[
  {
    "path": ".buckconfig",
    "content": "\n[android]\n  target = Google Inc.:Google APIs:23\n\n[download]\n  max_number_of_retries = 3\n\n[maven_repositories]\n  central = https://repo1.maven.org/maven2\n\n[alias]\n  rntester = //RNTester/android/app:app\n"
  },
  {
    "path": ".circleci/config.yml",
    "content": "aliases:\n  - &restore-node-cache\n    keys:\n      - v1-dependencies-{{ arch }}-{{ checksum \"package.json\" }}\n      # Fallback in case checksum fails\n      - v1-dependencies-{{ arch }}-\n\n  - &save-node-cache\n    paths:\n      - node_modules\n    key: v1-dependencies-{{ arch }}-{{ checksum \"package.json\" }}\n\n  - &restore-cache-analysis\n    keys:\n      - v1-analysis-dependencies-{{ arch }}-{{ checksum \"package.json\" }}{{ checksum \"danger/package.json\" }}\n      # Fallback in case checksum fails\n      - v1-analysis-dependencies-{{ arch }}-\n  - &save-cache-analysis\n    paths:\n      - danger/node_modules\n      - node_modules\n    key: v1-analysis-dependencies-{{ arch }}-{{ checksum \"package.json\" }}{{ checksum \"danger/package.json\" }}\n\n  - &restore-cache-android-packages\n    keys:\n      - v2-android-sdkmanager-packages-{{ arch }}-{{ checksum \"scripts/circle-ci-android-setup.sh\" }}\n      # Fallback in case checksum fails\n      - v2-android-sdkmanager-packages-{{ arch }}-\n  - &save-cache-android-packages\n    paths:\n      - /opt/android/sdk\n    key: v2-android-sdkmanager-packages-{{ arch }}-{{ checksum \"scripts/circle-ci-android-setup.sh\" }}\n\n  - &restore-cache-ndk\n    keys:\n      - v1-android-ndk-{{ arch }}-r10e-32-64\n\n  - &install-ndk\n    |\n      source scripts/circle-ci-android-setup.sh && getAndroidNDK\n\n  - &save-cache-ndk\n    paths:\n      - /opt/ndk\n    key: v1-android-ndk-{{ arch }}-r10e-32-64\n\n  - &restore-cache-buck\n    keys:\n      - v2-buck-{{ arch }}-v2017.11.16.01\n  - &save-cache-buck\n    paths:\n      - ~/buck\n    key: v2-buck-{{ arch }}-v2017.11.16.01\n\n  - &restore-cache-watchman\n    keys:\n      - v1-watchman-{{ arch }}-v4.9.0\n  - &save-cache-watchman\n    paths:\n      - ~/watchman\n    key: v1-watchman-{{ arch }}-v4.9.0\n\n  - &install-node-dependencies\n    |\n      npm install --no-package-lock --no-spin --no-progress\n\n  - &install-buck\n    |\n      if [[ ! -e ~/buck ]]; then\n        git clone https://github.com/facebook/buck.git ~/buck --branch v2017.11.16.01 --depth=1\n      fi\n      cd ~/buck && ant\n      buck --version\n\n  - &install-node\n    |\n      curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -\n      sudo apt-get install -y nodejs\n\n  - &run-node-tests\n    |\n      npm test -- --maxWorkers=2\n\n  - &run-lint-checks\n    |\n      npm run lint\n\n  - &run-flow-checks\n    |\n      npm run flow -- check\n\n\n  - &filter-only-master-stable\n    branches:\n      only:\n        - /.*-stable/\n        - master\n\n  - &filter-only-stable\n    branches:\n      only:\n        - /.*-stable/\n\n  - &filter-ignore-gh-pages\n    branches:\n      ignore: gh-pages\n\n  - &filter-ignore-master-stable\n    branches:\n      ignore:\n        - master\n        - /.*-stable/\n        - gh-pages\n\n  - &create-ndk-directory\n    |\n      if [[ ! -e /opt/ndk ]]; then\n        sudo mkdir /opt/ndk\n      fi\n      sudo chown ${USER:=$(/usr/bin/id -run)}:$USER /opt/ndk\n\n  # CircleCI does not support interpolating env variables in the environment\n  #  https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables\n  - &configure-android-path\n    |\n      echo 'export PATH=${ANDROID_NDK}:~/react-native/gradle-2.9/bin:~/buck/bin:$PATH' >> $BASH_ENV\n      source $BASH_ENV\n\n  - &install-android-packages\n    |\n      source scripts/circle-ci-android-setup.sh && getAndroidSDK\n\n  - &install-build-dependencies\n    |\n      sudo apt-get update -y\n      sudo apt-get install ant autoconf automake g++ gcc libqt5widgets5 lib32z1 lib32stdc++6  make maven python-dev python3-dev qml-module-qtquick-controls qtdeclarative5-dev file -y\n\n  - &build-android-app\n    name: Build Android App\n    command: |\n      buck build ReactAndroid/src/main/java/com/facebook/react\n      buck build ReactAndroid/src/main/java/com/facebook/react/shell\n\n  - &wait-for-avd\n    name: Wait for Android Virtual Device\n    command: source scripts/circle-ci-android-setup.sh && waitForAVD\n\n  - &check-js-bundle\n    name: Check for JavaScript Bundle\n    command: |\n      if [[ ! -e ReactAndroid/src/androidTest/assets/AndroidTestBundle.js ]]; then\n        echo \"JavaScript bundle missing, verify build-js-bundle step\"; exit 1;\n      else\n        echo \"JavaScript bundle found.\";\n      fi\n\n  - &compile-native-libs\n    name: Compile Native Libs for Unit and Integration Tests\n    command: ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=$BUILD_THREADS -Pcom.android.build.threadPoolSize=1\n    no_output_timeout: 6m\n\n  - &run-android-unit-tests\n    name: Unit Tests\n    command: buck test ReactAndroid/src/test/... --config build.threads=$BUILD_THREADS\n\n  - &run-android-integration-tests\n    name: Build and Install Test APK\n    command: source scripts/circle-ci-android-setup.sh && NO_BUCKD=1 retry3 buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS\n\n  - &collect-android-test-results\n    name: Collect Test Results\n    command: |\n      mkdir -p ~/junit/\n      find . -type f -regex \".*/build/test-results/debug/.*xml\" -exec cp {} ~/junit/ \\;\n      find . -type f -regex \".*/outputs/androidTest-results/connected/.*xml\" -exec cp {} ~/junit/ \\;\n    when: always\n\ndefaults: &defaults\n  working_directory: ~/react-native\n\nandroid_defaults: &android_defaults\n  <<: *defaults\n  docker:\n    - image: circleci/android:api-26-alpha\n  resource_class: \"large\"\n  environment:\n    - TERM: \"dumb\"\n    - ADB_INSTALL_TIMEOUT: 10\n    - _JAVA_OPTIONS: \"-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap\"\n    - GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=\"-XX:+HeapDumpOnOutOfMemoryError\"'\n    - ANDROID_NDK: '/opt/ndk/android-ndk-r10e'\n    - BUILD_THREADS: 2\n\nversion: 2\njobs:\n  # Runs JavaScript lint and flow checks\n  run-js-checks:\n    <<: *defaults\n    docker:\n      - image: circleci/node:8\n    steps:\n      - checkout\n      - restore-cache: *restore-node-cache\n      - run: *install-node-dependencies\n      - save-cache: *save-node-cache\n      - run: *run-lint-checks\n      - run: *run-flow-checks\n\n  # Runs JavaScript tests on Node 8\n  test-js-node-8:\n    <<: *defaults\n    docker:\n      - image: circleci/node:8\n    steps:\n      - checkout\n      - restore-cache: *restore-node-cache\n      - run: *install-node-dependencies\n      - save-cache: *save-node-cache\n      - run: *run-node-tests\n\n  # Runs JavaScript tests on Node 6\n  test-js-node-6:\n    <<: *defaults\n    docker:\n      - image: circleci/node:6\n    steps:\n      - checkout\n      - restore-cache: *restore-node-cache\n      - run: *install-node-dependencies\n      - save-cache: *save-node-cache\n      - run: *run-node-tests\n\n  # Runs unit tests on iOS devices\n  test-objc-ios:\n    <<: *defaults\n    macos:\n      xcode: \"9.0\"\n    dependencies:\n      pre:\n        - xcrun instruments -w \"iPhone 5s (10.3.1)\" || true\n    steps:\n      - checkout\n      - restore-cache: *restore-node-cache\n      - run: *install-node-dependencies\n      - save-cache: *save-node-cache\n      - run: ./scripts/objc-test-ios.sh\n\n  # Runs end to end tests\n  test-objc-e2e:\n    <<: *defaults\n    macos:\n      xcode: \"9.0\"\n    dependencies:\n      pre:\n        - xcrun instruments -w \"iPhone 5s (10.3.1)\" || true\n    steps:\n      - checkout\n      - restore-cache: *restore-node-cache\n      - run: *install-node-dependencies\n      - save-cache: *save-node-cache\n      - run: node ./scripts/run-ci-e2e-tests.js --ios --js --retries 3;\n\n  # # Checks podspec\n  # test-podspec:\n  #   <<: *defaults\n  #   macos:\n  #     xcode: \"9.0\"\n  #   steps:\n  #     - checkout\n  #     - restore-cache: *restore-node-cache\n  #     - run: *install-node-dependencies\n  #     - save-cache: *save-node-cache\n  #     - run: ./scripts/process-podspecs.sh\n  #\n  # # Publishes new version onto npm\n  # deploy:\n  #   <<: *android_defaults\n  #   steps:\n  #     - checkout\n  #\n  #     # Configure Android dependencies\n  #     - run: *configure-android-path\n  #     - run: *install-build-dependencies\n  #     - restore-cache: *restore-cache-android-packages\n  #     - run: *install-android-packages\n  #     - save-cache: *save-cache-android-packages\n  #     - run: *create-ndk-directory\n  #     - restore-cache: *restore-cache-ndk\n  #     - run: *install-ndk\n  #     - save-cache: *save-cache-ndk\n  #     - restore-cache: *restore-cache-buck\n  #     - run: *install-buck\n  #     - save-cache: *save-cache-buck\n  #     - run: *install-node\n  #     - restore-cache: *restore-node-cache\n  #     - run: *install-node-dependencies\n  #     - save-cache: *save-node-cache\n  #     - run: buck fetch ReactAndroid/src/test/java/com/facebook/react/modules\n  #     - run: buck fetch ReactAndroid/src/main/java/com/facebook/react\n  #     - run: buck fetch ReactAndroid/src/main/java/com/facebook/react/shell\n  #     - run: buck fetch ReactAndroid/src/test/...\n  #     - run: buck fetch ReactAndroid/src/androidTest/...\n  #     - run: ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSCHeaders\n  #\n  #     - run:\n  #         name: Publish React Native Package\n  #         command: |\n  #           if [ -z \"$CIRCLE_PULL_REQUEST\" ]; then\n  #             echo \"//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}\" > ~/.npmrc\n  #             git config --global user.email \"reactjs-bot@users.noreply.github.com\"\n  #             git config --global user.name \"npm Deployment Script\"\n  #             echo \"machine github.com login reactjs-bot password $GITHUB_TOKEN\" > ~/.netrc\n  #             node ./scripts/publish-npm.js\n  #           else\n  #             echo \"Skipping deploy.\"\n  #           fi\n\n# Workflows enables us to run multiple jobs in parallel\nworkflows:\n  version: 2\n\n  build:\n    jobs:\n\n      # Run lint and flow checks\n      - run-js-checks:\n          filters: *filter-ignore-gh-pages\n\n      # Test JavaScript on Node 8 and 6\n      - test-js-node-8:\n          filters: *filter-ignore-gh-pages\n      - test-js-node-6:\n          filters: *filter-ignore-gh-pages\n\n      # Test iOS & tvOS\n      - test-objc-ios:\n          filters: *filter-ignore-gh-pages\n      - test-objc-e2e:\n          filters: *filter-ignore-gh-pages\n\n      # # If we are on a stable branch, deploy to `npm`\n      # - hold:\n      #     type: approval\n      # - deploy:\n      #     filters: *filter-only-stable\n      #     requires:\n      #       - hold\n\n      - analyze-pull-request:\n          filters: *filter-ignore-master-stable\n"
  },
  {
    "path": ".editorconfig",
    "content": "# EditorConfig is awesome: http://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n# Unix-style newlines with a newline ending every file\n[*]\nend_of_line = lf\ninsert_final_newline = true\nindent_style = space\nindent_size = 2\n\n[*.gradle]\nindent_size = 4\n"
  },
  {
    "path": ".eslintignore",
    "content": "# node_modules ignored by default\n\n**/staticBundle.js\n**/main.js\nLibraries/vendor/**/*\nLibraries/Renderer/*\npr-inactivity-bookmarklet.js\nquestion-bookmarklet.js\nflow/\ndanger/\n"
  },
  {
    "path": ".eslintrc",
    "content": "{\n  \"root\": true,\n\n  \"parser\": \"babel-eslint\",\n\n  \"ecmaFeatures\": {\n    \"jsx\": true\n  },\n\n  \"env\": {\n    \"es6\": true,\n    \"jest\": true,\n  },\n\n  \"plugins\": [\n    \"eslint-comments\",\n    \"flowtype\",\n    \"prettier\",\n    \"react\",\n    \"jest\"\n  ],\n\n  // Map from global var to bool specifying if it can be redefined\n  \"globals\": {\n    \"__DEV__\": true,\n    \"__dirname\": false,\n    \"__fbBatchedBridgeConfig\": false,\n    \"alert\": false,\n    \"cancelAnimationFrame\": false,\n    \"cancelIdleCallback\": false,\n    \"clearImmediate\": true,\n    \"clearInterval\": false,\n    \"clearTimeout\": false,\n    \"console\": false,\n    \"document\": false,\n    \"escape\": false,\n    \"Event\": false,\n    \"EventTarget\": false,\n    \"exports\": false,\n    \"fetch\": false,\n    \"FormData\": false,\n    \"global\": false,\n    \"jest\": false,\n    \"Map\": true,\n    \"module\": false,\n    \"navigator\": false,\n    \"process\": false,\n    \"Promise\": true,\n    \"requestAnimationFrame\": true,\n    \"requestIdleCallback\": true,\n    \"require\": false,\n    \"Set\": true,\n    \"setImmediate\": true,\n    \"setInterval\": false,\n    \"setTimeout\": false,\n    \"window\": false,\n    \"XMLHttpRequest\": false,\n    \"pit\": false\n  },\n\n  \"rules\": {\n  // General\n\n    // This must be disallowed in this repo because the minimum supported\n    // version of node is 4 which doesn't support trailing commas.\n    // Once the minimum supported version is 8 or greater this can be changed\n    \"comma-dangle\": [2, {            // disallow trailing commas in object literals\n        \"arrays\": \"ignore\",\n        \"objects\": \"ignore\",\n        \"imports\": \"ignore\",\n        \"exports\": \"ignore\",\n        \"functions\": \"never\"\n    }],\n\n    \"no-cond-assign\": 1,             // disallow assignment in conditional expressions\n    \"no-console\": 0,                 // disallow use of console (off by default in the node environment)\n    \"no-const-assign\": 2,            // disallow assignment to const-declared variables\n    \"no-constant-condition\": 0,      // disallow use of constant expressions in conditions\n    \"no-control-regex\": 1,           // disallow control characters in regular expressions\n    \"no-debugger\": 1,                // disallow use of debugger\n    \"no-dupe-keys\": 2,               // disallow duplicate keys when creating object literals\n    \"no-empty\": 0,                   // disallow empty statements\n    \"no-ex-assign\": 1,               // disallow assigning to the exception in a catch block\n    \"no-extra-boolean-cast\": 1,      // disallow double-negation boolean casts in a boolean context\n    \"no-extra-parens\": 0,            // disallow unnecessary parentheses (off by default)\n    \"no-extra-semi\": 1,              // disallow unnecessary semicolons\n    \"no-func-assign\": 1,             // disallow overwriting functions written as function declarations\n    \"no-inner-declarations\": 0,      // disallow function or variable declarations in nested blocks\n    \"no-invalid-regexp\": 1,          // disallow invalid regular expression strings in the RegExp constructor\n    \"no-negated-in-lhs\": 1,          // disallow negation of the left operand of an in expression\n    \"no-obj-calls\": 1,               // disallow the use of object properties of the global object (Math and JSON) as functions\n    \"no-regex-spaces\": 1,            // disallow multiple spaces in a regular expression literal\n    \"no-reserved-keys\": 0,           // disallow reserved words being used as object literal keys (off by default)\n    \"no-sparse-arrays\": 1,           // disallow sparse arrays\n    \"no-unreachable\": 2,             // disallow unreachable statements after a return, throw, continue, or break statement\n    \"use-isnan\": 1,                  // disallow comparisons with the value NaN\n    \"valid-jsdoc\": 0,                // Ensure JSDoc comments are valid (off by default)\n    \"valid-typeof\": 1,               // Ensure that the results of typeof are compared against a valid string\n\n  // Best Practices\n  // These are rules designed to prevent you from making mistakes. They either prescribe a better way of doing something or help you avoid footguns.\n\n    \"block-scoped-var\": 0,           // treat var statements as if they were block scoped (off by default)\n    \"complexity\": 0,                 // specify the maximum cyclomatic complexity allowed in a program (off by default)\n    \"consistent-return\": 0,          // require return statements to either always or never specify values\n    \"curly\": 1,                      // specify curly brace conventions for all control statements\n    \"default-case\": 0,               // require default case in switch statements (off by default)\n    \"dot-notation\": 1,               // encourages use of dot notation whenever possible\n    \"eqeqeq\": [1, \"allow-null\"],     // require the use of === and !==\n    \"guard-for-in\": 0,               // make sure for-in loops have an if statement (off by default)\n    \"no-alert\": 1,                   // disallow the use of alert, confirm, and prompt\n    \"no-caller\": 1,                  // disallow use of arguments.caller or arguments.callee\n    \"no-div-regex\": 1,               // disallow division operators explicitly at beginning of regular expression (off by default)\n    \"no-else-return\": 0,             // disallow else after a return in an if (off by default)\n    \"no-eq-null\": 0,                 // disallow comparisons to null without a type-checking operator (off by default)\n    \"no-eval\": 2,                    // disallow use of eval()\n    \"no-extend-native\": 1,           // disallow adding to native types\n    \"no-extra-bind\": 1,              // disallow unnecessary function binding\n    \"no-fallthrough\": 1,             // disallow fallthrough of case statements\n    \"no-floating-decimal\": 1,        // disallow the use of leading or trailing decimal points in numeric literals (off by default)\n    \"no-implied-eval\": 1,            // disallow use of eval()-like methods\n    \"no-labels\": 1,                  // disallow use of labeled statements\n    \"no-iterator\": 1,                // disallow usage of __iterator__ property\n    \"no-lone-blocks\": 1,             // disallow unnecessary nested blocks\n    \"no-loop-func\": 0,               // disallow creation of functions within loops\n    \"no-multi-str\": 0,               // disallow use of multiline strings\n    \"no-native-reassign\": 0,         // disallow reassignments of native objects\n    \"no-new\": 1,                     // disallow use of new operator when not part of the assignment or comparison\n    \"no-new-func\": 2,                // disallow use of new operator for Function object\n    \"no-new-wrappers\": 1,            // disallows creating new instances of String,Number, and Boolean\n    \"no-octal\": 1,                   // disallow use of octal literals\n    \"no-octal-escape\": 1,            // disallow use of octal escape sequences in string literals, such as var foo = \"Copyright \\251\";\n    \"no-proto\": 1,                   // disallow usage of __proto__ property\n    \"no-redeclare\": 0,               // disallow declaring the same variable more then once\n    \"no-return-assign\": 1,           // disallow use of assignment in return statement\n    \"no-script-url\": 1,              // disallow use of javascript: urls.\n    \"no-self-compare\": 1,            // disallow comparisons where both sides are exactly the same (off by default)\n    \"no-sequences\": 1,               // disallow use of comma operator\n    \"no-unused-expressions\": 0,      // disallow usage of expressions in statement position\n    \"no-void\": 1,                    // disallow use of void operator (off by default)\n    \"no-warning-comments\": 0,        // disallow usage of configurable warning terms in comments\": 1,                        // e.g. TODO or FIXME (off by default)\n    \"no-with\": 1,                    // disallow use of the with statement\n    \"radix\": 1,                      // require use of the second argument for parseInt() (off by default)\n    \"semi-spacing\": 1,\t             // require a space after a semi-colon\n    \"vars-on-top\": 0,                // requires to declare all vars on top of their containing scope (off by default)\n    \"wrap-iife\": 0,                  // require immediate function invocation to be wrapped in parentheses (off by default)\n    \"yoda\": 1,                       // require or disallow Yoda conditions\n\n  // Variables\n  // These rules have to do with variable declarations.\n\n    \"no-catch-shadow\": 1,            // disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment)\n    \"no-delete-var\": 1,              // disallow deletion of variables\n    \"no-label-var\": 1,               // disallow labels that share a name with a variable\n    \"no-shadow\": 1,                  // disallow declaration of variables already declared in the outer scope\n    \"no-shadow-restricted-names\": 1, // disallow shadowing of names such as arguments\n    \"no-undef\": 2,                   // disallow use of undeclared variables unless mentioned in a /*global */ block\n    \"no-undefined\": 0,               // disallow use of undefined variable (off by default)\n    \"no-undef-init\": 1,              // disallow use of undefined when initializing variables\n    \"no-unused-vars\": [1, {\"vars\": \"all\", \"args\": \"none\"}], // disallow declaration of variables that are not used in the code\n    \"no-use-before-define\": 0,       // disallow use of variables before they are defined\n\n  // Node.js\n  // These rules are specific to JavaScript running on Node.js.\n\n    \"handle-callback-err\": 1,        // enforces error handling in callbacks (off by default) (on by default in the node environment)\n    \"no-mixed-requires\": 1,          // disallow mixing regular variable and require declarations (off by default) (on by default in the node environment)\n    \"no-new-require\": 1,             // disallow use of new operator with the require function (off by default) (on by default in the node environment)\n    \"no-path-concat\": 1,             // disallow string concatenation with __dirname and __filename (off by default) (on by default in the node environment)\n    \"no-process-exit\": 0,            // disallow process.exit() (on by default in the node environment)\n    \"no-restricted-modules\": 1,      // restrict usage of specified node modules (off by default)\n    \"no-sync\": 0,                    // disallow use of synchronous methods (off by default)\n\n  // ESLint Comments Plugin\n  // The following rules are made available via `eslint-plugin-eslint-comments`\n    'eslint-comments/no-aggregating-enable': 1, // disallows eslint-enable comments for multiple eslint-disable comments\n    'eslint-comments/no-unlimited-disable': 1, // disallows eslint-disable comments without rule names\n    'eslint-comments/no-unused-disable': 1, // disallow disables that don't cover any errors\n    'eslint-comments/no-unused-enable': 1, // // disallow enables that don't enable anything or enable rules that weren't disabled\n\n  // Flow Plugin\n  // The following rules are made available via `eslint-plugin-flowtype`\n    \"flowtype/define-flow-type\": 1,\n    \"flowtype/use-flow-type\": 1,\n\n  // Prettier Plugin\n  // https://github.com/prettier/eslint-plugin-prettier\n    \"prettier/prettier\": [2, \"fb\", \"@format\"],\n\n  // Stylistic Issues\n  // These rules are purely matters of style and are quite subjective.\n\n    \"key-spacing\": 0,\n    \"keyword-spacing\": 1,            // enforce spacing before and after keywords\n    \"jsx-quotes\": [1, \"prefer-double\"], // enforces the usage of double quotes for all JSX attribute values which doesn’t contain a double quote\n    \"comma-spacing\": 0,\n    \"no-multi-spaces\": 0,\n    \"brace-style\": 0,                // enforce one true brace style (off by default)\n    \"camelcase\": 0,                  // require camel case names\n    \"consistent-this\": 1,            // enforces consistent naming when capturing the current execution context (off by default)\n    \"eol-last\": 1,                   // enforce newline at the end of file, with no multiple empty lines\n    \"func-names\": 0,                 // require function expressions to have a name (off by default)\n    \"func-style\": 0,                 // enforces use of function declarations or expressions (off by default)\n    \"new-cap\": 0,                    // require a capital letter for constructors\n    \"new-parens\": 1,                 // disallow the omission of parentheses when invoking a constructor with no arguments\n    \"no-nested-ternary\": 0,          // disallow nested ternary expressions (off by default)\n    \"no-array-constructor\": 1,       // disallow use of the Array constructor\n    'no-empty-character-class': 1,   // disallow the use of empty character classes in regular expressions\n    \"no-lonely-if\": 0,               // disallow if as the only statement in an else block (off by default)\n    \"no-new-object\": 1,              // disallow use of the Object constructor\n    \"no-spaced-func\": 1,             // disallow space between function identifier and application\n    \"no-ternary\": 0,                 // disallow the use of ternary operators (off by default)\n    \"no-trailing-spaces\": 1,         // disallow trailing whitespace at the end of lines\n    \"no-underscore-dangle\": 0,       // disallow dangling underscores in identifiers\n    \"no-mixed-spaces-and-tabs\": 1,   // disallow mixed spaces and tabs for indentation\n    \"quotes\": [1, \"single\", \"avoid-escape\"], // specify whether double or single quotes should be used\n    \"quote-props\": 0,                // require quotes around object literal property names (off by default)\n    \"semi\": 1,                       // require or disallow use of semicolons instead of ASI\n    \"sort-vars\": 0,                  // sort variables within the same declaration block (off by default)\n    \"space-in-brackets\": 0,          // require or disallow spaces inside brackets (off by default)\n    \"space-in-parens\": 0,            // require or disallow spaces inside parentheses (off by default)\n    \"space-infix-ops\": 1,            // require spaces around operators\n    \"space-unary-ops\": [1, { \"words\": true, \"nonwords\": false }], // require or disallow spaces before/after unary operators (words on by default, nonwords off by default)\n    \"max-nested-callbacks\": 0,       // specify the maximum depth callbacks can be nested (off by default)\n    \"one-var\": 0,                    // allow just one var statement per function (off by default)\n    \"wrap-regex\": 0,                 // require regex literals to be wrapped in parentheses (off by default)\n\n  // Legacy\n  // The following rules are included for compatibility with JSHint and JSLint. While the names of the rules may not match up with the JSHint/JSLint counterpart, the functionality is the same.\n\n    \"max-depth\": 0,                  // specify the maximum depth that blocks can be nested (off by default)\n    \"max-len\": 0,                    // specify the maximum length of a line in your program (off by default)\n    \"max-params\": 0,                 // limits the number of parameters that can be used in the function declaration. (off by default)\n    \"max-statements\": 0,             // specify the maximum number of statement allowed in a function (off by default)\n    \"no-bitwise\": 1,                 // disallow use of bitwise operators (off by default)\n    \"no-plusplus\": 0,                // disallow use of unary operators, ++ and -- (off by default)\n\n  // React Plugin\n  // The following rules are made available via `eslint-plugin-react`.\n\n    \"react/display-name\": 0,\n    \"react/jsx-boolean-value\": 0,\n    \"react/jsx-no-comment-textnodes\": 1,\n    \"react/jsx-no-duplicate-props\": 2,\n    \"react/jsx-no-undef\": 2,\n    \"react/jsx-sort-props\": 0,\n    \"react/jsx-uses-react\": 1,\n    \"react/jsx-uses-vars\": 1,\n    \"react/no-did-mount-set-state\": 1,\n    \"react/no-did-update-set-state\": 1,\n    \"react/no-multi-comp\": 0,\n    \"react/no-string-refs\": 1,\n    \"react/no-unknown-property\": 0,\n    \"react/prop-types\": 0,\n    \"react/react-in-jsx-scope\": 1,\n    \"react/self-closing-comp\": 1,\n    \"react/wrap-multilines\": 0,\n\n  // Jest Plugin\n  // The following rules are made available via `eslint-plugin-jest`.\n    \"jest/no-disabled-tests\": 1,\n    \"jest/no-focused-tests\": 1,\n    \"jest/no-identical-title\": 1,\n    \"jest/valid-expect\": 1,\n  }\n}\n"
  },
  {
    "path": ".flowconfig",
    "content": "[ignore]\n; We fork some components by platform\n.*/*[.]android.js\n.*/*[.]ios.js\n\n; Ignore templates for 'react-native init'\n.*/local-cli/templates/.*\n\n; Ignore the Dangerfile\n<PROJECT_ROOT>/danger/dangerfile.js\n\n; Ignore \"BUCK\" generated dirs\n<PROJECT_ROOT>/\\.buckd/\n\n; Ignore unexpected extra \"@providesModule\"\n.*/node_modules/.*/node_modules/fbjs/.*\n\n; Ignore duplicate module providers\n; For RN Apps installed via npm, \"Libraries\" folder is inside\n; \"node_modules/react-native\" but in the source repo it is in the root\n.*/Libraries/react-native/React.js\n\n; Ignore polyfills\n.*/Libraries/polyfills/.*\n\n; Ignore metro\n.*/node_modules/metro/.*\n\n[include]\n\n[libs]\nLibraries/react-native/react-native-interface.js\nflow/\nflow-github/\n\n[options]\nemoji=true\n\nmodule.system=haste\n\nmunge_underscores=true\n\nmodule.name_mapper='^[./a-zA-Z0-9$_-]+\\.\\(bmp\\|gif\\|jpg\\|jpeg\\|png\\|psd\\|svg\\|webp\\|m4v\\|mov\\|mp4\\|mpeg\\|mpg\\|webm\\|aac\\|aiff\\|caf\\|m4a\\|mp3\\|wav\\|html\\|pdf\\)$' -> 'RelativeImageStub'\nmodule.name_mapper='react-native' -> 'react-native-macos'\n\nsuppress_type=$FlowIssue\nsuppress_type=$FlowFixMe\nsuppress_type=$FlowFixMeProps\nsuppress_type=$FlowFixMeState\n\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowFixMe\\\\($\\\\|[^(]\\\\|(\\\\(<VERSION>\\\\)? *\\\\(site=[a-z,_]*[react_native_oss|react_native_fb][a-z,_]*\\\\)?)\\\\)\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowIssue\\\\((\\\\(<VERSION>\\\\)? *\\\\(site=[a-z,_]*[react_native_oss|react_native_fb][a-z,_]*\\\\)?)\\\\)?:? #[0-9]+\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowFixedInNextDeploy\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowExpectedError\n\n[version]\n^0.66.0\n"
  },
  {
    "path": ".gitattributes",
    "content": "# Force LF line endings for Bash scripts.   On Windows the rest of the source\n# files will typically have CR+LF endings (Git default on Windows), but Bash\n# scripts need to have LF endings to work (under Cygwin), thus override to force\n# that.\ngradlew text eol=lf\n*.sh text eol=lf\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug.md",
    "content": "---\nname: 🐛 Bug report\nlabels: \"bug\"\nabout: Create a report to help us improve\n---\n\n## 🐛 Bug Report\n\n(A clear and concise description of what the bug is.)\n\n## To Reproduce\n\nSteps to reproduce the behavior:\n\n## Expected Behavior\n\n(A clear and concise description of what you expected to happen.)\n\n## Minimal Reproduction\n\n(For bugs that cannot be reproduced within RNTester, please provide a [minimal](https://stackoverflow.com/help/mcve) repository.)\n\n## Environment\n\n- macOS v10.x.x\n- react-native-macos v0.x.x\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature.md",
    "content": "---\nname: 🚀 Feature Proposal\nlabels: \"proposal\"\nabout: Submit a proposal for a new feature\n---\n\n## 🚀 Feature Proposal\n\n(A clear and concise description of what the feature is.)\n\n## Motivation\n\n(Please outline the motivation for the proposal.)\n\n## Example\n\n(Please provide an example for how this feature would be used.)\n"
  },
  {
    "path": ".gitignore",
    "content": "# Xcode\n!**/*.xcodeproj\n!**/*.pbxproj\n!**/*.xcworkspacedata\n!**/*.xcsettings\n!**/*.xcscheme\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\nproject.xcworkspace\n\n# Gradle\n/build/\n/RNTester/android/app/build/\n/RNTester/android/app/gradle/\n/RNTester/android/app/gradlew\n/RNTester/android/app/gradlew.bat\n/ReactAndroid/build/\n\n# Buck\n.buckd\nbuck-out\n/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/\n/ReactAndroid/src/main/jni/prebuilt/lib/x86/\n/ReactAndroid/src/main/gen\n\n# Android\n.idea\n.gradle\nlocal.properties\n*.iml\n/android/\n\n# Node\nnode_modules\n*.log\n.nvm\n/danger/node_modules/\n\n# OS X\n.DS_Store\n*.tgz\n\n# Test generated files\n/ReactAndroid/src/androidTest/assets/AndroidTestBundle.js\n*.js.meta\n\n/coverage\n/third-party\n"
  },
  {
    "path": ".npmignore",
    "content": "# rnpm\n/local-cli/rnpm\n/local-cli/server/middleware/heapCapture/bundle.js\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# [Open Source Code of Conduct](https://code.facebook.com/codeofconduct)\n\nThis code of conduct outlines our expectations for participants within the **Facebook Open Source** community, as well as steps to reporting unacceptable behavior. We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored. Anyone who violates this code of conduct may be banned from the community.\n\nOur open source community strives to:\n\n* **Be friendly and patient.**\n* **Be welcoming:** We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.\n* **Be considerate:** Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we’re a world-wide community, so you might not be communicating in someone else’s primary language.\n* **Be respectful:** Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one.\n* **Be careful in the words that you choose:** we are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren’t acceptable. This includes, but is not limited to:\n  * Violent threats or language directed against another person.\n  * Discriminatory jokes and language.\n  * Posting sexually explicit or violent material.\n  * Posting (or threatening to post) other people’s personally identifying information (“doxing”).\n  * Personal insults, especially those using racist or sexist terms.\n  * Unwelcome sexual attention.\n  * Advocating for, or encouraging, any of the above behavior.\n  * Repeated harassment of others. In general, if someone asks you to stop, then stop.\n* **When we disagree, try to understand why:** Disagreements, both social and technical, happen all the time. It is important that we resolve disagreements and differing views constructively.\n* **Remember that we’re different.** The strength of our community comes from its diversity, people from a wide range of backgrounds. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes.\n\nThis code is not exhaustive or complete. It serves to distill our common understanding of a collaborative, shared environment, and goals. We expect it to be followed in spirit as much as in the letter.\n\n## Diversity Statement\n\nWe encourage everyone to participate and are committed to building a community for all. Although we may not be able to satisfy everyone, we all agree that everyone is equal. Whenever a participant has made a mistake, we expect them to take responsibility for it. If someone has been harmed or offended, it is our responsibility to listen carefully and respectfully, and do our best to right the wrong.\n\nAlthough this list cannot be exhaustive, we explicitly honor diversity in age, gender, gender identity or expression, culture, ethnicity, language, national origin, political beliefs, profession, race, religion, sexual orientation, socioeconomic status, and technical ability. We will not tolerate discrimination based on any of the protected characteristics above, including participants with disabilities.\n\n## Reporting Issues\n\nIf you experience or witness unacceptable behavior—or have any other concerns—please report it by contacting us via opensource@fb.com. All reports will be handled with discretion. In your report please include:\n\n* Your contact information.\n* Names (real, nicknames, or pseudonyms) of any individuals involved. If there are additional witnesses, please include them as well. Your account of what occurred, and if you believe the incident is ongoing. If there is a publicly available record (e.g. a mailing list archive or a public IRC logger), please include a link.\n* Any additional information that may be helpful.\n\nAfter filing a report, a representative will contact you personally. If the person who is harassing you is part of the response team, they will recuse themselves from handling your incident. A representative will then review the incident, follow up with any additional questions, and make a decision as to how to respond. We will respect confidentiality requests for the purpose of protecting victims of abuse.\n\nAnyone asked to stop unacceptable behavior is expected to comply immediately. If an individual engages in unacceptable behavior, the representative may take any action they deem appropriate, up to and including a permanent ban from our community without warning.\n\n_This Code Of Conduct follows the [template](http://todogroup.org/opencodeofconduct/) established by the [TODO Group](http://todogroup.org/)._\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to React Native\n\n<!-- generated_contributing_start -->\nReact Native is one of Facebook's first open source projects that is both under very active development and is also being used to ship code to everybody using Facebook's mobile apps. If you're interested in contributing to React Native, hopefully this document makes the process for contributing clear.\n\n## [Code of Conduct](https://code.facebook.com/codeofconduct)\n\nFacebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read [the full text](https://code.facebook.com/codeofconduct) so that you can understand what actions will and will not be tolerated.\n\n## Get involved\n\nThere are many ways to contribute to React Native, and many of them do not involve writing any code. Here's a few ideas to get started:\n\n* Simply start using React Native. Go through the [Getting Started](https://facebook.github.io/react-native/docs/getting-started.html) guide. Does everything work as expected? If not, we're always looking for improvements. Let us know by [opening an issue](https://facebook.github.io/react-native/docs/contributing.html#reporting-new-issues).\n* Look through the [open issues](https://github.com/facebook/react-native/issues). Provide workarounds, ask for clarification, or suggest labels. Help [triage issues](https://facebook.github.io/react-native/docs/contributing.html#triaging-issues-and-pull-requests).\n* If you find an issue you would like to fix, [open a pull request](https://facebook.github.io/react-native/docs/contributing.html#your-first-pull-request). Issues tagged as [_Good first issue_](https://github.com/facebook/react-native/labels/Good%20first%20issue) are a good place to get started.\n* Read through the [React Native docs](https://facebook.github.io/react-native/docs/getting-started.html). If you find anything that is confusing or can be improved, you can make edits by clicking \"Improve this page\" at the bottom of most docs.\n* Browse [Stack Overflow](https://stackoverflow.com/questions/tagged/react-native) and answer questions. This will help you get familiarized with common pitfalls or misunderstandings, which can be useful when contributing updates to the documentation.\n* Take a look at the [features requested](https://react-native.canny.io/feature-requests) by others in the community and consider opening a pull request if you see something you want to work on.\n\nContributions are very welcome. If you think you need help planning your contribution, please hop into [#react-native](https://discord.gg/0ZcbPKXt5bZjGY5n) and let people know you're looking for a mentor.\n\nCore contributors to React Native meet monthly and post their meeting notes on the [React Native blog](https://facebook.github.io/react-native/blog). You can also find ad hoc discussions in the [React Native Core Contributors](https://www.facebook.com/groups/reactnativeoss/) Facebook group.\n\n### Triaging issues and pull requests\n\nOne great way you can contribute to the project without writing any code is to help triage issues and pull requests as they come in.\n\n* Ask for more information if the issue does not provide all the details required by the template.\n* Suggest [labels](https://github.com/facebook/react-native/labels) that can help categorize issues.\n* Flag issues that are stale or that should be closed.\n* Ask for test plans and review code.\n\nYou can learn more about handling issues in the [maintainer's guide](docs/maintainers.html#handling-issues).\n\n## Our development process\n\nSome of the core team will be working directly on [GitHub](https://github.com/facebook/react-native). These changes will be public from the beginning. Other changesets will come via a bridge with Facebook's internal source control. This is a necessity as it allows engineers at Facebook outside of the core team to move fast and contribute from an environment they are comfortable in.\n\nWhen a change made on GitHub is approved, it will first be imported into Facebook's internal source control. The change will eventually sync back to GitHub as a single commit once it has passed all internal tests.\n\n### Branch organization\n\nWe will do our best to keep `master` in good shape, with tests passing at all times. But in order to move fast, we will make API changes that your application might not be compatible with. We will do our best to [communicate these changes](https://github.com/facebook/react-native/releases) and version appropriately so you can lock into a specific version if need be.\n\nTo see what changes are coming and provide better feedback to React Native contributors, use the [latest release candidate](https://facebook.github.io/react-native/versions.html) when possible. By the time a release candidate is released, the changes it contains will have been shipped in production Facebook apps for over two weeks.\n\n## Bugs\n\nWe use [GitHub Issues](https://github.com/facebook/react-native/issues) for our public bugs. If you would like to report a problem, take a look around and see if someone already opened an issue about it. If you a are certain this is a new, unreported bug, you can submit a [bug report](https://facebook.github.io/react-native/docs/contributing.html#reporting-new-issues).\n\nIf you have questions about using React Native, the [Community page](https://facebook.github.io/react-native/help.html) list various resources that should help you get started.\n\nWe also have a [place where you can request features or enhancements](https://react-native.canny.io/feature-requests). If you see anything you'd like to be implemented, vote it up and explain your use case.\n\n## Reporting new issues\n\nWhen [opening a new issue](https://github.com/facebook/react-native/issues/new), always make sure to fill out the [issue template](https://raw.githubusercontent.com/facebook/react-native/master/.github/ISSUE_TEMPLATE.md). **This step is very important!** Not doing so may result in your issue getting closed. Don't take this personally if this happens, and feel free to open a new issue once you've gathered all the information required by the template.\n\n* **One issue, one bug:** Please report a single bug per issue.\n* **Provide a Snack:** The best way to get attention on your issue is to provide a reduced test case. You can use [Snack](https://snack.expo.io/) to demonstrate the issue.\n* **Provide reproduction steps:** List all the steps necessary to reproduce the issue. Provide a Snack or upload a sample project to GitHub. The person reading your bug report should be able to follow these steps to reproduce your issue with minimal effort.\n* **Try out the latest version:** Verify that the issue can be reproduced locally by updating your project to use [React Native from `master`](https://facebook.github.io/react-native/versions.html). The bug may have already been fixed!\n\nWe're not able to provide support through GitHub Issues. If you're looking for help with your code, consider asking on [Stack Overflow](https://stackoverflow.com/questions/tagged/react-native) or reaching out to the community through [other channels](https://facebook.github.io/react-native/support.html).\n\n### Security bugs\n\nFacebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. With that in mind, please do not file public issues; go through the process outlined on that page.\n\n## Pull requests\n\n### Your first pull request\n\nSo you have decided to contribute code back to upstream by opening a pull request. You've invested a good chunk of time, and we appreciate it. We will do our best to work with you and get the PR looked at.\n\nWorking on your first Pull Request? You can learn how from this free video series:\n\n[**How to Contribute to an Open Source Project on GitHub**](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)\n\nWe have a list of [beginner friendly issues](https://github.com/facebook/react-native/labels/Good%20First%20Task) to help you get your feet wet in the React Native codebase and familiar with our contribution process. This is a great place to get started.\n\n### Proposing a change\n\nIf you would like to request a new feature or enhancement but are not yet thinking about opening a pull request, we have a [place to track feature requests](https://react-native.canny.io/feature-requests).\n\nIf you intend to change the public API, or make any non-trivial changes to the implementation, we recommend [filing an issue](https://github.com/facebook/react-native/issues/new?title=%5BProposal%5D) that includes `[Proposal]` in the title. This lets us reach an agreement on your proposal before you put significant effort into it. These types of issues should be rare. If you have been contributing to the project long enough, you will probably already have access to the [React Native Core Contributors](https://www.facebook.com/groups/reactnativeoss/) Facebook Group, where this sort of discussion is usually held.\n\nIf you're only fixing a bug, it's fine to submit a pull request right away but we still recommend to file an issue detailing what you're fixing. This is helpful in case we don't accept that specific fix but want to keep track of the issue.\n\n### Sending a pull request\n\nSmall pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.\n\nPlease make sure the following is done when submitting a pull request:\n\n1. Fork [the repository](https://github.com/facebook/react-native) and create your branch from `master`.\n2. Add the copyright notice to the top of any new files you've added.\n3. Describe your [**test plan**](https://facebook.github.io/react-native/docs/contributing.html#test-plan) in your pull request description. Make sure to [test your changes](https://facebook.github.io/react-native/docs/testing.html)!\n4. Make sure your code lints (`npm run lint`).\n5. If you haven't already, [sign the CLA](https://code.facebook.com/cla).\n\nAll pull requests should be opened against the `master` branch. After opening your pull request, ensure [**all tests pass**](https://facebook.github.io/react-native/docs/contributing.html#contrinuous-integration-tests) on Circle CI. If a test fails and you believe it is unrelated to your change, leave a comment on the pull request explaining why.\n\n> **Note:** It is not necessary to keep clicking `Merge master to your branch` on the PR page. You would want to merge master if there are conflicts or tests are failing. The Facebook-GitHub-Bot ultimately squashes all commits to a single one before merging your PR.\n\n#### Test plan\n\nA good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI.\n\n* If you've added code that should be tested, add tests!\n* If you've changed APIs, update the documentation.\n\nSee [What is a Test Plan?](https://medium.com/@martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9) to learn more.\n\n#### Continuous integration tests\n\nMake sure all **tests pass** on [Circle CI][circle]. PRs that break tests are unlikely to be merged. Learn more about [testing your changes here](https://facebook.github.io/react-native/docs/testing.html).\n\n[circle]: https://circleci.com/gh/facebook/react-native\n\n#### Breaking changes\n\nWhen adding a new breaking change, follow this template in your pull request:\n\n```\n### New breaking change here\n\n* **Who does this affect**:\n* **How to migrate**:\n* **Why make this breaking change**:\n* **Severity (number of people affected x effort)**:\n```\n\nIf your pull request is merged, a core contributor will update the [list of breaking changes](https://github.com/facebook/react-native/wiki/Breaking-Changes) which is then used to populate the release notes.\n\n#### Copyright Notice for files\n\nCopy and paste this to the top of your new file(s):\n\n```JS\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n```\n\nIf you've added a new module, add a `@providesModule <moduleName>` at the end of the comment. This will allow the haste package manager to find it.\n\n#### Contributor License Agreement (CLA)\n\nIn order to accept your pull request, we need you to submit a CLA. You only need to do this once, so if you've done this for another Facebook open source project, you're good to go. If you are submitting a pull request for the first time, the Facebook GitHub Bot will reply with a link to the CLA form. You may also [complete your CLA here](https://code.facebook.com/cla).\n\n### What happens next?\n\nThe core team will be monitoring for pull requests. Read [what to expect from maintainers](https://facebook.github.io/react-native/docs/maintainers.html#handling-pull-requests) to understand what may happen after you open a pull request.\n\n## Style Guide\n\nOur linter will catch most styling issues that may exist in your code. You can check the status of your code styling by simply running `npm run lint`.\n\nHowever, there are still some styles that the linter cannot pick up.\n\n### Code Conventions\n\n#### General\n\n* **Most important: Look around.** Match the style you see used in the rest of the project. This includes formatting, naming things in code, naming things in documentation.\n* Add trailing commas,\n* 2 spaces for indentation (no tabs)\n* \"Attractive\"\n\n#### JavaScript\n\n* Use semicolons;\n* ES6 standards\n* Prefer `'` over `\"`\n* Do not use the optional parameters of `setTimeout` and `setInterval`\n* 80 character line length\n\n#### JSX\n\n* Prefer `\"` over `'` for string literal props\n* When wrapping opening tags over multiple lines, place one prop per line\n* `{}` of props should hug their values (no spaces)\n* Place the closing `>` of opening tags on the same line as the last prop\n* Place the closing `/>` of self-closing tags on their own line and left-align them with the opening `<`\n\n#### Objective-C\n\n* Space after `@property` declarations\n* Brackets on *every* `if`, on the *same* line\n* `- method`, `@interface`, and `@implementation` brackets on the following line\n* *Try* to keep it around 80 characters line length (sometimes it's just not possible...)\n* `*` operator goes with the variable name (e.g. `NSObject *variableName;`)\n\n#### Java\n\n* If a method call spans multiple lines closing bracket is on the same line as the last argument.\n* If a method header doesn't fit on one line each argument goes on a separate line.\n* 100 character line length\n\n### Documentation\n\n* Do not wrap lines at 80 characters - configure your editor to soft-wrap when editing documentation.\n\n## License\n\nBy contributing to React Native, you agree that your contributions will be licensed under its BSD license.\n<!-- generated_contributing_end -->\n"
  },
  {
    "path": "ContainerShip/Dockerfile.android",
    "content": "FROM hramos/android-base:latest\n\n# set default environment variables\nENV GRADLE_OPTS=\"-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=\\\"-Xmx512m -XX:+HeapDumpOnOutOfMemoryError\\\"\"\nENV JAVA_TOOL_OPTIONS=\"-Dfile.encoding=UTF8\"\n\n# add ReactAndroid directory\nADD .buckconfig /app/.buckconfig\nADD .buckjavaargs /app/.buckjavaargs\nADD ReactAndroid /app/ReactAndroid\nADD ReactCommon /app/ReactCommon\nADD keystores /app/keystores\n\n# set workdir\nWORKDIR /app\n\n# run buck fetches\nRUN buck fetch ReactAndroid/src/test/java/com/facebook/react/modules\nRUN buck fetch ReactAndroid/src/main/java/com/facebook/react\nRUN buck fetch ReactAndroid/src/main/java/com/facebook/react/shell\nRUN buck fetch ReactAndroid/src/test/...\nRUN buck fetch ReactAndroid/src/androidTest/...\n\n# build app\nRUN buck build ReactAndroid/src/main/java/com/facebook/react\nRUN buck build ReactAndroid/src/main/java/com/facebook/react/shell\n\nADD gradle /app/gradle\nADD gradlew /app/gradlew\nADD settings.gradle /app/settings.gradle\nADD build.gradle /app/build.gradle\nADD react.gradle /app/react.gradle\n\n# run gradle downloads\nRUN ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSCHeaders\n\n# compile native libs with Gradle script, we need bridge for unit and integration tests\nRUN ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=1 -Pcom.android.build.threadPoolSize=1\n\n# add all react-native code\nADD . /app\nWORKDIR /app\n\n# https://github.com/npm/npm/issues/13306\nRUN cd $(npm root -g)/npm && npm install fs-extra && sed -i -e s/graceful-fs/fs-extra/ -e s/fs.rename/fs.move/ ./lib/utils/rename.js\n\n# build node dependencies\nRUN npm install\n\nWORKDIR /app\n"
  },
  {
    "path": "ContainerShip/Dockerfile.android-base",
    "content": "FROM library/ubuntu:16.04\n\n# set default build arguments\nARG ANDROID_TOOLS_VERSION=25.2.5\nARG BUCK_VERSION=v2017.11.16.01\nARG NDK_VERSION=10e\nARG NODE_VERSION=6.2.0\nARG WATCHMAN_VERSION=4.7.0\n\n# set default environment variables\nENV ADB_INSTALL_TIMEOUT=10\nENV PATH=${PATH}:/opt/buck/bin/\nENV ANDROID_HOME=/opt/android\nENV ANDROID_SDK_HOME=${ANDROID_HOME}\nENV PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools\nENV ANDROID_NDK=/opt/ndk/android-ndk-r$NDK_VERSION\nENV PATH=${PATH}:${ANDROID_NDK}\n\n# install system dependencies\nRUN apt-get update && apt-get install ant autoconf automake curl g++ gcc git libqt5widgets5 lib32z1 lib32stdc++6 make maven npm openjdk-8* python-dev python3-dev qml-module-qtquick-controls qtdeclarative5-dev unzip -y\n\n# configure npm\nRUN npm config set spin=false\nRUN npm config set progress=false\n\n# install node\nRUN npm install n -g\nRUN n $NODE_VERSION\n\n# download buck\nRUN git clone https://github.com/facebook/buck.git /opt/buck --branch $BUCK_VERSION --depth=1\nWORKDIR /opt/buck\n\n# build buck\nRUN ant\n\n# download watchman\nRUN git clone https://github.com/facebook/watchman.git /opt/watchman\nWORKDIR /opt/watchman\nRUN git checkout v$WATCHMAN_VERSION\n\n# build watchman\nRUN ./autogen.sh\nRUN ./configure\nRUN make\nRUN make install\n\n# Full reference at https://dl.google.com/android/repository/repository2-1.xml\n# download and unpack android\nRUN mkdir /opt/android\nWORKDIR /opt/android\nRUN curl --silent https://dl.google.com/android/repository/tools_r$ANDROID_TOOLS_VERSION-linux.zip > android.zip\nRUN unzip android.zip\nRUN rm android.zip\n\n# download and unpack NDK\nRUN mkdir /opt/ndk\nWORKDIR /opt/ndk\nRUN curl --silent https://dl.google.com/android/repository/android-ndk-r$NDK_VERSION-linux-x86_64.zip > ndk.zip\nRUN unzip ndk.zip\n\n# cleanup NDK\nRUN rm ndk.zip\n\n# Add android SDK tools\nRUN echo \"y\" | sdkmanager \"system-images;android-19;google_apis;armeabi-v7a\"\nRUN echo \"y\" | sdkmanager \"platforms;android-23\"\nRUN echo \"y\" | sdkmanager \"platforms;android-19\"\nRUN echo \"y\" | sdkmanager \"build-tools;23.0.1\"\nRUN echo \"y\" | sdkmanager \"add-ons;addon-google_apis-google-23\"\nRUN echo \"y\" | sdkmanager \"extras;android;m2repository\"\n\n# Link adb executable\nRUN ln -s /opt/android/platform-tools/adb /usr/bin/adb\n\n# clean up unnecessary directories\nRUN rm -rf /opt/android/system-images/android-19/default/x86\n"
  },
  {
    "path": "ContainerShip/Dockerfile.javascript",
    "content": "FROM library/node:6.9.2\n\nENV YARN_VERSION=0.27.5\n\n# install dependencies\nRUN apt-get update && apt-get install ocaml libelf-dev -y\nRUN npm install yarn@$YARN_VERSION -g\n\n# add code\nRUN mkdir /app\nADD . /app\n\nWORKDIR /app\nRUN yarn install --ignore-engines\n\nWORKDIR website\nRUN yarn install --ignore-engines --ignore-platform\n\nWORKDIR /app\n"
  },
  {
    "path": "ContainerShip/scripts/run-android-ci-instrumentation-tests.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\n/**\n * This script runs instrumentation tests one by one with retries\n * Instrumentation tests tend to be flaky, so rerunning them individually increases\n * chances for success and reduces total average execution time.\n *\n * We assume that all instrumentation tests are flat in one folder\n * Available arguments:\n * --path - path to all .java files with tests\n * --package - com.facebook.react.tests\n * --retries [num] - how many times to retry possible flaky commands: npm install and running tests, default 1\n */\n\nconst argv = require('yargs').argv;\nconst async = require('async');\nconst child_process = require('child_process');\nconst fs = require('fs');\nconst path = require('path');\n\nconst colors = {\n    GREEN: '\\x1b[32m',\n    RED: '\\x1b[31m',\n    RESET: '\\x1b[0m'\n};\n\nconst test_opts = {\n    FILTER: new RegExp(argv.filter || '.*', 'i'),\n    IGNORE: argv.ignore || null,\n    PACKAGE: argv.package || 'com.facebook.react.tests',\n    PATH: argv.path || './ReactAndroid/src/androidTest/java/com/facebook/react/tests',\n    RETRIES: parseInt(argv.retries || 2, 10),\n\n    TEST_TIMEOUT: parseInt(argv['test-timeout'] || 1000 * 60 * 10),\n\n    OFFSET: argv.offset,\n    COUNT: argv.count\n};\n\nlet max_test_class_length = Number.NEGATIVE_INFINITY;\n\nlet testClasses = fs.readdirSync(path.resolve(process.cwd(), test_opts.PATH))\n    .filter((file) => {\n        return file.endsWith('.java');\n    }).map((clazz) => {\n        return path.basename(clazz, '.java');\n    });\n\nif (test_opts.IGNORE) {\n    test_opts.IGNORE = new RegExp(test_opts.IGNORE, 'i');\n    testClasses = testClasses.filter(className => {\n        return !test_opts.IGNORE.test(className);\n    });\n}\n\ntestClasses = testClasses.map((clazz) => {\n    return test_opts.PACKAGE + '.' + clazz;\n}).filter((clazz) => {\n    return test_opts.FILTER.test(clazz);\n});\n\n// only process subset of the tests at corresponding offset and count if args provided\nif (test_opts.COUNT != null && test_opts.OFFSET != null) {\n    const testCount = testClasses.length;\n    const start = test_opts.COUNT * test_opts.OFFSET;\n    const end = start + test_opts.COUNT;\n\n    if (start >= testClasses.length) {\n        testClasses = [];\n    } else if (end >= testClasses.length) {\n        testClasses = testClasses.slice(start);\n    } else {\n        testClasses = testClasses.slice(start, end);\n    }\n}\n\nreturn async.mapSeries(testClasses, (clazz, callback) => {\n    if (clazz.length > max_test_class_length) {\n        max_test_class_length = clazz.length;\n    }\n\n    return async.retry(test_opts.RETRIES, (retryCb) => {\n        const test_process = child_process.spawn('./ContainerShip/scripts/run-instrumentation-tests-via-adb-shell.sh', [test_opts.PACKAGE, clazz], {\n            stdio: 'inherit'\n        });\n\n        const timeout = setTimeout(() => {\n            test_process.kill();\n        }, test_opts.TEST_TIMEOUT);\n\n        test_process.on('error', (err) => {\n            clearTimeout(timeout);\n            retryCb(err);\n        });\n\n        test_process.on('exit', (code) => {\n            clearTimeout(timeout);\n\n            if (code !== 0) {\n                return retryCb(new Error(`Process exited with code: ${code}`));\n            }\n\n            return retryCb();\n        });\n    }, (err) => {\n        return callback(null, {\n            name: clazz,\n            status: err ? 'failure' : 'success'\n        });\n    });\n}, (err, results) => {\n    print_test_suite_results(results);\n\n    const failures = results.filter((test) => {\n        return test.status === 'failure';\n    });\n\n    return failures.length === 0 ? process.exit(0) : process.exit(1);\n});\n\nfunction print_test_suite_results(results) {\n    console.log('\\n\\nTest Suite Results:\\n');\n\n    let color;\n    let failing_suites = 0;\n    let passing_suites = 0;\n\n    function pad_output(num_chars) {\n        let i = 0;\n\n        while (i < num_chars) {\n            process.stdout.write(' ');\n            i++;\n        }\n    }\n    results.forEach((test) => {\n        if (test.status === 'success') {\n            color = colors.GREEN;\n            passing_suites++;\n        } else if (test.status === 'failure') {\n            color = colors.RED;\n            failing_suites++;\n        }\n\n        process.stdout.write(color);\n        process.stdout.write(test.name);\n        pad_output((max_test_class_length - test.name.length) + 8);\n        process.stdout.write(test.status);\n        process.stdout.write(`${colors.RESET}\\n`);\n    });\n\n    console.log(`\\n${passing_suites} passing, ${failing_suites} failing!`);\n}\n"
  },
  {
    "path": "ContainerShip/scripts/run-android-docker-instrumentation-tests.sh",
    "content": "#!/bin/bash\n\n# for buck gen\nmount -o remount,exec /dev/shm\n\nAVD_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)\n\n# create virtual device\necho no | android create avd -n $AVD_UUID -f -t android-19 --abi default/armeabi-v7a\n\n# emulator setup\nemulator64-arm -avd $AVD_UUID -no-skin -no-audio -no-window -no-boot-anim &\nbootanim=\"\"\nuntil [[ \"$bootanim\" =~ \"stopped\" ]]; do\n    sleep 5\n    bootanim=$(adb -e shell getprop init.svc.bootanim 2>&1)\n    echo \"boot animation status=$bootanim\"\ndone\n\nset -x\n\n# solve issue with max user watches limit\necho 65536 | tee -a /proc/sys/fs/inotify/max_user_watches\nwatchman shutdown-server\n\n# integration tests\n# build JS bundle for instrumentation tests\nnode local-cli/cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js\n\n# build test APK\nsource ./scripts/circle-ci-android-setup.sh && NO_BUCKD=1 retry3 buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=1\n\n# run installed apk with tests\nnode ./ContainerShip/scripts/run-android-ci-instrumentation-tests.js $*\nexit $?\n"
  },
  {
    "path": "ContainerShip/scripts/run-android-docker-unit-tests.sh",
    "content": "#!/bin/bash\n\n# set default environment variables\nUNIT_TESTS_BUILD_THREADS=\"${UNIT_TESTS_BUILD_THREADS:-1}\"\n\n# for buck gen\nmount -o remount,exec /dev/shm\n\nset -x\n\n# run unit tests\nbuck test ReactAndroid/src/test/... --config build.threads=$UNIT_TESTS_BUILD_THREADS\n"
  },
  {
    "path": "ContainerShip/scripts/run-ci-e2e-tests.sh",
    "content": "#!/bin/bash\n\nset -ex\n\n# set default environment variables\nROOT=$(pwd)\nSCRIPTS=$(pwd)/scripts\n\nRUN_ANDROID=0\nRUN_CLI_INSTALL=1\nRUN_IOS=0\nRUN_JS=0\n\nRETRY_COUNT=${RETRY_COUNT:-2}\nAVD_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)\n\nANDROID_NPM_DEPS=\"appium@1.5.1 mocha@2.4.5 wd@0.3.11 colors@1.0.3 pretty-data2@0.40.1\"\nCLI_PACKAGE=$ROOT/react-native-cli/react-native-cli-*.tgz\nPACKAGE=$ROOT/react-native-*.tgz\n\n# solve issue with max user watches limit\necho 65536 | tee -a /proc/sys/fs/inotify/max_user_watches\nwatchman shutdown-server\n\n# retries command on failure\n# $1 -- max attempts\n# $2 -- command to run\nfunction retry() {\n    local -r -i max_attempts=\"$1\"; shift\n    local -r cmd=\"$@\"\n    local -i attempt_num=1\n\n    until $cmd; do\n        if (( attempt_num == max_attempts )); then\n            echo \"Execution of '$cmd' failed; no more attempts left\"\n            return 1\n        else\n            (( attempt_num++ ))\n            echo \"Execution of '$cmd' failed; retrying for attempt number $attempt_num...\"\n        fi\n    done\n}\n\n# parse command line args & flags\nwhile :; do\n  case \"$1\" in\n    --android)\n      RUN_ANDROID=1\n      shift\n      ;;\n\n    --ios)\n      RUN_IOS=1\n      shift\n      ;;\n\n    --js)\n      RUN_JS=1\n      shift\n      ;;\n\n    --skip-cli-install)\n      RUN_CLI_INSTALL=0\n      shift\n      ;;\n\n    --tvos)\n      RUN_IOS=1\n      shift\n      ;;\n\n    *)\n      break\n  esac\ndone\n\nfunction e2e_suite() {\n    cd $ROOT\n\n    if [ $RUN_ANDROID -eq 0 ] && [ $RUN_IOS -eq 0 ] && [ $RUN_JS -eq 0 ]; then\n      echo \"No e2e tests specified!\"\n      return 0\n    fi\n\n    # create temp dir\n    TEMP_DIR=$(mktemp -d /tmp/react-native-XXXXXXXX)\n\n    # To make sure we actually installed the local version\n    # of react-native, we will create a temp file inside the template\n    # and check that it exists after `react-native init\n    IOS_MARKER=$(mktemp $ROOT/local-cli/templates/HelloWorld/ios/HelloWorld/XXXXXXXX)\n    ANDROID_MARKER=$(mktemp ${ROOT}/local-cli/templates/HelloWorld/android/XXXXXXXX)\n\n    # install CLI\n    cd react-native-cli\n    npm pack\n    cd ..\n\n    # can skip cli install for non sudo mode\n    if [ $RUN_CLI_INSTALL -ne 0 ]; then\n      npm install -g $CLI_PACKAGE\n      if [ $? -ne 0 ]; then\n        echo \"Could not install react-native-cli globally, please run in su mode\"\n        echo \"Or with --skip-cli-install to skip this step\"\n        return 1\n      fi\n    fi\n\n    if [ $RUN_ANDROID -ne 0 ]; then\n        set +ex\n\n        # create virtual device\n        if ! android list avd | grep \"$AVD_UUID\" > /dev/null; then\n            echo no | android create avd -n $AVD_UUID -f -t android-19 --abi default/armeabi-v7a\n        fi\n\n        # newline at end of adb devices call and first line is headers\n        DEVICE_COUNT=$(adb devices | wc -l)\n        ((DEVICE_COUNT -= 2))\n\n        # will always kill an existing emulator if one exists for fresh setup\n        if [[ $DEVICE_COUNT -ge 1 ]]; then\n            adb emu kill\n        fi\n\n        # emulator setup\n        emulator64-arm -avd $AVD_UUID -no-skin -no-audio -no-window -no-boot-anim &\n\n        bootanim=\"\"\n        until [[ \"$bootanim\" =~ \"stopped\" ]]; do\n            sleep 5\n            bootanim=$(adb -e shell getprop init.svc.bootanim 2>&1)\n            echo \"boot animation status=$bootanim\"\n        done\n\n        set -ex\n\n      ./gradlew :ReactAndroid:installArchives -Pjobs=1 -Dorg.gradle.jvmargs=\"-Xmx512m -XX:+HeapDumpOnOutOfMemoryError\"\n      if [ $? -ne 0 ]; then\n        echo \"Failed to compile Android binaries\"\n        return 1\n      fi\n    fi\n\n    npm pack\n    if [ $? -ne 0 ]; then\n      echo \"Failed to pack react-native\"\n      return 1\n    fi\n\n    cd $TEMP_DIR\n\n    retry $RETRY_COUNT react-native init EndToEndTest --version $PACKAGE --npm\n    if [ $? -ne 0 ]; then\n      echo \"Failed to execute react-native init\"\n      echo \"Most common reason is npm registry connectivity, try again\"\n      return 1\n    fi\n\n    cd EndToEndTest\n\n    # android tests\n    if [ $RUN_ANDROID -ne 0 ]; then\n      echo \"Running an Android e2e test\"\n      echo \"Installing e2e framework\"\n\n      retry $RETRY_COUNT npm install --save-dev $ANDROID_NPM_DEPS --silent >> /dev/null\n      if [ $? -ne 0 ]; then\n        echo \"Failed to install appium\"\n        echo \"Most common reason is npm registry connectivity, try again\"\n        return 1\n      fi\n\n      cp $SCRIPTS/android-e2e-test.js android-e2e-test.js\n\n      cd android\n      echo \"Downloading Maven deps\"\n      ./gradlew :app:copyDownloadableDepsToLibs\n\n      cd ..\n      keytool -genkey -v -keystore android/keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US\"\n\n      node ./node_modules/.bin/appium >> /dev/null &\n      APPIUM_PID=$!\n      echo \"Starting appium server $APPIUM_PID\"\n\n      echo \"Building app\"\n      buck build android/app\n\n      # hack to get node unhung (kill buckd)\n      kill -9 $(pgrep java)\n\n      if [ $? -ne 0 ]; then\n        echo \"could not execute Buck build, is it installed and in PATH?\"\n        return 1\n      fi\n\n      echo \"Starting packager server\"\n      npm start >> /dev/null &\n      SERVER_PID=$!\n      sleep 15\n\n      echo \"Executing android e2e test\"\n      retry $RETRY_COUNT node node_modules/.bin/_mocha android-e2e-test.js\n      if [ $? -ne 0 ]; then\n        echo \"Failed to run Android e2e tests\"\n        echo \"Most likely the code is broken\"\n        return 1\n      fi\n\n      # kill packager process\n      if kill -0 $SERVER_PID; then\n        echo \"Killing packager $SERVER_PID\"\n        kill -9 $SERVER_PID\n      fi\n\n      # kill appium process\n      if kill -0 $APPIUM_PID; then\n        echo \"Killing appium $APPIUM_PID\"\n        kill -9 $APPIUM_PID\n      fi\n\n    fi\n\n    # ios tests\n    if [ $RUN_IOS -ne 0 ]; then\n      echo \"Running ios e2e tests not yet implemented for docker!\"\n    fi\n\n    # js tests\n    if [ $RUN_JS -ne 0 ]; then\n      # Check the packager produces a bundle (doesn't throw an error)\n      react-native bundle --max-workers 1 --platform android --dev true --entry-file index.js --bundle-output android-bundle.js\n      if [ $? -ne 0 ]; then\n        echo \"Could not build android bundle\"\n        return 1\n      fi\n\n      react-native bundle --max-workers 1 --platform ios --dev true --entry-file index.js --bundle-output ios-bundle.js\n      if [ $? -ne 0 ]; then\n        echo \"Could not build iOS bundle\"\n        return 1\n      fi\n    fi\n\n    # directory cleanup\n    rm $IOS_MARKER\n    rm $ANDROID_MARKER\n\n    return 0\n}\n\nretry $RETRY_COUNT e2e_suite\n"
  },
  {
    "path": "ContainerShip/scripts/run-instrumentation-tests-via-adb-shell.sh",
    "content": "#!/bin/bash\n\n# Python script to run instrumentation tests, copied from https://github.com/circleci/circle-dummy-android\n# Example: ./scripts/run-android-instrumentation-tests.sh com.facebook.react.tests com.facebook.react.tests.ReactPickerTestCase\n#\nexport PATH=\"$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH\"\n\n# clear the logs\nadb logcat -c\n\n# run tests and check output\npython - $1 $2 << END\n\nimport re\nimport subprocess as sp\nimport sys\nimport threading\nimport time\n\ndone = False\n\ntest_app = sys.argv[1]\ntest_class = None\n\nif len(sys.argv) > 2:\n  test_class = sys.argv[2]\n  \ndef update():\n  # prevent CircleCI from killing the process for inactivity\n  while not done:\n    time.sleep(5)\n    print \"Running in background.  Waiting for 'adb' command response...\"\n\nt = threading.Thread(target=update)\nt.dameon = True\nt.start()\n\ndef run():\n  sp.Popen(['adb', 'wait-for-device']).communicate()\n  if (test_class != None):\n    p = sp.Popen('adb shell am instrument -w -e class %s %s/android.support.test.runner.AndroidJUnitRunner' \n      % (test_class, test_app), shell=True, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE)\n  else :\n    p = sp.Popen('adb shell am instrument -w %s/android.support.test.runner.AndroidJUnitRunner' \n      % (test_app), shell=True, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE)\n  return p.communicate()\n\nsuccess = re.compile(r'OK \\(\\d+ test(s)?\\)')\nstdout, stderr = run()\n\ndone = True\nprint stderr\nprint stdout\n\nif success.search(stderr + stdout):\n  sys.exit(0)\nelse:\n  # dump the logs\n  sp.Popen(['adb', 'logcat', '-d']).communicate()\n  sys.exit(1) # make sure we fail if the test failed\nEND\n\nRETVAL=$?\n\nexit $RETVAL\n"
  },
  {
    "path": "DockerTests.md",
    "content": "# Dockerfile Tests\n\nThis is a high level overview of the test configuration using docker. It explains how to run the tests locally\nand how they integrate with the Jenkins Pipeline script to run the automated tests on ContainerShip <https://www.containership.io/>.\n\n## Docker Installation\n\nIt is required to have Docker running on your machine in order to build and run the tests in the Dockerfiles.\nSee <https://docs.docker.com/engine/installation/> for more information on how to install.\n\n## Convenience NPM Run Scripts\n\nWe have added a number of default run scripts to the `package.json` file to simplify building and running your tests.\n\n`npm run test-android-setup` - Pulls down the base android docker image used for running the tests\n\n`npm run test-android-build` - Builds the docker image used to run the tests\n\n`npm run test-android-run-unit` - Runs all the unit tests that have been built in the latest react/android docker image (note: you need to run test-android-build before executing this, if the image does not exist it will fail)\n\n`npm run test-android-run-instrumentation` - Runs all the instrumentation tests that have been built in the latest react/android docker image (note: you need to run test-android-build before executing this, if the image does not exist it will fail). You can also pass additional flags to filter which tests instrumentation tests are run. Ex: `npm run test-android-run-instrumentation -- --filter=TestIdTestCase` to only run the TestIdTestCase instrumentation test. See below for more information\non the instrumentation test flags.\n\n`npm run test-android-run-e2e` - Runs all the end to end tests that have been built in the latest react/android docker image (note: you need to run test-android-build before executing this, if the image does not exist it will fail)\n\n`npm run test-android-unit` - Builds and runs the android unit tests.\n\n`npm run test-android-instrumentation` - Builds and runs the android instrumentation tests.\n\n`npm run test-android-e2e` - Builds and runs the android end to end tests.\n\n## Detailed Android Setup\n\nThere are two Dockerfiles for use with the Android codebase.\n\nThe `Dockerfile.android-base` contains all the necessary prerequisites required to run the React Android tests. It is\nseparated out into a separate Dockerfile because these are dependencies that rarely change and also because it is quite\na beastly image since it contains all the Android depedencies for running android and the emulators (~9GB).\n\nThe good news is you should rarely have to build or pull down the base image! All iterative code updates happen as\npart of the `Dockerfile.android` image build.\n\nSo step one...\n\n`docker pull containership/android-base:latest`\n\nThis will take quite some time depending on your connection and you need to ensure you have ~10GB of free disk space.\n\nOnce this is done, you can run tests locally by executing two simple commands:\n\n1. `docker build -t react/android -f ./ContainerShip/Dockerfile.android .`\n2. `docker run --cap-add=SYS_ADMIN -it react/android bash ContainerShip/scripts/run-android-docker-unit-tests.sh`\n\n> Note: `--cap-add=SYS_ADMIN` flag is required for the `ContainerShip/scripts/run-android-docker-unit-tests.sh` and\n`ContainerShip/scripts/run-android-docker-instrumentation-tests.sh` in order to allow the remounting of `/dev/shm` as writeable\nso the `buck` build system may write temporary output to that location\n\nEvery time you make any modifications to the codebase, you should re-run the `docker build ...` command in order for your\nupdates to be included in your local docker image.\n\nThe following shell scripts have been provided for android testing:\n\n`ContainerShip/scripts/run-android-docker-unit-tests.sh` - Runs the standard android unit tests\n\n`ContainerShip/scripts/run-android-docker-instrumentation-tests.sh` - Runs the android instrumentation tests on the emulator. *Note* that these\ntests take quite some time to run so there are various flags you can pass in order to filter which tests are run (see below)\n\n`ContainerShip/scripts/run-ci-e2e-tests.sh` - Runs the android end to end tests\n\n#### ContainerShip/scripts/run-android-docker-instrumentation-tests.sh\n\nThe instrumentation test script accepts the following flags in order to customize the execution of the tests:\n\n`--filter` - A regex that filters which instrumentation tests will be run. (Defaults to .*)\n\n`--package` - Name of the java package containing the instrumentation tests (Defaults to com.facebook.react.tests)\n\n`--path` - Path to the directory containing the instrumentation tests. (Defaults to ./ReactAndroid/src/androidTest/java/com/facebook/react/tests)\n\n`--retries` - Number of times to retry a failed test before declaring a failure (Defaults to 2)\n\nFor example, if locally you only wanted to run the InitialPropsTestCase, you could do the following:\n\n`docker run --cap-add=SYS_ADMIN -it react/android bash ContainerShip/scripts/run-android-docker-instrumentation-tests.sh --filter=\"InitialPropsTestCase\"`\n\n# Javascript Setup\n\nThere is a single Dockerfile for use with the javascript codebase.\n\nThe `Dockerfile.javascript` base requires all the necessary dependencies for running Javascript tests.\n\nAny time you make an update to the codebase, you can build and run the javascript tests with the following three commands:\n\n1. `docker build -t react/js -f ./ContainerShip/Dockerfile.javascript .`\n2. `docker run -it react/js yarn test --maxWorkers=4`\n3. `docker run -it react/js yarn run flow -- check`\n"
  },
  {
    "path": "IntegrationTests/AccessibilityManagerTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule AccessibilityManagerTest\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst { View } = ReactNative;\nconst RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\nconst {\n  TestModule,\n  AccessibilityManager,\n} = ReactNative.NativeModules;\n\n\nclass AccessibilityManagerTest extends React.Component<{}> {\n  componentDidMount() {\n    AccessibilityManager.setAccessibilityContentSizeMultipliers({\n      'extraSmall': 1.0,\n      'small': 2.0,\n      'medium': 3.0,\n      'large': 4.0,\n      'extraLarge': 5.0,\n      'extraExtraLarge': 6.0,\n      'extraExtraExtraLarge': 7.0,\n      'accessibilityMedium': 8.0,\n      'accessibilityLarge': 9.0,\n      'accessibilityExtraLarge': 10.0,\n      'accessibilityExtraExtraLarge': 11.0,\n      'accessibilityExtraExtraExtraLarge': 12.0,\n    });\n    RCTDeviceEventEmitter.addListener('didUpdateDimensions', update => {\n      TestModule.markTestPassed(update.window.fontScale === 4.0);\n    });\n  }\n\n  render(): React.Node {\n    return <View />;\n  }\n}\n\nAccessibilityManagerTest.displayName = 'AccessibilityManagerTest';\n\nmodule.exports = AccessibilityManagerTest;\n"
  },
  {
    "path": "IntegrationTests/AppEventsTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AppEventsTest\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  NativeAppEventEmitter,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\nvar { TestModule } = ReactNative.NativeModules;\n\nvar deepDiffer = require('deepDiffer');\n\nvar TEST_PAYLOAD = {foo: 'bar'};\n\ntype AppEvent = { data: Object, ts: number, };\ntype State = {\n  sent: 'none' | AppEvent,\n  received: 'none' | AppEvent,\n  elapsed?: string,\n};\n\nclass AppEventsTest extends React.Component<{}, State> {\n  state: State = {sent: 'none', received: 'none'};\n\n  componentDidMount() {\n    NativeAppEventEmitter.addListener('testEvent', this.receiveEvent);\n    var event = {data: TEST_PAYLOAD, ts: Date.now()};\n    TestModule.sendAppEvent('testEvent', event);\n    this.setState({sent: event});\n  }\n\n  receiveEvent = (event: any) => {\n    if (deepDiffer(event.data, TEST_PAYLOAD)) {\n      throw new Error('Received wrong event: ' + JSON.stringify(event));\n    }\n    var elapsed = (Date.now() - event.ts) + 'ms';\n    this.setState({received: event, elapsed}, () => {\n      TestModule.markTestCompleted();\n    });\n  };\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text>\n          {JSON.stringify(this.state, null, '  ')}\n        </Text>\n      </View>\n    );\n  }\n}\n\nAppEventsTest.displayName = 'AppEventsTest';\n\nvar styles = StyleSheet.create({\n  container: {\n    margin: 40,\n  },\n});\n\nmodule.exports = AppEventsTest;\n"
  },
  {
    "path": "IntegrationTests/AsyncStorageTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule AsyncStorageTest\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  AsyncStorage,\n  Text,\n  View,\n} = ReactNative;\nvar { TestModule } = ReactNative.NativeModules;\n\nvar deepDiffer = require('deepDiffer');\n\nvar DEBUG = false;\n\nvar KEY_1 = 'key_1';\nvar VAL_1 = 'val_1';\nvar KEY_2 = 'key_2';\nvar VAL_2 = 'val_2';\nvar KEY_MERGE = 'key_merge';\nvar VAL_MERGE_1 = {'foo': 1, 'bar': {'hoo': 1, 'boo': 1}, 'moo': {'a': 3}};\nvar VAL_MERGE_2 = {'bar': {'hoo': 2}, 'baz': 2, 'moo': {'a': 3}};\nvar VAL_MERGE_EXPECT =\n  {'foo': 1, 'bar': {'hoo': 2, 'boo': 1}, 'baz': 2, 'moo': {'a': 3}};\n\n// setup in componentDidMount\nvar done = (result : ?boolean) => {};\nvar updateMessage = (message : string ) => {};\n\nfunction runTestCase(description : string, fn) {\n  updateMessage(description);\n  fn();\n}\n\nfunction expectTrue(condition : boolean, message : string) {\n  if (!condition) {\n    throw new Error(message);\n  }\n}\n\nfunction expectEqual(lhs, rhs, testname : string) {\n  expectTrue(\n    !deepDiffer(lhs, rhs),\n    'Error in test ' + testname + ': expected\\n' + JSON.stringify(rhs) +\n      '\\ngot\\n' + JSON.stringify(lhs)\n  );\n}\n\nfunction expectAsyncNoError(place, err) {\n  if (err instanceof Error) {\n    err = err.message;\n  }\n  expectTrue(err === null, 'Unexpected error in ' + place + ': ' + JSON.stringify(err));\n}\n\nfunction testSetAndGet() {\n  AsyncStorage.setItem(KEY_1, VAL_1, (err1) => {\n    expectAsyncNoError('testSetAndGet/setItem', err1);\n    AsyncStorage.getItem(KEY_1, (err2, result) => {\n      expectAsyncNoError('testSetAndGet/getItem', err2);\n      expectEqual(result, VAL_1, 'testSetAndGet setItem');\n      updateMessage('get(key_1) correctly returned ' + result);\n      runTestCase('should get null for missing key', testMissingGet);\n    });\n  });\n}\n\nfunction testMissingGet() {\n  AsyncStorage.getItem(KEY_2, (err, result) => {\n    expectAsyncNoError('testMissingGet/setItem', err);\n    expectEqual(result, null, 'testMissingGet');\n    updateMessage('missing get(key_2) correctly returned ' + result);\n    runTestCase('check set twice results in a single key', testSetTwice);\n  });\n}\n\nfunction testSetTwice() {\n  AsyncStorage.setItem(KEY_1, VAL_1, ()=>{\n    AsyncStorage.setItem(KEY_1, VAL_1, ()=>{\n      AsyncStorage.getItem(KEY_1, (err, result) => {\n        expectAsyncNoError('testSetTwice/setItem', err);\n        expectEqual(result, VAL_1, 'testSetTwice');\n        updateMessage('setTwice worked as expected');\n        runTestCase('test removeItem', testRemoveItem);\n      });\n    });\n  });\n}\n\nfunction testRemoveItem() {\n  AsyncStorage.setItem(KEY_1, VAL_1, ()=>{\n    AsyncStorage.setItem(KEY_2, VAL_2, ()=>{\n      AsyncStorage.getAllKeys((err, result) => {\n        expectAsyncNoError('testRemoveItem/getAllKeys', err);\n        expectTrue(\n          result.indexOf(KEY_1) >= 0 && result.indexOf(KEY_2) >= 0,\n          'Missing KEY_1 or KEY_2 in ' + '(' + result + ')'\n        );\n        updateMessage('testRemoveItem - add two items');\n        AsyncStorage.removeItem(KEY_1, (err2) => {\n          expectAsyncNoError('testRemoveItem/removeItem', err2);\n          updateMessage('delete successful ');\n          AsyncStorage.getItem(KEY_1, (err3, result2) => {\n            expectAsyncNoError('testRemoveItem/getItem', err3);\n            expectEqual(\n              result2,\n              null,\n              'testRemoveItem: key_1 present after delete'\n            );\n            updateMessage('key properly removed ');\n            AsyncStorage.getAllKeys((err4, result3) => {\n             expectAsyncNoError('testRemoveItem/getAllKeys', err4);\n             expectTrue(\n               result3.indexOf(KEY_1) === -1,\n               'Unexpected: KEY_1 present in ' + result3\n             );\n             updateMessage('proper length returned.');\n             runTestCase('should merge values', testMerge);\n            });\n          });\n        });\n      });\n    });\n  });\n}\n\nfunction testMerge() {\n  AsyncStorage.setItem(KEY_MERGE, JSON.stringify(VAL_MERGE_1), (err1) => {\n    expectAsyncNoError('testMerge/setItem', err1);\n    AsyncStorage.mergeItem(KEY_MERGE, JSON.stringify(VAL_MERGE_2), (err2) => {\n      expectAsyncNoError('testMerge/mergeItem', err2);\n      AsyncStorage.getItem(KEY_MERGE, (err3, result) => {\n        expectAsyncNoError('testMerge/setItem', err3);\n        expectEqual(JSON.parse(result), VAL_MERGE_EXPECT, 'testMerge');\n        updateMessage('objects deeply merged\\nDone!');\n        runTestCase('multi set and get', testOptimizedMultiGet);\n      });\n    });\n  });\n}\n\nfunction testOptimizedMultiGet() {\n  let batch = [[KEY_1, VAL_1], [KEY_2, VAL_2]];\n  let keys = batch.map(([key, value]) => key);\n  AsyncStorage.multiSet(batch, (err1) => {\n    // yes, twice on purpose\n    [1, 2].forEach((i) => {\n      expectAsyncNoError(`${i} testOptimizedMultiGet/multiSet`, err1);\n      AsyncStorage.multiGet(keys, (err2, result) => {\n        expectAsyncNoError(`${i} testOptimizedMultiGet/multiGet`, err2);\n        expectEqual(result, batch, `${i} testOptimizedMultiGet multiGet`);\n        updateMessage('multiGet([key_1, key_2]) correctly returned ' + JSON.stringify(result));\n        done();\n      });\n    });\n  });\n}\n\n\nclass AsyncStorageTest extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    messages: 'Initializing...',\n    done: false,\n  };\n\n  componentDidMount() {\n    done = () => this.setState({done: true}, () => {\n      TestModule.markTestCompleted();\n    });\n    updateMessage = (msg) => {\n      this.setState({messages: this.state.messages.concat('\\n' + msg)});\n      DEBUG && console.log(msg);\n    };\n    AsyncStorage.clear(testSetAndGet);\n  }\n\n  render() {\n    return (\n      <View style={{backgroundColor: 'white', padding: 40}}>\n        <Text>\n          {\n            /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This\n             * comment suppresses an error found when Flow v0.54 was deployed.\n             * To see the error delete this comment and run Flow. */\n            this.constructor.displayName + ': '}\n          {this.state.done ? 'Done' : 'Testing...'}\n          {'\\n\\n' + this.state.messages}\n        </Text>\n      </View>\n    );\n  }\n}\n\nAsyncStorageTest.displayName = 'AsyncStorageTest';\n\nmodule.exports = AsyncStorageTest;\n"
  },
  {
    "path": "IntegrationTests/ImageCachePolicyTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ImageCachePolicyTest\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  View,\n  Text,\n  StyleSheet,\n} = ReactNative;\nvar { TestModule } = ReactNative.NativeModules;\n\n/*\n * The reload and force-cache tests don't actually verify that the complete functionality.\n *\n * reload: Should have the server set a long cache header, then swap the image on next load\n * with the test comparing the old image to the new image and making sure they are different.\n *\n * force-cache: Should do the above but set a no-cache header. The test should compare the first\n * image with the new one and make sure they are the same.\n */\n\nconst TESTS = ['only-if-cached', 'default', 'reload', 'force-cache'];\n\ntype Props = {}\ntype State = {\n  'only-if-cached'?: boolean,\n  'default'?: boolean,\n  'reload'?: boolean,\n  'force-cache'?: boolean,\n}\n\nclass ImageCachePolicyTest extends React.Component<Props, $FlowFixMeState> {\n  state = {}\n\n  shouldComponentUpdate(nextProps: Props, nextState: State) {\n    const results: Array<?boolean> = TESTS.map(x => nextState[x]);\n\n    if (!results.includes(undefined)) {\n      const result: boolean = results.reduce((x,y) => x === y === true, true);\n      TestModule.markTestPassed(result);\n    }\n\n    return false;\n  }\n\n  testComplete(name: string, pass: boolean) {\n    this.setState({[name]: pass});\n  }\n\n  render() {\n    return (\n      <View style={{flex: 1}}>\n        <Text>Hello</Text>\n      <Image\n        source={{\n              uri: 'https://facebook.github.io/react-native/img/favicon.png?cacheBust=notinCache' + Date.now(),\n              cache: 'only-if-cached'\n            }}\n        onLoad={() => this.testComplete('only-if-cached', false)}\n        onError={() => this.testComplete('only-if-cached', true)}\n        style={styles.base}\n      />\n        <Image\n          source={{\n              uri: 'https://facebook.github.io/react-native/img/favicon.png?cacheBust=notinCache' + Date.now(),\n              cache: 'default'\n            }}\n          onLoad={() => this.testComplete('default', true)}\n          onError={() => this.testComplete('default', false)}\n          style={styles.base}\n        />\n        <Image\n          source={{\n              uri: 'https://facebook.github.io/react-native/img/favicon.png?cacheBust=notinCache' + Date.now(),\n              cache: 'reload'\n            }}\n          onLoad={() => this.testComplete('reload', true)}\n          onError={() => this.testComplete('reload', false)}\n          style={styles.base}\n        />\n        <Image\n          source={{\n              uri: 'https://facebook.github.io/react-native/img/favicon.png?cacheBust=notinCache' + Date.now(),\n              cache: 'force-cache'\n            }}\n          onLoad={() => this.testComplete('force-cache', true)}\n          onError={() => this.testComplete('force-cache', false)}\n          style={styles.base}\n        />\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  base: {\n    width: 100,\n    height: 100,\n  },\n});\n\nImageCachePolicyTest.displayName = 'ImageCachePolicyTest';\n\nmodule.exports = ImageCachePolicyTest;\n"
  },
  {
    "path": "IntegrationTests/ImageSnapshotTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ImageSnapshotTest\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  View,\n} = ReactNative;\nvar { TestModule } = ReactNative.NativeModules;\n\nclass ImageSnapshotTest extends React.Component<{}> {\n  componentDidMount() {\n    if (!TestModule.verifySnapshot) {\n      throw new Error('TestModule.verifySnapshot not defined.');\n    }\n  }\n\n  done = (success : boolean) => {\n    TestModule.markTestPassed(success);\n  };\n\n  render() {\n    return (\n      <Image\n        source={require('./blue_square.png')}\n        defaultSource={require('./red_square.png')}\n        onLoad={() => TestModule.verifySnapshot(this.done)} />\n    );\n  }\n}\n\nImageSnapshotTest.displayName = 'ImageSnapshotTest';\n\nmodule.exports = ImageSnapshotTest;\n"
  },
  {
    "path": "IntegrationTests/IntegrationTestHarnessTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule IntegrationTestHarnessTest\n */\n'use strict';\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar requestAnimationFrame = require('fbjs/lib/requestAnimationFrame');\nvar React = require('react');\nvar PropTypes = require('prop-types');\nvar ReactNative = require('react-native');\nvar { Text, View } = ReactNative;\nvar { TestModule } = ReactNative.NativeModules;\n\nclass IntegrationTestHarnessTest extends React.Component<{\n  shouldThrow?: boolean,\n  waitOneFrame?: boolean,\n}, $FlowFixMeState> {\n  static propTypes = {\n    shouldThrow: PropTypes.bool,\n    waitOneFrame: PropTypes.bool,\n  };\n\n  state = {\n    done: false,\n  };\n\n  componentDidMount() {\n    if (this.props.waitOneFrame) {\n      requestAnimationFrame(this.runTest);\n    } else {\n      this.runTest();\n    }\n  }\n\n  runTest = () => {\n    if (this.props.shouldThrow) {\n      throw new Error('Throwing error because shouldThrow');\n    }\n    if (!TestModule) {\n      throw new Error('RCTTestModule is not registered.');\n    } else if (!TestModule.markTestCompleted) {\n      throw new Error('RCTTestModule.markTestCompleted not defined.');\n    }\n    this.setState({ done: true }, () => {\n      TestModule.markTestCompleted();\n    });\n  };\n\n  render() {\n    return (\n      <View style={{ backgroundColor: 'white', padding: 40 }}>\n        <Text>\n          {\n            /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This\n             * comment suppresses an error found when Flow v0.54 was deployed.\n             * To see the error delete this comment and run Flow. */\n            this.constructor.displayName + ': '}\n          {this.state.done ? 'Done' : 'Testing...'}\n        </Text>\n      </View>\n    );\n  }\n}\n\nIntegrationTestHarnessTest.displayName = 'IntegrationTestHarnessTest';\n\nmodule.exports = IntegrationTestHarnessTest;\n"
  },
  {
    "path": "IntegrationTests/IntegrationTestsApp.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule IntegrationTestsApp\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  AppRegistry,\n  ScrollView,\n  StyleSheet,\n  Text,\n  TouchableOpacity,\n  View,\n} = ReactNative;\n\n// Keep this list in sync with RNTesterIntegrationTests.m\nvar TESTS = [\n  require('./IntegrationTestHarnessTest'),\n  require('./TimersTest'),\n  require('./AsyncStorageTest'),\n  require('./LayoutEventsTest'),\n  require('./AppEventsTest'),\n  require('./SimpleSnapshotTest'),\n  require('./ImageCachePolicyTest'),\n  require('./ImageSnapshotTest'),\n  require('./PromiseTest'),\n  require('./WebViewTest'),\n  require('./SyncMethodTest'),\n  require('./WebSocketTest'),\n  require('./AccessibilityManagerTest'),\n];\n\nTESTS.forEach(\n  /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment\n   * suppresses an error found when Flow v0.54 was deployed. To see the error\n   * delete this comment and run Flow. */\n  (test) => AppRegistry.registerComponent(test.displayName, () => test)\n);\n\n// Modules required for integration tests\nrequire('LoggingTestModule');\n\ntype Test = any;\n\nclass IntegrationTestsApp extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    test: (null: ?Test),\n  };\n\n  render() {\n    if (this.state.test) {\n      return (\n        <ScrollView>\n          {/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n            * comment suppresses an error when upgrading Flow's support for\n            * React. To see the error delete this comment and run Flow. */}\n          <this.state.test />\n        </ScrollView>\n      );\n    }\n    return (\n      <View style={styles.container}>\n        <Text style={styles.row}>\n          Click on a test to run it in this shell for easier debugging and\n          development.  Run all tests in the testing environment with cmd+U in\n          Xcode.\n        </Text>\n        <View style={styles.separator} />\n        <ScrollView>\n          {TESTS.map((test) => [\n            <TouchableOpacity\n              onPress={() => this.setState({test})}\n              style={styles.row}>\n              <Text style={styles.testName}>\n                {test.displayName}\n              </Text>\n            </TouchableOpacity>,\n            <View style={styles.separator} />\n          ])}\n        </ScrollView>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    backgroundColor: 'white',\n    marginTop: 40,\n    margin: 15,\n  },\n  row: {\n    padding: 10,\n  },\n  testName: {\n    fontWeight: '500',\n  },\n  separator: {\n    height: 1,\n    backgroundColor: '#bbbbbb',\n  },\n});\n\nAppRegistry.registerComponent('IntegrationTestsApp', () => IntegrationTestsApp);\n"
  },
  {
    "path": "IntegrationTests/LayoutEventsTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule LayoutEventsTest\n * @flow\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  LayoutAnimation,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\nvar { TestModule } = ReactNative.NativeModules;\n\nvar deepDiffer = require('deepDiffer');\n\nfunction debug(...args) {\n  // console.log.apply(null, arguments);\n}\n\nimport type {Layout, LayoutEvent} from 'CoreEventTypes';\ntype Style = {\n  margin?: number,\n  padding?: number,\n  borderColor?: string,\n  borderWidth?: number,\n  backgroundColor?: string,\n  width?: number,\n};\n\ntype State = {\n  didAnimation: boolean,\n  extraText?: string,\n  imageLayout?: Layout,\n  textLayout?: Layout,\n  viewLayout?: Layout,\n  viewStyle?: Style,\n  containerStyle?: Style,\n};\n\nvar LayoutEventsTest = createReactClass({\n  displayName: 'LayoutEventsTest',\n  getInitialState(): State {\n    return {\n      didAnimation: false,\n    };\n  },\n  animateViewLayout: function() {\n    debug('animateViewLayout invoked');\n    LayoutAnimation.configureNext(\n      LayoutAnimation.Presets.spring,\n      () => {\n        debug('animateViewLayout done');\n        this.checkLayout(this.addWrapText);\n      }\n    );\n    this.setState({viewStyle: {margin: 60}});\n  },\n  addWrapText: function() {\n    debug('addWrapText invoked');\n    this.setState(\n      {extraText: '  And a bunch more text to wrap around a few lines.'},\n      () => this.checkLayout(this.changeContainer)\n    );\n  },\n  changeContainer: function() {\n    debug('changeContainer invoked');\n    this.setState(\n      {containerStyle: {width: 280}},\n      () => this.checkLayout(TestModule.markTestCompleted)\n    );\n  },\n  checkLayout: function(next?: ?Function) {\n    if (!this.isMounted()) {\n      return;\n    }\n    this.refs.view.measure((x, y, width, height) => {\n      this.compare('view', {x, y, width, height}, this.state.viewLayout);\n      if (typeof next === 'function') {\n        next();\n      } else if (!this.state.didAnimation) {\n        // Trigger first state change after onLayout fires\n        this.animateViewLayout();\n        this.state.didAnimation = true;\n      }\n    });\n    this.refs.txt.measure((x, y, width, height) => {\n      this.compare('txt', {x, y, width, height}, this.state.textLayout);\n    });\n    this.refs.img.measure((x, y, width, height) => {\n      this.compare('img', {x, y, width, height}, this.state.imageLayout);\n    });\n  },\n  compare: function(node: string, measured: any, onLayout: any): void {\n    if (deepDiffer(measured, onLayout)) {\n      var data = {measured, onLayout};\n      throw new Error(\n        node + ' onLayout mismatch with measure ' +\n          JSON.stringify(data, null, '  ')\n      );\n    }\n  },\n  onViewLayout: function(e: LayoutEvent) {\n    debug('received view layout event\\n', e.nativeEvent);\n    this.setState({viewLayout: e.nativeEvent.layout}, this.checkLayout);\n  },\n  onTextLayout: function(e: LayoutEvent) {\n    debug('received text layout event\\n', e.nativeEvent);\n    this.setState({textLayout: e.nativeEvent.layout}, this.checkLayout);\n  },\n  onImageLayout: function(e: LayoutEvent) {\n    debug('received image layout event\\n', e.nativeEvent);\n    this.setState({imageLayout: e.nativeEvent.layout}, this.checkLayout);\n  },\n  render: function() {\n    var viewStyle = [styles.view, this.state.viewStyle];\n    var textLayout = this.state.textLayout || {width: '?', height: '?'};\n    var imageLayout = this.state.imageLayout || {x: '?', y: '?'};\n    debug('viewLayout', this.state.viewLayout);\n    return (\n      <View style={[styles.container, this.state.containerStyle]}>\n        <View ref=\"view\" onLayout={this.onViewLayout} style={viewStyle}>\n          <Image\n            ref=\"img\"\n            onLayout={this.onImageLayout}\n            style={styles.image}\n            source={{uri: 'uie_thumb_big.png'}}\n          />\n          <Text ref=\"txt\" onLayout={this.onTextLayout} style={styles.text}>\n            A simple piece of text.{this.state.extraText}\n          </Text>\n          <Text>\n            {'\\n'}\n            Text w/h: {textLayout.width}/{textLayout.height + '\\n'}\n            Image x/y: {imageLayout.x}/{imageLayout.y}\n          </Text>\n        </View>\n      </View>\n    );\n  }\n});\n\nvar styles = StyleSheet.create({\n  container: {\n    margin: 40,\n  },\n  view: {\n    margin: 20,\n    padding: 12,\n    borderColor: 'black',\n    borderWidth: 0.5,\n    backgroundColor: 'transparent',\n  },\n  text: {\n    alignSelf: 'flex-start',\n    borderColor: 'rgba(0, 0, 255, 0.2)',\n    borderWidth: 0.5,\n  },\n  image: {\n    width: 50,\n    height: 50,\n    marginBottom: 10,\n    alignSelf: 'center',\n  },\n});\n\nLayoutEventsTest.displayName = 'LayoutEventsTest';\n\nmodule.exports = LayoutEventsTest;\n"
  },
  {
    "path": "IntegrationTests/LoggingTestModule.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule LoggingTestModule\n */\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\n\nvar warning = require('fbjs/lib/warning');\nvar invariant = require('fbjs/lib/invariant');\n\nvar LoggingTestModule = {\n  logToConsole: function(str) {\n    console.log(str);\n  },\n  logToConsoleAfterWait: function(str,timeout_ms) {\n    setTimeout(function() {\n      console.log(str);\n    }, timeout_ms);\n  },\n  warning: function(str) {\n    warning(false, str);\n  },\n  invariant: function(str) {\n    invariant(false, str);\n  },\n  logErrorToConsole: function(str) {\n    console.error(str);\n  },\n  throwError: function(str) {\n    throw new Error(str);\n  }\n};\n\nBatchedBridge.registerCallableModule(\n  'LoggingTestModule',\n  LoggingTestModule\n);\n\nmodule.exports = LoggingTestModule;\n"
  },
  {
    "path": "IntegrationTests/PromiseTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule PromiseTest\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar { View } = ReactNative;\nvar { TestModule } = ReactNative.NativeModules;\n\nclass PromiseTest extends React.Component<{}> {\n  shouldResolve = false;\n  shouldReject = false;\n  shouldSucceedAsync = false;\n  shouldThrowAsync = false;\n\n  componentDidMount() {\n    Promise.all([\n      this.testShouldResolve(),\n      this.testShouldReject(),\n      this.testShouldSucceedAsync(),\n      this.testShouldThrowAsync(),\n    ]).then(() => TestModule.markTestPassed(\n      this.shouldResolve && this.shouldReject &&\n      this.shouldSucceedAsync && this.shouldThrowAsync\n    ));\n  }\n\n  testShouldResolve = () => {\n    return TestModule\n      .shouldResolve()\n      .then(() => this.shouldResolve = true)\n      .catch(() => this.shouldResolve = false);\n  };\n\n  testShouldReject = () => {\n    return TestModule\n      .shouldReject()\n      .then(() => this.shouldReject = false)\n      .catch(() => this.shouldReject = true);\n  };\n\n  testShouldSucceedAsync = async (): Promise<any> => {\n    try {\n      await TestModule.shouldResolve();\n      this.shouldSucceedAsync = true;\n    } catch (e) {\n      this.shouldSucceedAsync = false;\n    }\n  };\n\n  testShouldThrowAsync = async (): Promise<any> => {\n    try {\n      await TestModule.shouldReject();\n      this.shouldThrowAsync = false;\n    } catch (e) {\n      this.shouldThrowAsync = true;\n    }\n  };\n\n  render(): React.Node {\n    return <View />;\n  }\n}\n\nPromiseTest.displayName = 'PromiseTest';\n\nmodule.exports = PromiseTest;\n"
  },
  {
    "path": "IntegrationTests/PropertiesUpdateTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n * @providesModule PropertiesUpdateTest\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  View,\n} = ReactNative;\n\nvar { TestModule } = ReactNative.NativeModules;\n\nclass PropertiesUpdateTest extends React.Component {\n  render() {\n    if (this.props.markTestPassed) {\n      TestModule.markTestPassed(true);\n    }\n    return (\n      <View/>\n    );\n  }\n}\n\nPropertiesUpdateTest.displayName = 'PropertiesUpdateTest';\n\nmodule.exports = PropertiesUpdateTest;\n"
  },
  {
    "path": "IntegrationTests/RCTRootViewIntegrationTestApp.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RCTRootViewIntegrationTestApp\n */\n'use strict';\n\nrequire('regenerator-runtime/runtime');\n\nvar React = require('React');\nvar ReactNative = require('react-native');\n\nvar {\n  AppRegistry,\n  ScrollView,\n  StyleSheet,\n  Text,\n  TouchableOpacity,\n  View,\n} = ReactNative;\n\n/* Keep this list in sync with RCTRootViewIntegrationTests.m */\nvar TESTS = [\n  require('./PropertiesUpdateTest'),\n  require('./ReactContentSizeUpdateTest'),\n  require('./SizeFlexibilityUpdateTest'),\n];\n\nTESTS.forEach(\n  (test) => AppRegistry.registerComponent(test.displayName, () => test)\n);\n\nclass RCTRootViewIntegrationTestApp extends React.Component {\n  state = {\n    test: null,\n  };\n\n  render() {\n    if (this.state.test) {\n      return (\n        <ScrollView>\n          <this.state.test />\n        </ScrollView>\n      );\n    }\n    return (\n      <View style={styles.container}>\n        <Text style={styles.row}>\n          Click on a test to run it in this shell for easier debugging and\n          development.  Run all tests in the testing environment with cmd+U in\n          Xcode.\n        </Text>\n        <View style={styles.separator} />\n        <ScrollView>\n          {TESTS.map((test) => [\n            <TouchableOpacity\n              onPress={() => this.setState({test})}\n              style={styles.row}>\n              <Text style={styles.testName}>\n                {test.displayName}\n              </Text>\n            </TouchableOpacity>,\n            <View style={styles.separator} />\n          ])}\n        </ScrollView>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    backgroundColor: 'white',\n    marginTop: 40,\n    margin: 15,\n  },\n  row: {\n    padding: 10,\n  },\n  testName: {\n    fontWeight: '500',\n  },\n  separator: {\n    height: 1,\n    backgroundColor: '#bbbbbb',\n  },\n});\n\nAppRegistry.registerComponent('RCTRootViewIntegrationTestApp', () => RCTRootViewIntegrationTestApp);\n"
  },
  {
    "path": "IntegrationTests/ReactContentSizeUpdateTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n * @providesModule ReactContentSizeUpdateTest\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\nvar RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter');\nvar Subscribable = require('Subscribable');\nvar TimerMixin = require('react-timer-mixin');\n\nvar { View } = ReactNative;\n\nvar { TestModule } = ReactNative.NativeModules;\n\nvar reactViewWidth = 101;\nvar reactViewHeight = 102;\nvar newReactViewWidth = 201;\nvar newReactViewHeight = 202;\n\nvar ReactContentSizeUpdateTest = createReactClass({\n  displayName: 'ReactContentSizeUpdateTest',\n  mixins: [Subscribable.Mixin,\n           TimerMixin],\n\n  componentWillMount: function() {\n    this.addListenerOn(\n      RCTNativeAppEventEmitter,\n      'rootViewDidChangeIntrinsicSize',\n      this.rootViewDidChangeIntrinsicSize\n    );\n  },\n\n  getInitialState: function() {\n    return {\n      height: reactViewHeight,\n      width: reactViewWidth,\n    };\n  },\n\n  updateViewSize: function() {\n    this.setState({\n      height: newReactViewHeight,\n      width: newReactViewWidth,\n    });\n  },\n\n  componentDidMount: function() {\n    this.setTimeout(\n      () => { this.updateViewSize(); },\n      1000\n    );\n  },\n\n  rootViewDidChangeIntrinsicSize: function(intrinsicSize) {\n    if (intrinsicSize.height === newReactViewHeight && intrinsicSize.width === newReactViewWidth) {\n      TestModule.markTestPassed(true);\n    }\n  },\n\n  render() {\n    return (\n      <View style={{'height':this.state.height, 'width':this.state.width}}/>\n    );\n  }\n});\n\nReactContentSizeUpdateTest.displayName = 'ReactContentSizeUpdateTest';\n\nmodule.exports = ReactContentSizeUpdateTest;\n"
  },
  {
    "path": "IntegrationTests/SimpleSnapshotTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule SimpleSnapshotTest\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar requestAnimationFrame = require('fbjs/lib/requestAnimationFrame');\n\nvar {\n  StyleSheet,\n  View,\n} = ReactNative;\nvar { TestModule } = ReactNative.NativeModules;\n\nclass SimpleSnapshotTest extends React.Component<{}> {\n  componentDidMount() {\n    if (!TestModule.verifySnapshot) {\n      throw new Error('TestModule.verifySnapshot not defined.');\n    }\n    requestAnimationFrame(() => TestModule.verifySnapshot(this.done));\n  }\n\n  done = (success : boolean) => {\n    TestModule.markTestPassed(success);\n  };\n\n  render() {\n    return (\n      <View style={{backgroundColor: 'white', padding: 100}}>\n        <View style={styles.box1} />\n        <View style={styles.box2} />\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  box1: {\n    width: 80,\n    height: 50,\n    backgroundColor: 'red',\n  },\n  box2: {\n    top: -10,\n    left: 20,\n    width: 70,\n    height: 90,\n    backgroundColor: 'blue',\n  },\n});\n\nSimpleSnapshotTest.displayName = 'SimpleSnapshotTest';\n\nmodule.exports = SimpleSnapshotTest;\n"
  },
  {
    "path": "IntegrationTests/SizeFlexibilityUpdateTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n * @providesModule SizeFlexibilityUpdateTest\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\nvar RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter');\nvar Subscribable = require('Subscribable');\nvar { View } = ReactNative;\n\nvar { TestModule } = ReactNative.NativeModules;\n\nvar reactViewWidth = 111;\nvar reactViewHeight = 222;\n\nvar finalState = false;\n\nvar SizeFlexibilityUpdateTest = createReactClass({\n  displayName: 'SizeFlexibilityUpdateTest',\n  mixins: [Subscribable.Mixin],\n\n  componentWillMount: function() {\n    this.addListenerOn(\n      RCTNativeAppEventEmitter,\n      'rootViewDidChangeIntrinsicSize',\n      this.rootViewDidChangeIntrinsicSize\n    );\n  },\n\n  markPassed: function() {\n    TestModule.markTestPassed(true);\n    finalState = true;\n  },\n\n  rootViewDidChangeIntrinsicSize: function(intrinsicSize) {\n\n    if (finalState) {\n      // If a test reaches its final state, it is not expected to do anything more\n      TestModule.markTestPassed(false);\n      return;\n    }\n\n    if (this.props.both) {\n      if (intrinsicSize.width === reactViewWidth && intrinsicSize.height === reactViewHeight) {\n        this.markPassed();\n        return;\n      }\n    }\n    if (this.props.height) {\n      if (intrinsicSize.width !== reactViewWidth && intrinsicSize.height === reactViewHeight) {\n        this.markPassed();\n        return;\n      }\n    }\n    if (this.props.width) {\n      if (intrinsicSize.width === reactViewWidth && intrinsicSize.height !== reactViewHeight) {\n        this.markPassed();\n        return;\n      }\n    }\n    if (this.props.none) {\n      if (intrinsicSize.width !== reactViewWidth && intrinsicSize.height !== reactViewHeight) {\n        this.markPassed();\n        return;\n      }\n    }\n  },\n\n  render() {\n    return (\n      <View style={{'height':reactViewHeight, 'width':reactViewWidth}}/>\n    );\n  }\n});\n\nSizeFlexibilityUpdateTest.displayName = 'SizeFlexibilityUpdateTest';\n\nmodule.exports = SizeFlexibilityUpdateTest;\n"
  },
  {
    "path": "IntegrationTests/SyncMethodTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule SyncMethodTest\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar { View } = ReactNative;\n\nconst {\n  TestModule,\n  RNTesterTestModule,\n} = ReactNative.NativeModules;\n\n\nclass SyncMethodTest extends React.Component<{}> {\n  componentDidMount() {\n    if (RNTesterTestModule.echoString('test string value') !== 'test string value') {\n      throw new Error('Something wrong with sync method export');\n    }\n    if (RNTesterTestModule.methodThatReturnsNil() != null) {\n      throw new Error('Something wrong with sync method export');\n    }\n    TestModule.markTestCompleted();\n  }\n\n  render(): React.Node {\n    return <View />;\n  }\n}\n\nSyncMethodTest.displayName = 'SyncMethodTest';\n\nmodule.exports = SyncMethodTest;\n"
  },
  {
    "path": "IntegrationTests/TimersTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TimersTest\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar TimerMixin = require('react-timer-mixin');\n\nvar {\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\nvar { TestModule  } = ReactNative.NativeModules;\n\nvar TimersTest = createReactClass({\n  displayName: 'TimersTest',\n  mixins: [TimerMixin],\n\n  _nextTest: () => {},\n  _interval: -1,\n\n  getInitialState() {\n    return {\n      count: 0,\n      done: false,\n    };\n  },\n\n  componentDidMount() {\n    this.setTimeout(this.testSetTimeout0, 1000);\n  },\n\n  testSetTimeout0() {\n    this.setTimeout(this.testSetTimeout1, 0);\n  },\n\n  testSetTimeout1() {\n    this.setTimeout(this.testSetTimeout50, 1);\n  },\n\n  testSetTimeout50() {\n    this.setTimeout(this.testRequestAnimationFrame, 50);\n  },\n\n  testRequestAnimationFrame() {\n    this.requestAnimationFrame(this.testSetInterval0);\n  },\n\n  testSetInterval0() {\n    this._nextTest = this.testSetInterval20;\n    this._interval = this.setInterval(this._incrementInterval, 0);\n  },\n\n  testSetInterval20() {\n    this._nextTest = this.testSetImmediate;\n    this._interval = this.setInterval(this._incrementInterval, 20);\n  },\n\n  testSetImmediate() {\n    this.setImmediate(this.testClearTimeout0);\n  },\n\n  testClearTimeout0() {\n    var timeout = this.setTimeout(() => this._fail('testClearTimeout0'), 0);\n    this.clearTimeout(timeout);\n    this.testClearTimeout30();\n  },\n\n  testClearTimeout30() {\n    var timeout = this.setTimeout(() => this._fail('testClearTimeout30'), 30);\n    this.clearTimeout(timeout);\n    this.setTimeout(this.testClearMulti, 50);\n  },\n\n  testClearMulti() {\n    var fails = [];\n    fails.push(this.setTimeout(() => this._fail('testClearMulti-1'), 20));\n    fails.push(this.setTimeout(() => this._fail('testClearMulti-2'), 50));\n    var delayClear = this.setTimeout(() => this._fail('testClearMulti-3'), 50);\n    fails.push(this.setTimeout(() => this._fail('testClearMulti-4'), 0));\n    fails.push(this.setTimeout(() => this._fail('testClearMulti-5'), 10));\n\n    fails.forEach((timeout) => this.clearTimeout(timeout));\n    this.setTimeout(() => this.clearTimeout(delayClear), 20);\n\n    this.setTimeout(this.testOrdering, 50);\n  },\n\n  testOrdering() {\n    // Clear timers are set first because it's more likely to uncover bugs.\n    var fail0;\n    this.setImmediate(() => this.clearTimeout(fail0));\n    fail0 = this.setTimeout(\n      () => this._fail('testOrdering-t0, setImmediate should happen before ' +\n        'setTimeout 0'),\n      0\n    );\n    var failAnim; // This should fail without the t=0 fastpath feature.\n    this.setTimeout(() => this.cancelAnimationFrame(failAnim), 0);\n    failAnim = this.requestAnimationFrame(\n      () => this._fail('testOrdering-Anim, setTimeout 0 should happen before ' +\n        'requestAnimationFrame')\n    );\n    var fail25;\n    this.setTimeout(() => { this.clearTimeout(fail25); }, 20);\n    fail25 = this.setTimeout(\n      () => this._fail('testOrdering-t25, setTimeout 20 should happen before ' +\n        'setTimeout 25'),\n      25\n    );\n    this.setTimeout(this.done, 50);\n  },\n\n  done() {\n    this.setState({done: true}, () => {\n      TestModule.markTestCompleted();\n    });\n  },\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text>\n          {this.constructor.displayName + ': \\n'}\n          Intervals: {this.state.count + '\\n'}\n          {this.state.done ? 'Done' : 'Testing...'}\n        </Text>\n      </View>\n    );\n  },\n\n  _incrementInterval() {\n    if (this.state.count > 3) {\n      throw new Error('interval incremented past end.');\n    }\n    if (this.state.count === 3) {\n      this.clearInterval(this._interval);\n      this.setState({count: 0}, this._nextTest);\n      return;\n    }\n    this.setState({count: this.state.count + 1});\n  },\n\n  _fail(caller : string) : void {\n    throw new Error('_fail called by ' + caller);\n  },\n});\n\nvar styles = StyleSheet.create({\n  container: {\n    backgroundColor: 'white',\n    padding: 40,\n  },\n});\n\nTimersTest.displayName = 'TimersTest';\n\nmodule.exports = TimersTest;\n"
  },
  {
    "path": "IntegrationTests/WebSocketTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule WebSocketTest\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar { View } = ReactNative;\nvar { TestModule } = ReactNative.NativeModules;\n\nconst DEFAULT_WS_URL = 'ws://localhost:5555/';\n\nconst WS_EVENTS = [\n  'close',\n  'error',\n  'message',\n  'open',\n];\nconst WS_STATES = [\n  /* 0 */ 'CONNECTING',\n  /* 1 */ 'OPEN',\n  /* 2 */ 'CLOSING',\n  /* 3 */ 'CLOSED',\n];\n\ntype State = {\n  url: string;\n  fetchStatus: ?string;\n  socket: ?WebSocket;\n  socketState: ?number;\n  lastSocketEvent: ?string;\n  lastMessage: ?string | ?ArrayBuffer;\n  testMessage: string;\n  testExpectedResponse: string;\n};\n\nclass WebSocketTest extends React.Component<{}, State> {\n  state: State = {\n    url: DEFAULT_WS_URL,\n    fetchStatus: null,\n    socket: null,\n    socketState: null,\n    lastSocketEvent: null,\n    lastMessage: null,\n    testMessage: 'testMessage',\n    testExpectedResponse: 'testMessage_response'\n  };\n\n  _waitFor = (condition: any, timeout: any, callback: any) => {\n    var remaining = timeout;\n    var t;\n    var timeoutFunction =  function() {\n      if (condition()) {\n        callback(true);\n        return;\n      }\n      remaining--;\n      if (remaining === 0) {\n        callback(false);\n      } else {\n        t = setTimeout(timeoutFunction,1000);\n      }\n    };\n    t = setTimeout(timeoutFunction,1000);\n  }\n\n  _connect = () => {\n    const socket = new WebSocket(this.state.url);\n    WS_EVENTS.forEach(ev => socket.addEventListener(ev, this._onSocketEvent));\n    this.setState({\n      socket,\n      socketState: socket.readyState,\n    });\n  };\n\n  _socketIsConnected = () => {\n    return this.state.socketState === 1; //'OPEN'\n  }\n\n  _socketIsDisconnected = () => {\n    return this.state.socketState === 3; //'CLOSED'\n  }\n\n  _disconnect = () => {\n    if (!this.state.socket) {\n      return;\n    }\n    this.state.socket.close();\n  };\n\n  _onSocketEvent = (event: any) => {\n    const state: any = {\n      socketState: event.target.readyState,\n      lastSocketEvent: event.type,\n    };\n    if (event.type === 'message') {\n      state.lastMessage = event.data;\n    }\n    this.setState(state);\n  };\n\n  _sendText = (text: string) => {\n    if (!this.state.socket) {\n      return;\n    }\n    this.state.socket.send(text);\n  };\n\n  _sendTestMessage = () => {\n    this._sendText(this.state.testMessage);\n  };\n\n  _receivedTestExpectedResponse = () => {\n    return (this.state.lastMessage === this.state.testExpectedResponse);\n  };\n\n  componentDidMount() {\n    this.testConnect();\n  }\n\n  testConnect = () => {\n    var component = this;\n    component._connect();\n    component._waitFor(component._socketIsConnected, 5, function(connectSucceeded) {\n      if (!connectSucceeded) {\n        TestModule.markTestPassed(false);\n        return;\n      }\n      component.testSendAndReceive();\n    });\n  }\n\n  testSendAndReceive = () => {\n    var component = this;\n    component._sendTestMessage();\n    component._waitFor(component._receivedTestExpectedResponse, 5, function(messageReceived) {\n      if (!messageReceived) {\n        TestModule.markTestPassed(false);\n        return;\n      }\n      component.testDisconnect();\n    });\n  }\n\n  testDisconnect = () => {\n    var component = this;\n    component._disconnect();\n    component._waitFor(component._socketIsDisconnected, 5, function(disconnectSucceeded) {\n      TestModule.markTestPassed(disconnectSucceeded);\n    });\n  }\n\n  render(): React.Node {\n    return <View />;\n  }\n}\n\nWebSocketTest.displayName = 'WebSocketTest';\n\nmodule.exports = WebSocketTest;\n"
  },
  {
    "path": "IntegrationTests/WebViewTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule WebViewTest\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  WebView,\n} = ReactNative;\n\nvar { TestModule } = ReactNative.NativeModules;\n\nclass WebViewTest extends React.Component {\n\n  render() {\n    var firstMessageReceived = false;\n    var secondMessageReceived = false;\n    function processMessage(e) {\n      var message = e.nativeEvent.data;\n      if (message === 'First') {firstMessageReceived = true;}\n      if (message === 'Second') {secondMessageReceived = true;}\n\n      // got both messages\n      if (firstMessageReceived && secondMessageReceived) {TestModule.markTestPassed(true);}\n      // wait for next message\n      else if (firstMessageReceived && !secondMessageReceived) {return;}\n      // first message got lost\n      else if (!firstMessageReceived && secondMessageReceived) {throw new Error('First message got lost');}\n    }\n    var html = 'Hello world'\n      + '<script>'\n      + \"window.setTimeout(function(){window.postMessage('First'); window.postMessage('Second')}, 0)\"\n      + '</script>';\n\n    // fail if messages didn't get through;\n    window.setTimeout(function() { throw new Error(firstMessageReceived ? 'Both messages got lost' : 'Second message got lost');}, 10000);\n\n    var source = {\n      html: html,\n      };\n\n    return (\n      <WebView\n        source={source}\n        onMessage = {processMessage}\n        />\n    );\n  }\n}\n\nWebViewTest.displayName = 'WebViewTest';\n\nmodule.exports = WebViewTest;\n"
  },
  {
    "path": "IntegrationTests/launchWebSocketServer.command",
    "content": "#!/usr/bin/env bash\n\n# Copyright (c) 2015-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\n# Set terminal title\necho -en \"\\033]0;Web Socket Test Server\\a\"\nclear\n\nTHIS_DIR=$(dirname \"$0\")\npushd \"$THIS_DIR\"\n./websocket_integration_test_server.js\npopd\n\necho \"Process terminated. Press <enter> to close the window\"\nread\n"
  },
  {
    "path": "IntegrationTests/websocket_integration_test_server.js",
    "content": "#!/usr/bin/env node\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule websocket_integration_test_server\n */\n'use strict';\n\n/* eslint-env node */\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst WebSocket = require('ws');\n\nconsole.log(`\\\nWebSocket integration test server\n\nThis will send each incoming message back, with the string '_response' appended.\nAn incoming message of 'exit' will shut down the server.\n\n`);\n\nconst server = new WebSocket.Server({port: 5555});\nserver.on('connection', (ws) => {\n  ws.on('message', (message) => {\n    console.log('Received message:', message);\n    if (message === 'exit') {\n      console.log('WebSocket integration test server exit');\n      process.exit(0);\n    }\n    console.log('Cookie:', ws.upgradeReq.headers.cookie);\n    ws.send(message + '_response');\n  });\n\n  ws.send('hello');\n});\n"
  },
  {
    "path": "Jenkinsfile",
    "content": "import groovy.json.JsonSlurperClassic\n\ndef runPipeline() {\n    try {\n        ansiColor('xterm') {\n            runStages();\n        }\n    } catch(err) {\n        echo \"Error: ${err}\"\n        currentBuild.result = \"FAILED\"\n    }\n}\n\ndef pullDockerImage(imageName) {\n    def result = sh(script: \"docker pull ${imageName}\", returnStatus: true)\n\n    if (result != 0) {\n        throw new Exception(\"Failed to pull image[${imageName}]\")\n    }\n}\n\ndef buildDockerfile(dockerfilePath = \"Dockerfile\", imageName) {\n    def buildCmd = \"docker build -f ${dockerfilePath} -t ${imageName} .\"\n    echo \"${buildCmd}\"\n\n    def result = sh(script: buildCmd, returnStatus: true)\n\n    if (result != 0) {\n        throw new Exception(\"Failed to build image[${imageName}] from '${dockerfilePath}'\")\n    }\n}\n\ndef runCmdOnDockerImage(imageName, cmd, run_opts = '') {\n    def result = sh(script: \"docker run ${run_opts} -i ${imageName} sh -c '${cmd}'\", returnStatus: true)\n\n    if(result != 0) {\n        throw new Exception(\"Failed to run cmd[${cmd}] on image[${imageName}]\")\n    }\n}\n\ndef calculateGithubInfo() {\n    return [\n        branch: env.BRANCH_NAME,\n        sha: sh(returnStdout: true, script: 'git rev-parse HEAD').trim(),\n        tag: null,\n        isPR: \"${env.CHANGE_URL}\".contains('/pull/')\n    ]\n}\n\ndef getParallelInstrumentationTests(testDir, parallelCount, imageName) {\n    def integrationTests = [:]\n    def testCount = sh(script: \"ls ${testDir} | wc -l\", returnStdout: true).trim().toInteger()\n    def testPerParallel = testCount.intdiv(parallelCount) + 1\n\n    def ignoredTests = 'CatalystNativeJavaToJSReturnValuesTestCase|CatalystUIManagerTestCase|CatalystMeasureLayoutTest|CatalystNativeJavaToJSArgumentsTestCase|CatalystNativeJSToJavaParametersTestCase|ReactScrollViewTestCase|ReactHorizontalScrollViewTestCase|ViewRenderingTestCase';\n\n    for (def x = 0; (x*testPerParallel) < testCount; x++) {\n        def offset = x\n        integrationTests[\"android integration tests: ${offset}\"] = {\n            run: {\n                runCmdOnDockerImage(imageName, \"bash /app/ContainerShip/scripts/run-android-docker-instrumentation-tests.sh --offset=${offset} --count=${testPerParallel} --ignore=\\\"${ignoredTests}\\\"\", '--privileged --rm')\n            }\n        }\n    }\n\n    return integrationTests\n}\n\ndef runStages() {\n    def buildInfo = [\n        image: [\n            name: \"facebook/react-native\",\n            tag: null\n        ],\n        scm: [\n            branch: null,\n            sha: null,\n            tag: null,\n            isPR: false\n        ]\n    ]\n\n    node {\n        def jsDockerBuild, androidDockerBuild\n        def jsTag, androidTag, jsImageName, androidImageName, parallelInstrumentationTests\n\n        try {\n            stage('Setup') {\n                parallel(\n                    'pull images': {\n                        pullDockerImage('containership/android-base:latest')\n                    }\n                )\n            }\n\n            stage('Build') {\n                checkout scm\n\n                def githubInfo = calculateGithubInfo()\n                buildInfo.scm.branch = githubInfo.branch\n                buildInfo.scm.sha = githubInfo.sha\n                buildInfo.scm.tag = githubInfo.tag\n                buildInfo.scm.isPR = githubInfo.isPR\n                buildInfo.image.tag = \"${buildInfo.scm.sha}-${env.BUILD_TAG.replace(\" \", \"-\").replace(\"/\", \"-\").replace(\"%2F\", \"-\")}\"\n\n                jsTag = \"${buildInfo.image.tag}\"\n                androidTag = \"${buildInfo.image.tag}\"\n                jsImageName = \"${buildInfo.image.name}-js:${jsTag}\"\n                androidImageName = \"${buildInfo.image.name}-android:${androidTag}\"\n\n                parallelInstrumentationTests = getParallelInstrumentationTests('./ReactAndroid/src/androidTest/java/com/facebook/react/tests', 3, androidImageName)\n\n                parallel(\n                    'javascript build': {\n                        jsDockerBuild = docker.build(\"${jsImageName}\", \"-f ContainerShip/Dockerfile.javascript .\")\n                    },\n                    'android build': {\n                        androidDockerBuild = docker.build(\"${androidImageName}\", \"-f ContainerShip/Dockerfile.android .\")\n                    }\n                )\n\n            }\n\n            stage('Tests JS') {\n                try {\n                    parallel(\n                        'javascript flow': {\n                            runCmdOnDockerImage(jsImageName, 'yarn run flow -- check', '--rm')\n                        },\n                        'javascript tests': {\n                            runCmdOnDockerImage(jsImageName, 'yarn test --maxWorkers=4', '--rm')\n                        },\n                        'documentation tests': {\n                            runCmdOnDockerImage(jsImageName, 'cd website && yarn test', '--rm')\n                        },\n                        'documentation generation': {\n                            runCmdOnDockerImage(jsImageName, 'cd website && node ./server/generate.js', '--rm')\n                        }\n                    )\n                } catch(e) {\n                    currentBuild.result = \"FAILED\"\n                    echo \"Test JS Stage Error: ${e}\"\n                }\n            }\n\n            stage('Tests Android') {\n                try {\n                    parallel(\n                        'android unit tests': {\n                            runCmdOnDockerImage(androidImageName, 'bash /app/ContainerShip/scripts/run-android-docker-unit-tests.sh', '--privileged --rm')\n                        },\n                        'android e2e tests': {\n                            runCmdOnDockerImage(androidImageName, 'bash /app/ContainerShip/scripts/run-ci-e2e-tests.sh --android --js', '--privileged --rm')\n                        }\n                    )\n                } catch(e) {\n                    currentBuild.result = \"FAILED\"\n                    echo \"Tests Android Stage Error: ${e}\"\n                }\n            }\n\n            stage('Tests Android Instrumentation') {\n                // run all tests in parallel\n                try {\n                    parallel(parallelInstrumentationTests)\n                } catch(e) {\n                    currentBuild.result = \"FAILED\"\n                    echo \"Tests Android Instrumentation Stage Error: ${e}\"\n                }\n            }\n\n            stage('Cleanup') {\n                cleanupImage(jsDockerBuild)\n                cleanupImage(androidDockerBuild)\n            }\n        } catch(err) {\n            cleanupImage(jsDockerBuild)\n            cleanupImage(androidDockerBuild)\n\n            throw err\n        }\n    }\n\n}\n\ndef isMasterBranch() {\n    return env.GIT_BRANCH == 'master'\n}\n\ndef gitCommit() {\n    return sh(returnStdout: true, script: 'git rev-parse HEAD').trim()\n}\n\ndef cleanupImage(image) {\n    if (image) {\n        try {\n            sh \"docker ps -a | awk '{ print \\$1,\\$2 }' | grep ${image.id} | awk '{print \\$1 }' | xargs -I {} docker rm {}\"\n            sh \"docker rmi -f ${image.id}\"\n        } catch(e) {\n            echo \"Error cleaning up ${image.id}\"\n            echo \"${e}\"\n        }\n    }\n}\n\nrunPipeline()\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2015-present, Facebook, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "LICENSE-docs",
    "content": "Attribution 4.0 International\n\n=======================================================================\n\nCreative Commons Corporation (\"Creative Commons\") is not a law firm and\ndoes not provide legal services or legal advice. Distribution of\nCreative Commons public licenses does not create a lawyer-client or\nother relationship. Creative Commons makes its licenses and related\ninformation available on an \"as-is\" basis. Creative Commons gives no\nwarranties regarding its licenses, any material licensed under their\nterms and conditions, or any related information. Creative Commons\ndisclaims all liability for damages resulting from their use to the\nfullest extent possible.\n\nUsing Creative Commons Public Licenses\n\nCreative Commons public licenses provide a standard set of terms and\nconditions that creators and other rights holders may use to share\noriginal works of authorship and other material subject to copyright\nand certain other rights specified in the public license below. The\nfollowing considerations are for informational purposes only, are not\nexhaustive, and do not form part of our licenses.\n\n     Considerations for licensors: Our public licenses are\n     intended for use by those authorized to give the public\n     permission to use material in ways otherwise restricted by\n     copyright and certain other rights. Our licenses are\n     irrevocable. Licensors should read and understand the terms\n     and conditions of the license they choose before applying it.\n     Licensors should also secure all rights necessary before\n     applying our licenses so that the public can reuse the\n     material as expected. Licensors should clearly mark any\n     material not subject to the license. This includes other CC-\n     licensed material, or material used under an exception or\n     limitation to copyright. More considerations for licensors:\n  wiki.creativecommons.org/Considerations_for_licensors\n\n     Considerations for the public: By using one of our public\n     licenses, a licensor grants the public permission to use the\n     licensed material under specified terms and conditions. If\n     the licensor's permission is not necessary for any reason--for\n     example, because of any applicable exception or limitation to\n     copyright--then that use is not regulated by the license. Our\n     licenses grant only permissions under copyright and certain\n     other rights that a licensor has authority to grant. Use of\n     the licensed material may still be restricted for other\n     reasons, including because others have copyright or other\n     rights in the material. A licensor may make special requests,\n     such as asking that all changes be marked or described.\n     Although not required by our licenses, you are encouraged to\n     respect those requests where reasonable. More_considerations\n     for the public:\n  wiki.creativecommons.org/Considerations_for_licensees\n\n=======================================================================\n\nCreative Commons Attribution 4.0 International Public License\n\nBy exercising the Licensed Rights (defined below), You accept and agree\nto be bound by the terms and conditions of this Creative Commons\nAttribution 4.0 International Public License (\"Public License\"). To the\nextent this Public License may be interpreted as a contract, You are\ngranted the Licensed Rights in consideration of Your acceptance of\nthese terms and conditions, and the Licensor grants You such rights in\nconsideration of benefits the Licensor receives from making the\nLicensed Material available under these terms and conditions.\n\n\nSection 1 -- Definitions.\n\n  a. Adapted Material means material subject to Copyright and Similar\n     Rights that is derived from or based upon the Licensed Material\n     and in which the Licensed Material is translated, altered,\n     arranged, transformed, or otherwise modified in a manner requiring\n     permission under the Copyright and Similar Rights held by the\n     Licensor. For purposes of this Public License, where the Licensed\n     Material is a musical work, performance, or sound recording,\n     Adapted Material is always produced where the Licensed Material is\n     synched in timed relation with a moving image.\n\n  b. Adapter's License means the license You apply to Your Copyright\n     and Similar Rights in Your contributions to Adapted Material in\n     accordance with the terms and conditions of this Public License.\n\n  c. Copyright and Similar Rights means copyright and/or similar rights\n     closely related to copyright including, without limitation,\n     performance, broadcast, sound recording, and Sui Generis Database\n     Rights, without regard to how the rights are labeled or\n     categorized. For purposes of this Public License, the rights\n     specified in Section 2(b)(1)-(2) are not Copyright and Similar\n     Rights.\n\n  d. Effective Technological Measures means those measures that, in the\n     absence of proper authority, may not be circumvented under laws\n     fulfilling obligations under Article 11 of the WIPO Copyright\n     Treaty adopted on December 20, 1996, and/or similar international\n     agreements.\n\n  e. Exceptions and Limitations means fair use, fair dealing, and/or\n     any other exception or limitation to Copyright and Similar Rights\n     that applies to Your use of the Licensed Material.\n\n  f. Licensed Material means the artistic or literary work, database,\n     or other material to which the Licensor applied this Public\n     License.\n\n  g. Licensed Rights means the rights granted to You subject to the\n     terms and conditions of this Public License, which are limited to\n     all Copyright and Similar Rights that apply to Your use of the\n     Licensed Material and that the Licensor has authority to license.\n\n  h. Licensor means the individual(s) or entity(ies) granting rights\n     under this Public License.\n\n  i. Share means to provide material to the public by any means or\n     process that requires permission under the Licensed Rights, such\n     as reproduction, public display, public performance, distribution,\n     dissemination, communication, or importation, and to make material\n     available to the public including in ways that members of the\n     public may access the material from a place and at a time\n     individually chosen by them.\n\n  j. Sui Generis Database Rights means rights other than copyright\n     resulting from Directive 96/9/EC of the European Parliament and of\n     the Council of 11 March 1996 on the legal protection of databases,\n     as amended and/or succeeded, as well as other essentially\n     equivalent rights anywhere in the world.\n\n  k. You means the individual or entity exercising the Licensed Rights\n     under this Public License. Your has a corresponding meaning.\n\n\nSection 2 -- Scope.\n\n  a. License grant.\n\n       1. Subject to the terms and conditions of this Public License,\n          the Licensor hereby grants You a worldwide, royalty-free,\n          non-sublicensable, non-exclusive, irrevocable license to\n          exercise the Licensed Rights in the Licensed Material to:\n\n            a. reproduce and Share the Licensed Material, in whole or\n               in part; and\n\n            b. produce, reproduce, and Share Adapted Material.\n\n       2. Exceptions and Limitations. For the avoidance of doubt, where\n          Exceptions and Limitations apply to Your use, this Public\n          License does not apply, and You do not need to comply with\n          its terms and conditions.\n\n       3. Term. The term of this Public License is specified in Section\n          6(a).\n\n       4. Media and formats; technical modifications allowed. The\n          Licensor authorizes You to exercise the Licensed Rights in\n          all media and formats whether now known or hereafter created,\n          and to make technical modifications necessary to do so. The\n          Licensor waives and/or agrees not to assert any right or\n          authority to forbid You from making technical modifications\n          necessary to exercise the Licensed Rights, including\n          technical modifications necessary to circumvent Effective\n          Technological Measures. For purposes of this Public License,\n          simply making modifications authorized by this Section 2(a)\n          (4) never produces Adapted Material.\n\n       5. Downstream recipients.\n\n            a. Offer from the Licensor -- Licensed Material. Every\n               recipient of the Licensed Material automatically\n               receives an offer from the Licensor to exercise the\n               Licensed Rights under the terms and conditions of this\n               Public License.\n\n            b. No downstream restrictions. You may not offer or impose\n               any additional or different terms or conditions on, or\n               apply any Effective Technological Measures to, the\n               Licensed Material if doing so restricts exercise of the\n               Licensed Rights by any recipient of the Licensed\n               Material.\n\n       6. No endorsement. Nothing in this Public License constitutes or\n          may be construed as permission to assert or imply that You\n          are, or that Your use of the Licensed Material is, connected\n          with, or sponsored, endorsed, or granted official status by,\n          the Licensor or others designated to receive attribution as\n          provided in Section 3(a)(1)(A)(i).\n\n  b. Other rights.\n\n       1. Moral rights, such as the right of integrity, are not\n          licensed under this Public License, nor are publicity,\n          privacy, and/or other similar personality rights; however, to\n          the extent possible, the Licensor waives and/or agrees not to\n          assert any such rights held by the Licensor to the limited\n          extent necessary to allow You to exercise the Licensed\n          Rights, but not otherwise.\n\n       2. Patent and trademark rights are not licensed under this\n          Public License.\n\n       3. To the extent possible, the Licensor waives any right to\n          collect royalties from You for the exercise of the Licensed\n          Rights, whether directly or through a collecting society\n          under any voluntary or waivable statutory or compulsory\n          licensing scheme. In all other cases the Licensor expressly\n          reserves any right to collect such royalties.\n\n\nSection 3 -- License Conditions.\n\nYour exercise of the Licensed Rights is expressly made subject to the\nfollowing conditions.\n\n  a. Attribution.\n\n       1. If You Share the Licensed Material (including in modified\n          form), You must:\n\n            a. retain the following if it is supplied by the Licensor\n               with the Licensed Material:\n\n                 i. identification of the creator(s) of the Licensed\n                    Material and any others designated to receive\n                    attribution, in any reasonable manner requested by\n                    the Licensor (including by pseudonym if\n                    designated);\n\n                ii. a copyright notice;\n\n               iii. a notice that refers to this Public License;\n\n                iv. a notice that refers to the disclaimer of\n                    warranties;\n\n                 v. a URI or hyperlink to the Licensed Material to the\n                    extent reasonably practicable;\n\n            b. indicate if You modified the Licensed Material and\n               retain an indication of any previous modifications; and\n\n            c. indicate the Licensed Material is licensed under this\n               Public License, and include the text of, or the URI or\n               hyperlink to, this Public License.\n\n       2. You may satisfy the conditions in Section 3(a)(1) in any\n          reasonable manner based on the medium, means, and context in\n          which You Share the Licensed Material. For example, it may be\n          reasonable to satisfy the conditions by providing a URI or\n          hyperlink to a resource that includes the required\n          information.\n\n       3. If requested by the Licensor, You must remove any of the\n          information required by Section 3(a)(1)(A) to the extent\n          reasonably practicable.\n\n       4. If You Share Adapted Material You produce, the Adapter's\n          License You apply must not prevent recipients of the Adapted\n          Material from complying with this Public License.\n\n\nSection 4 -- Sui Generis Database Rights.\n\nWhere the Licensed Rights include Sui Generis Database Rights that\napply to Your use of the Licensed Material:\n\n  a. for the avoidance of doubt, Section 2(a)(1) grants You the right\n     to extract, reuse, reproduce, and Share all or a substantial\n     portion of the contents of the database;\n\n  b. if You include all or a substantial portion of the database\n     contents in a database in which You have Sui Generis Database\n     Rights, then the database in which You have Sui Generis Database\n     Rights (but not its individual contents) is Adapted Material; and\n\n  c. You must comply with the conditions in Section 3(a) if You Share\n     all or a substantial portion of the contents of the database.\n\nFor the avoidance of doubt, this Section 4 supplements and does not\nreplace Your obligations under this Public License where the Licensed\nRights include other Copyright and Similar Rights.\n\n\nSection 5 -- Disclaimer of Warranties and Limitation of Liability.\n\n  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE\n     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS\n     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF\n     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,\n     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,\n     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR\n     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,\n     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT\n     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT\n     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.\n\n  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE\n     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,\n     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,\n     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,\n     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR\n     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN\n     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR\n     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR\n     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.\n\n  c. The disclaimer of warranties and limitation of liability provided\n     above shall be interpreted in a manner that, to the extent\n     possible, most closely approximates an absolute disclaimer and\n     waiver of all liability.\n\n\nSection 6 -- Term and Termination.\n\n  a. This Public License applies for the term of the Copyright and\n     Similar Rights licensed here. However, if You fail to comply with\n     this Public License, then Your rights under this Public License\n     terminate automatically.\n\n  b. Where Your right to use the Licensed Material has terminated under\n     Section 6(a), it reinstates:\n\n       1. automatically as of the date the violation is cured, provided\n          it is cured within 30 days of Your discovery of the\n          violation; or\n\n       2. upon express reinstatement by the Licensor.\n\n     For the avoidance of doubt, this Section 6(b) does not affect any\n     right the Licensor may have to seek remedies for Your violations\n     of this Public License.\n\n  c. For the avoidance of doubt, the Licensor may also offer the\n     Licensed Material under separate terms or conditions or stop\n     distributing the Licensed Material at any time; however, doing so\n     will not terminate this Public License.\n\n  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public\n     License.\n\n\nSection 7 -- Other Terms and Conditions.\n\n  a. The Licensor shall not be bound by any additional or different\n     terms or conditions communicated by You unless expressly agreed.\n\n  b. Any arrangements, understandings, or agreements regarding the\n     Licensed Material not stated herein are separate from and\n     independent of the terms and conditions of this Public License.\n\n\nSection 8 -- Interpretation.\n\n  a. For the avoidance of doubt, this Public License does not, and\n     shall not be interpreted to, reduce, limit, restrict, or impose\n     conditions on any use of the Licensed Material that could lawfully\n     be made without permission under this Public License.\n\n  b. To the extent possible, if any provision of this Public License is\n     deemed unenforceable, it shall be automatically reformed to the\n     minimum extent necessary to make it enforceable. If the provision\n     cannot be reformed, it shall be severed from this Public License\n     without affecting the enforceability of the remaining terms and\n     conditions.\n\n  c. No term or condition of this Public License will be waived and no\n     failure to comply consented to unless expressly agreed to by the\n     Licensor.\n\n  d. Nothing in this Public License constitutes or may be interpreted\n     as a limitation upon, or waiver of, any privileges and immunities\n     that apply to the Licensor or You, including from the legal\n     processes of any jurisdiction or authority.\n\n\n=======================================================================\n\nCreative Commons is not a party to its public licenses.\nNotwithstanding, Creative Commons may elect to apply one of its public\nlicenses to material it publishes and in those instances will be\nconsidered the \"Licensor.\" Except for the limited purpose of indicating\nthat material is shared under a Creative Commons public license or as\notherwise permitted by the Creative Commons policies published at\ncreativecommons.org/policies, Creative Commons does not authorize the\nuse of the trademark \"Creative Commons\" or any other trademark or logo\nof Creative Commons without its prior written consent including,\nwithout limitation, in connection with any unauthorized modifications\nto any of its public licenses or any other arrangements,\nunderstandings, or agreements concerning use of licensed material. For\nthe avoidance of doubt, this paragraph does not form part of the public\nlicenses.\n\nCreative Commons may be contacted at creativecommons.org.\n"
  },
  {
    "path": "Libraries/.eslintrc",
    "content": "{\n  \"rules\": {\n    // This folder currently runs through babel and doesn't need to be\n    // compatible with node 4\n    \"comma-dangle\": 0\n  }\n}\n"
  },
  {
    "path": "Libraries/ART/ART.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t0CF68B051AF0549300FF9E5C /* ARTGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68ADE1AF0549300FF9E5C /* ARTGroup.m */; };\n\t\t0CF68B061AF0549300FF9E5C /* ARTNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE01AF0549300FF9E5C /* ARTNode.m */; };\n\t\t0CF68B071AF0549300FF9E5C /* ARTRenderable.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE21AF0549300FF9E5C /* ARTRenderable.m */; };\n\t\t0CF68B081AF0549300FF9E5C /* ARTShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE41AF0549300FF9E5C /* ARTShape.m */; };\n\t\t0CF68B091AF0549300FF9E5C /* ARTSurfaceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE61AF0549300FF9E5C /* ARTSurfaceView.m */; };\n\t\t0CF68B0A1AF0549300FF9E5C /* ARTText.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE81AF0549300FF9E5C /* ARTText.m */; };\n\t\t0CF68B0B1AF0549300FF9E5C /* ARTBrush.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AEC1AF0549300FF9E5C /* ARTBrush.m */; };\n\t\t0CF68B0C1AF0549300FF9E5C /* ARTLinearGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AEE1AF0549300FF9E5C /* ARTLinearGradient.m */; };\n\t\t0CF68B0D1AF0549300FF9E5C /* ARTPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF01AF0549300FF9E5C /* ARTPattern.m */; };\n\t\t0CF68B0E1AF0549300FF9E5C /* ARTRadialGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF21AF0549300FF9E5C /* ARTRadialGradient.m */; };\n\t\t0CF68B0F1AF0549300FF9E5C /* ARTSolidColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF41AF0549300FF9E5C /* ARTSolidColor.m */; };\n\t\t0CF68B101AF0549300FF9E5C /* RCTConvert+ART.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF71AF0549300FF9E5C /* RCTConvert+ART.m */; };\n\t\t0CF68B111AF0549300FF9E5C /* ARTGroupManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFA1AF0549300FF9E5C /* ARTGroupManager.m */; };\n\t\t0CF68B121AF0549300FF9E5C /* ARTNodeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFC1AF0549300FF9E5C /* ARTNodeManager.m */; };\n\t\t0CF68B131AF0549300FF9E5C /* ARTRenderableManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFE1AF0549300FF9E5C /* ARTRenderableManager.m */; };\n\t\t0CF68B141AF0549300FF9E5C /* ARTShapeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B001AF0549300FF9E5C /* ARTShapeManager.m */; };\n\t\t0CF68B151AF0549300FF9E5C /* ARTSurfaceViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B021AF0549300FF9E5C /* ARTSurfaceViewManager.m */; };\n\t\t0CF68B161AF0549300FF9E5C /* ARTTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B041AF0549300FF9E5C /* ARTTextManager.m */; };\n\t\t325CF7AD1E5F2ABA00AC9606 /* ARTBrush.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AEC1AF0549300FF9E5C /* ARTBrush.m */; };\n\t\t325CF7AE1E5F2ABA00AC9606 /* ARTLinearGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AEE1AF0549300FF9E5C /* ARTLinearGradient.m */; };\n\t\t325CF7AF1E5F2ABA00AC9606 /* ARTPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF01AF0549300FF9E5C /* ARTPattern.m */; };\n\t\t325CF7B01E5F2ABA00AC9606 /* ARTRadialGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF21AF0549300FF9E5C /* ARTRadialGradient.m */; };\n\t\t325CF7B11E5F2ABA00AC9606 /* ARTSolidColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF41AF0549300FF9E5C /* ARTSolidColor.m */; };\n\t\t325CF7B21E5F2ABA00AC9606 /* ARTGroupManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFA1AF0549300FF9E5C /* ARTGroupManager.m */; };\n\t\t325CF7B31E5F2ABA00AC9606 /* ARTNodeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFC1AF0549300FF9E5C /* ARTNodeManager.m */; };\n\t\t325CF7B41E5F2ABA00AC9606 /* ARTRenderableManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFE1AF0549300FF9E5C /* ARTRenderableManager.m */; };\n\t\t325CF7B51E5F2ABA00AC9606 /* ARTShapeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B001AF0549300FF9E5C /* ARTShapeManager.m */; };\n\t\t325CF7B61E5F2ABA00AC9606 /* ARTSurfaceViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B021AF0549300FF9E5C /* ARTSurfaceViewManager.m */; };\n\t\t325CF7B71E5F2ABA00AC9606 /* ARTTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B041AF0549300FF9E5C /* ARTTextManager.m */; };\n\t\t325CF7B81E5F2ABA00AC9606 /* ARTGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68ADE1AF0549300FF9E5C /* ARTGroup.m */; };\n\t\t325CF7B91E5F2ABA00AC9606 /* ARTNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE01AF0549300FF9E5C /* ARTNode.m */; };\n\t\t325CF7BA1E5F2ABA00AC9606 /* ARTRenderable.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE21AF0549300FF9E5C /* ARTRenderable.m */; };\n\t\t325CF7BB1E5F2ABA00AC9606 /* ARTShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE41AF0549300FF9E5C /* ARTShape.m */; };\n\t\t325CF7BC1E5F2ABA00AC9606 /* ARTSurfaceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE61AF0549300FF9E5C /* ARTSurfaceView.m */; };\n\t\t325CF7BD1E5F2ABA00AC9606 /* ARTText.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE81AF0549300FF9E5C /* ARTText.m */; };\n\t\t325CF7BE1E5F2ABA00AC9606 /* RCTConvert+ART.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF71AF0549300FF9E5C /* RCTConvert+ART.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t0CF68ABF1AF0540F00FF9E5C /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/$(PRODUCT_NAME)\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t323A12851E5F266B004975B8 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/$(PRODUCT_NAME)\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t0CF68AC11AF0540F00FF9E5C /* libART.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libART.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t0CF68ADB1AF0549300FF9E5C /* ARTCGFloatArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTCGFloatArray.h; sourceTree = \"<group>\"; };\n\t\t0CF68ADC1AF0549300FF9E5C /* ARTContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTContainer.h; sourceTree = \"<group>\"; };\n\t\t0CF68ADD1AF0549300FF9E5C /* ARTGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTGroup.h; sourceTree = \"<group>\"; };\n\t\t0CF68ADE1AF0549300FF9E5C /* ARTGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTGroup.m; sourceTree = \"<group>\"; };\n\t\t0CF68ADF1AF0549300FF9E5C /* ARTNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTNode.h; sourceTree = \"<group>\"; };\n\t\t0CF68AE01AF0549300FF9E5C /* ARTNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTNode.m; sourceTree = \"<group>\"; };\n\t\t0CF68AE11AF0549300FF9E5C /* ARTRenderable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTRenderable.h; sourceTree = \"<group>\"; };\n\t\t0CF68AE21AF0549300FF9E5C /* ARTRenderable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTRenderable.m; sourceTree = \"<group>\"; };\n\t\t0CF68AE31AF0549300FF9E5C /* ARTShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTShape.h; sourceTree = \"<group>\"; };\n\t\t0CF68AE41AF0549300FF9E5C /* ARTShape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTShape.m; sourceTree = \"<group>\"; };\n\t\t0CF68AE51AF0549300FF9E5C /* ARTSurfaceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTSurfaceView.h; sourceTree = \"<group>\"; };\n\t\t0CF68AE61AF0549300FF9E5C /* ARTSurfaceView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTSurfaceView.m; sourceTree = \"<group>\"; };\n\t\t0CF68AE71AF0549300FF9E5C /* ARTText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTText.h; sourceTree = \"<group>\"; };\n\t\t0CF68AE81AF0549300FF9E5C /* ARTText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTText.m; sourceTree = \"<group>\"; };\n\t\t0CF68AE91AF0549300FF9E5C /* ARTTextFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTTextFrame.h; sourceTree = \"<group>\"; };\n\t\t0CF68AEB1AF0549300FF9E5C /* ARTBrush.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTBrush.h; sourceTree = \"<group>\"; };\n\t\t0CF68AEC1AF0549300FF9E5C /* ARTBrush.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTBrush.m; sourceTree = \"<group>\"; };\n\t\t0CF68AED1AF0549300FF9E5C /* ARTLinearGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTLinearGradient.h; sourceTree = \"<group>\"; };\n\t\t0CF68AEE1AF0549300FF9E5C /* ARTLinearGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTLinearGradient.m; sourceTree = \"<group>\"; };\n\t\t0CF68AEF1AF0549300FF9E5C /* ARTPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTPattern.h; sourceTree = \"<group>\"; };\n\t\t0CF68AF01AF0549300FF9E5C /* ARTPattern.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTPattern.m; sourceTree = \"<group>\"; };\n\t\t0CF68AF11AF0549300FF9E5C /* ARTRadialGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTRadialGradient.h; sourceTree = \"<group>\"; };\n\t\t0CF68AF21AF0549300FF9E5C /* ARTRadialGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTRadialGradient.m; sourceTree = \"<group>\"; };\n\t\t0CF68AF31AF0549300FF9E5C /* ARTSolidColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTSolidColor.h; sourceTree = \"<group>\"; };\n\t\t0CF68AF41AF0549300FF9E5C /* ARTSolidColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTSolidColor.m; sourceTree = \"<group>\"; };\n\t\t0CF68AF61AF0549300FF9E5C /* RCTConvert+ART.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"RCTConvert+ART.h\"; sourceTree = \"<group>\"; };\n\t\t0CF68AF71AF0549300FF9E5C /* RCTConvert+ART.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"RCTConvert+ART.m\"; sourceTree = \"<group>\"; };\n\t\t0CF68AF91AF0549300FF9E5C /* ARTGroupManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTGroupManager.h; sourceTree = \"<group>\"; };\n\t\t0CF68AFA1AF0549300FF9E5C /* ARTGroupManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTGroupManager.m; sourceTree = \"<group>\"; };\n\t\t0CF68AFB1AF0549300FF9E5C /* ARTNodeManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTNodeManager.h; sourceTree = \"<group>\"; };\n\t\t0CF68AFC1AF0549300FF9E5C /* ARTNodeManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTNodeManager.m; sourceTree = \"<group>\"; };\n\t\t0CF68AFD1AF0549300FF9E5C /* ARTRenderableManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTRenderableManager.h; sourceTree = \"<group>\"; };\n\t\t0CF68AFE1AF0549300FF9E5C /* ARTRenderableManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTRenderableManager.m; sourceTree = \"<group>\"; };\n\t\t0CF68AFF1AF0549300FF9E5C /* ARTShapeManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTShapeManager.h; sourceTree = \"<group>\"; };\n\t\t0CF68B001AF0549300FF9E5C /* ARTShapeManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTShapeManager.m; sourceTree = \"<group>\"; };\n\t\t0CF68B011AF0549300FF9E5C /* ARTSurfaceViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTSurfaceViewManager.h; sourceTree = \"<group>\"; };\n\t\t0CF68B021AF0549300FF9E5C /* ARTSurfaceViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTSurfaceViewManager.m; sourceTree = \"<group>\"; };\n\t\t0CF68B031AF0549300FF9E5C /* ARTTextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTTextManager.h; sourceTree = \"<group>\"; };\n\t\t0CF68B041AF0549300FF9E5C /* ARTTextManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTTextManager.m; sourceTree = \"<group>\"; };\n\t\t323A12871E5F266B004975B8 /* libART-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libART-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t0CF68ABE1AF0540F00FF9E5C /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t323A12841E5F266B004975B8 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t0CF68AB81AF0540F00FF9E5C = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0CF68AEA1AF0549300FF9E5C /* Brushes */,\n\t\t\t\t0CF68AF81AF0549300FF9E5C /* ViewManagers */,\n\t\t\t\t0CF68ADB1AF0549300FF9E5C /* ARTCGFloatArray.h */,\n\t\t\t\t0CF68ADC1AF0549300FF9E5C /* ARTContainer.h */,\n\t\t\t\t0CF68ADD1AF0549300FF9E5C /* ARTGroup.h */,\n\t\t\t\t0CF68ADE1AF0549300FF9E5C /* ARTGroup.m */,\n\t\t\t\t0CF68ADF1AF0549300FF9E5C /* ARTNode.h */,\n\t\t\t\t0CF68AE01AF0549300FF9E5C /* ARTNode.m */,\n\t\t\t\t0CF68AE11AF0549300FF9E5C /* ARTRenderable.h */,\n\t\t\t\t0CF68AE21AF0549300FF9E5C /* ARTRenderable.m */,\n\t\t\t\t0CF68AE31AF0549300FF9E5C /* ARTShape.h */,\n\t\t\t\t0CF68AE41AF0549300FF9E5C /* ARTShape.m */,\n\t\t\t\t0CF68AE51AF0549300FF9E5C /* ARTSurfaceView.h */,\n\t\t\t\t0CF68AE61AF0549300FF9E5C /* ARTSurfaceView.m */,\n\t\t\t\t0CF68AE71AF0549300FF9E5C /* ARTText.h */,\n\t\t\t\t0CF68AE81AF0549300FF9E5C /* ARTText.m */,\n\t\t\t\t0CF68AE91AF0549300FF9E5C /* ARTTextFrame.h */,\n\t\t\t\t0CF68AF61AF0549300FF9E5C /* RCTConvert+ART.h */,\n\t\t\t\t0CF68AF71AF0549300FF9E5C /* RCTConvert+ART.m */,\n\t\t\t\t0CF68AC21AF0540F00FF9E5C /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t0CF68AC21AF0540F00FF9E5C /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0CF68AC11AF0540F00FF9E5C /* libART.a */,\n\t\t\t\t323A12871E5F266B004975B8 /* libART-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0CF68AEA1AF0549300FF9E5C /* Brushes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0CF68AEB1AF0549300FF9E5C /* ARTBrush.h */,\n\t\t\t\t0CF68AEC1AF0549300FF9E5C /* ARTBrush.m */,\n\t\t\t\t0CF68AED1AF0549300FF9E5C /* ARTLinearGradient.h */,\n\t\t\t\t0CF68AEE1AF0549300FF9E5C /* ARTLinearGradient.m */,\n\t\t\t\t0CF68AEF1AF0549300FF9E5C /* ARTPattern.h */,\n\t\t\t\t0CF68AF01AF0549300FF9E5C /* ARTPattern.m */,\n\t\t\t\t0CF68AF11AF0549300FF9E5C /* ARTRadialGradient.h */,\n\t\t\t\t0CF68AF21AF0549300FF9E5C /* ARTRadialGradient.m */,\n\t\t\t\t0CF68AF31AF0549300FF9E5C /* ARTSolidColor.h */,\n\t\t\t\t0CF68AF41AF0549300FF9E5C /* ARTSolidColor.m */,\n\t\t\t);\n\t\t\tpath = Brushes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0CF68AF81AF0549300FF9E5C /* ViewManagers */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0CF68AF91AF0549300FF9E5C /* ARTGroupManager.h */,\n\t\t\t\t0CF68AFA1AF0549300FF9E5C /* ARTGroupManager.m */,\n\t\t\t\t0CF68AFB1AF0549300FF9E5C /* ARTNodeManager.h */,\n\t\t\t\t0CF68AFC1AF0549300FF9E5C /* ARTNodeManager.m */,\n\t\t\t\t0CF68AFD1AF0549300FF9E5C /* ARTRenderableManager.h */,\n\t\t\t\t0CF68AFE1AF0549300FF9E5C /* ARTRenderableManager.m */,\n\t\t\t\t0CF68AFF1AF0549300FF9E5C /* ARTShapeManager.h */,\n\t\t\t\t0CF68B001AF0549300FF9E5C /* ARTShapeManager.m */,\n\t\t\t\t0CF68B011AF0549300FF9E5C /* ARTSurfaceViewManager.h */,\n\t\t\t\t0CF68B021AF0549300FF9E5C /* ARTSurfaceViewManager.m */,\n\t\t\t\t0CF68B031AF0549300FF9E5C /* ARTTextManager.h */,\n\t\t\t\t0CF68B041AF0549300FF9E5C /* ARTTextManager.m */,\n\t\t\t);\n\t\t\tpath = ViewManagers;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t0CF68AC01AF0540F00FF9E5C /* ART */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 0CF68AD51AF0540F00FF9E5C /* Build configuration list for PBXNativeTarget \"ART\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t0CF68ABD1AF0540F00FF9E5C /* Sources */,\n\t\t\t\t0CF68ABE1AF0540F00FF9E5C /* Frameworks */,\n\t\t\t\t0CF68ABF1AF0540F00FF9E5C /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = ART;\n\t\t\tproductName = ART;\n\t\t\tproductReference = 0CF68AC11AF0540F00FF9E5C /* libART.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t323A12861E5F266B004975B8 /* ART-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 323A128D1E5F266B004975B8 /* Build configuration list for PBXNativeTarget \"ART-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t323A12831E5F266B004975B8 /* Sources */,\n\t\t\t\t323A12841E5F266B004975B8 /* Frameworks */,\n\t\t\t\t323A12851E5F266B004975B8 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"ART-tvOS\";\n\t\t\tproductName = \"ART-tvOS\";\n\t\t\tproductReference = 323A12871E5F266B004975B8 /* libART-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t0CF68AB91AF0540F00FF9E5C /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0620;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t0CF68AC01AF0540F00FF9E5C = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.2;\n\t\t\t\t\t};\n\t\t\t\t\t323A12861E5F266B004975B8 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.2;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 0CF68ABC1AF0540F00FF9E5C /* Build configuration list for PBXProject \"ART\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 0CF68AB81AF0540F00FF9E5C;\n\t\t\tproductRefGroup = 0CF68AC21AF0540F00FF9E5C /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t0CF68AC01AF0540F00FF9E5C /* ART */,\n\t\t\t\t323A12861E5F266B004975B8 /* ART-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t0CF68ABD1AF0540F00FF9E5C /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0CF68B161AF0549300FF9E5C /* ARTTextManager.m in Sources */,\n\t\t\t\t0CF68B111AF0549300FF9E5C /* ARTGroupManager.m in Sources */,\n\t\t\t\t0CF68B0D1AF0549300FF9E5C /* ARTPattern.m in Sources */,\n\t\t\t\t0CF68B0A1AF0549300FF9E5C /* ARTText.m in Sources */,\n\t\t\t\t0CF68B121AF0549300FF9E5C /* ARTNodeManager.m in Sources */,\n\t\t\t\t0CF68B051AF0549300FF9E5C /* ARTGroup.m in Sources */,\n\t\t\t\t0CF68B131AF0549300FF9E5C /* ARTRenderableManager.m in Sources */,\n\t\t\t\t0CF68B091AF0549300FF9E5C /* ARTSurfaceView.m in Sources */,\n\t\t\t\t0CF68B0E1AF0549300FF9E5C /* ARTRadialGradient.m in Sources */,\n\t\t\t\t0CF68B151AF0549300FF9E5C /* ARTSurfaceViewManager.m in Sources */,\n\t\t\t\t0CF68B081AF0549300FF9E5C /* ARTShape.m in Sources */,\n\t\t\t\t0CF68B071AF0549300FF9E5C /* ARTRenderable.m in Sources */,\n\t\t\t\t0CF68B101AF0549300FF9E5C /* RCTConvert+ART.m in Sources */,\n\t\t\t\t0CF68B061AF0549300FF9E5C /* ARTNode.m in Sources */,\n\t\t\t\t0CF68B0F1AF0549300FF9E5C /* ARTSolidColor.m in Sources */,\n\t\t\t\t0CF68B0C1AF0549300FF9E5C /* ARTLinearGradient.m in Sources */,\n\t\t\t\t0CF68B0B1AF0549300FF9E5C /* ARTBrush.m in Sources */,\n\t\t\t\t0CF68B141AF0549300FF9E5C /* ARTShapeManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t323A12831E5F266B004975B8 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t325CF7B71E5F2ABA00AC9606 /* ARTTextManager.m in Sources */,\n\t\t\t\t325CF7B21E5F2ABA00AC9606 /* ARTGroupManager.m in Sources */,\n\t\t\t\t325CF7AF1E5F2ABA00AC9606 /* ARTPattern.m in Sources */,\n\t\t\t\t325CF7BD1E5F2ABA00AC9606 /* ARTText.m in Sources */,\n\t\t\t\t325CF7B31E5F2ABA00AC9606 /* ARTNodeManager.m in Sources */,\n\t\t\t\t325CF7B81E5F2ABA00AC9606 /* ARTGroup.m in Sources */,\n\t\t\t\t325CF7B41E5F2ABA00AC9606 /* ARTRenderableManager.m in Sources */,\n\t\t\t\t325CF7BC1E5F2ABA00AC9606 /* ARTSurfaceView.m in Sources */,\n\t\t\t\t325CF7B01E5F2ABA00AC9606 /* ARTRadialGradient.m in Sources */,\n\t\t\t\t325CF7B61E5F2ABA00AC9606 /* ARTSurfaceViewManager.m in Sources */,\n\t\t\t\t325CF7BB1E5F2ABA00AC9606 /* ARTShape.m in Sources */,\n\t\t\t\t325CF7BA1E5F2ABA00AC9606 /* ARTRenderable.m in Sources */,\n\t\t\t\t325CF7BE1E5F2ABA00AC9606 /* RCTConvert+ART.m in Sources */,\n\t\t\t\t325CF7B91E5F2ABA00AC9606 /* ARTNode.m in Sources */,\n\t\t\t\t325CF7B11E5F2ABA00AC9606 /* ARTSolidColor.m in Sources */,\n\t\t\t\t325CF7AE1E5F2ABA00AC9606 /* ARTLinearGradient.m in Sources */,\n\t\t\t\t325CF7AD1E5F2ABA00AC9606 /* ARTBrush.m in Sources */,\n\t\t\t\t325CF7B51E5F2ABA00AC9606 /* ARTShapeManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t0CF68AD31AF0540F00FF9E5C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t0CF68AD41AF0540F00FF9E5C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t0CF68AD61AF0540F00FF9E5C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t0CF68AD71AF0540F00FF9E5C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t323A128E1E5F266B004975B8 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t323A128F1E5F266B004975B8 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t0CF68ABC1AF0540F00FF9E5C /* Build configuration list for PBXProject \"ART\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t0CF68AD31AF0540F00FF9E5C /* Debug */,\n\t\t\t\t0CF68AD41AF0540F00FF9E5C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t0CF68AD51AF0540F00FF9E5C /* Build configuration list for PBXNativeTarget \"ART\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t0CF68AD61AF0540F00FF9E5C /* Debug */,\n\t\t\t\t0CF68AD71AF0540F00FF9E5C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t323A128D1E5F266B004975B8 /* Build configuration list for PBXNativeTarget \"ART-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t323A128E1E5F266B004975B8 /* Debug */,\n\t\t\t\t323A128F1E5F266B004975B8 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 0CF68AB91AF0540F00FF9E5C /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/ART/ARTCGFloatArray.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n// A little helper to make sure we have the right memory allocation ready for use.\n// We assume that we will only this in one place so no reference counting is necessary.\n// Needs to be freed when dealloced.\n\n// This is fragile since this relies on these values not getting reused. Consider\n// wrapping these in an Obj-C class or some ARC hackery to get refcounting.\n\ntypedef struct {\n  size_t count;\n  CGFloat *array;\n} ARTCGFloatArray;\n"
  },
  {
    "path": "Libraries/ART/ARTContainer.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n@protocol ARTContainer <NSObject>\n\n// This is used as a hook for child to mark it's parent as dirty.\n// This bubbles up to the root which gets marked as dirty.\n- (void)invalidate;\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTGroup.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import \"ARTContainer.h\"\n#import \"ARTNode.h\"\n\n@interface ARTGroup : ARTNode <ARTContainer>\n\n@property (nonatomic, assign) CGRect clipping;\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTGroup.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTGroup.h\"\n\n@implementation ARTGroup\n\n- (void)renderLayerTo:(CGContextRef)context\n{\n\n  if (!CGRectIsEmpty(self.clipping)) {\n    CGContextClipToRect(context, self.clipping);\n  }\n\n  for (ARTNode *node in self.subviews) {\n    [node renderTo:context];\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n#import <AppKit/AppKit.h>\n#import \"React/NSView+React.h\"\n\n/**\n * ART nodes are implemented as empty UIViews but this is just an implementation detail to fit\n * into the existing view management. They should also be shadow views and painted on a background\n * thread.\n */\n\n@interface ARTNode : NSView\n\n@property (nonatomic, assign) CGFloat opacity;\n\n- (void)invalidate;\n- (void)renderTo:(CGContextRef)context;\n\n/**\n * renderTo will take opacity into account and draw renderLayerTo off-screen if there is opacity\n * specified, then composite that onto the context. renderLayerTo always draws at opacity=1.\n * @abstract\n */\n- (void)renderLayerTo:(CGContextRef)context;\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTNode.h\"\n\n#import \"ARTContainer.h\"\n\n@implementation ARTNode {\n    CGAffineTransform _transform;\n    //BOOL *_shouldBeTransformed;\n}\n\n- (BOOL)isFlipped\n{\n  return YES;\n}\n\n- (void)insertReactSubview:(NSView *)subview atIndex:(NSInteger)atIndex\n{\n    [super insertReactSubview:subview atIndex:atIndex];\n    [self addSubview:subview];\n    [self invalidate];\n}\n\n- (void)removeReactSubview:(NSView *)subview\n{\n    [super removeReactSubview:subview];\n    [self invalidate];\n}\n\n\n- (void)didUpdateReactSubviews\n{\n  // Do nothing, as subviews are inserted by insertReactSubview:\n}\n\n- (void)setOpacity:(CGFloat)opacity\n{\n  [self invalidate];\n  _opacity = opacity;\n}\n\n- (void)setTransform:(CGAffineTransform)transform\n{\n  [self invalidate];\n  self.layer.affineTransform = _transform;\n  _transform = transform;\n}\n\n- (void)invalidate\n{\n  id<ARTContainer> container = (id<ARTContainer>)self.superview;\n  [container invalidate];\n}\n\n- (void)renderTo:(CGContextRef)context\n{\n  if (self.opacity <= 0) {\n    // Nothing to paint\n    return;\n  }\n  if (self.opacity >= 1) {\n    // Just paint at full opacity\n    CGContextSaveGState(context);\n    CGContextConcatCTM(context, self.layer.affineTransform);\n    CGContextSetAlpha(context, 1);\n    [self renderLayerTo:context];\n    CGContextRestoreGState(context);\n    return;\n  }\n  // This needs to be painted on a layer before being composited.\n  CGContextSaveGState(context);\n  CGContextConcatCTM(context, self.layer.affineTransform);\n  CGContextSetAlpha(context, self.opacity);\n  CGContextBeginTransparencyLayer(context, NULL);\n  [self renderLayerTo:context];\n  CGContextEndTransparencyLayer(context);\n  CGContextRestoreGState(context);\n}\n\n- (void)renderLayerTo:(CGContextRef)context\n{\n  // abstract\n}\n\n- (void)layout\n{\n  [super layout];\n  self.layer.affineTransform = _transform;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTRenderable.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import \"ARTBrush.h\"\n#import \"ARTCGFloatArray.h\"\n#import \"ARTNode.h\"\n\n@interface ARTRenderable : ARTNode\n\n@property (nonatomic, strong) ARTBrush *fill;\n@property (nonatomic, assign) CGColorRef stroke;\n@property (nonatomic, assign) CGFloat strokeWidth;\n@property (nonatomic, assign) CGLineCap strokeCap;\n@property (nonatomic, assign) CGLineJoin strokeJoin;\n@property (nonatomic, assign) ARTCGFloatArray strokeDash;\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTRenderable.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTRenderable.h\"\n\n@implementation ARTRenderable\n\n- (void)setFill:(ARTBrush *)fill\n{\n  [self invalidate];\n  _fill = fill;\n}\n\n- (void)setStroke:(CGColorRef)stroke\n{\n  if (stroke == _stroke) {\n    return;\n  }\n  [self invalidate];\n  CGColorRelease(_stroke);\n  _stroke = CGColorRetain(stroke);\n}\n\n- (void)setStrokeWidth:(CGFloat)strokeWidth\n{\n  [self invalidate];\n  _strokeWidth = strokeWidth;\n}\n\n- (void)setStrokeCap:(CGLineCap)strokeCap\n{\n  [self invalidate];\n  _strokeCap = strokeCap;\n}\n\n- (void)setStrokeJoin:(CGLineJoin)strokeJoin\n{\n  [self invalidate];\n  _strokeJoin = strokeJoin;\n}\n\n- (void)setStrokeDash:(ARTCGFloatArray)strokeDash\n{\n  if (strokeDash.array == _strokeDash.array) {\n    return;\n  }\n  if (_strokeDash.array) {\n    free(_strokeDash.array);\n  }\n  [self invalidate];\n  _strokeDash = strokeDash;\n}\n\n- (void)dealloc\n{\n  CGColorRelease(_stroke);\n  if (_strokeDash.array) {\n    free(_strokeDash.array);\n  }\n}\n\n- (void)renderTo:(CGContextRef)context\n{\n  if (self.opacity <= 0 || self.opacity >= 1 || (self.fill && self.stroke)) {\n    // If we have both fill and stroke, we will need to paint this using normal compositing\n    [super renderTo: context];\n    return;\n  }\n  // This is a terminal with only one painting. Therefore we don't need to paint this\n  // off-screen. We can just composite it straight onto the buffer.\n  CGContextSaveGState(context);\n  CGContextConcatCTM(context, self.layer.affineTransform);\n  CGContextSetAlpha(context, self.opacity);\n  [self renderLayerTo:context];\n  CGContextRestoreGState(context);\n}\n\n- (void)renderLayerTo:(CGContextRef)context\n{\n  // abstract\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTSerializablePath.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ARTSerializablePath\n */\n'use strict';\n\n// TODO: Move this into an ART mode called \"serialized\" or something\n\nvar Class = require('art/core/class.js');\nvar Path = require('art/core/path.js');\n\nvar MOVE_TO = 0;\nvar CLOSE = 1;\nvar LINE_TO = 2;\nvar CURVE_TO = 3;\nvar ARC = 4;\n\nvar SerializablePath = Class(Path, {\n\n  initialize: function(path) {\n    this.reset();\n    if (path instanceof SerializablePath) {\n      this.path = path.path.slice(0);\n    } else if (path) {\n      if (path.applyToPath) {\n        path.applyToPath(this);\n      } else {\n        this.push(path);\n      }\n    }\n  },\n\n  onReset: function() {\n    this.path = [];\n  },\n\n  onMove: function(sx, sy, x, y) {\n    this.path.push(MOVE_TO, x, y);\n  },\n\n  onLine: function(sx, sy, x, y) {\n    this.path.push(LINE_TO, x, y);\n  },\n\n  onBezierCurve: function(sx, sy, p1x, p1y, p2x, p2y, x, y) {\n    this.path.push(CURVE_TO, p1x, p1y, p2x, p2y, x, y);\n  },\n\n  _arcToBezier: Path.prototype.onArc,\n\n  onArc: function(sx, sy, ex, ey, cx, cy, rx, ry, sa, ea, ccw, rotation) {\n    if (rx !== ry || rotation) {\n      return this._arcToBezier(\n        sx, sy, ex, ey, cx, cy, rx, ry, sa, ea, ccw, rotation\n      );\n    }\n    this.path.push(ARC, cx, cy, rx, sa, ea, ccw ? 0 : 1);\n  },\n\n  onClose: function() {\n    this.path.push(CLOSE);\n  },\n\n  toJSON: function() {\n    return this.path;\n  }\n\n});\n\nmodule.exports = SerializablePath;\n"
  },
  {
    "path": "Libraries/ART/ARTShape.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import \"ARTRenderable.h\"\n\n@interface ARTShape : ARTRenderable\n\n@property (nonatomic, assign) CGPathRef d;\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTShape.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTShape.h\"\n\n@implementation ARTShape\n\n- (void)setD:(CGPathRef)d\n{\n  if (d == _d) {\n    return;\n  }\n  [self invalidate];\n  CGPathRelease(_d);\n  _d = CGPathRetain(d);\n}\n\n- (void)dealloc\n{\n  CGPathRelease(_d);\n}\n\n- (void)renderLayerTo:(CGContextRef)context\n{\n  if ((!self.fill && !self.stroke) || !self.d) {\n    return;\n  }\n\n  CGPathDrawingMode mode = kCGPathStroke;\n  if (self.fill) {\n    if ([self.fill applyFillColor:context]) {\n      mode = kCGPathFill;\n    } else {\n      CGContextSaveGState(context);\n      CGContextAddPath(context, self.d);\n      CGContextClip(context);\n      [self.fill paint:context];\n      CGContextRestoreGState(context);\n      if (!self.stroke) {\n        return;\n      }\n    }\n  }\n  if (self.stroke) {\n    CGContextSetStrokeColorWithColor(context, self.stroke);\n    CGContextSetLineWidth(context, self.strokeWidth);\n    CGContextSetLineCap(context, self.strokeCap);\n    CGContextSetLineJoin(context, self.strokeJoin);\n    ARTCGFloatArray dash = self.strokeDash;\n    if (dash.count) {\n      CGContextSetLineDash(context, 0, dash.array, dash.count);\n    }\n    if (mode == kCGPathFill) {\n      mode = kCGPathFillStroke;\n    }\n  }\n\n  CGContextAddPath(context, self.d);\n  CGContextDrawPath(context, mode);\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTSurfaceView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import \"ARTContainer.h\"\n\n@interface ARTSurfaceView : NSView <ARTContainer>\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTSurfaceView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTSurfaceView.h\"\n\n#import <React/RCTLog.h>\n\n#import \"ARTNode.h\"\n\n@implementation ARTSurfaceView\n\n- (BOOL)isFlipped\n{\n  return YES;\n}\n\n- (void)insertReactSubview:(NSView *)subview atIndex:(NSInteger)atIndex\n{\n    [super insertReactSubview:subview atIndex:atIndex];\n    [self addSubview:subview];\n    [self invalidate];\n}\n\n- (void)removeReactSubview:(NSView *)subview\n{\n    [super removeReactSubview:subview];\n    [self invalidate];\n}\n\n\n- (void)didUpdateReactSubviews\n{\n  // Do nothing, as subviews are inserted by insertReactSubview:\n}\n\n- (void)invalidate\n{\n  [self setNeedsDisplay:YES];\n}\n\n- (void)drawRect:(CGRect)rect\n{\n  CGContextRef context = [NSGraphicsContext currentContext].CGContext;\n  for (ARTNode *node in self.subviews) {\n    [node renderTo:context];\n  }\n}\n\n- (void)reactSetInheritedBackgroundColor:(NSColor *)inheritedBackgroundColor\n{\n  [self setWantsLayer:YES];\n  self.layer.backgroundColor = [inheritedBackgroundColor CGColor];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTText.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import \"ARTRenderable.h\"\n#import \"ARTTextFrame.h\"\n\n@interface ARTText : ARTRenderable\n\n@property (nonatomic, assign) CTTextAlignment alignment;\n@property (nonatomic, assign) ARTTextFrame textFrame;\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTText.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTText.h\"\n\n#import <CoreText/CoreText.h>\n\n@implementation ARTText\n\n- (void)setAlignment:(CTTextAlignment)alignment\n{\n  [self invalidate];\n  _alignment = alignment;\n}\n\nstatic void ARTFreeTextFrame(ARTTextFrame frame)\n{\n  if (frame.count) {\n    // We must release each line before freeing up this struct\n    for (int i = 0; i < frame.count; i++) {\n      CFRelease(frame.lines[i]);\n    }\n    free(frame.lines);\n    free(frame.widths);\n  }\n}\n\n- (void)setTextFrame:(ARTTextFrame)frame\n{\n  if (frame.lines != _textFrame.lines) {\n    ARTFreeTextFrame(_textFrame);\n  }\n  [self invalidate];\n  _textFrame = frame;\n}\n\n- (void)dealloc\n{\n  ARTFreeTextFrame(_textFrame);\n}\n\n- (void)renderLayerTo:(CGContextRef)context\n{\n  ARTTextFrame frame = self.textFrame;\n\n  if ((!self.fill && !self.stroke) || !frame.count) {\n    return;\n  }\n\n  // to-do: draw along a path\n\n  CGTextDrawingMode mode = kCGTextStroke;\n  if (self.fill) {\n    if ([self.fill applyFillColor:context]) {\n      mode = kCGTextFill;\n    } else {\n\n      for (int i = 0; i < frame.count; i++) {\n        CGContextSaveGState(context);\n        // Inverse the coordinate space since CoreText assumes a bottom-up coordinate space\n        CGContextScaleCTM(context, 1.0, -1.0);\n        CGContextSetTextDrawingMode(context, kCGTextClip);\n        [self renderLineTo:context atIndex:i];\n        // Inverse the coordinate space back to the original before filling\n        CGContextScaleCTM(context, 1.0, -1.0);\n        [self.fill paint:context];\n        // Restore the state so that the next line can be clipped separately\n        CGContextRestoreGState(context);\n      }\n\n      if (!self.stroke) {\n        return;\n      }\n    }\n  }\n  if (self.stroke) {\n    CGContextSetStrokeColorWithColor(context, self.stroke);\n    CGContextSetLineWidth(context, self.strokeWidth);\n    CGContextSetLineCap(context, self.strokeCap);\n    CGContextSetLineJoin(context, self.strokeJoin);\n    ARTCGFloatArray dash = self.strokeDash;\n    if (dash.count) {\n      CGContextSetLineDash(context, 0, dash.array, dash.count);\n    }\n    if (mode == kCGTextFill) {\n      mode = kCGTextFillStroke;\n    }\n  }\n\n  CGContextSetTextDrawingMode(context, mode);\n\n  // Inverse the coordinate space since CoreText assumes a bottom-up coordinate space\n  CGContextScaleCTM(context, 1.0, -1.0);\n  for (int i = 0; i < frame.count; i++) {\n    [self renderLineTo:context atIndex:i];\n  }\n}\n\n- (void)renderLineTo:(CGContextRef)context atIndex:(int)index\n{\n  ARTTextFrame frame = self.textFrame;\n  CGFloat shift;\n  switch (self.alignment) {\n    case kCTTextAlignmentRight:\n      shift = frame.widths[index];\n      break;\n    case kCTTextAlignmentCenter:\n      shift = (frame.widths[index] / 2);\n      break;\n    default:\n      shift = 0;\n      break;\n  }\n  // We should consider snapping this shift to device pixels to improve rendering quality\n  // when a line has subpixel width.\n  CGContextSetTextPosition(context, -shift, -frame.baseLine - frame.lineHeight * index);\n  CTLineRef line = frame.lines[index];\n  CTLineDraw(line, context);\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ARTTextFrame.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <CoreText/CoreText.h>\n\n// A little helper to make sure we have a set of lines including width ready for use.\n// We assume that we will only this in one place so no reference counting is necessary.\n// Needs to be freed when dealloced.\n\n// This is fragile since this relies on these values not getting reused. Consider\n// wrapping these in an Obj-C class or some ARC hackery to get refcounting.\n\ntypedef struct {\n  size_t count;\n  CGFloat baseLine; // Distance from the origin to the base line of the first line\n  CGFloat lineHeight; // Distance between lines\n  CTLineRef *lines;\n  CGFloat *widths; // Width of each line\n} ARTTextFrame;\n"
  },
  {
    "path": "Libraries/ART/Brushes/ARTBrush.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <CoreGraphics/CoreGraphics.h>\n#import <Foundation/Foundation.h>\n\n@interface ARTBrush : NSObject\n\n/* @abstract */\n- (instancetype)initWithArray:(NSArray *)data NS_DESIGNATED_INITIALIZER;\n\n/**\n * For certain brushes we can fast path a combined fill and stroke.\n * For those brushes we override applyFillColor which sets the fill\n * color to be used by those batch paints. Those return YES.\n * We can't batch gradient painting in CoreGraphics, so those will\n * return NO and paint gets called instead.\n * @abstract\n */\n- (BOOL)applyFillColor:(CGContextRef)context;\n\n/**\n * paint fills the context with a brush. The context is assumed to\n * be clipped.\n * @abstract\n */\n- (void)paint:(CGContextRef)context;\n\n@end\n"
  },
  {
    "path": "Libraries/ART/Brushes/ARTBrush.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTBrush.h\"\n\n#import <React/RCTDefines.h>\n\n@implementation ARTBrush\n\n- (instancetype)initWithArray:(NSArray *)data\n{\n  return [super init];\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (BOOL)applyFillColor:(CGContextRef)context\n{\n  return NO;\n}\n\n- (void)paint:(CGContextRef)context\n{\n  // abstract\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/Brushes/ARTLinearGradient.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTBrush.h\"\n\n@interface ARTLinearGradient : ARTBrush\n\n@end\n"
  },
  {
    "path": "Libraries/ART/Brushes/ARTLinearGradient.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTLinearGradient.h\"\n\n#import <React/RCTLog.h>\n\n#import \"RCTConvert+ART.h\"\n\n@implementation ARTLinearGradient\n{\n  CGGradientRef _gradient;\n  CGPoint _startPoint;\n  CGPoint _endPoint;\n}\n\n- (instancetype)initWithArray:(NSArray<NSNumber *> *)array\n{\n  if ((self = [super initWithArray:array])) {\n    if (array.count < 5) {\n      RCTLogError(@\"-[%@ %@] expects 5 elements, received %@\",\n                  self.class, NSStringFromSelector(_cmd), array);\n      return nil;\n    }\n    _startPoint = [RCTConvert CGPoint:array offset:1];\n    _endPoint = [RCTConvert CGPoint:array offset:3];\n    _gradient = CGGradientRetain([RCTConvert CGGradient:array offset:5]);\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  CGGradientRelease(_gradient);\n}\n\n- (void)paint:(CGContextRef)context\n{\n  CGGradientDrawingOptions extendOptions =\n    kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation;\n  CGContextDrawLinearGradient(context, _gradient, _startPoint, _endPoint, extendOptions);\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/Brushes/ARTPattern.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTBrush.h\"\n\n@interface ARTPattern : ARTBrush\n\n@end\n"
  },
  {
    "path": "Libraries/ART/Brushes/ARTPattern.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTPattern.h\"\n\n#import <React/RCTLog.h>\n\n#import \"RCTConvert+ART.h\"\n\n@implementation ARTPattern\n{\n  CGImageRef _image;\n  CGRect _rect;\n}\n\n- (instancetype)initWithArray:(NSArray<id /* imagesource + numbers */> *)array\n{\n  if ((self = [super initWithArray:array])) {\n    if (array.count < 6) {\n      RCTLogError(@\"-[%@ %@] expects 6 elements, received %@\",\n                  self.class, NSStringFromSelector(_cmd), array);\n      return nil;\n    }\n    _image = CGImageRetain([RCTConvert CGImage:array[1]]);\n    _rect = [RCTConvert CGRect:array offset:2];\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  CGImageRelease(_image);\n}\n\n// Note: This could use applyFillColor with a pattern. This could be more efficient but\n// to do that, we need to calculate our own user space CTM.\n\n- (void)paint:(CGContextRef)context\n{\n  CGContextDrawTiledImage(context, _rect, _image);\n}\n\n\n\n@end\n"
  },
  {
    "path": "Libraries/ART/Brushes/ARTRadialGradient.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTBrush.h\"\n\n@interface ARTRadialGradient : ARTBrush\n\n@end\n"
  },
  {
    "path": "Libraries/ART/Brushes/ARTRadialGradient.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTRadialGradient.h\"\n\n#import <React/RCTLog.h>\n\n#import \"RCTConvert+ART.h\"\n\n@implementation ARTRadialGradient\n{\n  CGGradientRef _gradient;\n  CGPoint _focusPoint;\n  CGPoint _centerPoint;\n  CGFloat _radius;\n  CGFloat _radiusRatio;\n}\n\n- (instancetype)initWithArray:(NSArray<NSNumber *> *)array\n{\n  if ((self = [super initWithArray:array])) {\n    if (array.count < 7) {\n      RCTLogError(@\"-[%@ %@] expects 7 elements, received %@\",\n                  self.class, NSStringFromSelector(_cmd), array);\n      return nil;\n    }\n    _radius = [RCTConvert CGFloat:array[3]];\n    _radiusRatio = [RCTConvert CGFloat:array[4]] / _radius;\n    _focusPoint.x = [RCTConvert CGFloat:array[1]];\n    _focusPoint.y = [RCTConvert CGFloat:array[2]] / _radiusRatio;\n    _centerPoint.x = [RCTConvert CGFloat:array[5]];\n    _centerPoint.y = [RCTConvert CGFloat:array[6]] / _radiusRatio;\n    _gradient = CGGradientRetain([RCTConvert CGGradient:array offset:7]);\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  CGGradientRelease(_gradient);\n}\n\n- (void)paint:(CGContextRef)context\n{\n  CGAffineTransform transform = CGAffineTransformMakeScale(1, _radiusRatio);\n  CGContextConcatCTM(context, transform);\n  CGGradientDrawingOptions extendOptions = kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation;\n  CGContextDrawRadialGradient(context, _gradient, _focusPoint, 0, _centerPoint, _radius, extendOptions);\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/Brushes/ARTSolidColor.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTBrush.h\"\n\n@interface ARTSolidColor : ARTBrush\n\n@end\n"
  },
  {
    "path": "Libraries/ART/Brushes/ARTSolidColor.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTSolidColor.h\"\n\n#import <React/RCTLog.h>\n\n#import \"RCTConvert+ART.h\"\n\n@implementation ARTSolidColor\n{\n  CGColorRef _color;\n}\n\n- (instancetype)initWithArray:(NSArray<NSNumber *> *)array\n{\n  if ((self = [super initWithArray:array])) {\n    _color = CGColorRetain([RCTConvert CGColor:array offset:1]);\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  CGColorRelease(_color);\n}\n\n- (BOOL)applyFillColor:(CGContextRef)context\n{\n  CGContextSetFillColorWithColor(context, _color);\n  return YES;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/RCTConvert+ART.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <QuartzCore/QuartzCore.h>\n\n#import <React/RCTConvert.h>\n\n#import \"ARTBrush.h\"\n#import \"ARTCGFloatArray.h\"\n#import \"ARTTextFrame.h\"\n\n@interface RCTConvert (ART)\n\n+ (CGPathRef)CGPath:(id)json;\n+ (CTTextAlignment)CTTextAlignment:(id)json;\n+ (ARTTextFrame)ARTTextFrame:(id)json;\n+ (ARTCGFloatArray)ARTCGFloatArray:(id)json;\n+ (ARTBrush *)ARTBrush:(id)json;\n\n+ (CGPoint)CGPoint:(id)json offset:(NSUInteger)offset;\n+ (CGRect)CGRect:(id)json offset:(NSUInteger)offset;\n+ (CGColorRef)CGColor:(id)json offset:(NSUInteger)offset;\n+ (CGGradientRef)CGGradient:(id)json offset:(NSUInteger)offset;\n\n@end\n"
  },
  {
    "path": "Libraries/ART/RCTConvert+ART.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTConvert+ART.h\"\n\n#import <React/RCTFont.h>\n#import <React/RCTLog.h>\n\n#import \"ARTLinearGradient.h\"\n#import \"ARTPattern.h\"\n#import \"ARTRadialGradient.h\"\n#import \"ARTSolidColor.h\"\n\n@implementation RCTConvert (ART)\n\n+ (CGPathRef)CGPath:(id)json\n{\n  NSArray *arr = [self NSNumberArray:json];\n\n  NSUInteger count = [arr count];\n\n#define NEXT_VALUE [self double:arr[i++]]\n\n  CGMutablePathRef path = CGPathCreateMutable();\n  CGPathMoveToPoint(path, NULL, 0, 0);\n\n  @try {\n    NSUInteger i = 0;\n    while (i < count) {\n      NSUInteger type = [arr[i++] unsignedIntegerValue];\n      switch (type) {\n        case 0:\n          CGPathMoveToPoint(path, NULL, NEXT_VALUE, NEXT_VALUE);\n          break;\n        case 1:\n          CGPathCloseSubpath(path);\n          break;\n        case 2:\n          CGPathAddLineToPoint(path, NULL, NEXT_VALUE, NEXT_VALUE);\n          break;\n        case 3:\n          CGPathAddCurveToPoint(path, NULL, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE);\n          break;\n        case 4:\n          CGPathAddArc(path, NULL, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE == 0);\n          break;\n        default:\n          RCTLogError(@\"Invalid CGPath type %llu at element %llu of %@\", (unsigned long long)type, (unsigned long long)i, arr);\n          CGPathRelease(path);\n          return NULL;\n      }\n    }\n  }\n  @catch (NSException *exception) {\n    RCTLogError(@\"Invalid CGPath format: %@\", arr);\n    CGPathRelease(path);\n    return NULL;\n  }\n\n  return (CGPathRef)CFAutorelease(path);\n}\n\nRCT_ENUM_CONVERTER(CTTextAlignment, (@{\n  @\"auto\": @(kCTTextAlignmentNatural),\n  @\"left\": @(kCTTextAlignmentLeft),\n  @\"center\": @(kCTTextAlignmentCenter),\n  @\"right\": @(kCTTextAlignmentRight),\n  @\"justify\": @(kCTTextAlignmentJustified),\n}), kCTTextAlignmentNatural, integerValue)\n\n// This takes a tuple of text lines and a font to generate a CTLine for each text line.\n// This prepares everything for rendering a frame of text in ARTText.\n+ (ARTTextFrame)ARTTextFrame:(id)json\n{\n  NSDictionary *dict = [self NSDictionary:json];\n  ARTTextFrame frame;\n  frame.count = 0;\n\n  NSArray *lines = [self NSArray:dict[@\"lines\"]];\n  NSUInteger lineCount = [lines count];\n  if (lineCount == 0) {\n    return frame;\n  }\n\n  NSDictionary *fontDict = dict[@\"font\"];\n    CTFontRef font = (__bridge CTFontRef)[self NSFont:dict[@\"font\"]];\n    if (!font) {\n        return frame;\n    }\n\n    // Create a dictionary for this font\n    CFDictionaryRef attributes = (__bridge CFDictionaryRef)@{\n                                                             (NSString *)kCTFontAttributeName:(__bridge id)font,\n                                                             (NSString *)kCTForegroundColorFromContextAttributeName: @YES\n                                                             };\n\n    // Set up text frame with font metrics\n    CGFloat size = CTFontGetSize(font);\n    frame.count = lineCount;\n    frame.baseLine = size; // estimate base line\n    frame.lineHeight = size * 1.1; // Base on ART canvas line height estimate\n    frame.lines = malloc(sizeof(CTLineRef) * lineCount);\n    frame.widths = malloc(sizeof(CGFloat) * lineCount);\n\n    [lines enumerateObjectsUsingBlock:^(NSString *text, NSUInteger i, BOOL *stop) {\n        \n        CFStringRef string = (__bridge CFStringRef)text;\n        CFAttributedStringRef attrString = CFAttributedStringCreate(kCFAllocatorDefault, string, attributes);\n        CTLineRef line = CTLineCreateWithAttributedString(attrString);\n        CFRelease(attrString);\n        \n        frame.lines[i] = line;\n        frame.widths[i] = CTLineGetTypographicBounds(line, NULL, NULL, NULL);\n    }];\n\n  return frame;\n}\n\n+ (ARTCGFloatArray)ARTCGFloatArray:(id)json\n{\n  NSArray *arr = [self NSNumberArray:json];\n  NSUInteger count = arr.count;\n\n  ARTCGFloatArray array;\n  array.count = count;\n  array.array = NULL;\n\n  if (count) {\n    // Ideally, these arrays should already use the same memory layout.\n    // In that case we shouldn't need this new malloc.\n    array.array = malloc(sizeof(CGFloat) * count);\n    for (NSUInteger i = 0; i < count; i++) {\n      array.array[i] = [arr[i] doubleValue];\n    }\n  }\n\n  return array;\n}\n\n+ (ARTBrush *)ARTBrush:(id)json\n{\n  NSArray *arr = [self NSArray:json];\n  NSUInteger type = [self NSUInteger:arr.firstObject];\n  switch (type) {\n    case 0: // solid color\n      // These are probably expensive allocations since it's often the same value.\n      // We should memoize colors but look ups may be just as expensive.\n      return [[ARTSolidColor alloc] initWithArray:arr];\n    case 1: // linear gradient\n      return [[ARTLinearGradient alloc] initWithArray:arr];\n    case 2: // radial gradient\n      return [[ARTRadialGradient alloc] initWithArray:arr];\n    case 3: // pattern\n      return [[ARTPattern alloc] initWithArray:arr];\n    default:\n      RCTLogError(@\"Unknown brush type: %llu\", (unsigned long long)type);\n      return nil;\n  }\n}\n\n+ (CGPoint)CGPoint:(id)json offset:(NSUInteger)offset\n{\n  NSArray *arr = [self NSArray:json];\n  if (arr.count < offset + 2) {\n    RCTLogError(@\"Too few elements in array (expected at least %llu): %@\", (unsigned long long)(2 + offset), arr);\n    return CGPointZero;\n  }\n  return (CGPoint){\n    [self CGFloat:arr[offset]],\n    [self CGFloat:arr[offset + 1]],\n  };\n}\n\n+ (CGRect)CGRect:(id)json offset:(NSUInteger)offset\n{\n  NSArray *arr = [self NSArray:json];\n  if (arr.count < offset + 4) {\n    RCTLogError(@\"Too few elements in array (expected at least %llu): %@\", (unsigned long long)(4 + offset), arr);\n    return CGRectZero;\n  }\n  return (CGRect){\n    {[self CGFloat:arr[offset]], [self CGFloat:arr[offset + 1]]},\n    {[self CGFloat:arr[offset + 2]], [self CGFloat:arr[offset + 3]]},\n  };\n}\n\n+ (CGColorRef)CGColor:(id)json offset:(NSUInteger)offset\n{\n  NSArray *arr = [self NSArray:json];\n  if (arr.count < offset + 4) {\n    RCTLogError(@\"Too few elements in array (expected at least %llu): %@\", (unsigned long long)(4 + offset), arr);\n    return NULL;\n  }\n  return [self CGColor:[arr subarrayWithRange:(NSRange){offset, 4}]];\n}\n\n+ (CGGradientRef)CGGradient:(id)json offset:(NSUInteger)offset\n{\n  NSArray *arr = [self NSArray:json];\n  if (arr.count < offset) {\n    RCTLogError(@\"Too few elements in array (expected at least %llu): %@\", (unsigned long long)offset, arr);\n    return NULL;\n  }\n  arr = [arr subarrayWithRange:(NSRange){offset, arr.count - offset}];\n  ARTCGFloatArray colorsAndOffsets = [self ARTCGFloatArray:arr];\n  size_t stops = colorsAndOffsets.count / 5;\n  CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();\n  CGGradientRef gradient = CGGradientCreateWithColorComponents(\n    rgb,\n    colorsAndOffsets.array,\n    colorsAndOffsets.array + stops * 4,\n    stops\n  );\n  CGColorSpaceRelease(rgb);\n  free(colorsAndOffsets.array);\n  return (CGGradientRef)CFAutorelease(gradient);\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ReactNativeART.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactNativeART\n */\n'use strict';\n\nvar Color = require('art/core/color');\nvar Path = require('ARTSerializablePath');\nvar Transform = require('art/core/transform');\n\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar ReactNativeViewAttributes = require('ReactNativeViewAttributes');\n\nvar createReactNativeComponentClass = require('createReactNativeComponentClass');\nvar merge = require('merge');\nvar invariant = require('fbjs/lib/invariant');\n\n// Diff Helpers\n\nfunction arrayDiffer(a, b) {\n  if (a == null || b == null) {\n    return true;\n  }\n  if (a.length !== b.length) {\n    return true;\n  }\n  for (var i = 0; i < a.length; i++) {\n    if (a[i] !== b[i]) {\n      return true;\n    }\n  }\n  return false;\n}\n\nfunction fontAndLinesDiffer(a, b) {\n  if (a === b) {\n    return false;\n  }\n  if (a.font !== b.font) {\n    if (a.font === null) {\n      return true;\n    }\n    if (b.font === null) {\n      return true;\n    }\n\n    if (\n      a.font.fontFamily !== b.font.fontFamily ||\n      a.font.fontSize !== b.font.fontSize ||\n      a.font.fontWeight !== b.font.fontWeight ||\n      a.font.fontStyle !== b.font.fontStyle\n    ) {\n      return true;\n    }\n  }\n  return arrayDiffer(a.lines, b.lines);\n}\n\n// Native Attributes\n\nvar SurfaceViewAttributes = merge(ReactNativeViewAttributes.UIView, {\n  // This should contain pixel information such as width, height and\n  // resolution to know what kind of buffer needs to be allocated.\n  // Currently we rely on UIViews and style to figure that out.\n});\n\nvar NodeAttributes = {\n  transform: { diff: arrayDiffer },\n  opacity: true,\n};\n\nvar GroupAttributes = merge(NodeAttributes, {\n  clipping: { diff: arrayDiffer }\n});\n\nvar RenderableAttributes = merge(NodeAttributes, {\n  fill: { diff: arrayDiffer },\n  stroke: { diff: arrayDiffer },\n  strokeWidth: true,\n  strokeCap: true,\n  strokeJoin: true,\n  strokeDash: { diff: arrayDiffer },\n});\n\nvar ShapeAttributes = merge(RenderableAttributes, {\n  d: { diff: arrayDiffer },\n});\n\nvar TextAttributes = merge(RenderableAttributes, {\n  alignment: true,\n  frame: { diff: fontAndLinesDiffer },\n  path: { diff: arrayDiffer }\n});\n\n// Native Components\n\nvar NativeSurfaceView = createReactNativeComponentClass('ARTSurfaceView',\n  () => ({\n    validAttributes: SurfaceViewAttributes,\n    uiViewClassName: 'ARTSurfaceView',\n  }));\n\nvar NativeGroup = createReactNativeComponentClass('ARTGroup',\n  () => ({\n    validAttributes: GroupAttributes,\n    uiViewClassName: 'ARTGroup',\n  }));\n\nvar NativeShape = createReactNativeComponentClass('ARTShape',\n  () => ({\n    validAttributes: ShapeAttributes,\n    uiViewClassName: 'ARTShape',\n  }));\n\nvar NativeText = createReactNativeComponentClass('ARTText',\n  () => ({\n    validAttributes: TextAttributes,\n    uiViewClassName: 'ARTText',\n  }));\n\n// Utilities\n\nfunction childrenAsString(children) {\n  if (!children) {\n    return '';\n  }\n  if (typeof children === 'string') {\n    return children;\n  }\n  if (children.length) {\n    return children.join('\\n');\n  }\n  return '';\n}\n\n// Surface - Root node of all ART\n\nclass Surface extends React.Component {\n  static childContextTypes = {\n    isInSurface: PropTypes.bool,\n  };\n\n  getChildContext() {\n    return { isInSurface: true };\n  }\n\n  render() {\n    var props = this.props;\n    var w = extractNumber(props.width, 0);\n    var h = extractNumber(props.height, 0);\n    return (\n      <NativeSurfaceView style={[props.style, { width: w, height: h }]}>\n        {this.props.children}\n      </NativeSurfaceView>\n    );\n  }\n}\n\n// Node Props\n\n// TODO: The desktop version of ART has title and cursor. We should have\n// accessibility support here too even though hovering doesn't work.\n\nfunction extractNumber(value, defaultValue) {\n  if (value == null) {\n    return defaultValue;\n  }\n  return +value;\n}\n\nvar pooledTransform = new Transform();\n\nfunction extractTransform(props) {\n  var scaleX = props.scaleX != null ? props.scaleX :\n               props.scale != null ? props.scale : 1;\n  var scaleY = props.scaleY != null ? props.scaleY :\n               props.scale != null ? props.scale : 1;\n\n  pooledTransform\n    .transformTo(1, 0, 0, 1, 0, 0)\n    .move(props.x || 0, props.y || 0)\n    .rotate(props.rotation || 0, props.originX, props.originY)\n    .scale(scaleX, scaleY, props.originX, props.originY);\n\n  if (props.transform != null) {\n    pooledTransform.transform(props.transform);\n  }\n\n  return [\n    pooledTransform.xx, pooledTransform.yx,\n    pooledTransform.xy, pooledTransform.yy,\n    pooledTransform.x,  pooledTransform.y,\n  ];\n}\n\nfunction extractOpacity(props) {\n  // TODO: visible === false should also have no hit detection\n  if (props.visible === false) {\n    return 0;\n  }\n  if (props.opacity == null) {\n    return 1;\n  }\n  return +props.opacity;\n}\n\n// Groups\n\n// Note: ART has a notion of width and height on Group but AFAIK it's a noop in\n// ReactART.\n\nclass Group extends React.Component {\n  static contextTypes = {\n    isInSurface: PropTypes.bool.isRequired,\n  };\n\n  render() {\n    var props = this.props;\n    invariant(\n      this.context.isInSurface,\n      'ART: <Group /> must be a child of a <Surface />'\n    );\n    return (\n      <NativeGroup\n        opacity={extractOpacity(props)}\n        transform={extractTransform(props)}>\n        {this.props.children}\n      </NativeGroup>\n    );\n  }\n}\n\nclass ClippingRectangle extends React.Component {\n  render() {\n    var props = this.props;\n    var x = extractNumber(props.x, 0);\n    var y = extractNumber(props.y, 0);\n    var w = extractNumber(props.width, 0);\n    var h = extractNumber(props.height, 0);\n    var clipping = [x, y, w, h];\n    // The current clipping API requires x and y to be ignored in the transform\n    var propsExcludingXAndY = merge(props);\n    delete propsExcludingXAndY.x;\n    delete propsExcludingXAndY.y;\n    return (\n      <NativeGroup\n        clipping={clipping}\n        opacity={extractOpacity(props)}\n        transform={extractTransform(propsExcludingXAndY)}>\n        {this.props.children}\n      </NativeGroup>\n    );\n  }\n}\n\n// Renderables\n\nvar SOLID_COLOR = 0;\nvar LINEAR_GRADIENT = 1;\nvar RADIAL_GRADIENT = 2;\nvar PATTERN = 3;\n\nfunction insertColorIntoArray(color, targetArray, atIndex) {\n  var c = new Color(color);\n  targetArray[atIndex + 0] = c.red / 255;\n  targetArray[atIndex + 1] = c.green / 255;\n  targetArray[atIndex + 2] = c.blue / 255;\n  targetArray[atIndex + 3] = c.alpha;\n}\n\nfunction insertColorsIntoArray(stops, targetArray, atIndex) {\n  var i = 0;\n  if ('length' in stops) {\n    while (i < stops.length) {\n      insertColorIntoArray(stops[i], targetArray, atIndex + i * 4);\n      i++;\n    }\n  } else {\n    for (var offset in stops) {\n      insertColorIntoArray(stops[offset], targetArray, atIndex + i * 4);\n      i++;\n    }\n  }\n  return atIndex + i * 4;\n}\n\nfunction insertOffsetsIntoArray(stops, targetArray, atIndex, multi, reverse) {\n  var offsetNumber;\n  var i = 0;\n  if ('length' in stops) {\n    while (i < stops.length) {\n      offsetNumber = i / (stops.length - 1) * multi;\n      targetArray[atIndex + i] = reverse ? 1 - offsetNumber : offsetNumber;\n      i++;\n    }\n  } else {\n    for (var offsetString in stops) {\n      offsetNumber = (+offsetString) * multi;\n      targetArray[atIndex + i] = reverse ? 1 - offsetNumber : offsetNumber;\n      i++;\n    }\n  }\n  return atIndex + i;\n}\n\nfunction insertColorStopsIntoArray(stops, targetArray, atIndex) {\n  var lastIndex = insertColorsIntoArray(stops, targetArray, atIndex);\n  insertOffsetsIntoArray(stops, targetArray, lastIndex, 1, false);\n}\n\nfunction insertDoubleColorStopsIntoArray(stops, targetArray, atIndex) {\n  var lastIndex = insertColorsIntoArray(stops, targetArray, atIndex);\n  lastIndex = insertColorsIntoArray(stops, targetArray, lastIndex);\n  lastIndex = insertOffsetsIntoArray(stops, targetArray, lastIndex, 0.5, false);\n  insertOffsetsIntoArray(stops, targetArray, lastIndex, 0.5, true);\n}\n\nfunction applyBoundingBoxToBrushData(brushData, props) {\n  var type = brushData[0];\n  var width = +props.width;\n  var height = +props.height;\n  if (type === LINEAR_GRADIENT) {\n    brushData[1] *= width;\n    brushData[2] *= height;\n    brushData[3] *= width;\n    brushData[4] *= height;\n  } else if (type === RADIAL_GRADIENT) {\n    brushData[1] *= width;\n    brushData[2] *= height;\n    brushData[3] *= width;\n    brushData[4] *= height;\n    brushData[5] *= width;\n    brushData[6] *= height;\n  } else if (type === PATTERN) {\n    // todo\n  }\n}\n\nfunction extractBrush(colorOrBrush, props) {\n  if (colorOrBrush == null) {\n    return null;\n  }\n  if (colorOrBrush._brush) {\n    if (colorOrBrush._bb) {\n      // The legacy API for Gradients allow for the bounding box to be used\n      // as a convenience for specifying gradient positions. This should be\n      // deprecated. It's not properly implemented in canvas mode. ReactART\n      // doesn't handle update to the bounding box correctly. That's why we\n      // mutate this so that if it's reused, we reuse the same resolved box.\n      applyBoundingBoxToBrushData(colorOrBrush._brush, props);\n      colorOrBrush._bb = false;\n    }\n    return colorOrBrush._brush;\n  }\n  var c = new Color(colorOrBrush);\n  return [SOLID_COLOR, c.red / 255, c.green / 255, c.blue / 255, c.alpha];\n}\n\nfunction extractColor(color) {\n  if (color == null) {\n    return null;\n  }\n  var c = new Color(color);\n  return [c.red / 255, c.green / 255, c.blue / 255, c.alpha];\n}\n\nfunction extractStrokeCap(strokeCap) {\n  switch (strokeCap) {\n    case 'butt': return 0;\n    case 'square': return 2;\n    default: return 1; // round\n  }\n}\n\nfunction extractStrokeJoin(strokeJoin) {\n  switch (strokeJoin) {\n    case 'miter': return 0;\n    case 'bevel': return 2;\n    default: return 1; // round\n  }\n}\n\n// Shape\n\n// Note: ART has a notion of width and height on Shape but AFAIK it's a noop in\n// ReactART.\n\nclass Shape extends React.Component {\n  render() {\n    var props = this.props;\n    var path = props.d || childrenAsString(props.children);\n    var d = (path instanceof Path ? path : new Path(path)).toJSON();\n    return (\n      <NativeShape\n        fill={extractBrush(props.fill, props)}\n        opacity={extractOpacity(props)}\n        stroke={extractColor(props.stroke)}\n        strokeCap={extractStrokeCap(props.strokeCap)}\n        strokeDash={props.strokeDash || null}\n        strokeJoin={extractStrokeJoin(props.strokeJoin)}\n        strokeWidth={extractNumber(props.strokeWidth, 1)}\n        transform={extractTransform(props)}\n\n        d={d}\n      />\n    );\n  }\n}\n\n// Text\n\nvar cachedFontObjectsFromString = {};\n\nvar fontFamilyPrefix = /^[\\s\"']*/;\nvar fontFamilySuffix = /[\\s\"']*$/;\n\nfunction extractSingleFontFamily(fontFamilyString) {\n  // ART on the web allows for multiple font-families to be specified.\n  // For compatibility, we extract the first font-family, hoping\n  // we'll get a match.\n  return fontFamilyString.split(',')[0]\n         .replace(fontFamilyPrefix, '')\n         .replace(fontFamilySuffix, '');\n}\n\nfunction parseFontString(font) {\n  if (cachedFontObjectsFromString.hasOwnProperty(font)) {\n    return cachedFontObjectsFromString[font];\n  }\n  var regexp = /^\\s*((?:(?:normal|bold|italic)\\s+)*)(?:(\\d+(?:\\.\\d+)?)[ptexm\\%]*(?:\\s*\\/.*?)?\\s+)?\\s*\\\"?([^\\\"]*)/i;\n  var match = regexp.exec(font);\n  if (!match) {\n    return null;\n  }\n  var fontFamily = extractSingleFontFamily(match[3]);\n  var fontSize = +match[2] || 12;\n  var isBold = /bold/.exec(match[1]);\n  var isItalic = /italic/.exec(match[1]);\n  cachedFontObjectsFromString[font] = {\n    fontFamily: fontFamily,\n    fontSize: fontSize,\n    fontWeight: isBold ? 'bold' : 'normal',\n    fontStyle: isItalic ? 'italic' : 'normal',\n  };\n  return cachedFontObjectsFromString[font];\n}\n\nfunction extractFont(font) {\n  if (font == null) {\n    return null;\n  }\n  if (typeof font === 'string') {\n    return parseFontString(font);\n  }\n  var fontFamily = extractSingleFontFamily(font.fontFamily);\n  var fontSize = +font.fontSize || 12;\n  var fontWeight = font.fontWeight != null ? font.fontWeight.toString() : '400';\n  return {\n    // Normalize\n    fontFamily: fontFamily,\n    fontSize: fontSize,\n    fontWeight: fontWeight,\n    fontStyle: font.fontStyle,\n  };\n}\n\nvar newLine = /\\n/g;\nfunction extractFontAndLines(font, text) {\n  return { font: extractFont(font), lines: text.split(newLine) };\n}\n\nfunction extractAlignment(alignment) {\n  switch (alignment) {\n    case 'right':\n      return 1;\n    case 'center':\n      return 2;\n    default:\n      return 0;\n  }\n}\n\nclass Text extends React.Component {\n  render() {\n    var props = this.props;\n    var path = props.path;\n    var textPath = path ? (path instanceof Path ? path : new Path(path)).toJSON() : null;\n    var textFrame = extractFontAndLines(\n      props.font,\n      childrenAsString(props.children)\n    );\n    return (\n      <NativeText\n        fill={extractBrush(props.fill, props)}\n        opacity={extractOpacity(props)}\n        stroke={extractColor(props.stroke)}\n        strokeCap={extractStrokeCap(props.strokeCap)}\n        strokeDash={props.strokeDash || null}\n        strokeJoin={extractStrokeJoin(props.strokeJoin)}\n        strokeWidth={extractNumber(props.strokeWidth, 1)}\n        transform={extractTransform(props)}\n\n        alignment={extractAlignment(props.alignment)}\n        frame={textFrame}\n        path={textPath}\n      />\n    );\n  }\n}\n\n// Declarative fill type objects - API design not finalized\n\nfunction LinearGradient(stops, x1, y1, x2, y2) {\n  var type = LINEAR_GRADIENT;\n\n  if (arguments.length < 5) {\n    var angle = ((x1 == null) ? 270 : x1) * Math.PI / 180;\n\n    var x = Math.cos(angle);\n    var y = -Math.sin(angle);\n    var l = (Math.abs(x) + Math.abs(y)) / 2;\n\n    x *= l; y *= l;\n\n    x1 = 0.5 - x;\n    x2 = 0.5 + x;\n    y1 = 0.5 - y;\n    y2 = 0.5 + y;\n    this._bb = true;\n  } else {\n    this._bb = false;\n  }\n\n  var brushData = [type, +x1, +y1, +x2, +y2];\n  insertColorStopsIntoArray(stops, brushData, 5);\n  this._brush = brushData;\n}\n\nfunction RadialGradient(stops, fx, fy, rx, ry, cx, cy) {\n  if (ry == null) {\n    ry = rx;\n  }\n  if (cx == null) {\n    cx = fx;\n  }\n  if (cy == null) {\n    cy = fy;\n  }\n  if (fx == null) {\n    // As a convenience we allow the whole radial gradient to cover the\n    // bounding box. We should consider dropping this API.\n    fx = fy = rx = ry = cx = cy = 0.5;\n    this._bb = true;\n  } else {\n    this._bb = false;\n  }\n  // The ART API expects the radial gradient to be repeated at the edges.\n  // To simulate this we render the gradient twice as large and add double\n  // color stops. Ideally this API would become more restrictive so that this\n  // extra work isn't needed.\n  var brushData = [RADIAL_GRADIENT, +fx, +fy, +rx * 2, +ry * 2, +cx, +cy];\n  insertDoubleColorStopsIntoArray(stops, brushData, 7);\n  this._brush = brushData;\n}\n\nfunction Pattern(url, width, height, left, top) {\n  this._brush = [PATTERN, url, +left || 0, +top || 0, +width, +height];\n}\n\nvar ReactART = {\n  LinearGradient: LinearGradient,\n  RadialGradient: RadialGradient,\n  Pattern: Pattern,\n  Transform: Transform,\n  Path: Path,\n  Surface: Surface,\n  Group: Group,\n  ClippingRectangle: ClippingRectangle,\n  Shape: Shape,\n  Text: Text,\n};\n\nmodule.exports = ReactART;\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTGroupManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTNodeManager.h\"\n\n@interface ARTGroupManager : ARTNodeManager\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTGroupManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTGroupManager.h\"\n\n#import \"ARTGroup.h\"\n#import \"RCTConvert+ART.h\"\n\n@implementation ARTGroupManager\n\nRCT_EXPORT_MODULE()\n\n- (ARTNode *)node\n{\n  return [ARTGroup new];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(clipping, CGRect)\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTNodeManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@class ARTNode;\n\n@interface ARTNodeManager : RCTViewManager\n\n- (ARTNode *)node;\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTNodeManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTNodeManager.h\"\n\n#import \"ARTNode.h\"\n\n@implementation ARTNodeManager\n\nRCT_EXPORT_MODULE()\n\n- (ARTNode *)node\n{\n  return [ARTNode new];\n}\n\n- (NSView *)view\n{\n  return [self node];\n}\n\n- (RCTShadowView *)shadowView\n{\n  return nil;\n}\n\nRCT_EXPORT_VIEW_PROPERTY(opacity, CGFloat)\nRCT_EXPORT_VIEW_PROPERTY(transform, CGAffineTransform)\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTRenderableManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTNodeManager.h\"\n#import \"ARTRenderable.h\"\n\n@interface ARTRenderableManager : ARTNodeManager\n\n- (ARTRenderable *)node;\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTRenderableManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTRenderableManager.h\"\n\n#import \"RCTConvert+ART.h\"\n\n@implementation ARTRenderableManager\n\nRCT_EXPORT_MODULE()\n\n- (ARTRenderable *)node\n{\n  return [ARTRenderable new];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(strokeWidth, CGFloat)\nRCT_EXPORT_VIEW_PROPERTY(strokeCap, CGLineCap)\nRCT_EXPORT_VIEW_PROPERTY(strokeJoin, CGLineJoin)\nRCT_EXPORT_VIEW_PROPERTY(fill, ARTBrush)\nRCT_EXPORT_VIEW_PROPERTY(stroke, CGColor)\nRCT_EXPORT_VIEW_PROPERTY(strokeDash, ARTCGFloatArray)\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTShapeManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTRenderableManager.h\"\n\n@interface ARTShapeManager : ARTRenderableManager\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTShapeManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTShapeManager.h\"\n\n#import \"ARTShape.h\"\n#import \"RCTConvert+ART.h\"\n\n@implementation ARTShapeManager\n\nRCT_EXPORT_MODULE()\n\n- (ARTRenderable *)node\n{\n  return [ARTShape new];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(d, CGPath)\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTSurfaceViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface ARTSurfaceViewManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTSurfaceViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTSurfaceViewManager.h\"\n\n#import \"ARTSurfaceView.h\"\n\n@implementation ARTSurfaceViewManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  return [ARTSurfaceView new];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTTextManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTRenderableManager.h\"\n\n@interface ARTTextManager : ARTRenderableManager\n\n@end\n"
  },
  {
    "path": "Libraries/ART/ViewManagers/ARTTextManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"ARTTextManager.h\"\n\n#import \"ARTText.h\"\n#import \"RCTConvert+ART.h\"\n\n@implementation ARTTextManager\n\nRCT_EXPORT_MODULE()\n\n- (ARTRenderable *)node\n{\n  return [ARTText new];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(alignment, CTTextAlignment)\nRCT_REMAP_VIEW_PROPERTY(frame, textFrame, ARTTextFrame)\n\n@end\n"
  },
  {
    "path": "Libraries/ActionSheetIOS/ActionSheetIOS.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ActionSheetIOS\n * @flow\n * @format\n */\n'use strict';\n\nconst RCTActionSheetManager = require('NativeModules').ActionSheetManager;\n\nconst invariant = require('fbjs/lib/invariant');\nconst processColor = require('processColor');\n\n/**\n * Display action sheets and share sheets on iOS.\n *\n * See http://facebook.github.io/react-native/docs/actionsheetios.html\n */\nconst ActionSheetIOS = {\n  /**\n   * Display an iOS action sheet.\n   *\n   * The `options` object must contain one or more of:\n   *\n   * - `options` (array of strings) - a list of button titles (required)\n   * - `cancelButtonIndex` (int) - index of cancel button in `options`\n   * - `destructiveButtonIndex` (int) - index of destructive button in `options`\n   * - `title` (string) - a title to show above the action sheet\n   * - `message` (string) - a message to show below the title\n   *\n   * The 'callback' function takes one parameter, the zero-based index\n   * of the selected item.\n   *\n   * See http://facebook.github.io/react-native/docs/actionsheetios.html#showactionsheetwithoptions\n   */\n  showActionSheetWithOptions(\n    options: {|\n      +title?: ?string,\n      +message?: ?string,\n      +options: Array<string>,\n      +destructiveButtonIndex?: ?number,\n      +cancelButtonIndex?: ?number,\n      +anchor?: ?number,\n      +tintColor?: number | string,\n    |},\n    callback: (buttonIndex: number) => void,\n  ) {\n    invariant(\n      typeof options === 'object' && options !== null,\n      'Options must be a valid object',\n    );\n    invariant(typeof callback === 'function', 'Must provide a valid callback');\n\n    RCTActionSheetManager.showActionSheetWithOptions(\n      {...options, tintColor: processColor(options.tintColor)},\n      callback,\n    );\n  },\n\n  /**\n   * Display the iOS share sheet. The `options` object should contain\n   * one or both of `message` and `url` and can additionally have\n   * a `subject` or `excludedActivityTypes`:\n   *\n   * - `url` (string) - a URL to share\n   * - `message` (string) - a message to share\n   * - `subject` (string) - a subject for the message\n   * - `excludedActivityTypes` (array) - the activities to exclude from\n   *   the ActionSheet\n   * - `tintColor` (color) - tint color of the buttons\n   *\n   * The 'failureCallback' function takes one parameter, an error object.\n   * The only property defined on this object is an optional `stack` property\n   * of type `string`.\n   *\n   * The 'successCallback' function takes two parameters:\n   *\n   * - a boolean value signifying success or failure\n   * - a string that, in the case of success, indicates the method of sharing\n   *\n   * See http://facebook.github.io/react-native/docs/actionsheetios.html#showshareactionsheetwithoptions\n   */\n  showShareActionSheetWithOptions(\n    options: Object,\n    failureCallback: Function,\n    successCallback: Function,\n  ) {\n    invariant(\n      typeof options === 'object' && options !== null,\n      'Options must be a valid object',\n    );\n    invariant(\n      typeof failureCallback === 'function',\n      'Must provide a valid failureCallback',\n    );\n    invariant(\n      typeof successCallback === 'function',\n      'Must provide a valid successCallback',\n    );\n    RCTActionSheetManager.showShareActionSheetWithOptions(\n      {...options, tintColor: processColor(options.tintColor)},\n      failureCallback,\n      successCallback,\n    );\n  },\n};\n\nmodule.exports = ActionSheetIOS;\n"
  },
  {
    "path": "Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t14C644C41AB0DFC900DE3C65 /* RCTActionSheetManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C644C21AB0DFC900DE3C65 /* RCTActionSheetManager.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t134814201AA4EA6300B7C361 /* libRCTActionSheet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTActionSheet.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t14C644C11AB0DFC900DE3C65 /* RCTActionSheetManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTActionSheetManager.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t14C644C21AB0DFC900DE3C65 /* RCTActionSheetManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTActionSheetManager.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXGroup section */\n\t\t134814211AA4EA7D00B7C361 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134814201AA4EA6300B7C361 /* libRCTActionSheet.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58B511D21A9E6C8500147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t14C644C11AB0DFC900DE3C65 /* RCTActionSheetManager.h */,\n\t\t\t\t14C644C21AB0DFC900DE3C65 /* RCTActionSheetManager.m */,\n\t\t\t\t134814211AA4EA7D00B7C361 /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t58B511DA1A9E6C8500147676 /* RCTActionSheet */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTActionSheet\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t58B511D71A9E6C8500147676 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTActionSheet;\n\t\t\tproductName = RCTDataManager;\n\t\t\tproductReference = 134814201AA4EA6300B7C361 /* libRCTActionSheet.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511D31A9E6C8500147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t58B511DA1A9E6C8500147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTActionSheet\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511D21A9E6C8500147676;\n\t\t\tproductRefGroup = 58B511D21A9E6C8500147676;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B511DA1A9E6C8500147676 /* RCTActionSheet */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t58B511D71A9E6C8500147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t14C644C41AB0DFC900DE3C65 /* RCTActionSheetManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t58B511ED1A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511EE1A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511F01A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTActionSheet;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511F11A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTActionSheet;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTActionSheet\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511ED1A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511EE1A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTActionSheet\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511F01A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511F11A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511D31A9E6C8500147676 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/ActionSheetIOS/RCTActionSheetManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\n#import <React/RCTBridge.h>\n\n@interface RCTActionSheetManager : NSObject <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "Libraries/ActionSheetIOS/RCTActionSheetManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTActionSheetManager.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTLog.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTUtils.h>\n\n@interface RCTActionSheetManager () <UIActionSheetDelegate>\n@end\n\n@implementation RCTActionSheetManager\n{\n  // Use NSMapTable, as UIAlertViews do not implement <NSCopying>\n  // which is required for NSDictionary keys\n  NSMapTable *_callbacks;\n}\n\nRCT_EXPORT_MODULE()\n\n@synthesize bridge = _bridge;\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n/*\n * The `anchor` option takes a view to set as the anchor for the share\n * popup to point to, on iPads running iOS 8. If it is not passed, it\n * defaults to centering the share popup on screen without any arrows.\n */\n- (CGRect)sourceRectInView:(UIView *)sourceView\n             anchorViewTag:(NSNumber *)anchorViewTag\n{\n  if (anchorViewTag) {\n    UIView *anchorView = [self.bridge.uiManager viewForReactTag:anchorViewTag];\n    return [anchorView convertRect:anchorView.bounds toView:sourceView];\n  } else {\n    return (CGRect){sourceView.center, {1, 1}};\n  }\n}\n\nRCT_EXPORT_METHOD(showActionSheetWithOptions:(NSDictionary *)options\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  if (RCTRunningInAppExtension()) {\n    RCTLogError(@\"Unable to show action sheet from app extension\");\n    return;\n  }\n\n  if (!_callbacks) {\n    _callbacks = [NSMapTable strongToStrongObjectsMapTable];\n  }\n\n  NSString *title = [RCTConvert NSString:options[@\"title\"]];\n  NSString *message = [RCTConvert NSString:options[@\"message\"]];\n  NSArray<NSString *> *buttons = [RCTConvert NSStringArray:options[@\"options\"]];\n  NSInteger destructiveButtonIndex = options[@\"destructiveButtonIndex\"] ? [RCTConvert NSInteger:options[@\"destructiveButtonIndex\"]] : -1;\n  NSInteger cancelButtonIndex = options[@\"cancelButtonIndex\"] ? [RCTConvert NSInteger:options[@\"cancelButtonIndex\"]] : -1;\n\n  UIViewController *controller = RCTPresentedViewController();\n\n  if (controller == nil) {\n    RCTLogError(@\"Tried to display action sheet but there is no application window. options: %@\", options);\n    return;\n  }\n\n  /*\n   * The `anchor` option takes a view to set as the anchor for the share\n   * popup to point to, on iPads running iOS 8. If it is not passed, it\n   * defaults to centering the share popup on screen without any arrows.\n   */\n  NSNumber *anchorViewTag = [RCTConvert NSNumber:options[@\"anchor\"]];\n  UIView *sourceView = controller.view;\n  CGRect sourceRect = [self sourceRectInView:sourceView anchorViewTag:anchorViewTag];\n\n  UIAlertController *alertController =\n  [UIAlertController alertControllerWithTitle:title\n                                      message:message\n                               preferredStyle:UIAlertControllerStyleActionSheet];\n\n  NSInteger index = 0;\n  for (NSString *option in buttons) {\n    UIAlertActionStyle style = UIAlertActionStyleDefault;\n    if (index == destructiveButtonIndex) {\n      style = UIAlertActionStyleDestructive;\n    } else if (index == cancelButtonIndex) {\n      style = UIAlertActionStyleCancel;\n    }\n\n    NSInteger localIndex = index;\n    [alertController addAction:[UIAlertAction actionWithTitle:option\n                                                        style:style\n                                                      handler:^(__unused UIAlertAction *action){\n      callback(@[@(localIndex)]);\n    }]];\n\n    index++;\n  }\n\n  alertController.modalPresentationStyle = UIModalPresentationPopover;\n  alertController.popoverPresentationController.sourceView = sourceView;\n  alertController.popoverPresentationController.sourceRect = sourceRect;\n  if (!anchorViewTag) {\n    alertController.popoverPresentationController.permittedArrowDirections = 0;\n  }\n  [controller presentViewController:alertController animated:YES completion:nil];\n\n  alertController.view.tintColor = [RCTConvert UIColor:options[@\"tintColor\"]];\n}\n\nRCT_EXPORT_METHOD(showShareActionSheetWithOptions:(NSDictionary *)options\n                  failureCallback:(RCTResponseErrorBlock)failureCallback\n                  successCallback:(RCTResponseSenderBlock)successCallback)\n{\n  if (RCTRunningInAppExtension()) {\n    RCTLogError(@\"Unable to show action sheet from app extension\");\n    return;\n  }\n\n  NSMutableArray<id> *items = [NSMutableArray array];\n  NSString *message = [RCTConvert NSString:options[@\"message\"]];\n  if (message) {\n    [items addObject:message];\n  }\n  NSURL *URL = [RCTConvert NSURL:options[@\"url\"]];\n  if (URL) {\n    if ([URL.scheme.lowercaseString isEqualToString:@\"data\"]) {\n      NSError *error;\n      NSData *data = [NSData dataWithContentsOfURL:URL\n                                           options:(NSDataReadingOptions)0\n                                             error:&error];\n      if (!data) {\n        failureCallback(error);\n        return;\n      }\n      [items addObject:data];\n    } else {\n      [items addObject:URL];\n    }\n  }\n  if (items.count == 0) {\n    RCTLogError(@\"No `url` or `message` to share\");\n    return;\n  }\n\n  UIActivityViewController *shareController = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];\n\n  NSString *subject = [RCTConvert NSString:options[@\"subject\"]];\n  if (subject) {\n    [shareController setValue:subject forKey:@\"subject\"];\n  }\n\n  NSArray *excludedActivityTypes = [RCTConvert NSStringArray:options[@\"excludedActivityTypes\"]];\n  if (excludedActivityTypes) {\n    shareController.excludedActivityTypes = excludedActivityTypes;\n  }\n\n  UIViewController *controller = RCTPresentedViewController();\n  shareController.completionWithItemsHandler = ^(NSString *activityType, BOOL completed, __unused NSArray *returnedItems, NSError *activityError) {\n    if (activityError) {\n      failureCallback(activityError);\n    } else {\n      successCallback(@[@(completed), RCTNullIfNil(activityType)]);\n    }\n  };\n\n  shareController.modalPresentationStyle = UIModalPresentationPopover;\n  NSNumber *anchorViewTag = [RCTConvert NSNumber:options[@\"anchor\"]];\n  if (!anchorViewTag) {\n    shareController.popoverPresentationController.permittedArrowDirections = 0;\n  }\n  shareController.popoverPresentationController.sourceView = controller.view;\n  shareController.popoverPresentationController.sourceRect = [self sourceRectInView:controller.view anchorViewTag:anchorViewTag];\n\n  [controller presentViewController:shareController animated:YES completion:nil];\n\n  shareController.view.tintColor = [RCTConvert UIColor:options[@\"tintColor\"]];\n}\n\n#pragma mark UIActionSheetDelegate Methods\n\n- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex\n{\n  RCTResponseSenderBlock callback = [_callbacks objectForKey:actionSheet];\n  if (callback) {\n    callback(@[@(buttonIndex)]);\n    [_callbacks removeObjectForKey:actionSheet];\n  } else {\n    RCTLogWarn(@\"No callback registered for action sheet: %@\", actionSheet.title);\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Alert/Alert.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Alert\n * @flow\n */\n'use strict';\n\nconst AlertIOS = require('AlertIOS');\nconst NativeModules = require('NativeModules');\nconst Platform = require('Platform');\n\nimport type { AlertType, AlertButtonStyle } from 'AlertIOS';\n\nexport type Buttons = Array<{\n  text?: string,\n  onPress?: ?Function,\n  style?: AlertButtonStyle,\n}>;\n\ntype Options = {\n  cancelable?: ?boolean,\n  onDismiss?: ?Function,\n};\n\n/**\n * Launches an alert dialog with the specified title and message.\n * \n * See http://facebook.github.io/react-native/docs/alert.html\n */\nclass Alert {\n\n  /**\n   * Launches an alert dialog with the specified title and message.\n   * \n   * See http://facebook.github.io/react-native/docs/alert.html#alert\n   */\n  static alert(\n    title: ?string,\n    message?: ?string,\n    buttons?: Buttons,\n    options?: Options,\n    type?: AlertType,\n  ): void {\n    if (Platform.OS === 'ios' || Platform.OS === 'macos') {\n      if (typeof type !== 'undefined') {\n        console.warn('Alert.alert() with a 5th \"type\" parameter is deprecated and will be removed. Use AlertIOS.prompt() instead.');\n        AlertIOS.alert(title, message, buttons, type);\n        return;\n      }\n      AlertIOS.alert(title, message, buttons);\n    } else if (Platform.OS === 'android') {\n      AlertAndroid.alert(title, message, buttons, options);\n    }\n  }\n}\n\n/**\n * Wrapper around the Android native module.\n */\nclass AlertAndroid {\n\n  static alert(\n    title: ?string,\n    message?: ?string,\n    buttons?: Buttons,\n    options?: Options,\n  ): void {\n    var config = {\n      title: title || '',\n      message: message || '',\n    };\n\n    if (options) {\n      config = {...config, cancelable: options.cancelable};\n    }\n    // At most three buttons (neutral, negative, positive). Ignore rest.\n    // The text 'OK' should be probably localized. iOS Alert does that in native.\n    var validButtons: Buttons = buttons ? buttons.slice(0, 3) : [{text: 'OK'}];\n    var buttonPositive = validButtons.pop();\n    var buttonNegative = validButtons.pop();\n    var buttonNeutral = validButtons.pop();\n    if (buttonNeutral) {\n      config = {...config, buttonNeutral: buttonNeutral.text || '' };\n    }\n    if (buttonNegative) {\n      config = {...config, buttonNegative: buttonNegative.text || '' };\n    }\n    if (buttonPositive) {\n      config = {...config, buttonPositive: buttonPositive.text || '' };\n    }\n    NativeModules.DialogManagerAndroid.showAlert(\n      config,\n      (errorMessage) => console.warn(errorMessage),\n      (action, buttonKey) => {\n        if (action === NativeModules.DialogManagerAndroid.buttonClicked) {\n          if (buttonKey === NativeModules.DialogManagerAndroid.buttonNeutral) {\n            buttonNeutral.onPress && buttonNeutral.onPress();\n          } else if (buttonKey === NativeModules.DialogManagerAndroid.buttonNegative) {\n            buttonNegative.onPress && buttonNegative.onPress();\n          } else if (buttonKey === NativeModules.DialogManagerAndroid.buttonPositive) {\n            buttonPositive.onPress && buttonPositive.onPress();\n          }\n        } else if (action === NativeModules.DialogManagerAndroid.dismissed) {\n          options && options.onDismiss && options.onDismiss();\n        }\n      }\n    );\n  }\n}\n\nmodule.exports = Alert;\n"
  },
  {
    "path": "Libraries/Alert/AlertIOS.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AlertIOS\n * @flow\n * @jsdoc\n */\n'use strict';\n\nvar RCTAlertManager = require('NativeModules').AlertManager;\n\n/**\n * An Alert button type\n */\nexport type AlertType = $Enum<{\n  /**\n   * Default alert with no inputs\n   */\n  'default': string,\n  /**\n   * Plain text input alert\n   */\n  'plain-text': string,\n  /**\n   * Secure text input alert\n   */\n  'secure-text': string,\n  /**\n   * Login and password alert\n   */\n  'login-password': string,\n}>;\n\n/**\n * An Alert button style\n */\nexport type AlertButtonStyle = $Enum<{\n  /**\n   * Default button style\n   */\n  'default': string,\n  /**\n   * Cancel button style\n   */\n  'cancel': string,\n  /**\n   * Destructive button style\n   */\n  'destructive': string,\n}>;\n\n/**\n * Array or buttons\n * @typedef {Array} ButtonsArray\n * @property {string=} text Button label\n * @property {Function=} onPress Callback function when button pressed\n * @property {AlertButtonStyle=} style Button style\n */\nexport type ButtonsArray = Array<{\n  /**\n   * Button label\n   */\n  text?: string,\n  /**\n   * Callback function when button pressed\n   */\n  onPress?: ?Function,\n  /**\n   * Button style\n   */\n  style?: AlertButtonStyle,\n}>;\n\n/**\n * Use `AlertIOS` to display an alert dialog with a message or to create a prompt for user input on iOS. If you don't need to prompt for user input, we recommend using `Alert.alert() for cross-platform support.\n *\n * See http://facebook.github.io/react-native/docs/alertios.html\n */\nclass AlertIOS {\n  /**\n   * Create and display a popup alert.\n   *\n   * See http://facebook.github.io/react-native/docs/alertios.html#alert\n   */\n  static alert(\n    title: ?string,\n    message?: ?string,\n    callbackOrButtons?: ?(() => void) | ButtonsArray,\n    type?: AlertType,\n  ): void {\n    if (typeof type !== 'undefined') {\n      console.warn('AlertIOS.alert() with a 4th \"type\" parameter is deprecated and will be removed. Use AlertIOS.prompt() instead.');\n      this.prompt(title, message, callbackOrButtons, type);\n      return;\n    }\n    if (!callbackOrButtons) {\n      callbackOrButtons = [{text: 'OK'}]\n    }\n    this.prompt(title, message, callbackOrButtons, 'default');\n  }\n\n  /**\n   * Create and display a prompt to enter some text.\n   * \n   * See http://facebook.github.io/react-native/docs/alertios.html#prompt\n   */\n  static prompt(\n    title: ?string,\n    message?: ?string,\n    callbackOrButtons?: ?((text: string) => void) | ButtonsArray,\n    type?: ?AlertType = 'plain-text',\n    defaultValue?: string,\n    keyboardType?: string\n  ): void {\n    if (typeof type === 'function') {\n      console.warn(\n        'You passed a callback function as the \"type\" argument to AlertIOS.prompt(). React Native is ' +\n        'assuming  you want to use the deprecated AlertIOS.prompt(title, defaultValue, buttons, callback) ' +\n        'signature. The current signature is AlertIOS.prompt(title, message, callbackOrButtons, type, defaultValue, ' +\n        'keyboardType) and the old syntax will be removed in a future version.');\n\n      var callback = type;\n      var defaultValue = message;\n      RCTAlertManager.alertWithArgs({\n        title: title || '',\n        type: 'plain-text',\n        defaultValue,\n      }, (id, value) => {\n        callback(value);\n      });\n      return;\n    }\n\n    var callbacks = [];\n    var buttons = [];\n    var cancelButtonKey;\n    var destructiveButtonKey;\n    if (typeof callbackOrButtons === 'function') {\n      callbacks = [callbackOrButtons];\n    }\n    else if (callbackOrButtons instanceof Array) {\n      callbackOrButtons.forEach((btn, index) => {\n        callbacks[index] = btn.onPress;\n        if (btn.style === 'cancel') {\n          cancelButtonKey = String(index);\n        } else if (btn.style === 'destructive') {\n          destructiveButtonKey = String(index);\n        }\n        if (btn.text || index < (callbackOrButtons || []).length - 1) {\n          var btnDef = {};\n          btnDef[index] = btn.text || '';\n          buttons.push(btnDef);\n        }\n      });\n    }\n\n    RCTAlertManager.alertWithArgs({\n      title: title || '',\n      message: message || undefined,\n      buttons,\n      type: type || undefined,\n      defaultValue,\n      cancelButtonKey,\n      destructiveButtonKey,\n      keyboardType,\n    }, (id, value) => {\n      var cb = callbacks[id];\n      cb && cb(value);\n    });\n  }\n}\n\nmodule.exports = AlertIOS;\n"
  },
  {
    "path": "Libraries/Alert/RCTAlertManager.android.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RCTAlertManager\n*/\n'use strict';\n\nvar NativeModules = require('NativeModules');\n\nfunction emptyCallback() {}\n\nmodule.exports = {\n  alertWithArgs: function(args, callback) {\n    // TODO(5998984): Polyfill it correctly with DialogManagerAndroid\n    NativeModules.DialogManagerAndroid.showAlert(\n        args,\n        emptyCallback,\n        callback || emptyCallback);\n  },\n};\n"
  },
  {
    "path": "Libraries/Alert/RCTAlertManager.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RCTAlertManager\n * @flow\n */\n'use strict';\n\nvar RCTAlertManager = require('NativeModules').AlertManager;\n\nmodule.exports = RCTAlertManager;\n"
  },
  {
    "path": "Libraries/Animated/examples/demo.html",
    "content": "\n<!DOCTYPE html>\n<html>\n  <head>\n    <meta http-equiv='Content-type' content='text/html; charset=utf-8'>\n    <title>Animated</title>\n    <link href=\"./style.css\" rel=\"stylesheet\" type=\"text/css\">\n    <script src=\"https://fb.me/react-with-addons-0.13.3.js\"></script>\n    <script src=\"https://fb.me/JSXTransformer-0.13.3.js\"></script>\n    <script src=\"../release/dist/animated.js\"></script>\n    <style>\n\n    </style>\n    <script>\n    var TOTAL_EXAMPLES = 0;\n    function example() {\n      var scripts = document.getElementsByTagName('script');\n      var last = scripts[scripts.length - 2];\n      last.className = 'Example' + (++TOTAL_EXAMPLES);\n    }\n    </script>\n    <script type=\"text/jsx;harmony=true;stripTypes=true\">\n\n    var HorizontalPan = function(anim, config) {\n      config = config || {};\n      return {\n        onMouseDown: function(event) {\n          anim.stopAnimation(startValue => {\n            config.onStart && config.onStart();\n            var startPosition = event.clientX;\n            var lastTime = Date.now();\n            var lastPosition = event.clientX;\n            var velocity = 0;\n\n            function updateVelocity(event) {\n              var now = Date.now();\n              if (event.clientX === lastPosition || now === lastTime) {\n                return;\n              }\n              velocity = (event.clientX - lastPosition) / (now - lastTime);\n              lastTime = now;\n              lastPosition = event.clientX;\n            }\n\n            var moveListener, upListener;\n            window.addEventListener('mousemove', moveListener = (event) => {\n              var value = startValue + (event.clientX - startPosition);\n              anim.setValue(value);\n              updateVelocity(event);\n            });\n            window.addEventListener('mouseup', upListener = (event) => {\n              updateVelocity(event);\n              window.removeEventListener('mousemove', moveListener);\n              window.removeEventListener('mouseup', upListener);\n              config.onEnd && config.onEnd({velocity});\n            });\n          });\n        }\n      }\n    };\n\n    var EXAMPLE_COUNT = 0;\n    function examplify(Component) {\n      if (EXAMPLE_COUNT) {\n        var previousScript = document.getElementsByClassName('Example' + EXAMPLE_COUNT)[0].innerText;\n      } else {\n        var previousScript = `\n        examplify(React.createClass({\n          getInitialState: function() {\n            return {\n              anim: new Animated.Value(0), // ignore\n            };\n          },\n          render: function() {\n            return (\n              <Animated.div // ignore\n                style={{left: this.state.anim}} // ignore\n                className=\"circle\"\n              />\n            );\n          },\n        }));\n        `;\n      }\n\n      var script = document.getElementsByClassName('Example' + ++EXAMPLE_COUNT)[0];\n\n      var previousLines = {};\n      previousScript.split(/\\n/g).forEach(line => { previousLines[line.trim()] = 1; });\n      var code = document.createElement('div');\n      script.parentNode.insertBefore(code, script);\n\n      var Example = React.createClass({\n        render() {\n          return (\n            <div className=\"code\">\n              <div className=\"example\">\n                <button\n                  className=\"reset\"\n                  onClick={() => this.forceUpdate()}>\n                  Reset\n                </button>\n                <Component key={Math.random()} />\n              </div>\n              <hr />\n              <pre>{'React.createClass({'}</pre>\n              {script.innerText\n                .trim()\n                .split(/\\n/g)\n                .slice(1, -1)\n                .map(line =>\n                  <pre\n                    className={!previousLines[line.trim()] && 'highlight'}>\n                    {line}\n                  </pre>\n                )\n              }\n              <pre>{'});'}</pre>\n            </div>\n          );\n        }\n      })\n\n      React.render(<Example />, code);\n    }\n    </script>\n\n  </head>\n\n  <body>\n  <div class=\"container\">\n\n  <h1>Animated</h1>\n  <p>Animations have for a long time been a weak point of the React ecosystem. The <code>Animated</code> library aims at solving this problem. It embraces the declarative aspect of React and obtains performance by using raw DOM manipulation behind the scenes instead of the usual diff.</p>\n\n  <h2>Animated.Value</h2>\n\n  <p>The basic building block of this library is <code>Animated.Value</code>. This is a variable that's going to drive the animation. You use it like a normal value in <code>style</code> attribute. Only animated components such as <code>Animated.div</code> will understand it.</p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anim: new Animated.Value(100),\n    };\n  },\n  render: function() {\n    return (\n      <Animated.div\n        style={{left: this.state.anim}}\n        className=\"circle\"\n      />\n    );\n  },\n}));\n</script><script>example();</script>\n\n<h2>setValue</h2>\n\n<p>As you can see, the value is being used inside of <code>render()</code> as you would expect. However, you don't call <code>setState()</code> in order to update the value. Instead, you can call <code>setValue()</code> directly on the value itself. We are using a form of data binding.</p>\n\n<p>The <code>Animated.div</code> component when rendered tracks which animated values it received. This way, whenever that value changes, we don't need to re-render the entire component, we can directly update the specific style attribute that changed.</p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anim: new Animated.Value(0),\n    };\n  },\n  render: function() {\n    return (\n      <Animated.div\n        style={{left: this.state.anim}}\n        className=\"circle\"\n        onClick={this.handleClick}>\n        Click\n      </Animated.div>\n    );\n  },\n  handleClick: function() {\n    this.state.anim.setValue(400);\n  },\n}));\n</script><script>example();</script>\n\n<h2>Animated.timing</h2>\n\n<p>Now that we understand how the system works, let's play with some animations! The hello world of animations is to move the element somewhere else. To do that, we're going to animate the value from the current value 0 to the value 400.</p>\n\n<p>On every frame (via <code>requestAnimationFrame</code>), the <code>timing</code> animation is going to figure out the new value based on the current time, update the animated value which in turn is going to update the corresponding DOM node.</p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anim: new Animated.Value(0),\n    };\n  },\n  render: function() {\n    return (\n      <Animated.div\n        style={{left: this.state.anim}}\n        className=\"circle\"\n        onClick={this.handleClick}>\n        Click\n      </Animated.div>\n    );\n  },\n  handleClick: function() {\n    Animated.timing(this.state.anim, {toValue: 400}).start();\n  },\n}));\n</script><script>example();</script>\n\n<h2>Interrupt Animations</h2>\n\n<p>As a developer, the mental model is that most animations are fire and forget. When the user presses the button, you want it to shrink to 80% and when she releases, you want it to go back to 100%.</p>\n\n<p>There are multiple challenges to implement this correctly. You need to stop the current animation, grab the current value and restart an animation from there. As this is pretty tedious to do manually, <code>Animated</code> will do that automatically for you.</p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anim: new Animated.Value(1),\n    };\n  },\n  render: function() {\n    return (\n      <Animated.div\n        style={{transform: [{scale: this.state.anim}]}}\n        className=\"circle\"\n        onMouseDown={this.handleMouseDown}\n        onMouseUp={this.handleMouseUp}>\n        Press\n      </Animated.div>\n    );\n  },\n  handleMouseDown: function() {\n    Animated.timing(this.state.anim, { toValue: 0.8 }).start();\n  },\n  handleMouseUp: function() {\n    Animated.timing(this.state.anim, { toValue: 1 }).start();\n  },\n}));\n</script><script>example();</script>\n\n<h2>Animated.spring</h2>\n\n<p>Unfortunately, the <code>timing</code> animation doesn't feel good. The main reason is that no matter how far you are in the animation, it will trigger a new one with always the same duration.</p>\n\n<p>The commonly used solution for this problem is to use the equation of a real-world spring. Imagine that you attach a spring to the target value, stretch it to the current value and let it go. The spring movement is going to be the same as the update.</p>\n\n<p>It turns out that this model is useful in a very wide range of animations. I highly recommend you to always start with a <code>spring</code> animation instead of a <code>timing</code> animation. It will make your interface feels much better.</p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anim: new Animated.Value(1),\n    };\n  },\n  render: function() {\n    return (\n      <Animated.div\n        style={{transform: [{scale: this.state.anim}]}}\n        className=\"circle\"\n        onMouseDown={this.handleMouseDown}\n        onMouseUp={this.handleMouseUp}>\n        Press\n      </Animated.div>\n    );\n  },\n  handleMouseDown: function() {\n    Animated.spring(this.state.anim, { toValue: 0.8 }).start();\n  },\n  handleMouseUp: function() {\n    Animated.spring(this.state.anim, { toValue: 1 }).start();\n  },\n}));\n</script><script>example();</script>\n\n<h2>interpolate</h2>\n\n<p>It is very common to animate multiple attributes during the same animation. The usual way to implement it is to start a separate animation for each of the attribute. The downside is that you now have to manage a different state per attribute which is not ideal.</p>\n\n<p>With <code>Animated</code>, you can use a single state variable and render it in multiple attributes. When the value is updated, all the places will reflect the change.</p>\n\n<p>In the following example, we're going to model the animation with a variable where 1 means fully visible and 0 means fully hidden. We can pass it directly to the scale attribute as the ranges match. But for the rotation, we need to convert [0 ; 1] range to [260deg ; 0deg]. This is where <code>interpolate()</code> comes handy.</p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anim: new Animated.Value(1),\n    };\n  },\n  render: function() {\n    return (\n      <Animated.div\n        style={{\n          transform: [\n            {rotate: this.state.anim.interpolate({\n              inputRange: [0, 1],\n              outputRange: ['260deg', '0deg']\n            })},\n            {scale: this.state.anim},\n          ]\n        }}\n        className=\"circle\"\n        onClick={this.handleClick}>\n        Click\n      </Animated.div>\n    );\n  },\n  handleClick: function() {\n    Animated.spring(this.state.anim, {toValue: 0}).start();\n  }\n}));\n</script><script>example();</script>\n\n<h2>stopAnimation</h2>\n\n<p>The reason why we can get away with not calling <code>render()</code> and instead modify the DOM directly on updates is because the animated values are <strong>opaque</strong>. In render, <strong>you cannot know the current value</strong>, which prevents you from being able to modify the structure of the DOM.</p>\n\n<p><code>Animated</code> can offload the animation to a different thread (CoreAnimation, CSS transitions, main thread...) and we don't have a good way to know the real value. If you try to query the value then modify it, you are going to be out of sync and the result will look terrible.</p>\n\n<p>There's however one exception: when you want to stop the current animation. You need to know where it stopped in order to continue from there. We cannot know the value synchronously so we give it via a callback in <code>stopAnimation</code>. It will not suffer from being out of sync since the animation is no longer running.</p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anim: new Animated.Value(0)\n    };\n  },\n  render: function() {\n    return (\n      <div>\n        <button onClick={() => this.handleClick(-1)}>&lt;</button>\n        <Animated.div\n          style={{\n            transform: [\n              {rotate: this.state.anim.interpolate({\n                inputRange: [0, 4],\n                outputRange: ['0deg', '360deg']\n              })},\n            ],\n            position: 'relative'\n          }}\n          className=\"circle\"\n        />\n        <button onClick={() => this.handleClick(+1)}>&gt;</button>\n      </div>\n    );\n  },\n  handleClick: function(delta) {\n    this.state.anim.stopAnimation(value => {\n      Animated.spring(this.state.anim, {\n        toValue: Math.round(value) + delta\n      }).start();\n    });\n  },\n}));\n</script><script>example();</script>\n\n\n<h1>Gesture-based Animations</h1>\n\n<p>Most animations libraries only deal with time-based animations. But, as we move to mobile, a lot of animations are also gesture driven. Even more problematic, they often switch between both modes: once the gesture is over, you start a time-based animation using the same interpolations.</p>\n\n<p><code>Animated</code> has been designed with this use case in mind. The key aspect is that there are three distinct and separate concepts: inputs, value, output. The same value can be updated either from a time-based animation or a gesture-based one. Because we use this intermediate representation for the animation, we can keep the same rendering as output.</p>\n\n<h2>HorizontalPan</h2>\n\n<p>The code needed to drag elements around is very messy with the DOM APIs. On mousedown, you need to register a mousemove listener on window otherwise you may drop touches if you move too fast. <code>removeEventListener</code> takes the same arguments as <code>addEventListener</code> instead of an id like <code>clearTimeout</code>. It's also really easy to forget to remove a listener and have a leak. And finally, you need to store the current position and value at the beginning and update only compared to it.</p>\n\n<p>We introduce a little helper called <code>HorizontalPan</code> which handles all this annoying code for us. It takes an <code>Animated.Value</code> as first argument and returns the event handlers required for it to work. We just have to bind this value to the <code>left</code> attribute and we're good to go.</p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anim: new Animated.Value(0),\n    };\n  },\n  render: function() {\n    return (\n      <Animated.div\n        style={{left: this.state.anim}}\n        className=\"circle\"\n        {...HorizontalPan(this.state.anim)}>\n        Drag\n      </Animated.div>\n    );\n  },\n}));\n</script><script>example();</script>\n\n<h2>Animated.decay</h2>\n\n<p>One of the big breakthrough of the iPhone is the fact that when you release the finger while scrolling, it will not abruptly stop but instead keep going for some time.</p>\n\n<p>In order to implement this effect, we are using a second real-world simulation: an object moving on an icy surface. All it needs is two values: the current velocity and a deceleration coefficient. It is implemented by <code>Animated.decay</code>.</p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anim: new Animated.Value(0),\n    };\n  },\n  render: function() {\n    return (\n      <Animated.div\n        style={{left: this.state.anim}}\n        className=\"circle\"\n        {...HorizontalPan(this.state.anim, {\n          onEnd: this.handleEnd\n        })}>\n        Throw\n      </Animated.div>\n    );\n  },\n  handleEnd: function({velocity}) {\n    Animated.decay(this.state.anim, {velocity}).start();\n  }\n}));\n</script><script>example();</script>\n\n<h2>Animation Chaining</h2>\n\n<p>The target for an animation is usually a number but sometimes it is convenient to use another value as a target. This way, the first value will track the second. Using a spring animation, we can get a nice trailing effect.</p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    var anims = [0, 1, 2, 3, 4].map((_, i) => new Animated.Value(0));\n    Animated.spring(anims[0], {toValue: anims[1]}).start();\n    Animated.spring(anims[1], {toValue: anims[2]}).start();\n    Animated.spring(anims[2], {toValue: anims[3]}).start();\n    Animated.spring(anims[3], {toValue: anims[4]}).start();\n    return {\n      anims: anims,\n    };\n  },\n  render: function() {\n    return (\n      <div>\n        {this.state.anims.map((anim, i) =>\n          <Animated.div\n            style={{left: anim}}\n            className=\"circle\"\n            {...(i === 4 && HorizontalPan(anim, {\n              onEnd: this.handleEnd\n            }))}>\n            {i === 4 && 'Drag'}\n          </Animated.div>\n        )}\n      </div>\n    );\n  },\n  handleEnd: function({velocity}) {\n    Animated.decay(this.state.anims[4], {velocity}).start();\n  }\n}));\n</script><script>example();</script>\n\n<h2>addListener</h2>\n\n<p>As I said earlier, if you track a spring</p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    var anims = [0, 1, 2, 3, 4].map((_, i) => new Animated.Value(i * 100));\n    anims[0].addListener(this.handleChange);\n    return {\n      selected: null,\n      anims: anims,\n    };\n  },\n  render: function() {\n    return (\n      <div>\n        {this.state.anims.map((anim, i) =>\n          <Animated.div\n            style={{\n              left: anim,\n              opacity: i === 0 || i === this.state.selected ? 1 : 0.5\n            }}\n            className=\"circle\"\n            {...(i === 0 && HorizontalPan(anim, { onEnd: this.handleEnd }))}>\n            {i === 0 && 'Drag'}\n            {i === this.state.selected && 'Selected!'}\n          </Animated.div>\n        )}\n      </div>\n    );\n  },\n  handleChange: function({value}) {\n    var selected = null;\n    this.state.anims.forEach((_, i) => {\n      if (i !== 0 && i * 100 - 50 < value && value <= i * 100 + 50) {\n        selected = i;\n      }\n    });\n    if (selected !== this.state.selected) {\n      this.select(selected)\n    }\n  },\n  select(selected) {\n    this.setState({selected}, () => {\n      this.state.anims.forEach((anim, i) => {\n        if (i === 0) { return; }\n        if (selected === i) {\n          Animated.spring(anim, {toValue: this.state.anims[0]}).start();\n        } else {\n          Animated.spring(anim, {toValue: i * 100}).start();\n        }\n      });\n    });\n  },\n  handleEnd() {\n    this.select(null);\n    Animated.spring(this.state.anims[0], {toValue: 0}).start();\n  }\n}));\n</script><script>example();</script>\n\n\n<h2>Animated.sequence</h2>\n\n<p>It is very common to animate </p>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anims: [0, 1, 2, 3, 4].map((_, i) => new Animated.Value(0.2)),\n    };\n  },\n  render: function() {\n    return (\n      <div>\n        {this.state.anims.map((anim, i) =>\n          <Animated.div\n            style={{opacity: anim, position: 'relative'}}\n            className=\"circle\"\n            onClick={i === 0 && this.handleClick}>\n            {i === 0 && 'Click'}\n          </Animated.div>\n        )}\n      </div>\n    );\n  },\n  handleClick: function() {\n    this.state.anims.forEach(anim => { anim.setValue(0.2); });\n    Animated.sequence(\n      this.state.anims.map(anim => Animated.spring(anim, { toValue: 1 }))\n    ).start();\n  },\n}));\n</script><script>example();</script>\n\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anims: [0, 1, 2, 3, 4].map((_, i) => new Animated.Value(0.2)),\n    };\n  },\n  render: function() {\n    return (\n      <div>\n        {this.state.anims.map((anim, i) =>\n          <Animated.div\n            style={{opacity: anim, position: 'relative'}}\n            className=\"circle\"\n            onClick={i === 0 && this.handleClick}>\n            {i === 0 && 'Click'}\n          </Animated.div>\n        )}\n      </div>\n    );\n  },\n  handleClick: function() {\n    this.state.anims.forEach(anim => { anim.setValue(0.2); });\n    Animated.stagger(\n      100,\n      this.state.anims.map(anim => Animated.spring(anim, { toValue: 1 }))\n    ).start();\n  },\n}));\n</script><script>example();</script>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anims: [0, 1, 2, 3, 4].map((_, i) => new Animated.Value(0.2)),\n    };\n  },\n  render: function() {\n    return (\n      <div>\n        {this.state.anims.map((anim, i) =>\n          <Animated.div\n            style={{opacity: anim, position: 'relative'}}\n            className=\"circle\"\n            onClick={i === 0 && this.handleClick}>\n            {i === 0 && 'Click'}\n          </Animated.div>\n        )}\n      </div>\n    );\n  },\n  handleClick: function() {\n    this.state.anims.forEach(anim => { anim.setValue(0.2); });\n    Animated.sequence([\n      Animated.parallel(\n        this.state.anims.map(anim => Animated.spring(anim, { toValue: 1 }))\n      ),\n      Animated.stagger(\n        100,\n        this.state.anims.map(anim => Animated.spring(anim, { toValue: 0.2 }))\n      ),\n    ]).start();\n  },\n}));\n</script><script>example();</script>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anim: new Animated.Value(0),\n    };\n  },\n  handleClick: function() {\n    var rec = () => {\n      Animated.sequence([\n        Animated.timing(this.state.anim, {toValue: -1, duration: 150}),\n        Animated.timing(this.state.anim, {toValue: 1, duration: 150}),\n      ]).start(rec);\n    };\n    rec();\n  },\n  render: function() {\n    return (\n      <Animated.div\n        style={{\n          left: this.state.anim.interpolate({\n            inputRange: [-1, -0.5, 0.5, 1],\n            outputRange: [0, 5, 0, 5]\n          }),\n          transform: [\n            {rotate: this.state.anim.interpolate({\n              inputRange: [-1, 1],\n              outputRange: ['-10deg', '10deg']\n            })}\n          ]\n        }}\n        className=\"circle\"\n        onClick={this.handleClick}>\n        Click\n      </Animated.div>\n    );\n  },\n}));\n</script><script>example();</script>\n\n<script type=\"text/jsx;harmony=true;stripTypes=true\">\nexamplify(React.createClass({\n  getInitialState: function() {\n    return {\n      anim: new Animated.Value(0)\n    };\n  },\n  render: function() {\n    return (\n      <div\n        style={{overflow: 'scroll', height: 60}}\n        onScroll={Animated.event([\n          {target: {scrollLeft: this.state.anim}}\n        ])}>\n        <div style={{width: 1000, height: 1}} />\n        {[0, 1, 2, 3, 4].map(i =>\n          <Animated.div\n            style={{\n              left: this.state.anim.interpolate({\n                inputRange: [0, 1],\n                outputRange: [0, (i + 1)]\n              }),\n              pointerEvents: 'none',\n            }}\n            className=\"circle\">\n            {i === 4 && 'H-Scroll'}\n          </Animated.div>\n        )}\n      </div>\n    );\n  },\n}));\n</script><script>example();</script>\n\n\n  </div>\n  </body>\n</html>\n"
  },
  {
    "path": "Libraries/Animated/examples/style.css",
    "content": "html, h1, h2 {\n font-family: 'Roboto', sans-serif;\n font-weight: 300;\n}\n\n.container {\n  width: 800px;\n  margin: 0 auto;\n}\n\n.circle {\n  margin: 2px;\n  width: 50px;\n  height: 50px;\n  position: absolute;\n  display: inline-block;\n  box-shadow: 0 1px 2px #999;\n  text-shadow: 0 1px 2px #999;\n  background-image: url(pic1.jpg);\n  background-size: cover;\n  line-height: 80px;\n  vertical-align: bottom;\n  text-align: center;\n  color: white;\n  font-size: 10px;\n}\n\n.circle:nth-child(2) {\n  background-image: url(pic2.jpg);\n}\n\n.circle:nth-child(3) {\n  background-image: url(pic3.jpg);\n}\n\ndiv.code {\n  box-shadow: 0 1px 2px #999;\n  width: 600px;\n  padding: 5px;\n  position: relative;\n  margin: 0 auto;\n  margin-bottom: 40px;\n}\n\ndiv.code .reset {\n  float: right;\n}\n\ndiv.code pre {\n  padding: 2px;\n}\n\nhr {\n  border: none;\n  border-bottom: 1px solid #D9D9D9;\n  margin: 0;\n}\n\nbutton {\n  vertical-align: top;\n}\n\n.example > span {\n  color: #333;\n  font-size: 13px;\n}\n\n.example {\n  position: relative;\n  height: 60px;\n}\n\n.code pre {\n  margin: 0;\n  font-size: 11px;\n  line-height: 1;\n}\n\n.highlight {\n  background: rgb(228, 254, 253);\n}\n"
  },
  {
    "path": "Libraries/Animated/release/gulpfile.js",
    "content": "/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n * @providesModule gulpfile\n */\n\n'use strict';\n\nvar babel = require('gulp-babel');\nvar babelPluginDEV = require('fbjs-scripts/babel/dev-expression');\nvar babelPluginModules = require('fbjs-scripts/babel/rewrite-modules');\nvar del = require('del');\nvar derequire = require('gulp-derequire');\nvar flatten = require('gulp-flatten');\nvar gulp = require('gulp');\nvar gulpUtil = require('gulp-util');\nvar header = require('gulp-header');\nvar objectAssign = require('object-assign');\nvar runSequence = require('run-sequence');\nvar webpackStream = require('webpack-stream');\n\nvar DEVELOPMENT_HEADER = [\n  '/**',\n  ' * Animated v<%= version %>',\n  ' */'\n].join('\\n') + '\\n';\nvar PRODUCTION_HEADER = [\n  '/**',\n  ' * Animated v<%= version %>',\n  ' *',\n  ' * Copyright 2013-2015, Facebook, Inc.',\n  ' * All rights reserved.',\n  ' *',\n  ' * This source code is licensed under the BSD-style license found in the',\n  ' * LICENSE file in the root directory of this source tree. An additional grant',\n  ' * of patent rights can be found in the PATENTS file in the same directory.',\n  ' *',\n  ' */'\n].join('\\n') + '\\n';\n\nvar babelOpts = {\n  nonStandard: true,\n  loose: [\n    'es6.classes'\n  ],\n  stage: 1,\n  plugins: [babelPluginDEV, babelPluginModules],\n  _moduleMap: objectAssign({}, require('fbjs/module-map'), {\n    'React': 'react',\n  })\n};\n\nvar buildDist = function(opts) {\n  var webpackOpts = {\n    debug: opts.debug,\n    externals: {\n      'react': 'React',\n    },\n    module: {\n      loaders: [\n        {test: /\\.js$/, loader: 'babel'}\n      ],\n    },\n    output: {\n      filename: opts.output,\n      library: 'Animated'\n    },\n    plugins: [\n      new webpackStream.webpack.DefinePlugin({\n        'process.env.NODE_ENV': JSON.stringify(\n          opts.debug ? 'development' : 'production'\n        ),\n      }),\n      new webpackStream.webpack.optimize.OccurenceOrderPlugin(),\n      new webpackStream.webpack.optimize.DedupePlugin()\n    ]\n  };\n  if (!opts.debug) {\n    webpackOpts.plugins.push(\n      new webpackStream.webpack.optimize.UglifyJsPlugin({\n        compress: {\n          hoist_vars: true,\n          screw_ie8: true,\n          warnings: false\n        }\n      })\n    );\n  }\n  return webpackStream(webpackOpts, null, function(err, stats) {\n    if (err) {\n      throw new gulpUtil.PluginError('webpack', err);\n    }\n    if (stats.compilation.errors.length) {\n      throw new gulpUtil.PluginError('webpack', stats.toString());\n    }\n  });\n};\n\nvar paths = {\n  dist: 'dist',\n  entry: 'lib/AnimatedWeb.js',\n  lib: 'lib',\n  src: [\n    '*src/**/*.js',\n    '!src/**/__tests__/**/*.js',\n    '!src/**/__mocks__/**/*.js'\n  ],\n};\n\ngulp.task('clean', function(cb) {\n  del([paths.dist, paths.lib], cb);\n});\n\ngulp.task('modules', function() {\n  return gulp\n    .src(paths.src, {cwd: '../'})\n    .pipe(babel(babelOpts))\n    .pipe(flatten())\n    .pipe(gulp.dest(paths.lib));\n});\n\ngulp.task('dist', ['modules'], function () {\n  var distOpts = {\n    debug: true,\n    output: 'animated.js'\n  };\n  return gulp\n    .src(paths.entry)\n    .pipe(buildDist(distOpts))\n    .pipe(derequire())\n    .pipe(header(DEVELOPMENT_HEADER, {\n      version: process.env.npm_package_version\n    }))\n    .pipe(gulp.dest(paths.dist));\n});\n\ngulp.task('dist:min', ['modules'], function () {\n  var distOpts = {\n    debug: false,\n    output: 'animated.min.js'\n  };\n  return gulp\n    .src(paths.entry)\n    .pipe(buildDist(distOpts))\n    .pipe(header(PRODUCTION_HEADER, {\n      version: process.env.npm_package_version\n    }))\n    .pipe(gulp.dest(paths.dist));\n});\n\ngulp.task('watch', function() {\n  gulp.watch(paths.src, ['modules']);\n});\n\ngulp.task('default', function(cb) {\n  runSequence('clean', 'modules', ['dist', 'dist:min'], cb);\n});\n"
  },
  {
    "path": "Libraries/Animated/release/package.json",
    "content": "{\n  \"name\": \"react-animated\",\n  \"description\": \"Animated provides powerful mechanisms for animating your React views\",\n  \"version\": \"0.1.0\",\n  \"keywords\": [\n    \"react\",\n    \"animated\",\n    \"animation\"\n  ],\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"Animated.js\",\n  \"dependencies\": {\n    \"fbjs\": \"^0.2.1\"\n  },\n  \"scripts\": {\n    \"build\": \"gulp\"\n  },\n  \"devDependencies\": {\n    \"babel-core\": \"^5.8.25\",\n    \"babel-loader\": \"^5.3.2\",\n    \"del\": \"^1.2.0\",\n    \"fbjs-scripts\": \"^0.2.0\",\n    \"gulp\": \"^3.9.0\",\n    \"gulp-babel\": \"^5.1.0\",\n    \"gulp-derequire\": \"^2.1.0\",\n    \"gulp-flatten\": \"^0.1.0\",\n    \"gulp-header\": \"^1.2.2\",\n    \"gulp-util\": \"^3.0.6\",\n    \"object-assign\": \"^3.0.0\",\n    \"run-sequence\": \"^1.1.2\",\n    \"webpack\": \"1.11.0\",\n    \"webpack-stream\": \"^2.1.0\"\n  }\n}\n"
  },
  {
    "path": "Libraries/Animated/src/Animated.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Animated\n * @flow\n */\n'use strict';\n\n\nvar AnimatedImplementation = require('AnimatedImplementation');\nvar Image = require('Image');\nvar Text = require('Text');\nvar View = require('View');\n\nlet AnimatedScrollView;\n\nconst Animated = {\n  View: AnimatedImplementation.createAnimatedComponent(View),\n  Text: AnimatedImplementation.createAnimatedComponent(Text),\n  Image: AnimatedImplementation.createAnimatedComponent(Image),\n  get ScrollView() {\n    // Make this lazy to avoid circular reference.\n    if (!AnimatedScrollView) {\n      AnimatedScrollView = AnimatedImplementation.createAnimatedComponent(require('ScrollView'));\n    }\n    return AnimatedScrollView;\n  },\n};\n\nObject.assign((Animated: Object), AnimatedImplementation);\n\nmodule.exports = ((Animated: any): (typeof AnimatedImplementation) & typeof Animated);\n"
  },
  {
    "path": "Libraries/Animated/src/AnimatedEvent.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedEvent\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedValue = require('./nodes/AnimatedValue');\nconst NativeAnimatedHelper = require('./NativeAnimatedHelper');\nconst ReactNative = require('ReactNative');\n\nconst invariant = require('fbjs/lib/invariant');\nconst {shouldUseNativeDriver} = require('./NativeAnimatedHelper');\n\nexport type Mapping = {[key: string]: Mapping} | AnimatedValue;\nexport type EventConfig = {\n  listener?: ?Function,\n  useNativeDriver?: boolean,\n};\n\nfunction attachNativeEvent(\n  viewRef: any,\n  eventName: string,\n  argMapping: Array<?Mapping>,\n) {\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  const viewTag = ReactNative.findNodeHandle(viewRef);\n\n  eventMappings.forEach(mapping => {\n    NativeAnimatedHelper.API.addAnimatedEventToView(\n      viewTag,\n      eventName,\n      mapping,\n    );\n  });\n\n  return {\n    detach() {\n      eventMappings.forEach(mapping => {\n        NativeAnimatedHelper.API.removeAnimatedEventFromView(\n          viewTag,\n          eventName,\n          mapping.animatedValueTag,\n        );\n      });\n    },\n  };\n}\n\nclass AnimatedEvent {\n  _argMapping: Array<?Mapping>;\n  _listeners: Array<Function> = [];\n  _callListeners: Function;\n  _attachedEvent: ?{\n    detach: () => void,\n  };\n  __isNative: boolean;\n\n  constructor(argMapping: Array<?Mapping>, config?: EventConfig = {}) {\n    this._argMapping = argMapping;\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    if (__DEV__) {\n      this._validateMapping();\n    }\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() {\n    if (this.__isNative) {\n      return this._callListeners;\n    }\n\n    return (...args: any) => {\n      const traverse = (recMapping, recEvt, key) => {\n        if (typeof recEvt === 'number' && recMapping instanceof AnimatedValue) {\n          recMapping.setValue(recEvt);\n        } else if (typeof recMapping === 'object') {\n          for (const mappingKey in recMapping) {\n            /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n             * comment suppresses an error when upgrading Flow's support for\n             * React. To see the error delete this comment and run Flow. */\n            traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey);\n          }\n        }\n      };\n\n      if (!this.__isNative) {\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) {\n    this._listeners.forEach(listener => listener(...args));\n  }\n\n  _validateMapping() {\n    const traverse = (recMapping, recEvt, key) => {\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        traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey);\n      }\n    };\n  }\n}\n\nmodule.exports = {AnimatedEvent, attachNativeEvent};\n"
  },
  {
    "path": "Libraries/Animated/src/AnimatedImplementation.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedImplementation\n * @flow\n * @format\n * @preventMunge\n */\n'use strict';\n\nconst {AnimatedEvent, attachNativeEvent} = require('./AnimatedEvent');\nconst AnimatedAddition = require('./nodes/AnimatedAddition');\nconst AnimatedDiffClamp = require('./nodes/AnimatedDiffClamp');\nconst AnimatedDivision = require('./nodes/AnimatedDivision');\nconst AnimatedInterpolation = require('./nodes/AnimatedInterpolation');\nconst AnimatedModulo = require('./nodes/AnimatedModulo');\nconst AnimatedMultiplication = require('./nodes/AnimatedMultiplication');\nconst AnimatedNode = require('./nodes/AnimatedNode');\nconst AnimatedProps = require('./nodes/AnimatedProps');\nconst AnimatedTracking = require('./nodes/AnimatedTracking');\nconst AnimatedValue = require('./nodes/AnimatedValue');\nconst AnimatedValueXY = require('./nodes/AnimatedValueXY');\nconst DecayAnimation = require('./animations/DecayAnimation');\nconst SpringAnimation = require('./animations/SpringAnimation');\nconst TimingAnimation = require('./animations/TimingAnimation');\n\nconst createAnimatedComponent = require('./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\ntype CompositeAnimation = {\n  start: (callback?: ?EndCallback) => void,\n  stop: () => void,\n  reset: () => void,\n  _startNativeLoop: (iterations?: number) => void,\n  _isUsingNativeDriver: () => boolean,\n};\n\nconst add = function(\n  a: AnimatedNode | number,\n  b: AnimatedNode | number,\n): AnimatedAddition {\n  return new AnimatedAddition(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: AnimationConfig,\n) {\n  if (callback && config.onComplete) {\n    return (...args) => {\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,\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  }\n  return null;\n};\n\nconst spring = function(\n  value: AnimatedValue | AnimatedValueXY,\n  config: SpringAnimationConfig,\n): CompositeAnimation {\n  const start = function(\n    animatedValue: AnimatedValue | AnimatedValueXY,\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,\n  config: TimingAnimationConfig,\n): CompositeAnimation {\n  const start = function(\n    animatedValue: AnimatedValue | AnimatedValueXY,\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,\n  config: DecayAnimationConfig,\n): CompositeAnimation {\n  const start = function(\n    animatedValue: AnimatedValue | AnimatedValueXY,\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) {\n        if (!result.finished) {\n          callback && callback(result);\n          return;\n        }\n\n        current++;\n\n        if (current === animations.length) {\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  stopTogether?: boolean, // If one is stopped, stop all.  default: true\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) {\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), {toValue: 0, delay: time, duration: 0});\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 = {iterations: number};\n\nconst loop = function(\n  animation: CompositeAnimation,\n  {iterations = -1}: 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          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(argMapping: Array<?Mapping>, config?: EventConfig): 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/**\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 *\n * See http://facebook.github.io/react-native/docs/animated.html\n */\nmodule.exports = {\n  /**\n   * Standard value class for driving animations.  Typically initialized with\n   * `new Animated.Value(0);`\n   *\n   * See http://facebook.github.io/react-native/docs/animated.html#value\n   */\n  Value: AnimatedValue,\n  /**\n   * 2D value class for driving 2D animations, such as pan gestures.\n   *\n   * See https://facebook.github.io/react-native/releases/next/docs/animatedvaluexy.html\n   */\n  ValueXY: AnimatedValueXY,\n  /**\n   * Exported to use the Interpolation type in flow.\n   *\n   * See http://facebook.github.io/react-native/docs/animated.html#interpolation\n   */\n  Interpolation: AnimatedInterpolation,\n  /**\n   * Exported for ease of type checking. All animated values derive from this\n   * class.\n   *\n   * See http://facebook.github.io/react-native/docs/animated.html#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 http://facebook.github.io/react-native/docs/animated.html#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 http://facebook.github.io/react-native/docs/animated.html#timing\n   */\n  timing,\n  /**\n   * Animates a value according to an analytical spring model based on\n   * damped harmonic oscillation.\n   *\n   * See http://facebook.github.io/react-native/docs/animated.html#spring\n   */\n  spring,\n\n  /**\n   * Creates a new Animated value composed from two Animated values added\n   * together.\n   *\n   * See http://facebook.github.io/react-native/docs/animated.html#add\n   */\n  add,\n\n  /**\n   * Creates a new Animated value composed by dividing the first Animated value\n   * by the second Animated value.\n   *\n   * See http://facebook.github.io/react-native/docs/animated.html#divide\n   */\n  divide,\n\n  /**\n   * Creates a new Animated value composed from two Animated values multiplied\n   * together.\n   *\n   * See http://facebook.github.io/react-native/docs/animated.html#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 http://facebook.github.io/react-native/docs/animated.html#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 http://facebook.github.io/react-native/docs/animated.html#diffclamp\n   */\n  diffClamp,\n\n  /**\n   * Starts an animation after the given delay.\n   *\n   * See http://facebook.github.io/react-native/docs/animated.html#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 http://facebook.github.io/react-native/docs/animated.html#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 http://facebook.github.io/react-native/docs/animated.html#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 http://facebook.github.io/react-native/docs/animated.html#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 http://facebook.github.io/react-native/docs/animated.html#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 http://facebook.github.io/react-native/docs/animated.html#event\n   */\n  event,\n\n  /**\n   * Make any React component Animatable.  Used to create `Animated.View`, etc.\n   *\n   * See http://facebook.github.io/react-native/docs/animated.html#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 http://facebook.github.io/react-native/docs/animated.html#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 http://facebook.github.io/react-native/docs/animated.html#forkevent\n   */\n  forkEvent,\n  unforkEvent,\n\n  __PropsOnlyForTests: AnimatedProps,\n};\n"
  },
  {
    "path": "Libraries/Animated/src/AnimatedWeb.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule AnimatedWeb\n */\n'use strict';\n\nvar AnimatedImplementation = require('AnimatedImplementation');\n\nmodule.exports = {\n  ...AnimatedImplementation,\n  div: AnimatedImplementation.createAnimatedComponent('div'),\n  span: AnimatedImplementation.createAnimatedComponent('span'),\n  img: AnimatedImplementation.createAnimatedComponent('img'),\n};\n"
  },
  {
    "path": "Libraries/Animated/src/Easing.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Easing\n * @flow\n */\n'use strict';\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) {\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) {\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) {\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) {\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) {\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) {\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) {\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) {\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) {\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): (t: number) => number {\n    if (s === undefined) {\n      s = 1.70158;\n    }\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      t -= 1.5 / 2.75;\n      return 7.5625 * t * t + 0.75;\n    }\n\n    if (t < 2.5 / 2.75) {\n      t -= 2.25 / 2.75;\n      return 7.5625 * t * t + 0.9375;\n    }\n\n    t -= 2.625 / 2.75;\n    return 7.5625 * t * t + 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    const _bezier = require('bezier');\n    return _bezier(x1, y1, x2, y2);\n  }\n\n  /**\n   * Runs an easing function forwards.\n   */\n  static in(\n    easing: (t: number) => number,\n  ): (t: number) => number {\n    return easing;\n  }\n\n  /**\n   * Runs an easing function backwards.\n   */\n  static out(\n    easing: (t: number) => number,\n  ): (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(\n    easing: (t: number) => number,\n  ): (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\nmodule.exports = Easing;\n"
  },
  {
    "path": "Libraries/Animated/src/NativeAnimatedHelper.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule NativeAnimatedHelper\n * @flow\n * @format\n */\n'use strict';\n\nconst NativeAnimatedModule = require('NativeModules').NativeAnimatedModule;\nconst NativeEventEmitter = require('NativeEventEmitter');\n\nconst invariant = require('fbjs/lib/invariant');\n\nimport type {AnimationConfig} from './animations/Animation';\nimport type {EventConfig} from './AnimatedEvent';\n\nlet __nativeAnimatedNodeTagCount = 1; /* used for animated nodes */\nlet __nativeAnimationIdCount = 1; /* used for started animations */\n\ntype EndResult = {finished: boolean};\ntype EndCallback = (result: EndResult) => void;\ntype EventMapping = {\n  nativeEventPath: Array<string>,\n  animatedValueTag: ?number,\n};\n\nlet nativeEventEmitter;\n\n/**\n * Simple wrappers around NativeAnimatedModule to provide flow and autocmplete support for\n * the native module methods\n */\nconst API = {\n  createAnimatedNode: function(tag: ?number, config: Object): void {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.createAnimatedNode(tag, config);\n  },\n  startListeningToAnimatedNodeValue: function(tag: ?number) {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.startListeningToAnimatedNodeValue(tag);\n  },\n  stopListeningToAnimatedNodeValue: function(tag: ?number) {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.stopListeningToAnimatedNodeValue(tag);\n  },\n  connectAnimatedNodes: function(parentTag: ?number, childTag: ?number): void {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.connectAnimatedNodes(parentTag, childTag);\n  },\n  disconnectAnimatedNodes: function(\n    parentTag: ?number,\n    childTag: ?number,\n  ): void {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.disconnectAnimatedNodes(parentTag, childTag);\n  },\n  startAnimatingNode: function(\n    animationId: ?number,\n    nodeTag: ?number,\n    config: Object,\n    endCallback: EndCallback,\n  ): void {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.startAnimatingNode(\n      animationId,\n      nodeTag,\n      config,\n      endCallback,\n    );\n  },\n  stopAnimation: function(animationId: ?number) {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.stopAnimation(animationId);\n  },\n  setAnimatedNodeValue: function(nodeTag: ?number, value: ?number): void {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.setAnimatedNodeValue(nodeTag, value);\n  },\n  setAnimatedNodeOffset: function(nodeTag: ?number, offset: ?number): void {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.setAnimatedNodeOffset(nodeTag, offset);\n  },\n  flattenAnimatedNodeOffset: function(nodeTag: ?number): void {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.flattenAnimatedNodeOffset(nodeTag);\n  },\n  extractAnimatedNodeOffset: function(nodeTag: ?number): void {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.extractAnimatedNodeOffset(nodeTag);\n  },\n  connectAnimatedNodeToView: function(\n    nodeTag: ?number,\n    viewTag: ?number,\n  ): void {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.connectAnimatedNodeToView(nodeTag, viewTag);\n  },\n  disconnectAnimatedNodeFromView: function(\n    nodeTag: ?number,\n    viewTag: ?number,\n  ): void {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.disconnectAnimatedNodeFromView(nodeTag, viewTag);\n  },\n  dropAnimatedNode: function(tag: ?number): void {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.dropAnimatedNode(tag);\n  },\n  addAnimatedEventToView: function(\n    viewTag: ?number,\n    eventName: string,\n    eventMapping: EventMapping,\n  ) {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.addAnimatedEventToView(\n      viewTag,\n      eventName,\n      eventMapping,\n    );\n  },\n  removeAnimatedEventFromView(\n    viewTag: ?number,\n    eventName: string,\n    animatedNodeTag: ?number,\n  ) {\n    assertNativeAnimatedModule();\n    NativeAnimatedModule.removeAnimatedEventFromView(\n      viewTag,\n      eventName,\n      animatedNodeTag,\n    );\n  },\n};\n\n/**\n * Styles allowed by the native animated implementation.\n *\n * In general native animated implementation should support any numeric property that doesn't need\n * to be updated through the shadow view hierarchy (all non-layout properties).\n */\nconst STYLES_WHITELIST = {\n  opacity: true,\n  transform: 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 TRANSFORM_WHITELIST = {\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  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  STYLES_WHITELIST[prop] = true;\n}\n\nfunction addWhitelistedTransformProp(prop: string): void {\n  TRANSFORM_WHITELIST[prop] = true;\n}\n\nfunction addWhitelistedInterpolationParam(param: string): void {\n  SUPPORTED_INTERPOLATION_PARAMS[param] = true;\n}\n\nfunction validateTransform(configs: Array<Object>): void {\n  configs.forEach(config => {\n    if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) {\n      throw new Error(\n        `Property '${\n          config.property\n        }' is not supported by native animated module`,\n      );\n    }\n  });\n}\n\nfunction validateStyles(styles: Object): void {\n  for (var key in styles) {\n    if (!STYLES_WHITELIST.hasOwnProperty(key)) {\n      throw new Error(\n        `Style property '${key}' is not supported by native animated module`,\n      );\n    }\n  }\n}\n\nfunction validateInterpolation(config: Object): void {\n  for (var key in config) {\n    if (!SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(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(config: AnimationConfig | EventConfig): boolean {\n  if (config.useNativeDriver && !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          'More info: https://github.com/facebook/react-native/issues/11094#issuecomment-263240420',\n      );\n      _warnedMissingNativeAnimated = true;\n    }\n    return false;\n  }\n\n  return config.useNativeDriver || false;\n}\n\nmodule.exports = {\n  API,\n  addWhitelistedStyleProp,\n  addWhitelistedTransformProp,\n  addWhitelistedInterpolationParam,\n  validateStyles,\n  validateTransform,\n  validateInterpolation,\n  generateNewNodeTag,\n  generateNewAnimationId,\n  assertNativeAnimatedModule,\n  shouldUseNativeDriver,\n  get nativeEventEmitter() {\n    if (!nativeEventEmitter) {\n      nativeEventEmitter = new NativeEventEmitter(NativeAnimatedModule);\n    }\n    return nativeEventEmitter;\n  },\n};\n"
  },
  {
    "path": "Libraries/Animated/src/SpringConfig.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SpringConfig\n * @flow\n */\n\n'use strict';\n\ntype SpringConfigType = {\n  stiffness: number,\n  damping: number,\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)) -\n      (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)) -\n      (0.006 * Math.pow(x, 2)) + 0.36 * x + 2;\n  }\n\n  function b3Friction3(x) {\n    return (0.00000045 * Math.pow(x, 3)) -\n      (0.000332 * Math.pow(x, 2)) + 0.1078 * x + 5.84;\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  var b = normalize(bounciness / 1.7, 0, 20);\n  b = projectNormal(b, 0, 0.8);\n  var s = normalize(speed / 1.7, 0, 20);\n  var bouncyTension = projectNormal(s, 0.5, 200);\n  var 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\nmodule.exports = {\n  fromOrigamiTensionAndFriction,\n  fromBouncinessAndSpeed,\n};\n"
  },
  {
    "path": "Libraries/Animated/src/__tests__/Animated-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nvar Animated = require('Animated');\ndescribe('Animated tests', () => {\n  beforeEach(() => {\n    jest.resetModules();\n  });\n\n  describe('Animated', () => {\n\n    it('works end to end', () => {\n      var anim = new Animated.Value(0);\n\n      var callback = jest.fn();\n\n      var node = new Animated.__PropsOnlyForTests({\n        style: {\n          backgroundColor: 'red',\n          opacity: anim,\n          transform: [\n            {translateX: anim.interpolate({\n              inputRange: [0, 1],\n              outputRange: [100, 200],\n            })},\n            {scale: anim},\n          ],\n          shadowOffset: {\n            width: anim,\n            height: anim,\n          },\n        }\n      }, callback);\n\n      expect(anim.__getChildren().length).toBe(3);\n\n      expect(node.__getValue()).toEqual({\n        style: {\n          backgroundColor: 'red',\n          opacity: 0,\n          transform: [\n            {translateX: 100},\n            {scale: 0},\n          ],\n          shadowOffset: {\n            width: 0,\n            height: 0,\n          },\n        },\n      });\n\n      anim.setValue(0.5);\n\n      expect(callback).toBeCalled();\n\n      expect(node.__getValue()).toEqual({\n        style: {\n          backgroundColor: 'red',\n          opacity: 0.5,\n          transform: [\n            {translateX: 150},\n            {scale: 0.5},\n          ],\n          shadowOffset: {\n            width: 0.5,\n            height: 0.5,\n          },\n        },\n      });\n\n      node.__detach();\n      expect(anim.__getChildren().length).toBe(0);\n\n      anim.setValue(1);\n      expect(callback.mock.calls.length).toBe(1);\n    });\n\n    it('does not detach on updates', () => {\n      var anim = new Animated.Value(0);\n      anim.__detach = jest.fn();\n\n      var c = new Animated.View();\n      c.props = {\n        style: {\n          opacity: anim,\n        },\n      };\n      c.componentWillMount();\n\n      expect(anim.__detach).not.toBeCalled();\n      c._component = {};\n      c.componentWillReceiveProps({\n        style: {\n          opacity: anim,\n        },\n      });\n      expect(anim.__detach).not.toBeCalled();\n\n      c.componentWillUnmount();\n      expect(anim.__detach).toBeCalled();\n    });\n\n\n    it('stops animation when detached', () => {\n      var anim = new Animated.Value(0);\n      var callback = jest.fn();\n\n      var c = new Animated.View();\n      c.props = {\n        style: {\n          opacity: anim,\n        },\n      };\n      c.componentWillMount();\n\n      Animated.timing(anim, {toValue: 10, duration: 1000}).start(callback);\n      c._component = {};\n      c.componentWillUnmount();\n\n      expect(callback).toBeCalledWith({finished: false});\n      expect(callback).toBeCalledWith({finished: false});\n    });\n\n    it('triggers callback when spring is at rest', () => {\n      var anim = new Animated.Value(0);\n      var callback = jest.fn();\n      Animated.spring(anim, {toValue: 0, velocity: 0}).start(callback);\n      expect(callback).toBeCalled();\n    });\n\n    it('send toValue when an underdamped spring stops', () => {\n      var anim = new Animated.Value(0);\n      var listener = jest.fn();\n      anim.addListener(listener);\n      Animated.spring(anim, {toValue: 15}).start();\n      jest.runAllTimers();\n      var lastValue = listener.mock.calls[listener.mock.calls.length - 2][0].value;\n      expect(lastValue).not.toBe(15);\n      expect(lastValue).toBeCloseTo(15);\n      expect(anim.__getValue()).toBe(15);\n    });\n\n    it('send toValue when a critically damped spring stops', () => {\n      var anim = new Animated.Value(0);\n      var listener = jest.fn();\n      anim.addListener(listener);\n      Animated.spring(anim, {stiffness: 8000, damping: 2000, toValue: 15}).start();\n      jest.runAllTimers();\n      var lastValue = listener.mock.calls[listener.mock.calls.length - 2][0].value;\n      expect(lastValue).not.toBe(15);\n      expect(lastValue).toBeCloseTo(15);\n      expect(anim.__getValue()).toBe(15);\n    });\n\n    it('convert to JSON', () => {\n      expect(JSON.stringify(new Animated.Value(10))).toBe('10');\n    });\n  });\n\n\n  describe('Animated Sequence', () => {\n\n    it('works with an empty sequence', () => {\n      var cb = jest.fn();\n      Animated.sequence([]).start(cb);\n      expect(cb).toBeCalledWith({finished: true});\n    });\n\n    it('sequences well', () => {\n      var anim1 = {start: jest.fn()};\n      var anim2 = {start: jest.fn()};\n      var cb = jest.fn();\n\n      var seq = Animated.sequence([anim1, anim2]);\n\n      expect(anim1.start).not.toBeCalled();\n      expect(anim2.start).not.toBeCalled();\n\n      seq.start(cb);\n\n      expect(anim1.start).toBeCalled();\n      expect(anim2.start).not.toBeCalled();\n      expect(cb).not.toBeCalled();\n\n      anim1.start.mock.calls[0][0]({finished: true});\n\n      expect(anim2.start).toBeCalled();\n      expect(cb).not.toBeCalled();\n\n      anim2.start.mock.calls[0][0]({finished: true});\n      expect(cb).toBeCalledWith({finished: true});\n    });\n\n    it('supports interrupting sequence', () => {\n      var anim1 = {start: jest.fn()};\n      var anim2 = {start: jest.fn()};\n      var cb = jest.fn();\n\n      Animated.sequence([anim1, anim2]).start(cb);\n\n      anim1.start.mock.calls[0][0]({finished: false});\n\n      expect(anim1.start).toBeCalled();\n      expect(anim2.start).not.toBeCalled();\n      expect(cb).toBeCalledWith({finished: false});\n    });\n\n    it('supports stopping sequence', () => {\n      var anim1 = {start: jest.fn(), stop: jest.fn()};\n      var anim2 = {start: jest.fn(), stop: jest.fn()};\n      var cb = jest.fn();\n\n      var seq = Animated.sequence([anim1, anim2]);\n      seq.start(cb);\n      seq.stop();\n\n      expect(anim1.stop).toBeCalled();\n      expect(anim2.stop).not.toBeCalled();\n      expect(cb).not.toBeCalled();\n\n      anim1.start.mock.calls[0][0]({finished: false});\n\n      expect(cb).toBeCalledWith({finished: false});\n    });\n  });\n\n  describe('Animated Loop', () => {\n\n    it('loops indefinitely if config not specified', () => {\n      var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false};\n      var cb = jest.fn();\n\n      var loop = Animated.loop(animation);\n\n      expect(animation.start).not.toBeCalled();\n\n      loop.start(cb);\n\n      expect(animation.start).toBeCalled();\n      expect(animation.reset).toHaveBeenCalledTimes(1);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 1\n      expect(animation.reset).toHaveBeenCalledTimes(2);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 2\n      expect(animation.reset).toHaveBeenCalledTimes(3);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 3\n      expect(animation.reset).toHaveBeenCalledTimes(4);\n      expect(cb).not.toBeCalled();\n    });\n\n    it('loops indefinitely if iterations is -1', () => {\n      var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false};\n      var cb = jest.fn();\n\n      var loop = Animated.loop(animation, { iterations: -1 });\n\n      expect(animation.start).not.toBeCalled();\n\n      loop.start(cb);\n\n      expect(animation.start).toBeCalled();\n      expect(animation.reset).toHaveBeenCalledTimes(1);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 1\n      expect(animation.reset).toHaveBeenCalledTimes(2);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 2\n      expect(animation.reset).toHaveBeenCalledTimes(3);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 3\n      expect(animation.reset).toHaveBeenCalledTimes(4);\n      expect(cb).not.toBeCalled();\n    });\n\n    it('loops indefinitely if iterations not specified', () => {\n      var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false};\n      var cb = jest.fn();\n\n      var loop = Animated.loop(animation, { anotherKey: 'value' });\n\n      expect(animation.start).not.toBeCalled();\n\n      loop.start(cb);\n\n      expect(animation.start).toBeCalled();\n      expect(animation.reset).toHaveBeenCalledTimes(1);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 1\n      expect(animation.reset).toHaveBeenCalledTimes(2);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 2\n      expect(animation.reset).toHaveBeenCalledTimes(3);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 3\n      expect(animation.reset).toHaveBeenCalledTimes(4);\n      expect(cb).not.toBeCalled();\n    });\n\n    it('loops three times if iterations is 3', () => {\n      var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false};\n      var cb = jest.fn();\n\n      var loop = Animated.loop(animation, { iterations: 3 });\n\n      expect(animation.start).not.toBeCalled();\n\n      loop.start(cb);\n\n      expect(animation.start).toBeCalled();\n      expect(animation.reset).toHaveBeenCalledTimes(1);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 1\n      expect(animation.reset).toHaveBeenCalledTimes(2);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 2\n      expect(animation.reset).toHaveBeenCalledTimes(3);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 3\n      expect(animation.reset).toHaveBeenCalledTimes(3);\n      expect(cb).toBeCalledWith({finished: true});\n    });\n\n    it('does not loop if iterations is 1', () => {\n      var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false};\n      var cb = jest.fn();\n\n      var loop = Animated.loop(animation, { iterations: 1 });\n\n      expect(animation.start).not.toBeCalled();\n\n      loop.start(cb);\n\n      expect(animation.start).toBeCalled();\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 1\n      expect(cb).toBeCalledWith({finished: true});\n    });\n\n    it('does not animate if iterations is 0', () => {\n      var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false};\n      var cb = jest.fn();\n\n      var loop = Animated.loop(animation, { iterations: 0 });\n\n      expect(animation.start).not.toBeCalled();\n\n      loop.start(cb);\n\n      expect(animation.start).not.toBeCalled();\n      expect(cb).toBeCalledWith({finished: true});\n    });\n\n    it('supports interrupting an indefinite loop', () => {\n      var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false};\n      var cb = jest.fn();\n\n      Animated.loop(animation).start(cb);\n      expect(animation.start).toBeCalled();\n      expect(animation.reset).toHaveBeenCalledTimes(1);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: true}); // End of loop 1\n      expect(animation.reset).toHaveBeenCalledTimes(2);\n      expect(cb).not.toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: false}); // Interrupt loop\n      expect(animation.reset).toHaveBeenCalledTimes(2);\n      expect(cb).toBeCalledWith({finished: false});\n    });\n\n    it('supports stopping loop', () => {\n      var animation = {start: jest.fn(), stop: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false};\n      var cb = jest.fn();\n\n      var loop = Animated.loop(animation);\n      loop.start(cb);\n      loop.stop();\n\n      expect(animation.start).toBeCalled();\n      expect(animation.reset).toHaveBeenCalledTimes(1);\n      expect(animation.stop).toBeCalled();\n\n      animation.start.mock.calls[0][0]({finished: false}); // Interrupt loop\n      expect(animation.reset).toHaveBeenCalledTimes(1);\n      expect(cb).toBeCalledWith({finished: false});\n    });\n  });\n\n  describe('Animated Parallel', () => {\n\n    it('works with an empty parallel', () => {\n      var cb = jest.fn();\n      Animated.parallel([]).start(cb);\n      expect(cb).toBeCalledWith({finished: true});\n    });\n\n    it('works with an empty element in array', () => {\n      var anim1 = {start: jest.fn()};\n      var cb = jest.fn();\n      Animated.parallel([null, anim1]).start(cb);\n\n      expect(anim1.start).toBeCalled();\n      anim1.start.mock.calls[0][0]({finished: true});\n\n      expect(cb).toBeCalledWith({finished: true});\n    });\n\n    it('parellelizes well', () => {\n      var anim1 = {start: jest.fn()};\n      var anim2 = {start: jest.fn()};\n      var cb = jest.fn();\n\n      var par = Animated.parallel([anim1, anim2]);\n\n      expect(anim1.start).not.toBeCalled();\n      expect(anim2.start).not.toBeCalled();\n\n      par.start(cb);\n\n      expect(anim1.start).toBeCalled();\n      expect(anim2.start).toBeCalled();\n      expect(cb).not.toBeCalled();\n\n      anim1.start.mock.calls[0][0]({finished: true});\n      expect(cb).not.toBeCalled();\n\n      anim2.start.mock.calls[0][0]({finished: true});\n      expect(cb).toBeCalledWith({finished: true});\n    });\n\n    it('supports stopping parallel', () => {\n      var anim1 = {start: jest.fn(), stop: jest.fn()};\n      var anim2 = {start: jest.fn(), stop: jest.fn()};\n      var cb = jest.fn();\n\n      var seq = Animated.parallel([anim1, anim2]);\n      seq.start(cb);\n      seq.stop();\n\n      expect(anim1.stop).toBeCalled();\n      expect(anim2.stop).toBeCalled();\n      expect(cb).not.toBeCalled();\n\n      anim1.start.mock.calls[0][0]({finished: false});\n      expect(cb).not.toBeCalled();\n\n      anim2.start.mock.calls[0][0]({finished: false});\n      expect(cb).toBeCalledWith({finished: false});\n    });\n\n\n    it('does not call stop more than once when stopping', () => {\n      var anim1 = {start: jest.fn(), stop: jest.fn()};\n      var anim2 = {start: jest.fn(), stop: jest.fn()};\n      var anim3 = {start: jest.fn(), stop: jest.fn()};\n      var cb = jest.fn();\n\n      var seq = Animated.parallel([anim1, anim2, anim3]);\n      seq.start(cb);\n\n      anim1.start.mock.calls[0][0]({finished: false});\n\n      expect(anim1.stop.mock.calls.length).toBe(0);\n      expect(anim2.stop.mock.calls.length).toBe(1);\n      expect(anim3.stop.mock.calls.length).toBe(1);\n\n      anim2.start.mock.calls[0][0]({finished: false});\n\n      expect(anim1.stop.mock.calls.length).toBe(0);\n      expect(anim2.stop.mock.calls.length).toBe(1);\n      expect(anim3.stop.mock.calls.length).toBe(1);\n\n      anim3.start.mock.calls[0][0]({finished: false});\n\n      expect(anim1.stop.mock.calls.length).toBe(0);\n      expect(anim2.stop.mock.calls.length).toBe(1);\n      expect(anim3.stop.mock.calls.length).toBe(1);\n    });\n  });\n\n  describe('Animated delays', () => {\n    it('should call anim after delay in sequence', () => {\n      var anim = {start: jest.fn(), stop: jest.fn()};\n      var cb = jest.fn();\n      Animated.sequence([\n        Animated.delay(1000),\n        anim,\n      ]).start(cb);\n      jest.runAllTimers();\n      expect(anim.start.mock.calls.length).toBe(1);\n      expect(cb).not.toBeCalled();\n      anim.start.mock.calls[0][0]({finished: true});\n      expect(cb).toBeCalledWith({finished: true});\n    });\n    it('should run stagger to end', () => {\n      var cb = jest.fn();\n      Animated.stagger(1000, [\n        Animated.delay(1000),\n        Animated.delay(1000),\n        Animated.delay(1000),\n      ]).start(cb);\n      jest.runAllTimers();\n      expect(cb).toBeCalledWith({finished: true});\n    });\n  });\n\n  describe('Animated Events', () => {\n    it('should map events', () => {\n      var value = new Animated.Value(0);\n      var handler = Animated.event(\n        [null, {state: {foo: value}}],\n      );\n      handler({bar: 'ignoreBar'}, {state: {baz: 'ignoreBaz', foo: 42}});\n      expect(value.__getValue()).toBe(42);\n    });\n    it('should call listeners', () => {\n      var value = new Animated.Value(0);\n      var listener = jest.fn();\n      var handler = Animated.event(\n        [{foo: value}],\n        {listener},\n      );\n      handler({foo: 42});\n      expect(value.__getValue()).toBe(42);\n      expect(listener.mock.calls.length).toBe(1);\n      expect(listener).toBeCalledWith({foo: 42});\n    });\n    it('should call forked event listeners', () => {\n      var value = new Animated.Value(0);\n      var listener = jest.fn();\n      var handler = Animated.event(\n        [{foo: value}],\n        {listener},\n      );\n      var listener2 = jest.fn();\n      var forkedHandler = Animated.forkEvent(handler, listener2);\n      forkedHandler({foo: 42});\n      expect(value.__getValue()).toBe(42);\n      expect(listener.mock.calls.length).toBe(1);\n      expect(listener).toBeCalledWith({foo: 42});\n      expect(listener2.mock.calls.length).toBe(1);\n      expect(listener2).toBeCalledWith({foo: 42});\n    });\n  });\n\n  describe('Animated Interactions', () => {\n    /*eslint-disable no-shadow*/\n    var Animated;\n    /*eslint-enable*/\n    var InteractionManager;\n\n    beforeEach(() => {\n      jest.mock('InteractionManager');\n      Animated = require('Animated');\n      InteractionManager = require('InteractionManager');\n    });\n\n    afterEach(()=> {\n      jest.unmock('InteractionManager');\n    });\n\n    it('registers an interaction by default', () => {\n      InteractionManager.createInteractionHandle.mockReturnValue(777);\n\n      var value = new Animated.Value(0);\n      var callback = jest.fn();\n      Animated.timing(value, {\n        toValue: 100,\n        duration: 100,\n      }).start(callback);\n      jest.runAllTimers();\n\n      expect(InteractionManager.createInteractionHandle).toBeCalled();\n      expect(InteractionManager.clearInteractionHandle).toBeCalledWith(777);\n      expect(callback).toBeCalledWith({finished: true});\n    });\n\n    it('does not register an interaction when specified', () => {\n      var value = new Animated.Value(0);\n      var callback = jest.fn();\n      Animated.timing(value, {\n        toValue: 100,\n        duration: 100,\n        isInteraction: false,\n      }).start(callback);\n      jest.runAllTimers();\n\n      expect(InteractionManager.createInteractionHandle).not.toBeCalled();\n      expect(InteractionManager.clearInteractionHandle).not.toBeCalled();\n      expect(callback).toBeCalledWith({finished: true});\n    });\n  });\n\n  describe('Animated Tracking', () => {\n    it('should track values', () => {\n      var value1 = new Animated.Value(0);\n      var value2 = new Animated.Value(0);\n      Animated.timing(value2, {\n        toValue: value1,\n        duration: 0,\n      }).start();\n      value1.setValue(42);\n      expect(value2.__getValue()).toBe(42);\n      value1.setValue(7);\n      expect(value2.__getValue()).toBe(7);\n    });\n\n    it('should track interpolated values', () => {\n      var value1 = new Animated.Value(0);\n      var value2 = new Animated.Value(0);\n      Animated.timing(value2, {\n        toValue: value1.interpolate({\n          inputRange: [0, 2],\n          outputRange: [0, 1]\n        }),\n        duration: 0,\n      }).start();\n      value1.setValue(42);\n      expect(value2.__getValue()).toBe(42 / 2);\n    });\n\n    it('should stop tracking when animated', () => {\n      var value1 = new Animated.Value(0);\n      var value2 = new Animated.Value(0);\n      Animated.timing(value2, {\n        toValue: value1,\n        duration: 0,\n      }).start();\n      value1.setValue(42);\n      expect(value2.__getValue()).toBe(42);\n      Animated.timing(value2, {\n        toValue: 7,\n        duration: 0,\n      }).start();\n      value1.setValue(1492);\n      expect(value2.__getValue()).toBe(7);\n    });\n  });\n\n  describe('Animated Vectors', () => {\n    it('should animate vectors', () => {\n      var vec = new Animated.ValueXY();\n\n      var callback = jest.fn();\n\n      var node = new Animated.__PropsOnlyForTests({\n        style: {\n          opacity: vec.x.interpolate({\n            inputRange: [0, 42],\n            outputRange: [0.2, 0.8],\n          }),\n          transform: vec.getTranslateTransform(),\n          ...vec.getLayout(),\n        }\n      }, callback);\n\n      expect(node.__getValue()).toEqual({\n        style: {\n          opacity: 0.2,\n          transform: [\n            {translateX: 0},\n            {translateY: 0},\n          ],\n          left: 0,\n          top: 0,\n        },\n      });\n\n      vec.setValue({x: 42, y: 1492});\n\n      expect(callback.mock.calls.length).toBe(2); // once each for x, y\n\n      expect(node.__getValue()).toEqual({\n        style: {\n          opacity: 0.8,\n          transform: [\n            {translateX: 42},\n            {translateY: 1492},\n          ],\n          left: 42,\n          top: 1492,\n        },\n      });\n\n      node.__detach();\n\n      vec.setValue({x: 1, y: 1});\n      expect(callback.mock.calls.length).toBe(2);\n    });\n\n    it('should track vectors', () => {\n      var value1 = new Animated.ValueXY();\n      var value2 = new Animated.ValueXY();\n      Animated.timing(value2, {\n        toValue: value1,\n        duration: 0,\n      }).start();\n      value1.setValue({x: 42, y: 1492});\n      expect(value2.__getValue()).toEqual({x: 42, y: 1492});\n\n      // Make sure tracking keeps working (see stopTogether in ParallelConfig used\n      // by maybeVectorAnim).\n      value1.setValue({x: 3, y: 4});\n      expect(value2.__getValue()).toEqual({x: 3, y: 4});\n    });\n\n    it('should track with springs', () => {\n      var value1 = new Animated.ValueXY();\n      var value2 = new Animated.ValueXY();\n      Animated.spring(value2, {\n        toValue: value1,\n        tension: 3000, // faster spring for faster test\n        friction: 60,\n      }).start();\n      value1.setValue({x: 1, y: 1});\n      jest.runAllTimers();\n      expect(Math.round(value2.__getValue().x)).toEqual(1);\n      expect(Math.round(value2.__getValue().y)).toEqual(1);\n      value1.setValue({x: 2, y: 2});\n      jest.runAllTimers();\n      expect(Math.round(value2.__getValue().x)).toEqual(2);\n      expect(Math.round(value2.__getValue().y)).toEqual(2);\n    });\n  });\n\n  describe('Animated Listeners', () => {\n    it('should get updates', () => {\n      var value1 = new Animated.Value(0);\n      var listener = jest.fn();\n      var id = value1.addListener(listener);\n      value1.setValue(42);\n      expect(listener.mock.calls.length).toBe(1);\n      expect(listener).toBeCalledWith({value: 42});\n      expect(value1.__getValue()).toBe(42);\n      value1.setValue(7);\n      expect(listener.mock.calls.length).toBe(2);\n      expect(listener).toBeCalledWith({value: 7});\n      expect(value1.__getValue()).toBe(7);\n      value1.removeListener(id);\n      value1.setValue(1492);\n      expect(listener.mock.calls.length).toBe(2);\n      expect(value1.__getValue()).toBe(1492);\n    });\n\n    it('should removeAll', () => {\n      var value1 = new Animated.Value(0);\n      var listener = jest.fn();\n      [1,2,3,4].forEach(() => value1.addListener(listener));\n      value1.setValue(42);\n      expect(listener.mock.calls.length).toBe(4);\n      expect(listener).toBeCalledWith({value: 42});\n      value1.removeAllListeners();\n      value1.setValue(7);\n      expect(listener.mock.calls.length).toBe(4);\n    });\n  });\n\n  describe('Animated Diff Clamp', () => {\n    it('should get the proper value', () => {\n      const inputValues = [0, 20, 40, 30, 0, -40, -10, -20, 0];\n      const expectedValues = [0, 20, 20, 10, 0, 0, 20, 10, 20];\n      const value = new Animated.Value(0);\n      const diffClampValue = Animated.diffClamp(value, 0, 20);\n      for (let i = 0; i < inputValues.length; i++) {\n        value.setValue(inputValues[i]);\n        expect(diffClampValue.__getValue()).toBe(expectedValues[i]);\n      }\n    });\n  });\n});\n"
  },
  {
    "path": "Libraries/Animated/src/__tests__/AnimatedNative-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\njest\n  .clearAllMocks()\n  .setMock('Text', {})\n  .setMock('View', {})\n  .setMock('Image', {})\n  .setMock('React', {Component: class {}})\n  .setMock('NativeModules', {\n    NativeAnimatedModule: {},\n  })\n  .mock('NativeEventEmitter')\n  // findNodeHandle is imported from ReactNative so mock that whole module.\n  .setMock('ReactNative', {findNodeHandle: () => 1});\n\nconst Animated = require('Animated');\nconst NativeAnimatedHelper = require('NativeAnimatedHelper');\n\nfunction createAndMountComponent(ComponentClass, props) {\n  const component = new ComponentClass();\n  component.props = props;\n  component.componentWillMount();\n  // Simulate that refs were set.\n  component._component = {};\n  component.componentDidMount();\n  return component;\n}\n\ndescribe('Native Animated', () => {\n\n  const nativeAnimatedModule = require('NativeModules').NativeAnimatedModule;\n\n  beforeEach(() => {\n    nativeAnimatedModule.addAnimatedEventToView = jest.fn();\n    nativeAnimatedModule.connectAnimatedNodes = jest.fn();\n    nativeAnimatedModule.connectAnimatedNodeToView = jest.fn();\n    nativeAnimatedModule.createAnimatedNode = jest.fn();\n    nativeAnimatedModule.disconnectAnimatedNodeFromView = jest.fn();\n    nativeAnimatedModule.disconnectAnimatedNodes = jest.fn();\n    nativeAnimatedModule.dropAnimatedNode = jest.fn();\n    nativeAnimatedModule.extractAnimatedNodeOffset = jest.fn();\n    nativeAnimatedModule.flattenAnimatedNodeOffset = jest.fn();\n    nativeAnimatedModule.removeAnimatedEventFromView = jest.fn();\n    nativeAnimatedModule.setAnimatedNodeOffset = jest.fn();\n    nativeAnimatedModule.setAnimatedNodeValue = jest.fn();\n    nativeAnimatedModule.startAnimatingNode = jest.fn();\n    nativeAnimatedModule.startListeningToAnimatedNodeValue = jest.fn();\n    nativeAnimatedModule.stopAnimation = jest.fn();\n    nativeAnimatedModule.stopListeningToAnimatedNodeValue = jest.fn();\n  });\n\n  describe('Animated Value', () => {\n    it('proxies `setValue` correctly', () => {\n      const anim = new Animated.Value(0);\n      Animated.timing(anim, {toValue: 10, duration: 1000, useNativeDriver: true}).start();\n\n      const c = createAndMountComponent(Animated.View, {\n        style: {\n          opacity: anim,\n        },\n      });\n\n      // We expect `setValue` not to propagate down to `setNativeProps`, otherwise it may try to access `setNativeProps`\n      // via component refs table that we override here.\n      c.refs = {\n        node: {\n          setNativeProps: jest.genMockFunction(),\n        },\n      };\n\n      anim.setValue(0.5);\n\n      expect(nativeAnimatedModule.setAnimatedNodeValue).toBeCalledWith(expect.any(Number), 0.5);\n      expect(c.refs.node.setNativeProps).not.toHaveBeenCalled();\n    });\n\n    it('should set offset', () => {\n      const anim = new Animated.Value(0);\n      anim.setOffset(10);\n      anim.__makeNative();\n      createAndMountComponent(Animated.View, {\n        style: {\n          opacity: anim,\n        },\n      });\n\n      expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith(\n        expect.any(Number),\n        {type: 'value', value: 0, offset: 10},\n      );\n      anim.setOffset(20);\n      expect(nativeAnimatedModule.setAnimatedNodeOffset)\n        .toBeCalledWith(expect.any(Number), 20);\n    });\n\n    it('should flatten offset', () => {\n      const anim = new Animated.Value(0);\n      anim.__makeNative();\n      createAndMountComponent(Animated.View, {\n        style: {\n          opacity: anim,\n        },\n      });\n\n      expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith(\n        expect.any(Number),\n        {type: 'value', value: 0, offset: 0},\n      );\n      anim.flattenOffset();\n      expect(nativeAnimatedModule.flattenAnimatedNodeOffset)\n        .toBeCalledWith(expect.any(Number));\n    });\n\n    it('should extract offset', () => {\n      const anim = new Animated.Value(0);\n      anim.__makeNative();\n      createAndMountComponent(Animated.View, {\n        style: {\n          opacity: anim,\n        },\n      });\n\n      expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith(\n        expect.any(Number),\n        {type: 'value', value: 0, offset: 0},\n      );\n      anim.extractOffset();\n      expect(nativeAnimatedModule.extractAnimatedNodeOffset)\n        .toBeCalledWith(expect.any(Number));\n    });\n  });\n\n  describe('Animated Listeners', () => {\n    it('should get updates', () => {\n      const value1 = new Animated.Value(0);\n      value1.__makeNative();\n      const listener = jest.fn();\n      const id = value1.addListener(listener);\n      expect(nativeAnimatedModule.startListeningToAnimatedNodeValue)\n        .toHaveBeenCalledWith(value1.__getNativeTag());\n\n      NativeAnimatedHelper.nativeEventEmitter.emit(\n        'onAnimatedValueUpdate',\n        {value: 42, tag: value1.__getNativeTag()},\n      );\n      expect(listener).toHaveBeenCalledTimes(1);\n      expect(listener).toBeCalledWith({value: 42});\n      expect(value1.__getValue()).toBe(42);\n\n      NativeAnimatedHelper.nativeEventEmitter.emit(\n        'onAnimatedValueUpdate',\n        {value: 7, tag: value1.__getNativeTag()},\n      );\n      expect(listener).toHaveBeenCalledTimes(2);\n      expect(listener).toBeCalledWith({value: 7});\n      expect(value1.__getValue()).toBe(7);\n\n      value1.removeListener(id);\n      expect(nativeAnimatedModule.stopListeningToAnimatedNodeValue)\n        .toHaveBeenCalledWith(value1.__getNativeTag());\n\n      NativeAnimatedHelper.nativeEventEmitter.emit(\n        'onAnimatedValueUpdate',\n        {value: 1492, tag: value1.__getNativeTag()},\n      );\n      expect(listener).toHaveBeenCalledTimes(2);\n      expect(value1.__getValue()).toBe(7);\n    });\n\n    it('should removeAll', () => {\n      const value1 = new Animated.Value(0);\n      value1.__makeNative();\n      const listener = jest.fn();\n      [1,2,3,4].forEach(() => value1.addListener(listener));\n      expect(nativeAnimatedModule.startListeningToAnimatedNodeValue)\n        .toHaveBeenCalledWith(value1.__getNativeTag());\n\n      NativeAnimatedHelper.nativeEventEmitter.emit(\n        'onAnimatedValueUpdate',\n        {value: 42, tag: value1.__getNativeTag()},\n      );\n      expect(listener).toHaveBeenCalledTimes(4);\n      expect(listener).toBeCalledWith({value: 42});\n\n      value1.removeAllListeners();\n      expect(nativeAnimatedModule.stopListeningToAnimatedNodeValue)\n        .toHaveBeenCalledWith(value1.__getNativeTag());\n\n      NativeAnimatedHelper.nativeEventEmitter.emit(\n        'onAnimatedValueUpdate',\n        {value: 7, tag: value1.__getNativeTag()},\n      );\n      expect(listener).toHaveBeenCalledTimes(4);\n    });\n  });\n\n  describe('Animated Events', () => {\n    it('should map events', () => {\n      const value = new Animated.Value(0);\n      value.__makeNative();\n      const event = Animated.event(\n        [{nativeEvent: {state: {foo: value}}}],\n        {useNativeDriver: true},\n      );\n      const c = createAndMountComponent(Animated.View, {onTouchMove: event});\n      expect(nativeAnimatedModule.addAnimatedEventToView).toBeCalledWith(\n        expect.any(Number),\n        'onTouchMove',\n        {nativeEventPath: ['state', 'foo'], animatedValueTag: value.__getNativeTag()},\n      );\n\n      c.componentWillUnmount();\n      expect(nativeAnimatedModule.removeAnimatedEventFromView).toBeCalledWith(\n        expect.any(Number),\n        'onTouchMove',\n        value.__getNativeTag(),\n      );\n    });\n\n    it('should throw on invalid event path', () => {\n      const value = new Animated.Value(0);\n      value.__makeNative();\n      const event = Animated.event(\n        [{notNativeEvent: {foo: value}}],\n        {useNativeDriver: true},\n      );\n      expect(() => createAndMountComponent(Animated.View, {onTouchMove: event}))\n        .toThrowError(/nativeEvent/);\n      expect(nativeAnimatedModule.addAnimatedEventToView).not.toBeCalled();\n    });\n\n    it('should call listeners', () => {\n      const value = new Animated.Value(0);\n      value.__makeNative();\n      const listener = jest.fn();\n      const event = Animated.event(\n        [{nativeEvent: {foo: value}}],\n        {useNativeDriver: true, listener},\n      );\n      const handler = event.__getHandler();\n      handler({foo: 42});\n      expect(listener).toHaveBeenCalledTimes(1);\n      expect(listener).toBeCalledWith({foo: 42});\n    });\n  });\n\n  describe('Animated Graph', () => {\n    it('creates and detaches nodes', () => {\n      const anim = new Animated.Value(0);\n      const c = createAndMountComponent(Animated.View, {\n        style: {\n          opacity: anim,\n        },\n      });\n\n      Animated.timing(anim, {toValue: 10, duration: 1000, useNativeDriver: true}).start();\n\n      c.componentWillUnmount();\n\n      expect(nativeAnimatedModule.createAnimatedNode).toHaveBeenCalledTimes(3);\n      expect(nativeAnimatedModule.connectAnimatedNodes).toHaveBeenCalledTimes(2);\n\n      expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith(\n        expect.any(Number),\n        expect.any(Number),\n        {type: 'frames', frames: expect.any(Array), toValue: expect.any(Number), iterations: 1},\n        expect.any(Function)\n      );\n\n      expect(nativeAnimatedModule.disconnectAnimatedNodes).toHaveBeenCalledTimes(2);\n      expect(nativeAnimatedModule.dropAnimatedNode).toHaveBeenCalledTimes(3);\n    });\n\n    it('sends a valid description for value, style and props nodes', () => {\n      const anim = new Animated.Value(0);\n      createAndMountComponent(Animated.View, {\n        style: {\n          opacity: anim,\n        },\n      });\n\n      Animated.timing(anim, {toValue: 10, duration: 1000, useNativeDriver: true}).start();\n\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(expect.any(Number), {type: 'value', value: 0, offset: 0});\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(expect.any(Number), {type: 'style', style: {opacity: expect.any(Number)}});\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(expect.any(Number), {type: 'props', props: {style: expect.any(Number)}});\n    });\n\n    it('sends a valid graph description for Animated.add nodes', () => {\n      const first = new Animated.Value(1);\n      const second = new Animated.Value(2);\n      first.__makeNative();\n      second.__makeNative();\n\n      createAndMountComponent(Animated.View, {\n        style: {\n          opacity: Animated.add(first, second),\n        },\n      });\n\n      expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith(\n        expect.any(Number),\n        {type: 'addition', input: expect.any(Array)},\n      );\n      const additionCalls = nativeAnimatedModule.createAnimatedNode.mock.calls.filter(\n        (call) => call[1].type === 'addition'\n      );\n      expect(additionCalls.length).toBe(1);\n      const additionCall = additionCalls[0];\n      const additionNodeTag = additionCall[0];\n      const additionConnectionCalls = nativeAnimatedModule.connectAnimatedNodes.mock.calls.filter(\n        (call) => call[1] === additionNodeTag\n      );\n      expect(additionConnectionCalls.length).toBe(2);\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(additionCall[1].input[0], {type: 'value', value: 1, offset: 0});\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(additionCall[1].input[1], {type: 'value', value: 2, offset: 0});\n    });\n\n    it('sends a valid graph description for Animated.multiply nodes', () => {\n      const first = new Animated.Value(2);\n      const second = new Animated.Value(1);\n      first.__makeNative();\n      second.__makeNative();\n\n      createAndMountComponent(Animated.View, {\n        style: {\n          opacity: Animated.multiply(first, second),\n        },\n      });\n\n      expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith(\n        expect.any(Number),\n        {type: 'multiplication', input: expect.any(Array)},\n      );\n      const multiplicationCalls = nativeAnimatedModule.createAnimatedNode.mock.calls.filter(\n        (call) => call[1].type === 'multiplication'\n      );\n      expect(multiplicationCalls.length).toBe(1);\n      const multiplicationCall = multiplicationCalls[0];\n      const multiplicationNodeTag = multiplicationCall[0];\n      const multiplicationConnectionCalls = nativeAnimatedModule.connectAnimatedNodes.mock.calls.filter(\n        (call) => call[1] === multiplicationNodeTag\n      );\n      expect(multiplicationConnectionCalls.length).toBe(2);\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(multiplicationCall[1].input[0], {type: 'value', value: 2, offset: 0});\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(multiplicationCall[1].input[1], {type: 'value', value: 1, offset: 0});\n    });\n\n    it('sends a valid graph description for Animated.divide nodes', () => {\n      const first = new Animated.Value(4);\n      const second = new Animated.Value(2);\n      first.__makeNative();\n      second.__makeNative();\n\n      createAndMountComponent(Animated.View, {\n        style: {\n          opacity: Animated.divide(first, second),\n        },\n      });\n\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(expect.any(Number), {type: 'division', input: expect.any(Array)});\n      const divisionCalls = nativeAnimatedModule.createAnimatedNode.mock.calls.filter(\n        (call) => call[1].type === 'division'\n      );\n      expect(divisionCalls.length).toBe(1);\n      const divisionCall = divisionCalls[0];\n      const divisionNodeTag = divisionCall[0];\n      const divisionConnectionCalls = nativeAnimatedModule.connectAnimatedNodes.mock.calls.filter(\n        (call) => call[1] === divisionNodeTag\n      );\n      expect(divisionConnectionCalls.length).toBe(2);\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(divisionCall[1].input[0], {type: 'value', value: 4, offset: 0});\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(divisionCall[1].input[1], {type: 'value', value: 2, offset: 0});\n    });\n\n    it('sends a valid graph description for Animated.modulo nodes', () => {\n      const value = new Animated.Value(4);\n      value.__makeNative();\n\n      createAndMountComponent(Animated.View, {\n        style: {\n          opacity: Animated.modulo(value, 4),\n        },\n      });\n\n      expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith(\n        expect.any(Number),\n        {type: 'modulus', modulus: 4, input: expect.any(Number)},\n      );\n      const moduloCalls = nativeAnimatedModule.createAnimatedNode.mock.calls.filter(\n        (call) => call[1].type === 'modulus'\n      );\n      expect(moduloCalls.length).toBe(1);\n      const moduloCall = moduloCalls[0];\n      const moduloNodeTag = moduloCall[0];\n      const moduloConnectionCalls = nativeAnimatedModule.connectAnimatedNodes.mock.calls.filter(\n        (call) => call[1] === moduloNodeTag\n      );\n      expect(moduloConnectionCalls.length).toBe(1);\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(moduloCall[1].input, {type: 'value', value: 4, offset: 0});\n    });\n\n    it('sends a valid graph description for interpolate() nodes', () => {\n      const value = new Animated.Value(10);\n      value.__makeNative();\n\n      createAndMountComponent(Animated.View, {\n        style: {\n          opacity: value.interpolate({\n            inputRange: [10, 20],\n            outputRange: [0, 1],\n          }),\n        },\n      });\n\n      expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith(\n        expect.any(Number),\n        {type: 'value', value: 10, offset: 0}\n      );\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(expect.any(Number), {\n          type: 'interpolation',\n          inputRange: [10, 20],\n          outputRange: [0, 1],\n          extrapolateLeft: 'extend',\n          extrapolateRight: 'extend',\n        });\n      const interpolationNodeTag = nativeAnimatedModule.createAnimatedNode.mock.calls.find(\n        (call) => call[1].type === 'interpolation'\n      )[0];\n      const valueNodeTag = nativeAnimatedModule.createAnimatedNode.mock.calls.find(\n        (call) => call[1].type === 'value'\n      )[0];\n      expect(nativeAnimatedModule.connectAnimatedNodes).toBeCalledWith(valueNodeTag, interpolationNodeTag);\n    });\n\n    it('sends a valid graph description for transform nodes', () => {\n      const value = new Animated.Value(0);\n      value.__makeNative();\n\n      createAndMountComponent(Animated.View, {\n        style: {\n          transform: [{translateX: value}, {scale: 2}],\n        },\n      });\n\n      expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith(\n        expect.any(Number),\n        {\n          type: 'transform',\n          transforms: [{\n            nodeTag: expect.any(Number),\n            property: 'translateX',\n            type: 'animated',\n          }, {\n            value: 2,\n            property: 'scale',\n            type: 'static',\n          }],\n        },\n      );\n    });\n\n    it('sends a valid graph description for Animated.diffClamp nodes', () => {\n      const value = new Animated.Value(2);\n      value.__makeNative();\n\n      createAndMountComponent(Animated.View, {\n        style: {\n          opacity: Animated.diffClamp(value, 0, 20),\n        },\n      });\n\n      expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith(\n        expect.any(Number),\n        {type: 'diffclamp', input: expect.any(Number), max: 20, min: 0},\n      );\n      const diffClampCalls = nativeAnimatedModule.createAnimatedNode.mock.calls.filter(\n        (call) => call[1].type === 'diffclamp'\n      );\n      expect(diffClampCalls.length).toBe(1);\n      const diffClampCall = diffClampCalls[0];\n      const diffClampNodeTag = diffClampCall[0];\n      const diffClampConnectionCalls = nativeAnimatedModule.connectAnimatedNodes.mock.calls.filter(\n        (call) => call[1] === diffClampNodeTag\n      );\n      expect(diffClampConnectionCalls.length).toBe(1);\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(diffClampCall[1].input, {type: 'value', value: 2, offset: 0});\n    });\n\n    it('doesn\\'t call into native API if useNativeDriver is set to false', () => {\n      const anim = new Animated.Value(0);\n\n      const c = createAndMountComponent(Animated.View, {\n        style: {\n          opacity: anim,\n        },\n      });\n\n      Animated.timing(anim, {toValue: 10, duration: 1000, useNativeDriver: false}).start();\n\n      c.componentWillUnmount();\n\n      expect(nativeAnimatedModule.createAnimatedNode).not.toBeCalled();\n    });\n\n    it('fails when trying to run non-native animation on native node', () => {\n      const anim = new Animated.Value(0);\n\n      createAndMountComponent(Animated.View, {\n        style: {\n          opacity: anim,\n        },\n      });\n\n      Animated.timing(anim, {toValue: 10, duration: 50, useNativeDriver: true}).start();\n      jest.runAllTimers();\n\n      Animated.timing(anim, {toValue: 4, duration: 500, useNativeDriver: false}).start();\n      expect(jest.runAllTimers).toThrow();\n    });\n\n    it('fails for unsupported styles', () => {\n      const anim = new Animated.Value(0);\n\n      createAndMountComponent(Animated.View, {\n        style: {\n          left: anim,\n        },\n      });\n\n      const animation = Animated.timing(anim, {toValue: 10, duration: 50, useNativeDriver: true});\n      expect(animation.start).toThrowError(/left/);\n    });\n\n    it('works for any `static` props and styles', () => {\n      // Passing \"unsupported\" props should work just fine as long as they are not animated\n      const value = new Animated.Value(0);\n      value.__makeNative();\n\n      createAndMountComponent(Animated.View, {\n        style: {\n          left: 10,\n          top: 20,\n          opacity: value,\n        },\n        removeClippedSubviews: true,\n      });\n\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(expect.any(Number), { type: 'style', style: { opacity: expect.any(Number) }});\n      expect(nativeAnimatedModule.createAnimatedNode)\n        .toBeCalledWith(expect.any(Number), { type: 'props', props: { style: expect.any(Number) }});\n    });\n  });\n\n  describe('Animations', () => {\n    it('sends a valid timing animation description', () => {\n      const anim = new Animated.Value(0);\n      Animated.timing(anim, {toValue: 10, duration: 1000, useNativeDriver: true}).start();\n\n      expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith(\n        expect.any(Number),\n        expect.any(Number),\n        {type: 'frames', frames: expect.any(Array), toValue: expect.any(Number), iterations: 1},\n        expect.any(Function)\n      );\n    });\n\n    it('sends a valid spring animation description', () => {\n      const anim = new Animated.Value(0);\n      Animated.spring(anim, {toValue: 10, friction: 5, tension: 164, useNativeDriver: true}).start();\n      expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith(\n        expect.any(Number),\n        expect.any(Number),\n        {\n          type: 'spring',\n          stiffness: 679.08,\n          damping: 16,\n          mass: 1,\n          initialVelocity: 0,\n          overshootClamping: false,\n          restDisplacementThreshold: 0.001,\n          restSpeedThreshold: 0.001,\n          toValue: 10,\n          iterations: 1,\n        },\n        expect.any(Function)\n      );\n\n      Animated.spring(anim, {\n        toValue: 10,\n        stiffness: 1000,\n        damping: 500,\n        mass: 3,\n        useNativeDriver: true\n      }).start();\n      expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith(\n        expect.any(Number),\n        expect.any(Number),\n        {\n          type: 'spring',\n          stiffness: 1000,\n          damping: 500,\n          mass: 3,\n          initialVelocity: 0,\n          overshootClamping: false,\n          restDisplacementThreshold: 0.001,\n          restSpeedThreshold: 0.001,\n          toValue: 10,\n          iterations: 1,\n        },\n        expect.any(Function)\n      );\n\n      Animated.spring(anim, {toValue: 10, bounciness: 8, speed: 10, useNativeDriver: true}).start();\n      expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith(\n        expect.any(Number),\n        expect.any(Number),\n        {\n          type: 'spring',\n          damping: 23.05223140901191,\n          initialVelocity: 0,\n          overshootClamping: false,\n          restDisplacementThreshold: 0.001,\n          restSpeedThreshold: 0.001,\n          stiffness: 299.61882352941177,\n          mass: 1,\n          toValue: 10,\n          iterations: 1,\n        },\n        expect.any(Function)\n      );\n    });\n\n    it('sends a valid decay animation description', () => {\n      const anim = new Animated.Value(0);\n      Animated.decay(anim, {velocity: 10, deceleration: 0.1, useNativeDriver: true}).start();\n\n      expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith(\n        expect.any(Number),\n        expect.any(Number),\n        {type: 'decay', deceleration: 0.1, velocity: 10, iterations: 1},\n        expect.any(Function)\n      );\n    });\n\n    it('works with Animated.loop', () => {\n      const anim = new Animated.Value(0);\n      Animated.loop(\n        Animated.decay(anim, {velocity: 10, deceleration: 0.1, useNativeDriver: true}),\n        { iterations: 10 },\n      ).start();\n\n      expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith(\n        expect.any(Number),\n        expect.any(Number),\n        {type: 'decay', deceleration: 0.1, velocity: 10, iterations: 10},\n        expect.any(Function)\n      );\n    });\n\n    it('sends stopAnimation command to native', () => {\n      const value = new Animated.Value(0);\n      const animation = Animated.timing(value, {toValue: 10, duration: 50, useNativeDriver: true});\n\n      animation.start();\n      expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith(\n        expect.any(Number),\n        expect.any(Number),\n        {type: 'frames', frames: expect.any(Array), toValue: expect.any(Number), iterations: 1},\n        expect.any(Function)\n      );\n      const animationId = nativeAnimatedModule.startAnimatingNode.mock.calls[0][0];\n\n      animation.stop();\n      expect(nativeAnimatedModule.stopAnimation).toBeCalledWith(animationId);\n    });\n  });\n});\n"
  },
  {
    "path": "Libraries/Animated/src/__tests__/Easing-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nvar Easing = require('Easing');\ndescribe('Easing', () => {\n  it('should work with linear', () => {\n    var easing = Easing.linear;\n\n    expect(easing(0)).toBe(0);\n    expect(easing(0.5)).toBe(0.5);\n    expect(easing(0.8)).toBe(0.8);\n    expect(easing(1)).toBe(1);\n  });\n\n  it('should work with ease in linear', () => {\n    var easing = Easing.in(Easing.linear);\n    expect(easing(0)).toBe(0);\n    expect(easing(0.5)).toBe(0.5);\n    expect(easing(0.8)).toBe(0.8);\n    expect(easing(1)).toBe(1);\n  });\n\n  it('should work with easy out linear', () => {\n    var easing = Easing.out(Easing.linear);\n    expect(easing(0)).toBe(0);\n    expect(easing(0.5)).toBe(0.5);\n    expect(easing(0.6)).toBe(0.6);\n    expect(easing(1)).toBe(1);\n  });\n\n  it('should work with ease in quad', () => {\n    function easeInQuad(t) {\n      return t * t;\n    }\n    var easing = Easing.in(Easing.quad);\n    for (var t = -0.5; t < 1.5; t += 0.1) {\n      expect(easing(t)).toBe(easeInQuad(t));\n    }\n  });\n\n  it('should work with ease out quad', () => {\n    function easeOutQuad(t) {\n      return -t * (t - 2);\n    }\n    var easing = Easing.out(Easing.quad);\n    for (var t = 0; t <= 1; t += 0.1) {\n      expect(easing(1)).toBe(easeOutQuad(1));\n    }\n  });\n\n  it('should work with ease in-out quad', () => {\n    function easeInOutQuad(t) {\n      t = t * 2;\n      if (t < 1) {\n        return 0.5 * t * t;\n      }\n      return -((t - 1) * (t - 3) - 1) / 2;\n    }\n    var easing = Easing.inOut(Easing.quad);\n    for (var t = -0.5; t < 1.5; t += 0.1) {\n      expect(easing(t)).toBeCloseTo(easeInOutQuad(t), 4);\n    }\n  });\n\n  it('should satisfy boundary conditions with elastic', () => {\n    for (var b = 0; b < 4; b += 0.3) {\n      var easing = Easing.elastic(b);\n      expect(easing(0)).toBe(0);\n      expect(easing(1)).toBe(1);\n    }\n  });\n\n  function sampleEasingFunction(easing) {\n    var DURATION = 300;\n    var tickCount = Math.round(DURATION * 60 / 1000);\n    var samples = [];\n    for (var i = 0; i <= tickCount; i++) {\n      samples.push(easing(i / tickCount));\n    }\n    return samples;\n  }\n\n  var Samples = {\n    in_quad: [0,0.0030864197530864196,0.012345679012345678,0.027777777777777776,0.04938271604938271,0.0771604938271605,0.1111111111111111,0.15123456790123457,0.19753086419753085,0.25,0.308641975308642,0.37345679012345684,0.4444444444444444,0.5216049382716049,0.6049382716049383,0.6944444444444445,0.7901234567901234,0.8919753086419753,1],\n    out_quad: [0,0.10802469135802469,0.20987654320987653,0.3055555555555555,0.3950617283950617,0.47839506172839513,0.5555555555555556,0.6265432098765432,0.691358024691358,0.75,0.8024691358024691,0.8487654320987654,0.888888888888889,0.9228395061728394,0.9506172839506174,0.9722222222222221,0.9876543209876543,0.9969135802469136,1],\n    inOut_quad: [0,0.006172839506172839,0.024691358024691357,0.05555555555555555,0.09876543209876543,0.154320987654321,0.2222222222222222,0.30246913580246915,0.3950617283950617,0.5,0.6049382716049383,0.697530864197531,0.7777777777777777,0.845679012345679,0.9012345679012346,0.9444444444444444,0.9753086419753086,0.9938271604938271,1],\n    in_cubic: [0,0.00017146776406035664,0.0013717421124828531,0.004629629629629629,0.010973936899862825,0.021433470507544586,0.037037037037037035,0.05881344307270234,0.0877914951989026,0.125,0.1714677640603567,0.22822359396433475,0.2962962962962963,0.37671467764060357,0.4705075445816187,0.5787037037037038,0.7023319615912208,0.8424211248285322,1],\n    out_cubic: [0,0.15757887517146785,0.2976680384087792,0.42129629629629617,0.5294924554183813,0.6232853223593964,0.7037037037037036,0.7717764060356652,0.8285322359396433,0.875,0.9122085048010974,0.9411865569272977,0.9629629629629629,0.9785665294924554,0.9890260631001372,0.9953703703703703,0.9986282578875172,0.9998285322359396,1],\n    inOut_cubic: [0,0.0006858710562414266,0.0054869684499314125,0.018518518518518517,0.0438957475994513,0.08573388203017834,0.14814814814814814,0.23525377229080935,0.3511659807956104,0.5,0.6488340192043895,0.7647462277091908,0.8518518518518519,0.9142661179698217,0.9561042524005487,0.9814814814814815,0.9945130315500685,0.9993141289437586,1],\n    in_sin: [0,0.003805301908254455,0.01519224698779198,0.03407417371093169,0.06030737921409157,0.09369221296335006,0.1339745962155613,0.1808479557110082,0.233955556881022,0.2928932188134524,0.35721239031346064,0.42642356364895384,0.4999999999999999,0.5773817382593005,0.6579798566743311,0.7411809548974793,0.8263518223330696,0.9128442572523416,0.9999999999999999],\n    out_sin: [0,0.08715574274765817,0.17364817766693033,0.25881904510252074,0.3420201433256687,0.42261826174069944,0.49999999999999994,0.573576436351046,0.6427876096865393,0.7071067811865475,0.766044443118978,0.8191520442889918,0.8660254037844386,0.9063077870366499,0.9396926207859083,0.9659258262890683,0.984807753012208,0.9961946980917455,1],\n    inOut_sin: [0,0.00759612349389599,0.030153689607045786,0.06698729810778065,0.116977778440511,0.17860619515673032,0.24999999999999994,0.32898992833716556,0.4131759111665348,0.49999999999999994,0.5868240888334652,0.6710100716628343,0.7499999999999999,0.8213938048432696,0.883022221559489,0.9330127018922194,0.9698463103929542,0.9924038765061041,1],\n    in_exp: [0,0.0014352875901128893,0.002109491677524035,0.0031003926796253885,0.004556754060844206,0.006697218616039631,0.009843133202303688,0.014466792379488908,0.021262343752724643,0.03125,0.045929202883612456,0.06750373368076916,0.09921256574801243,0.1458161299470146,0.2143109957132682,0.31498026247371835,0.46293735614364506,0.6803950000871883,1],\n    out_exp: [0,0.31960499991281155,0.5370626438563548,0.6850197375262816,0.7856890042867318,0.8541838700529854,0.9007874342519875,0.9324962663192309,0.9540707971163875,0.96875,0.9787376562472754,0.9855332076205111,0.9901568667976963,0.9933027813839603,0.9954432459391558,0.9968996073203746,0.9978905083224759,0.9985647124098871,1],\n    inOut_exp: [0,0.0010547458387620175,0.002278377030422103,0.004921566601151844,0.010631171876362321,0.022964601441806228,0.049606282874006216,0.1071554978566341,0.23146867807182253,0.5,0.7685313219281775,0.892844502143366,0.9503937171259937,0.9770353985581938,0.9893688281236377,0.9950784333988482,0.9977216229695779,0.998945254161238,1],\n    in_circle: [0,0.0015444024660317135,0.006192010000093506,0.013986702816730645,0.025003956956430873,0.03935464078941209,0.057190958417936644,0.07871533601238889,0.10419358352238339,0.1339745962155614,0.1685205807169019,0.20845517506805522,0.2546440075000701,0.3083389112228482,0.37146063894529113,0.4472292016074334,0.5418771527091488,0.6713289009389102,1],\n    out_circle: [0,0.3286710990610898,0.45812284729085123,0.5527707983925666,0.6285393610547089,0.6916610887771518,0.7453559924999298,0.7915448249319448,0.8314794192830981,0.8660254037844386,0.8958064164776166,0.9212846639876111,0.9428090415820634,0.9606453592105879,0.9749960430435691,0.9860132971832694,0.9938079899999065,0.9984555975339683,1],\n    inOut_circle: [0,0.003096005000046753,0.012501978478215436,0.028595479208968322,0.052096791761191696,0.08426029035845095,0.12732200375003505,0.18573031947264557,0.2709385763545744,0.5,0.7290614236454256,0.8142696805273546,0.8726779962499649,0.915739709641549,0.9479032082388084,0.9714045207910317,0.9874980215217846,0.9969039949999532,1],\n    in_back_: [0,-0.004788556241426612,-0.017301289437585736,-0.0347587962962963,-0.05438167352537723,-0.07339051783264748,-0.08900592592592595,-0.09844849451303156,-0.0989388203017833,-0.08769750000000004,-0.06194513031550073,-0.018902307956104283,0.044210370370370254,0.13017230795610413,0.2417629080932785,0.3817615740740742,0.5529477091906719,0.7581007167352535,0.9999999999999998],\n    out_back_: [2.220446049250313e-16,0.24189928326474652,0.44705229080932807,0.6182384259259258,0.7582370919067215,0.8698276920438959,0.9557896296296297,1.0189023079561044,1.0619451303155008,1.0876975,1.0989388203017834,1.0984484945130315,1.089005925925926,1.0733905178326475,1.0543816735253773,1.0347587962962963,1.0173012894375857,1.0047885562414267,1],\n  };\n\n  Object.keys(Samples).forEach(function(type) {\n    it('should ease ' + type, function() {\n      var [modeName, easingName, isFunction] = type.split('_');\n      var easing = Easing[easingName];\n      if (isFunction !== undefined) {\n        easing = easing();\n      }\n      var computed = sampleEasingFunction(Easing[modeName](easing));\n      var samples = Samples[type];\n\n      computed.forEach((value, key) => {\n        expect(value).toBeCloseTo(samples[key], 2);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "Libraries/Animated/src/__tests__/Interpolation-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nvar AnimatedInterpolation = require('../nodes/AnimatedInterpolation');\nvar Easing = require('Easing');\n\ndescribe('Interpolation', () => {\n  it('should work with defaults', () => {\n    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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    var 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"
  },
  {
    "path": "Libraries/Animated/src/__tests__/bezier-test.js",
    "content": "/**\n * BezierEasing - use bezier curve for transition easing function\n * https://github.com/gre/bezier-easing\n *\n * @copyright 2014-2015 Gaetan Renaudeau. MIT License.\n * @noflow\n * @emails oncall+react_native\n * @format\n */\n\n'use strict';\n\nvar bezier = require('bezier');\n\nvar identity = function(x) {\n  return x;\n};\n\nfunction assertClose(a, b, precision = 3) {\n  expect(a).toBeCloseTo(b, precision);\n}\n\nfunction makeAssertCloseWithPrecision(precision) {\n  return function(a, b) {\n    assertClose(a, b, precision);\n  };\n}\n\nfunction allEquals(be1, be2, samples, assertion) {\n  if (!assertion) {\n    assertion = assertClose;\n  }\n  for (var i = 0; i <= samples; ++i) {\n    var x = i / samples;\n    assertion(be1(x), be2(x));\n  }\n}\n\nfunction repeat(n) {\n  return function(f) {\n    for (var i = 0; i < n; ++i) {\n      f(i);\n    }\n  };\n}\n\ndescribe('bezier', function() {\n  it('should be a function', function() {\n    expect(typeof bezier === 'function').toBe(true);\n  });\n  it('should creates an object', function() {\n    expect(typeof bezier(0, 0, 1, 1) === 'function').toBe(true);\n  });\n  it('should fail with wrong arguments', function() {\n    expect(function() {\n      bezier(0.5, 0.5, -5, 0.5);\n    }).toThrow();\n    expect(function() {\n      bezier(0.5, 0.5, 5, 0.5);\n    }).toThrow();\n    expect(function() {\n      bezier(-2, 0.5, 0.5, 0.5);\n    }).toThrow();\n    expect(function() {\n      bezier(2, 0.5, 0.5, 0.5);\n    }).toThrow();\n  });\n  describe('linear curves', function() {\n    it('should be linear', function() {\n      allEquals(bezier(0, 0, 1, 1), bezier(1, 1, 0, 0), 100);\n      allEquals(bezier(0, 0, 1, 1), identity, 100);\n    });\n  });\n  describe('common properties', function() {\n    it('should be the right value at extremes', function() {\n      repeat(10)(function() {\n        var a = Math.random(),\n          b = 2 * Math.random() - 0.5,\n          c = Math.random(),\n          d = 2 * Math.random() - 0.5;\n        var easing = bezier(a, b, c, d);\n        expect(easing(0)).toBe(0);\n        expect(easing(1)).toBe(1);\n      });\n    });\n\n    it('should approach the projected value of its x=y projected curve', function() {\n      repeat(10)(function() {\n        var a = Math.random(),\n          b = Math.random(),\n          c = Math.random(),\n          d = Math.random();\n        var easing = bezier(a, b, c, d);\n        var projected = bezier(b, a, d, c);\n        var composed = function(x) {\n          return projected(easing(x));\n        };\n        allEquals(identity, composed, 100, makeAssertCloseWithPrecision(2));\n      });\n    });\n  });\n  describe('two same instances', function() {\n    it('should be strictly equals', function() {\n      repeat(10)(function() {\n        var a = Math.random(),\n          b = 2 * Math.random() - 0.5,\n          c = Math.random(),\n          d = 2 * Math.random() - 0.5;\n        allEquals(bezier(a, b, c, d), bezier(a, b, c, d), 100, 0);\n      });\n    });\n  });\n  describe('symetric curves', function() {\n    it('should have a central value y~=0.5 at x=0.5', function() {\n      repeat(10)(function() {\n        var a = Math.random(),\n          b = 2 * Math.random() - 0.5,\n          c = 1 - a,\n          d = 1 - b;\n        var easing = bezier(a, b, c, d);\n        assertClose(easing(0.5), 0.5, 2);\n      });\n    });\n    it('should be symetrical', function() {\n      repeat(10)(function() {\n        var a = Math.random(),\n          b = 2 * Math.random() - 0.5,\n          c = 1 - a,\n          d = 1 - b;\n        var easing = bezier(a, b, c, d);\n        var sym = function(x) {\n          return 1 - easing(1 - x);\n        };\n        allEquals(easing, sym, 100, makeAssertCloseWithPrecision(2));\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "Libraries/Animated/src/animations/Animation.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Animation\n * @flow\n * @format\n */\n'use strict';\n\nconst NativeAnimatedHelper = require('NativeAnimatedHelper');\n\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  onComplete?: ?EndCallback,\n  iterations?: number,\n};\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    animatedValue.__makeNative();\n    this.__nativeId = NativeAnimatedHelper.generateNewAnimationId();\n    NativeAnimatedHelper.API.startAnimatingNode(\n      this.__nativeId,\n      animatedValue.__getNativeTag(),\n      this.__getNativeAnimationConfig(),\n      this.__debouncedOnEnd.bind(this),\n    );\n  }\n}\n\nmodule.exports = Animation;\n"
  },
  {
    "path": "Libraries/Animated/src/animations/DecayAnimation.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DecayAnimation\n * @flow\n * @format\n */\n'use strict';\n\nconst Animation = require('./Animation');\n\nconst {shouldUseNativeDriver} = require('../NativeAnimatedHelper');\n\nimport type {AnimationConfig, EndCallback} from './Animation';\nimport type AnimatedValue from '../nodes/AnimatedValue';\n\nexport type DecayAnimationConfig = AnimationConfig & {\n  velocity: number | {x: number, y: number},\n  deceleration?: number,\n};\n\nexport type DecayAnimationConfigSingle = 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 =\n      config.deceleration !== undefined ? config.deceleration : 0.998;\n    this._velocity = config.velocity;\n    this._useNativeDriver = shouldUseNativeDriver(config);\n    this.__isInteraction =\n      config.isInteraction !== undefined ? config.isInteraction : true;\n    this.__iterations = config.iterations !== undefined ? config.iterations : 1;\n  }\n\n  __getNativeAnimationConfig() {\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 /\n        (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\nmodule.exports = DecayAnimation;\n"
  },
  {
    "path": "Libraries/Animated/src/animations/SpringAnimation.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SpringAnimation\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedValue = require('../nodes/AnimatedValue');\nconst AnimatedValueXY = require('../nodes/AnimatedValueXY');\nconst Animation = require('./Animation');\nconst SpringConfig = require('../SpringConfig');\n\nconst invariant = require('fbjs/lib/invariant');\nconst {shouldUseNativeDriver} = require('../NativeAnimatedHelper');\n\nimport type {AnimationConfig, EndCallback} from './Animation';\n\nexport type SpringAnimationConfig = AnimationConfig & {\n  toValue: number | AnimatedValue | {x: number, y: number} | AnimatedValueXY,\n  overshootClamping?: boolean,\n  restDisplacementThreshold?: number,\n  restSpeedThreshold?: number,\n  velocity?: number | {x: number, y: 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\nexport type SpringAnimationConfigSingle = AnimationConfig & {\n  toValue: number | AnimatedValue,\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\nfunction withDefault<T>(value: ?T, defaultValue: T): T {\n  if (value === undefined || value === null) {\n    return defaultValue;\n  }\n  return value;\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: any;\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\n  constructor(config: SpringAnimationConfigSingle) {\n    super();\n\n    this._overshootClamping = withDefault(config.overshootClamping, false);\n    this._restDisplacementThreshold = withDefault(\n      config.restDisplacementThreshold,\n      0.001,\n    );\n    this._restSpeedThreshold = withDefault(config.restSpeedThreshold, 0.001);\n    this._initialVelocity = withDefault(config.velocity, 0);\n    this._lastVelocity = withDefault(config.velocity, 0);\n    this._toValue = config.toValue;\n    this._delay = withDefault(config.delay, 0);\n    this._useNativeDriver = shouldUseNativeDriver(config);\n    this.__isInteraction =\n      config.isInteraction !== undefined ? config.isInteraction : true;\n    this.__iterations = config.iterations !== undefined ? 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 = withDefault(config.stiffness, 100);\n      this._damping = withDefault(config.damping, 10);\n      this._mass = withDefault(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        withDefault(config.bounciness, 8),\n        withDefault(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        withDefault(config.tension, 40),\n        withDefault(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    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: withDefault(this._initialVelocity, this._lastVelocity),\n      toValue: this._toValue,\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._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    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\nmodule.exports = SpringAnimation;\n"
  },
  {
    "path": "Libraries/Animated/src/animations/TimingAnimation.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TimingAnimation\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedValue = require('../nodes/AnimatedValue');\nconst AnimatedValueXY = require('../nodes/AnimatedValueXY');\nconst Animation = require('./Animation');\n\nconst {shouldUseNativeDriver} = require('../NativeAnimatedHelper');\n\nimport type {AnimationConfig, EndCallback} from './Animation';\n\nexport type TimingAnimationConfig = AnimationConfig & {\n  toValue: number | AnimatedValue | {x: number, y: number} | AnimatedValueXY,\n  easing?: (value: number) => number,\n  duration?: number,\n  delay?: number,\n};\n\nexport type TimingAnimationConfigSingle = AnimationConfig & {\n  toValue: number | AnimatedValue,\n  easing?: (value: number) => number,\n  duration?: number,\n  delay?: number,\n};\n\nlet _easeInOut;\nfunction easeInOut() {\n  if (!_easeInOut) {\n    const Easing = require('Easing');\n    _easeInOut = Easing.inOut(Easing.ease);\n  }\n  return _easeInOut;\n}\n\nclass TimingAnimation extends Animation {\n  _startTime: number;\n  _fromValue: number;\n  _toValue: any;\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\n  constructor(config: TimingAnimationConfigSingle) {\n    super();\n    this._toValue = config.toValue;\n    this._easing = config.easing !== undefined ? config.easing : easeInOut();\n    this._duration = config.duration !== undefined ? config.duration : 500;\n    this._delay = config.delay !== undefined ? config.delay : 0;\n    this.__iterations = config.iterations !== undefined ? config.iterations : 1;\n    this.__isInteraction =\n      config.isInteraction !== undefined ? config.isInteraction : true;\n    this._useNativeDriver = shouldUseNativeDriver(config);\n  }\n\n  __getNativeAnimationConfig(): any {\n    const frameDuration = 1000.0 / 60.0;\n    const frames = [];\n    for (let dt = 0.0; dt < this._duration; dt += frameDuration) {\n      frames.push(this._easing(dt / this._duration));\n    }\n    frames.push(this._easing(1));\n    return {\n      type: 'frames',\n      frames,\n      toValue: this._toValue,\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._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            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      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\nmodule.exports = TimingAnimation;\n"
  },
  {
    "path": "Libraries/Animated/src/bezier.js",
    "content": "/**\n * BezierEasing - use bezier curve for transition easing function\n * https://github.com/gre/bezier-easing\n *\n * @copyright 2014-2015 Gaëtan Renaudeau. MIT License.\n * @providesModule bezier\n * @noflow\n */\n'use strict';\n\n // These values are established by empiricism with tests (tradeoff: performance VS precision)\n var NEWTON_ITERATIONS = 4;\n var NEWTON_MIN_SLOPE = 0.001;\n var SUBDIVISION_PRECISION = 0.0000001;\n var SUBDIVISION_MAX_ITERATIONS = 10;\n\n var kSplineTableSize = 11;\n var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\n var float32ArraySupported = typeof Float32Array === 'function';\n\n function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n function C (aA1)      { return 3.0 * aA1; }\n\n // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\n function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }\n\n // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\n function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }\n\n function binarySubdivide (aX, aA, aB, mX1, mX2) {\n   var currentX, currentT, i = 0;\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 (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n   return currentT;\n }\n\n function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {\n  for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n    var currentSlope = getSlope(aGuessT, mX1, mX2);\n    if (currentSlope === 0.0) {\n      return aGuessT;\n    }\n    var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n    aGuessT -= currentX / currentSlope;\n  }\n  return aGuessT;\n }\n\n module.exports = function bezier (mX1, mY1, mX2, mY2) {\n   if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { // eslint-disable-line yoda\n     throw new Error('bezier x values must be in [0, 1] range');\n   }\n\n   // Precompute samples table\n   var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n   if (mX1 !== mY1 || mX2 !== mY2) {\n     for (var i = 0; i < kSplineTableSize; ++i) {\n       sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n     }\n   }\n\n   function getTForX (aX) {\n     var intervalStart = 0.0;\n     var currentSample = 1;\n     var lastSample = kSplineTableSize - 1;\n\n     for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n       intervalStart += kSampleStepSize;\n     }\n     --currentSample;\n\n     // Interpolate to provide an initial guess for t\n     var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n     var guessForT = intervalStart + dist * kSampleStepSize;\n\n     var 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(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n     }\n   }\n\n   return function BezierEasing (x) {\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": "Libraries/Animated/src/createAnimatedComponent.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule createAnimatedComponent\n * @flow\n * @format\n */\n'use strict';\n\nconst {AnimatedEvent} = require('./AnimatedEvent');\nconst AnimatedProps = require('./nodes/AnimatedProps');\nconst React = require('React');\nconst ViewStylePropTypes = require('ViewStylePropTypes');\n\nfunction createAnimatedComponent(Component: any): any {\n  class AnimatedComponent extends React.Component<Object> {\n    _component: any;\n    _invokeAnimatedPropsCallbackOnMount: boolean = false;\n    _prevComponent: any;\n    _propsAnimated: AnimatedProps;\n    _eventDetachers: Array<Function> = [];\n    _setComponentRef: Function;\n\n    static __skipSetNativeProps_FOR_TESTS_ONLY = false;\n\n    constructor(props: Object) {\n      super(props);\n      this._setComponentRef = this._setComponentRef.bind(this);\n    }\n\n    componentWillUnmount() {\n      this._propsAnimated && this._propsAnimated.__detach();\n      this._detachNativeEvents();\n    }\n\n    setNativeProps(props) {\n      this._component.setNativeProps(props);\n    }\n\n    componentWillMount() {\n      this._attachProps(this.props);\n    }\n\n    componentDidMount() {\n      if (this._invokeAnimatedPropsCallbackOnMount) {\n        this._invokeAnimatedPropsCallbackOnMount = false;\n        this._animatedPropsCallback();\n      }\n\n      this._propsAnimated.setNativeView(this._component);\n      this._attachNativeEvents();\n    }\n\n    _attachNativeEvents() {\n      // Make sure to get the scrollable node for components that implement\n      // `ScrollResponder.Mixin`.\n      const scrollableNode = this._component.getScrollableNode\n        ? this._component.getScrollableNode()\n        : this._component;\n\n      for (const key in this.props) {\n        const prop = this.props[key];\n        if (prop instanceof AnimatedEvent && prop.__isNative) {\n          prop.__attach(scrollableNode, key);\n          this._eventDetachers.push(() => prop.__detach(scrollableNode, key));\n        }\n      }\n    }\n\n    _detachNativeEvents() {\n      this._eventDetachers.forEach(remove => remove());\n      this._eventDetachers = [];\n    }\n\n    // The system is best designed when setNativeProps is implemented. It is\n    // able to avoid re-rendering and directly set the attributes that changed.\n    // However, setNativeProps can only be implemented on leaf native\n    // components. If you want to animate a composite component, you need to\n    // re-render it. In this case, we have a fallback that uses forceUpdate.\n    _animatedPropsCallback = () => {\n      if (this._component == null) {\n        // AnimatedProps is created in will-mount because it's used in render.\n        // But this callback may be invoked before mount in async mode,\n        // In which case we should defer the setNativeProps() call.\n        // React may throw away uncommitted work in async mode,\n        // So a deferred call won't always be invoked.\n        this._invokeAnimatedPropsCallbackOnMount = true;\n      } else if (\n        AnimatedComponent.__skipSetNativeProps_FOR_TESTS_ONLY ||\n        typeof this._component.setNativeProps !== 'function'\n      ) {\n        this.forceUpdate();\n      } else if (!this._propsAnimated.__isNative) {\n        this._component.setNativeProps(\n          this._propsAnimated.__getAnimatedValue(),\n        );\n      } else {\n        throw new Error(\n          'Attempting to run JS driven animation on animated ' +\n            'node that has been moved to \"native\" earlier by starting an ' +\n            'animation with `useNativeDriver: true`',\n        );\n      }\n    };\n\n    _attachProps(nextProps) {\n      const oldPropsAnimated = this._propsAnimated;\n\n      this._propsAnimated = new AnimatedProps(\n        nextProps,\n        this._animatedPropsCallback,\n      );\n\n      // When you call detach, it removes the element from the parent list\n      // of children. If it goes to 0, then the parent also detaches itself\n      // and so on.\n      // An optimization is to attach the new elements and THEN detach the old\n      // ones instead of detaching and THEN attaching.\n      // This way the intermediate state isn't to go to 0 and trigger\n      // this expensive recursive detaching to then re-attach everything on\n      // the very next operation.\n      oldPropsAnimated && oldPropsAnimated.__detach();\n    }\n\n    componentWillReceiveProps(newProps) {\n      this._attachProps(newProps);\n    }\n\n    componentDidUpdate(prevProps) {\n      if (this._component !== this._prevComponent) {\n        this._propsAnimated.setNativeView(this._component);\n      }\n      if (this._component !== this._prevComponent || prevProps !== this.props) {\n        this._detachNativeEvents();\n        this._attachNativeEvents();\n      }\n    }\n\n    render() {\n      const props = this._propsAnimated.__getValue();\n      return (\n        <Component\n          {...props}\n          ref={this._setComponentRef}\n          // The native driver updates views directly through the UI thread so we\n          // have to make sure the view doesn't get optimized away because it cannot\n          // go through the NativeViewHierachyManager since it operates on the shadow\n          // thread.\n          collapsable={\n            this._propsAnimated.__isNative ? false : props.collapsable\n          }\n        />\n      );\n    }\n\n    _setComponentRef(c) {\n      this._prevComponent = this._component;\n      this._component = c;\n    }\n\n    // A third party library can use getNode()\n    // to get the node reference of the decorated component\n    getNode() {\n      return this._component;\n    }\n  }\n\n  const propTypes = Component.propTypes;\n\n  AnimatedComponent.propTypes = {\n    style: function(props, propName, componentName) {\n      if (!propTypes) {\n        return;\n      }\n\n      for (const key in ViewStylePropTypes) {\n        if (!propTypes[key] && props[key] !== undefined) {\n          console.warn(\n            'You are setting the style `{ ' +\n              key +\n              ': ... }` as a prop. You ' +\n              'should nest it in a style object. ' +\n              'E.g. `{ style: { ' +\n              key +\n              ': ... } }`',\n          );\n        }\n      }\n    },\n  };\n\n  return AnimatedComponent;\n}\n\nmodule.exports = createAnimatedComponent;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedAddition.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedAddition\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedInterpolation = require('./AnimatedInterpolation');\nconst AnimatedNode = require('./AnimatedNode');\nconst AnimatedValue = require('./AnimatedValue');\nconst AnimatedWithChildren = require('./AnimatedWithChildren');\n\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() {\n    this._a.__makeNative();\n    this._b.__makeNative();\n    super.__makeNative();\n  }\n\n  __getValue(): number {\n    return this._a.__getValue() + this._b.__getValue();\n  }\n\n  interpolate(config: InterpolationConfigType): AnimatedInterpolation {\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\nmodule.exports = AnimatedAddition;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedDiffClamp.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedDiffClamp\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedInterpolation = require('./AnimatedInterpolation');\nconst AnimatedNode = require('./AnimatedNode');\nconst AnimatedWithChildren = require('./AnimatedWithChildren');\n\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\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() {\n    this._a.__makeNative();\n    super.__makeNative();\n  }\n\n  interpolate(config: InterpolationConfigType): AnimatedInterpolation {\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\nmodule.exports = AnimatedDiffClamp;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedDivision.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedDivision\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedInterpolation = require('./AnimatedInterpolation');\nconst AnimatedNode = require('./AnimatedNode');\nconst AnimatedValue = require('./AnimatedValue');\nconst AnimatedWithChildren = require('./AnimatedWithChildren');\n\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\n\nclass AnimatedDivision 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() {\n    this._a.__makeNative();\n    this._b.__makeNative();\n    super.__makeNative();\n  }\n\n  __getValue(): number {\n    const a = this._a.__getValue();\n    const b = this._b.__getValue();\n    if (b === 0) {\n      console.error('Detected division by zero in AnimatedDivision');\n    }\n    return a / b;\n  }\n\n  interpolate(config: InterpolationConfigType): AnimatedInterpolation {\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\nmodule.exports = AnimatedDivision;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedInterpolation.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedInterpolation\n * @flow\n * @format\n */\n/* eslint no-bitwise: 0 */\n'use strict';\n\nconst AnimatedNode = require('./AnimatedNode');\nconst AnimatedWithChildren = require('./AnimatedWithChildren');\nconst NativeAnimatedHelper = require('../NativeAnimatedHelper');\n\nconst invariant = require('fbjs/lib/invariant');\nconst normalizeColor = require('normalizeColor');\n\ntype ExtrapolateType = 'extend' | 'identity' | 'clamp';\n\nexport type InterpolationConfigType = {\n  inputRange: Array<number>,\n  /* $FlowFixMe(>=0.38.0 site=react_native_fb,react_native_oss) - Flow error\n   * detected during the deployment of v0.38.0. To see the error, remove this\n   * comment and run flow\n   */\n  outputRange: Array<number> | Array<string>,\n  easing?: (input: number) => number,\n  extrapolate?: ExtrapolateType,\n  extrapolateLeft?: ExtrapolateType,\n  extrapolateRight?: ExtrapolateType,\n};\n\nconst linear = t => 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(\n  config: InterpolationConfigType,\n): (input: number) => number | string {\n  if (config.outputRange && typeof config.outputRange[0] === 'string') {\n    return createInterpolationFromStringOutputRange(config);\n  }\n\n  const outputRange: Array<number> = (config.outputRange: any);\n  checkInfiniteRange('outputRange', outputRange);\n\n  const inputRange = config.inputRange;\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  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    );\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 int32Color = normalizeColor(input);\n  if (int32Color === null) {\n    return input;\n  }\n\n  int32Color = int32Color || 0;\n\n  const r = (int32Color & 0xff000000) >>> 24;\n  const g = (int32Color & 0x00ff0000) >>> 16;\n  const b = (int32Color & 0x0000ff00) >>> 8;\n  const a = (int32Color & 0x000000ff) / 255;\n\n  return `rgba(${r}, ${g}, ${b}, ${a})`;\n}\n\nconst stringShapeRegex = /[0-9\\.-]+/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,\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(>=0.18.0): `outputRange[0].match()` can return `null`. Need to\n   * guard against this possibility.\n   */\n  const outputRanges = outputRange[0].match(stringShapeRegex).map(() => []);\n  outputRange.forEach(value => {\n    /* $FlowFixMe(>=0.18.0): `value.match()` can return `null`. Need to guard\n     * against this possibility.\n     */\n    value.match(stringShapeRegex).forEach((number, i) => {\n      outputRanges[i].push(+number);\n    });\n  });\n\n  /* $FlowFixMe(>=0.18.0): `outputRange[0].match()` can return `null`. Need to\n   * guard against this possibility.\n   */\n  const interpolations = outputRange[0]\n    .match(stringShapeRegex)\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      const val = +interpolations[i++](input);\n      const rounded =\n        shouldRound && i < 4 ? Math.round(val) : Math.round(val * 1000) / 1000;\n      return String(rounded);\n    });\n  };\n}\n\nfunction isRgbOrRgba(range) {\n  return typeof range === 'string' && range.startsWith('rgb');\n}\n\nfunction checkPattern(arr: Array<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: Array<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: Array<number>) {\n  invariant(arr.length >= 2, 'inputRange must have at least 2 elements');\n  for (let i = 1; i < arr.length; ++i) {\n    invariant(\n      arr[i] >= arr[i - 1],\n      /* $FlowFixMe(>=0.13.0) - In the addition expression below this comment,\n       * one or both of the operands may be something that doesn't cleanly\n       * convert to a string, like undefined, null, and object, etc. If you really\n       * mean this implicit string conversion, you can do something like\n       * String(myThing)\n       */\n      'inputRange must be monotonically increasing ' + arr,\n    );\n  }\n}\n\nfunction checkInfiniteRange(name: string, arr: Array<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(>=0.13.0) - In the addition expression below this comment,\n     * one or both of the operands may be something that doesn't cleanly convert\n     * to a string, like undefined, null, and object, etc. If you really mean\n     * this implicit string conversion, you can do something like\n     * String(myThing)\n     */\n    name + 'cannot be ]-infinity;+infinity[ ' + arr,\n  );\n}\n\nclass AnimatedInterpolation extends AnimatedWithChildren {\n  // Export for testing.\n  static __createInterpolation = createInterpolation;\n\n  _parent: AnimatedNode;\n  _config: InterpolationConfigType;\n  _interpolation: (input: number) => number | string;\n\n  constructor(parent: AnimatedNode, config: InterpolationConfigType) {\n    super();\n    this._parent = parent;\n    this._config = config;\n    this._interpolation = createInterpolation(config);\n  }\n\n  __makeNative() {\n    this._parent.__makeNative();\n    super.__makeNative();\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(config: InterpolationConfigType): AnimatedInterpolation {\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: Array<any>) {\n    // Change the string array type to number array\n    // So we can reuse the same logic in iOS and Android platform\n    return range.map(function(value) {\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        // Assume radians\n        return parseFloat(value) || 0;\n      }\n    });\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 tranform `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\nmodule.exports = AnimatedInterpolation;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedModulo.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedModulo\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedInterpolation = require('./AnimatedInterpolation');\nconst AnimatedNode = require('./AnimatedNode');\nconst AnimatedWithChildren = require('./AnimatedWithChildren');\n\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\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() {\n    this._a.__makeNative();\n    super.__makeNative();\n  }\n\n  __getValue(): number {\n    return (\n      (this._a.__getValue() % this._modulus + this._modulus) % this._modulus\n    );\n  }\n\n  interpolate(config: InterpolationConfigType): AnimatedInterpolation {\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\nmodule.exports = AnimatedModulo;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedMultiplication.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedMultiplication\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedInterpolation = require('./AnimatedInterpolation');\nconst AnimatedNode = require('./AnimatedNode');\nconst AnimatedValue = require('./AnimatedValue');\nconst AnimatedWithChildren = require('./AnimatedWithChildren');\n\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\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() {\n    this._a.__makeNative();\n    this._b.__makeNative();\n    super.__makeNative();\n  }\n\n  __getValue(): number {\n    return this._a.__getValue() * this._b.__getValue();\n  }\n\n  interpolate(config: InterpolationConfigType): AnimatedInterpolation {\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: 'multiplication',\n      input: [this._a.__getNativeTag(), this._b.__getNativeTag()],\n    };\n  }\n}\n\nmodule.exports = AnimatedMultiplication;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedNode.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedNode\n * @flow\n * @format\n */\n'use strict';\n\nconst NativeAnimatedHelper = require('../NativeAnimatedHelper');\n\nconst invariant = require('fbjs/lib/invariant');\n\n// Note(vjeux): this would be better as an interface but flow doesn't\n// support them yet\nclass AnimatedNode {\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  __makeNative() {\n    if (!this.__isNative) {\n      throw new Error('This node cannot be made a \"native\" animated node');\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    if (this.__nativeTag == null) {\n      const nativeTag: ?number = NativeAnimatedHelper.generateNewNodeTag();\n      NativeAnimatedHelper.API.createAnimatedNode(\n        nativeTag,\n        this.__getNativeConfig(),\n      );\n      this.__nativeTag = nativeTag;\n    }\n    return this.__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\nmodule.exports = AnimatedNode;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedProps.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedProps\n * @flow\n * @format\n */\n'use strict';\n\nconst {AnimatedEvent} = require('../AnimatedEvent');\nconst AnimatedNode = require('./AnimatedNode');\nconst AnimatedStyle = require('./AnimatedStyle');\nconst NativeAnimatedHelper = require('../NativeAnimatedHelper');\nconst ReactNative = require('ReactNative');\n\nconst invariant = require('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    this.__attach();\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    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 = ReactNative.findNodeHandle(\n      this._animatedView,\n    );\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 = ReactNative.findNodeHandle(\n      this._animatedView,\n    );\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  __getNativeConfig(): Object {\n    const propsConfig = {};\n    for (const propKey in this._props) {\n      const value = this._props[propKey];\n      if (value instanceof AnimatedNode) {\n        propsConfig[propKey] = value.__getNativeTag();\n      }\n    }\n    return {\n      type: 'props',\n      props: propsConfig,\n    };\n  }\n}\n\nmodule.exports = AnimatedProps;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedStyle.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedStyle\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedNode = require('./AnimatedNode');\nconst AnimatedTransform = require('./AnimatedTransform');\nconst AnimatedWithChildren = require('./AnimatedWithChildren');\nconst NativeAnimatedHelper = require('../NativeAnimatedHelper');\n\nconst flattenStyle = require('flattenStyle');\n\nclass AnimatedStyle extends AnimatedWithChildren {\n  _style: Object;\n\n  constructor(style: any) {\n    super();\n    style = flattenStyle(style) || {};\n    if (style.transform) {\n      style = {\n        ...style,\n        transform: new AnimatedTransform(style.transform),\n      };\n    }\n    this._style = 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(): Object {\n    return this._walkStyleAndGetValues(this._style);\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    super.__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  }\n\n  __getNativeConfig(): Object {\n    const styleConfig = {};\n    for (const styleKey in this._style) {\n      if (this._style[styleKey] instanceof AnimatedNode) {\n        styleConfig[styleKey] = this._style[styleKey].__getNativeTag();\n      }\n      // Non-animated styles are set using `setNativeProps`, no need\n      // to pass those as a part of the node config\n    }\n    NativeAnimatedHelper.validateStyles(styleConfig);\n    return {\n      type: 'style',\n      style: styleConfig,\n    };\n  }\n}\n\nmodule.exports = AnimatedStyle;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedTracking.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedTracking\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedValue = require('./AnimatedValue');\nconst AnimatedNode = require('./AnimatedNode');\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\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._callback = callback;\n    this.__attach();\n  }\n\n  __getValue(): Object {\n    return this._parent.__getValue();\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  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\nmodule.exports = AnimatedTracking;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedTransform.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedTransform\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedNode = require('./AnimatedNode');\nconst AnimatedWithChildren = require('./AnimatedWithChildren');\nconst NativeAnimatedHelper = require('../NativeAnimatedHelper');\n\nclass AnimatedTransform extends AnimatedWithChildren {\n  _transforms: Array<Object>;\n\n  constructor(transforms: Array<Object>) {\n    super();\n    this._transforms = transforms;\n  }\n\n  __makeNative() {\n    super.__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  }\n\n  __getValue(): Array<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(): Array<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,\n          });\n        }\n      }\n    });\n\n    NativeAnimatedHelper.validateTransform(transConfigs);\n    return {\n      type: 'transform',\n      transforms: transConfigs,\n    };\n  }\n}\n\nmodule.exports = AnimatedTransform;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedValue.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedValue\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedInterpolation = require('./AnimatedInterpolation');\nconst AnimatedNode = require('./AnimatedNode');\nconst AnimatedWithChildren = require('./AnimatedWithChildren');\nconst InteractionManager = require('InteractionManager');\nconst NativeAnimatedHelper = require('../NativeAnimatedHelper');\n\nimport type Animation, {EndCallback} from '../animations/Animation';\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\n\nconst NativeAnimatedAPI = NativeAnimatedHelper.API;\n\ntype ValueListenerCallback = (state: {value: number}) => void;\n\nlet _uniqueId = 1;\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) {\n    if (typeof node.update === 'function') {\n      animatedStyles.add(node);\n    } else {\n      node.__getChildren().forEach(findAnimatedStyles);\n    }\n  }\n  findAnimatedStyles(rootNode);\n  /* $FlowFixMe */\n  animatedStyles.forEach(animatedStyle => animatedStyle.update());\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 http://facebook.github.io/react-native/docs/animatedvalue.html\n */\nclass AnimatedValue extends AnimatedWithChildren {\n  _value: number;\n  _startingValue: number;\n  _offset: number;\n  _animation: ?Animation;\n  _tracking: ?AnimatedNode;\n  _listeners: {[key: string]: ValueListenerCallback};\n  __nativeAnimatedValueListener: ?any;\n\n  constructor(value: number) {\n    super();\n    this._startingValue = this._value = value;\n    this._offset = 0;\n    this._animation = null;\n    this._listeners = {};\n  }\n\n  __detach() {\n    this.stopAnimation();\n    super.__detach();\n  }\n\n  __getValue(): number {\n    return this._value + this._offset;\n  }\n\n  __makeNative() {\n    super.__makeNative();\n\n    if (Object.keys(this._listeners).length) {\n      this._startListeningToNativeValueUpdates();\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   * See http://facebook.github.io/react-native/docs/animatedvalue.html#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      NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), value);\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 http://facebook.github.io/react-native/docs/animatedvalue.html#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 http://facebook.github.io/react-native/docs/animatedvalue.html#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 http://facebook.github.io/react-native/docs/animatedvalue.html#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   * 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 http://facebook.github.io/react-native/docs/animatedvalue.html#addlistener\n   */\n  addListener(callback: ValueListenerCallback): 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 http://facebook.github.io/react-native/docs/animatedvalue.html#removelistener\n   */\n  removeListener(id: string): void {\n    delete this._listeners[id];\n    if (this.__isNative && Object.keys(this._listeners).length === 0) {\n      this._stopListeningForNativeValueUpdates();\n    }\n  }\n\n  /**\n   * Remove all registered listeners.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvalue.html#removealllisteners\n   */\n  removeAllListeners(): void {\n    this._listeners = {};\n    if (this.__isNative) {\n      this._stopListeningForNativeValueUpdates();\n    }\n  }\n\n  _startListeningToNativeValueUpdates() {\n    if (this.__nativeAnimatedValueListener) {\n      return;\n    }\n\n    NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag());\n    this.__nativeAnimatedValueListener = NativeAnimatedHelper.nativeEventEmitter.addListener(\n      'onAnimatedValueUpdate',\n      data => {\n        if (data.tag !== this.__getNativeTag()) {\n          return;\n        }\n        this._updateValue(data.value, false /* flush */);\n      },\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  /**\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 http://facebook.github.io/react-native/docs/animatedvalue.html#stopanimation\n   */\n  stopAnimation(callback?: ?(value: number) => void): void {\n    this.stopTracking();\n    this._animation && this._animation.stop();\n    this._animation = null;\n    callback && callback(this.__getValue());\n  }\n\n  /**\n   * Stops any animation and resets the value to its original.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvalue.html#resetanimation\n   */\n  resetAnimation(callback?: ?(value: number) => void): void {\n    this.stopAnimation(callback);\n    this._value = this._startingValue;\n  }\n\n  /**\n   * Interpolates the value before updating the property, e.g. mapping 0-1 to\n   * 0-10.\n   */\n  interpolate(config: InterpolationConfigType): AnimatedInterpolation {\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 http://facebook.github.io/react-native/docs/animatedvalue.html#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, therefore we can always\n        // pass flush = true to allow the updated value to propagate to native with setNativeProps\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: AnimatedNode): void {\n    this.stopTracking();\n    this._tracking = tracking;\n  }\n\n  _updateValue(value: number, flush: boolean): void {\n    this._value = value;\n    if (flush) {\n      _flush(this);\n    }\n    for (const key in this._listeners) {\n      this._listeners[key]({value: this.__getValue()});\n    }\n  }\n\n  __getNativeConfig(): Object {\n    return {\n      type: 'value',\n      value: this._value,\n      offset: this._offset,\n    };\n  }\n}\n\nmodule.exports = AnimatedValue;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedValueXY.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedValueXY\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedValue = require('./AnimatedValue');\nconst AnimatedWithChildren = require('./AnimatedWithChildren');\n\nconst invariant = require('fbjs/lib/invariant');\n\ntype ValueXYListenerCallback = (value: {x: number, y: number}) => void;\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 http://facebook.github.io/react-native/docs/animatedvaluexy.html\n */\nclass AnimatedValueXY extends AnimatedWithChildren {\n  x: AnimatedValue;\n  y: AnimatedValue;\n  _listeners: {[key: string]: {x: string, y: string}};\n\n  constructor(\n    valueIn?: ?{x: number | AnimatedValue, y: number | AnimatedValue},\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 initalized 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 http://facebook.github.io/react-native/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 http://facebook.github.io/react-native/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 http://facebook.github.io/react-native/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 http://facebook.github.io/react-native/docs/animatedvaluexy.html#extractoffset\n   */\n  extractOffset(): void {\n    this.x.extractOffset();\n    this.y.extractOffset();\n  }\n\n  __getValue(): {x: number, y: number} {\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 http://facebook.github.io/react-native/docs/animatedvaluexy.html#resetanimation\n   */\n  resetAnimation(callback?: (value: {x: number, y: number}) => void): 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 http://facebook.github.io/react-native/docs/animatedvaluexy.html#stopanimation\n   */\n  stopAnimation(callback?: (value: {x: number, y: number}) => void): 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 http://facebook.github.io/react-native/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 http://facebook.github.io/react-native/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 http://facebook.github.io/react-native/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 http://facebook.github.io/react-native/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 http://facebook.github.io/react-native/docs/animatedvaluexy.html#gettranslatetransform\n   */\n  getTranslateTransform(): Array<{[key: string]: AnimatedValue}> {\n    return [{translateX: this.x}, {translateY: this.y}];\n  }\n}\n\nmodule.exports = AnimatedValueXY;\n"
  },
  {
    "path": "Libraries/Animated/src/nodes/AnimatedWithChildren.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnimatedWithChildren\n * @flow\n * @format\n */\n'use strict';\n\nconst AnimatedNode = require('./AnimatedNode');\nconst NativeAnimatedHelper = require('../NativeAnimatedHelper');\n\nclass AnimatedWithChildren extends AnimatedNode {\n  _children: Array<AnimatedNode>;\n\n  constructor() {\n    super();\n    this._children = [];\n  }\n\n  __makeNative() {\n    if (!this.__isNative) {\n      this.__isNative = true;\n      for (const child of this._children) {\n        child.__makeNative();\n        NativeAnimatedHelper.API.connectAnimatedNodes(\n          this.__getNativeTag(),\n          child.__getNativeTag(),\n        );\n      }\n    }\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();\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\nmodule.exports = AnimatedWithChildren;\n"
  },
  {
    "path": "Libraries/Animated/src/polyfills/InteractionManager.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nmodule.exports = {\n  createInteractionHandle: function() {},\n  clearInteractionHandle: function() {}\n};\n"
  },
  {
    "path": "Libraries/Animated/src/polyfills/Set.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nfunction SetPolyfill() {\n  this._cache = [];\n}\n\nSetPolyfill.prototype.add = function(e) {\n  if (this._cache.indexOf(e) === -1) {\n    this._cache.push(e);\n  }\n};\n\nSetPolyfill.prototype.forEach = function(cb) {\n  this._cache.forEach(cb);\n};\n\nmodule.exports = SetPolyfill;\n"
  },
  {
    "path": "Libraries/Animated/src/polyfills/flattenStyle.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\nmodule.exports = function(style) {\n  return style;\n};\n"
  },
  {
    "path": "Libraries/AppState/AppState.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AppState\n * @flow\n */\n'use strict';\n\nconst MissingNativeEventEmitterShim = require('MissingNativeEventEmitterShim');\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst NativeModules = require('NativeModules');\nconst RCTAppState = NativeModules.AppState;\n\nconst logError = require('logError');\nconst invariant = require('fbjs/lib/invariant');\n\n/**\n * `AppState` can tell you if the app is in the foreground or background,\n * and notify you when the state changes.\n *\n * See http://facebook.github.io/react-native/docs/appstate.html\n */\nclass AppState extends NativeEventEmitter {\n\n  _eventHandlers: Object;\n  currentState: ?string;\n  isAvailable: boolean = true;\n\n  constructor() {\n    super(RCTAppState);\n\n    this.isAvailable = true;\n    this._eventHandlers = {\n      change: new Map(),\n      memoryWarning: new Map(),\n    };\n\n    // TODO: Remove the 'active' fallback after `initialAppState` is exported by\n    // the Android implementation.\n    this.currentState = RCTAppState.initialAppState || 'active';\n\n    let eventUpdated = false;\n\n    // TODO: this is a terrible solution - in order to ensure `currentState`\n    // prop is up to date, we have to register an observer that updates it \n    // whenever the state changes, even if nobody cares. We should just \n    // deprecate the `currentState` property and get rid of this.\n    this.addListener(\n      'appStateDidChange',\n      (appStateData) => {\n        eventUpdated = true;\n        this.currentState = appStateData.app_state;\n      }\n    );\n\n    // TODO: see above - this request just populates the value of `currentState`\n    // when the module is first initialized. Would be better to get rid of the\n    // prop and expose `getCurrentAppState` method directly.\n    RCTAppState.getCurrentAppState(\n      (appStateData) => {\n        if (!eventUpdated) {\n          this.currentState = appStateData.app_state;\n        }\n      },\n      logError\n    );\n  }\n\n  // TODO: now that AppState is a subclass of NativeEventEmitter, we could\n  // deprecate `addEventListener` and `removeEventListener` and just use \n  // addListener` and `listener.remove()` directly. That will be a breaking \n  // change though, as both the method and event names are different\n  // (addListener events are currently required to be globally unique).\n   /**\n   * Add a handler to AppState changes by listening to the `change` event type\n   * and providing the handler.\n   * \n   * See http://facebook.github.io/react-native/docs/appstate.html#addeventlistener\n   */\n  addEventListener(\n    type: string,\n    handler: Function\n  ) {\n    invariant(\n      ['change', 'memoryWarning'].indexOf(type) !== -1,\n      'Trying to subscribe to unknown event: \"%s\"', type\n    );\n    if (type === 'change') {\n      this._eventHandlers[type].set(handler, this.addListener(\n        'appStateDidChange',\n        (appStateData) => {\n          handler(appStateData.app_state);\n        }\n      ));\n    } else if (type === 'memoryWarning') {\n      this._eventHandlers[type].set(handler, this.addListener(\n        'memoryWarning',\n        handler\n      ));\n    }\n  }\n\n  /**\n   * Remove a handler by passing the `change` event type and the handler.\n   * \n   * See http://facebook.github.io/react-native/docs/appstate.html#removeeventlistener\n   */\n  removeEventListener(\n    type: string,\n    handler: Function\n  ) {\n    invariant(\n      ['change', 'memoryWarning'].indexOf(type) !== -1,\n      'Trying to remove listener for unknown event: \"%s\"', type\n    );\n    if (!this._eventHandlers[type].has(handler)) {\n      return;\n    }\n    this._eventHandlers[type].get(handler).remove();\n    this._eventHandlers[type].delete(handler);\n  }\n}\n\nif (__DEV__ && !RCTAppState) {\n  class MissingNativeAppStateShim extends MissingNativeEventEmitterShim {\n    constructor() {\n      super('RCTAppState', 'AppState');\n    }\n\n    get currentState(): ?string {\n      this.throwMissingNativeModule();\n    }\n\n    addEventListener(...args: Array<any>) {\n      this.throwMissingNativeModule();\n    }\n\n    removeEventListener(...args: Array<any>) {\n      this.throwMissingNativeModule();\n    }\n  }\n\n  // This module depends on the native `RCTAppState` module. If you don't\n  // include it, `AppState.isAvailable` will return `false`, and any method\n  // calls will throw. We reassign the class variable to keep the autodoc\n  // generator happy.\n  AppState = new MissingNativeAppStateShim();\n} else {\n  AppState = new AppState();\n}\n\nmodule.exports = AppState;\n"
  },
  {
    "path": "Libraries/BatchedBridge/BatchedBridge.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BatchedBridge\n * @flow\n */\n'use strict';\n\nconst MessageQueue = require('MessageQueue');\n\n// MessageQueue can install a global handler to catch all exceptions where JS users can register their own behavior\n// This handler makes all exceptions to be handled inside MessageQueue rather than by the VM at its origin\n// This makes stacktraces to be placed at MessageQueue rather than at where they were launched\n// The parameter __fbUninstallRNGlobalErrorHandler is passed to MessageQueue to prevent the handler from being installed\n//\n// __fbUninstallRNGlobalErrorHandler is conditionally set by the Inspector while the VM is paused for intialization\n// If the Inspector isn't present it defaults to undefined and the global error handler is installed\n// The Inspector can still call MessageQueue#uninstallGlobalErrorHandler to uninstalled on attach\n\nconst BatchedBridge = new MessageQueue(\n  // $FlowFixMe\n  typeof __fbUninstallRNGlobalErrorHandler !== 'undefined' &&\n    __fbUninstallRNGlobalErrorHandler === true, // eslint-disable-line no-undef\n);\n\n// Wire up the batched bridge on the global object so that we can call into it.\n// Ideally, this would be the inverse relationship. I.e. the native environment\n// provides this global directly with its script embedded. Then this module\n// would export it. A possible fix would be to trim the dependencies in\n// MessageQueue to its minimal features and embed that in the native runtime.\n\nObject.defineProperty(global, '__fbBatchedBridge', {\n  configurable: true,\n  value: BatchedBridge,\n});\n\nmodule.exports = BatchedBridge;\n"
  },
  {
    "path": "Libraries/BatchedBridge/MessageQueue.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule MessageQueue\n * @flow\n * @format\n */\n\n'use strict';\n\nconst ErrorUtils = require('ErrorUtils');\nconst Systrace = require('Systrace');\n\nconst deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev');\nconst invariant = require('fbjs/lib/invariant');\nconst stringifySafe = require('stringifySafe');\n\nexport type SpyData = {\n  type: number,\n  module: ?string,\n  method: string | number,\n  args: any[],\n};\n\nconst TO_JS = 0;\nconst TO_NATIVE = 1;\n\nconst MODULE_IDS = 0;\nconst METHOD_IDS = 1;\nconst PARAMS = 2;\nconst MIN_TIME_BETWEEN_FLUSHES_MS = 5;\n\n// eslint-disable-next-line no-bitwise\nconst TRACE_TAG_REACT_APPS = 1 << 17;\n\nconst DEBUG_INFO_LIMIT = 32;\n\n// Work around an initialization order issue\nlet JSTimers = null;\n\nclass MessageQueue {\n  _lazyCallableModules: {[key: string]: (void) => Object};\n  _queue: [number[], number[], any[], number];\n  _successCallbacks: (?Function)[];\n  _failureCallbacks: (?Function)[];\n  _callID: number;\n  _inCall: number;\n  _lastFlush: number;\n  _eventLoopStartTime: number;\n\n  _debugInfo: {[number]: [number, number]};\n  _remoteModuleTable: {[number]: string};\n  _remoteMethodTable: {[number]: string[]};\n\n  __spy: ?(data: SpyData) => void;\n\n  __guard: (() => void) => void;\n\n  constructor(shouldUninstallGlobalErrorHandler: boolean = false) {\n    this._lazyCallableModules = {};\n    this._queue = [[], [], [], 0];\n    this._successCallbacks = [];\n    this._failureCallbacks = [];\n    this._callID = 0;\n    this._lastFlush = 0;\n    this._eventLoopStartTime = new Date().getTime();\n    if (shouldUninstallGlobalErrorHandler) {\n      this.uninstallGlobalErrorHandler();\n    } else {\n      this.installGlobalErrorHandler();\n    }\n\n    if (__DEV__) {\n      this._debugInfo = {};\n      this._remoteModuleTable = {};\n      this._remoteMethodTable = {};\n    }\n\n    (this: any).callFunctionReturnFlushedQueue = this.callFunctionReturnFlushedQueue.bind(\n      this,\n    );\n    (this: any).callFunctionReturnResultAndFlushedQueue = this.callFunctionReturnResultAndFlushedQueue.bind(\n      this,\n    );\n    (this: any).flushedQueue = this.flushedQueue.bind(this);\n    (this: any).invokeCallbackAndReturnFlushedQueue = this.invokeCallbackAndReturnFlushedQueue.bind(\n      this,\n    );\n  }\n\n  /**\n   * Public APIs\n   */\n\n  static spy(spyOrToggle: boolean | ((data: SpyData) => void)) {\n    if (spyOrToggle === true) {\n      MessageQueue.prototype.__spy = info => {\n        console.log(\n          `${info.type === TO_JS ? 'N->JS' : 'JS->N'} : ` +\n            `${info.module ? info.module + '.' : ''}${info.method}` +\n            `(${JSON.stringify(info.args)})`,\n        );\n      };\n    } else if (spyOrToggle === false) {\n      MessageQueue.prototype.__spy = null;\n    } else {\n      MessageQueue.prototype.__spy = spyOrToggle;\n    }\n  }\n\n  callFunctionReturnFlushedQueue(module: string, method: string, args: any[]) {\n    this.__guard(() => {\n      this.__callFunction(module, method, args);\n    });\n\n    return this.flushedQueue();\n  }\n\n  callFunctionReturnResultAndFlushedQueue(\n    module: string,\n    method: string,\n    args: any[],\n  ) {\n    let result;\n    this.__guard(() => {\n      result = this.__callFunction(module, method, args);\n    });\n\n    return [result, this.flushedQueue()];\n  }\n\n  invokeCallbackAndReturnFlushedQueue(cbID: number, args: any[]) {\n    this.__guard(() => {\n      this.__invokeCallback(cbID, args);\n    });\n\n    return this.flushedQueue();\n  }\n\n  flushedQueue() {\n    this.__guard(() => {\n      this.__callImmediates();\n    });\n\n    const queue = this._queue;\n    this._queue = [[], [], [], this._callID];\n    return queue[0].length ? queue : null;\n  }\n\n  getEventLoopRunningTime() {\n    return new Date().getTime() - this._eventLoopStartTime;\n  }\n\n  registerCallableModule(name: string, module: Object) {\n    this._lazyCallableModules[name] = () => module;\n  }\n\n  registerLazyCallableModule(name: string, factory: void => Object) {\n    let module: Object;\n    let getValue: ?(void) => Object = factory;\n    this._lazyCallableModules[name] = () => {\n      if (getValue) {\n        module = getValue();\n        getValue = null;\n      }\n      return module;\n    };\n  }\n\n  getCallableModule(name: string) {\n    const getValue = this._lazyCallableModules[name];\n    return getValue ? getValue() : null;\n  }\n\n  enqueueNativeCall(\n    moduleID: number,\n    methodID: number,\n    params: any[],\n    onFail: ?Function,\n    onSucc: ?Function,\n  ) {\n    if (onFail || onSucc) {\n      if (__DEV__) {\n        this._debugInfo[this._callID] = [moduleID, methodID];\n        if (this._callID > DEBUG_INFO_LIMIT) {\n          delete this._debugInfo[this._callID - DEBUG_INFO_LIMIT];\n        }\n      }\n      // Encode callIDs into pairs of callback identifiers by shifting left and using the rightmost bit\n      // to indicate fail (0) or success (1)\n      // eslint-disable-next-line no-bitwise\n      onFail && params.push(this._callID << 1);\n      // eslint-disable-next-line no-bitwise\n      onSucc && params.push((this._callID << 1) | 1);\n      this._successCallbacks[this._callID] = onSucc;\n      this._failureCallbacks[this._callID] = onFail;\n    }\n\n    if (__DEV__) {\n      global.nativeTraceBeginAsyncFlow &&\n        global.nativeTraceBeginAsyncFlow(\n          TRACE_TAG_REACT_APPS,\n          'native',\n          this._callID,\n        );\n    }\n    this._callID++;\n\n    this._queue[MODULE_IDS].push(moduleID);\n    this._queue[METHOD_IDS].push(methodID);\n\n    if (__DEV__) {\n      // Validate that parameters passed over the bridge are\n      // folly-convertible.  As a special case, if a prop value is a\n      // function it is permitted here, and special-cased in the\n      // conversion.\n      const seen = [];\n      const path = [];\n      const validate = (val, key) => {\n        if (val == null) {\n          return true;\n        }\n        if (key != null) {\n          path.push(key);\n        }\n        let valid = true;\n        let error = '';\n        switch (typeof val) {\n          case 'boolean':\n          case 'string':\n            break; // No error.\n          case 'number':\n            if (!isFinite(val)) {\n              error = 'Cannot serialize an infinite number';\n            }\n            break;\n          case 'bigint':\n          case 'function':\n          case 'symbol':\n            error = 'Cannot serialize a ' + typeof val;\n            break;\n          case 'object':\n            const seenIndex = seen.indexOf(val);\n            if (seenIndex >= 0) {\n              error = 'Cannot serialize the same object twice';\n              break;\n            }\n            seen.push(val);\n            valid = Array.isArray(val)\n              ? val.every(validate)\n              : Object.keys(val).every(k => validate(val[k], k));\n            break;\n        }\n        if (error) {\n          console.warn(\n            error + '\\nFound at this path: ',\n            path.slice(),\n            '\\nin this object: ',\n            params,\n          );\n        }\n        if (key != null) {\n          path.pop();\n        }\n        return valid && !error;\n      };\n\n      if (!validate(params)) {\n        console.warn(\n          'Native method call has arguments which cannot be serialized: %O',\n          params,\n        );\n      }\n\n      // The params object should not be mutated after being queued\n      deepFreezeAndThrowOnMutationInDev((params: any));\n    }\n    this._queue[PARAMS].push(params);\n\n    const now = new Date().getTime();\n    if (\n      global.nativeFlushQueueImmediate &&\n      (now - this._lastFlush >= MIN_TIME_BETWEEN_FLUSHES_MS ||\n        this._inCall === 0)\n    ) {\n      var queue = this._queue;\n      this._queue = [[], [], [], this._callID];\n      this._lastFlush = now;\n      global.nativeFlushQueueImmediate(queue);\n    }\n    Systrace.counterEvent('pending_js_to_native_queue', this._queue[0].length);\n    if (__DEV__ && this.__spy && isFinite(moduleID)) {\n      this.__spy({\n        type: TO_NATIVE,\n        module: this._remoteModuleTable[moduleID],\n        method: this._remoteMethodTable[moduleID][methodID],\n        args: params,\n      });\n    } else if (this.__spy) {\n      this.__spy({\n        type: TO_NATIVE,\n        module: moduleID + '',\n        method: methodID,\n        args: params,\n      });\n    }\n  }\n\n  createDebugLookup(moduleID: number, name: string, methods: string[]) {\n    if (__DEV__) {\n      this._remoteModuleTable[moduleID] = name;\n      this._remoteMethodTable[moduleID] = methods;\n    }\n  }\n\n  uninstallGlobalErrorHandler() {\n    this.__guard = this.__guardUnsafe;\n  }\n\n  installGlobalErrorHandler() {\n    this.__guard = this.__guardSafe;\n  }\n\n  /**\n   * Private methods\n   */\n\n  // Lets exceptions propagate to be handled by the VM at the origin\n  __guardUnsafe(fn: () => void) {\n    this._inCall++;\n    fn();\n    this._inCall--;\n  }\n\n  __guardSafe(fn: () => void) {\n    this._inCall++;\n    try {\n      fn();\n    } catch (error) {\n      ErrorUtils.reportFatalError(error);\n    } finally {\n      this._inCall--;\n    }\n  }\n\n  __callImmediates() {\n    Systrace.beginEvent('JSTimers.callImmediates()');\n    if (!JSTimers) {\n      JSTimers = require('JSTimers');\n    }\n    JSTimers.callImmediates();\n    Systrace.endEvent();\n  }\n\n  __callFunction(module: string, method: string, args: any[]): any {\n    this._lastFlush = new Date().getTime();\n    this._eventLoopStartTime = this._lastFlush;\n    Systrace.beginEvent(`${module}.${method}()`);\n    if (this.__spy) {\n      this.__spy({type: TO_JS, module, method, args});\n    }\n    const moduleMethods = this.getCallableModule(module);\n    invariant(\n      !!moduleMethods,\n      'Module %s is not a registered callable module (calling %s)',\n      module,\n      method,\n    );\n    invariant(\n      !!moduleMethods[method],\n      'Method %s does not exist on module %s',\n      method,\n      module,\n    );\n    const result = moduleMethods[method].apply(moduleMethods, args);\n    Systrace.endEvent();\n    return result;\n  }\n\n  __invokeCallback(cbID: number, args: any[]) {\n    this._lastFlush = new Date().getTime();\n    this._eventLoopStartTime = this._lastFlush;\n\n    // The rightmost bit of cbID indicates fail (0) or success (1), the other bits are the callID shifted left.\n    // eslint-disable-next-line no-bitwise\n    const callID = cbID >>> 1;\n    // eslint-disable-next-line no-bitwise\n    const isSuccess = cbID & 1;\n    const callback = isSuccess\n      ? this._successCallbacks[callID]\n      : this._failureCallbacks[callID];\n\n    if (__DEV__) {\n      const debug = this._debugInfo[callID];\n      const module = debug && this._remoteModuleTable[debug[0]];\n      const method = debug && this._remoteMethodTable[debug[0]][debug[1]];\n      if (!callback) {\n        let errorMessage = `Callback with id ${cbID}: ${module}.${method}() not found`;\n        if (method) {\n          errorMessage =\n            `The callback ${method}() exists in module ${module}, ` +\n            'but only one callback may be registered to a function in a native module.';\n        }\n        invariant(callback, errorMessage);\n      }\n      const profileName = debug\n        ? '<callback for ' + module + '.' + method + '>'\n        : cbID;\n      if (callback && this.__spy) {\n        this.__spy({type: TO_JS, module: null, method: profileName, args});\n      }\n      Systrace.beginEvent(\n        `MessageQueue.invokeCallback(${profileName}, ${stringifySafe(args)})`,\n      );\n    }\n\n    if (!callback) {\n      return;\n    }\n\n    this._successCallbacks[callID] = this._failureCallbacks[callID] = null;\n    callback(...args);\n\n    if (__DEV__) {\n      Systrace.endEvent();\n    }\n  }\n}\n\nmodule.exports = MessageQueue;\n"
  },
  {
    "path": "Libraries/BatchedBridge/NativeModules.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule NativeModules\n * @flow\n */\n'use strict';\n\nconst BatchedBridge = require('BatchedBridge');\nconst ExceptionsManager = require('ExceptionsManager');\n\nconst invariant = require('fbjs/lib/invariant');\n\nimport type {ExtendedError} from 'parseErrorStack';\n\ntype ModuleConfig = [\n  string, /* name */\n  ?Object, /* constants */\n  Array<string>, /* functions */\n  Array<number>, /* promise method IDs */\n  Array<number>, /* sync method IDs */\n];\n\nexport type MethodType = 'async' | 'promise' | 'sync';\n\nfunction genModule(config: ?ModuleConfig, moduleID: number): ?{name: string, module?: Object} {\n  if (!config) {\n    return null;\n  }\n\n  const [moduleName, constants, methods, promiseMethods, syncMethods] = config;\n  invariant(!moduleName.startsWith('RCT') && !moduleName.startsWith('RK'),\n    'Module name prefixes should\\'ve been stripped by the native side ' +\n    'but wasn\\'t for ' + moduleName);\n\n  if (!constants && !methods) {\n    // Module contents will be filled in lazily later\n    return { name: moduleName };\n  }\n\n  const module = {};\n  methods && methods.forEach((methodName, methodID) => {\n    const isPromise = promiseMethods && arrayContains(promiseMethods, methodID);\n    const isSync = syncMethods && arrayContains(syncMethods, methodID);\n    invariant(!isPromise || !isSync, 'Cannot have a method that is both async and a sync hook');\n    const methodType = isPromise ? 'promise' : isSync ? 'sync' : 'async';\n    module[methodName] = genMethod(moduleID, methodID, methodType);\n  });\n  Object.assign(module, constants);\n\n  if (__DEV__) {\n    BatchedBridge.createDebugLookup(moduleID, moduleName, methods);\n  }\n\n  return { name: moduleName, module };\n}\n\n// export this method as a global so we can call it from native\nglobal.__fbGenNativeModule = genModule;\n\nfunction loadModule(name: string, moduleID: number): ?Object {\n  invariant(global.nativeRequireModuleConfig,\n    'Can\\'t lazily create module without nativeRequireModuleConfig');\n  const config = global.nativeRequireModuleConfig(name);\n  const info = genModule(config, moduleID);\n  return info && info.module;\n}\n\nfunction genMethod(moduleID: number, methodID: number, type: MethodType) {\n  let fn = null;\n  if (type === 'promise') {\n    fn = function(...args: Array<any>) {\n      return new Promise((resolve, reject) => {\n        BatchedBridge.enqueueNativeCall(moduleID, methodID, args,\n          (data) => resolve(data),\n          (errorData) => reject(createErrorFromErrorData(errorData)));\n      });\n    };\n  } else if (type === 'sync') {\n    fn = function(...args: Array<any>) {\n      if (__DEV__) {\n        invariant(global.nativeCallSyncHook, 'Calling synchronous methods on native ' +\n          'modules is not supported in Chrome.\\n\\n Consider providing alternative ' +\n          'methods to expose this method in debug mode, e.g. by exposing constants ' +\n          'ahead-of-time.');\n      }\n      return global.nativeCallSyncHook(moduleID, methodID, args);\n    };\n  } else {\n    fn = function(...args: Array<any>) {\n      const lastArg = args.length > 0 ? args[args.length - 1] : null;\n      const secondLastArg = args.length > 1 ? args[args.length - 2] : null;\n      const hasSuccessCallback = typeof lastArg === 'function';\n      const hasErrorCallback = typeof secondLastArg === 'function';\n      hasErrorCallback && invariant(\n        hasSuccessCallback,\n        'Cannot have a non-function arg after a function arg.'\n      );\n      const onSuccess = hasSuccessCallback ? lastArg : null;\n      const onFail = hasErrorCallback ? secondLastArg : null;\n      const callbackCount = hasSuccessCallback + hasErrorCallback;\n      args = args.slice(0, args.length - callbackCount);\n      try {\n        BatchedBridge.enqueueNativeCall(moduleID, methodID, args, onFail, onSuccess);\n      } catch(e) {\n        ExceptionsManager.handleException(e, true);\n      }\n    };\n  }\n  fn.type = type;\n  return fn;\n}\n\nfunction arrayContains<T>(array: Array<T>, value: T): boolean {\n  return array.indexOf(value) !== -1;\n}\n\nfunction createErrorFromErrorData(errorData: {message: string}): ExtendedError {\n  const {\n    message,\n    ...extraErrorInfo\n  } = errorData || {};\n  const error : ExtendedError = new Error(message);\n  error.framesToPop = 1;\n  return Object.assign(error, extraErrorInfo);\n}\n\nlet NativeModules : {[moduleName: string]: Object} = {};\nif (global.nativeModuleProxy) {\n  NativeModules = global.nativeModuleProxy;\n} else {\n  const bridgeConfig = global.__fbBatchedBridgeConfig;\n  invariant(bridgeConfig, '__fbBatchedBridgeConfig is not set, cannot invoke native modules');\n\n  const defineLazyObjectProperty = require('defineLazyObjectProperty');\n  (bridgeConfig.remoteModuleConfig || []).forEach((config: ModuleConfig, moduleID: number) => {\n    // Initially this config will only contain the module name when running in JSC. The actual\n    // configuration of the module will be lazily loaded.\n    const info = genModule(config, moduleID);\n    if (!info) {\n      return;\n    }\n\n    if (info.module) {\n      NativeModules[info.name] = info.module;\n    }\n    // If there's no module config, define a lazy getter\n    else {\n      defineLazyObjectProperty(NativeModules, info.name, {\n        get: () => loadModule(info.name, moduleID)\n      });\n    }\n  });\n}\n\nmodule.exports = NativeModules;\n"
  },
  {
    "path": "Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * These don't actually exist anywhere in the code.\n */\n'use strict';\nvar remoteModulesConfig = [\n  ['RemoteModule1',null,['remoteMethod','promiseMethod'],[]],\n  ['RemoteModule2',null,['remoteMethod','promiseMethod'],[]],\n];\n\nvar MessageQueueTestConfig = {\n  remoteModuleConfig: remoteModulesConfig,\n};\n\nmodule.exports = MessageQueueTestConfig;\n"
  },
  {
    "path": "Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n'use strict';\n\n/**\n * Dummy module that only exists for the sake of proving that the message queue\n * correctly dispatches to commonJS modules. The `testHook` is overriden by test\n * cases.\n */\nvar MessageQueueTestModule = {\n  testHook1: function() {\n  },\n  testHook2: function() {\n  }\n};\n\nmodule.exports = MessageQueueTestModule;\n"
  },
  {
    "path": "Libraries/BatchedBridge/__tests__/MessageQueue-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n * @format\n */\n'use strict';\n\nlet MessageQueue;\nlet MessageQueueTestModule;\nlet queue;\n\nconst MODULE_IDS = 0;\nconst METHOD_IDS = 1;\nconst PARAMS = 2;\n\nconst assertQueue = (flushedQueue, index, moduleID, methodID, params) => {\n  expect(flushedQueue[MODULE_IDS][index]).toEqual(moduleID);\n  expect(flushedQueue[METHOD_IDS][index]).toEqual(methodID);\n  expect(flushedQueue[PARAMS][index]).toEqual(params);\n};\n\n// Important things to test:\n//\n// [x] Local modules can be invoked through the queue.\n//\n// [ ] Local modules that throw exceptions are gracefully caught. In that case\n// local callbacks stored by IDs are cleaned up.\ndescribe('MessageQueue', function() {\n  beforeEach(function() {\n    jest.resetModules();\n    MessageQueue = require('MessageQueue');\n    MessageQueueTestModule = require('MessageQueueTestModule');\n    queue = new MessageQueue();\n    queue.registerCallableModule(\n      'MessageQueueTestModule',\n      MessageQueueTestModule,\n    );\n    queue.createDebugLookup(0, 'MessageQueueTestModule', [\n      'testHook1',\n      'testHook2',\n    ]);\n  });\n\n  it('should enqueue native calls', () => {\n    queue.enqueueNativeCall(0, 1, [2]);\n    const flushedQueue = queue.flushedQueue();\n    assertQueue(flushedQueue, 0, 0, 1, [2]);\n  });\n\n  it('should call a local function with the function name', () => {\n    MessageQueueTestModule.testHook2 = jest.fn();\n    expect(MessageQueueTestModule.testHook2.mock.calls.length).toEqual(0);\n    queue.__callFunction('MessageQueueTestModule', 'testHook2', [2]);\n    expect(MessageQueueTestModule.testHook2.mock.calls.length).toEqual(1);\n  });\n\n  it('should store callbacks', () => {\n    queue.enqueueNativeCall(0, 1, ['foo'], null, null);\n    const flushedQueue = queue.flushedQueue();\n    assertQueue(flushedQueue, 0, 0, 1, ['foo']);\n  });\n\n  it('should call the stored callback', () => {\n    let done = false;\n    queue.enqueueNativeCall(\n      0,\n      1,\n      [],\n      () => {},\n      () => {\n        done = true;\n      },\n    );\n    queue.__invokeCallback(1, []);\n    expect(done).toEqual(true);\n  });\n\n  it('should throw when calling the same callback twice', () => {\n    queue.enqueueNativeCall(0, 1, [], () => {}, () => {});\n    queue.__invokeCallback(1, []);\n    expect(() => queue.__invokeCallback(1, [])).toThrow();\n  });\n\n  it('should throw when calling both success and failure callback', () => {\n    queue.enqueueNativeCall(0, 1, [], () => {}, () => {});\n    queue.__invokeCallback(1, []);\n    expect(() => queue.__invokeCallback(0, [])).toThrow();\n  });\n\n  it('should throw when calling with unknown module', () => {\n    const unknownModule = 'UnknownModule',\n      unknownMethod = 'UnknownMethod';\n    expect(() => queue.__callFunction(unknownModule, unknownMethod)).toThrow(\n      `Module ${unknownModule} is not a registered callable module (calling ${unknownMethod})`,\n    );\n  });\n\n  it('should return lazily registered module', () => {\n    const dummyModule = {},\n      name = 'modulesName';\n    queue.registerLazyCallableModule(name, () => dummyModule);\n\n    expect(queue.getCallableModule(name)).toEqual(dummyModule);\n  });\n\n  it('should not initialize lazily registered module before it was used for the first time', () => {\n    const dummyModule = {},\n      name = 'modulesName';\n    const factory = jest.fn(() => dummyModule);\n    queue.registerLazyCallableModule(name, factory);\n    expect(factory).not.toHaveBeenCalled();\n  });\n\n  it('should initialize lazily registered module only once', () => {\n    const dummyModule = {},\n      name = 'modulesName';\n    const factory = jest.fn(() => dummyModule);\n    queue.registerLazyCallableModule(name, factory);\n    queue.getCallableModule(name);\n    queue.getCallableModule(name);\n    expect(factory).toHaveBeenCalledTimes(1);\n  });\n\n  it('should catch all exceptions if the global error handler is installed', () => {\n    const errorMessage = 'intentional error';\n    const errorModule = {\n      explode: function() {\n        throw new Error(errorMessage);\n      },\n    };\n    const name = 'errorModuleName';\n    const factory = jest.fn(() => errorModule);\n    queue.__guardSafe = jest.fn(() => {});\n    queue.__guardUnsafe = jest.fn(() => {});\n    queue.installGlobalErrorHandler();\n    queue.registerLazyCallableModule(name, factory);\n    queue.callFunctionReturnFlushedQueue(name, 'explode', []);\n    expect(queue.__guardUnsafe).toHaveBeenCalledTimes(0);\n    expect(queue.__guardSafe).toHaveBeenCalledTimes(2);\n  });\n\n  it('should propagate exceptions if the global error handler is uninstalled', () => {\n    queue.uninstallGlobalErrorHandler();\n    const errorMessage = 'intentional error';\n    const errorModule = {\n      explode: function() {\n        throw new Error(errorMessage);\n      },\n    };\n    const name = 'errorModuleName';\n    const factory = jest.fn(() => errorModule);\n    queue.__guardUnsafe = jest.fn(() => {});\n    queue.__guardSafe = jest.fn(() => {});\n    queue.registerLazyCallableModule(name, factory);\n    queue.uninstallGlobalErrorHandler();\n    queue.callFunctionReturnFlushedQueue(name, 'explode');\n    expect(queue.__guardUnsafe).toHaveBeenCalledTimes(2);\n    expect(queue.__guardSafe).toHaveBeenCalledTimes(0);\n  });\n\n  it('should catch all exceptions if the global error handler is re-installed', () => {\n    const errorMessage = 'intentional error';\n    const errorModule = {\n      explode: function() {\n        throw new Error(errorMessage);\n      },\n    };\n    const name = 'errorModuleName';\n    const factory = jest.fn(() => errorModule);\n    queue.__guardUnsafe = jest.fn(() => {});\n    queue.__guardSafe = jest.fn(() => {});\n    queue.registerLazyCallableModule(name, factory);\n    queue.uninstallGlobalErrorHandler();\n    queue.installGlobalErrorHandler();\n    queue.callFunctionReturnFlushedQueue(name, 'explode');\n    expect(queue.__guardUnsafe).toHaveBeenCalledTimes(0);\n    expect(queue.__guardSafe).toHaveBeenCalledTimes(2);\n  });\n});\n"
  },
  {
    "path": "Libraries/BatchedBridge/__tests__/NativeModules-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\njest\n  .enableAutomock()\n  .unmock('BatchedBridge')\n  .unmock('defineLazyObjectProperty')\n  .unmock('MessageQueue')\n  .unmock('NativeModules');\n\nlet BatchedBridge;\nlet NativeModules;\n\nconst MODULE_IDS = 0;\nconst METHOD_IDS = 1;\nconst PARAMS = 2;\nconst CALL_ID = 3;\n\nconst assertQueue = (flushedQueue, index, moduleID, methodID, params) => {\n  expect(flushedQueue[MODULE_IDS][index]).toEqual(moduleID);\n  expect(flushedQueue[METHOD_IDS][index]).toEqual(methodID);\n  expect(flushedQueue[PARAMS][index]).toEqual(params);\n};\n\n// Important things to test:\n//\n// [x] Calling remote method actually queues it up on the BatchedBridge\n//\n// [x] Both error and success callbacks are invoked.\n//\n// [x] When simulating an error callback from remote method, both error and\n// success callbacks are cleaned up.\n//\n// [ ] Remote invocation throws if not supplying an error callback.\ndescribe('MessageQueue', function() {\n  beforeEach(function() {\n    jest.resetModules();\n\n    global.__fbBatchedBridgeConfig = require('MessageQueueTestConfig');\n    BatchedBridge = require('BatchedBridge');\n    NativeModules = require('NativeModules');\n  });\n\n  it('should generate native modules', () => {\n    NativeModules.RemoteModule1.remoteMethod('foo');\n    const flushedQueue = BatchedBridge.flushedQueue();\n    assertQueue(flushedQueue, 0, 0, 0, ['foo']);\n  });\n\n  it('should make round trip and clear memory', function() {\n    const onFail = jest.fn();\n    const onSucc = jest.fn();\n\n    // Perform communication\n    NativeModules.RemoteModule1.promiseMethod('paloAlto', 'menloPark', onFail, onSucc);\n    NativeModules.RemoteModule2.promiseMethod('mac', 'windows', onFail, onSucc);\n\n    const resultingRemoteInvocations = BatchedBridge.flushedQueue();\n\n    // As always, the message queue has four fields\n    expect(resultingRemoteInvocations.length).toBe(4);\n    expect(resultingRemoteInvocations[MODULE_IDS].length).toBe(2);\n    expect(resultingRemoteInvocations[METHOD_IDS].length).toBe(2);\n    expect(resultingRemoteInvocations[PARAMS].length).toBe(2);\n    expect(typeof resultingRemoteInvocations[CALL_ID]).toEqual('number');\n\n    expect(resultingRemoteInvocations[0][0]).toBe(0); // `RemoteModule1`\n    expect(resultingRemoteInvocations[1][0]).toBe(1); // `promiseMethod`\n    expect([                                          // the arguments\n      resultingRemoteInvocations[2][0][0],\n      resultingRemoteInvocations[2][0][1]\n    ]).toEqual(['paloAlto', 'menloPark']);\n    // Callbacks ids are tacked onto the end of the remote arguments.\n    const firstFailCBID = resultingRemoteInvocations[2][0][2];\n    const firstSuccCBID = resultingRemoteInvocations[2][0][3];\n\n    expect(resultingRemoteInvocations[0][1]).toBe(1); // `RemoteModule2`\n    expect(resultingRemoteInvocations[1][1]).toBe(1); // `promiseMethod`\n    expect([                                          // the arguments\n      resultingRemoteInvocations[2][1][0],\n      resultingRemoteInvocations[2][1][1]\n    ]).toEqual(['mac', 'windows']);\n    const secondFailCBID = resultingRemoteInvocations[2][1][2];\n    const secondSuccCBID = resultingRemoteInvocations[2][1][3];\n\n    // Handle the first remote invocation by signaling failure.\n    BatchedBridge.__invokeCallback(firstFailCBID, ['firstFailure']);\n    // The failure callback was already invoked, the success is no longer valid\n    expect(function() {\n      BatchedBridge.__invokeCallback(firstSuccCBID, ['firstSucc']);\n    }).toThrow();\n    expect(onFail.mock.calls.length).toBe(1);\n    expect(onSucc.mock.calls.length).toBe(0);\n\n    // Handle the second remote invocation by signaling success.\n    BatchedBridge.__invokeCallback(secondSuccCBID, ['secondSucc']);\n    // The success callback was already invoked, the fail cb is no longer valid\n    expect(function() {\n      BatchedBridge.__invokeCallback(secondFailCBID, ['secondFail']);\n    }).toThrow();\n    expect(onFail.mock.calls.length).toBe(1);\n    expect(onSucc.mock.calls.length).toBe(1);\n  });\n});\n"
  },
  {
    "path": "Libraries/Blob/Blob.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Blob\n * @flow\n */\n\n'use strict';\n\nconst invariant = require('fbjs/lib/invariant');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst uuid = require('uuid');\n\nconst { BlobModule } = require('NativeModules');\n\nimport type { BlobProps } from 'BlobTypes';\n\n/**\n * Opaque JS representation of some binary data in native.\n *\n * The API is modeled after the W3C Blob API, with one caveat\n * regarding explicit deallocation. Refer to the `close()`\n * method for further details.\n *\n * Example usage in a React component:\n *\n *   class WebSocketImage extends React.Component {\n *      state = {blob: null};\n *      componentDidMount() {\n *        let ws = this.ws = new WebSocket(...);\n *        ws.binaryType = 'blob';\n *        ws.onmessage = (event) => {\n *          if (this.state.blob) {\n *            this.state.blob.close();\n *          }\n *          this.setState({blob: event.data});\n *        };\n *      }\n *      componentUnmount() {\n *        if (this.state.blob) {\n *          this.state.blob.close();\n *        }\n *        this.ws.close();\n *      }\n *      render() {\n *        if (!this.state.blob) {\n *          return <View />;\n *        }\n *        return <Image source={{uri: URL.createObjectURL(this.state.blob)}} />;\n *      }\n *   }\n *\n * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob\n */\nclass Blob {\n  /**\n   * Size of the data contained in the Blob object, in bytes.\n   */\n  size: number;\n  /*\n   * String indicating the MIME type of the data contained in the Blob.\n   * If the type is unknown, this string is empty.\n   */\n  type: string;\n\n  /*\n   * Unique id to identify the blob on native side (non-standard)\n   */\n  blobId: string;\n  /*\n   * Offset to indicate part of blob, used when sliced (non-standard)\n   */\n  offset: number;\n\n  /**\n   * Construct blob instance from blob data from native.\n   * Used internally by modules like XHR, WebSocket, etc.\n   */\n  static create(props: BlobProps): Blob {\n    return Object.assign(Object.create(Blob.prototype), props);\n  }\n\n  /**\n   * Constructor for JS consumers.\n   * Currently we only support creating Blobs from other Blobs.\n   * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob\n   */\n  constructor(parts: Array<Blob>, options: any) {\n    const blobId = uuid();\n    let size = 0;\n    parts.forEach((part) => {\n      invariant(part instanceof Blob, 'Can currently only create a Blob from other Blobs');\n      size += part.size;\n    });\n    BlobModule.createFromParts(parts, blobId);\n    return Blob.create({\n      blobId,\n      offset: 0,\n      size,\n    });\n  }\n\n  /*\n   * This method is used to create a new Blob object containing\n   * the data in the specified range of bytes of the source Blob.\n   * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice\n   */\n  slice(start?: number, end?: number): Blob {\n    let offset = this.offset;\n    let size = this.size;\n    if (typeof start === 'number') {\n      if (start > size) {\n        start = size;\n      }\n      offset += start;\n      size -= start;\n\n      if (typeof end === 'number') {\n        if (end < 0) {\n          end = this.size + end;\n        }\n        size = end - start;\n      }\n    }\n    return Blob.create({\n      blobId: this.blobId,\n      offset,\n      size,\n    });\n  }\n\n  /**\n   * This method is in the standard, but not actually implemented by\n   * any browsers at this point. It's important for how Blobs work in\n   * React Native, however, since we cannot de-allocate resources automatically,\n   * so consumers need to explicitly de-allocate them.\n   *\n   * Note that the semantics around Blobs created via `blob.slice()`\n   * and `new Blob([blob])` are different. `blob.slice()` creates a\n   * new *view* onto the same binary data, so calling `close()` on any\n   * of those views is enough to deallocate the data, whereas\n   * `new Blob([blob, ...])` actually copies the data in memory.\n   */\n  close() {\n    BlobModule.release(this.blobId);\n  }\n}\n\nmodule.exports = Blob;\n"
  },
  {
    "path": "Libraries/Blob/BlobTypes.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BlobTypes\n * @flow\n */\n\n'use strict';\n\nexport type BlobProps = {\n  blobId: string,\n  offset: number,\n  size: number,\n  type?: string,\n};\n\nexport type FileProps = BlobProps & {\n  name: string,\n  lastModified: number,\n};\n"
  },
  {
    "path": "Libraries/Blob/RCTBlob.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\tAD0871131E215B28007D136D /* RCTBlobManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = AD9A43C11DFC7126008DC588 /* RCTBlobManager.h */; };\n\t\tAD0871161E215EC9007D136D /* RCTBlobManager.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9A43C11DFC7126008DC588 /* RCTBlobManager.h */; };\n\t\tAD0871181E215ED1007D136D /* RCTBlobManager.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9A43C11DFC7126008DC588 /* RCTBlobManager.h */; };\n\t\tAD08711A1E2162C8007D136D /* RCTBlobManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = AD9A43C11DFC7126008DC588 /* RCTBlobManager.h */; };\n\t\tAD9A43C31DFC7126008DC588 /* RCTBlobManager.m in Sources */ = {isa = PBXBuildFile; fileRef = AD9A43C21DFC7126008DC588 /* RCTBlobManager.m */; };\n\t\tADD01A711E09404A00F6D226 /* RCTBlobManager.m in Sources */ = {isa = PBXBuildFile; fileRef = AD9A43C21DFC7126008DC588 /* RCTBlobManager.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t358F4ED51D1E81A9004DF814 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/RCTBlob;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\tAD08711A1E2162C8007D136D /* RCTBlobManager.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tAD0871121E215B16007D136D /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/RCTBlob;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\tAD0871131E215B28007D136D /* RCTBlobManager.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t358F4ED71D1E81A9004DF814 /* libRCTBlob.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTBlob.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tAD9A43C11DFC7126008DC588 /* RCTBlobManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBlobManager.h; sourceTree = \"<group>\"; };\n\t\tAD9A43C21DFC7126008DC588 /* RCTBlobManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBlobManager.m; sourceTree = \"<group>\"; };\n\t\tADD01A681E09402E00F6D226 /* libRCTBlob-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libRCTBlob-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n/* End PBXFileReference section */\n\n/* Begin PBXGroup section */\n\t\t358F4ECE1D1E81A9004DF814 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tAD9A43C11DFC7126008DC588 /* RCTBlobManager.h */,\n\t\t\t\tAD9A43C21DFC7126008DC588 /* RCTBlobManager.m */,\n\t\t\t\t358F4ED81D1E81A9004DF814 /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t358F4ED81D1E81A9004DF814 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t358F4ED71D1E81A9004DF814 /* libRCTBlob.a */,\n\t\t\t\tADD01A681E09402E00F6D226 /* libRCTBlob-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\tAD0871151E215EB7007D136D /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tAD0871161E215EC9007D136D /* RCTBlobManager.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tAD0871171E215ECC007D136D /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tAD0871181E215ED1007D136D /* RCTBlobManager.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t358F4ED61D1E81A9004DF814 /* RCTBlob */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 358F4EE01D1E81A9004DF814 /* Build configuration list for PBXNativeTarget \"RCTBlob\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tAD0871151E215EB7007D136D /* Headers */,\n\t\t\t\t358F4ED51D1E81A9004DF814 /* Copy Headers */,\n\t\t\t\t358F4ED31D1E81A9004DF814 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTBlob;\n\t\t\tproductName = SLKBlobs;\n\t\t\tproductReference = 358F4ED71D1E81A9004DF814 /* libRCTBlob.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tADD01A671E09402E00F6D226 /* RCTBlob-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = ADD01A6E1E09402E00F6D226 /* Build configuration list for PBXNativeTarget \"RCTBlob-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tAD0871171E215ECC007D136D /* Headers */,\n\t\t\t\tAD0871121E215B16007D136D /* Copy Headers */,\n\t\t\t\tADD01A641E09402E00F6D226 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"RCTBlob-tvOS\";\n\t\t\tproductName = \"RCTBlob-tvOS\";\n\t\t\tproductReference = ADD01A681E09402E00F6D226 /* libRCTBlob-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t358F4ECF1D1E81A9004DF814 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0730;\n\t\t\t\tORGANIZATIONNAME = \"Silk Labs\";\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t358F4ED61D1E81A9004DF814 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 7.3;\n\t\t\t\t\t};\n\t\t\t\t\tADD01A671E09402E00F6D226 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.2;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 358F4ED21D1E81A9004DF814 /* Build configuration list for PBXProject \"RCTBlob\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 358F4ECE1D1E81A9004DF814;\n\t\t\tproductRefGroup = 358F4ED81D1E81A9004DF814 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t358F4ED61D1E81A9004DF814 /* RCTBlob */,\n\t\t\t\tADD01A671E09402E00F6D226 /* RCTBlob-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t358F4ED31D1E81A9004DF814 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tAD9A43C31DFC7126008DC588 /* RCTBlobManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tADD01A641E09402E00F6D226 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tADD01A711E09404A00F6D226 /* RCTBlobManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t358F4EDE1D1E81A9004DF814 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t358F4EDF1D1E81A9004DF814 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t358F4EE11D1E81A9004DF814 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t358F4EE21D1E81A9004DF814 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tADD01A6F1E09402E00F6D226 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 10.1;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tADD01A701E09402E00F6D226 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 10.1;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t358F4ED21D1E81A9004DF814 /* Build configuration list for PBXProject \"RCTBlob\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t358F4EDE1D1E81A9004DF814 /* Debug */,\n\t\t\t\t358F4EDF1D1E81A9004DF814 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t358F4EE01D1E81A9004DF814 /* Build configuration list for PBXNativeTarget \"RCTBlob\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t358F4EE11D1E81A9004DF814 /* Debug */,\n\t\t\t\t358F4EE21D1E81A9004DF814 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tADD01A6E1E09402E00F6D226 /* Build configuration list for PBXNativeTarget \"RCTBlob-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tADD01A6F1E09402E00F6D226 /* Debug */,\n\t\t\t\tADD01A701E09402E00F6D226 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 358F4ECF1D1E81A9004DF814 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/Blob/RCTBlobManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridge.h>\n#import <React/RCTBridgeModule.h>\n#import <React/RCTURLRequestHandler.h>\n\n@interface RCTBlobManager : NSObject <RCTBridgeModule, RCTURLRequestHandler>\n\n@end\n"
  },
  {
    "path": "Libraries/Blob/RCTBlobManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTBlobManager.h\"\n\n#import <React/RCTConvert.h>\n#import <React/RCTWebSocketModule.h>\n\nstatic NSString *const kBlobUriScheme = @\"blob\";\n\n@interface _RCTBlobContentHandler : NSObject <RCTWebSocketContentHandler>\n\n- (instancetype)initWithBlobManager:(RCTBlobManager *)blobManager;\n\n@end\n\n\n@implementation RCTBlobManager\n{\n  NSMutableDictionary<NSString *, NSData *> *_blobs;\n  _RCTBlobContentHandler *_contentHandler;\n  NSOperationQueue *_queue;\n}\n\nRCT_EXPORT_MODULE(BlobModule)\n\n@synthesize bridge = _bridge;\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return NO;\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  return @{\n    @\"BLOB_URI_SCHEME\": kBlobUriScheme,\n    @\"BLOB_URI_HOST\": [NSNull null],\n  };\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  return [[_bridge webSocketModule] methodQueue];\n}\n\n- (NSString *)store:(NSData *)data\n{\n  NSString *blobId = [NSUUID UUID].UUIDString;\n  [self store:data withId:blobId];\n  return blobId;\n}\n\n- (void)store:(NSData *)data withId:(NSString *)blobId\n{\n  if (!_blobs) {\n    _blobs = [NSMutableDictionary new];\n  }\n\n  _blobs[blobId] = data;\n}\n\n- (NSData *)resolve:(NSDictionary<NSString *, id> *)blob\n{\n  NSString *blobId = [RCTConvert NSString:blob[@\"blobId\"]];\n  NSNumber *offset = [RCTConvert NSNumber:blob[@\"offset\"]];\n  NSNumber *size = [RCTConvert NSNumber:blob[@\"size\"]];\n\n  return [self resolve:blobId\n                offset:offset ? [offset integerValue] : 0\n                  size:size ? [size integerValue] : -1];\n}\n\n- (NSData *)resolve:(NSString *)blobId offset:(NSInteger)offset size:(NSInteger)size\n{\n  NSData *data = _blobs[blobId];\n  if (!data) {\n    return nil;\n  }\n  if (offset != 0 || (size != -1 && size != data.length)) {\n    data = [data subdataWithRange:NSMakeRange(offset, size)];\n  }\n  return data;\n}\n\nRCT_EXPORT_METHOD(enableBlobSupport:(nonnull NSNumber *)socketID)\n{\n  if (!_contentHandler) {\n    _contentHandler = [[_RCTBlobContentHandler alloc] initWithBlobManager:self];\n  }\n  [[_bridge webSocketModule] setContentHandler:_contentHandler forSocketID:socketID];\n}\n\nRCT_EXPORT_METHOD(disableBlobSupport:(nonnull NSNumber *)socketID)\n{\n  [[_bridge webSocketModule] setContentHandler:nil forSocketID:socketID];\n}\n\nRCT_EXPORT_METHOD(sendBlob:(NSDictionary *)blob socketID:(nonnull NSNumber *)socketID)\n{\n  [[_bridge webSocketModule] sendData:[self resolve:blob] forSocketID:socketID];\n}\n\nRCT_EXPORT_METHOD(createFromParts:(NSArray<NSDictionary<NSString *, id> *> *)parts withId:(NSString *)blobId)\n{\n  NSMutableData *data = [NSMutableData new];\n  for (NSDictionary<NSString *, id> *part in parts) {\n    NSData *partData = [self resolve:part];\n    [data appendData:partData];\n  }\n  [self store:data withId:blobId];\n}\n\nRCT_EXPORT_METHOD(release:(NSString *)blobId)\n{\n  [_blobs removeObjectForKey:blobId];\n}\n\n#pragma mark - RCTURLRequestHandler methods\n\n- (BOOL)canHandleRequest:(NSURLRequest *)request\n{\n  return [request.URL.scheme caseInsensitiveCompare:kBlobUriScheme] == NSOrderedSame;\n}\n\n- (id)sendRequest:(NSURLRequest *)request withDelegate:(id<RCTURLRequestDelegate>)delegate\n{\n  // Lazy setup\n  if (!_queue) {\n    _queue = [NSOperationQueue new];\n    _queue.maxConcurrentOperationCount = 2;\n  }\n\n  __weak __block NSBlockOperation *weakOp;\n  __block NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{\n    NSURLResponse *response = [[NSURLResponse alloc] initWithURL:request.URL\n                                                        MIMEType:nil\n                                           expectedContentLength:-1\n                                                textEncodingName:nil];\n\n    [delegate URLRequest:weakOp didReceiveResponse:response];\n\n    NSURLComponents *components = [[NSURLComponents alloc] initWithURL:request.URL resolvingAgainstBaseURL:NO];\n\n    NSString *blobId = components.path;\n    NSInteger offset = 0;\n    NSInteger size = -1;\n\n    if (components.queryItems) {\n      for (NSURLQueryItem *queryItem in components.queryItems) {\n        if ([queryItem.name isEqualToString:@\"offset\"]) {\n          offset = [queryItem.value integerValue];\n        }\n        if ([queryItem.name isEqualToString:@\"size\"]) {\n          size = [queryItem.value integerValue];\n        }\n      }\n    }\n\n    NSData *data;\n    if (blobId) {\n      data = [self resolve:blobId offset:offset size:size];\n    }\n    NSError *error;\n    if (data) {\n      [delegate URLRequest:weakOp didReceiveData:data];\n    } else {\n      error = [[NSError alloc] initWithDomain:NSURLErrorDomain code:NSURLErrorBadURL userInfo:nil];\n    }\n    [delegate URLRequest:weakOp didCompleteWithError:error];\n  }];\n\n  weakOp = op;\n  [_queue addOperation:op];\n  return op;\n}\n\n- (void)cancelRequest:(NSOperation *)op\n{\n  [op cancel];\n}\n\n@end\n\n@implementation _RCTBlobContentHandler {\n  __weak RCTBlobManager *_blobManager;\n}\n\n- (instancetype)initWithBlobManager:(RCTBlobManager *)blobManager\n{\n  if (self = [super init]) {\n    _blobManager = blobManager;\n  }\n  return self;\n}\n\n- (id)processMessage:(id)message forSocketID:(NSNumber *)socketID withType:(NSString *__autoreleasing _Nonnull *)type\n{\n  if (![message isKindOfClass:[NSData class]]) {\n    *type = @\"text\";\n    return message;\n  }\n\n  *type = @\"blob\";\n  return @{\n     @\"blobId\": [_blobManager store:message],\n     @\"offset\": @0,\n     @\"size\": @(((NSData *)message).length),\n   };\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Blob/URL.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule URL\n * @format\n * @flow\n */\n\n'use strict';\n\nconst Blob = require('Blob');\n\nconst {BlobModule} = require('NativeModules');\n\nlet BLOB_URL_PREFIX = null;\n\nif (BlobModule && typeof BlobModule.BLOB_URI_SCHEME === 'string') {\n  BLOB_URL_PREFIX = BlobModule.BLOB_URI_SCHEME + ':';\n  if (typeof BlobModule.BLOB_URI_HOST === 'string') {\n    BLOB_URL_PREFIX += `//${BlobModule.BLOB_URI_HOST}/`;\n  }\n}\n\n/**\n * To allow Blobs be accessed via `content://` URIs,\n * you need to register `BlobProvider` as a ContentProvider in your app's `AndroidManifest.xml`:\n *\n * ```xml\n * <manifest>\n *   <application>\n *     <provider\n *       android:name=\"com.facebook.react.modules.blob.BlobProvider\"\n *       android:authorities=\"@string/blob_provider_authority\"\n *       android:exported=\"false\"\n *     />\n *   </application>\n * </manifest>\n * ```\n * And then define the `blob_provider_authority` string in `res/values/strings.xml`.\n * Use a dotted name that's entirely unique to your app:\n *\n * ```xml\n * <resources>\n *   <string name=\"blob_provider_authority\">your.app.package.blobs</string>\n * </resources>\n * ```\n */\nclass URL {\n  constructor() {\n    throw new Error('Creating BlobURL objects is not supported yet.');\n  }\n\n  static createObjectURL(blob: Blob) {\n    if (BLOB_URL_PREFIX === null) {\n      throw new Error('Cannot create URL for blob!');\n    }\n    return `${BLOB_URL_PREFIX}${blob.blobId}?offset=${blob.offset}&size=${\n      blob.size\n    }`;\n  }\n\n  static revokeObjectURL(url: string) {\n    // Do nothing.\n  }\n}\n\nmodule.exports = URL;\n"
  },
  {
    "path": "Libraries/BugReporting/BugReporting.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BugReporting\n * @flow\n */\n'use strict';\n\nconst RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\nconst Map = require('Map');\nconst infoLog = require('infoLog');\n\nimport type EmitterSubscription from 'EmitterSubscription';\n\ntype ExtraData = { [key: string]: string };\ntype SourceCallback = () => string;\ntype DebugData = { extras: ExtraData, files: ExtraData };\n\nfunction defaultExtras() {\n  BugReporting.addFileSource('react_hierarchy.txt', () => require('dumpReactTree')());\n}\n\n/**\n * A simple class for collecting bug report data. Components can add sources that will be queried when a bug report\n * is created via `collectExtraData`. For example, a list component might add a source that provides the list of rows\n * that are currently visible on screen. Components should also remember to call `remove()` on the object that is\n * returned by `addSource` when they are unmounted.\n */\nclass BugReporting {\n  static _extraSources: Map<string, SourceCallback> = new Map();\n  static _fileSources: Map<string, SourceCallback> = new Map();\n  static _subscription: ?EmitterSubscription = null;\n  static _redboxSubscription: ?EmitterSubscription = null;\n\n  static _maybeInit() {\n    if (!BugReporting._subscription) {\n      BugReporting._subscription = RCTDeviceEventEmitter\n          .addListener('collectBugExtraData', BugReporting.collectExtraData, null);\n      defaultExtras();\n    }\n\n    if (!BugReporting._redboxSubscription) {\n      BugReporting._redboxSubscription = RCTDeviceEventEmitter\n          .addListener('collectRedBoxExtraData', BugReporting.collectExtraData, null);\n    }\n  }\n\n  /**\n   * Maps a string key to a simple callback that should return a string payload to be attached\n   * to a bug report. Source callbacks are called when `collectExtraData` is called.\n   *\n   * Returns an object to remove the source when the component unmounts.\n   *\n   * Conflicts trample with a warning.\n   */\n  static addSource(key: string, callback: SourceCallback): {remove: () => void} {\n    return this._addSource(key, callback, BugReporting._extraSources);\n  }\n\n  /**\n   * Maps a string key to a simple callback that should return a string payload to be attached\n   * to a bug report. Source callbacks are called when `collectExtraData` is called.\n   *\n   * Returns an object to remove the source when the component unmounts.\n   *\n   * Conflicts trample with a warning.\n   */\n  static addFileSource(key: string, callback: SourceCallback): {remove: () => void} {\n    return this._addSource(key, callback, BugReporting._fileSources);\n  }\n\n  static _addSource(key: string, callback: SourceCallback, source: Map<string, SourceCallback>): {remove: () => void} {\n    BugReporting._maybeInit();\n    if (source.has(key)) {\n      console.warn(`BugReporting.add* called multiple times for same key '${key}'`);\n    }\n    source.set(key, callback);\n    return {remove: () => { source.delete(key); }};\n  }\n\n  /**\n   * This can be called from a native bug reporting flow, or from JS code.\n   *\n   * If available, this will call `NativeModules.BugReporting.setExtraData(extraData)`\n   * after collecting `extraData`.\n   */\n  static collectExtraData(): DebugData {\n    const extraData: ExtraData = {};\n    for (const [key, callback] of BugReporting._extraSources) {\n      extraData[key] = callback();\n    }\n    const fileData: ExtraData = {};\n    for (const [key, callback] of BugReporting._fileSources) {\n      fileData[key] = callback();\n    }\n    infoLog('BugReporting extraData:', extraData);\n    const BugReportingNativeModule = require('NativeModules').BugReporting;\n    BugReportingNativeModule &&\n      BugReportingNativeModule.setExtraData &&\n      BugReportingNativeModule.setExtraData(extraData, fileData);\n\n    const RedBoxNativeModule = require('NativeModules').RedBox;\n    RedBoxNativeModule &&\n      RedBoxNativeModule.setExtraData &&\n      RedBoxNativeModule.setExtraData(extraData, 'From BugReporting.js');\n\n    return { extras: extraData, files: fileData };\n  }\n}\n\nmodule.exports = BugReporting;\n"
  },
  {
    "path": "Libraries/BugReporting/dumpReactTree.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule dumpReactTree\n * @flow\n */\n'use strict';\n\n/*\nconst getReactData = require('getReactData');\n\nconst INDENTATION_SIZE = 2;\nconst MAX_DEPTH = 2;\nconst MAX_STRING_LENGTH = 50;\n*/\n\n/**\n * Dump all React Native root views and their content. This function tries\n * it best to get the content but ultimately relies on implementation details\n * of React and will fail in future versions.\n */\nfunction dumpReactTree() {\n  try {\n    return getReactTree();\n  } catch (e) {\n    return 'Failed to dump react tree: ' + e;\n  }\n}\n\nfunction getReactTree() {\n  // TODO(sema): Reenable tree dumps using the Fiber tree structure. #15945684\n  return (\n    'React tree dumps have been temporarily disabled while React is ' +\n    'upgraded to Fiber.'\n  );\n/*\n  let output = '';\n  const rootIds = Object.getOwnPropertyNames(ReactNativeMount._instancesByContainerID);\n  for (const rootId of rootIds) {\n    const instance = ReactNativeMount._instancesByContainerID[rootId];\n    output += `============ Root ID: ${rootId} ============\\n`;\n    output += dumpNode(instance, 0);\n    output += `============ End root ID: ${rootId} ============\\n`;\n  }\n  return output;\n*/\n}\n\n/*\nfunction dumpNode(node: Object, identation: number) {\n  const data = getReactData(node);\n  if (data.nodeType === 'Text') {\n    return indent(identation) + data.text + '\\n';\n  } else if (data.nodeType === 'Empty') {\n    return '';\n  }\n  let output = indent(identation) + `<${data.name}`;\n  if (data.nodeType === 'Composite') {\n    for (const propName of Object.getOwnPropertyNames(data.props || {})) {\n      if (isNormalProp(propName)) {\n        try {\n          const value = convertValue(data.props[propName]);\n          if (value) {\n            output += ` ${propName}=${value}`;\n          }\n        } catch (e) {\n          const message = `[Failed to get property: ${e}]`;\n          output += ` ${propName}=${message}`;\n        }\n      }\n    }\n  }\n  let childOutput = '';\n  for (const child of data.children || []) {\n    childOutput += dumpNode(child, identation + 1);\n  }\n\n  if (childOutput) {\n    output += '>\\n' + childOutput + indent(identation) + `</${data.name}>\\n`;\n  } else {\n    output += ' />\\n';\n  }\n\n  return output;\n}\n\nfunction isNormalProp(name: string): boolean {\n  switch (name) {\n    case 'children':\n    case 'key':\n    case 'ref':\n      return false;\n    default:\n      return true;\n  }\n}\n\nfunction convertObject(object: Object, depth: number) {\n  if (depth >= MAX_DEPTH) {\n    return '[...omitted]';\n  }\n  let output = '{';\n  let first = true;\n  for (const key of Object.getOwnPropertyNames(object)) {\n    if (!first) {\n      output += ', ';\n    }\n    output += `${key}: ${convertValue(object[key], depth + 1)}`;\n    first = false;\n  }\n  return output + '}';\n}\n\nfunction convertValue(value, depth = 0): ?string {\n  if (!value) {\n    return null;\n  }\n\n  switch (typeof value) {\n    case 'string':\n      return JSON.stringify(possiblyEllipsis(value).replace('\\n', '\\\\n'));\n    case 'boolean':\n    case 'number':\n      return JSON.stringify(value);\n    case 'function':\n      return '[function]';\n    case 'object':\n      return convertObject(value, depth);\n    default:\n      return null;\n  }\n}\n\nfunction possiblyEllipsis(value: string) {\n  if (value.length > MAX_STRING_LENGTH) {\n    return value.slice(0, MAX_STRING_LENGTH) + '...';\n  } else {\n    return value;\n  }\n}\n\nfunction indent(size: number) {\n  return ' '.repeat(size * INDENTATION_SIZE);\n}\n*/\n\nmodule.exports = dumpReactTree;\n"
  },
  {
    "path": "Libraries/BugReporting/getReactData.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getReactData\n * @flow\n */\n'use strict';\n\n/**\n * Convert a react internal instance to a sanitized data object.\n *\n * This is shamelessly stolen from react-devtools:\n * https://github.com/facebook/react-devtools/blob/master/backend/getData.js\n */\nfunction getData(element: Object): Object {\n  var children = null;\n  var props = null;\n  var state = null;\n  var context = null;\n  var updater = null;\n  var name = null;\n  var type = null;\n  var text = null;\n  var publicInstance = null;\n  var nodeType = 'Native';\n  // If the parent is a native node without rendered children, but with\n  // multiple string children, then the `element` that gets passed in here is\n  // a plain value -- a string or number.\n  if (typeof element !== 'object') {\n    nodeType = 'Text';\n    text = element + '';\n  } else if (element._currentElement === null || element._currentElement === false) {\n    nodeType = 'Empty';\n  } else if (element._renderedComponent) {\n    nodeType = 'NativeWrapper';\n    children = [element._renderedComponent];\n    props = element._instance.props;\n    state = element._instance.state;\n    context = element._instance.context;\n    if (context && Object.keys(context).length === 0) {\n      context = null;\n    }\n  } else if (element._renderedChildren) {\n    children = childrenList(element._renderedChildren);\n  } else if (element._currentElement && element._currentElement.props) {\n    // This is a native node without rendered children -- meaning the children\n    // prop is just a string or (in the case of the <option>) a list of\n    // strings & numbers.\n    children = element._currentElement.props.children;\n  }\n\n  if (!props && element._currentElement && element._currentElement.props) {\n    props = element._currentElement.props;\n  }\n\n  // != used deliberately here to catch undefined and null\n  if (element._currentElement != null) {\n    type = element._currentElement.type;\n    if (typeof type === 'string') {\n      name = type;\n    } else if (element.getName) {\n      nodeType = 'Composite';\n      name = element.getName();\n      // 0.14 top-level wrapper\n      // TODO(jared): The backend should just act as if these don't exist.\n      if (element._renderedComponent && element._currentElement.props === element._renderedComponent._currentElement) {\n        nodeType = 'Wrapper';\n      }\n      if (name === null) {\n        name = 'No display name';\n      }\n    } else if (element._stringText) {\n      nodeType = 'Text';\n      text = element._stringText;\n    } else {\n      name = type.displayName || type.name || 'Unknown';\n    }\n  }\n\n  if (element._instance) {\n    var inst = element._instance;\n    updater = {\n      setState: inst.setState && inst.setState.bind(inst),\n      forceUpdate: inst.forceUpdate && inst.forceUpdate.bind(inst),\n      setInProps: inst.forceUpdate && setInProps.bind(null, element),\n      setInState: inst.forceUpdate && setInState.bind(null, inst),\n      setInContext: inst.forceUpdate && setInContext.bind(null, inst),\n    };\n    publicInstance = inst;\n\n    // TODO: React ART currently falls in this bucket, but this doesn't\n    // actually make sense and we should clean this up after stabilizing our\n    // API for backends\n    if (inst._renderedChildren) {\n      children = childrenList(inst._renderedChildren);\n    }\n  }\n\n  return {\n    nodeType,\n    type,\n    name,\n    props,\n    state,\n    context,\n    children,\n    text,\n    updater,\n    publicInstance,\n  };\n}\n\nfunction setInProps(internalInst, path: Array<string | number>, value: any) {\n  var element = internalInst._currentElement;\n  internalInst._currentElement = {\n    ...element,\n    props: copyWithSet(element.props, path, value),\n  };\n  internalInst._instance.forceUpdate();\n}\n\nfunction setInState(inst, path: Array<string | number>, value: any) {\n  setIn(inst.state, path, value);\n  inst.forceUpdate();\n}\n\nfunction setInContext(inst, path: Array<string | number>, value: any) {\n  setIn(inst.context, path, value);\n  inst.forceUpdate();\n}\n\nfunction setIn(obj: Object, path: Array<string | number>, value: any) {\n  var last = path.pop();\n  var parent = path.reduce((obj_, attr) => obj_ ? obj_[attr] : null, obj);\n  if (parent) {\n    parent[last] = value;\n  }\n}\n\nfunction childrenList(children) {\n  var res = [];\n  for (var name in children) {\n    res.push(children[name]);\n  }\n  return res;\n}\n\nfunction copyWithSetImpl(obj, path, idx, value) {\n  if (idx >= path.length) {\n    return value;\n  }\n  var key = path[idx];\n  var updated = Array.isArray(obj) ? obj.slice() : {...obj};\n  // $FlowFixMe number or string is fine here\n  updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);\n  return updated;\n}\n\nfunction copyWithSet(obj: Object | Array<any>, path: Array<string | number>, value: any): Object | Array<any> {\n  return copyWithSetImpl(obj, path, 0, value);\n}\n\nmodule.exports = getData;\n"
  },
  {
    "path": "Libraries/CameraRoll/CameraRoll.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CameraRoll\n * @flow\n * @format\n */\n'use strict';\n\nconst PropTypes = require('prop-types');\nconst {checkPropTypes} = PropTypes;\nconst RCTCameraRollManager = require('NativeModules').CameraRollManager;\n\nconst createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');\nconst invariant = require('fbjs/lib/invariant');\n\nconst GROUP_TYPES_OPTIONS = {\n  Album: 'Album',\n  All: 'All',\n  Event: 'Event',\n  Faces: 'Faces',\n  Library: 'Library',\n  PhotoStream: 'PhotoStream',\n  SavedPhotos: 'SavedPhotos', // default\n};\n\nconst ASSET_TYPE_OPTIONS = {\n  All: 'All',\n  Videos: 'Videos',\n  Photos: 'Photos',\n};\n\ntype GetPhotosParams = {\n  first: number,\n  after?: string,\n  groupTypes?: $Keys<typeof GROUP_TYPES_OPTIONS>,\n  groupName?: string,\n  assetType?: $Keys<typeof ASSET_TYPE_OPTIONS>,\n  mimeTypes?: Array<string>,\n};\n\n/**\n * Shape of the param arg for the `getPhotos` function.\n */\nconst getPhotosParamChecker = createStrictShapeTypeChecker({\n  /**\n   * The number of photos wanted in reverse order of the photo application\n   * (i.e. most recent first for SavedPhotos).\n   */\n  first: PropTypes.number.isRequired,\n\n  /**\n   * A cursor that matches `page_info { end_cursor }` returned from a previous\n   * call to `getPhotos`\n   */\n  after: PropTypes.string,\n\n  /**\n   * Specifies which group types to filter the results to.\n   */\n  groupTypes: PropTypes.oneOf(Object.keys(GROUP_TYPES_OPTIONS)),\n\n  /**\n   * Specifies filter on group names, like 'Recent Photos' or custom album\n   * titles.\n   */\n  groupName: PropTypes.string,\n\n  /**\n   * Specifies filter on asset type\n   */\n  assetType: PropTypes.oneOf(Object.keys(ASSET_TYPE_OPTIONS)),\n\n  /**\n   * Filter by mimetype (e.g. image/jpeg).\n   */\n  mimeTypes: PropTypes.arrayOf(PropTypes.string),\n});\n\ntype GetPhotosReturn = Promise<{\n  edges: Array<{\n    node: {\n      type: string,\n      group_name: string,\n      image: {\n        uri: string,\n        height: number,\n        width: number,\n        isStored?: boolean,\n        playableDuration: number,\n      },\n      timestamp: number,\n      location?: {\n        latitude?: number,\n        longitude?: number,\n        altitude?: number,\n        heading?: number,\n        speed?: number,\n      },\n    },\n  }>,\n  page_info: {\n    has_next_page: boolean,\n    start_cursor?: string,\n    end_cursor?: string,\n  },\n}>;\n\n/**\n * Shape of the return value of the `getPhotos` function.\n */\nconst getPhotosReturnChecker = createStrictShapeTypeChecker({\n  // $FlowFixMe(>=0.41.0)\n  edges: PropTypes.arrayOf(\n    createStrictShapeTypeChecker({\n      node: createStrictShapeTypeChecker({\n        type: PropTypes.string.isRequired,\n        group_name: PropTypes.string.isRequired,\n        image: createStrictShapeTypeChecker({\n          uri: PropTypes.string.isRequired,\n          height: PropTypes.number.isRequired,\n          width: PropTypes.number.isRequired,\n          isStored: PropTypes.bool,\n          playableDuration: PropTypes.number.isRequired,\n        }).isRequired,\n        timestamp: PropTypes.number.isRequired,\n        location: createStrictShapeTypeChecker({\n          latitude: PropTypes.number,\n          longitude: PropTypes.number,\n          altitude: PropTypes.number,\n          heading: PropTypes.number,\n          speed: PropTypes.number,\n        }),\n      }).isRequired,\n    }),\n  ).isRequired,\n  page_info: createStrictShapeTypeChecker({\n    has_next_page: PropTypes.bool.isRequired,\n    start_cursor: PropTypes.string,\n    end_cursor: PropTypes.string,\n  }).isRequired,\n});\n\n/**\n * `CameraRoll` provides access to the local camera roll / gallery.\n * Before using this you must link the `RCTCameraRoll` library.\n * You can refer to [Linking](docs/linking-libraries-ios.html) for help.\n *\n * ### Permissions\n * The user's permission is required in order to access the Camera Roll on devices running iOS 10 or later.\n * Add the `NSPhotoLibraryUsageDescription` key in your `Info.plist` with a string that describes how your\n * app will use this data. This key will appear as `Privacy - Photo Library Usage Description` in Xcode.\n *\n */\nclass CameraRoll {\n  static GroupTypesOptions: Object = GROUP_TYPES_OPTIONS;\n  static AssetTypeOptions: Object = ASSET_TYPE_OPTIONS;\n\n  /**\n   * `CameraRoll.saveImageWithTag()` is deprecated. Use `CameraRoll.saveToCameraRoll()` instead.\n   */\n  static saveImageWithTag(tag: string): Promise<string> {\n    console.warn(\n      '`CameraRoll.saveImageWithTag()` is deprecated. Use `CameraRoll.saveToCameraRoll()` instead.',\n    );\n    return this.saveToCameraRoll(tag, 'photo');\n  }\n\n  static deletePhotos(photos: Array<string>) {\n    return RCTCameraRollManager.deletePhotos(photos);\n  }\n\n  /**\n   * Saves the photo or video to the camera roll / gallery.\n   *\n   * On Android, the tag must be a local image or video URI, such as `\"file:///sdcard/img.png\"`.\n   *\n   * On iOS, the tag can be any image URI (including local, remote asset-library and base64 data URIs)\n   * or a local video file URI (remote or data URIs are not supported for saving video at this time).\n   *\n   * If the tag has a file extension of .mov or .mp4, it will be inferred as a video. Otherwise\n   * it will be treated as a photo. To override the automatic choice, you can pass an optional\n   * `type` parameter that must be one of 'photo' or 'video'.\n   *\n   * Returns a Promise which will resolve with the new URI.\n   */\n  static saveToCameraRoll(\n    tag: string,\n    type?: 'photo' | 'video',\n  ): Promise<string> {\n    invariant(\n      typeof tag === 'string',\n      'CameraRoll.saveToCameraRoll must be a valid string.',\n    );\n\n    invariant(\n      type === 'photo' || type === 'video' || type === undefined,\n      `The second argument to saveToCameraRoll must be 'photo' or 'video'. You passed ${type ||\n        'unknown'}`,\n    );\n\n    let mediaType = 'photo';\n    if (type) {\n      mediaType = type;\n    } else if (['mov', 'mp4'].indexOf(tag.split('.').slice(-1)[0]) >= 0) {\n      mediaType = 'video';\n    }\n\n    return RCTCameraRollManager.saveToCameraRoll(tag, mediaType);\n  }\n\n  /**\n   * Returns a Promise with photo identifier objects from the local camera\n   * roll of the device matching shape defined by `getPhotosReturnChecker`.\n   *\n   * Expects a params object of the following shape:\n   *\n   * - `first` : {number} : The number of photos wanted in reverse order of the photo application (i.e. most recent first for SavedPhotos).\n   * - `after` : {string} : A cursor that matches `page_info { end_cursor }` returned from a previous call to `getPhotos`.\n   * - `groupTypes` : {string} : Specifies which group types to filter the results to. Valid values are:\n   *      - `Album`\n   *      - `All`\n   *      - `Event`\n   *      - `Faces`\n   *      - `Library`\n   *      - `PhotoStream`\n   *      - `SavedPhotos` // default\n   * - `groupName` : {string} : Specifies filter on group names, like 'Recent Photos' or custom album titles.\n   * - `assetType` : {string} : Specifies filter on asset type. Valid values are:\n   *      - `All`\n   *      - `Videos`\n   *      - `Photos` // default\n   * - `mimeTypes` : {string} : Filter by mimetype (e.g. image/jpeg).\n   *\n   * Returns a Promise which when resolved will be of the following shape:\n   *\n   * - `edges` : {Array<node>} An array of node objects\n   *      - `node`: {object} An object with the following shape:\n   *          - `type`: {string}\n   *          - `group_name`: {string}\n   *          - `image`: {object} : An object with the following shape:\n   *              - `uri`: {string}\n   *              - `height`: {number}\n   *              - `width`: {number}\n   *              - `isStored`: {boolean}\n   *          - `timestamp`: {number}\n   *          - `location`: {object} : An object with the following shape:\n   *              - `latitude`: {number}\n   *              - `longitude`: {number}\n   *              - `altitude`: {number}\n   *              - `heading`: {number}\n   *              - `speed`: {number}\n   * - `page_info` : {object} : An object with the following shape:\n   *      - `has_next_page`: {boolean}\n   *      - `start_cursor`: {string}\n   *      - `end_cursor`: {string}\n   *\n   * Loading images:\n   * ```\n   * _handleButtonPress = () => {\n   *    CameraRoll.getPhotos({\n   *        first: 20,\n   *        assetType: 'All',\n   *      })\n   *      .then(r => {\n   *        this.setState({ photos: r.edges });\n   *      })\n   *      .catch((err) => {\n   *         //Error Loading Images\n   *      });\n   *    };\n   * render() {\n   *  return (\n   *    <View>\n   *      <Button title=\"Load Images\" onPress={this._handleButtonPress} />\n   *      <ScrollView>\n   *        {this.state.photos.map((p, i) => {\n   *        return (\n   *          <Image\n   *            key={i}\n   *            style={{\n   *              width: 300,\n   *              height: 100,\n   *            }}\n   *            source={{ uri: p.node.image.uri }}\n   *          />\n   *        );\n   *      })}\n   *      </ScrollView>\n   *    </View>\n   *  );\n   * }\n   * ```\n   */\n  static getPhotos(params: GetPhotosParams): GetPhotosReturn {\n    if (__DEV__) {\n      checkPropTypes(\n        {params: getPhotosParamChecker},\n        {params},\n        'params',\n        'CameraRoll.getPhotos',\n      );\n    }\n    if (arguments.length > 1) {\n      console.warn(\n        'CameraRoll.getPhotos(tag, success, error) is deprecated.  Use the returned Promise instead',\n      );\n      let successCallback = arguments[1];\n      if (__DEV__) {\n        const callback = arguments[1];\n        successCallback = response => {\n          checkPropTypes(\n            {response: getPhotosReturnChecker},\n            {response},\n            'response',\n            'CameraRoll.getPhotos callback',\n          );\n          callback(response);\n        };\n      }\n      const errorCallback = arguments[2] || (() => {});\n      RCTCameraRollManager.getPhotos(params).then(\n        successCallback,\n        errorCallback,\n      );\n    }\n    // TODO: Add the __DEV__ check back in to verify the Promise result\n    return RCTCameraRollManager.getPhotos(params);\n  }\n}\n\nmodule.exports = CameraRoll;\n"
  },
  {
    "path": "Libraries/CameraRoll/ImagePickerIOS.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ImagePickerIOS\n * @flow\n */\n'use strict';\n\nvar RCTImagePicker = require('NativeModules').ImagePickerIOS;\n\nvar ImagePickerIOS = {\n  canRecordVideos: function(callback: Function) {\n    return RCTImagePicker.canRecordVideos(callback);\n  },\n  canUseCamera: function(callback: Function) {\n    return RCTImagePicker.canUseCamera(callback);\n  },\n  openCameraDialog: function(config: Object, successCallback: Function, cancelCallback: Function) {\n    config = {\n      videoMode: false,\n      ...config,\n    };\n    return RCTImagePicker.openCameraDialog(config, successCallback, cancelCallback);\n  },\n  openSelectDialog: function(config: Object, successCallback: Function, cancelCallback: Function) {\n    config = {\n      showImages: true,\n      showVideos: false,\n      ...config,\n    };\n    return RCTImagePicker.openSelectDialog(config, successCallback, cancelCallback);\n  },\n};\n\nmodule.exports = ImagePickerIOS;\n"
  },
  {
    "path": "Libraries/CameraRoll/RCTAssetsLibraryRequestHandler.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridge.h>\n#import <React/RCTURLRequestHandler.h>\n\n@class ALAssetsLibrary;\n\n@interface RCTAssetsLibraryRequestHandler : NSObject <RCTURLRequestHandler>\n\n@end\n\n@interface RCTBridge (RCTAssetsLibraryImageLoader)\n\n/**\n * The shared asset library instance.\n */\n@property (nonatomic, readonly) ALAssetsLibrary *assetsLibrary;\n\n@end\n"
  },
  {
    "path": "Libraries/CameraRoll/RCTAssetsLibraryRequestHandler.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAssetsLibraryRequestHandler.h\"\n\n#import <stdatomic.h>\n\n#import <AssetsLibrary/AssetsLibrary.h>\n#import <MobileCoreServices/MobileCoreServices.h>\n\n#import <React/RCTBridge.h>\n#import <React/RCTUtils.h>\n\n@implementation RCTAssetsLibraryRequestHandler\n{\n  ALAssetsLibrary *_assetsLibrary;\n}\n\nRCT_EXPORT_MODULE()\n\n@synthesize bridge = _bridge;\n\n- (ALAssetsLibrary *)assetsLibrary\n{\n  return _assetsLibrary ?: (_assetsLibrary = [ALAssetsLibrary new]);\n}\n\n#pragma mark - RCTURLRequestHandler\n\n- (BOOL)canHandleRequest:(NSURLRequest *)request\n{\n  return [request.URL.scheme caseInsensitiveCompare:@\"assets-library\"] == NSOrderedSame;\n}\n\n- (id)sendRequest:(NSURLRequest *)request\n     withDelegate:(id<RCTURLRequestDelegate>)delegate\n{\n  __block atomic_bool cancelled = ATOMIC_VAR_INIT(NO);\n  void (^cancellationBlock)(void) = ^{\n    atomic_store(&cancelled, YES);\n  };\n\n  [[self assetsLibrary] assetForURL:request.URL resultBlock:^(ALAsset *asset) {\n    if (atomic_load(&cancelled)) {\n      return;\n    }\n\n    if (asset) {\n\n      ALAssetRepresentation *representation = [asset defaultRepresentation];\n      NSInteger length = (NSInteger)representation.size;\n      CFStringRef MIMEType = UTTypeCopyPreferredTagWithClass((__bridge CFStringRef _Nonnull)(representation.UTI), kUTTagClassMIMEType);\n\n      NSURLResponse *response =\n      [[NSURLResponse alloc] initWithURL:request.URL\n                                MIMEType:(__bridge NSString *)(MIMEType)\n                   expectedContentLength:length\n                        textEncodingName:nil];\n\n      [delegate URLRequest:cancellationBlock didReceiveResponse:response];\n\n      NSError *error = nil;\n      uint8_t *buffer = (uint8_t *)malloc((size_t)length);\n      if ([representation getBytes:buffer\n                        fromOffset:0\n                            length:length\n                             error:&error]) {\n\n        NSData *data = [[NSData alloc] initWithBytesNoCopy:buffer\n                                                    length:length\n                                              freeWhenDone:YES];\n\n        [delegate URLRequest:cancellationBlock didReceiveData:data];\n        [delegate URLRequest:cancellationBlock didCompleteWithError:nil];\n\n      } else {\n        free(buffer);\n        [delegate URLRequest:cancellationBlock didCompleteWithError:error];\n      }\n\n    } else {\n      NSString *errorMessage = [NSString stringWithFormat:@\"Failed to load asset\"\n                                \" at URL %@ with no error message.\", request.URL];\n      NSError *error = RCTErrorWithMessage(errorMessage);\n      [delegate URLRequest:cancellationBlock didCompleteWithError:error];\n    }\n  } failureBlock:^(NSError *loadError) {\n    if (atomic_load(&cancelled)) {\n      return;\n    }\n    [delegate URLRequest:cancellationBlock didCompleteWithError:loadError];\n  }];\n\n  return cancellationBlock;\n}\n\n- (void)cancelRequest:(id)requestToken\n{\n  ((void (^)(void))requestToken)();\n}\n\n@end\n\n@implementation RCTBridge (RCTAssetsLibraryImageLoader)\n\n- (ALAssetsLibrary *)assetsLibrary\n{\n  return [[self moduleForClass:[RCTAssetsLibraryRequestHandler class]] assetsLibrary];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/CameraRoll/RCTCameraRoll.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t137620351B31C53500677FF0 /* RCTImagePickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 137620341B31C53500677FF0 /* RCTImagePickerManager.m */; };\n\t\t143879351AAD238D00F088A5 /* RCTCameraRollManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 143879341AAD238D00F088A5 /* RCTCameraRollManager.m */; };\n\t\t8312EAEE1B85EB7C001867A2 /* RCTAssetsLibraryRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 8312EAED1B85EB7C001867A2 /* RCTAssetsLibraryRequestHandler.m */; };\n\t\t8312EAF11B85F071001867A2 /* RCTPhotoLibraryImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 8312EAF01B85F071001867A2 /* RCTPhotoLibraryImageLoader.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t58B5115B1A9E6B3D00147676 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/$(PRODUCT_NAME)\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t137620331B31C53500677FF0 /* RCTImagePickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTImagePickerManager.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t137620341B31C53500677FF0 /* RCTImagePickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImagePickerManager.m; sourceTree = \"<group>\"; };\n\t\t143879331AAD238D00F088A5 /* RCTCameraRollManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTCameraRollManager.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t143879341AAD238D00F088A5 /* RCTCameraRollManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTCameraRollManager.m; sourceTree = \"<group>\"; };\n\t\t58B5115D1A9E6B3D00147676 /* libRCTCameraRoll.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTCameraRoll.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t8312EAEC1B85EB7C001867A2 /* RCTAssetsLibraryRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTAssetsLibraryRequestHandler.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t8312EAED1B85EB7C001867A2 /* RCTAssetsLibraryRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAssetsLibraryRequestHandler.m; sourceTree = \"<group>\"; };\n\t\t8312EAEF1B85F071001867A2 /* RCTPhotoLibraryImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTPhotoLibraryImageLoader.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t8312EAF01B85F071001867A2 /* RCTPhotoLibraryImageLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPhotoLibraryImageLoader.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t58B5115A1A9E6B3D00147676 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t58B511541A9E6B3D00147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t8312EAEC1B85EB7C001867A2 /* RCTAssetsLibraryRequestHandler.h */,\n\t\t\t\t8312EAED1B85EB7C001867A2 /* RCTAssetsLibraryRequestHandler.m */,\n\t\t\t\t143879331AAD238D00F088A5 /* RCTCameraRollManager.h */,\n\t\t\t\t143879341AAD238D00F088A5 /* RCTCameraRollManager.m */,\n\t\t\t\t137620331B31C53500677FF0 /* RCTImagePickerManager.h */,\n\t\t\t\t137620341B31C53500677FF0 /* RCTImagePickerManager.m */,\n\t\t\t\t8312EAEF1B85F071001867A2 /* RCTPhotoLibraryImageLoader.h */,\n\t\t\t\t8312EAF01B85F071001867A2 /* RCTPhotoLibraryImageLoader.m */,\n\t\t\t\t58B5115E1A9E6B3D00147676 /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t58B5115E1A9E6B3D00147676 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t58B5115D1A9E6B3D00147676 /* libRCTCameraRoll.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t58B5115C1A9E6B3D00147676 /* RCTCameraRoll */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511711A9E6B3D00147676 /* Build configuration list for PBXNativeTarget \"RCTCameraRoll\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t58B511591A9E6B3D00147676 /* Sources */,\n\t\t\t\t58B5115A1A9E6B3D00147676 /* Frameworks */,\n\t\t\t\t58B5115B1A9E6B3D00147676 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTCameraRoll;\n\t\t\tproductName = RCTNetworkImage;\n\t\t\tproductReference = 58B5115D1A9E6B3D00147676 /* libRCTCameraRoll.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511551A9E6B3D00147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t58B5115C1A9E6B3D00147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511581A9E6B3D00147676 /* Build configuration list for PBXProject \"RCTCameraRoll\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511541A9E6B3D00147676;\n\t\t\tproductRefGroup = 58B5115E1A9E6B3D00147676 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B5115C1A9E6B3D00147676 /* RCTCameraRoll */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t58B511591A9E6B3D00147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t8312EAEE1B85EB7C001867A2 /* RCTAssetsLibraryRequestHandler.m in Sources */,\n\t\t\t\t8312EAF11B85F071001867A2 /* RCTPhotoLibraryImageLoader.m in Sources */,\n\t\t\t\t137620351B31C53500677FF0 /* RCTImagePickerManager.m in Sources */,\n\t\t\t\t143879351AAD238D00F088A5 /* RCTCameraRollManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t58B5116F1A9E6B3D00147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511701A9E6B3D00147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511721A9E6B3D00147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTCameraRoll;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511731A9E6B3D00147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTCameraRoll;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t58B511581A9E6B3D00147676 /* Build configuration list for PBXProject \"RCTCameraRoll\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B5116F1A9E6B3D00147676 /* Debug */,\n\t\t\t\t58B511701A9E6B3D00147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511711A9E6B3D00147676 /* Build configuration list for PBXNativeTarget \"RCTCameraRoll\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511721A9E6B3D00147676 /* Debug */,\n\t\t\t\t58B511731A9E6B3D00147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511551A9E6B3D00147676 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/CameraRoll/RCTCameraRollManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AssetsLibrary/AssetsLibrary.h>\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTConvert.h>\n\n@interface RCTConvert (ALAssetGroup)\n\n+ (ALAssetsGroupType)ALAssetsGroupType:(id)json;\n+ (ALAssetsFilter *)ALAssetsFilter:(id)json;\n\n@end\n\n@interface RCTCameraRollManager : NSObject <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "Libraries/CameraRoll/RCTCameraRollManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTCameraRollManager.h\"\n\n#import <CoreLocation/CoreLocation.h>\n#import <Foundation/Foundation.h>\n#import <UIKit/UIKit.h>\n#import <Photos/Photos.h>\n\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTImageLoader.h>\n#import <React/RCTLog.h>\n#import <React/RCTUtils.h>\n\n#import \"RCTAssetsLibraryRequestHandler.h\"\n\n@implementation RCTConvert (ALAssetGroup)\n\nRCT_ENUM_CONVERTER(ALAssetsGroupType, (@{\n\n  // New values\n  @\"album\": @(ALAssetsGroupAlbum),\n  @\"all\": @(ALAssetsGroupAll),\n  @\"event\": @(ALAssetsGroupEvent),\n  @\"faces\": @(ALAssetsGroupFaces),\n  @\"library\": @(ALAssetsGroupLibrary),\n  @\"photo-stream\": @(ALAssetsGroupPhotoStream),\n  @\"saved-photos\": @(ALAssetsGroupSavedPhotos),\n\n  // Legacy values\n  @\"Album\": @(ALAssetsGroupAlbum),\n  @\"All\": @(ALAssetsGroupAll),\n  @\"Event\": @(ALAssetsGroupEvent),\n  @\"Faces\": @(ALAssetsGroupFaces),\n  @\"Library\": @(ALAssetsGroupLibrary),\n  @\"PhotoStream\": @(ALAssetsGroupPhotoStream),\n  @\"SavedPhotos\": @(ALAssetsGroupSavedPhotos),\n\n}), ALAssetsGroupSavedPhotos, integerValue)\n\n+ (ALAssetsFilter *)ALAssetsFilter:(id)json\n{\n  static NSDictionary<NSString *, ALAssetsFilter *> *options;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    options = @{\n\n      // New values\n      @\"photos\": [ALAssetsFilter allPhotos],\n      @\"videos\": [ALAssetsFilter allVideos],\n      @\"all\": [ALAssetsFilter allAssets],\n\n      // Legacy values\n      @\"Photos\": [ALAssetsFilter allPhotos],\n      @\"Videos\": [ALAssetsFilter allVideos],\n      @\"All\": [ALAssetsFilter allAssets],\n    };\n  });\n\n  ALAssetsFilter *filter = options[json ?: @\"photos\"];\n  if (!filter) {\n    RCTLogError(@\"Invalid filter option: '%@'. Expected one of 'photos',\"\n                \"'videos' or 'all'.\", json);\n  }\n  return filter ?: [ALAssetsFilter allPhotos];\n}\n\n@end\n\n@implementation RCTCameraRollManager\n\nRCT_EXPORT_MODULE()\n\n@synthesize bridge = _bridge;\n\nstatic NSString *const kErrorUnableToLoad = @\"E_UNABLE_TO_LOAD\";\nstatic NSString *const kErrorUnableToSave = @\"E_UNABLE_TO_SAVE\";\n\nRCT_EXPORT_METHOD(saveToCameraRoll:(NSURLRequest *)request\n                  type:(NSString *)type\n                  resolve:(RCTPromiseResolveBlock)resolve\n                  reject:(RCTPromiseRejectBlock)reject)\n{\n  if ([type isEqualToString:@\"video\"]) {\n    // It's unclear if writeVideoAtPathToSavedPhotosAlbum is thread-safe\n    dispatch_async(dispatch_get_main_queue(), ^{\n      [self->_bridge.assetsLibrary writeVideoAtPathToSavedPhotosAlbum:request.URL completionBlock:^(NSURL *assetURL, NSError *saveError) {\n        if (saveError) {\n          reject(kErrorUnableToSave, nil, saveError);\n        } else {\n          resolve(assetURL.absoluteString);\n        }\n      }];\n    });\n  } else {\n    [_bridge.imageLoader loadImageWithURLRequest:request\n                                        callback:^(NSError *loadError, UIImage *loadedImage) {\n      if (loadError) {\n        reject(kErrorUnableToLoad, nil, loadError);\n        return;\n      }\n      // It's unclear if writeImageToSavedPhotosAlbum is thread-safe\n      dispatch_async(dispatch_get_main_queue(), ^{\n        [self->_bridge.assetsLibrary writeImageToSavedPhotosAlbum:loadedImage.CGImage metadata:nil completionBlock:^(NSURL *assetURL, NSError *saveError) {\n          if (saveError) {\n            RCTLogWarn(@\"Error saving cropped image: %@\", saveError);\n            reject(kErrorUnableToSave, nil, saveError);\n          } else {\n            resolve(assetURL.absoluteString);\n          }\n        }];\n      });\n    }];\n  }\n}\n\nstatic void RCTResolvePromise(RCTPromiseResolveBlock resolve,\n                              NSArray<NSDictionary<NSString *, id> *> *assets,\n                              BOOL hasNextPage)\n{\n  if (!assets.count) {\n    resolve(@{\n      @\"edges\": assets,\n      @\"page_info\": @{\n        @\"has_next_page\": @NO,\n      }\n    });\n    return;\n  }\n  resolve(@{\n    @\"edges\": assets,\n    @\"page_info\": @{\n      @\"start_cursor\": assets[0][@\"node\"][@\"image\"][@\"uri\"],\n      @\"end_cursor\": assets[assets.count - 1][@\"node\"][@\"image\"][@\"uri\"],\n      @\"has_next_page\": @(hasNextPage),\n    }\n  });\n}\n\nRCT_EXPORT_METHOD(getPhotos:(NSDictionary *)params\n                  resolve:(RCTPromiseResolveBlock)resolve\n                  reject:(RCTPromiseRejectBlock)reject)\n{\n  checkPhotoLibraryConfig();\n\n  NSUInteger first = [RCTConvert NSInteger:params[@\"first\"]];\n  NSString *afterCursor = [RCTConvert NSString:params[@\"after\"]];\n  NSString *groupName = [RCTConvert NSString:params[@\"groupName\"]];\n  ALAssetsFilter *assetType = [RCTConvert ALAssetsFilter:params[@\"assetType\"]];\n  ALAssetsGroupType groupTypes = [RCTConvert ALAssetsGroupType:params[@\"groupTypes\"]];\n\n  BOOL __block foundAfter = NO;\n  BOOL __block hasNextPage = NO;\n  BOOL __block resolvedPromise = NO;\n  NSMutableArray<NSDictionary<NSString *, id> *> *assets = [NSMutableArray new];\n\n  [_bridge.assetsLibrary enumerateGroupsWithTypes:groupTypes usingBlock:^(ALAssetsGroup *group, BOOL *stopGroups) {\n    if (group && (groupName == nil || [groupName isEqualToString:[group valueForProperty:ALAssetsGroupPropertyName]])) {\n\n      [group setAssetsFilter:assetType];\n      [group enumerateAssetsWithOptions:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stopAssets) {\n        if (result) {\n          NSString *uri = ((NSURL *)[result valueForProperty:ALAssetPropertyAssetURL]).absoluteString;\n          if (afterCursor && !foundAfter) {\n            if ([afterCursor isEqualToString:uri]) {\n              foundAfter = YES;\n            }\n            return; // Skip until we get to the first one\n          }\n          if (first == assets.count) {\n            *stopAssets = YES;\n            *stopGroups = YES;\n            hasNextPage = YES;\n            RCTAssert(resolvedPromise == NO, @\"Resolved the promise before we finished processing the results.\");\n            RCTResolvePromise(resolve, assets, hasNextPage);\n            resolvedPromise = YES;\n            return;\n          }\n          CGSize dimensions = [result defaultRepresentation].dimensions;\n          CLLocation *loc = [result valueForProperty:ALAssetPropertyLocation];\n          NSDate *date = [result valueForProperty:ALAssetPropertyDate];\n          NSString *filename = [result defaultRepresentation].filename;\n          int64_t duration = 0;\n          if ([[result valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypeVideo]) {\n            duration = [[result valueForProperty:ALAssetPropertyDuration] intValue];\n          }\n\n          [assets addObject:@{\n            @\"node\": @{\n              @\"type\": [result valueForProperty:ALAssetPropertyType],\n              @\"group_name\": [group valueForProperty:ALAssetsGroupPropertyName],\n              @\"image\": @{\n                @\"uri\": uri,\n                @\"filename\" : filename,\n                @\"height\": @(dimensions.height),\n                @\"width\": @(dimensions.width),\n                @\"isStored\": @YES,\n                @\"playableDuration\": @(duration),\n              },\n              @\"timestamp\": @(date.timeIntervalSince1970),\n              @\"location\": loc ? @{\n                @\"latitude\": @(loc.coordinate.latitude),\n                @\"longitude\": @(loc.coordinate.longitude),\n                @\"altitude\": @(loc.altitude),\n                @\"heading\": @(loc.course),\n                @\"speed\": @(loc.speed),\n              } : @{},\n            }\n          }];\n        }\n      }];\n    }\n\n    if (!group) {\n      // Sometimes the enumeration continues even if we set stop above, so we guard against resolving the promise\n      // multiple times here.\n      if (!resolvedPromise) {\n        RCTResolvePromise(resolve, assets, hasNextPage);\n        resolvedPromise = YES;\n      }\n    }\n  } failureBlock:^(NSError *error) {\n    if (error.code != ALAssetsLibraryAccessUserDeniedError) {\n      RCTLogError(@\"Failure while iterating through asset groups %@\", error);\n    }\n    reject(kErrorUnableToLoad, nil, error);\n  }];\n}\n\nRCT_EXPORT_METHOD(deletePhotos:(NSArray<NSString *>*)assets\n                  resolve:(RCTPromiseResolveBlock)resolve\n                  reject:(RCTPromiseRejectBlock)reject)\n{\n  NSArray<NSURL *> *assets_ = [RCTConvert NSURLArray:assets];\n  [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{\n      PHFetchResult<PHAsset *> *fetched =\n        [PHAsset fetchAssetsWithALAssetURLs:assets_ options:nil];\n      [PHAssetChangeRequest deleteAssets:fetched];\n    }\n  completionHandler:^(BOOL success, NSError *error) {\n      if (success == YES) {\n     \t    resolve(@(success));\n      }\n      else {\n\t        reject(@\"Couldn't delete\", @\"Couldn't delete assets\", error);\n      }\n    }\n    ];\n}\n\nstatic void checkPhotoLibraryConfig()\n{\n#if RCT_DEV\n  if (![[NSBundle mainBundle] objectForInfoDictionaryKey:@\"NSPhotoLibraryUsageDescription\"]) {\n    RCTLogError(@\"NSPhotoLibraryUsageDescription key must be present in Info.plist to use camera roll.\");\n  }\n#endif\n}\n\n@end\n"
  },
  {
    "path": "Libraries/CameraRoll/RCTImagePickerManager.h",
    "content": "/*\n *  Copyright (c) 2013, Facebook, Inc.\n *  All rights reserved.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <React/RCTBridgeModule.h>\n\n@interface RCTImagePickerManager : NSObject <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "Libraries/CameraRoll/RCTImagePickerManager.m",
    "content": "/*\n *  Copyright (c) 2013, Facebook, Inc.\n *  All rights reserved.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import \"RCTImagePickerManager.h\"\n\n#import <MobileCoreServices/UTCoreTypes.h>\n#import <UIKit/UIKit.h>\n\n#import <React/RCTConvert.h>\n#import <React/RCTImageStoreManager.h>\n#import <React/RCTRootView.h>\n#import <React/RCTUtils.h>\n\n@interface RCTImagePickerManager () <UIImagePickerControllerDelegate, UINavigationControllerDelegate>\n\n@end\n\n@implementation RCTImagePickerManager\n{\n  NSMutableArray<UIImagePickerController *> *_pickers;\n  NSMutableArray<RCTResponseSenderBlock> *_pickerCallbacks;\n  NSMutableArray<RCTResponseSenderBlock> *_pickerCancelCallbacks;\n}\n\nRCT_EXPORT_MODULE(ImagePickerIOS);\n\n@synthesize bridge = _bridge;\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\nRCT_EXPORT_METHOD(canRecordVideos:(RCTResponseSenderBlock)callback)\n{\n  NSArray<NSString *> *availableMediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];\n  callback(@[@([availableMediaTypes containsObject:(NSString *)kUTTypeMovie])]);\n}\n\nRCT_EXPORT_METHOD(canUseCamera:(RCTResponseSenderBlock)callback)\n{\n  callback(@[@([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])]);\n}\n\nRCT_EXPORT_METHOD(openCameraDialog:(NSDictionary *)config\n                  successCallback:(RCTResponseSenderBlock)callback\n                  cancelCallback:(RCTResponseSenderBlock)cancelCallback)\n{\n  if (RCTRunningInAppExtension()) {\n    cancelCallback(@[@\"Camera access is unavailable in an app extension\"]);\n    return;\n  }\n\n  UIImagePickerController *imagePicker = [UIImagePickerController new];\n  imagePicker.delegate = self;\n  imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;\n\n  if ([RCTConvert BOOL:config[@\"videoMode\"]]) {\n    imagePicker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;\n  }\n\n  [self _presentPicker:imagePicker\n       successCallback:callback\n        cancelCallback:cancelCallback];\n}\n\nRCT_EXPORT_METHOD(openSelectDialog:(NSDictionary *)config\n                  successCallback:(RCTResponseSenderBlock)callback\n                  cancelCallback:(RCTResponseSenderBlock)cancelCallback)\n{\n  if (RCTRunningInAppExtension()) {\n    cancelCallback(@[@\"Image picker is currently unavailable in an app extension\"]);\n    return;\n  }\n\n  UIImagePickerController *imagePicker = [UIImagePickerController new];\n  imagePicker.delegate = self;\n  imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;\n\n  NSMutableArray<NSString *> *allowedTypes = [NSMutableArray new];\n  if ([RCTConvert BOOL:config[@\"showImages\"]]) {\n    [allowedTypes addObject:(NSString *)kUTTypeImage];\n  }\n  if ([RCTConvert BOOL:config[@\"showVideos\"]]) {\n    [allowedTypes addObject:(NSString *)kUTTypeMovie];\n  }\n\n  imagePicker.mediaTypes = allowedTypes;\n\n  [self _presentPicker:imagePicker\n       successCallback:callback\n        cancelCallback:cancelCallback];\n}\n\n- (void)imagePickerController:(UIImagePickerController *)picker\ndidFinishPickingMediaWithInfo:(NSDictionary<NSString *, id> *)info\n{\n  NSString *mediaType = info[UIImagePickerControllerMediaType];\n  BOOL isMovie = [mediaType isEqualToString:(NSString *)kUTTypeMovie];\n  NSString *key = isMovie ? UIImagePickerControllerMediaURL : UIImagePickerControllerReferenceURL;\n  NSURL *imageURL = info[key];\n  UIImage *image = info[UIImagePickerControllerOriginalImage];\n  NSNumber *width = 0;\n  NSNumber *height = 0;\n  if (image) {\n    height = @(image.size.height);\n    width = @(image.size.width);\n  }\n  if (imageURL) {\n    [self _dismissPicker:picker args:@[imageURL.absoluteString, RCTNullIfNil(height), RCTNullIfNil(width)]];\n    return;\n  }\n\n  // This is a newly taken image, and doesn't have a URL yet.\n  // We need to save it to the image store first.\n  UIImage *originalImage = info[UIImagePickerControllerOriginalImage];\n\n  // WARNING: Using ImageStoreManager may cause a memory leak because the\n  // image isn't automatically removed from store once we're done using it.\n  [_bridge.imageStoreManager storeImage:originalImage withBlock:^(NSString *tempImageTag) {\n    [self _dismissPicker:picker args:tempImageTag ? @[tempImageTag, height, width] : nil];\n  }];\n}\n\n- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker\n{\n  [self _dismissPicker:picker args:nil];\n}\n\n- (void)_presentPicker:(UIImagePickerController *)imagePicker\n       successCallback:(RCTResponseSenderBlock)callback\n        cancelCallback:(RCTResponseSenderBlock)cancelCallback\n{\n  if (!_pickers) {\n    _pickers = [NSMutableArray new];\n    _pickerCallbacks = [NSMutableArray new];\n    _pickerCancelCallbacks = [NSMutableArray new];\n  }\n\n  [_pickers addObject:imagePicker];\n  [_pickerCallbacks addObject:callback];\n  [_pickerCancelCallbacks addObject:cancelCallback];\n\n  UIViewController *rootViewController = RCTPresentedViewController();\n  [rootViewController presentViewController:imagePicker animated:YES completion:nil];\n}\n\n- (void)_dismissPicker:(UIImagePickerController *)picker args:(NSArray *)args\n{\n  NSUInteger index = [_pickers indexOfObject:picker];\n  RCTResponseSenderBlock successCallback = _pickerCallbacks[index];\n  RCTResponseSenderBlock cancelCallback = _pickerCancelCallbacks[index];\n\n  [_pickers removeObjectAtIndex:index];\n  [_pickerCallbacks removeObjectAtIndex:index];\n  [_pickerCancelCallbacks removeObjectAtIndex:index];\n\n  UIViewController *rootViewController = RCTPresentedViewController();\n  [rootViewController dismissViewControllerAnimated:YES completion:nil];\n\n  if (args) {\n    successCallback(args);\n  } else {\n    cancelCallback(@[]);\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/CameraRoll/RCTPhotoLibraryImageLoader.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTImageLoader.h>\n\n@interface RCTPhotoLibraryImageLoader : NSObject <RCTImageURLLoader>\n\n@end\n"
  },
  {
    "path": "Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTPhotoLibraryImageLoader.h\"\n\n#import <Photos/Photos.h>\n\n#import <React/RCTUtils.h>\n\n@implementation RCTPhotoLibraryImageLoader\n\nRCT_EXPORT_MODULE()\n\n@synthesize bridge = _bridge;\n\n#pragma mark - RCTImageLoader\n\n- (BOOL)canLoadImageURL:(NSURL *)requestURL\n{\n  if (![PHAsset class]) {\n    return NO;\n  }\n  return [requestURL.scheme caseInsensitiveCompare:@\"assets-library\"] == NSOrderedSame ||\n    [requestURL.scheme caseInsensitiveCompare:@\"ph\"] == NSOrderedSame;\n}\n\n- (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL\n                                              size:(CGSize)size\n                                             scale:(CGFloat)scale\n                                        resizeMode:(RCTResizeMode)resizeMode\n                                   progressHandler:(RCTImageLoaderProgressBlock)progressHandler\n                                partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler\n                                 completionHandler:(RCTImageLoaderCompletionBlock)completionHandler\n{\n  // Using PhotoKit for iOS 8+\n  // The 'ph://' prefix is used by FBMediaKit to differentiate between\n  // assets-library. It is prepended to the local ID so that it is in the\n  // form of an, NSURL which is what assets-library uses.\n  NSString *assetID = @\"\";\n  PHFetchResult *results;\n  if (!imageURL) {\n    completionHandler(RCTErrorWithMessage(@\"Cannot load a photo library asset with no URL\"), nil);\n    return ^{};\n  } else if ([imageURL.scheme caseInsensitiveCompare:@\"assets-library\"] == NSOrderedSame) {\n    assetID = [imageURL absoluteString];\n    results = [PHAsset fetchAssetsWithALAssetURLs:@[imageURL] options:nil];\n  } else {\n    assetID = [imageURL.absoluteString substringFromIndex:@\"ph://\".length];\n    results = [PHAsset fetchAssetsWithLocalIdentifiers:@[assetID] options:nil];\n  }\n  if (results.count == 0) {\n    NSString *errorText = [NSString stringWithFormat:@\"Failed to fetch PHAsset with local identifier %@ with no error message.\", assetID];\n    completionHandler(RCTErrorWithMessage(errorText), nil);\n    return ^{};\n  }\n\n  PHAsset *asset = [results firstObject];\n  PHImageRequestOptions *imageOptions = [PHImageRequestOptions new];\n\n  // Allow PhotoKit to fetch images from iCloud\n  imageOptions.networkAccessAllowed = YES;\n\n  if (progressHandler) {\n    imageOptions.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary<NSString *, id> *info) {\n      static const double multiplier = 1e6;\n      progressHandler(progress * multiplier, multiplier);\n    };\n  }\n\n  // Note: PhotoKit defaults to a deliveryMode of PHImageRequestOptionsDeliveryModeOpportunistic\n  // which means it may call back multiple times - we probably don't want that\n  imageOptions.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;\n\n  BOOL useMaximumSize = CGSizeEqualToSize(size, CGSizeZero);\n  CGSize targetSize;\n  if (useMaximumSize) {\n    targetSize = PHImageManagerMaximumSize;\n    imageOptions.resizeMode = PHImageRequestOptionsResizeModeNone;\n  } else {\n    targetSize = CGSizeApplyAffineTransform(size, CGAffineTransformMakeScale(scale, scale));\n    imageOptions.resizeMode = PHImageRequestOptionsResizeModeFast;\n  }\n\n  PHImageContentMode contentMode = PHImageContentModeAspectFill;\n  if (resizeMode == RCTResizeModeContain) {\n    contentMode = PHImageContentModeAspectFit;\n  }\n\n  PHImageRequestID requestID =\n  [[PHImageManager defaultManager] requestImageForAsset:asset\n                                             targetSize:targetSize\n                                            contentMode:contentMode\n                                                options:imageOptions\n                                          resultHandler:^(UIImage *result, NSDictionary<NSString *, id> *info) {\n    if (result) {\n      completionHandler(nil, result);\n    } else {\n      completionHandler(info[PHImageErrorKey], nil);\n    }\n  }];\n\n  return ^{\n    [[PHImageManager defaultManager] cancelImageRequest:requestID];\n  };\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AccessibilityInfo\n * @flow\n */\n'use strict';\n\nvar NativeModules = require('NativeModules');\nvar RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\n\nvar RCTAccessibilityInfo = NativeModules.AccessibilityInfo;\n\nvar TOUCH_EXPLORATION_EVENT = 'touchExplorationDidChange';\n\ntype ChangeEventName = $Enum<{\n  change: string,\n}>;\n\nvar _subscriptions = new Map();\n\n/**\n * Sometimes it's useful to know whether or not the device has a screen reader\n * that is currently active. The `AccessibilityInfo` API is designed for this\n * purpose. You can use it to query the current state of the screen reader as \n * well as to register to be notified when the state of the screen reader \n * changes.\n *\n * See http://facebook.github.io/react-native/docs/accessibilityinfo.html\n */\n\nvar AccessibilityInfo = {\n\n  fetch: function(): Promise {\n    return new Promise((resolve, reject) => {\n      RCTAccessibilityInfo.isTouchExplorationEnabled(\n        function(resp) {\n          resolve(resp);\n        }\n      );\n    });\n  },\n\n  addEventListener: function (\n    eventName: ChangeEventName,\n    handler: Function\n  ): void {\n    var listener = RCTDeviceEventEmitter.addListener(\n      TOUCH_EXPLORATION_EVENT,\n      (enabled) => {\n        handler(enabled);\n      }\n    );\n    _subscriptions.set(handler, listener);\n  },\n\n  removeEventListener: function(\n    eventName: ChangeEventName,\n    handler: Function\n  ): void {\n    var listener = _subscriptions.get(handler);\n    if (!listener) {\n      return;\n    }\n    listener.remove();\n    _subscriptions.delete(handler);\n  },\n\n};\n\nmodule.exports = AccessibilityInfo;\n"
  },
  {
    "path": "Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AccessibilityInfo\n * @flow\n */\n'use strict';\n\nvar NativeModules = require('NativeModules');\nvar Promise = require('Promise');\nvar RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\n\nvar AccessibilityManager = NativeModules.AccessibilityManager;\n\nvar VOICE_OVER_EVENT = 'voiceOverDidChange';\nvar ANNOUNCEMENT_DID_FINISH_EVENT = 'announcementDidFinish';\n\ntype ChangeEventName = $Enum<{\n  change: string,\n  announcementFinished: string\n}>;\n\nvar _subscriptions = new Map();\n\n/**\n * Sometimes it's useful to know whether or not the device has a screen reader\n * that is currently active. The `AccessibilityInfo` API is designed for this\n * purpose. You can use it to query the current state of the screen reader as \n * well as to register to be notified when the state of the screen reader \n * changes.\n *\n * See http://facebook.github.io/react-native/docs/accessibilityinfo.html\n */\nvar AccessibilityInfo = {\n\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 enabledand `false` otherwise.\n   * \n   * See http://facebook.github.io/react-native/docs/accessibilityinfo.html#fetch\n   */\n  fetch: function(): Promise {\n    return new Promise((resolve, reject) => {\n      AccessibilityManager.getCurrentVoiceOverState(\n        resolve,\n        reject\n      );\n    });\n  },\n\n  /**\n   * Add an event handler. Supported events:\n   *\n   * - `change`: Fires when the state of the screen reader changes. The argument\n   *   to the event handler is a boolean. The boolean is `true` when a screen\n   *   reader is enabled and `false` otherwise.\n   * - `announcementFinished`: iOS-only event. Fires when the screen reader has\n   *   finished making an announcement. The argument to the event handler is a\n   *   dictionary with these keys:\n   *     - `announcement`: The string announced by the screen reader.\n   *     - `success`: A boolean indicating whether the announcement was\n   *       successfully made.\n   * \n   * See http://facebook.github.io/react-native/docs/accessibilityinfo.html#addeventlistener\n   */\n  addEventListener: function (\n    eventName: ChangeEventName,\n    handler: Function\n  ): Object {\n    var listener;\n\n    if (eventName === 'change') {\n      listener = RCTDeviceEventEmitter.addListener(\n        VOICE_OVER_EVENT,\n        handler\n      );\n    } else if (eventName === 'announcementFinished') {\n      listener = RCTDeviceEventEmitter.addListener(\n        ANNOUNCEMENT_DID_FINISH_EVENT,\n        handler\n      );\n    }\n\n    _subscriptions.set(handler, listener);\n    return {\n      remove: AccessibilityInfo.removeEventListener.bind(null, eventName, handler),\n    };\n  },\n\n  /**\n   * Set accessibility focus to a react component.\n   * \n   * @platform ios\n   * \n   * See http://facebook.github.io/react-native/docs/accessibilityinfo.html#setaccessibilityfocus\n   */\n  setAccessibilityFocus: function(\n    reactTag: number\n  ): void {\n    AccessibilityManager.setAccessibilityFocus(reactTag);\n  },\n\n  /**\n   * Post a string to be announced by the screen reader.\n   *\n   * @platform ios\n   * \n   * See http://facebook.github.io/react-native/docs/accessibilityinfo.html#announceforaccessibility\n   */\n  announceForAccessibility: function(\n    announcement: string\n  ): void {\n    AccessibilityManager.announceForAccessibility(announcement);\n  },\n\n  /**\n   * Remove an event handler.\n   * \n   * See http://facebook.github.io/react-native/docs/accessibilityinfo.html#removeeventlistener\n   */\n  removeEventListener: function(\n    eventName: ChangeEventName,\n    handler: Function\n  ): void {\n    var listener = _subscriptions.get(handler);\n    if (!listener) {\n      return;\n    }\n    listener.remove();\n    _subscriptions.delete(handler);\n  },\n\n};\n\nmodule.exports = AccessibilityInfo;\n"
  },
  {
    "path": "Libraries/Components/AccessibilityInfo/AccessibilityInfo.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AccessibilityInfo\n * @flow\n */\n'use strict';\n\nvar NativeModules = require('NativeModules');\nvar Promise = require('Promise');\nvar RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\n\nvar AccessibilityManager = NativeModules.AccessibilityManager;\n\nvar VOICE_OVER_EVENT = 'voiceOverDidChange';\n\ntype ChangeEventName = $Enum<{\n  change: string,\n}>;\n\nvar _subscriptions = new Map();\n\n/**\n * Sometimes it's useful to know whether or not the device has a screen reader that is currently active. The\n * `AccessibilityInfo` API is designed for this purpose. You can use it to query the current state of the\n * screen reader as well as to register to be notified when the state of the screen reader changes.\n *\n * Here's a small example illustrating how to use `AccessibilityInfo`:\n *\n * ```javascript\n * class ScreenReaderStatusExample extends React.Component {\n *   state = {\n *     screenReaderEnabled: false,\n *   }\n *\n *   componentDidMount() {\n *     AccessibilityInfo.addEventListener(\n *       'change',\n *       this._handleScreenReaderToggled\n *     );\n *     AccessibilityInfo.fetch().done((isEnabled) => {\n *       this.setState({\n *         screenReaderEnabled: isEnabled\n *       });\n *     });\n *   }\n *\n *   componentWillUnmount() {\n *     AccessibilityInfo.removeEventListener(\n *       'change',\n *       this._handleScreenReaderToggled\n *     );\n *   }\n *\n *   _handleScreenReaderToggled = (isEnabled) => {\n *     this.setState({\n *       screenReaderEnabled: isEnabled,\n *     });\n *   }\n *\n *   render() {\n *     return (\n *       <View>\n *         <Text>\n *           The screen reader is {this.state.screenReaderEnabled ? 'enabled' : 'disabled'}.\n *         </Text>\n *       </View>\n *     );\n *   }\n * }\n * ```\n */\nvar AccessibilityInfo = {\n\n  /**\n   * Query whether a screen reader is currently enabled. Returns a promise which\n   * resolves to a boolean. The result is `true` when a screen reader is enabled\n   * and `false` otherwise.\n   */\n  fetch: function(): Promise {\n    return new Promise((resolve, reject) => {\n      AccessibilityManager.getCurrentVoiceOverState(\n        resolve,\n        reject\n      );\n    });\n  },\n\n  /**\n   * Add an event handler. Supported events:\n   *\n   * - `change`: Fires when the state of the screen reader changes. The argument\n   *   to the event handler is a boolean. The boolean is `true` when a screen\n   *   reader is enabled and `false` otherwise.\n   */\n  addEventListener: function (\n    eventName: ChangeEventName,\n    handler: Function\n  ): Object {\n    var listener = RCTDeviceEventEmitter.addListener(\n      VOICE_OVER_EVENT,\n      handler\n    );\n    _subscriptions.set(handler, listener);\n    return {\n      remove: AccessibilityInfo.removeEventListener.bind(null, eventName, handler),\n    };\n  },\n\n  /**\n   * Remove an event handler.\n   */\n  removeEventListener: function(\n    eventName: ChangeEventName,\n    handler: Function\n  ): void {\n    var listener = _subscriptions.get(handler);\n    if (!listener) {\n      return;\n    }\n    listener.remove();\n    _subscriptions.delete(handler);\n  },\n\n};\n\nmodule.exports = AccessibilityInfo;\n"
  },
  {
    "path": "Libraries/Components/ActivityIndicator/ActivityIndicator.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ActivityIndicator\n * @flow\n */\n'use strict';\n\nconst ColorPropType = require('ColorPropType');\nconst NativeMethodsMixin = require('NativeMethodsMixin');\nconst Platform = require('Platform');\nconst ProgressBarAndroid = require('ProgressBarAndroid');\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst StyleSheet = require('StyleSheet');\nconst View = require('View');\nconst ViewPropTypes = require('ViewPropTypes');\n\nconst createReactClass = require('create-react-class');\nconst requireNativeComponent = require('requireNativeComponent');\n\nconst GRAY = '#999999';\n\ntype IndicatorSize = number | 'small' | 'large';\n\ntype DefaultProps = {\n  animating: boolean,\n  color: any,\n  hidesWhenStopped: boolean,\n  size: IndicatorSize,\n}\n\n/**\n * Displays a circular loading indicator.\n *\n * See http://facebook.github.io/react-native/docs/activityindicator.html\n */\nconst ActivityIndicator = createReactClass({\n  displayName: 'ActivityIndicator',\n  mixins: [NativeMethodsMixin],\n\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * Whether to show the indicator (true, the default) or hide it (false).\n     *\n     * See http://facebook.github.io/react-native/docs/activityindicator.html#animating\n     */\n    animating: PropTypes.bool,\n    /**\n     * The foreground color of the spinner (default is gray).\n     *\n     * See http://facebook.github.io/react-native/docs/activityindicator.html#color\n     */\n    color: ColorPropType,\n    /**\n     * Size of the indicator (default is 'small').\n     * Passing a number to the size prop is only supported on Android.\n     *\n     * See http://facebook.github.io/react-native/docs/activityindicator.html#size\n     */\n    size: PropTypes.oneOfType([\n      PropTypes.oneOf([ 'small', 'large', 'huge' ]),\n      PropTypes.number,\n    ]),\n    /**\n     * Whether the indicator should hide when not animating (true by default).\n     *\n     * @platform ios\n     *\n     * See http://facebook.github.io/react-native/docs/activityindicator.html#hideswhenstopped\n     */\n    hidesWhenStopped: PropTypes.bool,\n  },\n\n  getDefaultProps(): DefaultProps {\n    return {\n      animating: true,\n      color: Platform.OS === 'ios' || Platform.OS === 'macos' ? GRAY : undefined,\n      hidesWhenStopped: true,\n      size: 'small',\n    };\n  },\n\n  render() {\n    const {onLayout, style, ...props} = this.props;\n    let sizeStyle;\n\n    switch (props.size) {\n      case 'small':\n        sizeStyle = styles.sizeSmall;\n        break;\n      case 'large':\n        sizeStyle = styles.sizeLarge;\n        break;\n      case 'huge':\n        sizeStyle = styles.sizeHuge;\n        break;\n      default:\n        sizeStyle = {height: props.size, width: props.size};\n        break;\n    }\n\n    const nativeProps = {\n      ...props,\n      style: sizeStyle,\n      styleAttr: 'Normal',\n      indeterminate: true,\n    };\n\n    return (\n      <View onLayout={onLayout} style={[styles.container, style]}>\n        {(Platform.OS === 'ios' || Platform.OS === 'macos') ? (\n          <RCTActivityIndicator {...nativeProps} />\n        ) : (\n          <ProgressBarAndroid {...nativeProps} />\n        )}\n      </View>\n    );\n  }\n});\n\nconst styles = StyleSheet.create({\n  container: {\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  sizeSmall: {\n    width: 20,\n    height: 20,\n  },\n  sizeLarge: {\n    width: 36,\n    height: 36,\n  },\n  sizeHuge: {\n    width: 48,\n    height: 48,\n  },\n});\n\nif (Platform.OS === 'ios' || Platform.OS === 'macos') {\n  var RCTActivityIndicator = requireNativeComponent(\n    'RCTActivityIndicatorView',\n    ActivityIndicator,\n    { nativeOnly: { activityIndicatorViewStyle: true } }\n  );\n}\n\nmodule.exports = ActivityIndicator;\n"
  },
  {
    "path": "Libraries/Components/AppleTV/TVEventHandler.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TVEventHandler\n * @flow\n */\n'use strict';\n\nfunction TVEventHandler() {}\n\nTVEventHandler.prototype.enable = function(component: ?any, callback: Function) {};\n\nTVEventHandler.prototype.disable = function() {};\n\nmodule.exports = TVEventHandler;\n"
  },
  {
    "path": "Libraries/Components/AppleTV/TVEventHandler.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TVEventHandler\n * @flow\n */\n'use strict';\n\nconst React = require('React');\nconst TVNavigationEventEmitter = require('NativeModules').TVNavigationEventEmitter;\nconst NativeEventEmitter = require('NativeEventEmitter');\n\nfunction TVEventHandler() {\n  this.__nativeTVNavigationEventListener = null;\n  this.__nativeTVNavigationEventEmitter = null;\n}\n\nTVEventHandler.prototype.enable = function(component: ?any, callback: Function) {\n  if (!TVNavigationEventEmitter) {\n    return;\n  }\n\n  this.__nativeTVNavigationEventEmitter = new NativeEventEmitter(TVNavigationEventEmitter);\n  this.__nativeTVNavigationEventListener = this.__nativeTVNavigationEventEmitter.addListener(\n    'onTVNavEvent',\n    (data) => {\n      if (callback) {\n        callback(component, data);\n      }\n    }\n  );\n};\n\nTVEventHandler.prototype.disable = function() {\n  if (this.__nativeTVNavigationEventListener) {\n    this.__nativeTVNavigationEventListener.remove();\n    delete this.__nativeTVNavigationEventListener;\n  }\n  if (this.__nativeTVNavigationEventEmitter) {\n    delete this.__nativeTVNavigationEventEmitter;\n  }\n};\n\nmodule.exports = TVEventHandler;\n"
  },
  {
    "path": "Libraries/Components/AppleTV/TVEventHandler.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TVEventHandler\n * @flow\n */\n'use strict';\n\nfunction TVEventHandler() {}\n\nTVEventHandler.prototype.enable = function(component: ?any, callback: Function) {};\n\nTVEventHandler.prototype.disable = function() {};\n\nmodule.exports = TVEventHandler;\n"
  },
  {
    "path": "Libraries/Components/AppleTV/TVViewPropTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TVViewPropTypes\n * @flow\n */\n'use strict';\nvar PropTypes = require('prop-types');\n\n/**\n * Additional View properties for Apple TV\n */\nvar TVViewPropTypes = {\n    /**\n     * *(Apple TV only)* When set to true, this view will be focusable\n     * and navigable using the Apple TV remote.\n     *\n     * @platform ios\n     */\n    isTVSelectable: PropTypes.bool,\n\n    /**\n     * *(Apple TV only)* May be set to true to force the Apple TV focus engine to move focus to this view.\n     *\n     * @platform ios\n     */\n    hasTVPreferredFocus: PropTypes.bool,\n\n    /**\n     * *(Apple TV only)* Object with properties to control Apple TV parallax effects.\n     *\n     * enabled: If true, parallax effects are enabled.  Defaults to true.\n     * shiftDistanceX: Defaults to 2.0.\n     * shiftDistanceY: Defaults to 2.0.\n     * tiltAngle: Defaults to 0.05.\n     * magnification: Defaults to 1.0.\n     *\n     * @platform ios\n     */\n    tvParallaxProperties: PropTypes.object,\n\n    /**\n     * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus.  Defaults to 2.0.\n     *\n     * @platform ios\n     */\n    tvParallaxShiftDistanceX: PropTypes.number,\n\n    /**\n     * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus.  Defaults to 2.0.\n     *\n     * @platform ios\n     */\n    tvParallaxShiftDistanceY: PropTypes.number,\n\n    /**\n     * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus.  Defaults to 0.05.\n     *\n     * @platform ios\n     */\n    tvParallaxTiltAngle: PropTypes.number,\n\n    /**\n     * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus.  Defaults to 1.0.\n     *\n     * @platform ios\n     */\n    tvParallaxMagnification: PropTypes.number,\n\n};\n\nexport type TVViewProps = {\n  isTVSelectable?: bool,\n  hasTVPreferredFocus?: bool,\n  tvParallaxProperties?: Object,\n  tvParallaxShiftDistanceX?: number,\n  tvParallaxShiftDistanceY?: number,\n  tvParallaxTiltAngle?: number,\n  tvParallaxMagnification?: number,\n};\n\nmodule.exports = TVViewPropTypes;\n"
  },
  {
    "path": "Libraries/Components/Button.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Button\n * @flow\n */\n'use strict';\n\nconst ColorPropType = require('ColorPropType');\nconst Platform = require('Platform');\nconst React = require('React');\nconst PropTypes = require('prop-types');\nconst StyleSheet = require('StyleSheet');\nconst Text = require('Text');\nconst TouchableNativeFeedback = require('TouchableNativeFeedback');\nconst TouchableOpacity = require('TouchableOpacity');\nconst View = require('View');\n\nconst invariant = require('fbjs/lib/invariant');\n\nconst requireNativeComponent = require('requireNativeComponent');\nconst NativeModules = require('NativeModules');\n\n/**\n * A basic button component that should render nicely on any platform. Supports\n * a minimal level of customization.\n *\n * <center><img src=\"img/buttonExample.png\"></img></center>\n *\n * If this button doesn't look right for your app, you can build your own\n * button using [TouchableOpacity](docs/touchableopacity.html)\n * or [TouchableNativeFeedback](docs/touchablenativefeedback.html).\n * For inspiration, look at the [source code for this button component](https://github.com/facebook/react-native/blob/master/Libraries/Components/Button.js).\n * Or, take a look at the [wide variety of button components built by the community](https://js.coach/react-native?search=button).\n *\n * Example usage:\n *\n * ```\n * import { Button } from 'react-native';\n * ...\n *\n * <Button\n *   onPress={onPressLearnMore}\n *   title=\"Learn More\"\n *   color=\"#841584\"\n *   accessibilityLabel=\"Learn more about this purple button\"\n * />\n * ```\n *\n */\n\nclass Button extends React.Component<{\n  title: string,\n  onPress: () => any,\n  color?: ?string,\n  accessibilityLabel?: ?string,\n  disabled?: ?boolean,\n  testID?: ?string,\n  hasTVPreferredFocus?: ?boolean,\n}> {\n  static propTypes = {\n    /**\n     * Text to display inside the button\n     */\n    title: PropTypes.string,\n    /**\n     * Text to display for blindness accessibility features\n     */\n    accessibilityLabel: PropTypes.string,\n    /**\n     * Color of the text (iOS), or background color of the button (Android)\n     */\n    color: ColorPropType,\n    /**\n     * If true, disable all interactions for this component.\n     */\n    disabled: PropTypes.bool,\n    /**\n     * Handler to be called when the user taps the button\n     */\n    onPress: PropTypes.func,\n    /**\n     * Used to locate this view in end-to-end tests.\n     */\n    testID: PropTypes.string,\n    /**\n     * macOS Specific\n     */\n    type: PropTypes.oneOf([\n      'momentaryLight',\n      'push',\n      'switch',\n      'toggle',\n      'radio',\n      'onOff',\n      'accelerator',\n    ]),\n    /*\n     * https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/OSXHIGuidelines/SystemProvided.html\n     */\n    systemImage: PropTypes.string,\n    alternateTitle: PropTypes.string,\n    image: PropTypes.oneOfType([\n      PropTypes.shape({\n        uri: PropTypes.string,\n      }),\n      // Opaque type returned by require('./image.jpg')\n      PropTypes.number,\n    ]),\n    alternateImage: PropTypes.oneOfType([\n      PropTypes.shape({\n        uri: PropTypes.string,\n      }),\n      // Opaque type returned by require('./image.jpg')\n      PropTypes.number,\n    ]),\n    bezelStyle: PropTypes.oneOf([\n      'rounded',\n      'regularSquare',\n      'thickSquare',\n      'thickerSquare',\n      'disclosure',\n      'shadowlessSquare',\n      'circular',\n      'texturedSquare',\n      'helpButton',\n      'smallSquare',\n      'texturedRounded',\n      'roundRect',\n      'recessed',\n      'roundedDisclosure',\n      'inline',\n    ]),\n    toolTip: PropTypes.string,\n    allowsMixedState: PropTypes.bool,\n    state: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),\n    style: PropTypes.any,\n  };\n\n  render() {\n    const {\n      accessibilityLabel,\n      color,\n      onPress,\n      title,\n      hasTVPreferredFocus,\n      disabled,\n      testID,\n    } = this.props;\n    const buttonStyles = [styles.button];\n    const textStyles = [styles.text];\n    const Touchable = Platform.OS === 'android'\n      ? TouchableNativeFeedback\n      : TouchableOpacity;\n    if (color && Platform.OS === 'ios') {\n      textStyles.push({ color: color });\n    } else if (color) {\n      buttonStyles.push({ backgroundColor: color });\n    }\n    const accessibilityTraits = ['button'];\n    if (disabled) {\n      buttonStyles.push(styles.buttonDisabled);\n      textStyles.push(styles.textDisabled);\n      accessibilityTraits.push('disabled');\n    }\n    if (Platform.OS === 'ios' || Platform.OS === 'android') {\n      invariant(\n        typeof title === 'string',\n        'The title prop of a Button must be a string'\n      );\n    }\n    const formattedTitle = Platform.OS === 'android'\n      ? title.toUpperCase()\n      : title;\n\n    if (Platform.OS === 'macos') {\n      return (\n        <RCTButton {...this.props} style={[styles.button, this.props.style]} />\n      );\n    }\n    return (\n      <Touchable\n        accessibilityComponentType=\"button\"\n        accessibilityLabel={accessibilityLabel}\n        accessibilityTraits={accessibilityTraits}\n        hasTVPreferredFocus={hasTVPreferredFocus}\n        testID={testID}\n        disabled={disabled}\n        onPress={onPress}>\n        <View style={buttonStyles}>\n          <Text style={textStyles} disabled={disabled}>{formattedTitle}</Text>\n        </View>\n      </Touchable>\n    );\n  }\n}\n\n// Material design blue from https://material.google.com/style/color.html#color-color-palette\nlet defaultBlue = '#2196F3';\nif (Platform.OS === 'ios') {\n  // Measured default tintColor from iOS 10\n  defaultBlue = '#0C42FD';\n}\n\nconst RCTButton = requireNativeComponent('RCTButton', Button, {\n  nativeOnly: {},\n});\n\n\nconst styles = StyleSheet.create({\n  button: Platform.select({\n    ios: {},\n    android: {\n      elevation: 4,\n      // Material design blue from https://material.google.com/style/color.html#color-color-palette\n      backgroundColor: '#2196F3',\n      borderRadius: 2,\n    },\n    macos: {\n      height: NativeModules.ButtonManager.ComponentHeight,\n      width: NativeModules.ButtonManager.ComponentWidth,\n    },\n  }),\n  text: Platform.select({\n    ios: {\n      // iOS blue from https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/\n      color: '#007AFF',\n      textAlign: 'center',\n      padding: 8,\n      fontSize: 18,\n    },\n    android: {\n      color: 'white',\n      textAlign: 'center',\n      padding: 8,\n      fontWeight: '500',\n    },\n  }),\n  buttonDisabled: Platform.select({\n    ios: {},\n    android: {\n      elevation: 0,\n      backgroundColor: '#dfdfdf',\n    },\n  }),\n  textDisabled: Platform.select({\n    ios: {\n      color: '#cdcdcd',\n    },\n    android: {\n      color: '#a1a1a1',\n    },\n  }),\n});\n\nmodule.exports = Button;\n"
  },
  {
    "path": "Libraries/Components/CheckBox/CheckBox.android.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CheckBox\n * @flow\n * @format\n */\n'use strict';\n\nconst NativeMethodsMixin = require('NativeMethodsMixin');\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst StyleSheet = require('StyleSheet');\nconst ViewPropTypes = require('ViewPropTypes');\n\nconst createReactClass = require('create-react-class');\nconst requireNativeComponent = require('requireNativeComponent');\n\ntype DefaultProps = {\n  value: boolean,\n  disabled: boolean,\n};\n\n/**\n * Renders a boolean input (Android only).\n *\n * This is a controlled component that requires an `onValueChange` callback that\n * updates the `value` prop in order for the component to reflect user actions.\n * If the `value` prop is not updated, the component will continue to render\n * the supplied `value` prop instead of the expected result of any user actions.\n *\n * ```\n * import React from 'react';\n * import { AppRegistry, StyleSheet, Text, View, CheckBox } from 'react-native';\n *\n * export default class App extends React.Component {\n *   constructor(props) {\n *     super(props);\n *     this.state = {\n *       checked: false\n *     }\n *   }\n *\n *   toggle() {\n *     this.setState(({checked}) => {\n *       return {\n *         checked: !checked\n *       };\n *     });\n *   }\n *\n *   render() {\n *     const {checked} = this.state;\n *     return (\n *       <View style={styles.container}>\n *         <Text>Checked</Text>\n *         <CheckBox value={checked} onChange={this.toggle.bind(this)} />\n *       </View>\n *     );\n *   }\n * }\n *\n * const styles = StyleSheet.create({\n *   container: {\n *     flex: 1,\n *     flexDirection: 'row',\n *     alignItems: 'center',\n *     justifyContent: 'center',\n *   },\n * });\n *\n * // skip this line if using Create React Native App\n * AppRegistry.registerComponent('App', () => App);\n * ```\n *\n * @keyword checkbox\n * @keyword toggle\n */\nlet CheckBox = createReactClass({\n  displayName: 'CheckBox',\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * The value of the checkbox.  If true the checkbox will be turned on.\n     * Default value is false.\n     */\n    value: PropTypes.bool,\n    /**\n     * If true the user won't be able to toggle the checkbox.\n     * Default value is false.\n     */\n    disabled: PropTypes.bool,\n    /**\n     * Used in case the props change removes the component.\n     */\n    onChange: PropTypes.func,\n    /**\n     * Invoked with the new value when the value changes.\n     */\n    onValueChange: PropTypes.func,\n    /**\n     * Used to locate this view in end-to-end tests.\n     */\n    testID: PropTypes.string,\n  },\n\n  getDefaultProps: function(): DefaultProps {\n    return {\n      value: false,\n      disabled: false,\n    };\n  },\n\n  mixins: [NativeMethodsMixin],\n\n  _rctCheckBox: {},\n  _onChange: function(event: Object) {\n    this._rctCheckBox.setNativeProps({value: this.props.value});\n    // Change the props after the native props are set in case the props\n    // change removes the component\n    this.props.onChange && this.props.onChange(event);\n    this.props.onValueChange &&\n      this.props.onValueChange(event.nativeEvent.value);\n  },\n\n  render: function() {\n    let props = {...this.props};\n    props.onStartShouldSetResponder = () => true;\n    props.onResponderTerminationRequest = () => false;\n    props.enabled = !this.props.disabled;\n    props.on = this.props.value;\n    props.style = [styles.rctCheckBox, this.props.style];\n\n    return (\n      <RCTCheckBox\n        {...props}\n        ref={ref => {\n          /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n           * comment suppresses an error when upgrading Flow's support for\n           * React. To see the error delete this comment and run Flow. */\n          this._rctCheckBox = ref;\n        }}\n        onChange={this._onChange}\n      />\n    );\n  },\n});\n\nlet styles = StyleSheet.create({\n  rctCheckBox: {\n    height: 32,\n    width: 32,\n  },\n});\n\nlet RCTCheckBox = requireNativeComponent('AndroidCheckBox', CheckBox, {\n  nativeOnly: {\n    onChange: true,\n    on: true,\n    enabled: true,\n  },\n});\n\nmodule.exports = CheckBox;\n"
  },
  {
    "path": "Libraries/Components/CheckBox/CheckBox.ios.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CheckBox\n * @flow\n * @format\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/CheckBox/CheckBox.macos.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CheckBox\n * @flow\n * @format\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/Clipboard/Clipboard.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Clipboard\n * @flow\n */\n'use strict';\n\nconst Clipboard = require('NativeModules').Clipboard;\n\n/**\n * `Clipboard` gives you an interface for setting and getting content from Clipboard on both iOS and Android\n */\nmodule.exports = {\n  /**\n   * Get content of string type, this method returns a `Promise`, so you can use following code to get clipboard content\n   * ```javascript\n   * async _getContent() {\n   *   var content = await Clipboard.getString();\n   * }\n   * ```\n   */\n  getString(): Promise<string> {\n    return Clipboard.getString();\n  },\n  /**\n   * Set content of string type. You can use following code to set clipboard content\n   * ```javascript\n   * _setContent() {\n   *   Clipboard.setString('hello world');\n   * }\n   * ```\n   * @param the content to be stored in the clipboard.\n   */\n  setString(content: string) {\n    Clipboard.setString(content);\n  }\n};\n"
  },
  {
    "path": "Libraries/Components/Cursor/Cursor.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Cursor\n * @flow\n */\n'use strict';\n\nconst CursorManager = require('NativeModules').CursorManager;\n\n// All cursor types:\ntype CursorType = $Enum<{\n  arrow: string,\n  IBeam: string,\n  pointingHand: string,\n  closedHand: string,\n  openHand: string,\n  resizeLeft: string,\n  resizeRight: string,\n  resizeLeftRight: string,\n  resizeUp: string,\n  resizeDown: string,\n  resizeUpDown: string,\n  crosshair: string,\n  disappearing: string,\n  operationNotAllowed: string,\n  dragLink: string,\n  dragCopy: string,\n  contextualMenu: string,\n  IBeamForVerticalLayout: string,\n}>;\n\nconst cursorTypeMap = {\n  arrow: 'arrowCursor',\n  IBeam: 'IBeamCursor',\n  pointingHand: 'pointingHandCursor',\n  closedHand: 'closedHandCursor',\n  openHand: 'openHandCursor',\n  resizeLeft: 'resizeLeftCursor',\n  resizeRight: 'resizeRightCursor',\n  resizeLeftRight: 'resizeLeftRightCursor',\n  resizeUp: 'resizeUpCursor',\n  resizeDown: 'resizeDownCursor',\n  resizeUpDown: 'resizeUpDownCursor',\n  crosshair: 'crosshairCursor',\n  disappearing: 'disappearingItemCursor',\n  operationNotAllowed: 'operationNotAllowedCursor',\n  dragLink: 'dragLinkCursor',\n  dragCopy: 'dragCopyCursor',\n  contextualMenu: 'contextualMenuCursor',\n  IBeamForVerticalLayout: 'IBeamCursorForVerticalLayout',\n};\n\n/**\n * Let change cursor style\n * List of all cursor types:\n * https://developer.apple.com/reference/appkit/nscursor?language=objc\n *\n * // Usage\n * ```\n * Cursor.set('openHand');\n * ```\n */\nclass Cursor {\n  static set(type: CursorType): void {\n    if (!cursorTypeMap[type]) {\n      console.warn(`${type} isn't supported cursor type`);\n    } else {\n      const nativeCursorType = cursorTypeMap[type];\n      CursorManager[nativeCursorType]();\n    }\n  }\n}\n\nmodule.exports = Cursor;\n"
  },
  {
    "path": "Libraries/Components/DatePicker/DatePickerIOS.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DatePickerIOS\n * @flow\n *\n * This is a controlled component version of RCTDatePickerIOS\n */\n'use strict';\n\nconst NativeMethodsMixin = require('NativeMethodsMixin');\nconst React = require('React');\nconst PropTypes = require('prop-types');\nconst StyleSheet = require('StyleSheet');\nconst View = require('View');\nconst ViewPropTypes = require('ViewPropTypes');\n\nconst createReactClass = require('create-react-class');\nconst requireNativeComponent = require('requireNativeComponent');\n\ntype DefaultProps = {\n  mode: 'date' | 'time' | 'datetime',\n};\n\ntype Event = Object;\n\n/**\n * Use `DatePickerIOS` to render a date/time picker (selector) on iOS.  This is\n * a controlled component, so you must hook in to the `onDateChange` callback\n * and update the `date` prop in order for the component to update, otherwise\n * the user's change will be reverted immediately to reflect `props.date` as the\n * source of truth.\n */\nconst DatePickerIOS = createReactClass({\n  displayName: 'DatePickerIOS',\n  // TOOD: Put a better type for _picker\n  _picker: (undefined: ?$FlowFixMe),\n\n  mixins: [NativeMethodsMixin],\n\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * The currently selected date.\n     */\n    date: PropTypes.instanceOf(Date).isRequired,\n\n    /**\n     * Date change handler.\n     *\n     * This is called when the user changes the date or time in the UI.\n     * The first and only argument is a Date object representing the new\n     * date and time.\n     */\n    onDateChange: PropTypes.func.isRequired,\n\n    /**\n     * Maximum date.\n     *\n     * Restricts the range of possible date/time values.\n     */\n    maximumDate: PropTypes.instanceOf(Date),\n\n    /**\n     * Minimum date.\n     *\n     * Restricts the range of possible date/time values.\n     */\n    minimumDate: PropTypes.instanceOf(Date),\n\n    /**\n     * The date picker mode.\n     */\n    isRange: PropTypes.oneOf(['single', 'range']),\n\n    /**\n     * The date picker mode.\n     */\n    mode: PropTypes.oneOf(['date', 'time', 'datetime']),\n\n    datePickerMode: PropTypes.oneOf(['single', 'range']),\n\n    datePickerStyle: PropTypes.oneOf(['textField', 'clockAndCalendar', 'textFieldAndStepper']),\n\n    /**\n     * The date picker locale.\n     */\n    locale: PropTypes.string,\n\n    /**\n     * The interval at which minutes can be selected.\n     */\n    minuteInterval: PropTypes.oneOf([1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30]),\n\n    /**\n     * Timezone offset in minutes.\n     *\n     * By default, the date picker will use the device's timezone. With this\n     * parameter, it is possible to force a certain timezone offset. For\n     * instance, to show times in Pacific Standard Time, pass -7 * 60.\n     */\n    timeZoneOffsetInMinutes: PropTypes.number,\n    innerStyle: PropTypes.any,\n  },\n\n  getDefaultProps: function(): DefaultProps {\n    return {\n      mode: 'datetime',\n      datePickerStyle: 'clockAndCalendar'\n    };\n  },\n\n  _onChange: function(event: Event) {\n    const nativeTimeStamp = event.nativeEvent.timestamp;\n    this.props.onDateChange && this.props.onDateChange(\n      new Date(nativeTimeStamp), event.nativeEvent.timeInterval\n    );\n    // $FlowFixMe(>=0.41.0)\n    this.props.onChange && this.props.onChange(event);\n\n    // We expect the onChange* handlers to be in charge of updating our `date`\n    // prop. That way they can also disallow/undo/mutate the selection of\n    // certain values. In other words, the embedder of this component should\n    // be the source of truth, not the native component.\n    const propsTimeStamp = this.props.date.getTime();\n    if (this._picker && nativeTimeStamp !== propsTimeStamp) {\n      this._picker.setNativeProps({\n        date: propsTimeStamp,\n      });\n    }\n  },\n\n  render: function() {\n    const props = this.props;\n    return (\n      <View style={props.style}>\n        <RCTDatePickerIOS\n          ref={ picker => this._picker = picker }\n          style={[styles.datePickerIOS, props.innerStyle]}\n          date={props.date.getTime()}\n          datePickerStyle={props.datePickerStyle}\n          maximumDate={\n            props.maximumDate ? props.maximumDate.getTime() : undefined\n          }\n          minimumDate={\n            props.minimumDate ? props.minimumDate.getTime() : undefined\n          }\n          mode={props.mode}\n          datePickerMode={props.isRange ? 'range' : 'mode'}\n          minuteInterval={props.minuteInterval}\n          timeZoneOffsetInMinutes={props.timeZoneOffsetInMinutes}\n          onChange={this._onChange}\n          onStartShouldSetResponder={() => true}\n          onResponderTerminationRequest={() => false}\n        />\n      </View>\n    );\n  }\n});\n\nconst styles = StyleSheet.create({\n  datePickerIOS: {\n    height: 150,\n    width: 320,\n  },\n});\n\nconst RCTDatePickerIOS = requireNativeComponent('RCTDatePicker', {\n  propTypes: {\n    ...DatePickerIOS.propTypes,\n    date: PropTypes.number,\n    locale: PropTypes.string,\n    minimumDate: PropTypes.number,\n    maximumDate: PropTypes.number,\n    onDateChange: () => null,\n    onChange: PropTypes.func,\n  }\n});\n\nmodule.exports = DatePickerIOS;\n"
  },
  {
    "path": "Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DatePickerAndroid\n * @flow\n */\n'use strict';\n\nconst DatePickerModule = require('NativeModules').DatePickerAndroid;\n\n/**\n * Convert a Date to a timestamp.\n */\nfunction _toMillis(options: Object, key: string) {\n  const dateVal = options[key];\n  // Is it a Date object?\n  if (typeof dateVal === 'object' && typeof dateVal.getMonth === 'function') {\n    options[key] = dateVal.getTime();\n  }\n}\n\n/**\n * Opens the standard Android date picker dialog.\n *\n * ### Example\n *\n * ```\n * try {\n *   const {action, year, month, day} = await DatePickerAndroid.open({\n *     // Use `new Date()` for current date.\n *     // May 25 2020. Month 0 is January.\n *     date: new Date(2020, 4, 25)\n *   });\n *   if (action !== DatePickerAndroid.dismissedAction) {\n *     // Selected year, month (0-11), day\n *   }\n * } catch ({code, message}) {\n *   console.warn('Cannot open date picker', message);\n * }\n * ```\n */\nclass DatePickerAndroid {\n  /**\n   * Opens the standard Android date picker dialog.\n   *\n   * The available keys for the `options` object are:\n   *\n   *   - `date` (`Date` object or timestamp in milliseconds) - date to show by default\n   *   - `minDate` (`Date` or timestamp in milliseconds) - minimum date that can be selected\n   *   - `maxDate` (`Date` object or timestamp in milliseconds) - maximum date that can be selected\n   *   - `mode` (`enum('calendar', 'spinner', 'default')`) - To set the date-picker mode to calendar/spinner/default\n   *     - 'calendar': Show a date picker in calendar mode.\n   *     - 'spinner': Show a date picker in spinner mode.\n   *     - 'default': Show a default native date picker(spinner/calendar) based on android versions.\n   *\n   * Returns a Promise which will be invoked an object containing `action`, `year`, `month` (0-11),\n   * `day` if the user picked a date. If the user dismissed the dialog, the Promise will\n   * still be resolved with action being `DatePickerAndroid.dismissedAction` and all the other keys\n   * being undefined. **Always** check whether the `action` before reading the values.\n   *\n   * Note the native date picker dialog has some UI glitches on Android 4 and lower\n   * when using the `minDate` and `maxDate` options.\n   */\n  static async open(options: Object): Promise<Object> {\n    const optionsMs = options;\n    if (optionsMs) {\n      _toMillis(options, 'date');\n      _toMillis(options, 'minDate');\n      _toMillis(options, 'maxDate');\n    }\n    return DatePickerModule.open(options);\n  }\n\n  /**\n   * A date has been selected.\n   */\n  static get dateSetAction() { return 'dateSetAction'; }\n  /**\n   * The dialog has been dismissed.\n   */\n  static get dismissedAction() { return 'dismissedAction'; }\n}\n\nmodule.exports = DatePickerAndroid;\n"
  },
  {
    "path": "Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DatePickerAndroid\n * @flow\n */\n'use strict';\n\nconst DatePickerAndroid = {\n  async open(options: Object): Promise<Object> {\n    return Promise.reject({\n      message: 'DatePickerAndroid is not supported on this platform.'\n    });\n  },\n};\n\nmodule.exports = DatePickerAndroid;\n"
  },
  {
    "path": "Libraries/Components/DatePickerAndroid/DatePickerAndroid.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DatePickerAndroid\n * @flow\n */\n'use strict';\n\nvar warning = require('fbjs/lib/warning');\n\nconst DatePickerAndroid = {\n  async open(options: Object): Promise<Object> {\n    return Promise.reject({\n      message: 'DatePickerAndroid is not supported on this platform.'\n    });\n  },\n};\n\nmodule.exports = DatePickerAndroid;\n"
  },
  {
    "path": "Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DrawerLayoutAndroid\n */\n'use strict';\n\nvar ColorPropType = require('ColorPropType');\nvar NativeMethodsMixin = require('NativeMethodsMixin');\nvar Platform = require('Platform');\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar ReactNative = require('ReactNative');\nvar StatusBar = require('StatusBar');\nvar StyleSheet = require('StyleSheet');\nvar UIManager = require('UIManager');\nvar View = require('View');\nvar ViewPropTypes = require('ViewPropTypes');\n\nvar DrawerConsts = UIManager.AndroidDrawerLayout.Constants;\n\nvar createReactClass = require('create-react-class');\nvar dismissKeyboard = require('dismissKeyboard');\nvar requireNativeComponent = require('requireNativeComponent');\n\nvar RK_DRAWER_REF = 'drawerlayout';\nvar INNERVIEW_REF = 'innerView';\n\nvar DRAWER_STATES = [\n  'Idle',\n  'Dragging',\n  'Settling',\n];\n\n/**\n * React component that wraps the platform `DrawerLayout` (Android only). The\n * Drawer (typically used for navigation) is rendered with `renderNavigationView`\n * and direct children are the main view (where your content goes). The navigation\n * view is initially not visible on the screen, but can be pulled in from the\n * side of the window specified by the `drawerPosition` prop and its width can\n * be set by the `drawerWidth` prop.\n *\n * Example:\n *\n * ```\n * render: function() {\n *   var navigationView = (\n *     <View style={{flex: 1, backgroundColor: '#fff'}}>\n *       <Text style={{margin: 10, fontSize: 15, textAlign: 'left'}}>I'm in the Drawer!</Text>\n *     </View>\n *   );\n *   return (\n *     <DrawerLayoutAndroid\n *       drawerWidth={300}\n *       drawerPosition={DrawerLayoutAndroid.positions.Left}\n *       renderNavigationView={() => navigationView}>\n *       <View style={{flex: 1, alignItems: 'center'}}>\n *         <Text style={{margin: 10, fontSize: 15, textAlign: 'right'}}>Hello</Text>\n *         <Text style={{margin: 10, fontSize: 15, textAlign: 'right'}}>World!</Text>\n *       </View>\n *     </DrawerLayoutAndroid>\n *   );\n * },\n * ```\n */\nvar DrawerLayoutAndroid = createReactClass({\n  displayName: 'DrawerLayoutAndroid',\n  statics: {\n    positions: DrawerConsts.DrawerPosition,\n  },\n\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * Determines whether the keyboard gets dismissed in response to a drag.\n     *   - 'none' (the default), drags do not dismiss the keyboard.\n     *   - 'on-drag', the keyboard is dismissed when a drag begins.\n     */\n    keyboardDismissMode: PropTypes.oneOf([\n      'none', // default\n      'on-drag',\n    ]),\n    /**\n     * Specifies the background color of the drawer. The default value is white.\n     * If you want to set the opacity of the drawer, use rgba. Example:\n     *\n     * ```\n     * return (\n     *   <DrawerLayoutAndroid drawerBackgroundColor=\"rgba(0,0,0,0.5)\">\n     *   </DrawerLayoutAndroid>\n     * );\n     * ```\n     */\n    drawerBackgroundColor: ColorPropType,\n    /**\n     * Specifies the side of the screen from which the drawer will slide in.\n     */\n    drawerPosition: PropTypes.oneOf([\n      DrawerConsts.DrawerPosition.Left,\n      DrawerConsts.DrawerPosition.Right\n    ]),\n    /**\n     * Specifies the width of the drawer, more precisely the width of the view that be pulled in\n     * from the edge of the window.\n     */\n    drawerWidth: PropTypes.number,\n    /**\n     * Specifies the lock mode of the drawer. The drawer can be locked in 3 states:\n     * - unlocked (default), meaning that the drawer will respond (open/close) to touch gestures.\n     * - locked-closed, meaning that the drawer will stay closed and not respond to gestures.\n     * - locked-open, meaning that the drawer will stay opened and not respond to gestures.\n     * The drawer may still be opened and closed programmatically (`openDrawer`/`closeDrawer`).\n     */\n    drawerLockMode: PropTypes.oneOf([\n      'unlocked',\n      'locked-closed',\n      'locked-open'\n    ]),\n    /**\n     * Function called whenever there is an interaction with the navigation view.\n     */\n    onDrawerSlide: PropTypes.func,\n    /**\n     * Function called when the drawer state has changed. The drawer can be in 3 states:\n     * - idle, meaning there is no interaction with the navigation view happening at the time\n     * - dragging, meaning there is currently an interaction with the navigation view\n     * - settling, meaning that there was an interaction with the navigation view, and the\n     * navigation view is now finishing its closing or opening animation\n     */\n    onDrawerStateChanged: PropTypes.func,\n    /**\n     * Function called whenever the navigation view has been opened.\n     */\n    onDrawerOpen: PropTypes.func,\n    /**\n     * Function called whenever the navigation view has been closed.\n     */\n    onDrawerClose: PropTypes.func,\n    /**\n     * The navigation view that will be rendered to the side of the screen and can be pulled in.\n     */\n    renderNavigationView: PropTypes.func.isRequired,\n\n    /**\n     * Make the drawer take the entire screen and draw the background of the\n     * status bar to allow it to open over the status bar. It will only have an\n     * effect on API 21+.\n     */\n    statusBarBackgroundColor: ColorPropType,\n  },\n\n  mixins: [NativeMethodsMixin],\n\n  getDefaultProps: function(): Object {\n    return {\n      drawerBackgroundColor: 'white',\n    };\n  },\n\n  getInitialState: function() {\n    return {statusBarBackgroundColor: undefined};\n  },\n\n  getInnerViewNode: function() {\n    return this.refs[INNERVIEW_REF].getInnerViewNode();\n  },\n\n  render: function() {\n    var drawStatusBar = Platform.Version >= 21 && this.props.statusBarBackgroundColor;\n    var drawerViewWrapper =\n      <View\n        style={[\n          styles.drawerSubview,\n          {width: this.props.drawerWidth, backgroundColor: this.props.drawerBackgroundColor}\n        ]}\n        collapsable={false}>\n        {this.props.renderNavigationView()}\n        {drawStatusBar && <View style={styles.drawerStatusBar} />}\n      </View>;\n    var childrenWrapper =\n      <View ref={INNERVIEW_REF} style={styles.mainSubview} collapsable={false}>\n        {drawStatusBar &&\n        <StatusBar\n          translucent\n          backgroundColor={this.props.statusBarBackgroundColor}\n        />}\n        {drawStatusBar &&\n        <View style={[\n          styles.statusBar,\n          {backgroundColor: this.props.statusBarBackgroundColor}\n        ]} />}\n        {this.props.children}\n      </View>;\n    return (\n      <AndroidDrawerLayout\n        {...this.props}\n        ref={RK_DRAWER_REF}\n        drawerWidth={this.props.drawerWidth}\n        drawerPosition={this.props.drawerPosition}\n        drawerLockMode={this.props.drawerLockMode}\n        style={[styles.base, this.props.style]}\n        onDrawerSlide={this._onDrawerSlide}\n        onDrawerOpen={this._onDrawerOpen}\n        onDrawerClose={this._onDrawerClose}\n        onDrawerStateChanged={this._onDrawerStateChanged}>\n        {childrenWrapper}\n        {drawerViewWrapper}\n      </AndroidDrawerLayout>\n    );\n  },\n\n  _onDrawerSlide: function(event) {\n    if (this.props.onDrawerSlide) {\n      this.props.onDrawerSlide(event);\n    }\n    if (this.props.keyboardDismissMode === 'on-drag') {\n      dismissKeyboard();\n    }\n  },\n\n  _onDrawerOpen: function() {\n    if (this.props.onDrawerOpen) {\n      this.props.onDrawerOpen();\n    }\n  },\n\n  _onDrawerClose: function() {\n    if (this.props.onDrawerClose) {\n      this.props.onDrawerClose();\n    }\n  },\n\n  _onDrawerStateChanged: function(event) {\n    if (this.props.onDrawerStateChanged) {\n      this.props.onDrawerStateChanged(DRAWER_STATES[event.nativeEvent.drawerState]);\n    }\n  },\n\n  /**\n   * Opens the drawer.\n   */\n  openDrawer: function() {\n    UIManager.dispatchViewManagerCommand(\n      this._getDrawerLayoutHandle(),\n      UIManager.AndroidDrawerLayout.Commands.openDrawer,\n      null\n    );\n  },\n\n  /**\n   * Closes the drawer.\n   */\n  closeDrawer: function() {\n    UIManager.dispatchViewManagerCommand(\n      this._getDrawerLayoutHandle(),\n      UIManager.AndroidDrawerLayout.Commands.closeDrawer,\n      null\n    );\n  },\n  /**\n  * Closing and opening example\n  * Note: To access the drawer you have to give it a ref. Refs do not work on stateless components\n  * render () {\n  *   this.openDrawer = () => {\n  *     this.refs.DRAWER.openDrawer()\n  *   }\n  *   this.closeDrawer = () => {\n  *     this.refs.DRAWER.closeDrawer()\n  *   }\n  *   return (\n  *     <DrawerLayoutAndroid ref={'DRAWER'}>\n  *     </DrawerLayoutAndroid>\n  *   )\n  * }\n  */\n  _getDrawerLayoutHandle: function() {\n    return ReactNative.findNodeHandle(this.refs[RK_DRAWER_REF]);\n  },\n\n});\n\nvar styles = StyleSheet.create({\n  base: {\n    flex: 1,\n    elevation: 16,\n  },\n  mainSubview: {\n    position: 'absolute',\n    top: 0,\n    left: 0,\n    right: 0,\n    bottom: 0,\n  },\n  drawerSubview: {\n    position: 'absolute',\n    top: 0,\n    bottom: 0,\n  },\n  statusBar: {\n    height: StatusBar.currentHeight,\n  },\n  drawerStatusBar: {\n    position: 'absolute',\n    top: 0,\n    left: 0,\n    right: 0,\n    height: StatusBar.currentHeight,\n    backgroundColor: 'rgba(0, 0, 0, 0.251)',\n  },\n});\n\n// The View that contains both the actual drawer and the main view\nvar AndroidDrawerLayout = requireNativeComponent('AndroidDrawerLayout', DrawerLayoutAndroid);\n\nmodule.exports = DrawerLayoutAndroid;\n"
  },
  {
    "path": "Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DrawerLayoutAndroid\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/Intent/IntentAndroid.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule IntentAndroid\n */\n'use strict';\n\nmodule.exports = {\n  openURL: function(url) {\n    console.error('IntentAndroid is not supported on iOS');\n  },\n};\n"
  },
  {
    "path": "Libraries/Components/Keyboard/Keyboard.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Keyboard\n * @flow\n */\n'use strict';\n\nconst LayoutAnimation = require('LayoutAnimation');\nconst invariant = require('fbjs/lib/invariant');\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst KeyboardObserver = require('NativeModules').KeyboardObserver;\nconst dismissKeyboard = require('dismissKeyboard');\nconst KeyboardEventEmitter = new NativeEventEmitter(KeyboardObserver);\n\ntype KeyboardEventName =\n  | 'keyboardWillShow'\n  | 'keyboardDidShow'\n  | 'keyboardWillHide'\n  | 'keyboardDidHide'\n  | 'keyboardWillChangeFrame'\n  | 'keyboardDidChangeFrame';\n\nexport type KeyboardEvent = {|\n  +duration?: number,\n  +easing?: string,\n  +endCoordinates: {|\n    +width: number,\n    +height: number,\n    +screenX: number,\n    +screenY: number,\n  |},\n|};\n\ntype KeyboardEventListener = (e: KeyboardEvent) => void;\n\n// The following object exists for documentation purposes\n// Actual work happens in\n// https://github.com/facebook/react-native/blob/master/Libraries/EventEmitter/NativeEventEmitter.js\n\n/**\n * `Keyboard` module to control keyboard events.\n *\n * ### Usage\n *\n * The Keyboard module allows you to listen for native events and react to them, as\n * well as make changes to the keyboard, like dismissing it.\n *\n *```\n * import React, { Component } from 'react';\n * import { Keyboard, TextInput } from 'react-native';\n *\n * class Example extends Component {\n *   componentWillMount () {\n *     this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);\n *     this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);\n *   }\n *\n *   componentWillUnmount () {\n *     this.keyboardDidShowListener.remove();\n *     this.keyboardDidHideListener.remove();\n *   }\n *\n *   _keyboardDidShow () {\n *     alert('Keyboard Shown');\n *   }\n *\n *   _keyboardDidHide () {\n *     alert('Keyboard Hidden');\n *   }\n *\n *   render() {\n *     return (\n *       <TextInput\n *         onSubmitEditing={Keyboard.dismiss}\n *       />\n *     );\n *   }\n * }\n *```\n */\n\nlet Keyboard = {\n  /**\n   * The `addListener` function connects a JavaScript function to an identified native\n   * keyboard notification event.\n   *\n   * This function then returns the reference to the listener.\n   *\n   * @param {string} eventName The `nativeEvent` is the string that identifies the event you're listening for.  This\n   *can be any of the following:\n   *\n   * - `keyboardWillShow`\n   * - `keyboardDidShow`\n   * - `keyboardWillHide`\n   * - `keyboardDidHide`\n   * - `keyboardWillChangeFrame`\n   * - `keyboardDidChangeFrame`\n   *\n   * Note that if you set `android:windowSoftInputMode` to `adjustResize`  or `adjustNothing`,\n   * only `keyboardDidShow` and `keyboardDidHide` events will be available on Android.\n   * `keyboardWillShow` as well as `keyboardWillHide` are generally not available on Android\n   * since there is no native corresponding event.\n   *\n   * @param {function} callback function to be called when the event fires.\n   */\n  addListener(eventName: KeyboardEventName, callback: KeyboardEventListener) {\n    invariant(false, 'Dummy method used for documentation');\n  },\n\n  /**\n   * Removes a specific listener.\n   *\n   * @param {string} eventName The `nativeEvent` is the string that identifies the event you're listening for.\n   * @param {function} callback function to be called when the event fires.\n   */\n  removeListener(eventName: KeyboardEventName, callback: Function) {\n    invariant(false, 'Dummy method used for documentation');\n  },\n\n  /**\n   * Removes all listeners for a specific event type.\n   *\n   * @param {string} eventType The native event string listeners are watching which will be removed.\n   */\n  removeAllListeners(eventName: KeyboardEventName) {\n    invariant(false, 'Dummy method used for documentation');\n  },\n\n  /**\n   * Dismisses the active keyboard and removes focus.\n   */\n  dismiss() {\n    invariant(false, 'Dummy method used for documentation');\n  },\n\n  /**\n   * Useful for syncing TextInput (or other keyboard accessory view) size of\n   * position changes with keyboard movements.\n   */\n  scheduleLayoutAnimation(event: KeyboardEvent) {\n    invariant(false, 'Dummy method used for documentation');\n  },\n};\n\n// Throw away the dummy object and reassign it to original module\nKeyboard = KeyboardEventEmitter;\nKeyboard.dismiss = dismissKeyboard;\nKeyboard.scheduleLayoutAnimation = function(event: KeyboardEvent) {\n  const {duration, easing} = event;\n  if (duration) {\n    LayoutAnimation.configureNext({\n      duration: duration,\n      update: {\n        duration: duration,\n        type: (easing && LayoutAnimation.Types[easing]) || 'keyboard',\n      },\n    });\n  }\n};\n\nmodule.exports = Keyboard;\n"
  },
  {
    "path": "Libraries/Components/Keyboard/Keyboard.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Keyboard\n * @flow\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/Keyboard/KeyboardAvoidingView.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule KeyboardAvoidingView\n * @flow\n */\n'use strict';\n\nconst createReactClass = require('create-react-class');\nconst Keyboard = require('Keyboard');\nconst LayoutAnimation = require('LayoutAnimation');\nconst Platform = require('Platform');\nconst PropTypes = require('prop-types');\nconst React = require('React');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst TimerMixin = require('react-timer-mixin');\nconst View = require('View');\nconst ViewPropTypes = require('ViewPropTypes');\n\nimport type EmitterSubscription from 'EmitterSubscription';\nimport type {ViewLayout, ViewLayoutEvent} from 'ViewPropTypes';\n\ntype ScreenRect = {\n  screenX: number,\n  screenY: number,\n  width: number,\n  height: number,\n};\ntype KeyboardChangeEvent = {\n  startCoordinates?: ScreenRect,\n  endCoordinates: ScreenRect,\n  duration?: number,\n  easing?: string,\n};\n\nconst viewRef = 'VIEW';\n\n/**\n * This is a component to solve the common problem of views that need to move out of the way of the virtual keyboard.\n * It can automatically adjust either its height, position or bottom padding based on the position of the keyboard.\n */\nconst KeyboardAvoidingView = createReactClass({\n  displayName: 'KeyboardAvoidingView',\n  mixins: [TimerMixin],\n\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * Specify how the `KeyboardAvoidingView` will react to the presence of\n     * the keyboard. It can adjust the height, position or bottom padding of the view\n     */\n    behavior: PropTypes.oneOf(['height', 'position', 'padding']),\n\n    /**\n     * The style of the content container(View) when behavior is 'position'.\n     */\n    contentContainerStyle: ViewPropTypes.style,\n\n    /**\n     * This is the distance between the top of the user screen and the react native view,\n     * may be non-zero in some use cases. The default value is 0.\n     */\n    keyboardVerticalOffset: PropTypes.number.isRequired,\n  },\n\n  getDefaultProps() {\n    return {\n      keyboardVerticalOffset: 0,\n    };\n  },\n\n  getInitialState() {\n    return {\n      bottom: 0,\n    };\n  },\n\n  subscriptions: ([]: Array<EmitterSubscription>),\n  frame: (null: ?ViewLayout),\n\n  _relativeKeyboardHeight(keyboardFrame: ScreenRect): number {\n    const frame = this.frame;\n    if (!frame || !keyboardFrame) {\n      return 0;\n    }\n\n    const keyboardY = keyboardFrame.screenY - this.props.keyboardVerticalOffset;\n\n    // Calculate the displacement needed for the view such that it\n    // no longer overlaps with the keyboard\n    return Math.max(frame.y + frame.height - keyboardY, 0);\n  },\n\n  _onKeyboardChange(event: ?KeyboardChangeEvent) {\n    if (!event) {\n      this.setState({bottom: 0});\n      return;\n    }\n\n    const {duration, easing, endCoordinates} = event;\n    const height = this._relativeKeyboardHeight(endCoordinates);\n\n    if (this.state.bottom === height) {\n      return;\n    }\n\n    if (duration && easing) {\n      LayoutAnimation.configureNext({\n        duration: duration,\n        update: {\n          duration: duration,\n          type: LayoutAnimation.Types[easing] || 'keyboard',\n        },\n      });\n    }\n    this.setState({bottom: height});\n  },\n\n  _onLayout(event: ViewLayoutEvent) {\n    this.frame = event.nativeEvent.layout;\n  },\n\n  componentWillUpdate(nextProps: Object, nextState: Object, nextContext?: Object): void {\n    if (nextState.bottom === this.state.bottom &&\n        this.props.behavior === 'height' &&\n        nextProps.behavior === 'height') {\n      // If the component rerenders without an internal state change, e.g.\n      // triggered by parent component re-rendering, no need for bottom to change.\n      nextState.bottom = 0;\n    }\n  },\n\n  componentWillMount() {\n    if (Platform.OS === 'ios') {\n      this.subscriptions = [\n        Keyboard.addListener('keyboardWillChangeFrame', this._onKeyboardChange),\n      ];\n    } else {\n      this.subscriptions = [\n        Keyboard.addListener('keyboardDidHide', this._onKeyboardChange),\n        Keyboard.addListener('keyboardDidShow', this._onKeyboardChange),\n      ];\n    }\n  },\n\n  componentWillUnmount() {\n    this.subscriptions.forEach((sub) => sub.remove());\n  },\n\n  render(): React.Element<any> {\n    // $FlowFixMe(>=0.41.0)\n    const {behavior, children, style, ...props} = this.props;\n\n    switch (behavior) {\n      case 'height':\n        let heightStyle;\n        if (this.frame) {\n          // Note that we only apply a height change when there is keyboard present,\n          // i.e. this.state.bottom is greater than 0. If we remove that condition,\n          // this.frame.height will never go back to its original value.\n          // When height changes, we need to disable flex.\n          heightStyle = {height: this.frame.height - this.state.bottom, flex: 0};\n        }\n        return (\n          <View ref={viewRef} style={[style, heightStyle]} onLayout={this._onLayout} {...props}>\n            {children}\n          </View>\n        );\n\n      case 'position':\n        const positionStyle = {bottom: this.state.bottom};\n        const { contentContainerStyle } = this.props;\n\n        return (\n          <View ref={viewRef} style={style} onLayout={this._onLayout} {...props}>\n            <View style={[contentContainerStyle, positionStyle]}>\n              {children}\n            </View>\n          </View>\n        );\n\n      case 'padding':\n        const paddingStyle = {paddingBottom: this.state.bottom};\n        return (\n          <View ref={viewRef} style={[style, paddingStyle]} onLayout={this._onLayout} {...props}>\n            {children}\n          </View>\n        );\n\n      default:\n        return (\n          <View ref={viewRef} onLayout={this._onLayout} style={style} {...props}>\n            {children}\n          </View>\n        );\n    }\n  },\n});\n\nmodule.exports = KeyboardAvoidingView;\n"
  },
  {
    "path": "Libraries/Components/LazyRenderer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule LazyRenderer\n */\n'use strict';\n\nvar React = require('React');\nvar createReactClass = require('create-react-class');\nvar PropTypes = require('prop-types');\nvar TimerMixin = require('react-timer-mixin');\n\nvar LazyRenderer = createReactClass({\n  displayName: 'LazyRenderer',\n  mixin: [TimerMixin],\n\n  propTypes: {\n    render: PropTypes.func.isRequired,\n  },\n\n  componentWillMount: function(): void {\n    this.setState({\n      _lazyRender : true,\n    });\n  },\n\n  componentDidMount: function(): void {\n    requestAnimationFrame(() => {\n      this.setState({\n        _lazyRender : false,\n      });\n    });\n  },\n\n  render: function(): ?React.Element {\n    return this.state._lazyRender ? null : this.props.render();\n  },\n});\n\nmodule.exports = LazyRenderer;\n"
  },
  {
    "path": "Libraries/Components/MaskedView/MaskedViewIOS.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule MaskedViewIOS\n * @flow\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/MaskedView/MaskedViewIOS.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule MaskedViewIOS\n * @flow\n */\n\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst StyleSheet = require('StyleSheet');\nconst View = require('View');\nconst ViewPropTypes = require('ViewPropTypes');\nconst requireNativeComponent = require('requireNativeComponent');\n\nimport type { ViewProps } from 'ViewPropTypes';\n\ntype Props = ViewProps & {\n  children: any,\n  /**\n   * Should be a React element to be rendered and applied as the\n   * mask for the child element.\n   */\n  maskElement: React.Element<any>,\n};\n\n/**\n * Renders the child view with a mask specified in the `maskElement` prop.\n *\n * ```\n * import React from 'react';\n * import { MaskedViewIOS, Text, View } from 'react-native';\n *\n * class MyMaskedView extends React.Component {\n *   render() {\n *     return (\n *       <MaskedViewIOS\n *         style={{ flex: 1 }}\n *         maskElement={\n *           <View style={styles.maskContainerStyle}>\n *             <Text style={styles.maskTextStyle}>\n *               Basic Mask\n *             </Text>\n *           </View>\n *         }\n *       >\n *         <View style={{ flex: 1, backgroundColor: 'blue' }} />\n *       </MaskedViewIOS>\n *     );\n *   }\n * }\n * ```\n *\n * The above example will render a view with a blue background that fills its\n * parent, and then mask that view with text that says \"Basic Mask\".\n *\n * The alpha channel of the view rendered by the `maskElement` prop determines how\n * much of the view's content and background shows through. Fully or partially\n * opaque pixels allow the underlying content to show through but fully\n * transparent pixels block that content.\n *\n */\nclass MaskedViewIOS extends React.Component<Props> {\n  static propTypes = {\n    ...ViewPropTypes,\n    maskElement: PropTypes.element.isRequired,\n  };\n\n  _hasWarnedInvalidRenderMask = false;\n\n  render() {\n    const { maskElement, children, ...otherViewProps } = this.props;\n\n    if (!React.isValidElement(maskElement)) {\n      if (!this._hasWarnedInvalidRenderMask) {\n        console.warn(\n          'MaskedView: Invalid `maskElement` prop was passed to MaskedView. ' +\n            'Expected a React Element. No mask will render.'\n        );\n        this._hasWarnedInvalidRenderMask = true;\n      }\n      return <View {...otherViewProps}>{children}</View>;\n    }\n\n    return (\n      <RCTMaskedView {...otherViewProps}>\n        <View pointerEvents=\"none\" style={StyleSheet.absoluteFill}>\n          {maskElement}\n        </View>\n        {children}\n      </RCTMaskedView>\n    );\n  }\n}\n\nconst RCTMaskedView = requireNativeComponent('RCTMaskedView', {\n  name: 'RCTMaskedView',\n  displayName: 'RCTMaskedView',\n  propTypes: {\n    ...ViewPropTypes,\n  },\n});\n\nmodule.exports = MaskedViewIOS;\n"
  },
  {
    "path": "Libraries/Components/MaskedView/MaskedViewIOS.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule MaskedViewIOS\n * @flow\n */\n\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst StyleSheet = require('StyleSheet');\nconst View = require('View');\nconst ViewPropTypes = require('ViewPropTypes');\nconst requireNativeComponent = require('requireNativeComponent');\n\nimport type { ViewProps } from 'ViewPropTypes';\n\ntype Props = ViewProps & {\n  children: any,\n  /**\n   * Should be a React element to be rendered and applied as the\n   * mask for the child element.\n   */\n  maskElement: React.Element<any>,\n};\n\n/**\n * Renders the child view with a mask specified in the `maskElement` prop.\n *\n * ```\n * import React from 'react';\n * import { MaskedViewIOS, Text, View } from 'react-native';\n *\n * class MyMaskedView extends React.Component {\n *   render() {\n *     return (\n *       <MaskedViewIOS\n *         style={{ flex: 1 }}\n *         maskElement={\n *           <View style={styles.maskContainerStyle}>\n *             <Text style={styles.maskTextStyle}>\n *               Basic Mask\n *             </Text>\n *           </View>\n *         }\n *       >\n *         <View style={{ flex: 1, backgroundColor: 'blue' }} />\n *       </MaskedViewIOS>\n *     );\n *   }\n * }\n * ```\n *\n * The above example will render a view with a blue background that fills its\n * parent, and then mask that view with text that says \"Basic Mask\".\n *\n * The alpha channel of the view rendered by the `maskElement` prop determines how\n * much of the view's content and background shows through. Fully or partially\n * opaque pixels allow the underlying content to show through but fully\n * transparent pixels block that content.\n *\n */\nclass MaskedViewIOS extends React.Component<Props> {\n  static propTypes = {\n    ...ViewPropTypes,\n    maskElement: PropTypes.element.isRequired,\n  };\n\n  _hasWarnedInvalidRenderMask = false;\n\n  render() {\n    const { maskElement, children, ...otherViewProps } = this.props;\n\n    if (!React.isValidElement(maskElement)) {\n      if (!this._hasWarnedInvalidRenderMask) {\n        console.warn(\n          'MaskedView: Invalid `maskElement` prop was passed to MaskedView. ' +\n            'Expected a React Element. No mask will render.'\n        );\n        this._hasWarnedInvalidRenderMask = true;\n      }\n      return <View {...otherViewProps}>{children}</View>;\n    }\n\n    return (\n      <RCTMaskedView {...otherViewProps}>\n        <View pointerEvents=\"none\" style={StyleSheet.absoluteFill}>\n          {maskElement}\n        </View>\n        {children}\n      </RCTMaskedView>\n    );\n  }\n}\n\nconst RCTMaskedView = requireNativeComponent('RCTMaskedView', {\n  name: 'RCTMaskedView',\n  displayName: 'RCTMaskedView',\n  propTypes: {\n    ...ViewPropTypes,\n  },\n});\n\nmodule.exports = MaskedViewIOS;\n"
  },
  {
    "path": "Libraries/Components/Navigation/NavigatorIOS.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule NavigatorIOS\n * @flow\n */\n'use strict';\n\nvar EventEmitter = require('EventEmitter');\nvar Image = require('Image');\nvar RCTNavigatorManager = require('NativeModules').NavigatorManager;\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar ReactNative = require('ReactNative');\nvar StaticContainer = require('StaticContainer.react');\nvar StyleSheet = require('StyleSheet');\nvar TVEventHandler = require('TVEventHandler');\nvar View = require('View');\nvar ViewPropTypes = require('ViewPropTypes');\n\nvar createReactClass = require('create-react-class');\nvar invariant = require('fbjs/lib/invariant');\nvar requireNativeComponent = require('requireNativeComponent');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst keyMirror = require('fbjs/lib/keyMirror');\n\nvar TRANSITIONER_REF = 'transitionerRef';\n\nvar __uid = 0;\nfunction getuid() {\n  return __uid++;\n}\n\nclass NavigatorTransitionerIOS extends React.Component<$FlowFixMeProps> {\n  requestSchedulingNavigation(cb) {\n    RCTNavigatorManager.requestSchedulingJavaScriptNavigation(\n      ReactNative.findNodeHandle(this),\n      cb\n    );\n  }\n\n  render() {\n    return (\n      <RCTNavigator {...this.props}/>\n    );\n  }\n}\n\nconst SystemIconLabels = {\n  done: true,\n  cancel: true,\n  edit: true,\n  save: true,\n  add: true,\n  compose: true,\n  reply: true,\n  action: true,\n  organize: true,\n  bookmarks: true,\n  search: true,\n  refresh: true,\n  stop: true,\n  camera: true,\n  trash: true,\n  play: true,\n  pause: true,\n  rewind: true,\n  'fast-forward': true,\n  undo: true,\n  redo: true,\n  'page-curl': true,\n};\nconst SystemIcons = keyMirror(SystemIconLabels);\n\ntype SystemButtonType = $Enum<typeof SystemIconLabels>;\n\ntype Route = {\n  component: Function,\n  title: string,\n  titleImage?: Object,\n  passProps?: Object,\n  backButtonTitle?: string,\n  backButtonIcon?: Object,\n  leftButtonTitle?: string,\n  leftButtonIcon?: Object,\n  leftButtonSystemIcon?: SystemButtonType,\n  onLeftButtonPress?: Function,\n  rightButtonTitle?: string,\n  rightButtonIcon?: Object,\n  rightButtonSystemIcon?: SystemButtonType,\n  onRightButtonPress?: Function,\n  wrapperStyle?: any,\n};\n\ntype State = {\n  idStack: Array<number>,\n  routeStack: Array<Route>,\n  requestedTopOfStack: number,\n  observedTopOfStack: number,\n  progress: number,\n  fromIndex: number,\n  toIndex: number,\n  makingNavigatorRequest: boolean,\n  updatingAllIndicesAtOrBeyond: ?number,\n}\n\ntype Event = Object;\n\n/**\n * Think of `<NavigatorIOS>` as simply a component that renders an\n * `RCTNavigator`, and moves the `RCTNavigator`'s `requestedTopOfStack` pointer\n * forward and backward. The `RCTNavigator` interprets changes in\n * `requestedTopOfStack` to be pushes and pops of children that are rendered.\n * `<NavigatorIOS>` always ensures that whenever the `requestedTopOfStack`\n * pointer is moved, that we've also rendered enough children so that the\n * `RCTNavigator` can carry out the push/pop with those children.\n * `<NavigatorIOS>` also removes children that will no longer be needed\n * (after the pop of a child has been fully completed/animated out).\n */\n\n/**\n * `NavigatorIOS` is a wrapper around\n * [`UINavigationController`](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationController_Class/),\n * enabling you to implement a navigation stack. It works exactly the same as it\n * would on a native app using `UINavigationController`, providing the same\n * animations and behavior from UIKit.\n *\n * As the name implies, it is only available on iOS. Take a look at\n * [`React Navigation`](https://reactnavigation.org/) for a cross-platform\n * solution in JavaScript, or check out either of these components for native\n * solutions: [native-navigation](http://airbnb.io/native-navigation/),\n * [react-native-navigation](https://github.com/wix/react-native-navigation).\n *\n * To set up the navigator, provide the `initialRoute` prop with a route\n * object. A route object is used to describe each scene that your app\n * navigates to. `initialRoute` represents the first route in your navigator.\n *\n * ```\n * import PropTypes from 'prop-types';\n * import React, { Component } from 'react';\n * import { NavigatorIOS, Text } from 'react-native';\n *\n * export default class NavigatorIOSApp extends Component {\n *   render() {\n *     return (\n *       <NavigatorIOS\n *         initialRoute={{\n *           component: MyScene,\n *           title: 'My Initial Scene',\n *         }}\n *         style={{flex: 1}}\n *       />\n *     );\n *   }\n * }\n *\n * class MyScene extends Component {\n *   static propTypes = {\n *     title: PropTypes.string.isRequired,\n *     navigator: PropTypes.object.isRequired,\n *   }\n *\n *   _onForward = () => {\n *     this.props.navigator.push({\n *       title: 'Scene ' + nextIndex,\n *     });\n *   }\n *\n *   render() {\n *     return (\n *       <View>\n *         <Text>Current Scene: { this.props.title }</Text>\n *         <TouchableHighlight onPress={this._onForward}>\n *           <Text>Tap me to load the next scene</Text>\n *         </TouchableHighlight>\n *       </View>\n *     )\n *   }\n * }\n * ```\n *\n * In this code, the navigator renders the component specified in initialRoute,\n * which in this case is `MyScene`. This component will receive a `route` prop\n * and a `navigator` prop representing the navigator. The navigator's navigation\n * bar will render the title for the current scene, \"My Initial Scene\".\n *\n * You can optionally pass in a `passProps` property to your `initialRoute`.\n * `NavigatorIOS` passes this in as props to the rendered component:\n *\n * ```\n * initialRoute={{\n *   component: MyScene,\n *   title: 'My Initial Scene',\n *   passProps: { myProp: 'foo' }\n * }}\n * ```\n *\n * You can then access the props passed in via `{this.props.myProp}`.\n *\n * #### Handling Navigation\n *\n * To trigger navigation functionality such as pushing or popping a view, you\n * have access to a `navigator` object. The object is passed in as a prop to any\n * component that is rendered by `NavigatorIOS`. You can then call the\n * relevant methods to perform the navigation action you need:\n *\n * ```\n * class MyView extends Component {\n *   _handleBackPress() {\n *     this.props.navigator.pop();\n *   }\n *\n *   _handleNextPress(nextRoute) {\n *     this.props.navigator.push(nextRoute);\n *   }\n *\n *   render() {\n *     const nextRoute = {\n *       component: MyView,\n *       title: 'Bar That',\n *       passProps: { myProp: 'bar' }\n *     };\n *     return(\n *       <TouchableHighlight onPress={() => this._handleNextPress(nextRoute)}>\n *         <Text style={{marginTop: 200, alignSelf: 'center'}}>\n *           See you on the other nav {this.props.myProp}!\n *         </Text>\n *       </TouchableHighlight>\n *     );\n *   }\n * }\n * ```\n *\n * You can also trigger navigator functionality from the `NavigatorIOS`\n * component:\n *\n * ```\n * class NavvyIOS extends Component {\n *   _handleNavigationRequest() {\n *     this.refs.nav.push({\n *       component: MyView,\n *       title: 'Genius',\n *       passProps: { myProp: 'genius' },\n *     });\n *   }\n *\n *   render() {\n *     return (\n *       <NavigatorIOS\n *         ref='nav'\n *         initialRoute={{\n *           component: MyView,\n *           title: 'Foo This',\n *           passProps: { myProp: 'foo' },\n *           rightButtonTitle: 'Add',\n *           onRightButtonPress: () => this._handleNavigationRequest(),\n *         }}\n *         style={{flex: 1}}\n *       />\n *     );\n *   }\n * }\n * ```\n *\n * The code above adds a `_handleNavigationRequest` private method that is\n * invoked from the `NavigatorIOS` component when the right navigation bar item\n * is pressed. To get access to the navigator functionality, a reference to it\n * is saved in the `ref` prop and later referenced to push a new scene into the\n * navigation stack.\n *\n * #### Navigation Bar Configuration\n *\n * Props passed to `NavigatorIOS` will set the default configuration\n * for the navigation bar. Props passed as properties to a route object will set\n * the configuration for that route's navigation bar, overriding any props\n * passed to the `NavigatorIOS` component.\n *\n * ```\n * _handleNavigationRequest() {\n *   this.refs.nav.push({\n *     //...\n *     passProps: { myProp: 'genius' },\n *     barTintColor: '#996699',\n *   });\n * }\n *\n * render() {\n *   return (\n *     <NavigatorIOS\n *       //...\n *       style={{flex: 1}}\n *       barTintColor='#ffffcc'\n *     />\n *   );\n * }\n * ```\n *\n * In the example above the navigation bar color is changed when the new route\n * is pushed.\n *\n */\nvar NavigatorIOS = createReactClass({\n  displayName: 'NavigatorIOS',\n\n  propTypes: {\n\n    /**\n     * NavigatorIOS uses `route` objects to identify child views, their props,\n     * and navigation bar configuration. Navigation operations such as push\n     * operations expect routes to look like this the `initialRoute`.\n     */\n    initialRoute: PropTypes.shape({\n      /**\n       * The React Class to render for this route\n       */\n      component: PropTypes.func.isRequired,\n\n      /**\n       * The title displayed in the navigation bar and the back button for this\n       * route.\n       */\n      title: PropTypes.string.isRequired,\n\n      /**\n       * If set, a title image will appear instead of the text title.\n       */\n      titleImage: Image.propTypes.source,\n\n      /**\n       * Use this to specify additional props to pass to the rendered\n       * component. `NavigatorIOS` will automatically pass in `route` and\n       * `navigator` props to the comoponent.\n       */\n      passProps: PropTypes.object,\n\n      /**\n       * If set, the left navigation button image will be displayed using this\n       * source. Note that this doesn't apply to the header of the current\n       * view, but to those views that are subsequently pushed.\n       */\n      backButtonIcon: Image.propTypes.source,\n\n      /**\n       * If set, the left navigation button text will be set to this. Note that\n       * this doesn't apply to the left button of the current view, but to\n       * those views that are subsequently pushed\n       */\n      backButtonTitle: PropTypes.string,\n\n      /**\n       * If set, the left navigation button image will be displayed using\n       * this source.\n       */\n      leftButtonIcon: Image.propTypes.source,\n\n      /**\n       * If set, the left navigation button will display this text.\n       */\n      leftButtonTitle: PropTypes.string,\n\n      /**\n       * If set, the left header button will appear with this system icon\n       *\n       * Supported icons are `done`, `cancel`, `edit`, `save`, `add`,\n       * `compose`, `reply`, `action`, `organize`, `bookmarks`, `search`,\n       * `refresh`, `stop`, `camera`, `trash`, `play`, `pause`, `rewind`,\n       * `fast-forward`, `undo`, `redo`, and `page-curl`\n       */\n      leftButtonSystemIcon: PropTypes.oneOf(Object.keys(SystemIcons)),\n\n      /**\n       * This function will be invoked when the left navigation bar item is\n       * pressed.\n       */\n      onLeftButtonPress: PropTypes.func,\n\n      /**\n       * If set, the right navigation button image will be displayed using\n       * this source.\n       */\n      rightButtonIcon: Image.propTypes.source,\n\n      /**\n       * If set, the right navigation button will display this text.\n       */\n      rightButtonTitle: PropTypes.string,\n\n      /**\n       * If set, the right header button will appear with this system icon\n       *\n       * See leftButtonSystemIcon for supported icons\n       */\n      rightButtonSystemIcon: PropTypes.oneOf(Object.keys(SystemIcons)),\n\n      /**\n       * This function will be invoked when the right navigation bar item is\n       * pressed.\n       */\n      onRightButtonPress: PropTypes.func,\n\n      /**\n       * Styles for the navigation item containing the component.\n       */\n      wrapperStyle: ViewPropTypes.style,\n\n      /**\n       * Boolean value that indicates whether the navigation bar is hidden.\n       */\n      navigationBarHidden: PropTypes.bool,\n\n      /**\n       * Boolean value that indicates whether to hide the 1px hairline\n       * shadow.\n       */\n      shadowHidden: PropTypes.bool,\n\n      /**\n       * The color used for the buttons in the navigation bar.\n       */\n      tintColor: PropTypes.string,\n\n      /**\n       * The background color of the navigation bar.\n       */\n      barTintColor: PropTypes.string,\n\n      /**\n       * The style of the navigation bar. Supported values are 'default', 'black'.\n       * Use 'black' instead of setting `barTintColor` to black. This produces\n       * a navigation bar with the native iOS style with higher translucency.\n       */\n      barStyle: PropTypes.oneOf(['default', 'black']),\n\n       /**\n       * The text color of the navigation bar title.\n       */\n      titleTextColor: PropTypes.string,\n\n       /**\n       * Boolean value that indicates whether the navigation bar is\n       * translucent.\n       */\n      translucent: PropTypes.bool,\n\n    }).isRequired,\n\n    /**\n     * Boolean value that indicates whether the navigation bar is hidden\n     * by default.\n     */\n    navigationBarHidden: PropTypes.bool,\n\n    /**\n     * Boolean value that indicates whether to hide the 1px hairline shadow\n     * by default.\n     */\n    shadowHidden: PropTypes.bool,\n\n    /**\n     * The default wrapper style for components in the navigator.\n     * A common use case is to set the `backgroundColor` for every scene.\n     */\n    itemWrapperStyle: ViewPropTypes.style,\n\n    /**\n     * The default color used for the buttons in the navigation bar.\n     */\n    tintColor: PropTypes.string,\n\n    /**\n     * The default background color of the navigation bar.\n     */\n    barTintColor: PropTypes.string,\n\n    /**\n     * The style of the navigation bar. Supported values are 'default', 'black'.\n     * Use 'black' instead of setting `barTintColor` to black. This produces\n     * a navigation bar with the native iOS style with higher translucency.\n     */\n    barStyle: PropTypes.oneOf(['default', 'black']),\n\n    /**\n     * The default text color of the navigation bar title.\n     */\n    titleTextColor: PropTypes.string,\n\n    /**\n     * Boolean value that indicates whether the navigation bar is\n     * translucent by default\n     */\n    translucent: PropTypes.bool,\n\n    /**\n     * Boolean value that indicates whether the interactive pop gesture is\n     * enabled. This is useful for enabling/disabling the back swipe navigation\n     * gesture.\n     *\n     * If this prop is not provided, the default behavior is for the back swipe\n     * gesture to be enabled when the navigation bar is shown and disabled when\n     * the navigation bar is hidden. Once you've provided the\n     * `interactivePopGestureEnabled` prop, you can never restore the default\n     * behavior.\n     */\n    interactivePopGestureEnabled: PropTypes.bool,\n\n  },\n\n  navigator: (undefined: ?Object),\n\n  componentWillMount: function() {\n    // Precompute a pack of callbacks that's frequently generated and passed to\n    // instances.\n    this.navigator = {\n      push: this.push,\n      pop: this.pop,\n      popN: this.popN,\n      replace: this.replace,\n      replaceAtIndex: this.replaceAtIndex,\n      replacePrevious: this.replacePrevious,\n      replacePreviousAndPop: this.replacePreviousAndPop,\n      resetTo: this.resetTo,\n      popToRoute: this.popToRoute,\n      popToTop: this.popToTop,\n    };\n  },\n\n  componentDidMount: function() {\n    this._enableTVEventHandler();\n  },\n\n  componentWillUnmount: function() {\n    this._disableTVEventHandler();\n  },\n\n  getDefaultProps: function(): Object {\n    return {\n      translucent: true,\n    };\n  },\n\n  getInitialState: function(): State {\n    return {\n      idStack: [getuid()],\n      routeStack: [this.props.initialRoute],\n      // The navigation index that we wish to push/pop to.\n      requestedTopOfStack: 0,\n      // The last index that native has sent confirmation of completed push/pop\n      // for. At this point, we can discard any views that are beyond the\n      // `requestedTopOfStack`. A value of `null` means we have not received\n      // any confirmation, ever. We may receive an `observedTopOfStack` without\n      // ever requesting it - native can instigate pops of its own with the\n      // backswipe gesture.\n      observedTopOfStack: 0,\n      progress: 1,\n      fromIndex: 0,\n      toIndex: 0,\n      // Whether or not we are making a navigator request to push/pop. (Used\n      // for performance optimization).\n      makingNavigatorRequest: false,\n      // Whether or not we are updating children of navigator and if so (not\n      // `null`) which index marks the beginning of all updates. Used for\n      // performance optimization.\n      updatingAllIndicesAtOrBeyond: 0,\n    };\n  },\n\n  _toFocusOnNavigationComplete: (undefined: any),\n\n  _handleFocusRequest: function(item: any) {\n    if (this.state.makingNavigatorRequest) {\n      this._toFocusOnNavigationComplete = item;\n    } else {\n      this._getFocusEmitter().emit('focus', item);\n    }\n  },\n\n  _focusEmitter: (undefined: ?EventEmitter),\n\n  _getFocusEmitter: function(): EventEmitter {\n    // Flow not yet tracking assignments to instance fields.\n    var focusEmitter = this._focusEmitter;\n    if (!focusEmitter) {\n      focusEmitter = new EventEmitter();\n      this._focusEmitter = focusEmitter;\n    }\n    return focusEmitter;\n  },\n\n  getChildContext: function(): {\n    onFocusRequested: Function,\n    focusEmitter: EventEmitter,\n  } {\n    return {\n      onFocusRequested: this._handleFocusRequest,\n      focusEmitter: this._getFocusEmitter(),\n    };\n  },\n\n  childContextTypes: {\n    onFocusRequested: PropTypes.func,\n    focusEmitter: PropTypes.instanceOf(EventEmitter),\n  },\n\n  _tryLockNavigator: function(cb: () => void) {\n    this.refs[TRANSITIONER_REF].requestSchedulingNavigation(\n      (acquiredLock) => acquiredLock && cb()\n    );\n  },\n\n  _handleNavigatorStackChanged: function(e: Event) {\n    var newObservedTopOfStack = e.nativeEvent.stackLength - 1;\n\n    invariant(\n      newObservedTopOfStack <= this.state.requestedTopOfStack,\n      'No navigator item should be pushed without JS knowing about it %s %s', newObservedTopOfStack, this.state.requestedTopOfStack\n    );\n    var wasWaitingForConfirmation =\n      this.state.requestedTopOfStack !== this.state.observedTopOfStack;\n    if (wasWaitingForConfirmation) {\n      invariant(\n        newObservedTopOfStack === this.state.requestedTopOfStack,\n        'If waiting for observedTopOfStack to reach requestedTopOfStack, ' +\n        'the only valid observedTopOfStack should be requestedTopOfStack.'\n      );\n    }\n    // Mark the most recent observation regardless of if we can lock the\n    // navigator. `observedTopOfStack` merely represents what we've observed\n    // and this first `setState` is only executed to update debugging\n    // overlays/navigation bar.\n    // Also reset progress, toIndex, and fromIndex as they might not end\n    // in the correct states for a two possible reasons:\n    // Progress isn't always 0 or 1 at the end, the system rounds\n    // If the Navigator is offscreen these values won't be updated\n    // TOOD: Revisit this decision when no longer relying on native navigator.\n    var nextState = {\n      observedTopOfStack: newObservedTopOfStack,\n      makingNavigatorRequest: false,\n      updatingAllIndicesAtOrBeyond: null,\n      progress: 1,\n      toIndex: newObservedTopOfStack,\n      fromIndex: newObservedTopOfStack,\n    };\n    this.setState(nextState, this._eliminateUnneededChildren);\n  },\n\n  _eliminateUnneededChildren: function() {\n    // Updating the indices that we're deleting and that's all. (Truth: Nothing\n    // even uses the indices in this case, but let's make this describe the\n    // truth anyways).\n    var updatingAllIndicesAtOrBeyond =\n      this.state.routeStack.length > this.state.observedTopOfStack + 1 ?\n      this.state.observedTopOfStack + 1 :\n      null;\n    this.setState({\n      idStack: this.state.idStack.slice(0, this.state.observedTopOfStack + 1),\n      routeStack: this.state.routeStack.slice(0, this.state.observedTopOfStack + 1),\n      // Now we rerequest the top of stack that we observed.\n      requestedTopOfStack: this.state.observedTopOfStack,\n      makingNavigatorRequest: true,\n      updatingAllIndicesAtOrBeyond: updatingAllIndicesAtOrBeyond,\n    });\n  },\n\n  /**\n   * Navigate forward to a new route.\n   * @param route The new route to navigate to.\n   */\n  push: function(route: Route) {\n    invariant(!!route, 'Must supply route to push');\n    // Make sure all previous requests are caught up first. Otherwise reject.\n    if (this.state.requestedTopOfStack === this.state.observedTopOfStack) {\n      this._tryLockNavigator(() => {\n\n        var nextStack = this.state.routeStack.concat([route]);\n        var nextIDStack = this.state.idStack.concat([getuid()]);\n        this.setState({\n          // We have to make sure that we've also supplied enough views to\n          // satisfy our request to adjust the `requestedTopOfStack`.\n          idStack: nextIDStack,\n          routeStack: nextStack,\n          requestedTopOfStack: nextStack.length - 1,\n          makingNavigatorRequest: true,\n          updatingAllIndicesAtOrBeyond: nextStack.length - 1,\n        });\n      });\n    }\n  },\n\n  /**\n   * Go back N scenes at once. When N=1, behavior matches `pop()`.\n   * @param n The number of scenes to pop.\n   */\n  popN: function(n: number) {\n    if (n === 0) {\n      return;\n    }\n    // Make sure all previous requests are caught up first. Otherwise reject.\n    if (this.state.requestedTopOfStack === this.state.observedTopOfStack) {\n      if (this.state.requestedTopOfStack > 0) {\n        this._tryLockNavigator(() => {\n          var newRequestedTopOfStack = this.state.requestedTopOfStack - n;\n          invariant(newRequestedTopOfStack >= 0, 'Cannot pop below 0');\n          this.setState({\n            requestedTopOfStack: newRequestedTopOfStack,\n            makingNavigatorRequest: true,\n            updatingAllIndicesAtOrBeyond: this.state.requestedTopOfStack - n,\n          });\n        });\n      }\n    }\n  },\n\n  /**\n   * Pop back to the previous scene.\n   */\n  pop: function() {\n    this.popN(1);\n  },\n\n  /**\n   * Replace a route in the navigation stack.\n   *\n   * @param route The new route that will replace the specified one.\n   * @param index The route into the stack that should be replaced.\n   *    If it is negative, it counts from the back of the stack.\n   */\n  replaceAtIndex: function(route: Route, index: number) {\n    invariant(!!route, 'Must supply route to replace');\n    if (index < 0) {\n      index += this.state.routeStack.length;\n    }\n\n    if (this.state.routeStack.length <= index) {\n      return;\n    }\n\n    // I don't believe we need to lock for a replace since there's no\n    // navigation actually happening\n    var nextIDStack = this.state.idStack.slice();\n    var nextRouteStack = this.state.routeStack.slice();\n    nextIDStack[index] = getuid();\n    nextRouteStack[index] = route;\n\n    this.setState({\n      idStack: nextIDStack,\n      routeStack: nextRouteStack,\n      makingNavigatorRequest: false,\n      updatingAllIndicesAtOrBeyond: index,\n    });\n\n  },\n\n  /**\n   * Replace the route for the current scene and immediately\n   * load the view for the new route.\n   * @param route The new route to navigate to.\n   */\n  replace: function(route: Route) {\n    this.replaceAtIndex(route, -1);\n  },\n\n  /**\n   * Replace the route/view for the previous scene.\n   * @param route The new route to will replace the previous scene.\n   */\n  replacePrevious: function(route: Route) {\n    this.replaceAtIndex(route, -2);\n  },\n\n  /**\n   * Go back to the topmost item in the navigation stack.\n   */\n  popToTop: function() {\n    this.popToRoute(this.state.routeStack[0]);\n  },\n\n  /**\n   * Go back to the item for a particular route object.\n   * @param route The new route to navigate to.\n   */\n  popToRoute: function(route: Route) {\n    var indexOfRoute = this.state.routeStack.indexOf(route);\n    invariant(\n      indexOfRoute !== -1,\n      'Calling pop to route for a route that doesn\\'t exist!'\n    );\n    var numToPop = this.state.routeStack.length - indexOfRoute - 1;\n    this.popN(numToPop);\n  },\n\n  /**\n   * Replaces the previous route/view and transitions back to it.\n   * @param route The new route that replaces the previous scene.\n   */\n  replacePreviousAndPop: function(route: Route) {\n    // Make sure all previous requests are caught up first. Otherwise reject.\n    if (this.state.requestedTopOfStack !== this.state.observedTopOfStack) {\n      return;\n    }\n    if (this.state.routeStack.length < 2) {\n      return;\n    }\n    this._tryLockNavigator(() => {\n      this.replacePrevious(route);\n      this.setState({\n        requestedTopOfStack: this.state.requestedTopOfStack - 1,\n        makingNavigatorRequest: true,\n      });\n    });\n  },\n\n  /**\n   * Replaces the top item and pop to it.\n   * @param route The new route that will replace the topmost item.\n   */\n  resetTo: function(route: Route) {\n    invariant(!!route, 'Must supply route to push');\n    // Make sure all previous requests are caught up first. Otherwise reject.\n    if (this.state.requestedTopOfStack !== this.state.observedTopOfStack) {\n      return;\n    }\n    this.replaceAtIndex(route, 0);\n    this.popToRoute(route);\n  },\n\n  _handleNavigationComplete: function(e: Event) {\n    // Don't propagate to other NavigatorIOS instances this is nested in:\n    e.stopPropagation();\n\n    if (this._toFocusOnNavigationComplete) {\n      this._getFocusEmitter().emit('focus', this._toFocusOnNavigationComplete);\n      this._toFocusOnNavigationComplete = null;\n    }\n    this._handleNavigatorStackChanged(e);\n  },\n\n  _routeToStackItem: function(routeArg: Route, i: number) {\n    var {component, wrapperStyle, passProps, ...route} = routeArg;\n    var {itemWrapperStyle, ...props} = this.props;\n    var shouldUpdateChild =\n      this.state.updatingAllIndicesAtOrBeyond != null &&\n      this.state.updatingAllIndicesAtOrBeyond >= i;\n    var Component = component;\n    return (\n      <StaticContainer key={'nav' + i} shouldUpdate={shouldUpdateChild}>\n        <RCTNavigatorItem\n          {...props}\n          {...route}\n          style={[\n            styles.stackItem,\n            itemWrapperStyle,\n            wrapperStyle\n          ]}>\n          <Component\n            navigator={this.navigator}\n            route={route}\n            {...passProps}\n          />\n        </RCTNavigatorItem>\n      </StaticContainer>\n    );\n  },\n\n  _renderNavigationStackItems: function() {\n    var shouldRecurseToNavigator =\n      this.state.makingNavigatorRequest ||\n      this.state.updatingAllIndicesAtOrBeyond !== null;\n    // If not recursing update to navigator at all, may as well avoid\n    // computation of navigator children.\n    var items = shouldRecurseToNavigator ?\n      this.state.routeStack.map(this._routeToStackItem) : null;\n    return (\n      <StaticContainer shouldUpdate={shouldRecurseToNavigator}>\n        <NavigatorTransitionerIOS\n          ref={TRANSITIONER_REF}\n          style={styles.transitioner}\n          // $FlowFixMe(>=0.41.0)\n          vertical={this.props.vertical}\n          requestedTopOfStack={this.state.requestedTopOfStack}\n          onNavigationComplete={this._handleNavigationComplete}\n          interactivePopGestureEnabled={this.props.interactivePopGestureEnabled}>\n          {items}\n        </NavigatorTransitionerIOS>\n      </StaticContainer>\n    );\n  },\n\n  _tvEventHandler: (undefined: ?TVEventHandler),\n\n  _enableTVEventHandler: function() {\n    this._tvEventHandler = new TVEventHandler();\n    this._tvEventHandler.enable(this, function(cmp, evt) {\n      if (evt && evt.eventType === 'menu') {\n        cmp.pop();\n      }\n    });\n  },\n\n  _disableTVEventHandler: function() {\n    if (this._tvEventHandler) {\n      this._tvEventHandler.disable();\n      delete this._tvEventHandler;\n    }\n  },\n\n  render: function() {\n    return (\n      // $FlowFixMe(>=0.41.0)\n      <View style={this.props.style}>\n        {this._renderNavigationStackItems()}\n      </View>\n    );\n  },\n});\n\nvar styles = StyleSheet.create({\n  stackItem: {\n    backgroundColor: 'white',\n    overflow: 'hidden',\n    position: 'absolute',\n    top: 0,\n    left: 0,\n    right: 0,\n    bottom: 0,\n  },\n  transitioner: {\n    flex: 1,\n  },\n});\n\nvar RCTNavigator = requireNativeComponent('RCTNavigator');\nvar RCTNavigatorItem = requireNativeComponent('RCTNavItem');\n\nmodule.exports = NavigatorIOS;\n"
  },
  {
    "path": "Libraries/Components/Navigation/NavigatorIOS.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule NavigatorIOS\n * @flow\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/Picker/Picker.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Picker\n * @flow\n */\n\n'use strict';\n\nvar ColorPropType = require('ColorPropType');\nvar PickerIOS = require('PickerIOS');\n\nvar Platform = require('Platform');\nvar React = require('React');\nconst PropTypes = require('prop-types');\nvar StyleSheetPropType = require('StyleSheetPropType');\nvar TextStylePropTypes = require('TextStylePropTypes');\nvar UnimplementedView = require('UnimplementedView');\nconst ViewPropTypes = require('ViewPropTypes');\nvar ViewStylePropTypes = require('ViewStylePropTypes');\n\nvar itemStylePropType = StyleSheetPropType(TextStylePropTypes);\n\nvar pickerStyleType = StyleSheetPropType({\n  ...ViewStylePropTypes,\n  color: ColorPropType,\n});\n\nvar MODE_DIALOG = 'dialog';\nvar MODE_DROPDOWN = 'dropdown';\n\n/**\n * Individual selectable item in a Picker.\n */\nclass PickerItem extends React.Component<{\n label: string,\n value?: any,\n color?: ColorPropType,\n testID?: string,\n}> {\n static propTypes = {\n   /**\n    * Text to display for this item.\n    */\n   label: PropTypes.string.isRequired,\n   /**\n    * The value to be passed to picker's `onValueChange` callback when\n    * this item is selected. Can be a string or an integer.\n    */\n   value: PropTypes.any,\n   /**\n    * Color of this item's text.\n    * @platform android\n    */\n   color: ColorPropType,\n   /**\n    * Used to locate the item in end-to-end tests.\n    */\n   testID: PropTypes.string,\n };\n\n render() {\n   // The items are not rendered directly\n   throw null;\n }\n}\n\n/**\n * Renders the native picker component on iOS and Android. Example:\n *\n *     <Picker\n *       selectedValue={this.state.language}\n *       onValueChange={(itemValue, itemIndex) => this.setState({language: itemValue})}>\n *       <Picker.Item label=\"Java\" value=\"java\" />\n *       <Picker.Item label=\"JavaScript\" value=\"js\" />\n *     </Picker>\n */\nclass Picker extends React.Component<{\n style?: $FlowFixMe,\n selectedValue?: any,\n onValueChange?: Function,\n enabled?: boolean,\n mode?: 'dialog' | 'dropdown',\n itemStyle?: $FlowFixMe,\n prompt?: string,\n testID?: string,\n}> {\n /**\n  * On Android, display the options in a dialog.\n  */\n static MODE_DIALOG = MODE_DIALOG;\n\n /**\n  * On Android, display the options in a dropdown (this is the default).\n  */\n static MODE_DROPDOWN = MODE_DROPDOWN;\n\n static Item = PickerItem;\n\n static defaultProps = {\n   mode: MODE_DIALOG,\n };\n\n // $FlowFixMe(>=0.41.0)\n static propTypes = {\n   ...ViewPropTypes,\n   style: pickerStyleType,\n   /**\n    * Value matching value of one of the items. Can be a string or an integer.\n    */\n   selectedValue: PropTypes.any,\n   /**\n    * Callback for when an item is selected. This is called with the following parameters:\n    *   - `itemValue`: the `value` prop of the item that was selected\n    *   - `itemPosition`: the index of the selected item in this picker\n    */\n   onValueChange: PropTypes.func,\n   /**\n    * If set to false, the picker will be disabled, i.e. the user will not be able to make a\n    * selection.\n    * @platform android\n    */\n   enabled: PropTypes.bool,\n   /**\n    * On Android, specifies how to display the selection items when the user taps on the picker:\n    *\n    *   - 'dialog': Show a modal dialog. This is the default.\n    *   - 'dropdown': Shows a dropdown anchored to the picker view\n    *\n    * @platform android\n    */\n   mode: PropTypes.oneOf(['dialog', 'dropdown']),\n   /**\n    * Style to apply to each of the item labels.\n    * @platform ios\n    */\n   itemStyle: itemStylePropType,\n   /**\n    * Prompt string for this picker, used on Android in dialog mode as the title of the dialog.\n    * @platform android\n    */\n   prompt: PropTypes.string,\n   /**\n    * Used to locate this view in end-to-end tests.\n    */\n   testID: PropTypes.string,\n };\n\n render() {\n     if (Platform.OS === 'ios') {\n       // $FlowFixMe found when converting React.createClass to ES6\n       return <PickerIOS {...this.props}>{this.props.children}</PickerIOS>;\n     } else if (Platform.OS === 'android') {\n       // $FlowFixMe found when converting React.createClass to ES6\n       return <PickerAndroid {...this.props}>{this.props.children}</PickerAndroid>;\n     } else {\n       return <UnimplementedView />;\n     }\n }\n}\n\nmodule.exports = Picker;\n"
  },
  {
    "path": "Libraries/Components/Picker/PickerAndroid.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PickerAndroid\n * @flow\n */\n\n'use strict';\n\nvar ColorPropType = require('ColorPropType');\nvar React = require('React');\nvar ReactPropTypes = require('prop-types');\nvar StyleSheet = require('StyleSheet');\nvar StyleSheetPropType = require('StyleSheetPropType');\nconst ViewPropTypes = require('ViewPropTypes');\nvar ViewStylePropTypes = require('ViewStylePropTypes');\n\nvar processColor = require('processColor');\nvar requireNativeComponent = require('requireNativeComponent');\n\nvar REF_PICKER = 'picker';\nvar MODE_DROPDOWN = 'dropdown';\n\nvar pickerStyleType = StyleSheetPropType({\n  ...ViewStylePropTypes,\n  color: ColorPropType,\n});\n\ntype Event = Object;\n\n/**\n * Not exposed as a public API - use <Picker> instead.\n */\nclass PickerAndroid extends React.Component<{\n  style?: $FlowFixMe,\n  selectedValue?: any,\n  enabled?: boolean,\n  mode?: 'dialog' | 'dropdown',\n  onValueChange?: Function,\n  prompt?: string,\n  testID?: string,\n}, *> {\n  static propTypes = {\n    ...ViewPropTypes,\n    style: pickerStyleType,\n    selectedValue: ReactPropTypes.any,\n    enabled: ReactPropTypes.bool,\n    mode: ReactPropTypes.oneOf(['dialog', 'dropdown']),\n    onValueChange: ReactPropTypes.func,\n    prompt: ReactPropTypes.string,\n    testID: ReactPropTypes.string,\n  };\n\n  constructor(props, context) {\n    super(props, context);\n    var state = this._stateFromProps(props);\n\n    this.state = {\n      ...state,\n      initialSelectedIndex: state.selectedIndex,\n    };\n  }\n\n  componentWillReceiveProps(nextProps) {\n    this.setState(this._stateFromProps(nextProps));\n  }\n\n  // Translate prop and children into stuff that the native picker understands.\n  _stateFromProps = (props) => {\n    var selectedIndex = 0;\n    const items = React.Children.map(props.children, (child, index) => {\n      if (child.props.value === props.selectedValue) {\n        selectedIndex = index;\n      }\n      const childProps = {\n        value: child.props.value,\n        label: child.props.label,\n      };\n      if (child.props.color) {\n        childProps.color = processColor(child.props.color);\n      }\n      return childProps;\n    });\n    return {selectedIndex, items};\n  };\n\n  render() {\n    var Picker = this.props.mode === MODE_DROPDOWN ? DropdownPicker : DialogPicker;\n\n    var nativeProps = {\n      enabled: this.props.enabled,\n      items: this.state.items,\n      mode: this.props.mode,\n      onSelect: this._onChange,\n      prompt: this.props.prompt,\n      selected: this.state.initialSelectedIndex,\n      testID: this.props.testID,\n      style: [styles.pickerAndroid, this.props.style],\n      accessibilityLabel: this.props.accessibilityLabel,\n    };\n\n    return <Picker ref={REF_PICKER} {...nativeProps} />;\n  }\n\n  _onChange = (event: Event) => {\n    if (this.props.onValueChange) {\n      var position = event.nativeEvent.position;\n      if (position >= 0) {\n        var children = React.Children.toArray(this.props.children);\n        var value = children[position].props.value;\n        this.props.onValueChange(value, position);\n      } else {\n        this.props.onValueChange(null, position);\n      }\n    }\n    this._lastNativePosition = event.nativeEvent.position;\n    this.forceUpdate();\n  };\n\n  componentDidMount() {\n    this._lastNativePosition = this.state.initialSelectedIndex;\n  }\n\n  componentDidUpdate() {\n    // The picker is a controlled component. This means we expect the\n    // on*Change handlers to be in charge of updating our\n    // `selectedValue` prop. That way they can also\n    // disallow/undo/mutate the selection of certain values. In other\n    // words, the embedder of this component should be the source of\n    // truth, not the native component.\n    if (this.refs[REF_PICKER] && this.state.selectedIndex !== this._lastNativePosition) {\n      this.refs[REF_PICKER].setNativeProps({selected: this.state.selectedIndex});\n      this._lastNativePosition = this.state.selectedIndex;\n    }\n  }\n}\n\nvar styles = StyleSheet.create({\n  pickerAndroid: {\n    // The picker will conform to whatever width is given, but we do\n    // have to set the component's height explicitly on the\n    // surrounding view to ensure it gets rendered.\n    // TODO would be better to export a native constant for this,\n    // like in iOS the RCTDatePickerManager.m\n    height: 50,\n  },\n});\n\nvar cfg = {\n  nativeOnly: {\n    items: true,\n    selected: true,\n  }\n};\n\nvar DropdownPicker = requireNativeComponent('AndroidDropdownPicker', PickerAndroid, cfg);\nvar DialogPicker = requireNativeComponent('AndroidDialogPicker', PickerAndroid, cfg);\n\nmodule.exports = PickerAndroid;\n"
  },
  {
    "path": "Libraries/Components/Picker/PickerAndroid.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PickerAndroid\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/Picker/PickerIOS.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PickerIOS\n *\n * This is a controlled component version of RCTPickerIOS\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/Picker/PickerIOS.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PickerIOS\n *\n * This is a controlled component version of RCTPickerIOS\n */\n'use strict';\n\nvar NativeMethodsMixin = require('NativeMethodsMixin');\nvar React = require('React');\nconst PropTypes = require('prop-types');\nvar StyleSheet = require('StyleSheet');\nvar StyleSheetPropType = require('StyleSheetPropType');\nvar TextStylePropTypes = require('TextStylePropTypes');\nvar View = require('View');\nconst ViewPropTypes = require('ViewPropTypes');\nvar processColor = require('processColor');\n\nvar createReactClass = require('create-react-class');\nvar itemStylePropType = StyleSheetPropType(TextStylePropTypes);\nvar requireNativeComponent = require('requireNativeComponent');\n\nvar PickerIOS = createReactClass({\n  displayName: 'PickerIOS',\n  mixins: [NativeMethodsMixin],\n\n  propTypes: {\n    ...ViewPropTypes,\n    itemStyle: itemStylePropType,\n    onValueChange: PropTypes.func,\n    selectedValue: PropTypes.any, // string or integer basically\n  },\n\n  getInitialState: function() {\n    return this._stateFromProps(this.props);\n  },\n\n  componentWillReceiveProps: function(nextProps) {\n    this.setState(this._stateFromProps(nextProps));\n  },\n\n  // Translate PickerIOS prop and children into stuff that RCTPickerIOS understands.\n  _stateFromProps: function(props) {\n    var selectedIndex = 0;\n    var items = [];\n    React.Children.toArray(props.children).forEach(function (child, index) {\n      if (child.props.value === props.selectedValue) {\n        selectedIndex = index;\n      }\n      items.push({\n        value: child.props.value,\n        label: child.props.label,\n        textColor: processColor(child.props.color),\n      });\n    });\n    return {selectedIndex, items};\n  },\n\n  render: function() {\n    return (\n      <View style={this.props.style}>\n        <RCTPickerIOS\n          ref={picker => this._picker = picker}\n          style={[styles.pickerIOS, this.props.itemStyle]}\n          items={this.state.items}\n          selectedIndex={this.state.selectedIndex}\n          onChange={this._onChange}\n          onStartShouldSetResponder={() => true}\n          onResponderTerminationRequest={() => false}\n        />\n      </View>\n    );\n  },\n\n  _onChange: function(event) {\n    if (this.props.onChange) {\n      this.props.onChange(event);\n    }\n    if (this.props.onValueChange) {\n      this.props.onValueChange(event.nativeEvent.newValue, event.nativeEvent.newIndex);\n    }\n\n    // The picker is a controlled component. This means we expect the\n    // on*Change handlers to be in charge of updating our\n    // `selectedValue` prop. That way they can also\n    // disallow/undo/mutate the selection of certain values. In other\n    // words, the embedder of this component should be the source of\n    // truth, not the native component.\n    if (this._picker && this.state.selectedIndex !== event.nativeEvent.newIndex) {\n      this._picker.setNativeProps({\n        selectedIndex: this.state.selectedIndex\n      });\n    }\n  },\n});\n\nPickerIOS.Item = class extends React.Component {\n  static propTypes = {\n    value: PropTypes.any, // string or integer basically\n    label: PropTypes.string,\n    color: PropTypes.string,\n  };\n\n  render() {\n    // These items don't get rendered directly.\n    return null;\n  }\n};\n\nvar styles = StyleSheet.create({\n  pickerIOS: {\n    // The picker will conform to whatever width is given, but we do\n    // have to set the component's height explicitly on the\n    // surrounding view to ensure it gets rendered.\n    height: 216,\n  },\n});\n\nvar RCTPickerIOS = requireNativeComponent('RCTPicker', {\n  propTypes: {\n    style: itemStylePropType,\n  },\n}, {\n  nativeOnly: {\n    items: true,\n    onChange: true,\n    selectedIndex: true,\n  },\n});\n\nmodule.exports = PickerIOS;\n"
  },
  {
    "path": "Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ProgressBarAndroid\n */\n'use strict';\n\nconst ColorPropType = require('ColorPropType');\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst ReactNative = require('ReactNative');\nconst ViewPropTypes = require('ViewPropTypes');\n\nconst requireNativeComponent = require('requireNativeComponent');\n\nconst STYLE_ATTRIBUTES = [\n  'Horizontal',\n  'Normal',\n  'Small',\n  'Large',\n  'Inverse',\n  'SmallInverse',\n  'LargeInverse',\n];\n\nconst indeterminateType = function(props, propName, componentName, ...rest) {\n  const checker = function() {\n    const indeterminate = props[propName];\n    const styleAttr = props.styleAttr;\n    if (!indeterminate && styleAttr !== 'Horizontal') {\n      return new Error('indeterminate=false is only valid for styleAttr=Horizontal');\n    }\n  };\n\n  return PropTypes.bool(props, propName, componentName, ...rest) || checker();\n};\n\n/**\n * React component that wraps the Android-only `ProgressBar`. This component is used to indicate\n * that the app is loading or there is some activity in the app.\n *\n * Example:\n *\n * ```\n * render: function() {\n *   var progressBar =\n *     <View style={styles.container}>\n *       <ProgressBar styleAttr=\"Inverse\" />\n *     </View>;\n\n *   return (\n *     <MyLoadingComponent\n *       componentView={componentView}\n *       loadingView={progressBar}\n *       style={styles.loadingComponent}\n *     />\n *   );\n * },\n * ```\n */\nclass ProgressBarAndroid extends ReactNative.NativeComponent {\n  static propTypes = {\n    ...ViewPropTypes,\n\n    /**\n     * Style of the ProgressBar. One of:\n     *\n     * - Horizontal\n     * - Normal (default)\n     * - Small\n     * - Large\n     * - Inverse\n     * - SmallInverse\n     * - LargeInverse\n     */\n    styleAttr: PropTypes.oneOf(STYLE_ATTRIBUTES),\n    /**\n     * Whether to show the ProgressBar (true, the default) or hide it (false).\n     */\n    animating: PropTypes.bool,\n    /**\n     * If the progress bar will show indeterminate progress. Note that this\n     * can only be false if styleAttr is Horizontal.\n     */\n    indeterminate: indeterminateType,\n    /**\n     * The progress value (between 0 and 1).\n     */\n    progress: PropTypes.number,\n    /**\n     * Color of the progress bar.\n     */\n    color: ColorPropType,\n    /**\n     * Used to locate this view in end-to-end tests.\n     */\n    testID: PropTypes.string,\n  };\n\n  static defaultProps = {\n    styleAttr: 'Normal',\n    indeterminate: true,\n    animating: true,\n  };\n\n  render() {\n    return <AndroidProgressBar {...this.props} />;\n  }\n}\n\nconst AndroidProgressBar = requireNativeComponent(\n  'AndroidProgressBar',\n  ProgressBarAndroid,\n  {\n    nativeOnly: {\n      animating: true,\n    },\n  }\n);\n\nmodule.exports = ProgressBarAndroid;\n"
  },
  {
    "path": "Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ProgressBarAndroid\n */\n'use strict';\n\n'use strict';\n\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar Text = require('Text');\nvar View = require('View');\n\nclass DummyProgressViewIOS extends React.Component {\n  render() {\n    return (\n      <View style={[styles.dummy, this.props.style]}>\n        <Text style={styles.text}>\n          ProgressViewIOS is not supported on this platform!\n        </Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  dummy: {\n    width: 120,\n    height: 20,\n    backgroundColor: '#ffbcbc',\n    borderWidth: 1,\n    borderColor: 'red',\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  text: {\n    color: '#333333',\n    margin: 5,\n    fontSize: 10,\n  }\n});\n\nmodule.exports = DummyProgressViewIOS;\n"
  },
  {
    "path": "Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js",
    "content": "\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ProgressViewIOS\n */\n\n'use strict';\n\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar Text = require('Text');\nvar View = require('View');\n\nclass DummyProgressViewIOS extends React.Component {\n  render() {\n    return (\n      <View style={[styles.dummy, this.props.style]}>\n        <Text style={styles.text}>\n          ProgressViewIOS is not supported on this platform!\n        </Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  dummy: {\n    width: 120,\n    height: 20,\n    backgroundColor: '#ffbcbc',\n    borderWidth: 1,\n    borderColor: 'red',\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  text: {\n    color: '#333333',\n    margin: 5,\n    fontSize: 10,\n  }\n});\n\nmodule.exports = DummyProgressViewIOS;\n"
  },
  {
    "path": "Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ProgressViewIOS\n * @flow\n */\n'use strict';\n\nvar Image = require('Image');\nvar NativeMethodsMixin = require('NativeMethodsMixin');\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar StyleSheet = require('StyleSheet');\nvar ViewPropTypes = require('ViewPropTypes');\n\nvar createReactClass = require('create-react-class');\nvar requireNativeComponent = require('requireNativeComponent');\n\n/**\n * Use `ProgressViewIOS` to render a UIProgressView on iOS.\n */\nvar ProgressViewIOS = createReactClass({\n  displayName: 'ProgressViewIOS',\n  mixins: [NativeMethodsMixin],\n\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * The progress bar style.\n     */\n    progressViewStyle: PropTypes.oneOf(['default', 'bar']),\n\n    /**\n     * The progress value (between 0 and 1).\n     */\n    progress: PropTypes.number,\n\n    /**\n     * The tint color of the progress bar itself.\n     */\n    progressTintColor: PropTypes.string,\n\n    /**\n     * The tint color of the progress bar track.\n     */\n    trackTintColor: PropTypes.string,\n\n    /**\n     * A stretchable image to display as the progress bar.\n     */\n    progressImage: Image.propTypes.source,\n\n    /**\n     * A stretchable image to display behind the progress bar.\n     */\n    trackImage: Image.propTypes.source,\n  },\n\n  render: function() {\n    return (\n      <RCTProgressView\n        {...this.props}\n        style={[styles.progressView, this.props.style]}\n      />\n    );\n  }\n});\n\nvar styles = StyleSheet.create({\n  progressView: {\n    height: 2,\n  },\n});\n\nvar RCTProgressView = requireNativeComponent(\n  'RCTProgressView',\n  ProgressViewIOS\n);\n\nmodule.exports = ProgressViewIOS;\n"
  },
  {
    "path": "Libraries/Components/ProgressViewIOS/ProgressViewIOS.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ProgressViewIOS\n * @flow\n */\n'use strict';\n\nvar Image = require('Image');\nvar NativeMethodsMixin = require('NativeMethodsMixin');\nvar NativeModules = require('NativeModules');\nvar PropTypes = require('prop-types');\nvar React = require('React');\nvar createReactClass = require('create-react-class');\nvar StyleSheet = require('StyleSheet');\n\nvar requireNativeComponent = require('requireNativeComponent');\n\n/**\n * Use `ProgressViewIOS` to render a UIProgressView on iOS.\n */\nvar ProgressViewIOS = createReactClass({\n displayName: 'ProgressViewIOS',\n mixins: [NativeMethodsMixin],\n\n propTypes: {\n   /**\n    * The progress bar style.\n    */\n   progressViewStyle: PropTypes.oneOf(['default', 'bar']),\n\n   /**\n    * The progress value (between 0 and 1).\n    */\n   progress: PropTypes.number,\n\n   /**\n    * The tint color of the progress bar itself.\n    */\n   progressTintColor: PropTypes.string,\n\n   /**\n    * The tint color of the progress bar track.\n    */\n   trackTintColor: PropTypes.string,\n\n   /**\n    * A stretchable image to display as the progress bar.\n    */\n   progressImage: Image.propTypes.source,\n\n   /**\n    * A stretchable image to display behind the progress bar.\n    */\n   trackImage: Image.propTypes.source,\n   style: PropTypes.any,\n },\n\n render: function() {\n   return (\n     <RCTProgressView\n       {...this.props}\n       style={[styles.progressView, this.props.style]}\n     />\n   );\n },\n});\n\nvar styles = StyleSheet.create({\n  progressView: {\n    height: NativeModules.ProgressViewManager.ComponentHeight,\n  },\n});\n\nvar RCTProgressView = requireNativeComponent(\n  'RCTProgressView',\n  ProgressViewIOS\n);\n\nmodule.exports = ProgressViewIOS;\n"
  },
  {
    "path": "Libraries/Components/RefreshControl/RefreshControl.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RefreshControl\n * @flow\n */\n'use strict';\n\nconst ColorPropType = require('ColorPropType');\nconst NativeMethodsMixin = require('NativeMethodsMixin');\nconst Platform = require('Platform');\nconst React = require('React');\nconst PropTypes = require('prop-types');\nconst ViewPropTypes = require('ViewPropTypes');\n\nconst createReactClass = require('create-react-class');\nconst requireNativeComponent = require('requireNativeComponent');\n\nif (Platform.OS === 'android') {\n  var RefreshLayoutConsts = require('UIManager').AndroidSwipeRefreshLayout.Constants;\n} else {\n  var RefreshLayoutConsts = {SIZE: {}};\n}\n\n/**\n * This component is used inside a ScrollView or ListView to add pull to refresh\n * functionality. When the ScrollView is at `scrollY: 0`, swiping down\n * triggers an `onRefresh` event.\n *\n * ### Usage example\n *\n * ``` js\n * class RefreshableList extends Component {\n *   constructor(props) {\n *     super(props);\n *     this.state = {\n *       refreshing: false,\n *     };\n *   }\n *\n *   _onRefresh() {\n *     this.setState({refreshing: true});\n *     fetchData().then(() => {\n *       this.setState({refreshing: false});\n *     });\n *   }\n *\n *   render() {\n *     return (\n *       <ListView\n *         refreshControl={\n *           <RefreshControl\n *             refreshing={this.state.refreshing}\n *             onRefresh={this._onRefresh.bind(this)}\n *           />\n *         }\n *         ...\n *       >\n *       ...\n *       </ListView>\n *     );\n *   }\n *   ...\n * }\n * ```\n *\n * __Note:__ `refreshing` is a controlled prop, this is why it needs to be set to true\n * in the `onRefresh` function otherwise the refresh indicator will stop immediately.\n */\nconst RefreshControl = createReactClass({\n  displayName: 'RefreshControl',\n  statics: {\n    SIZE: RefreshLayoutConsts.SIZE,\n  },\n\n  mixins: [NativeMethodsMixin],\n\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * Called when the view starts refreshing.\n     */\n    onRefresh: PropTypes.func,\n    /**\n     * Whether the view should be indicating an active refresh.\n     */\n    refreshing: PropTypes.bool.isRequired,\n    /**\n     * The color of the refresh indicator.\n     * @platform ios\n     */\n    tintColor: ColorPropType,\n    /**\n     * Title color.\n     * @platform ios\n     */\n    titleColor: ColorPropType,\n    /**\n     * The title displayed under the refresh indicator.\n     * @platform ios\n     */\n    title: PropTypes.string,\n    /**\n     * Whether the pull to refresh functionality is enabled.\n     * @platform android\n     */\n    enabled: PropTypes.bool,\n    /**\n     * The colors (at least one) that will be used to draw the refresh indicator.\n     * @platform android\n     */\n    colors: PropTypes.arrayOf(ColorPropType),\n    /**\n     * The background color of the refresh indicator.\n     * @platform android\n     */\n    progressBackgroundColor: ColorPropType,\n    /**\n     * Size of the refresh indicator, see RefreshControl.SIZE.\n     * @platform android\n     */\n    size: PropTypes.oneOf([RefreshLayoutConsts.SIZE.DEFAULT, RefreshLayoutConsts.SIZE.LARGE]),\n    /**\n     * Progress view top offset\n     * @platform android\n     */\n    progressViewOffset: PropTypes.number,\n  },\n\n  _nativeRef: (null: any),\n  _lastNativeRefreshing: false,\n\n  componentDidMount() {\n    this._lastNativeRefreshing = this.props.refreshing;\n  },\n\n  componentDidUpdate(prevProps: {refreshing: boolean}) {\n    // RefreshControl is a controlled component so if the native refreshing\n    // value doesn't match the current js refreshing prop update it to\n    // the js value.\n    if (this.props.refreshing !== prevProps.refreshing) {\n      this._lastNativeRefreshing = this.props.refreshing;\n    } else if (this.props.refreshing !== this._lastNativeRefreshing) {\n      this._nativeRef.setNativeProps({refreshing: this.props.refreshing});\n      this._lastNativeRefreshing = this.props.refreshing;\n    }\n  },\n\n  render() {\n    return (\n      <NativeRefreshControl\n        {...this.props}\n        ref={ref => {this._nativeRef = ref;}}\n        onRefresh={this._onRefresh}\n      />\n    );\n  },\n\n  _onRefresh() {\n    this._lastNativeRefreshing = true;\n\n    this.props.onRefresh && this.props.onRefresh();\n\n    // The native component will start refreshing so force an update to\n    // make sure it stays in sync with the js component.\n    this.forceUpdate();\n  },\n});\n\nif (Platform.OS === 'ios') {\n  var NativeRefreshControl = requireNativeComponent(\n    'RCTRefreshControl',\n    RefreshControl\n  );\n} else if (Platform.OS === 'android') {\n  var NativeRefreshControl = requireNativeComponent(\n    'AndroidSwipeRefreshLayout',\n    RefreshControl\n  );\n}\n\nmodule.exports = RefreshControl;\n"
  },
  {
    "path": "Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\nconst React = require('React');\n\nconst requireNativeComponent = require('requireNativeComponent');\n\nconst RCTRefreshControl = requireNativeComponent('RCTRefreshControl');\n\nclass RefreshControlMock extends React.Component<{}> {\n  static latestRef: ?RefreshControlMock;\n  componentDidMount() {\n    RefreshControlMock.latestRef = this;\n  }\n  render() {\n    return <RCTRefreshControl />;\n  }\n}\n\nmodule.exports = RefreshControlMock;\n"
  },
  {
    "path": "Libraries/Components/SafeAreaView/SafeAreaView.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SafeAreaView\n * @flow\n */\n'use strict';\n\nmodule.exports = require('View');\n"
  },
  {
    "path": "Libraries/Components/SafeAreaView/SafeAreaView.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SafeAreaView\n * @flow\n * @format\n */\n\nconst React = require('React');\nconst ViewPropTypes = require('ViewPropTypes');\nconst requireNativeComponent = require('requireNativeComponent');\n\nimport type {ViewProps} from 'ViewPropTypes';\n\ntype Props = ViewProps & {\n  children: any,\n};\n\n/**\n * Renders nested content and automatically applies paddings reflect the portion of the view\n * that is not covered by navigation bars, tab bars, toolbars, and other ancestor views.\n * Moreover, and most importantly, Safe Area's paddings reflect physical limitation of the screen,\n * such as rounded corners or camera notches (aka sensor housing area on iPhone X).\n */\nclass SafeAreaView extends React.Component<Props> {\n  static propTypes = {\n    ...ViewPropTypes,\n  };\n\n  render() {\n    return <RCTSafeAreaView {...this.props} />;\n  }\n}\n\nconst RCTSafeAreaView = requireNativeComponent('RCTSafeAreaView', {\n  name: 'RCTSafeAreaView',\n  displayName: 'RCTSafeAreaView',\n  propTypes: {\n    ...ViewPropTypes,\n  },\n});\n\nmodule.exports = SafeAreaView;\n"
  },
  {
    "path": "Libraries/Components/SafeAreaView/SafeAreaView.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SafeAreaView\n * @flow\n */\n'use strict';\n\nmodule.exports = require('View');\n"
  },
  {
    "path": "Libraries/Components/ScrollResponder.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ScrollResponder\n * @flow\n */\n'use strict';\n\nconst Dimensions = require('Dimensions');\nconst Platform = require('Platform');\nconst FrameRateLogger = require('FrameRateLogger');\nconst Keyboard = require('Keyboard');\nconst ReactNative = require('ReactNative');\nconst Subscribable = require('Subscribable');\nconst TextInputState = require('TextInputState');\nconst UIManager = require('UIManager');\n\nconst invariant = require('fbjs/lib/invariant');\nconst nullthrows = require('fbjs/lib/nullthrows');\nconst performanceNow = require('fbjs/lib/performanceNow');\nconst warning = require('fbjs/lib/warning');\n\nconst { ScrollViewManager } = require('NativeModules');\nconst { getInstanceFromNode } = require('ReactNativeComponentTree');\n\n/**\n * Mixin that can be integrated in order to handle scrolling that plays well\n * with `ResponderEventPlugin`. Integrate with your platform specific scroll\n * views, or even your custom built (every-frame animating) scroll views so that\n * all of these systems play well with the `ResponderEventPlugin`.\n *\n * iOS scroll event timing nuances:\n * ===============================\n *\n *\n * Scrolling without bouncing, if you touch down:\n * -------------------------------\n *\n * 1. `onMomentumScrollBegin` (when animation begins after letting up)\n *    ... physical touch starts ...\n * 2. `onTouchStartCapture`   (when you press down to stop the scroll)\n * 3. `onTouchStart`          (same, but bubble phase)\n * 4. `onResponderRelease`    (when lifting up - you could pause forever before * lifting)\n * 5. `onMomentumScrollEnd`\n *\n *\n * Scrolling with bouncing, if you touch down:\n * -------------------------------\n *\n * 1. `onMomentumScrollBegin` (when animation begins after letting up)\n *    ... bounce begins ...\n *    ... some time elapses ...\n *    ... physical touch during bounce ...\n * 2. `onMomentumScrollEnd`   (Makes no sense why this occurs first during bounce)\n * 3. `onTouchStartCapture`   (immediately after `onMomentumScrollEnd`)\n * 4. `onTouchStart`          (same, but bubble phase)\n * 5. `onTouchEnd`            (You could hold the touch start for a long time)\n * 6. `onMomentumScrollBegin` (When releasing the view starts bouncing back)\n *\n * So when we receive an `onTouchStart`, how can we tell if we are touching\n * *during* an animation (which then causes the animation to stop)? The only way\n * to tell is if the `touchStart` occurred immediately after the\n * `onMomentumScrollEnd`.\n *\n * This is abstracted out for you, so you can just call this.scrollResponderIsAnimating() if\n * necessary\n *\n * `ScrollResponder` also includes logic for blurring a currently focused input\n * if one is focused while scrolling. The `ScrollResponder` is a natural place\n * to put this logic since it can support not dismissing the keyboard while\n * scrolling, unless a recognized \"tap\"-like gesture has occurred.\n *\n * The public lifecycle API includes events for keyboard interaction, responder\n * interaction, and scrolling (among others). The keyboard callbacks\n * `onKeyboardWill/Did/*` are *global* events, but are invoked on scroll\n * responder's props so that you can guarantee that the scroll responder's\n * internal state has been updated accordingly (and deterministically) by\n * the time the props callbacks are invoke. Otherwise, you would always wonder\n * if the scroll responder is currently in a state where it recognizes new\n * keyboard positions etc. If coordinating scrolling with keyboard movement,\n * *always* use these hooks instead of listening to your own global keyboard\n * events.\n *\n * Public keyboard lifecycle API: (props callbacks)\n *\n * Standard Keyboard Appearance Sequence:\n *\n *   this.props.onKeyboardWillShow\n *   this.props.onKeyboardDidShow\n *\n * `onScrollResponderKeyboardDismissed` will be invoked if an appropriate\n * tap inside the scroll responder's scrollable region was responsible\n * for the dismissal of the keyboard. There are other reasons why the\n * keyboard could be dismissed.\n *\n *   this.props.onScrollResponderKeyboardDismissed\n *\n * Standard Keyboard Hide Sequence:\n *\n *   this.props.onKeyboardWillHide\n *   this.props.onKeyboardDidHide\n */\n\nconst IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;\n\ntype State = {\n  isTouching: boolean,\n  lastMomentumScrollBeginTime: number,\n  lastMomentumScrollEndTime: number,\n  observedScrollSinceBecomingResponder: boolean,\n  becameResponderWhileAnimating: boolean,\n};\ntype Event = Object;\n\nfunction isTagInstanceOfTextInput(tag) {\n  const instance = getInstanceFromNode(tag);\n  return instance && instance.viewConfig && (\n    instance.viewConfig.uiViewClassName === 'AndroidTextInput' ||\n    instance.viewConfig.uiViewClassName === 'RCTMultilineTextInputView' ||\n    instance.viewConfig.uiViewClassName === 'RCTSinglelineTextInputView'\n  );\n}\n\nconst ScrollResponderMixin = {\n  mixins: [Subscribable.Mixin],\n  scrollResponderMixinGetInitialState: function(): State {\n    return {\n      isTouching: false,\n      lastMomentumScrollBeginTime: 0,\n      lastMomentumScrollEndTime: 0,\n\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 !== 'always').\n      observedScrollSinceBecomingResponder: false,\n      becameResponderWhileAnimating: false,\n    };\n  },\n\n  /**\n   * Invoke this from an `onScroll` event.\n   */\n  scrollResponderHandleScrollShouldSetResponder: function(): boolean {\n    return this.state.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: function(e: Event): boolean {\n    const currentlyFocusedTextInput = TextInputState.currentlyFocusedField();\n\n    if (\n      this.props.keyboardShouldPersistTaps === 'handled' &&\n      currentlyFocusedTextInput != null &&\n      e.target !== currentlyFocusedTextInput\n    ) {\n      return true;\n    }\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 a text input, while the keyboard is\n   *   up (which should dismiss the keyboard).\n   *\n   * Invoke this from an `onStartShouldSetResponderCapture` event.\n   */\n  scrollResponderHandleStartShouldSetResponderCapture: function(\n    e: Event\n  ): boolean {\n    // First see if we want to eat taps while the keyboard is up\n    const currentlyFocusedTextInput = TextInputState.currentlyFocusedField();\n    const {keyboardShouldPersistTaps} = this.props;\n    const keyboardNeverPersistTaps = !keyboardShouldPersistTaps ||\n                                    keyboardShouldPersistTaps === 'never';\n    if (keyboardNeverPersistTaps &&\n      currentlyFocusedTextInput != null &&\n      !isTagInstanceOfTextInput(e.target)\n    ) {\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: function() {},\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: function(): boolean {\n    return !this.state.observedScrollSinceBecomingResponder;\n  },\n\n  /**\n   * Invoke this from an `onTouchEnd` event.\n   *\n   * @param {SyntheticEvent} e Event.\n   */\n  scrollResponderHandleTouchEnd: function(e: Event) {\n    const nativeEvent = e.nativeEvent;\n    this.state.isTouching = nativeEvent.touches.length !== 0;\n    this.props.onTouchEnd && this.props.onTouchEnd(e);\n  },\n\n  /**\n   * Invoke this from an `onTouchCancel` event.\n   *\n   * @param {SyntheticEvent} e Event.\n   */\n  scrollResponderHandleTouchCancel: function(e: Event) {\n    this.state.isTouching = false;\n    this.props.onTouchCancel && this.props.onTouchCancel(e);\n  },\n\n  /**\n   * Invoke this from an `onResponderRelease` event.\n   */\n  scrollResponderHandleResponderRelease: function(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 (this.props.keyboardShouldPersistTaps !== true &&\n      this.props.keyboardShouldPersistTaps !== 'always' &&\n      currentlyFocusedTextInput != null &&\n      e.target !== currentlyFocusedTextInput &&\n      !this.state.observedScrollSinceBecomingResponder &&\n      !this.state.becameResponderWhileAnimating\n    ) {\n      this.props.onScrollResponderKeyboardDismissed &&\n        this.props.onScrollResponderKeyboardDismissed(e);\n      TextInputState.blurTextInput(currentlyFocusedTextInput);\n    }\n  },\n\n  scrollResponderHandleScroll: function(e: Event) {\n    this.state.observedScrollSinceBecomingResponder = true;\n    this.props.onScroll && this.props.onScroll(e);\n  },\n\n  /**\n   * Invoke this from an `onResponderGrant` event.\n   */\n  scrollResponderHandleResponderGrant: function(e: Event) {\n    this.state.observedScrollSinceBecomingResponder = false;\n    this.props.onResponderGrant && this.props.onResponderGrant(e);\n    this.state.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: function(e: Event) {\n    FrameRateLogger.beginScroll(); // TODO: track all scrolls after implementing onScrollEndAnimation\n    this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);\n  },\n\n  /**\n   * Invoke this from an `onScrollEndDrag` event.\n   */\n  scrollResponderHandleScrollEndDrag: function(e: Event) {\n    const { velocity } = e.nativeEvent;\n    // - If we are animating, then this is a \"drag\" that is stopping the scrollview and momentum end\n    //   will fire.\n    // - If velocity is non-zero, then the interaction will stop when momentum scroll ends or\n    //   another drag starts and ends.\n    // - If we don't get velocity, better to stop the interaction twice than not stop it.\n    if (\n      !this.scrollResponderIsAnimating() &&\n      (!velocity || (velocity.x === 0 && velocity.y === 0))\n    ) {\n      FrameRateLogger.endScroll();\n    }\n    this.props.onScrollEndDrag && this.props.onScrollEndDrag(e);\n  },\n\n  /**\n   * Invoke this from an `onMomentumScrollBegin` event.\n   */\n  scrollResponderHandleMomentumScrollBegin: function(e: Event) {\n    this.state.lastMomentumScrollBeginTime = performanceNow();\n    this.props.onMomentumScrollBegin && this.props.onMomentumScrollBegin(e);\n  },\n\n  /**\n   * Invoke this from an `onMomentumScrollEnd` event.\n   */\n  scrollResponderHandleMomentumScrollEnd: function(e: Event) {\n    FrameRateLogger.endScroll();\n    this.state.lastMomentumScrollEndTime = performanceNow();\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: function(e: Event) {\n    this.state.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: function(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: function(): boolean {\n    const now = performanceNow();\n    const timeSinceLastMomentumScrollEnd = now - this.state.lastMomentumScrollEndTime;\n    const isAnimating = timeSinceLastMomentumScrollEnd < IS_ANIMATING_TOUCH_START_THRESHOLD_MS ||\n      this.state.lastMomentumScrollEndTime < this.state.lastMomentumScrollBeginTime;\n    return isAnimating;\n  },\n\n  /**\n   * Returns the node that represents native view that can be scrolled.\n   * Components can pass what node to use by defining a `getScrollableNode`\n   * function otherwise `this` is used.\n   */\n  scrollResponderGetScrollableNode: function(): any {\n    return this.getScrollableNode\n      ? this.getScrollableNode()\n      : ReactNative.findNodeHandle(this);\n  },\n\n  /**\n   * A helper function to scroll to a specific point in the ScrollView.\n   * This is currently used to help focus 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: function(\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 || {});\n    }\n\n    var commandID;\n    if (Platform.OS === 'macos') {\n      commandID = UIManager.RCTNativeScrollView.Commands.scrollTo;\n    } else {\n      commandID = UIManager.RCTScrollView.Commands.scrollTo;\n    }\n\n    UIManager.dispatchViewManagerCommand(\n      nullthrows(this.scrollResponderGetScrollableNode()),\n      commandID,\n      [x || 0, y || 0, animated !== false]\n    );\n  },\n\n  /**\n   * Scrolls to the end of the ScrollView, either immediately or with a smooth\n   * animation.\n   *\n   * Example:\n   *\n   * `scrollResponderScrollToEnd({animated: true})`\n   */\n  scrollResponderScrollToEnd: function(options?: { animated?: boolean }) {\n    // Default to true\n    const animated = (options && options.animated) !== false;\n    UIManager.dispatchViewManagerCommand(\n      this.scrollResponderGetScrollableNode(),\n      UIManager.RCTScrollView.Commands.scrollToEnd,\n      [animated]\n    );\n  },\n\n  /**\n   * Deprecated, do not use.\n   */\n  scrollResponderScrollWithoutAnimationTo: function(\n    offsetX: number,\n    offsetY: number\n  ) {\n    console.warn(\n      '`scrollResponderScrollWithoutAnimationTo` is deprecated. Use `scrollResponderScrollTo` instead'\n    );\n    this.scrollResponderScrollTo({ x: offsetX, y: offsetY, animated: false });\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: function(\n    rect: {| x: number, y: number, width: number, height: number, animated?: boolean |},\n    animated?: boolean // deprecated, put this inside the rect argument instead\n  ) {\n    invariant(\n      ScrollViewManager && ScrollViewManager.zoomToRect,\n      'zoomToRect is not implemented'\n    );\n    if ('animated' in rect) {\n      animated = rect.animated;\n      delete rect.animated;\n    } else if (typeof animated !== 'undefined') {\n      console.warn(\n        '`scrollResponderZoomTo` `animated` argument is deprecated. Use `options.animated` instead'\n      );\n    }\n    ScrollViewManager.zoomToRect(\n      this.scrollResponderGetScrollableNode(),\n      rect,\n      animated !== false\n    );\n  },\n\n  /**\n   * Displays the scroll indicators momentarily.\n   */\n  scrollResponderFlashScrollIndicators: function() {\n    UIManager.dispatchViewManagerCommand(\n      this.scrollResponderGetScrollableNode(),\n      UIManager.RCTScrollView.Commands.flashScrollIndicators,\n      []\n    );\n  },\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 bottom \"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: function(\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      ReactNative.findNodeHandle(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: function(left: number, top: number, width: number, height: number) {\n    let keyboardScreenY = Dimensions.get('window').height;\n    if (this.keyboardWillOpenTo) {\n      keyboardScreenY = this.keyboardWillOpenTo.endCoordinates.screenY;\n    }\n    let scrollOffsetY = 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: function(e: Event) {\n    console.error('Error measuring text field: ', e);\n  },\n\n  /**\n   * `componentWillMount` is the closest thing to a  standard \"constructor\" for\n   * React components.\n   *\n   * The `keyboardWillShow` is called before input focus.\n   */\n  componentWillMount: function() {\n    const {keyboardShouldPersistTaps} = this.props;\n    warning(\n      typeof keyboardShouldPersistTaps !== 'boolean',\n      `'keyboardShouldPersistTaps={${keyboardShouldPersistTaps}}' is deprecated. `\n      + `Use 'keyboardShouldPersistTaps=\"${keyboardShouldPersistTaps ? 'always' : 'never'}\"' instead`\n    );\n\n    this.keyboardWillOpenTo = null;\n    this.additionalScrollOffset = 0;\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: function(e: Event) {\n    this.keyboardWillOpenTo = e;\n    this.props.onKeyboardWillShow && this.props.onKeyboardWillShow(e);\n  },\n\n  scrollResponderKeyboardWillHide: function(e: Event) {\n    this.keyboardWillOpenTo = null;\n    this.props.onKeyboardWillHide && this.props.onKeyboardWillHide(e);\n  },\n\n  scrollResponderKeyboardDidShow: function(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: function(e: Event) {\n    this.keyboardWillOpenTo = null;\n    this.props.onKeyboardDidHide && this.props.onKeyboardDidHide(e);\n  },\n};\n\nconst ScrollResponder = {\n  Mixin: ScrollResponderMixin,\n};\n\nmodule.exports = ScrollResponder;\n"
  },
  {
    "path": "Libraries/Components/ScrollView/RecyclerViewBackedScrollView.macos.js",
    "content": "/**\n * Copyright 2004-present Facebook. All Rights Reserved.\n *\n * @providesModule RecyclerViewBackedScrollView\n */\n'use strict';\n\nmodule.exports = require('ScrollView');\n"
  },
  {
    "path": "Libraries/Components/ScrollView/ScrollView.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ScrollView\n * @flow\n */\n'use strict';\n\nconst Animated = require('Animated');\nconst ColorPropType = require('ColorPropType');\nconst EdgeInsetsPropType = require('EdgeInsetsPropType');\nconst Platform = require('Platform');\nconst PointPropType = require('PointPropType');\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst ReactNative = require('ReactNative');\nconst ScrollResponder = require('ScrollResponder');\nconst ScrollViewStickyHeader = require('ScrollViewStickyHeader');\nconst StyleSheet = require('StyleSheet');\nconst StyleSheetPropType = require('StyleSheetPropType');\nconst View = require('View');\nconst ViewPropTypes = require('ViewPropTypes');\nconst ViewStylePropTypes = require('ViewStylePropTypes');\n\nconst createReactClass = require('create-react-class');\nconst dismissKeyboard = require('dismissKeyboard');\nconst flattenStyle = require('flattenStyle');\nconst invariant = require('fbjs/lib/invariant');\nconst deprecatedPropType = require('deprecatedPropType');\nconst processDecelerationRate = require('processDecelerationRate');\nconst requireNativeComponent = require('requireNativeComponent');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst warning = require('fbjs/lib/warning');\n\nimport type {NativeMethodsMixinType} from 'ReactNativeTypes';\n\n/**\n * Component that wraps platform ScrollView while providing\n * integration with touch locking \"responder\" system.\n *\n * Keep in mind that ScrollViews must have a bounded height in order to work,\n * since they contain unbounded-height children into a bounded container (via\n * a scroll interaction). In order to bound the height of a ScrollView, either\n * set the height of the view directly (discouraged) or make sure all parent\n * views have bounded height. Forgetting to transfer `{flex: 1}` down the\n * view stack can lead to errors here, which the element inspector makes\n * easy to debug.\n *\n * Doesn't yet support other contained responders from blocking this scroll\n * view from becoming the responder.\n *\n *\n * `<ScrollView>` vs [`<FlatList>`](/react-native/docs/flatlist.html) - which one to use?\n *\n * `ScrollView` simply renders all its react child components at once. That\n * makes it very easy to understand and use.\n *\n * On the other hand, this has a performance downside. Imagine you have a very\n * long list of items you want to display, maybe several screens worth of\n * content. Creating JS components and native views for everything all at once,\n * much of which may not even be shown, will contribute to slow rendering and\n * increased memory usage.\n *\n * This is where `FlatList` comes into play. `FlatList` renders items lazily,\n * just when they are about to appear, and removes items that scroll way off\n * screen to save memory and processing time.\n *\n * `FlatList` is also handy if you want to render separators between your items,\n * multiple columns, infinite scroll loading, or any number of other features it\n * supports out of the box.\n */\n// $FlowFixMe(>=0.41.0)\nconst ScrollView = createReactClass({\n  displayName: 'ScrollView',\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * Controls whether iOS should automatically adjust the content inset\n     * for scroll views that are placed behind a navigation bar or\n     * tab bar/ toolbar. The default value is true.\n     * @platform ios\n     */\n    automaticallyAdjustContentInsets: PropTypes.bool,\n    /**\n     * The amount by which the scroll view content is inset from the edges\n     * of the scroll view. Defaults to `{top: 0, left: 0, bottom: 0, right: 0}`.\n     * @platform ios\n     */\n    contentInset: EdgeInsetsPropType,\n    /**\n     * Used to manually set the starting scroll offset.\n     * The default value is `{x: 0, y: 0}`.\n     * @platform ios\n     */\n    contentOffset: PointPropType,\n    /**\n     * When true, the scroll view bounces when it reaches the end of the\n     * content if the content is larger then the scroll view along the axis of\n     * the scroll direction. When false, it disables all bouncing even if\n     * the `alwaysBounce*` props are true. The default value is true.\n     * @platform ios\n     */\n    bounces: PropTypes.bool,\n    /**\n     * When true, gestures can drive zoom past min/max and the zoom will animate\n     * to the min/max value at gesture end, otherwise the zoom will not exceed\n     * the limits.\n     * @platform ios\n     */\n    bouncesZoom: PropTypes.bool,\n\n    /**\n     * When true, the scroll view bounces horizontally when it reaches the end\n     * even if the content is smaller than the scroll view itself. The default\n     * value is true when `horizontal={true}` and false otherwise.\n     * @platform ios\n     */\n    alwaysBounceHorizontal: PropTypes.bool,\n    /**\n     * When true, the scroll view bounces vertically when it reaches the end\n     * even if the content is smaller than the scroll view itself. The default\n     * value is false when `horizontal={true}` and true otherwise.\n     * @platform ios\n     */\n    alwaysBounceVertical: PropTypes.bool,\n\n    /**\n     * When true, the scroll view automatically centers the content when the\n     * content is smaller than the scroll view bounds; when the content is\n     * larger than the scroll view, this property has no effect. The default\n     * value is false.\n     * @platform ios\n     */\n    centerContent: PropTypes.bool,\n    /**\n     * These styles will be applied to the scroll view content container which\n     * wraps all of the child views. Example:\n     *\n     * ```\n     * return (\n     *   <ScrollView contentContainerStyle={styles.contentContainer}>\n     *   </ScrollView>\n     * );\n     * ...\n     * const styles = StyleSheet.create({\n     *   contentContainer: {\n     *     paddingVertical: 20\n     *   }\n     * });\n     * ```\n     */\n    contentContainerStyle: StyleSheetPropType(ViewStylePropTypes),\n    /**\n     * A floating-point number that determines how quickly the scroll view\n     * decelerates after the user lifts their finger. You may also use string\n     * shortcuts `\"normal\"` and `\"fast\"` which match the underlying iOS settings\n     * for `UIScrollViewDecelerationRateNormal` and\n     * `UIScrollViewDecelerationRateFast` respectively.\n     *\n     *   - `'normal'`: 0.998 (the default)\n     *   - `'fast'`: 0.99\n     *\n     * @platform ios\n     */\n    decelerationRate: PropTypes.oneOfType([\n      PropTypes.oneOf(['fast', 'normal']),\n      PropTypes.number,\n    ]),\n    /**\n     * When true, the scroll view's children are arranged horizontally in a row\n     * instead of vertically in a column. The default value is false.\n     */\n    horizontal: PropTypes.bool,\n    /**\n     * The style of the scroll indicators.\n     *\n     *   - `'default'` (the default), same as `black`.\n     *   - `'black'`, scroll indicator is black. This style is good against a light background.\n     *   - `'white'`, scroll indicator is white. This style is good against a dark background.\n     *\n     * @platform ios\n     */\n    indicatorStyle: PropTypes.oneOf([\n      'default', // default\n      'black',\n      'white',\n    ]),\n    /**\n     * When true, the ScrollView will try to lock to only vertical or horizontal\n     * scrolling while dragging.  The default value is false.\n     * @platform ios\n     */\n    directionalLockEnabled: PropTypes.bool,\n    /**\n     * When false, once tracking starts, won't try to drag if the touch moves.\n     * The default value is true.\n     * @platform ios\n     */\n    canCancelContentTouches: PropTypes.bool,\n    /**\n     * Determines whether the keyboard gets dismissed in response to a drag.\n     *\n     * *Cross platform*\n     *\n     *   - `'none'` (the default), drags do not dismiss the keyboard.\n     *   - `'on-drag'`, the keyboard is dismissed when a drag begins.\n     *\n     * *iOS Only*\n     *\n     *   - `'interactive'`, the keyboard is dismissed interactively with the drag and moves in\n     *     synchrony with the touch; dragging upwards cancels the dismissal.\n     *     On android this is not supported and it will have the same behavior as 'none'.\n     */\n    keyboardDismissMode: PropTypes.oneOf([\n      'none', // default\n      'on-drag', // Cross-platform\n      'interactive', // iOS-only\n    ]),\n    /**\n     * Determines when the keyboard should stay visible after a tap.\n     *\n     *   - `'never'` (the default), tapping outside of the focused text input when the keyboard\n     *     is up dismisses the keyboard. When this happens, children won't receive the tap.\n     *   - `'always'`, the keyboard will not dismiss automatically, and the scroll view will not\n     *     catch taps, but children of the scroll view can catch taps.\n     *   - `'handled'`, the keyboard will not dismiss automatically when the tap was handled by\n     *     a children, (or captured by an ancestor).\n     *   - `false`, deprecated, use 'never' instead\n     *   - `true`, deprecated, use 'always' instead\n     */\n    keyboardShouldPersistTaps: PropTypes.oneOf(['always', 'never', 'handled', false, true]),\n    /**\n     * The maximum allowed zoom scale. The default value is 1.0.\n     * @platform ios\n     */\n    maximumZoomScale: PropTypes.number,\n    /**\n     * The minimum allowed zoom scale. The default value is 1.0.\n     * @platform ios\n     */\n    minimumZoomScale: PropTypes.number,\n    /**\n     * Called when the momentum scroll starts (scroll which occurs as the ScrollView glides to a stop).\n     */\n    onMomentumScrollBegin: PropTypes.func,\n    /**\n     * Called when the momentum scroll ends (scroll which occurs as the ScrollView glides to a stop).\n     */\n    onMomentumScrollEnd: PropTypes.func,\n    /**\n     * Fires at most once per frame during scrolling. The frequency of the\n     * events can be controlled using the `scrollEventThrottle` prop.\n     */\n    onScroll: PropTypes.func,\n    /**\n     * Called when the user begins to drag the scroll view.\n     */\n    onScrollBeginDrag: PropTypes.func,\n    /**\n     * Called when the user stops dragging the scroll view and it either stops\n     * or begins to glide.\n     */\n    onScrollEndDrag: PropTypes.func,\n    /**\n     * Called when scrollable content view of the ScrollView changes.\n     *\n     * Handler function is passed the content width and content height as parameters:\n     * `(contentWidth, contentHeight)`\n     *\n     * It's implemented using onLayout handler attached to the content container\n     * which this ScrollView renders.\n     */\n    onContentSizeChange: PropTypes.func,\n    /**\n     * When true, the scroll view stops on multiples of the scroll view's size\n     * when scrolling. This can be used for horizontal pagination. The default\n     * value is false.\n     *\n     * Note: Vertical pagination is not supported on Android.\n     */\n    pagingEnabled: PropTypes.bool,\n    /**\n    * When true, ScrollView allows use of pinch gestures to zoom in and out.\n    * The default value is true.\n    * @platform ios\n    */\n    pinchGestureEnabled: PropTypes.bool,\n    /**\n     * When false, the view cannot be scrolled via touch interaction.\n     * The default value is true.\n     *\n     * Note that the view can always be scrolled by calling `scrollTo`.\n     */\n    scrollEnabled: PropTypes.bool,\n    /**\n     * This controls how often the scroll event will be fired while scrolling\n     * (as a time interval in ms). A lower number yields better accuracy for code\n     * that is tracking the scroll position, but can lead to scroll performance\n     * problems due to the volume of information being send over the bridge.\n     * You will not notice a difference between values set between 1-16 as the\n     * JS run loop is synced to the screen refresh rate. If you do not need precise\n     * scroll position tracking, set this value higher to limit the information\n     * being sent across the bridge. The default value is zero, which results in\n     * the scroll event being sent only once each time the view is scrolled.\n     * @platform ios\n     */\n    scrollEventThrottle: PropTypes.number,\n    /**\n     * The amount by which the scroll view indicators are inset from the edges\n     * of the scroll view. This should normally be set to the same value as\n     * the `contentInset`. Defaults to `{0, 0, 0, 0}`.\n     * @platform ios\n     */\n    scrollIndicatorInsets: EdgeInsetsPropType,\n    /**\n     * When true, the scroll view scrolls to top when the status bar is tapped.\n     * The default value is true.\n     * @platform ios\n     */\n    scrollsToTop: PropTypes.bool,\n    /**\n     * When true, shows a horizontal scroll indicator.\n     * The default value is true.\n     */\n    showsHorizontalScrollIndicator: PropTypes.bool,\n    /**\n     * When true, shows a vertical scroll indicator.\n     * The default value is true.\n     */\n    showsVerticalScrollIndicator: PropTypes.bool,\n    /**\n     * When true, scrolls to bottom.\n     */\n    autoScrollToBottom: PropTypes.bool,\n    /**\n     * An array of child indices determining which children get docked to the\n     * top of the screen when scrolling. For example, passing\n     * `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the\n     * top of the scroll view. This property is not supported in conjunction\n     * with `horizontal={true}`.\n     */\n    stickyHeaderIndices: PropTypes.arrayOf(PropTypes.number),\n    /**\n     * When set, causes the scroll view to stop at multiples of the value of\n     * `snapToInterval`. This can be used for paginating through children\n     * that have lengths smaller than the scroll view. Typically used in\n     * combination with `snapToAlignment` and `decelerationRate=\"fast\"` on ios.\n     * Overrides less configurable `pagingEnabled` prop.\n     *\n     * Supported for horizontal scrollview on android.\n     */\n    snapToInterval: PropTypes.number,\n    /**\n     * When `snapToInterval` is set, `snapToAlignment` will define the relationship\n     * of the snapping to the scroll view.\n     *\n     *   - `'start'` (the default) will align the snap at the left (horizontal) or top (vertical)\n     *   - `'center'` will align the snap in the center\n     *   - `'end'` will align the snap at the right (horizontal) or bottom (vertical)\n     *\n     * @platform ios\n     */\n    snapToAlignment: PropTypes.oneOf([\n      'start', // default\n      'center',\n      'end',\n    ]),\n    /**\n     * Experimental: When true, offscreen child views (whose `overflow` value is\n     * `hidden`) are removed from their native backing superview when offscreen.\n     * This can improve scrolling performance on long lists. The default value is\n     * true.\n     */\n    removeClippedSubviews: PropTypes.bool,\n    /**\n     * The current scale of the scroll view content. The default value is 1.0.\n     * @platform ios\n     */\n    zoomScale: PropTypes.number,\n    /**\n     * This property specifies how the safe area insets are used to modify the\n     * content area of the scroll view. The default value of this property is\n     * \"never\". Available on iOS 11 and later.\n     * @platform ios\n     */\n    contentInsetAdjustmentBehavior: PropTypes.oneOf([\n      'automatic',\n      'scrollableAxes',\n      'never', // default\n      'always',\n    ]),\n    /**\n     * A RefreshControl component, used to provide pull-to-refresh\n     * functionality for the ScrollView. Only works for vertical ScrollViews\n     * (`horizontal` prop must be `false`).\n     *\n     * See [RefreshControl](docs/refreshcontrol.html).\n     */\n    refreshControl: PropTypes.element,\n\n    /**\n     * @platform ios\n     */\n    onRefreshStart: deprecatedPropType(\n      PropTypes.func,\n      'Use the `refreshControl` prop instead.'\n    ),\n\n    /**\n     * Sometimes a scrollview takes up more space than its content fills. When this is\n     * the case, this prop will fill the rest of the scrollview with a color to avoid setting\n     * a background and creating unnecessary overdraw. This is an advanced optimization\n     * that is not needed in the general case.\n     * @platform android\n     */\n    endFillColor: ColorPropType,\n\n    /**\n     * Tag used to log scroll performance on this scroll view. Will force\n     * momentum events to be turned on (see sendMomentumEvents). This doesn't do\n     * anything out of the box and you need to implement a custom native\n     * FpsListener for it to be useful.\n     * @platform android\n     */\n    scrollPerfTag: PropTypes.string,\n\n     /**\n     * Used to override default value of overScroll mode.\n     *\n     * Possible values:\n     *\n     *  - `'auto'` - Default value, allow a user to over-scroll\n     *    this view only if the content is large enough to meaningfully scroll.\n     *  - `'always'` - Always allow a user to over-scroll this view.\n     *  - `'never'` - Never allow a user to over-scroll this view.\n     *\n     * @platform android\n     */\n    overScrollMode: PropTypes.oneOf([\n      'auto',\n      'always',\n      'never',\n    ]),\n    /**\n     * When true, ScrollView will emit updateChildFrames data in scroll events,\n     * otherwise will not compute or emit child frame data.  This only exists\n     * to support legacy issues, `onLayout` should be used instead to retrieve\n     * frame data.\n     * The default value is false.\n     * @platform ios\n     */\n    DEPRECATED_sendUpdatedChildFrames: PropTypes.bool,\n  },\n\n  mixins: [ScrollResponder.Mixin],\n\n  _scrollAnimatedValue: (new Animated.Value(0): Animated.Value),\n  _scrollAnimatedValueAttachment: (null: ?{detach: () => void}),\n  _stickyHeaderRefs: (new Map(): Map<number, ScrollViewStickyHeader>),\n  _headerLayoutYs: (new Map(): Map<string, number>),\n  getInitialState: function() {\n    return this.scrollResponderMixinGetInitialState();\n  },\n\n  componentWillMount: function() {\n    this._scrollAnimatedValue = new Animated.Value(this.props.contentOffset ? this.props.contentOffset.y : 0);\n    this._scrollAnimatedValue.setOffset(this.props.contentInset ? this.props.contentInset.top : 0);\n    this._stickyHeaderRefs = new Map();\n    this._headerLayoutYs = new Map();\n  },\n\n  componentDidMount: function() {\n    this._updateAnimatedNodeAttachment();\n  },\n\n  componentDidUpdate: function() {\n    this._updateAnimatedNodeAttachment();\n  },\n\n  componentWillUnmount: function() {\n    if (this._scrollAnimatedValueAttachment) {\n      this._scrollAnimatedValueAttachment.detach();\n    }\n  },\n\n  setNativeProps: function(props: Object) {\n    this._scrollViewRef && this._scrollViewRef.setNativeProps(props);\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: function(): ScrollView {\n    return this;\n  },\n\n  getScrollableNode: function(): any {\n    return ReactNative.findNodeHandle(this._scrollViewRef);\n  },\n\n  getInnerViewNode: function(): any {\n    return ReactNative.findNodeHandle(this._innerViewRef);\n  },\n\n  /**\n   * Scrolls to a given x, y offset, either immediately or with a smooth animation.\n   *\n   * Example:\n   *\n   * `scrollTo({x: 0, y: 0, animated: true})`\n   *\n   * Note: The weird function signature is due to the fact that, for historical reasons,\n   * the function also accepts separate arguments as an alternative to the options object.\n   * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.\n   */\n  scrollTo: function(\n    y?: number | { x?: number, y?: number, animated?: boolean },\n    x?: number,\n    animated?: boolean\n  ) {\n    if (typeof y === 'number') {\n      console.warn('`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, ' +\n        'animated: true})` instead.');\n    } else {\n      ({x, y, animated} = y || {});\n    }\n    this.getScrollResponder().scrollResponderScrollTo(\n      {x: x || 0, y: y || 0, 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: function(\n    options?: { animated?: boolean },\n  ) {\n    // Default to true\n    const animated = (options && options.animated) !== false;\n    this.getScrollResponder().scrollResponderScrollToEnd({\n      animated: animated,\n    });\n  },\n\n  /**\n   * Deprecated, use `scrollTo` instead.\n   */\n  scrollWithoutAnimationTo: function(y: number = 0, x: number = 0) {\n    console.warn('`scrollWithoutAnimationTo` is deprecated. Use `scrollTo` instead');\n    this.scrollTo({x, y, animated: false});\n  },\n\n  /**\n   * Displays the scroll indicators momentarily.\n   *\n   * @platform ios\n   */\n  flashScrollIndicators: function() {\n    this.getScrollResponder().scrollResponderFlashScrollIndicators();\n  },\n\n  _getKeyForIndex: function(index, childArray) {\n    const child = childArray[index];\n    return child && child.key;\n  },\n\n  _updateAnimatedNodeAttachment: function() {\n    if (this._scrollAnimatedValueAttachment) {\n      this._scrollAnimatedValueAttachment.detach();\n    }\n    if (this.props.stickyHeaderIndices && this.props.stickyHeaderIndices.length > 0) {\n      this._scrollAnimatedValueAttachment = Animated.attachNativeEvent(\n        this._scrollViewRef,\n        'onScroll',\n        [{nativeEvent: {contentOffset: {y: this._scrollAnimatedValue}}}]\n      );\n    }\n  },\n\n  _setStickyHeaderRef: function(key, ref) {\n    if (ref) {\n      this._stickyHeaderRefs.set(key, ref);\n    } else {\n      this._stickyHeaderRefs.delete(key);\n    }\n  },\n\n  _onStickyHeaderLayout: function(index, event, key) {\n    if (!this.props.stickyHeaderIndices) {\n      return;\n    }\n    const childArray = React.Children.toArray(this.props.children);\n    if (key !== this._getKeyForIndex(index, childArray)) {\n      // ignore stale layout update\n      return;\n    }\n\n    const layoutY = event.nativeEvent.layout.y;\n    this._headerLayoutYs.set(key, layoutY);\n\n    const indexOfIndex = this.props.stickyHeaderIndices.indexOf(index);\n    const previousHeaderIndex = this.props.stickyHeaderIndices[indexOfIndex - 1];\n    if (previousHeaderIndex != null) {\n      const previousHeader = this._stickyHeaderRefs.get(\n        this._getKeyForIndex(previousHeaderIndex, childArray)\n      );\n      previousHeader && previousHeader.setNextHeaderY(layoutY);\n    }\n  },\n\n  _handleScroll: function(e: Object) {\n    if (__DEV__) {\n      if (this.props.onScroll && this.props.scrollEventThrottle == null && Platform.OS === 'ios') {\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    if (Platform.OS === 'android') {\n      if (this.props.keyboardDismissMode === 'on-drag') {\n        dismissKeyboard();\n      }\n    }\n    this.scrollResponderHandleScroll(e);\n  },\n\n  _handleContentOnLayout: function(e: Object) {\n    const {width, height} = e.nativeEvent.layout;\n    this.props.onContentSizeChange && this.props.onContentSizeChange(width, height);\n  },\n\n  _scrollViewRef: (null: ?ScrollView),\n  _setScrollViewRef: function(ref: ?ScrollView) {\n    this._scrollViewRef = ref;\n  },\n\n  _innerViewRef: (null: ?NativeMethodsMixinType),\n  _setInnerViewRef: function(ref: ?NativeMethodsMixinType) {\n    this._innerViewRef = ref;\n  },\n\n  render: function() {\n    let ScrollViewClass;\n    let ScrollContentContainerViewClass;\n    if (Platform.OS === 'ios') {\n      ScrollViewClass = RCTScrollView;\n      ScrollContentContainerViewClass = RCTScrollContentView;\n      warning(\n        !this.props.snapToInterval || !this.props.pagingEnabled,\n        'snapToInterval is currently ignored when pagingEnabled is true.'\n      );\n    } else if (Platform.OS === 'android') {\n      if (this.props.horizontal) {\n        ScrollViewClass = AndroidHorizontalScrollView;\n        ScrollContentContainerViewClass = AndroidHorizontalScrollContentView;\n      } else {\n        ScrollViewClass = AndroidScrollView;\n        ScrollContentContainerViewClass = View;\n      }\n      ScrollContentContainerViewClass = View;\n    } else if (Platform.OS === 'macos') {\n      ScrollViewClass = RCTScrollView;\n      ScrollContentContainerViewClass = View;\n    }\n\n    invariant(\n      ScrollViewClass !== undefined,\n      'ScrollViewClass must not be undefined'\n    );\n\n    invariant(\n      ScrollContentContainerViewClass !== undefined,\n      'ScrollContentContainerViewClass must not be undefined'\n    );\n\n    const contentContainerStyle = [\n      this.props.horizontal && styles.contentContainerHorizontal,\n      this.props.contentContainerStyle,\n    ];\n    let style, childLayoutProps;\n    if (__DEV__ && this.props.style) {\n      style = flattenStyle(this.props.style);\n      childLayoutProps = ['alignItems', 'justifyContent']\n        .filter((prop) => style && style[prop] !== undefined);\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 (this.props.onContentSizeChange) {\n      contentSizeChangeProps = {\n        onLayout: this._handleContentOnLayout,\n      };\n    }\n\n    const {stickyHeaderIndices} = this.props;\n    const hasStickyHeaders = stickyHeaderIndices && stickyHeaderIndices.length > 0;\n    const childArray = hasStickyHeaders && React.Children.toArray(this.props.children);\n    const children = hasStickyHeaders ?\n      childArray.map((child, index) => {\n        const indexOfIndex = child ? stickyHeaderIndices.indexOf(index) : -1;\n        if (indexOfIndex > -1) {\n          const key = child.key;\n          const nextIndex = stickyHeaderIndices[indexOfIndex + 1];\n          return (\n            <ScrollViewStickyHeader\n              key={key}\n              ref={(ref) => this._setStickyHeaderRef(key, ref)}\n              nextHeaderLayoutY={\n                this._headerLayoutYs.get(this._getKeyForIndex(nextIndex, childArray))\n              }\n              onLayout={(event) => this._onStickyHeaderLayout(index, event, key)}\n              scrollAnimatedValue={this._scrollAnimatedValue}>\n              {child}\n            </ScrollViewStickyHeader>\n          );\n        } else {\n          return child;\n        }\n      }) :\n      this.props.children;\n    const contentContainer =\n      <ScrollContentContainerViewClass\n        {...contentSizeChangeProps}\n        ref={this._setInnerViewRef}\n        style={contentContainerStyle}\n        removeClippedSubviews={\n          // Subview clipping causes issues with sticky headers on Android and\n          // would be hard to fix properly in a performant way.\n          Platform.OS === 'android' && hasStickyHeaders ?\n            false :\n            this.props.removeClippedSubviews\n        }\n        collapsable={false}>\n        {children}\n      </ScrollContentContainerViewClass>;\n\n    const alwaysBounceHorizontal =\n      this.props.alwaysBounceHorizontal !== undefined ?\n        this.props.alwaysBounceHorizontal :\n        this.props.horizontal;\n\n    const alwaysBounceVertical =\n      this.props.alwaysBounceVertical !== undefined ?\n        this.props.alwaysBounceVertical :\n        !this.props.horizontal;\n\n    const DEPRECATED_sendUpdatedChildFrames =\n      !!this.props.DEPRECATED_sendUpdatedChildFrames;\n\n    const baseStyle = this.props.horizontal ? styles.baseHorizontal : styles.baseVertical;\n    const props = {\n      ...this.props,\n      style: ([baseStyle, this.props.style]: ?Array<any>),\n      // Override the onContentSizeChange from props, since this event can\n      // bubble up from TextInputs\n      onContentSizeChange: null,\n      onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin,\n      onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd,\n      onResponderGrant: this.scrollResponderHandleResponderGrant,\n      onResponderReject: this.scrollResponderHandleResponderReject,\n      onResponderRelease: this.scrollResponderHandleResponderRelease,\n      onResponderTerminate: this.scrollResponderHandleTerminate,\n      onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest,\n      onScroll: this._handleScroll,\n      // onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag,\n      // onScrollEndDrag: this.scrollResponderHandleScrollEndDrag,\n      onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder,\n      onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder,\n      onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture,\n      onTouchEnd: this.scrollResponderHandleTouchEnd,\n      onTouchMove: this.scrollResponderHandleTouchMove,\n      onTouchStart: this.scrollResponderHandleTouchStart,\n      onTouchCancel: this.scrollResponderHandleTouchCancel,\n      scrollEventThrottle: hasStickyHeaders ? 1 : this.props.scrollEventThrottle,\n      sendMomentumEvents: (this.props.onMomentumScrollBegin || this.props.onMomentumScrollEnd) ?\n        true : false,\n      DEPRECATED_sendUpdatedChildFrames,\n    };\n\n    const onRefreshStart = this.props.onRefreshStart;\n    if (onRefreshStart) {\n      console.warn('onRefreshStart is deprecated. Use the refreshControl prop instead.');\n      // this is necessary because if we set it on props, even when empty,\n      // it'll trigger the default pull-to-refresh behavior on native.\n      props.onRefreshStart =\n        function() { onRefreshStart && onRefreshStart(this.endRefreshing); }.bind(this);\n    }\n\n    const refreshControl = this.props.refreshControl;\n\n    if (refreshControl) {\n      if (Platform.OS === 'ios') {\n        // On iOS the RefreshControl is a child of the ScrollView.\n        // tvOS lacks native support for RefreshControl, so don't include it in that case\n        return (\n          <ScrollViewClass {...props} ref={this._setScrollViewRef}>\n            {Platform.isTVOS ? null : refreshControl}\n            {contentContainer}\n          </ScrollViewClass>\n        );\n      } else if (Platform.OS === 'android') {\n        // On Android wrap the ScrollView with a AndroidSwipeRefreshLayout.\n        // Since the ScrollView is wrapped add the style props to the\n        // AndroidSwipeRefreshLayout and use flex: 1 for the ScrollView.\n        // Note: we should only apply props.style on the wrapper\n        // however, the ScrollView still needs the baseStyle to be scrollable\n\n        return React.cloneElement(\n          refreshControl,\n          {style: props.style},\n          <ScrollViewClass {...props} style={styles.baseHorizontal} ref={this._setScrollViewRef}>\n            {contentContainer}\n          </ScrollViewClass>\n        );\n      }\n    }\n    return (\n      <ScrollViewClass {...props} ref={this._setScrollViewRef}>\n        {contentContainer}\n      </ScrollViewClass>\n    );\n  }\n});\n\nconst styles = StyleSheet.create({\n  baseVertical: {\n    flexGrow: 1,\n    flexShrink: 1,\n    flexDirection: 'column',\n    overflow: 'scroll',\n  },\n  baseHorizontal: {\n    flexGrow: 1,\n    flexShrink: 1,\n    flexDirection: 'row',\n    overflow: 'scroll',\n  },\n  contentContainerHorizontal: {\n    alignSelf: 'flex-start',\n    flexDirection: 'row',\n  },\n});\n\nlet nativeOnlyProps,\n  AndroidScrollView,\n  AndroidHorizontalScrollContentView,\n  AndroidHorizontalScrollView,\n  RCTScrollView,\n  RCTScrollContentView;\nif (Platform.OS === 'android') {\n  nativeOnlyProps = {\n    nativeOnly: {\n      sendMomentumEvents: true,\n    }\n  };\n  AndroidScrollView = requireNativeComponent(\n    'RCTScrollView',\n    (ScrollView: React.ComponentType<any>),\n    nativeOnlyProps\n  );\n  AndroidHorizontalScrollView = requireNativeComponent(\n    'AndroidHorizontalScrollView',\n    (ScrollView: React.ComponentType<any>),\n    nativeOnlyProps\n  );\n  AndroidHorizontalScrollContentView = requireNativeComponent(\n    'AndroidHorizontalScrollContentView'\n  );\n} else if (Platform.OS === 'ios') {\n  nativeOnlyProps = {\n    nativeOnly: {\n      onMomentumScrollBegin: true,\n      onMomentumScrollEnd : true,\n      onScrollBeginDrag: true,\n      onScrollEndDrag: true,\n    }\n  };\n  RCTScrollView = requireNativeComponent(\n    'RCTScrollView',\n    (ScrollView: React.ComponentType<any>),\n    nativeOnlyProps,\n  );\n  RCTScrollContentView = requireNativeComponent('RCTScrollContentView', View);\n} else if (Platform.OS === 'macos') {\n  RCTScrollView = requireNativeComponent(\n    'RCTNativeScrollView',\n    (ScrollView: ReactClass<any>),\n    {\n    },\n  );\n}\n\nmodule.exports = ScrollView;\n"
  },
  {
    "path": "Libraries/Components/ScrollView/ScrollViewStickyHeader.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ScrollViewStickyHeader\n * @flow\n */\n'use strict';\n\nconst Animated = require('Animated');\nconst React = require('React');\nconst StyleSheet = require('StyleSheet');\n\ntype Props = {\n  children?: React.Element<any>,\n  nextHeaderLayoutY: ?number,\n  onLayout: (event: Object) => void,\n  scrollAnimatedValue: Animated.Value,\n};\n\nclass ScrollViewStickyHeader extends React.Component<Props, {\n  measured: boolean,\n  layoutY: number,\n  layoutHeight: number,\n  nextHeaderLayoutY: ?number,\n}> {\n  constructor(props: Props, context: Object) {\n    super(props, context);\n    this.state = {\n      measured: false,\n      layoutY: 0,\n      layoutHeight: 0,\n      nextHeaderLayoutY: props.nextHeaderLayoutY,\n    };\n  }\n\n  setNextHeaderY(y: number) {\n    this.setState({ nextHeaderLayoutY: y });\n  }\n\n  _onLayout = (event) => {\n    this.setState({\n      measured: true,\n      layoutY: event.nativeEvent.layout.y,\n      layoutHeight: event.nativeEvent.layout.height,\n    });\n\n    this.props.onLayout(event);\n    const child = React.Children.only(this.props.children);\n    if (child.props.onLayout) {\n      child.props.onLayout(event);\n    }\n  };\n\n  render() {\n    const {measured, layoutHeight, layoutY, nextHeaderLayoutY} = this.state;\n    const inputRange: Array<number> = [-1, 0];\n    const outputRange: Array<number> = [0, 0];\n\n    if (measured) {\n      // The interpolation looks like:\n      // - Negative scroll: no translation\n      // - From 0 to the y of the header: no translation. This will cause the header\n      //   to scroll normally until it reaches the top of the scroll view.\n      // - From header y to when the next header y hits the bottom edge of the header: translate\n      //   equally to scroll. This will cause the header to stay at the top of the scroll view.\n      // - Past the collision with the next header y: no more translation. This will cause the\n      // header to continue scrolling up and make room for the next sticky header.\n      // In the case that there is no next header just translate equally to\n      // scroll indefinetly.\n      inputRange.push(layoutY);\n      outputRange.push(0);\n      // Sometimes headers jump around so we make sure we don't violate the monotonic inputRange\n      // condition.\n      const collisionPoint = (nextHeaderLayoutY || 0) - layoutHeight;\n      if (collisionPoint >= layoutY) {\n        inputRange.push(collisionPoint, collisionPoint + 1);\n        outputRange.push(collisionPoint - layoutY, collisionPoint - layoutY);\n      } else {\n        inputRange.push(layoutY + 1);\n        outputRange.push(1);\n      }\n    }\n\n    const translateY = this.props.scrollAnimatedValue.interpolate({\n      inputRange,\n      outputRange,\n    });\n    const child = React.Children.only(this.props.children);\n\n    return (\n      <Animated.View\n        collapsable={false}\n        onLayout={this._onLayout}\n        style={[child.props.style, styles.header, {transform: [{translateY}]}]}>\n        {React.cloneElement(child, {\n          style: styles.fill, // We transfer the child style to the wrapper.\n          onLayout: undefined, // we call this manually through our this._onLayout\n        })}\n      </Animated.View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  header: {\n    zIndex: 10,\n  },\n  fill: {\n    flex: 1,\n  },\n});\n\nmodule.exports = ScrollViewStickyHeader;\n"
  },
  {
    "path": "Libraries/Components/ScrollView/__mocks__/ScrollViewMock.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\n/* eslint-env jest */\n\n'use strict';\n\ndeclare var jest: any;\n\nconst React = require('React');\nconst View = require('View');\n\nconst requireNativeComponent = require('requireNativeComponent');\n\nconst RCTScrollView = requireNativeComponent('RCTScrollView');\n\nconst ScrollViewComponent = jest.genMockFromModule('ScrollView');\n\nclass ScrollViewMock extends ScrollViewComponent {\n  render() {\n    return (\n      <RCTScrollView {...this.props}>\n        {this.props.refreshControl}\n        <View>\n          {this.props.children}\n        </View>\n      </RCTScrollView>\n    );\n  }\n}\n\nmodule.exports = ScrollViewMock;\n"
  },
  {
    "path": "Libraries/Components/ScrollView/processDecelerationRate.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule processDecelerationRate\n */\n'use strict';\n\nfunction processDecelerationRate(decelerationRate) {\n  if (decelerationRate === 'normal') {\n    decelerationRate = 0.998;\n  } else if (decelerationRate === 'fast') {\n    decelerationRate = 0.99;\n  }\n  return decelerationRate;\n}\n\nmodule.exports = processDecelerationRate;\n"
  },
  {
    "path": "Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js",
    "content": "\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SegmentedControlIOS\n */\n\n'use strict';\n\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar Text = require('Text');\nvar View = require('View');\n\nclass DummySegmentedControlIOS extends React.Component {\n  render() {\n    return (\n      <View style={[styles.dummy, this.props.style]}>\n        <Text style={styles.text}>\n          SegmentedControlIOS is not supported on this platform!\n        </Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  dummy: {\n    width: 120,\n    height: 50,\n    backgroundColor: '#ffbcbc',\n    borderWidth: 1,\n    borderColor: 'red',\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  text: {\n    color: '#333333',\n    margin: 5,\n    fontSize: 10,\n  }\n});\n\nmodule.exports = DummySegmentedControlIOS;\n"
  },
  {
    "path": "Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SegmentedControlIOS\n * @flow\n */\n'use strict';\n\nvar NativeMethodsMixin = require('NativeMethodsMixin');\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar StyleSheet = require('StyleSheet');\nvar ViewPropTypes = require('ViewPropTypes');\n\nvar createReactClass = require('create-react-class');\nvar requireNativeComponent = require('requireNativeComponent');\n\ntype DefaultProps = {\n  values: Array<string>,\n  enabled: boolean,\n};\n\nvar SEGMENTED_CONTROL_REFERENCE = 'segmentedcontrol';\n\ntype Event = Object;\n\n/**\n * Use `SegmentedControlIOS` to render a UISegmentedControl iOS.\n *\n * #### Programmatically changing selected index\n *\n * The selected index can be changed on the fly by assigning the\n * selectedIndex prop to a state variable, then changing that variable.\n * Note that the state variable would need to be updated as the user\n * selects a value and changes the index, as shown in the example below.\n *\n * ````\n * <SegmentedControlIOS\n *   values={['One', 'Two']}\n *   selectedIndex={this.state.selectedIndex}\n *   onChange={(event) => {\n *     this.setState({selectedIndex: event.nativeEvent.selectedSegmentIndex});\n *   }}\n * />\n * ````\n */\nvar SegmentedControlIOS = createReactClass({\n  displayName: 'SegmentedControlIOS',\n  mixins: [NativeMethodsMixin],\n\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * The labels for the control's segment buttons, in order.\n     */\n    values: PropTypes.arrayOf(PropTypes.string),\n\n    /**\n     * The index in `props.values` of the segment to be (pre)selected.\n     */\n    selectedIndex: PropTypes.number,\n\n    /**\n     * Callback that is called when the user taps a segment;\n     * passes the segment's value as an argument\n     */\n    onValueChange: PropTypes.func,\n\n    /**\n     * Callback that is called when the user taps a segment;\n     * passes the event as an argument\n     */\n    onChange: PropTypes.func,\n\n    /**\n     * If false the user won't be able to interact with the control.\n     * Default value is true.\n     */\n    enabled: PropTypes.bool,\n\n    /**\n     * Accent color of the control.\n     */\n    tintColor: PropTypes.string,\n\n    /**\n     * If true, then selecting a segment won't persist visually.\n     * The `onValueChange` callback will still work as expected.\n     */\n    momentary: PropTypes.bool\n  },\n\n  getDefaultProps: function(): DefaultProps {\n    return {\n      values: [],\n      enabled: true\n    };\n  },\n\n  _onChange: function(event: Event) {\n    this.props.onChange && this.props.onChange(event);\n    this.props.onValueChange && this.props.onValueChange(event.nativeEvent.value);\n  },\n\n  render: function() {\n    return (\n      <RCTSegmentedControl\n        {...this.props}\n        ref={SEGMENTED_CONTROL_REFERENCE}\n        style={[styles.segmentedControl, this.props.style]}\n        onChange={this._onChange}\n      />\n    );\n  }\n});\n\nvar styles = StyleSheet.create({\n  segmentedControl: {\n    height: 28,\n  },\n});\n\nvar RCTSegmentedControl = requireNativeComponent(\n  'RCTSegmentedControl',\n  SegmentedControlIOS\n);\n\nmodule.exports = SegmentedControlIOS;\n"
  },
  {
    "path": "Libraries/Components/Slider/Slider.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Slider\n * @flow\n */\n'use strict';\n\nvar Image = require('Image');\nvar ColorPropType = require('ColorPropType');\nvar NativeMethodsMixin = require('NativeMethodsMixin');\nvar ReactNativeViewAttributes = require('ReactNativeViewAttributes');\nvar Platform = require('Platform');\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar StyleSheet = require('StyleSheet');\nvar ViewPropTypes = require('ViewPropTypes');\n\nvar createReactClass = require('create-react-class');\nvar requireNativeComponent = require('requireNativeComponent');\n\ntype Event = Object;\n\n/**\n * A component used to select a single value from a range of values.\n *\n * ### Usage\n *\n * The example below shows how to use `Slider` to change\n * a value used by `Text`. The value is stored using\n * the state of the root component (`App`). The same component\n * subscribes to the `onValueChange`  of `Slider` and changes\n * the value using `setState`.\n *\n *```\n * import React from 'react';\n * import { StyleSheet, Text, View, Slider } from 'react-native';\n *\n * export default class App extends React.Component {\n *   constructor(props) {\n *     super(props);\n *     this.state = {\n *       value: 50\n *     }\n *   }\n *\n *   change(value) {\n *     this.setState(() => {\n *       return {\n *         value: parseFloat(value)\n *       };\n *     });\n *   }\n *\n *   render() {\n *     const {value} = this.state;\n *     return (\n *       <View style={styles.container}>\n *         <Text style={styles.text}>{String(value)}</Text>\n *         <Slider\n *           step={1}\n *           maximumValue={100}\n *           onValueChange={this.change.bind(this)}\n *           value={value} />\n *       </View>\n *     );\n *   }\n * }\n *\n * const styles = StyleSheet.create({\n *   container: {\n *     flex: 1,\n *     flexDirection: 'column',\n *     justifyContent: 'center'\n *   },\n *   text: {\n *     fontSize: 50,\n *     textAlign: 'center'\n *   }\n * });\n *```\n *\n */\nvar Slider = createReactClass({\n  displayName: 'Slider',\n  mixins: [NativeMethodsMixin],\n\n  propTypes: {\n    ...ViewPropTypes,\n\n    /**\n     * Used to style and layout the `Slider`.  See `StyleSheet.js` and\n     * `ViewStylePropTypes.js` for more info.\n     */\n    style: ViewPropTypes.style,\n\n    /**\n     * Initial value of the slider. The value should be between minimumValue\n     * and maximumValue, which default to 0 and 1 respectively.\n     * Default value is 0.\n     *\n     * *This is not a controlled component*, you don't need to update the\n     * value during dragging.\n     */\n    value: PropTypes.number,\n\n    /**\n     * Step value of the slider. The value should be\n     * between 0 and (maximumValue - minimumValue).\n     * Default value is 0.\n     */\n    step: PropTypes.number,\n\n    /**\n     * Initial minimum value of the slider. Default value is 0.\n     */\n    minimumValue: PropTypes.number,\n\n    /**\n     * Initial maximum value of the slider. Default value is 1.\n     */\n    maximumValue: PropTypes.number,\n\n    /**\n     * The color used for the track to the left of the button.\n     * Overrides the default blue gradient image on iOS.\n     */\n    minimumTrackTintColor: ColorPropType,\n\n    /**\n     * The color used for the track to the right of the button.\n     * Overrides the default blue gradient image on iOS.\n     */\n    maximumTrackTintColor: ColorPropType,\n\n    /**\n     * If true the user won't be able to move the slider.\n     * Default value is false.\n     */\n    disabled: PropTypes.bool,\n\n    /**\n     * Assigns a single image for the track. Only static images are supported.\n     * The center pixel of the image will be stretched to fill the track.\n     * @platform ios\n     */\n    trackImage: Image.propTypes.source,\n\n    /**\n     * Assigns a minimum track image. Only static images are supported. The\n     * rightmost pixel of the image will be stretched to fill the track.\n     * @platform ios\n     */\n    minimumTrackImage: Image.propTypes.source,\n\n    /**\n     * Assigns a maximum track image. Only static images are supported. The\n     * leftmost pixel of the image will be stretched to fill the track.\n     * @platform ios\n     */\n    maximumTrackImage: Image.propTypes.source,\n\n    /**\n     * Sets an image for the thumb. Only static images are supported.\n     * @platform ios\n     */\n    thumbImage: Image.propTypes.source,\n\n    /**\n     * Color of the foreground switch grip.\n     * @platform android\n     */\n    thumbTintColor: ColorPropType,\n\n    /**\n     * Callback continuously called while the user is dragging the slider.\n     */\n    onValueChange: PropTypes.func,\n\n    /**\n     * Callback that is called when the user releases the slider,\n     * regardless if the value has changed. The current value is passed\n     * as an argument to the callback handler.\n     */\n    onSlidingComplete: PropTypes.func,\n\n    /**\n     * Used to locate this view in UI automation tests.\n     */\n    testID: PropTypes.string,\n  },\n\n  getDefaultProps: function() : any {\n    return {\n      disabled: false,\n      value: 0,\n      minimumValue: 0,\n      maximumValue: 1,\n      step: 0\n    };\n  },\n\n  viewConfig: {\n    uiViewClassName: 'RCTSlider',\n    validAttributes: {\n      ...ReactNativeViewAttributes.RCTView,\n      value: true\n    }\n  },\n\n  render: function() {\n    const {style, onValueChange, onSlidingComplete, ...props} = this.props;\n    /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error found when Flow v0.54 was deployed. To see the error\n     * delete this comment and run Flow. */\n    props.style = [styles.slider, style];\n\n    /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error found when Flow v0.54 was deployed. To see the error\n     * delete this comment and run Flow. */\n    props.onValueChange = onValueChange && ((event: Event) => {\n      let userEvent = true;\n      if (Platform.OS === 'android') {\n        // On Android there's a special flag telling us the user is\n        // dragging the slider.\n        userEvent = event.nativeEvent.fromUser;\n      }\n      onValueChange && userEvent && onValueChange(event.nativeEvent.value);\n    });\n\n    /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error found when Flow v0.54 was deployed. To see the error\n     * delete this comment and run Flow. */\n    props.onChange = props.onValueChange;\n\n    /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error found when Flow v0.54 was deployed. To see the error\n     * delete this comment and run Flow. */\n    props.onSlidingComplete = onSlidingComplete && ((event: Event) => {\n      onSlidingComplete && onSlidingComplete(event.nativeEvent.value);\n    });\n\n    return <RCTSlider\n      {...props}\n      enabled={!this.props.disabled}\n      onStartShouldSetResponder={() => true}\n      onResponderTerminationRequest={() => false}\n    />;\n  }\n});\n\nlet styles;\nif (Platform.OS === 'ios' || Platform.OS === 'macos') {\n  styles = StyleSheet.create({\n    slider: {\n      height: 40,\n    },\n  });\n} else {\n  styles = StyleSheet.create({\n    slider: {},\n  });\n}\n\nlet options = {};\nif (Platform.OS === 'android') {\n  options = {\n    nativeOnly: {\n      enabled: true,\n    }\n  };\n}\nconst RCTSlider = requireNativeComponent('RCTSlider', Slider, options);\n\nmodule.exports = Slider;\n"
  },
  {
    "path": "Libraries/Components/StaticContainer.react.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StaticContainer.react\n * @flow\n */\n'use strict';\n\nconst React = require('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 */\nclass StaticContainer extends React.Component<Object> {\n\n  shouldComponentUpdate(nextProps: Object): boolean {\n    return !!nextProps.shouldUpdate;\n  }\n\n  render() {\n    const child = this.props.children;\n    return (child === null || child === false)\n      ? null\n      : React.Children.only(child);\n  }\n\n}\n\nmodule.exports = StaticContainer;\n"
  },
  {
    "path": "Libraries/Components/StaticRenderer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StaticRenderer\n * @flow\n */\n'use strict';\n\nvar React = require('React');\n\nvar PropTypes = require('prop-types');\n\nclass StaticRenderer extends React.Component<{\n  shouldUpdate: boolean,\n  render: Function,\n}> {\n  static propTypes = {\n    shouldUpdate: PropTypes.bool.isRequired,\n    render: PropTypes.func.isRequired,\n  };\n\n  shouldComponentUpdate(nextProps: { shouldUpdate: boolean }): boolean {\n    return nextProps.shouldUpdate;\n  }\n\n  render(): React.Node {\n    return this.props.render();\n  }\n}\n\nmodule.exports = StaticRenderer;\n"
  },
  {
    "path": "Libraries/Components/StatusBar/StatusBar.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StatusBar\n * @flow\n */\n'use strict';\n\nconst React = require('React');\nconst PropTypes = require('prop-types');\nconst ColorPropType = require('ColorPropType');\nconst Platform = require('Platform');\n\nconst processColor = require('processColor');\n\nconst StatusBarManager = require('NativeModules').StatusBarManager;\n\n/**\n * Status bar style\n */\nexport type StatusBarStyle = $Enum<{\n  /**\n   * Default status bar style (dark for iOS, light for Android)\n   */\n  'default': string,\n  /**\n   * Dark background, white texts and icons\n   */\n  'light-content': string,\n  /**\n   * Light background, dark texts and icons\n   */\n  'dark-content': string,\n}>;\n\n/**\n * Status bar animation\n */\nexport type StatusBarAnimation = $Enum<{\n  /**\n   * No animation\n   */\n  'none': string,\n  /**\n   * Fade animation\n   */\n  'fade': string,\n  /**\n   * Slide animation\n   */\n  'slide': string,\n}>;\n\ntype DefaultProps = {\n  animated: boolean,\n};\n\n/**\n * Merges the prop stack with the default values.\n */\nfunction mergePropsStack(\n  propsStack: Array<Object>,\n  defaultValues: Object\n): Object {\n  return propsStack.reduce((prev, cur) => {\n    for (const prop in cur) {\n      if (cur[prop] != null) {\n        prev[prop] = cur[prop];\n      }\n    }\n    return prev;\n  }, Object.assign({}, defaultValues));\n}\n\n/**\n * Returns an object to insert in the props stack from the props\n * and the transition/animation info.\n */\nfunction createStackEntry(props: any): any {\n  return {\n    backgroundColor:\n      props.backgroundColor != null\n        ? {\n            value: props.backgroundColor,\n            animated: props.animated,\n          }\n        : null,\n    barStyle:\n      props.barStyle != null\n        ? {\n            value: props.barStyle,\n            animated: props.animated,\n          }\n        : null,\n    translucent: props.translucent,\n    hidden:\n      props.hidden != null\n        ? {\n            value: props.hidden,\n            animated: props.animated,\n            transition: props.showHideTransition,\n          }\n        : null,\n    networkActivityIndicatorVisible: props.networkActivityIndicatorVisible,\n  };\n}\n\n/**\n * Component to control the app status bar.\n *\n * ### Usage with Navigator\n *\n * It is possible to have multiple `StatusBar` components mounted at the same\n * time. The props will be merged in the order the `StatusBar` components were\n * mounted. One use case is to specify status bar styles per route using `Navigator`.\n *\n * ```\n *  <View>\n *    <StatusBar\n *      backgroundColor=\"blue\"\n *      barStyle=\"light-content\"\n *    />\n *    <Navigator\n *      initialRoute={{statusBarHidden: true}}\n *      renderScene={(route, navigator) =>\n *        <View>\n *          <StatusBar hidden={route.statusBarHidden} />\n *          ...\n *        </View>\n *      }\n *    />\n *  </View>\n * ```\n *\n * ### Imperative API\n *\n * For cases where using a component is not ideal, there is also an imperative\n * API exposed as static functions on the component. It is however not recommended\n * to use the static API and the component for the same prop because any value\n * set by the static API will get overriden by the one set by the component in\n * the next render.\n *\n * ### Constants\n *\n * `currentHeight` (Android only) The height of the status bar.\n */\nclass StatusBar extends React.Component<{\n  hidden?: boolean,\n  animated?: boolean,\n  backgroundColor?: string,\n  translucent?: boolean,\n  barStyle?: 'default' | 'light-content' | 'dark-content',\n  networkActivityIndicatorVisible?: boolean,\n  showHideTransition?: 'fade' | 'slide',\n}> {\n  static _propsStack = [];\n\n  static _defaultProps = createStackEntry({\n    animated: false,\n    showHideTransition: 'fade',\n    backgroundColor: 'black',\n    barStyle: 'default',\n    translucent: false,\n    hidden: false,\n    networkActivityIndicatorVisible: false,\n  });\n\n  // Timer for updating the native module values at the end of the frame.\n  static _updateImmediate = null;\n\n  // The current merged values from the props stack.\n  static _currentValues = null;\n\n  // TODO(janic): Provide a real API to deal with status bar height. See the\n  // discussion in #6195.\n  /**\n   * The current height of the status bar on the device.\n   *\n   * @platform android\n   */\n  static currentHeight = StatusBarManager && StatusBarManager.HEIGHT;\n\n  // Provide an imperative API as static functions of the component.\n  // See the corresponding prop for more detail.\n\n  /**\n   * Show or hide the status bar\n   * @param hidden Hide the status bar.\n   * @param animation Optional animation when\n   *    changing the status bar hidden property.\n   */\n  static setHidden(hidden: boolean, animation?: StatusBarAnimation) {\n    animation = animation || 'none';\n    StatusBar._defaultProps.hidden.value = hidden;\n    if (Platform.OS === 'ios') {\n      StatusBarManager.setHidden(hidden, animation);\n    } else if (Platform.OS === 'android') {\n      StatusBarManager.setHidden(hidden);\n    }\n  }\n\n  /**\n   * Set the status bar style\n   * @param style Status bar style to set\n   * @param animated Animate the style change.\n   */\n  static setBarStyle(style: StatusBarStyle, animated?: boolean) {\n    animated = animated || false;\n    StatusBar._defaultProps.barStyle.value = style;\n    if (Platform.OS === 'ios') {\n      StatusBarManager.setStyle(style, animated);\n    } else if (Platform.OS === 'android') {\n      StatusBarManager.setStyle(style);\n    }\n  }\n\n  /**\n   * Control the visibility of the network activity indicator\n   * @param visible Show the indicator.\n   */\n  static setNetworkActivityIndicatorVisible(visible: boolean) {\n    if (Platform.OS !== 'ios') {\n      console.warn(\n        '`setNetworkActivityIndicatorVisible` is only available on iOS'\n      );\n      return;\n    }\n    StatusBar._defaultProps.networkActivityIndicatorVisible = visible;\n    StatusBarManager.setNetworkActivityIndicatorVisible(visible);\n  }\n\n  /**\n   * Set the background color for the status bar\n   * @param color Background color.\n   * @param animated Animate the style change.\n   */\n  static setBackgroundColor(color: string, animated?: boolean) {\n    if (Platform.OS !== 'android') {\n      console.warn('`setBackgroundColor` is only available on Android');\n      return;\n    }\n    animated = animated || false;\n    StatusBar._defaultProps.backgroundColor.value = color;\n    StatusBarManager.setColor(processColor(color), animated);\n  }\n\n  /**\n   * Control the translucency of the status bar\n   * @param translucent Set as translucent.\n   */\n  static setTranslucent(translucent: boolean) {\n    if (Platform.OS !== 'android') {\n      console.warn('`setTranslucent` is only available on Android');\n      return;\n    }\n    StatusBar._defaultProps.translucent = translucent;\n    StatusBarManager.setTranslucent(translucent);\n  }\n\n  static propTypes = {\n    /**\n     * If the status bar is hidden.\n     */\n    hidden: PropTypes.bool,\n    /**\n     * If the transition between status bar property changes should be animated.\n     * Supported for backgroundColor, barStyle and hidden.\n     */\n    animated: PropTypes.bool,\n    /**\n     * The background color of the status bar.\n     * @platform android\n     */\n    backgroundColor: ColorPropType,\n    /**\n     * If the status bar is translucent.\n     * When translucent is set to true, the app will draw under the status bar.\n     * This is useful when using a semi transparent status bar color.\n     *\n     * @platform android\n     */\n    translucent: PropTypes.bool,\n    /**\n     * Sets the color of the status bar text.\n     */\n    barStyle: PropTypes.oneOf(['default', 'light-content', 'dark-content']),\n    /**\n     * If the network activity indicator should be visible.\n     *\n     * @platform ios\n     */\n    networkActivityIndicatorVisible: PropTypes.bool,\n    /**\n     * The transition effect when showing and hiding the status bar using the `hidden`\n     * prop. Defaults to 'fade'.\n     *\n     * @platform ios\n     */\n    showHideTransition: PropTypes.oneOf(['fade', 'slide']),\n  };\n\n  static defaultProps = {\n    animated: false,\n    showHideTransition: 'fade',\n  };\n\n  _stackEntry = null;\n\n  componentDidMount() {\n    // Every time a StatusBar component is mounted, we push it's prop to a stack\n    // and always update the native status bar with the props from the top of then\n    // stack. This allows having multiple StatusBar components and the one that is\n    // added last or is deeper in the view hierachy will have priority.\n    this._stackEntry = createStackEntry(this.props);\n    StatusBar._propsStack.push(this._stackEntry);\n    this._updatePropsStack();\n  }\n\n  componentWillUnmount() {\n    // When a StatusBar is unmounted, remove itself from the stack and update\n    // the native bar with the next props.\n    const index = StatusBar._propsStack.indexOf(this._stackEntry);\n    StatusBar._propsStack.splice(index, 1);\n\n    this._updatePropsStack();\n  }\n\n  componentDidUpdate() {\n    const index = StatusBar._propsStack.indexOf(this._stackEntry);\n    this._stackEntry = createStackEntry(this.props);\n    StatusBar._propsStack[index] = this._stackEntry;\n\n    this._updatePropsStack();\n  }\n\n  /**\n   * Updates the native status bar with the props from the stack.\n   */\n  _updatePropsStack = () => {\n    // Send the update to the native module only once at the end of the frame.\n    clearImmediate(StatusBar._updateImmediate);\n    StatusBar._updateImmediate = setImmediate(() => {\n      const oldProps = StatusBar._currentValues;\n      const mergedProps = mergePropsStack(\n        StatusBar._propsStack,\n        StatusBar._defaultProps\n      );\n\n      // Update the props that have changed using the merged values from the props stack.\n      if (Platform.OS === 'ios') {\n        if (\n          !oldProps ||\n          oldProps.barStyle.value !== mergedProps.barStyle.value\n        ) {\n          StatusBarManager.setStyle(\n            mergedProps.barStyle.value,\n            mergedProps.barStyle.animated\n          );\n        }\n        if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) {\n          StatusBarManager.setHidden(\n            mergedProps.hidden.value,\n            mergedProps.hidden.animated ? mergedProps.hidden.transition : 'none'\n          );\n        }\n\n        if (\n          !oldProps ||\n          oldProps.networkActivityIndicatorVisible !==\n            mergedProps.networkActivityIndicatorVisible\n        ) {\n          StatusBarManager.setNetworkActivityIndicatorVisible(\n            mergedProps.networkActivityIndicatorVisible\n          );\n        }\n      } else if (Platform.OS === 'android') {\n        if (\n          !oldProps ||\n          oldProps.barStyle.value !== mergedProps.barStyle.value\n        ) {\n          StatusBarManager.setStyle(mergedProps.barStyle.value);\n        }\n        if (\n          !oldProps ||\n          oldProps.backgroundColor.value !== mergedProps.backgroundColor.value\n        ) {\n          StatusBarManager.setColor(\n            processColor(mergedProps.backgroundColor.value),\n            mergedProps.backgroundColor.animated\n          );\n        }\n        if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) {\n          StatusBarManager.setHidden(mergedProps.hidden.value);\n        }\n        if (!oldProps || oldProps.translucent !== mergedProps.translucent) {\n          StatusBarManager.setTranslucent(mergedProps.translucent);\n        }\n      }\n      // Update the current prop values.\n      StatusBar._currentValues = mergedProps;\n    });\n  };\n\n  render(): React.Node {\n    return null;\n  }\n}\n\nmodule.exports = StatusBar;\n"
  },
  {
    "path": "Libraries/Components/StatusBar/StatusBarIOS.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StatusBarIOS\n * @flow\n */\n'use strict';\n\nconst NativeEventEmitter = require('NativeEventEmitter');\n\nmodule.exports = new NativeEventEmitter('StatusBarManager');\n"
  },
  {
    "path": "Libraries/Components/StatusBar/StatusBarIOS.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StatusBarIOS\n * @flow\n */\n'use strict';\n\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst { StatusBarManager } = require('NativeModules');\n\n/**\n * Use `StatusBar` for mutating the status bar.\n */\nclass StatusBarIOS extends NativeEventEmitter {}\n\nmodule.exports = new StatusBarIOS(StatusBarManager);\n"
  },
  {
    "path": "Libraries/Components/StatusBar/StatusBarIOS.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StatusBarIOS\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/Subscribable.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Subscribable\n * @flow\n */\n'use strict';\n\nimport type EventEmitter from 'EventEmitter';\n\n/**\n * Subscribable provides a mixin for safely subscribing a component to an\n * eventEmitter\n *\n * This will be replaced with the observe interface that will be coming soon to\n * React Core\n */\n\nvar Subscribable = {};\n\nSubscribable.Mixin = {\n\n  componentWillMount: function() {\n    this._subscribableSubscriptions = [];\n  },\n\n  componentWillUnmount: function() {\n    this._subscribableSubscriptions.forEach(\n      (subscription) => subscription.remove()\n    );\n    this._subscribableSubscriptions = null;\n  },\n\n  /**\n   * Special form of calling `addListener` that *guarantees* that a\n   * subscription *must* be tied to a component instance, and therefore will\n   * be cleaned up when the component is unmounted. It is impossible to create\n   * the subscription and pass it in - this method must be the one to create\n   * the subscription and therefore can guarantee it is retained in a way that\n   * will be cleaned up.\n   *\n   * @param {EventEmitter} eventEmitter emitter to subscribe to.\n   * @param {string} eventType Type of event to listen to.\n   * @param {function} listener Function to invoke when event occurs.\n   * @param {object} context Object to use as listener context.\n   */\n  addListenerOn: function(\n    eventEmitter: EventEmitter,\n    eventType: string,\n    listener: Function,\n    context: Object\n  ) {\n    this._subscribableSubscriptions.push(\n      eventEmitter.addListener(eventType, listener, context)\n    );\n  }\n};\n\nmodule.exports = Subscribable;\n"
  },
  {
    "path": "Libraries/Components/Switch/Switch.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Switch\n * @flow\n */\n'use strict';\n\nvar ColorPropType = require('ColorPropType');\nvar NativeMethodsMixin = require('NativeMethodsMixin');\nvar Platform = require('Platform');\nvar React = require('React');\nconst PropTypes = require('prop-types');\nvar StyleSheet = require('StyleSheet');\nconst ViewPropTypes = require('ViewPropTypes');\n\nvar createReactClass = require('create-react-class');\nvar requireNativeComponent = require('requireNativeComponent');\n\ntype DefaultProps = {\n  value: boolean,\n  disabled: boolean,\n};\n\n/**\n * Renders a boolean input.\n *\n * This is a controlled component that requires an `onValueChange` callback that\n * updates the `value` prop in order for the component to reflect user actions.\n * If the `value` prop is not updated, the component will continue to render\n * the supplied `value` prop instead of the expected result of any user actions.\n *\n * @keyword checkbox\n * @keyword toggle\n */\nvar Switch = createReactClass({\n  displayName: 'Switch',\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * The value of the switch.  If true the switch will be turned on.\n     * Default value is false.\n     */\n    value: PropTypes.bool,\n    /**\n     * If true the user won't be able to toggle the switch.\n     * Default value is false.\n     */\n    disabled: PropTypes.bool,\n    /**\n     * Invoked with the new value when the value changes.\n     */\n    onValueChange: PropTypes.func,\n    /**\n     * Used to locate this view in end-to-end tests.\n     */\n    testID: PropTypes.string,\n\n    /**\n     * Border color on iOS and background color on Android when the switch is turned off.\n     */\n    tintColor: ColorPropType,\n    /**\n     * Background color when the switch is turned on.\n     */\n    onTintColor: ColorPropType,\n    /**\n     * Color of the foreground switch grip.\n     */\n    thumbTintColor: ColorPropType,\n  },\n\n  getDefaultProps: function(): DefaultProps {\n    return {\n      value: false,\n      disabled: false,\n    };\n  },\n\n  mixins: [NativeMethodsMixin],\n\n  _rctSwitch: {},\n  _onChange: function(event: Object) {\n    if (Platform.OS === 'android') {\n      this._rctSwitch.setNativeProps({on: this.props.value});\n    } else {\n      this._rctSwitch.setNativeProps({value: this.props.value});\n    }\n    //Change the props after the native props are set in case the props change removes the component\n    /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error when upgrading Flow's support for React. To see the\n     * error delete this comment and run Flow. */\n    this.props.onChange && this.props.onChange(event);\n    this.props.onValueChange && this.props.onValueChange(event.nativeEvent.value);\n  },\n\n  render: function() {\n    var props = {...this.props};\n    props.onStartShouldSetResponder = () => true;\n    props.onResponderTerminationRequest = () => false;\n    if (Platform.OS === 'android') {\n      props.enabled = !this.props.disabled;\n      props.on = this.props.value;\n      props.style = this.props.style;\n      props.trackTintColor = this.props.value ? this.props.onTintColor : this.props.tintColor;\n    } else if (Platform.OS === 'ios') {\n      props.style = [styles.rctSwitchIOS, this.props.style];\n    }\n    return (\n      <RCTSwitch\n        {...props}\n        /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n         * comment suppresses an error when upgrading Flow's support for React.\n         * To see the error delete this comment and run Flow. */\n        ref={(ref) => { this._rctSwitch = ref; }}\n        onChange={this._onChange}\n      />\n    );\n  },\n});\n\nvar styles = StyleSheet.create({\n  rctSwitchIOS: {\n    height: 31,\n    width: 51,\n  }\n});\n\nif (Platform.OS === 'android') {\n  var RCTSwitch = requireNativeComponent('AndroidSwitch', Switch, {\n    nativeOnly: {\n      onChange: true,\n      on: true,\n      enabled: true,\n      trackTintColor: true,\n    }\n  });\n} else {\n  var RCTSwitch = requireNativeComponent('RCTSwitch', Switch, {\n    nativeOnly: {\n      onChange: true\n    }\n  });\n}\n\nmodule.exports = Switch;\n"
  },
  {
    "path": "Libraries/Components/TabBarIOS/TabBarIOS.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TabBarIOS\n * @flow\n */\n\n'use strict';\n\nconst React = require('React');\nconst StyleSheet = require('StyleSheet');\nconst TabBarItemIOS = require('TabBarItemIOS');\nconst View = require('View');\n\nclass DummyTabBarIOS extends React.Component<$FlowFixMeProps> {\n  static Item = TabBarItemIOS;\n\n  render() {\n    return (\n      <View style={[this.props.style, styles.tabGroup]}>\n        {this.props.children}\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  tabGroup: {\n    flex: 1,\n  }\n});\n\nmodule.exports = DummyTabBarIOS;\n"
  },
  {
    "path": "Libraries/Components/TabBarIOS/TabBarIOS.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TabBarIOS\n * @flow\n */\n'use strict';\n\nvar ColorPropType = require('ColorPropType');\nvar React = require('React');\nconst PropTypes = require('prop-types');\nvar StyleSheet = require('StyleSheet');\nvar TabBarItemIOS = require('TabBarItemIOS');\nconst ViewPropTypes = require('ViewPropTypes');\n\nvar requireNativeComponent = require('requireNativeComponent');\n\nimport type {StyleObj} from 'StyleSheetTypes';\nimport type {ViewProps} from 'ViewPropTypes';\n\nclass TabBarIOS extends React.Component<ViewProps & {\n  style?: StyleObj,\n  unselectedTintColor?: string,\n  tintColor?: string,\n  unselectedItemTintColor?: string,\n  barTintColor?: string,\n  barStyle?: 'default' | 'black',\n  translucent?: boolean,\n  itemPositioning?: 'fill' | 'center' | 'auto',\n  children: React.Node,\n}> {\n  static Item = TabBarItemIOS;\n\n  static propTypes = {\n    ...ViewPropTypes,\n    style: ViewPropTypes.style,\n    /**\n     * Color of text on unselected tabs\n     */\n    unselectedTintColor: ColorPropType,\n    /**\n     * Color of the currently selected tab icon\n     */\n    tintColor: ColorPropType,\n    /**\n     * Color of unselected tab icons. Available since iOS 10.\n     */\n    unselectedItemTintColor: ColorPropType,\n    /**\n     * Background color of the tab bar\n     */\n    barTintColor: ColorPropType,\n    /**\n     * The style of the tab bar. Supported values are 'default', 'black'.\n     * Use 'black' instead of setting `barTintColor` to black. This produces\n     * a tab bar with the native iOS style with higher translucency.\n     */\n    barStyle: PropTypes.oneOf(['default', 'black']),\n    /**\n     * A Boolean value that indicates whether the tab bar is translucent\n     */\n    translucent: PropTypes.bool,\n    /**\n     * Specifies tab bar item positioning. Available values are:\n     * - fill - distributes items across the entire width of the tab bar\n     * - center - centers item in the available tab bar space\n     * - auto (default) - distributes items dynamically according to the\n     * user interface idiom. In a horizontally compact environment (e.g. iPhone 5)\n     * this value defaults to `fill`, in a horizontally regular one (e.g. iPad)\n     * it defaults to center.\n     */\n    itemPositioning: PropTypes.oneOf(['fill', 'center', 'auto']),\n  };\n\n  render() {\n    return (\n      <RCTTabBar\n        style={[styles.tabGroup, this.props.style]}\n        unselectedTintColor={this.props.unselectedTintColor}\n        unselectedItemTintColor={this.props.unselectedItemTintColor}\n        tintColor={this.props.tintColor}\n        barTintColor={this.props.barTintColor}\n        barStyle={this.props.barStyle}\n        itemPositioning={this.props.itemPositioning}\n        translucent={this.props.translucent !== false}>\n        {this.props.children}\n      </RCTTabBar>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  tabGroup: {\n    flex: 1,\n  }\n});\n\nvar RCTTabBar = requireNativeComponent('RCTTabBar', TabBarIOS);\n\nmodule.exports = TabBarIOS;\n"
  },
  {
    "path": "Libraries/Components/TabBarIOS/TabBarIOS.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TabBarIOS\n * @flow\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/TabBarIOS/TabBarItemIOS.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TabBarItemIOS\n */\n\n'use strict';\n\nvar React = require('React');\nvar View = require('View');\nvar StyleSheet = require('StyleSheet');\n\nclass DummyTab extends React.Component {\n  render() {\n    if (!this.props.selected) {\n      return <View />;\n    }\n    return (\n      <View style={[this.props.style, styles.tab]}>\n        {this.props.children}\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  tab: {\n    // TODO(5405356): Implement overflow: visible so position: absolute isn't useless\n    // position: 'absolute',\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0,\n    borderColor: 'red',\n    borderWidth: 1,\n  }\n});\n\nmodule.exports = DummyTab;\n"
  },
  {
    "path": "Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TabBarItemIOS\n * @noflow\n */\n'use strict';\n\nvar ColorPropType = require('ColorPropType');\nvar Image = require('Image');\nvar React = require('React');\nconst PropTypes = require('prop-types');\nvar StaticContainer = require('StaticContainer.react');\nvar StyleSheet = require('StyleSheet');\nvar View = require('View');\n\nconst ViewPropTypes = require('ViewPropTypes');\n\nvar requireNativeComponent = require('requireNativeComponent');\n\nclass TabBarItemIOS extends React.Component {\n  static propTypes = {\n    ...ViewPropTypes,\n    /**\n     * Little red bubble that sits at the top right of the icon.\n     */\n    badge: PropTypes.oneOfType([\n      PropTypes.string,\n      PropTypes.number,\n    ]),\n    /**\n     * Background color for the badge. Available since iOS 10.\n     */\n    badgeColor: ColorPropType,\n    /**\n     * Items comes with a few predefined system icons. Note that if you are\n     * using them, the title and selectedIcon will be overridden with the\n     * system ones.\n     */\n    systemIcon: PropTypes.oneOf([\n      'bookmarks',\n      'contacts',\n      'downloads',\n      'favorites',\n      'featured',\n      'history',\n      'more',\n      'most-recent',\n      'most-viewed',\n      'recents',\n      'search',\n      'top-rated',\n    ]),\n    /**\n     * A custom icon for the tab. It is ignored when a system icon is defined.\n     */\n    icon: Image.propTypes.source,\n    /**\n     * A custom icon when the tab is selected. It is ignored when a system\n     * icon is defined. If left empty, the icon will be tinted in blue.\n     */\n    selectedIcon: Image.propTypes.source,\n    /**\n     * Callback when this tab is being selected, you should change the state of your\n     * component to set selected={true}.\n     */\n    onPress: PropTypes.func,\n    /**\n     * If set to true it renders the image as original,\n     * it defaults to being displayed as a template\n     */\n    renderAsOriginal: PropTypes.bool,\n    /**\n     * It specifies whether the children are visible or not. If you see a\n     * blank content, you probably forgot to add a selected one.\n     */\n    selected: PropTypes.bool,\n    /**\n     * React style object.\n     */\n    style: ViewPropTypes.style,\n    /**\n     * Text that appears under the icon. It is ignored when a system icon\n     * is defined.\n     */\n    title: PropTypes.string,\n    /**\n     *(Apple TV only)* When set to true, this view will be focusable\n     * and navigable using the Apple TV remote.\n     *\n     * @platform ios\n     */\n    isTVSelectable: PropTypes.bool,\n  };\n\n  state = {\n    hasBeenSelected: false,\n  };\n\n  componentWillMount() {\n    if (this.props.selected) {\n      this.setState({hasBeenSelected: true});\n    }\n  }\n\n  componentWillReceiveProps(nextProps: { selected?: boolean }) {\n    if (this.state.hasBeenSelected || nextProps.selected) {\n      this.setState({hasBeenSelected: true});\n    }\n  }\n\n  render() {\n    var {style, children, ...props} = this.props;\n\n    // if the tab has already been shown once, always continue to show it so we\n    // preserve state between tab transitions\n    if (this.state.hasBeenSelected) {\n      var tabContents =\n        <StaticContainer shouldUpdate={this.props.selected}>\n          {children}\n        </StaticContainer>;\n    } else {\n      var tabContents = <View />;\n    }\n\n    return (\n      <RCTTabBarItem\n        {...props}\n        style={[styles.tab, style]}>\n        {tabContents}\n      </RCTTabBarItem>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  tab: {\n    position: 'absolute',\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0,\n  }\n});\n\nvar RCTTabBarItem = requireNativeComponent('RCTTabBarItem', TabBarItemIOS);\n\nmodule.exports = TabBarItemIOS;\n"
  },
  {
    "path": "Libraries/Components/TextInput/TextInput.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TextInput\n * @flow\n */\n'use strict';\n\nconst ColorPropType = require('ColorPropType');\nconst DocumentSelectionState = require('DocumentSelectionState');\nconst EventEmitter = require('EventEmitter');\nconst NativeMethodsMixin = require('NativeMethodsMixin');\nconst Platform = require('Platform');\nconst React = require('React');\nconst createReactClass = require('create-react-class');\nconst PropTypes = require('prop-types');\nconst NativeModules = require('NativeModules');\nconst ReactNative = require('ReactNative');\nconst StyleSheet = require('StyleSheet');\nconst Text = require('Text');\nconst TextInputState = require('TextInputState');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst TimerMixin = require('react-timer-mixin');\nconst TouchableWithoutFeedback = require('TouchableWithoutFeedback');\nconst UIManager = require('UIManager');\nconst ViewPropTypes = require('ViewPropTypes');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst emptyFunction = require('fbjs/lib/emptyFunction');\nconst invariant = require('fbjs/lib/invariant');\nconst requireNativeComponent = require('requireNativeComponent');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst warning = require('fbjs/lib/warning');\n\nconst onlyMultiline = {\n  onTextInput: true,\n  children: true,\n};\n\nif (Platform.OS === 'android') {\n  var AndroidTextInput = requireNativeComponent('AndroidTextInput', null);\n} else if (Platform.OS === 'ios' || Platform.OS === 'macos') {\n  var RCTMultilineTextInputView = requireNativeComponent('RCTMultilineTextInputView', null);\n  var RCTSinglelineTextInputView = requireNativeComponent('RCTTextField', null);\n  var RCTSecureTextField = requireNativeComponent('RCTSecureTextField', null);\n}\n\ntype Event = Object;\ntype Selection = {\n  start: number,\n  end?: number,\n};\n\nconst DataDetectorTypes = [\n  'phoneNumber',\n  'link',\n  'address',\n  'calendarEvent',\n  'none',\n  'all',\n];\n\n/**\n * A foundational component for inputting text into the app via a\n * keyboard. Props provide configurability for several features, such as\n * auto-correction, auto-capitalization, placeholder text, and different keyboard\n * types, such as a numeric keypad.\n *\n * The simplest use case is to plop down a `TextInput` and subscribe to the\n * `onChangeText` events to read the user input. There are also other events,\n * such as `onSubmitEditing` and `onFocus` that can be subscribed to. A simple\n * example:\n *\n * ```ReactNativeWebPlayer\n * import React, { Component } from 'react';\n * import { AppRegistry, TextInput } from 'react-native';\n *\n * export default class UselessTextInput extends Component {\n *   constructor(props) {\n *     super(props);\n *     this.state = { text: 'Useless Placeholder' };\n *   }\n *\n *   render() {\n *     return (\n *       <TextInput\n *         style={{height: 40, borderColor: 'gray', borderWidth: 1}}\n *         onChangeText={(text) => this.setState({text})}\n *         value={this.state.text}\n *       />\n *     );\n *   }\n * }\n *\n * // skip this line if using Create React Native App\n * AppRegistry.registerComponent('AwesomeProject', () => UselessTextInput);\n * ```\n *\n * Two methods exposed via the native element are .focus() and .blur() that\n * will focus or blur the TextInput programmatically.\n *\n * Note that some props are only available with `multiline={true/false}`.\n * Additionally, border styles that apply to only one side of the element\n * (e.g., `borderBottomColor`, `borderLeftWidth`, etc.) will not be applied if\n * `multiline=false`. To achieve the same effect, you can wrap your `TextInput`\n * in a `View`:\n *\n * ```ReactNativeWebPlayer\n * import React, { Component } from 'react';\n * import { AppRegistry, View, TextInput } from 'react-native';\n *\n * class UselessTextInput extends Component {\n *   render() {\n *     return (\n *       <TextInput\n *         {...this.props} // Inherit any props passed to it; e.g., multiline, numberOfLines below\n *         editable = {true}\n *         maxLength = {40}\n *       />\n *     );\n *   }\n * }\n *\n * export default class UselessTextInputMultiline extends Component {\n *   constructor(props) {\n *     super(props);\n *     this.state = {\n *       text: 'Useless Multiline Placeholder',\n *     };\n *   }\n *\n *   // If you type something in the text box that is a color, the background will change to that\n *   // color.\n *   render() {\n *     return (\n *      <View style={{\n *        backgroundColor: this.state.text,\n *        borderBottomColor: '#000000',\n *        borderBottomWidth: 1 }}\n *      >\n *        <UselessTextInput\n *          multiline = {true}\n *          numberOfLines = {4}\n *          onChangeText={(text) => this.setState({text})}\n *          value={this.state.text}\n *        />\n *      </View>\n *     );\n *   }\n * }\n *\n * // skip these lines if using Create React Native App\n * AppRegistry.registerComponent(\n *  'AwesomeProject',\n *  () => UselessTextInputMultiline\n * );\n * ```\n *\n * `TextInput` has by default a border at the bottom of its view. This border\n * has its padding set by the background image provided by the system, and it\n * cannot be changed. Solutions to avoid this is to either not set height\n * explicitly, case in which the system will take care of displaying the border\n * in the correct position, or to not display the border by setting\n * `underlineColorAndroid` to transparent.\n *\n * Note that on Android performing text selection in input can change\n * app's activity `windowSoftInputMode` param to `adjustResize`.\n * This may cause issues with components that have position: 'absolute'\n * while keyboard is active. To avoid this behavior either specify `windowSoftInputMode`\n * in AndroidManifest.xml ( https://developer.android.com/guide/topics/manifest/activity-element.html )\n * or control this param programmatically with native code.\n *\n */\n\nconst TextInput = createReactClass({\n  displayName: 'TextInput',\n  statics: {\n    /* TODO(brentvatne) docs are needed for this */\n    State: TextInputState,\n  },\n\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * If false, disables auto-correct. The default value is true.\n     */\n    // autoCorrect: PropTypes.bool,\n    /**\n     * If `false`, disables spell-check style (i.e. red underlines).\n     * The default value is inherited from `autoCorrect`.\n     * @platform ios\n     */\n    // spellCheck: PropTypes.bool,\n    /**\n     * If `true`, focuses the input on `componentDidMount`.\n     * The default value is `false`.\n     */\n    autoFocus: PropTypes.bool,\n    /**\n     * Specifies whether fonts should scale to respect Text Size accessibility settings. The\n     * default is `true`.\n     */\n    allowFontScaling: PropTypes.bool,\n    /**\n     * If `false`, text is not editable. The default value is `true`.\n     */\n    bezeled: PropTypes.bool,\n    /**\n     * If false, text is not editable. The default value is true.\n     */\n    editable: PropTypes.bool,\n    /**\n     * Determines the color of the keyboard.\n     * @platform ios\n     */\n    keyboardAppearance: PropTypes.oneOf(['default', 'light', 'dark']),\n    /**\n     * Determines how the return key should look. On Android you can also use\n     * `returnKeyLabel`.\n     *\n     * *Cross platform*\n     *\n     * The following values work across platforms:\n     *\n     * - `done`\n     * - `go`\n     * - `next`\n     * - `search`\n     * - `send`\n     *\n     * *Android Only*\n     *\n     * The following values work on Android only:\n     *\n     * - `none`\n     * - `previous`\n     *\n     * *iOS Only*\n     *\n     * The following values work on iOS only:\n     *\n     * - `default`\n     * - `emergency-call`\n     * - `google`\n     * - `join`\n     * - `route`\n     * - `yahoo`\n     */\n    returnKeyType: PropTypes.oneOf([\n      // Cross-platform\n      'done',\n      'go',\n      'next',\n      'search',\n      'send',\n      // Android-only\n      'none',\n      'previous',\n      // iOS-only\n      'default',\n      'emergency-call',\n      'google',\n      'join',\n      'route',\n      'yahoo',\n    ]),\n    /**\n     * Determines the color of the keyboard.\n     * @platform macos\n     */\n    focusRingType: PropTypes.oneOf(['default', 'none', 'exterior']),\n    /**\n     * Limits the maximum number of characters that can be entered. Use this\n     * instead of implementing the logic in JS to avoid flicker.\n     */\n    maxLength: PropTypes.number,\n    /**\n     * Sets the number of lines for a `TextInput`. Use it with multiline set to\n     * `true` to be able to fill the lines.\n     * @platform android\n     */\n    numberOfLines: PropTypes.number,\n    /**\n     * When `false`, if there is a small amount of space available around a text input\n     * (e.g. landscape orientation on a phone), the OS may choose to have the user edit\n     * the text inside of a full screen text input mode. When `true`, this feature is\n     * disabled and users will always edit the text directly inside of the text input.\n     * Defaults to `false`.\n     * @platform android\n     */\n    disableFullscreenUI: PropTypes.bool,\n    /**\n     * If `true`, the keyboard disables the return key when there is no text and\n     * automatically enables it when there is text. The default value is `false`.\n     * @platform ios\n     */\n    enablesReturnKeyAutomatically: PropTypes.bool,\n    /**\n     * If `true`, the text input can be multiple lines.\n     * The default value is `false`.\n     */\n    multiline: PropTypes.bool,\n    /**\n     * Set text break strategy on Android API Level 23+, possible values are `simple`, `highQuality`, `balanced`\n     * The default value is `simple`.\n     * @platform android\n     */\n    textBreakStrategy: PropTypes.oneOf(['simple', 'highQuality', 'balanced']),\n    /**\n     * Callback that is called when the text input is blurred.\n     */\n    onBlur: PropTypes.func,\n    /**\n     * Callback that is called when the text input is focused.\n     */\n    onFocus: PropTypes.func,\n    /**\n     * Callback that is called when the text input's text changes.\n     */\n    onChange: PropTypes.func,\n    /**\n     * Callback that is called when the text input's text changes.\n     * Changed text is passed as an argument to the callback handler.\n     */\n    onChangeText: PropTypes.func,\n    /**\n     * Callback that is called when the text input's content size changes.\n     * This will be called with\n     * `{ nativeEvent: { contentSize: { width, height } } }`.\n     *\n     * Only called for multiline text inputs.\n     */\n    onContentSizeChange: PropTypes.func,\n    /**\n     * Callback that is called when text input ends.\n     */\n    onEndEditing: PropTypes.func,\n    /**\n     * Callback that is called when the text input selection is changed.\n     * This will be called with\n     * `{ nativeEvent: { selection: { start, end } } }`.\n     */\n    onSelectionChange: PropTypes.func,\n    /**\n     * Callback that is called when the text input's submit button is pressed.\n     * Invalid if `multiline={true}` is specified.\n     */\n    onSubmitEditing: PropTypes.func,\n    /**\n     * Callback that is called when a key is pressed.\n     * This will be called with `{ nativeEvent: { key: keyValue } }`\n     * where `keyValue` is `'Enter'` or `'Backspace'` for respective keys and\n     * the typed-in character otherwise including `' '` for space.\n     * Fires before `onChange` callbacks.\n     */\n    onKeyPress: PropTypes.func,\n    /**\n     * Invoked on mount and layout changes with `{x, y, width, height}`.\n     */\n    onLayout: PropTypes.func,\n    /**\n     * Invoked on content scroll with `{ nativeEvent: { contentOffset: { x, y } } }`.\n     * May also contain other properties from ScrollEvent but on Android contentSize\n     * is not provided for performance reasons.\n     */\n    onScroll: PropTypes.func,\n    /**\n     * The string that will be rendered before text input has been entered.\n     */\n    placeholder: PropTypes.string,\n    /**\n     * The text color of the placeholder string.\n     */\n    placeholderTextColor: ColorPropType,\n    /**\n     * If `true`, the text input obscures the text entered so that sensitive text\n     * like passwords stay secure. The default value is `false`. Does not work with 'multiline={true}'.\n     */\n    password: PropTypes.bool,\n    /**\n    * The highlight and cursor color of the text input.\n    */\n    selectionColor: ColorPropType,\n    /**\n     * An instance of `DocumentSelectionState`, this is some state that is responsible for\n     * maintaining selection information for a document.\n     *\n     * Some functionality that can be performed with this instance is:\n     *\n     * - `blur()`\n     * - `focus()`\n     * - `update()`\n     *\n     * > You can reference `DocumentSelectionState` in\n     * > [`vendor/document/selection/DocumentSelectionState.js`](https://github.com/facebook/react-native/blob/master/Libraries/vendor/document/selection/DocumentSelectionState.js)\n     *\n     * @platform ios\n     */\n    selectionState: PropTypes.instanceOf(DocumentSelectionState),\n    /**\n     * The start and end of the text input's selection. Set start and end to\n     * the same value to position the cursor.\n     */\n    selection: PropTypes.shape({\n      start: PropTypes.number.isRequired,\n      end: PropTypes.number,\n    }),\n    /**\n     * The value to show for the text input. `TextInput` is a controlled\n     * component, which means the native value will be forced to match this\n     * value prop if provided. For most uses, this works great, but in some\n     * cases this may cause flickering - one common cause is preventing edits\n     * by keeping value the same. In addition to simply setting the same value,\n     * either set `editable={false}`, or set/update `maxLength` to prevent\n     * unwanted edits without flicker.\n     */\n    value: PropTypes.string,\n    /**\n     * Provides an initial value that will change when the user starts typing.\n     * Useful for simple use-cases where you do not want to deal with listening\n     * to events and updating the value prop to keep the controlled state in sync.\n     */\n    defaultValue: PropTypes.string,\n    /**\n     * When the clear button should appear on the right side of the text view.\n     * @platform ios\n     */\n    clearButtonMode: PropTypes.oneOf([\n      'never',\n      'while-editing',\n      'unless-editing',\n      'always',\n    ]),\n    /**\n     * If `true`, clears the text field automatically when editing begins.\n     * @platform ios\n     */\n    clearTextOnFocus: PropTypes.bool,\n    /**\n     * If `true`, all text will automatically be selected on focus.\n     */\n    selectTextOnFocus: PropTypes.bool,\n    /**\n     * If `true`, the text field will blur when submitted.\n     * The default value is true for single-line fields and false for\n     * multiline fields. Note that for multiline fields, setting `blurOnSubmit`\n     * to `true` means that pressing return will blur the field and trigger the\n     * `onSubmitEditing` event instead of inserting a newline into the field.\n     */\n    blurOnSubmit: PropTypes.bool,\n    /**\n     * Note that not all Text styles are supported, an incomplete list of what is not supported includes:\n     *\n     * - `borderLeftWidth`\n     * - `borderTopWidth`\n     * - `borderRightWidth`\n     * - `borderBottomWidth`\n     * - `borderTopLeftRadius`\n     * - `borderTopRightRadius`\n     * - `borderBottomRightRadius`\n     * - `borderBottomLeftRadius`\n     *\n     * see [Issue#7070](https://github.com/facebook/react-native/issues/7070)\n     * for more detail.\n     *\n     * [Styles](docs/style.html)\n     */\n    style: Text.propTypes.style,\n    /**\n     * The color of the `TextInput` underline.\n     * @platform android\n     */\n    underlineColorAndroid: ColorPropType,\n\n    /**\n     * If defined, the provided image resource will be rendered on the left.\n     * The image resource must be inside `/android/app/src/main/res/drawable` and referenced\n     * like\n     * ```\n     * <TextInput\n     *  inlineImageLeft='search_icon'\n     * />\n     * ```\n     * @platform android\n     */\n    inlineImageLeft: PropTypes.string,\n\n    /**\n     * Padding between the inline image, if any, and the text input itself.\n     * @platform android\n     */\n    inlineImagePadding: PropTypes.number,\n\n    /**\n     * Determines the types of data converted to clickable URLs in the text input.\n     * Only valid if `multiline={true}` and `editable={false}`.\n     * By default no data types are detected.\n     *\n     * You can provide one type or an array of many types.\n     *\n     * Possible values for `dataDetectorTypes` are:\n     *\n     * - `'phoneNumber'`\n     * - `'link'`\n     * - `'address'`\n     * - `'calendarEvent'`\n     * - `'none'`\n     * - `'all'`\n     *\n     * @platform ios\n     */\n    // dataDetectorTypes: PropTypes.oneOfType([\n    //   PropTypes.oneOf(DataDetectorTypes),\n    //   PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes)),\n    // ]),\n\n    /**\n     * If `true`, caret is hidden. The default value is `false`.\n     */\n    caretHidden: PropTypes.bool,\n  },\n  getDefaultProps(): Object {\n    return {\n      allowFontScaling: true,\n    };\n  },\n  /**\n   * `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We\n   * make `this` look like an actual native component class.\n   */\n  mixins: [NativeMethodsMixin, TimerMixin],\n\n  /**\n   * Returns `true` if the input is currently focused; `false` otherwise.\n   */\n  isFocused: function(): boolean {\n    return (\n      TextInputState.currentlyFocusedField() ===\n      ReactNative.findNodeHandle(this._inputRef)\n    );\n  },\n\n  contextTypes: {\n    onFocusRequested: PropTypes.func,\n    focusEmitter: PropTypes.instanceOf(EventEmitter),\n  },\n\n  _inputRef: (undefined: any),\n  _focusSubscription: (undefined: ?Function),\n  _lastNativeText: (undefined: ?string),\n  _lastNativeSelection: (undefined: ?Selection),\n\n  componentDidMount: function() {\n    this._lastNativeText = this.props.value;\n    if (!this.context.focusEmitter) {\n      if (this.props.autoFocus) {\n        this.requestAnimationFrame(this.focus);\n      }\n      return;\n    }\n    this._focusSubscription = this.context.focusEmitter.addListener(\n      'focus',\n      el => {\n        if (this === el) {\n          this.requestAnimationFrame(this.focus);\n        } else if (this.isFocused()) {\n          this.blur();\n        }\n      }\n    );\n    if (this.props.autoFocus) {\n      this.context.onFocusRequested(this);\n    }\n  },\n\n  componentWillUnmount: function() {\n    this._focusSubscription && this._focusSubscription.remove();\n    if (this.isFocused()) {\n      this.blur();\n    }\n  },\n\n  getChildContext: function(): Object {\n    return { isInAParentText: true };\n  },\n\n  childContextTypes: {\n    isInAParentText: PropTypes.bool,\n  },\n\n  /**\n   * Removes all text from the `TextInput`.\n   */\n  clear: function() {\n    this.setNativeProps({ text: '' });\n  },\n\n  render: function() {\n    if (Platform.OS === 'ios') {\n      return this._renderIOS();\n    } else if (Platform.OS === 'macos') {\n      return this._renderIOS();\n    } else if (Platform.OS === 'android') {\n      return this._renderAndroid();\n    }\n  },\n\n  _getText: function(): ?string {\n    return typeof this.props.value === 'string'\n      ? this.props.value\n      : typeof this.props.defaultValue === 'string'\n          ? this.props.defaultValue\n          : '';\n  },\n\n  _setNativeRef: function(ref: any) {\n    this._inputRef = ref;\n  },\n\n  _renderIOS: function() {\n    var textContainer;\n\n    var props = Object.assign({}, this.props);\n    props.style = [this.props.style];\n\n    if (props.selection && props.selection.end == null) {\n      props.selection = {\n        start: props.selection.start,\n        end: props.selection.start,\n      };\n    }\n\n    if (!props.multiline) {\n      if (__DEV__) {\n        for (var propKey in onlyMultiline) {\n          if (props[propKey]) {\n            const error = new Error(\n              'TextInput prop `' +\n                propKey +\n                '` is only supported with multiline.'\n            );\n            warning(false, '%s', error.stack);\n          }\n        }\n      }\n      var TextField = props.password ? RCTSecureTextField : RCTSinglelineTextInputView;\n      textContainer = (\n        <TextField\n          ref={this._setNativeRef}\n          {...props}\n          style={[{ minWidth: 100, height: NativeModules.TextFieldManager.ComponentHeight }, props.style]}\n          onFocus={this._onFocus}\n          onBlur={this._onBlur}\n          onChange={this._onChange}\n          onSelectionChange={this._onSelectionChange}\n          onSelectionChangeShouldSetResponder={emptyFunction.thatReturnsTrue}\n          text={this._getText()}\n        />\n      );\n    } else {\n      var children = props.children;\n      var childCount = 0;\n      React.Children.forEach(children, () => ++childCount);\n      invariant(\n        !(props.value && childCount),\n        'Cannot specify both value and children.'\n      );\n      if (childCount >= 1) {\n        children = <Text style={props.style} allowFontScaling={props.allowFontScaling}>{children}</Text>;\n      }\n      if (props.inputView) {\n        children = [children, props.inputView];\n      }\n      props.style.unshift(styles.multilineInput);\n      textContainer = (\n        <RCTMultilineTextInputView\n          ref={this._setNativeRef}\n          {...props}\n          children={children}\n          onFocus={this._onFocus}\n          onBlur={this._onBlur}\n          onChange={this._onChange}\n          onContentSizeChange={this.props.onContentSizeChange}\n          onSelectionChange={this._onSelectionChange}\n          onTextInput={this._onTextInput}\n          onSelectionChangeShouldSetResponder={emptyFunction.thatReturnsTrue}\n          text={this._getText()}\n          dataDetectorTypes={this.props.dataDetectorTypes}\n          onScroll={this._onScroll}\n        />\n      );\n    }\n\n    return (\n      <TouchableWithoutFeedback\n        onLayout={props.onLayout}\n        onPress={this._onPress}\n        rejectResponderTermination={true}\n        accessible={props.accessible}\n        accessibilityLabel={props.accessibilityLabel}\n        accessibilityTraits={props.accessibilityTraits}\n        nativeID={this.props.nativeID}\n        testID={props.testID}>\n        {textContainer}\n      </TouchableWithoutFeedback>\n    );\n  },\n\n  _renderAndroid: function() {\n    const props = Object.assign({}, this.props);\n    props.style = [this.props.style];\n    props.autoCapitalize =\n      UIManager.AndroidTextInput.Constants.AutoCapitalizationType[\n        props.autoCapitalize || 'sentences'\n      ];\n    /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error when upgrading Flow's support for React. To see the\n     * error delete this comment and run Flow. */\n    var children = this.props.children;\n    var childCount = 0;\n    React.Children.forEach(children, () => ++childCount);\n    invariant(\n      !(this.props.value && childCount),\n      'Cannot specify both value and children.'\n    );\n    if (childCount > 1) {\n      children = <Text>{children}</Text>;\n    }\n\n    if (props.selection && props.selection.end == null) {\n      props.selection = {\n        start: props.selection.start,\n        end: props.selection.start,\n      };\n    }\n\n    const textContainer = (\n      <AndroidTextInput\n        ref={this._setNativeRef}\n        {...props}\n        mostRecentEventCount={0}\n        onFocus={this._onFocus}\n        onBlur={this._onBlur}\n        onChange={this._onChange}\n        onSelectionChange={this._onSelectionChange}\n        onTextInput={this._onTextInput}\n        text={this._getText()}\n        children={children}\n        disableFullscreenUI={this.props.disableFullscreenUI}\n        textBreakStrategy={this.props.textBreakStrategy}\n        onScroll={this._onScroll}\n      />\n    );\n\n    return (\n      <TouchableWithoutFeedback\n        onLayout={this._onLayout}\n        onPress={this._onPress}\n        accessible={this.props.accessible}\n        accessibilityLabel={this.props.accessibilityLabel}\n        accessibilityComponentType={this.props.accessibilityComponentType}\n        nativeID={this.props.nativeID}\n        testID={this.props.testID}>\n        {textContainer}\n      </TouchableWithoutFeedback>\n    );\n  },\n\n  _onFocus: function(event: Event) {\n    if (this.props.onFocus) {\n      this.props.onFocus(event);\n    }\n  },\n\n  _onPress: function(event: Event) {\n    if (this.props.editable || this.props.editable === undefined) {\n      this.focus();\n    }\n  },\n\n  _onChange: function(event: Event) {\n    // Make sure to fire the mostRecentEventCount first so it is already set on\n    // native when the text value is set.\n    if (this._inputRef) {\n      this._inputRef.setNativeProps({\n        mostRecentEventCount: event.nativeEvent.eventCount,\n      });\n    }\n\n    var text = event.nativeEvent.text;\n    this.props.onChange && this.props.onChange(event);\n    this.props.onChangeText && this.props.onChangeText(text);\n\n    if (!this._inputRef) {\n      // calling `this.props.onChange` or `this.props.onChangeText`\n      // may clean up the input itself. Exits here.\n      return;\n    }\n\n    this._lastNativeText = text;\n    this.forceUpdate();\n  },\n\n  _onSelectionChange: function(event: Event) {\n    this.props.onSelectionChange && this.props.onSelectionChange(event);\n\n    if (!this._inputRef) {\n      // calling `this.props.onSelectionChange`\n      // may clean up the input itself. Exits here.\n      return;\n    }\n\n    this._lastNativeSelection = event.nativeEvent.selection;\n\n    if (this.props.selection || this.props.selectionState) {\n      this.forceUpdate();\n    }\n  },\n\n  componentDidUpdate: function() {\n    // This is necessary in case native updates the text and JS decides\n    // that the update should be ignored and we should stick with the value\n    // that we have in JS.\n    const nativeProps = {};\n\n    if (\n      this._lastNativeText !== this.props.value &&\n      typeof this.props.value === 'string'\n    ) {\n      nativeProps.text = this.props.value;\n    }\n\n    // Selection is also a controlled prop, if the native value doesn't match\n    // JS, update to the JS value.\n    const { selection } = this.props;\n    if (\n      this._lastNativeSelection &&\n      selection &&\n      (this._lastNativeSelection.start !== selection.start ||\n        this._lastNativeSelection.end !== selection.end)\n    ) {\n      nativeProps.selection = this.props.selection;\n    }\n\n    if (Object.keys(nativeProps).length > 0 && this._inputRef) {\n      this._inputRef.setNativeProps(nativeProps);\n    }\n\n    if (this.props.selectionState && selection) {\n      this.props.selectionState.update(selection.start, selection.end);\n    }\n  },\n\n  _onBlur: function(event: Event) {\n    this.blur();\n    if (this.props.onBlur) {\n      this.props.onBlur(event);\n    }\n  },\n\n  _onTextInput: function(event: Event) {\n    this.props.onTextInput && this.props.onTextInput(event);\n  },\n\n  _onScroll: function(event: Event) {\n    this.props.onScroll && this.props.onScroll(event);\n  },\n});\n\nvar styles = StyleSheet.create({\n  multilineInput: {\n    // This default top inset makes RCTMultilineTextInputView seem as close as possible\n    // to single-line RCTSinglelineTextInputView defaults, using the system defaults\n    // of font size 17 and a height of 31 points.\n    paddingTop: 5,\n  },\n});\n\nmodule.exports = TextInput;\n"
  },
  {
    "path": "Libraries/Components/TextInput/TextInputState.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TextInputState\n * @flow\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 */\n'use strict';\n\nvar Platform = require('Platform');\nvar UIManager = require('UIManager');\n\nvar TextInputState = {\n   /**\n   * Internal state\n   */\n  _currentlyFocusedID: (null: ?number),\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: function(): ?number {\n    return this._currentlyFocusedID;\n  },\n\n  /**\n   * @param {number} 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: function(textFieldID: ?number) {\n    if (this._currentlyFocusedID !== textFieldID && textFieldID !== null) {\n      this._currentlyFocusedID = textFieldID;\n      if (Platform.OS === 'ios' || Platform.OS === 'macos') {\n        UIManager.focus(textFieldID);\n      } else if (Platform.OS === 'android') {\n        UIManager.dispatchViewManagerCommand(\n          textFieldID,\n          UIManager.AndroidTextInput.Commands.focusTextInput,\n          null\n        );\n      }\n    }\n  },\n\n  /**\n   * @param {number} textFieldID id of the text field to unfocus\n   * Unfocuses the specified text field\n   * noop if it wasn't focused\n   */\n  blurTextInput: function(textFieldID: ?number) {\n    if (this._currentlyFocusedID === textFieldID && textFieldID !== null) {\n      this._currentlyFocusedID = null;\n      if (Platform.OS === 'ios') {\n        UIManager.blur(textFieldID);\n      } else if (Platform.OS === 'android') {\n        UIManager.dispatchViewManagerCommand(\n          textFieldID,\n          UIManager.AndroidTextInput.Commands.blurTextInput,\n          null\n        );\n      }\n    }\n  }\n};\n\nmodule.exports = TextInputState;\n"
  },
  {
    "path": "Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TimePickerAndroid\n * @flow\n */\n'use strict';\n\nconst TimePickerModule = require('NativeModules').TimePickerAndroid;\n\n/**\n * Opens the standard Android time picker dialog.\n *\n * ### Example\n *\n * ```\n * try {\n *   const {action, hour, minute} = await TimePickerAndroid.open({\n *     hour: 14,\n *     minute: 0,\n *     is24Hour: false, // Will display '2 PM'\n *   });\n *   if (action !== TimePickerAndroid.dismissedAction) {\n *     // Selected hour (0-23), minute (0-59)\n *   }\n * } catch ({code, message}) {\n *   console.warn('Cannot open time picker', message);\n * }\n * ```\n */\nclass TimePickerAndroid {\n\n  /**\n   * Opens the standard Android time picker dialog.\n   *\n   * The available keys for the `options` object are:\n   *   * `hour` (0-23) - the hour to show, defaults to the current time\n   *   * `minute` (0-59) - the minute to show, defaults to the current time\n   *   * `is24Hour` (boolean) - If `true`, the picker uses the 24-hour format. If `false`,\n   *     the picker shows an AM/PM chooser. If undefined, the default for the current locale\n   *     is used.\n   *   * `mode` (`enum('clock', 'spinner', 'default')`) - set the time picker mode\n   *     - 'clock': Show a time picker in clock mode.\n   *     - 'spinner': Show a time picker in spinner mode.\n   *     - 'default': Show a default time picker based on Android versions.\n   *\n   * Returns a Promise which will be invoked an object containing `action`, `hour` (0-23),\n   * `minute` (0-59) if the user picked a time. If the user dismissed the dialog, the Promise will\n   * still be resolved with action being `TimePickerAndroid.dismissedAction` and all the other keys\n   * being undefined. **Always** check whether the `action` before reading the values.\n   */\n  static async open(options: Object): Promise<Object> {\n    return TimePickerModule.open(options);\n  }\n\n  /**\n   * A time has been selected.\n   */\n  static get timeSetAction() { return 'timeSetAction'; }\n  /**\n   * The dialog has been dismissed.\n   */\n  static get dismissedAction() { return 'dismissedAction'; }\n}\n\nmodule.exports = TimePickerAndroid;\n"
  },
  {
    "path": "Libraries/Components/TimePickerAndroid/TimePickerAndroid.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TimePickerAndroid\n * @flow\n */\n'use strict';\n\nconst TimePickerAndroid = {\n  async open(options: Object): Promise<Object> {\n    return Promise.reject({\n      message: 'TimePickerAndroid is not supported on this platform.'\n    });\n  },\n};\n\nmodule.exports = TimePickerAndroid;\n"
  },
  {
    "path": "Libraries/Components/TimePickerAndroid/TimePickerAndroid.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TimePickerAndroid\n * @flow\n */\n'use strict';\n\nvar warning = require('fbjs/lib/warning');\n\nconst TimePickerAndroid = {\n  async open(options: Object): Promise<Object> {\n    return Promise.reject({\n      message: 'TimePickerAndroid is not supported on this platform.'\n    });\n  },\n};\n\nmodule.exports = TimePickerAndroid;\n"
  },
  {
    "path": "Libraries/Components/ToastAndroid/ToastAndroid.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ToastAndroid\n * @flow\n */\n\n'use strict';\n\nvar RCTToastAndroid = require('NativeModules').ToastAndroid;\n\n/**\n * This exposes the native ToastAndroid module as a JS module. This has a function 'show'\n * which takes the following parameters:\n *\n * 1. String message: A string with the text to toast\n * 2. int duration: The duration of the toast. May be ToastAndroid.SHORT or ToastAndroid.LONG\n *\n * There is also a function `showWithGravity` to specify the layout gravity. May be\n * ToastAndroid.TOP, ToastAndroid.BOTTOM, ToastAndroid.CENTER.\n *\n * The 'showWithGravityAndOffset' function adds on the ability to specify offset\n * These offset values will translate to pixels.\n *\n * Basic usage:\n * ```javascript\n * ToastAndroid.show('A pikachu appeared nearby !', ToastAndroid.SHORT);\n * ToastAndroid.showWithGravity('All Your Base Are Belong To Us', ToastAndroid.SHORT, ToastAndroid.CENTER);\n * ToastAndroid.showWithGravityAndOffset('A wild toast appeared!', ToastAndroid.LONG, ToastAndroid.BOTTOM, 25, 50);\n * ```\n */\n\nvar ToastAndroid = {\n\n  // Toast duration constants\n  SHORT: RCTToastAndroid.SHORT,\n  LONG: RCTToastAndroid.LONG,\n\n  // Toast gravity constants\n  TOP: RCTToastAndroid.TOP,\n  BOTTOM: RCTToastAndroid.BOTTOM,\n  CENTER: RCTToastAndroid.CENTER,\n\n  show: function (\n    message: string,\n    duration: number\n  ): void {\n    RCTToastAndroid.show(message, duration);\n  },\n\n  showWithGravity: function (\n    message: string,\n    duration: number,\n    gravity: number,\n  ): void {\n    RCTToastAndroid.showWithGravity(message, duration, gravity);\n  },\n\n  showWithGravityAndOffset: function (\n    message: string,\n    duration: number,\n    gravity: number,\n    xOffset: number,\n    yOffset: number,\n  ): void {\n    RCTToastAndroid.showWithGravityAndOffset(message, duration, gravity, xOffset, yOffset);\n  },\n};\n\nmodule.exports = ToastAndroid;\n"
  },
  {
    "path": "Libraries/Components/ToastAndroid/ToastAndroid.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ToastAndroid\n * @noflow\n */\n'use strict';\n\nvar warning = require('fbjs/lib/warning');\n\nvar ToastAndroid = {\n\n  show: function (\n    message: string,\n    duration: number\n  ): void {\n    warning(false, 'ToastAndroid is not supported on this platform.');\n  },\n\n};\n\nmodule.exports = ToastAndroid;\n"
  },
  {
    "path": "Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ToolbarAndroid\n */\n\n'use strict';\n\nvar Image = require('Image');\nvar NativeMethodsMixin = require('NativeMethodsMixin');\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar ReactNativeViewAttributes = require('ReactNativeViewAttributes');\nvar UIManager = require('UIManager');\nvar ViewPropTypes = require('ViewPropTypes');\nvar ColorPropType = require('ColorPropType');\n\nvar createReactClass = require('create-react-class');\nvar requireNativeComponent = require('requireNativeComponent');\nvar resolveAssetSource = require('resolveAssetSource');\n\nvar optionalImageSource = PropTypes.oneOfType([\n  Image.propTypes.source,\n  // Image.propTypes.source is required but we want it to be optional, so we OR\n  // it with a nullable propType.\n  PropTypes.oneOf([]),\n]);\n\n/**\n * React component that wraps the Android-only [`Toolbar` widget][0]. A Toolbar can display a logo,\n * navigation icon (e.g. hamburger menu), a title & subtitle and a list of actions. The title and\n * subtitle are expanded so the logo and navigation icons are displayed on the left, title and\n * subtitle in the middle and the actions on the right.\n *\n * If the toolbar has an only child, it will be displayed between the title and actions.\n *\n * Although the Toolbar supports remote images for the logo, navigation and action icons, this\n * should only be used in DEV mode where `require('./some_icon.png')` translates into a packager\n * URL. In release mode you should always use a drawable resource for these icons. Using\n * `require('./some_icon.png')` will do this automatically for you, so as long as you don't\n * explicitly use e.g. `{uri: 'http://...'}`, you will be good.\n *\n * Example:\n *\n * ```\n * render: function() {\n *   return (\n *     <ToolbarAndroid\n *       logo={require('./app_logo.png')}\n *       title=\"AwesomeApp\"\n *       actions={[{title: 'Settings', icon: require('./icon_settings.png'), show: 'always'}]}\n *       onActionSelected={this.onActionSelected} />\n *   )\n * },\n * onActionSelected: function(position) {\n *   if (position === 0) { // index of 'Settings'\n *     showSettings();\n *   }\n * }\n * ```\n *\n * [0]: https://developer.android.com/reference/android/support/v7/widget/Toolbar.html\n */\nvar ToolbarAndroid = createReactClass({\n  displayName: 'ToolbarAndroid',\n  mixins: [NativeMethodsMixin],\n\n  propTypes: {\n    ...ViewPropTypes,\n    /**\n     * Sets possible actions on the toolbar as part of the action menu. These are displayed as icons\n     * or text on the right side of the widget. If they don't fit they are placed in an 'overflow'\n     * menu.\n     *\n     * This property takes an array of objects, where each object has the following keys:\n     *\n     * * `title`: **required**, the title of this action\n     * * `icon`: the icon for this action, e.g. `require('./some_icon.png')`\n     * * `show`: when to show this action as an icon or hide it in the overflow menu: `always`,\n     * `ifRoom` or `never`\n     * * `showWithText`: boolean, whether to show text alongside the icon or not\n     */\n    actions: PropTypes.arrayOf(PropTypes.shape({\n      title: PropTypes.string.isRequired,\n      icon: optionalImageSource,\n      show: PropTypes.oneOf(['always', 'ifRoom', 'never']),\n      showWithText: PropTypes.bool\n    })),\n    /**\n     * Sets the toolbar logo.\n     */\n    logo: optionalImageSource,\n    /**\n     * Sets the navigation icon.\n     */\n    navIcon: optionalImageSource,\n    /**\n     * Callback that is called when an action is selected. The only argument that is passed to the\n     * callback is the position of the action in the actions array.\n     */\n    onActionSelected: PropTypes.func,\n    /**\n     * Callback called when the icon is selected.\n     */\n    onIconClicked: PropTypes.func,\n    /**\n     * Sets the overflow icon.\n     */\n    overflowIcon: optionalImageSource,\n    /**\n     * Sets the toolbar subtitle.\n     */\n    subtitle: PropTypes.string,\n    /**\n     * Sets the toolbar subtitle color.\n     */\n    subtitleColor: ColorPropType,\n    /**\n     * Sets the toolbar title.\n     */\n    title: PropTypes.string,\n    /**\n     * Sets the toolbar title color.\n     */\n    titleColor: ColorPropType,\n    /**\n     * Sets the content inset for the toolbar starting edge.\n     *\n     * The content inset affects the valid area for Toolbar content other than\n     * the navigation button and menu. Insets define the minimum margin for\n     * these components and can be used to effectively align Toolbar content\n     * along well-known gridlines.\n     */\n    contentInsetStart: PropTypes.number,\n    /**\n     * Sets the content inset for the toolbar ending edge.\n     *\n     * The content inset affects the valid area for Toolbar content other than\n     * the navigation button and menu. Insets define the minimum margin for\n     * these components and can be used to effectively align Toolbar content\n     * along well-known gridlines.\n     */\n    contentInsetEnd: PropTypes.number,\n    /**\n     * Used to set the toolbar direction to RTL.\n     * In addition to this property you need to add\n     *\n     *   android:supportsRtl=\"true\"\n     *\n     * to your application AndroidManifest.xml and then call\n     * `setLayoutDirection(LayoutDirection.RTL)` in your MainActivity\n     * `onCreate` method.\n     */\n    rtl: PropTypes.bool,\n    /**\n     * Used to locate this view in end-to-end tests.\n     */\n    testID: PropTypes.string,\n  },\n\n  render: function() {\n    var nativeProps = {\n      ...this.props,\n    };\n    if (this.props.logo) {\n      nativeProps.logo = resolveAssetSource(this.props.logo);\n    }\n    if (this.props.navIcon) {\n      nativeProps.navIcon = resolveAssetSource(this.props.navIcon);\n    }\n    if (this.props.overflowIcon) {\n      nativeProps.overflowIcon = resolveAssetSource(this.props.overflowIcon);\n    }\n    if (this.props.actions) {\n      var nativeActions = [];\n      for (var i = 0; i < this.props.actions.length; i++) {\n        var action = {\n          ...this.props.actions[i],\n        };\n        if (action.icon) {\n          action.icon = resolveAssetSource(action.icon);\n        }\n        if (action.show) {\n          action.show = UIManager.ToolbarAndroid.Constants.ShowAsAction[action.show];\n        }\n        nativeActions.push(action);\n      }\n      nativeProps.nativeActions = nativeActions;\n    }\n\n    return <NativeToolbar onSelect={this._onSelect} {...nativeProps} />;\n  },\n\n  _onSelect: function(event) {\n    var position = event.nativeEvent.position;\n    if (position === -1) {\n      this.props.onIconClicked && this.props.onIconClicked();\n    } else {\n      this.props.onActionSelected && this.props.onActionSelected(position);\n    }\n  },\n});\n\nvar NativeToolbar = requireNativeComponent('ToolbarAndroid', ToolbarAndroid, {\n  nativeOnly: {\n    nativeActions: true,\n  }\n});\n\nmodule.exports = ToolbarAndroid;\n"
  },
  {
    "path": "Libraries/Components/ToolbarAndroid/ToolbarAndroid.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ToolbarAndroid\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/Touchable/BoundingDimensions.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BoundingDimensions\n */\n\n'use strict';\n\nvar PooledClass = require('PooledClass');\n\nvar twoArgumentPooler = PooledClass.twoArgumentPooler;\n\n/**\n * PooledClass representing the bounding rectangle of a region.\n *\n * @param {number} width Width of bounding rectangle.\n * @param {number} height Height of bounding rectangle.\n * @constructor BoundingDimensions\n */\nfunction BoundingDimensions(width, height) {\n  this.width = width;\n  this.height = height;\n}\n\nBoundingDimensions.prototype.destructor = function() {\n  this.width = null;\n  this.height = null;\n};\n\n/**\n * @param {HTMLElement} element Element to return `BoundingDimensions` for.\n * @return {BoundingDimensions} Bounding dimensions of `element`.\n */\nBoundingDimensions.getPooledFromElement = function(element) {\n  return BoundingDimensions.getPooled(\n    element.offsetWidth,\n    element.offsetHeight\n  );\n};\n\nPooledClass.addPoolingTo(BoundingDimensions, twoArgumentPooler);\n\nmodule.exports = BoundingDimensions;\n"
  },
  {
    "path": "Libraries/Components/Touchable/PooledClass.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule PooledClass\n * @flow\n */\n\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\n\n/**\n * Static poolers. Several custom versions for each potential number of\n * arguments. A completely generic pooler is easy to implement, but would\n * require accessing the `arguments` object. In each of these, `this` refers to\n * the Class itself, not an instance. If any others are needed, simply add them\n * here, or in their own files.\n */\nvar oneArgumentPooler = function(copyFieldsFrom) {\n  var Klass = this;\n  if (Klass.instancePool.length) {\n    var instance = Klass.instancePool.pop();\n    Klass.call(instance, copyFieldsFrom);\n    return instance;\n  } else {\n    return new Klass(copyFieldsFrom);\n  }\n};\n\nvar twoArgumentPooler = function(a1, a2) {\n  var Klass = this;\n  if (Klass.instancePool.length) {\n    var instance = Klass.instancePool.pop();\n    Klass.call(instance, a1, a2);\n    return instance;\n  } else {\n    return new Klass(a1, a2);\n  }\n};\n\nvar threeArgumentPooler = function(a1, a2, a3) {\n  var Klass = this;\n  if (Klass.instancePool.length) {\n    var instance = Klass.instancePool.pop();\n    Klass.call(instance, a1, a2, a3);\n    return instance;\n  } else {\n    return new Klass(a1, a2, a3);\n  }\n};\n\nvar fourArgumentPooler = function(a1, a2, a3, a4) {\n  var Klass = this;\n  if (Klass.instancePool.length) {\n    var instance = Klass.instancePool.pop();\n    Klass.call(instance, a1, a2, a3, a4);\n    return instance;\n  } else {\n    return new Klass(a1, a2, a3, a4);\n  }\n};\n\nvar standardReleaser = function(instance) {\n  var Klass = this;\n  invariant(\n    instance instanceof Klass,\n    'Trying to release an instance into a pool of a different type.',\n  );\n  instance.destructor();\n  if (Klass.instancePool.length < Klass.poolSize) {\n    Klass.instancePool.push(instance);\n  }\n};\n\nvar DEFAULT_POOL_SIZE = 10;\nvar DEFAULT_POOLER = oneArgumentPooler;\n\ntype Pooler = any;\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<T>(\n  CopyConstructor: Class<T>,\n  pooler: Pooler,\n): Class<T> & {\n  getPooled(\n    ...args: $ReadOnlyArray<mixed>\n  ): /* arguments of the constructor */ T,\n  release(instance: mixed): void,\n} {\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: any);\n  NewKlass.instancePool = [];\n  NewKlass.getPooled = pooler || DEFAULT_POOLER;\n  if (!NewKlass.poolSize) {\n    NewKlass.poolSize = DEFAULT_POOL_SIZE;\n  }\n  NewKlass.release = standardReleaser;\n  return NewKlass;\n};\n\nvar PooledClass = {\n  addPoolingTo: addPoolingTo,\n  oneArgumentPooler: (oneArgumentPooler: Pooler),\n  twoArgumentPooler: (twoArgumentPooler: Pooler),\n  threeArgumentPooler: (threeArgumentPooler: Pooler),\n  fourArgumentPooler: (fourArgumentPooler: Pooler),\n};\n\nmodule.exports = PooledClass;\n"
  },
  {
    "path": "Libraries/Components/Touchable/Position.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Position\n */\n\n'use strict';\n\nvar PooledClass = require('PooledClass');\n\nvar twoArgumentPooler = PooledClass.twoArgumentPooler;\n\n/**\n * Position does not expose methods for construction via an `HTMLDOMElement`,\n * because it isn't meaningful to construct such a thing without first defining\n * a frame of reference.\n *\n * @param {number} windowStartKey Key that window starts at.\n * @param {number} windowEndKey Key that window ends at.\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\nmodule.exports = Position;\n"
  },
  {
    "path": "Libraries/Components/Touchable/Touchable.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Touchable\n */\n\n'use strict';\n\nconst BoundingDimensions = require('BoundingDimensions');\nconst Platform = require('Platform');\nconst Position = require('Position');\nconst React = require('React');\nconst ReactNative = require('ReactNative');\nconst TVEventHandler = require('TVEventHandler');\nconst TouchEventUtils = require('fbjs/lib/TouchEventUtils');\nconst UIManager = require('UIManager');\nconst View = require('View');\n\nconst keyMirror = require('fbjs/lib/keyMirror');\nconst normalizeColor = require('normalizeColor');\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 * - 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 *       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 */\nvar States = keyMirror({\n  NOT_RESPONDER: null,                   // Not the responder\n  RESPONDER_INACTIVE_PRESS_IN: null,     // Responder, inactive, in the `PressRect`\n  RESPONDER_INACTIVE_PRESS_OUT: null,    // Responder, inactive, out of `PressRect`\n  RESPONDER_ACTIVE_PRESS_IN: null,       // Responder, active, in the `PressRect`\n  RESPONDER_ACTIVE_PRESS_OUT: null,      // Responder, active, out of `PressRect`\n  RESPONDER_ACTIVE_LONG_PRESS_IN: null,  // Responder, active, in the `PressRect`, after long press threshold\n  RESPONDER_ACTIVE_LONG_PRESS_OUT: null, // Responder, active, out of `PressRect`, after long press threshold\n  ERROR: null\n});\n\n/**\n * Quick lookup map for states that are considered to be \"active\"\n */\nvar IsActive = {\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 */\nvar IsPressingIn = {\n  RESPONDER_INACTIVE_PRESS_IN: true,\n  RESPONDER_ACTIVE_PRESS_IN: true,\n  RESPONDER_ACTIVE_LONG_PRESS_IN: true,\n};\n\nvar IsLongPressingIn = {\n  RESPONDER_ACTIVE_LONG_PRESS_IN: true,\n};\n\n/**\n * Inputs to the state machine.\n */\nvar Signals = keyMirror({\n  DELAY: null,\n  RESPONDER_GRANT: null,\n  RESPONDER_RELEASE: null,\n  RESPONDER_TERMINATED: null,\n  ENTER_PRESS_RECT: null,\n  LEAVE_PRESS_RECT: null,\n  LONG_PRESS_DETECTED: null,\n});\n\n/**\n * Mapping from States x Signals => States\n */\nvar 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;\nvar HIGHLIGHT_DELAY_MS = 130;\n\nvar PRESS_EXPAND_PX = 20;\n\nvar LONG_PRESS_THRESHOLD = 500;\n\nvar LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS;\n\nvar 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 */\nvar TouchableMixin = {\n  componentDidMount: function() {\n    if (!Platform.isTVOS) {\n      return;\n    }\n\n    this._tvEventHandler = new TVEventHandler();\n    this._tvEventHandler.enable(this, function(cmp, evt) {\n      var myTag = ReactNative.findNodeHandle(cmp);\n      evt.dispatchConfig = {};\n      if (myTag === evt.tag) {\n        if (evt.eventType === 'focus') {\n          cmp.touchableHandleActivePressIn && cmp.touchableHandleActivePressIn(evt);\n        } else if (evt.eventType === 'blur') {\n          cmp.touchableHandleActivePressOut && cmp.touchableHandleActivePressOut(evt);\n        } else if (evt.eventType === 'select') {\n          cmp.touchableHandlePress && cmp.touchableHandlePress(evt);\n        }\n      }\n    });\n  },\n\n  /**\n   * Clear all timeouts on unmount\n   */\n  componentWillUnmount: function() {\n    if (this._tvEventHandler) {\n      this._tvEventHandler.disable();\n      delete this._tvEventHandler;\n    }\n    this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);\n    this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);\n    this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);\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    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() {\n    return !this.props.rejectResponderTermination;\n  },\n\n  /**\n   * Must return true to start the process of `Touchable`.\n   */\n  touchableHandleStartShouldSetResponder: function() {\n    return !this.props.disabled;\n  },\n\n  /**\n   * Return true to cancel press on long press.\n   */\n  touchableLongPressCancelsPress: function () {\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) {\n    var 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    var delayMS =\n      this.touchableGetHighlightDelayMS !== undefined ?\n      Math.max(this.touchableGetHighlightDelayMS(), 0) : 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    var longDelayMS =\n      this.touchableGetLongPressDelayMS !== undefined ?\n      Math.max(this.touchableGetLongPressDelayMS(), 10) : 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) {\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) {\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) {\n    // Not enough time elapsed yet, wait for highlight -\n    // this is just a perf optimization.\n    if (this.state.touchable.touchState === States.RESPONDER_INACTIVE_PRESS_IN) {\n      return;\n    }\n\n    // Measurement may not have returned yet.\n    if (!this.state.touchable.positionOnActivate) {\n      return;\n    }\n\n    var positionOnActivate = this.state.touchable.positionOnActivate;\n    var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;\n    var pressRectOffset = this.touchableGetPressRectOffset ?\n      this.touchableGetPressRectOffset() : {\n        left: PRESS_EXPAND_PX,\n        right: PRESS_EXPAND_PX,\n        top: PRESS_EXPAND_PX,\n        bottom: PRESS_EXPAND_PX\n      };\n\n    var pressExpandLeft = pressRectOffset.left;\n    var pressExpandTop = pressRectOffset.top;\n    var pressExpandRight = pressRectOffset.right;\n    var pressExpandBottom = pressRectOffset.bottom;\n\n    var hitSlop = this.touchableGetHitSlop ?\n      this.touchableGetHitSlop() : null;\n\n    if (hitSlop) {\n      pressExpandLeft += hitSlop.left;\n      pressExpandTop += hitSlop.top;\n      pressExpandRight += hitSlop.right;\n      pressExpandBottom += hitSlop.bottom;\n    }\n\n    var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent);\n    var pageX = touch && touch.pageX;\n    var pageY = touch && touch.pageY;\n\n    if (this.pressInLocation) {\n      var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY);\n      if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) {\n        this._cancelLongPressDelayTimeout();\n      }\n    }\n\n    var 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      this._receiveSignal(Signals.ENTER_PRESS_RECT, e);\n      var curState = this.state.touchable.touchState;\n      if (curState === States.RESPONDER_INACTIVE_PRESS_IN) {\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  // ==== 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\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(l, t, w, h, globalX, globalY) {\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      BoundingDimensions.release(this.state.touchable.dimensionsOnActivate);\n    this.state.touchable.positionOnActivate = Position.getPooled(globalX, globalY);\n    this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(w, h);\n  },\n\n  _handleDelay: function(e) {\n    this.touchableDelayTimeout = null;\n    this._receiveSignal(Signals.DELAY, e);\n  },\n\n  _handleLongDelay: function(e) {\n    this.longPressDelayTimeout = null;\n    var curState = this.state.touchable.touchState;\n    if (curState !== States.RESPONDER_ACTIVE_PRESS_IN &&\n        curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) {\n      console.error('Attempted to transition from state `' + curState + '` to `' +\n        States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' +\n        'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.');\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, e) {\n    var responderID = this.state.touchable.responderID;\n    var curState = this.state.touchable.touchState;\n    var 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 `' + signal + '` or state `' + curState +\n        '` for Touchable responder `' + responderID + '`'\n      );\n    }\n    if (nextState === States.ERROR) {\n      throw new Error(\n        'Touchable cannot transition from `' + curState + '` to `' + signal +\n        '` for responder `' + responderID + '`'\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) {\n    return state === States.RESPONDER_ACTIVE_PRESS_IN ||\n           state === States.RESPONDER_ACTIVE_LONG_PRESS_IN;\n  },\n\n  _savePressInLocation: function(e) {\n    var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent);\n    var pageX = touch && touch.pageX;\n    var pageY = touch && touch.pageY;\n    var locationX = touch && touch.locationX;\n    var locationY = touch && touch.locationY;\n    this.pressInLocation = {pageX, pageY, locationX, locationY};\n  },\n\n  _getDistanceBetweenPoints: function (aX, aY, bX, bY) {\n    var deltaX = aX - bX;\n    var 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(curState, nextState, signal, e) {\n    var curIsHighlight = this._isHighlight(curState);\n    var newIsHighlight = this._isHighlight(nextState);\n\n    var isFinalSignal =\n      signal === Signals.RESPONDER_TERMINATED ||\n      signal === Signals.RESPONDER_RELEASE;\n\n    if (isFinalSignal) {\n      this._cancelLongPressDelayTimeout();\n    }\n\n    if (!IsActive[curState] && IsActive[nextState]) {\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      var hasLongPressHandler = !!this.props.onLongPress;\n      var pressIsLongButStillCallOnPress =\n        IsLongPressingIn[curState] && (    // We *are* long pressing..\n          (// But either has no long handler\n          !hasLongPressHandler || !this.touchableLongPressCancelsPress()) // or we're told to ignore it.\n        );\n\n      var shouldInvokePress =  !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  _startHighlight: function(e) {\n    this._savePressInLocation(e);\n    this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);\n  },\n\n  _endHighlight: function(e) {\n    if (this.touchableHandleActivePressOut) {\n      if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) {\n        this.pressOutDelayTimeout = setTimeout(() => {\n          this.touchableHandleActivePressOut(e);\n        }, this.touchableGetPressOutDelayMS());\n      } else {\n        this.touchableHandleActivePressOut(e);\n      }\n    }\n  },\n\n};\n\nvar 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: ({color, hitSlop}) => {\n    if (!Touchable.TOUCH_TARGET_DEBUG) {\n      return null;\n    }\n    if (!__DEV__) {\n      throw Error('Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!');\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 hexColor = '#' + ('00000000' + normalizeColor(color).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\nmodule.exports = Touchable;\n"
  },
  {
    "path": "Libraries/Components/Touchable/TouchableBounce.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TouchableBounce\n * @flow\n * @format\n */\n'use strict';\n\nvar Animated = require('Animated');\nvar EdgeInsetsPropType = require('EdgeInsetsPropType');\nvar NativeMethodsMixin = require('NativeMethodsMixin');\nvar React = require('React');\nvar createReactClass = require('create-react-class');\nvar PropTypes = require('prop-types');\nvar Touchable = require('Touchable');\n\ntype Event = Object;\n\ntype State = {\n  animationID: ?number,\n  scale: Animated.Value,\n};\n\nvar PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};\n\n/**\n * Example of using the `TouchableMixin` to play well with other responder\n * locking views including `ScrollView`. `TouchableMixin` provides touchable\n * hooks (`this.touchableHandle*`) that we forward events to. In turn,\n * `TouchableMixin` expects us to implement some abstract methods to handle\n * interesting interactions such as `handleTouchablePress`.\n */\nvar TouchableBounce = createReactClass({\n  displayName: 'TouchableBounce',\n  mixins: [Touchable.Mixin, NativeMethodsMixin],\n\n  propTypes: {\n    /**\n     * When true, indicates that the view is an accessibility element. By default,\n     * all the touchable elements are accessible.\n     */\n    accessible: PropTypes.bool,\n\n    onPress: PropTypes.func,\n    onPressIn: PropTypes.func,\n    onPressOut: PropTypes.func,\n    // The function passed takes a callback to start the animation which should\n    // be run after this onPress handler is done. You can use this (for example)\n    // to update UI before starting the animation.\n    onPressWithCompletion: PropTypes.func,\n    // the function passed is called after the animation is complete\n    onPressAnimationComplete: PropTypes.func,\n    /**\n     * When the scroll view is disabled, this defines how far your touch may\n     * move off of the button, before deactivating the button. Once deactivated,\n     * try moving it back and you'll see that the button is once again\n     * reactivated! Move it back and forth several times while the scroll view\n     * is disabled. Ensure you pass in a constant to reduce memory allocations.\n     */\n    pressRetentionOffset: EdgeInsetsPropType,\n    /**\n     * This defines how far your touch can start away from the button. This is\n     * added to `pressRetentionOffset` when moving off of the button.\n     * ** NOTE **\n     * The touch area never extends past the parent view bounds and the Z-index\n     * of sibling views always takes precedence if a touch hits two overlapping\n     * views.\n     */\n    hitSlop: EdgeInsetsPropType,\n    releaseVelocity: PropTypes.number.isRequired,\n    releaseBounciness: PropTypes.number.isRequired,\n  },\n\n  getDefaultProps: function() {\n    return {releaseBounciness: 10, releaseVelocity: 10};\n  },\n\n  getInitialState: function(): State {\n    return {\n      ...this.touchableGetInitialState(),\n      scale: new Animated.Value(1),\n    };\n  },\n\n  bounceTo: function(\n    value: number,\n    velocity: number,\n    bounciness: number,\n    callback?: ?Function,\n  ) {\n    Animated.spring(this.state.scale, {\n      toValue: value,\n      velocity,\n      bounciness,\n      useNativeDriver: true,\n    }).start(callback);\n  },\n\n  /**\n   * `Touchable.Mixin` self callbacks. The mixin will invoke these if they are\n   * defined on your component.\n   */\n  touchableHandleActivePressIn: function(e: Event) {\n    this.bounceTo(0.93, 0.1, 0);\n    this.props.onPressIn && this.props.onPressIn(e);\n  },\n\n  touchableHandleActivePressOut: function(e: Event) {\n    this.bounceTo(1, 0.4, 0);\n    this.props.onPressOut && this.props.onPressOut(e);\n  },\n\n  touchableHandlePress: function(e: Event) {\n    var onPressWithCompletion = this.props.onPressWithCompletion;\n    if (onPressWithCompletion) {\n      onPressWithCompletion(() => {\n        this.state.scale.setValue(0.93);\n        this.bounceTo(\n          1,\n          this.props.releaseVelocity,\n          this.props.releaseBounciness,\n          this.props.onPressAnimationComplete,\n        );\n      });\n      return;\n    }\n\n    this.bounceTo(\n      1,\n      this.props.releaseVelocity,\n      this.props.releaseBounciness,\n      this.props.onPressAnimationComplete,\n    );\n    this.props.onPress && this.props.onPress(e);\n  },\n\n  touchableGetPressRectOffset: function(): typeof PRESS_RETENTION_OFFSET {\n    return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n  },\n\n  touchableGetHitSlop: function(): ?Object {\n    return this.props.hitSlop;\n  },\n\n  touchableGetHighlightDelayMS: function(): number {\n    return 0;\n  },\n\n  render: function(): React.Element<any> {\n    return (\n      <Animated.View\n        /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n         * comment suppresses an error when upgrading Flow's support for React.\n         * To see the error delete this comment and run Flow. */\n        style={[{transform: [{scale: this.state.scale}]}, this.props.style]}\n        accessible={this.props.accessible !== false}\n        /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n         * comment suppresses an error when upgrading Flow's support for React.\n         * To see the error delete this comment and run Flow. */\n        accessibilityLabel={this.props.accessibilityLabel}\n        /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n         * comment suppresses an error when upgrading Flow's support for React.\n         * To see the error delete this comment and run Flow. */\n        accessibilityComponentType={this.props.accessibilityComponentType}\n        /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n         * comment suppresses an error when upgrading Flow's support for React.\n         * To see the error delete this comment and run Flow. */\n        accessibilityTraits={this.props.accessibilityTraits}\n        /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n         * comment suppresses an error when upgrading Flow's support for React.\n         * To see the error delete this comment and run Flow. */\n        nativeID={this.props.nativeID}\n        /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n         * comment suppresses an error when upgrading Flow's support for React.\n         * To see the error delete this comment and run Flow. */\n        testID={this.props.testID}\n        testRole='AXTouchableBounce'\n        hitSlop={this.props.hitSlop}\n        onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}\n        onResponderTerminationRequest={\n          this.touchableHandleResponderTerminationRequest\n        }\n        onResponderGrant={this.touchableHandleResponderGrant}\n        onResponderMove={this.touchableHandleResponderMove}\n        onResponderRelease={this.touchableHandleResponderRelease}\n        onResponderTerminate={this.touchableHandleResponderTerminate}>\n        {\n          // $FlowFixMe(>=0.41.0)\n          this.props.children\n        }\n        {Touchable.renderDebugView({\n          color: 'orange',\n          hitSlop: this.props.hitSlop,\n        })}\n      </Animated.View>\n    );\n  },\n});\n\nmodule.exports = TouchableBounce;\n"
  },
  {
    "path": "Libraries/Components/Touchable/TouchableHighlight.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TouchableHighlight\n * @flow\n * @format\n */\n'use strict';\n\nconst ColorPropType = require('ColorPropType');\nconst NativeMethodsMixin = require('NativeMethodsMixin');\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst ReactNativeViewAttributes = require('ReactNativeViewAttributes');\nconst StyleSheet = require('StyleSheet');\nconst Touchable = require('Touchable');\nconst TouchableWithoutFeedback = require('TouchableWithoutFeedback');\nconst View = require('View');\nconst ViewPropTypes = require('ViewPropTypes');\n\nconst createReactClass = require('create-react-class');\nconst ensurePositiveDelayProps = require('ensurePositiveDelayProps');\n\nimport type {PressEvent} from 'CoreEventTypes';\n\nconst DEFAULT_PROPS = {\n  activeOpacity: 0.85,\n  delayPressOut: 100,\n  underlayColor: 'black',\n};\n\nconst PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};\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 *\n * Example:\n *\n * ```\n * renderButton: function() {\n *   return (\n *     <TouchableHighlight onPress={this._onPressButton}>\n *       <Image\n *         style={styles.button}\n *         source={require('./myButton.png')}\n *       />\n *     </TouchableHighlight>\n *   );\n * },\n * ```\n *\n *\n * ### Example\n *\n * ```ReactNativeWebPlayer\n * import React, { Component } from 'react'\n * import {\n *   AppRegistry,\n *   StyleSheet,\n *   TouchableHighlight,\n *   Text,\n *   View,\n * } from 'react-native'\n *\n * class App extends Component {\n *   constructor(props) {\n *     super(props)\n *     this.state = { count: 0 }\n *   }\n *\n *   onPress = () => {\n *     this.setState({\n *       count: this.state.count+1\n *     })\n *   }\n *\n *  render() {\n *     return (\n *       <View style={styles.container}>\n *         <TouchableHighlight\n *          style={styles.button}\n *          onPress={this.onPress}\n *         >\n *          <Text> Touch Here </Text>\n *         </TouchableHighlight>\n *         <View style={[styles.countContainer]}>\n *           <Text style={[styles.countText]}>\n *             { this.state.count !== 0 ? this.state.count: null}\n *           </Text>\n *         </View>\n *       </View>\n *     )\n *   }\n * }\n *\n * const styles = StyleSheet.create({\n *   container: {\n *     flex: 1,\n *     justifyContent: 'center',\n *     paddingHorizontal: 10\n *   },\n *   button: {\n *     alignItems: 'center',\n *     backgroundColor: '#DDDDDD',\n *     padding: 10\n *   },\n *   countContainer: {\n *     alignItems: 'center',\n *     padding: 10\n *   },\n *   countText: {\n *     color: '#FF00FF'\n *   }\n * })\n *\n * AppRegistry.registerComponent('App', () => App)\n * ```\n *\n */\n\nconst TouchableHighlight = createReactClass({\n  displayName: 'TouchableHighlight',\n  propTypes: {\n    ...TouchableWithoutFeedback.propTypes,\n    /**\n     * Determines what the opacity of the wrapped view should be when touch is\n     * active.\n     */\n    activeOpacity: PropTypes.number,\n    /**\n     * The color of the underlay that will show through when the touch is\n     * active.\n     */\n    underlayColor: ColorPropType,\n    /**\n     * Style to apply to the container/underlay. Most commonly used to make sure\n     * rounded corners match the wrapped component.\n     */\n    style: ViewPropTypes.style,\n    /**\n     * Called immediately after the underlay is shown\n     */\n    onShowUnderlay: PropTypes.func,\n    /**\n     * Called immediately after the underlay is hidden\n     */\n    onHideUnderlay: PropTypes.func,\n    /**\n     * *(Apple TV only)* TV preferred focus (see documentation for the View component).\n     *\n     * @platform ios\n     */\n    hasTVPreferredFocus: PropTypes.bool,\n    /**\n     * *(Apple TV only)* Object with properties to control Apple TV parallax effects.\n     *\n     * enabled: If true, parallax effects are enabled.  Defaults to true.\n     * shiftDistanceX: Defaults to 2.0.\n     * shiftDistanceY: Defaults to 2.0.\n     * tiltAngle: Defaults to 0.05.\n     * magnification: Defaults to 1.0.\n     *\n     * @platform ios\n     */\n    tvParallaxProperties: PropTypes.object,\n  },\n\n  mixins: [NativeMethodsMixin, Touchable.Mixin],\n\n  getDefaultProps: () => DEFAULT_PROPS,\n\n  getInitialState: function() {\n    this._isMounted = false;\n    return {\n      ...this.touchableGetInitialState(),\n      extraChildStyle: null,\n      extraUnderlayStyle: null,\n    };\n  },\n\n  componentDidMount: function() {\n    this._isMounted = true;\n    ensurePositiveDelayProps(this.props);\n  },\n\n  componentWillUnmount: function() {\n    this._isMounted = false;\n    clearTimeout(this._hideTimeout);\n  },\n\n  componentWillReceiveProps: function(nextProps) {\n    ensurePositiveDelayProps(nextProps);\n  },\n\n  viewConfig: {\n    uiViewClassName: 'RCTView',\n    validAttributes: ReactNativeViewAttributes.RCTView,\n  },\n\n  /**\n   * `Touchable.Mixin` self callbacks. The mixin will invoke these if they are\n   * defined on your component.\n   */\n  touchableHandleActivePressIn: function(e: PressEvent) {\n    clearTimeout(this._hideTimeout);\n    this._hideTimeout = null;\n    this._showUnderlay();\n    this.props.onPressIn && this.props.onPressIn(e);\n  },\n\n  touchableHandleActivePressOut: function(e: PressEvent) {\n    if (!this._hideTimeout) {\n      this._hideUnderlay();\n    }\n    this.props.onPressOut && this.props.onPressOut(e);\n  },\n\n  touchableHandlePress: function(e: PressEvent) {\n    clearTimeout(this._hideTimeout);\n    this._showUnderlay();\n    this._hideTimeout = setTimeout(\n      this._hideUnderlay,\n      this.props.delayPressOut,\n    );\n    this.props.onPress && this.props.onPress(e);\n  },\n\n  touchableHandleLongPress: function(e: PressEvent) {\n    this.props.onLongPress && this.props.onLongPress(e);\n  },\n\n  touchableGetPressRectOffset: function() {\n    return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n  },\n\n  touchableGetHitSlop: function() {\n    return this.props.hitSlop;\n  },\n\n  touchableGetHighlightDelayMS: function() {\n    return this.props.delayPressIn;\n  },\n\n  touchableGetLongPressDelayMS: function() {\n    return this.props.delayLongPress;\n  },\n\n  touchableGetPressOutDelayMS: function() {\n    return this.props.delayPressOut;\n  },\n\n  _showUnderlay: function() {\n    if (!this._isMounted || !this._hasPressHandler()) {\n      return;\n    }\n    this.setState({\n      extraChildStyle: {\n        opacity: this.props.activeOpacity,\n      },\n      extraUnderlayStyle: {\n        backgroundColor: this.props.underlayColor,\n      },\n    });\n    this.props.onShowUnderlay && this.props.onShowUnderlay();\n  },\n\n  _hideUnderlay: function() {\n    clearTimeout(this._hideTimeout);\n    this._hideTimeout = null;\n    if (this._hasPressHandler()) {\n      this.setState({\n        extraChildStyle: null,\n        extraUnderlayStyle: null,\n      });\n      this.props.onHideUnderlay && this.props.onHideUnderlay();\n    }\n  },\n\n  _hasPressHandler: function() {\n    return !!(\n      this.props.onPress ||\n      this.props.onPressIn ||\n      this.props.onPressOut ||\n      this.props.onLongPress\n    );\n  },\n\n  render: function() {\n    const child = React.Children.only(this.props.children);\n    return (\n      <View\n        accessible={this.props.accessible !== false}\n        accessibilityLabel={this.props.accessibilityLabel}\n        accessibilityComponentType={this.props.accessibilityComponentType}\n        accessibilityTraits={this.props.accessibilityTraits}\n        style={StyleSheet.compose(\n          this.props.style,\n          this.state.extraUnderlayStyle,\n        )}\n        onLayout={this.props.onLayout}\n        hitSlop={this.props.hitSlop}\n        isTVSelectable={true}\n        tvParallaxProperties={this.props.tvParallaxProperties}\n        hasTVPreferredFocus={this.props.hasTVPreferredFocus}\n        onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}\n        onResponderTerminationRequest={\n          this.touchableHandleResponderTerminationRequest\n        }\n        onResponderGrant={this.touchableHandleResponderGrant}\n        onResponderMove={this.touchableHandleResponderMove}\n        onResponderRelease={this.touchableHandleResponderRelease}\n        onResponderTerminate={this.touchableHandleResponderTerminate}\n        nativeID={this.props.nativeID}\n        testID={this.props.testID}>\n        {React.cloneElement(child, {\n          style: StyleSheet.compose(\n            child.props.style,\n            this.state.extraChildStyle,\n          ),\n        })}\n        {Touchable.renderDebugView({\n          color: 'green',\n          hitSlop: this.props.hitSlop,\n        })}\n      </View>\n    );\n  },\n});\n\nmodule.exports = TouchableHighlight;\n"
  },
  {
    "path": "Libraries/Components/Touchable/TouchableNativeFeedback.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TouchableNativeFeedback\n */\n'use strict';\n\nvar Platform = require('Platform');\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar ReactNative = require('ReactNative');\nvar Touchable = require('Touchable');\nvar TouchableWithoutFeedback = require('TouchableWithoutFeedback');\nvar UIManager = require('UIManager');\n\nvar createReactClass = require('create-react-class');\nvar ensurePositiveDelayProps = require('ensurePositiveDelayProps');\nvar processColor = require('processColor');\n\nvar rippleBackgroundPropType = PropTypes.shape({\n  type: PropTypes.oneOf(['RippleAndroid']),\n  color: PropTypes.number,\n  borderless: PropTypes.bool,\n});\n\nvar themeAttributeBackgroundPropType = PropTypes.shape({\n  type: PropTypes.oneOf(['ThemeAttrAndroid']),\n  attribute: PropTypes.string.isRequired,\n});\n\nvar backgroundPropType = PropTypes.oneOfType([\n  rippleBackgroundPropType,\n  themeAttributeBackgroundPropType,\n]);\n\ntype Event = Object;\n\nvar PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};\n\n/**\n * A wrapper for making views respond properly to touches (Android only).\n * On Android this component uses native state drawable to display touch\n * feedback.\n *\n * At the moment it only supports having a single View instance as a child\n * node, as it's implemented by replacing that View with another instance of\n * RCTView node with some additional properties set.\n *\n * Background drawable of native feedback touchable can be customized with\n * `background` property.\n *\n * Example:\n *\n * ```\n * renderButton: function() {\n *   return (\n *     <TouchableNativeFeedback\n *         onPress={this._onPressButton}\n *         background={TouchableNativeFeedback.SelectableBackground()}>\n *       <View style={{width: 150, height: 100, backgroundColor: 'red'}}>\n *         <Text style={{margin: 30}}>Button</Text>\n *       </View>\n *     </TouchableNativeFeedback>\n *   );\n * },\n * ```\n */\n\nvar TouchableNativeFeedback = createReactClass({\n  displayName: 'TouchableNativeFeedback',\n  propTypes: {\n    ...TouchableWithoutFeedback.propTypes,\n\n    /**\n     * Determines the type of background drawable that's going to be used to\n     * display feedback. It takes an object with `type` property and extra data\n     * depending on the `type`. It's recommended to use one of the static\n     * methods to generate that dictionary.\n     */\n    background: backgroundPropType,\n\n    /**\n     * Set to true to add the ripple effect to the foreground of the view, instead of the\n     * background. This is useful if one of your child views has a background of its own, or you're\n     * e.g. displaying images, and you don't want the ripple to be covered by them.\n     *\n     * Check TouchableNativeFeedback.canUseNativeForeground() first, as this is only available on\n     * Android 6.0 and above. If you try to use this on older versions you will get a warning and\n     * fallback to background.\n     */\n    useForeground: PropTypes.bool,\n  },\n\n  statics: {\n    /**\n     * Creates an object that represents android theme's default background for\n     * selectable elements (?android:attr/selectableItemBackground).\n     */\n    SelectableBackground: function() {\n      return {type: 'ThemeAttrAndroid', attribute: 'selectableItemBackground'};\n    },\n    /**\n     * Creates an object that represent android theme's default background for borderless\n     * selectable elements (?android:attr/selectableItemBackgroundBorderless).\n     * Available on android API level 21+.\n     */\n    SelectableBackgroundBorderless: function() {\n      return {type: 'ThemeAttrAndroid', attribute: 'selectableItemBackgroundBorderless'};\n    },\n    /**\n     * Creates an object that represents ripple drawable with specified color (as a\n     * string). If property `borderless` evaluates to true the ripple will\n     * render outside of the view bounds (see native actionbar buttons as an\n     * example of that behavior). This background type is available on Android\n     * API level 21+.\n     *\n     * @param color The ripple color\n     * @param borderless If the ripple can render outside it's bounds\n     */\n    Ripple: function(color: string, borderless: boolean) {\n      return {type: 'RippleAndroid', color: processColor(color), borderless: borderless};\n    },\n\n    canUseNativeForeground: function() {\n      return Platform.OS === 'android' && Platform.Version >= 23;\n    }\n  },\n\n  mixins: [Touchable.Mixin],\n\n  getDefaultProps: function() {\n    return {\n      background: this.SelectableBackground(),\n    };\n  },\n\n  getInitialState: function() {\n    return this.touchableGetInitialState();\n  },\n\n  componentDidMount: function() {\n    ensurePositiveDelayProps(this.props);\n  },\n\n  componentWillReceiveProps: function(nextProps) {\n    ensurePositiveDelayProps(nextProps);\n  },\n\n  /**\n   * `Touchable.Mixin` self callbacks. The mixin will invoke these if they are\n   * defined on your component.\n   */\n  touchableHandleActivePressIn: function(e: Event) {\n    this.props.onPressIn && this.props.onPressIn(e);\n    this._dispatchPressedStateChange(true);\n    this._dispatchHotspotUpdate(this.pressInLocation.locationX, this.pressInLocation.locationY);\n  },\n\n  touchableHandleActivePressOut: function(e: Event) {\n    this.props.onPressOut && this.props.onPressOut(e);\n    this._dispatchPressedStateChange(false);\n  },\n\n  touchableHandlePress: function(e: Event) {\n    this.props.onPress && this.props.onPress(e);\n  },\n\n  touchableHandleLongPress: function(e: Event) {\n    this.props.onLongPress && this.props.onLongPress(e);\n  },\n\n  touchableGetPressRectOffset: function() {\n    // Always make sure to predeclare a constant!\n    return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n  },\n\n  touchableGetHitSlop: function() {\n    return this.props.hitSlop;\n  },\n\n  touchableGetHighlightDelayMS: function() {\n    return this.props.delayPressIn;\n  },\n\n  touchableGetLongPressDelayMS: function() {\n    return this.props.delayLongPress;\n  },\n\n  touchableGetPressOutDelayMS: function() {\n    return this.props.delayPressOut;\n  },\n\n  _handleResponderMove: function(e) {\n    this.touchableHandleResponderMove(e);\n    this._dispatchHotspotUpdate(e.nativeEvent.locationX, e.nativeEvent.locationY);\n  },\n\n  _dispatchHotspotUpdate: function(destX, destY) {\n    UIManager.dispatchViewManagerCommand(\n      ReactNative.findNodeHandle(this),\n      UIManager.RCTView.Commands.hotspotUpdate,\n      [destX || 0, destY || 0]\n    );\n  },\n\n  _dispatchPressedStateChange: function(pressed) {\n    UIManager.dispatchViewManagerCommand(\n      ReactNative.findNodeHandle(this),\n      UIManager.RCTView.Commands.setPressed,\n      [pressed]\n    );\n  },\n\n  render: function() {\n    const child = React.Children.only(this.props.children);\n    let children = child.props.children;\n    if (Touchable.TOUCH_TARGET_DEBUG && child.type.displayName === 'View') {\n      if (!Array.isArray(children)) {\n        children = [children];\n      }\n      children.push(Touchable.renderDebugView({color: 'brown', hitSlop: this.props.hitSlop}));\n    }\n    if (this.props.useForeground && !TouchableNativeFeedback.canUseNativeForeground()) {\n      console.warn(\n        'Requested foreground ripple, but it is not available on this version of Android. ' +\n        'Consider calling TouchableNativeFeedback.canUseNativeForeground() and using a different ' +\n        'Touchable if the result is false.');\n    }\n    const drawableProp =\n      this.props.useForeground && TouchableNativeFeedback.canUseNativeForeground()\n        ? 'nativeForegroundAndroid'\n        : 'nativeBackgroundAndroid';\n    var childProps = {\n      ...child.props,\n      [drawableProp]: this.props.background,\n      accessible: this.props.accessible !== false,\n      accessibilityLabel: this.props.accessibilityLabel,\n      accessibilityComponentType: this.props.accessibilityComponentType,\n      accessibilityTraits: this.props.accessibilityTraits,\n      children,\n      testID: this.props.testID,\n      onLayout: this.props.onLayout,\n      hitSlop: this.props.hitSlop,\n      onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,\n      onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest,\n      onResponderGrant: this.touchableHandleResponderGrant,\n      onResponderMove: this._handleResponderMove,\n      onResponderRelease: this.touchableHandleResponderRelease,\n      onResponderTerminate: this.touchableHandleResponderTerminate,\n    };\n\n    // We need to clone the actual element so that the ripple background drawable\n    // can be applied directly to the background of this element rather than to\n    // a wrapper view as done in other Touchable*\n    return React.cloneElement(\n      child,\n      childProps\n    );\n  }\n});\n\nmodule.exports = TouchableNativeFeedback;\n"
  },
  {
    "path": "Libraries/Components/Touchable/TouchableNativeFeedback.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TouchableNativeFeedback\n */\n\n'use strict';\n\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar Text = require('Text');\nvar View = require('View');\n\nclass DummyTouchableNativeFeedback extends React.Component {\n  render() {\n    return (\n      <View style={[styles.container, this.props.style]}>\n        <Text style={styles.info}>TouchableNativeFeedback is not supported on this platform!</Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    height: 100,\n    width: 300,\n    backgroundColor: '#ffbcbc',\n    borderWidth: 1,\n    borderColor: 'red',\n    alignItems: 'center',\n    justifyContent: 'center',\n    margin: 10,\n  },\n  info: {\n    color: '#333333',\n    margin: 20,\n  }\n});\n\nmodule.exports = DummyTouchableNativeFeedback;\n"
  },
  {
    "path": "Libraries/Components/Touchable/TouchableNativeFeedback.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TouchableNativeFeedback\n */\n\n'use strict';\n\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar Text = require('Text');\nvar View = require('View');\n\nclass TouchableNativeFeedback extends React.Component {\n  render() {\n    return (\n      <View style={[styles.container, this.props.style]}>\n        <Text style={styles.info}>TouchableNativeFeedback is not supported on this platform!</Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    height: 100,\n    width: 300,\n    backgroundColor: '#ffbcbc',\n    borderWidth: 1,\n    borderColor: 'red',\n    alignItems: 'center',\n    justifyContent: 'center',\n    margin: 10,\n  },\n  info: {\n    color: '#333333',\n    margin: 20,\n  }\n});\n\nmodule.exports = TouchableNativeFeedback;\n"
  },
  {
    "path": "Libraries/Components/Touchable/TouchableOpacity.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TouchableOpacity\n * @noflow\n */\n'use strict';\n\n// Note (avik): add @flow when Flow supports spread properties in propTypes\n\nvar Animated = require('Animated');\nvar Easing = require('Easing');\nvar NativeMethodsMixin = require('NativeMethodsMixin');\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar TimerMixin = require('react-timer-mixin');\nvar Touchable = require('Touchable');\nvar TouchableWithoutFeedback = require('TouchableWithoutFeedback');\n\nvar createReactClass = require('create-react-class');\nvar ensurePositiveDelayProps = require('ensurePositiveDelayProps');\nvar flattenStyle = require('flattenStyle');\n\ntype Event = Object;\n\nvar PRESS_RETENTION_OFFSET = { top: 20, left: 20, right: 20, bottom: 30 };\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 *\n * Opacity is controlled by wrapping the children in an Animated.View, which is\n * added to the view hiearchy.  Be aware that this can affect layout.\n *\n * Example:\n *\n * ```\n * renderButton: function() {\n *   return (\n *     <TouchableOpacity onPress={this._onPressButton}>\n *       <Image\n *         style={styles.button}\n *         source={require('./myButton.png')}\n *       />\n *     </TouchableOpacity>\n *   );\n * },\n * ```\n * ### Example\n *\n * ```ReactNativeWebPlayer\n * import React, { Component } from 'react'\n * import {\n *   AppRegistry,\n *   StyleSheet,\n *   TouchableOpacity,\n *   Text,\n *   View,\n * } from 'react-native'\n *\n * class App extends Component {\n *   constructor(props) {\n *     super(props)\n *     this.state = { count: 0 }\n *   }\n *\n *   onPress = () => {\n *     this.setState({\n *       count: this.state.count+1\n *     })\n *   }\n *\n *  render() {\n *    return (\n *      <View style={styles.container}>\n *        <TouchableOpacity\n *          style={styles.button}\n *          onPress={this.onPress}\n *        >\n *          <Text> Touch Here </Text>\n *        </TouchableOpacity>\n *        <View style={[styles.countContainer]}>\n *          <Text style={[styles.countText]}>\n *             { this.state.count !== 0 ? this.state.count: null}\n *           </Text>\n *         </View>\n *       </View>\n *     )\n *   }\n * }\n *\n * const styles = StyleSheet.create({\n *   container: {\n *     flex: 1,\n *     justifyContent: 'center',\n *     paddingHorizontal: 10\n *   },\n *   button: {\n *     alignItems: 'center',\n *     backgroundColor: '#DDDDDD',\n *     padding: 10\n *   },\n *   countContainer: {\n *     alignItems: 'center',\n *     padding: 10\n *   },\n *   countText: {\n *     color: '#FF00FF'\n *   }\n * })\n *\n * AppRegistry.registerComponent('App', () => App)\n * ```\n *\n */\nvar TouchableOpacity = createReactClass({\n  displayName: 'TouchableOpacity',\n  mixins: [TimerMixin, Touchable.Mixin, NativeMethodsMixin],\n\n  propTypes: {\n    ...TouchableWithoutFeedback.propTypes,\n    /**\n     * Determines what the opacity of the wrapped view should be when touch is\n     * active. Defaults to 0.2.\n     */\n    activeOpacity: PropTypes.number,\n    /**\n     * *(Apple TV only)* TV preferred focus (see documentation for the View component).\n     *\n     * @platform ios\n     */\n    hasTVPreferredFocus: PropTypes.bool,\n    /**\n     * Apple TV parallax effects\n     */\n    tvParallaxProperties: PropTypes.object,\n  },\n\n  getDefaultProps: function() {\n    return {\n      activeOpacity: 0.2,\n    };\n  },\n\n  getInitialState: function() {\n    return {\n      ...this.touchableGetInitialState(),\n      anim: new Animated.Value(this._getChildStyleOpacityWithDefault()),\n    };\n  },\n\n  componentDidMount: function() {\n    ensurePositiveDelayProps(this.props);\n  },\n\n  componentWillReceiveProps: function(nextProps) {\n    ensurePositiveDelayProps(nextProps);\n  },\n\n  /**\n   * Animate the touchable to a new opacity.\n   */\n  setOpacityTo: function(value: number, duration: number) {\n    Animated.timing(this.state.anim, {\n      toValue: value,\n      duration: duration,\n      easing: Easing.inOut(Easing.quad),\n      useNativeDriver: true,\n    }).start();\n  },\n\n  /**\n   * `Touchable.Mixin` self callbacks. The mixin will invoke these if they are\n   * defined on your component.\n   */\n  touchableHandleActivePressIn: function(e: Event) {\n    if (e.dispatchConfig.registrationName === 'onResponderGrant') {\n      this._opacityActive(0);\n    } else {\n      this._opacityActive(150);\n    }\n    this.props.onPressIn && this.props.onPressIn(e);\n  },\n\n  touchableHandleActivePressOut: function(e: Event) {\n    this._opacityInactive(250);\n    this.props.onPressOut && this.props.onPressOut(e);\n  },\n\n  touchableHandlePress: function(e: Event) {\n    this.props.onPress && this.props.onPress(e);\n  },\n\n  touchableHandleLongPress: function(e: Event) {\n    this.props.onLongPress && this.props.onLongPress(e);\n  },\n\n  touchableGetPressRectOffset: function() {\n    return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n  },\n\n  touchableGetHitSlop: function() {\n    return this.props.hitSlop;\n  },\n\n  touchableGetHighlightDelayMS: function() {\n    return this.props.delayPressIn || 0;\n  },\n\n  touchableGetLongPressDelayMS: function() {\n    return this.props.delayLongPress === 0\n      ? 0\n      : this.props.delayLongPress || 500;\n  },\n\n  touchableGetPressOutDelayMS: function() {\n    return this.props.delayPressOut;\n  },\n\n  _opacityActive: function(duration: number) {\n    this.setOpacityTo(this.props.activeOpacity, duration);\n  },\n\n  _opacityInactive: function(duration: number) {\n    this.setOpacityTo(this._getChildStyleOpacityWithDefault(), duration);\n  },\n\n  _getChildStyleOpacityWithDefault: function() {\n    var childStyle = flattenStyle(this.props.style) || {};\n    return childStyle.opacity == undefined ? 1 : childStyle.opacity;\n  },\n\n  render: function() {\n    return (\n      <Animated.View\n        accessible={this.props.accessible !== false}\n        accessibilityLabel={this.props.accessibilityLabel}\n        accessibilityComponentType={this.props.accessibilityComponentType}\n        accessibilityTraits={this.props.accessibilityTraits}\n        style={[this.props.style, { opacity: this.state.anim }]}\n        nativeID={this.props.nativeID}\n        testID={this.props.testID}\n        testRole=\"AXTouchableOpacity\"\n        onLayout={this.props.onLayout}\n        isTVSelectable={true}\n        hasTVPreferredFocus={this.props.hasTVPreferredFocus}\n        tvParallaxProperties={this.props.tvParallaxProperties}\n        hitSlop={this.props.hitSlop}\n        onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}\n        onResponderTerminationRequest={\n          this.touchableHandleResponderTerminationRequest\n        }\n        onResponderGrant={this.touchableHandleResponderGrant}\n        onResponderMove={this.touchableHandleResponderMove}\n        onResponderRelease={this.touchableHandleResponderRelease}\n        onResponderTerminate={this.touchableHandleResponderTerminate}\n        onMouseEnter={this.props.onMouseEnter}\n        onMouseLeave={this.props.onMouseLeave}\n        onContextMenuItemClick={this.props.onContextMenuItemClick}\n        contextMenu={this.props.contextMenu}>\n        {this.props.children}\n        {Touchable.renderDebugView({\n          color: 'cyan',\n          hitSlop: this.props.hitSlop,\n        })}\n      </Animated.View>\n    );\n  },\n});\n\nmodule.exports = TouchableOpacity;\n"
  },
  {
    "path": "Libraries/Components/Touchable/TouchableWithoutFeedback.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TouchableWithoutFeedback\n * @flow\n */\n'use strict';\n\nconst EdgeInsetsPropType = require('EdgeInsetsPropType');\nconst React = require('React');\nconst PropTypes = require('prop-types');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst TimerMixin = require('react-timer-mixin');\nconst Touchable = require('Touchable');\n\nconst createReactClass = require('create-react-class');\nconst ensurePositiveDelayProps = require('ensurePositiveDelayProps');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst warning = require('fbjs/lib/warning');\n\nconst {\n  AccessibilityComponentTypes,\n  AccessibilityTraits,\n} = require('ViewAccessibility');\n\nimport type {PressEvent} from 'CoreEventTypes';\n\nconst PRESS_RETENTION_OFFSET = { top: 20, left: 20, right: 20, bottom: 30 };\n\n/**\n * Do not use unless you have a very good reason. All elements that\n * respond to press should have a visual feedback when touched.\n *\n * TouchableWithoutFeedback supports only one child.\n * If you wish to have several child components, wrap them in a View.\n */\nconst TouchableWithoutFeedback = createReactClass({\n  displayName: 'TouchableWithoutFeedback',\n  mixins: [TimerMixin, Touchable.Mixin],\n\n  propTypes: {\n    accessible: PropTypes.bool,\n    accessibilityComponentType: PropTypes.oneOf(AccessibilityComponentTypes),\n    accessibilityTraits: PropTypes.oneOfType([\n      PropTypes.oneOf(AccessibilityTraits),\n      PropTypes.arrayOf(PropTypes.oneOf(AccessibilityTraits)),\n    ]),\n    /**\n     * If true, disable all interactions for this component.\n     */\n    disabled: PropTypes.bool,\n    /**\n     * Called when the touch is released, but not if cancelled (e.g. by a scroll\n     * that steals the responder lock).\n     */\n    onPress: PropTypes.func,\n    /**\n    * Called as soon as the touchable element is pressed and invoked even before onPress.\n    * This can be useful when making network requests.\n    */\n    onPressIn: PropTypes.func,\n    /**\n    * Called as soon as the touch is released even before onPress.\n    */\n     onPressOut: PropTypes.func,\n    /**\n     * Invoked on mount and layout changes with\n     *\n     *   `{nativeEvent: {layout: {x, y, width, height}}}`\n     */\n    onLayout: PropTypes.func,\n\n    onLongPress: PropTypes.func,\n\n    /**\n     * Delay in ms, from the start of the touch, before onPressIn is called.\n     */\n    delayPressIn: PropTypes.number,\n    /**\n     * Delay in ms, from the release of the touch, before onPressOut is called.\n     */\n    delayPressOut: PropTypes.number,\n    /**\n     * Delay in ms, from onPressIn, before onLongPress is called.\n     */\n    delayLongPress: PropTypes.number,\n    /**\n     * When the scroll view is disabled, this defines how far your touch may\n     * move off of the button, before deactivating the button. Once deactivated,\n     * try moving it back and you'll see that the button is once again\n     * reactivated! Move it back and forth several times while the scroll view\n     * is disabled. Ensure you pass in a constant to reduce memory allocations.\n     */\n    pressRetentionOffset: EdgeInsetsPropType,\n    /**\n     * This defines how far your touch can start away from the button. This is\n     * added to `pressRetentionOffset` when moving off of the button.\n     * ** NOTE **\n     * The touch area never extends past the parent view bounds and the Z-index\n     * of sibling views always takes precedence if a touch hits two overlapping\n     * views.\n     */\n    hitSlop: EdgeInsetsPropType,\n    onMouseEnter: PropTypes.func,\n    onMouseLeave: PropTypes.func,\n    onContextMenuItemClick: PropTypes.func,\n    contextMenu: PropTypes.array,\n  },\n\n  getInitialState: function() {\n    return this.touchableGetInitialState();\n  },\n\n  componentDidMount: function() {\n    ensurePositiveDelayProps(this.props);\n  },\n\n  componentWillReceiveProps: function(nextProps: Object) {\n    ensurePositiveDelayProps(nextProps);\n  },\n\n  /**\n   * `Touchable.Mixin` self callbacks. The mixin will invoke these if they are\n   * defined on your component.\n   */\n  touchableHandlePress: function(e: PressEvent) {\n    this.props.onPress && this.props.onPress(e);\n  },\n\n  touchableHandleActivePressIn: function(e: PressEvent) {\n    this.props.onPressIn && this.props.onPressIn(e);\n  },\n\n  touchableHandleActivePressOut: function(e: PressEvent) {\n    this.props.onPressOut && this.props.onPressOut(e);\n  },\n\n  touchableHandleLongPress: function(e: PressEvent) {\n    this.props.onLongPress && this.props.onLongPress(e);\n  },\n\n  touchableGetPressRectOffset: function(): typeof PRESS_RETENTION_OFFSET {\n    return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n  },\n\n  touchableGetHitSlop: function(): ?Object {\n    return this.props.hitSlop;\n  },\n\n  touchableGetHighlightDelayMS: function(): number {\n    return this.props.delayPressIn || 0;\n  },\n\n  touchableGetLongPressDelayMS: function(): number {\n    return this.props.delayLongPress === 0\n      ? 0\n      : this.props.delayLongPress || 500;\n  },\n\n  touchableGetPressOutDelayMS: function(): number {\n    return this.props.delayPressOut || 0;\n  },\n\n  render: function(): React.Element<any> {\n    // Note(avik): remove dynamic typecast once Flow has been upgraded\n    // $FlowFixMe(>=0.41.0)\n    const child = React.Children.only(this.props.children);\n    let children = child.props.children;\n    warning(\n      !child.type || child.type.displayName !== 'Text',\n      'TouchableWithoutFeedback does not work well with Text children. Wrap children in a View instead. See ' +\n        ((child._owner && child._owner.getName && child._owner.getName()) ||\n          '<unknown>')\n    );\n    if (\n      Touchable.TOUCH_TARGET_DEBUG &&\n      child.type &&\n      child.type.displayName === 'View'\n    ) {\n      children = React.Children.toArray(children);\n      children.push(\n        Touchable.renderDebugView({ color: 'red', hitSlop: this.props.hitSlop })\n      );\n    }\n    const style = Touchable.TOUCH_TARGET_DEBUG &&\n      child.type &&\n      child.type.displayName === 'Text'\n      ? [child.props.style, { color: 'red' }]\n      : child.props.style;\n\n    const overrides = {\n      accessible: this.props.accessible !== false,\n      accessibilityLabel: this.props.accessibilityLabel,\n      accessibilityComponentType: this.props.accessibilityComponentType,\n      accessibilityTraits: this.props.accessibilityTraits,\n      nativeID: this.props.nativeID,\n      testID: this.props.testID,\n      onLayout: this.props.onLayout,\n      hitSlop: this.props.hitSlop,\n      onMouseEnter: this.props.onMouseEnter,\n      onMouseLeave: this.props.onMouseLeave,\n      onContextMenuItemClick: this.props.onContextMenuItemClick,\n      contextMenu: this.props.contextMenu,\n    };\n\n    return (React: any).cloneElement(child, {\n      ...onlyDefinedValues(overrides),\n      onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,\n      onResponderTerminationRequest: this\n        .touchableHandleResponderTerminationRequest,\n      onResponderGrant: this.touchableHandleResponderGrant,\n      onResponderMove: this.touchableHandleResponderMove,\n      onResponderRelease: this.touchableHandleResponderRelease,\n      onResponderTerminate: this.touchableHandleResponderTerminate,\n      style,\n      children,\n    });\n  },\n});\n\nfunction onlyDefinedValues(base) {\n  const copy = {};\n  for (const key in base) {\n    if (base[key] !== undefined) {\n      copy[key] = base[key];\n    }\n  }\n  return copy;\n}\n\nmodule.exports = TouchableWithoutFeedback;\n"
  },
  {
    "path": "Libraries/Components/Touchable/__mocks__/ensureComponentIsNative.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nmodule.exports = () => true;\n"
  },
  {
    "path": "Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nconst React = require('React');\nconst ReactTestRenderer = require('react-test-renderer');\nconst Text = require('Text');\nconst TouchableHighlight = require('TouchableHighlight');\n\ndescribe('TouchableHighlight', () => {\n  it('renders correctly', () => {\n    const instance = ReactTestRenderer.create(\n      <TouchableHighlight style={{}}>\n        <Text>Touchable</Text>\n      </TouchableHighlight>\n    );\n\n    expect(instance.toJSON()).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`TouchableHighlight renders correctly 1`] = `\n<View\n  accessibilityComponentType={undefined}\n  accessibilityLabel={undefined}\n  accessibilityTraits={undefined}\n  accessible={true}\n  hasTVPreferredFocus={undefined}\n  hitSlop={undefined}\n  isTVSelectable={true}\n  nativeID={undefined}\n  onLayout={undefined}\n  onMouseEnter={undefined}\n  onMouseLeave={undefined}\n  onResponderGrant={[Function]}\n  onResponderMove={[Function]}\n  onResponderRelease={[Function]}\n  onResponderTerminate={[Function]}\n  onResponderTerminationRequest={[Function]}\n  onStartShouldSetResponder={[Function]}\n  style={Object {}}\n  testID={undefined}\n  tvParallaxProperties={undefined}\n>\n  <Text\n    accessible={true}\n    allowFontScaling={true}\n    ellipsizeMode=\"tail\"\n    style={null}\n  >\n    Touchable\n  </Text>\n</View>\n`;\n"
  },
  {
    "path": "Libraries/Components/Touchable/ensureComponentIsNative.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ensureComponentIsNative\n * @flow\n */\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar ensureComponentIsNative = function(component: any) {\n  invariant(\n    component && typeof component.setNativeProps === 'function',\n    'Touchable child must either be native or forward setNativeProps to a ' +\n    'native component'\n  );\n};\n\nmodule.exports = ensureComponentIsNative;\n"
  },
  {
    "path": "Libraries/Components/Touchable/ensurePositiveDelayProps.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ensurePositiveDelayProps\n * @flow\n */\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar ensurePositiveDelayProps = function(props: any) {\n  invariant(\n    !(props.delayPressIn < 0 || props.delayPressOut < 0 ||\n      props.delayLongPress < 0),\n    'Touchable components cannot have negative delay properties'\n  );\n};\n\nmodule.exports = ensurePositiveDelayProps;\n"
  },
  {
    "path": "Libraries/Components/UnimplementedViews/UnimplementedView.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule UnimplementedView\n * @flow\n * @format\n */\n'use strict';\n\nconst React = require('React');\nconst StyleSheet = require('StyleSheet');\n\n/**\n * Common implementation for a simple stubbed view. Simply applies the view's styles to the inner\n * View component and renders its children.\n */\nclass UnimplementedView extends React.Component<$FlowFixMeProps> {\n  setNativeProps() {\n    // Do nothing.\n    // This method is required in order to use this view as a Touchable* child.\n    // See ensureComponentIsNative.js for more info\n  }\n\n  render() {\n    // Workaround require cycle from requireNativeComponent\n    const View = require('View');\n    return (\n      <View style={[styles.unimplementedView, this.props.style]}>\n        {this.props.children}\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  unimplementedView: __DEV__\n    ? {\n        alignSelf: 'flex-start',\n        borderColor: 'red',\n        borderWidth: 1,\n      }\n    : {},\n});\n\nmodule.exports = UnimplementedView;\n"
  },
  {
    "path": "Libraries/Components/View/PlatformViewPropTypes.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PlatformViewPropTypes\n * @flow\n */\n\nmodule.export = {};\n"
  },
  {
    "path": "Libraries/Components/View/PlatformViewPropTypes.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PlatformViewPropTypes\n * @flow\n */\n\nconst Platform = require('Platform');\n\nvar TVViewPropTypes = {};\nif (Platform.isTVOS) {\n  TVViewPropTypes = require('TVViewPropTypes');\n}\n\nmodule.exports = TVViewPropTypes;\n"
  },
  {
    "path": "Libraries/Components/View/PlatformViewPropTypes.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PlatformViewPropTypes\n * @flow\n */\n\nmodule.export = {};\n"
  },
  {
    "path": "Libraries/Components/View/ReactNativeStyleAttributes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactNativeStyleAttributes\n * @flow\n */\n\n'use strict';\n\nvar ImageStylePropTypes = require('ImageStylePropTypes');\nvar TextStylePropTypes = require('TextStylePropTypes');\nvar ViewStylePropTypes = require('ViewStylePropTypes');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar keyMirror = require('fbjs/lib/keyMirror');\nvar processColor = require('processColor');\nvar processTransform = require('processTransform');\nvar sizesDiffer = require('sizesDiffer');\n\nvar ReactNativeStyleAttributes = {\n  ...keyMirror(ViewStylePropTypes),\n  ...keyMirror(TextStylePropTypes),\n  ...keyMirror(ImageStylePropTypes),\n};\n\nReactNativeStyleAttributes.transform = { process: processTransform };\nReactNativeStyleAttributes.shadowOffset = { diff: sizesDiffer };\n\nvar colorAttributes = { process: processColor };\nReactNativeStyleAttributes.backgroundColor = colorAttributes;\nReactNativeStyleAttributes.borderBottomColor = colorAttributes;\nReactNativeStyleAttributes.borderColor = colorAttributes;\nReactNativeStyleAttributes.borderLeftColor = colorAttributes;\nReactNativeStyleAttributes.borderRightColor = colorAttributes;\nReactNativeStyleAttributes.borderTopColor = colorAttributes;\nReactNativeStyleAttributes.borderStartColor = colorAttributes;\nReactNativeStyleAttributes.borderEndColor = colorAttributes;\nReactNativeStyleAttributes.color = colorAttributes;\nReactNativeStyleAttributes.shadowColor = colorAttributes;\nReactNativeStyleAttributes.textDecorationColor = colorAttributes;\nReactNativeStyleAttributes.tintColor = colorAttributes;\nReactNativeStyleAttributes.textShadowColor = colorAttributes;\nReactNativeStyleAttributes.overlayColor = colorAttributes;\n\nmodule.exports = ReactNativeStyleAttributes;\n"
  },
  {
    "path": "Libraries/Components/View/ReactNativeViewAttributes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactNativeViewAttributes\n * @flow\n */\n'use strict';\n\nvar ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');\n\nvar ReactNativeViewAttributes = {};\n\nReactNativeViewAttributes.UIView = {\n  pointerEvents: true,\n  accessible: true,\n  accessibilityActions: true,\n  accessibilityLabel: true,\n  accessibilityComponentType: true,\n  accessibilityLiveRegion: true,\n  accessibilityTraits: true,\n  importantForAccessibility: true,\n  nativeID: true,\n  testID: true,\n  testRole: true,\n  renderToHardwareTextureAndroid: true,\n  shouldRasterizeIOS: true,\n  onLayout: true,\n  onMouseEnter: true,\n  onMouseLeave: true,\n  onAccessibilityTap: true,\n  onMagicTap: true,\n  collapsable: true,\n  needsOffscreenAlphaCompositing: true,\n  style: ReactNativeStyleAttributes,\n  toolTip: true,\n};\n\nReactNativeViewAttributes.RCTView = {\n  ...ReactNativeViewAttributes.UIView,\n\n  // This is a special performance property exposed by RCTView and useful for\n  // scrolling content when there are many subviews, most of which are offscreen.\n  // For this property to be effective, it must be applied to a view that contains\n  // many subviews that extend outside its bound. The subviews must also have\n  // overflow: hidden, as should the containing view (or one of its superviews).\n  removeClippedSubviews: true,\n};\n\nmodule.exports = ReactNativeViewAttributes;\n"
  },
  {
    "path": "Libraries/Components/View/ShadowPropTypesIOS.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ShadowPropTypesIOS\n * @flow\n * @format\n */\n'use strict';\n\nconst ColorPropType = require('ColorPropType');\nconst ReactPropTypes = require('prop-types');\n\n/**\n * These props can be used to dynamically generate shadows on views, images, text, etc.\n *\n * Because they are dynamically generated, they may cause performance regressions. Static\n * shadow image asset may be a better way to go for optimal performance.\n *\n * These properties are iOS only - for similar functionality on Android, use the [`elevation`\n * property](docs/viewstyleproptypes.html#elevation).\n */\nconst ShadowPropTypesIOS = {\n  /**\n   * Sets the drop shadow color\n   * @platform ios\n   */\n  shadowColor: ColorPropType,\n  /**\n   * Sets the drop shadow offset\n   * @platform ios\n   */\n  shadowOffset: ReactPropTypes.shape({\n    width: ReactPropTypes.number,\n    height: ReactPropTypes.number,\n  }),\n  /**\n   * Sets the drop shadow opacity (multiplied by the color's alpha component)\n   * @platform ios\n   */\n  shadowOpacity: ReactPropTypes.number,\n  /**\n   * Sets the drop shadow blur radius\n   * @platform ios\n   */\n  shadowRadius: ReactPropTypes.number,\n};\n\nmodule.exports = ShadowPropTypesIOS;\n"
  },
  {
    "path": "Libraries/Components/View/View.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule View\n * @flow\n */\n'use strict';\n\nconst NativeMethodsMixin = require('NativeMethodsMixin');\nconst Platform = require('Platform');\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');\nconst ReactNativeViewAttributes = require('ReactNativeViewAttributes');\nconst ViewPropTypes = require('ViewPropTypes');\n\nconst createReactClass = require('create-react-class');\nconst invariant = require('fbjs/lib/invariant');\nconst requireNativeComponent = require('requireNativeComponent');\n\nimport type {ViewProps} from 'ViewPropTypes';\n\nexport type Props = ViewProps;\n\n/**\n * The most fundamental component for building a UI.\n *\n * See http://facebook.github.io/react-native/docs/view.html\n */\nconst View = createReactClass({\n  displayName: 'View',\n  // TODO: We should probably expose the mixins, viewConfig, and statics publicly. For example,\n  // one of the props is of type AccessibilityComponentType. That is defined as a const[] above,\n  // but it is not rendered by the docs, since `statics` below is not rendered. So its Possible\n  // values had to be hardcoded.\n  mixins: [NativeMethodsMixin],\n\n  // `propTypes` should not be accessed directly on View since this wrapper only\n  // exists for DEV mode. However it's important for them to be declared.\n  // If the object passed to `createClass` specifies `propTypes`, Flow will\n  // create a static type from it.\n  propTypes: ViewPropTypes,\n\n  /**\n   * `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We\n   * make `this` look like an actual native component class.\n   */\n  viewConfig: {\n    uiViewClassName: 'RCTView',\n    validAttributes: ReactNativeViewAttributes.RCTView\n  },\n\n  contextTypes: {\n    isInAParentText: PropTypes.bool,\n  },\n\n  render: function() {\n    invariant(\n      !(this.context.isInAParentText && Platform.OS === 'android'),\n      'Nesting of <View> within <Text> is not supported on Android.');\n\n    // WARNING: This method will not be used in production mode as in that mode we\n    // replace wrapper component View with generated native wrapper RCTView. Avoid\n    // adding functionality this component that you'd want to be available in both\n    // dev and prod modes.\n    return <RCTView {...this.props} />;\n  },\n});\n\nconst RCTView = requireNativeComponent('RCTView', View, {\n  nativeOnly: {\n    nativeBackgroundAndroid: true,\n    nativeForegroundAndroid: true,\n  }\n});\n\nif (__DEV__) {\n  const UIManager = require('UIManager');\n  const viewConfig = UIManager.viewConfigs && UIManager.viewConfigs.RCTView || {};\n  for (const prop in viewConfig.nativeProps) {\n    const viewAny: any = View; // Appease flow\n    if (!viewAny.propTypes[prop] && !ReactNativeStyleAttributes[prop]) {\n      throw new Error(\n        'View is missing propType for native prop `' + prop + '`'\n      );\n    }\n  }\n}\n\nlet ViewToExport = RCTView;\nif (__DEV__) {\n  ViewToExport = View;\n}\n\n// No one should depend on the DEV-mode createClass View wrapper.\nmodule.exports = ((ViewToExport : any) : typeof RCTView);\n"
  },
  {
    "path": "Libraries/Components/View/View.js.flow",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule View\n * @flow\n * @format\n */\n\n'use strict';\n\nconst {NativeComponent} = require('ReactNative');\n\nimport type {ViewProps} from 'ViewPropTypes';\n\nexport type Props = ViewProps;\n\n/**\n * Host components in React 16 are represented by strings (eg \"div\", \"View\").\n * This is inconvenient for users who want to type a ref (eg `ref: View`).\n * The following type isn't sound but it enables consistent Flow types\n * for various default React Native components, so it seems a good tradeoff.\n */\ndeclare class View extends NativeComponent<void, ViewProps> {}\n\nmodule.exports = View;\n"
  },
  {
    "path": "Libraries/Components/View/ViewAccessibility.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ViewAccessibility\n * @flow\n */\n'use strict';\n\nexport type AccessibilityTrait =\n  'none' |\n  'button' |\n  'link' |\n  'header' |\n  'search' |\n  'image' |\n  'selected' |\n  'plays' |\n  'key' |\n  'text' |\n  'summary' |\n  'disabled' |\n  'frequentUpdates' |\n  'startsMedia' |\n  'adjustable' |\n  'allowsDirectInteraction' |\n  'pageTurn';\n\nexport type AccessibilityComponentType =\n  'none' |\n  'button' |\n  'radiobutton_checked' |\n  'radiobutton_unchecked';\n\nmodule.exports = {\n  AccessibilityTraits: [\n    'none',\n    'button',\n    'link',\n    'header',\n    'search',\n    'image',\n    'selected',\n    'plays',\n    'key',\n    'text',\n    'summary',\n    'disabled',\n    'frequentUpdates',\n    'startsMedia',\n    'adjustable',\n    'allowsDirectInteraction',\n    'pageTurn',\n  ],\n  AccessibilityComponentTypes: [\n    'none',\n    'button',\n    'radiobutton_checked',\n    'radiobutton_unchecked',\n  ],\n};\n"
  },
  {
    "path": "Libraries/Components/View/ViewPropTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ViewPropTypes\n * @flow\n */\n'use strict';\n\nconst EdgeInsetsPropType = require('EdgeInsetsPropType');\nconst PlatformViewPropTypes = require('PlatformViewPropTypes');\nconst PropTypes = require('prop-types');\nconst StyleSheetPropType = require('StyleSheetPropType');\nconst ViewStylePropTypes = require('ViewStylePropTypes');\n\nconst {\n  AccessibilityComponentTypes,\n  AccessibilityTraits,\n} = require('ViewAccessibility');\n\nimport type {\n  AccessibilityComponentType,\n  AccessibilityTrait,\n} from 'ViewAccessibility';\nimport type {EdgeInsetsProp} from 'EdgeInsetsPropType';\nimport type {TVViewProps} from 'TVViewPropTypes';\n\nconst stylePropType = StyleSheetPropType(ViewStylePropTypes);\n\nexport type ViewLayout = {\n  x: number,\n  y: number,\n  width: number,\n  height: number,\n}\n\nexport type ViewLayoutEvent = {\n  nativeEvent: {\n    layout: ViewLayout,\n  }\n}\n\n// There's no easy way to create a different type if (Platform.isTVOS):\n// so we must include TVViewProps\nexport type ViewProps = {\n  accessible?: bool,\n  accessibilityLabel?: React$PropType$Primitive<any>,\n  accessibilityActions?: Array<string>,\n  accessibilityComponentType?: AccessibilityComponentType,\n  accessibilityLiveRegion?: 'none' | 'polite' | 'assertive',\n  importantForAccessibility?: 'auto'| 'yes'| 'no'| 'no-hide-descendants',\n  accessibilityTraits?: AccessibilityTrait | Array<AccessibilityTrait>,\n  accessibilityViewIsModal?: bool,\n  onAccessibilityAction?: Function,\n  onAccessibilityTap?: Function,\n  onMagicTap?: Function,\n  testID?: string,\n  nativeID?: string,\n  onLayout?: (event: ViewLayoutEvent) => void,\n  onResponderGrant?: Function,\n  onResponderMove?: Function,\n  onResponderReject?: Function,\n  onResponderRelease?: Function,\n  onResponderTerminate?: Function,\n  onResponderTerminationRequest?: Function,\n  onStartShouldSetResponder?: Function,\n  onStartShouldSetResponderCapture?: Function,\n  onMoveShouldSetResponder?: Function,\n  onMoveShouldSetResponderCapture?: Function,\n  hitSlop?: EdgeInsetsProp,\n  pointerEvents?: 'box-none'| 'none'| 'box-only'| 'auto',\n  style?: stylePropType,\n  removeClippedSubviews?: bool,\n  renderToHardwareTextureAndroid?: bool,\n  shouldRasterizeIOS?: bool,\n  collapsable?: bool,\n  needsOffscreenAlphaCompositing?: bool,\n} & TVViewProps;\n\nmodule.exports = {\n  ...PlatformViewPropTypes,\n\n  /**\n   * When `true`, indicates that the view is an accessibility element.\n   * By default, all the touchable elements are accessible.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#accessible\n   */\n  accessible: PropTypes.bool,\n\n  /**\n   * Overrides the text that's read by the screen reader when the user interacts\n   * with the element. By default, the label is constructed by traversing all\n   * the children and accumulating all the `Text` nodes separated by space.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#accessibilitylabel\n   */\n  accessibilityLabel: PropTypes.node,\n\n  /**\n   * Provides an array of custom actions available for accessibility.\n   *\n   * @platform ios\n   */\n  accessibilityActions: PropTypes.arrayOf(PropTypes.string),\n\n  /**\n   * Indicates to accessibility services to treat UI component like a\n   * native one. Works for Android only.\n   *\n   * @platform android\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#accessibilitycomponenttype\n   */\n  accessibilityComponentType: PropTypes.oneOf(AccessibilityComponentTypes),\n\n  /**\n   * Indicates to accessibility services whether the user should be notified\n   * when this view changes. Works for Android API >= 19 only.\n   *\n   * @platform android\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#accessibilityliveregion\n   */\n  accessibilityLiveRegion: PropTypes.oneOf(['none', 'polite', 'assertive']),\n\n  /**\n   * Controls how view is important for accessibility which is if it\n   * fires accessibility events and if it is reported to accessibility services\n   * that query the screen. Works for Android only.\n   *\n   * @platform android\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#importantforaccessibility\n   */\n  importantForAccessibility: PropTypes.oneOf([\n    'auto',\n    'yes',\n    'no',\n    'no-hide-descendants',\n  ]),\n\n  /**\n   * Provides additional traits to screen reader. By default no traits are\n   * provided unless specified otherwise in element.\n   *\n   * You can provide one trait or an array of many traits.\n   *\n   * @platform ios\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#accessibilitytraits\n   */\n  accessibilityTraits: PropTypes.oneOfType([\n    PropTypes.oneOf(AccessibilityTraits),\n    PropTypes.arrayOf(PropTypes.oneOf(AccessibilityTraits)),\n  ]),\n\n  /**\n   * A value indicating whether VoiceOver should ignore the elements\n   * within views that are siblings of the receiver.\n   * Default is `false`.\n   *\n   * @platform ios\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#accessibilityviewismodal\n   */\n  accessibilityViewIsModal: PropTypes.bool,\n\n  /**\n   * When `accessible` is true, the system will try to invoke this function\n   * when the user performs an accessibility custom action.\n   *\n   * @platform ios\n   */\n  onAccessibilityAction: PropTypes.func,\n\n  /**\n   * When `accessible` is true, the system will try to invoke this function\n   * when the user performs accessibility tap gesture.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onaccessibilitytap\n   */\n  onAccessibilityTap: PropTypes.func,\n\n  /**\n   * When `accessible` is `true`, the system will invoke this function when the\n   * user performs the magic tap gesture.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onmagictap\n   */\n  onMagicTap: PropTypes.func,\n\n  /**\n   * Used to locate this view in end-to-end tests.\n   *\n   * > This disables the 'layout-only view removal' optimization for this view!\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#testid\n   */\n  testID: PropTypes.string,\n\n  /**\n   * Used to locate this view from native classes.\n   *\n   * > This disables the 'layout-only view removal' optimization for this view!\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#nativeid\n   */\n  nativeID: PropTypes.string,\n\n  /**\n   * For most touch interactions, you'll simply want to wrap your component in\n   * `TouchableHighlight` or `TouchableOpacity`. Check out `Touchable.js`,\n   * `ScrollResponder.js` and `ResponderEventPlugin.js` for more discussion.\n   */\n\n  /**\n   * The View is now responding for touch events. This is the time to highlight\n   * and show the user what is happening.\n   *\n   * `View.props.onResponderGrant: (event) => {}`, where `event` is a synthetic\n   * touch event as described above.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onrespondergrant\n   */\n  onResponderGrant: PropTypes.func,\n\n  /**\n   * The user is moving their finger.\n   *\n   * `View.props.onResponderMove: (event) => {}`, where `event` is a synthetic\n   * touch event as described above.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onrespondermove\n   */\n  onResponderMove: PropTypes.func,\n\n  /**\n   * Another responder is already active and will not release it to that `View`\n   * asking to be the responder.\n   *\n   * `View.props.onResponderReject: (event) => {}`, where `event` is a\n   * synthetic touch event as described above.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onresponderreject\n   */\n  onResponderReject: PropTypes.func,\n\n  /**\n   * Fired at the end of the touch.\n   *\n   * `View.props.onResponderRelease: (event) => {}`, where `event` is a\n   * synthetic touch event as described above.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onresponderrelease\n   */\n  onResponderRelease: PropTypes.func,\n\n  /**\n   * The responder has been taken from the `View`. Might be taken by other\n   * views after a call to `onResponderTerminationRequest`, or might be taken\n   * by the OS without asking (e.g., happens with control center/ notification\n   * center on iOS)\n   *\n   * `View.props.onResponderTerminate: (event) => {}`, where `event` is a\n   * synthetic touch event as described above.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onresponderterminate\n   */\n  onResponderTerminate: PropTypes.func,\n\n  /**\n   * Some other `View` wants to become responder and is asking this `View` to\n   * release its responder. Returning `true` allows its release.\n   *\n   * `View.props.onResponderTerminationRequest: (event) => {}`, where `event`\n   * is a synthetic touch event as described above.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onresponderterminationrequest\n   */\n  onResponderTerminationRequest: PropTypes.func,\n\n  /**\n   * Does this view want to become responder on the start of a touch?\n   *\n   * `View.props.onStartShouldSetResponder: (event) => [true | false]`, where\n   * `event` is a synthetic touch event as described above.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onstartshouldsetresponder\n   */\n  onStartShouldSetResponder: PropTypes.func,\n\n  /**\n   * If a parent `View` wants to prevent a child `View` from becoming responder\n   * on a touch start, it should have this handler which returns `true`.\n   *\n   * `View.props.onStartShouldSetResponderCapture: (event) => [true | false]`,\n   * where `event` is a synthetic touch event as described above.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onstartshouldsetrespondercapture\n   */\n  onStartShouldSetResponderCapture: PropTypes.func,\n\n  /**\n   * Does this view want to \"claim\" touch responsiveness? This is called for\n   * every touch move on the `View` when it is not the responder.\n   *\n   * `View.props.onMoveShouldSetResponder: (event) => [true | false]`, where\n   * `event` is a synthetic touch event as described above.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onmoveshouldsetresponder\n   */\n  onMoveShouldSetResponder: PropTypes.func,\n\n  /**\n   * If a parent `View` wants to prevent a child `View` from becoming responder\n   * on a move, it should have this handler which returns `true`.\n   *\n   * `View.props.onMoveShouldSetResponderCapture: (event) => [true | false]`,\n   * where `event` is a synthetic touch event as described above.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onMoveShouldsetrespondercapture\n   */\n  onMoveShouldSetResponderCapture: PropTypes.func,\n\n  /**\n   * This defines how far a touch event can start away from the view.\n   * Typical interface guidelines recommend touch targets that are at least\n   * 30 - 40 points/density-independent pixels.\n   *\n   * > The touch area never extends past the parent view bounds and the Z-index\n   * > of sibling views always takes precedence if a touch hits two overlapping\n   * > views.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#hitslop\n   */\n  hitSlop: EdgeInsetsPropType,\n\n  /**\n   * Invoked on mount and layout changes with:\n   *\n   * `{nativeEvent: { layout: {x, y, width, height}}}`\n   *\n   * This event is fired immediately once the layout has been calculated, but\n   * the new layout may not yet be reflected on the screen at the time the\n   * event is received, especially if a layout animation is in progress.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#onlayout\n   */\n  onLayout: PropTypes.func,\n\n  /**\n   * Controls whether the `View` can be the target of touch events.\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#pointerevents\n   */\n  pointerEvents: PropTypes.oneOf([\n    'box-none',\n    'none',\n    'box-only',\n    'auto',\n  ]),\n\n  /**\n   * See http://facebook.github.io/react-native/docs/style.html\n   */\n  style: stylePropType,\n\n  /**\n   * This is a special performance property exposed by `RCTView` and is useful\n   * for scrolling content when there are many subviews, most of which are\n   * offscreen. For this property to be effective, it must be applied to a\n   * view that contains many subviews that extend outside its bound. The\n   * subviews must also have `overflow: hidden`, as should the containing view\n   * (or one of its superviews).\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#removeclippedsubviews\n   */\n  removeClippedSubviews: PropTypes.bool,\n\n  /**\n   * Whether this `View` should render itself (and all of its children) into a\n   * single hardware texture on the GPU.\n   *\n   * @platform android\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#rendertohardwaretextureandroid\n   */\n  renderToHardwareTextureAndroid: PropTypes.bool,\n\n  /**\n   * Whether this `View` should be rendered as a bitmap before compositing.\n   *\n   * @platform ios\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#shouldrasterizeios\n   */\n  shouldRasterizeIOS: PropTypes.bool,\n\n  /**\n   * Views that are only used to layout their children or otherwise don't draw\n   * anything may be automatically removed from the native hierarchy as an\n   * optimization. Set this property to `false` to disable this optimization and\n   * ensure that this `View` exists in the native view hierarchy.\n   *\n   * @platform android\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#collapsable\n   */\n  collapsable: PropTypes.bool,\n\n  /**\n   * Whether this `View` needs to rendered offscreen and composited with an\n   * alpha in order to preserve 100% correct colors and blending behavior.\n   *\n   * @platform android\n   *\n   * See http://facebook.github.io/react-native/docs/view.html#needsoffscreenalphacompositing\n   */\n  needsOffscreenAlphaCompositing: PropTypes.bool,\n  /**\n   * Enables Dran'n'Drop Support for certain types of PboardType\n   * @platform macos\n   */\n  draggedTypes: PropTypes.arrayOf(\n    PropTypes.oneOf(['NSFilenamesPboardType', 'NSColorPboardType'])\n  ),\n  /**\n   * Desktop specific events\n   * @platform macos\n   */\n  onMouseEnter: PropTypes.func,\n  onMouseLeave: PropTypes.func,\n  onDragEnter: PropTypes.func,\n  onDragLeave: PropTypes.func,\n  onDrop: PropTypes.func,\n  onContextMenuItemClick: PropTypes.func,\n  /**\n   * Mapped to toolTip property of NSView. Used to show extra information when\n   * mouse hovering.\n   * @platform macos\n   */\n  toolTip: PropTypes.string,\n  /**\n   * Context menu\n   * @platform macos\n   */\n  contextMenu: PropTypes.array,\n};\n"
  },
  {
    "path": "Libraries/Components/View/ViewStylePropTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ViewStylePropTypes\n * @flow\n */\n'use strict';\n\nvar ColorPropType = require('ColorPropType');\nvar LayoutPropTypes = require('LayoutPropTypes');\nvar ReactPropTypes = require('prop-types');\nvar ShadowPropTypesIOS = require('ShadowPropTypesIOS');\nvar TransformPropTypes = require('TransformPropTypes');\n\n/**\n * Warning: Some of these properties may not be supported in all releases.\n */\nvar ViewStylePropTypes = {\n  ...LayoutPropTypes,\n  ...ShadowPropTypesIOS,\n  ...TransformPropTypes,\n  backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']),\n  backgroundColor: ColorPropType,\n  borderColor: ColorPropType,\n  borderTopColor: ColorPropType,\n  borderRightColor: ColorPropType,\n  borderBottomColor: ColorPropType,\n  borderLeftColor: ColorPropType,\n  borderStartColor: ColorPropType,\n  borderEndColor: ColorPropType,\n  borderRadius: ReactPropTypes.number,\n  borderTopLeftRadius: ReactPropTypes.number,\n  borderTopRightRadius: ReactPropTypes.number,\n  borderTopStartRadius: ReactPropTypes.number,\n  borderTopEndRadius: ReactPropTypes.number,\n  borderBottomLeftRadius: ReactPropTypes.number,\n  borderBottomRightRadius: ReactPropTypes.number,\n  borderBottomStartRadius: ReactPropTypes.number,\n  borderBottomEndRadius: ReactPropTypes.number,\n  borderStyle: ReactPropTypes.oneOf(['solid', 'dotted', 'dashed']),\n  borderWidth: ReactPropTypes.number,\n  borderTopWidth: ReactPropTypes.number,\n  borderRightWidth: ReactPropTypes.number,\n  borderBottomWidth: ReactPropTypes.number,\n  borderLeftWidth: ReactPropTypes.number,\n  opacity: ReactPropTypes.number,\n  /**\n   * (Android-only) Sets the elevation of a view, using Android's underlying\n   * [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\n   * This adds a drop shadow to the item and affects z-order for overlapping views.\n   * Only supported on Android 5.0+, has no effect on earlier versions.\n   * @platform android\n   */\n  elevation: ReactPropTypes.number,\n};\n\nmodule.exports = ViewStylePropTypes;\n"
  },
  {
    "path": "Libraries/Components/ViewPager/ViewPagerAndroid.android.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ViewPagerAndroid\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar ReactNative = require('ReactNative');\nvar UIManager = require('UIManager');\nvar ViewPropTypes = require('ViewPropTypes');\n\nvar dismissKeyboard = require('dismissKeyboard');\nvar requireNativeComponent = require('requireNativeComponent');\n\nvar VIEWPAGER_REF = 'viewPager';\n\ntype Event = Object;\n\nexport type ViewPagerScrollState = $Enum<{\n  idle: string,\n  dragging: string,\n  settling: string,\n}>;\n\n/**\n * Container that allows to flip left and right between child views. Each\n * child view of the `ViewPagerAndroid` will be treated as a separate page\n * and will be stretched to fill the `ViewPagerAndroid`.\n *\n * It is important all children are `<View>`s and not composite components.\n * You can set style properties like `padding` or `backgroundColor` for each\n * child. It is also important that each child have a `key` prop.\n *\n * Example:\n *\n * ```\n * render: function() {\n *   return (\n *     <ViewPagerAndroid\n *       style={styles.viewPager}\n *       initialPage={0}>\n *       <View style={styles.pageStyle} key=\"1\">\n *         <Text>First page</Text>\n *       </View>\n *       <View style={styles.pageStyle} key=\"2\">\n *         <Text>Second page</Text>\n *       </View>\n *     </ViewPagerAndroid>\n *   );\n * }\n *\n * ...\n *\n * var styles = {\n *   ...\n *   viewPager: {\n *     flex: 1\n *   },\n *   pageStyle: {\n *     alignItems: 'center',\n *     padding: 20,\n *   }\n * }\n * ```\n */\nclass ViewPagerAndroid extends React.Component<{\n  initialPage?: number,\n  onPageScroll?: Function,\n  onPageScrollStateChanged?: Function,\n  onPageSelected?: Function,\n  pageMargin?: number,\n  peekEnabled?: boolean,\n  keyboardDismissMode?: 'none' | 'on-drag',\n  scrollEnabled?: boolean,\n}> {\n  static propTypes = {\n    ...ViewPropTypes,\n    /**\n     * Index of initial page that should be selected. Use `setPage` method to\n     * update the page, and `onPageSelected` to monitor page changes\n     */\n    initialPage: PropTypes.number,\n\n    /**\n     * Executed when transitioning between pages (ether because of animation for\n     * the requested page change or when user is swiping/dragging between pages)\n     * The `event.nativeEvent` object for this callback will carry following data:\n     *  - position - index of first page from the left that is currently visible\n     *  - offset - value from range [0,1) describing stage between page transitions.\n     *    Value x means that (1 - x) fraction of the page at \"position\" index is\n     *    visible, and x fraction of the next page is visible.\n     */\n    onPageScroll: PropTypes.func,\n\n    /**\n     * Function called when the page scrolling state has changed.\n     * The page scrolling state can be in 3 states:\n     * - idle, meaning there is no interaction with the page scroller happening at the time\n     * - dragging, meaning there is currently an interaction with the page scroller\n     * - settling, meaning that there was an interaction with the page scroller, and the\n     *   page scroller is now finishing it's closing or opening animation\n     */\n    onPageScrollStateChanged: PropTypes.func,\n\n    /**\n     * This callback will be called once ViewPager finish navigating to selected page\n     * (when user swipes between pages). The `event.nativeEvent` object passed to this\n     * callback will have following fields:\n     *  - position - index of page that has been selected\n     */\n    onPageSelected: PropTypes.func,\n\n    /**\n     * Blank space to show between pages. This is only visible while scrolling, pages are still\n     * edge-to-edge.\n     */\n    pageMargin: PropTypes.number,\n\n    /**\n     * Determines whether the keyboard gets dismissed in response to a drag.\n     *   - 'none' (the default), drags do not dismiss the keyboard.\n     *   - 'on-drag', the keyboard is dismissed when a drag begins.\n     */\n    keyboardDismissMode: PropTypes.oneOf([\n      'none', // default\n      'on-drag',\n    ]),\n\n    /**\n    * When false, the content does not scroll.\n    * The default value is true.\n    */\n    scrollEnabled: PropTypes.bool,\n\n    /**\n     * Whether enable showing peekFraction or not. If this is true, the preview of\n     * last and next page will show in current screen. Defaults to false.\n     */\n     peekEnabled: PropTypes.bool,\n  };\n\n  componentDidMount() {\n    if (this.props.initialPage != null) {\n      this.setPageWithoutAnimation(this.props.initialPage);\n    }\n  }\n\n  getInnerViewNode = (): ReactComponent => {\n    return this.refs[VIEWPAGER_REF].getInnerViewNode();\n  };\n\n  _childrenWithOverridenStyle = (): Array => {\n    // Override styles so that each page will fill the parent. Native component\n    // will handle positioning of elements, so it's not important to offset\n    // them correctly.\n    return React.Children.map(this.props.children, function(child) {\n      if (!child) {\n        return null;\n      }\n      var newProps = {\n        ...child.props,\n        style: [child.props.style, {\n          position: 'absolute',\n          left: 0,\n          top: 0,\n          right: 0,\n          bottom: 0,\n          width: undefined,\n          height: undefined,\n        }],\n        collapsable: false,\n      };\n      if (child.type &&\n          child.type.displayName &&\n          (child.type.displayName !== 'RCTView') &&\n          (child.type.displayName !== 'View')) {\n        console.warn('Each ViewPager child must be a <View>. Was ' + child.type.displayName);\n      }\n      return React.createElement(child.type, newProps);\n    });\n  };\n\n  _onPageScroll = (e: Event) => {\n    if (this.props.onPageScroll) {\n      this.props.onPageScroll(e);\n    }\n    if (this.props.keyboardDismissMode === 'on-drag') {\n      dismissKeyboard();\n    }\n  };\n\n  _onPageScrollStateChanged = (e: Event) => {\n    if (this.props.onPageScrollStateChanged) {\n      this.props.onPageScrollStateChanged(e.nativeEvent.pageScrollState);\n    }\n  };\n\n  _onPageSelected = (e: Event) => {\n    if (this.props.onPageSelected) {\n      this.props.onPageSelected(e);\n    }\n  };\n\n  /**\n   * A helper function to scroll to a specific page in the ViewPager.\n   * The transition between pages will be animated.\n   */\n  setPage = (selectedPage: number) => {\n    UIManager.dispatchViewManagerCommand(\n      ReactNative.findNodeHandle(this),\n      UIManager.AndroidViewPager.Commands.setPage,\n      [selectedPage],\n    );\n  };\n\n  /**\n   * A helper function to scroll to a specific page in the ViewPager.\n   * The transition between pages will *not* be animated.\n   */\n  setPageWithoutAnimation = (selectedPage: number) => {\n    UIManager.dispatchViewManagerCommand(\n      ReactNative.findNodeHandle(this),\n      UIManager.AndroidViewPager.Commands.setPageWithoutAnimation,\n      [selectedPage],\n    );\n  };\n\n  render() {\n    return (\n      <NativeAndroidViewPager\n        {...this.props}\n        ref={VIEWPAGER_REF}\n        style={this.props.style}\n        onPageScroll={this._onPageScroll}\n        onPageScrollStateChanged={this._onPageScrollStateChanged}\n        onPageSelected={this._onPageSelected}\n        children={this._childrenWithOverridenStyle()}\n      />\n    );\n  }\n}\n\nvar NativeAndroidViewPager = requireNativeComponent('AndroidViewPager', ViewPagerAndroid);\n\nmodule.exports = ViewPagerAndroid;\n"
  },
  {
    "path": "Libraries/Components/ViewPager/ViewPagerAndroid.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ViewPagerAndroid\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/ViewPager/ViewPagerAndroid.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ViewPagerAndroid\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/Components/WebView/WebView.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule WebView\n */\n'use strict';\n\nvar EdgeInsetsPropType = require('EdgeInsetsPropType');\nvar ActivityIndicator = require('ActivityIndicator');\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar ReactNative = require('ReactNative');\nvar StyleSheet = require('StyleSheet');\nvar UIManager = require('UIManager');\nvar View = require('View');\nvar ViewPropTypes = require('ViewPropTypes');\n\nvar deprecatedPropType = require('deprecatedPropType');\nvar keyMirror = require('fbjs/lib/keyMirror');\nvar requireNativeComponent = require('requireNativeComponent');\nvar resolveAssetSource = require('resolveAssetSource');\n\nvar RCT_WEBVIEW_REF = 'webview';\n\nvar WebViewState = keyMirror({\n  IDLE: null,\n  LOADING: null,\n  ERROR: null,\n});\n\nvar defaultRenderLoading = () => (\n  <View style={styles.loadingView}>\n    <ActivityIndicator\n      style={styles.loadingProgressBar}\n    />\n  </View>\n);\n\n/**\n * Renders a native WebView.\n */\nclass WebView extends React.Component {\n  static get extraNativeComponentConfig() {\n    return {\n      nativeOnly: {\n        messagingEnabled: PropTypes.bool,\n      },\n    };\n  }\n\n  static propTypes = {\n    ...ViewPropTypes,\n    renderError: PropTypes.func,\n    renderLoading: PropTypes.func,\n    onLoad: PropTypes.func,\n    onLoadEnd: PropTypes.func,\n    onLoadStart: PropTypes.func,\n    onError: PropTypes.func,\n    automaticallyAdjustContentInsets: PropTypes.bool,\n    contentInset: EdgeInsetsPropType,\n    onNavigationStateChange: PropTypes.func,\n    onMessage: PropTypes.func,\n    onContentSizeChange: PropTypes.func,\n    startInLoadingState: PropTypes.bool, // force WebView to show loadingView on first load\n    style: ViewPropTypes.style,\n\n    html: deprecatedPropType(\n      PropTypes.string,\n      'Use the `source` prop instead.'\n    ),\n\n    url: deprecatedPropType(\n      PropTypes.string,\n      'Use the `source` prop instead.'\n    ),\n\n    /**\n     * Loads static html or a uri (with optional headers) in the WebView.\n     */\n    source: PropTypes.oneOfType([\n      PropTypes.shape({\n        /*\n         * The URI to load in the WebView. Can be a local or remote file.\n         */\n        uri: PropTypes.string,\n        /*\n         * The HTTP Method to use. Defaults to GET if not specified.\n         * NOTE: On Android, only GET and POST are supported.\n         */\n        method: PropTypes.oneOf(['GET', 'POST']),\n        /*\n         * Additional HTTP headers to send with the request.\n         * NOTE: On Android, this can only be used with GET requests.\n         */\n        headers: PropTypes.object,\n        /*\n         * 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         * NOTE: On Android, this can only be used with POST requests.\n         */\n        body: PropTypes.string,\n      }),\n      PropTypes.shape({\n        /*\n         * A static HTML page to display in the WebView.\n         */\n        html: PropTypes.string,\n        /*\n         * The base URL to be used for any relative links in the HTML.\n         */\n        baseUrl: PropTypes.string,\n      }),\n      /*\n       * Used internally by packager.\n       */\n      PropTypes.number,\n    ]),\n\n    /**\n     * Used on Android only, JS is enabled by default for WebView on iOS\n     * @platform android\n     */\n    javaScriptEnabled: PropTypes.bool,\n\n    /**\n     * Used on Android Lollipop and above only, third party cookies are enabled\n     * by default for WebView on Android Kitkat and below and on iOS\n     * @platform android\n     */\n    thirdPartyCookiesEnabled: PropTypes.bool,\n\n    /**\n     * Used on Android only, controls whether DOM Storage is enabled or not\n     * @platform android\n     */\n    domStorageEnabled: PropTypes.bool,\n\n    /**\n     * Sets the JS to be injected when the webpage loads.\n     */\n    injectedJavaScript: PropTypes.string,\n\n    /**\n     * Sets whether the webpage scales to fit the view and the user can change the scale.\n     */\n    scalesPageToFit: PropTypes.bool,\n\n    /**\n     * Sets the user-agent for this WebView. The user-agent can also be set in native using\n     * WebViewConfig. This prop will overwrite that config.\n     */\n    userAgent: PropTypes.string,\n\n    /**\n     * Used to locate this view in end-to-end tests.\n     */\n    testID: PropTypes.string,\n\n    /**\n     * Determines whether HTML5 audio & videos require the user to tap before they can\n     * start playing. The default value is `false`.\n     */\n    mediaPlaybackRequiresUserAction: PropTypes.bool,\n\n    /**\n     * Boolean that sets whether JavaScript running in the context of a file\n     * scheme URL should be allowed to access content from any origin.\n     * Including accessing content from other file scheme URLs\n     * @platform android\n     */\n    allowUniversalAccessFromFileURLs: PropTypes.bool,\n\n    /**\n     * Function that accepts a string that will be passed to the WebView and\n     * executed immediately as JavaScript.\n     */\n    injectJavaScript: PropTypes.func,\n\n    /**\n     * Specifies the mixed content mode. i.e WebView will allow a secure origin to load content from any other origin.\n     *\n     * Possible values for `mixedContentMode` are:\n     *\n     * - `'never'` (default) - WebView will not allow a secure origin to load content from an insecure origin.\n     * - `'always'` - WebView will allow a secure origin to load content from any other origin, even if that origin is insecure.\n     * - `'compatibility'` -  WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.\n     * @platform android\n     */\n    mixedContentMode: PropTypes.oneOf([\n      'never',\n      'always',\n      'compatibility'\n    ]),\n\n    /**\n     * Used on Android only, controls whether form autocomplete data should be saved\n     * @platform android\n     */\n    saveFormDataDisabled: PropTypes.bool,\n\n    /**\n     * Override the native component used to render the WebView. Enables a custom native\n     * WebView which uses the same JavaScript as the original WebView.\n     */\n    nativeConfig: PropTypes.shape({\n      /*\n       * The native component used to render the WebView.\n       */\n      component: PropTypes.any,\n      /*\n       * Set props directly on the native component WebView. Enables custom props which the\n       * original WebView doesn't pass through.\n       */\n      props: PropTypes.object,\n      /*\n       * Set the ViewManager to use for communcation with the native side.\n       * @platform ios\n       */\n      viewManager: PropTypes.object,\n    }),\n    /*\n     * Used on Android only, controls whether the given list of URL prefixes should\n     * make {@link com.facebook.react.views.webview.ReactWebViewClient} to launch a\n     * default activity intent for those URL instead of loading it within the webview.\n     * Use this to list URLs that WebView cannot handle, e.g. a PDF url.\n     * @platform android\n     */\n    urlPrefixesForDefaultIntent: PropTypes.arrayOf(PropTypes.string),\n  };\n\n  static defaultProps = {\n    javaScriptEnabled : true,\n    thirdPartyCookiesEnabled: true,\n    scalesPageToFit: true,\n    saveFormDataDisabled: false\n  };\n\n  state = {\n    viewState: WebViewState.IDLE,\n    lastErrorEvent: null,\n    startInLoadingState: true,\n  };\n\n  componentWillMount() {\n    if (this.props.startInLoadingState) {\n      this.setState({viewState: WebViewState.LOADING});\n    }\n  }\n\n  render() {\n    var otherView = null;\n\n   if (this.state.viewState === WebViewState.LOADING) {\n      otherView = (this.props.renderLoading || defaultRenderLoading)();\n    } else if (this.state.viewState === WebViewState.ERROR) {\n      var errorEvent = this.state.lastErrorEvent;\n      otherView = this.props.renderError && this.props.renderError(\n        errorEvent.domain,\n        errorEvent.code,\n        errorEvent.description);\n    } else if (this.state.viewState !== WebViewState.IDLE) {\n      console.error('RCTWebView invalid state encountered: ' + this.state.loading);\n    }\n\n    var webViewStyles = [styles.container, this.props.style];\n    if (this.state.viewState === WebViewState.LOADING ||\n      this.state.viewState === WebViewState.ERROR) {\n      // if we're in either LOADING or ERROR states, don't show the webView\n      webViewStyles.push(styles.hidden);\n    }\n\n    var source = this.props.source || {};\n    if (this.props.html) {\n      source.html = this.props.html;\n    } else if (this.props.url) {\n      source.uri = this.props.url;\n    }\n\n    if (source.method === 'POST' && source.headers) {\n      console.warn('WebView: `source.headers` is not supported when using POST.');\n    } else if (source.method === 'GET' && source.body) {\n      console.warn('WebView: `source.body` is not supported when using GET.');\n    }\n\n    const nativeConfig = this.props.nativeConfig || {};\n\n    let NativeWebView = nativeConfig.component || RCTWebView;\n\n    var webView =\n      <NativeWebView\n        ref={RCT_WEBVIEW_REF}\n        key=\"webViewKey\"\n        style={webViewStyles}\n        source={resolveAssetSource(source)}\n        scalesPageToFit={this.props.scalesPageToFit}\n        injectedJavaScript={this.props.injectedJavaScript}\n        userAgent={this.props.userAgent}\n        javaScriptEnabled={this.props.javaScriptEnabled}\n        thirdPartyCookiesEnabled={this.props.thirdPartyCookiesEnabled}\n        domStorageEnabled={this.props.domStorageEnabled}\n        messagingEnabled={typeof this.props.onMessage === 'function'}\n        onMessage={this.onMessage}\n        contentInset={this.props.contentInset}\n        automaticallyAdjustContentInsets={this.props.automaticallyAdjustContentInsets}\n        onContentSizeChange={this.props.onContentSizeChange}\n        onLoadingStart={this.onLoadingStart}\n        onLoadingFinish={this.onLoadingFinish}\n        onLoadingError={this.onLoadingError}\n        testID={this.props.testID}\n        mediaPlaybackRequiresUserAction={this.props.mediaPlaybackRequiresUserAction}\n        allowUniversalAccessFromFileURLs={this.props.allowUniversalAccessFromFileURLs}\n        mixedContentMode={this.props.mixedContentMode}\n        saveFormDataDisabled={this.props.saveFormDataDisabled}\n        urlPrefixesForDefaultIntent={this.props.urlPrefixesForDefaultIntent}\n        {...nativeConfig.props}\n      />;\n\n    return (\n      <View style={styles.container}>\n        {webView}\n        {otherView}\n      </View>\n    );\n  }\n\n  goForward = () => {\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.goForward,\n      null\n    );\n  };\n\n  goBack = () => {\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.goBack,\n      null\n    );\n  };\n\n  reload = () => {\n    this.setState({\n      viewState: WebViewState.LOADING\n    });\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.reload,\n      null\n    );\n  };\n\n  stopLoading = () => {\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.stopLoading,\n      null\n    );\n  };\n\n  postMessage = (data) => {\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.postMessage,\n      [String(data)]\n    );\n  };\n\n  /**\n  * Injects a javascript string into the referenced WebView. Deliberately does not\n  * return a response because using eval() to return a response breaks this method\n  * on pages with a Content Security Policy that disallows eval(). If you need that\n  * functionality, look into postMessage/onMessage.\n  */\n  injectJavaScript = (data) => {\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.injectJavaScript,\n      [data]\n    );\n  };\n\n  /**\n   * We return an event with a bunch of fields including:\n   *  url, title, loading, canGoBack, canGoForward\n   */\n  updateNavigationState = (event) => {\n    if (this.props.onNavigationStateChange) {\n      this.props.onNavigationStateChange(event.nativeEvent);\n    }\n  };\n\n  getWebViewHandle = () => {\n    return ReactNative.findNodeHandle(this.refs[RCT_WEBVIEW_REF]);\n  };\n\n  onLoadingStart = (event) => {\n    var onLoadStart = this.props.onLoadStart;\n    onLoadStart && onLoadStart(event);\n    this.updateNavigationState(event);\n  };\n\n  onLoadingError = (event) => {\n    event.persist(); // persist this event because we need to store it\n    var {onError, onLoadEnd} = this.props;\n    onError && onError(event);\n    onLoadEnd && onLoadEnd(event);\n    console.warn('Encountered an error loading page', event.nativeEvent);\n\n    this.setState({\n      lastErrorEvent: event.nativeEvent,\n      viewState: WebViewState.ERROR\n    });\n  };\n\n  onLoadingFinish = (event) => {\n    var {onLoad, onLoadEnd} = this.props;\n    onLoad && onLoad(event);\n    onLoadEnd && onLoadEnd(event);\n    this.setState({\n      viewState: WebViewState.IDLE,\n    });\n    this.updateNavigationState(event);\n  };\n\n  onMessage = (event: Event) => {\n    var {onMessage} = this.props;\n    onMessage && onMessage(event);\n  }\n}\n\nvar RCTWebView = requireNativeComponent('RCTWebView', WebView, WebView.extraNativeComponentConfig);\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  hidden: {\n    height: 0,\n    flex: 0, // disable 'flex:1' when hiding a View\n  },\n  loadingView: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n  },\n  loadingProgressBar: {\n    height: 20,\n  },\n});\n\nmodule.exports = WebView;\n"
  },
  {
    "path": "Libraries/Components/WebView/WebView.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule WebView\n * @noflow\n */\n'use strict';\n\nvar ActivityIndicator = require('ActivityIndicator');\nvar EdgeInsetsPropType = require('EdgeInsetsPropType');\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar ReactNative = require('ReactNative');\nvar StyleSheet = require('StyleSheet');\nvar Text = require('Text');\nvar UIManager = require('UIManager');\nvar View = require('View');\nvar ViewPropTypes = require('ViewPropTypes');\nvar ScrollView = require('ScrollView');\n\nvar deprecatedPropType = require('deprecatedPropType');\nvar invariant = require('fbjs/lib/invariant');\nvar keyMirror = require('fbjs/lib/keyMirror');\nvar requireNativeComponent = require('requireNativeComponent');\nvar resolveAssetSource = require('resolveAssetSource');\n\nvar RCTWebViewManager = require('NativeModules').WebViewManager;\n\nvar BGWASH = 'rgba(255,255,255,0.8)';\nvar RCT_WEBVIEW_REF = 'webview';\n\nvar WebViewState = keyMirror({\n  IDLE: null,\n  LOADING: null,\n  ERROR: null,\n});\n\nconst NavigationType = keyMirror({\n  click: true,\n  formsubmit: true,\n  backforward: true,\n  reload: true,\n  formresubmit: true,\n  other: true,\n});\n\nconst JSNavigationScheme = 'react-js-navigation';\n\ntype ErrorEvent = {\n  domain: any,\n  code: any,\n  description: any,\n}\n\ntype Event = Object;\n\nconst DataDetectorTypes = [\n  'phoneNumber',\n  'link',\n  'address',\n  'calendarEvent',\n  'none',\n  'all',\n];\n\nvar defaultRenderLoading = () => (\n  <View style={styles.loadingView}>\n    <ActivityIndicator />\n  </View>\n);\nvar defaultRenderError = (errorDomain, errorCode, errorDesc) => (\n  <View style={styles.errorContainer}>\n    <Text style={styles.errorTextTitle}>\n      Error loading page\n    </Text>\n    <Text style={styles.errorText}>\n      {'Domain: ' + errorDomain}\n    </Text>\n    <Text style={styles.errorText}>\n      {'Error Code: ' + errorCode}\n    </Text>\n    <Text style={styles.errorText}>\n      {'Description: ' + errorDesc}\n    </Text>\n  </View>\n);\n\n/**\n * `WebView` renders web content in a native view.\n *\n *```\n * import React, { Component } from 'react';\n * import { WebView } from 'react-native';\n *\n * class MyWeb extends Component {\n *   render() {\n *     return (\n *       <WebView\n *         source={{uri: 'https://github.com/facebook/react-native'}}\n *         style={{marginTop: 20}}\n *       />\n *     );\n *   }\n * }\n *```\n *\n * You can use this component to navigate back and forth in the web view's\n * history and configure various properties for the web content.\n */\nclass WebView extends React.Component {\n  static JSNavigationScheme = JSNavigationScheme;\n  static NavigationType = NavigationType;\n  static get extraNativeComponentConfig() {\n    return {\n      nativeOnly: {\n        onLoadingStart: true,\n        onLoadingError: true,\n        onLoadingFinish: true,\n        onMessage: true,\n        messagingEnabled: PropTypes.bool,\n      },\n    };\n  }\n\n  static propTypes = {\n    ...ViewPropTypes,\n\n    html: deprecatedPropType(\n      PropTypes.string,\n      'Use the `source` prop instead.'\n    ),\n\n    url: deprecatedPropType(\n      PropTypes.string,\n      'Use the `source` prop instead.'\n    ),\n\n    /**\n     * Loads static html or a uri (with optional headers) in the WebView.\n     */\n    source: PropTypes.oneOfType([\n      PropTypes.shape({\n        /*\n         * The URI to load in the `WebView`. Can be a local or remote file.\n         */\n        uri: PropTypes.string,\n        /*\n         * The HTTP Method to use. Defaults to GET if not specified.\n         * NOTE: On Android, only GET and POST are supported.\n         */\n        method: PropTypes.string,\n        /*\n         * Additional HTTP headers to send with the request.\n         * NOTE: On Android, this can only be used with GET requests.\n         */\n        headers: PropTypes.object,\n        /*\n         * 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         * NOTE: On Android, this can only be used with POST requests.\n         */\n        body: PropTypes.string,\n      }),\n      PropTypes.shape({\n        /*\n         * A static HTML page to display in the WebView.\n         */\n        html: PropTypes.string,\n        /*\n         * The base URL to be used for any relative links in the HTML.\n         */\n        baseUrl: PropTypes.string,\n      }),\n      /*\n       * Used internally by packager.\n       */\n      PropTypes.number,\n    ]),\n\n    /**\n     * Function that returns a view to show if there's an error.\n     */\n    renderError: PropTypes.func, // view to show if there's an error\n    /**\n     * Function that returns a loading indicator.\n     */\n    renderLoading: PropTypes.func,\n    /**\n     * Function that is invoked when the `WebView` has finished loading.\n     */\n    onLoad: PropTypes.func,\n    /**\n     * Function that is invoked when the `WebView` load succeeds or fails.\n     */\n    onLoadEnd: PropTypes.func,\n    /**\n     * Function that is invoked when the `WebView` starts loading.\n     */\n    onLoadStart: PropTypes.func,\n    /**\n     * Function that is invoked when the `WebView` load fails.\n     */\n    onError: PropTypes.func,\n    /**\n     * Boolean value that determines whether the web view bounces\n     * when it reaches the edge of the content. The default value is `true`.\n     * @platform ios\n     */\n    bounces: PropTypes.bool,\n    /**\n     * A floating-point number that determines how quickly the scroll view\n     * decelerates after the user lifts their finger. You may also use the\n     * string shortcuts `\"normal\"` and `\"fast\"` which match the underlying iOS\n     * settings for `UIScrollViewDecelerationRateNormal` and\n     * `UIScrollViewDecelerationRateFast` respectively:\n     *\n     *   - normal: 0.998\n     *   - fast: 0.99 (the default for iOS web view)\n     * @platform ios\n     */\n    decelerationRate: ScrollView.propTypes.decelerationRate,\n    /**\n     * Boolean value that determines whether scrolling is enabled in the\n     * `WebView`. The default value is `true`.\n     * @platform ios\n     */\n    scrollEnabled: PropTypes.bool,\n    /**\n     * Controls whether to adjust the content inset for web views that are\n     * placed behind a navigation bar, tab bar, or toolbar. The default value\n     * is `true`.\n     */\n    automaticallyAdjustContentInsets: PropTypes.bool,\n    /**\n     * The amount by which the web view content is inset from the edges of\n     * the scroll view. Defaults to {top: 0, left: 0, bottom: 0, right: 0}.\n     * @platform ios\n     */\n    contentInset: EdgeInsetsPropType,\n    /**\n     * Function that is invoked when the `WebView` loading starts or ends.\n     */\n    onNavigationStateChange: PropTypes.func,\n    /**\n     * A function that is invoked when the webview calls `window.postMessage`.\n     * Setting this property will inject a `postMessage` global into your\n     * webview, but will still call pre-existing values of `postMessage`.\n     *\n     * `window.postMessage` accepts one argument, `data`, which will be\n     * available on the event object, `event.nativeEvent.data`. `data`\n     * must be a string.\n     */\n    onMessage: PropTypes.func,\n    /**\n     * Boolean value that forces the `WebView` to show the loading view\n     * on the first load.\n     */\n    startInLoadingState: PropTypes.bool,\n    /**\n     * The style to apply to the `WebView`.\n     */\n    style: ViewPropTypes.style,\n\n    /**\n     * Determines the types of data converted to clickable URLs in the web view's content.\n     * By default only phone numbers are detected.\n     *\n     * You can provide one type or an array of many types.\n     *\n     * Possible values for `dataDetectorTypes` are:\n     *\n     * - `'phoneNumber'`\n     * - `'link'`\n     * - `'address'`\n     * - `'calendarEvent'`\n     * - `'none'`\n     * - `'all'`\n     *\n     * @platform ios\n     */\n    dataDetectorTypes: PropTypes.oneOfType([\n      PropTypes.oneOf(DataDetectorTypes),\n      PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes)),\n    ]),\n\n    /**\n     * Boolean value to enable JavaScript in the `WebView`. Used on Android only\n     * as JavaScript is enabled by default on iOS. The default value is `true`.\n     * @platform android\n     */\n    javaScriptEnabled: PropTypes.bool,\n\n    /**\n     * Boolean value to enable third party cookies in the `WebView`. Used on\n     * Android Lollipop and above only as third party cookies are enabled by\n     * default on Android Kitkat and below and on iOS. The default value is `true`.\n     * @platform android\n     */\n    thirdPartyCookiesEnabled: PropTypes.bool,\n\n    /**\n     * Boolean value to control whether DOM Storage is enabled. Used only in\n     * Android.\n     * @platform android\n     */\n    domStorageEnabled: PropTypes.bool,\n\n    /**\n     * Set this to provide JavaScript that will be injected into the web page\n     * when the view loads.\n     */\n    injectedJavaScript: PropTypes.string,\n\n    /**\n     * Sets the user-agent for the `WebView`.\n     * @platform android\n     */\n    userAgent: PropTypes.string,\n\n    /**\n     * Boolean that controls whether the web content is scaled to fit\n     * the view and enables the user to change the scale. The default value\n     * is `true`.\n     */\n    scalesPageToFit: PropTypes.bool,\n\n    /**\n     * Function that allows custom handling of any web view requests. Return\n     * `true` from the function to continue loading the request and `false`\n     * to stop loading.\n     * @platform ios\n     */\n    onShouldStartLoadWithRequest: PropTypes.func,\n\n    /**\n     * Boolean that determines whether HTML5 videos play inline or use the\n     * native full-screen controller. The default value is `false`.\n     *\n     * **NOTE** : In order for video to play inline, not only does this\n     * property need to be set to `true`, but the video element in the HTML\n     * document must also include the `webkit-playsinline` attribute.\n     * @platform ios\n     */\n    allowsInlineMediaPlayback: PropTypes.bool,\n\n    /**\n     * Boolean that determines whether HTML5 audio and video requires the user\n     * to tap them before they start playing. The default value is `true`.\n     */\n    mediaPlaybackRequiresUserAction: PropTypes.bool,\n\n    /**\n     * Function that accepts a string that will be passed to the WebView and\n     * executed immediately as JavaScript.\n     */\n    injectJavaScript: PropTypes.func,\n\n    /**\n     * Specifies the mixed content mode. i.e WebView will allow a secure origin to load content from any other origin.\n     *\n     * Possible values for `mixedContentMode` are:\n     *\n     * - `'never'` (default) - WebView will not allow a secure origin to load content from an insecure origin.\n     * - `'always'` - WebView will allow a secure origin to load content from any other origin, even if that origin is insecure.\n     * - `'compatibility'` -  WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.\n     * @platform android\n     */\n    mixedContentMode: PropTypes.oneOf([\n      'never',\n      'always',\n      'compatibility'\n    ]),\n\n    /**\n     * Override the native component used to render the WebView. Enables a custom native\n     * WebView which uses the same JavaScript as the original WebView.\n     */\n    nativeConfig: PropTypes.shape({\n      /*\n       * The native component used to render the WebView.\n       */\n      component: PropTypes.any,\n      /*\n       * Set props directly on the native component WebView. Enables custom props which the\n       * original WebView doesn't pass through.\n       */\n      props: PropTypes.object,\n      /*\n       * Set the ViewManager to use for communcation with the native side.\n       * @platform ios\n       */\n      viewManager: PropTypes.object,\n    }),\n  };\n\n  static defaultProps = {\n    scalesPageToFit: true,\n  };\n\n  state = {\n    viewState: WebViewState.IDLE,\n    lastErrorEvent: (null: ?ErrorEvent),\n    startInLoadingState: true,\n  };\n\n  componentWillMount() {\n    if (this.props.startInLoadingState) {\n      this.setState({viewState: WebViewState.LOADING});\n    }\n  }\n\n  render() {\n    var otherView = null;\n\n    if (this.state.viewState === WebViewState.LOADING) {\n      otherView = (this.props.renderLoading || defaultRenderLoading)();\n    } else if (this.state.viewState === WebViewState.ERROR) {\n      var errorEvent = this.state.lastErrorEvent;\n      invariant(\n        errorEvent != null,\n        'lastErrorEvent expected to be non-null'\n      );\n      otherView = (this.props.renderError || defaultRenderError)(\n        errorEvent.domain,\n        errorEvent.code,\n        errorEvent.description\n      );\n    } else if (this.state.viewState !== WebViewState.IDLE) {\n      console.error(\n        'RCTWebView invalid state encountered: ' + this.state.loading\n      );\n    }\n\n    var webViewStyles = [styles.container, styles.webView, this.props.style];\n    if (this.state.viewState === WebViewState.LOADING ||\n      this.state.viewState === WebViewState.ERROR) {\n      // if we're in either LOADING or ERROR states, don't show the webView\n      webViewStyles.push(styles.hidden);\n    }\n\n    const nativeConfig = this.props.nativeConfig || {};\n\n    const viewManager = nativeConfig.viewManager || RCTWebViewManager;\n\n    var onShouldStartLoadWithRequest = this.props.onShouldStartLoadWithRequest && ((event: Event) => {\n      var shouldStart = this.props.onShouldStartLoadWithRequest &&\n        this.props.onShouldStartLoadWithRequest(event.nativeEvent);\n      viewManager.startLoadWithResult(!!shouldStart, event.nativeEvent.lockIdentifier);\n    });\n\n    var source = this.props.source || {};\n    if (this.props.html) {\n      source.html = this.props.html;\n    } else if (this.props.url) {\n      source.uri = this.props.url;\n    }\n\n    const messagingEnabled = typeof this.props.onMessage === 'function';\n\n    const NativeWebView = nativeConfig.component || RCTWebView;\n\n    var webView =\n      <NativeWebView\n        ref={RCT_WEBVIEW_REF}\n        key=\"webViewKey\"\n        style={webViewStyles}\n        source={resolveAssetSource(source)}\n        injectedJavaScript={this.props.injectedJavaScript}\n        bounces={this.props.bounces}\n        scrollEnabled={this.props.scrollEnabled}\n        contentInset={this.props.contentInset}\n        automaticallyAdjustContentInsets={this.props.automaticallyAdjustContentInsets}\n        onLoadingStart={this._onLoadingStart}\n        onLoadingFinish={this._onLoadingFinish}\n        onLoadingError={this._onLoadingError}\n        messagingEnabled={messagingEnabled}\n        onMessage={this._onMessage}\n        onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}\n        scalesPageToFit={this.props.scalesPageToFit}\n        allowsInlineMediaPlayback={this.props.allowsInlineMediaPlayback}\n        mediaPlaybackRequiresUserAction={this.props.mediaPlaybackRequiresUserAction}\n        dataDetectorTypes={this.props.dataDetectorTypes}\n        {...nativeConfig.props}\n      />;\n\n    return (\n      <View style={styles.container}>\n        {webView}\n        {otherView}\n      </View>\n    );\n  }\n\n  /**\n   * Go forward one page in the web view's history.\n   */\n  goForward = () => {\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.goForward,\n      null\n    );\n  };\n\n  /**\n   * Go back one page in the web view's history.\n   */\n  goBack = () => {\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.goBack,\n      null\n    );\n  };\n\n  /**\n   * Reloads the current page.\n   */\n  reload = () => {\n    this.setState({viewState: WebViewState.LOADING});\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.reload,\n      null\n    );\n  };\n\n  /**\n   * Stop loading the current page.\n   */\n  stopLoading = () => {\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.stopLoading,\n      null\n    );\n  };\n\n  /**\n   * Posts a message to the web view, which will emit a `message` event.\n   * Accepts one argument, `data`, which must be a string.\n   *\n   * In your webview, you'll need to something like the following.\n   *\n   * ```js\n   * document.addEventListener('message', e => { document.title = e.data; });\n   * ```\n   */\n  postMessage = (data) => {\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.postMessage,\n      [String(data)]\n    );\n  };\n\n  /**\n  * Injects a javascript string into the referenced WebView. Deliberately does not\n  * return a response because using eval() to return a response breaks this method\n  * on pages with a Content Security Policy that disallows eval(). If you need that\n  * functionality, look into postMessage/onMessage.\n  */\n  injectJavaScript = (data) => {\n    UIManager.dispatchViewManagerCommand(\n      this.getWebViewHandle(),\n      UIManager.RCTWebView.Commands.injectJavaScript,\n      [data]\n    );\n  };\n\n  /**\n   * We return an event with a bunch of fields including:\n   *  url, title, loading, canGoBack, canGoForward\n   */\n  _updateNavigationState = (event: Event) => {\n    if (this.props.onNavigationStateChange) {\n      this.props.onNavigationStateChange(event.nativeEvent);\n    }\n  };\n\n  /**\n   * Returns the native `WebView` node.\n   */\n  getWebViewHandle = (): any => {\n    return ReactNative.findNodeHandle(this.refs[RCT_WEBVIEW_REF]);\n  };\n\n  _onLoadingStart = (event: Event) => {\n    var onLoadStart = this.props.onLoadStart;\n    onLoadStart && onLoadStart(event);\n    this._updateNavigationState(event);\n  };\n\n  _onLoadingError = (event: Event) => {\n    event.persist(); // persist this event because we need to store it\n    var {onError, onLoadEnd} = this.props;\n    onError && onError(event);\n    onLoadEnd && onLoadEnd(event);\n    console.warn('Encountered an error loading page', event.nativeEvent);\n\n    this.setState({\n      lastErrorEvent: event.nativeEvent,\n      viewState: WebViewState.ERROR\n    });\n  };\n\n  _onLoadingFinish = (event: Event) => {\n    var {onLoad, onLoadEnd} = this.props;\n    onLoad && onLoad(event);\n    onLoadEnd && onLoadEnd(event);\n    this.setState({\n      viewState: WebViewState.IDLE,\n    });\n    this._updateNavigationState(event);\n  };\n\n  _onMessage = (event: Event) => {\n    var {onMessage} = this.props;\n    onMessage && onMessage(event);\n  }\n}\n\nvar RCTWebView = requireNativeComponent('RCTWebView', WebView, WebView.extraNativeComponentConfig);\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  errorContainer: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: BGWASH,\n  },\n  errorText: {\n    fontSize: 14,\n    textAlign: 'center',\n    marginBottom: 2,\n  },\n  errorTextTitle: {\n    fontSize: 15,\n    fontWeight: '500',\n    marginBottom: 10,\n  },\n  hidden: {\n    height: 0,\n    flex: 0, // disable 'flex:1' when hiding a View\n  },\n  loadingView: {\n    backgroundColor: BGWASH,\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    height: 100,\n  },\n  webView: {\n    backgroundColor: '#ffffff',\n  }\n});\n\nmodule.exports = WebView;\n"
  },
  {
    "path": "Libraries/Core/Devtools/__tests__/parseErrorStack-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\n\nvar parseErrorStack = require('parseErrorStack');\n\nfunction getFakeError() {\n  return new Error('Happy Cat');\n}\n\ndescribe('parseErrorStack', function() {\n\n  it('parses error stack', function() {\n    var stack = parseErrorStack(getFakeError());\n    expect(stack.length).toBeGreaterThan(0);\n\n    var firstFrame = stack[0];\n    expect(firstFrame.methodName).toEqual('getFakeError');\n    expect(firstFrame.file).toMatch(/parseErrorStack-test\\.js$/);\n  });\n\n  it('supports framesToPop', function() {\n    function getWrappedError() {\n      var error = getFakeError();\n      error.framesToPop = 1;\n      return error;\n    }\n\n    // Make sure framesToPop == 1 causes it to ignore getFakeError\n    // stack frame\n    var stack = parseErrorStack(getWrappedError());\n    expect(stack[0].methodName).toEqual('getWrappedError');\n  });\n\n  it('ignores bad inputs', function() {\n    expect(parseErrorStack({})).toEqual([]);\n    expect(parseErrorStack(null)).toEqual([]);\n  });\n\n});\n"
  },
  {
    "path": "Libraries/Core/Devtools/getDevServer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getDevServer\n * @flow\n */\n'use strict';\n\nconst {SourceCode} = require('NativeModules');\n\nlet _cachedDevServerURL: ?string;\nconst FALLBACK = 'http://localhost:8081/';\n\ntype DevServerInfo = {\n  url: string,\n  bundleLoadedFromServer: boolean,\n};\n\n/**\n * Many RN development tools rely on the development server (packager) running\n * @return URL to packager with trailing slash\n */\nfunction getDevServer(): DevServerInfo {\n  if (_cachedDevServerURL === undefined) {\n    const match = SourceCode.scriptURL && SourceCode.scriptURL.match(/^https?:\\/\\/.*?\\//);\n    _cachedDevServerURL = match ? match[0] : null;\n  }\n\n  return {\n    url: _cachedDevServerURL || FALLBACK,\n    bundleLoadedFromServer: _cachedDevServerURL !== null,\n  };\n}\n\nmodule.exports = getDevServer;\n"
  },
  {
    "path": "Libraries/Core/Devtools/openFileInEditor.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule openFileInEditor\n * @flow\n */\n'use strict';\n\nconst getDevServer = require('getDevServer');\n\nfunction openFileInEditor(file: string, lineNumber: number) {\n  fetch(getDevServer().url + 'open-stack-frame', {\n    method: 'POST',\n    body: JSON.stringify({file, lineNumber}),\n  });\n}\n\nmodule.exports = openFileInEditor;\n"
  },
  {
    "path": "Libraries/Core/Devtools/parseErrorStack.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule parseErrorStack\n * @flow\n */\n'use strict';\n\nexport type StackFrame = {\n  column: ?number,\n  file: string,\n  lineNumber: number,\n  methodName: string,\n};\n\nexport type ExtendedError = Error & {\n  framesToPop?: number,\n};\n\nfunction parseErrorStack(e: ExtendedError): Array<StackFrame> {\n  if (!e || !e.stack) {\n    return [];\n  }\n\n  /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an\n   * error found when Flow v0.54 was deployed. To see the error delete this\n   * comment and run Flow. */\n  const stacktraceParser = require('stacktrace-parser');\n  const stack = Array.isArray(e.stack) ? e.stack : stacktraceParser.parse(e.stack);\n\n  let framesToPop = typeof e.framesToPop === 'number' ? e.framesToPop : 0;\n  while (framesToPop--) {\n    stack.shift();\n  }\n  return stack;\n}\n\nmodule.exports = parseErrorStack;\n"
  },
  {
    "path": "Libraries/Core/Devtools/setupDevtools.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule setupDevtools\n * @flow\n */\n'use strict';\n\ntype DevToolsPluginConnection = {\n  isAppActive: () => boolean,\n  host: string,\n  port: number,\n};\n\ntype DevToolsPlugin = {\n  connectToDevTools: (connection: DevToolsPluginConnection) => void,\n};\n\nlet register = function () {\n  // noop\n};\n\nif (__DEV__) {\n  const AppState = require('AppState');\n  const WebSocket = require('WebSocket');\n  /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an\n   * error found when Flow v0.54 was deployed. To see the error delete this\n   * comment and run Flow. */\n  const reactDevTools = require('react-devtools-core');\n  const getDevServer = require('getDevServer');\n\n  // Initialize dev tools only if the native module for WebSocket is available\n  if (WebSocket.isAvailable) {\n    // Don't steal the DevTools from currently active app.\n    // Note: if you add any AppState subscriptions to this file,\n    // you will also need to guard against `AppState.isAvailable`,\n    // or the code will throw for bundles that don't have it.\n    const isAppActive = () => AppState.currentState !== 'background';\n\n    // Get hostname from development server (packager)\n    const devServer = getDevServer();\n    const host = devServer.bundleLoadedFromServer\n      ? devServer.url.replace(/https?:\\/\\//, '').split(':')[0]\n      : 'localhost';\n\n    reactDevTools.connectToDevTools({\n      isAppActive,\n      host,\n      // Read the optional global variable for backward compatibility.\n      // It was added in https://github.com/facebook/react-native/commit/bf2b435322e89d0aeee8792b1c6e04656c2719a0.\n      port: window.__REACT_DEVTOOLS_PORT__,\n      resolveRNStyle: require('flattenStyle'),\n    });\n  }\n}\n\nmodule.exports = {\n  register,\n};\n"
  },
  {
    "path": "Libraries/Core/Devtools/symbolicateStackTrace.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule symbolicateStackTrace\n * @flow\n */\n'use strict';\n\nconst getDevServer = require('getDevServer');\n\nconst {SourceCode} = require('NativeModules');\n\n// Avoid requiring fetch on load of this module; see symbolicateStackTrace\nlet fetch;\n\nimport type {StackFrame} from 'parseErrorStack';\n\nfunction isSourcedFromDisk(sourcePath: string): boolean {\n  return !/^http/.test(sourcePath) && /[\\\\/]/.test(sourcePath);\n}\n\nasync function symbolicateStackTrace(stack: Array<StackFrame>): Promise<Array<StackFrame>> {\n  // RN currently lazy loads whatwg-fetch using a custom fetch module, which,\n  // when called for the first time, requires and re-exports 'whatwg-fetch'.\n  // However, when a dependency of the project tries to require whatwg-fetch\n  // either directly or indirectly, whatwg-fetch is required before\n  // RN can lazy load whatwg-fetch. As whatwg-fetch checks\n  // for a fetch polyfill before loading, it will in turn try to load\n  // RN's fetch module, which immediately tries to import whatwg-fetch AGAIN.\n  // This causes a circular require which results in RN's fetch module\n  // exporting fetch as 'undefined'.\n  // The fix below postpones trying to load fetch until the first call to symbolicateStackTrace.\n  // At that time, we will have either global.fetch (whatwg-fetch) or RN's fetch.\n  if (!fetch) {\n    fetch = global.fetch || require('fetch').fetch;\n  }\n\n  const devServer = getDevServer();\n  if (!devServer.bundleLoadedFromServer) {\n    throw new Error('Bundle was not loaded from the packager');\n  }\n\n  let stackCopy = stack;\n\n  if (SourceCode.scriptURL) {\n    let foundInternalSource: boolean = false;\n    stackCopy = stack.map((frame: StackFrame) => {\n      // If the sources exist on disk rather than appearing to come from the packager,\n      // replace the location with the packager URL until we reach an internal source\n      // which does not have a path (no slashes), indicating a switch from within\n      // the application to a surrounding debugging environment.\n      if (!foundInternalSource && isSourcedFromDisk(frame.file)) {\n        // Copy frame into new object and replace 'file' property\n        return {...frame, file: SourceCode.scriptURL};\n      }\n\n      foundInternalSource = true;\n      return frame;\n    });\n  }\n\n  const response = await fetch(devServer.url + 'symbolicate', {\n    method: 'POST',\n    body: JSON.stringify({stack: stackCopy}),\n  });\n  const json = await response.json();\n  return json.stack;\n}\n\nmodule.exports = symbolicateStackTrace;\n"
  },
  {
    "path": "Libraries/Core/ExceptionsManager.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ExceptionsManager\n * @flow\n */\n'use strict';\n\nimport type {ExtendedError} from 'parseErrorStack';\n\nconst INTERNAL_CALLSITES_REGEX = new RegExp(\n  [\n    '/Libraries/Renderer/oss/ReactNativeRenderer-dev\\\\.js$',\n    '/Libraries/BatchedBridge/MessageQueue\\\\.js$',\n  ].join('|'),\n);\n\n/**\n * Handles the developer-visible aspect of errors and exceptions\n */\nlet exceptionID = 0;\nfunction reportException(e: ExtendedError, isFatal: bool) {\n  const {ExceptionsManager} = require('NativeModules');\n  if (ExceptionsManager) {\n    const parseErrorStack = require('parseErrorStack');\n    const stack = parseErrorStack(e);\n    const currentExceptionID = ++exceptionID;\n    if (isFatal) {\n      ExceptionsManager.reportFatalException(e.message, stack, currentExceptionID);\n    } else {\n      ExceptionsManager.reportSoftException(e.message, stack, currentExceptionID);\n    }\n    if (__DEV__) {\n      const symbolicateStackTrace = require('symbolicateStackTrace');\n      symbolicateStackTrace(stack).then(\n        (prettyStack) => {\n          if (prettyStack) {\n            const stackWithoutInternalCallsites = prettyStack.filter(\n              frame => frame.file.match(INTERNAL_CALLSITES_REGEX) === null,\n            );\n            ExceptionsManager.updateExceptionMessage(\n              e.message,\n              stackWithoutInternalCallsites,\n              currentExceptionID,\n            );\n          } else {\n            throw new Error('The stack is null');\n          }\n        }\n      ).catch(\n        (error) => console.warn('Unable to symbolicate stack trace: ' + error.message)\n      );\n    }\n  }\n}\n\ndeclare var console: typeof console & {\n  _errorOriginal: Function,\n  reportErrorsAsExceptions: boolean,\n};\n\n/**\n * Logs exceptions to the (native) console and displays them\n */\nfunction handleException(e: Error, isFatal: boolean) {\n  // Workaround for reporting errors caused by `throw 'some string'`\n  // Unfortunately there is no way to figure out the stacktrace in this\n  // case, so if you ended up here trying to trace an error, look for\n  // `throw '<error message>'` somewhere in your codebase.\n  if (!e.message) {\n    e = new Error(e);\n  }\n  if (console._errorOriginal) {\n    console._errorOriginal(e.message);\n  } else {\n    console.error(e.message);\n  }\n  reportException(e, isFatal);\n}\n\nfunction reactConsoleErrorHandler() {\n  console._errorOriginal.apply(console, arguments);\n  if (!console.reportErrorsAsExceptions) {\n    return;\n  }\n\n  if (arguments[0] && arguments[0].stack) {\n    reportException(arguments[0], /* isFatal */ false);\n  } else {\n    const stringifySafe = require('stringifySafe');\n    const str = Array.prototype.map.call(arguments, stringifySafe).join(', ');\n    if (str.slice(0, 10) === '\"Warning: ') {\n      // React warnings use console.error so that a stack trace is shown, but\n      // we don't (currently) want these to show a redbox\n      // (Note: Logic duplicated in polyfills/console.js.)\n      return;\n    }\n    const error : ExtendedError = new Error('console.error: ' + str);\n    error.framesToPop = 1;\n    reportException(error, /* isFatal */ false);\n  }\n}\n\n/**\n * Shows a redbox with stacktrace for all console.error messages.  Disable by\n * setting `console.reportErrorsAsExceptions = false;` in your app.\n */\nfunction installConsoleErrorReporter() {\n  // Enable reportErrorsAsExceptions\n  if (console._errorOriginal) {\n    return; // already installed\n  }\n  // Flow doesn't like it when you set arbitrary values on a global object\n  console._errorOriginal = console.error.bind(console);\n  console.error = reactConsoleErrorHandler;\n  if (console.reportErrorsAsExceptions === undefined) {\n    // Individual apps can disable this\n    // Flow doesn't like it when you set arbitrary values on a global object\n    console.reportErrorsAsExceptions = true;\n  }\n}\n\nmodule.exports = { handleException, installConsoleErrorReporter };\n"
  },
  {
    "path": "Libraries/Core/InitializeCore.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule InitializeCore\n * @flow\n */\n\n/* globals window: true */\n\n/**\n * Sets up global variables typical in most JavaScript environments.\n *\n *   1. Global timers (via `setTimeout` etc).\n *   2. Global console object.\n *   3. Hooks for printing stack traces with source maps.\n *\n * Leaves enough room in the environment for implementing your own:\n *\n *   1. Require system.\n *   2. Bridged modules.\n *\n */\n'use strict';\n\nif (global.GLOBAL === undefined) {\n  global.GLOBAL = global;\n}\n\nif (global.window === undefined) {\n  global.window = global;\n}\n\nconst defineLazyObjectProperty = require('defineLazyObjectProperty');\n\n// Set up collections\nconst _shouldPolyfillCollection = require('_shouldPolyfillES6Collection');\nif (_shouldPolyfillCollection('Map')) {\n  polyfillGlobal('Map', () => require('Map'));\n}\nif (_shouldPolyfillCollection('Set')) {\n  polyfillGlobal('Set', () => require('Set'));\n}\n\n/**\n * Sets an object's property. If a property with the same name exists, this will\n * replace it but maintain its descriptor configuration. The property will be\n * replaced with a lazy getter.\n *\n * In DEV mode the original property value will be preserved as `original[PropertyName]`\n * so that, if necessary, it can be restored. For example, if you want to route\n * network requests through DevTools (to trace them):\n *\n *   global.XMLHttpRequest = global.originalXMLHttpRequest;\n *\n * @see https://github.com/facebook/react-native/issues/934\n */\nfunction defineLazyProperty<T>(\n  object: Object,\n  name: string,\n  getValue: () => T,\n): void {\n  const descriptor = Object.getOwnPropertyDescriptor(object, name);\n  if (__DEV__ && descriptor) {\n    const backupName = `original${name[0].toUpperCase()}${name.substr(1)}`;\n    Object.defineProperty(object, backupName, {\n      ...descriptor,\n      value: object[name],\n    });\n  }\n\n  const {enumerable, writable, configurable} = descriptor || {};\n  if (descriptor && !configurable) {\n    console.error('Failed to set polyfill. ' + name + ' is not configurable.');\n    return;\n  }\n\n  defineLazyObjectProperty(object, name, {\n    get: getValue,\n    enumerable: enumerable !== false,\n    writable: writable !== false,\n  });\n}\n\nfunction polyfillGlobal<T>(name: string, getValue: () => T): void {\n  defineLazyProperty(global, name, getValue);\n}\n\n// Set up process\nglobal.process = global.process || {};\nglobal.process.env = global.process.env || {};\nif (!global.process.env.NODE_ENV) {\n  global.process.env.NODE_ENV = __DEV__ ? 'development' : 'production';\n}\nglobal.process.exit = require('NativeModules').AppState.exit;\nObject.defineProperty(global.process, 'argv',\n  () => require('NativeModules').LinkingManager.argv);\n\n// Setup the Systrace profiling hooks if necessary\nif (global.__RCTProfileIsProfiling) {\n  const Systrace = require('Systrace');\n  Systrace.installReactHook(true);\n  Systrace.setEnabled(true);\n}\n\n// Set up console\nconst ExceptionsManager = require('ExceptionsManager');\nExceptionsManager.installConsoleErrorReporter();\n\n// Set up error handler\nif (!global.__fbDisableExceptionsManager) {\n  const handleError = (e, isFatal) => {\n    try {\n      ExceptionsManager.handleException(e, isFatal);\n    } catch (ee) {\n      console.log('Failed to print error: ', ee.message);\n      throw e;\n    }\n  };\n\n  const ErrorUtils = require('ErrorUtils');\n  ErrorUtils.setGlobalHandler(handleError);\n}\n\n// Check for compatibility between the JS and native code\nconst ReactNativeVersionCheck = require('ReactNativeVersionCheck');\nReactNativeVersionCheck.checkVersions();\n\n// Set up Promise\n// The native Promise implementation throws the following error:\n// ERROR: Event loop not supported.\npolyfillGlobal('Promise', () => require('Promise'));\n\n// Set up regenerator.\npolyfillGlobal('regeneratorRuntime', () => {\n  // The require just sets up the global, so make sure when we first\n  // invoke it the global does not exist\n  delete global.regeneratorRuntime;\n  /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an\n   * error found when Flow v0.54 was deployed. To see the error delete this\n   * comment and run Flow. */\n  require('regenerator-runtime/runtime');\n  return global.regeneratorRuntime;\n});\n\n// Set up timers\nconst defineLazyTimer = name => {\n  polyfillGlobal(name, () => require('JSTimers')[name]);\n};\ndefineLazyTimer('setTimeout');\ndefineLazyTimer('setInterval');\ndefineLazyTimer('setImmediate');\ndefineLazyTimer('clearTimeout');\ndefineLazyTimer('clearInterval');\ndefineLazyTimer('clearImmediate');\ndefineLazyTimer('requestAnimationFrame');\ndefineLazyTimer('cancelAnimationFrame');\ndefineLazyTimer('requestIdleCallback');\ndefineLazyTimer('cancelIdleCallback');\n\n// Set up XHR\n// The native XMLHttpRequest in Chrome dev tools is CORS aware and won't\n// let you fetch anything from the internet\npolyfillGlobal('XMLHttpRequest', () => require('XMLHttpRequest'));\npolyfillGlobal('FormData', () => require('FormData'));\n\npolyfillGlobal('fetch', () => require('fetch').fetch);\npolyfillGlobal('Headers', () => require('fetch').Headers);\npolyfillGlobal('Request', () => require('fetch').Request);\npolyfillGlobal('Response', () => require('fetch').Response);\npolyfillGlobal('WebSocket', () => require('WebSocket'));\npolyfillGlobal('Blob', () => require('Blob'));\npolyfillGlobal('URL', () => require('URL'));\n\n// Set up alert\nif (!global.alert) {\n  global.alert = function(text) {\n    // Require Alert on demand. Requiring it too early can lead to issues\n    // with things like Platform not being fully initialized.\n    require('Alert').alert('Alert', '' + text);\n  };\n}\n\n// Set up Geolocation\nlet navigator = global.navigator;\nif (navigator === undefined) {\n  global.navigator = navigator = {};\n}\n\n// see https://github.com/facebook/react-native/issues/10881\ndefineLazyProperty(navigator, 'product', () => 'ReactNative');\ndefineLazyProperty(navigator, 'geolocation', () => require('Geolocation'));\n\n// Just to make sure the JS gets packaged up. Wait until the JS environment has\n// been initialized before requiring them.\nconst BatchedBridge = require('BatchedBridge');\nBatchedBridge.registerLazyCallableModule('Systrace', () => require('Systrace'));\nBatchedBridge.registerLazyCallableModule('JSTimers', () => require('JSTimers'));\nBatchedBridge.registerLazyCallableModule('HeapCapture', () => require('HeapCapture'));\nBatchedBridge.registerLazyCallableModule('SamplingProfiler', () => require('SamplingProfiler'));\nBatchedBridge.registerLazyCallableModule('RCTLog', () => require('RCTLog'));\nBatchedBridge.registerLazyCallableModule('RCTDeviceEventEmitter', () => require('RCTDeviceEventEmitter'));\nBatchedBridge.registerLazyCallableModule('RCTNativeAppEventEmitter', () => require('RCTNativeAppEventEmitter'));\nBatchedBridge.registerLazyCallableModule('PerformanceLogger', () => require('PerformanceLogger'));\n\nglobal.fetchSegment = function(\n  segmentId: number,\n  callback: (?Error) => void,\n) {\n  const {SegmentFetcher} = require('NativeModules');\n  if (!SegmentFetcher) {\n    throw new Error('SegmentFetcher is missing. Please ensure that it is ' +\n      'included as a NativeModule.');\n  }\n\n  SegmentFetcher.fetchSegment(segmentId, (errorObject: ?{message: string, code: string}) => {\n    if (errorObject) {\n      const error = new Error(errorObject.message);\n      (error: any).code = errorObject.code;\n      callback(error);\n    }\n\n    callback(null);\n  });\n};\n\n// Set up devtools\nif (__DEV__) {\n  if (!global.__RCTProfileIsProfiling) {\n    BatchedBridge.registerCallableModule('HMRClient', require('HMRClient'));\n\n    // not when debugging in chrome\n    // TODO(t12832058) This check is broken\n    if (!window.document) {\n      require('setupDevtools');\n    }\n\n    // Set up inspector\n    const JSInspector = require('JSInspector');\n    /* $FlowFixMe(>=0.56.0 site=react_native_oss) This comment suppresses an\n     * error found when Flow v0.56 was deployed. To see the error delete this\n     * comment and run Flow. */\n    /* $FlowFixMe(>=0.56.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error found when Flow v0.56 was deployed. To see the error\n     * delete this comment and run Flow. */\n    JSInspector.registerAgent(require('NetworkAgent'));\n  }\n}\n"
  },
  {
    "path": "Libraries/Core/ReactNativeVersion.js",
    "content": "/**\n * @generated by scripts/bump-oss-version.js\n *\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ReactNativeVersion\n */\n\nexports.version = {\n  major: 0,\n  minor: 0,\n  patch: 0,\n  prerelease: null,\n};\n"
  },
  {
    "path": "Libraries/Core/ReactNativeVersionCheck.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactNativeVersionCheck\n * @flow\n * @format\n */\n'use strict';\n\nconst {PlatformConstants} = require('NativeModules');\nconst ReactNativeVersion = require('ReactNativeVersion');\n\n/**\n * Checks that the version of this React Native JS is compatible with the native\n * code, throwing an error if it isn't.\n *\n * The existence of this module is part of the public interface of React Native\n * even though it is used only internally within React Native. React Native\n * implementations for other platforms (ex: Windows) may override this module\n * and rely on its existence as a separate module.\n */\nexports.checkVersions = function checkVersions(): void {\n  if (!PlatformConstants) {\n    return;\n  }\n\n  const nativeVersion = PlatformConstants.reactNativeVersion;\n  if (\n    ReactNativeVersion.version.major !== nativeVersion.major ||\n    ReactNativeVersion.version.minor !== nativeVersion.minor\n  ) {\n    console.error(\n      `React Native version mismatch.\\n\\nJavaScript version: ${_formatVersion(\n        ReactNativeVersion.version,\n      )}\\n` +\n        `Native version: ${_formatVersion(nativeVersion)}\\n\\n` +\n        'Make sure that you have rebuilt the native code. If the problem ' +\n        'persists try clearing the Watchman and packager caches with ' +\n        '`watchman watch-del-all && react-native start --reset-cache`.',\n    );\n  }\n};\n\nfunction _formatVersion(version): string {\n  return (\n    `${version.major}.${version.minor}.${version.patch}` +\n    (version.prerelease !== null ? `-${version.prerelease}` : '')\n  );\n}\n"
  },
  {
    "path": "Libraries/Core/Timers/JSTimers.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule JSTimers\n * @format\n * @flow\n */\n'use strict';\n\nconst Platform = require('Platform');\nconst Systrace = require('Systrace');\n\nconst invariant = require('fbjs/lib/invariant');\nconst {Timing} = require('NativeModules');\n\nimport type {ExtendedError} from 'parseErrorStack';\n\nlet _performanceNow = null;\nfunction performanceNow() {\n  if (!_performanceNow) {\n    /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an\n     * error found when Flow v0.54 was deployed. To see the error delete this\n     * comment and run Flow. */\n    _performanceNow = require('fbjs/lib/performanceNow');\n  }\n  return _performanceNow();\n}\n\n/**\n * JS implementation of timer functions. Must be completely driven by an\n * external clock signal, all that's stored here is timerID, timer type, and\n * callback.\n */\n\nexport type JSTimerType =\n  | 'setTimeout'\n  | 'setInterval'\n  | 'requestAnimationFrame'\n  | 'setImmediate'\n  | 'requestIdleCallback';\n\n// These timing constants should be kept in sync with the ones in native ios and\n// android `RCTTiming` module.\nconst FRAME_DURATION = 1000 / 60;\nconst IDLE_CALLBACK_FRAME_DEADLINE = 1;\n\nconst MAX_TIMER_DURATION_MS = 60 * 1000;\nconst IS_ANDROID = Platform.OS === 'android';\nconst ANDROID_LONG_TIMER_MESSAGE =\n  'Setting a timer for a long period of time, i.e. multiple minutes, is a ' +\n  'performance and correctness issue on Android as it keeps the timer ' +\n  'module awake, and timers can only be called when the app is in the foreground. ' +\n  'See https://github.com/facebook/react-native/issues/12981 for more info.';\n\n// Parallel arrays\nconst callbacks: Array<?Function> = [];\nconst types: Array<?JSTimerType> = [];\nconst timerIDs: Array<?number> = [];\nlet immediates: Array<number> = [];\nlet requestIdleCallbacks: Array<number> = [];\nconst requestIdleCallbackTimeouts: {[number]: number} = {};\nconst identifiers: Array<null | {methodName: string}> = [];\n\nlet GUID = 1;\nlet errors: ?Array<Error> = null;\n\nlet hasEmittedTimeDriftWarning = false;\n\n// Returns a free index if one is available, and the next consecutive index otherwise.\nfunction _getFreeIndex(): number {\n  let freeIndex = timerIDs.indexOf(null);\n  if (freeIndex === -1) {\n    freeIndex = timerIDs.length;\n  }\n  return freeIndex;\n}\n\nfunction _allocateCallback(func: Function, type: JSTimerType): number {\n  const id = GUID++;\n  const freeIndex = _getFreeIndex();\n  timerIDs[freeIndex] = id;\n  callbacks[freeIndex] = func;\n  types[freeIndex] = type;\n  if (__DEV__) {\n    const parseErrorStack = require('parseErrorStack');\n    const error: ExtendedError = new Error();\n    error.framesToPop = 1;\n    const stack = parseErrorStack(error);\n    if (stack) {\n      identifiers[freeIndex] = stack.shift();\n    }\n  }\n  return id;\n}\n\n/**\n * Calls the callback associated with the ID. Also unregister that callback\n * if it was a one time timer (setTimeout), and not unregister it if it was\n * recurring (setInterval).\n */\nfunction _callTimer(timerID: number, frameTime: number, didTimeout: ?boolean) {\n  /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an\n   * error found when Flow v0.54 was deployed. To see the error delete this\n   * comment and run Flow. */\n  require('fbjs/lib/warning')(\n    timerID <= GUID,\n    'Tried to call timer with ID %s but no such timer exists.',\n    timerID,\n  );\n\n  // timerIndex of -1 means that no timer with that ID exists. There are\n  // two situations when this happens, when a garbage timer ID was given\n  // and when a previously existing timer was deleted before this callback\n  // fired. In both cases we want to ignore the timer id, but in the former\n  // case we warn as well.\n  const timerIndex = timerIDs.indexOf(timerID);\n  if (timerIndex === -1) {\n    return;\n  }\n\n  const type = types[timerIndex];\n  const callback = callbacks[timerIndex];\n  if (!callback || !type) {\n    console.error('No callback found for timerID ' + timerID);\n    return;\n  }\n\n  if (__DEV__) {\n    const identifier = identifiers[timerIndex] || {};\n    Systrace.beginEvent('Systrace.callTimer: ' + identifier.methodName);\n  }\n\n  // Clear the metadata\n  if (\n    type === 'setTimeout' ||\n    type === 'setImmediate' ||\n    type === 'requestAnimationFrame' ||\n    type === 'requestIdleCallback'\n  ) {\n    _clearIndex(timerIndex);\n  }\n\n  try {\n    if (\n      type === 'setTimeout' ||\n      type === 'setInterval' ||\n      type === 'setImmediate'\n    ) {\n      callback();\n    } else if (type === 'requestAnimationFrame') {\n      callback(performanceNow());\n    } else if (type === 'requestIdleCallback') {\n      callback({\n        timeRemaining: function() {\n          // TODO: Optimisation: allow running for longer than one frame if\n          // there are no pending JS calls on the bridge from native. This\n          // would require a way to check the bridge queue synchronously.\n          return Math.max(0, FRAME_DURATION - (performanceNow() - frameTime));\n        },\n        didTimeout: !!didTimeout,\n      });\n    } else {\n      console.error('Tried to call a callback with invalid type: ' + type);\n    }\n  } catch (e) {\n    // Don't rethrow so that we can run all timers.\n    if (!errors) {\n      errors = [e];\n    } else {\n      errors.push(e);\n    }\n  }\n\n  if (__DEV__) {\n    Systrace.endEvent();\n  }\n}\n\n/**\n * Performs a single pass over the enqueued immediates. Returns whether\n * more immediates are queued up (can be used as a condition a while loop).\n */\nfunction _callImmediatesPass() {\n  if (__DEV__) {\n    Systrace.beginEvent('callImmediatesPass()');\n  }\n\n  // The main reason to extract a single pass is so that we can track\n  // in the system trace\n  if (immediates.length > 0) {\n    const passImmediates = immediates.slice();\n    immediates = [];\n\n    // Use for loop rather than forEach as per @vjeux's advice\n    // https://github.com/facebook/react-native/commit/c8fd9f7588ad02d2293cac7224715f4af7b0f352#commitcomment-14570051\n    for (let i = 0; i < passImmediates.length; ++i) {\n      _callTimer(passImmediates[i], 0);\n    }\n  }\n\n  if (__DEV__) {\n    Systrace.endEvent();\n  }\n  return immediates.length > 0;\n}\n\nfunction _clearIndex(i: number) {\n  timerIDs[i] = null;\n  callbacks[i] = null;\n  types[i] = null;\n  identifiers[i] = null;\n}\n\nfunction _freeCallback(timerID: number) {\n  // timerIDs contains nulls after timers have been removed;\n  // ignore nulls upfront so indexOf doesn't find them\n  if (timerID == null) {\n    return;\n  }\n\n  const index = timerIDs.indexOf(timerID);\n  // See corresponding comment in `callTimers` for reasoning behind this\n  if (index !== -1) {\n    _clearIndex(index);\n    const type = types[index];\n    if (type !== 'setImmediate' && type !== 'requestIdleCallback') {\n      Timing.deleteTimer(timerID);\n    }\n  }\n}\n\n/**\n * JS implementation of timer functions. Must be completely driven by an\n * external clock signal, all that's stored here is timerID, timer type, and\n * callback.\n */\nconst JSTimers = {\n  /**\n   * @param {function} func Callback to be invoked after `duration` ms.\n   * @param {number} duration Number of milliseconds.\n   */\n  setTimeout: function(\n    func: Function,\n    duration: number,\n    ...args?: any\n  ): number {\n    if (__DEV__ && IS_ANDROID && duration > MAX_TIMER_DURATION_MS) {\n      console.warn(\n        ANDROID_LONG_TIMER_MESSAGE +\n          '\\n' +\n          '(Saw setTimeout with duration ' +\n          duration +\n          'ms)',\n      );\n    }\n    const id = _allocateCallback(\n      () => func.apply(undefined, args),\n      'setTimeout',\n    );\n    Timing.createTimer(id, duration || 0, Date.now(), /* recurring */ false);\n    return id;\n  },\n\n  /**\n   * @param {function} func Callback to be invoked every `duration` ms.\n   * @param {number} duration Number of milliseconds.\n   */\n  setInterval: function(\n    func: Function,\n    duration: number,\n    ...args?: any\n  ): number {\n    if (__DEV__ && IS_ANDROID && duration > MAX_TIMER_DURATION_MS) {\n      console.warn(\n        ANDROID_LONG_TIMER_MESSAGE +\n          '\\n' +\n          '(Saw setInterval with duration ' +\n          duration +\n          'ms)',\n      );\n    }\n    const id = _allocateCallback(\n      () => func.apply(undefined, args),\n      'setInterval',\n    );\n    Timing.createTimer(id, duration || 0, Date.now(), /* recurring */ true);\n    return id;\n  },\n\n  /**\n   * @param {function} func Callback to be invoked before the end of the\n   * current JavaScript execution loop.\n   */\n  setImmediate: function(func: Function, ...args?: any) {\n    const id = _allocateCallback(\n      () => func.apply(undefined, args),\n      'setImmediate',\n    );\n    immediates.push(id);\n    return id;\n  },\n\n  /**\n   * @param {function} func Callback to be invoked every frame.\n   */\n  requestAnimationFrame: function(func: Function) {\n    const id = _allocateCallback(func, 'requestAnimationFrame');\n    Timing.createTimer(id, 1, Date.now(), /* recurring */ false);\n    return id;\n  },\n\n  /**\n   * @param {function} func Callback to be invoked every frame and provided\n   * with time remaining in frame.\n   * @param {?object} options\n   */\n  requestIdleCallback: function(func: Function, options: ?Object) {\n    if (requestIdleCallbacks.length === 0) {\n      Timing.setSendIdleEvents(true);\n    }\n\n    const timeout = options && options.timeout;\n    const id = _allocateCallback(\n      timeout != null\n        ? deadline => {\n            const timeoutId = requestIdleCallbackTimeouts[id];\n            if (timeoutId) {\n              JSTimers.clearTimeout(timeoutId);\n              delete requestIdleCallbackTimeouts[id];\n            }\n            return func(deadline);\n          }\n        : func,\n      'requestIdleCallback',\n    );\n    requestIdleCallbacks.push(id);\n\n    if (timeout != null) {\n      const timeoutId = JSTimers.setTimeout(() => {\n        const index = requestIdleCallbacks.indexOf(id);\n        if (index > -1) {\n          requestIdleCallbacks.splice(index, 1);\n          _callTimer(id, performanceNow(), true);\n        }\n        delete requestIdleCallbackTimeouts[id];\n        if (requestIdleCallbacks.length === 0) {\n          Timing.setSendIdleEvents(false);\n        }\n      }, timeout);\n      requestIdleCallbackTimeouts[id] = timeoutId;\n    }\n    return id;\n  },\n\n  cancelIdleCallback: function(timerID: number) {\n    _freeCallback(timerID);\n    const index = requestIdleCallbacks.indexOf(timerID);\n    if (index !== -1) {\n      requestIdleCallbacks.splice(index, 1);\n    }\n\n    const timeoutId = requestIdleCallbackTimeouts[timerID];\n    if (timeoutId) {\n      JSTimers.clearTimeout(timeoutId);\n      delete requestIdleCallbackTimeouts[timerID];\n    }\n\n    if (requestIdleCallbacks.length === 0) {\n      Timing.setSendIdleEvents(false);\n    }\n  },\n\n  clearTimeout: function(timerID: number) {\n    _freeCallback(timerID);\n  },\n\n  clearInterval: function(timerID: number) {\n    _freeCallback(timerID);\n  },\n\n  clearImmediate: function(timerID: number) {\n    _freeCallback(timerID);\n    const index = immediates.indexOf(timerID);\n    if (index !== -1) {\n      immediates.splice(index, 1);\n    }\n  },\n\n  cancelAnimationFrame: function(timerID: number) {\n    _freeCallback(timerID);\n  },\n\n  /**\n   * This is called from the native side. We are passed an array of timerIDs,\n   * and\n   */\n  callTimers: function(timersToCall: Array<number>) {\n    invariant(\n      timersToCall.length !== 0,\n      'Cannot call `callTimers` with an empty list of IDs.',\n    );\n\n    // $FlowFixMe: optionals do not allow assignment from null\n    errors = null;\n    for (let i = 0; i < timersToCall.length; i++) {\n      _callTimer(timersToCall[i], 0);\n    }\n\n    if (errors) {\n      const errorCount = errors.length;\n      if (errorCount > 1) {\n        // Throw all the other errors in a setTimeout, which will throw each\n        // error one at a time\n        for (let ii = 1; ii < errorCount; ii++) {\n          JSTimers.setTimeout(\n            (error => {\n              throw error;\n            }).bind(null, errors[ii]),\n            0,\n          );\n        }\n      }\n      throw errors[0];\n    }\n  },\n\n  callIdleCallbacks: function(frameTime: number) {\n    if (\n      FRAME_DURATION - (performanceNow() - frameTime) <\n      IDLE_CALLBACK_FRAME_DEADLINE\n    ) {\n      return;\n    }\n\n    // $FlowFixMe: optionals do not allow assignment from null\n    errors = null;\n    if (requestIdleCallbacks.length > 0) {\n      const passIdleCallbacks = requestIdleCallbacks.slice();\n      requestIdleCallbacks = [];\n\n      for (let i = 0; i < passIdleCallbacks.length; ++i) {\n        _callTimer(passIdleCallbacks[i], frameTime);\n      }\n    }\n\n    if (requestIdleCallbacks.length === 0) {\n      Timing.setSendIdleEvents(false);\n    }\n\n    if (errors) {\n      errors.forEach(error =>\n        JSTimers.setTimeout(() => {\n          throw error;\n        }, 0),\n      );\n    }\n  },\n\n  /**\n   * This is called after we execute any command we receive from native but\n   * before we hand control back to native.\n   */\n  callImmediates() {\n    errors = null;\n    while (_callImmediatesPass()) {}\n    if (errors) {\n      errors.forEach(error =>\n        JSTimers.setTimeout(() => {\n          throw error;\n        }, 0),\n      );\n    }\n  },\n\n  /**\n   * Called from native (in development) when environment times are out-of-sync.\n   */\n  emitTimeDriftWarning(warningMessage: string) {\n    if (hasEmittedTimeDriftWarning) {\n      return;\n    }\n    hasEmittedTimeDriftWarning = true;\n    console.warn(warningMessage);\n  },\n};\n\nif (!Timing) {\n  console.warn(\"Timing native module is not available, can't set timers.\");\n  // $FlowFixMe: we can assume timers are generally available\n  module.exports = ({\n    callImmediates: JSTimers.callImmediates,\n    setImmediate: JSTimers.setImmediate,\n  }: typeof JSTimers);\n} else {\n  module.exports = JSTimers;\n}\n"
  },
  {
    "path": "Libraries/Core/__mocks__/ErrorUtils.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n// This mock only provides short-circuited methods of applyWithGuard and guard.\n// A lot of modules rely on these two functions. This mock relieves their tests\n// from depending on the real ErrorUtils module. If you need real error handling\n// don't use this mock.\n'use strict';\n\nfunction execute(fun, context, args) {\n  return fun.apply(context, args);\n}\n\nfunction reportError(error) {\n  throw error;\n}\n\nvar ErrorUtils = {\n  apply: jest.fn(execute),\n  applyWithGuard: jest.fn(execute),\n  guard: jest.fn(callback => callback),\n  inGuard: jest.fn().mockReturnValue(true),\n  reportError: jest.fn(reportError),\n  setGlobalHandler: jest.fn(),\n};\n\nmodule.exports = ErrorUtils;\n"
  },
  {
    "path": "Libraries/Core/__tests__/ReactNativeVersionCheck-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+react_native\n */\n'use strict';\n\ndescribe('checkVersion', () => {\n  describe('in development', () => {\n    _setDevelopmentModeForTests(true);\n    _defineCheckVersionTests();\n  });\n\n  describe('in production', () => {\n    _setDevelopmentModeForTests(false);\n    _defineCheckVersionTests();\n  });\n});\n\nfunction _setDevelopmentModeForTests(dev) {\n  let originalDev;\n\n  beforeAll(() => {\n    originalDev = global.__DEV__;\n    global.__DEV__ = dev;\n  });\n\n  afterAll(() => {\n    global.__DEV__ = originalDev;\n  });\n}\n\nfunction _defineCheckVersionTests() {\n  const consoleError = console.error;\n  const globalConsole = global.console;\n\n  let spyOnConsoleError;\n  let consoleOutput;\n\n  beforeEach(() => {\n    consoleOutput = '';\n    console.error = jest.fn();\n    global.console = {error: jest.fn(error => (consoleOutput += error))};\n    spyOnConsoleError = jest.spyOn(global.console, 'error');\n  });\n\n  afterEach(() => {\n    jest.resetModules();\n    console.error = consoleError;\n    global.console = globalConsole;\n    spyOnConsoleError.mockReset();\n  });\n\n  it('passes when all the versions are zero', () => {\n    _mockJsVersion(0, 0, 0);\n    _mockNativeVersion(0, 0, 0);\n\n    const ReactNativeVersion = require('ReactNativeVersion');\n    const ReactNativeVersionCheck = require('ReactNativeVersionCheck');\n    expect(ReactNativeVersion).toMatchObject({\n      version: {major: 0, minor: 0, patch: 0, prerelease: null},\n    });\n    expect(() => ReactNativeVersionCheck.checkVersions()).not.toThrow();\n  });\n\n  it('passes when the minor matches when the major is zero', () => {\n    _mockJsVersion(0, 1, 0);\n    _mockNativeVersion(0, 1, 0);\n\n    const ReactNativeVersionCheck = require('ReactNativeVersionCheck');\n    expect(() => ReactNativeVersionCheck.checkVersions()).not.toThrow();\n  });\n\n  it(\"logs error when the minor doesn't match when the major is zero\", () => {\n    _mockJsVersion(0, 1, 0);\n    _mockNativeVersion(0, 2, 0);\n\n    const ReactNativeVersionCheck = require('ReactNativeVersionCheck');\n\n    ReactNativeVersionCheck.checkVersions();\n    expect(spyOnConsoleError).toHaveBeenCalledTimes(1);\n    expect(consoleOutput).toMatch(/React Native version mismatch/);\n  });\n\n  it(\"logs error when the major doesn't match\", () => {\n    _mockJsVersion(1, 0, 0);\n    _mockNativeVersion(2, 0, 0);\n\n    const ReactNativeVersionCheck = require('ReactNativeVersionCheck');\n    ReactNativeVersionCheck.checkVersions();\n    expect(spyOnConsoleError).toHaveBeenCalledTimes(1);\n    expect(consoleOutput).toMatch(/React Native version mismatch/);\n  });\n\n  it(\"doesn't log error if the patch doesn't match\", () => {\n    _mockJsVersion(0, 1, 0);\n    _mockNativeVersion(0, 1, 2);\n\n    const ReactNativeVersionCheck = require('ReactNativeVersionCheck');\n    ReactNativeVersionCheck.checkVersions();\n    expect(spyOnConsoleError).toHaveBeenCalledTimes(0);\n  });\n\n  it(\"doesn't log error if the prerelease doesn't match\", () => {\n    _mockJsVersion(0, 1, 0, 'beta.0');\n    _mockNativeVersion(0, 1, 0, 'alpha.1');\n\n    const ReactNativeVersionCheck = require('ReactNativeVersionCheck');\n    ReactNativeVersionCheck.checkVersions();\n    expect(spyOnConsoleError).toHaveBeenCalledTimes(0);\n  });\n}\n\nfunction _mockJsVersion(major = 0, minor = 0, patch = 0, prerelease = null) {\n  jest.doMock('ReactNativeVersion', () => ({\n    version: {major, minor, patch, prerelease},\n  }));\n}\n\nfunction _mockNativeVersion(\n  major = 0,\n  minor = 0,\n  patch = 0,\n  prerelease = null,\n) {\n  jest.doMock('NativeModules', () => ({\n    PlatformConstants: {\n      reactNativeVersion: {major, minor, patch, prerelease},\n    },\n  }));\n}\n"
  },
  {
    "path": "Libraries/EventEmitter/MissingNativeEventEmitterShim.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule MissingNativeEventEmitterShim\n * @flow\n */\n'use strict';\n\nconst EmitterSubscription = require('EmitterSubscription');\nconst EventEmitter = require('EventEmitter');\n\nconst invariant = require('fbjs/lib/invariant');\n\nclass MissingNativeEventEmitterShim extends EventEmitter {\n  isAvailable: boolean = false;\n  _nativeModuleName: string;\n  _nativeEventEmitterName: string;\n\n  constructor(nativeModuleName: string, nativeEventEmitterName: string) {\n    super(null);\n    this._nativeModuleName = nativeModuleName;\n    this._nativeEventEmitterName = nativeEventEmitterName;\n  }\n\n  throwMissingNativeModule() {\n    invariant(\n      false,\n      `Cannot use '${this._nativeEventEmitterName}' module when ` +\n      `native '${this._nativeModuleName}' is not included in the build. ` +\n      `Either include it, or check '${this._nativeEventEmitterName}'.isAvailable ` +\n      'before calling any methods.'\n    );\n  }\n\n  // EventEmitter\n  addListener(eventType: string, listener: Function, context: ?Object) {\n    this.throwMissingNativeModule();\n  }\n\n  removeAllListeners(eventType: string) {\n    this.throwMissingNativeModule();\n  }\n\n  removeSubscription(subscription: EmitterSubscription) {\n    this.throwMissingNativeModule();\n  }\n}\n\nmodule.exports = MissingNativeEventEmitterShim;\n"
  },
  {
    "path": "Libraries/EventEmitter/NativeEventEmitter.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule NativeEventEmitter\n * @flow\n */\n'use strict';\n\nconst EventEmitter = require('EventEmitter');\nconst Platform = require('Platform');\nconst RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\n\nconst invariant = require('fbjs/lib/invariant');\n\nimport type EmitterSubscription from 'EmitterSubscription';\n\ntype NativeModule = {\n  +addListener: (eventType: string) => void,\n  +removeListeners: (count: number) => void,\n};\n\n/**\n * Abstract base class for implementing event-emitting modules. This implements\n * a subset of the standard EventEmitter node module API.\n */\nclass NativeEventEmitter extends EventEmitter {\n  _nativeModule: ?NativeModule;\n\n  constructor(nativeModule: ?NativeModule) {\n    super(RCTDeviceEventEmitter.sharedSubscriber);\n    if (Platform.OS === 'ios' || Platform.OS === 'macos') {\n      invariant(nativeModule, 'Native module cannot be null.');\n      this._nativeModule = nativeModule;\n    }\n  }\n\n  addListener(\n    eventType: string,\n    listener: Function,\n    context: ?Object,\n  ): EmitterSubscription {\n    if (this._nativeModule != null) {\n      this._nativeModule.addListener(eventType);\n    }\n    return super.addListener(eventType, listener, context);\n  }\n\n  removeAllListeners(eventType: string) {\n    invariant(eventType, 'eventType argument is required.');\n    const count = this.listeners(eventType).length;\n    if (this._nativeModule != null) {\n      this._nativeModule.removeListeners(count);\n    }\n    super.removeAllListeners(eventType);\n  }\n\n  removeSubscription(subscription: EmitterSubscription) {\n    if (this._nativeModule != null) {\n      this._nativeModule.removeListeners(1);\n    }\n    super.removeSubscription(subscription);\n  }\n}\n\nmodule.exports = NativeEventEmitter;\n"
  },
  {
    "path": "Libraries/EventEmitter/RCTDeviceEventEmitter.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RCTDeviceEventEmitter\n * @flow\n */\n'use strict';\n\nconst EventEmitter = require('EventEmitter');\nconst EventSubscriptionVendor = require('EventSubscriptionVendor');\n\nimport type EmitterSubscription from 'EmitterSubscription';\n\nfunction checkNativeEventModule(eventType: ?string) {\n  if (eventType) {\n    if (eventType.lastIndexOf('statusBar', 0) === 0) {\n      throw new Error('`' + eventType + '` event should be registered via the StatusBarIOS module');\n    }\n    if (eventType.lastIndexOf('keyboard', 0) === 0) {\n      throw new Error('`' + eventType + '` event should be registered via the Keyboard module');\n    }\n    if (eventType === 'appStateDidChange' || eventType === 'memoryWarning') {\n      throw new Error('`' + eventType + '` event should be registered via the AppState module');\n    }\n  }\n}\n\n/**\n * Deprecated - subclass NativeEventEmitter to create granular event modules instead of\n * adding all event listeners directly to RCTDeviceEventEmitter.\n */\nclass RCTDeviceEventEmitter extends EventEmitter {\n\n  sharedSubscriber: EventSubscriptionVendor;\n\n  constructor() {\n    const sharedSubscriber = new EventSubscriptionVendor();\n    super(sharedSubscriber);\n    this.sharedSubscriber = sharedSubscriber;\n  }\n\n\n  addListener(eventType: string, listener: Function, context: ?Object): EmitterSubscription {\n    if (__DEV__) {\n      checkNativeEventModule(eventType);\n    }\n    return super.addListener(eventType, listener, context);\n  }\n\n  removeAllListeners(eventType: ?string) {\n    if (__DEV__) {\n      checkNativeEventModule(eventType);\n    }\n    super.removeAllListeners(eventType);\n  }\n\n  removeSubscription(subscription: EmitterSubscription) {\n    if (subscription.emitter !== this) {\n      subscription.emitter.removeSubscription(subscription);\n    } else {\n      super.removeSubscription(subscription);\n    }\n  }\n}\n\nmodule.exports = new RCTDeviceEventEmitter();\n"
  },
  {
    "path": "Libraries/EventEmitter/RCTEventEmitter.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RCTEventEmitter\n * @flow\n */\n'use strict';\n\nconst BatchedBridge = require('BatchedBridge');\n\nconst RCTEventEmitter = {\n  register(eventEmitter: any) {\n    BatchedBridge.registerCallableModule(\n      'RCTEventEmitter',\n      eventEmitter\n    );\n  }\n};\n\nmodule.exports = RCTEventEmitter;\n"
  },
  {
    "path": "Libraries/EventEmitter/RCTNativeAppEventEmitter.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RCTNativeAppEventEmitter\n * @flow\n */\n'use strict';\n\nconst RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\n\n/**\n * Deprecated - subclass NativeEventEmitter to create granular event modules instead of\n * adding all event listeners directly to RCTNativeAppEventEmitter.\n */\nconst RCTNativeAppEventEmitter = RCTDeviceEventEmitter;\nmodule.exports = RCTNativeAppEventEmitter;\n"
  },
  {
    "path": "Libraries/EventEmitter/__mocks__/NativeEventEmitter.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\nconst EventEmitter = require('EventEmitter');\nconst RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\n\n/**\n * Mock the NativeEventEmitter as a normal JS EventEmitter.\n */\nclass NativeEventEmitter extends EventEmitter {\n  constructor() {\n    super(RCTDeviceEventEmitter.sharedSubscriber);\n  }\n}\n\nmodule.exports = NativeEventEmitter;\n"
  },
  {
    "path": "Libraries/Experimental/Incremental.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Incremental\n * @flow\n */\n'use strict';\n\nconst InteractionManager = require('InteractionManager');\nconst React = require('React');\n\nconst PropTypes = require('prop-types');\n\nconst infoLog = require('infoLog');\n\nconst DEBUG = false;\n\n/**\n * WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will\n * not be reliably announced.  The whole thing might be deleted, who knows? Use\n * at your own risk.\n *\n * React Native helps make apps smooth by doing all the heavy lifting off the\n * main thread, in JavaScript.  That works great a lot of the time, except that\n * heavy operations like rendering may block the JS thread from responding\n * quickly to events like taps, making the app feel sluggish.\n *\n * `<Incremental>` solves this by slicing up rendering into chunks that are\n * spread across multiple event loops. Expensive components can be sliced up\n * recursively by wrapping pieces of them and their decendents in\n * `<Incremental>` components. `<IncrementalGroup>` can be used to make sure\n * everything in the group is rendered recursively before calling `onDone` and\n * moving on to another sibling group (e.g. render one row at a time, even if\n * rendering the top level row component produces more `<Incremental>` chunks).\n * `<IncrementalPresenter>` is a type of `<IncrementalGroup>` that keeps it's\n * children invisible and out of the layout tree until all rendering completes\n * recursively. This means the group will be presented to the user as one unit,\n * rather than pieces popping in sequentially.\n *\n * `<Incremental>` only affects initial render - `setState` and other render\n * updates are unaffected.\n *\n * The chunks are rendered sequentially using the `InteractionManager` queue,\n * which means that rendering will pause if it's interrupted by an interaction,\n * such as an animation or gesture.\n *\n * Note there is some overhead, so you don't want to slice things up too much.\n * A target of 100-200ms of total work per event loop on old/slow devices might\n * be a reasonable place to start.\n *\n * Below is an example that will incrementally render all the parts of `Row` one\n * first, then present them together, then repeat the process for `Row` two, and\n * so on:\n *\n *   render: function() {\n *     return (\n *       <ScrollView>\n *         {Array(10).fill().map((rowIdx) => (\n *           <IncrementalPresenter key={rowIdx}>\n *             <Row>\n *               {Array(20).fill().map((widgetIdx) => (\n *                 <Incremental key={widgetIdx}>\n *                   <SlowWidget />\n *                 </Incremental>\n *               ))}\n *             </Row>\n *           </IncrementalPresenter>\n *         ))}\n *       </ScrollView>\n *     );\n *   };\n *\n * If SlowWidget takes 30ms to render, then without `Incremental`, this would\n * block the JS thread for at least `10 * 20 * 30ms = 6000ms`, but with\n * `Incremental` it will probably not block for more than 50-100ms at a time,\n * allowing user interactions to take place which might even unmount this\n * component, saving us from ever doing the remaining rendering work.\n */\nexport type Props = {\n /**\n  * Called when all the decendents have finished rendering and mounting\n  * recursively.\n  */\n onDone?: () => void,\n /**\n  * Tags instances and associated tasks for easier debugging.\n  */\n name: string,\n children?: any,\n};\ntype DefaultProps = {\n  name: string,\n};\ntype State = {\n  doIncrementalRender: boolean,\n};\nclass Incremental extends React.Component<Props, State> {\n  props: Props;\n  state: State;\n  context: Context;\n  _incrementId: number;\n  _mounted: boolean;\n  _rendered: boolean;\n\n  static defaultProps = {\n    name: '',\n  };\n\n  static contextTypes = {\n    incrementalGroup: PropTypes.object,\n    incrementalGroupEnabled: PropTypes.bool,\n  };\n\n  constructor(props: Props, context: Context) {\n    super(props, context);\n    this._mounted = false;\n    this.state = {\n      doIncrementalRender: false,\n    };\n  }\n\n  getName(): string {\n    const ctx = this.context.incrementalGroup || {};\n    return ctx.groupId + ':' + this._incrementId + '-' + this.props.name;\n  }\n\n  componentWillMount() {\n    const ctx = this.context.incrementalGroup;\n    if (!ctx) {\n      return;\n    }\n    this._incrementId = ++(ctx.incrementalCount);\n    InteractionManager.runAfterInteractions({\n      name: 'Incremental:' + this.getName(),\n      gen: () => new Promise(resolve => {\n        if (!this._mounted || this._rendered) {\n          resolve();\n          return;\n        }\n        DEBUG && infoLog('set doIncrementalRender for ' + this.getName());\n        this.setState({doIncrementalRender: true}, resolve);\n      }),\n    }).then(() => {\n      DEBUG && infoLog('call onDone for ' + this.getName());\n      this._mounted && this.props.onDone && this.props.onDone();\n    }).catch((ex) => {\n      ex.message = `Incremental render failed for ${this.getName()}: ${ex.message}`;\n      throw ex;\n    }).done();\n  }\n\n  render(): React.Node {\n    if (this._rendered || // Make sure that once we render once, we stay rendered even if incrementalGroupEnabled gets flipped.\n        !this.context.incrementalGroupEnabled ||\n        this.state.doIncrementalRender) {\n      DEBUG && infoLog('render ' + this.getName());\n      this._rendered = true;\n      return this.props.children;\n    }\n    return null;\n  }\n\n  componentDidMount() {\n    this._mounted = true;\n    if (!this.context.incrementalGroup) {\n      this.props.onDone && this.props.onDone();\n    }\n  }\n\n  componentWillUnmount() {\n    this._mounted = false;\n  }\n}\n\nexport type Context = {\n  incrementalGroupEnabled: boolean,\n  incrementalGroup: ?{\n    groupId: string,\n    incrementalCount: number,\n  },\n};\n\nmodule.exports = Incremental;\n"
  },
  {
    "path": "Libraries/Experimental/IncrementalExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule IncrementalExample\n * @flow\n */\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\nconst {\n  InteractionManager,\n  ScrollView,\n  StyleSheet,\n  Text,\n  TouchableOpacity,\n  View,\n} = ReactNative;\n\nconst Incremental = require('Incremental');\nconst IncrementalGroup = require('IncrementalGroup');\nconst IncrementalPresenter = require('IncrementalPresenter');\n\nconst JSEventLoopWatchdog = require('JSEventLoopWatchdog');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst performanceNow = require('fbjs/lib/performanceNow');\n\nInteractionManager.setDeadline(1000);\nJSEventLoopWatchdog.install({thresholdMS: 200});\n\nlet totalWidgets = 0;\n\nclass SlowWidget extends React.Component<$FlowFixMeProps, {ctorTimestamp: number, timeToMount: number}> {\n  constructor(props, context) {\n    super(props, context);\n    this.state = {\n      ctorTimestamp: performanceNow(),\n      timeToMount: 0,\n    };\n  }\n  render() {\n    this.state.timeToMount === 0 && burnCPU(20);\n    return (\n      <View style={styles.widgetContainer}>\n        <Text style={styles.widgetText}>\n          {`${this.state.timeToMount || '?'} ms`}\n        </Text>\n      </View>\n    );\n  }\n  componentDidMount() {\n    const timeToMount = performanceNow() - this.state.ctorTimestamp;\n    this.setState({timeToMount});\n    totalWidgets++;\n  }\n}\n\nlet imHandle;\nfunction startInteraction() {\n  imHandle = InteractionManager.createInteractionHandle();\n}\nfunction stopInteraction() {\n  InteractionManager.clearInteractionHandle(imHandle);\n}\n\nfunction Block(props: Object) {\n  const IncrementalContainer = props.stream ? IncrementalGroup : IncrementalPresenter;\n  return (\n    <IncrementalContainer name={'b_' + props.idx}>\n      <TouchableOpacity\n        onPressIn={startInteraction}\n        onPressOut={stopInteraction}>\n        <View style={styles.block}>\n          <Text>\n            {props.idx + ': ' + (props.stream ? 'Streaming' : 'Presented')}\n          </Text>\n          {props.children}\n        </View>\n      </TouchableOpacity>\n    </IncrementalContainer>\n  );\n}\n\nconst Row = (props: Object) => <View style={styles.row} {...props} />;\n\nclass IncrementalExample extends React.Component<mixed, {stats: ?Object}> {\n  static title = '<Incremental*>';\n  static description = 'Enables incremental rendering of complex components.';\n  start: number;\n  constructor(props: mixed, context: mixed) {\n    super(props, context);\n    this.start = performanceNow();\n    this.state = {\n      stats: null,\n    };\n    (this: any)._onDone = this._onDone.bind(this);\n  }\n  _onDone() {\n    const onDoneElapsed = performanceNow() - this.start;\n    setTimeout(() => {\n      const stats = {\n        onDoneElapsed,\n        totalWidgets,\n        ...JSEventLoopWatchdog.getStats(),\n        setTimeoutElapsed: performanceNow() - this.start,\n      };\n      stats.avgStall = stats.totalStallTime / stats.stallCount;\n      this.setState({stats});\n      console.log('onDone:', stats);\n    }, 0);\n  }\n  render(): React.Node {\n    return (\n      <IncrementalGroup\n        disabled={false}\n        name=\"root\"\n        onDone={this._onDone}>\n        <ScrollView style={styles.scrollView}>\n          <Text style={styles.headerText}>\n            Press and hold on a row to pause rendering.\n          </Text>\n          {this.state.stats && <Text>\n            Finished: {JSON.stringify(this.state.stats, null, 2)}\n          </Text>}\n          {Array(8).fill().map((_, blockIdx) => {\n            return (\n              <Block key={blockIdx} idx={blockIdx} stream={blockIdx < 2}>\n                {Array(4).fill().map((_b, rowIdx) => (\n                  <Row key={rowIdx}>\n                    {Array(14).fill().map((_c, widgetIdx) => (\n                      <Incremental key={widgetIdx} name={'w_' + widgetIdx}>\n                        <SlowWidget idx={widgetIdx} />\n                      </Incremental>\n                    ))}\n                  </Row>\n                ))}\n              </Block>\n            );\n          })}\n        </ScrollView>\n      </IncrementalGroup>\n    );\n  }\n}\n\nfunction burnCPU(milliseconds) {\n  const start = performanceNow();\n  while (performanceNow() < (start + milliseconds)) {}\n}\n\nvar styles = StyleSheet.create({\n  scrollView: {\n    margin: 10,\n    backgroundColor: 'white',\n    flex: 1,\n  },\n  headerText: {\n    fontSize: 20,\n    margin: 10,\n  },\n  block: {\n    borderRadius: 6,\n    borderWidth: 2,\n    borderColor: '#a52a2a',\n    padding: 14,\n    margin: 5,\n    backgroundColor: 'white',\n  },\n  row: {\n    flexDirection: 'row',\n  },\n  widgetContainer: {\n    backgroundColor: '#dddddd',\n    padding: 2,\n    margin: 2,\n  },\n  widgetText: {\n    color: 'black',\n    fontSize: 4,\n  },\n});\n\nmodule.exports = IncrementalExample;\n"
  },
  {
    "path": "Libraries/Experimental/IncrementalGroup.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule IncrementalGroup\n * @flow\n */\n'use strict';\n\nconst Incremental = require('Incremental');\nconst React = require('React');\n\nconst PropTypes = require('prop-types');\n\nconst infoLog = require('infoLog');\n\nlet _groupCounter = -1;\nconst DEBUG = false;\n\nimport type {Props, Context} from 'Incremental';\n\n/**\n * WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will\n * not be reliably announced.  The whole thing might be deleted, who knows? Use\n * at your own risk.\n *\n * `<Incremental>` components must be wrapped in an `<IncrementalGroup>` (e.g.\n * via `<IncrementalPresenter>`) in order to provide the incremental group\n * context, otherwise they will do nothing.\n *\n * See Incremental.js for more info.\n */\nclass IncrementalGroup extends React.Component<Props & {disabled?: boolean}> {\n  context: Context;\n  _groupInc: string;\n  componentWillMount() {\n    this._groupInc = `g${++_groupCounter}-`;\n    DEBUG && infoLog(\n      'create IncrementalGroup with id ' + this.getGroupId()\n    );\n  }\n\n  getGroupId(): string {\n    const ctx = this.context.incrementalGroup;\n    const prefix = ctx ? ctx.groupId + ':' : '';\n    return prefix + this._groupInc + this.props.name;\n  }\n\n  getChildContext(): Context {\n    if (this.props.disabled || this.context.incrementalGroupEnabled === false) {\n      return {\n        incrementalGroupEnabled: false,\n        incrementalGroup: null,\n      };\n    }\n    return {\n      incrementalGroupEnabled: true,\n      incrementalGroup: {\n        groupId: this.getGroupId(),\n        incrementalCount: -1,\n      },\n    };\n  }\n\n  render(): React.Node {\n    return (\n      <Incremental\n        onDone={this.props.onDone}\n        children={this.props.children}\n      />\n    );\n  }\n}\nIncrementalGroup.contextTypes = {\n  incrementalGroup: PropTypes.object,\n  incrementalGroupEnabled: PropTypes.bool,\n};\nIncrementalGroup.childContextTypes = IncrementalGroup.contextTypes;\n\nmodule.exports = IncrementalGroup;\n"
  },
  {
    "path": "Libraries/Experimental/IncrementalPresenter.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule IncrementalPresenter\n * @flow\n */\n'use strict';\n\nconst IncrementalGroup = require('IncrementalGroup');\nconst React = require('React');\nconst PropTypes = require('prop-types');\nconst View = require('View');\n\nconst ViewPropTypes = require('ViewPropTypes');\n\nimport type {Context} from 'Incremental';\n\n/**\n * WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will\n * not be reliably announced.  The whole thing might be deleted, who knows? Use\n * at your own risk.\n *\n * `<IncrementalPresenter>` can be used to group sets of `<Incremental>` renders\n * such that they are initially invisible and removed from layout until all\n * decendents have finished rendering, at which point they are drawn all at once\n * so the UI doesn't jump around during the incremental rendering process.\n *\n * See Incremental.js for more info.\n */\ntype Props = {\n  name: string,\n  disabled?: boolean,\n  onDone?: () => void,\n  onLayout?: (event: Object) => void,\n  style?: mixed,\n  children?: any,\n}\nclass IncrementalPresenter extends React.Component<Props> {\n  context: Context;\n  _isDone: boolean;\n\n  static propTypes = {\n    name: PropTypes.string,\n    disabled: PropTypes.bool,\n    onDone: PropTypes.func,\n    onLayout: PropTypes.func,\n    style: ViewPropTypes.style,\n  };\n  static contextTypes = {\n    incrementalGroup: PropTypes.object,\n    incrementalGroupEnabled: PropTypes.bool,\n  };\n\n  constructor(props: Props, context: Context) {\n    super(props, context);\n    this._isDone = false;\n    (this: any).onDone = this.onDone.bind(this);\n  }\n  onDone() {\n    this._isDone = true;\n    if (this.props.disabled !== true &&\n        this.context.incrementalGroupEnabled !== false) {\n      // Avoid expensive re-renders and use setNativeProps\n      this.refs.view.setNativeProps(\n        {style: [this.props.style, {opacity: 1, position: 'relative'}]}\n      );\n    }\n    this.props.onDone && this.props.onDone();\n  }\n  render() {\n    if (this.props.disabled !== true &&\n        this.context.incrementalGroupEnabled !== false &&\n        !this._isDone) {\n      var style = [this.props.style, {opacity: 0, position: 'absolute'}];\n    } else {\n      var style = this.props.style;\n    }\n    return (\n      <IncrementalGroup\n        onDone={this.onDone}\n        name={this.props.name}\n        disabled={this.props.disabled}>\n        <View\n          children={this.props.children}\n          ref=\"view\"\n          style={style}\n          onLayout={this.props.onLayout}\n        />\n      </IncrementalGroup>\n    );\n  }\n}\n\nmodule.exports = IncrementalPresenter;\n"
  },
  {
    "path": "Libraries/Experimental/SwipeableRow/SwipeableFlatList.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SwipeableFlatList\n * @flow\n * @format\n */\n'use strict';\n\nimport type {Props as FlatListProps} from 'FlatList';\nimport type {renderItemType} from 'VirtualizedList';\n\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst SwipeableRow = require('SwipeableRow');\nconst FlatList = require('FlatList');\n\ntype SwipableListProps = {\n  /**\n   * To alert the user that swiping is possible, the first row can bounce\n   * on component mount.\n   */\n  bounceFirstRowOnMount: boolean,\n  // Maximum distance to open to after a swipe\n  maxSwipeDistance: number | (Object => number),\n  // Callback method to render the view that will be unveiled on swipe\n  renderQuickActions: renderItemType,\n};\n\ntype Props<ItemT> = SwipableListProps & FlatListProps<ItemT>;\n\ntype State = {\n  openRowKey: ?string,\n};\n\n/**\n * A container component that renders multiple SwipeableRow's in a FlatList\n * implementation. This is designed to be a drop-in replacement for the\n * standard React Native `FlatList`, so use it as if it were a FlatList, but\n * with extra props, i.e.\n *\n * <SwipeableListView renderRow={..} renderQuickActions={..} {..FlatList props} />\n *\n * SwipeableRow can be used independently of this component, but the main\n * benefit of using this component is\n *\n * - It ensures that at most 1 row is swiped open (auto closes others)\n * - It can bounce the 1st row of the list so users know it's swipeable\n * - Increase performance on iOS by locking list swiping when row swiping is occuring\n * - More to come\n */\n\nclass SwipeableFlatList<ItemT> extends React.Component<Props<ItemT>, State> {\n  props: Props<ItemT>;\n  state: State;\n\n  _flatListRef: ?FlatList<ItemT> = null;\n  _shouldBounceFirstRowOnMount: boolean = false;\n\n  static propTypes = {\n    ...FlatList.propTypes,\n\n    /**\n     * To alert the user that swiping is possible, the first row can bounce\n     * on component mount.\n     */\n    bounceFirstRowOnMount: PropTypes.bool.isRequired,\n\n    // Maximum distance to open to after a swipe\n    maxSwipeDistance: PropTypes.oneOfType([PropTypes.number, PropTypes.func])\n      .isRequired,\n\n    // Callback method to render the view that will be unveiled on swipe\n    renderQuickActions: PropTypes.func.isRequired,\n  };\n\n  static defaultProps = {\n    ...FlatList.defaultProps,\n    bounceFirstRowOnMount: true,\n    renderQuickActions: () => null,\n  };\n\n  constructor(props: Props<ItemT>, context: any): void {\n    super(props, context);\n    this.state = {\n      openRowKey: null,\n    };\n\n    this._shouldBounceFirstRowOnMount = this.props.bounceFirstRowOnMount;\n  }\n\n  render(): React.Node {\n    return (\n      <FlatList\n        {...this.props}\n        ref={ref => {\n          this._flatListRef = ref;\n        }}\n        onScroll={this._onScroll}\n        renderItem={this._renderItem}\n      />\n    );\n  }\n\n  _onScroll = (e): void => {\n    // Close any opens rows on ListView scroll\n    if (this.state.openRowKey) {\n      this.setState({\n        openRowKey: null,\n      });\n    }\n\n    this.props.onScroll && this.props.onScroll(e);\n  };\n\n  _renderItem = (info: Object): ?React.Element<any> => {\n    const slideoutView = this.props.renderQuickActions(info);\n    const key = this.props.keyExtractor(info.item, info.index);\n\n    // If renderQuickActions is unspecified or returns falsey, don't allow swipe\n    if (!slideoutView) {\n      return this.props.renderItem(info);\n    }\n\n    let shouldBounceOnMount = false;\n    if (this._shouldBounceFirstRowOnMount) {\n      this._shouldBounceFirstRowOnMount = false;\n      shouldBounceOnMount = true;\n    }\n\n    return (\n      <SwipeableRow\n        slideoutView={slideoutView}\n        isOpen={key === this.state.openRowKey}\n        maxSwipeDistance={this._getMaxSwipeDistance(info)}\n        onOpen={() => this._onOpen(key)}\n        onClose={() => this._onClose(key)}\n        shouldBounceOnMount={shouldBounceOnMount}\n        onSwipeEnd={this._setListViewScrollable}\n        onSwipeStart={this._setListViewNotScrollable}>\n        {this.props.renderItem(info)}\n      </SwipeableRow>\n    );\n  };\n\n  // This enables rows having variable width slideoutView.\n  _getMaxSwipeDistance(info: Object): number {\n    if (typeof this.props.maxSwipeDistance === 'function') {\n      return this.props.maxSwipeDistance(info);\n    }\n\n    return this.props.maxSwipeDistance;\n  }\n\n  _setListViewScrollableTo(value: boolean) {\n    if (this._flatListRef) {\n      this._flatListRef.setNativeProps({\n        scrollEnabled: value,\n      });\n    }\n  }\n\n  _setListViewScrollable = () => {\n    this._setListViewScrollableTo(true);\n  };\n\n  _setListViewNotScrollable = () => {\n    this._setListViewScrollableTo(false);\n  };\n\n  _onOpen(key: any): void {\n    this.setState({\n      openRowKey: key,\n    });\n  }\n\n  _onClose(key: any): void {\n    this.setState({\n      openRowKey: null,\n    });\n  }\n}\n\nmodule.exports = SwipeableFlatList;\n"
  },
  {
    "path": "Libraries/Experimental/SwipeableRow/SwipeableListView.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SwipeableListView\n * @flow\n */\n'use strict';\n\nconst ListView = require('ListView');\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst SwipeableListViewDataSource = require('SwipeableListViewDataSource');\nconst SwipeableRow = require('SwipeableRow');\n\ntype DefaultProps = {\n  bounceFirstRowOnMount: boolean,\n  renderQuickActions: Function,\n};\n\ntype Props = {\n  bounceFirstRowOnMount: boolean,\n  dataSource: SwipeableListViewDataSource,\n  maxSwipeDistance: number | (rowData: any, sectionID: string, rowID: string) => number,\n  onScroll?: ?Function,\n  renderRow: Function,\n  renderQuickActions: Function,\n};\n\ntype State = {\n  dataSource: Object,\n};\n\n/**\n * A container component that renders multiple SwipeableRow's in a ListView\n * implementation. This is designed to be a drop-in replacement for the\n * standard React Native `ListView`, so use it as if it were a ListView, but\n * with extra props, i.e.\n *\n * let ds = SwipeableListView.getNewDataSource();\n * ds.cloneWithRowsAndSections(dataBlob, ?sectionIDs, ?rowIDs);\n * // ..\n * <SwipeableListView renderRow={..} renderQuickActions={..} {..ListView props} />\n *\n * SwipeableRow can be used independently of this component, but the main\n * benefit of using this component is\n *\n * - It ensures that at most 1 row is swiped open (auto closes others)\n * - It can bounce the 1st row of the list so users know it's swipeable\n * - More to come\n */\nclass SwipeableListView extends React.Component<Props, State> {\n  props: Props;\n  state: State;\n\n  _listViewRef: ?React.Element<any> = null;\n  _shouldBounceFirstRowOnMount: boolean = false;\n\n  static getNewDataSource(): Object {\n    return new SwipeableListViewDataSource({\n      getRowData: (data, sectionID, rowID) => data[sectionID][rowID],\n      getSectionHeaderData: (data, sectionID) => data[sectionID],\n      rowHasChanged: (row1, row2) => row1 !== row2,\n      sectionHeaderHasChanged: (s1, s2) => s1 !== s2,\n    });\n  }\n\n  static propTypes = {\n    /**\n     * To alert the user that swiping is possible, the first row can bounce\n     * on component mount.\n     */\n    bounceFirstRowOnMount: PropTypes.bool.isRequired,\n    /**\n     * Use `SwipeableListView.getNewDataSource()` to get a data source to use,\n     * then use it just like you would a normal ListView data source\n     */\n    dataSource: PropTypes.instanceOf(SwipeableListViewDataSource).isRequired,\n    // Maximum distance to open to after a swipe\n    maxSwipeDistance: PropTypes.oneOfType([\n      PropTypes.number,\n      PropTypes.func,\n    ]).isRequired,\n    // Callback method to render the swipeable view\n    renderRow: PropTypes.func.isRequired,\n    // Callback method to render the view that will be unveiled on swipe\n    renderQuickActions: PropTypes.func.isRequired,\n  };\n\n  static defaultProps = {\n    bounceFirstRowOnMount: false,\n    renderQuickActions: () => null,\n  };\n\n  constructor(props: Props, context: any): void {\n    super(props, context);\n\n    this._shouldBounceFirstRowOnMount = this.props.bounceFirstRowOnMount;\n    this.state = {\n      dataSource: this.props.dataSource,\n    };\n  }\n\n  componentWillReceiveProps(nextProps: Props): void {\n    if (this.state.dataSource.getDataSource() !== nextProps.dataSource.getDataSource()) {\n      this.setState({\n        dataSource: nextProps.dataSource,\n      });\n    }\n  }\n\n  render(): React.Node {\n    return (\n      <ListView\n        {...this.props}\n        ref={(ref) => {\n          this._listViewRef = ref;\n        }}\n        dataSource={this.state.dataSource.getDataSource()}\n        onScroll={this._onScroll}\n        renderRow={this._renderRow}\n      />\n    );\n  }\n\n  _onScroll = (e): void => {\n    // Close any opens rows on ListView scroll\n    if (this.props.dataSource.getOpenRowID()) {\n      this.setState({\n        dataSource: this.state.dataSource.setOpenRowID(null),\n      });\n    }\n    this.props.onScroll && this.props.onScroll(e);\n  }\n\n  /**\n   * This is a work-around to lock vertical `ListView` scrolling on iOS and\n   * mimic Android behaviour. Locking vertical scrolling when horizontal\n   * scrolling is active allows us to significantly improve framerates\n   * (from high 20s to almost consistently 60 fps)\n   */\n  _setListViewScrollable(value: boolean): void {\n    if (this._listViewRef && typeof this._listViewRef.setNativeProps === 'function') {\n      this._listViewRef.setNativeProps({\n        scrollEnabled: value,\n      });\n    }\n  }\n\n  // Passing through ListView's getScrollResponder() function\n  getScrollResponder(): ?Object {\n    if (this._listViewRef && typeof this._listViewRef.getScrollResponder === 'function') {\n      return this._listViewRef.getScrollResponder();\n    }\n  }\n\n  // This enables rows having variable width slideoutView.\n  _getMaxSwipeDistance(rowData: Object, sectionID: string, rowID: string): number {\n    if (typeof this.props.maxSwipeDistance === 'function') {\n      return this.props.maxSwipeDistance(rowData, sectionID, rowID);\n    }\n\n    return this.props.maxSwipeDistance;\n  }\n\n  _renderRow = (rowData: Object, sectionID: string, rowID: string): React.Element<any> => {\n    const slideoutView = this.props.renderQuickActions(rowData, sectionID, rowID);\n\n    // If renderQuickActions is unspecified or returns falsey, don't allow swipe\n    if (!slideoutView) {\n      return this.props.renderRow(rowData, sectionID, rowID);\n    }\n\n    let shouldBounceOnMount = false;\n    if (this._shouldBounceFirstRowOnMount) {\n      this._shouldBounceFirstRowOnMount = false;\n      shouldBounceOnMount = rowID === this.props.dataSource.getFirstRowID();\n    }\n\n    return (\n      <SwipeableRow\n        slideoutView={slideoutView}\n        isOpen={rowData.id === this.props.dataSource.getOpenRowID()}\n        maxSwipeDistance={this._getMaxSwipeDistance(rowData, sectionID, rowID)}\n        key={rowID}\n        onOpen={() => this._onOpen(rowData.id)}\n        onClose={() => this._onClose(rowData.id)}\n        onSwipeEnd={() => this._setListViewScrollable(true)}\n        onSwipeStart={() => this._setListViewScrollable(false)}\n        shouldBounceOnMount={shouldBounceOnMount}>\n        {this.props.renderRow(rowData, sectionID, rowID)}\n      </SwipeableRow>\n    );\n  };\n\n  _onOpen(rowID: string): void {\n    this.setState({\n      dataSource: this.state.dataSource.setOpenRowID(rowID),\n    });\n  }\n\n  _onClose(rowID: string): void {\n    this.setState({\n      dataSource: this.state.dataSource.setOpenRowID(null),\n    });\n  }\n}\n\nmodule.exports = SwipeableListView;\n"
  },
  {
    "path": "Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SwipeableListViewDataSource\n */\n'use strict';\n\nconst ListViewDataSource = require('ListViewDataSource');\n\n/**\n * Data source wrapper around ListViewDataSource to allow for tracking of\n * which row is swiped open and close opened row(s) when another row is swiped\n * open.\n *\n * See https://github.com/facebook/react-native/pull/5602 for why\n * ListViewDataSource is not subclassed.\n */\nclass SwipeableListViewDataSource {\n  _previousOpenRowID: string;\n  _openRowID: string;\n\n  _dataBlob: any;\n  _dataSource: ListViewDataSource;\n\n  rowIdentities: Array<Array<string>>;\n  sectionIdentities: Array<string>;\n\n  constructor(params: Object) {\n    this._dataSource = new ListViewDataSource({\n      getRowData: params.getRowData,\n      getSectionHeaderData: params.getSectionHeaderData,\n      rowHasChanged: (row1, row2) => {\n        /**\n         * Row needs to be re-rendered if its swiped open/close status is\n         * changed, or its data blob changed.\n         */\n        return (\n          (row1.id !== this._previousOpenRowID && row2.id === this._openRowID) ||\n          (row1.id === this._previousOpenRowID && row2.id !== this._openRowID) ||\n          params.rowHasChanged(row1, row2)\n        );\n      },\n      sectionHeaderHasChanged: params.sectionHeaderHasChanged,\n    });\n  }\n\n  cloneWithRowsAndSections(\n    dataBlob: any,\n    sectionIdentities: ?Array<string>,\n    rowIdentities: ?Array<Array<string>>\n  ): SwipeableListViewDataSource {\n    this._dataSource = this._dataSource.cloneWithRowsAndSections(\n      dataBlob,\n      sectionIdentities,\n      rowIdentities\n    );\n\n    this._dataBlob = dataBlob;\n    this.rowIdentities = this._dataSource.rowIdentities;\n    this.sectionIdentities = this._dataSource.sectionIdentities;\n\n    return this;\n  }\n\n  // For the actual ListView to use\n  getDataSource(): ListViewDataSource {\n    return this._dataSource;\n  }\n\n  getOpenRowID(): ?string {\n    return this._openRowID;\n  }\n\n  getFirstRowID(): ?string {\n    /**\n     * If rowIdentities is specified, find the first data row from there since\n     * we don't want to attempt to bounce section headers. If unspecified, find\n     * the first data row from _dataBlob.\n     */\n    if (this.rowIdentities) {\n      return this.rowIdentities[0] && this.rowIdentities[0][0];\n    }\n    return Object.keys(this._dataBlob)[0];\n  }\n\n  getLastRowID(): ?string {\n    if (this.rowIdentities && this.rowIdentities.length) {\n      const lastSection = this.rowIdentities[this.rowIdentities.length - 1];\n      if (lastSection && lastSection.length) {\n       return lastSection[lastSection.length - 1];\n     }\n    }\n   return Object.keys(this._dataBlob)[this._dataBlob.length - 1];\n  }\n\n  setOpenRowID(rowID: string): SwipeableListViewDataSource {\n    this._previousOpenRowID = this._openRowID;\n    this._openRowID = rowID;\n\n    this._dataSource = this._dataSource.cloneWithRowsAndSections(\n      this._dataBlob,\n      this.sectionIdentities,\n      this.rowIdentities\n    );\n\n    return this;\n  }\n}\n\nmodule.exports = SwipeableListViewDataSource;\n"
  },
  {
    "path": "Libraries/Experimental/SwipeableRow/SwipeableQuickActionButton.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SwipeableQuickActionButton\n * @flow\n */\n'use strict';\n\nconst Image = require('Image');\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst Text = require('Text');\nconst TouchableHighlight = require('TouchableHighlight');\nconst View = require('View');\nconst ViewPropTypes = require('ViewPropTypes');\n\nimport type {ImageSource} from 'ImageSource';\n\n/**\n * Standard set of quick action buttons that can, if the user chooses, be used\n * with SwipeableListView. Each button takes an image and text with optional\n * formatting.\n */\nclass SwipeableQuickActionButton extends React.Component<{\n  accessibilityLabel?: string,\n  imageSource: ImageSource | number,\n  imageStyle?: ?ViewPropTypes.style,\n  onPress?: Function,\n  style?: ?ViewPropTypes.style,\n  testID?: string,\n  text?: ?(string | Object | Array<string | Object>),\n  textStyle?: ?ViewPropTypes.style,\n}> {\n  static propTypes = {\n    accessibilityLabel: PropTypes.string,\n    imageSource: Image.propTypes.source.isRequired,\n    imageStyle: Image.propTypes.style,\n    onPress: PropTypes.func,\n    style: ViewPropTypes.style,\n    testID: PropTypes.string,\n    text: PropTypes.string,\n    textStyle: Text.propTypes.style,\n  };\n\n  render(): React.Node {\n    if (!this.props.imageSource && !this.props.text) {\n      return null;\n    }\n\n    return (\n      <TouchableHighlight\n        onPress={this.props.onPress}\n        testID={this.props.testID}\n        underlayColor=\"transparent\">\n        <View style={this.props.style}>\n          <Image\n            accessibilityLabel={this.props.accessibilityLabel}\n            source={this.props.imageSource}\n            style={this.props.imageStyle}\n          />\n          <Text style={this.props.textStyle}>\n            {this.props.text}\n          </Text>\n        </View>\n      </TouchableHighlight>\n    );\n  }\n}\n\nmodule.exports = SwipeableQuickActionButton;\n"
  },
  {
    "path": "Libraries/Experimental/SwipeableRow/SwipeableQuickActions.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SwipeableQuickActions\n * @flow\n */\n'use strict';\n\nconst React = require('React');\nconst StyleSheet = require('StyleSheet');\nconst View = require('View');\n\nconst ViewPropTypes = require('ViewPropTypes');\n\n/**\n * A thin wrapper around standard quick action buttons that can, if the user\n * chooses, be used with SwipeableListView. Sample usage is as follows, in the\n * renderQuickActions callback:\n *\n * <SwipeableQuickActions>\n *   <SwipeableQuickActionButton {..props} />\n *   <SwipeableQuickActionButton {..props} />\n * </SwipeableQuickActions>\n */\nclass SwipeableQuickActions extends React.Component<{style?: $FlowFixMe}> {\n  static propTypes = {\n    style: ViewPropTypes.style,\n  };\n\n  render(): React.Node {\n    // $FlowFixMe found when converting React.createClass to ES6\n    const children = this.props.children;\n    let buttons = [];\n\n    // Multiple children\n    if (children instanceof Array) {\n      for (let i = 0; i < children.length; i++) {\n        buttons.push(children[i]);\n\n        // $FlowFixMe found when converting React.createClass to ES6\n        if (i < this.props.children.length - 1) { // Not last button\n          buttons.push(<View key={i} style={styles.divider} />);\n        }\n      }\n    } else { // 1 child\n      buttons = children;\n    }\n\n    return (\n      <View style={[styles.background, this.props.style]}>\n        {buttons}\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  background: {\n    flex: 1,\n    flexDirection: 'row',\n    justifyContent: 'flex-end',\n  },\n  divider: {\n    width: 4,\n  },\n});\n\nmodule.exports = SwipeableQuickActions;\n"
  },
  {
    "path": "Libraries/Experimental/SwipeableRow/SwipeableRow.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SwipeableRow\n * @flow\n */\n'use strict';\n\nconst Animated = require('Animated');\nconst I18nManager = require('I18nManager');\nconst PanResponder = require('PanResponder');\nconst React = require('React');\nconst PropTypes = require('prop-types');\nconst StyleSheet = require('StyleSheet');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst TimerMixin = require('react-timer-mixin');\nconst View = require('View');\n\nconst createReactClass = require('create-react-class');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst emptyFunction = require('fbjs/lib/emptyFunction');\n\nconst IS_RTL = I18nManager.isRTL;\n\n// NOTE: Eventually convert these consts to an input object of configurations\n\n// Position of the left of the swipable item when closed\nconst CLOSED_LEFT_POSITION = 0;\n// Minimum swipe distance before we recognize it as such\nconst HORIZONTAL_SWIPE_DISTANCE_THRESHOLD = 10;\n// Minimum swipe speed before we fully animate the user's action (open/close)\nconst HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD = 0.3;\n// Factor to divide by to get slow speed; i.e. 4 means 1/4 of full speed\nconst SLOW_SPEED_SWIPE_FACTOR = 4;\n// Time, in milliseconds, of how long the animated swipe should be\nconst SWIPE_DURATION = 300;\n\n/**\n * On SwipeableListView mount, the 1st item will bounce to show users it's\n * possible to swipe\n */\nconst ON_MOUNT_BOUNCE_DELAY = 700;\nconst ON_MOUNT_BOUNCE_DURATION = 400;\n\n// Distance left of closed position to bounce back when right-swiping from closed\nconst RIGHT_SWIPE_BOUNCE_BACK_DISTANCE = 30;\nconst RIGHT_SWIPE_BOUNCE_BACK_DURATION = 300;\n/**\n * Max distance of right swipe to allow (right swipes do functionally nothing).\n * Must be multiplied by SLOW_SPEED_SWIPE_FACTOR because gestureState.dx tracks\n * how far the finger swipes, and not the actual animation distance.\n*/\nconst RIGHT_SWIPE_THRESHOLD = 30 * SLOW_SPEED_SWIPE_FACTOR;\n\n/**\n * Creates a swipable row that allows taps on the main item and a custom View\n * on the item hidden behind the row. Typically this should be used in\n * conjunction with SwipeableListView for additional functionality, but can be\n * used in a normal ListView. See the renderRow for SwipeableListView to see how\n * to use this component separately.\n */\nconst SwipeableRow = createReactClass({\n  displayName: 'SwipeableRow',\n  _panResponder: {},\n  _previousLeft: CLOSED_LEFT_POSITION,\n\n  mixins: [TimerMixin],\n\n  propTypes: {\n    children: PropTypes.any,\n    isOpen: PropTypes.bool,\n    preventSwipeRight: PropTypes.bool,\n    maxSwipeDistance: PropTypes.number.isRequired,\n    onOpen: PropTypes.func.isRequired,\n    onClose: PropTypes.func.isRequired,\n    onSwipeEnd: PropTypes.func.isRequired,\n    onSwipeStart: PropTypes.func.isRequired,\n    // Should bounce the row on mount\n    shouldBounceOnMount: PropTypes.bool,\n    /**\n     * A ReactElement that is unveiled when the user swipes\n     */\n    slideoutView: PropTypes.node.isRequired,\n    /**\n     * The minimum swipe distance required before fully animating the swipe. If\n     * the user swipes less than this distance, the item will return to its\n     * previous (open/close) position.\n     */\n    swipeThreshold: PropTypes.number.isRequired,\n  },\n\n  getInitialState(): Object {\n    return {\n      currentLeft: new Animated.Value(this._previousLeft),\n      /**\n       * In order to render component A beneath component B, A must be rendered\n       * before B. However, this will cause \"flickering\", aka we see A briefly\n       * then B. To counter this, _isSwipeableViewRendered flag is used to set\n       * component A to be transparent until component B is loaded.\n       */\n      isSwipeableViewRendered: false,\n      rowHeight: (null: ?number),\n    };\n  },\n\n  getDefaultProps(): Object {\n    return {\n      isOpen: false,\n      preventSwipeRight: false,\n      maxSwipeDistance: 0,\n      onOpen: emptyFunction,\n      onClose: emptyFunction,\n      onSwipeEnd: emptyFunction,\n      onSwipeStart: emptyFunction,\n      swipeThreshold: 30,\n    };\n  },\n\n  componentWillMount(): void {\n    this._panResponder = PanResponder.create({\n      onMoveShouldSetPanResponderCapture: this._handleMoveShouldSetPanResponderCapture,\n      onPanResponderGrant: this._handlePanResponderGrant,\n      onPanResponderMove: this._handlePanResponderMove,\n      onPanResponderRelease: this._handlePanResponderEnd,\n      onPanResponderTerminationRequest: this._onPanResponderTerminationRequest,\n      onPanResponderTerminate: this._handlePanResponderEnd,\n      onShouldBlockNativeResponder: (event, gestureState) => false,\n    });\n  },\n\n  componentDidMount(): void {\n    if (this.props.shouldBounceOnMount) {\n      /**\n       * Do the on mount bounce after a delay because if we animate when other\n       * components are loading, the animation will be laggy\n       */\n      this.setTimeout(() => {\n        this._animateBounceBack(ON_MOUNT_BOUNCE_DURATION);\n      }, ON_MOUNT_BOUNCE_DELAY);\n    }\n  },\n\n  componentWillReceiveProps(nextProps: Object): void {\n    /**\n     * We do not need an \"animateOpen(noCallback)\" because this animation is\n     * handled internally by this component.\n     */\n    if (this.props.isOpen && !nextProps.isOpen) {\n      this._animateToClosedPosition();\n    }\n  },\n\n  shouldComponentUpdate(nextProps: Object, nextState: Object): boolean {\n    if (this.props.shouldBounceOnMount && !nextProps.shouldBounceOnMount) {\n      // No need to rerender if SwipeableListView is disabling the bounce flag\n      return false;\n    }\n\n    return true;\n  },\n\n  render(): React.Element<any> {\n    // The view hidden behind the main view\n    let slideOutView;\n    if (this.state.isSwipeableViewRendered && this.state.rowHeight) {\n      slideOutView = (\n        <View style={[\n          styles.slideOutContainer,\n          {height: this.state.rowHeight},\n          ]}>\n          {this.props.slideoutView}\n        </View>\n      );\n    }\n\n    // The swipeable item\n    const swipeableView = (\n      <Animated.View\n        onLayout={this._onSwipeableViewLayout}\n        style={{transform: [{translateX: this.state.currentLeft}]}}>\n        {this.props.children}\n      </Animated.View>\n    );\n\n    return (\n      <View\n        {...this._panResponder.panHandlers}>\n        {slideOutView}\n        {swipeableView}\n      </View>\n    );\n  },\n\n  close(): void {\n    this.props.onClose();\n    this._animateToClosedPosition();\n  },\n\n  _onSwipeableViewLayout(event: Object): void {\n    this.setState({\n      isSwipeableViewRendered: true,\n      rowHeight: event.nativeEvent.layout.height,\n    });\n  },\n\n  _handleMoveShouldSetPanResponderCapture(\n    event: Object,\n    gestureState: Object,\n  ): boolean {\n    // Decides whether a swipe is responded to by this component or its child\n    return gestureState.dy < 10 && this._isValidSwipe(gestureState);\n  },\n\n  _handlePanResponderGrant(event: Object, gestureState: Object): void {\n\n  },\n\n  _handlePanResponderMove(event: Object, gestureState: Object): void {\n    if (this._isSwipingExcessivelyRightFromClosedPosition(gestureState)) {\n      return;\n    }\n\n    this.props.onSwipeStart();\n\n    if (this._isSwipingRightFromClosed(gestureState)) {\n      this._swipeSlowSpeed(gestureState);\n    } else {\n      this._swipeFullSpeed(gestureState);\n    }\n  },\n\n  _isSwipingRightFromClosed(gestureState: Object): boolean {\n    const gestureStateDx = IS_RTL ? -gestureState.dx : gestureState.dx;\n    return this._previousLeft === CLOSED_LEFT_POSITION && gestureStateDx > 0;\n  },\n\n  _swipeFullSpeed(gestureState: Object): void {\n    this.state.currentLeft.setValue(this._previousLeft + gestureState.dx);\n  },\n\n  _swipeSlowSpeed(gestureState: Object): void {\n    this.state.currentLeft.setValue(\n      this._previousLeft + gestureState.dx / SLOW_SPEED_SWIPE_FACTOR,\n    );\n  },\n\n  _isSwipingExcessivelyRightFromClosedPosition(gestureState: Object): boolean {\n    /**\n     * We want to allow a BIT of right swipe, to allow users to know that\n     * swiping is available, but swiping right does not do anything\n     * functionally.\n     */\n    const gestureStateDx = IS_RTL ? -gestureState.dx : gestureState.dx;\n    return (\n      this._isSwipingRightFromClosed(gestureState) &&\n      gestureStateDx > RIGHT_SWIPE_THRESHOLD\n    );\n  },\n\n  _onPanResponderTerminationRequest(\n    event: Object,\n    gestureState: Object,\n  ): boolean {\n    return false;\n  },\n\n  _animateTo(\n    toValue: number,\n    duration: number = SWIPE_DURATION,\n    callback: Function = emptyFunction,\n  ): void {\n    Animated.timing(\n      this.state.currentLeft,\n      {\n        duration,\n        toValue,\n        useNativeDriver: true,\n      },\n    ).start(() => {\n      this._previousLeft = toValue;\n      callback();\n    });\n  },\n\n  _animateToOpenPosition(): void {\n    const maxSwipeDistance = IS_RTL ? -this.props.maxSwipeDistance : this.props.maxSwipeDistance;\n    this._animateTo(-maxSwipeDistance);\n  },\n\n  _animateToOpenPositionWith(\n    speed: number,\n    distMoved: number,\n  ): void {\n    /**\n     * Ensure the speed is at least the set speed threshold to prevent a slow\n     * swiping animation\n     */\n    speed = (\n      speed > HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD ?\n      speed :\n      HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD\n    );\n    /**\n     * Calculate the duration the row should take to swipe the remaining distance\n     * at the same speed the user swiped (or the speed threshold)\n     */\n    const duration = Math.abs((this.props.maxSwipeDistance - Math.abs(distMoved)) / speed);\n    const maxSwipeDistance = IS_RTL ? -this.props.maxSwipeDistance : this.props.maxSwipeDistance;\n    this._animateTo(-maxSwipeDistance, duration);\n  },\n\n  _animateToClosedPosition(duration: number = SWIPE_DURATION): void {\n    this._animateTo(CLOSED_LEFT_POSITION, duration);\n  },\n\n  _animateToClosedPositionDuringBounce(): void {\n    this._animateToClosedPosition(RIGHT_SWIPE_BOUNCE_BACK_DURATION);\n  },\n\n  _animateBounceBack(duration: number): void {\n    /**\n     * When swiping right, we want to bounce back past closed position on release\n     * so users know they should swipe right to get content.\n     */\n    const swipeBounceBackDistance = IS_RTL ?\n      -RIGHT_SWIPE_BOUNCE_BACK_DISTANCE :\n      RIGHT_SWIPE_BOUNCE_BACK_DISTANCE;\n    this._animateTo(\n      -swipeBounceBackDistance,\n      duration,\n      this._animateToClosedPositionDuringBounce,\n    );\n  },\n\n  // Ignore swipes due to user's finger moving slightly when tapping\n  _isValidSwipe(gestureState: Object): boolean {\n    if (this.props.preventSwipeRight && this._previousLeft === CLOSED_LEFT_POSITION && gestureState.dx > 0) {\n      return false;\n    }\n\n    return Math.abs(gestureState.dx) > HORIZONTAL_SWIPE_DISTANCE_THRESHOLD;\n  },\n\n  _shouldAnimateRemainder(gestureState: Object): boolean {\n    /**\n     * If user has swiped past a certain distance, animate the rest of the way\n     * if they let go\n     */\n    return (\n      Math.abs(gestureState.dx) > this.props.swipeThreshold ||\n      gestureState.vx > HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD\n    );\n  },\n\n  _handlePanResponderEnd(event: Object, gestureState: Object): void {\n    const horizontalDistance = IS_RTL ? -gestureState.dx : gestureState.dx;\n    if (this._isSwipingRightFromClosed(gestureState)) {\n      this.props.onOpen();\n      this._animateBounceBack(RIGHT_SWIPE_BOUNCE_BACK_DURATION);\n    } else if (this._shouldAnimateRemainder(gestureState)) {\n      if (horizontalDistance < 0) {\n        // Swiped left\n        this.props.onOpen();\n        this._animateToOpenPositionWith(gestureState.vx, horizontalDistance);\n      } else {\n        // Swiped right\n        this.props.onClose();\n        this._animateToClosedPosition();\n      }\n    } else {\n      if (this._previousLeft === CLOSED_LEFT_POSITION) {\n        this._animateToClosedPosition();\n      } else {\n        this._animateToOpenPosition();\n      }\n    }\n\n    this.props.onSwipeEnd();\n  },\n});\n\nconst styles = StyleSheet.create({\n  slideOutContainer: {\n    bottom: 0,\n    left: 0,\n    position: 'absolute',\n    right: 0,\n    top: 0,\n  },\n});\n\nmodule.exports = SwipeableRow;\n"
  },
  {
    "path": "Libraries/Experimental/WindowedListView.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule WindowedListView\n * @flow\n */\n'use strict';\n\nconst Batchinator = require('Batchinator');\nconst IncrementalGroup = require('IncrementalGroup');\nconst React = require('React');\nconst ScrollView = require('ScrollView');\nconst Set = require('Set');\nconst StyleSheet = require('StyleSheet');\nconst Systrace = require('Systrace');\nconst View = require('View');\nconst ViewabilityHelper = require('ViewabilityHelper');\n\nconst clamp = require('clamp');\nconst deepDiffer = require('deepDiffer');\nconst infoLog = require('infoLog');\nconst invariant = require('fbjs/lib/invariant');\nconst nullthrows = require('fbjs/lib/nullthrows');\n\nimport type {NativeMethodsMixinType} from 'ReactNativeTypes';\n\nconst DEBUG = false;\n\n/**\n * An experimental ListView implementation designed for efficient memory usage\n * when rendering huge/infinite lists. It works by rendering a subset of rows\n * and replacing offscreen rows with an empty spacer, which means that it has to\n * re-render rows when scrolling back up.\n *\n * Note that rows must be the same height when they are re-mounted as when they\n * are unmounted otherwise the content will jump around. This means that any\n * state that affects the height, such as tap to expand, should be stored\n * outside the row component to maintain continuity.\n *\n * This is not a drop-in replacement for `ListView` - many features are not\n * supported, including section headers, dataSources, horizontal layout, etc.\n *\n * Row data should be provided as a simple array corresponding to rows.  `===`\n * is used to determine if a row has changed and should be re-rendered.\n *\n * Rendering is done incrementally one row at a time to minimize the amount of\n * work done per JS event tick. Individual rows can also use <Incremental>\n * to further break up the work and keep the app responsive and improve scroll\n * perf if rows get exceedingly complex.\n *\n * Note that it's possible to scroll faster than rows can be rendered. Instead\n * of showing the user a bunch of un-mounted blank space, WLV sets contentInset\n * to prevent scrolling into unrendered areas. Supply the\n * `renderWindowBoundaryIndicator` prop to indicate the boundary to the user,\n * e.g. with a row placeholder.\n */\ntype Props = {\n  /**\n   * A simple array of data blobs that are passed to the renderRow function in\n   * order. Note there is no dataSource like in the standard `ListView`.\n   */\n  data: Array<{rowKey: string, rowData: any}>,\n  /**\n   * Takes a data blob from the `data` array prop plus some meta info and should\n   * return a row.\n   */\n  renderRow: (\n    rowData: any, sectionIdx: number, rowIdx: number, rowKey: string\n  ) => ?React.Element<any>,\n  /**\n   * Rendered when the list is scrolled faster than rows can be rendered.\n   */\n  renderWindowBoundaryIndicator?: (\n    showIndicator: boolean,\n  ) => ?React.Element<any>,\n  /**\n   * Always rendered at the bottom of all the rows.\n   */\n  renderFooter?: (\n    showFooter: boolean,\n  ) => ?React.Element<any>,\n  /**\n   * Pipes through normal onScroll events from the underlying `ScrollView`.\n   */\n  onScroll?: (event: Object) => void,\n  /**\n   * Called when the rows that are visible in the viewport change.\n   */\n  onVisibleRowsChanged?: (firstIdx: number, count: number) => void,\n  /**\n   * Called when the viewability of rows changes, as defined by the\n   * `viewablePercentThreshold` prop.\n   */\n  onViewableRowsChanged?: (viewableRows: Array<number>) => void,\n  /**\n   * The percent of a row that must be visible to consider it \"viewable\".\n   */\n  viewablePercentThreshold: number,\n  /**\n   * Number of rows to render on first mount.\n   */\n  initialNumToRender: number,\n  /**\n   * Maximum number of rows to render while scrolling, i.e. the window size.\n   */\n  maxNumToRender: number,\n  /**\n   * Number of rows to render beyond the viewport. Note that this combined with\n   * `maxNumToRender` and the number of rows that can fit in one screen will\n   * determine how many rows to render above the viewport.\n   */\n  numToRenderAhead: number,\n  /**\n   * Used to log perf events for async row rendering.\n   */\n  asyncRowPerfEventName?: string,\n  /**\n   * A function that returns the scrollable component in which the list rows\n   * are rendered. Defaults to returning a ScrollView with the given props.\n   */\n  renderScrollComponent: (props: ?Object) => React.Element<any>,\n  /**\n   * Use to disable incremental rendering when not wanted, e.g. to speed up initial render.\n   */\n  disableIncrementalRendering: boolean,\n  /**\n   * This determines how frequently events such as scroll and layout can trigger a re-render.\n   */\n  recomputeRowsBatchingPeriod: number,\n  /**\n   * Called when rows will be mounted/unmounted. Mounted rows always form a contiguous block so it\n   * is expressed as a range of start plus count.\n   */\n  onMountedRowsWillChange?: (firstIdx: number, count: number) => void,\n  /**\n   * Change this when you want to make sure the WindowedListView will re-render, for example when\n   * the result of `renderScrollComponent` might change. It will be compared in\n   * `shouldComponentUpdate`.\n   */\n  shouldUpdateToken?: string,\n};\n\ntype State = {\n  boundaryIndicatorHeight?: number,\n  firstRow: number,\n  lastRow: number,\n};\nclass WindowedListView extends React.Component<Props, State> {\n  /**\n   * Recomputing which rows to render is batched up and run asynchronously to avoid wastful updates,\n   * e.g. from multiple layout updates in rapid succession.\n   */\n  _computeRowsToRenderBatcher: Batchinator;\n  _firstVisible: number = -1;\n  _lastVisible: number = -1;\n  _scrollOffsetY: number = 0;\n  _isScrolling: boolean = false;\n  _frameHeight: number = 0;\n  _rowFrames: {[key: string]: Object} = {};\n  _rowRenderMode: {[key: string]: null | 'async' | 'sync'} = {};\n  _rowFramesDirty: boolean = false;\n  _hasCalledOnEndReached: boolean = false;\n  _willComputeRowsToRender: boolean = false;\n  _viewableRows: Array<number> = [];\n  _cellsInProgress: Set<string> = new Set();\n  _scrollRef: ?ScrollView;\n  _viewabilityHelper: ViewabilityHelper;\n\n  static defaultProps = {\n    initialNumToRender: 10,\n    maxNumToRender: 30,\n    numToRenderAhead: 10,\n    viewablePercentThreshold: 50,\n    /* $FlowFixMe(>=0.59.0 site=react_native_fb) This comment suppresses an\n     * error caught by Flow 0.59 which was not caught before. Most likely, this\n     * error is because an exported function parameter is missing an\n     * annotation. Without an annotation, these parameters are uncovered by\n     * Flow. */\n    renderScrollComponent: (props) => <ScrollView {...props} />,\n    disableIncrementalRendering: false,\n    recomputeRowsBatchingPeriod: 10, // This should capture most events that happen within a frame\n  };\n\n  constructor(props: Props) {\n    super(props);\n    invariant(\n      this.props.numToRenderAhead < this.props.maxNumToRender,\n      'WindowedListView: numToRenderAhead must be less than maxNumToRender'\n    );\n    this._computeRowsToRenderBatcher = new Batchinator(\n      () => this._computeRowsToRender(this.props),\n      this.props.recomputeRowsBatchingPeriod,\n    );\n    this._viewabilityHelper = new ViewabilityHelper({\n      viewAreaCoveragePercentThreshold: this.props.viewablePercentThreshold,\n    });\n    this.state = {\n      firstRow: 0,\n      lastRow: Math.min(this.props.data.length, this.props.initialNumToRender) - 1,\n    };\n  }\n  getScrollResponder(): ?ScrollView {\n    return this._scrollRef &&\n      this._scrollRef.getScrollResponder &&\n      this._scrollRef.getScrollResponder();\n  }\n  shouldComponentUpdate(newProps: Props, newState: State): boolean {\n    DEBUG && infoLog('WLV: shouldComponentUpdate...');\n    if (newState !== this.state) {\n      DEBUG && infoLog('  yes: ', {newState, oldState: this.state});\n      return true;\n    }\n    for (const key in newProps) {\n      if (key !== 'data' && newProps[key] !== this.props[key]) {\n        DEBUG && infoLog('  yes, non-data prop change: ', {key});\n        return true;\n      }\n    }\n    const newDataSubset = newProps.data.slice(newState.firstRow, newState.lastRow + 1);\n    const prevDataSubset = this.props.data.slice(this.state.firstRow, this.state.lastRow + 1);\n    if (newDataSubset.length !== prevDataSubset.length) {\n      DEBUG && infoLog(\n        '  yes, subset length: ',\n        {newLen: newDataSubset.length, oldLen: prevDataSubset.length}\n      );\n      return true;\n    }\n    for (let idx = 0; idx < newDataSubset.length; idx++) {\n      if (newDataSubset[idx].rowData !== prevDataSubset[idx].rowData ||\n          newDataSubset[idx].rowKey !== prevDataSubset[idx].rowKey) {\n        DEBUG && infoLog(\n          '  yes, data change: ',\n          {idx, new: newDataSubset[idx], old: prevDataSubset[idx]}\n        );\n        return true;\n      }\n    }\n    DEBUG && infoLog('  knope');\n    return false;\n  }\n  componentWillReceiveProps() {\n    this._computeRowsToRenderBatcher.schedule();\n  }\n  _onMomentumScrollEnd = (e: Object) => {\n    this._onScroll(e);\n  };\n  _getFrameMetrics = (index: number): ?{length: number, offset: number} => {\n    const frame = this._rowFrames[this.props.data[index].rowKey];\n    return frame && {length: frame.height, offset: frame.y};\n  }\n  _onScroll = (e: Object) => {\n    const newScrollY = e.nativeEvent.contentOffset.y;\n    this._isScrolling = this._scrollOffsetY !== newScrollY;\n    this._scrollOffsetY = newScrollY;\n    this._frameHeight = e.nativeEvent.layoutMeasurement.height;\n    // We don't want to enqueue any updates if any cells are in the middle of an incremental render,\n    // because it would just be wasted work.\n    if (this._cellsInProgress.size === 0) {\n      this._computeRowsToRenderBatcher.schedule();\n    }\n    if (this.props.onViewableRowsChanged && Object.keys(this._rowFrames).length) {\n      const viewableRows = this._viewabilityHelper.computeViewableItems(\n        this.props.data.length,\n        e.nativeEvent.contentOffset.y,\n        e.nativeEvent.layoutMeasurement.height,\n        this._getFrameMetrics,\n      );\n      if (deepDiffer(viewableRows, this._viewableRows)) {\n        this._viewableRows = viewableRows;\n        nullthrows(this.props.onViewableRowsChanged)(this._viewableRows);\n      }\n    }\n    this.props.onScroll && this.props.onScroll(e);\n  };\n  // Caller does the diffing so we don't have to.\n  _onNewLayout = (params: {rowKey: string, layout: Object}) => {\n    const {rowKey, layout} = params;\n    if (DEBUG) {\n      const prev = this._rowFrames[rowKey] || {};\n      infoLog(\n        'record layout for row: ',\n        {k: rowKey, h: layout.height, y: layout.y, x: layout.x, hp: prev.height, yp: prev.y}\n      );\n      if (this._rowFrames[rowKey]) {\n        const deltaY = Math.abs(this._rowFrames[rowKey].y - layout.y);\n        const deltaH = Math.abs(this._rowFrames[rowKey].height - layout.height);\n        if (deltaY > 2 || deltaH > 2) {\n          const dataEntry = this.props.data.find((datum) => datum.rowKey === rowKey);\n          console.warn(\n            'layout jump: ',\n            {dataEntry, prevLayout: this._rowFrames[rowKey], newLayout: layout}\n          );\n        }\n      }\n    }\n    this._rowFrames[rowKey] = {...layout, offscreenLayoutDone: true};\n    this._rowFramesDirty = true;\n    if (this._cellsInProgress.size === 0) {\n      this._computeRowsToRenderBatcher.schedule();\n    }\n  };\n  _onWillUnmountCell = (rowKey: string) => {\n    if (this._rowFrames[rowKey]) {\n      this._rowFrames[rowKey].offscreenLayoutDone = false;\n      this._rowRenderMode[rowKey] = null;\n    }\n  };\n  /**\n   * This is used to keep track of cells that are in the process of rendering. If any cells are in\n   * progress, then other updates are skipped because they will just be wasted work.\n   */\n  _onProgressChange = ({rowKey, inProgress}: {rowKey: string, inProgress: boolean}) => {\n    if (inProgress) {\n      this._cellsInProgress.add(rowKey);\n    } else {\n      this._cellsInProgress.delete(rowKey);\n    }\n  };\n  componentWillUnmount() {\n    this._computeRowsToRenderBatcher.dispose();\n  }\n  _computeRowsToRender(props: Object): void {\n    const totalRows = props.data.length;\n    if (totalRows === 0) {\n      this._updateVisibleRows(-1, -1);\n      this.setState({\n        firstRow: 0,\n        lastRow: -1,\n      });\n      return;\n    }\n    const rowFrames = this._rowFrames;\n    let firstVisible = -1;\n    let lastVisible = 0;\n    let lastRow = clamp(0, this.state.lastRow, totalRows - 1);\n    const top = this._scrollOffsetY;\n    const bottom = top + this._frameHeight;\n    for (let idx = 0; idx < lastRow; idx++) {\n      const frame = rowFrames[props.data[idx].rowKey];\n      if (!frame) {\n        // No frame - sometimes happens when they come out of order, so just wait for the rest.\n        return;\n      }\n      if (((frame.y + frame.height) > top) && (firstVisible < 0)) {\n        firstVisible = idx;\n      }\n      if (frame.y < bottom) {\n        lastVisible = idx;\n      } else {\n        break;\n      }\n    }\n    if (firstVisible === -1) {\n      firstVisible = 0;\n    }\n    this._updateVisibleRows(firstVisible, lastVisible);\n\n    // Unfortuantely, we can't use <Incremental> to simplify our increment logic in this function\n    // because we need to make sure that cells are rendered in the right order one at a time when\n    // scrolling back up.\n\n    const numRendered = lastRow - this.state.firstRow + 1;\n    // Our last row target that we will approach incrementally\n    const targetLastRow = clamp(\n      numRendered - 1, // Don't reduce numRendered when scrolling back up\n      lastVisible + props.numToRenderAhead, // Primary goal\n      totalRows - 1, // Don't render past the end\n    );\n    // Increment the last row one at a time per JS event loop\n    if (targetLastRow > this.state.lastRow) {\n      lastRow++;\n    } else if (targetLastRow < this.state.lastRow) {\n      lastRow--;\n    }\n    // Once last row is set, figure out the first row\n    const firstRow = Math.max(\n      0, // Don't render past the top\n      lastRow - props.maxNumToRender + 1, // Don't exceed max to render\n      lastRow - numRendered, // Don't render more than 1 additional row\n    );\n    if (lastRow >= totalRows) {\n      // It's possible that the number of rows decreased by more than one\n      // increment could compensate for.  Need to make sure we don't render more\n      // than one new row at a time, but don't want to render past the end of\n      // the data.\n      lastRow = totalRows - 1;\n    }\n    if (props.onEndReached) {\n      // Make sure we call onEndReached exactly once every time we reach the\n      // end.  Resets if scoll back up and down again.\n      const willBeAtTheEnd = lastRow === (totalRows - 1);\n      if (willBeAtTheEnd && !this._hasCalledOnEndReached) {\n        props.onEndReached();\n        this._hasCalledOnEndReached = true;\n      } else {\n        // If lastRow is changing, reset so we can call onEndReached again\n        this._hasCalledOnEndReached = this.state.lastRow === lastRow;\n      }\n    }\n    const rowsShouldChange = firstRow !== this.state.firstRow || lastRow !== this.state.lastRow;\n    if (this._rowFramesDirty || rowsShouldChange) {\n      if (rowsShouldChange) {\n        props.onMountedRowsWillChange &&\n          props.onMountedRowsWillChange(firstRow, lastRow - firstRow + 1);\n        infoLog(\n          'WLV: row render range will change:',\n          {firstRow, firstVis: this._firstVisible, lastVis: this._lastVisible, lastRow},\n        );\n      }\n      this._rowFramesDirty = false;\n      this.setState({firstRow, lastRow});\n    }\n  }\n  _updateVisibleRows(newFirstVisible: number, newLastVisible: number) {\n    if (this.props.onVisibleRowsChanged) {\n      if (this._firstVisible !== newFirstVisible ||\n          this._lastVisible !== newLastVisible) {\n        this.props.onVisibleRowsChanged(newFirstVisible, newLastVisible - newFirstVisible + 1);\n      }\n    }\n    this._firstVisible = newFirstVisible;\n    this._lastVisible = newLastVisible;\n  }\n  render(): React.Node {\n    const {firstRow} = this.state;\n    const lastRow = clamp(0, this.state.lastRow, this.props.data.length - 1);\n    const rowFrames = this._rowFrames;\n    const rows = [];\n    let spacerHeight = 0;\n    // Incremental rendering is a tradeoff between throughput and responsiveness. When we have\n    // plenty of buffer (say 50% of the target), we render incrementally to keep the app responsive.\n    // If we are dangerously low on buffer (say below 25%) we always disable incremental to try to\n    // catch up as fast as possible. In the middle, we only disable incremental while scrolling\n    // since it's unlikely the user will try to press a button while scrolling. We also ignore the\n    // \"buffer\" size when we are bumped up against the edge of the available data.\n    const firstBuffer = firstRow === 0 ? Infinity : this._firstVisible - firstRow;\n    const lastBuffer = lastRow === this.props.data.length - 1\n      ? Infinity\n      : lastRow - this._lastVisible;\n    const minBuffer = Math.min(firstBuffer, lastBuffer);\n    const disableIncrementalRendering = this.props.disableIncrementalRendering ||\n      (this._isScrolling && minBuffer < this.props.numToRenderAhead * 0.5) ||\n      (minBuffer < this.props.numToRenderAhead * 0.25);\n    // Render mode is sticky while the component is mounted.\n    for (let ii = firstRow; ii <= lastRow; ii++) {\n      const rowKey = this.props.data[ii].rowKey;\n      if (\n        this._rowRenderMode[rowKey] === 'sync' ||\n        (disableIncrementalRendering && this._rowRenderMode[rowKey] !== 'async')\n      ) {\n        this._rowRenderMode[rowKey] = 'sync';\n      } else {\n        this._rowRenderMode[rowKey] = 'async';\n      }\n    }\n    for (let ii = firstRow; ii <= lastRow; ii++) {\n      const rowKey = this.props.data[ii].rowKey;\n      if (!rowFrames[rowKey]) {\n        break; // if rowFrame missing, no following ones will exist so quit early\n      }\n      // Look for the first row where offscreen layout is done (only true for mounted rows) or it\n      // will be rendered synchronously and set the spacer height such that it will offset all the\n      // unmounted rows before that one using the saved frame data.\n      if (rowFrames[rowKey].offscreenLayoutDone || this._rowRenderMode[rowKey] === 'sync') {\n        if (ii > 0) {\n          const prevRowKey = this.props.data[ii - 1].rowKey;\n          const frame = rowFrames[prevRowKey];\n          spacerHeight = frame ? frame.y + frame.height : 0;\n        }\n        break;\n      }\n    }\n    let showIndicator = false;\n    if (\n      spacerHeight > (this.state.boundaryIndicatorHeight || 0) &&\n      this.props.renderWindowBoundaryIndicator\n    ) {\n      showIndicator = true;\n      spacerHeight -= this.state.boundaryIndicatorHeight || 0;\n    }\n    DEBUG && infoLog('render top spacer with height ', spacerHeight);\n    rows.push(<View key=\"sp-top\" style={{height: spacerHeight}} />);\n    if (this.props.renderWindowBoundaryIndicator) {\n      // Always render it, even if removed, so that we can get the height right away and don't waste\n      // time creating/ destroying it. Should see if there is a better spinner option that is not as\n      // expensive.\n      rows.push(\n        <View\n          style={!showIndicator && styles.remove}\n          key=\"ind-top\"\n          onLayout={(e) => {\n            const layout = e.nativeEvent.layout;\n            if (layout.height !== this.state.boundaryIndicatorHeight) {\n              this.setState({boundaryIndicatorHeight: layout.height});\n            }\n          }}>\n          {this.props.renderWindowBoundaryIndicator(showIndicator)}\n        </View>\n      );\n    }\n    for (let idx = firstRow; idx <= lastRow; idx++) {\n      const rowKey = this.props.data[idx].rowKey;\n      const includeInLayout = this._rowRenderMode[rowKey] === 'sync' ||\n        (this._rowFrames[rowKey] && this._rowFrames[rowKey].offscreenLayoutDone);\n      rows.push(\n        <CellRenderer\n          key={rowKey}\n          rowKey={rowKey}\n          rowIndex={idx}\n          onNewLayout={this._onNewLayout}\n          onWillUnmount={this._onWillUnmountCell}\n          includeInLayout={includeInLayout}\n          onProgressChange={this._onProgressChange}\n          asyncRowPerfEventName={this.props.asyncRowPerfEventName}\n          rowData={this.props.data[idx].rowData}\n          renderRow={this.props.renderRow}\n        />\n      );\n    }\n    const lastRowKey = this.props.data[lastRow].rowKey;\n    const showFooter = this._rowFrames[lastRowKey] &&\n        this._rowFrames[lastRowKey].offscreenLayoutDone &&\n        lastRow === this.props.data.length - 1;\n    if (this.props.renderFooter) {\n      rows.push(\n        <View\n          key=\"ind-footer\"\n          style={showFooter ? styles.include : styles.remove}>\n          {this.props.renderFooter(showFooter)}\n        </View>\n      );\n    }\n    if (this.props.renderWindowBoundaryIndicator) {\n      rows.push(\n        <View\n          key=\"ind-bot\"\n          style={showFooter ? styles.remove : styles.include}\n          onLayout={(e) => {\n            const layout = e.nativeEvent.layout;\n            if (layout.height !== this.state.boundaryIndicatorHeight) {\n              this.setState({boundaryIndicatorHeight: layout.height});\n            }\n          }}>\n          {this.props.renderWindowBoundaryIndicator(!showFooter)}\n        </View>\n      );\n    }\n    // Prevent user from scrolling into empty space of unmounted rows.\n    const contentInset = {top: firstRow === 0 ? 0 : -spacerHeight};\n    return (\n      this.props.renderScrollComponent({\n        scrollEventThrottle: 50,\n        removeClippedSubviews: true,\n        ...this.props,\n        contentInset,\n        ref: (ref) => { this._scrollRef = ref; },\n        onScroll: this._onScroll,\n        onMomentumScrollEnd: this._onMomentumScrollEnd,\n        children: rows,\n      })\n    );\n  }\n}\n\n// performance testing id, unique for each component mount cycle\nlet g_perf_update_id = 0;\n\ntype CellProps = {\n  /**\n   * Row-specific data passed to renderRow and used in shouldComponentUpdate with ===\n   */\n  rowData: mixed,\n  rowKey: string,\n  /**\n   * Renders the actual row contents.\n   */\n   renderRow: (\n      rowData: mixed, sectionIdx: number, rowIdx: number, rowKey: string\n   ) => ?React.Element<any>,\n  /**\n   * Index of the row, passed through to other callbacks.\n   */\n  rowIndex: number,\n  /**\n   * Used for marking async begin/end events for row rendering.\n   */\n  asyncRowPerfEventName: ?string,\n  /**\n   * Initially false to indicate the cell should be rendered \"offscreen\" with position: absolute so\n   * that incremental rendering doesn't cause things to jump around. Once onNewLayout is called\n   * after offscreen rendering has completed, includeInLayout will be set true and the finished cell\n   * can be dropped into place.\n   *\n   * This is coordinated outside this component so the parent can syncronize this re-render with\n   * managing the placeholder sizing.\n   */\n  includeInLayout: boolean,\n  /**\n   * Updates the parent with the latest layout. Only called when incremental rendering is done and\n   * triggers the parent to re-render this row with includeInLayout true.\n   */\n  onNewLayout: (params: {rowKey: string, layout: Object}) => void,\n  /**\n   * Used to track when rendering is in progress so the parent can avoid wastedful re-renders that\n   * are just going to be invalidated once the cell finishes.\n   */\n  onProgressChange: (progress: {rowKey: string, inProgress: boolean}) => void,\n  /**\n   * Used to invalidate the layout so the parent knows it needs to compensate for the height in the\n   * placeholder size.\n   */\n  onWillUnmount: (rowKey: string) => void,\n};\nclass CellRenderer extends React.Component<CellProps> {\n  _containerRef: NativeMethodsMixinType;\n  _offscreenRenderDone = false;\n  _timeout = 0;\n  _lastLayout: ?Object = null;\n  _perfUpdateID: number = 0;\n  _asyncCookie: any;\n  _includeInLayoutLatch: boolean = false;\n  componentWillMount() {\n    if (this.props.asyncRowPerfEventName) {\n      this._perfUpdateID = g_perf_update_id++;\n      this._asyncCookie = Systrace.beginAsyncEvent(\n        this.props.asyncRowPerfEventName + this._perfUpdateID\n      );\n      // $FlowFixMe(>=0.28.0)\n      infoLog(`perf_asynctest_${this.props.asyncRowPerfEventName}_start ${this._perfUpdateID} ` +\n        `${Date.now()}`);\n    }\n    if (this.props.includeInLayout) {\n      this._includeInLayoutLatch = true;\n    }\n    this.props.onProgressChange({rowKey: this.props.rowKey, inProgress: true});\n  }\n  _onLayout = (e) => {\n    const layout = e.nativeEvent.layout;\n    const layoutChanged = deepDiffer(this._lastLayout, layout);\n    this._lastLayout = layout;\n    if (!this._offscreenRenderDone || !layoutChanged) {\n      return; // Don't send premature or duplicate updates\n    }\n    this.props.onNewLayout({\n      rowKey: this.props.rowKey,\n      layout,\n    });\n  };\n  _updateParent() {\n    invariant(!this._offscreenRenderDone, 'should only finish rendering once');\n    this._offscreenRenderDone = true;\n\n    // If this is not called before calling onNewLayout, the number of inProgress cells will remain\n    // non-zero, and thus the onNewLayout call will not fire the needed state change update.\n    this.props.onProgressChange({rowKey: this.props.rowKey, inProgress: false});\n\n    // If an onLayout event hasn't come in yet, then we skip here and assume it will come in later.\n    // This happens when Incremental is disabled and _onOffscreenRenderDone is called faster than\n    // layout can happen.\n    this._lastLayout &&\n      this.props.onNewLayout({rowKey: this.props.rowKey, layout: this._lastLayout});\n\n    DEBUG && infoLog('\\n   >>>>>  display row ' + this.props.rowIndex + '\\n\\n\\n');\n    if (this.props.asyncRowPerfEventName) {\n      // Note this doesn't include the native render time but is more accurate than also including\n      // the JS render time of anything that has been queued up.\n      Systrace.endAsyncEvent(\n        this.props.asyncRowPerfEventName + this._perfUpdateID,\n        this._asyncCookie\n      );\n      // $FlowFixMe(>=0.28.0)\n      infoLog(`perf_asynctest_${this.props.asyncRowPerfEventName}_end ${this._perfUpdateID} ` +\n        `${Date.now()}`);\n    }\n  }\n  _onOffscreenRenderDone = () => {\n    DEBUG && infoLog('_onOffscreenRenderDone for row ' + this.props.rowIndex);\n    if (this._includeInLayoutLatch) {\n      this._updateParent(); // rendered straight into layout, so no need to flush\n    } else {\n      this._timeout = setTimeout(() => this._updateParent(), 1); // Flush any pending layout events.\n    }\n  };\n  componentWillUnmount() {\n    /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n     * error found when Flow v0.63 was deployed. To see the error delete this\n     * comment and run Flow. */\n    clearTimeout(this._timeout);\n    this.props.onProgressChange({rowKey: this.props.rowKey, inProgress: false});\n    this.props.onWillUnmount(this.props.rowKey);\n  }\n  componentWillReceiveProps(newProps) {\n    if (newProps.includeInLayout && !this.props.includeInLayout) {\n      invariant(this._offscreenRenderDone, 'Should never try to add to layout before render done');\n      this._includeInLayoutLatch = true; // Once we render in layout, make sure it sticks.\n      this._containerRef.setNativeProps({style: styles.include});\n    }\n  }\n  shouldComponentUpdate(newProps: CellProps) {\n    return newProps.rowData !== this.props.rowData;\n  }\n  _setRef = (ref) => {\n    /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error when upgrading Flow's support for React. To see the\n     * error delete this comment and run Flow. */\n    this._containerRef = ref;\n  };\n  render() {\n    let debug;\n    if (DEBUG) {\n      infoLog('render cell ' + this.props.rowIndex);\n      const Text = require('Text');\n      debug = <Text style={{backgroundColor: 'lightblue'}}>\n        Row: {this.props.rowIndex}\n      </Text>;\n    }\n    const style = this._includeInLayoutLatch ? styles.include : styles.remove;\n    return (\n      <IncrementalGroup\n        disabled={this._includeInLayoutLatch}\n        onDone={this._onOffscreenRenderDone}\n        name={`WLVCell_${this.props.rowIndex}`}>\n        <View\n          ref={this._setRef}\n          style={style}\n          onLayout={this._onLayout}>\n          {debug}\n          {this.props.renderRow(this.props.rowData, 0, this.props.rowIndex, this.props.rowKey)}\n          {debug}\n        </View>\n      </IncrementalGroup>\n    );\n  }\n}\n\nconst removedXOffset = DEBUG ? 123 : 0;\n\nconst styles = StyleSheet.create({\n  include: {\n    position: 'relative',\n    left: 0,\n    right: 0,\n    opacity: 1,\n  },\n  remove: {\n    position: 'absolute',\n    left: removedXOffset,\n    right: -removedXOffset,\n    opacity: DEBUG ? 0.1 : 0,\n  },\n});\n\nmodule.exports = WindowedListView;\n"
  },
  {
    "path": "Libraries/Geolocation/Geolocation.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Geolocation\n * @flow\n */\n'use strict';\n\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst RCTLocationObserver = require('NativeModules').LocationObserver;\n\nconst invariant = require('fbjs/lib/invariant');\nconst logError = require('logError');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst warning = require('fbjs/lib/warning');\n\nconst LocationEventEmitter = new NativeEventEmitter(RCTLocationObserver);\n\nconst Platform = require('Platform');\nconst PermissionsAndroid = require('PermissionsAndroid');\n\nvar subscriptions = [];\nvar updatesEnabled = false;\n\ntype GeoConfiguration = {\n  skipPermissionRequests: bool;\n}\n\ntype GeoOptions = {\n  timeout?: number,\n  maximumAge?: number,\n  enableHighAccuracy?: bool,\n  distanceFilter: number,\n  useSignificantChanges?: bool,\n}\n\n/**\n * The Geolocation API extends the web spec:\n * https://developer.mozilla.org/en-US/docs/Web/API/Geolocation\n *\n * As a browser polyfill, this API is available through the `navigator.geolocation`\n * global - you do not need to `import` it.\n *\n * ### Configuration and Permissions\n *\n * <div class=\"banner-crna-ejected\">\n *   <h3>Projects with Native Code Only</h3>\n *   <p>\n *     This section only applies to projects made with <code>react-native init</code>\n *     or to those made with Create React Native App which have since ejected. For\n *     more information about ejecting, please see\n *     the <a href=\"https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md\" target=\"_blank\">guide</a> on\n *     the Create React Native App repository.\n *   </p>\n * </div>\n *\n * #### iOS\n * You need to include the `NSLocationWhenInUseUsageDescription` key\n * in Info.plist to enable geolocation when using the app. Geolocation is\n * enabled by default when you create a project with `react-native init`.\n *\n * In order to enable geolocation in the background, you need to include the\n * 'NSLocationAlwaysUsageDescription' key in Info.plist and add location as\n * a background mode in the 'Capabilities' tab in Xcode.\n *\n * #### Android\n * To request access to location, you need to add the following line to your\n * app's `AndroidManifest.xml`:\n *\n * `<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />`\n *\n * Android API >= 18 Positions will also contain a `mocked` boolean to indicate if position\n * was created from a mock provider.\n *\n * <p>\n *   Android API >= 23 Requires an additional step to check for, and request\n *   the ACCESS_FINE_LOCATION permission using\n *   the <a href=\"https://facebook.github.io/react-native/docs/permissionsandroid.html\" target=\"_blank\">PermissionsAndroid API</a>.\n *   Failure to do so may result in a hard crash.\n * </p>\n */\nvar Geolocation = {\n\n  /*\n    * Sets configuration options that will be used in all location requests.\n    *\n    * ### Options\n    *\n    * #### iOS\n    *\n    * - `skipPermissionRequests` - defaults to `false`, if `true` you must request permissions\n    * before using Geolocation APIs.\n    *\n    */\n  setRNConfiguration: function(\n    config: GeoConfiguration\n  ) {\n    if (RCTLocationObserver.setConfiguration) {\n      RCTLocationObserver.setConfiguration(config);\n    }\n  },\n\n  /*\n   * Request suitable Location permission based on the key configured on pList.\n   * If NSLocationAlwaysUsageDescription is set, it will request Always authorization,\n   * although if NSLocationWhenInUseUsageDescription is set, it will request InUse\n   * authorization.\n   */\n  requestAuthorization: function() {\n    RCTLocationObserver.requestAuthorization();\n  },\n\n  /*\n   * Invokes the success callback once with the latest location info.  Supported\n   * options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool)\n   * On Android, if the location is cached this can return almost immediately,\n   * or it will request an update which might take a while.\n   */\n  getCurrentPosition: async function(\n    geo_success: Function,\n    geo_error?: Function,\n    geo_options?: GeoOptions\n  ) {\n    invariant(\n      typeof geo_success === 'function',\n      'Must provide a valid geo_success callback.'\n    );\n    let hasPermission = true;\n    // Supports Android's new permission model. For Android older devices,\n    // it's always on.\n    if (Platform.OS === 'android' && Platform.Version >= 23) {\n      hasPermission = await PermissionsAndroid.check(\n        PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,\n      );\n      if (!hasPermission) {\n        const status = await PermissionsAndroid.request(\n          PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,\n        );\n        hasPermission = status === PermissionsAndroid.RESULTS.GRANTED;\n      }\n    }\n    if (hasPermission) {\n      RCTLocationObserver.getCurrentPosition(\n        geo_options || {},\n        geo_success,\n        geo_error || logError,\n      );\n    }\n  },\n\n  /*\n   * Invokes the success callback whenever the location changes.  Supported\n   * options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool), distanceFilter(m), useSignificantChanges (bool)\n   */\n  watchPosition: function(success: Function, error?: Function, options?: GeoOptions): number {\n    if (!updatesEnabled) {\n      RCTLocationObserver.startObserving(options || {});\n      updatesEnabled = true;\n    }\n    var watchID = subscriptions.length;\n    subscriptions.push([\n      LocationEventEmitter.addListener(\n        'geolocationDidChange',\n        success\n      ),\n      error ? LocationEventEmitter.addListener(\n        'geolocationError',\n        error\n      ) : null,\n    ]);\n    return watchID;\n  },\n\n  clearWatch: function(watchID: number) {\n    var sub = subscriptions[watchID];\n    if (!sub) {\n      // Silently exit when the watchID is invalid or already cleared\n      // This is consistent with timers\n      return;\n    }\n\n    sub[0].remove();\n    // array element refinements not yet enabled in Flow\n    var sub1 = sub[1]; sub1 && sub1.remove();\n    subscriptions[watchID] = undefined;\n    var noWatchers = true;\n    for (var ii = 0; ii < subscriptions.length; ii++) {\n      if (subscriptions[ii]) {\n        noWatchers = false; // still valid subscriptions\n      }\n    }\n    if (noWatchers) {\n      Geolocation.stopObserving();\n    }\n  },\n\n  stopObserving: function() {\n    if (updatesEnabled) {\n      RCTLocationObserver.stopObserving();\n      updatesEnabled = false;\n      for (var ii = 0; ii < subscriptions.length; ii++) {\n        var sub = subscriptions[ii];\n        if (sub) {\n          warning(false, 'Called stopObserving with existing subscriptions.');\n          sub[0].remove();\n          // array element refinements not yet enabled in Flow\n          var sub1 = sub[1]; sub1 && sub1.remove();\n        }\n      }\n      subscriptions = [];\n    }\n  }\n};\n\nmodule.exports = Geolocation;\n"
  },
  {
    "path": "Libraries/Geolocation/RCTGeolocation.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t134814061AA4E45400B7C361 /* RCTLocationObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 134814051AA4E45400B7C361 /* RCTLocationObserver.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t134814041AA4E45400B7C361 /* RCTLocationObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTLocationObserver.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t134814051AA4E45400B7C361 /* RCTLocationObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLocationObserver.m; sourceTree = \"<group>\"; };\n\t\t134814201AA4EA6300B7C361 /* libRCTGeolocation.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTGeolocation.a; sourceTree = BUILT_PRODUCTS_DIR; };\n/* End PBXFileReference section */\n\n/* Begin PBXGroup section */\n\t\t134814211AA4EA7D00B7C361 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134814201AA4EA6300B7C361 /* libRCTGeolocation.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58B511D21A9E6C8500147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134814041AA4E45400B7C361 /* RCTLocationObserver.h */,\n\t\t\t\t134814051AA4E45400B7C361 /* RCTLocationObserver.m */,\n\t\t\t\t134814211AA4EA7D00B7C361 /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t58B511DA1A9E6C8500147676 /* RCTGeolocation */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTGeolocation\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t58B511D71A9E6C8500147676 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTGeolocation;\n\t\t\tproductName = RCTDataManager;\n\t\t\tproductReference = 134814201AA4EA6300B7C361 /* libRCTGeolocation.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511D31A9E6C8500147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t58B511DA1A9E6C8500147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTGeolocation\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511D21A9E6C8500147676;\n\t\t\tproductRefGroup = 58B511D21A9E6C8500147676;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B511DA1A9E6C8500147676 /* RCTGeolocation */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t58B511D71A9E6C8500147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t134814061AA4E45400B7C361 /* RCTLocationObserver.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t58B511ED1A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511EE1A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511F01A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511F11A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTGeolocation\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511ED1A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511EE1A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTGeolocation\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511F01A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511F11A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511D31A9E6C8500147676 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/Geolocation/RCTLocationObserver.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTEventEmitter.h>\n\n@interface RCTLocationObserver : RCTEventEmitter\n\n@end\n"
  },
  {
    "path": "Libraries/Geolocation/RCTLocationObserver.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTLocationObserver.h\"\n\n#import <CoreLocation/CLError.h>\n#import <CoreLocation/CLLocationManager.h>\n#import <CoreLocation/CLLocationManagerDelegate.h>\n\n#import <React/RCTAssert.h>\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTLog.h>\n\ntypedef NS_ENUM(NSInteger, RCTPositionErrorCode) {\n  RCTPositionErrorDenied = 1,\n  RCTPositionErrorUnavailable,\n  RCTPositionErrorTimeout,\n};\n\n#define RCT_DEFAULT_LOCATION_ACCURACY kCLLocationAccuracyHundredMeters\n\ntypedef struct {\n  BOOL skipPermissionRequests;\n} RCTLocationConfiguration;\n\ntypedef struct {\n  double timeout;\n  double maximumAge;\n  double accuracy;\n  double distanceFilter;\n  BOOL useSignificantChanges;\n} RCTLocationOptions;\n\n@implementation RCTConvert (RCTLocationOptions)\n\n+ (RCTLocationConfiguration)RCTLocationConfiguration:(id)json\n{\n  NSDictionary<NSString *, id> *options = [RCTConvert NSDictionary:json];\n\n  return (RCTLocationConfiguration) {\n    .skipPermissionRequests = [RCTConvert BOOL:options[@\"skipPermissionRequests\"]]\n  };\n}\n\n+ (RCTLocationOptions)RCTLocationOptions:(id)json\n{\n  NSDictionary<NSString *, id> *options = [RCTConvert NSDictionary:json];\n\n  double distanceFilter = options[@\"distanceFilter\"] == NULL ? RCT_DEFAULT_LOCATION_ACCURACY\n    : [RCTConvert double:options[@\"distanceFilter\"]] ?: kCLDistanceFilterNone;\n\n  return (RCTLocationOptions){\n    .timeout = [RCTConvert NSTimeInterval:options[@\"timeout\"]] ?: INFINITY,\n    .maximumAge = [RCTConvert NSTimeInterval:options[@\"maximumAge\"]] ?: INFINITY,\n    .accuracy = [RCTConvert BOOL:options[@\"enableHighAccuracy\"]] ? kCLLocationAccuracyBest : RCT_DEFAULT_LOCATION_ACCURACY,\n    .distanceFilter = distanceFilter,\n    .useSignificantChanges = [RCTConvert BOOL:options[@\"useSignificantChanges\"]] ?: NO,\n  };\n}\n\n@end\n\nstatic NSDictionary<NSString *, id> *RCTPositionError(RCTPositionErrorCode code, NSString *msg /* nil for default */)\n{\n  if (!msg) {\n    switch (code) {\n      case RCTPositionErrorDenied:\n        msg = @\"User denied access to location services.\";\n        break;\n      case RCTPositionErrorUnavailable:\n        msg = @\"Unable to retrieve location.\";\n        break;\n      case RCTPositionErrorTimeout:\n        msg = @\"The location request timed out.\";\n        break;\n    }\n  }\n\n  return @{\n    @\"code\": @(code),\n    @\"message\": msg,\n    @\"PERMISSION_DENIED\": @(RCTPositionErrorDenied),\n    @\"POSITION_UNAVAILABLE\": @(RCTPositionErrorUnavailable),\n    @\"TIMEOUT\": @(RCTPositionErrorTimeout)\n  };\n}\n\n@interface RCTLocationRequest : NSObject\n\n@property (nonatomic, copy) RCTResponseSenderBlock successBlock;\n@property (nonatomic, copy) RCTResponseSenderBlock errorBlock;\n@property (nonatomic, assign) RCTLocationOptions options;\n@property (nonatomic, strong) NSTimer *timeoutTimer;\n\n@end\n\n@implementation RCTLocationRequest\n\n- (void)dealloc\n{\n  if (_timeoutTimer.valid) {\n    [_timeoutTimer invalidate];\n  }\n}\n\n@end\n\n@interface RCTLocationObserver () <CLLocationManagerDelegate>\n\n@end\n\n@implementation RCTLocationObserver\n{\n  CLLocationManager *_locationManager;\n  NSDictionary<NSString *, id> *_lastLocationEvent;\n  NSMutableArray<RCTLocationRequest *> *_pendingRequests;\n  BOOL _observingLocation;\n  BOOL _usingSignificantChanges;\n  RCTLocationConfiguration _locationConfiguration;\n  RCTLocationOptions _observerOptions;\n}\n\nRCT_EXPORT_MODULE()\n\n#pragma mark - Lifecycle\n\n- (void)dealloc\n{\n  _usingSignificantChanges ?\n    [_locationManager stopMonitoringSignificantLocationChanges] :\n    [_locationManager stopUpdatingLocation];\n\n  _locationManager.delegate = nil;\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[@\"geolocationDidChange\", @\"geolocationError\"];\n}\n\n#pragma mark - Private API\n\n- (void)beginLocationUpdatesWithDesiredAccuracy:(CLLocationAccuracy)desiredAccuracy distanceFilter:(CLLocationDistance)distanceFilter useSignificantChanges:(BOOL)useSignificantChanges\n{\n  if (!_locationConfiguration.skipPermissionRequests) {\n    [self requestAuthorization];\n  }\n\n  _locationManager.distanceFilter  = distanceFilter;\n  _locationManager.desiredAccuracy = desiredAccuracy;\n  _usingSignificantChanges = useSignificantChanges;\n\n  // Start observing location\n  _usingSignificantChanges ?\n    [_locationManager startMonitoringSignificantLocationChanges] :\n    [_locationManager startUpdatingLocation];\n}\n\n#pragma mark - Timeout handler\n\n- (void)timeout:(NSTimer *)timer\n{\n  RCTLocationRequest *request = timer.userInfo;\n  NSString *message = [NSString stringWithFormat: @\"Unable to fetch location within %.1fs.\", request.options.timeout];\n  request.errorBlock(@[RCTPositionError(RCTPositionErrorTimeout, message)]);\n  [_pendingRequests removeObject:request];\n\n  // Stop updating if no pending requests\n  if (_pendingRequests.count == 0 && !_observingLocation) {\n    _usingSignificantChanges ?\n      [_locationManager stopMonitoringSignificantLocationChanges] :\n      [_locationManager stopUpdatingLocation];\n  }\n}\n\n#pragma mark - Public API\n\nRCT_EXPORT_METHOD(setConfiguration:(RCTLocationConfiguration)config)\n{\n  _locationConfiguration = config;\n}\n\nRCT_EXPORT_METHOD(requestAuthorization)\n{\n  if (!_locationManager) {\n    _locationManager = [CLLocationManager new];\n    _locationManager.delegate = self;\n  }\n\n  // Request location access permission\n  if ([[NSBundle mainBundle] objectForInfoDictionaryKey:@\"NSLocationAlwaysUsageDescription\"] &&\n    [_locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {\n    [_locationManager requestAlwaysAuthorization];\n\n    // On iOS 9+ we also need to enable background updates\n    NSArray *backgroundModes  = [[NSBundle mainBundle] objectForInfoDictionaryKey:@\"UIBackgroundModes\"];\n    if (backgroundModes && [backgroundModes containsObject:@\"location\"]) {\n      if ([_locationManager respondsToSelector:@selector(setAllowsBackgroundLocationUpdates:)]) {\n        [_locationManager setAllowsBackgroundLocationUpdates:YES];\n      }\n    }\n  } else if ([[NSBundle mainBundle] objectForInfoDictionaryKey:@\"NSLocationWhenInUseUsageDescription\"] &&\n    [_locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {\n    [_locationManager requestWhenInUseAuthorization];\n  }\n}\n\nRCT_EXPORT_METHOD(startObserving:(RCTLocationOptions)options)\n{\n  checkLocationConfig();\n\n  // Select best options\n  _observerOptions = options;\n  for (RCTLocationRequest *request in _pendingRequests) {\n    _observerOptions.accuracy = MIN(_observerOptions.accuracy, request.options.accuracy);\n  }\n\n  [self beginLocationUpdatesWithDesiredAccuracy:_observerOptions.accuracy\n                                 distanceFilter:_observerOptions.distanceFilter\n                          useSignificantChanges:_observerOptions.useSignificantChanges];\n  _observingLocation = YES;\n}\n\nRCT_EXPORT_METHOD(stopObserving)\n{\n  // Stop observing\n  _observingLocation = NO;\n\n  // Stop updating if no pending requests\n  if (_pendingRequests.count == 0) {\n    _usingSignificantChanges ?\n      [_locationManager stopMonitoringSignificantLocationChanges] :\n      [_locationManager stopUpdatingLocation];\n  }\n}\n\nRCT_EXPORT_METHOD(getCurrentPosition:(RCTLocationOptions)options\n                  withSuccessCallback:(RCTResponseSenderBlock)successBlock\n                  errorCallback:(RCTResponseSenderBlock)errorBlock)\n{\n  checkLocationConfig();\n\n  if (!successBlock) {\n    RCTLogError(@\"%@.getCurrentPosition called with nil success parameter.\", [self class]);\n    return;\n  }\n\n  if (![CLLocationManager locationServicesEnabled]) {\n    if (errorBlock) {\n      errorBlock(@[\n        RCTPositionError(RCTPositionErrorUnavailable, @\"Location services disabled.\")\n      ]);\n      return;\n    }\n  }\n\n  if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) {\n    if (errorBlock) {\n      errorBlock(@[\n        RCTPositionError(RCTPositionErrorDenied, nil)\n      ]);\n      return;\n    }\n  }\n\n  // Check if previous recorded location exists and is good enough\n  if (_lastLocationEvent &&\n      [NSDate date].timeIntervalSince1970 - [RCTConvert NSTimeInterval:_lastLocationEvent[@\"timestamp\"]] < options.maximumAge &&\n      [_lastLocationEvent[@\"coords\"][@\"accuracy\"] doubleValue] <= options.accuracy) {\n\n    // Call success block with most recent known location\n    successBlock(@[_lastLocationEvent]);\n    return;\n  }\n\n  // Create request\n  RCTLocationRequest *request = [RCTLocationRequest new];\n  request.successBlock = successBlock;\n  request.errorBlock = errorBlock ?: ^(NSArray *args){};\n  request.options = options;\n  request.timeoutTimer = [NSTimer scheduledTimerWithTimeInterval:options.timeout\n                                                          target:self\n                                                        selector:@selector(timeout:)\n                                                        userInfo:request\n                                                         repeats:NO];\n  if (!_pendingRequests) {\n    _pendingRequests = [NSMutableArray new];\n  }\n  [_pendingRequests addObject:request];\n\n  // Configure location manager and begin updating location\n  CLLocationAccuracy accuracy = options.accuracy;\n  if (_locationManager) {\n    accuracy = MIN(_locationManager.desiredAccuracy, accuracy);\n  }\n  [self beginLocationUpdatesWithDesiredAccuracy:accuracy\n                                 distanceFilter:options.distanceFilter\n                          useSignificantChanges:options.useSignificantChanges];\n}\n\n#pragma mark - CLLocationManagerDelegate\n\n- (void)locationManager:(CLLocationManager *)manager\n     didUpdateLocations:(NSArray<CLLocation *> *)locations\n{\n  // Create event\n  CLLocation *location = locations.lastObject;\n  _lastLocationEvent = @{\n    @\"coords\": @{\n      @\"latitude\": @(location.coordinate.latitude),\n      @\"longitude\": @(location.coordinate.longitude),\n      @\"altitude\": @(location.altitude),\n      @\"accuracy\": @(location.horizontalAccuracy),\n      @\"altitudeAccuracy\": @(location.verticalAccuracy),\n      @\"heading\": @(location.course),\n      @\"speed\": @(location.speed),\n    },\n    @\"timestamp\": @([location.timestamp timeIntervalSince1970] * 1000) // in ms\n  };\n\n  // Send event\n  if (_observingLocation) {\n    [self sendEventWithName:@\"geolocationDidChange\" body:_lastLocationEvent];\n  }\n\n  // Fire all queued callbacks\n  for (RCTLocationRequest *request in _pendingRequests) {\n    request.successBlock(@[_lastLocationEvent]);\n    [request.timeoutTimer invalidate];\n  }\n  [_pendingRequests removeAllObjects];\n\n  // Stop updating if not observing\n  if (!_observingLocation) {\n    _usingSignificantChanges ?\n      [_locationManager stopMonitoringSignificantLocationChanges] :\n      [_locationManager stopUpdatingLocation];\n  }\n\n  // Reset location accuracy if desiredAccuracy is changed.\n  // Otherwise update accuracy will force triggering didUpdateLocations, watchPosition would keeping receiving location updates, even there's no location changes.\n  if (ABS(_locationManager.desiredAccuracy - RCT_DEFAULT_LOCATION_ACCURACY) > 0.000001) {\n    _locationManager.desiredAccuracy = RCT_DEFAULT_LOCATION_ACCURACY;\n  }\n}\n\n- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error\n{\n  // Check error type\n  NSDictionary<NSString *, id> *jsError = nil;\n  switch (error.code) {\n    case kCLErrorDenied:\n      jsError = RCTPositionError(RCTPositionErrorDenied, nil);\n      break;\n    case kCLErrorNetwork:\n      jsError = RCTPositionError(RCTPositionErrorUnavailable, @\"Unable to retrieve location due to a network failure\");\n      break;\n    case kCLErrorLocationUnknown:\n    default:\n      jsError = RCTPositionError(RCTPositionErrorUnavailable, nil);\n      break;\n  }\n\n  // Send event\n  if (_observingLocation) {\n    [self sendEventWithName:@\"geolocationError\" body:jsError];\n  }\n\n  // Fire all queued error callbacks\n  for (RCTLocationRequest *request in _pendingRequests) {\n    request.errorBlock(@[jsError]);\n    [request.timeoutTimer invalidate];\n  }\n  [_pendingRequests removeAllObjects];\n\n  // Reset location accuracy if desiredAccuracy is changed.\n  // Otherwise update accuracy will force triggering didUpdateLocations, watchPosition would keeping receiving location updates, even there's no location changes.\n  if (ABS(_locationManager.desiredAccuracy - RCT_DEFAULT_LOCATION_ACCURACY) > 0.000001) {\n    _locationManager.desiredAccuracy = RCT_DEFAULT_LOCATION_ACCURACY;\n  }\n}\n\nstatic void checkLocationConfig()\n{\n#if RCT_DEV\n  if (!([[NSBundle mainBundle] objectForInfoDictionaryKey:@\"NSLocationWhenInUseUsageDescription\"] ||\n    [[NSBundle mainBundle] objectForInfoDictionaryKey:@\"NSLocationAlwaysUsageDescription\"] ||\n    [[NSBundle mainBundle] objectForInfoDictionaryKey:@\"NSLocationAlwaysAndWhenInUseUsageDescription\"])) {\n    RCTLogError(@\"Either NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription or NSLocationAlwaysAndWhenInUseUsageDescription key must be present in Info.plist to use geolocation.\");\n  }\n#endif\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Image/AssetRegistry.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AssetRegistry\n * @flow\n */\n'use strict';\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\n\nvar assets: Array<PackagerAsset> = [];\n\nfunction 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\nfunction getAssetByID(assetId: number): PackagerAsset {\n  return assets[assetId - 1];\n}\n\nmodule.exports = { registerAsset, getAssetByID };\n"
  },
  {
    "path": "Libraries/Image/AssetSourceResolver.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AssetSourceResolver\n * @flow\n */\n'use strict';\n\nexport type ResolvedAssetSource = {\n  __packager_asset: boolean,\n  width: ?number,\n  height: ?number,\n  uri: string,\n  scale: number,\n};\n\nimport type { PackagerAsset } from 'AssetRegistry';\n\nconst PixelRatio = require('PixelRatio');\nconst Platform = require('Platform');\n\nconst assetPathUtils = require('../../local-cli/bundle/assetPathUtils');\nconst invariant = require('fbjs/lib/invariant');\n\n/**\n * Returns a path like 'assets/AwesomeModule/icon@2x.png'\n */\nfunction getScaledAssetPath(asset): string {\n  var scale = AssetSourceResolver.pickScale(asset.scales, PixelRatio.get());\n  var scaleSuffix = scale === 1 ? '' : '@' + scale + 'x';\n  var assetDir = assetPathUtils.getBasePath(asset);\n  return assetDir + '/' + asset.name + scaleSuffix + '.' + asset.type;\n}\n\n/**\n * Returns a path like 'drawable-mdpi/icon.png'\n */\nfunction getAssetPathInDrawableFolder(asset): string {\n  var scale = AssetSourceResolver.pickScale(asset.scales, PixelRatio.get());\n  var drawbleFolder = assetPathUtils.getAndroidResourceFolderName(asset, scale);\n  var fileName =  assetPathUtils.getAndroidResourceIdentifier(asset);\n  return drawbleFolder + '/' + fileName + '.' + asset.type;\n}\n\nclass AssetSourceResolver {\n\n  serverUrl: ?string;\n  // where the jsbundle is being run from\n  jsbundleUrl: ?string;\n  // the asset to resolve\n  asset: PackagerAsset;\n\n  constructor(serverUrl: ?string,\n    jsbundleUrl: ?string,\n    asset: PackagerAsset\n  ) {\n    this.serverUrl = serverUrl;\n    this.jsbundleUrl = jsbundleUrl;\n    this.asset = asset;\n  }\n\n  isLoadedFromServer(): boolean {\n    return !!this.serverUrl;\n  }\n\n  isLoadedFromFileSystem(): boolean {\n    return !!(this.jsbundleUrl && this.jsbundleUrl.startsWith('file://'));\n  }\n\n  defaultAsset(): ResolvedAssetSource {\n    if (this.isLoadedFromServer()) {\n      return this.assetServerURL();\n    }\n\n    if (Platform.OS === 'android') {\n      return this.isLoadedFromFileSystem() ?\n        this.drawableFolderInBundle() :\n        this.resourceIdentifierWithoutScale();\n    } else {\n      return this.scaledAssetURLNearBundle();\n    }\n  }\n\n  /**\n   * Returns an absolute URL which can be used to fetch the asset\n   * from the devserver\n   */\n  assetServerURL(): ResolvedAssetSource {\n    invariant(!!this.serverUrl, 'need server to load from');\n    return this.fromSource(\n      this.serverUrl + getScaledAssetPath(this.asset) +\n      '?platform=' + Platform.OS + '&hash=' + this.asset.hash\n    );\n  }\n\n  /**\n   * Resolves to just the scaled asset filename\n   * E.g. 'assets/AwesomeModule/icon@2x.png'\n   */\n  scaledAssetPath(): ResolvedAssetSource {\n    return this.fromSource(getScaledAssetPath(this.asset));\n  }\n\n  /**\n   * Resolves to where the bundle is running from, with a scaled asset filename\n   * E.g. 'file:///sdcard/bundle/assets/AwesomeModule/icon@2x.png'\n   */\n  scaledAssetURLNearBundle(): ResolvedAssetSource {\n    const path = this.jsbundleUrl || 'file://';\n    return this.fromSource(path + getScaledAssetPath(this.asset));\n  }\n\n  /**\n   * The default location of assets bundled with the app, located by\n   * resource identifier\n   * The Android resource system picks the correct scale.\n   * E.g. 'assets_awesomemodule_icon'\n   */\n  resourceIdentifierWithoutScale(): ResolvedAssetSource {\n    invariant(Platform.OS === 'android', 'resource identifiers work on Android');\n    return this.fromSource(assetPathUtils.getAndroidResourceIdentifier(this.asset));\n  }\n\n  /**\n   * If the jsbundle is running from a sideload location, this resolves assets\n   * relative to its location\n   * E.g. 'file:///sdcard/AwesomeModule/drawable-mdpi/icon.png'\n   */\n  drawableFolderInBundle(): ResolvedAssetSource {\n    const path = this.jsbundleUrl || 'file://';\n    return this.fromSource(\n      path + getAssetPathInDrawableFolder(this.asset)\n    );\n  }\n\n  fromSource(source: string): ResolvedAssetSource {\n    return {\n      __packager_asset: true,\n      width: this.asset.width,\n      height: this.asset.height,\n      uri: source,\n      scale: AssetSourceResolver.pickScale(this.asset.scales, PixelRatio.get()),\n    };\n  }\n\n  static pickScale(scales: Array<number>, deviceScale: number): number {\n    // Packager guarantees that `scales` array is sorted\n    for (var i = 0; i < scales.length; i++) {\n      if (scales[i] >= deviceScale) {\n        return scales[i];\n      }\n    }\n\n    // If nothing matches, device scale is larger than any available\n    // scales, so we return the biggest one. Unless the array is empty,\n    // in which case we default to 1\n    return scales[scales.length - 1] || 1;\n  }\n\n}\n\n module.exports = AssetSourceResolver;\n"
  },
  {
    "path": "Libraries/Image/Image.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Image\n * @flow\n */\n'use strict';\n\nvar ImageResizeMode = require('ImageResizeMode');\nvar ImageStylePropTypes = require('ImageStylePropTypes');\nvar NativeMethodsMixin = require('NativeMethodsMixin');\nvar NativeModules = require('NativeModules');\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar ReactNativeViewAttributes = require('ReactNativeViewAttributes');\nvar Set = require('Set');\nvar StyleSheet = require('StyleSheet');\nvar StyleSheetPropType = require('StyleSheetPropType');\nvar View = require('View');\nvar ViewPropTypes = require('ViewPropTypes');\nvar ViewStylePropTypes = require('ViewStylePropTypes');\n\nvar createReactClass = require('create-react-class');\nvar filterObject = require('fbjs/lib/filterObject');\nvar flattenStyle = require('flattenStyle');\nvar merge = require('merge');\nvar requireNativeComponent = require('requireNativeComponent');\nvar resolveAssetSource = require('resolveAssetSource');\n\nvar {\n  ImageLoader,\n} = NativeModules;\n\nlet _requestId = 1;\nfunction generateRequestId() {\n  return _requestId++;\n}\n\n/**\n * <Image> - A react component for displaying different types of images,\n * including network images, static resources, temporary local images, and\n * images from local disk, such as the camera roll.  Example usage:\n *\n *   renderImages: function() {\n *     return (\n *       <View>\n *         <Image\n *           style={styles.icon}\n *           source={require('./myIcon.png')}\n *         />\n *         <Image\n *           style={styles.logo}\n *           source={{uri: 'https://facebook.github.io/react-native/img/opengraph.png'}}\n *         />\n *       </View>\n *     );\n *   },\n *\n * More example code in ImageExample.js\n */\n\nvar ImageViewAttributes = merge(ReactNativeViewAttributes.UIView, {\n  src: true,\n  loadingIndicatorSrc: true,\n  resizeMethod: true,\n  resizeMode: true,\n  progressiveRenderingEnabled: true,\n  fadeDuration: true,\n  shouldNotifyLoadEvents: true,\n});\n\nvar ViewStyleKeys = new Set(Object.keys(ViewStylePropTypes));\nvar ImageSpecificStyleKeys = new Set(Object.keys(ImageStylePropTypes).filter(x => !ViewStyleKeys.has(x)));\n\nvar Image = createReactClass({\n  displayName: 'Image',\n  propTypes: {\n    ...ViewPropTypes,\n    style: StyleSheetPropType(ImageStylePropTypes),\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 a static image\n     * resource (which should be wrapped in the `require('./path/to/image.png')` function).\n     *\n     * `headers` is an object representing the HTTP headers to send along with the request\n     * for a remote image.\n     *\n     * This prop can also contain several remote `uri`, specified together with\n     * their width and height. The native side will then choose the best `uri` to display\n     * based on the measured size of the image container.\n     */\n    source: PropTypes.oneOfType([\n      PropTypes.shape({\n        uri: PropTypes.string,\n        headers: PropTypes.objectOf(PropTypes.string),\n      }),\n      // Opaque type returned by require('./image.jpg')\n      PropTypes.number,\n      // Multiple sources\n      PropTypes.arrayOf(\n        PropTypes.shape({\n          uri: PropTypes.string,\n          width: PropTypes.number,\n          height: PropTypes.number,\n          headers: PropTypes.objectOf(PropTypes.string),\n        }))\n    ]),\n    /**\n    * blurRadius: the blur radius of the blur filter added to the image\n    */\n    blurRadius: PropTypes.number,\n    /**\n     * similarly to `source`, this property represents the resource used to render\n     * the loading indicator for the image, displayed until image is ready to be\n     * displayed, typically after when it got downloaded from network.\n     */\n    loadingIndicatorSource: PropTypes.oneOfType([\n      PropTypes.shape({\n        uri: PropTypes.string,\n      }),\n      // Opaque type returned by require('./image.jpg')\n      PropTypes.number,\n    ]),\n    progressiveRenderingEnabled: PropTypes.bool,\n    fadeDuration: PropTypes.number,\n    /**\n     * Invoked on load start\n     */\n    onLoadStart: PropTypes.func,\n    /**\n     * Invoked on load error\n     */\n    onError: PropTypes.func,\n    /**\n     * Invoked when load completes successfully\n     */\n    onLoad: PropTypes.func,\n    /**\n     * Invoked when load either succeeds or fails\n     */\n    onLoadEnd: PropTypes.func,\n    /**\n     * Used to locate this view in end-to-end tests.\n     */\n    testID: PropTypes.string,\n    /**\n     * The mechanism that should be used to resize the image when the image's dimensions\n     * differ from the image view's dimensions. Defaults to `auto`.\n     *\n     * - `auto`: Use heuristics to pick between `resize` and `scale`.\n     *\n     * - `resize`: A software operation which changes the encoded image in memory before it\n     * gets decoded. This should be used instead of `scale` when the image is much larger\n     * than the view.\n     *\n     * - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is\n     * faster (usually hardware accelerated) and produces higher quality images. This\n     * should be used if the image is smaller than the view. It should also be used if the\n     * image is slightly bigger than the view.\n     *\n     * More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.\n     *\n     * @platform android\n     */\n    resizeMethod: PropTypes.oneOf(['auto', 'resize', 'scale']),\n    /**\n     * Determines how to resize the image when the frame doesn't match the raw\n     * image dimensions.\n     *\n     * 'cover': Scale the image uniformly (maintain the image's aspect ratio)\n     * so that both dimensions (width and height) of the image will be equal\n     * to or larger than the corresponding dimension of the view (minus padding).\n     *\n     * 'contain': Scale the image uniformly (maintain the image's aspect ratio)\n     * so that both dimensions (width and height) of the image will be equal to\n     * or less than the corresponding dimension of the view (minus padding).\n     *\n     * 'stretch': Scale width and height independently, This may change the\n     * aspect ratio of the src.\n     *\n     * 'center': Scale the image down so that it is completely visible,\n     * if bigger than the area of the view.\n     * The image will not be scaled up.\n     */\n    resizeMode: PropTypes.oneOf(['cover', 'contain', 'stretch', 'center']),\n  },\n\n  statics: {\n    resizeMode: ImageResizeMode,\n\n    getSize(\n      url: string,\n      success: (width: number, height: number) => void,\n      failure?: (error: any) => void,\n    ) {\n      return ImageLoader.getSize(url)\n        .then(function(sizes) {\n          success(sizes.width, sizes.height);\n        })\n        .catch(failure || function() {\n          console.warn('Failed to get size for image: ' + url);\n        });\n    },\n\n    /**\n     * Prefetches a remote image for later use by downloading it to the disk\n     * cache\n     */\n    prefetch(url: string, callback: ?Function) {\n      const requestId = generateRequestId();\n      callback && callback(requestId);\n      return ImageLoader.prefetchImage(url, requestId);\n    },\n\n    /**\n     * Abort prefetch request\n     */\n    abortPrefetch(requestId: number) {\n      ImageLoader.abortRequest(requestId);\n    },\n\n    /**\n     * Perform cache interrogation.\n     *\n     * @param urls the list of image URLs to check the cache for.\n     * @return a mapping from url to cache status, such as \"disk\" or \"memory\". If a requested URL is\n     *         not in the mapping, it means it's not in the cache.\n     */\n    async queryCache(urls: Array<string>): Promise<Map<string, 'memory' | 'disk'>> {\n      return await ImageLoader.queryCache(urls);\n    },\n\n    /**\n     * Resolves an asset reference into an object which has the properties `uri`, `width`,\n     * and `height`. The input may either be a number (opaque type returned by\n     * require('./foo.png')) or an `ImageSource` like { uri: '<http location || file path>' }\n     */\n    resolveAssetSource: resolveAssetSource,\n  },\n\n  mixins: [NativeMethodsMixin],\n\n  /**\n   * `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We\n   * make `this` look like an actual native component class.\n   */\n  viewConfig: {\n    uiViewClassName: 'RCTView',\n    validAttributes: ReactNativeViewAttributes.RCTView,\n  },\n\n  contextTypes: {\n    isInAParentText: PropTypes.bool\n  },\n\n  render: function() {\n    const source = resolveAssetSource(this.props.source);\n    const loadingIndicatorSource = resolveAssetSource(this.props.loadingIndicatorSource);\n\n    // As opposed to the ios version, here we render `null` when there is no source, source.uri\n    // or source array.\n\n    if (source && source.uri === '') {\n      console.warn('source.uri should not be an empty string');\n    }\n\n    if (this.props.src) {\n      console.warn('The <Image> component requires a `source` property rather than `src`.');\n    }\n\n    if (this.props.children) {\n      throw new Error('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    if (source && (source.uri || Array.isArray(source))) {\n      let style;\n      let sources;\n      if (source.uri) {\n        const {width, height} = source;\n        style = flattenStyle([{width, height}, styles.base, this.props.style]);\n        sources = [{uri: source.uri}];\n      } else {\n        style = flattenStyle([styles.base, this.props.style]);\n        sources = source;\n      }\n\n      const {onLoadStart, onLoad, onLoadEnd, onError} = this.props;\n      const nativeProps = merge(this.props, {\n        style,\n        shouldNotifyLoadEvents: !!(onLoadStart || onLoad || onLoadEnd || onError),\n        src: sources,\n        headers: source.headers,\n        loadingIndicatorSrc: loadingIndicatorSource ? loadingIndicatorSource.uri : null,\n      });\n\n      if (this.context.isInAParentText) {\n        return <RCTTextInlineImage {...nativeProps}/>;\n      } else {\n        return <RKImage {...nativeProps}/>;\n      }\n    }\n    return null;\n  }\n});\n\nvar styles = StyleSheet.create({\n  base: {\n    overflow: 'hidden',\n  },\n});\n\nvar cfg = {\n  nativeOnly: {\n    src: true,\n    headers: true,\n    loadingIndicatorSrc: true,\n    shouldNotifyLoadEvents: true,\n  },\n};\nvar RKImage = requireNativeComponent('RCTImageView', Image, cfg);\nvar RCTTextInlineImage = requireNativeComponent('RCTTextInlineImage', Image, cfg);\n\nmodule.exports = Image;\n"
  },
  {
    "path": "Libraries/Image/Image.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Image\n * @flow\n */\n'use strict';\n\nconst EdgeInsetsPropType = require('EdgeInsetsPropType');\nconst ImageResizeMode = require('ImageResizeMode');\nconst ImageSourcePropType = require('ImageSourcePropType');\nconst ImageStylePropTypes = require('ImageStylePropTypes');\nconst NativeMethodsMixin = require('NativeMethodsMixin');\nconst NativeModules = require('NativeModules');\nconst React = require('React');\nconst PropTypes = require('prop-types');\nconst ReactNativeViewAttributes = require('ReactNativeViewAttributes');\nconst StyleSheet = require('StyleSheet');\nconst StyleSheetPropType = require('StyleSheetPropType');\n\nconst createReactClass = require('create-react-class');\nconst flattenStyle = require('flattenStyle');\nconst requireNativeComponent = require('requireNativeComponent');\nconst resolveAssetSource = require('resolveAssetSource');\n\nconst ImageViewManager = NativeModules.ImageViewManager;\n\n/**\n * A React component for displaying different types of images,\n * including network images, static resources, temporary local images, and\n * images from local disk, such as the camera roll.\n *\n * This example shows fetching and displaying an image from local storage\n * as well as one from network and even from data provided in the `'data:'` uri scheme.\n *\n * > Note that for network and data images, you will need to manually specify the dimensions of your image!\n *\n * ```ReactNativeWebPlayer\n * import React, { Component } from 'react';\n * import { AppRegistry, View, Image } from 'react-native';\n *\n * export default class DisplayAnImage extends Component {\n *   render() {\n *     return (\n *       <View>\n *         <Image\n *           source={require('./img/favicon.png')}\n *         />\n *         <Image\n *           style={{width: 50, height: 50}}\n *           source={{uri: 'https://facebook.github.io/react-native/img/favicon.png'}}\n *         />\n *         <Image\n *           style={{width: 66, height: 58}}\n *           source={{uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAYAAAA6oTAqAAAAEXRFWHRTb2Z0d2FyZQBwbmdjcnVzaEB1SfMAAABQSURBVGje7dSxCQBACARB+2/ab8BEeQNhFi6WSYzYLYudDQYGBgYGBgYGBgYGBgYGBgZmcvDqYGBgmhivGQYGBgYGBgYGBgYGBgYGBgbmQw+P/eMrC5UTVAAAAABJRU5ErkJggg=='}}\n *         />\n *       </View>\n *     );\n *   }\n * }\n *\n * // skip this line if using Create React Native App\n * AppRegistry.registerComponent('DisplayAnImage', () => DisplayAnImage);\n * ```\n *\n * You can also add `style` to an image:\n *\n * ```ReactNativeWebPlayer\n * import React, { Component } from 'react';\n * import { AppRegistry, View, Image, StyleSheet } from 'react-native';\n *\n * const styles = StyleSheet.create({\n *   stretch: {\n *     width: 50,\n *     height: 200\n *   }\n * });\n *\n * export default class DisplayAnImageWithStyle extends Component {\n *   render() {\n *     return (\n *       <View>\n *         <Image\n *           style={styles.stretch}\n *           source={require('./img/favicon.png')}\n *         />\n *       </View>\n *     );\n *   }\n * }\n *\n * // skip these lines if using Create React Native App\n * AppRegistry.registerComponent(\n *   'DisplayAnImageWithStyle',\n *   () => DisplayAnImageWithStyle\n * );\n * ```\n *\n * ### GIF and WebP support on Android\n *\n * When building your own native code, GIF and WebP are not supported by default on Android.\n *\n * You will need to add some optional modules in `android/app/build.gradle`, depending on the needs of your app.\n *\n * ```\n * dependencies {\n *   // If your app supports Android versions before Ice Cream Sandwich (API level 14)\n *   compile 'com.facebook.fresco:animated-base-support:1.3.0'\n *\n *   // For animated GIF support\n *   compile 'com.facebook.fresco:animated-gif:1.3.0'\n *\n *   // For WebP support, including animated WebP\n *   compile 'com.facebook.fresco:animated-webp:1.3.0'\n *   compile 'com.facebook.fresco:webpsupport:1.3.0'\n *\n *   // For WebP support, without animations\n *   compile 'com.facebook.fresco:webpsupport:1.3.0'\n * }\n * ```\n *\n * Also, if you use GIF with ProGuard, you will need to add this rule in `proguard-rules.pro` :\n * ```\n * -keep class com.facebook.imagepipeline.animated.factory.AnimatedFactoryImpl {\n *   public AnimatedFactoryImpl(com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory, com.facebook.imagepipeline.core.ExecutorSupplier);\n * }\n * ```\n *\n */\nconst Image = createReactClass({\n  displayName: 'Image',\n  propTypes: {\n    /**\n     * > `ImageResizeMode` is an `Enum` for different image resizing modes, set via the\n     * > `resizeMode` style property on `Image` components. The values are `contain`, `cover`,\n     * > `stretch`, `center`, `repeat`.\n     */\n    style: StyleSheetPropType(ImageStylePropTypes),\n    /**\n     * The image source (either a remote URL or a local file resource).\n     *\n     * This prop can also contain several remote URLs, specified together with\n     * their width and height and potentially with scale/other URI arguments.\n     * The native side will then choose the best `uri` to display based on the\n     * measured size of the image container. A `cache` property can be added to\n     * control how networked request interacts with the local cache.\n     *\n     * The currently supported formats are `png`, `jpg`, `jpeg`, `bmp`, `gif`,\n     * `webp` (Android only), `psd` (iOS only).\n     */\n    source: ImageSourcePropType,\n    /**\n     * A static image to display while loading the image source.\n     *\n     * - `uri` - a string representing the resource identifier for the image, which\n     * should be either a local file path or the name of a static image resource\n     * (which should be wrapped in the `require('./path/to/image.png')` function).\n     * - `width`, `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     * - `scale` - 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     * - `number` - Opaque type returned by something like `require('./image.jpg')`.\n     *\n     * @platform ios\n     */\n    defaultSource: PropTypes.oneOfType([\n      // TODO: Tooling to support documenting these directly and having them display in the docs.\n      PropTypes.shape({\n        uri: PropTypes.string,\n        width: PropTypes.number,\n        height: PropTypes.number,\n        scale: PropTypes.number,\n      }),\n      PropTypes.number,\n    ]),\n    /**\n     * When true, indicates the image is an accessibility element.\n     * @platform ios\n     */\n    accessible: PropTypes.bool,\n    /**\n     * The text that's read by the screen reader when the user interacts with\n     * the image.\n     * @platform ios\n     */\n    accessibilityLabel: PropTypes.node,\n    /**\n    * blurRadius: the blur radius of the blur filter added to the image\n    */\n    blurRadius: PropTypes.number,\n    /**\n     * When the image is resized, the corners of the size specified\n     * by `capInsets` will stay a fixed size, but the center content and borders\n     * of the image will be stretched.  This is useful for creating resizable\n     * rounded buttons, shadows, and other resizable assets.  More info in the\n     * [official Apple documentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/index.html#//apple_ref/occ/instm/UIImage/resizableImageWithCapInsets).\n     *\n     * @platform ios\n     */\n    capInsets: EdgeInsetsPropType,\n    /**\n     * The mechanism that should be used to resize the image when the image's dimensions\n     * differ from the image view's dimensions. Defaults to `auto`.\n     *\n     * - `auto`: Use heuristics to pick between `resize` and `scale`.\n     *\n     * - `resize`: A software operation which changes the encoded image in memory before it\n     * gets decoded. This should be used instead of `scale` when the image is much larger\n     * than the view.\n     *\n     * - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is\n     * faster (usually hardware accelerated) and produces higher quality images. This\n     * should be used if the image is smaller than the view. It should also be used if the\n     * image is slightly bigger than the view.\n     *\n     * More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.\n     *\n     * @platform android\n     */\n    resizeMethod: PropTypes.oneOf(['auto', 'resize', 'scale']),\n    /**\n     * Determines how to resize the image when the frame doesn't match the raw\n     * image dimensions.\n     *\n     * - `cover`: Scale the image uniformly (maintain the image's aspect ratio)\n     * so that both dimensions (width and height) of the image will be equal\n     * to or larger than the corresponding dimension of the view (minus padding).\n     *\n     * - `contain`: Scale the image uniformly (maintain the image's aspect ratio)\n     * so that both dimensions (width and height) of the image will be equal to\n     * or less than the corresponding dimension of the view (minus padding).\n     *\n     * - `stretch`: Scale width and height independently, This may change the\n     * aspect ratio of the src.\n     *\n     * - `repeat`: Repeat the image to cover the frame of the view. The\n     * image will keep it's size and aspect ratio. (iOS only)\n     */\n    resizeMode: PropTypes.oneOf(['cover', 'contain', 'stretch', 'repeat', 'center']),\n    /**\n     * A unique identifier for this element to be used in UI Automation\n     * testing scripts.\n     */\n    testID: PropTypes.string,\n    /**\n     * Invoked on mount and layout changes with\n     * `{nativeEvent: {layout: {x, y, width, height}}}`.\n     */\n    onLayout: PropTypes.func,\n    /**\n     * Invoked on load start.\n     *\n     * e.g., `onLoadStart={(e) => this.setState({loading: true})}`\n     */\n    onLoadStart: PropTypes.func,\n    /**\n     * Invoked on download progress with `{nativeEvent: {loaded, total}}`.\n     * @platform ios\n     */\n    onProgress: PropTypes.func,\n    /**\n     * Invoked on load error with `{nativeEvent: {error}}`.\n     */\n    onError: PropTypes.func,\n    /**\n     * Invoked when a partial load of the image is complete. The definition of\n     * what constitutes a \"partial load\" is loader specific though this is meant\n     * for progressive JPEG loads.\n     * @platform ios\n     */\n    onPartialLoad: PropTypes.func,\n    /**\n     * Invoked when load completes successfully.\n     */\n    onLoad: PropTypes.func,\n    /**\n     * Invoked when load either succeeds or fails.\n     */\n    onLoadEnd: PropTypes.func,\n  },\n\n  statics: {\n    resizeMode: ImageResizeMode,\n    /**\n     * Retrieve the width and height (in pixels) of an image prior to displaying it.\n     * This method can fail if the image cannot be found, or fails to download.\n     *\n     * In order to retrieve the image dimensions, the image may first need to be\n     * loaded or downloaded, after which it will be cached. This means that in\n     * principle you could use this method to preload images, however it is not\n     * optimized for that purpose, and may in future be implemented in a way that\n     * does not fully load/download the image data. A proper, supported way to\n     * preload images will be provided as a separate API.\n     *\n     * Does not work for static image resources.\n     *\n     * @param uri The location of the image.\n     * @param success The function that will be called if the image was successfully found and width\n     * and height retrieved.\n     * @param failure The function that will be called if there was an error, such as failing to\n     * to retrieve the image.\n     *\n     * @returns void\n     *\n     * @platform ios\n     */\n    getSize: function(\n      uri: string,\n      success: (width: number, height: number) => void,\n      failure?: (error: any) => void,\n    ) {\n      ImageViewManager.getSize(uri, success, failure || function() {\n        console.warn('Failed to get size for image: ' + uri);\n      });\n    },\n    /**\n     * Prefetches a remote image for later use by downloading it to the disk\n     * cache\n     *\n     * @param url The remote location of the image.\n     *\n     * @return The prefetched image.\n     */\n    prefetch(url: string) {\n      return ImageViewManager.prefetchImage(url);\n    },\n    /**\n     * Resolves an asset reference into an object which has the properties `uri`, `width`,\n     * and `height`. The input may either be a number (opaque type returned by\n     * require('./foo.png')) or an `ImageSource` like { uri: '<http location || file path>' }\n     */\n    resolveAssetSource: resolveAssetSource,\n  },\n\n  mixins: [NativeMethodsMixin],\n\n  /**\n   * `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We\n   * make `this` look like an actual native component class.\n   */\n  viewConfig: {\n    uiViewClassName: 'UIView',\n    validAttributes: ReactNativeViewAttributes.UIView\n  },\n\n  render: function() {\n    const source = resolveAssetSource(this.props.source) || { uri: undefined, width: undefined, height: undefined };\n\n    let sources;\n    let style;\n    if (Array.isArray(source)) {\n      style = flattenStyle([styles.base, this.props.style]) || {};\n      sources = source;\n    } else {\n      const {width, height, uri} = source;\n      style = flattenStyle([{width, height}, styles.base, this.props.style]) || {};\n      sources = [source];\n\n      if (uri === '') {\n        console.warn('source.uri should not be an empty string');\n      }\n    }\n\n    const resizeMode = this.props.resizeMode || (style || {}).resizeMode || 'cover'; // Workaround for flow bug t7737108\n    const tintColor = (style || {}).tintColor; // Workaround for flow bug t7737108\n\n    if (this.props.src) {\n      console.warn('The <Image> component requires a `source` property rather than `src`.');\n    }\n\n    if (this.props.children) {\n      throw new Error('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    return (\n      <RCTImageView\n        {...this.props}\n        style={style}\n        resizeMode={resizeMode}\n        tintColor={tintColor}\n        source={sources}\n      />\n    );\n  },\n});\n\nconst styles = StyleSheet.create({\n  base: {\n    overflow: 'hidden',\n  },\n});\n\nconst RCTImageView = requireNativeComponent('RCTImageView', Image);\n\nmodule.exports = Image;\n"
  },
  {
    "path": "Libraries/Image/ImageBackground.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ImageBackground\n * @flow\n * @format\n */\n'use strict';\n\nconst Image = require('Image');\nconst React = require('React');\nconst StyleSheet = require('StyleSheet');\nconst View = require('View');\n\nconst ensureComponentIsNative = require('ensureComponentIsNative');\n\nimport type {NativeMethodsMixinType} from 'ReactNativeTypes';\n\n/**\n * Very simple drop-in replacement for <Image> which supports nesting views.\n *\n * ```ReactNativeWebPlayer\n * import React, { Component } from 'react';\n * import { AppRegistry, View, ImageBackground, Text } from 'react-native';\n *\n * class DisplayAnImageBackground extends Component {\n *   render() {\n *     return (\n *       <ImageBackground\n *         style={{width: 50, height: 50}}\n *         source={{uri: 'https://facebook.github.io/react-native/img/opengraph.png'}}\n *       >\n *         <Text>React</Text>\n *       </ImageBackground>\n *     );\n *   }\n * }\n *\n * // App registration and rendering\n * AppRegistry.registerComponent('DisplayAnImageBackground', () => DisplayAnImageBackground);\n * ```\n */\nclass ImageBackground extends React.Component<$FlowFixMeProps> {\n  setNativeProps(props: Object) {\n    // Work-around flow\n    const viewRef = this._viewRef;\n    if (viewRef) {\n      ensureComponentIsNative(viewRef);\n      viewRef.setNativeProps(props);\n    }\n  }\n\n  _viewRef: ?NativeMethodsMixinType = null;\n\n  _captureRef = ref => {\n    this._viewRef = ref;\n  };\n\n  render() {\n    const {children, style, imageStyle, imageRef, ...props} = this.props;\n\n    return (\n      <View style={style} ref={this._captureRef}>\n        <Image\n          {...props}\n          style={[\n            StyleSheet.absoluteFill,\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: style.width,\n              height: style.height,\n            },\n            imageStyle,\n          ]}\n          ref={imageRef}\n        />\n        {children}\n      </View>\n    );\n  }\n}\n\nmodule.exports = ImageBackground;\n"
  },
  {
    "path": "Libraries/Image/ImageEditor.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ImageEditor\n * @flow\n */\n'use strict';\n\nconst RCTImageEditingManager = require('NativeModules').ImageEditingManager;\n\ntype ImageCropData = {\n  /**\n   * The top-left corner of the cropped image, specified in the original\n   * image's coordinate space.\n   */\n  offset: {\n    x: number,\n    y: number,\n  },\n  /**\n   * The size (dimensions) of the cropped image, specified in the original\n   * image's coordinate space.\n   */\n  size: {\n    width: number,\n    height: number,\n  },\n  /**\n   * (Optional) size to scale the cropped image to.\n   */\n  displaySize?: ?{\n    width: number,\n    height: number,\n  },\n  /**\n   * (Optional) the resizing mode to use when scaling the image. If the\n   * `displaySize` param is not specified, this has no effect.\n   */\n  resizeMode?: ?$Enum<{\n    contain: string,\n    cover: string,\n    stretch: string,\n  }>,\n};\n\nclass ImageEditor {\n  /**\n   * Crop the image specified by the URI param. If URI points to a remote\n   * image, it will be downloaded automatically. If the image cannot be\n   * loaded/downloaded, the failure callback will be called.\n   *\n   * If the cropping process is successful, the resultant cropped image\n   * will be stored in the ImageStore, and the URI returned in the success\n   * callback will point to the image in the store. Remember to delete the\n   * cropped image from the ImageStore when you are done with it.\n   */\n  static cropImage(\n    uri: string,\n    cropData: ImageCropData,\n    success: (uri: string) => void,\n    failure: (error: Object) => void\n  ) {\n    RCTImageEditingManager.cropImage(uri, cropData, success, failure);\n  }\n}\n\nmodule.exports = ImageEditor;\n"
  },
  {
    "path": "Libraries/Image/ImageResizeMode.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ImageResizeMode\n * @flow\n */\n'use strict';\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar keyMirror = require('fbjs/lib/keyMirror');\n\n/**\n * ImageResizeMode - Enum for different image resizing modes, set via\n * `resizeMode` style property on `<Image>` components.\n */\nvar ImageResizeMode = keyMirror({\n  /**\n   * cover - The image will be resized such that the entire area of the view\n   * is covered by the image, potentially clipping parts of the image.\n   */\n  cover: null,\n  /**\n   * contain - The image will be resized such that it will be completely\n   * visible, contained within the frame of the View.\n   */\n  contain: null,\n  /**\n   * stretch - The image will be stretched to fill the entire frame of the\n   * view without clipping. This may change the aspect ratio of the image,\n   * distorting it.\n   */\n  stretch: null,\n  /**\n  * center - The image will be scaled down such that it is completely visible,\n  * if bigger than the area of the view.\n  * The image will not be scaled up.\n  */\n  center: null,\n\n  /**\n   * repeat - The image will be repeated to cover the frame of the View. The\n   * image will keep it's size and aspect ratio.\n   */\n  repeat: null,\n});\n\nmodule.exports = ImageResizeMode;\n"
  },
  {
    "path": "Libraries/Image/ImageSource.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ImageSource\n * @flow\n */\n'use strict';\n\n// This is to sync with ImageSourcePropTypes.js.\n\ntype ImageURISource = {\n  uri?: string,\n  bundle?: string,\n  method?: string,\n  headers?: Object,\n  body?: string,\n  cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached',\n  width?: number,\n  height?: number,\n  scale?: number,\n};\n\nexport type ImageSource = ImageURISource | number | Array<ImageURISource>;\n"
  },
  {
    "path": "Libraries/Image/ImageSourcePropType.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ImageSourcePropType\n * @no-flow\n */\n'use strict';\n\nconst PropTypes = require('prop-types');\n\nconst ImageURISourcePropType = PropTypes.shape({\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: PropTypes.string,\n  /**\n   * `bundle` is the iOS asset bundle which the image is included in. This\n   * will default to [NSBundle mainBundle] if not set.\n   * @platform ios\n   */\n  bundle: PropTypes.string,\n  /**\n   * `method` is the HTTP Method to use. Defaults to GET if not specified.\n   */\n  method: PropTypes.string,\n  /**\n   * `headers` is an object representing the HTTP headers to send along with the\n   * request for a remote image.\n   */\n  headers: PropTypes.objectOf(PropTypes.string),\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: PropTypes.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: PropTypes.oneOf([\n    'default',\n    'reload',\n    'force-cache',\n    'only-if-cached',\n  ]),\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  width: PropTypes.number,\n  height: PropTypes.number,\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: PropTypes.number,\n});\n\nconst ImageSourcePropType = PropTypes.oneOfType([\n  ImageURISourcePropType,\n  // Opaque type returned by require('./image.jpg')\n  PropTypes.number,\n  // Multiple sources\n  PropTypes.arrayOf(ImageURISourcePropType),\n]);\n\nmodule.exports = ImageSourcePropType;\n"
  },
  {
    "path": "Libraries/Image/ImageStore.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ImageStore\n * @flow\n */\n'use strict';\n\nconst RCTImageStoreManager = require('NativeModules').ImageStoreManager;\n\nclass ImageStore {\n  /**\n   * Check if the ImageStore contains image data for the specified URI.\n   * @platform ios\n   */\n  static hasImageForTag(uri: string, callback: (hasImage: bool) => void) {\n    if (RCTImageStoreManager.hasImageForTag) {\n      RCTImageStoreManager.hasImageForTag(uri, callback);\n    } else {\n      console.warn('hasImageForTag() not implemented');\n    }\n  }\n\n  /**\n   * Delete an image from the ImageStore. Images are stored in memory and\n   * must be manually removed when you are finished with them, otherwise they\n   * will continue to use up RAM until the app is terminated. It is safe to\n   * call `removeImageForTag()` without first calling `hasImageForTag()`, it\n   * will simply fail silently.\n   * @platform ios\n   */\n  static removeImageForTag(uri: string) {\n    if (RCTImageStoreManager.removeImageForTag) {\n      RCTImageStoreManager.removeImageForTag(uri);\n    } else {\n      console.warn('removeImageForTag() not implemented');\n    }\n  }\n\n  /**\n   * Stores a base64-encoded image in the ImageStore, and returns a URI that\n   * can be used to access or display the image later. Images are stored in\n   * memory only, and must be manually deleted when you are finished with\n   * them by calling `removeImageForTag()`.\n   *\n   * Note that it is very inefficient to transfer large quantities of binary\n   * data between JS and native code, so you should avoid calling this more\n   * than necessary.\n   * @platform ios\n   */\n  static addImageFromBase64(\n    base64ImageData: string,\n    success: (uri: string) => void,\n    failure: (error: any) => void\n  ) {\n    RCTImageStoreManager.addImageFromBase64(base64ImageData, success, failure);\n  }\n\n  /**\n   * Retrieves the base64-encoded data for an image in the ImageStore. If the\n   * specified URI does not match an image in the store, the failure callback\n   * will be called.\n   *\n   * Note that it is very inefficient to transfer large quantities of binary\n   * data between JS and native code, so you should avoid calling this more\n   * than necessary. To display an image in the ImageStore, you can just pass\n   * the URI to an `<Image/>` component; there is no need to retrieve the\n   * base64 data.\n   */\n  static getBase64ForTag(\n    uri: string,\n    success: (base64ImageData: string) => void,\n    failure: (error: any) => void\n  ) {\n    RCTImageStoreManager.getBase64ForTag(uri, success, failure);\n  }\n}\n\nmodule.exports = ImageStore;\n"
  },
  {
    "path": "Libraries/Image/ImageStylePropTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ImageStylePropTypes\n * @flow\n */\n'use strict';\n\nvar ColorPropType = require('ColorPropType');\nvar ImageResizeMode = require('ImageResizeMode');\nvar LayoutPropTypes = require('LayoutPropTypes');\nvar ReactPropTypes = require('prop-types');\nvar ShadowPropTypesIOS = require('ShadowPropTypesIOS');\nvar TransformPropTypes = require('TransformPropTypes');\n\nvar ImageStylePropTypes = {\n  ...LayoutPropTypes,\n  ...ShadowPropTypesIOS,\n  ...TransformPropTypes,\n  resizeMode: ReactPropTypes.oneOf(Object.keys(ImageResizeMode)),\n  backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']),\n  backgroundColor: ColorPropType,\n  borderColor: ColorPropType,\n  borderWidth: ReactPropTypes.number,\n  borderRadius: ReactPropTypes.number,\n  overflow: ReactPropTypes.oneOf(['visible', 'hidden']),\n\n  /**\n   * Changes the color of all the non-transparent pixels to the tintColor.\n   */\n  tintColor: ColorPropType,\n  opacity: ReactPropTypes.number,\n  /**\n   * When the image has rounded corners, specifying an overlayColor will\n   * cause the remaining space in the corners to be filled with a solid color.\n   * This is useful in cases which are not supported by the Android\n   * implementation of rounded corners:\n   *   - Certain resize modes, such as 'contain'\n   *   - Animated GIFs\n   *\n   * A typical way to use this prop is with images displayed on a solid\n   * background and setting the `overlayColor` to the same color\n   * as the background.\n   *\n   * For details of how this works under the hood, see\n   * http://frescolib.org/docs/rounded-corners-and-circles.html\n   *\n   * @platform android\n  */\n  overlayColor: ReactPropTypes.string,\n\n  // Android-Specific styles\n  borderTopLeftRadius: ReactPropTypes.number,\n  borderTopRightRadius: ReactPropTypes.number,\n  borderBottomLeftRadius: ReactPropTypes.number,\n  borderBottomRightRadius: ReactPropTypes.number,\n};\n\nmodule.exports = ImageStylePropTypes;\n"
  },
  {
    "path": "Libraries/Image/RCTGIFImageDecoder.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTImageLoader.h>\n\n@interface RCTGIFImageDecoder : NSObject <RCTImageDataDecoder>\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTGIFImageDecoder.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTGIFImageDecoder.h\"\n\n#import <ImageIO/ImageIO.h>\n#import <QuartzCore/QuartzCore.h>\n\n#import <React/RCTUtils.h>\n\n@implementation RCTGIFImageDecoder\n\nRCT_EXPORT_MODULE()\n\n- (BOOL)canDecodeImageData:(NSData *)imageData\n{\n  char header[7] = {};\n  [imageData getBytes:header length:6];\n\n  return !strcmp(header, \"GIF87a\") || !strcmp(header, \"GIF89a\");\n}\n\n- (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData\n                                              size:(CGSize)size\n                                             scale:(CGFloat)scale\n                                        resizeMode:(RCTResizeMode)resizeMode\n                                 completionHandler:(RCTImageLoaderCompletionBlock)completionHandler\n{\n  CGImageSourceRef imageSource = CGImageSourceCreateWithData((CFDataRef)imageData, NULL);\n  NSDictionary<NSString *, id> *properties = (__bridge_transfer NSDictionary *)CGImageSourceCopyProperties(imageSource, NULL);\n  NSUInteger loopCount = [properties[(id)kCGImagePropertyGIFDictionary][(id)kCGImagePropertyGIFLoopCount] unsignedIntegerValue];\n\n  NSImage *image = nil;\n  size_t imageCount = CGImageSourceGetCount(imageSource);\n  if (imageCount > 1) {\n\n    NSTimeInterval duration = 0;\n    NSMutableArray<NSNumber *> *delays = [NSMutableArray arrayWithCapacity:imageCount];\n    NSMutableArray<id /* CGIMageRef */> *images = [NSMutableArray arrayWithCapacity:imageCount];\n    for (size_t i = 0; i < imageCount; i++) {\n\n      CGImageRef imageRef = CGImageSourceCreateImageAtIndex(imageSource, i, NULL);\n      if (!image) {\n        // TODO: Respect the scale\n        image = [[NSImage alloc] initWithCGImage:imageRef size:CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)) ];\n      }\n\n      NSDictionary<NSString *, id> *frameProperties = (__bridge_transfer NSDictionary *)CGImageSourceCopyPropertiesAtIndex(imageSource, i, NULL);\n      NSDictionary<NSString *, id> *frameGIFProperties = frameProperties[(id)kCGImagePropertyGIFDictionary];\n\n      const NSTimeInterval kDelayTimeIntervalDefault = 0.1;\n      NSNumber *delayTime = frameGIFProperties[(id)kCGImagePropertyGIFUnclampedDelayTime] ?: frameGIFProperties[(id)kCGImagePropertyGIFDelayTime];\n      if (delayTime == nil) {\n        if (i == 0) {\n          delayTime = @(kDelayTimeIntervalDefault);\n        } else {\n          delayTime = delays[i - 1];\n        }\n      }\n\n      const NSTimeInterval kDelayTimeIntervalMinimum = 0.02;\n      if (delayTime.floatValue < (float)kDelayTimeIntervalMinimum - FLT_EPSILON) {\n        delayTime = @(kDelayTimeIntervalDefault);\n      }\n\n      duration += delayTime.doubleValue;\n      delays[i] = delayTime;\n      images[i] = (__bridge_transfer id)imageRef;\n    }\n    CFRelease(imageSource);\n\n    NSMutableArray<NSNumber *> *keyTimes = [NSMutableArray arrayWithCapacity:delays.count];\n    NSTimeInterval runningDuration = 0;\n    for (NSNumber *delayNumber in delays) {\n      [keyTimes addObject:@(runningDuration / duration)];\n      runningDuration += delayNumber.doubleValue;\n    }\n\n    [keyTimes addObject:@1.0];\n\n    // Create animation\n    CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@\"contents\"];\n    animation.calculationMode = kCAAnimationDiscrete;\n    animation.repeatCount = loopCount == 0 ? HUGE_VALF : loopCount;\n    animation.keyTimes = keyTimes;\n    animation.values = images;\n    animation.duration = duration;\n    animation.removedOnCompletion = NO;\n    image.reactKeyframeAnimation = animation;\n\n  } else {\n\n    // Don't bother creating an animation\n    CGImageRef imageRef = CGImageSourceCreateImageAtIndex(imageSource, 0, NULL);\n    if (imageRef) {\n      image = [[NSImage alloc] initWithCGImage:imageRef size:CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)) ];\n      CFRelease(imageRef);\n    }\n    CFRelease(imageSource);\n  }\n\n  completionHandler(nil, image);\n  return ^{};\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImage.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t1304D5AB1AA8C4A30002E2BE /* RCTImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5A81AA8C4A30002E2BE /* RCTImageView.m */; };\n\t\t1304D5AC1AA8C4A30002E2BE /* RCTImageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5AA1AA8C4A30002E2BE /* RCTImageViewManager.m */; };\n\t\t1304D5B21AA8C50D0002E2BE /* RCTGIFImageDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5B11AA8C50D0002E2BE /* RCTGIFImageDecoder.m */; };\n\t\t134B00A21B54232B00EC8DFB /* RCTImageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 134B00A11B54232B00EC8DFB /* RCTImageUtils.m */; };\n\t\t139A38841C4D587C00862840 /* RCTResizeMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 139A38831C4D587C00862840 /* RCTResizeMode.m */; };\n\t\t13EF7F7F1BC825B1003F47DD /* RCTLocalAssetImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 13EF7F7E1BC825B1003F47DD /* RCTLocalAssetImageLoader.m */; };\n\t\t143879381AAD32A300F088A5 /* RCTImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 143879371AAD32A300F088A5 /* RCTImageLoader.m */; };\n\t\t2D3B5F1A1D9B0D0400451313 /* RCTImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = CCD34C261D4B8FE900268922 /* RCTImageCache.m */; };\n\t\t2D3B5F1B1D9B0D0700451313 /* RCTImageBlurUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = EEF314711C9B0DD30049118E /* RCTImageBlurUtils.m */; };\n\t\t2D3B5F1C1D9B0D1300451313 /* RCTResizeMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 139A38831C4D587C00862840 /* RCTResizeMode.m */; };\n\t\t2D3B5F1D1D9B0D1300451313 /* RCTLocalAssetImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 13EF7F7E1BC825B1003F47DD /* RCTLocalAssetImageLoader.m */; };\n\t\t2D3B5F1E1D9B0D1300451313 /* RCTGIFImageDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5B11AA8C50D0002E2BE /* RCTGIFImageDecoder.m */; };\n\t\t2D3B5F1F1D9B0D1300451313 /* RCTImageEditingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 354631671B69857700AA0B86 /* RCTImageEditingManager.m */; };\n\t\t2D3B5F201D9B0D1300451313 /* RCTImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 143879371AAD32A300F088A5 /* RCTImageLoader.m */; };\n\t\t2D3B5F211D9B0D1300451313 /* RCTImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5A81AA8C4A30002E2BE /* RCTImageView.m */; };\n\t\t2D3B5F221D9B0D1300451313 /* RCTImageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5AA1AA8C4A30002E2BE /* RCTImageViewManager.m */; };\n\t\t2D3B5F231D9B0D1300451313 /* RCTImageStoreManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 35123E6A1B59C99D00EBAD80 /* RCTImageStoreManager.m */; };\n\t\t2D3B5F241D9B0D1300451313 /* RCTImageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 134B00A11B54232B00EC8DFB /* RCTImageUtils.m */; };\n\t\t35123E6B1B59C99D00EBAD80 /* RCTImageStoreManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 35123E6A1B59C99D00EBAD80 /* RCTImageStoreManager.m */; };\n\t\t354631681B69857700AA0B86 /* RCTImageEditingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 354631671B69857700AA0B86 /* RCTImageEditingManager.m */; };\n\t\t3D302E181DF8228100D6DDAE /* RCTImageUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 134B00A01B54232B00EC8DFB /* RCTImageUtils.h */; };\n\t\t3D302F211DF8269200D6DDAE /* RCTImageUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 134B00A01B54232B00EC8DFB /* RCTImageUtils.h */; };\n\t\t3DA05A5A1EE0312600805843 /* RCTImageShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 59AB09281EDE5DD1009F97B5 /* RCTImageShadowView.h */; };\n\t\t3DA05A5B1EE0312900805843 /* RCTImageShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59AB09291EDE5DD1009F97B5 /* RCTImageShadowView.m */; };\n\t\t3DED3A8A1DE6F79800336DD7 /* RCTGIFImageDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1304D5B01AA8C50D0002E2BE /* RCTGIFImageDecoder.h */; };\n\t\t3DED3A8B1DE6F79800336DD7 /* RCTImageBlurUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = EEF314701C9B0DD30049118E /* RCTImageBlurUtils.h */; };\n\t\t3DED3A8C1DE6F79800336DD7 /* RCTImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = CCD34C251D4B8FE900268922 /* RCTImageCache.h */; };\n\t\t3DED3A8D1DE6F79800336DD7 /* RCTImageEditingManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 354631661B69857700AA0B86 /* RCTImageEditingManager.h */; };\n\t\t3DED3A8E1DE6F79800336DD7 /* RCTImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5FA63C1DE4B44A0058FD77 /* RCTImageLoader.h */; };\n\t\t3DED3A8F1DE6F79800336DD7 /* RCTImageStoreManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5FA63D1DE4B44A0058FD77 /* RCTImageStoreManager.h */; };\n\t\t3DED3A901DE6F79800336DD7 /* RCTImageUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 134B00A01B54232B00EC8DFB /* RCTImageUtils.h */; };\n\t\t3DED3A911DE6F79800336DD7 /* RCTImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1304D5A71AA8C4A30002E2BE /* RCTImageView.h */; };\n\t\t3DED3A921DE6F79800336DD7 /* RCTImageViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1304D5A91AA8C4A30002E2BE /* RCTImageViewManager.h */; };\n\t\t3DED3A931DE6F79800336DD7 /* RCTLocalAssetImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 13EF7F7D1BC825B1003F47DD /* RCTLocalAssetImageLoader.h */; };\n\t\t3DED3A941DE6F79800336DD7 /* RCTResizeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5FA63E1DE4B44A0058FD77 /* RCTResizeMode.h */; };\n\t\t3DED3A961DE6F7A400336DD7 /* RCTGIFImageDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1304D5B01AA8C50D0002E2BE /* RCTGIFImageDecoder.h */; };\n\t\t3DED3A971DE6F7A400336DD7 /* RCTImageBlurUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = EEF314701C9B0DD30049118E /* RCTImageBlurUtils.h */; };\n\t\t3DED3A981DE6F7A400336DD7 /* RCTImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = CCD34C251D4B8FE900268922 /* RCTImageCache.h */; };\n\t\t3DED3A991DE6F7A400336DD7 /* RCTImageEditingManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 354631661B69857700AA0B86 /* RCTImageEditingManager.h */; };\n\t\t3DED3A9A1DE6F7A400336DD7 /* RCTImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5FA63C1DE4B44A0058FD77 /* RCTImageLoader.h */; };\n\t\t3DED3A9B1DE6F7A400336DD7 /* RCTImageStoreManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5FA63D1DE4B44A0058FD77 /* RCTImageStoreManager.h */; };\n\t\t3DED3A9C1DE6F7A400336DD7 /* RCTImageUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 134B00A01B54232B00EC8DFB /* RCTImageUtils.h */; };\n\t\t3DED3A9D1DE6F7A400336DD7 /* RCTImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1304D5A71AA8C4A30002E2BE /* RCTImageView.h */; };\n\t\t3DED3A9E1DE6F7A400336DD7 /* RCTImageViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1304D5A91AA8C4A30002E2BE /* RCTImageViewManager.h */; };\n\t\t3DED3A9F1DE6F7A400336DD7 /* RCTLocalAssetImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 13EF7F7D1BC825B1003F47DD /* RCTLocalAssetImageLoader.h */; };\n\t\t3DED3AA01DE6F7A400336DD7 /* RCTResizeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5FA63E1DE4B44A0058FD77 /* RCTResizeMode.h */; };\n\t\t59AB092A1EDE5DD1009F97B5 /* RCTImageShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 59AB09281EDE5DD1009F97B5 /* RCTImageShadowView.h */; };\n\t\t59AB092B1EDE5DD1009F97B5 /* RCTImageShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59AB09291EDE5DD1009F97B5 /* RCTImageShadowView.m */; };\n\t\tCCD34C271D4B8FE900268922 /* RCTImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = CCD34C261D4B8FE900268922 /* RCTImageCache.m */; };\n\t\tEEF314721C9B0DD30049118E /* RCTImageBlurUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = EEF314711C9B0DD30049118E /* RCTImageBlurUtils.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t3D302E171DF8225500D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/RCTImage;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3D302E181DF8228100D6DDAE /* RCTImageUtils.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D302F201DF8268700D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/RCTImage;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3D302F211DF8269200D6DDAE /* RCTImageUtils.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t1304D5A71AA8C4A30002E2BE /* RCTImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageView.h; sourceTree = \"<group>\"; };\n\t\t1304D5A81AA8C4A30002E2BE /* RCTImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageView.m; sourceTree = \"<group>\"; };\n\t\t1304D5A91AA8C4A30002E2BE /* RCTImageViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageViewManager.h; sourceTree = \"<group>\"; };\n\t\t1304D5AA1AA8C4A30002E2BE /* RCTImageViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageViewManager.m; sourceTree = \"<group>\"; };\n\t\t1304D5B01AA8C50D0002E2BE /* RCTGIFImageDecoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTGIFImageDecoder.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t1304D5B11AA8C50D0002E2BE /* RCTGIFImageDecoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTGIFImageDecoder.m; sourceTree = \"<group>\"; };\n\t\t134B00A01B54232B00EC8DFB /* RCTImageUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageUtils.h; sourceTree = \"<group>\"; };\n\t\t134B00A11B54232B00EC8DFB /* RCTImageUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageUtils.m; sourceTree = \"<group>\"; };\n\t\t139A38831C4D587C00862840 /* RCTResizeMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTResizeMode.m; sourceTree = \"<group>\"; };\n\t\t13EF7F7D1BC825B1003F47DD /* RCTLocalAssetImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLocalAssetImageLoader.h; sourceTree = \"<group>\"; };\n\t\t13EF7F7E1BC825B1003F47DD /* RCTLocalAssetImageLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLocalAssetImageLoader.m; sourceTree = \"<group>\"; };\n\t\t143879371AAD32A300F088A5 /* RCTImageLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoader.m; sourceTree = \"<group>\"; };\n\t\t2D2A283A1D9B042B00D4039D /* libRCTImage-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libRCTImage-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t35123E6A1B59C99D00EBAD80 /* RCTImageStoreManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageStoreManager.m; sourceTree = \"<group>\"; };\n\t\t354631661B69857700AA0B86 /* RCTImageEditingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTImageEditingManager.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t354631671B69857700AA0B86 /* RCTImageEditingManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageEditingManager.m; sourceTree = \"<group>\"; };\n\t\t3D5FA63C1DE4B44A0058FD77 /* RCTImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageLoader.h; sourceTree = \"<group>\"; };\n\t\t3D5FA63D1DE4B44A0058FD77 /* RCTImageStoreManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageStoreManager.h; sourceTree = \"<group>\"; };\n\t\t3D5FA63E1DE4B44A0058FD77 /* RCTResizeMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTResizeMode.h; sourceTree = \"<group>\"; };\n\t\t3D5FA68C1DE4BA290058FD77 /* libRCTNetwork.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libRCTNetwork.a; path = \"../Network/build/Debug-iphoneos/libRCTNetwork.a\"; sourceTree = \"<group>\"; };\n\t\t58B5115D1A9E6B3D00147676 /* libRCTImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTImage.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t59AB09281EDE5DD1009F97B5 /* RCTImageShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageShadowView.h; sourceTree = \"<group>\"; };\n\t\t59AB09291EDE5DD1009F97B5 /* RCTImageShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageShadowView.m; sourceTree = \"<group>\"; };\n\t\tCCD34C251D4B8FE900268922 /* RCTImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTImageCache.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\tCCD34C261D4B8FE900268922 /* RCTImageCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageCache.m; sourceTree = \"<group>\"; };\n\t\tD4EED0481ECB1D6200916991 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };\n\t\tEEF314701C9B0DD30049118E /* RCTImageBlurUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTImageBlurUtils.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\tEEF314711C9B0DD30049118E /* RCTImageBlurUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageBlurUtils.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tD4EED0471ECB1D5C00916991 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t3D5FA68B1DE4BA290058FD77 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD4EED0481ECB1D6200916991 /* AppKit.framework */,\n\t\t\t\t3D5FA68C1DE4BA290058FD77 /* libRCTNetwork.a */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58B511541A9E6B3D00147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D5FA68B1DE4BA290058FD77 /* Frameworks */,\n\t\t\t\t58B5115E1A9E6B3D00147676 /* Products */,\n\t\t\t\t1304D5B01AA8C50D0002E2BE /* RCTGIFImageDecoder.h */,\n\t\t\t\t1304D5B11AA8C50D0002E2BE /* RCTGIFImageDecoder.m */,\n\t\t\t\tEEF314701C9B0DD30049118E /* RCTImageBlurUtils.h */,\n\t\t\t\tEEF314711C9B0DD30049118E /* RCTImageBlurUtils.m */,\n\t\t\t\tCCD34C251D4B8FE900268922 /* RCTImageCache.h */,\n\t\t\t\tCCD34C261D4B8FE900268922 /* RCTImageCache.m */,\n\t\t\t\t354631661B69857700AA0B86 /* RCTImageEditingManager.h */,\n\t\t\t\t354631671B69857700AA0B86 /* RCTImageEditingManager.m */,\n\t\t\t\t3D5FA63C1DE4B44A0058FD77 /* RCTImageLoader.h */,\n\t\t\t\t143879371AAD32A300F088A5 /* RCTImageLoader.m */,\n\t\t\t\t59AB09281EDE5DD1009F97B5 /* RCTImageShadowView.h */,\n\t\t\t\t59AB09291EDE5DD1009F97B5 /* RCTImageShadowView.m */,\n\t\t\t\t3D5FA63D1DE4B44A0058FD77 /* RCTImageStoreManager.h */,\n\t\t\t\t35123E6A1B59C99D00EBAD80 /* RCTImageStoreManager.m */,\n\t\t\t\t134B00A01B54232B00EC8DFB /* RCTImageUtils.h */,\n\t\t\t\t134B00A11B54232B00EC8DFB /* RCTImageUtils.m */,\n\t\t\t\t1304D5A71AA8C4A30002E2BE /* RCTImageView.h */,\n\t\t\t\t1304D5A81AA8C4A30002E2BE /* RCTImageView.m */,\n\t\t\t\t1304D5A91AA8C4A30002E2BE /* RCTImageViewManager.h */,\n\t\t\t\t1304D5AA1AA8C4A30002E2BE /* RCTImageViewManager.m */,\n\t\t\t\t13EF7F7D1BC825B1003F47DD /* RCTLocalAssetImageLoader.h */,\n\t\t\t\t13EF7F7E1BC825B1003F47DD /* RCTLocalAssetImageLoader.m */,\n\t\t\t\t3D5FA63E1DE4B44A0058FD77 /* RCTResizeMode.h */,\n\t\t\t\t139A38831C4D587C00862840 /* RCTResizeMode.m */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t58B5115E1A9E6B3D00147676 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t58B5115D1A9E6B3D00147676 /* libRCTImage.a */,\n\t\t\t\t2D2A283A1D9B042B00D4039D /* libRCTImage-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t3DED3A891DE6F78800336DD7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DED3A8A1DE6F79800336DD7 /* RCTGIFImageDecoder.h in Headers */,\n\t\t\t\t3DED3A901DE6F79800336DD7 /* RCTImageUtils.h in Headers */,\n\t\t\t\t3DED3A8B1DE6F79800336DD7 /* RCTImageBlurUtils.h in Headers */,\n\t\t\t\t3DED3A8C1DE6F79800336DD7 /* RCTImageCache.h in Headers */,\n\t\t\t\t3DED3A8D1DE6F79800336DD7 /* RCTImageEditingManager.h in Headers */,\n\t\t\t\t3DED3A8E1DE6F79800336DD7 /* RCTImageLoader.h in Headers */,\n\t\t\t\t3DED3A8F1DE6F79800336DD7 /* RCTImageStoreManager.h in Headers */,\n\t\t\t\t59AB092A1EDE5DD1009F97B5 /* RCTImageShadowView.h in Headers */,\n\t\t\t\t3DED3A911DE6F79800336DD7 /* RCTImageView.h in Headers */,\n\t\t\t\t3DED3A921DE6F79800336DD7 /* RCTImageViewManager.h in Headers */,\n\t\t\t\t3DED3A931DE6F79800336DD7 /* RCTLocalAssetImageLoader.h in Headers */,\n\t\t\t\t3DED3A941DE6F79800336DD7 /* RCTResizeMode.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3DED3A951DE6F79D00336DD7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DED3A961DE6F7A400336DD7 /* RCTGIFImageDecoder.h in Headers */,\n\t\t\t\t3DED3A971DE6F7A400336DD7 /* RCTImageBlurUtils.h in Headers */,\n\t\t\t\t3DED3A981DE6F7A400336DD7 /* RCTImageCache.h in Headers */,\n\t\t\t\t3DED3A991DE6F7A400336DD7 /* RCTImageEditingManager.h in Headers */,\n\t\t\t\t3DED3A9A1DE6F7A400336DD7 /* RCTImageLoader.h in Headers */,\n\t\t\t\t3DED3A9B1DE6F7A400336DD7 /* RCTImageStoreManager.h in Headers */,\n\t\t\t\t3DED3A9C1DE6F7A400336DD7 /* RCTImageUtils.h in Headers */,\n\t\t\t\t3DA05A5A1EE0312600805843 /* RCTImageShadowView.h in Headers */,\n\t\t\t\t3DED3A9D1DE6F7A400336DD7 /* RCTImageView.h in Headers */,\n\t\t\t\t3DED3A9E1DE6F7A400336DD7 /* RCTImageViewManager.h in Headers */,\n\t\t\t\t3DED3A9F1DE6F7A400336DD7 /* RCTLocalAssetImageLoader.h in Headers */,\n\t\t\t\t3DED3AA01DE6F7A400336DD7 /* RCTResizeMode.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t2D2A28391D9B042B00D4039D /* RCTImage-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D2A28421D9B042B00D4039D /* Build configuration list for PBXNativeTarget \"RCTImage-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3DED3A951DE6F79D00336DD7 /* Headers */,\n\t\t\t\t3D302F201DF8268700D6DDAE /* Copy Headers */,\n\t\t\t\t2D2A28361D9B042B00D4039D /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"RCTImage-tvOS\";\n\t\t\tproductName = \"RCTImage-tvOS\";\n\t\t\tproductReference = 2D2A283A1D9B042B00D4039D /* libRCTImage-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t58B5115C1A9E6B3D00147676 /* RCTImage */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511711A9E6B3D00147676 /* Build configuration list for PBXNativeTarget \"RCTImage\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3DED3A891DE6F78800336DD7 /* Headers */,\n\t\t\t\t3D302E171DF8225500D6DDAE /* Copy Headers */,\n\t\t\t\t58B511591A9E6B3D00147676 /* Sources */,\n\t\t\t\tD4EED0471ECB1D5C00916991 /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTImage;\n\t\t\tproductName = RCTNetworkImage;\n\t\t\tproductReference = 58B5115D1A9E6B3D00147676 /* libRCTImage.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511551A9E6B3D00147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0810;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t2D2A28391D9B042B00D4039D = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t58B5115C1A9E6B3D00147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511581A9E6B3D00147676 /* Build configuration list for PBXProject \"RCTImage\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511541A9E6B3D00147676;\n\t\t\tproductRefGroup = 58B5115E1A9E6B3D00147676 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B5115C1A9E6B3D00147676 /* RCTImage */,\n\t\t\t\t2D2A28391D9B042B00D4039D /* RCTImage-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t2D2A28361D9B042B00D4039D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D3B5F231D9B0D1300451313 /* RCTImageStoreManager.m in Sources */,\n\t\t\t\t2D3B5F1A1D9B0D0400451313 /* RCTImageCache.m in Sources */,\n\t\t\t\t2D3B5F1D1D9B0D1300451313 /* RCTLocalAssetImageLoader.m in Sources */,\n\t\t\t\t2D3B5F1F1D9B0D1300451313 /* RCTImageEditingManager.m in Sources */,\n\t\t\t\t2D3B5F1E1D9B0D1300451313 /* RCTGIFImageDecoder.m in Sources */,\n\t\t\t\t2D3B5F1C1D9B0D1300451313 /* RCTResizeMode.m in Sources */,\n\t\t\t\t2D3B5F221D9B0D1300451313 /* RCTImageViewManager.m in Sources */,\n\t\t\t\t2D3B5F211D9B0D1300451313 /* RCTImageView.m in Sources */,\n\t\t\t\t3DA05A5B1EE0312900805843 /* RCTImageShadowView.m in Sources */,\n\t\t\t\t2D3B5F201D9B0D1300451313 /* RCTImageLoader.m in Sources */,\n\t\t\t\t2D3B5F1B1D9B0D0700451313 /* RCTImageBlurUtils.m in Sources */,\n\t\t\t\t2D3B5F241D9B0D1300451313 /* RCTImageUtils.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t58B511591A9E6B3D00147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t35123E6B1B59C99D00EBAD80 /* RCTImageStoreManager.m in Sources */,\n\t\t\t\t1304D5AC1AA8C4A30002E2BE /* RCTImageViewManager.m in Sources */,\n\t\t\t\t1304D5B21AA8C50D0002E2BE /* RCTGIFImageDecoder.m in Sources */,\n\t\t\t\t143879381AAD32A300F088A5 /* RCTImageLoader.m in Sources */,\n\t\t\t\t354631681B69857700AA0B86 /* RCTImageEditingManager.m in Sources */,\n\t\t\t\t139A38841C4D587C00862840 /* RCTResizeMode.m in Sources */,\n\t\t\t\t1304D5AB1AA8C4A30002E2BE /* RCTImageView.m in Sources */,\n\t\t\t\tEEF314721C9B0DD30049118E /* RCTImageBlurUtils.m in Sources */,\n\t\t\t\t59AB092B1EDE5DD1009F97B5 /* RCTImageShadowView.m in Sources */,\n\t\t\t\t13EF7F7F1BC825B1003F47DD /* RCTLocalAssetImageLoader.m in Sources */,\n\t\t\t\t134B00A21B54232B00EC8DFB /* RCTImageUtils.m in Sources */,\n\t\t\t\tCCD34C271D4B8FE900268922 /* RCTImageCache.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t2D2A28401D9B042B00D4039D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/RCTImage;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D2A28411D9B042B00D4039D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/RCTImage;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B5116F1A9E6B3D00147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 7.0;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.10;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511701A9E6B3D00147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.10;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511721A9E6B3D00147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTImage;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/RCTImage;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511731A9E6B3D00147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTImage;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/RCTImage;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t2D2A28421D9B042B00D4039D /* Build configuration list for PBXNativeTarget \"RCTImage-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D2A28401D9B042B00D4039D /* Debug */,\n\t\t\t\t2D2A28411D9B042B00D4039D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511581A9E6B3D00147676 /* Build configuration list for PBXProject \"RCTImage\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B5116F1A9E6B3D00147676 /* Debug */,\n\t\t\t\t58B511701A9E6B3D00147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511711A9E6B3D00147676 /* Build configuration list for PBXNativeTarget \"RCTImage\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511721A9E6B3D00147676 /* Debug */,\n\t\t\t\t58B511731A9E6B3D00147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511551A9E6B3D00147676 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/Image/RCTImageBlurUtils.h",
    "content": "/*\n *  Copyright (c) 2013, Facebook, Inc.\n *  All rights reserved.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <Accelerate/Accelerate.h>\n#import <AppKit/AppKit.h>\n\n#import <React/RCTDefines.h>\n\nRCT_EXTERN NSImage *RCTBlurredImageWithRadius(NSImage *inputImage, CGFloat radius);\n"
  },
  {
    "path": "Libraries/Image/RCTImageBlurUtils.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/UIImageUtils.h>\n#import \"RCTImageBlurUtils.h\"\n#import \"RCTImageUtils.h\"\n\nNSImage *RCTBlurredImageWithRadius(NSImage *inputImage, CGFloat radius)\n{\n  CGImageRef imageRef = RCTGetCGImage(inputImage);\n\n  // Image must be nonzero size\n  if (CGImageGetWidth(imageRef) * CGImageGetHeight(imageRef) == 0) {\n    return inputImage;\n  }\n\n  //convert to ARGB if it isn't\n  if (CGImageGetBitsPerPixel(imageRef) != 32 ||\n      CGImageGetBitsPerComponent(imageRef) != 8 ||\n      !((CGImageGetBitmapInfo(imageRef) & kCGBitmapAlphaInfoMask))) {\n    UIGraphicsBeginImageContextWithOptions(inputImage.size, NO, 1.0f); //TODO: real scale\n    [inputImage drawInRect:NSMakeRect(0, 0, inputImage.size.width, inputImage.size.height)];\n    imageRef = RCTGetCGImage(UIGraphicsGetImageFromCurrentImageContext());\n    UIGraphicsEndImageContext();\n  }\n\n  vImage_Buffer buffer1, buffer2;\n  buffer1.width = buffer2.width = CGImageGetWidth(imageRef);\n  buffer1.height = buffer2.height = CGImageGetHeight(imageRef);\n  buffer1.rowBytes = buffer2.rowBytes = CGImageGetBytesPerRow(imageRef);\n  size_t bytes = buffer1.rowBytes * buffer1.height;\n  buffer1.data = malloc(bytes);\n  buffer2.data = malloc(bytes);\n\n  // A description of how to compute the box kernel width from the Gaussian\n  // radius (aka standard deviation) appears in the SVG spec:\n  // http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement\n  uint32_t boxSize = floor((radius * 1 * 3 * sqrt(2 * M_PI) / 4 + 0.5) / 2);\n  boxSize |= 1; // Ensure boxSize is odd\n\n  //create temp buffer\n  void *tempBuffer = malloc((size_t)vImageBoxConvolve_ARGB8888(&buffer1, &buffer2, NULL, 0, 0, boxSize, boxSize,\n                                                               NULL, kvImageEdgeExtend + kvImageGetTempBufferSize));\n\n  //copy image data\n  CFDataRef dataSource = CGDataProviderCopyData(CGImageGetDataProvider(imageRef));\n  memcpy(buffer1.data, CFDataGetBytePtr(dataSource), bytes);\n  CFRelease(dataSource);\n\n  //perform blur\n  vImageBoxConvolve_ARGB8888(&buffer1, &buffer2, tempBuffer, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend);\n  vImageBoxConvolve_ARGB8888(&buffer2, &buffer1, tempBuffer, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend);\n  vImageBoxConvolve_ARGB8888(&buffer1, &buffer2, tempBuffer, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend);\n\n  //free buffers\n  free(buffer2.data);\n  free(tempBuffer);\n\n  //create image context from buffer\n  CGContextRef ctx = CGBitmapContextCreate(buffer1.data, buffer1.width, buffer1.height,\n                                           8, buffer1.rowBytes, CGImageGetColorSpace(imageRef),\n                                           CGImageGetBitmapInfo(imageRef));\n\n  //create image from context\n  imageRef = CGBitmapContextCreateImage(ctx);\n  NSImage *outputImage = [[NSImage alloc] initWithCGImage:imageRef size:inputImage.size];\n  CGImageRelease(imageRef);\n  CGContextRelease(ctx);\n  free(buffer1.data);\n  return outputImage;\n}\n"
  },
  {
    "path": "Libraries/Image/RCTImageCache.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTImageLoader.h>\n\n@interface RCTImageCache : NSObject <RCTImageCache>\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageCache.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTImageCache.h\"\n\n#import <objc/runtime.h>\n\n#import <ImageIO/ImageIO.h>\n\n#import <React/RCTConvert.h>\n#import <React/RCTNetworking.h>\n#import <React/RCTUtils.h>\n\n#import \"RCTImageUtils.h\"\n\nstatic const NSUInteger RCTMaxCachableDecodedImageSizeInBytes = 1048576; // 1MB\n\nstatic NSString *RCTCacheKeyForImage(NSString *imageTag, CGSize size, CGFloat scale,\n                                     RCTResizeMode resizeMode, NSString *responseDate)\n{\n    return [NSString stringWithFormat:@\"%@|%g|%g|%g|%lld|%@\",\n            imageTag, size.width, size.height, scale, (long long)resizeMode, responseDate];\n}\n\n@implementation RCTImageCache\n{\n  NSOperationQueue *_imageDecodeQueue;\n  NSCache *_decodedImageCache;\n}\n\n- (instancetype)init\n{\n  _decodedImageCache = [NSCache new];\n  _decodedImageCache.totalCostLimit = 5 * 1024 * 1024; // 5MB\n\n  return self;\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (void)clearCache\n{\n  [_decodedImageCache removeAllObjects];\n}\n\n- (void)addImageToCache:(NSImage *)image\n                 forKey:(NSString *)cacheKey\n{\n  if (!image) {\n    return;\n  }\n  CGFloat bytes = image.size.width * image.size.height * 1.0f * 4;\n  if (bytes <= RCTMaxCachableDecodedImageSizeInBytes) {\n    [self->_decodedImageCache setObject:image\n                                 forKey:cacheKey\n                                   cost:bytes];\n  }\n}\n\n- (NSImage *)imageForUrl:(NSString *)url\n                    size:(CGSize)size\n                   scale:(CGFloat)scale\n              resizeMode:(RCTResizeMode)resizeMode\n            responseDate:(NSString *)responseDate\n{\n  NSString *cacheKey = RCTCacheKeyForImage(url, size, scale, resizeMode, responseDate);\n  return [_decodedImageCache objectForKey:cacheKey];\n}\n\n- (void)addImageToCache:(NSImage *)image\n                    URL:(NSString *)url\n                   size:(CGSize)size\n                  scale:(CGFloat)scale\n             resizeMode:(RCTResizeMode)resizeMode\n           responseDate:(NSString *)responseDate\n{\n  NSString *cacheKey = RCTCacheKeyForImage(url, size, scale, resizeMode, responseDate);\n  return [self addImageToCache:image forKey:cacheKey];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageEditingManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridgeModule.h>\n\n@interface RCTImageEditingManager : NSObject <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageEditingManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTImageEditingManager.h\"\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTConvert.h>\n#import <React/RCTLog.h>\n#import <React/RCTUtils.h>\n#import <React/UIImageUtils.h>\n\n#import \"RCTImageLoader.h\"\n#import \"RCTImageStoreManager.h\"\n#import \"RCTImageUtils.h\"\n\n@implementation RCTImageEditingManager\n\nRCT_EXPORT_MODULE()\n\n@synthesize bridge = _bridge;\n\n/**\n * Crops an image and adds the result to the image store.\n *\n * @param imageRequest An image URL\n * @param cropData Dictionary with `offset`, `size` and `displaySize`.\n *        `offset` and `size` are relative to the full-resolution image size.\n *        `displaySize` is an optimization - if specified, the image will\n *        be scaled down to `displaySize` rather than `size`.\n *        All units are in px (not points).\n */\n\n//RCT_EXPORT_METHOD(cropImage:(NSString *)imageTag\n//                  cropData:(NSDictionary *)cropData\n//                  successCallback:(RCTResponseSenderBlock)successCallback\n//                  errorCallback:(RCTResponseErrorBlock)errorCallback)\n//{\n//  NSDictionary *offset = cropData[@\"offset\"];\n//  NSDictionary *size = cropData[@\"size\"];\n//  NSDictionary *displaySize = cropData[@\"displaySize\"];\n//  NSString *resizeMode = cropData[@\"resizeMode\"] ?: @\"contain\";\n//\n//  if (!offset[@\"x\"] || !offset[@\"y\"] || !size[@\"width\"] || !size[@\"height\"]) {\n//    NSString *errorMessage = [NSString stringWithFormat:@\"Invalid cropData: %@\", cropData];\n//    RCTLogError(@\"%@\", errorMessage);\n//    errorCallback(RCTErrorWithMessage(errorMessage));\n//    return;\n//  }\n//\n//  [_bridge.imageLoader loadImageWithTag:imageTag callback:^(NSError *error, UIImage *image) {\n//    if (error) {\n//      errorCallback(error);\n//      return;\n//    }\n//    CGRect rect = (CGRect){\n//      [RCTConvert CGPoint:offset],\n//      [RCTConvert CGSize:size]\n//    };\n//\n//    // Crop image\n//    CGRect rectToDrawIn = {{-rect.origin.x, -rect.origin.y}, image.size};\n//    UIGraphicsBeginImageContextWithOptions(rect.size, !RCTImageHasAlpha(image.CGImage), image.scale);\n//    [image drawInRect:rectToDrawIn];\n//    UIImage *croppedImage = UIGraphicsGetImageFromCurrentImageContext();\n//    UIGraphicsEndImageContext();\n//\n//    if (displaySize && displaySize[@\"width\"] && displaySize[@\"height\"]) {\n//      CGSize targetSize = [RCTConvert CGSize:displaySize];\n//      croppedImage = [self scaleImage:croppedImage targetSize:targetSize resizeMode:resizeMode];\n//    }\n//\n//    [_bridge.imageStoreManager storeImage:croppedImage withBlock:^(NSString *croppedImageTag) {\n//      if (!croppedImageTag) {\n//        NSString *errorMessage = @\"Error storing cropped image in RCTImageStoreManager\";\n//        RCTLogWarn(@\"%@\", errorMessage);\n//        errorCallback(RCTErrorWithMessage(errorMessage));\n//        return;\n//      }\n//      successCallback(@[croppedImageTag]);\n//    }];\n//  }];\n//}\n\n- (NSImage *)scaleImage:(NSImage *)image targetSize:(CGSize)targetSize resizeMode:(NSString *)resizeMode\n{\n  if (CGSizeEqualToSize(image.size, targetSize)) {\n    return image;\n  }\n\n  CGFloat imageRatio = image.size.width / image.size.height;\n  CGFloat targetRatio = targetSize.width / targetSize.height;\n\n  CGFloat newWidth = targetSize.width;\n  CGFloat newHeight = targetSize.height;\n\n  // contain vs cover\n  // http://blog.vjeux.com/2013/image/css-container-and-cover.html\n  if ([resizeMode isEqualToString:@\"contain\"]) {\n    if (imageRatio <= targetRatio) {\n      newWidth = targetSize.height * imageRatio;\n      newHeight = targetSize.height;\n    } else {\n      newWidth = targetSize.width;\n      newHeight = targetSize.width / imageRatio;\n    }\n  } else if ([resizeMode isEqualToString:@\"cover\"]) {\n    if (imageRatio <= targetRatio) {\n      newWidth = targetSize.width;\n      newHeight = targetSize.width / imageRatio;\n    } else {\n      newWidth = targetSize.height * imageRatio;\n      newHeight = targetSize.height;\n    }\n  } // else assume we're stretching the image\n\n  // prevent upscaling\n  newWidth = MIN(newWidth, image.size.width);\n  newHeight = MIN(newHeight, image.size.height);\n\n  // perform the scaling @1x because targetSize is in actual pixel width/height\n  UIGraphicsBeginImageContextWithOptions(targetSize, NO, 1.0f);\n  [image drawInRect:CGRectMake(0.f, 0.f, newWidth, newHeight)];\n  NSImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext();\n  UIGraphicsEndImageContext();\n\n  return scaledImage;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageLoader.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n#import <QuartzCore/CAAnimation.h>\n\n#import <React/RCTBridge.h>\n#import <React/RCTResizeMode.h>\n#import <React/RCTURLRequestHandler.h>\n#import \"React/UIImageUtils.h\"\n\ntypedef void (^RCTImageLoaderProgressBlock)(int64_t progress, int64_t total);\ntypedef void (^RCTImageLoaderPartialLoadBlock)(NSImage *image);\ntypedef void (^RCTImageLoaderCompletionBlock)(NSError *error, NSImage *image);\n\ntypedef dispatch_block_t RCTImageLoaderCancellationBlock;\n\n/**\n * Provides an interface to use for providing a image caching strategy.\n */\n@protocol RCTImageCache <NSObject>\n\n- (NSImage *)imageForUrl:(NSString *)url\n                    size:(CGSize)size\n                   scale:(CGFloat)scale\n              resizeMode:(RCTResizeMode)resizeMode\n            responseDate:(NSString *)responseDate;\n\n- (void)addImageToCache:(NSImage *)image\n                    URL:(NSString *)url\n                   size:(CGSize)size\n                  scale:(CGFloat)scale\n             resizeMode:(RCTResizeMode)resizeMode\n           responseDate:(NSString *)responseDate;\n\n@end\n\n/**\n * If available, RCTImageRedirectProtocol is invoked before loading an asset.\n * Implementation should return either a new URL or nil when redirection is\n * not needed.\n */\n\n@protocol RCTImageRedirectProtocol\n\n- (NSURL *)redirectAssetsURL:(NSURL *)URL;\n\n@end\n\n@interface NSImage (React)\n\n@property (nonatomic, copy) CAKeyframeAnimation *reactKeyframeAnimation;\n\n@end\n\n@interface RCTImageLoader : NSObject <RCTBridgeModule, RCTURLRequestHandler>\n\n/**\n * The maximum number of concurrent image loading tasks. Loading and decoding\n * images can consume a lot of memory, so setting this to a higher value may\n * cause memory to spike. If you are seeing out-of-memory crashes, try reducing\n * this value.\n */\n@property (nonatomic, assign) NSUInteger maxConcurrentLoadingTasks;\n\n/**\n * The maximum number of concurrent image decoding tasks. Decoding large\n * images can be especially CPU and memory intensive, so if your are decoding a\n * lot of large images in your app, you may wish to adjust this value.\n */\n@property (nonatomic, assign) NSUInteger maxConcurrentDecodingTasks;\n\n/**\n * Decoding large images can use a lot of memory, and potentially cause the app\n * to crash. This value allows you to throttle the amount of memory used by the\n * decoder independently of the number of concurrent threads. This means you can\n * still decode a lot of small images in parallel, without allowing the decoder\n * to try to decompress multiple huge images at once. Note that this value is\n * only a hint, and not an indicator of the total memory used by the app.\n */\n@property (nonatomic, assign) NSUInteger maxConcurrentDecodingBytes;\n\n- (instancetype)init;\n- (instancetype)initWithRedirectDelegate:(id<RCTImageRedirectProtocol>)redirectDelegate NS_DESIGNATED_INITIALIZER;\n\n/**\n * Loads the specified image at the highest available resolution.\n * Can be called from any thread, will call back on an unspecified thread.\n */\n- (RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest\n                                                  callback:(RCTImageLoaderCompletionBlock)callback;\n\n/**\n * As above, but includes target `size`, `scale` and `resizeMode`, which are used to\n * select the optimal dimensions for the loaded image. The `clipped` option\n * controls whether the image will be clipped to fit the specified size exactly,\n * or if the original aspect ratio should be retained.\n * `partialLoadBlock` is meant for custom image loaders that do not ship with the core RN library.\n * It is meant to be called repeatedly while loading the image as higher quality versions are decoded,\n * for instance with progressive JPEGs.\n */\n- (RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest\n                                                      size:(CGSize)size\n                                                     scale:(CGFloat)scale\n                                                   clipped:(BOOL)clipped\n                                                resizeMode:(RCTResizeMode)resizeMode\n                                             progressBlock:(RCTImageLoaderProgressBlock)progressBlock\n                                          partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadBlock\n                                           completionBlock:(RCTImageLoaderCompletionBlock)completionBlock;\n\n/**\n * Finds an appropriate image decoder and passes the target `size`, `scale` and\n * `resizeMode` for optimal image decoding.  The `clipped` option controls\n * whether the image will be clipped to fit the specified size exactly, or\n * if the original aspect ratio should be retained. Can be called from any\n * thread, will call callback on an unspecified thread.\n */\n- (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData\n                                              size:(CGSize)size\n                                             scale:(CGFloat)scale\n                                           clipped:(BOOL)clipped\n                                        resizeMode:(RCTResizeMode)resizeMode\n                                   completionBlock:(RCTImageLoaderCompletionBlock)completionBlock;\n\n/**\n * Get image size, in pixels. This method will do the least work possible to get\n * the information, and won't decode the image if it doesn't have to.\n */\n- (RCTImageLoaderCancellationBlock)getImageSizeForURLRequest:(NSURLRequest *)imageURLRequest\n                                                       block:(void(^)(NSError *error, CGSize size))completionBlock;\n\n@end\n\n@interface RCTBridge (RCTImageLoader)\n\n/**\n * The shared image loader instance\n */\n@property (nonatomic, readonly) RCTImageLoader *imageLoader;\n\n@end\n\n/**\n * Provides the interface needed to register an image loader. Image data\n * loaders are also bridge modules, so should be registered using\n * RCT_EXPORT_MODULE().\n */\n@protocol RCTImageURLLoader <RCTBridgeModule>\n\n/**\n * Indicates whether this data loader is capable of processing the specified\n * request URL. Typically the handler would examine the scheme/protocol of the\n * URL to determine this.\n */\n- (BOOL)canLoadImageURL:(NSURL *)requestURL;\n\n/**\n * Send a network request to load the request URL. The method should call the\n * progressHandler (if applicable) and the completionHandler when the request\n * has finished. The method should also return a cancellation block, if\n * applicable.\n */\n- (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL\n                                              size:(CGSize)size\n                                             scale:(CGFloat)scale\n                                        resizeMode:(RCTResizeMode)resizeMode\n                                   progressHandler:(RCTImageLoaderProgressBlock)progressHandler\n                                partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler\n                                 completionHandler:(RCTImageLoaderCompletionBlock)completionHandler;\n\n@optional\n\n/**\n * If more than one RCTImageURLLoader responds YES to `-canLoadImageURL:`\n * then `loaderPriority` is used to determine which one to use. The loader\n * with the highest priority will be selected. Default priority is zero. If\n * two or more valid loaders have the same priority, the selection order is\n * undefined.\n */\n- (float)loaderPriority;\n\n/**\n * If the loader must be called on the serial url cache queue, and whether the completion\n * block should be dispatched off the main thread. If this is NO, the loader will be\n * called from the main queue. Defaults to YES.\n *\n * Use with care: disabling scheduling will reduce RCTImageLoader's ability to throttle\n * network requests.\n */\n- (BOOL)requiresScheduling;\n\n/**\n * If images loaded by the loader should be cached in the decoded image cache.\n * Defaults to YES.\n */\n- (BOOL)shouldCacheLoadedImages;\n\n@end\n\n/**\n * Provides the interface needed to register an image decoder. Image decoders\n * are also bridge modules, so should be registered using RCT_EXPORT_MODULE().\n */\n@protocol RCTImageDataDecoder <RCTBridgeModule>\n\n/**\n * Indicates whether this handler is capable of decoding the specified data.\n * Typically the handler would examine some sort of header data to determine\n * this.\n */\n- (BOOL)canDecodeImageData:(NSData *)imageData;\n\n/**\n * Decode an image from the data object. The method should call the\n * completionHandler when the decoding operation  has finished. The method\n * should also return a cancellation block, if applicable.\n *\n * If you provide a custom image decoder, you most implement scheduling yourself,\n * to avoid decoding large amounts of images at the same time.\n */\n- (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData\n                                              size:(CGSize)size\n                                             scale:(CGFloat)scale\n                                        resizeMode:(RCTResizeMode)resizeMode\n                                 completionHandler:(RCTImageLoaderCompletionBlock)completionHandler;\n\n@optional\n\n/**\n * If more than one RCTImageDataDecoder responds YES to `-canDecodeImageData:`\n * then `decoderPriority` is used to determine which one to use. The decoder\n * with the highest priority will be selected. Default priority is zero.\n * If two or more valid decoders have the same priority, the selection order is\n * undefined.\n */\n- (float)decoderPriority;\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageLoader.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n#import <libkern/OSAtomic.h>\n#import <stdatomic.h>\n#import <objc/runtime.h>\n\n#import <ImageIO/ImageIO.h>\n\n#import <React/RCTConvert.h>\n#import <React/RCTDefines.h>\n#import <React/RCTImageLoader.h>\n#import <React/RCTLog.h>\n#import <React/RCTNetworking.h>\n#import <React/RCTUtils.h>\n\n#import \"RCTImageCache.h\"\n#import \"RCTImageUtils.h\"\n\n@implementation NSImage (React)\n\n- (CAKeyframeAnimation *)reactKeyframeAnimation\n{\n    return objc_getAssociatedObject(self, _cmd);\n}\n\n- (void)setReactKeyframeAnimation:(CAKeyframeAnimation *)reactKeyframeAnimation\n{\n    objc_setAssociatedObject(self, @selector(reactKeyframeAnimation), reactKeyframeAnimation, OBJC_ASSOCIATION_COPY_NONATOMIC);\n}\n\n@end\n\n@implementation RCTImageLoader\n{\n    NSArray<id<RCTImageURLLoader>> *_loaders;\n    NSArray<id<RCTImageDataDecoder>> *_decoders;\n    NSOperationQueue *_imageDecodeQueue;\n    dispatch_queue_t _URLRequestQueue;\n    id<RCTImageCache> _imageCache;\n    NSMutableArray *_pendingTasks;\n    NSInteger _activeTasks;\n    NSMutableArray *_pendingDecodes;\n    NSInteger _scheduledDecodes;\n    NSUInteger _activeBytes;\n  __weak id<RCTImageRedirectProtocol> _redirectDelegate;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n- (instancetype)init\n{\n  return [self initWithRedirectDelegate:nil];\n}\n\n- (instancetype)initWithRedirectDelegate:(id<RCTImageRedirectProtocol>)redirectDelegate\n{\n    if (self = [super init]) {\n        _redirectDelegate = redirectDelegate;\n    }\n    return self;\n}\n\n- (void)setUp\n{\n    // Set defaults\n    _maxConcurrentLoadingTasks = _maxConcurrentLoadingTasks ?: 4;\n    _maxConcurrentDecodingTasks = _maxConcurrentDecodingTasks ?: 2;\n    _maxConcurrentDecodingBytes = _maxConcurrentDecodingBytes ?: 30 * 1024 * 1024; // 30MB\n\n    _URLRequestQueue = dispatch_queue_create(\"com.facebook.react.ImageLoaderURLRequestQueue\", DISPATCH_QUEUE_SERIAL);\n}\n\n- (float)handlerPriority\n{\n    return 2;\n}\n\n- (id<RCTImageCache>)imageCache\n{\n    if (!_imageCache) {\n        //set up with default cache\n        _imageCache = [RCTImageCache new];\n    }\n    return _imageCache;\n}\n\n- (void)setImageCache:(id<RCTImageCache>)cache\n{\n    if (_imageCache) {\n        RCTLogWarn(@\"RCTImageCache was already set and has now been overriden.\");\n    }\n    _imageCache = cache;\n}\n\n- (id<RCTImageURLLoader>)imageURLLoaderForURL:(NSURL *)URL\n{\n    if (!_maxConcurrentLoadingTasks) {\n        [self setUp];\n    }\n\n    if (!_loaders) {\n        // Get loaders, sorted in reverse priority order (highest priority first)\n        RCTAssert(_bridge, @\"Bridge not set\");\n        _loaders = [[_bridge modulesConformingToProtocol:@protocol(RCTImageURLLoader)] sortedArrayUsingComparator:^NSComparisonResult(id<RCTImageURLLoader> a, id<RCTImageURLLoader> b) {\n            float priorityA = [a respondsToSelector:@selector(loaderPriority)] ? [a loaderPriority] : 0;\n            float priorityB = [b respondsToSelector:@selector(loaderPriority)] ? [b loaderPriority] : 0;\n            if (priorityA > priorityB) {\n                return NSOrderedAscending;\n            } else if (priorityA < priorityB) {\n                return NSOrderedDescending;\n            } else {\n                return NSOrderedSame;\n            }\n        }];\n    }\n\n    if (RCT_DEBUG) {\n        // Check for handler conflicts\n        float previousPriority = 0;\n        id<RCTImageURLLoader> previousLoader = nil;\n        for (id<RCTImageURLLoader> loader in _loaders) {\n            float priority = [loader respondsToSelector:@selector(loaderPriority)] ? [loader loaderPriority] : 0;\n            if (previousLoader && priority < previousPriority) {\n                return previousLoader;\n            }\n            if ([loader canLoadImageURL:URL]) {\n                if (previousLoader) {\n                    if (priority == previousPriority) {\n                        RCTLogError(@\"The RCTImageURLLoaders %@ and %@ both reported that\"\n                                    \" they can load the URL %@, and have equal priority\"\n                                    \" (%g). This could result in non-deterministic behavior.\",\n                                    loader, previousLoader, URL, priority);\n                    }\n                } else {\n                    previousLoader = loader;\n                    previousPriority = priority;\n                }\n            }\n        }\n        return previousLoader;\n    }\n\n    // Normal code path\n    for (id<RCTImageURLLoader> loader in _loaders) {\n        if ([loader canLoadImageURL:URL]) {\n            return loader;\n        }\n    }\n    return nil;\n}\n\n- (id<RCTImageDataDecoder>)imageDataDecoderForData:(NSData *)data\n{\n    if (!_maxConcurrentLoadingTasks) {\n        [self setUp];\n    }\n\n    if (!_decoders) {\n        // Get decoders, sorted in reverse priority order (highest priority first)\n        RCTAssert(_bridge, @\"Bridge not set\");\n        _decoders = [[_bridge modulesConformingToProtocol:@protocol(RCTImageDataDecoder)] sortedArrayUsingComparator:^NSComparisonResult(id<RCTImageDataDecoder> a, id<RCTImageDataDecoder> b) {\n            float priorityA = [a respondsToSelector:@selector(decoderPriority)] ? [a decoderPriority] : 0;\n            float priorityB = [b respondsToSelector:@selector(decoderPriority)] ? [b decoderPriority] : 0;\n            if (priorityA > priorityB) {\n                return NSOrderedAscending;\n            } else if (priorityA < priorityB) {\n                return NSOrderedDescending;\n            } else {\n                return NSOrderedSame;\n            }\n        }];\n    }\n\n    if (RCT_DEBUG) {\n        // Check for handler conflicts\n        float previousPriority = 0;\n        id<RCTImageDataDecoder> previousDecoder = nil;\n        for (id<RCTImageDataDecoder> decoder in _decoders) {\n            float priority = [decoder respondsToSelector:@selector(decoderPriority)] ? [decoder decoderPriority] : 0;\n            if (previousDecoder && priority < previousPriority) {\n                return previousDecoder;\n            }\n            if ([decoder canDecodeImageData:data]) {\n                if (previousDecoder) {\n                    if (priority == previousPriority) {\n                        RCTLogError(@\"The RCTImageDataDecoders %@ and %@ both reported that\"\n                                    \" they can decode the data <NSData %p; %tu bytes>, and\"\n                                    \" have equal priority (%g). This could result in\"\n                                    \" non-deterministic behavior.\",\n                                    decoder, previousDecoder, data, data.length, priority);\n                    }\n                } else {\n                    previousDecoder = decoder;\n                    previousPriority = priority;\n                }\n            }\n        }\n        return previousDecoder;\n    }\n\n    // Normal code path\n    for (id<RCTImageDataDecoder> decoder in _decoders) {\n        if ([decoder canDecodeImageData:data]) {\n            return decoder;\n        }\n    }\n    return nil;\n}\n\nstatic NSImage *RCTResizeImageIfNeeded(NSImage *image,\n                                       CGSize size,\n                                       CGFloat scale,\n                                       RCTResizeMode resizeMode)\n{\n    if (CGSizeEqualToSize(size, CGSizeZero) ||\n        CGSizeEqualToSize(image.size, CGSizeZero) ||\n        CGSizeEqualToSize(image.size, size)) {\n        return image;\n    }\n    CAKeyframeAnimation *animation = image.reactKeyframeAnimation;\n    CGRect targetSize = RCTTargetRect(image.size, size, scale, resizeMode);\n    CGAffineTransform transform = RCTTransformFromTargetRect(image.size, targetSize);\n    image = RCTTransformImage(image, size, scale, transform);\n    image.reactKeyframeAnimation = animation;\n    return image;\n}\n\n- (RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest\n                                                  callback:(RCTImageLoaderCompletionBlock)callback\n{\n    return [self loadImageWithURLRequest:imageURLRequest\n                                    size:CGSizeZero\n                                   scale:1\n                                 clipped:YES\n                              resizeMode:RCTResizeModeStretch\n                           progressBlock:nil\n                        partialLoadBlock:nil\n                         completionBlock:callback];\n}\n\n- (void)dequeueTasks\n{\n    dispatch_async(_URLRequestQueue, ^{\n        // Remove completed tasks\n        NSMutableArray *tasksToRemove = nil;\n        for (RCTNetworkTask *task in self->_pendingTasks.reverseObjectEnumerator) {\n            switch (task.status) {\n                case RCTNetworkTaskFinished:\n                    if (!tasksToRemove) {\n                        tasksToRemove = [NSMutableArray new];\n                    }\n                    [tasksToRemove addObject:task];\n                    self->_activeTasks--;\n                    break;\n                case RCTNetworkTaskPending:\n                    break;\n                case RCTNetworkTaskInProgress:\n                    // Check task isn't \"stuck\"\n                    if (task.requestToken == nil) {\n                        RCTLogWarn(@\"Task orphaned for request %@\", task.request);\n                        if (!tasksToRemove) {\n                            tasksToRemove = [NSMutableArray new];\n                        }\n                        [tasksToRemove addObject:task];\n                        self->_activeTasks--;\n                        [task cancel];\n                    }\n                    break;\n            }\n        }\n\n        if (tasksToRemove) {\n            [self->_pendingTasks removeObjectsInArray:tasksToRemove];\n        }\n\n        // Start queued decode\n        NSInteger activeDecodes = self->_scheduledDecodes - self->_pendingDecodes.count;\n        while (activeDecodes == 0 || (self->_activeBytes <= self->_maxConcurrentDecodingBytes &&\n                                      activeDecodes <= self->_maxConcurrentDecodingTasks)) {\n            dispatch_block_t decodeBlock = self->_pendingDecodes.firstObject;\n            if (decodeBlock) {\n                [self->_pendingDecodes removeObjectAtIndex:0];\n                decodeBlock();\n            } else {\n                break;\n            }\n        }\n\n        // Start queued tasks\n        for (RCTNetworkTask *task in self->_pendingTasks) {\n            if (MAX(self->_activeTasks, self->_scheduledDecodes) >= self->_maxConcurrentLoadingTasks) {\n                break;\n            }\n            if (task.status == RCTNetworkTaskPending) {\n                [task start];\n                self->_activeTasks++;\n            }\n        }\n    });\n}\n\n/**\n * This returns either an image, or raw image data, depending on the loading\n * path taken. This is useful if you want to skip decoding, e.g. when preloading\n * the image, or retrieving metadata.\n */\n- (RCTImageLoaderCancellationBlock)_loadImageOrDataWithURLRequest:(NSURLRequest *)request\n                                                             size:(CGSize)size\n                                                            scale:(CGFloat)scale\n                                                       resizeMode:(RCTResizeMode)resizeMode\n                                                    progressBlock:(RCTImageLoaderProgressBlock)progressHandler\n                                                 partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadHandler\n                                                  completionBlock:(void (^)(NSError *error, id imageOrData, BOOL cacheResult, NSString *fetchDate))completionBlock\n{\n    {\n        NSMutableURLRequest *mutableRequest = [request mutableCopy];\n        [NSURLProtocol setProperty:@\"RCTImageLoader\"\n                            forKey:@\"trackingName\"\n                         inRequest:mutableRequest];\n\n        // Add missing png extension\n        if (request.URL.fileURL && request.URL.pathExtension.length == 0) {\n            mutableRequest.URL = [request.URL URLByAppendingPathExtension:@\"png\"];\n        }\n        if (_redirectDelegate != nil) {\n            mutableRequest.URL = [_redirectDelegate redirectAssetsURL:mutableRequest.URL];\n        }\n        request = mutableRequest;\n    }\n\n    // Find suitable image URL loader\n    id<RCTImageURLLoader> loadHandler = [self imageURLLoaderForURL:request.URL];\n    BOOL requiresScheduling = [loadHandler respondsToSelector:@selector(requiresScheduling)] ?\n    [loadHandler requiresScheduling] : YES;\n\n    __block atomic_bool cancelled = ATOMIC_VAR_INIT(NO);\n    // TODO: Protect this variable shared between threads.\n    __block dispatch_block_t cancelLoad = nil;\n    void (^completionHandler)(NSError *, id, NSString *) = ^(NSError *error, id imageOrData, NSString *fetchDate) {\n        cancelLoad = nil;\n\n        BOOL cacheResult = [loadHandler respondsToSelector:@selector(shouldCacheLoadedImages)] ?\n        [loadHandler shouldCacheLoadedImages] : YES;\n\n        // If we've received an image, we should try to set it synchronously,\n        // if it's data, do decoding on a background thread.\n        if (RCTIsMainQueue() && ![imageOrData isKindOfClass:[NSImage class]]) {\n            // Most loaders do not return on the main thread, so caller is probably not\n            // expecting it, and may do expensive post-processing in the callback\n            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n                if (!atomic_load(&cancelled)) {\n                    completionBlock(error, imageOrData, cacheResult, fetchDate);\n                }\n            });\n        } else if (!atomic_load(&cancelled)) {\n            completionBlock(error, imageOrData, cacheResult, fetchDate);\n        }\n    };\n\n    // If the loader doesn't require scheduling we call it directly on\n    // the main queue.\n    if (loadHandler && !requiresScheduling) {\n        return [loadHandler loadImageForURL:request.URL\n                                       size:size\n                                      scale:scale\n                                 resizeMode:resizeMode\n                            progressHandler:progressHandler\n                         partialLoadHandler:partialLoadHandler\n                          completionHandler:^(NSError *error, NSImage *image){\n                              completionHandler(error, image, nil);\n                          }];\n    }\n\n    // All access to URL cache must be serialized\n    if (!_URLRequestQueue) {\n        [self setUp];\n    }\n\n    __weak RCTImageLoader *weakSelf = self;\n    dispatch_async(_URLRequestQueue, ^{\n        __typeof(self) strongSelf = weakSelf;\n        if (atomic_load(&cancelled) || !strongSelf) {\n            return;\n        }\n\n        if (loadHandler) {\n            cancelLoad = [loadHandler loadImageForURL:request.URL\n                                                 size:size\n                                                scale:scale\n                                           resizeMode:resizeMode\n                                      progressHandler:progressHandler\n                                   partialLoadHandler:partialLoadHandler\n                                    completionHandler:^(NSError *error, NSImage *image) {\n                                        completionHandler(error, image, nil);\n                                    }];\n        } else {\n            // Use networking module to load image\n            cancelLoad = [strongSelf _loadURLRequest:request\n                                       progressBlock:progressHandler\n                                     completionBlock:completionHandler];\n        }\n    });\n\n    return ^{\n        BOOL alreadyCancelled = atomic_fetch_or(&cancelled, 1);\n        if (alreadyCancelled) {\n            return;\n        }\n        dispatch_block_t cancelLoadLocal = cancelLoad;\n        cancelLoad = nil;\n        if (cancelLoadLocal) {\n            cancelLoadLocal();\n        }\n    };\n}\n\n- (RCTImageLoaderCancellationBlock)_loadURLRequest:(NSURLRequest *)request\nprogressBlock:(RCTImageLoaderProgressBlock)progressHandler\ncompletionBlock:(void (^)(NSError *error, id imageOrData, NSString *fetchDate))completionHandler\n{\n    // Check if networking module is available\n    if (RCT_DEBUG && ![_bridge respondsToSelector:@selector(networking)]) {\n        RCTLogError(@\"No suitable image URL loader found for %@. You may need to \"\n                    \" import the RCTNetwork library in order to load images.\",\n                    request.URL.absoluteString);\n        return NULL;\n    }\n\n    RCTNetworking *networking = [_bridge networking];\n\n    // Check if networking module can load image\n    if (RCT_DEBUG && ![networking canHandleRequest:request]) {\n        RCTLogError(@\"No suitable image URL loader found for %@\", request.URL.absoluteString);\n        return NULL;\n    }\n\n    // Use networking module to load image\n    RCTURLRequestCompletionBlock processResponse = ^(NSURLResponse *response, NSData *data, NSError *error) {\n        // Check for system errors\n        if (error) {\n            completionHandler(error, nil, nil);\n            return;\n        } else if (!response) {\n            completionHandler(RCTErrorWithMessage(@\"Response metadata error\"), nil, nil);\n            return;\n        } else if (!data) {\n            completionHandler(RCTErrorWithMessage(@\"Unknown image download error\"), nil, nil);\n            return;\n        }\n\n        // Check for http errors\n        NSString *responseDate;\n        if ([response isKindOfClass:[NSHTTPURLResponse class]]) {\n            NSInteger statusCode = ((NSHTTPURLResponse *)response).statusCode;\n            if (statusCode != 200) {\n                NSString *errorMessage = [NSString stringWithFormat:@\"Failed to load %@\", response.URL];\n                NSDictionary *userInfo = @{NSLocalizedDescriptionKey: errorMessage};\n                completionHandler([[NSError alloc] initWithDomain:NSURLErrorDomain\n                                                             code:statusCode\n                                                         userInfo:userInfo], nil, nil);\n                return;\n            }\n\n            responseDate = ((NSHTTPURLResponse *)response).allHeaderFields[@\"Date\"];\n        }\n\n        // Call handler\n        completionHandler(nil, data, responseDate);\n    };\n\n    // Download image\n    __weak __typeof(self) weakSelf = self;\n    __block RCTNetworkTask *task =\n    [networking networkTaskWithRequest:request\n                       completionBlock:^(NSURLResponse *response, NSData *data, NSError *error) {\n                           __typeof(self) strongSelf = weakSelf;\n                           if (!strongSelf) {\n                               return;\n                           }\n\n                           if (error || !response || !data) {\n                               NSError *someError = nil;\n                               if (error) {\n                                   someError = error;\n                               } else if (!response) {\n                                   someError = RCTErrorWithMessage(@\"Response metadata error\");\n                               } else {\n                                   someError = RCTErrorWithMessage(@\"Unknown image download error\");\n                               }\n                               completionHandler(someError, nil, nil);\n                               [strongSelf dequeueTasks];\n                               return;\n                           }\n\n                           dispatch_async(strongSelf->_URLRequestQueue, ^{\n                               // Process image data\n                               processResponse(response, data, nil);\n\n                               // Prepare for next task\n                               [strongSelf dequeueTasks];\n                           });\n                       }];\n\n    task.downloadProgressBlock = ^(int64_t progress, int64_t total) {\n        if (progressHandler) {\n            progressHandler(progress, total);\n        }\n    };\n\n    if (task) {\n        if (!_pendingTasks) {\n            _pendingTasks = [NSMutableArray new];\n        }\n        [_pendingTasks addObject:task];\n        [self dequeueTasks];\n    }\n\n    return ^{\n        __typeof(self) strongSelf = weakSelf;\n        if (!strongSelf || !task) {\n            return;\n        }\n        dispatch_async(strongSelf->_URLRequestQueue, ^{\n            [task cancel];\n            task = nil;\n        });\n        [strongSelf dequeueTasks];\n    };\n}\n\n- (RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest\n                                                      size:(CGSize)size\n                                                     scale:(CGFloat)scale\n                                                   clipped:(BOOL)clipped\n                                                resizeMode:(RCTResizeMode)resizeMode\n                                             progressBlock:(RCTImageLoaderProgressBlock)progressBlock\n                                          partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadBlock\n                                           completionBlock:(RCTImageLoaderCompletionBlock)completionBlock\n{\n    __block atomic_bool cancelled = ATOMIC_VAR_INIT(NO);\n    // TODO: Protect this variable shared between threads.\n    __block dispatch_block_t cancelLoad = nil;\n    dispatch_block_t cancellationBlock = ^{\n        BOOL alreadyCancelled = atomic_fetch_or(&cancelled, 1);\n        if (alreadyCancelled) {\n            return;\n        }\n        dispatch_block_t cancelLoadLocal = cancelLoad;\n        cancelLoad = nil;\n        if (cancelLoadLocal) {\n            cancelLoadLocal();\n        }\n    };\n\n    __weak RCTImageLoader *weakSelf = self;\n    void (^completionHandler)(NSError *, id, BOOL, NSString *) = ^(NSError *error, id imageOrData, BOOL cacheResult, NSString *fetchDate) {\n        __typeof(self) strongSelf = weakSelf;\n        if (atomic_load(&cancelled) || !strongSelf) {\n            return;\n        }\n\n        if (!imageOrData || [imageOrData isKindOfClass:[NSImage class]]) {\n            cancelLoad = nil;\n            completionBlock(error, imageOrData);\n            return;\n        }\n\n        // Check decoded image cache\n        if (cacheResult) {\n            NSImage *image = [[strongSelf imageCache] imageForUrl:imageURLRequest.URL.absoluteString\n                                                             size:size\n                                                            scale:scale\n                                                       resizeMode:resizeMode\n                                                     responseDate:fetchDate];\n            if (image) {\n                cancelLoad = nil;\n                completionBlock(nil, image);\n                return;\n            }\n        }\n\n        RCTImageLoaderCompletionBlock decodeCompletionHandler = ^(NSError *error_, NSImage *image) {\n            if (cacheResult && image) {\n                // Store decoded image in cache\n                [[strongSelf imageCache] addImageToCache:image\n                                                     URL:imageURLRequest.URL.absoluteString\n                                                    size:size\n                                                   scale:scale\n                                              resizeMode:resizeMode\n                                            responseDate:fetchDate];\n            }\n\n            cancelLoad = nil;\n            completionBlock(error_, image);\n        };\n\n        cancelLoad = [strongSelf decodeImageData:imageOrData\n                                            size:size\n                                           scale:scale\n                                         clipped:clipped\n                                      resizeMode:resizeMode\n                                 completionBlock:decodeCompletionHandler];\n    };\n\n    cancelLoad = [self _loadImageOrDataWithURLRequest:imageURLRequest\n                                                 size:size\n                                                scale:scale\n                                           resizeMode:resizeMode\n                                        progressBlock:progressBlock\n                                     partialLoadBlock:partialLoadBlock\n                                      completionBlock:completionHandler];\n    return cancellationBlock;\n}\n\n- (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)data\n                                              size:(CGSize)size\n                                             scale:(CGFloat)scale\n                                           clipped:(BOOL)clipped\n                                        resizeMode:(RCTResizeMode)resizeMode\n                                   completionBlock:(RCTImageLoaderCompletionBlock)completionBlock\n{\n    if (data.length == 0) {\n        completionBlock(RCTErrorWithMessage(@\"No image data\"), nil);\n        return ^{};\n    }\n\n    __block atomic_bool cancelled = ATOMIC_VAR_INIT(NO);\n    void (^completionHandler)(NSError *, NSImage *) = ^(NSError *error, NSImage *image) {\n        if (RCTIsMainQueue()) {\n            // Most loaders do not return on the main thread, so caller is probably not\n            // expecting it, and may do expensive post-processing in the callback\n            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n                if (!atomic_load(&cancelled)) {\n                    completionBlock(error, clipped ? RCTResizeImageIfNeeded(image, size, scale, resizeMode) : image);\n                }\n            });\n        } else if (!atomic_load(&cancelled)) {\n            completionBlock(error, clipped ? RCTResizeImageIfNeeded(image, size, scale, resizeMode) : image);\n        }\n    };\n\n    id<RCTImageDataDecoder> imageDecoder = [self imageDataDecoderForData:data];\n    if (imageDecoder) {\n        return [imageDecoder decodeImageData:data\n                                        size:size\n                                       scale:scale\n                                  resizeMode:resizeMode\n                           completionHandler:completionHandler] ?: ^{};\n    } else {\n        dispatch_block_t decodeBlock = ^{\n            // Calculate the size, in bytes, that the decompressed image will require\n            NSInteger decodedImageBytes = (size.width * scale) * (size.height * scale) * 4;\n\n            // Mark these bytes as in-use\n            self->_activeBytes += decodedImageBytes;\n\n            // Do actual decompression on a concurrent background queue\n            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n                if (!atomic_load(&cancelled)) {\n\n                    // Decompress the image data (this may be CPU and memory intensive)\n                    NSImage *image = RCTDecodeImageWithData(data, size, scale, resizeMode);\n\n#if RCT_DEV\n                    CGSize imagePixelSize = RCTSizeInPixels(image.size, 1.0f);\n                    CGSize screenPixelSize = RCTSizeInPixels(RCTScreenSize(), RCTScreenScale());\n                    if (imagePixelSize.width * imagePixelSize.height >\n                        screenPixelSize.width * screenPixelSize.height) {\n                      RCTLogInfo(@\"[PERF ASSETS] Loading image at size %@, which is larger \"\n                                   \"than the screen size %@\", NSStringFromSize(imagePixelSize),\n                                   NSStringFromSize(screenPixelSize));\n                    }\n#endif\n\n                    if (image) {\n                        completionHandler(nil, image);\n                    } else {\n                        NSString *errorMessage = [NSString stringWithFormat:@\"Error decoding image data <NSData %p; %tu bytes>\", data, data.length];\n                        NSError *finalError = RCTErrorWithMessage(errorMessage);\n                        completionHandler(finalError, nil);\n                    }\n                }\n\n                // We're no longer retaining the uncompressed data, so now we'll mark\n                // the decoding as complete so that the loading task queue can resume.\n                dispatch_async(self->_URLRequestQueue, ^{\n                    self->_scheduledDecodes--;\n                    self->_activeBytes -= decodedImageBytes;\n                    [self dequeueTasks];\n                });\n            });\n        };\n\n        if (!_URLRequestQueue) {\n            [self setUp];\n        }\n        dispatch_async(_URLRequestQueue, ^{\n            // The decode operation retains the compressed image data until it's\n            // complete, so we'll mark it as having started, in order to block\n            // further image loads from happening until we're done with the data.\n            self->_scheduledDecodes++;\n\n            if (!self->_pendingDecodes) {\n                self->_pendingDecodes = [NSMutableArray new];\n            }\n            NSInteger activeDecodes = self->_scheduledDecodes - self->_pendingDecodes.count - 1;\n            if (activeDecodes == 0 || (self->_activeBytes <= self->_maxConcurrentDecodingBytes &&\n                                       activeDecodes <= self->_maxConcurrentDecodingTasks)) {\n                decodeBlock();\n            } else {\n                [self->_pendingDecodes addObject:decodeBlock];\n            }\n        });\n\n        return ^{\n            atomic_store(&cancelled, YES);\n        };\n    }\n}\n\n- (RCTImageLoaderCancellationBlock)getImageSizeForURLRequest:(NSURLRequest *)imageURLRequest\n                                                       block:(void(^)(NSError *error, CGSize size))callback\n{\n    void (^completion)(NSError *, id, BOOL, NSString *) = ^(NSError *error, id imageOrData, BOOL cacheResult, NSString *fetchDate) {\n        CGSize size;\n        if ([imageOrData isKindOfClass:[NSData class]]) {\n            NSDictionary *meta = RCTGetImageMetadata(imageOrData);\n\n            NSInteger imageOrientation = [meta[(id)kCGImagePropertyOrientation] integerValue];\n            switch (imageOrientation) {\n                case kCGImagePropertyOrientationLeft:\n                case kCGImagePropertyOrientationRight:\n                case kCGImagePropertyOrientationLeftMirrored:\n                case kCGImagePropertyOrientationRightMirrored:\n                    // swap width and height\n                    size = (CGSize){\n                      [meta[(id)kCGImagePropertyPixelHeight] doubleValue],\n                      [meta[(id)kCGImagePropertyPixelWidth] doubleValue],\n                    };\n                    break;\n                case kCGImagePropertyOrientationUp:\n                case kCGImagePropertyOrientationDown:\n                case kCGImagePropertyOrientationUpMirrored:\n                case kCGImagePropertyOrientationDownMirrored:\n                default:\n                    size = (CGSize){\n                      [meta[(id)kCGImagePropertyPixelWidth] doubleValue],\n                      [meta[(id)kCGImagePropertyPixelHeight] doubleValue],\n                    };\n                    break;\n            }\n        } else {\n            NSImage *image = imageOrData;\n            size = (CGSize){\n                image.size.width * RCTScreenScale(),\n                image.size.height * RCTScreenScale(),\n            };\n        }\n        callback(error, size);\n    };\n\n    return [self _loadImageOrDataWithURLRequest:imageURLRequest\n                                           size:CGSizeZero\n                                          scale:1\n                                     resizeMode:RCTResizeModeStretch\n                                  progressBlock:NULL\n                               partialLoadBlock:NULL\n                                completionBlock:completion];\n}\n\n#pragma mark - RCTURLRequestHandler\n\n- (BOOL)canHandleRequest:(NSURLRequest *)request\n{\n  NSURL *requestURL = request.URL;\n\n  // If the data being loaded is a video, return NO\n  // Even better may be to implement this on the RCTImageURLLoader that would try to load it,\n  // but we'd have to run the logic both in RCTPhotoLibraryImageLoader and\n  // RCTAssetsLibraryRequestHandler. Once we drop iOS7 though, we'd drop\n  // RCTAssetsLibraryRequestHandler and can move it there.\n  static NSRegularExpression *videoRegex;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    NSError *error = nil;\n    videoRegex = [NSRegularExpression regularExpressionWithPattern:@\"(?:&|^)ext=MOV(?:&|$)\"\n                                                           options:NSRegularExpressionCaseInsensitive\n                                                             error:&error];\n    if (error) {\n      RCTLogError(@\"%@\", error);\n    }\n  });\n\n  NSString *query = requestURL.query;\n  if (\n    query != nil &&\n    [videoRegex firstMatchInString:query\n                           options:0\n                             range:NSMakeRange(0, query.length)]\n  ) {\n    return NO;\n  }\n\n  for (id<RCTImageURLLoader> loader in _loaders) {\n    // Don't use RCTImageURLLoader protocol for modules that already conform to\n    // RCTURLRequestHandler as it's inefficient to decode an image and then\n    // convert it back into data\n    if (![loader conformsToProtocol:@protocol(RCTURLRequestHandler)] &&\n      [loader canLoadImageURL:requestURL]) {\n      return YES;\n    }\n  }\n\n  return NO;\n}\n\n- (id)sendRequest:(NSURLRequest *)request withDelegate:(id<RCTURLRequestDelegate>)delegate\n{\n    __block RCTImageLoaderCancellationBlock requestToken;\n    requestToken = [self loadImageWithURLRequest:request callback:^(NSError *error, NSImage *image) {\n        if (error) {\n            [delegate URLRequest:requestToken didCompleteWithError:error];\n            return;\n        }\n\n        NSString *mimeType = nil;\n        NSData *imageData = nil;\n        if (RCTImageHasAlpha(RCTGetCGImage(image))) {\n            mimeType = @\"image/png\";\n            imageData = UIImagePNGRepresentation(image);\n        } else {\n            mimeType = @\"image/jpeg\";\n            imageData = UIImageJPEGRepresentation(image, 1.0);\n        }\n\n        NSURLResponse *response = [[NSURLResponse alloc] initWithURL:request.URL\n                                                            MIMEType:mimeType\n                                               expectedContentLength:imageData.length\n                                                    textEncodingName:nil];\n\n        [delegate URLRequest:requestToken didReceiveResponse:response];\n        [delegate URLRequest:requestToken didReceiveData:imageData];\n        [delegate URLRequest:requestToken didCompleteWithError:nil];\n    }];\n\n    return requestToken;\n}\n\n- (void)cancelRequest:(id)requestToken\n{\n    if (requestToken) {\n        ((RCTImageLoaderCancellationBlock)requestToken)();\n    }\n}\n\n@end\n\n@implementation RCTBridge (RCTImageLoader)\n\n- (RCTImageLoader *)imageLoader\n{\n    return [self moduleForClass:[RCTImageLoader class]];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageShadowView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTShadowView.h>\n\n@interface RCTImageShadowView : RCTShadowView\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageShadowView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTImageShadowView.h\"\n\n#import <React/RCTLog.h>\n\n@implementation RCTImageShadowView\n\n- (BOOL)isYogaLeafNode\n{\n  return YES;\n}\n\n- (BOOL)canHaveSubviews\n{\n  return NO;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageStoreManager.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBridge.h>\n#import <React/RCTURLRequestHandler.h>\n\n@interface RCTImageStoreManager : NSObject <RCTURLRequestHandler>\n\n/**\n * Set and get cached image data asynchronously. It is safe to call these from any\n * thread. The callbacks will be called on an unspecified thread.\n */\n- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)(void))block;\n- (void)storeImageData:(NSData *)imageData withBlock:(void (^)(NSString *imageTag))block;\n- (void)getImageDataForTag:(NSString *)imageTag withBlock:(void (^)(NSData *imageData))block;\n\n/**\n * Convenience method to store an image directly (image is converted to data\n * internally, so any metadata such as scale or orientation will be lost).\n */\n- (void)storeImage:(NSImage *)image withBlock:(void (^)(NSString *imageTag))block;\n\n@end\n\n@interface RCTImageStoreManager (Deprecated)\n\n/**\n * These methods are deprecated - use the data-based alternatives instead.\n */\n- (NSString *)storeImage:(NSImage *)image __deprecated;\n- (NSImage *)imageForTag:(NSString *)imageTag __deprecated;\n- (void)getImageForTag:(NSString *)imageTag withBlock:(void (^)(NSImage *image))block __deprecated;\n\n@end\n\n@interface RCTBridge (RCTImageStoreManager)\n\n@property (nonatomic, readonly) RCTImageStoreManager *imageStoreManager;\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageStoreManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTImageStoreManager.h\"\n\n#import <stdatomic.h>\n\n#import <ImageIO/ImageIO.h>\n//#import <MobileCoreServices/UTType.h>\n\n#import <React/RCTAssert.h>\n#import <React/RCTLog.h>\n#import <React/RCTUtils.h>\n\n#import \"RCTImageUtils.h\"\n\n#import \"React/UIImageUtils.h\"\n\nstatic NSString *const RCTImageStoreURLScheme = @\"rct-image-store\";\n\n@implementation RCTImageStoreManager\n{\n  NSMutableDictionary<NSString *, NSData *> *_store;\n  NSUInteger _id;\n}\n\n@synthesize methodQueue = _methodQueue;\n\nRCT_EXPORT_MODULE()\n\n- (float)handlerPriority\n{\n    return 1;\n}\n\n- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)(void))block\n{\n  dispatch_async(_methodQueue, ^{\n    [self removeImageForTag:imageTag];\n    if (block) {\n      block();\n    }\n  });\n}\n\n- (NSString *)_storeImageData:(NSData *)imageData\n{\n  RCTAssertThread(_methodQueue, @\"Must be called on RCTImageStoreManager thread\");\n\n  if (!_store) {\n    _store = [NSMutableDictionary new];\n    _id = 0;\n  }\n\n  NSString *imageTag = [NSString stringWithFormat:@\"%@://%tu\", RCTImageStoreURLScheme, _id++];\n  _store[imageTag] = imageData;\n  return imageTag;\n}\n\n- (void)storeImageData:(NSData *)imageData withBlock:(void (^)(NSString *imageTag))block\n{\n  RCTAssertParam(block);\n  dispatch_async(_methodQueue, ^{\n    block([self _storeImageData:imageData]);\n  });\n}\n\n- (void)getImageDataForTag:(NSString *)imageTag withBlock:(void (^)(NSData *imageData))block\n{\n  RCTAssertParam(block);\n  dispatch_async(_methodQueue, ^{\n    block(self->_store[imageTag]);\n  });\n}\n\n- (void)storeImage:(NSImage *)image withBlock:(void (^)(NSString *imageTag))block\n{\n  RCTAssertParam(block);\n  dispatch_async(_methodQueue, ^{\n    NSString *imageTag = [self _storeImageData:RCTGetImageData(image, 0.75)];\n    dispatch_async(dispatch_get_main_queue(), ^{\n      block(imageTag);\n    });\n  });\n}\n\nRCT_EXPORT_METHOD(removeImageForTag:(NSString *)imageTag)\n{\n  [_store removeObjectForKey:imageTag];\n}\n\nRCT_EXPORT_METHOD(hasImageForTag:(NSString *)imageTag\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  callback(@[@(_store[imageTag] != nil)]);\n}\n\n// TODO (#5906496): Name could be more explicit - something like getBase64EncodedDataForTag:?\nRCT_EXPORT_METHOD(getBase64ForTag:(NSString *)imageTag\n                  successCallback:(RCTResponseSenderBlock)successCallback\n                  errorCallback:(RCTResponseErrorBlock)errorCallback)\n{\n  NSData *imageData = _store[imageTag];\n  if (!imageData) {\n    errorCallback(RCTErrorWithMessage([NSString stringWithFormat:@\"Invalid imageTag: %@\", imageTag]));\n    return;\n  }\n  // Dispatching to a background thread to perform base64 encoding\n  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n    successCallback(@[[imageData base64EncodedStringWithOptions:0]]);\n  });\n}\n\nRCT_EXPORT_METHOD(addImageFromBase64:(NSString *)base64String\n                  successCallback:(RCTResponseSenderBlock)successCallback\n                  errorCallback:(RCTResponseErrorBlock)errorCallback)\n\n{\n  // Dispatching to a background thread to perform base64 decoding\n  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n    NSData *imageData = [[NSData alloc] initWithBase64EncodedString:base64String options:0];\n    if (imageData) {\n      dispatch_async(self->_methodQueue, ^{\n        successCallback(@[[self _storeImageData:imageData]]);\n      });\n    } else {\n      errorCallback(RCTErrorWithMessage(@\"Failed to add image from base64String\"));\n    }\n  });\n}\n\n#pragma mark - RCTURLRequestHandler\n\n- (BOOL)canHandleRequest:(NSURLRequest *)request\n{\n  return [request.URL.scheme caseInsensitiveCompare:RCTImageStoreURLScheme] == NSOrderedSame;\n}\n\n- (id)sendRequest:(NSURLRequest *)request withDelegate:(id<RCTURLRequestDelegate>)delegate\n{\n  __block atomic_bool cancelled = ATOMIC_VAR_INIT(NO);\n  void (^cancellationBlock)(void) = ^{\n    atomic_store(&cancelled, YES);\n  };\n\n  // Dispatch async to give caller time to cancel the request\n  dispatch_async(_methodQueue, ^{\n    if (atomic_load(&cancelled)) {\n      return;\n    }\n\n    NSString *imageTag = request.URL.absoluteString;\n    NSData *imageData = self->_store[imageTag];\n    if (!imageData) {\n      NSError *error = RCTErrorWithMessage([NSString stringWithFormat:@\"Invalid imageTag: %@\", imageTag]);\n      [delegate URLRequest:cancellationBlock didCompleteWithError:error];\n      return;\n    }\n\n    CGImageSourceRef sourceRef = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL);\n    if (!sourceRef) {\n      NSError *error = RCTErrorWithMessage([NSString stringWithFormat:@\"Unable to decode data for imageTag: %@\", imageTag]);\n      [delegate URLRequest:cancellationBlock didCompleteWithError:error];\n      return;\n    }\n    CFStringRef UTI = CGImageSourceGetType(sourceRef);\n    CFRelease(sourceRef);\n\n    NSString *MIMEType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass(UTI, kUTTagClassMIMEType);\n    NSURLResponse *response = [[NSURLResponse alloc] initWithURL:request.URL\n                                                        MIMEType:MIMEType\n                                           expectedContentLength:imageData.length\n                                                textEncodingName:nil];\n\n    [delegate URLRequest:cancellationBlock didReceiveResponse:response];\n    [delegate URLRequest:cancellationBlock didReceiveData:imageData];\n    [delegate URLRequest:cancellationBlock didCompleteWithError:nil];\n\n  });\n\n  return cancellationBlock;\n}\n\n- (void)cancelRequest:(id)requestToken\n{\n  if (requestToken) {\n    ((void (^)(void))requestToken)();\n  }\n}\n\n@end\n\n@implementation RCTImageStoreManager (Deprecated)\n\n- (NSString *)storeImage:(NSImage *)image\n{\n  RCTAssertMainQueue();\n  RCTLogWarn(@\"RCTImageStoreManager.storeImage() is deprecated and has poor performance. Use an alternative method instead.\");\n  __block NSString *imageTag;\n  dispatch_sync(_methodQueue, ^{\n    imageTag = [self _storeImageData:RCTGetImageData(image, 0.75)];\n  });\n  return imageTag;\n}\n\n- (NSImage *)imageForTag:(NSString *)imageTag\n{\n  RCTAssertMainQueue();\n  RCTLogWarn(@\"RCTImageStoreManager.imageForTag() is deprecated and has poor performance. Use an alternative method instead.\");\n  __block NSData *imageData;\n  dispatch_sync(_methodQueue, ^{\n    imageData = self->_store[imageTag];\n  });\n  return [[NSImage alloc] initWithData:imageData];\n}\n\n- (void)getImageForTag:(NSString *)imageTag withBlock:(void (^)(NSImage *image))block\n{\n  RCTAssertParam(block);\n  dispatch_async(_methodQueue, ^{\n    NSData *imageData = self->_store[imageTag];\n    dispatch_async(dispatch_get_main_queue(), ^{\n      // imageWithData: is not thread-safe, so we can't do this on methodQueue\n      block([[NSImage alloc] initWithData:imageData]);\n    });\n  });\n}\n\n@end\n\n@implementation RCTBridge (RCTImageStoreManager)\n\n- (RCTImageStoreManager *)imageStoreManager\n{\n  return [self moduleForClass:[RCTImageStoreManager class]];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageUtils.h",
    "content": "/*\n *  Copyright (c) 2013, Facebook, Inc.\n *  All rights reserved.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTDefines.h>\n#import <React/RCTResizeMode.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n/**\n * This function takes an source size (typically from an image), a target size\n * and scale that it will be drawn at (typically in a CGContext) and then\n * calculates the rectangle to draw the image into so that it will be sized and\n * positioned correctly according to the specified resizeMode.\n */\nRCT_EXTERN CGRect RCTTargetRect(CGSize sourceSize, CGSize destSize,\n                                CGFloat destScale, RCTResizeMode resizeMode);\n\n/**\n * This function takes a source size (typically from an image), a target rect\n * that it will be drawn into (typically relative to a CGContext), and works out\n * the transform needed to draw the image at the correct scale and position.\n */\nRCT_EXTERN CGAffineTransform RCTTransformFromTargetRect(CGSize sourceSize,\n                                                        CGRect targetRect);\n\n/**\n * This function takes an input content size & scale (typically from an image),\n * a target size & scale at which it will be displayed (typically in a\n * UIImageView) and then calculates the optimal size at which to redraw the\n * image so that it will be displayed correctly with the specified resizeMode.\n */\nRCT_EXTERN CGSize RCTTargetSize(CGSize sourceSize, CGFloat sourceScale,\n                                CGSize destSize, CGFloat destScale,\n                                RCTResizeMode resizeMode, BOOL allowUpscaling);\n\n/**\n * This function takes an input content size & scale (typically from an image),\n * a target size & scale that it will be displayed at, and determines if the\n * source will need to be upscaled to fit (which may result in pixelization).\n */\nRCT_EXTERN BOOL RCTUpscalingRequired(CGSize sourceSize, CGFloat sourceScale,\n                                     CGSize destSize, CGFloat destScale,\n                                     RCTResizeMode resizeMode);\n\n/**\n * This function takes the source data for an image and decodes it at the\n * specified size. If the original image is smaller than the destination size,\n * the resultant image's scale will be decreased to compensate, so the\n * width/height of the returned image is guaranteed to be >= destSize.\n * Pass a destSize of CGSizeZero to decode the image at its original size.\n */\nRCT_EXTERN NSImage *__nullable RCTDecodeImageWithData(NSData *data,\n                                                      CGSize destSize,\n                                                      CGFloat destScale,\n                                                      RCTResizeMode resizeMode);\n\n/**\n * This function takes the source data for an image and decodes just the\n * metadata, without decompressing the image itself.\n */\nRCT_EXTERN NSDictionary<NSString *, id> *__nullable RCTGetImageMetadata(NSData *data);\n\n/**\n * Convert an image back into data. Images with an alpha channel will be\n * converted to lossless PNG data. Images without alpha will be converted to\n * JPEG. The `quality` argument controls the compression ratio of the JPEG\n * conversion, with 1.0 being maximum quality. It has no effect for images\n * using PNG compression.\n */\nRCT_EXTERN NSData *__nullable RCTGetImageData(NSImage* image, float quality);\n\n/**\n * This function transforms an image. `destSize` is the size of the final image,\n * and `destScale` is its scale. The `transform` argument controls how the\n * source image will be mapped to the destination image.\n */\nRCT_EXTERN NSImage *__nullable RCTTransformImage(NSImage *image,\n                                                 CGSize destSize,\n                                                 CGFloat destScale,\n                                                 CGAffineTransform transform);\n\n/*\n * Return YES if image has an alpha component\n */\nRCT_EXTERN BOOL RCTImageHasAlpha(CGImageRef image);\n\nRCT_EXTERN CGImageRef RCTGetCGImage(NSImage *image);\n\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Image/RCTImageUtils.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTImageUtils.h\"\n\n#import <tgmath.h>\n\n#import <ImageIO/ImageIO.h>\n\n#import <React/RCTLog.h>\n#import <React/RCTUtils.h>\n#import \"React/UIImageUtils.h\"\n\nstatic CGFloat RCTCeilValue(CGFloat value, CGFloat scale)\n{\n  return ceil(value * scale) / scale;\n}\n\nstatic CGFloat RCTFloorValue(CGFloat value, CGFloat scale)\n{\n  return floor(value * scale) / scale;\n}\n\nstatic CGSize RCTCeilSize(CGSize size, CGFloat scale)\n{\n  return (CGSize){\n    RCTCeilValue(size.width, scale),\n    RCTCeilValue(size.height, scale)\n  };\n}\n\n//static CGImagePropertyOrientation CGImagePropertyOrientationFromUIImageOrientation(UIImageOrientation imageOrientation)\n//{\n//  // see https://stackoverflow.com/a/6699649/496389\n//  switch (imageOrientation) {\n////    case UIImageOrientationUp: return kCGImagePropertyOrientationUp;\n////    case UIImageOrientationDown: return kCGImagePropertyOrientationDown;\n////    case UIImageOrientationLeft: return kCGImagePropertyOrientationLeft;\n////    case UIImageOrientationRight: return kCGImagePropertyOrientationRight;\n////    case UIImageOrientationUpMirrored: return kCGImagePropertyOrientationUpMirrored;\n////    case UIImageOrientationDownMirrored: return kCGImagePropertyOrientationDownMirrored;\n////    case UIImageOrientationLeftMirrored: return kCGImagePropertyOrientationLeftMirrored;\n////    case UIImageOrientationRightMirrored: return kCGImagePropertyOrientationRightMirrored;\n//    default: return kCGImagePropertyOrientationUp;\n//  }\n//}\n\nCGRect RCTTargetRect(CGSize sourceSize, CGSize destSize,\n                     CGFloat destScale, RCTResizeMode resizeMode)\n{\n  if (CGSizeEqualToSize(destSize, CGSizeZero)) {\n    // Assume we require the largest size available\n    return (CGRect){CGPointZero, sourceSize};\n  }\n\n  CGFloat aspect = sourceSize.width / sourceSize.height;\n  // If only one dimension in destSize is non-zero (for example, an Image\n  // with `flex: 1` whose height is indeterminate), calculate the unknown\n  // dimension based on the aspect ratio of sourceSize\n  if (destSize.width == 0) {\n    destSize.width = destSize.height * aspect;\n  }\n  if (destSize.height == 0) {\n    destSize.height = destSize.width / aspect;\n  }\n\n  // Calculate target aspect ratio if needed\n  CGFloat targetAspect = 0.0;\n  if (resizeMode != RCTResizeModeCenter &&\n      resizeMode != RCTResizeModeStretch) {\n    targetAspect = destSize.width / destSize.height;\n    if (aspect == targetAspect) {\n      resizeMode = RCTResizeModeStretch;\n    }\n  }\n\n  switch (resizeMode) {\n    case RCTResizeModeStretch:\n    case RCTResizeModeRepeat:\n\n      return (CGRect){CGPointZero, RCTCeilSize(destSize, destScale)};\n\n    case RCTResizeModeContain:\n\n      if (targetAspect <= aspect) { // target is taller than content\n\n        sourceSize.width = destSize.width;\n        sourceSize.height = sourceSize.width / aspect;\n\n      } else { // target is wider than content\n\n        sourceSize.height = destSize.height;\n        sourceSize.width = sourceSize.height * aspect;\n      }\n      return (CGRect){\n        {\n          RCTFloorValue((destSize.width - sourceSize.width) / 2, destScale),\n          RCTFloorValue((destSize.height - sourceSize.height) / 2, destScale),\n        },\n        RCTCeilSize(sourceSize, destScale)\n      };\n\n    case RCTResizeModeCover:\n      if (targetAspect <= aspect) { // target is taller than content\n\n        sourceSize.height = destSize.height;\n        sourceSize.width = sourceSize.height * aspect;\n        destSize.width = destSize.height * targetAspect;\n        return (CGRect){\n          {RCTFloorValue((destSize.width - sourceSize.width) / 2, destScale), 0},\n          RCTCeilSize(sourceSize, destScale)\n        };\n\n      } else { // target is wider than content\n\n        sourceSize.width = destSize.width;\n        sourceSize.height = sourceSize.width / aspect;\n        destSize.height = destSize.width / targetAspect;\n        return (CGRect){\n          {0, RCTFloorValue((destSize.height - sourceSize.height) / 2, destScale)},\n          RCTCeilSize(sourceSize, destScale)\n        };\n      }\n\n    case RCTResizeModeCenter:\n\n      // Make sure the image is not clipped by the target.\n      if (sourceSize.height > destSize.height) {\n        sourceSize.width = destSize.width;\n        sourceSize.height = sourceSize.width / aspect;\n      }\n      if (sourceSize.width > destSize.width) {\n        sourceSize.height = destSize.height;\n        sourceSize.width = sourceSize.height * aspect;\n      }\n\n      return (CGRect){\n        {\n          RCTFloorValue((destSize.width - sourceSize.width) / 2, destScale),\n          RCTFloorValue((destSize.height - sourceSize.height) / 2, destScale),\n        },\n        RCTCeilSize(sourceSize, destScale)\n      };\n  }\n}\n\nCGAffineTransform RCTTransformFromTargetRect(CGSize sourceSize, CGRect targetRect)\n{\n  CGAffineTransform transform = CGAffineTransformIdentity;\n  transform = CGAffineTransformTranslate(transform,\n                                         targetRect.origin.x,\n                                         targetRect.origin.y);\n  transform = CGAffineTransformScale(transform,\n                                     targetRect.size.width / sourceSize.width,\n                                     targetRect.size.height / sourceSize.height);\n  return transform;\n}\n\nCGSize RCTTargetSize(CGSize sourceSize, CGFloat sourceScale,\n                     CGSize destSize, CGFloat destScale,\n                     RCTResizeMode resizeMode,\n                     BOOL allowUpscaling)\n{\n  switch (resizeMode) {\n    case RCTResizeModeCenter:\n\n      return RCTTargetRect(sourceSize, destSize, destScale, resizeMode).size;\n\n    case RCTResizeModeStretch:\n\n      if (!allowUpscaling) {\n        CGFloat scale = sourceScale / destScale;\n        destSize.width = MIN(sourceSize.width * scale, destSize.width);\n        destSize.height = MIN(sourceSize.height * scale, destSize.height);\n      }\n      return RCTCeilSize(destSize, destScale);\n\n    default: {\n\n      // Get target size\n      CGSize size = RCTTargetRect(sourceSize, destSize, destScale, resizeMode).size;\n      if (!allowUpscaling) {\n        // return sourceSize if target size is larger\n        if (sourceSize.width * sourceScale < size.width * destScale) {\n          return sourceSize;\n        }\n      }\n      return size;\n    }\n  }\n}\n\nBOOL RCTUpscalingRequired(CGSize sourceSize, CGFloat sourceScale,\n                          CGSize destSize, CGFloat destScale,\n                          RCTResizeMode resizeMode)\n{\n  if (CGSizeEqualToSize(destSize, CGSizeZero)) {\n    // Assume we require the largest size available\n    return YES;\n  }\n\n  // Precompensate for scale\n  CGFloat scale = sourceScale / destScale;\n  sourceSize.width *= scale;\n  sourceSize.height *= scale;\n\n  // Calculate aspect ratios if needed (don't bother if resizeMode == stretch)\n  CGFloat aspect = 0.0, targetAspect = 0.0;\n  if (resizeMode != RCTResizeModeStretch) {\n    aspect = sourceSize.width / sourceSize.height;\n    targetAspect = destSize.width / destSize.height;\n    if (aspect == targetAspect) {\n      resizeMode = RCTResizeModeStretch;\n    }\n  }\n\n  switch (resizeMode) {\n    case RCTResizeModeStretch:\n\n      return destSize.width > sourceSize.width || destSize.height > sourceSize.height;\n\n    case RCTResizeModeContain:\n\n      if (targetAspect <= aspect) { // target is taller than content\n\n        return destSize.width > sourceSize.width;\n\n      } else { // target is wider than content\n\n        return destSize.height > sourceSize.height;\n      }\n\n    case RCTResizeModeCover:\n\n      if (targetAspect <= aspect) { // target is taller than content\n\n        return destSize.height > sourceSize.height;\n\n      } else { // target is wider than content\n\n        return destSize.width > sourceSize.width;\n      }\n\n    case RCTResizeModeRepeat:\n    case RCTResizeModeCenter:\n\n      return NO;\n  }\n}\n\nNSImage *__nullable RCTDecodeImageWithData(NSData *data,\n                                           CGSize destSize,\n                                           CGFloat destScale,\n                                           RCTResizeMode resizeMode)\n{\n  CGImageSourceRef sourceRef = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);\n  if (!sourceRef) {\n    return nil;\n  }\n\n  // Get original image size\n  CFDictionaryRef imageProperties = CGImageSourceCopyPropertiesAtIndex(sourceRef, 0, NULL);\n  if (!imageProperties) {\n    CFRelease(sourceRef);\n    return nil;\n  }\n  NSNumber *width = CFDictionaryGetValue(imageProperties, kCGImagePropertyPixelWidth);\n  NSNumber *height = CFDictionaryGetValue(imageProperties, kCGImagePropertyPixelHeight);\n  CGSize sourceSize = {width.doubleValue, height.doubleValue};\n  CFRelease(imageProperties);\n\n  if (CGSizeEqualToSize(destSize, CGSizeZero)) {\n    destSize = sourceSize;\n    if (!destScale) {\n      destScale = 1;\n    }\n  } else if (!destScale) {\n    destScale = RCTScreenScale();\n  }\n\n  if (resizeMode == RCTResizeModeStretch) {\n    // Decoder cannot change aspect ratio, so RCTResizeModeStretch is equivalent\n    // to RCTResizeModeCover for our purposes\n    resizeMode = RCTResizeModeCover;\n  }\n\n  // Calculate target size\n  CGSize targetSize = RCTTargetSize(sourceSize, 1, destSize, destScale, resizeMode, NO);\n  CGSize targetPixelSize = RCTSizeInPixels(targetSize, destScale);\n  CGFloat maxPixelSize = fmax(fmin(sourceSize.width, targetPixelSize.width),\n                              fmin(sourceSize.height, targetPixelSize.height));\n\n  NSDictionary<NSString *, NSNumber *> *options = @{\n    (id)kCGImageSourceShouldAllowFloat: @YES,\n    (id)kCGImageSourceCreateThumbnailWithTransform: @YES,\n    (id)kCGImageSourceCreateThumbnailFromImageAlways: @YES,\n    (id)kCGImageSourceThumbnailMaxPixelSize: @(maxPixelSize),\n  };\n\n  // Get thumbnail\n  CGImageRef imageRef = CGImageSourceCreateThumbnailAtIndex(sourceRef, 0, (__bridge CFDictionaryRef)options);\n  CFRelease(sourceRef);\n  if (!imageRef) {\n    return nil;\n  }\n\n  // Return image\n  NSImage *image = [[NSImage alloc] initWithCGImage:imageRef size:targetSize];\n  CGImageRelease(imageRef);\n  return image;\n}\n\nNSDictionary<NSString *, id> *__nullable RCTGetImageMetadata(NSData *data)\n{\n  CGImageSourceRef sourceRef = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);\n  if (!sourceRef) {\n    return nil;\n  }\n  CFDictionaryRef imageProperties = CGImageSourceCopyPropertiesAtIndex(sourceRef, 0, NULL);\n  CFRelease(sourceRef);\n  return (__bridge_transfer id)imageProperties;\n}\n\nNSData *__nullable RCTGetImageData(NSImage* image, float quality)\n{\n  NSMutableDictionary *properties = [[NSMutableDictionary alloc] initWithDictionary:@{\n    (id)kCGImagePropertyOrientation : @(kCGImagePropertyOrientationUp)\n  }];\n  CGImageDestinationRef destination;\n  CFMutableDataRef imageData = CFDataCreateMutable(NULL, 0);\n  CGImageRef cgImage = RCTGetCGImage(image);\n  if (RCTImageHasAlpha(cgImage)) {\n    // get png data\n    destination = CGImageDestinationCreateWithData(imageData, kUTTypePNG, 1, NULL);\n  } else {\n    // get jpeg data\n    destination = CGImageDestinationCreateWithData(imageData, kUTTypeJPEG, 1, NULL);\n    [properties setValue:@(quality) forKey:(id)kCGImageDestinationLossyCompressionQuality];\n  }\n  CGImageDestinationAddImage(destination, cgImage, (__bridge CFDictionaryRef)properties);\n  if (!CGImageDestinationFinalize(destination))\n  {\n    CFRelease(imageData);\n    imageData = NULL;\n  }\n  CFRelease(destination);\n  return (__bridge_transfer NSData *)imageData;\n}\n\nCGImageRef RCTGetCGImage(NSImage *image)\n{\n//  CGImageSourceRef source = CGImageSourceCreateWithData((CFDataRef)[image TIFFRepresentation], NULL);\n//  return CGImageSourceCreateImageAtIndex(source, 0, NULL);\n  return [image CGImageForProposedRect:nil context:nil hints:nil];\n}\n\nNSImage *__nullable RCTTransformImage(NSImage *image,\n                                      CGSize destSize,\n                                      CGFloat destScale,\n                                      CGAffineTransform transform)\n{\n  if (destSize.width <= 0 | destSize.height <= 0 || destScale <= 0) {\n    return nil;\n  }\n\n  BOOL opaque = !RCTImageHasAlpha(RCTGetCGImage(image));\n  UIGraphicsBeginImageContextWithOptions(destSize, opaque, destScale);\n  CGContextRef currentContext = UIGraphicsGetCurrentContext();\n  CGContextConcatCTM(currentContext, transform);\n  [image drawInRect:NSMakeRect(0, 0, destSize.width, destSize.height)];\n  NSImage *result = UIGraphicsGetImageFromCurrentImageContext();\n  UIGraphicsEndImageContext();\n  return result;\n}\n\nBOOL RCTImageHasAlpha(CGImageRef image)\n{\n  switch (CGImageGetAlphaInfo(image)) {\n    case kCGImageAlphaNone:\n    case kCGImageAlphaNoneSkipLast:\n    case kCGImageAlphaNoneSkipFirst:\n      return NO;\n    default:\n      return YES;\n  }\n}\n"
  },
  {
    "path": "Libraries/Image/RCTImageView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTResizeMode.h>\n\n@class RCTBridge;\n@class RCTImageSource;\n\n@interface RCTImageView : NSImageView\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;\n\n@property (nonatomic, assign) NSEdgeInsets capInsets;\n@property (nonatomic, strong) NSImage *defaultImage;\n@property (nonatomic, copy) NSArray<RCTImageSource *> *imageSources;\n@property (nonatomic, assign) CGFloat blurRadius;\n@property (nonatomic, assign) RCTResizeMode resizeMode;\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTImageView.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTImageSource.h>\n#import <React/RCTUtils.h>\n#import <React/NSView+React.h>\n\n#import \"RCTImageBlurUtils.h\"\n#import \"RCTImageLoader.h\"\n#import \"RCTImageUtils.h\"\n\n/**\n * Determines whether an image of `currentSize` should be reloaded for display\n * at `idealSize`.\n */\nstatic BOOL RCTShouldReloadImageForSizeChange(CGSize currentSize, CGSize idealSize)\n{\n  static const CGFloat upscaleThreshold = 1.2;\n  static const CGFloat downscaleThreshold = 0.5;\n\n  CGFloat widthMultiplier = idealSize.width / currentSize.width;\n  CGFloat heightMultiplier = idealSize.height / currentSize.height;\n\n  return widthMultiplier > upscaleThreshold || widthMultiplier < downscaleThreshold ||\n    heightMultiplier > upscaleThreshold || heightMultiplier < downscaleThreshold;\n}\n\n/**\n * See RCTConvert (ImageSource). We want to send down the source as a similar\n * JSON parameter.\n */\nstatic NSDictionary *onLoadParamsForSource(RCTImageSource *source)\n{\n  NSDictionary *dict = @{\n    @\"width\": @(source.size.width),\n    @\"height\": @(source.size.height),\n    @\"url\": source.request.URL.absoluteString,\n  };\n  return @{ @\"source\": dict };\n}\n\n@interface RCTImageView ()\n\n@property (nonatomic, copy) RCTDirectEventBlock onLoadStart;\n@property (nonatomic, copy) RCTDirectEventBlock onProgress;\n@property (nonatomic, copy) RCTDirectEventBlock onError;\n@property (nonatomic, copy) RCTDirectEventBlock onPartialLoad;\n@property (nonatomic, copy) RCTDirectEventBlock onLoad;\n@property (nonatomic, copy) RCTDirectEventBlock onLoadEnd;\n\n@end\n\n@implementation RCTImageView\n{\n  // Weak reference back to the bridge, for image loading\n  __weak RCTBridge *_bridge;\n\n  // The image source that's currently displayed\n  RCTImageSource *_imageSource;\n\n  // The image source that's being loaded from the network\n  RCTImageSource *_pendingImageSource;\n\n  // Size of the image loaded / being loaded, so we can determine when to issue a reload to accommodate a changing size.\n  CGSize _targetSize;\n\n  // A block that can be invoked to cancel the most recent call to -reloadImage, if any\n  RCTImageLoaderCancellationBlock _reloadImageCancellationBlock;\n\n  // Whether the latest change of props requires the image to be reloaded\n  BOOL _needsReload;\n}\n\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  if ((self = [super initWithFrame:NSZeroRect])) {\n    _bridge = bridge;\n    [self setWantsLayer:YES];\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(NSRect)frameRect)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)coder)\n\n- (void)updateWithImage:(NSImage *)image\n{\n  if (!image) {\n    super.image = nil;\n    return;\n  }\n\n  /*\n  if (_resizeMode == RCTResizeModeRepeat) {\n    image = [image resizableImageWithCapInsets:_capInsets resizingMode:UIImageResizingModeTile];\n  } else if (!UIEdgeInsetsEqualToEdgeInsets(NSEdgeInsetsZero, _capInsets)) {\n    // Applying capInsets of 0 will switch the \"resizingMode\" of the image to \"tile\" which is undesired\n    image = [image resizableImageWithCapInsets:_capInsets resizingMode:UIImageResizingModeStretch];\n  }\n   */\n\n  // Apply trilinear filtering to smooth out mis-sized images\n  self.layer.minificationFilter = kCAFilterTrilinear;\n  self.layer.magnificationFilter = kCAFilterTrilinear;\n\n  super.image = image;\n}\n\n- (void)setImage:(NSImage *)image\n{\n  image = image ?: _defaultImage;\n  if (image != self.image) {\n    [self updateWithImage:image];\n  }\n}\n\n// TODO: Replace it with proper method\nstatic inline BOOL UIEdgeInsetsEqualToEdgeInsets(NSEdgeInsets insets1, NSEdgeInsets insets2) {\n  return CGRectEqualToRect(CGRectMake(insets1.left, insets1.top, insets1.right, insets1.bottom),\n                           CGRectMake(insets2.left, insets2.top, insets2.right, insets2.bottom));\n}\n\n- (void)setBlurRadius:(CGFloat)blurRadius\n{\n  if (blurRadius != _blurRadius) {\n    _blurRadius = blurRadius;\n    _needsReload = YES;\n  }\n}\n\n- (void)setCapInsets:(NSEdgeInsets)capInsets\n\n{\n  if (!UIEdgeInsetsEqualToEdgeInsets(_capInsets, capInsets)) {\n    if (UIEdgeInsetsEqualToEdgeInsets(_capInsets, NSEdgeInsetsZero) ||\n        UIEdgeInsetsEqualToEdgeInsets(capInsets, NSEdgeInsetsZero)) {\n      _capInsets = capInsets;\n      // Need to reload image when enabling or disabling capInsets\n      _needsReload = YES;\n    } else {\n      _capInsets = capInsets;\n      [self updateWithImage:self.image];\n    }\n  }\n}\n\n/*\n- (void)setRenderingMode:(UIImageRenderingMode)renderingMode\n{\n  if (_renderingMode != renderingMode) {\n    _renderingMode = renderingMode;\n    [self updateWithImage:self.image];\n  }\n}*/\n\n- (void)setImageSources:(NSArray<RCTImageSource *> *)imageSources\n{\n  if (![imageSources isEqual:_imageSources]) {\n    _imageSources = [imageSources copy];\n    _needsReload = YES;\n  }\n}\n\n- (void)setResizeMode:(RCTResizeMode)resizeMode\n{\n  if (_resizeMode != resizeMode) {\n    _resizeMode = resizeMode;\n    if (_resizeMode == RCTResizeModeRepeat) {\n      // Repeat resize mode is handled by the UIImage. Use scale to fill\n      // so the repeated image fills the UIImageView.\n      self.imageScaling = NSImageScaleAxesIndependently;\n    } else if (_resizeMode == RCTResizeModeCover) {\n      self.imageScaling = NSImageScaleNone;\n    } else if (_resizeMode == RCTResizeModeStretch) {\n      self.imageScaling = NSImageScaleAxesIndependently;\n    } else {\n      self.imageScaling = NSImageScaleProportionallyDown;\n    }\n\n    if ([self shouldReloadImageSourceAfterResize]) {\n      _needsReload = YES;\n    }\n  }\n}\n\n\n- (void)cancelImageLoad\n{\n  RCTImageLoaderCancellationBlock previousCancellationBlock = _reloadImageCancellationBlock;\n  if (previousCancellationBlock) {\n    previousCancellationBlock();\n    _reloadImageCancellationBlock = nil;\n  }\n\n  _pendingImageSource = nil;\n}\n\n- (void)clearImage\n{\n  [self cancelImageLoad];\n  [self.layer removeAnimationForKey:@\"contents\"];\n  self.image = nil;\n  _imageSource = nil;\n}\n\n- (void)clearImageIfDetached\n{\n  if (!self.window) {\n    [self clearImage];\n  }\n}\n\n- (BOOL)hasMultipleSources\n{\n  return _imageSources.count > 1;\n}\n\n- (RCTImageSource *)imageSourceForSize:(CGSize)size\n{\n  if (![self hasMultipleSources]) {\n    return _imageSources.firstObject;\n  }\n\n  // Need to wait for layout pass before deciding.\n  if (CGSizeEqualToSize(size, CGSizeZero)) {\n    return nil;\n  }\n\n  const CGFloat scale = RCTScreenScale();\n  const CGFloat targetImagePixels = size.width * size.height * scale * scale;\n\n  RCTImageSource *bestSource = nil;\n  CGFloat bestFit = CGFLOAT_MAX;\n  for (RCTImageSource *source in _imageSources) {\n    CGSize imgSize = source.size;\n    const CGFloat imagePixels =\n      imgSize.width * imgSize.height * source.scale * source.scale;\n    const CGFloat fit = ABS(1 - (imagePixels / targetImagePixels));\n\n    if (fit < bestFit) {\n      bestFit = fit;\n      bestSource = source;\n    }\n  }\n  return bestSource;\n}\n\n- (BOOL)shouldReloadImageSourceAfterResize\n{\n  // If capInsets are set, image doesn't need reloading when resized\n  return UIEdgeInsetsEqualToEdgeInsets(_capInsets, NSEdgeInsetsZero);\n}\n\n- (BOOL)shouldChangeImageSource\n{\n  // We need to reload if the desired image source is different from the current image\n  // source AND the image load that's pending\n  RCTImageSource *desiredImageSource = [self imageSourceForSize:self.frame.size];\n  return ![desiredImageSource isEqual:_imageSource] &&\n         ![desiredImageSource isEqual:_pendingImageSource];\n}\n\n- (void)reloadImage\n{\n  [self cancelImageLoad];\n  _needsReload = NO;\n\n  RCTImageSource *source = [self imageSourceForSize:self.frame.size];\n  _pendingImageSource = source;\n\n  if (source && self.frame.size.width > 0 && self.frame.size.height > 0) {\n    if (_onLoadStart) {\n      _onLoadStart(nil);\n    }\n\n    RCTImageLoaderProgressBlock progressHandler = nil;\n    if (_onProgress) {\n      progressHandler = ^(int64_t loaded, int64_t total) {\n        self->_onProgress(@{\n          @\"loaded\": @((double)loaded),\n          @\"total\": @((double)total),\n        });\n      };\n    }\n\n    __weak RCTImageView *weakSelf = self;\n    RCTImageLoaderPartialLoadBlock partialLoadHandler = ^(NSImage *image) {\n      [weakSelf imageLoaderLoadedImage:image error:nil forImageSource:source partial:YES];\n    };\n\n    CGSize imageSize = self.bounds.size;\n    CGFloat imageScale = RCTScreenScale();\n    if (!UIEdgeInsetsEqualToEdgeInsets(_capInsets, NSEdgeInsetsZero)) {\n      // Don't resize images that use capInsets\n      imageSize = CGSizeZero;\n      imageScale = source.scale;\n    }\n\n    RCTImageLoaderCompletionBlock completionHandler = ^(NSError *error, NSImage *loadedImage) {\n      [weakSelf imageLoaderLoadedImage:loadedImage error:error forImageSource:source partial:NO];\n    };\n\n    _reloadImageCancellationBlock =\n    [_bridge.imageLoader loadImageWithURLRequest:source.request\n                                            size:imageSize\n                                           scale:imageScale\n                                         clipped:NO\n                                      resizeMode:_resizeMode\n                                   progressBlock:progressHandler\n                                partialLoadBlock:partialLoadHandler\n                                 completionBlock:completionHandler];\n  } else {\n    [self clearImage];\n  }\n}\n\n- (void)imageLoaderLoadedImage:(NSImage *)loadedImage error:(NSError *)error forImageSource:(RCTImageSource *)source partial:(BOOL)isPartialLoad\n{\n  if (![source isEqual:_pendingImageSource]) {\n    // Bail out if source has changed since we started loading\n    return;\n  }\n\n  if (error) {\n    if (_onError) {\n      _onError(@{ @\"error\": error.localizedDescription });\n    }\n    if (_onLoadEnd) {\n      _onLoadEnd(nil);\n    }\n    return;\n  }\n\n  void (^setImageBlock)(NSImage *) = ^(NSImage *image) {\n    if (!isPartialLoad) {\n      self->_imageSource = source;\n      self->_pendingImageSource = nil;\n    }\n\n    if (image.reactKeyframeAnimation) {\n      [self.layer addAnimation:image.reactKeyframeAnimation forKey:@\"contents\"];\n    } else {\n      [self.layer removeAnimationForKey:@\"contents\"];\n      self.image = image;\n    }\n\n    if (isPartialLoad) {\n      if (self->_onPartialLoad) {\n        self->_onPartialLoad(nil);\n      }\n    } else {\n      if (self->_onLoad) {\n        RCTImageSource *sourceLoaded = [source imageSourceWithSize:image.size scale:source.scale];\n        self->_onLoad(onLoadParamsForSource(sourceLoaded));\n      }\n      if (self->_onLoadEnd) {\n        self->_onLoadEnd(nil);\n      }\n    }\n  };\n\n  if (_blurRadius > __FLT_EPSILON__) {\n    // Blur on a background thread to avoid blocking interaction\n    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n      NSImage *blurredImage = RCTBlurredImageWithRadius(loadedImage, self->_blurRadius);\n      RCTExecuteOnMainQueue(^{\n        setImageBlock(blurredImage);\n      });\n    });\n  } else {\n    // No blur, so try to set the image on the main thread synchronously to minimize image\n    // flashing. (For instance, if this view gets attached to a window, then -didMoveToWindow\n    // calls -reloadImage, and we want to set the image synchronously if possible so that the\n    // image property is set in the same CATransaction that attaches this view to the window.)\n    RCTExecuteOnMainQueue(^{\n      setImageBlock(loadedImage);\n    });\n  }\n}\n\n- (void)reactSetFrame:(CGRect)frame\n{\n  [super reactSetFrame:frame];\n\n  // If we didn't load an image yet, or the new frame triggers a different image source\n  // to be loaded, reload to swap to the proper image source.\n  if ([self shouldChangeImageSource]) {\n    _targetSize = frame.size;\n    [self reloadImage];\n  } else if ([self shouldReloadImageSourceAfterResize]) {\n    CGSize imageSize = self.image.size;\n    CGFloat imageScale = RCTScreenScale();\n    CGSize idealSize = RCTTargetSize(imageSize, imageScale, frame.size, RCTScreenScale(),\n                                     self.resizeMode, YES);\n\n    // Don't reload if the current image or target image size is close enough\n    if (!RCTShouldReloadImageForSizeChange(imageSize, idealSize) ||\n        !RCTShouldReloadImageForSizeChange(_targetSize, idealSize)) {\n      return;\n    }\n\n    // Don't reload if the current image size is the maximum size of the image source\n    CGSize imageSourceSize = _imageSource.size;\n    if (imageSize.width * imageScale == imageSourceSize.width * _imageSource.scale &&\n        imageSize.height * imageScale == imageSourceSize.height * _imageSource.scale) {\n      return;\n    }\n\n    RCTLogInfo(@\"Reloading image %@ as size %@\", _imageSource.request.URL.absoluteString, NSStringFromSize(idealSize));\n\n    // If the existing image or an image being loaded are not the right\n    // size, reload the asset in case there is a better size available.\n    _targetSize = idealSize;\n    [self reloadImage];\n  }\n}\n\n- (void)didSetProps:(NSArray<NSString *> *)changedProps\n{\n  if (_needsReload) {\n    [self reloadImage];\n  }\n}\n\n- (void)viewDidMoveToWindow\n{\n  [super viewDidMoveToWindow];\n\n  if (!self.window) {\n    // Cancel loading the image if we've moved offscreen. In addition to helping\n    // prioritise image requests that are actually on-screen, this removes\n    // requests that have gotten \"stuck\" from the queue, unblocking other images\n    // from loading.\n    [self cancelImageLoad];\n  } else if ([self shouldChangeImageSource]) {\n    [self reloadImage];\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTImageViewManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTImageViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTImageViewManager.h\"\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTConvert.h>\n\n#import \"RCTImageLoader.h\"\n#import \"RCTImageShadowView.h\"\n#import \"RCTImageView.h\"\n\n@implementation RCTImageViewManager\n\nRCT_EXPORT_MODULE()\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTImageShadowView new];\n}\n\n- (NSView *)view\n{\n  return [[RCTImageView alloc] initWithBridge:self.bridge];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(capInsets, MSEdgeInsets)\nRCT_REMAP_VIEW_PROPERTY(defaultSource, defaultImage, NSImage)\nRCT_EXPORT_VIEW_PROPERTY(resizeMode, RCTResizeMode)\nRCT_EXPORT_VIEW_PROPERTY(blurRadius, CGFloat)\nRCT_EXPORT_VIEW_PROPERTY(onLoadStart, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onProgress, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onError, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onPartialLoad, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onLoad, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onLoadEnd, RCTDirectEventBlock)\nRCT_REMAP_VIEW_PROPERTY(source, imageSources, NSArray<RCTImageSource *>);\nRCT_CUSTOM_VIEW_PROPERTY(tintColor, NSColor, RCTImageView)\n{\n  // Default tintColor isn't nil - it's inherited from the superView - but we\n  // want to treat a null json value for `tintColor` as meaning 'disable tint',\n  // so we toggle `renderingMode` here instead of in `-[RCTImageView setTintColor:]`\n  // TODO: tintColor\n  //view.tintColor = [RCTConvert NSColor:json] ?: defaultView.tintColor;\n  //view.renderingMode = json ? UIImageRenderingModeAlwaysTemplate : defaultView.renderingMode;\n}\n\nRCT_EXPORT_METHOD(getSize:(NSURLRequest *)request\n                  successBlock:(RCTResponseSenderBlock)successBlock\n                  errorBlock:(RCTResponseErrorBlock)errorBlock)\n{\n  [self.bridge.imageLoader getImageSizeForURLRequest:request\n                                               block:^(NSError *error, CGSize size) {\n                                                 if (error) {\n                                                   errorBlock(error);\n                                                 } else {\n                                                   successBlock(@[@(size.width), @(size.height)]);\n                                                 }\n                                               }];\n}\n\nRCT_EXPORT_METHOD(prefetchImage:(NSURLRequest *)request\n                  resolve:(RCTPromiseResolveBlock)resolve\n                  reject:(RCTPromiseRejectBlock)reject)\n{\n  if (!request) {\n    reject(@\"E_INVALID_URI\", @\"Cannot prefetch an image for an empty URI\", nil);\n    return;\n  }\n\n  [self.bridge.imageLoader loadImageWithURLRequest:request\n                                          callback:^(NSError *error, NSImage *image) {\n                                            if (error) {\n                                              reject(@\"E_PREFETCH_FAILURE\", nil, error);\n                                              return;\n                                            }\n                                            resolve(@YES);\n                                          }];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTLocalAssetImageLoader.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTImageLoader.h>\n\n@interface RCTLocalAssetImageLoader : NSObject <RCTImageURLLoader>\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTLocalAssetImageLoader.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTLocalAssetImageLoader.h\"\n\n#import <stdatomic.h>\n\n#import <React/RCTUtils.h>\n\n@implementation RCTLocalAssetImageLoader\n\nRCT_EXPORT_MODULE()\n\n- (BOOL)canLoadImageURL:(NSURL *)requestURL\n{\n  return RCTIsLocalAssetURL(requestURL);\n}\n\n- (BOOL)requiresScheduling\n{\n  // Don't schedule this loader on the URL queue so we can load the\n  // local assets synchronously to avoid flickers.\n  return NO;\n}\n\n- (BOOL)shouldCacheLoadedImages\n{\n  // UIImage imageNamed handles the caching automatically so we don't want\n  // to add it to the image cache.\n  return NO;\n}\n\n - (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL\n                                               size:(CGSize)size\n                                              scale:(CGFloat)scale\n                                         resizeMode:(RCTResizeMode)resizeMode\n                                    progressHandler:(RCTImageLoaderProgressBlock)progressHandler\n                                 partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler\n                                  completionHandler:(RCTImageLoaderCompletionBlock)completionHandler\n{\n  __block atomic_bool cancelled = ATOMIC_VAR_INIT(NO);\n  RCTExecuteOnMainQueue(^{\n    if (atomic_load(&cancelled)) {\n      return;\n    }\n\n    NSImage *image = RCTImageFromLocalAssetURL(imageURL);\n    if (image) {\n      if (progressHandler) {\n        progressHandler(1, 1);\n      }\n      completionHandler(nil, image);\n    } else {\n      NSString *message = [NSString stringWithFormat:@\"Could not find image %@\", imageURL];\n      RCTLogWarn(@\"%@\", message);\n      completionHandler(RCTErrorWithMessage(message), nil);\n    }\n  });\n\n  return ^{\n    atomic_store(&cancelled, YES);\n  };\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTResizeMode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTConvert.h>\n\ntypedef NS_ENUM(NSInteger, RCTResizeMode) {\n  RCTResizeModeContain = 0,\n  RCTResizeModeCover = 1,\n  RCTResizeModeStretch = 2,\n  RCTResizeModeCenter = 3,\n  RCTResizeModeRepeat = -1,\n};\n\n@interface RCTConvert(RCTResizeMode)\n\n+ (RCTResizeMode)RCTResizeMode:(id)json;\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RCTResizeMode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTResizeMode.h\"\n\n@implementation RCTConvert(RCTResizeMode)\n\nRCT_ENUM_CONVERTER(RCTResizeMode, (@{\n  @\"cover\": @(RCTResizeModeCover),\n  @\"contain\": @(RCTResizeModeContain),\n  @\"stretch\": @(RCTResizeModeStretch),\n  @\"center\": @(RCTResizeModeCenter),\n  @\"repeat\": @(RCTResizeModeRepeat),\n}), RCTResizeModeContain, integerValue)\n\n@end\n"
  },
  {
    "path": "Libraries/Image/RelativeImageStub.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RelativeImageStub\n * @flow\n */\n'use strict';\n\n// This is a stub for flow to make it understand require('./icon.png')\n// See metro/src/Bundler/index.js\n\nvar AssetRegistry = require('AssetRegistry');\n\nmodule.exports = AssetRegistry.registerAsset({\n  __packager_asset: true,\n  fileSystemLocation: '/full/path/to/directory',\n  httpServerLocation: '/assets/full/path/to/directory',\n  width: 100,\n  height: 100,\n  scales: [1, 2, 3],\n  hash: 'nonsense',\n  name: 'icon',\n  type: 'png',\n});\n"
  },
  {
    "path": "Libraries/Image/__tests__/__snapshots__/assetRelativePathInSnapshot.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`renders assets based on relative path 1`] = `\n<View>\n  <Image\n    source={\n      Object {\n        \"testUri\": \"../Libraries/Image/__tests__/img/img1.png\",\n      }\n    }\n  />\n  <Image\n    source={\n      Object {\n        \"testUri\": \"../Libraries/Image/__tests__/img/img2.png\",\n      }\n    }\n  />\n</View>\n`;\n"
  },
  {
    "path": "Libraries/Image/__tests__/assetRelativePathInSnapshot.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\njest.disableAutomock();\n\nconst React = require('React');\nconst ReactTestRenderer = require('react-test-renderer');\nconst Image = require('Image');\nconst View = require('View');\n\nit('renders assets based on relative path', () => {\n  expect(ReactTestRenderer.create(\n  <View>\n    <Image source={require('./img/img1.png')} />\n    <Image source={require('./img/img2.png')} />\n  </View>\n  )).toMatchSnapshot();\n});\n"
  },
  {
    "path": "Libraries/Image/__tests__/resolveAssetSource-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nvar AssetRegistry = require('AssetRegistry');\nvar Platform = require('Platform');\nvar NativeModules = require('NativeModules');\nvar resolveAssetSource = require('../resolveAssetSource');\n\nfunction expectResolvesAsset(input, expectedSource) {\n  var assetId = AssetRegistry.registerAsset(input);\n  expect(resolveAssetSource(assetId)).toEqual(expectedSource);\n}\n\ndescribe('resolveAssetSource', () => {\n  beforeEach(() => {\n    jest.resetModules();\n  });\n\n  it('returns same source for simple static and network images', () => {\n    var source1 = {uri: 'https://www.facebook.com/logo'};\n    expect(resolveAssetSource(source1)).toBe(source1);\n\n    var source2 = {uri: 'logo'};\n    expect(resolveAssetSource(source2)).toBe(source2);\n  });\n\n  it('does not change deprecated assets', () => {\n    expect(resolveAssetSource({\n      deprecated: true,\n      width: 100,\n      height: 200,\n      uri: 'logo',\n    })).toEqual({\n      deprecated: true,\n      width: 100,\n      height: 200,\n      uri: 'logo',\n    });\n  });\n\n  it('ignores any weird data', () => {\n    expect(resolveAssetSource(null)).toBe(null);\n    expect(resolveAssetSource(42)).toBe(null);\n    expect(resolveAssetSource('nonsense')).toBe(null);\n  });\n\n  describe('bundle was loaded from network (DEV)', () => {\n    beforeEach(() => {\n      NativeModules.SourceCode.scriptURL =\n        'http://10.0.0.1:8081/main.bundle';\n      Platform.OS = 'ios';\n    });\n\n    it('uses network image', () => {\n      expectResolvesAsset({\n        __packager_asset: true,\n        fileSystemLocation: '/root/app/module/a',\n        httpServerLocation: '/assets/module/a',\n        width: 100,\n        height: 200,\n        scales: [1],\n        hash: '5b6f00f',\n        name: 'logo',\n        type: 'png',\n      }, {\n        __packager_asset: true,\n        width: 100,\n        height: 200,\n        uri: 'http://10.0.0.1:8081/assets/module/a/logo.png?platform=ios&hash=5b6f00f',\n        scale: 1,\n      });\n    });\n\n    it('picks matching scale', () => {\n      expectResolvesAsset({\n        __packager_asset: true,\n        fileSystemLocation: '/root/app/module/a',\n        httpServerLocation: '/assets/module/a',\n        width: 100,\n        height: 200,\n        scales: [1, 2, 3],\n        hash: '5b6f00f',\n        name: 'logo',\n        type: 'png',\n      }, {\n        __packager_asset: true,\n        width: 100,\n        height: 200,\n        uri: 'http://10.0.0.1:8081/assets/module/a/logo@2x.png?platform=ios&hash=5b6f00f',\n        scale: 2,\n      });\n    });\n\n  });\n\n  describe('bundle was loaded from file on iOS', () => {\n    beforeEach(() => {\n      NativeModules.SourceCode.scriptURL =\n        'file:///Path/To/Sample.app/main.bundle';\n      Platform.OS = 'ios';\n    });\n\n    it('uses pre-packed image', () => {\n      expectResolvesAsset({\n        __packager_asset: true,\n        fileSystemLocation: '/root/app/module/a',\n        httpServerLocation: '/assets/module/a',\n        width: 100,\n        height: 200,\n        scales: [1],\n        hash: '5b6f00f',\n        name: 'logo',\n        type: 'png',\n      }, {\n        __packager_asset: true,\n        width: 100,\n        height: 200,\n        uri: 'file:///Path/To/Sample.app/assets/module/a/logo.png',\n        scale: 1,\n      });\n    });\n  });\n\n  describe('bundle was loaded from assets on Android', () => {\n    beforeEach(() => {\n      NativeModules.SourceCode.scriptURL =\n        'assets://Path/To/Simulator/main.bundle';\n      Platform.OS = 'android';\n    });\n\n    it('uses pre-packed image', () => {\n      expectResolvesAsset({\n        __packager_asset: true,\n        fileSystemLocation: '/root/app/module/a',\n        httpServerLocation: '/assets/AwesomeModule/Subdir',\n        width: 100,\n        height: 200,\n        scales: [1],\n        hash: '5b6f00f',\n        name: '!@Logo#1_\\u20ac', // Invalid chars shouldn't get passed to native\n        type: 'png',\n      }, {\n        __packager_asset: true,\n        width: 100,\n        height: 200,\n        uri: 'awesomemodule_subdir_logo1_',\n        scale: 1,\n      });\n    });\n  });\n\n  describe('bundle was loaded from file on Android', () => {\n    beforeEach(() => {\n      NativeModules.SourceCode.scriptURL =\n        'file:///sdcard/Path/To/Simulator/main.bundle';\n      Platform.OS = 'android';\n    });\n\n    it('uses pre-packed image', () => {\n      expectResolvesAsset({\n        __packager_asset: true,\n        fileSystemLocation: '/root/app/module/a',\n        httpServerLocation: '/assets/AwesomeModule/Subdir',\n        width: 100,\n        height: 200,\n        scales: [1],\n        hash: '5b6f00f',\n        name: '!@Logo#1_\\u20ac',\n        type: 'png',\n      }, {\n        __packager_asset: true,\n        width: 100,\n        height: 200,\n        uri: 'file:///sdcard/Path/To/Simulator/drawable-mdpi/awesomemodule_subdir_logo1_.png',\n        scale: 1,\n      });\n    });\n  });\n\n  describe('bundle was loaded from file on Android', () => {\n    beforeEach(() => {\n      NativeModules.SourceCode.scriptURL =\n        'file:///sdcard/Path/To/Simulator/main.bundle';\n      Platform.OS = 'android';\n    });\n\n    it('uses pre-packed image', () => {\n      expectResolvesAsset({\n        __packager_asset: true,\n        fileSystemLocation: '/root/app/module/a',\n        httpServerLocation: '/assets/AwesomeModule/Subdir',\n        width: 100,\n        height: 200,\n        scales: [1],\n        hash: '5b6f00f',\n        name: '!@Logo#1_€',\n        type: 'png',\n      }, {\n        __packager_asset: true,\n        width: 100,\n        height: 200,\n        uri: 'file:///sdcard/Path/To/Simulator/drawable-mdpi/awesomemodule_subdir_logo1_.png',\n        scale: 1,\n      });\n    });\n  });\n\n  describe('bundle was loaded from raw file on Android', () => {\n    beforeEach(() => {\n      NativeModules.SourceCode.scriptURL =\n        '/sdcard/Path/To/Simulator/main.bundle';\n      Platform.OS = 'android';\n    });\n\n    it('uses sideloaded image', () => {\n      expectResolvesAsset({\n        __packager_asset: true,\n        fileSystemLocation: '/root/app/module/a',\n        httpServerLocation: '/assets/AwesomeModule/Subdir',\n        width: 100,\n        height: 200,\n        scales: [1],\n        hash: '5b6f00f',\n        name: '!@Logo#1_\\u20ac',\n        type: 'png',\n      }, {\n        __packager_asset: true,\n        width: 100,\n        height: 200,\n        uri: 'file:///sdcard/Path/To/Simulator/drawable-mdpi/awesomemodule_subdir_logo1_.png',\n        scale: 1,\n      });\n    });\n  });\n\n  describe('source resolver can be customized', () => {\n    beforeEach(() => {\n      NativeModules.SourceCode.scriptURL =\n        'file:///sdcard/Path/To/Simulator/main.bundle';\n      Platform.OS = 'android';\n    });\n\n    it('uses bundled source, event when js is sideloaded', () => {\n      resolveAssetSource.setCustomSourceTransformer(\n        (resolver) => resolver.resourceIdentifierWithoutScale(),\n      );\n      expectResolvesAsset({\n        __packager_asset: true,\n        fileSystemLocation: '/root/app/module/a',\n        httpServerLocation: '/assets/AwesomeModule/Subdir',\n        width: 100,\n        height: 200,\n        scales: [1],\n        hash: '5b6f00f',\n        name: '!@Logo#1_\\u20ac',\n        type: 'png',\n      }, {\n        __packager_asset: true,\n        width: 100,\n        height: 200,\n        uri: 'awesomemodule_subdir_logo1_',\n        scale: 1,\n      });\n    });\n\n    it('allows any customization', () => {\n      resolveAssetSource.setCustomSourceTransformer(\n        (resolver) => resolver.fromSource('TEST')\n      );\n      expectResolvesAsset({\n        __packager_asset: true,\n        fileSystemLocation: '/root/app/module/a',\n        httpServerLocation: '/assets/AwesomeModule/Subdir',\n        width: 100,\n        height: 200,\n        scales: [1],\n        hash: '5b6f00f',\n        name: '!@Logo#1_\\u20ac',\n        type: 'png',\n      }, {\n        __packager_asset: true,\n        width: 100,\n        height: 200,\n        uri: 'TEST',\n        scale: 1,\n      });\n    });\n  });\n\n});\n\ndescribe('resolveAssetSource.pickScale', () => {\n  it('picks matching scale', () => {\n    expect(resolveAssetSource.pickScale([1], 2)).toBe(1);\n    expect(resolveAssetSource.pickScale([1, 2, 3], 2)).toBe(2);\n    expect(resolveAssetSource.pickScale([1, 2], 3)).toBe(2);\n    expect(resolveAssetSource.pickScale([1, 2, 3, 4], 3.5)).toBe(4);\n    expect(resolveAssetSource.pickScale([3, 4], 2)).toBe(3);\n    expect(resolveAssetSource.pickScale([], 2)).toBe(1);\n  });\n});\n"
  },
  {
    "path": "Libraries/Image/nativeImageSource.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule nativeImageSource\n * @flow\n */\n'use strict';\n\nconst Platform = require('Platform');\n\ntype SourceSpec = {\n  ios?: string,\n  android?: string,\n\n  // For more details on width and height, see\n  // http://facebook.github.io/react-native/docs/images.html#why-not-automatically-size-everything\n  width: number,\n  height: number,\n}\n\n/**\n * In hybrid apps, use `nativeImageSource` to access images that are already available\n * on the native side, for example in Xcode Asset Catalogs or Android's drawable folder.\n *\n * However, keep in mind that React Native Packager does not guarantee that the image exists. If\n * the image is missing you'll get an empty box. When adding new images your app needs to be\n * recompiled.\n *\n * Prefer Static Image Resources system which provides more guarantees, automates measurements and\n * allows adding new images without rebuilding the native app. For more details visit:\n *\n *   http://facebook.github.io/react-native/docs/images.html\n *\n */\nfunction nativeImageSource(spec: SourceSpec): Object {\n  const uri = Platform.select(spec);\n  if (!uri) {\n    console.warn(`No image name given for ${Platform.OS}: ${JSON.stringify(spec)}`);\n  }\n\n  return {\n    uri,\n    width: spec.width,\n    height: spec.height,\n    deprecated: true,\n  };\n}\n\nmodule.exports = nativeImageSource;\n"
  },
  {
    "path": "Libraries/Image/resolveAssetSource.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule resolveAssetSource\n * @flow\n *\n * Resolves an asset into a `source` for `Image`.\n */\n'use strict';\n\nconst AssetRegistry = require('AssetRegistry');\nconst AssetSourceResolver = require('AssetSourceResolver');\nconst NativeModules = require('NativeModules');\n\nimport type { ResolvedAssetSource } from 'AssetSourceResolver';\n\nlet _customSourceTransformer, _serverURL, _scriptURL;\n\nfunction getDevServerURL(): ?string {\n  if (_serverURL === undefined) {\n    var scriptURL = NativeModules.SourceCode.scriptURL;\n    var match = scriptURL && scriptURL.match(/^https?:\\/\\/.*?\\//);\n    if (match) {\n      // jsBundle was loaded from network\n      _serverURL = match[0];\n    } else {\n      // jsBundle was loaded from file\n      _serverURL = null;\n    }\n  }\n  return _serverURL;\n}\n\nfunction _coerceLocalScriptURL(scriptURL: ?string): ?string {\n  if (scriptURL) {\n    if (scriptURL.startsWith('assets://')) {\n      // android: running from within assets, no offline path to use\n      return null;\n    }\n    scriptURL = scriptURL.substring(0, scriptURL.lastIndexOf('/') + 1);\n    if (!scriptURL.includes('://')) {\n      // Add file protocol in case we have an absolute file path and not a URL.\n      // This shouldn't really be necessary. scriptURL should be a URL.\n      scriptURL = 'file://' + scriptURL;\n    }\n  }\n  return scriptURL;\n}\n\nfunction getScriptURL(): ?string {\n  if (_scriptURL === undefined) {\n    const scriptURL = NativeModules.SourceCode.scriptURL;\n    _scriptURL = _coerceLocalScriptURL(scriptURL);\n  }\n  return _scriptURL;\n}\n\nfunction setCustomSourceTransformer(\n  transformer: (resolver: AssetSourceResolver) => ResolvedAssetSource,\n): void {\n  _customSourceTransformer = transformer;\n}\n\n/**\n * `source` is either a number (opaque type returned by require('./foo.png'))\n * or an `ImageSource` like { uri: '<http location || file path>' }\n */\nfunction resolveAssetSource(source: any): ?ResolvedAssetSource {\n  if (typeof source === 'object') {\n    return source;\n  }\n\n  var asset = AssetRegistry.getAssetByID(source);\n  if (!asset) {\n    return null;\n  }\n\n  const resolver = new AssetSourceResolver(\n    getDevServerURL(),\n    getScriptURL(),\n    asset,\n  );\n  if (_customSourceTransformer) {\n    return _customSourceTransformer(resolver);\n  }\n  return resolver.defaultAsset();\n}\n\nmodule.exports = resolveAssetSource;\nmodule.exports.pickScale = AssetSourceResolver.pickScale;\nmodule.exports.setCustomSourceTransformer = setCustomSourceTransformer;\n"
  },
  {
    "path": "Libraries/Inspector/BorderBox.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BorderBox\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar View = require('View');\n\nclass BorderBox extends React.Component<$FlowFixMeProps> {\n  render() {\n    var box = this.props.box;\n    if (!box) {\n      return this.props.children;\n    }\n    var style = {\n      borderTopWidth: box.top,\n      borderBottomWidth: box.bottom,\n      borderLeftWidth: box.left,\n      borderRightWidth: box.right,\n    };\n    return (\n      <View style={[style, this.props.style]}>\n        {this.props.children}\n      </View>\n    );\n  }\n}\n\nmodule.exports = BorderBox;\n\n"
  },
  {
    "path": "Libraries/Inspector/BoxInspector.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BoxInspector\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar Text = require('Text');\nvar View = require('View');\nvar resolveBoxStyle = require('resolveBoxStyle');\n\nvar blank = {\n  top: 0,\n  left: 0,\n  right: 0,\n  bottom: 0,\n};\n\nclass BoxInspector extends React.Component<$FlowFixMeProps> {\n  render() {\n    var frame = this.props.frame;\n    var style = this.props.style;\n    var margin = style && resolveBoxStyle('margin', style) || blank;\n    var padding = style && resolveBoxStyle('padding', style) || blank;\n    return (\n      <BoxContainer title=\"margin\" titleStyle={styles.marginLabel} box={margin}>\n        <BoxContainer title=\"padding\" box={padding}>\n          <View>\n            <Text style={styles.innerText}>\n              ({(frame.left || 0).toFixed(1)}, {(frame.top || 0).toFixed(1)})\n            </Text>\n            <Text style={styles.innerText}>\n              {(frame.width || 0).toFixed(1)} &times; {(frame.height || 0).toFixed(1)}\n            </Text>\n          </View>\n        </BoxContainer>\n      </BoxContainer>\n    );\n  }\n}\n\nclass BoxContainer extends React.Component<$FlowFixMeProps> {\n  render() {\n    var box = this.props.box;\n    return (\n      <View style={styles.box}>\n        <View style={styles.row}>\n          {\n            }\n          <Text style={[this.props.titleStyle, styles.label]}>{this.props.title}</Text>\n          <Text style={styles.boxText}>{box.top}</Text>\n        </View>\n        <View style={styles.row}>\n          <Text style={styles.boxText}>{box.left}</Text>\n          {this.props.children}\n          <Text style={styles.boxText}>{box.right}</Text>\n        </View>\n        <Text style={styles.boxText}>{box.bottom}</Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  row: {\n    flexDirection: 'row',\n    alignItems: 'center',\n    justifyContent: 'space-around',\n  },\n  marginLabel: {\n    width: 60,\n  },\n  label: {\n    fontSize: 10,\n    color: 'rgb(255,100,0)',\n    marginLeft: 5,\n    flex: 1,\n    textAlign: 'left',\n    top: -3,\n  },\n  buffer: {\n    fontSize: 10,\n    color: 'yellow',\n    flex: 1,\n    textAlign: 'center',\n  },\n  innerText: {\n    color: 'yellow',\n    fontSize: 12,\n    textAlign: 'center',\n    width: 70,\n  },\n  box: {\n    borderWidth: 1,\n    borderColor: 'grey',\n  },\n  boxText: {\n    color: 'white',\n    fontSize: 12,\n    marginHorizontal: 3,\n    marginVertical: 2,\n    textAlign: 'center',\n  },\n});\n\nmodule.exports = BoxInspector;\n"
  },
  {
    "path": "Libraries/Inspector/ElementBox.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ElementBox\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar View = require('View');\nvar StyleSheet = require('StyleSheet');\nvar BorderBox = require('BorderBox');\nvar resolveBoxStyle = require('resolveBoxStyle');\n\nvar flattenStyle = require('flattenStyle');\n\nclass ElementBox extends React.Component<$FlowFixMeProps> {\n  render() {\n    var style = flattenStyle(this.props.style) || {};\n    var margin = resolveBoxStyle('margin', style);\n    var padding = resolveBoxStyle('padding', style);\n    var frameStyle = this.props.frame;\n    if (margin) {\n      frameStyle = {\n        top: frameStyle.top - margin.top,\n        left: frameStyle.left - margin.left,\n        height: frameStyle.height + margin.top + margin.bottom,\n        width: frameStyle.width + margin.left + margin.right,\n      };\n    }\n    var contentStyle = {\n      width: this.props.frame.width,\n      height: this.props.frame.height,\n    };\n    if (padding) {\n      contentStyle = {\n        width: contentStyle.width - padding.left - padding.right,\n        height: contentStyle.height - padding.top - padding.bottom,\n      };\n    }\n    return (\n      <View style={[styles.frame, frameStyle]} pointerEvents=\"none\">\n        <BorderBox box={margin} style={styles.margin}>\n          <BorderBox box={padding} style={styles.padding}>\n            <View style={[styles.content, contentStyle]} />\n          </BorderBox>\n        </BorderBox>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  frame: {\n    position: 'absolute',\n  },\n  content: {\n    backgroundColor: 'rgba(200, 230, 255, 0.8)',\n  },\n  padding: {\n    borderColor: 'rgba(77, 255, 0, 0.3)',\n  },\n  margin: {\n    borderColor: 'rgba(255, 132, 0, 0.3)',\n  },\n});\n\nmodule.exports = ElementBox;\n\n"
  },
  {
    "path": "Libraries/Inspector/ElementProperties.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ElementProperties\n * @flow\n */\n'use strict';\n\nconst BoxInspector = require('BoxInspector');\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst StyleInspector = require('StyleInspector');\nconst StyleSheet = require('StyleSheet');\nconst Text = require('Text');\nconst TouchableHighlight = require('TouchableHighlight');\nconst TouchableWithoutFeedback = require('TouchableWithoutFeedback');\nconst View = require('View');\n\nconst flattenStyle = require('flattenStyle');\nconst mapWithSeparator = require('mapWithSeparator');\nconst openFileInEditor = require('openFileInEditor');\n\nimport type {StyleObj} from 'StyleSheetTypes';\n\nclass ElementProperties extends React.Component<{\n  hierarchy: Array<$FlowFixMe>,\n  style?: StyleObj,\n  source?: {\n    fileName?: string,\n    lineNumber?: number,\n  },\n}> {\n  static propTypes = {\n    hierarchy: PropTypes.array.isRequired,\n    style: PropTypes.oneOfType([\n      PropTypes.object,\n      PropTypes.array,\n      PropTypes.number,\n    ]),\n    source: PropTypes.shape({\n      fileName: PropTypes.string,\n      lineNumber: PropTypes.number,\n    }),\n  };\n\n  render() {\n    const style = flattenStyle(this.props.style);\n    // $FlowFixMe found when converting React.createClass to ES6\n    const selection = this.props.selection;\n    let openFileButton;\n    const source = this.props.source;\n    const {fileName, lineNumber} = source || {};\n    if (fileName && lineNumber) {\n      const parts = fileName.split('/');\n      const fileNameShort = parts[parts.length - 1];\n      openFileButton = (\n        <TouchableHighlight\n          style={styles.openButton}\n          onPress={openFileInEditor.bind(null, fileName, lineNumber)}>\n          <Text style={styles.openButtonTitle} numberOfLines={1}>\n            {fileNameShort}:{lineNumber}\n          </Text>\n        </TouchableHighlight>\n      );\n    }\n    // Without the `TouchableWithoutFeedback`, taps on this inspector pane\n    // would change the inspected element to whatever is under the inspector\n    return (\n      <TouchableWithoutFeedback>\n        <View style={styles.info}>\n          <View style={styles.breadcrumb}>\n            {mapWithSeparator(\n              this.props.hierarchy,\n              (hierarchyItem, i) => (\n                <TouchableHighlight\n                  key={'item-' + i}\n                  style={[styles.breadItem, i === selection && styles.selected]}\n                  // $FlowFixMe found when converting React.createClass to ES6\n                  onPress={() => this.props.setSelection(i)}>\n                  <Text style={styles.breadItemText}>\n                    {hierarchyItem.name}\n                  </Text>\n                </TouchableHighlight>\n              ),\n              (i) => (\n                <Text key={'sep-' + i} style={styles.breadSep}>\n                  &#9656;\n                </Text>\n              )\n            )}\n          </View>\n          <View style={styles.row}>\n            <View style={styles.col}>\n              <StyleInspector style={style} />\n              {openFileButton}\n            </View>\n            {\n              // $FlowFixMe found when converting React.createClass to ES6\n            <BoxInspector style={style} frame={this.props.frame} />}\n          </View>\n        </View>\n      </TouchableWithoutFeedback>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  breadSep: {\n    fontSize: 8,\n    color: 'white',\n  },\n  breadcrumb: {\n    flexDirection: 'row',\n    flexWrap: 'wrap',\n    alignItems: 'flex-start',\n    marginBottom: 5,\n  },\n  selected: {\n    borderColor: 'white',\n    borderRadius: 5,\n  },\n  breadItem: {\n    borderWidth: 1,\n    borderColor: 'transparent',\n    marginHorizontal: 2,\n  },\n  breadItemText: {\n    fontSize: 10,\n    color: 'white',\n    marginHorizontal: 5,\n  },\n  row: {\n    flexDirection: 'row',\n    alignItems: 'center',\n    justifyContent: 'space-between',\n  },\n  col: {\n    flex: 1,\n  },\n  info: {\n    padding: 10,\n  },\n  openButton: {\n    padding: 10,\n    backgroundColor: '#000',\n    marginVertical: 5,\n    marginRight: 5,\n    borderRadius: 2,\n  },\n  openButtonTitle: {\n    color: 'white',\n    fontSize: 8,\n  }\n});\n\nmodule.exports = ElementProperties;\n"
  },
  {
    "path": "Libraries/Inspector/Inspector.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Inspector\n * @flow\n */\n\n'use strict';\n\nconst Dimensions = require('Dimensions');\nconst InspectorOverlay = require('InspectorOverlay');\nconst InspectorPanel = require('InspectorPanel');\nconst Platform = require('Platform');\nconst React = require('React');\nconst ReactNative = require('ReactNative');\nconst StyleSheet = require('StyleSheet');\nconst Touchable = require('Touchable');\nconst UIManager = require('UIManager');\nconst View = require('View');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst emptyObject = require('fbjs/lib/emptyObject');\nconst invariant = require('fbjs/lib/invariant');\n\nexport type ReactRenderer = {\n  getInspectorDataForViewTag: (viewTag: number) => Object,\n};\n\nconst hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;\nconst renderer: ReactRenderer = findRenderer();\n// required for devtools to be able to edit react native styles\nhook.resolveRNStyle = require('flattenStyle');\n\nfunction findRenderer(): ReactRenderer {\n  const renderers = hook._renderers;\n  const keys = Object.keys(renderers);\n  invariant(keys.length === 1, 'Expected to find exactly one React Native renderer on DevTools hook.');\n  return renderers[keys[0]];\n}\n\nclass Inspector extends React.Component<{\n  inspectedViewTag: ?number,\n  onRequestRerenderApp: (callback: (tag: ?number) => void) => void\n}, {\n  devtoolsAgent: ?Object,\n  hierarchy: any,\n  panelPos: string,\n  inspecting: bool,\n  selection: ?number,\n  perfing: bool,\n  inspected: any,\n  inspectedViewTag: any,\n  networking: bool,\n}> {\n  _subs: ?Array<() => void>;\n\n  constructor(props: Object) {\n    super(props);\n\n    this.state = {\n      devtoolsAgent: null,\n      hierarchy: null,\n      panelPos: 'bottom',\n      inspecting: true,\n      perfing: false,\n      inspected: null,\n      selection: null,\n      inspectedViewTag: this.props.inspectedViewTag,\n      networking: false,\n    };\n  }\n\n  componentDidMount() {\n    hook.on('react-devtools', this.attachToDevtools);\n    // if devtools is already started\n    if (hook.reactDevtoolsAgent) {\n      this.attachToDevtools(hook.reactDevtoolsAgent);\n    }\n  }\n\n  componentWillUnmount() {\n    if (this._subs) {\n      this._subs.map(fn => fn());\n    }\n    hook.off('react-devtools', this.attachToDevtools);\n  }\n\n  componentWillReceiveProps(newProps: Object) {\n    this.setState({inspectedViewTag: newProps.inspectedViewTag});\n  }\n\n  attachToDevtools = (agent: Object) => {\n    let _hideWait = null;\n    const hlSub = agent.sub('highlight', ({node, name, props}) => {\n      /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n       * error found when Flow v0.63 was deployed. To see the error delete this\n       * comment and run Flow. */\n      clearTimeout(_hideWait);\n\n      if (typeof node !== 'number') {\n        // Fiber\n        node = ReactNative.findNodeHandle(node);\n      }\n\n      UIManager.measure(node, (x, y, width, height, left, top) => {\n        this.setState({\n          hierarchy: [],\n          inspected: {\n            frame: {left, top, width, height},\n            style: props ? props.style : emptyObject,\n          },\n        });\n      });\n    });\n    const hideSub = agent.sub('hideHighlight', () => {\n      if (this.state.inspected === null) {\n        return;\n      }\n      // we wait to actually hide in order to avoid flicker\n      _hideWait = setTimeout(() => {\n        this.setState({\n          inspected: null,\n        });\n      }, 100);\n    });\n    this._subs = [hlSub, hideSub];\n\n    agent.on('shutdown', () => {\n      this.setState({devtoolsAgent: null});\n      this._subs = null;\n    });\n    this.setState({\n      devtoolsAgent: agent,\n    });\n  };\n\n\n  setSelection(i: number) {\n    const hierarchyItem = this.state.hierarchy[i];\n    // we pass in ReactNative.findNodeHandle as the method is injected\n    const {\n      measure,\n      props,\n      source,\n    } = hierarchyItem.getInspectorData(ReactNative.findNodeHandle);\n\n    measure((x, y, width, height, left, top) => {\n      this.setState({\n        inspected: {\n          frame: {left, top, width, height},\n          style: props.style,\n          source,\n        },\n        selection: i,\n      });\n    });\n  }\n\n  onTouchViewTag(touchedViewTag: number, frame: Object, pointerY: number) {\n    // Most likely the touched instance is a native wrapper (like RCTView)\n    // which is not very interesting. Most likely user wants a composite\n    // instance that contains it (like View)\n    const {\n      hierarchy,\n      props,\n      selection,\n      source,\n    } = renderer.getInspectorDataForViewTag(touchedViewTag);\n\n    if (this.state.devtoolsAgent) {\n      // Skip host leafs\n      const offsetFromLeaf = hierarchy.length - 1 - selection;\n      this.state.devtoolsAgent.selectFromDOMNode(touchedViewTag, true, offsetFromLeaf);\n    }\n\n    this.setState({\n      panelPos: pointerY > Dimensions.get('window').height / 2 ? 'top' : 'bottom',\n      selection,\n      hierarchy,\n      inspected: {\n        style: props.style,\n        frame,\n        source,\n      },\n    });\n  }\n\n  setPerfing(val: bool) {\n    this.setState({\n      perfing: val,\n      inspecting: false,\n      inspected: null,\n      networking: false,\n    });\n  }\n\n  setInspecting(val: bool) {\n    this.setState({\n      inspecting: val,\n      inspected: null\n    });\n  }\n\n  setTouchTargetting(val: bool) {\n    Touchable.TOUCH_TARGET_DEBUG = val;\n    this.props.onRequestRerenderApp((inspectedViewTag) => {\n      this.setState({inspectedViewTag});\n    });\n  }\n\n  setNetworking(val: bool) {\n    this.setState({\n      networking: val,\n      perfing: false,\n      inspecting: false,\n      inspected: null,\n    });\n  }\n\n  render() {\n    const panelContainerStyle = (this.state.panelPos === 'bottom') ?\n      {bottom: 0} :\n      {top: Platform.OS === 'ios' ? 20 : 0};\n    return (\n      <View style={styles.container} pointerEvents=\"box-none\">\n        {this.state.inspecting &&\n          <InspectorOverlay\n            inspected={this.state.inspected}\n            inspectedViewTag={this.state.inspectedViewTag}\n            onTouchViewTag={this.onTouchViewTag.bind(this)}\n          />}\n        <View style={[styles.panelContainer, panelContainerStyle]}>\n          <InspectorPanel\n            devtoolsIsOpen={!!this.state.devtoolsAgent}\n            inspecting={this.state.inspecting}\n            perfing={this.state.perfing}\n            setPerfing={this.setPerfing.bind(this)}\n            setInspecting={this.setInspecting.bind(this)}\n            inspected={this.state.inspected}\n            hierarchy={this.state.hierarchy}\n            selection={this.state.selection}\n            setSelection={this.setSelection.bind(this)}\n            touchTargetting={Touchable.TOUCH_TARGET_DEBUG}\n            setTouchTargetting={this.setTouchTargetting.bind(this)}\n            networking={this.state.networking}\n            setNetworking={this.setNetworking.bind(this)}\n          />\n        </View>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    position: 'absolute',\n    backgroundColor: 'transparent',\n    top: 0,\n    left: 0,\n    right: 0,\n    bottom: 0,\n  },\n  panelContainer: {\n    position: 'absolute',\n    left: 0,\n    right: 0,\n  },\n});\n\nmodule.exports = Inspector;\n"
  },
  {
    "path": "Libraries/Inspector/InspectorOverlay.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule InspectorOverlay\n * @flow\n */\n'use strict';\n\nvar Dimensions = require('Dimensions');\nvar ElementBox = require('ElementBox');\nvar PropTypes = require('prop-types');\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar UIManager = require('UIManager');\nvar View = require('View');\n\ntype EventLike = {\n  nativeEvent: Object,\n};\n\nclass InspectorOverlay extends React.Component<{\n  inspected?: {\n    frame?: Object,\n    style?: any,\n  },\n  inspectedViewTag?: number,\n  onTouchViewTag: (tag: number, frame: Object, pointerY: number) => void,\n}> {\n  static propTypes = {\n    inspected: PropTypes.shape({\n      frame: PropTypes.object,\n      style: PropTypes.any,\n    }),\n    inspectedViewTag: PropTypes.number,\n    onTouchViewTag: PropTypes.func.isRequired,\n  };\n\n  findViewForTouchEvent = (e: EventLike) => {\n    var {locationX, locationY} = e.nativeEvent.touches[0];\n    UIManager.findSubviewIn(\n      this.props.inspectedViewTag,\n      [locationX, locationY],\n      (nativeViewTag, left, top, width, height) => {\n        this.props.onTouchViewTag(nativeViewTag, {left, top, width, height}, locationY);\n      }\n    );\n  };\n\n  shouldSetResponser = (e: EventLike): bool => {\n    this.findViewForTouchEvent(e);\n    return true;\n  };\n\n  render() {\n    var content = null;\n    if (this.props.inspected) {\n      content = <ElementBox frame={this.props.inspected.frame} style={this.props.inspected.style} />;\n    }\n\n    return (\n      <View\n        onStartShouldSetResponder={this.shouldSetResponser}\n        onResponderMove={this.findViewForTouchEvent}\n        style={[styles.inspector, {height: Dimensions.get('window').height}]}>\n        {content}\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  inspector: {\n    backgroundColor: 'transparent',\n    position: 'absolute',\n    left: 0,\n    top: 0,\n    right: 0,\n  },\n});\n\nmodule.exports = InspectorOverlay;\n"
  },
  {
    "path": "Libraries/Inspector/InspectorPanel.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule InspectorPanel\n * @flow\n */\n'use strict';\n\nconst ElementProperties = require('ElementProperties');\nconst NetworkOverlay = require('NetworkOverlay');\nconst PerformanceOverlay = require('PerformanceOverlay');\nconst React = require('React');\nconst PropTypes = require('prop-types');\nconst ScrollView = require('ScrollView');\nconst StyleSheet = require('StyleSheet');\nconst Text = require('Text');\nconst TouchableHighlight = require('TouchableHighlight');\nconst View = require('View');\n\nclass InspectorPanel extends React.Component<$FlowFixMeProps> {\n  renderWaiting() {\n    if (this.props.inspecting) {\n      return (\n        <Text style={styles.waitingText}>\n          Tap something to inspect it\n        </Text>\n      );\n    }\n    return <Text style={styles.waitingText}>Nothing is inspected</Text>;\n  }\n\n  render() {\n    let contents;\n    if (this.props.inspected) {\n      contents = (\n        <ScrollView style={styles.properties}>\n          <ElementProperties\n            style={this.props.inspected.style}\n            frame={this.props.inspected.frame}\n            source={this.props.inspected.source}\n            hierarchy={this.props.hierarchy}\n            selection={this.props.selection}\n            setSelection={this.props.setSelection}\n          />\n        </ScrollView>\n      );\n    } else if (this.props.perfing) {\n      contents = (\n        <PerformanceOverlay />\n      );\n    } else if (this.props.networking) {\n      contents = (\n        <NetworkOverlay />\n      );\n    } else {\n      contents = (\n        <View style={styles.waiting}>\n          {this.renderWaiting()}\n        </View>\n      );\n    }\n    return (\n      <View style={styles.container}>\n        {!this.props.devtoolsIsOpen && contents}\n        <View style={styles.buttonRow}>\n          <Button\n            title={'Inspect'}\n            pressed={this.props.inspecting}\n            onClick={this.props.setInspecting}\n          />\n          <Button title={'Perf'}\n            pressed={this.props.perfing}\n            onClick={this.props.setPerfing}\n          />\n          <Button title={'Network'}\n            pressed={this.props.networking}\n            onClick={this.props.setNetworking}\n          />\n          <Button title={'Touchables'}\n            pressed={this.props.touchTargetting}\n            onClick={this.props.setTouchTargetting}\n          />\n        </View>\n      </View>\n    );\n  }\n}\n\nInspectorPanel.propTypes = {\n  devtoolsIsOpen: PropTypes.bool,\n  inspecting: PropTypes.bool,\n  setInspecting: PropTypes.func,\n  inspected: PropTypes.object,\n  perfing: PropTypes.bool,\n  setPerfing: PropTypes.func,\n  touchTargetting: PropTypes.bool,\n  setTouchTargetting: PropTypes.func,\n  networking: PropTypes.bool,\n  setNetworking: PropTypes.func,\n};\n\nclass Button extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <TouchableHighlight onPress={() => this.props.onClick(!this.props.pressed)} style={[\n        styles.button,\n        this.props.pressed && styles.buttonPressed\n      ]}>\n        <Text style={styles.buttonText}>{this.props.title}</Text>\n      </TouchableHighlight>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  buttonRow: {\n    flexDirection: 'row',\n  },\n  button: {\n    backgroundColor: 'rgba(0, 0, 0, 0.3)',\n    margin: 2,\n    height: 30,\n    justifyContent: 'center',\n    alignItems: 'center',\n  },\n  buttonPressed: {\n    backgroundColor: 'rgba(255, 255, 255, 0.3)',\n  },\n  buttonText: {\n    textAlign: 'center',\n    color: 'white',\n    margin: 5,\n  },\n  container: {\n    backgroundColor: 'rgba(0, 0, 0, 0.7)',\n  },\n  properties: {\n    height: 200,\n  },\n  waiting: {\n    height: 100,\n  },\n  waitingText: {\n    fontSize: 20,\n    textAlign: 'center',\n    marginVertical: 20,\n    color: 'white',\n  },\n});\n\nmodule.exports = InspectorPanel;\n"
  },
  {
    "path": "Libraries/Inspector/NetworkOverlay.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule NetworkOverlay\n * @flow\n */\n'use strict';\n\nconst ListView = require('ListView');\nconst React = require('React');\nconst ScrollView = require('ScrollView');\nconst StyleSheet = require('StyleSheet');\nconst Text = require('Text');\nconst TouchableHighlight = require('TouchableHighlight');\nconst View = require('View');\nconst WebSocketInterceptor = require('WebSocketInterceptor');\nconst XHRInterceptor = require('XHRInterceptor');\n\nconst LISTVIEW_CELL_HEIGHT = 15;\nconst SEPARATOR_THICKNESS = 2;\n\n// Global id for the intercepted XMLHttpRequest objects.\nlet nextXHRId = 0;\n\ntype NetworkRequestInfo = {\n  type?: string,\n  url?: string,\n  method?: string,\n  status?: number,\n  dataSent?: any,\n  responseContentType?: string,\n  responseSize?: number,\n  requestHeaders?: Object,\n  responseHeaders?: string,\n  response?: Object | string,\n  responseURL?: string,\n  responseType?: string,\n  timeout?: number,\n  closeReason?: string,\n  messages?: string,\n  serverClose?: Object,\n  serverError?: Object,\n};\n\n/**\n * Show all the intercepted network requests over the InspectorPanel.\n */\nclass NetworkOverlay extends React.Component<Object, {\n  dataSource: ListView.DataSource,\n  newDetailInfo: bool,\n  detailRowID: ?number,\n}> {\n  _requests: Array<NetworkRequestInfo>;\n  _listViewDataSource: ListView.DataSource;\n  _listView: ?ListView;\n  _listViewHighlighted: bool;\n  _listViewHeight: number;\n  _scrollView: ?ScrollView;\n  _detailViewItems: Array<Array<React.Element<any>>>;\n  _listViewOnLayout: (event: Event) => void;\n  _captureRequestListView: (listRef: ?ListView) => void;\n  _captureDetailScrollView: (scrollRef: ?ScrollView) => void;\n  _renderRow: (\n    rowData: NetworkRequestInfo,\n    sectionID: number,\n    rowID: number,\n    highlightRow: (sectionID: number, rowID: number) => void,\n  ) => React.Element<any>;\n  _closeButtonClicked: () => void;\n  // Map of `socketId` -> `index in `_requests``.\n  _socketIdMap: Object;\n  // Map of `xhr._index` -> `index in `_requests``.\n  _xhrIdMap: {[key: number]: number};\n\n  constructor(props: Object) {\n    super(props);\n    this._requests = [];\n    this._detailViewItems = [];\n    this._listViewDataSource =\n      new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});\n    this.state = {\n      dataSource: this._listViewDataSource.cloneWithRows([]),\n      newDetailInfo: false,\n      detailRowID: null,\n    };\n    this._listViewHighlighted = false;\n    this._listViewHeight = 0;\n    this._captureRequestListView = this._captureRequestListView.bind(this);\n    this._captureDetailScrollView = this._captureDetailScrollView.bind(this);\n    this._listViewOnLayout = this._listViewOnLayout.bind(this);\n    this._renderRow = this._renderRow.bind(this);\n    this._closeButtonClicked = this._closeButtonClicked.bind(this);\n    this._socketIdMap = {};\n    this._xhrIdMap = {};\n  }\n\n  _enableXHRInterception(): void {\n    if (XHRInterceptor.isInterceptorEnabled()) {\n      return;\n    }\n    // Show the XHR request item in listView as soon as it was opened.\n    XHRInterceptor.setOpenCallback((method, url, xhr) => {\n      // Generate a global id for each intercepted xhr object, add this id\n      // to the xhr object as a private `_index` property to identify it,\n      // so that we can distinguish different xhr objects in callbacks.\n      xhr._index = nextXHRId++;\n      const xhrIndex = this._requests.length;\n      this._xhrIdMap[xhr._index] = xhrIndex;\n\n      const _xhr: NetworkRequestInfo = {\n        'type': 'XMLHttpRequest',\n        'method': method,\n        'url': url\n      };\n      this._requests.push(_xhr);\n      this._detailViewItems.push([]);\n      this._genDetailViewItem(xhrIndex);\n      this.setState(\n        {dataSource: this._listViewDataSource.cloneWithRows(this._requests)},\n        this._scrollToBottom(),\n      );\n    });\n\n    XHRInterceptor.setRequestHeaderCallback((header, value, xhr) => {\n      const xhrIndex = this._getRequestIndexByXHRID(xhr._index);\n      if (xhrIndex === -1) {\n        return;\n      }\n      const networkInfo = this._requests[xhrIndex];\n      if (!networkInfo.requestHeaders) {\n        networkInfo.requestHeaders = {};\n      }\n      networkInfo.requestHeaders[header] = value;\n      this._genDetailViewItem(xhrIndex);\n    });\n\n    XHRInterceptor.setSendCallback((data, xhr) => {\n      const xhrIndex = this._getRequestIndexByXHRID(xhr._index);\n      if (xhrIndex === -1) {\n        return;\n      }\n      this._requests[xhrIndex].dataSent = data;\n      this._genDetailViewItem(xhrIndex);\n    });\n\n    XHRInterceptor.setHeaderReceivedCallback(\n      (type, size, responseHeaders, xhr) => {\n        const xhrIndex = this._getRequestIndexByXHRID(xhr._index);\n        if (xhrIndex === -1) {\n          return;\n        }\n        const networkInfo = this._requests[xhrIndex];\n        networkInfo.responseContentType = type;\n        networkInfo.responseSize = size;\n        networkInfo.responseHeaders = responseHeaders;\n        this._genDetailViewItem(xhrIndex);\n      }\n    );\n\n    XHRInterceptor.setResponseCallback((\n        status,\n        timeout,\n        response,\n        responseURL,\n        responseType,\n        xhr,\n      ) => {\n        const xhrIndex = this._getRequestIndexByXHRID(xhr._index);\n        if (xhrIndex === -1) {\n          return;\n        }\n        const networkInfo = this._requests[xhrIndex];\n        networkInfo.status = status;\n        networkInfo.timeout = timeout;\n        networkInfo.response = response;\n        networkInfo.responseURL = responseURL;\n        networkInfo.responseType = responseType;\n        this._genDetailViewItem(xhrIndex);\n      }\n    );\n\n    // Fire above callbacks.\n    XHRInterceptor.enableInterception();\n  }\n\n  _enableWebSocketInterception(): void {\n    if (WebSocketInterceptor.isInterceptorEnabled()) {\n      return;\n    }\n    // Show the WebSocket request item in listView when 'connect' is called.\n    WebSocketInterceptor.setConnectCallback(\n      (url, protocols, options, socketId) => {\n        const socketIndex = this._requests.length;\n        this._socketIdMap[socketId] = socketIndex;\n        const _webSocket: NetworkRequestInfo = {\n          'type': 'WebSocket',\n          'url': url,\n          'protocols': protocols,\n        };\n        this._requests.push(_webSocket);\n        this._detailViewItems.push([]);\n        this._genDetailViewItem(socketIndex);\n        this.setState(\n          {dataSource: this._listViewDataSource.cloneWithRows(this._requests)},\n          this._scrollToBottom(),\n        );\n      }\n    );\n\n    WebSocketInterceptor.setCloseCallback(\n      (statusCode, closeReason, socketId) => {\n        const socketIndex = this._socketIdMap[socketId];\n        if (socketIndex === undefined) {\n          return;\n        }\n        if (statusCode !== null && closeReason !== null) {\n          this._requests[socketIndex].status = statusCode;\n          this._requests[socketIndex].closeReason = closeReason;\n        }\n        this._genDetailViewItem(socketIndex);\n      }\n    );\n\n    WebSocketInterceptor.setSendCallback((data, socketId) => {\n      const socketIndex = this._socketIdMap[socketId];\n      if (socketIndex === undefined) {\n        return;\n      }\n      if (!this._requests[socketIndex].messages) {\n        this._requests[socketIndex].messages = '';\n      }\n      this._requests[socketIndex].messages +=\n        'Sent: ' + JSON.stringify(data) + '\\n';\n      this._genDetailViewItem(socketIndex);\n    });\n\n    WebSocketInterceptor.setOnMessageCallback((socketId, message) => {\n      const socketIndex = this._socketIdMap[socketId];\n      if (socketIndex === undefined) {\n        return;\n      }\n      if (!this._requests[socketIndex].messages) {\n        this._requests[socketIndex].messages = '';\n      }\n      this._requests[socketIndex].messages +=\n        'Received: ' + JSON.stringify(message) + '\\n';\n      this._genDetailViewItem(socketIndex);\n    });\n\n    WebSocketInterceptor.setOnCloseCallback((socketId, message) => {\n      const socketIndex = this._socketIdMap[socketId];\n      if (socketIndex === undefined) {\n        return;\n      }\n      this._requests[socketIndex].serverClose = message;\n      this._genDetailViewItem(socketIndex);\n    });\n\n    WebSocketInterceptor.setOnErrorCallback((socketId, message) => {\n      const socketIndex = this._socketIdMap[socketId];\n      if (socketIndex === undefined) {\n        return;\n      }\n      this._requests[socketIndex].serverError = message;\n      this._genDetailViewItem(socketIndex);\n    });\n\n    // Fire above callbacks.\n    WebSocketInterceptor.enableInterception();\n  }\n\n  componentDidMount() {\n    this._enableXHRInterception();\n    this._enableWebSocketInterception();\n  }\n\n  componentWillUnmount() {\n    XHRInterceptor.disableInterception();\n    WebSocketInterceptor.disableInterception();\n  }\n\n  _renderRow(\n    rowData: NetworkRequestInfo,\n    sectionID: number,\n    rowID: number,\n    highlightRow: (sectionID: number, rowID: number) => void,\n  ): React.Element<any> {\n    let urlCellViewStyle = styles.urlEvenCellView;\n    let methodCellViewStyle = styles.methodEvenCellView;\n    if (rowID % 2 === 1) {\n      urlCellViewStyle = styles.urlOddCellView;\n      methodCellViewStyle = styles.methodOddCellView;\n    }\n    return (\n      <TouchableHighlight onPress={() => {\n          this._pressRow(rowID);\n          highlightRow(sectionID, rowID);\n        }}>\n        <View>\n          <View style={styles.tableRow}>\n            <View style={urlCellViewStyle}>\n              <Text style={styles.cellText} numberOfLines={1}>\n                {rowData.url}\n              </Text>\n            </View>\n            <View style={methodCellViewStyle}>\n              <Text style={styles.cellText} numberOfLines={1}>\n                {this._getTypeShortName(rowData.type)}\n              </Text>\n            </View>\n          </View>\n        </View>\n      </TouchableHighlight>\n    );\n  }\n\n  _renderSeperator(\n    sectionID: number,\n    rowID: number,\n    adjacentRowHighlighted: bool): React.Element<any> {\n    return (\n      <View\n        key={`${sectionID}-${rowID}`}\n        style={{\n          height: adjacentRowHighlighted ? SEPARATOR_THICKNESS : 0,\n          backgroundColor: adjacentRowHighlighted ? '#3B5998' : '#CCCCCC',\n        }}\n      />\n    );\n  }\n\n  _scrollToBottom(): void {\n    if (this._listView) {\n      const scrollResponder = this._listView.getScrollResponder();\n      if (scrollResponder) {\n        const scrollY = Math.max(\n          this._requests.length * LISTVIEW_CELL_HEIGHT +\n          (this._listViewHighlighted ? 2 * SEPARATOR_THICKNESS : 0) -\n          this._listViewHeight,\n          0,\n        );\n        scrollResponder.scrollResponderScrollTo({\n          x: 0,\n          y: scrollY,\n          animated: true\n        });\n      }\n    }\n  }\n\n  _captureRequestListView(listRef: ?ListView): void {\n    this._listView = listRef;\n  }\n\n  _listViewOnLayout(event: any): void {\n    const {height} = event.nativeEvent.layout;\n    this._listViewHeight = height;\n  }\n\n  /**\n   * Popup a scrollView to dynamically show detailed information of\n   * the request, when pressing a row in the network flow listView.\n   */\n  _pressRow(rowID: number): void {\n    this._listViewHighlighted = true;\n    this.setState(\n      {detailRowID: rowID},\n      this._scrollToTop(),\n    );\n  }\n\n  _scrollToTop(): void {\n    if (this._scrollView) {\n      this._scrollView.scrollTo({\n        y: 0,\n        animated: false,\n      });\n    }\n  }\n\n  _captureDetailScrollView(scrollRef: ?ScrollView): void {\n    this._scrollView = scrollRef;\n  }\n\n  _closeButtonClicked() {\n    this.setState({detailRowID: null});\n  }\n\n  _getStringByValue(value: any): string {\n    if (value === undefined) {\n      return 'undefined';\n    }\n    if (typeof value === 'object') {\n      return JSON.stringify(value);\n    }\n    if (typeof value === 'string' && value.length > 500) {\n      return String(value).substr(0, 500).concat(\n        '\\n***TRUNCATED TO 500 CHARACTERS***');\n    }\n    return value;\n  }\n\n  _getRequestIndexByXHRID(index: number): number {\n    if (index === undefined) {\n      return -1;\n    }\n    const xhrIndex = this._xhrIdMap[index];\n    if (xhrIndex === undefined) {\n      return -1;\n    } else {\n      return xhrIndex;\n    }\n  }\n\n  _getTypeShortName(type: any): string {\n    if (type === 'XMLHttpRequest') {\n      return 'XHR';\n    } else if (type === 'WebSocket') {\n      return 'WS';\n    }\n\n    return '';\n  }\n\n  /**\n   * Generate a list of views containing network request information for\n   * a XHR object, to be shown in the detail scrollview. This function\n   * should be called every time there is a new update of the XHR object,\n   * in order to show network request/response information in real time.\n   */\n  _genDetailViewItem(index: number): void {\n    this._detailViewItems[index] = [];\n    const detailViewItem = this._detailViewItems[index];\n    const requestItem = this._requests[index];\n    for (let key in requestItem) {\n      detailViewItem.push(\n        <View style={styles.detailViewRow} key={key}>\n          <Text style={[styles.detailViewText, styles.detailKeyCellView]}>\n            {key}\n          </Text>\n          <Text style={[styles.detailViewText, styles.detailValueCellView]}>\n            {this._getStringByValue(requestItem[key])}\n          </Text>\n        </View>\n      );\n    }\n    // Re-render if this network request is showing in the detail view.\n    if (this.state.detailRowID != null &&\n        Number(this.state.detailRowID) === index) {\n      this.setState({newDetailInfo: true});\n    }\n  }\n\n  render() {\n    return (\n      <View style={styles.container}>\n        {this.state.detailRowID != null &&\n        <TouchableHighlight\n          style={styles.closeButton}\n          onPress={this._closeButtonClicked}>\n          <View>\n            <Text style={styles.clostButtonText}>v</Text>\n          </View>\n        </TouchableHighlight>}\n        {this.state.detailRowID != null &&\n        <ScrollView\n          style={styles.detailScrollView}\n          ref={this._captureDetailScrollView}>\n          {this._detailViewItems[this.state.detailRowID]}\n        </ScrollView>}\n        <View style={styles.listViewTitle}>\n          {this._requests.length > 0 &&\n          <View style={styles.tableRow}>\n            <View style={styles.urlTitleCellView}>\n              <Text style={styles.cellText} numberOfLines={1}>URL</Text>\n            </View>\n            <View style={styles.methodTitleCellView}>\n              <Text style={styles.cellText} numberOfLines={1}>Type</Text>\n            </View>\n          </View>}\n        </View>\n        <ListView\n          style={styles.listView}\n          ref={this._captureRequestListView}\n          dataSource={this.state.dataSource}\n          renderRow={this._renderRow}\n          enableEmptySections={true}\n          renderSeparator={this._renderSeperator}\n          onLayout={this._listViewOnLayout}\n        />\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    paddingTop: 10,\n    paddingBottom: 10,\n    paddingLeft: 5,\n    paddingRight: 5,\n  },\n  listViewTitle: {\n    height: 20,\n  },\n  listView: {\n    flex: 1,\n    height: 60,\n  },\n  tableRow: {\n    flexDirection: 'row',\n    flex: 1,\n  },\n  cellText: {\n    color: 'white',\n    fontSize: 12,\n  },\n  methodTitleCellView: {\n    height: 18,\n    borderColor: '#DCD7CD',\n    borderTopWidth: 1,\n    borderBottomWidth: 1,\n    borderRightWidth: 1,\n    alignItems: 'center',\n    justifyContent: 'center',\n    backgroundColor: '#444',\n    flex: 1,\n  },\n  urlTitleCellView: {\n    height: 18,\n    borderColor: '#DCD7CD',\n    borderTopWidth: 1,\n    borderBottomWidth: 1,\n    borderLeftWidth: 1,\n    borderRightWidth: 1,\n    justifyContent: 'center',\n    backgroundColor: '#444',\n    flex: 5,\n    paddingLeft: 3,\n  },\n  methodOddCellView: {\n    height: 15,\n    borderColor: '#DCD7CD',\n    borderRightWidth: 1,\n    alignItems: 'center',\n    justifyContent: 'center',\n    backgroundColor: '#000',\n    flex: 1,\n  },\n  urlOddCellView: {\n    height: 15,\n    borderColor: '#DCD7CD',\n    borderLeftWidth: 1,\n    borderRightWidth: 1,\n    justifyContent: 'center',\n    backgroundColor: '#000',\n    flex: 5,\n    paddingLeft: 3,\n  },\n  methodEvenCellView: {\n    height: 15,\n    borderColor: '#DCD7CD',\n    borderRightWidth: 1,\n    alignItems: 'center',\n    justifyContent: 'center',\n    backgroundColor: '#888',\n    flex: 1,\n  },\n  urlEvenCellView: {\n    height: 15,\n    borderColor: '#DCD7CD',\n    borderLeftWidth: 1,\n    borderRightWidth: 1,\n    justifyContent: 'center',\n    backgroundColor: '#888',\n    flex: 5,\n    paddingLeft: 3,\n  },\n  detailScrollView: {\n    flex: 1,\n    height: 180,\n    marginTop: 5,\n    marginBottom: 5,\n  },\n  detailKeyCellView: {\n    flex: 1.3,\n  },\n  detailValueCellView: {\n    flex: 2,\n  },\n  detailViewRow: {\n    flexDirection: 'row',\n    paddingHorizontal: 3,\n  },\n  detailViewText: {\n    color: 'white',\n    fontSize: 11,\n  },\n  clostButtonText: {\n    color: 'white',\n    fontSize: 10,\n  },\n  closeButton: {\n    marginTop: 5,\n    backgroundColor: '#888',\n    justifyContent: 'center',\n    alignItems: 'center',\n  },\n});\n\nmodule.exports = NetworkOverlay;\n"
  },
  {
    "path": "Libraries/Inspector/PerformanceOverlay.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PerformanceOverlay\n * @flow\n */\n'use strict';\n\nvar PerformanceLogger = require('PerformanceLogger');\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar Text = require('Text');\nvar View = require('View');\n\nclass PerformanceOverlay extends React.Component<{}> {\n  render() {\n    var perfLogs = PerformanceLogger.getTimespans();\n    var items = [];\n\n    for (var key in perfLogs) {\n      if (perfLogs[key].totalTime) {\n        var unit = (key === 'BundleSize') ? 'b' : 'ms';\n        items.push(\n          <View style={styles.row} key={key}>\n            <Text style={[styles.text, styles.label]}>{key}</Text>\n            <Text style={[styles.text, styles.totalTime]}>\n              {perfLogs[key].totalTime + unit}\n            </Text>\n          </View>\n        );\n      }\n    }\n\n    return (\n      <View style={styles.container}>\n        {items}\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    height: 100,\n    paddingTop: 10,\n  },\n  label: {\n    flex: 1,\n  },\n  row: {\n    flexDirection: 'row',\n    paddingHorizontal: 10,\n  },\n  text: {\n    color: 'white',\n    fontSize: 12,\n  },\n  totalTime: {\n    paddingRight: 100,\n  },\n});\n\nmodule.exports = PerformanceOverlay;\n"
  },
  {
    "path": "Libraries/Inspector/StyleInspector.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StyleInspector\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar Text = require('Text');\nvar View = require('View');\n\nclass StyleInspector extends React.Component<$FlowFixMeProps> {\n  render() {\n    if (!this.props.style) {\n      return <Text style={styles.noStyle}>No style</Text>;\n    }\n    var names = Object.keys(this.props.style);\n    return (\n      <View style={styles.container}>\n        <View>\n          {names.map(name => <Text key={name} style={styles.attr}>{name}:</Text>)}\n        </View>\n\n        <View>\n          {names.map(name => {\n            var value = typeof this.props.style[name] === 'object' ? JSON.stringify(this.props.style[name]) : this.props.style[name];\n            return <Text key={name} style={styles.value}>{value}</Text>;\n          } ) }\n        </View>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    flexDirection: 'row',\n  },\n  row: {\n    flexDirection: 'row',\n    alignItems: 'center',\n    justifyContent: 'space-around',\n  },\n  attr: {\n    fontSize: 10,\n    color: '#ccc',\n  },\n  value: {\n    fontSize: 10,\n    color: 'white',\n    marginLeft: 10,\n  },\n  noStyle: {\n    color: 'white',\n    fontSize: 10,\n  },\n});\n\nmodule.exports = StyleInspector;\n\n"
  },
  {
    "path": "Libraries/Inspector/resolveBoxStyle.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule resolveBoxStyle\n * @flow\n */\n'use strict';\n\n/**\n * Resolve a style property into it's component parts, e.g.\n *\n * resolveProperties('margin', {margin: 5, marginBottom: 10})\n * ->\n * {top: 5, left: 5, right: 5, bottom: 10}\n *\n * If none are set, returns false.\n */\nfunction resolveBoxStyle(prefix: string, style: Object): ?Object {\n  var res = {};\n  var subs = ['top', 'left', 'bottom', 'right'];\n  var set = false;\n  subs.forEach(sub => {\n    res[sub] = style[prefix] || 0;\n  });\n  if (style[prefix]) {\n    set = true;\n  }\n  if (style[prefix + 'Vertical']) {\n    res.top = res.bottom = style[prefix + 'Vertical'];\n    set = true;\n  }\n  if (style[prefix + 'Horizontal']) {\n    res.left = res.right = style[prefix + 'Horizontal'];\n    set = true;\n  }\n  subs.forEach(sub => {\n    var val = style[prefix + capFirst(sub)];\n    if (val) {\n      res[sub] = val;\n      set = true;\n    }\n  });\n  if (!set) {\n    return;\n  }\n  return res;\n}\n\nfunction capFirst(text) {\n  return text[0].toUpperCase() + text.slice(1);\n}\n\nmodule.exports = resolveBoxStyle;\n\n"
  },
  {
    "path": "Libraries/Interaction/Batchinator.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Batchinator\n * @flow\n */\n'use strict';\n\nconst InteractionManager = require('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\nmodule.exports = Batchinator;\n"
  },
  {
    "path": "Libraries/Interaction/BridgeSpyStallHandler.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BridgeSpyStallHandler\n * @flow\n */\n'use strict';\n\nconst JSEventLoopWatchdog = require('JSEventLoopWatchdog');\nconst MessageQueue = require('MessageQueue');\n\nconst infoLog = require('infoLog');\n\nconst BridgeSpyStallHandler = {\n  register: function() {\n    let spyBuffer = [];\n    MessageQueue.spy((data) => {\n      spyBuffer.push(data);\n    });\n    const TO_JS = 0;\n    JSEventLoopWatchdog.addHandler({\n      onStall: () => {\n        infoLog(\n          spyBuffer.length + ' bridge messages during stall: ',\n          spyBuffer.map((info) => {\n            let args = '<args>';\n            try {\n              args = JSON.stringify(info.args);\n            } catch (e1) {\n              if (Array.isArray(info.args)) {\n                args = info.args.map((arg) => {\n                  try {\n                    return JSON.stringify(arg);\n                  } catch (e2) {\n                    return '?';\n                  }\n                });\n              } else {\n                args = 'keys:' + JSON.stringify(Object.keys(info.args));\n              }\n            }\n            return `${info.type === TO_JS ? 'N->JS' : 'JS->N'} : ` +\n              `${info.module ? (info.module + '.') : ''}${info.method}(${JSON.stringify(args)})`;\n          }),\n        );\n      },\n      onIterate: () => {\n        spyBuffer = [];\n      },\n    });\n  },\n};\n\nmodule.exports = BridgeSpyStallHandler;\n"
  },
  {
    "path": "Libraries/Interaction/FrameRateLogger.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule FrameRateLogger\n * @flow\n */\n'use strict';\n\nconst NativeModules = require('NativeModules');\n\nconst invariant = require('fbjs/lib/invariant');\n\n/**\n * Flow API for native FrameRateLogger module. If the native module is not installed, function calls\n * are just no-ops.\n *\n * Typical behavior is that `setContext` is called when a new screen is loaded (e.g. via a\n * navigation integration), and then `beginScroll` is called by `ScrollResponder` at which point the\n * native module then begins tracking frame drops. When `ScrollResponder` calls `endScroll`, the\n * native module gathers up all it's frame drop data and reports it via an analytics pipeline for\n * analysis.\n *\n * Note that `beginScroll` may be called multiple times by `ScrollResponder` - unclear if that's a\n * bug, but the native module should be robust to that.\n *\n * In the future we may add support for tracking frame drops in other types of interactions beyond\n * scrolling.\n */\nconst FrameRateLogger = {\n  /**\n   * Enable `debug` to see local logs of what's going on. `reportStackTraces` will grab stack traces\n   * during UI thread stalls and upload them if the native module supports it.\n   */\n  setGlobalOptions: function(options: {debug?: boolean, reportStackTraces?: boolean}) {\n    if (options.debug !== undefined) {\n      invariant(\n        NativeModules.FrameRateLogger,\n        'Trying to debug FrameRateLogger without the native module!',\n      );\n    }\n    NativeModules.FrameRateLogger && NativeModules.FrameRateLogger.setGlobalOptions(options);\n  },\n\n  /**\n   * Must call `setContext` before any events can be properly tracked, which is done automatically\n   * in `AppRegistry`, but navigation is also a common place to hook in.\n   */\n  setContext: function(context: string) {\n    NativeModules.FrameRateLogger && NativeModules.FrameRateLogger.setContext(context);\n  },\n\n  /**\n   * Called in `ScrollResponder` so any component that uses that module will handle this\n   * automatically.\n   */\n  beginScroll() {\n    NativeModules.FrameRateLogger && NativeModules.FrameRateLogger.beginScroll();\n  },\n\n  /**\n   * Called in `ScrollResponder` so any component that uses that module will handle this\n   * automatically.\n   */\n  endScroll() {\n    NativeModules.FrameRateLogger && NativeModules.FrameRateLogger.endScroll();\n  },\n};\n\nmodule.exports = FrameRateLogger;\n"
  },
  {
    "path": "Libraries/Interaction/InteractionManager.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule InteractionManager\n * @flow\n */\n'use strict';\n\nconst BatchedBridge = require('BatchedBridge');\nconst EventEmitter = require('EventEmitter');\nconst Set = require('Set');\nconst TaskQueue = require('TaskQueue');\n\nconst infoLog = require('infoLog');\nconst invariant = require('fbjs/lib/invariant');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst keyMirror = require('fbjs/lib/keyMirror');\n\ntype Handle = number;\nimport type {Task} from 'TaskQueue';\n\nconst _emitter = new EventEmitter();\n\nconst DEBUG_DELAY = 0;\nconst DEBUG = false;\n\n/**\n * InteractionManager allows long-running work to be scheduled after any\n * interactions/animations have completed. In particular, this allows JavaScript\n * animations to run smoothly.\n *\n * Applications can schedule tasks to run after interactions with the following:\n *\n * ```\n * InteractionManager.runAfterInteractions(() => {\n *   // ...long-running synchronous task...\n * });\n * ```\n *\n * Compare this to other scheduling alternatives:\n *\n * - requestAnimationFrame(): for code that animates a view over time.\n * - setImmediate/setTimeout(): run code later, note this may delay animations.\n * - runAfterInteractions(): run code later, without delaying active animations.\n *\n * The touch handling system considers one or more active touches to be an\n * 'interaction' and will delay `runAfterInteractions()` callbacks until all\n * touches have ended or been cancelled.\n *\n * InteractionManager also allows applications to register animations by\n * creating an interaction 'handle' on animation start, and clearing it upon\n * completion:\n *\n * ```\n * var handle = InteractionManager.createInteractionHandle();\n * // run animation... (`runAfterInteractions` tasks are queued)\n * // later, on animation completion:\n * InteractionManager.clearInteractionHandle(handle);\n * // queued tasks run if all handles were cleared\n * ```\n *\n * `runAfterInteractions` takes either a plain callback function, or a\n * `PromiseTask` object with a `gen` method that returns a `Promise`.  If a\n * `PromiseTask` is supplied, then it is fully resolved (including asynchronous\n * dependencies that also schedule more tasks via `runAfterInteractions`) before\n * starting on the next task that might have been queued up synchronously\n * earlier.\n *\n * By default, queued tasks are executed together in a loop in one\n * `setImmediate` batch. If `setDeadline` is called with a positive number, then\n * tasks will only be executed until the deadline (in terms of js event loop run\n * time) approaches, at which point execution will yield via setTimeout,\n * allowing events such as touches to start interactions and block queued tasks\n * from executing, making apps more responsive.\n */\nvar InteractionManager = {\n  Events: keyMirror({\n    interactionStart: true,\n    interactionComplete: true,\n  }),\n\n  /**\n   * Schedule a function to run after all interactions have completed. Returns a cancellable\n   * \"promise\".\n   */\n  runAfterInteractions(task: ?Task): {then: Function, done: Function, cancel: Function} {\n    const tasks = [];\n    const promise = new Promise(resolve => {\n      _scheduleUpdate();\n      if (task) {\n        tasks.push(task);\n      }\n      tasks.push({run: resolve, name: 'resolve ' + (task && task.name || '?')});\n      _taskQueue.enqueueTasks(tasks);\n    });\n    return {\n      then: promise.then.bind(promise),\n      done: (...args) => {\n        if (promise.done) {\n          return promise.done(...args);\n        } else {\n          console.warn('Tried to call done when not supported by current Promise implementation.');\n        }\n      },\n      cancel: function() {\n        _taskQueue.cancelTasks(tasks);\n      },\n    };\n  },\n\n  /**\n   * Notify manager that an interaction has started.\n   */\n  createInteractionHandle(): Handle {\n    DEBUG && infoLog('create interaction handle');\n    _scheduleUpdate();\n    var handle = ++_inc;\n    _addInteractionSet.add(handle);\n    return handle;\n  },\n\n  /**\n   * Notify manager that an interaction has completed.\n   */\n  clearInteractionHandle(handle: Handle) {\n    DEBUG && infoLog('clear interaction handle');\n    invariant(\n      !!handle,\n      'Must provide a handle to clear.'\n    );\n    _scheduleUpdate();\n    _addInteractionSet.delete(handle);\n    _deleteInteractionSet.add(handle);\n  },\n\n  addListener: _emitter.addListener.bind(_emitter),\n\n  /**\n   * A positive number will use setTimeout to schedule any tasks after the\n   * eventLoopRunningTime hits the deadline value, otherwise all tasks will be\n   * executed in one setImmediate batch (default).\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 = 0;\nlet _inc = 0;\nlet _deadline = -1;\n\ndeclare function setImmediate(callback: any, ...args: Array<any>): number;\n\n/**\n * Schedule an asynchronous update to the interaction state.\n */\nfunction _scheduleUpdate() {\n  if (!_nextUpdateHandle) {\n    if (_deadline > 0) {\n      /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n       * error found when Flow v0.63 was deployed. To see the error delete this\n       * comment and run Flow. */\n      _nextUpdateHandle = setTimeout(_processUpdate, 0 + DEBUG_DELAY);\n    } else {\n      _nextUpdateHandle = setImmediate(_processUpdate);\n    }\n  }\n}\n\n/**\n * Notify listeners, process queue, etc\n */\nfunction _processUpdate() {\n  _nextUpdateHandle = 0;\n\n  var interactionCount = _interactionSet.size;\n  _addInteractionSet.forEach(handle =>\n    _interactionSet.add(handle)\n  );\n  _deleteInteractionSet.forEach(handle =>\n    _interactionSet.delete(handle)\n  );\n  var nextInteractionCount = _interactionSet.size;\n\n  if (interactionCount !== 0 && nextInteractionCount === 0) {\n    // transition from 1+ --> 0 interactions\n    _emitter.emit(InteractionManager.Events.interactionComplete);\n  } else if (interactionCount === 0 && nextInteractionCount !== 0) {\n    // transition from 0 --> 1+ interactions\n    _emitter.emit(InteractionManager.Events.interactionStart);\n  }\n\n  // process the queue regardless of a transition\n  if (nextInteractionCount === 0) {\n    while (_taskQueue.hasTasksToProcess()) {\n      _taskQueue.processNext();\n      if (_deadline > 0 &&\n          BatchedBridge.getEventLoopRunningTime() >= _deadline) {\n        // Hit deadline before processing all tasks, so process more later.\n        _scheduleUpdate();\n        break;\n      }\n    }\n  }\n  _addInteractionSet.clear();\n  _deleteInteractionSet.clear();\n}\n\nmodule.exports = InteractionManager;\n"
  },
  {
    "path": "Libraries/Interaction/InteractionMixin.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule InteractionMixin\n * @flow\n */\n'use strict';\n\nvar InteractionManager = require('InteractionManager');\n\n/**\n * This mixin provides safe versions of InteractionManager start/end methods\n * that ensures `clearInteractionHandle` is always called\n * once per start, even if the component is unmounted.\n */\nvar InteractionMixin = {\n  componentWillUnmount: function() {\n    while (this._interactionMixinHandles.length) {\n      InteractionManager.clearInteractionHandle(\n        this._interactionMixinHandles.pop()\n      );\n    }\n  },\n\n  _interactionMixinHandles: ([]: Array<number>),\n\n  createInteractionHandle: function() {\n    var handle = InteractionManager.createInteractionHandle();\n    this._interactionMixinHandles.push(handle);\n    return handle;\n  },\n\n  clearInteractionHandle: function(clearHandle: number) {\n    InteractionManager.clearInteractionHandle(clearHandle);\n    this._interactionMixinHandles = this._interactionMixinHandles.filter(\n      handle => handle !== clearHandle\n    );\n  },\n\n  /**\n   * Schedule work for after all interactions have completed.\n   *\n   * @param {function} callback\n   */\n  runAfterInteractions: function(callback: Function) {\n    InteractionManager.runAfterInteractions(callback);\n  },\n};\n\nmodule.exports = InteractionMixin;\n"
  },
  {
    "path": "Libraries/Interaction/InteractionStallDebugger.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule InteractionStallDebugger\n * @flow\n */\n'use strict';\n\nconst BridgeSpyStallHandler = require('BridgeSpyStallHandler');\nconst JSEventLoopWatchdog = require('JSEventLoopWatchdog');\nconst ReactPerfStallHandler = require('ReactPerfStallHandler');\n\nconst InteractionStallDebugger = {\n  install: function(options: {thresholdMS: number}) {\n    JSEventLoopWatchdog.install(options);\n    BridgeSpyStallHandler.register();\n    if (__DEV__) {\n      ReactPerfStallHandler.register();\n    }\n  },\n};\n\nmodule.exports = InteractionStallDebugger;\n"
  },
  {
    "path": "Libraries/Interaction/JSEventLoopWatchdog.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule JSEventLoopWatchdog\n * @flow\n */\n'use strict';\n\nconst infoLog = require('infoLog');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst performanceNow = require('fbjs/lib/performanceNow');\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 = performanceNow();\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 = performanceNow();\n    function iteration() {\n      const now = performanceNow();\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 = `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\nmodule.exports = JSEventLoopWatchdog;\n"
  },
  {
    "path": "Libraries/Interaction/PanResponder.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PanResponder\n */\n\n'use strict';\n\nconst InteractionManager = require('./InteractionManager');\nconst TouchHistoryMath = require('TouchHistoryMath');\n\nconst currentCentroidXOfTouchesChangedAfter = TouchHistoryMath.currentCentroidXOfTouchesChangedAfter;\nconst currentCentroidYOfTouchesChangedAfter = TouchHistoryMath.currentCentroidYOfTouchesChangedAfter;\nconst previousCentroidXOfTouchesChangedAfter = TouchHistoryMath.previousCentroidXOfTouchesChangedAfter;\nconst previousCentroidYOfTouchesChangedAfter = 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\nconst PanResponder = {\n\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: function (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: function (gestureState, touchHistory) {\n    gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\n    gestureState.moveX = currentCentroidXOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo);\n    gestureState.moveY = currentCentroidYOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo);\n    const movedAfter = gestureState._accountsForMovesUpTo;\n    const prevX = previousCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);\n    const x = currentCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);\n    const prevY = previousCentroidYOfTouchesChangedAfter(touchHistory, movedAfter);\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 = 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: function (config) {\n    const interactionState = {\n      handle: (null: ?number),\n    };\n    const gestureState = {\n      // Useful for debugging\n      stateID: Math.random(),\n    };\n    PanResponder._initializeGestureState(gestureState);\n    const panHandlers = {\n      onStartShouldSetResponder: function (e) {\n        return config.onStartShouldSetPanResponder === undefined ?\n          false :\n          config.onStartShouldSetPanResponder(e, gestureState);\n      },\n      onMoveShouldSetResponder: function (e) {\n        return config.onMoveShouldSetPanResponder === undefined ?\n          false :\n          config.onMoveShouldSetPanResponder(e, gestureState);\n      },\n      onStartShouldSetResponderCapture: function (e) {\n        // TODO: Actually, we should reinitialize the state any time\n        // touches.length increases from 0 active to > 0 active.\n        if (e.nativeEvent.touches.length === 1) {\n          PanResponder._initializeGestureState(gestureState);\n        }\n        gestureState.numberActiveTouches = e.touchHistory.numberActiveTouches;\n        return config.onStartShouldSetPanResponderCapture !== undefined ?\n          config.onStartShouldSetPanResponderCapture(e, gestureState) :\n          false;\n      },\n\n      onMoveShouldSetResponderCapture: function (e) {\n        const touchHistory = e.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 (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) {\n          return false;\n        }\n        PanResponder._updateGestureStateOnMove(gestureState, touchHistory);\n        return config.onMoveShouldSetPanResponderCapture ?\n          config.onMoveShouldSetPanResponderCapture(e, gestureState) :\n          false;\n      },\n\n      onResponderGrant: function (e) {\n        if (!interactionState.handle) {\n          interactionState.handle = InteractionManager.createInteractionHandle();\n        }\n        gestureState.x0 = currentCentroidX(e.touchHistory);\n        gestureState.y0 = currentCentroidY(e.touchHistory);\n        gestureState.dx = 0;\n        gestureState.dy = 0;\n        if (config.onPanResponderGrant) {\n          config.onPanResponderGrant(e, gestureState);\n        }\n        // TODO: t7467124 investigate if this can be removed\n        return config.onShouldBlockNativeResponder === undefined ?\n          true :\n          config.onShouldBlockNativeResponder();\n      },\n\n      onResponderReject: function (e) {\n        clearInteractionHandle(interactionState, config.onPanResponderReject, e, gestureState);\n      },\n\n      onResponderRelease: function (e) {\n        clearInteractionHandle(interactionState, config.onPanResponderRelease, e, gestureState);\n        PanResponder._initializeGestureState(gestureState);\n      },\n\n      onResponderStart: function (e) {\n        const touchHistory = e.touchHistory;\n        gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\n        if (config.onPanResponderStart) {\n          config.onPanResponderStart(e, gestureState);\n        }\n      },\n\n      onResponderMove: function (e) {\n        const touchHistory = e.touchHistory;\n        // Guard against the dispatch of two touch moves when there are two\n        // simultaneously changed touches.\n        if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) {\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(e, gestureState);\n        }\n      },\n\n      onResponderEnd: function (e) {\n        const touchHistory = e.touchHistory;\n        gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\n        clearInteractionHandle(interactionState, config.onPanResponderEnd, e, gestureState);\n      },\n\n      onResponderTerminate: function (e) {\n        clearInteractionHandle(interactionState, config.onPanResponderTerminate, e, gestureState);\n        PanResponder._initializeGestureState(gestureState);\n      },\n\n      onResponderTerminationRequest: function (e) {\n        return config.onPanResponderTerminationRequest === undefined ?\n          true :\n          config.onPanResponderTerminationRequest(e, gestureState);\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: Function,\n  event: Object,\n  gestureState: Object\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\nmodule.exports = PanResponder;\n"
  },
  {
    "path": "Libraries/Interaction/ReactPerfStallHandler.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactPerfStallHandler\n * @flow\n */\n'use strict';\n\nconst JSEventLoopWatchdog = require('JSEventLoopWatchdog');\nconst ReactPerf = require('ReactPerf');\n\nconst ReactPerfStallHandler = {\n  register: function() {\n    ReactPerf.start();\n    JSEventLoopWatchdog.addHandler({\n      onStall: () => {\n        ReactPerf.stop();\n        ReactPerf.printInclusive();\n        ReactPerf.printWasted();\n        ReactPerf.start();\n      },\n      onIterate: () => {\n        ReactPerf.stop();\n        ReactPerf.start();\n      },\n    });\n  },\n};\n\nmodule.exports = ReactPerfStallHandler;\n"
  },
  {
    "path": "Libraries/Interaction/TaskQueue.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TaskQueue\n * @flow\n */\n'use strict';\n\nconst infoLog = require('infoLog');\nconst invariant = require('fbjs/lib/invariant');\n\ntype SimpleTask = {\n  name: string,\n  run: () => void,\n};\ntype PromiseTask = {\n  name: string,\n  gen: () => Promise<any>,\n};\nexport type Task = Function | SimpleTask | PromiseTask;\n\nconst DEBUG = false;\n\n/**\n * TaskQueue - A system for queueing and executing a mix of simple callbacks and\n * trees of dependent tasks based on Promises. No tasks are executed unless\n * `processNext` is called.\n *\n * `enqueue` takes a Task object with either a simple `run` callback, or a\n * `gen` function that returns a `Promise` and puts it in the queue.  If a gen\n * function is supplied, then the promise it returns will block execution of\n * tasks already in the queue until it resolves. This can be used to make sure\n * the first task is fully resolved (including asynchronous dependencies that\n * also schedule more tasks via `enqueue`) before starting on the next task.\n * The `onMoreTasks` constructor argument is used to inform the owner that an\n * async task has resolved and that the queue should be processed again.\n *\n * Note: Tasks are only actually executed with explicit calls to `processNext`.\n */\nclass TaskQueue {\n  /**\n   * TaskQueue instances are self contained and independent, so multiple tasks\n   * of varying semantics and priority can operate together.\n   *\n   * `onMoreTasks` is invoked when `PromiseTask`s resolve if there are more\n   * tasks to process.\n   */\n  constructor({onMoreTasks}: {onMoreTasks: () => void}) {\n    this._onMoreTasks = onMoreTasks;\n    this._queueStack = [{tasks: [], popable: false}];\n  }\n\n  /**\n   * Add a task to the queue.  It is recommended to name your tasks for easier\n   * async debugging. Tasks will not be executed until `processNext` is called\n   * explicitly.\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    // search through all tasks and remove them.\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  /**\n   * Check to see if `processNext` should be called.\n   *\n   * @returns {boolean} Returns true if there are tasks that are ready to be\n   * processed with `processNext`, or returns false if there are no more tasks\n   * to be processed right now, although there may be tasks in the queue that\n   * are blocked by earlier `PromiseTask`s that haven't resolved yet.\n   * `onMoreTasks` will be called after each `PromiseTask` resolves if there are\n   * tasks ready to run at that point.\n   */\n  hasTasksToProcess(): bool {\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 (task.gen) {\n          DEBUG && infoLog('genPromise for task ' + task.name);\n          this._genPromise((task: any)); // Rather than annoying tagged union\n        } else if (task.run) {\n          DEBUG && infoLog('run task ' + task.name);\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          DEBUG && infoLog('run anonymous task');\n          task();\n        }\n      } catch (e) {\n        e.message = 'TaskQueue: Error with task ' + (task.name || '') + ': ' +\n          e.message;\n        throw e;\n      }\n    }\n  }\n\n  _queueStack: Array<{tasks: Array<Task>, popable: bool}>;\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 &&\n        queue.tasks.length === 0 &&\n        this._queueStack.length > 1) {\n      this._queueStack.pop();\n      DEBUG && infoLog('popped queue: ', {stackIdx, queueStackSize: this._queueStack.length});\n      return this._getCurrentQueue();\n    } else {\n      return queue.tasks;\n    }\n  }\n\n  _genPromise(task: PromiseTask) {\n    // Each async task pushes it's own queue onto the queue stack. This\n    // effectively defers execution of previously queued tasks until the promise\n    // resolves, at which point we allow the new queue to be popped, which\n    // happens once it is fully processed.\n    this._queueStack.push({tasks: [], popable: false});\n    const stackIdx = this._queueStack.length - 1;\n    DEBUG && infoLog('push new queue: ', {stackIdx});\n    DEBUG && infoLog('exec gen task ' + task.name);\n    task.gen()\n      .then(() => {\n        DEBUG && infoLog(\n          'onThen for gen task ' + task.name,\n          {stackIdx, queueStackSize: this._queueStack.length},\n        );\n        this._queueStack[stackIdx].popable = true;\n        this.hasTasksToProcess() && this._onMoreTasks();\n      })\n      .catch((ex) => {\n        ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`;\n        throw ex;\n      })\n      .done();\n  }\n}\n\n\nmodule.exports = TaskQueue;\n"
  },
  {
    "path": "Libraries/Interaction/__tests__/Batchinator-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n\n'use strict';\n\njest\n  .mock('ErrorUtils')\n  .mock('BatchedBridge');\n\nfunction expectToBeCalledOnce(fn) {\n  expect(fn.mock.calls.length).toBe(1);\n}\n\ndescribe('Batchinator', () => {\n  const Batchinator = require('Batchinator');\n\n  it('executes vanilla tasks', () => {\n    const callback = jest.fn();\n    const batcher = new Batchinator(callback, 10000);\n    batcher.schedule();\n    jest.runAllTimers();\n    expectToBeCalledOnce(callback);\n  });\n\n  it('batches up tasks', () => {\n    const callback = jest.fn();\n    const batcher = new Batchinator(callback, 10000);\n    batcher.schedule();\n    batcher.schedule();\n    batcher.schedule();\n    batcher.schedule();\n    expect(callback).not.toBeCalled();\n    jest.runAllTimers();\n    expectToBeCalledOnce(callback);\n  });\n\n  it('flushes on dispose', () => {\n    const callback = jest.fn();\n    const batcher = new Batchinator(callback, 10000);\n    batcher.schedule();\n    batcher.schedule();\n    batcher.dispose();\n    expectToBeCalledOnce(callback);\n    jest.runAllTimers();\n    expectToBeCalledOnce(callback);\n  });\n\n  it('should call tasks scheduled by the callback', () => {\n    let batcher = null;\n    let hasRescheduled = false;\n    const callback = jest.fn(() => {\n      if (!hasRescheduled) {\n        batcher.schedule();\n        hasRescheduled = true;\n      }\n    });\n    batcher = new Batchinator(callback, 10000);\n    batcher.schedule();\n    jest.runAllTimers();\n    expect(callback.mock.calls.length).toBe(2);\n  });\n\n  it('does not run callbacks more than once', () => {\n    const callback = jest.fn();\n    const batcher = new Batchinator(callback, 10000);\n    batcher.schedule();\n    batcher.schedule();\n    jest.runAllTimers();\n    expectToBeCalledOnce(callback);\n    jest.runAllTimers();\n    expectToBeCalledOnce(callback);\n    batcher.dispose();\n    expectToBeCalledOnce(callback);\n  });\n});\n"
  },
  {
    "path": "Libraries/Interaction/__tests__/InteractionManager-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n\n'use strict';\n\njest\n  .mock('ErrorUtils')\n  .mock('BatchedBridge');\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('InteractionManager');\n\n    interactionStart = jest.fn();\n    interactionComplete = jest.fn();\n\n    InteractionManager.addListener(\n      InteractionManager.Events.interactionStart,\n      interactionStart\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 & stopped 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('runs 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\ndescribe('promise tasks', () => {\n  let InteractionManager;\n  let BatchedBridge;\n  let sequenceId;\n  function createSequenceTask(expectedSequenceId) {\n    return jest.fn(() => {\n      expect(++sequenceId).toBe(expectedSequenceId);\n    });\n  }\n  beforeEach(() => {\n    jest.resetModules();\n    jest.useFakeTimers();\n    InteractionManager = require('InteractionManager');\n    BatchedBridge = require('BatchedBridge');\n    sequenceId = 0;\n  });\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({gen: task2, 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    BatchedBridge.getEventLoopRunningTime.mockReturnValue(10);\n    const task1 = createSequenceTask(1);\n    const task2 = createSequenceTask(2);\n    InteractionManager.runAfterInteractions(task1);\n    InteractionManager.runAfterInteractions(task2);\n\n    jest.runOnlyPendingTimers();\n\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    BatchedBridge.getEventLoopRunningTime.mockReturnValue(200);\n    const task1 = createSequenceTask(1);\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(); // resolve1\n    jest.runOnlyPendingTimers(); // task2\n\n    expectToBeCalledOnce(task2);\n  });\n\n  const bigAsyncTest = (resolve) => {\n    jest.useRealTimers();\n\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({gen: task4, name: 'gen4'})\n            .then(resolve);\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).then(resolve);\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);\n\n    setTimeout(() => {\n      expectToBeCalledOnce(task1);\n      expectToBeCalledOnce(task2);\n      expectToBeCalledOnce(task3);\n      expectToBeCalledOnce(task4);\n      expectToBeCalledOnce(task5);\n      expectToBeCalledOnce(task6);\n\n      resolve();\n    }, 100);\n  };\n\n  it('resolves async tasks recusively before other queued tasks', () => {\n    return new Promise(bigAsyncTest);\n  });\n\n  it('should also work with a deadline', () => {\n    InteractionManager.setDeadline(100);\n    BatchedBridge.getEventLoopRunningTime.mockReturnValue(200);\n    return new Promise(bigAsyncTest);\n  });\n});\n"
  },
  {
    "path": "Libraries/Interaction/__tests__/InteractionMixin-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\njest.enableAutomock().unmock('InteractionMixin');\n\ndescribe('InteractionMixin', () => {\n  var InteractionManager;\n  var InteractionMixin;\n  var component;\n\n  beforeEach(() => {\n    jest.resetModules();\n    InteractionManager = require('InteractionManager');\n    InteractionMixin = require('InteractionMixin');\n\n    component = Object.create(InteractionMixin);\n  });\n\n  it('should start interactions', () => {\n    component.createInteractionHandle();\n    expect(InteractionManager.createInteractionHandle).toBeCalled();\n  });\n\n  it('should end interactions', () => {\n    var handle = {};\n    component.clearInteractionHandle(handle);\n    expect(InteractionManager.clearInteractionHandle).toBeCalledWith(handle);\n  });\n\n  it('should schedule tasks', () => {\n    var task = jest.fn();\n    component.runAfterInteractions(task);\n    expect(InteractionManager.runAfterInteractions).toBeCalledWith(task);\n  });\n\n  it('should end unfinished interactions in componentWillUnmount', () => {\n    var handle = component.createInteractionHandle();\n    component.componentWillUnmount();\n    expect(InteractionManager.clearInteractionHandle).toBeCalledWith(handle);\n  });\n});\n"
  },
  {
    "path": "Libraries/Interaction/__tests__/TaskQueue-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n\n'use strict';\n\nconst Promise = require('promise');\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  function createSequenceTask(expectedSequenceId) {\n    return jest.fn(() => {\n      expect(++sequenceId).toBe(expectedSequenceId);\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\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    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    expectToBeCalledOnce(onMoreTasks);\n    expectToBeCalledOnce(task2);\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    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    expectToBeCalledOnce(task1);\n    expectToBeCalledOnce(task2);\n    expectToBeCalledOnce(task3);\n    expectToBeCalledOnce(task4);\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"
  },
  {
    "path": "Libraries/JSInspector/InspectorAgent.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule InspectorAgent\n * @flow\n */\n'use strict';\n\nexport type EventSender = (name: string, params: Object) => void;\n\nclass InspectorAgent {\n  _eventSender: EventSender;\n\n  constructor(eventSender: EventSender) {\n    this._eventSender = eventSender;\n  }\n\n  sendEvent(name: string, params: Object) {\n    this._eventSender(name, params);\n  }\n}\n\nmodule.exports = InspectorAgent;\n"
  },
  {
    "path": "Libraries/JSInspector/JSInspector.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule JSInspector\n * @flow\n */\n'use strict';\n\nimport type EventSender from 'InspectorAgent';\n\ninterface Agent {\n  constructor(eventSender: EventSender): void\n}\n\n// Flow doesn't support static declarations in interface\ntype AgentClass = Class<Agent> & { DOMAIN: string };\n\ndeclare function __registerInspectorAgent(type: AgentClass): void;\ndeclare function __inspectorTimestamp(): number;\n\nconst JSInspector = {\n  registerAgent(type: AgentClass) {\n    if (global.__registerInspectorAgent) {\n      global.__registerInspectorAgent(type);\n    }\n  },\n  getTimestamp(): number {\n    return global.__inspectorTimestamp();\n  },\n};\n\nmodule.exports = JSInspector;\n"
  },
  {
    "path": "Libraries/JSInspector/NetworkAgent.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule NetworkAgent\n * @flow\n */\n'use strict';\n\nconst InspectorAgent = require('InspectorAgent');\nconst JSInspector = require('JSInspector');\nconst Map = require('Map');\nconst XMLHttpRequest = require('XMLHttpRequest');\n\nimport type EventSender from 'InspectorAgent';\n\ntype RequestId = string;\n\ntype LoaderId = string;\ntype FrameId = string;\ntype Timestamp = number;\n\ntype Headers = Object;\n\n// We don't currently care about this\ntype ResourceTiming = null;\n\ntype ResourceType =\n  'Document' |\n  'Stylesheet' |\n  'Image' |\n  'Media' |\n  'Font' |\n  'Script' |\n  'TextTrack' |\n  'XHR' |\n  'Fetch' |\n  'EventSource' |\n  'WebSocket' |\n  'Manifest' |\n  'Other';\n\ntype SecurityState =\n  'unknown' |\n  'neutral' |\n  'insecure' |\n  'warning' |\n  'secure' |\n  'info';\ntype BlockedReason =\n  'csp' |\n  'mixed-content' |\n  'origin' |\n  'inspector' |\n  'subresource-filter' |\n  'other';\n\ntype StackTrace = null;\n\ntype Initiator = {\n  type: 'script' | 'other',\n  stackTrace?: StackTrace,\n  url?: string,\n  lineNumber?: number\n}\n\ntype ResourcePriority = 'VeryLow' | 'Low' | 'Medium' | 'High' | 'VeryHigh';\n\ntype Request = {\n  url: string,\n  method: string,\n  headers: Headers,\n  postData?: string,\n  mixedContentType?: 'blockable' | 'optionally-blockable' | 'none',\n  initialPriority: ResourcePriority,\n};\n\ntype Response = {\n  url: string,\n  status: number,\n  statusText: string,\n  headers: Headers,\n  headersText?: string,\n  mimeType: string,\n  requestHeaders?: Headers,\n  requestHeadersText?: string,\n  connectionReused: boolean,\n  connectionId: number,\n  fromDiskCache?: boolean,\n  encodedDataLength: number,\n  timing?: ResourceTiming,\n  securityState: SecurityState,\n};\n\ntype RequestWillBeSentEvent = {\n  requestId: RequestId,\n  frameId: FrameId,\n  loaderId: LoaderId,\n  documentURL: string,\n  request: Request,\n  timestamp: Timestamp,\n  initiator: Initiator,\n  redirectResponse?: Response,\n  // This is supposed to be optional but the inspector crashes without it,\n  // see https://bugs.chromium.org/p/chromium/issues/detail?id=653138\n  type: ResourceType,\n};\n\ntype ResponseReceivedEvent = {\n  requestId: RequestId,\n  frameId: FrameId,\n  loaderId: LoaderId,\n  timestamp: Timestamp,\n  type: ResourceType,\n  response: Response,\n};\n\ntype DataReceived = {\n  requestId: RequestId,\n  timestamp: Timestamp,\n  dataLength: number,\n  encodedDataLength: number,\n};\n\ntype LoadingFinishedEvent = {\n  requestId: RequestId,\n  timestamp: Timestamp,\n  encodedDataLength: number,\n};\n\ntype LoadingFailedEvent = {\n  requestId: RequestId,\n  timestamp: Timestamp,\n  type: ResourceType,\n  errorText: string,\n  canceled?: boolean,\n  blockedReason?: BlockedReason,\n};\n\nclass Interceptor {\n  _agent: NetworkAgent;\n  _requests: Map<string, string>;\n\n  constructor(agent: NetworkAgent) {\n    this._agent = agent;\n    this._requests = new Map();\n  }\n\n  getData(requestId: string): ?string {\n    return this._requests.get(requestId);\n  }\n\n  requestSent(\n    id: number,\n    url: string,\n    method: string,\n    headers: Object) {\n    const requestId = String(id);\n    this._requests.set(requestId, '');\n\n    const request: Request = {\n      url,\n      method,\n      headers,\n      initialPriority: 'Medium',\n    };\n    const event: RequestWillBeSentEvent = {\n      requestId,\n      documentURL: '',\n      frameId: '1',\n      loaderId: '1',\n      request,\n      timestamp: JSInspector.getTimestamp(),\n      initiator: {\n        // TODO(blom): Get stack trace\n        // If type is 'script' the inspector will try to execute\n        // `stack.callFrames[0]`\n        type: 'other',\n      },\n      type: 'Other',\n    };\n    this._agent.sendEvent('requestWillBeSent', event);\n  }\n\n  responseReceived(\n    id: number,\n    url: string,\n    status: number,\n    headers: Object) {\n    const requestId = String(id);\n    const response: Response = {\n      url,\n      status,\n      statusText: String(status),\n      headers,\n      // TODO(blom) refined headers, can we get this?\n      requestHeaders: {},\n      mimeType: this._getMimeType(headers),\n      connectionReused: false,\n      connectionId: -1,\n      encodedDataLength: 0,\n      securityState: 'unknown',\n    };\n\n    const event: ResponseReceivedEvent = {\n      requestId,\n      frameId: '1',\n      loaderId: '1',\n      timestamp: JSInspector.getTimestamp(),\n      type: 'Other',\n      response,\n    };\n    this._agent.sendEvent('responseReceived', event);\n  }\n\n  dataReceived(\n    id: number,\n    data: string) {\n    const requestId = String(id);\n    const existingData = this._requests.get(requestId) || '';\n    this._requests.set(requestId, existingData.concat(data));\n    const event: DataReceived = {\n      requestId,\n      timestamp: JSInspector.getTimestamp(),\n      dataLength: data.length,\n      encodedDataLength: data.length,\n    };\n    this._agent.sendEvent('dataReceived', event);\n  }\n\n  loadingFinished(\n    id: number,\n    encodedDataLength: number) {\n    const event: LoadingFinishedEvent = {\n      requestId: String(id),\n      timestamp: JSInspector.getTimestamp(),\n      encodedDataLength: encodedDataLength,\n    };\n    this._agent.sendEvent('loadingFinished', event);\n  }\n\n  loadingFailed(\n      id: number,\n      error: string) {\n    const event: LoadingFailedEvent = {\n      requestId: String(id),\n      timestamp: JSInspector.getTimestamp(),\n      type: 'Other',\n      errorText: error,\n    };\n    this._agent.sendEvent('loadingFailed', event);\n  }\n\n  _getMimeType(headers: Object): string {\n    const contentType = headers['Content-Type'] || '';\n    return contentType.split(';')[0];\n  }\n}\n\ntype EnableArgs = {\n  maxResourceBufferSize?: number,\n  maxTotalBufferSize?: number\n};\n\nclass NetworkAgent extends InspectorAgent {\n  static DOMAIN = 'Network';\n\n  _sendEvent: EventSender;\n  _interceptor: ?Interceptor;\n\n  enable({ maxResourceBufferSize, maxTotalBufferSize }: EnableArgs) {\n    this._interceptor = new Interceptor(this);\n    XMLHttpRequest.setInterceptor(this._interceptor);\n  }\n\n  disable() {\n    XMLHttpRequest.setInterceptor(null);\n    this._interceptor = null;\n  }\n\n  getResponseBody({requestId}: {requestId: RequestId})\n      : {body: ?string, base64Encoded: boolean} {\n    return {body: this.interceptor().getData(requestId), base64Encoded: false};\n  }\n\n  interceptor(): Interceptor {\n    if (this._interceptor) {\n      return this._interceptor;\n    } else {\n      throw Error('_interceptor can not be null');\n    }\n\n  }\n}\n\nmodule.exports = NetworkAgent;\n"
  },
  {
    "path": "Libraries/LayoutAnimation/LayoutAnimation.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule LayoutAnimation\n * @flow\n * @format\n */\n'use strict';\n\nconst PropTypes = require('prop-types');\nconst UIManager = require('UIManager');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst keyMirror = require('fbjs/lib/keyMirror');\n\nconst {checkPropTypes} = PropTypes;\n\nconst TypesEnum = {\n  spring: true,\n  linear: true,\n  easeInEaseOut: true,\n  easeIn: true,\n  easeOut: true,\n  keyboard: true,\n};\nconst Types = keyMirror(TypesEnum);\n\nconst PropertiesEnum = {\n  opacity: true,\n  scaleXY: true,\n};\nconst Properties = keyMirror(PropertiesEnum);\n\nconst animType = PropTypes.shape({\n  duration: PropTypes.number,\n  delay: PropTypes.number,\n  springDamping: PropTypes.number,\n  initialVelocity: PropTypes.number,\n  type: PropTypes.oneOf(Object.keys(Types)).isRequired,\n  property: PropTypes.oneOf(\n    // Only applies to create/delete\n    Object.keys(Properties),\n  ),\n});\n\ntype Anim = {\n  duration?: number,\n  delay?: number,\n  springDamping?: number,\n  initialVelocity?: number,\n  type?: $Enum<typeof TypesEnum>,\n  property?: $Enum<typeof PropertiesEnum>,\n};\n\nconst configType = PropTypes.shape({\n  duration: PropTypes.number.isRequired,\n  create: animType,\n  update: animType,\n  delete: animType,\n});\n\ntype Config = {\n  duration: number,\n  create?: Anim,\n  update?: Anim,\n  delete?: Anim,\n};\n\nfunction checkConfig(config: Config, location: string, name: string) {\n  checkPropTypes({config: configType}, {config}, location, name);\n}\n\nfunction configureNext(config: Config, onAnimationDidEnd?: Function) {\n  if (__DEV__) {\n    checkConfig(config, 'config', 'LayoutAnimation.configureNext');\n  }\n  UIManager.configureNextLayoutAnimation(\n    config,\n    onAnimationDidEnd || function() {},\n    function() {\n      /* unused */\n    },\n  );\n}\n\nfunction create(duration: number, type, creationProp): Config {\n  return {\n    duration,\n    create: {\n      type,\n      property: creationProp,\n    },\n    update: {\n      type,\n    },\n    delete: {\n      type,\n      property: creationProp,\n    },\n  };\n}\n\nconst Presets = {\n  easeInEaseOut: create(300, Types.easeInEaseOut, Properties.opacity),\n  linear: create(500, Types.linear, Properties.opacity),\n  spring: {\n    duration: 700,\n    create: {\n      type: Types.linear,\n      property: Properties.opacity,\n    },\n    update: {\n      type: Types.spring,\n      springDamping: 0.4,\n    },\n    delete: {\n      type: Types.linear,\n      property: Properties.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`, config for animating in new views (see `Anim` type)\n   *   - `update`, config for animating views that have been updated\n   * (see `Anim` type)\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,\n  Properties,\n  checkConfig,\n  Presets,\n  easeInEaseOut: configureNext.bind(null, Presets.easeInEaseOut),\n  linear: configureNext.bind(null, Presets.linear),\n  spring: configureNext.bind(null, Presets.spring),\n};\n\nmodule.exports = LayoutAnimation;\n"
  },
  {
    "path": "Libraries/Linking/Linking.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Linking\n * @flow\n */\n'use strict';\n\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst NativeModules = require('NativeModules');\nconst Platform = require('Platform');\n\nconst invariant = require('fbjs/lib/invariant');\n\nconst LinkingManager = Platform.OS === 'android' ?\n  NativeModules.IntentAndroid : NativeModules.LinkingManager;\n\n/**\n * <div class=\"banner-crna-ejected\">\n *   <h3>Projects with Native Code Only</h3>\n *   <p>\n *     This section only applies to projects made with <code>react-native init</code>\n *     or to those made with Create React Native App which have since ejected. For\n *     more information about ejecting, please see\n *     the <a href=\"https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md\" target=\"_blank\">guide</a> on\n *     the Create React Native App repository.\n *   </p>\n * </div>\n *\n * `Linking` gives you a general interface to interact with both incoming\n * and outgoing app links.\n *\n * ### Basic Usage\n *\n * #### Handling deep links\n *\n * If your app was launched from an external url registered to your app you can\n * access and handle it from any component you want with\n *\n * ```\n * componentDidMount() {\n *   Linking.getInitialURL().then((url) => {\n *     if (url) {\n *       console.log('Initial url is: ' + url);\n *     }\n *   }).catch(err => console.error('An error occurred', err));\n * }\n * ```\n *\n * NOTE: For instructions on how to add support for deep linking on Android,\n * refer to [Enabling Deep Links for App Content - Add Intent Filters for Your Deep Links](http://developer.android.com/training/app-indexing/deep-linking.html#adding-filters).\n *\n * If you wish to receive the intent in an existing instance of MainActivity,\n * you may set the `launchMode` of MainActivity to `singleTask` in\n * `AndroidManifest.xml`. See [`<activity>`](http://developer.android.com/guide/topics/manifest/activity-element.html)\n * documentation for more information.\n *\n * ```\n * <activity\n *   android:name=\".MainActivity\"\n *   android:launchMode=\"singleTask\">\n * ```\n *\n * NOTE: On iOS, you'll need to link `RCTLinking` to your project by following\n * the steps described [here](docs/linking-libraries-ios.html#manual-linking).\n * If you also want to listen to incoming app links during your app's\n * execution, you'll need to add the following lines to your `*AppDelegate.m`:\n *\n * ```\n * // iOS 9.x or newer\n * #import <React/RCTLinkingManager.h>\n *\n * - (BOOL)application:(UIApplication *)application\n *    openURL:(NSURL *)url\n *    options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options\n * {\n *   return [RCTLinkingManager application:application openURL:url options:options];\n * }\n * ```\n *\n * If you're targeting iOS 8.x or older, you can use the following code instead:\n *\n * ```\n * // iOS 8.x or older\n * #import <React/RCTLinkingManager.h>\n *\n * - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url\n *   sourceApplication:(NSString *)sourceApplication annotation:(id)annotation\n * {\n *   return [RCTLinkingManager application:application openURL:url\n *                       sourceApplication:sourceApplication annotation:annotation];\n * }\n * ```\n *\n *\n * // If your app is using [Universal Links](https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html),\n * you'll need to add the following code as well:\n *\n * ```\n * - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity\n *  restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler\n * {\n *  return [RCTLinkingManager application:application\n *                   continueUserActivity:userActivity\n *                     restorationHandler:restorationHandler];\n * }\n * ```\n *\n * And then on your React component you'll be able to listen to the events on\n * `Linking` as follows\n *\n * ```\n * componentDidMount() {\n *   Linking.addEventListener('url', this._handleOpenURL);\n * },\n * componentWillUnmount() {\n *   Linking.removeEventListener('url', this._handleOpenURL);\n * },\n * _handleOpenURL(event) {\n *   console.log(event.url);\n * }\n * ```\n * #### Opening external links\n *\n * To start the corresponding activity for a link (web URL, email, contact etc.), call\n *\n * ```\n * Linking.openURL(url).catch(err => console.error('An error occurred', err));\n * ```\n *\n * If you want to check if any installed app can handle a given URL beforehand you can call\n * ```\n * Linking.canOpenURL(url).then(supported => {\n *   if (!supported) {\n *     console.log('Can\\'t handle url: ' + url);\n *   } else {\n *     return Linking.openURL(url);\n *   }\n * }).catch(err => console.error('An error occurred', err));\n * ```\n */\nclass Linking extends NativeEventEmitter {\n\n  constructor() {\n    super(LinkingManager);\n  }\n\n  /**\n   * Add a handler to Linking changes by listening to the `url` event type\n   * and providing the handler\n   */\n  addEventListener(type: string, handler: Function) {\n    this.addListener(type, handler);\n  }\n\n  /**\n   * Remove a handler by passing the `url` event type and the handler\n   */\n  removeEventListener(type: string, handler: Function ) {\n    this.removeListener(type, handler);\n  }\n\n  /**\n   * Try to open the given `url` with any of the installed apps.\n   *\n   * You can use other URLs, like a location (e.g. \"geo:37.484847,-122.148386\" on Android\n   * or \"http://maps.apple.com/?ll=37.484847,-122.148386\" on iOS), a contact,\n   * or any other URL that can be opened with the installed apps.\n   *\n   * The method returns a `Promise` object. If the user confirms the open dialog or the\n   * url automatically opens, the promise is resolved.  If the user cancels the open dialog\n   * or there are no registered applications for the url, the promise is rejected.\n   *\n   * NOTE: This method will fail if the system doesn't know how to open the specified URL.\n   * If you're passing in a non-http(s) URL, it's best to check {@code canOpenURL} first.\n   *\n   * NOTE: For web URLs, the protocol (\"http://\", \"https://\") must be set accordingly!\n   */\n  openURL(url: string): Promise<any> {\n    Linking._validateURL(url);\n    return LinkingManager.openURL(url);\n  }\n\n  /**\n   * Determine whether or not an installed app can handle a given URL.\n   *\n   * NOTE: For web URLs, the protocol (\"http://\", \"https://\") must be set accordingly!\n   *\n   * NOTE: As of iOS 9, your app needs to provide the `LSApplicationQueriesSchemes` key\n   * inside `Info.plist` or canOpenURL will always return false.\n   *\n   * @param URL the URL to open\n   */\n  canOpenURL(url: string): Promise<boolean> {\n    Linking._validateURL(url);\n    return LinkingManager.canOpenURL(url);\n  }\n\n  /**\n   * If the app launch was triggered by an app link,\n   * it will give the link url, otherwise it will give `null`\n   *\n   * NOTE: To support deep linking on Android, refer http://developer.android.com/training/app-indexing/deep-linking.html#handling-intents\n   */\n  getInitialURL(): Promise<?string> {\n    return LinkingManager.getInitialURL();\n  }\n\n  static getArgv() {\n    return LinkingManager.argv;\n  }\n\n  static _validateURL(url: string) {\n    invariant(\n      typeof url === 'string',\n      'Invalid URL: should be a string. Was: ' + url\n    );\n    invariant(\n      url,\n      'Invalid URL: cannot be empty'\n    );\n  }\n}\n\nmodule.exports = new Linking();\n"
  },
  {
    "path": "Libraries/LinkingIOS/RCTLinking.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t148699CF1ABD045300480536 /* RCTLinkingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 148699CE1ABD045300480536 /* RCTLinkingManager.m */; };\n\t\t2D3B5F251D9B0DE600451313 /* RCTLinkingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 148699CE1ABD045300480536 /* RCTLinkingManager.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t134814201AA4EA6300B7C361 /* libRCTLinking.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTLinking.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t148699CD1ABD045300480536 /* RCTLinkingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLinkingManager.h; sourceTree = \"<group>\"; };\n\t\t148699CE1ABD045300480536 /* RCTLinkingManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLinkingManager.m; sourceTree = \"<group>\"; };\n\t\t2D2A28471D9B043800D4039D /* libRCTLinking-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libRCTLinking-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n/* End PBXFileReference section */\n\n/* Begin PBXGroup section */\n\t\t134814211AA4EA7D00B7C361 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134814201AA4EA6300B7C361 /* libRCTLinking.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58B511D21A9E6C8500147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t148699CD1ABD045300480536 /* RCTLinkingManager.h */,\n\t\t\t\t148699CE1ABD045300480536 /* RCTLinkingManager.m */,\n\t\t\t\t134814211AA4EA7D00B7C361 /* Products */,\n\t\t\t\t2D2A28471D9B043800D4039D /* libRCTLinking-tvOS.a */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t2D2A28461D9B043800D4039D /* RCTLinking-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D2A284F1D9B043800D4039D /* Build configuration list for PBXNativeTarget \"RCTLinking-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2D2A28431D9B043800D4039D /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"RCTLinking-tvOS\";\n\t\t\tproductName = \"RCTLinking-tvOS\";\n\t\t\tproductReference = 2D2A28471D9B043800D4039D /* libRCTLinking-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t58B511DA1A9E6C8500147676 /* RCTLinking */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTLinking\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t58B511D71A9E6C8500147676 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTLinking;\n\t\t\tproductName = RCTDataManager;\n\t\t\tproductReference = 134814201AA4EA6300B7C361 /* libRCTLinking.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511D31A9E6C8500147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t2D2A28461D9B043800D4039D = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t58B511DA1A9E6C8500147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTLinking\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511D21A9E6C8500147676;\n\t\t\tproductRefGroup = 58B511D21A9E6C8500147676;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B511DA1A9E6C8500147676 /* RCTLinking */,\n\t\t\t\t2D2A28461D9B043800D4039D /* RCTLinking-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t2D2A28431D9B043800D4039D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D3B5F251D9B0DE600451313 /* RCTLinkingManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t58B511D71A9E6C8500147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t148699CF1ABD045300480536 /* RCTLinkingManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t2D2A284D1D9B043800D4039D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D2A284E1D9B043800D4039D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511ED1A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.10;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511EE1A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.10;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511F01A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTLinking;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511F11A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTLinking;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t2D2A284F1D9B043800D4039D /* Build configuration list for PBXNativeTarget \"RCTLinking-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D2A284D1D9B043800D4039D /* Debug */,\n\t\t\t\t2D2A284E1D9B043800D4039D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTLinking\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511ED1A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511EE1A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTLinking\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511F01A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511F11A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511D31A9E6C8500147676 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/LinkingIOS/RCTLinkingManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTEventEmitter.h>\n\n@interface RCTLinkingManager : RCTEventEmitter\n\n+ (BOOL)application:(NSApplication *)application\n            openURL:(NSURL *)URL\n  sourceApplication:(NSString *)sourceApplication\n         annotation:(id)annotation;\n\n+ (BOOL)application:(NSApplication *)application\ncontinueUserActivity:(NSUserActivity *)userActivity\n  restorationHandler:(void (^)(NSArray *))restorationHandler;\n\n@end\n"
  },
  {
    "path": "Libraries/LinkingIOS/RCTLinkingManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTLinkingManager.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTUtils.h>\n\nstatic NSString *const kOpenURLNotification = @\"RCTOpenURLNotification\";\n\nstatic void postNotificationWithURL(NSURL *URL, id sender)\n{\n  NSDictionary<NSString *, id> *payload = @{@\"url\": URL.absoluteString};\n  [[NSNotificationCenter defaultCenter] postNotificationName:kOpenURLNotification\n                                                      object:sender\n                                                    userInfo:payload];\n}\n\n@implementation RCTLinkingManager\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n- (void)startObserving\n{\n  [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(getUrl:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL];\n\n  [[NSNotificationCenter defaultCenter] addObserver:self\n                                           selector:@selector(handleOpenURLNotification:)\n                                               name:kOpenURLNotification\n                                             object:nil];\n}\n\n- (void)stopObserving\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return NO;\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  NSString *argv = _bridge.launchOptions[@\"argv\"];\n  return @{@\"argv\": RCTNullIfNil(argv)};\n}\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[@\"url\"];\n}\n\n+ (BOOL)application:(NSApplication *)application\n            openURL:(NSURL *)URL\n  sourceApplication:(NSString *)sourceApplication\n         annotation:(id)annotation\n{\n  postNotificationWithURL(URL, self);\n  return YES;\n}\n\n- (void)getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent\n{\n    [[NSApp mainWindow] makeKeyAndOrderFront:nil];\n    NSString* url = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];\n    NSDictionary *payload = @{@\"url\": url};\n    [self sendEventWithName:@\"url\" body:payload];\n}\n\n+ (BOOL)application:(NSApplication *)application\ncontinueUserActivity:(NSUserActivity *)userActivity\n  restorationHandler:(void (^)(NSArray *))restorationHandler\n{\n  if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) {\n    NSDictionary *payload = @{@\"url\": userActivity.webpageURL.absoluteString};\n    [[NSNotificationCenter defaultCenter] postNotificationName:kOpenURLNotification\n                                                        object:self\n                                                      userInfo:payload];\n  }\n  return YES;\n}\n\n- (void)handleOpenURLNotification:(NSNotification *)notification\n{\n  [self sendEventWithName:@\"url\" body:notification.userInfo];\n}\n\nRCT_EXPORT_METHOD(openURL:(NSURL *)URL\n                  resolve:(RCTPromiseResolveBlock)resolve\n                  reject:(RCTPromiseRejectBlock)reject)\n{\n  // TODO: we should really return success/failure via a Promise reject/resolve here\n  // Doesn't really matter what thread we call this on since it exits the app\n  [[NSWorkspace sharedWorkspace] openURL:URL];\n}\n\n\n//TODO: implement canOpenURL or add different apis such as open File, launchApplication\nRCT_EXPORT_METHOD(canOpenURL:(NSURL *)URL\n                  resolve:(RCTPromiseResolveBlock)resolve\n                  reject:(__unused RCTPromiseRejectBlock)reject)\n{\n  if (RCTRunningInAppExtension()) {\n    // Technically Today widgets can open urls, but supporting that would require\n    // a reference to the NSExtensionContext\n    resolve(@NO);\n    return;\n  }\n\n  // TODO: on iOS9 this will fail if URL isn't included in the plist\n  // we should probably check for that and reject in that case instead of\n  // simply resolving with NO\n\n  // This can be expensive, so we deliberately don't call on main thread\n  BOOL canOpen = YES; // TODO: actual checking\n  resolve(@(canOpen));\n}\n\n\nRCT_EXPORT_METHOD(getInitialURL:(RCTPromiseResolveBlock)resolve\n                  reject:(__unused RCTPromiseRejectBlock)reject)\n{\n  NSURL *initialURL = nil;\n//  if (self.bridge.launchOptions[UIApplicationLaunchOptionsURLKey]) {\n//    initialURL = self.bridge.launchOptions[UIApplicationLaunchOptionsURLKey];\n//  } else {\n//    NSDictionary *userActivityDictionary =\n//      self.bridge.launchOptions[UIApplicationLaunchOptionsUserActivityDictionaryKey];\n//    if ([userActivityDictionary[UIApplicationLaunchOptionsUserActivityTypeKey] isEqual:NSUserActivityTypeBrowsingWeb]) {\n//      initialURL = ((NSUserActivity *)userActivityDictionary[@\"UIApplicationLaunchOptionsUserActivityKey\"]).webpageURL;\n//    }\n//  }\n  resolve(RCTNullIfNil(initialURL.absoluteString));\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Lists/FillRateHelper.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule FillRateHelper\n * @flow\n * @format\n */\n\n'use strict';\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst performanceNow = require('fbjs/lib/performanceNow');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst warning = require('fbjs/lib/warning');\n\nexport type FillRateInfo = Info;\n\nclass Info {\n  any_blank_count = 0;\n  any_blank_ms = 0;\n  any_blank_speed_sum = 0;\n  mostly_blank_count = 0;\n  mostly_blank_ms = 0;\n  pixels_blank = 0;\n  pixels_sampled = 0;\n  pixels_scrolled = 0;\n  total_time_spent = 0;\n  sample_count = 0;\n}\n\ntype FrameMetrics = {inLayout?: boolean, length: number, offset: number};\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 = (null: ?number);\n  _enabled = false;\n  _getFrameMetrics: (index: number) => ?FrameMetrics;\n  _info = new Info();\n  _mostlyBlankStartTime = (null: ?number);\n  _samplesStartTime = (null: ?number);\n\n  static addListener(callback: FillRateInfo => void): {remove: () => void} {\n    warning(\n      _sampleRate !== null,\n      '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(getFrameMetrics: (index: number) => ?FrameMetrics) {\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 = performanceNow();\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 = performanceNow() - 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        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      data: Array<any>,\n      getItemCount: (data: Array<any>) => number,\n      initialNumToRender: number,\n    },\n    state: {\n      first: number,\n      last: number,\n    },\n    scrollMetrics: {\n      dOffset: number,\n      offset: number,\n      velocity: number,\n      visibleLength: number,\n    },\n  ): number {\n    if (\n      !this._enabled ||\n      props.getItemCount(props.data) === 0 ||\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 = performanceNow();\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 = state.first;\n    let firstFrame = this._getFrameMetrics(first);\n    while (first <= state.last && (!firstFrame || !firstFrame.inLayout)) {\n      firstFrame = this._getFrameMetrics(first);\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 = state.last;\n    let lastFrame = this._getFrameMetrics(last);\n    while (last >= state.first && (!lastFrame || !lastFrame.inLayout)) {\n      lastFrame = this._getFrameMetrics(last);\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\nmodule.exports = FillRateHelper;\n"
  },
  {
    "path": "Libraries/Lists/FlatList.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule FlatList\n * @flow\n * @format\n */\n'use strict';\n\nconst MetroListView = require('MetroListView'); // Used as a fallback legacy option\nconst React = require('React');\nconst View = require('View');\nconst VirtualizedList = require('VirtualizedList');\nconst ListView = require('ListView');\n\nconst invariant = require('fbjs/lib/invariant');\n\nimport type {StyleObj} from 'StyleSheetTypes';\nimport type {\n  ViewabilityConfig,\n  ViewToken,\n  ViewabilityConfigCallbackPair,\n} from 'ViewabilityHelper';\nimport type {Props as VirtualizedListProps} from 'VirtualizedList';\n\nexport type SeparatorsObj = {\n  highlight: () => void,\n  unhighlight: () => void,\n  updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,\n};\n\ntype RequiredProps<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: (info: {\n    item: ItemT,\n    index: number,\n    separators: SeparatorsObj,\n  }) => ?React.Element<any>,\n  /**\n   * For simplicity, data is just a plain array. If you want to use something else, like an\n   * immutable list, use the underlying `VirtualizedList` directly.\n   */\n  data: ?$ReadOnlyArray<ItemT>,\n};\ntype OptionalProps<ItemT> = {\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   * 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   * 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   * Optional custom style for multi-item rows generated when numColumns > 1.\n   */\n  columnWrapperStyle?: StyleObj,\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: ?Array<ItemT>,\n    index: number,\n  ) => {length: number, offset: number, index: number},\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  numColumns: number,\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   * How far from the end (in units of visible length of the list) the bottom 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   * Called when the viewability of rows changes, as defined by the `viewabilityConfig` prop.\n   */\n  onViewableItemsChanged?: ?(info: {\n    viewableItems: Array<ViewToken>,\n    changed: Array<ViewToken>,\n  }) => void,\n  /**\n   * Set this when offset is needed for the loading indicator to show correctly.\n   * @platform android\n   */\n  progressViewOffset?: number,\n  legacyImplementation?: ?boolean,\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   * 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};\nexport type Props<ItemT> = RequiredProps<ItemT> &\n  OptionalProps<ItemT> &\n  VirtualizedListProps;\n\nconst defaultProps = {\n  ...VirtualizedList.defaultProps,\n  numColumns: 1,\n};\nexport type DefaultProps = typeof defaultProps;\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  static defaultProps: DefaultProps = defaultProps;\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    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    viewPosition?: number,\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() {\n    if (this._listRef) {\n      return this._listRef.getScrollResponder();\n    }\n  }\n\n  getScrollableNode() {\n    if (this._listRef) {\n      return this._listRef.getScrollableNode();\n    }\n  }\n\n  setNativeProps(props: Object) {\n    if (this._listRef) {\n      this._listRef.setNativeProps(props);\n    }\n  }\n\n  componentWillMount() {\n    this._checkProps(this.props);\n  }\n\n  componentWillReceiveProps(nextProps: Props<ItemT>) {\n    invariant(\n      nextProps.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      nextProps.onViewableItemsChanged === this.props.onViewableItemsChanged,\n      'Changing onViewableItemsChanged on the fly is not supported',\n    );\n    invariant(\n      nextProps.viewabilityConfig === this.props.viewabilityConfig,\n      'Changing viewabilityConfig on the fly is not supported',\n    );\n    invariant(\n      nextProps.viewabilityConfigCallbackPairs ===\n        this.props.viewabilityConfigCallbackPairs,\n      'Changing viewabilityConfigCallbackPairs on the fly is not supported',\n    );\n\n    this._checkProps(nextProps);\n  }\n\n  constructor(props: Props<*>) {\n    super(props);\n    if (this.props.viewabilityConfigCallbackPairs) {\n      this._virtualizedListPairs = this.props.viewabilityConfigCallbackPairs.map(\n        pair => ({\n          viewabilityConfig: pair.viewabilityConfig,\n          onViewableItemsChanged: this._createOnViewableItemsChanged(\n            pair.onViewableItemsChanged,\n          ),\n        }),\n      );\n    } else if (this.props.onViewableItemsChanged) {\n      /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n       * error found when Flow v0.63 was deployed. To see the error delete this\n       * comment and run Flow. */\n      this._virtualizedListPairs.push({\n        viewabilityConfig: this.props.viewabilityConfig,\n        onViewableItemsChanged: this._createOnViewableItemsChanged(\n          this.props.onViewableItemsChanged,\n        ),\n      });\n    }\n  }\n\n  _hasWarnedLegacy = false;\n  _listRef: null | VirtualizedList | ListView;\n  _virtualizedListPairs: Array<ViewabilityConfigCallbackPair> = [];\n\n  _captureRef = ref => {\n    this._listRef = ref;\n  };\n\n  _checkProps(props: Props<ItemT>) {\n    const {\n      getItem,\n      getItemCount,\n      horizontal,\n      legacyImplementation,\n      numColumns,\n      columnWrapperStyle,\n      onViewableItemsChanged,\n      viewabilityConfigCallbackPairs,\n    } = props;\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    if (legacyImplementation) {\n      invariant(\n        numColumns === 1,\n        'Legacy list does not support multiple columns.',\n      );\n      // Warning: may not have full feature parity and is meant more for debugging and performance\n      // comparison.\n      if (!this._hasWarnedLegacy) {\n        console.warn(\n          'FlatList: Using legacyImplementation - some features not supported and performance ' +\n            'may suffer',\n        );\n        this._hasWarnedLegacy = true;\n      }\n    }\n    invariant(\n      !(onViewableItemsChanged && viewabilityConfigCallbackPairs),\n      'FlatList does not support setting both onViewableItemsChanged and ' +\n        'viewabilityConfigCallbackPairs.',\n    );\n  }\n\n  _getItem = (data: Array<ItemT>, index: number) => {\n    const {numColumns} = this.props;\n    if (numColumns > 1) {\n      const ret = [];\n      for (let kk = 0; kk < numColumns; kk++) {\n        const item = data[index * numColumns + kk];\n        item && ret.push(item);\n      }\n      return ret;\n    } else {\n      return data[index];\n    }\n  };\n\n  _getItemCount = (data: ?Array<ItemT>): number => {\n    return data ? Math.ceil(data.length / this.props.numColumns) : 0;\n  };\n\n  _keyExtractor = (items: ItemT | Array<ItemT>, index: number) => {\n    const {keyExtractor, numColumns} = this.props;\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((it, kk) => keyExtractor(it, index * numColumns + kk))\n        .join(':');\n    } else {\n      /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n       * error found when Flow v0.63 was deployed. To see the error delete this\n       * comment and run Flow. */\n      return keyExtractor(items, index);\n    }\n  };\n\n  _pushMultiColumnViewable(arr: Array<ViewToken>, v: ViewToken): void {\n    const {numColumns, keyExtractor} = this.props;\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    }) => void,\n  ) {\n    return (info: {\n      viewableItems: Array<ViewToken>,\n      changed: Array<ViewToken>,\n    }) => {\n      const {numColumns} = this.props;\n      if (onViewableItemsChanged) {\n        if (numColumns > 1) {\n          const changed = [];\n          const viewableItems = [];\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  _renderItem = (info: Object) => {\n    const {renderItem, numColumns, columnWrapperStyle} = this.props;\n    if (numColumns > 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={[{flexDirection: 'row'}, columnWrapperStyle]}>\n          {item.map((it, kk) => {\n            const element = renderItem({\n              item: it,\n              index: index * numColumns + kk,\n              separators: info.separators,\n            });\n            return element && React.cloneElement(element, {key: kk});\n          })}\n        </View>\n      );\n    } else {\n      return renderItem(info);\n    }\n  };\n\n  render() {\n    if (this.props.legacyImplementation) {\n      return (\n        <MetroListView\n          {...this.props}\n          items={this.props.data}\n          ref={this._captureRef}\n        />\n      );\n    } else {\n      return (\n        <VirtualizedList\n          {...this.props}\n          renderItem={this._renderItem}\n          getItem={this._getItem}\n          getItemCount={this._getItemCount}\n          keyExtractor={this._keyExtractor}\n          ref={this._captureRef}\n          viewabilityConfigCallbackPairs={this._virtualizedListPairs}\n        />\n      );\n    }\n  }\n}\n\nmodule.exports = FlatList;\n"
  },
  {
    "path": "Libraries/Lists/ListView/ListView.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ListView\n * @flow\n * @format\n */\n'use strict';\n\nvar ListViewDataSource = require('ListViewDataSource');\nvar Platform = require('Platform');\nvar React = require('React');\nvar PropTypes = require('prop-types');\nvar ReactNative = require('ReactNative');\nvar RCTScrollViewManager = require('NativeModules').ScrollViewManager;\nvar ScrollView = require('ScrollView');\nvar ScrollResponder = require('ScrollResponder');\nvar StaticRenderer = require('StaticRenderer');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar TimerMixin = require('react-timer-mixin');\nvar View = require('View');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar cloneReferencedElement = require('react-clone-referenced-element');\nvar createReactClass = require('create-react-class');\nvar isEmpty = require('isEmpty');\nvar merge = require('merge');\n\nvar DEFAULT_PAGE_SIZE = 1;\nvar DEFAULT_INITIAL_ROWS = 10;\nvar DEFAULT_SCROLL_RENDER_AHEAD = 1000;\nvar DEFAULT_END_REACHED_THRESHOLD = 1000;\nvar DEFAULT_SCROLL_CALLBACK_THROTTLE = 50;\n\n/**\n * DEPRECATED - use one of the new list components, such as [`FlatList`](docs/flatlist.html)\n * or [`SectionList`](docs/sectionlist.html) for bounded memory use, fewer bugs,\n * better performance, an easier to use API, and more features. Check out this\n * [blog post](https://facebook.github.io/react-native/blog/2017/03/13/better-list-views.html)\n * for more details.\n *\n * ListView - A core component designed for efficient display of vertically\n * scrolling lists of changing data. The minimal API is to create a\n * [`ListView.DataSource`](docs/listviewdatasource.html), populate it with a simple\n * array of data blobs, and instantiate a `ListView` component with that data\n * source and a `renderRow` callback which takes a blob from the data array and\n * returns a renderable component.\n *\n * Minimal example:\n *\n * ```\n * class MyComponent extends Component {\n *   constructor() {\n *     super();\n *     const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});\n *     this.state = {\n *       dataSource: ds.cloneWithRows(['row 1', 'row 2']),\n *     };\n *   }\n *\n *   render() {\n *     return (\n *       <ListView\n *         dataSource={this.state.dataSource}\n *         renderRow={(rowData) => <Text>{rowData}</Text>}\n *       />\n *     );\n *   }\n * }\n * ```\n *\n * ListView also supports more advanced features, including sections with sticky\n * section headers, header and footer support, callbacks on reaching the end of\n * the available data (`onEndReached`) and on the set of rows that are visible\n * in the device viewport change (`onChangeVisibleRows`), and several\n * performance optimizations.\n *\n * There are a few performance operations designed to make ListView scroll\n * smoothly while dynamically loading potentially very large (or conceptually\n * infinite) data sets:\n *\n *  * Only re-render changed rows - the rowHasChanged function provided to the\n *    data source tells the ListView if it needs to re-render a row because the\n *    source data has changed - see ListViewDataSource for more details.\n *\n *  * Rate-limited row rendering - By default, only one row is rendered per\n *    event-loop (customizable with the `pageSize` prop). This breaks up the\n *    work into smaller chunks to reduce the chance of dropping frames while\n *    rendering rows.\n */\n\nvar ListView = createReactClass({\n  displayName: 'ListView',\n  _childFrames: ([]: Array<Object>),\n  _sentEndForContentLength: (null: ?number),\n  _scrollComponent: (null: any),\n  _prevRenderedRowsCount: 0,\n  _visibleRows: ({}: Object),\n  scrollProperties: ({}: Object),\n\n  mixins: [ScrollResponder.Mixin, TimerMixin],\n\n  statics: {\n    DataSource: ListViewDataSource,\n  },\n\n  /**\n   * You must provide a renderRow function. If you omit any of the other render\n   * functions, ListView will simply skip rendering them.\n   *\n   * - renderRow(rowData, sectionID, rowID, highlightRow);\n   * - renderSectionHeader(sectionData, sectionID);\n   */\n  propTypes: {\n    ...ScrollView.propTypes,\n    /**\n     * An instance of [ListView.DataSource](docs/listviewdatasource.html) to use\n     */\n    dataSource: PropTypes.instanceOf(ListViewDataSource).isRequired,\n    /**\n     * (sectionID, rowID, adjacentRowHighlighted) => renderable\n     *\n     * If provided, a renderable component to be rendered as the separator\n     * below each row but not the last row if there is a section header below.\n     * Take a sectionID and rowID of the row above and whether its adjacent row\n     * is highlighted.\n     */\n    renderSeparator: PropTypes.func,\n    /**\n     * (rowData, sectionID, rowID, highlightRow) => renderable\n     *\n     * Takes a data entry from the data source and its ids and should return\n     * a renderable component to be rendered as the row. By default the data\n     * is exactly what was put into the data source, but it's also possible to\n     * provide custom extractors. ListView can be notified when a row is\n     * being highlighted by calling `highlightRow(sectionID, rowID)`. This\n     * sets a boolean value of adjacentRowHighlighted in renderSeparator, allowing you\n     * to control the separators above and below the highlighted row. The highlighted\n     * state of a row can be reset by calling highlightRow(null).\n     */\n    renderRow: PropTypes.func.isRequired,\n    /**\n     * How many rows to render on initial component mount. Use this to make\n     * it so that the first screen worth of data appears at one time instead of\n     * over the course of multiple frames.\n     */\n    initialListSize: PropTypes.number.isRequired,\n    /**\n     * Called when all rows have been rendered and the list has been scrolled\n     * to within onEndReachedThreshold of the bottom. The native scroll\n     * event is provided.\n     */\n    onEndReached: PropTypes.func,\n    /**\n     * Threshold in pixels (virtual, not physical) for calling onEndReached.\n     */\n    onEndReachedThreshold: PropTypes.number.isRequired,\n    /**\n     * Number of rows to render per event loop. Note: if your 'rows' are actually\n     * cells, i.e. they don't span the full width of your view (as in the\n     * ListViewGridLayoutExample), you should set the pageSize to be a multiple\n     * of the number of cells per row, otherwise you're likely to see gaps at\n     * the edge of the ListView as new pages are loaded.\n     */\n    pageSize: PropTypes.number.isRequired,\n    /**\n     * () => renderable\n     *\n     * The header and footer are always rendered (if these props are provided)\n     * on every render pass. If they are expensive to re-render, wrap them\n     * in StaticContainer or other mechanism as appropriate. Footer is always\n     * at the bottom of the list, and header at the top, on every render pass.\n     * In a horizontal ListView, the header is rendered on the left and the\n     * footer on the right.\n     */\n    renderFooter: PropTypes.func,\n    renderHeader: PropTypes.func,\n    /**\n     * (sectionData, sectionID) => renderable\n     *\n     * If provided, a header is rendered for this section.\n     */\n    renderSectionHeader: PropTypes.func,\n    /**\n     * (props) => renderable\n     *\n     * A function that returns the scrollable component in which the list rows\n     * are rendered. Defaults to returning a ScrollView with the given props.\n     */\n    renderScrollComponent: PropTypes.func.isRequired,\n    /**\n     * How early to start rendering rows before they come on screen, in\n     * pixels.\n     */\n    scrollRenderAheadDistance: PropTypes.number.isRequired,\n    /**\n     * (visibleRows, changedRows) => void\n     *\n     * Called when the set of visible rows changes. `visibleRows` maps\n     * { sectionID: { rowID: true }} for all the visible rows, and\n     * `changedRows` maps { sectionID: { rowID: true | false }} for the rows\n     * that have changed their visibility, with true indicating visible, and\n     * false indicating the view has moved out of view.\n     */\n    onChangeVisibleRows: PropTypes.func,\n    /**\n     * A performance optimization for improving scroll perf of\n     * large lists, used in conjunction with overflow: 'hidden' on the row\n     * containers. This is enabled by default.\n     */\n    removeClippedSubviews: PropTypes.bool,\n    /**\n     * Makes the sections headers sticky. The sticky behavior means that it\n     * will scroll with the content at the top of the section until it reaches\n     * the top of the screen, at which point it will stick to the top until it\n     * is pushed off the screen by the next section header. This property is\n     * not supported in conjunction with `horizontal={true}`. Only enabled by\n     * default on iOS because of typical platform standards.\n     */\n    stickySectionHeadersEnabled: PropTypes.bool,\n    /**\n     * An array of child indices determining which children get docked to the\n     * top of the screen when scrolling. For example, passing\n     * `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the\n     * top of the scroll view. This property is not supported in conjunction\n     * with `horizontal={true}`.\n     */\n    stickyHeaderIndices: PropTypes.arrayOf(PropTypes.number).isRequired,\n    /**\n     * Flag indicating whether empty section headers should be rendered. In the future release\n     * empty section headers will be rendered by default, and the flag will be deprecated.\n     * If empty sections are not desired to be rendered their indices should be excluded from sectionID object.\n     */\n    enableEmptySections: PropTypes.bool,\n  },\n\n  /**\n   * Exports some data, e.g. for perf investigations or analytics.\n   */\n  getMetrics: function() {\n    return {\n      contentLength: this.scrollProperties.contentLength,\n      totalRows: this.props.enableEmptySections\n        ? this.props.dataSource.getRowAndSectionCount()\n        : this.props.dataSource.getRowCount(),\n      renderedRows: this.state.curRenderedRowsCount,\n      visibleRows: Object.keys(this._visibleRows).length,\n    };\n  },\n\n  /**\n   * Provides a handle to the underlying scroll responder.\n   * Note that `this._scrollComponent` might not be a `ScrollView`, so we\n   * need to check that it responds to `getScrollResponder` before calling it.\n   */\n  getScrollResponder: function() {\n    if (this._scrollComponent && this._scrollComponent.getScrollResponder) {\n      return this._scrollComponent.getScrollResponder();\n    }\n  },\n\n  getScrollableNode: function() {\n    if (this._scrollComponent && this._scrollComponent.getScrollableNode) {\n      return this._scrollComponent.getScrollableNode();\n    } else {\n      return ReactNative.findNodeHandle(this._scrollComponent);\n    }\n  },\n\n  /**\n   * Scrolls to a given x, y offset, either immediately or with a smooth animation.\n   *\n   * See `ScrollView#scrollTo`.\n   */\n  scrollTo: function(...args: Array<mixed>) {\n    if (this._scrollComponent && this._scrollComponent.scrollTo) {\n      this._scrollComponent.scrollTo(...args);\n    }\n  },\n\n  /**\n   * If this is a vertical ListView scrolls to the bottom.\n   * If this is a horizontal ListView 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   * See `ScrollView#scrollToEnd`.\n   */\n  scrollToEnd: function(options?: ?{animated?: ?boolean}) {\n    if (this._scrollComponent) {\n      if (this._scrollComponent.scrollToEnd) {\n        this._scrollComponent.scrollToEnd(options);\n      } else {\n        console.warn(\n          'The scroll component used by the ListView does not support ' +\n            'scrollToEnd. Check the renderScrollComponent prop of your ListView.',\n        );\n      }\n    }\n  },\n\n  /**\n   * Displays the scroll indicators momentarily.\n   *\n   * @platform ios\n   */\n  flashScrollIndicators: function() {\n    if (this._scrollComponent && this._scrollComponent.flashScrollIndicators) {\n      this._scrollComponent.flashScrollIndicators();\n    }\n  },\n\n  setNativeProps: function(props: Object) {\n    if (this._scrollComponent) {\n      this._scrollComponent.setNativeProps(props);\n    }\n  },\n\n  /**\n   * React life cycle hooks.\n   */\n\n  getDefaultProps: function() {\n    return {\n      initialListSize: DEFAULT_INITIAL_ROWS,\n      pageSize: DEFAULT_PAGE_SIZE,\n      renderScrollComponent: props => <ScrollView {...props} />,\n      scrollRenderAheadDistance: DEFAULT_SCROLL_RENDER_AHEAD,\n      onEndReachedThreshold: DEFAULT_END_REACHED_THRESHOLD,\n      stickySectionHeadersEnabled: Platform.OS === 'ios',\n      stickyHeaderIndices: [],\n      autoScrollToBottom: false,\n    };\n  },\n\n  getInitialState: function() {\n    return {\n      curRenderedRowsCount: this.props.initialListSize,\n      highlightedRow: ({}: Object),\n    };\n  },\n\n  getInnerViewNode: function() {\n    return this._scrollComponent.getInnerViewNode();\n  },\n\n  componentWillMount: function() {\n    // this data should never trigger a render pass, so don't put in state\n    this.scrollProperties = {\n      visibleLength: null,\n      contentLength: null,\n      offset: 0,\n    };\n    this._childFrames = [];\n    this._visibleRows = {};\n    this._prevRenderedRowsCount = 0;\n    this._sentEndForContentLength = null;\n  },\n\n  componentDidMount: function() {\n    // do this in animation frame until componentDidMount actually runs after\n    // the component is laid out\n    // this.requestAnimationFrame(() => {\n    //   this._measureAndUpdateScrollProps();\n    // });\n  },\n\n  componentWillReceiveProps: function(nextProps: Object) {\n    if (\n      this.props.dataSource !== nextProps.dataSource ||\n      this.props.initialListSize !== nextProps.initialListSize\n    ) {\n      this.setState(\n        (state, props) => {\n          this._prevRenderedRowsCount = 0;\n          return {\n            curRenderedRowsCount: Math.min(\n              Math.max(state.curRenderedRowsCount, props.initialListSize),\n              props.enableEmptySections\n                ? props.dataSource.getRowAndSectionCount()\n                : props.dataSource.getRowCount(),\n            ),\n          };\n        },\n        () => this._renderMoreRowsIfNeeded(),\n      );\n    }\n  },\n\n  componentDidUpdate: function() {\n    // this.requestAnimationFrame(() => {\n    //   this._measureAndUpdateScrollProps();\n    // });\n  },\n\n  _onRowHighlighted: function(sectionID: string, rowID: string) {\n    this.setState({highlightedRow: {sectionID, rowID}});\n  },\n\n  render: function() {\n    var bodyComponents = [];\n\n    var dataSource = this.props.dataSource;\n    var allRowIDs = dataSource.rowIdentities;\n    var rowCount = 0;\n    var stickySectionHeaderIndices = [];\n\n    const {renderSectionHeader} = this.props;\n\n    var header = this.props.renderHeader && this.props.renderHeader();\n    var footer = this.props.renderFooter && this.props.renderFooter();\n    var totalIndex = header ? 1 : 0;\n\n    for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {\n      var sectionID = dataSource.sectionIdentities[sectionIdx];\n      var rowIDs = allRowIDs[sectionIdx];\n      if (rowIDs.length === 0) {\n        if (this.props.enableEmptySections === undefined) {\n          /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses\n           * an error found when Flow v0.54 was deployed. To see the error\n           * delete this comment and run Flow. */\n          var warning = require('fbjs/lib/warning');\n          warning(\n            false,\n            'In next release empty section headers will be rendered.' +\n              \" In this release you can use 'enableEmptySections' flag to render empty section headers.\",\n          );\n          continue;\n        } else {\n          var invariant = require('fbjs/lib/invariant');\n          invariant(\n            this.props.enableEmptySections,\n            \"In next release 'enableEmptySections' flag will be deprecated, empty section headers will always be rendered.\" +\n              ' If empty section headers are not desirable their indices should be excluded from sectionIDs object.' +\n              \" In this release 'enableEmptySections' may only have value 'true' to allow empty section headers rendering.\",\n          );\n        }\n      }\n\n      if (renderSectionHeader) {\n        const element = renderSectionHeader(\n          dataSource.getSectionHeaderData(sectionIdx),\n          sectionID,\n        );\n        if (element) {\n          bodyComponents.push(\n            React.cloneElement(element, {key: 's_' + sectionID}),\n          );\n          if (this.props.stickySectionHeadersEnabled) {\n            stickySectionHeaderIndices.push(totalIndex);\n          }\n          totalIndex++;\n        }\n      }\n\n      for (var rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) {\n        // Inverting index if this is inverting ListView\n        var rowID = this.props.autoScrollToBottom\n          ? rowIDs.length - 1 - rowIdx\n          : rowIDs[rowIdx];\n\n        var comboID = sectionID + '_' + rowID;\n        var shouldUpdateRow =\n          rowCount >= this._prevRenderedRowsCount &&\n          dataSource.rowShouldUpdate(sectionIdx, rowIdx);\n\n        var row = (\n          <StaticRenderer\n            key={'r_' + comboID}\n            shouldUpdate={!!shouldUpdateRow}\n            render={this.props.renderRow.bind(\n              null,\n              dataSource.getRowData(sectionIdx, rowID),\n              sectionID,\n              rowID,\n              this._onRowHighlighted,\n            )}\n          />\n        );\n\n        /*\n         * Prepend items\n         */\n        if (this.props.autoScrollToBottom) {\n          bodyComponents = [row].concat(bodyComponents);\n        } else {\n          bodyComponents.push(row);\n        }\n\n        totalIndex++;\n\n        if (\n          this.props.renderSeparator &&\n          (rowIdx !== rowIDs.length - 1 || sectionIdx === allRowIDs.length - 1)\n        ) {\n          var adjacentRowHighlighted =\n            this.state.highlightedRow.sectionID === sectionID &&\n            (this.state.highlightedRow.rowID === rowID ||\n              this.state.highlightedRow.rowID === rowIDs[rowIdx + 1]);\n          var separator = this.props.renderSeparator(\n            sectionID,\n            rowID,\n            adjacentRowHighlighted,\n          );\n          if (separator) {\n            bodyComponents.push(<View key={'s_' + comboID}>{separator}</View>);\n            totalIndex++;\n          }\n        }\n        if (++rowCount === this.state.curRenderedRowsCount) {\n          break;\n        }\n      }\n      if (rowCount >= this.state.curRenderedRowsCount) {\n        break;\n      }\n    }\n\n    var {renderScrollComponent, ...props} = this.props;\n    if (!props.scrollEventThrottle) {\n      props.scrollEventThrottle = DEFAULT_SCROLL_CALLBACK_THROTTLE;\n    }\n    if (props.removeClippedSubviews === undefined) {\n      props.removeClippedSubviews = true;\n    }\n    Object.assign(props, {\n      onScroll: this._onScroll,\n      stickyHeaderIndices: this.props.stickyHeaderIndices.concat(\n        stickySectionHeaderIndices,\n      ),\n\n      // Do not pass these events downstream to ScrollView since they will be\n      // registered in ListView's own ScrollResponder.Mixin\n      onKeyboardWillShow: undefined,\n      onKeyboardWillHide: undefined,\n      onKeyboardDidShow: undefined,\n      onKeyboardDidHide: undefined,\n    });\n\n    return cloneReferencedElement(\n      renderScrollComponent(props),\n      {\n        ref: this._setScrollComponentRef,\n        onContentSizeChange: this._onContentSizeChange,\n        onLayout: this._onLayout,\n        DEPRECATED_sendUpdatedChildFrames:\n          typeof props.onChangeVisibleRows !== undefined,\n      },\n      header,\n      bodyComponents,\n      footer,\n    );\n  },\n\n  /**\n   * Private methods\n   */\n\n  _measureAndUpdateScrollProps: function() {\n    var scrollComponent = this.getScrollResponder();\n    if (!scrollComponent || !scrollComponent.getInnerViewNode) {\n      return;\n    }\n\n    // RCTScrollViewManager.calculateChildFrames is not available on\n    // every platform\n    RCTScrollViewManager &&\n      RCTScrollViewManager.calculateChildFrames &&\n      RCTScrollViewManager.calculateChildFrames(\n        ReactNative.findNodeHandle(scrollComponent),\n        this._updateVisibleRows,\n      );\n  },\n\n  _setScrollComponentRef: function(scrollComponent: Object) {\n    this._scrollComponent = scrollComponent;\n  },\n\n  _onContentSizeChange: function(width: number, height: number) {\n    var contentLength = !this.props.horizontal ? height : width;\n    if (contentLength !== this.scrollProperties.contentLength) {\n      this.scrollProperties.contentLength = contentLength;\n      this._updateVisibleRows();\n      this._renderMoreRowsIfNeeded();\n    }\n    this.props.onContentSizeChange &&\n      this.props.onContentSizeChange(width, height);\n  },\n\n  _onLayout: function(event: Object) {\n    var {width, height} = event.nativeEvent.layout;\n    var visibleLength = !this.props.horizontal ? height : width;\n    if (visibleLength !== this.scrollProperties.visibleLength) {\n      this.scrollProperties.visibleLength = visibleLength;\n      this._updateVisibleRows();\n      this._renderMoreRowsIfNeeded();\n    }\n    this.props.onLayout && this.props.onLayout(event);\n  },\n\n  _maybeCallOnEndReached: function(event?: Object) {\n    if (\n      this.props.onEndReached &&\n      this.scrollProperties.contentLength !== this._sentEndForContentLength &&\n      this._getDistanceFromEnd(this.scrollProperties) <\n        this.props.onEndReachedThreshold &&\n      this.state.curRenderedRowsCount ===\n        (this.props.enableEmptySections\n          ? this.props.dataSource.getRowAndSectionCount()\n          : this.props.dataSource.getRowCount())\n    ) {\n      this._sentEndForContentLength = this.scrollProperties.contentLength;\n      this.props.onEndReached(event);\n      return true;\n    }\n    return false;\n  },\n\n  _renderMoreRowsIfNeeded: function() {\n    if (\n      this.scrollProperties.contentLength === null ||\n      this.scrollProperties.visibleLength === null ||\n      this.state.curRenderedRowsCount ===\n        (this.props.enableEmptySections\n          ? this.props.dataSource.getRowAndSectionCount()\n          : this.props.dataSource.getRowCount())\n    ) {\n      this._maybeCallOnEndReached();\n      return;\n    }\n\n    var distanceFromEnd = this._getDistanceFromEnd(this.scrollProperties);\n    if (distanceFromEnd < this.props.scrollRenderAheadDistance) {\n      this._pageInNewRows();\n    }\n  },\n\n  _pageInNewRows: function() {\n    this.setState(\n      (state, props) => {\n        var rowsToRender = Math.min(\n          state.curRenderedRowsCount + props.pageSize,\n          props.enableEmptySections\n            ? props.dataSource.getRowAndSectionCount()\n            : props.dataSource.getRowCount(),\n        );\n        this._prevRenderedRowsCount = state.curRenderedRowsCount;\n        return {\n          curRenderedRowsCount: rowsToRender,\n        };\n      },\n      () => {\n        this._measureAndUpdateScrollProps();\n        this._prevRenderedRowsCount = this.state.curRenderedRowsCount;\n      },\n    );\n  },\n\n  _getDistanceFromEnd: function(scrollProperties: Object) {\n    return (\n      scrollProperties.contentLength -\n      scrollProperties.visibleLength -\n      scrollProperties.offset\n    );\n  },\n\n  _updateVisibleRows: function(updatedFrames?: Array<Object>) {\n    if (!this.props.onChangeVisibleRows) {\n      return; // No need to compute visible rows if there is no callback\n    }\n    if (updatedFrames) {\n      updatedFrames.forEach(newFrame => {\n        this._childFrames[newFrame.index] = merge(newFrame);\n      });\n    }\n    var isVertical = !this.props.horizontal;\n    var dataSource = this.props.dataSource;\n    var visibleMin = this.scrollProperties.offset;\n    var visibleMax = visibleMin + this.scrollProperties.visibleLength;\n    var allRowIDs = dataSource.rowIdentities;\n\n    var header = this.props.renderHeader && this.props.renderHeader();\n    var totalIndex = header ? 1 : 0;\n    var visibilityChanged = false;\n    var changedRows = {};\n    for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {\n      var rowIDs = allRowIDs[sectionIdx];\n      if (rowIDs.length === 0) {\n        continue;\n      }\n      var sectionID = dataSource.sectionIdentities[sectionIdx];\n      if (this.props.renderSectionHeader) {\n        totalIndex++;\n      }\n      var visibleSection = this._visibleRows[sectionID];\n      if (!visibleSection) {\n        visibleSection = {};\n      }\n      for (var rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) {\n        var rowID = rowIDs[rowIdx];\n        var frame = this._childFrames[totalIndex];\n        totalIndex++;\n        if (\n          this.props.renderSeparator &&\n          (rowIdx !== rowIDs.length - 1 || sectionIdx === allRowIDs.length - 1)\n        ) {\n          totalIndex++;\n        }\n        if (!frame) {\n          break;\n        }\n        var rowVisible = visibleSection[rowID];\n        var min = isVertical ? frame.y : frame.x;\n        var max = min + (isVertical ? frame.height : frame.width);\n        if ((!min && !max) || min === max) {\n          break;\n        }\n        if (min > visibleMax || max < visibleMin) {\n          if (rowVisible) {\n            visibilityChanged = true;\n            delete visibleSection[rowID];\n            if (!changedRows[sectionID]) {\n              changedRows[sectionID] = {};\n            }\n            changedRows[sectionID][rowID] = false;\n          }\n        } else if (!rowVisible) {\n          visibilityChanged = true;\n          visibleSection[rowID] = true;\n          if (!changedRows[sectionID]) {\n            changedRows[sectionID] = {};\n          }\n          changedRows[sectionID][rowID] = true;\n        }\n      }\n      if (!isEmpty(visibleSection)) {\n        this._visibleRows[sectionID] = visibleSection;\n      } else if (this._visibleRows[sectionID]) {\n        delete this._visibleRows[sectionID];\n      }\n    }\n    visibilityChanged &&\n      this.props.onChangeVisibleRows(this._visibleRows, changedRows);\n  },\n\n  _onScroll: function(e: Object) {\n    var isVertical = !this.props.horizontal;\n    this.scrollProperties.visibleLength =\n      e.nativeEvent.layoutMeasurement[isVertical ? 'height' : 'width'];\n    this.scrollProperties.contentLength =\n      e.nativeEvent.contentSize[isVertical ? 'height' : 'width'];\n    this.scrollProperties.offset =\n      e.nativeEvent.contentOffset[isVertical ? 'y' : 'x'];\n    this._updateVisibleRows(e.nativeEvent.updatedChildFrames);\n    if (!this._maybeCallOnEndReached(e)) {\n      this._renderMoreRowsIfNeeded();\n    }\n\n    if (\n      this.props.onEndReached &&\n      this._getDistanceFromEnd(this.scrollProperties) >\n        this.props.onEndReachedThreshold\n    ) {\n      // Scrolled out of the end zone, so it should be able to trigger again.\n      this._sentEndForContentLength = null;\n    }\n\n    this.props.onScroll && this.props.onScroll(e);\n  },\n});\n\nmodule.exports = ListView;\n"
  },
  {
    "path": "Libraries/Lists/ListView/ListViewDataSource.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ListViewDataSource\n * @flow\n * @format\n */\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\nvar isEmpty = require('isEmpty');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar warning = require('fbjs/lib/warning');\n\nfunction defaultGetRowData(\n  dataBlob: any,\n  sectionID: number | string,\n  rowID: number | string,\n): any {\n  return dataBlob[sectionID][rowID];\n}\n\nfunction defaultGetSectionHeaderData(\n  dataBlob: any,\n  sectionID: number | string,\n): any {\n  return dataBlob[sectionID];\n}\n\ntype differType = (data1: any, data2: any) => boolean;\n\ntype ParamType = {\n  rowHasChanged: differType,\n  getRowData?: ?typeof defaultGetRowData,\n  sectionHeaderHasChanged?: ?differType,\n  getSectionHeaderData?: ?typeof defaultGetSectionHeaderData,\n};\n\n/**\n * Provides efficient data processing and access to the\n * `ListView` component.  A `ListViewDataSource` is created with functions for\n * extracting data from the input blob, and comparing elements (with default\n * implementations for convenience).  The input blob can be as simple as an\n * array of strings, or an object with rows nested inside section objects.\n *\n * To update the data in the datasource, use `cloneWithRows` (or\n * `cloneWithRowsAndSections` if you care about sections).  The data in the\n * data source is immutable, so you can't modify it directly.  The clone methods\n * suck in the new data and compute a diff for each row so ListView knows\n * whether to re-render it or not.\n *\n * In this example, a component receives data in chunks, handled by\n * `_onDataArrived`, which concats the new data onto the old data and updates the\n * data source.  We use `concat` to create a new array - mutating `this._data`,\n * e.g. with `this._data.push(newRowData)`, would be an error. `_rowHasChanged`\n * understands the shape of the row data and knows how to efficiently compare\n * it.\n *\n * ```\n * getInitialState: function() {\n *   var ds = new ListView.DataSource({rowHasChanged: this._rowHasChanged});\n *   return {ds};\n * },\n * _onDataArrived(newData) {\n *   this._data = this._data.concat(newData);\n *   this.setState({\n *     ds: this.state.ds.cloneWithRows(this._data)\n *   });\n * }\n * ```\n */\n\nclass ListViewDataSource {\n  /**\n   * You can provide custom extraction and `hasChanged` functions for section\n   * headers and rows.  If absent, data will be extracted with the\n   * `defaultGetRowData` and `defaultGetSectionHeaderData` functions.\n   *\n   * The default extractor expects data of one of the following forms:\n   *\n   *      { sectionID_1: { rowID_1: <rowData1>, ... }, ... }\n   *\n   *    or\n   *\n   *      { sectionID_1: [ <rowData1>, <rowData2>, ... ], ... }\n   *\n   *    or\n   *\n   *      [ [ <rowData1>, <rowData2>, ... ], ... ]\n   *\n   * The constructor takes in a params argument that can contain any of the\n   * following:\n   *\n   * - getRowData(dataBlob, sectionID, rowID);\n   * - getSectionHeaderData(dataBlob, sectionID);\n   * - rowHasChanged(prevRowData, nextRowData);\n   * - sectionHeaderHasChanged(prevSectionData, nextSectionData);\n   */\n  constructor(params: ParamType) {\n    invariant(\n      params && typeof params.rowHasChanged === 'function',\n      'Must provide a rowHasChanged function.',\n    );\n    this._rowHasChanged = params.rowHasChanged;\n    this._getRowData = params.getRowData || defaultGetRowData;\n    this._sectionHeaderHasChanged = params.sectionHeaderHasChanged;\n    this._getSectionHeaderData =\n      params.getSectionHeaderData || defaultGetSectionHeaderData;\n\n    this._dataBlob = null;\n    this._dirtyRows = [];\n    this._dirtySections = [];\n    this._cachedRowCount = 0;\n\n    // These two private variables are accessed by outsiders because ListView\n    // uses them to iterate over the data in this class.\n    this.rowIdentities = [];\n    this.sectionIdentities = [];\n  }\n\n  /**\n   * Clones this `ListViewDataSource` with the specified `dataBlob` and\n   * `rowIdentities`. The `dataBlob` is just an arbitrary blob of data. At\n   * construction an extractor to get the interesting information was defined\n   * (or the default was used).\n   *\n   * The `rowIdentities` is a 2D array of identifiers for rows.\n   * ie. [['a1', 'a2'], ['b1', 'b2', 'b3'], ...].  If not provided, it's\n   * assumed that the keys of the section data are the row identities.\n   *\n   * Note: This function does NOT clone the data in this data source. It simply\n   * passes the functions defined at construction to a new data source with\n   * the data specified. If you wish to maintain the existing data you must\n   * handle merging of old and new data separately and then pass that into\n   * this function as the `dataBlob`.\n   */\n  cloneWithRows(\n    dataBlob: $ReadOnlyArray<any> | {+[key: string]: any},\n    rowIdentities: ?$ReadOnlyArray<string>,\n  ): ListViewDataSource {\n    var rowIds = rowIdentities ? [[...rowIdentities]] : null;\n    if (!this._sectionHeaderHasChanged) {\n      this._sectionHeaderHasChanged = () => false;\n    }\n    return this.cloneWithRowsAndSections({s1: dataBlob}, ['s1'], rowIds);\n  }\n\n  /**\n   * This performs the same function as the `cloneWithRows` function but here\n   * you also specify what your `sectionIdentities` are. If you don't care\n   * about sections you should safely be able to use `cloneWithRows`.\n   *\n   * `sectionIdentities` is an array of identifiers for sections.\n   * ie. ['s1', 's2', ...].  The identifiers should correspond to the keys or array indexes\n   * of the data you wish to include.  If not provided, it's assumed that the\n   * keys of dataBlob are the section identities.\n   *\n   * Note: this returns a new object!\n   *\n   * ```\n   * const dataSource = ds.cloneWithRowsAndSections({\n   *   addresses: ['row 1', 'row 2'],\n   *   phone_numbers: ['data 1', 'data 2'],\n   * }, ['phone_numbers']);\n   * ```\n   */\n  cloneWithRowsAndSections(\n    dataBlob: any,\n    sectionIdentities: ?Array<string>,\n    rowIdentities: ?Array<Array<string>>,\n  ): ListViewDataSource {\n    invariant(\n      typeof this._sectionHeaderHasChanged === 'function',\n      'Must provide a sectionHeaderHasChanged function with section data.',\n    );\n    invariant(\n      !sectionIdentities ||\n        !rowIdentities ||\n        sectionIdentities.length === rowIdentities.length,\n      'row and section ids lengths must be the same',\n    );\n\n    var newSource = new ListViewDataSource({\n      getRowData: this._getRowData,\n      getSectionHeaderData: this._getSectionHeaderData,\n      rowHasChanged: this._rowHasChanged,\n      sectionHeaderHasChanged: this._sectionHeaderHasChanged,\n    });\n    newSource._dataBlob = dataBlob;\n    if (sectionIdentities) {\n      newSource.sectionIdentities = sectionIdentities;\n    } else {\n      newSource.sectionIdentities = Object.keys(dataBlob);\n    }\n    if (rowIdentities) {\n      newSource.rowIdentities = rowIdentities;\n    } else {\n      newSource.rowIdentities = [];\n      newSource.sectionIdentities.forEach(sectionID => {\n        newSource.rowIdentities.push(Object.keys(dataBlob[sectionID]));\n      });\n    }\n    newSource._cachedRowCount = countRows(newSource.rowIdentities);\n\n    newSource._calculateDirtyArrays(\n      this._dataBlob,\n      this.sectionIdentities,\n      this.rowIdentities,\n    );\n\n    return newSource;\n  }\n\n  /**\n   * Returns the total number of rows in the data source.\n   *\n   * If you are specifying the rowIdentities or sectionIdentities, then `getRowCount` will return the number of rows in the filtered data source.\n   */\n  getRowCount(): number {\n    return this._cachedRowCount;\n  }\n\n  /**\n   * Returns the total number of rows in the data source (see `getRowCount` for how this is calculated) plus the number of sections in the data.\n   *\n   * If you are specifying the rowIdentities or sectionIdentities, then `getRowAndSectionCount` will return the number of rows & sections in the filtered data source.\n   */\n  getRowAndSectionCount(): number {\n    return this._cachedRowCount + this.sectionIdentities.length;\n  }\n\n  /**\n   * Returns if the row is dirtied and needs to be rerendered\n   */\n  rowShouldUpdate(sectionIndex: number, rowIndex: number): boolean {\n    var needsUpdate = this._dirtyRows[sectionIndex][rowIndex];\n    warning(\n      needsUpdate !== undefined,\n      'missing dirtyBit for section, row: ' + sectionIndex + ', ' + rowIndex,\n    );\n    return needsUpdate;\n  }\n\n  /**\n   * Gets the data required to render the row.\n   */\n  getRowData(sectionIndex: number, rowIndex: number): any {\n    var sectionID = this.sectionIdentities[sectionIndex];\n    var rowID = this.rowIdentities[sectionIndex][rowIndex];\n    warning(\n      sectionID !== undefined && rowID !== undefined,\n      'rendering invalid section, row: ' + sectionIndex + ', ' + rowIndex,\n    );\n    return this._getRowData(this._dataBlob, sectionID, rowID);\n  }\n\n  /**\n   * Gets the rowID at index provided if the dataSource arrays were flattened,\n   * or null of out of range indexes.\n   */\n  getRowIDForFlatIndex(index: number): ?string {\n    var accessIndex = index;\n    for (var ii = 0; ii < this.sectionIdentities.length; ii++) {\n      if (accessIndex >= this.rowIdentities[ii].length) {\n        accessIndex -= this.rowIdentities[ii].length;\n      } else {\n        return this.rowIdentities[ii][accessIndex];\n      }\n    }\n    return null;\n  }\n\n  /**\n   * Gets the sectionID at index provided if the dataSource arrays were flattened,\n   * or null for out of range indexes.\n   */\n  getSectionIDForFlatIndex(index: number): ?string {\n    var accessIndex = index;\n    for (var ii = 0; ii < this.sectionIdentities.length; ii++) {\n      if (accessIndex >= this.rowIdentities[ii].length) {\n        accessIndex -= this.rowIdentities[ii].length;\n      } else {\n        return this.sectionIdentities[ii];\n      }\n    }\n    return null;\n  }\n\n  /**\n   * Returns an array containing the number of rows in each section\n   */\n  getSectionLengths(): Array<number> {\n    var results = [];\n    for (var ii = 0; ii < this.sectionIdentities.length; ii++) {\n      results.push(this.rowIdentities[ii].length);\n    }\n    return results;\n  }\n\n  /**\n   * Returns if the section header is dirtied and needs to be rerendered\n   */\n  sectionHeaderShouldUpdate(sectionIndex: number): boolean {\n    var needsUpdate = this._dirtySections[sectionIndex];\n    warning(\n      needsUpdate !== undefined,\n      'missing dirtyBit for section: ' + sectionIndex,\n    );\n    return needsUpdate;\n  }\n\n  /**\n   * Gets the data required to render the section header\n   */\n  getSectionHeaderData(sectionIndex: number): any {\n    if (!this._getSectionHeaderData) {\n      return null;\n    }\n    var sectionID = this.sectionIdentities[sectionIndex];\n    warning(\n      sectionID !== undefined,\n      'renderSection called on invalid section: ' + sectionIndex,\n    );\n    return this._getSectionHeaderData(this._dataBlob, sectionID);\n  }\n\n  /**\n   * Private members and methods.\n   */\n\n  _getRowData: typeof defaultGetRowData;\n  _getSectionHeaderData: typeof defaultGetSectionHeaderData;\n  _rowHasChanged: differType;\n  _sectionHeaderHasChanged: ?differType;\n\n  _dataBlob: any;\n  _dirtyRows: Array<Array<boolean>>;\n  _dirtySections: Array<boolean>;\n  _cachedRowCount: number;\n\n  // These two 'protected' variables are accessed by ListView to iterate over\n  // the data in this class.\n  rowIdentities: Array<Array<string>>;\n  sectionIdentities: Array<string>;\n\n  _calculateDirtyArrays(\n    prevDataBlob: any,\n    prevSectionIDs: Array<string>,\n    prevRowIDs: Array<Array<string>>,\n  ): void {\n    // construct a hashmap of the existing (old) id arrays\n    var prevSectionsHash = keyedDictionaryFromArray(prevSectionIDs);\n    var prevRowsHash = {};\n    for (var ii = 0; ii < prevRowIDs.length; ii++) {\n      var sectionID = prevSectionIDs[ii];\n      warning(\n        !prevRowsHash[sectionID],\n        'SectionID appears more than once: ' + sectionID,\n      );\n      prevRowsHash[sectionID] = keyedDictionaryFromArray(prevRowIDs[ii]);\n    }\n\n    // compare the 2 identity array and get the dirtied rows\n    this._dirtySections = [];\n    this._dirtyRows = [];\n\n    var dirty;\n    for (var sIndex = 0; sIndex < this.sectionIdentities.length; sIndex++) {\n      var sectionID = this.sectionIdentities[sIndex];\n      // dirty if the sectionHeader is new or _sectionHasChanged is true\n      dirty = !prevSectionsHash[sectionID];\n      var sectionHeaderHasChanged = this._sectionHeaderHasChanged;\n      if (!dirty && sectionHeaderHasChanged) {\n        dirty = sectionHeaderHasChanged(\n          this._getSectionHeaderData(prevDataBlob, sectionID),\n          this._getSectionHeaderData(this._dataBlob, sectionID),\n        );\n      }\n      this._dirtySections.push(!!dirty);\n\n      this._dirtyRows[sIndex] = [];\n      for (\n        var rIndex = 0;\n        rIndex < this.rowIdentities[sIndex].length;\n        rIndex++\n      ) {\n        var rowID = this.rowIdentities[sIndex][rIndex];\n        // dirty if the section is new, row is new or _rowHasChanged is true\n        dirty =\n          !prevSectionsHash[sectionID] ||\n          !prevRowsHash[sectionID][rowID] ||\n          this._rowHasChanged(\n            this._getRowData(prevDataBlob, sectionID, rowID),\n            this._getRowData(this._dataBlob, sectionID, rowID),\n          );\n        this._dirtyRows[sIndex].push(!!dirty);\n      }\n    }\n  }\n}\n\nfunction countRows(allRowIDs) {\n  var totalRows = 0;\n  for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {\n    var rowIDs = allRowIDs[sectionIdx];\n    totalRows += rowIDs.length;\n  }\n  return totalRows;\n}\n\nfunction keyedDictionaryFromArray(arr) {\n  if (isEmpty(arr)) {\n    return {};\n  }\n  var result = {};\n  for (var ii = 0; ii < arr.length; ii++) {\n    var key = arr[ii];\n    warning(!result[key], 'Value appears more than once in array: ' + key);\n    result[key] = true;\n  }\n  return result;\n}\n\nmodule.exports = ListViewDataSource;\n"
  },
  {
    "path": "Libraries/Lists/ListView/__mocks__/ListViewMock.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @format\n */\n'use strict';\n\nconst ListViewDataSource = require('ListViewDataSource');\nconst React = require('React');\nconst ScrollView = require('ScrollView');\nconst StaticRenderer = require('StaticRenderer');\n\nclass ListViewMock extends React.Component<$FlowFixMeProps> {\n  static latestRef: ?ListViewMock;\n  static defaultProps = {\n    /* $FlowFixMe(>=0.59.0 site=react_native_fb) This comment suppresses an\n     * error caught by Flow 0.59 which was not caught before. Most likely, this\n     * error is because an exported function parameter is missing an\n     * annotation. Without an annotation, these parameters are uncovered by\n     * Flow. */\n    renderScrollComponent: props => <ScrollView {...props} />,\n  };\n  componentDidMount() {\n    ListViewMock.latestRef = this;\n  }\n  render() {\n    const {dataSource, renderFooter, renderHeader} = this.props;\n    const rows = [renderHeader && renderHeader()];\n    const allRowIDs = dataSource.rowIdentities;\n    for (let sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {\n      const sectionID = dataSource.sectionIdentities[sectionIdx];\n      const rowIDs = allRowIDs[sectionIdx];\n      for (let rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) {\n        const rowID = rowIDs[rowIdx];\n        // Row IDs are only unique in a section\n        rows.push(\n          <StaticRenderer\n            key={'section_' + sectionID + '_row_' + rowID}\n            shouldUpdate={true}\n            render={this.props.renderRow.bind(\n              null,\n              dataSource.getRowData(sectionIdx, rowIdx),\n              sectionID,\n              rowID,\n            )}\n          />,\n        );\n      }\n    }\n    renderFooter && rows.push(renderFooter());\n    return this.props.renderScrollComponent({...this.props, children: rows});\n  }\n  static DataSource = ListViewDataSource;\n}\n\nmodule.exports = ListViewMock;\n"
  },
  {
    "path": "Libraries/Lists/MetroListView.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule MetroListView\n * @flow\n * @format\n */\n'use strict';\n\nconst ListView = require('ListView');\nconst React = require('React');\nconst RefreshControl = require('RefreshControl');\nconst ScrollView = require('ScrollView');\n\nconst invariant = require('fbjs/lib/invariant');\n\ntype Item = any;\n\ntype NormalProps = {\n  FooterComponent?: React.ComponentType<*>,\n  renderItem: (info: Object) => ?React.Element<any>,\n  /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n   * suppresses an error when upgrading Flow's support for React. To see the\n   * error delete this comment and run Flow. */\n  renderSectionHeader?: ({section: Object}) => ?React.Element<any>,\n  SeparatorComponent?: ?React.ComponentType<*>, // not supported yet\n\n  // Provide either `items` or `sections`\n  items?: ?Array<Item>, // By default, an Item is assumed to be {key: string}\n  // $FlowFixMe - Something is a little off with the type Array<Item>\n  sections?: ?Array<{key: string, data: Array<Item>}>,\n\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?: ?Function,\n  /**\n   * Set this true while waiting for new data from a refresh.\n   */\n  refreshing?: boolean,\n  /**\n   * If true, renders items next to each other horizontally instead of stacked vertically.\n   */\n  horizontal?: ?boolean,\n};\ntype DefaultProps = {\n  keyExtractor: (item: Item, index: number) => string,\n};\n/* $FlowFixMe - the renderItem passed in from SectionList is optional there but\n * required here */\ntype Props = NormalProps & DefaultProps;\n\n/**\n * This is just a wrapper around the legacy ListView that matches the new API of FlatList, but with\n * some section support tacked on. It is recommended to just use FlatList directly, this component\n * is mostly for debugging and performance comparison.\n */\nclass MetroListView extends React.Component<Props, $FlowFixMeState> {\n  scrollToEnd(params?: ?{animated?: ?boolean}) {\n    throw new Error('scrollToEnd not supported in legacy ListView.');\n  }\n  scrollToIndex(params: {\n    animated?: ?boolean,\n    index: number,\n    viewPosition?: number,\n  }) {\n    throw new Error('scrollToIndex not supported in legacy ListView.');\n  }\n  scrollToItem(params: {\n    animated?: ?boolean,\n    item: Item,\n    viewPosition?: number,\n  }) {\n    throw new Error('scrollToItem not supported in legacy ListView.');\n  }\n  scrollToLocation(params: {\n    animated?: ?boolean,\n    itemIndex: number,\n    sectionIndex: number,\n    viewOffset?: number,\n    viewPosition?: number,\n  }) {\n    throw new Error('scrollToLocation not supported in legacy ListView.');\n  }\n  scrollToOffset(params: {animated?: ?boolean, offset: number}) {\n    const {animated, offset} = params;\n    this._listRef.scrollTo(\n      this.props.horizontal ? {x: offset, animated} : {y: offset, animated},\n    );\n  }\n  getListRef() {\n    return this._listRef;\n  }\n  setNativeProps(props: Object) {\n    if (this._listRef) {\n      this._listRef.setNativeProps(props);\n    }\n  }\n  static defaultProps: DefaultProps = {\n    keyExtractor: (item, index) => item.key || String(index),\n    renderScrollComponent: (props: Props) => {\n      if (props.onRefresh) {\n        return (\n          <ScrollView\n            {...props}\n            refreshControl={\n              /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss)\n               * This comment suppresses an error when upgrading Flow's support\n               * for React. To see the error delete this comment and run Flow.\n               */\n              <RefreshControl\n                refreshing={props.refreshing}\n                onRefresh={props.onRefresh}\n              />\n            }\n          />\n        );\n      } else {\n        return <ScrollView {...props} />;\n      }\n    },\n  };\n  state = this._computeState(this.props, {\n    ds: new ListView.DataSource({\n      rowHasChanged: (itemA, itemB) => true,\n      sectionHeaderHasChanged: () => true,\n      getSectionHeaderData: (dataBlob, sectionID) =>\n        this.state.sectionHeaderData[sectionID],\n    }),\n    sectionHeaderData: {},\n  });\n  componentWillReceiveProps(newProps: Props) {\n    this.setState(state => this._computeState(newProps, state));\n  }\n  render() {\n    return (\n      <ListView\n        {...this.props}\n        dataSource={this.state.ds}\n        ref={this._captureRef}\n        renderRow={this._renderRow}\n        renderFooter={this.props.FooterComponent && this._renderFooter}\n        renderSectionHeader={this.props.sections && this._renderSectionHeader}\n        renderSeparator={this.props.SeparatorComponent && this._renderSeparator}\n      />\n    );\n  }\n  _listRef: ListView;\n  _captureRef = ref => {\n    this._listRef = ref;\n  };\n  _computeState(props: Props, state) {\n    const sectionHeaderData = {};\n    if (props.sections) {\n      invariant(!props.items, 'Cannot have both sections and items props.');\n      const sections = {};\n      props.sections.forEach((sectionIn, ii) => {\n        const sectionID = 's' + ii;\n        sections[sectionID] = sectionIn.data;\n        sectionHeaderData[sectionID] = sectionIn;\n      });\n      return {\n        ds: state.ds.cloneWithRowsAndSections(sections),\n        sectionHeaderData,\n      };\n    } else {\n      invariant(!props.sections, 'Cannot have both sections and items props.');\n      return {\n        ds: state.ds.cloneWithRows(props.items),\n        sectionHeaderData,\n      };\n    }\n  }\n  /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n   * suppresses an error when upgrading Flow's support for React. To see the\n   * error delete this comment and run Flow. */\n  _renderFooter = () => <this.props.FooterComponent key=\"$footer\" />;\n  _renderRow = (item, sectionID, rowID, highlightRow) => {\n    return this.props.renderItem({item, index: rowID});\n  };\n  _renderSectionHeader = (section, sectionID) => {\n    const {renderSectionHeader} = this.props;\n    invariant(\n      renderSectionHeader,\n      'Must provide renderSectionHeader with sections prop',\n    );\n    return renderSectionHeader({section});\n  };\n  _renderSeparator = (sID, rID) => (\n    /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error when upgrading Flow's support for React. To see the\n     * error delete this comment and run Flow. */\n    <this.props.SeparatorComponent key={sID + rID} />\n  );\n}\n\nmodule.exports = MetroListView;\n"
  },
  {
    "path": "Libraries/Lists/SectionList.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SectionList\n * @flow\n * @format\n */\n'use strict';\n\nconst MetroListView = require('MetroListView');\nconst Platform = require('Platform');\nconst React = require('React');\nconst ScrollView = require('ScrollView');\nconst VirtualizedSectionList = require('VirtualizedSectionList');\n\nimport type {ViewToken} from 'ViewabilityHelper';\nimport type {Props as VirtualizedSectionListProps} from 'VirtualizedSectionList';\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\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  }) => ?React.Element<any>,\n  ItemSeparatorComponent?: ?React.ComponentType<any>,\n  keyExtractor?: (item: SectionItemT) => string,\n\n  // TODO: support more optional/override props\n  // onViewableItemsChanged?: ...\n};\n\ntype RequiredProps<SectionT: SectionBase<any>> = {\n  /**\n   * The actual data to render, akin to the `data` prop in [`<FlatList>`](/react-native/docs/flatlist.html).\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  }) => ?React.Element<any>,\n  /**\n   * Rendered in between each item, but not at the top or bottom. By default, `highlighted`,\n   * `section`, and `[leading/trailing][Item/Separator]` props are provided. `renderItem` provides\n   * `separators.highlight`/`unhighlight` which will update the `highlighted` prop, but you can also\n   * add custom props with `separators.updateProps`.\n   */\n  ItemSeparatorComponent?: ?React.ComponentType<any>,\n  /**\n   * Rendered at the very beginning of the list. 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   * 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 very end of the list. 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   * 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   * 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   * How far from the end (in units of visible length of the list) the bottom 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   * 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  }) => void,\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   * 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: {section: SectionT}) => ?React.Element<any>,\n  /**\n   * Rendered at the bottom of each section.\n   */\n  renderSectionFooter?: ?(info: {section: SectionT}) => ?React.Element<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\n  legacyImplementation?: ?boolean,\n};\n\nexport type Props<SectionT> = RequiredProps<SectionT> &\n  OptionalProps<SectionT> &\n  VirtualizedSectionListProps<SectionT>;\n\nconst defaultProps = {\n  ...VirtualizedSectionList.defaultProps,\n  stickySectionHeadersEnabled: Platform.OS === 'ios',\n};\n\ntype DefaultProps = typeof defaultProps;\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>`](/react-native/docs/flatlist.html).\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.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 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 */\nclass SectionList<SectionT: SectionBase<any>> extends React.PureComponent<\n  Props<SectionT>,\n  void,\n> {\n  props: Props<SectionT>;\n  static defaultProps: DefaultProps = defaultProps;\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: {\n    animated?: ?boolean,\n    itemIndex: number,\n    sectionIndex: number,\n    viewOffset?: number,\n    viewPosition?: number,\n  }) {\n    this._wrapperListRef.scrollToLocation(params);\n  }\n\n  /**\n   * Tells the list an interaction has occured, 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(): ?ScrollView {\n    const listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n    if (listRef) {\n      return listRef.getScrollResponder();\n    }\n  }\n\n  getScrollableNode() {\n    const listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n    if (listRef) {\n      return listRef.getScrollableNode();\n    }\n  }\n\n  setNativeProps(props: Object) {\n    const listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n    if (listRef) {\n      listRef.setNativeProps(props);\n    }\n  }\n\n  render() {\n    const List = this.props.legacyImplementation\n      ? MetroListView\n      : VirtualizedSectionList;\n    return <List {...this.props} ref={this._captureRef} />;\n  }\n\n  _wrapperListRef: MetroListView | VirtualizedSectionList<any>;\n  _captureRef = ref => {\n    /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error when upgrading Flow's support for React. To see the\n     * error delete this comment and run Flow. */\n    this._wrapperListRef = ref;\n  };\n}\n\nmodule.exports = SectionList;\n"
  },
  {
    "path": "Libraries/Lists/ViewabilityHelper.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ViewabilityHelper\n * @flow\n * @format\n */\n'use strict';\n\nconst invariant = require('fbjs/lib/invariant');\n\nexport type ViewToken = {\n  item: any,\n  key: string,\n  index: ?number,\n  isViewable: boolean,\n  section?: any,\n};\n\nexport type ViewabilityConfigCallbackPair = {\n  viewabilityConfig: ViewabilityConfig,\n  onViewableItemsChanged: (info: {\n    viewableItems: Array<ViewToken>,\n    changed: Array<ViewToken>,\n  }) => void,\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  /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an error\n   * found when Flow v0.63 was deployed. To see the error delete this comment\n   * and run Flow. */\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    this._timers.forEach(clearTimeout);\n  }\n\n  /**\n   * Determines which items are viewable based on the current metrics and config.\n   */\n  computeViewableItems(\n    itemCount: number,\n    scrollOffset: number,\n    viewportHeight: number,\n    getFrameMetrics: (index: number) => ?{length: number, offset: number},\n    renderRange?: {first: number, last: number}, // Optional optimization to reduce the scan size\n  ): Array<number> {\n    const {\n      itemVisiblePercentThreshold,\n      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    invariant(\n      last < itemCount,\n      'Invalid render range ' + JSON.stringify({renderRange, itemCount}),\n    );\n    for (let idx = first; idx <= last; idx++) {\n      const metrics = getFrameMetrics(idx);\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    itemCount: number,\n    scrollOffset: number,\n    viewportHeight: number,\n    getFrameMetrics: (index: number) => ?{length: number, offset: number},\n    createViewToken: (index: number, isViewable: boolean) => ViewToken,\n    onViewableItemsChanged: ({\n      viewableItems: Array<ViewToken>,\n      changed: Array<ViewToken>,\n    }) => void,\n    renderRange?: {first: number, last: number}, // Optional optimization to reduce the scan size\n  ): void {\n    if (\n      (this._config.waitForInteraction && !this._hasInteracted) ||\n      itemCount === 0 ||\n      !getFrameMetrics(0)\n    ) {\n      return;\n    }\n    let viewableIndices = [];\n    if (itemCount) {\n      viewableIndices = this.computeViewableItems(\n        itemCount,\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 = setTimeout(() => {\n        this._timers.delete(handle);\n        this._onUpdateSync(\n          viewableIndices,\n          onViewableItemsChanged,\n          createViewToken,\n        );\n      }, this._config.minimumViewTime);\n      this._timers.add(handle);\n    } else {\n      this._onUpdateSync(\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    viewableIndicesToCheck,\n    onViewableItemsChanged,\n    createViewToken,\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);\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\nmodule.exports = ViewabilityHelper;\n"
  },
  {
    "path": "Libraries/Lists/VirtualizeUtils.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule VirtualizeUtils\n * @flow\n * @format\n */\n'use strict';\n\nconst invariant = require('fbjs/lib/invariant');\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 */\nfunction elementsThatOverlapOffsets(\n  offsets: Array<number>,\n  itemCount: number,\n  getFrameMetrics: (index: number) => {length: number, offset: number},\n): Array<number> {\n  const out = [];\n  let outLength = 0;\n  for (let ii = 0; ii < itemCount; ii++) {\n    const frame = getFrameMetrics(ii);\n    const trailingOffset = frame.offset + frame.length;\n    for (let kk = 0; kk < offsets.length; kk++) {\n      if (out[kk] == null && trailingOffset >= offsets[kk]) {\n        out[kk] = ii;\n        outLength++;\n        if (kk === offsets.length - 1) {\n          invariant(\n            outLength === offsets.length,\n            'bad offsets input, should be in increasing order: %s',\n            JSON.stringify(offsets),\n          );\n          return out;\n        }\n      }\n    }\n  }\n  return out;\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 */\nfunction newRangeCount(\n  prev: {first: number, last: number},\n  next: {first: number, last: number},\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 */\nfunction computeWindowedRenderLimits(\n  props: {\n    data: any,\n    getItemCount: (data: any) => number,\n    maxToRenderPerBatch: number,\n    windowSize: number,\n  },\n  prev: {first: number, last: number},\n  getFrameMetricsApprox: (index: number) => {length: number, offset: number},\n  scrollMetrics: {\n    dt: number,\n    offset: number,\n    velocity: number,\n    visibleLength: number,\n  },\n): {first: number, last: number} {\n  const {data, getItemCount, maxToRenderPerBatch, windowSize} = props;\n  const itemCount = getItemCount(data);\n  if (itemCount === 0) {\n    return prev;\n  }\n  const {offset, velocity, visibleLength} = 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 = getFrameMetricsApprox(itemCount - 1).offset;\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 targetting.\n  let [overscanFirst, first, last, overscanLast] = elementsThatOverlapOffsets(\n    [overscanBegin, visibleBegin, visibleEnd, overscanEnd],\n    props.getItemCount(props.data),\n    getFrameMetricsApprox,\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\nconst VirtualizeUtils = {\n  computeWindowedRenderLimits,\n  elementsThatOverlapOffsets,\n  newRangeCount,\n};\n\nmodule.exports = VirtualizeUtils;\n"
  },
  {
    "path": "Libraries/Lists/VirtualizedList.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule VirtualizedList\n * @flow\n * @format\n */\n'use strict';\n\nconst Batchinator = require('Batchinator');\nconst FillRateHelper = require('FillRateHelper');\nconst PropTypes = require('prop-types');\nconst React = require('React');\nconst ReactNative = require('ReactNative');\nconst RefreshControl = require('RefreshControl');\nconst ScrollView = require('ScrollView');\nconst StyleSheet = require('StyleSheet');\nconst UIManager = require('UIManager');\nconst View = require('View');\nconst ViewabilityHelper = require('ViewabilityHelper');\n\nconst flattenStyle = require('flattenStyle');\nconst infoLog = require('infoLog');\nconst invariant = require('fbjs/lib/invariant');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst warning = require('fbjs/lib/warning');\n\nconst {computeWindowedRenderLimits} = require('VirtualizeUtils');\n\nimport type {StyleObj} from 'StyleSheetTypes';\nimport type {\n  ViewabilityConfig,\n  ViewToken,\n  ViewabilityConfigCallbackPair,\n} from 'ViewabilityHelper';\n\ntype Item = any;\n\nexport type renderItemType = (info: any) => ?React.Element<any>;\n\ntype ViewabilityHelperCallbackTuple = {\n  viewabilityHelper: ViewabilityHelper,\n  onViewableItemsChanged: (info: {\n    viewableItems: Array<ViewToken>,\n    changed: Array<ViewToken>,\n  }) => void,\n};\n\ntype RequiredProps = {\n  renderItem: renderItemType,\n  /**\n   * The default accessor functions assume this is an Array<{key: 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  /**\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.\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  getItemLayout?: (\n    data: any,\n    index: number,\n  ) => {length: number, offset: number, index: number}, // e.g. height, y\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   * Each cell is rendered using this element. Can be a React Component Class,\n   * or a render function. Defaults to using View.\n   */\n  CellRendererComponent?: ?React.ComponentType<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   * 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   * A unique identifier for this list. If there are multiple VirtualizedLists at the same level of\n   * nesting within another VirtualizedList, this key is necessary for virtualization to\n   * work properly.\n   */\n  listKey?: string,\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 my suffer because rendering content may\n   * interfere with responding to button taps or other interactions.\n   */\n  maxToRenderPerBatch: number,\n  onEndReached?: ?(info: {distanceFromEnd: number}) => void,\n  onEndReachedThreshold?: ?number, // units of visible length\n  onLayout?: ?Function,\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?: ?Function,\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  }) => void,\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  }) => void,\n  /**\n   * Set this when offset is needed for the loading indicator to show correctly.\n   * @platform android\n   */\n  progressViewOffset?: number,\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  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/* $FlowFixMe - this Props seems to be missing a bunch of stuff. Remove this\n * comment to see the errors */\nexport type Props = RequiredProps & OptionalProps;\n\nlet _usedIndexForKey = false;\n\ntype Frame = {\n  offset: number,\n  length: number,\n  index: number,\n  inLayout: boolean,\n};\n\ntype ChildListState = {\n  first: number,\n  last: number,\n  frames: {[key: number]: Frame},\n};\n\ntype State = {first: number, last: number};\n\n/**\n * Base implementation for the more convenient [`<FlatList>`](/react-native/docs/flatlist.html)\n * and [`<SectionList>`](/react-native/docs/sectionlist.html) 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` prop on each item and uses that for the React key.\n *   Alternatively, you can provide a custom `keyExtractor` prop.\n *\n */\nclass VirtualizedList extends React.PureComponent<Props, State> {\n  props: Props;\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    const frame = this._getFrameMetricsApprox(veryLast);\n    const offset = Math.max(\n      0,\n      frame.offset +\n        frame.length +\n        this._footerLength -\n        this._scrollMetrics.visibleLength,\n    );\n    /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error when upgrading Flow's support for React. To see the\n     * error delete this comment and run Flow. */\n    this._scrollRef.scrollTo(\n      /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n       * comment suppresses an error when upgrading Flow's support for React.\n       * To see the error delete this comment and run Flow. */\n      this.props.horizontal ? {x: offset, animated} : {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    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 && index < getItemCount(data),\n      `scrollToIndex out of range: ${index} vs ${getItemCount(data) - 1}`,\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(index);\n    const offset =\n      Math.max(\n        0,\n        frame.offset -\n          (viewPosition || 0) *\n            (this._scrollMetrics.visibleLength - frame.length),\n      ) - (viewOffset || 0);\n    /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error when upgrading Flow's support for React. To see the\n     * error delete this comment and run Flow. */\n    this._scrollRef.scrollTo(\n      /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n       * comment suppresses an error when upgrading Flow's support for React.\n       * To see the error delete this comment and run Flow. */\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    viewPosition?: number,\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    /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error when upgrading Flow's support for React. To see the\n     * error delete this comment and run Flow. */\n    this._scrollRef.scrollTo(\n      /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n       * comment suppresses an error when upgrading Flow's support for React.\n       * To see the error delete this comment and run Flow. */\n      this.props.horizontal ? {x: offset, animated} : {y: offset, animated},\n    );\n  }\n\n  recordInteraction() {\n    this._viewabilityTuples.forEach(t => {\n      t.viewabilityHelper.recordInteraction();\n    });\n    this._updateViewableItems(this.props.data);\n  }\n\n  flashScrollIndicators() {\n    /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error when upgrading Flow's support for React. To see the\n     * error delete this comment and run Flow. */\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() {\n    if (this._scrollRef && this._scrollRef.getScrollResponder) {\n      return this._scrollRef.getScrollResponder();\n    }\n  }\n\n  getScrollableNode() {\n    if (this._scrollRef && this._scrollRef.getScrollableNode) {\n      return this._scrollRef.getScrollableNode();\n    } else {\n      return ReactNative.findNodeHandle(this._scrollRef);\n    }\n  }\n\n  setNativeProps(props: Object) {\n    if (this._scrollRef) {\n      this._scrollRef.setNativeProps(props);\n    }\n  }\n\n  static defaultProps = {\n    disableVirtualization: false,\n    horizontal: false,\n    initialNumToRender: 10,\n    keyExtractor: (item: Item, index: number) => {\n      if (item.key != null) {\n        return item.key;\n      }\n      _usedIndexForKey = true;\n      return String(index);\n    },\n    maxToRenderPerBatch: 10,\n    onEndReachedThreshold: 2, // multiples of length\n    scrollEventThrottle: 50,\n    updateCellsBatchingPeriod: 50,\n    windowSize: 21, // multiples of length\n  };\n\n  static contextTypes = {\n    virtualizedCell: PropTypes.shape({\n      cellKey: PropTypes.string,\n    }),\n    virtualizedList: PropTypes.shape({\n      getScrollMetrics: PropTypes.func,\n      horizontal: PropTypes.bool,\n      getOutermostParentListRef: PropTypes.func,\n      registerAsNestedChild: PropTypes.func,\n      unregisterAsNestedChild: PropTypes.func,\n    }),\n  };\n\n  static childContextTypes = {\n    virtualizedList: PropTypes.shape({\n      getScrollMetrics: PropTypes.func,\n      horizontal: PropTypes.bool,\n      getOutermostParentListRef: PropTypes.func,\n      registerAsNestedChild: PropTypes.func,\n      unregisterAsNestedChild: PropTypes.func,\n    }),\n  };\n\n  getChildContext() {\n    return {\n      virtualizedList: {\n        getScrollMetrics: this._getScrollMetrics,\n        horizontal: this.props.horizontal,\n        getOutermostParentListRef: this._getOutermostParentListRef,\n        registerAsNestedChild: this._registerAsNestedChild,\n        unregisterAsNestedChild: this._unregisterAsNestedChild,\n      },\n    };\n  }\n\n  _getCellKey(): string {\n    return (\n      (this.context.virtualizedCell && this.context.virtualizedCell.cellKey) ||\n      'rootList'\n    );\n  }\n\n  _getScrollMetrics = () => {\n    return this._scrollMetrics;\n  };\n\n  hasMore(): boolean {\n    return this._hasMore;\n  }\n\n  _getOutermostParentListRef = () => {\n    if (this._isNestedWithSameOrientation()) {\n      return this.context.virtualizedList.getOutermostParentListRef();\n    } else {\n      return this;\n    }\n  };\n\n  _registerAsNestedChild = (childList: {\n    cellKey: string,\n    key: string,\n    ref: VirtualizedList,\n  }): ?ChildListState => {\n    // Register the mapping between this child key and the cellKey for its cell\n    const childListsInCell =\n      this._cellKeysToChildListKeys.get(childList.cellKey) || new Set();\n    childListsInCell.add(childList.key);\n    this._cellKeysToChildListKeys.set(childList.cellKey, childListsInCell);\n\n    const existingChildData = this._nestedChildLists.get(childList.key);\n    invariant(\n      !(existingChildData && existingChildData.ref !== null),\n      'A VirtualizedList contains a cell which itself contains ' +\n        'more than one VirtualizedList of the same orientation as the parent ' +\n        'list. You must pass a unique listKey prop to each sibling list.',\n    );\n    this._nestedChildLists.set(childList.key, {\n      ref: childList.ref,\n      state: null,\n    });\n\n    return existingChildData && existingChildData.state;\n  };\n\n  _unregisterAsNestedChild = (childList: {\n    key: string,\n    state: ChildListState,\n  }): void => {\n    this._nestedChildLists.set(childList.key, {\n      ref: null,\n      state: childList.state,\n    });\n  };\n\n  state: State;\n\n  constructor(props: Props, context: Object) {\n    super(props, context);\n    invariant(\n      !props.onScroll || !props.onScroll.__isNative,\n      'Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent ' +\n        'to support native onScroll events with useNativeDriver',\n    );\n\n    invariant(\n      props.windowSize > 0,\n      'VirtualizedList: The windowSize prop must be present and set to a value greater than 0.',\n    );\n\n    this._fillRateHelper = new FillRateHelper(this._getFrameMetrics);\n    this._updateCellsToRenderBatcher = new Batchinator(\n      this._updateCellsToRender,\n      this.props.updateCellsBatchingPeriod,\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 if (this.props.onViewableItemsChanged) {\n      this._viewabilityTuples.push({\n        viewabilityHelper: new ViewabilityHelper(this.props.viewabilityConfig),\n        onViewableItemsChanged: this.props.onViewableItemsChanged,\n      });\n    }\n\n    let initialState = {\n      first: this.props.initialScrollIndex || 0,\n      last:\n        Math.min(\n          this.props.getItemCount(this.props.data),\n          (this.props.initialScrollIndex || 0) + this.props.initialNumToRender,\n        ) - 1,\n    };\n\n    if (this._isNestedWithSameOrientation()) {\n      const storedState = this.context.virtualizedList.registerAsNestedChild({\n        cellKey: this._getCellKey(),\n        key: this.props.listKey || this._getCellKey(),\n        ref: this,\n      });\n      if (storedState) {\n        initialState = storedState;\n        this.state = storedState;\n        this._frames = storedState.frames;\n      }\n    }\n\n    this.state = initialState;\n  }\n\n  componentDidMount() {\n    if (this.props.initialScrollIndex) {\n      this._initialScrollIndexTimeout = setTimeout(\n        () =>\n          /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses\n           * an error found when Flow v0.63 was deployed. To see the error\n           * delete this comment and run Flow. */\n          this.scrollToIndex({\n            animated: false,\n            index: this.props.initialScrollIndex,\n          }),\n        0,\n      );\n    }\n  }\n\n  componentWillUnmount() {\n    if (this._isNestedWithSameOrientation()) {\n      this.context.virtualizedList.unregisterAsNestedChild({\n        key: this.props.listKey || this._getCellKey(),\n        state: {\n          first: this.state.first,\n          last: this.state.last,\n          frames: this._frames,\n        },\n      });\n    }\n    this._updateViewableItems(null);\n    this._updateCellsToRenderBatcher.dispose({abort: true});\n    this._viewabilityTuples.forEach(tuple => {\n      tuple.viewabilityHelper.dispose();\n    });\n    this._fillRateHelper.deactivateAndFlush();\n    /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n     * error found when Flow v0.63 was deployed. To see the error delete this\n     * comment and run Flow. */\n    clearTimeout(this._initialScrollIndexTimeout);\n  }\n\n  componentWillReceiveProps(newProps: Props) {\n    const {data, extraData, getItemCount, maxToRenderPerBatch} = newProps;\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    this.setState({\n      first: Math.max(\n        0,\n        Math.min(\n          this.state.first,\n          getItemCount(data) - 1 - maxToRenderPerBatch,\n        ),\n      ),\n      last: Math.max(0, Math.min(this.state.last, getItemCount(data) - 1)),\n    });\n    if (data !== this.props.data || extraData !== this.props.extraData) {\n      this._hasDataChangedSinceEndReached = true;\n\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  }\n\n  _pushCells(\n    cells: Array<Object>,\n    stickyHeaderIndices: Array<number>,\n    stickyIndicesFromProps: Set<number>,\n    first: number,\n    last: number,\n    inversionStyle: ?StyleObj,\n  ) {\n    const {\n      CellRendererComponent,\n      ItemSeparatorComponent,\n      data,\n      getItem,\n      getItemCount,\n      horizontal,\n      keyExtractor,\n    } = this.props;\n    const stickyOffset = this.props.ListHeaderComponent ? 1 : 0;\n    const end = getItemCount(data) - 1;\n    let prevCellKey;\n    last = Math.min(end, last);\n    for (let ii = first; ii <= last; ii++) {\n      const item = getItem(data, ii);\n      const key = keyExtractor(item, ii);\n      this._indicesToKeys.set(ii, key);\n      if (stickyIndicesFromProps.has(ii + stickyOffset)) {\n        stickyHeaderIndices.push(cells.length);\n      }\n      cells.push(\n        <CellRenderer\n          CellRendererComponent={CellRendererComponent}\n          ItemSeparatorComponent={ii < end ? ItemSeparatorComponent : undefined}\n          cellKey={key}\n          fillRateHelper={this._fillRateHelper}\n          horizontal={horizontal}\n          index={ii}\n          inversionStyle={inversionStyle}\n          item={item}\n          key={key}\n          prevCellKey={prevCellKey}\n          onUpdateSeparators={this._onUpdateSeparators}\n          onLayout={e => this._onCellLayout(e, key, ii)}\n          onUnmount={this._onCellUnmount}\n          parentProps={this.props}\n          ref={ref => {\n            this._cellRefs[key] = ref;\n          }}\n        />,\n      );\n      prevCellKey = key;\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  _isVirtualizationDisabled(): boolean {\n    return this.props.disableVirtualization;\n  }\n\n  _isNestedWithSameOrientation(): boolean {\n    const nestedContext = this.context.virtualizedList;\n    return !!(\n      nestedContext && !!nestedContext.horizontal === !!this.props.horizontal\n    );\n  }\n\n  render() {\n    if (__DEV__) {\n      const flatStyles = flattenStyle(this.props.contentContainerStyle);\n      warning(\n        flatStyles == null || flatStyles.flexWrap !== 'wrap',\n        '`flexWrap: `wrap`` is not supported with the `VirtualizedList` components.' +\n          'Consider using `numColumns` with `FlatList` instead.',\n      );\n    }\n    const {\n      ListEmptyComponent,\n      ListFooterComponent,\n      ListHeaderComponent,\n    } = this.props;\n    const {data, horizontal} = this.props;\n    const isVirtualizationDisabled = this._isVirtualizationDisabled();\n    const inversionStyle = this.props.inverted\n      ? this.props.horizontal\n        ? styles.horizontallyInverted\n        : styles.verticallyInverted\n      : null;\n    const cells = [];\n    const stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);\n    const stickyHeaderIndices = [];\n    if (ListHeaderComponent) {\n      if (stickyIndicesFromProps.has(0)) {\n        stickyHeaderIndices.push(0);\n      }\n      const element = React.isValidElement(ListHeaderComponent) ? (\n        ListHeaderComponent\n      ) : (\n        // $FlowFixMe\n        <ListHeaderComponent />\n      );\n      cells.push(\n        <VirtualizedCellWrapper\n          cellKey={this._getCellKey() + '-header'}\n          key=\"$header\">\n          <View onLayout={this._onLayoutHeader} style={inversionStyle}>\n            {element}\n          </View>\n        </VirtualizedCellWrapper>,\n      );\n    }\n    const itemCount = this.props.getItemCount(data);\n    if (itemCount > 0) {\n      _usedIndexForKey = false;\n      const spacerKey = !horizontal ? 'height' : 'width';\n      const lastInitialIndex = this.props.initialScrollIndex\n        ? -1\n        : this.props.initialNumToRender - 1;\n      const {first, last} = this.state;\n      this._pushCells(\n        cells,\n        stickyHeaderIndices,\n        stickyIndicesFromProps,\n        0,\n        lastInitialIndex,\n        inversionStyle,\n      );\n      const firstAfterInitial = Math.max(lastInitialIndex + 1, first);\n      if (!isVirtualizationDisabled && first > lastInitialIndex + 1) {\n        let insertedStickySpacer = false;\n        if (stickyIndicesFromProps.size > 0) {\n          const stickyOffset = ListHeaderComponent ? 1 : 0;\n          // See if there are any sticky headers in the virtualized space that we need to render.\n          for (let ii = firstAfterInitial - 1; ii > lastInitialIndex; ii--) {\n            if (stickyIndicesFromProps.has(ii + stickyOffset)) {\n              const initBlock = this._getFrameMetricsApprox(lastInitialIndex);\n              const stickyBlock = this._getFrameMetricsApprox(ii);\n              const leadSpace =\n                stickyBlock.offset - (initBlock.offset + initBlock.length);\n              cells.push(\n                <View key=\"$sticky_lead\" style={{[spacerKey]: leadSpace}} />,\n              );\n              this._pushCells(\n                cells,\n                stickyHeaderIndices,\n                stickyIndicesFromProps,\n                ii,\n                ii,\n                inversionStyle,\n              );\n              const trailSpace =\n                this._getFrameMetricsApprox(first).offset -\n                (stickyBlock.offset + stickyBlock.length);\n              cells.push(\n                <View key=\"$sticky_trail\" style={{[spacerKey]: trailSpace}} />,\n              );\n              insertedStickySpacer = true;\n              break;\n            }\n          }\n        }\n        if (!insertedStickySpacer) {\n          const initBlock = this._getFrameMetricsApprox(lastInitialIndex);\n          const firstSpace =\n            this._getFrameMetricsApprox(first).offset -\n            (initBlock.offset + initBlock.length);\n          cells.push(\n            <View key=\"$lead_spacer\" style={{[spacerKey]: firstSpace}} />,\n          );\n        }\n      }\n      this._pushCells(\n        cells,\n        stickyHeaderIndices,\n        stickyIndicesFromProps,\n        firstAfterInitial,\n        last,\n        inversionStyle,\n      );\n      if (!this._hasWarned.keys && _usedIndexForKey) {\n        console.warn(\n          'VirtualizedList: missing keys for items, make sure to specify a key property on each ' +\n            'item or provide a custom keyExtractor.',\n        );\n        this._hasWarned.keys = true;\n      }\n      if (!isVirtualizationDisabled && last < itemCount - 1) {\n        const lastFrame = this._getFrameMetricsApprox(last);\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 end = this.props.getItemLayout\n          ? itemCount - 1\n          : Math.min(itemCount - 1, this._highestMeasuredFrameIndex);\n        const endFrame = this._getFrameMetricsApprox(end);\n        const tailSpacerLength =\n          endFrame.offset +\n          endFrame.length -\n          (lastFrame.offset + lastFrame.length);\n        cells.push(\n          <View key=\"$tail_spacer\" style={{[spacerKey]: tailSpacerLength}} />,\n        );\n      }\n    } else if (ListEmptyComponent) {\n      const element = React.isValidElement(ListEmptyComponent) ? (\n        ListEmptyComponent\n      ) : (\n        // $FlowFixMe\n        <ListEmptyComponent />\n      );\n      cells.push(\n        <View\n          key=\"$empty\"\n          onLayout={this._onLayoutEmpty}\n          style={inversionStyle}>\n          {element}\n        </View>,\n      );\n    }\n    if (ListFooterComponent) {\n      const element = React.isValidElement(ListFooterComponent) ? (\n        ListFooterComponent\n      ) : (\n        // $FlowFixMe\n        <ListFooterComponent />\n      );\n      cells.push(\n        <VirtualizedCellWrapper\n          cellKey={this._getCellKey() + '-footer'}\n          key=\"$footer\">\n          <View onLayout={this._onLayoutFooter} style={inversionStyle}>\n            {element}\n          </View>\n        </VirtualizedCellWrapper>,\n      );\n    }\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      onMomentumScrollEnd: this._onMomentumScrollEnd,\n      scrollEventThrottle: this.props.scrollEventThrottle, // TODO: Android support\n      stickyHeaderIndices,\n    };\n    if (inversionStyle) {\n      scrollProps.style = [inversionStyle, this.props.style];\n    }\n\n    this._hasMore =\n      this.state.last < this.props.getItemCount(this.props.data) - 1;\n\n    const ret = React.cloneElement(\n      (this.props.renderScrollComponent || this._defaultRenderScrollComponent)(\n        scrollProps,\n      ),\n      {\n        ref: this._captureScrollRef,\n      },\n      cells,\n    );\n    if (this.props.debug) {\n      return (\n        <View style={{flex: 1}}>\n          {ret}\n          {this._renderDebugOverlay()}\n        </View>\n      );\n    } else {\n      return ret;\n    }\n  }\n\n  componentDidUpdate() {\n    this._scheduleCellsToRenderUpdate();\n  }\n\n  _averageCellLength = 0;\n  // Maps a cell key to the set of keys for all outermost child lists within that cell\n  _cellKeysToChildListKeys: Map<string, Set<string>> = new Map();\n  _cellRefs = {};\n  _fillRateHelper: FillRateHelper;\n  _frames = {};\n  _footerLength = 0;\n  _hasDataChangedSinceEndReached = true;\n  _hasMore = false;\n  _hasWarned = {};\n  _highestMeasuredFrameIndex = 0;\n  _headerLength = 0;\n  _indicesToKeys: Map<number, string> = new Map();\n  _initialScrollIndexTimeout = 0;\n  _nestedChildLists: Map<\n    string,\n    {ref: ?VirtualizedList, state: ?ChildListState},\n  > = new Map();\n  _offsetFromParentVirtualizedList: number = 0;\n  _prevParentOffset: number = 0;\n  _scrollMetrics = {\n    contentLength: 0,\n    dOffset: 0,\n    dt: 10,\n    offset: 0,\n    timestamp: 0,\n    velocity: 0,\n    visibleLength: 0,\n  };\n  _scrollRef = (null: any);\n  _sentEndForContentLength = 0;\n  _totalCellLength = 0;\n  _totalCellsMeasured = 0;\n  _updateCellsToRenderBatcher: Batchinator;\n  _viewabilityTuples: Array<ViewabilityHelperCallbackTuple> = [];\n\n  _captureScrollRef = ref => {\n    this._scrollRef = ref;\n  };\n\n  _computeBlankness() {\n    this._fillRateHelper.computeBlankness(\n      this.props,\n      this.state,\n      this._scrollMetrics,\n    );\n  }\n\n  _defaultRenderScrollComponent = props => {\n    if (this._isNestedWithSameOrientation()) {\n      return <View {...props} />;\n    } else if (props.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) +\n          '`',\n      );\n      return (\n        <ScrollView\n          {...props}\n          refreshControl={\n            /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n             * comment suppresses an error when upgrading Flow's support for\n             * React. To see the error delete this comment and run Flow. */\n            <RefreshControl\n              refreshing={props.refreshing}\n              onRefresh={props.onRefresh}\n              progressViewOffset={props.progressViewOffset}\n            />\n          }\n        />\n      );\n    } else {\n      return <ScrollView {...props} />;\n    }\n  };\n\n  _onCellLayout(e, cellKey, index) {\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    this._computeBlankness();\n  }\n\n  _onCellUnmount = (cellKey: string) => {\n    const curr = this._frames[cellKey];\n    if (curr) {\n      this._frames[cellKey] = {...curr, inLayout: false};\n    }\n  };\n\n  _measureLayoutRelativeToContainingList(): void {\n    UIManager.measureLayout(\n      ReactNative.findNodeHandle(this),\n      ReactNative.findNodeHandle(\n        this.context.virtualizedList.getOutermostParentListRef(),\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      (x, y, width, height) => {\n        this._offsetFromParentVirtualizedList = this._selectOffset({x, y});\n        this._scrollMetrics.contentLength = this._selectLength({width, height});\n\n        const scrollMetrics = this._convertParentScrollMetrics(\n          this.context.virtualizedList.getScrollMetrics(),\n        );\n        this._scrollMetrics.visibleLength = scrollMetrics.visibleLength;\n        this._scrollMetrics.offset = scrollMetrics.offset;\n      },\n    );\n  }\n\n  _onLayout = (e: Object) => {\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._maybeCallOnEndReached();\n  };\n\n  _onLayoutEmpty = e => {\n    this.props.onLayout && this.props.onLayout(e);\n  };\n\n  _onLayoutFooter = e => {\n    this._footerLength = this._selectLength(e.nativeEvent.layout);\n  };\n\n  _onLayoutHeader = e => {\n    this._headerLength = this._selectLength(e.nativeEvent.layout);\n  };\n\n  _renderDebugOverlay() {\n    const normalize =\n      this._scrollMetrics.visibleLength / this._scrollMetrics.contentLength;\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);\n      if (frame.inLayout) {\n        framesInLayout.push(frame);\n      }\n    }\n    const windowTop = this._getFrameMetricsApprox(this.state.first).offset;\n    const frameLast = this._getFrameMetricsApprox(this.state.last);\n    const windowLen = frameLast.offset + frameLast.length - windowTop;\n    const visTop = this._scrollMetrics.offset;\n    const visLen = this._scrollMetrics.visibleLength;\n    const baseStyle = {position: 'absolute', top: 0, right: 0};\n    return (\n      <View\n        style={{\n          ...baseStyle,\n          bottom: 0,\n          width: 20,\n          borderColor: 'blue',\n          borderWidth: 1,\n        }}>\n        {framesInLayout.map((f, ii) => (\n          <View\n            key={'f' + ii}\n            style={{\n              ...baseStyle,\n              left: 0,\n              top: f.offset * normalize,\n              height: f.length * normalize,\n              backgroundColor: 'orange',\n            }}\n          />\n        ))}\n        <View\n          style={{\n            ...baseStyle,\n            left: 0,\n            top: windowTop * normalize,\n            height: windowLen * normalize,\n            borderColor: 'green',\n            borderWidth: 2,\n          }}\n        />\n        <View\n          style={{\n            ...baseStyle,\n            left: 0,\n            top: visTop * normalize,\n            height: visLen * normalize,\n            borderColor: 'red',\n            borderWidth: 2,\n          }}\n        />\n      </View>\n    );\n  }\n\n  _selectLength(metrics: {height: number, width: number}): number {\n    return !this.props.horizontal ? metrics.height : metrics.width;\n  }\n\n  _selectOffset(metrics: {x: number, y: number}): number {\n    return !this.props.horizontal ? metrics.y : metrics.x;\n  }\n\n  _maybeCallOnEndReached() {\n    const {\n      data,\n      getItemCount,\n      onEndReached,\n      onEndReachedThreshold,\n    } = this.props;\n    const {contentLength, visibleLength, offset} = this._scrollMetrics;\n    const distanceFromEnd = contentLength - visibleLength - offset;\n    if (\n      onEndReached &&\n      this.state.last === getItemCount(data) - 1 &&\n      /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n       * error found when Flow v0.63 was deployed. To see the error delete this\n       * comment and run Flow. */\n      distanceFromEnd < onEndReachedThreshold * visibleLength &&\n      (this._hasDataChangedSinceEndReached ||\n        this._scrollMetrics.contentLength !== this._sentEndForContentLength)\n    ) {\n      // Only call onEndReached once for a given dataset + content length.\n      this._hasDataChangedSinceEndReached = false;\n      this._sentEndForContentLength = this._scrollMetrics.contentLength;\n      onEndReached({distanceFromEnd});\n    }\n  }\n\n  _onContentSizeChange = (width: number, height: number) => {\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._maybeCallOnEndReached();\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    // 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.ref && childList.ref._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      ({\n        visibleLength,\n        contentLength,\n        offset,\n        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    this._scrollMetrics = {\n      contentLength,\n      dt,\n      dOffset,\n      offset,\n      timestamp,\n      velocity,\n      visibleLength,\n    };\n    this._updateViewableItems(this.props.data);\n    if (!this.props) {\n      return;\n    }\n    this._maybeCallOnEndReached();\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;\n    const {offset, visibleLength, velocity} = this._scrollMetrics;\n    const itemCount = this.props.getItemCount(this.props.data);\n    let hiPri = false;\n    if (first > 0 || last < itemCount - 1) {\n      const distTop = offset - this._getFrameMetricsApprox(first).offset;\n      const distBottom =\n        this._getFrameMetricsApprox(last).offset - (offset + visibleLength);\n      const scrollingThreshold =\n        /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n         * error found when Flow v0.63 was deployed. To see the error delete\n         * this comment and run Flow. */\n        this.props.onEndReachedThreshold * visibleLength / 2;\n      hiPri =\n        Math.min(distTop, distBottom) < 0 ||\n        (velocity < -2 && distTop < scrollingThreshold) ||\n        (velocity > 2 && distBottom < scrollingThreshold);\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 (hiPri && this._averageCellLength) {\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): void => {\n    this._viewabilityTuples.forEach(tuple => {\n      tuple.viewabilityHelper.recordInteraction();\n    });\n    this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);\n  };\n\n  _onScrollEndDrag = (e): void => {\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  _onMomentumScrollEnd = (e): void => {\n    this._scrollMetrics.velocity = 0;\n    this._computeBlankness();\n    this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(e);\n  };\n\n  _updateCellsToRender = () => {\n    const {data, getItemCount, onEndReachedThreshold} = this.props;\n    const isVirtualizationDisabled = this._isVirtualizationDisabled();\n    this._updateViewableItems(data);\n    if (!data) {\n      return;\n    }\n    this.setState(state => {\n      let newState;\n      if (!isVirtualizationDisabled) {\n        // If we run this with bogus data, we'll force-render window {first: 0, last: 0},\n        // and wipe out the initialNumToRender rendered elements.\n        // So let's wait until the scroll view metrics have been set up. And until then,\n        // we will trust the initialNumToRender suggestion\n        if (this._scrollMetrics.visibleLength) {\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          if (!this.props.initialScrollIndex || this._scrollMetrics.offset) {\n            newState = computeWindowedRenderLimits(\n              this.props,\n              state,\n              this._getFrameMetricsApprox,\n              this._scrollMetrics,\n            );\n          }\n        }\n      } else {\n        const {contentLength, offset, visibleLength} = this._scrollMetrics;\n        const distanceFromEnd = contentLength - visibleLength - offset;\n        const renderAhead =\n          /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses\n           * an error found when Flow v0.63 was deployed. To see the error\n           * delete this comment and run Flow. */\n          distanceFromEnd < onEndReachedThreshold * visibleLength\n            ? this.props.maxToRenderPerBatch\n            : 0;\n        newState = {\n          first: 0,\n          last: Math.min(state.last + renderAhead, getItemCount(data) - 1),\n        };\n      }\n      if (newState && this._nestedChildLists.size > 0) {\n        const newFirst = newState.first;\n        const newLast = newState.last;\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        for (let ii = newFirst; ii <= newLast; ii++) {\n          const cellKeyForIndex = this._indicesToKeys.get(ii);\n          const childListKeys =\n            cellKeyForIndex &&\n            this._cellKeysToChildListKeys.get(cellKeyForIndex);\n          if (!childListKeys) {\n            continue;\n          }\n          let someChildHasMore = false;\n          // For each cell, need to check whether any child list in it has more elements to render\n          for (let childKey of childListKeys) {\n            const childList = this._nestedChildLists.get(childKey);\n            if (childList && childList.ref && childList.ref.hasMore()) {\n              someChildHasMore = true;\n              break;\n            }\n          }\n          if (someChildHasMore) {\n            newState.last = ii;\n            break;\n          }\n        }\n      }\n      return newState;\n    });\n  };\n\n  _createViewToken = (index: number, isViewable: boolean) => {\n    const {data, getItem, keyExtractor} = this.props;\n    const item = getItem(data, index);\n    return {index, item, key: keyExtractor(item, index), isViewable};\n  };\n\n  _getFrameMetricsApprox = (\n    index: number,\n  ): {length: number, offset: number} => {\n    const frame = this._getFrameMetrics(index);\n    if (frame && frame.index === index) {\n      // check for invalid frames due to row re-ordering\n      return frame;\n    } else {\n      const {getItemLayout} = this.props;\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  ): ?{\n    length: number,\n    offset: number,\n    index: number,\n    inLayout?: boolean,\n  } => {\n    const {\n      data,\n      getItem,\n      getItemCount,\n      getItemLayout,\n      keyExtractor,\n    } = this.props;\n    invariant(\n      getItemCount(data) > index,\n      'Tried to get frame for out of range index ' + index,\n    );\n    const item = getItem(data, index);\n    let frame = item && this._frames[keyExtractor(item, index)];\n    if (!frame || frame.index !== index) {\n      if (getItemLayout) {\n        frame = getItemLayout(data, index);\n        if (__DEV__) {\n          const frameType = PropTypes.shape({\n            length: PropTypes.number.isRequired,\n            offset: PropTypes.number.isRequired,\n            index: PropTypes.number.isRequired,\n          }).isRequired;\n          PropTypes.checkPropTypes(\n            {frame: frameType},\n            {frame},\n            'frame',\n            'VirtualizedList.getItemLayout',\n          );\n        }\n      }\n    }\n    /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n     * error found when Flow v0.63 was deployed. To see the error delete this\n     * comment and run Flow. */\n    return frame;\n  };\n\n  _updateViewableItems(data: any) {\n    const {getItemCount} = this.props;\n\n    this._viewabilityTuples.forEach(tuple => {\n      tuple.viewabilityHelper.onUpdate(\n        getItemCount(data),\n        this._scrollMetrics.offset,\n        this._scrollMetrics.visibleLength,\n        this._getFrameMetrics,\n        this._createViewToken,\n        tuple.onViewableItemsChanged,\n        this.state,\n      );\n    });\n  }\n}\n\nclass CellRenderer extends React.Component<\n  {\n    CellRendererComponent?: ?React.ComponentType<any>,\n    ItemSeparatorComponent: ?React.ComponentType<*>,\n    cellKey: string,\n    fillRateHelper: FillRateHelper,\n    horizontal: ?boolean,\n    index: number,\n    inversionStyle: ?StyleObj,\n    item: Item,\n    onLayout: (event: Object) => void, // This is extracted by ScrollViewStickyHeader\n    onUnmount: (cellKey: string) => void,\n    onUpdateSeparators: (cellKeys: Array<?string>, props: Object) => void,\n    parentProps: {\n      getItemLayout?: ?Function,\n      renderItem: renderItemType,\n    },\n    prevCellKey: ?string,\n  },\n  $FlowFixMeState,\n> {\n  state = {\n    separatorProps: {\n      highlighted: false,\n      leadingItem: this.props.item,\n    },\n  };\n\n  static childContextTypes = {\n    virtualizedCell: PropTypes.shape({\n      cellKey: PropTypes.string,\n    }),\n  };\n\n  getChildContext() {\n    return {\n      virtualizedCell: {\n        cellKey: this.props.cellKey,\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  _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: (select: 'leading' | 'trailing', newProps: Object) => {\n      const {cellKey, prevCellKey} = this.props;\n      this.props.onUpdateSeparators(\n        [select === 'leading' ? prevCellKey : cellKey],\n        newProps,\n      );\n    },\n  };\n\n  updateSeparatorProps(newProps: Object) {\n    this.setState(state => ({\n      separatorProps: {...state.separatorProps, ...newProps},\n    }));\n  }\n\n  componentWillUnmount() {\n    this.props.onUnmount(this.props.cellKey);\n  }\n\n  render() {\n    const {\n      CellRendererComponent,\n      ItemSeparatorComponent,\n      fillRateHelper,\n      horizontal,\n      item,\n      index,\n      inversionStyle,\n      parentProps,\n    } = this.props;\n    const {renderItem, getItemLayout} = parentProps;\n    invariant(renderItem, 'no renderItem!');\n    const element = renderItem({\n      item,\n      index,\n      separators: this._separators,\n    });\n    const onLayout =\n      getItemLayout && !parentProps.debug && !fillRateHelper.enabled()\n        ? undefined\n        : this.props.onLayout;\n    // NOTE: that when this is a sticky header, `onLayout` will get automatically extracted and\n    // called explicitly by `ScrollViewStickyHeader`.\n    const itemSeparator = ItemSeparatorComponent && (\n      <ItemSeparatorComponent {...this.state.separatorProps} />\n    );\n    const cellStyle = inversionStyle\n      ? horizontal\n        ? [{flexDirection: 'row-reverse'}, inversionStyle]\n        : [{flexDirection: 'column-reverse'}, inversionStyle]\n      : horizontal ? [{flexDirection: 'row'}, inversionStyle] : inversionStyle;\n    if (!CellRendererComponent) {\n      return (\n        <View style={cellStyle} onLayout={onLayout}>\n          {element}\n          {itemSeparator}\n        </View>\n      );\n    }\n    return (\n      <CellRendererComponent\n        {...this.props}\n        style={cellStyle}\n        onLayout={onLayout}>\n        {element}\n        {itemSeparator}\n      </CellRendererComponent>\n    );\n  }\n}\n\nclass VirtualizedCellWrapper extends React.Component<{\n  cellKey: string,\n  children: React.Node,\n}> {\n  static childContextTypes = {\n    virtualizedCell: PropTypes.shape({\n      cellKey: PropTypes.string,\n    }),\n  };\n\n  getChildContext() {\n    return {\n      virtualizedCell: {\n        cellKey: this.props.cellKey,\n      },\n    };\n  }\n\n  render() {\n    return this.props.children;\n  }\n}\n\nconst styles = StyleSheet.create({\n  verticallyInverted: {\n    transform: [{scaleY: -1}],\n  },\n  horizontallyInverted: {\n    transform: [{scaleX: -1}],\n  },\n});\n\nmodule.exports = VirtualizedList;\n"
  },
  {
    "path": "Libraries/Lists/VirtualizedSectionList.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule VirtualizedSectionList\n * @flow\n * @format\n */\n'use strict';\n\nconst React = require('React');\nconst View = require('View');\nconst VirtualizedList = require('VirtualizedList');\n\nconst invariant = require('fbjs/lib/invariant');\n\nimport type {ViewToken} from 'ViewabilityHelper';\nimport type {Props as VirtualizedListProps} from 'VirtualizedList';\n\ntype Item = any;\ntype SectionItem = any;\n\ntype SectionBase = {\n  // Must be provided directly on each section.\n  data: $ReadOnlyArray<SectionItem>,\n  key?: string,\n\n  // Optional props will override list-wide props just for this section.\n  renderItem?: ?({\n    item: SectionItem,\n    index: number,\n    section: SectionBase,\n    separators: {\n      highlight: () => void,\n      unhighlight: () => void,\n      updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,\n    },\n  }) => ?React.Element<any>,\n  ItemSeparatorComponent?: ?React.ComponentType<*>,\n  keyExtractor?: (item: SectionItem, index: ?number) => string,\n\n  // TODO: support more optional/override props\n  // FooterComponent?: ?ReactClass<*>,\n  // HeaderComponent?: ?ReactClass<*>,\n  // onViewableItemsChanged?: ({viewableItems: Array<ViewToken>, changed: Array<ViewToken>}) => void,\n};\n\ntype RequiredProps<SectionT: SectionBase> = {\n  sections: $ReadOnlyArray<SectionT>,\n};\n\ntype OptionalProps<SectionT: SectionBase> = {\n  /**\n   * Rendered after the last item in the last section.\n   */\n  ListFooterComponent?: ?(React.ComponentType<*> | React.Element<any>),\n  /**\n   * Rendered at the very beginning of the list.\n   */\n  ListHeaderComponent?: ?(React.ComponentType<*> | React.Element<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  }) => ?React.Element<any>,\n  /**\n   * Rendered at the top of each section.\n   */\n  renderSectionHeader?: ?({section: SectionT}) => ?React.Element<any>,\n  /**\n   * Rendered at the bottom of each section.\n   */\n  renderSectionFooter?: ?({section: SectionT}) => ?React.Element<any>,\n  /**\n   * Rendered at the bottom of every Section, except the very last one, in place of the normal\n   * ItemSeparatorComponent.\n   */\n  SectionSeparatorComponent?: ?React.ComponentType<*>,\n  /**\n   * Rendered at the bottom of every Item except the very last one in the last section.\n   */\n  ItemSeparatorComponent?: ?React.ComponentType<*>,\n  /**\n   * Warning: Virtualization can drastically improve memory consumption for long lists, but trashes\n   * the state of items when they scroll out of the render window, so make sure all relavent data is\n   * stored outside of the recursive `renderItem` instance tree.\n   */\n  enableVirtualization?: ?boolean,\n  keyExtractor: (item: Item, index: number) => string,\n  onEndReached?: ?({distanceFromEnd: number}) => void,\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?: ?Function,\n  /**\n   * Called when the viewability of rows changes, as defined by the\n   * `viewabilityConfig` prop.\n   */\n  onViewableItemsChanged?: ?({\n    viewableItems: Array<ViewToken>,\n    changed: Array<ViewToken>,\n  }) => void,\n  /**\n   * Set this true while waiting for new data from a refresh.\n   */\n  refreshing?: ?boolean,\n};\n\nexport type Props<SectionT> = RequiredProps<SectionT> &\n  OptionalProps<SectionT> &\n  VirtualizedListProps;\n\ntype DefaultProps = typeof VirtualizedList.defaultProps & {\n  data: $ReadOnlyArray<Item>,\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<SectionT: SectionBase> extends React.PureComponent<\n  Props<SectionT>,\n  State,\n> {\n  props: Props<SectionT>;\n\n  state: State;\n\n  static defaultProps: DefaultProps = {\n    ...VirtualizedList.defaultProps,\n    data: [],\n  };\n\n  scrollToLocation(params: {\n    animated?: ?boolean,\n    itemIndex: number,\n    sectionIndex: number,\n    viewPosition?: number,\n  }) {\n    let index = params.itemIndex + 1;\n    for (let ii = 0; ii < params.sectionIndex; ii++) {\n      index += this.props.sections[ii].data.length + 2;\n    }\n    const toIndexParams = {\n      ...params,\n      index,\n    };\n    this._listRef.scrollToIndex(toIndexParams);\n  }\n\n  getListRef(): VirtualizedList {\n    return this._listRef;\n  }\n\n  _keyExtractor = (item: Item, index: number) => {\n    const info = this._subExtractor(index);\n    return (info && info.key) || String(index);\n  };\n\n  _subExtractor(\n    index: number,\n  ): ?{\n    section: SectionT,\n    key: string, // Key of the section or combined key for section + item\n    index: ?number, // Relative index within the section\n    header?: ?boolean, // True if this is the section header\n    leadingItem?: ?Item,\n    leadingSection?: ?SectionT,\n    trailingItem?: ?Item,\n    trailingSection?: ?SectionT,\n  } {\n    let itemIndex = index;\n    const defaultKeyExtractor = this.props.keyExtractor;\n    for (let ii = 0; ii < this.props.sections.length; ii++) {\n      const section = this.props.sections[ii];\n      const key = section.key || String(ii);\n      itemIndex -= 1; // The section adds an item for the header\n      if (itemIndex >= section.data.length + 1) {\n        itemIndex -= section.data.length + 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: this.props.sections[ii + 1],\n        };\n      } else if (itemIndex === section.data.length) {\n        return {\n          section,\n          key: key + ':footer',\n          index: null,\n          header: false,\n          trailingSection: this.props.sections[ii + 1],\n        };\n      } else {\n        const keyExtractor = section.keyExtractor || defaultKeyExtractor;\n        return {\n          section,\n          key: key + ':' + keyExtractor(section.data[itemIndex], itemIndex),\n          index: itemIndex,\n          leadingItem: section.data[itemIndex - 1],\n          leadingSection: this.props.sections[ii - 1],\n          trailingItem: section.data[itemIndex + 1],\n          trailingSection: this.props.sections[ii + 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 keyExtractor = info.section.keyExtractor || this.props.keyExtractor;\n    return {\n      ...viewable,\n      index: info.index,\n      /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n       * error found when Flow v0.63 was deployed. To see the error delete this\n       * comment and run Flow. */\n      key: keyExtractor(viewable.item, info.index),\n      section: info.section,\n    };\n  };\n\n  _onViewableItemsChanged = ({\n    viewableItems,\n    changed,\n  }: {\n    viewableItems: Array<ViewToken>,\n    changed: Array<ViewToken>,\n  }) => {\n    if (this.props.onViewableItemsChanged) {\n      this.props.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 = ({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(index, info);\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          onUpdateSeparator={this._onUpdateSeparator}\n          prevCellKey={(this._subExtractor(index - 1) || {}).key}\n          ref={ref => {\n            this._cellRefs[info.key] = ref;\n          }}\n          renderItem={renderItem}\n          section={info.section}\n          trailingItem={info.trailingItem}\n          trailingSection={info.trailingSection}\n        />\n      );\n    }\n  };\n\n  _onUpdateSeparator = (key: string, newProps: Object) => {\n    const ref = this._cellRefs[key];\n    ref && ref.updateSeparatorProps(newProps);\n  };\n\n  _getSeparatorComponent(\n    index: number,\n    info?: ?Object,\n  ): ?React.ComponentType<*> {\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 === this.state.childProps.getItemCount() - 1;\n    const isLastItemInSection = info.index === info.section.data.length - 1;\n    if (SectionSeparatorComponent && isLastItemInSection) {\n      return SectionSeparatorComponent;\n    }\n    if (ItemSeparatorComponent && !isLastItemInSection && !isLastItemInList) {\n      return ItemSeparatorComponent;\n    }\n    return null;\n  }\n\n  _computeState(props: Props<SectionT>): State {\n    const offset = props.ListHeaderComponent ? 1 : 0;\n    const stickyHeaderIndices = [];\n    const itemCount = props.sections.reduce((v, section) => {\n      stickyHeaderIndices.push(v + offset);\n      return v + section.data.length + 2; // Add two for the section header and footer.\n    }, 0);\n\n    return {\n      childProps: {\n        ...props,\n        renderItem: this._renderItem,\n        ItemSeparatorComponent: undefined, // Rendered with renderItem\n        data: props.sections,\n        getItemCount: () => itemCount,\n        getItem,\n        keyExtractor: this._keyExtractor,\n        onViewableItemsChanged: props.onViewableItemsChanged\n          ? this._onViewableItemsChanged\n          : undefined,\n        stickyHeaderIndices: props.stickySectionHeadersEnabled\n          ? stickyHeaderIndices\n          : undefined,\n      },\n    };\n  }\n\n  constructor(props: Props<SectionT>, context: Object) {\n    super(props, context);\n    this.state = this._computeState(props);\n  }\n\n  componentWillReceiveProps(nextProps: Props<SectionT>) {\n    this.setState(this._computeState(nextProps));\n  }\n\n  render() {\n    return (\n      <VirtualizedList {...this.state.childProps} ref={this._captureRef} />\n    );\n  }\n\n  _cellRefs = {};\n  _listRef: VirtualizedList;\n  _captureRef = ref => {\n    /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error when upgrading Flow's support for React. To see the\n     * error delete this comment and run Flow. */\n    this._listRef = ref;\n  };\n}\n\ntype ItemWithSeparatorProps = {\n  LeadingSeparatorComponent: ?React.ComponentType<*>,\n  SeparatorComponent: ?React.ComponentType<*>,\n  cellKey: string,\n  index: number,\n  item: Item,\n  onUpdateSeparator: (cellKey: string, newProps: Object) => void,\n  prevCellKey?: ?string,\n  renderItem: Function,\n  section: Object,\n  leadingItem: ?Item,\n  leadingSection: ?Object,\n  trailingItem: ?Item,\n  trailingSection: ?Object,\n};\n\nclass ItemWithSeparator extends React.Component<\n  ItemWithSeparatorProps,\n  $FlowFixMeState,\n> {\n  state = {\n    separatorProps: {\n      highlighted: false,\n      leadingItem: this.props.item,\n      leadingSection: this.props.leadingSection,\n      section: this.props.section,\n      trailingItem: this.props.trailingItem,\n      trailingSection: this.props.trailingSection,\n    },\n    leadingSeparatorProps: {\n      highlighted: false,\n      leadingItem: this.props.leadingItem,\n      leadingSection: this.props.leadingSection,\n      section: this.props.section,\n      trailingItem: this.props.item,\n      trailingSection: this.props.trailingSection,\n    },\n  };\n\n  _separators = {\n    highlight: () => {\n      ['leading', 'trailing'].forEach(s =>\n        this._separators.updateProps(s, {highlighted: true}),\n      );\n    },\n    unhighlight: () => {\n      ['leading', 'trailing'].forEach(s =>\n        this._separators.updateProps(s, {highlighted: false}),\n      );\n    },\n    updateProps: (select: 'leading' | 'trailing', newProps: Object) => {\n      const {LeadingSeparatorComponent, cellKey, prevCellKey} = this.props;\n      if (select === 'leading' && LeadingSeparatorComponent) {\n        this.setState(state => ({\n          leadingSeparatorProps: {...state.leadingSeparatorProps, ...newProps},\n        }));\n      } else {\n        this.props.onUpdateSeparator(\n          (select === 'leading' && prevCellKey) || cellKey,\n          newProps,\n        );\n      }\n    },\n  };\n\n  componentWillReceiveProps(props: ItemWithSeparatorProps) {\n    this.setState(state => ({\n      separatorProps: {\n        ...this.state.separatorProps,\n        leadingItem: props.item,\n        leadingSection: props.leadingSection,\n        section: props.section,\n        trailingItem: props.trailingItem,\n        trailingSection: props.trailingSection,\n      },\n      leadingSeparatorProps: {\n        ...this.state.leadingSeparatorProps,\n        leadingItem: props.leadingItem,\n        leadingSection: props.leadingSection,\n        section: props.section,\n        trailingItem: props.item,\n        trailingSection: props.trailingSection,\n      },\n    }));\n  }\n\n  updateSeparatorProps(newProps: Object) {\n    this.setState(state => ({\n      separatorProps: {...state.separatorProps, ...newProps},\n    }));\n  }\n\n  render() {\n    const {\n      LeadingSeparatorComponent,\n      SeparatorComponent,\n      item,\n      index,\n      section,\n    } = this.props;\n    const element = this.props.renderItem({\n      item,\n      index,\n      section,\n      separators: this._separators,\n    });\n    const leadingSeparator = LeadingSeparatorComponent && (\n      <LeadingSeparatorComponent {...this.state.leadingSeparatorProps} />\n    );\n    const separator = SeparatorComponent && (\n      <SeparatorComponent {...this.state.separatorProps} />\n    );\n    return leadingSeparator || separator ? (\n      <View>\n        {leadingSeparator}\n        {element}\n        {separator}\n      </View>\n    ) : (\n      element\n    );\n  }\n}\n\nfunction getItem(sections: ?$ReadOnlyArray<Item>, index: number): ?Item {\n  if (!sections) {\n    return null;\n  }\n  let itemIdx = index - 1;\n  for (let ii = 0; ii < sections.length; ii++) {\n    if (itemIdx === -1 || itemIdx === sections[ii].data.length) {\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 sections[ii];\n    } else if (itemIdx < sections[ii].data.length) {\n      // If we are in the bounds of the list's data then return the item.\n      return sections[ii].data[itemIdx];\n    } else {\n      itemIdx -= sections[ii].data.length + 2; // Add two for the header and footer\n    }\n  }\n  return null;\n}\n\nmodule.exports = VirtualizedSectionList;\n"
  },
  {
    "path": "Libraries/Lists/__flowtests__/FlatList-flowtest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nconst FlatList = require('FlatList');\nconst React = require('react');\n\nfunction renderMyListItem(info: {item: {title: string}, index: number}) {\n  return <span />;\n}\n\nmodule.exports = {\n  testEverythingIsFine() {\n    const data = [\n      {\n        title: 'Title Text',\n        key: 1,\n      },\n    ];\n    return <FlatList renderItem={renderMyListItem} data={data} />;\n  },\n\n  testBadDataWithTypicalItem() {\n    const data = [\n      {\n        // $FlowExpectedError - bad title type 6, should be string\n        title: 6,\n        key: 1,\n      },\n    ];\n    return <FlatList renderItem={renderMyListItem} data={data} />;\n  },\n\n  testMissingFieldWithTypicalItem() {\n    const data = [\n      {\n        key: 1,\n      },\n    ];\n    // $FlowExpectedError - missing title\n    return <FlatList renderItem={renderMyListItem} data={data} />;\n  },\n\n  testGoodDataWithBadCustomRenderItemFunction() {\n    const data = [\n      {\n        widget: 6,\n        key: 1,\n      },\n    ];\n    return (\n      <FlatList\n        renderItem={info => (\n          <span>\n            {\n              // $FlowExpectedError - bad widgetCount type 6, should be Object\n              info.item.widget.missingProp\n            }\n          </span>\n        )}\n        data={data}\n      />\n    );\n  },\n\n  testBadRenderItemFunction() {\n    const data = [\n      {\n        title: 'foo',\n        key: 1,\n      },\n    ];\n    return [\n      // $FlowExpectedError - title should be inside `item`\n      <FlatList renderItem={(info: {title: string}) => <span />} data={data} />,\n      <FlatList\n        // $FlowExpectedError - bad index type string, should be number\n        renderItem={(info: {item: any, index: string}) => <span />}\n        data={data}\n      />,\n      <FlatList\n        // $FlowExpectedError - bad title type number, should be string\n        renderItem={(info: {item: {title: number}}) => <span />}\n        data={data}\n      />,\n      // EverythingIsFine\n      <FlatList\n        renderItem={(info: {item: {title: string}}) => <span />}\n        data={data}\n      />,\n    ];\n  },\n\n  testOtherBadProps() {\n    return [\n      // $FlowExpectedError - bad numColumns type \"lots\"\n      <FlatList renderItem={renderMyListItem} data={[]} numColumns=\"lots\" />,\n      // $FlowExpectedError - bad windowSize type \"big\"\n      <FlatList renderItem={renderMyListItem} data={[]} windowSize=\"big\" />,\n      // $FlowExpectedError - missing `data` prop\n      <FlatList renderItem={renderMyListItem} />,\n    ];\n  },\n};\n"
  },
  {
    "path": "Libraries/Lists/__flowtests__/SectionList-flowtest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nconst React = require('react');\nconst SectionList = require('SectionList');\n\nfunction renderMyListItem(info: {item: {title: string}, index: number}) {\n  return <span />;\n}\n\nconst renderMyHeader = ({section}: {section: {fooNumber: number} & Object}) => (\n  <span />\n);\n\nmodule.exports = {\n  testGoodDataWithGoodItem() {\n    const sections = [\n      {\n        key: 'a',\n        data: [\n          {\n            title: 'foo',\n            key: 1,\n          },\n        ],\n      },\n    ];\n    return <SectionList renderItem={renderMyListItem} sections={sections} />;\n  },\n\n  testBadRenderItemFunction() {\n    const sections = [\n      {\n        key: 'a',\n        data: [\n          {\n            title: 'foo',\n            key: 1,\n          },\n        ],\n      },\n    ];\n    return [\n      // $FlowExpectedError - title should be inside `item`\n      <SectionList\n        renderItem={(info: {title: string}) => <span />}\n        sections={sections}\n      />,\n      <SectionList\n        // $FlowExpectedError - bad index type string, should be number\n        renderItem={(info: {index: string}) => <span />}\n        sections={sections}\n      />,\n      // EverythingIsFine\n      <SectionList\n        renderItem={(info: {item: {title: string}}) => <span />}\n        sections={sections}\n      />,\n    ];\n  },\n\n  testBadInheritedDefaultProp(): React.Element<*> {\n    const sections = [];\n    return (\n      <SectionList\n        renderItem={renderMyListItem}\n        sections={sections}\n        // $FlowExpectedError - bad windowSize type \"big\"\n        windowSize=\"big\"\n      />\n    );\n  },\n\n  testMissingData(): React.Element<*> {\n    // $FlowExpectedError - missing `sections` prop\n    return <SectionList renderItem={renderMyListItem} />;\n  },\n\n  testBadSectionsShape(): React.Element<*> {\n    const sections = [\n      /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n       * error found when Flow v0.63 was deployed. To see the error delete this\n       * comment and run Flow. */\n      {\n        key: 'a',\n        items: [\n          {\n            title: 'foo',\n            key: 1,\n          },\n        ],\n      },\n    ];\n    // $FlowExpectedError - section missing `data` field\n    return <SectionList renderItem={renderMyListItem} sections={sections} />;\n  },\n\n  testBadSectionsMetadata(): React.Element<*> {\n    const sections = [\n      {\n        key: 'a',\n        // $FlowExpectedError - section has bad meta data `fooNumber` field of type string\n        fooNumber: 'string',\n        data: [\n          {\n            title: 'foo',\n            key: 1,\n          },\n        ],\n      },\n    ];\n    return (\n      <SectionList\n        renderSectionHeader={renderMyHeader}\n        renderItem={renderMyListItem}\n        sections={sections}\n      />\n    );\n  },\n};\n"
  },
  {
    "path": "Libraries/Lists/__tests__/FillRateHelper-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n *\n * @format\n * @emails oncall+react_native\n */\n'use strict';\n\nconst FillRateHelper = require('FillRateHelper');\n\nlet rowFramesGlobal;\nconst dataGlobal = [\n  {key: 'header'},\n  {key: 'a'},\n  {key: 'b'},\n  {key: 'c'},\n  {key: 'd'},\n  {key: 'footer'},\n];\nfunction getFrameMetrics(index: number) {\n  const frame = rowFramesGlobal[dataGlobal[index].key];\n  return {length: frame.height, offset: frame.y, inLayout: frame.inLayout};\n}\n\nfunction computeResult({helper, props, state, scroll}): number {\n  helper.activate();\n  return helper.computeBlankness(\n    {\n      data: dataGlobal,\n      getItemCount: data2 => data2.length,\n      initialNumToRender: 10,\n      ...(props || {}),\n    },\n    {first: 1, last: 2, ...(state || {})},\n    {offset: 0, visibleLength: 100, ...(scroll || {})},\n  );\n}\n\ndescribe('computeBlankness', function() {\n  beforeEach(() => {\n    FillRateHelper.setSampleRate(1);\n    FillRateHelper.setMinSampleCount(0);\n  });\n\n  it('computes correct blankness of viewport', function() {\n    const helper = new FillRateHelper(getFrameMetrics);\n    rowFramesGlobal = {\n      header: {y: 0, height: 0, inLayout: true},\n      a: {y: 0, height: 50, inLayout: true},\n      b: {y: 50, height: 50, inLayout: true},\n    };\n    let blankness = computeResult({helper});\n    expect(blankness).toBe(0);\n    blankness = computeResult({helper, state: {last: 1}});\n    expect(blankness).toBe(0.5);\n    blankness = computeResult({helper, scroll: {offset: 25}});\n    expect(blankness).toBe(0.25);\n    blankness = computeResult({helper, scroll: {visibleLength: 400}});\n    expect(blankness).toBe(0.75);\n    blankness = computeResult({helper, scroll: {offset: 100}});\n    expect(blankness).toBe(1);\n  });\n\n  it('skips frames that are not in layout', function() {\n    const helper = new FillRateHelper(getFrameMetrics);\n    rowFramesGlobal = {\n      header: {y: 0, height: 0, inLayout: false},\n      a: {y: 0, height: 10, inLayout: false},\n      b: {y: 10, height: 30, inLayout: true},\n      c: {y: 40, height: 40, inLayout: true},\n      d: {y: 80, height: 20, inLayout: false},\n      footer: {y: 100, height: 0, inLayout: false},\n    };\n    const blankness = computeResult({helper, state: {last: 4}});\n    expect(blankness).toBe(0.3);\n  });\n\n  it('sampling rate can disable', function() {\n    let helper = new FillRateHelper(getFrameMetrics);\n    rowFramesGlobal = {\n      header: {y: 0, height: 0, inLayout: true},\n      a: {y: 0, height: 40, inLayout: true},\n      b: {y: 40, height: 40, inLayout: true},\n    };\n    let blankness = computeResult({helper});\n    expect(blankness).toBe(0.2);\n\n    FillRateHelper.setSampleRate(0);\n\n    helper = new FillRateHelper(getFrameMetrics);\n    blankness = computeResult({helper});\n    expect(blankness).toBe(0);\n  });\n\n  it('can handle multiple listeners and unsubscribe', function() {\n    const listeners = [jest.fn(), jest.fn(), jest.fn()];\n    const subscriptions = listeners.map(listener =>\n      FillRateHelper.addListener(listener),\n    );\n    subscriptions[1].remove();\n    const helper = new FillRateHelper(getFrameMetrics);\n    rowFramesGlobal = {\n      header: {y: 0, height: 0, inLayout: true},\n      a: {y: 0, height: 40, inLayout: true},\n      b: {y: 40, height: 40, inLayout: true},\n    };\n    const blankness = computeResult({helper});\n    expect(blankness).toBe(0.2);\n    helper.deactivateAndFlush();\n    const info0 = listeners[0].mock.calls[0][0];\n    expect(info0.pixels_blank / info0.pixels_sampled).toBe(blankness);\n    expect(listeners[1]).not.toBeCalled();\n    const info1 = listeners[2].mock.calls[0][0];\n    expect(info1.pixels_blank / info1.pixels_sampled).toBe(blankness);\n  });\n});\n"
  },
  {
    "path": "Libraries/Lists/__tests__/FlatList-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n *\n * @format\n * @emails oncall+react_native\n */\n'use strict';\n\nconst React = require('React');\nconst ReactTestRenderer = require('react-test-renderer');\n\nconst FlatList = require('FlatList');\n\ndescribe('FlatList', () => {\n  it('renders simple list', () => {\n    const component = ReactTestRenderer.create(\n      <FlatList\n        data={[{key: 'i1'}, {key: 'i2'}, {key: 'i3'}]}\n        renderItem={({item}) => <item value={item.key} />}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n  it('renders empty list', () => {\n    const component = ReactTestRenderer.create(\n      <FlatList data={[]} renderItem={({item}) => <item value={item.key} />} />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n  it('renders null list', () => {\n    const component = ReactTestRenderer.create(\n      <FlatList\n        data={undefined}\n        renderItem={({item}) => <item value={item.key} />}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n  it('renders all the bells and whistles', () => {\n    const component = ReactTestRenderer.create(\n      <FlatList\n        ItemSeparatorComponent={() => <separator />}\n        ListEmptyComponent={() => <empty />}\n        ListFooterComponent={() => <footer />}\n        ListHeaderComponent={() => <header />}\n        data={new Array(5).fill().map((_, ii) => ({id: String(ii)}))}\n        keyExtractor={(item, index) => item.id}\n        getItemLayout={({index}) => ({length: 50, offset: index * 50})}\n        numColumns={2}\n        refreshing={false}\n        onRefresh={jest.fn()}\n        renderItem={({item}) => <item value={item.id} />}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "Libraries/Lists/__tests__/SectionList-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n *\n * @format\n * @emails oncall+react_native\n */\n'use strict';\n\nconst React = require('React');\nconst ReactTestRenderer = require('react-test-renderer');\n\nconst SectionList = require('SectionList');\n\ndescribe('SectionList', () => {\n  it('renders empty list', () => {\n    const component = ReactTestRenderer.create(\n      <SectionList\n        sections={[]}\n        renderItem={({item}) => <item v={item.key} />}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n  it('rendering empty section headers is fine', () => {\n    const component = ReactTestRenderer.create(\n      <SectionList\n        sections={[{key: 's1', data: [{key: 'i1'}, {key: 'i2'}]}]}\n        renderItem={({item}) => <item v={item.key} />}\n        renderSectionHeader={() => null}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n  it('renders all the bells and whistles', () => {\n    const component = ReactTestRenderer.create(\n      <SectionList\n        initialNumToRender={Infinity}\n        ItemSeparatorComponent={props => (\n          <defaultItemSeparator v={propStr(props)} />\n        )}\n        ListEmptyComponent={props => <empty v={propStr(props)} />}\n        ListFooterComponent={props => <footer v={propStr(props)} />}\n        ListHeaderComponent={props => <header v={propStr(props)} />}\n        SectionSeparatorComponent={props => (\n          <sectionSeparator v={propStr(props)} />\n        )}\n        sections={[\n          {\n            renderItem: props => <itemForSection1 v={propStr(props)} />,\n            key: 's1',\n            keyExtractor: (item, index) => item.id,\n            ItemSeparatorComponent: props => (\n              <itemSeparatorForSection1 v={propStr(props)} />\n            ),\n            data: [{id: 'i1s1'}, {id: 'i2s1'}],\n          },\n          {\n            key: 's2',\n            data: [{key: 'i1s2'}, {key: 'i2s2'}],\n          },\n          {\n            key: 's3',\n            data: [{key: 'i1s3'}, {key: 'i2s3'}],\n          },\n        ]}\n        refreshing={false}\n        onRefresh={jest.fn()}\n        renderItem={props => <defaultItem v={propStr(props)} />}\n        renderSectionHeader={props => <sectionHeader v={propStr(props)} />}\n        renderSectionFooter={props => <sectionFooter v={propStr(props)} />}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n  it('renders a footer when there is no data', () => {\n    const component = ReactTestRenderer.create(\n      <SectionList\n        sections={[{key: 's1', data: []}]}\n        renderItem={({item}) => <item v={item.key} />}\n        renderSectionHeader={props => <sectionHeader v={propStr(props)} />}\n        renderSectionFooter={props => <sectionFooter v={propStr(props)} />}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n  it('renders a footer when there is no data and no header', () => {\n    const component = ReactTestRenderer.create(\n      <SectionList\n        sections={[{key: 's1', data: []}]}\n        renderItem={({item}) => <item v={item.key} />}\n        renderSectionFooter={props => <sectionFooter v={propStr(props)} />}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n});\n\nfunction propStr(props) {\n  return Object.keys(props)\n    .map(k => {\n      const propObj = props[k] || {};\n      return `${k}:${propObj.key || propObj.id || props[k]}`;\n    })\n    .join(',');\n}\n"
  },
  {
    "path": "Libraries/Lists/__tests__/ViewabilityHelper-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n *\n * @format\n * @emails oncall+react_native\n */\n'use strict';\n\nconst ViewabilityHelper = require('ViewabilityHelper');\n\nlet rowFrames;\nlet data;\nfunction getFrameMetrics(index: number) {\n  const frame = rowFrames[data[index].key];\n  return {length: frame.height, offset: frame.y};\n}\nfunction createViewToken(index: number, isViewable: boolean) {\n  return {key: data[index].key, isViewable};\n}\n\ndescribe('computeViewableItems', function() {\n  it('returns all 4 entirely visible rows as viewable', function() {\n    const helper = new ViewabilityHelper({\n      viewAreaCoveragePercentThreshold: 50,\n    });\n    rowFrames = {\n      a: {y: 0, height: 50},\n      b: {y: 50, height: 50},\n      c: {y: 100, height: 50},\n      d: {y: 150, height: 50},\n    };\n    data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}];\n    expect(\n      helper.computeViewableItems(data.length, 0, 200, getFrameMetrics),\n    ).toEqual([0, 1, 2, 3]);\n  });\n\n  it('returns top 2 rows as viewable (1. entirely visible and 2. majority)', function() {\n    const helper = new ViewabilityHelper({\n      viewAreaCoveragePercentThreshold: 50,\n    });\n    rowFrames = {\n      a: {y: 0, height: 50},\n      b: {y: 50, height: 150},\n      c: {y: 200, height: 50},\n      d: {y: 250, height: 50},\n    };\n    data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}];\n    expect(\n      helper.computeViewableItems(data.length, 0, 200, getFrameMetrics),\n    ).toEqual([0, 1]);\n  });\n\n  it('returns only 2nd row as viewable (majority)', function() {\n    const helper = new ViewabilityHelper({\n      viewAreaCoveragePercentThreshold: 50,\n    });\n    rowFrames = {\n      a: {y: 0, height: 50},\n      b: {y: 50, height: 150},\n      c: {y: 200, height: 50},\n      d: {y: 250, height: 50},\n    };\n    data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}];\n    expect(\n      helper.computeViewableItems(data.length, 25, 200, getFrameMetrics),\n    ).toEqual([1]);\n  });\n\n  it('handles empty input', function() {\n    const helper = new ViewabilityHelper({\n      viewAreaCoveragePercentThreshold: 50,\n    });\n    rowFrames = {};\n    data = [];\n    expect(\n      helper.computeViewableItems(data.length, 0, 200, getFrameMetrics),\n    ).toEqual([]);\n  });\n\n  it('handles different view area coverage percent thresholds', function() {\n    rowFrames = {\n      a: {y: 0, height: 50},\n      b: {y: 50, height: 150},\n      c: {y: 200, height: 500},\n      d: {y: 700, height: 50},\n    };\n    data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}];\n\n    let helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 0});\n    expect(\n      helper.computeViewableItems(data.length, 0, 50, getFrameMetrics),\n    ).toEqual([0]);\n    expect(\n      helper.computeViewableItems(data.length, 1, 50, getFrameMetrics),\n    ).toEqual([0, 1]);\n    expect(\n      helper.computeViewableItems(data.length, 199, 50, getFrameMetrics),\n    ).toEqual([1, 2]);\n    expect(\n      helper.computeViewableItems(data.length, 250, 50, getFrameMetrics),\n    ).toEqual([2]);\n\n    helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 100});\n    expect(\n      helper.computeViewableItems(data.length, 0, 200, getFrameMetrics),\n    ).toEqual([0, 1]);\n    expect(\n      helper.computeViewableItems(data.length, 1, 200, getFrameMetrics),\n    ).toEqual([1]);\n    expect(\n      helper.computeViewableItems(data.length, 400, 200, getFrameMetrics),\n    ).toEqual([2]);\n    expect(\n      helper.computeViewableItems(data.length, 600, 200, getFrameMetrics),\n    ).toEqual([3]);\n\n    helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 10});\n    expect(\n      helper.computeViewableItems(data.length, 30, 200, getFrameMetrics),\n    ).toEqual([0, 1, 2]);\n    expect(\n      helper.computeViewableItems(data.length, 31, 200, getFrameMetrics),\n    ).toEqual([1, 2]);\n  });\n\n  it('handles different item visible percent thresholds', function() {\n    rowFrames = {\n      a: {y: 0, height: 50},\n      b: {y: 50, height: 150},\n      c: {y: 200, height: 50},\n      d: {y: 250, height: 50},\n    };\n    data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}];\n    let helper = new ViewabilityHelper({itemVisiblePercentThreshold: 0});\n    expect(\n      helper.computeViewableItems(data.length, 0, 50, getFrameMetrics),\n    ).toEqual([0]);\n    expect(\n      helper.computeViewableItems(data.length, 1, 50, getFrameMetrics),\n    ).toEqual([0, 1]);\n\n    helper = new ViewabilityHelper({itemVisiblePercentThreshold: 100});\n    expect(\n      helper.computeViewableItems(data.length, 0, 250, getFrameMetrics),\n    ).toEqual([0, 1, 2]);\n    expect(\n      helper.computeViewableItems(data.length, 1, 250, getFrameMetrics),\n    ).toEqual([1, 2]);\n\n    helper = new ViewabilityHelper({itemVisiblePercentThreshold: 10});\n    expect(\n      helper.computeViewableItems(data.length, 184, 20, getFrameMetrics),\n    ).toEqual([1]);\n    expect(\n      helper.computeViewableItems(data.length, 185, 20, getFrameMetrics),\n    ).toEqual([1, 2]);\n    expect(\n      helper.computeViewableItems(data.length, 186, 20, getFrameMetrics),\n    ).toEqual([2]);\n  });\n});\n\ndescribe('onUpdate', function() {\n  it('returns 1 visible row as viewable then scrolls away', function() {\n    const helper = new ViewabilityHelper();\n    rowFrames = {\n      a: {y: 0, height: 50},\n    };\n    data = [{key: 'a'}];\n    const onViewableItemsChanged = jest.fn();\n    helper.onUpdate(\n      data.length,\n      0,\n      200,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n    expect(onViewableItemsChanged.mock.calls.length).toBe(1);\n    expect(onViewableItemsChanged.mock.calls[0][0]).toEqual({\n      changed: [{isViewable: true, key: 'a'}],\n      viewabilityConfig: {viewAreaCoveragePercentThreshold: 0},\n      viewableItems: [{isViewable: true, key: 'a'}],\n    });\n    helper.onUpdate(\n      data.length,\n      0,\n      200,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n    expect(onViewableItemsChanged.mock.calls.length).toBe(1); // nothing changed!\n    helper.onUpdate(\n      data.length,\n      100,\n      200,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n    expect(onViewableItemsChanged.mock.calls.length).toBe(2);\n    expect(onViewableItemsChanged.mock.calls[1][0]).toEqual({\n      changed: [{isViewable: false, key: 'a'}],\n      viewabilityConfig: {viewAreaCoveragePercentThreshold: 0},\n      viewableItems: [],\n    });\n  });\n\n  it('returns 1st visible row then 1st and 2nd then just 2nd', function() {\n    const helper = new ViewabilityHelper();\n    rowFrames = {\n      a: {y: 0, height: 200},\n      b: {y: 200, height: 200},\n    };\n    data = [{key: 'a'}, {key: 'b'}];\n    const onViewableItemsChanged = jest.fn();\n    helper.onUpdate(\n      data.length,\n      0,\n      200,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n    expect(onViewableItemsChanged.mock.calls.length).toBe(1);\n    expect(onViewableItemsChanged.mock.calls[0][0]).toEqual({\n      changed: [{isViewable: true, key: 'a'}],\n      viewabilityConfig: {viewAreaCoveragePercentThreshold: 0},\n      viewableItems: [{isViewable: true, key: 'a'}],\n    });\n    helper.onUpdate(\n      data.length,\n      100,\n      200,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n    expect(onViewableItemsChanged.mock.calls.length).toBe(2);\n    // Both visible with 100px overlap each\n    expect(onViewableItemsChanged.mock.calls[1][0]).toEqual({\n      changed: [{isViewable: true, key: 'b'}],\n      viewabilityConfig: {viewAreaCoveragePercentThreshold: 0},\n      viewableItems: [\n        {isViewable: true, key: 'a'},\n        {isViewable: true, key: 'b'},\n      ],\n    });\n    helper.onUpdate(\n      data.length,\n      200,\n      200,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n    expect(onViewableItemsChanged.mock.calls.length).toBe(3);\n    expect(onViewableItemsChanged.mock.calls[2][0]).toEqual({\n      changed: [{isViewable: false, key: 'a'}],\n      viewabilityConfig: {viewAreaCoveragePercentThreshold: 0},\n      viewableItems: [{isViewable: true, key: 'b'}],\n    });\n  });\n\n  it('minimumViewTime delays callback', function() {\n    const helper = new ViewabilityHelper({\n      minimumViewTime: 350,\n      viewAreaCoveragePercentThreshold: 0,\n    });\n    rowFrames = {\n      a: {y: 0, height: 200},\n      b: {y: 200, height: 200},\n    };\n    data = [{key: 'a'}, {key: 'b'}];\n    const onViewableItemsChanged = jest.fn();\n    helper.onUpdate(\n      data.length,\n      0,\n      200,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n    expect(onViewableItemsChanged).not.toBeCalled();\n\n    jest.runAllTimers();\n\n    expect(onViewableItemsChanged.mock.calls.length).toBe(1);\n    expect(onViewableItemsChanged.mock.calls[0][0]).toEqual({\n      changed: [{isViewable: true, key: 'a'}],\n      viewabilityConfig: {\n        minimumViewTime: 350,\n        viewAreaCoveragePercentThreshold: 0,\n      },\n      viewableItems: [{isViewable: true, key: 'a'}],\n    });\n  });\n\n  it('minimumViewTime skips briefly visible items', function() {\n    const helper = new ViewabilityHelper({\n      minimumViewTime: 350,\n      viewAreaCoveragePercentThreshold: 0,\n    });\n    rowFrames = {\n      a: {y: 0, height: 250},\n      b: {y: 250, height: 200},\n    };\n    data = [{key: 'a'}, {key: 'b'}];\n    const onViewableItemsChanged = jest.fn();\n    helper.onUpdate(\n      data.length,\n      0,\n      200,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n    helper.onUpdate(\n      data.length,\n      300, // scroll past item 'a'\n      200,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n\n    jest.runAllTimers();\n\n    expect(onViewableItemsChanged.mock.calls.length).toBe(1);\n    expect(onViewableItemsChanged.mock.calls[0][0]).toEqual({\n      changed: [{isViewable: true, key: 'b'}],\n      viewabilityConfig: {\n        minimumViewTime: 350,\n        viewAreaCoveragePercentThreshold: 0,\n      },\n      viewableItems: [{isViewable: true, key: 'b'}],\n    });\n  });\n\n  it('waitForInteraction blocks callback until interaction', function() {\n    const helper = new ViewabilityHelper({\n      waitForInteraction: true,\n      viewAreaCoveragePercentThreshold: 0,\n    });\n    rowFrames = {\n      a: {y: 0, height: 200},\n      b: {y: 200, height: 200},\n    };\n    data = [{key: 'a'}, {key: 'b'}];\n    const onViewableItemsChanged = jest.fn();\n    helper.onUpdate(\n      data.length,\n      0,\n      100,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n    expect(onViewableItemsChanged).not.toBeCalled();\n\n    helper.recordInteraction();\n\n    helper.onUpdate(\n      data.length,\n      20,\n      100,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n    expect(onViewableItemsChanged.mock.calls.length).toBe(1);\n    expect(onViewableItemsChanged.mock.calls[0][0]).toEqual({\n      changed: [{isViewable: true, key: 'a'}],\n      viewabilityConfig: {\n        waitForInteraction: true,\n        viewAreaCoveragePercentThreshold: 0,\n      },\n      viewableItems: [{isViewable: true, key: 'a'}],\n    });\n  });\n\n  it('returns the right visible row after the underlying data changed', function() {\n    const helper = new ViewabilityHelper();\n    rowFrames = {\n      a: {y: 0, height: 200},\n      b: {y: 200, height: 200},\n    };\n    data = [{key: 'a'}, {key: 'b'}];\n    const onViewableItemsChanged = jest.fn();\n    helper.onUpdate(\n      data.length,\n      0,\n      200,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n    expect(onViewableItemsChanged.mock.calls.length).toBe(1);\n    expect(onViewableItemsChanged.mock.calls[0][0]).toEqual({\n      changed: [{isViewable: true, key: 'a'}],\n      viewabilityConfig: {viewAreaCoveragePercentThreshold: 0},\n      viewableItems: [{isViewable: true, key: 'a'}],\n    });\n\n    // update data\n    rowFrames = {\n      c: {y: 0, height: 200},\n      a: {y: 200, height: 200},\n      b: {y: 400, height: 200},\n    };\n    data = [{key: 'c'}, {key: 'a'}, {key: 'b'}];\n\n    helper.resetViewableIndices();\n\n    helper.onUpdate(\n      data.length,\n      0,\n      200,\n      getFrameMetrics,\n      createViewToken,\n      onViewableItemsChanged,\n    );\n\n    expect(onViewableItemsChanged.mock.calls.length).toBe(2);\n    expect(onViewableItemsChanged.mock.calls[1][0]).toEqual({\n      changed: [{isViewable: true, key: 'c'}, {isViewable: false, key: 'a'}],\n      viewabilityConfig: {viewAreaCoveragePercentThreshold: 0},\n      viewableItems: [{isViewable: true, key: 'c'}],\n    });\n  });\n});\n"
  },
  {
    "path": "Libraries/Lists/__tests__/VirtualizeUtils-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n *\n * @format\n * @emails oncall+react_native\n */\n'use strict';\n\nconst {elementsThatOverlapOffsets, newRangeCount} = require('VirtualizeUtils');\n\ndescribe('newRangeCount', function() {\n  it('handles subset', function() {\n    expect(newRangeCount({first: 1, last: 4}, {first: 2, last: 3})).toBe(0);\n  });\n  it('handles forward disjoint set', function() {\n    expect(newRangeCount({first: 1, last: 4}, {first: 6, last: 9})).toBe(4);\n  });\n  it('handles reverse disjoint set', function() {\n    expect(newRangeCount({first: 6, last: 8}, {first: 1, last: 4})).toBe(4);\n  });\n  it('handles superset', function() {\n    expect(newRangeCount({first: 1, last: 4}, {first: 0, last: 5})).toBe(2);\n  });\n  it('handles end extension', function() {\n    expect(newRangeCount({first: 1, last: 4}, {first: 1, last: 8})).toBe(4);\n  });\n  it('handles front extension', function() {\n    expect(newRangeCount({first: 1, last: 4}, {first: 0, last: 4})).toBe(1);\n  });\n  it('handles forward insersect', function() {\n    expect(newRangeCount({first: 1, last: 4}, {first: 3, last: 6})).toBe(2);\n  });\n  it('handles reverse intersect', function() {\n    expect(newRangeCount({first: 3, last: 6}, {first: 1, last: 4})).toBe(2);\n  });\n});\n\ndescribe('elementsThatOverlapOffsets', function() {\n  it('handles fixed length', function() {\n    const offsets = [0, 250, 350, 450];\n    function getFrameMetrics(index: number) {\n      return {\n        length: 100,\n        offset: 100 * index,\n      };\n    }\n    expect(elementsThatOverlapOffsets(offsets, 100, getFrameMetrics)).toEqual([\n      0,\n      2,\n      3,\n      4,\n    ]);\n  });\n  it('handles variable length', function() {\n    const offsets = [150, 250, 900];\n    const frames = [\n      {offset: 0, length: 50},\n      {offset: 50, length: 200},\n      {offset: 250, length: 600},\n      {offset: 850, length: 100},\n      {offset: 950, length: 150},\n    ];\n    expect(\n      elementsThatOverlapOffsets(offsets, frames.length, ii => frames[ii]),\n    ).toEqual([1, 1, 3]);\n  });\n  it('handles out of bounds', function() {\n    const offsets = [150, 900];\n    const frames = [\n      {offset: 0, length: 50},\n      {offset: 50, length: 150},\n      {offset: 250, length: 100},\n    ];\n    expect(\n      elementsThatOverlapOffsets(offsets, frames.length, ii => frames[ii]),\n    ).toEqual([1]);\n  });\n  it('errors on non-increasing offsets', function() {\n    const offsets = [150, 50];\n    const frames = [\n      {offset: 0, length: 50},\n      {offset: 50, length: 150},\n      {offset: 250, length: 100},\n    ];\n    expect(() => {\n      elementsThatOverlapOffsets(offsets, frames.length, ii => frames[ii]);\n    }).toThrowErrorMatchingSnapshot();\n  });\n});\n"
  },
  {
    "path": "Libraries/Lists/__tests__/VirtualizedList-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n *\n * @format\n * @emails oncall+react_native\n */\n'use strict';\n\nconst React = require('React');\nconst ReactTestRenderer = require('react-test-renderer');\n\nconst VirtualizedList = require('VirtualizedList');\n\ndescribe('VirtualizedList', () => {\n  it('renders simple list', () => {\n    const component = ReactTestRenderer.create(\n      <VirtualizedList\n        data={[{key: 'i1'}, {key: 'i2'}, {key: 'i3'}]}\n        renderItem={({item}) => <item value={item.key} />}\n        getItem={(data, index) => data[index]}\n        getItemCount={data => data.length}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n\n  it('renders empty list', () => {\n    const component = ReactTestRenderer.create(\n      <VirtualizedList\n        data={[]}\n        renderItem={({item}) => <item value={item.key} />}\n        getItem={(data, index) => data[index]}\n        getItemCount={data => data.length}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n\n  it('renders null list', () => {\n    const component = ReactTestRenderer.create(\n      <VirtualizedList\n        data={undefined}\n        renderItem={({item}) => <item value={item.key} />}\n        getItem={(data, index) => data[index]}\n        getItemCount={data => 0}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n\n  it('renders empty list with empty component', () => {\n    const component = ReactTestRenderer.create(\n      <VirtualizedList\n        data={[]}\n        ListEmptyComponent={() => <empty />}\n        ListFooterComponent={() => <footer />}\n        ListHeaderComponent={() => <header />}\n        getItem={(data, index) => data[index]}\n        getItemCount={data => data.length}\n        renderItem={({item}) => <item value={item.key} />}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n\n  it('renders list with empty component', () => {\n    const component = ReactTestRenderer.create(\n      <VirtualizedList\n        data={[{key: 'hello'}]}\n        ListEmptyComponent={() => <empty />}\n        getItem={(data, index) => data[index]}\n        getItemCount={data => data.length}\n        renderItem={({item}) => <item value={item.key} />}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n\n  it('renders all the bells and whistles', () => {\n    const component = ReactTestRenderer.create(\n      <VirtualizedList\n        ItemSeparatorComponent={() => <separator />}\n        ListEmptyComponent={() => <empty />}\n        ListFooterComponent={() => <footer />}\n        ListHeaderComponent={() => <header />}\n        data={new Array(5).fill().map((_, ii) => ({id: String(ii)}))}\n        getItem={(data, index) => data[index]}\n        getItemCount={data => data.length}\n        getItemLayout={({index}) => ({length: 50, offset: index * 50})}\n        inverted={true}\n        keyExtractor={(item, index) => item.id}\n        onRefresh={jest.fn()}\n        refreshing={false}\n        renderItem={({item}) => <item value={item.id} />}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n\n  it('test getItem functionality where data is not an Array', () => {\n    const component = ReactTestRenderer.create(\n      <VirtualizedList\n        data={new Map([['id_0', {key: 'item_0'}]])}\n        getItem={(data, index) => data.get('id_' + index)}\n        getItemCount={(data: Map) => data.size}\n        renderItem={({item}) => <item value={item.key} />}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n\n  it('handles separators correctly', () => {\n    const infos = [];\n    const component = ReactTestRenderer.create(\n      <VirtualizedList\n        ItemSeparatorComponent={props => <separator {...props} />}\n        data={[{key: 'i0'}, {key: 'i1'}, {key: 'i2'}]}\n        renderItem={info => {\n          infos.push(info);\n          return <item title={info.item.key} />;\n        }}\n        getItem={(data, index) => data[index]}\n        getItemCount={data => data.length}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n    infos[1].separators.highlight();\n    expect(component).toMatchSnapshot();\n    infos[2].separators.updateProps('leading', {press: true});\n    expect(component).toMatchSnapshot();\n    infos[1].separators.unhighlight();\n  });\n\n  it('handles nested lists', () => {\n    const component = ReactTestRenderer.create(\n      <VirtualizedList\n        data={[{key: 'outer0'}, {key: 'outer1'}]}\n        renderItem={outerInfo => (\n          <VirtualizedList\n            data={[\n              {key: outerInfo.item.key + ':inner0'},\n              {key: outerInfo.item.key + ':inner1'},\n            ]}\n            horizontal={outerInfo.item.key === 'outer1'}\n            renderItem={innerInfo => {\n              return <item title={innerInfo.item.key} />;\n            }}\n            getItem={(data, index) => data[index]}\n            getItemCount={data => data.length}\n          />\n        )}\n        getItem={(data, index) => data[index]}\n        getItemCount={data => data.length}\n      />,\n    );\n    expect(component).toMatchSnapshot();\n  });\n\n  it('returns the viewableItems correctly in the onViewableItemsChanged callback after changing the data', () => {\n    const ITEM_HEIGHT = 800;\n    let data = [{key: 'i1'}, {key: 'i2'}, {key: 'i3'}];\n    const nativeEvent = {\n      contentOffset: {y: 0, x: 0},\n      layoutMeasurement: {width: 300, height: 600},\n      contentSize: {width: 300, height: data.length * ITEM_HEIGHT},\n      zoomScale: 1,\n      contentInset: {right: 0, top: 0, left: 0, bottom: 0},\n    };\n    const onViewableItemsChanged = jest.fn();\n    const props = {\n      data,\n      renderItem: ({item}) => <item value={item.key} />,\n      getItem: (data, index) => data[index],\n      getItemCount: data => data.length,\n      getItemLayout: (data, index) => ({\n        length: ITEM_HEIGHT,\n        offset: ITEM_HEIGHT * index,\n        index,\n      }),\n      onViewableItemsChanged,\n    };\n\n    const component = ReactTestRenderer.create(<VirtualizedList {...props} />);\n\n    const instance = component.getInstance();\n\n    instance._onScrollBeginDrag({nativeEvent});\n    instance._onScroll({\n      timeStamp: 1000,\n      nativeEvent,\n    });\n\n    expect(onViewableItemsChanged).toHaveBeenCalledTimes(1);\n    expect(onViewableItemsChanged).toHaveBeenLastCalledWith(\n      expect.objectContaining({\n        viewableItems: [expect.objectContaining({isViewable: true, key: 'i1'})],\n      }),\n    );\n    data = [{key: 'i4'}, ...data];\n    component.update(<VirtualizedList {...props} data={data} />);\n\n    instance._onScroll({\n      timeStamp: 2000,\n      nativeEvent: {\n        ...nativeEvent,\n        contentOffset: {y: 100, x: 0},\n      },\n    });\n\n    expect(onViewableItemsChanged).toHaveBeenCalledTimes(2);\n    expect(onViewableItemsChanged).toHaveBeenLastCalledWith(\n      expect.objectContaining({\n        viewableItems: [expect.objectContaining({isViewable: true, key: 'i4'})],\n      }),\n    );\n  });\n});\n"
  },
  {
    "path": "Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`FlatList renders all the bells and whistles 1`] = `\n<RCTScrollView\n  ItemSeparatorComponent={[Function]}\n  ListEmptyComponent={[Function]}\n  ListFooterComponent={[Function]}\n  ListHeaderComponent={[Function]}\n  data={\n    Array [\n      Object {\n        \"id\": \"0\",\n      },\n      Object {\n        \"id\": \"1\",\n      },\n      Object {\n        \"id\": \"2\",\n      },\n      Object {\n        \"id\": \"3\",\n      },\n      Object {\n        \"id\": \"4\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  getItemLayout={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  numColumns={2}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onRefresh={[MockFunction]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  refreshControl={\n    <RefreshControlMock\n      onRefresh={[MockFunction]}\n      progressViewOffset={undefined}\n      refreshing={false}\n    />\n  }\n  refreshing={false}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  viewabilityConfigCallbackPairs={Array []}\n  windowSize={21}\n>\n  <RCTRefreshControl />\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <header />\n    </View>\n    <View\n      onLayout={undefined}\n      style={null}\n    >\n      <View\n        style={\n          Array [\n            Object {\n              \"flexDirection\": \"row\",\n            },\n            undefined,\n          ]\n        }\n      >\n        <item\n          value=\"0\"\n        />\n        <item\n          value=\"1\"\n        />\n      </View>\n      <separator />\n    </View>\n    <View\n      onLayout={undefined}\n      style={null}\n    >\n      <View\n        style={\n          Array [\n            Object {\n              \"flexDirection\": \"row\",\n            },\n            undefined,\n          ]\n        }\n      >\n        <item\n          value=\"2\"\n        />\n        <item\n          value=\"3\"\n        />\n      </View>\n      <separator />\n    </View>\n    <View\n      onLayout={undefined}\n      style={null}\n    >\n      <View\n        style={\n          Array [\n            Object {\n              \"flexDirection\": \"row\",\n            },\n            undefined,\n          ]\n        }\n      >\n        <item\n          value=\"4\"\n        />\n      </View>\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <footer />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`FlatList renders empty list 1`] = `\n<RCTScrollView\n  data={Array []}\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  numColumns={1}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  viewabilityConfigCallbackPairs={Array []}\n  windowSize={21}\n>\n  <View />\n</RCTScrollView>\n`;\n\nexports[`FlatList renders null list 1`] = `\n<RCTScrollView\n  data={undefined}\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  numColumns={1}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  viewabilityConfigCallbackPairs={Array []}\n  windowSize={21}\n>\n  <View />\n</RCTScrollView>\n`;\n\nexports[`FlatList renders simple list 1`] = `\n<RCTScrollView\n  data={\n    Array [\n      Object {\n        \"key\": \"i1\",\n      },\n      Object {\n        \"key\": \"i2\",\n      },\n      Object {\n        \"key\": \"i3\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  numColumns={1}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  viewabilityConfigCallbackPairs={Array []}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        value=\"i1\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        value=\"i2\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        value=\"i3\"\n      />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n"
  },
  {
    "path": "Libraries/Lists/__tests__/__snapshots__/SectionList-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`SectionList rendering empty section headers is fine 1`] = `\n<RCTScrollView\n  ItemSeparatorComponent={undefined}\n  data={\n    Array [\n      Object {\n        \"data\": Array [\n          Object {\n            \"key\": \"i1\",\n          },\n          Object {\n            \"key\": \"i2\",\n          },\n        ],\n        \"key\": \"s1\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  onViewableItemsChanged={undefined}\n  renderItem={[Function]}\n  renderSectionHeader={[Function]}\n  scrollEventThrottle={50}\n  sections={\n    Array [\n      Object {\n        \"data\": Array [\n          Object {\n            \"key\": \"i1\",\n          },\n          Object {\n            \"key\": \"i2\",\n          },\n        ],\n        \"key\": \"s1\",\n      },\n    ]\n  }\n  stickyHeaderIndices={\n    Array [\n      0,\n    ]\n  }\n  stickySectionHeadersEnabled={true}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    />\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        v=\"i1\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        v=\"i2\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    />\n  </View>\n</RCTScrollView>\n`;\n\nexports[`SectionList renders a footer when there is no data 1`] = `\n<RCTScrollView\n  ItemSeparatorComponent={undefined}\n  data={\n    Array [\n      Object {\n        \"data\": Array [],\n        \"key\": \"s1\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  onViewableItemsChanged={undefined}\n  renderItem={[Function]}\n  renderSectionFooter={[Function]}\n  renderSectionHeader={[Function]}\n  scrollEventThrottle={50}\n  sections={\n    Array [\n      Object {\n        \"data\": Array [],\n        \"key\": \"s1\",\n      },\n    ]\n  }\n  stickyHeaderIndices={\n    Array [\n      0,\n    ]\n  }\n  stickySectionHeadersEnabled={true}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <sectionHeader\n        v=\"section:s1\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <sectionFooter\n        v=\"section:s1\"\n      />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`SectionList renders a footer when there is no data and no header 1`] = `\n<RCTScrollView\n  ItemSeparatorComponent={undefined}\n  data={\n    Array [\n      Object {\n        \"data\": Array [],\n        \"key\": \"s1\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  onViewableItemsChanged={undefined}\n  renderItem={[Function]}\n  renderSectionFooter={[Function]}\n  scrollEventThrottle={50}\n  sections={\n    Array [\n      Object {\n        \"data\": Array [],\n        \"key\": \"s1\",\n      },\n    ]\n  }\n  stickyHeaderIndices={\n    Array [\n      0,\n    ]\n  }\n  stickySectionHeadersEnabled={true}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    />\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <sectionFooter\n        v=\"section:s1\"\n      />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`SectionList renders all the bells and whistles 1`] = `\n<RCTScrollView\n  ItemSeparatorComponent={undefined}\n  ListEmptyComponent={[Function]}\n  ListFooterComponent={[Function]}\n  ListHeaderComponent={[Function]}\n  SectionSeparatorComponent={[Function]}\n  data={\n    Array [\n      Object {\n        \"ItemSeparatorComponent\": [Function],\n        \"data\": Array [\n          Object {\n            \"id\": \"i1s1\",\n          },\n          Object {\n            \"id\": \"i2s1\",\n          },\n        ],\n        \"key\": \"s1\",\n        \"keyExtractor\": [Function],\n        \"renderItem\": [Function],\n      },\n      Object {\n        \"data\": Array [\n          Object {\n            \"key\": \"i1s2\",\n          },\n          Object {\n            \"key\": \"i2s2\",\n          },\n        ],\n        \"key\": \"s2\",\n      },\n      Object {\n        \"data\": Array [\n          Object {\n            \"key\": \"i1s3\",\n          },\n          Object {\n            \"key\": \"i2s3\",\n          },\n        ],\n        \"key\": \"s3\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={Infinity}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onRefresh={[MockFunction]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  onViewableItemsChanged={undefined}\n  refreshControl={\n    <RefreshControlMock\n      onRefresh={[MockFunction]}\n      progressViewOffset={undefined}\n      refreshing={false}\n    />\n  }\n  refreshing={false}\n  renderItem={[Function]}\n  renderSectionFooter={[Function]}\n  renderSectionHeader={[Function]}\n  scrollEventThrottle={50}\n  sections={\n    Array [\n      Object {\n        \"ItemSeparatorComponent\": [Function],\n        \"data\": Array [\n          Object {\n            \"id\": \"i1s1\",\n          },\n          Object {\n            \"id\": \"i2s1\",\n          },\n        ],\n        \"key\": \"s1\",\n        \"keyExtractor\": [Function],\n        \"renderItem\": [Function],\n      },\n      Object {\n        \"data\": Array [\n          Object {\n            \"key\": \"i1s2\",\n          },\n          Object {\n            \"key\": \"i2s2\",\n          },\n        ],\n        \"key\": \"s2\",\n      },\n      Object {\n        \"data\": Array [\n          Object {\n            \"key\": \"i1s3\",\n          },\n          Object {\n            \"key\": \"i2s3\",\n          },\n        ],\n        \"key\": \"s3\",\n      },\n    ]\n  }\n  stickyHeaderIndices={\n    Array [\n      1,\n      5,\n      9,\n    ]\n  }\n  stickySectionHeadersEnabled={true}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <RCTRefreshControl />\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <header\n        v=\"\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <sectionHeader\n        v=\"section:s1\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <View>\n        <sectionSeparator\n          v=\"highlighted:false,leadingItem:undefined,leadingSection:undefined,section:s1,trailingItem:i1s1,trailingSection:s2\"\n        />\n        <itemForSection1\n          v=\"item:i1s1,index:0,section:s1,separators:[object Object]\"\n        />\n        <itemSeparatorForSection1\n          v=\"highlighted:false,leadingItem:i1s1,leadingSection:undefined,section:s1,trailingItem:i2s1,trailingSection:s2\"\n        />\n      </View>\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <View>\n        <itemForSection1\n          v=\"item:i2s1,index:1,section:s1,separators:[object Object]\"\n        />\n        <sectionSeparator\n          v=\"highlighted:false,leadingItem:i2s1,leadingSection:undefined,section:s1,trailingItem:undefined,trailingSection:s2\"\n        />\n      </View>\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <sectionFooter\n        v=\"section:s1\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <sectionHeader\n        v=\"section:s2\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <View>\n        <sectionSeparator\n          v=\"highlighted:false,leadingItem:undefined,leadingSection:s1,section:s2,trailingItem:i1s2,trailingSection:s3\"\n        />\n        <defaultItem\n          v=\"item:i1s2,index:0,section:s2,separators:[object Object]\"\n        />\n        <defaultItemSeparator\n          v=\"highlighted:false,leadingItem:i1s2,leadingSection:s1,section:s2,trailingItem:i2s2,trailingSection:s3\"\n        />\n      </View>\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <View>\n        <defaultItem\n          v=\"item:i2s2,index:1,section:s2,separators:[object Object]\"\n        />\n        <sectionSeparator\n          v=\"highlighted:false,leadingItem:i2s2,leadingSection:s1,section:s2,trailingItem:undefined,trailingSection:s3\"\n        />\n      </View>\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <sectionFooter\n        v=\"section:s2\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <sectionHeader\n        v=\"section:s3\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <View>\n        <sectionSeparator\n          v=\"highlighted:false,leadingItem:undefined,leadingSection:s2,section:s3,trailingItem:i1s3,trailingSection:undefined\"\n        />\n        <defaultItem\n          v=\"item:i1s3,index:0,section:s3,separators:[object Object]\"\n        />\n        <defaultItemSeparator\n          v=\"highlighted:false,leadingItem:i1s3,leadingSection:s2,section:s3,trailingItem:i2s3,trailingSection:undefined\"\n        />\n      </View>\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <View>\n        <defaultItem\n          v=\"item:i2s3,index:1,section:s3,separators:[object Object]\"\n        />\n        <sectionSeparator\n          v=\"highlighted:false,leadingItem:i2s3,leadingSection:s2,section:s3,trailingItem:undefined,trailingSection:undefined\"\n        />\n      </View>\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <sectionFooter\n        v=\"section:s3\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <footer\n        v=\"\"\n      />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`SectionList renders empty list 1`] = `\n<RCTScrollView\n  ItemSeparatorComponent={undefined}\n  data={Array []}\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  onViewableItemsChanged={undefined}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  sections={Array []}\n  stickyHeaderIndices={Array []}\n  stickySectionHeadersEnabled={true}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View />\n</RCTScrollView>\n`;\n"
  },
  {
    "path": "Libraries/Lists/__tests__/__snapshots__/VirtualizeUtils-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`elementsThatOverlapOffsets errors on non-increasing offsets 1`] = `\"bad offsets input, should be in increasing order: [150,50]\"`;\n"
  },
  {
    "path": "Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`VirtualizedList handles nested lists 1`] = `\n<RCTScrollView\n  data={\n    Array [\n      Object {\n        \"key\": \"outer0\",\n      },\n      Object {\n        \"key\": \"outer1\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <View\n        data={\n          Array [\n            Object {\n              \"key\": \"outer0:inner0\",\n            },\n            Object {\n              \"key\": \"outer0:inner1\",\n            },\n          ]\n        }\n        disableVirtualization={false}\n        getItem={[Function]}\n        getItemCount={[Function]}\n        horizontal={false}\n        initialNumToRender={10}\n        keyExtractor={[Function]}\n        maxToRenderPerBatch={10}\n        onContentSizeChange={[Function]}\n        onEndReachedThreshold={2}\n        onLayout={[Function]}\n        onMomentumScrollEnd={[Function]}\n        onScroll={[Function]}\n        onScrollBeginDrag={[Function]}\n        onScrollEndDrag={[Function]}\n        renderItem={[Function]}\n        scrollEventThrottle={50}\n        stickyHeaderIndices={Array []}\n        updateCellsBatchingPeriod={50}\n        windowSize={21}\n      >\n        <View\n          onLayout={[Function]}\n          style={null}\n        >\n          <item\n            title=\"outer0:inner0\"\n          />\n        </View>\n        <View\n          onLayout={[Function]}\n          style={null}\n        >\n          <item\n            title=\"outer0:inner1\"\n          />\n        </View>\n      </View>\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <RCTScrollView\n        data={\n          Array [\n            Object {\n              \"key\": \"outer1:inner0\",\n            },\n            Object {\n              \"key\": \"outer1:inner1\",\n            },\n          ]\n        }\n        disableVirtualization={false}\n        getItem={[Function]}\n        getItemCount={[Function]}\n        horizontal={true}\n        initialNumToRender={10}\n        keyExtractor={[Function]}\n        maxToRenderPerBatch={10}\n        onContentSizeChange={[Function]}\n        onEndReachedThreshold={2}\n        onLayout={[Function]}\n        onMomentumScrollEnd={[Function]}\n        onScroll={[Function]}\n        onScrollBeginDrag={[Function]}\n        onScrollEndDrag={[Function]}\n        renderItem={[Function]}\n        scrollEventThrottle={50}\n        stickyHeaderIndices={Array []}\n        updateCellsBatchingPeriod={50}\n        windowSize={21}\n      >\n        <View>\n          <View\n            onLayout={[Function]}\n            style={\n              Array [\n                Object {\n                  \"flexDirection\": \"row\",\n                },\n                null,\n              ]\n            }\n          >\n            <item\n              title=\"outer1:inner0\"\n            />\n          </View>\n          <View\n            onLayout={[Function]}\n            style={\n              Array [\n                Object {\n                  \"flexDirection\": \"row\",\n                },\n                null,\n              ]\n            }\n          >\n            <item\n              title=\"outer1:inner1\"\n            />\n          </View>\n        </View>\n      </RCTScrollView>\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`VirtualizedList handles separators correctly 1`] = `\n<RCTScrollView\n  ItemSeparatorComponent={[Function]}\n  data={\n    Array [\n      Object {\n        \"key\": \"i0\",\n      },\n      Object {\n        \"key\": \"i1\",\n      },\n      Object {\n        \"key\": \"i2\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        title=\"i0\"\n      />\n      <separator\n        highlighted={false}\n        leadingItem={\n          Object {\n            \"key\": \"i0\",\n          }\n        }\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        title=\"i1\"\n      />\n      <separator\n        highlighted={false}\n        leadingItem={\n          Object {\n            \"key\": \"i1\",\n          }\n        }\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        title=\"i2\"\n      />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`VirtualizedList handles separators correctly 2`] = `\n<RCTScrollView\n  ItemSeparatorComponent={[Function]}\n  data={\n    Array [\n      Object {\n        \"key\": \"i0\",\n      },\n      Object {\n        \"key\": \"i1\",\n      },\n      Object {\n        \"key\": \"i2\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        title=\"i0\"\n      />\n      <separator\n        highlighted={true}\n        leadingItem={\n          Object {\n            \"key\": \"i0\",\n          }\n        }\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        title=\"i1\"\n      />\n      <separator\n        highlighted={true}\n        leadingItem={\n          Object {\n            \"key\": \"i1\",\n          }\n        }\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        title=\"i2\"\n      />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`VirtualizedList handles separators correctly 3`] = `\n<RCTScrollView\n  ItemSeparatorComponent={[Function]}\n  data={\n    Array [\n      Object {\n        \"key\": \"i0\",\n      },\n      Object {\n        \"key\": \"i1\",\n      },\n      Object {\n        \"key\": \"i2\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        title=\"i0\"\n      />\n      <separator\n        highlighted={true}\n        leadingItem={\n          Object {\n            \"key\": \"i0\",\n          }\n        }\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        title=\"i1\"\n      />\n      <separator\n        highlighted={true}\n        leadingItem={\n          Object {\n            \"key\": \"i1\",\n          }\n        }\n        press={true}\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        title=\"i2\"\n      />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`VirtualizedList renders all the bells and whistles 1`] = `\n<RCTScrollView\n  ItemSeparatorComponent={[Function]}\n  ListEmptyComponent={[Function]}\n  ListFooterComponent={[Function]}\n  ListHeaderComponent={[Function]}\n  data={\n    Array [\n      Object {\n        \"id\": \"0\",\n      },\n      Object {\n        \"id\": \"1\",\n      },\n      Object {\n        \"id\": \"2\",\n      },\n      Object {\n        \"id\": \"3\",\n      },\n      Object {\n        \"id\": \"4\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  getItemLayout={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  inverted={true}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onRefresh={[MockFunction]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  refreshControl={\n    <RefreshControlMock\n      onRefresh={[MockFunction]}\n      progressViewOffset={undefined}\n      refreshing={false}\n    />\n  }\n  refreshing={false}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  style={\n    Array [\n      Object {\n        \"transform\": Array [\n          Object {\n            \"scaleY\": -1,\n          },\n        ],\n      },\n      undefined,\n    ]\n  }\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <RCTRefreshControl />\n  <View>\n    <View\n      onLayout={[Function]}\n      style={\n        Object {\n          \"transform\": Array [\n            Object {\n              \"scaleY\": -1,\n            },\n          ],\n        }\n      }\n    >\n      <header />\n    </View>\n    <View\n      onLayout={undefined}\n      style={\n        Array [\n          Object {\n            \"flexDirection\": \"column-reverse\",\n          },\n          Object {\n            \"transform\": Array [\n              Object {\n                \"scaleY\": -1,\n              },\n            ],\n          },\n        ]\n      }\n    >\n      <item\n        value=\"0\"\n      />\n      <separator />\n    </View>\n    <View\n      onLayout={undefined}\n      style={\n        Array [\n          Object {\n            \"flexDirection\": \"column-reverse\",\n          },\n          Object {\n            \"transform\": Array [\n              Object {\n                \"scaleY\": -1,\n              },\n            ],\n          },\n        ]\n      }\n    >\n      <item\n        value=\"1\"\n      />\n      <separator />\n    </View>\n    <View\n      onLayout={undefined}\n      style={\n        Array [\n          Object {\n            \"flexDirection\": \"column-reverse\",\n          },\n          Object {\n            \"transform\": Array [\n              Object {\n                \"scaleY\": -1,\n              },\n            ],\n          },\n        ]\n      }\n    >\n      <item\n        value=\"2\"\n      />\n      <separator />\n    </View>\n    <View\n      onLayout={undefined}\n      style={\n        Array [\n          Object {\n            \"flexDirection\": \"column-reverse\",\n          },\n          Object {\n            \"transform\": Array [\n              Object {\n                \"scaleY\": -1,\n              },\n            ],\n          },\n        ]\n      }\n    >\n      <item\n        value=\"3\"\n      />\n      <separator />\n    </View>\n    <View\n      onLayout={undefined}\n      style={\n        Array [\n          Object {\n            \"flexDirection\": \"column-reverse\",\n          },\n          Object {\n            \"transform\": Array [\n              Object {\n                \"scaleY\": -1,\n              },\n            ],\n          },\n        ]\n      }\n    >\n      <item\n        value=\"4\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={\n        Object {\n          \"transform\": Array [\n            Object {\n              \"scaleY\": -1,\n            },\n          ],\n        }\n      }\n    >\n      <footer />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`VirtualizedList renders empty list 1`] = `\n<RCTScrollView\n  data={Array []}\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View />\n</RCTScrollView>\n`;\n\nexports[`VirtualizedList renders empty list with empty component 1`] = `\n<RCTScrollView\n  ListEmptyComponent={[Function]}\n  ListFooterComponent={[Function]}\n  ListHeaderComponent={[Function]}\n  data={Array []}\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <header />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <empty />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <footer />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`VirtualizedList renders list with empty component 1`] = `\n<RCTScrollView\n  ListEmptyComponent={[Function]}\n  data={\n    Array [\n      Object {\n        \"key\": \"hello\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        value=\"hello\"\n      />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`VirtualizedList renders null list 1`] = `\n<RCTScrollView\n  data={undefined}\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View />\n</RCTScrollView>\n`;\n\nexports[`VirtualizedList renders simple list 1`] = `\n<RCTScrollView\n  data={\n    Array [\n      Object {\n        \"key\": \"i1\",\n      },\n      Object {\n        \"key\": \"i2\",\n      },\n      Object {\n        \"key\": \"i3\",\n      },\n    ]\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        value=\"i1\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        value=\"i2\"\n      />\n    </View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        value=\"i3\"\n      />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n\nexports[`VirtualizedList test getItem functionality where data is not an Array 1`] = `\n<RCTScrollView\n  data={\n    Map {\n      \"id_0\" => Object {\n        \"key\": \"item_0\",\n      },\n    }\n  }\n  disableVirtualization={false}\n  getItem={[Function]}\n  getItemCount={[Function]}\n  horizontal={false}\n  initialNumToRender={10}\n  keyExtractor={[Function]}\n  maxToRenderPerBatch={10}\n  onContentSizeChange={[Function]}\n  onEndReachedThreshold={2}\n  onLayout={[Function]}\n  onMomentumScrollEnd={[Function]}\n  onScroll={[Function]}\n  onScrollBeginDrag={[Function]}\n  onScrollEndDrag={[Function]}\n  renderItem={[Function]}\n  scrollEventThrottle={50}\n  stickyHeaderIndices={Array []}\n  updateCellsBatchingPeriod={50}\n  windowSize={21}\n>\n  <View>\n    <View\n      onLayout={[Function]}\n      style={null}\n    >\n      <item\n        value=\"item_0\"\n      />\n    </View>\n  </View>\n</RCTScrollView>\n`;\n"
  },
  {
    "path": "Libraries/Menu/MenuManager.js",
    "content": "/*\n* @providesModule MenuManager\n* @flow\n*/\n'use strict';\n\nconst MenuManager = require('NativeModules').MenuManager;\nconst RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\n\nMenuManager.addSubmenu = function(title, items) {\n  items.forEach(item => {\n    MenuManager.addItemToSubmenu(title, item);\n    RCTDeviceEventEmitter.addListener(\n      'onKeyPressed_' + item.key,\n      item.callback\n    );\n  });\n};\n\nmodule.exports = MenuManager;\n"
  },
  {
    "path": "Libraries/Modal/Modal.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Modal\n * @flow\n */\n'use strict';\n\nconst AppContainer = require('AppContainer');\nconst I18nManager = require('I18nManager');\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst NativeModules = require('NativeModules');\nconst Platform = require('Platform');\nconst React = require('React');\nconst PropTypes = require('prop-types');\nconst StyleSheet = require('StyleSheet');\nconst View = require('View');\n\nconst deprecatedPropType = require('deprecatedPropType');\nconst requireNativeComponent = require('requireNativeComponent');\nconst RCTModalHostView = requireNativeComponent('RCTModalHostView', null);\nconst ModalEventEmitter = Platform.OS === 'ios' && NativeModules.ModalManager ?\n  new NativeEventEmitter(NativeModules.ModalManager) : null;\n\nimport type EmitterSubscription from 'EmitterSubscription';\n\n/**\n * The Modal component is a simple way to present content above an enclosing view.\n *\n * _Note: If you need more control over how to present modals over the rest of your app,\n * then consider using a top-level Navigator._\n *\n * ```javascript\n * import React, { Component } from 'react';\n * import { Modal, Text, TouchableHighlight, View } from 'react-native';\n *\n * class ModalExample extends Component {\n *\n *   state = {\n *     modalVisible: false,\n *   }\n *\n *   setModalVisible(visible) {\n *     this.setState({modalVisible: visible});\n *   }\n *\n *   render() {\n *     return (\n *       <View style={{marginTop: 22}}>\n *         <Modal\n *           animationType=\"slide\"\n *           transparent={false}\n *           visible={this.state.modalVisible}\n *           onRequestClose={() => {alert(\"Modal has been closed.\")}}\n *           >\n *          <View style={{marginTop: 22}}>\n *           <View>\n *             <Text>Hello World!</Text>\n *\n *             <TouchableHighlight onPress={() => {\n *               this.setModalVisible(!this.state.modalVisible)\n *             }}>\n *               <Text>Hide Modal</Text>\n *             </TouchableHighlight>\n *\n *           </View>\n *          </View>\n *         </Modal>\n *\n *         <TouchableHighlight onPress={() => {\n *           this.setModalVisible(true)\n *         }}>\n *           <Text>Show Modal</Text>\n *         </TouchableHighlight>\n *\n *       </View>\n *     );\n *   }\n * }\n * ```\n */\n\n// In order to route onDismiss callbacks, we need to uniquely identifier each\n// <Modal> on screen. There can be different ones, either nested or as siblings.\n// We cannot pass the onDismiss callback to native as the view will be\n// destroyed before the callback is fired.\nvar uniqueModalIdentifier = 0;\n\nclass Modal extends React.Component<Object> {\n  static propTypes = {\n    /**\n     * The `animationType` prop controls how the modal animates.\n     *\n     * - `slide` slides in from the bottom\n     * - `fade` fades into view\n     * - `none` appears without an animation\n     *\n     * Default is set to `none`.\n     */\n    animationType: PropTypes.oneOf(['none', 'slide', 'fade']),\n    presentationType: PropTypes.oneOf(['window', 'sheet', 'popover']),\n    width: PropTypes.number,\n    height: PropTypes.number,\n    /**\n     * The `presentationStyle` prop controls how the modal appears (generally on larger devices such as iPad or plus-sized iPhones).\n     * See https://developer.apple.com/reference/uikit/uimodalpresentationstyle for details.\n     * @platform ios\n     *\n     * - `fullScreen` covers the screen completely\n     * - `pageSheet` covers portrait-width view centered (only on larger devices)\n     * - `formSheet` covers narrow-width view centered (only on larger devices)\n     * - `overFullScreen` covers the screen completely, but allows transparency\n     *\n     * Default is set to `overFullScreen` or `fullScreen` depending on `transparent` property.\n     */\n    presentationStyle: PropTypes.oneOf(['fullScreen', 'pageSheet', 'formSheet', 'overFullScreen']),\n    /**\n     * The `transparent` prop determines whether your modal will fill the entire view. Setting this to `true` will render the modal over a transparent background.\n     */\n    transparent: PropTypes.bool,\n    /**\n     * The `hardwareAccelerated` prop controls whether to force hardware acceleration for the underlying window.\n     * @platform android\n     */\n    hardwareAccelerated: PropTypes.bool,\n    /**\n     * The `visible` prop determines whether your modal is visible.\n     */\n    visible: PropTypes.bool,\n    /**\n     * The `onRequestClose` callback is called when the user taps the hardware back button on Android or the menu button on Apple TV.\n     */\n    onRequestClose: (Platform.isTVOS || Platform.OS === 'android') ? PropTypes.func.isRequired : PropTypes.func,\n    /**\n     * The `onShow` prop allows passing a function that will be called once the modal has been shown.\n     */\n    onShow: PropTypes.func,\n    /**\n     * The `onDismiss` prop allows passing a function that will be called once the modal has been dismissed.\n     * @platform ios\n     */\n    onDismiss: PropTypes.func,\n    animated: deprecatedPropType(\n      PropTypes.bool,\n      'Use the `animationType` prop instead.'\n    ),\n    /**\n     * The `supportedOrientations` prop allows the modal to be rotated to any of the specified orientations.\n     * On iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field.\n     * When using `presentationStyle` of `pageSheet` or `formSheet`, this property will be ignored by iOS.\n     * @platform ios\n     */\n    supportedOrientations: PropTypes.arrayOf(PropTypes.oneOf(['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right'])),\n    /**\n     * The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed.\n     * The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation.\n     * @platform ios\n     */\n    onOrientationChange: PropTypes.func,\n  };\n\n  static defaultProps = {\n    visible: true,\n    hardwareAccelerated: false,\n  };\n\n  static contextTypes = {\n    rootTag: PropTypes.number,\n  };\n\n  _identifier: number;\n  _eventSubscription: ?EmitterSubscription;\n\n  constructor(props: Object) {\n    super(props);\n    Modal._confirmProps(props);\n    this._identifier = uniqueModalIdentifier++;\n  }\n\n  componentDidMount() {\n    if (ModalEventEmitter) {\n      this._eventSubscription = ModalEventEmitter.addListener(\n        'modalDismissed',\n        event => {\n          if (event.modalID === this._identifier && this.props.onDismiss) {\n            this.props.onDismiss();\n          }\n        },\n      );\n    }\n  }\n\n  componentWillUnmount() {\n    if (this._eventSubscription) {\n      this._eventSubscription.remove();\n    }\n  }\n\n  componentWillReceiveProps(nextProps: Object) {\n    Modal._confirmProps(nextProps);\n  }\n\n  static _confirmProps(props: Object) {\n    if (props.presentationStyle && props.presentationStyle !== 'overFullScreen' && props.transparent) {\n      console.warn(`Modal with '${props.presentationStyle}' presentation style and 'transparent' value is not supported.`);\n    }\n  }\n\n  render(): React.Node {\n    if (this.props.visible === false) {\n      return null;\n    }\n\n    const containerStyles = {\n      backgroundColor: this.props.transparent ? 'transparent' : 'white',\n    };\n\n    let animationType = this.props.animationType;\n    if (!animationType) {\n      // manually setting default prop here to keep support for the deprecated 'animated' prop\n      animationType = 'none';\n      if (this.props.animated) {\n        animationType = 'slide';\n      }\n    }\n\n    let presentationStyle = this.props.presentationStyle;\n    if (!presentationStyle) {\n      presentationStyle = 'fullScreen';\n      if (this.props.transparent) {\n        presentationStyle = 'overFullScreen';\n      }\n    }\n\n    const innerChildren = __DEV__ ?\n      ( <AppContainer rootTag={this.context.rootTag}>\n          {this.props.children}\n        </AppContainer>) :\n      this.props.children;\n\n    return (\n      <RCTModalHostView\n        {...this.props}\n        animationType={animationType}\n        presentationType={this.props.presentationType || 'window'}\n        transparent={this.props.transparent}\n        hardwareAccelerated={this.props.hardwareAccelerated}\n        onRequestClose={this.props.onRequestClose}\n        onShow={this.props.onShow}\n        identifier={this._identifier}\n        style={styles.modal}\n        onStartShouldSetResponder={this._shouldSetResponder}\n        supportedOrientations={this.props.supportedOrientations}\n        onOrientationChange={this.props.onOrientationChange}\n        >\n        <View style={[styles.container, containerStyles]}>\n          {innerChildren}\n        </View>\n      </RCTModalHostView>\n    );\n  }\n\n  // We don't want any responder events bubbling out of the modal.\n  _shouldSetResponder(): boolean {\n    return true;\n  }\n}\n\nconst side = I18nManager.isRTL ? 'right' : 'left';\n\nconst styles = StyleSheet.create({\n  modal: {\n    position: 'absolute',\n  },\n  container: {\n    position: 'absolute',\n    [side] : 0,\n    top: 0,\n  }\n});\n\nmodule.exports = Modal;\n"
  },
  {
    "path": "Libraries/NativeAnimation/Drivers/RCTAnimationDriver.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <CoreGraphics/CoreGraphics.h>\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridgeModule.h>\n\nstatic CGFloat RCTSingleFrameInterval = 1.0 / 60.0;\n\n@class RCTValueAnimatedNode;\n\nNS_ASSUME_NONNULL_BEGIN\n\n@protocol RCTAnimationDriver <NSObject>\n\n@property (nonatomic, readonly) NSNumber *animationId;\n@property (nonatomic, readonly) RCTValueAnimatedNode *valueNode;\n@property (nonatomic, readonly) BOOL animationHasBegun;\n@property (nonatomic, readonly) BOOL animationHasFinished;\n\n- (instancetype)initWithId:(NSNumber *)animationId\n                    config:(NSDictionary *)config\n                   forNode:(RCTValueAnimatedNode *)valueNode\n                  callBack:(nullable RCTResponseSenderBlock)callback;\n\n- (void)startAnimation;\n- (void)stepAnimationWithTime:(NSTimeInterval)currentTime;\n- (void)stopAnimation;\n\nNS_ASSUME_NONNULL_END\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Drivers/RCTDecayAnimation.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAnimationDriver.h\"\n\n@interface RCTDecayAnimation : NSObject<RCTAnimationDriver>\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDecayAnimation.h\"\n\n#import <AppKit/AppKit.h>\n#import <React/RCTConvert.h>\n\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTDecayAnimation ()\n\n@property (nonatomic, strong) NSNumber *animationId;\n@property (nonatomic, strong) RCTValueAnimatedNode *valueNode;\n@property (nonatomic, assign) BOOL animationHasBegun;\n@property (nonatomic, assign) BOOL animationHasFinished;\n\n@end\n\n@implementation RCTDecayAnimation\n{\n  CGFloat _velocity;\n  CGFloat _deceleration;\n  NSTimeInterval _frameStartTime;\n  CGFloat _fromValue;\n  CGFloat _lastValue;\n  NSInteger _iterations;\n  NSInteger _currentLoop;\n  RCTResponseSenderBlock _callback;\n}\n\n- (instancetype)initWithId:(NSNumber *)animationId\n                    config:(NSDictionary *)config\n                   forNode:(RCTValueAnimatedNode *)valueNode\n                  callBack:(nullable RCTResponseSenderBlock)callback;\n{\n  if ((self = [super init])) {\n    NSNumber *iterations = [RCTConvert NSNumber:config[@\"iterations\"]] ?: @1;\n\n    _animationId = animationId;\n    _fromValue = 0;\n    _lastValue = 0;\n    _valueNode = valueNode;\n    _callback = [callback copy];\n    _velocity = [RCTConvert CGFloat:config[@\"velocity\"]];\n    _deceleration = [RCTConvert CGFloat:config[@\"deceleration\"]];\n    _iterations = iterations.integerValue;\n    _currentLoop = 1;\n    _animationHasFinished = iterations.integerValue == 0;\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (void)startAnimation\n{\n  _frameStartTime = -1;\n  _animationHasBegun = YES;\n}\n\n- (void)stopAnimation\n{\n  _valueNode = nil;\n  if (_callback) {\n    _callback(@[@{\n      @\"finished\": @(_animationHasFinished)\n    }]);\n  }\n}\n\n- (void)stepAnimationWithTime:(NSTimeInterval)currentTime\n{\n  if (!_animationHasBegun || _animationHasFinished) {\n    // Animation has not begun or animation has already finished.\n    return;\n  }\n\n  if (_frameStartTime == -1) {\n    // Since this is the first animation step, consider the start to be on the previous frame.\n    _frameStartTime = currentTime - RCTSingleFrameInterval;\n    if (_fromValue == _lastValue) {\n      // First iteration, assign _fromValue based on _valueNode.\n      _fromValue = _valueNode.value;\n    } else {\n      // Not the first iteration, reset _valueNode based on _fromValue.\n      [self updateValue:_fromValue];\n    }\n    _lastValue = _valueNode.value;\n  }\n\n  CGFloat value = _fromValue +\n    (_velocity / (1 - _deceleration)) *\n    (1 - exp(-(1 - _deceleration) * (currentTime - _frameStartTime) * 1000.0));\n\n  [self updateValue:value];\n\n  if (fabs(_lastValue - value) < 0.1) {\n    if (_iterations == -1 || _currentLoop < _iterations) {\n      // Set _frameStartTime to -1 to reset instance variables on the next runAnimationStep.\n      _frameStartTime = -1;\n      _currentLoop++;\n    } else {\n      _animationHasFinished = true;\n      return;\n    }\n  }\n\n  _lastValue = value;\n}\n\n- (void)updateValue:(CGFloat)outputValue\n{\n  _valueNode.value = outputValue;\n  [_valueNode setNeedsUpdate];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Drivers/RCTEventAnimation.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTEventDispatcher.h>\n\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTEventAnimation : NSObject\n\n@property (nonatomic, readonly, weak) RCTValueAnimatedNode *valueNode;\n\n- (instancetype)initWithEventPath:(NSArray<NSString *> *)eventPath\n                        valueNode:(RCTValueAnimatedNode *)valueNode;\n\n- (void)updateWithEvent:(id<RCTEvent>)event;\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Drivers/RCTEventAnimation.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTEventAnimation.h\"\n\n@implementation RCTEventAnimation\n{\n  NSArray<NSString *> *_eventPath;\n}\n\n- (instancetype)initWithEventPath:(NSArray<NSString *> *)eventPath\n                        valueNode:(RCTValueAnimatedNode *)valueNode\n{\n  if ((self = [super init])) {\n    _eventPath = eventPath;\n    _valueNode = valueNode;\n  }\n  return self;\n}\n\n- (void)updateWithEvent:(id<RCTEvent>)event\n{\n  NSArray *args = event.arguments;\n  // Supported events args are in the following order: viewTag, eventName, eventData.\n  id currentValue = args[2];\n  for (NSString *key in _eventPath) {\n    currentValue = [currentValue valueForKey:key];\n  }\n\n  _valueNode.value = ((NSNumber *)currentValue).doubleValue;\n  [_valueNode setNeedsUpdate];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Drivers/RCTFrameAnimation.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAnimationDriver.h\"\n\n@interface RCTFrameAnimation : NSObject<RCTAnimationDriver>\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTFrameAnimation.h\"\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTConvert.h>\n#import <React/RCTDefines.h>\n\n#import \"RCTAnimationUtils.h\"\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTFrameAnimation ()\n\n@property (nonatomic, strong) NSNumber *animationId;\n@property (nonatomic, strong) RCTValueAnimatedNode *valueNode;\n@property (nonatomic, assign) BOOL animationHasBegun;\n@property (nonatomic, assign) BOOL animationHasFinished;\n\n@end\n\n@implementation RCTFrameAnimation\n{\n  NSArray<NSNumber *> *_frames;\n  CGFloat _toValue;\n  CGFloat _fromValue;\n  NSTimeInterval _animationStartTime;\n  NSTimeInterval _animationCurrentTime;\n  RCTResponseSenderBlock _callback;\n  NSInteger _iterations;\n  NSInteger _currentLoop;\n}\n\n- (instancetype)initWithId:(NSNumber *)animationId\n                    config:(NSDictionary *)config\n                   forNode:(RCTValueAnimatedNode *)valueNode\n                  callBack:(nullable RCTResponseSenderBlock)callback;\n{\n  if ((self = [super init])) {\n    NSNumber *toValue = [RCTConvert NSNumber:config[@\"toValue\"]] ?: @1;\n    NSArray<NSNumber *> *frames = [RCTConvert NSNumberArray:config[@\"frames\"]];\n    NSNumber *iterations = [RCTConvert NSNumber:config[@\"iterations\"]] ?: @1;\n\n    _animationId = animationId;\n    _toValue = toValue.floatValue;\n    _fromValue = valueNode.value;\n    _valueNode = valueNode;\n    _frames = [frames copy];\n    _callback = [callback copy];\n    _animationHasFinished = iterations.integerValue == 0;\n    _iterations = iterations.integerValue;\n    _currentLoop = 1;\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (void)startAnimation\n{\n  _animationStartTime = _animationCurrentTime = -1;\n  _animationHasBegun = YES;\n}\n\n- (void)stopAnimation\n{\n  _valueNode = nil;\n  if (_callback) {\n    _callback(@[@{\n      @\"finished\": @(_animationHasFinished)\n    }]);\n  }\n}\n\n- (void)stepAnimationWithTime:(NSTimeInterval)currentTime\n{\n  if (!_animationHasBegun || _animationHasFinished || _frames.count == 0) {\n    // Animation has not begun or animation has already finished.\n    return;\n  }\n\n  if (_animationStartTime == -1) {\n    _animationStartTime = _animationCurrentTime = currentTime;\n  }\n\n  _animationCurrentTime = currentTime;\n  NSTimeInterval currentDuration = _animationCurrentTime - _animationStartTime;\n\n  // Determine how many frames have passed since last update.\n  // Get index of frames that surround the current interval\n  NSUInteger startIndex = floor(currentDuration / RCTSingleFrameInterval);\n  NSUInteger nextIndex = startIndex + 1;\n\n  if (nextIndex >= _frames.count) {\n    if (_iterations == -1 || _currentLoop < _iterations) {\n      // Looping, reset to the first frame value.\n      _animationStartTime = currentTime;\n      _currentLoop++;\n      NSNumber *firstValue = _frames.firstObject;\n      [self updateOutputWithFrameOutput:firstValue.doubleValue];\n    } else {\n      _animationHasFinished = YES;\n      // We are at the end of the animation\n      // Update value and flag animation has ended.\n      NSNumber *finalValue = _frames.lastObject;\n      [self updateOutputWithFrameOutput:finalValue.doubleValue];\n    }\n    return;\n  }\n\n  // Do a linear remap of the two frames to safegaurd against variable framerates\n  NSNumber *fromFrameValue = _frames[startIndex];\n  NSNumber *toFrameValue = _frames[nextIndex];\n  NSTimeInterval fromInterval = startIndex * RCTSingleFrameInterval;\n  NSTimeInterval toInterval = nextIndex * RCTSingleFrameInterval;\n\n  // Interpolate between the individual frames to ensure the animations are\n  //smooth and of the proper duration regardless of the framerate.\n  CGFloat frameOutput = RCTInterpolateValue(currentDuration,\n                                            fromInterval,\n                                            toInterval,\n                                            fromFrameValue.doubleValue,\n                                            toFrameValue.doubleValue,\n                                            EXTRAPOLATE_TYPE_EXTEND,\n                                            EXTRAPOLATE_TYPE_EXTEND);\n\n  [self updateOutputWithFrameOutput:frameOutput];\n}\n\n- (void)updateOutputWithFrameOutput:(CGFloat)frameOutput\n{\n  CGFloat outputValue = RCTInterpolateValue(frameOutput,\n                                            0,\n                                            1,\n                                            _fromValue,\n                                            _toValue,\n                                            EXTRAPOLATE_TYPE_EXTEND,\n                                            EXTRAPOLATE_TYPE_EXTEND);\n\n  _valueNode.value = outputValue;\n  [_valueNode setNeedsUpdate];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Drivers/RCTSpringAnimation.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAnimationDriver.h\"\n\n@interface RCTSpringAnimation : NSObject<RCTAnimationDriver>\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSpringAnimation.h\"\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTConvert.h>\n#import <React/RCTDefines.h>\n\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTSpringAnimation ()\n\n@property (nonatomic, strong) NSNumber *animationId;\n@property (nonatomic, strong) RCTValueAnimatedNode *valueNode;\n@property (nonatomic, assign) BOOL animationHasBegun;\n@property (nonatomic, assign) BOOL animationHasFinished;\n\n@end\n\nconst NSTimeInterval MAX_DELTA_TIME = 0.064;\n\n@implementation RCTSpringAnimation\n{\n  CGFloat _toValue;\n  CGFloat _fromValue;\n  BOOL _overshootClamping;\n  CGFloat _restDisplacementThreshold;\n  CGFloat _restSpeedThreshold;\n  CGFloat _stiffness;\n  CGFloat _damping;\n  CGFloat _mass;\n  CGFloat _initialVelocity;\n  NSTimeInterval _animationStartTime;\n  NSTimeInterval _animationCurrentTime;\n  RCTResponseSenderBlock _callback;\n\n  CGFloat _lastPosition;\n  CGFloat _lastVelocity;\n\n  NSInteger _iterations;\n  NSInteger _currentLoop;\n  \n  NSTimeInterval _t; // Current time (startTime + dt)\n}\n\n- (instancetype)initWithId:(NSNumber *)animationId\n                    config:(NSDictionary *)config\n                   forNode:(RCTValueAnimatedNode *)valueNode\n                  callBack:(nullable RCTResponseSenderBlock)callback\n{\n  if ((self = [super init])) {\n    NSNumber *iterations = [RCTConvert NSNumber:config[@\"iterations\"]] ?: @1;\n\n    _animationId = animationId;\n    _toValue = [RCTConvert CGFloat:config[@\"toValue\"]];\n    _fromValue = valueNode.value;\n    _lastPosition = 0;\n    _valueNode = valueNode;\n    _overshootClamping = [RCTConvert BOOL:config[@\"overshootClamping\"]];\n    _restDisplacementThreshold = [RCTConvert CGFloat:config[@\"restDisplacementThreshold\"]];\n    _restSpeedThreshold = [RCTConvert CGFloat:config[@\"restSpeedThreshold\"]];\n    _stiffness = [RCTConvert CGFloat:config[@\"stiffness\"]];\n    _damping = [RCTConvert CGFloat:config[@\"damping\"]];\n    _mass = [RCTConvert CGFloat:config[@\"mass\"]];\n    _initialVelocity = [RCTConvert CGFloat:config[@\"initialVelocity\"]];\n    \n    _callback = [callback copy];\n\n    _lastPosition = _fromValue;\n    _lastVelocity = _initialVelocity;\n\n    _animationHasFinished = iterations.integerValue == 0;\n    _iterations = iterations.integerValue;\n    _currentLoop = 1;\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (void)startAnimation\n{\n  _animationStartTime = _animationCurrentTime = -1;\n  _animationHasBegun = YES;\n}\n\n- (void)stopAnimation\n{\n  _valueNode = nil;\n  if (_callback) {\n    _callback(@[@{\n      @\"finished\": @(_animationHasFinished)\n    }]);\n  }\n}\n\n- (void)stepAnimationWithTime:(NSTimeInterval)currentTime\n{\n  if (!_animationHasBegun || _animationHasFinished) {\n    // Animation has not begun or animation has already finished.\n    return;\n  }\n  \n  // calculate delta time\n  NSTimeInterval deltaTime;\n  if(_animationStartTime == -1) {\n    _t = 0.0;\n    _animationStartTime = currentTime;\n    deltaTime = 0.0;\n  } else {\n    // Handle frame drops, and only advance dt by a max of MAX_DELTA_TIME\n    deltaTime = MIN(MAX_DELTA_TIME, currentTime - _animationCurrentTime);\n    _t = _t + deltaTime;\n  }\n  \n  // store the timestamp\n  _animationCurrentTime = currentTime;\n  \n  CGFloat c = _damping;\n  CGFloat m = _mass;\n  CGFloat k = _stiffness;\n  CGFloat v0 = -_initialVelocity;\n  \n  CGFloat zeta = c / (2 * sqrtf(k * m));\n  CGFloat omega0 = sqrtf(k / m);\n  CGFloat omega1 = omega0 * sqrtf(1.0 - (zeta * zeta));\n  CGFloat x0 = _toValue - _fromValue;\n  \n  CGFloat position;\n  CGFloat velocity;\n  if (zeta < 1) {\n    // Under damped\n    CGFloat envelope = expf(-zeta * omega0 * _t);\n    position =\n      _toValue -\n      envelope *\n      ((v0 + zeta * omega0 * x0) / omega1 * sinf(omega1 * _t) +\n        x0 * cosf(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        (sinf(omega1 * _t) * (v0 + zeta * omega0 * x0) / omega1 +\n          x0 * cosf(omega1 * _t)) -\n      envelope *\n        (cosf(omega1 * _t) * (v0 + zeta * omega0 * x0) -\n          omega1 * x0 * sinf(omega1 * _t));\n  } else {\n    CGFloat envelope = expf(-omega0 * _t);\n    position = _toValue - envelope * (x0 + (v0 + omega0 * x0) * _t);\n    velocity =\n      envelope * (v0 * (_t * omega0 - 1) + _t * x0 * (omega0 * omega0));\n  }\n  \n  _lastPosition = position;\n  _lastVelocity = velocity;\n  \n  [self onUpdate:position];\n  \n  // Conditions for stopping the spring animation\n  BOOL isOvershooting = NO;\n  if (_overshootClamping && _stiffness != 0) {\n    if (_fromValue < _toValue) {\n      isOvershooting = position > _toValue;\n    } else {\n      isOvershooting = position < _toValue;\n    }\n  }\n  BOOL isVelocity = ABS(velocity) <= _restSpeedThreshold;\n  BOOL isDisplacement = YES;\n  if (_stiffness != 0) {\n    isDisplacement = ABS(_toValue - position) <= _restDisplacementThreshold;\n  }\n  \n  if (isOvershooting || (isVelocity && isDisplacement)) {\n    if (_stiffness != 0) {\n      // Ensure that we end up with a round value\n      if (_animationHasFinished) {\n        return;\n      }\n      [self onUpdate:_toValue];\n    }\n    \n    if (_iterations == -1 || _currentLoop < _iterations) {\n      _lastPosition = _fromValue;\n      _lastVelocity = _initialVelocity;\n      // Set _animationStartTime to -1 to reset instance variables on the next animation step.\n      _animationStartTime = -1;\n      _currentLoop++;\n      [self onUpdate:_fromValue];\n    } else {\n      _animationHasFinished = YES;\n    }\n  }\n}\n\n- (void)onUpdate:(CGFloat)outputValue\n{\n  _valueNode.value = outputValue;\n  [_valueNode setNeedsUpdate];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTAdditionAnimatedNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTAdditionAnimatedNode : RCTValueAnimatedNode\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTAdditionAnimatedNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAdditionAnimatedNode.h\"\n\n@implementation RCTAdditionAnimatedNode\n\n- (void)performUpdate\n{\n  [super performUpdate];\n  NSArray<NSNumber *> *inputNodes = self.config[@\"input\"];\n  if (inputNodes.count > 1) {\n    RCTValueAnimatedNode *parent1 = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:inputNodes[0]];\n    RCTValueAnimatedNode *parent2 = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:inputNodes[1]];\n    if ([parent1 isKindOfClass:[RCTValueAnimatedNode class]] &&\n        [parent2 isKindOfClass:[RCTValueAnimatedNode class]]) {\n      self.value = parent1.value + parent2.value;\n    }\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTAnimatedNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n@interface RCTAnimatedNode : NSObject\n\n- (instancetype)initWithTag:(NSNumber *)tag\n                     config:(NSDictionary<NSString *, id> *)config NS_DESIGNATED_INITIALIZER;\n\n@property (nonatomic, readonly) NSNumber *nodeTag;\n@property (nonatomic, copy, readonly) NSDictionary<NSString *, id> *config;\n\n@property (nonatomic, copy, readonly) NSMapTable<NSNumber *, RCTAnimatedNode *> *childNodes;\n@property (nonatomic, copy, readonly) NSMapTable<NSNumber *, RCTAnimatedNode *> *parentNodes;\n\n@property (nonatomic, readonly) BOOL needsUpdate;\n\n/**\n * Marks a node and its children as needing update.\n */\n- (void)setNeedsUpdate NS_REQUIRES_SUPER;\n\n/**\n * The node will update its value if necesarry and only after its parents have updated.\n */\n- (void)updateNodeIfNecessary NS_REQUIRES_SUPER;\n\n/**\n * Where the actual update code lives. Called internally from updateNodeIfNecessary\n */\n- (void)performUpdate NS_REQUIRES_SUPER;\n\n- (void)addChild:(RCTAnimatedNode *)child NS_REQUIRES_SUPER;\n- (void)removeChild:(RCTAnimatedNode *)child NS_REQUIRES_SUPER;\n\n- (void)onAttachedToNode:(RCTAnimatedNode *)parent NS_REQUIRES_SUPER;\n- (void)onDetachedFromNode:(RCTAnimatedNode *)parent NS_REQUIRES_SUPER;\n\n- (void)detachNode NS_REQUIRES_SUPER;\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTAnimatedNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAnimatedNode.h\"\n\n#import <React/RCTDefines.h>\n\n@implementation RCTAnimatedNode\n{\n  NSMapTable<NSNumber *, RCTAnimatedNode *> *_childNodes;\n  NSMapTable<NSNumber *, RCTAnimatedNode *> *_parentNodes;\n}\n\n- (instancetype)initWithTag:(NSNumber *)tag\n                     config:(NSDictionary<NSString *, id> *)config\n{\n  if ((self = [super init])) {\n    _nodeTag = tag;\n    _config = [config copy];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (NSMapTable<NSNumber *, RCTAnimatedNode *> *)childNodes\n{\n  return _childNodes;\n}\n\n- (NSMapTable<NSNumber *, RCTAnimatedNode *> *)parentNodes\n{\n  return _parentNodes;\n}\n\n- (void)addChild:(RCTAnimatedNode *)child\n{\n  if (!_childNodes) {\n    _childNodes = [NSMapTable strongToWeakObjectsMapTable];\n  }\n  if (child) {\n    [_childNodes setObject:child forKey:child.nodeTag];\n    [child onAttachedToNode:self];\n  }\n}\n\n- (void)removeChild:(RCTAnimatedNode *)child\n{\n  if (!_childNodes) {\n    return;\n  }\n  if (child) {\n    [_childNodes removeObjectForKey:child.nodeTag];\n    [child onDetachedFromNode:self];\n  }\n}\n\n- (void)onAttachedToNode:(RCTAnimatedNode *)parent\n{\n  if (!_parentNodes) {\n    _parentNodes = [NSMapTable strongToWeakObjectsMapTable];\n  }\n  if (parent) {\n    [_parentNodes setObject:parent forKey:parent.nodeTag];\n  }\n}\n\n- (void)onDetachedFromNode:(RCTAnimatedNode *)parent\n{\n  if (!_parentNodes) {\n    return;\n  }\n  if (parent) {\n    [_parentNodes removeObjectForKey:parent.nodeTag];\n  }\n}\n\n- (void)detachNode\n{\n  for (RCTAnimatedNode *parent in _parentNodes.objectEnumerator) {\n    [parent removeChild:self];\n  }\n  for (RCTAnimatedNode *child in _childNodes.objectEnumerator) {\n    [self removeChild:child];\n  }\n}\n\n- (void)setNeedsUpdate\n{\n  _needsUpdate = YES;\n  for (RCTAnimatedNode *child in _childNodes.objectEnumerator) {\n    [child setNeedsUpdate];\n  }\n}\n\n- (void)updateNodeIfNecessary\n{\n  if (_needsUpdate) {\n    for (RCTAnimatedNode *parent in _parentNodes.objectEnumerator) {\n      [parent updateNodeIfNecessary];\n    }\n    [self performUpdate];\n  }\n}\n\n- (void)performUpdate\n{\n  _needsUpdate = NO;\n  // To be overidden by subclasses\n  // This method is called on a node only if it has been marked for update\n  // during the current update loop\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTDiffClampAnimatedNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTDiffClampAnimatedNode : RCTValueAnimatedNode\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTDiffClampAnimatedNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDiffClampAnimatedNode.h\"\n\n#import <React/RCTLog.h>\n\n@implementation RCTDiffClampAnimatedNode\n{\n  NSNumber *_inputNodeTag;\n  CGFloat _min;\n  CGFloat _max;\n  CGFloat _lastValue;\n}\n\n- (instancetype)initWithTag:(NSNumber *)tag\n                     config:(NSDictionary<NSString *, id> *)config\n{\n  if (self = [super initWithTag:tag config:config]) {\n    _inputNodeTag = config[@\"input\"];\n    _min = [config[@\"min\"] floatValue];\n    _max = [config[@\"max\"] floatValue];\n  }\n\n  return self;\n}\n\n- (void)onAttachedToNode:(RCTAnimatedNode *)parent\n{\n  [super onAttachedToNode:parent];\n\n  self.value = _lastValue = [self inputNodeValue];\n}\n\n- (void)performUpdate\n{\n  [super performUpdate];\n\n  CGFloat value = [self inputNodeValue];\n\n  CGFloat diff = value - _lastValue;\n  _lastValue = value;\n  self.value = MIN(MAX(self.value + diff, _min), _max);\n}\n\n- (CGFloat)inputNodeValue\n{\n  RCTValueAnimatedNode *inputNode = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:_inputNodeTag];\n  if (![inputNode isKindOfClass:[RCTValueAnimatedNode class]]) {\n    RCTLogError(@\"Illegal node ID set as an input for Animated.DiffClamp node\");\n    return 0;\n  }\n\n  return inputNode.value;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTDivisionAnimatedNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTDivisionAnimatedNode : RCTValueAnimatedNode\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTDivisionAnimatedNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDivisionAnimatedNode.h\"\n\n#import <React/RCTLog.h>\n\n@implementation RCTDivisionAnimatedNode\n\n- (void)performUpdate\n{\n  [super performUpdate];\n\n  NSArray<NSNumber *> *inputNodes = self.config[@\"input\"];\n  if (inputNodes.count > 1) {\n    RCTValueAnimatedNode *parent1 = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:inputNodes[0]];\n    RCTValueAnimatedNode *parent2 = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:inputNodes[1]];\n    if ([parent1 isKindOfClass:[RCTValueAnimatedNode class]] &&\n        [parent2 isKindOfClass:[RCTValueAnimatedNode class]]) {\n      if (parent2.value == 0) {\n        RCTLogError(@\"Detected a division by zero in Animated.divide node\");\n        return;\n      }\n      self.value = parent1.value / parent2.value;\n    }\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTInterpolationAnimatedNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTInterpolationAnimatedNode : RCTValueAnimatedNode\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTInterpolationAnimatedNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTInterpolationAnimatedNode.h\"\n\n#import \"RCTAnimationUtils.h\"\n\n@implementation RCTInterpolationAnimatedNode\n{\n  __weak RCTValueAnimatedNode *_parentNode;\n  NSArray<NSNumber *> *_inputRange;\n  NSArray<NSNumber *> *_outputRange;\n  NSString *_extrapolateLeft;\n  NSString *_extrapolateRight;\n}\n\n- (instancetype)initWithTag:(NSNumber *)tag\n                     config:(NSDictionary<NSString *, id> *)config\n{\n  if ((self = [super initWithTag:tag config:config])) {\n    _inputRange = [config[@\"inputRange\"] copy];\n    NSMutableArray *outputRange = [NSMutableArray array];\n    for (id value in config[@\"outputRange\"]) {\n      if ([value isKindOfClass:[NSNumber class]]) {\n        [outputRange addObject:value];\n      }\n    }\n    _outputRange = [outputRange copy];\n    _extrapolateLeft = config[@\"extrapolateLeft\"];\n    _extrapolateRight = config[@\"extrapolateRight\"];\n  }\n  return self;\n}\n\n- (void)onAttachedToNode:(RCTAnimatedNode *)parent\n{\n  [super onAttachedToNode:parent];\n  if ([parent isKindOfClass:[RCTValueAnimatedNode class]]) {\n    _parentNode = (RCTValueAnimatedNode *)parent;\n  }\n}\n\n- (void)onDetachedFromNode:(RCTAnimatedNode *)parent\n{\n  [super onDetachedFromNode:parent];\n  if (_parentNode == parent) {\n    _parentNode = nil;\n  }\n}\n\n- (void)performUpdate\n{\n  [super performUpdate];\n  if (!_parentNode) {\n    return;\n  }\n\n  CGFloat inputValue = _parentNode.value;\n\n  self.value = RCTInterpolateValueInRange(inputValue,\n                                          _inputRange,\n                                          _outputRange,\n                                          _extrapolateLeft,\n                                          _extrapolateRight);\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTModuloAnimatedNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTModuloAnimatedNode : RCTValueAnimatedNode\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTModuloAnimatedNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTModuloAnimatedNode.h\"\n\n@implementation RCTModuloAnimatedNode\n\n- (void)performUpdate\n{\n  [super performUpdate];\n  NSNumber *inputNode = self.config[@\"input\"];\n  NSNumber *modulus = self.config[@\"modulus\"];\n  RCTValueAnimatedNode *parent = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:inputNode];\n  self.value = fmodf(parent.value, modulus.floatValue);\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTMultiplicationAnimatedNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTMultiplicationAnimatedNode : RCTValueAnimatedNode\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTMultiplicationAnimatedNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTMultiplicationAnimatedNode.h\"\n\n@implementation RCTMultiplicationAnimatedNode\n\n- (void)performUpdate\n{\n  [super performUpdate];\n\n  NSArray<NSNumber *> *inputNodes = self.config[@\"input\"];\n  if (inputNodes.count > 1) {\n    RCTValueAnimatedNode *parent1 = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:inputNodes[0]];\n    RCTValueAnimatedNode *parent2 = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:inputNodes[1]];\n    if ([parent1 isKindOfClass:[RCTValueAnimatedNode class]] &&\n        [parent2 isKindOfClass:[RCTValueAnimatedNode class]]) {\n      self.value = parent1.value * parent2.value;\n    }\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAnimatedNode.h\"\n\n@class RCTUIManager;\n@class RCTViewPropertyMapper;\n\n@interface RCTPropsAnimatedNode : RCTAnimatedNode\n\n- (void)connectToView:(NSNumber *)viewTag\n             viewName:(NSString *)viewName\n            uiManager:(RCTUIManager *)uiManager;\n\n- (void)disconnectFromView:(NSNumber *)viewTag;\n\n- (void)restoreDefaultValues;\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTPropsAnimatedNode.h\"\n\n#import <React/RCTLog.h>\n#import <React/RCTUIManager.h>\n\n#import \"RCTAnimationUtils.h\"\n#import \"RCTStyleAnimatedNode.h\"\n#import \"RCTValueAnimatedNode.h\"\n\n@implementation RCTPropsAnimatedNode\n{\n  NSNumber *_connectedViewTag;\n  NSString *_connectedViewName;\n  __weak RCTUIManager *_uiManager;\n  NSMutableDictionary<NSString *, NSObject *> *_propsDictionary;\n}\n\n- (instancetype)initWithTag:(NSNumber *)tag\n                     config:(NSDictionary<NSString *, id> *)config;\n{\n  if (self = [super initWithTag:tag config:config]) {\n    _propsDictionary = [NSMutableDictionary new];\n  }\n  return self;\n}\n\n- (void)connectToView:(NSNumber *)viewTag\n             viewName:(NSString *)viewName\n            uiManager:(RCTUIManager *)uiManager\n{\n  _connectedViewTag = viewTag;\n  _connectedViewName = viewName;\n  _uiManager = uiManager;\n}\n\n- (void)disconnectFromView:(NSNumber *)viewTag\n{\n  _connectedViewTag = nil;\n  _connectedViewName = nil;\n  _uiManager = nil;\n}\n\n- (void)restoreDefaultValues\n{\n  // Restore the default value for all props that were modified by this node.\n  for (NSString *key in _propsDictionary.allKeys) {\n    _propsDictionary[key] = [NSNull null];\n  }\n\n  if (_propsDictionary.count) {\n    [_uiManager synchronouslyUpdateViewOnUIThread:_connectedViewTag\n                                         viewName:_connectedViewName\n                                            props:_propsDictionary];\n  }\n}\n\n- (NSString *)propertyNameForParentTag:(NSNumber *)parentTag\n{\n  __block NSString *propertyName;\n  [self.config[@\"props\"] enumerateKeysAndObjectsUsingBlock:^(NSString *_Nonnull property, NSNumber *_Nonnull tag, BOOL *_Nonnull stop) {\n    if ([tag isEqualToNumber:parentTag]) {\n      propertyName = property;\n      *stop = YES;\n    }\n  }];\n  return propertyName;\n}\n\n- (void)performUpdate\n{\n  [super performUpdate];\n\n  // Since we are updating nodes after detaching them from views there is a time where it's\n  // possible that the view was disconnected and still receive an update, this is normal and we can\n  // simply skip that update.\n  if (!_connectedViewTag) {\n    return;\n  }\n  \n  for (NSNumber *parentTag in self.parentNodes.keyEnumerator) {\n    RCTAnimatedNode *parentNode = [self.parentNodes objectForKey:parentTag];\n    if ([parentNode isKindOfClass:[RCTStyleAnimatedNode class]]) {\n      [self->_propsDictionary addEntriesFromDictionary:[(RCTStyleAnimatedNode *)parentNode propsDictionary]];\n      \n    } else if ([parentNode isKindOfClass:[RCTValueAnimatedNode class]]) {\n      NSString *property = [self propertyNameForParentTag:parentTag];\n      CGFloat value = [(RCTValueAnimatedNode *)parentNode value];\n      self->_propsDictionary[property] = @(value);\n    }\n  }\n\n  if (_propsDictionary.count) {\n    [_uiManager synchronouslyUpdateViewOnUIThread:_connectedViewTag\n                                         viewName:_connectedViewName\n                                            props:_propsDictionary];\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAnimatedNode.h\"\n\n@interface RCTStyleAnimatedNode : RCTAnimatedNode\n\n- (NSDictionary<NSString *, NSObject *> *)propsDictionary;\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTStyleAnimatedNode.h\"\n#import \"RCTAnimationUtils.h\"\n#import \"RCTValueAnimatedNode.h\"\n#import \"RCTTransformAnimatedNode.h\"\n\n@implementation RCTStyleAnimatedNode\n{\n  NSMutableDictionary<NSString *, NSObject *> *_propsDictionary;\n}\n\n- (instancetype)initWithTag:(NSNumber *)tag\n                     config:(NSDictionary<NSString *, id> *)config;\n{\n  if ((self = [super initWithTag:tag config:config])) {\n    _propsDictionary = [NSMutableDictionary new];\n  }\n  return self;\n}\n\n- (NSDictionary *)propsDictionary\n{\n  return _propsDictionary;\n}\n\n- (void)performUpdate\n{\n  [super performUpdate];\n\n  NSDictionary<NSString *, NSNumber *> *style = self.config[@\"style\"];\n  [style enumerateKeysAndObjectsUsingBlock:^(NSString *property, NSNumber *nodeTag, __unused BOOL *stop) {\n    RCTAnimatedNode *node = [self.parentNodes objectForKey:nodeTag];\n    if (node) {\n      if ([node isKindOfClass:[RCTValueAnimatedNode class]]) {\n        RCTValueAnimatedNode *parentNode = (RCTValueAnimatedNode *)node;\n        [self->_propsDictionary setObject:@(parentNode.value) forKey:property];\n      } else if ([node isKindOfClass:[RCTTransformAnimatedNode class]]) {\n        RCTTransformAnimatedNode *parentNode = (RCTTransformAnimatedNode *)node;\n        [self->_propsDictionary addEntriesFromDictionary:parentNode.propsDictionary];\n      }\n    }\n  }];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTTransformAnimatedNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAnimatedNode.h\"\n\n@interface RCTTransformAnimatedNode : RCTAnimatedNode\n\n- (NSDictionary<NSString *, NSObject *> *)propsDictionary;\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTTransformAnimatedNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTransformAnimatedNode.h\"\n#import \"RCTValueAnimatedNode.h\"\n\n@implementation RCTTransformAnimatedNode\n{\n  NSMutableDictionary<NSString *, NSObject *> *_propsDictionary;\n}\n\n- (instancetype)initWithTag:(NSNumber *)tag\n                     config:(NSDictionary<NSString *, id> *)config;\n{\n  if ((self = [super initWithTag:tag config:config])) {\n    _propsDictionary = [NSMutableDictionary new];\n  }\n  return self;\n}\n\n- (NSDictionary *)propsDictionary\n{\n  return _propsDictionary;\n}\n\n- (void)performUpdate\n{\n  [super performUpdate];\n\n  NSArray<NSDictionary *> *transformConfigs = self.config[@\"transforms\"];\n  NSMutableArray<NSDictionary *> *transform = [NSMutableArray arrayWithCapacity:transformConfigs.count];\n  for (NSDictionary *transformConfig in transformConfigs) {\n    NSString *type = transformConfig[@\"type\"];\n    NSString *property = transformConfig[@\"property\"];\n    NSNumber *value;\n    if ([type isEqualToString: @\"animated\"]) {\n      NSNumber *nodeTag = transformConfig[@\"nodeTag\"];\n      RCTAnimatedNode *node = [self.parentNodes objectForKey:nodeTag];\n      if (![node isKindOfClass:[RCTValueAnimatedNode class]]) {\n        continue;\n      }\n      RCTValueAnimatedNode *parentNode = (RCTValueAnimatedNode *)node;\n      value = @(parentNode.value);\n    } else {\n      value = transformConfig[@\"value\"];\n    }\n    [transform addObject:@{property: value}];\n  }\n\n  _propsDictionary[@\"transform\"] = transform;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTValueAnimatedNode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTAnimatedNode.h\"\n\n@class RCTValueAnimatedNode;\n\n@protocol RCTValueAnimatedNodeObserver <NSObject>\n\n- (void)animatedNode:(RCTValueAnimatedNode *)node didUpdateValue:(CGFloat)value;\n\n@end\n\n@interface RCTValueAnimatedNode : RCTAnimatedNode\n\n- (void)setOffset:(CGFloat)offset;\n- (void)flattenOffset;\n- (void)extractOffset;\n\n@property (nonatomic, assign) CGFloat value;\n@property (nonatomic, weak) id<RCTValueAnimatedNodeObserver> valueObserver;\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/Nodes/RCTValueAnimatedNode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTValueAnimatedNode ()\n\n@property (nonatomic, assign) CGFloat offset;\n\n@end\n\n@implementation RCTValueAnimatedNode\n\n@synthesize value = _value;\n\n- (instancetype)initWithTag:(NSNumber *)tag\n                     config:(NSDictionary<NSString *, id> *)config\n{\n  if (self = [super initWithTag:tag config:config]) {\n    _offset = [self.config[@\"offset\"] floatValue];\n    _value = [self.config[@\"value\"] floatValue];\n  }\n  return self;\n}\n\n- (void)flattenOffset\n{\n  _value += _offset;\n  _offset = 0;\n}\n\n- (void)extractOffset\n{\n  _offset += _value;\n  _value = 0;\n}\n\n- (CGFloat)value\n{\n  return _value + _offset;\n}\n\n- (void)setValue:(CGFloat)value\n{\n  _value = value;\n\n  if (_valueObserver) {\n    [_valueObserver animatedNode:self didUpdateValue:_value];\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/RCTAnimation.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t13E501CC1D07A644005F35D8 /* RCTAnimationUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501B81D07A644005F35D8 /* RCTAnimationUtils.m */; };\n\t\t13E501CF1D07A644005F35D8 /* RCTNativeAnimatedModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501BE1D07A644005F35D8 /* RCTNativeAnimatedModule.m */; };\n\t\t13E501E81D07A6C9005F35D8 /* RCTAdditionAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501D71D07A6C9005F35D8 /* RCTAdditionAnimatedNode.m */; };\n\t\t13E501E91D07A6C9005F35D8 /* RCTAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501D91D07A6C9005F35D8 /* RCTAnimatedNode.m */; };\n\t\t13E501EB1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501DD1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.m */; };\n\t\t13E501EC1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501DF1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.m */; };\n\t\t13E501ED1D07A6C9005F35D8 /* RCTPropsAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E11D07A6C9005F35D8 /* RCTPropsAnimatedNode.m */; };\n\t\t13E501EE1D07A6C9005F35D8 /* RCTStyleAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E31D07A6C9005F35D8 /* RCTStyleAnimatedNode.m */; };\n\t\t13E501EF1D07A6C9005F35D8 /* RCTTransformAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E51D07A6C9005F35D8 /* RCTTransformAnimatedNode.m */; };\n\t\t13E501F01D07A6C9005F35D8 /* RCTValueAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E71D07A6C9005F35D8 /* RCTValueAnimatedNode.m */; };\n\t\t192F69811E823F4A008692C7 /* RCTAnimationUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501B71D07A644005F35D8 /* RCTAnimationUtils.h */; };\n\t\t192F69821E823F4A008692C7 /* RCTNativeAnimatedModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501BD1D07A644005F35D8 /* RCTNativeAnimatedModule.h */; };\n\t\t192F69831E823F4A008692C7 /* RCTNativeAnimatedNodesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 94DA09161DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.h */; };\n\t\t192F69841E823F4A008692C7 /* RCTAnimationDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 94C1294A1D4069170025F25C /* RCTAnimationDriver.h */; };\n\t\t192F69851E823F4A008692C7 /* RCTEventAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 19F00F201DC8847500113FEE /* RCTEventAnimation.h */; };\n\t\t192F69861E823F4A008692C7 /* RCTFrameAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 94C1294C1D4069170025F25C /* RCTFrameAnimation.h */; };\n\t\t192F69871E823F4A008692C7 /* RCTSpringAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 94C1294E1D4069170025F25C /* RCTSpringAnimation.h */; };\n\t\t192F69881E823F4A008692C7 /* RCTDivisionAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9894931D999639008027DB /* RCTDivisionAnimatedNode.h */; };\n\t\t192F69891E823F4A008692C7 /* RCTDiffClampAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 193F64F21D776EC6004D1CAA /* RCTDiffClampAnimatedNode.h */; };\n\t\t192F698A1E823F4A008692C7 /* RCTAdditionAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501D61D07A6C9005F35D8 /* RCTAdditionAnimatedNode.h */; };\n\t\t192F698B1E823F4A008692C7 /* RCTAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501D81D07A6C9005F35D8 /* RCTAnimatedNode.h */; };\n\t\t192F698C1E823F4A008692C7 /* RCTInterpolationAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501DC1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.h */; };\n\t\t192F698D1E823F4A008692C7 /* RCTModuloAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 94DAE3F71D7334A70059942F /* RCTModuloAnimatedNode.h */; };\n\t\t192F698E1E823F4A008692C7 /* RCTMultiplicationAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501DE1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.h */; };\n\t\t192F698F1E823F4A008692C7 /* RCTPropsAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501E01D07A6C9005F35D8 /* RCTPropsAnimatedNode.h */; };\n\t\t192F69901E823F4A008692C7 /* RCTStyleAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501E21D07A6C9005F35D8 /* RCTStyleAnimatedNode.h */; };\n\t\t192F69911E823F4A008692C7 /* RCTTransformAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501E41D07A6C9005F35D8 /* RCTTransformAnimatedNode.h */; };\n\t\t192F69921E823F4A008692C7 /* RCTValueAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501E61D07A6C9005F35D8 /* RCTValueAnimatedNode.h */; };\n\t\t192F69941E823F78008692C7 /* RCTAnimationUtils.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501B71D07A644005F35D8 /* RCTAnimationUtils.h */; };\n\t\t192F69951E823F78008692C7 /* RCTNativeAnimatedModule.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501BD1D07A644005F35D8 /* RCTNativeAnimatedModule.h */; };\n\t\t192F69961E823F78008692C7 /* RCTNativeAnimatedNodesManager.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 94DA09161DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.h */; };\n\t\t192F69971E823F78008692C7 /* RCTAnimationDriver.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 94C1294A1D4069170025F25C /* RCTAnimationDriver.h */; };\n\t\t192F69981E823F78008692C7 /* RCTEventAnimation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 19F00F201DC8847500113FEE /* RCTEventAnimation.h */; };\n\t\t192F69991E823F78008692C7 /* RCTFrameAnimation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 94C1294C1D4069170025F25C /* RCTFrameAnimation.h */; };\n\t\t192F699A1E823F78008692C7 /* RCTSpringAnimation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 94C1294E1D4069170025F25C /* RCTSpringAnimation.h */; };\n\t\t192F699B1E823F78008692C7 /* RCTDivisionAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5C9894931D999639008027DB /* RCTDivisionAnimatedNode.h */; };\n\t\t192F699C1E823F78008692C7 /* RCTDiffClampAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 193F64F21D776EC6004D1CAA /* RCTDiffClampAnimatedNode.h */; };\n\t\t192F699D1E823F78008692C7 /* RCTAdditionAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501D61D07A6C9005F35D8 /* RCTAdditionAnimatedNode.h */; };\n\t\t192F699E1E823F78008692C7 /* RCTAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501D81D07A6C9005F35D8 /* RCTAnimatedNode.h */; };\n\t\t192F699F1E823F78008692C7 /* RCTInterpolationAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501DC1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.h */; };\n\t\t192F69A01E823F78008692C7 /* RCTModuloAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 94DAE3F71D7334A70059942F /* RCTModuloAnimatedNode.h */; };\n\t\t192F69A11E823F78008692C7 /* RCTMultiplicationAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501DE1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.h */; };\n\t\t192F69A21E823F78008692C7 /* RCTPropsAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501E01D07A6C9005F35D8 /* RCTPropsAnimatedNode.h */; };\n\t\t192F69A31E823F78008692C7 /* RCTStyleAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501E21D07A6C9005F35D8 /* RCTStyleAnimatedNode.h */; };\n\t\t192F69A41E823F78008692C7 /* RCTTransformAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501E41D07A6C9005F35D8 /* RCTTransformAnimatedNode.h */; };\n\t\t192F69A51E823F78008692C7 /* RCTValueAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501E61D07A6C9005F35D8 /* RCTValueAnimatedNode.h */; };\n\t\t193F64F41D776EC6004D1CAA /* RCTDiffClampAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 193F64F31D776EC6004D1CAA /* RCTDiffClampAnimatedNode.m */; };\n\t\t194804ED1E975D8E00623005 /* RCTDecayAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 194804EB1E975D8E00623005 /* RCTDecayAnimation.h */; };\n\t\t194804EE1E975D8E00623005 /* RCTDecayAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 194804EC1E975D8E00623005 /* RCTDecayAnimation.m */; };\n\t\t194804EF1E975DB500623005 /* RCTDecayAnimation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 194804EB1E975D8E00623005 /* RCTDecayAnimation.h */; };\n\t\t194804F01E975DCF00623005 /* RCTDecayAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 194804EB1E975D8E00623005 /* RCTDecayAnimation.h */; };\n\t\t194804F11E975DD700623005 /* RCTDecayAnimation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 194804EB1E975D8E00623005 /* RCTDecayAnimation.h */; };\n\t\t194804F21E977DDB00623005 /* RCTDecayAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 194804EC1E975D8E00623005 /* RCTDecayAnimation.m */; };\n\t\t1980B70E1E80D1C4004DC789 /* RCTAnimationUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501B71D07A644005F35D8 /* RCTAnimationUtils.h */; };\n\t\t1980B7101E80D1C4004DC789 /* RCTNativeAnimatedModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501BD1D07A644005F35D8 /* RCTNativeAnimatedModule.h */; };\n\t\t1980B7121E80D1C4004DC789 /* RCTNativeAnimatedNodesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 94DA09161DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.h */; };\n\t\t1980B7141E80D1C4004DC789 /* RCTAnimationDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 94C1294A1D4069170025F25C /* RCTAnimationDriver.h */; };\n\t\t1980B7151E80D1C4004DC789 /* RCTEventAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 19F00F201DC8847500113FEE /* RCTEventAnimation.h */; };\n\t\t1980B7171E80D1C4004DC789 /* RCTFrameAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 94C1294C1D4069170025F25C /* RCTFrameAnimation.h */; };\n\t\t1980B7191E80D1C4004DC789 /* RCTSpringAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 94C1294E1D4069170025F25C /* RCTSpringAnimation.h */; };\n\t\t1980B71B1E80D1C4004DC789 /* RCTDivisionAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9894931D999639008027DB /* RCTDivisionAnimatedNode.h */; };\n\t\t1980B71D1E80D1C4004DC789 /* RCTDiffClampAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 193F64F21D776EC6004D1CAA /* RCTDiffClampAnimatedNode.h */; };\n\t\t1980B71F1E80D1C4004DC789 /* RCTAdditionAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501D61D07A6C9005F35D8 /* RCTAdditionAnimatedNode.h */; };\n\t\t1980B7211E80D1C4004DC789 /* RCTAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501D81D07A6C9005F35D8 /* RCTAnimatedNode.h */; };\n\t\t1980B7231E80D1C4004DC789 /* RCTInterpolationAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501DC1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.h */; };\n\t\t1980B7251E80D1C4004DC789 /* RCTModuloAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 94DAE3F71D7334A70059942F /* RCTModuloAnimatedNode.h */; };\n\t\t1980B7271E80D1C4004DC789 /* RCTMultiplicationAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501DE1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.h */; };\n\t\t1980B7291E80D1C4004DC789 /* RCTPropsAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501E01D07A6C9005F35D8 /* RCTPropsAnimatedNode.h */; };\n\t\t1980B72B1E80D1C4004DC789 /* RCTStyleAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501E21D07A6C9005F35D8 /* RCTStyleAnimatedNode.h */; };\n\t\t1980B72D1E80D1C4004DC789 /* RCTTransformAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501E41D07A6C9005F35D8 /* RCTTransformAnimatedNode.h */; };\n\t\t1980B72F1E80D1C4004DC789 /* RCTValueAnimatedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E501E61D07A6C9005F35D8 /* RCTValueAnimatedNode.h */; };\n\t\t1980B7321E80D259004DC789 /* RCTAnimationUtils.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501B71D07A644005F35D8 /* RCTAnimationUtils.h */; };\n\t\t1980B7351E80DD6F004DC789 /* RCTNativeAnimatedModule.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501BD1D07A644005F35D8 /* RCTNativeAnimatedModule.h */; };\n\t\t1980B7361E80DD6F004DC789 /* RCTNativeAnimatedNodesManager.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 94DA09161DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.h */; };\n\t\t1980B7371E80DD6F004DC789 /* RCTAnimationDriver.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 94C1294A1D4069170025F25C /* RCTAnimationDriver.h */; };\n\t\t1980B7381E80DD6F004DC789 /* RCTEventAnimation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 19F00F201DC8847500113FEE /* RCTEventAnimation.h */; };\n\t\t1980B7391E80DD6F004DC789 /* RCTFrameAnimation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 94C1294C1D4069170025F25C /* RCTFrameAnimation.h */; };\n\t\t1980B73A1E80DD6F004DC789 /* RCTSpringAnimation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 94C1294E1D4069170025F25C /* RCTSpringAnimation.h */; };\n\t\t1980B73B1E80DD6F004DC789 /* RCTDivisionAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5C9894931D999639008027DB /* RCTDivisionAnimatedNode.h */; };\n\t\t1980B73C1E80DD6F004DC789 /* RCTDiffClampAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 193F64F21D776EC6004D1CAA /* RCTDiffClampAnimatedNode.h */; };\n\t\t1980B73D1E80DD6F004DC789 /* RCTAdditionAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501D61D07A6C9005F35D8 /* RCTAdditionAnimatedNode.h */; };\n\t\t1980B73E1E80DD6F004DC789 /* RCTAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501D81D07A6C9005F35D8 /* RCTAnimatedNode.h */; };\n\t\t1980B73F1E80DD6F004DC789 /* RCTInterpolationAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501DC1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.h */; };\n\t\t1980B7401E80DD6F004DC789 /* RCTModuloAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 94DAE3F71D7334A70059942F /* RCTModuloAnimatedNode.h */; };\n\t\t1980B7411E80DD6F004DC789 /* RCTMultiplicationAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501DE1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.h */; };\n\t\t1980B7421E80DD6F004DC789 /* RCTPropsAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501E01D07A6C9005F35D8 /* RCTPropsAnimatedNode.h */; };\n\t\t1980B7431E80DD6F004DC789 /* RCTStyleAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501E21D07A6C9005F35D8 /* RCTStyleAnimatedNode.h */; };\n\t\t1980B7441E80DD6F004DC789 /* RCTTransformAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501E41D07A6C9005F35D8 /* RCTTransformAnimatedNode.h */; };\n\t\t1980B7451E80DD6F004DC789 /* RCTValueAnimatedNode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 13E501E61D07A6C9005F35D8 /* RCTValueAnimatedNode.h */; };\n\t\t19F00F221DC8847500113FEE /* RCTEventAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 19F00F211DC8847500113FEE /* RCTEventAnimation.m */; };\n\t\t19F00F231DC8848E00113FEE /* RCTEventAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 19F00F211DC8847500113FEE /* RCTEventAnimation.m */; };\n\t\t2D3B5EF21D9B0B3100451313 /* RCTAnimationUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501B81D07A644005F35D8 /* RCTAnimationUtils.m */; };\n\t\t2D3B5EF41D9B0B3700451313 /* RCTNativeAnimatedModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501BE1D07A644005F35D8 /* RCTNativeAnimatedModule.m */; };\n\t\t2D3B5EF51D9B0B4800451313 /* RCTDivisionAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C9894941D999639008027DB /* RCTDivisionAnimatedNode.m */; };\n\t\t2D3B5EF61D9B0B4800451313 /* RCTDiffClampAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 193F64F31D776EC6004D1CAA /* RCTDiffClampAnimatedNode.m */; };\n\t\t2D3B5EF71D9B0B4800451313 /* RCTAdditionAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501D71D07A6C9005F35D8 /* RCTAdditionAnimatedNode.m */; };\n\t\t2D3B5EF81D9B0B4800451313 /* RCTAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501D91D07A6C9005F35D8 /* RCTAnimatedNode.m */; };\n\t\t2D3B5EFA1D9B0B4800451313 /* RCTInterpolationAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501DD1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.m */; };\n\t\t2D3B5EFB1D9B0B4800451313 /* RCTModuloAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 94DAE3F81D7334A70059942F /* RCTModuloAnimatedNode.m */; };\n\t\t2D3B5EFC1D9B0B4800451313 /* RCTMultiplicationAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501DF1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.m */; };\n\t\t2D3B5EFD1D9B0B4800451313 /* RCTPropsAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E11D07A6C9005F35D8 /* RCTPropsAnimatedNode.m */; };\n\t\t2D3B5EFE1D9B0B4800451313 /* RCTStyleAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E31D07A6C9005F35D8 /* RCTStyleAnimatedNode.m */; };\n\t\t2D3B5EFF1D9B0B4800451313 /* RCTTransformAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E51D07A6C9005F35D8 /* RCTTransformAnimatedNode.m */; };\n\t\t2D3B5F001D9B0B4800451313 /* RCTValueAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E71D07A6C9005F35D8 /* RCTValueAnimatedNode.m */; };\n\t\t5C9894951D999639008027DB /* RCTDivisionAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C9894941D999639008027DB /* RCTDivisionAnimatedNode.m */; };\n\t\t944244D01DB962DA0032A02B /* RCTFrameAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 94C1294D1D4069170025F25C /* RCTFrameAnimation.m */; };\n\t\t944244D11DB962DC0032A02B /* RCTSpringAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 94C1294F1D4069170025F25C /* RCTSpringAnimation.m */; };\n\t\t9476E8EC1DC9232D005D5CD1 /* RCTNativeAnimatedNodesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 94DA09171DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.m */; };\n\t\t94C129511D40692B0025F25C /* RCTFrameAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 94C1294D1D4069170025F25C /* RCTFrameAnimation.m */; };\n\t\t94C129521D40692B0025F25C /* RCTSpringAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 94C1294F1D4069170025F25C /* RCTSpringAnimation.m */; };\n\t\t94DA09181DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 94DA09171DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.m */; };\n\t\t94DAE3F91D7334A70059942F /* RCTModuloAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 94DAE3F81D7334A70059942F /* RCTModuloAnimatedNode.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t192F69931E823F4F008692C7 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/RCTAnimation;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t194804F11E975DD700623005 /* RCTDecayAnimation.h in CopyFiles */,\n\t\t\t\t192F69941E823F78008692C7 /* RCTAnimationUtils.h in CopyFiles */,\n\t\t\t\t192F69951E823F78008692C7 /* RCTNativeAnimatedModule.h in CopyFiles */,\n\t\t\t\t192F69961E823F78008692C7 /* RCTNativeAnimatedNodesManager.h in CopyFiles */,\n\t\t\t\t192F69971E823F78008692C7 /* RCTAnimationDriver.h in CopyFiles */,\n\t\t\t\t192F69981E823F78008692C7 /* RCTEventAnimation.h in CopyFiles */,\n\t\t\t\t192F69991E823F78008692C7 /* RCTFrameAnimation.h in CopyFiles */,\n\t\t\t\t192F699A1E823F78008692C7 /* RCTSpringAnimation.h in CopyFiles */,\n\t\t\t\t192F699B1E823F78008692C7 /* RCTDivisionAnimatedNode.h in CopyFiles */,\n\t\t\t\t192F699C1E823F78008692C7 /* RCTDiffClampAnimatedNode.h in CopyFiles */,\n\t\t\t\t192F699D1E823F78008692C7 /* RCTAdditionAnimatedNode.h in CopyFiles */,\n\t\t\t\t192F699E1E823F78008692C7 /* RCTAnimatedNode.h in CopyFiles */,\n\t\t\t\t192F699F1E823F78008692C7 /* RCTInterpolationAnimatedNode.h in CopyFiles */,\n\t\t\t\t192F69A01E823F78008692C7 /* RCTModuloAnimatedNode.h in CopyFiles */,\n\t\t\t\t192F69A11E823F78008692C7 /* RCTMultiplicationAnimatedNode.h in CopyFiles */,\n\t\t\t\t192F69A21E823F78008692C7 /* RCTPropsAnimatedNode.h in CopyFiles */,\n\t\t\t\t192F69A31E823F78008692C7 /* RCTStyleAnimatedNode.h in CopyFiles */,\n\t\t\t\t192F69A41E823F78008692C7 /* RCTTransformAnimatedNode.h in CopyFiles */,\n\t\t\t\t192F69A51E823F78008692C7 /* RCTValueAnimatedNode.h in CopyFiles */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1980B7311E80D21C004DC789 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/RCTAnimation;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t194804EF1E975DB500623005 /* RCTDecayAnimation.h in CopyFiles */,\n\t\t\t\t1980B7351E80DD6F004DC789 /* RCTNativeAnimatedModule.h in CopyFiles */,\n\t\t\t\t1980B7361E80DD6F004DC789 /* RCTNativeAnimatedNodesManager.h in CopyFiles */,\n\t\t\t\t1980B7371E80DD6F004DC789 /* RCTAnimationDriver.h in CopyFiles */,\n\t\t\t\t1980B7381E80DD6F004DC789 /* RCTEventAnimation.h in CopyFiles */,\n\t\t\t\t1980B7391E80DD6F004DC789 /* RCTFrameAnimation.h in CopyFiles */,\n\t\t\t\t1980B73A1E80DD6F004DC789 /* RCTSpringAnimation.h in CopyFiles */,\n\t\t\t\t1980B73B1E80DD6F004DC789 /* RCTDivisionAnimatedNode.h in CopyFiles */,\n\t\t\t\t1980B73C1E80DD6F004DC789 /* RCTDiffClampAnimatedNode.h in CopyFiles */,\n\t\t\t\t1980B73D1E80DD6F004DC789 /* RCTAdditionAnimatedNode.h in CopyFiles */,\n\t\t\t\t1980B73E1E80DD6F004DC789 /* RCTAnimatedNode.h in CopyFiles */,\n\t\t\t\t1980B73F1E80DD6F004DC789 /* RCTInterpolationAnimatedNode.h in CopyFiles */,\n\t\t\t\t1980B7401E80DD6F004DC789 /* RCTModuloAnimatedNode.h in CopyFiles */,\n\t\t\t\t1980B7411E80DD6F004DC789 /* RCTMultiplicationAnimatedNode.h in CopyFiles */,\n\t\t\t\t1980B7421E80DD6F004DC789 /* RCTPropsAnimatedNode.h in CopyFiles */,\n\t\t\t\t1980B7431E80DD6F004DC789 /* RCTStyleAnimatedNode.h in CopyFiles */,\n\t\t\t\t1980B7441E80DD6F004DC789 /* RCTTransformAnimatedNode.h in CopyFiles */,\n\t\t\t\t1980B7451E80DD6F004DC789 /* RCTValueAnimatedNode.h in CopyFiles */,\n\t\t\t\t1980B7321E80D259004DC789 /* RCTAnimationUtils.h in CopyFiles */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t134814201AA4EA6300B7C361 /* libRCTAnimation.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTAnimation.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13E501B71D07A644005F35D8 /* RCTAnimationUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTAnimationUtils.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13E501B81D07A644005F35D8 /* RCTAnimationUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAnimationUtils.m; sourceTree = \"<group>\"; };\n\t\t13E501BD1D07A644005F35D8 /* RCTNativeAnimatedModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTNativeAnimatedModule.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13E501BE1D07A644005F35D8 /* RCTNativeAnimatedModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNativeAnimatedModule.m; sourceTree = \"<group>\"; };\n\t\t13E501D61D07A6C9005F35D8 /* RCTAdditionAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAdditionAnimatedNode.h; sourceTree = \"<group>\"; };\n\t\t13E501D71D07A6C9005F35D8 /* RCTAdditionAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAdditionAnimatedNode.m; sourceTree = \"<group>\"; };\n\t\t13E501D81D07A6C9005F35D8 /* RCTAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAnimatedNode.h; sourceTree = \"<group>\"; };\n\t\t13E501D91D07A6C9005F35D8 /* RCTAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAnimatedNode.m; sourceTree = \"<group>\"; };\n\t\t13E501DC1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTInterpolationAnimatedNode.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13E501DD1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTInterpolationAnimatedNode.m; sourceTree = \"<group>\"; };\n\t\t13E501DE1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTMultiplicationAnimatedNode.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13E501DF1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMultiplicationAnimatedNode.m; sourceTree = \"<group>\"; };\n\t\t13E501E01D07A6C9005F35D8 /* RCTPropsAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTPropsAnimatedNode.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13E501E11D07A6C9005F35D8 /* RCTPropsAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPropsAnimatedNode.m; sourceTree = \"<group>\"; };\n\t\t13E501E21D07A6C9005F35D8 /* RCTStyleAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTStyleAnimatedNode.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13E501E31D07A6C9005F35D8 /* RCTStyleAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTStyleAnimatedNode.m; sourceTree = \"<group>\"; };\n\t\t13E501E41D07A6C9005F35D8 /* RCTTransformAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTTransformAnimatedNode.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13E501E51D07A6C9005F35D8 /* RCTTransformAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTransformAnimatedNode.m; sourceTree = \"<group>\"; };\n\t\t13E501E61D07A6C9005F35D8 /* RCTValueAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTValueAnimatedNode.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13E501E71D07A6C9005F35D8 /* RCTValueAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTValueAnimatedNode.m; sourceTree = \"<group>\"; };\n\t\t193F64F21D776EC6004D1CAA /* RCTDiffClampAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTDiffClampAnimatedNode.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t193F64F31D776EC6004D1CAA /* RCTDiffClampAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDiffClampAnimatedNode.m; sourceTree = \"<group>\"; };\n\t\t194804EB1E975D8E00623005 /* RCTDecayAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDecayAnimation.h; sourceTree = \"<group>\"; };\n\t\t194804EC1E975D8E00623005 /* RCTDecayAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDecayAnimation.m; sourceTree = \"<group>\"; };\n\t\t19F00F201DC8847500113FEE /* RCTEventAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTEventAnimation.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t19F00F211DC8847500113FEE /* RCTEventAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTEventAnimation.m; sourceTree = \"<group>\"; };\n\t\t2D2A28201D9B03D100D4039D /* libRCTAnimation.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTAnimation.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t5C9894931D999639008027DB /* RCTDivisionAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTDivisionAnimatedNode.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t5C9894941D999639008027DB /* RCTDivisionAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDivisionAnimatedNode.m; sourceTree = \"<group>\"; };\n\t\t94C1294A1D4069170025F25C /* RCTAnimationDriver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTAnimationDriver.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t94C1294C1D4069170025F25C /* RCTFrameAnimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTFrameAnimation.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t94C1294D1D4069170025F25C /* RCTFrameAnimation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTFrameAnimation.m; sourceTree = \"<group>\"; };\n\t\t94C1294E1D4069170025F25C /* RCTSpringAnimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTSpringAnimation.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t94C1294F1D4069170025F25C /* RCTSpringAnimation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTSpringAnimation.m; sourceTree = \"<group>\"; };\n\t\t94DA09161DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNativeAnimatedNodesManager.h; sourceTree = \"<group>\"; };\n\t\t94DA09171DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNativeAnimatedNodesManager.m; sourceTree = \"<group>\"; };\n\t\t94DAE3F71D7334A70059942F /* RCTModuloAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTModuloAnimatedNode.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t94DAE3F81D7334A70059942F /* RCTModuloAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModuloAnimatedNode.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXGroup section */\n\t\t134814211AA4EA7D00B7C361 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134814201AA4EA6300B7C361 /* libRCTAnimation.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13E501D51D07A6C9005F35D8 /* Nodes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5C9894931D999639008027DB /* RCTDivisionAnimatedNode.h */,\n\t\t\t\t5C9894941D999639008027DB /* RCTDivisionAnimatedNode.m */,\n\t\t\t\t193F64F21D776EC6004D1CAA /* RCTDiffClampAnimatedNode.h */,\n\t\t\t\t193F64F31D776EC6004D1CAA /* RCTDiffClampAnimatedNode.m */,\n\t\t\t\t13E501D61D07A6C9005F35D8 /* RCTAdditionAnimatedNode.h */,\n\t\t\t\t13E501D71D07A6C9005F35D8 /* RCTAdditionAnimatedNode.m */,\n\t\t\t\t13E501D81D07A6C9005F35D8 /* RCTAnimatedNode.h */,\n\t\t\t\t13E501D91D07A6C9005F35D8 /* RCTAnimatedNode.m */,\n\t\t\t\t13E501DC1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.h */,\n\t\t\t\t13E501DD1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.m */,\n\t\t\t\t94DAE3F71D7334A70059942F /* RCTModuloAnimatedNode.h */,\n\t\t\t\t94DAE3F81D7334A70059942F /* RCTModuloAnimatedNode.m */,\n\t\t\t\t13E501DE1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.h */,\n\t\t\t\t13E501DF1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.m */,\n\t\t\t\t13E501E01D07A6C9005F35D8 /* RCTPropsAnimatedNode.h */,\n\t\t\t\t13E501E11D07A6C9005F35D8 /* RCTPropsAnimatedNode.m */,\n\t\t\t\t13E501E21D07A6C9005F35D8 /* RCTStyleAnimatedNode.h */,\n\t\t\t\t13E501E31D07A6C9005F35D8 /* RCTStyleAnimatedNode.m */,\n\t\t\t\t13E501E41D07A6C9005F35D8 /* RCTTransformAnimatedNode.h */,\n\t\t\t\t13E501E51D07A6C9005F35D8 /* RCTTransformAnimatedNode.m */,\n\t\t\t\t13E501E61D07A6C9005F35D8 /* RCTValueAnimatedNode.h */,\n\t\t\t\t13E501E71D07A6C9005F35D8 /* RCTValueAnimatedNode.m */,\n\t\t\t);\n\t\t\tpath = Nodes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58B511D21A9E6C8500147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13E501B71D07A644005F35D8 /* RCTAnimationUtils.h */,\n\t\t\t\t13E501B81D07A644005F35D8 /* RCTAnimationUtils.m */,\n\t\t\t\t13E501BD1D07A644005F35D8 /* RCTNativeAnimatedModule.h */,\n\t\t\t\t13E501BE1D07A644005F35D8 /* RCTNativeAnimatedModule.m */,\n\t\t\t\t94DA09161DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.h */,\n\t\t\t\t94DA09171DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.m */,\n\t\t\t\t94C129491D4069170025F25C /* Drivers */,\n\t\t\t\t13E501D51D07A6C9005F35D8 /* Nodes */,\n\t\t\t\t134814211AA4EA7D00B7C361 /* Products */,\n\t\t\t\t2D2A28201D9B03D100D4039D /* libRCTAnimation.a */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t94C129491D4069170025F25C /* Drivers */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t94C1294A1D4069170025F25C /* RCTAnimationDriver.h */,\n\t\t\t\t194804EB1E975D8E00623005 /* RCTDecayAnimation.h */,\n\t\t\t\t194804EC1E975D8E00623005 /* RCTDecayAnimation.m */,\n\t\t\t\t19F00F201DC8847500113FEE /* RCTEventAnimation.h */,\n\t\t\t\t19F00F211DC8847500113FEE /* RCTEventAnimation.m */,\n\t\t\t\t94C1294C1D4069170025F25C /* RCTFrameAnimation.h */,\n\t\t\t\t94C1294D1D4069170025F25C /* RCTFrameAnimation.m */,\n\t\t\t\t94C1294E1D4069170025F25C /* RCTSpringAnimation.h */,\n\t\t\t\t94C1294F1D4069170025F25C /* RCTSpringAnimation.m */,\n\t\t\t);\n\t\t\tpath = Drivers;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t192F69801E823F2E008692C7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t194804F01E975DCF00623005 /* RCTDecayAnimation.h in Headers */,\n\t\t\t\t192F69811E823F4A008692C7 /* RCTAnimationUtils.h in Headers */,\n\t\t\t\t192F69821E823F4A008692C7 /* RCTNativeAnimatedModule.h in Headers */,\n\t\t\t\t192F69831E823F4A008692C7 /* RCTNativeAnimatedNodesManager.h in Headers */,\n\t\t\t\t192F69841E823F4A008692C7 /* RCTAnimationDriver.h in Headers */,\n\t\t\t\t192F69851E823F4A008692C7 /* RCTEventAnimation.h in Headers */,\n\t\t\t\t192F69861E823F4A008692C7 /* RCTFrameAnimation.h in Headers */,\n\t\t\t\t192F69871E823F4A008692C7 /* RCTSpringAnimation.h in Headers */,\n\t\t\t\t192F69881E823F4A008692C7 /* RCTDivisionAnimatedNode.h in Headers */,\n\t\t\t\t192F69891E823F4A008692C7 /* RCTDiffClampAnimatedNode.h in Headers */,\n\t\t\t\t192F698A1E823F4A008692C7 /* RCTAdditionAnimatedNode.h in Headers */,\n\t\t\t\t192F698B1E823F4A008692C7 /* RCTAnimatedNode.h in Headers */,\n\t\t\t\t192F698C1E823F4A008692C7 /* RCTInterpolationAnimatedNode.h in Headers */,\n\t\t\t\t192F698D1E823F4A008692C7 /* RCTModuloAnimatedNode.h in Headers */,\n\t\t\t\t192F698E1E823F4A008692C7 /* RCTMultiplicationAnimatedNode.h in Headers */,\n\t\t\t\t192F698F1E823F4A008692C7 /* RCTPropsAnimatedNode.h in Headers */,\n\t\t\t\t192F69901E823F4A008692C7 /* RCTStyleAnimatedNode.h in Headers */,\n\t\t\t\t192F69911E823F4A008692C7 /* RCTTransformAnimatedNode.h in Headers */,\n\t\t\t\t192F69921E823F4A008692C7 /* RCTValueAnimatedNode.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1980B70D1E80D1B5004DC789 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1980B70E1E80D1C4004DC789 /* RCTAnimationUtils.h in Headers */,\n\t\t\t\t1980B7101E80D1C4004DC789 /* RCTNativeAnimatedModule.h in Headers */,\n\t\t\t\t1980B7121E80D1C4004DC789 /* RCTNativeAnimatedNodesManager.h in Headers */,\n\t\t\t\t1980B7141E80D1C4004DC789 /* RCTAnimationDriver.h in Headers */,\n\t\t\t\t1980B7151E80D1C4004DC789 /* RCTEventAnimation.h in Headers */,\n\t\t\t\t194804ED1E975D8E00623005 /* RCTDecayAnimation.h in Headers */,\n\t\t\t\t1980B7171E80D1C4004DC789 /* RCTFrameAnimation.h in Headers */,\n\t\t\t\t1980B7191E80D1C4004DC789 /* RCTSpringAnimation.h in Headers */,\n\t\t\t\t1980B71B1E80D1C4004DC789 /* RCTDivisionAnimatedNode.h in Headers */,\n\t\t\t\t1980B71D1E80D1C4004DC789 /* RCTDiffClampAnimatedNode.h in Headers */,\n\t\t\t\t1980B71F1E80D1C4004DC789 /* RCTAdditionAnimatedNode.h in Headers */,\n\t\t\t\t1980B7211E80D1C4004DC789 /* RCTAnimatedNode.h in Headers */,\n\t\t\t\t1980B7231E80D1C4004DC789 /* RCTInterpolationAnimatedNode.h in Headers */,\n\t\t\t\t1980B7251E80D1C4004DC789 /* RCTModuloAnimatedNode.h in Headers */,\n\t\t\t\t1980B7271E80D1C4004DC789 /* RCTMultiplicationAnimatedNode.h in Headers */,\n\t\t\t\t1980B7291E80D1C4004DC789 /* RCTPropsAnimatedNode.h in Headers */,\n\t\t\t\t1980B72B1E80D1C4004DC789 /* RCTStyleAnimatedNode.h in Headers */,\n\t\t\t\t1980B72D1E80D1C4004DC789 /* RCTTransformAnimatedNode.h in Headers */,\n\t\t\t\t1980B72F1E80D1C4004DC789 /* RCTValueAnimatedNode.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t2D2A281F1D9B03D100D4039D /* RCTAnimation-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D2A28281D9B03D100D4039D /* Build configuration list for PBXNativeTarget \"RCTAnimation-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2D2A281C1D9B03D100D4039D /* Sources */,\n\t\t\t\t192F69801E823F2E008692C7 /* Headers */,\n\t\t\t\t192F69931E823F4F008692C7 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"RCTAnimation-tvOS\";\n\t\t\tproductName = \"RCTAnimation-tvOS\";\n\t\t\tproductReference = 2D2A28201D9B03D100D4039D /* libRCTAnimation.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t58B511DA1A9E6C8500147676 /* RCTAnimation */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTAnimation\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t58B511D71A9E6C8500147676 /* Sources */,\n\t\t\t\t1980B70D1E80D1B5004DC789 /* Headers */,\n\t\t\t\t1980B7311E80D21C004DC789 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTAnimation;\n\t\t\tproductName = RCTDataManager;\n\t\t\tproductReference = 134814201AA4EA6300B7C361 /* libRCTAnimation.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511D31A9E6C8500147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0730;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t2D2A281F1D9B03D100D4039D = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t58B511DA1A9E6C8500147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTAnimation\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511D21A9E6C8500147676;\n\t\t\tproductRefGroup = 58B511D21A9E6C8500147676;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B511DA1A9E6C8500147676 /* RCTAnimation */,\n\t\t\t\t2D2A281F1D9B03D100D4039D /* RCTAnimation-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t2D2A281C1D9B03D100D4039D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D3B5F001D9B0B4800451313 /* RCTValueAnimatedNode.m in Sources */,\n\t\t\t\t2D3B5EFB1D9B0B4800451313 /* RCTModuloAnimatedNode.m in Sources */,\n\t\t\t\t2D3B5EF21D9B0B3100451313 /* RCTAnimationUtils.m in Sources */,\n\t\t\t\t2D3B5EF51D9B0B4800451313 /* RCTDivisionAnimatedNode.m in Sources */,\n\t\t\t\t2D3B5EF71D9B0B4800451313 /* RCTAdditionAnimatedNode.m in Sources */,\n\t\t\t\t19F00F231DC8848E00113FEE /* RCTEventAnimation.m in Sources */,\n\t\t\t\t2D3B5EF41D9B0B3700451313 /* RCTNativeAnimatedModule.m in Sources */,\n\t\t\t\t2D3B5EF61D9B0B4800451313 /* RCTDiffClampAnimatedNode.m in Sources */,\n\t\t\t\t2D3B5EF81D9B0B4800451313 /* RCTAnimatedNode.m in Sources */,\n\t\t\t\t2D3B5EFE1D9B0B4800451313 /* RCTStyleAnimatedNode.m in Sources */,\n\t\t\t\t2D3B5EFA1D9B0B4800451313 /* RCTInterpolationAnimatedNode.m in Sources */,\n\t\t\t\t2D3B5EFF1D9B0B4800451313 /* RCTTransformAnimatedNode.m in Sources */,\n\t\t\t\t2D3B5EFC1D9B0B4800451313 /* RCTMultiplicationAnimatedNode.m in Sources */,\n\t\t\t\t2D3B5EFD1D9B0B4800451313 /* RCTPropsAnimatedNode.m in Sources */,\n\t\t\t\t944244D01DB962DA0032A02B /* RCTFrameAnimation.m in Sources */,\n\t\t\t\t944244D11DB962DC0032A02B /* RCTSpringAnimation.m in Sources */,\n\t\t\t\t9476E8EC1DC9232D005D5CD1 /* RCTNativeAnimatedNodesManager.m in Sources */,\n\t\t\t\t194804F21E977DDB00623005 /* RCTDecayAnimation.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t58B511D71A9E6C8500147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t94C129511D40692B0025F25C /* RCTFrameAnimation.m in Sources */,\n\t\t\t\t94C129521D40692B0025F25C /* RCTSpringAnimation.m in Sources */,\n\t\t\t\t94DA09181DC7971C00AEA8C9 /* RCTNativeAnimatedNodesManager.m in Sources */,\n\t\t\t\t13E501F01D07A6C9005F35D8 /* RCTValueAnimatedNode.m in Sources */,\n\t\t\t\t94DAE3F91D7334A70059942F /* RCTModuloAnimatedNode.m in Sources */,\n\t\t\t\t193F64F41D776EC6004D1CAA /* RCTDiffClampAnimatedNode.m in Sources */,\n\t\t\t\t19F00F221DC8847500113FEE /* RCTEventAnimation.m in Sources */,\n\t\t\t\t13E501EE1D07A6C9005F35D8 /* RCTStyleAnimatedNode.m in Sources */,\n\t\t\t\t13E501CC1D07A644005F35D8 /* RCTAnimationUtils.m in Sources */,\n\t\t\t\t13E501CF1D07A644005F35D8 /* RCTNativeAnimatedModule.m in Sources */,\n\t\t\t\t13E501EC1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.m in Sources */,\n\t\t\t\t13E501ED1D07A6C9005F35D8 /* RCTPropsAnimatedNode.m in Sources */,\n\t\t\t\t13E501E91D07A6C9005F35D8 /* RCTAnimatedNode.m in Sources */,\n\t\t\t\t13E501EB1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.m in Sources */,\n\t\t\t\t13E501E81D07A6C9005F35D8 /* RCTAdditionAnimatedNode.m in Sources */,\n\t\t\t\t5C9894951D999639008027DB /* RCTDivisionAnimatedNode.m in Sources */,\n\t\t\t\t13E501EF1D07A6C9005F35D8 /* RCTTransformAnimatedNode.m in Sources */,\n\t\t\t\t194804EE1E975D8E00623005 /* RCTDecayAnimation.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t2D2A28261D9B03D100D4039D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTAnimation;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D2A28271D9B03D100D4039D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTAnimation;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511ED1A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511EE1A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511F01A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTAnimation;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511F11A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTAnimation;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t2D2A28281D9B03D100D4039D /* Build configuration list for PBXNativeTarget \"RCTAnimation-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D2A28261D9B03D100D4039D /* Debug */,\n\t\t\t\t2D2A28271D9B03D100D4039D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTAnimation\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511ED1A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511EE1A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTAnimation\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511F01A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511F11A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511D31A9E6C8500147676 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/NativeAnimation/RCTAnimationUtils.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <CoreGraphics/CoreGraphics.h>\n#import <Foundation/Foundation.h>\n\n#import <React/RCTDefines.h>\n\nstatic NSString *const EXTRAPOLATE_TYPE_IDENTITY = @\"identity\";\nstatic NSString *const EXTRAPOLATE_TYPE_CLAMP = @\"clamp\";\nstatic NSString *const EXTRAPOLATE_TYPE_EXTEND = @\"extend\";\n\nRCT_EXTERN CGFloat RCTInterpolateValueInRange(CGFloat value,\n                                              NSArray<NSNumber *> *inputRange,\n                                              NSArray<NSNumber *> *outputRange,\n                                              NSString *extrapolateLeft,\n                                              NSString *extrapolateRight);\n\nRCT_EXTERN CGFloat RCTInterpolateValue(CGFloat value,\n                                       CGFloat inputMin,\n                                       CGFloat inputMax,\n                                       CGFloat outputMin,\n                                       CGFloat outputMax,\n                                       NSString *extrapolateLeft,\n                                       NSString *extrapolateRight);\n\nRCT_EXTERN CGFloat RCTRadiansToDegrees(CGFloat radians);\nRCT_EXTERN CGFloat RCTDegreesToRadians(CGFloat degrees);\n"
  },
  {
    "path": "Libraries/NativeAnimation/RCTAnimationUtils.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAnimationUtils.h\"\n\n#import <React/RCTLog.h>\n\nstatic NSUInteger _RCTFindIndexOfNearestValue(CGFloat value, NSArray<NSNumber *> *range)\n{\n  NSUInteger index;\n  NSUInteger rangeCount = range.count;\n  for (index = 1; index < rangeCount - 1; index++) {\n    NSNumber *inputValue = range[index];\n    if (inputValue.doubleValue >= value) {\n      break;\n    }\n  }\n  return index - 1;\n}\n\n/**\n * Interpolates value by remapping it linearly fromMin->fromMax to toMin->toMax\n */\nCGFloat RCTInterpolateValue(CGFloat value,\n                            CGFloat inputMin,\n                            CGFloat inputMax,\n                            CGFloat outputMin,\n                            CGFloat outputMax,\n                            NSString *extrapolateLeft,\n                            NSString *extrapolateRight)\n{\n  if (value < inputMin) {\n    if ([extrapolateLeft isEqualToString:EXTRAPOLATE_TYPE_IDENTITY]) {\n      return value;\n    } else if ([extrapolateLeft isEqualToString:EXTRAPOLATE_TYPE_CLAMP]) {\n      value = inputMin;\n    } else if ([extrapolateLeft isEqualToString:EXTRAPOLATE_TYPE_EXTEND]) {\n      // noop\n    } else {\n      RCTLogError(@\"Invalid extrapolation type %@ for left extrapolation\", extrapolateLeft);\n    }\n  }\n\n  if (value > inputMax) {\n    if ([extrapolateRight isEqualToString:EXTRAPOLATE_TYPE_IDENTITY]) {\n      return value;\n    } else if ([extrapolateRight isEqualToString:EXTRAPOLATE_TYPE_CLAMP]) {\n      value = inputMax;\n    } else if ([extrapolateRight isEqualToString:EXTRAPOLATE_TYPE_EXTEND]) {\n      // noop\n    } else {\n      RCTLogError(@\"Invalid extrapolation type %@ for right extrapolation\", extrapolateRight);\n    }\n  }\n\n  return outputMin + (value - inputMin) * (outputMax - outputMin) / (inputMax - inputMin);\n}\n\n/**\n * Interpolates value by mapping it from the inputRange to the outputRange.\n */\nCGFloat RCTInterpolateValueInRange(CGFloat value,\n                                   NSArray<NSNumber *> *inputRange,\n                                   NSArray<NSNumber *> *outputRange,\n                                   NSString *extrapolateLeft,\n                                   NSString *extrapolateRight)\n{\n  NSUInteger rangeIndex = _RCTFindIndexOfNearestValue(value, inputRange);\n  CGFloat inputMin = inputRange[rangeIndex].doubleValue;\n  CGFloat inputMax = inputRange[rangeIndex + 1].doubleValue;\n  CGFloat outputMin = outputRange[rangeIndex].doubleValue;\n  CGFloat outputMax = outputRange[rangeIndex + 1].doubleValue;\n\n  return RCTInterpolateValue(value,\n                             inputMin,\n                             inputMax,\n                             outputMin,\n                             outputMax,\n                             extrapolateLeft,\n                             extrapolateRight);\n}\n\nCGFloat RCTRadiansToDegrees(CGFloat radians)\n{\n  return radians * 180.0 / M_PI;\n}\n\nCGFloat RCTDegreesToRadians(CGFloat degrees)\n{\n  return degrees / 180.0 * M_PI;\n}\n"
  },
  {
    "path": "Libraries/NativeAnimation/RCTNativeAnimatedModule.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTEventEmitter.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTUIManagerObserverCoordinator.h>\n#import <React/RCTUIManagerUtils.h>\n\n#import \"RCTValueAnimatedNode.h\"\n\n@interface RCTNativeAnimatedModule : RCTEventEmitter <RCTBridgeModule, RCTValueAnimatedNodeObserver, RCTEventDispatcherObserver, RCTUIManagerObserver>\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/RCTNativeAnimatedModule.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n#import \"RCTNativeAnimatedModule.h\"\n\n#import \"RCTNativeAnimatedNodesManager.h\"\n\ntypedef void (^AnimatedOperation)(RCTNativeAnimatedNodesManager *nodesManager);\n\n@implementation RCTNativeAnimatedModule\n{\n  RCTNativeAnimatedNodesManager *_nodesManager;\n\n  // Oparations called after views have been updated.\n  NSMutableArray<AnimatedOperation> *_operations;\n  // Operations called before views have been updated.\n  NSMutableArray<AnimatedOperation> *_preOperations;\n}\n\nRCT_EXPORT_MODULE();\n\n- (void)invalidate\n{\n  [_nodesManager stopAnimationLoop];\n  [self.bridge.eventDispatcher removeDispatchObserver:self];\n  [self.bridge.uiManager.observerCoordinator removeObserver:self];\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  // This module needs to be on the same queue as the UIManager to avoid\n  // having to lock `_operations` and `_preOperations` since `uiManagerWillPerformMounting`\n  // will be called from that queue.\n  return RCTGetUIManagerQueue();\n}\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  [super setBridge:bridge];\n\n  _nodesManager = [[RCTNativeAnimatedNodesManager alloc] initWithUIManager:self.bridge.uiManager];\n  _operations = [NSMutableArray new];\n  _preOperations = [NSMutableArray new];\n\n  [bridge.eventDispatcher addDispatchObserver:self];\n  [bridge.uiManager.observerCoordinator addObserver:self];\n}\n\n#pragma mark -- API\n\nRCT_EXPORT_METHOD(createAnimatedNode:(nonnull NSNumber *)tag\n                  config:(NSDictionary<NSString *, id> *)config)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager createAnimatedNode:tag config:config];\n  }];\n}\n\nRCT_EXPORT_METHOD(connectAnimatedNodes:(nonnull NSNumber *)parentTag\n                  childTag:(nonnull NSNumber *)childTag)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager connectAnimatedNodes:parentTag childTag:childTag];\n  }];\n}\n\nRCT_EXPORT_METHOD(disconnectAnimatedNodes:(nonnull NSNumber *)parentTag\n                  childTag:(nonnull NSNumber *)childTag)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager disconnectAnimatedNodes:parentTag childTag:childTag];\n  }];\n}\n\nRCT_EXPORT_METHOD(startAnimatingNode:(nonnull NSNumber *)animationId\n                  nodeTag:(nonnull NSNumber *)nodeTag\n                  config:(NSDictionary<NSString *, id> *)config\n                  endCallback:(RCTResponseSenderBlock)callBack)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager startAnimatingNode:animationId nodeTag:nodeTag config:config endCallback:callBack];\n  }];\n}\n\nRCT_EXPORT_METHOD(stopAnimation:(nonnull NSNumber *)animationId)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager stopAnimation:animationId];\n  }];\n}\n\nRCT_EXPORT_METHOD(setAnimatedNodeValue:(nonnull NSNumber *)nodeTag\n                  value:(nonnull NSNumber *)value)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager setAnimatedNodeValue:nodeTag value:value];\n  }];\n}\n\nRCT_EXPORT_METHOD(setAnimatedNodeOffset:(nonnull NSNumber *)nodeTag\n                  offset:(nonnull NSNumber *)offset)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager setAnimatedNodeOffset:nodeTag offset:offset];\n  }];\n}\n\nRCT_EXPORT_METHOD(flattenAnimatedNodeOffset:(nonnull NSNumber *)nodeTag)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager flattenAnimatedNodeOffset:nodeTag];\n  }];\n}\n\nRCT_EXPORT_METHOD(extractAnimatedNodeOffset:(nonnull NSNumber *)nodeTag)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager extractAnimatedNodeOffset:nodeTag];\n  }];\n}\n\nRCT_EXPORT_METHOD(connectAnimatedNodeToView:(nonnull NSNumber *)nodeTag\n                  viewTag:(nonnull NSNumber *)viewTag)\n{\n  NSString *viewName = [self.bridge.uiManager viewNameForReactTag:viewTag];\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager connectAnimatedNodeToView:nodeTag viewTag:viewTag viewName:viewName];\n  }];\n}\n\nRCT_EXPORT_METHOD(disconnectAnimatedNodeFromView:(nonnull NSNumber *)nodeTag\n                  viewTag:(nonnull NSNumber *)viewTag)\n{\n  [self addPreOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager restoreDefaultValues:nodeTag];\n  }];\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager disconnectAnimatedNodeFromView:nodeTag viewTag:viewTag];\n  }];\n}\n\nRCT_EXPORT_METHOD(dropAnimatedNode:(nonnull NSNumber *)tag)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager dropAnimatedNode:tag];\n  }];\n}\n\nRCT_EXPORT_METHOD(startListeningToAnimatedNodeValue:(nonnull NSNumber *)tag)\n{\n  __weak id<RCTValueAnimatedNodeObserver> valueObserver = self;\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager startListeningToAnimatedNodeValue:tag valueObserver:valueObserver];\n  }];\n}\n\nRCT_EXPORT_METHOD(stopListeningToAnimatedNodeValue:(nonnull NSNumber *)tag)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager stopListeningToAnimatedNodeValue:tag];\n  }];\n}\n\nRCT_EXPORT_METHOD(addAnimatedEventToView:(nonnull NSNumber *)viewTag\n                  eventName:(nonnull NSString *)eventName\n                  eventMapping:(NSDictionary<NSString *, id> *)eventMapping)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager addAnimatedEventToView:viewTag eventName:eventName eventMapping:eventMapping];\n  }];\n}\n\nRCT_EXPORT_METHOD(removeAnimatedEventFromView:(nonnull NSNumber *)viewTag\n                  eventName:(nonnull NSString *)eventName\n            animatedNodeTag:(nonnull NSNumber *)animatedNodeTag)\n{\n  [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) {\n    [nodesManager removeAnimatedEventFromView:viewTag eventName:eventName animatedNodeTag:animatedNodeTag];\n  }];\n}\n\n#pragma mark -- Batch handling\n\n- (void)addOperationBlock:(AnimatedOperation)operation\n{\n  [_operations addObject:operation];\n}\n\n- (void)addPreOperationBlock:(AnimatedOperation)operation\n{\n  [_preOperations addObject:operation];\n}\n\n#pragma mark - RCTUIManagerObserver\n\n- (void)uiManagerWillPerformMounting:(RCTUIManager *)uiManager\n{\n  if (_preOperations.count == 0 && _operations.count == 0) {\n    return;\n  }\n\n  NSArray<AnimatedOperation> *preOperations = _preOperations;\n  NSArray<AnimatedOperation> *operations = _operations;\n  _preOperations = [NSMutableArray new];\n  _operations = [NSMutableArray new];\n\n  [uiManager prependUIBlock:^(__unused RCTUIManager *manager, __unused NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    for (AnimatedOperation operation in preOperations) {\n      operation(self->_nodesManager);\n    }\n  }];\n\n  [uiManager addUIBlock:^(__unused RCTUIManager *manager, __unused NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    for (AnimatedOperation operation in operations) {\n      operation(self->_nodesManager);\n    }\n\n    [self->_nodesManager updateAnimations];\n  }];\n}\n\n#pragma mark -- Events\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[@\"onAnimatedValueUpdate\"];\n}\n\n- (void)animatedNode:(RCTValueAnimatedNode *)node didUpdateValue:(CGFloat)value\n{\n  [self sendEventWithName:@\"onAnimatedValueUpdate\"\n                     body:@{@\"tag\": node.nodeTag, @\"value\": @(value)}];\n}\n\n- (void)eventDispatcherWillDispatchEvent:(id<RCTEvent>)event\n{\n  // Events can be dispatched from any queue so we have to make sure handleAnimatedEvent\n  // is run from the main queue.\n  RCTExecuteOnMainQueue(^{\n    [self->_nodesManager handleAnimatedEvent:event];\n  });\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <RCTAnimation/RCTValueAnimatedNode.h>\n#import <React/RCTBridgeModule.h>\n#import <React/RCTUIManager.h>\n\n@interface RCTNativeAnimatedNodesManager : NSObject\n\n- (nonnull instancetype)initWithUIManager:(nonnull RCTUIManager *)uiManager;\n\n- (void)updateAnimations;\n\n- (void)stepAnimations:(nonnull NSTimer *)sender;\n\n// graph\n\n- (void)createAnimatedNode:(nonnull NSNumber *)tag\n                    config:(NSDictionary<NSString *, id> *__nonnull)config;\n\n- (void)connectAnimatedNodes:(nonnull NSNumber *)parentTag\n                    childTag:(nonnull NSNumber *)childTag;\n\n- (void)disconnectAnimatedNodes:(nonnull NSNumber *)parentTag\n                       childTag:(nonnull NSNumber *)childTag;\n\n- (void)connectAnimatedNodeToView:(nonnull NSNumber *)nodeTag\n                          viewTag:(nonnull NSNumber *)viewTag\n                         viewName:(nonnull NSString *)viewName;\n\n- (void)restoreDefaultValues:(nonnull NSNumber *)nodeTag;\n\n- (void)disconnectAnimatedNodeFromView:(nonnull NSNumber *)nodeTag\n                               viewTag:(nonnull NSNumber *)viewTag;\n\n- (void)dropAnimatedNode:(nonnull NSNumber *)tag;\n\n// mutations\n\n- (void)setAnimatedNodeValue:(nonnull NSNumber *)nodeTag\n                       value:(nonnull NSNumber *)value;\n\n- (void)setAnimatedNodeOffset:(nonnull NSNumber *)nodeTag\n                       offset:(nonnull NSNumber *)offset;\n\n- (void)flattenAnimatedNodeOffset:(nonnull NSNumber *)nodeTag;\n\n- (void)extractAnimatedNodeOffset:(nonnull NSNumber *)nodeTag;\n\n// drivers\n\n- (void)startAnimatingNode:(nonnull NSNumber *)animationId\n                   nodeTag:(nonnull NSNumber *)nodeTag\n                    config:(NSDictionary<NSString *, id> *__nonnull)config\n               endCallback:(nullable RCTResponseSenderBlock)callBack;\n\n- (void)stopAnimation:(nonnull NSNumber *)animationId;\n\n- (void)stopAnimationLoop;\n\n// events\n\n- (void)addAnimatedEventToView:(nonnull NSNumber *)viewTag\n                     eventName:(nonnull NSString *)eventName\n                  eventMapping:(NSDictionary<NSString *, id> *__nonnull)eventMapping;\n\n- (void)removeAnimatedEventFromView:(nonnull NSNumber *)viewTag\n                          eventName:(nonnull NSString *)eventName\n                    animatedNodeTag:(nonnull NSNumber *)animatedNodeTag;\n\n- (void)handleAnimatedEvent:(nonnull id<RCTEvent>)event;\n\n// listeners\n\n- (void)startListeningToAnimatedNodeValue:(nonnull NSNumber *)tag\n                            valueObserver:(nonnull id<RCTValueAnimatedNodeObserver>)valueObserver;\n\n- (void)stopListeningToAnimatedNodeValue:(nonnull NSNumber *)tag;\n\n@end\n"
  },
  {
    "path": "Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTNativeAnimatedNodesManager.h\"\n\n#import <React/RCTConvert.h>\n#import <React/RCTDisplayLink.h>\n\n#import \"RCTAdditionAnimatedNode.h\"\n#import \"RCTAnimatedNode.h\"\n#import \"RCTAnimationDriver.h\"\n#import \"RCTDiffClampAnimatedNode.h\"\n#import \"RCTDivisionAnimatedNode.h\"\n#import \"RCTEventAnimation.h\"\n#import \"RCTFrameAnimation.h\"\n#import \"RCTDecayAnimation.h\"\n#import \"RCTInterpolationAnimatedNode.h\"\n#import \"RCTModuloAnimatedNode.h\"\n#import \"RCTMultiplicationAnimatedNode.h\"\n#import \"RCTPropsAnimatedNode.h\"\n#import \"RCTSpringAnimation.h\"\n#import \"RCTStyleAnimatedNode.h\"\n#import \"RCTTransformAnimatedNode.h\"\n#import \"RCTValueAnimatedNode.h\"\n\n@implementation RCTNativeAnimatedNodesManager\n{\n  __weak RCTUIManager *_uiManager;\n  NSMutableDictionary<NSNumber *, RCTAnimatedNode *> *_animationNodes;\n  // Mapping of a view tag and an event name to a list of event animation drivers. 99% of the time\n  // there will be only one driver per mapping so all code code should be optimized around that.\n  NSMutableDictionary<NSString *, NSMutableArray<RCTEventAnimation *> *> *_eventDrivers;\n  NSMutableSet<id<RCTAnimationDriver>> *_activeAnimations;\n  NSTimer *_displayLink;\n}\n\n- (instancetype)initWithUIManager:(nonnull RCTUIManager *)uiManager\n{\n  if ((self = [super init])) {\n    _uiManager = uiManager;\n    _animationNodes = [NSMutableDictionary new];\n    _eventDrivers = [NSMutableDictionary new];\n    _activeAnimations = [NSMutableSet new];\n  }\n  return self;\n}\n\n#pragma mark -- Graph\n\n- (void)createAnimatedNode:(nonnull NSNumber *)tag\n                    config:(NSDictionary<NSString *, id> *)config\n{\n  static NSDictionary *map;\n  static dispatch_once_t mapToken;\n  dispatch_once(&mapToken, ^{\n    map = @{@\"style\" : [RCTStyleAnimatedNode class],\n            @\"value\" : [RCTValueAnimatedNode class],\n            @\"props\" : [RCTPropsAnimatedNode class],\n            @\"interpolation\" : [RCTInterpolationAnimatedNode class],\n            @\"addition\" : [RCTAdditionAnimatedNode class],\n            @\"diffclamp\": [RCTDiffClampAnimatedNode class],\n            @\"division\" : [RCTDivisionAnimatedNode class],\n            @\"multiplication\" : [RCTMultiplicationAnimatedNode class],\n            @\"modulus\" : [RCTModuloAnimatedNode class],\n            @\"transform\" : [RCTTransformAnimatedNode class]};\n  });\n\n  NSString *nodeType = [RCTConvert NSString:config[@\"type\"]];\n\n  Class nodeClass = map[nodeType];\n  if (!nodeClass) {\n    RCTLogError(@\"Animated node type %@ not supported natively\", nodeType);\n    return;\n  }\n\n  RCTAnimatedNode *node = [[nodeClass alloc] initWithTag:tag config:config];\n  _animationNodes[tag] = node;\n  [node setNeedsUpdate];\n}\n\n- (void)connectAnimatedNodes:(nonnull NSNumber *)parentTag\n                    childTag:(nonnull NSNumber *)childTag\n{\n  RCTAssertParam(parentTag);\n  RCTAssertParam(childTag);\n\n  RCTAnimatedNode *parentNode = _animationNodes[parentTag];\n  RCTAnimatedNode *childNode = _animationNodes[childTag];\n\n  RCTAssertParam(parentNode);\n  RCTAssertParam(childNode);\n\n  [parentNode addChild:childNode];\n  [childNode setNeedsUpdate];\n}\n\n- (void)disconnectAnimatedNodes:(nonnull NSNumber *)parentTag\n                       childTag:(nonnull NSNumber *)childTag\n{\n  RCTAssertParam(parentTag);\n  RCTAssertParam(childTag);\n\n  RCTAnimatedNode *parentNode = _animationNodes[parentTag];\n  RCTAnimatedNode *childNode = _animationNodes[childTag];\n\n  RCTAssertParam(parentNode);\n  RCTAssertParam(childNode);\n\n  [parentNode removeChild:childNode];\n  [childNode setNeedsUpdate];\n}\n\n- (void)connectAnimatedNodeToView:(nonnull NSNumber *)nodeTag\n                          viewTag:(nonnull NSNumber *)viewTag\n                         viewName:(nonnull NSString *)viewName\n{\n  RCTAnimatedNode *node = _animationNodes[nodeTag];\n  if ([node isKindOfClass:[RCTPropsAnimatedNode class]]) {\n    [(RCTPropsAnimatedNode *)node connectToView:viewTag viewName:viewName uiManager:_uiManager];\n  }\n  [node setNeedsUpdate];\n}\n\n- (void)disconnectAnimatedNodeFromView:(nonnull NSNumber *)nodeTag\n                               viewTag:(nonnull NSNumber *)viewTag\n{\n  RCTAnimatedNode *node = _animationNodes[nodeTag];\n  if ([node isKindOfClass:[RCTPropsAnimatedNode class]]) {\n    [(RCTPropsAnimatedNode *)node disconnectFromView:viewTag];\n  }\n}\n\n- (void)restoreDefaultValues:(nonnull NSNumber *)nodeTag\n{\n  RCTAnimatedNode *node = _animationNodes[nodeTag];\n  // Restoring default values needs to happen before UIManager operations so it is\n  // possible the node hasn't been created yet if it is being connected and\n  // disconnected in the same batch. In that case we don't need to restore\n  // default values since it will never actually update the view.\n  if (node == nil) {\n    return;\n  }\n  if (![node isKindOfClass:[RCTPropsAnimatedNode class]]) {\n    RCTLogError(@\"Not a props node.\");\n  }\n  [(RCTPropsAnimatedNode *)node restoreDefaultValues];\n}\n\n- (void)dropAnimatedNode:(nonnull NSNumber *)tag\n{\n  RCTAnimatedNode *node = _animationNodes[tag];\n  if (node) {\n    [node detachNode];\n    [_animationNodes removeObjectForKey:tag];\n  }\n}\n\n#pragma mark -- Mutations\n\n- (void)setAnimatedNodeValue:(nonnull NSNumber *)nodeTag\n                       value:(nonnull NSNumber *)value\n{\n  RCTAnimatedNode *node = _animationNodes[nodeTag];\n  if (![node isKindOfClass:[RCTValueAnimatedNode class]]) {\n    RCTLogError(@\"Not a value node.\");\n    return;\n  }\n  [self stopAnimationsForNode:node];\n\n  RCTValueAnimatedNode *valueNode = (RCTValueAnimatedNode *)node;\n  valueNode.value = value.floatValue;\n  [valueNode setNeedsUpdate];\n}\n\n- (void)setAnimatedNodeOffset:(nonnull NSNumber *)nodeTag\n                       offset:(nonnull NSNumber *)offset\n{\n  RCTAnimatedNode *node = _animationNodes[nodeTag];\n  if (![node isKindOfClass:[RCTValueAnimatedNode class]]) {\n    RCTLogError(@\"Not a value node.\");\n    return;\n  }\n\n  RCTValueAnimatedNode *valueNode = (RCTValueAnimatedNode *)node;\n  [valueNode setOffset:offset.floatValue];\n  [valueNode setNeedsUpdate];\n}\n\n- (void)flattenAnimatedNodeOffset:(nonnull NSNumber *)nodeTag\n{\n  RCTAnimatedNode *node = _animationNodes[nodeTag];\n  if (![node isKindOfClass:[RCTValueAnimatedNode class]]) {\n    RCTLogError(@\"Not a value node.\");\n    return;\n  }\n\n  RCTValueAnimatedNode *valueNode = (RCTValueAnimatedNode *)node;\n  [valueNode flattenOffset];\n}\n\n- (void)extractAnimatedNodeOffset:(nonnull NSNumber *)nodeTag\n{\n  RCTAnimatedNode *node = _animationNodes[nodeTag];\n  if (![node isKindOfClass:[RCTValueAnimatedNode class]]) {\n    RCTLogError(@\"Not a value node.\");\n    return;\n  }\n\n  RCTValueAnimatedNode *valueNode = (RCTValueAnimatedNode *)node;\n  [valueNode extractOffset];\n}\n\n#pragma mark -- Drivers\n\n- (void)startAnimatingNode:(nonnull NSNumber *)animationId\n                   nodeTag:(nonnull NSNumber *)nodeTag\n                    config:(NSDictionary<NSString *, id> *)config\n               endCallback:(RCTResponseSenderBlock)callBack\n{\n  RCTValueAnimatedNode *valueNode = (RCTValueAnimatedNode *)_animationNodes[nodeTag];\n\n  NSString *type = config[@\"type\"];\n  id<RCTAnimationDriver> animationDriver;\n\n  if ([type isEqual:@\"frames\"]) {\n    animationDriver = [[RCTFrameAnimation alloc] initWithId:animationId\n                                                     config:config\n                                                    forNode:valueNode\n                                                   callBack:callBack];\n\n  } else if ([type isEqual:@\"spring\"]) {\n    animationDriver = [[RCTSpringAnimation alloc] initWithId:animationId\n                                                      config:config\n                                                     forNode:valueNode\n                                                    callBack:callBack];\n\n  } else if ([type isEqual:@\"decay\"]) {\n    animationDriver = [[RCTDecayAnimation alloc] initWithId:animationId\n                                                     config:config\n                                                    forNode:valueNode\n                                                   callBack:callBack];\n  } else {\n    RCTLogError(@\"Unsupported animation type: %@\", config[@\"type\"]);\n    return;\n  }\n\n  [_activeAnimations addObject:animationDriver];\n  [animationDriver startAnimation];\n  [self startAnimationLoopIfNeeded];\n}\n\n- (void)stopAnimation:(nonnull NSNumber *)animationId\n{\n  for (id<RCTAnimationDriver> driver in _activeAnimations) {\n    if ([driver.animationId isEqual:animationId]) {\n      [driver stopAnimation];\n      [_activeAnimations removeObject:driver];\n      break;\n    }\n  }\n}\n\n- (void)stopAnimationsForNode:(nonnull RCTAnimatedNode *)node\n{\n    NSMutableArray<id<RCTAnimationDriver>> *discarded = [NSMutableArray new];\n    for (id<RCTAnimationDriver> driver in _activeAnimations) {\n        if ([driver.valueNode isEqual:node]) {\n            [discarded addObject:driver];\n        }\n    }\n    for (id<RCTAnimationDriver> driver in discarded) {\n        [driver stopAnimation];\n        [_activeAnimations removeObject:driver];\n    }\n}\n\n#pragma mark -- Events\n\n- (void)addAnimatedEventToView:(nonnull NSNumber *)viewTag\n                     eventName:(nonnull NSString *)eventName\n                  eventMapping:(NSDictionary<NSString *, id> *)eventMapping\n{\n  NSNumber *nodeTag = [RCTConvert NSNumber:eventMapping[@\"animatedValueTag\"]];\n  RCTAnimatedNode *node = _animationNodes[nodeTag];\n\n  if (!node) {\n    RCTLogError(@\"Animated node with tag %@ does not exists\", nodeTag);\n    return;\n  }\n\n  if (![node isKindOfClass:[RCTValueAnimatedNode class]]) {\n    RCTLogError(@\"Animated node connected to event should be of type RCTValueAnimatedNode\");\n    return;\n  }\n\n  NSArray<NSString *> *eventPath = [RCTConvert NSStringArray:eventMapping[@\"nativeEventPath\"]];\n\n  RCTEventAnimation *driver =\n    [[RCTEventAnimation alloc] initWithEventPath:eventPath valueNode:(RCTValueAnimatedNode *)node];\n\n  NSString *key = [NSString stringWithFormat:@\"%@%@\", viewTag, eventName];\n  if (_eventDrivers[key] != nil) {\n    [_eventDrivers[key] addObject:driver];\n  } else {\n    NSMutableArray<RCTEventAnimation *> *drivers = [NSMutableArray new];\n    [drivers addObject:driver];\n    _eventDrivers[key] = drivers;\n  }\n}\n\n- (void)removeAnimatedEventFromView:(nonnull NSNumber *)viewTag\n                          eventName:(nonnull NSString *)eventName\n                    animatedNodeTag:(nonnull NSNumber *)animatedNodeTag\n{\n  NSString *key = [NSString stringWithFormat:@\"%@%@\", viewTag, eventName];\n  if (_eventDrivers[key] != nil) {\n    if (_eventDrivers[key].count == 1) {\n      [_eventDrivers removeObjectForKey:key];\n    } else {\n      NSMutableArray<RCTEventAnimation *> *driversForKey = _eventDrivers[key];\n      for (NSUInteger i = 0; i < driversForKey.count; i++) {\n        if (driversForKey[i].valueNode.nodeTag == animatedNodeTag) {\n          [driversForKey removeObjectAtIndex:i];\n          break;\n        }\n      }\n    }\n  }\n}\n\n- (void)handleAnimatedEvent:(id<RCTEvent>)event\n{\n  if (_eventDrivers.count == 0) {\n    return;\n  }\n\n  NSString *key = [NSString stringWithFormat:@\"%@%@\", event.viewTag, event.eventName];\n  NSMutableArray<RCTEventAnimation *> *driversForKey = _eventDrivers[key];\n  if (driversForKey) {\n    for (RCTEventAnimation *driver in driversForKey) {\n      [self stopAnimationsForNode:driver.valueNode];\n      [driver updateWithEvent:event];\n    }\n\n    [self updateAnimations];\n  }\n}\n\n#pragma mark -- Listeners\n\n- (void)startListeningToAnimatedNodeValue:(nonnull NSNumber *)tag\n                            valueObserver:(id<RCTValueAnimatedNodeObserver>)valueObserver\n{\n  RCTAnimatedNode *node = _animationNodes[tag];\n  if ([node isKindOfClass:[RCTValueAnimatedNode class]]) {\n    ((RCTValueAnimatedNode *)node).valueObserver = valueObserver;\n  }\n}\n\n- (void)stopListeningToAnimatedNodeValue:(nonnull NSNumber *)tag\n{\n  RCTAnimatedNode *node = _animationNodes[tag];\n  if ([node isKindOfClass:[RCTValueAnimatedNode class]]) {\n    ((RCTValueAnimatedNode *)node).valueObserver = nil;\n  }\n}\n\n\n#pragma mark -- Animation Loop\n\n- (void)startAnimationLoopIfNeeded\n{\n  if (!_displayLink && _activeAnimations.count > 0) {\n      _displayLink = [NSTimer\n                     timerWithTimeInterval:RCT_TIME_PER_FRAME\n                     target:self\n                     selector:@selector(stepAnimations:)\n                     userInfo:nil\n                     repeats:YES];\n\n    [[NSRunLoop mainRunLoop] addTimer:_displayLink forMode:NSRunLoopCommonModes];\n  }\n}\n\n- (void)stopAnimationLoopIfNeeded\n{\n  if (_activeAnimations.count == 0) {\n    [self stopAnimationLoop];\n  }\n}\n\n- (void)stopAnimationLoop\n{\n  if (_displayLink) {\n    [_displayLink invalidate];\n    _displayLink = nil;\n  }\n}\n\n- (void)stepAnimations:(NSTimer *)timer\n{\n  NSTimeInterval time = timer.fireDate.timeIntervalSince1970;\n  for (id<RCTAnimationDriver> animationDriver in _activeAnimations) {\n    [animationDriver stepAnimationWithTime:time];\n  }\n\n  [self updateAnimations];\n\n  for (id<RCTAnimationDriver> animationDriver in [_activeAnimations copy]) {\n    if (animationDriver.animationHasFinished) {\n      [animationDriver stopAnimation];\n      [_activeAnimations removeObject:animationDriver];\n    }\n  }\n\n  [self stopAnimationLoopIfNeeded];\n}\n\n\n#pragma mark -- Updates\n\n- (void)updateAnimations\n{\n  [_animationNodes enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, RCTAnimatedNode *node, BOOL *stop) {\n    if (node.needsUpdate) {\n      [node updateNodeIfNecessary];\n    }\n  }];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/NavigationExperimental/NavigationReducer.js",
    "content": ""
  },
  {
    "path": "Libraries/Network/FormData.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule FormData\n * @flow\n */\n'use strict';\n\ntype FormDataValue = any;\ntype FormDataNameValuePair = [string, FormDataValue];\n\ntype Headers = {[name: string]: string};\ntype FormDataPart = {\n  string: string,\n  headers: Headers,\n} | {\n  uri: string,\n  headers: Headers,\n  name?: string,\n  type?: string,\n};\n\n/**\n * Polyfill for XMLHttpRequest2 FormData API, allowing multipart POST requests\n * with mixed data (string, native files) to be submitted via XMLHttpRequest.\n *\n * Example:\n *\n *   var photo = {\n *     uri: uriFromCameraRoll,\n *     type: 'image/jpeg',\n *     name: 'photo.jpg',\n *   };\n *\n *   var body = new FormData();\n *   body.append('authToken', 'secret');\n *   body.append('photo', photo);\n *   body.append('title', 'A beautiful photo!');\n *\n *   xhr.open('POST', serverURL);\n *   xhr.send(body);\n */\nclass FormData {\n  _parts: Array<FormDataNameValuePair>;\n\n  constructor() {\n    this._parts = [];\n  }\n\n  append(key: string, value: FormDataValue) {\n    // The XMLHttpRequest spec doesn't specify if duplicate keys are allowed.\n    // MDN says that any new values should be appended to existing values.\n    // In any case, major browsers allow duplicate keys, so that's what we'll do\n    // too. They'll simply get appended as additional form data parts in the\n    // request body, leaving the server to deal with them.\n    this._parts.push([key, value]);\n  }\n\n  getParts(): Array<FormDataPart> {\n    return this._parts.map(([name, value]) => {\n      var contentDisposition = 'form-data; name=\"' + name + '\"';\n\n      var headers: Headers = {'content-disposition': contentDisposition};\n\n      // The body part is a \"blob\", which in React Native just means\n      // an object with a `uri` attribute. Optionally, it can also\n      // have a `name` and `type` attribute to specify filename and\n      // content type (cf. web Blob interface.)\n      if (typeof value === 'object' && value) {\n        if (typeof value.name === 'string') {\n          headers['content-disposition'] += '; filename=\"' + value.name + '\"';\n        }\n        if (typeof value.type === 'string') {\n          headers['content-type'] = value.type;\n        }\n        return {...value, headers, fieldName: name};\n      }\n      // Convert non-object values to strings as per FormData.append() spec\n      return {string: String(value), headers, fieldName: name};\n    });\n  }\n}\n\nmodule.exports = FormData;\n"
  },
  {
    "path": "Libraries/Network/NetInfo.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule NetInfo\n * @flow\n */\n'use strict';\n\nconst Map = require('Map');\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst NativeModules = require('NativeModules');\nconst Platform = require('Platform');\nconst RCTNetInfo = NativeModules.NetInfo;\n\nconst NetInfoEventEmitter = new NativeEventEmitter(RCTNetInfo);\n\nconst DEVICE_CONNECTIVITY_EVENT = 'networkStatusDidChange';\n\ntype ChangeEventName = $Enum<{\n  connectionChange: string,\n  change: string,\n}>;\n\ntype ReachabilityStateIOS = $Enum<{\n  cell: string,\n  none: string,\n  unknown: string,\n  wifi: string,\n}>;\n\ntype ConnectivityStateAndroid = $Enum<{\n  NONE: string,\n  MOBILE: string,\n  WIFI: string,\n  MOBILE_MMS: string,\n  MOBILE_SUPL: string,\n  MOBILE_DUN: string,\n  MOBILE_HIPRI: string,\n  WIMAX: string,\n  BLUETOOTH: string,\n  DUMMY: string,\n  ETHERNET: string,\n  MOBILE_FOTA: string,\n  MOBILE_IMS: string,\n  MOBILE_CBS: string,\n  WIFI_P2P: string,\n  MOBILE_IA: string,\n  MOBILE_EMERGENCY: string,\n  PROXY: string,\n  VPN: string,\n  UNKNOWN: string,\n}>;\n\n\nconst _subscriptions = new Map();\n\nlet _isConnectedDeprecated;\nif (Platform.OS === 'ios' || Platform.OS === 'macos') {\n  _isConnectedDeprecated = function(\n    reachability: ReachabilityStateIOS,\n  ): bool {\n    return reachability !== 'none' && reachability !== 'unknown';\n  };\n} else if (Platform.OS === 'android') {\n  _isConnectedDeprecated = function(\n      connectionType: ConnectivityStateAndroid,\n    ): bool {\n    return connectionType !== 'NONE' && connectionType !== 'UNKNOWN';\n  };\n}\n\nfunction _isConnected(connection) {\n  return connection.type !== 'none' && connection.type !== 'unknown';\n}\n\nconst _isConnectedSubscriptions = new Map();\n\n/**\n * NetInfo exposes info about online/offline status\n *\n * ```\n * NetInfo.getConnectionInfo().then((connectionInfo) => {\n *   console.log('Initial, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);\n * });\n * function handleFirstConnectivityChange(connectionInfo) {\n *   console.log('First change, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);\n *   NetInfo.removeEventListener(\n *     'connectionChange',\n *     handleFirstConnectivityChange\n *   );\n * }\n * NetInfo.addEventListener(\n *   'connectionChange',\n *   handleFirstConnectivityChange\n * );\n * ```\n *\n * ### ConnectionType enum\n *\n * `ConnectionType` describes the type of connection the device is using to communicate with the network.\n *\n * Cross platform values for `ConnectionType`:\n * - `none` - device is offline\n * - `wifi` - device is online and connected via wifi, or is the iOS simulator\n * - `cellular` - device is connected via Edge, 3G, WiMax, or LTE\n * - `unknown` - error case and the network status is unknown\n *\n * Android-only values for `ConnectionType`:\n * - `bluetooth` - device is connected via Bluetooth\n * - `ethernet` - device is connected via Ethernet\n * - `wimax` - device is connected via WiMAX\n *\n * ### EffectiveConnectionType enum\n *\n * Cross platform values for `EffectiveConnectionType`:\n * - `2g`\n * - `3g`\n * - `4g`\n * - `unknown`\n *\n * ### Android\n *\n * To request network info, you need to add the following line to your\n * app's `AndroidManifest.xml`:\n *\n * `<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />`\n *\n * ### isConnectionExpensive\n *\n * Available on Android. Detect if the current active connection is metered or not. A network is\n * classified as metered when the user is sensitive to heavy data usage on that connection due to\n * monetary costs, data limitations or battery/performance issues.\n *\n * ```\n * NetInfo.isConnectionExpensive()\n * .then(isConnectionExpensive => {\n *   console.log('Connection is ' + (isConnectionExpensive ? 'Expensive' : 'Not Expensive'));\n * })\n * .catch(error => {\n *   console.error(error);\n * });\n * ```\n *\n * ### isConnected\n *\n * Available on all platforms. Asynchronously fetch a boolean to determine\n * internet connectivity.\n *\n * ```\n * NetInfo.isConnected.fetch().then(isConnected => {\n *   console.log('First, is ' + (isConnected ? 'online' : 'offline'));\n * });\n * function handleFirstConnectivityChange(isConnected) {\n *   console.log('Then, is ' + (isConnected ? 'online' : 'offline'));\n *   NetInfo.isConnected.removeEventListener(\n *     'connectionChange',\n *     handleFirstConnectivityChange\n *   );\n * }\n * NetInfo.isConnected.addEventListener(\n *   'connectionChange',\n *   handleFirstConnectivityChange\n * );\n * ```\n *\n * ### Connectivity Types (deprecated)\n *\n * The following connectivity types are deprecated. They're used by the deprecated APIs `fetch` and the `change` event.\n *\n * iOS connectivity types (deprecated):\n * - `none` - device is offline\n * - `wifi` - device is online and connected via wifi, or is the iOS simulator\n * - `cell` - device is connected via Edge, 3G, WiMax, or LTE\n * - `unknown` - error case and the network status is unknown\n *\n * Android connectivity types (deprecated).\n * - `NONE` - device is offline\n * - `BLUETOOTH` - The Bluetooth data connection.\n * - `DUMMY` -  Dummy data connection.\n * - `ETHERNET` - The Ethernet data connection.\n * - `MOBILE` - The Mobile data connection.\n * - `MOBILE_DUN` - A DUN-specific Mobile data connection.\n * - `MOBILE_HIPRI` - A High Priority Mobile data connection.\n * - `MOBILE_MMS` - An MMS-specific Mobile data connection.\n * - `MOBILE_SUPL` -  A SUPL-specific Mobile data connection.\n * - `VPN` -  A virtual network using one or more native bearers. Requires API Level 21\n * - `WIFI` - The WIFI data connection.\n * - `WIMAX` -  The WiMAX data connection.\n * - `UNKNOWN` - Unknown data connection.\n *\n * The rest of the connectivity types are hidden by the Android API, but can be used if necessary.\n */\nconst NetInfo = {\n  /**\n   * Adds an event handler. Supported events:\n   *\n   * - `connectionChange`: Fires when the network status changes. The argument to the event\n   *   handler is an object with keys:\n   *   - `type`: A `ConnectionType` (listed above)\n   *   - `effectiveType`: An `EffectiveConnectionType` (listed above)\n   * - `change`: This event is deprecated. Listen to `connectionChange` instead. Fires when\n   *   the network status changes. The argument to the event handler is one of the deprecated\n   *   connectivity types listed above.\n   */\n  addEventListener(\n    eventName: ChangeEventName,\n    handler: Function\n  ): {remove: () => void} {\n    let listener;\n    if (eventName === 'connectionChange') {\n      listener = NetInfoEventEmitter.addListener(\n        DEVICE_CONNECTIVITY_EVENT,\n        (appStateData) => {\n          handler({\n            type: appStateData.connectionType,\n            effectiveType: appStateData.effectiveConnectionType\n          });\n        }\n      );\n    } else if (eventName === 'change') {\n      console.warn('NetInfo\\'s \"change\" event is deprecated. Listen to the \"connectionChange\" event instead.');\n\n      listener = NetInfoEventEmitter.addListener(\n        DEVICE_CONNECTIVITY_EVENT,\n        (appStateData) => {\n          handler(appStateData.network_info);\n        }\n      );\n    } else {\n      console.warn('Trying to subscribe to unknown event: \"' + eventName + '\"');\n      return {\n        remove: () => {}\n      };\n    }\n\n    _subscriptions.set(handler, listener);\n    return {\n      remove: () => NetInfo.removeEventListener(eventName, handler)\n    };\n  },\n\n  /**\n   * Removes the listener for network status changes.\n   */\n  removeEventListener(\n    eventName: ChangeEventName,\n    handler: Function\n  ): void {\n    const listener = _subscriptions.get(handler);\n    if (!listener) {\n      return;\n    }\n    listener.remove();\n    _subscriptions.delete(handler);\n  },\n\n  /**\n   * This function is deprecated. Use `getConnectionInfo` instead. Returns a promise that\n   * resolves with one of the deprecated connectivity types listed above.\n   */\n  fetch(): Promise<any> {\n    console.warn('NetInfo.fetch() is deprecated. Use NetInfo.getConnectionInfo() instead.');\n    return RCTNetInfo.getCurrentConnectivity().then(resp => resp.network_info);\n  },\n\n  /**\n   * Returns a promise that resolves to an object with `type` and `effectiveType` keys\n   * whose values are a `ConnectionType` and an `EffectiveConnectionType`, (described above),\n   * respectively.\n   */\n  getConnectionInfo(): Promise<any> {\n    return RCTNetInfo.getCurrentConnectivity().then(resp => {\n      return {\n        type: resp.connectionType,\n        effectiveType: resp.effectiveConnectionType,\n      };\n    });\n  },\n\n  /**\n   * An object with the same methods as above but the listener receives a\n   * boolean which represents the internet connectivity.\n   * Use this if you are only interested with whether the device has internet\n   * connectivity.\n   */\n  isConnected: {\n    addEventListener(\n      eventName: ChangeEventName,\n      handler: Function\n    ): {remove: () => void} {\n      const listener = (connection) => {\n        if (eventName === 'change') {\n          handler(_isConnectedDeprecated(connection));\n        } else if (eventName === 'connectionChange') {\n          handler(_isConnected(connection));\n        }\n      };\n      _isConnectedSubscriptions.set(handler, listener);\n      NetInfo.addEventListener(\n        eventName,\n        listener\n      );\n      return {\n        remove: () => NetInfo.isConnected.removeEventListener(eventName, handler)\n      };\n    },\n\n    removeEventListener(\n      eventName: ChangeEventName,\n      handler: Function\n    ): void {\n      const listener = _isConnectedSubscriptions.get(handler);\n      NetInfo.removeEventListener(\n        eventName,\n        /* $FlowFixMe(>=0.36.0 site=react_native_fb,react_native_oss) Flow error\n         * detected during the deploy of Flow v0.36.0. To see the error, remove\n         * this comment and run Flow */\n        listener\n      );\n      _isConnectedSubscriptions.delete(handler);\n    },\n\n    fetch(): Promise<any> {\n      return NetInfo.getConnectionInfo().then(_isConnected);\n    },\n  },\n\n  isConnectionExpensive(): Promise<boolean> {\n    return (\n      Platform.OS === 'android' ? RCTNetInfo.isConnectionMetered() : Promise.reject(new Error('Currently not supported on iOS'))\n    );\n  },\n};\n\nmodule.exports = NetInfo;\n"
  },
  {
    "path": "Libraries/Network/RCTDataRequestHandler.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTInvalidating.h>\n#import <React/RCTURLRequestHandler.h>\n\n/**\n * This is the default RCTURLRequestHandler implementation for data URL requests.\n */\n@interface RCTDataRequestHandler : NSObject <RCTURLRequestHandler, RCTInvalidating>\n\n@end\n"
  },
  {
    "path": "Libraries/Network/RCTDataRequestHandler.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDataRequestHandler.h\"\n\n@implementation RCTDataRequestHandler\n{\n  NSOperationQueue *_queue;\n}\n\nRCT_EXPORT_MODULE()\n\n- (void)invalidate\n{\n  [_queue cancelAllOperations];\n  _queue = nil;\n}\n\n- (BOOL)canHandleRequest:(NSURLRequest *)request\n{\n  return [request.URL.scheme caseInsensitiveCompare:@\"data\"] == NSOrderedSame;\n}\n\n- (NSOperation *)sendRequest:(NSURLRequest *)request\n                withDelegate:(id<RCTURLRequestDelegate>)delegate\n{\n  // Lazy setup\n  if (!_queue) {\n    _queue = [NSOperationQueue new];\n    _queue.maxConcurrentOperationCount = 2;\n  }\n\n  __weak __block NSBlockOperation *weakOp;\n  __block NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{\n\n    // Get mime type\n    NSRange firstSemicolon = [request.URL.resourceSpecifier rangeOfString:@\";\"];\n    NSString *mimeType = firstSemicolon.length ? [request.URL.resourceSpecifier substringToIndex:firstSemicolon.location] : nil;\n\n    // Send response\n    NSURLResponse *response = [[NSURLResponse alloc] initWithURL:request.URL\n                                                        MIMEType:mimeType\n                                           expectedContentLength:-1\n                                                textEncodingName:nil];\n\n    [delegate URLRequest:weakOp didReceiveResponse:response];\n\n    // Load data\n    NSError *error;\n    NSData *data = [NSData dataWithContentsOfURL:request.URL\n                                         options:NSDataReadingMappedIfSafe\n                                           error:&error];\n    if (data) {\n      [delegate URLRequest:weakOp didReceiveData:data];\n    }\n    [delegate URLRequest:weakOp didCompleteWithError:error];\n  }];\n\n  weakOp = op;\n  [_queue addOperation:op];\n  return op;\n}\n\n- (void)cancelRequest:(NSOperation *)op\n{\n  [op cancel];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Network/RCTFileRequestHandler.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTInvalidating.h>\n#import <React/RCTURLRequestHandler.h>\n\n/**\n * This is the default RCTURLRequestHandler implementation for file requests.\n */\n@interface RCTFileRequestHandler : NSObject <RCTURLRequestHandler, RCTInvalidating>\n\n@end\n"
  },
  {
    "path": "Libraries/Network/RCTFileRequestHandler.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTFileRequestHandler.h\"\n\n//#import <MobileCoreServices/MobileCoreServices.h>\n\n#import <React/RCTUtils.h>\n\n@implementation RCTFileRequestHandler\n{\n  NSOperationQueue *_fileQueue;\n}\n\nRCT_EXPORT_MODULE()\n\n- (void)invalidate\n{\n  [_fileQueue cancelAllOperations];\n  _fileQueue = nil;\n}\n\n- (BOOL)canHandleRequest:(NSURLRequest *)request\n{\n  return\n  [request.URL.scheme caseInsensitiveCompare:@\"file\"] == NSOrderedSame\n  && !RCTIsBundleAssetURL(request.URL);\n}\n\n- (NSOperation *)sendRequest:(NSURLRequest *)request\n                withDelegate:(id<RCTURLRequestDelegate>)delegate\n{\n  // Lazy setup\n  if (!_fileQueue) {\n    _fileQueue = [NSOperationQueue new];\n    _fileQueue.maxConcurrentOperationCount = 4;\n  }\n\n  __weak __block NSBlockOperation *weakOp;\n  __block NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{\n\n    // Get content length\n    NSError *error = nil;\n    NSFileManager *fileManager = [NSFileManager new];\n    NSDictionary<NSString *, id> *fileAttributes = [fileManager attributesOfItemAtPath:request.URL.path error:&error];\n    if (!fileAttributes) {\n      [delegate URLRequest:weakOp didCompleteWithError:error];\n      return;\n    }\n\n    // Get mime type\n    NSString *fileExtension = [request.URL pathExtension];\n    NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(\n      kUTTagClassFilenameExtension, (__bridge CFStringRef)fileExtension, NULL);\n    NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass(\n      (__bridge CFStringRef)UTI, kUTTagClassMIMEType);\n\n    // Send response\n    NSURLResponse *response = [[NSURLResponse alloc] initWithURL:request.URL\n                                                        MIMEType:contentType\n                                           expectedContentLength:[fileAttributes[NSFileSize] ?: @-1 integerValue]\n                                                textEncodingName:nil];\n\n    [delegate URLRequest:weakOp didReceiveResponse:response];\n\n    // Load data\n    NSData *data = [NSData dataWithContentsOfURL:request.URL\n                                         options:NSDataReadingMappedIfSafe\n                                           error:&error];\n    if (data) {\n      [delegate URLRequest:weakOp didReceiveData:data];\n    }\n    [delegate URLRequest:weakOp didCompleteWithError:error];\n  }];\n\n  weakOp = op;\n  [_fileQueue addOperation:op];\n  return op;\n}\n\n- (void)cancelRequest:(NSOperation *)op\n{\n  [op cancel];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Network/RCTHTTPRequestHandler.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTInvalidating.h>\n#import <React/RCTURLRequestHandler.h>\n\n/**\n * This is the default RCTURLRequestHandler implementation for HTTP requests.\n */\n@interface RCTHTTPRequestHandler : NSObject <RCTURLRequestHandler, RCTInvalidating>\n\n@end\n"
  },
  {
    "path": "Libraries/Network/RCTHTTPRequestHandler.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTHTTPRequestHandler.h\"\n\n#import <mutex>\n\n#import \"RCTNetworking.h\"\n\n@interface RCTHTTPRequestHandler () <NSURLSessionDataDelegate>\n\n@end\n\n@implementation RCTHTTPRequestHandler\n{\n  NSMapTable *_delegates;\n  NSURLSession *_session;\n  std::mutex _mutex;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n- (void)invalidate\n{\n  [_session invalidateAndCancel];\n  _session = nil;\n}\n\n- (BOOL)isValid\n{\n  // if session == nil and delegates != nil, we've been invalidated\n  return _session || !_delegates;\n}\n\n#pragma mark - NSURLRequestHandler\n\n- (BOOL)canHandleRequest:(NSURLRequest *)request\n{\n  static NSSet<NSString *> *schemes = nil;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    // technically, RCTHTTPRequestHandler can handle file:// as well,\n    // but it's less efficient than using RCTFileRequestHandler\n    schemes = [[NSSet alloc] initWithObjects:@\"http\", @\"https\", nil];\n  });\n  return [schemes containsObject:request.URL.scheme.lowercaseString];\n}\n\n- (NSURLSessionDataTask *)sendRequest:(NSURLRequest *)request\n                         withDelegate:(id<RCTURLRequestDelegate>)delegate\n{\n  // Lazy setup\n  if (!_session && [self isValid]) {\n    NSOperationQueue *callbackQueue = [NSOperationQueue new];\n    callbackQueue.maxConcurrentOperationCount = 1;\n    callbackQueue.underlyingQueue = [[_bridge networking] methodQueue];\n    NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];\n    [configuration setHTTPShouldSetCookies:YES];\n    [configuration setHTTPCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];\n    [configuration setHTTPCookieStorage:[NSHTTPCookieStorage sharedHTTPCookieStorage]];\n    _session = [NSURLSession sessionWithConfiguration:configuration\n                                             delegate:self\n                                        delegateQueue:callbackQueue];\n\n    std::lock_guard<std::mutex> lock(_mutex);\n    _delegates = [[NSMapTable alloc] initWithKeyOptions:NSPointerFunctionsStrongMemory\n                                           valueOptions:NSPointerFunctionsStrongMemory\n                                               capacity:0];\n  }\n\n  NSURLSessionDataTask *task = [_session dataTaskWithRequest:request];\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n    [_delegates setObject:delegate forKey:task];\n  }\n  [task resume];\n  return task;\n}\n\n- (void)cancelRequest:(NSURLSessionDataTask *)task\n{\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n    [_delegates removeObjectForKey:task];\n  }\n  [task cancel];\n}\n\n#pragma mark - NSURLSession delegate\n\n- (void)URLSession:(NSURLSession *)session\n              task:(NSURLSessionTask *)task\n   didSendBodyData:(int64_t)bytesSent\n    totalBytesSent:(int64_t)totalBytesSent\ntotalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend\n{\n  id<RCTURLRequestDelegate> delegate;\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n    delegate = [_delegates objectForKey:task];\n  }\n  [delegate URLRequest:task didSendDataWithProgress:totalBytesSent];\n}\n\n- (void)URLSession:(NSURLSession *)session\n          dataTask:(NSURLSessionDataTask *)task\ndidReceiveResponse:(NSURLResponse *)response\n completionHandler:(void (^)(NSURLSessionResponseDisposition))completionHandler\n{\n  id<RCTURLRequestDelegate> delegate;\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n    delegate = [_delegates objectForKey:task];\n  }\n  [delegate URLRequest:task didReceiveResponse:response];\n  completionHandler(NSURLSessionResponseAllow);\n}\n\n- (void)URLSession:(NSURLSession *)session\n          dataTask:(NSURLSessionDataTask *)task\n    didReceiveData:(NSData *)data\n{\n  id<RCTURLRequestDelegate> delegate;\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n    delegate = [_delegates objectForKey:task];\n  }\n  [delegate URLRequest:task didReceiveData:data];\n}\n\n- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error\n{\n  id<RCTURLRequestDelegate> delegate;\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n    delegate = [_delegates objectForKey:task];\n    [_delegates removeObjectForKey:task];\n  }\n  [delegate URLRequest:task didCompleteWithError:error];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Network/RCTNetInfo.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <SystemConfiguration/SystemConfiguration.h>\n\n#import <React/RCTEventEmitter.h>\n\n@interface RCTNetInfo : RCTEventEmitter\n\n- (instancetype)initWithHost:(NSString *)host;\n\n@end\n"
  },
  {
    "path": "Libraries/Network/RCTNetInfo.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTNetInfo.h\"\n\n#if !TARGET_OS_TV\n  #import <CoreTelephony/CTTelephonyNetworkInfo.h>\n#endif\n#import <React/RCTAssert.h>\n#import <React/RCTBridge.h>\n#import <React/RCTEventDispatcher.h>\n\n// Based on the ConnectionType enum described in the W3C Network Information API spec\n// (https://wicg.github.io/netinfo/).\nstatic NSString *const RCTConnectionTypeUnknown = @\"unknown\";\nstatic NSString *const RCTConnectionTypeNone = @\"none\";\nstatic NSString *const RCTConnectionTypeWifi = @\"wifi\";\nstatic NSString *const RCTConnectionTypeCellular = @\"cellular\";\n\n// Based on the EffectiveConnectionType enum described in the W3C Network Information API spec\n// (https://wicg.github.io/netinfo/).\nstatic NSString *const RCTEffectiveConnectionTypeUnknown = @\"unknown\";\nstatic NSString *const RCTEffectiveConnectionType2g = @\"2g\";\nstatic NSString *const RCTEffectiveConnectionType3g = @\"3g\";\nstatic NSString *const RCTEffectiveConnectionType4g = @\"4g\";\n\n// The RCTReachabilityState* values are deprecated.\nstatic NSString *const RCTReachabilityStateUnknown = @\"unknown\";\nstatic NSString *const RCTReachabilityStateNone = @\"none\";\nstatic NSString *const RCTReachabilityStateWifi = @\"wifi\";\nstatic NSString *const RCTReachabilityStateCell = @\"cell\";\n\n@implementation RCTNetInfo\n{\n  SCNetworkReachabilityRef _reachability;\n  NSString *_connectionType;\n  NSString *_effectiveConnectionType;\n  NSString *_statusDeprecated;\n  NSString *_host;\n}\n\nRCT_EXPORT_MODULE()\n\nstatic void RCTReachabilityCallback(__unused SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void *info)\n{\n  RCTNetInfo *self = (__bridge id)info;\n  NSString *connectionType = RCTConnectionTypeUnknown;\n  NSString *effectiveConnectionType = RCTEffectiveConnectionTypeUnknown;\n  NSString *status = RCTReachabilityStateUnknown;\n  if ((flags & kSCNetworkReachabilityFlagsReachable) == 0 ||\n      (flags & kSCNetworkReachabilityFlagsConnectionRequired) != 0) {\n    connectionType = RCTConnectionTypeNone;\n    status = RCTReachabilityStateNone;\n  }\n  \n#if !TARGET_OS_TV\n  \n//  else if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) {\n//    connectionType = RCTConnectionTypeCellular;\n//    status = RCTReachabilityStateCell;\n//\n//    CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init];\n//    if (netinfo) {\n//      if ([netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS] ||\n//          [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyEdge] ||\n//          [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMA1x]) {\n//        effectiveConnectionType = RCTEffectiveConnectionType2g;\n//      } else if ([netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyWCDMA] ||\n//                 [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSDPA] ||\n//                 [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSUPA] ||\n//                 [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0] ||\n//                 [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA] ||\n//                 [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB] ||\n//                 [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyeHRPD]) {\n//        effectiveConnectionType = RCTEffectiveConnectionType3g;\n//      } else if ([netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) {\n//        effectiveConnectionType = RCTEffectiveConnectionType4g;\n//      }\n//    }\n//  }\n  \n#endif\n  \n  else {\n    connectionType = RCTConnectionTypeWifi;\n    status = RCTReachabilityStateWifi;\n  }\n  \n  if (![connectionType isEqualToString:self->_connectionType] ||\n      ![effectiveConnectionType isEqualToString:self->_effectiveConnectionType] ||\n      ![status isEqualToString:self->_statusDeprecated]) {\n    self->_connectionType = connectionType;\n    self->_effectiveConnectionType = effectiveConnectionType;\n    self->_statusDeprecated = status;\n    [self sendEventWithName:@\"networkStatusDidChange\" body:@{@\"connectionType\": connectionType,\n                                                             @\"effectiveConnectionType\": effectiveConnectionType,\n                                                             @\"network_info\": status}];\n  }\n}\n\n#pragma mark - Lifecycle\n\n- (instancetype)initWithHost:(NSString *)host\n{\n  RCTAssertParam(host);\n  RCTAssert(![host hasPrefix:@\"http\"], @\"Host value should just contain the domain, not the URL scheme.\");\n\n  if ((self = [self init])) {\n    _host = [host copy];\n  }\n  return self;\n}\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[@\"networkStatusDidChange\"];\n}\n\n- (void)startObserving\n{\n  _connectionType = RCTConnectionTypeUnknown;\n  _effectiveConnectionType = RCTEffectiveConnectionTypeUnknown;\n  _statusDeprecated = RCTReachabilityStateUnknown;\n  _reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, _host.UTF8String ?: \"apple.com\");\n  SCNetworkReachabilityContext context = { 0, ( __bridge void *)self, NULL, NULL, NULL };\n  SCNetworkReachabilitySetCallback(_reachability, RCTReachabilityCallback, &context);\n  SCNetworkReachabilityScheduleWithRunLoop(_reachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);\n}\n\n- (void)stopObserving\n{\n  if (_reachability) {\n    SCNetworkReachabilityUnscheduleFromRunLoop(_reachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);\n    CFRelease(_reachability);\n  }\n}\n\n#pragma mark - Public API\n\nRCT_EXPORT_METHOD(getCurrentConnectivity:(RCTPromiseResolveBlock)resolve\n                  reject:(__unused RCTPromiseRejectBlock)reject)\n{\n  resolve(@{@\"connectionType\": _connectionType ?: RCTConnectionTypeUnknown,\n            @\"effectiveConnectionType\": _effectiveConnectionType ?: RCTEffectiveConnectionTypeUnknown,\n            @\"network_info\": _statusDeprecated ?: RCTReachabilityStateUnknown});\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t134E969A1BCEB7F800AFFDA1 /* RCTDataRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 134E96991BCEB7F800AFFDA1 /* RCTDataRequestHandler.m */; };\n\t\t1372B7371AB03E7B00659ED6 /* RCTNetInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 1372B7361AB03E7B00659ED6 /* RCTNetInfo.m */; };\n\t\t13D6D66A1B5FCF8200883BE9 /* RCTNetworkTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D6D6691B5FCF8200883BE9 /* RCTNetworkTask.m */; };\n\t\t13EF800E1BCBE015003F47DD /* RCTFileRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 13EF800D1BCBE015003F47DD /* RCTFileRequestHandler.m */; };\n\t\t2D3B5F261D9B0EAB00451313 /* RCTNetworkTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D6D6691B5FCF8200883BE9 /* RCTNetworkTask.m */; };\n\t\t2D3B5F271D9B0EB400451313 /* RCTHTTPRequestHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352DA0B81B17855800AA15A8 /* RCTHTTPRequestHandler.mm */; };\n\t\t2D3B5F281D9B0EB400451313 /* RCTFileRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 13EF800D1BCBE015003F47DD /* RCTFileRequestHandler.m */; };\n\t\t2D3B5F291D9B0EB400451313 /* RCTDataRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 134E96991BCEB7F800AFFDA1 /* RCTDataRequestHandler.m */; };\n\t\t2D3B5F2A1D9B0EB400451313 /* RCTNetInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 1372B7361AB03E7B00659ED6 /* RCTNetInfo.m */; };\n\t\t2D3B5F2B1D9B0EB400451313 /* RCTNetworking.mm in Sources */ = {isa = PBXBuildFile; fileRef = 58B512071A9E6CE300147676 /* RCTNetworking.mm */; };\n\t\t352DA0BA1B17855800AA15A8 /* RCTHTTPRequestHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352DA0B81B17855800AA15A8 /* RCTHTTPRequestHandler.mm */; };\n\t\t58B512081A9E6CE300147676 /* RCTNetworking.mm in Sources */ = {isa = PBXBuildFile; fileRef = 58B512071A9E6CE300147676 /* RCTNetworking.mm */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t134E96981BCEB7F800AFFDA1 /* RCTDataRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDataRequestHandler.h; sourceTree = \"<group>\"; };\n\t\t134E96991BCEB7F800AFFDA1 /* RCTDataRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDataRequestHandler.m; sourceTree = \"<group>\"; };\n\t\t1372B7351AB03E7B00659ED6 /* RCTNetInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTNetInfo.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t1372B7361AB03E7B00659ED6 /* RCTNetInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = RCTNetInfo.m; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };\n\t\t13D6D6681B5FCF8200883BE9 /* RCTNetworkTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTNetworkTask.h; sourceTree = \"<group>\"; };\n\t\t13D6D6691B5FCF8200883BE9 /* RCTNetworkTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNetworkTask.m; sourceTree = \"<group>\"; };\n\t\t13EF800C1BCBE015003F47DD /* RCTFileRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTFileRequestHandler.h; sourceTree = \"<group>\"; };\n\t\t13EF800D1BCBE015003F47DD /* RCTFileRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTFileRequestHandler.m; sourceTree = \"<group>\"; };\n\t\t2D2A28541D9B044C00D4039D /* libRCTNetwork-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libRCTNetwork-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t352DA0B71B17855800AA15A8 /* RCTHTTPRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTHTTPRequestHandler.h; sourceTree = \"<group>\"; };\n\t\t352DA0B81B17855800AA15A8 /* RCTHTTPRequestHandler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTHTTPRequestHandler.mm; sourceTree = \"<group>\"; };\n\t\t3D5FA63F1DE4B4790058FD77 /* RCTNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworking.h; sourceTree = \"<group>\"; };\n\t\t58B511DB1A9E6C8500147676 /* libRCTNetwork.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTNetwork.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t58B512071A9E6CE300147676 /* RCTNetworking.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTNetworking.mm; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXGroup section */\n\t\t58B511D21A9E6C8500147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13D6D6681B5FCF8200883BE9 /* RCTNetworkTask.h */,\n\t\t\t\t13D6D6691B5FCF8200883BE9 /* RCTNetworkTask.m */,\n\t\t\t\t352DA0B71B17855800AA15A8 /* RCTHTTPRequestHandler.h */,\n\t\t\t\t352DA0B81B17855800AA15A8 /* RCTHTTPRequestHandler.mm */,\n\t\t\t\t13EF800C1BCBE015003F47DD /* RCTFileRequestHandler.h */,\n\t\t\t\t13EF800D1BCBE015003F47DD /* RCTFileRequestHandler.m */,\n\t\t\t\t134E96981BCEB7F800AFFDA1 /* RCTDataRequestHandler.h */,\n\t\t\t\t134E96991BCEB7F800AFFDA1 /* RCTDataRequestHandler.m */,\n\t\t\t\t1372B7351AB03E7B00659ED6 /* RCTNetInfo.h */,\n\t\t\t\t1372B7361AB03E7B00659ED6 /* RCTNetInfo.m */,\n\t\t\t\t3D5FA63F1DE4B4790058FD77 /* RCTNetworking.h */,\n\t\t\t\t58B512071A9E6CE300147676 /* RCTNetworking.mm */,\n\t\t\t\t58B511DC1A9E6C8500147676 /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t58B511DC1A9E6C8500147676 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t58B511DB1A9E6C8500147676 /* libRCTNetwork.a */,\n\t\t\t\t2D2A28541D9B044C00D4039D /* libRCTNetwork-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t2D2A28531D9B044C00D4039D /* RCTNetwork-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D2A285C1D9B044C00D4039D /* Build configuration list for PBXNativeTarget \"RCTNetwork-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2D2A28501D9B044C00D4039D /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"RCTNetwork-tvOS\";\n\t\t\tproductName = \"RCTNetwork-tvOS\";\n\t\t\tproductReference = 2D2A28541D9B044C00D4039D /* libRCTNetwork-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t58B511DA1A9E6C8500147676 /* RCTNetwork */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTNetwork\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t58B511D71A9E6C8500147676 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTNetwork;\n\t\t\tproductName = RCTDataManager;\n\t\t\tproductReference = 58B511DB1A9E6C8500147676 /* libRCTNetwork.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511D31A9E6C8500147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0810;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t2D2A28531D9B044C00D4039D = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t58B511DA1A9E6C8500147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTNetwork\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511D21A9E6C8500147676;\n\t\t\tproductRefGroup = 58B511DC1A9E6C8500147676 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B511DA1A9E6C8500147676 /* RCTNetwork */,\n\t\t\t\t2D2A28531D9B044C00D4039D /* RCTNetwork-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t2D2A28501D9B044C00D4039D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D3B5F2A1D9B0EB400451313 /* RCTNetInfo.m in Sources */,\n\t\t\t\t2D3B5F261D9B0EAB00451313 /* RCTNetworkTask.m in Sources */,\n\t\t\t\t2D3B5F281D9B0EB400451313 /* RCTFileRequestHandler.m in Sources */,\n\t\t\t\t2D3B5F271D9B0EB400451313 /* RCTHTTPRequestHandler.mm in Sources */,\n\t\t\t\t2D3B5F2B1D9B0EB400451313 /* RCTNetworking.mm in Sources */,\n\t\t\t\t2D3B5F291D9B0EB400451313 /* RCTDataRequestHandler.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t58B511D71A9E6C8500147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13D6D66A1B5FCF8200883BE9 /* RCTNetworkTask.m in Sources */,\n\t\t\t\t13EF800E1BCBE015003F47DD /* RCTFileRequestHandler.m in Sources */,\n\t\t\t\t134E969A1BCEB7F800AFFDA1 /* RCTDataRequestHandler.m in Sources */,\n\t\t\t\t1372B7371AB03E7B00659ED6 /* RCTNetInfo.m in Sources */,\n\t\t\t\t58B512081A9E6CE300147676 /* RCTNetworking.mm in Sources */,\n\t\t\t\t352DA0BA1B17855800AA15A8 /* RCTHTTPRequestHandler.mm in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t2D2A285A1D9B044C00D4039D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D2A285B1D9B044C00D4039D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511ED1A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511EE1A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511F01A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.10;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTNetwork;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511F11A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.10;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTNetwork;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t2D2A285C1D9B044C00D4039D /* Build configuration list for PBXNativeTarget \"RCTNetwork-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D2A285A1D9B044C00D4039D /* Debug */,\n\t\t\t\t2D2A285B1D9B044C00D4039D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTNetwork\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511ED1A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511EE1A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTNetwork\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511F01A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511F11A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511D31A9E6C8500147676 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/Network/RCTNetworkTask.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTURLRequestDelegate.h>\n#import <React/RCTURLRequestHandler.h>\n\ntypedef void (^RCTURLRequestCompletionBlock)(NSURLResponse *response, NSData *data, NSError *error);\ntypedef void (^RCTURLRequestCancellationBlock)(void);\ntypedef void (^RCTURLRequestIncrementalDataBlock)(NSData *data, int64_t progress, int64_t total);\ntypedef void (^RCTURLRequestProgressBlock)(int64_t progress, int64_t total);\ntypedef void (^RCTURLRequestResponseBlock)(NSURLResponse *response);\n\ntypedef NS_ENUM(NSInteger, RCTNetworkTaskStatus) {\n  RCTNetworkTaskPending = 0,\n  RCTNetworkTaskInProgress,\n  RCTNetworkTaskFinished,\n};\n\n@interface RCTNetworkTask : NSObject <RCTURLRequestDelegate>\n\n@property (nonatomic, readonly) NSURLRequest *request;\n@property (nonatomic, readonly) NSNumber *requestID;\n@property (nonatomic, readonly, weak) id requestToken;\n@property (nonatomic, readonly) NSURLResponse *response;\n\n@property (nonatomic, copy) RCTURLRequestCompletionBlock completionBlock;\n@property (nonatomic, copy) RCTURLRequestProgressBlock downloadProgressBlock;\n@property (nonatomic, copy) RCTURLRequestIncrementalDataBlock incrementalDataBlock;\n@property (nonatomic, copy) RCTURLRequestResponseBlock responseBlock;\n@property (nonatomic, copy) RCTURLRequestProgressBlock uploadProgressBlock;\n\n@property (nonatomic, readonly) RCTNetworkTaskStatus status;\n\n- (instancetype)initWithRequest:(NSURLRequest *)request\n                        handler:(id<RCTURLRequestHandler>)handler\n                  callbackQueue:(dispatch_queue_t)callbackQueue NS_DESIGNATED_INITIALIZER;\n\n- (void)start;\n- (void)cancel;\n\n@end\n"
  },
  {
    "path": "Libraries/Network/RCTNetworkTask.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTLog.h>\n#import <React/RCTNetworkTask.h>\n#import <React/RCTUtils.h>\n\n@implementation RCTNetworkTask\n{\n  NSMutableData *_data;\n  id<RCTURLRequestHandler> _handler;\n  dispatch_queue_t _callbackQueue;\n\n  RCTNetworkTask *_selfReference;\n}\n\n- (instancetype)initWithRequest:(NSURLRequest *)request\n                        handler:(id<RCTURLRequestHandler>)handler\n                  callbackQueue:(dispatch_queue_t)callbackQueue\n{\n  RCTAssertParam(request);\n  RCTAssertParam(handler);\n  RCTAssertParam(callbackQueue);\n\n  static NSUInteger requestID = 0;\n\n  if ((self = [super init])) {\n    _requestID = @(requestID++);\n    _request = request;\n    _handler = handler;\n    _callbackQueue = callbackQueue;\n    _status = RCTNetworkTaskPending;\n\n    dispatch_queue_set_specific(callbackQueue, (__bridge void *)self, (__bridge void *)self, NULL);\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (void)invalidate\n{\n  _selfReference = nil;\n  _completionBlock = nil;\n  _downloadProgressBlock = nil;\n  _incrementalDataBlock = nil;\n  _responseBlock = nil;\n  _uploadProgressBlock = nil;\n  _requestToken = nil;\n}\n\n- (void)dispatchCallback:(dispatch_block_t)callback\n{\n  if (dispatch_get_specific((__bridge void *)self) == (__bridge void *)self) {\n    callback();\n  } else {\n    dispatch_async(_callbackQueue, callback);\n  }\n}\n\n- (void)start\n{\n  if (_status != RCTNetworkTaskPending) {\n    RCTLogError(@\"RCTNetworkTask was already started or completed\");\n    return;\n  }\n\n  if (_requestToken == nil) {\n    id token = [_handler sendRequest:_request withDelegate:self];\n    if ([self validateRequestToken:token]) {\n      _selfReference = self;\n      _status = RCTNetworkTaskInProgress;\n    }\n  }\n}\n\n- (void)cancel\n{\n  if (_status == RCTNetworkTaskFinished) {\n    return;\n  }\n\n  _status = RCTNetworkTaskFinished;\n  id token = _requestToken;\n  if (token && [_handler respondsToSelector:@selector(cancelRequest:)]) {\n    [_handler cancelRequest:token];\n  }\n  [self invalidate];\n}\n\n- (BOOL)validateRequestToken:(id)requestToken\n{\n  BOOL valid = YES;\n  if (_requestToken == nil) {\n    if (requestToken == nil) {\n      if (RCT_DEBUG) {\n        RCTLogError(@\"Missing request token for request: %@\", _request);\n      }\n      valid = NO;\n    }\n    _requestToken = requestToken;\n  } else if (![requestToken isEqual:_requestToken]) {\n    if (RCT_DEBUG) {\n      RCTLogError(@\"Unrecognized request token: %@ expected: %@\", requestToken, _requestToken);\n    }\n    valid = NO;\n  }\n\n  if (!valid) {\n    _status = RCTNetworkTaskFinished;\n    if (_completionBlock) {\n      RCTURLRequestCompletionBlock completionBlock = _completionBlock;\n      [self dispatchCallback:^{\n        completionBlock(self->_response, nil, RCTErrorWithMessage(@\"Invalid request token.\"));\n      }];\n    }\n    [self invalidate];\n  }\n  return valid;\n}\n\n- (void)URLRequest:(id)requestToken didSendDataWithProgress:(int64_t)bytesSent\n{\n  if (![self validateRequestToken:requestToken]) {\n    return;\n  }\n\n  if (_uploadProgressBlock) {\n    RCTURLRequestProgressBlock uploadProgressBlock = _uploadProgressBlock;\n    int64_t length = _request.HTTPBody.length;\n    [self dispatchCallback:^{\n      uploadProgressBlock(bytesSent, length);\n    }];\n  }\n}\n\n- (void)URLRequest:(id)requestToken didReceiveResponse:(NSURLResponse *)response\n{\n  if (![self validateRequestToken:requestToken]) {\n    return;\n  }\n\n  _response = response;\n  if (_responseBlock) {\n    RCTURLRequestResponseBlock responseBlock = _responseBlock;\n    [self dispatchCallback:^{\n      responseBlock(response);\n    }];\n  }\n}\n\n- (void)URLRequest:(id)requestToken didReceiveData:(NSData *)data\n{\n  if (![self validateRequestToken:requestToken]) {\n    return;\n  }\n\n  if (!_data) {\n    _data = [NSMutableData new];\n  }\n  [_data appendData:data];\n\n  int64_t length = _data.length;\n  int64_t total = _response.expectedContentLength;\n\n  if (_incrementalDataBlock) {\n    RCTURLRequestIncrementalDataBlock incrementalDataBlock = _incrementalDataBlock;\n    [self dispatchCallback:^{\n      incrementalDataBlock(data, length, total);\n    }];\n  }\n  if (_downloadProgressBlock && total > 0) {\n    RCTURLRequestProgressBlock downloadProgressBlock = _downloadProgressBlock;\n    [self dispatchCallback:^{\n      downloadProgressBlock(length, total);\n    }];\n  }\n}\n\n- (void)URLRequest:(id)requestToken didCompleteWithError:(NSError *)error\n{\n  if (![self validateRequestToken:requestToken]) {\n    return;\n  }\n\n  _status = RCTNetworkTaskFinished;\n  if (_completionBlock) {\n    RCTURLRequestCompletionBlock completionBlock = _completionBlock;\n    [self dispatchCallback:^{\n      completionBlock(self->_response, self->_data, error);\n    }];\n  }\n  [self invalidate];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Network/RCTNetworking.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RCTNetworking\n * @flow\n */\n'use strict';\n\n// Do not require the native RCTNetworking module directly! Use this wrapper module instead.\n// It will add the necessary requestId, so that you don't have to generate it yourself.\nconst MissingNativeEventEmitterShim = require('MissingNativeEventEmitterShim');\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst RCTNetworkingNative = require('NativeModules').Networking;\nconst convertRequestBody = require('convertRequestBody');\n\nimport type {RequestBody} from 'convertRequestBody';\n\ntype Header = [string, string];\n\n// Convert FormData headers to arrays, which are easier to consume in\n// native on Android.\nfunction convertHeadersMapToArray(headers: Object): Array<Header> {\n  const headerArray = [];\n  for (const name in headers) {\n    headerArray.push([name, headers[name]]);\n  }\n  return headerArray;\n}\n\nlet _requestId = 1;\nfunction generateRequestId(): number {\n  return _requestId++;\n}\n\n/**\n * This class is a wrapper around the native RCTNetworking module. It adds a necessary unique\n * requestId to each network request that can be used to abort that request later on.\n */\nclass RCTNetworking extends NativeEventEmitter {\n\n  isAvailable: boolean = true;\n\n  constructor() {\n    super(RCTNetworkingNative);\n  }\n\n  sendRequest(\n    method: string,\n    trackingName: string,\n    url: string,\n    headers: Object,\n    data: RequestBody,\n    responseType: 'text' | 'base64',\n    incrementalUpdates: boolean,\n    timeout: number,\n    callback: (requestId: number) => any,\n    withCredentials: boolean\n  ) {\n    const body = convertRequestBody(data);\n    if (body && body.formData) {\n      body.formData = body.formData.map((part) => ({\n        ...part,\n        headers: convertHeadersMapToArray(part.headers),\n      }));\n    }\n    const requestId = generateRequestId();\n    RCTNetworkingNative.sendRequest(\n      method,\n      url,\n      requestId,\n      convertHeadersMapToArray(headers),\n      {...body, trackingName},\n      responseType,\n      incrementalUpdates,\n      timeout,\n      withCredentials\n    );\n    callback(requestId);\n  }\n\n  abortRequest(requestId: number) {\n    RCTNetworkingNative.abortRequest(requestId);\n  }\n\n  clearCookies(callback: (result: boolean) => any) {\n    RCTNetworkingNative.clearCookies(callback);\n  }\n}\n\nif (__DEV__ && !RCTNetworkingNative) {\n  class MissingNativeRCTNetworkingShim extends MissingNativeEventEmitterShim {\n    constructor() {\n      super('RCTNetworking', 'Networking');\n    }\n\n    sendRequest(...args: Array<any>) {\n      this.throwMissingNativeModule();\n    }\n\n    abortRequest(...args: Array<any>) {\n      this.throwMissingNativeModule();\n    }\n\n    clearCookies(...args: Array<any>) {\n      this.throwMissingNativeModule();\n    }\n  }\n\n  // This module depends on the native `RCTNetworkingNative` module. If you don't include it,\n  // `RCTNetworking.isAvailable` will return `false`, and any method calls will throw.\n  // We reassign the class variable to keep the autodoc generator happy.\n  RCTNetworking = new MissingNativeRCTNetworkingShim();\n} else {\n  RCTNetworking = new RCTNetworking();\n}\n\nmodule.exports = RCTNetworking;\n"
  },
  {
    "path": "Libraries/Network/RCTNetworking.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTEventEmitter.h>\n#import <React/RCTNetworkTask.h>\n\n@interface RCTNetworking : RCTEventEmitter\n\n/**\n * Does a handler exist for the specified request?\n */\n- (BOOL)canHandleRequest:(NSURLRequest *)request;\n\n/**\n * Return an RCTNetworkTask for the specified request. This is useful for\n * invoking the React Native networking stack from within native code.\n */\n- (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request\n                           completionBlock:(RCTURLRequestCompletionBlock)completionBlock;\n\n@end\n\n@interface RCTBridge (RCTNetworking)\n\n@property (nonatomic, readonly) RCTNetworking *networking;\n\n@end\n"
  },
  {
    "path": "Libraries/Network/RCTNetworking.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RCTNetworking\n * @flow\n */\n'use strict';\n\nconst MissingNativeEventEmitterShim = require('MissingNativeEventEmitterShim');\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst RCTNetworkingNative = require('NativeModules').Networking;\nconst convertRequestBody = require('convertRequestBody');\n\nimport type {RequestBody} from 'convertRequestBody';\n\nclass RCTNetworking extends NativeEventEmitter {\n\n  isAvailable: boolean = true;\n\n  constructor() {\n    super(RCTNetworkingNative);\n  }\n\n  sendRequest(\n    method: string,\n    trackingName: string,\n    url: string,\n    headers: Object,\n    data: RequestBody,\n    responseType: 'text' | 'base64',\n    incrementalUpdates: boolean,\n    timeout: number,\n    callback: (requestId: number) => any,\n    withCredentials: boolean\n  ) {\n    const body = convertRequestBody(data);\n    RCTNetworkingNative.sendRequest({\n      method,\n      url,\n      data: {...body, trackingName},\n      headers,\n      responseType,\n      incrementalUpdates,\n      timeout,\n      withCredentials\n    }, callback);\n  }\n\n  abortRequest(requestId: number) {\n    RCTNetworkingNative.abortRequest(requestId);\n  }\n\n  clearCookies(callback: (result: boolean) => any) {\n    RCTNetworkingNative.clearCookies(callback);\n  }\n}\n\nif (__DEV__ && !RCTNetworkingNative) {\n  class MissingNativeRCTNetworkingShim extends MissingNativeEventEmitterShim {\n    constructor() {\n      super('RCTNetworking', 'Networking');\n    }\n\n    sendRequest(...args: Array<any>) {\n      this.throwMissingNativeModule();\n    }\n\n    abortRequest(...args: Array<any>) {\n      this.throwMissingNativeModule();\n    }\n\n    clearCookies(...args: Array<any>) {\n      this.throwMissingNativeModule();\n    }\n  }\n\n  // This module depends on the native `RCTNetworkingNative` module. If you don't include it,\n  // `RCTNetworking.isAvailable` will return `false`, and any method calls will throw.\n  // We reassign the class variable to keep the autodoc generator happy.\n  RCTNetworking = new MissingNativeRCTNetworkingShim();\n} else {\n  RCTNetworking = new RCTNetworking();\n}\n\nmodule.exports = RCTNetworking;\n"
  },
  {
    "path": "Libraries/Network/RCTNetworking.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RCTNetworking\n * @flow\n */\n'use strict';\n\nconst FormData = require('FormData');\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst RCTNetworkingNative = require('NativeModules').Networking;\n\nclass RCTNetworking extends NativeEventEmitter {\n\n  constructor() {\n    super(RCTNetworkingNative);\n  }\n\n  sendRequest(\n    method: string,\n    trackingName: string,\n    url: string,\n    headers: Object,\n    data: string | FormData | {uri: string},\n    responseType: 'text' | 'base64',\n    incrementalUpdates: boolean,\n    timeout: number,\n    callback: (requestId: number) => any\n  ) {\n    const body =\n      typeof data === 'string' ? {string: data} :\n      data instanceof FormData ? {formData: data.getParts()} :\n      data;\n    RCTNetworkingNative.sendRequest({\n      method,\n      url,\n      data: {...body, trackingName},\n      headers,\n      responseType,\n      incrementalUpdates,\n      timeout\n    }, callback);\n  }\n\n  abortRequest(requestId: number) {\n    RCTNetworkingNative.abortRequest(requestId);\n  }\n\n  clearCookies(callback: (result: boolean) => any) {\n    console.warn('RCTNetworking.clearCookies is not supported on iOS');\n  }\n}\n\nmodule.exports = new RCTNetworking();\n"
  },
  {
    "path": "Libraries/Network/RCTNetworking.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n\n#import <mutex>\n\n#import <React/RCTAssert.h>\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTLog.h>\n#import <React/RCTNetworkTask.h>\n#import <React/RCTNetworking.h>\n#import <React/RCTURLRequestHandler.h>\n#import <React/RCTUtils.h>\n\n#import \"RCTHTTPRequestHandler.h\"\n\ntypedef RCTURLRequestCancellationBlock (^RCTHTTPQueryResult)(NSError *error, NSDictionary<NSString *, id> *result);\n\n@interface RCTNetworking ()\n\n- (RCTURLRequestCancellationBlock)processDataForHTTPQuery:(NSDictionary<NSString *, id> *)data\n                                                 callback:(RCTHTTPQueryResult)callback;\n@end\n\n/**\n * Helper to convert FormData payloads into multipart/formdata requests.\n */\n@interface RCTHTTPFormDataHelper : NSObject\n\n@property (nonatomic, weak) RCTNetworking *networker;\n\n@end\n\n@implementation RCTHTTPFormDataHelper\n{\n  NSMutableArray<NSDictionary<NSString *, id> *> *_parts;\n  NSMutableData *_multipartBody;\n  RCTHTTPQueryResult _callback;\n  NSString *_boundary;\n}\n\nstatic NSString *RCTGenerateFormBoundary()\n{\n  const size_t boundaryLength = 70;\n  const char *boundaryChars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.\";\n\n  char *bytes = (char*)malloc(boundaryLength);\n  size_t charCount = strlen(boundaryChars);\n  for (int i = 0; i < boundaryLength; i++) {\n    bytes[i] = boundaryChars[arc4random_uniform((u_int32_t)charCount)];\n  }\n  return [[NSString alloc] initWithBytesNoCopy:bytes length:boundaryLength encoding:NSUTF8StringEncoding freeWhenDone:YES];\n}\n\n- (RCTURLRequestCancellationBlock)process:(NSArray<NSDictionary *> *)formData\n                                 callback:(RCTHTTPQueryResult)callback\n{\n  RCTAssertThread(_networker.methodQueue, @\"process: must be called on method queue\");\n\n  if (formData.count == 0) {\n    return callback(nil, nil);\n  }\n\n  _parts = [formData mutableCopy];\n  _callback = callback;\n  _multipartBody = [NSMutableData new];\n  _boundary = RCTGenerateFormBoundary();\n\n  return [_networker processDataForHTTPQuery:_parts[0] callback:^(NSError *error, NSDictionary<NSString *, id> *result) {\n    return [self handleResult:result error:error];\n  }];\n}\n\n- (RCTURLRequestCancellationBlock)handleResult:(NSDictionary<NSString *, id> *)result\n                                         error:(NSError *)error\n{\n  RCTAssertThread(_networker.methodQueue, @\"handleResult: must be called on method queue\");\n\n  if (error) {\n    return _callback(error, nil);\n  }\n\n  // Start with boundary.\n  [_multipartBody appendData:[[NSString stringWithFormat:@\"--%@\\r\\n\", _boundary]\n                              dataUsingEncoding:NSUTF8StringEncoding]];\n\n  // Print headers.\n  NSMutableDictionary<NSString *, NSString *> *headers = [_parts[0][@\"headers\"] mutableCopy];\n  NSString *partContentType = result[@\"contentType\"];\n  if (partContentType != nil) {\n    headers[@\"content-type\"] = partContentType;\n  }\n  [headers enumerateKeysAndObjectsUsingBlock:^(NSString *parameterKey, NSString *parameterValue, BOOL *stop) {\n    [self->_multipartBody appendData:[[NSString stringWithFormat:@\"%@: %@\\r\\n\", parameterKey, parameterValue]\n                                dataUsingEncoding:NSUTF8StringEncoding]];\n  }];\n\n  // Add the body.\n  [_multipartBody appendData:[@\"\\r\\n\" dataUsingEncoding:NSUTF8StringEncoding]];\n  [_multipartBody appendData:result[@\"body\"]];\n  [_multipartBody appendData:[@\"\\r\\n\" dataUsingEncoding:NSUTF8StringEncoding]];\n\n  [_parts removeObjectAtIndex:0];\n  if (_parts.count) {\n    return [_networker processDataForHTTPQuery:_parts[0] callback:^(NSError *err, NSDictionary<NSString *, id> *res) {\n      return [self handleResult:res error:err];\n    }];\n  }\n\n  // We've processed the last item. Finish and return.\n  [_multipartBody appendData:[[NSString stringWithFormat:@\"--%@--\\r\\n\", _boundary]\n                              dataUsingEncoding:NSUTF8StringEncoding]];\n  NSString *contentType = [NSString stringWithFormat:@\"multipart/form-data; boundary=%@\", _boundary];\n  return _callback(nil, @{@\"body\": _multipartBody, @\"contentType\": contentType});\n}\n\n@end\n\n/**\n * Bridge module that provides the JS interface to the network stack.\n */\n@implementation RCTNetworking\n{\n  NSMutableDictionary<NSNumber *, RCTNetworkTask *> *_tasksByRequestID;\n  std::mutex _handlersLock;\n  NSArray<id<RCTURLRequestHandler>> *_handlers;\n}\n\n@synthesize methodQueue = _methodQueue;\n\nRCT_EXPORT_MODULE()\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[@\"didCompleteNetworkResponse\",\n           @\"didReceiveNetworkResponse\",\n           @\"didSendNetworkData\",\n           @\"didReceiveNetworkIncrementalData\",\n           @\"didReceiveNetworkDataProgress\",\n           @\"didReceiveNetworkData\"];\n}\n\n- (id<RCTURLRequestHandler>)handlerForRequest:(NSURLRequest *)request\n{\n  if (!request.URL) {\n    return nil;\n  }\n\n  {\n    std::lock_guard<std::mutex> lock(_handlersLock);\n\n    if (!_handlers) {\n      // Get handlers, sorted in reverse priority order (highest priority first)\n      _handlers = [[self.bridge modulesConformingToProtocol:@protocol(RCTURLRequestHandler)] sortedArrayUsingComparator:^NSComparisonResult(id<RCTURLRequestHandler> a, id<RCTURLRequestHandler> b) {\n        float priorityA = [a respondsToSelector:@selector(handlerPriority)] ? [a handlerPriority] : 0;\n        float priorityB = [b respondsToSelector:@selector(handlerPriority)] ? [b handlerPriority] : 0;\n        if (priorityA > priorityB) {\n          return NSOrderedAscending;\n        } else if (priorityA < priorityB) {\n          return NSOrderedDescending;\n        } else {\n          return NSOrderedSame;\n        }\n      }];\n    }\n  }\n\n  if (RCT_DEBUG) {\n    // Check for handler conflicts\n    float previousPriority = 0;\n    id<RCTURLRequestHandler> previousHandler = nil;\n    for (id<RCTURLRequestHandler> handler in _handlers) {\n      float priority = [handler respondsToSelector:@selector(handlerPriority)] ? [handler handlerPriority] : 0;\n      if (previousHandler && priority < previousPriority) {\n        return previousHandler;\n      }\n      if ([handler canHandleRequest:request]) {\n        if (previousHandler) {\n          if (priority == previousPriority) {\n            RCTLogError(@\"The RCTURLRequestHandlers %@ and %@ both reported that\"\n                        \" they can handle the request %@, and have equal priority\"\n                        \" (%g). This could result in non-deterministic behavior.\",\n                        handler, previousHandler, request, priority);\n          }\n        } else {\n          previousHandler = handler;\n          previousPriority = priority;\n        }\n      }\n    }\n    return previousHandler;\n  }\n\n  // Normal code path\n  for (id<RCTURLRequestHandler> handler in _handlers) {\n    if ([handler canHandleRequest:request]) {\n      return handler;\n    }\n  }\n  return nil;\n}\n\n- (NSDictionary<NSString *, id> *)stripNullsInRequestHeaders:(NSDictionary<NSString *, id> *)headers\n{\n  NSMutableDictionary *result = [NSMutableDictionary dictionaryWithCapacity:headers.count];\n  for (NSString *key in headers.allKeys) {\n    id val = headers[key];\n    if (val != [NSNull null]) {\n      result[key] = val;\n    }\n  }\n\n  return result;\n}\n\n- (RCTURLRequestCancellationBlock)buildRequest:(NSDictionary<NSString *, id> *)query\n                                 completionBlock:(void (^)(NSURLRequest *request))block\n{\n  RCTAssertThread(_methodQueue, @\"buildRequest: must be called on method queue\");\n\n  NSURL *URL = [RCTConvert NSURL:query[@\"url\"]]; // this is marked as nullable in JS, but should not be null\n  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];\n  request.HTTPMethod = [RCTConvert NSString:RCTNilIfNull(query[@\"method\"])].uppercaseString ?: @\"GET\";\n\n  // Load and set the cookie header.\n  NSArray<NSHTTPCookie *> *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:URL];\n  request.allHTTPHeaderFields = [NSHTTPCookie requestHeaderFieldsWithCookies:cookies];\n\n  // Set supplied headers.\n  NSDictionary *headers = [RCTConvert NSDictionary:query[@\"headers\"]];\n  [headers enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *stop) {\n    if (value) {\n      [request addValue:[RCTConvert NSString:value] forHTTPHeaderField:key];\n    }\n  }];\n\n  request.timeoutInterval = [RCTConvert NSTimeInterval:query[@\"timeout\"]];\n  request.HTTPShouldHandleCookies = [RCTConvert BOOL:query[@\"withCredentials\"]];\n  NSDictionary<NSString *, id> *data = [RCTConvert NSDictionary:RCTNilIfNull(query[@\"data\"])];\n  NSString *trackingName = data[@\"trackingName\"];\n  if (trackingName) {\n    [NSURLProtocol setProperty:trackingName\n                        forKey:@\"trackingName\"\n                     inRequest:request];\n  }\n  return [self processDataForHTTPQuery:data callback:^(NSError *error, NSDictionary<NSString *, id> *result) {\n    if (error) {\n      RCTLogError(@\"Error processing request body: %@\", error);\n      // Ideally we'd circle back to JS here and notify an error/abort on the request.\n      return (RCTURLRequestCancellationBlock)nil;\n    }\n    request.HTTPBody = result[@\"body\"];\n    NSString *dataContentType = result[@\"contentType\"];\n    NSString *requestContentType = [request valueForHTTPHeaderField:@\"Content-Type\"];\n    BOOL isMultipart = [dataContentType hasPrefix:@\"multipart\"];\n\n    // For multipart requests we need to override caller-specified content type with one\n    // from the data object, because it contains the boundary string\n    if (dataContentType && ([requestContentType length] == 0 || isMultipart)) {\n      [request setValue:dataContentType forHTTPHeaderField:@\"Content-Type\"];\n    }\n\n    // Gzip the request body\n    if ([request.allHTTPHeaderFields[@\"Content-Encoding\"] isEqualToString:@\"gzip\"]) {\n      request.HTTPBody = RCTGzipData(request.HTTPBody, -1 /* default */);\n      [request setValue:(@(request.HTTPBody.length)).description forHTTPHeaderField:@\"Content-Length\"];\n    }\n\n    dispatch_async(self->_methodQueue, ^{\n      block(request);\n    });\n\n    return (RCTURLRequestCancellationBlock)nil;\n  }];\n}\n\n- (BOOL)canHandleRequest:(NSURLRequest *)request\n{\n  return [self handlerForRequest:request] != nil;\n}\n\n/**\n * Process the 'data' part of an HTTP query.\n *\n * 'data' can be a JSON value of the following forms:\n *\n * - {\"string\": \"...\"}: a simple JS string that will be UTF-8 encoded and sent as the body\n *\n * - {\"uri\": \"some-uri://...\"}: reference to a system resource, e.g. an image in the asset library\n *\n * - {\"formData\": [...]}: list of data payloads that will be combined into a multipart/form-data request\n *\n * If successful, the callback be called with a result dictionary containing the following (optional) keys:\n *\n * - @\"body\" (NSData): the body of the request\n *\n * - @\"contentType\" (NSString): the content type header of the request\n *\n */\n- (RCTURLRequestCancellationBlock)processDataForHTTPQuery:(nullable NSDictionary<NSString *, id> *)query callback:\n(RCTURLRequestCancellationBlock (^)(NSError *error, NSDictionary<NSString *, id> *result))callback\n{\n  RCTAssertThread(_methodQueue, @\"processDataForHTTPQuery: must be called on method queue\");\n\n  if (!query) {\n    return callback(nil, nil);\n  }\n  NSData *body = [RCTConvert NSData:query[@\"string\"]];\n  if (body) {\n    return callback(nil, @{@\"body\": body});\n  }\n  NSString *base64String = [RCTConvert NSString:query[@\"base64\"]];\n  if (base64String) {\n    NSData *data = [[NSData alloc] initWithBase64EncodedString:base64String options:0];\n    return callback(nil, @{@\"body\": data});\n  }\n  NSURLRequest *request = [RCTConvert NSURLRequest:query[@\"uri\"]];\n  if (request) {\n\n    __block RCTURLRequestCancellationBlock cancellationBlock = nil;\n    RCTNetworkTask *task = [self networkTaskWithRequest:request completionBlock:^(NSURLResponse *response, NSData *data, NSError *error) {\n      dispatch_async(self->_methodQueue, ^{\n        cancellationBlock = callback(error, data ? @{@\"body\": data, @\"contentType\": RCTNullIfNil(response.MIMEType)} : nil);\n      });\n    }];\n\n    [task start];\n\n    __weak RCTNetworkTask *weakTask = task;\n    return ^{\n      [weakTask cancel];\n      if (cancellationBlock) {\n        cancellationBlock();\n      }\n    };\n  }\n  NSArray<NSDictionary *> *formData = [RCTConvert NSDictionaryArray:query[@\"formData\"]];\n  if (formData) {\n    RCTHTTPFormDataHelper *formDataHelper = [RCTHTTPFormDataHelper new];\n    formDataHelper.networker = self;\n    return [formDataHelper process:formData callback:callback];\n  }\n  // Nothing in the data payload, at least nothing we could understand anyway.\n  // Ignore and treat it as if it were null.\n  return callback(nil, nil);\n}\n\n+ (NSString *)decodeTextData:(NSData *)data fromResponse:(NSURLResponse *)response withCarryData:(NSMutableData *)inputCarryData\n{\n  NSStringEncoding encoding = NSUTF8StringEncoding;\n  if (response.textEncodingName) {\n    CFStringEncoding cfEncoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName);\n    encoding = CFStringConvertEncodingToNSStringEncoding(cfEncoding);\n  }\n\n  NSMutableData *currentCarryData = inputCarryData ?: [NSMutableData new];\n  [currentCarryData appendData:data];\n\n  // Attempt to decode text\n  NSString *encodedResponse = [[NSString alloc] initWithData:currentCarryData encoding:encoding];\n\n  if (!encodedResponse && data.length > 0) {\n    if (encoding == NSUTF8StringEncoding && inputCarryData) {\n      // If decode failed, we attempt to trim broken character bytes from the data.\n      // At this time, only UTF-8 support is enabled. Multibyte encodings, such as UTF-16 and UTF-32, require a lot of additional work\n      // to determine wether BOM was included in the first data packet. If so, save it, and attach it to each new data packet. If not,\n      // an encoding has to be selected with a suitable byte order (for ARM iOS, it would be little endianness).\n\n      CFStringEncoding cfEncoding = CFStringConvertNSStringEncodingToEncoding(encoding);\n      // Taking a single unichar is not good enough, due to Unicode combining character sequences or characters outside the BMP.\n      // See https://www.objc.io/issues/9-strings/unicode/#common-pitfalls\n      // We'll attempt with a sequence of two characters, the most common combining character sequence and characters outside the BMP (emojis).\n      CFIndex maxCharLength = CFStringGetMaximumSizeForEncoding(2, cfEncoding);\n\n      NSUInteger removedBytes = 1;\n\n      while (removedBytes < maxCharLength) {\n        encodedResponse = [[NSString alloc] initWithData:[currentCarryData subdataWithRange:NSMakeRange(0, currentCarryData.length - removedBytes)]\n                                                encoding:encoding];\n\n        if (encodedResponse != nil) {\n          break;\n        }\n\n        removedBytes += 1;\n      }\n    } else {\n      // We don't have an encoding, or the encoding is incorrect, so now we try to guess\n      [NSString stringEncodingForData:data\n                      encodingOptions:@{ NSStringEncodingDetectionSuggestedEncodingsKey: @[ @(encoding) ] }\n                      convertedString:&encodedResponse\n                  usedLossyConversion:NULL];\n    }\n  }\n\n  if (inputCarryData) {\n    NSUInteger encodedResponseLength = [encodedResponse dataUsingEncoding:encoding].length;\n\n    // Ensure a valid subrange exists within currentCarryData\n    if (currentCarryData.length >= encodedResponseLength) {\n      NSData *newCarryData = [currentCarryData subdataWithRange:NSMakeRange(encodedResponseLength, currentCarryData.length - encodedResponseLength)];\n      [inputCarryData setData:newCarryData];\n    } else {\n      [inputCarryData setLength:0];\n    }\n  }\n\n  return encodedResponse;\n}\n\n- (void)sendData:(NSData *)data\n    responseType:(NSString *)responseType\n         forTask:(RCTNetworkTask *)task\n{\n  RCTAssertThread(_methodQueue, @\"sendData: must be called on method queue\");\n\n  if (data.length == 0) {\n    return;\n  }\n\n  NSString *responseString;\n  if ([responseType isEqualToString:@\"text\"]) {\n    // No carry storage is required here because the entire data has been loaded.\n    responseString = [RCTNetworking decodeTextData:data fromResponse:task.response withCarryData:nil];\n    if (!responseString) {\n      RCTLogWarn(@\"Received data was not a string, or was not a recognised encoding.\");\n      return;\n    }\n  } else if ([responseType isEqualToString:@\"base64\"]) {\n    responseString = [data base64EncodedStringWithOptions:0];\n  } else {\n    RCTLogWarn(@\"Invalid responseType: %@\", responseType);\n    return;\n  }\n\n  NSArray<id> *responseJSON = @[task.requestID, responseString];\n  [self sendEventWithName:@\"didReceiveNetworkData\" body:responseJSON];\n}\n\n- (void)sendRequest:(NSURLRequest *)request\n       responseType:(NSString *)responseType\n incrementalUpdates:(BOOL)incrementalUpdates\n     responseSender:(RCTResponseSenderBlock)responseSender\n{\n  RCTAssertThread(_methodQueue, @\"sendRequest: must be called on method queue\");\n  __weak __typeof(self) weakSelf = self;\n  __block RCTNetworkTask *task;\n  RCTURLRequestProgressBlock uploadProgressBlock = ^(int64_t progress, int64_t total) {\n    NSArray *responseJSON = @[task.requestID, @((double)progress), @((double)total)];\n    [weakSelf sendEventWithName:@\"didSendNetworkData\" body:responseJSON];\n  };\n\n  RCTURLRequestResponseBlock responseBlock = ^(NSURLResponse *response) {\n    NSDictionary<NSString *, NSString *> *headers;\n    NSInteger status;\n    if ([response isKindOfClass:[NSHTTPURLResponse class]]) { // Might be a local file request\n      NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;\n      headers = httpResponse.allHeaderFields ?: @{};\n      status = httpResponse.statusCode;\n    } else {\n      headers = response.MIMEType ? @{@\"Content-Type\": response.MIMEType} : @{};\n      status = 200;\n    }\n    id responseURL = response.URL ? response.URL.absoluteString : [NSNull null];\n    NSArray<id> *responseJSON = @[task.requestID, @(status), headers, responseURL];\n    [weakSelf sendEventWithName:@\"didReceiveNetworkResponse\" body:responseJSON];\n  };\n\n  // XHR does not allow you to peek at xhr.response before the response is\n  // finished. Only when xhr.responseType is set to ''/'text', consumers may\n  // peek at xhr.responseText. So unless the requested responseType is 'text',\n  // we only send progress updates and not incremental data updates to JS here.\n  RCTURLRequestIncrementalDataBlock incrementalDataBlock = nil;\n  RCTURLRequestProgressBlock downloadProgressBlock = nil;\n  if (incrementalUpdates) {\n    if ([responseType isEqualToString:@\"text\"]) {\n\n      // We need this to carry over bytes, which could not be decoded into text (such as broken UTF-8 characters).\n      // The incremental data block holds the ownership of this object, and will be released upon release of the block.\n      NSMutableData *incrementalDataCarry = [NSMutableData new];\n\n      incrementalDataBlock = ^(NSData *data, int64_t progress, int64_t total) {\n        NSUInteger initialCarryLength = incrementalDataCarry.length;\n\n        NSString *responseString = [RCTNetworking decodeTextData:data\n                                                    fromResponse:task.response\n                                                   withCarryData:incrementalDataCarry];\n        if (!responseString) {\n          RCTLogWarn(@\"Received data was not a string, or was not a recognised encoding.\");\n          return;\n        }\n\n        // Update progress to include the previous carry length and reduce the current carry length.\n        NSArray<id> *responseJSON = @[task.requestID,\n                                      responseString,\n                                      @(progress + initialCarryLength - incrementalDataCarry.length),\n                                      @(total)];\n\n        [weakSelf sendEventWithName:@\"didReceiveNetworkIncrementalData\" body:responseJSON];\n      };\n    } else {\n      downloadProgressBlock = ^(int64_t progress, int64_t total) {\n        NSArray<id> *responseJSON = @[task.requestID, @(progress), @(total)];\n        [weakSelf sendEventWithName:@\"didReceiveNetworkDataProgress\" body:responseJSON];\n      };\n    }\n  }\n\n  RCTURLRequestCompletionBlock completionBlock =\n  ^(NSURLResponse *response, NSData *data, NSError *error) {\n    __typeof(self) strongSelf = weakSelf;\n    if (!strongSelf) {\n      return;\n    }\n\n    // Unless we were sending incremental (text) chunks to JS, all along, now\n    // is the time to send the request body to JS.\n    if (!(incrementalUpdates && [responseType isEqualToString:@\"text\"])) {\n      [strongSelf sendData:data responseType:responseType forTask:task];\n    }\n    NSArray *responseJSON = @[task.requestID,\n                              RCTNullIfNil(error.localizedDescription),\n                              error.code == kCFURLErrorTimedOut ? @YES : @NO\n                              ];\n\n    [strongSelf sendEventWithName:@\"didCompleteNetworkResponse\" body:responseJSON];\n    [strongSelf->_tasksByRequestID removeObjectForKey:task.requestID];\n  };\n\n  task = [self networkTaskWithRequest:request completionBlock:completionBlock];\n  task.downloadProgressBlock = downloadProgressBlock;\n  task.incrementalDataBlock = incrementalDataBlock;\n  task.responseBlock = responseBlock;\n  task.uploadProgressBlock = uploadProgressBlock;\n\n  if (task.requestID) {\n    if (!_tasksByRequestID) {\n      _tasksByRequestID = [NSMutableDictionary new];\n    }\n    _tasksByRequestID[task.requestID] = task;\n    responseSender(@[task.requestID]);\n  }\n\n  [task start];\n}\n\n#pragma mark - Public API\n\n- (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request completionBlock:(RCTURLRequestCompletionBlock)completionBlock\n{\n  id<RCTURLRequestHandler> handler = [self handlerForRequest:request];\n  if (!handler) {\n    RCTLogError(@\"No suitable URL request handler found for %@\", request.URL);\n    return nil;\n  }\n\n  RCTNetworkTask *task = [[RCTNetworkTask alloc] initWithRequest:request\n                                                         handler:handler\n                                                   callbackQueue:_methodQueue];\n  task.completionBlock = completionBlock;\n  return task;\n}\n\n#pragma mark - JS API\n\nRCT_EXPORT_METHOD(sendRequest:(NSDictionary *)query\n                  responseSender:(RCTResponseSenderBlock)responseSender)\n{\n  // TODO: buildRequest returns a cancellation block, but there's currently\n  // no way to invoke it, if, for example the request is cancelled while\n  // loading a large file to build the request body\n  [self buildRequest:query completionBlock:^(NSURLRequest *request) {\n    NSString *responseType = [RCTConvert NSString:query[@\"responseType\"]];\n    BOOL incrementalUpdates = [RCTConvert BOOL:query[@\"incrementalUpdates\"]];\n    [self sendRequest:request\n         responseType:responseType\n   incrementalUpdates:incrementalUpdates\n       responseSender:responseSender];\n  }];\n}\n\nRCT_EXPORT_METHOD(abortRequest:(nonnull NSNumber *)requestID)\n{\n  [_tasksByRequestID[requestID] cancel];\n  [_tasksByRequestID removeObjectForKey:requestID];\n}\n\nRCT_EXPORT_METHOD(clearCookies:(RCTResponseSenderBlock)responseSender)\n{\n  NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];\n  if (!storage.cookies.count) {\n    responseSender(@[@NO]);\n    return;\n  }\n\n  for (NSHTTPCookie *cookie in storage.cookies) {\n    [storage deleteCookie:cookie];\n  }\n  responseSender(@[@YES]);\n}\n\n@end\n\n@implementation RCTBridge (RCTNetworking)\n\n- (RCTNetworking *)networking\n{\n  return [self moduleForClass:[RCTNetworking class]];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Network/XHRInterceptor.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule XHRInterceptor\n */\n 'use strict';\n\nconst XMLHttpRequest = require('XMLHttpRequest');\nconst originalXHROpen = XMLHttpRequest.prototype.open;\nconst originalXHRSend = XMLHttpRequest.prototype.send;\nconst originalXHRSetRequestHeader = XMLHttpRequest.prototype.setRequestHeader;\n\nvar openCallback;\nvar sendCallback;\nvar requestHeaderCallback;\nvar headerReceivedCallback;\nvar responseCallback;\n\nvar isInterceptorEnabled = false;\n\n/**\n * A network interceptor which monkey-patches XMLHttpRequest methods\n * to gather all network requests/responses, in order to show their\n * information in the React Native inspector development tool.\n * This supports interception with XMLHttpRequest API, including Fetch API\n * and any other third party libraries that depend on XMLHttpRequest.\n */\nconst XHRInterceptor = {\n  /**\n   * Invoked before XMLHttpRequest.open(...) is called.\n   */\n  setOpenCallback(callback) {\n    openCallback = callback;\n  },\n\n  /**\n   * Invoked before XMLHttpRequest.send(...) is called.\n   */\n  setSendCallback(callback) {\n    sendCallback = callback;\n  },\n\n  /**\n   * Invoked after xhr's readyState becomes xhr.HEADERS_RECEIVED.\n   */\n  setHeaderReceivedCallback(callback) {\n    headerReceivedCallback = callback;\n  },\n\n  /**\n   * Invoked after xhr's readyState becomes xhr.DONE.\n   */\n  setResponseCallback(callback) {\n    responseCallback = callback;\n  },\n\n  /**\n   * Invoked before XMLHttpRequest.setRequestHeader(...) is called.\n   */\n  setRequestHeaderCallback(callback) {\n    requestHeaderCallback = callback;\n  },\n\n  isInterceptorEnabled() {\n    return isInterceptorEnabled;\n  },\n\n  enableInterception() {\n    if (isInterceptorEnabled) {\n      return;\n    }\n    // Override `open` method for all XHR requests to intercept the request\n    // method and url, then pass them through the `openCallback`.\n    XMLHttpRequest.prototype.open = function(method, url) {\n      if (openCallback) {\n        openCallback(method, url, this);\n      }\n      originalXHROpen.apply(this, arguments);\n    };\n\n    // Override `setRequestHeader` method for all XHR requests to intercept\n    // the request headers, then pass them through the `requestHeaderCallback`.\n    XMLHttpRequest.prototype.setRequestHeader = function(header, value) {\n      if (requestHeaderCallback) {\n        requestHeaderCallback(header, value, this);\n      }\n      originalXHRSetRequestHeader.apply(this, arguments);\n    };\n\n    // Override `send` method of all XHR requests to intercept the data sent,\n    // register listeners to intercept the response, and invoke the callbacks.\n    XMLHttpRequest.prototype.send = function(data) {\n      if (sendCallback) {\n        sendCallback(data, this);\n      }\n      if (this.addEventListener) {\n        this.addEventListener('readystatechange', () => {\n          if (!isInterceptorEnabled) {\n            return;\n          }\n          if (this.readyState === this.HEADERS_RECEIVED) {\n            const contentTypeString = this.getResponseHeader('Content-Type');\n            const contentLengthString =\n              this.getResponseHeader('Content-Length');\n            let responseContentType, responseSize;\n            if (contentTypeString) {\n              responseContentType = contentTypeString.split(';')[0];\n            }\n            if (contentLengthString) {\n              responseSize = parseInt(contentLengthString, 10);\n            }\n            if (headerReceivedCallback) {\n              headerReceivedCallback(\n                responseContentType,\n                responseSize,\n                this.getAllResponseHeaders(),\n                this,\n              );\n            }\n          }\n          if (this.readyState === this.DONE) {\n            if (responseCallback) {\n              responseCallback(\n                this.status,\n                this.timeout,\n                this.response,\n                this.responseURL,\n                this.responseType,\n                this,\n              );\n            }\n          }\n        }, false);\n      }\n      originalXHRSend.apply(this, arguments);\n    };\n    isInterceptorEnabled = true;\n  },\n\n  // Unpatch XMLHttpRequest methods and remove the callbacks.\n  disableInterception() {\n    if (!isInterceptorEnabled) {\n      return;\n    }\n    isInterceptorEnabled = false;\n    XMLHttpRequest.prototype.send = originalXHRSend;\n    XMLHttpRequest.prototype.open = originalXHROpen;\n    XMLHttpRequest.prototype.setRequestHeader = originalXHRSetRequestHeader;\n    responseCallback = null;\n    openCallback = null;\n    sendCallback = null;\n    headerReceivedCallback = null;\n    requestHeaderCallback = null;\n  },\n};\n\nmodule.exports = XHRInterceptor;\n"
  },
  {
    "path": "Libraries/Network/XMLHttpRequest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule XMLHttpRequest\n * @flow\n */\n'use strict';\n\nconst EventTarget = require('event-target-shim');\nconst RCTNetworking = require('RCTNetworking');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst base64 = require('base64-js');\nconst invariant = require('fbjs/lib/invariant');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst warning = require('fbjs/lib/warning');\n\ntype ResponseType = '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text';\ntype Response = ?Object | string;\n\ntype XHRInterceptor = {\n  requestSent(\n    id: number,\n    url: string,\n    method: string,\n    headers: Object\n  ): void,\n  responseReceived(\n    id: number,\n    url: string,\n    status: number,\n    headers: Object\n  ): void,\n  dataReceived(\n    id: number,\n    data: string\n  ): void,\n  loadingFinished(\n    id: number,\n    encodedDataLength: number\n  ): void,\n  loadingFailed(\n    id: number,\n    error: string\n  ): void,\n};\n\nconst UNSENT = 0;\nconst OPENED = 1;\nconst HEADERS_RECEIVED = 2;\nconst LOADING = 3;\nconst DONE = 4;\n\nconst SUPPORTED_RESPONSE_TYPES = {\n  arraybuffer: typeof global.ArrayBuffer === 'function',\n  blob: typeof global.Blob === 'function',\n  document: false,\n  json: true,\n  text: true,\n  '': true,\n};\n\nconst REQUEST_EVENTS = [\n  'abort',\n  'error',\n  'load',\n  'loadstart',\n  'progress',\n  'timeout',\n  'loadend',\n];\n\nconst XHR_EVENTS = REQUEST_EVENTS.concat('readystatechange');\n\nclass XMLHttpRequestEventTarget extends EventTarget(...REQUEST_EVENTS) {\n  onload: ?Function;\n  onloadstart: ?Function;\n  onprogress: ?Function;\n  ontimeout: ?Function;\n  onerror: ?Function;\n  onabort: ?Function;\n  onloadend: ?Function;\n}\n\n/**\n * Shared base for platform-specific XMLHttpRequest implementations.\n */\nclass XMLHttpRequest extends EventTarget(...XHR_EVENTS) {\n\n  static UNSENT: number = UNSENT;\n  static OPENED: number = OPENED;\n  static HEADERS_RECEIVED: number = HEADERS_RECEIVED;\n  static LOADING: number = LOADING;\n  static DONE: number = DONE;\n\n  static _interceptor: ?XHRInterceptor = null;\n\n  UNSENT: number = UNSENT;\n  OPENED: number = OPENED;\n  HEADERS_RECEIVED: number = HEADERS_RECEIVED;\n  LOADING: number = LOADING;\n  DONE: number = DONE;\n\n  // EventTarget automatically initializes these to `null`.\n  onload: ?Function;\n  onloadstart: ?Function;\n  onprogress: ?Function;\n  ontimeout: ?Function;\n  onerror: ?Function;\n  onabort: ?Function;\n  onloadend: ?Function;\n  onreadystatechange: ?Function;\n\n  readyState: number = UNSENT;\n  responseHeaders: ?Object;\n  status: number = 0;\n  timeout: number = 0;\n  responseURL: ?string;\n  withCredentials: boolean = true\n\n  upload: XMLHttpRequestEventTarget = new XMLHttpRequestEventTarget();\n\n  _requestId: ?number;\n  _subscriptions: Array<*>;\n\n  _aborted: boolean = false;\n  _cachedResponse: Response;\n  _hasError: boolean = false;\n  _headers: Object;\n  _lowerCaseResponseHeaders: Object;\n  _method: ?string = null;\n  _response: string | ?Object;\n  _responseType: ResponseType;\n  _response: string = '';\n  _sent: boolean;\n  _url: ?string = null;\n  _timedOut: boolean = false;\n  _trackingName: string = 'unknown';\n  _incrementalEvents: boolean = false;\n\n  static setInterceptor(interceptor: ?XHRInterceptor) {\n    XMLHttpRequest._interceptor = interceptor;\n  }\n\n  constructor() {\n    super();\n    this._reset();\n  }\n\n  _reset(): void {\n    this.readyState = this.UNSENT;\n    this.responseHeaders = undefined;\n    this.status = 0;\n    delete this.responseURL;\n\n    this._requestId = null;\n\n    this._cachedResponse = undefined;\n    this._hasError = false;\n    this._headers = {};\n    this._response = '';\n    this._responseType = '';\n    this._sent = false;\n    this._lowerCaseResponseHeaders = {};\n\n    this._clearSubscriptions();\n    this._timedOut = false;\n  }\n\n  get responseType(): ResponseType {\n    return this._responseType;\n  }\n\n  set responseType(responseType: ResponseType): void {\n    if (this._sent) {\n      throw new Error(\n        'Failed to set the \\'responseType\\' property on \\'XMLHttpRequest\\': The ' +\n        'response type cannot be set after the request has been sent.'\n      );\n    }\n    if (!SUPPORTED_RESPONSE_TYPES.hasOwnProperty(responseType)) {\n      warning(\n        false,\n        `The provided value '${responseType}' is not a valid 'responseType'.`\n      );\n      return;\n    }\n\n    // redboxes early, e.g. for 'arraybuffer' on ios 7\n    invariant(\n      SUPPORTED_RESPONSE_TYPES[responseType] || responseType === 'document',\n      `The provided value '${responseType}' is unsupported in this environment.`\n    );\n    this._responseType = responseType;\n  }\n\n  get responseText(): string {\n    if (this._responseType !== '' && this._responseType !== 'text') {\n      throw new Error(\n        \"The 'responseText' property is only available if 'responseType' \" +\n        `is set to '' or 'text', but it is '${this._responseType}'.`\n      );\n    }\n    if (this.readyState < LOADING) {\n      return '';\n    }\n    return this._response;\n  }\n\n  get response(): Response {\n    const {responseType} = this;\n    if (responseType === '' || responseType === 'text') {\n      return this.readyState < LOADING || this._hasError\n        ? ''\n        : this._response;\n    }\n\n    if (this.readyState !== DONE) {\n      return null;\n    }\n\n    if (this._cachedResponse !== undefined) {\n      return this._cachedResponse;\n    }\n\n    switch (responseType) {\n      case 'document':\n        this._cachedResponse = null;\n        break;\n\n      case 'arraybuffer':\n        this._cachedResponse = base64.toByteArray(this._response).buffer;\n        break;\n\n      case 'blob':\n        this._cachedResponse = new global.Blob(\n          [base64.toByteArray(this._response).buffer],\n          {type: this.getResponseHeader('content-type') || ''}\n        );\n        break;\n\n      case 'json':\n        try {\n          this._cachedResponse = JSON.parse(this._response);\n        } catch (_) {\n          this._cachedResponse = null;\n        }\n        break;\n\n      default:\n        this._cachedResponse = null;\n    }\n\n    return this._cachedResponse;\n  }\n\n  // exposed for testing\n  __didCreateRequest(requestId: number): void {\n    this._requestId = requestId;\n\n    XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.requestSent(\n      requestId,\n      this._url || '',\n      this._method || 'GET',\n      this._headers);\n  }\n\n  // exposed for testing\n  __didUploadProgress(\n    requestId: number,\n    progress: number,\n    total: number\n  ): void {\n    if (requestId === this._requestId) {\n      this.upload.dispatchEvent({\n        type: 'progress',\n        lengthComputable: true,\n        loaded: progress,\n        total,\n      });\n    }\n  }\n\n  __didReceiveResponse(\n    requestId: number,\n    status: number,\n    responseHeaders: ?Object,\n    responseURL: ?string\n  ): void {\n    if (requestId === this._requestId) {\n      this.status = status;\n      this.setResponseHeaders(responseHeaders);\n      this.setReadyState(this.HEADERS_RECEIVED);\n      if (responseURL || responseURL === '') {\n        this.responseURL = responseURL;\n      } else {\n        delete this.responseURL;\n      }\n\n      XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.responseReceived(\n        requestId,\n        responseURL || this._url || '',\n        status,\n        responseHeaders || {});\n    }\n  }\n\n  __didReceiveData(requestId: number, response: string): void {\n    if (requestId !== this._requestId) {\n      return;\n    }\n    this._response = response;\n    this._cachedResponse = undefined; // force lazy recomputation\n    this.setReadyState(this.LOADING);\n\n    XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.dataReceived(\n      requestId,\n      response);\n  }\n\n  __didReceiveIncrementalData(\n    requestId: number,\n    responseText: string,\n    progress: number,\n    total: number\n  ) {\n    if (requestId !== this._requestId) {\n      return;\n    }\n    if (!this._response) {\n      this._response = responseText;\n    } else {\n      this._response += responseText;\n    }\n\n    XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.dataReceived(\n      requestId,\n      responseText);\n\n    this.setReadyState(this.LOADING);\n    this.__didReceiveDataProgress(requestId, progress, total);\n  }\n\n  __didReceiveDataProgress(\n    requestId: number,\n    loaded: number,\n    total: number\n  ): void {\n    if (requestId !== this._requestId) {\n      return;\n    }\n    this.dispatchEvent({\n      type: 'progress',\n      lengthComputable: total >= 0,\n      loaded,\n      total,\n    });\n  }\n\n  // exposed for testing\n  __didCompleteResponse(\n    requestId: number,\n    error: string,\n    timeOutError: boolean\n  ): void {\n    if (requestId === this._requestId) {\n      if (error) {\n        if (this._responseType === '' || this._responseType === 'text') {\n          this._response = error;\n        }\n        this._hasError = true;\n        if (timeOutError) {\n          this._timedOut = true;\n        }\n      }\n      this._clearSubscriptions();\n      this._requestId = null;\n      this.setReadyState(this.DONE);\n\n      if (error) {\n        XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.loadingFailed(\n          requestId,\n          error);\n      } else {\n        XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.loadingFinished(\n          requestId,\n          this._response.length);\n      }\n    }\n  }\n\n  _clearSubscriptions(): void {\n    (this._subscriptions || []).forEach(sub => {\n      if (sub) {\n        sub.remove();\n      }\n    });\n    this._subscriptions = [];\n  }\n\n  getAllResponseHeaders(): ?string {\n    if (!this.responseHeaders) {\n      // according to the spec, return null if no response has been received\n      return null;\n    }\n    var headers = this.responseHeaders || {};\n    return Object.keys(headers).map((headerName) => {\n      return headerName + ': ' + headers[headerName];\n    }).join('\\r\\n');\n  }\n\n  getResponseHeader(header: string): ?string {\n    var value = this._lowerCaseResponseHeaders[header.toLowerCase()];\n    return value !== undefined ? value : null;\n  }\n\n  setRequestHeader(header: string, value: any): void {\n    if (this.readyState !== this.OPENED) {\n      throw new Error('Request has not been opened');\n    }\n    this._headers[header.toLowerCase()] = String(value);\n  }\n\n  /**\n   * Custom extension for tracking origins of request.\n   */\n  setTrackingName(trackingName: string): XMLHttpRequest {\n    this._trackingName = trackingName;\n    return this;\n  }\n\n  open(method: string, url: string, async: ?boolean): void {\n    /* Other optional arguments are not supported yet */\n    if (this.readyState !== this.UNSENT) {\n      throw new Error('Cannot open, already sending');\n    }\n    if (async !== undefined && !async) {\n      // async is default\n      throw new Error('Synchronous http requests are not supported');\n    }\n    if (!url) {\n      throw new Error('Cannot load an empty url');\n    }\n    this._method = method.toUpperCase();\n    this._url = url;\n    this._aborted = false;\n    this.setReadyState(this.OPENED);\n  }\n\n  send(data: any): void {\n    if (this.readyState !== this.OPENED) {\n      throw new Error('Request has not been opened');\n    }\n    if (this._sent) {\n      throw new Error('Request has already been sent');\n    }\n    this._sent = true;\n    const incrementalEvents = this._incrementalEvents ||\n      !!this.onreadystatechange ||\n      !!this.onprogress;\n\n    this._subscriptions.push(RCTNetworking.addListener(\n      'didSendNetworkData',\n      (args) => this.__didUploadProgress(...args)\n    ));\n    this._subscriptions.push(RCTNetworking.addListener(\n      'didReceiveNetworkResponse',\n      (args) => this.__didReceiveResponse(...args)\n    ));\n    this._subscriptions.push(RCTNetworking.addListener(\n      'didReceiveNetworkData',\n      (args) => this.__didReceiveData(...args)\n    ));\n    this._subscriptions.push(RCTNetworking.addListener(\n      'didReceiveNetworkIncrementalData',\n      (args) => this.__didReceiveIncrementalData(...args)\n    ));\n    this._subscriptions.push(RCTNetworking.addListener(\n      'didReceiveNetworkDataProgress',\n      (args) => this.__didReceiveDataProgress(...args)\n    ));\n    this._subscriptions.push(RCTNetworking.addListener(\n      'didCompleteNetworkResponse',\n      (args) => this.__didCompleteResponse(...args)\n    ));\n\n    let nativeResponseType = 'text';\n    if (this._responseType === 'arraybuffer' || this._responseType === 'blob') {\n      nativeResponseType = 'base64';\n    }\n\n    invariant(this._method, 'Request method needs to be defined.');\n    invariant(this._url, 'Request URL needs to be defined.');\n    RCTNetworking.sendRequest(\n      this._method,\n      this._trackingName,\n      this._url,\n      this._headers,\n      data,\n      nativeResponseType,\n      incrementalEvents,\n      this.timeout,\n      this.__didCreateRequest.bind(this),\n      this.withCredentials\n    );\n  }\n\n  abort(): void {\n    this._aborted = true;\n    if (this._requestId) {\n      RCTNetworking.abortRequest(this._requestId);\n    }\n    // only call onreadystatechange if there is something to abort,\n    // below logic is per spec\n    if (!(this.readyState === this.UNSENT ||\n        (this.readyState === this.OPENED && !this._sent) ||\n        this.readyState === this.DONE)) {\n      this._reset();\n      this.setReadyState(this.DONE);\n    }\n    // Reset again after, in case modified in handler\n    this._reset();\n  }\n\n  setResponseHeaders(responseHeaders: ?Object): void {\n    this.responseHeaders = responseHeaders || null;\n    var headers = responseHeaders || {};\n    this._lowerCaseResponseHeaders =\n      Object.keys(headers).reduce((lcaseHeaders, headerName) => {\n        lcaseHeaders[headerName.toLowerCase()] = headers[headerName];\n        return lcaseHeaders;\n      }, {});\n  }\n\n  setReadyState(newState: number): void {\n    this.readyState = newState;\n    this.dispatchEvent({type: 'readystatechange'});\n    if (newState === this.DONE) {\n      if (this._aborted) {\n        this.dispatchEvent({type: 'abort'});\n      } else if (this._hasError) {\n        if (this._timedOut) {\n          this.dispatchEvent({type: 'timeout'});\n        } else {\n          this.dispatchEvent({type: 'error'});\n        }\n      } else {\n        this.dispatchEvent({type: 'load'});\n      }\n      this.dispatchEvent({type: 'loadend'});\n    }\n  }\n\n  /* global EventListener */\n  addEventListener(type: string, listener: EventListener): void {\n    // If we dont' have a 'readystatechange' event handler, we don't\n    // have to send repeated LOADING events with incremental updates\n    // to responseText, which will avoid a bunch of native -> JS\n    // bridge traffic.\n    if (type === 'readystatechange' || type === 'progress') {\n      this._incrementalEvents = true;\n    }\n    super.addEventListener(type, listener);\n  }\n}\n\nmodule.exports = XMLHttpRequest;\n"
  },
  {
    "path": "Libraries/Network/__tests__/FormData-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n\n'use strict';\n\nconst FormData = require('FormData');\n\ndescribe('FormData', function() {\n  var formData;\n\n  beforeEach(() => {\n    formData = new FormData();\n  });\n\n  afterEach(() => {\n    formData = null;\n  });\n\n  it('should return non blob null', function() {\n    formData.append('null', null);\n\n    const expectedPart = {\n      string: 'null',\n      headers: {\n        'content-disposition': 'form-data; name=\"null\"'\n      },\n      fieldName: 'null'\n    };\n    expect(formData.getParts()[0]).toMatchObject(expectedPart);\n  });\n\n  it('should return blob', function() {\n    formData.append('photo', {\n      uri: 'arbitrary/path',\n      type: 'image/jpeg',\n      name: 'photo.jpg'\n    });\n\n    const expectedPart = {\n      uri: 'arbitrary/path',\n      type: 'image/jpeg',\n      name: 'photo.jpg',\n      headers: {\n        'content-disposition': 'form-data; name=\"photo\"; filename=\"photo.jpg\"',\n        'content-type': 'image/jpeg'\n      },\n      fieldName: 'photo'\n    };\n    expect(formData.getParts()[0]).toMatchObject(expectedPart);\n  });\n});\n"
  },
  {
    "path": "Libraries/Network/__tests__/XMLHttpRequest-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n\n'use strict';\njest.unmock('Platform');\nconst Platform = require('Platform');\nlet requestId = 1;\n\nfunction setRequestId(id){\n  if (Platform.OS === 'ios' || Platform.OS === 'macos') {\n    return;\n  }\n  requestId = id;\n}\n\njest\n  .dontMock('event-target-shim')\n  .setMock('NativeModules', {\n    Networking: {\n      addListener: function() {},\n      removeListeners: function() {},\n      sendRequest(options, callback) {\n        if (typeof callback === 'function') { // android does not pass a callback\n          callback(requestId);\n        }\n      },\n      abortRequest: function() {},\n    },\n  });\n\nconst XMLHttpRequest = require('XMLHttpRequest');\n\ndescribe('XMLHttpRequest', function() {\n  var xhr;\n  var handleTimeout;\n  var handleError;\n  var handleLoad;\n  var handleReadyStateChange;\n  var handleLoadEnd;\n\n  beforeEach(() => {\n    xhr = new XMLHttpRequest();\n\n    xhr.ontimeout = jest.fn();\n    xhr.onerror = jest.fn();\n    xhr.onload = jest.fn();\n    xhr.onloadend = jest.fn();\n    xhr.onreadystatechange = jest.fn();\n\n    handleTimeout = jest.fn();\n    handleError = jest.fn();\n    handleLoad = jest.fn();\n    handleLoadEnd = jest.fn();\n    handleReadyStateChange = jest.fn();\n\n    xhr.addEventListener('timeout', handleTimeout);\n    xhr.addEventListener('error', handleError);\n    xhr.addEventListener('load', handleLoad);\n    xhr.addEventListener('loadend', handleLoadEnd);\n    xhr.addEventListener('readystatechange', handleReadyStateChange);\n  });\n\n  afterEach(() => {\n    xhr = null;\n    handleTimeout = null;\n    handleError = null;\n    handleLoad = null;\n    handleLoadEnd = null;\n    handleReadyStateChange = null;\n  });\n\n  it('should transition readyState correctly', function() {\n    expect(xhr.readyState).toBe(xhr.UNSENT);\n\n    xhr.open('GET', 'blabla');\n\n    expect(xhr.onreadystatechange.mock.calls.length).toBe(1);\n    expect(handleReadyStateChange.mock.calls.length).toBe(1);\n    expect(xhr.readyState).toBe(xhr.OPENED);\n  });\n\n  it('should expose responseType correctly', function() {\n    expect(xhr.responseType).toBe('');\n\n    // Setting responseType to an unsupported value has no effect.\n    xhr.responseType = 'arrayblobbuffertextfile';\n    expect(xhr.responseType).toBe('');\n\n    xhr.responseType = 'arraybuffer';\n    expect(xhr.responseType).toBe('arraybuffer');\n\n    // Can't change responseType after first data has been received.\n    xhr.open('GET', 'blabla');\n    xhr.send();\n    expect(() => { xhr.responseType = 'text'; }).toThrow();\n  });\n\n  it('should expose responseText correctly', function() {\n    xhr.responseType = '';\n    expect(xhr.responseText).toBe('');\n    expect(xhr.response).toBe('');\n\n    xhr.responseType = 'arraybuffer';\n    expect(() => xhr.responseText).toThrow();\n    expect(xhr.response).toBe(null);\n\n    xhr.responseType = 'text';\n    expect(xhr.responseText).toBe('');\n    expect(xhr.response).toBe('');\n\n    // responseText is read-only.\n    expect(() => { xhr.responseText = 'hi'; }).toThrow();\n    expect(xhr.responseText).toBe('');\n    expect(xhr.response).toBe('');\n\n    xhr.open('GET', 'blabla');\n    xhr.send();\n    setRequestId(2);\n    xhr.__didReceiveData(requestId, 'Some data');\n    expect(xhr.responseText).toBe('Some data');\n  });\n\n  it('should call ontimeout function when the request times out', function() {\n    xhr.open('GET', 'blabla');\n    xhr.send();\n    setRequestId(3);\n    xhr.__didCompleteResponse(requestId, 'Timeout', true);\n    xhr.__didCompleteResponse(requestId, 'Timeout', true);\n\n    expect(xhr.readyState).toBe(xhr.DONE);\n\n    expect(xhr.ontimeout.mock.calls.length).toBe(1);\n    expect(xhr.onloadend.mock.calls.length).toBe(1);\n    expect(xhr.onerror).not.toBeCalled();\n    expect(xhr.onload).not.toBeCalled();\n\n    expect(handleTimeout.mock.calls.length).toBe(1);\n    expect(handleLoadEnd.mock.calls.length).toBe(1);\n    expect(handleError).not.toBeCalled();\n    expect(handleLoad).not.toBeCalled();\n  });\n\n  it('should call onerror function when the request times out', function() {\n    xhr.open('GET', 'blabla');\n    xhr.send();\n    setRequestId(4);\n    xhr.__didCompleteResponse(requestId, 'Generic error');\n\n    expect(xhr.readyState).toBe(xhr.DONE);\n\n    expect(xhr.onreadystatechange.mock.calls.length).toBe(2);\n    expect(xhr.onerror.mock.calls.length).toBe(1);\n    expect(xhr.onloadend.mock.calls.length).toBe(1);\n    expect(xhr.ontimeout).not.toBeCalled();\n    expect(xhr.onload).not.toBeCalled();\n\n    expect(handleReadyStateChange.mock.calls.length).toBe(2);\n    expect(handleError.mock.calls.length).toBe(1);\n    expect(handleLoadEnd.mock.calls.length).toBe(1);\n    expect(handleTimeout).not.toBeCalled();\n    expect(handleLoad).not.toBeCalled();\n  });\n\n  it('should call onload function when there is no error', function() {\n    xhr.open('GET', 'blabla');\n    xhr.send();\n    setRequestId(5);\n    xhr.__didCompleteResponse(requestId, null);\n\n    expect(xhr.readyState).toBe(xhr.DONE);\n\n    expect(xhr.onreadystatechange.mock.calls.length).toBe(2);\n    expect(xhr.onload.mock.calls.length).toBe(1);\n    expect(xhr.onloadend.mock.calls.length).toBe(1);\n    expect(xhr.onerror).not.toBeCalled();\n    expect(xhr.ontimeout).not.toBeCalled();\n\n    expect(handleReadyStateChange.mock.calls.length).toBe(2);\n    expect(handleLoad.mock.calls.length).toBe(1);\n    expect(handleLoadEnd.mock.calls.length).toBe(1);\n    expect(handleError).not.toBeCalled();\n    expect(handleTimeout).not.toBeCalled();\n  });\n\n  it('should call upload onprogress', function() {\n    xhr.open('GET', 'blabla');\n    xhr.send();\n\n    xhr.upload.onprogress = jest.fn();\n    var handleProgress = jest.fn();\n    xhr.upload.addEventListener('progress', handleProgress);\n    setRequestId(6);\n    xhr.__didUploadProgress(requestId, 42, 100);\n\n    expect(xhr.upload.onprogress.mock.calls.length).toBe(1);\n    expect(handleProgress.mock.calls.length).toBe(1);\n\n    expect(xhr.upload.onprogress.mock.calls[0][0].loaded).toBe(42);\n    expect(xhr.upload.onprogress.mock.calls[0][0].total).toBe(100);\n    expect(handleProgress.mock.calls[0][0].loaded).toBe(42);\n    expect(handleProgress.mock.calls[0][0].total).toBe(100);\n  });\n\n  it('should combine response headers with CRLF', function() {\n    xhr.open('GET', 'blabla');\n    xhr.send();\n    setRequestId(7);\n    xhr.__didReceiveResponse(requestId, 200, {\n      'Content-Type': 'text/plain; charset=utf-8',\n      'Content-Length': '32',\n    });\n\n    expect(xhr.getAllResponseHeaders()).toBe(\n      'Content-Type: text/plain; charset=utf-8\\r\\n' +\n      'Content-Length: 32');\n  });\n\n});\n"
  },
  {
    "path": "Libraries/Network/convertRequestBody.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule convertRequestBody\n * @flow\n */\n'use strict';\n\nconst binaryToBase64 = require('binaryToBase64');\n\nconst FormData = require('FormData');\n\nexport type RequestBody =\n    string\n  | FormData\n  | {uri: string}\n  | ArrayBuffer\n  | $ArrayBufferView\n  ;\n\nfunction convertRequestBody(body: RequestBody): Object {\n  if (typeof body === 'string') {\n    return {string: body};\n  }\n  if (body instanceof FormData) {\n    return {formData: body.getParts()};\n  }\n  if (body instanceof ArrayBuffer || ArrayBuffer.isView(body)) {\n    // $FlowFixMe: no way to assert that 'body' is indeed an ArrayBufferView\n    return {base64: binaryToBase64(body)};\n  }\n  return body;\n}\n\nmodule.exports = convertRequestBody;\n"
  },
  {
    "path": "Libraries/Network/fetch.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule fetch\n *\n */\n\n /* globals Headers, Request, Response */\n\n'use strict';\n\nimport whatwg from 'whatwg-fetch';\n\nif (whatwg && whatwg.fetch) {\n  module.exports = whatwg;\n} else {\n  module.exports = {fetch, Headers, Request, Response};\n}\n"
  },
  {
    "path": "Libraries/Performance/QuickPerformanceLogger.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule QuickPerformanceLogger\n */\n\n'use strict';\n\nvar fixOpts = function(opts) {\n    var AUTO_SET_TIMESTAMP = -1;\n    var DUMMY_INSTANCE_KEY = 0;\n    opts = opts || {};\n    opts.instanceKey = opts.instanceKey || DUMMY_INSTANCE_KEY;\n    opts.timestamp = opts.timestamp || AUTO_SET_TIMESTAMP;\n    return opts;\n};\n\nvar QuickPerformanceLogger = {\n  markerStart(markerId, opts) {\n    if (typeof markerId !== 'number') {\n      return;\n    }\n    if (global.nativeQPLMarkerStart) {\n      opts = fixOpts(opts);\n      global.nativeQPLMarkerStart(markerId, opts.instanceKey, opts.timestamp);\n    }\n  },\n\n  markerEnd(markerId, actionId, opts) {\n    if (typeof markerId !== 'number' || typeof actionId !== 'number') {\n      return;\n    }\n    if (global.nativeQPLMarkerEnd) {\n      opts = fixOpts(opts);\n      global.nativeQPLMarkerEnd(markerId, opts.instanceKey, actionId, opts.timestamp);\n    }\n  },\n\n  markerNote(markerId, actionId, opts) {\n    if (typeof markerId !== 'number' || typeof actionId !== 'number') {\n      return;\n    }\n    if (global.nativeQPLMarkerNote) {\n      opts = fixOpts(opts);\n      global.nativeQPLMarkerNote(markerId, opts.instanceKey, actionId, opts.timestamp);\n    }\n  },\n\n  markerTag(markerId, tag, opts) {\n    if (typeof markerId !== 'number' || typeof tag !== 'string') {\n      return;\n    }\n    if (global.nativeQPLMarkerTag) {\n      opts = fixOpts(opts);\n      global.nativeQPLMarkerTag(markerId, opts.instanceKey, tag);\n    }\n  },\n\n  markerAnnotate(markerId, annotationKey, annotationValue, opts) {\n    if (typeof markerId !== 'number' ||\n        typeof annotationKey !== 'string' ||\n        typeof annotationValue !== 'string') {\n      return;\n    }\n    if (global.nativeQPLMarkerAnnotate) {\n      opts = fixOpts(opts);\n      global.nativeQPLMarkerAnnotate(markerId, opts.instanceKey, annotationKey, annotationValue);\n    }\n  },\n\n  markerCancel(markerId, opts) {\n    if (typeof markerId !== 'number') {\n      return;\n    }\n    if (global.nativeQPLMarkerCancel) {\n      opts = fixOpts(opts);\n      global.nativeQPLMarkerCancel(markerId, opts.instanceKey);\n    }\n  },\n\n  currentTimestamp() {\n    if (global.nativeQPLTimestamp) {\n      return global.nativeQPLTimestamp();\n    }\n    return 0;\n  },\n\n};\n\nmodule.exports = QuickPerformanceLogger;\n"
  },
  {
    "path": "Libraries/Performance/SamplingProfiler.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SamplingProfiler\n * @flow\n */\n'use strict';\n\nconst SamplingProfiler = {\n  poke: function (token: number): void {\n    let error = null;\n    let result = null;\n    try {\n      result = global.pokeSamplingProfiler();\n      if (result === null) {\n        console.log('The JSC Sampling Profiler has started');\n      } else {\n        console.log('The JSC Sampling Profiler has stopped');\n      }\n    } catch (e) {\n      console.log(\n        'Error occured when restarting Sampling Profiler: ' + e.toString());\n      error = e.toString();\n    }\n\n    const {JSCSamplingProfiler} = require('NativeModules');\n    JSCSamplingProfiler.operationComplete(token, result, error);\n  },\n};\n\nmodule.exports = SamplingProfiler;\n"
  },
  {
    "path": "Libraries/Performance/Systrace.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Systrace\n * @flow\n */\n'use strict';\n\nconst invariant = require('fbjs/lib/invariant');\n\ntype RelayProfiler = {\n  attachProfileHandler(\n    name: string,\n    handler: (name: string, state?: any) => () => void\n  ): void,\n\n  attachAggregateHandler(\n    name: string,\n    handler: (name: string, callback: () => void) => void\n  ): void,\n};\n\n/* eslint no-bitwise: 0 */\nconst TRACE_TAG_REACT_APPS = 1 << 17;\nconst TRACE_TAG_JS_VM_CALLS = 1 << 27;\n\nlet _enabled = false;\nlet _asyncCookie = 0;\nconst _markStack = [];\nlet _markStackIndex = -1;\nlet _canInstallReactHook = false;\nlet _useFiber = false;\n\n// Implements a subset of User Timing API necessary for React measurements.\n// https://developer.mozilla.org/en-US/docs/Web/API/User_Timing_API\nconst REACT_MARKER = '\\u269B';\nconst userTimingPolyfill = __DEV__ ? {\n  mark(markName: string) {\n    if (_enabled) {\n      _markStackIndex++;\n      _markStack[_markStackIndex] = markName;\n      let systraceLabel = markName;\n      // Since perf measurements are a shared namespace in User Timing API,\n      // we prefix all React results with a React emoji.\n      if (markName[0] === REACT_MARKER) {\n        // This is coming from React.\n        // Removing component IDs keeps trace colors stable.\n        const indexOfId = markName.lastIndexOf(' (#');\n        const cutoffIndex = indexOfId !== -1 ? indexOfId : markName.length;\n        // Also cut off the emoji because it breaks Systrace\n        systraceLabel = markName.slice(2, cutoffIndex);\n      }\n      Systrace.beginEvent(systraceLabel);\n    }\n  },\n  measure(measureName: string, startMark: ?string, endMark: ?string) {\n    if (_enabled) {\n      invariant(\n        typeof measureName === 'string' &&\n        typeof startMark === 'string' &&\n        typeof endMark === 'undefined',\n        'Only performance.measure(string, string) overload is supported.'\n      );\n      const topMark = _markStack[_markStackIndex];\n      invariant(\n        startMark === topMark,\n        'There was a mismatching performance.measure() call. ' +\n        'Expected \"%s\" but got \"%s.\"',\n        topMark,\n        startMark,\n      );\n      _markStackIndex--;\n      // We can't use more descriptive measureName because Systrace doesn't\n      // let us edit labels post factum.\n      Systrace.endEvent();\n    }\n  },\n  clearMarks(markName: string) {\n    if (_enabled) {\n      if (_markStackIndex === -1) {\n        return;\n      }\n      if (markName === _markStack[_markStackIndex]) {\n        // React uses this for \"cancelling\" started measurements.\n        // Systrace doesn't support deleting measurements, so we just stop them.\n        if (userTimingPolyfill != null) {\n          userTimingPolyfill.measure(markName, markName);\n        }\n      }\n    }\n  },\n  clearMeasures() {\n    // React calls this to avoid memory leaks in browsers, but we don't keep\n    // measurements anyway.\n  },\n} : null;\n\n// A hook to get React Stack markers in Systrace.\nconst reactDebugToolHook = __DEV__ ? {\n  onBeforeMountComponent(debugID) {\n    const ReactComponentTreeHook = require('ReactGlobalSharedState').ReactComponentTreeHook;\n    const displayName = ReactComponentTreeHook.getDisplayName(debugID);\n    Systrace.beginEvent(`ReactReconciler.mountComponent(${displayName})`);\n  },\n  onMountComponent(debugID) {\n    Systrace.endEvent();\n  },\n  onBeforeUpdateComponent(debugID) {\n    const ReactComponentTreeHook = require('ReactGlobalSharedState').ReactComponentTreeHook;\n    const displayName = ReactComponentTreeHook.getDisplayName(debugID);\n    Systrace.beginEvent(`ReactReconciler.updateComponent(${displayName})`);\n  },\n  onUpdateComponent(debugID) {\n    Systrace.endEvent();\n  },\n  onBeforeUnmountComponent(debugID) {\n    const ReactComponentTreeHook = require('ReactGlobalSharedState').ReactComponentTreeHook;\n    const displayName = ReactComponentTreeHook.getDisplayName(debugID);\n    Systrace.beginEvent(`ReactReconciler.unmountComponent(${displayName})`);\n  },\n  onUnmountComponent(debugID) {\n    Systrace.endEvent();\n  },\n  onBeginLifeCycleTimer(debugID, timerType) {\n    const ReactComponentTreeHook = require('ReactGlobalSharedState').ReactComponentTreeHook;\n    const displayName = ReactComponentTreeHook.getDisplayName(debugID);\n    Systrace.beginEvent(`${displayName}.${timerType}()`);\n  },\n  onEndLifeCycleTimer(debugID, timerType) {\n    Systrace.endEvent();\n  },\n} : null;\n\nconst Systrace = {\n  installReactHook(useFiber: boolean) {\n    if (_enabled) {\n      if (__DEV__) {\n        if (useFiber) {\n          global.performance = userTimingPolyfill;\n        } else {\n          require('ReactDebugTool').addHook(reactDebugToolHook);\n        }\n      }\n    }\n    _useFiber = useFiber;\n    _canInstallReactHook = true;\n  },\n\n  setEnabled(enabled: boolean) {\n    if (_enabled !== enabled) {\n      if (__DEV__) {\n        if (enabled) {\n          global.nativeTraceBeginLegacy && global.nativeTraceBeginLegacy(TRACE_TAG_JS_VM_CALLS);\n        } else {\n          global.nativeTraceEndLegacy && global.nativeTraceEndLegacy(TRACE_TAG_JS_VM_CALLS);\n        }\n        if (_canInstallReactHook) {\n          if (_useFiber) {\n            if (enabled && global.performance === undefined) {\n              global.performance = userTimingPolyfill;\n            }\n          } else {\n            const ReactDebugTool = require('ReactDebugTool');\n            if (enabled) {\n              ReactDebugTool.addHook(reactDebugToolHook);\n            } else {\n              ReactDebugTool.removeHook(reactDebugToolHook);\n            }\n          }\n        }\n      }\n      _enabled = enabled;\n    }\n  },\n\n  isEnabled(): boolean {\n    return _enabled;\n  },\n\n  /**\n   * beginEvent/endEvent for starting and then ending a profile within the same call stack frame\n  **/\n  beginEvent(profileName?: any, args?: any) {\n    if (_enabled) {\n      profileName = typeof profileName === 'function' ?\n        profileName() : profileName;\n      global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS, profileName, args);\n    }\n  },\n\n  endEvent() {\n    if (_enabled) {\n      global.nativeTraceEndSection(TRACE_TAG_REACT_APPS);\n    }\n  },\n\n  /**\n   * beginAsyncEvent/endAsyncEvent for starting and then ending a profile where the end can either\n   * occur on another thread or out of the current stack frame, eg await\n   * the returned cookie variable should be used as input into the endAsyncEvent call to end the profile\n  **/\n  beginAsyncEvent(profileName?: any): any {\n    const cookie = _asyncCookie;\n    if (_enabled) {\n      _asyncCookie++;\n      profileName = typeof profileName === 'function' ?\n        profileName() : profileName;\n      global.nativeTraceBeginAsyncSection(TRACE_TAG_REACT_APPS, profileName, cookie);\n    }\n    return cookie;\n  },\n\n  endAsyncEvent(profileName?: any, cookie?: any) {\n    if (_enabled) {\n      profileName = typeof profileName === 'function' ?\n        profileName() : profileName;\n      global.nativeTraceEndAsyncSection(TRACE_TAG_REACT_APPS, profileName, cookie);\n    }\n  },\n\n  /**\n   * counterEvent registers the value to the profileName on the systrace timeline\n  **/\n  counterEvent(profileName?: any, value?: any) {\n    if (_enabled) {\n      profileName = typeof profileName === 'function' ?\n        profileName() : profileName;\n      global.nativeTraceCounter &&\n        global.nativeTraceCounter(TRACE_TAG_REACT_APPS, profileName, value);\n    }\n  },\n\n  /**\n   * Relay profiles use await calls, so likely occur out of current stack frame\n   * therefore async variant of profiling is used\n  **/\n  attachToRelayProfiler(relayProfiler: RelayProfiler) {\n    relayProfiler.attachProfileHandler('*', (name) => {\n      const cookie = Systrace.beginAsyncEvent(name);\n      return () => {\n        Systrace.endAsyncEvent(name, cookie);\n      };\n    });\n\n    relayProfiler.attachAggregateHandler('*', (name, callback) => {\n      Systrace.beginEvent(name);\n      callback();\n      Systrace.endEvent();\n    });\n  },\n\n  /* This is not called by default due to perf overhead but it's useful\n     if you want to find traces which spend too much time in JSON. */\n  swizzleJSON() {\n    Systrace.measureMethods(JSON, 'JSON', [\n      'parse',\n      'stringify'\n    ]);\n  },\n\n /**\n  * Measures multiple methods of a class. For example, you can do:\n  * Systrace.measureMethods(JSON, 'JSON', ['parse', 'stringify']);\n  *\n  * @param object\n  * @param objectName\n  * @param methodNames Map from method names to method display names.\n  */\n measureMethods(object: any, objectName: string, methodNames: Array<string>): void {\n   if (!__DEV__) {\n     return;\n   }\n\n   methodNames.forEach(methodName => {\n     object[methodName] = Systrace.measure(\n       objectName,\n       methodName,\n       object[methodName]\n     );\n   });\n },\n\n /**\n  * Returns an profiled version of the input function. For example, you can:\n  * JSON.parse = Systrace.measure('JSON', 'parse', JSON.parse);\n  *\n  * @param objName\n  * @param fnName\n  * @param {function} func\n  * @return {function} replacement function\n  */\n measure(objName: string, fnName: string, func: any): any {\n   if (!__DEV__) {\n     return func;\n   }\n\n   const profileName = `${objName}.${fnName}`;\n   return function() {\n     if (!_enabled) {\n       return func.apply(this, arguments);\n     }\n\n     Systrace.beginEvent(profileName);\n     const ret = func.apply(this, arguments);\n     Systrace.endEvent();\n     return ret;\n   };\n },\n};\n\nif (__DEV__) {\n  // This is needed, because require callis in polyfills are not processed as\n  // other files. Therefore, calls to `require('moduleId')` are not replaced\n  // with numeric IDs\n  // TODO(davidaurelio) Scan polyfills for dependencies, too (t9759686)\n  (require: any).Systrace = Systrace;\n}\n\nmodule.exports = Systrace;\n"
  },
  {
    "path": "Libraries/PermissionsAndroid/PermissionsAndroid.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PermissionsAndroid\n * @flow\n */\n'use strict';\n\nconst NativeModules = require('NativeModules');\n\ntype Rationale = {\n  title: string,\n  message: string,\n}\n\ntype PermissionStatus = 'granted' | 'denied' | 'never_ask_again';\n/**\n * <div class=\"banner-crna-ejected\">\n *   <h3>Project with Native Code Required</h3>\n *   <p>\n *     This API only works in projects made with <code>react-native init</code>\n *     or in those made with Create React Native App which have since ejected. For\n *     more information about ejecting, please see\n *     the <a href=\"https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md\" target=\"_blank\">guide</a> on\n *     the Create React Native App repository.\n *   </p>\n * </div>\n *\n * `PermissionsAndroid` provides access to Android M's new permissions model.\n * Some permissions are granted by default when the application is installed\n * so long as they appear in `AndroidManifest.xml`. However, \"dangerous\"\n * permissions require a dialog prompt. You should use this module for those\n * permissions.\n *\n * On devices before SDK version 23, the permissions are automatically granted\n * if they appear in the manifest, so `check` and `request`\n * should always be true.\n *\n * If a user has previously turned off a permission that you prompt for, the OS\n * will advise your app to show a rationale for needing the permission. The\n * optional `rationale` argument will show a dialog prompt only if\n * necessary - otherwise the normal permission prompt will appear.\n *\n * ### Example\n * ```\n * import { PermissionsAndroid } from 'react-native';\n *\n * async function requestCameraPermission() {\n *   try {\n *     const granted = await PermissionsAndroid.request(\n *       PermissionsAndroid.PERMISSIONS.CAMERA,\n *       {\n *         'title': 'Cool Photo App Camera Permission',\n *         'message': 'Cool Photo App needs access to your camera ' +\n *                    'so you can take awesome pictures.'\n *       }\n *     )\n *     if (granted === PermissionsAndroid.RESULTS.GRANTED) {\n *       console.log(\"You can use the camera\")\n *     } else {\n *       console.log(\"Camera permission denied\")\n *     }\n *   } catch (err) {\n *     console.warn(err)\n *   }\n * }\n * ```\n */\n\nclass PermissionsAndroid {\n  PERMISSIONS: Object;\n  RESULTS: Object;\n\n  constructor() {\n    /**\n     * A list of specified \"dangerous\" permissions that require prompting the user\n     */\n    this.PERMISSIONS = {\n      READ_CALENDAR: 'android.permission.READ_CALENDAR',\n      WRITE_CALENDAR: 'android.permission.WRITE_CALENDAR',\n      CAMERA: 'android.permission.CAMERA',\n      READ_CONTACTS: 'android.permission.READ_CONTACTS',\n      WRITE_CONTACTS: 'android.permission.WRITE_CONTACTS',\n      GET_ACCOUNTS:  'android.permission.GET_ACCOUNTS',\n      ACCESS_FINE_LOCATION: 'android.permission.ACCESS_FINE_LOCATION',\n      ACCESS_COARSE_LOCATION: 'android.permission.ACCESS_COARSE_LOCATION',\n      RECORD_AUDIO: 'android.permission.RECORD_AUDIO',\n      READ_PHONE_STATE: 'android.permission.READ_PHONE_STATE',\n      CALL_PHONE: 'android.permission.CALL_PHONE',\n      READ_CALL_LOG: 'android.permission.READ_CALL_LOG',\n      WRITE_CALL_LOG: 'android.permission.WRITE_CALL_LOG',\n      ADD_VOICEMAIL: 'com.android.voicemail.permission.ADD_VOICEMAIL',\n      USE_SIP: 'android.permission.USE_SIP',\n      PROCESS_OUTGOING_CALLS: 'android.permission.PROCESS_OUTGOING_CALLS',\n      BODY_SENSORS:  'android.permission.BODY_SENSORS',\n      SEND_SMS: 'android.permission.SEND_SMS',\n      RECEIVE_SMS: 'android.permission.RECEIVE_SMS',\n      READ_SMS: 'android.permission.READ_SMS',\n      RECEIVE_WAP_PUSH: 'android.permission.RECEIVE_WAP_PUSH',\n      RECEIVE_MMS: 'android.permission.RECEIVE_MMS',\n      READ_EXTERNAL_STORAGE: 'android.permission.READ_EXTERNAL_STORAGE',\n      WRITE_EXTERNAL_STORAGE: 'android.permission.WRITE_EXTERNAL_STORAGE',\n    };\n\n    this.RESULTS = {\n      GRANTED: 'granted',\n      DENIED: 'denied',\n      NEVER_ASK_AGAIN: 'never_ask_again',\n    };\n  }\n\n  /**\n   * DEPRECATED - use check\n   *\n   * Returns a promise resolving to a boolean value as to whether the specified\n   * permissions has been granted\n   *\n   * @deprecated\n   */\n  checkPermission(permission: string) : Promise<boolean> {\n    console.warn('\"PermissionsAndroid.checkPermission\" is deprecated. Use \"PermissionsAndroid.check\" instead');\n    return NativeModules.PermissionsAndroid.checkPermission(permission);\n  }\n\n  /**\n   * Returns a promise resolving to a boolean value as to whether the specified\n   * permissions has been granted\n   */\n  check(permission: string) : Promise<boolean> {\n    return NativeModules.PermissionsAndroid.checkPermission(permission);\n  }\n\n  /**\n   * DEPRECATED - use request\n   *\n   * Prompts the user to enable a permission and returns a promise resolving to a\n   * boolean value indicating whether the user allowed or denied the request\n   *\n   * If the optional rationale argument is included (which is an object with a\n   * `title` and `message`), this function checks with the OS whether it is\n   * necessary to show a dialog explaining why the permission is needed\n   * (https://developer.android.com/training/permissions/requesting.html#explain)\n   * and then shows the system permission dialog\n   *\n   * @deprecated\n   */\n  async requestPermission(permission: string, rationale?: Rationale) : Promise<boolean> {\n    console.warn('\"PermissionsAndroid.requestPermission\" is deprecated. Use \"PermissionsAndroid.request\" instead');\n    const response = await this.request(permission, rationale);\n    return (response === this.RESULTS.GRANTED);\n  }\n\n  /**\n   * Prompts the user to enable a permission and returns a promise resolving to a\n   * string value indicating whether the user allowed or denied the request\n   *\n   * If the optional rationale argument is included (which is an object with a\n   * `title` and `message`), this function checks with the OS whether it is\n   * necessary to show a dialog explaining why the permission is needed\n   * (https://developer.android.com/training/permissions/requesting.html#explain)\n   * and then shows the system permission dialog\n   */\n  async request(permission: string, rationale?: Rationale) : Promise<PermissionStatus> {\n    if (rationale) {\n      const shouldShowRationale = await NativeModules.PermissionsAndroid.shouldShowRequestPermissionRationale(permission);\n\n      if (shouldShowRationale) {\n        return new Promise((resolve, reject) => {\n          NativeModules.DialogManagerAndroid.showAlert(\n            rationale,\n            () => reject(new Error('Error showing rationale')),\n            () => resolve(NativeModules.PermissionsAndroid.requestPermission(permission))\n          );\n        });\n      }\n    }\n    return NativeModules.PermissionsAndroid.requestPermission(permission);\n  }\n\n  /**\n   * Prompts the user to enable multiple permissions in the same dialog and\n   * returns an object with the permissions as keys and strings as values\n   * indicating whether the user allowed or denied the request\n   */\n  requestMultiple(permissions: Array<string>) : Promise<{[permission: string]: PermissionStatus}> {\n    return NativeModules.PermissionsAndroid.requestMultiplePermissions(permissions);\n  }\n}\n\nPermissionsAndroid = new PermissionsAndroid();\n\nmodule.exports = PermissionsAndroid;\n"
  },
  {
    "path": "Libraries/Picker/PickerIOS.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PickerIOS\n *\n * This is a controlled component version of RCTPickerIOS\n */\n'use strict';\n\nconst NativeMethodsMixin = require('NativeMethodsMixin');\nvar React = require('React');\nvar createReactClass = require('create-react-class');\nvar PropTypes = require('prop-types');\nvar RCTPickerIOSConsts = require('NativeModules').UIManager.RCTPicker.Constants;\nvar StyleSheet = require('StyleSheet');\nvar View = require('View');\n\nvar requireNativeComponent = require('requireNativeComponent');\n\nvar PICKER = 'picker';\n\nvar PickerIOS = createReactClass({\n  displayName: 'PickerIOS',\n  mixins: [NativeMethodsMixin],\n\n  propTypes: {\n    onValueChange: PropTypes.func,\n    selectedValue: PropTypes.any, // string or integer basically\n  },\n\n  getInitialState: function() {\n    return this._stateFromProps(this.props);\n  },\n\n  componentWillReceiveProps: function(nextProps) {\n    this.setState(this._stateFromProps(nextProps));\n  },\n\n  // Translate PickerIOS prop and children into stuff that RCTPickerIOS understands.\n  _stateFromProps: function(props) {\n    var selectedIndex = 0;\n    var items = [];\n    React.Children.forEach(props.children, function(child, index) {\n      if (child.props.value === props.selectedValue) {\n        selectedIndex = index;\n      }\n      items.push({ value: child.props.value, label: child.props.label });\n    });\n    return { selectedIndex, items };\n  },\n\n  render: function() {\n    return (\n      <View style={this.props.style}>\n        <RCTPickerIOS\n          ref={PICKER}\n          style={styles.pickerIOS}\n          items={this.state.items}\n          selectedIndex={this.state.selectedIndex}\n          onChange={this._onChange}\n        />\n      </View>\n    );\n  },\n\n  _onChange: function(event) {\n    if (this.props.onChange) {\n      this.props.onChange(event);\n    }\n    if (this.props.onValueChange) {\n      this.props.onValueChange(event.nativeEvent.newValue);\n    }\n\n    // The picker is a controlled component. This means we expect the\n    // on*Change handlers to be in charge of updating our\n    // `selectedValue` prop. That way they can also\n    // disallow/undo/mutate the selection of certain values. In other\n    // words, the embedder of this component should be the source of\n    // truth, not the native component.\n    if (this.state.selectedIndex !== event.nativeEvent.newIndex) {\n      this.refs[PICKER].setNativeProps({\n        selectedIndex: this.state.selectedIndex,\n      });\n    }\n  },\n});\n\nPickerIOS.Item = class extends React.Component {\n  static propTypes = {\n    value: PropTypes.any, // string or integer basically\n    label: PropTypes.string,\n  };\n\n  render() {\n    // These items don't get rendered directly.\n    return null;\n  }\n};\nvar styles = StyleSheet.create({\n  pickerIOS: {\n    // The picker will conform to whatever width is given, but we do\n    // have to set the component's height explicitly on the\n    // surrounding view to ensure it gets rendered.\n    // TODO: investigate why contantsToExport is not available\n    height: RCTPickerIOSConsts ? RCTPickerIOSConsts.ComponentHeight : 20,\n  },\n});\n\nvar RCTPickerIOS = requireNativeComponent('RCTPicker', PickerIOS, {\n  nativeOnly: {\n    items: true,\n    onChange: true,\n    selectedIndex: true,\n  },\n});\n\nmodule.exports = PickerIOS;\n"
  },
  {
    "path": "Libraries/Promise.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Promise\n * @flow\n */\n'use strict';\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst Promise = require('fbjs/lib/Promise.native');\n\nif (__DEV__) {\n  /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an\n   * error found when Flow v0.54 was deployed. To see the error delete this\n   * comment and run Flow. */\n  require('promise/setimmediate/rejection-tracking').enable({\n    allRejections: true,\n    onUnhandled: (id, error = {}) => {\n      let message: string;\n      let stack: ?string;\n\n      const stringValue = Object.prototype.toString.call(error);\n      if (stringValue === '[object Error]') {\n        message = Error.prototype.toString.call(error);\n        stack = error.stack;\n      } else {\n        /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses\n         * an error found when Flow v0.54 was deployed. To see the error delete\n         * this comment and run Flow. */\n        message = require('pretty-format')(error);\n      }\n\n      const warning =\n        `Possible Unhandled Promise Rejection (id: ${id}):\\n` +\n        `${message}\\n` +\n        (stack == null ? '' : stack);\n      console.warn(warning);\n    },\n    onHandled: (id) => {\n      const warning =\n        `Promise Rejection Handled (id: ${id})\\n` +\n        'This means you can ignore any previous messages of the form ' +\n        `\"Possible Unhandled Promise Rejection (id: ${id}):\"`;\n      console.warn(warning);\n    },\n  });\n}\n\nmodule.exports = Promise;\n"
  },
  {
    "path": "Libraries/PushNotificationIOS/PushNotificationIOS.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PushNotificationIOS\n * @flow\n */\n'use strict';\n\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst RCTPushNotificationManager = require('NativeModules').PushNotificationManager;\nconst invariant = require('fbjs/lib/invariant');\n\nconst PushNotificationEmitter = new NativeEventEmitter(RCTPushNotificationManager);\n\nconst _notifHandlers = new Map();\n\nconst DEVICE_NOTIF_EVENT = 'remoteNotificationReceived';\nconst NOTIF_REGISTER_EVENT = 'remoteNotificationsRegistered';\nconst NOTIF_REGISTRATION_ERROR_EVENT = 'remoteNotificationRegistrationError';\nconst DEVICE_LOCAL_NOTIF_EVENT = 'localNotificationReceived';\n\nexport type ContentAvailable = 1 | null | void;\n\nexport type FetchResult = {\n  NewData: string,\n  NoData: string,\n  ResultFailed: string,\n};\n\n/**\n * An event emitted by PushNotificationIOS.\n */\nexport type PushNotificationEventName = $Enum<{\n  /**\n   * Fired when a remote notification is received. The handler will be invoked\n   * with an instance of `PushNotificationIOS`.\n   */\n  notification: string,\n  /**\n   * Fired when a local notification is received. The handler will be invoked\n   * with an instance of `PushNotificationIOS`.\n   */\n  localNotification: string,\n  /**\n   * Fired when the user registers for remote notifications. The handler will be\n   * invoked with a hex string representing the deviceToken.\n   */\n  register: string,\n  /**\n   * Fired when the user fails to register for remote notifications. Typically\n   * occurs when APNS is having issues, or the device is a simulator. The\n   * handler will be invoked with {message: string, code: number, details: any}.\n   */\n  registrationError: string,\n}>;\n\n/**\n * <div class=\"banner-crna-ejected\">\n *   <h3>Projects with Native Code Only</h3>\n *   <p>\n *     This section only applies to projects made with <code>react-native init</code>\n *     or to those made with Create React Native App which have since ejected. For\n *     more information about ejecting, please see\n *     the <a href=\"https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md\" target=\"_blank\">guide</a> on\n *     the Create React Native App repository.\n *   </p>\n * </div>\n *\n * Handle push notifications for your app, including permission handling and\n * icon badge number.\n *\n * To get up and running, [configure your notifications with Apple](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html#//apple_ref/doc/uid/TP40012582-CH26-SW6)\n * and your server-side system.\n *\n * [Manually link](docs/linking-libraries-ios.html#manual-linking) the PushNotificationIOS library\n *\n * - Add the following to your Project: `node_modules/react-native-macos/LibrariesPushNotificationIOS/RCTPushNotification.xcodeproj`\n * - Add the following to `Link Binary With Libraries`: `libRCTPushNotification.a`\n *\n * Finally, to enable support for `notification` and `register` events you need to augment your AppDelegate.\n *\n * At the top of your `AppDelegate.m`:\n *\n *   `#import <React/RCTPushNotificationManager.h>`\n *\n * And then in your AppDelegate implementation add the following:\n *\n *   ```\n *    // Required to register for notifications\n *    - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings\n *    {\n *     [RCTPushNotificationManager didRegisterUserNotificationSettings:notificationSettings];\n *    }\n *    // Required for the register event.\n *    - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken\n *    {\n *     [RCTPushNotificationManager didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];\n *    }\n *    // Required for the notification event. You must call the completion handler after handling the remote notification.\n *    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo\n *                                                           fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler\n *    {\n *      [RCTPushNotificationManager didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];\n *    }\n *    // Required for the registrationError event.\n *    - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error\n *    {\n *     [RCTPushNotificationManager didFailToRegisterForRemoteNotificationsWithError:error];\n *    }\n *    // Required for the localNotification event.\n *    - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification\n *    {\n *     [RCTPushNotificationManager didReceiveLocalNotification:notification];\n *    }\n *   ```\n */\nclass PushNotificationIOS {\n  _data: Object;\n  _alert: string | Object;\n  _sound: string;\n  _category: string;\n  _contentAvailable: ContentAvailable;\n  _badgeCount: number;\n  _notificationId: string;\n  _isRemote: boolean;\n  _remoteNotificationCompleteCallbackCalled: boolean;\n\n  static FetchResult: FetchResult = {\n    NewData: 'UIBackgroundFetchResultNewData',\n    NoData: 'UIBackgroundFetchResultNoData',\n    ResultFailed: 'UIBackgroundFetchResultFailed',\n  };\n\n  /**\n   * Schedules the localNotification for immediate presentation.\n   *\n   * details is an object containing:\n   *\n   * - `alertBody` : The message displayed in the notification alert.\n   * - `alertAction` : The \"action\" displayed beneath an actionable notification. Defaults to \"view\";\n   * - `soundName` : The sound played when the notification is fired (optional).\n   * - `isSilent`  : If true, the notification will appear without sound (optional).\n   * - `category`  : The category of this notification, required for actionable notifications (optional).\n   * - `userInfo`  : An optional object containing additional notification data.\n   * - `applicationIconBadgeNumber` (optional) : The number to display as the app's icon badge. The default value of this property is 0, which means that no badge is displayed.\n   */\n  static presentLocalNotification(details: Object) {\n    RCTPushNotificationManager.presentLocalNotification(details);\n    if (details.handler) {\n      PushNotificationEmitter.addListener(\n        'localNotificationClicked',\n        details.handler)\n    }\n  }\n\n  /**\n   * Schedules the localNotification for future presentation.\n   *\n   * details is an object containing:\n   *\n   * - `fireDate` : The date and time when the system should deliver the notification.\n   * - `alertTitle` : The text displayed as the title of the notification alert.\n   * - `alertBody` : The message displayed in the notification alert.\n   * - `alertAction` : The \"action\" displayed beneath an actionable notification. Defaults to \"view\";\n   * - `soundName` : The sound played when the notification is fired (optional).\n   * - `isSilent`  : If true, the notification will appear without sound (optional).\n   * - `category`  : The category of this notification, required for actionable notifications (optional).\n   * - `userInfo` : An optional object containing additional notification data.\n   * - `applicationIconBadgeNumber` (optional) : The number to display as the app's icon badge. Setting the number to 0 removes the icon badge.\n   * - `repeatInterval` : The interval to repeat as a string.  Possible values: `minute`, `hour`, `day`, `week`, `month`, `year`.\n   */\n  static scheduleLocalNotification(details: Object) {\n    RCTPushNotificationManager.scheduleLocalNotification(details);\n  }\n\n  /**\n   * Cancels all scheduled localNotifications\n   */\n  static cancelAllLocalNotifications() {\n    RCTPushNotificationManager.cancelAllLocalNotifications();\n  }\n\n  /**\n   * Remove all delivered notifications from Notification Center\n   */\n  static removeAllDeliveredNotifications(): void {\n    RCTPushNotificationManager.removeAllDeliveredNotifications();\n  }\n\n  /**\n   * Provides you with a list of the app’s notifications that are still displayed in Notification Center\n   *\n   * @param callback Function which receive an array of delivered notifications\n   *\n   *  A delivered notification is an object containing:\n   *\n   * - `identifier`  : The identifier of this notification.\n   * - `title`  : The title of this notification.\n   * - `body`  : The body of this notification.\n   * - `category`  : The category of this notification, if has one.\n   * - `userInfo`  : An optional object containing additional notification data.\n   * - `thread-id`  : The thread identifier of this notification, if has one.\n   */\n  static getDeliveredNotifications(callback: (notifications: Array<Object>) => void): void {\n    RCTPushNotificationManager.getDeliveredNotifications(callback);\n  }\n\n  /**\n   * Removes the specified notifications from Notification Center\n   *\n   * @param identifiers Array of notification identifiers\n   */\n  static removeDeliveredNotifications(identifiers: Array<string>): void {\n    RCTPushNotificationManager.removeDeliveredNotifications(identifiers);\n  }\n\n  /**\n   * Sets the badge number for the app icon on the home screen\n   */\n  static setApplicationIconBadgeNumber(number: number) {\n    RCTPushNotificationManager.setApplicationIconBadgeNumber(number);\n  }\n\n  /**\n   * Gets the current badge number for the app icon on the home screen\n   */\n  static getApplicationIconBadgeNumber(callback: Function) {\n    RCTPushNotificationManager.getApplicationIconBadgeNumber(callback);\n  }\n\n  /**\n   * Cancel local notifications.\n   *\n   * Optionally restricts the set of canceled notifications to those\n   * notifications whose `userInfo` fields match the corresponding fields\n   * in the `userInfo` argument.\n   */\n  static cancelLocalNotifications(userInfo: Object) {\n    RCTPushNotificationManager.cancelLocalNotifications(userInfo);\n  }\n\n  /**\n   * Gets the local notifications that are currently scheduled.\n   */\n  static getScheduledLocalNotifications(callback: Function) {\n    RCTPushNotificationManager.getScheduledLocalNotifications(callback);\n  }\n\n  /**\n   * Attaches a listener to remote or local notification events while the app is running\n   * in the foreground or the background.\n   *\n   * Valid events are:\n   *\n   * - `notification` : Fired when a remote notification is received. The\n   *   handler will be invoked with an instance of `PushNotificationIOS`.\n   * - `localNotification` : Fired when a local notification is received. The\n   *   handler will be invoked with an instance of `PushNotificationIOS`.\n   * - `register`: Fired when the user registers for remote notifications. The\n   *   handler will be invoked with a hex string representing the deviceToken.\n   * - `registrationError`: Fired when the user fails to register for remote\n   *   notifications. Typically occurs when APNS is having issues, or the device\n   *   is a simulator. The handler will be invoked with\n   *   {message: string, code: number, details: any}.\n   */\n  static addEventListener(type: PushNotificationEventName, handler: Function) {\n    invariant(\n      type === 'notification' || type === 'register' || type === 'registrationError' || type === 'localNotification',\n      'PushNotificationIOS only supports `notification`, `register`, `registrationError`, and `localNotification` events'\n    );\n    var listener;\n    if (type === 'notification') {\n      listener =  PushNotificationEmitter.addListener(\n        DEVICE_NOTIF_EVENT,\n        (notifData) => {\n          handler(new PushNotificationIOS(notifData));\n        }\n      );\n    } else if (type === 'localNotification') {\n      listener = PushNotificationEmitter.addListener(\n        DEVICE_LOCAL_NOTIF_EVENT,\n        (notifData) => {\n          handler(new PushNotificationIOS(notifData));\n        }\n      );\n    } else if (type === 'register') {\n      listener = PushNotificationEmitter.addListener(\n        NOTIF_REGISTER_EVENT,\n        (registrationInfo) => {\n          handler(registrationInfo.deviceToken);\n        }\n      );\n    } else if (type === 'registrationError') {\n      listener = PushNotificationEmitter.addListener(\n        NOTIF_REGISTRATION_ERROR_EVENT,\n        (errorInfo) => {\n          handler(errorInfo);\n        }\n      );\n    }\n    _notifHandlers.set(type, listener);\n  }\n\n  /**\n   * Removes the event listener. Do this in `componentWillUnmount` to prevent\n   * memory leaks\n   */\n  static removeEventListener(type: PushNotificationEventName, handler: Function) {\n    invariant(\n      type === 'notification' || type === 'register' || type === 'registrationError' || type === 'localNotification',\n      'PushNotificationIOS only supports `notification`, `register`, `registrationError`, and `localNotification` events'\n    );\n    var listener = _notifHandlers.get(type);\n    if (!listener) {\n      return;\n    }\n    listener.remove();\n    _notifHandlers.delete(type);\n  }\n\n  /**\n   * Requests notification permissions from iOS, prompting the user's\n   * dialog box. By default, it will request all notification permissions, but\n   * a subset of these can be requested by passing a map of requested\n   * permissions.\n   * The following permissions are supported:\n   *\n   *   - `alert`\n   *   - `badge`\n   *   - `sound`\n   *\n   * If a map is provided to the method, only the permissions with truthy values\n   * will be requested.\n\n   * This method returns a promise that will resolve when the user accepts,\n   * rejects, or if the permissions were previously rejected. The promise\n   * resolves to the current state of the permission.\n   */\n  static requestPermissions(permissions?: {\n    alert?: boolean,\n    badge?: boolean,\n    sound?: boolean\n  }): Promise<{\n    alert: boolean,\n    badge: boolean,\n    sound: boolean\n  }> {\n    var requestedPermissions = {};\n    if (permissions) {\n      requestedPermissions = {\n        alert: !!permissions.alert,\n        badge: !!permissions.badge,\n        sound: !!permissions.sound\n      };\n    } else {\n      requestedPermissions = {\n        alert: true,\n        badge: true,\n        sound: true\n      };\n    }\n    return RCTPushNotificationManager.requestPermissions(requestedPermissions);\n  }\n\n  /**\n   * Unregister for all remote notifications received via Apple Push Notification service.\n   *\n   * You should call this method in rare circumstances only, such as when a new version of\n   * the app removes support for all types of remote notifications. Users can temporarily\n   * prevent apps from receiving remote notifications through the Notifications section of\n   * the Settings app. Apps unregistered through this method can always re-register.\n   */\n  static abandonPermissions() {\n    RCTPushNotificationManager.abandonPermissions();\n  }\n\n  /**\n   * See what push permissions are currently enabled. `callback` will be\n   * invoked with a `permissions` object:\n   *\n   *  - `alert` :boolean\n   *  - `badge` :boolean\n   *  - `sound` :boolean\n   */\n  static checkPermissions(callback: Function) {\n    invariant(\n      typeof callback === 'function',\n      'Must provide a valid callback'\n    );\n    RCTPushNotificationManager.checkPermissions(callback);\n  }\n\n  /**\n   * This method returns a promise that resolves to either the notification\n   * object if the app was launched by a push notification, or `null` otherwise.\n   */\n  static getInitialNotification(): Promise<?PushNotificationIOS> {\n    return RCTPushNotificationManager.getInitialNotification().then(notification => {\n      return notification && new PushNotificationIOS(notification);\n    });\n  }\n\n  /**\n   * You will never need to instantiate `PushNotificationIOS` yourself.\n   * Listening to the `notification` event and invoking\n   * `getInitialNotification` is sufficient\n   */\n  constructor(nativeNotif: Object) {\n    this._data = {};\n    this._remoteNotificationCompleteCallbackCalled = false;\n    this._isRemote = nativeNotif.remote;\n    if (this._isRemote) {\n      this._notificationId = nativeNotif.notificationId;\n    }\n\n    if (nativeNotif.remote) {\n      // Extract data from Apple's `aps` dict as defined:\n      // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html\n      Object.keys(nativeNotif).forEach((notifKey) => {\n        var notifVal = nativeNotif[notifKey];\n        if (notifKey === 'aps') {\n          this._alert = notifVal.alert;\n          this._sound = notifVal.sound;\n          this._badgeCount = notifVal.badge;\n          this._category = notifVal.category;\n          this._contentAvailable = notifVal['content-available'];\n        } else {\n          this._data[notifKey] = notifVal;\n        }\n      });\n    } else {\n      // Local notifications aren't being sent down with `aps` dict.\n      this._badgeCount = nativeNotif.applicationIconBadgeNumber;\n      this._sound = nativeNotif.soundName;\n      this._alert = nativeNotif.alertBody;\n      this._data = nativeNotif.userInfo;\n      this._category = nativeNotif.category;\n    }\n  }\n\n  /**\n   * This method is available for remote notifications that have been received via:\n   * `application:didReceiveRemoteNotification:fetchCompletionHandler:`\n   * https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/#//apple_ref/occ/intfm/UIApplicationDelegate/application:didReceiveRemoteNotification:fetchCompletionHandler:\n   *\n   * Call this to execute when the remote notification handling is complete. When\n   * calling this block, pass in the fetch result value that best describes\n   * the results of your operation. You *must* call this handler and should do so\n   * as soon as possible. For a list of possible values, see `PushNotificationIOS.FetchResult`.\n   *\n   * If you do not call this method your background remote notifications could\n   * be throttled, to read more about it see the above documentation link.\n   */\n  finish(fetchResult: FetchResult) {\n    if (!this._isRemote || !this._notificationId || this._remoteNotificationCompleteCallbackCalled) {\n      return;\n    }\n    this._remoteNotificationCompleteCallbackCalled = true;\n\n    RCTPushNotificationManager.onFinishRemoteNotification(this._notificationId, fetchResult);\n  }\n\n  /**\n   * An alias for `getAlert` to get the notification's main message string\n   */\n  getMessage(): ?string | ?Object {\n    // alias because \"alert\" is an ambiguous name\n    return this._alert;\n  }\n\n  /**\n   * Gets the sound string from the `aps` object\n   */\n  getSound(): ?string {\n    return this._sound;\n  }\n\n  /**\n   * Gets the category string from the `aps` object\n   */\n  getCategory(): ?string {\n    return this._category;\n  }\n\n  /**\n   * Gets the notification's main message from the `aps` object\n   */\n  getAlert(): ?string | ?Object {\n    return this._alert;\n  }\n\n  /**\n   * Gets the content-available number from the `aps` object\n   */\n  getContentAvailable(): ContentAvailable {\n    return this._contentAvailable;\n  }\n\n  /**\n   * Gets the badge count number from the `aps` object\n   */\n  getBadgeCount(): ?number {\n    return this._badgeCount;\n  }\n\n  /**\n   * Gets the data object on the notif\n   */\n  getData(): ?Object {\n    return this._data;\n  }\n}\n\nmodule.exports = PushNotificationIOS;\n"
  },
  {
    "path": "Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t148699CF1ABD045300480536 /* RCTPushNotificationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 148699CE1ABD045300480536 /* RCTPushNotificationManager.m */; };\n\t\t3D0574931DE6009C00184BB4 /* RCTPushNotificationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 148699CE1ABD045300480536 /* RCTPushNotificationManager.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t3D05745D1DE6004600184BB4 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/$(PRODUCT_NAME)\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t58B511D91A9E6C8500147676 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/$(PRODUCT_NAME)\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t134814201AA4EA6300B7C361 /* libRCTPushNotification.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTPushNotification.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t148699CD1ABD045300480536 /* RCTPushNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTPushNotificationManager.h; sourceTree = \"<group>\"; };\n\t\t148699CE1ABD045300480536 /* RCTPushNotificationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPushNotificationManager.m; sourceTree = \"<group>\"; };\n\t\t3D05745F1DE6004600184BB4 /* libRCTPushNotification-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libRCTPushNotification-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t3D05745C1DE6004600184BB4 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t58B511D81A9E6C8500147676 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t134814211AA4EA7D00B7C361 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134814201AA4EA6300B7C361 /* libRCTPushNotification.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58B511D21A9E6C8500147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t148699CD1ABD045300480536 /* RCTPushNotificationManager.h */,\n\t\t\t\t148699CE1ABD045300480536 /* RCTPushNotificationManager.m */,\n\t\t\t\t134814211AA4EA7D00B7C361 /* Products */,\n\t\t\t\t3D05745F1DE6004600184BB4 /* libRCTPushNotification-tvOS.a */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t3D05745E1DE6004600184BB4 /* RCTPushNotification-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D0574671DE6004600184BB4 /* Build configuration list for PBXNativeTarget \"RCTPushNotification-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D05745B1DE6004600184BB4 /* Sources */,\n\t\t\t\t3D05745C1DE6004600184BB4 /* Frameworks */,\n\t\t\t\t3D05745D1DE6004600184BB4 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"RCTPushNotification-tvOS\";\n\t\t\tproductName = \"RCTPushNotification-tvOS\";\n\t\t\tproductReference = 3D05745F1DE6004600184BB4 /* libRCTPushNotification-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t58B511DA1A9E6C8500147676 /* RCTPushNotification */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTPushNotification\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t58B511D71A9E6C8500147676 /* Sources */,\n\t\t\t\t58B511D81A9E6C8500147676 /* Frameworks */,\n\t\t\t\t58B511D91A9E6C8500147676 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTPushNotification;\n\t\t\tproductName = RCTDataManager;\n\t\t\tproductReference = 134814201AA4EA6300B7C361 /* libRCTPushNotification.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511D31A9E6C8500147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t3D05745E1DE6004600184BB4 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.1;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t58B511DA1A9E6C8500147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTPushNotification\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511D21A9E6C8500147676;\n\t\t\tproductRefGroup = 58B511D21A9E6C8500147676;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B511DA1A9E6C8500147676 /* RCTPushNotification */,\n\t\t\t\t3D05745E1DE6004600184BB4 /* RCTPushNotification-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t3D05745B1DE6004600184BB4 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D0574931DE6009C00184BB4 /* RCTPushNotificationManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t58B511D71A9E6C8500147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t148699CF1ABD045300480536 /* RCTPushNotificationManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t3D0574651DE6004600184BB4 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D0574661DE6004600184BB4 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511ED1A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"DEBUG=1\";\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511EE1A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"\";\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511F01A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTPushNotification;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511F11A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTPushNotification;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t3D0574671DE6004600184BB4 /* Build configuration list for PBXNativeTarget \"RCTPushNotification-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D0574651DE6004600184BB4 /* Debug */,\n\t\t\t\t3D0574661DE6004600184BB4 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTPushNotification\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511ED1A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511EE1A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTPushNotification\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511F01A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511F11A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511D31A9E6C8500147676 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/PushNotificationIOS/RCTPushNotificationManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTEventEmitter.h>\n\nextern NSString *const RCTRemoteNotificationReceived;\n\n@interface RCTPushNotificationManager : RCTEventEmitter\n\n//+ (void)didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings;\n+ (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;\n+ (void)didReceiveRemoteNotification:(NSDictionary *)notification;\n+ (void)didReceiveLocalNotification:(NSUserNotification *)notification;\n\n@end\n"
  },
  {
    "path": "Libraries/PushNotificationIOS/RCTPushNotificationManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTPushNotificationManager.h\"\n\n#import <UserNotifications/UserNotifications.h>\n\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTUtils.h>\n\nNSString *const RCTLocalNotificationReceived = @\"LocalNotificationReceived\";\nNSString *const RCTRemoteNotificationReceived = @\"RemoteNotificationReceived\";\nNSString *const RCTRemoteNotificationsRegistered = @\"RemoteNotificationsRegistered\";\nNSString *const RCTRegisterUserNotificationSettings = @\"RegisterUserNotificationSettings\";\n\nNSString *const RCTErrorUnableToRequestPermissions = @\"E_UNABLE_TO_REQUEST_PERMISSIONS\";\nNSString *const RCTErrorRemoteNotificationRegistrationFailed = @\"E_FAILED_TO_REGISTER_FOR_REMOTE_NOTIFICATIONS\";\n\n@implementation RCTConvert (NSUserNotification)\n\n+ (NSUserNotification *)NSUserNotification:(id)json\n{\n  NSDictionary<NSString *, id> *details = [self NSDictionary:json];\n  NSUserNotification *notification = [NSUserNotification new];\n  notification.deliveryDate = [RCTConvert NSDate:details[@\"fireDate\"]] ?: [NSDate date];\n  notification.informativeText = [RCTConvert NSString:details[@\"alertBody\"]];\n  notification.soundName = [RCTConvert NSString:details[@\"soundName\"]] ?: NSUserNotificationDefaultSoundName;\n  notification.userInfo = [RCTConvert NSDictionary:details[@\"userInfo\"]];\n  if (details[@\"title\"]) {\n    notification.title = [RCTConvert NSString:details[@\"title\"]];\n  }\n  return notification;\n}\n\n@end\n\n@implementation RCTPushNotificationManager\n{\n  RCTPromiseResolveBlock _requestPermissionsResolveBlock;\n}\n\nstatic NSDictionary *RCTFormatLocalNotification(NSUserNotification *notification)\n{\n  NSMutableDictionary *formattedLocalNotification = [NSMutableDictionary dictionary];\n  if (notification.actualDeliveryDate) {\n    NSDateFormatter *formatter = [NSDateFormatter new];\n    [formatter setDateFormat:@\"yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ\"];\n    NSString *fireDateString = [formatter stringFromDate:notification.actualDeliveryDate];\n    formattedLocalNotification[@\"fireDate\"] = fireDateString;\n  }\n  formattedLocalNotification[@\"alertAction\"] = RCTNullIfNil(notification.actionButtonTitle);\n  formattedLocalNotification[@\"alertBody\"] = RCTNullIfNil(notification.informativeText);\n//  formattedLocalNotification[@\"applicationIconBadgeNumber\"] = @(notification.applicationIconBadgeNumber);\n//  formattedLocalNotification[@\"category\"] = RCTNullIfNil(notification.category);\n  formattedLocalNotification[@\"soundName\"] = RCTNullIfNil(notification.soundName);\n  formattedLocalNotification[@\"userInfo\"] = RCTNullIfNil(RCTJSONClean(notification.userInfo));\n  formattedLocalNotification[@\"remote\"] = @NO;\n  return formattedLocalNotification;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  _bridge = bridge;\n}\n\n- (void)startObserving\n{\n  [[NSNotificationCenter defaultCenter] addObserver:self\n                                           selector:@selector(handleLocalNotificationReceived:)\n                                               name:RCTLocalNotificationReceived\n                                             object:nil];\n  [[NSNotificationCenter defaultCenter] addObserver:self\n                                           selector:@selector(handleRemoteNotificationReceived:)\n                                               name:RCTRemoteNotificationReceived\n                                             object:nil];\n  [[NSNotificationCenter defaultCenter] addObserver:self\n                                           selector:@selector(handleRemoteNotificationsRegistered:)\n                                               name:RCTRemoteNotificationsRegistered\n                                             object:nil];\n\n  [NSUserNotificationCenter defaultUserNotificationCenter].delegate = self;\n}\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[@\"localNotificationReceived\",\n           @\"remoteNotificationReceived\",\n           @\"remoteNotificationsRegistered\",\n           @\"remoteNotificationRegistrationError\"];\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  NSDictionary<NSString *, id> *initialNotification =\n    [_bridge.launchOptions[NSApplicationLaunchUserNotificationKey] copy];\n  return @{@\"initialNotification\": RCTNullIfNil(initialNotification)};\n}\n\n\n+ (void)didRegisterUserNotificationSettings\n{\n  if ([NSApplication instancesRespondToSelector:@selector(registerForRemoteNotifications)]) {\n    //[[NSApplication sharedApplication] registerForRemoteNotifications];\n  }\n}\n\n+ (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken\n{\n  NSMutableString *hexString = [NSMutableString string];\n  NSUInteger deviceTokenLength = deviceToken.length;\n  const unsigned char *bytes = deviceToken.bytes;\n  for (NSUInteger i = 0; i < deviceTokenLength; i++) {\n    [hexString appendFormat:@\"%02x\", bytes[i]];\n  }\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTRemoteNotificationsRegistered\n                                                      object:self\n                                                    userInfo:@{@\"deviceToken\" : [hexString copy]}];\n}\n\n+ (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error\n{\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTErrorRemoteNotificationRegistrationFailed\n                                                      object:self\n                                                    userInfo:@{@\"error\": error}];\n}\n\n+ (void)didReceiveRemoteNotification:(NSDictionary *)notification\n{\n  NSDictionary *userInfo = @{@\"notification\": notification};\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTRemoteNotificationReceived\n                                                      object:self\n                                                    userInfo:userInfo];\n}\n\n+ (void)didReceiveLocalNotification:(NSUserNotification*)notification\n{\n  NSMutableDictionary *details = [NSMutableDictionary new];\n  if (notification.informativeText) {\n    details[@\"alertBody\"] = notification.informativeText;\n  }\n  if (notification.userInfo) {\n    details[@\"userInfo\"] = RCTJSONClean(notification.userInfo);\n  }\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTLocalNotificationReceived\n                                                      object:self\n                                                    userInfo:RCTFormatLocalNotification(notification)];\n}\n\n- (void)handleLocalNotificationReceived:(NSNotification *)notification\n{\n  [self sendEventWithName:@\"localNotificationReceived\" body:notification.userInfo];\n}\n\n- (void)handleRemoteNotificationReceived:(NSNotification *)notification\n{\n  NSMutableDictionary *remoteNotification = [NSMutableDictionary dictionaryWithDictionary:notification.userInfo[@\"notification\"]];\n  RCTRemoteNotificationCallback completionHandler = notification.userInfo[@\"completionHandler\"];\n  NSString *notificationId = [[NSUUID UUID] UUIDString];\n  remoteNotification[@\"notificationId\"] = notificationId;\n  remoteNotification[@\"remote\"] = @YES;\n  if (completionHandler) {\n    if (!self.remoteNotificationCallbacks) {\n      // Lazy initialization\n      self.remoteNotificationCallbacks = [NSMutableDictionary dictionary];\n    }\n    self.remoteNotificationCallbacks[notificationId] = completionHandler;\n  }\n\n  [self sendEventWithName:@\"remoteNotificationReceived\" body:remoteNotification];\n}\n\n- (void)handleRemoteNotificationsRegistered:(NSNotification *)notification\n{\n  [self sendEventWithName:@\"remoteNotificationsRegistered\" body:notification.userInfo];\n}\n\n- (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification\n{\n  NSError *error = notification.userInfo[@\"error\"];\n  NSDictionary *errorDetails = @{\n    @\"message\": error.localizedDescription,\n    @\"code\": @(error.code),\n    @\"details\": error.userInfo,\n  };\n  [self sendEventWithName:@\"remoteNotificationRegistrationError\" body:errorDetails];\n}\n\n- (void)handleRegisterUserNotificationSettings:(NSNotification *)notification\n{\n  if (_requestPermissionsResolveBlock == nil) {\n    return;\n  }\n\n  UIUserNotificationSettings *notificationSettings = notification.userInfo[@\"notificationSettings\"];\n  NSDictionary *notificationTypes = @{\n    @\"alert\": @((notificationSettings.types & UIUserNotificationTypeAlert) > 0),\n    @\"sound\": @((notificationSettings.types & UIUserNotificationTypeSound) > 0),\n    @\"badge\": @((notificationSettings.types & UIUserNotificationTypeBadge) > 0),\n  };\n\n  _requestPermissionsResolveBlock(notificationTypes);\n  // Clean up listener added in requestPermissions\n  [self removeListeners:1];\n  _requestPermissionsResolveBlock = nil;\n}\n\nRCT_EXPORT_METHOD(onFinishRemoteNotification:(NSString *)notificationId fetchResult:(UIBackgroundFetchResult)result) {\n  RCTRemoteNotificationCallback completionHandler = self.remoteNotificationCallbacks[notificationId];\n  if (!completionHandler) {\n    RCTLogError(@\"There is no completion handler with notification id: %@\", notificationId);\n    return;\n  }\n  completionHandler(result);\n  [self.remoteNotificationCallbacks removeObjectForKey:notificationId];\n}\n\n/**\n * Update the application icon badge number on the home screen\n */\nRCT_EXPORT_METHOD(setApplicationIconBadgeNumber:(NSInteger)number)\n{\n  RCTSharedApplication().dockTile.badgeLabel = @(number);\n}\n\n/**\n * Get the current application icon badge number on the home screen\n */\nRCT_EXPORT_METHOD(getApplicationIconBadgeNumber:(RCTResponseSenderBlock)callback)\n{\n  callback(@[RCTSharedApplication().dockTile.badgeLabel]);\n}\n\nRCT_EXPORT_METHOD(requestPermissions:(NSDictionary *)permissions\n                 resolver:(RCTPromiseResolveBlock)resolve\n                 rejecter:(RCTPromiseRejectBlock)reject)\n{\n  if (RCTRunningInAppExtension()) {\n    reject(RCTErrorUnableToRequestPermissions, nil, RCTErrorWithMessage(@\"Requesting push notifications is currently unavailable in an app extension\"));\n    return;\n  }\n//\n//  UIUserNotificationType types = UIUserNotificationTypeNone;\n//  if (permissions) {\n//    if ([RCTConvert BOOL:permissions[@\"alert\"]]) {\n//      types |= UIUserNotificationTypeAlert;\n//    }\n//    if ([RCTConvert BOOL:permissions[@\"badge\"]]) {\n//      types |= UIUserNotificationTypeBadge;\n//    }\n//    if ([RCTConvert BOOL:permissions[@\"sound\"]]) {\n//      types |= UIUserNotificationTypeSound;\n//    }\n//  } else {\n//    types = UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound;\n//  }\n//\n//  UIApplication *app = RCTSharedApplication();\n//  if ([app respondsToSelector:@selector(registerUserNotificationSettings:)]) {\n//    UIUserNotificationSettings *notificationSettings =\n//      [UIUserNotificationSettings settingsForTypes:(NSUInteger)types categories:nil];\n//    [app registerUserNotificationSettings:notificationSettings];\n//  } else {\n//    [app registerForRemoteNotificationTypes:(NSUInteger)types];\n//  }\n}\n\nRCT_EXPORT_METHOD(abandonPermissions)\n{\n  [RCTSharedApplication() unregisterForRemoteNotifications];\n}\n\nRCT_EXPORT_METHOD(checkPermissions:(RCTResponseSenderBlock)callback)\n{\n  if (RCTRunningInAppExtension()) {\n    callback(@[@{@\"alert\": @NO, @\"badge\": @NO, @\"sound\": @NO}]);\n    return;\n  }\n\n  NSUInteger types = [RCTSharedApplication() currentUserNotificationSettings].types;\n  callback(@[@{\n    @\"alert\": @((types & UIUserNotificationTypeAlert) > 0),\n    @\"badge\": @((types & UIUserNotificationTypeBadge) > 0),\n    @\"sound\": @((types & UIUserNotificationTypeSound) > 0),\n  }]);\n}\n\nRCT_EXPORT_METHOD(presentLocalNotification:(NSUserNotification *)notification)\n{\n  [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];\n}\n\nRCT_EXPORT_METHOD(scheduleLocalNotification:(NSUserNotification *)notification)\n{\n  [[NSUserNotificationCenter defaultUserNotificationCenter] scheduleNotification:notification];\n}\n\nRCT_EXPORT_METHOD(cancelAllLocalNotifications)\n{\n  for (NSUserNotification *notification in [NSUserNotificationCenter defaultUserNotificationCenter].scheduledNotifications) {\n    [[NSUserNotificationCenter defaultUserNotificationCenter] removeScheduledNotification:notification];\n  }\n}\n\nRCT_EXPORT_METHOD(cancelLocalNotifications:(NSDictionary<NSString *, id> *)userInfo)\n{\n  for (UILocalNotification *notification in RCTSharedApplication().scheduledLocalNotifications) {\n    __block BOOL matchesAll = YES;\n    NSDictionary<NSString *, id> *notificationInfo = notification.userInfo;\n    // Note: we do this with a loop instead of just `isEqualToDictionary:`\n    // because we only require that all specified userInfo values match the\n    // notificationInfo values - notificationInfo may contain additional values\n    // which we don't care about.\n    [userInfo enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop) {\n      if (![notificationInfo[key] isEqual:obj]) {\n        matchesAll = NO;\n        *stop = YES;\n      }\n    }];\n    if (matchesAll) {\n      [[NSUserNotificationCenter defaultUserNotificationCenter] removeScheduledNotification:notification];\n    }\n  }\n}\n\n- (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification {\n  return YES;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/FBSnapshotTestCase/FBSnapshotTestCase.h",
    "content": "/*\n *  Copyright (c) 2013, Facebook, Inc.\n *  All rights reserved.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <QuartzCore/QuartzCore.h>\n\n#import <UIKit/UIKit.h>\n\n#import <XCTest/XCTest.h>\n\n#ifndef FB_REFERENCE_IMAGE_DIR\n#define FB_REFERENCE_IMAGE_DIR \"\\\"$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages\\\"\"\n#endif\n\n/**\n The base class of view snapshotting tests. If you have small UI component, it's often easier to configure it in a test\n and compare an image of the view to a reference image that write lots of complex layout-code tests.\n\n In order to flip the tests in your subclass to record the reference images set `recordMode` to YES before calling\n -[super setUp].\n */\n@interface FBSnapshotTestCase : XCTestCase\n\n/**\n When YES, the test macros will save reference images, rather than performing an actual test.\n */\n@property (readwrite, nonatomic, assign) BOOL recordMode;\n\n/**\n Performs the comparisons or records a snapshot of the view if recordMode is YES.\n @param view The view to snapshot\n @param referenceImagesDirectory The directory in which reference images are stored.\n @param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method.\n @param error An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).\n @returns YES if the comparison (or saving of the reference image) succeeded.\n */\n- (BOOL)compareSnapshotOfView:(NSView *)view\n     referenceImagesDirectory:(NSString *)referenceImagesDirectory\n                   identifier:(NSString *)identifier\n                        error:(NSError **)errorPtr;\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/FBSnapshotTestCase/FBSnapshotTestCase.m",
    "content": "/*\n *  Copyright (c) 2013, Facebook, Inc.\n *  All rights reserved.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import \"FBSnapshotTestCase.h\"\n\n#import \"FBSnapshotTestController.h\"\n\n@interface FBSnapshotTestCase ()\n\n@property (readwrite, nonatomic, retain) FBSnapshotTestController *snapshotController;\n\n@end\n\n@implementation FBSnapshotTestCase\n\n- (void)setUp\n{\n  [super setUp];\n  self.snapshotController = [[FBSnapshotTestController alloc] initWithTestName:NSStringFromClass([self class])];\n}\n\n- (void)tearDown\n{\n  self.snapshotController = nil;\n  [super tearDown];\n}\n\n- (BOOL)recordMode\n{\n  return self.snapshotController.recordMode;\n}\n\n- (void)setRecordMode:(BOOL)recordMode\n{\n  self.snapshotController.recordMode = recordMode;\n}\n\n- (BOOL)compareSnapshotOfLayer:(CALayer *)layer\n      referenceImagesDirectory:(NSString *)referenceImagesDirectory\n                    identifier:(NSString *)identifier\n                         error:(NSError **)errorPtr\n{\n  return [self _compareSnapshotOfViewOrLayer:layer\n                    referenceImagesDirectory:referenceImagesDirectory\n                                  identifier:identifier\n                                       error:errorPtr];\n}\n\n- (BOOL)compareSnapshotOfView:(NSView *)view\n     referenceImagesDirectory:(NSString *)referenceImagesDirectory\n                   identifier:(NSString *)identifier\n                        error:(NSError **)errorPtr\n{\n  _snapshotController.referenceImagesDirectory = referenceImagesDirectory;\n  return [_snapshotController compareSnapshotOfView:view\n                                           selector:self.invocation.selector\n                                         identifier:identifier\n                                              error:errorPtr];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/FBSnapshotTestCase/FBSnapshotTestController.h",
    "content": "/*\n *  Copyright (c) 2013, Facebook, Inc.\n *  All rights reserved.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <Foundation/Foundation.h>\n#import <AppKit/AppKit.h>\n\ntypedef NS_ENUM(NSInteger, FBSnapshotTestControllerErrorCode) {\n  FBSnapshotTestControllerErrorCodeUnknown,\n  FBSnapshotTestControllerErrorCodeNeedsRecord,\n  FBSnapshotTestControllerErrorCodePNGCreationFailed,\n  FBSnapshotTestControllerErrorCodeImagesDifferentSizes,\n  FBSnapshotTestControllerErrorCodeImagesDifferent,\n};\n/**\n Errors returned by the methods of FBSnapshotTestController use this domain.\n */\nextern NSString *const FBSnapshotTestControllerErrorDomain;\n\n/**\n Errors returned by the methods of FBSnapshotTestController sometimes contain this key in the `userInfo` dictionary.\n */\nextern NSString *const FBReferenceImageFilePathKey;\n\n/**\n Provides the heavy-lifting for FBSnapshotTestCase. It loads and saves images, along with performing the actual pixel-\n by-pixel comparison of images.\n Instances are initialized with the test class, and directories to read and write to.\n */\n@interface FBSnapshotTestController : NSObject\n\n/**\n Record snapshots.\n **/\n@property(readwrite, nonatomic, assign) BOOL recordMode;\n\n/**\n @param testClass The subclass of FBSnapshotTestCase that is using this controller.\n @returns An instance of FBSnapshotTestController.\n */\n- (id)initWithTestClass:(Class)testClass;\n\n/**\n Designated initializer.\n @param testName The name of the tests.\n @returns An instance of FBSnapshotTestController.\n */\n- (id)initWithTestName:(NSString *)testName;\n\n/**\n Performs the comparison of the view.\n @param view The view to snapshot.\n @param selector selector\n @param identifier An optional identifier, used is there are muliptle snapshot tests in a given -test method.\n @param errorPtr An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).\n @returns YES if the comparison (or saving of the reference image) succeeded.\n */\n- (BOOL)compareSnapshotOfView:(NSView *)view\n                     selector:(SEL)selector\n                   identifier:(NSString *)identifier\n                        error:(NSError **)errorPtr;\n\n/**\n The directory in which reference images are stored.\n */\n@property (readwrite, nonatomic, copy) NSString *referenceImagesDirectory;\n\n/**\n Loads a reference image.\n @param selector The test method being run.\n @param identifier The optional identifier, used when multiple images are tested in a single -test method.\n @param error An error, if this methods returns nil, the error will be something useful.\n @returns An image.\n */\n- (NSImage *)referenceImageForSelector:(SEL)selector\n                            identifier:(NSString *)identifier\n                                 error:(NSError **)error;\n\n/**\n Saves a reference image.\n @param selector The test method being run.\n @param identifier The optional identifier, used when multiple images are tested in a single -test method.\n @param errorPtr An error, if this methods returns NO, the error will be something useful.\n @returns An image.\n */\n- (BOOL)saveReferenceImage:(NSImage *)image\n                  selector:(SEL)selector\n                identifier:(NSString *)identifier\n                     error:(NSError **)errorPtr;\n\n/**\n Performs a pixel-by-pixel comparison of the two images.\n @param referenceImage The reference (correct) image.\n @param image The image to test against the reference.\n @param errorPtr An error that indicates why the comparison failed if it does.\n @returns YES if the comparison succeeded and the images are the same.\n */\n- (BOOL)compareReferenceImage:(NSImage *)referenceImage\n                      toImage:(NSImage *)image\n                        error:(NSError **)errorPtr;\n\n/**\n Saves the reference image and the test image to `failedOutputDirectory`.\n @param referenceImage The reference (correct) image.\n @param testImage The image to test against the reference.\n @param selector The test method being run.\n @param identifier The optional identifier, used when multiple images are tested in a single -test method.\n @param errorPtr An error that indicates why the comparison failed if it does.\n @returns YES if the save succeeded.\n */\n- (BOOL)saveFailedReferenceImage:(NSImage *)referenceImage\n                       testImage:(NSImage *)testImage\n                        selector:(SEL)selector\n                      identifier:(NSString *)identifier\n                           error:(NSError **)errorPtr;\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/FBSnapshotTestCase/FBSnapshotTestController.m",
    "content": "/*\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n#import \"FBSnapshotTestController.h\"\n\n#import <objc/runtime.h>\n\n#import <AppKit/AppKit.h>\n\n#import \"UIImage+Compare.h\"\n#import \"UIImage+Diff.h\"\n#import \"React/UIImageUtils.h\"\n\nNSString *const FBSnapshotTestControllerErrorDomain = @\"FBSnapshotTestControllerErrorDomain\";\n\nNSString *const FBReferenceImageFilePathKey = @\"FBReferenceImageFilePathKey\";\n\ntypedef struct RGBAPixel {\n  char r;\n  char g;\n  char b;\n  char a;\n} RGBAPixel;\n\n@interface FBSnapshotTestController ()\n\n@property (readonly, nonatomic, copy) NSString *testName;\n\n@end\n\n@implementation FBSnapshotTestController\n{\n  NSFileManager *_fileManager;\n}\n\n#pragma mark - Lifecycle\n\n- (instancetype)initWithTestClass:(Class)testClass;\n{\n  return [self initWithTestName:NSStringFromClass(testClass)];\n}\n\n- (instancetype)initWithTestName:(NSString *)testName\n{\n  if ((self = [super init])) {\n    _testName = [testName copy];\n    _fileManager = [NSFileManager new];\n  }\n  return self;\n}\n\n#pragma mark - Properties\n\n- (NSString *)description\n{\n  return [NSString stringWithFormat:@\"%@ %@\", [super description], _referenceImagesDirectory];\n}\n\n#pragma mark - Public API\n\n- (NSImage *)referenceImageForSelector:(SEL)selector\n                            identifier:(NSString *)identifier\n                                 error:(NSError **)errorPtr\n{\n  NSString *filePath = [self _referenceFilePathForSelector:selector identifier:identifier];\n  NSImage *image = [[NSImage alloc] initWithContentsOfFile:filePath];\n  if (nil == image && NULL != errorPtr) {\n    BOOL exists = [_fileManager fileExistsAtPath:filePath];\n    if (!exists) {\n      *errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain\n                                      code:FBSnapshotTestControllerErrorCodeNeedsRecord\n                                  userInfo:@{\n                                             FBReferenceImageFilePathKey: filePath,\n                                             NSLocalizedDescriptionKey: @\"Unable to load reference image.\",\n                                             NSLocalizedFailureReasonErrorKey: @\"Reference image not found. You need to run the test in record mode\",\n                                             }];\n    } else {\n      *errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain\n                                      code:FBSnapshotTestControllerErrorCodeUnknown\n                                  userInfo:nil];\n    }\n  }\n  return image;\n}\n\n- (BOOL)saveReferenceImage:(NSImage *)image\n                  selector:(SEL)selector\n                identifier:(NSString *)identifier\n                     error:(NSError **)errorPtr\n{\n  BOOL didWrite = NO;\n  if (nil != image) {\n    NSString *filePath = [self _referenceFilePathForSelector:selector identifier:identifier];\n    NSData *pngData = UIImagePNGRepresentation(image);\n    if (nil != pngData) {\n      NSError *creationError = nil;\n      BOOL didCreateDir = [_fileManager createDirectoryAtPath:[filePath stringByDeletingLastPathComponent]\n                                  withIntermediateDirectories:YES\n                                                   attributes:nil\n                                                        error:&creationError];\n      if (!didCreateDir) {\n        if (NULL != errorPtr) {\n          *errorPtr = creationError;\n        }\n        return NO;\n      }\n      didWrite = [pngData writeToFile:filePath options:NSDataWritingAtomic error:errorPtr];\n      if (didWrite) {\n        NSLog(@\"Reference image save at: %@\", filePath);\n      }\n    } else {\n      if (nil != errorPtr) {\n        *errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain\n                                        code:FBSnapshotTestControllerErrorCodePNGCreationFailed\n                                    userInfo:@{\n                                               FBReferenceImageFilePathKey: filePath,\n                                               }];\n      }\n    }\n  }\n  return didWrite;\n}\n\n- (BOOL)saveFailedReferenceImage:(NSImage *)referenceImage\n                       testImage:(NSImage *)testImage\n                        selector:(SEL)selector\n                      identifier:(NSString *)identifier\n                           error:(NSError **)errorPtr\n{\n  NSData *referencePNGData = UIImagePNGRepresentation(referenceImage);\n  NSData *testPNGData = UIImagePNGRepresentation(testImage);\n  \n  NSString *referencePath = [self _failedFilePathForSelector:selector\n                                                  identifier:identifier\n                                                fileNameType:FBTestSnapshotFileNameTypeFailedReference];\n  \n  NSError *creationError = nil;\n  BOOL didCreateDir = [_fileManager createDirectoryAtPath:[referencePath stringByDeletingLastPathComponent]\n                              withIntermediateDirectories:YES\n                                               attributes:nil\n                                                    error:&creationError];\n  if (!didCreateDir) {\n    if (NULL != errorPtr) {\n      *errorPtr = creationError;\n    }\n    return NO;\n  }\n  \n  if (![referencePNGData writeToFile:referencePath options:NSDataWritingAtomic error:errorPtr]) {\n    return NO;\n  }\n  \n  NSString *testPath = [self _failedFilePathForSelector:selector\n                                             identifier:identifier\n                                           fileNameType:FBTestSnapshotFileNameTypeFailedTest];\n  \n  if (![testPNGData writeToFile:testPath options:NSDataWritingAtomic error:errorPtr]) {\n    return NO;\n  }\n  \n  NSString *diffPath = [self _failedFilePathForSelector:selector\n                                             identifier:identifier\n                                           fileNameType:FBTestSnapshotFileNameTypeFailedTestDiff];\n  \n  NSImage *diffImage = [referenceImage diffWithImage:testImage];\n  NSData *diffImageData = UIImagePNGRepresentation(diffImage);\n  \n  if (![diffImageData writeToFile:diffPath options:NSDataWritingAtomic error:errorPtr]) {\n    return NO;\n  }\n  \n  NSLog(@\"If you have Kaleidoscope installed you can run this command to see an image diff:\\n\"\n        @\"ksdiff \\\"%@\\\" \\\"%@\\\"\", referencePath, testPath);\n  \n  return YES;\n}\n\n- (BOOL)compareReferenceImage:(NSImage *)referenceImage toImage:(NSImage *)image error:(NSError **)errorPtr\n{\n  if (CGSizeEqualToSize(referenceImage.size, image.size)) {\n    \n    BOOL imagesEqual = [referenceImage compareWithImage:image];\n    if (NULL != errorPtr) {\n      *errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain\n                                      code:FBSnapshotTestControllerErrorCodeImagesDifferent\n                                  userInfo:@{\n                                             NSLocalizedDescriptionKey: @\"Images different\",\n                                             }];\n    }\n    return imagesEqual;\n  }\n  if (NULL != errorPtr) {\n    *errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain\n                                    code:FBSnapshotTestControllerErrorCodeImagesDifferentSizes\n                                userInfo:@{\n                                           NSLocalizedDescriptionKey: @\"Images different sizes\",\n                                           NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@\"referenceImage:%@, image:%@\",\n                                                                              NSStringFromSize(referenceImage.size),\n                                                                              NSStringFromSize(image.size)],\n                                           }];\n  }\n  return NO;\n}\n\n#pragma mark - Private API\n\ntypedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {\n  FBTestSnapshotFileNameTypeReference,\n  FBTestSnapshotFileNameTypeFailedReference,\n  FBTestSnapshotFileNameTypeFailedTest,\n  FBTestSnapshotFileNameTypeFailedTestDiff,\n};\n\n- (NSString *)_fileNameForSelector:(SEL)selector\n                        identifier:(NSString *)identifier\n                      fileNameType:(FBTestSnapshotFileNameType)fileNameType\n{\n  NSString *fileName = nil;\n  switch (fileNameType) {\n    case FBTestSnapshotFileNameTypeFailedReference:\n      fileName = @\"reference_\";\n      break;\n    case FBTestSnapshotFileNameTypeFailedTest:\n      fileName = @\"failed_\";\n      break;\n    case FBTestSnapshotFileNameTypeFailedTestDiff:\n      fileName = @\"diff_\";\n      break;\n    default:\n      fileName = @\"\";\n      break;\n  }\n  fileName = [fileName stringByAppendingString:NSStringFromSelector(selector)];\n  if (0 < identifier.length) {\n    fileName = [fileName stringByAppendingFormat:@\"_%@\", identifier];\n  }\n  if ([[NSScreen mainScreen] backingScaleFactor] > 1.0) {\n    fileName = [fileName stringByAppendingFormat:@\"@%.fx\", [[NSScreen mainScreen] backingScaleFactor]];\n  }\n#if TARGET_OS_TV\n  fileName = [fileName stringByAppendingString:@\"_tvOS\"];\n#endif\n  fileName = [fileName stringByAppendingPathExtension:@\"png\"];\n  return fileName;\n}\n\n- (NSString *)_referenceFilePathForSelector:(SEL)selector identifier:(NSString *)identifier\n{\n  NSString *fileName = [self _fileNameForSelector:selector\n                                       identifier:identifier\n                                     fileNameType:FBTestSnapshotFileNameTypeReference];\n  NSString *filePath = [_referenceImagesDirectory stringByAppendingPathComponent:_testName];\n  filePath = [filePath stringByAppendingPathComponent:fileName];\n  return filePath;\n}\n\n- (NSString *)_failedFilePathForSelector:(SEL)selector\n                              identifier:(NSString *)identifier\n                            fileNameType:(FBTestSnapshotFileNameType)fileNameType\n{\n  NSString *fileName = [self _fileNameForSelector:selector\n                                       identifier:identifier\n                                     fileNameType:fileNameType];\n  NSString *folderPath = NSTemporaryDirectory();\n  if (getenv(\"IMAGE_DIFF_DIR\")) {\n    folderPath = @(getenv(\"IMAGE_DIFF_DIR\"));\n  }\n  NSString *filePath = [folderPath stringByAppendingPathComponent:_testName];\n  filePath = [filePath stringByAppendingPathComponent:fileName];\n  return filePath;\n}\n\n- (BOOL)compareSnapshotOfView:(id)view\n                     selector:(SEL)selector\n                   identifier:(NSString *)identifier\n                        error:(NSError **)errorPtr\n{\n  if (self.recordMode) {\n    return [self _recordSnapshotOfView:view selector:selector identifier:identifier error:errorPtr];\n  } else {\n    return [self _performPixelComparisonWithView:view selector:selector identifier:identifier error:errorPtr];\n  }\n}\n\n#pragma mark - Private API\n\n- (BOOL)_performPixelComparisonWithView:(NSView *)view\n                               selector:(SEL)selector\n                             identifier:(NSString *)identifier\n                                  error:(NSError **)errorPtr\n{\n  NSImage *referenceImage = [self referenceImageForSelector:selector identifier:identifier error:errorPtr];\n  if (nil != referenceImage) {\n    NSImage *snapshot = [self _snapshotView:view];\n    BOOL imagesSame = [self compareReferenceImage:referenceImage toImage:snapshot error:errorPtr];\n    if (!imagesSame) {\n      [self saveFailedReferenceImage:referenceImage\n                           testImage:snapshot\n                            selector:selector\n                          identifier:identifier\n                               error:errorPtr];\n    }\n    return imagesSame;\n  }\n  return NO;\n}\n\n- (BOOL)_recordSnapshotOfView:(NSView *)view\n                     selector:(SEL)selector\n                   identifier:(NSString *)identifier\n                        error:(NSError **)errorPtr\n{\n  NSImage *snapshot = [self _snapshotView:view];\n  return [self saveReferenceImage:snapshot selector:selector identifier:identifier error:errorPtr];\n}\n\n- (NSImage *)_snapshotView:(NSView *)view\n{\n  [view layout];\n  \n  CGRect bounds = view.bounds;\n  \n  NSAssert1(CGRectGetWidth(bounds), @\"Zero width for view %@\", view);\n  NSAssert1(CGRectGetHeight(bounds), @\"Zero height for view %@\", view);\n  \n  UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);\n  CGContextRef context = UIGraphicsGetCurrentContext();\n  NSAssert1(context, @\"Could not generate context for view %@\", view);\n  \n  UIGraphicsPushContext(context);\n  CGContextSaveGState(context);\n  \n  [view.layer renderInContext:context];\n//  {\n//    BOOL success = [view drawViewHierarchyInRect:bounds afterScreenUpdates:YES];\n//    NSAssert1(success, @\"Could not create snapshot for view %@\", view);\n//  }\n  CGContextRestoreGState(context);\n  UIGraphicsPopContext();\n  \n  NSImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();\n  UIGraphicsEndImageContext();\n  \n  return snapshot;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.h",
    "content": "//\n//  Created by Gabriel Handford on 3/1/09.\n//  Copyright 2009-2013. All rights reserved.\n//  Created by John Boiles on 10/20/11.\n//  Copyright (c) 2011. All rights reserved\n//  Modified by Felix Schulze on 2/11/13.\n//  Copyright 2013. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person\n//  obtaining a copy of this software and associated documentation\n//  files (the \"Software\"), to deal in the Software without\n//  restriction, including without limitation the rights to use,\n//  copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the\n//  Software is furnished to do so, subject to the following\n//  conditions:\n//\n//  The above copyright notice and this permission notice shall be\n//  included in all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n//  OTHER DEALINGS IN THE SOFTWARE.\n//\n\n#import <AppKit/AppKit.h>\n\n@interface NSImage (Compare)\n\n- (BOOL)compareWithImage:(NSImage *)image;\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.m",
    "content": "//\n//  Created by Gabriel Handford on 3/1/09.\n//  Copyright 2009-2013. All rights reserved.\n//  Created by John Boiles on 10/20/11.\n//  Copyright (c) 2011. All rights reserved\n//  Modified by Felix Schulze on 2/11/13.\n//  Copyright 2013. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person\n//  obtaining a copy of this software and associated documentation\n//  files (the \"Software\"), to deal in the Software without\n//  restriction, including without limitation the rights to use,\n//  copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the\n//  Software is furnished to do so, subject to the following\n//  conditions:\n//\n//  The above copyright notice and this permission notice shall be\n//  included in all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n//  OTHER DEALINGS IN THE SOFTWARE.\n//\n\n#import \"UIImage+Compare.h\"\n#import \"React/UIImageUtils.h\"\n\n@implementation NSImage (Compare)\n\n- (BOOL)compareWithImage:(NSImage *)image\n{\n  NSAssert(CGSizeEqualToSize(self.size, image.size), @\"Images must be same size.\");\n\n  CGImageRef source = RCTGetCGImageRef(self);\n  CGImageRef dest = RCTGetCGImageRef(image);\n  // The images have the equal size, so we could use the smallest amount of bytes because of byte padding\n  size_t minBytesPerRow = MIN(CGImageGetBytesPerRow(source), CGImageGetBytesPerRow(dest));\n  size_t referenceImageSizeBytes = CGImageGetHeight(source) * minBytesPerRow;\n  void *referenceImagePixels = calloc(1, referenceImageSizeBytes);\n  void *imagePixels = calloc(1, referenceImageSizeBytes);\n\n  if (!referenceImagePixels || !imagePixels) {\n    free(referenceImagePixels);\n    free(imagePixels);\n    return NO;\n  }\n\n  CGContextRef referenceImageContext = CGBitmapContextCreate(referenceImagePixels,\n                                                             CGImageGetWidth(source),\n                                                             CGImageGetHeight(source),\n                                                             CGImageGetBitsPerComponent(source),\n                                                             minBytesPerRow,\n                                                             CGImageGetColorSpace(source),\n                                                             (CGBitmapInfo)kCGImageAlphaPremultipliedLast\n                                                             );\n  CGContextRef imageContext = CGBitmapContextCreate(imagePixels,\n                                                    CGImageGetWidth(dest),\n                                                    CGImageGetHeight(dest),\n                                                    CGImageGetBitsPerComponent(dest),\n                                                    minBytesPerRow,\n                                                    CGImageGetColorSpace(dest),\n                                                    (CGBitmapInfo)kCGImageAlphaPremultipliedLast\n                                                    );\n\n  CGFloat scaleFactor = 1;//[UIScreen mainScreen].scale;\n  CGContextScaleCTM(referenceImageContext, scaleFactor, scaleFactor);\n  CGContextScaleCTM(imageContext, scaleFactor, scaleFactor);\n\n  if (!referenceImageContext || !imageContext) {\n    CGContextRelease(referenceImageContext);\n    CGContextRelease(imageContext);\n    free(referenceImagePixels);\n    free(imagePixels);\n    return NO;\n  }\n\n  CGContextDrawImage(referenceImageContext, CGRectMake(0.0f, 0.0f, self.size.width, self.size.height), source);\n  CGContextDrawImage(imageContext, CGRectMake(0.0f, 0.0f, image.size.width, image.size.height), dest);\n  CGContextRelease(referenceImageContext);\n  CGContextRelease(imageContext);\n\n  BOOL imageEqual = (memcmp(referenceImagePixels, imagePixels, referenceImageSizeBytes) == 0);\n  free(referenceImagePixels);\n  free(imagePixels);\n  return imageEqual;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.h",
    "content": "//\n//  Created by Gabriel Handford on 3/1/09.\n//  Copyright 2009-2013. All rights reserved.\n//  Created by John Boiles on 10/20/11.\n//  Copyright (c) 2011. All rights reserved\n//  Modified by Felix Schulze on 2/11/13.\n//  Copyright 2013. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person\n//  obtaining a copy of this software and associated documentation\n//  files (the \"Software\"), to deal in the Software without\n//  restriction, including without limitation the rights to use,\n//  copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the\n//  Software is furnished to do so, subject to the following\n//  conditions:\n//\n//  The above copyright notice and this permission notice shall be\n//  included in all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n//  OTHER DEALINGS IN THE SOFTWARE.\n//\n\n#import <AppKit/AppKit.h>\n\n@interface NSImage (Diff)\n\n- (NSImage *)diffWithImage:(NSImage *)image;\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.m",
    "content": "//\n//  Created by Gabriel Handford on 3/1/09.\n//  Copyright 2009-2013. All rights reserved.\n//  Created by John Boiles on 10/20/11.\n//  Copyright (c) 2011. All rights reserved\n//  Modified by Felix Schulze on 2/11/13.\n//  Copyright 2013. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person\n//  obtaining a copy of this software and associated documentation\n//  files (the \"Software\"), to deal in the Software without\n//  restriction, including without limitation the rights to use,\n//  copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the\n//  Software is furnished to do so, subject to the following\n//  conditions:\n//\n//  The above copyright notice and this permission notice shall be\n//  included in all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n//  OTHER DEALINGS IN THE SOFTWARE.\n//\n\n#import \"UIImage+Diff.h\"\n#import \"React/UIImageUtils.h\"\n\n@implementation NSImage (Diff)\n\n- (NSImage *)diffWithImage:(NSImage *)image\n{\n  if (!image) {\n    return nil;\n  }\n  CGSize imageSize = CGSizeMake(MAX([self size].width, image.size.width), MAX([self size].height, image.size.height));\n  UIGraphicsBeginImageContextWithOptions(imageSize, YES, 0.0);\n  CGContextRef context = UIGraphicsGetCurrentContext();\n  [self drawInRect:CGRectMake(0, 0, self.size.width, self.size.height)];\n  CGContextSetAlpha(context, 0.5f);\n  CGContextBeginTransparencyLayer(context, NULL);\n  [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];\n  CGContextSetBlendMode(context, kCGBlendModeDifference);\n  CGContextSetFillColorWithColor(context,[NSColor whiteColor].CGColor);\n  CGContextFillRect(context, CGRectMake(0, 0, [self size].width, [self size].height));\n  CGContextEndTransparencyLayer(context);\n  NSImage *returnImage = UIGraphicsGetImageFromCurrentImageContext();\n  UIGraphicsEndImageContext();\n  return returnImage;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/RCTSnapshotManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTSnapshotManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/RCTSnapshotManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSnapshotManager.h\"\n\n@interface RCTSnapshotView : NSView\n\n@property (nonatomic, copy) RCTDirectEventBlock onSnapshotReady;\n@property (nonatomic, copy) NSString *testIdentifier;\n\n@end\n\n@implementation RCTSnapshotView\n\n- (void)setTestIdentifier:(NSString *)testIdentifier\n{\n  if (![_testIdentifier isEqualToString:testIdentifier]) {\n    _testIdentifier = [testIdentifier copy];\n    dispatch_async(dispatch_get_main_queue(), ^{\n      if (self.onSnapshotReady) {\n        self.onSnapshotReady(@{@\"testIdentifier\" : self.testIdentifier});\n      }\n    });\n  }\n}\n\n@end\n\n\n@implementation RCTSnapshotManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  return [RCTSnapshotView new];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(testIdentifier, NSString)\nRCT_EXPORT_VIEW_PROPERTY(onSnapshotReady, RCTDirectEventBlock)\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/RCTTest.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t2D3B5F2D1D9B0F2800451313 /* RCTSnapshotManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9913A84A1BBE833400D70E66 /* RCTSnapshotManager.m */; };\n\t\t2D3B5F2E1D9B0F2B00451313 /* RCTTestModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 585135341AB3C56F00882537 /* RCTTestModule.m */; };\n\t\t2D3B5F2F1D9B0F2E00451313 /* RCTTestRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = 585135361AB3C56F00882537 /* RCTTestRunner.m */; };\n\t\t2D3B5F301D9B0F3D00451313 /* FBSnapshotTestController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58E64FE71AB964CD007446E2 /* FBSnapshotTestController.m */; };\n\t\t2D3B5F311D9B0F4200451313 /* UIImage+Compare.m in Sources */ = {isa = PBXBuildFile; fileRef = 58E64FE91AB964CD007446E2 /* UIImage+Compare.m */; };\n\t\t2D3B5F321D9B0F4500451313 /* UIImage+Diff.m in Sources */ = {isa = PBXBuildFile; fileRef = 58E64FEB1AB964CD007446E2 /* UIImage+Diff.m */; };\n\t\t3D3030281DF82A6300D6DDAE /* RCTTestRunner.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 585135351AB3C56F00882537 /* RCTTestRunner.h */; };\n\t\t3D30302A1DF82A8300D6DDAE /* RCTTestRunner.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 585135351AB3C56F00882537 /* RCTTestRunner.h */; };\n\t\t3DED3AA21DE6FC3400336DD7 /* RCTTestRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = 585135351AB3C56F00882537 /* RCTTestRunner.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t3DED3AA41DE6FC4C00336DD7 /* RCTTestRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = 585135351AB3C56F00882537 /* RCTTestRunner.h */; settings = {ATTRIBUTES = (Private, ); }; };\n\t\t585135371AB3C56F00882537 /* RCTTestModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 585135341AB3C56F00882537 /* RCTTestModule.m */; };\n\t\t585135381AB3C57000882537 /* RCTTestRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = 585135361AB3C56F00882537 /* RCTTestRunner.m */; };\n\t\t58E64FED1AB964CD007446E2 /* FBSnapshotTestController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58E64FE71AB964CD007446E2 /* FBSnapshotTestController.m */; };\n\t\t58E64FEE1AB964CD007446E2 /* UIImage+Compare.m in Sources */ = {isa = PBXBuildFile; fileRef = 58E64FE91AB964CD007446E2 /* UIImage+Compare.m */; };\n\t\t58E64FEF1AB964CD007446E2 /* UIImage+Diff.m in Sources */ = {isa = PBXBuildFile; fileRef = 58E64FEB1AB964CD007446E2 /* UIImage+Diff.m */; };\n\t\t9913A84B1BBE833400D70E66 /* RCTSnapshotManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9913A84A1BBE833400D70E66 /* RCTSnapshotManager.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t3D3030271DF8299E00D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/RCTTest;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3D3030281DF82A6300D6DDAE /* RCTTestRunner.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3030291DF82A6E00D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/RCTTest;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3D30302A1DF82A8300D6DDAE /* RCTTestRunner.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t2D2A286E1D9B047700D4039D /* libRCTTest-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libRCTTest-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t580C376F1AB104AF0015E709 /* libRCTTest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTTest.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t585135331AB3C56F00882537 /* RCTTestModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTestModule.h; sourceTree = \"<group>\"; };\n\t\t585135341AB3C56F00882537 /* RCTTestModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTestModule.m; sourceTree = \"<group>\"; };\n\t\t585135351AB3C56F00882537 /* RCTTestRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTestRunner.h; sourceTree = \"<group>\"; };\n\t\t585135361AB3C56F00882537 /* RCTTestRunner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTestRunner.m; sourceTree = \"<group>\"; };\n\t\t58E64FE41AB964CD007446E2 /* FBSnapshotTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBSnapshotTestCase.h; sourceTree = \"<group>\"; };\n\t\t58E64FE51AB964CD007446E2 /* FBSnapshotTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSnapshotTestCase.m; sourceTree = \"<group>\"; };\n\t\t58E64FE61AB964CD007446E2 /* FBSnapshotTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBSnapshotTestController.h; sourceTree = \"<group>\"; };\n\t\t58E64FE71AB964CD007446E2 /* FBSnapshotTestController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSnapshotTestController.m; sourceTree = \"<group>\"; };\n\t\t58E64FE81AB964CD007446E2 /* UIImage+Compare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"UIImage+Compare.h\"; sourceTree = \"<group>\"; };\n\t\t58E64FE91AB964CD007446E2 /* UIImage+Compare.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"UIImage+Compare.m\"; sourceTree = \"<group>\"; };\n\t\t58E64FEA1AB964CD007446E2 /* UIImage+Diff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"UIImage+Diff.h\"; sourceTree = \"<group>\"; };\n\t\t58E64FEB1AB964CD007446E2 /* UIImage+Diff.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"UIImage+Diff.m\"; sourceTree = \"<group>\"; };\n\t\t9913A8491BBE833400D70E66 /* RCTSnapshotManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSnapshotManager.h; sourceTree = \"<group>\"; };\n\t\t9913A84A1BBE833400D70E66 /* RCTSnapshotManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSnapshotManager.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t2D2A286B1D9B047700D4039D /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t580C376C1AB104AF0015E709 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t580C37661AB104AF0015E709 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t58E64FE31AB964CD007446E2 /* FBSnapshotTestCase */,\n\t\t\t\t9913A8491BBE833400D70E66 /* RCTSnapshotManager.h */,\n\t\t\t\t9913A84A1BBE833400D70E66 /* RCTSnapshotManager.m */,\n\t\t\t\t585135331AB3C56F00882537 /* RCTTestModule.h */,\n\t\t\t\t585135341AB3C56F00882537 /* RCTTestModule.m */,\n\t\t\t\t585135351AB3C56F00882537 /* RCTTestRunner.h */,\n\t\t\t\t585135361AB3C56F00882537 /* RCTTestRunner.m */,\n\t\t\t\t580C37701AB104AF0015E709 /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t580C37701AB104AF0015E709 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t580C376F1AB104AF0015E709 /* libRCTTest.a */,\n\t\t\t\t2D2A286E1D9B047700D4039D /* libRCTTest-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58E64FE31AB964CD007446E2 /* FBSnapshotTestCase */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t58E64FE41AB964CD007446E2 /* FBSnapshotTestCase.h */,\n\t\t\t\t58E64FE51AB964CD007446E2 /* FBSnapshotTestCase.m */,\n\t\t\t\t58E64FE61AB964CD007446E2 /* FBSnapshotTestController.h */,\n\t\t\t\t58E64FE71AB964CD007446E2 /* FBSnapshotTestController.m */,\n\t\t\t\t58E64FE81AB964CD007446E2 /* UIImage+Compare.h */,\n\t\t\t\t58E64FE91AB964CD007446E2 /* UIImage+Compare.m */,\n\t\t\t\t58E64FEA1AB964CD007446E2 /* UIImage+Diff.h */,\n\t\t\t\t58E64FEB1AB964CD007446E2 /* UIImage+Diff.m */,\n\t\t\t);\n\t\t\tpath = FBSnapshotTestCase;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t3DED3AA11DE6FC2200336DD7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DED3AA21DE6FC3400336DD7 /* RCTTestRunner.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3DED3AA31DE6FC4700336DD7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DED3AA41DE6FC4C00336DD7 /* RCTTestRunner.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t2D2A286D1D9B047700D4039D /* RCTTest-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D2A28761D9B047700D4039D /* Build configuration list for PBXNativeTarget \"RCTTest-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3DED3AA31DE6FC4700336DD7 /* Headers */,\n\t\t\t\t3D3030291DF82A6E00D6DDAE /* Copy Headers */,\n\t\t\t\t2D2A286A1D9B047700D4039D /* Sources */,\n\t\t\t\t2D2A286B1D9B047700D4039D /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"RCTTest-tvOS\";\n\t\t\tproductName = \"RCTTest-tvOS\";\n\t\t\tproductReference = 2D2A286E1D9B047700D4039D /* libRCTTest-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t580C376E1AB104AF0015E709 /* RCTTest */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 580C37831AB104AF0015E709 /* Build configuration list for PBXNativeTarget \"RCTTest\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3DED3AA11DE6FC2200336DD7 /* Headers */,\n\t\t\t\t3D3030271DF8299E00D6DDAE /* Copy Headers */,\n\t\t\t\t580C376B1AB104AF0015E709 /* Sources */,\n\t\t\t\t580C376C1AB104AF0015E709 /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTTest;\n\t\t\tproductName = RCTTest;\n\t\t\tproductReference = 580C376F1AB104AF0015E709 /* libRCTTest.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t580C37671AB104AF0015E709 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t2D2A286D1D9B047700D4039D = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t580C376E1AB104AF0015E709 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 580C376A1AB104AF0015E709 /* Build configuration list for PBXProject \"RCTTest\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 580C37661AB104AF0015E709;\n\t\t\tproductRefGroup = 580C37701AB104AF0015E709 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t580C376E1AB104AF0015E709 /* RCTTest */,\n\t\t\t\t2D2A286D1D9B047700D4039D /* RCTTest-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t2D2A286A1D9B047700D4039D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D3B5F311D9B0F4200451313 /* UIImage+Compare.m in Sources */,\n\t\t\t\t2D3B5F2F1D9B0F2E00451313 /* RCTTestRunner.m in Sources */,\n\t\t\t\t2D3B5F321D9B0F4500451313 /* UIImage+Diff.m in Sources */,\n\t\t\t\t2D3B5F301D9B0F3D00451313 /* FBSnapshotTestController.m in Sources */,\n\t\t\t\t2D3B5F2D1D9B0F2800451313 /* RCTSnapshotManager.m in Sources */,\n\t\t\t\t2D3B5F2E1D9B0F2B00451313 /* RCTTestModule.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t580C376B1AB104AF0015E709 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t58E64FEE1AB964CD007446E2 /* UIImage+Compare.m in Sources */,\n\t\t\t\t9913A84B1BBE833400D70E66 /* RCTSnapshotManager.m in Sources */,\n\t\t\t\t585135371AB3C56F00882537 /* RCTTestModule.m in Sources */,\n\t\t\t\t58E64FEF1AB964CD007446E2 /* UIImage+Diff.m in Sources */,\n\t\t\t\t58E64FED1AB964CD007446E2 /* FBSnapshotTestController.m in Sources */,\n\t\t\t\t585135381AB3C57000882537 /* RCTTestRunner.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t2D2A28741D9B047700D4039D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/RCTTest;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D2A28751D9B047700D4039D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/RCTTest;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t580C37811AB104AF0015E709 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n                MACOSX_DEPLOYMENT_TARGET = 10.10;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t580C37821AB104AF0015E709 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n                MACOSX_DEPLOYMENT_TARGET = 10.10;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t580C37841AB104AF0015E709 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-framework\",\n\t\t\t\t\tXCTest,\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/RCTTest;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t580C37851AB104AF0015E709 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-framework\",\n\t\t\t\t\tXCTest,\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/RCTTest;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t2D2A28761D9B047700D4039D /* Build configuration list for PBXNativeTarget \"RCTTest-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D2A28741D9B047700D4039D /* Debug */,\n\t\t\t\t2D2A28751D9B047700D4039D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t580C376A1AB104AF0015E709 /* Build configuration list for PBXProject \"RCTTest\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t580C37811AB104AF0015E709 /* Debug */,\n\t\t\t\t580C37821AB104AF0015E709 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t580C37831AB104AF0015E709 /* Build configuration list for PBXNativeTarget \"RCTTest\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t580C37841AB104AF0015E709 /* Debug */,\n\t\t\t\t580C37851AB104AF0015E709 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 580C37671AB104AF0015E709 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/RCTTest/RCTTestModule.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTDefines.h>\n\ntypedef NS_ENUM(NSInteger, RCTTestStatus) {\n  RCTTestStatusPending = 0,\n  RCTTestStatusPassed,\n  RCTTestStatusFailed\n};\n\n@class FBSnapshotTestController;\n\n@interface RCTTestModule : NSObject <RCTBridgeModule>\n\n/**\n * The snapshot test controller for this module.\n */\n@property (nonatomic, strong) FBSnapshotTestController *controller;\n\n/**\n * This is the view to be snapshotted.\n */\n@property (nonatomic, strong) NSView *view;\n\n/**\n * This is used to give meaningful names to snapshot image files.\n */\n@property (nonatomic, assign) SEL testSelector;\n\n/**\n * This is polled while running the runloop until true.\n */\n@property (nonatomic, readonly) RCTTestStatus status;\n\n@property (nonatomic, copy) NSString *testSuffix;\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/RCTTestModule.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTestModule.h\"\n\n#import <React/RCTAssert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTLog.h>\n#import <React/RCTUIManager.h>\n\n#import \"FBSnapshotTestController.h\"\n\n@implementation RCTTestModule {\n  NSMutableDictionary<NSString *, NSNumber *> *_snapshotCounter;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n- (dispatch_queue_t)methodQueue\n{\n  return _bridge.uiManager.methodQueue;\n}\n\nRCT_EXPORT_METHOD(verifySnapshot:(RCTResponseSenderBlock)callback)\n{\n  RCTAssert(_controller != nil, @\"No snapshot controller configured.\");\n\n  [_bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    NSString *testName = NSStringFromSelector(self->_testSelector);\n    if (!self->_snapshotCounter) {\n      self->_snapshotCounter = [NSMutableDictionary new];\n    }\n\n    NSNumber *counter = @([self->_snapshotCounter[testName] integerValue] + 1);\n    self->_snapshotCounter[testName] = counter;\n\n    NSError *error = nil;\n    NSString *identifier = [counter stringValue];\n    if (self->_testSuffix) {\n      identifier = [identifier stringByAppendingString:self->_testSuffix];\n    }\n    BOOL success = [self->_controller compareSnapshotOfView:self->_view\n                                                   selector:self->_testSelector\n                                                 identifier:identifier\n                                                      error:&error];\n    if (!success) {\n      RCTLogInfo(@\"Failed to verify snapshot %@ (error: %@)\", identifier, error);\n    }\n    callback(@[@(success)]);\n  }];\n}\n\nRCT_EXPORT_METHOD(sendAppEvent:(NSString *)name body:(nullable id)body)\n{\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n  [_bridge.eventDispatcher sendAppEventWithName:name body:body];\n#pragma clang diagnostic pop\n}\n\nRCT_REMAP_METHOD(shouldResolve, shouldResolve_resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)\n{\n  resolve(@1);\n}\n\nRCT_REMAP_METHOD(shouldReject, shouldReject_resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)\n{\n  reject(nil, nil, nil);\n}\n\nRCT_EXPORT_METHOD(markTestCompleted)\n{\n  [self markTestPassed:YES];\n}\n\nRCT_EXPORT_METHOD(markTestPassed:(BOOL)success)\n{\n  [_bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, __unused NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    self->_status = success ? RCTTestStatusPassed : RCTTestStatusFailed;\n  }];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/RCTTestRunner.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridge.h>\n\n#ifndef FB_REFERENCE_IMAGE_DIR\n#define FB_REFERENCE_IMAGE_DIR \"\"\n#endif\n\n#define RCT_RUN_RUNLOOP_WHILE(CONDITION)                                                          \\\n{                                                                                                 \\\n  NSDate *timeout = [NSDate dateWithTimeIntervalSinceNow:30];                                      \\\n  NSRunLoop *runloop = [NSRunLoop mainRunLoop];                                                   \\\n  while ((CONDITION)) {                                                                           \\\n    [runloop runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.01]]; \\\n    if ([timeout timeIntervalSinceNow] <= 0) {                                                    \\\n      XCTFail(@\"Runloop timed out before condition was met\");                                     \\\n      break;                                                                                      \\\n    }                                                                                             \\\n  }                                                                                               \\\n}\n\n/**\n * Use the RCTInitRunnerForApp macro for typical usage. See FBSnapshotTestCase.h for more information\n * on how to configure the snapshotting system.\n */\n#define RCTInitRunnerForApp(app__, moduleProvider__, scriptURL__) \\\n[[RCTTestRunner alloc] initWithApp:(app__) \\\n                referenceDirectory:@FB_REFERENCE_IMAGE_DIR \\\n                    moduleProvider:(moduleProvider__) \\\n                    scriptURL: scriptURL__]\n\n@protocol RCTBridgeModule;\n@class RCTBridge;\n\n@class RCTRootView;\n\n@interface RCTTestRunner : NSObject\n\n/**\n * Controls the mode snapshots are run in. If set to true, new snapshots are written to disk,\n * otherwise, the UI will be compared to the existing snapshot.\n */\n@property (nonatomic, assign) BOOL recordMode;\n\n@property (nonatomic, assign, readwrite) BOOL useBundler;\n\n@property (nonatomic, assign, readwrite) BOOL useJSDebugger;\n\n@property (nonatomic, copy) NSString *testSuffix;\n\n@property (nonatomic, readonly) NSURL *scriptURL;\n\n/**\n * Initialize a runner.  It's recommended that you use the RCTInitRunnerForApp\n * macro instead of calling this directly.\n *\n * @param app The path to the app bundle without suffixes, e.g. IntegrationTests/IntegrationTestsApp\n * @param referenceDirectory The path for snapshot references images.\n * @param block A block that returns an array of extra modules to be used by the test runner.\n */\n- (instancetype)initWithApp:(NSString *)app\n         referenceDirectory:(NSString *)referenceDirectory\n             moduleProvider:(RCTBridgeModuleListProvider)block\n                  scriptURL:(NSURL *)scriptURL NS_DESIGNATED_INITIALIZER;\n\n/**\n * Simplest runTest function simply mounts the specified JS module with no\n * initialProps and waits for it to call\n *\n *   RCTTestModule.markTestCompleted()\n *\n * JS errors/exceptions and timeouts will fail the test.  Snapshot tests call\n * RCTTestModule.verifySnapshot whenever they want to verify what has been\n * rendered (typically via requestAnimationFrame to make sure the latest state\n * has been rendered in native.\n *\n * @param test Selector of the test, usually just `_cmd`.\n * @param moduleName Name of the JS component as registered by `AppRegistry.registerComponent` in JS.\n */\n- (void)runTest:(SEL)test module:(NSString *)moduleName;\n\n/**\n * Same as runTest:, but allows for passing initialProps for providing mock data\n * or requesting different behaviors, configurationBlock provides arbitrary logic for the hosting\n * root view manipulation.\n *\n * @param test Selector of the test, usually just `_cmd`.\n * @param moduleName Name of the JS component as registered by `AppRegistry.registerComponent` in JS.\n * @param initialProps props that are passed into the component when rendered.\n * @param configurationBlock A block that takes the hosting root view and performs arbitrary manipulation after its creation.\n */\n- (void)runTest:(SEL)test module:(NSString *)moduleName\n   initialProps:(NSDictionary<NSString *, id> *)initialProps\nconfigurationBlock:(void(^)(RCTRootView *rootView))configurationBlock;\n\n/**\n * Same as runTest:, but allows for passing initialProps for providing mock data\n * or requesting different behaviors, configurationBlock provides arbitrary logic for the hosting\n * root view manipulation, and expectErrorRegex verifies that the error you expected was thrown.\n *\n * @param test Selector of the test, usually just `_cmd`.\n * @param moduleName Name of the JS component as registered by `AppRegistry.registerComponent` in JS.\n * @param initialProps props that are passed into the component when rendered.\n * @param configurationBlock A block that takes the hosting root view and performs arbitrary manipulation after its creation.\n * @param expectErrorRegex A regex that must match the error thrown.  If no error is thrown, the test fails.\n */\n- (void)runTest:(SEL)test module:(NSString *)moduleName\n   initialProps:(NSDictionary<NSString *, id> *)initialProps\nconfigurationBlock:(void(^)(RCTRootView *rootView))configurationBlock\nexpectErrorRegex:(NSString *)expectErrorRegex;\n\n/**\n * Same as runTest:, but allows for passing initialProps for providing mock data\n * or requesting different behaviors, configurationBlock provides arbitrary logic for the hosting\n * root view manipulation, and expectErrorBlock provides arbitrary\n * logic for processing errors (nil will cause any error to fail the test).\n *\n * @param test Selector of the test, usually just `_cmd`.\n * @param moduleName Name of the JS component as registered by `AppRegistry.registerComponent` in JS.\n * @param initialProps props that are passed into the component when rendered.\n * @param configurationBlock A block that takes the hosting root view and performs arbitrary manipulation after its creation.\n * @param expectErrorBlock A block that takes the error message and returns NO to fail the test.\n */\n- (void)runTest:(SEL)test module:(NSString *)moduleName\n   initialProps:(NSDictionary<NSString *, id> *)initialProps\nconfigurationBlock:(void(^)(RCTRootView *rootView))configurationBlock\nexpectErrorBlock:(BOOL(^)(NSString *error))expectErrorBlock;\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/RCTTestRunner.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTestRunner.h\"\n\n#import <React/RCTAssert.h>\n#import <React/RCTBridge+Private.h>\n#import <React/RCTDevSettings.h>\n#import <React/RCTLog.h>\n#import <React/RCTRootView.h>\n#import <React/RCTUtils.h>\n\n#import \"FBSnapshotTestController.h\"\n#import \"RCTTestModule.h\"\n\nstatic const NSTimeInterval kTestTimeoutSeconds = 120;\n\n@implementation RCTTestRunner\n{\n  FBSnapshotTestController *_testController;\n  RCTBridgeModuleListProvider _moduleProvider;\n  NSString *_appPath;\n}\n\n- (instancetype)initWithApp:(NSString *)app\n         referenceDirectory:(NSString *)referenceDirectory\n             moduleProvider:(RCTBridgeModuleListProvider)block\n                  scriptURL:(NSURL *)scriptURL\n{\n  RCTAssertParam(app);\n  RCTAssertParam(referenceDirectory);\n\n  if ((self = [super init])) {\n    if (!referenceDirectory.length) {\n      referenceDirectory = [[NSBundle bundleForClass:self.class].resourcePath stringByAppendingPathComponent:@\"ReferenceImages\"];\n    }\n\n    NSString *sanitizedAppName = [app stringByReplacingOccurrencesOfString:@\"/\" withString:@\"-\"];\n    sanitizedAppName = [sanitizedAppName stringByReplacingOccurrencesOfString:@\"\\\\\" withString:@\"-\"];\n    _testController = [[FBSnapshotTestController alloc] initWithTestName:sanitizedAppName];\n    _testController.referenceImagesDirectory = referenceDirectory;\n    _moduleProvider = [block copy];\n    _appPath = app;\n\n    if (scriptURL != nil) {\n      _scriptURL = scriptURL;\n    } else {\n      [self updateScript];\n    }\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (void)updateScript\n{\n  if (getenv(\"CI_USE_PACKAGER\") || _useBundler) {\n    _scriptURL = [NSURL URLWithString:[NSString stringWithFormat:@\"http://localhost:8081/%@.bundle?platform=macos&dev=true\", _appPath]];\n  } else {\n    _scriptURL = [[NSBundle bundleForClass:[RCTBridge class]] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n  }\n  RCTAssert(_scriptURL != nil, @\"No scriptURL set\");\n}\n\n- (void)setRecordMode:(BOOL)recordMode\n{\n  _testController.recordMode = recordMode;\n}\n\n- (BOOL)recordMode\n{\n  return _testController.recordMode;\n}\n\n- (void)setUseBundler:(BOOL)useBundler\n{\n  _useBundler = useBundler;\n  [self updateScript];\n}\n\n- (void)runTest:(SEL)test module:(NSString *)moduleName\n{\n  [self runTest:test module:moduleName initialProps:nil configurationBlock:nil expectErrorBlock:nil];\n}\n\n- (void)runTest:(SEL)test module:(NSString *)moduleName\n   initialProps:(NSDictionary<NSString *, id> *)initialProps\nconfigurationBlock:(void(^)(RCTRootView *rootView))configurationBlock\n{\n  [self runTest:test module:moduleName initialProps:initialProps configurationBlock:configurationBlock expectErrorBlock:nil];\n}\n\n- (void)runTest:(SEL)test module:(NSString *)moduleName\n   initialProps:(NSDictionary<NSString *, id> *)initialProps\nconfigurationBlock:(void(^)(RCTRootView *rootView))configurationBlock\nexpectErrorRegex:(NSString *)errorRegex\n{\n  BOOL(^expectErrorBlock)(NSString *error)  = ^BOOL(NSString *error){\n    return [error rangeOfString:errorRegex options:NSRegularExpressionSearch].location != NSNotFound;\n  };\n\n  [self runTest:test module:moduleName initialProps:initialProps configurationBlock:configurationBlock expectErrorBlock:expectErrorBlock];\n}\n\n- (void)runTest:(SEL)test module:(NSString *)moduleName\n   initialProps:(NSDictionary<NSString *, id> *)initialProps\nconfigurationBlock:(void(^)(RCTRootView *rootView))configurationBlock\nexpectErrorBlock:(BOOL(^)(NSString *error))expectErrorBlock\n{\n  __weak RCTBridge *batchedBridge;\n\n  @autoreleasepool {\n    __block NSMutableArray<NSString *> *errors = nil;\n    RCTLogFunction defaultLogFunction = RCTGetLogFunction();\n    RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {\n      defaultLogFunction(level, source, fileName, lineNumber, message);\n      if (level >= RCTLogLevelError) {\n        if (errors == nil) {\n          errors = [NSMutableArray new];\n        }\n        [errors addObject:message];\n      }\n    });\n\n    RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:_scriptURL\n                                              moduleProvider:_moduleProvider\n                                               launchOptions:nil];\n    [bridge.devSettings setIsDebuggingRemotely:_useJSDebugger];\n    batchedBridge = [bridge batchedBridge];\n\n    RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:moduleName initialProperties:initialProps];\n#if TARGET_OS_TV\n    rootView.frame = CGRectMake(0, 0, 1920, 1080); // Standard screen size for tvOS\n#else\n    rootView.frame = CGRectMake(0, 0, 320, 2000); // Constant size for testing on multiple devices\n#endif\n\n    RCTTestModule *testModule = [rootView.bridge moduleForClass:[RCTTestModule class]];\n    RCTAssert(_testController != nil, @\"_testController should not be nil\");\n    testModule.controller = _testController;\n    testModule.testSelector = test;\n    testModule.testSuffix = _testSuffix;\n    testModule.view = rootView;\n\n    NSView * vcView = [NSView new];\n    [vcView addSubview:rootView]; // Add as subview so it doesn't get resized\n    if ([[NSApplication sharedApplication] mainWindow]) {\n      [[[NSApplication sharedApplication] mainWindow] close];\n    }\n\n    NSWindowController *windowController = [[[NSApplication sharedApplication] mainWindow] windowController];\n\n    NSWindow *window = [[NSWindow alloc] initWithContentRect:rootView.frame\n                                              styleMask:NSTitledWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask | NSClosableWindowMask | NSFullSizeContentViewWindowMask\n                                                backing:NSBackingStoreBuffered\n                                                  defer:NO];\n\n    [window setTitle:moduleName];\n    [windowController showWindow:window];\n    [windowController setShouldCascadeWindows:NO];\n\n    [window setContentView:rootView];\n\n    if (configurationBlock) {\n      configurationBlock(rootView);\n    }\n\n    if (configurationBlock) {\n      configurationBlock(rootView);\n    }\n\n    NSDate *date = [NSDate dateWithTimeIntervalSinceNow:kTestTimeoutSeconds];\n    while (date.timeIntervalSinceNow > 0 && testModule.status == RCTTestStatusPending && errors == nil) {\n      [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];\n      [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];\n    }\n\n    [rootView removeFromSuperview];\n\n    RCTSetLogFunction(defaultLogFunction);\n\n    NSArray<NSView *> *nonLayoutSubviews = [vcView.subviews filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id subview, NSDictionary *bindings) {\n      return ![NSStringFromClass([subview class]) isEqualToString:@\"_UILayoutGuide\"];\n    }]];\n\n    RCTAssert(nonLayoutSubviews.count == 0, @\"There shouldn't be any other views: %@\", nonLayoutSubviews);\n\n    if (expectErrorBlock) {\n      RCTAssert(expectErrorBlock(errors[0]), @\"Expected an error but the first one was missing or did not match.\");\n    } else {\n      RCTAssert(errors == nil, @\"RedBox errors: %@\", errors);\n      RCTAssert(testModule.status != RCTTestStatusPending, @\"Test didn't finish within %0.f seconds\", kTestTimeoutSeconds);\n      RCTAssert(testModule.status == RCTTestStatusPassed, @\"Test failed\");\n    }\n\n    [bridge invalidate];\n  }\n\n  // Give the bridge a chance to disappear before continuing to the next test.\n  NSDate *invalidateTimeout = [NSDate dateWithTimeIntervalSinceNow:30];\n  while (invalidateTimeout.timeIntervalSinceNow > 0 && batchedBridge != nil) {\n    [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];\n    [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/RCTTest/SnapshotViewIOS.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SnapshotViewIOS\n */\n'use strict';\n\nmodule.exports = require('UnimplementedView');\n"
  },
  {
    "path": "Libraries/RCTTest/SnapshotViewIOS.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SnapshotViewIOS\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nconst PropTypes = require('prop-types');\nvar StyleSheet = require('StyleSheet');\nvar { TestModule } = require('NativeModules');\nvar UIManager = require('UIManager');\nvar View = require('View');\n\nconst ViewPropTypes = require('ViewPropTypes');\n\nvar requireNativeComponent = require('requireNativeComponent');\n\nclass SnapshotViewIOS extends React.Component<{\n  onSnapshotReady?: Function,\n  testIdentifier?: string,\n}> {\n  // $FlowFixMe(>=0.41.0)\n  static propTypes = {\n    ...ViewPropTypes,\n    // A callback when the Snapshot view is ready to be compared\n    onSnapshotReady : PropTypes.func,\n    // A name to identify the individual instance to the SnapshotView\n    testIdentifier : PropTypes.string,\n  };\n\n  onDefaultAction = (event: Object) => {\n    TestModule.verifySnapshot(TestModule.markTestPassed);\n  };\n\n  render() {\n    var testIdentifier = this.props.testIdentifier || 'test';\n    var onSnapshotReady = this.props.onSnapshotReady || this.onDefaultAction;\n    return (\n      <RCTSnapshot\n        style={style.snapshot}\n        {...this.props}\n        onSnapshotReady={onSnapshotReady}\n        testIdentifier={testIdentifier}\n      />\n    );\n  }\n}\n\nvar style = StyleSheet.create({\n  snapshot: {\n    flex: 1,\n  },\n});\n\n// Verify that RCTSnapshot is part of the UIManager since it is only loaded\n// if you have linked against RCTTest like in tests, otherwise we will have\n// a warning printed out\nvar RCTSnapshot = UIManager.RCTSnapshot ?\n  requireNativeComponent('RCTSnapshot', SnapshotViewIOS) :\n  View;\n\nmodule.exports = SnapshotViewIOS;\n"
  },
  {
    "path": "Libraries/RCTTest/SnapshotViewIOS.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SnapshotViewIOS\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nconst PropTypes = require('prop-types');\nvar StyleSheet = require('StyleSheet');\nvar { TestModule } = require('NativeModules');\nvar UIManager = require('UIManager');\nvar View = require('View');\n\nconst ViewPropTypes = require('ViewPropTypes');\n\nvar requireNativeComponent = require('requireNativeComponent');\n\nclass SnapshotViewIOS extends React.Component {\n  props: {\n    onSnapshotReady?: Function,\n    testIdentifier?: string,\n  };\n\n  // $FlowFixMe(>=0.41.0)\n  static propTypes = {\n    ...ViewPropTypes,\n    // A callback when the Snapshot view is ready to be compared\n    onSnapshotReady: PropTypes.func,\n    // A name to identify the individual instance to the SnapshotView\n    testIdentifier: PropTypes.string,\n  };\n\n  onDefaultAction = (event: Object) => {\n    TestModule.verifySnapshot(TestModule.markTestPassed);\n  };\n\n  render() {\n    var testIdentifier = this.props.testIdentifier || 'test';\n    var onSnapshotReady = this.props.onSnapshotReady || this.onDefaultAction;\n    return (\n      <RCTSnapshot\n        style={style.snapshot}\n        {...this.props}\n        onSnapshotReady={onSnapshotReady}\n        testIdentifier={testIdentifier}\n      />\n    );\n  }\n}\n\nvar style = StyleSheet.create({\n  snapshot: {\n    flex: 1,\n  },\n});\n\n// Verify that RCTSnapshot is part of the UIManager since it is only loaded\n// if you have linked against RCTTest like in tests, otherwise we will have\n// a warning printed out\nvar RCTSnapshot = UIManager.RCTSnapshot\n  ? requireNativeComponent('RCTSnapshot', SnapshotViewIOS)\n  : View;\n\nmodule.exports = SnapshotViewIOS;\n"
  },
  {
    "path": "Libraries/ReactNative/AppContainer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AppContainer\n * @format\n * @flow\n */\n\n'use strict';\n\nconst EmitterSubscription = require('EmitterSubscription');\nconst PropTypes = require('prop-types');\nconst RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\nconst React = require('React');\nconst ReactNative = require('ReactNative');\nconst StyleSheet = require('StyleSheet');\nconst View = require('View');\n\ntype Context = {\n  rootTag: number,\n};\ntype Props = {|\n  /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n   * suppresses an error when upgrading Flow's support for React. To see the\n   * error delete this comment and run Flow. */\n  children?: React.Children,\n  rootTag: number,\n  WrapperComponent?: ?React.ComponentType<*>,\n|};\ntype State = {\n  inspector: ?React.Element<any>,\n  mainKey: number,\n};\n\nclass AppContainer extends React.Component<Props, State> {\n  state: State = {\n    inspector: null,\n    mainKey: 1,\n  };\n  _mainRef: ?React.Element<any>;\n  _subscription: ?EmitterSubscription = null;\n\n  static childContextTypes = {\n    rootTag: PropTypes.number,\n  };\n\n  getChildContext(): Context {\n    return {\n      rootTag: this.props.rootTag,\n    };\n  }\n\n  componentDidMount(): void {\n    if (__DEV__) {\n      if (!global.__RCTProfileIsProfiling) {\n        this._subscription = RCTDeviceEventEmitter.addListener(\n          'toggleElementInspector',\n          () => {\n            const Inspector = require('Inspector');\n            const inspector = this.state.inspector ? null : (\n              <Inspector\n                inspectedViewTag={ReactNative.findNodeHandle(this._mainRef)}\n                onRequestRerenderApp={updateInspectedViewTag => {\n                  this.setState(\n                    s => ({mainKey: s.mainKey + 1}),\n                    () =>\n                      updateInspectedViewTag(\n                        ReactNative.findNodeHandle(this._mainRef),\n                      ),\n                  );\n                }}\n              />\n            );\n            this.setState({inspector});\n          },\n        );\n      }\n    }\n  }\n\n  componentWillUnmount(): void {\n    if (this._subscription) {\n      this._subscription.remove();\n    }\n  }\n\n  render(): React.Node {\n    let yellowBox = null;\n    if (__DEV__) {\n      if (!global.__RCTProfileIsProfiling) {\n        const YellowBox = require('YellowBox');\n        yellowBox = <YellowBox />;\n      }\n    }\n\n    let innerView = (\n      <View\n        collapsable={!this.state.inspector}\n        key={this.state.mainKey}\n        pointerEvents=\"box-none\"\n        style={styles.appContainer}\n        ref={ref => {\n          /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n           * comment suppresses an error when upgrading Flow's support for\n           * React. To see the error delete this comment and run Flow. */\n          this._mainRef = ref;\n        }}>\n        {this.props.children}\n      </View>\n    );\n\n    const Wrapper = this.props.WrapperComponent;\n    if (Wrapper) {\n      innerView = <Wrapper>{innerView}</Wrapper>;\n    }\n    return (\n      <View style={styles.appContainer} pointerEvents=\"box-none\">\n        {innerView}\n        {yellowBox}\n        {this.state.inspector}\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  appContainer: {\n    flex: 1,\n  },\n});\n\nmodule.exports = AppContainer;\n"
  },
  {
    "path": "Libraries/ReactNative/AppRegistry.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AppRegistry\n * @flow\n * @format\n */\n'use strict';\n\nconst BatchedBridge = require('BatchedBridge');\nconst BugReporting = require('BugReporting');\nconst NativeModules = require('NativeModules');\nconst ReactNative = require('ReactNative');\nconst SceneTracker = require('SceneTracker');\n\nconst infoLog = require('infoLog');\nconst invariant = require('fbjs/lib/invariant');\nconst renderApplication = require('renderApplication');\n\ntype Task = (taskData: any) => Promise<void>;\ntype TaskProvider = () => Task;\nexport type ComponentProvider = () => React$ComponentType<any>;\nexport type ComponentProviderInstrumentationHook = (\n  component: ComponentProvider,\n) => React$ComponentType<any>;\nexport type AppConfig = {\n  appKey: string,\n  component?: ComponentProvider,\n  run?: Function,\n  section?: boolean,\n};\nexport type Runnable = {\n  component?: ComponentProvider,\n  run: Function,\n};\nexport type Runnables = {\n  [appKey: string]: Runnable,\n};\nexport type Registry = {\n  sections: Array<string>,\n  runnables: Runnables,\n};\nexport type WrapperComponentProvider = any => React$ComponentType<*>;\n\nconst runnables: Runnables = {};\nlet runCount = 1;\nconst sections: Runnables = {};\nconst tasks: Map<string, TaskProvider> = new Map();\nlet componentProviderInstrumentationHook: ComponentProviderInstrumentationHook = (\n  component: ComponentProvider,\n) => component();\n\nlet wrapperComponentProvider: ?WrapperComponentProvider;\n\n/**\n * `AppRegistry` is the JavaScript entry point to running all React Native apps.\n *\n * See http://facebook.github.io/react-native/docs/appregistry.html\n */\nconst AppRegistry = {\n  setWrapperComponentProvider(provider: WrapperComponentProvider) {\n    wrapperComponentProvider = provider;\n  },\n\n  registerConfig(config: Array<AppConfig>): void {\n    config.forEach(appConfig => {\n      if (appConfig.run) {\n        AppRegistry.registerRunnable(appConfig.appKey, appConfig.run);\n      } else {\n        invariant(\n          appConfig.component != null,\n          'AppRegistry.registerConfig(...): Every config is expected to set ' +\n            'either `run` or `component`, but `%s` has neither.',\n          appConfig.appKey,\n        );\n        AppRegistry.registerComponent(\n          appConfig.appKey,\n          appConfig.component,\n          appConfig.section,\n        );\n      }\n    });\n  },\n\n  /**\n   * Registers an app's root component.\n   *\n   * See http://facebook.github.io/react-native/docs/appregistry.html#registercomponent\n   */\n  registerComponent(\n    appKey: string,\n    componentProvider: ComponentProvider,\n    section?: boolean,\n  ): string {\n    runnables[appKey] = {\n      componentProvider,\n      run: appParameters =>\n        renderApplication(\n          componentProviderInstrumentationHook(componentProvider),\n          appParameters.initialProps,\n          appParameters.rootTag,\n          wrapperComponentProvider && wrapperComponentProvider(appParameters),\n        ),\n    };\n    if (section) {\n      sections[appKey] = runnables[appKey];\n    }\n    return appKey;\n  },\n\n  registerRunnable(appKey: string, run: Function): string {\n    runnables[appKey] = {run};\n    return appKey;\n  },\n\n  registerSection(appKey: string, component: ComponentProvider): void {\n    AppRegistry.registerComponent(appKey, component, true);\n  },\n\n  getAppKeys(): Array<string> {\n    return Object.keys(runnables);\n  },\n\n  getSectionKeys(): Array<string> {\n    return Object.keys(sections);\n  },\n\n  getSections(): Runnables {\n    return {\n      ...sections,\n    };\n  },\n\n  getRunnable(appKey: string): ?Runnable {\n    return runnables[appKey];\n  },\n\n  getRegistry(): Registry {\n    return {\n      sections: AppRegistry.getSectionKeys(),\n      runnables: {...runnables},\n    };\n  },\n\n  setComponentProviderInstrumentationHook(\n    hook: ComponentProviderInstrumentationHook,\n  ) {\n    componentProviderInstrumentationHook = hook;\n  },\n\n  /**\n   * Loads the JavaScript bundle and runs the app.\n   *\n   * See http://facebook.github.io/react-native/docs/appregistry.html#runapplication\n   */\n  runApplication(appKey: string, appParameters: any): void {\n    const msg =\n      'Running application \"' +\n      appKey +\n      '\" with appParams: ' +\n      JSON.stringify(appParameters) +\n      '. ' +\n      '__DEV__ === ' +\n      String(__DEV__) +\n      ', development-level warning are ' +\n      (__DEV__ ? 'ON' : 'OFF') +\n      ', performance optimizations are ' +\n      (__DEV__ ? 'OFF' : 'ON');\n    infoLog(msg);\n    BugReporting.addSource(\n      'AppRegistry.runApplication' + runCount++,\n      () => msg,\n    );\n    invariant(\n      runnables[appKey] && runnables[appKey].run,\n      'Application ' +\n        appKey +\n        ' has not been registered.\\n\\n' +\n        \"Hint: This error often happens when you're running the packager \" +\n        '(local dev server) from a wrong folder. For example you have ' +\n        'multiple apps and the packager is still running for the app you ' +\n        'were working on before.\\nIf this is the case, simply kill the old ' +\n        'packager instance (e.g. close the packager terminal window) ' +\n        'and start the packager in the correct app folder (e.g. cd into app ' +\n        \"folder and run 'npm start').\\n\\n\" +\n        'This error can also happen due to a require() error during ' +\n        'initialization or failure to call AppRegistry.registerComponent.\\n\\n',\n    );\n\n    SceneTracker.setActiveScene({name: appKey});\n    runnables[appKey].run(appParameters);\n  },\n\n  /**\n   * Stops an application when a view should be destroyed.\n   *\n   * See http://facebook.github.io/react-native/docs/appregistry.html#unmountapplicationcomponentatroottag\n   */\n  unmountApplicationComponentAtRootTag(rootTag: number): void {\n    ReactNative.unmountComponentAtNodeAndRemoveContainer(rootTag);\n  },\n\n  /**\n   * Register a headless task. A headless task is a bit of code that runs without a UI.\n   *\n   * See http://facebook.github.io/react-native/docs/appregistry.html#registerheadlesstask\n   */\n  registerHeadlessTask(taskKey: string, task: TaskProvider): void {\n    if (tasks.has(taskKey)) {\n      console.warn(\n        `registerHeadlessTask called multiple times for same key '${taskKey}'`,\n      );\n    }\n    tasks.set(taskKey, task);\n  },\n\n  /**\n   * Only called from native code. Starts a headless task.\n   *\n   * See http://facebook.github.io/react-native/docs/appregistry.html#startheadlesstask\n   */\n  startHeadlessTask(taskId: number, taskKey: string, data: any): void {\n    const taskProvider = tasks.get(taskKey);\n    if (!taskProvider) {\n      throw new Error(`No task registered for key ${taskKey}`);\n    }\n    taskProvider()(data)\n      .then(() =>\n        NativeModules.HeadlessJsTaskSupport.notifyTaskFinished(taskId),\n      )\n      .catch(reason => {\n        console.error(reason);\n        NativeModules.HeadlessJsTaskSupport.notifyTaskFinished(taskId);\n      });\n  },\n};\n\nBatchedBridge.registerCallableModule('AppRegistry', AppRegistry);\n\nmodule.exports = AppRegistry;\n"
  },
  {
    "path": "Libraries/ReactNative/I18nManager.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule I18nManager\n * @flow\n * @format\n */\n'use strict';\n\ntype I18nManagerStatus = {\n  isRTL: boolean,\n  doLeftAndRightSwapInRTL: boolean,\n  allowRTL: (allowRTL: boolean) => {},\n  forceRTL: (forceRTL: boolean) => {},\n  swapLeftAndRightInRTL: (flipStyles: boolean) => {},\n};\n\nconst I18nManager: I18nManagerStatus = require('NativeModules').I18nManager || {\n  isRTL: false,\n  doLeftAndRightSwapInRTL: true,\n  allowRTL: () => {},\n  forceRTL: () => {},\n  swapLeftAndRightInRTL: () => {},\n};\n\nmodule.exports = I18nManager;\n"
  },
  {
    "path": "Libraries/ReactNative/ReactNativeFeatureFlags.js",
    "content": "/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactNativeFeatureFlags\n * @flow\n * @format\n */\n\n'use strict';\n\n// =============================================================================\n// IMPORTANT:\n// When syncing React Renderer, make sure the feature flags are still compatible\n// =============================================================================\n\nvar useFiber;\n\nvar ReactNativeFeatureFlags = {\n  get useFiber(): boolean {\n    if (useFiber == null) {\n      useFiber = true;\n      if (__DEV__) {\n        require('Systrace').installReactHook(useFiber);\n      }\n    }\n    return useFiber;\n  },\n  set useFiber(enabled: boolean): void {\n    if (useFiber != null) {\n      throw new Error(\n        'Cannot set useFiber feature flag after it has been accessed. ' +\n          'Please override it before requiring React.',\n      );\n    }\n    useFiber = enabled;\n    if (__DEV__) {\n      require('Systrace').installReactHook(useFiber);\n    }\n  },\n};\n\nmodule.exports = ReactNativeFeatureFlags;\n"
  },
  {
    "path": "Libraries/ReactNative/UIManager.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule UIManager\n * @flow\n * @format\n */\n'use strict';\n\nconst NativeModules = require('NativeModules');\nconst Platform = require('Platform');\n\nconst defineLazyObjectProperty = require('defineLazyObjectProperty');\nconst invariant = require('fbjs/lib/invariant');\n\nconst {UIManager} = NativeModules;\n\ninvariant(\n  UIManager,\n  'UIManager is undefined. The native module config is probably incorrect.',\n);\n\n// In past versions of ReactNative users called UIManager.takeSnapshot()\n// However takeSnapshot was moved to ReactNative in order to support flat\n// bundles and to avoid a cyclic dependency between UIManager and ReactNative.\n// UIManager.takeSnapshot still exists though. In order to avoid confusion or\n// accidental usage, mask the method with a deprecation warning.\nUIManager.__takeSnapshot = UIManager.takeSnapshot;\nUIManager.takeSnapshot = function() {\n  invariant(\n    false,\n    'UIManager.takeSnapshot should not be called directly. ' +\n      'Use ReactNative.takeSnapshot instead.',\n  );\n};\n\n/**\n * Copies the ViewManager constants and commands into UIManager. This is\n * only needed for iOS, which puts the constants in the ViewManager\n * namespace instead of UIManager, unlike Android.\n */\nif (Platform.OS === 'ios' || Platform.OS === 'macos') {\n  Object.keys(UIManager).forEach(viewName => {\n    const viewConfig = UIManager[viewName];\n    if (viewConfig.Manager) {\n      defineLazyObjectProperty(viewConfig, 'Constants', {\n        get: () => {\n          const viewManager = NativeModules[viewConfig.Manager];\n          const constants = {};\n          viewManager &&\n            Object.keys(viewManager).forEach(key => {\n              const value = viewManager[key];\n              if (typeof value !== 'function') {\n                constants[key] = value;\n              }\n            });\n          return constants;\n        },\n      });\n      defineLazyObjectProperty(viewConfig, 'Commands', {\n        get: () => {\n          const viewManager = NativeModules[viewConfig.Manager];\n          const commands = {};\n          let index = 0;\n          viewManager &&\n            Object.keys(viewManager).forEach(key => {\n              const value = viewManager[key];\n              if (typeof value === 'function') {\n                commands[key] = index++;\n              }\n            });\n          return commands;\n        },\n      });\n    }\n  });\n} else if (Platform.OS === 'android' && UIManager.ViewManagerNames) {\n  UIManager.ViewManagerNames.forEach(viewManagerName => {\n    defineLazyObjectProperty(UIManager, viewManagerName, {\n      get: () => UIManager.getConstantsForViewManager(viewManagerName),\n    });\n  });\n}\n\nmodule.exports = UIManager;\n"
  },
  {
    "path": "Libraries/ReactNative/UIManagerStatTracker.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule UIManagerStatTracker\n * @flow\n * @format\n */\n'use strict';\n\nvar UIManager = require('UIManager');\n\nvar installed = false;\nvar UIManagerStatTracker = {\n  install: function() {\n    if (installed) {\n      return;\n    }\n    installed = true;\n    var statLogHandle;\n    var stats = {};\n    function printStats() {\n      console.log({UIManagerStatTracker: stats});\n      statLogHandle = null;\n    }\n    function incStat(key: string, increment: number) {\n      stats[key] = (stats[key] || 0) + increment;\n      if (!statLogHandle) {\n        statLogHandle = setImmediate(printStats);\n      }\n    }\n    var createViewOrig = UIManager.createView;\n    UIManager.createView = function(tag, className, rootTag, props) {\n      incStat('createView', 1);\n      incStat('setProp', Object.keys(props || []).length);\n      createViewOrig(tag, className, rootTag, props);\n    };\n    var updateViewOrig = UIManager.updateView;\n    UIManager.updateView = function(tag, className, props) {\n      incStat('updateView', 1);\n      incStat('setProp', Object.keys(props || []).length);\n      updateViewOrig(tag, className, props);\n    };\n    var manageChildrenOrig = UIManager.manageChildren;\n    UIManager.manageChildren = function(\n      tag,\n      moveFrom,\n      moveTo,\n      addTags,\n      addIndices,\n      remove,\n    ) {\n      incStat('manageChildren', 1);\n      incStat('move', Object.keys(moveFrom || []).length);\n      incStat('remove', Object.keys(remove || []).length);\n      manageChildrenOrig(tag, moveFrom, moveTo, addTags, addIndices, remove);\n    };\n  },\n};\n\nmodule.exports = UIManagerStatTracker;\n"
  },
  {
    "path": "Libraries/ReactNative/YellowBox.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule YellowBox\n * @flow\n * @format\n */\n\n'use strict';\n\nconst EventEmitter = require('EventEmitter');\nconst Platform = require('Platform');\nconst React = require('React');\nconst SafeAreaView = require('SafeAreaView');\nconst StyleSheet = require('StyleSheet');\nconst RCTLog = require('RCTLog');\n\nconst infoLog = require('infoLog');\nconst openFileInEditor = require('openFileInEditor');\nconst parseErrorStack = require('parseErrorStack');\nconst stringifySafe = require('stringifySafe');\nconst symbolicateStackTrace = require('symbolicateStackTrace');\n\nimport type EmitterSubscription from 'EmitterSubscription';\nimport type {StackFrame} from 'parseErrorStack';\n\ntype WarningInfo = {\n  count: number,\n  stacktrace: Array<StackFrame>,\n  symbolicated: boolean,\n};\n\nconst _warningEmitter = new EventEmitter();\nconst _warningMap: Map<string, WarningInfo> = new Map();\nconst IGNORED_WARNINGS: Array<string> = [];\n\n/**\n * YellowBox renders warnings at the bottom of the app being developed.\n *\n * Warnings help guard against subtle yet significant issues that can impact the\n * quality of the app. This \"in your face\" style of warning allows developers to\n * notice and correct these issues as quickly as possible.\n *\n * By default, the warning box is enabled in `__DEV__`. Set the following flag\n * to disable it (and call `console.warn` to update any rendered <YellowBox>):\n *\n *   console.disableYellowBox = true;\n *   console.warn('YellowBox is disabled.');\n *\n * Ignore specific warnings by calling:\n *\n *   YellowBox.ignoreWarnings(['Warning: ...']);\n *\n * (DEPRECATED) Warnings can be ignored programmatically by setting the array:\n *\n *   console.ignoredYellowBox = ['Warning: ...'];\n *\n * Strings in `console.ignoredYellowBox` can be a prefix of the warning that\n * should be ignored.\n */\n\nif (__DEV__) {\n  const {error, warn} = console;\n\n  (console: any).error = function() {\n    error.apply(console, arguments);\n    // Show yellow box for the `warning` module.\n    if (\n      typeof arguments[0] === 'string' &&\n      arguments[0].startsWith('Warning: ')\n    ) {\n      updateWarningMap.apply(null, arguments);\n    }\n  };\n\n  (console: any).warn = function() {\n    warn.apply(console, arguments);\n    updateWarningMap.apply(null, arguments);\n  };\n\n  if (Platform.isTesting) {\n    (console: any).disableYellowBox = true;\n  }\n\n  RCTLog.setWarningHandler((...args) => {\n    updateWarningMap.apply(null, args);\n  });\n}\n\n/**\n * Simple function for formatting strings.\n *\n * Replaces placeholders with values passed as extra arguments\n *\n * @param {string} format the base string\n * @param ...args the values to insert\n * @return {string} the replaced string\n */\nfunction sprintf(format, ...args) {\n  let index = 0;\n  return format.replace(/%s/g, match => args[index++]);\n}\n\nfunction updateWarningMap(...args): void {\n  if (console.disableYellowBox) {\n    return;\n  }\n\n  let warning;\n  if (typeof args[0] === 'string') {\n    const [format, ...formatArgs] = args;\n    const argCount = (format.match(/%s/g) || []).length;\n    warning = [\n      sprintf(format, ...formatArgs.slice(0, argCount).map(stringifySafe)),\n      ...formatArgs.slice(argCount).map(stringifySafe),\n    ].join(' ');\n  } else {\n    warning = args.map(stringifySafe).join(' ');\n  }\n\n  if (warning.startsWith('(ADVICE)')) {\n    return;\n  }\n\n  const warningInfo = _warningMap.get(warning);\n  if (warningInfo) {\n    warningInfo.count += 1;\n  } else {\n    const error: any = new Error();\n    error.framesToPop = 2;\n\n    _warningMap.set(warning, {\n      count: 1,\n      stacktrace: parseErrorStack(error),\n      symbolicated: false,\n    });\n  }\n\n  _warningEmitter.emit('warning', _warningMap);\n}\n\nfunction ensureSymbolicatedWarning(warning: string): void {\n  const prevWarningInfo = _warningMap.get(warning);\n  if (!prevWarningInfo || prevWarningInfo.symbolicated) {\n    return;\n  }\n  prevWarningInfo.symbolicated = true;\n\n  symbolicateStackTrace(prevWarningInfo.stacktrace).then(\n    stack => {\n      const nextWarningInfo = _warningMap.get(warning);\n      if (nextWarningInfo) {\n        nextWarningInfo.stacktrace = stack;\n        _warningEmitter.emit('warning', _warningMap);\n      }\n    },\n    error => {\n      const nextWarningInfo = _warningMap.get(warning);\n      if (nextWarningInfo) {\n        infoLog('Failed to symbolicate warning, \"%s\":', warning, error);\n        _warningEmitter.emit('warning', _warningMap);\n      }\n    },\n  );\n}\n\nfunction isWarningIgnored(warning: string): boolean {\n  const isIgnored = IGNORED_WARNINGS.some((ignoredWarning: string) =>\n    warning.startsWith(ignoredWarning),\n  );\n\n  if (isIgnored) {\n    return true;\n  }\n\n  // DEPRECATED\n  return (\n    Array.isArray(console.ignoredYellowBox) &&\n    console.ignoredYellowBox.some(ignorePrefix =>\n      warning.startsWith(String(ignorePrefix)),\n    )\n  );\n}\n\nconst WarningRow = ({count, warning, onPress}) => {\n  const Text = require('Text');\n  const TouchableHighlight = require('TouchableHighlight');\n  const View = require('View');\n\n  const countText =\n    count > 1 ? (\n      <Text style={styles.listRowCount}>{'(' + count + ') '}</Text>\n    ) : null;\n\n  return (\n    <View style={styles.listRow}>\n      <TouchableHighlight\n        activeOpacity={0.5}\n        onPress={onPress}\n        style={styles.listRowContent}\n        underlayColor=\"transparent\">\n        <Text style={styles.listRowText} numberOfLines={2}>\n          {countText}\n          {warning}\n        </Text>\n      </TouchableHighlight>\n    </View>\n  );\n};\n\ntype StackRowProps = {frame: StackFrame};\nconst StackRow = ({frame}: StackRowProps) => {\n  const Text = require('Text');\n  const TouchableHighlight = require('TouchableHighlight');\n  const {file, lineNumber} = frame;\n  let fileName;\n  if (file) {\n    const fileParts = file.split('/');\n    fileName = fileParts[fileParts.length - 1];\n  } else {\n    fileName = '<unknown file>';\n  }\n\n  return (\n    <TouchableHighlight\n      activeOpacity={0.5}\n      style={styles.openInEditorButton}\n      underlayColor=\"transparent\"\n      onPress={openFileInEditor.bind(null, file, lineNumber)}>\n      <Text style={styles.inspectorCountText}>\n        {fileName}:{lineNumber}\n      </Text>\n    </TouchableHighlight>\n  );\n};\n\nconst WarningInspector = ({\n  warningInfo,\n  warning,\n  stacktraceVisible,\n  onDismiss,\n  onDismissAll,\n  onMinimize,\n  toggleStacktrace,\n}) => {\n  const ScrollView = require('ScrollView');\n  const Text = require('Text');\n  const TouchableHighlight = require('TouchableHighlight');\n  const View = require('View');\n  const {count, stacktrace} = warningInfo || {};\n\n  const countSentence =\n    'Warning encountered ' + count + ' time' + (count - 1 ? 's' : '') + '.';\n\n  let stacktraceList;\n  if (stacktraceVisible && stacktrace) {\n    stacktraceList = (\n      <View style={styles.stacktraceList}>\n        {stacktrace.map((frame, ii) => <StackRow frame={frame} key={ii} />)}\n      </View>\n    );\n  }\n\n  return (\n    <View style={styles.inspector}>\n      <SafeAreaView style={styles.safeArea}>\n        <View style={styles.inspectorCount}>\n          <Text style={styles.inspectorCountText}>{countSentence}</Text>\n          <TouchableHighlight\n            onPress={toggleStacktrace}\n            underlayColor=\"transparent\">\n            <Text style={styles.inspectorButtonText}>\n              {stacktraceVisible ? '\\u{25BC}' : '\\u{25B6}'} Stacktrace\n            </Text>\n          </TouchableHighlight>\n        </View>\n        <ScrollView style={styles.inspectorWarning}>\n          {stacktraceList}\n          <Text style={styles.inspectorWarningText}>{warning}</Text>\n        </ScrollView>\n        <View style={styles.inspectorButtons}>\n          <TouchableHighlight\n            activeOpacity={0.5}\n            onPress={onMinimize}\n            style={styles.inspectorButton}\n            underlayColor=\"transparent\">\n            <Text style={styles.inspectorButtonText}>Minimize</Text>\n          </TouchableHighlight>\n          <TouchableHighlight\n            activeOpacity={0.5}\n            onPress={onDismiss}\n            style={styles.inspectorButton}\n            underlayColor=\"transparent\">\n            <Text style={styles.inspectorButtonText}>Dismiss</Text>\n          </TouchableHighlight>\n          <TouchableHighlight\n            activeOpacity={0.5}\n            onPress={onDismissAll}\n            style={styles.inspectorButton}\n            underlayColor=\"transparent\">\n            <Text style={styles.inspectorButtonText}>Dismiss All</Text>\n          </TouchableHighlight>\n        </View>\n      </SafeAreaView>\n    </View>\n  );\n};\n\nclass YellowBox extends React.Component<\n  mixed,\n  {\n    stacktraceVisible: boolean,\n    inspecting: ?string,\n    warningMap: Map<any, any>,\n  },\n> {\n  _listener: ?EmitterSubscription;\n  dismissWarning: (warning: ?string) => void;\n\n  constructor(props: mixed, context: mixed) {\n    super(props, context);\n    this.state = {\n      inspecting: null,\n      stacktraceVisible: false,\n      warningMap: _warningMap,\n    };\n    this.dismissWarning = warning => {\n      const {inspecting, warningMap} = this.state;\n      if (warning) {\n        warningMap.delete(warning);\n      } else {\n        warningMap.clear();\n      }\n      this.setState({\n        inspecting: warning && inspecting !== warning ? inspecting : null,\n        warningMap,\n      });\n    };\n  }\n\n  static ignoreWarnings(warnings: Array<string>): void {\n    warnings.forEach((warning: string) => {\n      if (IGNORED_WARNINGS.indexOf(warning) === -1) {\n        IGNORED_WARNINGS.push(warning);\n      }\n    });\n  }\n\n  componentDidMount() {\n    let scheduled = null;\n    this._listener = _warningEmitter.addListener('warning', warningMap => {\n      // Use `setImmediate` because warnings often happen during render, but\n      // state cannot be set while rendering.\n      scheduled =\n        scheduled ||\n        setImmediate(() => {\n          scheduled = null;\n          this.setState({\n            warningMap,\n          });\n        });\n    });\n  }\n\n  componentDidUpdate() {\n    const {inspecting} = this.state;\n    if (inspecting != null) {\n      ensureSymbolicatedWarning(inspecting);\n    }\n  }\n\n  componentWillUnmount() {\n    if (this._listener) {\n      this._listener.remove();\n    }\n  }\n\n  render() {\n    if (console.disableYellowBox || this.state.warningMap.size === 0) {\n      return null;\n    }\n    const ScrollView = require('ScrollView');\n    const View = require('View');\n\n    const {inspecting, stacktraceVisible} = this.state;\n    const inspector =\n      inspecting !== null ? (\n        <WarningInspector\n          warningInfo={this.state.warningMap.get(inspecting)}\n          warning={inspecting}\n          stacktraceVisible={stacktraceVisible}\n          onDismiss={() => this.dismissWarning(inspecting)}\n          onDismissAll={() => this.dismissWarning(null)}\n          onMinimize={() => this.setState({inspecting: null})}\n          toggleStacktrace={() =>\n            this.setState({stacktraceVisible: !stacktraceVisible})\n          }\n        />\n      ) : null;\n\n    const rows = [];\n    this.state.warningMap.forEach((warningInfo, warning) => {\n      if (!isWarningIgnored(warning)) {\n        rows.push(\n          <WarningRow\n            key={warning}\n            count={warningInfo.count}\n            warning={warning}\n            onPress={() => this.setState({inspecting: warning})}\n            onDismiss={() => this.dismissWarning(warning)}\n          />,\n        );\n      }\n    });\n\n    const listStyle = [\n      styles.list,\n      // Additional `0.4` so the 5th row can peek into view.\n      {height: Math.min(rows.length, 4.4) * (rowGutter + rowHeight)},\n    ];\n    return (\n      <View style={inspector ? styles.fullScreen : listStyle}>\n        <ScrollView style={listStyle} scrollsToTop={false}>\n          {rows}\n        </ScrollView>\n        {inspector}\n      </View>\n    );\n  }\n}\n\nconst backgroundColor = opacity => 'rgba(250, 186, 48, ' + opacity + ')';\nconst textColor = 'white';\nconst rowGutter = 1;\nconst rowHeight = 46;\n\n// For unknown reasons, setting elevation: Number.MAX_VALUE causes remote debugging to\n// hang on iOS (some sort of overflow maybe). Setting it to Number.MAX_SAFE_INTEGER fixes the iOS issue, but since\n// elevation is an android-only style property we might as well remove it altogether for iOS.\n// See: https://github.com/facebook/react-native/issues/12223\nconst elevation =\n  Platform.OS === 'android' ? Number.MAX_SAFE_INTEGER : undefined;\n\nvar styles = StyleSheet.create({\n  fullScreen: {\n    height: '100%',\n    width: '100%',\n    elevation: elevation,\n    position: 'absolute',\n  },\n  inspector: {\n    backgroundColor: backgroundColor(0.95),\n    height: '100%',\n    paddingTop: 50,\n    padding: 20,\n    elevation: elevation,\n  },\n  inspectorButtons: {\n    flexDirection: 'row',\n  },\n  inspectorButton: {\n    flex: 1,\n    paddingVertical: 22,\n    backgroundColor: backgroundColor(1),\n  },\n  safeArea: {\n    flex: 1,\n  },\n  stacktraceList: {\n    paddingBottom: 5,\n  },\n  inspectorButtonText: {\n    color: textColor,\n    fontSize: 14,\n    opacity: 0.8,\n    textAlign: 'center',\n  },\n  openInEditorButton: {\n    paddingTop: 5,\n    paddingBottom: 5,\n  },\n  inspectorCount: {\n    padding: 15,\n    paddingBottom: 0,\n    flexDirection: 'row',\n    justifyContent: 'space-between',\n  },\n  inspectorCountText: {\n    color: textColor,\n    fontSize: 14,\n  },\n  inspectorWarning: {\n    flex: 1,\n    paddingHorizontal: 15,\n  },\n  inspectorWarningText: {\n    color: textColor,\n    fontSize: 16,\n    fontWeight: '600',\n  },\n  list: {\n    backgroundColor: 'transparent',\n    position: 'absolute',\n    left: 0,\n    right: 0,\n    bottom: 0,\n    elevation: elevation,\n  },\n  listRow: {\n    backgroundColor: backgroundColor(0.95),\n    height: rowHeight,\n    marginTop: rowGutter,\n  },\n  listRowContent: {\n    flex: 1,\n  },\n  listRowCount: {\n    color: 'rgba(255, 255, 255, 0.5)',\n  },\n  listRowText: {\n    color: textColor,\n    position: 'absolute',\n    left: 0,\n    top: Platform.OS === 'android' ? 5 : 7,\n    marginLeft: 15,\n    marginRight: 15,\n  },\n});\n\nmodule.exports = YellowBox;\n"
  },
  {
    "path": "Libraries/ReactNative/queryLayoutByID.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule queryLayoutByID\n * @flow\n * @format\n */\n'use strict';\n\nvar UIManager = require('UIManager');\n\ntype OnSuccessCallback = (\n  left: number,\n  top: number,\n  width: number,\n  height: number,\n  pageX: number,\n  pageY: number,\n) => void;\n\n// I don't know what type error is...\ntype OnErrorCallback = (error: any) => void;\n\n/**\n * Queries the layout of a view. The layout does not reflect the element as\n * seen by the user, rather it reflects the position within the layout system,\n * before any transforms are applied.\n *\n * The only other requirement is that the `pageX, pageY` values be in the same\n * coordinate system that events' `pageX/Y` are reported. That means that for\n * the web, `pageXOffset/pageYOffset` should be added to to\n * getBoundingClientRect to make consistent with touches.\n *\n *  var pageXOffset = window.pageXOffset;\n *  var pageYOffset = window.pageYOffset;\n *\n * This is an IOS specific implementation.\n *\n * @param {number} tag ID of the platform specific node to be measured.\n * @param {function} onError `func(error)`\n * @param {function} onSuccess `func(left, top, width, height, pageX, pageY)`\n */\nvar queryLayoutByID = function(\n  tag: ?number,\n  onError: OnErrorCallback,\n  onSuccess: OnSuccessCallback,\n): void {\n  if (tag == null) {\n    return;\n  }\n  // Native bridge doesn't *yet* surface errors.\n  UIManager.measure(tag, onSuccess);\n};\n\nmodule.exports = queryLayoutByID;\n"
  },
  {
    "path": "Libraries/ReactNative/renderApplication.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule renderApplication\n * @format\n * @flow\n */\n\n'use strict';\n\nconst AppContainer = require('AppContainer');\nconst React = require('React');\nconst ReactNative = require('ReactNative');\n\nconst invariant = require('fbjs/lib/invariant');\n\n// require BackHandler so it sets the default handler that exits the app if no listeners respond\nrequire('BackHandler');\n\nfunction renderApplication<Props: Object>(\n  RootComponent: React.ComponentType<Props>,\n  initialProps: Props,\n  rootTag: any,\n  WrapperComponent?: ?React.ComponentType<*>,\n) {\n  invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag);\n\n  let renderable = (\n    <AppContainer rootTag={rootTag} WrapperComponent={WrapperComponent}>\n      <RootComponent {...initialProps} rootTag={rootTag} />\n    </AppContainer>\n  );\n\n  // If the root component is async, the user probably wants the initial render\n  // to be async also. To do this, wrap AppContainer with an async marker.\n  // For more info see https://fb.me/is-component-async\n  if (\n    RootComponent.prototype != null &&\n    RootComponent.prototype.unstable_isAsyncReactComponent === true\n  ) {\n    // $FlowFixMe This is not yet part of the official public API\n    class AppContainerAsyncWrapper extends React.unstable_AsyncComponent {\n      render() {\n        return this.props.children;\n      }\n    }\n\n    renderable = (\n      <AppContainerAsyncWrapper>{renderable}</AppContainerAsyncWrapper>\n    );\n  }\n\n  ReactNative.render(renderable, rootTag);\n}\n\nmodule.exports = renderApplication;\n"
  },
  {
    "path": "Libraries/ReactNative/requireNativeComponent.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule requireNativeComponent\n * @flow\n * @format\n */\n'use strict';\n\nconst Platform = require('Platform');\nconst ReactNativeBridgeEventPlugin = require('ReactNativeBridgeEventPlugin');\nconst ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');\nconst UIManager = require('UIManager');\n\nconst createReactNativeComponentClass = require('createReactNativeComponentClass');\nconst insetsDiffer = require('insetsDiffer');\nconst matricesDiffer = require('matricesDiffer');\nconst pointsDiffer = require('pointsDiffer');\nconst processColor = require('processColor');\nconst resolveAssetSource = require('resolveAssetSource');\nconst sizesDiffer = require('sizesDiffer');\nconst verifyPropTypes = require('verifyPropTypes');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst invariant = require('fbjs/lib/invariant');\nconst warning = require('fbjs/lib/warning');\n\n/**\n * Used to create React components that directly wrap native component\n * implementations.  Config information is extracted from data exported from the\n * UIManager module.  You should also wrap the native component in a\n * hand-written component with full propTypes definitions and other\n * documentation - pass the hand-written component in as `componentInterface` to\n * verify all the native props are documented via `propTypes`.\n *\n * If some native props shouldn't be exposed in the wrapper interface, you can\n * pass null for `componentInterface` and call `verifyPropTypes` directly\n * with `nativePropsToIgnore`;\n *\n * Common types are lined up with the appropriate prop differs with\n * `TypeToDifferMap`.  Non-scalar types not in the map default to `deepDiffer`.\n */\nimport type {ComponentInterface} from 'verifyPropTypes';\n\nlet hasAttachedDefaultEventTypes: boolean = false;\n\nfunction requireNativeComponent(\n  viewName: string,\n  componentInterface?: ?ComponentInterface,\n  extraConfig?: ?{nativeOnly?: Object},\n): React$ComponentType<any> | string {\n  function attachDefaultEventTypes(viewConfig: any) {\n    if (Platform.OS === 'android') {\n      // This is supported on Android platform only,\n      // as lazy view managers discovery is Android-specific.\n      if (UIManager.ViewManagerNames) {\n        // Lazy view managers enabled.\n        viewConfig = merge(viewConfig, UIManager.getDefaultEventTypes());\n      } else {\n        viewConfig.bubblingEventTypes = merge(\n          viewConfig.bubblingEventTypes,\n          UIManager.genericBubblingEventTypes,\n        );\n        viewConfig.directEventTypes = merge(\n          viewConfig.directEventTypes,\n          UIManager.genericDirectEventTypes,\n        );\n      }\n    }\n  }\n\n  function merge(destination: ?Object, source: ?Object): ?Object {\n    if (!source) {\n      return destination;\n    }\n    if (!destination) {\n      return source;\n    }\n\n    for (const key in source) {\n      if (!source.hasOwnProperty(key)) {\n        continue;\n      }\n\n      var sourceValue = source[key];\n      if (destination.hasOwnProperty(key)) {\n        const destinationValue = destination[key];\n        if (\n          typeof sourceValue === 'object' &&\n          typeof destinationValue === 'object'\n        ) {\n          sourceValue = merge(destinationValue, sourceValue);\n        }\n      }\n      destination[key] = sourceValue;\n    }\n    return destination;\n  }\n\n  // Don't load the ViewConfig from UIManager until it's needed for rendering.\n  // Lazy-loading this can help avoid Prepack deopts.\n  function getViewConfig() {\n    const viewConfig = UIManager[viewName];\n\n    invariant(\n      viewConfig != null && !viewConfig.NativeProps != null,\n      'Native component for \"%s\" does not exist',\n      viewName,\n    );\n\n    viewConfig.uiViewClassName = viewName;\n    viewConfig.validAttributes = {};\n\n    // ReactNative `View.propTypes` have been deprecated in favor of\n    // `ViewPropTypes`. In their place a temporary getter has been added with a\n    // deprecated warning message. Avoid triggering that warning here by using\n    // temporary workaround, __propTypesSecretDontUseThesePlease.\n    // TODO (bvaughn) Revert this particular change any time after April 1\n    if (componentInterface) {\n      viewConfig.propTypes =\n        typeof componentInterface.__propTypesSecretDontUseThesePlease ===\n        'object'\n          ? componentInterface.__propTypesSecretDontUseThesePlease\n          : componentInterface.propTypes;\n    } else {\n      viewConfig.propTypes = null;\n    }\n\n    let baseModuleName = viewConfig.baseModuleName;\n    let nativeProps = {...viewConfig.NativeProps};\n    while (baseModuleName) {\n      const baseModule = UIManager[baseModuleName];\n      if (!baseModule) {\n        warning(false, 'Base module \"%s\" does not exist', baseModuleName);\n        baseModuleName = null;\n      } else {\n        nativeProps = {...nativeProps, ...baseModule.NativeProps};\n        baseModuleName = baseModule.baseModuleName;\n      }\n    }\n\n    for (const key in nativeProps) {\n      let useAttribute = false;\n      const attribute = {};\n\n      const differ = TypeToDifferMap[nativeProps[key]];\n      if (differ) {\n        attribute.diff = differ;\n        useAttribute = true;\n      }\n\n      const processor = TypeToProcessorMap[nativeProps[key]];\n      if (processor) {\n        attribute.process = processor;\n        useAttribute = true;\n      }\n\n      viewConfig.validAttributes[key] = useAttribute ? attribute : true;\n    }\n\n    // Unfortunately, the current set up puts the style properties on the top\n    // level props object. We also need to add the nested form for API\n    // compatibility. This allows these props on both the top level and the\n    // nested style level. TODO: Move these to nested declarations on the\n    // native side.\n    viewConfig.validAttributes.style = ReactNativeStyleAttributes;\n\n    if (__DEV__) {\n      componentInterface &&\n        verifyPropTypes(\n          componentInterface,\n          viewConfig,\n          extraConfig && extraConfig.nativeOnly,\n        );\n    }\n\n    if (!hasAttachedDefaultEventTypes) {\n      attachDefaultEventTypes(viewConfig);\n      hasAttachedDefaultEventTypes = true;\n    }\n\n    // Register this view's event types with the ReactNative renderer.\n    // This enables view managers to be initialized lazily, improving perf,\n    // While also enabling 3rd party components to define custom event types.\n    ReactNativeBridgeEventPlugin.processEventTypes(viewConfig);\n\n    return viewConfig;\n  }\n\n  return createReactNativeComponentClass(viewName, getViewConfig);\n}\n\nconst TypeToDifferMap = {\n  // iOS Types\n  CATransform3D: matricesDiffer,\n  CGPoint: pointsDiffer,\n  CGSize: sizesDiffer,\n  UIEdgeInsets: insetsDiffer,\n  // Android Types\n  // (not yet implemented)\n};\n\nfunction processColorArray(colors: ?Array<any>): ?Array<?number> {\n  return colors && colors.map(processColor);\n}\n\nconst TypeToProcessorMap = {\n  // iOS Types\n  CGColor: processColor,\n  CGColorArray: processColorArray,\n  UIColor: processColor,\n  UIColorArray: processColorArray,\n  CGImage: resolveAssetSource,\n  UIImage: resolveAssetSource,\n  RCTImageSource: resolveAssetSource,\n  // Android Types\n  Color: processColor,\n  ColorArray: processColorArray,\n  // OS X Types\n  NSColor: processColor,\n  NSColorArray: processColorArray,\n  NSImage: resolveAssetSource,\n};\n\nmodule.exports = requireNativeComponent;\n"
  },
  {
    "path": "Libraries/ReactNative/verifyPropTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule verifyPropTypes\n * @flow\n * @format\n */\n'use strict';\n\nvar ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');\n\nexport type ComponentInterface =\n  | React$ComponentType<any>\n  | {\n      name?: string,\n      displayName?: string,\n      propTypes: Object,\n    };\n\nfunction verifyPropTypes(\n  componentInterface: ComponentInterface,\n  viewConfig: Object,\n  nativePropsToIgnore?: ?Object,\n) {\n  if (!viewConfig) {\n    return; // This happens for UnimplementedView.\n  }\n  var componentName =\n    componentInterface.displayName || componentInterface.name || 'unknown';\n\n  // ReactNative `View.propTypes` have been deprecated in favor of\n  // `ViewPropTypes`. In their place a temporary getter has been added with a\n  // deprecated warning message. Avoid triggering that warning here by using\n  // temporary workaround, __propTypesSecretDontUseThesePlease.\n  // TODO (bvaughn) Revert this particular change any time after April 1\n  var propTypes =\n    (componentInterface: any).__propTypesSecretDontUseThesePlease ||\n    componentInterface.propTypes;\n\n  if (!propTypes) {\n    throw new Error('`' + componentName + '` has no propTypes defined`');\n  }\n\n  var nativeProps = viewConfig.NativeProps;\n  for (var prop in nativeProps) {\n    if (\n      !propTypes[prop] &&\n      !ReactNativeStyleAttributes[prop] &&\n      (!nativePropsToIgnore || !nativePropsToIgnore[prop])\n    ) {\n      var message;\n      if (propTypes.hasOwnProperty(prop)) {\n        message =\n          '`' +\n          componentName +\n          '` has incorrectly defined propType for native prop `' +\n          viewConfig.uiViewClassName +\n          '.' +\n          prop +\n          '` of native type `' +\n          nativeProps[prop];\n      } else {\n        message =\n          '`' +\n          componentName +\n          '` has no propType for native prop `' +\n          viewConfig.uiViewClassName +\n          '.' +\n          prop +\n          '` of native type `' +\n          nativeProps[prop] +\n          '`';\n      }\n      message +=\n        \"\\nIf you haven't changed this prop yourself, this usually means that \" +\n        'your versions of the native code and JavaScript code are out of sync. Updating both ' +\n        'should make this error go away.';\n      throw new Error(message);\n    }\n  }\n}\n\nmodule.exports = verifyPropTypes;\n"
  },
  {
    "path": "Libraries/Renderer/REVISION",
    "content": "9491dee79586d21c115cd4d5986c81b7d88d2b3f"
  },
  {
    "path": "Libraries/Renderer/ReactNativeRenderer-dev.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @noflow\n * @providesModule ReactNativeRenderer-dev\n * @preventMunge\n */\n\n'use strict';\n\nif (__DEV__) {\n  (function() {\n\"use strict\";\n\nrequire(\"InitializeCore\");\nvar invariant = require(\"fbjs/lib/invariant\");\nvar warning = require(\"fbjs/lib/warning\");\nvar emptyFunction = require(\"fbjs/lib/emptyFunction\");\nvar RCTEventEmitter = require(\"RCTEventEmitter\");\nvar UIManager = require(\"UIManager\");\nvar React = require(\"react\");\nvar ExceptionsManager = require(\"ExceptionsManager\");\nvar TextInputState = require(\"TextInputState\");\nvar deepDiffer = require(\"deepDiffer\");\nvar flattenStyle = require(\"flattenStyle\");\nvar emptyObject = require(\"fbjs/lib/emptyObject\");\nvar checkPropTypes = require(\"prop-types/checkPropTypes\");\nvar shallowEqual = require(\"fbjs/lib/shallowEqual\");\nvar deepFreezeAndThrowOnMutationInDev = require(\"deepFreezeAndThrowOnMutationInDev\");\n\nvar ReactErrorUtils = {\n  // Used by Fiber to simulate a try-catch.\n  _caughtError: null,\n  _hasCaughtError: false,\n\n  // Used by event system to capture/rethrow the first error.\n  _rethrowError: null,\n  _hasRethrowError: false,\n\n  injection: {\n    injectErrorUtils: function(injectedErrorUtils) {\n      invariant(\n        typeof injectedErrorUtils.invokeGuardedCallback === \"function\",\n        \"Injected invokeGuardedCallback() must be a function.\"\n      );\n      invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback;\n    }\n  },\n\n  /**\n   * Call a function while guarding against errors that happens within it.\n   * Returns an error if it throws, otherwise null.\n   *\n   * In production, this is implemented using a try-catch. The reason we don't\n   * use a try-catch directly is so that we can swap out a different\n   * implementation in DEV mode.\n   *\n   * @param {String} name of the guard to use for logging or debugging\n   * @param {Function} func The function to invoke\n   * @param {*} context The context to use when calling the function\n   * @param {...*} args Arguments for function\n   */\n  invokeGuardedCallback: function(name, func, context, a, b, c, d, e, f) {\n    invokeGuardedCallback.apply(ReactErrorUtils, arguments);\n  },\n\n  /**\n   * Same as invokeGuardedCallback, but instead of returning an error, it stores\n   * it in a global so it can be rethrown by `rethrowCaughtError` later.\n   * TODO: See if _caughtError and _rethrowError can be unified.\n   *\n   * @param {String} name of the guard to use for logging or debugging\n   * @param {Function} func The function to invoke\n   * @param {*} context The context to use when calling the function\n   * @param {...*} args Arguments for function\n   */\n  invokeGuardedCallbackAndCatchFirstError: function(\n    name,\n    func,\n    context,\n    a,\n    b,\n    c,\n    d,\n    e,\n    f\n  ) {\n    ReactErrorUtils.invokeGuardedCallback.apply(this, arguments);\n    if (ReactErrorUtils.hasCaughtError()) {\n      var error = ReactErrorUtils.clearCaughtError();\n      if (!ReactErrorUtils._hasRethrowError) {\n        ReactErrorUtils._hasRethrowError = true;\n        ReactErrorUtils._rethrowError = error;\n      }\n    }\n  },\n\n  /**\n   * During execution of guarded functions we will capture the first error which\n   * we will rethrow to be handled by the top level error handler.\n   */\n  rethrowCaughtError: function() {\n    return rethrowCaughtError.apply(ReactErrorUtils, arguments);\n  },\n\n  hasCaughtError: function() {\n    return ReactErrorUtils._hasCaughtError;\n  },\n\n  clearCaughtError: function() {\n    if (ReactErrorUtils._hasCaughtError) {\n      var error = ReactErrorUtils._caughtError;\n      ReactErrorUtils._caughtError = null;\n      ReactErrorUtils._hasCaughtError = false;\n      return error;\n    } else {\n      invariant(\n        false,\n        \"clearCaughtError was called but no error was captured. This error \" +\n          \"is likely caused by a bug in React. Please file an issue.\"\n      );\n    }\n  }\n};\n\nvar invokeGuardedCallback = function(name, func, context, a, b, c, d, e, f) {\n  ReactErrorUtils._hasCaughtError = false;\n  ReactErrorUtils._caughtError = null;\n  var funcArgs = Array.prototype.slice.call(arguments, 3);\n  try {\n    func.apply(context, funcArgs);\n  } catch (error) {\n    ReactErrorUtils._caughtError = error;\n    ReactErrorUtils._hasCaughtError = true;\n  }\n};\n\n{\n  // In DEV mode, we swap out invokeGuardedCallback for a special version\n  // that plays more nicely with the browser's DevTools. The idea is to preserve\n  // \"Pause on exceptions\" behavior. Because React wraps all user-provided\n  // functions in invokeGuardedCallback, and the production version of\n  // invokeGuardedCallback uses a try-catch, all user exceptions are treated\n  // like caught exceptions, and the DevTools won't pause unless the developer\n  // takes the extra step of enabling pause on caught exceptions. This is\n  // untintuitive, though, because even though React has caught the error, from\n  // the developer's perspective, the error is uncaught.\n  //\n  // To preserve the expected \"Pause on exceptions\" behavior, we don't use a\n  // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\n  // DOM node, and call the user-provided callback from inside an event handler\n  // for that fake event. If the callback throws, the error is \"captured\" using\n  // a global event handler. But because the error happens in a different\n  // event loop context, it does not interrupt the normal program flow.\n  // Effectively, this gives us try-catch behavior without actually using\n  // try-catch. Neat!\n\n  // Check that the browser supports the APIs we need to implement our special\n  // DEV version of invokeGuardedCallback\n  if (\n    typeof window !== \"undefined\" &&\n    typeof window.dispatchEvent === \"function\" &&\n    typeof document !== \"undefined\" &&\n    typeof document.createEvent === \"function\"\n  ) {\n    var fakeNode = document.createElement(\"react\");\n\n    var invokeGuardedCallbackDev = function(\n      name,\n      func,\n      context,\n      a,\n      b,\n      c,\n      d,\n      e,\n      f\n    ) {\n      // If document doesn't exist we know for sure we will crash in this method\n      // when we call document.createEvent(). However this can cause confusing\n      // errors: https://github.com/facebookincubator/create-react-app/issues/3482\n      // So we preemptively throw with a better message instead.\n      invariant(\n        typeof document !== \"undefined\",\n        \"The `document` global was defined when React was initialized, but is not \" +\n          \"defined anymore. This can happen in a test environment if a component \" +\n          \"schedules an update from an asynchronous callback, but the test has already \" +\n          \"finished running. To solve this, you can either unmount the component at \" +\n          \"the end of your test (and ensure that any asynchronous operations get \" +\n          \"canceled in `componentWillUnmount`), or you can change the test itself \" +\n          \"to be asynchronous.\"\n      );\n      var evt = document.createEvent(\"Event\");\n\n      // Keeps track of whether the user-provided callback threw an error. We\n      // set this to true at the beginning, then set it to false right after\n      // calling the function. If the function errors, `didError` will never be\n      // set to false. This strategy works even if the browser is flaky and\n      // fails to call our global error handler, because it doesn't rely on\n      // the error event at all.\n      var didError = true;\n\n      // Create an event handler for our fake event. We will synchronously\n      // dispatch our fake event using `dispatchEvent`. Inside the handler, we\n      // call the user-provided callback.\n      var funcArgs = Array.prototype.slice.call(arguments, 3);\n      function callCallback() {\n        // We immediately remove the callback from event listeners so that\n        // nested `invokeGuardedCallback` calls do not clash. Otherwise, a\n        // nested call would trigger the fake event handlers of any call higher\n        // in the stack.\n        fakeNode.removeEventListener(evtType, callCallback, false);\n        func.apply(context, funcArgs);\n        didError = false;\n      }\n\n      // Create a global error event handler. We use this to capture the value\n      // that was thrown. It's possible that this error handler will fire more\n      // than once; for example, if non-React code also calls `dispatchEvent`\n      // and a handler for that event throws. We should be resilient to most of\n      // those cases. Even if our error event handler fires more than once, the\n      // last error event is always used. If the callback actually does error,\n      // we know that the last error event is the correct one, because it's not\n      // possible for anything else to have happened in between our callback\n      // erroring and the code that follows the `dispatchEvent` call below. If\n      // the callback doesn't error, but the error event was fired, we know to\n      // ignore it because `didError` will be false, as described above.\n      var error = void 0;\n      // Use this to track whether the error event is ever called.\n      var didSetError = false;\n      var isCrossOriginError = false;\n\n      function onError(event) {\n        error = event.error;\n        didSetError = true;\n        if (error === null && event.colno === 0 && event.lineno === 0) {\n          isCrossOriginError = true;\n        }\n      }\n\n      // Create a fake event type.\n      var evtType = \"react-\" + (name ? name : \"invokeguardedcallback\");\n\n      // Attach our event handlers\n      window.addEventListener(\"error\", onError);\n      fakeNode.addEventListener(evtType, callCallback, false);\n\n      // Synchronously dispatch our fake event. If the user-provided function\n      // errors, it will trigger our global error handler.\n      evt.initEvent(evtType, false, false);\n      fakeNode.dispatchEvent(evt);\n\n      if (didError) {\n        if (!didSetError) {\n          // The callback errored, but the error event never fired.\n          error = new Error(\n            \"An error was thrown inside one of your components, but React \" +\n              \"doesn't know what it was. This is likely due to browser \" +\n              'flakiness. React does its best to preserve the \"Pause on ' +\n              'exceptions\" behavior of the DevTools, which requires some ' +\n              \"DEV-mode only tricks. It's possible that these don't work in \" +\n              \"your browser. Try triggering the error in production mode, \" +\n              \"or switching to a modern browser. If you suspect that this is \" +\n              \"actually an issue with React, please file an issue.\"\n          );\n        } else if (isCrossOriginError) {\n          error = new Error(\n            \"A cross-origin error was thrown. React doesn't have access to \" +\n              \"the actual error object in development. \" +\n              \"See https://fb.me/react-crossorigin-error for more information.\"\n          );\n        }\n        ReactErrorUtils._hasCaughtError = true;\n        ReactErrorUtils._caughtError = error;\n      } else {\n        ReactErrorUtils._hasCaughtError = false;\n        ReactErrorUtils._caughtError = null;\n      }\n\n      // Remove our event listeners\n      window.removeEventListener(\"error\", onError);\n    };\n\n    invokeGuardedCallback = invokeGuardedCallbackDev;\n  }\n}\n\nvar rethrowCaughtError = function() {\n  if (ReactErrorUtils._hasRethrowError) {\n    var error = ReactErrorUtils._rethrowError;\n    ReactErrorUtils._rethrowError = null;\n    ReactErrorUtils._hasRethrowError = false;\n    throw error;\n  }\n};\n\n/**\n * Injectable ordering of event plugins.\n */\nvar eventPluginOrder = null;\n\n/**\n * Injectable mapping from names to event plugin modules.\n */\nvar namesToPlugins = {};\n\n/**\n * Recomputes the plugin list using the injected plugins and plugin ordering.\n *\n * @private\n */\nfunction recomputePluginOrdering() {\n  if (!eventPluginOrder) {\n    // Wait until an `eventPluginOrder` is injected.\n    return;\n  }\n  for (var pluginName in namesToPlugins) {\n    var pluginModule = namesToPlugins[pluginName];\n    var pluginIndex = eventPluginOrder.indexOf(pluginName);\n    invariant(\n      pluginIndex > -1,\n      \"EventPluginRegistry: Cannot inject event plugins that do not exist in \" +\n        \"the plugin ordering, `%s`.\",\n      pluginName\n    );\n    if (plugins[pluginIndex]) {\n      continue;\n    }\n    invariant(\n      pluginModule.extractEvents,\n      \"EventPluginRegistry: Event plugins must implement an `extractEvents` \" +\n        \"method, but `%s` does not.\",\n      pluginName\n    );\n    plugins[pluginIndex] = pluginModule;\n    var publishedEvents = pluginModule.eventTypes;\n    for (var eventName in publishedEvents) {\n      invariant(\n        publishEventForPlugin(\n          publishedEvents[eventName],\n          pluginModule,\n          eventName\n        ),\n        \"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.\",\n        eventName,\n        pluginName\n      );\n    }\n  }\n}\n\n/**\n * Publishes an event so that it can be dispatched by the supplied plugin.\n *\n * @param {object} dispatchConfig Dispatch configuration for the event.\n * @param {object} PluginModule Plugin publishing the event.\n * @return {boolean} True if the event was successfully published.\n * @private\n */\nfunction publishEventForPlugin(dispatchConfig, pluginModule, eventName) {\n  invariant(\n    !eventNameDispatchConfigs.hasOwnProperty(eventName),\n    \"EventPluginHub: More than one plugin attempted to publish the same \" +\n      \"event name, `%s`.\",\n    eventName\n  );\n  eventNameDispatchConfigs[eventName] = dispatchConfig;\n\n  var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;\n  if (phasedRegistrationNames) {\n    for (var phaseName in phasedRegistrationNames) {\n      if (phasedRegistrationNames.hasOwnProperty(phaseName)) {\n        var phasedRegistrationName = phasedRegistrationNames[phaseName];\n        publishRegistrationName(\n          phasedRegistrationName,\n          pluginModule,\n          eventName\n        );\n      }\n    }\n    return true;\n  } else if (dispatchConfig.registrationName) {\n    publishRegistrationName(\n      dispatchConfig.registrationName,\n      pluginModule,\n      eventName\n    );\n    return true;\n  }\n  return false;\n}\n\n/**\n * Publishes a registration name that is used to identify dispatched events.\n *\n * @param {string} registrationName Registration name to add.\n * @param {object} PluginModule Plugin publishing the event.\n * @private\n */\nfunction publishRegistrationName(registrationName, pluginModule, eventName) {\n  invariant(\n    !registrationNameModules[registrationName],\n    \"EventPluginHub: More than one plugin attempted to publish the same \" +\n      \"registration name, `%s`.\",\n    registrationName\n  );\n  registrationNameModules[registrationName] = pluginModule;\n  registrationNameDependencies[registrationName] =\n    pluginModule.eventTypes[eventName].dependencies;\n\n  {\n    var lowerCasedName = registrationName.toLowerCase();\n  }\n}\n\n/**\n * Registers plugins so that they can extract and dispatch events.\n *\n * @see {EventPluginHub}\n */\n\n/**\n * Ordered list of injected plugins.\n */\nvar plugins = [];\n\n/**\n * Mapping from event name to dispatch config\n */\nvar eventNameDispatchConfigs = {};\n\n/**\n * Mapping from registration name to plugin module\n */\nvar registrationNameModules = {};\n\n/**\n * Mapping from registration name to event name\n */\nvar registrationNameDependencies = {};\n\n/**\n * Mapping from lowercase registration names to the properly cased version,\n * used to warn in the case of missing event handlers. Available\n * only in true.\n * @type {Object}\n */\n\n// Trust the developer to only use possibleRegistrationNames in true\n\n/**\n * Injects an ordering of plugins (by plugin name). This allows the ordering\n * to be decoupled from injection of the actual plugins so that ordering is\n * always deterministic regardless of packaging, on-the-fly injection, etc.\n *\n * @param {array} InjectedEventPluginOrder\n * @internal\n * @see {EventPluginHub.injection.injectEventPluginOrder}\n */\nfunction injectEventPluginOrder(injectedEventPluginOrder) {\n  invariant(\n    !eventPluginOrder,\n    \"EventPluginRegistry: Cannot inject event plugin ordering more than \" +\n      \"once. You are likely trying to load more than one copy of React.\"\n  );\n  // Clone the ordering so it cannot be dynamically mutated.\n  eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);\n  recomputePluginOrdering();\n}\n\n/**\n * Injects plugins to be used by `EventPluginHub`. The plugin names must be\n * in the ordering injected by `injectEventPluginOrder`.\n *\n * Plugins can be injected as part of page initialization or on-the-fly.\n *\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n * @internal\n * @see {EventPluginHub.injection.injectEventPluginsByName}\n */\nfunction injectEventPluginsByName(injectedNamesToPlugins) {\n  var isOrderingDirty = false;\n  for (var pluginName in injectedNamesToPlugins) {\n    if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {\n      continue;\n    }\n    var pluginModule = injectedNamesToPlugins[pluginName];\n    if (\n      !namesToPlugins.hasOwnProperty(pluginName) ||\n      namesToPlugins[pluginName] !== pluginModule\n    ) {\n      invariant(\n        !namesToPlugins[pluginName],\n        \"EventPluginRegistry: Cannot inject two different event plugins \" +\n          \"using the same name, `%s`.\",\n        pluginName\n      );\n      namesToPlugins[pluginName] = pluginModule;\n      isOrderingDirty = true;\n    }\n  }\n  if (isOrderingDirty) {\n    recomputePluginOrdering();\n  }\n}\n\nvar getFiberCurrentPropsFromNode = null;\nvar getInstanceFromNode = null;\nvar getNodeFromInstance = null;\n\nvar injection$1 = {\n  injectComponentTree: function(Injected) {\n    getFiberCurrentPropsFromNode = Injected.getFiberCurrentPropsFromNode;\n    getInstanceFromNode = Injected.getInstanceFromNode;\n    getNodeFromInstance = Injected.getNodeFromInstance;\n\n    {\n      warning(\n        getNodeFromInstance && getInstanceFromNode,\n        \"EventPluginUtils.injection.injectComponentTree(...): Injected \" +\n          \"module is missing getNodeFromInstance or getInstanceFromNode.\"\n      );\n    }\n  }\n};\n\nfunction isEndish(topLevelType) {\n  return (\n    topLevelType === \"topMouseUp\" ||\n    topLevelType === \"topTouchEnd\" ||\n    topLevelType === \"topTouchCancel\"\n  );\n}\n\nfunction isMoveish(topLevelType) {\n  return topLevelType === \"topMouseMove\" || topLevelType === \"topTouchMove\";\n}\nfunction isStartish(topLevelType) {\n  return topLevelType === \"topMouseDown\" || topLevelType === \"topTouchStart\";\n}\n\nvar validateEventDispatches;\n{\n  validateEventDispatches = function(event) {\n    var dispatchListeners = event._dispatchListeners;\n    var dispatchInstances = event._dispatchInstances;\n\n    var listenersIsArr = Array.isArray(dispatchListeners);\n    var listenersLen = listenersIsArr\n      ? dispatchListeners.length\n      : dispatchListeners ? 1 : 0;\n\n    var instancesIsArr = Array.isArray(dispatchInstances);\n    var instancesLen = instancesIsArr\n      ? dispatchInstances.length\n      : dispatchInstances ? 1 : 0;\n\n    warning(\n      instancesIsArr === listenersIsArr && instancesLen === listenersLen,\n      \"EventPluginUtils: Invalid `event`.\"\n    );\n  };\n}\n\n/**\n * Dispatch the event to the listener.\n * @param {SyntheticEvent} event SyntheticEvent to handle\n * @param {boolean} simulated If the event is simulated (changes exn behavior)\n * @param {function} listener Application-level callback\n * @param {*} inst Internal component instance\n */\nfunction executeDispatch(event, simulated, listener, inst) {\n  var type = event.type || \"unknown-event\";\n  event.currentTarget = getNodeFromInstance(inst);\n  ReactErrorUtils.invokeGuardedCallbackAndCatchFirstError(\n    type,\n    listener,\n    undefined,\n    event\n  );\n  event.currentTarget = null;\n}\n\n/**\n * Standard/simple iteration through an event's collected dispatches.\n */\nfunction executeDispatchesInOrder(event, simulated) {\n  var dispatchListeners = event._dispatchListeners;\n  var dispatchInstances = event._dispatchInstances;\n  {\n    validateEventDispatches(event);\n  }\n  if (Array.isArray(dispatchListeners)) {\n    for (var i = 0; i < dispatchListeners.length; i++) {\n      if (event.isPropagationStopped()) {\n        break;\n      }\n      // Listeners and Instances are two parallel arrays that are always in sync.\n      executeDispatch(\n        event,\n        simulated,\n        dispatchListeners[i],\n        dispatchInstances[i]\n      );\n    }\n  } else if (dispatchListeners) {\n    executeDispatch(event, simulated, dispatchListeners, dispatchInstances);\n  }\n  event._dispatchListeners = null;\n  event._dispatchInstances = null;\n}\n\n/**\n * Standard/simple iteration through an event's collected dispatches, but stops\n * at the first dispatch execution returning true, and returns that id.\n *\n * @return {?string} id of the first dispatch execution who's listener returns\n * true, or null if no listener returned true.\n */\nfunction executeDispatchesInOrderStopAtTrueImpl(event) {\n  var dispatchListeners = event._dispatchListeners;\n  var dispatchInstances = event._dispatchInstances;\n  {\n    validateEventDispatches(event);\n  }\n  if (Array.isArray(dispatchListeners)) {\n    for (var i = 0; i < dispatchListeners.length; i++) {\n      if (event.isPropagationStopped()) {\n        break;\n      }\n      // Listeners and Instances are two parallel arrays that are always in sync.\n      if (dispatchListeners[i](event, dispatchInstances[i])) {\n        return dispatchInstances[i];\n      }\n    }\n  } else if (dispatchListeners) {\n    if (dispatchListeners(event, dispatchInstances)) {\n      return dispatchInstances;\n    }\n  }\n  return null;\n}\n\n/**\n * @see executeDispatchesInOrderStopAtTrueImpl\n */\nfunction executeDispatchesInOrderStopAtTrue(event) {\n  var ret = executeDispatchesInOrderStopAtTrueImpl(event);\n  event._dispatchInstances = null;\n  event._dispatchListeners = null;\n  return ret;\n}\n\n/**\n * Execution of a \"direct\" dispatch - there must be at most one dispatch\n * accumulated on the event or it is considered an error. It doesn't really make\n * sense for an event with multiple dispatches (bubbled) to keep track of the\n * return values at each dispatch execution, but it does tend to make sense when\n * dealing with \"direct\" dispatches.\n *\n * @return {*} The return value of executing the single dispatch.\n */\nfunction executeDirectDispatch(event) {\n  {\n    validateEventDispatches(event);\n  }\n  var dispatchListener = event._dispatchListeners;\n  var dispatchInstance = event._dispatchInstances;\n  invariant(\n    !Array.isArray(dispatchListener),\n    \"executeDirectDispatch(...): Invalid `event`.\"\n  );\n  event.currentTarget = dispatchListener\n    ? getNodeFromInstance(dispatchInstance)\n    : null;\n  var res = dispatchListener ? dispatchListener(event) : null;\n  event.currentTarget = null;\n  event._dispatchListeners = null;\n  event._dispatchInstances = null;\n  return res;\n}\n\n/**\n * @param {SyntheticEvent} event\n * @return {boolean} True iff number of dispatches accumulated is greater than 0.\n */\nfunction hasDispatches(event) {\n  return !!event._dispatchListeners;\n}\n\n/**\n * Accumulates items that must not be null or undefined into the first one. This\n * is used to conserve memory by avoiding array allocations, and thus sacrifices\n * API cleanness. Since `current` can be null before being passed in and not\n * null after this function, make sure to assign it back to `current`:\n *\n * `a = accumulateInto(a, b);`\n *\n * This API should be sparingly used. Try `accumulate` for something cleaner.\n *\n * @return {*|array<*>} An accumulation of items.\n */\n\nfunction accumulateInto(current, next) {\n  invariant(\n    next != null,\n    \"accumulateInto(...): Accumulated items must not be null or undefined.\"\n  );\n\n  if (current == null) {\n    return next;\n  }\n\n  // Both are not empty. Warning: Never call x.concat(y) when you are not\n  // certain that x is an Array (x could be a string with concat method).\n  if (Array.isArray(current)) {\n    if (Array.isArray(next)) {\n      current.push.apply(current, next);\n      return current;\n    }\n    current.push(next);\n    return current;\n  }\n\n  if (Array.isArray(next)) {\n    // A bit too dangerous to mutate `next`.\n    return [current].concat(next);\n  }\n\n  return [current, next];\n}\n\n/**\n * @param {array} arr an \"accumulation\" of items which is either an Array or\n * a single item. Useful when paired with the `accumulate` module. This is a\n * simple utility that allows us to reason about a collection of items, but\n * handling the case when there is exactly one item (and we do not need to\n * allocate an array).\n * @param {function} cb Callback invoked with each element or a collection.\n * @param {?} [scope] Scope used as `this` in a callback.\n */\nfunction forEachAccumulated(arr, cb, scope) {\n  if (Array.isArray(arr)) {\n    arr.forEach(cb, scope);\n  } else if (arr) {\n    cb.call(scope, arr);\n  }\n}\n\n/**\n * Internal queue of events that have accumulated their dispatches and are\n * waiting to have their dispatches executed.\n */\nvar eventQueue = null;\n\n/**\n * Dispatches an event and releases it back into the pool, unless persistent.\n *\n * @param {?object} event Synthetic event to be dispatched.\n * @param {boolean} simulated If the event is simulated (changes exn behavior)\n * @private\n */\nvar executeDispatchesAndRelease = function(event, simulated) {\n  if (event) {\n    executeDispatchesInOrder(event, simulated);\n\n    if (!event.isPersistent()) {\n      event.constructor.release(event);\n    }\n  }\n};\nvar executeDispatchesAndReleaseSimulated = function(e) {\n  return executeDispatchesAndRelease(e, true);\n};\nvar executeDispatchesAndReleaseTopLevel = function(e) {\n  return executeDispatchesAndRelease(e, false);\n};\n\nfunction isInteractive(tag) {\n  return (\n    tag === \"button\" ||\n    tag === \"input\" ||\n    tag === \"select\" ||\n    tag === \"textarea\"\n  );\n}\n\nfunction shouldPreventMouseEvent(name, type, props) {\n  switch (name) {\n    case \"onClick\":\n    case \"onClickCapture\":\n    case \"onDoubleClick\":\n    case \"onDoubleClickCapture\":\n    case \"onMouseDown\":\n    case \"onMouseDownCapture\":\n    case \"onMouseMove\":\n    case \"onMouseMoveCapture\":\n    case \"onMouseUp\":\n    case \"onMouseUpCapture\":\n      return !!(props.disabled && isInteractive(type));\n    default:\n      return false;\n  }\n}\n\n/**\n * This is a unified interface for event plugins to be installed and configured.\n *\n * Event plugins can implement the following properties:\n *\n *   `extractEvents` {function(string, DOMEventTarget, string, object): *}\n *     Required. When a top-level event is fired, this method is expected to\n *     extract synthetic events that will in turn be queued and dispatched.\n *\n *   `eventTypes` {object}\n *     Optional, plugins that fire events must publish a mapping of registration\n *     names that are used to register listeners. Values of this mapping must\n *     be objects that contain `registrationName` or `phasedRegistrationNames`.\n *\n *   `executeDispatch` {function(object, function, string)}\n *     Optional, allows plugins to override how an event gets dispatched. By\n *     default, the listener is simply invoked.\n *\n * Each plugin that is injected into `EventsPluginHub` is immediately operable.\n *\n * @public\n */\n\n/**\n * Methods for injecting dependencies.\n */\nvar injection = {\n  /**\n   * @param {array} InjectedEventPluginOrder\n   * @public\n   */\n  injectEventPluginOrder: injectEventPluginOrder,\n\n  /**\n   * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n   */\n  injectEventPluginsByName: injectEventPluginsByName\n};\n\n/**\n * @param {object} inst The instance, which is the source of events.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @return {?function} The stored callback.\n */\nfunction getListener(inst, registrationName) {\n  var listener;\n\n  // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not\n  // live here; needs to be moved to a better place soon\n  var stateNode = inst.stateNode;\n  if (!stateNode) {\n    // Work in progress (ex: onload events in incremental mode).\n    return null;\n  }\n  var props = getFiberCurrentPropsFromNode(stateNode);\n  if (!props) {\n    // Work in progress.\n    return null;\n  }\n  listener = props[registrationName];\n  if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\n    return null;\n  }\n  invariant(\n    !listener || typeof listener === \"function\",\n    \"Expected `%s` listener to be a function, instead got a value of `%s` type.\",\n    registrationName,\n    typeof listener\n  );\n  return listener;\n}\n\n/**\n * Allows registered plugins an opportunity to extract events from top-level\n * native browser events.\n *\n * @return {*} An accumulation of synthetic events.\n * @internal\n */\nfunction extractEvents(\n  topLevelType,\n  targetInst,\n  nativeEvent,\n  nativeEventTarget\n) {\n  var events;\n  for (var i = 0; i < plugins.length; i++) {\n    // Not every plugin in the ordering may be loaded at runtime.\n    var possiblePlugin = plugins[i];\n    if (possiblePlugin) {\n      var extractedEvents = possiblePlugin.extractEvents(\n        topLevelType,\n        targetInst,\n        nativeEvent,\n        nativeEventTarget\n      );\n      if (extractedEvents) {\n        events = accumulateInto(events, extractedEvents);\n      }\n    }\n  }\n  return events;\n}\n\n/**\n * Enqueues a synthetic event that should be dispatched when\n * `processEventQueue` is invoked.\n *\n * @param {*} events An accumulation of synthetic events.\n * @internal\n */\nfunction enqueueEvents(events) {\n  if (events) {\n    eventQueue = accumulateInto(eventQueue, events);\n  }\n}\n\n/**\n * Dispatches all synthetic events on the event queue.\n *\n * @internal\n */\nfunction processEventQueue(simulated) {\n  // Set `eventQueue` to null before processing it so that we can tell if more\n  // events get enqueued while processing.\n  var processingEventQueue = eventQueue;\n  eventQueue = null;\n\n  if (!processingEventQueue) {\n    return;\n  }\n\n  if (simulated) {\n    forEachAccumulated(\n      processingEventQueue,\n      executeDispatchesAndReleaseSimulated\n    );\n  } else {\n    forEachAccumulated(\n      processingEventQueue,\n      executeDispatchesAndReleaseTopLevel\n    );\n  }\n  invariant(\n    !eventQueue,\n    \"processEventQueue(): Additional events were enqueued while processing \" +\n      \"an event queue. Support for this has not yet been implemented.\"\n  );\n  // This would be a good time to rethrow if any of the event handlers threw.\n  ReactErrorUtils.rethrowCaughtError();\n}\n\nvar IndeterminateComponent = 0; // Before we know whether it is functional or class\nvar FunctionalComponent = 1;\nvar ClassComponent = 2;\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\nvar HostComponent = 5;\nvar HostText = 6;\nvar CallComponent = 7;\nvar CallHandlerPhase = 8;\nvar ReturnComponent = 9;\nvar Fragment = 10;\n\nfunction getParent(inst) {\n  do {\n    inst = inst[\"return\"];\n    // TODO: If this is a HostRoot we might want to bail out.\n    // That is depending on if we want nested subtrees (layers) to bubble\n    // events to their parent. We could also go through parentNode on the\n    // host node but that wouldn't work for React Native and doesn't let us\n    // do the portal feature.\n  } while (inst && inst.tag !== HostComponent);\n  if (inst) {\n    return inst;\n  }\n  return null;\n}\n\n/**\n * Return the lowest common ancestor of A and B, or null if they are in\n * different trees.\n */\nfunction getLowestCommonAncestor(instA, instB) {\n  var depthA = 0;\n  for (var tempA = instA; tempA; tempA = getParent(tempA)) {\n    depthA++;\n  }\n  var depthB = 0;\n  for (var tempB = instB; tempB; tempB = getParent(tempB)) {\n    depthB++;\n  }\n\n  // If A is deeper, crawl up.\n  while (depthA - depthB > 0) {\n    instA = getParent(instA);\n    depthA--;\n  }\n\n  // If B is deeper, crawl up.\n  while (depthB - depthA > 0) {\n    instB = getParent(instB);\n    depthB--;\n  }\n\n  // Walk in lockstep until we find a match.\n  var depth = depthA;\n  while (depth--) {\n    if (instA === instB || instA === instB.alternate) {\n      return instA;\n    }\n    instA = getParent(instA);\n    instB = getParent(instB);\n  }\n  return null;\n}\n\n/**\n * Return if A is an ancestor of B.\n */\nfunction isAncestor(instA, instB) {\n  while (instB) {\n    if (instA === instB || instA === instB.alternate) {\n      return true;\n    }\n    instB = getParent(instB);\n  }\n  return false;\n}\n\n/**\n * Return the parent instance of the passed-in instance.\n */\nfunction getParentInstance(inst) {\n  return getParent(inst);\n}\n\n/**\n * Simulates the traversal of a two-phase, capture/bubble event dispatch.\n */\nfunction traverseTwoPhase(inst, fn, arg) {\n  var path = [];\n  while (inst) {\n    path.push(inst);\n    inst = getParent(inst);\n  }\n  var i;\n  for (i = path.length; i-- > 0; ) {\n    fn(path[i], \"captured\", arg);\n  }\n  for (i = 0; i < path.length; i++) {\n    fn(path[i], \"bubbled\", arg);\n  }\n}\n\n/**\n * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that\n * should would receive a `mouseEnter` or `mouseLeave` event.\n *\n * Does not invoke the callback on the nearest common ancestor because nothing\n * \"entered\" or \"left\" that element.\n */\n\n/**\n * Some event types have a notion of different registration names for different\n * \"phases\" of propagation. This finds listeners by a given phase.\n */\nfunction listenerAtPhase(inst, event, propagationPhase) {\n  var registrationName =\n    event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n  return getListener(inst, registrationName);\n}\n\n/**\n * A small set of propagation patterns, each of which will accept a small amount\n * of information, and generate a set of \"dispatch ready event objects\" - which\n * are sets of events that have already been annotated with a set of dispatched\n * listener functions/ids. The API is designed this way to discourage these\n * propagation strategies from actually executing the dispatches, since we\n * always want to collect the entire set of dispatches before executing even a\n * single one.\n */\n\n/**\n * Tags a `SyntheticEvent` with dispatched listeners. Creating this function\n * here, allows us to not have to bind or create functions for each event.\n * Mutating the event's members allows us to not have to create a wrapping\n * \"dispatch\" object that pairs the event with the listener.\n */\nfunction accumulateDirectionalDispatches(inst, phase, event) {\n  {\n    warning(inst, \"Dispatching inst must not be null\");\n  }\n  var listener = listenerAtPhase(inst, event, phase);\n  if (listener) {\n    event._dispatchListeners = accumulateInto(\n      event._dispatchListeners,\n      listener\n    );\n    event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n  }\n}\n\n/**\n * Collect dispatches (must be entirely collected before dispatching - see unit\n * tests). Lazily allocate the array to conserve memory.  We must loop through\n * each event and perform the traversal for each one. We cannot perform a\n * single traversal for the entire collection of events because each event may\n * have a different target.\n */\nfunction accumulateTwoPhaseDispatchesSingle(event) {\n  if (event && event.dispatchConfig.phasedRegistrationNames) {\n    traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n  }\n}\n\n/**\n * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.\n */\nfunction accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n  if (event && event.dispatchConfig.phasedRegistrationNames) {\n    var targetInst = event._targetInst;\n    var parentInst = targetInst ? getParentInstance(targetInst) : null;\n    traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n  }\n}\n\n/**\n * Accumulates without regard to direction, does not look for phased\n * registration names. Same as `accumulateDirectDispatchesSingle` but without\n * requiring that the `dispatchMarker` be the same as the dispatched ID.\n */\nfunction accumulateDispatches(inst, ignoredDirection, event) {\n  if (inst && event && event.dispatchConfig.registrationName) {\n    var registrationName = event.dispatchConfig.registrationName;\n    var listener = getListener(inst, registrationName);\n    if (listener) {\n      event._dispatchListeners = accumulateInto(\n        event._dispatchListeners,\n        listener\n      );\n      event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n    }\n  }\n}\n\n/**\n * Accumulates dispatches on an `SyntheticEvent`, but only for the\n * `dispatchMarker`.\n * @param {SyntheticEvent} event\n */\nfunction accumulateDirectDispatchesSingle(event) {\n  if (event && event.dispatchConfig.registrationName) {\n    accumulateDispatches(event._targetInst, null, event);\n  }\n}\n\nfunction accumulateTwoPhaseDispatches(events) {\n  forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);\n}\n\nfunction accumulateTwoPhaseDispatchesSkipTarget(events) {\n  forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);\n}\n\nfunction accumulateDirectDispatches(events) {\n  forEachAccumulated(events, accumulateDirectDispatchesSingle);\n}\n\n/* eslint valid-typeof: 0 */\n\nvar didWarnForAddedNewProperty = false;\nvar isProxySupported = typeof Proxy === \"function\";\nvar EVENT_POOL_SIZE = 10;\n\nvar shouldBeReleasedProperties = [\n  \"dispatchConfig\",\n  \"_targetInst\",\n  \"nativeEvent\",\n  \"isDefaultPrevented\",\n  \"isPropagationStopped\",\n  \"_dispatchListeners\",\n  \"_dispatchInstances\"\n];\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar EventInterface = {\n  type: null,\n  target: null,\n  // currentTarget is set when dispatching; no use in copying it here\n  currentTarget: emptyFunction.thatReturnsNull,\n  eventPhase: null,\n  bubbles: null,\n  cancelable: null,\n  timeStamp: function(event) {\n    return event.timeStamp || Date.now();\n  },\n  defaultPrevented: null,\n  isTrusted: null\n};\n\n/**\n * Synthetic events are dispatched by event plugins, typically in response to a\n * top-level event delegation handler.\n *\n * These systems should generally use pooling to reduce the frequency of garbage\n * collection. The system should check `isPersistent` to determine whether the\n * event should be released into the pool after being dispatched. Users that\n * need a persisted event should invoke `persist`.\n *\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\n * DOM interface; custom application-specific events can also subclass this.\n *\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {*} targetInst Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @param {DOMEventTarget} nativeEventTarget Target node.\n */\nfunction SyntheticEvent(\n  dispatchConfig,\n  targetInst,\n  nativeEvent,\n  nativeEventTarget\n) {\n  {\n    // these have a getter/setter for warnings\n    delete this.nativeEvent;\n    delete this.preventDefault;\n    delete this.stopPropagation;\n  }\n\n  this.dispatchConfig = dispatchConfig;\n  this._targetInst = targetInst;\n  this.nativeEvent = nativeEvent;\n\n  var Interface = this.constructor.Interface;\n  for (var propName in Interface) {\n    if (!Interface.hasOwnProperty(propName)) {\n      continue;\n    }\n    {\n      delete this[propName]; // this has a getter/setter for warnings\n    }\n    var normalize = Interface[propName];\n    if (normalize) {\n      this[propName] = normalize(nativeEvent);\n    } else {\n      if (propName === \"target\") {\n        this.target = nativeEventTarget;\n      } else {\n        this[propName] = nativeEvent[propName];\n      }\n    }\n  }\n\n  var defaultPrevented =\n    nativeEvent.defaultPrevented != null\n      ? nativeEvent.defaultPrevented\n      : nativeEvent.returnValue === false;\n  if (defaultPrevented) {\n    this.isDefaultPrevented = emptyFunction.thatReturnsTrue;\n  } else {\n    this.isDefaultPrevented = emptyFunction.thatReturnsFalse;\n  }\n  this.isPropagationStopped = emptyFunction.thatReturnsFalse;\n  return this;\n}\n\nObject.assign(SyntheticEvent.prototype, {\n  preventDefault: function() {\n    this.defaultPrevented = true;\n    var event = this.nativeEvent;\n    if (!event) {\n      return;\n    }\n\n    if (event.preventDefault) {\n      event.preventDefault();\n    } else if (typeof event.returnValue !== \"unknown\") {\n      event.returnValue = false;\n    }\n    this.isDefaultPrevented = emptyFunction.thatReturnsTrue;\n  },\n\n  stopPropagation: function() {\n    var event = this.nativeEvent;\n    if (!event) {\n      return;\n    }\n\n    if (event.stopPropagation) {\n      event.stopPropagation();\n    } else if (typeof event.cancelBubble !== \"unknown\") {\n      // The ChangeEventPlugin registers a \"propertychange\" event for\n      // IE. This event does not support bubbling or cancelling, and\n      // any references to cancelBubble throw \"Member not found\".  A\n      // typeof check of \"unknown\" circumvents this issue (and is also\n      // IE specific).\n      event.cancelBubble = true;\n    }\n\n    this.isPropagationStopped = emptyFunction.thatReturnsTrue;\n  },\n\n  /**\n   * We release all dispatched `SyntheticEvent`s after each event loop, adding\n   * them back into the pool. This allows a way to hold onto a reference that\n   * won't be added back into the pool.\n   */\n  persist: function() {\n    this.isPersistent = emptyFunction.thatReturnsTrue;\n  },\n\n  /**\n   * Checks if this event should be released back into the pool.\n   *\n   * @return {boolean} True if this should not be released, false otherwise.\n   */\n  isPersistent: emptyFunction.thatReturnsFalse,\n\n  /**\n   * `PooledClass` looks for `destructor` on each instance it releases.\n   */\n  destructor: function() {\n    var Interface = this.constructor.Interface;\n    for (var propName in Interface) {\n      {\n        Object.defineProperty(\n          this,\n          propName,\n          getPooledWarningPropertyDefinition(propName, Interface[propName])\n        );\n      }\n    }\n    for (var i = 0; i < shouldBeReleasedProperties.length; i++) {\n      this[shouldBeReleasedProperties[i]] = null;\n    }\n    {\n      Object.defineProperty(\n        this,\n        \"nativeEvent\",\n        getPooledWarningPropertyDefinition(\"nativeEvent\", null)\n      );\n      Object.defineProperty(\n        this,\n        \"preventDefault\",\n        getPooledWarningPropertyDefinition(\"preventDefault\", emptyFunction)\n      );\n      Object.defineProperty(\n        this,\n        \"stopPropagation\",\n        getPooledWarningPropertyDefinition(\"stopPropagation\", emptyFunction)\n      );\n    }\n  }\n});\n\nSyntheticEvent.Interface = EventInterface;\n\n/**\n * Helper to reduce boilerplate when creating subclasses.\n *\n * @param {function} Class\n * @param {?object} Interface\n */\nSyntheticEvent.augmentClass = function(Class, Interface) {\n  var Super = this;\n\n  var E = function() {};\n  E.prototype = Super.prototype;\n  var prototype = new E();\n\n  Object.assign(prototype, Class.prototype);\n  Class.prototype = prototype;\n  Class.prototype.constructor = Class;\n\n  Class.Interface = Object.assign({}, Super.Interface, Interface);\n  Class.augmentClass = Super.augmentClass;\n  addEventPoolingTo(Class);\n};\n\n/** Proxying after everything set on SyntheticEvent\n * to resolve Proxy issue on some WebKit browsers\n * in which some Event properties are set to undefined (GH#10010)\n */\n{\n  if (isProxySupported) {\n    /*eslint-disable no-func-assign */\n    SyntheticEvent = new Proxy(SyntheticEvent, {\n      construct: function(target, args) {\n        return this.apply(target, Object.create(target.prototype), args);\n      },\n      apply: function(constructor, that, args) {\n        return new Proxy(constructor.apply(that, args), {\n          set: function(target, prop, value) {\n            if (\n              prop !== \"isPersistent\" &&\n              !target.constructor.Interface.hasOwnProperty(prop) &&\n              shouldBeReleasedProperties.indexOf(prop) === -1\n            ) {\n              warning(\n                didWarnForAddedNewProperty || target.isPersistent(),\n                \"This synthetic event is reused for performance reasons. If you're \" +\n                  \"seeing this, you're adding a new property in the synthetic event object. \" +\n                  \"The property is never released. See \" +\n                  \"https://fb.me/react-event-pooling for more information.\"\n              );\n              didWarnForAddedNewProperty = true;\n            }\n            target[prop] = value;\n            return true;\n          }\n        });\n      }\n    });\n    /*eslint-enable no-func-assign */\n  }\n}\n\naddEventPoolingTo(SyntheticEvent);\n\n/**\n * Helper to nullify syntheticEvent instance properties when destructing\n *\n * @param {String} propName\n * @param {?object} getVal\n * @return {object} defineProperty object\n */\nfunction getPooledWarningPropertyDefinition(propName, getVal) {\n  var isFunction = typeof getVal === \"function\";\n  return {\n    configurable: true,\n    set: set,\n    get: get\n  };\n\n  function set(val) {\n    var action = isFunction ? \"setting the method\" : \"setting the property\";\n    warn(action, \"This is effectively a no-op\");\n    return val;\n  }\n\n  function get() {\n    var action = isFunction ? \"accessing the method\" : \"accessing the property\";\n    var result = isFunction\n      ? \"This is a no-op function\"\n      : \"This is set to null\";\n    warn(action, result);\n    return getVal;\n  }\n\n  function warn(action, result) {\n    var warningCondition = false;\n    warning(\n      warningCondition,\n      \"This synthetic event is reused for performance reasons. If you're seeing this, \" +\n        \"you're %s `%s` on a released/nullified synthetic event. %s. \" +\n        \"If you must keep the original synthetic event around, use event.persist(). \" +\n        \"See https://fb.me/react-event-pooling for more information.\",\n      action,\n      propName,\n      result\n    );\n  }\n}\n\nfunction getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {\n  var EventConstructor = this;\n  if (EventConstructor.eventPool.length) {\n    var instance = EventConstructor.eventPool.pop();\n    EventConstructor.call(\n      instance,\n      dispatchConfig,\n      targetInst,\n      nativeEvent,\n      nativeInst\n    );\n    return instance;\n  }\n  return new EventConstructor(\n    dispatchConfig,\n    targetInst,\n    nativeEvent,\n    nativeInst\n  );\n}\n\nfunction releasePooledEvent(event) {\n  var EventConstructor = this;\n  invariant(\n    event instanceof EventConstructor,\n    \"Trying to release an event instance  into a pool of a different type.\"\n  );\n  event.destructor();\n  if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {\n    EventConstructor.eventPool.push(event);\n  }\n}\n\nfunction addEventPoolingTo(EventConstructor) {\n  EventConstructor.eventPool = [];\n  EventConstructor.getPooled = getPooledEvent;\n  EventConstructor.release = releasePooledEvent;\n}\n\nvar SyntheticEvent$1 = SyntheticEvent;\n\n/**\n * `touchHistory` isn't actually on the native event, but putting it in the\n * interface will ensure that it is cleaned up when pooled/destroyed. The\n * `ResponderEventPlugin` will populate it appropriately.\n */\nvar ResponderEventInterface = {\n  touchHistory: function(nativeEvent) {\n    return null; // Actually doesn't even look at the native event.\n  }\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native event.\n * @extends {SyntheticEvent}\n */\nfunction ResponderSyntheticEvent(\n  dispatchConfig,\n  dispatchMarker,\n  nativeEvent,\n  nativeEventTarget\n) {\n  return SyntheticEvent$1.call(\n    this,\n    dispatchConfig,\n    dispatchMarker,\n    nativeEvent,\n    nativeEventTarget\n  );\n}\n\nSyntheticEvent$1.augmentClass(ResponderSyntheticEvent, ResponderEventInterface);\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\nvar MAX_TOUCH_BANK = 20;\nvar touchBank = [];\nvar touchHistory = {\n  touchBank: touchBank,\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\nfunction timestampForTouch(touch) {\n  // The legacy internal implementation provides \"timeStamp\", which has been\n  // renamed to \"timestamp\". Let both work for now while we iron it out\n  // TODO (evv): rename timeStamp to timestamp in internal code\n  return touch.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) {\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, touch) {\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(_ref) {\n  var identifier = _ref.identifier;\n\n  invariant(identifier != null, \"Touch object is missing identifier.\");\n  {\n    warning(\n      identifier <= MAX_TOUCH_BANK,\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  return identifier;\n}\n\nfunction recordTouchStart(touch) {\n  var identifier = getTouchIdentifier(touch);\n  var touchRecord = touchBank[identifier];\n  if (touchRecord) {\n    resetTouchRecord(touchRecord, touch);\n  } else {\n    touchBank[identifier] = createTouchRecord(touch);\n  }\n  touchHistory.mostRecentTimeStamp = timestampForTouch(touch);\n}\n\nfunction recordTouchMove(touch) {\n  var touchRecord = 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.error(\n      \"Cannot record touch move without a touch start.\\n\" + \"Touch Move: %s\\n\",\n      \"Touch Bank: %s\",\n      printTouch(touch),\n      printTouchBank()\n    );\n  }\n}\n\nfunction recordTouchEnd(touch) {\n  var touchRecord = 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.error(\n      \"Cannot record touch end without a touch start.\\n\" + \"Touch End: %s\\n\",\n      \"Touch Bank: %s\",\n      printTouch(touch),\n      printTouchBank()\n    );\n  }\n}\n\nfunction printTouch(touch) {\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() {\n  var 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\nvar ResponderTouchHistoryStore = {\n  recordTouchTrack: function(topLevelType, nativeEvent) {\n    if (isMoveish(topLevelType)) {\n      nativeEvent.changedTouches.forEach(recordTouchMove);\n    } else if (isStartish(topLevelType)) {\n      nativeEvent.changedTouches.forEach(recordTouchStart);\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(recordTouchEnd);\n      touchHistory.numberActiveTouches = nativeEvent.touches.length;\n      if (touchHistory.numberActiveTouches === 1) {\n        for (var i = 0; i < touchBank.length; i++) {\n          var touchTrackToCheck = touchBank[i];\n          if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {\n            touchHistory.indexOfSingleActiveTouch = i;\n            break;\n          }\n        }\n        {\n          var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch];\n          warning(\n            activeRecord != null && activeRecord.touchActive,\n            \"Cannot find single active touch.\"\n          );\n        }\n      }\n    }\n  },\n\n  touchHistory: touchHistory\n};\n\n/**\n * Accumulates items that must not be null or undefined.\n *\n * This is used to conserve memory by avoiding array allocations.\n *\n * @return {*|array<*>} An accumulation of items.\n */\nfunction accumulate(current, next) {\n  invariant(\n    next != null,\n    \"accumulate(...): Accumulated items must be not be null or undefined.\"\n  );\n\n  if (current == null) {\n    return next;\n  }\n\n  // Both are not empty. Warning: Never call x.concat(y) when you are not\n  // certain that x is an Array (x could be a string with concat method).\n  if (Array.isArray(current)) {\n    return current.concat(next);\n  }\n\n  if (Array.isArray(next)) {\n    return [current].concat(next);\n  }\n\n  return [current, next];\n}\n\n/**\n * Instance of element that should respond to touch/move types of interactions,\n * as indicated explicitly by relevant callbacks.\n */\nvar responderInst = null;\n\n/**\n * Count of current touches. A textInput should become responder iff the\n * selection changes while there is a touch on the screen.\n */\nvar trackedTouchCount = 0;\n\n/**\n * Last reported number of active touches.\n */\nvar previousActiveTouches = 0;\n\nvar changeResponder = function(nextResponderInst, blockHostResponder) {\n  var oldResponderInst = responderInst;\n  responderInst = nextResponderInst;\n  if (ResponderEventPlugin.GlobalResponderHandler !== null) {\n    ResponderEventPlugin.GlobalResponderHandler.onChange(\n      oldResponderInst,\n      nextResponderInst,\n      blockHostResponder\n    );\n  }\n};\n\nvar eventTypes = {\n  /**\n   * On a `touchStart`/`mouseDown`, is it desired that this element become the\n   * responder?\n   */\n  startShouldSetResponder: {\n    phasedRegistrationNames: {\n      bubbled: \"onStartShouldSetResponder\",\n      captured: \"onStartShouldSetResponderCapture\"\n    }\n  },\n\n  /**\n   * On a `scroll`, is it desired that this element become the responder? This\n   * is usually not needed, but should be used to retroactively infer that a\n   * `touchStart` had occurred during momentum scroll. During a momentum scroll,\n   * a touch start will be immediately followed by a scroll event if the view is\n   * currently scrolling.\n   *\n   * TODO: This shouldn't bubble.\n   */\n  scrollShouldSetResponder: {\n    phasedRegistrationNames: {\n      bubbled: \"onScrollShouldSetResponder\",\n      captured: \"onScrollShouldSetResponderCapture\"\n    }\n  },\n\n  /**\n   * On text selection change, should this element become the responder? This\n   * is needed for text inputs or other views with native selection, so the\n   * JS view can claim the responder.\n   *\n   * TODO: This shouldn't bubble.\n   */\n  selectionChangeShouldSetResponder: {\n    phasedRegistrationNames: {\n      bubbled: \"onSelectionChangeShouldSetResponder\",\n      captured: \"onSelectionChangeShouldSetResponderCapture\"\n    }\n  },\n\n  /**\n   * On a `touchMove`/`mouseMove`, is it desired that this element become the\n   * responder?\n   */\n  moveShouldSetResponder: {\n    phasedRegistrationNames: {\n      bubbled: \"onMoveShouldSetResponder\",\n      captured: \"onMoveShouldSetResponderCapture\"\n    }\n  },\n\n  /**\n   * Direct responder events dispatched directly to responder. Do not bubble.\n   */\n  responderStart: { registrationName: \"onResponderStart\" },\n  responderMove: { registrationName: \"onResponderMove\" },\n  responderEnd: { registrationName: \"onResponderEnd\" },\n  responderRelease: { registrationName: \"onResponderRelease\" },\n  responderTerminationRequest: {\n    registrationName: \"onResponderTerminationRequest\"\n  },\n  responderGrant: { registrationName: \"onResponderGrant\" },\n  responderReject: { registrationName: \"onResponderReject\" },\n  responderTerminate: { registrationName: \"onResponderTerminate\" }\n};\n\n/**\n *\n * Responder System:\n * ----------------\n *\n * - A global, solitary \"interaction lock\" on a view.\n * - If a node becomes the responder, it should convey visual feedback\n *   immediately to indicate so, either by highlighting or moving accordingly.\n * - To be the responder means, that touches are exclusively important to that\n *   responder view, and no other view.\n * - While touches are still occurring, the responder lock can be transferred to\n *   a new view, but only to increasingly \"higher\" views (meaning ancestors of\n *   the current responder).\n *\n * Responder being granted:\n * ------------------------\n *\n * - Touch starts, moves, and scrolls can cause an ID to become the responder.\n * - We capture/bubble `startShouldSetResponder`/`moveShouldSetResponder` to\n *   the \"appropriate place\".\n * - If nothing is currently the responder, the \"appropriate place\" is the\n *   initiating event's `targetID`.\n * - If something *is* already the responder, the \"appropriate place\" is the\n *   first common ancestor of the event target and the current `responderInst`.\n * - Some negotiation happens: See the timing diagram below.\n * - Scrolled views automatically become responder. The reasoning is that a\n *   platform scroll view that isn't built on top of the responder system has\n *   began scrolling, and the active responder must now be notified that the\n *   interaction is no longer locked to it - the system has taken over.\n *\n * - Responder being released:\n *   As soon as no more touches that *started* inside of descendants of the\n *   *current* responderInst, an `onResponderRelease` event is dispatched to the\n *   current responder, and the responder lock is released.\n *\n * TODO:\n * - on \"end\", a callback hook for `onResponderEndShouldRemainResponder` that\n *   determines if the responder lock should remain.\n * - If a view shouldn't \"remain\" the responder, any active touches should by\n *   default be considered \"dead\" and do not influence future negotiations or\n *   bubble paths. It should be as if those touches do not exist.\n * -- For multitouch: Usually a translate-z will choose to \"remain\" responder\n *  after one out of many touches ended. For translate-y, usually the view\n *  doesn't wish to \"remain\" responder after one of many touches end.\n * - Consider building this on top of a `stopPropagation` model similar to\n *   `W3C` events.\n * - Ensure that `onResponderTerminate` is called on touch cancels, whether or\n *   not `onResponderTerminationRequest` returns `true` or `false`.\n *\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 +-------->|onResponderRejec|\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\n/**\n * A note about event ordering in the `EventPluginHub`.\n *\n * Suppose plugins are injected in the following order:\n *\n * `[R, S, C]`\n *\n * To help illustrate the example, assume `S` is `SimpleEventPlugin` (for\n * `onClick` etc) and `R` is `ResponderEventPlugin`.\n *\n * \"Deferred-Dispatched Events\":\n *\n * - The current event plugin system will traverse the list of injected plugins,\n *   in order, and extract events by collecting the plugin's return value of\n *   `extractEvents()`.\n * - These events that are returned from `extractEvents` are \"deferred\n *   dispatched events\".\n * - When returned from `extractEvents`, deferred-dispatched events contain an\n *   \"accumulation\" of deferred dispatches.\n * - These deferred dispatches are accumulated/collected before they are\n *   returned, but processed at a later time by the `EventPluginHub` (hence the\n *   name deferred).\n *\n * In the process of returning their deferred-dispatched events, event plugins\n * themselves can dispatch events on-demand without returning them from\n * `extractEvents`. Plugins might want to do this, so that they can use event\n * dispatching as a tool that helps them decide which events should be extracted\n * in the first place.\n *\n * \"On-Demand-Dispatched Events\":\n *\n * - On-demand-dispatched events are not returned from `extractEvents`.\n * - On-demand-dispatched events are dispatched during the process of returning\n *   the deferred-dispatched events.\n * - They should not have side effects.\n * - They should be avoided, and/or eventually be replaced with another\n *   abstraction that allows event plugins to perform multiple \"rounds\" of event\n *   extraction.\n *\n * Therefore, the sequence of event dispatches becomes:\n *\n * - `R`s on-demand events (if any)   (dispatched by `R` on-demand)\n * - `S`s on-demand events (if any)   (dispatched by `S` on-demand)\n * - `C`s on-demand events (if any)   (dispatched by `C` on-demand)\n * - `R`s extracted events (if any)   (dispatched by `EventPluginHub`)\n * - `S`s extracted events (if any)   (dispatched by `EventPluginHub`)\n * - `C`s extracted events (if any)   (dispatched by `EventPluginHub`)\n *\n * In the case of `ResponderEventPlugin`: If the `startShouldSetResponder`\n * on-demand dispatch returns `true` (and some other details are satisfied) the\n * `onResponderGrant` deferred dispatched event is returned from\n * `extractEvents`. The sequence of dispatch executions in this case\n * will appear as follows:\n *\n * - `startShouldSetResponder` (`ResponderEventPlugin` dispatches on-demand)\n * - `touchStartCapture`       (`EventPluginHub` dispatches as usual)\n * - `touchStart`              (`EventPluginHub` dispatches as usual)\n * - `responderGrant/Reject`   (`EventPluginHub` dispatches as usual)\n */\n\nfunction setResponderAndExtractTransfer(\n  topLevelType,\n  targetInst,\n  nativeEvent,\n  nativeEventTarget\n) {\n  var shouldSetEventType = isStartish(topLevelType)\n    ? eventTypes.startShouldSetResponder\n    : isMoveish(topLevelType)\n      ? eventTypes.moveShouldSetResponder\n      : topLevelType === \"topSelectionChange\"\n        ? eventTypes.selectionChangeShouldSetResponder\n        : eventTypes.scrollShouldSetResponder;\n\n  // TODO: stop one short of the current responder.\n  var bubbleShouldSetFrom = !responderInst\n    ? targetInst\n    : getLowestCommonAncestor(responderInst, targetInst);\n\n  // When capturing/bubbling the \"shouldSet\" event, we want to skip the target\n  // (deepest ID) if it happens to be the current responder. The reasoning:\n  // It's strange to get an `onMoveShouldSetResponder` when you're *already*\n  // the responder.\n  var skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst;\n  var shouldSetEvent = ResponderSyntheticEvent.getPooled(\n    shouldSetEventType,\n    bubbleShouldSetFrom,\n    nativeEvent,\n    nativeEventTarget\n  );\n  shouldSetEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;\n  if (skipOverBubbleShouldSetFrom) {\n    accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent);\n  } else {\n    accumulateTwoPhaseDispatches(shouldSetEvent);\n  }\n  var wantsResponderInst = executeDispatchesInOrderStopAtTrue(shouldSetEvent);\n  if (!shouldSetEvent.isPersistent()) {\n    shouldSetEvent.constructor.release(shouldSetEvent);\n  }\n\n  if (!wantsResponderInst || wantsResponderInst === responderInst) {\n    return null;\n  }\n  var extracted;\n  var grantEvent = ResponderSyntheticEvent.getPooled(\n    eventTypes.responderGrant,\n    wantsResponderInst,\n    nativeEvent,\n    nativeEventTarget\n  );\n  grantEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;\n\n  accumulateDirectDispatches(grantEvent);\n  var blockHostResponder = executeDirectDispatch(grantEvent) === true;\n  if (responderInst) {\n    var terminationRequestEvent = ResponderSyntheticEvent.getPooled(\n      eventTypes.responderTerminationRequest,\n      responderInst,\n      nativeEvent,\n      nativeEventTarget\n    );\n    terminationRequestEvent.touchHistory =\n      ResponderTouchHistoryStore.touchHistory;\n    accumulateDirectDispatches(terminationRequestEvent);\n    var shouldSwitch =\n      !hasDispatches(terminationRequestEvent) ||\n      executeDirectDispatch(terminationRequestEvent);\n    if (!terminationRequestEvent.isPersistent()) {\n      terminationRequestEvent.constructor.release(terminationRequestEvent);\n    }\n\n    if (shouldSwitch) {\n      var terminateEvent = ResponderSyntheticEvent.getPooled(\n        eventTypes.responderTerminate,\n        responderInst,\n        nativeEvent,\n        nativeEventTarget\n      );\n      terminateEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;\n      accumulateDirectDispatches(terminateEvent);\n      extracted = accumulate(extracted, [grantEvent, terminateEvent]);\n      changeResponder(wantsResponderInst, blockHostResponder);\n    } else {\n      var rejectEvent = ResponderSyntheticEvent.getPooled(\n        eventTypes.responderReject,\n        wantsResponderInst,\n        nativeEvent,\n        nativeEventTarget\n      );\n      rejectEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;\n      accumulateDirectDispatches(rejectEvent);\n      extracted = accumulate(extracted, rejectEvent);\n    }\n  } else {\n    extracted = accumulate(extracted, grantEvent);\n    changeResponder(wantsResponderInst, blockHostResponder);\n  }\n  return extracted;\n}\n\n/**\n * A transfer is a negotiation between a currently set responder and the next\n * element to claim responder status. Any start event could trigger a transfer\n * of responderInst. Any move event could trigger a transfer.\n *\n * @param {string} topLevelType Record from `BrowserEventConstants`.\n * @return {boolean} True if a transfer of responder could possibly occur.\n */\nfunction canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) {\n  return (\n    topLevelInst &&\n    // responderIgnoreScroll: We are trying to migrate away from specifically\n    // tracking native scroll events here and responderIgnoreScroll indicates we\n    // will send topTouchCancel to handle canceling touch events instead\n    ((topLevelType === \"topScroll\" && !nativeEvent.responderIgnoreScroll) ||\n      (trackedTouchCount > 0 && topLevelType === \"topSelectionChange\") ||\n      isStartish(topLevelType) ||\n      isMoveish(topLevelType))\n  );\n}\n\n/**\n * Returns whether or not this touch end event makes it such that there are no\n * longer any touches that started inside of the current `responderInst`.\n *\n * @param {NativeEvent} nativeEvent Native touch end event.\n * @return {boolean} Whether or not this touch end event ends the responder.\n */\nfunction noResponderTouches(nativeEvent) {\n  var touches = nativeEvent.touches;\n  if (!touches || touches.length === 0) {\n    return true;\n  }\n  for (var i = 0; i < touches.length; i++) {\n    var activeTouch = touches[i];\n    var target = activeTouch.target;\n    if (target !== null && target !== undefined && target !== 0) {\n      // Is the original touch location inside of the current responder?\n      var targetInst = getInstanceFromNode(target);\n      if (isAncestor(responderInst, targetInst)) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n\nvar ResponderEventPlugin = {\n  /* For unit testing only */\n  _getResponder: function() {\n    return responderInst;\n  },\n\n  eventTypes: eventTypes,\n\n  /**\n   * We must be resilient to `targetInst` being `null` on `touchMove` or\n   * `touchEnd`. On certain platforms, this means that a native scroll has\n   * assumed control and the original touch targets are destroyed.\n   */\n  extractEvents: function(\n    topLevelType,\n    targetInst,\n    nativeEvent,\n    nativeEventTarget\n  ) {\n    if (isStartish(topLevelType)) {\n      trackedTouchCount += 1;\n    } else if (isEndish(topLevelType)) {\n      if (trackedTouchCount >= 0) {\n        trackedTouchCount -= 1;\n      } else {\n        console.error(\n          \"Ended a touch event which was not counted in `trackedTouchCount`.\"\n        );\n        return null;\n      }\n    }\n\n    ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent);\n\n    var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent)\n      ? setResponderAndExtractTransfer(\n          topLevelType,\n          targetInst,\n          nativeEvent,\n          nativeEventTarget\n        )\n      : null;\n    // Responder may or may not have transferred on a new touch start/move.\n    // Regardless, whoever is the responder after any potential transfer, we\n    // direct all touch start/move/ends to them in the form of\n    // `onResponderMove/Start/End`. These will be called for *every* additional\n    // finger that move/start/end, dispatched directly to whoever is the\n    // current responder at that moment, until the responder is \"released\".\n    //\n    // These multiple individual change touch events are are always bookended\n    // by `onResponderGrant`, and one of\n    // (`onResponderRelease/onResponderTerminate`).\n    var isResponderTouchStart = responderInst && isStartish(topLevelType);\n    var isResponderTouchMove = responderInst && isMoveish(topLevelType);\n    var isResponderTouchEnd = responderInst && isEndish(topLevelType);\n    var incrementalTouch = isResponderTouchStart\n      ? eventTypes.responderStart\n      : isResponderTouchMove\n        ? eventTypes.responderMove\n        : isResponderTouchEnd ? eventTypes.responderEnd : null;\n\n    if (incrementalTouch) {\n      var gesture = ResponderSyntheticEvent.getPooled(\n        incrementalTouch,\n        responderInst,\n        nativeEvent,\n        nativeEventTarget\n      );\n      gesture.touchHistory = ResponderTouchHistoryStore.touchHistory;\n      accumulateDirectDispatches(gesture);\n      extracted = accumulate(extracted, gesture);\n    }\n\n    var isResponderTerminate =\n      responderInst && topLevelType === \"topTouchCancel\";\n    var isResponderRelease =\n      responderInst &&\n      !isResponderTerminate &&\n      isEndish(topLevelType) &&\n      noResponderTouches(nativeEvent);\n    var finalTouch = isResponderTerminate\n      ? eventTypes.responderTerminate\n      : isResponderRelease ? eventTypes.responderRelease : null;\n    if (finalTouch) {\n      var finalEvent = ResponderSyntheticEvent.getPooled(\n        finalTouch,\n        responderInst,\n        nativeEvent,\n        nativeEventTarget\n      );\n      finalEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;\n      accumulateDirectDispatches(finalEvent);\n      extracted = accumulate(extracted, finalEvent);\n      changeResponder(null);\n    }\n\n    var numberActiveTouches =\n      ResponderTouchHistoryStore.touchHistory.numberActiveTouches;\n    if (\n      ResponderEventPlugin.GlobalInteractionHandler &&\n      numberActiveTouches !== previousActiveTouches\n    ) {\n      ResponderEventPlugin.GlobalInteractionHandler.onChange(\n        numberActiveTouches\n      );\n    }\n    previousActiveTouches = numberActiveTouches;\n\n    return extracted;\n  },\n\n  GlobalResponderHandler: null,\n  GlobalInteractionHandler: null,\n\n  injection: {\n    /**\n     * @param {{onChange: (ReactID, ReactID) => void} GlobalResponderHandler\n     * Object that handles any change in responder. Use this to inject\n     * integration with an existing touch handling system etc.\n     */\n    injectGlobalResponderHandler: function(GlobalResponderHandler) {\n      ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler;\n    },\n\n    /**\n     * @param {{onChange: (numberActiveTouches) => void} GlobalInteractionHandler\n     * Object that handles any change in the number of active touches.\n     */\n    injectGlobalInteractionHandler: function(GlobalInteractionHandler) {\n      ResponderEventPlugin.GlobalInteractionHandler = GlobalInteractionHandler;\n    }\n  }\n};\n\nvar customBubblingEventTypes = {};\nvar customDirectEventTypes = {};\n\nvar ReactNativeBridgeEventPlugin = {\n  eventTypes: {},\n\n  /**\n   * @see {EventPluginHub.extractEvents}\n   */\n  extractEvents: function(\n    topLevelType,\n    targetInst,\n    nativeEvent,\n    nativeEventTarget\n  ) {\n    var bubbleDispatchConfig = customBubblingEventTypes[topLevelType];\n    var directDispatchConfig = customDirectEventTypes[topLevelType];\n    invariant(\n      bubbleDispatchConfig || directDispatchConfig,\n      'Unsupported top level event type \"%s\" dispatched',\n      topLevelType\n    );\n    var event = SyntheticEvent$1.getPooled(\n      bubbleDispatchConfig || directDispatchConfig,\n      targetInst,\n      nativeEvent,\n      nativeEventTarget\n    );\n    if (bubbleDispatchConfig) {\n      accumulateTwoPhaseDispatches(event);\n    } else if (directDispatchConfig) {\n      accumulateDirectDispatches(event);\n    } else {\n      return null;\n    }\n    return event;\n  },\n\n  processEventTypes: function(viewConfig) {\n    var bubblingEventTypes = viewConfig.bubblingEventTypes,\n      directEventTypes = viewConfig.directEventTypes;\n\n    {\n      if (bubblingEventTypes != null && directEventTypes != null) {\n        for (var topLevelType in directEventTypes) {\n          invariant(\n            bubblingEventTypes[topLevelType] == null,\n            \"Event cannot be both direct and bubbling: %s\",\n            topLevelType\n          );\n        }\n      }\n    }\n\n    if (bubblingEventTypes != null) {\n      for (var _topLevelType in bubblingEventTypes) {\n        if (customBubblingEventTypes[_topLevelType] == null) {\n          ReactNativeBridgeEventPlugin.eventTypes[\n            _topLevelType\n          ] = customBubblingEventTypes[_topLevelType] =\n            bubblingEventTypes[_topLevelType];\n        }\n      }\n    }\n\n    if (directEventTypes != null) {\n      for (var _topLevelType2 in directEventTypes) {\n        if (customDirectEventTypes[_topLevelType2] == null) {\n          ReactNativeBridgeEventPlugin.eventTypes[\n            _topLevelType2\n          ] = customDirectEventTypes[_topLevelType2] =\n            directEventTypes[_topLevelType2];\n        }\n      }\n    }\n  }\n};\n\nvar instanceCache = {};\nvar instanceProps = {};\n\nfunction precacheFiberNode(hostInst, tag) {\n  instanceCache[tag] = hostInst;\n}\n\nfunction uncacheFiberNode(tag) {\n  delete instanceCache[tag];\n  delete instanceProps[tag];\n}\n\nfunction getInstanceFromTag(tag) {\n  return instanceCache[tag] || null;\n}\n\nfunction getTagFromInstance(inst) {\n  var tag = inst.stateNode._nativeTag;\n  invariant(tag, \"All native instances should have a tag.\");\n  return tag;\n}\n\nfunction getFiberCurrentPropsFromNode$1(stateNode) {\n  return instanceProps[stateNode._nativeTag] || null;\n}\n\nfunction updateFiberProps(tag, props) {\n  instanceProps[tag] = props;\n}\n\nvar ReactNativeComponentTree = Object.freeze({\n  precacheFiberNode: precacheFiberNode,\n  uncacheFiberNode: uncacheFiberNode,\n  getClosestInstanceFromNode: getInstanceFromTag,\n  getInstanceFromNode: getInstanceFromTag,\n  getNodeFromInstance: getTagFromInstance,\n  getFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode$1,\n  updateFiberProps: updateFiberProps\n});\n\n// Use to restore controlled state after a change event has fired.\n\nvar fiberHostComponent = null;\n\nvar restoreTarget = null;\nvar restoreQueue = null;\n\nfunction restoreStateOfTarget(target) {\n  // We perform this translation at the end of the event loop so that we\n  // always receive the correct fiber here\n  var internalInstance = getInstanceFromNode(target);\n  if (!internalInstance) {\n    // Unmounted\n    return;\n  }\n  invariant(\n    fiberHostComponent &&\n      typeof fiberHostComponent.restoreControlledState === \"function\",\n    \"Fiber needs to be injected to handle a fiber target for controlled \" +\n      \"events. This error is likely caused by a bug in React. Please file an issue.\"\n  );\n  var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);\n  fiberHostComponent.restoreControlledState(\n    internalInstance.stateNode,\n    internalInstance.type,\n    props\n  );\n}\n\nfunction restoreStateIfNeeded() {\n  if (!restoreTarget) {\n    return;\n  }\n  var target = restoreTarget;\n  var queuedTargets = restoreQueue;\n  restoreTarget = null;\n  restoreQueue = null;\n\n  restoreStateOfTarget(target);\n  if (queuedTargets) {\n    for (var i = 0; i < queuedTargets.length; i++) {\n      restoreStateOfTarget(queuedTargets[i]);\n    }\n  }\n}\n\n// Used as a way to call batchedUpdates when we don't have a reference to\n// the renderer. Such as when we're dispatching events or if third party\n// libraries need to call batchedUpdates. Eventually, this API will go away when\n// everything is batched by default. We'll then have a similar API to opt-out of\n// scheduled work and instead do synchronous work.\n\n// Defaults\nvar fiberBatchedUpdates = function(fn, bookkeeping) {\n  return fn(bookkeeping);\n};\n\nvar isNestingBatched = false;\nfunction batchedUpdates(fn, bookkeeping) {\n  if (isNestingBatched) {\n    // If we are currently inside another batch, we need to wait until it\n    // fully completes before restoring state. Therefore, we add the target to\n    // a queue of work.\n    return fiberBatchedUpdates(fn, bookkeeping);\n  }\n  isNestingBatched = true;\n  try {\n    return fiberBatchedUpdates(fn, bookkeeping);\n  } finally {\n    // Here we wait until all updates have propagated, which is important\n    // when using controlled components within layers:\n    // https://github.com/facebook/react/issues/1698\n    // Then we restore state of any controlled component.\n    isNestingBatched = false;\n    restoreStateIfNeeded();\n  }\n}\n\nvar ReactGenericBatchingInjection = {\n  injectFiberBatchedUpdates: function(_batchedUpdates) {\n    fiberBatchedUpdates = _batchedUpdates;\n  }\n};\n\nvar injection$2 = ReactGenericBatchingInjection;\n\nfunction runEventQueueInBatch(events) {\n  enqueueEvents(events);\n  processEventQueue(false);\n}\n\n/**\n * Streams a fired top-level event to `EventPluginHub` where plugins have the\n * opportunity to create `ReactEvent`s to be dispatched.\n */\nfunction handleTopLevel(\n  topLevelType,\n  targetInst,\n  nativeEvent,\n  nativeEventTarget\n) {\n  var events = extractEvents(\n    topLevelType,\n    targetInst,\n    nativeEvent,\n    nativeEventTarget\n  );\n  runEventQueueInBatch(events);\n}\n\n/**\n * Keeps track of allocating and associating native \"tags\" which are numeric,\n * unique view IDs. All the native tags are negative numbers, to avoid\n * collisions, but in the JS we keep track of them as positive integers to store\n * them effectively in Arrays. So we must refer to them as \"inverses\" of the\n * native tags (that are * normally negative).\n *\n * It *must* be the case that every `rootNodeID` always maps to the exact same\n * `tag` forever. The easiest way to accomplish this is to never delete\n * anything from this table.\n * Why: Because `dangerouslyReplaceNodeWithMarkupByID` relies on being able to\n * unmount a component with a `rootNodeID`, then mount a new one in its place,\n */\nvar INITIAL_TAG_COUNT = 1;\nvar ReactNativeTagHandles = {\n  tagsStartAt: INITIAL_TAG_COUNT,\n  tagCount: INITIAL_TAG_COUNT,\n\n  allocateTag: function() {\n    // Skip over root IDs as those are reserved for native\n    while (this.reactTagIsNativeTopRootID(ReactNativeTagHandles.tagCount)) {\n      ReactNativeTagHandles.tagCount++;\n    }\n    var tag = ReactNativeTagHandles.tagCount;\n    ReactNativeTagHandles.tagCount++;\n    return tag;\n  },\n\n  assertRootTag: function(tag) {\n    invariant(\n      this.reactTagIsNativeTopRootID(tag),\n      \"Expect a native root tag, instead got %s\",\n      tag\n    );\n  },\n\n  reactTagIsNativeTopRootID: function(reactTag) {\n    // We reserve all tags that are 1 mod 10 for native root views\n    return reactTag % 10 === 1;\n  }\n};\n\n/**\n * Version of `ReactBrowserEventEmitter` that works on the receiving side of a\n * serialized worker boundary.\n */\n\n// Shared default empty native event - conserve memory.\nvar EMPTY_NATIVE_EVENT = {};\n\n/**\n * Selects a subsequence of `Touch`es, without destroying `touches`.\n *\n * @param {Array<Touch>} touches Deserialized touch objects.\n * @param {Array<number>} indices Indices by which to pull subsequence.\n * @return {Array<Touch>} Subsequence of touch objects.\n */\nvar touchSubsequence = function(touches, indices) {\n  var ret = [];\n  for (var i = 0; i < indices.length; i++) {\n    ret.push(touches[indices[i]]);\n  }\n  return ret;\n};\n\n/**\n * TODO: Pool all of this.\n *\n * Destroys `touches` by removing touch objects at indices `indices`. This is\n * to maintain compatibility with W3C touch \"end\" events, where the active\n * touches don't include the set that has just been \"ended\".\n *\n * @param {Array<Touch>} touches Deserialized touch objects.\n * @param {Array<number>} indices Indices to remove from `touches`.\n * @return {Array<Touch>} Subsequence of removed touch objects.\n */\nvar removeTouchesAtIndices = function(touches, indices) {\n  var rippedOut = [];\n  // use an unsafe downcast to alias to nullable elements,\n  // so we can delete and then compact.\n  var temp = touches;\n  for (var i = 0; i < indices.length; i++) {\n    var index = indices[i];\n    rippedOut.push(touches[index]);\n    temp[index] = null;\n  }\n  var fillAt = 0;\n  for (var j = 0; j < temp.length; j++) {\n    var cur = temp[j];\n    if (cur !== null) {\n      temp[fillAt++] = cur;\n    }\n  }\n  temp.length = fillAt;\n  return rippedOut;\n};\n\n/**\n * Internal version of `receiveEvent` in terms of normalized (non-tag)\n * `rootNodeID`.\n *\n * @see receiveEvent.\n *\n * @param {rootNodeID} rootNodeID React root node ID that event occurred on.\n * @param {TopLevelType} topLevelType Top level type of event.\n * @param {?object} nativeEventParam Object passed from native.\n */\nfunction _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam) {\n  var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT;\n  var inst = getInstanceFromTag(rootNodeID);\n  batchedUpdates(function() {\n    handleTopLevel(topLevelType, inst, nativeEvent, nativeEvent.target);\n  });\n  // React Native doesn't use ReactControlledComponent but if it did, here's\n  // where it would do it.\n}\n\n/**\n * Publicly exposed method on module for native objc to invoke when a top\n * level event is extracted.\n * @param {rootNodeID} rootNodeID React root node ID that event occurred on.\n * @param {TopLevelType} topLevelType Top level type of event.\n * @param {object} nativeEventParam Object passed from native.\n */\nfunction receiveEvent(rootNodeID, topLevelType, nativeEventParam) {\n  _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam);\n}\n\n/**\n * Simple multi-wrapper around `receiveEvent` that is intended to receive an\n * efficient representation of `Touch` objects, and other information that\n * can be used to construct W3C compliant `Event` and `Touch` lists.\n *\n * This may create dispatch behavior that differs than web touch handling. We\n * loop through each of the changed touches and receive it as a single event.\n * So two `touchStart`/`touchMove`s that occur simultaneously are received as\n * two separate touch event dispatches - when they arguably should be one.\n *\n * This implementation reuses the `Touch` objects themselves as the `Event`s\n * since we dispatch an event for each touch (though that might not be spec\n * compliant). The main purpose of reusing them is to save allocations.\n *\n * TODO: Dispatch multiple changed touches in one event. The bubble path\n * could be the first common ancestor of all the `changedTouches`.\n *\n * One difference between this behavior and W3C spec: cancelled touches will\n * not appear in `.touches`, or in any future `.touches`, though they may\n * still be \"actively touching the surface\".\n *\n * Web desktop polyfills only need to construct a fake touch event with\n * identifier 0, also abandoning traditional click handlers.\n */\nfunction receiveTouches(eventTopLevelType, touches, changedIndices) {\n  var changedTouches =\n    eventTopLevelType === \"topTouchEnd\" ||\n    eventTopLevelType === \"topTouchCancel\"\n      ? removeTouchesAtIndices(touches, changedIndices)\n      : touchSubsequence(touches, changedIndices);\n\n  for (var jj = 0; jj < changedTouches.length; jj++) {\n    var touch = changedTouches[jj];\n    // Touch objects can fulfill the role of `DOM` `Event` objects if we set\n    // the `changedTouches`/`touches`. This saves allocations.\n    touch.changedTouches = changedTouches;\n    touch.touches = touches;\n    var nativeEvent = touch;\n    var rootNodeID = null;\n    var target = nativeEvent.target;\n    if (target !== null && target !== undefined) {\n      if (target < ReactNativeTagHandles.tagsStartAt) {\n        {\n          warning(\n            false,\n            \"A view is reporting that a touch occurred on tag zero.\"\n          );\n        }\n      } else {\n        rootNodeID = target;\n      }\n    }\n    // $FlowFixMe Shouldn't we *not* call it if rootNodeID is null?\n    _receiveRootNodeIDEvent(rootNodeID, eventTopLevelType, nativeEvent);\n  }\n}\n\nvar ReactNativeEventEmitter = Object.freeze({\n  getListener: getListener,\n  registrationNames: registrationNameModules,\n  _receiveRootNodeIDEvent: _receiveRootNodeIDEvent,\n  receiveEvent: receiveEvent,\n  receiveTouches: receiveTouches,\n  handleTopLevel: handleTopLevel\n});\n\nvar ReactNativeEventPluginOrder = [\n  \"ResponderEventPlugin\",\n  \"ReactNativeBridgeEventPlugin\"\n];\n\n// Module provided by RN:\nvar ReactNativeGlobalResponderHandler = {\n  onChange: function(from, to, blockNativeResponder) {\n    if (to !== null) {\n      var tag = to.stateNode._nativeTag;\n      UIManager.setJSResponder(tag, blockNativeResponder);\n    } else {\n      UIManager.clearJSResponder();\n    }\n  }\n};\n\n/**\n * Make sure essential globals are available and are patched correctly. Please don't remove this\n * line. Bundles created by react-packager `require` it before executing any application code. This\n * ensures it exists in the dependency graph and can be `require`d.\n * TODO: require this in packager, not in React #10932517\n */\n// Module provided by RN:\n// Module provided by RN:\n/**\n * Register the event emitter with the native bridge\n */\nRCTEventEmitter.register(ReactNativeEventEmitter);\n\n/**\n * Inject module for resolving DOM hierarchy and plugin ordering.\n */\ninjection.injectEventPluginOrder(ReactNativeEventPluginOrder);\ninjection$1.injectComponentTree(ReactNativeComponentTree);\n\nResponderEventPlugin.injection.injectGlobalResponderHandler(\n  ReactNativeGlobalResponderHandler\n);\n\n/**\n * Some important event plugins included by default (without having to require\n * them).\n */\ninjection.injectEventPluginsByName({\n  ResponderEventPlugin: ResponderEventPlugin,\n  ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin\n});\n\nvar defaultShowDialog = function(capturedError) {\n  return true;\n};\n\nvar showDialog = defaultShowDialog;\n\nfunction logCapturedError(capturedError) {\n  var logError = showDialog(capturedError);\n\n  // Allow injected showDialog() to prevent default console.error logging.\n  // This enables renderers like ReactNative to better manage redbox behavior.\n  if (logError === false) {\n    return;\n  }\n\n  var error = capturedError.error;\n  var suppressLogging = error && error.suppressReactErrorLogging;\n  if (suppressLogging) {\n    return;\n  }\n\n  {\n    var componentName = capturedError.componentName,\n      componentStack = capturedError.componentStack,\n      errorBoundaryName = capturedError.errorBoundaryName,\n      errorBoundaryFound = capturedError.errorBoundaryFound,\n      willRetry = capturedError.willRetry;\n\n    var componentNameMessage = componentName\n      ? \"The above error occurred in the <\" + componentName + \"> component:\"\n      : \"The above error occurred in one of your React components:\";\n\n    var errorBoundaryMessage = void 0;\n    // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.\n    if (errorBoundaryFound && errorBoundaryName) {\n      if (willRetry) {\n        errorBoundaryMessage =\n          \"React will try to recreate this component tree from scratch \" +\n          (\"using the error boundary you provided, \" + errorBoundaryName + \".\");\n      } else {\n        errorBoundaryMessage =\n          \"This error was initially handled by the error boundary \" +\n          errorBoundaryName +\n          \".\\n\" +\n          \"Recreating the tree from scratch failed so React will unmount the tree.\";\n      }\n    } else {\n      errorBoundaryMessage =\n        \"Consider adding an error boundary to your tree to customize error handling behavior.\\n\" +\n        \"Visit https://fb.me/react-error-boundaries to learn more about error boundaries.\";\n    }\n    var combinedMessage =\n      \"\" +\n      componentNameMessage +\n      componentStack +\n      \"\\n\\n\" +\n      (\"\" + errorBoundaryMessage);\n\n    // In development, we provide our own message with just the component stack.\n    // We don't include the original error message and JS stack because the browser\n    // has already printed it. Even if the application swallows the error, it is still\n    // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.\n    console.error(combinedMessage);\n  }\n}\n\nvar injection$4 = {\n  /**\n   * Display custom dialog for lifecycle errors.\n   * Return false to prevent default behavior of logging to console.error.\n   */\n  injectDialog: function(fn) {\n    invariant(\n      showDialog === defaultShowDialog,\n      \"The custom dialog was already injected.\"\n    );\n    invariant(\n      typeof fn === \"function\",\n      \"Injected showDialog() must be a function.\"\n    );\n    showDialog = fn;\n  }\n};\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === \"function\" && Symbol[\"for\"];\n\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol[\"for\"](\"react.element\") : 0xeac7;\nvar REACT_CALL_TYPE = hasSymbol ? Symbol[\"for\"](\"react.call\") : 0xeac8;\nvar REACT_RETURN_TYPE = hasSymbol ? Symbol[\"for\"](\"react.return\") : 0xeac9;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol[\"for\"](\"react.portal\") : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol[\"for\"](\"react.fragment\") : 0xeacb;\n\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === \"function\" && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = \"@@iterator\";\n\nfunction getIteratorFn(maybeIterable) {\n  if (maybeIterable === null || typeof maybeIterable === \"undefined\") {\n    return null;\n  }\n  var maybeIterator =\n    (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n    maybeIterable[FAUX_ITERATOR_SYMBOL];\n  if (typeof maybeIterator === \"function\") {\n    return maybeIterator;\n  }\n  return null;\n}\n\nfunction createPortal(\n  children,\n  containerInfo,\n  // TODO: figure out the API for cross-renderer implementation.\n  implementation\n) {\n  var key =\n    arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n  return {\n    // This tag allow us to uniquely identify this as a React Portal\n    $$typeof: REACT_PORTAL_TYPE,\n    key: key == null ? null : \"\" + key,\n    children: children,\n    containerInfo: containerInfo,\n    implementation: implementation\n  };\n}\n\nvar 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    var touchBank = touchHistory.touchBank;\n    var total = 0;\n    var count = 0;\n\n    var 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 (var i = 0; i < touchBank.length; i++) {\n        var touchTrack = touchBank[i];\n        if (\n          touchTrack !== null &&\n          touchTrack !== undefined &&\n          touchTrack.touchActive &&\n          touchTrack.currentTimeStamp >= touchesChangedAfter\n        ) {\n          var 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\n    );\n  },\n\n  currentCentroidYOfTouchesChangedAfter: function(\n    touchHistory,\n    touchesChangedAfter\n  ) {\n    return TouchHistoryMath.centroidDimension(\n      touchHistory,\n      touchesChangedAfter,\n      false, // isXAxis\n      true\n    );\n  },\n\n  previousCentroidXOfTouchesChangedAfter: function(\n    touchHistory,\n    touchesChangedAfter\n  ) {\n    return TouchHistoryMath.centroidDimension(\n      touchHistory,\n      touchesChangedAfter,\n      true, // isXAxis\n      false\n    );\n  },\n\n  previousCentroidYOfTouchesChangedAfter: function(\n    touchHistory,\n    touchesChangedAfter\n  ) {\n    return TouchHistoryMath.centroidDimension(\n      touchHistory,\n      touchesChangedAfter,\n      false, // isXAxis\n      false\n    );\n  },\n\n  currentCentroidX: function(touchHistory) {\n    return TouchHistoryMath.centroidDimension(\n      touchHistory,\n      0, // touchesChangedAfter\n      true, // isXAxis\n      true\n    );\n  },\n\n  currentCentroidY: function(touchHistory) {\n    return TouchHistoryMath.centroidDimension(\n      touchHistory,\n      0, // touchesChangedAfter\n      false, // isXAxis\n      true\n    );\n  },\n\n  noCentroid: -1\n};\n\nvar ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nvar ReactCurrentOwner = ReactInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame;\n\nvar ReactGlobalSharedState = Object.freeze({\n  ReactCurrentOwner: ReactCurrentOwner,\n  ReactDebugCurrentFrame: ReactDebugCurrentFrame\n});\n\n// TODO: this is special because it gets imported during build.\n\nvar ReactVersion = \"16.2.0\";\n\n// Module provided by RN:\n/**\n * Intercept lifecycle errors and ensure they are shown with the correct stack\n * trace within the native redbox component.\n */\nfunction showDialog$1(capturedError) {\n  var componentStack = capturedError.componentStack,\n    error = capturedError.error;\n\n  var errorToHandle = void 0;\n\n  // Typically Errors are thrown but eg strings or null can be thrown as well.\n  if (error instanceof Error) {\n    var message = error.message,\n      name = error.name;\n\n    var summary = message ? name + \": \" + message : name;\n\n    errorToHandle = error;\n\n    try {\n      errorToHandle.message =\n        summary + \"\\n\\nThis error is located at:\" + componentStack;\n    } catch (e) {}\n  } else if (typeof error === \"string\") {\n    errorToHandle = new Error(\n      error + \"\\n\\nThis error is located at:\" + componentStack\n    );\n  } else {\n    errorToHandle = new Error(\"Unspecified error at:\" + componentStack);\n  }\n\n  ExceptionsManager.handleException(errorToHandle, false);\n\n  // Return false here to prevent ReactFiberErrorLogger default behavior of\n  // logging error details to console.error. Calls to console.error are\n  // automatically routed to the native redbox controller, which we've already\n  // done above by calling ExceptionsManager.\n  return false;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n}\n\nvar objects = {};\nvar uniqueID = 1;\nvar emptyObject$2 = {};\n\nvar ReactNativePropRegistry = (function() {\n  function ReactNativePropRegistry() {\n    _classCallCheck(this, ReactNativePropRegistry);\n  }\n\n  ReactNativePropRegistry.register = function register(object) {\n    var id = ++uniqueID;\n    {\n      Object.freeze(object);\n    }\n    objects[id] = object;\n    return id;\n  };\n\n  ReactNativePropRegistry.getByID = function getByID(id) {\n    if (!id) {\n      // Used in the style={[condition && id]} pattern,\n      // we want it to be a no-op when the value is false or null\n      return emptyObject$2;\n    }\n\n    var object = objects[id];\n    if (!object) {\n      console.warn(\"Invalid style with id `\" + id + \"`. Skipping ...\");\n      return emptyObject$2;\n    }\n    return object;\n  };\n\n  return ReactNativePropRegistry;\n})();\n\n// Modules provided by RN:\nvar emptyObject$1 = {};\n\n/**\n * Create a payload that contains all the updates between two sets of props.\n *\n * These helpers are all encapsulated into a single module, because they use\n * mutation as a performance optimization which leads to subtle shared\n * dependencies between the code paths. To avoid this mutable state leaking\n * across modules, I've kept them isolated to this module.\n */\n\n// Tracks removed keys\nvar removedKeys = null;\nvar removedKeyCount = 0;\n\nfunction defaultDiffer(prevProp, nextProp) {\n  if (typeof nextProp !== \"object\" || nextProp === null) {\n    // Scalars have already been checked for equality\n    return true;\n  } else {\n    // For objects and arrays, the default diffing algorithm is a deep compare\n    return deepDiffer(prevProp, nextProp);\n  }\n}\n\nfunction resolveObject(idOrObject) {\n  if (typeof idOrObject === \"number\") {\n    return ReactNativePropRegistry.getByID(idOrObject);\n  }\n  return idOrObject;\n}\n\nfunction restoreDeletedValuesInNestedArray(\n  updatePayload,\n  node,\n  validAttributes\n) {\n  if (Array.isArray(node)) {\n    var i = node.length;\n    while (i-- && removedKeyCount > 0) {\n      restoreDeletedValuesInNestedArray(\n        updatePayload,\n        node[i],\n        validAttributes\n      );\n    }\n  } else if (node && removedKeyCount > 0) {\n    var obj = resolveObject(node);\n    for (var propKey in removedKeys) {\n      if (!removedKeys[propKey]) {\n        continue;\n      }\n      var nextProp = obj[propKey];\n      if (nextProp === undefined) {\n        continue;\n      }\n\n      var attributeConfig = validAttributes[propKey];\n      if (!attributeConfig) {\n        continue; // not a valid native prop\n      }\n\n      if (typeof nextProp === \"function\") {\n        nextProp = true;\n      }\n      if (typeof nextProp === \"undefined\") {\n        nextProp = null;\n      }\n\n      if (typeof attributeConfig !== \"object\") {\n        // case: !Object is the default case\n        updatePayload[propKey] = nextProp;\n      } else if (\n        typeof attributeConfig.diff === \"function\" ||\n        typeof attributeConfig.process === \"function\"\n      ) {\n        // case: CustomAttributeConfiguration\n        var nextValue =\n          typeof attributeConfig.process === \"function\"\n            ? attributeConfig.process(nextProp)\n            : nextProp;\n        updatePayload[propKey] = nextValue;\n      }\n      removedKeys[propKey] = false;\n      removedKeyCount--;\n    }\n  }\n}\n\nfunction diffNestedArrayProperty(\n  updatePayload,\n  prevArray,\n  nextArray,\n  validAttributes\n) {\n  var minLength =\n    prevArray.length < nextArray.length ? prevArray.length : nextArray.length;\n  var i;\n  for (i = 0; i < minLength; i++) {\n    // Diff any items in the array in the forward direction. Repeated keys\n    // will be overwritten by later values.\n    updatePayload = diffNestedProperty(\n      updatePayload,\n      prevArray[i],\n      nextArray[i],\n      validAttributes\n    );\n  }\n  for (; i < prevArray.length; i++) {\n    // Clear out all remaining properties.\n    updatePayload = clearNestedProperty(\n      updatePayload,\n      prevArray[i],\n      validAttributes\n    );\n  }\n  for (; i < nextArray.length; i++) {\n    // Add all remaining properties.\n    updatePayload = addNestedProperty(\n      updatePayload,\n      nextArray[i],\n      validAttributes\n    );\n  }\n  return updatePayload;\n}\n\nfunction diffNestedProperty(\n  updatePayload,\n  prevProp,\n  nextProp,\n  validAttributes\n) {\n  if (!updatePayload && prevProp === nextProp) {\n    // If no properties have been added, then we can bail out quickly on object\n    // equality.\n    return updatePayload;\n  }\n\n  if (!prevProp || !nextProp) {\n    if (nextProp) {\n      return addNestedProperty(updatePayload, nextProp, validAttributes);\n    }\n    if (prevProp) {\n      return clearNestedProperty(updatePayload, prevProp, validAttributes);\n    }\n    return updatePayload;\n  }\n\n  if (!Array.isArray(prevProp) && !Array.isArray(nextProp)) {\n    // Both are leaves, we can diff the leaves.\n    return diffProperties(\n      updatePayload,\n      resolveObject(prevProp),\n      resolveObject(nextProp),\n      validAttributes\n    );\n  }\n\n  if (Array.isArray(prevProp) && Array.isArray(nextProp)) {\n    // Both are arrays, we can diff the arrays.\n    return diffNestedArrayProperty(\n      updatePayload,\n      prevProp,\n      nextProp,\n      validAttributes\n    );\n  }\n\n  if (Array.isArray(prevProp)) {\n    return diffProperties(\n      updatePayload,\n      // $FlowFixMe - We know that this is always an object when the input is.\n      flattenStyle(prevProp),\n      // $FlowFixMe - We know that this isn't an array because of above flow.\n      resolveObject(nextProp),\n      validAttributes\n    );\n  }\n\n  return diffProperties(\n    updatePayload,\n    resolveObject(prevProp),\n    // $FlowFixMe - We know that this is always an object when the input is.\n    flattenStyle(nextProp),\n    validAttributes\n  );\n}\n\n/**\n * addNestedProperty takes a single set of props and valid attribute\n * attribute configurations. It processes each prop and adds it to the\n * updatePayload.\n */\nfunction addNestedProperty(updatePayload, nextProp, validAttributes) {\n  if (!nextProp) {\n    return updatePayload;\n  }\n\n  if (!Array.isArray(nextProp)) {\n    // Add each property of the leaf.\n    return addProperties(\n      updatePayload,\n      resolveObject(nextProp),\n      validAttributes\n    );\n  }\n\n  for (var i = 0; i < nextProp.length; i++) {\n    // Add all the properties of the array.\n    updatePayload = addNestedProperty(\n      updatePayload,\n      nextProp[i],\n      validAttributes\n    );\n  }\n\n  return updatePayload;\n}\n\n/**\n * clearNestedProperty takes a single set of props and valid attributes. It\n * adds a null sentinel to the updatePayload, for each prop key.\n */\nfunction clearNestedProperty(updatePayload, prevProp, validAttributes) {\n  if (!prevProp) {\n    return updatePayload;\n  }\n\n  if (!Array.isArray(prevProp)) {\n    // Add each property of the leaf.\n    return clearProperties(\n      updatePayload,\n      resolveObject(prevProp),\n      validAttributes\n    );\n  }\n\n  for (var i = 0; i < prevProp.length; i++) {\n    // Add all the properties of the array.\n    updatePayload = clearNestedProperty(\n      updatePayload,\n      prevProp[i],\n      validAttributes\n    );\n  }\n  return updatePayload;\n}\n\n/**\n * diffProperties takes two sets of props and a set of valid attributes\n * and write to updatePayload the values that changed or were deleted.\n * If no updatePayload is provided, a new one is created and returned if\n * anything changed.\n */\nfunction diffProperties(updatePayload, prevProps, nextProps, validAttributes) {\n  var attributeConfig;\n  var nextProp;\n  var prevProp;\n\n  for (var propKey in nextProps) {\n    attributeConfig = validAttributes[propKey];\n    if (!attributeConfig) {\n      continue; // not a valid native prop\n    }\n\n    prevProp = prevProps[propKey];\n    nextProp = nextProps[propKey];\n\n    // functions are converted to booleans as markers that the associated\n    // events should be sent from native.\n    if (typeof nextProp === \"function\") {\n      nextProp = true;\n      // If nextProp is not a function, then don't bother changing prevProp\n      // since nextProp will win and go into the updatePayload regardless.\n      if (typeof prevProp === \"function\") {\n        prevProp = true;\n      }\n    }\n\n    // An explicit value of undefined is treated as a null because it overrides\n    // any other preceding value.\n    if (typeof nextProp === \"undefined\") {\n      nextProp = null;\n      if (typeof prevProp === \"undefined\") {\n        prevProp = null;\n      }\n    }\n\n    if (removedKeys) {\n      removedKeys[propKey] = false;\n    }\n\n    if (updatePayload && updatePayload[propKey] !== undefined) {\n      // Something else already triggered an update to this key because another\n      // value diffed. Since we're now later in the nested arrays our value is\n      // more important so we need to calculate it and override the existing\n      // value. It doesn't matter if nothing changed, we'll set it anyway.\n\n      // Pattern match on: attributeConfig\n      if (typeof attributeConfig !== \"object\") {\n        // case: !Object is the default case\n        updatePayload[propKey] = nextProp;\n      } else if (\n        typeof attributeConfig.diff === \"function\" ||\n        typeof attributeConfig.process === \"function\"\n      ) {\n        // case: CustomAttributeConfiguration\n        var nextValue =\n          typeof attributeConfig.process === \"function\"\n            ? attributeConfig.process(nextProp)\n            : nextProp;\n        updatePayload[propKey] = nextValue;\n      }\n      continue;\n    }\n\n    if (prevProp === nextProp) {\n      continue; // nothing changed\n    }\n\n    // Pattern match on: attributeConfig\n    if (typeof attributeConfig !== \"object\") {\n      // case: !Object is the default case\n      if (defaultDiffer(prevProp, nextProp)) {\n        // a normal leaf has changed\n        (updatePayload || (updatePayload = {}))[propKey] = nextProp;\n      }\n    } else if (\n      typeof attributeConfig.diff === \"function\" ||\n      typeof attributeConfig.process === \"function\"\n    ) {\n      // case: CustomAttributeConfiguration\n      var shouldUpdate =\n        prevProp === undefined ||\n        (typeof attributeConfig.diff === \"function\"\n          ? attributeConfig.diff(prevProp, nextProp)\n          : defaultDiffer(prevProp, nextProp));\n      if (shouldUpdate) {\n        nextValue =\n          typeof attributeConfig.process === \"function\"\n            ? attributeConfig.process(nextProp)\n            : nextProp;\n        (updatePayload || (updatePayload = {}))[propKey] = nextValue;\n      }\n    } else {\n      // default: fallthrough case when nested properties are defined\n      removedKeys = null;\n      removedKeyCount = 0;\n      // We think that attributeConfig is not CustomAttributeConfiguration at\n      // this point so we assume it must be AttributeConfiguration.\n      updatePayload = diffNestedProperty(\n        updatePayload,\n        prevProp,\n        nextProp,\n        attributeConfig\n      );\n      if (removedKeyCount > 0 && updatePayload) {\n        restoreDeletedValuesInNestedArray(\n          updatePayload,\n          nextProp,\n          attributeConfig\n        );\n        removedKeys = null;\n      }\n    }\n  }\n\n  // Also iterate through all the previous props to catch any that have been\n  // removed and make sure native gets the signal so it can reset them to the\n  // default.\n  for (propKey in prevProps) {\n    if (nextProps[propKey] !== undefined) {\n      continue; // we've already covered this key in the previous pass\n    }\n    attributeConfig = validAttributes[propKey];\n    if (!attributeConfig) {\n      continue; // not a valid native prop\n    }\n\n    if (updatePayload && updatePayload[propKey] !== undefined) {\n      // This was already updated to a diff result earlier.\n      continue;\n    }\n\n    prevProp = prevProps[propKey];\n    if (prevProp === undefined) {\n      continue; // was already empty anyway\n    }\n    // Pattern match on: attributeConfig\n    if (\n      typeof attributeConfig !== \"object\" ||\n      typeof attributeConfig.diff === \"function\" ||\n      typeof attributeConfig.process === \"function\"\n    ) {\n      // case: CustomAttributeConfiguration | !Object\n      // Flag the leaf property for removal by sending a sentinel.\n      (updatePayload || (updatePayload = {}))[propKey] = null;\n      if (!removedKeys) {\n        removedKeys = {};\n      }\n      if (!removedKeys[propKey]) {\n        removedKeys[propKey] = true;\n        removedKeyCount++;\n      }\n    } else {\n      // default:\n      // This is a nested attribute configuration where all the properties\n      // were removed so we need to go through and clear out all of them.\n      updatePayload = clearNestedProperty(\n        updatePayload,\n        prevProp,\n        attributeConfig\n      );\n    }\n  }\n  return updatePayload;\n}\n\n/**\n * addProperties adds all the valid props to the payload after being processed.\n */\nfunction addProperties(updatePayload, props, validAttributes) {\n  // TODO: Fast path\n  return diffProperties(updatePayload, emptyObject$1, props, validAttributes);\n}\n\n/**\n * clearProperties clears all the previous props by adding a null sentinel\n * to the payload for each valid key.\n */\nfunction clearProperties(updatePayload, prevProps, validAttributes) {\n  // TODO: Fast path\n  return diffProperties(\n    updatePayload,\n    prevProps,\n    emptyObject$1,\n    validAttributes\n  );\n}\n\nfunction create(props, validAttributes) {\n  return addProperties(\n    null, // updatePayload\n    props,\n    validAttributes\n  );\n}\n\nfunction diff(prevProps, nextProps, validAttributes) {\n  return diffProperties(\n    null, // updatePayload\n    prevProps,\n    nextProps,\n    validAttributes\n  );\n}\n\n/**\n * In the future, we should cleanup callbacks by cancelling them instead of\n * using this.\n */\nfunction mountSafeCallback(context, callback) {\n  return function() {\n    if (!callback) {\n      return undefined;\n    }\n    if (typeof context.__isMounted === \"boolean\") {\n      // TODO(gaearon): this is gross and should be removed.\n      // It is currently necessary because View uses createClass,\n      // and so any measure() calls on View (which are done by React\n      // DevTools) trigger the isMounted() deprecation warning.\n      if (!context.__isMounted) {\n        return undefined;\n      }\n      // The else branch is important so that we don't\n      // trigger the deprecation warning by calling isMounted.\n    } else if (typeof context.isMounted === \"function\") {\n      if (!context.isMounted()) {\n        return undefined;\n      }\n    }\n    return callback.apply(context, arguments);\n  };\n}\n\nfunction throwOnStylesProp(component, props) {\n  if (props.styles !== undefined) {\n    var owner = component._owner || null;\n    var name = component.constructor.displayName;\n    var msg =\n      \"`styles` is not a supported property of `\" +\n      name +\n      \"`, did \" +\n      \"you mean `style` (singular)?\";\n    if (owner && owner.constructor && owner.constructor.displayName) {\n      msg +=\n        \"\\n\\nCheck the `\" +\n        owner.constructor.displayName +\n        \"` parent \" +\n        \" component.\";\n    }\n    throw new Error(msg);\n  }\n}\n\nfunction warnForStyleProps(props, validAttributes) {\n  for (var key in validAttributes.style) {\n    if (!(validAttributes[key] || props[key] === undefined)) {\n      console.error(\n        \"You are setting the style `{ \" +\n          key +\n          \": ... }` as a prop. You \" +\n          \"should nest it in a style object. \" +\n          \"E.g. `{ style: { \" +\n          key +\n          \": ... } }`\"\n      );\n    }\n  }\n}\n\n/**\n * `ReactInstanceMap` maintains a mapping from a public facing stateful\n * instance (key) and the internal representation (value). This allows public\n * methods to accept the user facing instance as an argument and map them back\n * to internal methods.\n *\n * Note that this module is currently shared and assumed to be stateless.\n * If this becomes an actual Map, that will break.\n */\n\n/**\n * This API should be called `delete` but we'd have to make sure to always\n * transform these to strings for IE support. When this transform is fully\n * supported we can rename it.\n */\n\nfunction get(key) {\n  return key._reactInternalFiber;\n}\n\nfunction set(key, value) {\n  key._reactInternalFiber = value;\n}\n\nfunction getComponentName(fiber) {\n  var type = fiber.type;\n\n  if (typeof type === \"string\") {\n    return type;\n  }\n  if (typeof type === \"function\") {\n    return type.displayName || type.name;\n  }\n  return null;\n}\n\n// Re-export dynamic flags from the fbsource version.\nvar _require = require(\"ReactFeatureFlags\");\n\nvar debugRenderPhaseSideEffects = _require.debugRenderPhaseSideEffects;\n\nvar enableAsyncSubtreeAPI = true;\n\nvar enableUserTimingAPI = true;\nvar enableMutatingReconciler = true;\nvar enableNoopReconciler = false;\nvar enablePersistentReconciler = false;\n\n// Only used in www builds.\n\n// Don't change these two values:\nvar NoEffect = 0; //           0b00000000\nvar PerformedWork = 1; //      0b00000001\n\n// You can change the rest (and add more).\nvar Placement = 2; //          0b00000010\nvar Update = 4; //             0b00000100\nvar PlacementAndUpdate = 6; // 0b00000110\nvar Deletion = 8; //           0b00001000\nvar ContentReset = 16; //      0b00010000\nvar Callback = 32; //          0b00100000\nvar Err = 64; //               0b01000000\nvar Ref = 128; //              0b10000000\n\nvar MOUNTING = 1;\nvar MOUNTED = 2;\nvar UNMOUNTED = 3;\n\nfunction isFiberMountedImpl(fiber) {\n  var node = fiber;\n  if (!fiber.alternate) {\n    // If there is no alternate, this might be a new tree that isn't inserted\n    // yet. If it is, then it will have a pending insertion effect on it.\n    if ((node.effectTag & Placement) !== NoEffect) {\n      return MOUNTING;\n    }\n    while (node[\"return\"]) {\n      node = node[\"return\"];\n      if ((node.effectTag & Placement) !== NoEffect) {\n        return MOUNTING;\n      }\n    }\n  } else {\n    while (node[\"return\"]) {\n      node = node[\"return\"];\n    }\n  }\n  if (node.tag === HostRoot) {\n    // TODO: Check if this was a nested HostRoot when used with\n    // renderContainerIntoSubtree.\n    return MOUNTED;\n  }\n  // If we didn't hit the root, that means that we're in an disconnected tree\n  // that has been unmounted.\n  return UNMOUNTED;\n}\n\nfunction isFiberMounted(fiber) {\n  return isFiberMountedImpl(fiber) === MOUNTED;\n}\n\nfunction isMounted(component) {\n  {\n    var owner = ReactCurrentOwner.current;\n    if (owner !== null && owner.tag === ClassComponent) {\n      var ownerFiber = owner;\n      var instance = ownerFiber.stateNode;\n      warning(\n        instance._warnedAboutRefsInRender,\n        \"%s is accessing isMounted inside its render() function. \" +\n          \"render() should be a pure function of props and state. It should \" +\n          \"never access something that requires stale data from the previous \" +\n          \"render, such as refs. Move this logic to componentDidMount and \" +\n          \"componentDidUpdate instead.\",\n        getComponentName(ownerFiber) || \"A component\"\n      );\n      instance._warnedAboutRefsInRender = true;\n    }\n  }\n\n  var fiber = get(component);\n  if (!fiber) {\n    return false;\n  }\n  return isFiberMountedImpl(fiber) === MOUNTED;\n}\n\nfunction assertIsMounted(fiber) {\n  invariant(\n    isFiberMountedImpl(fiber) === MOUNTED,\n    \"Unable to find node on an unmounted component.\"\n  );\n}\n\nfunction findCurrentFiberUsingSlowPath(fiber) {\n  var alternate = fiber.alternate;\n  if (!alternate) {\n    // If there is no alternate, then we only need to check if it is mounted.\n    var state = isFiberMountedImpl(fiber);\n    invariant(\n      state !== UNMOUNTED,\n      \"Unable to find node on an unmounted component.\"\n    );\n    if (state === MOUNTING) {\n      return null;\n    }\n    return fiber;\n  }\n  // If we have two possible branches, we'll walk backwards up to the root\n  // to see what path the root points to. On the way we may hit one of the\n  // special cases and we'll deal with them.\n  var a = fiber;\n  var b = alternate;\n  while (true) {\n    var parentA = a[\"return\"];\n    var parentB = parentA ? parentA.alternate : null;\n    if (!parentA || !parentB) {\n      // We're at the root.\n      break;\n    }\n\n    // If both copies of the parent fiber point to the same child, we can\n    // assume that the child is current. This happens when we bailout on low\n    // priority: the bailed out fiber's child reuses the current child.\n    if (parentA.child === parentB.child) {\n      var child = parentA.child;\n      while (child) {\n        if (child === a) {\n          // We've determined that A is the current branch.\n          assertIsMounted(parentA);\n          return fiber;\n        }\n        if (child === b) {\n          // We've determined that B is the current branch.\n          assertIsMounted(parentA);\n          return alternate;\n        }\n        child = child.sibling;\n      }\n      // We should never have an alternate for any mounting node. So the only\n      // way this could possibly happen is if this was unmounted, if at all.\n      invariant(false, \"Unable to find node on an unmounted component.\");\n    }\n\n    if (a[\"return\"] !== b[\"return\"]) {\n      // The return pointer of A and the return pointer of B point to different\n      // fibers. We assume that return pointers never criss-cross, so A must\n      // belong to the child set of A.return, and B must belong to the child\n      // set of B.return.\n      a = parentA;\n      b = parentB;\n    } else {\n      // The return pointers point to the same fiber. We'll have to use the\n      // default, slow path: scan the child sets of each parent alternate to see\n      // which child belongs to which set.\n      //\n      // Search parent A's child set\n      var didFindChild = false;\n      var _child = parentA.child;\n      while (_child) {\n        if (_child === a) {\n          didFindChild = true;\n          a = parentA;\n          b = parentB;\n          break;\n        }\n        if (_child === b) {\n          didFindChild = true;\n          b = parentA;\n          a = parentB;\n          break;\n        }\n        _child = _child.sibling;\n      }\n      if (!didFindChild) {\n        // Search parent B's child set\n        _child = parentB.child;\n        while (_child) {\n          if (_child === a) {\n            didFindChild = true;\n            a = parentB;\n            b = parentA;\n            break;\n          }\n          if (_child === b) {\n            didFindChild = true;\n            b = parentB;\n            a = parentA;\n            break;\n          }\n          _child = _child.sibling;\n        }\n        invariant(\n          didFindChild,\n          \"Child was not found in either parent set. This indicates a bug \" +\n            \"in React related to the return pointer. Please file an issue.\"\n        );\n      }\n    }\n\n    invariant(\n      a.alternate === b,\n      \"Return fibers should always be each others' alternates. \" +\n        \"This error is likely caused by a bug in React. Please file an issue.\"\n    );\n  }\n  // If the root is not a host container, we're in a disconnected tree. I.e.\n  // unmounted.\n  invariant(\n    a.tag === HostRoot,\n    \"Unable to find node on an unmounted component.\"\n  );\n  if (a.stateNode.current === a) {\n    // We've determined that A is the current branch.\n    return fiber;\n  }\n  // Otherwise B has to be current branch.\n  return alternate;\n}\n\nfunction findCurrentHostFiber(parent) {\n  var currentParent = findCurrentFiberUsingSlowPath(parent);\n  if (!currentParent) {\n    return null;\n  }\n\n  // Next we'll drill down this component to find the first HostComponent/Text.\n  var node = currentParent;\n  while (true) {\n    if (node.tag === HostComponent || node.tag === HostText) {\n      return node;\n    } else if (node.child) {\n      node.child[\"return\"] = node;\n      node = node.child;\n      continue;\n    }\n    if (node === currentParent) {\n      return null;\n    }\n    while (!node.sibling) {\n      if (!node[\"return\"] || node[\"return\"] === currentParent) {\n        return null;\n      }\n      node = node[\"return\"];\n    }\n    node.sibling[\"return\"] = node[\"return\"];\n    node = node.sibling;\n  }\n  // Flow needs the return null here, but ESLint complains about it.\n  // eslint-disable-next-line no-unreachable\n  return null;\n}\n\nfunction findCurrentHostFiberWithNoPortals(parent) {\n  var currentParent = findCurrentFiberUsingSlowPath(parent);\n  if (!currentParent) {\n    return null;\n  }\n\n  // Next we'll drill down this component to find the first HostComponent/Text.\n  var node = currentParent;\n  while (true) {\n    if (node.tag === HostComponent || node.tag === HostText) {\n      return node;\n    } else if (node.child && node.tag !== HostPortal) {\n      node.child[\"return\"] = node;\n      node = node.child;\n      continue;\n    }\n    if (node === currentParent) {\n      return null;\n    }\n    while (!node.sibling) {\n      if (!node[\"return\"] || node[\"return\"] === currentParent) {\n        return null;\n      }\n      node = node[\"return\"];\n    }\n    node.sibling[\"return\"] = node[\"return\"];\n    node = node.sibling;\n  }\n  // Flow needs the return null here, but ESLint complains about it.\n  // eslint-disable-next-line no-unreachable\n  return null;\n}\n\nvar valueStack = [];\n\n{\n  var fiberStack = [];\n}\n\nvar index = -1;\n\nfunction createCursor(defaultValue) {\n  return {\n    current: defaultValue\n  };\n}\n\nfunction pop(cursor, fiber) {\n  if (index < 0) {\n    {\n      warning(false, \"Unexpected pop.\");\n    }\n    return;\n  }\n\n  {\n    if (fiber !== fiberStack[index]) {\n      warning(false, \"Unexpected Fiber popped.\");\n    }\n  }\n\n  cursor.current = valueStack[index];\n\n  valueStack[index] = null;\n\n  {\n    fiberStack[index] = null;\n  }\n\n  index--;\n}\n\nfunction push(cursor, value, fiber) {\n  index++;\n\n  valueStack[index] = cursor.current;\n\n  {\n    fiberStack[index] = fiber;\n  }\n\n  cursor.current = value;\n}\n\nfunction reset() {\n  while (index > -1) {\n    valueStack[index] = null;\n\n    {\n      fiberStack[index] = null;\n    }\n\n    index--;\n  }\n}\n\nvar describeComponentFrame = function(name, source, ownerName) {\n  return (\n    \"\\n    in \" +\n    (name || \"Unknown\") +\n    (source\n      ? \" (at \" +\n        source.fileName.replace(/^.*[\\\\\\/]/, \"\") +\n        \":\" +\n        source.lineNumber +\n        \")\"\n      : ownerName ? \" (created by \" + ownerName + \")\" : \"\")\n  );\n};\n\nfunction describeFiber(fiber) {\n  switch (fiber.tag) {\n    case IndeterminateComponent:\n    case FunctionalComponent:\n    case ClassComponent:\n    case HostComponent:\n      var owner = fiber._debugOwner;\n      var source = fiber._debugSource;\n      var name = getComponentName(fiber);\n      var ownerName = null;\n      if (owner) {\n        ownerName = getComponentName(owner);\n      }\n      return describeComponentFrame(name, source, ownerName);\n    default:\n      return \"\";\n  }\n}\n\n// This function can only be called with a work-in-progress fiber and\n// only during begin or complete phase. Do not call it under any other\n// circumstances.\nfunction getStackAddendumByWorkInProgressFiber(workInProgress) {\n  var info = \"\";\n  var node = workInProgress;\n  do {\n    info += describeFiber(node);\n    // Otherwise this return pointer might point to the wrong tree:\n    node = node[\"return\"];\n  } while (node);\n  return info;\n}\n\nfunction getCurrentFiberOwnerName() {\n  {\n    var fiber = ReactDebugCurrentFiber.current;\n    if (fiber === null) {\n      return null;\n    }\n    var owner = fiber._debugOwner;\n    if (owner !== null && typeof owner !== \"undefined\") {\n      return getComponentName(owner);\n    }\n  }\n  return null;\n}\n\nfunction getCurrentFiberStackAddendum() {\n  {\n    var fiber = ReactDebugCurrentFiber.current;\n    if (fiber === null) {\n      return null;\n    }\n    // Safe because if current fiber exists, we are reconciling,\n    // and it is guaranteed to be the work-in-progress version.\n    return getStackAddendumByWorkInProgressFiber(fiber);\n  }\n  return null;\n}\n\nfunction resetCurrentFiber() {\n  ReactDebugCurrentFrame.getCurrentStack = null;\n  ReactDebugCurrentFiber.current = null;\n  ReactDebugCurrentFiber.phase = null;\n}\n\nfunction setCurrentFiber(fiber) {\n  ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackAddendum;\n  ReactDebugCurrentFiber.current = fiber;\n  ReactDebugCurrentFiber.phase = null;\n}\n\nfunction setCurrentPhase(phase) {\n  ReactDebugCurrentFiber.phase = phase;\n}\n\nvar ReactDebugCurrentFiber = {\n  current: null,\n  phase: null,\n  resetCurrentFiber: resetCurrentFiber,\n  setCurrentFiber: setCurrentFiber,\n  setCurrentPhase: setCurrentPhase,\n  getCurrentFiberOwnerName: getCurrentFiberOwnerName,\n  getCurrentFiberStackAddendum: getCurrentFiberStackAddendum\n};\n\n// Prefix measurements so that it's possible to filter them.\n// Longer prefixes are hard to read in DevTools.\nvar reactEmoji = \"\\u269B\";\nvar warningEmoji = \"\\u26D4\";\nvar supportsUserTiming =\n  typeof performance !== \"undefined\" &&\n  typeof performance.mark === \"function\" &&\n  typeof performance.clearMarks === \"function\" &&\n  typeof performance.measure === \"function\" &&\n  typeof performance.clearMeasures === \"function\";\n\n// Keep track of current fiber so that we know the path to unwind on pause.\n// TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?\nvar currentFiber = null;\n// If we're in the middle of user code, which fiber and method is it?\n// Reusing `currentFiber` would be confusing for this because user code fiber\n// can change during commit phase too, but we don't need to unwind it (since\n// lifecycles in the commit phase don't resemble a tree).\nvar currentPhase = null;\nvar currentPhaseFiber = null;\n// Did lifecycle hook schedule an update? This is often a performance problem,\n// so we will keep track of it, and include it in the report.\n// Track commits caused by cascading updates.\nvar isCommitting = false;\nvar hasScheduledUpdateInCurrentCommit = false;\nvar hasScheduledUpdateInCurrentPhase = false;\nvar commitCountInCurrentWorkLoop = 0;\nvar effectCountInCurrentCommit = 0;\nvar isWaitingForCallback = false;\n// During commits, we only show a measurement once per method name\n// to avoid stretch the commit phase with measurement overhead.\nvar labelsInCurrentCommit = new Set();\n\nvar formatMarkName = function(markName) {\n  return reactEmoji + \" \" + markName;\n};\n\nvar formatLabel = function(label, warning$$1) {\n  var prefix = warning$$1 ? warningEmoji + \" \" : reactEmoji + \" \";\n  var suffix = warning$$1 ? \" Warning: \" + warning$$1 : \"\";\n  return \"\" + prefix + label + suffix;\n};\n\nvar beginMark = function(markName) {\n  performance.mark(formatMarkName(markName));\n};\n\nvar clearMark = function(markName) {\n  performance.clearMarks(formatMarkName(markName));\n};\n\nvar endMark = function(label, markName, warning$$1) {\n  var formattedMarkName = formatMarkName(markName);\n  var formattedLabel = formatLabel(label, warning$$1);\n  try {\n    performance.measure(formattedLabel, formattedMarkName);\n  } catch (err) {}\n  // If previous mark was missing for some reason, this will throw.\n  // This could only happen if React crashed in an unexpected place earlier.\n  // Don't pile on with more errors.\n\n  // Clear marks immediately to avoid growing buffer.\n  performance.clearMarks(formattedMarkName);\n  performance.clearMeasures(formattedLabel);\n};\n\nvar getFiberMarkName = function(label, debugID) {\n  return label + \" (#\" + debugID + \")\";\n};\n\nvar getFiberLabel = function(componentName, isMounted, phase) {\n  if (phase === null) {\n    // These are composite component total time measurements.\n    return componentName + \" [\" + (isMounted ? \"update\" : \"mount\") + \"]\";\n  } else {\n    // Composite component methods.\n    return componentName + \".\" + phase;\n  }\n};\n\nvar beginFiberMark = function(fiber, phase) {\n  var componentName = getComponentName(fiber) || \"Unknown\";\n  var debugID = fiber._debugID;\n  var isMounted = fiber.alternate !== null;\n  var label = getFiberLabel(componentName, isMounted, phase);\n\n  if (isCommitting && labelsInCurrentCommit.has(label)) {\n    // During the commit phase, we don't show duplicate labels because\n    // there is a fixed overhead for every measurement, and we don't\n    // want to stretch the commit phase beyond necessary.\n    return false;\n  }\n  labelsInCurrentCommit.add(label);\n\n  var markName = getFiberMarkName(label, debugID);\n  beginMark(markName);\n  return true;\n};\n\nvar clearFiberMark = function(fiber, phase) {\n  var componentName = getComponentName(fiber) || \"Unknown\";\n  var debugID = fiber._debugID;\n  var isMounted = fiber.alternate !== null;\n  var label = getFiberLabel(componentName, isMounted, phase);\n  var markName = getFiberMarkName(label, debugID);\n  clearMark(markName);\n};\n\nvar endFiberMark = function(fiber, phase, warning$$1) {\n  var componentName = getComponentName(fiber) || \"Unknown\";\n  var debugID = fiber._debugID;\n  var isMounted = fiber.alternate !== null;\n  var label = getFiberLabel(componentName, isMounted, phase);\n  var markName = getFiberMarkName(label, debugID);\n  endMark(label, markName, warning$$1);\n};\n\nvar shouldIgnoreFiber = function(fiber) {\n  // Host components should be skipped in the timeline.\n  // We could check typeof fiber.type, but does this work with RN?\n  switch (fiber.tag) {\n    case HostRoot:\n    case HostComponent:\n    case HostText:\n    case HostPortal:\n    case ReturnComponent:\n    case Fragment:\n      return true;\n    default:\n      return false;\n  }\n};\n\nvar clearPendingPhaseMeasurement = function() {\n  if (currentPhase !== null && currentPhaseFiber !== null) {\n    clearFiberMark(currentPhaseFiber, currentPhase);\n  }\n  currentPhaseFiber = null;\n  currentPhase = null;\n  hasScheduledUpdateInCurrentPhase = false;\n};\n\nvar pauseTimers = function() {\n  // Stops all currently active measurements so that they can be resumed\n  // if we continue in a later deferred loop from the same unit of work.\n  var fiber = currentFiber;\n  while (fiber) {\n    if (fiber._debugIsCurrentlyTiming) {\n      endFiberMark(fiber, null, null);\n    }\n    fiber = fiber[\"return\"];\n  }\n};\n\nvar resumeTimersRecursively = function(fiber) {\n  if (fiber[\"return\"] !== null) {\n    resumeTimersRecursively(fiber[\"return\"]);\n  }\n  if (fiber._debugIsCurrentlyTiming) {\n    beginFiberMark(fiber, null);\n  }\n};\n\nvar resumeTimers = function() {\n  // Resumes all measurements that were active during the last deferred loop.\n  if (currentFiber !== null) {\n    resumeTimersRecursively(currentFiber);\n  }\n};\n\nfunction recordEffect() {\n  if (enableUserTimingAPI) {\n    effectCountInCurrentCommit++;\n  }\n}\n\nfunction recordScheduleUpdate() {\n  if (enableUserTimingAPI) {\n    if (isCommitting) {\n      hasScheduledUpdateInCurrentCommit = true;\n    }\n    if (\n      currentPhase !== null &&\n      currentPhase !== \"componentWillMount\" &&\n      currentPhase !== \"componentWillReceiveProps\"\n    ) {\n      hasScheduledUpdateInCurrentPhase = true;\n    }\n  }\n}\n\nfunction startRequestCallbackTimer() {\n  if (enableUserTimingAPI) {\n    if (supportsUserTiming && !isWaitingForCallback) {\n      isWaitingForCallback = true;\n      beginMark(\"(Waiting for async callback...)\");\n    }\n  }\n}\n\nfunction stopRequestCallbackTimer(didExpire) {\n  if (enableUserTimingAPI) {\n    if (supportsUserTiming) {\n      isWaitingForCallback = false;\n      var warning$$1 = didExpire ? \"React was blocked by main thread\" : null;\n      endMark(\n        \"(Waiting for async callback...)\",\n        \"(Waiting for async callback...)\",\n        warning$$1\n      );\n    }\n  }\n}\n\nfunction startWorkTimer(fiber) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    }\n    // If we pause, this is the fiber to unwind from.\n    currentFiber = fiber;\n    if (!beginFiberMark(fiber, null)) {\n      return;\n    }\n    fiber._debugIsCurrentlyTiming = true;\n  }\n}\n\nfunction cancelWorkTimer(fiber) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    }\n    // Remember we shouldn't complete measurement for this fiber.\n    // Otherwise flamechart will be deep even for small updates.\n    fiber._debugIsCurrentlyTiming = false;\n    clearFiberMark(fiber, null);\n  }\n}\n\nfunction stopWorkTimer(fiber) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    }\n    // If we pause, its parent is the fiber to unwind from.\n    currentFiber = fiber[\"return\"];\n    if (!fiber._debugIsCurrentlyTiming) {\n      return;\n    }\n    fiber._debugIsCurrentlyTiming = false;\n    endFiberMark(fiber, null, null);\n  }\n}\n\nfunction stopFailedWorkTimer(fiber) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    }\n    // If we pause, its parent is the fiber to unwind from.\n    currentFiber = fiber[\"return\"];\n    if (!fiber._debugIsCurrentlyTiming) {\n      return;\n    }\n    fiber._debugIsCurrentlyTiming = false;\n    var warning$$1 = \"An error was thrown inside this error boundary\";\n    endFiberMark(fiber, null, warning$$1);\n  }\n}\n\nfunction startPhaseTimer(fiber, phase) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    clearPendingPhaseMeasurement();\n    if (!beginFiberMark(fiber, phase)) {\n      return;\n    }\n    currentPhaseFiber = fiber;\n    currentPhase = phase;\n  }\n}\n\nfunction stopPhaseTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    if (currentPhase !== null && currentPhaseFiber !== null) {\n      var warning$$1 = hasScheduledUpdateInCurrentPhase\n        ? \"Scheduled a cascading update\"\n        : null;\n      endFiberMark(currentPhaseFiber, currentPhase, warning$$1);\n    }\n    currentPhase = null;\n    currentPhaseFiber = null;\n  }\n}\n\nfunction startWorkLoopTimer(nextUnitOfWork) {\n  if (enableUserTimingAPI) {\n    currentFiber = nextUnitOfWork;\n    if (!supportsUserTiming) {\n      return;\n    }\n    commitCountInCurrentWorkLoop = 0;\n    // This is top level call.\n    // Any other measurements are performed within.\n    beginMark(\"(React Tree Reconciliation)\");\n    // Resume any measurements that were in progress during the last loop.\n    resumeTimers();\n  }\n}\n\nfunction stopWorkLoopTimer(interruptedBy) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    var warning$$1 = null;\n    if (interruptedBy !== null) {\n      if (interruptedBy.tag === HostRoot) {\n        warning$$1 = \"A top-level update interrupted the previous render\";\n      } else {\n        var componentName = getComponentName(interruptedBy) || \"Unknown\";\n        warning$$1 =\n          \"An update to \" + componentName + \" interrupted the previous render\";\n      }\n    } else if (commitCountInCurrentWorkLoop > 1) {\n      warning$$1 = \"There were cascading updates\";\n    }\n    commitCountInCurrentWorkLoop = 0;\n    // Pause any measurements until the next loop.\n    pauseTimers();\n    endMark(\n      \"(React Tree Reconciliation)\",\n      \"(React Tree Reconciliation)\",\n      warning$$1\n    );\n  }\n}\n\nfunction startCommitTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    isCommitting = true;\n    hasScheduledUpdateInCurrentCommit = false;\n    labelsInCurrentCommit.clear();\n    beginMark(\"(Committing Changes)\");\n  }\n}\n\nfunction stopCommitTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n\n    var warning$$1 = null;\n    if (hasScheduledUpdateInCurrentCommit) {\n      warning$$1 = \"Lifecycle hook scheduled a cascading update\";\n    } else if (commitCountInCurrentWorkLoop > 0) {\n      warning$$1 = \"Caused by a cascading update in earlier commit\";\n    }\n    hasScheduledUpdateInCurrentCommit = false;\n    commitCountInCurrentWorkLoop++;\n    isCommitting = false;\n    labelsInCurrentCommit.clear();\n\n    endMark(\"(Committing Changes)\", \"(Committing Changes)\", warning$$1);\n  }\n}\n\nfunction startCommitHostEffectsTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    effectCountInCurrentCommit = 0;\n    beginMark(\"(Committing Host Effects)\");\n  }\n}\n\nfunction stopCommitHostEffectsTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    var count = effectCountInCurrentCommit;\n    effectCountInCurrentCommit = 0;\n    endMark(\n      \"(Committing Host Effects: \" + count + \" Total)\",\n      \"(Committing Host Effects)\",\n      null\n    );\n  }\n}\n\nfunction startCommitLifeCyclesTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    effectCountInCurrentCommit = 0;\n    beginMark(\"(Calling Lifecycle Methods)\");\n  }\n}\n\nfunction stopCommitLifeCyclesTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    var count = effectCountInCurrentCommit;\n    effectCountInCurrentCommit = 0;\n    endMark(\n      \"(Calling Lifecycle Methods: \" + count + \" Total)\",\n      \"(Calling Lifecycle Methods)\",\n      null\n    );\n  }\n}\n\n{\n  var warnedAboutMissingGetChildContext = {};\n}\n\n// A cursor to the current merged context object on the stack.\nvar contextStackCursor = createCursor(emptyObject);\n// A cursor to a boolean indicating whether the context has changed.\nvar didPerformWorkStackCursor = createCursor(false);\n// Keep track of the previous context object that was on the stack.\n// We use this to get access to the parent context after we have already\n// pushed the next context provider, and now need to merge their contexts.\nvar previousContext = emptyObject;\n\nfunction getUnmaskedContext(workInProgress) {\n  var hasOwnContext = isContextProvider(workInProgress);\n  if (hasOwnContext) {\n    // If the fiber is a context provider itself, when we read its context\n    // we have already pushed its own child context on the stack. A context\n    // provider should not \"see\" its own child context. Therefore we read the\n    // previous (parent) context instead for a context provider.\n    return previousContext;\n  }\n  return contextStackCursor.current;\n}\n\nfunction cacheContext(workInProgress, unmaskedContext, maskedContext) {\n  var instance = workInProgress.stateNode;\n  instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;\n  instance.__reactInternalMemoizedMaskedChildContext = maskedContext;\n}\n\nfunction getMaskedContext(workInProgress, unmaskedContext) {\n  var type = workInProgress.type;\n  var contextTypes = type.contextTypes;\n  if (!contextTypes) {\n    return emptyObject;\n  }\n\n  // Avoid recreating masked context unless unmasked context has changed.\n  // Failing to do this will result in unnecessary calls to componentWillReceiveProps.\n  // This may trigger infinite loops if componentWillReceiveProps calls setState.\n  var instance = workInProgress.stateNode;\n  if (\n    instance &&\n    instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext\n  ) {\n    return instance.__reactInternalMemoizedMaskedChildContext;\n  }\n\n  var context = {};\n  for (var key in contextTypes) {\n    context[key] = unmaskedContext[key];\n  }\n\n  {\n    var name = getComponentName(workInProgress) || \"Unknown\";\n    checkPropTypes(\n      contextTypes,\n      context,\n      \"context\",\n      name,\n      ReactDebugCurrentFiber.getCurrentFiberStackAddendum\n    );\n  }\n\n  // Cache unmasked context so we can avoid recreating masked context unless necessary.\n  // Context is created before the class component is instantiated so check for instance.\n  if (instance) {\n    cacheContext(workInProgress, unmaskedContext, context);\n  }\n\n  return context;\n}\n\nfunction hasContextChanged() {\n  return didPerformWorkStackCursor.current;\n}\n\nfunction isContextConsumer(fiber) {\n  return fiber.tag === ClassComponent && fiber.type.contextTypes != null;\n}\n\nfunction isContextProvider(fiber) {\n  return fiber.tag === ClassComponent && fiber.type.childContextTypes != null;\n}\n\nfunction popContextProvider(fiber) {\n  if (!isContextProvider(fiber)) {\n    return;\n  }\n\n  pop(didPerformWorkStackCursor, fiber);\n  pop(contextStackCursor, fiber);\n}\n\nfunction popTopLevelContextObject(fiber) {\n  pop(didPerformWorkStackCursor, fiber);\n  pop(contextStackCursor, fiber);\n}\n\nfunction pushTopLevelContextObject(fiber, context, didChange) {\n  invariant(\n    contextStackCursor.cursor == null,\n    \"Unexpected context found on stack. \" +\n      \"This error is likely caused by a bug in React. Please file an issue.\"\n  );\n\n  push(contextStackCursor, context, fiber);\n  push(didPerformWorkStackCursor, didChange, fiber);\n}\n\nfunction processChildContext(fiber, parentContext) {\n  var instance = fiber.stateNode;\n  var childContextTypes = fiber.type.childContextTypes;\n\n  // TODO (bvaughn) Replace this behavior with an invariant() in the future.\n  // It has only been added in Fiber to match the (unintentional) behavior in Stack.\n  if (typeof instance.getChildContext !== \"function\") {\n    {\n      var componentName = getComponentName(fiber) || \"Unknown\";\n\n      if (!warnedAboutMissingGetChildContext[componentName]) {\n        warnedAboutMissingGetChildContext[componentName] = true;\n        warning(\n          false,\n          \"%s.childContextTypes is specified but there is no getChildContext() method \" +\n            \"on the instance. You can either define getChildContext() on %s or remove \" +\n            \"childContextTypes from it.\",\n          componentName,\n          componentName\n        );\n      }\n    }\n    return parentContext;\n  }\n\n  var childContext = void 0;\n  {\n    ReactDebugCurrentFiber.setCurrentPhase(\"getChildContext\");\n  }\n  startPhaseTimer(fiber, \"getChildContext\");\n  childContext = instance.getChildContext();\n  stopPhaseTimer();\n  {\n    ReactDebugCurrentFiber.setCurrentPhase(null);\n  }\n  for (var contextKey in childContext) {\n    invariant(\n      contextKey in childContextTypes,\n      '%s.getChildContext(): key \"%s\" is not defined in childContextTypes.',\n      getComponentName(fiber) || \"Unknown\",\n      contextKey\n    );\n  }\n  {\n    var name = getComponentName(fiber) || \"Unknown\";\n    checkPropTypes(\n      childContextTypes,\n      childContext,\n      \"child context\",\n      name,\n      // In practice, there is one case in which we won't get a stack. It's when\n      // somebody calls unstable_renderSubtreeIntoContainer() and we process\n      // context from the parent component instance. The stack will be missing\n      // because it's outside of the reconciliation, and so the pointer has not\n      // been set. This is rare and doesn't matter. We'll also remove that API.\n      ReactDebugCurrentFiber.getCurrentFiberStackAddendum\n    );\n  }\n\n  return Object.assign({}, parentContext, childContext);\n}\n\nfunction pushContextProvider(workInProgress) {\n  if (!isContextProvider(workInProgress)) {\n    return false;\n  }\n\n  var instance = workInProgress.stateNode;\n  // We push the context as early as possible to ensure stack integrity.\n  // If the instance does not exist yet, we will push null at first,\n  // and replace it on the stack later when invalidating the context.\n  var memoizedMergedChildContext =\n    (instance && instance.__reactInternalMemoizedMergedChildContext) ||\n    emptyObject;\n\n  // Remember the parent context so we can merge with it later.\n  // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.\n  previousContext = contextStackCursor.current;\n  push(contextStackCursor, memoizedMergedChildContext, workInProgress);\n  push(\n    didPerformWorkStackCursor,\n    didPerformWorkStackCursor.current,\n    workInProgress\n  );\n\n  return true;\n}\n\nfunction invalidateContextProvider(workInProgress, didChange) {\n  var instance = workInProgress.stateNode;\n  invariant(\n    instance,\n    \"Expected to have an instance by this point. \" +\n      \"This error is likely caused by a bug in React. Please file an issue.\"\n  );\n\n  if (didChange) {\n    // Merge parent and own context.\n    // Skip this if we're not updating due to sCU.\n    // This avoids unnecessarily recomputing memoized values.\n    var mergedContext = processChildContext(workInProgress, previousContext);\n    instance.__reactInternalMemoizedMergedChildContext = mergedContext;\n\n    // Replace the old (or empty) context with the new one.\n    // It is important to unwind the context in the reverse order.\n    pop(didPerformWorkStackCursor, workInProgress);\n    pop(contextStackCursor, workInProgress);\n    // Now push the new context and mark that it has changed.\n    push(contextStackCursor, mergedContext, workInProgress);\n    push(didPerformWorkStackCursor, didChange, workInProgress);\n  } else {\n    pop(didPerformWorkStackCursor, workInProgress);\n    push(didPerformWorkStackCursor, didChange, workInProgress);\n  }\n}\n\nfunction resetContext() {\n  previousContext = emptyObject;\n  contextStackCursor.current = emptyObject;\n  didPerformWorkStackCursor.current = false;\n}\n\nfunction findCurrentUnmaskedContext(fiber) {\n  // Currently this is only used with renderSubtreeIntoContainer; not sure if it\n  // makes sense elsewhere\n  invariant(\n    isFiberMounted(fiber) && fiber.tag === ClassComponent,\n    \"Expected subtree parent to be a mounted class component. \" +\n      \"This error is likely caused by a bug in React. Please file an issue.\"\n  );\n\n  var node = fiber;\n  while (node.tag !== HostRoot) {\n    if (isContextProvider(node)) {\n      return node.stateNode.__reactInternalMemoizedMergedChildContext;\n    }\n    var parent = node[\"return\"];\n    invariant(\n      parent,\n      \"Found unexpected detached subtree parent. \" +\n        \"This error is likely caused by a bug in React. Please file an issue.\"\n    );\n    node = parent;\n  }\n  return node.stateNode.context;\n}\n\nvar NoWork = 0; // TODO: Use an opaque type once ESLint et al support the syntax\n\nvar Sync = 1;\nvar Never = 2147483647; // Max int32: Math.pow(2, 31) - 1\n\nvar UNIT_SIZE = 10;\nvar MAGIC_NUMBER_OFFSET = 2;\n\n// 1 unit of expiration time represents 10ms.\nfunction msToExpirationTime(ms) {\n  // Always add an offset so that we don't clash with the magic number for NoWork.\n  return ((ms / UNIT_SIZE) | 0) + MAGIC_NUMBER_OFFSET;\n}\n\nfunction expirationTimeToMs(expirationTime) {\n  return (expirationTime - MAGIC_NUMBER_OFFSET) * UNIT_SIZE;\n}\n\nfunction ceiling(num, precision) {\n  return (((num / precision) | 0) + 1) * precision;\n}\n\nfunction computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {\n  return ceiling(\n    currentTime + expirationInMs / UNIT_SIZE,\n    bucketSizeMs / UNIT_SIZE\n  );\n}\n\nvar NoContext = 0;\nvar AsyncUpdates = 1;\n\n{\n  var hasBadMapPolyfill = false;\n  try {\n    var nonExtensibleObject = Object.preventExtensions({});\n    /* eslint-disable no-new */\n    new Map([[nonExtensibleObject, null]]);\n    new Set([nonExtensibleObject]);\n    /* eslint-enable no-new */\n  } catch (e) {\n    // TODO: Consider warning about bad polyfills\n    hasBadMapPolyfill = true;\n  }\n}\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\n{\n  var debugCounter = 1;\n}\n\nfunction FiberNode(tag, pendingProps, key, internalContextTag) {\n  // Instance\n  this.tag = tag;\n  this.key = key;\n  this.type = null;\n  this.stateNode = null;\n\n  // Fiber\n  this[\"return\"] = null;\n  this.child = null;\n  this.sibling = null;\n  this.index = 0;\n\n  this.ref = null;\n\n  this.pendingProps = pendingProps;\n  this.memoizedProps = null;\n  this.updateQueue = null;\n  this.memoizedState = null;\n\n  this.internalContextTag = internalContextTag;\n\n  // Effects\n  this.effectTag = NoEffect;\n  this.nextEffect = null;\n\n  this.firstEffect = null;\n  this.lastEffect = null;\n\n  this.expirationTime = NoWork;\n\n  this.alternate = null;\n\n  {\n    this._debugID = debugCounter++;\n    this._debugSource = null;\n    this._debugOwner = null;\n    this._debugIsCurrentlyTiming = false;\n    if (!hasBadMapPolyfill && typeof Object.preventExtensions === \"function\") {\n      Object.preventExtensions(this);\n    }\n  }\n}\n\n// This is a constructor function, rather than a POJO constructor, still\n// please ensure we do the following:\n// 1) Nobody should add any instance methods on this. Instance methods can be\n//    more difficult to predict when they get optimized and they are almost\n//    never inlined properly in static compilers.\n// 2) Nobody should rely on `instanceof Fiber` for type testing. We should\n//    always know when it is a fiber.\n// 3) We might want to experiment with using numeric keys since they are easier\n//    to optimize in a non-JIT environment.\n// 4) We can easily go from a constructor to a createFiber object literal if that\n//    is faster.\n// 5) It should be easy to port this to a C struct and keep a C implementation\n//    compatible.\nvar createFiber = function(tag, pendingProps, key, internalContextTag) {\n  // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors\n  return new FiberNode(tag, pendingProps, key, internalContextTag);\n};\n\nfunction shouldConstruct(Component) {\n  return !!(Component.prototype && Component.prototype.isReactComponent);\n}\n\n// This is used to create an alternate fiber to do work on.\nfunction createWorkInProgress(current, pendingProps, expirationTime) {\n  var workInProgress = current.alternate;\n  if (workInProgress === null) {\n    // We use a double buffering pooling technique because we know that we'll\n    // only ever need at most two versions of a tree. We pool the \"other\" unused\n    // node that we're free to reuse. This is lazily created to avoid allocating\n    // extra objects for things that are never updated. It also allow us to\n    // reclaim the extra memory if needed.\n    workInProgress = createFiber(\n      current.tag,\n      pendingProps,\n      current.key,\n      current.internalContextTag\n    );\n    workInProgress.type = current.type;\n    workInProgress.stateNode = current.stateNode;\n\n    {\n      // DEV-only fields\n      workInProgress._debugID = current._debugID;\n      workInProgress._debugSource = current._debugSource;\n      workInProgress._debugOwner = current._debugOwner;\n    }\n\n    workInProgress.alternate = current;\n    current.alternate = workInProgress;\n  } else {\n    workInProgress.pendingProps = pendingProps;\n\n    // We already have an alternate.\n    // Reset the effect tag.\n    workInProgress.effectTag = NoEffect;\n\n    // The effect list is no longer valid.\n    workInProgress.nextEffect = null;\n    workInProgress.firstEffect = null;\n    workInProgress.lastEffect = null;\n  }\n\n  workInProgress.expirationTime = expirationTime;\n\n  workInProgress.child = current.child;\n  workInProgress.memoizedProps = current.memoizedProps;\n  workInProgress.memoizedState = current.memoizedState;\n  workInProgress.updateQueue = current.updateQueue;\n\n  // These will be overridden during the parent's reconciliation\n  workInProgress.sibling = current.sibling;\n  workInProgress.index = current.index;\n  workInProgress.ref = current.ref;\n\n  return workInProgress;\n}\n\nfunction createHostRootFiber() {\n  var fiber = createFiber(HostRoot, null, NoContext);\n  return fiber;\n}\n\nfunction createFiberFromElement(element, internalContextTag, expirationTime) {\n  var owner = null;\n  {\n    owner = element._owner;\n  }\n\n  var fiber = void 0;\n  var type = element.type;\n  var key = element.key;\n  var pendingProps = element.props;\n  if (typeof type === \"function\") {\n    fiber = shouldConstruct(type)\n      ? createFiber(ClassComponent, pendingProps, key, internalContextTag)\n      : createFiber(\n          IndeterminateComponent,\n          pendingProps,\n          key,\n          internalContextTag\n        );\n    fiber.type = type;\n  } else if (typeof type === \"string\") {\n    fiber = createFiber(HostComponent, pendingProps, key, internalContextTag);\n    fiber.type = type;\n  } else if (\n    typeof type === \"object\" &&\n    type !== null &&\n    typeof type.tag === \"number\"\n  ) {\n    // Currently assumed to be a continuation and therefore is a fiber already.\n    // TODO: The yield system is currently broken for updates in some cases.\n    // The reified yield stores a fiber, but we don't know which fiber that is;\n    // the current or a workInProgress? When the continuation gets rendered here\n    // we don't know if we can reuse that fiber or if we need to clone it.\n    // There is probably a clever way to restructure this.\n    fiber = type;\n    fiber.pendingProps = pendingProps;\n  } else {\n    var info = \"\";\n    {\n      if (\n        type === undefined ||\n        (typeof type === \"object\" &&\n          type !== null &&\n          Object.keys(type).length === 0)\n      ) {\n        info +=\n          \" You likely forgot to export your component from the file \" +\n          \"it's defined in, or you might have mixed up default and named imports.\";\n      }\n      var ownerName = owner ? getComponentName(owner) : null;\n      if (ownerName) {\n        info += \"\\n\\nCheck the render method of `\" + ownerName + \"`.\";\n      }\n    }\n    invariant(\n      false,\n      \"Element type is invalid: expected a string (for built-in components) \" +\n        \"or a class/function (for composite components) but got: %s.%s\",\n      type == null ? type : typeof type,\n      info\n    );\n  }\n\n  {\n    fiber._debugSource = element._source;\n    fiber._debugOwner = element._owner;\n  }\n\n  fiber.expirationTime = expirationTime;\n\n  return fiber;\n}\n\nfunction createFiberFromFragment(\n  elements,\n  internalContextTag,\n  expirationTime,\n  key\n) {\n  var fiber = createFiber(Fragment, elements, key, internalContextTag);\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\n\nfunction createFiberFromText(content, internalContextTag, expirationTime) {\n  var fiber = createFiber(HostText, content, null, internalContextTag);\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\n\nfunction createFiberFromHostInstanceForDeletion() {\n  var fiber = createFiber(HostComponent, null, null, NoContext);\n  fiber.type = \"DELETED\";\n  return fiber;\n}\n\nfunction createFiberFromCall(call, internalContextTag, expirationTime) {\n  var fiber = createFiber(CallComponent, call, call.key, internalContextTag);\n  fiber.type = call.handler;\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\n\nfunction createFiberFromReturn(returnNode, internalContextTag, expirationTime) {\n  var fiber = createFiber(ReturnComponent, null, null, internalContextTag);\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\n\nfunction createFiberFromPortal(portal, internalContextTag, expirationTime) {\n  var pendingProps = portal.children !== null ? portal.children : [];\n  var fiber = createFiber(\n    HostPortal,\n    pendingProps,\n    portal.key,\n    internalContextTag\n  );\n  fiber.expirationTime = expirationTime;\n  fiber.stateNode = {\n    containerInfo: portal.containerInfo,\n    pendingChildren: null, // Used by persistent updates\n    implementation: portal.implementation\n  };\n  return fiber;\n}\n\n// TODO: This should be lifted into the renderer.\n\nfunction createFiberRoot(containerInfo, hydrate) {\n  // Cyclic construction. This cheats the type system right now because\n  // stateNode is any.\n  var uninitializedFiber = createHostRootFiber();\n  var root = {\n    current: uninitializedFiber,\n    containerInfo: containerInfo,\n    pendingChildren: null,\n    remainingExpirationTime: NoWork,\n    isReadyForCommit: false,\n    finishedWork: null,\n    context: null,\n    pendingContext: null,\n    hydrate: hydrate,\n    firstBatch: null,\n    nextScheduledRoot: null\n  };\n  uninitializedFiber.stateNode = root;\n  return root;\n}\n\nvar onCommitFiberRoot = null;\nvar onCommitFiberUnmount = null;\nvar hasLoggedError = false;\n\nfunction catchErrors(fn) {\n  return function(arg) {\n    try {\n      return fn(arg);\n    } catch (err) {\n      if (true && !hasLoggedError) {\n        hasLoggedError = true;\n        warning(false, \"React DevTools encountered an error: %s\", err);\n      }\n    }\n  };\n}\n\nfunction injectInternals(internals) {\n  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === \"undefined\") {\n    // No DevTools\n    return false;\n  }\n  var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;\n  if (hook.isDisabled) {\n    // This isn't a real property on the hook, but it can be set to opt out\n    // of DevTools integration and associated warnings and logs.\n    // https://github.com/facebook/react/issues/3877\n    return true;\n  }\n  if (!hook.supportsFiber) {\n    {\n      warning(\n        false,\n        \"The installed version of React DevTools is too old and will not work \" +\n          \"with the current version of React. Please update React DevTools. \" +\n          \"https://fb.me/react-devtools\"\n      );\n    }\n    // DevTools exists, even though it doesn't support Fiber.\n    return true;\n  }\n  try {\n    var rendererID = hook.inject(internals);\n    // We have successfully injected, so now it is safe to set up hooks.\n    onCommitFiberRoot = catchErrors(function(root) {\n      return hook.onCommitFiberRoot(rendererID, root);\n    });\n    onCommitFiberUnmount = catchErrors(function(fiber) {\n      return hook.onCommitFiberUnmount(rendererID, fiber);\n    });\n  } catch (err) {\n    // Catch all errors because it is unsafe to throw during initialization.\n    {\n      warning(false, \"React DevTools encountered an error: %s.\", err);\n    }\n  }\n  // DevTools exists\n  return true;\n}\n\nfunction onCommitRoot(root) {\n  if (typeof onCommitFiberRoot === \"function\") {\n    onCommitFiberRoot(root);\n  }\n}\n\nfunction onCommitUnmount(fiber) {\n  if (typeof onCommitFiberUnmount === \"function\") {\n    onCommitFiberUnmount(fiber);\n  }\n}\n\n{\n  var didWarnUpdateInsideUpdate = false;\n}\n\n// Callbacks are not validated until invocation\n\n// Singly linked-list of updates. When an update is scheduled, it is added to\n// the queue of the current fiber and the work-in-progress fiber. The two queues\n// are separate but they share a persistent structure.\n//\n// During reconciliation, updates are removed from the work-in-progress fiber,\n// but they remain on the current fiber. That ensures that if a work-in-progress\n// is aborted, the aborted updates are recovered by cloning from current.\n//\n// The work-in-progress queue is always a subset of the current queue.\n//\n// When the tree is committed, the work-in-progress becomes the current.\n\nfunction createUpdateQueue(baseState) {\n  var queue = {\n    baseState: baseState,\n    expirationTime: NoWork,\n    first: null,\n    last: null,\n    callbackList: null,\n    hasForceUpdate: false,\n    isInitialized: false\n  };\n  {\n    queue.isProcessing = false;\n  }\n  return queue;\n}\n\nfunction insertUpdateIntoQueue(queue, update) {\n  // Append the update to the end of the list.\n  if (queue.last === null) {\n    // Queue is empty\n    queue.first = queue.last = update;\n  } else {\n    queue.last.next = update;\n    queue.last = update;\n  }\n  if (\n    queue.expirationTime === NoWork ||\n    queue.expirationTime > update.expirationTime\n  ) {\n    queue.expirationTime = update.expirationTime;\n  }\n}\n\nfunction insertUpdateIntoFiber(fiber, update) {\n  // We'll have at least one and at most two distinct update queues.\n  var alternateFiber = fiber.alternate;\n  var queue1 = fiber.updateQueue;\n  if (queue1 === null) {\n    // TODO: We don't know what the base state will be until we begin work.\n    // It depends on which fiber is the next current. Initialize with an empty\n    // base state, then set to the memoizedState when rendering. Not super\n    // happy with this approach.\n    queue1 = fiber.updateQueue = createUpdateQueue(null);\n  }\n\n  var queue2 = void 0;\n  if (alternateFiber !== null) {\n    queue2 = alternateFiber.updateQueue;\n    if (queue2 === null) {\n      queue2 = alternateFiber.updateQueue = createUpdateQueue(null);\n    }\n  } else {\n    queue2 = null;\n  }\n  queue2 = queue2 !== queue1 ? queue2 : null;\n\n  // Warn if an update is scheduled from inside an updater function.\n  {\n    if (\n      (queue1.isProcessing || (queue2 !== null && queue2.isProcessing)) &&\n      !didWarnUpdateInsideUpdate\n    ) {\n      warning(\n        false,\n        \"An update (setState, replaceState, or forceUpdate) was scheduled \" +\n          \"from inside an update function. Update functions should be pure, \" +\n          \"with zero side-effects. Consider using componentDidUpdate or a \" +\n          \"callback.\"\n      );\n      didWarnUpdateInsideUpdate = true;\n    }\n  }\n\n  // If there's only one queue, add the update to that queue and exit.\n  if (queue2 === null) {\n    insertUpdateIntoQueue(queue1, update);\n    return;\n  }\n\n  // If either queue is empty, we need to add to both queues.\n  if (queue1.last === null || queue2.last === null) {\n    insertUpdateIntoQueue(queue1, update);\n    insertUpdateIntoQueue(queue2, update);\n    return;\n  }\n\n  // If both lists are not empty, the last update is the same for both lists\n  // because of structural sharing. So, we should only append to one of\n  // the lists.\n  insertUpdateIntoQueue(queue1, update);\n  // But we still need to update the `last` pointer of queue2.\n  queue2.last = update;\n}\n\nfunction getUpdateExpirationTime(fiber) {\n  if (fiber.tag !== ClassComponent && fiber.tag !== HostRoot) {\n    return NoWork;\n  }\n  var updateQueue = fiber.updateQueue;\n  if (updateQueue === null) {\n    return NoWork;\n  }\n  return updateQueue.expirationTime;\n}\n\nfunction getStateFromUpdate(update, instance, prevState, props) {\n  var partialState = update.partialState;\n  if (typeof partialState === \"function\") {\n    var updateFn = partialState;\n\n    // Invoke setState callback an extra time to help detect side-effects.\n    if (debugRenderPhaseSideEffects) {\n      updateFn.call(instance, prevState, props);\n    }\n\n    return updateFn.call(instance, prevState, props);\n  } else {\n    return partialState;\n  }\n}\n\nfunction processUpdateQueue(\n  current,\n  workInProgress,\n  queue,\n  instance,\n  props,\n  renderExpirationTime\n) {\n  if (current !== null && current.updateQueue === queue) {\n    // We need to create a work-in-progress queue, by cloning the current queue.\n    var currentQueue = queue;\n    queue = workInProgress.updateQueue = {\n      baseState: currentQueue.baseState,\n      expirationTime: currentQueue.expirationTime,\n      first: currentQueue.first,\n      last: currentQueue.last,\n      isInitialized: currentQueue.isInitialized,\n      // These fields are no longer valid because they were already committed.\n      // Reset them.\n      callbackList: null,\n      hasForceUpdate: false\n    };\n  }\n\n  {\n    // Set this flag so we can warn if setState is called inside the update\n    // function of another setState.\n    queue.isProcessing = true;\n  }\n\n  // Reset the remaining expiration time. If we skip over any updates, we'll\n  // increase this accordingly.\n  queue.expirationTime = NoWork;\n\n  // TODO: We don't know what the base state will be until we begin work.\n  // It depends on which fiber is the next current. Initialize with an empty\n  // base state, then set to the memoizedState when rendering. Not super\n  // happy with this approach.\n  var state = void 0;\n  if (queue.isInitialized) {\n    state = queue.baseState;\n  } else {\n    state = queue.baseState = workInProgress.memoizedState;\n    queue.isInitialized = true;\n  }\n  var dontMutatePrevState = true;\n  var update = queue.first;\n  var didSkip = false;\n  while (update !== null) {\n    var updateExpirationTime = update.expirationTime;\n    if (updateExpirationTime > renderExpirationTime) {\n      // This update does not have sufficient priority. Skip it.\n      var remainingExpirationTime = queue.expirationTime;\n      if (\n        remainingExpirationTime === NoWork ||\n        remainingExpirationTime > updateExpirationTime\n      ) {\n        // Update the remaining expiration time.\n        queue.expirationTime = updateExpirationTime;\n      }\n      if (!didSkip) {\n        didSkip = true;\n        queue.baseState = state;\n      }\n      // Continue to the next update.\n      update = update.next;\n      continue;\n    }\n\n    // This update does have sufficient priority.\n\n    // If no previous updates were skipped, drop this update from the queue by\n    // advancing the head of the list.\n    if (!didSkip) {\n      queue.first = update.next;\n      if (queue.first === null) {\n        queue.last = null;\n      }\n    }\n\n    // Process the update\n    var _partialState = void 0;\n    if (update.isReplace) {\n      state = getStateFromUpdate(update, instance, state, props);\n      dontMutatePrevState = true;\n    } else {\n      _partialState = getStateFromUpdate(update, instance, state, props);\n      if (_partialState) {\n        if (dontMutatePrevState) {\n          // $FlowFixMe: Idk how to type this properly.\n          state = Object.assign({}, state, _partialState);\n        } else {\n          state = Object.assign(state, _partialState);\n        }\n        dontMutatePrevState = false;\n      }\n    }\n    if (update.isForced) {\n      queue.hasForceUpdate = true;\n    }\n    if (update.callback !== null) {\n      // Append to list of callbacks.\n      var _callbackList = queue.callbackList;\n      if (_callbackList === null) {\n        _callbackList = queue.callbackList = [];\n      }\n      _callbackList.push(update);\n    }\n    update = update.next;\n  }\n\n  if (queue.callbackList !== null) {\n    workInProgress.effectTag |= Callback;\n  } else if (queue.first === null && !queue.hasForceUpdate) {\n    // The queue is empty. We can reset it.\n    workInProgress.updateQueue = null;\n  }\n\n  if (!didSkip) {\n    didSkip = true;\n    queue.baseState = state;\n  }\n\n  {\n    // No longer processing.\n    queue.isProcessing = false;\n  }\n\n  return state;\n}\n\nfunction commitCallbacks(queue, context) {\n  var callbackList = queue.callbackList;\n  if (callbackList === null) {\n    return;\n  }\n  // Set the list to null to make sure they don't get called more than once.\n  queue.callbackList = null;\n  for (var i = 0; i < callbackList.length; i++) {\n    var update = callbackList[i];\n    var _callback = update.callback;\n    // This update might be processed again. Clear the callback so it's only\n    // called once.\n    update.callback = null;\n    invariant(\n      typeof _callback === \"function\",\n      \"Invalid argument passed as callback. Expected a function. Instead \" +\n        \"received: %s\",\n      _callback\n    );\n    _callback.call(context);\n  }\n}\n\nvar fakeInternalInstance = {};\nvar isArray = Array.isArray;\n\n{\n  var didWarnAboutStateAssignmentForComponent = {};\n\n  var warnOnInvalidCallback = function(callback, callerName) {\n    warning(\n      callback === null || typeof callback === \"function\",\n      \"%s(...): Expected the last optional `callback` argument to be a \" +\n        \"function. Instead received: %s.\",\n      callerName,\n      callback\n    );\n  };\n\n  // This is so gross but it's at least non-critical and can be removed if\n  // it causes problems. This is meant to give a nicer error message for\n  // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,\n  // ...)) which otherwise throws a \"_processChildContext is not a function\"\n  // exception.\n  Object.defineProperty(fakeInternalInstance, \"_processChildContext\", {\n    enumerable: false,\n    value: function() {\n      invariant(\n        false,\n        \"_processChildContext is not available in React 16+. This likely \" +\n          \"means you have multiple copies of React and are attempting to nest \" +\n          \"a React 15 tree inside a React 16 tree using \" +\n          \"unstable_renderSubtreeIntoContainer, which isn't supported. Try \" +\n          \"to make sure you have only one copy of React (and ideally, switch \" +\n          \"to ReactDOM.createPortal).\"\n      );\n    }\n  });\n  Object.freeze(fakeInternalInstance);\n}\n\nvar ReactFiberClassComponent = function(\n  scheduleWork,\n  computeExpirationForFiber,\n  memoizeProps,\n  memoizeState\n) {\n  // Class component state updater\n  var updater = {\n    isMounted: isMounted,\n    enqueueSetState: function(instance, partialState, callback) {\n      var fiber = get(instance);\n      callback = callback === undefined ? null : callback;\n      {\n        warnOnInvalidCallback(callback, \"setState\");\n      }\n      var expirationTime = computeExpirationForFiber(fiber);\n      var update = {\n        expirationTime: expirationTime,\n        partialState: partialState,\n        callback: callback,\n        isReplace: false,\n        isForced: false,\n        nextCallback: null,\n        next: null\n      };\n      insertUpdateIntoFiber(fiber, update);\n      scheduleWork(fiber, expirationTime);\n    },\n    enqueueReplaceState: function(instance, state, callback) {\n      var fiber = get(instance);\n      callback = callback === undefined ? null : callback;\n      {\n        warnOnInvalidCallback(callback, \"replaceState\");\n      }\n      var expirationTime = computeExpirationForFiber(fiber);\n      var update = {\n        expirationTime: expirationTime,\n        partialState: state,\n        callback: callback,\n        isReplace: true,\n        isForced: false,\n        nextCallback: null,\n        next: null\n      };\n      insertUpdateIntoFiber(fiber, update);\n      scheduleWork(fiber, expirationTime);\n    },\n    enqueueForceUpdate: function(instance, callback) {\n      var fiber = get(instance);\n      callback = callback === undefined ? null : callback;\n      {\n        warnOnInvalidCallback(callback, \"forceUpdate\");\n      }\n      var expirationTime = computeExpirationForFiber(fiber);\n      var update = {\n        expirationTime: expirationTime,\n        partialState: null,\n        callback: callback,\n        isReplace: false,\n        isForced: true,\n        nextCallback: null,\n        next: null\n      };\n      insertUpdateIntoFiber(fiber, update);\n      scheduleWork(fiber, expirationTime);\n    }\n  };\n\n  function checkShouldComponentUpdate(\n    workInProgress,\n    oldProps,\n    newProps,\n    oldState,\n    newState,\n    newContext\n  ) {\n    if (\n      oldProps === null ||\n      (workInProgress.updateQueue !== null &&\n        workInProgress.updateQueue.hasForceUpdate)\n    ) {\n      // If the workInProgress already has an Update effect, return true\n      return true;\n    }\n\n    var instance = workInProgress.stateNode;\n    var type = workInProgress.type;\n    if (typeof instance.shouldComponentUpdate === \"function\") {\n      startPhaseTimer(workInProgress, \"shouldComponentUpdate\");\n      var shouldUpdate = instance.shouldComponentUpdate(\n        newProps,\n        newState,\n        newContext\n      );\n      stopPhaseTimer();\n\n      // Simulate an async bailout/interruption by invoking lifecycle twice.\n      if (debugRenderPhaseSideEffects) {\n        instance.shouldComponentUpdate(newProps, newState, newContext);\n      }\n\n      {\n        warning(\n          shouldUpdate !== undefined,\n          \"%s.shouldComponentUpdate(): Returned undefined instead of a \" +\n            \"boolean value. Make sure to return true or false.\",\n          getComponentName(workInProgress) || \"Unknown\"\n        );\n      }\n\n      return shouldUpdate;\n    }\n\n    if (type.prototype && type.prototype.isPureReactComponent) {\n      return (\n        !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)\n      );\n    }\n\n    return true;\n  }\n\n  function checkClassInstance(workInProgress) {\n    var instance = workInProgress.stateNode;\n    var type = workInProgress.type;\n    {\n      var name = getComponentName(workInProgress);\n      var renderPresent = instance.render;\n\n      if (!renderPresent) {\n        if (type.prototype && typeof type.prototype.render === \"function\") {\n          warning(\n            false,\n            \"%s(...): No `render` method found on the returned component \" +\n              \"instance: did you accidentally return an object from the constructor?\",\n            name\n          );\n        } else {\n          warning(\n            false,\n            \"%s(...): No `render` method found on the returned component \" +\n              \"instance: you may have forgotten to define `render`.\",\n            name\n          );\n        }\n      }\n\n      var noGetInitialStateOnES6 =\n        !instance.getInitialState ||\n        instance.getInitialState.isReactClassApproved ||\n        instance.state;\n      warning(\n        noGetInitialStateOnES6,\n        \"getInitialState was defined on %s, a plain JavaScript class. \" +\n          \"This is only supported for classes created using React.createClass. \" +\n          \"Did you mean to define a state property instead?\",\n        name\n      );\n      var noGetDefaultPropsOnES6 =\n        !instance.getDefaultProps ||\n        instance.getDefaultProps.isReactClassApproved;\n      warning(\n        noGetDefaultPropsOnES6,\n        \"getDefaultProps was defined on %s, a plain JavaScript class. \" +\n          \"This is only supported for classes created using React.createClass. \" +\n          \"Use a static property to define defaultProps instead.\",\n        name\n      );\n      var noInstancePropTypes = !instance.propTypes;\n      warning(\n        noInstancePropTypes,\n        \"propTypes was defined as an instance property on %s. Use a static \" +\n          \"property to define propTypes instead.\",\n        name\n      );\n      var noInstanceContextTypes = !instance.contextTypes;\n      warning(\n        noInstanceContextTypes,\n        \"contextTypes was defined as an instance property on %s. Use a static \" +\n          \"property to define contextTypes instead.\",\n        name\n      );\n      var noComponentShouldUpdate =\n        typeof instance.componentShouldUpdate !== \"function\";\n      warning(\n        noComponentShouldUpdate,\n        \"%s has a method called \" +\n          \"componentShouldUpdate(). Did you mean shouldComponentUpdate()? \" +\n          \"The name is phrased as a question because the function is \" +\n          \"expected to return a value.\",\n        name\n      );\n      if (\n        type.prototype &&\n        type.prototype.isPureReactComponent &&\n        typeof instance.shouldComponentUpdate !== \"undefined\"\n      ) {\n        warning(\n          false,\n          \"%s has a method called shouldComponentUpdate(). \" +\n            \"shouldComponentUpdate should not be used when extending React.PureComponent. \" +\n            \"Please extend React.Component if shouldComponentUpdate is used.\",\n          getComponentName(workInProgress) || \"A pure component\"\n        );\n      }\n      var noComponentDidUnmount =\n        typeof instance.componentDidUnmount !== \"function\";\n      warning(\n        noComponentDidUnmount,\n        \"%s has a method called \" +\n          \"componentDidUnmount(). But there is no such lifecycle method. \" +\n          \"Did you mean componentWillUnmount()?\",\n        name\n      );\n      var noComponentDidReceiveProps =\n        typeof instance.componentDidReceiveProps !== \"function\";\n      warning(\n        noComponentDidReceiveProps,\n        \"%s has a method called \" +\n          \"componentDidReceiveProps(). But there is no such lifecycle method. \" +\n          \"If you meant to update the state in response to changing props, \" +\n          \"use componentWillReceiveProps(). If you meant to fetch data or \" +\n          \"run side-effects or mutations after React has updated the UI, use componentDidUpdate().\",\n        name\n      );\n      var noComponentWillRecieveProps =\n        typeof instance.componentWillRecieveProps !== \"function\";\n      warning(\n        noComponentWillRecieveProps,\n        \"%s has a method called \" +\n          \"componentWillRecieveProps(). Did you mean componentWillReceiveProps()?\",\n        name\n      );\n      var hasMutatedProps = instance.props !== workInProgress.pendingProps;\n      warning(\n        instance.props === undefined || !hasMutatedProps,\n        \"%s(...): When calling super() in `%s`, make sure to pass \" +\n          \"up the same props that your component's constructor was passed.\",\n        name,\n        name\n      );\n      var noInstanceDefaultProps = !instance.defaultProps;\n      warning(\n        noInstanceDefaultProps,\n        \"Setting defaultProps as an instance property on %s is not supported and will be ignored.\" +\n          \" Instead, define defaultProps as a static property on %s.\",\n        name,\n        name\n      );\n    }\n\n    var state = instance.state;\n    if (state && (typeof state !== \"object\" || isArray(state))) {\n      warning(\n        false,\n        \"%s.state: must be set to an object or null\",\n        getComponentName(workInProgress)\n      );\n    }\n    if (typeof instance.getChildContext === \"function\") {\n      warning(\n        typeof workInProgress.type.childContextTypes === \"object\",\n        \"%s.getChildContext(): childContextTypes must be defined in order to \" +\n          \"use getChildContext().\",\n        getComponentName(workInProgress)\n      );\n    }\n  }\n\n  function resetInputPointers(workInProgress, instance) {\n    instance.props = workInProgress.memoizedProps;\n    instance.state = workInProgress.memoizedState;\n  }\n\n  function adoptClassInstance(workInProgress, instance) {\n    instance.updater = updater;\n    workInProgress.stateNode = instance;\n    // The instance needs access to the fiber so that it can schedule updates\n    set(instance, workInProgress);\n    {\n      instance._reactInternalInstance = fakeInternalInstance;\n    }\n  }\n\n  function constructClassInstance(workInProgress, props) {\n    var ctor = workInProgress.type;\n    var unmaskedContext = getUnmaskedContext(workInProgress);\n    var needsContext = isContextConsumer(workInProgress);\n    var context = needsContext\n      ? getMaskedContext(workInProgress, unmaskedContext)\n      : emptyObject;\n    var instance = new ctor(props, context);\n    adoptClassInstance(workInProgress, instance);\n\n    // Cache unmasked context so we can avoid recreating masked context unless necessary.\n    // ReactFiberContext usually updates this cache but can't for newly-created instances.\n    if (needsContext) {\n      cacheContext(workInProgress, unmaskedContext, context);\n    }\n\n    return instance;\n  }\n\n  function callComponentWillMount(workInProgress, instance) {\n    startPhaseTimer(workInProgress, \"componentWillMount\");\n    var oldState = instance.state;\n    instance.componentWillMount();\n    stopPhaseTimer();\n\n    // Simulate an async bailout/interruption by invoking lifecycle twice.\n    if (debugRenderPhaseSideEffects) {\n      instance.componentWillMount();\n    }\n\n    if (oldState !== instance.state) {\n      {\n        warning(\n          false,\n          \"%s.componentWillMount(): Assigning directly to this.state is \" +\n            \"deprecated (except inside a component's \" +\n            \"constructor). Use setState instead.\",\n          getComponentName(workInProgress)\n        );\n      }\n      updater.enqueueReplaceState(instance, instance.state, null);\n    }\n  }\n\n  function callComponentWillReceiveProps(\n    workInProgress,\n    instance,\n    newProps,\n    newContext\n  ) {\n    startPhaseTimer(workInProgress, \"componentWillReceiveProps\");\n    var oldState = instance.state;\n    instance.componentWillReceiveProps(newProps, newContext);\n    stopPhaseTimer();\n\n    // Simulate an async bailout/interruption by invoking lifecycle twice.\n    if (debugRenderPhaseSideEffects) {\n      instance.componentWillReceiveProps(newProps, newContext);\n    }\n\n    if (instance.state !== oldState) {\n      {\n        var componentName = getComponentName(workInProgress) || \"Component\";\n        if (!didWarnAboutStateAssignmentForComponent[componentName]) {\n          warning(\n            false,\n            \"%s.componentWillReceiveProps(): Assigning directly to \" +\n              \"this.state is deprecated (except inside a component's \" +\n              \"constructor). Use setState instead.\",\n            componentName\n          );\n          didWarnAboutStateAssignmentForComponent[componentName] = true;\n        }\n      }\n      updater.enqueueReplaceState(instance, instance.state, null);\n    }\n  }\n\n  // Invokes the mount life-cycles on a previously never rendered instance.\n  function mountClassInstance(workInProgress, renderExpirationTime) {\n    var current = workInProgress.alternate;\n\n    {\n      checkClassInstance(workInProgress);\n    }\n\n    var instance = workInProgress.stateNode;\n    var state = instance.state || null;\n    var props = workInProgress.pendingProps;\n    var unmaskedContext = getUnmaskedContext(workInProgress);\n\n    instance.props = props;\n    instance.state = workInProgress.memoizedState = state;\n    instance.refs = emptyObject;\n    instance.context = getMaskedContext(workInProgress, unmaskedContext);\n\n    if (\n      enableAsyncSubtreeAPI &&\n      workInProgress.type != null &&\n      workInProgress.type.prototype != null &&\n      workInProgress.type.prototype.unstable_isAsyncReactComponent === true\n    ) {\n      workInProgress.internalContextTag |= AsyncUpdates;\n    }\n\n    if (typeof instance.componentWillMount === \"function\") {\n      callComponentWillMount(workInProgress, instance);\n      // If we had additional state updates during this life-cycle, let's\n      // process them now.\n      var updateQueue = workInProgress.updateQueue;\n      if (updateQueue !== null) {\n        instance.state = processUpdateQueue(\n          current,\n          workInProgress,\n          updateQueue,\n          instance,\n          props,\n          renderExpirationTime\n        );\n      }\n    }\n    if (typeof instance.componentDidMount === \"function\") {\n      workInProgress.effectTag |= Update;\n    }\n  }\n\n  // Called on a preexisting class instance. Returns false if a resumed render\n  // could be reused.\n  // function resumeMountClassInstance(\n  //   workInProgress: Fiber,\n  //   priorityLevel: PriorityLevel,\n  // ): boolean {\n  //   const instance = workInProgress.stateNode;\n  //   resetInputPointers(workInProgress, instance);\n\n  //   let newState = workInProgress.memoizedState;\n  //   let newProps = workInProgress.pendingProps;\n  //   if (!newProps) {\n  //     // If there isn't any new props, then we'll reuse the memoized props.\n  //     // This could be from already completed work.\n  //     newProps = workInProgress.memoizedProps;\n  //     invariant(\n  //       newProps != null,\n  //       'There should always be pending or memoized props. This error is ' +\n  //         'likely caused by a bug in React. Please file an issue.',\n  //     );\n  //   }\n  //   const newUnmaskedContext = getUnmaskedContext(workInProgress);\n  //   const newContext = getMaskedContext(workInProgress, newUnmaskedContext);\n\n  //   const oldContext = instance.context;\n  //   const oldProps = workInProgress.memoizedProps;\n\n  //   if (\n  //     typeof instance.componentWillReceiveProps === 'function' &&\n  //     (oldProps !== newProps || oldContext !== newContext)\n  //   ) {\n  //     callComponentWillReceiveProps(\n  //       workInProgress,\n  //       instance,\n  //       newProps,\n  //       newContext,\n  //     );\n  //   }\n\n  //   // Process the update queue before calling shouldComponentUpdate\n  //   const updateQueue = workInProgress.updateQueue;\n  //   if (updateQueue !== null) {\n  //     newState = processUpdateQueue(\n  //       workInProgress,\n  //       updateQueue,\n  //       instance,\n  //       newState,\n  //       newProps,\n  //       priorityLevel,\n  //     );\n  //   }\n\n  //   // TODO: Should we deal with a setState that happened after the last\n  //   // componentWillMount and before this componentWillMount? Probably\n  //   // unsupported anyway.\n\n  //   if (\n  //     !checkShouldComponentUpdate(\n  //       workInProgress,\n  //       workInProgress.memoizedProps,\n  //       newProps,\n  //       workInProgress.memoizedState,\n  //       newState,\n  //       newContext,\n  //     )\n  //   ) {\n  //     // Update the existing instance's state, props, and context pointers even\n  //     // though we're bailing out.\n  //     instance.props = newProps;\n  //     instance.state = newState;\n  //     instance.context = newContext;\n  //     return false;\n  //   }\n\n  //   // Update the input pointers now so that they are correct when we call\n  //   // componentWillMount\n  //   instance.props = newProps;\n  //   instance.state = newState;\n  //   instance.context = newContext;\n\n  //   if (typeof instance.componentWillMount === 'function') {\n  //     callComponentWillMount(workInProgress, instance);\n  //     // componentWillMount may have called setState. Process the update queue.\n  //     const newUpdateQueue = workInProgress.updateQueue;\n  //     if (newUpdateQueue !== null) {\n  //       newState = processUpdateQueue(\n  //         workInProgress,\n  //         newUpdateQueue,\n  //         instance,\n  //         newState,\n  //         newProps,\n  //         priorityLevel,\n  //       );\n  //     }\n  //   }\n\n  //   if (typeof instance.componentDidMount === 'function') {\n  //     workInProgress.effectTag |= Update;\n  //   }\n\n  //   instance.state = newState;\n\n  //   return true;\n  // }\n\n  // Invokes the update life-cycles and returns false if it shouldn't rerender.\n  function updateClassInstance(current, workInProgress, renderExpirationTime) {\n    var instance = workInProgress.stateNode;\n    resetInputPointers(workInProgress, instance);\n\n    var oldProps = workInProgress.memoizedProps;\n    var newProps = workInProgress.pendingProps;\n    var oldContext = instance.context;\n    var newUnmaskedContext = getUnmaskedContext(workInProgress);\n    var newContext = getMaskedContext(workInProgress, newUnmaskedContext);\n\n    // Note: During these life-cycles, instance.props/instance.state are what\n    // ever the previously attempted to render - not the \"current\". However,\n    // during componentDidUpdate we pass the \"current\" props.\n\n    if (\n      typeof instance.componentWillReceiveProps === \"function\" &&\n      (oldProps !== newProps || oldContext !== newContext)\n    ) {\n      callComponentWillReceiveProps(\n        workInProgress,\n        instance,\n        newProps,\n        newContext\n      );\n    }\n\n    // Compute the next state using the memoized state and the update queue.\n    var oldState = workInProgress.memoizedState;\n    // TODO: Previous state can be null.\n    var newState = void 0;\n    if (workInProgress.updateQueue !== null) {\n      newState = processUpdateQueue(\n        current,\n        workInProgress,\n        workInProgress.updateQueue,\n        instance,\n        newProps,\n        renderExpirationTime\n      );\n    } else {\n      newState = oldState;\n    }\n\n    if (\n      oldProps === newProps &&\n      oldState === newState &&\n      !hasContextChanged() &&\n      !(\n        workInProgress.updateQueue !== null &&\n        workInProgress.updateQueue.hasForceUpdate\n      )\n    ) {\n      // If an update was already in progress, we should schedule an Update\n      // effect even though we're bailing out, so that cWU/cDU are called.\n      if (typeof instance.componentDidUpdate === \"function\") {\n        if (\n          oldProps !== current.memoizedProps ||\n          oldState !== current.memoizedState\n        ) {\n          workInProgress.effectTag |= Update;\n        }\n      }\n      return false;\n    }\n\n    var shouldUpdate = checkShouldComponentUpdate(\n      workInProgress,\n      oldProps,\n      newProps,\n      oldState,\n      newState,\n      newContext\n    );\n\n    if (shouldUpdate) {\n      if (typeof instance.componentWillUpdate === \"function\") {\n        startPhaseTimer(workInProgress, \"componentWillUpdate\");\n        instance.componentWillUpdate(newProps, newState, newContext);\n        stopPhaseTimer();\n\n        // Simulate an async bailout/interruption by invoking lifecycle twice.\n        if (debugRenderPhaseSideEffects) {\n          instance.componentWillUpdate(newProps, newState, newContext);\n        }\n      }\n      if (typeof instance.componentDidUpdate === \"function\") {\n        workInProgress.effectTag |= Update;\n      }\n    } else {\n      // If an update was already in progress, we should schedule an Update\n      // effect even though we're bailing out, so that cWU/cDU are called.\n      if (typeof instance.componentDidUpdate === \"function\") {\n        if (\n          oldProps !== current.memoizedProps ||\n          oldState !== current.memoizedState\n        ) {\n          workInProgress.effectTag |= Update;\n        }\n      }\n\n      // If shouldComponentUpdate returned false, we should still update the\n      // memoized props/state to indicate that this work can be reused.\n      memoizeProps(workInProgress, newProps);\n      memoizeState(workInProgress, newState);\n    }\n\n    // Update the existing instance's state, props, and context pointers even\n    // if shouldComponentUpdate returns false.\n    instance.props = newProps;\n    instance.state = newState;\n    instance.context = newContext;\n\n    return shouldUpdate;\n  }\n\n  return {\n    adoptClassInstance: adoptClassInstance,\n    constructClassInstance: constructClassInstance,\n    mountClassInstance: mountClassInstance,\n    // resumeMountClassInstance,\n    updateClassInstance: updateClassInstance\n  };\n};\n\nvar getCurrentFiberStackAddendum$1 =\n  ReactDebugCurrentFiber.getCurrentFiberStackAddendum;\n\n{\n  var didWarnAboutMaps = false;\n  /**\n   * Warn if there's no key explicitly set on dynamic arrays of children or\n   * object keys are not valid. This allows us to keep track of children between\n   * updates.\n   */\n  var ownerHasKeyUseWarning = {};\n  var ownerHasFunctionTypeWarning = {};\n\n  var warnForMissingKey = function(child) {\n    if (child === null || typeof child !== \"object\") {\n      return;\n    }\n    if (!child._store || child._store.validated || child.key != null) {\n      return;\n    }\n    invariant(\n      typeof child._store === \"object\",\n      \"React Component in warnForMissingKey should have a _store. \" +\n        \"This error is likely caused by a bug in React. Please file an issue.\"\n    );\n    child._store.validated = true;\n\n    var currentComponentErrorInfo =\n      \"Each child in an array or iterator should have a unique \" +\n      '\"key\" prop. See https://fb.me/react-warning-keys for ' +\n      \"more information.\" +\n      (getCurrentFiberStackAddendum$1() || \"\");\n    if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n      return;\n    }\n    ownerHasKeyUseWarning[currentComponentErrorInfo] = true;\n\n    warning(\n      false,\n      \"Each child in an array or iterator should have a unique \" +\n        '\"key\" prop. See https://fb.me/react-warning-keys for ' +\n        \"more information.%s\",\n      getCurrentFiberStackAddendum$1()\n    );\n  };\n}\n\nvar isArray$1 = Array.isArray;\n\nfunction coerceRef(current, element) {\n  var mixedRef = element.ref;\n  if (mixedRef !== null && typeof mixedRef !== \"function\") {\n    if (element._owner) {\n      var owner = element._owner;\n      var inst = void 0;\n      if (owner) {\n        var ownerFiber = owner;\n        invariant(\n          ownerFiber.tag === ClassComponent,\n          \"Stateless function components cannot have refs.\"\n        );\n        inst = ownerFiber.stateNode;\n      }\n      invariant(\n        inst,\n        \"Missing owner for string ref %s. This error is likely caused by a \" +\n          \"bug in React. Please file an issue.\",\n        mixedRef\n      );\n      var stringRef = \"\" + mixedRef;\n      // Check if previous string ref matches new string ref\n      if (\n        current !== null &&\n        current.ref !== null &&\n        current.ref._stringRef === stringRef\n      ) {\n        return current.ref;\n      }\n      var ref = function(value) {\n        var refs = inst.refs === emptyObject ? (inst.refs = {}) : inst.refs;\n        if (value === null) {\n          delete refs[stringRef];\n        } else {\n          refs[stringRef] = value;\n        }\n      };\n      ref._stringRef = stringRef;\n      return ref;\n    } else {\n      invariant(\n        typeof mixedRef === \"string\",\n        \"Expected ref to be a function or a string.\"\n      );\n      invariant(\n        element._owner,\n        \"Element ref was specified as a string (%s) but no owner was \" +\n          \"set. You may have multiple copies of React loaded. \" +\n          \"(details: https://fb.me/react-refs-must-have-owner).\",\n        mixedRef\n      );\n    }\n  }\n  return mixedRef;\n}\n\nfunction throwOnInvalidObjectType(returnFiber, newChild) {\n  if (returnFiber.type !== \"textarea\") {\n    var addendum = \"\";\n    {\n      addendum =\n        \" If you meant to render a collection of children, use an array \" +\n        \"instead.\" +\n        (getCurrentFiberStackAddendum$1() || \"\");\n    }\n    invariant(\n      false,\n      \"Objects are not valid as a React child (found: %s).%s\",\n      Object.prototype.toString.call(newChild) === \"[object Object]\"\n        ? \"object with keys {\" + Object.keys(newChild).join(\", \") + \"}\"\n        : newChild,\n      addendum\n    );\n  }\n}\n\nfunction warnOnFunctionType() {\n  var currentComponentErrorInfo =\n    \"Functions are not valid as a React child. This may happen if \" +\n    \"you return a Component instead of <Component /> from render. \" +\n    \"Or maybe you meant to call this function rather than return it.\" +\n    (getCurrentFiberStackAddendum$1() || \"\");\n\n  if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {\n    return;\n  }\n  ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;\n\n  warning(\n    false,\n    \"Functions are not valid as a React child. This may happen if \" +\n      \"you return a Component instead of <Component /> from render. \" +\n      \"Or maybe you meant to call this function rather than return it.%s\",\n    getCurrentFiberStackAddendum$1() || \"\"\n  );\n}\n\n// This wrapper function exists because I expect to clone the code in each path\n// to be able to optimize each path individually by branching early. This needs\n// a compiler or we can do it manually. Helpers that don't need this branching\n// live outside of this function.\nfunction ChildReconciler(shouldTrackSideEffects) {\n  function deleteChild(returnFiber, childToDelete) {\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return;\n    }\n    // Deletions are added in reversed order so we add it to the front.\n    // At this point, the return fiber's effect list is empty except for\n    // deletions, so we can just append the deletion to the list. The remaining\n    // effects aren't added until the complete phase. Once we implement\n    // resuming, this may not be true.\n    var last = returnFiber.lastEffect;\n    if (last !== null) {\n      last.nextEffect = childToDelete;\n      returnFiber.lastEffect = childToDelete;\n    } else {\n      returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n    }\n    childToDelete.nextEffect = null;\n    childToDelete.effectTag = Deletion;\n  }\n\n  function deleteRemainingChildren(returnFiber, currentFirstChild) {\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return null;\n    }\n\n    // TODO: For the shouldClone case, this could be micro-optimized a bit by\n    // assuming that after the first child we've already added everything.\n    var childToDelete = currentFirstChild;\n    while (childToDelete !== null) {\n      deleteChild(returnFiber, childToDelete);\n      childToDelete = childToDelete.sibling;\n    }\n    return null;\n  }\n\n  function mapRemainingChildren(returnFiber, currentFirstChild) {\n    // Add the remaining children to a temporary map so that we can find them by\n    // keys quickly. Implicit (null) keys get added to this set with their index\n    var existingChildren = new Map();\n\n    var existingChild = currentFirstChild;\n    while (existingChild !== null) {\n      if (existingChild.key !== null) {\n        existingChildren.set(existingChild.key, existingChild);\n      } else {\n        existingChildren.set(existingChild.index, existingChild);\n      }\n      existingChild = existingChild.sibling;\n    }\n    return existingChildren;\n  }\n\n  function useFiber(fiber, pendingProps, expirationTime) {\n    // We currently set sibling to null and index to 0 here because it is easy\n    // to forget to do before returning it. E.g. for the single child case.\n    var clone = createWorkInProgress(fiber, pendingProps, expirationTime);\n    clone.index = 0;\n    clone.sibling = null;\n    return clone;\n  }\n\n  function placeChild(newFiber, lastPlacedIndex, newIndex) {\n    newFiber.index = newIndex;\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return lastPlacedIndex;\n    }\n    var current = newFiber.alternate;\n    if (current !== null) {\n      var oldIndex = current.index;\n      if (oldIndex < lastPlacedIndex) {\n        // This is a move.\n        newFiber.effectTag = Placement;\n        return lastPlacedIndex;\n      } else {\n        // This item can stay in place.\n        return oldIndex;\n      }\n    } else {\n      // This is an insertion.\n      newFiber.effectTag = Placement;\n      return lastPlacedIndex;\n    }\n  }\n\n  function placeSingleChild(newFiber) {\n    // This is simpler for the single child case. We only need to do a\n    // placement for inserting new children.\n    if (shouldTrackSideEffects && newFiber.alternate === null) {\n      newFiber.effectTag = Placement;\n    }\n    return newFiber;\n  }\n\n  function updateTextNode(returnFiber, current, textContent, expirationTime) {\n    if (current === null || current.tag !== HostText) {\n      // Insert\n      var created = createFiberFromText(\n        textContent,\n        returnFiber.internalContextTag,\n        expirationTime\n      );\n      created[\"return\"] = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, textContent, expirationTime);\n      existing[\"return\"] = returnFiber;\n      return existing;\n    }\n  }\n\n  function updateElement(returnFiber, current, element, expirationTime) {\n    if (current !== null && current.type === element.type) {\n      // Move based on index\n      var existing = useFiber(current, element.props, expirationTime);\n      existing.ref = coerceRef(current, element);\n      existing[\"return\"] = returnFiber;\n      {\n        existing._debugSource = element._source;\n        existing._debugOwner = element._owner;\n      }\n      return existing;\n    } else {\n      // Insert\n      var created = createFiberFromElement(\n        element,\n        returnFiber.internalContextTag,\n        expirationTime\n      );\n      created.ref = coerceRef(current, element);\n      created[\"return\"] = returnFiber;\n      return created;\n    }\n  }\n\n  function updateCall(returnFiber, current, call, expirationTime) {\n    // TODO: Should this also compare handler to determine whether to reuse?\n    if (current === null || current.tag !== CallComponent) {\n      // Insert\n      var created = createFiberFromCall(\n        call,\n        returnFiber.internalContextTag,\n        expirationTime\n      );\n      created[\"return\"] = returnFiber;\n      return created;\n    } else {\n      // Move based on index\n      var existing = useFiber(current, call, expirationTime);\n      existing[\"return\"] = returnFiber;\n      return existing;\n    }\n  }\n\n  function updateReturn(returnFiber, current, returnNode, expirationTime) {\n    if (current === null || current.tag !== ReturnComponent) {\n      // Insert\n      var created = createFiberFromReturn(\n        returnNode,\n        returnFiber.internalContextTag,\n        expirationTime\n      );\n      created.type = returnNode.value;\n      created[\"return\"] = returnFiber;\n      return created;\n    } else {\n      // Move based on index\n      var existing = useFiber(current, null, expirationTime);\n      existing.type = returnNode.value;\n      existing[\"return\"] = returnFiber;\n      return existing;\n    }\n  }\n\n  function updatePortal(returnFiber, current, portal, expirationTime) {\n    if (\n      current === null ||\n      current.tag !== HostPortal ||\n      current.stateNode.containerInfo !== portal.containerInfo ||\n      current.stateNode.implementation !== portal.implementation\n    ) {\n      // Insert\n      var created = createFiberFromPortal(\n        portal,\n        returnFiber.internalContextTag,\n        expirationTime\n      );\n      created[\"return\"] = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, portal.children || [], expirationTime);\n      existing[\"return\"] = returnFiber;\n      return existing;\n    }\n  }\n\n  function updateFragment(returnFiber, current, fragment, expirationTime, key) {\n    if (current === null || current.tag !== Fragment) {\n      // Insert\n      var created = createFiberFromFragment(\n        fragment,\n        returnFiber.internalContextTag,\n        expirationTime,\n        key\n      );\n      created[\"return\"] = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, fragment, expirationTime);\n      existing[\"return\"] = returnFiber;\n      return existing;\n    }\n  }\n\n  function createChild(returnFiber, newChild, expirationTime) {\n    if (typeof newChild === \"string\" || typeof newChild === \"number\") {\n      // Text nodes don't have keys. If the previous node is implicitly keyed\n      // we can continue to replace it without aborting even if it is not a text\n      // node.\n      var created = createFiberFromText(\n        \"\" + newChild,\n        returnFiber.internalContextTag,\n        expirationTime\n      );\n      created[\"return\"] = returnFiber;\n      return created;\n    }\n\n    if (typeof newChild === \"object\" && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE: {\n          if (newChild.type === REACT_FRAGMENT_TYPE) {\n            var _created = createFiberFromFragment(\n              newChild.props.children,\n              returnFiber.internalContextTag,\n              expirationTime,\n              newChild.key\n            );\n            _created[\"return\"] = returnFiber;\n            return _created;\n          } else {\n            var _created2 = createFiberFromElement(\n              newChild,\n              returnFiber.internalContextTag,\n              expirationTime\n            );\n            _created2.ref = coerceRef(null, newChild);\n            _created2[\"return\"] = returnFiber;\n            return _created2;\n          }\n        }\n\n        case REACT_CALL_TYPE: {\n          var _created3 = createFiberFromCall(\n            newChild,\n            returnFiber.internalContextTag,\n            expirationTime\n          );\n          _created3[\"return\"] = returnFiber;\n          return _created3;\n        }\n\n        case REACT_RETURN_TYPE: {\n          var _created4 = createFiberFromReturn(\n            newChild,\n            returnFiber.internalContextTag,\n            expirationTime\n          );\n          _created4.type = newChild.value;\n          _created4[\"return\"] = returnFiber;\n          return _created4;\n        }\n\n        case REACT_PORTAL_TYPE: {\n          var _created5 = createFiberFromPortal(\n            newChild,\n            returnFiber.internalContextTag,\n            expirationTime\n          );\n          _created5[\"return\"] = returnFiber;\n          return _created5;\n        }\n      }\n\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        var _created6 = createFiberFromFragment(\n          newChild,\n          returnFiber.internalContextTag,\n          expirationTime,\n          null\n        );\n        _created6[\"return\"] = returnFiber;\n        return _created6;\n      }\n\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n\n    {\n      if (typeof newChild === \"function\") {\n        warnOnFunctionType();\n      }\n    }\n\n    return null;\n  }\n\n  function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {\n    // Update the fiber if the keys match, otherwise return null.\n\n    var key = oldFiber !== null ? oldFiber.key : null;\n\n    if (typeof newChild === \"string\" || typeof newChild === \"number\") {\n      // Text nodes don't have keys. If the previous node is implicitly keyed\n      // we can continue to replace it without aborting even if it is not a text\n      // node.\n      if (key !== null) {\n        return null;\n      }\n      return updateTextNode(\n        returnFiber,\n        oldFiber,\n        \"\" + newChild,\n        expirationTime\n      );\n    }\n\n    if (typeof newChild === \"object\" && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE: {\n          if (newChild.key === key) {\n            if (newChild.type === REACT_FRAGMENT_TYPE) {\n              return updateFragment(\n                returnFiber,\n                oldFiber,\n                newChild.props.children,\n                expirationTime,\n                key\n              );\n            }\n            return updateElement(\n              returnFiber,\n              oldFiber,\n              newChild,\n              expirationTime\n            );\n          } else {\n            return null;\n          }\n        }\n\n        case REACT_CALL_TYPE: {\n          if (newChild.key === key) {\n            return updateCall(returnFiber, oldFiber, newChild, expirationTime);\n          } else {\n            return null;\n          }\n        }\n\n        case REACT_RETURN_TYPE: {\n          // Returns don't have keys. If the previous node is implicitly keyed\n          // we can continue to replace it without aborting even if it is not a\n          // yield.\n          if (key === null) {\n            return updateReturn(\n              returnFiber,\n              oldFiber,\n              newChild,\n              expirationTime\n            );\n          } else {\n            return null;\n          }\n        }\n\n        case REACT_PORTAL_TYPE: {\n          if (newChild.key === key) {\n            return updatePortal(\n              returnFiber,\n              oldFiber,\n              newChild,\n              expirationTime\n            );\n          } else {\n            return null;\n          }\n        }\n      }\n\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        if (key !== null) {\n          return null;\n        }\n\n        return updateFragment(\n          returnFiber,\n          oldFiber,\n          newChild,\n          expirationTime,\n          null\n        );\n      }\n\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n\n    {\n      if (typeof newChild === \"function\") {\n        warnOnFunctionType();\n      }\n    }\n\n    return null;\n  }\n\n  function updateFromMap(\n    existingChildren,\n    returnFiber,\n    newIdx,\n    newChild,\n    expirationTime\n  ) {\n    if (typeof newChild === \"string\" || typeof newChild === \"number\") {\n      // Text nodes don't have keys, so we neither have to check the old nor\n      // new node for the key. If both are text nodes, they match.\n      var matchedFiber = existingChildren.get(newIdx) || null;\n      return updateTextNode(\n        returnFiber,\n        matchedFiber,\n        \"\" + newChild,\n        expirationTime\n      );\n    }\n\n    if (typeof newChild === \"object\" && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE: {\n          var _matchedFiber =\n            existingChildren.get(\n              newChild.key === null ? newIdx : newChild.key\n            ) || null;\n          if (newChild.type === REACT_FRAGMENT_TYPE) {\n            return updateFragment(\n              returnFiber,\n              _matchedFiber,\n              newChild.props.children,\n              expirationTime,\n              newChild.key\n            );\n          }\n          return updateElement(\n            returnFiber,\n            _matchedFiber,\n            newChild,\n            expirationTime\n          );\n        }\n\n        case REACT_CALL_TYPE: {\n          var _matchedFiber2 =\n            existingChildren.get(\n              newChild.key === null ? newIdx : newChild.key\n            ) || null;\n          return updateCall(\n            returnFiber,\n            _matchedFiber2,\n            newChild,\n            expirationTime\n          );\n        }\n\n        case REACT_RETURN_TYPE: {\n          // Returns don't have keys, so we neither have to check the old nor\n          // new node for the key. If both are returns, they match.\n          var _matchedFiber3 = existingChildren.get(newIdx) || null;\n          return updateReturn(\n            returnFiber,\n            _matchedFiber3,\n            newChild,\n            expirationTime\n          );\n        }\n\n        case REACT_PORTAL_TYPE: {\n          var _matchedFiber4 =\n            existingChildren.get(\n              newChild.key === null ? newIdx : newChild.key\n            ) || null;\n          return updatePortal(\n            returnFiber,\n            _matchedFiber4,\n            newChild,\n            expirationTime\n          );\n        }\n      }\n\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        var _matchedFiber5 = existingChildren.get(newIdx) || null;\n        return updateFragment(\n          returnFiber,\n          _matchedFiber5,\n          newChild,\n          expirationTime,\n          null\n        );\n      }\n\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n\n    {\n      if (typeof newChild === \"function\") {\n        warnOnFunctionType();\n      }\n    }\n\n    return null;\n  }\n\n  /**\n   * Warns if there is a duplicate or missing key\n   */\n  function warnOnInvalidKey(child, knownKeys) {\n    {\n      if (typeof child !== \"object\" || child === null) {\n        return knownKeys;\n      }\n      switch (child.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n        case REACT_CALL_TYPE:\n        case REACT_PORTAL_TYPE:\n          warnForMissingKey(child);\n          var key = child.key;\n          if (typeof key !== \"string\") {\n            break;\n          }\n          if (knownKeys === null) {\n            knownKeys = new Set();\n            knownKeys.add(key);\n            break;\n          }\n          if (!knownKeys.has(key)) {\n            knownKeys.add(key);\n            break;\n          }\n          warning(\n            false,\n            \"Encountered two children with the same key, `%s`. \" +\n              \"Keys should be unique so that components maintain their identity \" +\n              \"across updates. Non-unique keys may cause children to be \" +\n              \"duplicated and/or omitted — the behavior is unsupported and \" +\n              \"could change in a future version.%s\",\n            key,\n            getCurrentFiberStackAddendum$1()\n          );\n          break;\n        default:\n          break;\n      }\n    }\n    return knownKeys;\n  }\n\n  function reconcileChildrenArray(\n    returnFiber,\n    currentFirstChild,\n    newChildren,\n    expirationTime\n  ) {\n    // This algorithm can't optimize by searching from boths ends since we\n    // don't have backpointers on fibers. I'm trying to see how far we can get\n    // with that model. If it ends up not being worth the tradeoffs, we can\n    // add it later.\n\n    // Even with a two ended optimization, we'd want to optimize for the case\n    // where there are few changes and brute force the comparison instead of\n    // going for the Map. It'd like to explore hitting that path first in\n    // forward-only mode and only go for the Map once we notice that we need\n    // lots of look ahead. This doesn't handle reversal as well as two ended\n    // search but that's unusual. Besides, for the two ended optimization to\n    // work on Iterables, we'd need to copy the whole set.\n\n    // In this first iteration, we'll just live with hitting the bad case\n    // (adding everything to a Map) in for every insert/move.\n\n    // If you change this code, also update reconcileChildrenIterator() which\n    // uses the same algorithm.\n\n    {\n      // First, validate keys.\n      var knownKeys = null;\n      for (var i = 0; i < newChildren.length; i++) {\n        var child = newChildren[i];\n        knownKeys = warnOnInvalidKey(child, knownKeys);\n      }\n    }\n\n    var resultingFirstChild = null;\n    var previousNewFiber = null;\n\n    var oldFiber = currentFirstChild;\n    var lastPlacedIndex = 0;\n    var newIdx = 0;\n    var nextOldFiber = null;\n    for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {\n      if (oldFiber.index > newIdx) {\n        nextOldFiber = oldFiber;\n        oldFiber = null;\n      } else {\n        nextOldFiber = oldFiber.sibling;\n      }\n      var newFiber = updateSlot(\n        returnFiber,\n        oldFiber,\n        newChildren[newIdx],\n        expirationTime\n      );\n      if (newFiber === null) {\n        // TODO: This breaks on empty slots like null children. That's\n        // unfortunate because it triggers the slow path all the time. We need\n        // a better way to communicate whether this was a miss or null,\n        // boolean, undefined, etc.\n        if (oldFiber === null) {\n          oldFiber = nextOldFiber;\n        }\n        break;\n      }\n      if (shouldTrackSideEffects) {\n        if (oldFiber && newFiber.alternate === null) {\n          // We matched the slot, but we didn't reuse the existing fiber, so we\n          // need to delete the existing child.\n          deleteChild(returnFiber, oldFiber);\n        }\n      }\n      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n      if (previousNewFiber === null) {\n        // TODO: Move out of the loop. This only happens for the first run.\n        resultingFirstChild = newFiber;\n      } else {\n        // TODO: Defer siblings if we're not at the right index for this slot.\n        // I.e. if we had null values before, then we want to defer this\n        // for each null value. However, we also don't want to call updateSlot\n        // with the previous one.\n        previousNewFiber.sibling = newFiber;\n      }\n      previousNewFiber = newFiber;\n      oldFiber = nextOldFiber;\n    }\n\n    if (newIdx === newChildren.length) {\n      // We've reached the end of the new children. We can delete the rest.\n      deleteRemainingChildren(returnFiber, oldFiber);\n      return resultingFirstChild;\n    }\n\n    if (oldFiber === null) {\n      // If we don't have any more existing children we can choose a fast path\n      // since the rest will all be insertions.\n      for (; newIdx < newChildren.length; newIdx++) {\n        var _newFiber = createChild(\n          returnFiber,\n          newChildren[newIdx],\n          expirationTime\n        );\n        if (!_newFiber) {\n          continue;\n        }\n        lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          // TODO: Move out of the loop. This only happens for the first run.\n          resultingFirstChild = _newFiber;\n        } else {\n          previousNewFiber.sibling = _newFiber;\n        }\n        previousNewFiber = _newFiber;\n      }\n      return resultingFirstChild;\n    }\n\n    // Add all children to a key map for quick lookups.\n    var existingChildren = mapRemainingChildren(returnFiber, oldFiber);\n\n    // Keep scanning and use the map to restore deleted items as moves.\n    for (; newIdx < newChildren.length; newIdx++) {\n      var _newFiber2 = updateFromMap(\n        existingChildren,\n        returnFiber,\n        newIdx,\n        newChildren[newIdx],\n        expirationTime\n      );\n      if (_newFiber2) {\n        if (shouldTrackSideEffects) {\n          if (_newFiber2.alternate !== null) {\n            // The new fiber is a work in progress, but if there exists a\n            // current, that means that we reused the fiber. We need to delete\n            // it from the child list so that we don't add it to the deletion\n            // list.\n            existingChildren[\"delete\"](\n              _newFiber2.key === null ? newIdx : _newFiber2.key\n            );\n          }\n        }\n        lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          resultingFirstChild = _newFiber2;\n        } else {\n          previousNewFiber.sibling = _newFiber2;\n        }\n        previousNewFiber = _newFiber2;\n      }\n    }\n\n    if (shouldTrackSideEffects) {\n      // Any existing children that weren't consumed above were deleted. We need\n      // to add them to the deletion list.\n      existingChildren.forEach(function(child) {\n        return deleteChild(returnFiber, child);\n      });\n    }\n\n    return resultingFirstChild;\n  }\n\n  function reconcileChildrenIterator(\n    returnFiber,\n    currentFirstChild,\n    newChildrenIterable,\n    expirationTime\n  ) {\n    // This is the same implementation as reconcileChildrenArray(),\n    // but using the iterator instead.\n\n    var iteratorFn = getIteratorFn(newChildrenIterable);\n    invariant(\n      typeof iteratorFn === \"function\",\n      \"An object is not an iterable. This error is likely caused by a bug in \" +\n        \"React. Please file an issue.\"\n    );\n\n    {\n      // Warn about using Maps as children\n      if (typeof newChildrenIterable.entries === \"function\") {\n        var possibleMap = newChildrenIterable;\n        if (possibleMap.entries === iteratorFn) {\n          warning(\n            didWarnAboutMaps,\n            \"Using Maps as children is unsupported and will likely yield \" +\n              \"unexpected results. Convert it to a sequence/iterable of keyed \" +\n              \"ReactElements instead.%s\",\n            getCurrentFiberStackAddendum$1()\n          );\n          didWarnAboutMaps = true;\n        }\n      }\n\n      // First, validate keys.\n      // We'll get a different iterator later for the main pass.\n      var _newChildren = iteratorFn.call(newChildrenIterable);\n      if (_newChildren) {\n        var knownKeys = null;\n        var _step = _newChildren.next();\n        for (; !_step.done; _step = _newChildren.next()) {\n          var child = _step.value;\n          knownKeys = warnOnInvalidKey(child, knownKeys);\n        }\n      }\n    }\n\n    var newChildren = iteratorFn.call(newChildrenIterable);\n    invariant(newChildren != null, \"An iterable object provided no iterator.\");\n\n    var resultingFirstChild = null;\n    var previousNewFiber = null;\n\n    var oldFiber = currentFirstChild;\n    var lastPlacedIndex = 0;\n    var newIdx = 0;\n    var nextOldFiber = null;\n\n    var step = newChildren.next();\n    for (\n      ;\n      oldFiber !== null && !step.done;\n      newIdx++, step = newChildren.next()\n    ) {\n      if (oldFiber.index > newIdx) {\n        nextOldFiber = oldFiber;\n        oldFiber = null;\n      } else {\n        nextOldFiber = oldFiber.sibling;\n      }\n      var newFiber = updateSlot(\n        returnFiber,\n        oldFiber,\n        step.value,\n        expirationTime\n      );\n      if (newFiber === null) {\n        // TODO: This breaks on empty slots like null children. That's\n        // unfortunate because it triggers the slow path all the time. We need\n        // a better way to communicate whether this was a miss or null,\n        // boolean, undefined, etc.\n        if (!oldFiber) {\n          oldFiber = nextOldFiber;\n        }\n        break;\n      }\n      if (shouldTrackSideEffects) {\n        if (oldFiber && newFiber.alternate === null) {\n          // We matched the slot, but we didn't reuse the existing fiber, so we\n          // need to delete the existing child.\n          deleteChild(returnFiber, oldFiber);\n        }\n      }\n      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n      if (previousNewFiber === null) {\n        // TODO: Move out of the loop. This only happens for the first run.\n        resultingFirstChild = newFiber;\n      } else {\n        // TODO: Defer siblings if we're not at the right index for this slot.\n        // I.e. if we had null values before, then we want to defer this\n        // for each null value. However, we also don't want to call updateSlot\n        // with the previous one.\n        previousNewFiber.sibling = newFiber;\n      }\n      previousNewFiber = newFiber;\n      oldFiber = nextOldFiber;\n    }\n\n    if (step.done) {\n      // We've reached the end of the new children. We can delete the rest.\n      deleteRemainingChildren(returnFiber, oldFiber);\n      return resultingFirstChild;\n    }\n\n    if (oldFiber === null) {\n      // If we don't have any more existing children we can choose a fast path\n      // since the rest will all be insertions.\n      for (; !step.done; newIdx++, step = newChildren.next()) {\n        var _newFiber3 = createChild(returnFiber, step.value, expirationTime);\n        if (_newFiber3 === null) {\n          continue;\n        }\n        lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          // TODO: Move out of the loop. This only happens for the first run.\n          resultingFirstChild = _newFiber3;\n        } else {\n          previousNewFiber.sibling = _newFiber3;\n        }\n        previousNewFiber = _newFiber3;\n      }\n      return resultingFirstChild;\n    }\n\n    // Add all children to a key map for quick lookups.\n    var existingChildren = mapRemainingChildren(returnFiber, oldFiber);\n\n    // Keep scanning and use the map to restore deleted items as moves.\n    for (; !step.done; newIdx++, step = newChildren.next()) {\n      var _newFiber4 = updateFromMap(\n        existingChildren,\n        returnFiber,\n        newIdx,\n        step.value,\n        expirationTime\n      );\n      if (_newFiber4 !== null) {\n        if (shouldTrackSideEffects) {\n          if (_newFiber4.alternate !== null) {\n            // The new fiber is a work in progress, but if there exists a\n            // current, that means that we reused the fiber. We need to delete\n            // it from the child list so that we don't add it to the deletion\n            // list.\n            existingChildren[\"delete\"](\n              _newFiber4.key === null ? newIdx : _newFiber4.key\n            );\n          }\n        }\n        lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          resultingFirstChild = _newFiber4;\n        } else {\n          previousNewFiber.sibling = _newFiber4;\n        }\n        previousNewFiber = _newFiber4;\n      }\n    }\n\n    if (shouldTrackSideEffects) {\n      // Any existing children that weren't consumed above were deleted. We need\n      // to add them to the deletion list.\n      existingChildren.forEach(function(child) {\n        return deleteChild(returnFiber, child);\n      });\n    }\n\n    return resultingFirstChild;\n  }\n\n  function reconcileSingleTextNode(\n    returnFiber,\n    currentFirstChild,\n    textContent,\n    expirationTime\n  ) {\n    // There's no need to check for keys on text nodes since we don't have a\n    // way to define them.\n    if (currentFirstChild !== null && currentFirstChild.tag === HostText) {\n      // We already have an existing node so let's just update it and delete\n      // the rest.\n      deleteRemainingChildren(returnFiber, currentFirstChild.sibling);\n      var existing = useFiber(currentFirstChild, textContent, expirationTime);\n      existing[\"return\"] = returnFiber;\n      return existing;\n    }\n    // The existing first child is not a text node so we need to create one\n    // and delete the existing ones.\n    deleteRemainingChildren(returnFiber, currentFirstChild);\n    var created = createFiberFromText(\n      textContent,\n      returnFiber.internalContextTag,\n      expirationTime\n    );\n    created[\"return\"] = returnFiber;\n    return created;\n  }\n\n  function reconcileSingleElement(\n    returnFiber,\n    currentFirstChild,\n    element,\n    expirationTime\n  ) {\n    var key = element.key;\n    var child = currentFirstChild;\n    while (child !== null) {\n      // TODO: If key === null and child.key === null, then this only applies to\n      // the first item in the list.\n      if (child.key === key) {\n        if (\n          child.tag === Fragment\n            ? element.type === REACT_FRAGMENT_TYPE\n            : child.type === element.type\n        ) {\n          deleteRemainingChildren(returnFiber, child.sibling);\n          var existing = useFiber(\n            child,\n            element.type === REACT_FRAGMENT_TYPE\n              ? element.props.children\n              : element.props,\n            expirationTime\n          );\n          existing.ref = coerceRef(child, element);\n          existing[\"return\"] = returnFiber;\n          {\n            existing._debugSource = element._source;\n            existing._debugOwner = element._owner;\n          }\n          return existing;\n        } else {\n          deleteRemainingChildren(returnFiber, child);\n          break;\n        }\n      } else {\n        deleteChild(returnFiber, child);\n      }\n      child = child.sibling;\n    }\n\n    if (element.type === REACT_FRAGMENT_TYPE) {\n      var created = createFiberFromFragment(\n        element.props.children,\n        returnFiber.internalContextTag,\n        expirationTime,\n        element.key\n      );\n      created[\"return\"] = returnFiber;\n      return created;\n    } else {\n      var _created7 = createFiberFromElement(\n        element,\n        returnFiber.internalContextTag,\n        expirationTime\n      );\n      _created7.ref = coerceRef(currentFirstChild, element);\n      _created7[\"return\"] = returnFiber;\n      return _created7;\n    }\n  }\n\n  function reconcileSingleCall(\n    returnFiber,\n    currentFirstChild,\n    call,\n    expirationTime\n  ) {\n    var key = call.key;\n    var child = currentFirstChild;\n    while (child !== null) {\n      // TODO: If key === null and child.key === null, then this only applies to\n      // the first item in the list.\n      if (child.key === key) {\n        if (child.tag === CallComponent) {\n          deleteRemainingChildren(returnFiber, child.sibling);\n          var existing = useFiber(child, call, expirationTime);\n          existing[\"return\"] = returnFiber;\n          return existing;\n        } else {\n          deleteRemainingChildren(returnFiber, child);\n          break;\n        }\n      } else {\n        deleteChild(returnFiber, child);\n      }\n      child = child.sibling;\n    }\n\n    var created = createFiberFromCall(\n      call,\n      returnFiber.internalContextTag,\n      expirationTime\n    );\n    created[\"return\"] = returnFiber;\n    return created;\n  }\n\n  function reconcileSingleReturn(\n    returnFiber,\n    currentFirstChild,\n    returnNode,\n    expirationTime\n  ) {\n    // There's no need to check for keys on yields since they're stateless.\n    var child = currentFirstChild;\n    if (child !== null) {\n      if (child.tag === ReturnComponent) {\n        deleteRemainingChildren(returnFiber, child.sibling);\n        var existing = useFiber(child, null, expirationTime);\n        existing.type = returnNode.value;\n        existing[\"return\"] = returnFiber;\n        return existing;\n      } else {\n        deleteRemainingChildren(returnFiber, child);\n      }\n    }\n\n    var created = createFiberFromReturn(\n      returnNode,\n      returnFiber.internalContextTag,\n      expirationTime\n    );\n    created.type = returnNode.value;\n    created[\"return\"] = returnFiber;\n    return created;\n  }\n\n  function reconcileSinglePortal(\n    returnFiber,\n    currentFirstChild,\n    portal,\n    expirationTime\n  ) {\n    var key = portal.key;\n    var child = currentFirstChild;\n    while (child !== null) {\n      // TODO: If key === null and child.key === null, then this only applies to\n      // the first item in the list.\n      if (child.key === key) {\n        if (\n          child.tag === HostPortal &&\n          child.stateNode.containerInfo === portal.containerInfo &&\n          child.stateNode.implementation === portal.implementation\n        ) {\n          deleteRemainingChildren(returnFiber, child.sibling);\n          var existing = useFiber(child, portal.children || [], expirationTime);\n          existing[\"return\"] = returnFiber;\n          return existing;\n        } else {\n          deleteRemainingChildren(returnFiber, child);\n          break;\n        }\n      } else {\n        deleteChild(returnFiber, child);\n      }\n      child = child.sibling;\n    }\n\n    var created = createFiberFromPortal(\n      portal,\n      returnFiber.internalContextTag,\n      expirationTime\n    );\n    created[\"return\"] = returnFiber;\n    return created;\n  }\n\n  // This API will tag the children with the side-effect of the reconciliation\n  // itself. They will be added to the side-effect list as we pass through the\n  // children and the parent.\n  function reconcileChildFibers(\n    returnFiber,\n    currentFirstChild,\n    newChild,\n    expirationTime\n  ) {\n    // This function is not recursive.\n    // If the top level item is an array, we treat it as a set of children,\n    // not as a fragment. Nested arrays on the other hand will be treated as\n    // fragment nodes. Recursion happens at the normal flow.\n\n    // Handle top level unkeyed fragments as if they were arrays.\n    // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n    // We treat the ambiguous cases above the same.\n    if (\n      typeof newChild === \"object\" &&\n      newChild !== null &&\n      newChild.type === REACT_FRAGMENT_TYPE &&\n      newChild.key === null\n    ) {\n      newChild = newChild.props.children;\n    }\n\n    // Handle object types\n    var isObject = typeof newChild === \"object\" && newChild !== null;\n\n    if (isObject) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          return placeSingleChild(\n            reconcileSingleElement(\n              returnFiber,\n              currentFirstChild,\n              newChild,\n              expirationTime\n            )\n          );\n\n        case REACT_CALL_TYPE:\n          return placeSingleChild(\n            reconcileSingleCall(\n              returnFiber,\n              currentFirstChild,\n              newChild,\n              expirationTime\n            )\n          );\n        case REACT_RETURN_TYPE:\n          return placeSingleChild(\n            reconcileSingleReturn(\n              returnFiber,\n              currentFirstChild,\n              newChild,\n              expirationTime\n            )\n          );\n        case REACT_PORTAL_TYPE:\n          return placeSingleChild(\n            reconcileSinglePortal(\n              returnFiber,\n              currentFirstChild,\n              newChild,\n              expirationTime\n            )\n          );\n      }\n    }\n\n    if (typeof newChild === \"string\" || typeof newChild === \"number\") {\n      return placeSingleChild(\n        reconcileSingleTextNode(\n          returnFiber,\n          currentFirstChild,\n          \"\" + newChild,\n          expirationTime\n        )\n      );\n    }\n\n    if (isArray$1(newChild)) {\n      return reconcileChildrenArray(\n        returnFiber,\n        currentFirstChild,\n        newChild,\n        expirationTime\n      );\n    }\n\n    if (getIteratorFn(newChild)) {\n      return reconcileChildrenIterator(\n        returnFiber,\n        currentFirstChild,\n        newChild,\n        expirationTime\n      );\n    }\n\n    if (isObject) {\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n\n    {\n      if (typeof newChild === \"function\") {\n        warnOnFunctionType();\n      }\n    }\n    if (typeof newChild === \"undefined\") {\n      // If the new child is undefined, and the return fiber is a composite\n      // component, throw an error. If Fiber return types are disabled,\n      // we already threw above.\n      switch (returnFiber.tag) {\n        case ClassComponent: {\n          {\n            var instance = returnFiber.stateNode;\n            if (instance.render._isMockFunction) {\n              // We allow auto-mocks to proceed as if they're returning null.\n              break;\n            }\n          }\n        }\n        // Intentionally fall through to the next case, which handles both\n        // functions and classes\n        // eslint-disable-next-lined no-fallthrough\n        case FunctionalComponent: {\n          var Component = returnFiber.type;\n          invariant(\n            false,\n            \"%s(...): Nothing was returned from render. This usually means a \" +\n              \"return statement is missing. Or, to render nothing, \" +\n              \"return null.\",\n            Component.displayName || Component.name || \"Component\"\n          );\n        }\n      }\n    }\n\n    // Remaining cases are all treated as empty.\n    return deleteRemainingChildren(returnFiber, currentFirstChild);\n  }\n\n  return reconcileChildFibers;\n}\n\nvar reconcileChildFibers = ChildReconciler(true);\nvar mountChildFibers = ChildReconciler(false);\n\nfunction cloneChildFibers(current, workInProgress) {\n  invariant(\n    current === null || workInProgress.child === current.child,\n    \"Resuming work not yet implemented.\"\n  );\n\n  if (workInProgress.child === null) {\n    return;\n  }\n\n  var currentChild = workInProgress.child;\n  var newChild = createWorkInProgress(\n    currentChild,\n    currentChild.pendingProps,\n    currentChild.expirationTime\n  );\n  workInProgress.child = newChild;\n\n  newChild[\"return\"] = workInProgress;\n  while (currentChild.sibling !== null) {\n    currentChild = currentChild.sibling;\n    newChild = newChild.sibling = createWorkInProgress(\n      currentChild,\n      currentChild.pendingProps,\n      currentChild.expirationTime\n    );\n    newChild[\"return\"] = workInProgress;\n  }\n  newChild.sibling = null;\n}\n\n{\n  var warnedAboutStatelessRefs = {};\n}\n\nvar ReactFiberBeginWork = function(\n  config,\n  hostContext,\n  hydrationContext,\n  scheduleWork,\n  computeExpirationForFiber\n) {\n  var shouldSetTextContent = config.shouldSetTextContent,\n    useSyncScheduling = config.useSyncScheduling,\n    shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree;\n  var pushHostContext = hostContext.pushHostContext,\n    pushHostContainer = hostContext.pushHostContainer;\n  var enterHydrationState = hydrationContext.enterHydrationState,\n    resetHydrationState = hydrationContext.resetHydrationState,\n    tryToClaimNextHydratableInstance =\n      hydrationContext.tryToClaimNextHydratableInstance;\n\n  var _ReactFiberClassCompo = ReactFiberClassComponent(\n      scheduleWork,\n      computeExpirationForFiber,\n      memoizeProps,\n      memoizeState\n    ),\n    adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance,\n    constructClassInstance = _ReactFiberClassCompo.constructClassInstance,\n    mountClassInstance = _ReactFiberClassCompo.mountClassInstance,\n    updateClassInstance = _ReactFiberClassCompo.updateClassInstance;\n\n  // TODO: Remove this and use reconcileChildrenAtExpirationTime directly.\n\n  function reconcileChildren(current, workInProgress, nextChildren) {\n    reconcileChildrenAtExpirationTime(\n      current,\n      workInProgress,\n      nextChildren,\n      workInProgress.expirationTime\n    );\n  }\n\n  function reconcileChildrenAtExpirationTime(\n    current,\n    workInProgress,\n    nextChildren,\n    renderExpirationTime\n  ) {\n    if (current === null) {\n      // If this is a fresh new component that hasn't been rendered yet, we\n      // won't update its child set by applying minimal side-effects. Instead,\n      // we will add them all to the child before it gets rendered. That means\n      // we can optimize this reconciliation pass by not tracking side-effects.\n      workInProgress.child = mountChildFibers(\n        workInProgress,\n        null,\n        nextChildren,\n        renderExpirationTime\n      );\n    } else {\n      // If the current child is the same as the work in progress, it means that\n      // we haven't yet started any work on these children. Therefore, we use\n      // the clone algorithm to create a copy of all the current children.\n\n      // If we had any progressed work already, that is invalid at this point so\n      // let's throw it out.\n      workInProgress.child = reconcileChildFibers(\n        workInProgress,\n        current.child,\n        nextChildren,\n        renderExpirationTime\n      );\n    }\n  }\n\n  function updateFragment(current, workInProgress) {\n    var nextChildren = workInProgress.pendingProps;\n    if (hasContextChanged()) {\n      // Normally we can bail out on props equality but if context has changed\n      // we don't do the bailout and we have to reuse existing props instead.\n    } else if (\n      nextChildren === null ||\n      workInProgress.memoizedProps === nextChildren\n    ) {\n      return bailoutOnAlreadyFinishedWork(current, workInProgress);\n    }\n    reconcileChildren(current, workInProgress, nextChildren);\n    memoizeProps(workInProgress, nextChildren);\n    return workInProgress.child;\n  }\n\n  function markRef(current, workInProgress) {\n    var ref = workInProgress.ref;\n    if (ref !== null && (!current || current.ref !== ref)) {\n      // Schedule a Ref effect\n      workInProgress.effectTag |= Ref;\n    }\n  }\n\n  function updateFunctionalComponent(current, workInProgress) {\n    var fn = workInProgress.type;\n    var nextProps = workInProgress.pendingProps;\n\n    if (hasContextChanged()) {\n      // Normally we can bail out on props equality but if context has changed\n      // we don't do the bailout and we have to reuse existing props instead.\n    } else {\n      if (workInProgress.memoizedProps === nextProps) {\n        return bailoutOnAlreadyFinishedWork(current, workInProgress);\n      }\n      // TODO: consider bringing fn.shouldComponentUpdate() back.\n      // It used to be here.\n    }\n\n    var unmaskedContext = getUnmaskedContext(workInProgress);\n    var context = getMaskedContext(workInProgress, unmaskedContext);\n\n    var nextChildren;\n\n    {\n      ReactCurrentOwner.current = workInProgress;\n      ReactDebugCurrentFiber.setCurrentPhase(\"render\");\n      nextChildren = fn(nextProps, context);\n      ReactDebugCurrentFiber.setCurrentPhase(null);\n    }\n    // React DevTools reads this flag.\n    workInProgress.effectTag |= PerformedWork;\n    reconcileChildren(current, workInProgress, nextChildren);\n    memoizeProps(workInProgress, nextProps);\n    return workInProgress.child;\n  }\n\n  function updateClassComponent(current, workInProgress, renderExpirationTime) {\n    // Push context providers early to prevent context stack mismatches.\n    // During mounting we don't know the child context yet as the instance doesn't exist.\n    // We will invalidate the child context in finishClassComponent() right after rendering.\n    var hasContext = pushContextProvider(workInProgress);\n\n    var shouldUpdate = void 0;\n    if (current === null) {\n      if (!workInProgress.stateNode) {\n        // In the initial pass we might need to construct the instance.\n        constructClassInstance(workInProgress, workInProgress.pendingProps);\n        mountClassInstance(workInProgress, renderExpirationTime);\n        shouldUpdate = true;\n      } else {\n        invariant(false, \"Resuming work not yet implemented.\");\n        // In a resume, we'll already have an instance we can reuse.\n        // shouldUpdate = resumeMountClassInstance(workInProgress, renderExpirationTime);\n      }\n    } else {\n      shouldUpdate = updateClassInstance(\n        current,\n        workInProgress,\n        renderExpirationTime\n      );\n    }\n    return finishClassComponent(\n      current,\n      workInProgress,\n      shouldUpdate,\n      hasContext\n    );\n  }\n\n  function finishClassComponent(\n    current,\n    workInProgress,\n    shouldUpdate,\n    hasContext\n  ) {\n    // Refs should update even if shouldComponentUpdate returns false\n    markRef(current, workInProgress);\n\n    if (!shouldUpdate) {\n      // Context providers should defer to sCU for rendering\n      if (hasContext) {\n        invalidateContextProvider(workInProgress, false);\n      }\n\n      return bailoutOnAlreadyFinishedWork(current, workInProgress);\n    }\n\n    var instance = workInProgress.stateNode;\n\n    // Rerender\n    ReactCurrentOwner.current = workInProgress;\n    var nextChildren = void 0;\n    {\n      ReactDebugCurrentFiber.setCurrentPhase(\"render\");\n      nextChildren = instance.render();\n      if (debugRenderPhaseSideEffects) {\n        instance.render();\n      }\n      ReactDebugCurrentFiber.setCurrentPhase(null);\n    }\n    // React DevTools reads this flag.\n    workInProgress.effectTag |= PerformedWork;\n    reconcileChildren(current, workInProgress, nextChildren);\n    // Memoize props and state using the values we just used to render.\n    // TODO: Restructure so we never read values from the instance.\n    memoizeState(workInProgress, instance.state);\n    memoizeProps(workInProgress, instance.props);\n\n    // The context might have changed so we need to recalculate it.\n    if (hasContext) {\n      invalidateContextProvider(workInProgress, true);\n    }\n\n    return workInProgress.child;\n  }\n\n  function pushHostRootContext(workInProgress) {\n    var root = workInProgress.stateNode;\n    if (root.pendingContext) {\n      pushTopLevelContextObject(\n        workInProgress,\n        root.pendingContext,\n        root.pendingContext !== root.context\n      );\n    } else if (root.context) {\n      // Should always be set\n      pushTopLevelContextObject(workInProgress, root.context, false);\n    }\n    pushHostContainer(workInProgress, root.containerInfo);\n  }\n\n  function updateHostRoot(current, workInProgress, renderExpirationTime) {\n    pushHostRootContext(workInProgress);\n    var updateQueue = workInProgress.updateQueue;\n    if (updateQueue !== null) {\n      var prevState = workInProgress.memoizedState;\n      var state = processUpdateQueue(\n        current,\n        workInProgress,\n        updateQueue,\n        null,\n        null,\n        renderExpirationTime\n      );\n      if (prevState === state) {\n        // If the state is the same as before, that's a bailout because we had\n        // no work that expires at this time.\n        resetHydrationState();\n        return bailoutOnAlreadyFinishedWork(current, workInProgress);\n      }\n      var element = state.element;\n      var root = workInProgress.stateNode;\n      if (\n        (current === null || current.child === null) &&\n        root.hydrate &&\n        enterHydrationState(workInProgress)\n      ) {\n        // If we don't have any current children this might be the first pass.\n        // We always try to hydrate. If this isn't a hydration pass there won't\n        // be any children to hydrate which is effectively the same thing as\n        // not hydrating.\n\n        // This is a bit of a hack. We track the host root as a placement to\n        // know that we're currently in a mounting state. That way isMounted\n        // works as expected. We must reset this before committing.\n        // TODO: Delete this when we delete isMounted and findDOMNode.\n        workInProgress.effectTag |= Placement;\n\n        // Ensure that children mount into this root without tracking\n        // side-effects. This ensures that we don't store Placement effects on\n        // nodes that will be hydrated.\n        workInProgress.child = mountChildFibers(\n          workInProgress,\n          null,\n          element,\n          renderExpirationTime\n        );\n      } else {\n        // Otherwise reset hydration state in case we aborted and resumed another\n        // root.\n        resetHydrationState();\n        reconcileChildren(current, workInProgress, element);\n      }\n      memoizeState(workInProgress, state);\n      return workInProgress.child;\n    }\n    resetHydrationState();\n    // If there is no update queue, that's a bailout because the root has no props.\n    return bailoutOnAlreadyFinishedWork(current, workInProgress);\n  }\n\n  function updateHostComponent(current, workInProgress, renderExpirationTime) {\n    pushHostContext(workInProgress);\n\n    if (current === null) {\n      tryToClaimNextHydratableInstance(workInProgress);\n    }\n\n    var type = workInProgress.type;\n    var memoizedProps = workInProgress.memoizedProps;\n    var nextProps = workInProgress.pendingProps;\n    var prevProps = current !== null ? current.memoizedProps : null;\n\n    if (hasContextChanged()) {\n      // Normally we can bail out on props equality but if context has changed\n      // we don't do the bailout and we have to reuse existing props instead.\n    } else if (memoizedProps === nextProps) {\n      return bailoutOnAlreadyFinishedWork(current, workInProgress);\n    }\n\n    var nextChildren = nextProps.children;\n    var isDirectTextChild = shouldSetTextContent(type, nextProps);\n\n    if (isDirectTextChild) {\n      // We special case a direct text child of a host node. This is a common\n      // case. We won't handle it as a reified child. We will instead handle\n      // this in the host environment that also have access to this prop. That\n      // avoids allocating another HostText fiber and traversing it.\n      nextChildren = null;\n    } else if (prevProps && shouldSetTextContent(type, prevProps)) {\n      // If we're switching from a direct text child to a normal child, or to\n      // empty, we need to schedule the text content to be reset.\n      workInProgress.effectTag |= ContentReset;\n    }\n\n    markRef(current, workInProgress);\n\n    // Check the host config to see if the children are offscreen/hidden.\n    if (\n      renderExpirationTime !== Never &&\n      !useSyncScheduling &&\n      shouldDeprioritizeSubtree(type, nextProps)\n    ) {\n      // Down-prioritize the children.\n      workInProgress.expirationTime = Never;\n      // Bailout and come back to this fiber later.\n      return null;\n    }\n\n    reconcileChildren(current, workInProgress, nextChildren);\n    memoizeProps(workInProgress, nextProps);\n    return workInProgress.child;\n  }\n\n  function updateHostText(current, workInProgress) {\n    if (current === null) {\n      tryToClaimNextHydratableInstance(workInProgress);\n    }\n    var nextProps = workInProgress.pendingProps;\n    memoizeProps(workInProgress, nextProps);\n    // Nothing to do here. This is terminal. We'll do the completion step\n    // immediately after.\n    return null;\n  }\n\n  function mountIndeterminateComponent(\n    current,\n    workInProgress,\n    renderExpirationTime\n  ) {\n    invariant(\n      current === null,\n      \"An indeterminate component should never have mounted. This error is \" +\n        \"likely caused by a bug in React. Please file an issue.\"\n    );\n    var fn = workInProgress.type;\n    var props = workInProgress.pendingProps;\n    var unmaskedContext = getUnmaskedContext(workInProgress);\n    var context = getMaskedContext(workInProgress, unmaskedContext);\n\n    var value;\n\n    {\n      if (fn.prototype && typeof fn.prototype.render === \"function\") {\n        var componentName = getComponentName(workInProgress);\n        warning(\n          false,\n          \"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" +\n            \"This is likely to cause errors. Change %s to extend React.Component instead.\",\n          componentName,\n          componentName\n        );\n      }\n      ReactCurrentOwner.current = workInProgress;\n      value = fn(props, context);\n    }\n    // React DevTools reads this flag.\n    workInProgress.effectTag |= PerformedWork;\n\n    if (\n      typeof value === \"object\" &&\n      value !== null &&\n      typeof value.render === \"function\"\n    ) {\n      // Proceed under the assumption that this is a class instance\n      workInProgress.tag = ClassComponent;\n\n      // Push context providers early to prevent context stack mismatches.\n      // During mounting we don't know the child context yet as the instance doesn't exist.\n      // We will invalidate the child context in finishClassComponent() right after rendering.\n      var hasContext = pushContextProvider(workInProgress);\n      adoptClassInstance(workInProgress, value);\n      mountClassInstance(workInProgress, renderExpirationTime);\n      return finishClassComponent(current, workInProgress, true, hasContext);\n    } else {\n      // Proceed under the assumption that this is a functional component\n      workInProgress.tag = FunctionalComponent;\n      {\n        var Component = workInProgress.type;\n\n        if (Component) {\n          warning(\n            !Component.childContextTypes,\n            \"%s(...): childContextTypes cannot be defined on a functional component.\",\n            Component.displayName || Component.name || \"Component\"\n          );\n        }\n        if (workInProgress.ref !== null) {\n          var info = \"\";\n          var ownerName = ReactDebugCurrentFiber.getCurrentFiberOwnerName();\n          if (ownerName) {\n            info += \"\\n\\nCheck the render method of `\" + ownerName + \"`.\";\n          }\n\n          var warningKey = ownerName || workInProgress._debugID || \"\";\n          var debugSource = workInProgress._debugSource;\n          if (debugSource) {\n            warningKey = debugSource.fileName + \":\" + debugSource.lineNumber;\n          }\n          if (!warnedAboutStatelessRefs[warningKey]) {\n            warnedAboutStatelessRefs[warningKey] = true;\n            warning(\n              false,\n              \"Stateless function components cannot be given refs. \" +\n                \"Attempts to access this ref will fail.%s%s\",\n              info,\n              ReactDebugCurrentFiber.getCurrentFiberStackAddendum()\n            );\n          }\n        }\n      }\n      reconcileChildren(current, workInProgress, value);\n      memoizeProps(workInProgress, props);\n      return workInProgress.child;\n    }\n  }\n\n  function updateCallComponent(current, workInProgress, renderExpirationTime) {\n    var nextCall = workInProgress.pendingProps;\n    if (hasContextChanged()) {\n      // Normally we can bail out on props equality but if context has changed\n      // we don't do the bailout and we have to reuse existing props instead.\n    } else if (workInProgress.memoizedProps === nextCall) {\n      nextCall = workInProgress.memoizedProps;\n      // TODO: When bailing out, we might need to return the stateNode instead\n      // of the child. To check it for work.\n      // return bailoutOnAlreadyFinishedWork(current, workInProgress);\n    }\n\n    var nextChildren = nextCall.children;\n\n    // The following is a fork of reconcileChildrenAtExpirationTime but using\n    // stateNode to store the child.\n    if (current === null) {\n      workInProgress.stateNode = mountChildFibers(\n        workInProgress,\n        workInProgress.stateNode,\n        nextChildren,\n        renderExpirationTime\n      );\n    } else {\n      workInProgress.stateNode = reconcileChildFibers(\n        workInProgress,\n        workInProgress.stateNode,\n        nextChildren,\n        renderExpirationTime\n      );\n    }\n\n    memoizeProps(workInProgress, nextCall);\n    // This doesn't take arbitrary time so we could synchronously just begin\n    // eagerly do the work of workInProgress.child as an optimization.\n    return workInProgress.stateNode;\n  }\n\n  function updatePortalComponent(\n    current,\n    workInProgress,\n    renderExpirationTime\n  ) {\n    pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n    var nextChildren = workInProgress.pendingProps;\n    if (hasContextChanged()) {\n      // Normally we can bail out on props equality but if context has changed\n      // we don't do the bailout and we have to reuse existing props instead.\n    } else if (workInProgress.memoizedProps === nextChildren) {\n      return bailoutOnAlreadyFinishedWork(current, workInProgress);\n    }\n\n    if (current === null) {\n      // Portals are special because we don't append the children during mount\n      // but at commit. Therefore we need to track insertions which the normal\n      // flow doesn't do during mount. This doesn't happen at the root because\n      // the root always starts with a \"current\" with a null child.\n      // TODO: Consider unifying this with how the root works.\n      workInProgress.child = reconcileChildFibers(\n        workInProgress,\n        null,\n        nextChildren,\n        renderExpirationTime\n      );\n      memoizeProps(workInProgress, nextChildren);\n    } else {\n      reconcileChildren(current, workInProgress, nextChildren);\n      memoizeProps(workInProgress, nextChildren);\n    }\n    return workInProgress.child;\n  }\n\n  /*\n  function reuseChildrenEffects(returnFiber : Fiber, firstChild : Fiber) {\n    let child = firstChild;\n    do {\n      // Ensure that the first and last effect of the parent corresponds\n      // to the children's first and last effect.\n      if (!returnFiber.firstEffect) {\n        returnFiber.firstEffect = child.firstEffect;\n      }\n      if (child.lastEffect) {\n        if (returnFiber.lastEffect) {\n          returnFiber.lastEffect.nextEffect = child.firstEffect;\n        }\n        returnFiber.lastEffect = child.lastEffect;\n      }\n    } while (child = child.sibling);\n  }\n  */\n\n  function bailoutOnAlreadyFinishedWork(current, workInProgress) {\n    cancelWorkTimer(workInProgress);\n\n    // TODO: We should ideally be able to bail out early if the children have no\n    // more work to do. However, since we don't have a separation of this\n    // Fiber's priority and its children yet - we don't know without doing lots\n    // of the same work we do anyway. Once we have that separation we can just\n    // bail out here if the children has no more work at this priority level.\n    // if (workInProgress.priorityOfChildren <= priorityLevel) {\n    //   // If there are side-effects in these children that have not yet been\n    //   // committed we need to ensure that they get properly transferred up.\n    //   if (current && current.child !== workInProgress.child) {\n    //     reuseChildrenEffects(workInProgress, child);\n    //   }\n    //   return null;\n    // }\n\n    cloneChildFibers(current, workInProgress);\n    return workInProgress.child;\n  }\n\n  function bailoutOnLowPriority(current, workInProgress) {\n    cancelWorkTimer(workInProgress);\n\n    // TODO: Handle HostComponent tags here as well and call pushHostContext()?\n    // See PR 8590 discussion for context\n    switch (workInProgress.tag) {\n      case HostRoot:\n        pushHostRootContext(workInProgress);\n        break;\n      case ClassComponent:\n        pushContextProvider(workInProgress);\n        break;\n      case HostPortal:\n        pushHostContainer(\n          workInProgress,\n          workInProgress.stateNode.containerInfo\n        );\n        break;\n    }\n    // TODO: What if this is currently in progress?\n    // How can that happen? How is this not being cloned?\n    return null;\n  }\n\n  // TODO: Delete memoizeProps/State and move to reconcile/bailout instead\n  function memoizeProps(workInProgress, nextProps) {\n    workInProgress.memoizedProps = nextProps;\n  }\n\n  function memoizeState(workInProgress, nextState) {\n    workInProgress.memoizedState = nextState;\n    // Don't reset the updateQueue, in case there are pending updates. Resetting\n    // is handled by processUpdateQueue.\n  }\n\n  function beginWork(current, workInProgress, renderExpirationTime) {\n    if (\n      workInProgress.expirationTime === NoWork ||\n      workInProgress.expirationTime > renderExpirationTime\n    ) {\n      return bailoutOnLowPriority(current, workInProgress);\n    }\n\n    switch (workInProgress.tag) {\n      case IndeterminateComponent:\n        return mountIndeterminateComponent(\n          current,\n          workInProgress,\n          renderExpirationTime\n        );\n      case FunctionalComponent:\n        return updateFunctionalComponent(current, workInProgress);\n      case ClassComponent:\n        return updateClassComponent(\n          current,\n          workInProgress,\n          renderExpirationTime\n        );\n      case HostRoot:\n        return updateHostRoot(current, workInProgress, renderExpirationTime);\n      case HostComponent:\n        return updateHostComponent(\n          current,\n          workInProgress,\n          renderExpirationTime\n        );\n      case HostText:\n        return updateHostText(current, workInProgress);\n      case CallHandlerPhase:\n        // This is a restart. Reset the tag to the initial phase.\n        workInProgress.tag = CallComponent;\n      // Intentionally fall through since this is now the same.\n      case CallComponent:\n        return updateCallComponent(\n          current,\n          workInProgress,\n          renderExpirationTime\n        );\n      case ReturnComponent:\n        // A return component is just a placeholder, we can just run through the\n        // next one immediately.\n        return null;\n      case HostPortal:\n        return updatePortalComponent(\n          current,\n          workInProgress,\n          renderExpirationTime\n        );\n      case Fragment:\n        return updateFragment(current, workInProgress);\n      default:\n        invariant(\n          false,\n          \"Unknown unit of work tag. This error is likely caused by a bug in \" +\n            \"React. Please file an issue.\"\n        );\n    }\n  }\n\n  function beginFailedWork(current, workInProgress, renderExpirationTime) {\n    // Push context providers here to avoid a push/pop context mismatch.\n    switch (workInProgress.tag) {\n      case ClassComponent:\n        pushContextProvider(workInProgress);\n        break;\n      case HostRoot:\n        pushHostRootContext(workInProgress);\n        break;\n      default:\n        invariant(\n          false,\n          \"Invalid type of work. This error is likely caused by a bug in React. \" +\n            \"Please file an issue.\"\n        );\n    }\n\n    // Add an error effect so we can handle the error during the commit phase\n    workInProgress.effectTag |= Err;\n\n    // This is a weird case where we do \"resume\" work — work that failed on\n    // our first attempt. Because we no longer have a notion of \"progressed\n    // deletions,\" reset the child to the current child to make sure we delete\n    // it again. TODO: Find a better way to handle this, perhaps during a more\n    // general overhaul of error handling.\n    if (current === null) {\n      workInProgress.child = null;\n    } else if (workInProgress.child !== current.child) {\n      workInProgress.child = current.child;\n    }\n\n    if (\n      workInProgress.expirationTime === NoWork ||\n      workInProgress.expirationTime > renderExpirationTime\n    ) {\n      return bailoutOnLowPriority(current, workInProgress);\n    }\n\n    // If we don't bail out, we're going be recomputing our children so we need\n    // to drop our effect list.\n    workInProgress.firstEffect = null;\n    workInProgress.lastEffect = null;\n\n    // Unmount the current children as if the component rendered null\n    var nextChildren = null;\n    reconcileChildrenAtExpirationTime(\n      current,\n      workInProgress,\n      nextChildren,\n      renderExpirationTime\n    );\n\n    if (workInProgress.tag === ClassComponent) {\n      var instance = workInProgress.stateNode;\n      workInProgress.memoizedProps = instance.props;\n      workInProgress.memoizedState = instance.state;\n    }\n\n    return workInProgress.child;\n  }\n\n  return {\n    beginWork: beginWork,\n    beginFailedWork: beginFailedWork\n  };\n};\n\nvar ReactFiberCompleteWork = function(config, hostContext, hydrationContext) {\n  var createInstance = config.createInstance,\n    createTextInstance = config.createTextInstance,\n    appendInitialChild = config.appendInitialChild,\n    finalizeInitialChildren = config.finalizeInitialChildren,\n    prepareUpdate = config.prepareUpdate,\n    mutation = config.mutation,\n    persistence = config.persistence;\n  var getRootHostContainer = hostContext.getRootHostContainer,\n    popHostContext = hostContext.popHostContext,\n    getHostContext = hostContext.getHostContext,\n    popHostContainer = hostContext.popHostContainer;\n  var prepareToHydrateHostInstance =\n      hydrationContext.prepareToHydrateHostInstance,\n    prepareToHydrateHostTextInstance =\n      hydrationContext.prepareToHydrateHostTextInstance,\n    popHydrationState = hydrationContext.popHydrationState;\n\n  function markUpdate(workInProgress) {\n    // Tag the fiber with an update effect. This turns a Placement into\n    // an UpdateAndPlacement.\n    workInProgress.effectTag |= Update;\n  }\n\n  function markRef(workInProgress) {\n    workInProgress.effectTag |= Ref;\n  }\n\n  function appendAllReturns(returns, workInProgress) {\n    var node = workInProgress.stateNode;\n    if (node) {\n      node[\"return\"] = workInProgress;\n    }\n    while (node !== null) {\n      if (\n        node.tag === HostComponent ||\n        node.tag === HostText ||\n        node.tag === HostPortal\n      ) {\n        invariant(false, \"A call cannot have host component children.\");\n      } else if (node.tag === ReturnComponent) {\n        returns.push(node.type);\n      } else if (node.child !== null) {\n        node.child[\"return\"] = node;\n        node = node.child;\n        continue;\n      }\n      while (node.sibling === null) {\n        if (node[\"return\"] === null || node[\"return\"] === workInProgress) {\n          return;\n        }\n        node = node[\"return\"];\n      }\n      node.sibling[\"return\"] = node[\"return\"];\n      node = node.sibling;\n    }\n  }\n\n  function moveCallToHandlerPhase(\n    current,\n    workInProgress,\n    renderExpirationTime\n  ) {\n    var call = workInProgress.memoizedProps;\n    invariant(\n      call,\n      \"Should be resolved by now. This error is likely caused by a bug in \" +\n        \"React. Please file an issue.\"\n    );\n\n    // First step of the call has completed. Now we need to do the second.\n    // TODO: It would be nice to have a multi stage call represented by a\n    // single component, or at least tail call optimize nested ones. Currently\n    // that requires additional fields that we don't want to add to the fiber.\n    // So this requires nested handlers.\n    // Note: This doesn't mutate the alternate node. I don't think it needs to\n    // since this stage is reset for every pass.\n    workInProgress.tag = CallHandlerPhase;\n\n    // Build up the returns.\n    // TODO: Compare this to a generator or opaque helpers like Children.\n    var returns = [];\n    appendAllReturns(returns, workInProgress);\n    var fn = call.handler;\n    var props = call.props;\n    var nextChildren = fn(props, returns);\n\n    var currentFirstChild = current !== null ? current.child : null;\n    workInProgress.child = reconcileChildFibers(\n      workInProgress,\n      currentFirstChild,\n      nextChildren,\n      renderExpirationTime\n    );\n    return workInProgress.child;\n  }\n\n  function appendAllChildren(parent, workInProgress) {\n    // We only have the top Fiber that was created but we need recurse down its\n    // children to find all the terminal nodes.\n    var node = workInProgress.child;\n    while (node !== null) {\n      if (node.tag === HostComponent || node.tag === HostText) {\n        appendInitialChild(parent, node.stateNode);\n      } else if (node.tag === HostPortal) {\n        // If we have a portal child, then we don't want to traverse\n        // down its children. Instead, we'll get insertions from each child in\n        // the portal directly.\n      } else if (node.child !== null) {\n        node.child[\"return\"] = node;\n        node = node.child;\n        continue;\n      }\n      if (node === workInProgress) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node[\"return\"] === null || node[\"return\"] === workInProgress) {\n          return;\n        }\n        node = node[\"return\"];\n      }\n      node.sibling[\"return\"] = node[\"return\"];\n      node = node.sibling;\n    }\n  }\n\n  var updateHostContainer = void 0;\n  var updateHostComponent = void 0;\n  var updateHostText = void 0;\n  if (mutation) {\n    if (enableMutatingReconciler) {\n      // Mutation mode\n      updateHostContainer = function(workInProgress) {\n        // Noop\n      };\n      updateHostComponent = function(\n        current,\n        workInProgress,\n        updatePayload,\n        type,\n        oldProps,\n        newProps,\n        rootContainerInstance\n      ) {\n        // TODO: Type this specific to this type of component.\n        workInProgress.updateQueue = updatePayload;\n        // If the update payload indicates that there is a change or if there\n        // is a new ref we mark this as an update. All the work is done in commitWork.\n        if (updatePayload) {\n          markUpdate(workInProgress);\n        }\n      };\n      updateHostText = function(current, workInProgress, oldText, newText) {\n        // If the text differs, mark it as an update. All the work in done in commitWork.\n        if (oldText !== newText) {\n          markUpdate(workInProgress);\n        }\n      };\n    } else {\n      invariant(false, \"Mutating reconciler is disabled.\");\n    }\n  } else if (persistence) {\n    if (enablePersistentReconciler) {\n      // Persistent host tree mode\n      var cloneInstance = persistence.cloneInstance,\n        createContainerChildSet = persistence.createContainerChildSet,\n        appendChildToContainerChildSet =\n          persistence.appendChildToContainerChildSet,\n        finalizeContainerChildren = persistence.finalizeContainerChildren;\n\n      // An unfortunate fork of appendAllChildren because we have two different parent types.\n\n      var appendAllChildrenToContainer = function(\n        containerChildSet,\n        workInProgress\n      ) {\n        // We only have the top Fiber that was created but we need recurse down its\n        // children to find all the terminal nodes.\n        var node = workInProgress.child;\n        while (node !== null) {\n          if (node.tag === HostComponent || node.tag === HostText) {\n            appendChildToContainerChildSet(containerChildSet, node.stateNode);\n          } else if (node.tag === HostPortal) {\n            // If we have a portal child, then we don't want to traverse\n            // down its children. Instead, we'll get insertions from each child in\n            // the portal directly.\n          } else if (node.child !== null) {\n            node.child[\"return\"] = node;\n            node = node.child;\n            continue;\n          }\n          if (node === workInProgress) {\n            return;\n          }\n          while (node.sibling === null) {\n            if (node[\"return\"] === null || node[\"return\"] === workInProgress) {\n              return;\n            }\n            node = node[\"return\"];\n          }\n          node.sibling[\"return\"] = node[\"return\"];\n          node = node.sibling;\n        }\n      };\n      updateHostContainer = function(workInProgress) {\n        var portalOrRoot = workInProgress.stateNode;\n        var childrenUnchanged = workInProgress.firstEffect === null;\n        if (childrenUnchanged) {\n          // No changes, just reuse the existing instance.\n        } else {\n          var container = portalOrRoot.containerInfo;\n          var newChildSet = createContainerChildSet(container);\n          if (finalizeContainerChildren(container, newChildSet)) {\n            markUpdate(workInProgress);\n          }\n          portalOrRoot.pendingChildren = newChildSet;\n          // If children might have changed, we have to add them all to the set.\n          appendAllChildrenToContainer(newChildSet, workInProgress);\n          // Schedule an update on the container to swap out the container.\n          markUpdate(workInProgress);\n        }\n      };\n      updateHostComponent = function(\n        current,\n        workInProgress,\n        updatePayload,\n        type,\n        oldProps,\n        newProps,\n        rootContainerInstance\n      ) {\n        // If there are no effects associated with this node, then none of our children had any updates.\n        // This guarantees that we can reuse all of them.\n        var childrenUnchanged = workInProgress.firstEffect === null;\n        var currentInstance = current.stateNode;\n        if (childrenUnchanged && updatePayload === null) {\n          // No changes, just reuse the existing instance.\n          // Note that this might release a previous clone.\n          workInProgress.stateNode = currentInstance;\n        } else {\n          var recyclableInstance = workInProgress.stateNode;\n          var newInstance = cloneInstance(\n            currentInstance,\n            updatePayload,\n            type,\n            oldProps,\n            newProps,\n            workInProgress,\n            childrenUnchanged,\n            recyclableInstance\n          );\n          if (\n            finalizeInitialChildren(\n              newInstance,\n              type,\n              newProps,\n              rootContainerInstance\n            )\n          ) {\n            markUpdate(workInProgress);\n          }\n          workInProgress.stateNode = newInstance;\n          if (childrenUnchanged) {\n            // If there are no other effects in this tree, we need to flag this node as having one.\n            // Even though we're not going to use it for anything.\n            // Otherwise parents won't know that there are new children to propagate upwards.\n            markUpdate(workInProgress);\n          } else {\n            // If children might have changed, we have to add them all to the set.\n            appendAllChildren(newInstance, workInProgress);\n          }\n        }\n      };\n      updateHostText = function(current, workInProgress, oldText, newText) {\n        if (oldText !== newText) {\n          // If the text content differs, we'll create a new text instance for it.\n          var rootContainerInstance = getRootHostContainer();\n          var currentHostContext = getHostContext();\n          workInProgress.stateNode = createTextInstance(\n            newText,\n            rootContainerInstance,\n            currentHostContext,\n            workInProgress\n          );\n          // We'll have to mark it as having an effect, even though we won't use the effect for anything.\n          // This lets the parents know that at least one of their children has changed.\n          markUpdate(workInProgress);\n        }\n      };\n    } else {\n      invariant(false, \"Persistent reconciler is disabled.\");\n    }\n  } else {\n    if (enableNoopReconciler) {\n      // No host operations\n      updateHostContainer = function(workInProgress) {\n        // Noop\n      };\n      updateHostComponent = function(\n        current,\n        workInProgress,\n        updatePayload,\n        type,\n        oldProps,\n        newProps,\n        rootContainerInstance\n      ) {\n        // Noop\n      };\n      updateHostText = function(current, workInProgress, oldText, newText) {\n        // Noop\n      };\n    } else {\n      invariant(false, \"Noop reconciler is disabled.\");\n    }\n  }\n\n  function completeWork(current, workInProgress, renderExpirationTime) {\n    var newProps = workInProgress.pendingProps;\n    switch (workInProgress.tag) {\n      case FunctionalComponent:\n        return null;\n      case ClassComponent: {\n        // We are leaving this subtree, so pop context if any.\n        popContextProvider(workInProgress);\n        return null;\n      }\n      case HostRoot: {\n        popHostContainer(workInProgress);\n        popTopLevelContextObject(workInProgress);\n        var fiberRoot = workInProgress.stateNode;\n        if (fiberRoot.pendingContext) {\n          fiberRoot.context = fiberRoot.pendingContext;\n          fiberRoot.pendingContext = null;\n        }\n\n        if (current === null || current.child === null) {\n          // If we hydrated, pop so that we can delete any remaining children\n          // that weren't hydrated.\n          popHydrationState(workInProgress);\n          // This resets the hacky state to fix isMounted before committing.\n          // TODO: Delete this when we delete isMounted and findDOMNode.\n          workInProgress.effectTag &= ~Placement;\n        }\n        updateHostContainer(workInProgress);\n        return null;\n      }\n      case HostComponent: {\n        popHostContext(workInProgress);\n        var rootContainerInstance = getRootHostContainer();\n        var type = workInProgress.type;\n        if (current !== null && workInProgress.stateNode != null) {\n          // If we have an alternate, that means this is an update and we need to\n          // schedule a side-effect to do the updates.\n          var oldProps = current.memoizedProps;\n          // If we get updated because one of our children updated, we don't\n          // have newProps so we'll have to reuse them.\n          // TODO: Split the update API as separate for the props vs. children.\n          // Even better would be if children weren't special cased at all tho.\n          var instance = workInProgress.stateNode;\n          var currentHostContext = getHostContext();\n          var updatePayload = prepareUpdate(\n            instance,\n            type,\n            oldProps,\n            newProps,\n            rootContainerInstance,\n            currentHostContext\n          );\n\n          updateHostComponent(\n            current,\n            workInProgress,\n            updatePayload,\n            type,\n            oldProps,\n            newProps,\n            rootContainerInstance\n          );\n\n          if (current.ref !== workInProgress.ref) {\n            markRef(workInProgress);\n          }\n        } else {\n          if (!newProps) {\n            invariant(\n              workInProgress.stateNode !== null,\n              \"We must have new props for new mounts. This error is likely \" +\n                \"caused by a bug in React. Please file an issue.\"\n            );\n            // This can happen when we abort work.\n            return null;\n          }\n\n          var _currentHostContext = getHostContext();\n          // TODO: Move createInstance to beginWork and keep it on a context\n          // \"stack\" as the parent. Then append children as we go in beginWork\n          // or completeWork depending on we want to add then top->down or\n          // bottom->up. Top->down is faster in IE11.\n          var wasHydrated = popHydrationState(workInProgress);\n          if (wasHydrated) {\n            // TODO: Move this and createInstance step into the beginPhase\n            // to consolidate.\n            if (\n              prepareToHydrateHostInstance(\n                workInProgress,\n                rootContainerInstance,\n                _currentHostContext\n              )\n            ) {\n              // If changes to the hydrated node needs to be applied at the\n              // commit-phase we mark this as such.\n              markUpdate(workInProgress);\n            }\n          } else {\n            var _instance = createInstance(\n              type,\n              newProps,\n              rootContainerInstance,\n              _currentHostContext,\n              workInProgress\n            );\n\n            appendAllChildren(_instance, workInProgress);\n\n            // Certain renderers require commit-time effects for initial mount.\n            // (eg DOM renderer supports auto-focus for certain elements).\n            // Make sure such renderers get scheduled for later work.\n            if (\n              finalizeInitialChildren(\n                _instance,\n                type,\n                newProps,\n                rootContainerInstance\n              )\n            ) {\n              markUpdate(workInProgress);\n            }\n            workInProgress.stateNode = _instance;\n          }\n\n          if (workInProgress.ref !== null) {\n            // If there is a ref on a host node we need to schedule a callback\n            markRef(workInProgress);\n          }\n        }\n        return null;\n      }\n      case HostText: {\n        var newText = newProps;\n        if (current && workInProgress.stateNode != null) {\n          var oldText = current.memoizedProps;\n          // If we have an alternate, that means this is an update and we need\n          // to schedule a side-effect to do the updates.\n          updateHostText(current, workInProgress, oldText, newText);\n        } else {\n          if (typeof newText !== \"string\") {\n            invariant(\n              workInProgress.stateNode !== null,\n              \"We must have new props for new mounts. This error is likely \" +\n                \"caused by a bug in React. Please file an issue.\"\n            );\n            // This can happen when we abort work.\n            return null;\n          }\n          var _rootContainerInstance = getRootHostContainer();\n          var _currentHostContext2 = getHostContext();\n          var _wasHydrated = popHydrationState(workInProgress);\n          if (_wasHydrated) {\n            if (prepareToHydrateHostTextInstance(workInProgress)) {\n              markUpdate(workInProgress);\n            }\n          } else {\n            workInProgress.stateNode = createTextInstance(\n              newText,\n              _rootContainerInstance,\n              _currentHostContext2,\n              workInProgress\n            );\n          }\n        }\n        return null;\n      }\n      case CallComponent:\n        return moveCallToHandlerPhase(\n          current,\n          workInProgress,\n          renderExpirationTime\n        );\n      case CallHandlerPhase:\n        // Reset the tag to now be a first phase call.\n        workInProgress.tag = CallComponent;\n        return null;\n      case ReturnComponent:\n        // Does nothing.\n        return null;\n      case Fragment:\n        return null;\n      case HostPortal:\n        popHostContainer(workInProgress);\n        updateHostContainer(workInProgress);\n        return null;\n      // Error cases\n      case IndeterminateComponent:\n        invariant(\n          false,\n          \"An indeterminate component should have become determinate before \" +\n            \"completing. This error is likely caused by a bug in React. Please \" +\n            \"file an issue.\"\n        );\n      // eslint-disable-next-line no-fallthrough\n      default:\n        invariant(\n          false,\n          \"Unknown unit of work tag. This error is likely caused by a bug in \" +\n            \"React. Please file an issue.\"\n        );\n    }\n  }\n\n  return {\n    completeWork: completeWork\n  };\n};\n\nvar invokeGuardedCallback$2 = ReactErrorUtils.invokeGuardedCallback;\nvar hasCaughtError$1 = ReactErrorUtils.hasCaughtError;\nvar clearCaughtError$1 = ReactErrorUtils.clearCaughtError;\n\nvar ReactFiberCommitWork = function(config, captureError) {\n  var getPublicInstance = config.getPublicInstance,\n    mutation = config.mutation,\n    persistence = config.persistence;\n\n  var callComponentWillUnmountWithTimer = function(current, instance) {\n    startPhaseTimer(current, \"componentWillUnmount\");\n    instance.props = current.memoizedProps;\n    instance.state = current.memoizedState;\n    instance.componentWillUnmount();\n    stopPhaseTimer();\n  };\n\n  // Capture errors so they don't interrupt unmounting.\n  function safelyCallComponentWillUnmount(current, instance) {\n    {\n      invokeGuardedCallback$2(\n        null,\n        callComponentWillUnmountWithTimer,\n        null,\n        current,\n        instance\n      );\n      if (hasCaughtError$1()) {\n        var unmountError = clearCaughtError$1();\n        captureError(current, unmountError);\n      }\n    }\n  }\n\n  function safelyDetachRef(current) {\n    var ref = current.ref;\n    if (ref !== null) {\n      {\n        invokeGuardedCallback$2(null, ref, null, null);\n        if (hasCaughtError$1()) {\n          var refError = clearCaughtError$1();\n          captureError(current, refError);\n        }\n      }\n    }\n  }\n\n  function commitLifeCycles(current, finishedWork) {\n    switch (finishedWork.tag) {\n      case ClassComponent: {\n        var instance = finishedWork.stateNode;\n        if (finishedWork.effectTag & Update) {\n          if (current === null) {\n            startPhaseTimer(finishedWork, \"componentDidMount\");\n            instance.props = finishedWork.memoizedProps;\n            instance.state = finishedWork.memoizedState;\n            instance.componentDidMount();\n            stopPhaseTimer();\n          } else {\n            var prevProps = current.memoizedProps;\n            var prevState = current.memoizedState;\n            startPhaseTimer(finishedWork, \"componentDidUpdate\");\n            instance.props = finishedWork.memoizedProps;\n            instance.state = finishedWork.memoizedState;\n            instance.componentDidUpdate(prevProps, prevState);\n            stopPhaseTimer();\n          }\n        }\n        var updateQueue = finishedWork.updateQueue;\n        if (updateQueue !== null) {\n          commitCallbacks(updateQueue, instance);\n        }\n        return;\n      }\n      case HostRoot: {\n        var _updateQueue = finishedWork.updateQueue;\n        if (_updateQueue !== null) {\n          var _instance =\n            finishedWork.child !== null ? finishedWork.child.stateNode : null;\n          commitCallbacks(_updateQueue, _instance);\n        }\n        return;\n      }\n      case HostComponent: {\n        var _instance2 = finishedWork.stateNode;\n\n        // Renderers may schedule work to be done after host components are mounted\n        // (eg DOM renderer may schedule auto-focus for inputs and form controls).\n        // These effects should only be committed when components are first mounted,\n        // aka when there is no current/alternate.\n        if (current === null && finishedWork.effectTag & Update) {\n          var type = finishedWork.type;\n          var props = finishedWork.memoizedProps;\n          commitMount(_instance2, type, props, finishedWork);\n        }\n\n        return;\n      }\n      case HostText: {\n        // We have no life-cycles associated with text.\n        return;\n      }\n      case HostPortal: {\n        // We have no life-cycles associated with portals.\n        return;\n      }\n      default: {\n        invariant(\n          false,\n          \"This unit of work tag should not have side-effects. This error is \" +\n            \"likely caused by a bug in React. Please file an issue.\"\n        );\n      }\n    }\n  }\n\n  function commitAttachRef(finishedWork) {\n    var ref = finishedWork.ref;\n    if (ref !== null) {\n      var instance = finishedWork.stateNode;\n      switch (finishedWork.tag) {\n        case HostComponent:\n          ref(getPublicInstance(instance));\n          break;\n        default:\n          ref(instance);\n      }\n    }\n  }\n\n  function commitDetachRef(current) {\n    var currentRef = current.ref;\n    if (currentRef !== null) {\n      currentRef(null);\n    }\n  }\n\n  // User-originating errors (lifecycles and refs) should not interrupt\n  // deletion, so don't let them throw. Host-originating errors should\n  // interrupt deletion, so it's okay\n  function commitUnmount(current) {\n    if (typeof onCommitUnmount === \"function\") {\n      onCommitUnmount(current);\n    }\n\n    switch (current.tag) {\n      case ClassComponent: {\n        safelyDetachRef(current);\n        var instance = current.stateNode;\n        if (typeof instance.componentWillUnmount === \"function\") {\n          safelyCallComponentWillUnmount(current, instance);\n        }\n        return;\n      }\n      case HostComponent: {\n        safelyDetachRef(current);\n        return;\n      }\n      case CallComponent: {\n        commitNestedUnmounts(current.stateNode);\n        return;\n      }\n      case HostPortal: {\n        // TODO: this is recursive.\n        // We are also not using this parent because\n        // the portal will get pushed immediately.\n        if (enableMutatingReconciler && mutation) {\n          unmountHostComponents(current);\n        } else if (enablePersistentReconciler && persistence) {\n          emptyPortalContainer(current);\n        }\n        return;\n      }\n    }\n  }\n\n  function commitNestedUnmounts(root) {\n    // While we're inside a removed host node we don't want to call\n    // removeChild on the inner nodes because they're removed by the top\n    // call anyway. We also want to call componentWillUnmount on all\n    // composites before this host node is removed from the tree. Therefore\n    var node = root;\n    while (true) {\n      commitUnmount(node);\n      // Visit children because they may contain more composite or host nodes.\n      // Skip portals because commitUnmount() currently visits them recursively.\n      if (\n        node.child !== null &&\n        // If we use mutation we drill down into portals using commitUnmount above.\n        // If we don't use mutation we drill down into portals here instead.\n        (!mutation || node.tag !== HostPortal)\n      ) {\n        node.child[\"return\"] = node;\n        node = node.child;\n        continue;\n      }\n      if (node === root) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node[\"return\"] === null || node[\"return\"] === root) {\n          return;\n        }\n        node = node[\"return\"];\n      }\n      node.sibling[\"return\"] = node[\"return\"];\n      node = node.sibling;\n    }\n  }\n\n  function detachFiber(current) {\n    // Cut off the return pointers to disconnect it from the tree. Ideally, we\n    // should clear the child pointer of the parent alternate to let this\n    // get GC:ed but we don't know which for sure which parent is the current\n    // one so we'll settle for GC:ing the subtree of this child. This child\n    // itself will be GC:ed when the parent updates the next time.\n    current[\"return\"] = null;\n    current.child = null;\n    if (current.alternate) {\n      current.alternate.child = null;\n      current.alternate[\"return\"] = null;\n    }\n  }\n\n  if (!mutation) {\n    var commitContainer = void 0;\n    if (persistence) {\n      var replaceContainerChildren = persistence.replaceContainerChildren,\n        createContainerChildSet = persistence.createContainerChildSet;\n\n      var emptyPortalContainer = function(current) {\n        var portal = current.stateNode;\n        var containerInfo = portal.containerInfo;\n\n        var emptyChildSet = createContainerChildSet(containerInfo);\n        replaceContainerChildren(containerInfo, emptyChildSet);\n      };\n      commitContainer = function(finishedWork) {\n        switch (finishedWork.tag) {\n          case ClassComponent: {\n            return;\n          }\n          case HostComponent: {\n            return;\n          }\n          case HostText: {\n            return;\n          }\n          case HostRoot:\n          case HostPortal: {\n            var portalOrRoot = finishedWork.stateNode;\n            var containerInfo = portalOrRoot.containerInfo,\n              _pendingChildren = portalOrRoot.pendingChildren;\n\n            replaceContainerChildren(containerInfo, _pendingChildren);\n            return;\n          }\n          default: {\n            invariant(\n              false,\n              \"This unit of work tag should not have side-effects. This error is \" +\n                \"likely caused by a bug in React. Please file an issue.\"\n            );\n          }\n        }\n      };\n    } else {\n      commitContainer = function(finishedWork) {\n        // Noop\n      };\n    }\n    if (enablePersistentReconciler || enableNoopReconciler) {\n      return {\n        commitResetTextContent: function(finishedWork) {},\n        commitPlacement: function(finishedWork) {},\n        commitDeletion: function(current) {\n          // Detach refs and call componentWillUnmount() on the whole subtree.\n          commitNestedUnmounts(current);\n          detachFiber(current);\n        },\n        commitWork: function(current, finishedWork) {\n          commitContainer(finishedWork);\n        },\n\n        commitLifeCycles: commitLifeCycles,\n        commitAttachRef: commitAttachRef,\n        commitDetachRef: commitDetachRef\n      };\n    } else if (persistence) {\n      invariant(false, \"Persistent reconciler is disabled.\");\n    } else {\n      invariant(false, \"Noop reconciler is disabled.\");\n    }\n  }\n  var commitMount = mutation.commitMount,\n    commitUpdate = mutation.commitUpdate,\n    resetTextContent = mutation.resetTextContent,\n    commitTextUpdate = mutation.commitTextUpdate,\n    appendChild = mutation.appendChild,\n    appendChildToContainer = mutation.appendChildToContainer,\n    insertBefore = mutation.insertBefore,\n    insertInContainerBefore = mutation.insertInContainerBefore,\n    removeChild = mutation.removeChild,\n    removeChildFromContainer = mutation.removeChildFromContainer;\n\n  function getHostParentFiber(fiber) {\n    var parent = fiber[\"return\"];\n    while (parent !== null) {\n      if (isHostParent(parent)) {\n        return parent;\n      }\n      parent = parent[\"return\"];\n    }\n    invariant(\n      false,\n      \"Expected to find a host parent. This error is likely caused by a bug \" +\n        \"in React. Please file an issue.\"\n    );\n  }\n\n  function isHostParent(fiber) {\n    return (\n      fiber.tag === HostComponent ||\n      fiber.tag === HostRoot ||\n      fiber.tag === HostPortal\n    );\n  }\n\n  function getHostSibling(fiber) {\n    // We're going to search forward into the tree until we find a sibling host\n    // node. Unfortunately, if multiple insertions are done in a row we have to\n    // search past them. This leads to exponential search for the next sibling.\n    var node = fiber;\n    siblings: while (true) {\n      // If we didn't find anything, let's try the next sibling.\n      while (node.sibling === null) {\n        if (node[\"return\"] === null || isHostParent(node[\"return\"])) {\n          // If we pop out of the root or hit the parent the fiber we are the\n          // last sibling.\n          return null;\n        }\n        node = node[\"return\"];\n      }\n      node.sibling[\"return\"] = node[\"return\"];\n      node = node.sibling;\n      while (node.tag !== HostComponent && node.tag !== HostText) {\n        // If it is not host node and, we might have a host node inside it.\n        // Try to search down until we find one.\n        if (node.effectTag & Placement) {\n          // If we don't have a child, try the siblings instead.\n          continue siblings;\n        }\n        // If we don't have a child, try the siblings instead.\n        // We also skip portals because they are not part of this host tree.\n        if (node.child === null || node.tag === HostPortal) {\n          continue siblings;\n        } else {\n          node.child[\"return\"] = node;\n          node = node.child;\n        }\n      }\n      // Check if this host node is stable or about to be placed.\n      if (!(node.effectTag & Placement)) {\n        // Found it!\n        return node.stateNode;\n      }\n    }\n  }\n\n  function commitPlacement(finishedWork) {\n    // Recursively insert all host nodes into the parent.\n    var parentFiber = getHostParentFiber(finishedWork);\n    var parent = void 0;\n    var isContainer = void 0;\n    switch (parentFiber.tag) {\n      case HostComponent:\n        parent = parentFiber.stateNode;\n        isContainer = false;\n        break;\n      case HostRoot:\n        parent = parentFiber.stateNode.containerInfo;\n        isContainer = true;\n        break;\n      case HostPortal:\n        parent = parentFiber.stateNode.containerInfo;\n        isContainer = true;\n        break;\n      default:\n        invariant(\n          false,\n          \"Invalid host parent fiber. This error is likely caused by a bug \" +\n            \"in React. Please file an issue.\"\n        );\n    }\n    if (parentFiber.effectTag & ContentReset) {\n      // Reset the text content of the parent before doing any insertions\n      resetTextContent(parent);\n      // Clear ContentReset from the effect tag\n      parentFiber.effectTag &= ~ContentReset;\n    }\n\n    var before = getHostSibling(finishedWork);\n    // We only have the top Fiber that was inserted but we need recurse down its\n    // children to find all the terminal nodes.\n    var node = finishedWork;\n    while (true) {\n      if (node.tag === HostComponent || node.tag === HostText) {\n        if (before) {\n          if (isContainer) {\n            insertInContainerBefore(parent, node.stateNode, before);\n          } else {\n            insertBefore(parent, node.stateNode, before);\n          }\n        } else {\n          if (isContainer) {\n            appendChildToContainer(parent, node.stateNode);\n          } else {\n            appendChild(parent, node.stateNode);\n          }\n        }\n      } else if (node.tag === HostPortal) {\n        // If the insertion itself is a portal, then we don't want to traverse\n        // down its children. Instead, we'll get insertions from each child in\n        // the portal directly.\n      } else if (node.child !== null) {\n        node.child[\"return\"] = node;\n        node = node.child;\n        continue;\n      }\n      if (node === finishedWork) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node[\"return\"] === null || node[\"return\"] === finishedWork) {\n          return;\n        }\n        node = node[\"return\"];\n      }\n      node.sibling[\"return\"] = node[\"return\"];\n      node = node.sibling;\n    }\n  }\n\n  function unmountHostComponents(current) {\n    // We only have the top Fiber that was inserted but we need recurse down its\n    var node = current;\n\n    // Each iteration, currentParent is populated with node's host parent if not\n    // currentParentIsValid.\n    var currentParentIsValid = false;\n    var currentParent = void 0;\n    var currentParentIsContainer = void 0;\n\n    while (true) {\n      if (!currentParentIsValid) {\n        var parent = node[\"return\"];\n        findParent: while (true) {\n          invariant(\n            parent !== null,\n            \"Expected to find a host parent. This error is likely caused by \" +\n              \"a bug in React. Please file an issue.\"\n          );\n          switch (parent.tag) {\n            case HostComponent:\n              currentParent = parent.stateNode;\n              currentParentIsContainer = false;\n              break findParent;\n            case HostRoot:\n              currentParent = parent.stateNode.containerInfo;\n              currentParentIsContainer = true;\n              break findParent;\n            case HostPortal:\n              currentParent = parent.stateNode.containerInfo;\n              currentParentIsContainer = true;\n              break findParent;\n          }\n          parent = parent[\"return\"];\n        }\n        currentParentIsValid = true;\n      }\n\n      if (node.tag === HostComponent || node.tag === HostText) {\n        commitNestedUnmounts(node);\n        // After all the children have unmounted, it is now safe to remove the\n        // node from the tree.\n        if (currentParentIsContainer) {\n          removeChildFromContainer(currentParent, node.stateNode);\n        } else {\n          removeChild(currentParent, node.stateNode);\n        }\n        // Don't visit children because we already visited them.\n      } else if (node.tag === HostPortal) {\n        // When we go into a portal, it becomes the parent to remove from.\n        // We will reassign it back when we pop the portal on the way up.\n        currentParent = node.stateNode.containerInfo;\n        // Visit children because portals might contain host components.\n        if (node.child !== null) {\n          node.child[\"return\"] = node;\n          node = node.child;\n          continue;\n        }\n      } else {\n        commitUnmount(node);\n        // Visit children because we may find more host components below.\n        if (node.child !== null) {\n          node.child[\"return\"] = node;\n          node = node.child;\n          continue;\n        }\n      }\n      if (node === current) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node[\"return\"] === null || node[\"return\"] === current) {\n          return;\n        }\n        node = node[\"return\"];\n        if (node.tag === HostPortal) {\n          // When we go out of the portal, we need to restore the parent.\n          // Since we don't keep a stack of them, we will search for it.\n          currentParentIsValid = false;\n        }\n      }\n      node.sibling[\"return\"] = node[\"return\"];\n      node = node.sibling;\n    }\n  }\n\n  function commitDeletion(current) {\n    // Recursively delete all host nodes from the parent.\n    // Detach refs and call componentWillUnmount() on the whole subtree.\n    unmountHostComponents(current);\n    detachFiber(current);\n  }\n\n  function commitWork(current, finishedWork) {\n    switch (finishedWork.tag) {\n      case ClassComponent: {\n        return;\n      }\n      case HostComponent: {\n        var instance = finishedWork.stateNode;\n        if (instance != null) {\n          // Commit the work prepared earlier.\n          var newProps = finishedWork.memoizedProps;\n          // For hydration we reuse the update path but we treat the oldProps\n          // as the newProps. The updatePayload will contain the real change in\n          // this case.\n          var oldProps = current !== null ? current.memoizedProps : newProps;\n          var type = finishedWork.type;\n          // TODO: Type the updateQueue to be specific to host components.\n          var updatePayload = finishedWork.updateQueue;\n          finishedWork.updateQueue = null;\n          if (updatePayload !== null) {\n            commitUpdate(\n              instance,\n              updatePayload,\n              type,\n              oldProps,\n              newProps,\n              finishedWork\n            );\n          }\n        }\n        return;\n      }\n      case HostText: {\n        invariant(\n          finishedWork.stateNode !== null,\n          \"This should have a text node initialized. This error is likely \" +\n            \"caused by a bug in React. Please file an issue.\"\n        );\n        var textInstance = finishedWork.stateNode;\n        var newText = finishedWork.memoizedProps;\n        // For hydration we reuse the update path but we treat the oldProps\n        // as the newProps. The updatePayload will contain the real change in\n        // this case.\n        var oldText = current !== null ? current.memoizedProps : newText;\n        commitTextUpdate(textInstance, oldText, newText);\n        return;\n      }\n      case HostRoot: {\n        return;\n      }\n      default: {\n        invariant(\n          false,\n          \"This unit of work tag should not have side-effects. This error is \" +\n            \"likely caused by a bug in React. Please file an issue.\"\n        );\n      }\n    }\n  }\n\n  function commitResetTextContent(current) {\n    resetTextContent(current.stateNode);\n  }\n\n  if (enableMutatingReconciler) {\n    return {\n      commitResetTextContent: commitResetTextContent,\n      commitPlacement: commitPlacement,\n      commitDeletion: commitDeletion,\n      commitWork: commitWork,\n      commitLifeCycles: commitLifeCycles,\n      commitAttachRef: commitAttachRef,\n      commitDetachRef: commitDetachRef\n    };\n  } else {\n    invariant(false, \"Mutating reconciler is disabled.\");\n  }\n};\n\nvar NO_CONTEXT = {};\n\nvar ReactFiberHostContext = function(config) {\n  var getChildHostContext = config.getChildHostContext,\n    getRootHostContext = config.getRootHostContext;\n\n  var contextStackCursor = createCursor(NO_CONTEXT);\n  var contextFiberStackCursor = createCursor(NO_CONTEXT);\n  var rootInstanceStackCursor = createCursor(NO_CONTEXT);\n\n  function requiredContext(c) {\n    invariant(\n      c !== NO_CONTEXT,\n      \"Expected host context to exist. This error is likely caused by a bug \" +\n        \"in React. Please file an issue.\"\n    );\n    return c;\n  }\n\n  function getRootHostContainer() {\n    var rootInstance = requiredContext(rootInstanceStackCursor.current);\n    return rootInstance;\n  }\n\n  function pushHostContainer(fiber, nextRootInstance) {\n    // Push current root instance onto the stack;\n    // This allows us to reset root when portals are popped.\n    push(rootInstanceStackCursor, nextRootInstance, fiber);\n\n    var nextRootContext = getRootHostContext(nextRootInstance);\n\n    // Track the context and the Fiber that provided it.\n    // This enables us to pop only Fibers that provide unique contexts.\n    push(contextFiberStackCursor, fiber, fiber);\n    push(contextStackCursor, nextRootContext, fiber);\n  }\n\n  function popHostContainer(fiber) {\n    pop(contextStackCursor, fiber);\n    pop(contextFiberStackCursor, fiber);\n    pop(rootInstanceStackCursor, fiber);\n  }\n\n  function getHostContext() {\n    var context = requiredContext(contextStackCursor.current);\n    return context;\n  }\n\n  function pushHostContext(fiber) {\n    var rootInstance = requiredContext(rootInstanceStackCursor.current);\n    var context = requiredContext(contextStackCursor.current);\n    var nextContext = getChildHostContext(context, fiber.type, rootInstance);\n\n    // Don't push this Fiber's context unless it's unique.\n    if (context === nextContext) {\n      return;\n    }\n\n    // Track the context and the Fiber that provided it.\n    // This enables us to pop only Fibers that provide unique contexts.\n    push(contextFiberStackCursor, fiber, fiber);\n    push(contextStackCursor, nextContext, fiber);\n  }\n\n  function popHostContext(fiber) {\n    // Do not pop unless this Fiber provided the current context.\n    // pushHostContext() only pushes Fibers that provide unique contexts.\n    if (contextFiberStackCursor.current !== fiber) {\n      return;\n    }\n\n    pop(contextStackCursor, fiber);\n    pop(contextFiberStackCursor, fiber);\n  }\n\n  function resetHostContainer() {\n    contextStackCursor.current = NO_CONTEXT;\n    rootInstanceStackCursor.current = NO_CONTEXT;\n  }\n\n  return {\n    getHostContext: getHostContext,\n    getRootHostContainer: getRootHostContainer,\n    popHostContainer: popHostContainer,\n    popHostContext: popHostContext,\n    pushHostContainer: pushHostContainer,\n    pushHostContext: pushHostContext,\n    resetHostContainer: resetHostContainer\n  };\n};\n\nvar ReactFiberHydrationContext = function(config) {\n  var shouldSetTextContent = config.shouldSetTextContent,\n    hydration = config.hydration;\n\n  // If this doesn't have hydration mode.\n\n  if (!hydration) {\n    return {\n      enterHydrationState: function() {\n        return false;\n      },\n      resetHydrationState: function() {},\n      tryToClaimNextHydratableInstance: function() {},\n      prepareToHydrateHostInstance: function() {\n        invariant(\n          false,\n          \"Expected prepareToHydrateHostInstance() to never be called. \" +\n            \"This error is likely caused by a bug in React. Please file an issue.\"\n        );\n      },\n      prepareToHydrateHostTextInstance: function() {\n        invariant(\n          false,\n          \"Expected prepareToHydrateHostTextInstance() to never be called. \" +\n            \"This error is likely caused by a bug in React. Please file an issue.\"\n        );\n      },\n      popHydrationState: function(fiber) {\n        return false;\n      }\n    };\n  }\n\n  var canHydrateInstance = hydration.canHydrateInstance,\n    canHydrateTextInstance = hydration.canHydrateTextInstance,\n    getNextHydratableSibling = hydration.getNextHydratableSibling,\n    getFirstHydratableChild = hydration.getFirstHydratableChild,\n    hydrateInstance = hydration.hydrateInstance,\n    hydrateTextInstance = hydration.hydrateTextInstance,\n    didNotMatchHydratedContainerTextInstance =\n      hydration.didNotMatchHydratedContainerTextInstance,\n    didNotMatchHydratedTextInstance = hydration.didNotMatchHydratedTextInstance,\n    didNotHydrateContainerInstance = hydration.didNotHydrateContainerInstance,\n    didNotHydrateInstance = hydration.didNotHydrateInstance,\n    didNotFindHydratableContainerInstance =\n      hydration.didNotFindHydratableContainerInstance,\n    didNotFindHydratableContainerTextInstance =\n      hydration.didNotFindHydratableContainerTextInstance,\n    didNotFindHydratableInstance = hydration.didNotFindHydratableInstance,\n    didNotFindHydratableTextInstance =\n      hydration.didNotFindHydratableTextInstance;\n\n  // The deepest Fiber on the stack involved in a hydration context.\n  // This may have been an insertion or a hydration.\n\n  var hydrationParentFiber = null;\n  var nextHydratableInstance = null;\n  var isHydrating = false;\n\n  function enterHydrationState(fiber) {\n    var parentInstance = fiber.stateNode.containerInfo;\n    nextHydratableInstance = getFirstHydratableChild(parentInstance);\n    hydrationParentFiber = fiber;\n    isHydrating = true;\n    return true;\n  }\n\n  function deleteHydratableInstance(returnFiber, instance) {\n    {\n      switch (returnFiber.tag) {\n        case HostRoot:\n          didNotHydrateContainerInstance(\n            returnFiber.stateNode.containerInfo,\n            instance\n          );\n          break;\n        case HostComponent:\n          didNotHydrateInstance(\n            returnFiber.type,\n            returnFiber.memoizedProps,\n            returnFiber.stateNode,\n            instance\n          );\n          break;\n      }\n    }\n\n    var childToDelete = createFiberFromHostInstanceForDeletion();\n    childToDelete.stateNode = instance;\n    childToDelete[\"return\"] = returnFiber;\n    childToDelete.effectTag = Deletion;\n\n    // This might seem like it belongs on progressedFirstDeletion. However,\n    // these children are not part of the reconciliation list of children.\n    // Even if we abort and rereconcile the children, that will try to hydrate\n    // again and the nodes are still in the host tree so these will be\n    // recreated.\n    if (returnFiber.lastEffect !== null) {\n      returnFiber.lastEffect.nextEffect = childToDelete;\n      returnFiber.lastEffect = childToDelete;\n    } else {\n      returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n    }\n  }\n\n  function insertNonHydratedInstance(returnFiber, fiber) {\n    fiber.effectTag |= Placement;\n    {\n      switch (returnFiber.tag) {\n        case HostRoot: {\n          var parentContainer = returnFiber.stateNode.containerInfo;\n          switch (fiber.tag) {\n            case HostComponent:\n              var type = fiber.type;\n              var props = fiber.pendingProps;\n              didNotFindHydratableContainerInstance(\n                parentContainer,\n                type,\n                props\n              );\n              break;\n            case HostText:\n              var text = fiber.pendingProps;\n              didNotFindHydratableContainerTextInstance(parentContainer, text);\n              break;\n          }\n          break;\n        }\n        case HostComponent: {\n          var parentType = returnFiber.type;\n          var parentProps = returnFiber.memoizedProps;\n          var parentInstance = returnFiber.stateNode;\n          switch (fiber.tag) {\n            case HostComponent:\n              var _type = fiber.type;\n              var _props = fiber.pendingProps;\n              didNotFindHydratableInstance(\n                parentType,\n                parentProps,\n                parentInstance,\n                _type,\n                _props\n              );\n              break;\n            case HostText:\n              var _text = fiber.pendingProps;\n              didNotFindHydratableTextInstance(\n                parentType,\n                parentProps,\n                parentInstance,\n                _text\n              );\n              break;\n          }\n          break;\n        }\n        default:\n          return;\n      }\n    }\n  }\n\n  function tryHydrate(fiber, nextInstance) {\n    switch (fiber.tag) {\n      case HostComponent: {\n        var type = fiber.type;\n        var props = fiber.pendingProps;\n        var instance = canHydrateInstance(nextInstance, type, props);\n        if (instance !== null) {\n          fiber.stateNode = instance;\n          return true;\n        }\n        return false;\n      }\n      case HostText: {\n        var text = fiber.pendingProps;\n        var textInstance = canHydrateTextInstance(nextInstance, text);\n        if (textInstance !== null) {\n          fiber.stateNode = textInstance;\n          return true;\n        }\n        return false;\n      }\n      default:\n        return false;\n    }\n  }\n\n  function tryToClaimNextHydratableInstance(fiber) {\n    if (!isHydrating) {\n      return;\n    }\n    var nextInstance = nextHydratableInstance;\n    if (!nextInstance) {\n      // Nothing to hydrate. Make it an insertion.\n      insertNonHydratedInstance(hydrationParentFiber, fiber);\n      isHydrating = false;\n      hydrationParentFiber = fiber;\n      return;\n    }\n    if (!tryHydrate(fiber, nextInstance)) {\n      // If we can't hydrate this instance let's try the next one.\n      // We use this as a heuristic. It's based on intuition and not data so it\n      // might be flawed or unnecessary.\n      nextInstance = getNextHydratableSibling(nextInstance);\n      if (!nextInstance || !tryHydrate(fiber, nextInstance)) {\n        // Nothing to hydrate. Make it an insertion.\n        insertNonHydratedInstance(hydrationParentFiber, fiber);\n        isHydrating = false;\n        hydrationParentFiber = fiber;\n        return;\n      }\n      // We matched the next one, we'll now assume that the first one was\n      // superfluous and we'll delete it. Since we can't eagerly delete it\n      // we'll have to schedule a deletion. To do that, this node needs a dummy\n      // fiber associated with it.\n      deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance);\n    }\n    hydrationParentFiber = fiber;\n    nextHydratableInstance = getFirstHydratableChild(nextInstance);\n  }\n\n  function prepareToHydrateHostInstance(\n    fiber,\n    rootContainerInstance,\n    hostContext\n  ) {\n    var instance = fiber.stateNode;\n    var updatePayload = hydrateInstance(\n      instance,\n      fiber.type,\n      fiber.memoizedProps,\n      rootContainerInstance,\n      hostContext,\n      fiber\n    );\n    // TODO: Type this specific to this type of component.\n    fiber.updateQueue = updatePayload;\n    // If the update payload indicates that there is a change or if there\n    // is a new ref we mark this as an update.\n    if (updatePayload !== null) {\n      return true;\n    }\n    return false;\n  }\n\n  function prepareToHydrateHostTextInstance(fiber) {\n    var textInstance = fiber.stateNode;\n    var textContent = fiber.memoizedProps;\n    var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);\n    {\n      if (shouldUpdate) {\n        // We assume that prepareToHydrateHostTextInstance is called in a context where the\n        // hydration parent is the parent host component of this host text.\n        var returnFiber = hydrationParentFiber;\n        if (returnFiber !== null) {\n          switch (returnFiber.tag) {\n            case HostRoot: {\n              var parentContainer = returnFiber.stateNode.containerInfo;\n              didNotMatchHydratedContainerTextInstance(\n                parentContainer,\n                textInstance,\n                textContent\n              );\n              break;\n            }\n            case HostComponent: {\n              var parentType = returnFiber.type;\n              var parentProps = returnFiber.memoizedProps;\n              var parentInstance = returnFiber.stateNode;\n              didNotMatchHydratedTextInstance(\n                parentType,\n                parentProps,\n                parentInstance,\n                textInstance,\n                textContent\n              );\n              break;\n            }\n          }\n        }\n      }\n    }\n    return shouldUpdate;\n  }\n\n  function popToNextHostParent(fiber) {\n    var parent = fiber[\"return\"];\n    while (\n      parent !== null &&\n      parent.tag !== HostComponent &&\n      parent.tag !== HostRoot\n    ) {\n      parent = parent[\"return\"];\n    }\n    hydrationParentFiber = parent;\n  }\n\n  function popHydrationState(fiber) {\n    if (fiber !== hydrationParentFiber) {\n      // We're deeper than the current hydration context, inside an inserted\n      // tree.\n      return false;\n    }\n    if (!isHydrating) {\n      // If we're not currently hydrating but we're in a hydration context, then\n      // we were an insertion and now need to pop up reenter hydration of our\n      // siblings.\n      popToNextHostParent(fiber);\n      isHydrating = true;\n      return false;\n    }\n\n    var type = fiber.type;\n\n    // If we have any remaining hydratable nodes, we need to delete them now.\n    // We only do this deeper than head and body since they tend to have random\n    // other nodes in them. We also ignore components with pure text content in\n    // side of them.\n    // TODO: Better heuristic.\n    if (\n      fiber.tag !== HostComponent ||\n      (type !== \"head\" &&\n        type !== \"body\" &&\n        !shouldSetTextContent(type, fiber.memoizedProps))\n    ) {\n      var nextInstance = nextHydratableInstance;\n      while (nextInstance) {\n        deleteHydratableInstance(fiber, nextInstance);\n        nextInstance = getNextHydratableSibling(nextInstance);\n      }\n    }\n\n    popToNextHostParent(fiber);\n    nextHydratableInstance = hydrationParentFiber\n      ? getNextHydratableSibling(fiber.stateNode)\n      : null;\n    return true;\n  }\n\n  function resetHydrationState() {\n    hydrationParentFiber = null;\n    nextHydratableInstance = null;\n    isHydrating = false;\n  }\n\n  return {\n    enterHydrationState: enterHydrationState,\n    resetHydrationState: resetHydrationState,\n    tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance,\n    prepareToHydrateHostInstance: prepareToHydrateHostInstance,\n    prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance,\n    popHydrationState: popHydrationState\n  };\n};\n\n// This lets us hook into Fiber to debug what it's doing.\n// See https://github.com/facebook/react/pull/8033.\n// This is not part of the public API, not even for React DevTools.\n// You may only inject a debugTool if you work on React Fiber itself.\nvar ReactFiberInstrumentation = {\n  debugTool: null\n};\n\nvar ReactFiberInstrumentation_1 = ReactFiberInstrumentation;\n\nvar invokeGuardedCallback$1 = ReactErrorUtils.invokeGuardedCallback;\nvar hasCaughtError = ReactErrorUtils.hasCaughtError;\nvar clearCaughtError = ReactErrorUtils.clearCaughtError;\n\n{\n  var didWarnAboutStateTransition = false;\n  var didWarnSetStateChildContext = false;\n  var didWarnStateUpdateForUnmountedComponent = {};\n\n  var warnAboutUpdateOnUnmounted = function(fiber) {\n    var componentName = getComponentName(fiber) || \"ReactClass\";\n    if (didWarnStateUpdateForUnmountedComponent[componentName]) {\n      return;\n    }\n    warning(\n      false,\n      \"Can only update a mounted or mounting \" +\n        \"component. This usually means you called setState, replaceState, \" +\n        \"or forceUpdate on an unmounted component. This is a no-op.\\n\\nPlease \" +\n        \"check the code for the %s component.\",\n      componentName\n    );\n    didWarnStateUpdateForUnmountedComponent[componentName] = true;\n  };\n\n  var warnAboutInvalidUpdates = function(instance) {\n    switch (ReactDebugCurrentFiber.phase) {\n      case \"getChildContext\":\n        if (didWarnSetStateChildContext) {\n          return;\n        }\n        warning(\n          false,\n          \"setState(...): Cannot call setState() inside getChildContext()\"\n        );\n        didWarnSetStateChildContext = true;\n        break;\n      case \"render\":\n        if (didWarnAboutStateTransition) {\n          return;\n        }\n        warning(\n          false,\n          \"Cannot update during an existing state transition (such as within \" +\n            \"`render` or another component's constructor). Render methods should \" +\n            \"be a pure function of props and state; constructor side-effects are \" +\n            \"an anti-pattern, but can be moved to `componentWillMount`.\"\n        );\n        didWarnAboutStateTransition = true;\n        break;\n    }\n  };\n}\n\nvar ReactFiberScheduler = function(config) {\n  var hostContext = ReactFiberHostContext(config);\n  var hydrationContext = ReactFiberHydrationContext(config);\n  var popHostContainer = hostContext.popHostContainer,\n    popHostContext = hostContext.popHostContext,\n    resetHostContainer = hostContext.resetHostContainer;\n\n  var _ReactFiberBeginWork = ReactFiberBeginWork(\n      config,\n      hostContext,\n      hydrationContext,\n      scheduleWork,\n      computeExpirationForFiber\n    ),\n    beginWork = _ReactFiberBeginWork.beginWork,\n    beginFailedWork = _ReactFiberBeginWork.beginFailedWork;\n\n  var _ReactFiberCompleteWo = ReactFiberCompleteWork(\n      config,\n      hostContext,\n      hydrationContext\n    ),\n    completeWork = _ReactFiberCompleteWo.completeWork;\n\n  var _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError),\n    commitResetTextContent = _ReactFiberCommitWork.commitResetTextContent,\n    commitPlacement = _ReactFiberCommitWork.commitPlacement,\n    commitDeletion = _ReactFiberCommitWork.commitDeletion,\n    commitWork = _ReactFiberCommitWork.commitWork,\n    commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles,\n    commitAttachRef = _ReactFiberCommitWork.commitAttachRef,\n    commitDetachRef = _ReactFiberCommitWork.commitDetachRef;\n\n  var now = config.now,\n    scheduleDeferredCallback = config.scheduleDeferredCallback,\n    cancelDeferredCallback = config.cancelDeferredCallback,\n    useSyncScheduling = config.useSyncScheduling,\n    prepareForCommit = config.prepareForCommit,\n    resetAfterCommit = config.resetAfterCommit;\n\n  // Represents the current time in ms.\n\n  var startTime = now();\n  var mostRecentCurrentTime = msToExpirationTime(0);\n\n  // Used to ensure computeUniqueAsyncExpiration is monotonically increases.\n  var lastUniqueAsyncExpiration = 0;\n\n  // Represents the expiration time that incoming updates should use. (If this\n  // is NoWork, use the default strategy: async updates in async mode, sync\n  // updates in sync mode.)\n  var expirationContext = NoWork;\n\n  var isWorking = false;\n\n  // The next work in progress fiber that we're currently working on.\n  var nextUnitOfWork = null;\n  var nextRoot = null;\n  // The time at which we're currently rendering work.\n  var nextRenderExpirationTime = NoWork;\n\n  // The next fiber with an effect that we're currently committing.\n  var nextEffect = null;\n\n  // Keep track of which fibers have captured an error that need to be handled.\n  // Work is removed from this collection after componentDidCatch is called.\n  var capturedErrors = null;\n  // Keep track of which fibers have failed during the current batch of work.\n  // This is a different set than capturedErrors, because it is not reset until\n  // the end of the batch. This is needed to propagate errors correctly if a\n  // subtree fails more than once.\n  var failedBoundaries = null;\n  // Error boundaries that captured an error during the current commit.\n  var commitPhaseBoundaries = null;\n  var firstUncaughtError = null;\n  var didFatal = false;\n\n  var isCommitting = false;\n  var isUnmounting = false;\n\n  // Used for performance tracking.\n  var interruptedBy = null;\n\n  function resetContextStack() {\n    // Reset the stack\n    reset();\n    // Reset the cursors\n    resetContext();\n    resetHostContainer();\n  }\n\n  function commitAllHostEffects() {\n    while (nextEffect !== null) {\n      {\n        ReactDebugCurrentFiber.setCurrentFiber(nextEffect);\n      }\n      recordEffect();\n\n      var effectTag = nextEffect.effectTag;\n      if (effectTag & ContentReset) {\n        commitResetTextContent(nextEffect);\n      }\n\n      if (effectTag & Ref) {\n        var current = nextEffect.alternate;\n        if (current !== null) {\n          commitDetachRef(current);\n        }\n      }\n\n      // The following switch statement is only concerned about placement,\n      // updates, and deletions. To avoid needing to add a case for every\n      // possible bitmap value, we remove the secondary effects from the\n      // effect tag and switch on that value.\n      var primaryEffectTag =\n        effectTag & ~(Callback | Err | ContentReset | Ref | PerformedWork);\n      switch (primaryEffectTag) {\n        case Placement: {\n          commitPlacement(nextEffect);\n          // Clear the \"placement\" from effect tag so that we know that this is inserted, before\n          // any life-cycles like componentDidMount gets called.\n          // TODO: findDOMNode doesn't rely on this any more but isMounted\n          // does and isMounted is deprecated anyway so we should be able\n          // to kill this.\n          nextEffect.effectTag &= ~Placement;\n          break;\n        }\n        case PlacementAndUpdate: {\n          // Placement\n          commitPlacement(nextEffect);\n          // Clear the \"placement\" from effect tag so that we know that this is inserted, before\n          // any life-cycles like componentDidMount gets called.\n          nextEffect.effectTag &= ~Placement;\n\n          // Update\n          var _current = nextEffect.alternate;\n          commitWork(_current, nextEffect);\n          break;\n        }\n        case Update: {\n          var _current2 = nextEffect.alternate;\n          commitWork(_current2, nextEffect);\n          break;\n        }\n        case Deletion: {\n          isUnmounting = true;\n          commitDeletion(nextEffect);\n          isUnmounting = false;\n          break;\n        }\n      }\n      nextEffect = nextEffect.nextEffect;\n    }\n\n    {\n      ReactDebugCurrentFiber.resetCurrentFiber();\n    }\n  }\n\n  function commitAllLifeCycles() {\n    while (nextEffect !== null) {\n      var effectTag = nextEffect.effectTag;\n\n      if (effectTag & (Update | Callback)) {\n        recordEffect();\n        var current = nextEffect.alternate;\n        commitLifeCycles(current, nextEffect);\n      }\n\n      if (effectTag & Ref) {\n        recordEffect();\n        commitAttachRef(nextEffect);\n      }\n\n      if (effectTag & Err) {\n        recordEffect();\n        commitErrorHandling(nextEffect);\n      }\n\n      var next = nextEffect.nextEffect;\n      // Ensure that we clean these up so that we don't accidentally keep them.\n      // I'm not actually sure this matters because we can't reset firstEffect\n      // and lastEffect since they're on every node, not just the effectful\n      // ones. So we have to clean everything as we reuse nodes anyway.\n      nextEffect.nextEffect = null;\n      // Ensure that we reset the effectTag here so that we can rely on effect\n      // tags to reason about the current life-cycle.\n      nextEffect = next;\n    }\n  }\n\n  function commitRoot(finishedWork) {\n    // We keep track of this so that captureError can collect any boundaries\n    // that capture an error during the commit phase. The reason these aren't\n    // local to this function is because errors that occur during cWU are\n    // captured elsewhere, to prevent the unmount from being interrupted.\n    isWorking = true;\n    isCommitting = true;\n    startCommitTimer();\n\n    var root = finishedWork.stateNode;\n    invariant(\n      root.current !== finishedWork,\n      \"Cannot commit the same tree as before. This is probably a bug \" +\n        \"related to the return field. This error is likely caused by a bug \" +\n        \"in React. Please file an issue.\"\n    );\n    root.isReadyForCommit = false;\n\n    // Reset this to null before calling lifecycles\n    ReactCurrentOwner.current = null;\n\n    var firstEffect = void 0;\n    if (finishedWork.effectTag > PerformedWork) {\n      // A fiber's effect list consists only of its children, not itself. So if\n      // the root has an effect, we need to add it to the end of the list. The\n      // resulting list is the set that would belong to the root's parent, if\n      // it had one; that is, all the effects in the tree including the root.\n      if (finishedWork.lastEffect !== null) {\n        finishedWork.lastEffect.nextEffect = finishedWork;\n        firstEffect = finishedWork.firstEffect;\n      } else {\n        firstEffect = finishedWork;\n      }\n    } else {\n      // There is no effect on the root.\n      firstEffect = finishedWork.firstEffect;\n    }\n\n    prepareForCommit();\n\n    // Commit all the side-effects within a tree. We'll do this in two passes.\n    // The first pass performs all the host insertions, updates, deletions and\n    // ref unmounts.\n    nextEffect = firstEffect;\n    startCommitHostEffectsTimer();\n    while (nextEffect !== null) {\n      var didError = false;\n      var _error = void 0;\n      {\n        invokeGuardedCallback$1(null, commitAllHostEffects, null);\n        if (hasCaughtError()) {\n          didError = true;\n          _error = clearCaughtError();\n        }\n      }\n      if (didError) {\n        invariant(\n          nextEffect !== null,\n          \"Should have next effect. This error is likely caused by a bug \" +\n            \"in React. Please file an issue.\"\n        );\n        captureError(nextEffect, _error);\n        // Clean-up\n        if (nextEffect !== null) {\n          nextEffect = nextEffect.nextEffect;\n        }\n      }\n    }\n    stopCommitHostEffectsTimer();\n\n    resetAfterCommit();\n\n    // The work-in-progress tree is now the current tree. This must come after\n    // the first pass of the commit phase, so that the previous tree is still\n    // current during componentWillUnmount, but before the second pass, so that\n    // the finished work is current during componentDidMount/Update.\n    root.current = finishedWork;\n\n    // In the second pass we'll perform all life-cycles and ref callbacks.\n    // Life-cycles happen as a separate pass so that all placements, updates,\n    // and deletions in the entire tree have already been invoked.\n    // This pass also triggers any renderer-specific initial effects.\n    nextEffect = firstEffect;\n    startCommitLifeCyclesTimer();\n    while (nextEffect !== null) {\n      var _didError = false;\n      var _error2 = void 0;\n      {\n        invokeGuardedCallback$1(null, commitAllLifeCycles, null);\n        if (hasCaughtError()) {\n          _didError = true;\n          _error2 = clearCaughtError();\n        }\n      }\n      if (_didError) {\n        invariant(\n          nextEffect !== null,\n          \"Should have next effect. This error is likely caused by a bug \" +\n            \"in React. Please file an issue.\"\n        );\n        captureError(nextEffect, _error2);\n        if (nextEffect !== null) {\n          nextEffect = nextEffect.nextEffect;\n        }\n      }\n    }\n\n    isCommitting = false;\n    isWorking = false;\n    stopCommitLifeCyclesTimer();\n    stopCommitTimer();\n    if (typeof onCommitRoot === \"function\") {\n      onCommitRoot(finishedWork.stateNode);\n    }\n    if (true && ReactFiberInstrumentation_1.debugTool) {\n      ReactFiberInstrumentation_1.debugTool.onCommitWork(finishedWork);\n    }\n\n    // If we caught any errors during this commit, schedule their boundaries\n    // to update.\n    if (commitPhaseBoundaries) {\n      commitPhaseBoundaries.forEach(scheduleErrorRecovery);\n      commitPhaseBoundaries = null;\n    }\n\n    if (firstUncaughtError !== null) {\n      var _error3 = firstUncaughtError;\n      firstUncaughtError = null;\n      onUncaughtError(_error3);\n    }\n\n    var remainingTime = root.current.expirationTime;\n\n    if (remainingTime === NoWork) {\n      capturedErrors = null;\n      failedBoundaries = null;\n    }\n\n    return remainingTime;\n  }\n\n  function resetExpirationTime(workInProgress, renderTime) {\n    if (renderTime !== Never && workInProgress.expirationTime === Never) {\n      // The children of this component are hidden. Don't bubble their\n      // expiration times.\n      return;\n    }\n\n    // Check for pending updates.\n    var newExpirationTime = getUpdateExpirationTime(workInProgress);\n\n    // TODO: Calls need to visit stateNode\n\n    // Bubble up the earliest expiration time.\n    var child = workInProgress.child;\n    while (child !== null) {\n      if (\n        child.expirationTime !== NoWork &&\n        (newExpirationTime === NoWork ||\n          newExpirationTime > child.expirationTime)\n      ) {\n        newExpirationTime = child.expirationTime;\n      }\n      child = child.sibling;\n    }\n    workInProgress.expirationTime = newExpirationTime;\n  }\n\n  function completeUnitOfWork(workInProgress) {\n    while (true) {\n      // The current, flushed, state of this fiber is the alternate.\n      // Ideally nothing should rely on this, but relying on it here\n      // means that we don't need an additional field on the work in\n      // progress.\n      var current = workInProgress.alternate;\n      {\n        ReactDebugCurrentFiber.setCurrentFiber(workInProgress);\n      }\n      var next = completeWork(\n        current,\n        workInProgress,\n        nextRenderExpirationTime\n      );\n      {\n        ReactDebugCurrentFiber.resetCurrentFiber();\n      }\n\n      var returnFiber = workInProgress[\"return\"];\n      var siblingFiber = workInProgress.sibling;\n\n      resetExpirationTime(workInProgress, nextRenderExpirationTime);\n\n      if (next !== null) {\n        stopWorkTimer(workInProgress);\n        if (true && ReactFiberInstrumentation_1.debugTool) {\n          ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);\n        }\n        // If completing this work spawned new work, do that next. We'll come\n        // back here again.\n        return next;\n      }\n\n      if (returnFiber !== null) {\n        // Append all the effects of the subtree and this fiber onto the effect\n        // list of the parent. The completion order of the children affects the\n        // side-effect order.\n        if (returnFiber.firstEffect === null) {\n          returnFiber.firstEffect = workInProgress.firstEffect;\n        }\n        if (workInProgress.lastEffect !== null) {\n          if (returnFiber.lastEffect !== null) {\n            returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;\n          }\n          returnFiber.lastEffect = workInProgress.lastEffect;\n        }\n\n        // If this fiber had side-effects, we append it AFTER the children's\n        // side-effects. We can perform certain side-effects earlier if\n        // needed, by doing multiple passes over the effect list. We don't want\n        // to schedule our own side-effect on our own list because if end up\n        // reusing children we'll schedule this effect onto itself since we're\n        // at the end.\n        var effectTag = workInProgress.effectTag;\n        // Skip both NoWork and PerformedWork tags when creating the effect list.\n        // PerformedWork effect is read by React DevTools but shouldn't be committed.\n        if (effectTag > PerformedWork) {\n          if (returnFiber.lastEffect !== null) {\n            returnFiber.lastEffect.nextEffect = workInProgress;\n          } else {\n            returnFiber.firstEffect = workInProgress;\n          }\n          returnFiber.lastEffect = workInProgress;\n        }\n      }\n\n      stopWorkTimer(workInProgress);\n      if (true && ReactFiberInstrumentation_1.debugTool) {\n        ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);\n      }\n\n      if (siblingFiber !== null) {\n        // If there is more work to do in this returnFiber, do that next.\n        return siblingFiber;\n      } else if (returnFiber !== null) {\n        // If there's no more work in this returnFiber. Complete the returnFiber.\n        workInProgress = returnFiber;\n        continue;\n      } else {\n        // We've reached the root.\n        var root = workInProgress.stateNode;\n        root.isReadyForCommit = true;\n        return null;\n      }\n    }\n\n    // Without this explicit null return Flow complains of invalid return type\n    // TODO Remove the above while(true) loop\n    // eslint-disable-next-line no-unreachable\n    return null;\n  }\n\n  function performUnitOfWork(workInProgress) {\n    // The current, flushed, state of this fiber is the alternate.\n    // Ideally nothing should rely on this, but relying on it here\n    // means that we don't need an additional field on the work in\n    // progress.\n    var current = workInProgress.alternate;\n\n    // See if beginning this work spawns more work.\n    startWorkTimer(workInProgress);\n    {\n      ReactDebugCurrentFiber.setCurrentFiber(workInProgress);\n    }\n\n    var next = beginWork(current, workInProgress, nextRenderExpirationTime);\n    {\n      ReactDebugCurrentFiber.resetCurrentFiber();\n    }\n    if (true && ReactFiberInstrumentation_1.debugTool) {\n      ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);\n    }\n\n    if (next === null) {\n      // If this doesn't spawn new work, complete the current work.\n      next = completeUnitOfWork(workInProgress);\n    }\n\n    ReactCurrentOwner.current = null;\n\n    return next;\n  }\n\n  function performFailedUnitOfWork(workInProgress) {\n    // The current, flushed, state of this fiber is the alternate.\n    // Ideally nothing should rely on this, but relying on it here\n    // means that we don't need an additional field on the work in\n    // progress.\n    var current = workInProgress.alternate;\n\n    // See if beginning this work spawns more work.\n    startWorkTimer(workInProgress);\n    {\n      ReactDebugCurrentFiber.setCurrentFiber(workInProgress);\n    }\n    var next = beginFailedWork(\n      current,\n      workInProgress,\n      nextRenderExpirationTime\n    );\n    {\n      ReactDebugCurrentFiber.resetCurrentFiber();\n    }\n    if (true && ReactFiberInstrumentation_1.debugTool) {\n      ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);\n    }\n\n    if (next === null) {\n      // If this doesn't spawn new work, complete the current work.\n      next = completeUnitOfWork(workInProgress);\n    }\n\n    ReactCurrentOwner.current = null;\n\n    return next;\n  }\n\n  function workLoop(expirationTime) {\n    if (capturedErrors !== null) {\n      // If there are unhandled errors, switch to the slow work loop.\n      // TODO: How to avoid this check in the fast path? Maybe the renderer\n      // could keep track of which roots have unhandled errors and call a\n      // forked version of renderRoot.\n      slowWorkLoopThatChecksForFailedWork(expirationTime);\n      return;\n    }\n    if (\n      nextRenderExpirationTime === NoWork ||\n      nextRenderExpirationTime > expirationTime\n    ) {\n      return;\n    }\n\n    if (nextRenderExpirationTime <= mostRecentCurrentTime) {\n      // Flush all expired work.\n      while (nextUnitOfWork !== null) {\n        nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n      }\n    } else {\n      // Flush asynchronous work until the deadline runs out of time.\n      while (nextUnitOfWork !== null && !shouldYield()) {\n        nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n      }\n    }\n  }\n\n  function slowWorkLoopThatChecksForFailedWork(expirationTime) {\n    if (\n      nextRenderExpirationTime === NoWork ||\n      nextRenderExpirationTime > expirationTime\n    ) {\n      return;\n    }\n\n    if (nextRenderExpirationTime <= mostRecentCurrentTime) {\n      // Flush all expired work.\n      while (nextUnitOfWork !== null) {\n        if (hasCapturedError(nextUnitOfWork)) {\n          // Use a forked version of performUnitOfWork\n          nextUnitOfWork = performFailedUnitOfWork(nextUnitOfWork);\n        } else {\n          nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n        }\n      }\n    } else {\n      // Flush asynchronous work until the deadline runs out of time.\n      while (nextUnitOfWork !== null && !shouldYield()) {\n        if (hasCapturedError(nextUnitOfWork)) {\n          // Use a forked version of performUnitOfWork\n          nextUnitOfWork = performFailedUnitOfWork(nextUnitOfWork);\n        } else {\n          nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n        }\n      }\n    }\n  }\n\n  function renderRootCatchBlock(root, failedWork, boundary, expirationTime) {\n    // We're going to restart the error boundary that captured the error.\n    // Conceptually, we're unwinding the stack. We need to unwind the\n    // context stack, too.\n    unwindContexts(failedWork, boundary);\n\n    // Restart the error boundary using a forked version of\n    // performUnitOfWork that deletes the boundary's children. The entire\n    // failed subree will be unmounted. During the commit phase, a special\n    // lifecycle method is called on the error boundary, which triggers\n    // a re-render.\n    nextUnitOfWork = performFailedUnitOfWork(boundary);\n\n    // Continue working.\n    workLoop(expirationTime);\n  }\n\n  function renderRoot(root, expirationTime) {\n    invariant(\n      !isWorking,\n      \"renderRoot was called recursively. This error is likely caused \" +\n        \"by a bug in React. Please file an issue.\"\n    );\n    isWorking = true;\n\n    // We're about to mutate the work-in-progress tree. If the root was pending\n    // commit, it no longer is: we'll need to complete it again.\n    root.isReadyForCommit = false;\n\n    // Check if we're starting from a fresh stack, or if we're resuming from\n    // previously yielded work.\n    if (\n      root !== nextRoot ||\n      expirationTime !== nextRenderExpirationTime ||\n      nextUnitOfWork === null\n    ) {\n      // Reset the stack and start working from the root.\n      resetContextStack();\n      nextRoot = root;\n      nextRenderExpirationTime = expirationTime;\n      nextUnitOfWork = createWorkInProgress(\n        nextRoot.current,\n        null,\n        expirationTime\n      );\n    }\n\n    startWorkLoopTimer(nextUnitOfWork);\n\n    var didError = false;\n    var error = null;\n    {\n      invokeGuardedCallback$1(null, workLoop, null, expirationTime);\n      if (hasCaughtError()) {\n        didError = true;\n        error = clearCaughtError();\n      }\n    }\n\n    // An error was thrown during the render phase.\n    while (didError) {\n      if (didFatal) {\n        // This was a fatal error. Don't attempt to recover from it.\n        firstUncaughtError = error;\n        break;\n      }\n\n      var failedWork = nextUnitOfWork;\n      if (failedWork === null) {\n        // An error was thrown but there's no current unit of work. This can\n        // happen during the commit phase if there's a bug in the renderer.\n        didFatal = true;\n        continue;\n      }\n\n      // \"Capture\" the error by finding the nearest boundary. If there is no\n      // error boundary, we use the root.\n      var boundary = captureError(failedWork, error);\n      invariant(\n        boundary !== null,\n        \"Should have found an error boundary. This error is likely \" +\n          \"caused by a bug in React. Please file an issue.\"\n      );\n\n      if (didFatal) {\n        // The error we just captured was a fatal error. This happens\n        // when the error propagates to the root more than once.\n        continue;\n      }\n\n      didError = false;\n      error = null;\n      {\n        invokeGuardedCallback$1(\n          null,\n          renderRootCatchBlock,\n          null,\n          root,\n          failedWork,\n          boundary,\n          expirationTime\n        );\n        if (hasCaughtError()) {\n          didError = true;\n          error = clearCaughtError();\n          continue;\n        }\n      }\n      // We're finished working. Exit the error loop.\n      break;\n    }\n\n    var uncaughtError = firstUncaughtError;\n\n    // We're done performing work. Time to clean up.\n    stopWorkLoopTimer(interruptedBy);\n    interruptedBy = null;\n    isWorking = false;\n    didFatal = false;\n    firstUncaughtError = null;\n\n    if (uncaughtError !== null) {\n      onUncaughtError(uncaughtError);\n    }\n\n    return root.isReadyForCommit ? root.current.alternate : null;\n  }\n\n  // Returns the boundary that captured the error, or null if the error is ignored\n  function captureError(failedWork, error) {\n    // It is no longer valid because we exited the user code.\n    ReactCurrentOwner.current = null;\n    {\n      ReactDebugCurrentFiber.resetCurrentFiber();\n    }\n\n    // Search for the nearest error boundary.\n    var boundary = null;\n\n    // Passed to logCapturedError()\n    var errorBoundaryFound = false;\n    var willRetry = false;\n    var errorBoundaryName = null;\n\n    // Host containers are a special case. If the failed work itself is a host\n    // container, then it acts as its own boundary. In all other cases, we\n    // ignore the work itself and only search through the parents.\n    if (failedWork.tag === HostRoot) {\n      boundary = failedWork;\n\n      if (isFailedBoundary(failedWork)) {\n        // If this root already failed, there must have been an error when\n        // attempting to unmount it. This is a worst-case scenario and\n        // should only be possible if there's a bug in the renderer.\n        didFatal = true;\n      }\n    } else {\n      var node = failedWork[\"return\"];\n      while (node !== null && boundary === null) {\n        if (node.tag === ClassComponent) {\n          var instance = node.stateNode;\n          if (typeof instance.componentDidCatch === \"function\") {\n            errorBoundaryFound = true;\n            errorBoundaryName = getComponentName(node);\n\n            // Found an error boundary!\n            boundary = node;\n            willRetry = true;\n          }\n        } else if (node.tag === HostRoot) {\n          // Treat the root like a no-op error boundary\n          boundary = node;\n        }\n\n        if (isFailedBoundary(node)) {\n          // This boundary is already in a failed state.\n\n          // If we're currently unmounting, that means this error was\n          // thrown while unmounting a failed subtree. We should ignore\n          // the error.\n          if (isUnmounting) {\n            return null;\n          }\n\n          // If we're in the commit phase, we should check to see if\n          // this boundary already captured an error during this commit.\n          // This case exists because multiple errors can be thrown during\n          // a single commit without interruption.\n          if (\n            commitPhaseBoundaries !== null &&\n            (commitPhaseBoundaries.has(node) ||\n              (node.alternate !== null &&\n                commitPhaseBoundaries.has(node.alternate)))\n          ) {\n            // If so, we should ignore this error.\n            return null;\n          }\n\n          // The error should propagate to the next boundary -— we keep looking.\n          boundary = null;\n          willRetry = false;\n        }\n\n        node = node[\"return\"];\n      }\n    }\n\n    if (boundary !== null) {\n      // Add to the collection of failed boundaries. This lets us know that\n      // subsequent errors in this subtree should propagate to the next boundary.\n      if (failedBoundaries === null) {\n        failedBoundaries = new Set();\n      }\n      failedBoundaries.add(boundary);\n\n      // This method is unsafe outside of the begin and complete phases.\n      // We might be in the commit phase when an error is captured.\n      // The risk is that the return path from this Fiber may not be accurate.\n      // That risk is acceptable given the benefit of providing users more context.\n      var _componentStack = getStackAddendumByWorkInProgressFiber(failedWork);\n      var _componentName = getComponentName(failedWork);\n\n      // Add to the collection of captured errors. This is stored as a global\n      // map of errors and their component stack location keyed by the boundaries\n      // that capture them. We mostly use this Map as a Set; it's a Map only to\n      // avoid adding a field to Fiber to store the error.\n      if (capturedErrors === null) {\n        capturedErrors = new Map();\n      }\n\n      var capturedError = {\n        componentName: _componentName,\n        componentStack: _componentStack,\n        error: error,\n        errorBoundary: errorBoundaryFound ? boundary.stateNode : null,\n        errorBoundaryFound: errorBoundaryFound,\n        errorBoundaryName: errorBoundaryName,\n        willRetry: willRetry\n      };\n\n      capturedErrors.set(boundary, capturedError);\n\n      try {\n        logCapturedError(capturedError);\n      } catch (e) {\n        // Prevent cycle if logCapturedError() throws.\n        // A cycle may still occur if logCapturedError renders a component that throws.\n        var suppressLogging = e && e.suppressReactErrorLogging;\n        if (!suppressLogging) {\n          console.error(e);\n        }\n      }\n\n      // If we're in the commit phase, defer scheduling an update on the\n      // boundary until after the commit is complete\n      if (isCommitting) {\n        if (commitPhaseBoundaries === null) {\n          commitPhaseBoundaries = new Set();\n        }\n        commitPhaseBoundaries.add(boundary);\n      } else {\n        // Otherwise, schedule an update now.\n        // TODO: Is this actually necessary during the render phase? Is it\n        // possible to unwind and continue rendering at the same priority,\n        // without corrupting internal state?\n        scheduleErrorRecovery(boundary);\n      }\n      return boundary;\n    } else if (firstUncaughtError === null) {\n      // If no boundary is found, we'll need to throw the error\n      firstUncaughtError = error;\n    }\n    return null;\n  }\n\n  function hasCapturedError(fiber) {\n    // TODO: capturedErrors should store the boundary instance, to avoid needing\n    // to check the alternate.\n    return (\n      capturedErrors !== null &&\n      (capturedErrors.has(fiber) ||\n        (fiber.alternate !== null && capturedErrors.has(fiber.alternate)))\n    );\n  }\n\n  function isFailedBoundary(fiber) {\n    // TODO: failedBoundaries should store the boundary instance, to avoid\n    // needing to check the alternate.\n    return (\n      failedBoundaries !== null &&\n      (failedBoundaries.has(fiber) ||\n        (fiber.alternate !== null && failedBoundaries.has(fiber.alternate)))\n    );\n  }\n\n  function commitErrorHandling(effectfulFiber) {\n    var capturedError = void 0;\n    if (capturedErrors !== null) {\n      capturedError = capturedErrors.get(effectfulFiber);\n      capturedErrors[\"delete\"](effectfulFiber);\n      if (capturedError == null) {\n        if (effectfulFiber.alternate !== null) {\n          effectfulFiber = effectfulFiber.alternate;\n          capturedError = capturedErrors.get(effectfulFiber);\n          capturedErrors[\"delete\"](effectfulFiber);\n        }\n      }\n    }\n\n    invariant(\n      capturedError != null,\n      \"No error for given unit of work. This error is likely caused by a \" +\n        \"bug in React. Please file an issue.\"\n    );\n\n    switch (effectfulFiber.tag) {\n      case ClassComponent:\n        var instance = effectfulFiber.stateNode;\n\n        var info = {\n          componentStack: capturedError.componentStack\n        };\n\n        // Allow the boundary to handle the error, usually by scheduling\n        // an update to itself\n        instance.componentDidCatch(capturedError.error, info);\n        return;\n      case HostRoot:\n        if (firstUncaughtError === null) {\n          firstUncaughtError = capturedError.error;\n        }\n        return;\n      default:\n        invariant(\n          false,\n          \"Invalid type of work. This error is likely caused by a bug in \" +\n            \"React. Please file an issue.\"\n        );\n    }\n  }\n\n  function unwindContexts(from, to) {\n    var node = from;\n    while (node !== null) {\n      switch (node.tag) {\n        case ClassComponent:\n          popContextProvider(node);\n          break;\n        case HostComponent:\n          popHostContext(node);\n          break;\n        case HostRoot:\n          popHostContainer(node);\n          break;\n        case HostPortal:\n          popHostContainer(node);\n          break;\n      }\n      if (node === to || node.alternate === to) {\n        stopFailedWorkTimer(node);\n        break;\n      } else {\n        stopWorkTimer(node);\n      }\n      node = node[\"return\"];\n    }\n  }\n\n  function computeAsyncExpiration() {\n    // Given the current clock time, returns an expiration time. We use rounding\n    // to batch like updates together.\n    // Should complete within ~1000ms. 1200ms max.\n    var currentTime = recalculateCurrentTime();\n    var expirationMs = 1000;\n    var bucketSizeMs = 200;\n    return computeExpirationBucket(currentTime, expirationMs, bucketSizeMs);\n  }\n\n  // Creates a unique async expiration time.\n  function computeUniqueAsyncExpiration() {\n    var result = computeAsyncExpiration();\n    if (result <= lastUniqueAsyncExpiration) {\n      // Since we assume the current time monotonically increases, we only hit\n      // this branch when computeUniqueAsyncExpiration is fired multiple times\n      // within a 200ms window (or whatever the async bucket size is).\n      result = lastUniqueAsyncExpiration + 1;\n    }\n    lastUniqueAsyncExpiration = result;\n    return lastUniqueAsyncExpiration;\n  }\n\n  function computeExpirationForFiber(fiber) {\n    var expirationTime = void 0;\n    if (expirationContext !== NoWork) {\n      // An explicit expiration context was set;\n      expirationTime = expirationContext;\n    } else if (isWorking) {\n      if (isCommitting) {\n        // Updates that occur during the commit phase should have sync priority\n        // by default.\n        expirationTime = Sync;\n      } else {\n        // Updates during the render phase should expire at the same time as\n        // the work that is being rendered.\n        expirationTime = nextRenderExpirationTime;\n      }\n    } else {\n      // No explicit expiration context was set, and we're not currently\n      // performing work. Calculate a new expiration time.\n      if (useSyncScheduling && !(fiber.internalContextTag & AsyncUpdates)) {\n        // This is a sync update\n        expirationTime = Sync;\n      } else {\n        // This is an async update\n        expirationTime = computeAsyncExpiration();\n      }\n    }\n    return expirationTime;\n  }\n\n  function scheduleWork(fiber, expirationTime) {\n    return scheduleWorkImpl(fiber, expirationTime, false);\n  }\n\n  function checkRootNeedsClearing(root, fiber, expirationTime) {\n    if (\n      !isWorking &&\n      root === nextRoot &&\n      expirationTime < nextRenderExpirationTime\n    ) {\n      // Restart the root from the top.\n      if (nextUnitOfWork !== null) {\n        // This is an interruption. (Used for performance tracking.)\n        interruptedBy = fiber;\n      }\n      nextRoot = null;\n      nextUnitOfWork = null;\n      nextRenderExpirationTime = NoWork;\n    }\n  }\n\n  function scheduleWorkImpl(fiber, expirationTime, isErrorRecovery) {\n    recordScheduleUpdate();\n\n    {\n      if (!isErrorRecovery && fiber.tag === ClassComponent) {\n        var instance = fiber.stateNode;\n        warnAboutInvalidUpdates(instance);\n      }\n    }\n\n    var node = fiber;\n    while (node !== null) {\n      // Walk the parent path to the root and update each node's\n      // expiration time.\n      if (\n        node.expirationTime === NoWork ||\n        node.expirationTime > expirationTime\n      ) {\n        node.expirationTime = expirationTime;\n      }\n      if (node.alternate !== null) {\n        if (\n          node.alternate.expirationTime === NoWork ||\n          node.alternate.expirationTime > expirationTime\n        ) {\n          node.alternate.expirationTime = expirationTime;\n        }\n      }\n      if (node[\"return\"] === null) {\n        if (node.tag === HostRoot) {\n          var root = node.stateNode;\n\n          checkRootNeedsClearing(root, fiber, expirationTime);\n          requestWork(root, expirationTime);\n          checkRootNeedsClearing(root, fiber, expirationTime);\n        } else {\n          {\n            if (!isErrorRecovery && fiber.tag === ClassComponent) {\n              warnAboutUpdateOnUnmounted(fiber);\n            }\n          }\n          return;\n        }\n      }\n      node = node[\"return\"];\n    }\n  }\n\n  function scheduleErrorRecovery(fiber) {\n    scheduleWorkImpl(fiber, Sync, true);\n  }\n\n  function recalculateCurrentTime() {\n    // Subtract initial time so it fits inside 32bits\n    var ms = now() - startTime;\n    mostRecentCurrentTime = msToExpirationTime(ms);\n    return mostRecentCurrentTime;\n  }\n\n  function deferredUpdates(fn) {\n    var previousExpirationContext = expirationContext;\n    expirationContext = computeAsyncExpiration();\n    try {\n      return fn();\n    } finally {\n      expirationContext = previousExpirationContext;\n    }\n  }\n\n  function syncUpdates(fn) {\n    var previousExpirationContext = expirationContext;\n    expirationContext = Sync;\n    try {\n      return fn();\n    } finally {\n      expirationContext = previousExpirationContext;\n    }\n  }\n\n  // TODO: Everything below this is written as if it has been lifted to the\n  // renderers. I'll do this in a follow-up.\n\n  // Linked-list of roots\n  var firstScheduledRoot = null;\n  var lastScheduledRoot = null;\n\n  var callbackExpirationTime = NoWork;\n  var callbackID = -1;\n  var isRendering = false;\n  var nextFlushedRoot = null;\n  var nextFlushedExpirationTime = NoWork;\n  var deadlineDidExpire = false;\n  var hasUnhandledError = false;\n  var unhandledError = null;\n  var deadline = null;\n\n  var isBatchingUpdates = false;\n  var isUnbatchingUpdates = false;\n\n  var completedBatches = null;\n\n  // Use these to prevent an infinite loop of nested updates\n  var NESTED_UPDATE_LIMIT = 1000;\n  var nestedUpdateCount = 0;\n\n  var timeHeuristicForUnitOfWork = 1;\n\n  function scheduleCallbackWithExpiration(expirationTime) {\n    if (callbackExpirationTime !== NoWork) {\n      // A callback is already scheduled. Check its expiration time (timeout).\n      if (expirationTime > callbackExpirationTime) {\n        // Existing callback has sufficient timeout. Exit.\n        return;\n      } else {\n        // Existing callback has insufficient timeout. Cancel and schedule a\n        // new one.\n        cancelDeferredCallback(callbackID);\n      }\n      // The request callback timer is already running. Don't start a new one.\n    } else {\n      startRequestCallbackTimer();\n    }\n\n    // Compute a timeout for the given expiration time.\n    var currentMs = now() - startTime;\n    var expirationMs = expirationTimeToMs(expirationTime);\n    var timeout = expirationMs - currentMs;\n\n    callbackExpirationTime = expirationTime;\n    callbackID = scheduleDeferredCallback(performAsyncWork, {\n      timeout: timeout\n    });\n  }\n\n  // requestWork is called by the scheduler whenever a root receives an update.\n  // It's up to the renderer to call renderRoot at some point in the future.\n  function requestWork(root, expirationTime) {\n    if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n      invariant(\n        false,\n        \"Maximum update depth exceeded. This can happen when a \" +\n          \"component repeatedly calls setState inside componentWillUpdate or \" +\n          \"componentDidUpdate. React limits the number of nested updates to \" +\n          \"prevent infinite loops.\"\n      );\n    }\n\n    // Add the root to the schedule.\n    // Check if this root is already part of the schedule.\n    if (root.nextScheduledRoot === null) {\n      // This root is not already scheduled. Add it.\n      root.remainingExpirationTime = expirationTime;\n      if (lastScheduledRoot === null) {\n        firstScheduledRoot = lastScheduledRoot = root;\n        root.nextScheduledRoot = root;\n      } else {\n        lastScheduledRoot.nextScheduledRoot = root;\n        lastScheduledRoot = root;\n        lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n      }\n    } else {\n      // This root is already scheduled, but its priority may have increased.\n      var remainingExpirationTime = root.remainingExpirationTime;\n      if (\n        remainingExpirationTime === NoWork ||\n        expirationTime < remainingExpirationTime\n      ) {\n        // Update the priority.\n        root.remainingExpirationTime = expirationTime;\n      }\n    }\n\n    if (isRendering) {\n      // Prevent reentrancy. Remaining work will be scheduled at the end of\n      // the currently rendering batch.\n      return;\n    }\n\n    if (isBatchingUpdates) {\n      // Flush work at the end of the batch.\n      if (isUnbatchingUpdates) {\n        // ...unless we're inside unbatchedUpdates, in which case we should\n        // flush it now.\n        nextFlushedRoot = root;\n        nextFlushedExpirationTime = Sync;\n        performWorkOnRoot(root, Sync, recalculateCurrentTime());\n      }\n      return;\n    }\n\n    // TODO: Get rid of Sync and use current time?\n    if (expirationTime === Sync) {\n      performWork(Sync, null);\n    } else {\n      scheduleCallbackWithExpiration(expirationTime);\n    }\n  }\n\n  function findHighestPriorityRoot() {\n    var highestPriorityWork = NoWork;\n    var highestPriorityRoot = null;\n\n    if (lastScheduledRoot !== null) {\n      var previousScheduledRoot = lastScheduledRoot;\n      var root = firstScheduledRoot;\n      while (root !== null) {\n        var remainingExpirationTime = root.remainingExpirationTime;\n        if (remainingExpirationTime === NoWork) {\n          // This root no longer has work. Remove it from the scheduler.\n\n          // TODO: This check is redudant, but Flow is confused by the branch\n          // below where we set lastScheduledRoot to null, even though we break\n          // from the loop right after.\n          invariant(\n            previousScheduledRoot !== null && lastScheduledRoot !== null,\n            \"Should have a previous and last root. This error is likely \" +\n              \"caused by a bug in React. Please file an issue.\"\n          );\n          if (root === root.nextScheduledRoot) {\n            // This is the only root in the list.\n            root.nextScheduledRoot = null;\n            firstScheduledRoot = lastScheduledRoot = null;\n            break;\n          } else if (root === firstScheduledRoot) {\n            // This is the first root in the list.\n            var next = root.nextScheduledRoot;\n            firstScheduledRoot = next;\n            lastScheduledRoot.nextScheduledRoot = next;\n            root.nextScheduledRoot = null;\n          } else if (root === lastScheduledRoot) {\n            // This is the last root in the list.\n            lastScheduledRoot = previousScheduledRoot;\n            lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n            root.nextScheduledRoot = null;\n            break;\n          } else {\n            previousScheduledRoot.nextScheduledRoot = root.nextScheduledRoot;\n            root.nextScheduledRoot = null;\n          }\n          root = previousScheduledRoot.nextScheduledRoot;\n        } else {\n          if (\n            highestPriorityWork === NoWork ||\n            remainingExpirationTime < highestPriorityWork\n          ) {\n            // Update the priority, if it's higher\n            highestPriorityWork = remainingExpirationTime;\n            highestPriorityRoot = root;\n          }\n          if (root === lastScheduledRoot) {\n            break;\n          }\n          previousScheduledRoot = root;\n          root = root.nextScheduledRoot;\n        }\n      }\n    }\n\n    // If the next root is the same as the previous root, this is a nested\n    // update. To prevent an infinite loop, increment the nested update count.\n    var previousFlushedRoot = nextFlushedRoot;\n    if (\n      previousFlushedRoot !== null &&\n      previousFlushedRoot === highestPriorityRoot\n    ) {\n      nestedUpdateCount++;\n    } else {\n      // Reset whenever we switch roots.\n      nestedUpdateCount = 0;\n    }\n    nextFlushedRoot = highestPriorityRoot;\n    nextFlushedExpirationTime = highestPriorityWork;\n  }\n\n  function performAsyncWork(dl) {\n    performWork(NoWork, dl);\n  }\n\n  function performWork(minExpirationTime, dl) {\n    deadline = dl;\n\n    // Keep working on roots until there's no more work, or until the we reach\n    // the deadline.\n    findHighestPriorityRoot();\n\n    if (enableUserTimingAPI && deadline !== null) {\n      var didExpire = nextFlushedExpirationTime < recalculateCurrentTime();\n      stopRequestCallbackTimer(didExpire);\n    }\n\n    while (\n      nextFlushedRoot !== null &&\n      nextFlushedExpirationTime !== NoWork &&\n      (minExpirationTime === NoWork ||\n        nextFlushedExpirationTime <= minExpirationTime) &&\n      !deadlineDidExpire\n    ) {\n      performWorkOnRoot(\n        nextFlushedRoot,\n        nextFlushedExpirationTime,\n        recalculateCurrentTime()\n      );\n      // Find the next highest priority work.\n      findHighestPriorityRoot();\n    }\n\n    // We're done flushing work. Either we ran out of time in this callback,\n    // or there's no more work left with sufficient priority.\n\n    // If we're inside a callback, set this to false since we just completed it.\n    if (deadline !== null) {\n      callbackExpirationTime = NoWork;\n      callbackID = -1;\n    }\n    // If there's work left over, schedule a new callback.\n    if (nextFlushedExpirationTime !== NoWork) {\n      scheduleCallbackWithExpiration(nextFlushedExpirationTime);\n    }\n\n    // Clean-up.\n    deadline = null;\n    deadlineDidExpire = false;\n    nestedUpdateCount = 0;\n\n    finishRendering();\n  }\n\n  function flushRoot(root, expirationTime) {\n    invariant(\n      !isRendering,\n      \"work.commit(): Cannot commit while already rendering. This likely \" +\n        \"means you attempted to commit from inside a lifecycle method.\"\n    );\n    // Perform work on root as if the given expiration time is the current time.\n    // This has the effect of synchronously flushing all work up to and\n    // including the given time.\n    performWorkOnRoot(root, expirationTime, expirationTime);\n    finishRendering();\n  }\n\n  function finishRendering() {\n    if (completedBatches !== null) {\n      var batches = completedBatches;\n      completedBatches = null;\n      for (var i = 0; i < batches.length; i++) {\n        var batch = batches[i];\n        try {\n          batch._onComplete();\n        } catch (error) {\n          if (!hasUnhandledError) {\n            hasUnhandledError = true;\n            unhandledError = error;\n          }\n        }\n      }\n    }\n\n    if (hasUnhandledError) {\n      var _error4 = unhandledError;\n      unhandledError = null;\n      hasUnhandledError = false;\n      throw _error4;\n    }\n  }\n\n  function performWorkOnRoot(root, expirationTime, currentTime) {\n    invariant(\n      !isRendering,\n      \"performWorkOnRoot was called recursively. This error is likely caused \" +\n        \"by a bug in React. Please file an issue.\"\n    );\n\n    isRendering = true;\n\n    // Check if this is async work or sync/expired work.\n    if (expirationTime <= currentTime) {\n      // Flush sync work.\n      var finishedWork = root.finishedWork;\n      if (finishedWork !== null) {\n        // This root is already complete. We can commit it.\n        completeRoot(root, finishedWork, expirationTime);\n      } else {\n        root.finishedWork = null;\n        finishedWork = renderRoot(root, expirationTime);\n        if (finishedWork !== null) {\n          // We've completed the root. Commit it.\n          completeRoot(root, finishedWork, expirationTime);\n        }\n      }\n    } else {\n      // Flush async work.\n      var _finishedWork = root.finishedWork;\n      if (_finishedWork !== null) {\n        // This root is already complete. We can commit it.\n        completeRoot(root, _finishedWork, expirationTime);\n      } else {\n        root.finishedWork = null;\n        _finishedWork = renderRoot(root, expirationTime);\n        if (_finishedWork !== null) {\n          // We've completed the root. Check the deadline one more time\n          // before committing.\n          if (!shouldYield()) {\n            // Still time left. Commit the root.\n            completeRoot(root, _finishedWork, expirationTime);\n          } else {\n            // There's no time left. Mark this root as complete. We'll come\n            // back and commit it later.\n            root.finishedWork = _finishedWork;\n          }\n        }\n      }\n    }\n\n    isRendering = false;\n  }\n\n  function completeRoot(root, finishedWork, expirationTime) {\n    // Check if there's a batch that matches this expiration time.\n    var firstBatch = root.firstBatch;\n    if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) {\n      if (completedBatches === null) {\n        completedBatches = [firstBatch];\n      } else {\n        completedBatches.push(firstBatch);\n      }\n      if (firstBatch._defer) {\n        // This root is blocked from committing by a batch. Unschedule it until\n        // we receive another update.\n        root.finishedWork = finishedWork;\n        root.remainingExpirationTime = NoWork;\n        return;\n      }\n    }\n\n    // Commit the root.\n    root.finishedWork = null;\n    root.remainingExpirationTime = commitRoot(finishedWork);\n  }\n\n  // When working on async work, the reconciler asks the renderer if it should\n  // yield execution. For DOM, we implement this with requestIdleCallback.\n  function shouldYield() {\n    if (deadline === null) {\n      return false;\n    }\n    if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {\n      // Disregard deadline.didTimeout. Only expired work should be flushed\n      // during a timeout. This path is only hit for non-expired work.\n      return false;\n    }\n    deadlineDidExpire = true;\n    return true;\n  }\n\n  // TODO: Not happy about this hook. Conceptually, renderRoot should return a\n  // tuple of (isReadyForCommit, didError, error)\n  function onUncaughtError(error) {\n    invariant(\n      nextFlushedRoot !== null,\n      \"Should be working on a root. This error is likely caused by a bug in \" +\n        \"React. Please file an issue.\"\n    );\n    // Unschedule this root so we don't work on it again until there's\n    // another update.\n    nextFlushedRoot.remainingExpirationTime = NoWork;\n    if (!hasUnhandledError) {\n      hasUnhandledError = true;\n      unhandledError = error;\n    }\n  }\n\n  // TODO: Batching should be implemented at the renderer level, not inside\n  // the reconciler.\n  function batchedUpdates(fn, a) {\n    var previousIsBatchingUpdates = isBatchingUpdates;\n    isBatchingUpdates = true;\n    try {\n      return fn(a);\n    } finally {\n      isBatchingUpdates = previousIsBatchingUpdates;\n      if (!isBatchingUpdates && !isRendering) {\n        performWork(Sync, null);\n      }\n    }\n  }\n\n  // TODO: Batching should be implemented at the renderer level, not inside\n  // the reconciler.\n  function unbatchedUpdates(fn) {\n    if (isBatchingUpdates && !isUnbatchingUpdates) {\n      isUnbatchingUpdates = true;\n      try {\n        return fn();\n      } finally {\n        isUnbatchingUpdates = false;\n      }\n    }\n    return fn();\n  }\n\n  // TODO: Batching should be implemented at the renderer level, not within\n  // the reconciler.\n  function flushSync(fn) {\n    var previousIsBatchingUpdates = isBatchingUpdates;\n    isBatchingUpdates = true;\n    try {\n      return syncUpdates(fn);\n    } finally {\n      isBatchingUpdates = previousIsBatchingUpdates;\n      invariant(\n        !isRendering,\n        \"flushSync was called from inside a lifecycle method. It cannot be \" +\n          \"called when React is already rendering.\"\n      );\n      performWork(Sync, null);\n    }\n  }\n\n  return {\n    computeAsyncExpiration: computeAsyncExpiration,\n    computeExpirationForFiber: computeExpirationForFiber,\n    scheduleWork: scheduleWork,\n    requestWork: requestWork,\n    flushRoot: flushRoot,\n    batchedUpdates: batchedUpdates,\n    unbatchedUpdates: unbatchedUpdates,\n    flushSync: flushSync,\n    deferredUpdates: deferredUpdates,\n    computeUniqueAsyncExpiration: computeUniqueAsyncExpiration\n  };\n};\n\n{\n  var didWarnAboutNestedUpdates = false;\n}\n\n// 0 is PROD, 1 is DEV.\n// Might add PROFILE later.\n\nfunction getContextForSubtree(parentComponent) {\n  if (!parentComponent) {\n    return emptyObject;\n  }\n\n  var fiber = get(parentComponent);\n  var parentContext = findCurrentUnmaskedContext(fiber);\n  return isContextProvider(fiber)\n    ? processChildContext(fiber, parentContext)\n    : parentContext;\n}\n\nvar ReactFiberReconciler$1 = function(config) {\n  var getPublicInstance = config.getPublicInstance;\n\n  var _ReactFiberScheduler = ReactFiberScheduler(config),\n    computeAsyncExpiration = _ReactFiberScheduler.computeAsyncExpiration,\n    computeUniqueAsyncExpiration =\n      _ReactFiberScheduler.computeUniqueAsyncExpiration,\n    computeExpirationForFiber = _ReactFiberScheduler.computeExpirationForFiber,\n    scheduleWork = _ReactFiberScheduler.scheduleWork,\n    requestWork = _ReactFiberScheduler.requestWork,\n    flushRoot = _ReactFiberScheduler.flushRoot,\n    batchedUpdates = _ReactFiberScheduler.batchedUpdates,\n    unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates,\n    flushSync = _ReactFiberScheduler.flushSync,\n    deferredUpdates = _ReactFiberScheduler.deferredUpdates;\n\n  function computeRootExpirationTime(current, element) {\n    var expirationTime = void 0;\n    // Check if the top-level element is an async wrapper component. If so,\n    // treat updates to the root as async. This is a bit weird but lets us\n    // avoid a separate `renderAsync` API.\n    if (\n      enableAsyncSubtreeAPI &&\n      element != null &&\n      element.type != null &&\n      element.type.prototype != null &&\n      element.type.prototype.unstable_isAsyncReactComponent === true\n    ) {\n      expirationTime = computeAsyncExpiration();\n    } else {\n      expirationTime = computeExpirationForFiber(current);\n    }\n    return expirationTime;\n  }\n\n  function scheduleRootUpdate(current, element, expirationTime, callback) {\n    {\n      if (\n        ReactDebugCurrentFiber.phase === \"render\" &&\n        ReactDebugCurrentFiber.current !== null &&\n        !didWarnAboutNestedUpdates\n      ) {\n        didWarnAboutNestedUpdates = true;\n        warning(\n          false,\n          \"Render methods should be a pure function of props and state; \" +\n            \"triggering nested component updates from render is not allowed. \" +\n            \"If necessary, trigger nested updates in componentDidUpdate.\\n\\n\" +\n            \"Check the render method of %s.\",\n          getComponentName(ReactDebugCurrentFiber.current) || \"Unknown\"\n        );\n      }\n    }\n\n    callback = callback === undefined ? null : callback;\n    {\n      warning(\n        callback === null || typeof callback === \"function\",\n        \"render(...): Expected the last optional `callback` argument to be a \" +\n          \"function. Instead received: %s.\",\n        callback\n      );\n    }\n\n    var update = {\n      expirationTime: expirationTime,\n      partialState: { element: element },\n      callback: callback,\n      isReplace: false,\n      isForced: false,\n      next: null\n    };\n    insertUpdateIntoFiber(current, update);\n    scheduleWork(current, expirationTime);\n\n    return expirationTime;\n  }\n\n  function updateContainerAtExpirationTime(\n    element,\n    container,\n    parentComponent,\n    expirationTime,\n    callback\n  ) {\n    // TODO: If this is a nested container, this won't be the root.\n    var current = container.current;\n\n    {\n      if (ReactFiberInstrumentation_1.debugTool) {\n        if (current.alternate === null) {\n          ReactFiberInstrumentation_1.debugTool.onMountContainer(container);\n        } else if (element === null) {\n          ReactFiberInstrumentation_1.debugTool.onUnmountContainer(container);\n        } else {\n          ReactFiberInstrumentation_1.debugTool.onUpdateContainer(container);\n        }\n      }\n    }\n\n    var context = getContextForSubtree(parentComponent);\n    if (container.context === null) {\n      container.context = context;\n    } else {\n      container.pendingContext = context;\n    }\n\n    return scheduleRootUpdate(current, element, expirationTime, callback);\n  }\n\n  function findHostInstance(fiber) {\n    var hostFiber = findCurrentHostFiber(fiber);\n    if (hostFiber === null) {\n      return null;\n    }\n    return hostFiber.stateNode;\n  }\n\n  return {\n    createContainer: function(containerInfo, hydrate) {\n      return createFiberRoot(containerInfo, hydrate);\n    },\n    updateContainer: function(element, container, parentComponent, callback) {\n      var current = container.current;\n      var expirationTime = computeRootExpirationTime(current, element);\n      return updateContainerAtExpirationTime(\n        element,\n        container,\n        parentComponent,\n        expirationTime,\n        callback\n      );\n    },\n\n    updateContainerAtExpirationTime: updateContainerAtExpirationTime,\n\n    flushRoot: flushRoot,\n\n    requestWork: requestWork,\n\n    computeUniqueAsyncExpiration: computeUniqueAsyncExpiration,\n\n    batchedUpdates: batchedUpdates,\n\n    unbatchedUpdates: unbatchedUpdates,\n\n    deferredUpdates: deferredUpdates,\n\n    flushSync: flushSync,\n\n    getPublicRootInstance: function(container) {\n      var containerFiber = container.current;\n      if (!containerFiber.child) {\n        return null;\n      }\n      switch (containerFiber.child.tag) {\n        case HostComponent:\n          return getPublicInstance(containerFiber.child.stateNode);\n        default:\n          return containerFiber.child.stateNode;\n      }\n    },\n\n    findHostInstance: findHostInstance,\n\n    findHostInstanceWithNoPortals: function(fiber) {\n      var hostFiber = findCurrentHostFiberWithNoPortals(fiber);\n      if (hostFiber === null) {\n        return null;\n      }\n      return hostFiber.stateNode;\n    },\n    injectIntoDevTools: function(devToolsConfig) {\n      var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;\n\n      return injectInternals(\n        Object.assign({}, devToolsConfig, {\n          findHostInstanceByFiber: function(fiber) {\n            return findHostInstance(fiber);\n          },\n          findFiberByHostInstance: function(instance) {\n            if (!findFiberByHostInstance) {\n              // Might not be implemented by the renderer.\n              return null;\n            }\n            return findFiberByHostInstance(instance);\n          }\n        })\n      );\n    }\n  };\n};\n\nvar ReactFiberReconciler$2 = Object.freeze({\n  default: ReactFiberReconciler$1\n});\n\nvar ReactFiberReconciler$3 =\n  (ReactFiberReconciler$2 && ReactFiberReconciler$1) || ReactFiberReconciler$2;\n\n// TODO: bundle Flow types with the package.\n\n// TODO: decide on the top-level export form.\n// This is hacky but makes it work with both Rollup and Jest.\nvar reactReconciler = ReactFiberReconciler$3[\"default\"]\n  ? ReactFiberReconciler$3[\"default\"]\n  : ReactFiberReconciler$3;\n\nvar viewConfigCallbacks = new Map();\nvar viewConfigs = new Map();\n\n/**\n * Registers a native view/component by name.\n * A callback is provided to load the view config from UIManager.\n * The callback is deferred until the view is actually rendered.\n * This is done to avoid causing Prepack deopts.\n */\nfunction register(name, callback) {\n  invariant(\n    !viewConfigCallbacks.has(name),\n    \"Tried to register two views with the same name %s\",\n    name\n  );\n  viewConfigCallbacks.set(name, callback);\n  return name;\n}\n\n/**\n * Retrieves a config for the specified view.\n * If this is the first time the view has been used,\n * This configuration will be lazy-loaded from UIManager.\n */\nfunction get$1(name) {\n  var viewConfig = void 0;\n  if (!viewConfigs.has(name)) {\n    var callback = viewConfigCallbacks.get(name);\n    invariant(\n      typeof callback === \"function\",\n      \"View config not found for name %s\",\n      name\n    );\n    viewConfigCallbacks.set(name, null);\n    viewConfig = callback();\n    viewConfigs.set(name, viewConfig);\n  } else {\n    viewConfig = viewConfigs.get(name);\n  }\n  invariant(viewConfig, \"View config not found for name %s\", name);\n  return viewConfig;\n}\n\nfunction _classCallCheck$1(instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n}\n\n// Modules provided by RN:\n/**\n * This component defines the same methods as NativeMethodsMixin but without the\n * findNodeHandle wrapper. This wrapper is unnecessary for HostComponent views\n * and would also result in a circular require.js dependency (since\n * ReactNativeFiber depends on this component and NativeMethodsMixin depends on\n * ReactNativeFiber).\n */\n\nvar ReactNativeFiberHostComponent = (function() {\n  function ReactNativeFiberHostComponent(tag, viewConfig) {\n    _classCallCheck$1(this, ReactNativeFiberHostComponent);\n\n    this._nativeTag = tag;\n    this._children = [];\n    this.viewConfig = viewConfig;\n  }\n\n  ReactNativeFiberHostComponent.prototype.blur = function blur() {\n    TextInputState.blurTextInput(this._nativeTag);\n  };\n\n  ReactNativeFiberHostComponent.prototype.focus = function focus() {\n    TextInputState.focusTextInput(this._nativeTag);\n  };\n\n  ReactNativeFiberHostComponent.prototype.measure = function measure(callback) {\n    UIManager.measure(this._nativeTag, mountSafeCallback(this, callback));\n  };\n\n  ReactNativeFiberHostComponent.prototype.measureInWindow = function measureInWindow(\n    callback\n  ) {\n    UIManager.measureInWindow(\n      this._nativeTag,\n      mountSafeCallback(this, callback)\n    );\n  };\n\n  ReactNativeFiberHostComponent.prototype.measureLayout = function measureLayout(\n    relativeToNativeNode,\n    onSuccess,\n    onFail /* currently unused */\n  ) {\n    UIManager.measureLayout(\n      this._nativeTag,\n      relativeToNativeNode,\n      mountSafeCallback(this, onFail),\n      mountSafeCallback(this, onSuccess)\n    );\n  };\n\n  ReactNativeFiberHostComponent.prototype.setNativeProps = function setNativeProps(\n    nativeProps\n  ) {\n    {\n      warnForStyleProps(nativeProps, this.viewConfig.validAttributes);\n    }\n\n    var updatePayload = create(nativeProps, this.viewConfig.validAttributes);\n\n    // Avoid the overhead of bridge calls if there's no update.\n    // This is an expensive no-op for Android, and causes an unnecessary\n    // view invalidation for certain components (eg RCTTextInput) on iOS.\n    if (updatePayload != null) {\n      UIManager.updateView(\n        this._nativeTag,\n        this.viewConfig.uiViewClassName,\n        updatePayload\n      );\n    }\n  };\n\n  return ReactNativeFiberHostComponent;\n})();\n\nvar hasNativePerformanceNow =\n  typeof performance === \"object\" && typeof performance.now === \"function\";\n\nvar now = hasNativePerformanceNow\n  ? function() {\n      return performance.now();\n    }\n  : function() {\n      return Date.now();\n    };\n\nvar scheduledCallback = null;\nvar frameDeadline = 0;\n\nvar frameDeadlineObject = {\n  timeRemaining: function() {\n    return frameDeadline - now();\n  }\n};\n\nfunction setTimeoutCallback() {\n  // TODO (bvaughn) Hard-coded 5ms unblocks initial async testing.\n  // React API probably changing to boolean rather than time remaining.\n  // Longer-term plan is to rewrite this using shared memory,\n  // And just return the value of the bit as the boolean.\n  frameDeadline = now() + 5;\n\n  var callback = scheduledCallback;\n  scheduledCallback = null;\n  if (callback !== null) {\n    callback(frameDeadlineObject);\n  }\n}\n\n// RN has a poor polyfill for requestIdleCallback so we aren't using it.\n// This implementation is only intended for short-term use anyway.\n// We also don't implement cancel functionality b'c Fiber doesn't currently need it.\nfunction scheduleDeferredCallback(callback) {\n  // We assume only one callback is scheduled at a time b'c that's how Fiber works.\n  scheduledCallback = callback;\n  return setTimeout(setTimeoutCallback, 1);\n}\n\nfunction cancelDeferredCallback(callbackID) {\n  scheduledCallback = null;\n  clearTimeout(callbackID);\n}\n\n// Modules provided by RN:\nfunction recursivelyUncacheFiberNode(node) {\n  if (typeof node === \"number\") {\n    // Leaf node (eg text)\n    uncacheFiberNode(node);\n  } else {\n    uncacheFiberNode(node._nativeTag);\n\n    node._children.forEach(recursivelyUncacheFiberNode);\n  }\n}\n\nvar NativeRenderer = reactReconciler({\n  appendInitialChild: function(parentInstance, child) {\n    parentInstance._children.push(child);\n  },\n  createInstance: function(\n    type,\n    props,\n    rootContainerInstance,\n    hostContext,\n    internalInstanceHandle\n  ) {\n    var tag = ReactNativeTagHandles.allocateTag();\n    var viewConfig = get$1(type);\n\n    {\n      for (var key in viewConfig.validAttributes) {\n        if (props.hasOwnProperty(key)) {\n          deepFreezeAndThrowOnMutationInDev(props[key]);\n        }\n      }\n    }\n\n    var updatePayload = create(props, viewConfig.validAttributes);\n\n    UIManager.createView(\n      tag, // reactTag\n      viewConfig.uiViewClassName, // viewName\n      rootContainerInstance, // rootTag\n      updatePayload\n    );\n\n    var component = new ReactNativeFiberHostComponent(tag, viewConfig);\n\n    precacheFiberNode(internalInstanceHandle, tag);\n    updateFiberProps(tag, props);\n\n    // Not sure how to avoid this cast. Flow is okay if the component is defined\n    // in the same file but if it's external it can't see the types.\n    return component;\n  },\n  createTextInstance: function(\n    text,\n    rootContainerInstance,\n    hostContext,\n    internalInstanceHandle\n  ) {\n    var tag = ReactNativeTagHandles.allocateTag();\n\n    UIManager.createView(\n      tag, // reactTag\n      \"RCTRawText\", // viewName\n      rootContainerInstance, // rootTag\n      { text: text }\n    );\n\n    precacheFiberNode(internalInstanceHandle, tag);\n\n    return tag;\n  },\n  finalizeInitialChildren: function(\n    parentInstance,\n    type,\n    props,\n    rootContainerInstance\n  ) {\n    // Don't send a no-op message over the bridge.\n    if (parentInstance._children.length === 0) {\n      return false;\n    }\n\n    // Map from child objects to native tags.\n    // Either way we need to pass a copy of the Array to prevent it from being frozen.\n    var nativeTags = parentInstance._children.map(function(child) {\n      return typeof child === \"number\"\n        ? child // Leaf node (eg text)\n        : child._nativeTag;\n    });\n\n    UIManager.setChildren(\n      parentInstance._nativeTag, // containerTag\n      nativeTags\n    );\n\n    return false;\n  },\n  getRootHostContext: function() {\n    return emptyObject;\n  },\n  getChildHostContext: function() {\n    return emptyObject;\n  },\n  getPublicInstance: function(instance) {\n    return instance;\n  },\n\n  now: now,\n\n  prepareForCommit: function() {\n    // Noop\n  },\n  prepareUpdate: function(\n    instance,\n    type,\n    oldProps,\n    newProps,\n    rootContainerInstance,\n    hostContext\n  ) {\n    return emptyObject;\n  },\n  resetAfterCommit: function() {\n    // Noop\n  },\n\n  scheduleDeferredCallback: scheduleDeferredCallback,\n  cancelDeferredCallback: cancelDeferredCallback,\n\n  shouldDeprioritizeSubtree: function(type, props) {\n    return false;\n  },\n  shouldSetTextContent: function(type, props) {\n    // TODO (bvaughn) Revisit this decision.\n    // Always returning false simplifies the createInstance() implementation,\n    // But creates an additional child Fiber for raw text children.\n    // No additional native views are created though.\n    // It's not clear to me which is better so I'm deferring for now.\n    // More context @ github.com/facebook/react/pull/8560#discussion_r92111303\n    return false;\n  },\n\n  useSyncScheduling: true,\n\n  mutation: {\n    appendChild: function(parentInstance, child) {\n      var childTag = typeof child === \"number\" ? child : child._nativeTag;\n      var children = parentInstance._children;\n      var index = children.indexOf(child);\n\n      if (index >= 0) {\n        children.splice(index, 1);\n        children.push(child);\n\n        UIManager.manageChildren(\n          parentInstance._nativeTag, // containerTag\n          [index], // moveFromIndices\n          [children.length - 1], // moveToIndices\n          [], // addChildReactTags\n          [], // addAtIndices\n          []\n        );\n      } else {\n        children.push(child);\n\n        UIManager.manageChildren(\n          parentInstance._nativeTag, // containerTag\n          [], // moveFromIndices\n          [], // moveToIndices\n          [childTag], // addChildReactTags\n          [children.length - 1], // addAtIndices\n          []\n        );\n      }\n    },\n    appendChildToContainer: function(parentInstance, child) {\n      var childTag = typeof child === \"number\" ? child : child._nativeTag;\n      UIManager.setChildren(\n        parentInstance, // containerTag\n        [childTag]\n      );\n    },\n    commitTextUpdate: function(textInstance, oldText, newText) {\n      UIManager.updateView(\n        textInstance, // reactTag\n        \"RCTRawText\", // viewName\n        { text: newText }\n      );\n    },\n    commitMount: function(instance, type, newProps, internalInstanceHandle) {\n      // Noop\n    },\n    commitUpdate: function(\n      instance,\n      updatePayloadTODO,\n      type,\n      oldProps,\n      newProps,\n      internalInstanceHandle\n    ) {\n      var viewConfig = instance.viewConfig;\n\n      updateFiberProps(instance._nativeTag, newProps);\n\n      var updatePayload = diff(oldProps, newProps, viewConfig.validAttributes);\n\n      // Avoid the overhead of bridge calls if there's no update.\n      // This is an expensive no-op for Android, and causes an unnecessary\n      // view invalidation for certain components (eg RCTTextInput) on iOS.\n      if (updatePayload != null) {\n        UIManager.updateView(\n          instance._nativeTag, // reactTag\n          viewConfig.uiViewClassName, // viewName\n          updatePayload\n        );\n      }\n    },\n    insertBefore: function(parentInstance, child, beforeChild) {\n      var children = parentInstance._children;\n      var index = children.indexOf(child);\n\n      // Move existing child or add new child?\n      if (index >= 0) {\n        children.splice(index, 1);\n        var beforeChildIndex = children.indexOf(beforeChild);\n        children.splice(beforeChildIndex, 0, child);\n\n        UIManager.manageChildren(\n          parentInstance._nativeTag, // containerID\n          [index], // moveFromIndices\n          [beforeChildIndex], // moveToIndices\n          [], // addChildReactTags\n          [], // addAtIndices\n          []\n        );\n      } else {\n        var _beforeChildIndex = children.indexOf(beforeChild);\n        children.splice(_beforeChildIndex, 0, child);\n\n        var childTag = typeof child === \"number\" ? child : child._nativeTag;\n\n        UIManager.manageChildren(\n          parentInstance._nativeTag, // containerID\n          [], // moveFromIndices\n          [], // moveToIndices\n          [childTag], // addChildReactTags\n          [_beforeChildIndex], // addAtIndices\n          []\n        );\n      }\n    },\n    insertInContainerBefore: function(parentInstance, child, beforeChild) {\n      // TODO (bvaughn): Remove this check when...\n      // We create a wrapper object for the container in ReactNative render()\n      // Or we refactor to remove wrapper objects entirely.\n      // For more info on pros/cons see PR #8560 description.\n      invariant(\n        typeof parentInstance !== \"number\",\n        \"Container does not support insertBefore operation\"\n      );\n    },\n    removeChild: function(parentInstance, child) {\n      recursivelyUncacheFiberNode(child);\n      var children = parentInstance._children;\n      var index = children.indexOf(child);\n\n      children.splice(index, 1);\n\n      UIManager.manageChildren(\n        parentInstance._nativeTag, // containerID\n        [], // moveFromIndices\n        [], // moveToIndices\n        [], // addChildReactTags\n        [], // addAtIndices\n        [index]\n      );\n    },\n    removeChildFromContainer: function(parentInstance, child) {\n      recursivelyUncacheFiberNode(child);\n      UIManager.manageChildren(\n        parentInstance, // containerID\n        [], // moveFromIndices\n        [], // moveToIndices\n        [], // addChildReactTags\n        [], // addAtIndices\n        [0]\n      );\n    },\n    resetTextContent: function(instance) {\n      // Noop\n    }\n  }\n});\n\n/**\n * ReactNative vs ReactWeb\n * -----------------------\n * React treats some pieces of data opaquely. This means that the information\n * is first class (it can be passed around), but cannot be inspected. This\n * allows us to build infrastructure that reasons about resources, without\n * making assumptions about the nature of those resources, and this allows that\n * infra to be shared across multiple platforms, where the resources are very\n * different. General infra (such as `ReactMultiChild`) reasons opaquely about\n * the data, but platform specific code (such as `ReactNativeBaseComponent`) can\n * make assumptions about the data.\n *\n *\n * `rootNodeID`, uniquely identifies a position in the generated native view\n * tree. Many layers of composite components (created with `React.createClass`)\n * can all share the same `rootNodeID`.\n *\n * `nodeHandle`: A sufficiently unambiguous way to refer to a lower level\n * resource (dom node, native view etc). The `rootNodeID` is sufficient for web\n * `nodeHandle`s, because the position in a tree is always enough to uniquely\n * identify a DOM node (we never have nodes in some bank outside of the\n * document). The same would be true for `ReactNative`, but we must maintain a\n * mapping that we can send efficiently serializable\n * strings across native boundaries.\n *\n * Opaque name      TodaysWebReact   FutureWebWorkerReact   ReactNative\n * ----------------------------------------------------------------------------\n * nodeHandle       N/A              rootNodeID             tag\n */\n\n// TODO (bvaughn) Rename the findNodeHandle module to something more descriptive\n// eg findInternalHostInstance. This will reduce the likelihood of someone\n// accidentally deep-requiring this version.\nfunction findNodeHandle(componentOrHandle) {\n  {\n    var owner = ReactCurrentOwner.current;\n    if (owner !== null && owner.stateNode !== null) {\n      warning(\n        owner.stateNode._warnedAboutRefsInRender,\n        \"%s is accessing findNodeHandle inside its render(). \" +\n          \"render() should be a pure function of props and state. It should \" +\n          \"never access something that requires stale data from the previous \" +\n          \"render, such as refs. Move this logic to componentDidMount and \" +\n          \"componentDidUpdate instead.\",\n        getComponentName(owner) || \"A component\"\n      );\n\n      owner.stateNode._warnedAboutRefsInRender = true;\n    }\n  }\n  if (componentOrHandle == null) {\n    return null;\n  }\n  if (typeof componentOrHandle === \"number\") {\n    // Already a node handle\n    return componentOrHandle;\n  }\n\n  var component = componentOrHandle;\n\n  // TODO (balpert): Wrap iOS native components in a composite wrapper, then\n  // ReactInstanceMap.get here will always succeed for mounted components\n  var internalInstance = get(component);\n  if (internalInstance) {\n    return NativeRenderer.findHostInstance(internalInstance);\n  } else {\n    if (component) {\n      return component;\n    } else {\n      invariant(\n        // Native\n        (typeof component === \"object\" && \"_nativeTag\" in component) ||\n          // Composite\n          (component.render != null && typeof component.render === \"function\"),\n        \"findNodeHandle(...): Argument is not a component \" +\n          \"(type: %s, keys: %s)\",\n        typeof component,\n        Object.keys(component)\n      );\n      invariant(\n        false,\n        \"findNodeHandle(...): Unable to find node handle for unmounted \" +\n          \"component.\"\n      );\n    }\n  }\n}\n\n/**\n * External users of findNodeHandle() expect the host tag number return type.\n * The injected findNodeHandle() strategy returns the instance wrapper though.\n * See NativeMethodsMixin#setNativeProps for more info on why this is done.\n */\nfunction findNumericNodeHandleFiber(componentOrHandle) {\n  var instance = findNodeHandle(componentOrHandle);\n  if (instance == null || typeof instance === \"number\") {\n    return instance;\n  }\n  return instance._nativeTag;\n}\n\n// Modules provided by RN:\n/**\n * `NativeMethodsMixin` provides methods to access the underlying native\n * component directly. This can be useful in cases when you want to focus\n * a view or measure its on-screen dimensions, for example.\n *\n * The methods described here are available on most of the default components\n * provided by React Native. Note, however, that they are *not* available on\n * composite components that aren't directly backed by a native view. This will\n * generally include most components that you define in your own app. For more\n * information, see [Direct\n * Manipulation](docs/direct-manipulation.html).\n *\n * Note the Flow $Exact<> syntax is required to support mixins.\n * React createClass mixins can only be used with exact types.\n */\nvar NativeMethodsMixin = {\n  /**\n   * Determines the location on screen, width, and height of the given view and\n   * returns the values via an async callback. If successful, the callback will\n   * be called with the following arguments:\n   *\n   *  - x\n   *  - y\n   *  - width\n   *  - height\n   *  - pageX\n   *  - pageY\n   *\n   * Note that these measurements are not available until after the rendering\n   * has been completed in native. If you need the measurements as soon as\n   * possible, consider using the [`onLayout`\n   * prop](docs/view.html#onlayout) instead.\n   */\n  measure: function(callback) {\n    UIManager.measure(\n      findNumericNodeHandleFiber(this),\n      mountSafeCallback(this, callback)\n    );\n  },\n\n  /**\n   * Determines the location of the given view in the window and returns the\n   * values via an async callback. If the React root view is embedded in\n   * another native view, this will give you the absolute coordinates. If\n   * successful, the callback will be called with the following\n   * arguments:\n   *\n   *  - x\n   *  - y\n   *  - width\n   *  - height\n   *\n   * Note that these measurements are not available until after the rendering\n   * has been completed in native.\n   */\n  measureInWindow: function(callback) {\n    UIManager.measureInWindow(\n      findNumericNodeHandleFiber(this),\n      mountSafeCallback(this, callback)\n    );\n  },\n\n  /**\n   * Like [`measure()`](#measure), but measures the view relative an ancestor,\n   * specified as `relativeToNativeNode`. This means that the returned x, y\n   * are relative to the origin x, y of the ancestor view.\n   *\n   * As always, to obtain a native node handle for a component, you can use\n   * `findNumericNodeHandle(component)`.\n   */\n  measureLayout: function(\n    relativeToNativeNode,\n    onSuccess,\n    onFail /* currently unused */\n  ) {\n    UIManager.measureLayout(\n      findNumericNodeHandleFiber(this),\n      relativeToNativeNode,\n      mountSafeCallback(this, onFail),\n      mountSafeCallback(this, onSuccess)\n    );\n  },\n\n  /**\n   * This function sends props straight to native. They will not participate in\n   * future diff process - this means that if you do not include them in the\n   * next render, they will remain active (see [Direct\n   * Manipulation](docs/direct-manipulation.html)).\n   */\n  setNativeProps: function(nativeProps) {\n    // Class components don't have viewConfig -> validateAttributes.\n    // Nor does it make sense to set native props on a non-native component.\n    // Instead, find the nearest host component and set props on it.\n    // Use findNodeHandle() rather than findNumericNodeHandle() because\n    // We want the instance/wrapper (not the native tag).\n    var maybeInstance = void 0;\n\n    // Fiber errors if findNodeHandle is called for an umounted component.\n    // Tests using ReactTestRenderer will trigger this case indirectly.\n    // Mimicking stack behavior, we should silently ignore this case.\n    // TODO Fix ReactTestRenderer so we can remove this try/catch.\n    try {\n      maybeInstance = findNodeHandle(this);\n    } catch (error) {}\n\n    // If there is no host component beneath this we should fail silently.\n    // This is not an error; it could mean a class component rendered null.\n    if (maybeInstance == null) {\n      return;\n    }\n\n    var viewConfig = maybeInstance.viewConfig;\n\n    {\n      warnForStyleProps(nativeProps, viewConfig.validAttributes);\n    }\n\n    var updatePayload = create(nativeProps, viewConfig.validAttributes);\n\n    // Avoid the overhead of bridge calls if there's no update.\n    // This is an expensive no-op for Android, and causes an unnecessary\n    // view invalidation for certain components (eg RCTTextInput) on iOS.\n    if (updatePayload != null) {\n      UIManager.updateView(\n        maybeInstance._nativeTag,\n        viewConfig.uiViewClassName,\n        updatePayload\n      );\n    }\n  },\n\n  /**\n   * Requests focus for the given input or view. The exact behavior triggered\n   * will depend on the platform and type of view.\n   */\n  focus: function() {\n    TextInputState.focusTextInput(findNumericNodeHandleFiber(this));\n  },\n\n  /**\n   * Removes focus from an input or view. This is the opposite of `focus()`.\n   */\n  blur: function() {\n    TextInputState.blurTextInput(findNumericNodeHandleFiber(this));\n  }\n};\n\n{\n  // hide this from Flow since we can't define these properties outside of\n  // true without actually implementing them (setting them to undefined\n  // isn't allowed by ReactClass)\n  var NativeMethodsMixin_DEV = NativeMethodsMixin;\n  invariant(\n    !NativeMethodsMixin_DEV.componentWillMount &&\n      !NativeMethodsMixin_DEV.componentWillReceiveProps,\n    \"Do not override existing functions.\"\n  );\n  NativeMethodsMixin_DEV.componentWillMount = function() {\n    throwOnStylesProp(this, this.props);\n  };\n  NativeMethodsMixin_DEV.componentWillReceiveProps = function(newProps) {\n    throwOnStylesProp(this, newProps);\n  };\n}\n\nfunction _classCallCheck$2(instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n  if (!self) {\n    throw new ReferenceError(\n      \"this hasn't been initialised - super() hasn't been called\"\n    );\n  }\n  return call && (typeof call === \"object\" || typeof call === \"function\")\n    ? call\n    : self;\n}\n\nfunction _inherits(subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\n      \"Super expression must either be null or a function, not \" +\n        typeof superClass\n    );\n  }\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      enumerable: false,\n      writable: true,\n      configurable: true\n    }\n  });\n  if (superClass)\n    Object.setPrototypeOf\n      ? Object.setPrototypeOf(subClass, superClass)\n      : (subClass.__proto__ = superClass);\n}\n\n// Modules provided by RN:\n/**\n * Superclass that provides methods to access the underlying native component.\n * This can be useful when you want to focus a view or measure its dimensions.\n *\n * Methods implemented by this class are available on most default components\n * provided by React Native. However, they are *not* available on composite\n * components that are not directly backed by a native view. For more\n * information, see [Direct Manipulation](docs/direct-manipulation.html).\n *\n * @abstract\n */\n\nvar ReactNativeComponent = (function(_React$Component) {\n  _inherits(ReactNativeComponent, _React$Component);\n\n  function ReactNativeComponent() {\n    _classCallCheck$2(this, ReactNativeComponent);\n\n    return _possibleConstructorReturn(\n      this,\n      _React$Component.apply(this, arguments)\n    );\n  }\n\n  /**\n   * Removes focus. This is the opposite of `focus()`.\n   */\n  ReactNativeComponent.prototype.blur = function blur() {\n    TextInputState.blurTextInput(findNumericNodeHandleFiber(this));\n  };\n\n  /**\n   * Requests focus. The exact behavior depends on the platform and view.\n   */\n\n  ReactNativeComponent.prototype.focus = function focus() {\n    TextInputState.focusTextInput(findNumericNodeHandleFiber(this));\n  };\n\n  /**\n   * Measures the on-screen location and dimensions. If successful, the callback\n   * will be called asynchronously with the following arguments:\n   *\n   *  - x\n   *  - y\n   *  - width\n   *  - height\n   *  - pageX\n   *  - pageY\n   *\n   * These values are not available until after natives rendering completes. If\n   * you need the measurements as soon as possible, consider using the\n   * [`onLayout` prop](docs/view.html#onlayout) instead.\n   */\n\n  ReactNativeComponent.prototype.measure = function measure(callback) {\n    UIManager.measure(\n      findNumericNodeHandleFiber(this),\n      mountSafeCallback(this, callback)\n    );\n  };\n\n  /**\n   * Measures the on-screen location and dimensions. Even if the React Native\n   * root view is embedded within another native view, this method will give you\n   * the absolute coordinates measured from the window. If successful, the\n   * callback will be called asynchronously with the following arguments:\n   *\n   *  - x\n   *  - y\n   *  - width\n   *  - height\n   *\n   * These values are not available until after natives rendering completes.\n   */\n\n  ReactNativeComponent.prototype.measureInWindow = function measureInWindow(\n    callback\n  ) {\n    UIManager.measureInWindow(\n      findNumericNodeHandleFiber(this),\n      mountSafeCallback(this, callback)\n    );\n  };\n\n  /**\n   * Similar to [`measure()`](#measure), but the resulting location will be\n   * relative to the supplied ancestor's location.\n   *\n   * Obtain a native node handle with `ReactNative.findNodeHandle(component)`.\n   */\n\n  ReactNativeComponent.prototype.measureLayout = function measureLayout(\n    relativeToNativeNode,\n    onSuccess,\n    onFail /* currently unused */\n  ) {\n    UIManager.measureLayout(\n      findNumericNodeHandleFiber(this),\n      relativeToNativeNode,\n      mountSafeCallback(this, onFail),\n      mountSafeCallback(this, onSuccess)\n    );\n  };\n\n  /**\n   * This function sends props straight to native. They will not participate in\n   * future diff process - this means that if you do not include them in the\n   * next render, they will remain active (see [Direct\n   * Manipulation](docs/direct-manipulation.html)).\n   */\n\n  ReactNativeComponent.prototype.setNativeProps = function setNativeProps(\n    nativeProps\n  ) {\n    // Class components don't have viewConfig -> validateAttributes.\n    // Nor does it make sense to set native props on a non-native component.\n    // Instead, find the nearest host component and set props on it.\n    // Use findNodeHandle() rather than ReactNative.findNodeHandle() because\n    // We want the instance/wrapper (not the native tag).\n    var maybeInstance = void 0;\n\n    // Fiber errors if findNodeHandle is called for an umounted component.\n    // Tests using ReactTestRenderer will trigger this case indirectly.\n    // Mimicking stack behavior, we should silently ignore this case.\n    // TODO Fix ReactTestRenderer so we can remove this try/catch.\n    try {\n      maybeInstance = findNodeHandle(this);\n    } catch (error) {}\n\n    // If there is no host component beneath this we should fail silently.\n    // This is not an error; it could mean a class component rendered null.\n    if (maybeInstance == null) {\n      return;\n    }\n\n    var viewConfig = maybeInstance.viewConfig;\n\n    var updatePayload = create(nativeProps, viewConfig.validAttributes);\n\n    // Avoid the overhead of bridge calls if there's no update.\n    // This is an expensive no-op for Android, and causes an unnecessary\n    // view invalidation for certain components (eg RCTTextInput) on iOS.\n    if (updatePayload != null) {\n      UIManager.updateView(\n        maybeInstance._nativeTag,\n        viewConfig.uiViewClassName,\n        updatePayload\n      );\n    }\n  };\n\n  return ReactNativeComponent;\n})(React.Component);\n\n// Module provided by RN:\nvar getInspectorDataForViewTag = void 0;\n\n{\n  var traverseOwnerTreeUp = function(hierarchy, instance) {\n    if (instance) {\n      hierarchy.unshift(instance);\n      traverseOwnerTreeUp(hierarchy, instance._debugOwner);\n    }\n  };\n\n  var getOwnerHierarchy = function(instance) {\n    var hierarchy = [];\n    traverseOwnerTreeUp(hierarchy, instance);\n    return hierarchy;\n  };\n\n  var lastNonHostInstance = function(hierarchy) {\n    for (var i = hierarchy.length - 1; i > 1; i--) {\n      var instance = hierarchy[i];\n\n      if (instance.tag !== HostComponent) {\n        return instance;\n      }\n    }\n    return hierarchy[0];\n  };\n\n  var getHostProps = function(fiber) {\n    var host = findCurrentHostFiber(fiber);\n    if (host) {\n      return host.memoizedProps || emptyObject;\n    }\n    return emptyObject;\n  };\n\n  var getHostNode = function(fiber, findNodeHandle) {\n    var hostNode = void 0;\n    // look for children first for the hostNode\n    // as composite fibers do not have a hostNode\n    while (fiber) {\n      if (fiber.stateNode !== null && fiber.tag === HostComponent) {\n        hostNode = findNodeHandle(fiber.stateNode);\n      }\n      if (hostNode) {\n        return hostNode;\n      }\n      fiber = fiber.child;\n    }\n    return null;\n  };\n\n  var createHierarchy = function(fiberHierarchy) {\n    return fiberHierarchy.map(function(fiber) {\n      return {\n        name: getComponentName(fiber),\n        getInspectorData: function(findNodeHandle) {\n          return {\n            measure: function(callback) {\n              return UIManager.measure(\n                getHostNode(fiber, findNodeHandle),\n                callback\n              );\n            },\n            props: getHostProps(fiber),\n            source: fiber._debugSource\n          };\n        }\n      };\n    });\n  };\n\n  getInspectorDataForViewTag = function(viewTag) {\n    var closestInstance = getInstanceFromTag(viewTag);\n\n    // Handle case where user clicks outside of ReactNative\n    if (!closestInstance) {\n      return {\n        hierarchy: [],\n        props: emptyObject,\n        selection: null,\n        source: null\n      };\n    }\n\n    var fiber = findCurrentFiberUsingSlowPath(closestInstance);\n    var fiberHierarchy = getOwnerHierarchy(fiber);\n    var instance = lastNonHostInstance(fiberHierarchy);\n    var hierarchy = createHierarchy(fiberHierarchy);\n    var props = getHostProps(instance);\n    var source = instance._debugSource;\n    var selection = fiberHierarchy.indexOf(instance);\n\n    return {\n      hierarchy: hierarchy,\n      props: props,\n      selection: selection,\n      source: source\n    };\n  };\n}\n\n/**\n * Creates a renderable ReactNative host component.\n * Use this method for view configs that are loaded from UIManager.\n * Use createReactNativeComponentClass() for view configs defined within JavaScript.\n *\n * @param {string} config iOS View configuration.\n * @private\n */\nvar createReactNativeComponentClass = function(name, callback) {\n  return register(name, callback);\n};\n\n// Module provided by RN:\n/**\n * Capture an image of the screen, window or an individual view. The image\n * will be stored in a temporary file that will only exist for as long as the\n * app is running.\n *\n * The `view` argument can be the literal string `window` if you want to\n * capture the entire window, or it can be a reference to a specific\n * React Native component.\n *\n * The `options` argument may include:\n * - width/height (number) - the width and height of the image to capture.\n * - format (string) - either 'png' or 'jpeg'. Defaults to 'png'.\n * - quality (number) - the quality when using jpeg. 0.0 - 1.0 (default).\n *\n * Returns a Promise.\n * @platform ios\n */\nfunction takeSnapshot(view, options) {\n  if (typeof view !== \"number\" && view !== \"window\") {\n    view = findNumericNodeHandleFiber(view) || \"window\";\n  }\n\n  // Call the hidden '__takeSnapshot' method; the main one throws an error to\n  // prevent accidental backwards-incompatible usage.\n  return UIManager.__takeSnapshot(view, options);\n}\n\n// TODO: direct imports like some-package/src/* are bad. Fix me.\n// Module provided by RN:\ninjection$2.injectFiberBatchedUpdates(NativeRenderer.batchedUpdates);\n\nvar roots = new Map();\n\n// Intercept lifecycle errors and ensure they are shown with the correct stack\n// trace within the native redbox component.\ninjection$4.injectDialog(showDialog$1);\n\nvar ReactNativeRenderer = {\n  NativeComponent: ReactNativeComponent,\n\n  findNodeHandle: findNumericNodeHandleFiber,\n\n  render: function(element, containerTag, callback) {\n    var root = roots.get(containerTag);\n\n    if (!root) {\n      // TODO (bvaughn): If we decide to keep the wrapper component,\n      // We could create a wrapper for containerTag as well to reduce special casing.\n      root = NativeRenderer.createContainer(containerTag, false);\n      roots.set(containerTag, root);\n    }\n    NativeRenderer.updateContainer(element, root, null, callback);\n\n    return NativeRenderer.getPublicRootInstance(root);\n  },\n  unmountComponentAtNode: function(containerTag) {\n    var root = roots.get(containerTag);\n    if (root) {\n      // TODO: Is it safe to reset this now or should I wait since this unmount could be deferred?\n      NativeRenderer.updateContainer(null, root, null, function() {\n        roots[\"delete\"](containerTag);\n      });\n    }\n  },\n  unmountComponentAtNodeAndRemoveContainer: function(containerTag) {\n    ReactNativeRenderer.unmountComponentAtNode(containerTag);\n\n    // Call back into native to remove all of the subviews from this container\n    UIManager.removeRootView(containerTag);\n  },\n  createPortal: function(children, containerTag) {\n    var key =\n      arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n    return createPortal(children, containerTag, null, key);\n  },\n\n  unstable_batchedUpdates: batchedUpdates,\n\n  flushSync: NativeRenderer.flushSync,\n\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {\n    // Used as a mixin in many createClass-based components\n    NativeMethodsMixin: NativeMethodsMixin,\n    // Used by react-native-github/Libraries/ components\n    ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin, // requireNativeComponent\n    ReactGlobalSharedState: ReactGlobalSharedState, // Systrace\n    ReactNativeComponentTree: ReactNativeComponentTree, // InspectorUtils, ScrollResponder\n    ReactNativePropRegistry: ReactNativePropRegistry, // flattenStyle, Stylesheet\n    TouchHistoryMath: TouchHistoryMath, // PanResponder\n    createReactNativeComponentClass: createReactNativeComponentClass, // RCTText, RCTView, ReactNativeART\n    takeSnapshot: takeSnapshot\n  }\n};\n\n{\n  // $FlowFixMe\n  Object.assign(\n    ReactNativeRenderer.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n    {\n      // TODO: none of these work since Fiber. Remove these dependencies.\n      // Used by RCTRenderingPerf, Systrace:\n      ReactDebugTool: {\n        addHook: function() {},\n        removeHook: function() {}\n      },\n      // Used by ReactPerfStallHandler, RCTRenderingPerf:\n      ReactPerf: {\n        start: function() {},\n        stop: function() {},\n        printInclusive: function() {},\n        printWasted: function() {}\n      }\n    }\n  );\n}\n\nNativeRenderer.injectIntoDevTools({\n  findFiberByHostInstance: getInstanceFromTag,\n  getInspectorDataForViewTag: getInspectorDataForViewTag,\n  bundleType: 1,\n  version: ReactVersion,\n  rendererPackageName: \"react-native-renderer\"\n});\n\nvar ReactNativeRenderer$2 = Object.freeze({\n  default: ReactNativeRenderer\n});\n\nvar ReactNativeRenderer$3 =\n  (ReactNativeRenderer$2 && ReactNativeRenderer) || ReactNativeRenderer$2;\n\n// TODO: decide on the top-level export form.\n// This is hacky but makes it work with both Rollup and Jest.\nvar reactNativeRenderer = ReactNativeRenderer$3[\"default\"]\n  ? ReactNativeRenderer$3[\"default\"]\n  : ReactNativeRenderer$3;\n\nmodule.exports = reactNativeRenderer;\n\n  })();\n}\n"
  },
  {
    "path": "Libraries/Renderer/ReactNativeRenderer-prod.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @noflow\n * @providesModule ReactNativeRenderer-prod\n * @preventMunge\n */\n\n\"use strict\";\nrequire(\"InitializeCore\");\nvar invariant = require(\"fbjs/lib/invariant\"),\n  emptyFunction = require(\"fbjs/lib/emptyFunction\"),\n  RCTEventEmitter = require(\"RCTEventEmitter\"),\n  UIManager = require(\"UIManager\"),\n  React = require(\"react\"),\n  ExceptionsManager = require(\"ExceptionsManager\"),\n  TextInputState = require(\"TextInputState\"),\n  deepDiffer = require(\"deepDiffer\"),\n  flattenStyle = require(\"flattenStyle\"),\n  emptyObject = require(\"fbjs/lib/emptyObject\"),\n  shallowEqual = require(\"fbjs/lib/shallowEqual\"),\n  ReactErrorUtils = {\n    _caughtError: null,\n    _hasCaughtError: !1,\n    _rethrowError: null,\n    _hasRethrowError: !1,\n    injection: {\n      injectErrorUtils: function(injectedErrorUtils) {\n        invariant(\n          \"function\" === typeof injectedErrorUtils.invokeGuardedCallback,\n          \"Injected invokeGuardedCallback() must be a function.\"\n        );\n        invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback;\n      }\n    },\n    invokeGuardedCallback: function(name, func, context, a, b, c, d, e, f) {\n      invokeGuardedCallback.apply(ReactErrorUtils, arguments);\n    },\n    invokeGuardedCallbackAndCatchFirstError: function(\n      name,\n      func,\n      context,\n      a,\n      b,\n      c,\n      d,\n      e,\n      f\n    ) {\n      ReactErrorUtils.invokeGuardedCallback.apply(this, arguments);\n      if (ReactErrorUtils.hasCaughtError()) {\n        var error = ReactErrorUtils.clearCaughtError();\n        ReactErrorUtils._hasRethrowError ||\n          ((ReactErrorUtils._hasRethrowError = !0),\n          (ReactErrorUtils._rethrowError = error));\n      }\n    },\n    rethrowCaughtError: function() {\n      return rethrowCaughtError.apply(ReactErrorUtils, arguments);\n    },\n    hasCaughtError: function() {\n      return ReactErrorUtils._hasCaughtError;\n    },\n    clearCaughtError: function() {\n      if (ReactErrorUtils._hasCaughtError) {\n        var error = ReactErrorUtils._caughtError;\n        ReactErrorUtils._caughtError = null;\n        ReactErrorUtils._hasCaughtError = !1;\n        return error;\n      }\n      invariant(\n        !1,\n        \"clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.\"\n      );\n    }\n  };\nfunction invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {\n  ReactErrorUtils._hasCaughtError = !1;\n  ReactErrorUtils._caughtError = null;\n  var funcArgs = Array.prototype.slice.call(arguments, 3);\n  try {\n    func.apply(context, funcArgs);\n  } catch (error) {\n    (ReactErrorUtils._caughtError = error),\n      (ReactErrorUtils._hasCaughtError = !0);\n  }\n}\nfunction rethrowCaughtError() {\n  if (ReactErrorUtils._hasRethrowError) {\n    var error = ReactErrorUtils._rethrowError;\n    ReactErrorUtils._rethrowError = null;\n    ReactErrorUtils._hasRethrowError = !1;\n    throw error;\n  }\n}\nvar eventPluginOrder = null,\n  namesToPlugins = {};\nfunction recomputePluginOrdering() {\n  if (eventPluginOrder)\n    for (var pluginName in namesToPlugins) {\n      var pluginModule = namesToPlugins[pluginName],\n        pluginIndex = eventPluginOrder.indexOf(pluginName);\n      invariant(\n        -1 < pluginIndex,\n        \"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.\",\n        pluginName\n      );\n      if (!plugins[pluginIndex]) {\n        invariant(\n          pluginModule.extractEvents,\n          \"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.\",\n          pluginName\n        );\n        plugins[pluginIndex] = pluginModule;\n        pluginIndex = pluginModule.eventTypes;\n        for (var eventName in pluginIndex) {\n          var JSCompiler_inline_result = void 0;\n          var dispatchConfig = pluginIndex[eventName],\n            pluginModule$jscomp$0 = pluginModule,\n            eventName$jscomp$0 = eventName;\n          invariant(\n            !eventNameDispatchConfigs.hasOwnProperty(eventName$jscomp$0),\n            \"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.\",\n            eventName$jscomp$0\n          );\n          eventNameDispatchConfigs[eventName$jscomp$0] = dispatchConfig;\n          var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;\n          if (phasedRegistrationNames) {\n            for (JSCompiler_inline_result in phasedRegistrationNames)\n              phasedRegistrationNames.hasOwnProperty(\n                JSCompiler_inline_result\n              ) &&\n                publishRegistrationName(\n                  phasedRegistrationNames[JSCompiler_inline_result],\n                  pluginModule$jscomp$0,\n                  eventName$jscomp$0\n                );\n            JSCompiler_inline_result = !0;\n          } else\n            dispatchConfig.registrationName\n              ? (publishRegistrationName(\n                  dispatchConfig.registrationName,\n                  pluginModule$jscomp$0,\n                  eventName$jscomp$0\n                ),\n                (JSCompiler_inline_result = !0))\n              : (JSCompiler_inline_result = !1);\n          invariant(\n            JSCompiler_inline_result,\n            \"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.\",\n            eventName,\n            pluginName\n          );\n        }\n      }\n    }\n}\nfunction publishRegistrationName(registrationName, pluginModule) {\n  invariant(\n    !registrationNameModules[registrationName],\n    \"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.\",\n    registrationName\n  );\n  registrationNameModules[registrationName] = pluginModule;\n}\nvar plugins = [],\n  eventNameDispatchConfigs = {},\n  registrationNameModules = {},\n  getFiberCurrentPropsFromNode = null,\n  getInstanceFromNode = null,\n  getNodeFromInstance = null;\nfunction isEndish(topLevelType) {\n  return (\n    \"topMouseUp\" === topLevelType ||\n    \"topTouchEnd\" === topLevelType ||\n    \"topTouchCancel\" === topLevelType\n  );\n}\nfunction isMoveish(topLevelType) {\n  return \"topMouseMove\" === topLevelType || \"topTouchMove\" === topLevelType;\n}\nfunction isStartish(topLevelType) {\n  return \"topMouseDown\" === topLevelType || \"topTouchStart\" === topLevelType;\n}\nfunction executeDispatch(event, simulated, listener, inst) {\n  simulated = event.type || \"unknown-event\";\n  event.currentTarget = getNodeFromInstance(inst);\n  ReactErrorUtils.invokeGuardedCallbackAndCatchFirstError(\n    simulated,\n    listener,\n    void 0,\n    event\n  );\n  event.currentTarget = null;\n}\nfunction executeDirectDispatch(event) {\n  var dispatchListener = event._dispatchListeners,\n    dispatchInstance = event._dispatchInstances;\n  invariant(\n    !Array.isArray(dispatchListener),\n    \"executeDirectDispatch(...): Invalid `event`.\"\n  );\n  event.currentTarget = dispatchListener\n    ? getNodeFromInstance(dispatchInstance)\n    : null;\n  dispatchListener = dispatchListener ? dispatchListener(event) : null;\n  event.currentTarget = null;\n  event._dispatchListeners = null;\n  event._dispatchInstances = null;\n  return dispatchListener;\n}\nfunction accumulateInto(current, next) {\n  invariant(\n    null != next,\n    \"accumulateInto(...): Accumulated items must not be null or undefined.\"\n  );\n  if (null == current) return next;\n  if (Array.isArray(current)) {\n    if (Array.isArray(next)) return current.push.apply(current, next), current;\n    current.push(next);\n    return current;\n  }\n  return Array.isArray(next) ? [current].concat(next) : [current, next];\n}\nfunction forEachAccumulated(arr, cb, scope) {\n  Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr);\n}\nvar eventQueue = null;\nfunction executeDispatchesAndReleaseTopLevel(e) {\n  if (e) {\n    var dispatchListeners = e._dispatchListeners,\n      dispatchInstances = e._dispatchInstances;\n    if (Array.isArray(dispatchListeners))\n      for (\n        var i = 0;\n        i < dispatchListeners.length && !e.isPropagationStopped();\n        i++\n      )\n        executeDispatch(e, !1, dispatchListeners[i], dispatchInstances[i]);\n    else\n      dispatchListeners &&\n        executeDispatch(e, !1, dispatchListeners, dispatchInstances);\n    e._dispatchListeners = null;\n    e._dispatchInstances = null;\n    e.isPersistent() || e.constructor.release(e);\n  }\n}\nvar injection = {\n  injectEventPluginOrder: function(injectedEventPluginOrder) {\n    invariant(\n      !eventPluginOrder,\n      \"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.\"\n    );\n    eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);\n    recomputePluginOrdering();\n  },\n  injectEventPluginsByName: function(injectedNamesToPlugins) {\n    var isOrderingDirty = !1,\n      pluginName;\n    for (pluginName in injectedNamesToPlugins)\n      if (injectedNamesToPlugins.hasOwnProperty(pluginName)) {\n        var pluginModule = injectedNamesToPlugins[pluginName];\n        (namesToPlugins.hasOwnProperty(pluginName) &&\n          namesToPlugins[pluginName] === pluginModule) ||\n          (invariant(\n            !namesToPlugins[pluginName],\n            \"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.\",\n            pluginName\n          ),\n          (namesToPlugins[pluginName] = pluginModule),\n          (isOrderingDirty = !0));\n      }\n    isOrderingDirty && recomputePluginOrdering();\n  }\n};\nfunction getListener(inst, registrationName) {\n  var listener = inst.stateNode;\n  if (!listener) return null;\n  var props = getFiberCurrentPropsFromNode(listener);\n  if (!props) return null;\n  listener = props[registrationName];\n  a: switch (registrationName) {\n    case \"onClick\":\n    case \"onClickCapture\":\n    case \"onDoubleClick\":\n    case \"onDoubleClickCapture\":\n    case \"onMouseDown\":\n    case \"onMouseDownCapture\":\n    case \"onMouseMove\":\n    case \"onMouseMoveCapture\":\n    case \"onMouseUp\":\n    case \"onMouseUpCapture\":\n      (props = !props.disabled) ||\n        ((inst = inst.type),\n        (props = !(\n          \"button\" === inst ||\n          \"input\" === inst ||\n          \"select\" === inst ||\n          \"textarea\" === inst\n        )));\n      inst = !props;\n      break a;\n    default:\n      inst = !1;\n  }\n  if (inst) return null;\n  invariant(\n    !listener || \"function\" === typeof listener,\n    \"Expected `%s` listener to be a function, instead got a value of `%s` type.\",\n    registrationName,\n    typeof listener\n  );\n  return listener;\n}\nfunction getParent(inst) {\n  do inst = inst[\"return\"];\n  while (inst && 5 !== inst.tag);\n  return inst ? inst : null;\n}\nfunction traverseTwoPhase(inst, fn, arg) {\n  for (var path = []; inst; ) path.push(inst), (inst = getParent(inst));\n  for (inst = path.length; 0 < inst--; ) fn(path[inst], \"captured\", arg);\n  for (inst = 0; inst < path.length; inst++) fn(path[inst], \"bubbled\", arg);\n}\nfunction accumulateDirectionalDispatches(inst, phase, event) {\n  if (\n    (phase = getListener(\n      inst,\n      event.dispatchConfig.phasedRegistrationNames[phase]\n    ))\n  )\n    (event._dispatchListeners = accumulateInto(\n      event._dispatchListeners,\n      phase\n    )),\n      (event._dispatchInstances = accumulateInto(\n        event._dispatchInstances,\n        inst\n      ));\n}\nfunction accumulateTwoPhaseDispatchesSingle(event) {\n  event &&\n    event.dispatchConfig.phasedRegistrationNames &&\n    traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n}\nfunction accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n  if (event && event.dispatchConfig.phasedRegistrationNames) {\n    var targetInst = event._targetInst;\n    targetInst = targetInst ? getParent(targetInst) : null;\n    traverseTwoPhase(targetInst, accumulateDirectionalDispatches, event);\n  }\n}\nfunction accumulateDirectDispatchesSingle(event) {\n  if (event && event.dispatchConfig.registrationName) {\n    var inst = event._targetInst;\n    if (inst && event && event.dispatchConfig.registrationName) {\n      var listener = getListener(inst, event.dispatchConfig.registrationName);\n      listener &&\n        ((event._dispatchListeners = accumulateInto(\n          event._dispatchListeners,\n          listener\n        )),\n        (event._dispatchInstances = accumulateInto(\n          event._dispatchInstances,\n          inst\n        )));\n    }\n  }\n}\nvar shouldBeReleasedProperties = \"dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances\".split(\n    \" \"\n  ),\n  EventInterface = {\n    type: null,\n    target: null,\n    currentTarget: emptyFunction.thatReturnsNull,\n    eventPhase: null,\n    bubbles: null,\n    cancelable: null,\n    timeStamp: function(event) {\n      return event.timeStamp || Date.now();\n    },\n    defaultPrevented: null,\n    isTrusted: null\n  };\nfunction SyntheticEvent(\n  dispatchConfig,\n  targetInst,\n  nativeEvent,\n  nativeEventTarget\n) {\n  this.dispatchConfig = dispatchConfig;\n  this._targetInst = targetInst;\n  this.nativeEvent = nativeEvent;\n  dispatchConfig = this.constructor.Interface;\n  for (var propName in dispatchConfig)\n    dispatchConfig.hasOwnProperty(propName) &&\n      ((targetInst = dispatchConfig[propName])\n        ? (this[propName] = targetInst(nativeEvent))\n        : \"target\" === propName\n          ? (this.target = nativeEventTarget)\n          : (this[propName] = nativeEvent[propName]));\n  this.isDefaultPrevented = (null != nativeEvent.defaultPrevented\n  ? nativeEvent.defaultPrevented\n  : !1 === nativeEvent.returnValue)\n    ? emptyFunction.thatReturnsTrue\n    : emptyFunction.thatReturnsFalse;\n  this.isPropagationStopped = emptyFunction.thatReturnsFalse;\n  return this;\n}\nObject.assign(SyntheticEvent.prototype, {\n  preventDefault: function() {\n    this.defaultPrevented = !0;\n    var event = this.nativeEvent;\n    event &&\n      (event.preventDefault\n        ? event.preventDefault()\n        : \"unknown\" !== typeof event.returnValue && (event.returnValue = !1),\n      (this.isDefaultPrevented = emptyFunction.thatReturnsTrue));\n  },\n  stopPropagation: function() {\n    var event = this.nativeEvent;\n    event &&\n      (event.stopPropagation\n        ? event.stopPropagation()\n        : \"unknown\" !== typeof event.cancelBubble && (event.cancelBubble = !0),\n      (this.isPropagationStopped = emptyFunction.thatReturnsTrue));\n  },\n  persist: function() {\n    this.isPersistent = emptyFunction.thatReturnsTrue;\n  },\n  isPersistent: emptyFunction.thatReturnsFalse,\n  destructor: function() {\n    var Interface = this.constructor.Interface,\n      propName;\n    for (propName in Interface) this[propName] = null;\n    for (\n      Interface = 0;\n      Interface < shouldBeReleasedProperties.length;\n      Interface++\n    )\n      this[shouldBeReleasedProperties[Interface]] = null;\n  }\n});\nSyntheticEvent.Interface = EventInterface;\nSyntheticEvent.augmentClass = function(Class, Interface) {\n  function E() {}\n  E.prototype = this.prototype;\n  var prototype = new E();\n  Object.assign(prototype, Class.prototype);\n  Class.prototype = prototype;\n  Class.prototype.constructor = Class;\n  Class.Interface = Object.assign({}, this.Interface, Interface);\n  Class.augmentClass = this.augmentClass;\n  addEventPoolingTo(Class);\n};\naddEventPoolingTo(SyntheticEvent);\nfunction getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {\n  if (this.eventPool.length) {\n    var instance = this.eventPool.pop();\n    this.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);\n    return instance;\n  }\n  return new this(dispatchConfig, targetInst, nativeEvent, nativeInst);\n}\nfunction releasePooledEvent(event) {\n  invariant(\n    event instanceof this,\n    \"Trying to release an event instance  into a pool of a different type.\"\n  );\n  event.destructor();\n  10 > this.eventPool.length && this.eventPool.push(event);\n}\nfunction addEventPoolingTo(EventConstructor) {\n  EventConstructor.eventPool = [];\n  EventConstructor.getPooled = getPooledEvent;\n  EventConstructor.release = releasePooledEvent;\n}\nfunction ResponderSyntheticEvent(\n  dispatchConfig,\n  dispatchMarker,\n  nativeEvent,\n  nativeEventTarget\n) {\n  return SyntheticEvent.call(\n    this,\n    dispatchConfig,\n    dispatchMarker,\n    nativeEvent,\n    nativeEventTarget\n  );\n}\nSyntheticEvent.augmentClass(ResponderSyntheticEvent, {\n  touchHistory: function() {\n    return null;\n  }\n});\nvar touchBank = [],\n  touchHistory = {\n    touchBank: touchBank,\n    numberActiveTouches: 0,\n    indexOfSingleActiveTouch: -1,\n    mostRecentTimeStamp: 0\n  };\nfunction timestampForTouch(touch) {\n  return touch.timeStamp || touch.timestamp;\n}\nfunction getTouchIdentifier(_ref) {\n  _ref = _ref.identifier;\n  invariant(null != _ref, \"Touch object is missing identifier.\");\n  return _ref;\n}\nfunction recordTouchStart(touch) {\n  var identifier = getTouchIdentifier(touch),\n    touchRecord = touchBank[identifier];\n  touchRecord\n    ? ((touchRecord.touchActive = !0),\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    : ((touchRecord = {\n        touchActive: !0,\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      (touchBank[identifier] = touchRecord));\n  touchHistory.mostRecentTimeStamp = timestampForTouch(touch);\n}\nfunction recordTouchMove(touch) {\n  var touchRecord = touchBank[getTouchIdentifier(touch)];\n  touchRecord\n    ? ((touchRecord.touchActive = !0),\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    : console.error(\n        \"Cannot record touch move without a touch start.\\nTouch Move: %s\\n\",\n        \"Touch Bank: %s\",\n        printTouch(touch),\n        printTouchBank()\n      );\n}\nfunction recordTouchEnd(touch) {\n  var touchRecord = touchBank[getTouchIdentifier(touch)];\n  touchRecord\n    ? ((touchRecord.touchActive = !1),\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    : console.error(\n        \"Cannot record touch end without a touch start.\\nTouch End: %s\\n\",\n        \"Touch Bank: %s\",\n        printTouch(touch),\n        printTouchBank()\n      );\n}\nfunction printTouch(touch) {\n  return JSON.stringify({\n    identifier: touch.identifier,\n    pageX: touch.pageX,\n    pageY: touch.pageY,\n    timestamp: timestampForTouch(touch)\n  });\n}\nfunction printTouchBank() {\n  var printed = JSON.stringify(touchBank.slice(0, 20));\n  20 < touchBank.length &&\n    (printed += \" (original size: \" + touchBank.length + \")\");\n  return printed;\n}\nvar ResponderTouchHistoryStore = {\n  recordTouchTrack: function(topLevelType, nativeEvent) {\n    if (isMoveish(topLevelType))\n      nativeEvent.changedTouches.forEach(recordTouchMove);\n    else if (isStartish(topLevelType))\n      nativeEvent.changedTouches.forEach(recordTouchStart),\n        (touchHistory.numberActiveTouches = nativeEvent.touches.length),\n        1 === touchHistory.numberActiveTouches &&\n          (touchHistory.indexOfSingleActiveTouch =\n            nativeEvent.touches[0].identifier);\n    else if (\n      isEndish(topLevelType) &&\n      (nativeEvent.changedTouches.forEach(recordTouchEnd),\n      (touchHistory.numberActiveTouches = nativeEvent.touches.length),\n      1 === touchHistory.numberActiveTouches)\n    )\n      for (topLevelType = 0; topLevelType < touchBank.length; topLevelType++)\n        if (\n          ((nativeEvent = touchBank[topLevelType]),\n          null != nativeEvent && nativeEvent.touchActive)\n        ) {\n          touchHistory.indexOfSingleActiveTouch = topLevelType;\n          break;\n        }\n  },\n  touchHistory: touchHistory\n};\nfunction accumulate(current, next) {\n  invariant(\n    null != next,\n    \"accumulate(...): Accumulated items must be not be null or undefined.\"\n  );\n  return null == current\n    ? next\n    : Array.isArray(current)\n      ? current.concat(next)\n      : Array.isArray(next) ? [current].concat(next) : [current, next];\n}\nvar responderInst = null,\n  trackedTouchCount = 0,\n  previousActiveTouches = 0;\nfunction changeResponder(nextResponderInst, blockHostResponder) {\n  var oldResponderInst = responderInst;\n  responderInst = nextResponderInst;\n  if (null !== ResponderEventPlugin.GlobalResponderHandler)\n    ResponderEventPlugin.GlobalResponderHandler.onChange(\n      oldResponderInst,\n      nextResponderInst,\n      blockHostResponder\n    );\n}\nvar eventTypes = {\n    startShouldSetResponder: {\n      phasedRegistrationNames: {\n        bubbled: \"onStartShouldSetResponder\",\n        captured: \"onStartShouldSetResponderCapture\"\n      }\n    },\n    scrollShouldSetResponder: {\n      phasedRegistrationNames: {\n        bubbled: \"onScrollShouldSetResponder\",\n        captured: \"onScrollShouldSetResponderCapture\"\n      }\n    },\n    selectionChangeShouldSetResponder: {\n      phasedRegistrationNames: {\n        bubbled: \"onSelectionChangeShouldSetResponder\",\n        captured: \"onSelectionChangeShouldSetResponderCapture\"\n      }\n    },\n    moveShouldSetResponder: {\n      phasedRegistrationNames: {\n        bubbled: \"onMoveShouldSetResponder\",\n        captured: \"onMoveShouldSetResponderCapture\"\n      }\n    },\n    responderStart: { registrationName: \"onResponderStart\" },\n    responderMove: { registrationName: \"onResponderMove\" },\n    responderEnd: { registrationName: \"onResponderEnd\" },\n    responderRelease: { registrationName: \"onResponderRelease\" },\n    responderTerminationRequest: {\n      registrationName: \"onResponderTerminationRequest\"\n    },\n    responderGrant: { registrationName: \"onResponderGrant\" },\n    responderReject: { registrationName: \"onResponderReject\" },\n    responderTerminate: { registrationName: \"onResponderTerminate\" }\n  },\n  ResponderEventPlugin = {\n    _getResponder: function() {\n      return responderInst;\n    },\n    eventTypes: eventTypes,\n    extractEvents: function(\n      topLevelType,\n      targetInst,\n      nativeEvent,\n      nativeEventTarget\n    ) {\n      if (isStartish(topLevelType)) trackedTouchCount += 1;\n      else if (isEndish(topLevelType))\n        if (0 <= trackedTouchCount) --trackedTouchCount;\n        else\n          return (\n            console.error(\n              \"Ended a touch event which was not counted in `trackedTouchCount`.\"\n            ),\n            null\n          );\n      ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent);\n      if (\n        targetInst &&\n        ((\"topScroll\" === topLevelType && !nativeEvent.responderIgnoreScroll) ||\n          (0 < trackedTouchCount && \"topSelectionChange\" === topLevelType) ||\n          isStartish(topLevelType) ||\n          isMoveish(topLevelType))\n      ) {\n        var shouldSetEventType = isStartish(topLevelType)\n          ? eventTypes.startShouldSetResponder\n          : isMoveish(topLevelType)\n            ? eventTypes.moveShouldSetResponder\n            : \"topSelectionChange\" === topLevelType\n              ? eventTypes.selectionChangeShouldSetResponder\n              : eventTypes.scrollShouldSetResponder;\n        if (responderInst)\n          b: {\n            var JSCompiler_temp = responderInst;\n            for (\n              var depthA = 0, tempA = JSCompiler_temp;\n              tempA;\n              tempA = getParent(tempA)\n            )\n              depthA++;\n            tempA = 0;\n            for (var tempB = targetInst; tempB; tempB = getParent(tempB))\n              tempA++;\n            for (; 0 < depthA - tempA; )\n              (JSCompiler_temp = getParent(JSCompiler_temp)), depthA--;\n            for (; 0 < tempA - depthA; )\n              (targetInst = getParent(targetInst)), tempA--;\n            for (; depthA--; ) {\n              if (\n                JSCompiler_temp === targetInst ||\n                JSCompiler_temp === targetInst.alternate\n              )\n                break b;\n              JSCompiler_temp = getParent(JSCompiler_temp);\n              targetInst = getParent(targetInst);\n            }\n            JSCompiler_temp = null;\n          }\n        else JSCompiler_temp = targetInst;\n        targetInst = JSCompiler_temp === responderInst;\n        JSCompiler_temp = ResponderSyntheticEvent.getPooled(\n          shouldSetEventType,\n          JSCompiler_temp,\n          nativeEvent,\n          nativeEventTarget\n        );\n        JSCompiler_temp.touchHistory = ResponderTouchHistoryStore.touchHistory;\n        targetInst\n          ? forEachAccumulated(\n              JSCompiler_temp,\n              accumulateTwoPhaseDispatchesSingleSkipTarget\n            )\n          : forEachAccumulated(\n              JSCompiler_temp,\n              accumulateTwoPhaseDispatchesSingle\n            );\n        b: {\n          shouldSetEventType = JSCompiler_temp._dispatchListeners;\n          targetInst = JSCompiler_temp._dispatchInstances;\n          if (Array.isArray(shouldSetEventType))\n            for (\n              depthA = 0;\n              depthA < shouldSetEventType.length &&\n              !JSCompiler_temp.isPropagationStopped();\n              depthA++\n            ) {\n              if (\n                shouldSetEventType[depthA](JSCompiler_temp, targetInst[depthA])\n              ) {\n                shouldSetEventType = targetInst[depthA];\n                break b;\n              }\n            }\n          else if (\n            shouldSetEventType &&\n            shouldSetEventType(JSCompiler_temp, targetInst)\n          ) {\n            shouldSetEventType = targetInst;\n            break b;\n          }\n          shouldSetEventType = null;\n        }\n        JSCompiler_temp._dispatchInstances = null;\n        JSCompiler_temp._dispatchListeners = null;\n        JSCompiler_temp.isPersistent() ||\n          JSCompiler_temp.constructor.release(JSCompiler_temp);\n        if (shouldSetEventType && shouldSetEventType !== responderInst)\n          if (\n            ((JSCompiler_temp = ResponderSyntheticEvent.getPooled(\n              eventTypes.responderGrant,\n              shouldSetEventType,\n              nativeEvent,\n              nativeEventTarget\n            )),\n            (JSCompiler_temp.touchHistory =\n              ResponderTouchHistoryStore.touchHistory),\n            forEachAccumulated(\n              JSCompiler_temp,\n              accumulateDirectDispatchesSingle\n            ),\n            (targetInst = !0 === executeDirectDispatch(JSCompiler_temp)),\n            responderInst)\n          )\n            if (\n              ((depthA = ResponderSyntheticEvent.getPooled(\n                eventTypes.responderTerminationRequest,\n                responderInst,\n                nativeEvent,\n                nativeEventTarget\n              )),\n              (depthA.touchHistory = ResponderTouchHistoryStore.touchHistory),\n              forEachAccumulated(depthA, accumulateDirectDispatchesSingle),\n              (tempA =\n                !depthA._dispatchListeners || executeDirectDispatch(depthA)),\n              depthA.isPersistent() || depthA.constructor.release(depthA),\n              tempA)\n            ) {\n              depthA = ResponderSyntheticEvent.getPooled(\n                eventTypes.responderTerminate,\n                responderInst,\n                nativeEvent,\n                nativeEventTarget\n              );\n              depthA.touchHistory = ResponderTouchHistoryStore.touchHistory;\n              forEachAccumulated(depthA, accumulateDirectDispatchesSingle);\n              var JSCompiler_temp$jscomp$0 = accumulate(\n                JSCompiler_temp$jscomp$0,\n                [JSCompiler_temp, depthA]\n              );\n              changeResponder(shouldSetEventType, targetInst);\n            } else\n              (shouldSetEventType = ResponderSyntheticEvent.getPooled(\n                eventTypes.responderReject,\n                shouldSetEventType,\n                nativeEvent,\n                nativeEventTarget\n              )),\n                (shouldSetEventType.touchHistory =\n                  ResponderTouchHistoryStore.touchHistory),\n                forEachAccumulated(\n                  shouldSetEventType,\n                  accumulateDirectDispatchesSingle\n                ),\n                (JSCompiler_temp$jscomp$0 = accumulate(\n                  JSCompiler_temp$jscomp$0,\n                  shouldSetEventType\n                ));\n          else\n            (JSCompiler_temp$jscomp$0 = accumulate(\n              JSCompiler_temp$jscomp$0,\n              JSCompiler_temp\n            )),\n              changeResponder(shouldSetEventType, targetInst);\n        else JSCompiler_temp$jscomp$0 = null;\n      } else JSCompiler_temp$jscomp$0 = null;\n      shouldSetEventType = responderInst && isStartish(topLevelType);\n      JSCompiler_temp = responderInst && isMoveish(topLevelType);\n      targetInst = responderInst && isEndish(topLevelType);\n      if (\n        (shouldSetEventType = shouldSetEventType\n          ? eventTypes.responderStart\n          : JSCompiler_temp\n            ? eventTypes.responderMove\n            : targetInst ? eventTypes.responderEnd : null)\n      )\n        (shouldSetEventType = ResponderSyntheticEvent.getPooled(\n          shouldSetEventType,\n          responderInst,\n          nativeEvent,\n          nativeEventTarget\n        )),\n          (shouldSetEventType.touchHistory =\n            ResponderTouchHistoryStore.touchHistory),\n          forEachAccumulated(\n            shouldSetEventType,\n            accumulateDirectDispatchesSingle\n          ),\n          (JSCompiler_temp$jscomp$0 = accumulate(\n            JSCompiler_temp$jscomp$0,\n            shouldSetEventType\n          ));\n      shouldSetEventType = responderInst && \"topTouchCancel\" === topLevelType;\n      if (\n        (topLevelType =\n          responderInst && !shouldSetEventType && isEndish(topLevelType))\n      )\n        a: {\n          if ((topLevelType = nativeEvent.touches) && 0 !== topLevelType.length)\n            for (\n              JSCompiler_temp = 0;\n              JSCompiler_temp < topLevelType.length;\n              JSCompiler_temp++\n            )\n              if (\n                ((targetInst = topLevelType[JSCompiler_temp].target),\n                null !== targetInst &&\n                  void 0 !== targetInst &&\n                  0 !== targetInst)\n              ) {\n                depthA = getInstanceFromNode(targetInst);\n                b: {\n                  for (targetInst = responderInst; depthA; ) {\n                    if (\n                      targetInst === depthA ||\n                      targetInst === depthA.alternate\n                    ) {\n                      targetInst = !0;\n                      break b;\n                    }\n                    depthA = getParent(depthA);\n                  }\n                  targetInst = !1;\n                }\n                if (targetInst) {\n                  topLevelType = !1;\n                  break a;\n                }\n              }\n          topLevelType = !0;\n        }\n      if (\n        (topLevelType = shouldSetEventType\n          ? eventTypes.responderTerminate\n          : topLevelType ? eventTypes.responderRelease : null)\n      )\n        (nativeEvent = ResponderSyntheticEvent.getPooled(\n          topLevelType,\n          responderInst,\n          nativeEvent,\n          nativeEventTarget\n        )),\n          (nativeEvent.touchHistory = ResponderTouchHistoryStore.touchHistory),\n          forEachAccumulated(nativeEvent, accumulateDirectDispatchesSingle),\n          (JSCompiler_temp$jscomp$0 = accumulate(\n            JSCompiler_temp$jscomp$0,\n            nativeEvent\n          )),\n          changeResponder(null);\n      nativeEvent = ResponderTouchHistoryStore.touchHistory.numberActiveTouches;\n      if (\n        ResponderEventPlugin.GlobalInteractionHandler &&\n        nativeEvent !== previousActiveTouches\n      )\n        ResponderEventPlugin.GlobalInteractionHandler.onChange(nativeEvent);\n      previousActiveTouches = nativeEvent;\n      return JSCompiler_temp$jscomp$0;\n    },\n    GlobalResponderHandler: null,\n    GlobalInteractionHandler: null,\n    injection: {\n      injectGlobalResponderHandler: function(GlobalResponderHandler) {\n        ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler;\n      },\n      injectGlobalInteractionHandler: function(GlobalInteractionHandler) {\n        ResponderEventPlugin.GlobalInteractionHandler = GlobalInteractionHandler;\n      }\n    }\n  },\n  customBubblingEventTypes = {},\n  customDirectEventTypes = {},\n  ReactNativeBridgeEventPlugin = {\n    eventTypes: {},\n    extractEvents: function(\n      topLevelType,\n      targetInst,\n      nativeEvent,\n      nativeEventTarget\n    ) {\n      var bubbleDispatchConfig = customBubblingEventTypes[topLevelType],\n        directDispatchConfig = customDirectEventTypes[topLevelType];\n      invariant(\n        bubbleDispatchConfig || directDispatchConfig,\n        'Unsupported top level event type \"%s\" dispatched',\n        topLevelType\n      );\n      topLevelType = SyntheticEvent.getPooled(\n        bubbleDispatchConfig || directDispatchConfig,\n        targetInst,\n        nativeEvent,\n        nativeEventTarget\n      );\n      if (bubbleDispatchConfig)\n        forEachAccumulated(topLevelType, accumulateTwoPhaseDispatchesSingle);\n      else if (directDispatchConfig)\n        forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle);\n      else return null;\n      return topLevelType;\n    },\n    processEventTypes: function(viewConfig) {\n      var bubblingEventTypes = viewConfig.bubblingEventTypes;\n      viewConfig = viewConfig.directEventTypes;\n      if (null != bubblingEventTypes)\n        for (var _topLevelType in bubblingEventTypes)\n          null == customBubblingEventTypes[_topLevelType] &&\n            (ReactNativeBridgeEventPlugin.eventTypes[\n              _topLevelType\n            ] = customBubblingEventTypes[_topLevelType] =\n              bubblingEventTypes[_topLevelType]);\n      if (null != viewConfig)\n        for (var _topLevelType2 in viewConfig)\n          null == customDirectEventTypes[_topLevelType2] &&\n            (ReactNativeBridgeEventPlugin.eventTypes[\n              _topLevelType2\n            ] = customDirectEventTypes[_topLevelType2] =\n              viewConfig[_topLevelType2]);\n    }\n  },\n  instanceCache = {},\n  instanceProps = {};\nfunction uncacheFiberNode(tag) {\n  delete instanceCache[tag];\n  delete instanceProps[tag];\n}\nfunction getInstanceFromTag(tag) {\n  return instanceCache[tag] || null;\n}\nvar ReactNativeComponentTree = Object.freeze({\n    precacheFiberNode: function(hostInst, tag) {\n      instanceCache[tag] = hostInst;\n    },\n    uncacheFiberNode: uncacheFiberNode,\n    getClosestInstanceFromNode: getInstanceFromTag,\n    getInstanceFromNode: getInstanceFromTag,\n    getNodeFromInstance: function(inst) {\n      inst = inst.stateNode._nativeTag;\n      invariant(inst, \"All native instances should have a tag.\");\n      return inst;\n    },\n    getFiberCurrentPropsFromNode: function(stateNode) {\n      return instanceProps[stateNode._nativeTag] || null;\n    },\n    updateFiberProps: function(tag, props) {\n      instanceProps[tag] = props;\n    }\n  }),\n  restoreTarget = null,\n  restoreQueue = null;\nfunction restoreStateOfTarget(target) {\n  if ((target = getInstanceFromNode(target))) {\n    invariant(\n      null,\n      \"Fiber needs to be injected to handle a fiber target for controlled events. This error is likely caused by a bug in React. Please file an issue.\"\n    );\n    var props = getFiberCurrentPropsFromNode(target.stateNode);\n    null.restoreControlledState(target.stateNode, target.type, props);\n  }\n}\nfunction fiberBatchedUpdates(fn, bookkeeping) {\n  return fn(bookkeeping);\n}\nvar isNestingBatched = !1;\nfunction batchedUpdates(fn, bookkeeping) {\n  if (isNestingBatched) return fiberBatchedUpdates(fn, bookkeeping);\n  isNestingBatched = !0;\n  try {\n    return fiberBatchedUpdates(fn, bookkeeping);\n  } finally {\n    if (\n      ((isNestingBatched = !1),\n      restoreTarget &&\n        ((bookkeeping = restoreTarget),\n        (fn = restoreQueue),\n        (restoreQueue = restoreTarget = null),\n        restoreStateOfTarget(bookkeeping),\n        fn))\n    )\n      for (bookkeeping = 0; bookkeeping < fn.length; bookkeeping++)\n        restoreStateOfTarget(fn[bookkeeping]);\n  }\n}\nfunction handleTopLevel(\n  topLevelType,\n  targetInst,\n  nativeEvent,\n  nativeEventTarget\n) {\n  for (var events, i = 0; i < plugins.length; i++) {\n    var possiblePlugin = plugins[i];\n    possiblePlugin &&\n      (possiblePlugin = possiblePlugin.extractEvents(\n        topLevelType,\n        targetInst,\n        nativeEvent,\n        nativeEventTarget\n      )) &&\n      (events = accumulateInto(events, possiblePlugin));\n  }\n  events && (eventQueue = accumulateInto(eventQueue, events));\n  topLevelType = eventQueue;\n  eventQueue = null;\n  topLevelType &&\n    (forEachAccumulated(topLevelType, executeDispatchesAndReleaseTopLevel),\n    invariant(\n      !eventQueue,\n      \"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.\"\n    ),\n    ReactErrorUtils.rethrowCaughtError());\n}\nvar ReactNativeTagHandles = {\n    tagsStartAt: 1,\n    tagCount: 1,\n    allocateTag: function() {\n      for (; this.reactTagIsNativeTopRootID(ReactNativeTagHandles.tagCount); )\n        ReactNativeTagHandles.tagCount++;\n      var tag = ReactNativeTagHandles.tagCount;\n      ReactNativeTagHandles.tagCount++;\n      return tag;\n    },\n    assertRootTag: function(tag) {\n      invariant(\n        this.reactTagIsNativeTopRootID(tag),\n        \"Expect a native root tag, instead got %s\",\n        tag\n      );\n    },\n    reactTagIsNativeTopRootID: function(reactTag) {\n      return 1 === reactTag % 10;\n    }\n  },\n  EMPTY_NATIVE_EVENT = {};\nfunction _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam) {\n  var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT,\n    inst = getInstanceFromTag(rootNodeID);\n  batchedUpdates(function() {\n    handleTopLevel(topLevelType, inst, nativeEvent, nativeEvent.target);\n  });\n}\nvar ReactNativeEventEmitter = Object.freeze({\n  getListener: getListener,\n  registrationNames: registrationNameModules,\n  _receiveRootNodeIDEvent: _receiveRootNodeIDEvent,\n  receiveEvent: function(rootNodeID, topLevelType, nativeEventParam) {\n    _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam);\n  },\n  receiveTouches: function(eventTopLevelType, touches, changedIndices) {\n    if (\n      \"topTouchEnd\" === eventTopLevelType ||\n      \"topTouchCancel\" === eventTopLevelType\n    ) {\n      var JSCompiler_temp = [];\n      for (var i = 0; i < changedIndices.length; i++) {\n        var index = changedIndices[i];\n        JSCompiler_temp.push(touches[index]);\n        touches[index] = null;\n      }\n      for (i = changedIndices = 0; i < touches.length; i++)\n        (index = touches[i]),\n          null !== index && (touches[changedIndices++] = index);\n      touches.length = changedIndices;\n    } else\n      for (JSCompiler_temp = [], i = 0; i < changedIndices.length; i++)\n        JSCompiler_temp.push(touches[changedIndices[i]]);\n    for (\n      changedIndices = 0;\n      changedIndices < JSCompiler_temp.length;\n      changedIndices++\n    ) {\n      i = JSCompiler_temp[changedIndices];\n      i.changedTouches = JSCompiler_temp;\n      i.touches = touches;\n      index = null;\n      var target = i.target;\n      null === target ||\n        void 0 === target ||\n        target < ReactNativeTagHandles.tagsStartAt ||\n        (index = target);\n      _receiveRootNodeIDEvent(index, eventTopLevelType, i);\n    }\n  },\n  handleTopLevel: handleTopLevel\n});\nRCTEventEmitter.register(ReactNativeEventEmitter);\ninjection.injectEventPluginOrder([\n  \"ResponderEventPlugin\",\n  \"ReactNativeBridgeEventPlugin\"\n]);\ngetFiberCurrentPropsFromNode =\n  ReactNativeComponentTree.getFiberCurrentPropsFromNode;\ngetInstanceFromNode = ReactNativeComponentTree.getInstanceFromNode;\ngetNodeFromInstance = ReactNativeComponentTree.getNodeFromInstance;\nResponderEventPlugin.injection.injectGlobalResponderHandler({\n  onChange: function(from, to, blockNativeResponder) {\n    null !== to\n      ? UIManager.setJSResponder(to.stateNode._nativeTag, blockNativeResponder)\n      : UIManager.clearJSResponder();\n  }\n});\ninjection.injectEventPluginsByName({\n  ResponderEventPlugin: ResponderEventPlugin,\n  ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin\n});\nfunction defaultShowDialog() {\n  return !0;\n}\nvar showDialog = defaultShowDialog,\n  hasSymbol = \"function\" === typeof Symbol && Symbol[\"for\"],\n  REACT_ELEMENT_TYPE = hasSymbol ? Symbol[\"for\"](\"react.element\") : 60103,\n  REACT_CALL_TYPE = hasSymbol ? Symbol[\"for\"](\"react.call\") : 60104,\n  REACT_RETURN_TYPE = hasSymbol ? Symbol[\"for\"](\"react.return\") : 60105,\n  REACT_PORTAL_TYPE = hasSymbol ? Symbol[\"for\"](\"react.portal\") : 60106,\n  REACT_FRAGMENT_TYPE = hasSymbol ? Symbol[\"for\"](\"react.fragment\") : 60107,\n  MAYBE_ITERATOR_SYMBOL = \"function\" === typeof Symbol && Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n  if (null === maybeIterable || \"undefined\" === typeof maybeIterable)\n    return null;\n  maybeIterable =\n    (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n    maybeIterable[\"@@iterator\"];\n  return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nfunction createPortal(children, containerInfo, implementation) {\n  var key =\n    3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n  return {\n    $$typeof: REACT_PORTAL_TYPE,\n    key: null == key ? null : \"\" + key,\n    children: children,\n    containerInfo: containerInfo,\n    implementation: implementation\n  };\n}\nvar TouchHistoryMath = {\n    centroidDimension: function(\n      touchHistory,\n      touchesChangedAfter,\n      isXAxis,\n      ofCurrent\n    ) {\n      var touchBank = touchHistory.touchBank,\n        total = 0,\n        count = 0;\n      touchHistory =\n        1 === touchHistory.numberActiveTouches\n          ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch]\n          : null;\n      if (null !== touchHistory)\n        touchHistory.touchActive &&\n          touchHistory.currentTimeStamp > touchesChangedAfter &&\n          ((total +=\n            ofCurrent && isXAxis\n              ? touchHistory.currentPageX\n              : ofCurrent && !isXAxis\n                ? touchHistory.currentPageY\n                : !ofCurrent && isXAxis\n                  ? touchHistory.previousPageX\n                  : touchHistory.previousPageY),\n          (count = 1));\n      else\n        for (\n          touchHistory = 0;\n          touchHistory < touchBank.length;\n          touchHistory++\n        ) {\n          var touchTrack = touchBank[touchHistory];\n          null !== touchTrack &&\n            void 0 !== touchTrack &&\n            touchTrack.touchActive &&\n            touchTrack.currentTimeStamp >= touchesChangedAfter &&\n            ((total +=\n              ofCurrent && isXAxis\n                ? touchTrack.currentPageX\n                : ofCurrent && !isXAxis\n                  ? touchTrack.currentPageY\n                  : !ofCurrent && isXAxis\n                    ? touchTrack.previousPageX\n                    : touchTrack.previousPageY),\n            count++);\n        }\n      return 0 < count ? total / count : TouchHistoryMath.noCentroid;\n    },\n    currentCentroidXOfTouchesChangedAfter: function(\n      touchHistory,\n      touchesChangedAfter\n    ) {\n      return TouchHistoryMath.centroidDimension(\n        touchHistory,\n        touchesChangedAfter,\n        !0,\n        !0\n      );\n    },\n    currentCentroidYOfTouchesChangedAfter: function(\n      touchHistory,\n      touchesChangedAfter\n    ) {\n      return TouchHistoryMath.centroidDimension(\n        touchHistory,\n        touchesChangedAfter,\n        !1,\n        !0\n      );\n    },\n    previousCentroidXOfTouchesChangedAfter: function(\n      touchHistory,\n      touchesChangedAfter\n    ) {\n      return TouchHistoryMath.centroidDimension(\n        touchHistory,\n        touchesChangedAfter,\n        !0,\n        !1\n      );\n    },\n    previousCentroidYOfTouchesChangedAfter: function(\n      touchHistory,\n      touchesChangedAfter\n    ) {\n      return TouchHistoryMath.centroidDimension(\n        touchHistory,\n        touchesChangedAfter,\n        !1,\n        !1\n      );\n    },\n    currentCentroidX: function(touchHistory) {\n      return TouchHistoryMath.centroidDimension(touchHistory, 0, !0, !0);\n    },\n    currentCentroidY: function(touchHistory) {\n      return TouchHistoryMath.centroidDimension(touchHistory, 0, !1, !0);\n    },\n    noCentroid: -1\n  },\n  ReactCurrentOwner =\n    React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,\n  ReactGlobalSharedState = Object.freeze({\n    ReactCurrentOwner: ReactCurrentOwner,\n    ReactDebugCurrentFrame: null\n  }),\n  objects = {},\n  uniqueID = 1,\n  emptyObject$2 = {},\n  ReactNativePropRegistry = (function() {\n    function ReactNativePropRegistry() {\n      if (!(this instanceof ReactNativePropRegistry))\n        throw new TypeError(\"Cannot call a class as a function\");\n    }\n    ReactNativePropRegistry.register = function(object) {\n      var id = ++uniqueID;\n      objects[id] = object;\n      return id;\n    };\n    ReactNativePropRegistry.getByID = function(id) {\n      if (!id) return emptyObject$2;\n      var object = objects[id];\n      return object\n        ? object\n        : (console.warn(\"Invalid style with id `\" + id + \"`. Skipping ...\"),\n          emptyObject$2);\n    };\n    return ReactNativePropRegistry;\n  })(),\n  emptyObject$1 = {},\n  removedKeys = null,\n  removedKeyCount = 0;\nfunction resolveObject(idOrObject) {\n  return \"number\" === typeof idOrObject\n    ? ReactNativePropRegistry.getByID(idOrObject)\n    : idOrObject;\n}\nfunction restoreDeletedValuesInNestedArray(\n  updatePayload,\n  node,\n  validAttributes\n) {\n  if (Array.isArray(node))\n    for (var i = node.length; i-- && 0 < removedKeyCount; )\n      restoreDeletedValuesInNestedArray(\n        updatePayload,\n        node[i],\n        validAttributes\n      );\n  else if (node && 0 < removedKeyCount)\n    for (i in ((node = resolveObject(node)), removedKeys))\n      if (removedKeys[i]) {\n        var nextProp = node[i];\n        if (void 0 !== nextProp) {\n          var attributeConfig = validAttributes[i];\n          if (attributeConfig) {\n            \"function\" === typeof nextProp && (nextProp = !0);\n            \"undefined\" === typeof nextProp && (nextProp = null);\n            if (\"object\" !== typeof attributeConfig)\n              updatePayload[i] = nextProp;\n            else if (\n              \"function\" === typeof attributeConfig.diff ||\n              \"function\" === typeof attributeConfig.process\n            )\n              (nextProp =\n                \"function\" === typeof attributeConfig.process\n                  ? attributeConfig.process(nextProp)\n                  : nextProp),\n                (updatePayload[i] = nextProp);\n            removedKeys[i] = !1;\n            removedKeyCount--;\n          }\n        }\n      }\n}\nfunction diffNestedProperty(\n  updatePayload,\n  prevProp,\n  nextProp,\n  validAttributes\n) {\n  if (!updatePayload && prevProp === nextProp) return updatePayload;\n  if (!prevProp || !nextProp)\n    return nextProp\n      ? addNestedProperty(updatePayload, nextProp, validAttributes)\n      : prevProp\n        ? clearNestedProperty(updatePayload, prevProp, validAttributes)\n        : updatePayload;\n  if (!Array.isArray(prevProp) && !Array.isArray(nextProp))\n    return diffProperties(\n      updatePayload,\n      resolveObject(prevProp),\n      resolveObject(nextProp),\n      validAttributes\n    );\n  if (Array.isArray(prevProp) && Array.isArray(nextProp)) {\n    var minLength =\n        prevProp.length < nextProp.length ? prevProp.length : nextProp.length,\n      i;\n    for (i = 0; i < minLength; i++)\n      updatePayload = diffNestedProperty(\n        updatePayload,\n        prevProp[i],\n        nextProp[i],\n        validAttributes\n      );\n    for (; i < prevProp.length; i++)\n      updatePayload = clearNestedProperty(\n        updatePayload,\n        prevProp[i],\n        validAttributes\n      );\n    for (; i < nextProp.length; i++)\n      updatePayload = addNestedProperty(\n        updatePayload,\n        nextProp[i],\n        validAttributes\n      );\n    return updatePayload;\n  }\n  return Array.isArray(prevProp)\n    ? diffProperties(\n        updatePayload,\n        flattenStyle(prevProp),\n        resolveObject(nextProp),\n        validAttributes\n      )\n    : diffProperties(\n        updatePayload,\n        resolveObject(prevProp),\n        flattenStyle(nextProp),\n        validAttributes\n      );\n}\nfunction addNestedProperty(updatePayload, nextProp, validAttributes) {\n  if (!nextProp) return updatePayload;\n  if (!Array.isArray(nextProp))\n    return (\n      (nextProp = resolveObject(nextProp)),\n      diffProperties(updatePayload, emptyObject$1, nextProp, validAttributes)\n    );\n  for (var i = 0; i < nextProp.length; i++)\n    updatePayload = addNestedProperty(\n      updatePayload,\n      nextProp[i],\n      validAttributes\n    );\n  return updatePayload;\n}\nfunction clearNestedProperty(updatePayload, prevProp, validAttributes) {\n  if (!prevProp) return updatePayload;\n  if (!Array.isArray(prevProp))\n    return (\n      (prevProp = resolveObject(prevProp)),\n      diffProperties(updatePayload, prevProp, emptyObject$1, validAttributes)\n    );\n  for (var i = 0; i < prevProp.length; i++)\n    updatePayload = clearNestedProperty(\n      updatePayload,\n      prevProp[i],\n      validAttributes\n    );\n  return updatePayload;\n}\nfunction diffProperties(updatePayload, prevProps, nextProps, validAttributes) {\n  var attributeConfig, propKey;\n  for (propKey in nextProps)\n    if ((attributeConfig = validAttributes[propKey])) {\n      var prevProp = prevProps[propKey];\n      var nextProp = nextProps[propKey];\n      \"function\" === typeof nextProp &&\n        ((nextProp = !0), \"function\" === typeof prevProp && (prevProp = !0));\n      \"undefined\" === typeof nextProp &&\n        ((nextProp = null),\n        \"undefined\" === typeof prevProp && (prevProp = null));\n      removedKeys && (removedKeys[propKey] = !1);\n      if (updatePayload && void 0 !== updatePayload[propKey])\n        if (\"object\" !== typeof attributeConfig)\n          updatePayload[propKey] = nextProp;\n        else {\n          if (\n            \"function\" === typeof attributeConfig.diff ||\n            \"function\" === typeof attributeConfig.process\n          )\n            (attributeConfig =\n              \"function\" === typeof attributeConfig.process\n                ? attributeConfig.process(nextProp)\n                : nextProp),\n              (updatePayload[propKey] = attributeConfig);\n        }\n      else if (prevProp !== nextProp)\n        if (\"object\" !== typeof attributeConfig)\n          (\"object\" !== typeof nextProp ||\n            null === nextProp ||\n            deepDiffer(prevProp, nextProp)) &&\n            ((updatePayload || (updatePayload = {}))[propKey] = nextProp);\n        else if (\n          \"function\" === typeof attributeConfig.diff ||\n          \"function\" === typeof attributeConfig.process\n        ) {\n          if (\n            void 0 === prevProp ||\n            (\"function\" === typeof attributeConfig.diff\n              ? attributeConfig.diff(prevProp, nextProp)\n              : \"object\" !== typeof nextProp ||\n                null === nextProp ||\n                deepDiffer(prevProp, nextProp))\n          )\n            (attributeConfig =\n              \"function\" === typeof attributeConfig.process\n                ? attributeConfig.process(nextProp)\n                : nextProp),\n              ((updatePayload || (updatePayload = {}))[\n                propKey\n              ] = attributeConfig);\n        } else\n          (removedKeys = null),\n            (removedKeyCount = 0),\n            (updatePayload = diffNestedProperty(\n              updatePayload,\n              prevProp,\n              nextProp,\n              attributeConfig\n            )),\n            0 < removedKeyCount &&\n              updatePayload &&\n              (restoreDeletedValuesInNestedArray(\n                updatePayload,\n                nextProp,\n                attributeConfig\n              ),\n              (removedKeys = null));\n    }\n  for (propKey in prevProps)\n    void 0 === nextProps[propKey] &&\n      (!(attributeConfig = validAttributes[propKey]) ||\n        (updatePayload && void 0 !== updatePayload[propKey]) ||\n        ((prevProp = prevProps[propKey]),\n        void 0 !== prevProp &&\n          (\"object\" !== typeof attributeConfig ||\n          \"function\" === typeof attributeConfig.diff ||\n          \"function\" === typeof attributeConfig.process\n            ? (((updatePayload || (updatePayload = {}))[propKey] = null),\n              removedKeys || (removedKeys = {}),\n              removedKeys[propKey] ||\n                ((removedKeys[propKey] = !0), removedKeyCount++))\n            : (updatePayload = clearNestedProperty(\n                updatePayload,\n                prevProp,\n                attributeConfig\n              )))));\n  return updatePayload;\n}\nfunction mountSafeCallback(context, callback) {\n  return function() {\n    if (callback) {\n      if (\"boolean\" === typeof context.__isMounted) {\n        if (!context.__isMounted) return;\n      } else if (\n        \"function\" === typeof context.isMounted &&\n        !context.isMounted()\n      )\n        return;\n      return callback.apply(context, arguments);\n    }\n  };\n}\nfunction getComponentName(fiber) {\n  fiber = fiber.type;\n  return \"string\" === typeof fiber\n    ? fiber\n    : \"function\" === typeof fiber ? fiber.displayName || fiber.name : null;\n}\nvar debugRenderPhaseSideEffects = require(\"ReactFeatureFlags\")\n  .debugRenderPhaseSideEffects;\nfunction isFiberMountedImpl(fiber) {\n  var node = fiber;\n  if (fiber.alternate) for (; node[\"return\"]; ) node = node[\"return\"];\n  else {\n    if (0 !== (node.effectTag & 2)) return 1;\n    for (; node[\"return\"]; )\n      if (((node = node[\"return\"]), 0 !== (node.effectTag & 2))) return 1;\n  }\n  return 3 === node.tag ? 2 : 3;\n}\nfunction isMounted(component) {\n  return (component = component._reactInternalFiber)\n    ? 2 === isFiberMountedImpl(component)\n    : !1;\n}\nfunction assertIsMounted(fiber) {\n  invariant(\n    2 === isFiberMountedImpl(fiber),\n    \"Unable to find node on an unmounted component.\"\n  );\n}\nfunction findCurrentFiberUsingSlowPath(fiber) {\n  var alternate = fiber.alternate;\n  if (!alternate)\n    return (\n      (alternate = isFiberMountedImpl(fiber)),\n      invariant(\n        3 !== alternate,\n        \"Unable to find node on an unmounted component.\"\n      ),\n      1 === alternate ? null : fiber\n    );\n  for (var a = fiber, b = alternate; ; ) {\n    var parentA = a[\"return\"],\n      parentB = parentA ? parentA.alternate : null;\n    if (!parentA || !parentB) break;\n    if (parentA.child === parentB.child) {\n      for (var child = parentA.child; child; ) {\n        if (child === a) return assertIsMounted(parentA), fiber;\n        if (child === b) return assertIsMounted(parentA), alternate;\n        child = child.sibling;\n      }\n      invariant(!1, \"Unable to find node on an unmounted component.\");\n    }\n    if (a[\"return\"] !== b[\"return\"]) (a = parentA), (b = parentB);\n    else {\n      child = !1;\n      for (var _child = parentA.child; _child; ) {\n        if (_child === a) {\n          child = !0;\n          a = parentA;\n          b = parentB;\n          break;\n        }\n        if (_child === b) {\n          child = !0;\n          b = parentA;\n          a = parentB;\n          break;\n        }\n        _child = _child.sibling;\n      }\n      if (!child) {\n        for (_child = parentB.child; _child; ) {\n          if (_child === a) {\n            child = !0;\n            a = parentB;\n            b = parentA;\n            break;\n          }\n          if (_child === b) {\n            child = !0;\n            b = parentB;\n            a = parentA;\n            break;\n          }\n          _child = _child.sibling;\n        }\n        invariant(\n          child,\n          \"Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.\"\n        );\n      }\n    }\n    invariant(\n      a.alternate === b,\n      \"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.\"\n    );\n  }\n  invariant(3 === a.tag, \"Unable to find node on an unmounted component.\");\n  return a.stateNode.current === a ? fiber : alternate;\n}\nfunction findCurrentHostFiber(parent) {\n  parent = findCurrentFiberUsingSlowPath(parent);\n  if (!parent) return null;\n  for (var node = parent; ; ) {\n    if (5 === node.tag || 6 === node.tag) return node;\n    if (node.child) (node.child[\"return\"] = node), (node = node.child);\n    else {\n      if (node === parent) break;\n      for (; !node.sibling; ) {\n        if (!node[\"return\"] || node[\"return\"] === parent) return null;\n        node = node[\"return\"];\n      }\n      node.sibling[\"return\"] = node[\"return\"];\n      node = node.sibling;\n    }\n  }\n  return null;\n}\nfunction findCurrentHostFiberWithNoPortals(parent) {\n  parent = findCurrentFiberUsingSlowPath(parent);\n  if (!parent) return null;\n  for (var node = parent; ; ) {\n    if (5 === node.tag || 6 === node.tag) return node;\n    if (node.child && 4 !== node.tag)\n      (node.child[\"return\"] = node), (node = node.child);\n    else {\n      if (node === parent) break;\n      for (; !node.sibling; ) {\n        if (!node[\"return\"] || node[\"return\"] === parent) return null;\n        node = node[\"return\"];\n      }\n      node.sibling[\"return\"] = node[\"return\"];\n      node = node.sibling;\n    }\n  }\n  return null;\n}\nvar valueStack = [],\n  index = -1;\nfunction pop(cursor) {\n  0 > index ||\n    ((cursor.current = valueStack[index]), (valueStack[index] = null), index--);\n}\nfunction push(cursor, value) {\n  index++;\n  valueStack[index] = cursor.current;\n  cursor.current = value;\n}\nnew Set();\nvar contextStackCursor = { current: emptyObject },\n  didPerformWorkStackCursor = { current: !1 },\n  previousContext = emptyObject;\nfunction getUnmaskedContext(workInProgress) {\n  return isContextProvider(workInProgress)\n    ? previousContext\n    : contextStackCursor.current;\n}\nfunction getMaskedContext(workInProgress, unmaskedContext) {\n  var contextTypes = workInProgress.type.contextTypes;\n  if (!contextTypes) return emptyObject;\n  var instance = workInProgress.stateNode;\n  if (\n    instance &&\n    instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext\n  )\n    return instance.__reactInternalMemoizedMaskedChildContext;\n  var context = {},\n    key;\n  for (key in contextTypes) context[key] = unmaskedContext[key];\n  instance &&\n    ((workInProgress = workInProgress.stateNode),\n    (workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext),\n    (workInProgress.__reactInternalMemoizedMaskedChildContext = context));\n  return context;\n}\nfunction isContextProvider(fiber) {\n  return 2 === fiber.tag && null != fiber.type.childContextTypes;\n}\nfunction popContextProvider(fiber) {\n  isContextProvider(fiber) &&\n    (pop(didPerformWorkStackCursor, fiber), pop(contextStackCursor, fiber));\n}\nfunction pushTopLevelContextObject(fiber, context, didChange) {\n  invariant(\n    null == contextStackCursor.cursor,\n    \"Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.\"\n  );\n  push(contextStackCursor, context, fiber);\n  push(didPerformWorkStackCursor, didChange, fiber);\n}\nfunction processChildContext(fiber, parentContext) {\n  var instance = fiber.stateNode,\n    childContextTypes = fiber.type.childContextTypes;\n  if (\"function\" !== typeof instance.getChildContext) return parentContext;\n  instance = instance.getChildContext();\n  for (var contextKey in instance)\n    invariant(\n      contextKey in childContextTypes,\n      '%s.getChildContext(): key \"%s\" is not defined in childContextTypes.',\n      getComponentName(fiber) || \"Unknown\",\n      contextKey\n    );\n  return Object.assign({}, parentContext, instance);\n}\nfunction pushContextProvider(workInProgress) {\n  if (!isContextProvider(workInProgress)) return !1;\n  var instance = workInProgress.stateNode;\n  instance =\n    (instance && instance.__reactInternalMemoizedMergedChildContext) ||\n    emptyObject;\n  previousContext = contextStackCursor.current;\n  push(contextStackCursor, instance, workInProgress);\n  push(\n    didPerformWorkStackCursor,\n    didPerformWorkStackCursor.current,\n    workInProgress\n  );\n  return !0;\n}\nfunction invalidateContextProvider(workInProgress, didChange) {\n  var instance = workInProgress.stateNode;\n  invariant(\n    instance,\n    \"Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.\"\n  );\n  if (didChange) {\n    var mergedContext = processChildContext(workInProgress, previousContext);\n    instance.__reactInternalMemoizedMergedChildContext = mergedContext;\n    pop(didPerformWorkStackCursor, workInProgress);\n    pop(contextStackCursor, workInProgress);\n    push(contextStackCursor, mergedContext, workInProgress);\n  } else pop(didPerformWorkStackCursor, workInProgress);\n  push(didPerformWorkStackCursor, didChange, workInProgress);\n}\nfunction FiberNode(tag, pendingProps, key, internalContextTag) {\n  this.tag = tag;\n  this.key = key;\n  this.stateNode = this.type = null;\n  this.sibling = this.child = this[\"return\"] = null;\n  this.index = 0;\n  this.ref = null;\n  this.pendingProps = pendingProps;\n  this.memoizedState = this.updateQueue = this.memoizedProps = null;\n  this.internalContextTag = internalContextTag;\n  this.effectTag = 0;\n  this.lastEffect = this.firstEffect = this.nextEffect = null;\n  this.expirationTime = 0;\n  this.alternate = null;\n}\nfunction createFiber(tag, pendingProps, key, internalContextTag) {\n  return new FiberNode(tag, pendingProps, key, internalContextTag);\n}\nfunction createWorkInProgress(current, pendingProps, expirationTime) {\n  var workInProgress = current.alternate;\n  null === workInProgress\n    ? ((workInProgress = createFiber(\n        current.tag,\n        pendingProps,\n        current.key,\n        current.internalContextTag\n      )),\n      (workInProgress.type = current.type),\n      (workInProgress.stateNode = current.stateNode),\n      (workInProgress.alternate = current),\n      (current.alternate = workInProgress))\n    : ((workInProgress.pendingProps = pendingProps),\n      (workInProgress.effectTag = 0),\n      (workInProgress.nextEffect = null),\n      (workInProgress.firstEffect = null),\n      (workInProgress.lastEffect = null));\n  workInProgress.expirationTime = expirationTime;\n  workInProgress.child = current.child;\n  workInProgress.memoizedProps = current.memoizedProps;\n  workInProgress.memoizedState = current.memoizedState;\n  workInProgress.updateQueue = current.updateQueue;\n  workInProgress.sibling = current.sibling;\n  workInProgress.index = current.index;\n  workInProgress.ref = current.ref;\n  return workInProgress;\n}\nfunction createFiberFromElement(element, internalContextTag, expirationTime) {\n  var fiber = void 0,\n    type = element.type,\n    key = element.key;\n  element = element.props;\n  \"function\" === typeof type\n    ? ((fiber =\n        type.prototype && type.prototype.isReactComponent\n          ? createFiber(2, element, key, internalContextTag)\n          : createFiber(0, element, key, internalContextTag)),\n      (fiber.type = type))\n    : \"string\" === typeof type\n      ? ((fiber = createFiber(5, element, key, internalContextTag)),\n        (fiber.type = type))\n      : \"object\" === typeof type &&\n        null !== type &&\n        \"number\" === typeof type.tag\n        ? ((fiber = type), (fiber.pendingProps = element))\n        : invariant(\n            !1,\n            \"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",\n            null == type ? type : typeof type,\n            \"\"\n          );\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\nfunction createFiberFromFragment(\n  elements,\n  internalContextTag,\n  expirationTime,\n  key\n) {\n  elements = createFiber(10, elements, key, internalContextTag);\n  elements.expirationTime = expirationTime;\n  return elements;\n}\nfunction createFiberFromText(content, internalContextTag, expirationTime) {\n  content = createFiber(6, content, null, internalContextTag);\n  content.expirationTime = expirationTime;\n  return content;\n}\nfunction createFiberFromCall(call, internalContextTag, expirationTime) {\n  internalContextTag = createFiber(7, call, call.key, internalContextTag);\n  internalContextTag.type = call.handler;\n  internalContextTag.expirationTime = expirationTime;\n  return internalContextTag;\n}\nfunction createFiberFromReturn(returnNode, internalContextTag, expirationTime) {\n  returnNode = createFiber(9, null, null, internalContextTag);\n  returnNode.expirationTime = expirationTime;\n  return returnNode;\n}\nfunction createFiberFromPortal(portal, internalContextTag, expirationTime) {\n  internalContextTag = createFiber(\n    4,\n    null !== portal.children ? portal.children : [],\n    portal.key,\n    internalContextTag\n  );\n  internalContextTag.expirationTime = expirationTime;\n  internalContextTag.stateNode = {\n    containerInfo: portal.containerInfo,\n    pendingChildren: null,\n    implementation: portal.implementation\n  };\n  return internalContextTag;\n}\nvar onCommitFiberRoot = null,\n  onCommitFiberUnmount = null;\nfunction catchErrors(fn) {\n  return function(arg) {\n    try {\n      return fn(arg);\n    } catch (err) {}\n  };\n}\nfunction injectInternals(internals) {\n  if (\"undefined\" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1;\n  var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;\n  if (hook.isDisabled || !hook.supportsFiber) return !0;\n  try {\n    var rendererID = hook.inject(internals);\n    onCommitFiberRoot = catchErrors(function(root) {\n      return hook.onCommitFiberRoot(rendererID, root);\n    });\n    onCommitFiberUnmount = catchErrors(function(fiber) {\n      return hook.onCommitFiberUnmount(rendererID, fiber);\n    });\n  } catch (err) {}\n  return !0;\n}\nfunction onCommitRoot(root) {\n  \"function\" === typeof onCommitFiberRoot && onCommitFiberRoot(root);\n}\nfunction onCommitUnmount(fiber) {\n  \"function\" === typeof onCommitFiberUnmount && onCommitFiberUnmount(fiber);\n}\nfunction createUpdateQueue(baseState) {\n  return {\n    baseState: baseState,\n    expirationTime: 0,\n    first: null,\n    last: null,\n    callbackList: null,\n    hasForceUpdate: !1,\n    isInitialized: !1\n  };\n}\nfunction insertUpdateIntoQueue(queue, update) {\n  null === queue.last\n    ? (queue.first = queue.last = update)\n    : ((queue.last.next = update), (queue.last = update));\n  if (\n    0 === queue.expirationTime ||\n    queue.expirationTime > update.expirationTime\n  )\n    queue.expirationTime = update.expirationTime;\n}\nfunction insertUpdateIntoFiber(fiber, update) {\n  var alternateFiber = fiber.alternate,\n    queue1 = fiber.updateQueue;\n  null === queue1 && (queue1 = fiber.updateQueue = createUpdateQueue(null));\n  null !== alternateFiber\n    ? ((fiber = alternateFiber.updateQueue),\n      null === fiber &&\n        (fiber = alternateFiber.updateQueue = createUpdateQueue(null)))\n    : (fiber = null);\n  fiber = fiber !== queue1 ? fiber : null;\n  null === fiber\n    ? insertUpdateIntoQueue(queue1, update)\n    : null === queue1.last || null === fiber.last\n      ? (insertUpdateIntoQueue(queue1, update),\n        insertUpdateIntoQueue(fiber, update))\n      : (insertUpdateIntoQueue(queue1, update), (fiber.last = update));\n}\nfunction getStateFromUpdate(update, instance, prevState, props) {\n  update = update.partialState;\n  return \"function\" === typeof update\n    ? (debugRenderPhaseSideEffects && update.call(instance, prevState, props),\n      update.call(instance, prevState, props))\n    : update;\n}\nfunction processUpdateQueue(\n  current,\n  workInProgress,\n  queue,\n  instance,\n  props,\n  renderExpirationTime\n) {\n  null !== current &&\n    current.updateQueue === queue &&\n    (queue = workInProgress.updateQueue = {\n      baseState: queue.baseState,\n      expirationTime: queue.expirationTime,\n      first: queue.first,\n      last: queue.last,\n      isInitialized: queue.isInitialized,\n      callbackList: null,\n      hasForceUpdate: !1\n    });\n  queue.expirationTime = 0;\n  queue.isInitialized\n    ? (current = queue.baseState)\n    : ((current = queue.baseState = workInProgress.memoizedState),\n      (queue.isInitialized = !0));\n  for (\n    var dontMutatePrevState = !0, update = queue.first, didSkip = !1;\n    null !== update;\n\n  ) {\n    var updateExpirationTime = update.expirationTime;\n    if (updateExpirationTime > renderExpirationTime) {\n      var remainingExpirationTime = queue.expirationTime;\n      if (\n        0 === remainingExpirationTime ||\n        remainingExpirationTime > updateExpirationTime\n      )\n        queue.expirationTime = updateExpirationTime;\n      didSkip || ((didSkip = !0), (queue.baseState = current));\n    } else {\n      didSkip ||\n        ((queue.first = update.next),\n        null === queue.first && (queue.last = null));\n      if (update.isReplace)\n        (current = getStateFromUpdate(update, instance, current, props)),\n          (dontMutatePrevState = !0);\n      else if (\n        (updateExpirationTime = getStateFromUpdate(\n          update,\n          instance,\n          current,\n          props\n        ))\n      )\n        (current = dontMutatePrevState\n          ? Object.assign({}, current, updateExpirationTime)\n          : Object.assign(current, updateExpirationTime)),\n          (dontMutatePrevState = !1);\n      update.isForced && (queue.hasForceUpdate = !0);\n      null !== update.callback &&\n        ((updateExpirationTime = queue.callbackList),\n        null === updateExpirationTime &&\n          (updateExpirationTime = queue.callbackList = []),\n        updateExpirationTime.push(update));\n    }\n    update = update.next;\n  }\n  null !== queue.callbackList\n    ? (workInProgress.effectTag |= 32)\n    : null !== queue.first ||\n      queue.hasForceUpdate ||\n      (workInProgress.updateQueue = null);\n  didSkip || (queue.baseState = current);\n  return current;\n}\nfunction commitCallbacks(queue, context) {\n  var callbackList = queue.callbackList;\n  if (null !== callbackList)\n    for (\n      queue.callbackList = null, queue = 0;\n      queue < callbackList.length;\n      queue++\n    ) {\n      var update = callbackList[queue],\n        _callback = update.callback;\n      update.callback = null;\n      invariant(\n        \"function\" === typeof _callback,\n        \"Invalid argument passed as callback. Expected a function. Instead received: %s\",\n        _callback\n      );\n      _callback.call(context);\n    }\n}\nfunction ReactFiberClassComponent(\n  scheduleWork,\n  computeExpirationForFiber,\n  memoizeProps,\n  memoizeState\n) {\n  function adoptClassInstance(workInProgress, instance) {\n    instance.updater = updater;\n    workInProgress.stateNode = instance;\n    instance._reactInternalFiber = workInProgress;\n  }\n  var updater = {\n    isMounted: isMounted,\n    enqueueSetState: function(instance, partialState, callback) {\n      instance = instance._reactInternalFiber;\n      callback = void 0 === callback ? null : callback;\n      var expirationTime = computeExpirationForFiber(instance);\n      insertUpdateIntoFiber(instance, {\n        expirationTime: expirationTime,\n        partialState: partialState,\n        callback: callback,\n        isReplace: !1,\n        isForced: !1,\n        nextCallback: null,\n        next: null\n      });\n      scheduleWork(instance, expirationTime);\n    },\n    enqueueReplaceState: function(instance, state, callback) {\n      instance = instance._reactInternalFiber;\n      callback = void 0 === callback ? null : callback;\n      var expirationTime = computeExpirationForFiber(instance);\n      insertUpdateIntoFiber(instance, {\n        expirationTime: expirationTime,\n        partialState: state,\n        callback: callback,\n        isReplace: !0,\n        isForced: !1,\n        nextCallback: null,\n        next: null\n      });\n      scheduleWork(instance, expirationTime);\n    },\n    enqueueForceUpdate: function(instance, callback) {\n      instance = instance._reactInternalFiber;\n      callback = void 0 === callback ? null : callback;\n      var expirationTime = computeExpirationForFiber(instance);\n      insertUpdateIntoFiber(instance, {\n        expirationTime: expirationTime,\n        partialState: null,\n        callback: callback,\n        isReplace: !1,\n        isForced: !0,\n        nextCallback: null,\n        next: null\n      });\n      scheduleWork(instance, expirationTime);\n    }\n  };\n  return {\n    adoptClassInstance: adoptClassInstance,\n    constructClassInstance: function(workInProgress, props) {\n      var ctor = workInProgress.type,\n        unmaskedContext = getUnmaskedContext(workInProgress),\n        needsContext =\n          2 === workInProgress.tag && null != workInProgress.type.contextTypes,\n        context = needsContext\n          ? getMaskedContext(workInProgress, unmaskedContext)\n          : emptyObject;\n      props = new ctor(props, context);\n      adoptClassInstance(workInProgress, props);\n      needsContext &&\n        ((workInProgress = workInProgress.stateNode),\n        (workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext),\n        (workInProgress.__reactInternalMemoizedMaskedChildContext = context));\n      return props;\n    },\n    mountClassInstance: function(workInProgress, renderExpirationTime) {\n      var current = workInProgress.alternate,\n        instance = workInProgress.stateNode,\n        state = instance.state || null,\n        props = workInProgress.pendingProps,\n        unmaskedContext = getUnmaskedContext(workInProgress);\n      instance.props = props;\n      instance.state = workInProgress.memoizedState = state;\n      instance.refs = emptyObject;\n      instance.context = getMaskedContext(workInProgress, unmaskedContext);\n      null != workInProgress.type &&\n        null != workInProgress.type.prototype &&\n        !0 === workInProgress.type.prototype.unstable_isAsyncReactComponent &&\n        (workInProgress.internalContextTag |= 1);\n      \"function\" === typeof instance.componentWillMount &&\n        ((state = instance.state),\n        instance.componentWillMount(),\n        debugRenderPhaseSideEffects && instance.componentWillMount(),\n        state !== instance.state &&\n          updater.enqueueReplaceState(instance, instance.state, null),\n        (state = workInProgress.updateQueue),\n        null !== state &&\n          (instance.state = processUpdateQueue(\n            current,\n            workInProgress,\n            state,\n            instance,\n            props,\n            renderExpirationTime\n          )));\n      \"function\" === typeof instance.componentDidMount &&\n        (workInProgress.effectTag |= 4);\n    },\n    updateClassInstance: function(\n      current,\n      workInProgress,\n      renderExpirationTime\n    ) {\n      var instance = workInProgress.stateNode;\n      instance.props = workInProgress.memoizedProps;\n      instance.state = workInProgress.memoizedState;\n      var oldProps = workInProgress.memoizedProps,\n        newProps = workInProgress.pendingProps,\n        oldContext = instance.context,\n        newUnmaskedContext = getUnmaskedContext(workInProgress);\n      newUnmaskedContext = getMaskedContext(workInProgress, newUnmaskedContext);\n      \"function\" !== typeof instance.componentWillReceiveProps ||\n        (oldProps === newProps && oldContext === newUnmaskedContext) ||\n        ((oldContext = instance.state),\n        instance.componentWillReceiveProps(newProps, newUnmaskedContext),\n        debugRenderPhaseSideEffects &&\n          instance.componentWillReceiveProps(newProps, newUnmaskedContext),\n        instance.state !== oldContext &&\n          updater.enqueueReplaceState(instance, instance.state, null));\n      oldContext = workInProgress.memoizedState;\n      renderExpirationTime =\n        null !== workInProgress.updateQueue\n          ? processUpdateQueue(\n              current,\n              workInProgress,\n              workInProgress.updateQueue,\n              instance,\n              newProps,\n              renderExpirationTime\n            )\n          : oldContext;\n      if (\n        !(\n          oldProps !== newProps ||\n          oldContext !== renderExpirationTime ||\n          didPerformWorkStackCursor.current ||\n          (null !== workInProgress.updateQueue &&\n            workInProgress.updateQueue.hasForceUpdate)\n        )\n      )\n        return (\n          \"function\" !== typeof instance.componentDidUpdate ||\n            (oldProps === current.memoizedProps &&\n              oldContext === current.memoizedState) ||\n            (workInProgress.effectTag |= 4),\n          !1\n        );\n      if (\n        null === oldProps ||\n        (null !== workInProgress.updateQueue &&\n          workInProgress.updateQueue.hasForceUpdate)\n      )\n        var shouldUpdate = !0;\n      else {\n        shouldUpdate = workInProgress.stateNode;\n        var type = workInProgress.type;\n        \"function\" === typeof shouldUpdate.shouldComponentUpdate\n          ? ((type = shouldUpdate.shouldComponentUpdate(\n              newProps,\n              renderExpirationTime,\n              newUnmaskedContext\n            )),\n            debugRenderPhaseSideEffects &&\n              shouldUpdate.shouldComponentUpdate(\n                newProps,\n                renderExpirationTime,\n                newUnmaskedContext\n              ),\n            (shouldUpdate = type))\n          : (shouldUpdate =\n              type.prototype && type.prototype.isPureReactComponent\n                ? !shallowEqual(oldProps, newProps) ||\n                  !shallowEqual(oldContext, renderExpirationTime)\n                : !0);\n      }\n      shouldUpdate\n        ? (\"function\" === typeof instance.componentWillUpdate &&\n            (instance.componentWillUpdate(\n              newProps,\n              renderExpirationTime,\n              newUnmaskedContext\n            ),\n            debugRenderPhaseSideEffects &&\n              instance.componentWillUpdate(\n                newProps,\n                renderExpirationTime,\n                newUnmaskedContext\n              )),\n          \"function\" === typeof instance.componentDidUpdate &&\n            (workInProgress.effectTag |= 4))\n        : (\"function\" !== typeof instance.componentDidUpdate ||\n            (oldProps === current.memoizedProps &&\n              oldContext === current.memoizedState) ||\n            (workInProgress.effectTag |= 4),\n          memoizeProps(workInProgress, newProps),\n          memoizeState(workInProgress, renderExpirationTime));\n      instance.props = newProps;\n      instance.state = renderExpirationTime;\n      instance.context = newUnmaskedContext;\n      return shouldUpdate;\n    }\n  };\n}\nvar isArray$1 = Array.isArray;\nfunction coerceRef(current, element) {\n  var mixedRef = element.ref;\n  if (null !== mixedRef && \"function\" !== typeof mixedRef) {\n    if (element._owner) {\n      element = element._owner;\n      var inst = void 0;\n      element &&\n        (invariant(\n          2 === element.tag,\n          \"Stateless function components cannot have refs.\"\n        ),\n        (inst = element.stateNode));\n      invariant(\n        inst,\n        \"Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.\",\n        mixedRef\n      );\n      var stringRef = \"\" + mixedRef;\n      if (\n        null !== current &&\n        null !== current.ref &&\n        current.ref._stringRef === stringRef\n      )\n        return current.ref;\n      current = function(value) {\n        var refs = inst.refs === emptyObject ? (inst.refs = {}) : inst.refs;\n        null === value ? delete refs[stringRef] : (refs[stringRef] = value);\n      };\n      current._stringRef = stringRef;\n      return current;\n    }\n    invariant(\n      \"string\" === typeof mixedRef,\n      \"Expected ref to be a function or a string.\"\n    );\n    invariant(\n      element._owner,\n      \"Element ref was specified as a string (%s) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).\",\n      mixedRef\n    );\n  }\n  return mixedRef;\n}\nfunction throwOnInvalidObjectType(returnFiber, newChild) {\n  \"textarea\" !== returnFiber.type &&\n    invariant(\n      !1,\n      \"Objects are not valid as a React child (found: %s).%s\",\n      \"[object Object]\" === Object.prototype.toString.call(newChild)\n        ? \"object with keys {\" + Object.keys(newChild).join(\", \") + \"}\"\n        : newChild,\n      \"\"\n    );\n}\nfunction ChildReconciler(shouldTrackSideEffects) {\n  function deleteChild(returnFiber, childToDelete) {\n    if (shouldTrackSideEffects) {\n      var last = returnFiber.lastEffect;\n      null !== last\n        ? ((last.nextEffect = childToDelete),\n          (returnFiber.lastEffect = childToDelete))\n        : (returnFiber.firstEffect = returnFiber.lastEffect = childToDelete);\n      childToDelete.nextEffect = null;\n      childToDelete.effectTag = 8;\n    }\n  }\n  function deleteRemainingChildren(returnFiber, currentFirstChild) {\n    if (!shouldTrackSideEffects) return null;\n    for (; null !== currentFirstChild; )\n      deleteChild(returnFiber, currentFirstChild),\n        (currentFirstChild = currentFirstChild.sibling);\n    return null;\n  }\n  function mapRemainingChildren(returnFiber, currentFirstChild) {\n    for (returnFiber = new Map(); null !== currentFirstChild; )\n      null !== currentFirstChild.key\n        ? returnFiber.set(currentFirstChild.key, currentFirstChild)\n        : returnFiber.set(currentFirstChild.index, currentFirstChild),\n        (currentFirstChild = currentFirstChild.sibling);\n    return returnFiber;\n  }\n  function useFiber(fiber, pendingProps, expirationTime) {\n    fiber = createWorkInProgress(fiber, pendingProps, expirationTime);\n    fiber.index = 0;\n    fiber.sibling = null;\n    return fiber;\n  }\n  function placeChild(newFiber, lastPlacedIndex, newIndex) {\n    newFiber.index = newIndex;\n    if (!shouldTrackSideEffects) return lastPlacedIndex;\n    newIndex = newFiber.alternate;\n    if (null !== newIndex)\n      return (\n        (newIndex = newIndex.index),\n        newIndex < lastPlacedIndex\n          ? ((newFiber.effectTag = 2), lastPlacedIndex)\n          : newIndex\n      );\n    newFiber.effectTag = 2;\n    return lastPlacedIndex;\n  }\n  function placeSingleChild(newFiber) {\n    shouldTrackSideEffects &&\n      null === newFiber.alternate &&\n      (newFiber.effectTag = 2);\n    return newFiber;\n  }\n  function updateTextNode(returnFiber, current, textContent, expirationTime) {\n    if (null === current || 6 !== current.tag)\n      return (\n        (current = createFiberFromText(\n          textContent,\n          returnFiber.internalContextTag,\n          expirationTime\n        )),\n        (current[\"return\"] = returnFiber),\n        current\n      );\n    current = useFiber(current, textContent, expirationTime);\n    current[\"return\"] = returnFiber;\n    return current;\n  }\n  function updateElement(returnFiber, current, element, expirationTime) {\n    if (null !== current && current.type === element.type)\n      return (\n        (expirationTime = useFiber(current, element.props, expirationTime)),\n        (expirationTime.ref = coerceRef(current, element)),\n        (expirationTime[\"return\"] = returnFiber),\n        expirationTime\n      );\n    expirationTime = createFiberFromElement(\n      element,\n      returnFiber.internalContextTag,\n      expirationTime\n    );\n    expirationTime.ref = coerceRef(current, element);\n    expirationTime[\"return\"] = returnFiber;\n    return expirationTime;\n  }\n  function updateCall(returnFiber, current, call, expirationTime) {\n    if (null === current || 7 !== current.tag)\n      return (\n        (current = createFiberFromCall(\n          call,\n          returnFiber.internalContextTag,\n          expirationTime\n        )),\n        (current[\"return\"] = returnFiber),\n        current\n      );\n    current = useFiber(current, call, expirationTime);\n    current[\"return\"] = returnFiber;\n    return current;\n  }\n  function updateReturn(returnFiber, current, returnNode, expirationTime) {\n    if (null === current || 9 !== current.tag)\n      return (\n        (current = createFiberFromReturn(\n          returnNode,\n          returnFiber.internalContextTag,\n          expirationTime\n        )),\n        (current.type = returnNode.value),\n        (current[\"return\"] = returnFiber),\n        current\n      );\n    current = useFiber(current, null, expirationTime);\n    current.type = returnNode.value;\n    current[\"return\"] = returnFiber;\n    return current;\n  }\n  function updatePortal(returnFiber, current, portal, expirationTime) {\n    if (\n      null === current ||\n      4 !== current.tag ||\n      current.stateNode.containerInfo !== portal.containerInfo ||\n      current.stateNode.implementation !== portal.implementation\n    )\n      return (\n        (current = createFiberFromPortal(\n          portal,\n          returnFiber.internalContextTag,\n          expirationTime\n        )),\n        (current[\"return\"] = returnFiber),\n        current\n      );\n    current = useFiber(current, portal.children || [], expirationTime);\n    current[\"return\"] = returnFiber;\n    return current;\n  }\n  function updateFragment(returnFiber, current, fragment, expirationTime, key) {\n    if (null === current || 10 !== current.tag)\n      return (\n        (current = createFiberFromFragment(\n          fragment,\n          returnFiber.internalContextTag,\n          expirationTime,\n          key\n        )),\n        (current[\"return\"] = returnFiber),\n        current\n      );\n    current = useFiber(current, fragment, expirationTime);\n    current[\"return\"] = returnFiber;\n    return current;\n  }\n  function createChild(returnFiber, newChild, expirationTime) {\n    if (\"string\" === typeof newChild || \"number\" === typeof newChild)\n      return (\n        (newChild = createFiberFromText(\n          \"\" + newChild,\n          returnFiber.internalContextTag,\n          expirationTime\n        )),\n        (newChild[\"return\"] = returnFiber),\n        newChild\n      );\n    if (\"object\" === typeof newChild && null !== newChild) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          if (newChild.type === REACT_FRAGMENT_TYPE)\n            return (\n              (newChild = createFiberFromFragment(\n                newChild.props.children,\n                returnFiber.internalContextTag,\n                expirationTime,\n                newChild.key\n              )),\n              (newChild[\"return\"] = returnFiber),\n              newChild\n            );\n          expirationTime = createFiberFromElement(\n            newChild,\n            returnFiber.internalContextTag,\n            expirationTime\n          );\n          expirationTime.ref = coerceRef(null, newChild);\n          expirationTime[\"return\"] = returnFiber;\n          return expirationTime;\n        case REACT_CALL_TYPE:\n          return (\n            (newChild = createFiberFromCall(\n              newChild,\n              returnFiber.internalContextTag,\n              expirationTime\n            )),\n            (newChild[\"return\"] = returnFiber),\n            newChild\n          );\n        case REACT_RETURN_TYPE:\n          return (\n            (expirationTime = createFiberFromReturn(\n              newChild,\n              returnFiber.internalContextTag,\n              expirationTime\n            )),\n            (expirationTime.type = newChild.value),\n            (expirationTime[\"return\"] = returnFiber),\n            expirationTime\n          );\n        case REACT_PORTAL_TYPE:\n          return (\n            (newChild = createFiberFromPortal(\n              newChild,\n              returnFiber.internalContextTag,\n              expirationTime\n            )),\n            (newChild[\"return\"] = returnFiber),\n            newChild\n          );\n      }\n      if (isArray$1(newChild) || getIteratorFn(newChild))\n        return (\n          (newChild = createFiberFromFragment(\n            newChild,\n            returnFiber.internalContextTag,\n            expirationTime,\n            null\n          )),\n          (newChild[\"return\"] = returnFiber),\n          newChild\n        );\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n    return null;\n  }\n  function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {\n    var key = null !== oldFiber ? oldFiber.key : null;\n    if (\"string\" === typeof newChild || \"number\" === typeof newChild)\n      return null !== key\n        ? null\n        : updateTextNode(returnFiber, oldFiber, \"\" + newChild, expirationTime);\n    if (\"object\" === typeof newChild && null !== newChild) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          return newChild.key === key\n            ? newChild.type === REACT_FRAGMENT_TYPE\n              ? updateFragment(\n                  returnFiber,\n                  oldFiber,\n                  newChild.props.children,\n                  expirationTime,\n                  key\n                )\n              : updateElement(returnFiber, oldFiber, newChild, expirationTime)\n            : null;\n        case REACT_CALL_TYPE:\n          return newChild.key === key\n            ? updateCall(returnFiber, oldFiber, newChild, expirationTime)\n            : null;\n        case REACT_RETURN_TYPE:\n          return null === key\n            ? updateReturn(returnFiber, oldFiber, newChild, expirationTime)\n            : null;\n        case REACT_PORTAL_TYPE:\n          return newChild.key === key\n            ? updatePortal(returnFiber, oldFiber, newChild, expirationTime)\n            : null;\n      }\n      if (isArray$1(newChild) || getIteratorFn(newChild))\n        return null !== key\n          ? null\n          : updateFragment(\n              returnFiber,\n              oldFiber,\n              newChild,\n              expirationTime,\n              null\n            );\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n    return null;\n  }\n  function updateFromMap(\n    existingChildren,\n    returnFiber,\n    newIdx,\n    newChild,\n    expirationTime\n  ) {\n    if (\"string\" === typeof newChild || \"number\" === typeof newChild)\n      return (\n        (existingChildren = existingChildren.get(newIdx) || null),\n        updateTextNode(\n          returnFiber,\n          existingChildren,\n          \"\" + newChild,\n          expirationTime\n        )\n      );\n    if (\"object\" === typeof newChild && null !== newChild) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          return (\n            (existingChildren =\n              existingChildren.get(\n                null === newChild.key ? newIdx : newChild.key\n              ) || null),\n            newChild.type === REACT_FRAGMENT_TYPE\n              ? updateFragment(\n                  returnFiber,\n                  existingChildren,\n                  newChild.props.children,\n                  expirationTime,\n                  newChild.key\n                )\n              : updateElement(\n                  returnFiber,\n                  existingChildren,\n                  newChild,\n                  expirationTime\n                )\n          );\n        case REACT_CALL_TYPE:\n          return (\n            (existingChildren =\n              existingChildren.get(\n                null === newChild.key ? newIdx : newChild.key\n              ) || null),\n            updateCall(returnFiber, existingChildren, newChild, expirationTime)\n          );\n        case REACT_RETURN_TYPE:\n          return (\n            (existingChildren = existingChildren.get(newIdx) || null),\n            updateReturn(\n              returnFiber,\n              existingChildren,\n              newChild,\n              expirationTime\n            )\n          );\n        case REACT_PORTAL_TYPE:\n          return (\n            (existingChildren =\n              existingChildren.get(\n                null === newChild.key ? newIdx : newChild.key\n              ) || null),\n            updatePortal(\n              returnFiber,\n              existingChildren,\n              newChild,\n              expirationTime\n            )\n          );\n      }\n      if (isArray$1(newChild) || getIteratorFn(newChild))\n        return (\n          (existingChildren = existingChildren.get(newIdx) || null),\n          updateFragment(\n            returnFiber,\n            existingChildren,\n            newChild,\n            expirationTime,\n            null\n          )\n        );\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n    return null;\n  }\n  function reconcileChildrenArray(\n    returnFiber,\n    currentFirstChild,\n    newChildren,\n    expirationTime\n  ) {\n    for (\n      var resultingFirstChild = null,\n        previousNewFiber = null,\n        oldFiber = currentFirstChild,\n        newIdx = (currentFirstChild = 0),\n        nextOldFiber = null;\n      null !== oldFiber && newIdx < newChildren.length;\n      newIdx++\n    ) {\n      oldFiber.index > newIdx\n        ? ((nextOldFiber = oldFiber), (oldFiber = null))\n        : (nextOldFiber = oldFiber.sibling);\n      var newFiber = updateSlot(\n        returnFiber,\n        oldFiber,\n        newChildren[newIdx],\n        expirationTime\n      );\n      if (null === newFiber) {\n        null === oldFiber && (oldFiber = nextOldFiber);\n        break;\n      }\n      shouldTrackSideEffects &&\n        oldFiber &&\n        null === newFiber.alternate &&\n        deleteChild(returnFiber, oldFiber);\n      currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);\n      null === previousNewFiber\n        ? (resultingFirstChild = newFiber)\n        : (previousNewFiber.sibling = newFiber);\n      previousNewFiber = newFiber;\n      oldFiber = nextOldFiber;\n    }\n    if (newIdx === newChildren.length)\n      return (\n        deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild\n      );\n    if (null === oldFiber) {\n      for (; newIdx < newChildren.length; newIdx++)\n        if (\n          (oldFiber = createChild(\n            returnFiber,\n            newChildren[newIdx],\n            expirationTime\n          ))\n        )\n          (currentFirstChild = placeChild(oldFiber, currentFirstChild, newIdx)),\n            null === previousNewFiber\n              ? (resultingFirstChild = oldFiber)\n              : (previousNewFiber.sibling = oldFiber),\n            (previousNewFiber = oldFiber);\n      return resultingFirstChild;\n    }\n    for (\n      oldFiber = mapRemainingChildren(returnFiber, oldFiber);\n      newIdx < newChildren.length;\n      newIdx++\n    )\n      if (\n        (nextOldFiber = updateFromMap(\n          oldFiber,\n          returnFiber,\n          newIdx,\n          newChildren[newIdx],\n          expirationTime\n        ))\n      ) {\n        if (shouldTrackSideEffects && null !== nextOldFiber.alternate)\n          oldFiber[\"delete\"](\n            null === nextOldFiber.key ? newIdx : nextOldFiber.key\n          );\n        currentFirstChild = placeChild(nextOldFiber, currentFirstChild, newIdx);\n        null === previousNewFiber\n          ? (resultingFirstChild = nextOldFiber)\n          : (previousNewFiber.sibling = nextOldFiber);\n        previousNewFiber = nextOldFiber;\n      }\n    shouldTrackSideEffects &&\n      oldFiber.forEach(function(child) {\n        return deleteChild(returnFiber, child);\n      });\n    return resultingFirstChild;\n  }\n  function reconcileChildrenIterator(\n    returnFiber,\n    currentFirstChild,\n    newChildrenIterable,\n    expirationTime\n  ) {\n    var iteratorFn = getIteratorFn(newChildrenIterable);\n    invariant(\n      \"function\" === typeof iteratorFn,\n      \"An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.\"\n    );\n    newChildrenIterable = iteratorFn.call(newChildrenIterable);\n    invariant(\n      null != newChildrenIterable,\n      \"An iterable object provided no iterator.\"\n    );\n    for (\n      var previousNewFiber = (iteratorFn = null),\n        oldFiber = currentFirstChild,\n        newIdx = (currentFirstChild = 0),\n        nextOldFiber = null,\n        step = newChildrenIterable.next();\n      null !== oldFiber && !step.done;\n      newIdx++, step = newChildrenIterable.next()\n    ) {\n      oldFiber.index > newIdx\n        ? ((nextOldFiber = oldFiber), (oldFiber = null))\n        : (nextOldFiber = oldFiber.sibling);\n      var newFiber = updateSlot(\n        returnFiber,\n        oldFiber,\n        step.value,\n        expirationTime\n      );\n      if (null === newFiber) {\n        oldFiber || (oldFiber = nextOldFiber);\n        break;\n      }\n      shouldTrackSideEffects &&\n        oldFiber &&\n        null === newFiber.alternate &&\n        deleteChild(returnFiber, oldFiber);\n      currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);\n      null === previousNewFiber\n        ? (iteratorFn = newFiber)\n        : (previousNewFiber.sibling = newFiber);\n      previousNewFiber = newFiber;\n      oldFiber = nextOldFiber;\n    }\n    if (step.done)\n      return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn;\n    if (null === oldFiber) {\n      for (; !step.done; newIdx++, step = newChildrenIterable.next())\n        (step = createChild(returnFiber, step.value, expirationTime)),\n          null !== step &&\n            ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),\n            null === previousNewFiber\n              ? (iteratorFn = step)\n              : (previousNewFiber.sibling = step),\n            (previousNewFiber = step));\n      return iteratorFn;\n    }\n    for (\n      oldFiber = mapRemainingChildren(returnFiber, oldFiber);\n      !step.done;\n      newIdx++, step = newChildrenIterable.next()\n    )\n      if (\n        ((step = updateFromMap(\n          oldFiber,\n          returnFiber,\n          newIdx,\n          step.value,\n          expirationTime\n        )),\n        null !== step)\n      ) {\n        if (shouldTrackSideEffects && null !== step.alternate)\n          oldFiber[\"delete\"](null === step.key ? newIdx : step.key);\n        currentFirstChild = placeChild(step, currentFirstChild, newIdx);\n        null === previousNewFiber\n          ? (iteratorFn = step)\n          : (previousNewFiber.sibling = step);\n        previousNewFiber = step;\n      }\n    shouldTrackSideEffects &&\n      oldFiber.forEach(function(child) {\n        return deleteChild(returnFiber, child);\n      });\n    return iteratorFn;\n  }\n  return function(returnFiber, currentFirstChild, newChild, expirationTime) {\n    \"object\" === typeof newChild &&\n      null !== newChild &&\n      newChild.type === REACT_FRAGMENT_TYPE &&\n      null === newChild.key &&\n      (newChild = newChild.props.children);\n    var isObject = \"object\" === typeof newChild && null !== newChild;\n    if (isObject)\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          a: {\n            var key = newChild.key;\n            for (isObject = currentFirstChild; null !== isObject; ) {\n              if (isObject.key === key)\n                if (\n                  10 === isObject.tag\n                    ? newChild.type === REACT_FRAGMENT_TYPE\n                    : isObject.type === newChild.type\n                ) {\n                  deleteRemainingChildren(returnFiber, isObject.sibling);\n                  currentFirstChild = useFiber(\n                    isObject,\n                    newChild.type === REACT_FRAGMENT_TYPE\n                      ? newChild.props.children\n                      : newChild.props,\n                    expirationTime\n                  );\n                  currentFirstChild.ref = coerceRef(isObject, newChild);\n                  currentFirstChild[\"return\"] = returnFiber;\n                  returnFiber = currentFirstChild;\n                  break a;\n                } else {\n                  deleteRemainingChildren(returnFiber, isObject);\n                  break;\n                }\n              else deleteChild(returnFiber, isObject);\n              isObject = isObject.sibling;\n            }\n            newChild.type === REACT_FRAGMENT_TYPE\n              ? ((currentFirstChild = createFiberFromFragment(\n                  newChild.props.children,\n                  returnFiber.internalContextTag,\n                  expirationTime,\n                  newChild.key\n                )),\n                (currentFirstChild[\"return\"] = returnFiber),\n                (returnFiber = currentFirstChild))\n              : ((expirationTime = createFiberFromElement(\n                  newChild,\n                  returnFiber.internalContextTag,\n                  expirationTime\n                )),\n                (expirationTime.ref = coerceRef(currentFirstChild, newChild)),\n                (expirationTime[\"return\"] = returnFiber),\n                (returnFiber = expirationTime));\n          }\n          return placeSingleChild(returnFiber);\n        case REACT_CALL_TYPE:\n          a: {\n            for (isObject = newChild.key; null !== currentFirstChild; ) {\n              if (currentFirstChild.key === isObject)\n                if (7 === currentFirstChild.tag) {\n                  deleteRemainingChildren(\n                    returnFiber,\n                    currentFirstChild.sibling\n                  );\n                  currentFirstChild = useFiber(\n                    currentFirstChild,\n                    newChild,\n                    expirationTime\n                  );\n                  currentFirstChild[\"return\"] = returnFiber;\n                  returnFiber = currentFirstChild;\n                  break a;\n                } else {\n                  deleteRemainingChildren(returnFiber, currentFirstChild);\n                  break;\n                }\n              else deleteChild(returnFiber, currentFirstChild);\n              currentFirstChild = currentFirstChild.sibling;\n            }\n            currentFirstChild = createFiberFromCall(\n              newChild,\n              returnFiber.internalContextTag,\n              expirationTime\n            );\n            currentFirstChild[\"return\"] = returnFiber;\n            returnFiber = currentFirstChild;\n          }\n          return placeSingleChild(returnFiber);\n        case REACT_RETURN_TYPE:\n          a: {\n            if (null !== currentFirstChild)\n              if (9 === currentFirstChild.tag) {\n                deleteRemainingChildren(returnFiber, currentFirstChild.sibling);\n                currentFirstChild = useFiber(\n                  currentFirstChild,\n                  null,\n                  expirationTime\n                );\n                currentFirstChild.type = newChild.value;\n                currentFirstChild[\"return\"] = returnFiber;\n                returnFiber = currentFirstChild;\n                break a;\n              } else deleteRemainingChildren(returnFiber, currentFirstChild);\n            currentFirstChild = createFiberFromReturn(\n              newChild,\n              returnFiber.internalContextTag,\n              expirationTime\n            );\n            currentFirstChild.type = newChild.value;\n            currentFirstChild[\"return\"] = returnFiber;\n            returnFiber = currentFirstChild;\n          }\n          return placeSingleChild(returnFiber);\n        case REACT_PORTAL_TYPE:\n          a: {\n            for (isObject = newChild.key; null !== currentFirstChild; ) {\n              if (currentFirstChild.key === isObject)\n                if (\n                  4 === currentFirstChild.tag &&\n                  currentFirstChild.stateNode.containerInfo ===\n                    newChild.containerInfo &&\n                  currentFirstChild.stateNode.implementation ===\n                    newChild.implementation\n                ) {\n                  deleteRemainingChildren(\n                    returnFiber,\n                    currentFirstChild.sibling\n                  );\n                  currentFirstChild = useFiber(\n                    currentFirstChild,\n                    newChild.children || [],\n                    expirationTime\n                  );\n                  currentFirstChild[\"return\"] = returnFiber;\n                  returnFiber = currentFirstChild;\n                  break a;\n                } else {\n                  deleteRemainingChildren(returnFiber, currentFirstChild);\n                  break;\n                }\n              else deleteChild(returnFiber, currentFirstChild);\n              currentFirstChild = currentFirstChild.sibling;\n            }\n            currentFirstChild = createFiberFromPortal(\n              newChild,\n              returnFiber.internalContextTag,\n              expirationTime\n            );\n            currentFirstChild[\"return\"] = returnFiber;\n            returnFiber = currentFirstChild;\n          }\n          return placeSingleChild(returnFiber);\n      }\n    if (\"string\" === typeof newChild || \"number\" === typeof newChild)\n      return (\n        (newChild = \"\" + newChild),\n        null !== currentFirstChild && 6 === currentFirstChild.tag\n          ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),\n            (currentFirstChild = useFiber(\n              currentFirstChild,\n              newChild,\n              expirationTime\n            )))\n          : (deleteRemainingChildren(returnFiber, currentFirstChild),\n            (currentFirstChild = createFiberFromText(\n              newChild,\n              returnFiber.internalContextTag,\n              expirationTime\n            ))),\n        (currentFirstChild[\"return\"] = returnFiber),\n        (returnFiber = currentFirstChild),\n        placeSingleChild(returnFiber)\n      );\n    if (isArray$1(newChild))\n      return reconcileChildrenArray(\n        returnFiber,\n        currentFirstChild,\n        newChild,\n        expirationTime\n      );\n    if (getIteratorFn(newChild))\n      return reconcileChildrenIterator(\n        returnFiber,\n        currentFirstChild,\n        newChild,\n        expirationTime\n      );\n    isObject && throwOnInvalidObjectType(returnFiber, newChild);\n    if (\"undefined\" === typeof newChild)\n      switch (returnFiber.tag) {\n        case 2:\n        case 1:\n          (expirationTime = returnFiber.type),\n            invariant(\n              !1,\n              \"%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\",\n              expirationTime.displayName || expirationTime.name || \"Component\"\n            );\n      }\n    return deleteRemainingChildren(returnFiber, currentFirstChild);\n  };\n}\nvar reconcileChildFibers = ChildReconciler(!0),\n  mountChildFibers = ChildReconciler(!1);\nfunction ReactFiberBeginWork(\n  config,\n  hostContext,\n  hydrationContext,\n  scheduleWork,\n  computeExpirationForFiber\n) {\n  function reconcileChildren(current, workInProgress, nextChildren) {\n    var renderExpirationTime = workInProgress.expirationTime;\n    workInProgress.child =\n      null === current\n        ? mountChildFibers(\n            workInProgress,\n            null,\n            nextChildren,\n            renderExpirationTime\n          )\n        : reconcileChildFibers(\n            workInProgress,\n            current.child,\n            nextChildren,\n            renderExpirationTime\n          );\n  }\n  function markRef(current, workInProgress) {\n    var ref = workInProgress.ref;\n    null === ref ||\n      (current && current.ref === ref) ||\n      (workInProgress.effectTag |= 128);\n  }\n  function finishClassComponent(\n    current,\n    workInProgress,\n    shouldUpdate,\n    hasContext\n  ) {\n    markRef(current, workInProgress);\n    if (!shouldUpdate)\n      return (\n        hasContext && invalidateContextProvider(workInProgress, !1),\n        bailoutOnAlreadyFinishedWork(current, workInProgress)\n      );\n    shouldUpdate = workInProgress.stateNode;\n    ReactCurrentOwner.current = workInProgress;\n    debugRenderPhaseSideEffects && shouldUpdate.render();\n    var nextChildren = shouldUpdate.render();\n    workInProgress.effectTag |= 1;\n    reconcileChildren(current, workInProgress, nextChildren);\n    workInProgress.memoizedState = shouldUpdate.state;\n    workInProgress.memoizedProps = shouldUpdate.props;\n    hasContext && invalidateContextProvider(workInProgress, !0);\n    return workInProgress.child;\n  }\n  function pushHostRootContext(workInProgress) {\n    var root = workInProgress.stateNode;\n    root.pendingContext\n      ? pushTopLevelContextObject(\n          workInProgress,\n          root.pendingContext,\n          root.pendingContext !== root.context\n        )\n      : root.context &&\n        pushTopLevelContextObject(workInProgress, root.context, !1);\n    pushHostContainer(workInProgress, root.containerInfo);\n  }\n  function bailoutOnAlreadyFinishedWork(current, workInProgress) {\n    invariant(\n      null === current || workInProgress.child === current.child,\n      \"Resuming work not yet implemented.\"\n    );\n    if (null !== workInProgress.child) {\n      current = workInProgress.child;\n      var newChild = createWorkInProgress(\n        current,\n        current.pendingProps,\n        current.expirationTime\n      );\n      workInProgress.child = newChild;\n      for (newChild[\"return\"] = workInProgress; null !== current.sibling; )\n        (current = current.sibling),\n          (newChild = newChild.sibling = createWorkInProgress(\n            current,\n            current.pendingProps,\n            current.expirationTime\n          )),\n          (newChild[\"return\"] = workInProgress);\n      newChild.sibling = null;\n    }\n    return workInProgress.child;\n  }\n  function bailoutOnLowPriority(current, workInProgress) {\n    switch (workInProgress.tag) {\n      case 3:\n        pushHostRootContext(workInProgress);\n        break;\n      case 2:\n        pushContextProvider(workInProgress);\n        break;\n      case 4:\n        pushHostContainer(\n          workInProgress,\n          workInProgress.stateNode.containerInfo\n        );\n    }\n    return null;\n  }\n  var shouldSetTextContent = config.shouldSetTextContent,\n    useSyncScheduling = config.useSyncScheduling,\n    shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree,\n    pushHostContext = hostContext.pushHostContext,\n    pushHostContainer = hostContext.pushHostContainer,\n    enterHydrationState = hydrationContext.enterHydrationState,\n    resetHydrationState = hydrationContext.resetHydrationState,\n    tryToClaimNextHydratableInstance =\n      hydrationContext.tryToClaimNextHydratableInstance;\n  config = ReactFiberClassComponent(\n    scheduleWork,\n    computeExpirationForFiber,\n    function(workInProgress, nextProps) {\n      workInProgress.memoizedProps = nextProps;\n    },\n    function(workInProgress, nextState) {\n      workInProgress.memoizedState = nextState;\n    }\n  );\n  var adoptClassInstance = config.adoptClassInstance,\n    constructClassInstance = config.constructClassInstance,\n    mountClassInstance = config.mountClassInstance,\n    updateClassInstance = config.updateClassInstance;\n  return {\n    beginWork: function(current, workInProgress, renderExpirationTime) {\n      if (\n        0 === workInProgress.expirationTime ||\n        workInProgress.expirationTime > renderExpirationTime\n      )\n        return bailoutOnLowPriority(current, workInProgress);\n      switch (workInProgress.tag) {\n        case 0:\n          invariant(\n            null === current,\n            \"An indeterminate component should never have mounted. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n          var fn = workInProgress.type,\n            props = workInProgress.pendingProps,\n            unmaskedContext = getUnmaskedContext(workInProgress);\n          unmaskedContext = getMaskedContext(workInProgress, unmaskedContext);\n          fn = fn(props, unmaskedContext);\n          workInProgress.effectTag |= 1;\n          \"object\" === typeof fn &&\n          null !== fn &&\n          \"function\" === typeof fn.render\n            ? ((workInProgress.tag = 2),\n              (props = pushContextProvider(workInProgress)),\n              adoptClassInstance(workInProgress, fn),\n              mountClassInstance(workInProgress, renderExpirationTime),\n              (current = finishClassComponent(\n                current,\n                workInProgress,\n                !0,\n                props\n              )))\n            : ((workInProgress.tag = 1),\n              reconcileChildren(current, workInProgress, fn),\n              (workInProgress.memoizedProps = props),\n              (current = workInProgress.child));\n          return current;\n        case 1:\n          return (\n            (props = workInProgress.type),\n            (renderExpirationTime = workInProgress.pendingProps),\n            didPerformWorkStackCursor.current ||\n            workInProgress.memoizedProps !== renderExpirationTime\n              ? ((fn = getUnmaskedContext(workInProgress)),\n                (fn = getMaskedContext(workInProgress, fn)),\n                (props = props(renderExpirationTime, fn)),\n                (workInProgress.effectTag |= 1),\n                reconcileChildren(current, workInProgress, props),\n                (workInProgress.memoizedProps = renderExpirationTime),\n                (current = workInProgress.child))\n              : (current = bailoutOnAlreadyFinishedWork(\n                  current,\n                  workInProgress\n                )),\n            current\n          );\n        case 2:\n          return (\n            (props = pushContextProvider(workInProgress)),\n            (fn = void 0),\n            null === current\n              ? workInProgress.stateNode\n                ? invariant(!1, \"Resuming work not yet implemented.\")\n                : (constructClassInstance(\n                    workInProgress,\n                    workInProgress.pendingProps\n                  ),\n                  mountClassInstance(workInProgress, renderExpirationTime),\n                  (fn = !0))\n              : (fn = updateClassInstance(\n                  current,\n                  workInProgress,\n                  renderExpirationTime\n                )),\n            finishClassComponent(current, workInProgress, fn, props)\n          );\n        case 3:\n          return (\n            pushHostRootContext(workInProgress),\n            (props = workInProgress.updateQueue),\n            null !== props\n              ? ((fn = workInProgress.memoizedState),\n                (props = processUpdateQueue(\n                  current,\n                  workInProgress,\n                  props,\n                  null,\n                  null,\n                  renderExpirationTime\n                )),\n                fn === props\n                  ? (resetHydrationState(),\n                    (current = bailoutOnAlreadyFinishedWork(\n                      current,\n                      workInProgress\n                    )))\n                  : ((fn = props.element),\n                    (unmaskedContext = workInProgress.stateNode),\n                    (null === current || null === current.child) &&\n                    unmaskedContext.hydrate &&\n                    enterHydrationState(workInProgress)\n                      ? ((workInProgress.effectTag |= 2),\n                        (workInProgress.child = mountChildFibers(\n                          workInProgress,\n                          null,\n                          fn,\n                          renderExpirationTime\n                        )))\n                      : (resetHydrationState(),\n                        reconcileChildren(current, workInProgress, fn)),\n                    (workInProgress.memoizedState = props),\n                    (current = workInProgress.child)))\n              : (resetHydrationState(),\n                (current = bailoutOnAlreadyFinishedWork(\n                  current,\n                  workInProgress\n                ))),\n            current\n          );\n        case 5:\n          pushHostContext(workInProgress);\n          null === current && tryToClaimNextHydratableInstance(workInProgress);\n          props = workInProgress.type;\n          var memoizedProps = workInProgress.memoizedProps;\n          fn = workInProgress.pendingProps;\n          unmaskedContext = null !== current ? current.memoizedProps : null;\n          didPerformWorkStackCursor.current || memoizedProps !== fn\n            ? ((memoizedProps = fn.children),\n              shouldSetTextContent(props, fn)\n                ? (memoizedProps = null)\n                : unmaskedContext &&\n                  shouldSetTextContent(props, unmaskedContext) &&\n                  (workInProgress.effectTag |= 16),\n              markRef(current, workInProgress),\n              2147483647 !== renderExpirationTime &&\n              !useSyncScheduling &&\n              shouldDeprioritizeSubtree(props, fn)\n                ? ((workInProgress.expirationTime = 2147483647),\n                  (current = null))\n                : (reconcileChildren(current, workInProgress, memoizedProps),\n                  (workInProgress.memoizedProps = fn),\n                  (current = workInProgress.child)))\n            : (current = bailoutOnAlreadyFinishedWork(current, workInProgress));\n          return current;\n        case 6:\n          return (\n            null === current &&\n              tryToClaimNextHydratableInstance(workInProgress),\n            (workInProgress.memoizedProps = workInProgress.pendingProps),\n            null\n          );\n        case 8:\n          workInProgress.tag = 7;\n        case 7:\n          return (\n            (props = workInProgress.pendingProps),\n            didPerformWorkStackCursor.current ||\n              workInProgress.memoizedProps !== props ||\n              (props = workInProgress.memoizedProps),\n            (fn = props.children),\n            (workInProgress.stateNode =\n              null === current\n                ? mountChildFibers(\n                    workInProgress,\n                    workInProgress.stateNode,\n                    fn,\n                    renderExpirationTime\n                  )\n                : reconcileChildFibers(\n                    workInProgress,\n                    workInProgress.stateNode,\n                    fn,\n                    renderExpirationTime\n                  )),\n            (workInProgress.memoizedProps = props),\n            workInProgress.stateNode\n          );\n        case 9:\n          return null;\n        case 4:\n          return (\n            pushHostContainer(\n              workInProgress,\n              workInProgress.stateNode.containerInfo\n            ),\n            (props = workInProgress.pendingProps),\n            didPerformWorkStackCursor.current ||\n            workInProgress.memoizedProps !== props\n              ? (null === current\n                  ? (workInProgress.child = reconcileChildFibers(\n                      workInProgress,\n                      null,\n                      props,\n                      renderExpirationTime\n                    ))\n                  : reconcileChildren(current, workInProgress, props),\n                (workInProgress.memoizedProps = props),\n                (current = workInProgress.child))\n              : (current = bailoutOnAlreadyFinishedWork(\n                  current,\n                  workInProgress\n                )),\n            current\n          );\n        case 10:\n          return (\n            (renderExpirationTime = workInProgress.pendingProps),\n            didPerformWorkStackCursor.current ||\n            (null !== renderExpirationTime &&\n              workInProgress.memoizedProps !== renderExpirationTime)\n              ? (reconcileChildren(\n                  current,\n                  workInProgress,\n                  renderExpirationTime\n                ),\n                (workInProgress.memoizedProps = renderExpirationTime),\n                (current = workInProgress.child))\n              : (current = bailoutOnAlreadyFinishedWork(\n                  current,\n                  workInProgress\n                )),\n            current\n          );\n        default:\n          invariant(\n            !1,\n            \"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n      }\n    },\n    beginFailedWork: function(current, workInProgress, renderExpirationTime) {\n      switch (workInProgress.tag) {\n        case 2:\n          pushContextProvider(workInProgress);\n          break;\n        case 3:\n          pushHostRootContext(workInProgress);\n          break;\n        default:\n          invariant(\n            !1,\n            \"Invalid type of work. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n      }\n      workInProgress.effectTag |= 64;\n      null === current\n        ? (workInProgress.child = null)\n        : workInProgress.child !== current.child &&\n          (workInProgress.child = current.child);\n      if (\n        0 === workInProgress.expirationTime ||\n        workInProgress.expirationTime > renderExpirationTime\n      )\n        return bailoutOnLowPriority(current, workInProgress);\n      workInProgress.firstEffect = null;\n      workInProgress.lastEffect = null;\n      workInProgress.child =\n        null === current\n          ? mountChildFibers(workInProgress, null, null, renderExpirationTime)\n          : reconcileChildFibers(\n              workInProgress,\n              current.child,\n              null,\n              renderExpirationTime\n            );\n      2 === workInProgress.tag &&\n        ((current = workInProgress.stateNode),\n        (workInProgress.memoizedProps = current.props),\n        (workInProgress.memoizedState = current.state));\n      return workInProgress.child;\n    }\n  };\n}\nfunction ReactFiberCompleteWork(config, hostContext, hydrationContext) {\n  function markUpdate(workInProgress) {\n    workInProgress.effectTag |= 4;\n  }\n  var createInstance = config.createInstance,\n    createTextInstance = config.createTextInstance,\n    appendInitialChild = config.appendInitialChild,\n    finalizeInitialChildren = config.finalizeInitialChildren,\n    prepareUpdate = config.prepareUpdate,\n    persistence = config.persistence,\n    getRootHostContainer = hostContext.getRootHostContainer,\n    popHostContext = hostContext.popHostContext,\n    getHostContext = hostContext.getHostContext,\n    popHostContainer = hostContext.popHostContainer,\n    prepareToHydrateHostInstance =\n      hydrationContext.prepareToHydrateHostInstance,\n    prepareToHydrateHostTextInstance =\n      hydrationContext.prepareToHydrateHostTextInstance,\n    popHydrationState = hydrationContext.popHydrationState,\n    updateHostContainer = void 0,\n    updateHostComponent = void 0,\n    updateHostText = void 0;\n  config.mutation\n    ? ((updateHostContainer = function() {}),\n      (updateHostComponent = function(current, workInProgress, updatePayload) {\n        (workInProgress.updateQueue = updatePayload) &&\n          markUpdate(workInProgress);\n      }),\n      (updateHostText = function(current, workInProgress, oldText, newText) {\n        oldText !== newText && markUpdate(workInProgress);\n      }))\n    : persistence\n      ? invariant(!1, \"Persistent reconciler is disabled.\")\n      : invariant(!1, \"Noop reconciler is disabled.\");\n  return {\n    completeWork: function(current, workInProgress, renderExpirationTime) {\n      var newProps = workInProgress.pendingProps;\n      switch (workInProgress.tag) {\n        case 1:\n          return null;\n        case 2:\n          return popContextProvider(workInProgress), null;\n        case 3:\n          popHostContainer(workInProgress);\n          pop(didPerformWorkStackCursor, workInProgress);\n          pop(contextStackCursor, workInProgress);\n          newProps = workInProgress.stateNode;\n          newProps.pendingContext &&\n            ((newProps.context = newProps.pendingContext),\n            (newProps.pendingContext = null));\n          if (null === current || null === current.child)\n            popHydrationState(workInProgress), (workInProgress.effectTag &= -3);\n          updateHostContainer(workInProgress);\n          return null;\n        case 5:\n          popHostContext(workInProgress);\n          renderExpirationTime = getRootHostContainer();\n          var type = workInProgress.type;\n          if (null !== current && null != workInProgress.stateNode) {\n            var oldProps = current.memoizedProps,\n              instance = workInProgress.stateNode,\n              currentHostContext = getHostContext();\n            instance = prepareUpdate(\n              instance,\n              type,\n              oldProps,\n              newProps,\n              renderExpirationTime,\n              currentHostContext\n            );\n            updateHostComponent(\n              current,\n              workInProgress,\n              instance,\n              type,\n              oldProps,\n              newProps,\n              renderExpirationTime\n            );\n            current.ref !== workInProgress.ref &&\n              (workInProgress.effectTag |= 128);\n          } else {\n            if (!newProps)\n              return (\n                invariant(\n                  null !== workInProgress.stateNode,\n                  \"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\"\n                ),\n                null\n              );\n            current = getHostContext();\n            if (popHydrationState(workInProgress))\n              prepareToHydrateHostInstance(\n                workInProgress,\n                renderExpirationTime,\n                current\n              ) && markUpdate(workInProgress);\n            else {\n              current = createInstance(\n                type,\n                newProps,\n                renderExpirationTime,\n                current,\n                workInProgress\n              );\n              a: for (oldProps = workInProgress.child; null !== oldProps; ) {\n                if (5 === oldProps.tag || 6 === oldProps.tag)\n                  appendInitialChild(current, oldProps.stateNode);\n                else if (4 !== oldProps.tag && null !== oldProps.child) {\n                  oldProps.child[\"return\"] = oldProps;\n                  oldProps = oldProps.child;\n                  continue;\n                }\n                if (oldProps === workInProgress) break;\n                for (; null === oldProps.sibling; ) {\n                  if (\n                    null === oldProps[\"return\"] ||\n                    oldProps[\"return\"] === workInProgress\n                  )\n                    break a;\n                  oldProps = oldProps[\"return\"];\n                }\n                oldProps.sibling[\"return\"] = oldProps[\"return\"];\n                oldProps = oldProps.sibling;\n              }\n              finalizeInitialChildren(\n                current,\n                type,\n                newProps,\n                renderExpirationTime\n              ) && markUpdate(workInProgress);\n              workInProgress.stateNode = current;\n            }\n            null !== workInProgress.ref && (workInProgress.effectTag |= 128);\n          }\n          return null;\n        case 6:\n          if (current && null != workInProgress.stateNode)\n            updateHostText(\n              current,\n              workInProgress,\n              current.memoizedProps,\n              newProps\n            );\n          else {\n            if (\"string\" !== typeof newProps)\n              return (\n                invariant(\n                  null !== workInProgress.stateNode,\n                  \"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\"\n                ),\n                null\n              );\n            current = getRootHostContainer();\n            renderExpirationTime = getHostContext();\n            popHydrationState(workInProgress)\n              ? prepareToHydrateHostTextInstance(workInProgress) &&\n                markUpdate(workInProgress)\n              : (workInProgress.stateNode = createTextInstance(\n                  newProps,\n                  current,\n                  renderExpirationTime,\n                  workInProgress\n                ));\n          }\n          return null;\n        case 7:\n          newProps = workInProgress.memoizedProps;\n          invariant(\n            newProps,\n            \"Should be resolved by now. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n          workInProgress.tag = 8;\n          type = [];\n          a: for (\n            (oldProps = workInProgress.stateNode) &&\n            (oldProps[\"return\"] = workInProgress);\n            null !== oldProps;\n\n          ) {\n            if (5 === oldProps.tag || 6 === oldProps.tag || 4 === oldProps.tag)\n              invariant(!1, \"A call cannot have host component children.\");\n            else if (9 === oldProps.tag) type.push(oldProps.type);\n            else if (null !== oldProps.child) {\n              oldProps.child[\"return\"] = oldProps;\n              oldProps = oldProps.child;\n              continue;\n            }\n            for (; null === oldProps.sibling; ) {\n              if (\n                null === oldProps[\"return\"] ||\n                oldProps[\"return\"] === workInProgress\n              )\n                break a;\n              oldProps = oldProps[\"return\"];\n            }\n            oldProps.sibling[\"return\"] = oldProps[\"return\"];\n            oldProps = oldProps.sibling;\n          }\n          oldProps = newProps.handler;\n          newProps = oldProps(newProps.props, type);\n          workInProgress.child = reconcileChildFibers(\n            workInProgress,\n            null !== current ? current.child : null,\n            newProps,\n            renderExpirationTime\n          );\n          return workInProgress.child;\n        case 8:\n          return (workInProgress.tag = 7), null;\n        case 9:\n          return null;\n        case 10:\n          return null;\n        case 4:\n          return (\n            popHostContainer(workInProgress),\n            updateHostContainer(workInProgress),\n            null\n          );\n        case 0:\n          invariant(\n            !1,\n            \"An indeterminate component should have become determinate before completing. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n        default:\n          invariant(\n            !1,\n            \"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n      }\n    }\n  };\n}\nfunction ReactFiberCommitWork(config, captureError) {\n  function safelyDetachRef(current) {\n    var ref = current.ref;\n    if (null !== ref)\n      try {\n        ref(null);\n      } catch (refError) {\n        captureError(current, refError);\n      }\n  }\n  function commitUnmount(current) {\n    \"function\" === typeof onCommitUnmount && onCommitUnmount(current);\n    switch (current.tag) {\n      case 2:\n        safelyDetachRef(current);\n        var instance = current.stateNode;\n        if (\"function\" === typeof instance.componentWillUnmount)\n          try {\n            (instance.props = current.memoizedProps),\n              (instance.state = current.memoizedState),\n              instance.componentWillUnmount();\n          } catch (unmountError) {\n            captureError(current, unmountError);\n          }\n        break;\n      case 5:\n        safelyDetachRef(current);\n        break;\n      case 7:\n        commitNestedUnmounts(current.stateNode);\n        break;\n      case 4:\n        mutation && unmountHostComponents(current);\n    }\n  }\n  function commitNestedUnmounts(root) {\n    for (var node = root; ; )\n      if (\n        (commitUnmount(node),\n        null === node.child || (mutation && 4 === node.tag))\n      ) {\n        if (node === root) break;\n        for (; null === node.sibling; ) {\n          if (null === node[\"return\"] || node[\"return\"] === root) return;\n          node = node[\"return\"];\n        }\n        node.sibling[\"return\"] = node[\"return\"];\n        node = node.sibling;\n      } else (node.child[\"return\"] = node), (node = node.child);\n  }\n  function isHostParent(fiber) {\n    return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag;\n  }\n  function unmountHostComponents(current) {\n    for (\n      var node = current,\n        currentParentIsValid = !1,\n        currentParent = void 0,\n        currentParentIsContainer = void 0;\n      ;\n\n    ) {\n      if (!currentParentIsValid) {\n        currentParentIsValid = node[\"return\"];\n        a: for (;;) {\n          invariant(\n            null !== currentParentIsValid,\n            \"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n          switch (currentParentIsValid.tag) {\n            case 5:\n              currentParent = currentParentIsValid.stateNode;\n              currentParentIsContainer = !1;\n              break a;\n            case 3:\n              currentParent = currentParentIsValid.stateNode.containerInfo;\n              currentParentIsContainer = !0;\n              break a;\n            case 4:\n              currentParent = currentParentIsValid.stateNode.containerInfo;\n              currentParentIsContainer = !0;\n              break a;\n          }\n          currentParentIsValid = currentParentIsValid[\"return\"];\n        }\n        currentParentIsValid = !0;\n      }\n      if (5 === node.tag || 6 === node.tag)\n        commitNestedUnmounts(node),\n          currentParentIsContainer\n            ? removeChildFromContainer(currentParent, node.stateNode)\n            : removeChild(currentParent, node.stateNode);\n      else if (\n        (4 === node.tag\n          ? (currentParent = node.stateNode.containerInfo)\n          : commitUnmount(node),\n        null !== node.child)\n      ) {\n        node.child[\"return\"] = node;\n        node = node.child;\n        continue;\n      }\n      if (node === current) break;\n      for (; null === node.sibling; ) {\n        if (null === node[\"return\"] || node[\"return\"] === current) return;\n        node = node[\"return\"];\n        4 === node.tag && (currentParentIsValid = !1);\n      }\n      node.sibling[\"return\"] = node[\"return\"];\n      node = node.sibling;\n    }\n  }\n  var getPublicInstance = config.getPublicInstance,\n    mutation = config.mutation;\n  config = config.persistence;\n  mutation ||\n    (config\n      ? invariant(!1, \"Persistent reconciler is disabled.\")\n      : invariant(!1, \"Noop reconciler is disabled.\"));\n  var commitMount = mutation.commitMount,\n    commitUpdate = mutation.commitUpdate,\n    resetTextContent = mutation.resetTextContent,\n    commitTextUpdate = mutation.commitTextUpdate,\n    appendChild = mutation.appendChild,\n    appendChildToContainer = mutation.appendChildToContainer,\n    insertBefore = mutation.insertBefore,\n    insertInContainerBefore = mutation.insertInContainerBefore,\n    removeChild = mutation.removeChild,\n    removeChildFromContainer = mutation.removeChildFromContainer;\n  return {\n    commitResetTextContent: function(current) {\n      resetTextContent(current.stateNode);\n    },\n    commitPlacement: function(finishedWork) {\n      a: {\n        for (var parent = finishedWork[\"return\"]; null !== parent; ) {\n          if (isHostParent(parent)) {\n            var parentFiber = parent;\n            break a;\n          }\n          parent = parent[\"return\"];\n        }\n        invariant(\n          !1,\n          \"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\"\n        );\n        parentFiber = void 0;\n      }\n      var isContainer = (parent = void 0);\n      switch (parentFiber.tag) {\n        case 5:\n          parent = parentFiber.stateNode;\n          isContainer = !1;\n          break;\n        case 3:\n          parent = parentFiber.stateNode.containerInfo;\n          isContainer = !0;\n          break;\n        case 4:\n          parent = parentFiber.stateNode.containerInfo;\n          isContainer = !0;\n          break;\n        default:\n          invariant(\n            !1,\n            \"Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n      }\n      parentFiber.effectTag & 16 &&\n        (resetTextContent(parent), (parentFiber.effectTag &= -17));\n      a: b: for (parentFiber = finishedWork; ; ) {\n        for (; null === parentFiber.sibling; ) {\n          if (\n            null === parentFiber[\"return\"] ||\n            isHostParent(parentFiber[\"return\"])\n          ) {\n            parentFiber = null;\n            break a;\n          }\n          parentFiber = parentFiber[\"return\"];\n        }\n        parentFiber.sibling[\"return\"] = parentFiber[\"return\"];\n        for (\n          parentFiber = parentFiber.sibling;\n          5 !== parentFiber.tag && 6 !== parentFiber.tag;\n\n        ) {\n          if (parentFiber.effectTag & 2) continue b;\n          if (null === parentFiber.child || 4 === parentFiber.tag) continue b;\n          else\n            (parentFiber.child[\"return\"] = parentFiber),\n              (parentFiber = parentFiber.child);\n        }\n        if (!(parentFiber.effectTag & 2)) {\n          parentFiber = parentFiber.stateNode;\n          break a;\n        }\n      }\n      for (var node = finishedWork; ; ) {\n        if (5 === node.tag || 6 === node.tag)\n          parentFiber\n            ? isContainer\n              ? insertInContainerBefore(parent, node.stateNode, parentFiber)\n              : insertBefore(parent, node.stateNode, parentFiber)\n            : isContainer\n              ? appendChildToContainer(parent, node.stateNode)\n              : appendChild(parent, node.stateNode);\n        else if (4 !== node.tag && null !== node.child) {\n          node.child[\"return\"] = node;\n          node = node.child;\n          continue;\n        }\n        if (node === finishedWork) break;\n        for (; null === node.sibling; ) {\n          if (null === node[\"return\"] || node[\"return\"] === finishedWork)\n            return;\n          node = node[\"return\"];\n        }\n        node.sibling[\"return\"] = node[\"return\"];\n        node = node.sibling;\n      }\n    },\n    commitDeletion: function(current) {\n      unmountHostComponents(current);\n      current[\"return\"] = null;\n      current.child = null;\n      current.alternate &&\n        ((current.alternate.child = null),\n        (current.alternate[\"return\"] = null));\n    },\n    commitWork: function(current, finishedWork) {\n      switch (finishedWork.tag) {\n        case 2:\n          break;\n        case 5:\n          var instance = finishedWork.stateNode;\n          if (null != instance) {\n            var newProps = finishedWork.memoizedProps;\n            current = null !== current ? current.memoizedProps : newProps;\n            var type = finishedWork.type,\n              updatePayload = finishedWork.updateQueue;\n            finishedWork.updateQueue = null;\n            null !== updatePayload &&\n              commitUpdate(\n                instance,\n                updatePayload,\n                type,\n                current,\n                newProps,\n                finishedWork\n              );\n          }\n          break;\n        case 6:\n          invariant(\n            null !== finishedWork.stateNode,\n            \"This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n          instance = finishedWork.memoizedProps;\n          commitTextUpdate(\n            finishedWork.stateNode,\n            null !== current ? current.memoizedProps : instance,\n            instance\n          );\n          break;\n        case 3:\n          break;\n        default:\n          invariant(\n            !1,\n            \"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n      }\n    },\n    commitLifeCycles: function(current, finishedWork) {\n      switch (finishedWork.tag) {\n        case 2:\n          var instance = finishedWork.stateNode;\n          if (finishedWork.effectTag & 4)\n            if (null === current)\n              (instance.props = finishedWork.memoizedProps),\n                (instance.state = finishedWork.memoizedState),\n                instance.componentDidMount();\n            else {\n              var prevProps = current.memoizedProps;\n              current = current.memoizedState;\n              instance.props = finishedWork.memoizedProps;\n              instance.state = finishedWork.memoizedState;\n              instance.componentDidUpdate(prevProps, current);\n            }\n          finishedWork = finishedWork.updateQueue;\n          null !== finishedWork && commitCallbacks(finishedWork, instance);\n          break;\n        case 3:\n          instance = finishedWork.updateQueue;\n          null !== instance &&\n            commitCallbacks(\n              instance,\n              null !== finishedWork.child ? finishedWork.child.stateNode : null\n            );\n          break;\n        case 5:\n          instance = finishedWork.stateNode;\n          null === current &&\n            finishedWork.effectTag & 4 &&\n            commitMount(\n              instance,\n              finishedWork.type,\n              finishedWork.memoizedProps,\n              finishedWork\n            );\n          break;\n        case 6:\n          break;\n        case 4:\n          break;\n        default:\n          invariant(\n            !1,\n            \"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n      }\n    },\n    commitAttachRef: function(finishedWork) {\n      var ref = finishedWork.ref;\n      if (null !== ref) {\n        var instance = finishedWork.stateNode;\n        switch (finishedWork.tag) {\n          case 5:\n            ref(getPublicInstance(instance));\n            break;\n          default:\n            ref(instance);\n        }\n      }\n    },\n    commitDetachRef: function(current) {\n      current = current.ref;\n      null !== current && current(null);\n    }\n  };\n}\nvar NO_CONTEXT = {};\nfunction ReactFiberHostContext(config) {\n  function requiredContext(c) {\n    invariant(\n      c !== NO_CONTEXT,\n      \"Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.\"\n    );\n    return c;\n  }\n  var getChildHostContext = config.getChildHostContext,\n    getRootHostContext = config.getRootHostContext,\n    contextStackCursor = { current: NO_CONTEXT },\n    contextFiberStackCursor = { current: NO_CONTEXT },\n    rootInstanceStackCursor = { current: NO_CONTEXT };\n  return {\n    getHostContext: function() {\n      return requiredContext(contextStackCursor.current);\n    },\n    getRootHostContainer: function() {\n      return requiredContext(rootInstanceStackCursor.current);\n    },\n    popHostContainer: function(fiber) {\n      pop(contextStackCursor, fiber);\n      pop(contextFiberStackCursor, fiber);\n      pop(rootInstanceStackCursor, fiber);\n    },\n    popHostContext: function(fiber) {\n      contextFiberStackCursor.current === fiber &&\n        (pop(contextStackCursor, fiber), pop(contextFiberStackCursor, fiber));\n    },\n    pushHostContainer: function(fiber, nextRootInstance) {\n      push(rootInstanceStackCursor, nextRootInstance, fiber);\n      nextRootInstance = getRootHostContext(nextRootInstance);\n      push(contextFiberStackCursor, fiber, fiber);\n      push(contextStackCursor, nextRootInstance, fiber);\n    },\n    pushHostContext: function(fiber) {\n      var rootInstance = requiredContext(rootInstanceStackCursor.current),\n        context = requiredContext(contextStackCursor.current);\n      rootInstance = getChildHostContext(context, fiber.type, rootInstance);\n      context !== rootInstance &&\n        (push(contextFiberStackCursor, fiber, fiber),\n        push(contextStackCursor, rootInstance, fiber));\n    },\n    resetHostContainer: function() {\n      contextStackCursor.current = NO_CONTEXT;\n      rootInstanceStackCursor.current = NO_CONTEXT;\n    }\n  };\n}\nfunction ReactFiberHydrationContext(config) {\n  function deleteHydratableInstance(returnFiber, instance) {\n    var fiber = createFiber(5, null, null, 0);\n    fiber.type = \"DELETED\";\n    fiber.stateNode = instance;\n    fiber[\"return\"] = returnFiber;\n    fiber.effectTag = 8;\n    null !== returnFiber.lastEffect\n      ? ((returnFiber.lastEffect.nextEffect = fiber),\n        (returnFiber.lastEffect = fiber))\n      : (returnFiber.firstEffect = returnFiber.lastEffect = fiber);\n  }\n  function tryHydrate(fiber, nextInstance) {\n    switch (fiber.tag) {\n      case 5:\n        return (\n          (nextInstance = canHydrateInstance(\n            nextInstance,\n            fiber.type,\n            fiber.pendingProps\n          )),\n          null !== nextInstance ? ((fiber.stateNode = nextInstance), !0) : !1\n        );\n      case 6:\n        return (\n          (nextInstance = canHydrateTextInstance(\n            nextInstance,\n            fiber.pendingProps\n          )),\n          null !== nextInstance ? ((fiber.stateNode = nextInstance), !0) : !1\n        );\n      default:\n        return !1;\n    }\n  }\n  function popToNextHostParent(fiber) {\n    for (\n      fiber = fiber[\"return\"];\n      null !== fiber && 5 !== fiber.tag && 3 !== fiber.tag;\n\n    )\n      fiber = fiber[\"return\"];\n    hydrationParentFiber = fiber;\n  }\n  var shouldSetTextContent = config.shouldSetTextContent;\n  config = config.hydration;\n  if (!config)\n    return {\n      enterHydrationState: function() {\n        return !1;\n      },\n      resetHydrationState: function() {},\n      tryToClaimNextHydratableInstance: function() {},\n      prepareToHydrateHostInstance: function() {\n        invariant(\n          !1,\n          \"Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.\"\n        );\n      },\n      prepareToHydrateHostTextInstance: function() {\n        invariant(\n          !1,\n          \"Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.\"\n        );\n      },\n      popHydrationState: function() {\n        return !1;\n      }\n    };\n  var canHydrateInstance = config.canHydrateInstance,\n    canHydrateTextInstance = config.canHydrateTextInstance,\n    getNextHydratableSibling = config.getNextHydratableSibling,\n    getFirstHydratableChild = config.getFirstHydratableChild,\n    hydrateInstance = config.hydrateInstance,\n    hydrateTextInstance = config.hydrateTextInstance,\n    hydrationParentFiber = null,\n    nextHydratableInstance = null,\n    isHydrating = !1;\n  return {\n    enterHydrationState: function(fiber) {\n      nextHydratableInstance = getFirstHydratableChild(\n        fiber.stateNode.containerInfo\n      );\n      hydrationParentFiber = fiber;\n      return (isHydrating = !0);\n    },\n    resetHydrationState: function() {\n      nextHydratableInstance = hydrationParentFiber = null;\n      isHydrating = !1;\n    },\n    tryToClaimNextHydratableInstance: function(fiber) {\n      if (isHydrating) {\n        var nextInstance = nextHydratableInstance;\n        if (nextInstance) {\n          if (!tryHydrate(fiber, nextInstance)) {\n            nextInstance = getNextHydratableSibling(nextInstance);\n            if (!nextInstance || !tryHydrate(fiber, nextInstance)) {\n              fiber.effectTag |= 2;\n              isHydrating = !1;\n              hydrationParentFiber = fiber;\n              return;\n            }\n            deleteHydratableInstance(\n              hydrationParentFiber,\n              nextHydratableInstance\n            );\n          }\n          hydrationParentFiber = fiber;\n          nextHydratableInstance = getFirstHydratableChild(nextInstance);\n        } else\n          (fiber.effectTag |= 2),\n            (isHydrating = !1),\n            (hydrationParentFiber = fiber);\n      }\n    },\n    prepareToHydrateHostInstance: function(\n      fiber,\n      rootContainerInstance,\n      hostContext\n    ) {\n      rootContainerInstance = hydrateInstance(\n        fiber.stateNode,\n        fiber.type,\n        fiber.memoizedProps,\n        rootContainerInstance,\n        hostContext,\n        fiber\n      );\n      fiber.updateQueue = rootContainerInstance;\n      return null !== rootContainerInstance ? !0 : !1;\n    },\n    prepareToHydrateHostTextInstance: function(fiber) {\n      return hydrateTextInstance(fiber.stateNode, fiber.memoizedProps, fiber);\n    },\n    popHydrationState: function(fiber) {\n      if (fiber !== hydrationParentFiber) return !1;\n      if (!isHydrating)\n        return popToNextHostParent(fiber), (isHydrating = !0), !1;\n      var type = fiber.type;\n      if (\n        5 !== fiber.tag ||\n        (\"head\" !== type &&\n          \"body\" !== type &&\n          !shouldSetTextContent(type, fiber.memoizedProps))\n      )\n        for (type = nextHydratableInstance; type; )\n          deleteHydratableInstance(fiber, type),\n            (type = getNextHydratableSibling(type));\n      popToNextHostParent(fiber);\n      nextHydratableInstance = hydrationParentFiber\n        ? getNextHydratableSibling(fiber.stateNode)\n        : null;\n      return !0;\n    }\n  };\n}\nfunction ReactFiberScheduler(config) {\n  function completeUnitOfWork(workInProgress$jscomp$0) {\n    for (;;) {\n      var next = completeWork(\n          workInProgress$jscomp$0.alternate,\n          workInProgress$jscomp$0,\n          nextRenderExpirationTime\n        ),\n        returnFiber = workInProgress$jscomp$0[\"return\"],\n        siblingFiber = workInProgress$jscomp$0.sibling;\n      var workInProgress = workInProgress$jscomp$0;\n      if (\n        2147483647 === nextRenderExpirationTime ||\n        2147483647 !== workInProgress.expirationTime\n      ) {\n        if (2 !== workInProgress.tag && 3 !== workInProgress.tag)\n          var newExpirationTime = 0;\n        else\n          (newExpirationTime = workInProgress.updateQueue),\n            (newExpirationTime =\n              null === newExpirationTime\n                ? 0\n                : newExpirationTime.expirationTime);\n        for (var child = workInProgress.child; null !== child; )\n          0 !== child.expirationTime &&\n            (0 === newExpirationTime ||\n              newExpirationTime > child.expirationTime) &&\n            (newExpirationTime = child.expirationTime),\n            (child = child.sibling);\n        workInProgress.expirationTime = newExpirationTime;\n      }\n      if (null !== next) return next;\n      null !== returnFiber &&\n        (null === returnFiber.firstEffect &&\n          (returnFiber.firstEffect = workInProgress$jscomp$0.firstEffect),\n        null !== workInProgress$jscomp$0.lastEffect &&\n          (null !== returnFiber.lastEffect &&\n            (returnFiber.lastEffect.nextEffect =\n              workInProgress$jscomp$0.firstEffect),\n          (returnFiber.lastEffect = workInProgress$jscomp$0.lastEffect)),\n        1 < workInProgress$jscomp$0.effectTag &&\n          (null !== returnFiber.lastEffect\n            ? (returnFiber.lastEffect.nextEffect = workInProgress$jscomp$0)\n            : (returnFiber.firstEffect = workInProgress$jscomp$0),\n          (returnFiber.lastEffect = workInProgress$jscomp$0)));\n      if (null !== siblingFiber) return siblingFiber;\n      if (null !== returnFiber) workInProgress$jscomp$0 = returnFiber;\n      else {\n        workInProgress$jscomp$0.stateNode.isReadyForCommit = !0;\n        break;\n      }\n    }\n    return null;\n  }\n  function performUnitOfWork(workInProgress) {\n    var next = beginWork(\n      workInProgress.alternate,\n      workInProgress,\n      nextRenderExpirationTime\n    );\n    null === next && (next = completeUnitOfWork(workInProgress));\n    ReactCurrentOwner.current = null;\n    return next;\n  }\n  function performFailedUnitOfWork(workInProgress) {\n    var next = beginFailedWork(\n      workInProgress.alternate,\n      workInProgress,\n      nextRenderExpirationTime\n    );\n    null === next && (next = completeUnitOfWork(workInProgress));\n    ReactCurrentOwner.current = null;\n    return next;\n  }\n  function workLoop(expirationTime) {\n    if (null !== capturedErrors) {\n      if (\n        !(\n          0 === nextRenderExpirationTime ||\n          nextRenderExpirationTime > expirationTime\n        )\n      )\n        if (nextRenderExpirationTime <= mostRecentCurrentTime)\n          for (; null !== nextUnitOfWork; )\n            nextUnitOfWork = hasCapturedError(nextUnitOfWork)\n              ? performFailedUnitOfWork(nextUnitOfWork)\n              : performUnitOfWork(nextUnitOfWork);\n        else\n          for (; null !== nextUnitOfWork && !shouldYield(); )\n            nextUnitOfWork = hasCapturedError(nextUnitOfWork)\n              ? performFailedUnitOfWork(nextUnitOfWork)\n              : performUnitOfWork(nextUnitOfWork);\n    } else if (\n      !(\n        0 === nextRenderExpirationTime ||\n        nextRenderExpirationTime > expirationTime\n      )\n    )\n      if (nextRenderExpirationTime <= mostRecentCurrentTime)\n        for (; null !== nextUnitOfWork; )\n          nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n      else\n        for (; null !== nextUnitOfWork && !shouldYield(); )\n          nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n  }\n  function renderRoot(root, expirationTime) {\n    invariant(\n      !isWorking,\n      \"renderRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.\"\n    );\n    isWorking = !0;\n    root.isReadyForCommit = !1;\n    if (\n      root !== nextRoot ||\n      expirationTime !== nextRenderExpirationTime ||\n      null === nextUnitOfWork\n    ) {\n      for (; -1 < index; ) (valueStack[index] = null), index--;\n      previousContext = emptyObject;\n      contextStackCursor.current = emptyObject;\n      didPerformWorkStackCursor.current = !1;\n      resetHostContainer();\n      nextRoot = root;\n      nextRenderExpirationTime = expirationTime;\n      nextUnitOfWork = createWorkInProgress(\n        nextRoot.current,\n        null,\n        expirationTime\n      );\n    }\n    var didError = !1,\n      error = null;\n    try {\n      workLoop(expirationTime);\n    } catch (e) {\n      (didError = !0), (error = e);\n    }\n    for (; didError; ) {\n      if (didFatal) {\n        firstUncaughtError = error;\n        break;\n      }\n      var failedWork = nextUnitOfWork;\n      if (null === failedWork) didFatal = !0;\n      else {\n        var boundary = captureError(failedWork, error);\n        invariant(\n          null !== boundary,\n          \"Should have found an error boundary. This error is likely caused by a bug in React. Please file an issue.\"\n        );\n        if (!didFatal) {\n          try {\n            didError = boundary;\n            error = expirationTime;\n            for (boundary = didError; null !== failedWork; ) {\n              switch (failedWork.tag) {\n                case 2:\n                  popContextProvider(failedWork);\n                  break;\n                case 5:\n                  popHostContext(failedWork);\n                  break;\n                case 3:\n                  popHostContainer(failedWork);\n                  break;\n                case 4:\n                  popHostContainer(failedWork);\n              }\n              if (failedWork === boundary || failedWork.alternate === boundary)\n                break;\n              failedWork = failedWork[\"return\"];\n            }\n            nextUnitOfWork = performFailedUnitOfWork(didError);\n            workLoop(error);\n          } catch (e) {\n            didError = !0;\n            error = e;\n            continue;\n          }\n          break;\n        }\n      }\n    }\n    expirationTime = firstUncaughtError;\n    didFatal = isWorking = !1;\n    firstUncaughtError = null;\n    null !== expirationTime && onUncaughtError(expirationTime);\n    return root.isReadyForCommit ? root.current.alternate : null;\n  }\n  function captureError(failedWork, error$jscomp$0) {\n    var boundary = (ReactCurrentOwner.current = null),\n      errorBoundaryFound = !1,\n      willRetry = !1,\n      errorBoundaryName = null;\n    if (3 === failedWork.tag)\n      (boundary = failedWork), isFailedBoundary(failedWork) && (didFatal = !0);\n    else\n      for (\n        var node = failedWork[\"return\"];\n        null !== node && null === boundary;\n\n      ) {\n        2 === node.tag\n          ? \"function\" === typeof node.stateNode.componentDidCatch &&\n            ((errorBoundaryFound = !0),\n            (errorBoundaryName = getComponentName(node)),\n            (boundary = node),\n            (willRetry = !0))\n          : 3 === node.tag && (boundary = node);\n        if (isFailedBoundary(node)) {\n          if (\n            isUnmounting ||\n            (null !== commitPhaseBoundaries &&\n              (commitPhaseBoundaries.has(node) ||\n                (null !== node.alternate &&\n                  commitPhaseBoundaries.has(node.alternate))))\n          )\n            return null;\n          boundary = null;\n          willRetry = !1;\n        }\n        node = node[\"return\"];\n      }\n    if (null !== boundary) {\n      null === failedBoundaries && (failedBoundaries = new Set());\n      failedBoundaries.add(boundary);\n      var info = \"\";\n      node = failedWork;\n      do {\n        a: switch (node.tag) {\n          case 0:\n          case 1:\n          case 2:\n          case 5:\n            var owner = node._debugOwner,\n              source = node._debugSource;\n            var JSCompiler_inline_result = getComponentName(node);\n            var ownerName = null;\n            owner && (ownerName = getComponentName(owner));\n            owner = source;\n            JSCompiler_inline_result =\n              \"\\n    in \" +\n              (JSCompiler_inline_result || \"Unknown\") +\n              (owner\n                ? \" (at \" +\n                  owner.fileName.replace(/^.*[\\\\\\/]/, \"\") +\n                  \":\" +\n                  owner.lineNumber +\n                  \")\"\n                : ownerName ? \" (created by \" + ownerName + \")\" : \"\");\n            break a;\n          default:\n            JSCompiler_inline_result = \"\";\n        }\n        info += JSCompiler_inline_result;\n        node = node[\"return\"];\n      } while (node);\n      node = info;\n      failedWork = getComponentName(failedWork);\n      null === capturedErrors && (capturedErrors = new Map());\n      error$jscomp$0 = {\n        componentName: failedWork,\n        componentStack: node,\n        error: error$jscomp$0,\n        errorBoundary: errorBoundaryFound ? boundary.stateNode : null,\n        errorBoundaryFound: errorBoundaryFound,\n        errorBoundaryName: errorBoundaryName,\n        willRetry: willRetry\n      };\n      capturedErrors.set(boundary, error$jscomp$0);\n      try {\n        if (!1 !== showDialog(error$jscomp$0)) {\n          var error = error$jscomp$0.error;\n          (error && error.suppressReactErrorLogging) || console.error(error);\n        }\n      } catch (e) {\n        (e && e.suppressReactErrorLogging) || console.error(e);\n      }\n      isCommitting\n        ? (null === commitPhaseBoundaries &&\n            (commitPhaseBoundaries = new Set()),\n          commitPhaseBoundaries.add(boundary))\n        : scheduleErrorRecovery(boundary);\n      return boundary;\n    }\n    null === firstUncaughtError && (firstUncaughtError = error$jscomp$0);\n    return null;\n  }\n  function hasCapturedError(fiber) {\n    return (\n      null !== capturedErrors &&\n      (capturedErrors.has(fiber) ||\n        (null !== fiber.alternate && capturedErrors.has(fiber.alternate)))\n    );\n  }\n  function isFailedBoundary(fiber) {\n    return (\n      null !== failedBoundaries &&\n      (failedBoundaries.has(fiber) ||\n        (null !== fiber.alternate && failedBoundaries.has(fiber.alternate)))\n    );\n  }\n  function computeAsyncExpiration() {\n    return 20 * ((((recalculateCurrentTime() + 100) / 20) | 0) + 1);\n  }\n  function computeExpirationForFiber(fiber) {\n    return 0 !== expirationContext\n      ? expirationContext\n      : isWorking\n        ? isCommitting ? 1 : nextRenderExpirationTime\n        : !useSyncScheduling || fiber.internalContextTag & 1\n          ? computeAsyncExpiration()\n          : 1;\n  }\n  function scheduleWork(fiber, expirationTime) {\n    return scheduleWorkImpl(fiber, expirationTime, !1);\n  }\n  function scheduleWorkImpl(fiber, expirationTime) {\n    for (; null !== fiber; ) {\n      if (0 === fiber.expirationTime || fiber.expirationTime > expirationTime)\n        fiber.expirationTime = expirationTime;\n      null !== fiber.alternate &&\n        (0 === fiber.alternate.expirationTime ||\n          fiber.alternate.expirationTime > expirationTime) &&\n        (fiber.alternate.expirationTime = expirationTime);\n      if (null === fiber[\"return\"])\n        if (3 === fiber.tag) {\n          var root = fiber.stateNode;\n          !isWorking &&\n            root === nextRoot &&\n            expirationTime < nextRenderExpirationTime &&\n            ((nextUnitOfWork = nextRoot = null),\n            (nextRenderExpirationTime = 0));\n          requestWork(root, expirationTime);\n          !isWorking &&\n            root === nextRoot &&\n            expirationTime < nextRenderExpirationTime &&\n            ((nextUnitOfWork = nextRoot = null),\n            (nextRenderExpirationTime = 0));\n        } else break;\n      fiber = fiber[\"return\"];\n    }\n  }\n  function scheduleErrorRecovery(fiber) {\n    scheduleWorkImpl(fiber, 1, !0);\n  }\n  function recalculateCurrentTime() {\n    return (mostRecentCurrentTime = (((now() - startTime) / 10) | 0) + 2);\n  }\n  function scheduleCallbackWithExpiration(expirationTime) {\n    if (0 !== callbackExpirationTime) {\n      if (expirationTime > callbackExpirationTime) return;\n      cancelDeferredCallback(callbackID);\n    }\n    var currentMs = now() - startTime;\n    callbackExpirationTime = expirationTime;\n    callbackID = scheduleDeferredCallback(performAsyncWork, {\n      timeout: 10 * (expirationTime - 2) - currentMs\n    });\n  }\n  function requestWork(root, expirationTime) {\n    nestedUpdateCount > NESTED_UPDATE_LIMIT &&\n      invariant(\n        !1,\n        \"Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.\"\n      );\n    if (null === root.nextScheduledRoot)\n      (root.remainingExpirationTime = expirationTime),\n        null === lastScheduledRoot\n          ? ((firstScheduledRoot = lastScheduledRoot = root),\n            (root.nextScheduledRoot = root))\n          : ((lastScheduledRoot = lastScheduledRoot.nextScheduledRoot = root),\n            (lastScheduledRoot.nextScheduledRoot = firstScheduledRoot));\n    else {\n      var remainingExpirationTime = root.remainingExpirationTime;\n      if (\n        0 === remainingExpirationTime ||\n        expirationTime < remainingExpirationTime\n      )\n        root.remainingExpirationTime = expirationTime;\n    }\n    isRendering ||\n      (isBatchingUpdates\n        ? isUnbatchingUpdates &&\n          ((nextFlushedRoot = root),\n          (nextFlushedExpirationTime = 1),\n          performWorkOnRoot(root, 1, recalculateCurrentTime()))\n        : 1 === expirationTime\n          ? performWork(1, null)\n          : scheduleCallbackWithExpiration(expirationTime));\n  }\n  function findHighestPriorityRoot() {\n    var highestPriorityWork = 0,\n      highestPriorityRoot = null;\n    if (null !== lastScheduledRoot)\n      for (\n        var previousScheduledRoot = lastScheduledRoot,\n          root = firstScheduledRoot;\n        null !== root;\n\n      ) {\n        var remainingExpirationTime = root.remainingExpirationTime;\n        if (0 === remainingExpirationTime) {\n          invariant(\n            null !== previousScheduledRoot && null !== lastScheduledRoot,\n            \"Should have a previous and last root. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n          if (root === root.nextScheduledRoot) {\n            firstScheduledRoot = lastScheduledRoot = root.nextScheduledRoot = null;\n            break;\n          } else if (root === firstScheduledRoot)\n            (firstScheduledRoot = remainingExpirationTime =\n              root.nextScheduledRoot),\n              (lastScheduledRoot.nextScheduledRoot = remainingExpirationTime),\n              (root.nextScheduledRoot = null);\n          else if (root === lastScheduledRoot) {\n            lastScheduledRoot = previousScheduledRoot;\n            lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n            root.nextScheduledRoot = null;\n            break;\n          } else\n            (previousScheduledRoot.nextScheduledRoot = root.nextScheduledRoot),\n              (root.nextScheduledRoot = null);\n          root = previousScheduledRoot.nextScheduledRoot;\n        } else {\n          if (\n            0 === highestPriorityWork ||\n            remainingExpirationTime < highestPriorityWork\n          )\n            (highestPriorityWork = remainingExpirationTime),\n              (highestPriorityRoot = root);\n          if (root === lastScheduledRoot) break;\n          previousScheduledRoot = root;\n          root = root.nextScheduledRoot;\n        }\n      }\n    previousScheduledRoot = nextFlushedRoot;\n    null !== previousScheduledRoot &&\n    previousScheduledRoot === highestPriorityRoot\n      ? nestedUpdateCount++\n      : (nestedUpdateCount = 0);\n    nextFlushedRoot = highestPriorityRoot;\n    nextFlushedExpirationTime = highestPriorityWork;\n  }\n  function performAsyncWork(dl) {\n    performWork(0, dl);\n  }\n  function performWork(minExpirationTime, dl) {\n    deadline = dl;\n    for (\n      findHighestPriorityRoot();\n      null !== nextFlushedRoot &&\n      0 !== nextFlushedExpirationTime &&\n      (0 === minExpirationTime ||\n        nextFlushedExpirationTime <= minExpirationTime) &&\n      !deadlineDidExpire;\n\n    )\n      performWorkOnRoot(\n        nextFlushedRoot,\n        nextFlushedExpirationTime,\n        recalculateCurrentTime()\n      ),\n        findHighestPriorityRoot();\n    null !== deadline && ((callbackExpirationTime = 0), (callbackID = -1));\n    0 !== nextFlushedExpirationTime &&\n      scheduleCallbackWithExpiration(nextFlushedExpirationTime);\n    deadline = null;\n    deadlineDidExpire = !1;\n    nestedUpdateCount = 0;\n    finishRendering();\n  }\n  function finishRendering() {\n    if (null !== completedBatches) {\n      var batches = completedBatches;\n      completedBatches = null;\n      for (var i = 0; i < batches.length; i++) {\n        var batch = batches[i];\n        try {\n          batch._onComplete();\n        } catch (error) {\n          hasUnhandledError ||\n            ((hasUnhandledError = !0), (unhandledError = error));\n        }\n      }\n    }\n    if (hasUnhandledError)\n      throw ((batches = unhandledError),\n      (unhandledError = null),\n      (hasUnhandledError = !1),\n      batches);\n  }\n  function performWorkOnRoot(root, expirationTime, currentTime) {\n    invariant(\n      !isRendering,\n      \"performWorkOnRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.\"\n    );\n    isRendering = !0;\n    expirationTime <= currentTime\n      ? ((currentTime = root.finishedWork),\n        null !== currentTime\n          ? completeRoot(root, currentTime, expirationTime)\n          : ((root.finishedWork = null),\n            (currentTime = renderRoot(root, expirationTime)),\n            null !== currentTime &&\n              completeRoot(root, currentTime, expirationTime)))\n      : ((currentTime = root.finishedWork),\n        null !== currentTime\n          ? completeRoot(root, currentTime, expirationTime)\n          : ((root.finishedWork = null),\n            (currentTime = renderRoot(root, expirationTime)),\n            null !== currentTime &&\n              (shouldYield()\n                ? (root.finishedWork = currentTime)\n                : completeRoot(root, currentTime, expirationTime))));\n    isRendering = !1;\n  }\n  function completeRoot(root, finishedWork, expirationTime) {\n    var firstBatch = root.firstBatch;\n    if (\n      null !== firstBatch &&\n      firstBatch._expirationTime <= expirationTime &&\n      (null === completedBatches\n        ? (completedBatches = [firstBatch])\n        : completedBatches.push(firstBatch),\n      firstBatch._defer)\n    ) {\n      root.finishedWork = finishedWork;\n      root.remainingExpirationTime = 0;\n      return;\n    }\n    root.finishedWork = null;\n    isCommitting = isWorking = !0;\n    expirationTime = finishedWork.stateNode;\n    invariant(\n      expirationTime.current !== finishedWork,\n      \"Cannot commit the same tree as before. This is probably a bug related to the return field. This error is likely caused by a bug in React. Please file an issue.\"\n    );\n    expirationTime.isReadyForCommit = !1;\n    ReactCurrentOwner.current = null;\n    1 < finishedWork.effectTag\n      ? null !== finishedWork.lastEffect\n        ? ((finishedWork.lastEffect.nextEffect = finishedWork),\n          (firstBatch = finishedWork.firstEffect))\n        : (firstBatch = finishedWork)\n      : (firstBatch = finishedWork.firstEffect);\n    prepareForCommit();\n    for (nextEffect = firstBatch; null !== nextEffect; ) {\n      var didError = !1,\n        _error = void 0;\n      try {\n        for (; null !== nextEffect; ) {\n          var effectTag = nextEffect.effectTag;\n          effectTag & 16 && commitResetTextContent(nextEffect);\n          if (effectTag & 128) {\n            var current = nextEffect.alternate;\n            null !== current && commitDetachRef(current);\n          }\n          switch (effectTag & -242) {\n            case 2:\n              commitPlacement(nextEffect);\n              nextEffect.effectTag &= -3;\n              break;\n            case 6:\n              commitPlacement(nextEffect);\n              nextEffect.effectTag &= -3;\n              commitWork(nextEffect.alternate, nextEffect);\n              break;\n            case 4:\n              commitWork(nextEffect.alternate, nextEffect);\n              break;\n            case 8:\n              (isUnmounting = !0),\n                commitDeletion(nextEffect),\n                (isUnmounting = !1);\n          }\n          nextEffect = nextEffect.nextEffect;\n        }\n      } catch (e) {\n        (didError = !0), (_error = e);\n      }\n      didError &&\n        (invariant(\n          null !== nextEffect,\n          \"Should have next effect. This error is likely caused by a bug in React. Please file an issue.\"\n        ),\n        captureError(nextEffect, _error),\n        null !== nextEffect && (nextEffect = nextEffect.nextEffect));\n    }\n    resetAfterCommit();\n    expirationTime.current = finishedWork;\n    for (nextEffect = firstBatch; null !== nextEffect; ) {\n      effectTag = !1;\n      current = void 0;\n      try {\n        for (; null !== nextEffect; ) {\n          var effectTag$jscomp$0 = nextEffect.effectTag;\n          effectTag$jscomp$0 & 36 &&\n            commitLifeCycles(nextEffect.alternate, nextEffect);\n          effectTag$jscomp$0 & 128 && commitAttachRef(nextEffect);\n          if (effectTag$jscomp$0 & 64)\n            switch (((firstBatch = nextEffect),\n            (didError = void 0),\n            null !== capturedErrors &&\n              ((didError = capturedErrors.get(firstBatch)),\n              capturedErrors[\"delete\"](firstBatch),\n              null == didError &&\n                null !== firstBatch.alternate &&\n                ((firstBatch = firstBatch.alternate),\n                (didError = capturedErrors.get(firstBatch)),\n                capturedErrors[\"delete\"](firstBatch))),\n            invariant(\n              null != didError,\n              \"No error for given unit of work. This error is likely caused by a bug in React. Please file an issue.\"\n            ),\n            firstBatch.tag)) {\n              case 2:\n                firstBatch.stateNode.componentDidCatch(didError.error, {\n                  componentStack: didError.componentStack\n                });\n                break;\n              case 3:\n                null === firstUncaughtError &&\n                  (firstUncaughtError = didError.error);\n                break;\n              default:\n                invariant(\n                  !1,\n                  \"Invalid type of work. This error is likely caused by a bug in React. Please file an issue.\"\n                );\n            }\n          var next = nextEffect.nextEffect;\n          nextEffect.nextEffect = null;\n          nextEffect = next;\n        }\n      } catch (e) {\n        (effectTag = !0), (current = e);\n      }\n      effectTag &&\n        (invariant(\n          null !== nextEffect,\n          \"Should have next effect. This error is likely caused by a bug in React. Please file an issue.\"\n        ),\n        captureError(nextEffect, current),\n        null !== nextEffect && (nextEffect = nextEffect.nextEffect));\n    }\n    isWorking = isCommitting = !1;\n    \"function\" === typeof onCommitRoot && onCommitRoot(finishedWork.stateNode);\n    commitPhaseBoundaries &&\n      (commitPhaseBoundaries.forEach(scheduleErrorRecovery),\n      (commitPhaseBoundaries = null));\n    null !== firstUncaughtError &&\n      ((finishedWork = firstUncaughtError),\n      (firstUncaughtError = null),\n      onUncaughtError(finishedWork));\n    finishedWork = expirationTime.current.expirationTime;\n    0 === finishedWork && (failedBoundaries = capturedErrors = null);\n    root.remainingExpirationTime = finishedWork;\n  }\n  function shouldYield() {\n    return null === deadline ||\n      deadline.timeRemaining() > timeHeuristicForUnitOfWork\n      ? !1\n      : (deadlineDidExpire = !0);\n  }\n  function onUncaughtError(error) {\n    invariant(\n      null !== nextFlushedRoot,\n      \"Should be working on a root. This error is likely caused by a bug in React. Please file an issue.\"\n    );\n    nextFlushedRoot.remainingExpirationTime = 0;\n    hasUnhandledError || ((hasUnhandledError = !0), (unhandledError = error));\n  }\n  var hostContext = ReactFiberHostContext(config),\n    hydrationContext = ReactFiberHydrationContext(config),\n    popHostContainer = hostContext.popHostContainer,\n    popHostContext = hostContext.popHostContext,\n    resetHostContainer = hostContext.resetHostContainer,\n    _ReactFiberBeginWork = ReactFiberBeginWork(\n      config,\n      hostContext,\n      hydrationContext,\n      scheduleWork,\n      computeExpirationForFiber\n    ),\n    beginWork = _ReactFiberBeginWork.beginWork,\n    beginFailedWork = _ReactFiberBeginWork.beginFailedWork,\n    completeWork = ReactFiberCompleteWork(config, hostContext, hydrationContext)\n      .completeWork;\n  hostContext = ReactFiberCommitWork(config, captureError);\n  var commitResetTextContent = hostContext.commitResetTextContent,\n    commitPlacement = hostContext.commitPlacement,\n    commitDeletion = hostContext.commitDeletion,\n    commitWork = hostContext.commitWork,\n    commitLifeCycles = hostContext.commitLifeCycles,\n    commitAttachRef = hostContext.commitAttachRef,\n    commitDetachRef = hostContext.commitDetachRef,\n    now = config.now,\n    scheduleDeferredCallback = config.scheduleDeferredCallback,\n    cancelDeferredCallback = config.cancelDeferredCallback,\n    useSyncScheduling = config.useSyncScheduling,\n    prepareForCommit = config.prepareForCommit,\n    resetAfterCommit = config.resetAfterCommit,\n    startTime = now(),\n    mostRecentCurrentTime = 2,\n    lastUniqueAsyncExpiration = 0,\n    expirationContext = 0,\n    isWorking = !1,\n    nextUnitOfWork = null,\n    nextRoot = null,\n    nextRenderExpirationTime = 0,\n    nextEffect = null,\n    capturedErrors = null,\n    failedBoundaries = null,\n    commitPhaseBoundaries = null,\n    firstUncaughtError = null,\n    didFatal = !1,\n    isCommitting = !1,\n    isUnmounting = !1,\n    firstScheduledRoot = null,\n    lastScheduledRoot = null,\n    callbackExpirationTime = 0,\n    callbackID = -1,\n    isRendering = !1,\n    nextFlushedRoot = null,\n    nextFlushedExpirationTime = 0,\n    deadlineDidExpire = !1,\n    hasUnhandledError = !1,\n    unhandledError = null,\n    deadline = null,\n    isBatchingUpdates = !1,\n    isUnbatchingUpdates = !1,\n    completedBatches = null,\n    NESTED_UPDATE_LIMIT = 1e3,\n    nestedUpdateCount = 0,\n    timeHeuristicForUnitOfWork = 1;\n  return {\n    computeAsyncExpiration: computeAsyncExpiration,\n    computeExpirationForFiber: computeExpirationForFiber,\n    scheduleWork: scheduleWork,\n    requestWork: requestWork,\n    flushRoot: function(root, expirationTime) {\n      invariant(\n        !isRendering,\n        \"work.commit(): Cannot commit while already rendering. This likely means you attempted to commit from inside a lifecycle method.\"\n      );\n      performWorkOnRoot(root, expirationTime, expirationTime);\n      finishRendering();\n    },\n    batchedUpdates: function(fn, a) {\n      var previousIsBatchingUpdates = isBatchingUpdates;\n      isBatchingUpdates = !0;\n      try {\n        return fn(a);\n      } finally {\n        (isBatchingUpdates = previousIsBatchingUpdates) ||\n          isRendering ||\n          performWork(1, null);\n      }\n    },\n    unbatchedUpdates: function(fn) {\n      if (isBatchingUpdates && !isUnbatchingUpdates) {\n        isUnbatchingUpdates = !0;\n        try {\n          return fn();\n        } finally {\n          isUnbatchingUpdates = !1;\n        }\n      }\n      return fn();\n    },\n    flushSync: function(fn) {\n      var previousIsBatchingUpdates = isBatchingUpdates;\n      isBatchingUpdates = !0;\n      try {\n        a: {\n          var previousExpirationContext = expirationContext;\n          expirationContext = 1;\n          try {\n            var JSCompiler_inline_result = fn();\n            break a;\n          } finally {\n            expirationContext = previousExpirationContext;\n          }\n          JSCompiler_inline_result = void 0;\n        }\n        return JSCompiler_inline_result;\n      } finally {\n        (isBatchingUpdates = previousIsBatchingUpdates),\n          invariant(\n            !isRendering,\n            \"flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.\"\n          ),\n          performWork(1, null);\n      }\n    },\n    deferredUpdates: function(fn) {\n      var previousExpirationContext = expirationContext;\n      expirationContext = computeAsyncExpiration();\n      try {\n        return fn();\n      } finally {\n        expirationContext = previousExpirationContext;\n      }\n    },\n    computeUniqueAsyncExpiration: function() {\n      var result = computeAsyncExpiration();\n      result <= lastUniqueAsyncExpiration &&\n        (result = lastUniqueAsyncExpiration + 1);\n      return (lastUniqueAsyncExpiration = result);\n    }\n  };\n}\nfunction ReactFiberReconciler$1(config) {\n  function updateContainerAtExpirationTime(\n    element,\n    container,\n    parentComponent,\n    expirationTime,\n    callback\n  ) {\n    var current = container.current;\n    if (parentComponent) {\n      parentComponent = parentComponent._reactInternalFiber;\n      var parentContext;\n      b: {\n        invariant(\n          2 === isFiberMountedImpl(parentComponent) &&\n            2 === parentComponent.tag,\n          \"Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.\"\n        );\n        for (parentContext = parentComponent; 3 !== parentContext.tag; ) {\n          if (isContextProvider(parentContext)) {\n            parentContext =\n              parentContext.stateNode.__reactInternalMemoizedMergedChildContext;\n            break b;\n          }\n          parentContext = parentContext[\"return\"];\n          invariant(\n            parentContext,\n            \"Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.\"\n          );\n        }\n        parentContext = parentContext.stateNode.context;\n      }\n      parentComponent = isContextProvider(parentComponent)\n        ? processChildContext(parentComponent, parentContext)\n        : parentContext;\n    } else parentComponent = emptyObject;\n    null === container.context\n      ? (container.context = parentComponent)\n      : (container.pendingContext = parentComponent);\n    container = callback;\n    insertUpdateIntoFiber(current, {\n      expirationTime: expirationTime,\n      partialState: { element: element },\n      callback: void 0 === container ? null : container,\n      isReplace: !1,\n      isForced: !1,\n      next: null\n    });\n    scheduleWork(current, expirationTime);\n    return expirationTime;\n  }\n  function findHostInstance(fiber) {\n    fiber = findCurrentHostFiber(fiber);\n    return null === fiber ? null : fiber.stateNode;\n  }\n  var getPublicInstance = config.getPublicInstance;\n  config = ReactFiberScheduler(config);\n  var computeAsyncExpiration = config.computeAsyncExpiration,\n    computeExpirationForFiber = config.computeExpirationForFiber,\n    scheduleWork = config.scheduleWork;\n  return {\n    createContainer: function(containerInfo, hydrate) {\n      var uninitializedFiber = createFiber(3, null, 0);\n      containerInfo = {\n        current: uninitializedFiber,\n        containerInfo: containerInfo,\n        pendingChildren: null,\n        remainingExpirationTime: 0,\n        isReadyForCommit: !1,\n        finishedWork: null,\n        context: null,\n        pendingContext: null,\n        hydrate: hydrate,\n        firstBatch: null,\n        nextScheduledRoot: null\n      };\n      return (uninitializedFiber.stateNode = containerInfo);\n    },\n    updateContainer: function(element, container, parentComponent, callback) {\n      var current = container.current;\n      current =\n        null != element &&\n        null != element.type &&\n        null != element.type.prototype &&\n        !0 === element.type.prototype.unstable_isAsyncReactComponent\n          ? computeAsyncExpiration()\n          : computeExpirationForFiber(current);\n      return updateContainerAtExpirationTime(\n        element,\n        container,\n        parentComponent,\n        current,\n        callback\n      );\n    },\n    updateContainerAtExpirationTime: updateContainerAtExpirationTime,\n    flushRoot: config.flushRoot,\n    requestWork: config.requestWork,\n    computeUniqueAsyncExpiration: config.computeUniqueAsyncExpiration,\n    batchedUpdates: config.batchedUpdates,\n    unbatchedUpdates: config.unbatchedUpdates,\n    deferredUpdates: config.deferredUpdates,\n    flushSync: config.flushSync,\n    getPublicRootInstance: function(container) {\n      container = container.current;\n      if (!container.child) return null;\n      switch (container.child.tag) {\n        case 5:\n          return getPublicInstance(container.child.stateNode);\n        default:\n          return container.child.stateNode;\n      }\n    },\n    findHostInstance: findHostInstance,\n    findHostInstanceWithNoPortals: function(fiber) {\n      fiber = findCurrentHostFiberWithNoPortals(fiber);\n      return null === fiber ? null : fiber.stateNode;\n    },\n    injectIntoDevTools: function(devToolsConfig) {\n      var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;\n      return injectInternals(\n        Object.assign({}, devToolsConfig, {\n          findHostInstanceByFiber: function(fiber) {\n            return findHostInstance(fiber);\n          },\n          findFiberByHostInstance: function(instance) {\n            return findFiberByHostInstance\n              ? findFiberByHostInstance(instance)\n              : null;\n          }\n        })\n      );\n    }\n  };\n}\nvar ReactFiberReconciler$2 = Object.freeze({ default: ReactFiberReconciler$1 }),\n  ReactFiberReconciler$3 =\n    (ReactFiberReconciler$2 && ReactFiberReconciler$1) ||\n    ReactFiberReconciler$2,\n  reactReconciler = ReactFiberReconciler$3[\"default\"]\n    ? ReactFiberReconciler$3[\"default\"]\n    : ReactFiberReconciler$3,\n  viewConfigCallbacks = new Map(),\n  viewConfigs = new Map(),\n  ReactNativeFiberHostComponent = (function() {\n    function ReactNativeFiberHostComponent(tag, viewConfig) {\n      if (!(this instanceof ReactNativeFiberHostComponent))\n        throw new TypeError(\"Cannot call a class as a function\");\n      this._nativeTag = tag;\n      this._children = [];\n      this.viewConfig = viewConfig;\n    }\n    ReactNativeFiberHostComponent.prototype.blur = function() {\n      TextInputState.blurTextInput(this._nativeTag);\n    };\n    ReactNativeFiberHostComponent.prototype.focus = function() {\n      TextInputState.focusTextInput(this._nativeTag);\n    };\n    ReactNativeFiberHostComponent.prototype.measure = function(callback) {\n      UIManager.measure(this._nativeTag, mountSafeCallback(this, callback));\n    };\n    ReactNativeFiberHostComponent.prototype.measureInWindow = function(\n      callback\n    ) {\n      UIManager.measureInWindow(\n        this._nativeTag,\n        mountSafeCallback(this, callback)\n      );\n    };\n    ReactNativeFiberHostComponent.prototype.measureLayout = function(\n      relativeToNativeNode,\n      onSuccess,\n      onFail\n    ) {\n      UIManager.measureLayout(\n        this._nativeTag,\n        relativeToNativeNode,\n        mountSafeCallback(this, onFail),\n        mountSafeCallback(this, onSuccess)\n      );\n    };\n    ReactNativeFiberHostComponent.prototype.setNativeProps = function(\n      nativeProps\n    ) {\n      nativeProps = diffProperties(\n        null,\n        emptyObject$1,\n        nativeProps,\n        this.viewConfig.validAttributes\n      );\n      null != nativeProps &&\n        UIManager.updateView(\n          this._nativeTag,\n          this.viewConfig.uiViewClassName,\n          nativeProps\n        );\n    };\n    return ReactNativeFiberHostComponent;\n  })(),\n  now =\n    \"object\" === typeof performance && \"function\" === typeof performance.now\n      ? function() {\n          return performance.now();\n        }\n      : function() {\n          return Date.now();\n        },\n  scheduledCallback = null,\n  frameDeadline = 0,\n  frameDeadlineObject = {\n    timeRemaining: function() {\n      return frameDeadline - now();\n    }\n  };\nfunction setTimeoutCallback() {\n  frameDeadline = now() + 5;\n  var callback = scheduledCallback;\n  scheduledCallback = null;\n  null !== callback && callback(frameDeadlineObject);\n}\nfunction recursivelyUncacheFiberNode(node) {\n  \"number\" === typeof node\n    ? uncacheFiberNode(node)\n    : (uncacheFiberNode(node._nativeTag),\n      node._children.forEach(recursivelyUncacheFiberNode));\n}\nvar NativeRenderer = reactReconciler({\n  appendInitialChild: function(parentInstance, child) {\n    parentInstance._children.push(child);\n  },\n  createInstance: function(\n    type,\n    props,\n    rootContainerInstance,\n    hostContext,\n    internalInstanceHandle\n  ) {\n    hostContext = ReactNativeTagHandles.allocateTag();\n    if (viewConfigs.has(type)) var viewConfig = viewConfigs.get(type);\n    else\n      (viewConfig = viewConfigCallbacks.get(type)),\n        invariant(\n          \"function\" === typeof viewConfig,\n          \"View config not found for name %s\",\n          type\n        ),\n        viewConfigCallbacks.set(type, null),\n        (viewConfig = viewConfig()),\n        viewConfigs.set(type, viewConfig);\n    invariant(viewConfig, \"View config not found for name %s\", type);\n    type = viewConfig;\n    viewConfig = diffProperties(\n      null,\n      emptyObject$1,\n      props,\n      type.validAttributes\n    );\n    UIManager.createView(\n      hostContext,\n      type.uiViewClassName,\n      rootContainerInstance,\n      viewConfig\n    );\n    rootContainerInstance = new ReactNativeFiberHostComponent(\n      hostContext,\n      type\n    );\n    instanceCache[hostContext] = internalInstanceHandle;\n    instanceProps[hostContext] = props;\n    return rootContainerInstance;\n  },\n  createTextInstance: function(\n    text,\n    rootContainerInstance,\n    hostContext,\n    internalInstanceHandle\n  ) {\n    hostContext = ReactNativeTagHandles.allocateTag();\n    UIManager.createView(hostContext, \"RCTRawText\", rootContainerInstance, {\n      text: text\n    });\n    instanceCache[hostContext] = internalInstanceHandle;\n    return hostContext;\n  },\n  finalizeInitialChildren: function(parentInstance) {\n    if (0 === parentInstance._children.length) return !1;\n    var nativeTags = parentInstance._children.map(function(child) {\n      return \"number\" === typeof child ? child : child._nativeTag;\n    });\n    UIManager.setChildren(parentInstance._nativeTag, nativeTags);\n    return !1;\n  },\n  getRootHostContext: function() {\n    return emptyObject;\n  },\n  getChildHostContext: function() {\n    return emptyObject;\n  },\n  getPublicInstance: function(instance) {\n    return instance;\n  },\n  now: now,\n  prepareForCommit: function() {},\n  prepareUpdate: function() {\n    return emptyObject;\n  },\n  resetAfterCommit: function() {},\n  scheduleDeferredCallback: function(callback) {\n    scheduledCallback = callback;\n    return setTimeout(setTimeoutCallback, 1);\n  },\n  cancelDeferredCallback: function(callbackID) {\n    scheduledCallback = null;\n    clearTimeout(callbackID);\n  },\n  shouldDeprioritizeSubtree: function() {\n    return !1;\n  },\n  shouldSetTextContent: function() {\n    return !1;\n  },\n  useSyncScheduling: !0,\n  mutation: {\n    appendChild: function(parentInstance, child) {\n      var childTag = \"number\" === typeof child ? child : child._nativeTag,\n        children = parentInstance._children,\n        index = children.indexOf(child);\n      0 <= index\n        ? (children.splice(index, 1),\n          children.push(child),\n          UIManager.manageChildren(\n            parentInstance._nativeTag,\n            [index],\n            [children.length - 1],\n            [],\n            [],\n            []\n          ))\n        : (children.push(child),\n          UIManager.manageChildren(\n            parentInstance._nativeTag,\n            [],\n            [],\n            [childTag],\n            [children.length - 1],\n            []\n          ));\n    },\n    appendChildToContainer: function(parentInstance, child) {\n      UIManager.setChildren(parentInstance, [\n        \"number\" === typeof child ? child : child._nativeTag\n      ]);\n    },\n    commitTextUpdate: function(textInstance, oldText, newText) {\n      UIManager.updateView(textInstance, \"RCTRawText\", { text: newText });\n    },\n    commitMount: function() {},\n    commitUpdate: function(\n      instance,\n      updatePayloadTODO,\n      type,\n      oldProps,\n      newProps\n    ) {\n      updatePayloadTODO = instance.viewConfig;\n      instanceProps[instance._nativeTag] = newProps;\n      oldProps = diffProperties(\n        null,\n        oldProps,\n        newProps,\n        updatePayloadTODO.validAttributes\n      );\n      null != oldProps &&\n        UIManager.updateView(\n          instance._nativeTag,\n          updatePayloadTODO.uiViewClassName,\n          oldProps\n        );\n    },\n    insertBefore: function(parentInstance, child, beforeChild) {\n      var children = parentInstance._children,\n        index = children.indexOf(child);\n      0 <= index\n        ? (children.splice(index, 1),\n          (beforeChild = children.indexOf(beforeChild)),\n          children.splice(beforeChild, 0, child),\n          UIManager.manageChildren(\n            parentInstance._nativeTag,\n            [index],\n            [beforeChild],\n            [],\n            [],\n            []\n          ))\n        : ((index = children.indexOf(beforeChild)),\n          children.splice(index, 0, child),\n          UIManager.manageChildren(\n            parentInstance._nativeTag,\n            [],\n            [],\n            [\"number\" === typeof child ? child : child._nativeTag],\n            [index],\n            []\n          ));\n    },\n    insertInContainerBefore: function(parentInstance) {\n      invariant(\n        \"number\" !== typeof parentInstance,\n        \"Container does not support insertBefore operation\"\n      );\n    },\n    removeChild: function(parentInstance, child) {\n      recursivelyUncacheFiberNode(child);\n      var children = parentInstance._children;\n      child = children.indexOf(child);\n      children.splice(child, 1);\n      UIManager.manageChildren(\n        parentInstance._nativeTag,\n        [],\n        [],\n        [],\n        [],\n        [child]\n      );\n    },\n    removeChildFromContainer: function(parentInstance, child) {\n      recursivelyUncacheFiberNode(child);\n      UIManager.manageChildren(parentInstance, [], [], [], [], [0]);\n    },\n    resetTextContent: function() {}\n  }\n});\nfunction findNodeHandle(componentOrHandle) {\n  if (null == componentOrHandle) return null;\n  if (\"number\" === typeof componentOrHandle) return componentOrHandle;\n  var internalInstance = componentOrHandle._reactInternalFiber;\n  if (internalInstance)\n    return NativeRenderer.findHostInstance(internalInstance);\n  if (componentOrHandle) return componentOrHandle;\n  invariant(\n    (\"object\" === typeof componentOrHandle &&\n      \"_nativeTag\" in componentOrHandle) ||\n      (null != componentOrHandle.render &&\n        \"function\" === typeof componentOrHandle.render),\n    \"findNodeHandle(...): Argument is not a component (type: %s, keys: %s)\",\n    typeof componentOrHandle,\n    Object.keys(componentOrHandle)\n  );\n  invariant(\n    !1,\n    \"findNodeHandle(...): Unable to find node handle for unmounted component.\"\n  );\n}\nfunction findNumericNodeHandleFiber(componentOrHandle) {\n  componentOrHandle = findNodeHandle(componentOrHandle);\n  return null == componentOrHandle || \"number\" === typeof componentOrHandle\n    ? componentOrHandle\n    : componentOrHandle._nativeTag;\n}\nfunction _inherits(subClass, superClass) {\n  if (\"function\" !== typeof superClass && null !== superClass)\n    throw new TypeError(\n      \"Super expression must either be null or a function, not \" +\n        typeof superClass\n    );\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      enumerable: !1,\n      writable: !0,\n      configurable: !0\n    }\n  });\n  superClass &&\n    (Object.setPrototypeOf\n      ? Object.setPrototypeOf(subClass, superClass)\n      : (subClass.__proto__ = superClass));\n}\nvar ReactNativeComponent = (function(_React$Component) {\n    function ReactNativeComponent() {\n      if (!(this instanceof ReactNativeComponent))\n        throw new TypeError(\"Cannot call a class as a function\");\n      var call = _React$Component.apply(this, arguments);\n      if (!this)\n        throw new ReferenceError(\n          \"this hasn't been initialised - super() hasn't been called\"\n        );\n      return !call || (\"object\" !== typeof call && \"function\" !== typeof call)\n        ? this\n        : call;\n    }\n    _inherits(ReactNativeComponent, _React$Component);\n    ReactNativeComponent.prototype.blur = function() {\n      TextInputState.blurTextInput(findNumericNodeHandleFiber(this));\n    };\n    ReactNativeComponent.prototype.focus = function() {\n      TextInputState.focusTextInput(findNumericNodeHandleFiber(this));\n    };\n    ReactNativeComponent.prototype.measure = function(callback) {\n      UIManager.measure(\n        findNumericNodeHandleFiber(this),\n        mountSafeCallback(this, callback)\n      );\n    };\n    ReactNativeComponent.prototype.measureInWindow = function(callback) {\n      UIManager.measureInWindow(\n        findNumericNodeHandleFiber(this),\n        mountSafeCallback(this, callback)\n      );\n    };\n    ReactNativeComponent.prototype.measureLayout = function(\n      relativeToNativeNode,\n      onSuccess,\n      onFail\n    ) {\n      UIManager.measureLayout(\n        findNumericNodeHandleFiber(this),\n        relativeToNativeNode,\n        mountSafeCallback(this, onFail),\n        mountSafeCallback(this, onSuccess)\n      );\n    };\n    ReactNativeComponent.prototype.setNativeProps = function(nativeProps) {\n      var maybeInstance = void 0;\n      try {\n        maybeInstance = findNodeHandle(this);\n      } catch (error) {}\n      if (null != maybeInstance) {\n        var viewConfig = maybeInstance.viewConfig;\n        nativeProps = diffProperties(\n          null,\n          emptyObject$1,\n          nativeProps,\n          viewConfig.validAttributes\n        );\n        null != nativeProps &&\n          UIManager.updateView(\n            maybeInstance._nativeTag,\n            viewConfig.uiViewClassName,\n            nativeProps\n          );\n      }\n    };\n    return ReactNativeComponent;\n  })(React.Component),\n  getInspectorDataForViewTag = void 0;\ngetInspectorDataForViewTag = function() {\n  invariant(!1, \"getInspectorDataForViewTag() is not available in production\");\n};\nfiberBatchedUpdates = NativeRenderer.batchedUpdates;\nvar roots = new Map();\nfunction fn$jscomp$inline_616(capturedError) {\n  var componentStack = capturedError.componentStack,\n    error = capturedError.error;\n  if (error instanceof Error) {\n    capturedError = error.message;\n    var name = error.name;\n    try {\n      error.message =\n        (capturedError ? name + \": \" + capturedError : name) +\n        \"\\n\\nThis error is located at:\" +\n        componentStack;\n    } catch (e) {}\n  } else\n    error =\n      \"string\" === typeof error\n        ? Error(error + \"\\n\\nThis error is located at:\" + componentStack)\n        : Error(\"Unspecified error at:\" + componentStack);\n  ExceptionsManager.handleException(error, !1);\n  return !1;\n}\ninvariant(\n  showDialog === defaultShowDialog,\n  \"The custom dialog was already injected.\"\n);\ninvariant(\n  \"function\" === typeof fn$jscomp$inline_616,\n  \"Injected showDialog() must be a function.\"\n);\nshowDialog = fn$jscomp$inline_616;\nvar ReactNativeRenderer = {\n  NativeComponent: ReactNativeComponent,\n  findNodeHandle: findNumericNodeHandleFiber,\n  render: function(element, containerTag, callback) {\n    var root = roots.get(containerTag);\n    root ||\n      ((root = NativeRenderer.createContainer(containerTag, !1)),\n      roots.set(containerTag, root));\n    NativeRenderer.updateContainer(element, root, null, callback);\n    return NativeRenderer.getPublicRootInstance(root);\n  },\n  unmountComponentAtNode: function(containerTag) {\n    var root = roots.get(containerTag);\n    root &&\n      NativeRenderer.updateContainer(null, root, null, function() {\n        roots[\"delete\"](containerTag);\n      });\n  },\n  unmountComponentAtNodeAndRemoveContainer: function(containerTag) {\n    ReactNativeRenderer.unmountComponentAtNode(containerTag);\n    UIManager.removeRootView(containerTag);\n  },\n  createPortal: function(children, containerTag) {\n    return createPortal(\n      children,\n      containerTag,\n      null,\n      2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null\n    );\n  },\n  unstable_batchedUpdates: batchedUpdates,\n  flushSync: NativeRenderer.flushSync,\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {\n    NativeMethodsMixin: {\n      measure: function(callback) {\n        UIManager.measure(\n          findNumericNodeHandleFiber(this),\n          mountSafeCallback(this, callback)\n        );\n      },\n      measureInWindow: function(callback) {\n        UIManager.measureInWindow(\n          findNumericNodeHandleFiber(this),\n          mountSafeCallback(this, callback)\n        );\n      },\n      measureLayout: function(relativeToNativeNode, onSuccess, onFail) {\n        UIManager.measureLayout(\n          findNumericNodeHandleFiber(this),\n          relativeToNativeNode,\n          mountSafeCallback(this, onFail),\n          mountSafeCallback(this, onSuccess)\n        );\n      },\n      setNativeProps: function(nativeProps) {\n        var maybeInstance = void 0;\n        try {\n          maybeInstance = findNodeHandle(this);\n        } catch (error) {}\n        if (null != maybeInstance) {\n          var viewConfig = maybeInstance.viewConfig;\n          nativeProps = diffProperties(\n            null,\n            emptyObject$1,\n            nativeProps,\n            viewConfig.validAttributes\n          );\n          null != nativeProps &&\n            UIManager.updateView(\n              maybeInstance._nativeTag,\n              viewConfig.uiViewClassName,\n              nativeProps\n            );\n        }\n      },\n      focus: function() {\n        TextInputState.focusTextInput(findNumericNodeHandleFiber(this));\n      },\n      blur: function() {\n        TextInputState.blurTextInput(findNumericNodeHandleFiber(this));\n      }\n    },\n    ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin,\n    ReactGlobalSharedState: ReactGlobalSharedState,\n    ReactNativeComponentTree: ReactNativeComponentTree,\n    ReactNativePropRegistry: ReactNativePropRegistry,\n    TouchHistoryMath: TouchHistoryMath,\n    createReactNativeComponentClass: function(name, callback) {\n      invariant(\n        !viewConfigCallbacks.has(name),\n        \"Tried to register two views with the same name %s\",\n        name\n      );\n      viewConfigCallbacks.set(name, callback);\n      return name;\n    },\n    takeSnapshot: function(view, options) {\n      \"number\" !== typeof view &&\n        \"window\" !== view &&\n        (view = findNumericNodeHandleFiber(view) || \"window\");\n      return UIManager.__takeSnapshot(view, options);\n    }\n  }\n};\nNativeRenderer.injectIntoDevTools({\n  findFiberByHostInstance: getInstanceFromTag,\n  getInspectorDataForViewTag: getInspectorDataForViewTag,\n  bundleType: 0,\n  version: \"16.2.0\",\n  rendererPackageName: \"react-native-renderer\"\n});\nvar ReactNativeRenderer$2 = Object.freeze({ default: ReactNativeRenderer }),\n  ReactNativeRenderer$3 =\n    (ReactNativeRenderer$2 && ReactNativeRenderer) || ReactNativeRenderer$2;\nmodule.exports = ReactNativeRenderer$3[\"default\"]\n  ? ReactNativeRenderer$3[\"default\"]\n  : ReactNativeRenderer$3;\n"
  },
  {
    "path": "Libraries/Renderer/shims/NativeMethodsMixin.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule NativeMethodsMixin\n * @flow\n */\n\n'use strict';\n\nconst {\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n} = require('ReactNative');\n\nimport type {NativeMethodsMixinType} from 'ReactNativeTypes';\n\nconst {NativeMethodsMixin} = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nmodule.exports = ((NativeMethodsMixin: any): $Exact<NativeMethodsMixinType>);\n"
  },
  {
    "path": "Libraries/Renderer/shims/ReactDebugTool.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule ReactDebugTool\n */\n\n'use strict';\n\nconst {\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n} = require('ReactNative');\n\nmodule.exports =\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactDebugTool;\n"
  },
  {
    "path": "Libraries/Renderer/shims/ReactFeatureFlags.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule ReactFeatureFlags\n */\n\n'use strict';\n\nvar ReactFeatureFlags = {\n  debugRenderPhaseSideEffects: false,\n};\n\nmodule.exports = ReactFeatureFlags;\n"
  },
  {
    "path": "Libraries/Renderer/shims/ReactGlobalSharedState.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule ReactGlobalSharedState\n */\n\n'use strict';\n\nconst {\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n} = require('ReactNative');\n\nmodule.exports =\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactGlobalSharedState;\n"
  },
  {
    "path": "Libraries/Renderer/shims/ReactNative.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule ReactNative\n * @flow\n */\n'use strict';\n\nimport type {ReactNativeType} from 'ReactNativeTypes';\n\nlet ReactNative;\n\nif (__DEV__) {\n  ReactNative = require('ReactNativeRenderer-dev');\n} else {\n  ReactNative = require('ReactNativeRenderer-prod');\n}\n\nmodule.exports = (ReactNative: ReactNativeType);\n"
  },
  {
    "path": "Libraries/Renderer/shims/ReactNativeBridgeEventPlugin.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule ReactNativeBridgeEventPlugin\n */\n\n'use strict';\n\nconst {\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n} = require('ReactNative');\n\nmodule.exports =\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactNativeBridgeEventPlugin;\n"
  },
  {
    "path": "Libraries/Renderer/shims/ReactNativeComponentTree.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule ReactNativeComponentTree\n * @flow\n */\n\n'use strict';\n\nconst {\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n} = require('ReactNative');\n\nmodule.exports =\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactNativeComponentTree;\n"
  },
  {
    "path": "Libraries/Renderer/shims/ReactNativePropRegistry.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule ReactNativePropRegistry\n * @flow\n */\n\n'use strict';\n\nconst {\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n} = require('ReactNative');\n\nmodule.exports =\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactNativePropRegistry;\n"
  },
  {
    "path": "Libraries/Renderer/shims/ReactNativeTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @providesModule ReactNativeTypes\n */\n\nexport type MeasureOnSuccessCallback = (\n  x: number,\n  y: number,\n  width: number,\n  height: number,\n  pageX: number,\n  pageY: number,\n) => void;\n\nexport type MeasureInWindowOnSuccessCallback = (\n  x: number,\n  y: number,\n  width: number,\n  height: number,\n) => void;\n\nexport type MeasureLayoutOnSuccessCallback = (\n  left: number,\n  top: number,\n  width: number,\n  height: number,\n) => void;\n\ntype BubblingEventType = {\n  phasedRegistrationNames: {\n    captured: string,\n    bubbled: string,\n  },\n};\n\ntype DirectEventType = {\n  registrationName: string,\n};\n\nexport type ReactNativeBaseComponentViewConfig = {\n  validAttributes: Object,\n  uiViewClassName: string,\n  bubblingEventTypes?: {[topLevelType: string]: BubblingEventType},\n  directEventTypes?: {[topLevelType: string]: DirectEventType},\n  propTypes?: Object,\n};\n\nexport type ViewConfigGetter = () => ReactNativeBaseComponentViewConfig;\n\n/**\n * This type keeps ReactNativeFiberHostComponent and NativeMethodsMixin in sync.\n * It can also provide types for ReactNative applications that use NMM or refs.\n */\nexport type NativeMethodsMixinType = {\n  blur(): void,\n  focus(): void,\n  measure(callback: MeasureOnSuccessCallback): void,\n  measureInWindow(callback: MeasureInWindowOnSuccessCallback): void,\n  measureLayout(\n    relativeToNativeNode: number,\n    onSuccess: MeasureLayoutOnSuccessCallback,\n    onFail: () => void,\n  ): void,\n  setNativeProps(nativeProps: Object): void,\n};\n\ntype ReactNativeBridgeEventPlugin = {\n  processEventTypes(viewConfig: ReactNativeBaseComponentViewConfig): void,\n};\n\ntype SecretInternalsType = {\n  NativeMethodsMixin: NativeMethodsMixinType,\n  createReactNativeComponentClass(\n    name: string,\n    callback: ViewConfigGetter,\n  ): any,\n  ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin,\n  ReactNativeComponentTree: any,\n  ReactNativePropRegistry: any,\n  // TODO (bvaughn) Decide which additional types to expose here?\n  // And how much information to fill in for the above types.\n};\n\n/**\n * Flat ReactNative renderer bundles are too big for Flow to parse efficiently.\n * Provide minimal Flow typing for the high-level RN API and call it a day.\n */\nexport type ReactNativeType = {\n  NativeComponent: any,\n  findNodeHandle(componentOrHandle: any): ?number,\n  render(\n    element: React$Element<any>,\n    containerTag: any,\n    callback: ?Function,\n  ): any,\n  unmountComponentAtNode(containerTag: number): any,\n  unmountComponentAtNodeAndRemoveContainer(containerTag: number): any,\n  unstable_batchedUpdates: any, // TODO (bvaughn) Add types\n\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType,\n};\n"
  },
  {
    "path": "Libraries/Renderer/shims/ReactPerf.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule ReactPerf\n */\n\n'use strict';\n\nconst {\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n} = require('ReactNative');\n\nmodule.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactPerf;\n"
  },
  {
    "path": "Libraries/Renderer/shims/ReactTypes.js",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @providesModule ReactTypes\n */\n\nexport type ReactNode =\n  | React$Element<any>\n  | ReactCall\n  | ReactReturn\n  | ReactPortal\n  | ReactText\n  | ReactFragment;\n\nexport type ReactFragment = ReactEmpty | Iterable<React$Node>;\n\nexport type ReactNodeList = ReactEmpty | React$Node;\n\nexport type ReactText = string | number;\n\nexport type ReactEmpty = null | void | boolean;\n\nexport type ReactCall = {\n  $$typeof: Symbol | number,\n  key: null | string,\n  children: any,\n  // This should be a more specific CallHandler\n  handler: (props: any, returns: Array<mixed>) => ReactNodeList,\n  props: any,\n};\n\nexport type ReactReturn = {\n  $$typeof: Symbol | number,\n  value: mixed,\n};\n\nexport type ReactPortal = {\n  $$typeof: Symbol | number,\n  key: null | string,\n  containerInfo: any,\n  children: ReactNodeList,\n  // TODO: figure out the API for cross-renderer implementation.\n  implementation: any,\n};\n"
  },
  {
    "path": "Libraries/Renderer/shims/TouchHistoryMath.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule TouchHistoryMath\n */\n\n'use strict';\n\nconst {\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n} = require('ReactNative');\n\nmodule.exports =\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.TouchHistoryMath;\n"
  },
  {
    "path": "Libraries/Renderer/shims/createReactNativeComponentClass.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule createReactNativeComponentClass\n * @flow\n */\n\n'use strict';\n\nconst {\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n} = require('ReactNative');\n\nmodule.exports =\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.createReactNativeComponentClass;\n"
  },
  {
    "path": "Libraries/Renderer/shims/takeSnapshot.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule takeSnapshot\n */\n\n'use strict';\n\nconst {\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n} = require('ReactNative');\n\nmodule.exports =\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.takeSnapshot;\n"
  },
  {
    "path": "Libraries/Sample/Sample.android.js",
    "content": "/**\n * Stub of Sample for Android.\n *\n * @providesModule Sample\n * @flow\n */\n'use strict';\n\nvar warning = require('fbjs/lib/warning');\n\nvar Sample = {\n  test: function() {\n    warning('Not yet implemented for Android.');\n  }\n};\n\nmodule.exports = Sample;\n"
  },
  {
    "path": "Libraries/Sample/Sample.h",
    "content": "#import <React/RCTBridgeModule.h>\n\n@interface Sample : NSObject <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "Libraries/Sample/Sample.ios.js",
    "content": "/**\n * @providesModule Sample\n * @flow\n */\n'use strict';\n\nvar NativeSample = require('NativeModules').Sample;\n\n/**\n * High-level docs for the Sample iOS API can be written here.\n */\n\nvar Sample = {\n  test: function() {\n    NativeSample.test();\n  }\n};\n\nmodule.exports = Sample;\n"
  },
  {
    "path": "Libraries/Sample/Sample.m",
    "content": "#import \"Sample.h\"\n\n@implementation Sample\n\nRCT_EXPORT_MODULE()\n\nRCT_EXPORT_METHOD(test)\n{\n  // Your implementation here\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Sample/Sample.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t13BE3DEE1AC21097009241FE /* Sample.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* Sample.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t58B511D91A9E6C8500147676 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/$(PRODUCT_NAME)\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t134814201AA4EA6300B7C361 /* libSample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSample.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13BE3DEC1AC21097009241FE /* Sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Sample.h; sourceTree = \"<group>\"; };\n\t\t13BE3DED1AC21097009241FE /* Sample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Sample.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t58B511D81A9E6C8500147676 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t134814211AA4EA7D00B7C361 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134814201AA4EA6300B7C361 /* libSample.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58B511D21A9E6C8500147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13BE3DEC1AC21097009241FE /* Sample.h */,\n\t\t\t\t13BE3DED1AC21097009241FE /* Sample.m */,\n\t\t\t\t134814211AA4EA7D00B7C361 /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t58B511DA1A9E6C8500147676 /* Sample */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"Sample\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t58B511D71A9E6C8500147676 /* Sources */,\n\t\t\t\t58B511D81A9E6C8500147676 /* Frameworks */,\n\t\t\t\t58B511D91A9E6C8500147676 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = Sample;\n\t\t\tproductName = RCTDataManager;\n\t\t\tproductReference = 134814201AA4EA6300B7C361 /* libSample.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511D31A9E6C8500147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t58B511DA1A9E6C8500147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"Sample\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511D21A9E6C8500147676;\n\t\t\tproductRefGroup = 58B511D21A9E6C8500147676;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B511DA1A9E6C8500147676 /* Sample */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t58B511D71A9E6C8500147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13BE3DEE1AC21097009241FE /* Sample.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t58B511ED1A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511EE1A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511F01A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,\n\t\t\t\t\t\"$(SRCROOT)/../../React/**\",\n\t\t\t\t\t\"$(SRCROOT)/../../node_modules/react-native-macos/React/**\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = Sample;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511F11A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,\n\t\t\t\t\t\"$(SRCROOT)/../../React/**\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = Sample;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"Sample\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511ED1A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511EE1A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"Sample\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511F01A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511F11A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511D31A9E6C8500147676 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/Sample/package.json",
    "content": "{\n  \"name\": \"Sample\",\n  \"version\": \"0.0.1\",\n  \"keywords\": \"react-native\"\n}\n"
  },
  {
    "path": "Libraries/Settings/RCTSettings.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t13DBA45E1AEE749000A17CF8 /* RCTSettingsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DBA45D1AEE749000A17CF8 /* RCTSettingsManager.m */; };\n\t\t2D3B5F2C1D9B0ECA00451313 /* RCTSettingsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DBA45D1AEE749000A17CF8 /* RCTSettingsManager.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t134814201AA4EA6300B7C361 /* libRCTSettings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTSettings.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13DBA45C1AEE749000A17CF8 /* RCTSettingsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSettingsManager.h; sourceTree = \"<group>\"; };\n\t\t13DBA45D1AEE749000A17CF8 /* RCTSettingsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSettingsManager.m; sourceTree = \"<group>\"; };\n\t\t2D2A28611D9B046600D4039D /* libRCTSettings-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libRCTSettings-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n/* End PBXFileReference section */\n\n/* Begin PBXGroup section */\n\t\t134814211AA4EA7D00B7C361 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134814201AA4EA6300B7C361 /* libRCTSettings.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58B511D21A9E6C8500147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13DBA45C1AEE749000A17CF8 /* RCTSettingsManager.h */,\n\t\t\t\t13DBA45D1AEE749000A17CF8 /* RCTSettingsManager.m */,\n\t\t\t\t134814211AA4EA7D00B7C361 /* Products */,\n\t\t\t\t2D2A28611D9B046600D4039D /* libRCTSettings-tvOS.a */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t2D2A28601D9B046600D4039D /* RCTSettings-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D2A28691D9B046600D4039D /* Build configuration list for PBXNativeTarget \"RCTSettings-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2D2A285D1D9B046600D4039D /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"RCTSettings-tvOS\";\n\t\t\tproductName = \"RCTSettings-tvOS\";\n\t\t\tproductReference = 2D2A28611D9B046600D4039D /* libRCTSettings-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t58B511DA1A9E6C8500147676 /* RCTSettings */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTSettings\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t58B511D71A9E6C8500147676 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTSettings;\n\t\t\tproductName = RCTDataManager;\n\t\t\tproductReference = 134814201AA4EA6300B7C361 /* libRCTSettings.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511D31A9E6C8500147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t2D2A28601D9B046600D4039D = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t58B511DA1A9E6C8500147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTSettings\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511D21A9E6C8500147676;\n\t\t\tproductRefGroup = 58B511D21A9E6C8500147676;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B511DA1A9E6C8500147676 /* RCTSettings */,\n\t\t\t\t2D2A28601D9B046600D4039D /* RCTSettings-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t2D2A285D1D9B046600D4039D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D3B5F2C1D9B0ECA00451313 /* RCTSettingsManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t58B511D71A9E6C8500147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13DBA45E1AEE749000A17CF8 /* RCTSettingsManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t2D2A28671D9B046600D4039D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D2A28681D9B046600D4039D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511ED1A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n                MACOSX_DEPLOYMENT_TARGET = 10.10;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511EE1A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n                MACOSX_DEPLOYMENT_TARGET = 10.10;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511F01A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTSettings;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511F11A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTSettings;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t2D2A28691D9B046600D4039D /* Build configuration list for PBXNativeTarget \"RCTSettings-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D2A28671D9B046600D4039D /* Debug */,\n\t\t\t\t2D2A28681D9B046600D4039D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTSettings\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511ED1A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511EE1A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTSettings\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511F01A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511F11A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511D31A9E6C8500147676 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/Settings/RCTSettingsManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridgeModule.h>\n\n@interface RCTSettingsManager : NSObject <RCTBridgeModule>\n\n- (instancetype)initWithUserDefaults:(NSUserDefaults *)defaults NS_DESIGNATED_INITIALIZER;\n\n@end\n"
  },
  {
    "path": "Libraries/Settings/RCTSettingsManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSettingsManager.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTUtils.h>\n\n@implementation RCTSettingsManager\n{\n  BOOL _ignoringUpdates;\n  NSUserDefaults *_defaults;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return NO;\n}\n\n- (instancetype)init\n{\n  return [self initWithUserDefaults:[NSUserDefaults standardUserDefaults]];\n}\n\n- (instancetype)initWithUserDefaults:(NSUserDefaults *)defaults\n{\n  if ((self = [super init])) {\n    _defaults = defaults;\n\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(userDefaultsDidChange:)\n                                                 name:NSUserDefaultsDidChangeNotification\n                                               object:_defaults];\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  return @{@\"settings\": RCTJSONClean([_defaults dictionaryRepresentation])};\n}\n\n- (void)userDefaultsDidChange:(NSNotification *)note\n{\n  if (_ignoringUpdates) {\n    return;\n  }\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n  [_bridge.eventDispatcher\n   sendDeviceEventWithName:@\"settingsUpdated\"\n   body:RCTJSONClean([_defaults dictionaryRepresentation])];\n#pragma clang diagnostic pop\n}\n\n/**\n * Set one or more values in the settings.\n * TODO: would it be useful to have a callback for when this has completed?\n */\nRCT_EXPORT_METHOD(setValues:(NSDictionary *)values)\n{\n  _ignoringUpdates = YES;\n  [values enumerateKeysAndObjectsUsingBlock:^(NSString *key, id json, BOOL *stop) {\n    id plist = [RCTConvert NSPropertyList:json];\n    if (plist) {\n      [self->_defaults setObject:plist forKey:key];\n    } else {\n      [self->_defaults removeObjectForKey:key];\n    }\n  }];\n\n  [_defaults synchronize];\n  _ignoringUpdates = NO;\n}\n\n/**\n * Remove some values from the settings.\n */\nRCT_EXPORT_METHOD(deleteValues:(NSArray<NSString *> *)keys)\n{\n  _ignoringUpdates = YES;\n  for (NSString *key in keys) {\n    [_defaults removeObjectForKey:key];\n  }\n\n  [_defaults synchronize];\n  _ignoringUpdates = NO;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Settings/Settings.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Settings\n * @flow\n */\n'use strict';\n\nvar Settings = {\n  get(key: string): mixed {\n    console.warn('Settings is not yet supported on Android');\n    return null;\n  },\n\n  set(settings: Object) {\n    console.warn('Settings is not yet supported on Android');\n  },\n\n  watchKeys(keys: string | Array<string>, callback: Function): number {\n    console.warn('Settings is not yet supported on Android');\n    return -1;\n  },\n\n  clearWatch(watchId: number) {\n    console.warn('Settings is not yet supported on Android');\n  },\n};\n\nmodule.exports = Settings;\n"
  },
  {
    "path": "Libraries/Settings/Settings.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Settings\n * @flow\n */\n'use strict';\n\nvar RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\nvar RCTSettingsManager = require('NativeModules').SettingsManager;\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar subscriptions: Array<{keys: Array<string>, callback: ?Function}> = [];\n\nvar Settings = {\n  _settings: RCTSettingsManager && RCTSettingsManager.settings,\n\n  get(key: string): mixed {\n    return this._settings[key];\n  },\n\n  set(settings: Object) {\n    this._settings = Object.assign(this._settings, settings);\n    RCTSettingsManager.setValues(settings);\n  },\n\n  watchKeys(keys: string | Array<string>, callback: Function): number {\n    if (typeof keys === 'string') {\n      keys = [keys];\n    }\n\n    invariant(\n      Array.isArray(keys),\n      'keys should be a string or array of strings'\n    );\n\n    var sid = subscriptions.length;\n    subscriptions.push({keys: keys, callback: callback});\n    return sid;\n  },\n\n  clearWatch(watchId: number) {\n    if (watchId < subscriptions.length) {\n      subscriptions[watchId] = {keys: [], callback: null};\n    }\n  },\n\n  _sendObservations(body: Object) {\n    Object.keys(body).forEach((key) => {\n      var newValue = body[key];\n      var didChange = this._settings[key] !== newValue;\n      this._settings[key] = newValue;\n\n      if (didChange) {\n        subscriptions.forEach((sub) => {\n          if (sub.keys.indexOf(key) !== -1 && sub.callback) {\n            sub.callback();\n          }\n        });\n      }\n    });\n  },\n};\n\nRCTDeviceEventEmitter.addListener(\n  'settingsUpdated',\n  Settings._sendObservations.bind(Settings)\n);\n\nmodule.exports = Settings;\n"
  },
  {
    "path": "Libraries/Settings/Settings.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Settings\n * @flow\n */\n'use strict';\n\nvar RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\n\nvar RCTSettingsManager = require('NativeModules').SettingsManager;\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar subscriptions: Array<{ keys: Array<string>, callback: ?Function }> = [];\n\nvar Settings = {\n  _settings: RCTSettingsManager && RCTSettingsManager.settings,\n\n  get(key: string): mixed {\n    return this._settings && this._settings[key];\n  },\n\n  set(settings: Object) {\n    if (this._settings) {\n      this._settings = Object.assign(this._settings, settings);\n      RCTSettingsManager.setValues(settings);\n    }\n  },\n\n  watchKeys(keys: string | Array<string>, callback: Function): number {\n    if (typeof keys === 'string') {\n      keys = [keys];\n    }\n\n    invariant(\n      Array.isArray(keys),\n      'keys should be a string or array of strings'\n    );\n\n    var sid = subscriptions.length;\n    subscriptions.push({ keys: keys, callback: callback });\n    return sid;\n  },\n\n  clearWatch(watchId: number) {\n    if (watchId < subscriptions.length) {\n      subscriptions[watchId] = { keys: [], callback: null };\n    }\n  },\n\n  _sendObservations(body: Object) {\n    Object.keys(body).forEach(key => {\n      var newValue = body[key];\n      var didChange = this._settings[key] !== newValue;\n      this._settings[key] = newValue;\n\n      if (didChange) {\n        subscriptions.forEach(sub => {\n          if (sub.keys.indexOf(key) !== -1 && sub.callback) {\n            sub.callback();\n          }\n        });\n      }\n    });\n  },\n};\n\nRCTDeviceEventEmitter.addListener(\n  'settingsUpdated',\n  Settings._sendObservations.bind(Settings)\n);\n\nmodule.exports = Settings;\n"
  },
  {
    "path": "Libraries/Share/Share.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Share\n * @flow\n */\n'use strict';\n\nconst Platform = require('Platform');\n\nconst invariant = require('fbjs/lib/invariant');\nconst processColor = require('processColor');\n\nconst {\n  ActionSheetManager,\n  ShareModule\n} = require('NativeModules');\n\ntype Content = { title?: string, message: string } | { title?: string, url: string };\ntype Options = {\n  dialogTitle?: string,\n  excludedActivityTypes?: Array<string>,\n  tintColor?: string,\n  subject?: string\n};\n\nclass Share {\n\n  /**\n   * Open a dialog to share text content.\n   *\n   * In iOS, Returns a Promise which will be invoked an object containing `action`, `activityType`.\n   * If the user dismissed the dialog, the Promise will still be resolved with action being `Share.dismissedAction`\n   * and all the other keys being undefined.\n   *\n   * In Android, Returns a Promise which always be resolved with action being `Share.sharedAction`.\n   *\n   * ### Content\n   *\n   *  - `message` - a message to share\n   *  - `title` - title of the message\n   *\n   * #### iOS\n   *\n   *  - `url` - an URL to share\n   *\n   * At least one of URL and message is required.\n   *\n   * ### Options\n   *\n   * #### iOS\n   *\n   *  - `subject` - a subject to share via email\n   *  - `excludedActivityTypes`\n   *  - `tintColor`\n   *\n   * #### Android\n   *\n   *  - `dialogTitle`\n   *\n   */\n  static share(content: Content, options: Options = {}): 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\n    if (Platform.OS === 'android') {\n      invariant(\n        !content.title || typeof content.title === 'string',\n        'Invalid title: title should be a string.'\n      );\n      return ShareModule.share(content, options.dialogTitle);\n    } else if (Platform.OS === 'ios') {\n      return new Promise((resolve, reject) => {\n        ActionSheetManager.showShareActionSheetWithOptions(\n          {...content, ...options, tintColor: processColor(options.tintColor)},\n          (error) => reject(error),\n          (success, activityType) => {\n            if (success) {\n              resolve({\n                'action': 'sharedAction',\n                'activityType': activityType\n              });\n            } else {\n              resolve({\n                'action': 'dismissedAction'\n              });\n            }\n          }\n        );\n      });\n    } else {\n      return Promise.reject(new Error('Unsupported platform'));\n    }\n  }\n\n  /**\n   * The content was successfully shared.\n   */\n  static get sharedAction(): string { return 'sharedAction'; }\n\n  /**\n   * The dialog has been dismissed.\n   * @platform ios\n   */\n  static get dismissedAction(): string { return 'dismissedAction'; }\n\n}\n\nmodule.exports = Share;\n"
  },
  {
    "path": "Libraries/Storage/AsyncStorage.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AsyncStorage\n * @noflow\n * @flow-weak\n * @jsdoc\n */\n'use strict';\n\nconst NativeModules = require('NativeModules');\n\n// Use RocksDB if available, then SQLite, then file storage.\nconst RCTAsyncStorage = NativeModules.AsyncRocksDBStorage ||\n  NativeModules.AsyncSQLiteDBStorage ||\n  NativeModules.AsyncLocalStorage;\n\n/**\n * `AsyncStorage` is a simple, unencrypted, asynchronous, persistent, key-value\n * storage system that is global to the app.  It should be used instead of \n * LocalStorage.\n * \n * See http://facebook.github.io/react-native/docs/asyncstorage.html\n */\nvar AsyncStorage = {\n  _getRequests: ([]: Array<any>),\n  _getKeys: ([]: Array<string>),\n  _immediate: (null: ?number),\n\n  /**\n   * Fetches an item for a `key` and invokes a callback upon completion.\n   * \n   * See http://facebook.github.io/react-native/docs/asyncstorage.html#getitem\n   */\n  getItem: function(\n    key: string,\n    callback?: ?(error: ?Error, result: ?string) => void\n  ): Promise {\n    return new Promise((resolve, reject) => {\n      RCTAsyncStorage.multiGet([key], function(errors, result) {\n        // Unpack result to get value from [[key,value]]\n        var value = (result && result[0] && result[0][1]) ? result[0][1] : null;\n        var errs = convertErrors(errors);\n        callback && callback(errs && errs[0], value);\n        if (errs) {\n          reject(errs[0]);\n        } else {\n          resolve(value);\n        }\n      });\n    });\n  },\n\n  /**\n   * Sets the value for a `key` and invokes a callback upon completion.\n   * \n   * See http://facebook.github.io/react-native/docs/asyncstorage.html#setitem\n   */\n  setItem: function(\n    key: string,\n    value: string,\n    callback?: ?(error: ?Error) => void\n  ): Promise {\n    return new Promise((resolve, reject) => {\n      RCTAsyncStorage.multiSet([[key,value]], function(errors) {\n        var errs = convertErrors(errors);\n        callback && callback(errs && errs[0]);\n        if (errs) {\n          reject(errs[0]);\n        } else {\n          resolve(null);\n        }\n      });\n    });\n  },\n\n  /**\n   * Removes an item for a `key` and invokes a callback upon completion.\n   * \n   * See http://facebook.github.io/react-native/docs/asyncstorage.html#removeitem\n   */\n  removeItem: function(\n    key: string,\n    callback?: ?(error: ?Error) => void\n  ): Promise {\n    return new Promise((resolve, reject) => {\n      RCTAsyncStorage.multiRemove([key], function(errors) {\n        var errs = convertErrors(errors);\n        callback && callback(errs && errs[0]);\n        if (errs) {\n          reject(errs[0]);\n        } else {\n          resolve(null);\n        }\n      });\n    });\n  },\n\n  /**\n   * Merges an existing `key` value with an input value, assuming both values\n   * are stringified JSON.\n   *\n   * **NOTE:** This is not supported by all native implementations.\n   *\n   * See http://facebook.github.io/react-native/docs/asyncstorage.html#mergeitem\n   */\n  mergeItem: function(\n    key: string,\n    value: string,\n    callback?: ?(error: ?Error) => void\n  ): Promise {\n    return new Promise((resolve, reject) => {\n      RCTAsyncStorage.multiMerge([[key,value]], function(errors) {\n        var errs = convertErrors(errors);\n        callback && callback(errs && errs[0]);\n        if (errs) {\n          reject(errs[0]);\n        } else {\n          resolve(null);\n        }\n      });\n    });\n  },\n\n  /**\n   * Erases *all* `AsyncStorage` for all clients, libraries, etc. You probably\n   * don't want to call this; use `removeItem` or `multiRemove` to clear only\n   * your app's keys.\n   * \n   * See http://facebook.github.io/react-native/docs/asyncstorage.html#clear\n   */\n  clear: function(callback?: ?(error: ?Error) => void): Promise {\n    return new Promise((resolve, reject) => {\n      RCTAsyncStorage.clear(function(error) {\n        callback && callback(convertError(error));\n        if (error && convertError(error)){\n          reject(convertError(error));\n        } else {\n          resolve(null);\n        }\n      });\n    });\n  },\n\n  /**\n   * Gets *all* keys known to your app; for all callers, libraries, etc.\n   *\n   * See http://facebook.github.io/react-native/docs/asyncstorage.html#getallkeys\n   */\n  getAllKeys: function(callback?: ?(error: ?Error, keys: ?Array<string>) => void): Promise {\n    return new Promise((resolve, reject) => {\n      RCTAsyncStorage.getAllKeys(function(error, keys) {\n        callback && callback(convertError(error), keys);\n        if (error) {\n          reject(convertError(error));\n        } else {\n          resolve(keys);\n        }\n      });\n    });\n  },\n\n  /**\n   * The following batched functions are useful for executing a lot of\n   * operations at once, allowing for native optimizations and provide the\n   * convenience of a single callback after all operations are complete.\n   *\n   * These functions return arrays of errors, potentially one for every key.\n   * For key-specific errors, the Error object will have a key property to\n   * indicate which key caused the error.\n   */\n\n  /** \n   * Flushes any pending requests using a single batch call to get the data.\n   * \n   * See http://facebook.github.io/react-native/docs/asyncstorage.html#flushgetrequests\n   * */\n  flushGetRequests: function(): void {\n    const getRequests = this._getRequests;\n    const getKeys = this._getKeys;\n\n    this._getRequests = [];\n    this._getKeys = [];\n\n    RCTAsyncStorage.multiGet(getKeys, function(errors, result) {\n      // Even though the runtime complexity of this is theoretically worse vs if we used a map,\n      // it's much, much faster in practice for the data sets we deal with (we avoid\n      // allocating result pair arrays). This was heavily benchmarked.\n      //\n      // Is there a way to avoid using the map but fix the bug in this breaking test?\n      // https://github.com/facebook/react-native/commit/8dd8ad76579d7feef34c014d387bf02065692264\n      const map = {};\n      result && result.forEach(([key, value]) => { map[key] = value; return value; });\n      const reqLength = getRequests.length;\n      for (let i = 0; i < reqLength; i++) {\n        const request = getRequests[i];\n        const requestKeys = request.keys;\n        const requestResult = requestKeys.map(key => [key, map[key]]);\n        request.callback && request.callback(null, requestResult);\n        request.resolve && request.resolve(requestResult);\n      }\n    });\n  },\n\n  /**\n   * This allows you to batch the fetching of items given an array of `key`\n   * inputs. Your callback will be invoked with an array of corresponding\n   * key-value pairs found.\n   * \n   * See http://facebook.github.io/react-native/docs/asyncstorage.html#multiget\n   */\n  multiGet: function(\n    keys: Array<string>,\n    callback?: ?(errors: ?Array<Error>, result: ?Array<Array<string>>) => void\n  ): Promise {\n    if (!this._immediate) {\n      this._immediate = setImmediate(() => {\n        this._immediate = null;\n        this.flushGetRequests();\n      });\n    }\n\n    var getRequest = {\n      keys: keys,\n      callback: callback,\n      // do we need this?\n      keyIndex: this._getKeys.length,\n      resolve: null,\n      reject: null,\n    };\n\n    var promiseResult = new Promise((resolve, reject) => {\n      getRequest.resolve = resolve;\n      getRequest.reject = reject;\n    });\n\n    this._getRequests.push(getRequest);\n    // avoid fetching duplicates\n    keys.forEach(key => {\n      if (this._getKeys.indexOf(key) === -1) {\n        this._getKeys.push(key);\n      }\n    });\n\n    return promiseResult;\n  },\n\n  /**\n   * Use this as a batch operation for storing multiple key-value pairs. When\n   * the operation completes you'll get a single callback with any errors.\n   *\n   * See http://facebook.github.io/react-native/docs/asyncstorage.html#multiset\n   */\n  multiSet: function(\n    keyValuePairs: Array<Array<string>>,\n    callback?: ?(errors: ?Array<Error>) => void\n  ): Promise {\n    return new Promise((resolve, reject) => {\n      RCTAsyncStorage.multiSet(keyValuePairs, function(errors) {\n        var error = convertErrors(errors);\n        callback && callback(error);\n        if (error) {\n          reject(error);\n        } else {\n          resolve(null);\n        }\n      });\n    });\n  },\n\n  /**\n   * Call this to batch the deletion of all keys in the `keys` array.\n   * \n   * See http://facebook.github.io/react-native/docs/asyncstorage.html#multiremove\n   */\n  multiRemove: function(\n    keys: Array<string>,\n    callback?: ?(errors: ?Array<Error>) => void\n  ): Promise {\n    return new Promise((resolve, reject) => {\n      RCTAsyncStorage.multiRemove(keys, function(errors) {\n        var error = convertErrors(errors);\n        callback && callback(error);\n        if (error) {\n          reject(error);\n        } else {\n          resolve(null);\n        }\n      });\n    });\n  },\n\n  /**\n   * Batch operation to merge in existing and new values for a given set of\n   * keys. This assumes that the values are stringified JSON.\n   * \n   * **NOTE**: This is not supported by all native implementations.\n   * \n   * See http://facebook.github.io/react-native/docs/asyncstorage.html#multimerge\n   */\n  multiMerge: function(\n    keyValuePairs: Array<Array<string>>,\n    callback?: ?(errors: ?Array<Error>) => void\n  ): Promise {\n    return new Promise((resolve, reject) => {\n      RCTAsyncStorage.multiMerge(keyValuePairs, function(errors) {\n        var error = convertErrors(errors);\n        callback && callback(error);\n        if (error) {\n          reject(error);\n        } else {\n          resolve(null);\n        }\n      });\n    });\n  },\n};\n\n// Not all native implementations support merge.\nif (!RCTAsyncStorage.multiMerge) {\n  delete AsyncStorage.mergeItem;\n  delete AsyncStorage.multiMerge;\n}\n\nfunction convertErrors(errs) {\n  if (!errs) {\n    return null;\n  }\n  return (Array.isArray(errs) ? errs : [errs]).map((e) => convertError(e));\n}\n\nfunction convertError(error) {\n  if (!error) {\n    return null;\n  }\n  var out = new Error(error.message);\n  out.key = error.key; // flow doesn't like this :(\n  return out;\n}\n\nmodule.exports = AsyncStorage;\n"
  },
  {
    "path": "Libraries/StyleSheet/ColorPropType.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ColorPropType\n */\n'use strict';\n\nvar normalizeColor = require('normalizeColor');\n\nvar colorPropType = function(isRequired, props, propName, componentName, location, propFullName) {\n  var color = props[propName];\n  if (color === undefined || color === null) {\n    if (isRequired) {\n      return new Error(\n        'Required ' + location + ' `' + (propFullName || propName) +\n        '` was not specified in `' + componentName + '`.'\n      );\n    }\n    return;\n  }\n\n  if (typeof color === 'number') {\n    // Developers should not use a number, but we are using the prop type\n    // both for user provided colors and for transformed ones. This isn't ideal\n    // and should be fixed but will do for now...\n    return;\n  }\n\n  if (normalizeColor(color) === null) {\n    return new Error(\n      'Invalid ' + location + ' `' + (propFullName || propName) +\n      '` supplied to `' + componentName + '`: ' + color + '\\n' +\n`Valid color formats are\n  - '#f0f' (#rgb)\n  - '#f0fc' (#rgba)\n  - '#ff00ff' (#rrggbb)\n  - '#ff00ff00' (#rrggbbaa)\n  - 'rgb(255, 255, 255)'\n  - 'rgba(255, 255, 255, 1.0)'\n  - 'hsl(360, 100%, 100%)'\n  - 'hsla(360, 100%, 100%, 1.0)'\n  - 'transparent'\n  - 'red'\n  - 0xff00ff00 (0xrrggbbaa)\n`);\n  }\n};\n\nvar ColorPropType = colorPropType.bind(null, false /* isRequired */);\nColorPropType.isRequired = colorPropType.bind(null, true /* isRequired */);\n\nmodule.exports = ColorPropType;\n"
  },
  {
    "path": "Libraries/StyleSheet/EdgeInsetsPropType.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EdgeInsetsPropType\n * @flow\n */\n'use strict';\n\nconst PropTypes = require('prop-types');\n\nconst createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');\n\nconst EdgeInsetsPropType = (createStrictShapeTypeChecker({\n  top: PropTypes.number,\n  left: PropTypes.number,\n  bottom: PropTypes.number,\n  right: PropTypes.number,\n}): ReactPropsCheckType & ReactPropsChainableTypeChecker);\n\nexport type EdgeInsetsProp = {\n  top: number,\n  left: number,\n  bottom: number,\n  right: number,\n};\n\nmodule.exports = EdgeInsetsPropType;\n"
  },
  {
    "path": "Libraries/StyleSheet/LayoutPropTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule LayoutPropTypes\n * @flow\n */\n'use strict';\n\nvar ReactPropTypes = require('prop-types');\n\n/**\n * React Native's layout system is based on Flexbox and is powered both\n * on iOS and Android by an open source project called `Yoga`:\n * https://github.com/facebook/yoga\n *\n * The implementation in Yoga is slightly different from what the\n * Flexbox spec defines - for example, we chose more sensible default\n * values. Since our layout docs are generated from the comments in this\n * file, please keep a brief comment describing each prop type.\n *\n * These properties are a subset of our styles that are consumed by the layout\n * algorithm and affect the positioning and sizing of views.\n */\nvar LayoutPropTypes = {\n  /** `display` sets the display type of this component.\n   *\n   *  It works similarly to `display` in CSS, but only support 'flex' and 'none'.\n   *  'flex' is the default.\n   */\n  display: ReactPropTypes.oneOf([\n    'none',\n    'flex',\n  ]),\n\n  /** `width` sets the width of this component.\n   *\n   *  It works similarly to `width` in CSS, but in React Native you\n   *  must use points or percentages. Ems and other units are not supported.\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/width for more details.\n   */\n  width: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `height` sets the height of this component.\n   *\n   *  It works similarly to `height` in CSS, but in React Native you\n   *  must use points or percentages. Ems and other units are not supported.\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/height for more details.\n   */\n  height: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /**\n   * When the direction is `ltr`, `start` is equivalent to `left`.\n   * When the direction is `rtl`, `start` is equivalent to `right`.\n   *\n   * This style takes precedence over the `left`, `right`, and `end` styles.\n   */\n  start: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /**\n   * When the direction is `ltr`, `end` is equivalent to `right`.\n   * When the direction is `rtl`, `end` is equivalent to `left`.\n   *\n   * This style takes precedence over the `left` and `right` styles.\n   */\n  end: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `top` is the number of logical pixels to offset the top edge of\n   *  this component.\n   *\n   *  It works similarly to `top` in CSS, but in React Native you\n   *  must use points or percentages. Ems and other units are not supported.\n   *\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/top\n   *  for more details of how `top` affects layout.\n   */\n  top: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `left` is the number of logical pixels to offset the left edge of\n   *  this component.\n   *\n   *  It works similarly to `left` in CSS, but in React Native you\n   *  must use points or percentages. Ems and other units are not supported.\n   *\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/left\n   *  for more details of how `left` affects layout.\n   */\n  left: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `right` is the number of logical pixels to offset the right edge of\n   *  this component.\n   *\n   *  It works similarly to `right` in CSS, but in React Native you\n   *  must use points or percentages. Ems and other units are not supported.\n   *\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/right\n   *  for more details of how `right` affects layout.\n   */\n  right: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `bottom` is the number of logical pixels to offset the bottom edge of\n   *  this component.\n   *\n   *  It works similarly to `bottom` in CSS, but in React Native you\n   *  must use points or percentages. Ems and other units are not supported.\n   *\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/bottom\n   *  for more details of how `bottom` affects layout.\n   */\n  bottom: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `minWidth` is the minimum width for this component, in logical pixels.\n   *\n   *  It works similarly to `min-width` in CSS, but in React Native you\n   *  must use points or percentages. Ems and other units are not supported.\n   *\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/min-width\n   *  for more details.\n   */\n  minWidth: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `maxWidth` is the maximum width for this component, in logical pixels.\n   *\n   *  It works similarly to `max-width` in CSS, but in React Native you\n   *  must use points or percentages. Ems and other units are not supported.\n   *\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n   *  for more details.\n   */\n  maxWidth: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `minHeight` is the minimum height for this component, in logical pixels.\n   *\n   *  It works similarly to `min-height` in CSS, but in React Native you\n   *  must use points or percentages. Ems and other units are not supported.\n   *\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/min-height\n   *  for more details.\n   */\n  minHeight: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `maxHeight` is the maximum height for this component, in logical pixels.\n   *\n   *  It works similarly to `max-height` in CSS, but in React Native you\n   *  must use points or percentages. Ems and other units are not supported.\n   *\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/max-height\n   *  for more details.\n   */\n  maxHeight: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** Setting `margin` has the same effect as setting each of\n   *  `marginTop`, `marginLeft`, `marginBottom`, and `marginRight`.\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n   *  for more details.\n   */\n  margin: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** Setting `marginVertical` has the same effect as setting both\n   *  `marginTop` and `marginBottom`.\n   */\n  marginVertical: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** Setting `marginHorizontal` has the same effect as setting\n   *  both `marginLeft` and `marginRight`.\n   */\n  marginHorizontal: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `marginTop` works like `margin-top` in CSS.\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n   *  for more details.\n   */\n  marginTop: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `marginBottom` works like `margin-bottom` in CSS.\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n   *  for more details.\n   */\n  marginBottom: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `marginLeft` works like `margin-left` in CSS.\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n   *  for more details.\n   */\n  marginLeft: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `marginRight` works like `margin-right` in CSS.\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n   *  for more details.\n   */\n  marginRight: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /**\n   * When direction is `ltr`, `marginStart` is equivalent to `marginLeft`.\n   * When direction is `rtl`, `marginStart` is equivalent to `marginRight`.\n   */\n  marginStart: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /**\n   * When direction is `ltr`, `marginEnd` is equivalent to `marginRight`.\n   * When direction is `rtl`, `marginEnd` is equivalent to `marginLeft`.\n   */\n  marginEnd: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** Setting `padding` has the same effect as setting each of\n   *  `paddingTop`, `paddingBottom`, `paddingLeft`, and `paddingRight`.\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/padding\n   *  for more details.\n   */\n  padding: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** Setting `paddingVertical` is like setting both of\n   *  `paddingTop` and `paddingBottom`.\n   */\n  paddingVertical: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** Setting `paddingHorizontal` is like setting both of\n   *  `paddingLeft` and `paddingRight`.\n   */\n  paddingHorizontal: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `paddingTop` works like `padding-top` in CSS.\n   * See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\n   * for more details.\n   */\n  paddingTop: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `paddingBottom` works like `padding-bottom` in CSS.\n   * See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\n   * for more details.\n   */\n  paddingBottom: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `paddingLeft` works like `padding-left` in CSS.\n   * See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\n   * for more details.\n   */\n  paddingLeft: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `paddingRight` works like `padding-right` in CSS.\n   * See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\n   * for more details.\n   */\n  paddingRight: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /**\n   * When direction is `ltr`, `paddingStart` is equivalent to `paddingLeft`.\n   * When direction is `rtl`, `paddingStart` is equivalent to `paddingRight`.\n   */\n  paddingStart: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /**\n   * When direction is `ltr`, `paddingEnd` is equivalent to `paddingRight`.\n   * When direction is `rtl`, `paddingEnd` is equivalent to `paddingLeft`.\n   */\n  paddingEnd: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /** `borderWidth` works like `border-width` in CSS.\n   * See https://developer.mozilla.org/en-US/docs/Web/CSS/border-width\n   * for more details.\n   */\n  borderWidth: ReactPropTypes.number,\n\n  /** `borderTopWidth` works like `border-top-width` in CSS.\n   * See https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-width\n   * for more details.\n   */\n  borderTopWidth: ReactPropTypes.number,\n\n  /**\n   * When direction is `ltr`, `borderStartWidth` is equivalent to `borderLeftWidth`.\n   * When direction is `rtl`, `borderStartWidth` is equivalent to `borderRightWidth`.\n   */\n  borderStartWidth: ReactPropTypes.number,\n\n  /**\n   * When direction is `ltr`, `borderEndWidth` is equivalent to `borderRightWidth`.\n   * When direction is `rtl`, `borderEndWidth` is equivalent to `borderLeftWidth`.\n   */\n  borderEndWidth: ReactPropTypes.number,\n\n  /** `borderRightWidth` works like `border-right-width` in CSS.\n   * See https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-width\n   * for more details.\n   */\n  borderRightWidth: ReactPropTypes.number,\n\n  /** `borderBottomWidth` works like `border-bottom-width` in CSS.\n   * See https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-width\n   * for more details.\n   */\n  borderBottomWidth: ReactPropTypes.number,\n\n  /** `borderLeftWidth` works like `border-left-width` in CSS.\n   * See https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-width\n   * for more details.\n   */\n  borderLeftWidth: ReactPropTypes.number,\n\n  /** `position` in React Native is similar to regular CSS, but\n   *  everything is set to `relative` by default, so `absolute`\n   *  positioning is always just relative to the parent.\n   *\n   *  If you want to position a child using specific numbers of logical\n   *  pixels relative to its parent, set the child to have `absolute`\n   *  position.\n   *\n   *  If you want to position a child relative to something\n   *  that is not its parent, just don't use styles for that. Use the\n   *  component tree.\n   *\n   *  See https://github.com/facebook/yoga\n   *  for more details on how `position` differs between React Native\n   *  and CSS.\n   */\n  position: ReactPropTypes.oneOf([\n    'absolute',\n    'relative'\n  ]),\n\n  /** `flexDirection` controls which directions children of a container go.\n   *  `row` goes left to right, `column` goes top to bottom, and you may\n   *  be able to guess what the other two do. It works like `flex-direction`\n   *  in CSS, except the default is `column`.\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction\n   *  for more details.\n   */\n  flexDirection: ReactPropTypes.oneOf([\n    'row',\n    'row-reverse',\n    'column',\n    'column-reverse'\n  ]),\n\n  /** `flexWrap` controls whether children can wrap around after they\n   *  hit the end of a flex container.\n   *  It works like `flex-wrap` in CSS (default: nowrap).\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap\n   *  for more details.\n   */\n  flexWrap: ReactPropTypes.oneOf([\n    'wrap',\n    'nowrap'\n  ]),\n\n  /** `justifyContent` aligns children in the main direction.\n   *  For example, if children are flowing vertically, `justifyContent`\n   *  controls how they align vertically.\n   *  It works like `justify-content` in CSS (default: flex-start).\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content\n   *  for more details.\n   */\n  justifyContent: ReactPropTypes.oneOf([\n    'flex-start',\n    'flex-end',\n    'center',\n    'space-between',\n    'space-around',\n    'space-evenly'\n  ]),\n\n  /** `alignItems` aligns children in the cross direction.\n   *  For example, if children are flowing vertically, `alignItems`\n   *  controls how they align horizontally.\n   *  It works like `align-items` in CSS (default: stretch).\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/align-items\n   *  for more details.\n   */\n  alignItems: ReactPropTypes.oneOf([\n    'flex-start',\n    'flex-end',\n    'center',\n    'stretch',\n    'baseline'\n  ]),\n\n  /** `alignSelf` controls how a child aligns in the cross direction,\n   *  overriding the `alignItems` of the parent. It works like `align-self`\n   *  in CSS (default: auto).\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/align-self\n   *  for more details.\n   */\n  alignSelf: ReactPropTypes.oneOf([\n    'auto',\n    'flex-start',\n    'flex-end',\n    'center',\n    'stretch',\n    'baseline'\n  ]),\n\n  /** `alignContent` controls how rows align in the cross direction,\n   *  overriding the `alignContent` of the parent.\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/align-content\n   *  for more details.\n   */\n  alignContent: ReactPropTypes.oneOf([\n    'flex-start',\n    'flex-end',\n    'center',\n    'stretch',\n    'space-between',\n    'space-around'\n  ]),\n\n  /** `overflow` controls how children are measured and displayed.\n   *  `overflow: hidden` causes views to be clipped while `overflow: scroll`\n   *  causes views to be measured independently of their parents main axis.\n   *  It works like `overflow` in CSS (default: visible).\n   *  See https://developer.mozilla.org/en/docs/Web/CSS/overflow\n   *  for more details.\n   *  `overflow: visible` only works on iOS. On Android, all views will clip\n   *  their children.\n   */\n  overflow: ReactPropTypes.oneOf([\n    'visible',\n    'hidden',\n    'scroll',\n  ]),\n\n  /** In React Native `flex` does not work the same way that it does in CSS.\n   *  `flex` is a number rather than a string, and it works\n   *  according to the `Yoga` library\n   *  at https://github.com/facebook/yoga\n   *\n   *  When `flex` is a positive number, it makes the component flexible\n   *  and it will be sized proportional to its flex value. So a\n   *  component with `flex` set to 2 will take twice the space as a\n   *  component with `flex` set to 1.\n   *\n   *  When `flex` is 0, the component is sized according to `width`\n   *  and `height` and it is inflexible.\n   *\n   *  When `flex` is -1, the component is normally sized according\n   *  `width` and `height`. However, if there's not enough space,\n   *  the component will shrink to its `minWidth` and `minHeight`.\n   *\n   * flexGrow, flexShrink, and flexBasis work the same as in CSS.\n   */\n  flex: ReactPropTypes.number,\n  flexGrow: ReactPropTypes.number,\n  flexShrink: ReactPropTypes.number,\n  flexBasis: ReactPropTypes.oneOfType([\n    ReactPropTypes.number,\n    ReactPropTypes.string,\n  ]),\n\n  /**\n   * Aspect ratio control the size of the undefined dimension of a node. Aspect ratio is a\n   * non-standard property only available in react native and not CSS.\n   *\n   * - On a node with a set width/height aspect ratio control the size of the unset dimension\n   * - On a node with a set flex basis aspect ratio controls the size of the node in the cross axis\n   *   if unset\n   * - On a node with a measure function aspect ratio works as though the measure function measures\n   *   the flex basis\n   * - On a node with flex grow/shrink aspect ratio controls the size of the node in the cross axis\n   *   if unset\n   * - Aspect ratio takes min/max dimensions into account\n   */\n  aspectRatio: ReactPropTypes.number,\n\n  /** `zIndex` controls which components display on top of others.\n   *  Normally, you don't use `zIndex`. Components render according to\n   *  their order in the document tree, so later components draw over\n   *  earlier ones. `zIndex` may be useful if you have animations or custom\n   *  modal interfaces where you don't want this behavior.\n   *\n   *  It works like the CSS `z-index` property - components with a larger\n   *  `zIndex` will render on top. Think of the z-direction like it's\n   *  pointing from the phone into your eyeball.\n   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/z-index for\n   *  more details.\n   */\n  zIndex: ReactPropTypes.number,\n\n  /** `direction` specifies the directional flow of the user interface.\n   *  The default is `inherit`, except for root node which will have\n   *  value based on the current locale.\n   *  See https://facebook.github.io/yoga/docs/rtl/\n   *  for more details.\n   *  @platform ios\n   */\n  direction: ReactPropTypes.oneOf([\n    'inherit',\n    'ltr',\n    'rtl',\n  ]),\n};\n\nmodule.exports = LayoutPropTypes;\n"
  },
  {
    "path": "Libraries/StyleSheet/PointPropType.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PointPropType\n * @flow\n */\n'use strict';\n\nvar PropTypes = require('prop-types');\n\nvar createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');\n\nvar PointPropType = createStrictShapeTypeChecker({\n  x: PropTypes.number,\n  y: PropTypes.number,\n});\n\nmodule.exports = PointPropType;\n"
  },
  {
    "path": "Libraries/StyleSheet/StyleSheet.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StyleSheet\n * @flow\n */\n'use strict';\n\nconst PixelRatio = require('PixelRatio');\nconst ReactNativePropRegistry = require('ReactNativePropRegistry');\nconst ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');\nconst StyleSheetValidation = require('StyleSheetValidation');\n\nconst flatten = require('flattenStyle');\n\nimport type {\n  StyleSheetStyle as _StyleSheetStyle,\n  Styles as _Styles,\n  StyleSheet as _StyleSheet,\n  StyleValue as _StyleValue,\n  StyleObj,\n} from 'StyleSheetTypes';\n\nexport type StyleProp = StyleObj;\nexport type Styles = _Styles;\nexport type StyleSheet<S> = _StyleSheet<S>;\nexport type StyleValue = _StyleValue;\nexport type StyleSheetStyle = _StyleSheetStyle;\n\nlet hairlineWidth = PixelRatio.roundToNearestPixel(0.4);\nif (hairlineWidth === 0) {\n  hairlineWidth = 1 / PixelRatio.get();\n}\n\nconst absoluteFillObject = {\n  position: ('absolute': 'absolute'),\n  left: 0,\n  right: 0,\n  top: 0,\n  bottom: 0,\n};\nconst absoluteFill: typeof absoluteFillObject =\n  ReactNativePropRegistry.register(absoluteFillObject); // This also freezes it\n\n/**\n * A StyleSheet is an abstraction similar to CSS StyleSheets\n *\n * Create a new StyleSheet:\n *\n * ```\n * const styles = StyleSheet.create({\n *   container: {\n *     borderRadius: 4,\n *     borderWidth: 0.5,\n *     borderColor: '#d6d7da',\n *   },\n *   title: {\n *     fontSize: 19,\n *     fontWeight: 'bold',\n *   },\n *   activeTitle: {\n *     color: 'red',\n *   },\n * });\n * ```\n *\n * Use a StyleSheet:\n *\n * ```\n * <View style={styles.container}>\n *   <Text style={[styles.title, this.props.isActive && styles.activeTitle]} />\n * </View>\n * ```\n *\n * Code quality:\n *\n *  - By moving styles away from the render function, you're making the code\n *  easier to understand.\n *  - Naming the styles is a good way to add meaning to the low level components\n *  in the render function.\n *\n * Performance:\n *\n *  - Making a stylesheet from a style object makes it possible to refer to it\n * by ID instead of creating a new style object every time.\n *  - It also allows to send the style only once through the bridge. All\n * subsequent uses are going to refer an id (not implemented yet).\n */\nmodule.exports = {\n  /**\n   * This is defined as the width of a thin line on the platform. It can be\n   * used as the thickness of a border or division between two elements.\n   * Example:\n   * ```\n   *   {\n   *     borderBottomColor: '#bbb',\n   *     borderBottomWidth: StyleSheet.hairlineWidth\n   *   }\n   * ```\n   *\n   * This constant will always be a round number of pixels (so a line defined\n   * by it look crisp) and will try to match the standard width of a thin line\n   * on the underlying platform. However, you should not rely on it being a\n   * constant size, because on different platforms and screen densities its\n   * value may be calculated differently.\n   *\n   * A line with hairline width may not be visible if your simulator is downscaled.\n   */\n  hairlineWidth,\n\n  /**\n   * A very common pattern is to create overlays with position absolute and zero positioning,\n   * so `absoluteFill` can be used for convenience and to reduce duplication of these repeated\n   * styles.\n   */\n  absoluteFill,\n\n  /**\n   * Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be\n   * used to create a customized entry in a `StyleSheet`, e.g.:\n   *\n   *   const styles = StyleSheet.create({\n   *     wrapper: {\n   *       ...StyleSheet.absoluteFillObject,\n   *       top: 10,\n   *       backgroundColor: 'transparent',\n   *     },\n   *   });\n   */\n  absoluteFillObject,\n\n  /**\n   * Combines two styles such that `style2` will override any styles in `style1`.\n   * If either style is falsy, the other one is returned without allocating an\n   * array, saving allocations and maintaining reference equality for\n   * PureComponent checks.\n   */\n  compose(style1: ?StyleProp, style2: ?StyleProp): ?StyleProp {\n    if (style1 && style2) {\n      return [style1, style2];\n    } else {\n      return style1 || style2;\n    }\n  },\n\n  /**\n   * Flattens an array of style objects, into one aggregated style object.\n   * Alternatively, this method can be used to lookup IDs, returned by\n   * StyleSheet.register.\n   *\n   * > **NOTE**: Exercise caution as abusing this can tax you in terms of\n   * > optimizations.\n   * >\n   * > IDs enable optimizations through the bridge and memory in general. Refering\n   * > to style objects directly will deprive you of these optimizations.\n   *\n   * Example:\n   * ```\n   * const styles = StyleSheet.create({\n   *   listItem: {\n   *     flex: 1,\n   *     fontSize: 16,\n   *     color: 'white'\n   *   },\n   *   selectedListItem: {\n   *     color: 'green'\n   *   }\n   * });\n   *\n   * StyleSheet.flatten([styles.listItem, styles.selectedListItem])\n   * // returns { flex: 1, fontSize: 16, color: 'green' }\n   * ```\n   * Alternative use:\n   * ```\n   * StyleSheet.flatten(styles.listItem);\n   * // return { flex: 1, fontSize: 16, color: 'white' }\n   * // Simply styles.listItem would return its ID (number)\n   * ```\n   * This method internally uses `StyleSheetRegistry.getStyleByID(style)`\n   * to resolve style objects represented by IDs. Thus, an array of style\n   * objects (instances of StyleSheet.create), are individually resolved to,\n   * their respective objects, merged as one and then returned. This also explains\n   * the alternative use.\n   */\n  flatten,\n\n  /**\n   * WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will\n   * not be reliably announced. The whole thing might be deleted, who knows? Use\n   * at your own risk.\n   *\n   * Sets a function to use to pre-process a style property value. This is used\n   * internally to process color and transform values. You should not use this\n   * unless you really know what you are doing and have exhausted other options.\n   */\n  setStyleAttributePreprocessor(property: string, process: (nextProp: mixed) => mixed) {\n    let value;\n\n    if (typeof ReactNativeStyleAttributes[property] === 'string') {\n      value = {};\n    } else if (typeof ReactNativeStyleAttributes[property] === 'object') {\n      value = ReactNativeStyleAttributes[property];\n    } else {\n      console.error(`${property} is not a valid style attribute`);\n      return;\n    }\n\n    if (__DEV__ && typeof value.process === 'function') {\n      console.warn(`Overwriting ${property} style attribute preprocessor`);\n    }\n\n    ReactNativeStyleAttributes[property] = { ...value, process };\n  },\n\n  /**\n   * Creates a StyleSheet style reference from the given object.\n   */\n  create<S: Styles>(obj: S): StyleSheet<S> {\n    const result = {};\n    for (const key in obj) {\n      StyleSheetValidation.validateStyle(key, obj);\n      result[key] = obj[key] && ReactNativePropRegistry.register(obj[key]);\n    }\n    return result;\n  },\n};\n"
  },
  {
    "path": "Libraries/StyleSheet/StyleSheetPropType.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StyleSheetPropType\n * @flow\n */\n'use strict';\n\nvar createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');\nvar flattenStyle = require('flattenStyle');\n\nfunction StyleSheetPropType(\n  shape: {[key: string]: ReactPropsCheckType}\n): ReactPropsCheckType {\n  var shapePropType = createStrictShapeTypeChecker(shape);\n  return function(props, propName, componentName, location?, ...rest) {\n    var newProps = props;\n    if (props[propName]) {\n      // Just make a dummy prop object with only the flattened style\n      newProps = {};\n      newProps[propName] = flattenStyle(props[propName]);\n    }\n    return shapePropType(newProps, propName, componentName, location, ...rest);\n  };\n}\n\nmodule.exports = StyleSheetPropType;\n"
  },
  {
    "path": "Libraries/StyleSheet/StyleSheetTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StyleSheetTypes\n * @flow\n * @format\n */\n\n'use strict';\n\nimport AnimatedNode from 'AnimatedNode';\n\nexport opaque type StyleSheetStyle: number = number;\n\nexport type ColorValue = null | string;\nexport type DimensionValue = null | number | string | AnimatedNode;\n\nexport type LayoutStyle<+Dimension = DimensionValue> = {\n  +display?: 'none' | 'flex',\n  +width?: Dimension,\n  +height?: Dimension,\n  +top?: Dimension,\n  +bottom?: Dimension,\n  +left?: Dimension,\n  +right?: Dimension,\n  +minWidth?: Dimension,\n  +maxWidth?: Dimension,\n  +minHeight?: Dimension,\n  +maxHeight?: Dimension,\n  +margin?: Dimension,\n  +marginVertical?: Dimension,\n  +marginHorizontal?: Dimension,\n  +marginTop?: Dimension,\n  +marginBottom?: Dimension,\n  +marginLeft?: Dimension,\n  +marginRight?: Dimension,\n  +padding?: Dimension,\n  +paddingVertical?: Dimension,\n  +paddingHorizontal?: Dimension,\n  +paddingTop?: Dimension,\n  +paddingBottom?: Dimension,\n  +paddingLeft?: Dimension,\n  +paddingRight?: Dimension,\n  +borderWidth?: number,\n  +borderTopWidth?: number,\n  +borderBottomWidth?: number,\n  +borderLeftWidth?: number,\n  +borderRightWidth?: number,\n  +position?: 'absolute' | 'relative',\n  +flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse',\n  +flexWrap?: 'wrap' | 'nowrap',\n  +justifyContent?:\n    | 'flex-start'\n    | 'flex-end'\n    | 'center'\n    | 'space-between'\n    | 'space-around'\n    | 'space-evenly',\n  +alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline',\n  +alignSelf?:\n    | 'auto'\n    | 'flex-start'\n    | 'flex-end'\n    | 'center'\n    | 'stretch'\n    | 'baseline',\n  +alignContent?:\n    | 'flex-start'\n    | 'flex-end'\n    | 'center'\n    | 'stretch'\n    | 'space-between'\n    | 'space-around',\n  +overflow?: 'visible' | 'hidden' | 'scroll',\n  +flex?: number,\n  +flexGrow?: number,\n  +flexShrink?: number,\n  +flexBasis?: number | string,\n  +aspectRatio?: number,\n  +zIndex?: number,\n  +direction?: 'inherit' | 'ltr' | 'rtl',\n};\n\nexport type TransformStyle = {\n  +transform?: $ReadOnlyArray<\n    | {+perspective: number | AnimatedNode}\n    | {+rotate: string}\n    | {+rotateX: string}\n    | {+rotateY: string}\n    | {+rotateZ: string}\n    | {+scale: number | AnimatedNode}\n    | {+scaleX: number | AnimatedNode}\n    | {+scaleY: number | AnimatedNode}\n    | {+translateX: number | AnimatedNode}\n    | {+translateY: number | AnimatedNode}\n    | {\n      +translate: [number | AnimatedNode, number | AnimatedNode] | AnimatedNode,\n    }\n    | {+skewX: string}\n    | {+skewY: string}\n    // TODO: what is the actual type it expects?\n    | {+matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode},\n  >,\n};\n\nexport type ShadowStyle<+Color = ColorValue> = {\n  +shadowColor?: Color,\n  +shadowOffset?: {\n    +width?: number,\n    +height?: number,\n  },\n  +shadowOpacity?: number | AnimatedNode,\n  +shadowRadius?: number,\n};\n\nexport type ViewStyle<+Dimension = DimensionValue, +Color = ColorValue> = {\n  ...$Exact<LayoutStyle<Dimension>>,\n  ...$Exact<ShadowStyle<Color>>,\n  ...$Exact<TransformStyle>,\n  +backfaceVisibility?: 'visible' | 'hidden',\n  +backgroundColor?: Color,\n  +borderColor?: Color,\n  +borderTopColor?: Color,\n  +borderRightColor?: Color,\n  +borderBottomColor?: Color,\n  +borderLeftColor?: Color,\n  +borderRadius?: number,\n  +borderTopLeftRadius?: number,\n  +borderTopRightRadius?: number,\n  +borderBottomLeftRadius?: number,\n  +borderBottomRightRadius?: number,\n  +borderStyle?: 'solid' | 'dotted' | 'dashed',\n  +borderWidth?: number,\n  +borderTopWidth?: number,\n  +borderRightWidth?: number,\n  +borderBottomWidth?: number,\n  +borderLeftWidth?: number,\n  +opacity?: number | AnimatedNode,\n  +elevation?: number,\n};\n\nexport type TextStyle<+Dimension = DimensionValue, +Color = ColorValue> = {\n  ...$Exact<ViewStyle<Dimension, Color>>,\n  +color?: Color,\n  +fontFamily?: string,\n  +fontSize?: number,\n  +fontStyle?: 'normal' | 'italic',\n  +fontWeight?:\n    | 'normal'\n    | 'bold'\n    | '100'\n    | '200'\n    | '300'\n    | '400'\n    | '500'\n    | '600'\n    | '700'\n    | '800'\n    | '900',\n  +fontVariant?: $ReadOnlyArray<\n    | 'small-caps'\n    | 'oldstyle-nums'\n    | 'lining-nums'\n    | 'tabular-nums'\n    | 'proportional-nums',\n  >,\n  +textShadowOffset?: {+width?: number, +height?: number},\n  +textShadowRadius?: number,\n  +textShadowColor?: Color,\n  +letterSpacing?: number,\n  +lineHeight?: number,\n  +textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify',\n  +textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center',\n  +includeFontPadding?: boolean,\n  +textDecorationLine?:\n    | 'none'\n    | 'underline'\n    | 'line-through'\n    | 'underline line-through',\n  +textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed',\n  +textDecorationColor?: Color,\n  +writingDirection?: 'auto' | 'ltr' | 'rtl',\n};\n\nexport type ImageStyle<+Dimension = DimensionValue, +Color = ColorValue> = {\n  ...$Exact<ViewStyle<Dimension, Color>>,\n  +resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',\n  +tintColor?: Color,\n  +overlayColor?: string,\n};\n\nexport type Style<+Dimension = DimensionValue, +Color = ColorValue> = {\n  ...$Exact<TextStyle<Dimension, Color>>,\n  +resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',\n  +tintColor?: Color,\n  +overlayColor?: string,\n};\n\nexport type StyleProp<+T> =\n  | null\n  | void\n  | T\n  | StyleSheetStyle\n  | number\n  | false\n  | ''\n  | $ReadOnlyArray<StyleProp<T>>;\n\n// export type ViewStyleProp = StyleProp<$Shape<ViewStyle<DimensionValue>>>;\n// export type TextStyleProp = StyleProp<\n//   $Shape<TextStyle<DimensionValue, ColorValue>>,\n// >;\n// export type ImageStyleProp = StyleProp<\n//   $Shape<ImageStyle<DimensionValue, ColorValue>>,\n// >;\n\nexport type StyleObj = StyleProp<$Shape<Style<DimensionValue, ColorValue>>>;\nexport type StyleValue = StyleObj;\n\nexport type ViewStyleProp = StyleObj;\nexport type TextStyleProp = StyleObj;\nexport type ImageStyleProp = StyleObj;\n\nexport type Styles = {\n  +[key: string]: $Shape<Style<DimensionValue, ColorValue>>,\n};\nexport type StyleSheet<+S: Styles> = $ObjMap<S, (Object) => StyleSheetStyle>;\n\n/*\nUtility type get non-nullable types for specific style keys.\nUseful when a component requires values for certain Style Keys.\nSo Instead:\n```\ntype Props = {position: string};\n```\nYou should use:\n```\ntype Props = {position: TypeForStyleKey<'position'>};\n```\n\nThis will correctly give you the type 'absolute' | 'relative' instead of the\nweak type of just string;\n*/\nexport type TypeForStyleKey<+key: $Keys<Style<>>> = $ElementType<Style<>, key>;\n"
  },
  {
    "path": "Libraries/StyleSheet/StyleSheetValidation.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StyleSheetValidation\n * @flow\n */\n'use strict';\n\nvar ImageStylePropTypes = require('ImageStylePropTypes');\nvar TextStylePropTypes = require('TextStylePropTypes');\nvar ViewStylePropTypes = require('ViewStylePropTypes');\n\nvar invariant = require('fbjs/lib/invariant');\n\n// Hardcoded because this is a legit case but we don't want to load it from\n// a private API. We might likely want to unify style sheet creation with how it\n// is done in the DOM so this might move into React. I know what I'm doing so\n// plz don't fire me.\nconst ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nclass StyleSheetValidation {\n  static validateStyleProp(prop: string, style: Object, caller: string) {\n    if (!__DEV__) {\n      return;\n    }\n    if (allStylePropTypes[prop] === undefined) {\n      var message1 = '\"' + prop + '\" is not a valid style property.';\n      var message2 = '\\nValid style props: ' +\n        JSON.stringify(Object.keys(allStylePropTypes).sort(), null, '  ');\n      styleError(message1, style, caller, message2);\n    }\n    var error = allStylePropTypes[prop](\n      style,\n      prop,\n      caller,\n      'prop',\n      null,\n      ReactPropTypesSecret,\n    );\n    if (error) {\n      styleError(error.message, style, caller);\n    }\n  }\n\n  static validateStyle(name: string, styles: Object) {\n    if (!__DEV__) {\n      return;\n    }\n    for (var prop in styles[name]) {\n      StyleSheetValidation.validateStyleProp(prop, styles[name], 'StyleSheet ' + name);\n    }\n  }\n\n  static addValidStylePropTypes(stylePropTypes) {\n    for (var key in stylePropTypes) {\n      allStylePropTypes[key] = stylePropTypes[key];\n    }\n  }\n}\n\nvar styleError = function(message1, style, caller?, message2?) {\n  invariant(\n    false,\n    message1 + '\\n' + (caller || '<<unknown>>') + ': ' +\n    JSON.stringify(style, null, '  ') + (message2 || '')\n  );\n};\n\nvar allStylePropTypes = {};\n\nStyleSheetValidation.addValidStylePropTypes(ImageStylePropTypes);\nStyleSheetValidation.addValidStylePropTypes(TextStylePropTypes);\nStyleSheetValidation.addValidStylePropTypes(ViewStylePropTypes);\n\nmodule.exports = StyleSheetValidation;\n"
  },
  {
    "path": "Libraries/StyleSheet/TransformPropTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TransformPropTypes\n * @flow\n */\n'use strict';\n\nvar ReactPropTypes = require('prop-types');\n\nvar deprecatedPropType = require('deprecatedPropType');\n\nvar TransformMatrixPropType = function(\n  props : Object,\n  propName : string,\n  componentName : string\n) : ?Error {\n  if (props[propName]) {\n    return new Error(\n      'The transformMatrix style property is deprecated. ' +\n      'Use `transform: [{ matrix: ... }]` instead.'\n    );\n  }\n};\n\nvar DecomposedMatrixPropType = function(\n  props : Object,\n  propName : string,\n  componentName : string\n) : ?Error {\n  if (props[propName]) {\n    return new Error(\n      'The decomposedMatrix style property is deprecated. ' +\n      'Use `transform: [...]` instead.'\n    );\n  }\n};\n\nvar TransformPropTypes = {\n  /**\n   * `transform` accepts an array of transformation objects. Each object specifies\n   * the property that will be transformed as the key, and the value to use in the\n   * transformation. Objects should not be combined. Use a single key/value pair\n   * per object.\n   *\n   * The rotate transformations require a string so that the transform may be\n   * expressed in degrees (deg) or radians (rad). For example:\n   *\n   * `transform([{ rotateX: '45deg' }, { rotateZ: '0.785398rad' }])`\n   *\n   * The skew transformations require a string so that the transform may be\n   * expressed in degrees (deg). For example:\n   *\n   * `transform([{ skewX: '45deg' }])`\n   */\n  transform: ReactPropTypes.arrayOf(\n    ReactPropTypes.oneOfType([\n      ReactPropTypes.shape({perspective: ReactPropTypes.number}),\n      ReactPropTypes.shape({rotate: ReactPropTypes.string}),\n      ReactPropTypes.shape({rotateX: ReactPropTypes.string}),\n      ReactPropTypes.shape({rotateY: ReactPropTypes.string}),\n      ReactPropTypes.shape({rotateZ: ReactPropTypes.string}),\n      ReactPropTypes.shape({scale: ReactPropTypes.number}),\n      ReactPropTypes.shape({scaleX: ReactPropTypes.number}),\n      ReactPropTypes.shape({scaleY: ReactPropTypes.number}),\n      ReactPropTypes.shape({translateX: ReactPropTypes.number}),\n      ReactPropTypes.shape({translateY: ReactPropTypes.number}),\n      ReactPropTypes.shape({skewX: ReactPropTypes.string}),\n      ReactPropTypes.shape({skewY: ReactPropTypes.string})\n    ])\n  ),\n\n  /**\n   * Deprecated. Use the transform prop instead.\n   */\n  transformMatrix: TransformMatrixPropType,\n  /**\n   * Deprecated. Use the transform prop instead.\n   */\n  decomposedMatrix: DecomposedMatrixPropType,\n\n  /* Deprecated transform props used on Android only */\n  scaleX: deprecatedPropType(ReactPropTypes.number, 'Use the transform prop instead.'),\n  scaleY: deprecatedPropType(ReactPropTypes.number, 'Use the transform prop instead.'),\n  rotation: deprecatedPropType(ReactPropTypes.number, 'Use the transform prop instead.'),\n  translateX: deprecatedPropType(ReactPropTypes.number, 'Use the transform prop instead.'),\n  translateY: deprecatedPropType(ReactPropTypes.number, 'Use the transform prop instead.'),\n};\n\nmodule.exports = TransformPropTypes;\n"
  },
  {
    "path": "Libraries/StyleSheet/__tests__/__snapshots__/processTransform-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`processTransform validation should throw on invalid transform property 1`] = `\"Invalid transform translateW: {\\\\\"translateW\\\\\":10}\"`;\n\nexports[`processTransform validation should throw on object with multiple properties 1`] = `\"You must specify exactly one property per transform object. Passed properties: {\\\\\"scale\\\\\":0.5,\\\\\"translateY\\\\\":10}\"`;\n\nexports[`processTransform validation should throw when not passing an array to an array prop 1`] = `\"Transform with key of matrix must have an array as the value: {\\\\\"matrix\\\\\":\\\\\"not-a-matrix\\\\\"}\"`;\n\nexports[`processTransform validation should throw when not passing an array to an array prop 2`] = `\"Transform with key of translate must have an array as the value: {\\\\\"translate\\\\\":10}\"`;\n\nexports[`processTransform validation should throw when passing a matrix of the wrong size 1`] = `\"Matrix transform must have a length of 9 (2d) or 16 (3d). Provided matrix has a length of 4: {\\\\\"matrix\\\\\":[1,1,1,1]}\"`;\n\nexports[`processTransform validation should throw when passing a perspective of 0 1`] = `\"Transform with key of \\\\\"perspective\\\\\" cannot be zero: {\\\\\"perspective\\\\\":0}\"`;\n\nexports[`processTransform validation should throw when passing a translate of the wrong size 1`] = `\"Transform with key translate must be an array of length 2 or 3, found 1: {\\\\\"translate\\\\\":[1]}\"`;\n\nexports[`processTransform validation should throw when passing a translate of the wrong size 2`] = `\"Transform with key translate must be an array of length 2 or 3, found 4: {\\\\\"translate\\\\\":[1,1,1,1]}\"`;\n\nexports[`processTransform validation should throw when passing an Animated.Value 1`] = `\"You passed an Animated.Value to a normal component. You need to wrap that component in an Animated. For example, replace <View /> by <Animated.View />.\"`;\n\nexports[`processTransform validation should throw when passing an invalid angle prop 1`] = `\"Transform with key of \\\\\"rotate\\\\\" must be a string: {\\\\\"rotate\\\\\":10}\"`;\n\nexports[`processTransform validation should throw when passing an invalid angle prop 2`] = `\"Rotate transform must be expressed in degrees (deg) or radians (rad): {\\\\\"skewX\\\\\":\\\\\"10drg\\\\\"}\"`;\n\nexports[`processTransform validation should throw when passing an invalid value to a number prop 1`] = `\"Transform with key of \\\\\"translateY\\\\\" must be a number: {\\\\\"translateY\\\\\":\\\\\"20deg\\\\\"}\"`;\n\nexports[`processTransform validation should throw when passing an invalid value to a number prop 2`] = `\"Transform with key of \\\\\"scale\\\\\" must be a number: {\\\\\"scale\\\\\":{\\\\\"x\\\\\":10,\\\\\"y\\\\\":10}}\"`;\n\nexports[`processTransform validation should throw when passing an invalid value to a number prop 3`] = `\"Transform with key of \\\\\"perspective\\\\\" must be a number: {\\\\\"perspective\\\\\":[]}\"`;\n"
  },
  {
    "path": "Libraries/StyleSheet/__tests__/flattenStyle-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nvar flattenStyle = require('flattenStyle');\n\ndescribe('flattenStyle', () => {\n\n  it('should merge style objects', () => {\n    var style1 = {width: 10};\n    var style2 = {height: 20};\n    var flatStyle = flattenStyle([style1, style2]);\n    expect(flatStyle.width).toBe(10);\n    expect(flatStyle.height).toBe(20);\n  });\n\n  it('should override style properties', () => {\n    var style1 = {backgroundColor: '#000', width: 10};\n    var style2 = {backgroundColor: '#023c69', width: null};\n    var flatStyle = flattenStyle([style1, style2]);\n    expect(flatStyle.backgroundColor).toBe('#023c69');\n    expect(flatStyle.width).toBe(null);\n  });\n\n  it('should overwrite properties with `undefined`', () => {\n    var style1 = {backgroundColor: '#000'};\n    var style2 = {backgroundColor: undefined};\n    var flatStyle = flattenStyle([style1, style2]);\n    expect(flatStyle.backgroundColor).toBe(undefined);\n  });\n\n  it('should not fail on falsy values', () => {\n    expect(() => flattenStyle([null, false, undefined])).not.toThrow();\n  });\n\n  it('should recursively flatten arrays', () => {\n    var style1 = {width: 10};\n    var style2 = {height: 20};\n    var style3 = {width: 30};\n    var flatStyle = flattenStyle([null, [], [style1, style2], style3]);\n    expect(flatStyle.width).toBe(30);\n    expect(flatStyle.height).toBe(20);\n  });\n});\n"
  },
  {
    "path": "Libraries/StyleSheet/__tests__/normalizeColor-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nvar normalizeColor = require('normalizeColor');\n\ndescribe('normalizeColor', function() {\n  it('should accept only spec compliant colors', function() {\n    expect(normalizeColor('#abc')).not.toBe(null);\n    expect(normalizeColor('#abcd')).not.toBe(null);\n    expect(normalizeColor('#abcdef')).not.toBe(null);\n    expect(normalizeColor('#abcdef01')).not.toBe(null);\n    expect(normalizeColor('rgb(1,2,3)')).not.toBe(null);\n    expect(normalizeColor('rgb(1, 2, 3)')).not.toBe(null);\n    expect(normalizeColor('rgb(   1   , 2   , 3   )')).not.toBe(null);\n    expect(normalizeColor('rgb(-1, -2, -3)')).not.toBe(null);\n    expect(normalizeColor('rgba(0, 0, 0, 1)')).not.toBe(null);\n    expect(normalizeColor(0x01234567 + 0.5)).toBe(null);\n    expect(normalizeColor(-1)).toBe(null);\n    expect(normalizeColor(0xffffffff + 1)).toBe(null);\n  });\n\n  it('should temporarly accept floating point values for rgb', function() {\n    expect(normalizeColor('rgb(1.1, 2.1, 3.1)')).toBe(0x010203ff);\n    expect(normalizeColor('rgba(1.1, 2.1, 3.1, 1.0)')).toBe(0x010203ff);\n  });\n\n  it('should refuse non spec compliant colors', function() {\n    expect(normalizeColor('#00gg00')).toBe(null);\n    expect(normalizeColor('rgb(1, 2, 3,)')).toBe(null);\n    expect(normalizeColor('rgb(1, 2, 3')).toBe(null);\n\n    // Used to be accepted by normalizeColor\n    expect(normalizeColor('abc')).toBe(null);\n    expect(normalizeColor(' #abc ')).toBe(null);\n    expect(normalizeColor('##abc')).toBe(null);\n    expect(normalizeColor('rgb 255 0 0')).toBe(null);\n    expect(normalizeColor('RGBA(0, 1, 2)')).toBe(null);\n    expect(normalizeColor('rgb (0, 1, 2)')).toBe(null);\n    expect(normalizeColor('hsv(0, 1, 2)')).toBe(null);\n    expect(normalizeColor({r: 10, g: 10, b: 10})).toBe(null);\n    expect(normalizeColor('hsl(1%, 2, 3)')).toBe(null);\n    expect(normalizeColor('rgb(1%, 2%, 3%)')).toBe(null);\n  });\n\n  it('should handle hex6 properly', function() {\n    expect(normalizeColor('#000000')).toBe(0x000000ff);\n    expect(normalizeColor('#ffffff')).toBe(0xffffffff);\n    expect(normalizeColor('#ff00ff')).toBe(0xff00ffff);\n    expect(normalizeColor('#abcdef')).toBe(0xabcdefff);\n    expect(normalizeColor('#012345')).toBe(0x012345ff);\n  });\n\n  it('should handle hex3 properly', function() {\n    expect(normalizeColor('#000')).toBe(0x000000ff);\n    expect(normalizeColor('#fff')).toBe(0xffffffff);\n    expect(normalizeColor('#f0f')).toBe(0xff00ffff);\n  });\n\n  it('should handle hex8 properly', function() {\n    expect(normalizeColor('#00000000')).toBe(0x00000000);\n    expect(normalizeColor('#ffffffff')).toBe(0xffffffff);\n    expect(normalizeColor('#ffff00ff')).toBe(0xffff00ff);\n    expect(normalizeColor('#abcdef01')).toBe(0xabcdef01);\n    expect(normalizeColor('#01234567')).toBe(0x01234567);\n  });\n\n  it('should handle rgb properly', function() {\n    expect(normalizeColor('rgb(0, 0, 0)')).toBe(0x000000ff);\n    expect(normalizeColor('rgb(-1, -2, -3)')).toBe(0x000000ff);\n    expect(normalizeColor('rgb(0, 0, 255)')).toBe(0x0000ffff);\n    expect(normalizeColor('rgb(100, 15, 69)')).toBe(0x640f45ff);\n    expect(normalizeColor('rgb(255, 255, 255)')).toBe(0xffffffff);\n    expect(normalizeColor('rgb(256, 256, 256)')).toBe(0xffffffff);\n  });\n\n  it('should handle rgba properly', function() {\n    expect(normalizeColor('rgba(0, 0, 0, 0.0)')).toBe(0x00000000);\n    expect(normalizeColor('rgba(0, 0, 0, 0)')).toBe(0x00000000);\n    expect(normalizeColor('rgba(0, 0, 0, -0.5)')).toBe(0x00000000);\n    expect(normalizeColor('rgba(0, 0, 0, 1.0)')).toBe(0x000000ff);\n    expect(normalizeColor('rgba(0, 0, 0, 1)')).toBe(0x000000ff);\n    expect(normalizeColor('rgba(0, 0, 0, 1.5)')).toBe(0x000000ff);\n    expect(normalizeColor('rgba(100, 15, 69, 0.5)')).toBe(0x640f4580);\n  });\n\n  it('should handle hsl properly', function() {\n    expect(normalizeColor('hsl(0, 0%, 0%)')).toBe(0x000000ff);\n    expect(normalizeColor('hsl(360, 100%, 100%)')).toBe(0xffffffff);\n    expect(normalizeColor('hsl(180, 50%, 50%)')).toBe(0x40bfbfff);\n    expect(normalizeColor('hsl(540, 50%, 50%)')).toBe(0x40bfbfff);\n    expect(normalizeColor('hsl(70, 25%, 75%)')).toBe(0xcacfafff);\n    expect(normalizeColor('hsl(70, 100%, 75%)')).toBe(0xeaff80ff);\n    expect(normalizeColor('hsl(70, 110%, 75%)')).toBe(0xeaff80ff);\n    expect(normalizeColor('hsl(70, 0%, 75%)')).toBe(0xbfbfbfff);\n    expect(normalizeColor('hsl(70, -10%, 75%)')).toBe(0xbfbfbfff);\n  });\n\n  it('should handle hsla properly', function() {\n    expect(normalizeColor('hsla(0, 0%, 0%, 0)')).toBe(0x00000000);\n    expect(normalizeColor('hsla(360, 100%, 100%, 1)')).toBe(0xffffffff);\n    expect(normalizeColor('hsla(360, 100%, 100%, 0)')).toBe(0xffffff00);\n    expect(normalizeColor('hsla(180, 50%, 50%, 0.2)')).toBe(0x40bfbf33);\n  });\n\n  it('should handle named colors properly', function() {\n    expect(normalizeColor('red')).toBe(0xff0000ff);\n    expect(normalizeColor('transparent')).toBe(0x00000000);\n    expect(normalizeColor('peachpuff')).toBe(0xffdab9ff);\n  });\n\n  it('should handle number colors properly', function() {\n    expect(normalizeColor(0x00000000)).toBe(0x00000000);\n    expect(normalizeColor(0xff0000ff)).toBe(0xff0000ff);\n    expect(normalizeColor(0xffffffff)).toBe(0xffffffff);\n    expect(normalizeColor(0x01234567)).toBe(0x01234567);\n  });\n\n  it('should return the same color when it\\'s already normalized', function() {\n    const normalizedColor = normalizeColor('red') || 0;\n    expect(normalizeColor(normalizedColor)).toBe(normalizedColor);\n  });\n});\n"
  },
  {
    "path": "Libraries/StyleSheet/__tests__/processColor-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nconst {OS} = require('Platform');\nconst processColor = require('processColor');\n\nconst platformSpecific = OS === 'android'\n  ? unsigned => unsigned | 0 //eslint-disable-line no-bitwise\n  : x => x;\n\ndescribe('processColor', () => {\n\n  describe('predefined color names', () => {\n\n    it('should convert red', () => {\n      var colorFromString = processColor('red');\n      var expectedInt = 0xFFFF0000;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n\n    it('should convert white', () => {\n      var colorFromString = processColor('white');\n      var expectedInt = 0xFFFFFFFF;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n\n    it('should convert black', () => {\n      var colorFromString = processColor('black');\n      var expectedInt = 0xFF000000;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n\n    it('should convert transparent', () => {\n      var colorFromString = processColor('transparent');\n      var expectedInt = 0x00000000;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n  });\n\n  describe('RGB strings', () => {\n\n    it('should convert rgb(x, y, z)', () => {\n      var colorFromString = processColor('rgb(10, 20, 30)');\n      var expectedInt = 0xFF0A141E;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n\n  });\n\n  describe('RGBA strings', () => {\n\n    it('should convert rgba(x, y, z, a)', () => {\n      var colorFromString = processColor('rgba(10, 20, 30, 0.4)');\n      var expectedInt = 0x660A141E;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n\n  });\n\n  describe('HSL strings', () => {\n\n    it('should convert hsl(x, y%, z%)', () => {\n      var colorFromString = processColor('hsl(318, 69%, 55%)');\n      var expectedInt = 0xFFDB3DAC;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n\n  });\n\n  describe('HSLA strings', () => {\n\n    it('should convert hsla(x, y%, z%, a)', () => {\n      var colorFromString = processColor('hsla(318, 69%, 55%, 0.25)');\n      var expectedInt = 0x40DB3DAC;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n\n  });\n\n  describe('hex strings', () => {\n\n    it('should convert #xxxxxx', () => {\n      var colorFromString = processColor('#1e83c9');\n      var expectedInt = 0xFF1E83C9;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n\n  });\n\n});\n"
  },
  {
    "path": "Libraries/StyleSheet/__tests__/processTransform-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nconst processTransform = require('processTransform');\n\ndescribe('processTransform', () => {\n  describe('validation', () => {\n    it('should accept an empty array', () => {\n      processTransform([]);\n    });\n\n    it('should accept a simple valid transform', () => {\n      processTransform([\n        {scale: 0.5},\n        {translateX: 10},\n        {translateY: 20},\n        {rotate: '10deg'},\n      ]);\n    });\n\n    it('should throw on object with multiple properties', () => {\n      expect(() => processTransform([{scale: 0.5, translateY: 10}])).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw on invalid transform property', () => {\n      expect(() => processTransform([{translateW: 10}])).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw when not passing an array to an array prop', () => {\n      expect(() => processTransform([{matrix: 'not-a-matrix'}])).toThrowErrorMatchingSnapshot();\n      expect(() => processTransform([{translate: 10}])).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should accept a valid matrix', () => {\n      processTransform([{matrix: [1, 1, 1, 1, 1, 1, 1, 1, 1]}]);\n      processTransform([{matrix: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]}]);\n    });\n\n    it('should throw when passing a matrix of the wrong size', () => {\n      expect(() => processTransform([{matrix: [1, 1, 1, 1]}])).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should accept a valid translate', () => {\n      processTransform([{translate: [1, 1]}]);\n      processTransform([{translate: [1, 1, 1]}]);\n    });\n\n    it('should throw when passing a translate of the wrong size', () => {\n      expect(() => processTransform([{translate: [1]}])).toThrowErrorMatchingSnapshot();\n      expect(() => processTransform([{translate: [1, 1, 1, 1]}])).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw when passing an invalid value to a number prop', () => {\n      expect(() => processTransform([{translateY: '20deg'}])).toThrowErrorMatchingSnapshot();\n      expect(() => processTransform([{scale: {x: 10, y: 10}}])).toThrowErrorMatchingSnapshot();\n      expect(() => processTransform([{perspective: []}])).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw when passing a perspective of 0', () => {\n      expect(() => processTransform([{perspective: 0}])).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should accept an angle in degrees or radians', () => {\n      processTransform([{skewY: '10deg'}]);\n      processTransform([{rotateX: '1.16rad'}]);\n    });\n\n    it('should throw when passing an invalid angle prop', () => {\n      expect(() => processTransform([{rotate: 10}])).toThrowErrorMatchingSnapshot();\n      expect(() => processTransform([{skewX: '10drg'}])).toThrowErrorMatchingSnapshot();\n    });\n\n    it('should throw when passing an Animated.Value', () => {\n      expect(() => processTransform([{rotate: {getValue: () => {}}}])).toThrowErrorMatchingSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "Libraries/StyleSheet/__tests__/setNormalizedColorAlpha-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nvar setNormalizedColorAlpha = require('setNormalizedColorAlpha');\nvar normalizeColor = require('normalizeColor');\n\ndescribe('setNormalizedColorAlpha', function() {\n  it('should adjust the alpha of the color passed in', function() {\n    expect(setNormalizedColorAlpha(0xffffffff, 0.4)).toBe(0xffffff66);\n    expect(setNormalizedColorAlpha(0x204080ff, 0.6)).toBe(0x20408099);\n  });\n\n  it('should clamp invalid input', function() {\n    expect(setNormalizedColorAlpha(0xffffffff, 1.5)).toBe(0xffffffff);\n    expect(setNormalizedColorAlpha(0xffffffff, -1)).toBe(0xffffff00);\n  });\n\n  it('should ignore the color\\'s original alpha', function() {\n    expect(setNormalizedColorAlpha(0x204080aa, 0.8)).toBe(0x204080cc);\n  });\n\n  it('should return the original color when alpha is unchanged', function() {\n    var originalColor = normalizeColor('blue');\n    expect(setNormalizedColorAlpha(originalColor, 1)).toBe(originalColor);\n  });\n});\n"
  },
  {
    "path": "Libraries/StyleSheet/flattenStyle.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule flattenStyle\n * @flow\n */\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\nvar ReactNativePropRegistry;\n\nimport type { StyleObj } from 'StyleSheetTypes';\n\nfunction getStyle(style) {\n  if (ReactNativePropRegistry === undefined) {\n    ReactNativePropRegistry = require('ReactNativePropRegistry');\n  }\n  if (typeof style === 'number') {\n    return ReactNativePropRegistry.getByID(style);\n  }\n  return style;\n}\n\nfunction flattenStyle(style: ?StyleObj): ?Object {\n  if (!style) {\n    return undefined;\n  }\n  invariant(style !== true, 'style may be false but not true');\n\n  if (!Array.isArray(style)) {\n    /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n     * error found when Flow v0.63 was deployed. To see the error delete this\n     * comment and run Flow. */\n    return getStyle(style);\n  }\n\n  var result = {};\n  for (var i = 0, styleLength = style.length; i < styleLength; ++i) {\n    var computedStyle = flattenStyle(style[i]);\n    if (computedStyle) {\n      for (var key in computedStyle) {\n        result[key] = computedStyle[key];\n      }\n    }\n  }\n  return result;\n}\n\nmodule.exports = flattenStyle;\n"
  },
  {
    "path": "Libraries/StyleSheet/normalizeColor.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule normalizeColor\n * @flow\n */\n/* eslint no-bitwise: 0 */\n'use strict';\n\nfunction normalizeColor(color: string | number): ?number {\n  var match;\n\n  if (typeof color === 'number') {\n    if (color >>> 0 === color && color >= 0 && color <= 0xffffffff) {\n      return color;\n    }\n    return null;\n  }\n\n  // Ordered based on occurrences on Facebook codebase\n  if ((match = matchers.hex6.exec(color))) {\n    return parseInt(match[1] + 'ff', 16) >>> 0;\n  }\n\n  if (names.hasOwnProperty(color)) {\n    return names[color];\n  }\n\n  if ((match = matchers.rgb.exec(color))) {\n    return (\n      (// b\n      (parse255(match[1]) << 24 | // r\n      parse255(match[2]) << 16 | // g\n      parse255(match[3]) << 8 | 0x000000ff)) // a\n    ) >>> 0;\n  }\n\n  if ((match = matchers.rgba.exec(color))) {\n    return (\n      (// b\n      (parse255(match[1]) << 24 | // r\n      parse255(match[2]) << 16 | // g\n      parse255(match[3]) << 8 | parse1(match[4]))) // a\n    ) >>> 0;\n  }\n\n  if ((match = matchers.hex3.exec(color))) {\n    return parseInt(\n      match[1] + match[1] + // r\n      match[2] + match[2] + // g\n      match[3] + match[3] + // b\n      'ff', // a\n      16\n    ) >>> 0;\n  }\n\n  // https://drafts.csswg.org/css-color-4/#hex-notation\n  if ((match = matchers.hex8.exec(color))) {\n    return parseInt(match[1], 16) >>> 0;\n  }\n\n  if ((match = matchers.hex4.exec(color))) {\n    return parseInt(\n      match[1] + match[1] + // r\n      match[2] + match[2] + // g\n      match[3] + match[3] + // b\n      match[4] + match[4], // a\n      16\n    ) >>> 0;\n  }\n\n  if ((match = matchers.hsl.exec(color))) {\n    return (\n      (hslToRgb(\n        parse360(match[1]), // h\n        parsePercentage(match[2]), // s\n        parsePercentage(match[3]) // l\n      ) | 0x000000ff) // a\n    ) >>> 0;\n  }\n\n  if ((match = matchers.hsla.exec(color))) {\n    return (\n      (hslToRgb(\n        parse360(match[1]), // h\n        parsePercentage(match[2]), // s\n        parsePercentage(match[3]) // l\n      ) | parse1(match[4])) // a\n    ) >>> 0;\n  }\n\n  return null;\n}\n\nfunction hue2rgb(p: number, q: number, t: number): number {\n  if (t < 0) {\n    t += 1;\n  }\n  if (t > 1) {\n    t -= 1;\n  }\n  if (t < 1 / 6) {\n    return p + (q - p) * 6 * t;\n  }\n  if (t < 1 / 2) {\n    return q;\n  }\n  if (t < 2 / 3) {\n    return p + (q - p) * (2 / 3 - t) * 6;\n  }\n  return p;\n}\n\nfunction hslToRgb(h: number, s: number, l: number): number {\n  var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n  var p = 2 * l - q;\n  var r = hue2rgb(p, q, h + 1 / 3);\n  var g = hue2rgb(p, q, h);\n  var b = hue2rgb(p, q, h - 1 / 3);\n\n  return (\n    Math.round(r * 255) << 24 |\n    Math.round(g * 255) << 16 |\n    Math.round(b * 255) << 8\n  );\n}\n\n// var INTEGER = '[-+]?\\\\d+';\nvar NUMBER = '[-+]?\\\\d*\\\\.?\\\\d+';\nvar PERCENTAGE = NUMBER + '%';\n\nfunction call(...args) {\n  return '\\\\(\\\\s*(' + args.join(')\\\\s*,\\\\s*(') + ')\\\\s*\\\\)';\n}\n\nvar matchers = {\n  rgb: new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER)),\n  rgba: new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER)),\n  hsl: new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE)),\n  hsla: new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)),\n  hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n  hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n  hex6: /^#([0-9a-fA-F]{6})$/,\n  hex8: /^#([0-9a-fA-F]{8})$/,\n};\n\nfunction parse255(str: string): number {\n  var int = parseInt(str, 10);\n  if (int < 0) {\n    return 0;\n  }\n  if (int > 255) {\n    return 255;\n  }\n  return int;\n}\n\nfunction parse360(str: string): number {\n  var int = parseFloat(str);\n  return (((int % 360) + 360) % 360) / 360;\n}\n\nfunction parse1(str: string): number {\n  var num = parseFloat(str);\n  if (num < 0) {\n    return 0;\n  }\n  if (num > 1) {\n    return 255;\n  }\n  return Math.round(num * 255);\n}\n\nfunction parsePercentage(str: string): number {\n  // parseFloat conveniently ignores the final %\n  var int = parseFloat(str);\n  if (int < 0) {\n    return 0;\n  }\n  if (int > 100) {\n    return 1;\n  }\n  return int / 100;\n}\n\nvar names = {\n  transparent: 0x00000000,\n\n  // http://www.w3.org/TR/css3-color/#svg-color\n  aliceblue: 0xf0f8ffff,\n  antiquewhite: 0xfaebd7ff,\n  aqua: 0x00ffffff,\n  aquamarine: 0x7fffd4ff,\n  azure: 0xf0ffffff,\n  beige: 0xf5f5dcff,\n  bisque: 0xffe4c4ff,\n  black: 0x000000ff,\n  blanchedalmond: 0xffebcdff,\n  blue: 0x0000ffff,\n  blueviolet: 0x8a2be2ff,\n  brown: 0xa52a2aff,\n  burlywood: 0xdeb887ff,\n  burntsienna: 0xea7e5dff,\n  cadetblue: 0x5f9ea0ff,\n  chartreuse: 0x7fff00ff,\n  chocolate: 0xd2691eff,\n  coral: 0xff7f50ff,\n  cornflowerblue: 0x6495edff,\n  cornsilk: 0xfff8dcff,\n  crimson: 0xdc143cff,\n  cyan: 0x00ffffff,\n  darkblue: 0x00008bff,\n  darkcyan: 0x008b8bff,\n  darkgoldenrod: 0xb8860bff,\n  darkgray: 0xa9a9a9ff,\n  darkgreen: 0x006400ff,\n  darkgrey: 0xa9a9a9ff,\n  darkkhaki: 0xbdb76bff,\n  darkmagenta: 0x8b008bff,\n  darkolivegreen: 0x556b2fff,\n  darkorange: 0xff8c00ff,\n  darkorchid: 0x9932ccff,\n  darkred: 0x8b0000ff,\n  darksalmon: 0xe9967aff,\n  darkseagreen: 0x8fbc8fff,\n  darkslateblue: 0x483d8bff,\n  darkslategray: 0x2f4f4fff,\n  darkslategrey: 0x2f4f4fff,\n  darkturquoise: 0x00ced1ff,\n  darkviolet: 0x9400d3ff,\n  deeppink: 0xff1493ff,\n  deepskyblue: 0x00bfffff,\n  dimgray: 0x696969ff,\n  dimgrey: 0x696969ff,\n  dodgerblue: 0x1e90ffff,\n  firebrick: 0xb22222ff,\n  floralwhite: 0xfffaf0ff,\n  forestgreen: 0x228b22ff,\n  fuchsia: 0xff00ffff,\n  gainsboro: 0xdcdcdcff,\n  ghostwhite: 0xf8f8ffff,\n  gold: 0xffd700ff,\n  goldenrod: 0xdaa520ff,\n  gray: 0x808080ff,\n  green: 0x008000ff,\n  greenyellow: 0xadff2fff,\n  grey: 0x808080ff,\n  honeydew: 0xf0fff0ff,\n  hotpink: 0xff69b4ff,\n  indianred: 0xcd5c5cff,\n  indigo: 0x4b0082ff,\n  ivory: 0xfffff0ff,\n  khaki: 0xf0e68cff,\n  lavender: 0xe6e6faff,\n  lavenderblush: 0xfff0f5ff,\n  lawngreen: 0x7cfc00ff,\n  lemonchiffon: 0xfffacdff,\n  lightblue: 0xadd8e6ff,\n  lightcoral: 0xf08080ff,\n  lightcyan: 0xe0ffffff,\n  lightgoldenrodyellow: 0xfafad2ff,\n  lightgray: 0xd3d3d3ff,\n  lightgreen: 0x90ee90ff,\n  lightgrey: 0xd3d3d3ff,\n  lightpink: 0xffb6c1ff,\n  lightsalmon: 0xffa07aff,\n  lightseagreen: 0x20b2aaff,\n  lightskyblue: 0x87cefaff,\n  lightslategray: 0x778899ff,\n  lightslategrey: 0x778899ff,\n  lightsteelblue: 0xb0c4deff,\n  lightyellow: 0xffffe0ff,\n  lime: 0x00ff00ff,\n  limegreen: 0x32cd32ff,\n  linen: 0xfaf0e6ff,\n  magenta: 0xff00ffff,\n  maroon: 0x800000ff,\n  mediumaquamarine: 0x66cdaaff,\n  mediumblue: 0x0000cdff,\n  mediumorchid: 0xba55d3ff,\n  mediumpurple: 0x9370dbff,\n  mediumseagreen: 0x3cb371ff,\n  mediumslateblue: 0x7b68eeff,\n  mediumspringgreen: 0x00fa9aff,\n  mediumturquoise: 0x48d1ccff,\n  mediumvioletred: 0xc71585ff,\n  midnightblue: 0x191970ff,\n  mintcream: 0xf5fffaff,\n  mistyrose: 0xffe4e1ff,\n  moccasin: 0xffe4b5ff,\n  navajowhite: 0xffdeadff,\n  navy: 0x000080ff,\n  oldlace: 0xfdf5e6ff,\n  olive: 0x808000ff,\n  olivedrab: 0x6b8e23ff,\n  orange: 0xffa500ff,\n  orangered: 0xff4500ff,\n  orchid: 0xda70d6ff,\n  palegoldenrod: 0xeee8aaff,\n  palegreen: 0x98fb98ff,\n  paleturquoise: 0xafeeeeff,\n  palevioletred: 0xdb7093ff,\n  papayawhip: 0xffefd5ff,\n  peachpuff: 0xffdab9ff,\n  peru: 0xcd853fff,\n  pink: 0xffc0cbff,\n  plum: 0xdda0ddff,\n  powderblue: 0xb0e0e6ff,\n  purple: 0x800080ff,\n  rebeccapurple: 0x663399ff,\n  red: 0xff0000ff,\n  rosybrown: 0xbc8f8fff,\n  royalblue: 0x4169e1ff,\n  saddlebrown: 0x8b4513ff,\n  salmon: 0xfa8072ff,\n  sandybrown: 0xf4a460ff,\n  seagreen: 0x2e8b57ff,\n  seashell: 0xfff5eeff,\n  sienna: 0xa0522dff,\n  silver: 0xc0c0c0ff,\n  skyblue: 0x87ceebff,\n  slateblue: 0x6a5acdff,\n  slategray: 0x708090ff,\n  slategrey: 0x708090ff,\n  snow: 0xfffafaff,\n  springgreen: 0x00ff7fff,\n  steelblue: 0x4682b4ff,\n  tan: 0xd2b48cff,\n  teal: 0x008080ff,\n  thistle: 0xd8bfd8ff,\n  tomato: 0xff6347ff,\n  turquoise: 0x40e0d0ff,\n  violet: 0xee82eeff,\n  wheat: 0xf5deb3ff,\n  white: 0xffffffff,\n  whitesmoke: 0xf5f5f5ff,\n  yellow: 0xffff00ff,\n  yellowgreen: 0x9acd32ff,\n};\n\nmodule.exports = normalizeColor;\n"
  },
  {
    "path": "Libraries/StyleSheet/processColor.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule processColor\n * @flow\n */\n'use strict';\n\nconst Platform = require('Platform');\n\nconst normalizeColor = require('normalizeColor');\n\n/* eslint no-bitwise: 0 */\nfunction processColor(color?: string | number): ?number {\n  if (color === undefined || color === null) {\n    return color;\n  }\n\n  let int32Color = normalizeColor(color);\n  if (int32Color === null || int32Color === undefined) {\n    return undefined;\n  }\n\n  // Converts 0xrrggbbaa into 0xaarrggbb\n  int32Color = (int32Color << 24 | int32Color >>> 8) >>> 0;\n\n  if (Platform.OS === 'android') {\n    // Android use 32 bit *signed* integer to represent the color\n    // We utilize the fact that bitwise operations in JS also operates on\n    // signed 32 bit integers, so that we can use those to convert from\n    // *unsigned* to *signed* 32bit int that way.\n    int32Color = int32Color | 0x0;\n  }\n  return int32Color;\n}\n\nmodule.exports = processColor;\n"
  },
  {
    "path": "Libraries/StyleSheet/processTransform.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule processTransform\n * @flow\n */\n'use strict';\n\nvar MatrixMath = require('MatrixMath');\nvar Platform = require('Platform');\n\nvar invariant = require('fbjs/lib/invariant');\nvar stringifySafe = require('stringifySafe');\n\n/**\n * Generate a transform matrix based on the provided transforms, and use that\n * within the style object instead.\n *\n * This allows us to provide an API that is similar to CSS, where transforms may\n * be applied in an arbitrary order, and yet have a universal, singular\n * interface to native code.\n */\nfunction processTransform(transform: Array<Object>): Array<Object> | Array<number> {\n  if (__DEV__) {\n    _validateTransforms(transform);\n  }\n\n  // Android & iOS implementations of transform property accept the list of\n  // transform properties as opposed to a transform Matrix. This is necessary\n  // to control transform property updates completely on the native thread.\n  if (Platform.OS === 'android' || Platform.OS === 'ios' || Platform.OS === 'macos') {\n    return transform;\n  }\n\n  var result = MatrixMath.createIdentityMatrix();\n\n  transform.forEach(transformation => {\n    var key = Object.keys(transformation)[0];\n    var value = transformation[key];\n\n    switch (key) {\n      case 'matrix':\n        MatrixMath.multiplyInto(result, result, value);\n        break;\n      case 'perspective':\n        _multiplyTransform(result, MatrixMath.reusePerspectiveCommand, [value]);\n        break;\n      case 'rotateX':\n        _multiplyTransform(result, MatrixMath.reuseRotateXCommand, [_convertToRadians(value)]);\n        break;\n      case 'rotateY':\n        _multiplyTransform(result, MatrixMath.reuseRotateYCommand, [_convertToRadians(value)]);\n        break;\n      case 'rotate':\n      case 'rotateZ':\n        _multiplyTransform(result, MatrixMath.reuseRotateZCommand, [_convertToRadians(value)]);\n        break;\n      case 'scale':\n        _multiplyTransform(result, MatrixMath.reuseScaleCommand, [value]);\n        break;\n      case 'scaleX':\n        _multiplyTransform(result, MatrixMath.reuseScaleXCommand, [value]);\n        break;\n      case 'scaleY':\n        _multiplyTransform(result, MatrixMath.reuseScaleYCommand, [value]);\n        break;\n      case 'translate':\n        _multiplyTransform(result, MatrixMath.reuseTranslate3dCommand, [value[0], value[1], value[2] || 0]);\n        break;\n      case 'translateX':\n        _multiplyTransform(result, MatrixMath.reuseTranslate2dCommand, [value, 0]);\n        break;\n      case 'translateY':\n        _multiplyTransform(result, MatrixMath.reuseTranslate2dCommand, [0, value]);\n        break;\n      case 'skewX':\n        _multiplyTransform(result, MatrixMath.reuseSkewXCommand, [_convertToRadians(value)]);\n        break;\n      case 'skewY':\n        _multiplyTransform(result, MatrixMath.reuseSkewYCommand, [_convertToRadians(value)]);\n        break;\n      default:\n        throw new Error('Invalid transform name: ' + key);\n    }\n  });\n\n  return result;\n}\n\n/**\n * Performs a destructive operation on a transform matrix.\n */\nfunction _multiplyTransform(\n  result: Array<number>,\n  matrixMathFunction: Function,\n  args: Array<number>\n): void {\n  var matrixToApply = MatrixMath.createIdentityMatrix();\n  var argsWithIdentity = [matrixToApply].concat(args);\n  matrixMathFunction.apply(this, argsWithIdentity);\n  MatrixMath.multiplyInto(result, result, matrixToApply);\n}\n\n/**\n * Parses a string like '0.5rad' or '60deg' into radians expressed in a float.\n * Note that validation on the string is done in `_validateTransform()`.\n */\nfunction _convertToRadians(value: string): number {\n  var floatValue = parseFloat(value);\n  return value.indexOf('rad') > -1 ? floatValue : floatValue * Math.PI / 180;\n}\n\nfunction _validateTransforms(transform: Array<Object>): void {\n  transform.forEach(transformation => {\n    var keys = Object.keys(transformation);\n    invariant(\n      keys.length === 1,\n      'You must specify exactly one property per transform object. Passed properties: %s',\n      stringifySafe(transformation),\n    );\n    var key = keys[0];\n    var value = transformation[key];\n    _validateTransform(key, value, transformation);\n  });\n}\n\nfunction _validateTransform(key, value, transformation) {\n  invariant(\n    !value.getValue,\n    'You passed an Animated.Value to a normal component. ' +\n    'You need to wrap that component in an Animated. For example, ' +\n    'replace <View /> by <Animated.View />.'\n  );\n\n  var multivalueTransforms = [\n    'matrix',\n    'translate',\n  ];\n  if (multivalueTransforms.indexOf(key) !== -1) {\n    invariant(\n      Array.isArray(value),\n      'Transform with key of %s must have an array as the value: %s',\n      key,\n      stringifySafe(transformation),\n    );\n  }\n  switch (key) {\n    case 'matrix':\n      invariant(\n        value.length === 9 || value.length === 16,\n        'Matrix transform must have a length of 9 (2d) or 16 (3d). ' +\n          'Provided matrix has a length of %s: %s',\n        value.length,\n        stringifySafe(transformation),\n      );\n      break;\n    case 'translate':\n      invariant(\n        value.length === 2 || value.length === 3,\n        'Transform with key translate must be an array of length 2 or 3, found %s: %s',\n        value.length,\n        stringifySafe(transformation),\n      );\n      break;\n    case 'rotateX':\n    case 'rotateY':\n    case 'rotateZ':\n    case 'rotate':\n    case 'skewX':\n    case 'skewY':\n      invariant(\n        typeof value === 'string',\n        'Transform with key of \"%s\" must be a string: %s',\n        key,\n        stringifySafe(transformation),\n      );\n      invariant(\n        value.indexOf('deg') > -1 || value.indexOf('rad') > -1,\n        'Rotate transform must be expressed in degrees (deg) or radians ' +\n          '(rad): %s',\n        stringifySafe(transformation),\n      );\n      break;\n    case 'perspective':\n      invariant(\n        typeof value === 'number',\n        'Transform with key of \"%s\" must be a number: %s',\n        key,\n        stringifySafe(transformation),\n      );\n      invariant(\n        value !== 0,\n        'Transform with key of \"%s\" cannot be zero: %s',\n        key,\n        stringifySafe(transformation),\n      );\n      break;\n    case 'translateX':\n    case 'translateY':\n    case 'scale':\n    case 'scaleX':\n    case 'scaleY':\n      invariant(\n        typeof value === 'number',\n        'Transform with key of \"%s\" must be a number: %s',\n        key,\n        stringifySafe(transformation),\n      );\n      break;\n    default:\n      invariant(false, 'Invalid transform %s: %s', key, stringifySafe(transformation));\n  }\n}\n\nmodule.exports = processTransform;\n"
  },
  {
    "path": "Libraries/StyleSheet/setNormalizedColorAlpha.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule setNormalizedColorAlpha\n * @flow\n */\n/* eslint no-bitwise: 0 */\n'use strict';\n\n/**\n * number should be a color processed by `normalizeColor`\n * alpha should be number between 0 and 1\n */\nfunction setNormalizedColorAlpha(input: number, alpha: number): number {\n  if (alpha < 0) {\n    alpha = 0;\n  } else if (alpha > 1) {\n    alpha = 1;\n  }\n\n  alpha = Math.round(alpha * 255);\n  // magic bitshift guarantees we return an unsigned int\n  return ((input & 0xffffff00) | alpha) >>> 0;\n}\n\nmodule.exports = setNormalizedColorAlpha;\n"
  },
  {
    "path": "Libraries/SurfaceBackedComponent/RCTSurfaceBackedComponent.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <ComponentKit/CKComponent.h>\n#import <ComponentKit/CKCompositeComponent.h>\n#import <RCTSurfaceHostingComponent/RCTSurfaceHostingComponentOptions.h>\n\n@class RCTBridge;\n\n/**\n * ComponentKit component represents a React Native Surface created\n * (and stored in the state) with given `bridge`, `moduleName`,\n * and `properties`.\n */\n@interface RCTSurfaceBackedComponent : CKCompositeComponent\n\n+ (instancetype)newWithBridge:(RCTBridge *)bridge\n                   moduleName:(NSString *)moduleName\n                   properties:(NSDictionary *)properties\n                      options:(RCTSurfaceHostingComponentOptions)options;\n\n@end\n"
  },
  {
    "path": "Libraries/SurfaceBackedComponent/RCTSurfaceBackedComponent.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSurfaceBackedComponent.h\"\n\n#import <UIKit/UIKit.h>\n\n#import <ComponentKit/CKComponentSubclass.h>\n#import <ComponentKit/CKOverlayLayoutComponent.h>\n#import <RCTSurfaceHostingComponent/RCTSurfaceHostingComponent.h>\n#import <React/RCTSurface.h>\n\n#import \"RCTSurfaceBackedComponentState.h\"\n\n@implementation RCTSurfaceBackedComponent\n\n+ (id)initialState\n{\n  return [RCTSurfaceBackedComponentState new];\n}\n\n+ (instancetype)newWithBridge:(RCTBridge *)bridge\n                   moduleName:(NSString *)moduleName\n                   properties:(NSDictionary *)properties\n                      options:(RCTSurfaceHostingComponentOptions)options\n{\n  CKComponentScope scope(self, moduleName);\n\n  RCTSurfaceBackedComponentState *state = scope.state();\n\n  if (state.surface == nil || state.surface.bridge != bridge || ![state.surface.moduleName isEqualToString:moduleName]) {\n    RCTSurface *surface =\n      [[RCTSurface alloc] initWithBridge:bridge\n                              moduleName:moduleName\n                       initialProperties:properties];\n\n    state = [RCTSurfaceBackedComponentState newWithSurface:surface];\n\n    CKComponentScope::replaceState(scope, state);\n  }\n  else {\n    if (![state.surface.properties isEqualToDictionary:properties]) {\n      state.surface.properties = properties;\n    }\n  }\n\n  RCTSurfaceHostingComponent *surfaceHostingComponent =\n    [RCTSurfaceHostingComponent newWithSurface:state.surface\n                                       options:options];\n\n  CKComponent *component;\n  if (options.activityIndicatorComponentFactory == nil || RCTSurfaceStageIsRunning(state.surface.stage)) {\n    component = surfaceHostingComponent;\n  } else {\n    component = [CKOverlayLayoutComponent newWithComponent:surfaceHostingComponent\n                                                   overlay:options.activityIndicatorComponentFactory()];\n  }\n\n  return [super newWithComponent:component];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/SurfaceBackedComponent/RCTSurfaceBackedComponentState.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\n@class RCTSurface;\n\n@interface RCTSurfaceBackedComponentState: NSObject\n\n@property (atomic, readonly, strong) RCTSurface *surface;\n\n+ (instancetype)newWithSurface:(RCTSurface *)surface;\n\n@end\n"
  },
  {
    "path": "Libraries/SurfaceBackedComponent/RCTSurfaceBackedComponentState.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSurfaceBackedComponentState.h\"\n\n#import <React/RCTSurface.h>\n\n@implementation RCTSurfaceBackedComponentState\n\n+ (instancetype)newWithSurface:(RCTSurface *)surface\n{\n  return [[self alloc] initWithSurface:surface];\n}\n\n- (instancetype)initWithSurface:(RCTSurface *)surface\n{\n  if (self == [super init]) {\n    _surface = surface;\n  }\n\n  return self;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponent+Internal.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <RCTSurfaceHostingComponent/RCTSurfaceHostingComponent.h>\n#import <RCTSurfaceHostingComponent/RCTSurfaceHostingComponentOptions.h>\n\n@class RCTSurface;\n@class RCTSurfaceHostingComponentState;\n\n@interface RCTSurfaceHostingComponent ()\n\n@property (nonatomic, strong, readonly) RCTSurface *surface;\n@property (nonatomic, retain, readonly) RCTSurfaceHostingComponentState *state;\n@property (nonatomic, assign, readonly) RCTSurfaceHostingComponentOptions options;\n\n@end\n"
  },
  {
    "path": "Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponent.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <ComponentKit/CKComponent.h>\n#import <RCTSurfaceHostingComponent/RCTSurfaceHostingComponentOptions.h>\n\n@class RCTSurface;\n\n/**\n * ComponentKit component represents given Surface instance.\n */\n@interface RCTSurfaceHostingComponent : CKComponent\n\n+ (instancetype)newWithSurface:(RCTSurface *)surface options:(RCTSurfaceHostingComponentOptions)options;\n\n@end\n"
  },
  {
    "path": "Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponent.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSurfaceHostingComponent.h\"\n#import \"RCTSurfaceHostingComponent+Internal.h\"\n\n#import <UIKit/UIKit.h>\n\n#import <ComponentKit/CKComponentSubclass.h>\n#import <React/RCTSurface.h>\n#import <React/RCTSurfaceView.h>\n\n#import \"RCTSurfaceHostingComponentState.h\"\n\n@implementation RCTSurfaceHostingComponent\n\n+ (id)initialState\n{\n  return [RCTSurfaceHostingComponentState new];\n}\n\n+ (instancetype)newWithSurface:(RCTSurface *)surface options:(RCTSurfaceHostingComponentOptions)options\n{\n  CKComponentScope scope(self, surface);\n\n  RCTSurfaceHostingComponentState *const state = scope.state();\n\n  RCTSurfaceHostingComponentState *const newState =\n    [RCTSurfaceHostingComponentState newWithStage:surface.stage\n                                     intrinsicSize:surface.intrinsicSize];\n\n  if (![state isEqual:newState]) {\n    CKComponentScope::replaceState(scope, newState);\n  }\n\n  RCTSurfaceHostingComponent *const component =\n    [super newWithView:{[UIView class]} size:{}];\n\n  if (component) {\n    component->_state = scope.state();\n    component->_surface = surface;\n    component->_options = options;\n  }\n\n  return component;\n}\n\n- (CKComponentLayout)computeLayoutThatFits:(CKSizeRange)constrainedSize\n{\n  // Optimistically communicating layout constraints to the `_surface`,\n  // just to provide layout constraints to React Native as early as possible.\n  // React Native *may* use this info later during applying the own state and\n  // related laying out in parallel with ComponentKit execution.\n  // This call will not interfere (or introduce any negative side effects) with\n  // following invocation of `sizeThatFitsMinimumSize:maximumSize:`.\n  // A weak point: We assume here that this particular layout will be\n  // mounted eventually, which is technically not guaranteed by ComponentKit.\n  // Therefore we also assume that the last layout calculated in a sequence\n  // will be mounted anyways, which is probably true for all *real* use cases.\n  // We plan to tackle this problem during the next big step in improving\n  // interop compatibilities of React Native which will enable us granularly\n  // control React Native mounting blocks and, as a result, implement\n  // truly synchronous mounting stage between React Native and ComponentKit.\n  [_surface setMinimumSize:constrainedSize.min\n               maximumSize:constrainedSize.max];\n\n  // Just in case of the very first building pass, we give React Native a chance\n  // to prepare its internals for coming synchronous measuring.\n  [_surface synchronouslyWaitForStage:RCTSurfaceStageSurfaceDidInitialLayout\n                              timeout:_options.synchronousLayoutingTimeout];\n\n  CGSize fittingSize = CGSizeZero;\n  if (_surface.stage & RCTSurfaceStageSurfaceDidInitialLayout) {\n    fittingSize = [_surface sizeThatFitsMinimumSize:constrainedSize.min\n                                        maximumSize:constrainedSize.max];\n  }\n  else {\n    fittingSize = _options.activityIndicatorSize;\n  }\n\n  fittingSize = constrainedSize.clamp(fittingSize);\n  return {self, fittingSize};\n}\n\n- (CKComponentBoundsAnimation)boundsAnimationFromPreviousComponent:(RCTSurfaceHostingComponent *)previousComponent\n{\n  if (_options.boundsAnimations && (previousComponent->_state.stage != _state.stage)) {\n    return {\n      .mode = CKComponentBoundsAnimationModeDefault,\n      .duration = 0.25,\n      .options = UIViewAnimationOptionCurveEaseInOut,\n    };\n  }\n\n  return {};\n}\n\n@end\n"
  },
  {
    "path": "Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponentController.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <ComponentKit/CKComponentController.h>\n\n@interface RCTSurfaceHostingComponentController : CKComponentController\n\n@end\n"
  },
  {
    "path": "Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponentController.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSurfaceHostingComponentController.h\"\n\n#import <ComponentKit/CKComponentSubclass.h>\n#import <React/RCTAssert.h>\n#import <React/RCTSurface.h>\n#import <React/RCTSurfaceDelegate.h>\n#import <React/RCTSurfaceView.h>\n\n#import \"RCTSurfaceHostingComponent+Internal.h\"\n#import \"RCTSurfaceHostingComponent.h\"\n#import \"RCTSurfaceHostingComponentState.h\"\n\n@interface RCTSurfaceHostingComponentController() <RCTSurfaceDelegate>\n@end\n\n@implementation RCTSurfaceHostingComponentController {\n  RCTSurface *_surface;\n}\n\n- (instancetype)initWithComponent:(RCTSurfaceHostingComponent *)component\n{\n  if (self = [super initWithComponent:component]) {\n    [self updateSurfaceWithComponent:component];\n  }\n\n  return self;\n}\n\n#pragma mark - Lifecycle\n\n- (void)didMount\n{\n  [super didMount];\n  [self mountSurfaceView];\n}\n\n- (void)didRemount\n{\n  [super didRemount];\n  [self mountSurfaceView];\n}\n\n- (void)didUpdateComponent\n{\n  [super didUpdateComponent];\n  [self updateSurfaceWithComponent:(RCTSurfaceHostingComponent *)self.component];\n}\n\n- (void)didUnmount\n{\n  [super didUnmount];\n  [self unmountSurfaceView];\n}\n\n#pragma mark - Helpers\n\n- (void)updateSurfaceWithComponent:(RCTSurfaceHostingComponent *)component\n{\n  // Updating `surface`\n  RCTSurface *const surface = component.surface;\n  if (surface != _surface) {\n    if (_surface.delegate == self) {\n      _surface.delegate = nil;\n    }\n\n    _surface = surface;\n    _surface.delegate = self;\n  }\n}\n\n- (void)setIntrinsicSize:(CGSize)intrinsicSize\n{\n  [self.component updateState:^(RCTSurfaceHostingComponentState *state) {\n    return [RCTSurfaceHostingComponentState newWithStage:state.stage\n                                           intrinsicSize:intrinsicSize];\n  } mode:[self suitableStateUpdateMode]];\n}\n\n- (void)setStage:(RCTSurfaceStage)stage\n{\n  [self.component updateState:^(RCTSurfaceHostingComponentState *state) {\n    return [RCTSurfaceHostingComponentState newWithStage:stage\n                                           intrinsicSize:state.intrinsicSize];\n  } mode:[self suitableStateUpdateMode]];\n}\n\n- (CKUpdateMode)suitableStateUpdateMode\n{\n  return ((RCTSurfaceHostingComponent *)self.component).options.synchronousStateUpdates && RCTIsMainQueue() ? CKUpdateModeSynchronous : CKUpdateModeAsynchronous;\n}\n\n- (void)mountSurfaceView\n{\n  UIView *const surfaceView = _surface.view;\n\n  const CKComponentViewContext &context = [[self component] viewContext];\n\n  UIView *const superview = context.view;\n  superview.clipsToBounds = YES;\n\n  RCTAssert([superview.subviews count] <= 1, @\"Should never have more than a single stateful subview.\");\n\n  UIView *const existingSurfaceView = [superview.subviews lastObject];\n  if (existingSurfaceView != surfaceView) {\n    [existingSurfaceView removeFromSuperview];\n    surfaceView.frame = superview.bounds;\n    surfaceView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;\n    [superview addSubview:surfaceView];\n  }\n}\n\n- (void)unmountSurfaceView\n{\n  const CKComponentViewContext &context = [[self component] viewContext];\n\n  UIView *const superview = context.view;\n  RCTAssert([superview.subviews count] <= 1, @\"Should never have more than a single stateful subview.\");\n  UIView *const existingSurfaceView = [superview.subviews lastObject];\n  [existingSurfaceView removeFromSuperview];\n}\n\n#pragma mark - RCTSurfaceDelegate\n\n- (void)surface:(RCTSurface *)surface didChangeIntrinsicSize:(CGSize)intrinsicSize\n{\n  [self setIntrinsicSize:intrinsicSize];\n}\n\n- (void)surface:(RCTSurface *)surface didChangeStage:(RCTSurfaceStage)stage\n{\n  [self setStage:stage];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponentOptions.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\n#import <ComponentKit/CKComponent.h>\n\ntypedef CKComponent *(^RCTSurfaceHostingComponentOptionsActivityIndicatorComponentFactory)();\n\nstruct RCTSurfaceHostingComponentOptions {\n  NSTimeInterval synchronousLayoutingTimeout = 0.350;\n  BOOL synchronousStateUpdates = YES;\n  CGSize activityIndicatorSize = {44.0, 44.0};\n  BOOL boundsAnimations = YES;\n  RCTSurfaceHostingComponentOptionsActivityIndicatorComponentFactory activityIndicatorComponentFactory = nil;\n};\n"
  },
  {
    "path": "Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponentState.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\n#import <React/RCTSurfaceStage.h>\n\n@interface RCTSurfaceHostingComponentState: NSObject\n\n@property (nonatomic, readonly, assign) CGSize intrinsicSize;\n@property (nonatomic, readonly, assign) RCTSurfaceStage stage;\n\n+ (instancetype)newWithStage:(RCTSurfaceStage)stage\n               intrinsicSize:(CGSize)intrinsicSize;\n\n@end\n"
  },
  {
    "path": "Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponentState.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSurfaceHostingComponentState.h\"\n\n@implementation RCTSurfaceHostingComponentState\n\n+ (instancetype)newWithStage:(RCTSurfaceStage)stage\n               intrinsicSize:(CGSize)intrinsicSize\n{\n  return [[self alloc] initWithStage:stage intrinsicSize:intrinsicSize];\n}\n\n\n- (instancetype)initWithStage:(RCTSurfaceStage)stage\n                intrinsicSize:(CGSize)intrinsicSize\n{\n  if (self = [super init]) {\n    _stage = stage;\n    _intrinsicSize = intrinsicSize;\n  }\n\n  return self;\n}\n\n- (BOOL)isEqual:(RCTSurfaceHostingComponentState *)other\n{\n  if (other == self) {\n    return YES;\n  }\n\n  return\n    _stage == other->_stage &&\n    CGSizeEqualToSize(_intrinsicSize, other->_intrinsicSize);\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTConvert+Text.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTConvert.h>\n\n@interface RCTConvert (Text)\n//\n//+ (NSTextAutocorrectionType)NSTextAutocorrectionType:(id)json;\n//+ (NSTextSpellCheckingType)NSTextSpellCheckingType:(id)json;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTConvert+Text.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTConvert+Text.h\"\n\n@implementation RCTConvert (Text)\n\n+ (UITextAutocorrectionType)UITextAutocorrectionType:(id)json\n{\n  return\n    json == nil ? UITextAutocorrectionTypeDefault :\n    [RCTConvert BOOL:json] ? UITextAutocorrectionTypeYes :\n    UITextAutocorrectionTypeNo;\n}\n\n+ (UITextSpellCheckingType)UITextSpellCheckingType:(id)json\n{\n  return\n    json == nil ? UITextSpellCheckingTypeDefault :\n    [RCTConvert BOOL:json] ? UITextSpellCheckingTypeYes :\n    UITextSpellCheckingTypeNo;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTFontAttributes.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTFontAttributesDelegate.h\"\n\n@class RCTAccessibilityManager;\n\n@interface RCTFontAttributes : NSObject\n\n@property (nonatomic, weak) id<RCTFontAttributesDelegate> delegate;\n\n@property (readonly, nonatomic, strong) NSFont *font;\n\n@property (nonatomic, assign) BOOL allowFontScaling;\n@property (nonatomic, copy) NSString *fontFamily;\n@property (nonatomic, strong) NSNumber *fontSize;\n@property (nonatomic, assign) CGFloat fontSizeMultiplier;\n@property (nonatomic, copy) NSString *fontStyle;\n@property (nonatomic, copy) NSString *fontWeight;\n\n- (instancetype)initWithAccessibilityManager:(RCTAccessibilityManager *)accessibilityManager;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTFontAttributes.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTFontAttributes.h\"\n\n// #import <React/RCTAccessibilityManager.h>\n#import <React/RCTAssert.h>\n#import <React/RCTFont.h>\n#import <React/RCTLog.h>\n\n@interface RCTFontAttributes ()\n{\n  RCTAccessibilityManager *_accessibilityManager;\n}\n\n@property (nonatomic, strong) NSFont *font;\n\n@end\n\n@implementation RCTFontAttributes\n\n- (instancetype)initWithAccessibilityManager:(RCTAccessibilityManager *)accessibilityManager\n{\n  RCTAssertParam(accessibilityManager);\n\n  if (self = [super init]) {\n    _accessibilityManager = accessibilityManager;\n    // _fontSizeMultiplier = _accessibilityManager.multiplier;\n\n    // [[NSNotificationCenter defaultCenter] addObserver:self\n    //                                          selector:@selector(contentSizeMultiplierDidChange)\n    //                                              name:RCTAccessibilityManagerDidUpdateMultiplierNotification\n    //                                            object:_accessibilityManager];\n\n    [self updateFont];\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (void)contentSizeMultiplierDidChange\n{\n  // self.fontSizeMultiplier = _accessibilityManager.multiplier;\n}\n\n- (void)setAllowFontScaling:(BOOL)allowFontScaling\n{\n  _allowFontScaling = allowFontScaling;\n  [self updateFont];\n}\n\n- (void)setFontFamily:(NSString *)fontFamily\n{\n  _fontFamily = fontFamily;\n  [self updateFont];\n}\n\n- (void)setFontSize:(NSNumber *)fontSize\n{\n  _fontSize = fontSize;\n  [self updateFont];\n}\n\n- (void)setFontSizeMultiplier:(CGFloat)fontSizeMultiplier\n{\n   _fontSizeMultiplier = fontSizeMultiplier;\n\n  if (_fontSizeMultiplier == 0) {\n    RCTLogError(@\"fontSizeMultiplier value must be > zero.\");\n    _fontSizeMultiplier = 1.0;\n  }\n\n  [self updateFont];\n}\n\n- (void)setFontStyle:(NSString *)fontStyle\n{\n  _fontStyle = fontStyle;\n  [self updateFont];\n}\n\n- (void)setFontWeight:(NSString *)fontWeight\n{\n  _fontWeight = fontWeight;\n  [self updateFont];\n}\n\n- (void)updateFont\n{\n  CGFloat scaleMultiplier = self.allowFontScaling ? self.fontSizeMultiplier : 1.0;\n  self.font = [RCTFont updateFont:nil\n                       withFamily:self.fontFamily\n                             size:self.fontSize\n                           weight:self.fontWeight\n                           style:self.fontStyle\n                         variant:nil\n                 scaleMultiplier:scaleMultiplier];\n\n  [self.delegate fontAttributesDidChangeWithFont:self.font];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTFontAttributesDelegate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n@protocol RCTFontAttributesDelegate <NSObject>\n\n- (void)fontAttributesDidChangeWithFont:(NSFont *)font;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTRawTextShadowView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTShadowView.h>\n\n@interface RCTRawTextShadowView : RCTShadowView\n\n@property (nonatomic, copy) NSString *text;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTRawTextShadowView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTRawTextShadowView.h\"\n\n#import <React/RCTUIManager.h>\n\n@implementation RCTRawTextShadowView\n\n- (instancetype)init\n{\n  if ((self = [super init])) {\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(contentSizeMultiplierDidChange:)\n                                                 name:RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification\n                                               object:nil];\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (void)contentSizeMultiplierDidChange:(NSNotification *)note\n{\n  [self dirtyText];\n}\n\n- (void)setText:(NSString *)text\n{\n  if (_text != text && ![_text isEqualToString:text]) {\n    _text = [text copy];\n    [self dirtyText];\n  }\n}\n\n- (NSString *)description\n{\n  NSString *superDescription = super.description;\n  return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@\"; text: %@>\", self.text];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTRawTextViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTRawTextViewManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTRawTextViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTRawTextViewManager.h\"\n\n#import \"RCTRawTextShadowView.h\"\n\n@implementation RCTRawTextViewManager\n\nRCT_EXPORT_MODULE(RCTRawText)\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTRawTextShadowView new];\n}\n\nRCT_EXPORT_SHADOW_PROPERTY(text, NSString)\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTSecureTextField.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@class RCTEventDispatcher;\n\n@interface RCTSecureTextField : NSSecureTextField <NSTextFieldDelegate>\n\n@property (nonatomic, assign) BOOL selectTextOnFocus;\n@property (nonatomic, assign) NSEdgeInsets contentInset;\n@property (nonatomic, assign) NSInteger mostRecentEventCount;\n@property (nonatomic, strong) NSNumber *maxLength;\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;\n\n@end\n\n"
  },
  {
    "path": "Libraries/Text/RCTSecureTextField.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSecureTextField.h\"\n\n#import \"React/RCTConvert.h\"\n#import \"React/RCTEventDispatcher.h\"\n#import \"React/RCTUtils.h\"\n#import \"React/NSView+React.h\"\n\n@implementation RCTSecureTextField\n{\n  RCTEventDispatcher *_eventDispatcher;\n  NSMutableArray *_reactSubviews;\n  BOOL _jsRequestingFirstResponder;\n  NSInteger _nativeEventCount;\n}\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher\n{\n  if ((self = [super initWithFrame:CGRectZero])) {\n    RCTAssert(eventDispatcher, @\"eventDispatcher is a required parameter\");\n    _eventDispatcher = eventDispatcher;\n    self.delegate = self;\n    self.drawsBackground = NO;\n    self.bordered = NO;\n    self.bezeled = YES;\n\n    _reactSubviews = [NSMutableArray new];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (void)setText:(NSString *)text\n{\n  NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n  if (eventLag == 0 && ![text isEqualToString:[self stringValue]]) {\n    //NSRange *selection = [self value]\n    [self setStringValue:text];\n    //self.selectedTextRange = selection; // maintain cursor position/selection - this is robust to out of bounds\n  } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n    RCTLogWarn(@\"Native TextInput(%@) is %zd events ahead of JS - try to make your JS faster.\", [self stringValue], eventLag);\n  }\n}\n\n- (void)textDidChange:(NSNotification *)aNotification\n{\n  _nativeEventCount++;\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeChange\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n- (void)textDidEndEditing:(NSNotification *)aNotification\n{\n  _nativeEventCount++;\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n- (void)textDidBeginEditing:(NSNotification *)aNotification\n{\n  if (_selectTextOnFocus) {\n    dispatch_async(dispatch_get_main_queue(), ^{\n      [self selectAll:nil];\n    });\n  }\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n- (BOOL)becomeFirstResponder\n{\n  _jsRequestingFirstResponder = YES;\n  BOOL result = [super becomeFirstResponder];\n  _jsRequestingFirstResponder = NO;\n  return result;\n}\n\n- (BOOL)resignFirstResponder\n{\n  BOOL result = [super resignFirstResponder];\n  if (result)\n  {\n    [_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur\n                                   reactTag:self.reactTag\n                                       text:[self stringValue]\n                                        key:nil\n                                 eventCount:_nativeEventCount];\n  }\n  return result;\n}\n\n- (BOOL)canBecomeFirstResponder\n{\n  return _jsRequestingFirstResponder;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTText.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t59E604521FE9CAF100BD90C5 /* RCTTextShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E6042F1FE9CAF100BD90C5 /* RCTTextShadowView.m */; };\n\t\t59E604531FE9CAF100BD90C5 /* RCTTextShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E6042F1FE9CAF100BD90C5 /* RCTTextShadowView.m */; };\n\t\t59E604541FE9CAF100BD90C5 /* RCTTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E604311FE9CAF100BD90C5 /* RCTTextView.m */; };\n\t\t59E604551FE9CAF100BD90C5 /* RCTTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E604311FE9CAF100BD90C5 /* RCTTextView.m */; };\n\t\t59E604561FE9CAF100BD90C5 /* RCTTextViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E604331FE9CAF100BD90C5 /* RCTTextViewManager.m */; };\n\t\t59E604571FE9CAF100BD90C5 /* RCTTextViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E604331FE9CAF100BD90C5 /* RCTTextViewManager.m */; };\n\t\t59E604581FE9CAF100BD90C5 /* RCTRawTextShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E604341FE9CAF100BD90C5 /* RCTRawTextShadowView.m */; };\n\t\t59E604591FE9CAF100BD90C5 /* RCTRawTextShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E604341FE9CAF100BD90C5 /* RCTRawTextShadowView.m */; };\n\t\t59E6045A1FE9CAF100BD90C5 /* RCTRawTextViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E604361FE9CAF100BD90C5 /* RCTRawTextViewManager.m */; };\n\t\t59E6045B1FE9CAF100BD90C5 /* RCTRawTextViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E604361FE9CAF100BD90C5 /* RCTRawTextViewManager.m */; };\n\t\t59E604731FE9CB3F00BD90C5 /* RCTFontAttributes.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = A85C82981F742AA20036C019 /* RCTFontAttributes.h */; };\n\t\t59E604741FE9CB3F00BD90C5 /* RCTFontAttributesDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = A85C82BA1F742D8F0036C019 /* RCTFontAttributesDelegate.h */; };\n\t\t59E604751FE9CB3F00BD90C5 /* RCTRawTextShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59E6042C1FE9CAF100BD90C5 /* RCTRawTextShadowView.h */; };\n\t\t59E604761FE9CB3F00BD90C5 /* RCTRawTextViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59E604351FE9CAF100BD90C5 /* RCTRawTextViewManager.h */; };\n\t\t59E604771FE9CB3F00BD90C5 /* RCTTextShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59E6042E1FE9CAF100BD90C5 /* RCTTextShadowView.h */; };\n\t\t59E604781FE9CB3F00BD90C5 /* RCTTextView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59E604301FE9CAF100BD90C5 /* RCTTextView.h */; };\n\t\t59E604791FE9CB3F00BD90C5 /* RCTTextViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59E604321FE9CAF100BD90C5 /* RCTTextViewManager.h */; };\n\t\t59E604881FE9CB4A00BD90C5 /* RCTFontAttributes.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = A85C82981F742AA20036C019 /* RCTFontAttributes.h */; };\n\t\t59E604891FE9CB4A00BD90C5 /* RCTFontAttributesDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = A85C82BA1F742D8F0036C019 /* RCTFontAttributesDelegate.h */; };\n\t\t59E6048A1FE9CB4A00BD90C5 /* RCTRawTextShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59E6042C1FE9CAF100BD90C5 /* RCTRawTextShadowView.h */; };\n\t\t59E6048B1FE9CB4A00BD90C5 /* RCTRawTextViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59E604351FE9CAF100BD90C5 /* RCTRawTextViewManager.h */; };\n\t\t59E6048C1FE9CB4A00BD90C5 /* RCTTextShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59E6042E1FE9CAF100BD90C5 /* RCTTextShadowView.h */; };\n\t\t59E6048D1FE9CB4A00BD90C5 /* RCTTextView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59E604301FE9CAF100BD90C5 /* RCTTextView.h */; };\n\t\t59E6048E1FE9CB4A00BD90C5 /* RCTTextViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59E604321FE9CAF100BD90C5 /* RCTTextViewManager.h */; };\n\t\t59E8C5CC1F8833D100204F5E /* RCTFontAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = A85C82991F742AA20036C019 /* RCTFontAttributes.m */; };\n\t\tA85C829A1F742AA20036C019 /* RCTFontAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = A85C82991F742AA20036C019 /* RCTFontAttributes.m */; };\n\t\tD4EEE317201FA3B300C4CBB6 /* RCTMultilineTextInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE303201FA3B100C4CBB6 /* RCTMultilineTextInputView.m */; };\n\t\tD4EEE318201FA3B300C4CBB6 /* RCTUITextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE307201FA3B100C4CBB6 /* RCTUITextView.m */; };\n\t\tD4EEE31A201FA3B300C4CBB6 /* RCTShadowTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE30C201FA3B200C4CBB6 /* RCTShadowTextView.m */; };\n\t\tD4EEE31B201FA3B300C4CBB6 /* RCTTextSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE30D201FA3B200C4CBB6 /* RCTTextSelection.m */; };\n\t\tD4EEE31C201FA3B300C4CBB6 /* RCTTextFieldManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE310201FA3B200C4CBB6 /* RCTTextFieldManager.m */; };\n\t\tD4EEE31D201FA3B300C4CBB6 /* RCTSecureTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE312201FA3B200C4CBB6 /* RCTSecureTextField.m */; };\n\t\tD4EEE31E201FA3B300C4CBB6 /* RCTTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE313201FA3B200C4CBB6 /* RCTTextField.m */; };\n\t\tD4EEE31F201FA3B300C4CBB6 /* RCTShadowTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE315201FA3B300C4CBB6 /* RCTShadowTextField.m */; };\n\t\tD4EEE320201FA3B300C4CBB6 /* RCTTextViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE316201FA3B300C4CBB6 /* RCTTextViewManager.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t599DF25E1F0306540079B53E /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/RCTText;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t59E604881FE9CB4A00BD90C5 /* RCTFontAttributes.h in Copy Headers */,\n\t\t\t\t59E604891FE9CB4A00BD90C5 /* RCTFontAttributesDelegate.h in Copy Headers */,\n\t\t\t\t59E6048A1FE9CB4A00BD90C5 /* RCTRawTextShadowView.h in Copy Headers */,\n\t\t\t\t59E6048B1FE9CB4A00BD90C5 /* RCTRawTextViewManager.h in Copy Headers */,\n\t\t\t\t59E6048C1FE9CB4A00BD90C5 /* RCTTextShadowView.h in Copy Headers */,\n\t\t\t\t59E6048D1FE9CB4A00BD90C5 /* RCTTextView.h in Copy Headers */,\n\t\t\t\t59E6048E1FE9CB4A00BD90C5 /* RCTTextViewManager.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t599DF2601F0306AD0079B53E /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/RCTText;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t59E604731FE9CB3F00BD90C5 /* RCTFontAttributes.h in Copy Headers */,\n\t\t\t\t59E604741FE9CB3F00BD90C5 /* RCTFontAttributesDelegate.h in Copy Headers */,\n\t\t\t\t59E604751FE9CB3F00BD90C5 /* RCTRawTextShadowView.h in Copy Headers */,\n\t\t\t\t59E604761FE9CB3F00BD90C5 /* RCTRawTextViewManager.h in Copy Headers */,\n\t\t\t\t59E604771FE9CB3F00BD90C5 /* RCTTextShadowView.h in Copy Headers */,\n\t\t\t\t59E604781FE9CB3F00BD90C5 /* RCTTextView.h in Copy Headers */,\n\t\t\t\t59E604791FE9CB3F00BD90C5 /* RCTTextViewManager.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t2D2A287B1D9B048500D4039D /* libRCTText-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libRCTText-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t58B5119B1A9E6C1200147676 /* libRCTText.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTText.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t59E6042C1FE9CAF100BD90C5 /* RCTRawTextShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRawTextShadowView.h; sourceTree = \"<group>\"; };\n\t\t59E6042E1FE9CAF100BD90C5 /* RCTTextShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTextShadowView.h; sourceTree = \"<group>\"; };\n\t\t59E6042F1FE9CAF100BD90C5 /* RCTTextShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTextShadowView.m; sourceTree = \"<group>\"; };\n\t\t59E604301FE9CAF100BD90C5 /* RCTTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTextView.h; sourceTree = \"<group>\"; };\n\t\t59E604311FE9CAF100BD90C5 /* RCTTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTextView.m; sourceTree = \"<group>\"; };\n\t\t59E604321FE9CAF100BD90C5 /* RCTTextViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTextViewManager.h; sourceTree = \"<group>\"; };\n\t\t59E604331FE9CAF100BD90C5 /* RCTTextViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTextViewManager.m; sourceTree = \"<group>\"; };\n\t\t59E604341FE9CAF100BD90C5 /* RCTRawTextShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRawTextShadowView.m; sourceTree = \"<group>\"; };\n\t\t59E604351FE9CAF100BD90C5 /* RCTRawTextViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRawTextViewManager.h; sourceTree = \"<group>\"; };\n\t\t59E604361FE9CAF100BD90C5 /* RCTRawTextViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRawTextViewManager.m; sourceTree = \"<group>\"; };\n\t\tA85C82981F742AA20036C019 /* RCTFontAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTFontAttributes.h; sourceTree = \"<group>\"; };\n\t\tA85C82991F742AA20036C019 /* RCTFontAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTFontAttributes.m; sourceTree = \"<group>\"; };\n\t\tA85C82BA1F742D8F0036C019 /* RCTFontAttributesDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTFontAttributesDelegate.h; sourceTree = \"<group>\"; };\n\t\tD4EEE303201FA3B100C4CBB6 /* RCTMultilineTextInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTMultilineTextInputView.m; path = TextInputLegacy/RCTMultilineTextInputView.m; sourceTree = \"<group>\"; };\n\t\tD4EEE304201FA3B100C4CBB6 /* RCTShadowTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTShadowTextField.h; path = TextInputLegacy/RCTShadowTextField.h; sourceTree = \"<group>\"; };\n\t\tD4EEE305201FA3B100C4CBB6 /* RCTShadowTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTShadowTextView.h; path = TextInputLegacy/RCTShadowTextView.h; sourceTree = \"<group>\"; };\n\t\tD4EEE306201FA3B100C4CBB6 /* RCTTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTTextField.h; path = TextInputLegacy/RCTTextField.h; sourceTree = \"<group>\"; };\n\t\tD4EEE307201FA3B100C4CBB6 /* RCTUITextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTUITextView.m; path = TextInputLegacy/RCTUITextView.m; sourceTree = \"<group>\"; };\n\t\tD4EEE308201FA3B100C4CBB6 /* RCTTextFieldManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTTextFieldManager.h; path = TextInputLegacy/RCTTextFieldManager.h; sourceTree = \"<group>\"; };\n\t\tD4EEE309201FA3B100C4CBB6 /* RCTTextSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTTextSelection.h; path = TextInputLegacy/RCTTextSelection.h; sourceTree = \"<group>\"; };\n\t\tD4EEE30A201FA3B100C4CBB6 /* RCTSecureTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTSecureTextField.h; path = TextInputLegacy/RCTSecureTextField.h; sourceTree = \"<group>\"; };\n\t\tD4EEE30C201FA3B200C4CBB6 /* RCTShadowTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTShadowTextView.m; path = TextInputLegacy/RCTShadowTextView.m; sourceTree = \"<group>\"; };\n\t\tD4EEE30D201FA3B200C4CBB6 /* RCTTextSelection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTTextSelection.m; path = TextInputLegacy/RCTTextSelection.m; sourceTree = \"<group>\"; };\n\t\tD4EEE30E201FA3B200C4CBB6 /* RCTMultilineTextInputView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTMultilineTextInputView.h; path = TextInputLegacy/RCTMultilineTextInputView.h; sourceTree = \"<group>\"; };\n\t\tD4EEE30F201FA3B200C4CBB6 /* RCTTextViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTTextViewManager.h; path = TextInputLegacy/RCTTextViewManager.h; sourceTree = \"<group>\"; };\n\t\tD4EEE310201FA3B200C4CBB6 /* RCTTextFieldManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTTextFieldManager.m; path = TextInputLegacy/RCTTextFieldManager.m; sourceTree = \"<group>\"; };\n\t\tD4EEE311201FA3B200C4CBB6 /* RCTUITextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTUITextView.h; path = TextInputLegacy/RCTUITextView.h; sourceTree = \"<group>\"; };\n\t\tD4EEE312201FA3B200C4CBB6 /* RCTSecureTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTSecureTextField.m; path = TextInputLegacy/RCTSecureTextField.m; sourceTree = \"<group>\"; };\n\t\tD4EEE313201FA3B200C4CBB6 /* RCTTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTTextField.m; path = TextInputLegacy/RCTTextField.m; sourceTree = \"<group>\"; };\n\t\tD4EEE315201FA3B300C4CBB6 /* RCTShadowTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTShadowTextField.m; path = TextInputLegacy/RCTShadowTextField.m; sourceTree = \"<group>\"; };\n\t\tD4EEE316201FA3B300C4CBB6 /* RCTTextViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTTextViewManager.m; path = TextInputLegacy/RCTTextViewManager.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXGroup section */\n\t\t58B511921A9E6C1200147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD4EEE302201FA3A100C4CBB6 /* TextInputLegacy */,\n\t\t\t\t58B5119C1A9E6C1200147676 /* Products */,\n\t\t\t\tA85C82981F742AA20036C019 /* RCTFontAttributes.h */,\n\t\t\t\tA85C82991F742AA20036C019 /* RCTFontAttributes.m */,\n\t\t\t\tA85C82BA1F742D8F0036C019 /* RCTFontAttributesDelegate.h */,\n\t\t\t\t59E6042C1FE9CAF100BD90C5 /* RCTRawTextShadowView.h */,\n\t\t\t\t59E604341FE9CAF100BD90C5 /* RCTRawTextShadowView.m */,\n\t\t\t\t59E604351FE9CAF100BD90C5 /* RCTRawTextViewManager.h */,\n\t\t\t\t59E604361FE9CAF100BD90C5 /* RCTRawTextViewManager.m */,\n\t\t\t\t59E6042D1FE9CAF100BD90C5 /* Text */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t58B5119C1A9E6C1200147676 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t58B5119B1A9E6C1200147676 /* libRCTText.a */,\n\t\t\t\t2D2A287B1D9B048500D4039D /* libRCTText-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t59E6042D1FE9CAF100BD90C5 /* Text */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t59E6042E1FE9CAF100BD90C5 /* RCTTextShadowView.h */,\n\t\t\t\t59E6042F1FE9CAF100BD90C5 /* RCTTextShadowView.m */,\n\t\t\t\t59E604301FE9CAF100BD90C5 /* RCTTextView.h */,\n\t\t\t\t59E604311FE9CAF100BD90C5 /* RCTTextView.m */,\n\t\t\t\t59E604321FE9CAF100BD90C5 /* RCTTextViewManager.h */,\n\t\t\t\t59E604331FE9CAF100BD90C5 /* RCTTextViewManager.m */,\n\t\t\t);\n\t\t\tpath = Text;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tD4EEE302201FA3A100C4CBB6 /* TextInputLegacy */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD4EEE30E201FA3B200C4CBB6 /* RCTMultilineTextInputView.h */,\n\t\t\t\tD4EEE303201FA3B100C4CBB6 /* RCTMultilineTextInputView.m */,\n\t\t\t\tD4EEE30A201FA3B100C4CBB6 /* RCTSecureTextField.h */,\n\t\t\t\tD4EEE312201FA3B200C4CBB6 /* RCTSecureTextField.m */,\n\t\t\t\tD4EEE304201FA3B100C4CBB6 /* RCTShadowTextField.h */,\n\t\t\t\tD4EEE315201FA3B300C4CBB6 /* RCTShadowTextField.m */,\n\t\t\t\tD4EEE305201FA3B100C4CBB6 /* RCTShadowTextView.h */,\n\t\t\t\tD4EEE30C201FA3B200C4CBB6 /* RCTShadowTextView.m */,\n\t\t\t\tD4EEE306201FA3B100C4CBB6 /* RCTTextField.h */,\n\t\t\t\tD4EEE313201FA3B200C4CBB6 /* RCTTextField.m */,\n\t\t\t\tD4EEE308201FA3B100C4CBB6 /* RCTTextFieldManager.h */,\n\t\t\t\tD4EEE310201FA3B200C4CBB6 /* RCTTextFieldManager.m */,\n\t\t\t\tD4EEE309201FA3B100C4CBB6 /* RCTTextSelection.h */,\n\t\t\t\tD4EEE30D201FA3B200C4CBB6 /* RCTTextSelection.m */,\n\t\t\t\tD4EEE30F201FA3B200C4CBB6 /* RCTTextViewManager.h */,\n\t\t\t\tD4EEE316201FA3B300C4CBB6 /* RCTTextViewManager.m */,\n\t\t\t\tD4EEE311201FA3B200C4CBB6 /* RCTUITextView.h */,\n\t\t\t\tD4EEE307201FA3B100C4CBB6 /* RCTUITextView.m */,\n\t\t\t);\n\t\t\tname = TextInputLegacy;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t2D2A287A1D9B048500D4039D /* RCTText-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D2A28831D9B048500D4039D /* Build configuration list for PBXNativeTarget \"RCTText-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t599DF2601F0306AD0079B53E /* Copy Headers */,\n\t\t\t\t2D2A28771D9B048500D4039D /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"RCTText-tvOS\";\n\t\t\tproductName = \"RCTText-tvOS\";\n\t\t\tproductReference = 2D2A287B1D9B048500D4039D /* libRCTText-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t58B5119A1A9E6C1200147676 /* RCTText */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511AF1A9E6C1300147676 /* Build configuration list for PBXNativeTarget \"RCTText\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t599DF25E1F0306540079B53E /* Copy Headers */,\n\t\t\t\t58B511971A9E6C1200147676 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTText;\n\t\t\tproductName = RCTText;\n\t\t\tproductReference = 58B5119B1A9E6C1200147676 /* libRCTText.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511931A9E6C1200147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t2D2A287A1D9B048500D4039D = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t58B5119A1A9E6C1200147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511961A9E6C1200147676 /* Build configuration list for PBXProject \"RCTText\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511921A9E6C1200147676;\n\t\t\tproductRefGroup = 58B5119C1A9E6C1200147676 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B5119A1A9E6C1200147676 /* RCTText */,\n\t\t\t\t2D2A287A1D9B048500D4039D /* RCTText-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t2D2A28771D9B048500D4039D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t59E604571FE9CAF100BD90C5 /* RCTTextViewManager.m in Sources */,\n\t\t\t\t59E604531FE9CAF100BD90C5 /* RCTTextShadowView.m in Sources */,\n\t\t\t\t59E604591FE9CAF100BD90C5 /* RCTRawTextShadowView.m in Sources */,\n\t\t\t\t59E604551FE9CAF100BD90C5 /* RCTTextView.m in Sources */,\n\t\t\t\t59E8C5CC1F8833D100204F5E /* RCTFontAttributes.m in Sources */,\n\t\t\t\t59E6045B1FE9CAF100BD90C5 /* RCTRawTextViewManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t58B511971A9E6C1200147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t59E604561FE9CAF100BD90C5 /* RCTTextViewManager.m in Sources */,\n\t\t\t\tD4EEE318201FA3B300C4CBB6 /* RCTUITextView.m in Sources */,\n\t\t\t\tD4EEE31C201FA3B300C4CBB6 /* RCTTextFieldManager.m in Sources */,\n\t\t\t\tD4EEE31D201FA3B300C4CBB6 /* RCTSecureTextField.m in Sources */,\n\t\t\t\t59E604521FE9CAF100BD90C5 /* RCTTextShadowView.m in Sources */,\n\t\t\t\tD4EEE320201FA3B300C4CBB6 /* RCTTextViewManager.m in Sources */,\n\t\t\t\tD4EEE31A201FA3B300C4CBB6 /* RCTShadowTextView.m in Sources */,\n\t\t\t\tD4EEE31F201FA3B300C4CBB6 /* RCTShadowTextField.m in Sources */,\n\t\t\t\tD4EEE31B201FA3B300C4CBB6 /* RCTTextSelection.m in Sources */,\n\t\t\t\tD4EEE317201FA3B300C4CBB6 /* RCTMultilineTextInputView.m in Sources */,\n\t\t\t\t59E604581FE9CAF100BD90C5 /* RCTRawTextShadowView.m in Sources */,\n\t\t\t\tD4EEE31E201FA3B300C4CBB6 /* RCTTextField.m in Sources */,\n\t\t\t\t59E604541FE9CAF100BD90C5 /* RCTTextView.m in Sources */,\n\t\t\t\tA85C829A1F742AA20036C019 /* RCTFontAttributes.m in Sources */,\n\t\t\t\t59E6045A1FE9CAF100BD90C5 /* RCTRawTextViewManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t2D2A28811D9B048500D4039D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D2A28821D9B048500D4039D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511AD1A9E6C1300147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511AE1A9E6C1300147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511B01A9E6C1300147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511B11A9E6C1300147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t2D2A28831D9B048500D4039D /* Build configuration list for PBXNativeTarget \"RCTText-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D2A28811D9B048500D4039D /* Debug */,\n\t\t\t\t2D2A28821D9B048500D4039D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511961A9E6C1200147676 /* Build configuration list for PBXProject \"RCTText\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511AD1A9E6C1300147676 /* Debug */,\n\t\t\t\t58B511AE1A9E6C1300147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511AF1A9E6C1300147676 /* Build configuration list for PBXNativeTarget \"RCTText\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511B01A9E6C1300147676 /* Debug */,\n\t\t\t\t58B511B11A9E6C1300147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511931A9E6C1200147676 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/Text/RCTTextField.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTComponent.h>\n\n@class RCTEventDispatcher;\n\n@interface TextFieldCellWithPaddings : NSTextFieldCell\n@end\n\n@interface RCTTextField : NSTextField <NSTextFieldDelegate, NSTextViewDelegate>\n\n@property (nonatomic, assign) BOOL caretHidden;\n@property (nonatomic, assign) BOOL selectTextOnFocus;\n@property (nonatomic, assign) NSEdgeInsets contentInset;\n@property (nonatomic, strong) NSColor *placeholderTextColor;\n@property (nonatomic, strong) NSColor *selectionColor;\n@property (nonatomic, assign) NSInteger mostRecentEventCount;\n@property (nonatomic, strong) NSNumber *maxLength;\n\n@property (nonatomic, copy) RCTDirectEventBlock onSelectionChange;\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTTextField.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextField.h\"\n\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTUtils.h>\n#import <React/NSView+React.h>\n\n#import \"RCTTextSelection.h\"\n\n\n@implementation RCTTextField\n{\n  RCTEventDispatcher *_eventDispatcher;\n  NSInteger _nativeEventCount;\n  NSString * _placeholderString;\n  BOOL _submitted;\n  NSRange _previousSelectionRange;\n  BOOL _textWasPasted;\n  NSString *_finalText;\n}\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher\n{\n  if ((self = [super initWithFrame:CGRectZero])) {\n    RCTAssert(eventDispatcher, @\"eventDispatcher is a required parameter\");\n    self.delegate = self;\n    self.drawsBackground = NO;\n    self.bordered = NO;\n    self.bezeled = NO;\n\n    _eventDispatcher = eventDispatcher;\n\n    [self addObserver:self forKeyPath:@\"selectedTextRange\" options:0 context:nil];\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  [self removeObserver:self forKeyPath:@\"selectedTextRange\"];\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (void)sendKeyValueForString:(NSString *)string\n{\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeKeyPress\n                                 reactTag:self.reactTag\n                                     text:nil\n                                      key:string\n                               eventCount:_nativeEventCount];\n}\n\n-(void)keyUp:(NSEvent *)theEvent\n{\n  [self sendKeyValueForString: [NSString stringWithFormat:@\"%i\", theEvent.keyCode ]];\n}\n\n// TODO:\n// figure out why this method doesn't get called\n\n//- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector\n//{\n//  NSEvent *currentEvent = [[NSApplication sharedApplication]currentEvent];\n//  [self sendKeyValueForString: [NSString stringWithFormat:@\"%i\", currentEvent.keyCode ]];\n//  return YES;\n//}\n//\n//- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString;\n//{\n//  [self sendKeyValueForString: replacementString];\n//  return YES;\n//}\n\n// This method is overridden for `onKeyPress`. The manager\n// will not send a keyPress for text that was pasted.\n- (void)paste:(id)sender\n{\n  _textWasPasted = YES;\n  [[super currentEditor] paste:sender];\n}\n\n- (void)setSelection:(RCTTextSelection *)selection\n{\n  if (!selection) {\n    return;\n  }\n\n//  UITextRange *currentSelection = self.selectedTextRange;\n//  UITextPosition *start = [self positionFromPosition:self.beginningOfDocument offset:selection.start];\n//  UITextPosition *end = [self positionFromPosition:self.beginningOfDocument offset:selection.end];\n//  UITextRange *selectedTextRange = [self textRangeFromPosition:start toPosition:end];\n//\n//  NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n//  if (eventLag == 0 && ![currentSelection isEqual:selectedTextRange]) {\n//    _previousSelectionRange = selectedTextRange;\n//    self.selectedTextRange = selectedTextRange;\n//  } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n//    RCTLogWarn(@\"Native TextInput(%@) is %zd events ahead of JS - try to make your JS faster.\", self.text, eventLag);\n//  }\n}\n\n\n- (void)setText:(NSString *)text\n{\n  NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n  if (eventLag == 0 && ![text isEqualToString:[self stringValue]]) {\n    [self setStringValue:text];\n    // TODO: maintain cursor position\n  } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n    RCTLogWarn(@\"Native TextInput(%@) is %zd events ahead of JS - try to make your JS faster.\", [self stringValue], eventLag);\n  }\n}\n\n- (void)setPlaceholderTextColor:(NSColor *)placeholderTextColor\n{\n  if (placeholderTextColor != nil && ![_placeholderTextColor isEqual:placeholderTextColor]) {\n    _placeholderTextColor = placeholderTextColor;\n    [self updatePlaceholder];\n  }\n}\n\n- (void)updatePlaceholder\n{\n  [self setPlaceholderString:_placeholderString];\n  if (_placeholderTextColor && _placeholderString) {\n    NSAttributedString *attrString = [[NSAttributedString alloc]\n                                      initWithString:_placeholderString attributes: @{\n                                        NSForegroundColorAttributeName: _placeholderTextColor,\n                                        NSFontAttributeName: [self font]\n                                      }];\n    [self setPlaceholderAttributedString:attrString];\n  }\n}\n\n- (void)setPlaceholder:(NSString *)placeholder\n{\n  if (placeholder != nil && ![_placeholderString isEqual:placeholder]) {\n    _placeholderString = placeholder;\n    [self updatePlaceholder];\n  }\n}\n\n- (void)setBackgroundColor:(NSColor *)backgroundColor\n{\n  if (backgroundColor) {\n    [self setDrawsBackground:YES];\n    [self.cell setBackgroundColor:backgroundColor];\n  }\n}\n\n- (void)textDidChange:(NSNotification *)aNotification\n{\n  _nativeEventCount++;\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeChange\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n\n  // selectedTextRange observer isn't triggered when you type even though the\n  // cursor position moves, so we send event again here.\n  [self sendSelectionEvent];\n}\n\n- (void)textDidEndEditing:(NSNotification *)aNotification\n{\n  if (![_finalText isEqualToString:self.stringValue]) {\n    _finalText = nil;\n    // iOS does't send event `UIControlEventEditingChanged` if the change was happened because of autocorrection\n    // which was triggered by loosing focus. We assume that if `text` was changed in the middle of loosing focus process,\n    // we did not receive that event. So, we call `textFieldDidChange` manually.\n    [self textDidChange:(NSNotification *)self];\n  }\n\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n- (void)textFieldSubmitEditing\n{\n  _submitted = YES;\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeSubmit\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n- (void)textDidBeginEditing:(NSNotification *)aNotification\n{\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n\n  dispatch_async(dispatch_get_main_queue(), ^{\n    if (self->_selectTextOnFocus) {\n      [self selectAll:nil];\n    }\n\n    [self sendSelectionEvent];\n  });\n}\n\n- (void)observeValueForKeyPath:(NSString *)keyPath\n                      ofObject:(RCTTextField *)textField\n                        change:(NSDictionary *)change\n                       context:(void *)context\n{\n  if ([keyPath isEqualToString:@\"selectedTextRange\"]) {\n    [self sendSelectionEvent];\n  }\n}\n\n- (void)sendSelectionEvent\n{\n  if (_onSelectionChange &&\n      (self.currentEditor.selectedRange.location != _previousSelectionRange.location ||\n      self.currentEditor.selectedRange.length != _previousSelectionRange.length)) {\n\n    _previousSelectionRange = self.currentEditor.selectedRange;\n\n    NSRange selection = self.currentEditor.selectedRange;\n    NSInteger start = selection.location;\n    NSInteger end = selection.location + selection.length;\n    _onSelectionChange(@{\n      @\"selection\": @{\n        @\"start\": @(start),\n        @\"end\": @(end),\n      },\n    });\n  }\n}\n\n- (BOOL)resignFirstResponder\n{\n  BOOL result = [super resignFirstResponder];\n  if (result)\n  {\n    [_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur\n                                   reactTag:self.reactTag\n                                       text:[self stringValue]\n                                        key:nil\n                                 eventCount:_nativeEventCount];\n  }\n  return result;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTTextFieldManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextFieldManager.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTFont.h>\n#import <React/RCTShadowView.h>\n\n#import \"RCTShadowTextField.h\"\n#import \"RCTTextField.h\"\n#import \"RCTSecureTextField.h\"\n\n@implementation RCTConvert(RCTTextField)\n\nRCT_ENUM_CONVERTER(NSFocusRingType, (@{\n    @\"default\": @(NSFocusRingTypeDefault),\n    @\"none\": @(NSFocusRingTypeNone),\n    @\"exterior\": @(NSFocusRingTypeExterior)\n}), NSFocusRingTypeDefault, integerValue)\n\n@end\n\n@interface RCTTextFieldManager() <NSTextFieldDelegate>\n\n@end\n\n@implementation RCTTextFieldManager\n\nRCT_EXPORT_MODULE()\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTShadowTextField new];\n}\n\n- (NSView *)view\n{\n    RCTTextField *textField = [[RCTTextField alloc] initWithEventDispatcher:self.bridge.eventDispatcher];\n    textField.delegate = self;\n    return textField;\n}\n\nRCT_EXPORT_VIEW_PROPERTY(bezeled, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(bordered, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(caretHidden, BOOL)\nRCT_REMAP_VIEW_PROPERTY(editable, enabled, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(placeholder, NSString)\nRCT_EXPORT_VIEW_PROPERTY(placeholderTextColor, NSColor)\nRCT_EXPORT_VIEW_PROPERTY(selection, RCTTextSelection)\nRCT_EXPORT_VIEW_PROPERTY(text, NSString)\nRCT_EXPORT_VIEW_PROPERTY(maxLength, NSNumber)\nRCT_EXPORT_VIEW_PROPERTY(focusRingType, NSFocusRingType)\nRCT_EXPORT_VIEW_PROPERTY(selectionColor, NSColor)\nRCT_REMAP_VIEW_PROPERTY(textAlign, alignment, NSTextAlignment)\nRCT_REMAP_VIEW_PROPERTY(color, textColor, NSColor)\nRCT_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)];\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withWeight:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withStyle:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withFamily:json ?: defaultView.font.familyName];\n}\nRCT_EXPORT_VIEW_PROPERTY(mostRecentEventCount, NSInteger)\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView\n{\n  NSNumber *reactTag = shadowView.reactTag;\n  NSEdgeInsets padding = shadowView.paddingAsInsets;\n  return ^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTTextField *> *viewRegistry) {\n    ((RCTTextField *)viewRegistry[reactTag]).contentInset = padding;\n  };\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  RCTTextField *view = [[RCTTextField alloc] initWithEventDispatcher:self.bridge.eventDispatcher];\n  return @{\n     @\"ComponentHeight\": @(view.intrinsicContentSize.height),\n     @\"ComponentWidth\": @(view.intrinsicContentSize.width)\n  };\n}\n\n@end\n\n@interface RCTSecureTextFieldManager() <NSTextFieldDelegate>\n@end\n\n// TODO: extract common logic into one place\n@implementation RCTSecureTextFieldManager\n\nRCT_EXPORT_MODULE()\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES;\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  RCTTextField *view = [[RCTTextField alloc] initWithEventDispatcher:self.bridge.eventDispatcher];\n  return @{\n           @\"ComponentHeight\": @(view.intrinsicContentSize.height),\n           @\"ComponentWidth\": @(view.intrinsicContentSize.width)\n           };\n}\n\n- (NSView *)view\n{\n  RCTSecureTextField *textField = [[RCTSecureTextField alloc] initWithEventDispatcher:self.bridge.eventDispatcher];\n  textField.delegate = self;\n  return textField;\n}\n\nRCT_EXPORT_VIEW_PROPERTY(bezeled, BOOL)\nRCT_REMAP_VIEW_PROPERTY(editable, enabled, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(text, NSString)\nRCT_EXPORT_VIEW_PROPERTY(maxLength, NSNumber)\nRCT_EXPORT_VIEW_PROPERTY(selectionColor, NSColor)\nRCT_REMAP_VIEW_PROPERTY(color, textColor, NSColor)\nRCT_REMAP_VIEW_PROPERTY(textAlign, textAlignment, NSTextAlignment)\nRCT_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)];\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withWeight:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withStyle:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withFamily:json ?: defaultView.font.familyName];\n}\nRCT_EXPORT_VIEW_PROPERTY(mostRecentEventCount, NSInteger)\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView\n{\n  NSNumber *reactTag = shadowView.reactTag;\n  NSEdgeInsets padding = shadowView.paddingAsInsets;\n  return ^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTTextField *> *viewRegistry) {\n    viewRegistry[reactTag].contentInset = padding;\n  };\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTTextView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextView.h\"\n\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTUtils.h>\n#import <React/NSView+React.h>\n\n#import \"RCTShadowText.h\"\n#import \"RCTText.h\"\n#import \"RCTTextSelection.h\"\n#import \"RCTUITextView.h\"\n\n@implementation RCTTextView\n{\n  RCTBridge *_bridge;\n  RCTEventDispatcher *_eventDispatcher;\n\n  RCTUITextView *_textView;\n  RCTText *_richTextView;\n  NSAttributedString *_pendingAttributedText;\n  \n  NSUInteger _previousTextLength;\n  CGFloat _previousContentHeight;\n  NSString *_predictedText;\n  BOOL _blockTextShouldChange;\n  BOOL _nativeUpdatesInFlight;\n  NSInteger _nativeEventCount;\n  CGFloat _padding;\n  \n  NSArray <NSValue *> * _previousSelectionRanges;\n  NSScrollView *_scrollView;\n\n  BOOL _jsRequestingFirstResponder;\n\n  CGSize _previousContentSize;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  RCTAssertParam(bridge);\n\n  if (self = [super initWithFrame:CGRectZero]) {\n    _contentInset = NSEdgeInsetsZero;\n    _bridge = bridge;\n    _eventDispatcher = bridge.eventDispatcher;\n    _blurOnSubmit = NO;\n\n    _textView = [[RCTUITextView alloc] initWithFrame:self.bounds];\n//    _textView.autoresizingMask = NSViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;\n    _textView.backgroundColor = [NSColor clearColor];\n    _textView.textColor = [NSColor blackColor];\n    // This line actually removes 5pt (default value) left and right padding in UITextView.\n    _textView.textContainer.lineFragmentPadding = 0;\n    \n    _textView.delegate = self;\n    _textView.drawsBackground = NO;\n    _textView.focusRingType = NSFocusRingTypeDefault;\n\n    [self addSubview:_textView];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n#pragma mark - RCTComponent\n\n- (void)insertReactSubview:(NSView *)subview atIndex:(NSInteger)index\n{\n  [super insertReactSubview:subview atIndex:index];\n\n  if ([subview isKindOfClass:[RCTText class]]) {\n    if (_richTextView) {\n      RCTLogError(@\"Tried to insert a second <Text> into <TextInput> - there can only be one.\");\n    }\n    _richTextView = (RCTText *)subview;\n\n    // If this <TextInput> is in rich text editing mode, and the child <Text> node providing rich text\n    // styling has a backgroundColor, then the attributedText produced by the child <Text> node will have an\n    // NSBackgroundColor attribute. We need to forward this attribute to the text view manually because the text view\n    // always has a clear background color in `initWithBridge:`.\n    //\n    // TODO: This should be removed when the related hack in -performPendingTextUpdate is removed.\n    if (subview.layer.backgroundColor) {\n      NSMutableDictionary<NSString *, id> *attrs = [_textView.typingAttributes mutableCopy];\n      attrs[NSBackgroundColorAttributeName] = (__bridge id _Nullable)(subview.layer.backgroundColor);\n      _textView.typingAttributes = attrs;\n    }\n\n    [self performTextUpdate];\n  }\n}\n\n- (void)removeReactSubview:(NSView *)subview\n{\n  [super removeReactSubview:subview];\n  if (_richTextView == subview) {\n    _richTextView = nil;\n    [self performTextUpdate];\n  }\n}\n\n- (void)didUpdateReactSubviews\n{\n  // Do nothing, as we don't allow non-text subviews.\n}\n\n#pragma mark - Routine\n\n- (void)setMostRecentEventCount:(NSInteger)mostRecentEventCount\n{\n  _mostRecentEventCount = mostRecentEventCount;\n\n  // Props are set after uiBlockToAmendWithShadowViewRegistry, which means that\n  // at the time performTextUpdate is called, _mostRecentEventCount will be\n  // behind _eventCount, with the result that performPendingTextUpdate will do\n  // nothing. For that reason we call it again here after mostRecentEventCount\n  // has been set.\n  [self performPendingTextUpdate];\n}\n\nstatic NSAttributedString *removeReactTagFromString(NSAttributedString *string)\n{\n  if (string.length == 0) {\n    return string;\n  } else {\n    NSMutableAttributedString *mutableString = [[NSMutableAttributedString alloc] initWithAttributedString:string];\n    [mutableString removeAttribute:RCTReactTagAttributeName range:NSMakeRange(0, mutableString.length)];\n    return mutableString;\n  }\n}\n\n- (void)performTextUpdate\n{\n  if (_richTextView) {\n    _pendingAttributedText = _richTextView.textStorage;\n    [self performPendingTextUpdate];\n  } else if (!self.text) {\n    _textView.text = @\"\";\n  }\n}\n\n- (void)performPendingTextUpdate\n{\n  if (!_pendingAttributedText || _mostRecentEventCount < _nativeEventCount || _nativeUpdatesInFlight) {\n    return;\n  }\n  \n  // The underlying <Text> node that produces _pendingAttributedText has a react tag attribute on it that causes the\n  // -isEqualToAttributedString: comparison below to spuriously fail. We don't want that comparison to fail unless it\n  // needs to because when the comparison fails, we end up setting attributedText on the text view, which clears\n  // autocomplete state for CKJ text input.\n  //\n  // TODO: Kill this after we finish passing all style/attribute info into JS.\n  _pendingAttributedText = removeReactTagFromString(_pendingAttributedText);\n  \n  if ([_textView.attributedString isEqualToAttributedString:_pendingAttributedText]) {\n    _pendingAttributedText = nil; // Don't try again.\n    return;\n  }\n  \n  // When we update the attributed text, there might be pending autocorrections\n  // that will get accepted by default. In order for this to not garble our text,\n  // we temporarily block all textShouldChange events so they are not applied.\n  _blockTextShouldChange = YES;\n  \n//  UITextRange *selection = _textView.selectedTextRange;\n //  NSInteger oldTextLength = _textView.attributedString.length;\n  \n  [_textView setAttributedText:_pendingAttributedText];\n  _predictedText = _pendingAttributedText.string;\n  _pendingAttributedText = nil;\n  \n//  if (selection.empty) {\n//    // maintain cursor position relative to the end of the old text\n//    NSInteger start = [_textView offsetFromPosition:_textView.beginningOfDocument toPosition:selection.start];\n//    NSInteger offsetFromEnd = oldTextLength - start;\n//    NSInteger newOffset = _textView.attributedText.length - offsetFromEnd;\n//    UITextPosition *position = [_textView positionFromPosition:_textView.beginningOfDocument offset:newOffset];\n//    _textView.selectedTextRange = [_textView textRangeFromPosition:position toPosition:position];\n//  }\n  \n  [_textView layoutSubtreeIfNeeded];\n  \n  [self invalidateContentSize];\n  \n  _blockTextShouldChange = NO;\n}\n\n- (void)updateFrames\n{\n  // Adjust the insets so that they are as close as possible to single-line\n  // RCTTextField defaults, using the system defaults of font size 17 and a\n  // height of 31 points.\n  //\n  // We apply the left inset to the frame since a negative left text-container\n  // inset mysteriously causes the text to be hidden until the text view is\n  // first focused.\n  CGRect frame = self.frame;\n  frame.origin.y += (_contentInset.top + 2);\n  frame.size.width -= (_contentInset.left + _contentInset.right - 5);\n  _textView.frame = frame;\n\n  NSSize adjustedTextContainerInset = CGSizeMake(_padding, _padding);\n  _textView.textContainerInset = adjustedTextContainerInset;\n}\n\n- (void)setFont:(NSFont *)font\n{\n  _font = font;\n  [_textView setFont:font];\n}\n\n- (NSColor *)textColor\n{\n  return _textView.textColor;\n}\n\n- (void)setTextColor:(NSColor *)textColor\n{\n  _textView.textColor = textColor;\n}\n\n\n- (void)setPadding:(CGFloat)padding\n{\n  _padding = padding;\n  [self updateFrames];\n}\n\n- (void)setContentInset:(NSEdgeInsets)contentInset\n{\n  _contentInset = contentInset;\n  [self updateFrames];\n}\n\n- (void)setBackgroundColor:(NSColor *)backgroundColor\n{\n  if (backgroundColor) {\n    [_textView setDrawsBackground:YES];\n    [_textView setBackgroundColor:backgroundColor];\n  }\n}\n\n- (NSString *)text\n{\n  return [_textView string];\n}\n\n- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)range replacementString:(NSString *)text\n{\n  if (_blockTextShouldChange) {\n    return NO;\n  }\n\n  if (_textView.textWasPasted) {\n    _textView.textWasPasted = NO;\n  } else {\n    [_eventDispatcher sendTextEventWithType:RCTTextEventTypeKeyPress\n                                   reactTag:self.reactTag\n                                       text:[_textView string]\n                                        key:text\n                                 eventCount:_nativeEventCount];\n\n    if (_blurOnSubmit && [text isEqualToString:@\"\\n\"]) {\n      // TODO: the purpose of blurOnSubmit on RCTextField is to decide if the\n      // field should lose focus when return is pressed or not. We're cheating a\n      // bit here by using it on RCTextView to decide if return character should\n      // submit the form, or be entered into the field.\n      //\n      // The reason this is cheating is because there's no way to specify that\n      // you want the return key to be swallowed *and* have the field retain\n      // focus (which was what blurOnSubmit was originally for). For the case\n      // where _blurOnSubmit = YES, this is still the correct and expected\n      // behavior though, so we'll leave the don't-blur-or-add-newline problem\n      // to be solved another day.\n      [_eventDispatcher sendTextEventWithType:RCTTextEventTypeSubmit\n                                     reactTag:self.reactTag\n                                         text:self.text\n                                          key:nil\n                                   eventCount:_nativeEventCount];\n      [_textView resignFirstResponder];\n      return NO;\n    }\n  }\n\n  // So we need to track that there is a native update in flight just in case JS manages to come back around and update\n  // things /before/ UITextView can update itself asynchronously.  If there is a native update in flight, we defer the\n  // JS update when it comes in and apply the deferred update once textViewDidChange fires with the native update applied.\n  if (_blockTextShouldChange) {\n    return NO;\n  }\n\n  if (_maxLength) {\n    NSUInteger allowedLength = _maxLength.integerValue - textView.string.length + range.length;\n    if (text.length > allowedLength) {\n      // If we typed/pasted more than one character, limit the text inputted\n      if (text.length > 1) {\n        // Truncate the input string so the result is exactly maxLength\n        NSString *limitedString = [text substringToIndex:allowedLength];\n        NSMutableString *newString = textView.string.mutableCopy;\n        [newString replaceCharactersInRange:range withString:limitedString];\n        textView.string = newString;\n        _predictedText = newString;\n\n        // Collapse selection at end of insert to match normal paste behavior\n//        UITextPosition *insertEnd = [textView positionFromPosition:textView.beginningOfDocument\n//                                                            offset:(range.location + allowedLength)];\n//        textView.selectedTextRange = [textView textRangeFromPosition:insertEnd toPosition:insertEnd];\n\n        [self textViewDidChange:textView];\n      }\n      return NO;\n    }\n  }\n\n  _nativeUpdatesInFlight = YES;\n\n  if (range.location + range.length > _predictedText.length) {\n    // _predictedText got out of sync in a bad way, so let's just force sync it.  Haven't been able to repro this, but\n    // it's causing a real crash here: #6523822\n    _predictedText = textView.string;\n  }\n\n  NSString *previousText = [_predictedText substringWithRange:range];\n  if (_predictedText) {\n    _predictedText = [_predictedText stringByReplacingCharactersInRange:range withString:text];\n  } else {\n    _predictedText = text;\n  }\n\n  if (_onTextInput) {\n    _onTextInput(@{\n      @\"text\": text,\n      @\"previousText\": previousText ?: @\"\",\n      @\"range\": @{\n        @\"start\": @(range.location),\n        @\"end\": @(range.location + range.length)\n      },\n      @\"eventCount\": @(_nativeEventCount),\n    });\n  }\n\n  return YES;\n}\n\n- (void)textViewDidChangeSelection:(__unused NSNotification *)notification\n{\n  if (_onSelectionChange &&\n      _textView.selectedRanges != _previousSelectionRanges &&\n      ![_textView.selectedRanges isEqual:_previousSelectionRanges]) {\n\n    _previousSelectionRanges = _textView.selectedRanges;\n\n    NSRange selection = _textView.selectedRanges.firstObject.rangeValue;\n\n    // TODO: support multiple ranges\n    _onSelectionChange(@{\n      @\"selection\": @{\n        @\"start\": @(selection.location),\n        @\"end\": @(selection.location + selection.length),\n      },\n    });\n  }\n}\n\n- (void)setText:(NSString *)text\n{\n  NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n  if (eventLag == 0 && ![text isEqualToString:[_textView string]]) {\n    NSArray <NSValue *> *previousRanges = [_textView selectedRanges];\n    [_textView setString:text];\n    [_textView setSelectedRanges:previousRanges];\n    // [self updatePlaceholderVisibility];\n    [self invalidateContentSize];\n  } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n    RCTLogWarn(@\"Native TextInput(%@) is %zd events ahead of JS - try to make your JS faster.\", self.text, eventLag);\n  }\n}\n\n- (void)updatePlaceholderVisibility\n{\n}\n\n- (NSString *)placeholder\n{\n  return _textView.placeholderText;\n}\n\n- (void)setPlaceholder:(NSString *)placeholder\n{\n  _textView.placeholderText = placeholder;\n}\n\n- (NSColor *)placeholderTextColor\n{\n  return _textView.placeholderTextColor;\n}\n\n- (void)setPlaceholderTextColor:(NSColor *)placeholderTextColor\n{\n  _textView.placeholderTextColor = placeholderTextColor;\n}\n\n- (NSFont *)defaultPlaceholderFont\n{\n  return [NSFont systemFontOfSize:17];\n}\n\n- (NSColor *)defaultPlaceholderTextColor\n{\n  return [NSColor colorWithRed:0.0/255.0 green:0.0/255.0 blue:0.098/255.0 alpha:0.22];\n}\n\n- (void)textDidChange:(__unused NSNotification *)notification\n{\n  if (_clearTextOnFocus) {\n    [_textView setString:@\"\"];\n    [self updatePlaceholderVisibility];\n  }\n\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus\n                                 reactTag:self.reactTag\n                                     text:nil\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\nstatic BOOL findMismatch(NSString *first, NSString *second, NSRange *firstRange, NSRange *secondRange)\n{\n  NSInteger firstMismatch = -1;\n  for (NSUInteger ii = 0; ii < MAX(first.length, second.length); ii++) {\n    if (ii >= first.length || ii >= second.length || [first characterAtIndex:ii] != [second characterAtIndex:ii]) {\n      firstMismatch = ii;\n      break;\n    }\n  }\n\n  if (firstMismatch == -1) {\n    return NO;\n  }\n\n  NSUInteger ii = second.length;\n  NSUInteger lastMismatch = first.length;\n  while (ii > firstMismatch && lastMismatch > firstMismatch) {\n    if ([first characterAtIndex:(lastMismatch - 1)] != [second characterAtIndex:(ii - 1)]) {\n      break;\n    }\n    ii--;\n    lastMismatch--;\n  }\n\n  *firstRange = NSMakeRange(firstMismatch, lastMismatch - firstMismatch);\n  *secondRange = NSMakeRange(firstMismatch, ii - firstMismatch);\n  return YES;\n}\n\n- (void)textViewDidChange:(NSTextView *)textView\n{\n  // Detect when textView updates happend that didn't invoke `shouldChangeTextInRange`\n  // (e.g. typing simplified chinese in pinyin will insert and remove spaces without\n  // calling shouldChangeTextInRange).  This will cause JS to get out of sync so we\n  // update the mismatched range.\n  NSRange currentRange;\n  NSRange predictionRange;\n  if (findMismatch(textView.string, _predictedText, &currentRange, &predictionRange)) {\n    NSString *replacement = [textView.string substringWithRange:currentRange];\n    [self textView:textView shouldChangeTextInRange:predictionRange replacementString:replacement];\n    // JS will assume the selection changed based on the location of our shouldChangeTextInRange, so reset it.\n    [self textViewDidChangeSelection:(NSNotification *)textView];\n    _predictedText = textView.string;\n  }\n\n  _nativeUpdatesInFlight = NO;\n  _nativeEventCount++;\n\n  if (!self.reactTag || !_onChange) {\n    return;\n  }\n\n  // When the context size increases, iOS updates the contentSize twice; once\n  // with a lower height, then again with the correct height. To prevent a\n  // spurious event from being sent, we track the previous, and only send the\n  // update event if it matches our expectation that greater text length\n  // should result in increased height. This assumption is, of course, not\n  // necessarily true because shorter text might include more linebreaks, but\n  // in practice this works well enough.\n  NSUInteger textLength = textView.string.length;\n  NSTextContainer* textContainer = [textView textContainer];\n  NSLayoutManager* layoutManager = [textView layoutManager];\n  [layoutManager ensureLayoutForTextContainer: textContainer];\n  CGSize contentSize = [layoutManager usedRectForTextContainer: textContainer].size;\n  CGFloat contentHeight = contentSize.height;\n  if (textLength >= _previousTextLength) {\n    contentHeight = MAX(contentHeight, _previousContentHeight);\n  }\n  _previousTextLength = textLength;\n  _previousContentHeight = contentHeight;\n  _onChange(@{\n    @\"text\": self.text,\n    @\"contentSize\": @{\n      @\"height\": @(contentHeight),\n      @\"width\": @(contentSize.width)\n    },\n    @\"target\": self.reactTag,\n    @\"eventCount\": @(_nativeEventCount),\n  });\n}\n\n- (void)textDidEndEditing:(NSNotification *)aNotification\n{\n  if (_nativeUpdatesInFlight) {\n    // iOS does't call `textViewDidChange:` delegate method if the change was happened because of autocorrection\n    // which was triggered by loosing focus. So, we call it manually.\n    [self textViewDidChange:_textView];\n    //_nativeEventCount++;\n  }\n\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd\n                                 reactTag:self.reactTag\n                                     text:[_textView string]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n  \n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur\n                                 reactTag:self.reactTag\n                                     text:nil\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n\n- (void)textDidBeginEditing:(NSNotification *)aNotification\n{\n  if (_clearTextOnFocus) {\n    [_textView setString:@\"\"];\n  }\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus\n                                 reactTag:self.reactTag\n                                     text:[_textView string]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n\n#pragma mark - Focus control deledation\n\n- (void)reactFocus\n{\n  [_textView reactFocus];\n}\n\n- (void)reactBlur\n{\n  [_textView reactBlur];\n}\n\n- (void)didMoveToWindow\n{\n  [_textView reactFocusIfNeeded];\n}\n\n#pragma mark - Content size\n\n- (CGSize)contentSize\n{\n  // Returning value does NOT include insets.\n  CGSize contentSize = self.intrinsicContentSize;\n  contentSize.width -= _contentInset.left + _contentInset.right;\n  contentSize.height -= _contentInset.top + _contentInset.bottom;\n  return contentSize;\n}\n\n- (void)invalidateContentSize\n{\n  CGSize contentSize = self.contentSize;\n\n  if (CGSizeEqualToSize(_previousContentSize, contentSize)) {\n    return;\n  }\n  _previousContentSize = contentSize;\n\n  [_bridge.uiManager setIntrinsicContentSize:contentSize forView:self];\n\n  if (_onContentSizeChange) {\n    _onContentSizeChange(@{\n      @\"contentSize\": @{\n        @\"height\": @(contentSize.height),\n        @\"width\": @(contentSize.width),\n      },\n      @\"target\": self.reactTag,\n    });\n  }\n}\n\n#pragma mark - Layout\n\n- (CGSize)intrinsicContentSize\n{\n  // Calling `sizeThatFits:` is probably more expensive method to compute\n  // content size compare to direct access `_textView.contentSize` property,\n  // but seems `sizeThatFits:` returns more reliable and consistent result.\n  // Returning value DOES include insets.\n  return [self sizeThatFits:CGSizeMake(self.bounds.size.width, INFINITY)];\n}\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  // return [_textView sizeThatFits:size];\n  return _textView.frame.size;\n}\n\n- (void)layout\n{\n  [super layout];\n  [self invalidateContentSize];\n}\n\n//\n//#pragma mark - UIScrollViewDelegate\n//\n//- (void)scrollViewDidScroll:(UIScrollView *)scrollView\n//{\n//  if (_onScroll) {\n//    CGPoint contentOffset = scrollView.contentOffset;\n//    CGSize contentSize = scrollView.contentSize;\n//    CGSize size = scrollView.bounds.size;\n//    UIEdgeInsets contentInset = scrollView.contentInset;\n//\n//    _onScroll(@{\n//      @\"contentOffset\": @{\n//        @\"x\": @(contentOffset.x),\n//        @\"y\": @(contentOffset.y)\n//      },\n//      @\"contentInset\": @{\n//        @\"top\": @(contentInset.top),\n//        @\"left\": @(contentInset.left),\n//        @\"bottom\": @(contentInset.bottom),\n//        @\"right\": @(contentInset.right)\n//      },\n//      @\"contentSize\": @{\n//        @\"width\": @(contentSize.width),\n//        @\"height\": @(contentSize.height)\n//      },\n//      @\"layoutMeasurement\": @{\n//        @\"width\": @(size.width),\n//        @\"height\": @(size.height)\n//      },\n//      @\"zoomScale\": @(scrollView.zoomScale ?: 1),\n//    });\n//  }\n//}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/RCTTextViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextViewManager.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTFont.h>\n#import <React/RCTShadowView.h>\n\n#import \"RCTShadowTextView.h\"\n#import \"RCTTextView.h\"\n\n@implementation RCTTextViewManager\n\nRCT_EXPORT_MODULE()\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTShadowTextView new];\n}\n\n- (NSView *)view\n{\n  return [[RCTTextView alloc] initWithBridge:self.bridge];\n}\n\n//RCT_REMAP_VIEW_PROPERTY(autoCapitalize, textView.autocapitalizationType, UITextAutocapitalizationType)\n//RCT_REMAP_VIEW_PROPERTY(autoCorrect, autocorrectionType, UITextAutocorrectionType)\n//RCT_REMAP_VIEW_PROPERTY(spellCheck, spellCheckingType, UITextSpellCheckingType)\nRCT_EXPORT_VIEW_PROPERTY(blurOnSubmit, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(clearTextOnFocus, BOOL)\nRCT_REMAP_VIEW_PROPERTY(editable, textView.editable, BOOL)\nRCT_REMAP_VIEW_PROPERTY(selectionColor, textView.insertionPointColor, NSColor)\n\nRCT_EXPORT_VIEW_PROPERTY(maxLength, NSNumber)\nRCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onContentSizeChange, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onSelectionChange, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onScroll, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onTextInput, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(placeholder, NSString)\nRCT_EXPORT_VIEW_PROPERTY(placeholderTextColor, NSColor)\nRCT_REMAP_VIEW_PROPERTY(secureTextEntry, textView.secureTextEntry, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(selectTextOnFocus, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(selection, RCTTextSelection)\nRCT_EXPORT_VIEW_PROPERTY(text, NSString)\nRCT_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, RCTTextView)\n{\n  view.font = [RCTFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)];\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused RCTTextView)\n{\n  view.font = [RCTFont updateFont:view.font withWeight:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused RCTTextView)\n{\n  view.font = [RCTFont updateFont:view.font withStyle:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, RCTTextView)\n{\n  view.font = [RCTFont updateFont:view.font withFamily:json ?: defaultView.font.familyName];\n}\nRCT_EXPORT_VIEW_PROPERTY(mostRecentEventCount, NSInteger)\n\n#if !TARGET_OS_TV\nRCT_REMAP_VIEW_PROPERTY(dataDetectorTypes, textView.dataDetectorTypes, UIDataDetectorTypes)\n#endif\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView\n{\n  NSNumber *reactTag = shadowView.reactTag;\n  NSEdgeInsets padding = shadowView.paddingAsInsets;\n  return ^(RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTTextView *> *viewRegistry) {\n    viewRegistry[reactTag].contentInset = padding;\n  };\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/Text/RCTTextShadowView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTShadowView.h>\n#import <React/RCTTextDecorationLineType.h>\n\ntypedef NS_ENUM(NSInteger, RCTSizeComparison)\n{\n  RCTSizeTooLarge,\n  RCTSizeTooSmall,\n  RCTSizeWithinRange,\n};\n\n\nextern NSString *const RCTIsHighlightedAttributeName;\nextern NSString *const RCTReactTagAttributeName;\n\n@interface RCTTextShadowView : RCTShadowView\n\n@property (nonatomic, strong) NSColor *color;\n@property (nonatomic, strong) NSColor *backgroundColor;\n@property (nonatomic, copy) NSString *fontFamily;\n@property (nonatomic, assign) CGFloat fontSize;\n@property (nonatomic, copy) NSString *fontWeight;\n@property (nonatomic, copy) NSString *fontStyle;\n@property (nonatomic, copy) NSArray *fontVariant;\n@property (nonatomic, assign) BOOL isHighlighted;\n@property (nonatomic, assign) CGFloat letterSpacing;\n@property (nonatomic, assign) CGFloat lineHeight;\n@property (nonatomic, assign) NSUInteger numberOfLines;\n@property (nonatomic, assign) NSLineBreakMode ellipsizeMode;\n@property (nonatomic, assign) CGSize shadowOffset;\n@property (nonatomic, assign) NSTextAlignment textAlign;\n@property (nonatomic, assign) NSWritingDirection writingDirection;\n@property (nonatomic, strong) NSColor *textDecorationColor;\n@property (nonatomic, assign) NSUnderlineStyle textDecorationStyle;\n@property (nonatomic, assign) RCTTextDecorationLineType textDecorationLine;\n@property (nonatomic, assign) CGFloat fontSizeMultiplier;\n@property (nonatomic, assign) BOOL allowFontScaling;\n@property (nonatomic, assign) CGFloat opacity;\n@property (nonatomic, assign) CGSize textShadowOffset;\n@property (nonatomic, assign) CGFloat textShadowRadius;\n@property (nonatomic, strong) NSColor *textShadowColor;\n@property (nonatomic, assign) BOOL adjustsFontSizeToFit;\n@property (nonatomic, assign) CGFloat minimumFontScale;\n@property (nonatomic, assign) BOOL selectable;\n\n- (void)recomputeText;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/Text/RCTTextShadowView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextShadowView.h\"\n\n// TODO: (critical) Fix accessibility\n// #import <React/RCTAccessibilityManager.h>\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTFont.h>\n#import <React/RCTLog.h>\n#import <React/RCTShadowView+Layout.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTUtils.h>\n\n#import \"RCTRawTextShadowView.h\"\n#import \"RCTTextView.h\"\n#import \"RCTMultilineTextInputView.h\"\n\nNSString *const RCTIsHighlightedAttributeName = @\"IsHighlightedAttributeName\";\nNSString *const RCTReactTagAttributeName = @\"ReactTagAttributeName\";\n\nstatic NSString *const kShadowViewAttributeName = @\"RCTShadowViewAttributeName\";\n\nstatic CGFloat const kAutoSizeWidthErrorMargin  = 0.05f;\nstatic CGFloat const kAutoSizeHeightErrorMargin = 0.025f;\nstatic CGFloat const kAutoSizeGranularity       = 0.001f;\n\n@implementation RCTTextShadowView\n{\n  NSTextStorage *_cachedTextStorage;\n  CGFloat _cachedTextStorageWidth;\n  CGFloat _cachedTextStorageWidthMode;\n  NSAttributedString *_cachedAttributedString;\n  CGFloat _effectiveLetterSpacing;\n  NSUserInterfaceLayoutDirection _cachedLayoutDirection;\n}\n\nstatic YGSize RCTMeasure(YGNodeRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)\n{\n  RCTTextShadowView *shadowText = (__bridge RCTTextShadowView *)YGNodeGetContext(node);\n  NSTextStorage *textStorage = [shadowText buildTextStorageForWidth:width widthMode:widthMode];\n  [shadowText calculateTextFrame:textStorage];\n  NSLayoutManager *layoutManager = textStorage.layoutManagers.firstObject;\n  NSTextContainer *textContainer = layoutManager.textContainers.firstObject;\n  CGSize computedSize = [layoutManager usedRectForTextContainer:textContainer].size;\n\n  YGSize result;\n  result.width = RCTCeilPixelValue(computedSize.width);\n  if (shadowText->_effectiveLetterSpacing < 0) {\n    result.width -= shadowText->_effectiveLetterSpacing;\n  }\n  result.height = RCTCeilPixelValue(computedSize.height);\n  return result;\n}\n\n- (instancetype)init\n{\n  if ((self = [super init])) {\n    _fontSize = NAN;\n    _letterSpacing = NAN;\n    _isHighlighted = NO;\n    _textDecorationStyle = NSUnderlineStyleSingle;\n    _opacity = 1.0;\n    _cachedTextStorageWidth = -1;\n    _cachedTextStorageWidthMode = -1;\n    _fontSizeMultiplier = 1.0;\n    _textAlign = NSTextAlignmentNatural;\n    _writingDirection = NSWritingDirectionNatural;\n    _cachedLayoutDirection = NSUserInterfaceLayoutDirectionLeftToRight;\n\n     YGNodeSetMeasureFunc(self.yogaNode, RCTMeasure);\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(contentSizeMultiplierDidChange:)\n                                                 name:RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification\n                                               object:nil];\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (NSString *)description\n{\n  NSString *superDescription = super.description;\n  return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@\"; text: %@>\", [self attributedString].string];\n}\n\n- (BOOL)isYogaLeafNode\n{\n  return YES;\n}\n\n- (void)contentSizeMultiplierDidChange:(NSNotification *)note\n{\n  YGNodeMarkDirty(self.yogaNode);\n  [self dirtyText];\n}\n\n- (NSDictionary<NSString *, id> *)processUpdatedProperties:(NSMutableSet<RCTApplierBlock> *)applierBlocks\n                                          parentProperties:(NSDictionary<NSString *, id> *)parentProperties\n{\n  if ([[self reactSuperview] isKindOfClass:[RCTTextShadowView class]]) {\n    return parentProperties;\n  }\n\n  parentProperties = [super processUpdatedProperties:applierBlocks\n                                    parentProperties:parentProperties];\n\n  CGFloat availableWidth = self.availableSize.width;\n  NSNumber *parentTag = [[self reactSuperview] reactTag];\n  NSTextStorage *textStorage = [self buildTextStorageForWidth:availableWidth widthMode:YGMeasureModeExactly];\n  CGRect textFrame = [self calculateTextFrame:textStorage];\n  BOOL selectable = _selectable;\n  [applierBlocks addObject:^(NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    RCTTextView *view = (RCTTextView *)viewRegistry[self.reactTag];\n    view.textFrame = textFrame;\n    view.textStorage = textStorage;\n    view.selectable = selectable;\n\n    /**\n     * NOTE: this logic is included to support rich text editing inside multiline\n     * `<TextInput>` controls. It is required in order to ensure that the\n     * textStorage (aka attributed string) is copied over from the RCTTextShadowView\n     * to the RCTTextView view in time to be used to update the editable text content.\n     * TODO: we should establish a delegate relationship betweeen RCTMultilineTextInputView\n     * and its contaned RCTTextView element when they get inserted and get rid of this\n     */\n    NSView *parentView = viewRegistry[parentTag];\n    if ([parentView respondsToSelector:@selector(performTextUpdate)]) {\n      [(RCTMultilineTextInputView *)parentView performTextUpdate];\n    }\n  }];\n\n  return parentProperties;\n}\n\n- (void)applyLayoutNode:(YGNodeRef)node\n      viewsWithNewFrame:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame\n       absolutePosition:(CGPoint)absolutePosition\n{\n  [super applyLayoutNode:node viewsWithNewFrame:viewsWithNewFrame absolutePosition:absolutePosition];\n  [self dirtyPropagation];\n}\n\n- (void)applyLayoutToChildren:(YGNodeRef)node\n            viewsWithNewFrame:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame\n             absolutePosition:(CGPoint)absolutePosition\n{\n  // Run layout on subviews.\n  CGFloat availableWidth = self.availableSize.width;\n  NSTextStorage *textStorage = [self buildTextStorageForWidth:availableWidth widthMode:YGMeasureModeExactly];\n  NSLayoutManager *layoutManager = textStorage.layoutManagers.firstObject;\n  NSTextContainer *textContainer = layoutManager.textContainers.firstObject;\n  NSRange glyphRange = [layoutManager glyphRangeForTextContainer:textContainer];\n  NSRange characterRange = [layoutManager characterRangeForGlyphRange:glyphRange actualGlyphRange:NULL];\n  [layoutManager.textStorage enumerateAttribute:kShadowViewAttributeName inRange:characterRange options:0 usingBlock:^(RCTShadowView *child, NSRange range, BOOL *_) {\n    if (child) {\n      YGNodeRef childNode = child.yogaNode;\n      float width = YGNodeStyleGetWidth(childNode).value;\n      float height = YGNodeStyleGetHeight(childNode).value;\n      if (YGFloatIsUndefined(width) || YGFloatIsUndefined(height)) {\n        RCTLogError(@\"Views nested within a <Text> must have a width and height\");\n      }\n      NSFont *font = [textStorage attribute:NSFontAttributeName atIndex:range.location effectiveRange:nil];\n      CGRect glyphRect = [layoutManager boundingRectForGlyphRange:range inTextContainer:textContainer];\n      CGRect childFrame = {{\n        RCTRoundPixelValue(glyphRect.origin.x),\n        RCTRoundPixelValue(glyphRect.origin.y + glyphRect.size.height - height + font.descender)\n      }, {\n        RCTRoundPixelValue(width),\n        RCTRoundPixelValue(height)\n      }};\n\n      NSRange truncatedGlyphRange = [layoutManager truncatedGlyphRangeInLineFragmentForGlyphAtIndex:range.location];\n      BOOL childIsTruncated = NSIntersectionRange(range, truncatedGlyphRange).length != 0;\n\n      [child collectUpdatedFrames:viewsWithNewFrame\n                        withFrame:childFrame\n                           hidden:childIsTruncated\n                 absolutePosition:absolutePosition];\n    }\n  }];\n}\n\n- (NSTextStorage *)buildTextStorageForWidth:(CGFloat)width widthMode:(YGMeasureMode)widthMode\n{\n  if (\n      _cachedTextStorage &&\n      (width == _cachedTextStorageWidth || (isnan(width) && isnan(_cachedTextStorageWidth))) &&\n      widthMode == _cachedTextStorageWidthMode &&\n      _cachedLayoutDirection == self.layoutDirection\n  ) {\n    return _cachedTextStorage;\n  }\n\n  NSLayoutManager *layoutManager = [NSLayoutManager new];\n\n  NSTextStorage *textStorage = [[NSTextStorage alloc] initWithAttributedString:self.attributedString];\n  [textStorage addLayoutManager:layoutManager];\n\n  NSTextContainer *textContainer = [NSTextContainer new];\n  textContainer.lineFragmentPadding = 0.0;\n\n  if (_numberOfLines > 0) {\n    textContainer.lineBreakMode = _ellipsizeMode;\n  } else {\n    textContainer.lineBreakMode = NSLineBreakByClipping;\n  }\n\n  textContainer.maximumNumberOfLines = _numberOfLines;\n  textContainer.size = (CGSize){\n    widthMode == YGMeasureModeUndefined || isnan(width) ? CGFLOAT_MAX : width,\n    CGFLOAT_MAX\n  };\n\n  [layoutManager addTextContainer:textContainer];\n  [layoutManager ensureLayoutForTextContainer:textContainer];\n\n  _cachedTextStorageWidth = width;\n  _cachedTextStorageWidthMode = widthMode;\n  _cachedTextStorage = textStorage;\n\n  return textStorage;\n}\n\n- (void)dirtyText\n{\n  [super dirtyText];\n  _cachedTextStorage = nil;\n}\n\n- (void)recomputeText\n{\n  [self attributedString];\n  [self setTextComputed];\n  [self dirtyPropagation];\n}\n\n- (NSAttributedString *)attributedString\n{\n  return [self _attributedStringWithFontFamily:nil\n                                      fontSize:nil\n                                    fontWeight:nil\n                                     fontStyle:nil\n                                 letterSpacing:nil\n                            useBackgroundColor:YES\n                               foregroundColor:self.color ?: [NSColor textColor]\n                               backgroundColor:self.backgroundColor\n                                       opacity:self.opacity];\n}\n\n- (NSAttributedString *)_attributedStringWithFontFamily:(NSString *)fontFamily\n                                               fontSize:(NSNumber *)fontSize\n                                             fontWeight:(NSString *)fontWeight\n                                              fontStyle:(NSString *)fontStyle\n                                          letterSpacing:(NSNumber *)letterSpacing\n                                     useBackgroundColor:(BOOL)useBackgroundColor\n                                        foregroundColor:(NSColor *)foregroundColor\n                                        backgroundColor:(NSColor *)backgroundColor\n                                                opacity:(CGFloat)opacity\n{\n  if (\n      ![self isTextDirty] &&\n      _cachedAttributedString &&\n      _cachedLayoutDirection == self.layoutDirection\n  ) {\n    return _cachedAttributedString;\n  }\n\n  _cachedLayoutDirection = self.layoutDirection;\n\n  if (_fontSize && !isnan(_fontSize)) {\n    fontSize = @(_fontSize);\n  }\n  if (_fontWeight) {\n    fontWeight = _fontWeight;\n  }\n  if (_fontStyle) {\n    fontStyle = _fontStyle;\n  }\n  if (_fontFamily) {\n    fontFamily = _fontFamily;\n  }\n  if (!isnan(_letterSpacing)) {\n    letterSpacing = @(_letterSpacing);\n  }\n\n  _effectiveLetterSpacing = letterSpacing.doubleValue;\n\n  NSFont *font = [RCTFont updateFont:nil\n                          withFamily:fontFamily\n                                size:fontSize\n                              weight:fontWeight\n                               style:fontStyle\n                             variant:_fontVariant\n                     scaleMultiplier:_allowFontScaling ? _fontSizeMultiplier : 1.0];\n\n  CGFloat heightOfTallestSubview = 0.0;\n  NSMutableAttributedString *attributedString = [NSMutableAttributedString new];\n  for (RCTShadowView *child in [self reactSubviews]) {\n    if ([child isKindOfClass:[RCTTextShadowView class]]) {\n      RCTTextShadowView *shadowText = (RCTTextShadowView *)child;\n      [attributedString appendAttributedString:\n       [shadowText _attributedStringWithFontFamily:fontFamily\n                                          fontSize:fontSize\n                                        fontWeight:fontWeight\n                                         fontStyle:fontStyle\n                                     letterSpacing:letterSpacing\n                                useBackgroundColor:YES\n                                   foregroundColor:shadowText.color ?: foregroundColor\n                                   backgroundColor:shadowText.backgroundColor ?: backgroundColor\n                                           opacity:opacity * shadowText.opacity]];\n      [child setTextComputed];\n    } else if ([child isKindOfClass:[RCTRawTextShadowView class]]) {\n      RCTRawTextShadowView *shadowRawText = (RCTRawTextShadowView *)child;\n      [attributedString appendAttributedString:[[NSAttributedString alloc] initWithString:shadowRawText.text ?: @\"\"]];\n      [child setTextComputed];\n    } else {\n      float width = YGNodeStyleGetWidth(child.yogaNode).value;\n      float height = YGNodeStyleGetHeight(child.yogaNode).value;\n      if (YGFloatIsUndefined(width) || YGFloatIsUndefined(height)) {\n        RCTLogError(@\"Views nested within a <Text> must have a width and height\");\n      }\n      NSTextAttachment *attachment = [NSTextAttachment new];\n      attachment.bounds = (CGRect){CGPointZero, {width, height}};\n      NSMutableAttributedString *attachmentString = [NSMutableAttributedString new];\n      [attachmentString appendAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]];\n      [attachmentString addAttribute:kShadowViewAttributeName value:child range:(NSRange){0, attachmentString.length}];\n      [attributedString appendAttributedString:attachmentString];\n      if (height > heightOfTallestSubview) {\n        heightOfTallestSubview = height;\n      }\n      // Don't call setTextComputed on this child. RCTTextViewManager takes care of\n      // processing inline UIViews.\n    }\n  }\n\n  [self _addAttribute:NSForegroundColorAttributeName\n            withValue:[foregroundColor colorWithAlphaComponent:CGColorGetAlpha(foregroundColor.CGColor) * opacity]\n   toAttributedString:attributedString];\n\n  if (_isHighlighted) {\n    [self _addAttribute:RCTIsHighlightedAttributeName withValue:@YES toAttributedString:attributedString];\n  }\n  if (useBackgroundColor && backgroundColor) {\n    [self _addAttribute:NSBackgroundColorAttributeName\n              withValue:[backgroundColor colorWithAlphaComponent:CGColorGetAlpha(backgroundColor.CGColor) * opacity]\n     toAttributedString:attributedString];\n  }\n\n  [self _addAttribute:NSFontAttributeName withValue:font toAttributedString:attributedString];\n  [self _addAttribute:NSKernAttributeName withValue:letterSpacing toAttributedString:attributedString];\n  [self _addAttribute:RCTReactTagAttributeName withValue:self.reactTag toAttributedString:attributedString];\n//  [self _setParagraphStyleOnAttributedString:attributedString\n//                              fontLineHeight:[NSLayoutManager defaultLineHeightForFont: font]\n//                      heightOfTallestSubview:heightOfTallestSubview];\n\n  // create a non-mutable attributedString for use by the Text system which avoids copies down the line\n  _cachedAttributedString = [[NSAttributedString alloc] initWithAttributedString:attributedString];\n  YGNodeMarkDirty(self.yogaNode);\n\n  return _cachedAttributedString;\n}\n\n- (void)_addAttribute:(NSString *)attribute withValue:(id)attributeValue toAttributedString:(NSMutableAttributedString *)attributedString\n{\n  [attributedString enumerateAttribute:attribute inRange:NSMakeRange(0, attributedString.length) options:0 usingBlock:^(id value, NSRange range, BOOL *stop) {\n    if (!value && attributeValue) {\n      [attributedString addAttribute:attribute value:attributeValue range:range];\n    }\n  }];\n}\n\n/*\n * LineHeight works the same way line-height works in the web: if children and self have\n * varying lineHeights, we simply take the max.\n */\n- (void)_setParagraphStyleOnAttributedString:(NSMutableAttributedString *)attributedString\n                              fontLineHeight:(CGFloat)fontLineHeight\n                      heightOfTallestSubview:(CGFloat)heightOfTallestSubview\n{\n  __block BOOL hasParagraphStyle = NO;\n\n  if (_lineHeight != 0.0 || _textAlign != NSTextAlignmentNatural) {\n    hasParagraphStyle = YES;\n  }\n\n  CGFloat fontSizeMultiplier = _allowFontScaling ? _fontSizeMultiplier : 1.0;\n\n  // Text line height\n  __block float compoundLineHeight = _lineHeight * fontSizeMultiplier;\n\n  // Checking for `maximumLineHeight` on each of our children and updating `compoundLineHeight` with the maximum value on the go.\n  [attributedString enumerateAttribute:NSParagraphStyleAttributeName\n                               inRange:(NSRange){0, attributedString.length}\n                               options:0\n                            usingBlock:^(NSParagraphStyle *paragraphStyle, NSRange range, BOOL *stop) {\n\n    if (!paragraphStyle) {\n      return;\n    }\n\n    hasParagraphStyle = YES;\n    compoundLineHeight = MAX(compoundLineHeight, paragraphStyle.maximumLineHeight);\n  }];\n\n  compoundLineHeight = MAX(round(compoundLineHeight), ceilf(heightOfTallestSubview));\n\n  // Text alignment\n  NSTextAlignment textAlign = _textAlign;\n  if (textAlign == NSTextAlignmentRight || textAlign == NSTextAlignmentLeft) {\n    if (_cachedLayoutDirection == NSUserInterfaceLayoutDirectionRightToLeft) {\n      if (textAlign == NSTextAlignmentRight) {\n        textAlign = NSTextAlignmentLeft;\n      } else {\n        textAlign = NSTextAlignmentRight;\n      }\n    }\n  }\n\n  if (hasParagraphStyle) {\n    NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];\n    paragraphStyle.alignment = textAlign;\n    paragraphStyle.baseWritingDirection = _writingDirection;\n    paragraphStyle.minimumLineHeight = compoundLineHeight;\n    paragraphStyle.maximumLineHeight = compoundLineHeight;\n    [attributedString addAttribute:NSParagraphStyleAttributeName\n                             value:paragraphStyle\n                             range:(NSRange){0, attributedString.length}];\n\n    if (compoundLineHeight > fontLineHeight) {\n      [attributedString addAttribute:NSBaselineOffsetAttributeName\n                               value:@(compoundLineHeight / 2 - fontLineHeight / 2)\n                               range:(NSRange){0, attributedString.length}];\n    }\n  }\n\n  // Text decoration\n  if (_textDecorationLine == RCTTextDecorationLineTypeUnderline ||\n      _textDecorationLine == RCTTextDecorationLineTypeUnderlineStrikethrough) {\n    [self _addAttribute:NSUnderlineStyleAttributeName withValue:@(_textDecorationStyle)\n     toAttributedString:attributedString];\n  }\n  if (_textDecorationLine == RCTTextDecorationLineTypeStrikethrough ||\n      _textDecorationLine == RCTTextDecorationLineTypeUnderlineStrikethrough){\n    [self _addAttribute:NSStrikethroughStyleAttributeName withValue:@(_textDecorationStyle)\n     toAttributedString:attributedString];\n  }\n  if (_textDecorationColor) {\n    [self _addAttribute:NSStrikethroughColorAttributeName withValue:_textDecorationColor\n     toAttributedString:attributedString];\n    [self _addAttribute:NSUnderlineColorAttributeName withValue:_textDecorationColor\n     toAttributedString:attributedString];\n  }\n\n  // Text shadow\n  if (!CGSizeEqualToSize(_textShadowOffset, CGSizeZero)) {\n    NSShadow *shadow = [NSShadow new];\n    shadow.shadowOffset = _textShadowOffset;\n    shadow.shadowBlurRadius = _textShadowRadius;\n    shadow.shadowColor = _textShadowColor;\n    [self _addAttribute:NSShadowAttributeName withValue:shadow toAttributedString:attributedString];\n  }\n}\n\n#pragma mark Autosizing\n\n- (CGRect)calculateTextFrame:(NSTextStorage *)textStorage\n{\n  CGRect textFrame = UIEdgeInsetsInsetRect((CGRect){CGPointZero, self.frame.size},\n                                           self.compoundInsets);\n\n  if (_adjustsFontSizeToFit) {\n    textFrame = [self updateStorage:textStorage toFitFrame:textFrame];\n  }\n\n  return textFrame;\n}\n\n- (CGRect)updateStorage:(NSTextStorage *)textStorage toFitFrame:(CGRect)frame\n{\n  BOOL fits = [self attemptScale:1.0f\n                       inStorage:textStorage\n                        forFrame:frame];\n  CGSize requiredSize;\n  if (!fits) {\n    requiredSize = [self calculateOptimumScaleInFrame:frame\n                                           forStorage:textStorage\n                                             minScale:self.minimumFontScale\n                                             maxScale:1.0\n                                              prevMid:INT_MAX];\n  } else {\n    requiredSize = [self calculateSize:textStorage];\n  }\n\n  // Vertically center draw position for new text sizing.\n  frame.origin.y = self.compoundInsets.top + RCTRoundPixelValue((CGRectGetHeight(frame) - requiredSize.height) / 2.0f);\n  return frame;\n}\n\n- (CGSize)calculateOptimumScaleInFrame:(CGRect)frame\n                            forStorage:(NSTextStorage *)textStorage\n                              minScale:(CGFloat)minScale\n                              maxScale:(CGFloat)maxScale\n                               prevMid:(CGFloat)prevMid\n{\n  CGFloat midScale = (minScale + maxScale) / 2.0f;\n  if (round((prevMid / kAutoSizeGranularity)) == round((midScale / kAutoSizeGranularity))) {\n    //Bail because we can't meet error margin.\n    return [self calculateSize:textStorage];\n  } else {\n    RCTSizeComparison comparison = [self attemptScale:midScale\n                                            inStorage:textStorage\n                                             forFrame:frame];\n    if (comparison == RCTSizeWithinRange) {\n      return [self calculateSize:textStorage];\n    } else if (comparison == RCTSizeTooLarge) {\n      return [self calculateOptimumScaleInFrame:frame\n                                     forStorage:textStorage\n                                       minScale:minScale\n                                       maxScale:midScale - kAutoSizeGranularity\n                                        prevMid:midScale];\n    } else {\n      return [self calculateOptimumScaleInFrame:frame\n                                     forStorage:textStorage\n                                       minScale:midScale + kAutoSizeGranularity\n                                       maxScale:maxScale\n                                        prevMid:midScale];\n    }\n  }\n}\n\n- (RCTSizeComparison)attemptScale:(CGFloat)scale\n                        inStorage:(NSTextStorage *)textStorage\n                         forFrame:(CGRect)frame\n{\n  NSLayoutManager *layoutManager = [textStorage.layoutManagers firstObject];\n  NSTextContainer *textContainer = [layoutManager.textContainers firstObject];\n\n  NSRange glyphRange = NSMakeRange(0, textStorage.length);\n  [textStorage beginEditing];\n  [textStorage enumerateAttribute:NSFontAttributeName\n                           inRange:glyphRange\n                           options:0\n                        usingBlock:^(NSFont *font, NSRange range, BOOL *stop)\n   {\n     if (font) {\n       NSFont *originalFont = [self.attributedString attribute:NSFontAttributeName\n                                                       atIndex:range.location\n                                                effectiveRange:&range];\n\n       NSFont *newFont = [NSFont fontWithName: originalFont.fontName size:originalFont.pointSize * scale];\n       [textStorage removeAttribute:NSFontAttributeName range:range];\n       [textStorage addAttribute:NSFontAttributeName value:newFont range:range];\n     }\n   }];\n\n  [textStorage endEditing];\n\n  NSInteger linesRequired = [self numberOfLinesRequired:[textStorage.layoutManagers firstObject]];\n  CGSize requiredSize = [self calculateSize:textStorage];\n\n  BOOL fitSize = requiredSize.height <= CGRectGetHeight(frame) &&\n  requiredSize.width <= CGRectGetWidth(frame);\n\n  BOOL fitLines = linesRequired <= textContainer.maximumNumberOfLines ||\n  textContainer.maximumNumberOfLines == 0;\n\n  if (fitLines && fitSize) {\n    if ((requiredSize.width + (CGRectGetWidth(frame) * kAutoSizeWidthErrorMargin)) > CGRectGetWidth(frame) &&\n        (requiredSize.height + (CGRectGetHeight(frame) * kAutoSizeHeightErrorMargin)) > CGRectGetHeight(frame))\n    {\n      return RCTSizeWithinRange;\n    } else {\n      return RCTSizeTooSmall;\n    }\n  } else {\n    return RCTSizeTooLarge;\n  }\n}\n\n// Via Apple Text Layout Programming Guide\n// https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TextLayout/Tasks/CountLines.html\n- (NSInteger)numberOfLinesRequired:(NSLayoutManager *)layoutManager\n{\n  NSInteger numberOfLines, index, numberOfGlyphs = [layoutManager numberOfGlyphs];\n  NSRange lineRange;\n  for (numberOfLines = 0, index = 0; index < numberOfGlyphs; numberOfLines++){\n    (void) [layoutManager lineFragmentRectForGlyphAtIndex:index\n                                           effectiveRange:&lineRange];\n    index = NSMaxRange(lineRange);\n  }\n\n  return numberOfLines;\n}\n\n// Via Apple Text Layout Programming Guide\n//https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TextLayout/Tasks/StringHeight.html\n- (CGSize)calculateSize:(NSTextStorage *)storage\n{\n  NSLayoutManager *layoutManager = [storage.layoutManagers firstObject];\n  NSTextContainer *textContainer = [layoutManager.textContainers firstObject];\n\n  [textContainer setLineBreakMode:NSLineBreakByWordWrapping];\n  NSInteger maxLines = [textContainer maximumNumberOfLines];\n  [textContainer setMaximumNumberOfLines:0];\n  (void) [layoutManager glyphRangeForTextContainer:textContainer];\n  CGSize requiredSize = [layoutManager usedRectForTextContainer:textContainer].size;\n  [textContainer setMaximumNumberOfLines:maxLines];\n\n  return requiredSize;\n}\n\n#define RCT_TEXT_PROPERTY(setProp, ivar, type) \\\n- (void)set##setProp:(type)value;              \\\n{                                              \\\n  ivar = value;                                \\\n  [self dirtyText];                            \\\n}\n\nRCT_TEXT_PROPERTY(AdjustsFontSizeToFit, _adjustsFontSizeToFit, BOOL)\nRCT_TEXT_PROPERTY(Color, _color, NSColor *)\nRCT_TEXT_PROPERTY(FontFamily, _fontFamily, NSString *)\nRCT_TEXT_PROPERTY(FontSize, _fontSize, CGFloat)\nRCT_TEXT_PROPERTY(FontWeight, _fontWeight, NSString *)\nRCT_TEXT_PROPERTY(FontStyle, _fontStyle, NSString *)\nRCT_TEXT_PROPERTY(FontVariant, _fontVariant, NSArray *)\nRCT_TEXT_PROPERTY(IsHighlighted, _isHighlighted, BOOL)\nRCT_TEXT_PROPERTY(LetterSpacing, _letterSpacing, CGFloat)\nRCT_TEXT_PROPERTY(LineHeight, _lineHeight, CGFloat)\nRCT_TEXT_PROPERTY(NumberOfLines, _numberOfLines, NSUInteger)\nRCT_TEXT_PROPERTY(EllipsizeMode, _ellipsizeMode, NSLineBreakMode)\nRCT_TEXT_PROPERTY(TextAlign, _textAlign, NSTextAlignment)\nRCT_TEXT_PROPERTY(TextDecorationColor, _textDecorationColor, NSColor *);\nRCT_TEXT_PROPERTY(TextDecorationLine, _textDecorationLine, RCTTextDecorationLineType);\nRCT_TEXT_PROPERTY(TextDecorationStyle, _textDecorationStyle, NSUnderlineStyle);\nRCT_TEXT_PROPERTY(WritingDirection, _writingDirection, NSWritingDirection)\nRCT_TEXT_PROPERTY(Opacity, _opacity, CGFloat)\nRCT_TEXT_PROPERTY(TextShadowOffset, _textShadowOffset, CGSize);\nRCT_TEXT_PROPERTY(TextShadowRadius, _textShadowRadius, CGFloat);\nRCT_TEXT_PROPERTY(TextShadowColor, _textShadowColor, NSColor *);\n\n- (void)setAllowFontScaling:(BOOL)allowFontScaling\n{\n  _allowFontScaling = allowFontScaling;\n  for (RCTShadowView *child in [self reactSubviews]) {\n    if ([child isKindOfClass:[RCTTextShadowView class]]) {\n      ((RCTTextShadowView *)child).allowFontScaling = allowFontScaling;\n    }\n  }\n  [self dirtyText];\n}\n\n- (void)setFontSizeMultiplier:(CGFloat)fontSizeMultiplier\n{\n  _fontSizeMultiplier = fontSizeMultiplier;\n  if (_fontSizeMultiplier == 0) {\n    RCTLogError(@\"fontSizeMultiplier value must be > zero.\");\n    _fontSizeMultiplier = 1.0;\n  }\n  for (RCTShadowView *child in [self reactSubviews]) {\n    if ([child isKindOfClass:[RCTTextShadowView class]]) {\n      ((RCTTextShadowView *)child).fontSizeMultiplier = fontSizeMultiplier;\n    }\n  }\n  [self dirtyText];\n}\n\n- (void)setMinimumFontScale:(CGFloat)minimumFontScale\n{\n  if (minimumFontScale >= 0.01) {\n    _minimumFontScale = minimumFontScale;\n  }\n  [self dirtyText];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/Text/RCTTextView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\nCGRect UIEdgeInsetsInsetRect(CGRect rect, NSEdgeInsets insets);\n\n@interface RCTTextView : NSView\n\n@property (nonatomic, assign) NSEdgeInsets contentInset;\n@property (nonatomic, strong) NSTextStorage *textStorage;\n@property (nonatomic, assign) CGRect textFrame;\n@property (nonatomic, assign) BOOL selectable;\n\n@property (nonatomic, assign) BOOL respondsToLiveResizing;\n@end\n"
  },
  {
    "path": "Libraries/Text/Text/RCTTextView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextView.h\"\n\n#import <QuartzCore/QuartzCore.h>\n// #import <MobileCoreServices/UTCoreTypes.h>\n\n#import <React/RCTUtils.h>\n#import <React/NSView+React.h>\n\n#import \"RCTTextShadowView.h\"\n\n// https://github.com/BigZaphod/Chameleon/blob/84605ede274bd82b330d72dd6ac41e64eb925fd7/UIKit/Classes/UIGeometry.h\nCGRect UIEdgeInsetsInsetRect(CGRect rect, NSEdgeInsets insets) {\n  rect.origin.x    += insets.left;\n  rect.origin.y    += insets.top;\n  rect.size.width  -= (insets.left + insets.right);\n  rect.size.height -= (insets.top  + insets.bottom);\n  return rect;\n}\n\n@implementation NSBezierPath (BezierPathQuartzUtilities)\n// This method works only in OS X v10.2 and later.\n- (CGPathRef)quartzPath\n{\n  long i, numElements;\n\n  // Need to begin a path here.\n  CGPathRef           immutablePath = NULL;\n\n  // Then draw the path elements.\n  numElements = [self elementCount];\n  if (numElements > 0)\n  {\n    CGMutablePathRef    path = CGPathCreateMutable();\n    NSPoint             points[3];\n    BOOL                didClosePath = YES;\n\n    for (i = 0; i < numElements; i++)\n    {\n      switch ([self elementAtIndex:i associatedPoints:points])\n      {\n        case NSMoveToBezierPathElement:\n          CGPathMoveToPoint(path, NULL, points[0].x, points[0].y);\n          break;\n\n        case NSLineToBezierPathElement:\n          CGPathAddLineToPoint(path, NULL, points[0].x, points[0].y);\n          didClosePath = NO;\n          break;\n\n        case NSCurveToBezierPathElement:\n          CGPathAddCurveToPoint(path, NULL, points[0].x, points[0].y,\n                                points[1].x, points[1].y,\n                                points[2].x, points[2].y);\n          didClosePath = NO;\n          break;\n\n        case NSClosePathBezierPathElement:\n          CGPathCloseSubpath(path);\n          didClosePath = YES;\n          break;\n      }\n    }\n\n    // Be sure the path is closed or Quartz may not do valid hit detection.\n    if (!didClosePath)\n      CGPathCloseSubpath(path);\n\n    immutablePath = CGPathCreateCopy(path);\n    CGPathRelease(path);\n  }\n\n  return immutablePath; // TODO: potential leak\n}\n@end\n\nstatic void collectNonTextDescendants(RCTTextView *view, NSMutableArray *nonTextDescendants)\n{\n  for (NSView *child in view.reactSubviews) {\n    if ([child isKindOfClass:[RCTTextView class]]) {\n      collectNonTextDescendants((RCTTextView *)child, nonTextDescendants);\n    } else if (!CGRectEqualToRect(child.frame, CGRectZero)) {\n      [nonTextDescendants addObject:child];\n    }\n  }\n}\n\n@implementation RCTTextView\n{\n  NSTextStorage *_textStorage;\n  CAShapeLayer *_highlightLayer;\n}\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if ((self = [super initWithFrame:frame])) {\n    _textStorage = [NSTextStorage new];\n  }\n  return self;\n}\n\n- (BOOL)isFlipped\n{\n  return YES;\n}\n\n- (NSString *)description\n{\n  NSString *superDescription = super.description;\n  NSRange semicolonRange = [superDescription rangeOfString:@\";\"];\n  NSString *replacement = [NSString stringWithFormat:@\"; reactTag: %@; text: %@\", self.reactTag, self.textStorage.string];\n  return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement];\n}\n\n- (void)setSelectable:(BOOL)selectable\n{\n  if (_selectable == selectable) {\n    return;\n  }\n\n  _selectable = selectable;\n\n  if (_selectable) {\n    [self enableContextMenu];\n  }\n  else {\n    [self disableContextMenu];\n  }\n}\n\n- (void)reactSetFrame:(CGRect)frame\n{\n  [super reactSetFrame:frame];\n}\n\n- (void)reactSetInheritedBackgroundColor:(NSColor *)inheritedBackgroundColor\n{\n  if (self.wantsLayer == NO) {\n    self.wantsLayer = YES;\n  }\n  self.layer.backgroundColor = [inheritedBackgroundColor CGColor];\n}\n\n- (void)didUpdateReactSubviews\n{\n  // Do nothing, as subviews are managed by `setTextStorage:` method\n}\n\n- (void)setTextStorage:(NSTextStorage *)textStorage\n{\n  if (_textStorage != textStorage) {\n    _textStorage = textStorage;\n\n    // Update subviews\n    NSMutableArray *nonTextDescendants = [NSMutableArray new];\n    collectNonTextDescendants(self, nonTextDescendants);\n    NSArray *subviews = self.subviews;\n    if (![subviews isEqualToArray:nonTextDescendants]) {\n      for (NSView *child in subviews) {\n        if (![nonTextDescendants containsObject:child]) {\n          [child removeFromSuperview];\n        }\n      }\n      for (NSView *child in nonTextDescendants) {\n        [self addSubview:child];\n      }\n    }\n\n    [self setNeedsDisplay:YES];\n  }\n}\n\n- (void)drawRect:(CGRect)dirtyRect\n{\n  NSLayoutManager *layoutManager = [_textStorage.layoutManagers firstObject];\n  NSTextContainer *textContainer = [layoutManager.textContainers firstObject];\n\n  NSRange glyphRange = [layoutManager glyphRangeForTextContainer:textContainer];\n  CGRect textFrame = self.textFrame;\n  [layoutManager drawBackgroundForGlyphRange:glyphRange atPoint:textFrame.origin];\n  [layoutManager drawGlyphsForGlyphRange:glyphRange atPoint:textFrame.origin];\n\n  __block NSBezierPath *highlightPath = nil;\n  NSRange characterRange = [layoutManager characterRangeForGlyphRange:glyphRange actualGlyphRange:NULL];\n\n  [layoutManager.textStorage enumerateAttribute:RCTIsHighlightedAttributeName inRange:characterRange options:0 usingBlock:^(NSNumber *value, NSRange range, BOOL *_) {\n    if (!value.boolValue) {\n      return;\n    }\n\n    [layoutManager enumerateEnclosingRectsForGlyphRange:range withinSelectedGlyphRange:range inTextContainer:textContainer usingBlock:^(CGRect enclosingRect, __unused BOOL *__) {\n      NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:CGRectInset(enclosingRect, -2, -2) xRadius:2 yRadius:2];\n      if (highlightPath) {\n        [highlightPath appendBezierPath:path];\n      } else {\n        highlightPath = path;\n      }\n    }];\n  }];\n\n  if (highlightPath) {\n    if (!_highlightLayer) {\n      _highlightLayer = [CAShapeLayer layer];\n      _highlightLayer.fillColor = [NSColor colorWithWhite:0 alpha:0.25].CGColor;\n      [self.layer addSublayer:_highlightLayer];\n    }\n    _highlightLayer.position = (CGPoint){_contentInset.left, _contentInset.top};\n    _highlightLayer.path = highlightPath.quartzPath;\n  } else {\n    [_highlightLayer removeFromSuperlayer];\n    _highlightLayer = nil;\n  }\n}\n\n- (NSNumber *)reactTagAtPoint:(CGPoint)point\n{\n  NSNumber *reactTag = self.reactTag;\n\n  CGFloat fraction;\n  NSLayoutManager *layoutManager = _textStorage.layoutManagers.firstObject;\n  NSTextContainer *textContainer = layoutManager.textContainers.firstObject;\n  NSUInteger characterIndex = [layoutManager characterIndexForPoint:point\n                                                    inTextContainer:textContainer\n                           fractionOfDistanceBetweenInsertionPoints:&fraction];\n\n  // If the point is not before (fraction == 0.0) the first character and not\n  // after (fraction == 1.0) the last character, then the attribute is valid.\n  if (_textStorage.length > 0 && (fraction > 0 || characterIndex > 0) && (fraction < 1 || characterIndex < _textStorage.length - 1)) {\n    reactTag = [_textStorage attribute:RCTReactTagAttributeName atIndex:characterIndex effectiveRange:NULL];\n  }\n  return reactTag;\n}\n\n- (void)viewDidMoveToWindow\n{\n  [super viewDidMoveToWindow];\n\n  if (!self.window) {\n    self.layer.contents = nil;\n    if (_highlightLayer) {\n      [_highlightLayer removeFromSuperlayer];\n      _highlightLayer = nil;\n    }\n  } else if (_textStorage.length) {\n    [self setNeedsDisplay:YES];\n  }\n}\n\n\n#pragma mark - Accessibility\n\n- (NSString *)accessibilityLabel\n{\n  NSString *superAccessibilityLabel = [super accessibilityLabel];\n  if (superAccessibilityLabel) {\n    return superAccessibilityLabel;\n  }\n  return _textStorage.string;\n}\n\n#pragma mark - Context Menu\n\n- (void)enableContextMenu\n{\n\n}\n\n- (void)disableContextMenu\n{\n}\n\n- (BOOL)canBecomeFirstResponder\n{\n  return _selectable;\n}\n\n//- (BOOL)canPerformAction:(SEL)action withSender:(id)sender\n//{\n//  if (_selectable && action == @selector(copy:)) {\n//    return YES;\n//  }\n//\n//  return [self.nextResponder canPerformAction:action withSender:sender];\n//}\n\n- (void)copy:(id)sender\n{\n#if !TARGET_OS_TV\n  #endif\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/Text/RCTTextViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTTextViewManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "Libraries/Text/Text/RCTTextViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextViewManager.h\"\n\n#import <yoga/Yoga.h>\n// #import <React/RCTAccessibilityManager.h>\n#import <React/RCTAssert.h>\n#import <React/RCTConvert.h>\n#import <React/RCTLog.h>\n#import <React/RCTShadowView+Layout.h>\n#import <React/NSView+React.h>\n\n#import \"RCTRawTextShadowView.h\"\n#import \"RCTTextShadowView.h\"\n#import \"RCTTextView.h\"\n#import \"RCTMultilineTextInputView.h\"\n\nstatic void collectDirtyNonTextDescendants(RCTTextShadowView *shadowView, NSMutableArray *nonTextDescendants) {\n  for (RCTShadowView *child in shadowView.reactSubviews) {\n    if ([child isKindOfClass:[RCTTextShadowView class]]) {\n      collectDirtyNonTextDescendants((RCTTextShadowView *)child, nonTextDescendants);\n    } else if ([child isKindOfClass:[RCTRawTextShadowView class]]) {\n      // no-op\n    } else if ([child isTextDirty]) {\n      [nonTextDescendants addObject:child];\n    }\n  }\n}\n\n@interface RCTTextShadowView (Private)\n\n- (NSTextStorage *)buildTextStorageForWidth:(CGFloat)width widthMode:(YGMeasureMode)widthMode;\n\n@end\n\n\n@implementation RCTTextViewManager\n\nRCT_EXPORT_MODULE(RCTText)\n\n- (NSView *)view\n{\n  return [RCTTextView new];\n}\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTTextShadowView new];\n}\n\n#pragma mark - Shadow properties\n\nRCT_EXPORT_SHADOW_PROPERTY(color, NSColor)\nRCT_EXPORT_SHADOW_PROPERTY(backgroundColor, NSColor)\nRCT_EXPORT_SHADOW_PROPERTY(fontFamily, NSString)\nRCT_EXPORT_SHADOW_PROPERTY(fontSize, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(fontWeight, NSString)\nRCT_EXPORT_SHADOW_PROPERTY(fontStyle, NSString)\nRCT_EXPORT_SHADOW_PROPERTY(fontVariant, NSArray)\nRCT_EXPORT_SHADOW_PROPERTY(isHighlighted, BOOL)\nRCT_EXPORT_SHADOW_PROPERTY(letterSpacing, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(lineHeight, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(numberOfLines, NSUInteger)\nRCT_EXPORT_SHADOW_PROPERTY(ellipsizeMode, NSLineBreakMode)\nRCT_EXPORT_SHADOW_PROPERTY(textAlign, NSTextAlignment)\nRCT_EXPORT_SHADOW_PROPERTY(textDecorationStyle, NSUnderlineStyle)\nRCT_EXPORT_SHADOW_PROPERTY(textDecorationColor, NSColor)\nRCT_EXPORT_SHADOW_PROPERTY(textDecorationLine, RCTTextDecorationLineType)\nRCT_EXPORT_SHADOW_PROPERTY(writingDirection, NSWritingDirection)\nRCT_EXPORT_SHADOW_PROPERTY(allowFontScaling, BOOL)\nRCT_EXPORT_SHADOW_PROPERTY(opacity, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(textShadowOffset, CGSize)\nRCT_EXPORT_SHADOW_PROPERTY(textShadowRadius, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(textShadowColor, NSColor)\nRCT_EXPORT_SHADOW_PROPERTY(adjustsFontSizeToFit, BOOL)\nRCT_EXPORT_SHADOW_PROPERTY(minimumFontScale, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(selectable, BOOL)\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary<NSNumber *, RCTShadowView *> *)shadowViewRegistry\n{\n  for (RCTShadowView *rootView in shadowViewRegistry.allValues) {\n    if (![rootView isReactRootView]) {\n      // This isn't a root view\n      continue;\n    }\n\n    if (![rootView isTextDirty]) {\n      // No text processing to be done\n      continue;\n    }\n\n    NSMutableArray<RCTShadowView *> *queue = [NSMutableArray arrayWithObject:rootView];\n    for (NSInteger i = 0; i < queue.count; i++) {\n      RCTShadowView *shadowView = queue[i];\n      RCTAssert([shadowView isTextDirty], @\"Don't process any nodes that don't have dirty text\");\n\n      if ([shadowView isKindOfClass:[RCTTextShadowView class]]) {\n        // ((RCTTextShadowView *)shadowView).fontSizeMultiplier = self.bridge.accessibilityManager.multiplier;\n        [(RCTTextShadowView *)shadowView recomputeText];\n        collectDirtyNonTextDescendants((RCTTextShadowView *)shadowView, queue);\n      } else if ([shadowView isKindOfClass:[RCTRawTextShadowView class]]) {\n        RCTLogError(@\"Raw text cannot be used outside of a <Text> tag. Not rendering string: '%@'\",\n                    [(RCTRawTextShadowView *)shadowView text]);\n      } else {\n        for (RCTShadowView *child in [shadowView reactSubviews]) {\n          if ([child isTextDirty]) {\n            [queue addObject:child];\n          }\n        }\n      }\n\n      [shadowView setTextComputed];\n    }\n  }\n\n  return nil;\n}\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTTextShadowView *)shadowView\n{\n  NSNumber *reactTag = shadowView.reactTag;\n  NSEdgeInsets padding = shadowView.paddingAsInsets;\n\n  return ^(RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTTextView *> *viewRegistry) {\n    RCTTextView *text = viewRegistry[reactTag];\n    text.contentInset = padding;\n  };\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/Text.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Text\n * @flow\n */\n'use strict';\n\nconst ColorPropType = require('ColorPropType');\nconst EdgeInsetsPropType = require('EdgeInsetsPropType');\nconst NativeMethodsMixin = require('NativeMethodsMixin');\nconst Platform = require('Platform');\nconst React = require('React');\nconst PropTypes = require('prop-types');\nconst ReactNativeViewAttributes = require('ReactNativeViewAttributes');\nconst StyleSheetPropType = require('StyleSheetPropType');\nconst TextStylePropTypes = require('TextStylePropTypes');\nconst Touchable = require('Touchable');\n\nconst createReactClass = require('create-react-class');\nconst createReactNativeComponentClass = require('createReactNativeComponentClass');\nconst mergeFast = require('mergeFast');\nconst processColor = require('processColor');\n\nconst stylePropType = StyleSheetPropType(TextStylePropTypes);\n\nconst viewConfig = {\n  validAttributes: mergeFast(ReactNativeViewAttributes.UIView, {\n    isHighlighted: true,\n    numberOfLines: true,\n    ellipsizeMode: true,\n    allowFontScaling: true,\n    disabled: true,\n    selectable: true,\n    selectionColor: true,\n    adjustsFontSizeToFit: true,\n    minimumFontScale: true,\n    textBreakStrategy: true,\n  }),\n  uiViewClassName: 'RCTText',\n};\n\n/**\n * A React component for displaying text.\n *\n * `Text` supports nesting, styling, and touch handling.\n *\n * In the following example, the nested title and body text will inherit the\n * `fontFamily` from `styles.baseText`, but the title provides its own\n * additional styles.  The title and body will stack on top of each other on\n * account of the literal newlines:\n *\n * ```ReactNativeWebPlayer\n * import React, { Component } from 'react';\n * import { AppRegistry, Text, StyleSheet } from 'react-native';\n *\n * export default class TextInANest extends Component {\n *   constructor(props) {\n *     super(props);\n *     this.state = {\n *       titleText: \"Bird's Nest\",\n *       bodyText: 'This is not really a bird nest.'\n *     };\n *   }\n *\n *   render() {\n *     return (\n *       <Text style={styles.baseText}>\n *         <Text style={styles.titleText} onPress={this.onPressTitle}>\n *           {this.state.titleText}{'\\n'}{'\\n'}\n *         </Text>\n *         <Text numberOfLines={5}>\n *           {this.state.bodyText}\n *         </Text>\n *       </Text>\n *     );\n *   }\n * }\n *\n * const styles = StyleSheet.create({\n *   baseText: {\n *     fontFamily: 'Cochin',\n *   },\n *   titleText: {\n *     fontSize: 20,\n *     fontWeight: 'bold',\n *   },\n * });\n *\n * // skip this line if using Create React Native App\n * AppRegistry.registerComponent('TextInANest', () => TextInANest);\n * ```\n *\n * ## Nested text\n *\n * Both iOS and Android allow you to display formatted text by annotating\n * ranges of a string with specific formatting like bold or colored text\n * (`NSAttributedString` on iOS, `SpannableString` on Android). In practice,\n * this is very tedious. For React Native, we decided to use web paradigm for\n * this where you can nest text to achieve the same effect.\n *\n *\n * ```ReactNativeWebPlayer\n * import React, { Component } from 'react';\n * import { AppRegistry, Text } from 'react-native';\n *\n * export default class BoldAndBeautiful extends Component {\n *   render() {\n *     return (\n *       <Text style={{fontWeight: 'bold'}}>\n *         I am bold\n *         <Text style={{color: 'red'}}>\n *           and red\n *         </Text>\n *       </Text>\n *     );\n *   }\n * }\n *\n * // skip this line if using Create React Native App\n * AppRegistry.registerComponent('AwesomeProject', () => BoldAndBeautiful);\n * ```\n *\n * Behind the scenes, React Native converts this to a flat `NSAttributedString`\n * or `SpannableString` that contains the following information:\n *\n * ```javascript\n * \"I am bold and red\"\n * 0-9: bold\n * 9-17: bold, red\n * ```\n *\n * ## Nested views (iOS only)\n *\n * On iOS, you can nest views within your Text component. Here's an example:\n *\n * ```ReactNativeWebPlayer\n * import React, { Component } from 'react';\n * import { AppRegistry, Text, View } from 'react-native';\n *\n * export default class BlueIsCool extends Component {\n *   render() {\n *     return (\n *       <Text>\n *         There is a blue square\n *         <View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />\n *         in between my text.\n *       </Text>\n *     );\n *   }\n * }\n *\n * // skip this line if using Create React Native App\n * AppRegistry.registerComponent('AwesomeProject', () => BlueIsCool);\n * ```\n *\n * > In order to use this feature, you must give the view a `width` and a `height`.\n *\n * ## Containers\n *\n * The `<Text>` element is special relative to layout: everything inside is no\n * longer using the flexbox layout but using text layout. This means that\n * elements inside of a `<Text>` are no longer rectangles, but wrap when they\n * see the end of the line.\n *\n * ```javascript\n * <Text>\n *   <Text>First part and </Text>\n *   <Text>second part</Text>\n * </Text>\n * // Text container: all the text flows as if it was one\n * // |First part |\n * // |and second |\n * // |part       |\n *\n * <View>\n *   <Text>First part and </Text>\n *   <Text>second part</Text>\n * </View>\n * // View container: each text is its own block\n * // |First part |\n * // |and        |\n * // |second part|\n * ```\n *\n * ## Limited Style Inheritance\n *\n * On the web, the usual way to set a font family and size for the entire\n * document is to take advantage of inherited CSS properties like so:\n *\n * ```css\n * html {\n *   font-family: 'lucida grande', tahoma, verdana, arial, sans-serif;\n *   font-size: 11px;\n *   color: #141823;\n * }\n * ```\n *\n * All elements in the document will inherit this font unless they or one of\n * their parents specifies a new rule.\n *\n * In React Native, we are more strict about it: **you must wrap all the text\n * nodes inside of a `<Text>` component**. You cannot have a text node directly\n * under a `<View>`.\n *\n *\n * ```javascript\n * // BAD: will raise exception, can't have a text node as child of a <View>\n * <View>\n *   Some text\n * </View>\n *\n * // GOOD\n * <View>\n *   <Text>\n *     Some text\n *   </Text>\n * </View>\n * ```\n *\n * You also lose the ability to set up a default font for an entire subtree.\n * The recommended way to use consistent fonts and sizes across your\n * application is to create a component `MyAppText` that includes them and use\n * this component across your app. You can also use this component to make more\n * specific components like `MyAppHeaderText` for other kinds of text.\n *\n * ```javascript\n * <View>\n *   <MyAppText>Text styled with the default font for the entire application</MyAppText>\n *   <MyAppHeaderText>Text styled as a header</MyAppHeaderText>\n * </View>\n * ```\n *\n * Assuming that `MyAppText` is a component that simply renders out its\n * children into a `Text` component with styling, then `MyAppHeaderText` can be\n * defined as follows:\n *\n * ```javascript\n * class MyAppHeaderText extends Component {\n *   render() {\n *     return (\n *       <MyAppText>\n *         <Text style={{fontSize: 20}}>\n *           {this.props.children}\n *         </Text>\n *       </MyAppText>\n *     );\n *   }\n * }\n * ```\n *\n * Composing `MyAppText` in this way ensures that we get the styles from a\n * top-level component, but leaves us the ability to add / override them in\n * specific use cases.\n *\n * React Native still has the concept of style inheritance, but limited to text\n * subtrees. In this case, the second part will be both bold and red.\n *\n * ```javascript\n * <Text style={{fontWeight: 'bold'}}>\n *   I am bold\n *   <Text style={{color: 'red'}}>\n *     and red\n *   </Text>\n * </Text>\n * ```\n *\n * We believe that this more constrained way to style text will yield better\n * apps:\n *\n * - (Developer) React components are designed with strong isolation in mind:\n * You should be able to drop a component anywhere in your application,\n * trusting that as long as the props are the same, it will look and behave the\n * same way. Text properties that could inherit from outside of the props would\n * break this isolation.\n *\n * - (Implementor) The implementation of React Native is also simplified. We do\n * not need to have a `fontFamily` field on every single element, and we do not\n * need to potentially traverse the tree up to the root every time we display a\n * text node. The style inheritance is only encoded inside of the native Text\n * component and doesn't leak to other components or the system itself.\n *\n */\n\nconst Text = createReactClass({\n  displayName: 'Text',\n  propTypes: {\n    /**\n     * When `numberOfLines` is set, this prop defines how text will be truncated.\n     * `numberOfLines` must be set in conjunction with this prop.\n     *\n     * This can be one of the following values:\n     *\n     * - `head` - The line is displayed so that the end fits in the container and the missing text\n     * at the beginning of the line is indicated by an ellipsis glyph. e.g., \"...wxyz\"\n     * - `middle` - The line is displayed so that the beginning and end fit in the container and the\n     * missing text in the middle is indicated by an ellipsis glyph. \"ab...yz\"\n     * - `tail` - The line is displayed so that the beginning fits in the container and the\n     * missing text at the end of the line is indicated by an ellipsis glyph. e.g., \"abcd...\"\n     * - `clip` - Lines are not drawn past the edge of the text container.\n     *\n     * The default is `tail`.\n     *\n     * > `clip` is working only for iOS\n     */\n    ellipsizeMode: PropTypes.oneOf(['head', 'middle', 'tail', 'clip']),\n    /**\n     * Used to truncate the text with an ellipsis after computing the text\n     * layout, including line wrapping, such that the total number of lines\n     * does not exceed this number.\n     *\n     * This prop is commonly used with `ellipsizeMode`.\n     */\n    numberOfLines: PropTypes.number,\n    /**\n     * Set text break strategy on Android API Level 23+, possible values are `simple`, `highQuality`, `balanced`\n     * The default value is `highQuality`.\n     * @platform android\n     */\n    textBreakStrategy: PropTypes.oneOf(['simple', 'highQuality', 'balanced']),\n    /**\n     * Invoked on mount and layout changes with\n     *\n     *   `{nativeEvent: {layout: {x, y, width, height}}}`\n     */\n    onLayout: PropTypes.func,\n    /**\n     * This function is called on press.\n     *\n     * e.g., `onPress={() => console.log('1st')}`\n     */\n    onPress: PropTypes.func,\n    /**\n     * This function is called on long press.\n     *\n     * e.g., `onLongPress={this.increaseSize}>`\n     */\n    onLongPress: PropTypes.func,\n    /**\n     * When the scroll view is disabled, this defines how far your touch may\n     * move off of the button, before deactivating the button. Once deactivated,\n     * try moving it back and you'll see that the button is once again\n     * reactivated! Move it back and forth several times while the scroll view\n     * is disabled. Ensure you pass in a constant to reduce memory allocations.\n     */\n    pressRetentionOffset: EdgeInsetsPropType,\n    /**\n     * Lets the user select text, to use the native copy and paste functionality.\n     */\n    selectable: PropTypes.bool,\n    /**\n     * The highlight color of the text.\n     * @platform android\n     */\n    selectionColor: ColorPropType,\n    /**\n     * When `true`, no visual change is made when text is pressed down. By\n     * default, a gray oval highlights the text on press down.\n     * @platform ios\n     */\n    suppressHighlighting: PropTypes.bool,\n    style: stylePropType,\n    /**\n     * Used to locate this view in end-to-end tests.\n     */\n    testID: PropTypes.string,\n    /**\n     * Used to locate this view from native code.\n     */\n    nativeID: PropTypes.string,\n    /**\n     * Specifies whether fonts should scale to respect Text Size accessibility settings. The\n     * default is `true`.\n     */\n    allowFontScaling: PropTypes.bool,\n    /**\n     * When set to `true`, indicates that the view is an accessibility element. The default value\n     * for a `Text` element is `true`.\n     *\n     * See the\n     * [Accessibility guide](docs/accessibility.html#accessible-ios-android)\n     * for more information.\n     */\n    accessible: PropTypes.bool,\n    /**\n     * Specifies whether font should be scaled down automatically to fit given style constraints.\n     * @platform ios\n     */\n    adjustsFontSizeToFit: PropTypes.bool,\n\n    /**\n     * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).\n     * @platform ios\n     */\n    minimumFontScale: PropTypes.number,\n    /**\n     * Specifies the disabled state of the text view for testing purposes\n     * @platform android\n     */\n    disabled: PropTypes.bool,\n  },\n  getDefaultProps(): Object {\n    return {\n      accessible: true,\n      testRole: 'AXText',\n      allowFontScaling: true,\n      ellipsizeMode: 'tail',\n    };\n  },\n  getInitialState: function(): Object {\n    return mergeFast(Touchable.Mixin.touchableGetInitialState(), {\n      isHighlighted: false,\n    });\n  },\n  mixins: [NativeMethodsMixin],\n  viewConfig: viewConfig,\n  getChildContext(): Object {\n    return {isInAParentText: true};\n  },\n  childContextTypes: {\n    isInAParentText: PropTypes.bool\n  },\n  contextTypes: {\n    isInAParentText: PropTypes.bool\n  },\n  /**\n   * Only assigned if touch is needed.\n   */\n  _handlers: (null: ?Object),\n  _hasPressHandler(): boolean {\n    return !!this.props.onPress || !!this.props.onLongPress;\n  },\n  /**\n   * These are assigned lazily the first time the responder is set to make plain\n   * text nodes as cheap as possible.\n   */\n  touchableHandleActivePressIn: (null: ?Function),\n  touchableHandleActivePressOut: (null: ?Function),\n  touchableHandlePress: (null: ?Function),\n  touchableHandleLongPress: (null: ?Function),\n  touchableGetPressRectOffset: (null: ?Function),\n  render(): React.Element<any> {\n    let newProps = this.props;\n    if (this.props.onStartShouldSetResponder || this._hasPressHandler()) {\n      if (!this._handlers) {\n        this._handlers = {\n          onStartShouldSetResponder: (): bool => {\n            const shouldSetFromProps = this.props.onStartShouldSetResponder &&\n                // $FlowFixMe(>=0.41.0)\n                this.props.onStartShouldSetResponder();\n            const setResponder = shouldSetFromProps || this._hasPressHandler();\n            if (setResponder && !this.touchableHandleActivePressIn) {\n              // Attach and bind all the other handlers only the first time a touch\n              // actually happens.\n              for (const key in Touchable.Mixin) {\n                if (typeof Touchable.Mixin[key] === 'function') {\n                  (this: any)[key] = Touchable.Mixin[key].bind(this);\n                }\n              }\n              this.touchableHandleActivePressIn = () => {\n                if (this.props.suppressHighlighting || !this._hasPressHandler()) {\n                  return;\n                }\n                this.setState({\n                  isHighlighted: true,\n                });\n              };\n\n              this.touchableHandleActivePressOut = () => {\n                if (this.props.suppressHighlighting || !this._hasPressHandler()) {\n                  return;\n                }\n                this.setState({\n                  isHighlighted: false,\n                });\n              };\n\n              this.touchableHandlePress = (e: SyntheticEvent<>) => {\n                this.props.onPress && this.props.onPress(e);\n              };\n\n              this.touchableHandleLongPress = (e: SyntheticEvent<>) => {\n                this.props.onLongPress && this.props.onLongPress(e);\n              };\n\n              this.touchableGetPressRectOffset = function(): RectOffset {\n                return this.props.pressRetentionOffset || PRESS_RECT_OFFSET;\n              };\n            }\n            return setResponder;\n          },\n          onResponderGrant: function(e: SyntheticEvent<>, dispatchID: string) {\n            this.touchableHandleResponderGrant(e, dispatchID);\n            this.props.onResponderGrant &&\n              this.props.onResponderGrant.apply(this, arguments);\n          }.bind(this),\n          onResponderMove: function(e: SyntheticEvent<>) {\n            this.touchableHandleResponderMove(e);\n            this.props.onResponderMove &&\n              this.props.onResponderMove.apply(this, arguments);\n          }.bind(this),\n          onResponderRelease: function(e: SyntheticEvent<>) {\n            this.touchableHandleResponderRelease(e);\n            this.props.onResponderRelease &&\n              this.props.onResponderRelease.apply(this, arguments);\n          }.bind(this),\n          onResponderTerminate: function(e: SyntheticEvent<>) {\n            this.touchableHandleResponderTerminate(e);\n            this.props.onResponderTerminate &&\n              this.props.onResponderTerminate.apply(this, arguments);\n          }.bind(this),\n          onResponderTerminationRequest: function(): bool {\n            // Allow touchable or props.onResponderTerminationRequest to deny\n            // the request\n            var allowTermination = this.touchableHandleResponderTerminationRequest();\n            if (allowTermination && this.props.onResponderTerminationRequest) {\n              allowTermination = this.props.onResponderTerminationRequest.apply(this, arguments);\n            }\n            return allowTermination;\n          }.bind(this),\n        };\n      }\n      newProps = {\n        ...this.props,\n        ...this._handlers,\n        isHighlighted: this.state.isHighlighted,\n      };\n    }\n    if (newProps.selectionColor != null) {\n      newProps = {\n        ...newProps,\n        selectionColor: processColor(newProps.selectionColor)\n      };\n    }\n    if (Touchable.TOUCH_TARGET_DEBUG && newProps.onPress) {\n      newProps = {\n        ...newProps,\n        style: [this.props.style, {color: 'magenta'}],\n      };\n    }\n    if (this.context.isInAParentText) {\n      return <RCTVirtualText {...newProps} />;\n    } else {\n      return <RCTText {...newProps} />;\n    }\n  },\n});\n\ntype RectOffset = {\n  top: number,\n  left: number,\n  right: number,\n  bottom: number,\n}\n\nvar PRESS_RECT_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};\n\nvar RCTText = createReactNativeComponentClass(\n  viewConfig.uiViewClassName,\n  () => viewConfig\n);\nvar RCTVirtualText = RCTText;\n\nif (Platform.OS === 'android') {\n  RCTVirtualText = createReactNativeComponentClass('RCTVirtualText', () => ({\n    validAttributes: mergeFast(ReactNativeViewAttributes.UIView, {\n      isHighlighted: true,\n    }),\n    uiViewClassName: 'RCTVirtualText',\n  }));\n}\n\nmodule.exports = Text;\n"
  },
  {
    "path": "Libraries/Text/TextInput/Multiline/RCTMultilineTextInputShadowView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTShadowView.h>\n\n@interface RCTMultilineTextInputShadowView : RCTShadowView\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Multiline/RCTMultilineTextInputShadowView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTMultilineTextInputShadowView.h\"\n\n@implementation RCTMultilineTextInputShadowView\n\n- (BOOL)isYogaLeafNode\n{\n  return YES;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTView.h>\n#import <React/NSView+React.h>\n\n#import \"RCTBaseTextInputView.h\"\n\n@class RCTBridge;\n\n@interface RCTMultilineTextInputView : RCTBaseTextInputView\n\n//@property (nonatomic, assign) BOOL blurOnSubmit;\n//@property (nonatomic, assign) BOOL clearTextOnFocus;\n//@property (nonatomic, assign) BOOL selectTextOnFocus;\n@property (nonatomic, assign) NSEdgeInsets contentInset;\n@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;\n@property (nonatomic, copy) NSString *text;\n@property (nonatomic, strong) NSColor *placeholderTextColor;\n@property (nonatomic, copy) NSString *placeholder;\n@property (nonatomic, strong) NSFont *font;\n// @property (nonatomic, assign) NSInteger mostRecentEventCount;\n@property (nonatomic, strong) NSNumber *maxLength;\n\n@property (nonatomic, copy) RCTDirectEventBlock onChange;\n@property (nonatomic, copy) RCTDirectEventBlock onTextInput;\n@property (nonatomic, copy) RCTDirectEventBlock onScroll;\n\n- (void)performTextUpdate;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTMultilineTextInputView.h\"\n\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTFont.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTUtils.h>\n#import <React/NSView+React.h>\n\n#import \"RCTTextShadowView.h\"\n#import \"RCTTextView.h\"\n#import \"RCTTextSelection.h\"\n#import \"RCTUITextView.h\"\n\n@interface RCTMultilineTextInputView () <RCTBackedTextInputDelegate>\n\n@end\n\n@implementation RCTMultilineTextInputView\n{\n  RCTUITextView *_backedTextInput;\n  RCTTextView *_richTextView;\n  NSAttributedString *_pendingAttributedText;\n\n  NSString *_predictedText;\n\n  BOOL _blockTextShouldChange;\n  BOOL _nativeUpdatesInFlight;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  RCTAssertParam(bridge);\n\n  if (self = [super initWithBridge:bridge]) {\n    // `blurOnSubmit` defaults to `false` for <TextInput multiline={true}> by design.\n    _blurOnSubmit = NO;\n\n    _backedTextInput = [[RCTUITextView alloc] initWithFrame:self.bounds];\n    _backedTextInput.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;\n    _backedTextInput.backgroundColor = [NSColor clearColor];\n    _backedTextInput.textColor = [NSColor blackColor];\n    // This line actually removes 5pt (default value) left and right padding in UITextView.\n    _backedTextInput.textContainer.lineFragmentPadding = 0;\n//#if !TARGET_OS_TV\n//    _backedTextInput.scrollsToTop = NO;\n//#endif\n//    _backedTextInput.scrollEnabled = YES;\n    _backedTextInput.textInputDelegate = self;\n    _backedTextInput.font = self.fontAttributes.font;\n\n    [self addSubview:_backedTextInput];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (id<RCTBackedTextInputViewProtocol>)backedTextInputView\n{\n  return _backedTextInput;\n}\n\n#pragma mark - RCTComponent\n\n- (void)insertReactSubview:(NSView *)subview atIndex:(NSInteger)index\n{\n  [super insertReactSubview:subview atIndex:index];\n\n  if ([subview isKindOfClass:[RCTTextView class]]) {\n    if (_richTextView) {\n      RCTLogError(@\"Tried to insert a second <Text> into <TextInput> - there can only be one.\");\n    }\n    _richTextView = (RCTTextView *)subview;\n\n    // If this <TextInput> is in rich text editing mode, and the child <Text> node providing rich text\n    // styling has a backgroundColor, then the attributedText produced by the child <Text> node will have an\n    // NSBackgroundColor attribute. We need to forward this attribute to the text view manually because the text view\n    // always has a clear background color in `initWithBridge:`.\n    //\n    // TODO: This should be removed when the related hack in -performPendingTextUpdate is removed.\n    if (subview.layer.backgroundColor) {\n      NSMutableDictionary<NSString *, id> *attrs = [_backedTextInput.typingAttributes mutableCopy];\n      NSColor *backgroundColor = [NSColor colorWithCGColor:subview.layer.backgroundColor];\n      attrs[NSBackgroundColorAttributeName] = backgroundColor;\n      _backedTextInput.typingAttributes = attrs;\n    }\n\n    [self performTextUpdate];\n  }\n}\n\n- (void)removeReactSubview:(NSView *)subview\n{\n  [super removeReactSubview:subview];\n  if (_richTextView == subview) {\n    _richTextView = nil;\n    [self performTextUpdate];\n  }\n}\n\n- (void)didUpdateReactSubviews\n{\n  // Do nothing, as we don't allow non-text subviews.\n}\n\n#pragma mark - Routine\n\n- (void)setMostRecentEventCount:(NSInteger)mostRecentEventCount\n{\n  _mostRecentEventCount = mostRecentEventCount;\n\n  // Props are set after uiBlockToAmendWithShadowViewRegistry, which means that\n  // at the time performTextUpdate is called, _mostRecentEventCount will be\n  // behind _eventCount, with the result that performPendingTextUpdate will do\n  // nothing. For that reason we call it again here after mostRecentEventCount\n  // has been set.\n  [self performPendingTextUpdate];\n}\n\n- (void)performTextUpdate\n{\n  if (_richTextView) {\n    _pendingAttributedText = _richTextView.textStorage;\n    [self performPendingTextUpdate];\n  } else if (!self.text) {\n    _backedTextInput.attributedString = nil;\n  }\n}\n\nstatic NSAttributedString *removeReactTagFromString(NSAttributedString *string)\n{\n  if (string.length == 0) {\n    return string;\n  } else {\n    NSMutableAttributedString *mutableString = [[NSMutableAttributedString alloc] initWithAttributedString:string];\n    [mutableString removeAttribute:RCTReactTagAttributeName range:NSMakeRange(0, mutableString.length)];\n    return mutableString;\n  }\n}\n\n- (void)performPendingTextUpdate\n{\n  if (!_pendingAttributedText || _mostRecentEventCount < _nativeEventCount || _nativeUpdatesInFlight) {\n    return;\n  }\n\n  // The underlying <Text> node that produces _pendingAttributedText has a react tag attribute on it that causes the\n  // -isEqualToAttributedString: comparison below to spuriously fail. We don't want that comparison to fail unless it\n  // needs to because when the comparison fails, we end up setting attributedText on the text view, which clears\n  // autocomplete state for CKJ text input.\n  //\n  // TODO: Kill this after we finish passing all style/attribute info into JS.\n  _pendingAttributedText = removeReactTagFromString(_pendingAttributedText);\n\n  if ([_backedTextInput.attributedText isEqualToAttributedString:_pendingAttributedText]) {\n    _pendingAttributedText = nil; // Don't try again.\n    return;\n  }\n\n  // When we update the attributed text, there might be pending autocorrections\n  // that will get accepted by default. In order for this to not garble our text,\n  // we temporarily block all textShouldChange events so they are not applied.\n  _blockTextShouldChange = YES;\n\n  UITextRange *selection = _backedTextInput.selectedTextRange;\n  NSInteger oldTextLength = _backedTextInput.attributedText.length;\n\n  _backedTextInput.attributedText = _pendingAttributedText;\n  _predictedText = _pendingAttributedText.string;\n  _pendingAttributedText = nil;\n\n  if (selection.empty) {\n    // maintain cursor position relative to the end of the old text\n    NSInteger start = [_backedTextInput offsetFromPosition:_backedTextInput.beginningOfDocument toPosition:selection.start];\n    NSInteger offsetFromEnd = oldTextLength - start;\n    NSInteger newOffset = _backedTextInput.attributedText.length - offsetFromEnd;\n    NSTextPosition *position = [_backedTextInput positionFromPosition:_backedTextInput.beginningOfDocument offset:newOffset];\n    [_backedTextInput setSelectedTextRange:[_backedTextInput textRangeFromPosition:position toPosition:position]\n                            notifyDelegate:YES];\n  }\n\n  [_backedTextInput layoutIfNeeded];\n\n  [self invalidateContentSize];\n\n  _blockTextShouldChange = NO;\n}\n\n#pragma mark - Properties\n\n- (NSFont *)font\n{\n  return _backedTextInput.font;\n}\n\n- (void)setFont:(NSFont *)font\n{\n  _backedTextInput.font = font;\n  [self setNeedsLayout];\n}\n\n- (NSString *)text\n{\n  return _backedTextInput.text;\n}\n\n- (void)setText:(NSString *)text\n{\n  NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n  if (eventLag == 0 && ![text isEqualToString:_backedTextInput.text]) {\n    UITextRange *selection = _backedTextInput.selectedTextRange;\n    NSInteger oldTextLength = _backedTextInput.text.length;\n\n    _predictedText = text;\n    _backedTextInput.text = text;\n\n    if (selection.empty) {\n      // maintain cursor position relative to the end of the old text\n      NSInteger start = [_backedTextInput offsetFromPosition:_backedTextInput.beginningOfDocument toPosition:selection.start];\n      NSInteger offsetFromEnd = oldTextLength - start;\n      NSInteger newOffset = text.length - offsetFromEnd;\n      UITextPosition *position = [_backedTextInput positionFromPosition:_backedTextInput.beginningOfDocument offset:newOffset];\n      [_backedTextInput setSelectedTextRange:[_backedTextInput textRangeFromPosition:position toPosition:position]\n                              notifyDelegate:YES];\n    }\n\n    [self invalidateContentSize];\n  } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n    RCTLogWarn(@\"Native TextInput(%@) is %lld events ahead of JS - try to make your JS faster.\", self.text, (long long)eventLag);\n  }\n}\n\n#pragma mark - RCTBackedTextInputDelegate\n\n- (BOOL)textInputShouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text\n{\n  if (!_backedTextInput.textWasPasted) {\n    [_eventDispatcher sendTextEventWithType:RCTTextEventTypeKeyPress\n                                   reactTag:self.reactTag\n                                       text:nil\n                                        key:text\n                                 eventCount:_nativeEventCount];\n  }\n\n  // So we need to track that there is a native update in flight just in case JS manages to come back around and update\n  // things /before/ UITextView can update itself asynchronously.  If there is a native update in flight, we defer the\n  // JS update when it comes in and apply the deferred update once textViewDidChange fires with the native update applied.\n  if (_blockTextShouldChange) {\n    return NO;\n  }\n\n  if (_maxLength) {\n    NSUInteger allowedLength = _maxLength.integerValue - _backedTextInput.text.length + range.length;\n    if (text.length > allowedLength) {\n      // If we typed/pasted more than one character, limit the text inputted\n      if (text.length > 1) {\n        // Truncate the input string so the result is exactly maxLength\n        NSString *limitedString = [text substringToIndex:allowedLength];\n        NSMutableString *newString = _backedTextInput.text.mutableCopy;\n        [newString replaceCharactersInRange:range withString:limitedString];\n        _backedTextInput.text = newString;\n        _predictedText = newString;\n\n        // Collapse selection at end of insert to match normal paste behavior\n        UITextPosition *insertEnd = [_backedTextInput positionFromPosition:_backedTextInput.beginningOfDocument\n                                                            offset:(range.location + allowedLength)];\n        [_backedTextInput setSelectedTextRange:[_backedTextInput textRangeFromPosition:insertEnd toPosition:insertEnd]\n                                notifyDelegate:YES];\n\n        [self textInputDidChange];\n      }\n      return NO;\n    }\n  }\n\n  _nativeUpdatesInFlight = YES;\n\n  if (range.location + range.length > _predictedText.length) {\n    // _predictedText got out of sync in a bad way, so let's just force sync it.  Haven't been able to repro this, but\n    // it's causing a real crash here: #6523822\n    _predictedText = _backedTextInput.text;\n  }\n\n  NSString *previousText = [_predictedText substringWithRange:range];\n  if (_predictedText) {\n    _predictedText = [_predictedText stringByReplacingCharactersInRange:range withString:text];\n  } else {\n    _predictedText = text;\n  }\n\n  if (_onTextInput) {\n    _onTextInput(@{\n      @\"text\": text,\n      @\"previousText\": previousText ?: @\"\",\n      @\"range\": @{\n        @\"start\": @(range.location),\n        @\"end\": @(range.location + range.length)\n      },\n      @\"eventCount\": @(_nativeEventCount),\n    });\n  }\n\n  return YES;\n}\n\nstatic BOOL findMismatch(NSString *first, NSString *second, NSRange *firstRange, NSRange *secondRange)\n{\n  NSInteger firstMismatch = -1;\n  for (NSUInteger ii = 0; ii < MAX(first.length, second.length); ii++) {\n    if (ii >= first.length || ii >= second.length || [first characterAtIndex:ii] != [second characterAtIndex:ii]) {\n      firstMismatch = ii;\n      break;\n    }\n  }\n\n  if (firstMismatch == -1) {\n    return NO;\n  }\n\n  NSUInteger ii = second.length;\n  NSUInteger lastMismatch = first.length;\n  while (ii > firstMismatch && lastMismatch > firstMismatch) {\n    if ([first characterAtIndex:(lastMismatch - 1)] != [second characterAtIndex:(ii - 1)]) {\n      break;\n    }\n    ii--;\n    lastMismatch--;\n  }\n\n  *firstRange = NSMakeRange(firstMismatch, lastMismatch - firstMismatch);\n  *secondRange = NSMakeRange(firstMismatch, ii - firstMismatch);\n  return YES;\n}\n\n- (void)textInputDidChange\n{\n  [self invalidateContentSize];\n\n  // Detect when _backedTextInput updates happend that didn't invoke `shouldChangeTextInRange`\n  // (e.g. typing simplified chinese in pinyin will insert and remove spaces without\n  // calling shouldChangeTextInRange).  This will cause JS to get out of sync so we\n  // update the mismatched range.\n  NSRange currentRange;\n  NSRange predictionRange;\n  if (findMismatch(_backedTextInput.text, _predictedText, &currentRange, &predictionRange)) {\n    NSString *replacement = [_backedTextInput.text substringWithRange:currentRange];\n    [self textInputShouldChangeTextInRange:predictionRange replacementText:replacement];\n    // JS will assume the selection changed based on the location of our shouldChangeTextInRange, so reset it.\n    [self textInputDidChangeSelection];\n    _predictedText = _backedTextInput.text;\n  }\n\n  _nativeUpdatesInFlight = NO;\n  _nativeEventCount++;\n\n  if (!self.reactTag || !_onChange) {\n    return;\n  }\n\n  _onChange(@{\n    @\"text\": self.text,\n    @\"target\": self.reactTag,\n    @\"eventCount\": @(_nativeEventCount),\n  });\n}\n\n#pragma mark - UIScrollViewDelegate\n\n- (void)scrollViewDidScroll:(NSScrollView *)scrollView\n{\n  if (_onScroll) {\n    CGPoint contentOffset = scrollView.contentOffset;\n    CGSize contentSize = scrollView.contentSize;\n    CGSize size = scrollView.bounds.size;\n    NSEdgeInsets contentInset = scrollView.contentInset;\n\n    _onScroll(@{\n      @\"contentOffset\": @{\n        @\"x\": @(contentOffset.x),\n        @\"y\": @(contentOffset.y)\n      },\n      @\"contentInset\": @{\n        @\"top\": @(contentInset.top),\n        @\"left\": @(contentInset.left),\n        @\"bottom\": @(contentInset.bottom),\n        @\"right\": @(contentInset.right)\n      },\n      @\"contentSize\": @{\n        @\"width\": @(contentSize.width),\n        @\"height\": @(contentSize.height)\n      },\n      @\"layoutMeasurement\": @{\n        @\"width\": @(size.width),\n        @\"height\": @(size.height)\n      },\n      @\"zoomScale\": @(scrollView.zoomScale ?: 1),\n    });\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTBaseTextInputViewManager.h\"\n\n@interface RCTMultilineTextInputViewManager : RCTBaseTextInputViewManager\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTMultilineTextInputViewManager.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTFont.h>\n#import <React/RCTShadowView+Layout.h>\n#import <React/RCTShadowView.h>\n\n#import \"RCTConvert+Text.h\"\n#import \"RCTMultilineTextInputShadowView.h\"\n#import \"RCTMultilineTextInputView.h\"\n\n@implementation RCTMultilineTextInputViewManager\n\nRCT_EXPORT_MODULE()\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTMultilineTextInputShadowView new];\n}\n\n- (NSView *)view\n{\n  return [[RCTMultilineTextInputView alloc] initWithBridge:self.bridge];\n}\n\n#pragma mark - Multiline <TextInput> (aka TextView) specific properties\n\nRCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onContentSizeChange, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onSelectionChange, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onScroll, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onTextInput, RCTDirectEventBlock)\n\n#if !TARGET_OS_TV\nRCT_REMAP_VIEW_PROPERTY(dataDetectorTypes, backedTextInputView.dataDetectorTypes, UIDataDetectorTypes)\n#endif\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Multiline/RCTUITextView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTBackedTextInputViewProtocol.h\"\n\n#import \"RCTBackedTextInputDelegate.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n/*\n * Just regular UITextView... but much better!\n */\n\n@interface RCTUITextView : NSTextView <RCTBackedTextInputViewProtocol>\n\n- (instancetype)initWithFrame:(CGRect)frame textContainer:(nullable NSTextContainer *)textContainer NS_UNAVAILABLE;\n- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;\n\n@property (nonatomic, weak) id<RCTBackedTextInputDelegate> textInputDelegate;\n// - (void)setText:(NSString *)text;\n- (void)setAttributedText:(NSAttributedString *)attributedText;\n\n@property (nonatomic, strong) NSAttributedString *placeholderAttributedString;\n@property (nonatomic, assign) BOOL textWasPasted;\n@property (nonatomic, copy, nullable) NSString *placeholderText;\n@property (nonatomic, assign, nullable) NSColor *placeholderTextColor;\n@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Text/TextInput/Multiline/RCTUITextView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Cocoa/Cocoa.h>\n#import \"RCTUITextView.h\"\n\n#import <React/NSView+React.h>\n#import <React/RCTUtils.h>\n\nCGRect UIEdgeInsetsSizeRect(CGRect rect, CGSize insets) {\n//  rect.origin.x    += insets.left;\n //  rect.origin.y    += insets.top;\n  rect.size.width  -= (insets.width);\n  rect.size.height -= (insets.height);\n  return rect;\n}\n\n\n#import \"RCTBackedTextInputDelegateAdapter.h\"\n\n@implementation RCTUITextView\n{\n  NSTextField *_placeholderView;\n  NSTextView *_detachedTextView;\n  RCTBackedTextViewDelegateAdapter *_textInputDelegateAdapter;\n}\n\nstatic NSFont *defaultPlaceholderFont()\n{\n  return [NSFont systemFontOfSize:17];\n}\n\nstatic NSColor *defaultPlaceholderTextColor()\n{\n  // Default placeholder color from UITextField.\n  return [NSColor colorWithRed:0 green:0 blue:0.0980392 alpha:0.22];\n}\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if (self = [super initWithFrame:frame]) {\n    _placeholderView = [[NSTextField alloc] initWithFrame:self.bounds];\n//    _placeholderView.isAccessibilityElement = NO;\n//    _placeholderView.numberOfLines = 0;\n    [self addSubview:_placeholderView];\n\n    _textInputDelegateAdapter = [[RCTBackedTextViewDelegateAdapter alloc] initWithTextView:self];\n  }\n\n  return self;\n}\n\n\n- (NSString *)accessibilityLabel\n{\n  NSMutableString *accessibilityLabel = [NSMutableString new];\n\n  NSString *superAccessibilityLabel = [super accessibilityLabel];\n  if (superAccessibilityLabel.length > 0) {\n    [accessibilityLabel appendString:superAccessibilityLabel];\n  }\n\n  if (self.placeholder.length > 0 && self.text.length == 0) {\n    if (accessibilityLabel.length > 0) {\n      [accessibilityLabel appendString:@\" \"];\n    }\n    [accessibilityLabel appendString:self.placeholder];\n  }\n\n  return accessibilityLabel;\n}\n\n#pragma mark - Properties\n\n- (void)setPlaceholder:(NSString *)placeholder\n{\n  _placeholderText = placeholderText;\n  _placeholderView.stringValue = _placeholderText;\n}\n\n- (void)setPlaceholderTextColor:(NSColor *)placeholderTextColor\n{\n  _placeholderColor = placeholderColor;\n  _placeholderView.textColor = _placeholderColor ?: defaultPlaceholderColor();\n}\n\n- (void)textDidChange\n{\n  _textWasPasted = NO;\n  [self invalidatePlaceholderVisibility];\n}\n\n#pragma mark - Overrides\n\n- (void)setFont:(NSFont *)font\n{\n  // [super setFont:font];\n  [[super textStorage] setFont:font];\n  _placeholderView.font = font ?: defaultPlaceholderFont();\n}\n\n- (void)setTextAlignment:(NSTextAlignment)textAlignment\n{\n  // [super setTextAlignment:textAlignment];\n  // _placeholderView.textAlignment = textAlignment;\n}\n\n- (void)setText:(NSString *)text\n{\n  [self setString:text];\n  [self textDidChange];\n}\n\n- (void)setAttributedText:(NSAttributedString *)attributedText\n{\n  [self.textStorage setAttributedString:attributedText];\n  [self textDidChange];\n}\n\n#pragma mark - Overrides\n\n- (void)setSelectedTextRange:(UITextRange *)selectedTextRange notifyDelegate:(BOOL)notifyDelegate\n{\n  if (!notifyDelegate) {\n    // We have to notify an adapter that following selection change was initiated programmatically,\n    // so the adapter must not generate a notification for it.\n    [_textInputDelegateAdapter skipNextTextInputDidChangeSelectionEventWithTextRange:selectedTextRange];\n  }\n\n  [super setSelectedTextRange:selectedTextRange];\n}\n\n- (void)paste:(id)sender\n{\n  [super paste:sender];\n  _textWasPasted = YES;\n}\n\n- (void)setContentOffset:(CGPoint)contentOffset animated:(__unused BOOL)animated\n{\n  // Turning off scroll animation.\n  // This fixes the problem also known as \"flaky scrolling\".\n  // [super setContentOffset:contentOffset animated:NO];\n}\n\n#pragma mark - Layout\n\n- (void)layout\n{\n  [super layout];\n\n  CGRect textFrame = UIEdgeInsetsSizeRect(self.bounds, self.textContainerInset);\n  CGFloat placeholderHeight = [_placeholderView sizeThatFits:textFrame.size].height;\n  textFrame.size.height = MIN(placeholderHeight, textFrame.size.height);\n  _placeholderView.frame = textFrame;\n}\n\n- (CGSize)intrinsicContentSize\n{\n  // Returning size DOES contain `textContainerInset` (aka `padding`).\n  return [self sizeThatFits:CGSizeMake(self.preferredMaxLayoutWidth, INFINITY)];\n}\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  NSRect rect = [super.layoutManager usedRectForTextContainer:super.textContainer];\n  return CGSizeMake(MIN(rect.size.width, size.width), rect.size.height);\n}\n\n#pragma mark - Placeholder\n\n- (void)invalidatePlaceholderVisibility\n{\n  BOOL isVisible = _placeholderText.length != 0 && self.string.length == 0;\n  _placeholderView.hidden = !isVisible;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/RCTBackedTextInputDelegate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@protocol RCTBackedTextInputViewProtocol;\n\n@protocol RCTBackedTextInputDelegate <NSObject>\n\n- (BOOL)textInputShouldBeginEditing; // Return `NO` to disallow editing.\n- (void)textInputDidBeginEditing;\n\n- (BOOL)textInputShouldEndEditing; // Return `YES` to allow editing to stop and to resign first responder status. `NO` to disallow the editing session to end.\n- (void)textInputDidEndEditing; // May be called if forced even if `textInputShouldEndEditing` returns `NO` (e.g. view removed from window) or `[textInput endEditing:YES]` called.\n\n- (BOOL)textInputShouldReturn; // May be called right before `textInputShouldEndEditing` if \"Return\" button was pressed.\n- (void)textInputDidReturn;\n\n- (BOOL)textInputShouldChangeTextInRange:(NSRange)range replacementText:(NSString *)string; // Return NO to not change text.\n- (void)textInputDidChange;\n\n- (void)textInputDidChangeSelection;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTBackedTextInputViewProtocol.h\"\n#import \"RCTBackedTextInputDelegate.h\"\n\n#pragma mark - RCTBackedTextFieldDelegateAdapter (for UITextField)\n\n@interface RCTBackedTextFieldDelegateAdapter : NSObject\n\n- (instancetype)initWithTextField:(NSTextField<RCTBackedTextInputViewProtocol> *)backedTextInput;\n\n- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(NSRange *)textRange;\n- (void)selectedTextRangeWasSet;\n\n@end\n\n#pragma mark - RCTBackedTextViewDelegateAdapter (for UITextView)\n\n@interface RCTBackedTextViewDelegateAdapter : NSObject\n\n- (instancetype)initWithTextView:(NSTextView<RCTBackedTextInputViewProtocol> *)backedTextInput;\n\n- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(NSRange *)textRange;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTBackedTextInputDelegateAdapter.h\"\n\n#pragma mark - RCTBackedTextFieldDelegateAdapter (for UITextField)\n\nstatic void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingContext;\n\n@interface RCTBackedTextFieldDelegateAdapter () <NSTextFieldDelegate>\n@end\n\n@implementation RCTBackedTextFieldDelegateAdapter {\n  __weak NSTextField<RCTBackedTextInputViewProtocol> *_backedTextInput;\n  BOOL _textDidChangeIsComing;\n  NSRange *_previousSelectedTextRange;\n}\n\n- (instancetype)initWithTextField:(NSTextField<RCTBackedTextInputViewProtocol> *)backedTextInput\n{\n  if (self = [super init]) {\n    _backedTextInput = backedTextInput;\n    backedTextInput.delegate = self;\n\n    [_backedTextInput addTarget:self action:@selector(textFieldDidChange) forControlEvents:UIControlEventEditingChanged];\n    [_backedTextInput addTarget:self action:@selector(textFieldDidEndEditingOnExit) forControlEvents:UIControlEventEditingDidEndOnExit];\n  }\n\n  return self;\n}\n\n- (void)dealloc\n{\n  [_backedTextInput removeTarget:self action:nil forControlEvents:UIControlEventEditingChanged];\n  [_backedTextInput removeTarget:self action:nil forControlEvents:UIControlEventEditingDidEndOnExit];\n}\n\n#pragma mark - UITextFieldDelegate\n\n- (BOOL)textFieldShouldBeginEditing:(__unused NSTextField *)textField\n{\n  return [_backedTextInput.textInputDelegate textInputShouldBeginEditing];\n}\n\n- (void)textFieldDidBeginEditing:(__unused NSTextField *)textField\n{\n  [_backedTextInput.textInputDelegate textInputDidBeginEditing];\n}\n\n- (BOOL)textFieldShouldEndEditing:(__unused NSTextField *)textField\n{\n  return [_backedTextInput.textInputDelegate textInputShouldEndEditing];\n}\n\n- (void)textFieldDidEndEditing:(__unused NSTextField *)textField\n{\n  if (_textDidChangeIsComing) {\n    // iOS does't call `textViewDidChange:` delegate method if the change was happened because of autocorrection\n    // which was triggered by losing focus. So, we call it manually.\n    _textDidChangeIsComing = NO;\n    [_backedTextInput.textInputDelegate textInputDidChange];\n  }\n\n  [_backedTextInput.textInputDelegate textInputDidEndEditing];\n}\n\n- (BOOL)textField:(__unused NSTextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string\n{\n  BOOL result = [_backedTextInput.textInputDelegate textInputShouldChangeTextInRange:range replacementText:string];\n  if (result) {\n    _textDidChangeIsComing = YES;\n  }\n  return result;\n}\n\n- (BOOL)textFieldShouldReturn:(__unused NSTextField *)textField\n{\n  return [_backedTextInput.textInputDelegate textInputShouldReturn];\n}\n\n#pragma mark - UIControlEventEditing* Family Events\n\n- (void)textFieldDidChange\n{\n  _textDidChangeIsComing = NO;\n  [_backedTextInput.textInputDelegate textInputDidChange];\n\n  // `selectedTextRangeWasSet` isn't triggered during typing.\n  [self textFieldProbablyDidChangeSelection];\n}\n\n- (void)textFieldDidEndEditingOnExit\n{\n  [_backedTextInput.textInputDelegate textInputDidReturn];\n}\n\n#pragma mark - UIKeyboardInput (private UIKit protocol)\n\n// This method allows us to detect a [Backspace] `keyPress`\n// even when there is no more text in the `UITextField`.\n- (BOOL)keyboardInputShouldDelete:(__unused NSTextField *)textField\n{\n  [_backedTextInput.textInputDelegate textInputShouldChangeTextInRange:NSMakeRange(0, 0) replacementText:@\"\"];\n  return YES;\n}\n\n#pragma mark - Public Interface\n\n- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(NSRange *)textRange\n{\n  _previousSelectedTextRange = textRange;\n}\n\n- (void)selectedTextRangeWasSet\n{\n  [self textFieldProbablyDidChangeSelection];\n}\n\n#pragma mark - Generalization\n\n- (void)textFieldProbablyDidChangeSelection\n{\n  if ([_backedTextInput.selectedTextRange isEqual:_previousSelectedTextRange]) {\n    return;\n  }\n\n  _previousSelectedTextRange = _backedTextInput.selectedTextRange;\n  [_backedTextInput.textInputDelegate textInputDidChangeSelection];\n}\n\n@end\n\n#pragma mark - RCTBackedTextViewDelegateAdapter (for UITextView)\n\n@interface RCTBackedTextViewDelegateAdapter () <NSTextViewDelegate>\n@end\n\n@implementation RCTBackedTextViewDelegateAdapter {\n  __weak NSTextView<RCTBackedTextInputViewProtocol> *_backedTextInput;\n  BOOL _textDidChangeIsComing;\n  NSRange *_previousSelectedTextRange;\n}\n\n- (instancetype)initWithTextView:(NSTextView<RCTBackedTextInputViewProtocol> *)backedTextInput\n{\n  if (self = [super init]) {\n    _backedTextInput = backedTextInput;\n    backedTextInput.delegate = self;\n  }\n\n  return self;\n}\n\n#pragma mark - UITextViewDelegate\n\n- (BOOL)textViewShouldBeginEditing:(__unused NSTextView *)textView\n{\n  return [_backedTextInput.textInputDelegate textInputShouldBeginEditing];\n}\n\n- (void)textViewDidBeginEditing:(__unused NSTextView *)textView\n{\n  [_backedTextInput.textInputDelegate textInputDidBeginEditing];\n}\n\n- (BOOL)textViewShouldEndEditing:(__unused UITextView *)textView\n{\n  return [_backedTextInput.textInputDelegate textInputShouldEndEditing];\n}\n\n- (void)textViewDidEndEditing:(__unused UITextView *)textView\n{\n  if (_textDidChangeIsComing) {\n    // iOS does't call `textViewDidChange:` delegate method if the change was happened because of autocorrection\n    // which was triggered by losing focus. So, we call it manually.\n    _textDidChangeIsComing = NO;\n    [_backedTextInput.textInputDelegate textInputDidChange];\n  }\n\n  [_backedTextInput.textInputDelegate textInputDidEndEditing];\n}\n\n- (BOOL)textView:(__unused NSTextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text\n{\n  // Custom implementation of `textInputShouldReturn` and `textInputDidReturn` pair for `UITextView`.\n  if (!_backedTextInput.textWasPasted && [text isEqualToString:@\"\\n\"]) {\n    if ([_backedTextInput.textInputDelegate textInputShouldReturn]) {\n      [_backedTextInput.textInputDelegate textInputDidReturn];\n      [_backedTextInput endEditing:NO];\n      return NO;\n    }\n  }\n\n  BOOL result = [_backedTextInput.textInputDelegate textInputShouldChangeTextInRange:range replacementText:text];\n  if (result) {\n    _textDidChangeIsComing = YES;\n  }\n  return result;\n}\n\n- (void)textViewDidChange:(__unused UITextView *)textView\n{\n  _textDidChangeIsComing = NO;\n  [_backedTextInput.textInputDelegate textInputDidChange];\n}\n\n- (void)textViewDidChangeSelection:(__unused UITextView *)textView\n{\n  [self textViewProbablyDidChangeSelection];\n}\n\n#pragma mark - Public Interface\n\n- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(UITextRange *)textRange\n{\n  _previousSelectedTextRange = textRange;\n}\n\n#pragma mark - Generalization\n\n- (void)textViewProbablyDidChangeSelection\n{\n  if ([_backedTextInput.selectedTextRange isEqual:_previousSelectedTextRange]) {\n    return;\n  }\n\n  _previousSelectedTextRange = _backedTextInput.selectedTextRange;\n  [_backedTextInput.textInputDelegate textInputDidChangeSelection];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@protocol RCTBackedTextInputDelegate;\n\n@protocol RCTBackedTextInputViewProtocol <NSTextInput>\n\n@property (nonatomic, copy, nullable) NSString *text;\n@property (nonatomic, strong, nullable) NSColor *textColor;\n@property (nonatomic, copy, nullable) NSString *placeholder;\n@property (nonatomic, strong, nullable) NSColor *placeholderColor;\n@property (nonatomic, assign, readonly) BOOL textWasPasted;\n@property (nonatomic, strong, nullable) NSFont *font;\n@property (nonatomic, assign) NSEdgeInsets textContainerInset;\n@property (nonatomic, strong, nullable) NSView *inputAccessoryView;\n@property (nonatomic, weak, nullable) id<RCTBackedTextInputDelegate> textInputDelegate;\n@property (nonatomic, readonly) CGSize contentSize;\n\n// This protocol disallows direct access to `selectedTextRange` property because\n// unwise usage of it can break the `delegate` behavior. So, we always have to\n// explicitly specify should `delegate` be notified about the change or not.\n// If the change was initiated programmatically, we must NOT notify the delegate.\n// If the change was a result of user actions (like typing or touches), we MUST notify the delegate.\n- (void)setSelectedTextRange:(NSRange)selectedTextRange NS_UNAVAILABLE;\n- (void)setSelectedTextRange:(NSRange)selectedTextRange notifyDelegate:(BOOL)notifyDelegate;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/RCTBaseTextInputView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTView.h>\n\n#import \"RCTBackedTextInputViewProtocol.h\"\n#import \"RCTFontAttributes.h\"\n#import \"RCTFontAttributesDelegate.h\"\n\n@class RCTBridge;\n@class RCTEventDispatcher;\n@class RCTTextSelection;\n\n@interface RCTBaseTextInputView : RCTView <RCTFontAttributesDelegate> {\n@protected\n  __weak RCTBridge *_bridge;\n  RCTEventDispatcher *_eventDispatcher;\n  NSInteger _nativeEventCount;\n  NSInteger _mostRecentEventCount;\n  BOOL _blurOnSubmit;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;\n\n- (instancetype)init NS_UNAVAILABLE;\n- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;\n- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;\n\n@property (nonatomic, readonly) NSView<RCTBackedTextInputViewProtocol> *backedTextInputView;\n\n@property (nonatomic, assign) NSEdgeInsets reactPaddingInsets;\n@property (nonatomic, assign) NSEdgeInsets reactBorderInsets;\n@property (nonatomic, assign, readonly) CGSize contentSize;\n\n@property (nonatomic, copy) RCTDirectEventBlock onContentSizeChange;\n@property (nonatomic, copy) RCTDirectEventBlock onSelectionChange;\n\n@property (nonatomic, readonly, strong) RCTFontAttributes *fontAttributes;\n\n@property (nonatomic, assign) NSInteger mostRecentEventCount;\n@property (nonatomic, assign) BOOL blurOnSubmit;\n@property (nonatomic, assign) BOOL selectTextOnFocus;\n@property (nonatomic, assign) BOOL clearTextOnFocus;\n@property (nonatomic, copy) RCTTextSelection *selection;\n\n- (void)setFont:(NSFont *)font;\n\n- (void)invalidateContentSize;\n\n// Temporary exposure of particial `RCTBackedTextInputDelegate` support.\n// In the future all methods of the protocol should move to this class.\n- (BOOL)textInputShouldBeginEditing;\n- (void)textInputDidBeginEditing;\n- (BOOL)textInputShouldReturn;\n- (void)textInputDidReturn;\n- (void)textInputDidChangeSelection;\n- (BOOL)textInputShouldEndEditing;\n- (void)textInputDidEndEditing;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/RCTBaseTextInputView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTBaseTextInputView.h\"\n\n#import <React/RCTAccessibilityManager.h>\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTUtils.h>\n#import <React/NSView+React.h>\n\n#import \"RCTTextSelection.h\"\n\n@implementation RCTBaseTextInputView {\n  CGSize _previousContentSize;\n  BOOL _hasInputAccesoryView;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  RCTAssertParam(bridge);\n\n  if (self = [super initWithFrame:CGRectZero]) {\n    _bridge = bridge;\n    _eventDispatcher = bridge.eventDispatcher;\n    _fontAttributes = [[RCTFontAttributes alloc] initWithAccessibilityManager:bridge.accessibilityManager];\n    _fontAttributes.delegate = self;\n  }\n\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)decoder)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\n\n- (id<RCTBackedTextInputViewProtocol>)backedTextInputView\n{\n  RCTAssert(NO, @\"-[RCTBaseTextInputView backedTextInputView] must be implemented in subclass.\");\n  return nil;\n}\n\n- (void)setFont:(NSFont *)font\n{\n  self.backedTextInputView.font = font;\n  [self invalidateContentSize];\n}\n\n- (void)fontAttributesDidChangeWithFont:(NSFont *)font\n{\n  self.font = font;\n}\n\n#pragma mark - Properties\n\n- (void)setReactPaddingInsets:(NSEdgeInsets)reactPaddingInsets\n{\n  _reactPaddingInsets = reactPaddingInsets;\n  // We apply `paddingInsets` as `backedTextInputView`'s `textContainerInset`.\n  self.backedTextInputView.textContainerInset = reactPaddingInsets;\n  [self setNeedsLayout];\n}\n\n- (void)setReactBorderInsets:(NSEdgeInsets)reactBorderInsets\n{\n  _reactBorderInsets = reactBorderInsets;\n  // We apply `borderInsets` as `backedTextInputView` layout offset.\n  self.backedTextInputView.frame = NSEdgeInsetsInsetRect(self.bounds, reactBorderInsets);\n  [self setNeedsLayout];\n}\n\n- (RCTTextSelection *)selection\n{\n  id<RCTBackedTextInputViewProtocol> backedTextInput = self.backedTextInputView;\n  NSTextRange *selectedTextRange = backedTextInput.selectedTextRange;\n  return [[RCTTextSelection new] initWithStart:[backedTextInput offsetFromPosition:backedTextInput.beginningOfDocument toPosition:selectedTextRange.start]\n                                           end:[backedTextInput offsetFromPosition:backedTextInput.beginningOfDocument toPosition:selectedTextRange.end]];\n}\n\n- (void)setSelection:(RCTTextSelection *)selection\n{\n  if (!selection) {\n    return;\n  }\n\n  id<RCTBackedTextInputViewProtocol> backedTextInput = self.backedTextInputView;\n\n  NSRange previousSelectedTextRange = backedTextInput.;\n  NSTextPosition *start = [backedTextInput positionFromPosition:backedTextInput.beginningOfDocument offset:selection.start];\n  NSTextPosition *end = [backedTextInput positionFromPosition:backedTextInput.beginningOfDocument offset:selection.end];\n  NSRange selectedTextRange = [backedTextInput textRangeFromPosition:start toPosition:end];\n\n  NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n  if (eventLag == 0 && ![previousSelectedTextRange isEqual:selectedTextRange]) {\n    [backedTextInput setSelectedTextRange:selectedTextRange notifyDelegate:NO];\n  } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n    RCTLogWarn(@\"Native TextInput(%@) is %lld events ahead of JS - try to make your JS faster.\", backedTextInput.text, (long long)eventLag);\n  }\n}\n\n#pragma mark - RCTBackedTextInputDelegate\n\n- (BOOL)textInputShouldBeginEditing\n{\n  return YES;\n}\n\n- (void)textInputDidBeginEditing\n{\n  if (_clearTextOnFocus) {\n    self.backedTextInputView.text = @\"\";\n  }\n\n  if (_selectTextOnFocus) {\n    [self.backedTextInputView selectAll:nil];\n  }\n\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus\n                                 reactTag:self.reactTag\n                                     text:self.backedTextInputView.text\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n- (BOOL)textInputShouldReturn\n{\n  // We send `submit` event here, in `textInputShouldReturn`\n  // (not in `textInputDidReturn)`, because of semantic of the event:\n  // `onSubmitEditing` is called when \"Submit\" button\n  // (the blue key on onscreen keyboard) did pressed\n  // (no connection to any specific \"submitting\" process).\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeSubmit\n                                 reactTag:self.reactTag\n                                     text:self.backedTextInputView.text\n                                      key:nil\n                               eventCount:_nativeEventCount];\n\n  return _blurOnSubmit;\n}\n\n- (void)textInputDidReturn\n{\n  // Does nothing.\n}\n\n- (void)textInputDidChangeSelection\n{\n  if (!_onSelectionChange) {\n    return;\n  }\n\n  RCTTextSelection *selection = self.selection;\n  _onSelectionChange(@{\n    @\"selection\": @{\n      @\"start\": @(selection.start),\n      @\"end\": @(selection.end),\n    },\n  });\n}\n\n- (BOOL)textInputShouldEndEditing\n{\n  return YES;\n}\n\n- (void)textInputDidEndEditing\n{\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd\n                                 reactTag:self.reactTag\n                                     text:self.backedTextInputView.text\n                                      key:nil\n                               eventCount:_nativeEventCount];\n\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur\n                                 reactTag:self.reactTag\n                                     text:self.backedTextInputView.text\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n#pragma mark - Content Size (in Yoga terms, without any insets)\n\n- (CGSize)contentSize\n{\n  CGSize contentSize = self.backedTextInputView.contentSize;\n  UIEdgeInsets reactPaddingInsets = self.reactPaddingInsets;\n  contentSize.width -= reactPaddingInsets.left + reactPaddingInsets.right;\n  contentSize.height -= reactPaddingInsets.top + reactPaddingInsets.bottom;\n  // Returning value does NOT include border and padding insets.\n  return contentSize;\n}\n\n- (void)invalidateContentSize\n{\n  // Updates `contentSize` property and notifies Yoga about the change, if necessary.\n  CGSize contentSize = self.contentSize;\n\n  if (CGSizeEqualToSize(_previousContentSize, contentSize)) {\n    return;\n  }\n  _previousContentSize = contentSize;\n\n  [_bridge.uiManager setIntrinsicContentSize:contentSize forView:self];\n\n  if (_onContentSizeChange) {\n    _onContentSizeChange(@{\n      @\"contentSize\": @{\n        @\"height\": @(contentSize.height),\n        @\"width\": @(contentSize.width),\n      },\n      @\"target\": self.reactTag,\n    });\n  }\n}\n\n#pragma mark - Layout (in UIKit terms, with all insets)\n\n- (CGSize)intrinsicContentSize\n{\n  CGSize size = self.backedTextInputView.intrinsicContentSize;\n  size.width += _reactBorderInsets.left + _reactBorderInsets.right;\n  size.height += _reactBorderInsets.top + _reactBorderInsets.bottom;\n  // Returning value DOES include border and padding insets.\n  return size;\n}\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  CGFloat compoundHorizontalBorderInset = _reactBorderInsets.left + _reactBorderInsets.right;\n  CGFloat compoundVerticalBorderInset = _reactBorderInsets.top + _reactBorderInsets.bottom;\n\n  size.width -= compoundHorizontalBorderInset;\n  size.height -= compoundVerticalBorderInset;\n\n  // Note: `paddingInsets` was already included in `backedTextInputView` size\n  // because it was applied as `textContainerInset`.\n  CGSize fittingSize = [self.backedTextInputView sizeThatFits:size];\n\n  fittingSize.width += compoundHorizontalBorderInset;\n  fittingSize.height += compoundVerticalBorderInset;\n\n  // Returning value DOES include border and padding insets.\n  return fittingSize;\n}\n\n- (void)layoutSubviews\n{\n  [super layoutSubviews];\n  [self invalidateContentSize];\n}\n\n#pragma mark - Accessibility\n\n- (UIView *)reactAccessibilityElement\n{\n  return self.backedTextInputView;\n}\n\n#pragma mark - Focus Control\n\n- (void)reactFocus\n{\n  [self.backedTextInputView reactFocus];\n}\n\n- (void)reactBlur\n{\n  [self.backedTextInputView reactBlur];\n}\n\n- (void)didMoveToWindow\n{\n  [self.backedTextInputView reactFocusIfNeeded];\n}\n\n#pragma mark - Custom Input Accessory View\n\n- (void)didSetProps:(NSArray<NSString *> *)changedProps\n{\n  [self invalidateInputAccessoryView];\n}\n\n- (void)invalidateInputAccessoryView\n{\n#if !TARGET_OS_TV\n  UIView<RCTBackedTextInputViewProtocol> *textInputView = self.backedTextInputView;\n  UIKeyboardType keyboardType = textInputView.keyboardType;\n\n  // These keyboard types (all are number pads) don't have a \"Done\" button by default,\n  // so we create an `inputAccessoryView` with this button for them.\n  BOOL shouldHaveInputAccesoryView =\n    (\n      keyboardType == UIKeyboardTypeNumberPad ||\n      keyboardType == UIKeyboardTypePhonePad ||\n      keyboardType == UIKeyboardTypeDecimalPad ||\n      keyboardType == UIKeyboardTypeASCIICapableNumberPad\n    ) &&\n    textInputView.returnKeyType == UIReturnKeyDone;\n\n  if (_hasInputAccesoryView == shouldHaveInputAccesoryView) {\n    return;\n  }\n\n  _hasInputAccesoryView = shouldHaveInputAccesoryView;\n\n  if (shouldHaveInputAccesoryView) {\n    UIToolbar *toolbarView = [[UIToolbar alloc] init];\n    [toolbarView sizeToFit];\n    UIBarButtonItem *flexibleSpace =\n      [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace\n                                                    target:nil\n                                                    action:nil];\n    UIBarButtonItem *doneButton =\n      [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone\n                                                    target:self\n                                                    action:@selector(handleInputAccessoryDoneButton)];\n    toolbarView.items = @[flexibleSpace, doneButton];\n    textInputView.inputAccessoryView = toolbarView;\n  }\n  else {\n    textInputView.inputAccessoryView = nil;\n  }\n\n  // We have to call `reloadInputViews` for focused text inputs to update an accessory view.\n  if (textInputView.isFirstResponder) {\n    [textInputView reloadInputViews];\n  }\n#endif\n}\n\n- (void)handleInputAccessoryDoneButton\n{\n  if ([self textInputShouldReturn]) {\n    [self.backedTextInputView endEditing:YES];\n  }\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/RCTBaseTextInputViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTBaseTextInputViewManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/RCTBaseTextInputViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTBaseTextInputViewManager.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTFont.h>\n#import <React/RCTShadowView+Layout.h>\n#import <React/RCTShadowView.h>\n\n#import \"RCTConvert+Text.h\"\n#import \"RCTBaseTextInputView.h\"\n\n@implementation RCTBaseTextInputViewManager\n\nRCT_EXPORT_MODULE()\n\n#pragma mark - Unified <TextInput> properties\n\nRCT_REMAP_VIEW_PROPERTY(allowFontScaling, fontAttributes.allowFontScaling, BOOL)\nRCT_REMAP_VIEW_PROPERTY(autoCapitalize, backedTextInputView.autocapitalizationType, UITextAutocapitalizationType)\nRCT_REMAP_VIEW_PROPERTY(autoCorrect, backedTextInputView.autocorrectionType, UITextAutocorrectionType)\nRCT_REMAP_VIEW_PROPERTY(color, backedTextInputView.textColor, UIColor)\nRCT_REMAP_VIEW_PROPERTY(editable, backedTextInputView.editable, BOOL)\nRCT_REMAP_VIEW_PROPERTY(enablesReturnKeyAutomatically, backedTextInputView.enablesReturnKeyAutomatically, BOOL)\nRCT_REMAP_VIEW_PROPERTY(fontSize, fontAttributes.fontSize, NSNumber)\nRCT_REMAP_VIEW_PROPERTY(fontWeight, fontAttributes.fontWeight, NSString)\nRCT_REMAP_VIEW_PROPERTY(fontStyle, fontAttributes.fontStyle, NSString)\nRCT_REMAP_VIEW_PROPERTY(fontFamily, fontAttributes.fontFamily, NSString)\nRCT_REMAP_VIEW_PROPERTY(keyboardAppearance, backedTextInputView.keyboardAppearance, UIKeyboardAppearance)\nRCT_REMAP_VIEW_PROPERTY(keyboardType, backedTextInputView.keyboardType, UIKeyboardType)\nRCT_REMAP_VIEW_PROPERTY(placeholder, backedTextInputView.placeholder, NSString)\nRCT_REMAP_VIEW_PROPERTY(placeholderTextColor, backedTextInputView.placeholderColor, UIColor)\nRCT_REMAP_VIEW_PROPERTY(returnKeyType, backedTextInputView.returnKeyType, UIReturnKeyType)\nRCT_REMAP_VIEW_PROPERTY(secureTextEntry, backedTextInputView.secureTextEntry, BOOL)\nRCT_REMAP_VIEW_PROPERTY(selectionColor, backedTextInputView.tintColor, UIColor)\nRCT_REMAP_VIEW_PROPERTY(spellCheck, backedTextInputView.spellCheckingType, UITextSpellCheckingType)\nRCT_REMAP_VIEW_PROPERTY(textAlign, backedTextInputView.textAlignment, NSTextAlignment)\nRCT_EXPORT_VIEW_PROPERTY(blurOnSubmit, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(clearTextOnFocus, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(maxLength, NSNumber)\nRCT_EXPORT_VIEW_PROPERTY(selectTextOnFocus, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(selection, RCTTextSelection)\nRCT_EXPORT_VIEW_PROPERTY(text, NSString)\n\nRCT_EXPORT_VIEW_PROPERTY(mostRecentEventCount, NSInteger)\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView\n{\n  NSNumber *reactTag = shadowView.reactTag;\n  NSEdgeInsets borderAsInsets = shadowView.borderAsInsets;\n  NSEdgeInsets paddingAsInsets = shadowView.paddingAsInsets;\n  return ^(RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTBaseTextInputView *> *viewRegistry) {\n    RCTBaseTextInputView *view = viewRegistry[reactTag];\n    view.reactBorderInsets = borderAsInsets;\n    view.reactPaddingInsets = paddingAsInsets;\n  };\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/RCTTextSelection.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTConvert.h>\n\n/**\n * Object containing information about a TextInput's selection.\n */\n@interface RCTTextSelection : NSObject\n\n@property (nonatomic, assign, readonly) NSInteger start;\n@property (nonatomic, assign, readonly) NSInteger end;\n\n- (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end;\n\n@end\n\n@interface RCTConvert (RCTTextSelection)\n\n+ (RCTTextSelection *)RCTTextSelection:(id)json;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/RCTTextSelection.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextSelection.h\"\n\n@implementation RCTTextSelection\n\n- (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end\n{\n  if (self = [super init]) {\n    _start = start;\n    _end = end;\n  }\n  return self;\n}\n\n@end\n\n@implementation RCTConvert (RCTTextSelection)\n\n+ (RCTTextSelection *)RCTTextSelection:(id)json\n{\n  if ([json isKindOfClass:[NSDictionary class]]) {\n    NSInteger start = [self NSInteger:json[@\"start\"]];\n    NSInteger end = [self NSInteger:json[@\"end\"]];\n    return [[RCTTextSelection alloc] initWithStart:start end:end];\n  }\n\n  return nil;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputShadowView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTShadowView.h>\n\n@interface RCTSinglelineTextInputShadowView : RCTShadowView\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputShadowView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSinglelineTextInputShadowView.h\"\n\n@implementation RCTSinglelineTextInputShadowView\n\n- (BOOL)isYogaLeafNode\n{\n  return YES;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTComponent.h>\n#import <React/RCTView.h>\n\n#import \"RCTBaseTextInputView.h\"\n\n@class RCTUITextField;\n\n@interface RCTSinglelineTextInputView : RCTBaseTextInputView\n\n@property (nonatomic, assign) BOOL caretHidden;\n@property (nonatomic, strong) NSNumber *maxLength;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSinglelineTextInputView.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTFont.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTUtils.h>\n#import <React/NSView+React.h>\n\n#import \"RCTBackedTextInputDelegate.h\"\n#import \"RCTTextSelection.h\"\n#import \"RCTUITextField.h\"\n\n@interface RCTSinglelineTextInputView () <RCTBackedTextInputDelegate>\n\n@end\n\n@implementation RCTSinglelineTextInputView\n{\n  RCTUITextField *_backedTextInput;\n  BOOL _submitted;\n  CGSize _previousContentSize;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  if (self = [super initWithBridge:bridge]) {\n    // `blurOnSubmit` defaults to `true` for <TextInput multiline={false}> by design.\n    _blurOnSubmit = YES;\n\n    _backedTextInput = [[RCTUITextField alloc] initWithFrame:self.bounds];\n    _backedTextInput.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;\n    _backedTextInput.textInputDelegate = self;\n    _backedTextInput.font = self.fontAttributes.font;\n\n    [self addSubview:_backedTextInput];\n  }\n\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (id<RCTBackedTextInputViewProtocol>)backedTextInputView\n{\n  return _backedTextInput;\n}\n\n- (void)sendKeyValueForString:(NSString *)string\n{\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeKeyPress\n                                 reactTag:self.reactTag\n                                     text:nil\n                                      key:string\n                               eventCount:_nativeEventCount];\n}\n\n#pragma mark - Properties\n\n- (NSString *)text\n{\n  return _backedTextInput.text;\n}\n\n- (void)setText:(NSString *)text\n{\n  NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n  if (eventLag == 0 && ![text isEqualToString:self.text]) {\n    UITextRange *selection = _backedTextInput.selectedTextRange;\n    NSInteger oldTextLength = _backedTextInput.text.length;\n\n    _backedTextInput.text = text;\n\n    if (selection.empty) {\n      // maintain cursor position relative to the end of the old text\n      NSInteger offsetStart = [_backedTextInput offsetFromPosition:_backedTextInput.beginningOfDocument toPosition:selection.start];\n      NSInteger offsetFromEnd = oldTextLength - offsetStart;\n      NSInteger newOffset = text.length - offsetFromEnd;\n      UITextPosition *position = [_backedTextInput positionFromPosition:_backedTextInput.beginningOfDocument offset:newOffset];\n      [_backedTextInput setSelectedTextRange:[_backedTextInput textRangeFromPosition:position toPosition:position]\n                              notifyDelegate:YES];\n    }\n  } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n    RCTLogWarn(@\"Native TextInput(%@) is %lld events ahead of JS - try to make your JS faster.\", _backedTextInput.text, (long long)eventLag);\n  }\n}\n\n#pragma mark - RCTBackedTextInputDelegate\n\n- (BOOL)textInputShouldChangeTextInRange:(NSRange)range replacementText:(NSString *)string\n{\n  // Only allow single keypresses for `onKeyPress`, pasted text will not be sent.\n  if (!_backedTextInput.textWasPasted) {\n    [self sendKeyValueForString:string];\n  }\n\n  if (_maxLength != nil && ![string isEqualToString:@\"\\n\"]) { // Make sure forms can be submitted via return.\n    NSUInteger allowedLength = _maxLength.integerValue - MIN(_maxLength.integerValue, _backedTextInput.text.length) + range.length;\n    if (string.length > allowedLength) {\n      if (string.length > 1) {\n        // Truncate the input string so the result is exactly `maxLength`.\n        NSString *limitedString = [string substringToIndex:allowedLength];\n        NSMutableString *newString = _backedTextInput.text.mutableCopy;\n        [newString replaceCharactersInRange:range withString:limitedString];\n        _backedTextInput.text = newString;\n\n        // Collapse selection at end of insert to match normal paste behavior.\n        UITextPosition *insertEnd = [_backedTextInput positionFromPosition:_backedTextInput.beginningOfDocument\n                                                              offset:(range.location + allowedLength)];\n        [_backedTextInput setSelectedTextRange:[_backedTextInput textRangeFromPosition:insertEnd toPosition:insertEnd]\n                                notifyDelegate:YES];\n        [self textInputDidChange];\n      }\n      return NO;\n    }\n  }\n\n  return YES;\n}\n\n- (void)textInputDidChange\n{\n  _nativeEventCount++;\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeChange\n                                 reactTag:self.reactTag\n                                     text:_backedTextInput.text\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTBaseTextInputViewManager.h\"\n\n@interface RCTSinglelineTextInputViewManager : RCTBaseTextInputViewManager\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSinglelineTextInputViewManager.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTFont.h>\n#import <React/RCTShadowView+Layout.h>\n#import <React/RCTShadowView.h>\n\n#import \"RCTConvert+Text.h\"\n#import \"RCTSinglelineTextInputShadowView.h\"\n#import \"RCTSinglelineTextInputView.h\"\n#import \"RCTUITextField.h\"\n\n@implementation RCTSinglelineTextInputViewManager\n\nRCT_EXPORT_MODULE()\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTSinglelineTextInputShadowView new];\n}\n\n- (NSView *)view\n{\n  return [[RCTSinglelineTextInputView alloc] initWithBridge:self.bridge];\n}\n\n#pragma mark - Singleline <TextInput> (aka TextField) specific properties\n\nRCT_REMAP_VIEW_PROPERTY(caretHidden, backedTextInputView.caretHidden, BOOL)\nRCT_REMAP_VIEW_PROPERTY(clearButtonMode, backedTextInputView.clearButtonMode, UITextFieldViewMode)\nRCT_EXPORT_VIEW_PROPERTY(onSelectionChange, RCTDirectEventBlock)\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInput/Singleline/RCTUITextField.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTBackedTextInputViewProtocol.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n/*\n * Just regular UITextField... but much better!\n */\n@interface RCTUITextField : NSTextField <RCTBackedTextInputViewProtocol>\n\n- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;\n\n@property (nonatomic, weak) id<RCTBackedTextInputDelegate> textInputDelegate;\n\n@property (nonatomic, assign) BOOL caretHidden;\n@property (nonatomic, assign, readonly) BOOL textWasPasted;\n@property (nonatomic, copy, nullable) NSString *placeholder;\n@property (nonatomic, strong, nullable) NSColor *placeholderColor;\n@property (nonatomic, assign) NSEdgeInsets textContainerInset;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Text/TextInput/Singleline/RCTUITextField.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTUITextField.h\"\n\n#import <React/RCTUtils.h>\n#import <React/NSView+React.h>\n\n#import \"RCTBackedTextInputDelegateAdapter.h\"\n\n@implementation RCTUITextField {\n  RCTBackedTextFieldDelegateAdapter *_textInputDelegateAdapter;\n}\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if (self = [super initWithFrame:frame]) {\n\n    _textInputDelegateAdapter = [[RCTBackedTextFieldDelegateAdapter alloc] initWithTextField:self];\n  }\n\n  return self;\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (void)_textDidChange\n{\n  _textWasPasted = NO;\n}\n\n#pragma mark - Properties\n\n- (void)setTextContainerInset:(NSEdgeInsets)textContainerInset\n{\n  _textContainerInset = textContainerInset;\n  [self setNeedsLayout:YES];\n}\n\n- (void)setPlaceholder:(NSString *)placeholder\n{\n  if (placeholder != nil && ![_placeholder isEqual:placeholder]) {\n    _placeholder = placeholder;\n    [self updatePlaceholder];\n  }\n}\n\n- (void)setPlaceholderColor:(NSColor *)placeholderColor\n{\n  _placeholderColor = placeholderColor;\n  [self _updatePlaceholder];\n}\n\n- (void)_updatePlaceholder\n{\n  if (self.placeholder == nil) {\n    return;\n  }\n\n  NSMutableDictionary *attributes = [NSMutableDictionary new];\n  if (_placeholderColor) {\n    [attributes setObject:_placeholderColor forKey:NSForegroundColorAttributeName];\n  }\n  \n  \n\n  self.placeholderAttributedString = [[NSAttributedString alloc] initWithString:self.placeholder\n                                                               attributes:attributes];\n}\n\n- (BOOL)isEditable\n{\n  return self.isEnabled;\n}\n\n- (void)setEditable:(BOOL)editable\n{\n  self.enabled = editable;\n}\n\n#pragma mark - Caret Manipulation\n\n//- (CGRect)caretRectForPosition:(UITextPosition *)position\n//{\n//  if (_caretHidden) {\n//    return CGRectZero;\n//  }\n//\n//  return [super caretRectForPosition:position];\n//}\n\n#pragma mark - Positioning Overrides\n\nstatic inline CGRect NSEdgeInsetsInsetRect(CGRect rect, NSEdgeInsets insets) {\n  rect.origin.x    += insets.left;\n  rect.origin.y    += insets.top;\n  rect.size.width  -= (insets.left + insets.right);\n  rect.size.height -= (insets.top  + insets.bottom);\n  return rect;\n}\n\n//- (CGRect)textRectForBounds:(CGRect)bounds\n//{\n//  return NSEdgeInsetsInsetRect([super textRectForBounds:bounds], _textContainerInset);\n//}\n\n//- (CGRect)editingRectForBounds:(CGRect)bounds\n//{\n//  return [self textRectForBounds:bounds];\n//}\n\n#pragma mark - Overrides\n\n- (void)setSelectedTextRange:(NSRange)selectedTextRange\n{\n  [[super currentEditor] setSelectedRange:selectedTextRange];\n  [_textInputDelegateAdapter selectedTextRangeWasSet];\n}\n\n- (void)setSelectedTextRange:(NSRange)selectedTextRange notifyDelegate:(BOOL)notifyDelegate\n{\n  if (!notifyDelegate) {\n    // We have to notify an adapter that following selection change was initiated programmatically,\n    // so the adapter must not generate a notification for it.\n    [_textInputDelegateAdapter skipNextTextInputDidChangeSelectionEventWithTextRange:selectedTextRange];\n  }\n\n  [[super currentEditor] setSelectedRange:selectedTextRange];\n}\n\n- (void)paste:(id)sender\n{\n  [[super currentEditor] paste:sender];\n  _textWasPasted = YES;\n}\n\n#pragma mark - Layout\n\n- (CGSize)contentSize\n{\n  // Returning size DOES contain `textContainerInset` (aka `padding`).\n  return self.intrinsicContentSize;\n}\n\n- (CGSize)intrinsicContentSize\n{\n  // Note: `placeholder` defines intrinsic size for `<TextInput>`.\n  NSString *text = self.placeholder ?: @\"\";\n  CGSize size = [text sizeWithAttributes:@{NSFontAttributeName: self.font}];\n  size = CGSizeMake(RCTCeilPixelValue(size.width), RCTCeilPixelValue(size.height));\n  size.width += _textContainerInset.left + _textContainerInset.right;\n  size.height += _textContainerInset.top + _textContainerInset.bottom;\n  // Returning size DOES contain `textContainerInset` (aka `padding`).\n  return size;\n}\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  // All size values here contain `textContainerInset` (aka `padding`).\n  CGSize intrinsicSize = self.intrinsicContentSize;\n  return CGSizeMake(MIN(size.width, intrinsicSize.width), MIN(size.height, intrinsicSize.height));\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTMultilineTextInputView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTView.h>\n#import <React/NSView+React.h>\n\n@class RCTBridge;\n\n@interface RCTMultilineTextInputView : RCTView <NSTextViewDelegate, NSTextDelegate>\n\n@property (nonatomic, assign) BOOL blurOnSubmit;\n@property (nonatomic, assign) BOOL clearTextOnFocus;\n@property (nonatomic, assign) BOOL selectTextOnFocus;\n@property (nonatomic, assign) NSEdgeInsets contentInset;\n@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;\n@property (nonatomic, copy) NSString *text;\n@property (nonatomic, strong) NSColor *placeholderTextColor;\n@property (nonatomic, copy) NSString *placeholder;\n@property (nonatomic, strong) NSFont *font;\n@property (nonatomic, assign) NSInteger mostRecentEventCount;\n@property (nonatomic, strong) NSNumber *maxLength;\n@property (nonatomic, assign, readonly) CGSize contentSize;\n\n@property (nonatomic, copy) RCTDirectEventBlock onChange;\n@property (nonatomic, copy) RCTDirectEventBlock onContentSizeChange;\n@property (nonatomic, copy) RCTDirectEventBlock onSelectionChange;\n@property (nonatomic, copy) RCTDirectEventBlock onTextInput;\n@property (nonatomic, copy) RCTDirectEventBlock onScroll;\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;\n\n- (void)performTextUpdate;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTMultilineTextInputView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTMultilineTextInputView.h\"\n\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTUtils.h>\n#import <React/NSView+React.h>\n\n#import \"RCTTextSelection.h\"\n#import \"RCTUITextView.h\"\n#import \"RCTTextView.h\"\n#import \"RCTTextShadowView.h\"\n\n@implementation RCTMultilineTextInputView\n{\n  RCTBridge *_bridge;\n  RCTEventDispatcher *_eventDispatcher;\n\n  RCTUITextView *_textView;\n  RCTTextView *_richTextView;\n  NSAttributedString *_pendingAttributedText;\n  \n  NSUInteger _previousTextLength;\n  CGFloat _previousContentHeight;\n  NSString *_predictedText;\n  BOOL _blockTextShouldChange;\n  BOOL _nativeUpdatesInFlight;\n  NSInteger _nativeEventCount;\n  CGFloat _padding;\n  \n  NSArray <NSValue *> * _previousSelectionRanges;\n  NSScrollView *_scrollView;\n\n  BOOL _jsRequestingFirstResponder;\n\n  CGSize _previousContentSize;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  RCTAssertParam(bridge);\n\n  if (self = [super initWithFrame:CGRectZero]) {\n    _contentInset = NSEdgeInsetsZero;\n    _bridge = bridge;\n    _eventDispatcher = bridge.eventDispatcher;\n    _blurOnSubmit = NO;\n   \n    _textView = [[RCTUITextView alloc] initWithFrame:self.bounds];\n    _textView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;\n    _textView.backgroundColor = [NSColor redColor];\n    _textView.textColor = [NSColor blackColor];\n    // This line actually removes 5pt (default value) left and right padding in UITextView.\n    _textView.textContainer.lineFragmentPadding = 0;\n    \n    _textView.delegate = self;\n    _textView.drawsBackground = NO;\n\n    _textView.focusRingType = NSFocusRingTypeDefault;\n\n    [self addSubview:_textView];\n   \n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n#pragma mark - RCTComponent\n\n- (void)insertReactSubview:(NSView *)subview atIndex:(NSInteger)index\n{\n  [super insertReactSubview:subview atIndex:index];\n\n  if ([subview isKindOfClass:[RCTTextView class]]) {\n    if (_richTextView) {\n      RCTLogError(@\"Tried to insert a second <Text> into <TextInput> - there can only be one.\");\n    }\n    _richTextView = (RCTTextView *)subview;\n\n    // If this <TextInput> is in rich text editing mode, and the child <Text> node providing rich text\n    // styling has a backgroundColor, then the attributedText produced by the child <Text> node will have an\n    // NSBackgroundColor attribute. We need to forward this attribute to the text view manually because the text view\n    // always has a clear background color in `initWithBridge:`.\n    //\n    // TODO: This should be removed when the related hack in -performPendingTextUpdate is removed.\n    if (subview.layer.backgroundColor) {\n      NSMutableDictionary<NSString *, id> *attrs = [_textView.typingAttributes mutableCopy];\n      attrs[NSBackgroundColorAttributeName] = (__bridge id _Nullable)(subview.layer.backgroundColor);\n      _textView.typingAttributes = attrs;\n    }\n\n    [self performTextUpdate];\n  }\n}\n\n- (void)removeReactSubview:(NSView *)subview\n{\n  [super removeReactSubview:subview];\n  if (_richTextView == subview) {\n    _richTextView = nil;\n    [self performTextUpdate];\n  }\n}\n\n- (void)didUpdateReactSubviews\n{\n  // Do nothing, as we don't allow non-text subviews.\n}\n\n#pragma mark - Routine\n\n- (void)setMostRecentEventCount:(NSInteger)mostRecentEventCount\n{\n  _mostRecentEventCount = mostRecentEventCount;\n\n  // Props are set after uiBlockToAmendWithShadowViewRegistry, which means that\n  // at the time performTextUpdate is called, _mostRecentEventCount will be\n  // behind _eventCount, with the result that performPendingTextUpdate will do\n  // nothing. For that reason we call it again here after mostRecentEventCount\n  // has been set.\n  [self performPendingTextUpdate];\n}\n\nstatic NSAttributedString *removeReactTagFromString(NSAttributedString *string)\n{\n  if (string.length == 0) {\n    return string;\n  } else {\n    NSMutableAttributedString *mutableString = [[NSMutableAttributedString alloc] initWithAttributedString:string];\n    [mutableString removeAttribute:RCTReactTagAttributeName range:NSMakeRange(0, mutableString.length)];\n    return mutableString;\n  }\n}\n\n- (void)performTextUpdate\n{\n  if (_richTextView) {\n    _pendingAttributedText = _richTextView.textStorage;\n    [self performPendingTextUpdate];\n  } else if (!self.text) {\n    _textView.text = @\"\";\n  }\n}\n\n- (void)performPendingTextUpdate\n{\n  if (!_pendingAttributedText || _mostRecentEventCount < _nativeEventCount || _nativeUpdatesInFlight) {\n    return;\n  }\n  \n  // The underlying <Text> node that produces _pendingAttributedText has a react tag attribute on it that causes the\n  // -isEqualToAttributedString: comparison below to spuriously fail. We don't want that comparison to fail unless it\n  // needs to because when the comparison fails, we end up setting attributedText on the text view, which clears\n  // autocomplete state for CKJ text input.\n  //\n  // TODO: Kill this after we finish passing all style/attribute info into JS.\n  _pendingAttributedText = removeReactTagFromString(_pendingAttributedText);\n  \n  if ([_textView.attributedString isEqualToAttributedString:_pendingAttributedText]) {\n    _pendingAttributedText = nil; // Don't try again.\n    return;\n  }\n  \n  // When we update the attributed text, there might be pending autocorrections\n  // that will get accepted by default. In order for this to not garble our text,\n  // we temporarily block all textShouldChange events so they are not applied.\n  _blockTextShouldChange = YES;\n  \n//  UITextRange *selection = _textView.selectedTextRange;\n //  NSInteger oldTextLength = _textView.attributedString.length;\n  \n  [_textView setAttributedText:_pendingAttributedText];\n  _predictedText = _pendingAttributedText.string;\n  _pendingAttributedText = nil;\n  \n//  if (selection.empty) {\n//    // maintain cursor position relative to the end of the old text\n//    NSInteger start = [_textView offsetFromPosition:_textView.beginningOfDocument toPosition:selection.start];\n//    NSInteger offsetFromEnd = oldTextLength - start;\n//    NSInteger newOffset = _textView.attributedText.length - offsetFromEnd;\n//    UITextPosition *position = [_textView positionFromPosition:_textView.beginningOfDocument offset:newOffset];\n//    _textView.selectedTextRange = [_textView textRangeFromPosition:position toPosition:position];\n//  }\n  \n  [_textView layoutSubtreeIfNeeded];\n  \n  [self invalidateContentSize];\n  \n  _blockTextShouldChange = NO;\n}\n\n- (void)updateFrames\n{\n  // Adjust the insets so that they are as close as possible to single-line\n  // RCTTextField defaults, using the system defaults of font size 17 and a\n  // height of 31 points.\n  //\n  // We apply the left inset to the frame since a negative left text-container\n  // inset mysteriously causes the text to be hidden until the text view is\n  // first focused.\n  CGRect frame = self.frame;\n  frame.origin.y += (_contentInset.top + 2);\n  frame.size.width -= (_contentInset.left + _contentInset.right - 5);\n  _textView.frame = frame;\n\n  NSSize adjustedTextContainerInset = CGSizeMake(_padding, _padding);\n  _textView.textContainerInset = adjustedTextContainerInset;\n}\n\n- (void)setFont:(NSFont *)font\n{\n  _font = font;\n  [_textView setFont:font];\n}\n\n- (NSColor *)textColor\n{\n  return _textView.textColor;\n}\n\n- (void)setTextColor:(NSColor *)textColor\n{\n  _textView.textColor = textColor;\n}\n\n\n- (void)setPadding:(CGFloat)padding\n{\n  _padding = padding;\n  [self updateFrames];\n}\n\n- (void)setContentInset:(NSEdgeInsets)contentInset\n{\n  _contentInset = contentInset;\n  [self updateFrames];\n}\n\n- (void)setBackgroundColor:(NSColor *)backgroundColor\n{\n  if (backgroundColor) {\n    [_textView setDrawsBackground:YES];\n    [_textView setBackgroundColor:backgroundColor];\n  }\n}\n\n- (NSString *)text\n{\n  return [_textView string];\n}\n\n- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)range replacementString:(NSString *)text\n{\n  if (_blockTextShouldChange) {\n    return NO;\n  }\n\n  if (_textView.textWasPasted) {\n    _textView.textWasPasted = NO;\n  } else {\n    [_eventDispatcher sendTextEventWithType:RCTTextEventTypeKeyPress\n                                   reactTag:self.reactTag\n                                       text:[_textView string]\n                                        key:text\n                                 eventCount:_nativeEventCount];\n\n    if (_blurOnSubmit && [text isEqualToString:@\"\\n\"]) {\n      // TODO: the purpose of blurOnSubmit on RCTextField is to decide if the\n      // field should lose focus when return is pressed or not. We're cheating a\n      // bit here by using it on RCTextView to decide if return character should\n      // submit the form, or be entered into the field.\n      //\n      // The reason this is cheating is because there's no way to specify that\n      // you want the return key to be swallowed *and* have the field retain\n      // focus (which was what blurOnSubmit was originally for). For the case\n      // where _blurOnSubmit = YES, this is still the correct and expected\n      // behavior though, so we'll leave the don't-blur-or-add-newline problem\n      // to be solved another day.\n      [_eventDispatcher sendTextEventWithType:RCTTextEventTypeSubmit\n                                     reactTag:self.reactTag\n                                         text:self.text\n                                          key:nil\n                                   eventCount:_nativeEventCount];\n      [_textView resignFirstResponder];\n      return NO;\n    }\n  }\n\n  // So we need to track that there is a native update in flight just in case JS manages to come back around and update\n  // things /before/ UITextView can update itself asynchronously.  If there is a native update in flight, we defer the\n  // JS update when it comes in and apply the deferred update once textViewDidChange fires with the native update applied.\n  if (_blockTextShouldChange) {\n    return NO;\n  }\n\n  if (_maxLength) {\n    NSUInteger allowedLength = _maxLength.integerValue - textView.string.length + range.length;\n    if (text.length > allowedLength) {\n      // If we typed/pasted more than one character, limit the text inputted\n      if (text.length > 1) {\n        // Truncate the input string so the result is exactly maxLength\n        NSString *limitedString = [text substringToIndex:allowedLength];\n        NSMutableString *newString = textView.string.mutableCopy;\n        [newString replaceCharactersInRange:range withString:limitedString];\n        textView.string = newString;\n        _predictedText = newString;\n\n        // Collapse selection at end of insert to match normal paste behavior\n//        UITextPosition *insertEnd = [textView positionFromPosition:textView.beginningOfDocument\n//                                                            offset:(range.location + allowedLength)];\n//        textView.selectedTextRange = [textView textRangeFromPosition:insertEnd toPosition:insertEnd];\n\n        [self textViewDidChange:textView];\n      }\n      return NO;\n    }\n  }\n\n  _nativeUpdatesInFlight = YES;\n\n  if (range.location + range.length > _predictedText.length) {\n    // _predictedText got out of sync in a bad way, so let's just force sync it.  Haven't been able to repro this, but\n    // it's causing a real crash here: #6523822\n    _predictedText = textView.string;\n  }\n\n  NSString *previousText = [_predictedText substringWithRange:range];\n  if (_predictedText) {\n    _predictedText = [_predictedText stringByReplacingCharactersInRange:range withString:text];\n  } else {\n    _predictedText = text;\n  }\n\n  if (_onTextInput) {\n    _onTextInput(@{\n      @\"text\": text,\n      @\"previousText\": previousText ?: @\"\",\n      @\"range\": @{\n        @\"start\": @(range.location),\n        @\"end\": @(range.location + range.length)\n      },\n      @\"eventCount\": @(_nativeEventCount),\n    });\n  }\n\n  return YES;\n}\n\n- (void)textViewDidChangeSelection:(__unused NSNotification *)notification\n{\n  if (_onSelectionChange &&\n      _textView.selectedRanges != _previousSelectionRanges &&\n      ![_textView.selectedRanges isEqual:_previousSelectionRanges]) {\n\n    _previousSelectionRanges = _textView.selectedRanges;\n\n    NSRange selection = _textView.selectedRanges.firstObject.rangeValue;\n\n    // TODO: support multiple ranges\n    _onSelectionChange(@{\n      @\"selection\": @{\n        @\"start\": @(selection.location),\n        @\"end\": @(selection.location + selection.length),\n      },\n    });\n  }\n}\n\n- (void)setText:(NSString *)text\n{\n  NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n  if (eventLag == 0 && ![text isEqualToString:[_textView string]]) {\n    NSArray <NSValue *> *previousRanges = [_textView selectedRanges];\n    [_textView setString:text];\n    [_textView setSelectedRanges:previousRanges];\n    // [self updatePlaceholderVisibility];\n    [self invalidateContentSize];\n  } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n    RCTLogWarn(@\"Native TextInput(%@) is %zd events ahead of JS - try to make your JS faster.\", self.text, eventLag);\n  }\n}\n\n- (void)updatePlaceholderVisibility\n{\n}\n\n- (NSString *)placeholder\n{\n  return _textView.placeholderText;\n}\n\n- (void)setPlaceholder:(NSString *)placeholder\n{\n  _textView.placeholderText = placeholder;\n}\n\n- (NSColor *)placeholderTextColor\n{\n  return _textView.placeholderTextColor;\n}\n\n- (void)setPlaceholderTextColor:(NSColor *)placeholderTextColor\n{\n  _textView.placeholderTextColor = placeholderTextColor;\n}\n\n- (NSFont *)defaultPlaceholderFont\n{\n  return [NSFont systemFontOfSize:17];\n}\n\n- (NSColor *)defaultPlaceholderTextColor\n{\n  return [NSColor colorWithRed:0.0/255.0 green:0.0/255.0 blue:0.098/255.0 alpha:0.22];\n}\n\n- (void)textDidChange:(__unused NSNotification *)notification\n{\n  if (_clearTextOnFocus) {\n    [_textView setString:@\"\"];\n    [self updatePlaceholderVisibility];\n  }\n\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus\n                                 reactTag:self.reactTag\n                                     text:nil\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\nstatic BOOL findMismatch(NSString *first, NSString *second, NSRange *firstRange, NSRange *secondRange)\n{\n  NSInteger firstMismatch = -1;\n  for (NSUInteger ii = 0; ii < MAX(first.length, second.length); ii++) {\n    if (ii >= first.length || ii >= second.length || [first characterAtIndex:ii] != [second characterAtIndex:ii]) {\n      firstMismatch = ii;\n      break;\n    }\n  }\n\n  if (firstMismatch == -1) {\n    return NO;\n  }\n\n  NSUInteger ii = second.length;\n  NSUInteger lastMismatch = first.length;\n  while (ii > firstMismatch && lastMismatch > firstMismatch) {\n    if ([first characterAtIndex:(lastMismatch - 1)] != [second characterAtIndex:(ii - 1)]) {\n      break;\n    }\n    ii--;\n    lastMismatch--;\n  }\n\n  *firstRange = NSMakeRange(firstMismatch, lastMismatch - firstMismatch);\n  *secondRange = NSMakeRange(firstMismatch, ii - firstMismatch);\n  return YES;\n}\n\n- (void)textViewDidChange:(NSTextView *)textView\n{\n  // Detect when textView updates happend that didn't invoke `shouldChangeTextInRange`\n  // (e.g. typing simplified chinese in pinyin will insert and remove spaces without\n  // calling shouldChangeTextInRange).  This will cause JS to get out of sync so we\n  // update the mismatched range.\n  NSRange currentRange;\n  NSRange predictionRange;\n  if (findMismatch(textView.string, _predictedText, &currentRange, &predictionRange)) {\n    NSString *replacement = [textView.string substringWithRange:currentRange];\n    [self textView:textView shouldChangeTextInRange:predictionRange replacementString:replacement];\n    // JS will assume the selection changed based on the location of our shouldChangeTextInRange, so reset it.\n    [self textViewDidChangeSelection:(NSNotification *)textView];\n    _predictedText = textView.string;\n  }\n\n  _nativeUpdatesInFlight = NO;\n  _nativeEventCount++;\n\n  if (!self.reactTag || !_onChange) {\n    return;\n  }\n\n  // When the context size increases, iOS updates the contentSize twice; once\n  // with a lower height, then again with the correct height. To prevent a\n  // spurious event from being sent, we track the previous, and only send the\n  // update event if it matches our expectation that greater text length\n  // should result in increased height. This assumption is, of course, not\n  // necessarily true because shorter text might include more linebreaks, but\n  // in practice this works well enough.\n  NSUInteger textLength = textView.string.length;\n  NSTextContainer* textContainer = [textView textContainer];\n  NSLayoutManager* layoutManager = [textView layoutManager];\n  [layoutManager ensureLayoutForTextContainer: textContainer];\n  CGSize contentSize = [layoutManager usedRectForTextContainer: textContainer].size;\n  CGFloat contentHeight = contentSize.height;\n  if (textLength >= _previousTextLength) {\n    contentHeight = MAX(contentHeight, _previousContentHeight);\n  }\n  _previousTextLength = textLength;\n  _previousContentHeight = contentHeight;\n  _onChange(@{\n    @\"text\": self.text,\n    @\"contentSize\": @{\n      @\"height\": @(contentHeight),\n      @\"width\": @(contentSize.width)\n    },\n    @\"target\": self.reactTag,\n    @\"eventCount\": @(_nativeEventCount),\n  });\n}\n\n- (void)textDidEndEditing:(NSNotification *)aNotification\n{\n  if (_nativeUpdatesInFlight) {\n    // iOS does't call `textViewDidChange:` delegate method if the change was happened because of autocorrection\n    // which was triggered by loosing focus. So, we call it manually.\n    [self textViewDidChange:_textView];\n    //_nativeEventCount++;\n  }\n\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd\n                                 reactTag:self.reactTag\n                                     text:[_textView string]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n  \n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur\n                                 reactTag:self.reactTag\n                                     text:nil\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n\n- (void)textDidBeginEditing:(NSNotification *)aNotification\n{\n  if (_clearTextOnFocus) {\n    [_textView setString:@\"\"];\n  }\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus\n                                 reactTag:self.reactTag\n                                     text:[_textView string]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n\n#pragma mark - Focus control deledation\n\n- (void)reactFocus\n{\n  [_textView reactFocus];\n}\n\n- (void)reactBlur\n{\n  [_textView reactBlur];\n}\n\n- (void)didMoveToWindow\n{\n  [_textView reactFocusIfNeeded];\n}\n\n#pragma mark - Content size\n\n- (CGSize)contentSize\n{\n  // Returning value does NOT include insets.\n  CGSize contentSize = self.intrinsicContentSize;\n  contentSize.width -= _contentInset.left + _contentInset.right;\n  contentSize.height -= _contentInset.top + _contentInset.bottom;\n  return contentSize;\n}\n\n- (void)invalidateContentSize\n{\n  CGSize contentSize = self.contentSize;\n\n  if (CGSizeEqualToSize(_previousContentSize, contentSize)) {\n    return;\n  }\n  _previousContentSize = contentSize;\n\n  [_bridge.uiManager setIntrinsicContentSize:contentSize forView:self];\n\n  if (_onContentSizeChange) {\n    _onContentSizeChange(@{\n      @\"contentSize\": @{\n        @\"height\": @(contentSize.height),\n        @\"width\": @(contentSize.width),\n      },\n      @\"target\": self.reactTag,\n    });\n  }\n}\n\n#pragma mark - Layout\n\n- (CGSize)intrinsicContentSize\n{\n  // Calling `sizeThatFits:` is probably more expensive method to compute\n  // content size compare to direct access `_textView.contentSize` property,\n  // but seems `sizeThatFits:` returns more reliable and consistent result.\n  // Returning value DOES include insets.\n  return [self sizeThatFits:CGSizeMake(self.bounds.size.width, INFINITY)];\n}\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  // return [_textView sizeThatFits:size];\n  return _textView.frame.size;\n}\n\n- (void)layout\n{\n  [super layout];\n  [self invalidateContentSize];\n}\n\n//\n//#pragma mark - UIScrollViewDelegate\n//\n//- (void)scrollViewDidScroll:(UIScrollView *)scrollView\n//{\n//  if (_onScroll) {\n//    CGPoint contentOffset = scrollView.contentOffset;\n//    CGSize contentSize = scrollView.contentSize;\n//    CGSize size = scrollView.bounds.size;\n//    UIEdgeInsets contentInset = scrollView.contentInset;\n//\n//    _onScroll(@{\n//      @\"contentOffset\": @{\n//        @\"x\": @(contentOffset.x),\n//        @\"y\": @(contentOffset.y)\n//      },\n//      @\"contentInset\": @{\n//        @\"top\": @(contentInset.top),\n//        @\"left\": @(contentInset.left),\n//        @\"bottom\": @(contentInset.bottom),\n//        @\"right\": @(contentInset.right)\n//      },\n//      @\"contentSize\": @{\n//        @\"width\": @(contentSize.width),\n//        @\"height\": @(contentSize.height)\n//      },\n//      @\"layoutMeasurement\": @{\n//        @\"width\": @(size.width),\n//        @\"height\": @(size.height)\n//      },\n//      @\"zoomScale\": @(scrollView.zoomScale ?: 1),\n//    });\n//  }\n//}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTSecureTextField.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@class RCTEventDispatcher;\n\n@interface RCTSecureTextField : NSSecureTextField <NSTextFieldDelegate>\n\n@property (nonatomic, assign) BOOL selectTextOnFocus;\n@property (nonatomic, assign) NSEdgeInsets contentInset;\n@property (nonatomic, assign) NSInteger mostRecentEventCount;\n@property (nonatomic, strong) NSNumber *maxLength;\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;\n\n@end\n\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTSecureTextField.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSecureTextField.h\"\n\n#import \"React/RCTConvert.h\"\n#import \"React/RCTEventDispatcher.h\"\n#import \"React/RCTUtils.h\"\n#import \"React/NSView+React.h\"\n\n@implementation RCTSecureTextField\n{\n  RCTEventDispatcher *_eventDispatcher;\n  NSMutableArray *_reactSubviews;\n  BOOL _jsRequestingFirstResponder;\n  NSInteger _nativeEventCount;\n}\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher\n{\n  if ((self = [super initWithFrame:CGRectZero])) {\n    RCTAssert(eventDispatcher, @\"eventDispatcher is a required parameter\");\n    _eventDispatcher = eventDispatcher;\n    self.delegate = self;\n    self.drawsBackground = NO;\n    self.bordered = NO;\n    self.bezeled = YES;\n\n    _reactSubviews = [NSMutableArray new];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (void)setText:(NSString *)text\n{\n  NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n  if (eventLag == 0 && ![text isEqualToString:[self stringValue]]) {\n    //NSRange *selection = [self value]\n    [self setStringValue:text];\n    //self.selectedTextRange = selection; // maintain cursor position/selection - this is robust to out of bounds\n  } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n    RCTLogWarn(@\"Native TextInput(%@) is %zd events ahead of JS - try to make your JS faster.\", [self stringValue], eventLag);\n  }\n}\n\n- (void)textDidChange:(NSNotification *)aNotification\n{\n  _nativeEventCount++;\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeChange\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n- (void)textDidEndEditing:(NSNotification *)aNotification\n{\n  _nativeEventCount++;\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n- (void)textDidBeginEditing:(NSNotification *)aNotification\n{\n  if (_selectTextOnFocus) {\n    dispatch_async(dispatch_get_main_queue(), ^{\n      [self selectAll:nil];\n    });\n  }\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n- (BOOL)becomeFirstResponder\n{\n  _jsRequestingFirstResponder = YES;\n  BOOL result = [super becomeFirstResponder];\n  _jsRequestingFirstResponder = NO;\n  return result;\n}\n\n- (BOOL)resignFirstResponder\n{\n  BOOL result = [super resignFirstResponder];\n  if (result)\n  {\n    [_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur\n                                   reactTag:self.reactTag\n                                       text:[self stringValue]\n                                        key:nil\n                                 eventCount:_nativeEventCount];\n  }\n  return result;\n}\n\n- (BOOL)canBecomeFirstResponder\n{\n  return _jsRequestingFirstResponder;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTShadowTextField.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTShadowView.h>\n\n@interface RCTShadowTextField : RCTShadowView\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTShadowTextField.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTShadowTextField.h\"\n\n@implementation RCTShadowTextField\n\n- (BOOL)isYogaLeafNode\n{\n  return YES;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTShadowTextView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTShadowView.h>\n\n@interface RCTShadowTextView : RCTShadowView\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTShadowTextView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTShadowTextView.h\"\n\n@implementation RCTShadowTextView\n\n- (BOOL)isYogaLeafNode\n{\n  return YES;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTTextField.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTComponent.h>\n\n@class RCTEventDispatcher;\n\n@interface TextFieldCellWithPaddings : NSTextFieldCell\n@end\n\n@interface RCTTextField : NSTextField <NSTextFieldDelegate, NSTextViewDelegate>\n\n@property (nonatomic, assign) BOOL caretHidden;\n@property (nonatomic, assign) BOOL selectTextOnFocus;\n@property (nonatomic, assign) NSEdgeInsets contentInset;\n@property (nonatomic, assign) NSEdgeInsets textContainerInset;\n@property (nonatomic, strong) NSColor *placeholderTextColor;\n@property (nonatomic, strong) NSColor *selectionColor;\n@property (nonatomic, assign) NSInteger mostRecentEventCount;\n@property (nonatomic, strong) NSNumber *maxLength;\n\n@property (nonatomic, copy) RCTDirectEventBlock onSelectionChange;\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTTextField.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextField.h\"\n\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTUtils.h>\n#import <React/NSView+React.h>\n\n#import \"RCTTextSelection.h\"\n\n\n@implementation RCTTextField\n{\n  RCTEventDispatcher *_eventDispatcher;\n  NSInteger _nativeEventCount;\n  NSString * _placeholderString;\n  BOOL _submitted;\n  NSRange _previousSelectionRange;\n  BOOL _textWasPasted;\n  NSString *_finalText;\n}\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher\n{\n  if ((self = [super initWithFrame:CGRectZero])) {\n    RCTAssert(eventDispatcher, @\"eventDispatcher is a required parameter\");\n    self.delegate = self;\n    self.drawsBackground = NO;\n    self.bordered = NO;\n    self.bezeled = YES;\n    // self.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;\n\n    _eventDispatcher = eventDispatcher;\n\n    [self addObserver:self forKeyPath:@\"selectedTextRange\" options:0 context:nil];\n  }\n  return self;\n}\n\n\n\n- (void)dealloc\n{\n  [self removeObserver:self forKeyPath:@\"selectedTextRange\"];\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (void)sendKeyValueForString:(NSString *)string\n{\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeKeyPress\n                                 reactTag:self.reactTag\n                                     text:nil\n                                      key:string\n                               eventCount:_nativeEventCount];\n}\n\n-(void)keyUp:(NSEvent *)theEvent\n{\n  [self sendKeyValueForString: [NSString stringWithFormat:@\"%i\", theEvent.keyCode ]];\n}\n\n- (void)setTextContainerInset:(NSEdgeInsets)textContainerInset\n{\n  _textContainerInset = textContainerInset;\n  [self setNeedsLayout:YES];\n}\n\n// TODO:\n// figure out why this method doesn't get called\n\n//- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector\n//{\n//  NSEvent *currentEvent = [[NSApplication sharedApplication]currentEvent];\n//  [self sendKeyValueForString: [NSString stringWithFormat:@\"%i\", currentEvent.keyCode ]];\n//  return YES;\n//}\n//\n//- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString;\n//{\n//  [self sendKeyValueForString: replacementString];\n//  return YES;\n//}\n\n// This method is overridden for `onKeyPress`. The manager\n// will not send a keyPress for text that was pasted.\n- (void)paste:(id)sender\n{\n  _textWasPasted = YES;\n  [[super currentEditor] paste:sender];\n}\n\n- (void)setSelection:(RCTTextSelection *)selection\n{\n  if (!selection) {\n    return;\n  }\n\n//  UITextRange *currentSelection = self.selectedTextRange;\n//  UITextPosition *start = [self positionFromPosition:self.beginningOfDocument offset:selection.start];\n//  UITextPosition *end = [self positionFromPosition:self.beginningOfDocument offset:selection.end];\n//  UITextRange *selectedTextRange = [self textRangeFromPosition:start toPosition:end];\n//\n//  NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n//  if (eventLag == 0 && ![currentSelection isEqual:selectedTextRange]) {\n//    _previousSelectionRange = selectedTextRange;\n//    self.selectedTextRange = selectedTextRange;\n//  } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n//    RCTLogWarn(@\"Native TextInput(%@) is %zd events ahead of JS - try to make your JS faster.\", self.text, eventLag);\n//  }\n}\n\n\n- (void)setText:(NSString *)text\n{\n  NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n  if (eventLag == 0 && ![text isEqualToString:[self stringValue]]) {\n    [self setStringValue:text];\n    // TODO: maintain cursor position\n  } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n    RCTLogWarn(@\"Native TextInput(%@) is %zd events ahead of JS - try to make your JS faster.\", [self stringValue], eventLag);\n  }\n}\n\n- (void)setPlaceholderTextColor:(NSColor *)placeholderTextColor\n{\n  if (placeholderTextColor != nil && ![_placeholderTextColor isEqual:placeholderTextColor]) {\n    _placeholderTextColor = placeholderTextColor;\n    [self updatePlaceholder];\n  }\n}\n\n- (void)updatePlaceholder\n{\n  if (_placeholderTextColor && _placeholderString) {\n    NSAttributedString *attrString = [[NSAttributedString alloc]\n                                      initWithString:_placeholderString attributes: @{\n                                        NSForegroundColorAttributeName: _placeholderTextColor,\n                                        NSFontAttributeName: [self font]\n                                      }];\n    [self setPlaceholderAttributedString:attrString];\n  }\n}\n\n- (void)setPlaceholder:(NSString *)placeholder\n{\n  if (placeholder != nil && ![_placeholderString isEqual:placeholder]) {\n    _placeholderString = placeholder;\n    [self updatePlaceholder];\n  }\n}\n\n- (void)setBackgroundColor:(NSColor *)backgroundColor\n{\n  if (backgroundColor) {\n    [self setDrawsBackground:YES];\n    [self.cell setBackgroundColor:backgroundColor];\n  }\n}\n\n- (void)textDidChange:(NSNotification *)aNotification\n{\n  _nativeEventCount++;\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeChange\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n\n  // selectedTextRange observer isn't triggered when you type even though the\n  // cursor position moves, so we send event again here.\n  [self sendSelectionEvent];\n}\n\n- (void)textDidEndEditing:(NSNotification *)aNotification\n{\n  if (![_finalText isEqualToString:self.stringValue]) {\n    _finalText = nil;\n    // iOS does't send event `UIControlEventEditingChanged` if the change was happened because of autocorrection\n    // which was triggered by loosing focus. We assume that if `text` was changed in the middle of loosing focus process,\n    // we did not receive that event. So, we call `textFieldDidChange` manually.\n    [self textDidChange:(NSNotification *)self];\n  }\n\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n- (void)textFieldSubmitEditing\n{\n  _submitted = YES;\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeSubmit\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n}\n\n- (void)textDidBeginEditing:(NSNotification *)aNotification\n{\n  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus\n                                 reactTag:self.reactTag\n                                     text:[self stringValue]\n                                      key:nil\n                               eventCount:_nativeEventCount];\n\n  dispatch_async(dispatch_get_main_queue(), ^{\n    if (self->_selectTextOnFocus) {\n      [self selectAll:nil];\n    }\n\n    [self sendSelectionEvent];\n  });\n}\n\n- (void)observeValueForKeyPath:(NSString *)keyPath\n                      ofObject:(RCTTextField *)textField\n                        change:(NSDictionary *)change\n                       context:(void *)context\n{\n  if ([keyPath isEqualToString:@\"selectedTextRange\"]) {\n    [self sendSelectionEvent];\n  }\n}\n\n- (void)sendSelectionEvent\n{\n  if (_onSelectionChange &&\n      (self.currentEditor.selectedRange.location != _previousSelectionRange.location ||\n      self.currentEditor.selectedRange.length != _previousSelectionRange.length)) {\n\n    _previousSelectionRange = self.currentEditor.selectedRange;\n\n    NSRange selection = self.currentEditor.selectedRange;\n    NSInteger start = selection.location;\n    NSInteger end = selection.location + selection.length;\n    _onSelectionChange(@{\n      @\"selection\": @{\n        @\"start\": @(start),\n        @\"end\": @(end),\n      },\n    });\n  }\n}\n\n- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(nullable NSString *)replacementString\n{\n  if (_maxLength) {\n    NSUInteger allowedLength = _maxLength.integerValue - self.stringValue.length + affectedCharRange.length;\n    \n    if (replacementString.length > allowedLength) {\n      return NO;\n    }\n  }\n\n  return YES;\n}\n\n- (BOOL)resignFirstResponder\n{\n  BOOL result = [super resignFirstResponder];\n  if (result)\n  {\n    [_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur\n                                   reactTag:self.reactTag\n                                       text:[self stringValue]\n                                        key:nil\n                                 eventCount:_nativeEventCount];\n  }\n  return result;\n}\n\n- (CGSize)contentSize\n{\n  // Returning size DOES contain `textContainerInset` (aka `padding`).\n  return self.intrinsicContentSize;\n}\n\n//- (CGSize)intrinsicContentSize\n//{\n//  // Note: `placeholder` defines intrinsic size for `<TextInput>`.\n//  NSString *text = self.placeholderString ?: @\"\";\n//  CGSize size = [text sizeWithAttributes:@{NSFontAttributeName: self.font}];\n//  size = CGSizeMake(RCTCeilPixelValue(size.width), RCTCeilPixelValue(size.height));\n//  size.width += _textContainerInset.left + _textContainerInset.right;\n//  size.height += _textContainerInset.top + _textContainerInset.bottom;\n//  // Returning size DOES contain `textContainerInset` (aka `padding`).\n//  return size;\n//}\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  // All size values here contain `textContainerInset` (aka `padding`).\n  CGSize intrinsicSize = self.intrinsicContentSize;\n  return CGSizeMake(MIN(size.width, intrinsicSize.width), MIN(size.height, intrinsicSize.height));\n}\n\n//- (void)reactSetFrame:(CGRect)frame\n//{\n//  NSLog(@\"frame height: %f %f\", frame.size.height, frame.size.width);\n\n//  [self setFrame:NSMakeRect(0, 0, 100, 100)];\n//}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTTextFieldManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTTextFieldManager : RCTViewManager\n\n@end\n\n@interface RCTSecureTextFieldManager : RCTViewManager\n\n@end\n\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTTextFieldManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextFieldManager.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTFont.h>\n#import <React/RCTShadowView.h>\n#import <React/RCTShadowView+Layout.h>\n\n#import \"RCTShadowTextField.h\"\n#import \"RCTTextShadowView.h\"\n#import \"RCTTextField.h\"\n#import \"RCTSecureTextField.h\"\n\n@implementation RCTConvert(RCTTextField)\n\nRCT_ENUM_CONVERTER(NSFocusRingType, (@{\n    @\"default\": @(NSFocusRingTypeDefault),\n    @\"none\": @(NSFocusRingTypeNone),\n    @\"exterior\": @(NSFocusRingTypeExterior)\n}), NSFocusRingTypeDefault, integerValue)\n\n@end\n\n@interface RCTTextFieldManager() <NSTextFieldDelegate>\n\n@end\n\n@implementation RCTTextFieldManager\n\nRCT_EXPORT_MODULE()\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTShadowTextField new];\n}\n\n- (NSView *)view\n{\n    RCTTextField *textField = [[RCTTextField alloc] initWithEventDispatcher:self.bridge.eventDispatcher];\n    textField.delegate = self;\n    return textField;\n}\n\nRCT_EXPORT_VIEW_PROPERTY(caretHidden, BOOL)\nRCT_REMAP_VIEW_PROPERTY(editable, enabled, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(placeholder, NSString)\nRCT_EXPORT_VIEW_PROPERTY(placeholderTextColor, NSColor)\n// RCT_EXPORT_VIEW_PROPERTY(selection, RCTTextSelection)\nRCT_EXPORT_VIEW_PROPERTY(text, NSString)\nRCT_EXPORT_VIEW_PROPERTY(maxLength, NSNumber)\nRCT_EXPORT_VIEW_PROPERTY(focusRingType, NSFocusRingType)\nRCT_EXPORT_VIEW_PROPERTY(selectionColor, NSColor)\nRCT_REMAP_VIEW_PROPERTY(textAlign, alignment, NSTextAlignment)\nRCT_REMAP_VIEW_PROPERTY(color, textColor, NSColor)\nRCT_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)];\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withWeight:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withStyle:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withFamily:json ?: defaultView.font.familyName];\n}\nRCT_EXPORT_VIEW_PROPERTY(mostRecentEventCount, NSInteger)\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTTextShadowView *)shadowView\n{\n  NSNumber *reactTag = shadowView.reactTag;\n  NSEdgeInsets padding = shadowView.paddingAsInsets;\n  return ^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTTextField *> *viewRegistry) {\n    ((RCTTextField *)viewRegistry[reactTag]).textContainerInset = padding;\n  };\n}\n\n//\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  RCTTextField *view = [[RCTTextField alloc] initWithEventDispatcher:self.bridge.eventDispatcher];\n  return @{\n     @\"ComponentHeight\": @(view.intrinsicContentSize.height),\n     @\"ComponentWidth\": @(view.intrinsicContentSize.width)\n  };\n}\n\n@end\n\n@interface RCTSecureTextFieldManager() <NSTextFieldDelegate>\n@end\n\n// TODO: extract common logic into one place\n@implementation RCTSecureTextFieldManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  RCTSecureTextField *textField = [[RCTSecureTextField alloc] initWithEventDispatcher:self.bridge.eventDispatcher];\n  textField.delegate = self;\n  return textField;\n}\n\nRCT_EXPORT_VIEW_PROPERTY(bezeled, BOOL)\nRCT_REMAP_VIEW_PROPERTY(editable, enabled, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(text, NSString)\nRCT_EXPORT_VIEW_PROPERTY(maxLength, NSNumber)\nRCT_EXPORT_VIEW_PROPERTY(selectionColor, NSColor)\nRCT_REMAP_VIEW_PROPERTY(color, textColor, NSColor)\nRCT_REMAP_VIEW_PROPERTY(textAlign, textAlignment, NSTextAlignment)\nRCT_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)];\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withWeight:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withStyle:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, RCTTextField)\n{\n  view.font = [RCTFont updateFont:view.font withFamily:json ?: defaultView.font.familyName];\n}\nRCT_EXPORT_VIEW_PROPERTY(mostRecentEventCount, NSInteger)\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTTextShadowView *)shadowView\n{\n  NSNumber *reactTag = shadowView.reactTag;\n  NSEdgeInsets padding = shadowView.paddingAsInsets;\n  return ^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTTextField *> *viewRegistry) {\n    viewRegistry[reactTag].contentInset = padding;\n  };\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTTextManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTTextManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTTextManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextManager.h\"\n\n#import <yoga/Yoga.h>\n// #import <React/RCTAccessibilityManager.h>\n#import <React/RCTAssert.h>\n#import <React/RCTConvert.h>\n#import <React/RCTLog.h>\n#import <React/NSView+React.h>\n\n#import \"RCTShadowRawText.h\"\n#import \"RCTShadowText.h\"\n#import \"RCTText.h\"\n#import \"RCTTextView.h\"\n\n\nstatic void collectDirtyNonTextDescendants(RCTShadowText *shadowView, NSMutableArray *nonTextDescendants) {\n  for (RCTShadowView *child in shadowView.reactSubviews) {\n    if ([child isKindOfClass:[RCTShadowText class]]) {\n      collectDirtyNonTextDescendants((RCTShadowText *)child, nonTextDescendants);\n    } else if ([child isKindOfClass:[RCTShadowRawText class]]) {\n      // no-op\n    } else if ([child isTextDirty]) {\n      [nonTextDescendants addObject:child];\n    }\n  }\n}\n\n@interface RCTShadowText (Private)\n\n- (NSTextStorage *)buildTextStorageForWidth:(CGFloat)width widthMode:(YGMeasureMode)widthMode;\n\n@end\n\n\n@implementation RCTTextManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  return [RCTText new];\n}\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTShadowText new];\n}\n\n#pragma mark - Shadow properties\n\nRCT_EXPORT_SHADOW_PROPERTY(color, NSColor)\nRCT_EXPORT_SHADOW_PROPERTY(fontFamily, NSString)\nRCT_EXPORT_SHADOW_PROPERTY(fontSize, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(fontWeight, NSString)\nRCT_EXPORT_SHADOW_PROPERTY(fontStyle, NSString)\nRCT_EXPORT_SHADOW_PROPERTY(fontVariant, NSArray)\nRCT_EXPORT_SHADOW_PROPERTY(isHighlighted, BOOL)\nRCT_EXPORT_SHADOW_PROPERTY(letterSpacing, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(lineHeight, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(numberOfLines, NSUInteger)\nRCT_EXPORT_SHADOW_PROPERTY(ellipsizeMode, NSLineBreakMode)\nRCT_EXPORT_SHADOW_PROPERTY(textAlign, NSTextAlignment)\nRCT_EXPORT_SHADOW_PROPERTY(textDecorationStyle, NSUnderlineStyle)\nRCT_EXPORT_SHADOW_PROPERTY(textDecorationColor, NSColor)\nRCT_EXPORT_SHADOW_PROPERTY(textDecorationLine, RCTTextDecorationLineType)\nRCT_EXPORT_SHADOW_PROPERTY(writingDirection, NSWritingDirection)\nRCT_EXPORT_SHADOW_PROPERTY(allowFontScaling, BOOL)\nRCT_EXPORT_SHADOW_PROPERTY(opacity, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(textShadowOffset, CGSize)\nRCT_EXPORT_SHADOW_PROPERTY(textShadowRadius, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(textShadowColor, NSColor)\nRCT_EXPORT_SHADOW_PROPERTY(adjustsFontSizeToFit, BOOL)\nRCT_EXPORT_SHADOW_PROPERTY(minimumFontScale, CGFloat)\nRCT_EXPORT_SHADOW_PROPERTY(selectable, BOOL)\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary<NSNumber *, RCTShadowView *> *)shadowViewRegistry\n{\n  for (RCTShadowView *rootView in shadowViewRegistry.allValues) {\n    if (![rootView isReactRootView]) {\n      // This isn't a root view\n      continue;\n    }\n\n    if (![rootView isTextDirty]) {\n      // No text processing to be done\n      continue;\n    }\n\n    NSMutableArray<RCTShadowView *> *queue = [NSMutableArray arrayWithObject:rootView];\n    for (NSInteger i = 0; i < queue.count; i++) {\n      RCTShadowView *shadowView = queue[i];\n      RCTAssert([shadowView isTextDirty], @\"Don't process any nodes that don't have dirty text\");\n\n      if ([shadowView isKindOfClass:[RCTShadowText class]]) {\n        ((RCTShadowText *)shadowView).fontSizeMultiplier = 1; //TODO: accessability\n        [(RCTShadowText *)shadowView recomputeText];\n        collectDirtyNonTextDescendants((RCTShadowText *)shadowView, queue);\n      } else if ([shadowView isKindOfClass:[RCTShadowRawText class]]) {\n        RCTLogError(@\"Raw text cannot be used outside of a <Text> tag. Not rendering string: '%@'\",\n                    [(RCTShadowRawText *)shadowView text]);\n      } else {\n        for (RCTShadowView *child in [shadowView reactSubviews]) {\n          if ([child isTextDirty]) {\n            [queue addObject:child];\n          }\n        }\n      }\n\n      [shadowView setTextComputed];\n    }\n  }\n\n  return nil;\n}\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowText *)shadowView\n{\n  NSNumber *reactTag = shadowView.reactTag;\n  NSEdgeInsets padding = shadowView.paddingAsInsets;\n\n  return ^(RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTText *> *viewRegistry) {\n    RCTText *text = viewRegistry[reactTag];\n    text.contentInset = padding;\n  };\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTTextSelection.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTConvert.h>\n\n/**\n * Object containing information about a TextInput's selection.\n */\n@interface RCTTextSelection : NSObject\n\n@property (nonatomic, assign, readonly) NSInteger start;\n@property (nonatomic, assign, readonly) NSInteger end;\n\n- (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end;\n\n@end\n\n@interface RCTConvert (RCTTextSelection)\n\n+ (RCTTextSelection *)RCTTextSelection:(id)json;\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTTextSelection.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextSelection.h\"\n\n@implementation RCTTextSelection\n\n- (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end\n{\n  if (self = [super init]) {\n    _start = start;\n    _end = end;\n  }\n  return self;\n}\n\n@end\n\n@implementation RCTConvert (RCTTextSelection)\n\n+ (RCTTextSelection *)RCTTextSelection:(id)json\n{\n  if ([json isKindOfClass:[NSDictionary class]]) {\n    NSInteger start = [self NSInteger:json[@\"start\"]];\n    NSInteger end = [self NSInteger:json[@\"end\"]];\n    return [[RCTTextSelection alloc] initWithStart:start end:end];\n  }\n\n  return nil;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTTextViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTMultilineTextInputViewManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTTextViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTextViewManager.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTFont.h>\n#import <React/RCTShadowView.h>\n#import <React/RCTShadowView+Layout.h>\n\n#import \"RCTShadowTextView.h\"\n#import \"RCTTextShadowView.h\"\n#import \"RCTMultilineTextInputView.h\"\n\n@implementation RCTMultilineTextInputViewManager\n\nRCT_EXPORT_MODULE()\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTShadowTextView new];\n}\n\n- (NSView *)view\n{\n  return [[RCTMultilineTextInputView alloc] initWithBridge:self.bridge];\n}\n\n// RCT_REMAP_VIEW_PROPERTY(autoCapitalize, textView.autocapitalizationType, UITextAutocapitalizationType)\n// RCT_REMAP_VIEW_PROPERTY(autoCorrect, autocorrectionType, UITextAutocorrectionType)\n// RCT_REMAP_VIEW_PROPERTY(spellCheck, spellCheckingType, UITextSpellCheckingType)\nRCT_EXPORT_VIEW_PROPERTY(blurOnSubmit, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(clearTextOnFocus, BOOL)\nRCT_REMAP_VIEW_PROPERTY(editable, textView.editable, BOOL)\nRCT_REMAP_VIEW_PROPERTY(selectionColor, textView.insertionPointColor, NSColor)\n\nRCT_EXPORT_VIEW_PROPERTY(maxLength, NSNumber)\nRCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onContentSizeChange, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onSelectionChange, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onScroll, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onTextInput, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(placeholder, NSString)\nRCT_EXPORT_VIEW_PROPERTY(placeholderTextColor, NSColor)\nRCT_REMAP_VIEW_PROPERTY(secureTextEntry, textView.secureTextEntry, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(selectTextOnFocus, BOOL)\n// RCT_EXPORT_VIEW_PROPERTY(selection, RCTTextSelection)\nRCT_EXPORT_VIEW_PROPERTY(text, NSString)\nRCT_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, RCTMultilineTextInputView)\n{\n  view.font = [RCTFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)];\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused RCTMultilineTextInputView)\n{\n  view.font = [RCTFont updateFont:view.font withWeight:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused RCTMultilineTextInputView)\n{\n  view.font = [RCTFont updateFont:view.font withStyle:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, RCTMultilineTextInputView)\n{\n  view.font = [RCTFont updateFont:view.font withFamily:json ?: defaultView.font.familyName];\n}\nRCT_EXPORT_VIEW_PROPERTY(mostRecentEventCount, NSInteger)\n\n// #if !TARGET_OS_TV\n// RCT_REMAP_VIEW_PROPERTY(dataDetectorTypes, textView.dataDetectorTypes, UIDataDetectorTypes)\n// #endif\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTTextShadowView *)shadowView\n{\n  NSNumber *reactTag = shadowView.reactTag;\n  NSEdgeInsets padding = shadowView.paddingAsInsets;\n  return ^(RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTMultilineTextInputView *> *viewRegistry) {\n    viewRegistry[reactTag].contentInset = padding;\n  };\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTUITextView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n/*\n * Just regular UITextView... but much better!\n */\n\n@interface RCTUITextView : NSTextView\n\n- (instancetype)initWithFrame:(CGRect)frame textContainer:(nullable NSTextContainer *)textContainer NS_UNAVAILABLE;\n- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;\n\n- (void)setText:(NSString *)text;\n- (void)setAttributedText:(NSAttributedString *)attributedText;\n\n@property (nonatomic, strong) NSAttributedString *placeholderAttributedString;\n@property (nonatomic, assign) BOOL textWasPasted;\n@property (nonatomic, copy, nullable) NSString *placeholderText;\n@property (nonatomic, assign, nullable) NSColor *placeholderTextColor;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Text/TextInputLegacy/RCTUITextView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Cocoa/Cocoa.h>\n#import \"RCTUITextView.h\"\n\n#import <React/NSView+React.h>\n\nCGRect UIEdgeInsetsSizeRect(CGRect rect, CGSize insets) {\n//  rect.origin.x    += insets.left;\n //  rect.origin.y    += insets.top;\n  rect.size.width  -= (insets.width);\n  rect.size.height -= (insets.height);\n  return rect;\n}\n\n\n@implementation RCTUITextView\n{\n  NSTextField *_placeholderView;\n  NSTextView *_detachedTextView;\n}\n\nstatic NSFont *defaultPlaceholderFont()\n{\n  return [NSFont systemFontOfSize:17];\n}\n\nstatic NSColor *defaultPlaceholderTextColor()\n{\n  // Default placeholder color from UITextField.\n  return [NSColor colorWithRed:0 green:0 blue:0.0980392 alpha:0.22];\n}\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if (self = [super initWithFrame:frame]) {\n//    _placeholderView = [[NSTextField alloc] initWithFrame:self.bounds];\n////    _placeholderView.isAccessibilityElement = NO;\n//    // _placeholderView. = 0;\n//    _placeholderView.textColor = defaultPlaceholderTextColor();\n//    _placeholderView.editable = NO;\n//    [self addSubview:_placeholderView];\n  }\n\n  return self;\n}\n\n\n#pragma mark - Properties\n\n- (void)setPlaceholderText:(NSString *)placeholderText\n{\n  _placeholderText = placeholderText;\n  _placeholderView.stringValue = _placeholderText;\n}\n\n- (void)setPlaceholderTextColor:(NSColor *)placeholderTextColor\n{\n  _placeholderTextColor = placeholderTextColor;\n  _placeholderView.textColor = _placeholderTextColor ?: defaultPlaceholderTextColor();\n}\n\n- (void)textDidChange\n{\n  _textWasPasted = NO;\n  [self invalidatePlaceholderVisibility];\n}\n\n#pragma mark - Overrides\n\n- (void)setFont:(NSFont *)font\n{\n  // [super setFont:font];\n  [[super textStorage] setFont:font];\n  _placeholderView.font = font ?: defaultPlaceholderFont();\n}\n\n- (void)setTextAlignment:(NSTextAlignment)textAlignment\n{\n  // [super setTextAlignment:textAlignment];\n  // _placeholderView.textAlignment = textAlignment;\n}\n\n- (void)setText:(NSString *)text\n{\n  [self setString:text];\n  [self textDidChange];\n}\n\n- (void)setAttributedText:(NSAttributedString *)attributedText\n{\n  [self.textStorage setAttributedString:attributedText];\n  [self textDidChange];\n}\n\n- (void)paste:(id)sender\n{\n  [super paste:sender];\n  _textWasPasted = YES;\n}\n\n- (void)setContentOffset:(CGPoint)contentOffset animated:(__unused BOOL)animated\n{\n  // Turning off scroll animation.\n  // This fixes the problem also known as \"flaky scrolling\".\n  // [super setContentOffset:contentOffset animated:NO];\n}\n\n#pragma mark - Layout\n\n- (void)layout\n{\n  [super layout];\n\n  CGRect textFrame = UIEdgeInsetsSizeRect(self.bounds, self.textContainerInset);\n  CGFloat placeholderHeight = [_placeholderView sizeThatFits:textFrame.size].height;\n  textFrame.size.height = MIN(placeholderHeight, textFrame.size.height);\n  _placeholderView.frame = textFrame;\n}\n\n- (void)drawRect:(NSRect)rect\n{\n  if ([[self string] isEqualToString:@\"\"] && self != [[self window] firstResponder]) {\n    [_placeholderView.attributedStringValue drawWithRect:rect options:NSStringDrawingUsesLineFragmentOrigin context:nil];\n  }\n  [super drawRect:rect];\n}\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  NSRect rect = [super.layoutManager usedRectForTextContainer:super.textContainer];\n  return CGSizeMake(MIN(rect.size.width, size.width), rect.size.height);\n}\n\n#pragma mark - Placeholder\n\n- (void)invalidatePlaceholderVisibility\n{\n  BOOL isVisible = _placeholderText.length != 0 && self.string.length == 0;\n  _placeholderView.hidden = !isVisible;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Text/TextProps.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TextProps\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type {Node} from 'react';\n\nimport type {LayoutEvent} from 'CoreEventTypes';\nimport type {TextStyleProp} from 'StyleSheetTypes';\n\ntype PressRetentionOffset = {\n  top: number,\n  left: number,\n  bottom: number,\n  right: number,\n};\n\n/**\n * @see https://facebook.github.io/react-native/docs/text.html#reference\n */\nexport type TextProps = {|\n  accessible?: boolean,\n  allowFontScaling?: boolean,\n  children: Node,\n  ellipsizeMode?: 'clip' | 'head' | 'middle' | 'tail',\n  nativeID?: string,\n  numberOfLines?: number,\n  onLayout?: ?(event: LayoutEvent) => void,\n  onLongPress?: ?() => void,\n  onPress?: ?() => void,\n  pressRetentionOffset?: PressRetentionOffset,\n  selectable?: boolean,\n  style?: TextStyleProp,\n  testID?: string,\n\n  // Android Only\n  disabled?: boolean,\n  selectionColor?: string,\n  textBreakStrategy?: 'balanced' | 'highQuality' | 'simple',\n\n  // iOS Only\n  adjustsFontSizeToFit?: boolean,\n  minimumFontScale?: number,\n  suppressHighlighting?: boolean,\n|};\n"
  },
  {
    "path": "Libraries/Text/TextStylePropTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TextStylePropTypes\n * @flow\n */\n'use strict';\n\nconst ColorPropType = require('ColorPropType');\nconst ReactPropTypes = require('prop-types');\nconst ViewStylePropTypes = require('ViewStylePropTypes');\n\nconst TextStylePropTypes = {\n  ...ViewStylePropTypes,\n\n  color: ColorPropType,\n  fontFamily: ReactPropTypes.string,\n  fontSize: ReactPropTypes.number,\n  fontStyle: ReactPropTypes.oneOf(['normal', 'italic']),\n  /**\n   * Specifies font weight. The values 'normal' and 'bold' are supported for\n   * most fonts. Not all fonts have a variant for each of the numeric values,\n   * in that case the closest one is chosen.\n   */\n  fontWeight: ReactPropTypes.oneOf(\n    ['normal' /*default*/, 'bold',\n     '100', '200', '300', '400', '500', '600', '700', '800', '900']\n  ),\n  /**\n   * @platform ios\n   */\n  fontVariant: ReactPropTypes.arrayOf(\n    ReactPropTypes.oneOf([\n      'small-caps',\n      'oldstyle-nums',\n      'lining-nums',\n      'tabular-nums',\n      'proportional-nums',\n    ])\n  ),\n  textShadowOffset: ReactPropTypes.shape(\n    {width: ReactPropTypes.number, height: ReactPropTypes.number}\n  ),\n  textShadowRadius: ReactPropTypes.number,\n  textShadowColor: ColorPropType,\n  /**\n   * @platform ios\n   */\n  letterSpacing: ReactPropTypes.number,\n  lineHeight: ReactPropTypes.number,\n  /**\n   * Specifies text alignment. The value 'justify' is only supported on iOS and\n   * fallbacks to `left` on Android.\n   */\n  textAlign: ReactPropTypes.oneOf(\n    ['auto' /*default*/, 'left', 'right', 'center', 'justify']\n  ),\n  /**\n   * @platform android\n   */\n  textAlignVertical: ReactPropTypes.oneOf(\n    ['auto' /*default*/, 'top', 'bottom', 'center']\n  ),\n  /**\n   * Set to `false` to remove extra font padding intended to make space for certain ascenders / descenders.\n   * With some fonts, this padding can make text look slightly misaligned when centered vertically.\n   * For best results also set `textAlignVertical` to `center`. Default is true.\n   * @platform android\n   */\n  includeFontPadding: ReactPropTypes.bool,\n  textDecorationLine: ReactPropTypes.oneOf(\n    ['none' /*default*/, 'underline', 'line-through', 'underline line-through']\n  ),\n  /**\n   * @platform ios\n   */\n  textDecorationStyle: ReactPropTypes.oneOf(\n    ['solid' /*default*/, 'double', 'dotted','dashed']\n  ),\n  /**\n   * @platform ios\n   */\n  textDecorationColor: ColorPropType,\n  /**\n   * @platform ios\n   */\n  writingDirection: ReactPropTypes.oneOf(\n    ['auto' /*default*/, 'ltr', 'rtl']\n  ),\n};\n\nmodule.exports = TextStylePropTypes;\n"
  },
  {
    "path": "Libraries/Text/TextUpdateTest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TextUpdateTest\n * @flow\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar TimerMixin = require('react-timer-mixin');\nvar {\n  NativeModules,\n  StyleSheet,\n  Text,\n} = ReactNative;\n\nvar TestManager = NativeModules.TestManager || NativeModules.SnapshotTestManager;\n\nvar TextUpdateTest = createReactClass({\n  displayName: 'TextUpdateTest',\n  mixins: [TimerMixin],\n  getInitialState: function() {\n    return {seeMore: true};\n  },\n  componentDidMount: function() {\n    this.requestAnimationFrame(\n      () => this.setState({seeMore: false}, () => {\n        TestManager.markTestCompleted();\n      })\n    );\n  },\n  render: function() {\n    return (\n      <Text\n        style={styles.container}\n        onPress={() => this.setState({seeMore: !this.state.seeMore})}>\n        <Text>Tap to see more (bugs)...</Text>\n        {this.state.seeMore && 'raw text'}\n      </Text>\n    );\n  },\n});\n\nvar styles = StyleSheet.create({\n  container: {\n    margin: 10,\n    marginTop: 100,\n  },\n});\n\nmodule.exports = TextUpdateTest;\n"
  },
  {
    "path": "Libraries/Types/CoreEventTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CoreEventTypes\n * @flow\n * @format\n */\n\n'use strict';\n\nexport type Layout = {|\n  +x: number,\n  +y: number,\n  +width: number,\n  +height: number,\n|};\nexport type LayoutEvent = {|\n  +nativeEvent: {|\n    +layout: Layout,\n  |},\n  +persist: () => void,\n|};\n\nexport type PressEvent = Object;\n"
  },
  {
    "path": "Libraries/Utilities/Appearance.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Appearance\n * @flow\n */\n'use strict';\n\nconst Appearance = require('NativeModules').Appearance;\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst processColor = require('processColor')\n\nconst invariant = require('fbjs/lib/invariant');\n\ninvariant(Appearance, 'Appearance native module is not installed correctly');\n\ntype RGBColor = string | number;\nexport type AppearanceConfig = {\n  currentAppearance: String,\n  colors: {\n    [name: String]: RGBColor\n  }\n}\n\nclass AppearanceManager extends NativeEventEmitter {\n\n  constructor() {\n    super(Appearance);\n  }\n\n  addEventListener(type: string, handler: Function) {\n    return this.addListener(type, handler);\n  }\n\n  removeSubscription(subscription: any) {\n    if (subscription.emitter !== this) {\n      subscription.emitter.removeSubscription(subscription);\n    } else {\n      super.removeSubscription(subscription);\n    }\n  }\n\n  static get initial(): AppearanceConfig { \n    return {\n      colors: Appearance.colors,\n      currentAppearance: Appearance.currentAppearance\n    };\n  }\n\n  static highlightWithLevel(color: RGBColor, level: Number): Promise<RGBColor> {\n    return Appearance.highlightWithLevel(processColor(color), level)\n  }\n\n  static shadowWithLevel(color: RGBColor, level: Number): Promise<RGBColor> {\n    return Appearance.shadowWithLevel(processColor(color), level)\n  }\n}\n\nmodule.exports = AppearanceManager;\n"
  },
  {
    "path": "Libraries/Utilities/BackAndroid.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * BackAndroid has been moved to BackHandler.  This stub calls BackHandler methods\n * after generating a warning to remind users to move to the new BackHandler module.\n *\n * @providesModule BackAndroid\n */\n\n'use strict';\n\nvar BackHandler = require('BackHandler');\n\nvar warning = require('fbjs/lib/warning');\n\n/**\n * Deprecated.  Use BackHandler instead.\n */\nvar BackAndroid = {\n\n  exitApp: function() {\n    warning(false, 'BackAndroid is deprecated.  Please use BackHandler instead.');\n    BackHandler.exitApp();\n  },\n\n  addEventListener: function (\n    eventName: BackPressEventName,\n    handler: Function\n  ): {remove: () => void} {\n    warning(false, 'BackAndroid is deprecated.  Please use BackHandler instead.');\n    return BackHandler.addEventListener(eventName, handler);\n  },\n\n  removeEventListener: function(\n    eventName: BackPressEventName,\n    handler: Function\n  ): void {\n    warning(false, 'BackAndroid is deprecated.  Please use BackHandler instead.');\n    BackHandler.removeEventListener(eventName, handler);\n  },\n\n};\n\nmodule.exports = BackAndroid;\n"
  },
  {
    "path": "Libraries/Utilities/BackHandler.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BackHandler\n */\n\n'use strict';\n\nvar DeviceEventManager = require('NativeModules').DeviceEventManager;\nvar RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\n\nvar DEVICE_BACK_EVENT = 'hardwareBackPress';\n\ntype BackPressEventName = $Enum<{\n  backPress: string,\n}>;\n\nvar _backPressSubscriptions = new Set();\n\nRCTDeviceEventEmitter.addListener(DEVICE_BACK_EVENT, function() {\n  var invokeDefault = true;\n  var subscriptions = Array.from(_backPressSubscriptions.values()).reverse();\n\n  for (var i = 0; i < subscriptions.length; ++i) {\n    if (subscriptions[i]()) {\n      invokeDefault = false;\n      break;\n    }\n  }\n\n  if (invokeDefault) {\n    BackHandler.exitApp();\n  }\n});\n\n/**\n * Detect hardware button presses for back navigation.\n *\n * Android: Detect hardware back button presses, and programmatically invoke the default back button\n * functionality to exit the app if there are no listeners or if none of the listeners return true.\n *\n * tvOS: Detect presses of the menu button on the TV remote.  (Still to be implemented:\n * programmatically disable menu button handling\n * functionality to exit the app if there are no listeners or if none of the listeners return true.)\n *\n * iOS: Not applicable.\n *\n * The event subscriptions are called in reverse order (i.e. last registered subscription first),\n * and if one subscription returns true then subscriptions registered earlier will not be called.\n *\n * Example:\n *\n * ```javascript\n * BackHandler.addEventListener('hardwareBackPress', function() {\n *  // this.onMainScreen and this.goBack are just examples, you need to use your own implementation here\n *  // Typically you would use the navigator here to go to the last state.\n *\n *  if (!this.onMainScreen()) {\n *    this.goBack();\n *    return true;\n *  }\n *  return false;\n * });\n * ```\n */\nvar BackHandler = {\n\n  exitApp: function() {\n    DeviceEventManager.invokeDefaultBackPressHandler();\n  },\n\n  /**\n   * Adds an event handler. Supported events:\n   *\n   * - `hardwareBackPress`: Fires when the Android hardware back button is pressed or when the\n   * tvOS menu button is pressed.\n   */\n  addEventListener: function (\n    eventName: BackPressEventName,\n    handler: Function\n  ): {remove: () => void} {\n    _backPressSubscriptions.add(handler);\n    return {\n      remove: () => BackHandler.removeEventListener(eventName, handler),\n    };\n  },\n\n  /**\n   * Removes the event handler.\n   */\n  removeEventListener: function(\n    eventName: BackPressEventName,\n    handler: Function\n  ): void {\n    _backPressSubscriptions.delete(handler);\n  },\n\n};\n\nmodule.exports = BackHandler;\n"
  },
  {
    "path": "Libraries/Utilities/BackHandler.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * On Apple TV, this implements back navigation using the TV remote's menu button.\n * On iOS, this just implements a stub.\n *\n * @providesModule BackHandler\n */\n\n'use strict';\n\nconst Platform = require('Platform');\nconst TVEventHandler = require('TVEventHandler');\n\ntype BackPressEventName = $Enum<{\n  backPress: string,\n}>;\n\nfunction emptyFunction() {}\n\n/**\n * Detect hardware button presses for back navigation.\n *\n * Android: Detect hardware back button presses, and programmatically invoke the default back button\n * functionality to exit the app if there are no listeners or if none of the listeners return true.\n *\n * tvOS: Detect presses of the menu button on the TV remote.  (Still to be implemented:\n * programmatically disable menu button handling\n * functionality to exit the app if there are no listeners or if none of the listeners return true.)\n *\n * iOS: Not applicable.\n *\n * The event subscriptions are called in reverse order (i.e. last registered subscription first),\n * and if one subscription returns true then subscriptions registered earlier will not be called.\n *\n * Example:\n *\n * ```javascript\n * BackHandler.addEventListener('hardwareBackPress', function() {\n *  // this.onMainScreen and this.goBack are just examples, you need to use your own implementation here\n *  // Typically you would use the navigator here to go to the last state.\n *\n *  if (!this.onMainScreen()) {\n *    this.goBack();\n *    return true;\n *  }\n *  return false;\n * });\n * ```\n */\nlet BackHandler;\n\nif (Platform.isTVOS) {\n  const _tvEventHandler = new TVEventHandler();\n  var _backPressSubscriptions = new Set();\n\n  _tvEventHandler.enable(this, function(cmp, evt) {\n    if (evt && evt.eventType === 'menu') {\n      var invokeDefault = true;\n      var subscriptions = Array.from(_backPressSubscriptions.values()).reverse();\n\n      for (var i = 0; i < subscriptions.length; ++i) {\n        if (subscriptions[i]()) {\n          invokeDefault = false;\n          break;\n        }\n      }\n\n      if (invokeDefault) {\n        BackHandler.exitApp();\n      }\n    }\n  });\n\n  BackHandler = {\n    exitApp: emptyFunction,\n\n    addEventListener: function (\n      eventName: BackPressEventName,\n      handler: Function\n    ): {remove: () => void} {\n      _backPressSubscriptions.add(handler);\n      return {\n        remove: () => BackHandler.removeEventListener(eventName, handler),\n      };\n    },\n\n    removeEventListener: function(\n      eventName: BackPressEventName,\n      handler: Function\n    ): void {\n      _backPressSubscriptions.delete(handler);\n    },\n\n  };\n\n} else {\n\n  BackHandler = {\n    exitApp: emptyFunction,\n    addEventListener() {\n      return {\n        remove: emptyFunction,\n      };\n    },\n    removeEventListener: emptyFunction,\n  };\n\n}\n\nmodule.exports = BackHandler;\n"
  },
  {
    "path": "Libraries/Utilities/BackHandler.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * On Apple TV, this implements back navigation using the TV remote's menu button.\n * On iOS, this just implements a stub.\n *\n * @providesModule BackHandler\n */\n\n'use strict';\n\nconst Platform = require('Platform');\nconst TVEventHandler = require('TVEventHandler');\n\ntype BackPressEventName = $Enum<{\n  backPress: string,\n}>;\n\nfunction emptyFunction() {}\n\n/**\n * Detect hardware button presses for back navigation.\n *\n * Android: Detect hardware back button presses, and programmatically invoke the default back button\n * functionality to exit the app if there are no listeners or if none of the listeners return true.\n *\n * tvOS: Detect presses of the menu button on the TV remote.  (Still to be implemented:\n * programmatically disable menu button handling\n * functionality to exit the app if there are no listeners or if none of the listeners return true.)\n *\n * iOS: Not applicable.\n *\n * The event subscriptions are called in reverse order (i.e. last registered subscription first),\n * and if one subscription returns true then subscriptions registered earlier will not be called.\n *\n * Example:\n *\n * ```javascript\n * BackHandler.addEventListener('hardwareBackPress', function() {\n *  // this.onMainScreen and this.goBack are just examples, you need to use your own implementation here\n *  // Typically you would use the navigator here to go to the last state.\n *\n *  if (!this.onMainScreen()) {\n *    this.goBack();\n *    return true;\n *  }\n *  return false;\n * });\n * ```\n */\nlet BackHandler;\n\nif (Platform.isTVOS) {\n  const _tvEventHandler = new TVEventHandler();\n  var _backPressSubscriptions = new Set();\n\n  _tvEventHandler.enable(this, function(cmp, evt) {\n    if (evt && evt.eventType === 'menu') {\n      var backPressSubscriptions = new Set(_backPressSubscriptions);\n      var invokeDefault = true;\n      var subscriptions = [...backPressSubscriptions].reverse();\n      for (var i = 0; i < subscriptions.length; ++i) {\n        if (subscriptions[i]()) {\n          invokeDefault = false;\n          break;\n        }\n      }\n\n      if (invokeDefault) {\n        BackHandler.exitApp();\n      }\n    }\n  });\n\n  BackHandler = {\n    exitApp: emptyFunction,\n\n    addEventListener: function (\n      eventName: BackPressEventName,\n      handler: Function\n    ): {remove: () => void} {\n      _backPressSubscriptions.add(handler);\n      return {\n        remove: () => BackHandler.removeEventListener(eventName, handler),\n      };\n    },\n\n    removeEventListener: function(\n      eventName: BackPressEventName,\n      handler: Function\n    ): void {\n      _backPressSubscriptions.delete(handler);\n    },\n\n  };\n\n} else {\n\n  BackHandler = {\n    exitApp: emptyFunction,\n    addEventListener() {\n      return {\n        remove: emptyFunction,\n      };\n    },\n    removeEventListener: emptyFunction,\n  };\n\n}\n\nmodule.exports = BackHandler;\n"
  },
  {
    "path": "Libraries/Utilities/CSSVarConfig.js",
    "content": "/**\n * Copyright 2004-present Facebook. All Rights Reserved.\n *\n * @providesModule CSSVarConfig\n */\n'use strict';\n\n// this a partial list of the constants in CSSConstants:: from PHP that are applicable to mobile\n\nmodule.exports = {\n  'fbui-accent-blue': '#5890ff',\n  'fbui-blue-90': '#4e69a2',\n  'fbui-blue-80': '#627aad',\n  'fbui-blue-70': '#758ab7',\n  'fbui-blue-60': '#899bc1',\n  'fbui-blue-50': '#9daccb',\n  'fbui-blue-40': '#b1bdd6',\n  'fbui-blue-30': '#c4cde0',\n  'fbui-blue-20': '#d8deea',\n  'fbui-blue-10': '#ebeef4',\n  'fbui-blue-5': '#f5f7fa',\n  'fbui-blue-2': '#fbfcfd',\n  'fbui-blueblack-90': '#06090f',\n  'fbui-blueblack-80': '#0c121e',\n  'fbui-blueblack-70': '#121b2e',\n  'fbui-blueblack-60': '#18243d',\n  'fbui-blueblack-50': '#1e2d4c',\n  'fbui-blueblack-40': '#23355b',\n  'fbui-blueblack-30': '#293e6b',\n  'fbui-blueblack-20': '#2f477a',\n  'fbui-blueblack-10': '#355089',\n  'fbui-blueblack-5': '#385490',\n  'fbui-blueblack-2': '#3a5795',\n  'fbui-bluegray-90': '#080a10',\n  'fbui-bluegray-80': '#141823',\n  'fbui-bluegray-70': '#232937',\n  'fbui-bluegray-60': '#373e4d',\n  'fbui-bluegray-50': '#4e5665',\n  'fbui-bluegray-40': '#6a7180',\n  'fbui-bluegray-30': '#9197a3',\n  'fbui-bluegray-20': '#bdc1c9',\n  'fbui-bluegray-10': '#dcdee3',\n  'fbui-bluegray-5': '#e9eaed',\n  'fbui-bluegray-2': '#f6f7f8',\n  'fbui-gray-90': '#191919',\n  'fbui-gray-80': '#333333',\n  'fbui-gray-70': '#4c4c4c',\n  'fbui-gray-60': '#666666',\n  'fbui-gray-50': '#7f7f7f',\n  'fbui-gray-40': '#999999',\n  'fbui-gray-30': '#b2b2b2',\n  'fbui-gray-20': '#cccccc',\n  'fbui-gray-10': '#e5e5e5',\n  'fbui-gray-5': '#f2f2f2',\n  'fbui-gray-2': '#fafafa',\n  'fbui-red': '#da2929',\n  'fbui-error': '#ce0d24',\n  'x-mobile-dark-text': '#4e5665',\n  'x-mobile-medium-text': '#6a7180',\n  'x-mobile-light-text': '#9197a3',\n  'x-mobile-base-wash': '#dcdee3',\n};\n"
  },
  {
    "path": "Libraries/Utilities/DebugEnvironment.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DebugEnvironment\n * @flow\n */\n\n'use strict';\n\nmodule.exports = {\n  // When crippled, synchronous JS function calls to native will fail.\n  isCrippledMode: __DEV__ && !global.nativeCallSyncHook,\n};\n"
  },
  {
    "path": "Libraries/Utilities/DeviceInfo.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DeviceInfo\n * @flow\n */\n'use strict';\n\nconst DeviceInfo = require('NativeModules').DeviceInfo;\n\nconst invariant = require('fbjs/lib/invariant');\n\ninvariant(DeviceInfo, 'DeviceInfo native module is not installed correctly');\n\nmodule.exports = DeviceInfo;\n"
  },
  {
    "path": "Libraries/Utilities/Dimensions.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Dimensions\n * @flow\n */\n'use strict';\n\nvar DeviceInfo = require('DeviceInfo');\nvar EventEmitter = require('EventEmitter');\nvar Platform = require('Platform');\nvar RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar eventEmitter = new EventEmitter();\nvar dimensionsInitialized = false;\nvar dimensions = {};\nclass Dimensions {\n  /**\n   * This should only be called from native code by sending the\n   * didUpdateDimensions event.\n   *\n   * @param {object} dims Simple string-keyed object of dimensions to set\n   */\n  static set(dims: {[key:string]: any}): void {\n    // We calculate the window dimensions in JS so that we don't encounter loss of\n    // precision in transferring the dimensions (which could be non-integers) over\n    // the bridge.\n    if (dims && dims.windowPhysicalPixels) {\n      // parse/stringify => Clone hack\n      dims = JSON.parse(JSON.stringify(dims));\n\n      var windowPhysicalPixels = dims.windowPhysicalPixels;\n      dims.window = {\n        width: windowPhysicalPixels.width / windowPhysicalPixels.scale,\n        height: windowPhysicalPixels.height / windowPhysicalPixels.scale,\n        scale: windowPhysicalPixels.scale,\n        fontScale: windowPhysicalPixels.fontScale,\n      };\n      if (Platform.OS === 'android') {\n        // Screen and window dimensions are different on android\n        var screenPhysicalPixels = dims.screenPhysicalPixels;\n        dims.screen = {\n          width: screenPhysicalPixels.width / screenPhysicalPixels.scale,\n          height: screenPhysicalPixels.height / screenPhysicalPixels.scale,\n          scale: screenPhysicalPixels.scale,\n          fontScale: screenPhysicalPixels.fontScale,\n        };\n\n        // delete so no callers rely on this existing\n        delete dims.screenPhysicalPixels;\n      } else {\n        dims.screen = dims.window;\n      }\n      // delete so no callers rely on this existing\n      delete dims.windowPhysicalPixels;\n    }\n\n    Object.assign(dimensions, dims);\n    if (dimensionsInitialized) {\n      // Don't fire 'change' the first time the dimensions are set.\n      eventEmitter.emit('change', {\n        window: dimensions.window,\n        screen: dimensions.screen\n      });\n    } else {\n      dimensionsInitialized = true;\n    }\n  }\n\n  /**\n   * Initial dimensions are set before `runApplication` is called so they should\n   * be available before any other require's are run, but may be updated later.\n   *\n   * Note: Although dimensions are available immediately, they may change (e.g\n   * due to device rotation) so any rendering logic or styles that depend on\n   * these constants should try to call this function on every render, rather\n   * than caching the value (for example, using inline styles rather than\n   * setting a value in a `StyleSheet`).\n   *\n   * Example: `var {height, width} = Dimensions.get('window');`\n   *\n   * @param {string} dim Name of dimension as defined when calling `set`.\n   * @returns {Object?} Value for the dimension.\n   */\n  static get(dim: string): Object {\n    invariant(dimensions[dim], 'No dimension set for key ' + dim);\n    return dimensions[dim];\n  }\n\n  /**\n   * Add an event handler. Supported events:\n   *\n   * - `change`: Fires when a property within the `Dimensions` object changes. The argument\n   *   to the event handler is an object with `window` and `screen` properties whose values\n   *   are the same as the return values of `Dimensions.get('window')` and\n   *   `Dimensions.get('screen')`, respectively.\n   */\n  static addEventListener(\n    type: string,\n    handler: Function\n  ) {\n    invariant(\n      type === 'change',\n      'Trying to subscribe to unknown event: \"%s\"', type\n    );\n    eventEmitter.addListener(type, handler);\n  }\n\n  /**\n   * Remove an event handler.\n   */\n  static removeEventListener(\n    type: string,\n    handler: Function\n  ) {\n    invariant(\n      type === 'change',\n      'Trying to remove listener for unknown event: \"%s\"', type\n    );\n    eventEmitter.removeListener(type, handler);\n  }\n}\n\nDimensions.set(DeviceInfo.Dimensions);\nRCTDeviceEventEmitter.addListener('didUpdateDimensions', function(update) {\n  Dimensions.set(update);\n});\n\nmodule.exports = Dimensions;\n"
  },
  {
    "path": "Libraries/Utilities/HMRClient.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule HMRClient\n * @flow\n */\n'use strict';\n\nconst Platform = require('Platform');\nconst invariant = require('fbjs/lib/invariant');\n\n/**\n * HMR Client that receives from the server HMR updates and propagates them\n * runtime to reflects those changes.\n */\nconst HMRClient = {\n  enable(platform: string, bundleEntry: string, host: string, port: number) {\n    invariant(platform, 'Missing required parameter `platform`');\n    invariant(bundleEntry, 'Missing required paramenter `bundleEntry`');\n    invariant(host, 'Missing required paramenter `host`');\n\n    // need to require WebSocket inside of `enable` function because\n    // this module is defined as a `polyfillGlobal`.\n    // See `InitializeJavascriptAppEngine.js`\n    const WebSocket = require('WebSocket');\n\n    const wsHostPort = port !== null && port !== ''\n      ? `${host}:${port}`\n      : host;\n\n    bundleEntry = bundleEntry.replace(/\\.(bundle|delta)/, '.js');\n\n    // Build the websocket url\n    const wsUrl = `ws://${wsHostPort}/hot?` +\n      `platform=${platform}&` +\n      `bundleEntry=${bundleEntry}`;\n\n    const activeWS = new WebSocket(wsUrl);\n    activeWS.onerror = (e) => {\n      let error = (\n`Hot loading isn't working because it cannot connect to the development server.\n\nTry the following to fix the issue:\n- Ensure that the packager server is running and available on the same network`\n      );\n\n      if (Platform.OS === 'ios') {\n        error += (\n`\n- Ensure that the Packager server URL is correctly set in AppDelegate`\n        );\n      } else {\n        error += (\n`\n- Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices\n- If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device\n- If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server - e.g. 10.0.1.1:8081`\n        );\n      }\n\n      error += (\n`\n\nURL: ${host}:${port}\n\nError: ${e.message}`\n      );\n\n      throw new Error(error);\n    };\n    activeWS.onmessage = ({data}) => {\n      // Moving to top gives errors due to NativeModules not being initialized\n      const HMRLoadingView = require('HMRLoadingView');\n\n      data = JSON.parse(data);\n\n      switch (data.type) {\n        case 'update-start': {\n          HMRLoadingView.showMessage('Hot Loading...');\n          break;\n        }\n        case 'update': {\n          const {\n            modules,\n            sourceMappingURLs,\n            sourceURLs,\n          } = data.body;\n\n          if (Platform.OS === 'ios' || Platform.OS === 'macos') {\n            const RCTRedBox = require('NativeModules').RedBox;\n            RCTRedBox && RCTRedBox.dismiss && RCTRedBox.dismiss();\n          } else {\n            const RCTExceptionsManager = require('NativeModules').ExceptionsManager;\n            RCTExceptionsManager && RCTExceptionsManager.dismissRedbox && RCTExceptionsManager.dismissRedbox();\n          }\n\n          modules.forEach(({id, code}, i) => {\n            code = code + '\\n\\n' + sourceMappingURLs[i];\n\n            // on JSC we need to inject from native for sourcemaps to work\n            // (Safari doesn't support `sourceMappingURL` nor any variant when\n            // evaluating code) but on Chrome we can simply use eval\n            const injectFunction = typeof global.nativeInjectHMRUpdate === 'function'\n              ? global.nativeInjectHMRUpdate\n              : eval; // eslint-disable-line no-eval\n\n            injectFunction(code, sourceURLs[i]);\n          });\n\n          HMRLoadingView.hide();\n          break;\n        }\n        case 'update-done': {\n          HMRLoadingView.hide();\n          break;\n        }\n        case 'error': {\n          HMRLoadingView.hide();\n          throw new Error(data.body.type + ' ' + data.body.description);\n        }\n        default: {\n          throw new Error(`Unexpected message: ${data}`);\n        }\n      }\n    };\n  },\n};\n\nmodule.exports = HMRClient;\n"
  },
  {
    "path": "Libraries/Utilities/HMRLoadingView.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule HMRLoadingView\n * @flow\n */\n\n'use strict';\n\nvar ToastAndroid = require('ToastAndroid');\n\nconst TOAST_SHORT_DELAY = 2000;\n\nclass HMRLoadingView {\n  static _showing: boolean;\n\n  static showMessage(message: string) {\n    if (HMRLoadingView._showing) {\n      return;\n    }\n    ToastAndroid.show(message, ToastAndroid.SHORT);\n    HMRLoadingView._showing = true;\n    setTimeout(() => {\n      HMRLoadingView._showing = false;\n    }, TOAST_SHORT_DELAY);\n  }\n\n  static hide() {\n    // noop\n  }\n}\n\nmodule.exports = HMRLoadingView;\n"
  },
  {
    "path": "Libraries/Utilities/HMRLoadingView.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule HMRLoadingView\n * @flow\n */\n\n'use strict';\n\nconst processColor = require('processColor');\nconst { DevLoadingView } = require('NativeModules');\n\nclass HMRLoadingView {\n  static showMessage(message: string) {\n    DevLoadingView.showMessage(\n      message,\n      processColor('#000000'),\n      processColor('#aaaaaa'),\n    );\n  }\n\n  static hide() {\n    DevLoadingView.hide();\n  }\n}\n\nmodule.exports = HMRLoadingView;\n"
  },
  {
    "path": "Libraries/Utilities/HMRLoadingView.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule HMRLoadingView\n * @flow\n */\n\n'use strict';\n\nconst processColor = require('processColor');\nconst { DevLoadingView } = require('NativeModules');\n\nclass HMRLoadingView {\n  static showMessage(message: string) {\n    DevLoadingView.showMessage(\n      message,\n      processColor('#000000'),\n      processColor('#aaaaaa'),\n    );\n  }\n\n  static hide() {\n    DevLoadingView.hide();\n  }\n}\n\nmodule.exports = HMRLoadingView;\n"
  },
  {
    "path": "Libraries/Utilities/HeapCapture.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule HeapCapture\n * @flow\n */\n'use strict';\n\nvar HeapCapture = {\n  captureHeap: function (path: string) {\n    var error = null;\n    try {\n      global.nativeCaptureHeap(path);\n      console.log('HeapCapture.captureHeap succeeded: ' + path);\n    } catch (e) {\n      console.log('HeapCapture.captureHeap error: ' + e.toString());\n      error = e.toString();\n    }\n    require('NativeModules').JSCHeapCapture.captureComplete(path, error);\n  },\n};\n\nmodule.exports = HeapCapture;\n"
  },
  {
    "path": "Libraries/Utilities/MatrixMath.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule MatrixMath\n * @noflow\n */\n/* eslint-disable space-infix-ops */\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\n\n/**\n * Memory conservative (mutative) matrix math utilities. Uses \"command\"\n * matrices, which are reusable.\n */\nvar MatrixMath = {\n  createIdentityMatrix: function() {\n    return [\n      1,0,0,0,\n      0,1,0,0,\n      0,0,1,0,\n      0,0,0,1\n    ];\n  },\n\n  createCopy: function(m) {\n    return [\n      m[0],  m[1],  m[2],  m[3],\n      m[4],  m[5],  m[6],  m[7],\n      m[8],  m[9],  m[10], m[11],\n      m[12], m[13], m[14], m[15],\n    ];\n  },\n\n  createOrthographic: function(left, right, bottom, top, near, far) {\n    var a = 2 / (right - left);\n    var b = 2 / (top - bottom);\n    var c = -2 / (far - near);\n\n    var tx = -(right + left) / (right - left);\n    var ty = -(top + bottom) / (top - bottom);\n    var tz = -(far + near) / (far - near);\n\n    return [\n        a,  0,  0,  0,\n        0,  b,  0,  0,\n        0,  0,  c,  0,\n        tx, ty, tz, 1\n    ];\n  },\n\n  createFrustum: function(left, right, bottom, top, near, far) {\n    var r_width  = 1 / (right - left);\n    var r_height = 1 / (top - bottom);\n    var r_depth  = 1 / (near - far);\n    var x = 2 * (near * r_width);\n    var y = 2 * (near * r_height);\n    var A = (right + left) * r_width;\n    var B = (top + bottom) * r_height;\n    var C = (far + near) * r_depth;\n    var D = 2 * (far * near * r_depth);\n    return [\n      x, 0, 0, 0,\n      0, y, 0, 0,\n      A, B, C,-1,\n      0, 0, D, 0,\n    ];\n  },\n\n  /**\n   * This create a perspective projection towards negative z\n   * Clipping the z range of [-near, -far]\n   *\n   * @param fovInRadians - field of view in randians\n   */\n  createPerspective: function(fovInRadians, aspect, near, far) {\n    var h = 1 / Math.tan(fovInRadians / 2);\n    var r_depth  = 1 / (near - far);\n    var C = (far + near) * r_depth;\n    var D = 2 * (far * near * r_depth);\n    return [\n      h/aspect, 0, 0, 0,\n      0, h, 0, 0,\n      0, 0, C,-1,\n      0, 0, D, 0,\n    ];\n  },\n\n  createTranslate2d: function(x, y) {\n    var mat = MatrixMath.createIdentityMatrix();\n    MatrixMath.reuseTranslate2dCommand(mat, x, y);\n    return mat;\n  },\n\n  reuseTranslate2dCommand: function(matrixCommand, x, y) {\n    matrixCommand[12] = x;\n    matrixCommand[13] = y;\n  },\n\n  reuseTranslate3dCommand: function(matrixCommand, x, y, z) {\n    matrixCommand[12] = x;\n    matrixCommand[13] = y;\n    matrixCommand[14] = z;\n  },\n\n  createScale: function(factor) {\n    var mat = MatrixMath.createIdentityMatrix();\n    MatrixMath.reuseScaleCommand(mat, factor);\n    return mat;\n  },\n\n  reuseScaleCommand: function(matrixCommand, factor) {\n    matrixCommand[0] = factor;\n    matrixCommand[5] = factor;\n  },\n\n  reuseScale3dCommand: function(matrixCommand, x, y, z) {\n    matrixCommand[0] = x;\n    matrixCommand[5] = y;\n    matrixCommand[10] = z;\n  },\n\n  reusePerspectiveCommand: function(matrixCommand, p) {\n    matrixCommand[11] = -1 / p;\n  },\n\n  reuseScaleXCommand(matrixCommand, factor) {\n    matrixCommand[0] = factor;\n  },\n\n  reuseScaleYCommand(matrixCommand, factor) {\n    matrixCommand[5] = factor;\n  },\n\n  reuseScaleZCommand(matrixCommand, factor) {\n    matrixCommand[10] = factor;\n  },\n\n  reuseRotateXCommand: function(matrixCommand, radians) {\n    matrixCommand[5] = Math.cos(radians);\n    matrixCommand[6] = Math.sin(radians);\n    matrixCommand[9] = -Math.sin(radians);\n    matrixCommand[10] = Math.cos(radians);\n  },\n\n  reuseRotateYCommand: function(matrixCommand, amount) {\n    matrixCommand[0] = Math.cos(amount);\n    matrixCommand[2] = -Math.sin(amount);\n    matrixCommand[8] = Math.sin(amount);\n    matrixCommand[10] = Math.cos(amount);\n  },\n\n  // http://www.w3.org/TR/css3-transforms/#recomposing-to-a-2d-matrix\n  reuseRotateZCommand: function(matrixCommand, radians) {\n    matrixCommand[0] = Math.cos(radians);\n    matrixCommand[1] = Math.sin(radians);\n    matrixCommand[4] = -Math.sin(radians);\n    matrixCommand[5] = Math.cos(radians);\n  },\n\n  createRotateZ: function(radians) {\n    var mat = MatrixMath.createIdentityMatrix();\n    MatrixMath.reuseRotateZCommand(mat, radians);\n    return mat;\n  },\n\n  reuseSkewXCommand: function(matrixCommand, radians) {\n    matrixCommand[4] = Math.tan(radians);\n  },\n\n  reuseSkewYCommand: function(matrixCommand, radians) {\n    matrixCommand[1] = Math.tan(radians);\n  },\n\n  multiplyInto: function(out, a, b) {\n    var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n      a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n      a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n      a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\n    var b0  = b[0], b1 = b[1], b2 = b[2], b3 = b[3];\n    out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n    out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n    out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n    out[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n    b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7];\n    out[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n    out[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n    out[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n    out[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n    b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11];\n    out[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n    out[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n    out[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n    out[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n    b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15];\n    out[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n    out[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n    out[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n    out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n  },\n\n  determinant(matrix: Array<number>): number {\n    var [\n      m00, m01, m02, m03,\n      m10, m11, m12, m13,\n      m20, m21, m22, m23,\n      m30, m31, m32, m33\n    ] = matrix;\n    return (\n      m03 * m12 * m21 * m30 - m02 * m13 * m21 * m30 -\n      m03 * m11 * m22 * m30 + m01 * m13 * m22 * m30 +\n      m02 * m11 * m23 * m30 - m01 * m12 * m23 * m30 -\n      m03 * m12 * m20 * m31 + m02 * m13 * m20 * m31 +\n      m03 * m10 * m22 * m31 - m00 * m13 * m22 * m31 -\n      m02 * m10 * m23 * m31 + m00 * m12 * m23 * m31 +\n      m03 * m11 * m20 * m32 - m01 * m13 * m20 * m32 -\n      m03 * m10 * m21 * m32 + m00 * m13 * m21 * m32 +\n      m01 * m10 * m23 * m32 - m00 * m11 * m23 * m32 -\n      m02 * m11 * m20 * m33 + m01 * m12 * m20 * m33 +\n      m02 * m10 * m21 * m33 - m00 * m12 * m21 * m33 -\n      m01 * m10 * m22 * m33 + m00 * m11 * m22 * m33\n    );\n  },\n\n  /**\n   * Inverse of a matrix. Multiplying by the inverse is used in matrix math\n   * instead of division.\n   *\n   * Formula from:\n   * http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n   */\n  inverse(matrix: Array<number>): Array<number> {\n    var det = MatrixMath.determinant(matrix);\n    if (!det) {\n      return matrix;\n    }\n    var [\n      m00, m01, m02, m03,\n      m10, m11, m12, m13,\n      m20, m21, m22, m23,\n      m30, m31, m32, m33\n    ] = matrix;\n    return [\n      (m12*m23*m31 - m13*m22*m31 + m13*m21*m32 - m11*m23*m32 - m12*m21*m33 + m11*m22*m33) / det,\n      (m03*m22*m31 - m02*m23*m31 - m03*m21*m32 + m01*m23*m32 + m02*m21*m33 - m01*m22*m33) / det,\n      (m02*m13*m31 - m03*m12*m31 + m03*m11*m32 - m01*m13*m32 - m02*m11*m33 + m01*m12*m33) / det,\n      (m03*m12*m21 - m02*m13*m21 - m03*m11*m22 + m01*m13*m22 + m02*m11*m23 - m01*m12*m23) / det,\n      (m13*m22*m30 - m12*m23*m30 - m13*m20*m32 + m10*m23*m32 + m12*m20*m33 - m10*m22*m33) / det,\n      (m02*m23*m30 - m03*m22*m30 + m03*m20*m32 - m00*m23*m32 - m02*m20*m33 + m00*m22*m33) / det,\n      (m03*m12*m30 - m02*m13*m30 - m03*m10*m32 + m00*m13*m32 + m02*m10*m33 - m00*m12*m33) / det,\n      (m02*m13*m20 - m03*m12*m20 + m03*m10*m22 - m00*m13*m22 - m02*m10*m23 + m00*m12*m23) / det,\n      (m11*m23*m30 - m13*m21*m30 + m13*m20*m31 - m10*m23*m31 - m11*m20*m33 + m10*m21*m33) / det,\n      (m03*m21*m30 - m01*m23*m30 - m03*m20*m31 + m00*m23*m31 + m01*m20*m33 - m00*m21*m33) / det,\n      (m01*m13*m30 - m03*m11*m30 + m03*m10*m31 - m00*m13*m31 - m01*m10*m33 + m00*m11*m33) / det,\n      (m03*m11*m20 - m01*m13*m20 - m03*m10*m21 + m00*m13*m21 + m01*m10*m23 - m00*m11*m23) / det,\n      (m12*m21*m30 - m11*m22*m30 - m12*m20*m31 + m10*m22*m31 + m11*m20*m32 - m10*m21*m32) / det,\n      (m01*m22*m30 - m02*m21*m30 + m02*m20*m31 - m00*m22*m31 - m01*m20*m32 + m00*m21*m32) / det,\n      (m02*m11*m30 - m01*m12*m30 - m02*m10*m31 + m00*m12*m31 + m01*m10*m32 - m00*m11*m32) / det,\n      (m01*m12*m20 - m02*m11*m20 + m02*m10*m21 - m00*m12*m21 - m01*m10*m22 + m00*m11*m22) / det\n    ];\n  },\n\n  /**\n   * Turns columns into rows and rows into columns.\n   */\n   transpose(m: Array<number>): Array<number> {\n    return [\n      m[0], m[4], m[8],  m[12],\n      m[1], m[5], m[9],  m[13],\n      m[2], m[6], m[10], m[14],\n      m[3], m[7], m[11], m[15]\n    ];\n  },\n\n  /**\n   * Based on: http://tog.acm.org/resources/GraphicsGems/gemsii/unmatrix.c\n   */\n  multiplyVectorByMatrix(\n    v: Array<number>,\n    m: Array<number>\n  ): Array<number> {\n    var [vx, vy, vz, vw] = v;\n    return [\n      vx * m[0] + vy * m[4] + vz * m[8]  + vw * m[12],\n      vx * m[1] + vy * m[5] + vz * m[9]  + vw * m[13],\n      vx * m[2] + vy * m[6] + vz * m[10] + vw * m[14],\n      vx * m[3] + vy * m[7] + vz * m[11] + vw * m[15]\n    ];\n  },\n\n  /**\n   * From: https://code.google.com/p/webgl-mjs/source/browse/mjs.js\n   */\n  v3Length(a: Array<number>): number {\n    return Math.sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]);\n  },\n\n  /**\n   * Based on: https://code.google.com/p/webgl-mjs/source/browse/mjs.js\n   */\n   v3Normalize(\n     vector: Array<number>,\n     v3Length: number\n    ): Array<number> {\n    var im = 1 / (v3Length || MatrixMath.v3Length(vector));\n    return [\n      vector[0] * im,\n      vector[1] * im,\n      vector[2] * im\n    ];\n  },\n\n  /**\n   * The dot product of a and b, two 3-element vectors.\n   * From: https://code.google.com/p/webgl-mjs/source/browse/mjs.js\n   */\n  v3Dot(a, b) {\n    return a[0] * b[0] +\n           a[1] * b[1] +\n           a[2] * b[2];\n  },\n\n  /**\n   * From:\n   * http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp\n   */\n  v3Combine(\n    a: Array<number>,\n    b: Array<number>,\n    aScale: number,\n    bScale: number\n  ): Array<number> {\n    return [\n      aScale * a[0] + bScale * b[0],\n      aScale * a[1] + bScale * b[1],\n      aScale * a[2] + bScale * b[2]\n    ];\n  },\n\n  /**\n   * From:\n   * http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp\n   */\n  v3Cross(a: Array<number>, b: Array<number>): Array<number> {\n    return [\n      a[1] * b[2] - a[2] * b[1],\n      a[2] * b[0] - a[0] * b[2],\n      a[0] * b[1] - a[1] * b[0]\n    ];\n  },\n\n  /**\n   * Based on:\n   * http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/\n   * and:\n   * http://quat.zachbennett.com/\n   *\n   * Note that this rounds degrees to the thousandth of a degree, due to\n   * floating point errors in the creation of the quaternion.\n   *\n   * Also note that this expects the qw value to be last, not first.\n   *\n   * Also, when researching this, remember that:\n   * yaw   === heading            === z-axis\n   * pitch === elevation/attitude === y-axis\n   * roll  === bank               === x-axis\n   */\n  quaternionToDegreesXYZ(q: Array<number>, matrix, row): Array<number> {\n    var [qx, qy, qz, qw] = q;\n    var qw2 = qw * qw;\n    var qx2 = qx * qx;\n    var qy2 = qy * qy;\n    var qz2 = qz * qz;\n    var test = qx * qy + qz * qw;\n    var unit = qw2 + qx2 + qy2 + qz2;\n    var conv = 180 / Math.PI;\n\n    if (test > 0.49999 * unit) {\n      return [0, 2 * Math.atan2(qx, qw) * conv, 90];\n    }\n    if (test < -0.49999 * unit) {\n      return [0, -2 * Math.atan2(qx, qw) * conv, -90];\n    }\n\n    return [\n      MatrixMath.roundTo3Places(\n        Math.atan2(2*qx*qw-2*qy*qz,1-2*qx2-2*qz2) * conv\n      ),\n      MatrixMath.roundTo3Places(\n        Math.atan2(2*qy*qw-2*qx*qz,1-2*qy2-2*qz2) * conv\n      ),\n      MatrixMath.roundTo3Places(\n        Math.asin(2*qx*qy+2*qz*qw) * conv\n      )\n    ];\n  },\n\n  /**\n   * Based on:\n   * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round\n   */\n  roundTo3Places(n: number): number {\n    var arr = n.toString().split('e');\n    return Math.round(arr[0] + 'e' + (arr[1] ? (+arr[1] - 3) : 3)) * 0.001;\n  },\n\n  /**\n   * Decompose a matrix into separate transform values, for use on platforms\n   * where applying a precomposed matrix is not possible, and transforms are\n   * applied in an inflexible ordering (e.g. Android).\n   *\n   * Implementation based on\n   * http://www.w3.org/TR/css3-transforms/#decomposing-a-2d-matrix\n   * http://www.w3.org/TR/css3-transforms/#decomposing-a-3d-matrix\n   * which was based on\n   * http://tog.acm.org/resources/GraphicsGems/gemsii/unmatrix.c\n   */\n  decomposeMatrix(transformMatrix: Array<number>): ?Object {\n\n    invariant(\n      transformMatrix.length === 16,\n      'Matrix decomposition needs a list of 3d matrix values, received %s',\n      transformMatrix\n    );\n\n    // output values\n    var perspective = [];\n    var quaternion = [];\n    var scale = [];\n    var skew = [];\n    var translation = [];\n\n    // create normalized, 2d array matrix\n    // and normalized 1d array perspectiveMatrix with redefined 4th column\n    if (!transformMatrix[15]) {\n      return;\n    }\n    var matrix = [];\n    var perspectiveMatrix = [];\n    for (var i = 0; i < 4; i++) {\n      matrix.push([]);\n      for (var j = 0; j < 4; j++) {\n        var value = transformMatrix[(i * 4) + j] / transformMatrix[15];\n        matrix[i].push(value);\n        perspectiveMatrix.push(j === 3 ? 0 : value);\n      }\n    }\n    perspectiveMatrix[15] = 1;\n\n    // test for singularity of upper 3x3 part of the perspective matrix\n    if (!MatrixMath.determinant(perspectiveMatrix)) {\n      return;\n    }\n\n    // isolate perspective\n    if (matrix[0][3] !== 0 || matrix[1][3] !== 0 || matrix[2][3] !== 0) {\n      // rightHandSide is the right hand side of the equation.\n      // rightHandSide is a vector, or point in 3d space relative to the origin.\n      var rightHandSide = [\n        matrix[0][3],\n        matrix[1][3],\n        matrix[2][3],\n        matrix[3][3]\n      ];\n\n      // Solve the equation by inverting perspectiveMatrix and multiplying\n      // rightHandSide by the inverse.\n      var inversePerspectiveMatrix = MatrixMath.inverse(\n        perspectiveMatrix\n      );\n      var transposedInversePerspectiveMatrix = MatrixMath.transpose(\n        inversePerspectiveMatrix\n      );\n      var perspective = MatrixMath.multiplyVectorByMatrix(\n        rightHandSide,\n        transposedInversePerspectiveMatrix\n      );\n    } else {\n      // no perspective\n      perspective[0] = perspective[1] = perspective[2] = 0;\n      perspective[3] = 1;\n    }\n\n    // translation is simple\n    for (var i = 0; i < 3; i++) {\n      translation[i] = matrix[3][i];\n    }\n\n    // Now get scale and shear.\n    // 'row' is a 3 element array of 3 component vectors\n    var row = [];\n    for (i = 0; i < 3; i++) {\n      row[i] = [\n        matrix[i][0],\n        matrix[i][1],\n        matrix[i][2]\n      ];\n    }\n\n    // Compute X scale factor and normalize first row.\n    scale[0] = MatrixMath.v3Length(row[0]);\n    row[0] = MatrixMath.v3Normalize(row[0], scale[0]);\n\n    // Compute XY shear factor and make 2nd row orthogonal to 1st.\n    skew[0] = MatrixMath.v3Dot(row[0], row[1]);\n    row[1] = MatrixMath.v3Combine(row[1], row[0], 1.0, -skew[0]);\n\n    // Compute XY shear factor and make 2nd row orthogonal to 1st.\n    skew[0] = MatrixMath.v3Dot(row[0], row[1]);\n    row[1] = MatrixMath.v3Combine(row[1], row[0], 1.0, -skew[0]);\n\n    // Now, compute Y scale and normalize 2nd row.\n    scale[1] = MatrixMath.v3Length(row[1]);\n    row[1] = MatrixMath.v3Normalize(row[1], scale[1]);\n    skew[0] /= scale[1];\n\n    // Compute XZ and YZ shears, orthogonalize 3rd row\n    skew[1] = MatrixMath.v3Dot(row[0], row[2]);\n    row[2] = MatrixMath.v3Combine(row[2], row[0], 1.0, -skew[1]);\n    skew[2] = MatrixMath.v3Dot(row[1], row[2]);\n    row[2] = MatrixMath.v3Combine(row[2], row[1], 1.0, -skew[2]);\n\n    // Next, get Z scale and normalize 3rd row.\n    scale[2] = MatrixMath.v3Length(row[2]);\n    row[2] = MatrixMath.v3Normalize(row[2], scale[2]);\n    skew[1] /= scale[2];\n    skew[2] /= scale[2];\n\n    // At this point, the matrix (in rows) is orthonormal.\n    // Check for a coordinate system flip.  If the determinant\n    // is -1, then negate the matrix and the scaling factors.\n    var pdum3 = MatrixMath.v3Cross(row[1], row[2]);\n    if (MatrixMath.v3Dot(row[0], pdum3) < 0) {\n      for (i = 0; i < 3; i++) {\n        scale[i] *= -1;\n        row[i][0] *= -1;\n        row[i][1] *= -1;\n        row[i][2] *= -1;\n      }\n    }\n\n    // Now, get the rotations out\n    quaternion[0] =\n      0.5 * Math.sqrt(Math.max(1 + row[0][0] - row[1][1] - row[2][2], 0));\n    quaternion[1] =\n      0.5 * Math.sqrt(Math.max(1 - row[0][0] + row[1][1] - row[2][2], 0));\n    quaternion[2] =\n      0.5 * Math.sqrt(Math.max(1 - row[0][0] - row[1][1] + row[2][2], 0));\n    quaternion[3] =\n      0.5 * Math.sqrt(Math.max(1 + row[0][0] + row[1][1] + row[2][2], 0));\n\n    if (row[2][1] > row[1][2]) {\n      quaternion[0] = -quaternion[0];\n    }\n    if (row[0][2] > row[2][0]) {\n      quaternion[1] = -quaternion[1];\n    }\n    if (row[1][0] > row[0][1]) {\n      quaternion[2] = -quaternion[2];\n    }\n\n    // correct for occasional, weird Euler synonyms for 2d rotation\n    var rotationDegrees;\n    if (\n      quaternion[0] < 0.001 && quaternion[0] >= 0 &&\n      quaternion[1] < 0.001 && quaternion[1] >= 0\n    ) {\n      // this is a 2d rotation on the z-axis\n      rotationDegrees = [0, 0, MatrixMath.roundTo3Places(\n        Math.atan2(row[0][1], row[0][0]) * 180 / Math.PI\n      )];\n    } else {\n      rotationDegrees = MatrixMath.quaternionToDegreesXYZ(quaternion, matrix, row);\n    }\n\n    // expose both base data and convenience names\n    return {\n      rotationDegrees,\n      perspective,\n      quaternion,\n      scale,\n      skew,\n      translation,\n\n      rotate: rotationDegrees[2],\n      rotateX: rotationDegrees[0],\n      rotateY: rotationDegrees[1],\n      scaleX: scale[0],\n      scaleY: scale[1],\n      translateX: translation[0],\n      translateY: translation[1],\n    };\n  },\n\n};\n\nmodule.exports = MatrixMath;\n"
  },
  {
    "path": "Libraries/Utilities/PerformanceLogger.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PerformanceLogger\n * @flow\n * @format\n */\n'use strict';\n\nconst Systrace = require('Systrace');\n\nconst infoLog = require('infoLog');\nconst performanceNow =\n  /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an\n   * error found when Flow v0.54 was deployed. To see the error delete this\n   * comment and run Flow. */\n  global.nativePerformanceNow || require('fbjs/lib/performanceNow');\n\ntype Timespan = {\n  description?: string,\n  totalTime?: number,\n  startTime?: number,\n  endTime?: number,\n};\n\nlet timespans: {[key: string]: Timespan} = {};\nlet extras: {[key: string]: any} = {};\nconst cookies: {[key: string]: number} = {};\n\nconst PRINT_TO_CONSOLE = false;\n\n/**\n * This is meant to collect and log performance data in production, which means\n * it needs to have minimal overhead.\n */\nconst PerformanceLogger = {\n  addTimespan(key: string, lengthInMs: number, description?: string) {\n    if (timespans[key]) {\n      if (__DEV__) {\n        infoLog(\n          'PerformanceLogger: Attempting to add a timespan that already exists ',\n          key,\n        );\n      }\n      return;\n    }\n\n    timespans[key] = {\n      description: description,\n      totalTime: lengthInMs,\n    };\n  },\n\n  startTimespan(key: string, description?: string) {\n    if (timespans[key]) {\n      if (__DEV__) {\n        infoLog(\n          'PerformanceLogger: Attempting to start a timespan that already exists ',\n          key,\n        );\n      }\n      return;\n    }\n\n    timespans[key] = {\n      description: description,\n      startTime: performanceNow(),\n    };\n    cookies[key] = Systrace.beginAsyncEvent(key);\n    if (__DEV__ && PRINT_TO_CONSOLE) {\n      infoLog('PerformanceLogger.js', 'start: ' + key);\n    }\n  },\n\n  stopTimespan(key: string) {\n    const timespan = timespans[key];\n    if (!timespan || !timespan.startTime) {\n      if (__DEV__) {\n        infoLog(\n          'PerformanceLogger: Attempting to end a timespan that has not started ',\n          key,\n        );\n      }\n      return;\n    }\n    if (timespan.endTime) {\n      if (__DEV__) {\n        infoLog(\n          'PerformanceLogger: Attempting to end a timespan that has already ended ',\n          key,\n        );\n      }\n      return;\n    }\n\n    timespan.endTime = performanceNow();\n    timespan.totalTime = timespan.endTime - (timespan.startTime || 0);\n    if (__DEV__ && PRINT_TO_CONSOLE) {\n      infoLog('PerformanceLogger.js', 'end: ' + key);\n    }\n\n    Systrace.endAsyncEvent(key, cookies[key]);\n    delete cookies[key];\n  },\n\n  clear() {\n    timespans = {};\n    extras = {};\n  },\n\n  clearCompleted() {\n    for (const key in timespans) {\n      if (timespans[key].totalTime) {\n        delete timespans[key];\n      }\n    }\n    extras = {};\n  },\n\n  clearExceptTimespans(keys: Array<string>) {\n    timespans = Object.keys(timespans).reduce(function(previous, key) {\n      if (keys.indexOf(key) !== -1) {\n        previous[key] = timespans[key];\n      }\n      return previous;\n    }, {});\n    extras = {};\n  },\n\n  currentTimestamp() {\n    return performanceNow();\n  },\n\n  getTimespans() {\n    return timespans;\n  },\n\n  hasTimespan(key: string) {\n    return !!timespans[key];\n  },\n\n  logTimespans() {\n    for (const key in timespans) {\n      if (timespans[key].totalTime) {\n        infoLog(key + ': ' + timespans[key].totalTime + 'ms');\n      }\n    }\n  },\n\n  addTimespans(newTimespans: Array<number>, labels: Array<string>) {\n    for (let ii = 0, l = newTimespans.length; ii < l; ii += 2) {\n      const label = labels[ii / 2];\n      PerformanceLogger.addTimespan(\n        label,\n        newTimespans[ii + 1] - newTimespans[ii],\n        label,\n      );\n    }\n  },\n\n  setExtra(key: string, value: any) {\n    if (extras[key]) {\n      if (__DEV__) {\n        infoLog(\n          'PerformanceLogger: Attempting to set an extra that already exists ',\n          {key, currentValue: extras[key], attemptedValue: value},\n        );\n      }\n      return;\n    }\n    extras[key] = value;\n  },\n\n  getExtras() {\n    return extras;\n  },\n};\n\nmodule.exports = PerformanceLogger;\n"
  },
  {
    "path": "Libraries/Utilities/PixelRatio.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PixelRatio\n * @flow\n */\n'use strict';\n\nvar Dimensions = require('Dimensions');\n\n/**\n * PixelRatio class gives access to the device pixel density.\n *\n * ## Fetching a correctly sized image\n *\n * You should get a higher resolution image if you are on a high pixel density\n * device. A good rule of thumb is to multiply the size of the image you display\n * by the pixel ratio.\n *\n * ```\n * var image = getImage({\n *   width: PixelRatio.getPixelSizeForLayoutSize(200),\n *   height: PixelRatio.getPixelSizeForLayoutSize(100),\n * });\n * <Image source={image} style={{width: 200, height: 100}} />\n * ```\n *\n * ## Pixel grid snapping\n *\n * In iOS, you can specify positions and dimensions for elements with arbitrary\n * precision, for example 29.674825. But, ultimately the physical display only\n * have a fixed number of pixels, for example 640×960 for iPhone 4 or 750×1334\n * for iPhone 6. iOS tries to be as faithful as possible to the user value by\n * spreading one original pixel into multiple ones to trick the eye. The\n * downside of this technique is that it makes the resulting element look\n * blurry.\n *\n * In practice, we found out that developers do not want this feature and they\n * have to work around it by doing manual rounding in order to avoid having\n * blurry elements. In React Native, we are rounding all the pixels\n * automatically.\n *\n * We have to be careful when to do this rounding. You never want to work with\n * rounded and unrounded values at the same time as you're going to accumulate\n * rounding errors. Having even one rounding error is deadly because a one\n * pixel border may vanish or be twice as big.\n *\n * In React Native, everything in JavaScript and within the layout engine works\n * with arbitrary precision numbers. It's only when we set the position and\n * dimensions of the native element on the main thread that we round. Also,\n * rounding is done relative to the root rather than the parent, again to avoid\n * accumulating rounding errors.\n *\n */\nclass PixelRatio {\n  /**\n   * Returns the device pixel density. Some examples:\n   *\n   *   - PixelRatio.get() === 1\n   *     - mdpi Android devices (160 dpi)\n   *   - PixelRatio.get() === 1.5\n   *     - hdpi Android devices (240 dpi)\n   *   - PixelRatio.get() === 2\n   *     - iPhone 4, 4S\n   *     - iPhone 5, 5c, 5s\n   *     - iPhone 6\n   *     - xhdpi Android devices (320 dpi)\n   *   - PixelRatio.get() === 3\n   *     - iPhone 6 plus\n   *     - xxhdpi Android devices (480 dpi)\n   *   - PixelRatio.get() === 3.5\n   *     - Nexus 6\n   */\n  static get(): number {\n    return Dimensions.get('window').scale;\n  }\n\n  /**\n   * Returns the scaling factor for font sizes. This is the ratio that is used to calculate the\n   * absolute font size, so any elements that heavily depend on that should use this to do\n   * calculations.\n   *\n   * If a font scale is not set, this returns the device pixel ratio.\n   *\n   * Currently this is only implemented on Android and reflects the user preference set in\n   * Settings > Display > Font size, on iOS it will always return the default pixel ratio.\n   * @platform android\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   *\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    var ratio = PixelRatio.get();\n    return Math.round(layoutSize * ratio) / ratio;\n  }\n\n  // No-op for iOS, but used on the web. Should not be documented.\n  static startDetecting() {}\n}\n\nmodule.exports = PixelRatio;\n"
  },
  {
    "path": "Libraries/Utilities/Platform.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Platform\n * @flow\n */\n\n'use strict';\n\nconst NativeModules = require('NativeModules');\n\nconst Platform = {\n  OS: 'android',\n  get Version() {\n    const constants = NativeModules.PlatformConstants;\n    return constants && constants.Version;\n  },\n  get isTesting(): boolean {\n    const constants = NativeModules.PlatformConstants;\n    return constants && constants.isTesting;\n  },\n  select: (obj: Object) => 'android' in obj ? obj.android : obj.default,\n};\n\nmodule.exports = Platform;\n"
  },
  {
    "path": "Libraries/Utilities/Platform.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Platform\n * @flow\n */\n\n'use strict';\n\nconst NativeModules = require('NativeModules');\n\nconst Platform = {\n  OS: 'ios',\n  get Version() {\n    const constants = NativeModules.PlatformConstants;\n    return constants && constants.osVersion;\n  },\n  get isPad() {\n    const constants = NativeModules.PlatformConstants;\n    return constants ? constants.interfaceIdiom === 'pad' : false;\n  },\n  get isTVOS() {\n    const constants = NativeModules.PlatformConstants;\n    return constants ? constants.interfaceIdiom === 'tv' : false;\n  },\n  get isTesting(): boolean {\n    const constants = NativeModules.PlatformConstants;\n    return constants && constants.isTesting;\n  },\n  select: (obj: Object) => 'ios' in obj ? obj.ios : obj.default,\n};\n\nmodule.exports = Platform;\n"
  },
  {
    "path": "Libraries/Utilities/Platform.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Platform\n * @flow\n */\n\n'use strict';\n\nvar Platform = {\n  OS: 'macos',\n  select: (obj: Object) => obj.macos,\n};\n\nmodule.exports = Platform;\n"
  },
  {
    "path": "Libraries/Utilities/PlatformOS.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PlatformOS\n * @flow\n */\n\n'use strict';\n\nexport type PlatformSelectSpec<A, I> = {|\n  android: A,\n  ios: I,\n|};\n\nconst PlatformOS = {\n  OS: 'android',\n  select: <A, I> (spec: PlatformSelectSpec<A, I>): A | I => spec.android,\n};\n\nmodule.exports = PlatformOS;\n"
  },
  {
    "path": "Libraries/Utilities/PlatformOS.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PlatformOS\n * @flow\n */\n\n'use strict';\n\nexport type PlatformSelectSpec<A, I> = {|\n  android: A,\n  ios: I,\n|};\n\nconst PlatformOS = {\n  OS: 'ios',\n  select: <A, I> (spec: PlatformSelectSpec<A, I>): A | I => spec.ios,\n};\n\nmodule.exports = PlatformOS;\n"
  },
  {
    "path": "Libraries/Utilities/RCTLog.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RCTLog\n * @flow\n */\n'use strict';\n\nconst invariant = require('fbjs/lib/invariant');\n\nconst levelsMap = {\n  log: 'log',\n  info: 'info',\n  warn: 'warn',\n  error: 'error',\n  fatal: 'error',\n};\n\nlet warningHandler: ?(Array<any> => void) = null;\n\nconst RCTLog = {\n  // level one of log, info, warn, error, mustfix\n  logIfNoNativeHook(level: string, ...args: Array<any>): void {\n    // We already printed in the native console, so only log here if using a js debugger\n    if (typeof global.nativeLoggingHook === 'undefined') {\n      RCTLog.logToConsole(level, ...args);\n    } else {\n      // Report native warnings to YellowBox\n      if (warningHandler && level === 'warn') {\n        warningHandler(...args);\n      }\n    }\n  },\n\n  // Log to console regardless of nativeLoggingHook\n  logToConsole(level: string, ...args: Array<any>): void {\n    const logFn = levelsMap[level];\n    invariant(\n      logFn,\n      'Level \"' + level + '\" not one of ' + Object.keys(levelsMap).toString()\n    );\n\n    console[logFn](...args);\n  },\n\n  setWarningHandler(handler: typeof warningHandler): void {\n    warningHandler = handler;\n  }\n};\n\nmodule.exports = RCTLog;\n"
  },
  {
    "path": "Libraries/Utilities/SceneTracker.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SceneTracker\n * @flow\n */\n\n'use strict';\n\ntype Scene = {name: string};\n\nlet _listeners: Array<(scene: Scene) => void> = [];\n\nlet _activeScene = {name: 'default'};\n\nconst SceneTracker = {\n  setActiveScene(scene: Scene) {\n    _activeScene = scene;\n    _listeners.forEach((listener) => listener(_activeScene));\n  },\n\n  getActiveScene(): Scene {\n    return _activeScene;\n  },\n\n  addActiveSceneChangedListener(callback: (scene: Scene) => void): {remove: () => void} {\n    _listeners.push(callback);\n    return {\n      remove: () => {\n        _listeners = _listeners.filter((listener) => callback !== listener);\n      },\n    };\n  },\n};\n\nmodule.exports = SceneTracker;\n"
  },
  {
    "path": "Libraries/Utilities/__mocks__/BackHandler.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nconst _backPressSubscriptions = new Set();\n\nconst BackHandler = {\n  exitApp: jest.fn(),\n\n  addEventListener: function (\n    eventName: BackPressEventName,\n    handler: Function\n  ): {remove: () => void} {\n    _backPressSubscriptions.add(handler);\n    return {\n      remove: () => BackHandler.removeEventListener(eventName, handler),\n    };\n  },\n\n  removeEventListener: function(\n    eventName: BackPressEventName,\n    handler: Function\n  ): void {\n    _backPressSubscriptions.delete(handler);\n  },\n\n\n  mockPressBack: function() {\n    let invokeDefault = true;\n    const subscriptions = [..._backPressSubscriptions].reverse();\n    for (let i = 0; i < subscriptions.length; ++i) {\n      if (subscriptions[i]()) {\n        invokeDefault = false;\n        break;\n      }\n    }\n\n    if (invokeDefault) {\n      BackHandler.exitApp();\n    }\n  },\n};\n\nmodule.exports = BackHandler;\n"
  },
  {
    "path": "Libraries/Utilities/__mocks__/PixelRatio.js",
    "content": "/**\n * Copyright 2004-present Facebook. All Rights Reserved.\n */\n\n'use strict';\n\nconst PixelRatio = {\n  get: jest.fn().mockReturnValue(2),\n  getFontScale: jest.fn(() => PixelRatio.get()),\n  getPixelSizeForLayoutSize: jest.fn(layoutSize => Math.round(layoutSize * PixelRatio.get())),\n  roundToNearestPixel: jest.fn(layoutSize => {\n    const ratio = PixelRatio.get();\n    return Math.round(layoutSize * ratio) / ratio;\n  }),\n  startDetecting: jest.fn(),\n};\n\nmodule.exports = PixelRatio;\n"
  },
  {
    "path": "Libraries/Utilities/__tests__/MatrixMath-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nvar MatrixMath = require('MatrixMath');\n\nfunction degreesToRadians(degrees) {\n  return degrees * Math.PI / 180;\n}\n\nfunction convertZeroes(degrees) {\n  return degrees.map(value => value === -0 ? 0 : value);\n}\n\ndescribe('MatrixMath', () => {\n\n  it('decomposes a 4x4 matrix to produce accurate Z-axis angles', () => {\n    expect(MatrixMath.decomposeMatrix([\n      1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1\n    ]).rotationDegrees).toEqual([0, 0, 0]);\n\n    [30, 45, 60, 75, 90, 100, 115, 120, 133, 167].forEach(angle => {\n      var mat = MatrixMath.createRotateZ(degreesToRadians(angle));\n      expect(convertZeroes(MatrixMath.decomposeMatrix(mat).rotationDegrees))\n        .toEqual([0, 0, angle]);\n\n      mat = MatrixMath.createRotateZ(degreesToRadians(-angle));\n      expect(convertZeroes(MatrixMath.decomposeMatrix(mat).rotationDegrees))\n        .toEqual([0, 0, -angle]);\n    });\n\n    expect(MatrixMath.decomposeMatrix(\n      MatrixMath.createRotateZ(degreesToRadians(180))\n    ).rotationDegrees).toEqual([0, 0, 180]);\n\n    // all values are between 0 and 180;\n    // change of sign and direction in the third and fourth quadrant\n    expect(MatrixMath.decomposeMatrix(\n      MatrixMath.createRotateZ(degreesToRadians(222))\n    ).rotationDegrees).toEqual([0, 0, -138]);\n\n    expect(MatrixMath.decomposeMatrix(\n      MatrixMath.createRotateZ(degreesToRadians(270))\n    ).rotationDegrees).toEqual([0, 0, -90]);\n\n    // 360 is expressed as 0\n    expect(MatrixMath.decomposeMatrix(\n      MatrixMath.createRotateZ(degreesToRadians(360))\n    ).rotationDegrees).toEqual([0, 0, -0]);\n\n    expect(MatrixMath.decomposeMatrix(\n      MatrixMath.createRotateZ(degreesToRadians(33.33333333))\n    ).rotationDegrees).toEqual([0, 0, 33.333]);\n\n    expect(MatrixMath.decomposeMatrix(\n      MatrixMath.createRotateZ(degreesToRadians(86.75309))\n    ).rotationDegrees).toEqual([0, 0, 86.753]);\n\n    expect(MatrixMath.decomposeMatrix(\n      MatrixMath.createRotateZ(degreesToRadians(42.00000000001))\n    ).rotationDegrees).toEqual([0, 0, 42]);\n\n    expect(MatrixMath.decomposeMatrix(\n      MatrixMath.createRotateZ(degreesToRadians(42.99999999999))\n    ).rotationDegrees).toEqual([0, 0, 43]);\n\n    expect(MatrixMath.decomposeMatrix(\n      MatrixMath.createRotateZ(degreesToRadians(42.49999999999))\n    ).rotationDegrees).toEqual([0, 0, 42.5]);\n\n    expect(MatrixMath.decomposeMatrix(\n      MatrixMath.createRotateZ(degreesToRadians(42.55555555555))\n    ).rotationDegrees).toEqual([0, 0, 42.556]);\n  });\n\n  it('decomposes a 4x4 matrix to produce accurate Y-axis angles', () => {\n    var mat;\n    [30, 45, 60, 75, 90, 100, 110, 120, 133, 167].forEach(angle => {\n      mat = MatrixMath.createIdentityMatrix();\n      MatrixMath.reuseRotateYCommand(mat, degreesToRadians(angle));\n      expect(convertZeroes(MatrixMath.decomposeMatrix(mat).rotationDegrees))\n        .toEqual([0, angle, 0]);\n\n      mat = MatrixMath.createIdentityMatrix();\n      MatrixMath.reuseRotateYCommand(mat, degreesToRadians(-angle));\n      expect(convertZeroes(MatrixMath.decomposeMatrix(mat).rotationDegrees))\n        .toEqual([0, -angle, 0]);\n    });\n\n    // all values are between 0 and 180;\n    // change of sign and direction in the third and fourth quadrant\n    mat = MatrixMath.createIdentityMatrix();\n    MatrixMath.reuseRotateYCommand(mat, degreesToRadians(222));\n    expect(MatrixMath.decomposeMatrix(mat).rotationDegrees)\n      .toEqual([0, -138, 0]);\n\n    mat = MatrixMath.createIdentityMatrix();\n    MatrixMath.reuseRotateYCommand(mat, degreesToRadians(270));\n    expect(MatrixMath.decomposeMatrix(mat).rotationDegrees)\n      .toEqual([0, -90, 0]);\n\n    mat = MatrixMath.createIdentityMatrix();\n    MatrixMath.reuseRotateYCommand(mat, degreesToRadians(360));\n    expect(MatrixMath.decomposeMatrix(mat).rotationDegrees)\n      .toEqual([0, 0, 0]);\n  });\n\n  it('decomposes a 4x4 matrix to produce accurate X-axis angles', () => {\n    var mat;\n    [30, 45, 60, 75, 90, 100, 110, 120, 133, 167].forEach(angle => {\n      mat = MatrixMath.createIdentityMatrix();\n      MatrixMath.reuseRotateXCommand(mat, degreesToRadians(angle));\n      expect(convertZeroes(MatrixMath.decomposeMatrix(mat).rotationDegrees))\n        .toEqual([angle, 0, 0]);\n    });\n\n    // all values are between 0 and 180;\n    // change of sign and direction in the third and fourth quadrant\n    mat = MatrixMath.createIdentityMatrix();\n    MatrixMath.reuseRotateXCommand(mat, degreesToRadians(222));\n    expect(MatrixMath.decomposeMatrix(mat).rotationDegrees)\n      .toEqual([-138, 0, 0]);\n\n    mat = MatrixMath.createIdentityMatrix();\n    MatrixMath.reuseRotateXCommand(mat, degreesToRadians(270));\n    expect(MatrixMath.decomposeMatrix(mat).rotationDegrees)\n      .toEqual([-90, 0, 0]);\n\n    mat = MatrixMath.createIdentityMatrix();\n    MatrixMath.reuseRotateXCommand(mat, degreesToRadians(360));\n    expect(MatrixMath.decomposeMatrix(mat).rotationDegrees)\n      .toEqual([0, 0, 0]);\n  });\n\n});\n"
  },
  {
    "path": "Libraries/Utilities/__tests__/Platform-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nvar PlatformIOS = require('../Platform.ios');\nvar PlatformAndroid = require('../Platform.android');\n\ndescribe('Platform', () => {\n\n  describe('OS', () => {\n    it('should have correct value', () => {\n      expect(PlatformIOS.OS).toEqual('ios');\n      expect(PlatformAndroid.OS).toEqual('android');\n    });\n  });\n\n  describe('select', () => {\n    it('should return platform specific value', () => {\n      const obj = { ios: 'ios', android: 'android' };\n      expect(PlatformIOS.select(obj)).toEqual(obj.ios);\n      expect(PlatformAndroid.select(obj)).toEqual(obj.android);\n    });\n  });\n\n});\n"
  },
  {
    "path": "Libraries/Utilities/__tests__/SceneTracker-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nconst SceneTracker = require('SceneTracker');\n\ndescribe('setActiveScene', function() {\n\n  it('can handle multiple listeners and unsubscribe', function() {\n    const listeners = [jest.fn(), jest.fn(), jest.fn()];\n    const subscriptions = listeners.map(\n      (listener) => SceneTracker.addActiveSceneChangedListener(listener)\n    );\n    subscriptions[1].remove();\n    const newScene = {name: 'scene1'};\n    SceneTracker.setActiveScene(newScene);\n    expect(listeners[0]).toBeCalledWith(newScene);\n    expect(listeners[1]).not.toBeCalled();\n    expect(listeners[2]).toBeCalledWith(newScene);\n  });\n});\n"
  },
  {
    "path": "Libraries/Utilities/__tests__/buildStyleInterpolator-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nvar buildStyleInterpolator = require('buildStyleInterpolator');\n\nvar validateEmpty = function(interpolator, value, validator) {\n  var emptyObject = {};\n  var changed = interpolator(emptyObject, value);\n  validator(emptyObject);\n  expect(changed).toBe(true);\n  changed = interpolator(emptyObject, value);\n  expect(changed).toBe(false);\n};\ndescribe('buildStyleInterpolator', function() {\n  it('should linearly interpolate without extrapolating', function() {\n    var testAnim = {\n      opacity: {\n        from: 100,\n        to: 200,\n        min: 0,\n        max: 1,\n        type: 'linear',\n        extrapolate: false,\n      },\n      left: {\n        from: 200,\n        to: 300,\n        min: 0,\n        max: 1,\n        type: 'linear',\n        extrapolate: false,\n      },\n      top: {\n        type: 'constant',\n        value: 23.5,\n      },\n    };\n    var interpolator = buildStyleInterpolator(testAnim);\n    validateEmpty(interpolator, 0, function(res) {\n      expect(res).toEqual({\n        opacity: 100,\n        left: 200,\n        top: 23.5,\n      });\n    });\n    validateEmpty(interpolator, 1, function(res) {\n      expect(res).toEqual({\n        opacity: 200,\n        left: 300,\n        top: 23.5,\n      });\n    });\n    validateEmpty(interpolator, -0.1, function(res) {\n      expect(res).toEqual({\n        opacity: 100,\n        left: 200,\n        top: 23.5,\n      });\n    });\n    validateEmpty(interpolator, 1.1, function(res) {\n      expect(res).toEqual({\n        opacity: 200,\n        left: 300,\n        top: 23.5,\n      });\n    });\n    validateEmpty(interpolator, 0.5, function(res) {\n      expect(res).toEqual({\n        opacity: 150,\n        left: 250,\n        top: 23.5,\n      });\n    });\n  });\n  it('should linearly interpolate with extrapolating', function() {\n    var testAnim = {\n      opacity: {\n        from: 100,\n        to: 200,\n        min: 0,\n        max: 1,\n        type: 'linear',\n        round: 1,  // To make testing easier\n        extrapolate: true,\n      },\n      left: {\n        from: 200,\n        to: 300,\n        min: 0,\n        max: 1,\n        type: 'linear',\n        round: 1,  // To make testing easier\n        extrapolate: true,\n      },\n      top: {\n        type: 'constant',\n        value: 23.5,\n      },\n    };\n    var interpolator = buildStyleInterpolator(testAnim);\n    validateEmpty(interpolator, 0, function(res) {\n      expect(res).toEqual({\n        opacity: 100,\n        left: 200,\n        top: 23.5,\n      });\n    });\n    validateEmpty(interpolator, 1, function(res) {\n      expect(res).toEqual({\n        opacity: 200,\n        left: 300,\n        top: 23.5,\n      });\n    });\n    validateEmpty(interpolator, -0.1, function(res) {\n      expect(res).toEqual({\n        opacity: 90,\n        left: 190,\n        top: 23.5,\n      });\n    });\n    validateEmpty(interpolator, 1.1, function(res) {\n      expect(res).toEqual({\n        opacity: 210,\n        left: 310,\n        top: 23.5,\n      });\n    });\n    validateEmpty(interpolator, 0.5, function(res) {\n      expect(res).toEqual({\n        opacity: 150,\n        left: 250,\n        top: 23.5,\n      });\n    });\n  });\n  it('should round accordingly', function() {\n    var testAnim = {\n      opacity: {\n        from: 0,\n        to: 1,\n        min: 0,\n        max: 1,\n        type: 'linear',\n        round: 2,  // As in one over two\n        extrapolate: true,\n      },\n    };\n    var interpolator = buildStyleInterpolator(testAnim);\n    validateEmpty(interpolator, 0, function(res) {\n      expect(res).toEqual({\n        opacity: 0,\n      });\n    });\n    validateEmpty(interpolator, 0.5, function(res) {\n      expect(res).toEqual({\n        opacity: 0.5,\n      });\n    });\n    validateEmpty(interpolator, 0.4, function(res) {\n      expect(res).toEqual({\n        opacity: 0.5,\n      });\n    });\n    validateEmpty(interpolator, 0.26, function(res) {\n      expect(res).toEqual({\n        opacity: 0.5,\n      });\n    });\n    validateEmpty(interpolator, 0.74, function(res) {\n      expect(res).toEqual({\n        opacity: 0.5,\n      });\n    });\n    validateEmpty(interpolator, 0.76, function(res) {\n      expect(res).toEqual({\n        opacity: 1.0,\n      });\n    });\n  });\n  it('should detect chnages correctly', function() {\n    var testAnim = {\n      opacity: {\n        from: 0,\n        to: 1,\n        min: 0,\n        max: 1,\n        type: 'linear',\n        round: 2,  // As in one over two\n        extrapolate: false,\n      },\n    };\n    var interpolator = buildStyleInterpolator(testAnim);\n    var obj = {};\n    var res = interpolator(obj, 0);\n    expect(obj).toEqual({\n      opacity: 0,\n    });\n    expect(res).toBe(true);\n\n    res = interpolator(obj, 0);\n    // No change detected\n    expect(obj).toEqual({\n      opacity: 0,\n    });\n    expect(res).toBe(false);\n\n    // No change detected\n    res = interpolator(obj, 1);\n    expect(obj).toEqual({\n      opacity: 1,\n    });\n    expect(res).toBe(true);\n\n    // Still no change detected even when clipping\n    res = interpolator(obj, 1);\n    expect(obj).toEqual({\n      opacity: 1,\n    });\n    expect(res).toBe(false);\n  });\n  it('should handle identity', function() {\n    var testAnim = {\n      opacity: {\n        type: 'identity',\n      },\n    };\n    var interpolator = buildStyleInterpolator(testAnim);\n    var obj = {};\n    var res = interpolator(obj, 0.5);\n    expect(obj).toEqual({\n      opacity: 0.5,\n    });\n    expect(res).toBe(true);\n\n    res = interpolator(obj, 0.5);\n    // No change detected\n    expect(obj).toEqual({\n      opacity: 0.5,\n    });\n    expect(res).toBe(false);\n  });\n  it('should translate', function() {\n    var testAnim = {\n      transformTranslate: {\n        from: {x: 1, y: 10, z: 100},\n        to: {x: 5, y: 50, z: 500},\n        min: 0,\n        max: 4,\n        type: 'linear',\n      },\n    };\n    var interpolator = buildStyleInterpolator(testAnim);\n    var obj = {};\n    var res = interpolator(obj, 1);\n    expect(obj).toEqual({\n      transform: [{matrix: [1, 0, 0, 0,\n                            0, 1, 0, 0,\n                            0, 0, 1, 0,\n                            2, 20, 200, 1]}]\n    });\n    expect(res).toBe(true);\n  });\n  it('should scale', function() {\n    var testAnim = {\n      transformScale: {\n        from: {x: 1, y: 10, z: 100},\n        to: {x: 5, y: 50, z: 500},\n        min: 0,\n        max: 4,\n        type: 'linear',\n      },\n    };\n    var interpolator = buildStyleInterpolator(testAnim);\n    var obj = {};\n    var res = interpolator(obj, 1);\n    expect(obj).toEqual({\n      transform: [{matrix: [2, 0, 0, 0,\n                            0, 20, 0, 0,\n                            0, 0, 200, 0,\n                            0, 0, 0, 1]}]\n    });\n    expect(res).toBe(true);\n  });\n  it('should combine scale and translate', function() {\n    var testAnim = {\n      transformScale: {\n        from: {x: 1, y: 10, z: 100},\n        to: {x: 5, y: 50, z: 500},\n        min: 0,\n        max: 4,\n        type: 'linear',\n      },\n      transformTranslate: {\n        from: {x: 1, y: 10, z: 100},\n        to: {x: 5, y: 50, z: 500},\n        min: 0,\n        max: 4,\n        type: 'linear',\n      },\n    };\n    var interpolator = buildStyleInterpolator(testAnim);\n    var obj = {};\n    var res = interpolator(obj, 1);\n    expect(obj).toEqual({\n      transform: [{matrix: [2, 0, 0, 0,\n                            0, 20, 0, 0,\n                            0, 0, 200, 0,\n                            4, 400, 40000, 1]}]\n    });\n    expect(res).toBe(true);\n  });\n  it('should step', function() {\n    var testAnim = {\n      opacity: {\n        threshold: 13,\n        from: 10,\n        to: 20,\n        type: 'step',\n      },\n    };\n    var interpolator = buildStyleInterpolator(testAnim);\n    var obj = {};\n    var res = interpolator(obj, 0);\n    expect(obj).toEqual({\n      opacity: 10,\n    });\n    expect(res).toBe(true);\n\n    res = interpolator(obj, 0);\n    // No change detected\n    expect(obj).toEqual({\n      opacity: 10,\n    });\n    expect(res).toBe(false);\n\n    // No change detected\n    res = interpolator(obj, 10);\n    expect(obj).toEqual({\n      opacity: 10,\n    });\n    expect(res).toBe(false);\n\n    // No change detected\n    res = interpolator(obj, 12);\n    expect(obj).toEqual({\n      opacity: 10,\n    });\n    expect(res).toBe(false);\n\n    // No change detected\n    res = interpolator(obj, 13);\n    expect(obj).toEqual({\n      opacity: 20,\n    });\n    expect(res).toBe(true);\n\n    // No change detected\n    res = interpolator(obj, 13.1);\n    expect(obj).toEqual({\n      opacity: 20,\n    });\n    expect(res).toBe(false);\n\n    // No change detected\n    res = interpolator(obj, 25);\n    expect(obj).toEqual({\n      opacity: 20,\n    });\n    expect(res).toBe(false);\n  });\n});\n"
  },
  {
    "path": "Libraries/Utilities/__tests__/deepFreezeAndThrowOnMutationInDev-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\nvar deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev');\n\ndescribe('deepFreezeAndThrowOnMutationInDev', function() {\n\n  it('should be a noop on non object values', () => {\n    __DEV__ = true;\n    expect(() => deepFreezeAndThrowOnMutationInDev('')).not.toThrow();\n    expect(() => deepFreezeAndThrowOnMutationInDev(null)).not.toThrow();\n    expect(() => deepFreezeAndThrowOnMutationInDev(false)).not.toThrow();\n    expect(() => deepFreezeAndThrowOnMutationInDev(5)).not.toThrow();\n    expect(() => deepFreezeAndThrowOnMutationInDev()).not.toThrow();\n    __DEV__ = false;\n    expect(() => deepFreezeAndThrowOnMutationInDev('')).not.toThrow();\n    expect(() => deepFreezeAndThrowOnMutationInDev(null)).not.toThrow();\n    expect(() => deepFreezeAndThrowOnMutationInDev(false)).not.toThrow();\n    expect(() => deepFreezeAndThrowOnMutationInDev(5)).not.toThrow();\n    expect(() => deepFreezeAndThrowOnMutationInDev()).not.toThrow();\n  });\n\n  it('should throw on mutation in dev with strict', () => {\n    'use strict';\n    __DEV__ = true;\n    var o = {key: 'oldValue'};\n    deepFreezeAndThrowOnMutationInDev(o);\n    expect(() => { o.key = 'newValue'; }).toThrowError(\n      'You attempted to set the key `key` with the value `\"newValue\"` ' +\n      'on an object that is meant to be immutable and has been frozen.'\n    );\n    expect(o.key).toBe('oldValue');\n  });\n\n  it('should throw on mutation in dev without strict', () => {\n    __DEV__ = true;\n    var o = {key: 'oldValue'};\n    deepFreezeAndThrowOnMutationInDev(o);\n    expect(() => { o.key = 'newValue'; }).toThrowError(\n      'You attempted to set the key `key` with the value `\"newValue\"` ' +\n      'on an object that is meant to be immutable and has been frozen.'\n    );\n    expect(o.key).toBe('oldValue');\n  });\n\n  it('should throw on nested mutation in dev with strict', () => {\n    'use strict';\n    __DEV__ = true;\n    var o = {key1: {key2: {key3: 'oldValue'}}};\n    deepFreezeAndThrowOnMutationInDev(o);\n    expect(() => { o.key1.key2.key3 = 'newValue'; }).toThrowError(\n      'You attempted to set the key `key3` with the value `\"newValue\"` ' +\n      'on an object that is meant to be immutable and has been frozen.'\n    );\n    expect(o.key1.key2.key3).toBe('oldValue');\n  });\n\n  it('should throw on nested mutation in dev without strict', () => {\n    __DEV__ = true;\n    var o = {key1: {key2: {key3: 'oldValue'}}};\n    deepFreezeAndThrowOnMutationInDev(o);\n    expect(() => { o.key1.key2.key3 = 'newValue'; }).toThrowError(\n      'You attempted to set the key `key3` with the value `\"newValue\"` ' +\n      'on an object that is meant to be immutable and has been frozen.'\n    );\n    expect(o.key1.key2.key3).toBe('oldValue');\n  });\n\n  it('should throw on insertion in dev with strict', () => {\n    'use strict';\n    __DEV__ = true;\n    var o = {oldKey: 'value'};\n    deepFreezeAndThrowOnMutationInDev(o);\n    expect(() => { o.newKey = 'value'; })\n      .toThrowError(\n        /(Cannot|Can't) add property newKey, object is not extensible/\n      );\n    expect(o.newKey).toBe(undefined);\n  });\n\n  it('should not throw on insertion in dev without strict', () => {\n    __DEV__ = true;\n    var o = {oldKey: 'value'};\n    deepFreezeAndThrowOnMutationInDev(o);\n    expect(() => { o.newKey = 'value'; }).not.toThrow();\n    expect(o.newKey).toBe(undefined);\n  });\n\n  it('should mutate and not throw on mutation in prod', () => {\n    'use strict';\n    __DEV__ = false;\n    var o = {key: 'oldValue'};\n    deepFreezeAndThrowOnMutationInDev(o);\n    expect(() => { o.key = 'newValue'; }).not.toThrow();\n    expect(o.key).toBe('newValue');\n  });\n\n  // This is a limitation of the technique unfortunately\n  it('should not deep freeze already frozen objects', () => {\n    'use strict';\n    __DEV__ = true;\n    var o = {key1: {key2: 'oldValue'}};\n    Object.freeze(o);\n    deepFreezeAndThrowOnMutationInDev(o);\n    expect(() => { o.key1.key2 = 'newValue'; }).not.toThrow();\n    expect(o.key1.key2).toBe('newValue');\n  });\n\n  it(\"shouldn't recurse infinitely\", () => {\n    __DEV__ = true;\n    var o = {};\n    o.circular = o;\n    deepFreezeAndThrowOnMutationInDev(o);\n  });\n\n});\n"
  },
  {
    "path": "Libraries/Utilities/__tests__/groupByEveryN-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\ndescribe('groupByEveryN', () => {\n  var groupByEveryN = require('groupByEveryN');\n\n  it('should group by with different n', () => {\n    expect(groupByEveryN([1, 2, 3, 4, 5, 6, 7, 8, 9], 1))\n      .toEqual([[1], [2], [3], [4], [5], [6], [7], [8], [9]]);\n    expect(groupByEveryN([1, 2, 3, 4, 5, 6, 7, 8, 9], 2))\n      .toEqual([[1, 2], [3, 4], [5, 6], [7, 8], [9, null]]);\n    expect(groupByEveryN([1, 2, 3, 4, 5, 6, 7, 8, 9], 3))\n      .toEqual([[1, 2, 3], [4, 5, 6], [7, 8, 9]]);\n    expect(groupByEveryN([1, 2, 3, 4, 5, 6, 7, 8, 9], 4))\n      .toEqual([[1, 2, 3, 4], [5, 6, 7, 8], [9, null, null, null]]);\n  });\n\n  it('should fill with null', () => {\n    expect(groupByEveryN([], 4))\n      .toEqual([]);\n    expect(groupByEveryN([1], 4))\n      .toEqual([[1, null, null, null]]);\n    expect(groupByEveryN([1, 2], 4))\n      .toEqual([[1, 2, null, null]]);\n    expect(groupByEveryN([1, 2, 3], 4))\n      .toEqual([[1, 2, 3, null]]);\n    expect(groupByEveryN([1, 2, 3, 4], 4))\n      .toEqual([[1, 2, 3, 4]]);\n  });\n});\n"
  },
  {
    "path": "Libraries/Utilities/__tests__/mapWithSeparator-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\ndescribe('mapWithSeparator', () => {\n  const mapWithSeparator = require('mapWithSeparator');\n\n  it('mapWithSeparator returns expected results', () => {\n    const array = [1, 2, 3];\n    const result = mapWithSeparator(\n      array,\n      function(value) {\n        return value * 2;\n      },\n      function() {\n        return 0;\n      }\n    );\n    expect(result).toEqual([2, 0, 4, 0, 6]);\n  });\n\n  it('mapWithSeparator indices are correct', () => {\n    const array = [1, 2, 3];\n    const result = mapWithSeparator(\n      array,\n      function(value, index) {\n        return index;\n      },\n      function(index) {\n        return index;\n      }\n    );\n    expect(result).toEqual([0, 0, 1, 1, 2]);\n  });\n\n  it('mapWithSeparator passes correct array and indices', () => {\n    const array = [3, 2, 1];\n    const result = mapWithSeparator(\n      array,\n      function(value, index, arr) {\n        return arr[index];\n      },\n      function(index) {\n        return index;\n      }\n    );\n    expect(result).toEqual([3, 0, 2, 1, 1]);\n  });\n});\n"
  },
  {
    "path": "Libraries/Utilities/__tests__/truncate-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\ndescribe('truncate', () => {\n\n  var truncate = require('truncate');\n\n  it('should truncate', () => {\n    expect(truncate('Hello, world.', 5))\n      .toBe('He...');\n  });\n  it('should not truncate', () => {\n    expect(truncate('Hello, world.', 50))\n      .toBe('Hello, world.');\n  });\n  it('should not truncate more than minDelta chars.', () => {\n    expect(truncate('Hello, world.', 7, {minDelta: 10}))\n      .toBe('Hello, world.');\n    expect(truncate('Hello, world.', 7, {minDelta: 9}))\n      .toBe('Hell...');\n  });\n  it('should break in the middle of words', () => {\n    expect(truncate('Hello, world.  How are you?', 18, {breakOnWords: false}))\n      .toBe('Hello, world.  H...');\n    expect(truncate('Hello, world.\\nHow are you?', 18, {breakOnWords: false}))\n      .toBe('Hello, world.\\nHo...');\n  });\n  it('should break at word boundaries', () => {\n    expect(truncate('Hello, world.  How are you?', 18, {breakOnWords: true}))\n      .toBe('Hello, world....');\n    expect(truncate('Hello, world.\\nHow are you?', 18, {breakOnWords: true}))\n      .toBe('Hello, world....');\n  });\n  it('should uses custom elipses', () => {\n    expect(truncate('Hello, world.', 9, {elipsis: '&middot'}))\n      .toBe('He&middot');\n  });\n  it('shouldn\\'t barf with weird input', () => {\n    expect(truncate('Hello, world.', 0))\n      .toBe('Hello,...');\n    expect(truncate('Hello, world.', -132))\n      .toBe('...');\n    expect(truncate('', 0))\n      .toBe('');\n    expect(truncate(null, 0))\n      .toBe(null);\n  });\n});\n"
  },
  {
    "path": "Libraries/Utilities/__tests__/utf8-test.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n\n'use strict';\n\nconst {encode} = require('../utf8');\n\ndescribe('UTF-8 encoding:', () => {\n   it('can encode code points < U+80', () => {\n     const arrayBuffer = encode('\\u0000abcDEF\\u007f');\n     expect(new Uint8Array(arrayBuffer)).toEqual(\n       new Uint8Array([0x00, 0x61, 0x62, 0x63, 0x44, 0x45, 0x46, 0x7f]));\n   });\n\n   it('can encode code points < U+800', () => {\n     const arrayBuffer = encode('\\u0080\\u0548\\u07ff');\n     expect(new Uint8Array(arrayBuffer)).toEqual(\n       new Uint8Array([0xc2, 0x80, 0xd5, 0x88, 0xdf, 0xbf]));\n   });\n\n   it('can encode code points < U+10000', () => {\n     const arrayBuffer = encode('\\u0800\\uac48\\uffff');\n     expect(new Uint8Array(arrayBuffer)).toEqual(\n       new Uint8Array([0xe0, 0xa0, 0x80, 0xea, 0xb1, 0x88, 0xef, 0xbf, 0xbf]));\n   });\n\n   it('can encode code points in the Supplementary Planes (surrogate pairs)', () => {\n     const arrayBuffer = encode([\n       '\\ud800\\udc00',\n       '\\ud800\\ude89',\n       '\\ud83d\\ude3b',\n       '\\udbff\\udfff'\n     ].join(''));\n     expect(new Uint8Array(arrayBuffer)).toEqual(\n       new Uint8Array([\n         0xf0, 0x90, 0x80, 0x80,\n         0xf0, 0x90, 0x8a, 0x89,\n         0xf0, 0x9f, 0x98, 0xbb,\n         0xf4, 0x8f, 0xbf, 0xbf,\n       ])\n     );\n   });\n\n   it('allows for stray high surrogates', () => {\n     const arrayBuffer = encode(String.fromCharCode(0x61, 0xd8c6, 0x62));\n     expect(new Uint8Array(arrayBuffer)).toEqual(\n       new Uint8Array([0x61, 0xed, 0xa3, 0x86, 0x62]));\n   });\n\n   it('allows for stray low surrogates', () => {\n     const arrayBuffer = encode(String.fromCharCode(0x61, 0xde19, 0x62));\n     expect(new Uint8Array(arrayBuffer)).toEqual(\n       new Uint8Array([0x61, 0xed, 0xb8, 0x99, 0x62]));\n   });\n});\n"
  },
  {
    "path": "Libraries/Utilities/asyncRequire.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @format\n * @providesModule asyncRequire\n */\n\n'use strict';\n\nconst dynamicRequire: number => mixed = (require: $FlowFixMe);\n\n/**\n * The bundler must register the dependency properly when generating a call to\n * `asyncRequire`, that allows us to call `require` dynamically with confidence\n * the module ID is indeed valid and available.\n */\nfunction asyncRequire(moduleID: number): Promise<mixed> {\n  return Promise.resolve()\n    .then(() => {\n      const {segmentId} = (require: $FlowFixMe).unpackModuleId(moduleID);\n      return loadSegment(segmentId);\n    })\n    .then(() => dynamicRequire(moduleID));\n}\n\nlet segmentLoaders = new Map();\n\n/**\n * Ensure that a bundle segment is ready for use, for example requiring some of\n * its module. We cache load promises so as to avoid calling `fetchSegment`\n * twice for the same bundle. We assume that once a segment is fetched/loaded,\n * it is never gettting removed during this instance of the JavaScript VM.\n *\n * Segment #0 is the main segment, that is always available by definition, so\n * we never try to load anything.\n *\n * We don't use async/await syntax to avoid depending on `regeneratorRuntime`.\n */\nfunction loadSegment(segmentId: number): Promise<void> {\n  return Promise.resolve().then(() => {\n    if (segmentId === 0) {\n      return;\n    }\n    if (typeof global.__BUNDLE_DIGEST__ !== 'string') {\n      throw IncorrectBundleSetupError();\n    }\n    const globalDigest = global.__BUNDLE_DIGEST__;\n    let segmentLoader = segmentLoaders.get(segmentId);\n    if (segmentLoader != null) {\n      return segmentLoader;\n    }\n    const {fetchSegment} = global;\n    if (fetchSegment == null) {\n      throw new FetchSegmentNotAvailableError();\n    }\n    segmentLoader = new Promise((resolve, reject) => {\n      fetchSegment(segmentId, error => {\n        if (error != null) {\n          reject(error);\n          return;\n        }\n        resolve();\n      });\n    }).then(() => {\n      const metaModuleId = (require: $FlowFixMe).packModuleId({\n        segmentId,\n        localId: 0,\n      });\n      const metaModule = dynamicRequire(metaModuleId);\n      const digest: string =\n        typeof metaModule === 'object' && metaModule != null\n          ? (metaModule.BUNDLE_DIGEST: $FlowFixMe)\n          : 'undefined';\n      if (digest !== globalDigest) {\n        throw new IncompatibleSegmentError(globalDigest, digest);\n      }\n    });\n    segmentLoaders.set(segmentId, segmentLoader);\n    return segmentLoader;\n  });\n}\n\nclass FetchSegmentNotAvailableError extends Error {\n  constructor() {\n    super(\n      'When bundle splitting is enabled, the `global.fetchSegment` function ' +\n        'must be provided to be able to load particular bundle segments.',\n    );\n  }\n}\n\nclass IncorrectBundleSetupError extends Error {\n  constructor() {\n    super(\n      'To be able to use split segments, the bundler must define a global ' +\n        'constant `__BUNDLE_DIGEST__` that identifies the bundle uniquely.',\n    );\n  }\n}\nasyncRequire.IncorrectBundleSetupError = IncorrectBundleSetupError;\n\nclass IncompatibleSegmentError extends Error {\n  constructor(globalDigest, segmentDigest) {\n    super(\n      'The split segment that is being loaded has been built from a ' +\n        'different version of the code than the main segment. Or, the ' +\n        'bundler is setting up the module #0 of the segment incorrectly. ' +\n        `The global digest is \\`${globalDigest}\\` while the segment is ` +\n        `\\`${segmentDigest}\\`.`,\n    );\n  }\n}\nasyncRequire.IncompatibleSegmentError = IncompatibleSegmentError;\n\nmodule.exports = asyncRequire;\n"
  },
  {
    "path": "Libraries/Utilities/binaryToBase64.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule binaryToBase64\n * @flow\n */\n'use strict';\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst base64 = require('base64-js');\n\nfunction binaryToBase64(data: ArrayBuffer | $ArrayBufferView) {\n  if (data instanceof ArrayBuffer) {\n    data = new Uint8Array(data);\n  }\n  if (data instanceof Uint8Array) {\n    return base64.fromByteArray(data);\n  }\n  if (!ArrayBuffer.isView(data)) {\n    throw new Error('data must be ArrayBuffer or typed array');\n  }\n  const {buffer, byteOffset, byteLength} = data;\n  return base64.fromByteArray(new Uint8Array(buffer, byteOffset, byteLength));\n}\n\nmodule.exports = binaryToBase64;\n"
  },
  {
    "path": "Libraries/Utilities/buildStyleInterpolator.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule buildStyleInterpolator\n */\n\n'use strict';\n\nvar keyOf = require('fbjs/lib/keyOf');\n\nvar X_DIM = keyOf({x: null});\nvar Y_DIM = keyOf({y: null});\nvar Z_DIM = keyOf({z: null});\n\nvar InitialOperationField = {\n  transformTranslate: [0, 0, 0],\n  transformScale: [1, 1, 1],\n};\n\nvar InterpolateMatrix = {\n  transformScale: function(mat, x, y, z) {\n    mat[0] = mat[0] * x;\n    mat[1] = mat[1] * x;\n    mat[2] = mat[2] * x;\n    mat[3] = mat[3] * x;\n    mat[4] = mat[4] * y;\n    mat[5] = mat[5] * y;\n    mat[6] = mat[6] * y;\n    mat[7] = mat[7] * y;\n    mat[8] = mat[8] * z;\n    mat[9] = mat[9] * z;\n    mat[10] = mat[10] * z;\n    mat[11] = mat[11] * z;\n  },\n  transformTranslate: function(mat, x, y, z) {\n    mat[12] = mat[0] * x + mat[4] * y + mat[8] * z + mat[12];\n    mat[13] = mat[1] * x + mat[5] * y + mat[9] * z + mat[13];\n    mat[14] = mat[2] * x + mat[6] * y + mat[10] * z + mat[14];\n    mat[15] = mat[3] * x + mat[7] * y + mat[11] * z + mat[15];\n  }\n};\n\nvar computeNextValLinear = function(anim, from, to, value) {\n  var hasRoundRatio = 'round' in anim;\n  var roundRatio = anim.round;\n  var ratio = (value - anim.min) / (anim.max - anim.min);\n  if (!anim.extrapolate) {\n    ratio = ratio > 1 ? 1 : (ratio < 0 ? 0 : ratio);\n  }\n  var nextVal = from * (1 - ratio) + to * ratio;\n  if (hasRoundRatio) {\n    nextVal = Math.round(roundRatio * nextVal) / roundRatio;\n  }\n  return nextVal;\n};\n\nvar computeNextValLinearScalar = function(anim, value) {\n  return computeNextValLinear(anim, anim.from, anim.to, value);\n};\n\nvar setNextValAndDetectChange = function(result, name, nextVal, didChange) {\n  if (!didChange) {\n    var prevVal = result[name];\n    result[name] = nextVal;\n    didChange = didChange  || (nextVal !== prevVal);\n  } else {\n    result[name] = nextVal;\n  }\n  return didChange;\n};\n\nvar initIdentity = function(mat) {\n  mat[0] = 1;\n  mat[1] = 0;\n  mat[2] = 0;\n  mat[3] = 0;\n  mat[4] = 0;\n  mat[5] = 1;\n  mat[6] = 0;\n  mat[7] = 0;\n  mat[8] = 0;\n  mat[9] = 0;\n  mat[10] = 1;\n  mat[11] = 0;\n  mat[12] = 0;\n  mat[13] = 0;\n  mat[14] = 0;\n  mat[15] = 1;\n};\n\nvar computeNextMatrixOperationField = function(anim, name, dim, index, value) {\n  if (anim.from[dim] !== undefined && anim.to[dim] !== undefined) {\n    return computeNextValLinear(anim, anim.from[dim], anim.to[dim], value);\n  } else {\n    return InitialOperationField[name][index];\n  }\n};\n\nvar computeTransform = function(anim, name, value, result,\n                                didChange, didMatrix) {\n  var transform = result.transform !== undefined ?\n        result.transform : (result.transform = [{ matrix: [] }]);\n  var mat = transform[0].matrix;\n  var m0 = mat[0];\n  var m1 = mat[1];\n  var m2 = mat[2];\n  var m3 = mat[3];\n  var m4 = mat[4];\n  var m5 = mat[5];\n  var m6 = mat[6];\n  var m7 = mat[7];\n  var m8 = mat[8];\n  var m9 = mat[9];\n  var m10 = mat[10];\n  var m11 = mat[11];\n  var m12 = mat[12];\n  var m13 = mat[13];\n  var m14 = mat[14];\n  var m15 = mat[15];\n  if (!didMatrix) {\n    initIdentity(mat);  // This will be the first transform.\n  }\n  var x = computeNextMatrixOperationField(anim, name, X_DIM, 0, value);\n  var y = computeNextMatrixOperationField(anim, name, Y_DIM, 1, value);\n  var z = computeNextMatrixOperationField(anim, name, Z_DIM, 2, value);\n  InterpolateMatrix[name](mat, x, y, z);\n  if (!didChange) {\n    didChange = m0 !== mat[0] || m1 !== mat[1] ||\n                m2 !== mat[2] || m3 !== mat[3] ||\n                m4 !== mat[4] || m5 !== mat[5] ||\n                m6 !== mat[6] || m7 !== mat[7] ||\n                m8 !== mat[8] || m9 !== mat[9] ||\n                m10 !== mat[10] || m11 !== mat[11] ||\n                m12 !== mat[12] || m13 !== mat[13] ||\n                m14 !== mat[14] || m15 !== mat[15];\n  }\n  return didChange;\n};\n\n/**\n * @param {object} anims Animation configuration by style property name.\n * @return {function} Function accepting style object, that mutates that style\n * object and returns a boolean describing if any update was actually applied.\n */\nvar buildStyleInterpolator = function(anims) {\n  function styleInterpolator(result, value) {\n    var didChange = false;\n    var didMatrix = false;\n    for (var name in anims) {\n      var anim = anims[name];\n      if (anim.type === 'linear') {\n        if (name in InterpolateMatrix) {\n          didChange = computeTransform(anim, name, value, result,\n                                       didChange, didMatrix);\n          didMatrix = true;\n        } else {\n          var next = computeNextValLinearScalar(anim, value);\n          didChange = setNextValAndDetectChange(result, name, next, didChange);\n        }\n      } else if (anim.type === 'constant') {\n        var next = anim.value;\n        didChange = setNextValAndDetectChange(result, name, next, didChange);\n      } else if (anim.type === 'step') {\n        var next = value >= anim.threshold ? anim.to : anim.from;\n        didChange = setNextValAndDetectChange(result, name, next, didChange);\n      } else if (anim.type === 'identity') {\n        var next = value;\n        didChange = setNextValAndDetectChange(result, name, next, didChange);\n      }\n    }\n    return didChange;\n  }\n  return styleInterpolator;\n};\n\nmodule.exports = buildStyleInterpolator;\n"
  },
  {
    "path": "Libraries/Utilities/clamp.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule clamp\n * @typechecks\n */\n'use strict';\n\n/**\n * @param {number} min\n * @param {number} value\n * @param {number} max\n * @return {number}\n */\nfunction clamp(min, value, max) {\n  if (value < min) {\n    return min;\n  }\n  if (value > max) {\n    return max;\n  }\n  return value;\n}\n\nmodule.exports = clamp;\n"
  },
  {
    "path": "Libraries/Utilities/createStrictShapeTypeChecker.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule createStrictShapeTypeChecker\n * @flow\n */\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\nvar merge = require('merge');\n\nfunction createStrictShapeTypeChecker(\n  shapeTypes: {[key: string]: ReactPropsCheckType}\n): ReactPropsChainableTypeChecker {\n  function checkType(isRequired, props, propName, componentName, location?, ...rest) {\n    if (!props[propName]) {\n      if (isRequired) {\n        invariant(\n          false,\n          `Required object \\`${propName}\\` was not specified in ` +\n          `\\`${componentName}\\`.`\n        );\n      }\n      return;\n    }\n    var propValue = props[propName];\n    var propType = typeof propValue;\n    var locationName = location || '(unknown)';\n    if (propType !== 'object') {\n      invariant(\n        false,\n        `Invalid ${locationName} \\`${propName}\\` of type \\`${propType}\\` ` +\n          `supplied to \\`${componentName}\\`, expected \\`object\\`.`\n      );\n    }\n    // We need to check all keys in case some are required but missing from\n    // props.\n    var allKeys = merge(props[propName], shapeTypes);\n    for (var key in allKeys) {\n      var checker = shapeTypes[key];\n      if (!checker) {\n        invariant(\n          false,\n          `Invalid props.${propName} key \\`${key}\\` supplied to \\`${componentName}\\`.` +\n            '\\nBad object: ' + JSON.stringify(props[propName], null, '  ') +\n            '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, '  ')\n        );\n      }\n      var error = checker(propValue, key, componentName, location, ...rest);\n      if (error) {\n        invariant(\n          false,\n          error.message +\n            '\\nBad object: ' + JSON.stringify(props[propName], null, '  ')\n        );\n      }\n    }\n  }\n  function chainedCheckType(\n    props: {[key: string]: any},\n    propName: string,\n    componentName: string,\n    location?: string,\n    ...rest\n  ): ?Error {\n    return checkType(false, props, propName, componentName, location, ...rest);\n  }\n  chainedCheckType.isRequired = checkType.bind(null, true);\n  return chainedCheckType;\n}\n\nmodule.exports = createStrictShapeTypeChecker;\n"
  },
  {
    "path": "Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule deepFreezeAndThrowOnMutationInDev\n * @flow\n */\n\n'use strict';\n\n/**\n * If your application is accepting different values for the same field over\n * time and is doing a diff on them, you can either (1) create a copy or\n * (2) ensure that those values are not mutated behind two passes.\n * This function helps you with (2) by freezing the object and throwing if\n * the user subsequently modifies the value.\n *\n * There are two caveats with this function:\n *   - If the call site is not in strict mode, it will only throw when\n *     mutating existing fields, adding a new one\n *     will unfortunately fail silently :(\n *   - If the object is already frozen or sealed, it will not continue the\n *     deep traversal and will leave leaf nodes unfrozen.\n *\n * Freezing the object and adding the throw mechanism is expensive and will\n * only be used in DEV.\n */\nfunction deepFreezeAndThrowOnMutationInDev(object: Object) {\n  if (__DEV__) {\n    if (typeof object !== 'object' ||\n        object === null ||\n        Object.isFrozen(object) ||\n        Object.isSealed(object)) {\n      return;\n    }\n\n    var keys = Object.keys(object);\n\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i];\n      if (object.hasOwnProperty(key)) {\n        object.__defineGetter__(key, identity.bind(null, object[key]));\n        object.__defineSetter__(key, throwOnImmutableMutation.bind(null, key));\n      }\n    }\n\n    Object.freeze(object);\n    Object.seal(object);\n\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i];\n      if (object.hasOwnProperty(key)) {\n        deepFreezeAndThrowOnMutationInDev(object[key]);\n      }\n    }\n  }\n}\n\nfunction throwOnImmutableMutation(key, value) {\n  throw Error(\n    'You attempted to set the key `' + key + '` with the value `' +\n    JSON.stringify(value) + '` on an object that is meant to be immutable ' +\n    'and has been frozen.'\n  );\n}\n\nfunction identity(value) {\n  return value;\n}\n\nmodule.exports = deepFreezeAndThrowOnMutationInDev;\n"
  },
  {
    "path": "Libraries/Utilities/defineLazyObjectProperty.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule defineLazyObjectProperty\n * @flow\n */\n\n'use strict';\n\n/**\n * Defines a lazily evaluated property on the supplied `object`.\n */\nfunction defineLazyObjectProperty<T>(\n  object: Object,\n  name: string,\n  descriptor: {\n    get: () => T,\n    enumerable?: boolean,\n    writable?: boolean,\n  },\n): void {\n  const {get} = descriptor;\n  const enumerable = descriptor.enumerable !== false;\n  const writable = descriptor.writable !== false;\n\n  let value;\n  let valueSet = false;\n  function getValue(): T {\n    // WORKAROUND: A weird infinite loop occurs where calling `getValue` calls\n    // `setValue` which calls `Object.defineProperty` which somehow triggers\n    // `getValue` again. Adding `valueSet` breaks this loop.\n    if (!valueSet) {\n      // Calling `get()` here can trigger an infinite loop if it fails to\n      // remove the getter on the property, which can happen when executing\n      // JS in a V8 context.  `valueSet = true` will break this loop, and\n      // sets the value of the property to undefined, until the code in `get()`\n      // finishes, at which point the property is set to the correct value.\n      valueSet = true;\n      setValue(get());\n    }\n    return value;\n  }\n  function setValue(newValue: T): void {\n    value = newValue;\n    valueSet = true;\n    Object.defineProperty(object, name, {\n      value: newValue,\n      configurable: true,\n      enumerable,\n      writable,\n    });\n  }\n\n  Object.defineProperty(object, name, {\n    get: getValue,\n    set: setValue,\n    configurable: true,\n    enumerable,\n  });\n}\n\nmodule.exports = defineLazyObjectProperty;\n"
  },
  {
    "path": "Libraries/Utilities/deprecatedPropType.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule deprecatedPropType\n * @flow\n */\n'use strict';\n\nconst UIManager = require('UIManager');\n\n/**\n * Adds a deprecation warning when the prop is used.\n */\nfunction deprecatedPropType(\n  propType: ReactPropsCheckType,\n  explanation: string\n): ReactPropsCheckType {\n  return function validate(props, propName, componentName, ...rest) {\n    // Don't warn for native components.\n    if (!UIManager[componentName] && props[propName] !== undefined) {\n      console.warn(`\\`${propName}\\` supplied to \\`${componentName}\\` has been deprecated. ${explanation}`);\n    }\n\n    return propType(\n      props,\n      propName,\n      componentName,\n      ...rest\n    );\n  };\n}\n\nmodule.exports = deprecatedPropType;\n"
  },
  {
    "path": "Libraries/Utilities/differ/__tests__/deepDiffer-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\nvar deepDiffer = require('deepDiffer');\n\ndescribe('deepDiffer', function() {\n  it('should diff primitives of the same type', () => {\n    expect(deepDiffer(1, 2)).toBe(true);\n    expect(deepDiffer(42, 42)).toBe(false);\n    expect(deepDiffer('foo', 'bar')).toBe(true);\n    expect(deepDiffer('foo', 'foo')).toBe(false);\n    expect(deepDiffer(true, false)).toBe(true);\n    expect(deepDiffer(false, true)).toBe(true);\n    expect(deepDiffer(true, true)).toBe(false);\n    expect(deepDiffer(false, false)).toBe(false);\n    expect(deepDiffer(null, null)).toBe(false);\n    expect(deepDiffer(undefined, undefined)).toBe(false);\n  });\n  it('should diff primitives of different types', () => {\n    expect(deepDiffer(1, '1')).toBe(true);\n    expect(deepDiffer(true, 'true')).toBe(true);\n    expect(deepDiffer(true, 1)).toBe(true);\n    expect(deepDiffer(false, 0)).toBe(true);\n    expect(deepDiffer(null, undefined)).toBe(true);\n    expect(deepDiffer(null, 0)).toBe(true);\n    expect(deepDiffer(null, false)).toBe(true);\n    expect(deepDiffer(null, '')).toBe(true);\n    expect(deepDiffer(undefined, 0)).toBe(true);\n    expect(deepDiffer(undefined, false)).toBe(true);\n    expect(deepDiffer(undefined, '')).toBe(true);\n  });\n  it('should diff Objects', () => {\n    expect(deepDiffer({}, {})).toBe(false);\n    expect(deepDiffer({}, null)).toBe(true);\n    expect(deepDiffer(null, {})).toBe(true);\n    expect(deepDiffer({a: 1}, {a: 1})).toBe(false);\n    expect(deepDiffer({a: 1}, {a: 2})).toBe(true);\n    expect(deepDiffer({a: 1}, {a: 1, b: null})).toBe(true);\n    expect(deepDiffer({a: 1}, {a: 1, b: 1})).toBe(true);\n    expect(deepDiffer({a: 1, b: 1}, {a: 1})).toBe(true);\n    expect(deepDiffer({a: {A: 1}, b: 1}, {a: {A: 1}, b: 1})).toBe(false);\n    expect(deepDiffer({a: {A: 1}, b: 1}, {a: {A: 2}, b: 1})).toBe(true);\n    expect(deepDiffer(\n      {a: {A: {aA: 1, bB: 1}}, b: 1},\n      {a: {A: {aA: 1, bB: 1}}, b: 1}\n    )).toBe(false);\n    expect(deepDiffer(\n      {a: {A: {aA: 1, bB: 1}}, b: 1},\n      {a: {A: {aA: 1, cC: 1}}, b: 1}\n    )).toBe(true);\n  });\n  it('should diff Arrays', () => {\n    expect(deepDiffer([], [])).toBe(false);\n    expect(deepDiffer([], null)).toBe(true);\n    expect(deepDiffer(null, [])).toBe(true);\n    expect(deepDiffer([42], [42])).toBe(false);\n    expect(deepDiffer([1], [2])).toBe(true);\n    expect(deepDiffer([1, 2, 3], [1, 2, 3])).toBe(false);\n    expect(deepDiffer([1, 2, 3], [1, 2, 4])).toBe(true);\n    expect(deepDiffer([1, 2, 3], [1, 4, 3])).toBe(true);\n    expect(deepDiffer([1, 2, 3, 4], [1, 2, 3])).toBe(true);\n    expect(deepDiffer([1, 2, 3], [1, 2, 3, 4])).toBe(true);\n    expect(deepDiffer([0, null, false, ''], [0, null, false, ''])).toBe(false);\n    expect(deepDiffer([0, null, false, ''], ['', false, null, 0])).toBe(true);\n  });\n  it('should diff mixed types', () => {\n    expect(deepDiffer({}, [])).toBe(true);\n    expect(deepDiffer([], {})).toBe(true);\n    expect(deepDiffer(\n      {a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false]]},\n      {a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false]]}\n    )).toBe(false);\n    expect(deepDiffer(\n      {a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false]]},\n      {a: [{A: {aA: 1, bB: 2}}, 'bar'], c: [1, [false]]}\n    )).toBe(true);\n    expect(deepDiffer(\n      {a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false]]},\n      {a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false], null]}\n    )).toBe(true);\n    expect(deepDiffer(\n      {a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false]]},\n      {a: [{A: {aA: 1, bB: 1}}, ['bar']], c: [1, [false]]}\n    )).toBe(true);\n  });\n  it('should distinguish between proper Array and Object', () => {\n    expect(deepDiffer(['a', 'b'], {0: 'a', 1: 'b', length: 2})).toBe(true);\n    expect(deepDiffer(['a', 'b'], {length: 2, 0: 'a', 1: 'b'})).toBe(true);\n  });\n  it('should diff same object', () => {\n    var obj = [1,[2,3]];\n    expect(deepDiffer(obj, obj)).toBe(false);\n  });\n});\n"
  },
  {
    "path": "Libraries/Utilities/differ/deepDiffer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule deepDiffer\n * @flow\n */\n'use strict';\n\n/*\n * @returns {bool} true if different, false if equal\n */\nvar deepDiffer = function(one: any, two: any): bool {\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    var len = one.length;\n    if (two.length !== len) {\n      return true;\n    }\n    for (var ii = 0; ii < len; ii++) {\n      if (deepDiffer(one[ii], two[ii])) {\n        return true;\n      }\n    }\n  } else {\n    for (var key in one) {\n      if (deepDiffer(one[key], two[key])) {\n        return true;\n      }\n    }\n    for (var 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\nmodule.exports = deepDiffer;\n"
  },
  {
    "path": "Libraries/Utilities/differ/insetsDiffer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule insetsDiffer\n * @flow\n */\n'use strict';\n\ntype Inset = {\n  top: ?number,\n  left: ?number,\n  right: ?number,\n  bottom: ?number,\n}\n\nvar dummyInsets = {\n\ttop: undefined,\n\tleft: undefined,\n\tright: undefined,\n\tbottom: undefined,\n};\n\nvar insetsDiffer = function(\n  one: ?Inset,\n  two: ?Inset\n): bool {\n  one = one || dummyInsets;\n  two = two || dummyInsets;\n  return one !== two && (\n    one.top !== two.top ||\n    one.left !== two.left ||\n    one.right !== two.right ||\n    one.bottom !== two.bottom\n  );\n};\n\nmodule.exports = insetsDiffer;\n"
  },
  {
    "path": "Libraries/Utilities/differ/matricesDiffer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule matricesDiffer\n */\n'use strict';\n\n/**\n * Unrolls an array comparison specially for matrices. Prioritizes\n * checking of indices that are most likely to change so that the comparison\n * bails as early as possible.\n *\n * @param {MatrixMath.Matrix} one First matrix.\n * @param {MatrixMath.Matrix} two Second matrix.\n * @return {boolean} Whether or not the two matrices differ.\n */\nvar matricesDiffer = function(one, two) {\n  if (one === two) {\n    return false;\n  }\n  return !one || !two ||\n    one[12] !== two[12] ||\n    one[13] !== two[13] ||\n    one[14] !== two[14] ||\n    one[5] !== two[5] ||\n    one[10] !== two[10] ||\n    one[1] !== two[1] ||\n    one[2] !== two[2] ||\n    one[3] !== two[3] ||\n    one[4] !== two[4] ||\n    one[6] !== two[6] ||\n    one[7] !== two[7] ||\n    one[8] !== two[8] ||\n    one[9] !== two[9] ||\n    one[11] !== two[11] ||\n    one[15] !== two[15];\n};\n\nmodule.exports = matricesDiffer;\n"
  },
  {
    "path": "Libraries/Utilities/differ/pointsDiffer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule pointsDiffer\n * @flow\n */\n'use strict';\n\ntype Point = {\n  x: ?number,\n  y: ?number,\n}\n\nvar dummyPoint = {x: undefined, y: undefined};\n\nvar pointsDiffer = function(one: ?Point, two: ?Point): bool {\n  one = one || dummyPoint;\n  two = two || dummyPoint;\n  return one !== two && (\n    one.x !== two.x ||\n    one.y !== two.y\n  );\n};\n\nmodule.exports = pointsDiffer;\n"
  },
  {
    "path": "Libraries/Utilities/differ/sizesDiffer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule sizesDiffer\n */\n'use strict';\n\nvar dummySize = {width: undefined, height: undefined};\n\nvar sizesDiffer = function(one, two) {\n  one = one || dummySize;\n  two = two || dummySize;\n  return one !== two && (\n    one.width !== two.width ||\n    one.height !== two.height\n  );\n};\n\nmodule.exports = sizesDiffer;\n"
  },
  {
    "path": "Libraries/Utilities/dismissKeyboard.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule dismissKeyboard\n *\n * This function dismisses the currently-open keyboard, if any\n */\n'use strict';\n\nvar TextInputState = require('TextInputState');\n\nfunction dismissKeyboard() {\n  TextInputState.blurTextInput(TextInputState.currentlyFocusedField());\n}\n\nmodule.exports = dismissKeyboard;\n"
  },
  {
    "path": "Libraries/Utilities/groupByEveryN.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule groupByEveryN\n * @flow\n */\n\n/**\n * Useful method to split an array into groups of the same number of elements.\n * You can use it to generate grids, rows, pages...\n *\n * If the input length is not a multiple of the count, it'll fill the last\n * array with null so you can display a placeholder.\n *\n * Example:\n *   groupByEveryN([1, 2, 3, 4, 5], 3)\n *    => [[1, 2, 3], [4, 5, null]]\n *\n *   groupByEveryN([1, 2, 3], 2).map(elems => {\n *     return <Row>{elems.map(elem => <Elem>{elem}</Elem>)}</Row>;\n *   })\n */\n'use strict';\n\nfunction groupByEveryN<T>(array: Array<T>, n: number): Array<Array<?T>> {\n  var result = [];\n  var temp = [];\n\n  for (var i = 0; i < array.length; ++i) {\n    if (i > 0 && i % n === 0) {\n      result.push(temp);\n      temp = [];\n    }\n    temp.push(array[i]);\n  }\n\n  if (temp.length > 0) {\n    while (temp.length !== n) {\n      temp.push(null);\n    }\n    result.push(temp);\n  }\n\n  return result;\n}\n\nmodule.exports = groupByEveryN;\n"
  },
  {
    "path": "Libraries/Utilities/infoLog.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule infoLog\n */\n'use strict';\n\n/**\n * Intentional info-level logging for clear separation from ad-hoc console debug logging.\n */\nfunction infoLog(...args) {\n  return console.log(...args);\n}\n\nmodule.exports = infoLog;\n"
  },
  {
    "path": "Libraries/Utilities/logError.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule logError\n * @flow\n */\n'use strict';\n\n/**\n * Small utility that can be used as an error handler. You cannot just pass\n * `console.error` as a failure callback - it's not properly bound.  If passes an\n * `Error` object, it will print the message and stack.\n */\nvar logError = function(...args: $ReadOnlyArray<mixed>) {\n  if (args.length === 1 && args[0] instanceof Error) {\n    var err = args[0];\n    console.error('Error: \"' + err.message + '\".  Stack:\\n' + err.stack);\n  } else {\n    console.error.apply(console, args);\n  }\n};\n\nmodule.exports = logError;\n"
  },
  {
    "path": "Libraries/Utilities/mapWithSeparator.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule mapWithSeparator\n * @flow\n */\n'use strict';\n\nfunction mapWithSeparator<TFrom, TTo>(\n  items: Array<TFrom>,\n  itemRenderer: (item: TFrom, index: number, items: Array<TFrom>) => TTo,\n  spacerRenderer: (index: number) => TTo,\n): Array<TTo> {\n  const mapped = [];\n  if (items.length > 0) {\n    mapped.push(itemRenderer(items[0], 0, items));\n    for (let ii = 1; ii < items.length; ii++) {\n      mapped.push(spacerRenderer(ii - 1), itemRenderer(items[ii], ii, items));\n    }\n  }\n  return mapped;\n}\n\nmodule.exports = mapWithSeparator;\n"
  },
  {
    "path": "Libraries/Utilities/mergeFast.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule mergeFast\n * @flow\n */\n'use strict';\n\n/**\n * Faster version of `merge` that doesn't check its arguments and\n * also merges prototype inherited properties.\n *\n * @param {object} one Any non-null object.\n * @param {object} two Any non-null object.\n * @return {object} Merging of two objects, including prototype\n * inherited properties.\n */\nvar mergeFast = function(one: Object, two: Object): Object {\n  var ret = {};\n  for (var keyOne in one) {\n    ret[keyOne] = one[keyOne];\n  }\n  for (var keyTwo in two) {\n    ret[keyTwo] = two[keyTwo];\n  }\n  return ret;\n};\n\nmodule.exports = mergeFast;\n"
  },
  {
    "path": "Libraries/Utilities/mergeIntoFast.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule mergeIntoFast\n * @flow\n */\n'use strict';\n\n/**\n * Faster version of `mergeInto` that doesn't check its arguments and\n * also copies over prototype inherited properties.\n *\n * @param {object} one Object to assign to.\n * @param {object} two Object to assign from.\n */\nvar mergeIntoFast = function(one: Object, two: Object): void {\n  for (var keyTwo in two) {\n    one[keyTwo] = two[keyTwo];\n  }\n};\n\nmodule.exports = mergeIntoFast;\n"
  },
  {
    "path": "Libraries/Utilities/stringifySafe.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule stringifySafe\n * @flow\n */\n'use strict';\n\n/**\n * Tries to stringify with JSON.stringify and toString, but catches exceptions\n * (e.g. from circular objects) and always returns a string and never throws.\n */\nfunction stringifySafe(arg: any): string {\n  var ret;\n  var type = typeof arg;\n  if (arg === undefined) {\n    ret = 'undefined';\n  } else if (arg === null) {\n    ret = 'null';\n  } else if (type === 'string') {\n    ret = '\"' + arg + '\"';\n  } else if (type === 'function') {\n    try {\n      ret = arg.toString();\n    } catch (e) {\n      ret = '[function unknown]';\n    }\n  } else {\n    // Perform a try catch, just in case the object has a circular\n    // reference or stringify throws for some other reason.\n    try {\n      ret = JSON.stringify(arg);\n    } catch (e) {\n      if (typeof arg.toString === 'function') {\n        try {\n          ret = arg.toString();\n        } catch (E) {}\n      }\n    }\n  }\n  return ret || '[\"' + type + '\" failed to stringify]';\n}\n\nmodule.exports = stringifySafe;\n"
  },
  {
    "path": "Libraries/Utilities/truncate.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule truncate\n * @flow\n */\n'use strict';\n\ntype truncateOptions = {\n  breakOnWords: boolean,\n  minDelta: number,\n  elipsis: string,\n}\n\nconst defaultOptions = {\n  breakOnWords: true,\n  minDelta: 10, // Prevents truncating a tiny bit off the end\n  elipsis: '...',\n};\n\n// maxChars (including ellipsis)\nconst truncate = function(\n  str: ?string,\n  maxChars: number,\n  options: truncateOptions\n): ?string {\n  options = Object.assign({}, defaultOptions, options);\n  if (str && str.length &&\n      str.length - options.minDelta + options.elipsis.length >= maxChars) {\n    str = str.slice(0, maxChars - options.elipsis.length + 1);\n    if (options.breakOnWords) {\n      var ii = Math.max(str.lastIndexOf(' '), str.lastIndexOf('\\n'));\n      str = str.slice(0, ii);\n    }\n    str = str.trim() + options.elipsis;\n  }\n  return str;\n};\n\nmodule.exports = truncate;\n"
  },
  {
    "path": "Libraries/Utilities/utf8.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule utf8\n * @flow\n */\n'use strict';\n\nclass ByteVector {\n  _storage: Uint8Array;\n  _sizeWritten: number;\n\n  constructor(size) {\n    this._storage = new Uint8Array(size);\n    this._sizeWritten = 0;\n  }\n\n  push(value: number): ByteVector {\n    const i = this._sizeWritten;\n    if (i === this._storage.length) {\n      this._realloc();\n    }\n    this._storage[i] = value;\n    this._sizeWritten = i + 1;\n    return this;\n  }\n\n  getBuffer(): ArrayBuffer {\n    return this._storage.buffer.slice(0, this._sizeWritten);\n  }\n\n  _realloc() {\n    const storage = this._storage;\n    this._storage = new Uint8Array(align(storage.length * 1.5));\n    this._storage.set(storage);\n  }\n}\n\n/*eslint-disable no-bitwise */\nexports.encode = (string: string): ArrayBuffer => {\n  const {length} = string;\n  const bytes = new ByteVector(length);\n\n  // each character / char code is assumed to represent an UTF-16 wchar.\n  // With the notable exception of surrogate pairs, each wchar represents the\n  // corresponding unicode code point.\n  // For an explanation of UTF-8 encoding, read [1]\n  // For an explanation of UTF-16 surrogate pairs, read [2]\n  //\n  // [1] https://en.wikipedia.org/wiki/UTF-8#Description\n  // [2] https://en.wikipedia.org/wiki/UTF-16#U.2B10000_to_U.2B10FFFF\n  let nextCodePoint = string.charCodeAt(0);\n  for (let i = 0; i < length; i++) {\n    let codePoint = nextCodePoint;\n    nextCodePoint = string.charCodeAt(i + 1);\n\n    if (codePoint < 0x80) {\n      bytes.push(codePoint);\n    } else if (codePoint < 0x800) {\n      bytes\n        .push(0xc0 | codePoint >>> 6)\n        .push(0x80 | codePoint & 0x3f);\n    } else if (codePoint >>> 10 === 0x36 && nextCodePoint >>> 10 === 0x37) { // high surrogate & low surrogate\n      codePoint = 0x10000 + (((codePoint & 0x3ff) << 10) | (nextCodePoint & 0x3ff));\n      bytes\n        .push(0xf0 | codePoint >>> 18 & 0x7)\n        .push(0x80 | codePoint >>> 12 & 0x3f)\n        .push(0x80 | codePoint >>> 6  & 0x3f)\n        .push(0x80 | codePoint & 0x3f);\n\n      i += 1;\n      nextCodePoint = string.charCodeAt(i + 1);\n    } else {\n      bytes\n        .push(0xe0 | codePoint >>> 12)\n        .push(0x80 | codePoint >>> 6 & 0x3f)\n        .push(0x80 | codePoint & 0x3f);\n    }\n  }\n  return bytes.getBuffer();\n};\n\n// align to multiples of 8 bytes\nfunction align(size: number): number {\n  return size % 8 ? (Math.floor(size / 8) + 1) << 3 : size;\n}\n"
  },
  {
    "path": "Libraries/Vibration/RCTVibration.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridgeModule.h>\n\n@interface RCTVibration : NSObject <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "Libraries/Vibration/RCTVibration.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTVibration.h\"\n\n#import <AudioToolbox/AudioToolbox.h>\n\n@implementation RCTVibration\n\nRCT_EXPORT_MODULE()\n\nRCT_EXPORT_METHOD(vibrate)\n{\n  AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Vibration/RCTVibration.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t832C819C1AAF6E1A007FA2F7 /* RCTVibration.m in Sources */ = {isa = PBXBuildFile; fileRef = 832C819B1AAF6E1A007FA2F7 /* RCTVibration.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t832C81801AAF6DEF007FA2F7 /* libRCTVibration.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTVibration.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t832C819A1AAF6E1A007FA2F7 /* RCTVibration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTVibration.h; sourceTree = \"<group>\"; };\n\t\t832C819B1AAF6E1A007FA2F7 /* RCTVibration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTVibration.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXGroup section */\n\t\t832C81771AAF6DEF007FA2F7 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t832C819A1AAF6E1A007FA2F7 /* RCTVibration.h */,\n\t\t\t\t832C819B1AAF6E1A007FA2F7 /* RCTVibration.m */,\n\t\t\t\t832C81811AAF6DEF007FA2F7 /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t832C81811AAF6DEF007FA2F7 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t832C81801AAF6DEF007FA2F7 /* libRCTVibration.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t832C817F1AAF6DEF007FA2F7 /* RCTVibration */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 832C81941AAF6DF0007FA2F7 /* Build configuration list for PBXNativeTarget \"RCTVibration\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t832C817C1AAF6DEF007FA2F7 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTVibration;\n\t\t\tproductName = RCTVibration;\n\t\t\tproductReference = 832C81801AAF6DEF007FA2F7 /* libRCTVibration.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t832C81781AAF6DEF007FA2F7 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0620;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t832C817F1AAF6DEF007FA2F7 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.2;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 832C817B1AAF6DEF007FA2F7 /* Build configuration list for PBXProject \"RCTVibration\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 832C81771AAF6DEF007FA2F7;\n\t\t\tproductRefGroup = 832C81811AAF6DEF007FA2F7 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t832C817F1AAF6DEF007FA2F7 /* RCTVibration */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t832C817C1AAF6DEF007FA2F7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t832C819C1AAF6E1A007FA2F7 /* RCTVibration.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t832C81921AAF6DF0007FA2F7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t832C81931AAF6DF0007FA2F7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t832C81951AAF6DF0007FA2F7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t832C81961AAF6DF0007FA2F7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t832C817B1AAF6DEF007FA2F7 /* Build configuration list for PBXProject \"RCTVibration\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t832C81921AAF6DF0007FA2F7 /* Debug */,\n\t\t\t\t832C81931AAF6DF0007FA2F7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t832C81941AAF6DF0007FA2F7 /* Build configuration list for PBXNativeTarget \"RCTVibration\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t832C81951AAF6DF0007FA2F7 /* Debug */,\n\t\t\t\t832C81961AAF6DF0007FA2F7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 832C81781AAF6DEF007FA2F7 /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/Vibration/Vibration.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Vibration\n * @flow\n * @jsdoc\n */\n 'use strict';\n\n var warning = require('fbjs/lib/warning');\n\n var Vibration = {\n   cancel: function() {\n     warning('Vibration is not supported on this platform!');\n   },\n   vibrate: function() {\n     warning('Vibration is not supported on this platform!');\n   }\n };\n\n module.exports = Vibration;\n"
  },
  {
    "path": "Libraries/Vibration/VibrationIOS.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * Stub of VibrationIOS for Android.\n *\n * @providesModule VibrationIOS\n */\n'use strict';\n\nvar warning = require('fbjs/lib/warning');\n\nvar VibrationIOS = {\n  vibrate: function() {\n    warning('VibrationIOS is not supported on this platform!');\n  }\n};\n\nmodule.exports = VibrationIOS;\n"
  },
  {
    "path": "Libraries/Vibration/VibrationIOS.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule VibrationIOS\n * @flow\n */\n'use strict';\n\nvar RCTVibration = require('NativeModules').Vibration;\n\nvar invariant = require('fbjs/lib/invariant');\n\n/**\n * NOTE: `VibrationIOS` is being deprecated. Use `Vibration` instead.\n *\n * The Vibration API is exposed at `VibrationIOS.vibrate()`. On iOS, calling this\n * function will trigger a one second vibration. The vibration is asynchronous\n * so this method will return immediately.\n *\n * There will be no effect on devices that do not support Vibration, eg. the iOS\n * simulator.\n *\n * Vibration patterns are currently unsupported.\n */\n\nvar VibrationIOS = {\n  /**\n   * @deprecated\n   */\n  vibrate: function() {\n    invariant(\n      arguments[0] === undefined,\n      'Vibration patterns not supported.'\n    );\n    RCTVibration.vibrate();\n  }\n};\n\nmodule.exports = VibrationIOS;\n"
  },
  {
    "path": "Libraries/Vibration/VibrationIOS.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * Stub of VibrationIOS for Android.\n *\n * @providesModule VibrationIOS\n */\n'use strict';\n\nvar warning = require('fbjs/lib/warning');\n\nvar VibrationIOS = {\n  vibrate: function() {\n    warning('VibrationIOS is not supported on this platform!');\n  }\n};\n\nmodule.exports = VibrationIOS;\n"
  },
  {
    "path": "Libraries/WebSocket/RCTReconnectingWebSocket.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTDefines.h>\n\n#if RCT_DEV // Only supported in dev mode\n\n@class RCTReconnectingWebSocket;\n\n@protocol RCTReconnectingWebSocketDelegate\n- (void)reconnectingWebSocketDidOpen:(RCTReconnectingWebSocket *)webSocket;\n- (void)reconnectingWebSocket:(RCTReconnectingWebSocket *)webSocket didReceiveMessage:(id)message;\n/** Sent when the socket has closed due to error or clean shutdown. An automatic reconnect will start shortly. */\n- (void)reconnectingWebSocketDidClose:(RCTReconnectingWebSocket *)webSocket;\n@end\n\n@interface RCTReconnectingWebSocket : NSObject\n\n/** Delegate will be messaged on the given queue (required). */\n- (instancetype)initWithURL:(NSURL *)url queue:(dispatch_queue_t)queue;\n\n@property (nonatomic, weak) id<RCTReconnectingWebSocketDelegate> delegate;\n- (void)send:(id)data;\n- (void)start;\n- (void)stop;\n\n- (instancetype)initWithURL:(NSURL *)url __deprecated_msg(\"Use initWithURL:queue: instead\");\n/** @brief Must be set before -start to have effect */\n@property (nonatomic, strong) dispatch_queue_t delegateDispatchQueue __deprecated_msg(\"Use initWithURL:queue: instead\");\n\n@end\n\n#endif\n"
  },
  {
    "path": "Libraries/WebSocket/RCTReconnectingWebSocket.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTReconnectingWebSocket.h\"\n\n#import <React/RCTConvert.h>\n#import <React/RCTDefines.h>\n#import <fishhook/fishhook.h>\n\n#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */\n#import <os/log.h>\n#endif /* __IPHONE_11_0 */\n\n#import \"RCTSRWebSocket.h\"\n\n#if RCT_DEV // Only supported in dev mode\n\nstatic void (*orig_nwlog_legacy_v)(int, char*, va_list);\n\nstatic void my_nwlog_legacy_v(int level, char *format, va_list args) {\n  static const uint buffer_size = 256;\n  static char buffer[buffer_size];\n  va_list copy;\n  va_copy(copy, args);\n  vsnprintf(buffer, buffer_size, format, copy);\n  va_end(copy);\n\n  if (strstr(buffer, \"nw_connection_get_connected_socket_block_invoke\") == NULL &&\n      strstr(buffer, \"Connection has no connected handler\") == NULL) {\n    orig_nwlog_legacy_v(level, format, args);\n  }\n}\n\n#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */\n\nstatic void (*orig_os_log_error_impl)(void *dso, os_log_t log, os_log_type_t type, const char *format, uint8_t *buf, uint32_t size);\n\nstatic void my_os_log_error_impl(void *dso, os_log_t log, os_log_type_t type, const char *format, uint8_t *buf, uint32_t size)\n{\n  if (strstr(format, \"TCP Conn %p Failed : error %ld:%d\") == NULL) {\n    orig_os_log_error_impl(dso, log, type, format, buf, size);\n  }\n}\n\n#endif /* __IPHONE_11_0 */\n\n@interface RCTReconnectingWebSocket () <RCTSRWebSocketDelegate>\n@end\n\n@implementation RCTReconnectingWebSocket {\n  NSURL *_url;\n  RCTSRWebSocket *_socket;\n}\n\n+ (void)load\n{\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    rebind_symbols((struct rebinding[1]){\n      {\"nwlog_legacy_v\", my_nwlog_legacy_v, (void *)&orig_nwlog_legacy_v}\n    }, 1);\n#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */\n    rebind_symbols((struct rebinding[1]){\n      {\"_os_log_error_impl\", my_os_log_error_impl, (void *)&orig_os_log_error_impl}\n    }, 1);\n#endif /* __IPHONE_11_0 */\n  });\n}\n\n- (instancetype)initWithURL:(NSURL *)url queue:(dispatch_queue_t)queue\n{\n  if (self = [super init]) {\n    _url = url;\n    _delegateDispatchQueue = queue;\n  }\n  return self;\n}\n\n- (instancetype)initWithURL:(NSURL *)url\n{\n  return [self initWithURL:url queue:dispatch_get_main_queue()];\n}\n\n- (void)send:(id)data\n{\n  [_socket send:data];\n}\n\n- (void)start\n{\n  [self stop];\n  _socket = [[RCTSRWebSocket alloc] initWithURL:_url];\n  _socket.delegate = self;\n  [_socket setDelegateDispatchQueue:_delegateDispatchQueue];\n  [_socket open];\n}\n\n- (void)stop\n{\n  _socket.delegate = nil;\n  [_socket closeWithCode:1000 reason:@\"Invalidated\"];\n  _socket = nil;\n}\n\n- (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message\n{\n  [_delegate reconnectingWebSocket:self didReceiveMessage:message];\n}\n\n- (void)reconnect\n{\n  __weak RCTSRWebSocket *socket = _socket;\n  dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{\n    // Only reconnect if the observer wasn't stoppped while we were waiting\n    if (socket) {\n      [self start];\n    }\n  });\n}\n\n- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket\n{\n  [_delegate reconnectingWebSocketDidOpen:self];\n}\n\n- (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error\n{\n  [_delegate reconnectingWebSocketDidClose:self];\n  [self reconnect];\n}\n\n- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean\n{\n  [_delegate reconnectingWebSocketDidClose:self];\n  [self reconnect];\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "Libraries/WebSocket/RCTSRWebSocket.h",
    "content": "//\n//   Copyright 2012 Square Inc.\n//\n//   Licensed under the Apache License, Version 2.0 (the \"License\");\n//   you may not use this file except in compliance with the License.\n//   You may obtain a copy of the License at\n//\n//       http://www.apache.org/licenses/LICENSE-2.0\n//\n//   Unless required by applicable law or agreed to in writing, software\n//   distributed under the License is distributed on an \"AS IS\" BASIS,\n//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//   See the License for the specific language governing permissions and\n//   limitations under the License.\n//\n\n#import <Foundation/Foundation.h>\n#import <Security/SecCertificate.h>\n\ntypedef NS_ENUM(unsigned int, RCTSRReadyState) {\n    RCTSR_CONNECTING   = 0,\n    RCTSR_OPEN         = 1,\n    RCTSR_CLOSING      = 2,\n    RCTSR_CLOSED       = 3,\n};\n\ntypedef NS_ENUM(NSInteger, RCTSRStatusCode) {\n    RCTSRStatusCodeNormal = 1000,\n    RCTSRStatusCodeGoingAway = 1001,\n    RCTSRStatusCodeProtocolError = 1002,\n    RCTSRStatusCodeUnhandledType = 1003,\n    // 1004 reserved.\n    RCTSRStatusNoStatusReceived = 1005,\n    // 1004-1006 reserved.\n    RCTSRStatusCodeInvalidUTF8 = 1007,\n    RCTSRStatusCodePolicyViolated = 1008,\n    RCTSRStatusCodeMessageTooBig = 1009,\n};\n\n@class RCTSRWebSocket;\n\nextern NSString *const RCTSRWebSocketErrorDomain;\nextern NSString *const RCTSRHTTPResponseErrorKey;\n\n#pragma mark - RCTSRWebSocketDelegate\n\n@protocol RCTSRWebSocketDelegate;\n\n#pragma mark - RCTSRWebSocket\n\n@interface RCTSRWebSocket : NSObject <NSStreamDelegate>\n\n@property (nonatomic, weak) id<RCTSRWebSocketDelegate> delegate;\n\n@property (nonatomic, readonly) RCTSRReadyState readyState;\n@property (nonatomic, readonly, strong) NSURL *url;\n\n// This returns the negotiated protocol.\n// It will be nil until after the handshake completes.\n@property (nonatomic, readonly, copy) NSString *protocol;\n\n// Protocols should be an array of strings that turn into Sec-WebSocket-Protocol.\n- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray<NSString *> *)protocols NS_DESIGNATED_INITIALIZER;\n- (instancetype)initWithURLRequest:(NSURLRequest *)request;\n\n// Some helper constructors.\n- (instancetype)initWithURL:(NSURL *)url protocols:(NSArray<NSString *> *)protocols;\n- (instancetype)initWithURL:(NSURL *)url;\n\n// Delegate queue will be dispatch_main_queue by default.\n// You cannot set both OperationQueue and dispatch_queue.\n- (void)setDelegateOperationQueue:(NSOperationQueue *)queue;\n- (void)setDelegateDispatchQueue:(dispatch_queue_t)queue;\n\n// By default, it will schedule itself on +[NSRunLoop RCTSR_networkRunLoop] using defaultModes.\n- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode;\n- (void)unscheduleFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode;\n\n// RCTSRWebSockets are intended for one-time-use only.  Open should be called once and only once.\n- (void)open;\n\n- (void)close;\n- (void)closeWithCode:(NSInteger)code reason:(NSString *)reason;\n\n// Send a UTF8 String or Data.\n- (void)send:(id)data;\n\n// Send Data (can be nil) in a ping message.\n- (void)sendPing:(NSData *)data;\n\n@end\n\n#pragma mark - RCTSRWebSocketDelegate\n\n@protocol RCTSRWebSocketDelegate <NSObject>\n\n// message will either be an NSString if the server is using text\n// or NSData if the server is using binary.\n- (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message;\n\n@optional\n\n- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket;\n- (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error;\n- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean;\n- (void)webSocket:(RCTSRWebSocket *)webSocket didReceivePong:(NSData *)pongPayload;\n\n@end\n\n#pragma mark - NSURLRequest (CertificateAdditions)\n\n@interface NSURLRequest (CertificateAdditions)\n\n@property (nonatomic, readonly, copy) NSArray *RCTSR_SSLPinnedCertificates;\n\n@end\n\n#pragma mark - NSMutableURLRequest (CertificateAdditions)\n\n@interface NSMutableURLRequest (CertificateAdditions)\n\n@property (nonatomic, copy) NSArray *RCTSR_SSLPinnedCertificates;\n\n@end\n\n#pragma mark - NSRunLoop (RCTSRWebSocket)\n\n@interface NSRunLoop (RCTSRWebSocket)\n\n+ (NSRunLoop *)RCTSR_networkRunLoop;\n\n@end\n"
  },
  {
    "path": "Libraries/WebSocket/RCTSRWebSocket.m",
    "content": "//\n//   Copyright 2012 Square Inc.\n//\n//   Licensed under the Apache License, Version 2.0 (the \"License\");\n//   you may not use this file except in compliance with the License.\n//   You may obtain a copy of the License at\n//\n//       http://www.apache.org/licenses/LICENSE-2.0\n//\n//   Unless required by applicable law or agreed to in writing, software\n//   distributed under the License is distributed on an \"AS IS\" BASIS,\n//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//   See the License for the specific language governing permissions and\n//   limitations under the License.\n//\n\n#import \"RCTSRWebSocket.h\"\n\n#import <Availability.h>\n\n#import <Security/SecRandom.h>\n\n#import <CommonCrypto/CommonDigest.h>\n#import <React/RCTAssert.h>\n#import <React/RCTLog.h>\n\ntypedef NS_ENUM(NSInteger, RCTSROpCode)  {\n  RCTSROpCodeTextFrame = 0x1,\n  RCTSROpCodeBinaryFrame = 0x2,\n  // 3-7 reserved.\n  RCTSROpCodeConnectionClose = 0x8,\n  RCTSROpCodePing = 0x9,\n  RCTSROpCodePong = 0xA,\n  // B-F reserved.\n};\n\ntypedef struct {\n  BOOL fin;\n  //  BOOL rsv1;\n  //  BOOL rsv2;\n  //  BOOL rsv3;\n  uint8_t opcode;\n  BOOL masked;\n  uint64_t payload_length;\n} frame_header;\n\nstatic NSString *const RCTSRWebSocketAppendToSecKeyString = @\"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\";\n\n//#define RCTSR_ENABLE_LOG\n#ifdef RCTSR_ENABLE_LOG\n#define RCTSRLog(format...) RCTLogInfo(format)\n#else\n#define RCTSRLog(...) do { } while (0)\n#endif\n\n// This is a hack, and probably not optimal\nstatic inline int32_t validate_dispatch_data_partial_string(NSData *data)\n{\n  static const int maxCodepointSize = 3;\n\n  for (int i = 0; i < maxCodepointSize; i++) {\n    NSString *str = [[NSString alloc] initWithBytesNoCopy:(char *)data.bytes length:data.length - i encoding:NSUTF8StringEncoding freeWhenDone:NO];\n    if (str) {\n      return (int32_t)data.length - i;\n    }\n  }\n\n  return -1;\n}\n\n@interface NSData (RCTSRWebSocket)\n\n@property (nonatomic, readonly, copy) NSString *stringBySHA1ThenBase64Encoding;\n\n@end\n\n\n@interface NSString (RCTSRWebSocket)\n\n@property (nonatomic, readonly, copy) NSString *stringBySHA1ThenBase64Encoding;\n\n@end\n\n\n@interface NSURL (RCTSRWebSocket)\n\n// The origin isn't really applicable for a native application.\n// So instead, just map ws -> http and wss -> https.\n@property (nonatomic, readonly, copy) NSString *RCTSR_origin;\n\n@end\n\n\n@interface _RCTSRRunLoopThread : NSThread\n\n@property (nonatomic, readonly) NSRunLoop *runLoop;\n\n@end\n\n\nstatic NSString *newSHA1String(const char *bytes, size_t length)\n{\n  uint8_t md[CC_SHA1_DIGEST_LENGTH];\n\n  assert(length >= 0);\n  assert(length <= UINT32_MAX);\n  CC_SHA1(bytes, (CC_LONG)length, md);\n\n  NSData *data = [NSData dataWithBytes:md length:CC_SHA1_DIGEST_LENGTH];\n  return [data base64EncodedStringWithOptions:0];\n}\n\n@implementation NSData (RCTSRWebSocket)\n\n- (NSString *)stringBySHA1ThenBase64Encoding;\n{\n  return newSHA1String(self.bytes, self.length);\n}\n\n@end\n\n\n@implementation NSString (RCTSRWebSocket)\n\n- (NSString *)stringBySHA1ThenBase64Encoding;\n{\n  return newSHA1String(self.UTF8String, self.length);\n}\n\n@end\n\nNSString *const RCTSRWebSocketErrorDomain = @\"RCTSRWebSocketErrorDomain\";\nNSString *const RCTSRHTTPResponseErrorKey = @\"HTTPResponseStatusCode\";\n\n// Returns number of bytes consumed. Returning 0 means you didn't match.\n// Sends bytes to callback handler;\ntypedef size_t (^stream_scanner)(NSData *collected_data);\n\ntypedef void (^data_callback)(RCTSRWebSocket *webSocket,  NSData *data);\n\n@interface RCTSRIOConsumer : NSObject\n\n@property (nonatomic, copy, readonly) stream_scanner consumer;\n@property (nonatomic, copy, readonly) data_callback handler;\n@property (nonatomic, assign) size_t bytesNeeded;\n@property (nonatomic, assign, readonly) BOOL readToCurrentFrame;\n@property (nonatomic, assign, readonly) BOOL unmaskBytes;\n\n@end\n\n// This class is not thread-safe, and is expected to always be run on the same queue.\n@interface RCTSRIOConsumerPool : NSObject\n\n- (instancetype)initWithBufferCapacity:(NSUInteger)poolSize NS_DESIGNATED_INITIALIZER;\n\n- (RCTSRIOConsumer *)consumerWithScanner:(stream_scanner)scanner handler:(data_callback)handler bytesNeeded:(size_t)bytesNeeded readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes;\n- (void)returnConsumer:(RCTSRIOConsumer *)consumer;\n\n@end\n\n@interface RCTSRWebSocket ()  <NSStreamDelegate>\n\n@property (nonatomic, assign) RCTSRReadyState readyState;\n\n@property (nonatomic, strong) NSOperationQueue *delegateOperationQueue;\n@property (nonatomic, strong) dispatch_queue_t delegateDispatchQueue;\n\n@end\n\n@implementation RCTSRWebSocket\n{\n  NSInteger _webSocketVersion;\n\n  NSOperationQueue *_delegateOperationQueue;\n  dispatch_queue_t _delegateDispatchQueue;\n\n  dispatch_queue_t _workQueue;\n  NSMutableArray<RCTSRIOConsumer *> *_consumers;\n\n  NSInputStream *_inputStream;\n  NSOutputStream *_outputStream;\n\n  NSMutableData *_readBuffer;\n  NSUInteger _readBufferOffset;\n\n  NSMutableData *_outputBuffer;\n  NSUInteger _outputBufferOffset;\n\n  uint8_t _currentFrameOpcode;\n  size_t _currentFrameCount;\n  size_t _readOpCount;\n  uint32_t _currentStringScanPosition;\n  NSMutableData *_currentFrameData;\n\n  NSString *_closeReason;\n\n  NSString *_secKey;\n\n  BOOL _pinnedCertFound;\n\n  uint8_t _currentReadMaskKey[4];\n  size_t _currentReadMaskOffset;\n\n  BOOL _consumerStopped;\n\n  BOOL _closeWhenFinishedWriting;\n  BOOL _failed;\n\n  BOOL _secure;\n  NSURLRequest *_urlRequest;\n\n  CFHTTPMessageRef _receivedHTTPHeaders;\n\n  BOOL _sentClose;\n  BOOL _didFail;\n  int _closeCode;\n\n  BOOL _isPumping;\n\n  NSMutableSet<NSArray *> *_scheduledRunloops;\n\n  // We use this to retain ourselves.\n  __strong RCTSRWebSocket *_selfRetain;\n\n  NSArray<NSString *> *_requestedProtocols;\n  RCTSRIOConsumerPool *_consumerPool;\n}\n\n- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray<NSString *> *)protocols\n{\n  RCTAssertParam(request);\n\n  if ((self = [super init])) {\n    _url = request.URL;\n    _urlRequest = request;\n\n    _requestedProtocols = [protocols copy];\n\n    [self _RCTSR_commonInit];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (instancetype)initWithURLRequest:(NSURLRequest *)request;\n{\n  return [self initWithURLRequest:request protocols:nil];\n}\n\n- (instancetype)initWithURL:(NSURL *)URL;\n{\n  return [self initWithURL:URL protocols:nil];\n}\n\n- (instancetype)initWithURL:(NSURL *)URL protocols:(NSArray<NSString *> *)protocols;\n{\n  NSMutableURLRequest *request;\n  if (URL) {\n    // Build a mutable request so we can fill the cookie header.\n    request = [NSMutableURLRequest requestWithURL:URL];\n\n    // We load cookies from sharedHTTPCookieStorage (shared with XHR and\n    // fetch). To get HTTPS-only cookies for wss URLs, replace wss with https\n    // in the URL.\n    NSURLComponents *components = [NSURLComponents componentsWithURL:URL resolvingAgainstBaseURL:true];\n    if ([components.scheme isEqualToString:@\"wss\"]) {\n      components.scheme = @\"https\";\n    }\n    // Load and set the cookie header.\n    if ([NSHTTPCookieStorage sharedHTTPCookieStorage].cookies.count > 0 && components) {\n      NSArray<NSHTTPCookie *> *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:components.URL];\n      [request setAllHTTPHeaderFields:[NSHTTPCookie requestHeaderFieldsWithCookies:cookies]];\n    }\n  }\n  return [self initWithURLRequest:request protocols:protocols];\n}\n\n- (void)_RCTSR_commonInit;\n{\n  NSString *scheme = _url.scheme.lowercaseString;\n  assert([scheme isEqualToString:@\"ws\"] || [scheme isEqualToString:@\"http\"] || [scheme isEqualToString:@\"wss\"] || [scheme isEqualToString:@\"https\"]);\n\n  if ([scheme isEqualToString:@\"wss\"] || [scheme isEqualToString:@\"https\"]) {\n    _secure = YES;\n  }\n\n  _readyState = RCTSR_CONNECTING;\n  _consumerStopped = YES;\n  _webSocketVersion = 13;\n\n  _workQueue = dispatch_queue_create(\"com.facebook.react.SRWebSocket\", DISPATCH_QUEUE_SERIAL);\n\n  // Going to set a specific on the queue so we can validate we're on the work queue\n  dispatch_queue_set_specific(_workQueue, (__bridge void *)self, (__bridge void *)_workQueue, NULL);\n\n  _delegateDispatchQueue = dispatch_get_main_queue();\n\n  _readBuffer = [NSMutableData new];\n  _outputBuffer = [NSMutableData new];\n\n  _currentFrameData = [NSMutableData new];\n\n  _consumers = [NSMutableArray new];\n\n  _consumerPool = [RCTSRIOConsumerPool new];\n\n  _scheduledRunloops = [NSMutableSet new];\n\n  [self _initializeStreams];\n\n  // default handlers\n}\n\n- (void)assertOnWorkQueue;\n{\n  assert(dispatch_get_specific((__bridge void *)self) == (__bridge void *)_workQueue);\n}\n\n- (void)dealloc\n{\n  _inputStream.delegate = nil;\n  _outputStream.delegate = nil;\n\n  [_inputStream close];\n  [_outputStream close];\n\n  _workQueue = NULL;\n\n  if (_receivedHTTPHeaders) {\n    CFRelease(_receivedHTTPHeaders);\n    _receivedHTTPHeaders = NULL;\n  }\n\n  if (_delegateDispatchQueue) {\n    _delegateDispatchQueue = NULL;\n  }\n}\n\n#ifndef NDEBUG\n\n- (void)setReadyState:(RCTSRReadyState)aReadyState;\n{\n  [self willChangeValueForKey:@\"readyState\"];\n  assert(aReadyState > _readyState);\n  _readyState = aReadyState;\n  [self didChangeValueForKey:@\"readyState\"];\n}\n\n#endif\n\n- (void)open;\n{\n  assert(_url);\n  RCTAssert(_readyState == RCTSR_CONNECTING, @\"Cannot call -(void)open on RCTSRWebSocket more than once\");\n\n  _selfRetain = self;\n\n  [self _connect];\n}\n\n// Calls block on delegate queue\n- (void)_performDelegateBlock:(dispatch_block_t)block;\n{\n  if (_delegateOperationQueue) {\n    [_delegateOperationQueue addOperationWithBlock:block];\n  } else {\n    assert(_delegateDispatchQueue);\n    dispatch_async(_delegateDispatchQueue, block);\n  }\n}\n\n- (void)setDelegateDispatchQueue:(dispatch_queue_t)queue;\n{\n  _delegateDispatchQueue = queue;\n}\n\n- (BOOL)_checkHandshake:(CFHTTPMessageRef)httpMessage;\n{\n  NSString *acceptHeader = CFBridgingRelease(CFHTTPMessageCopyHeaderFieldValue(httpMessage, CFSTR(\"Sec-WebSocket-Accept\")));\n\n  if (acceptHeader == nil) {\n    return NO;\n  }\n\n  NSString *concattedString = [_secKey stringByAppendingString:RCTSRWebSocketAppendToSecKeyString];\n  NSString *expectedAccept = [concattedString stringBySHA1ThenBase64Encoding];\n\n  return [acceptHeader isEqualToString:expectedAccept];\n}\n\n- (void)_HTTPHeadersDidFinish;\n{\n  NSInteger responseCode = CFHTTPMessageGetResponseStatusCode(_receivedHTTPHeaders);\n\n  if (responseCode >= 400) {\n    RCTSRLog(@\"Request failed with response code %ld\", responseCode);\n    [self _failWithError:[NSError errorWithDomain:RCTSRWebSocketErrorDomain code:2132 userInfo:@{NSLocalizedDescriptionKey:[NSString stringWithFormat:@\"received bad response code from server %ld\", (long)responseCode], RCTSRHTTPResponseErrorKey:@(responseCode)}]];\n    return;\n  }\n\n  if (![self _checkHandshake:_receivedHTTPHeaders]) {\n    [self _failWithError:[NSError errorWithDomain:RCTSRWebSocketErrorDomain code:2133 userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@\"Invalid Sec-WebSocket-Accept response\"]}]];\n    return;\n  }\n\n  NSString *negotiatedProtocol = CFBridgingRelease(CFHTTPMessageCopyHeaderFieldValue(_receivedHTTPHeaders, CFSTR(\"Sec-WebSocket-Protocol\")));\n  if (negotiatedProtocol) {\n    // Make sure we requested the protocol\n    if ([_requestedProtocols indexOfObject:negotiatedProtocol] == NSNotFound) {\n      [self _failWithError:[NSError errorWithDomain:RCTSRWebSocketErrorDomain code:2133 userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@\"Server specified Sec-WebSocket-Protocol that wasn't requested\"]}]];\n      return;\n    }\n\n    _protocol = negotiatedProtocol;\n  }\n\n  self.readyState = RCTSR_OPEN;\n\n  if (!_didFail) {\n    [self _readFrameNew];\n  }\n\n  [self _performDelegateBlock:^{\n    if ([self.delegate respondsToSelector:@selector(webSocketDidOpen:)]) {\n      [self.delegate webSocketDidOpen:self];\n    };\n  }];\n}\n\n- (void)_readHTTPHeader;\n{\n  if (_receivedHTTPHeaders == NULL) {\n    _receivedHTTPHeaders = CFHTTPMessageCreateEmpty(NULL, NO);\n  }\n\n  [self _readUntilHeaderCompleteWithCallback:^(RCTSRWebSocket *socket,  NSData *data) {\n    CFHTTPMessageAppendBytes(self->_receivedHTTPHeaders, (const UInt8 *)data.bytes, data.length);\n\n    if (CFHTTPMessageIsHeaderComplete(self->_receivedHTTPHeaders)) {\n      RCTSRLog(@\"Finished reading headers %@\", CFBridgingRelease(CFHTTPMessageCopyAllHeaderFields(_receivedHTTPHeaders)));\n      [socket _HTTPHeadersDidFinish];\n    } else {\n      [socket _readHTTPHeader];\n    }\n  }];\n}\n\n- (void)didConnect\n{\n  RCTSRLog(@\"Connected\");\n  CFHTTPMessageRef request = CFHTTPMessageCreateRequest(NULL, CFSTR(\"GET\"), (__bridge CFURLRef)_url, kCFHTTPVersion1_1);\n\n  // Set host first so it defaults\n  CFHTTPMessageSetHeaderFieldValue(request, CFSTR(\"Host\"), (__bridge CFStringRef)(_url.port ? [NSString stringWithFormat:@\"%@:%@\", _url.host, _url.port] : _url.host));\n\n  NSMutableData *keyBytes = [[NSMutableData alloc] initWithLength:16];\n  int result = SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes);\n  assert(result == 0);\n  _secKey = [keyBytes base64EncodedStringWithOptions:0];\n  assert([_secKey length] == 24);\n\n  CFHTTPMessageSetHeaderFieldValue(request, CFSTR(\"Upgrade\"), CFSTR(\"websocket\"));\n  CFHTTPMessageSetHeaderFieldValue(request, CFSTR(\"Connection\"), CFSTR(\"Upgrade\"));\n  CFHTTPMessageSetHeaderFieldValue(request, CFSTR(\"Sec-WebSocket-Key\"), (__bridge CFStringRef)_secKey);\n  CFHTTPMessageSetHeaderFieldValue(request, CFSTR(\"Sec-WebSocket-Version\"), (__bridge CFStringRef)[NSString stringWithFormat:@\"%ld\", (long)_webSocketVersion]);\n\n  CFHTTPMessageSetHeaderFieldValue(request, CFSTR(\"Origin\"), (__bridge CFStringRef)_url.RCTSR_origin);\n\n  if (_requestedProtocols) {\n    CFHTTPMessageSetHeaderFieldValue(request, CFSTR(\"Sec-WebSocket-Protocol\"), (__bridge CFStringRef)[_requestedProtocols componentsJoinedByString:@\", \"]);\n  }\n\n  [_urlRequest.allHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {\n    CFHTTPMessageSetHeaderFieldValue(request, (__bridge CFStringRef)key, (__bridge CFStringRef)obj);\n  }];\n\n  NSData *message = CFBridgingRelease(CFHTTPMessageCopySerializedMessage(request));\n\n  CFRelease(request);\n\n  [self _writeData:message];\n  [self _readHTTPHeader];\n}\n\n- (void)_initializeStreams;\n{\n  assert(_url.port.unsignedIntValue <= UINT32_MAX);\n  uint32_t port = _url.port.unsignedIntValue;\n  if (port == 0) {\n    if (!_secure) {\n      port = 80;\n    } else {\n      port = 443;\n    }\n  }\n  NSString *host = _url.host;\n\n  CFReadStreamRef readStream = NULL;\n  CFWriteStreamRef writeStream = NULL;\n\n  CFStreamCreatePairWithSocketToHost(NULL, (__bridge CFStringRef)host, port, &readStream, &writeStream);\n\n  _outputStream = CFBridgingRelease(writeStream);\n  _inputStream = CFBridgingRelease(readStream);\n\n\n  if (_secure) {\n    NSMutableDictionary<NSString *, id> *SSLOptions = [NSMutableDictionary new];\n\n    [_outputStream setProperty:(__bridge id)kCFStreamSocketSecurityLevelNegotiatedSSL forKey:(__bridge id)kCFStreamPropertySocketSecurityLevel];\n\n    // If we're using pinned certs, don't validate the certificate chain\n    if (_urlRequest.RCTSR_SSLPinnedCertificates.count) {\n      [SSLOptions setValue:@NO forKey:(__bridge id)kCFStreamSSLValidatesCertificateChain];\n    }\n\n#if DEBUG\n    [SSLOptions setValue:@NO forKey:(__bridge id)kCFStreamSSLValidatesCertificateChain];\n    RCTLogInfo(@\"SocketRocket: In debug mode.  Allowing connection to any root cert\");\n#endif\n\n    [_outputStream setProperty:SSLOptions\n                        forKey:(__bridge id)kCFStreamPropertySSLSettings];\n  }\n\n  _inputStream.delegate = self;\n  _outputStream.delegate = self;\n}\n\n- (void)_connect;\n{\n  if (!_scheduledRunloops.count) {\n    [self scheduleInRunLoop:[NSRunLoop RCTSR_networkRunLoop] forMode:NSDefaultRunLoopMode];\n  }\n\n  [_outputStream open];\n  [_inputStream open];\n}\n\n- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode;\n{\n  [_outputStream scheduleInRunLoop:aRunLoop forMode:mode];\n  [_inputStream scheduleInRunLoop:aRunLoop forMode:mode];\n\n  [_scheduledRunloops addObject:@[aRunLoop, mode]];\n}\n\n- (void)unscheduleFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode;\n{\n  [_outputStream removeFromRunLoop:aRunLoop forMode:mode];\n  [_inputStream removeFromRunLoop:aRunLoop forMode:mode];\n\n  [_scheduledRunloops removeObject:@[aRunLoop, mode]];\n}\n\n- (void)close;\n{\n  [self closeWithCode:RCTSRStatusCodeNormal reason:nil];\n}\n\n- (void)closeWithCode:(NSInteger)code reason:(NSString *)reason;\n{\n  assert(code);\n  dispatch_async(_workQueue, ^{\n    if (self.readyState == RCTSR_CLOSING || self.readyState == RCTSR_CLOSED) {\n      return;\n    }\n\n    BOOL wasConnecting = self.readyState == RCTSR_CONNECTING;\n\n    self.readyState = RCTSR_CLOSING;\n\n    RCTSRLog(@\"Closing with code %ld reason %@\", code, reason);\n\n    if (wasConnecting) {\n      [self _disconnect];\n      return;\n    }\n\n    size_t maxMsgSize = [reason maximumLengthOfBytesUsingEncoding:NSUTF8StringEncoding];\n    NSMutableData *mutablePayload = [[NSMutableData alloc] initWithLength:sizeof(uint16_t) + maxMsgSize];\n    NSData *payload = mutablePayload;\n\n    ((uint16_t *)mutablePayload.mutableBytes)[0] = EndianU16_BtoN(code);\n\n    if (reason) {\n      NSRange remainingRange = {0};\n\n      NSUInteger usedLength = 0;\n\n      BOOL success = [reason getBytes:(char *)mutablePayload.mutableBytes + sizeof(uint16_t) maxLength:payload.length - sizeof(uint16_t) usedLength:&usedLength encoding:NSUTF8StringEncoding options:NSStringEncodingConversionExternalRepresentation range:NSMakeRange(0, reason.length) remainingRange:&remainingRange];\n\n      assert(success);\n      assert(remainingRange.length == 0);\n\n      if (usedLength != maxMsgSize) {\n        payload = [payload subdataWithRange:NSMakeRange(0, usedLength + sizeof(uint16_t))];\n      }\n    }\n\n    [self _sendFrameWithOpcode:RCTSROpCodeConnectionClose data:payload];\n  });\n}\n\n- (void)_closeWithProtocolError:(NSString *)message;\n{\n  // Need to shunt this on the _callbackQueue first to see if they received any messages\n  [self _performDelegateBlock:^{\n    [self closeWithCode:RCTSRStatusCodeProtocolError reason:message];\n    dispatch_async(self->_workQueue, ^{\n      [self _disconnect];\n    });\n  }];\n}\n\n- (void)_failWithError:(NSError *)error;\n{\n  dispatch_async(_workQueue, ^{\n    if (self.readyState != RCTSR_CLOSED) {\n      self->_failed = YES;\n      [self _performDelegateBlock:^{\n        if ([self.delegate respondsToSelector:@selector(webSocket:didFailWithError:)]) {\n          [self.delegate webSocket:self didFailWithError:error];\n        }\n      }];\n\n      self.readyState = RCTSR_CLOSED;\n      self->_selfRetain = nil;\n\n      RCTSRLog(@\"Failing with error %@\", error.localizedDescription);\n\n      [self _disconnect];\n    }\n  });\n}\n\n- (void)_writeData:(NSData *)data;\n{\n  [self assertOnWorkQueue];\n\n  if (_closeWhenFinishedWriting) {\n    return;\n  }\n  [_outputBuffer appendData:data];\n  [self _pumpWriting];\n}\n\n- (void)send:(id)data;\n{\n  RCTAssert(self.readyState != RCTSR_CONNECTING, @\"Invalid State: Cannot call send: until connection is open\");\n  // TODO: maybe not copy this for performance\n  data = [data copy];\n  dispatch_async(_workQueue, ^{\n    if ([data isKindOfClass:[NSString class]]) {\n      [self _sendFrameWithOpcode:RCTSROpCodeTextFrame data:[(NSString *)data dataUsingEncoding:NSUTF8StringEncoding]];\n    } else if ([data isKindOfClass:[NSData class]]) {\n      [self _sendFrameWithOpcode:RCTSROpCodeBinaryFrame data:data];\n    } else if (data == nil) {\n      [self _sendFrameWithOpcode:RCTSROpCodeTextFrame data:data];\n    } else {\n      assert(NO);\n    }\n  });\n}\n\n- (void)sendPing:(NSData *)data;\n{\n  RCTAssert(self.readyState == RCTSR_OPEN, @\"Invalid State: Cannot call send: until connection is open\");\n  // TODO: maybe not copy this for performance\n  data = [data copy] ?: [NSData data]; // It's okay for a ping to be empty\n  dispatch_async(_workQueue, ^{\n    [self _sendFrameWithOpcode:RCTSROpCodePing data:data];\n  });\n}\n\n- (void)handlePing:(NSData *)pingData;\n{\n  // Need to pingpong this off _callbackQueue first to make sure messages happen in order\n  [self _performDelegateBlock:^{\n    dispatch_async(self->_workQueue, ^{\n      [self _sendFrameWithOpcode:RCTSROpCodePong data:pingData];\n    });\n  }];\n}\n\n- (void)handlePong:(NSData *)pongData;\n{\n  RCTSRLog(@\"Received pong\");\n  [self _performDelegateBlock:^{\n    if ([self.delegate respondsToSelector:@selector(webSocket:didReceivePong:)]) {\n      [self.delegate webSocket:self didReceivePong:pongData];\n    }\n  }];\n}\n\n- (void)_handleMessage:(id)message\n{\n  RCTSRLog(@\"Received message\");\n  [self _performDelegateBlock:^{\n    [self.delegate webSocket:self didReceiveMessage:message];\n  }];\n}\n\nstatic inline BOOL closeCodeIsValid(int closeCode)\n{\n  if (closeCode < 1000) {\n    return NO;\n  }\n\n  if (closeCode >= 1000 && closeCode <= 1011) {\n    if (closeCode == 1004 ||\n        closeCode == 1005 ||\n        closeCode == 1006) {\n      return NO;\n    }\n    return YES;\n  }\n\n  if (closeCode >= 3000 && closeCode <= 3999) {\n    return YES;\n  }\n\n  if (closeCode >= 4000 && closeCode <= 4999) {\n    return YES;\n  }\n\n  return NO;\n}\n\n//  Note from RFC:\n//\n//  If there is a body, the first two\n//  bytes of the body MUST be a 2-byte unsigned integer (in network byte\n//  order) representing a status code with value /code/ defined in\n//  Section 7.4.  Following the 2-byte integer the body MAY contain UTF-8\n//  encoded data with value /reason/, the interpretation of which is not\n//  defined by this specification.\n\n- (void)handleCloseWithData:(NSData *)data;\n{\n  size_t dataSize = data.length;\n  __block uint16_t closeCode = 0;\n\n  RCTSRLog(@\"Received close frame\");\n\n  if (dataSize == 1) {\n    // TODO: handle error\n    [self _closeWithProtocolError:@\"Payload for close must be larger than 2 bytes\"];\n    return;\n  } else if (dataSize >= 2) {\n    [data getBytes:&closeCode length:sizeof(closeCode)];\n    _closeCode = EndianU16_BtoN(closeCode);\n    if (!closeCodeIsValid(_closeCode)) {\n      [self _closeWithProtocolError:[NSString stringWithFormat:@\"Cannot have close code of %d\", _closeCode]];\n      return;\n    }\n    if (dataSize > 2) {\n      _closeReason = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(2, dataSize - 2)] encoding:NSUTF8StringEncoding];\n      if (!_closeReason) {\n        [self _closeWithProtocolError:@\"Close reason MUST be valid UTF-8\"];\n        return;\n      }\n    }\n  } else {\n    _closeCode = RCTSRStatusNoStatusReceived;\n  }\n\n  [self assertOnWorkQueue];\n\n  if (self.readyState == RCTSR_OPEN) {\n    [self closeWithCode:1000 reason:nil];\n  }\n  dispatch_async(_workQueue, ^{\n    [self _disconnect];\n  });\n}\n\n- (void)_disconnect;\n{\n  [self assertOnWorkQueue];\n  RCTSRLog(@\"Trying to disconnect\");\n  _closeWhenFinishedWriting = YES;\n  [self _pumpWriting];\n}\n\n- (void)_handleFrameWithData:(NSData *)frameData opCode:(NSInteger)opcode;\n{\n  // Check that the current data is valid UTF8\n\n  BOOL isControlFrame = (opcode == RCTSROpCodePing || opcode == RCTSROpCodePong || opcode == RCTSROpCodeConnectionClose);\n  if (!isControlFrame) {\n    [self _readFrameNew];\n  } else {\n    dispatch_async(_workQueue, ^{\n      [self _readFrameContinue];\n    });\n  }\n\n  switch (opcode) {\n    case RCTSROpCodeTextFrame: {\n      NSString *str = [[NSString alloc] initWithData:frameData encoding:NSUTF8StringEncoding];\n      if (str == nil && frameData) {\n        [self closeWithCode:RCTSRStatusCodeInvalidUTF8 reason:@\"Text frames must be valid UTF-8\"];\n        dispatch_async(_workQueue, ^{\n          [self _disconnect];\n        });\n\n        return;\n      }\n      [self _handleMessage:str];\n      break;\n    }\n    case RCTSROpCodeBinaryFrame:\n      [self _handleMessage:[frameData copy]];\n      break;\n    case RCTSROpCodeConnectionClose:\n      [self handleCloseWithData:frameData];\n      break;\n    case RCTSROpCodePing:\n      [self handlePing:frameData];\n      break;\n    case RCTSROpCodePong:\n      [self handlePong:frameData];\n      break;\n    default:\n      [self _closeWithProtocolError:[NSString stringWithFormat:@\"Unknown opcode %ld\", (long)opcode]];\n      // TODO: Handle invalid opcode\n      break;\n  }\n}\n\n- (void)_handleFrameHeader:(frame_header)frame_header curData:(NSData *)curData;\n{\n  assert(frame_header.opcode != 0);\n\n  if (self.readyState != RCTSR_OPEN) {\n    return;\n  }\n\n  BOOL isControlFrame = (frame_header.opcode == RCTSROpCodePing || frame_header.opcode == RCTSROpCodePong || frame_header.opcode == RCTSROpCodeConnectionClose);\n\n  if (isControlFrame && !frame_header.fin) {\n    [self _closeWithProtocolError:@\"Fragmented control frames not allowed\"];\n    return;\n  }\n\n  if (isControlFrame && frame_header.payload_length >= 126) {\n    [self _closeWithProtocolError:@\"Control frames cannot have payloads larger than 126 bytes\"];\n    return;\n  }\n\n  if (!isControlFrame) {\n    _currentFrameOpcode = frame_header.opcode;\n    _currentFrameCount += 1;\n  }\n\n  if (frame_header.payload_length == 0) {\n    if (isControlFrame) {\n      [self _handleFrameWithData:curData opCode:frame_header.opcode];\n    } else {\n      if (frame_header.fin) {\n        [self _handleFrameWithData:_currentFrameData opCode:frame_header.opcode];\n      } else {\n        // TODO: add assert that opcode is not a control;\n        [self _readFrameContinue];\n      }\n    }\n  } else {\n    assert(frame_header.payload_length <= SIZE_T_MAX);\n    [self _addConsumerWithDataLength:(size_t)frame_header.payload_length callback:^(RCTSRWebSocket *socket, NSData *newData) {\n      if (isControlFrame) {\n        [socket _handleFrameWithData:newData opCode:frame_header.opcode];\n      } else {\n        if (frame_header.fin) {\n          [socket _handleFrameWithData:socket->_currentFrameData opCode:frame_header.opcode];\n        } else {\n          // TODO: add assert that opcode is not a control;\n          [socket _readFrameContinue];\n        }\n\n      }\n    } readToCurrentFrame:!isControlFrame unmaskBytes:frame_header.masked];\n  }\n}\n\n/* From RFC:\n\n 0                   1                   2                   3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-------+-+-------------+-------------------------------+\n |F|R|R|R| opcode|M| Payload len |    Extended payload length    |\n |I|S|S|S|  (4)  |A|     (7)     |             (16/64)           |\n |N|V|V|V|       |S|             |   (if payload len==126/127)   |\n | |1|2|3|       |K|             |                               |\n +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - +\n |     Extended payload length continued, if payload len == 127  |\n + - - - - - - - - - - - - - - - +-------------------------------+\n |                               |Masking-key, if MASK set to 1  |\n +-------------------------------+-------------------------------+\n | Masking-key (continued)       |          Payload Data         |\n +-------------------------------- - - - - - - - - - - - - - - - +\n :                     Payload Data continued ...                :\n + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +\n |                     Payload Data continued ...                |\n +---------------------------------------------------------------+\n */\n\nstatic const uint8_t RCTSRFinMask          = 0x80;\nstatic const uint8_t RCTSROpCodeMask       = 0x0F;\nstatic const uint8_t RCTSRRsvMask          = 0x70;\nstatic const uint8_t RCTSRMaskMask         = 0x80;\nstatic const uint8_t RCTSRPayloadLenMask   = 0x7F;\n\n- (void)_readFrameContinue;\n{\n  assert((_currentFrameCount == 0 && _currentFrameOpcode == 0) || (_currentFrameCount > 0 && _currentFrameOpcode > 0));\n\n  [self _addConsumerWithDataLength:2 callback:^(RCTSRWebSocket *socket, NSData *data) {\n    __block frame_header header = {0};\n\n    const uint8_t *headerBuffer = data.bytes;\n    assert(data.length >= 2);\n\n    if (headerBuffer[0] & RCTSRRsvMask) {\n      [socket _closeWithProtocolError:@\"Server used RSV bits\"];\n      return;\n    }\n\n    uint8_t receivedOpcode = (RCTSROpCodeMask &headerBuffer[0]);\n\n    BOOL isControlFrame = (receivedOpcode == RCTSROpCodePing || receivedOpcode == RCTSROpCodePong || receivedOpcode == RCTSROpCodeConnectionClose);\n\n    if (!isControlFrame && receivedOpcode != 0 && socket->_currentFrameCount > 0) {\n      [socket _closeWithProtocolError:@\"all data frames after the initial data frame must have opcode 0\"];\n      return;\n    }\n\n    if (receivedOpcode == 0 && socket->_currentFrameCount == 0) {\n      [socket _closeWithProtocolError:@\"cannot continue a message\"];\n      return;\n    }\n\n    header.opcode = receivedOpcode == 0 ? socket->_currentFrameOpcode : receivedOpcode;\n\n    header.fin = !!(RCTSRFinMask &headerBuffer[0]);\n\n\n    header.masked = !!(RCTSRMaskMask &headerBuffer[1]);\n    header.payload_length = RCTSRPayloadLenMask & headerBuffer[1];\n\n    headerBuffer = NULL;\n\n    if (header.masked) {\n      [socket _closeWithProtocolError:@\"Client must receive unmasked data\"];\n    }\n\n    size_t extra_bytes_needed = header.masked ? sizeof(self->_currentReadMaskKey) : 0;\n\n    if (header.payload_length == 126) {\n      extra_bytes_needed += sizeof(uint16_t);\n    } else if (header.payload_length == 127) {\n      extra_bytes_needed += sizeof(uint64_t);\n    }\n\n    if (extra_bytes_needed == 0) {\n      [socket _handleFrameHeader:header curData:socket->_currentFrameData];\n    } else {\n      [socket _addConsumerWithDataLength:extra_bytes_needed callback:^(RCTSRWebSocket *_socket, NSData *_data) {\n        size_t mapped_size = _data.length;\n        const void *mapped_buffer = _data.bytes;\n        size_t offset = 0;\n\n        if (header.payload_length == 126) {\n          assert(mapped_size >= sizeof(uint16_t));\n          uint16_t newLen = EndianU16_BtoN(*(uint16_t *)(mapped_buffer));\n          header.payload_length = newLen;\n          offset += sizeof(uint16_t);\n        } else if (header.payload_length == 127) {\n          assert(mapped_size >= sizeof(uint64_t));\n          header.payload_length = EndianU64_BtoN(*(uint64_t *)(mapped_buffer));\n          offset += sizeof(uint64_t);\n        } else {\n          assert(header.payload_length < 126 && header.payload_length >= 0);\n        }\n\n        if (header.masked) {\n          assert(mapped_size >= sizeof(self->_currentReadMaskOffset) + offset);\n          memcpy(_socket->_currentReadMaskKey, ((uint8_t *)mapped_buffer) + offset, sizeof(_socket->_currentReadMaskKey));\n        }\n\n        [_socket _handleFrameHeader:header curData:_socket->_currentFrameData];\n      } readToCurrentFrame:NO unmaskBytes:NO];\n    }\n  } readToCurrentFrame:NO unmaskBytes:NO];\n}\n\n- (void)_readFrameNew;\n{\n  dispatch_async(_workQueue, ^{\n    self->_currentFrameData.length = 0;\n\n    self->_currentFrameOpcode = 0;\n    self->_currentFrameCount = 0;\n    self->_readOpCount = 0;\n    self->_currentStringScanPosition = 0;\n\n    [self _readFrameContinue];\n  });\n}\n\n- (void)_pumpWriting;\n{\n  [self assertOnWorkQueue];\n\n  NSUInteger dataLength = _outputBuffer.length;\n  if (dataLength - _outputBufferOffset > 0 && _outputStream.hasSpaceAvailable) {\n    NSInteger bytesWritten = [_outputStream write:_outputBuffer.bytes + _outputBufferOffset maxLength:dataLength - _outputBufferOffset];\n    if (bytesWritten == -1) {\n      [self _failWithError:[NSError errorWithDomain:RCTSRWebSocketErrorDomain code:2145 userInfo:@{NSLocalizedDescriptionKey: @\"Error writing to stream\"}]];\n      return;\n    }\n\n    _outputBufferOffset += bytesWritten;\n\n    if (_outputBufferOffset > 4096 && _outputBufferOffset > (_outputBuffer.length >> 1)) {\n      _outputBuffer = [[NSMutableData alloc] initWithBytes:(char *)_outputBuffer.bytes + _outputBufferOffset length:_outputBuffer.length - _outputBufferOffset];\n      _outputBufferOffset = 0;\n    }\n  }\n\n  if (_closeWhenFinishedWriting &&\n      _outputBuffer.length - _outputBufferOffset == 0 &&\n      (_inputStream.streamStatus != NSStreamStatusNotOpen &&\n       _inputStream.streamStatus != NSStreamStatusClosed) &&\n      !_sentClose) {\n    _sentClose = YES;\n\n    [_outputStream close];\n    [_inputStream close];\n\n    for (NSArray *runLoop in [_scheduledRunloops copy]) {\n      [self unscheduleFromRunLoop:runLoop[0] forMode:runLoop[1]];\n    }\n\n    if (!_failed) {\n      [self _performDelegateBlock:^{\n        if ([self.delegate respondsToSelector:@selector(webSocket:didCloseWithCode:reason:wasClean:)]) {\n          [self.delegate webSocket:self didCloseWithCode:self->_closeCode reason:self->_closeReason wasClean:YES];\n        }\n      }];\n    }\n\n    _selfRetain = nil;\n  }\n}\n\n- (void)_addConsumerWithScanner:(stream_scanner)consumer callback:(data_callback)callback;\n{\n  [self assertOnWorkQueue];\n  [self _addConsumerWithScanner:consumer callback:callback dataLength:0];\n}\n\n- (void)_addConsumerWithDataLength:(size_t)dataLength callback:(data_callback)callback readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes;\n{\n  [self assertOnWorkQueue];\n  assert(dataLength);\n\n  [_consumers addObject:[_consumerPool consumerWithScanner:nil handler:callback bytesNeeded:dataLength readToCurrentFrame:readToCurrentFrame unmaskBytes:unmaskBytes]];\n  [self _pumpScanner];\n}\n\n- (void)_addConsumerWithScanner:(stream_scanner)consumer callback:(data_callback)callback dataLength:(size_t)dataLength;\n{\n  [self assertOnWorkQueue];\n  [_consumers addObject:[_consumerPool consumerWithScanner:consumer handler:callback bytesNeeded:dataLength readToCurrentFrame:NO unmaskBytes:NO]];\n  [self _pumpScanner];\n}\n\nstatic const char CRLFCRLFBytes[] = {'\\r', '\\n', '\\r', '\\n'};\n\n- (void)_readUntilHeaderCompleteWithCallback:(data_callback)dataHandler;\n{\n  [self _readUntilBytes:CRLFCRLFBytes length:sizeof(CRLFCRLFBytes) callback:dataHandler];\n}\n\n- (void)_readUntilBytes:(const void *)bytes length:(size_t)length callback:(data_callback)dataHandler;\n{\n  // TODO: optimize so this can continue from where we last searched\n  stream_scanner consumer = ^size_t(NSData *data) {\n    __block size_t found_size = 0;\n    __block size_t match_count = 0;\n\n    size_t size = data.length;\n    const unsigned char *buffer = data.bytes;\n    for (size_t i = 0; i < size; i++ ) {\n      if (((const unsigned char *)buffer)[i] == ((const unsigned char *)bytes)[match_count]) {\n        match_count += 1;\n        if (match_count == length) {\n          found_size = i + 1;\n          break;\n        }\n      } else {\n        match_count = 0;\n      }\n    }\n    return found_size;\n  };\n  [self _addConsumerWithScanner:consumer callback:dataHandler];\n}\n\n// Returns true if did work\n- (BOOL)_innerPumpScanner\n{\n  BOOL didWork = NO;\n\n  if (self.readyState >= RCTSR_CLOSING) {\n    return didWork;\n  }\n\n  if (!_consumers.count) {\n    return didWork;\n  }\n\n  size_t curSize = _readBuffer.length - _readBufferOffset;\n  if (!curSize) {\n    return didWork;\n  }\n\n  RCTSRIOConsumer *consumer = _consumers[0];\n\n  size_t bytesNeeded = consumer.bytesNeeded;\n\n  size_t foundSize = 0;\n  if (consumer.consumer) {\n    NSData *tempView = [NSData dataWithBytesNoCopy:(char *)_readBuffer.bytes + _readBufferOffset length:_readBuffer.length - _readBufferOffset freeWhenDone:NO];\n    foundSize = consumer.consumer(tempView);\n  } else {\n    assert(consumer.bytesNeeded);\n    if (curSize >= bytesNeeded) {\n      foundSize = bytesNeeded;\n    } else if (consumer.readToCurrentFrame) {\n      foundSize = curSize;\n    }\n  }\n\n  NSData *slice = nil;\n  if (consumer.readToCurrentFrame || foundSize) {\n    NSRange sliceRange = NSMakeRange(_readBufferOffset, foundSize);\n    slice = [_readBuffer subdataWithRange:sliceRange];\n\n    _readBufferOffset += foundSize;\n\n    if (_readBufferOffset > 4096 && _readBufferOffset > (_readBuffer.length >> 1)) {\n      _readBuffer = [[NSMutableData alloc] initWithBytes:(char *)_readBuffer.bytes + _readBufferOffset length:_readBuffer.length - _readBufferOffset];            _readBufferOffset = 0;\n    }\n\n    if (consumer.unmaskBytes) {\n      NSMutableData *mutableSlice = [slice mutableCopy];\n\n      NSUInteger len = mutableSlice.length;\n      uint8_t *bytes = mutableSlice.mutableBytes;\n\n      for (NSUInteger i = 0; i < len; i++) {\n        bytes[i] = bytes[i] ^ _currentReadMaskKey[_currentReadMaskOffset % sizeof(_currentReadMaskKey)];\n        _currentReadMaskOffset += 1;\n      }\n\n      slice = mutableSlice;\n    }\n\n    if (consumer.readToCurrentFrame) {\n      [_currentFrameData appendData:slice];\n\n      _readOpCount += 1;\n\n      if (_currentFrameOpcode == RCTSROpCodeTextFrame) {\n        // Validate UTF8 stuff.\n        size_t currentDataSize = _currentFrameData.length;\n        if (_currentFrameOpcode == RCTSROpCodeTextFrame && currentDataSize > 0) {\n          // TODO: Optimize this.  Don't really have to copy all the data each time\n\n          size_t scanSize = currentDataSize - _currentStringScanPosition;\n\n          NSData *scan_data = [_currentFrameData subdataWithRange:NSMakeRange(_currentStringScanPosition, scanSize)];\n          int32_t valid_utf8_size = validate_dispatch_data_partial_string(scan_data);\n\n          if (valid_utf8_size == -1) {\n            [self closeWithCode:RCTSRStatusCodeInvalidUTF8 reason:@\"Text frames must be valid UTF-8\"];\n            dispatch_async(_workQueue, ^{\n              [self _disconnect];\n            });\n            return didWork;\n          } else {\n            _currentStringScanPosition += valid_utf8_size;\n          }\n        }\n      }\n\n      consumer.bytesNeeded -= foundSize;\n\n      if (consumer.bytesNeeded == 0) {\n        [_consumers removeObjectAtIndex:0];\n        consumer.handler(self, nil);\n        [_consumerPool returnConsumer:consumer];\n        didWork = YES;\n      }\n    } else if (foundSize) {\n      [_consumers removeObjectAtIndex:0];\n      consumer.handler(self, slice);\n      [_consumerPool returnConsumer:consumer];\n      didWork = YES;\n    }\n  }\n  return didWork;\n}\n\n- (void)_pumpScanner;\n{\n  [self assertOnWorkQueue];\n\n  if (!_isPumping) {\n    _isPumping = YES;\n  } else {\n    return;\n  }\n\n  while ([self _innerPumpScanner]) {}\n\n  _isPumping = NO;\n}\n\n//#define NOMASK\n\nstatic const size_t RCTSRFrameHeaderOverhead = 32;\n\n- (void)_sendFrameWithOpcode:(RCTSROpCode)opcode data:(id)data;\n{\n  [self assertOnWorkQueue];\n\n  if (nil == data) {\n    return;\n  }\n\n  RCTAssert([data isKindOfClass:[NSData class]] || [data isKindOfClass:[NSString class]], @\"NSString or NSData\");\n\n  size_t payloadLength = [data isKindOfClass:[NSString class]] ? [(NSString *)data lengthOfBytesUsingEncoding:NSUTF8StringEncoding] : [data length];\n\n  NSMutableData *frame = [[NSMutableData alloc] initWithLength:payloadLength + RCTSRFrameHeaderOverhead];\n  if (!frame) {\n    [self closeWithCode:RCTSRStatusCodeMessageTooBig reason:@\"Message too big\"];\n    return;\n  }\n  uint8_t *frame_buffer = (uint8_t *)frame.mutableBytes;\n\n  // set fin\n  frame_buffer[0] = RCTSRFinMask | opcode;\n\n  BOOL useMask = YES;\n#ifdef NOMASK\n  useMask = NO;\n#endif\n\n  if (useMask) {\n    // set the mask and header\n    frame_buffer[1] |= RCTSRMaskMask;\n  }\n\n  size_t frame_buffer_size = 2;\n\n  const uint8_t *unmasked_payload = NULL;\n  if ([data isKindOfClass:[NSData class]]) {\n    unmasked_payload = (uint8_t *)[data bytes];\n  } else if ([data isKindOfClass:[NSString class]]) {\n    unmasked_payload =  (const uint8_t *)[data UTF8String];\n  } else {\n    return;\n  }\n\n  if (payloadLength < 126) {\n    frame_buffer[1] |= payloadLength;\n  } else if (payloadLength <= UINT16_MAX) {\n    frame_buffer[1] |= 126;\n    *((uint16_t *)(frame_buffer + frame_buffer_size)) = EndianU16_BtoN((uint16_t)payloadLength);\n    frame_buffer_size += sizeof(uint16_t);\n  } else {\n    frame_buffer[1] |= 127;\n    *((uint64_t *)(frame_buffer + frame_buffer_size)) = EndianU64_BtoN((uint64_t)payloadLength);\n    frame_buffer_size += sizeof(uint64_t);\n  }\n\n  if (!useMask) {\n    for (size_t i = 0; i < payloadLength; i++) {\n      frame_buffer[frame_buffer_size] = unmasked_payload[i];\n      frame_buffer_size += 1;\n    }\n  } else {\n    uint8_t *mask_key = frame_buffer + frame_buffer_size;\n    int result = SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);\n    assert(result == 0);\n    frame_buffer_size += sizeof(uint32_t);\n\n    // TODO: could probably optimize this with SIMD\n    for (size_t i = 0; i < payloadLength; i++) {\n      frame_buffer[frame_buffer_size] = unmasked_payload[i] ^ mask_key[i % sizeof(uint32_t)];\n      frame_buffer_size += 1;\n    }\n  }\n\n  assert(frame_buffer_size <= [frame length]);\n  frame.length = frame_buffer_size;\n\n  [self _writeData:frame];\n}\n\n- (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode;\n{\n  if (_secure && !_pinnedCertFound && (eventCode == NSStreamEventHasBytesAvailable || eventCode == NSStreamEventHasSpaceAvailable)) {\n    NSArray *sslCerts = _urlRequest.RCTSR_SSLPinnedCertificates;\n    if (sslCerts) {\n      SecTrustRef secTrust = (__bridge SecTrustRef)[aStream propertyForKey:(__bridge id)kCFStreamPropertySSLPeerTrust];\n      if (secTrust) {\n        NSInteger numCerts = SecTrustGetCertificateCount(secTrust);\n        for (NSInteger i = 0; i < numCerts && !_pinnedCertFound; i++) {\n          SecCertificateRef cert = SecTrustGetCertificateAtIndex(secTrust, i);\n          NSData *certData = CFBridgingRelease(SecCertificateCopyData(cert));\n\n          for (id ref in sslCerts) {\n            SecCertificateRef trustedCert = (__bridge SecCertificateRef)ref;\n            NSData *trustedCertData = CFBridgingRelease(SecCertificateCopyData(trustedCert));\n\n            if ([trustedCertData isEqualToData:certData]) {\n              _pinnedCertFound = YES;\n              break;\n            }\n          }\n        }\n      }\n\n      if (!_pinnedCertFound) {\n        dispatch_async(_workQueue, ^{\n          [self _failWithError:[NSError errorWithDomain:RCTSRWebSocketErrorDomain code:23556 userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@\"Invalid server cert\"]}]];\n        });\n        return;\n      }\n    }\n  }\n\n  assert(_workQueue != NULL);\n  dispatch_async(_workQueue, ^{\n    switch (eventCode) {\n      case NSStreamEventOpenCompleted: {\n        RCTSRLog(@\"NSStreamEventOpenCompleted %@\", aStream);\n        if (self.readyState >= RCTSR_CLOSING) {\n          return;\n        }\n        assert(self->_readBuffer);\n\n        if (self.readyState == RCTSR_CONNECTING && aStream == self->_inputStream) {\n          [self didConnect];\n        }\n        [self _pumpWriting];\n        [self _pumpScanner];\n        break;\n      }\n\n      case NSStreamEventErrorOccurred: {\n        RCTSRLog(@\"NSStreamEventErrorOccurred %@ %@\", aStream, [aStream.streamError copy]);\n        // TODO: specify error better!\n        [self _failWithError:aStream.streamError];\n        self->_readBufferOffset = 0;\n        self->_readBuffer.length = 0;\n        break;\n\n      }\n\n      case NSStreamEventEndEncountered: {\n        [self _pumpScanner];\n        RCTSRLog(@\"NSStreamEventEndEncountered %@\", aStream);\n        if (aStream.streamError) {\n          [self _failWithError:aStream.streamError];\n        } else {\n          dispatch_async(self->_workQueue, ^{\n            if (self.readyState != RCTSR_CLOSED) {\n              self.readyState = RCTSR_CLOSED;\n              self->_selfRetain = nil;\n            }\n\n            if (!self->_sentClose && !self->_failed) {\n              self->_sentClose = YES;\n              // If we get closed in this state it's probably not clean because we should be sending this when we send messages\n              [self _performDelegateBlock:^{\n                if ([self.delegate respondsToSelector:@selector(webSocket:didCloseWithCode:reason:wasClean:)]) {\n                  [self.delegate webSocket:self didCloseWithCode:RCTSRStatusCodeGoingAway reason:@\"Stream end encountered\" wasClean:NO];\n                }\n              }];\n            }\n          });\n        }\n\n        break;\n      }\n\n      case NSStreamEventHasBytesAvailable: {\n        RCTSRLog(@\"NSStreamEventHasBytesAvailable %@\", aStream);\n        const int bufferSize = 2048;\n        uint8_t buffer[bufferSize];\n\n        while (self->_inputStream.hasBytesAvailable) {\n          NSInteger bytes_read = [self->_inputStream read:buffer maxLength:bufferSize];\n\n          if (bytes_read > 0) {\n            [self->_readBuffer appendBytes:buffer length:bytes_read];\n          } else if (bytes_read < 0) {\n            [self _failWithError:self->_inputStream.streamError];\n          }\n\n          if (bytes_read != bufferSize) {\n            break;\n          }\n        };\n        [self _pumpScanner];\n        break;\n      }\n\n      case NSStreamEventHasSpaceAvailable: {\n        RCTSRLog(@\"NSStreamEventHasSpaceAvailable %@\", aStream);\n        [self _pumpWriting];\n        break;\n      }\n\n      default:\n        RCTSRLog(@\"(default)  %@\", aStream);\n        break;\n    }\n  });\n}\n\n@end\n\n@implementation RCTSRIOConsumer\n\n- (void)setupWithScanner:(stream_scanner)scanner handler:(data_callback)handler bytesNeeded:(size_t)bytesNeeded readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes;\n{\n  _consumer = [scanner copy];\n  _handler = [handler copy];\n  _bytesNeeded = bytesNeeded;\n  _readToCurrentFrame = readToCurrentFrame;\n  _unmaskBytes = unmaskBytes;\n  assert(_consumer || _bytesNeeded);\n}\n\n@end\n\n@implementation RCTSRIOConsumerPool\n{\n  NSUInteger _poolSize;\n  NSMutableArray<RCTSRIOConsumer *> *_bufferedConsumers;\n}\n\n- (instancetype)initWithBufferCapacity:(NSUInteger)poolSize;\n{\n  if ((self = [super init])) {\n    _poolSize = poolSize;\n    _bufferedConsumers = [[NSMutableArray alloc] initWithCapacity:poolSize];\n  }\n  return self;\n}\n\n- (instancetype)init\n{\n  return [self initWithBufferCapacity:8];\n}\n\n- (RCTSRIOConsumer *)consumerWithScanner:(stream_scanner)scanner handler:(data_callback)handler bytesNeeded:(size_t)bytesNeeded readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes;\n{\n  RCTSRIOConsumer *consumer = nil;\n  if (_bufferedConsumers.count) {\n    consumer = _bufferedConsumers.lastObject;\n    [_bufferedConsumers removeLastObject];\n  } else {\n    consumer = [RCTSRIOConsumer new];\n  }\n\n  [consumer setupWithScanner:scanner handler:handler bytesNeeded:bytesNeeded readToCurrentFrame:readToCurrentFrame unmaskBytes:unmaskBytes];\n\n  return consumer;\n}\n\n- (void)returnConsumer:(RCTSRIOConsumer *)consumer;\n{\n  if (_bufferedConsumers.count < _poolSize) {\n    [_bufferedConsumers addObject:consumer];\n  }\n}\n\n@end\n\n@implementation  NSURLRequest (CertificateAdditions)\n\n- (NSArray *)RCTSR_SSLPinnedCertificates;\n{\n  return [NSURLProtocol propertyForKey:@\"RCTSR_SSLPinnedCertificates\" inRequest:self];\n}\n\n@end\n\n@implementation  NSMutableURLRequest (CertificateAdditions)\n\n- (NSArray *)RCTSR_SSLPinnedCertificates;\n{\n  return [NSURLProtocol propertyForKey:@\"RCTSR_SSLPinnedCertificates\" inRequest:self];\n}\n\n- (void)setRCTSR_SSLPinnedCertificates:(NSArray *)RCTSR_SSLPinnedCertificates;\n{\n  [NSURLProtocol setProperty:RCTSR_SSLPinnedCertificates forKey:@\"RCTSR_SSLPinnedCertificates\" inRequest:self];\n}\n\n@end\n\n@implementation NSURL (RCTSRWebSocket)\n\n- (NSString *)RCTSR_origin;\n{\n  NSString *scheme = self.scheme.lowercaseString;\n\n  if ([scheme isEqualToString:@\"wss\"]) {\n    scheme = @\"https\";\n  } else if ([scheme isEqualToString:@\"ws\"]) {\n    scheme = @\"http\";\n  }\n\n  int defaultPort = ([scheme isEqualToString:@\"https\"] ? 443 :\n                     [scheme isEqualToString:@\"http\"] ? 80 :\n                     -1);\n  int port = self.port.intValue;\n  if (port > 0 && port != defaultPort) {\n    return [NSString stringWithFormat:@\"%@://%@:%d\", scheme, self.host, port];\n  } else {\n    return [NSString stringWithFormat:@\"%@://%@\", scheme, self.host];\n  }\n}\n\n@end\n\nstatic _RCTSRRunLoopThread *networkThread = nil;\nstatic NSRunLoop *networkRunLoop = nil;\n\n@implementation NSRunLoop (RCTSRWebSocket)\n\n+ (NSRunLoop *)RCTSR_networkRunLoop\n{\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    networkThread = [_RCTSRRunLoopThread new];\n    networkThread.name = @\"com.squareup.SocketRocket.NetworkThread\";\n    [networkThread start];\n    networkRunLoop = networkThread.runLoop;\n  });\n\n  return networkRunLoop;\n}\n\n@end\n\n@implementation _RCTSRRunLoopThread\n{\n  dispatch_group_t _waitGroup;\n}\n\n@synthesize runLoop = _runLoop;\n\n- (instancetype)init\n{\n  if ((self = [super init])) {\n    _waitGroup = dispatch_group_create();\n    dispatch_group_enter(_waitGroup);\n  }\n  return self;\n}\n\n- (void)main;\n{\n  @autoreleasepool {\n    _runLoop = [NSRunLoop currentRunLoop];\n    dispatch_group_leave(_waitGroup);\n\n    NSTimer *timer = [[NSTimer alloc] initWithFireDate:[NSDate distantFuture] interval:0.0 target:self selector:@selector(step) userInfo:nil repeats:NO];\n    [_runLoop addTimer:timer forMode:NSDefaultRunLoopMode];\n\n    while ([_runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) { }\n    assert(NO);\n  }\n}\n\n- (void)step\n{\n  // Does nothing\n}\n\n- (NSRunLoop *)runLoop;\n{\n  dispatch_group_wait(_waitGroup, DISPATCH_TIME_FOREVER);\n  return _runLoop;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/WebSocket/RCTWebSocket.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t1338BBE01B04ACC80064A9C9 /* RCTSRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */; };\n\t\t1338BBE11B04ACC80064A9C9 /* RCTWebSocketExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */; };\n\t\t2D3B5F3D1D9B165B00451313 /* RCTSRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */; };\n\t\t2D3B5F3E1D9B165B00451313 /* RCTWebSocketExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */; };\n\t\t2D3B5F401D9B165B00451313 /* RCTWebSocketModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */; };\n\t\t2DC5E5281F3A6CFD000EE84B /* libfishhook-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DC5E5271F3A6CFD000EE84B /* libfishhook-tvOS.a */; };\n\t\t3C86DF7C1ADF695F0047B81A /* RCTWebSocketModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */; };\n\t\t3DBE0D141F3B185A0099AA32 /* fishhook.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DBE0D121F3B185A0099AA32 /* fishhook.c */; };\n\t\t3DBE0D151F3B185A0099AA32 /* fishhook.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DBE0D121F3B185A0099AA32 /* fishhook.c */; };\n\t\t3DBE0D801F3B1AF00099AA32 /* fishhook.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DBE0D131F3B185A0099AA32 /* fishhook.h */; };\n\t\t3DBE0D821F3B1B0C0099AA32 /* fishhook.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DBE0D131F3B185A0099AA32 /* fishhook.h */; };\n\t\tA12E9E2E1E5DEC4E0029001B /* RCTReconnectingWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = A12E9E2D1E5DEC4E0029001B /* RCTReconnectingWebSocket.m */; };\n\t\tA12E9E2F1E5DEC550029001B /* RCTReconnectingWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = A12E9E2D1E5DEC4E0029001B /* RCTReconnectingWebSocket.m */; };\n\t\tD426ACCE20D56EFD003B4C4D /* libfishhook.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DBE0D001F3B181A0099AA32 /* libfishhook.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t3DBE0D0E1F3B18490099AA32 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 3C86DF3E1ADF2C930047B81A /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3DBE0CF41F3B181A0099AA32;\n\t\t\tremoteInfo = fishhook;\n\t\t};\n\t\t3DBE0D101F3B184D0099AA32 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 3C86DF3E1ADF2C930047B81A /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3DBE0D011F3B181C0099AA32;\n\t\t\tremoteInfo = \"fishhook-tvOS\";\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t3DBE0D7F1F3B1AEC0099AA32 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/fishhook;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3DBE0D801F3B1AF00099AA32 /* fishhook.h in CopyFiles */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3DBE0D811F3B1B010099AA32 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/fishhook;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3DBE0D821F3B1B0C0099AA32 /* fishhook.h in CopyFiles */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t1338BBDC1B04ACC80064A9C9 /* RCTSRWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSRWebSocket.h; sourceTree = \"<group>\"; };\n\t\t1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSRWebSocket.m; sourceTree = \"<group>\"; };\n\t\t1338BBDE1B04ACC80064A9C9 /* RCTWebSocketExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketExecutor.h; sourceTree = \"<group>\"; };\n\t\t1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWebSocketExecutor.m; sourceTree = \"<group>\"; };\n\t\t13526A511F362F7F0008EF00 /* libfishhook.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfishhook.a; sourceTree = \"<group>\"; };\n\t\t2D2A28881D9B049200D4039D /* libRCTWebSocket-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libRCTWebSocket-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t2DC5E5271F3A6CFD000EE84B /* libfishhook-tvOS.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = \"libfishhook-tvOS.a\"; path = \"../fishhook/build/Debug-appletvos/libfishhook-tvOS.a\"; sourceTree = \"<group>\"; };\n\t\t3C86DF461ADF2C930047B81A /* libRCTWebSocket.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTWebSocket.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3C86DF7A1ADF695F0047B81A /* RCTWebSocketModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketModule.h; sourceTree = \"<group>\"; };\n\t\t3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = RCTWebSocketModule.m; sourceTree = \"<group>\"; tabWidth = 2; };\n\t\t3DBE0D001F3B181A0099AA32 /* libfishhook.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libfishhook.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3DBE0D0D1F3B181C0099AA32 /* libfishhook-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libfishhook-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3DBE0D121F3B185A0099AA32 /* fishhook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fishhook.c; path = ../fishhook/fishhook.c; sourceTree = \"<group>\"; };\n\t\t3DBE0D131F3B185A0099AA32 /* fishhook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fishhook.h; path = ../fishhook/fishhook.h; sourceTree = \"<group>\"; };\n\t\tA12E9E2C1E5DEC4E0029001B /* RCTReconnectingWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTReconnectingWebSocket.h; sourceTree = \"<group>\"; };\n\t\tA12E9E2D1E5DEC4E0029001B /* RCTReconnectingWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTReconnectingWebSocket.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t13526A4F1F362F770008EF00 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tD426ACCE20D56EFD003B4C4D /* libfishhook.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DC5E5151F3A6C39000EE84B /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2DC5E5281F3A6CFD000EE84B /* libfishhook-tvOS.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t13526A501F362F7F0008EF00 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2DC5E5271F3A6CFD000EE84B /* libfishhook-tvOS.a */,\n\t\t\t\t13526A511F362F7F0008EF00 /* libfishhook.a */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3C86DF3D1ADF2C930047B81A = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3DBE0D121F3B185A0099AA32 /* fishhook.c */,\n\t\t\t\t3DBE0D131F3B185A0099AA32 /* fishhook.h */,\n\t\t\t\tA12E9E2C1E5DEC4E0029001B /* RCTReconnectingWebSocket.h */,\n\t\t\t\tA12E9E2D1E5DEC4E0029001B /* RCTReconnectingWebSocket.m */,\n\t\t\t\t1338BBDC1B04ACC80064A9C9 /* RCTSRWebSocket.h */,\n\t\t\t\t1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */,\n\t\t\t\t1338BBDE1B04ACC80064A9C9 /* RCTWebSocketExecutor.h */,\n\t\t\t\t1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */,\n\t\t\t\t3C86DF7A1ADF695F0047B81A /* RCTWebSocketModule.h */,\n\t\t\t\t3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */,\n\t\t\t\t3C86DF471ADF2C930047B81A /* Products */,\n\t\t\t\t13526A501F362F7F0008EF00 /* Frameworks */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t3C86DF471ADF2C930047B81A /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3C86DF461ADF2C930047B81A /* libRCTWebSocket.a */,\n\t\t\t\t2D2A28881D9B049200D4039D /* libRCTWebSocket-tvOS.a */,\n\t\t\t\t3DBE0D001F3B181A0099AA32 /* libfishhook.a */,\n\t\t\t\t3DBE0D0D1F3B181C0099AA32 /* libfishhook-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t2D2A28871D9B049200D4039D /* RCTWebSocket-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D2A28901D9B049200D4039D /* Build configuration list for PBXNativeTarget \"RCTWebSocket-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2D2A28841D9B049200D4039D /* Sources */,\n\t\t\t\t2DC5E5151F3A6C39000EE84B /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t3DBE0D111F3B184D0099AA32 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"RCTWebSocket-tvOS\";\n\t\t\tproductName = \"RCTWebSocket-tvOS\";\n\t\t\tproductReference = 2D2A28881D9B049200D4039D /* libRCTWebSocket-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3C86DF451ADF2C930047B81A /* RCTWebSocket */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3C86DF5A1ADF2C930047B81A /* Build configuration list for PBXNativeTarget \"RCTWebSocket\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3C86DF421ADF2C930047B81A /* Sources */,\n\t\t\t\t13526A4F1F362F770008EF00 /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t3DBE0D0F1F3B18490099AA32 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = RCTWebSocket;\n\t\t\tproductName = WebSocket;\n\t\t\tproductReference = 3C86DF461ADF2C930047B81A /* libRCTWebSocket.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3DBE0CF41F3B181A0099AA32 /* fishhook */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3DBE0CFD1F3B181A0099AA32 /* Build configuration list for PBXNativeTarget \"fishhook\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3DBE0D7F1F3B1AEC0099AA32 /* CopyFiles */,\n\t\t\t\t3DBE0CF51F3B181A0099AA32 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = fishhook;\n\t\t\tproductName = WebSocket;\n\t\t\tproductReference = 3DBE0D001F3B181A0099AA32 /* libfishhook.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3DBE0D011F3B181C0099AA32 /* fishhook-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3DBE0D0A1F3B181C0099AA32 /* Build configuration list for PBXNativeTarget \"fishhook-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3DBE0D811F3B1B010099AA32 /* CopyFiles */,\n\t\t\t\t3DBE0D021F3B181C0099AA32 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"fishhook-tvOS\";\n\t\t\tproductName = \"RCTWebSocket-tvOS\";\n\t\t\tproductReference = 3DBE0D0D1F3B181C0099AA32 /* libfishhook-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t3C86DF3E1ADF2C930047B81A /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0630;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t2D2A28871D9B049200D4039D = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t3C86DF451ADF2C930047B81A = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.3;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 3C86DF411ADF2C930047B81A /* Build configuration list for PBXProject \"RCTWebSocket\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 3C86DF3D1ADF2C930047B81A;\n\t\t\tproductRefGroup = 3C86DF471ADF2C930047B81A /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t3C86DF451ADF2C930047B81A /* RCTWebSocket */,\n\t\t\t\t2D2A28871D9B049200D4039D /* RCTWebSocket-tvOS */,\n\t\t\t\t3DBE0CF41F3B181A0099AA32 /* fishhook */,\n\t\t\t\t3DBE0D011F3B181C0099AA32 /* fishhook-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t2D2A28841D9B049200D4039D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D3B5F3E1D9B165B00451313 /* RCTWebSocketExecutor.m in Sources */,\n\t\t\t\t2D3B5F401D9B165B00451313 /* RCTWebSocketModule.m in Sources */,\n\t\t\t\tA12E9E2F1E5DEC550029001B /* RCTReconnectingWebSocket.m in Sources */,\n\t\t\t\t2D3B5F3D1D9B165B00451313 /* RCTSRWebSocket.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3C86DF421ADF2C930047B81A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1338BBE01B04ACC80064A9C9 /* RCTSRWebSocket.m in Sources */,\n\t\t\t\t3C86DF7C1ADF695F0047B81A /* RCTWebSocketModule.m in Sources */,\n\t\t\t\tA12E9E2E1E5DEC4E0029001B /* RCTReconnectingWebSocket.m in Sources */,\n\t\t\t\t1338BBE11B04ACC80064A9C9 /* RCTWebSocketExecutor.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3DBE0CF51F3B181A0099AA32 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DBE0D141F3B185A0099AA32 /* fishhook.c in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3DBE0D021F3B181C0099AA32 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DBE0D151F3B185A0099AA32 /* fishhook.c in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t3DBE0D0F1F3B18490099AA32 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3DBE0CF41F3B181A0099AA32 /* fishhook */;\n\t\t\ttargetProxy = 3DBE0D0E1F3B18490099AA32 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3DBE0D111F3B184D0099AA32 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3DBE0D011F3B181C0099AA32 /* fishhook-tvOS */;\n\t\t\ttargetProxy = 3DBE0D101F3B184D0099AA32 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin XCBuildConfiguration section */\n\t\t2D2A288E1D9B049200D4039D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tWARNING_CFLAGS = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D2A288F1D9B049200D4039D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tWARNING_CFLAGS = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3C86DF581ADF2C930047B81A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3C86DF591ADF2C930047B81A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Werror\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3C86DF5B1ADF2C930047B81A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tEXECUTABLE_PREFIX = lib;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"RCT_METRO_PORT=${RCT_METRO_PORT}\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_TREAT_WARNINGS_AS_ERRORS = NO;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tWARNING_CFLAGS = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3C86DF5C1ADF2C930047B81A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tEXECUTABLE_PREFIX = lib;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"RCT_METRO_PORT=${RCT_METRO_PORT}\";\n\t\t\t\tGCC_TREAT_WARNINGS_AS_ERRORS = NO;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3DBE0CFE1F3B181A0099AA32 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tEXECUTABLE_PREFIX = lib;\n\t\t\t\tGCC_TREAT_WARNINGS_AS_ERRORS = NO;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3DBE0CFF1F3B181A0099AA32 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tEXECUTABLE_PREFIX = lib;\n\t\t\t\tGCC_TREAT_WARNINGS_AS_ERRORS = NO;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tWARNING_CFLAGS = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3DBE0D0B1F3B181C0099AA32 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3DBE0D0C1F3B181C0099AA32 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t2D2A28901D9B049200D4039D /* Build configuration list for PBXNativeTarget \"RCTWebSocket-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D2A288E1D9B049200D4039D /* Debug */,\n\t\t\t\t2D2A288F1D9B049200D4039D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3C86DF411ADF2C930047B81A /* Build configuration list for PBXProject \"RCTWebSocket\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3C86DF581ADF2C930047B81A /* Debug */,\n\t\t\t\t3C86DF591ADF2C930047B81A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3C86DF5A1ADF2C930047B81A /* Build configuration list for PBXNativeTarget \"RCTWebSocket\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3C86DF5B1ADF2C930047B81A /* Debug */,\n\t\t\t\t3C86DF5C1ADF2C930047B81A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3DBE0CFD1F3B181A0099AA32 /* Build configuration list for PBXNativeTarget \"fishhook\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3DBE0CFE1F3B181A0099AA32 /* Debug */,\n\t\t\t\t3DBE0CFF1F3B181A0099AA32 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3DBE0D0A1F3B181C0099AA32 /* Build configuration list for PBXNativeTarget \"fishhook-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3DBE0D0B1F3B181C0099AA32 /* Debug */,\n\t\t\t\t3DBE0D0C1F3B181C0099AA32 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 3C86DF3E1ADF2C930047B81A /* Project object */;\n}\n"
  },
  {
    "path": "Libraries/WebSocket/RCTWebSocketExecutor.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTDefines.h>\n#import <React/RCTJavaScriptExecutor.h>\n\n#if RCT_DEV // Debug executors are only supported in dev mode\n\n@interface RCTWebSocketExecutor : NSObject <RCTJavaScriptExecutor>\n\n- (instancetype)initWithURL:(NSURL *)URL;\n\n@end\n\n#endif\n"
  },
  {
    "path": "Libraries/WebSocket/RCTWebSocketExecutor.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTWebSocketExecutor.h\"\n\n#import <React/RCTAssert.h>\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTDefines.h>\n#import <React/RCTLog.h>\n#import <React/RCTUtils.h>\n\n#import \"RCTSRWebSocket.h\"\n\n#if RCT_DEV // Debug executors are only supported in dev mode\n\ntypedef void (^RCTWSMessageCallback)(NSError *error, NSDictionary<NSString *, id> *reply);\n\n@interface RCTWebSocketExecutor () <RCTSRWebSocketDelegate>\n\n@end\n\n@implementation RCTWebSocketExecutor\n{\n  RCTSRWebSocket *_socket;\n  dispatch_queue_t _jsQueue;\n  NSMutableDictionary<NSNumber *, RCTWSMessageCallback> *_callbacks;\n  dispatch_semaphore_t _socketOpenSemaphore;\n  NSMutableDictionary<NSString *, NSString *> *_injectedObjects;\n  NSURL *_url;\n  NSError *_setupError;\n}\n\nRCT_EXPORT_MODULE()\n\n@synthesize bridge = _bridge;\n\n- (instancetype)initWithURL:(NSURL *)URL\n{\n  RCTAssertParam(URL);\n\n  if ((self = [self init])) {\n    _url = URL;\n  }\n  return self;\n}\n\n- (void)setUp\n{\n  if (!_url) {\n    NSInteger port = [[[_bridge bundleURL] port] integerValue] ?: RCT_METRO_PORT;\n    NSString *host = [[_bridge bundleURL] host] ?: @\"localhost\";\n    NSString *URLString = [NSString stringWithFormat:@\"http://%@:%lld/debugger-proxy?role=client\", host, (long long)port];\n    _url = [RCTConvert NSURL:URLString];\n  }\n\n  _jsQueue = dispatch_queue_create(\"com.facebook.react.WebSocketExecutor\", DISPATCH_QUEUE_SERIAL);\n  _socket = [[RCTSRWebSocket alloc] initWithURL:_url];\n  _socket.delegate = self;\n  _callbacks = [NSMutableDictionary new];\n  _injectedObjects = [NSMutableDictionary new];\n  [_socket setDelegateDispatchQueue:_jsQueue];\n\n  NSURL *startDevToolsURL = [NSURL URLWithString:@\"/launch-js-devtools\" relativeToURL:_url];\n\n  NSURLSession *session = [NSURLSession sharedSession];\n  NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:[NSURLRequest requestWithURL:startDevToolsURL]\n                                              completionHandler:^(NSData *data, NSURLResponse *response, NSError *error){}];\n  [dataTask resume];\n  if (![self connectToProxy]) {\n    [self invalidate];\n    NSString *error = [NSString stringWithFormat:@\"Connection to %@ timed out. Are you \"\n                       \"running node proxy? If you are running on the device, check if \"\n                       \"you have the right IP address in `RCTWebSocketExecutor.m`.\", _url];\n    _setupError = RCTErrorWithMessage(error);\n    RCTFatal(_setupError);\n    return;\n  }\n\n  NSInteger retries = 3;\n  BOOL runtimeIsReady = [self prepareJSRuntime];\n  while (!runtimeIsReady && retries > 0) {\n    runtimeIsReady = [self prepareJSRuntime];\n    retries--;\n  }\n  if (!runtimeIsReady) {\n    [self invalidate];\n    NSString *error = @\"Runtime is not ready for debugging.\\n \"\n                      \"- Make sure Packager server is running.\\n\"\n                      \"- Make sure the JavaScript Debugger is running and not paused on a \"\n                      \"breakpoint or exception and try reloading again.\";\n    _setupError = RCTErrorWithMessage(error);\n    RCTFatal(_setupError);\n    return;\n  }\n}\n\n- (BOOL)connectToProxy\n{\n  _socketOpenSemaphore = dispatch_semaphore_create(0);\n  [_socket open];\n  long connected = dispatch_semaphore_wait(_socketOpenSemaphore, dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * 10));\n  return connected == 0 && _socket.readyState == RCTSR_OPEN;\n}\n\n- (BOOL)prepareJSRuntime\n{\n  __block NSError *initError;\n  dispatch_semaphore_t s = dispatch_semaphore_create(0);\n  [self sendMessage:@{@\"method\": @\"prepareJSRuntime\"} onReply:^(NSError *error, NSDictionary<NSString *, id> *reply) {\n    initError = error;\n    dispatch_semaphore_signal(s);\n  }];\n  long runtimeIsReady = dispatch_semaphore_wait(s, dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * 5));\n  if (initError) {\n    RCTLogInfo(@\"Websocket runtime setup failed: %@\", initError);\n  }\n  return runtimeIsReady == 0 && initError == nil;\n}\n\n- (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message\n{\n  NSError *error = nil;\n  NSDictionary<NSString *, id> *reply = RCTJSONParse(message, &error);\n  NSNumber *messageID = reply[@\"replyID\"];\n  RCTWSMessageCallback callback = _callbacks[messageID];\n  if (callback) {\n    callback(error, reply);\n    [_callbacks removeObjectForKey:messageID];\n  }\n}\n\n- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket\n{\n  dispatch_semaphore_signal(_socketOpenSemaphore);\n}\n\n- (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error\n{\n  dispatch_semaphore_signal(_socketOpenSemaphore);\n  RCTLogInfo(@\"WebSocket connection failed with error %@\", error);\n}\n\n- (void)sendMessage:(NSDictionary<NSString *, id> *)message onReply:(RCTWSMessageCallback)callback\n{\n  static NSUInteger lastID = 10000;\n\n  if (_setupError) {\n    callback(_setupError, nil);\n    return;\n  }\n\n  dispatch_async(_jsQueue, ^{\n    if (!self.valid) {\n      callback(RCTErrorWithMessage(@\"Runtime is not ready for debugging. Make sure Packager server is running.\"), nil);\n      return;\n    }\n\n    NSNumber *expectedID = @(lastID++);\n    self->_callbacks[expectedID] = [callback copy];\n    NSMutableDictionary<NSString *, id> *messageWithID = [message mutableCopy];\n    messageWithID[@\"id\"] = expectedID;\n    [self->_socket send:RCTJSONStringify(messageWithID, NULL)];\n  });\n}\n\n- (void)executeApplicationScript:(NSData *)script sourceURL:(NSURL *)URL onComplete:(RCTJavaScriptCompleteBlock)onComplete\n{\n  // Hack: the bridge transitions out of loading state as soon as this method returns, which prevents us\n  // from completely invalidating the bridge and preventing an endless barage of RCTLog.logIfNoNativeHook\n  // calls if the JS execution environment is broken. We therefore block this thread until this message has returned.\n  dispatch_semaphore_t scriptSem = dispatch_semaphore_create(0);\n\n  NSDictionary<NSString *, id> *message = @{\n    @\"method\": @\"executeApplicationScript\",\n    @\"url\": RCTNullIfNil(URL.absoluteString),\n    @\"inject\": _injectedObjects,\n  };\n  [self sendMessage:message onReply:^(NSError *socketError, NSDictionary<NSString *, id> *reply) {\n    if (socketError) {\n      onComplete(socketError);\n    } else {\n      NSString *error = reply[@\"error\"];\n      onComplete(error ? RCTErrorWithMessage(error) : nil);\n    }\n    dispatch_semaphore_signal(scriptSem);\n  }];\n\n  dispatch_semaphore_wait(scriptSem, DISPATCH_TIME_FOREVER);\n}\n\n- (void)flushedQueue:(RCTJavaScriptCallback)onComplete\n{\n  [self _executeJSCall:@\"flushedQueue\" arguments:@[] callback:onComplete];\n}\n\n- (void)callFunctionOnModule:(NSString *)module\n                      method:(NSString *)method\n                   arguments:(NSArray *)args\n                    callback:(RCTJavaScriptCallback)onComplete\n{\n  [self _executeJSCall:@\"callFunctionReturnFlushedQueue\" arguments:@[module, method, args] callback:onComplete];\n}\n\n- (void)invokeCallbackID:(NSNumber *)cbID\n               arguments:(NSArray *)args\n                callback:(RCTJavaScriptCallback)onComplete\n{\n  [self _executeJSCall:@\"invokeCallbackAndReturnFlushedQueue\" arguments:@[cbID, args] callback:onComplete];\n}\n\n- (void)_executeJSCall:(NSString *)method arguments:(NSArray *)arguments callback:(RCTJavaScriptCallback)onComplete\n{\n  RCTAssert(onComplete != nil, @\"callback was missing for exec JS call\");\n  NSDictionary<NSString *, id> *message = @{\n    @\"method\": method,\n    @\"arguments\": arguments\n  };\n  [self sendMessage:message onReply:^(NSError *socketError, NSDictionary<NSString *, id> *reply) {\n    if (socketError) {\n      onComplete(nil, socketError);\n      return;\n    }\n\n    NSError *jsonError;\n    id result = RCTJSONParse(reply[@\"result\"], &jsonError);\n    NSString *error = reply[@\"error\"];\n    onComplete(result, error ? RCTErrorWithMessage(error) : jsonError);\n  }];\n}\n\n- (void)injectJSONText:(NSString *)script asGlobalObjectNamed:(NSString *)objectName callback:(RCTJavaScriptCompleteBlock)onComplete\n{\n  dispatch_async(_jsQueue, ^{\n    self->_injectedObjects[objectName] = script;\n    onComplete(nil);\n  });\n}\n\n- (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block\n{\n  RCTExecuteOnMainQueue(block);\n}\n\n- (void)executeAsyncBlockOnJavaScriptQueue:(dispatch_block_t)block\n{\n  dispatch_async(dispatch_get_main_queue(), block);\n}\n\n- (void)invalidate\n{\n  _socket.delegate = nil;\n  [_socket closeWithCode:1000 reason:@\"Invalidated\"];\n  _socket = nil;\n}\n\n- (BOOL)isValid\n{\n  return _socket != nil && _socket.readyState == RCTSR_OPEN;\n}\n\n- (void)dealloc\n{\n  RCTAssert(!self.valid, @\"-invalidate must be called before -dealloc\");\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "Libraries/WebSocket/RCTWebSocketModule.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTEventEmitter.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@protocol RCTWebSocketContentHandler <NSObject>\n\n- (id)processMessage:(id __nullable)message forSocketID:(NSNumber *)socketID\n            withType:(NSString *__nonnull __autoreleasing *__nonnull)type;\n\n@end\n\n@interface RCTWebSocketModule : RCTEventEmitter\n\n// Register a custom handler for a specific websocket. The handler will be strongly held by the WebSocketModule.\n- (void)setContentHandler:(id<RCTWebSocketContentHandler> __nullable)handler forSocketID:(NSNumber *)socketID;\n\n- (void)sendData:(NSData *)data forSocketID:(nonnull NSNumber *)socketID;\n\n@end\n\n@interface RCTBridge (RCTWebSocketModule)\n\n- (RCTWebSocketModule *)webSocketModule;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/WebSocket/RCTWebSocketModule.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTWebSocketModule.h\"\n\n#import <objc/runtime.h>\n\n#import <React/RCTConvert.h>\n#import <React/RCTUtils.h>\n\n#import \"RCTSRWebSocket.h\"\n\n@implementation RCTSRWebSocket (React)\n\n- (NSNumber *)reactTag\n{\n  return objc_getAssociatedObject(self, _cmd);\n}\n\n- (void)setReactTag:(NSNumber *)reactTag\n{\n  objc_setAssociatedObject(self, @selector(reactTag), reactTag, OBJC_ASSOCIATION_COPY_NONATOMIC);\n}\n\n@end\n\n@interface RCTWebSocketModule () <RCTSRWebSocketDelegate>\n\n@end\n\n@implementation RCTWebSocketModule\n{\n  NSMutableDictionary<NSNumber *, RCTSRWebSocket *> *_sockets;\n  NSMutableDictionary<NSNumber *, id> *_contentHandlers;\n}\n\nRCT_EXPORT_MODULE()\n\n// Used by RCTBlobModule\n@synthesize methodQueue = _methodQueue;\n\n- (NSArray *)supportedEvents\n{\n  return @[@\"websocketMessage\",\n           @\"websocketOpen\",\n           @\"websocketFailed\",\n           @\"websocketClosed\"];\n}\n\n- (void)dealloc\n{\n  for (RCTSRWebSocket *socket in _sockets.allValues) {\n    socket.delegate = nil;\n    [socket close];\n  }\n}\n\nRCT_EXPORT_METHOD(connect:(NSURL *)URL protocols:(NSArray *)protocols options:(NSDictionary *)options socketID:(nonnull NSNumber *)socketID)\n{\n  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];\n\n  // We load cookies from sharedHTTPCookieStorage (shared with XHR and\n  // fetch). To get secure cookies for wss URLs, replace wss with https\n  // in the URL.\n  NSURLComponents *components = [NSURLComponents componentsWithURL:URL resolvingAgainstBaseURL:true];\n  if ([components.scheme.lowercaseString isEqualToString:@\"wss\"]) {\n    components.scheme = @\"https\";\n  }\n\n  // Load and set the cookie header.\n  NSArray<NSHTTPCookie *> *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:components.URL];\n  request.allHTTPHeaderFields = [NSHTTPCookie requestHeaderFieldsWithCookies:cookies];\n\n  // Load supplied headers\n  [options[@\"headers\"] enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *stop) {\n    [request addValue:[RCTConvert NSString:value] forHTTPHeaderField:key];\n  }];\n\n  RCTSRWebSocket *webSocket = [[RCTSRWebSocket alloc] initWithURLRequest:request protocols:protocols];\n  webSocket.delegate = self;\n  webSocket.reactTag = socketID;\n  if (!_sockets) {\n    _sockets = [NSMutableDictionary new];\n  }\n  _sockets[socketID] = webSocket;\n  [webSocket open];\n}\n\nRCT_EXPORT_METHOD(send:(NSString *)message forSocketID:(nonnull NSNumber *)socketID)\n{\n  [_sockets[socketID] send:message];\n}\n\nRCT_EXPORT_METHOD(sendBinary:(NSString *)base64String forSocketID:(nonnull NSNumber *)socketID)\n{\n  [self sendData:[[NSData alloc] initWithBase64EncodedString:base64String options:0] forSocketID:socketID];\n}\n\n- (void)sendData:(NSData *)data forSocketID:(nonnull NSNumber *)socketID\n{\n  [_sockets[socketID] send:data];\n}\n\nRCT_EXPORT_METHOD(ping:(nonnull NSNumber *)socketID)\n{\n  [_sockets[socketID] sendPing:NULL];\n}\n\nRCT_EXPORT_METHOD(close:(nonnull NSNumber *)socketID)\n{\n  [_sockets[socketID] close];\n  [_sockets removeObjectForKey:socketID];\n}\n\n- (void)setContentHandler:(id<RCTWebSocketContentHandler>)handler forSocketID:(NSString *)socketID\n{\n  if (!_contentHandlers) {\n    _contentHandlers = [NSMutableDictionary new];\n  }\n  _contentHandlers[socketID] = handler;\n}\n\n#pragma mark - RCTSRWebSocketDelegate methods\n\n- (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message\n{\n  NSString *type;\n\n  NSNumber *socketID = [webSocket reactTag];\n  id contentHandler = _contentHandlers[socketID];\n  if (contentHandler) {\n    message = [contentHandler processMessage:message forSocketID:socketID withType:&type];\n  } else {\n    if ([message isKindOfClass:[NSData class]]) {\n      type = @\"binary\";\n      message = [message base64EncodedStringWithOptions:0];\n    } else {\n      type = @\"text\";\n    }\n  }\n\n  [self sendEventWithName:@\"websocketMessage\" body:@{\n    @\"data\": message,\n    @\"type\": type,\n    @\"id\": webSocket.reactTag\n  }];\n}\n\n- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket\n{\n  [self sendEventWithName:@\"websocketOpen\" body:@{\n    @\"id\": webSocket.reactTag\n  }];\n}\n\n- (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error\n{\n  NSNumber *socketID = [webSocket reactTag];\n  _contentHandlers[socketID] = nil;\n  _sockets[socketID] = nil;\n  [self sendEventWithName:@\"websocketFailed\" body:@{\n    @\"message\": error.localizedDescription,\n    @\"id\": socketID\n  }];\n}\n\n- (void)webSocket:(RCTSRWebSocket *)webSocket\n didCloseWithCode:(NSInteger)code\n           reason:(NSString *)reason\n         wasClean:(BOOL)wasClean\n{\n  NSNumber *socketID = [webSocket reactTag];\n  _contentHandlers[socketID] = nil;\n  _sockets[socketID] = nil;\n  [self sendEventWithName:@\"websocketClosed\" body:@{\n    @\"code\": @(code),\n    @\"reason\": RCTNullIfNil(reason),\n    @\"clean\": @(wasClean),\n    @\"id\": socketID\n  }];\n}\n\n@end\n\n@implementation RCTBridge (RCTWebSocketModule)\n\n- (RCTWebSocketModule *)webSocketModule\n{\n  return [self moduleForClass:[RCTWebSocketModule class]];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/WebSocket/WebSocket.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule WebSocket\n * @flow\n */\n'use strict';\n\nconst Blob = require('Blob');\nconst EventTarget = require('event-target-shim');\nconst NativeEventEmitter = require('NativeEventEmitter');\nconst NativeModules = require('NativeModules');\nconst Platform = require('Platform');\nconst WebSocketEvent = require('WebSocketEvent');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst base64 = require('base64-js');\nconst binaryToBase64 = require('binaryToBase64');\nconst invariant = require('fbjs/lib/invariant');\n\nconst {WebSocketModule} = NativeModules;\n\nimport type EventSubscription from 'EventSubscription';\n\ntype ArrayBufferView =\n  | Int8Array\n  | Uint8Array\n  | Uint8ClampedArray\n  | Int16Array\n  | Uint16Array\n  | Int32Array\n  | Uint32Array\n  | Float32Array\n  | Float64Array\n  | DataView\n\ntype BinaryType = 'blob' | 'arraybuffer'\n\nconst CONNECTING = 0;\nconst OPEN = 1;\nconst CLOSING = 2;\nconst CLOSED = 3;\n\nconst CLOSE_NORMAL = 1000;\n\nconst WEBSOCKET_EVENTS = [\n  'close',\n  'error',\n  'message',\n  'open',\n];\n\nlet nextWebSocketId = 0;\n\n/**\n * Browser-compatible WebSockets implementation.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\n * See https://github.com/websockets/ws\n */\nclass WebSocket extends EventTarget(...WEBSOCKET_EVENTS) {\n  static CONNECTING = CONNECTING;\n  static OPEN = OPEN;\n  static CLOSING = CLOSING;\n  static CLOSED = CLOSED;\n\n  CONNECTING: number = CONNECTING;\n  OPEN: number = OPEN;\n  CLOSING: number = CLOSING;\n  CLOSED: number = CLOSED;\n\n  _socketId: number;\n  _eventEmitter: NativeEventEmitter;\n  _subscriptions: Array<EventSubscription>;\n  _binaryType: ?BinaryType;\n\n  onclose: ?Function;\n  onerror: ?Function;\n  onmessage: ?Function;\n  onopen: ?Function;\n\n  bufferedAmount: number;\n  extension: ?string;\n  protocol: ?string;\n  readyState: number = CONNECTING;\n  url: ?string;\n\n  // This module depends on the native `WebSocketModule` module. If you don't include it,\n  // `WebSocket.isAvailable` will return `false`, and WebSocket constructor will throw an error\n  static isAvailable: boolean = !!WebSocketModule;\n\n  constructor(url: string, protocols: ?string | ?Array<string>, options: ?{headers?: {origin?: string}}) {\n    super();\n    if (typeof protocols === 'string') {\n      protocols = [protocols];\n    }\n\n    const {headers = {}, ...unrecognized} = options || {};\n\n    // Preserve deprecated backwards compatibility for the 'origin' option\n    if (unrecognized && typeof unrecognized.origin === 'string') {\n      console.warn('Specifying `origin` as a WebSocket connection option is deprecated. Include it under `headers` instead.');\n      /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This\n       * comment suppresses an error found when Flow v0.54 was deployed. To see\n       * the error delete this comment and run Flow. */\n      headers.origin = unrecognized.origin;\n      /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This\n       * comment suppresses an error found when Flow v0.54 was deployed. To see\n       * the error delete this comment and run Flow. */\n      delete unrecognized.origin;\n    }\n\n    // Warn about and discard anything else\n    if (Object.keys(unrecognized).length > 0) {\n      console.warn('Unrecognized WebSocket connection option(s) `' + Object.keys(unrecognized).join('`, `') + '`. '\n        + 'Did you mean to put these under `headers`?');\n    }\n\n    if (!Array.isArray(protocols)) {\n      protocols = null;\n    }\n\n    if (!WebSocket.isAvailable) {\n      throw new Error('Cannot initialize WebSocket module. ' +\n      'Native module WebSocketModule is missing.');\n    }\n\n    this._eventEmitter = new NativeEventEmitter(WebSocketModule);\n    this._socketId = nextWebSocketId++;\n    this._registerEvents();\n    WebSocketModule.connect(url, protocols, { headers }, this._socketId);\n  }\n\n  get binaryType(): ?BinaryType {\n    return this._binaryType;\n  }\n\n  set binaryType(binaryType: BinaryType): void {\n    if (binaryType !== 'blob' && binaryType !== 'arraybuffer') {\n      throw new Error('binaryType must be either \\'blob\\' or \\'arraybuffer\\'');\n    }\n    if (this._binaryType === 'blob' || binaryType === 'blob') {\n      const BlobModule = NativeModules.BlobModule;\n      invariant(BlobModule, 'Native module BlobModule is required for blob support');\n      if (BlobModule) {\n        if (binaryType === 'blob') {\n          BlobModule.enableBlobSupport(this._socketId);\n        } else {\n          BlobModule.disableBlobSupport(this._socketId);\n        }\n      }\n    }\n    this._binaryType = binaryType;\n  }\n\n  close(code?: number, reason?: string): void {\n    if (this.readyState === this.CLOSING ||\n        this.readyState === this.CLOSED) {\n      return;\n    }\n\n    this.readyState = this.CLOSING;\n    this._close(code, reason);\n  }\n\n  send(data: string | ArrayBuffer | ArrayBufferView | Blob): void {\n    if (this.readyState === this.CONNECTING) {\n      throw new Error('INVALID_STATE_ERR');\n    }\n\n    if (data instanceof Blob) {\n      const BlobModule = NativeModules.BlobModule;\n      invariant(BlobModule, 'Native module BlobModule is required for blob support');\n      BlobModule.sendBlob(data, this._socketId);\n      return;\n    }\n\n    if (typeof data === 'string') {\n      WebSocketModule.send(data, this._socketId);\n      return;\n    }\n\n    if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) {\n      WebSocketModule.sendBinary(binaryToBase64(data), this._socketId);\n      return;\n    }\n\n    throw new Error('Unsupported data type');\n  }\n\n  ping(): void {\n    if (this.readyState === this.CONNECTING) {\n        throw new Error('INVALID_STATE_ERR');\n    }\n\n    WebSocketModule.ping(this._socketId);\n  }\n\n  _close(code?: number, reason?: string): void {\n    if (Platform.OS === 'android') {\n      // See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent\n      const statusCode = typeof code === 'number' ? code : CLOSE_NORMAL;\n      const closeReason = typeof reason === 'string' ? reason : '';\n      WebSocketModule.close(statusCode, closeReason, this._socketId);\n    } else {\n      WebSocketModule.close(this._socketId);\n    }\n  }\n\n  _unregisterEvents(): void {\n    this._subscriptions.forEach(e => e.remove());\n    this._subscriptions = [];\n  }\n\n  _registerEvents(): void {\n    this._subscriptions = [\n      this._eventEmitter.addListener('websocketMessage', ev => {\n        if (ev.id !== this._socketId) {\n          return;\n        }\n        let data = ev.data;\n        switch (ev.type) {\n          case 'binary':\n            data = base64.toByteArray(ev.data).buffer;\n            break;\n          case 'blob':\n            data = Blob.create(ev.data);\n            break;\n        }\n        this.dispatchEvent(new WebSocketEvent('message', { data }));\n      }),\n      this._eventEmitter.addListener('websocketOpen', ev => {\n        if (ev.id !== this._socketId) {\n          return;\n        }\n        this.readyState = this.OPEN;\n        this.dispatchEvent(new WebSocketEvent('open'));\n      }),\n      this._eventEmitter.addListener('websocketClosed', ev => {\n        if (ev.id !== this._socketId) {\n          return;\n        }\n        this.readyState = this.CLOSED;\n        this.dispatchEvent(new WebSocketEvent('close', {\n          code: ev.code,\n          reason: ev.reason,\n        }));\n        this._unregisterEvents();\n        this.close();\n      }),\n      this._eventEmitter.addListener('websocketFailed', ev => {\n        if (ev.id !== this._socketId) {\n          return;\n        }\n        this.readyState = this.CLOSED;\n        this.dispatchEvent(new WebSocketEvent('error', {\n          message: ev.message,\n        }));\n        this.dispatchEvent(new WebSocketEvent('close', {\n          message: ev.message,\n        }));\n        this._unregisterEvents();\n        this.close();\n      })\n    ];\n  }\n}\n\nmodule.exports = WebSocket;\n"
  },
  {
    "path": "Libraries/WebSocket/WebSocketEvent.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule WebSocketEvent\n */\n\n'use strict';\n\n/**\n * Event object passed to the `onopen`, `onclose`, `onmessage`, `onerror`\n * callbacks of `WebSocket`.\n *\n * The `type` property is \"open\", \"close\", \"message\", \"error\" respectively.\n *\n * In case of \"message\", the `data` property contains the incoming data.\n */\nclass WebSocketEvent {\n  constructor(type, eventInitDict) {\n    this.type = type.toString();\n    Object.assign(this, eventInitDict);\n  }\n}\n\nmodule.exports = WebSocketEvent;\n"
  },
  {
    "path": "Libraries/WebSocket/WebSocketInterceptor.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule WebSocketInterceptor\n */\n 'use strict';\n\nconst RCTWebSocketModule = require('NativeModules').WebSocketModule;\nconst NativeEventEmitter = require('NativeEventEmitter');\n\nconst base64 = require('base64-js');\n\nconst originalRCTWebSocketConnect = RCTWebSocketModule.connect;\nconst originalRCTWebSocketSend = RCTWebSocketModule.send;\nconst originalRCTWebSocketSendBinary = RCTWebSocketModule.sendBinary;\nconst originalRCTWebSocketClose = RCTWebSocketModule.close;\n\nlet eventEmitter: NativeEventEmitter;\nlet subscriptions: Array<EventSubscription>;\n\nlet closeCallback;\nlet sendCallback;\nlet connectCallback;\nlet onOpenCallback;\nlet onMessageCallback;\nlet onErrorCallback;\nlet onCloseCallback;\n\nlet isInterceptorEnabled = false;\n\n/**\n * A network interceptor which monkey-patches RCTWebSocketModule methods\n * to gather all websocket network requests/responses, in order to show\n * their information in the React Native inspector development tool.\n */\n\nconst WebSocketInterceptor = {\n  /**\n   * Invoked when RCTWebSocketModule.close(...) is called.\n   */\n  setCloseCallback(callback) {\n    closeCallback = callback;\n  },\n\n  /**\n   * Invoked when RCTWebSocketModule.send(...) or sendBinary(...) is called.\n   */\n  setSendCallback(callback) {\n    sendCallback = callback;\n  },\n\n  /**\n   * Invoked when RCTWebSocketModule.connect(...) is called.\n   */\n  setConnectCallback(callback) {\n    connectCallback = callback;\n  },\n\n  /**\n   * Invoked when event \"websocketOpen\" happens.\n   */\n  setOnOpenCallback(callback) {\n    onOpenCallback = callback;\n  },\n\n  /**\n   * Invoked when event \"websocketMessage\" happens.\n   */\n  setOnMessageCallback(callback) {\n    onMessageCallback = callback;\n  },\n\n  /**\n   * Invoked when event \"websocketFailed\" happens.\n   */\n  setOnErrorCallback(callback) {\n    onErrorCallback = callback;\n  },\n\n  /**\n   * Invoked when event \"websocketClosed\" happens.\n   */\n  setOnCloseCallback(callback) {\n    onCloseCallback = callback;\n  },\n\n  isInterceptorEnabled() {\n    return isInterceptorEnabled;\n  },\n\n  _unregisterEvents() {\n    subscriptions.forEach(e => e.remove());\n    subscriptions = [];\n  },\n\n  /**\n   * Add listeners to the RCTWebSocketModule events to intercept them.\n   */\n  _registerEvents() {\n    subscriptions = [\n      eventEmitter.addListener('websocketMessage', ev => {\n        if (onMessageCallback) {\n          onMessageCallback(\n            ev.id,\n            (ev.type === 'binary') ?\n            WebSocketInterceptor._arrayBufferToString(ev.data) : ev.data,\n          );\n        }\n      }),\n      eventEmitter.addListener('websocketOpen', ev => {\n        if (onOpenCallback) {\n          onOpenCallback(ev.id);\n        }\n      }),\n      eventEmitter.addListener('websocketClosed', ev => {\n        if (onCloseCallback) {\n          onCloseCallback(ev.id, {code: ev.code, reason: ev.reason});\n        }\n      }),\n      eventEmitter.addListener('websocketFailed', ev => {\n        if (onErrorCallback) {\n          onErrorCallback(ev.id, {message: ev.message});\n        }\n      })\n    ];\n  },\n\n  enableInterception() {\n    if (isInterceptorEnabled) {\n      return;\n    }\n    eventEmitter = new NativeEventEmitter(RCTWebSocketModule);\n    WebSocketInterceptor._registerEvents();\n\n    // Override `connect` method for all RCTWebSocketModule requests\n    // to intercept the request url, protocols, options and socketId,\n    // then pass them through the `connectCallback`.\n    RCTWebSocketModule.connect = function(url, protocols, options, socketId) {\n      if (connectCallback) {\n        connectCallback(url, protocols, options, socketId);\n      }\n      originalRCTWebSocketConnect.apply(this, arguments);\n    };\n\n    // Override `send` method for all RCTWebSocketModule requests to intercept\n    // the data sent, then pass them through the `sendCallback`.\n    RCTWebSocketModule.send = function(data, socketId) {\n      if (sendCallback) {\n        sendCallback(data, socketId);\n      }\n      originalRCTWebSocketSend.apply(this, arguments);\n    };\n\n    // Override `sendBinary` method for all RCTWebSocketModule requests to\n    // intercept the data sent, then pass them through the `sendCallback`.\n    RCTWebSocketModule.sendBinary = function(data, socketId) {\n      if (sendCallback) {\n        sendCallback(WebSocketInterceptor._arrayBufferToString(data), socketId);\n      }\n      originalRCTWebSocketSendBinary.apply(this, arguments);\n    };\n\n    // Override `close` method for all RCTWebSocketModule requests to intercept\n    // the close information, then pass them through the `closeCallback`.\n    RCTWebSocketModule.close = function() {\n      if (closeCallback) {\n        if (arguments.length === 3) {\n          closeCallback(arguments[0], arguments[1], arguments[2]);\n        } else {\n          closeCallback(null, null, arguments[0]);\n        }\n      }\n      originalRCTWebSocketClose.apply(this, arguments);\n    };\n\n    isInterceptorEnabled = true;\n  },\n\n   _arrayBufferToString(data) {\n    const value = base64.toByteArray(data).buffer;\n    if (value === undefined || value === null) {\n      return '(no value)';\n    }\n    if (typeof ArrayBuffer !== 'undefined' &&\n        typeof Uint8Array !== 'undefined' &&\n        value instanceof ArrayBuffer) {\n      return `ArrayBuffer {${String(Array.from(new Uint8Array(value)))}}`;\n    }\n    return value;\n  },\n\n  // Unpatch RCTWebSocketModule methods and remove the callbacks.\n  disableInterception() {\n    if (!isInterceptorEnabled) {\n      return;\n    }\n    isInterceptorEnabled = false;\n    RCTWebSocketModule.send = originalRCTWebSocketSend;\n    RCTWebSocketModule.sendBinary = originalRCTWebSocketSendBinary;\n    RCTWebSocketModule.close = originalRCTWebSocketClose;\n    RCTWebSocketModule.connect = originalRCTWebSocketConnect;\n\n    connectCallback = null;\n    closeCallback = null;\n    sendCallback = null;\n    onOpenCallback = null;\n    onMessageCallback = null;\n    onCloseCallback = null;\n    onErrorCallback = null;\n\n    WebSocketInterceptor._unregisterEvents();\n  },\n};\n\nmodule.exports = WebSocketInterceptor;\n"
  },
  {
    "path": "Libraries/WebSocket/__mocks__/event-target-shim.js",
    "content": "// Jest fatals for the following statement (minimal repro case)\n//\n//   exports.something = Symbol;\n//\n// Until it is fixed, mocking the entire node module makes the\n// problem go away.\n\n'use strict';\n\nfunction EventTarget() {\n  // Support both EventTarget and EventTarget(...)\n  // as a super class, just like the original module does.\n  if (arguments.length > 0) {\n    return EventTarget;\n  }\n}\n\nmodule.exports = EventTarget;\n"
  },
  {
    "path": "Libraries/WebSocket/__tests__/WebSocket-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+react_native\n */\n'use strict';\n\njest.enableAutomock().unmock('WebSocket');\njest.setMock('NativeModules', {\n  WebSocketModule: {\n    connect: () => {}\n  }\n});\n\nvar WebSocket = require('WebSocket');\n\ndescribe('WebSocket', function() {\n\n  it('should have connection lifecycle constants defined on the class', () => {\n    expect(WebSocket.CONNECTING).toEqual(0);\n  });\n\n  it('should have connection lifecycle constants defined on the instance', () => {\n    expect(new WebSocket('wss://echo.websocket.org').CONNECTING).toEqual(0);\n  });\n\n});\n"
  },
  {
    "path": "Libraries/Wrapper/Example/RCTWrapperExampleView.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTWrapperExampleView : UIView\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Wrapper/Example/RCTWrapperExampleView.m",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import \"RCTWrapperExampleView.h\"\n\n#import <RCTWrapper/RCTWrapper.h>\n\n@implementation RCTWrapperExampleView {\n  NSTimer *_timer;\n  CGSize _intrinsicContentSize;\n}\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if (self = [super initWithFrame:frame]) {\n    self.backgroundColor = [UIColor whiteColor];\n\n    _intrinsicContentSize = CGSizeMake(64, 64);\n    _timer = [NSTimer scheduledTimerWithTimeInterval:1.0\n                                              target:self\n                                            selector:@selector(tick)\n                                            userInfo:nil\n                                             repeats:YES];\n\n    UITapGestureRecognizer *gestureRecognizer =\n      [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tick)];\n    [self addGestureRecognizer:gestureRecognizer];\n  }\n  return self;\n}\n\n- (void)tick\n{\n  _intrinsicContentSize.width = 32 + arc4random() % 128;\n  _intrinsicContentSize.height = 32 + arc4random() % 128;\n\n  [self invalidateIntrinsicContentSize];\n  [self.superview setNeedsLayout];\n}\n\n- (CGSize)intrinsicContentSize\n{\n  return _intrinsicContentSize;\n}\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  return CGSizeMake(\n    MIN(size.width, _intrinsicContentSize.width),\n    MIN(size.height, _intrinsicContentSize.height)\n  );\n}\n\n@end\n\nRCT_WRAPPER_FOR_VIEW(RCTWrapperExampleView)\n"
  },
  {
    "path": "Libraries/Wrapper/Example/RCTWrapperExampleViewController.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTWrapperExampleViewController : UIViewController\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Wrapper/Example/RCTWrapperExampleViewController.m",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import \"RCTWrapperExampleViewController.h\"\n\n#import <RCTWrapper/RCTWrapper.h>\n\n#import \"RCTWrapperExampleView.h\"\n\n@implementation RCTWrapperExampleViewController\n\n- (void)loadView {\n  self.view = [RCTWrapperExampleView new];\n}\n\n@end\n\nRCT_WRAPPER_FOR_VIEW_CONTROLLER(RCTWrapperExampleViewController)\n"
  },
  {
    "path": "Libraries/Wrapper/Example/RCTWrapperReactRootViewController.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <UIKit/UIKit.h>\n\n@class RCTBridge;\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTWrapperReactRootViewController : UIViewController\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Wrapper/Example/RCTWrapperReactRootViewController.m",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import \"RCTWrapperReactRootViewController.h\"\n\n#import <RCTWrapper/RCTWrapper.h>\n#import <React/RCTBridge.h>\n#import <React/RCTRootView.h>\n\n#import \"RCTWrapperExampleView.h\"\n\n@implementation RCTWrapperReactRootViewController {\n  RCTBridge *_bridge;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  if (self = [super initWithNibName:nil bundle:nil]) {\n    _bridge = bridge;\n  }\n\n  return self;\n}\n\n- (void)loadView\n{\n  RCTRootView *rootView =\n    [[RCTRootView alloc] initWithBridge:_bridge\n                             moduleName:@\"WrapperExample\"\n                      initialProperties:@{}];\n\n  rootView.backgroundColor = [UIColor whiteColor];\n\n  UIActivityIndicatorView *progressIndicatorView =\n    [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];\n  [progressIndicatorView startAnimating];\n  rootView.loadingView = progressIndicatorView;\n\n  rootView.sizeFlexibility = RCTRootViewSizeFlexibilityWidthAndHeight;\n  self.view = rootView;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <UIKit/UIKit.h>\n\n#import <RCTWrapper/RCTWrapperViewManager.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTWrapperReactRootViewManager : RCTWrapperViewManager\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.m",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import \"RCTWrapperReactRootViewManager.h\"\n\n#import <RCTWrapper/RCTWrapperView.h>\n#import <RCTWrapper/RCTWrapperViewControllerHostingView.h>\n\n#import \"RCTWrapperReactRootViewController.h\"\n\n@implementation RCTWrapperReactRootViewManager\n\nRCT_EXPORT_MODULE()\n\n- (UIView *)view\n{\n  RCTWrapperViewControllerHostingView *contentViewControllerHostingView =\n    [RCTWrapperViewControllerHostingView new];\n\n  contentViewControllerHostingView.contentViewController =\n    [[RCTWrapperReactRootViewController alloc] initWithBridge:self.bridge];\n\n  RCTWrapperView *wrapperView = [super view];\n  wrapperView.contentView = contentViewControllerHostingView;\n  return wrapperView;\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Wrapper/RCTWrapper.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <UIKit/UIKit.h>\n\n#import <RCTWrapper/RCTWrapperView.h>\n#import <RCTWrapper/RCTWrapperViewControllerHostingView.h>\n#import <RCTWrapper/RCTWrapperViewManager.h>\n\n// Umbrella header with macros\n\n// RCT_WRAPPER_FOR_VIEW\n#define RCT_WRAPPER_FOR_VIEW(ClassName)                                        \\\n                                                                               \\\nNS_ASSUME_NONNULL_BEGIN                                                        \\\n                                                                               \\\n@interface ClassName##Manager : RCTWrapperViewManager                          \\\n                                                                               \\\n@end                                                                           \\\n                                                                               \\\nNS_ASSUME_NONNULL_END                                                          \\\n                                                                               \\\n@implementation ClassName##Manager                                             \\\n                                                                               \\\nRCT_EXPORT_MODULE()                                                            \\\n                                                                               \\\n- (UIView *)view                                                               \\\n{                                                                              \\\n  RCTWrapperView *wrapperView = [super view];                                  \\\n  wrapperView.contentView = [ClassName new];                                   \\\n  return wrapperView;                                                          \\\n}                                                                              \\\n                                                                               \\\n@end\n\n// RCT_WRAPPER_FOR_VIEW_CONTROLLER\n#define RCT_WRAPPER_FOR_VIEW_CONTROLLER(ClassName)                             \\\n                                                                               \\\nNS_ASSUME_NONNULL_BEGIN                                                        \\\n                                                                               \\\n@interface ClassName##Manager : RCTWrapperViewManager                          \\\n                                                                               \\\n@end                                                                           \\\n                                                                               \\\nNS_ASSUME_NONNULL_END                                                          \\\n                                                                               \\\n@implementation ClassName##Manager                                             \\\n                                                                               \\\nRCT_EXPORT_MODULE()                                                            \\\n                                                                               \\\n- (UIView *)view                                                               \\\n{                                                                              \\\n  RCTWrapperViewControllerHostingView *contentViewControllerHostingView =      \\\n    [RCTWrapperViewControllerHostingView new];                                 \\\n  contentViewControllerHostingView.contentViewController =                     \\\n    [[ClassName alloc] initWithNibName:nil bundle:nil];                        \\\n  RCTWrapperView *wrapperView = [super view];                                  \\\n  wrapperView.contentView = contentViewControllerHostingView;                  \\\n  return wrapperView;                                                          \\\n}                                                                              \\\n                                                                               \\\n@end\n"
  },
  {
    "path": "Libraries/Wrapper/RCTWrapperShadowView.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <UIKit/UIKit.h>\n\n#import <React/RCTShadowView.h>\n\n@class RCTBridge;\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTWrapperShadowView : RCTShadowView\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Wrapper/RCTWrapperShadowView.m",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import \"RCTWrapperShadowView.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTShadowView+Layout.h>\n\n#import \"RCTWrapperView.h\"\n\n@implementation RCTWrapperShadowView\n{\n  __weak RCTBridge *_bridge;\n  RCTWrapperMeasureBlock _measureBlock;\n  CGSize _intrinsicContentSize;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  if (self = [super init]) {\n    _bridge = bridge;\n    YGNodeSetMeasureFunc(self.yogaNode, RCTWrapperShadowViewMeasure);\n  }\n\n  return self;\n}\n\nstatic YGSize RCTWrapperShadowViewMeasure(YGNodeRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)\n{\n  CGSize minimumSize = CGSizeMake(0, 0);\n  CGSize maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);\n\n  switch (widthMode) {\n    case YGMeasureModeUndefined:\n      break;\n    case YGMeasureModeExactly:\n      minimumSize.width = width;\n      maximumSize.width = width;\n      break;\n    case YGMeasureModeAtMost:\n      maximumSize.width = width;\n      break;\n  }\n\n  switch (heightMode) {\n    case YGMeasureModeUndefined:\n      break;\n    case YGMeasureModeExactly:\n      minimumSize.height = height;\n      maximumSize.height = height;\n      break;\n    case YGMeasureModeAtMost:\n      maximumSize.height = height;\n      break;\n  }\n\n  RCTWrapperShadowView *shadowView = (__bridge RCTWrapperShadowView *)YGNodeGetContext(node);\n  CGSize size = [shadowView measureWithMinimumSize:minimumSize maximumSize:maximumSize];\n\n  return (YGSize){\n    RCTYogaFloatFromCoreGraphicsFloat(size.width),\n    RCTYogaFloatFromCoreGraphicsFloat(size.height)\n  };\n}\n\n- (CGSize)measureWithMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize\n{\n  dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC);\n\n  if (!_measureBlock) {\n    RCTBridge *bridge = _bridge;\n    __block RCTWrapperMeasureBlock measureBlock;\n    NSNumber *reactTag = self.reactTag;\n\n    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);\n\n    dispatch_async(dispatch_get_main_queue(), ^{\n      RCTUIManager *uiManager = bridge.uiManager;\n      RCTWrapperView *view = (RCTWrapperView *)[uiManager viewForReactTag:reactTag];\n      measureBlock = view.measureBlock;\n\n      dispatch_semaphore_signal(semaphore);\n    });\n\n    if (dispatch_semaphore_wait(semaphore, timeout)) {\n      RCTLogError(@\"Unable to retrieve `measureBlock` for view (%@) because the main thread is busy.\", self);\n    }\n\n    _measureBlock = measureBlock;\n  }\n\n  if (!_measureBlock) {\n    return maximumSize;\n  }\n\n  __block CGSize size = maximumSize;\n\n  dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);\n\n  dispatch_async(dispatch_get_main_queue(), ^{\n    size = self->_measureBlock(minimumSize, maximumSize);\n    dispatch_semaphore_signal(semaphore);\n  });\n\n  if (dispatch_semaphore_wait(semaphore, timeout)) {\n    RCTLogError(@\"Unable to compute layout for view (%@) because the main thread is busy.\", self);\n  }\n\n  return size;\n}\n\n- (BOOL)isYogaLeafNode\n{\n  return YES;\n}\n\n- (CGSize)intrinsicContentSize\n{\n  return _intrinsicContentSize;\n}\n\n- (void)setIntrinsicContentSize:(CGSize)size\n{\n  _intrinsicContentSize = size;\n  YGNodeMarkDirty(self.yogaNode);\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Wrapper/RCTWrapperView.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <UIKit/UIKit.h>\n\ntypedef CGSize (^RCTWrapperMeasureBlock)(CGSize minimumSize, CGSize maximumSize);\n\n@class RCTBridge;\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTWrapperView : UIView\n\n@property (nonatomic, retain, nullable) UIView *contentView;\n@property (nonatomic, readonly) RCTWrapperMeasureBlock measureBlock;\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;\n\n#pragma mark - Restrictions\n\n- (instancetype)init NS_UNAVAILABLE;\n- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;\n- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;\n\n- (void)addSubview:(UIView *)view NS_UNAVAILABLE;\n- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index NS_UNAVAILABLE;\n- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview NS_UNAVAILABLE;\n- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview NS_UNAVAILABLE;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Wrapper/RCTWrapperView.m",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import \"RCTWrapperView.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTUIManager.h>\n\n@implementation RCTWrapperView {\n  __weak RCTBridge *_bridge;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  if (self = [super initWithFrame:CGRectZero]) {\n    _bridge = bridge;\n    __weak __typeof(self) weakSelf = self;\n\n    _measureBlock = ^(CGSize minimumSize, CGSize maximumSize) {\n      __typeof(self) strongSelf = weakSelf;\n\n      if (!strongSelf) {\n        return maximumSize;\n      }\n\n      CGSize size = [strongSelf sizeThatFits:maximumSize];\n\n      return CGSizeMake(\n        MAX(size.width, minimumSize.width),\n        MAX(size.height, minimumSize.height)\n      );\n    };\n  }\n\n  return self;\n}\n\n#pragma mark - `contentView`\n\n- (nullable UIView *)contentView\n{\n  return self.subviews.firstObject;\n}\n\n- (void)setContentView:(UIView *)contentView\n{\n  while (self.subviews.firstObject) {\n    [self.subviews.firstObject removeFromSuperview];\n  }\n\n  if (!contentView) {\n    return;\n  }\n\n  [super addSubview:contentView];\n\n  contentView.frame = self.bounds;\n  contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;\n  contentView.translatesAutoresizingMaskIntoConstraints = YES;\n}\n\n#pragma mark - Layout\n\n- (void)setNeedsLayout\n{\n  [super setNeedsLayout];\n  [self invalidateIntrinsicContentSize];\n}\n\n- (void)invalidateIntrinsicContentSize\n{\n  [super invalidateIntrinsicContentSize];\n\n  // Setting `intrinsicContentSize` dirties the Yoga node and\n  // enfoce Yoga to call `measure` function (backed to `measureBlock`).\n  [_bridge.uiManager setIntrinsicContentSize:self.intrinsicContentSize forView:self];\n}\n\n- (CGSize)intrinsicContentSize\n{\n  return [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];\n}\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  UIView *contentView = self.contentView;\n  if (!contentView) {\n    return [super sizeThatFits:size];\n  }\n\n  return [contentView sizeThatFits:size];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Wrapper/RCTWrapperViewControllerHostingView.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTWrapperViewControllerHostingView : UIView\n\n@property (nonatomic, retain, nullable) UIViewController *contentViewController;\n\n#pragma mark - Restrictions\n\n- (void)addSubview:(UIView *)view NS_UNAVAILABLE;\n- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index NS_UNAVAILABLE;\n- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview NS_UNAVAILABLE;\n- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview NS_UNAVAILABLE;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Wrapper/RCTWrapperViewControllerHostingView.m",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import \"RCTWrapperViewControllerHostingView.h\"\n\n#import <React/UIView+React.h>\n\n#pragma mark - UIViewController+Children\n\n@interface UIViewController (Children)\n\n@property (nonatomic, readonly) BOOL isAttached;\n- (void)attachChildViewController:(UIViewController *)childViewController toContainerView:(UIView *)containerView;\n- (void)detachChildViewController:(UIViewController *)childViewController;\n\n@end\n\n@implementation UIViewController (Children)\n\n- (BOOL)isAttached\n{\n  return self.parentViewController != nil;\n}\n\n- (void)attachChildViewController:(UIViewController *)childViewController toContainerView:(UIView *)containerView\n{\n  [self addChildViewController:childViewController];\n  // `[childViewController willMoveToParentViewController:self]` is calling automatically\n  [containerView addSubview:childViewController.view];\n  childViewController.view.frame = containerView.bounds;\n  childViewController.view.translatesAutoresizingMaskIntoConstraints = YES;\n  childViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;\n  [childViewController didMoveToParentViewController:self];\n\n  [childViewController beginAppearanceTransition:true animated:false];\n  [childViewController endAppearanceTransition];\n}\n\n- (void)detachChildViewController:(UIViewController *)childViewController\n{\n  [childViewController beginAppearanceTransition:false animated: false];\n  [childViewController endAppearanceTransition];\n\n  [childViewController willMoveToParentViewController:nil];\n  [childViewController.view removeFromSuperview];\n  [childViewController removeFromParentViewController];\n  // `[childViewController didMoveToParentViewController:nil]` is calling automatically\n}\n\n@end\n\n@implementation RCTWrapperViewControllerHostingView {\n  UIViewController *_Nullable _contentViewController;\n}\n\n#pragma mark - `contentViewController`\n\n- (nullable UIViewController *)contentViewController\n{\n  return _contentViewController;\n}\n\n- (void)setContentViewController:(UIViewController *)contentViewController\n{\n\n  if (_contentViewController) {\n    [self detachContentViewControllerIfNeeded];\n  }\n\n  _contentViewController = contentViewController;\n\n  if (_contentViewController) {\n    [self attachContentViewControllerIfNeeded];\n  }\n}\n\n#pragma mark - Attaching and Detaching\n\n- (void)attachContentViewControllerIfNeeded\n{\n  if (self.contentViewController.isAttached) {\n    return;\n  }\n\n  [self.reactViewController attachChildViewController:self.contentViewController toContainerView:self];\n}\n\n- (void)detachContentViewControllerIfNeeded\n{\n  if (!self.contentViewController.isAttached) {\n    return;\n  }\n\n  [self.reactViewController detachChildViewController:self.contentViewController];\n}\n\n#pragma mark - Life cycle\n\n- (void)willMoveToWindow:(UIWindow *)newWindow\n{\n  if (newWindow == nil) {\n    [self detachContentViewControllerIfNeeded];\n  }\n}\n\n- (void)didMoveToWindow\n{\n  [super didMoveToWindow];\n  [self attachContentViewControllerIfNeeded];\n}\n\n#pragma mark - Layout\n\n- (void)setNeedsLayout\n{\n  [super setNeedsLayout];\n  [self.superview setNeedsLayout];\n}\n\n- (CGSize)intrinsicContentSize\n{\n  return self.contentViewController.view.intrinsicContentSize;\n}\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  return [self.contentViewController.view sizeThatFits:size];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/Wrapper/RCTWrapperViewManager.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <React/RCTViewManager.h>\n\n@class RCTWrapperView;\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTWrapperViewManager : RCTViewManager\n\n- (RCTWrapperView *)view NS_REQUIRES_SUPER;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Libraries/Wrapper/RCTWrapperViewManager.m",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import \"RCTWrapperViewManager.h\"\n\n#import \"RCTWrapperShadowView.h\"\n#import \"RCTWrapperView.h\"\n\n@implementation RCTWrapperViewManager\n\nRCT_EXPORT_MODULE()\n\n- (RCTShadowView *)shadowView\n{\n  return [[RCTWrapperShadowView alloc] initWithBridge:self.bridge];\n}\n\n- (UIView *)view\n{\n  return [[RCTWrapperView alloc] initWithBridge:self.bridge];\n}\n\n@end\n"
  },
  {
    "path": "Libraries/fishhook/LICENSE",
    "content": "// Copyright (c) 2013, Facebook, Inc.\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//   * Redistributions of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//   * Redistributions in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//   * Neither the name Facebook nor the names of its contributors may be used to\n//     endorse or promote products derived from this software without specific\n//     prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
  },
  {
    "path": "Libraries/fishhook/README.md",
    "content": "# fishhook\n\n__fishhook__ is a very simple library that enables dynamically rebinding symbols in Mach-O binaries running on iOS in the simulator and on device. This provides functionality that is similar to using [`DYLD_INTERPOSE`][interpose] on OS X. At Facebook, we've found it useful as a way to hook calls in libSystem for debugging/tracing purposes (for example, auditing for double-close issues with file descriptors).\n\n[interpose]: http://opensource.apple.com/source/dyld/dyld-210.2.3/include/mach-o/dyld-interposing.h \"<mach-o/dyld-interposing.h>\"\n\n## Usage\n\nOnce you add `fishhook.h`/`fishhook.c` to your project, you can rebind symbols as follows:\n```Objective-C\n#import <dlfcn.h>\n\n#import <UIKit/UIKit.h>\n\n#import \"AppDelegate.h\"\n#import \"fishhook.h\"\n \nstatic int (*orig_close)(int);\nstatic int (*orig_open)(const char *, int, ...);\n \nint my_close(int fd) {\n  printf(\"Calling real close(%d)\\n\", fd);\n  return orig_close(fd);\n}\n \nint my_open(const char *path, int oflag, ...) {\n  va_list ap = {0};\n  mode_t mode = 0;\n \n  if ((oflag & O_CREAT) != 0) {\n    // mode only applies to O_CREAT\n    va_start(ap, oflag);\n    mode = va_arg(ap, int);\n    va_end(ap);\n    printf(\"Calling real open('%s', %d, %d)\\n\", path, oflag, mode);\n    return orig_open(path, oflag, mode);\n  } else {\n    printf(\"Calling real open('%s', %d)\\n\", path, oflag);\n    return orig_open(path, oflag, mode);\n  }\n}\n \nint main(int argc, char * argv[])\n{\n  @autoreleasepool {\n    rebind_symbols((struct rebinding[2]){{\"close\", my_close, (void *)&orig_close}, {\"open\", my_open, (void *)&orig_open}}, 2);\n \n    // Open our own binary and print out first 4 bytes (which is the same\n    // for all Mach-O binaries on a given architecture)\n    int fd = open(argv[0], O_RDONLY);\n    uint32_t magic_number = 0;\n    read(fd, &magic_number, 4);\n    printf(\"Mach-O Magic Number: %x \\n\", magic_number);\n    close(fd);\n \n    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));\n  }\n}\n```\n### Sample output\n```\nCalling real open('/var/mobile/Applications/161DA598-5B83-41F5-8A44-675491AF6A2C/Test.app/Test', 0)\nMach-O Magic Number: feedface \nCalling real close(3)\n...\n```\n\n## How it works\n\n`dyld` binds lazy and non-lazy symbols by updating pointers in particular sections of the `__DATA` segment of a Mach-O binary. __fishhook__ re-binds these symbols by determining the locations to update for each of the symbol names passed to `rebind_symbols` and then writing out the corresponding replacements.\n\nFor a given image, the `__DATA` segment may contain two sections that are relevant for dynamic symbol bindings: `__nl_symbol_ptr` and `__la_symbol_ptr`. `__nl_symbol_ptr` is an array of pointers to non-lazily bound data (these are bound at the time a library is loaded) and `__la_symbol_ptr` is an array of pointers to imported functions that is generally filled by a routine called `dyld_stub_binder` during the first call to that symbol (it's also possible to tell `dyld` to bind these at launch). In order to find the name of the symbol that corresponds to a particular location in one of these sections, we have to jump through several layers of indirection. For the two relevant sections, the section headers (`struct section`s from `<mach-o/loader.h>`) provide an offset (in the `reserved1` field) into what is known as the indirect symbol table. The indirect symbol table, which is located in the `__LINKEDIT` segment of the binary, is just an array of indexes into the symbol table (also in `__LINKEDIT`) whose order is identical to that of the pointers in the non-lazy and lazy symbol sections. So, given `struct section nl_symbol_ptr`, the corresponding index in the symbol table of the first address in that section is `indirect_symbol_table[nl_symbol_ptr->reserved1]`. The symbol table itself is an array of `struct nlist`s (see `<mach-o/nlist.h>`), and each `nlist` contains an index into the string table in `__LINKEDIT` which where the actual symbol names are stored. So, for each pointer `__nl_symbol_ptr` and `__la_symbol_ptr`, we are able to find the corresponding symbol and then the corresponding string to compare against the requested symbol names, and if there is a match, we replace the pointer in the section with the replacement.\n\nThe process of looking up the name of a given entry in the lazy or non-lazy pointer tables looks like this:\n![Visual explanation](http://i.imgur.com/HVXqHCz.png)"
  },
  {
    "path": "Libraries/fishhook/fishhook.c",
    "content": "// Copyright (c) 2013, Facebook, Inc.\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//   * Redistributions of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//   * Redistributions in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//   * Neither the name Facebook nor the names of its contributors may be used to\n//     endorse or promote products derived from this software without specific\n//     prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#import \"fishhook.h\"\n\n#import <dlfcn.h>\n#import <stdlib.h>\n#import <string.h>\n#import <sys/types.h>\n#import <mach-o/dyld.h>\n#import <mach-o/loader.h>\n#import <mach-o/nlist.h>\n\n#ifdef __LP64__\ntypedef struct mach_header_64 mach_header_t;\ntypedef struct segment_command_64 segment_command_t;\ntypedef struct section_64 section_t;\ntypedef struct nlist_64 nlist_t;\n#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT_64\n#else\ntypedef struct mach_header mach_header_t;\ntypedef struct segment_command segment_command_t;\ntypedef struct section section_t;\ntypedef struct nlist nlist_t;\n#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT\n#endif\n\n#ifndef SEG_DATA_CONST\n#define SEG_DATA_CONST  \"__DATA_CONST\"\n#endif\n\nstruct rebindings_entry {\n  struct rebinding *rebindings;\n  size_t rebindings_nel;\n  struct rebindings_entry *next;\n};\n\nstatic struct rebindings_entry *_rebindings_head;\n\nstatic int prepend_rebindings(struct rebindings_entry **rebindings_head,\n                              struct rebinding rebindings[],\n                              size_t nel) {\n  struct rebindings_entry *new_entry = (struct rebindings_entry *) malloc(sizeof(struct rebindings_entry));\n  if (!new_entry) {\n    return -1;\n  }\n  new_entry->rebindings = (struct rebinding *) malloc(sizeof(struct rebinding) * nel);\n  if (!new_entry->rebindings) {\n    free(new_entry);\n    return -1;\n  }\n  memcpy(new_entry->rebindings, rebindings, sizeof(struct rebinding) * nel);\n  new_entry->rebindings_nel = nel;\n  new_entry->next = *rebindings_head;\n  *rebindings_head = new_entry;\n  return 0;\n}\n\nstatic void perform_rebinding_with_section(struct rebindings_entry *rebindings,\n                                           section_t *section,\n                                           intptr_t slide,\n                                           nlist_t *symtab,\n                                           char *strtab,\n                                           uint32_t *indirect_symtab) {\n  uint32_t *indirect_symbol_indices = indirect_symtab + section->reserved1;\n  void **indirect_symbol_bindings = (void **)((uintptr_t)slide + section->addr);\n  for (uint i = 0; i < section->size / sizeof(void *); i++) {\n    uint32_t symtab_index = indirect_symbol_indices[i];\n    if (symtab_index == INDIRECT_SYMBOL_ABS || symtab_index == INDIRECT_SYMBOL_LOCAL ||\n        symtab_index == (INDIRECT_SYMBOL_LOCAL   | INDIRECT_SYMBOL_ABS)) {\n      continue;\n    }\n    uint32_t strtab_offset = symtab[symtab_index].n_un.n_strx;\n    char *symbol_name = strtab + strtab_offset;\n    if (strnlen(symbol_name, 2) < 2) {\n      continue;\n    }\n    struct rebindings_entry *cur = rebindings;\n    while (cur) {\n      for (uint j = 0; j < cur->rebindings_nel; j++) {\n        if (strcmp(&symbol_name[1], cur->rebindings[j].name) == 0) {\n          if (cur->rebindings[j].replaced != NULL &&\n              indirect_symbol_bindings[i] != cur->rebindings[j].replacement) {\n            *(cur->rebindings[j].replaced) = indirect_symbol_bindings[i];\n          }\n          indirect_symbol_bindings[i] = cur->rebindings[j].replacement;\n          goto symbol_loop;\n        }\n      }\n      cur = cur->next;\n    }\n  symbol_loop:;\n  }\n}\n\nstatic void rebind_symbols_for_image(struct rebindings_entry *rebindings,\n                                     const struct mach_header *header,\n                                     intptr_t slide) {\n  Dl_info info;\n  if (dladdr(header, &info) == 0) {\n    return;\n  }\n\n  segment_command_t *cur_seg_cmd;\n  segment_command_t *linkedit_segment = NULL;\n  struct symtab_command* symtab_cmd = NULL;\n  struct dysymtab_command* dysymtab_cmd = NULL;\n\n  uintptr_t cur = (uintptr_t)header + sizeof(mach_header_t);\n  for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) {\n    cur_seg_cmd = (segment_command_t *)cur;\n    if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) {\n      if (strcmp(cur_seg_cmd->segname, SEG_LINKEDIT) == 0) {\n        linkedit_segment = cur_seg_cmd;\n      }\n    } else if (cur_seg_cmd->cmd == LC_SYMTAB) {\n      symtab_cmd = (struct symtab_command*)cur_seg_cmd;\n    } else if (cur_seg_cmd->cmd == LC_DYSYMTAB) {\n      dysymtab_cmd = (struct dysymtab_command*)cur_seg_cmd;\n    }\n  }\n\n  if (!symtab_cmd || !dysymtab_cmd || !linkedit_segment ||\n      !dysymtab_cmd->nindirectsyms) {\n    return;\n  }\n\n  // Find base symbol/string table addresses\n  uintptr_t linkedit_base = (uintptr_t)slide + linkedit_segment->vmaddr - linkedit_segment->fileoff;\n  nlist_t *symtab = (nlist_t *)(linkedit_base + symtab_cmd->symoff);\n  char *strtab = (char *)(linkedit_base + symtab_cmd->stroff);\n\n  // Get indirect symbol table (array of uint32_t indices into symbol table)\n  uint32_t *indirect_symtab = (uint32_t *)(linkedit_base + dysymtab_cmd->indirectsymoff);\n\n  cur = (uintptr_t)header + sizeof(mach_header_t);\n  for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) {\n    cur_seg_cmd = (segment_command_t *)cur;\n    if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) {\n      if (strcmp(cur_seg_cmd->segname, SEG_DATA) != 0 &&\n          strcmp(cur_seg_cmd->segname, SEG_DATA_CONST) != 0) {\n        continue;\n      }\n      for (uint j = 0; j < cur_seg_cmd->nsects; j++) {\n        section_t *sect =\n          (section_t *)(cur + sizeof(segment_command_t)) + j;\n        if ((sect->flags & SECTION_TYPE) == S_LAZY_SYMBOL_POINTERS) {\n          perform_rebinding_with_section(rebindings, sect, slide, symtab, strtab, indirect_symtab);\n        }\n        if ((sect->flags & SECTION_TYPE) == S_NON_LAZY_SYMBOL_POINTERS) {\n          perform_rebinding_with_section(rebindings, sect, slide, symtab, strtab, indirect_symtab);\n        }\n      }\n    }\n  }\n}\n\nstatic void _rebind_symbols_for_image(const struct mach_header *header,\n                                      intptr_t slide) {\n    rebind_symbols_for_image(_rebindings_head, header, slide);\n}\n\nint rebind_symbols_image(void *header,\n                         intptr_t slide,\n                         struct rebinding rebindings[],\n                         size_t rebindings_nel) {\n    struct rebindings_entry *rebindings_head = NULL;\n    int retval = prepend_rebindings(&rebindings_head, rebindings, rebindings_nel);\n    rebind_symbols_for_image(rebindings_head, (const struct mach_header *) header, slide);\n    free(rebindings_head);\n    return retval;\n}\n\nint rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel) {\n  int retval = prepend_rebindings(&_rebindings_head, rebindings, rebindings_nel);\n  if (retval < 0) {\n    return retval;\n  }\n  // If this was the first call, register callback for image additions (which is also invoked for\n  // existing images, otherwise, just run on existing images\n  if (!_rebindings_head->next) {\n    _dyld_register_func_for_add_image(_rebind_symbols_for_image);\n  } else {\n    uint32_t c = _dyld_image_count();\n    for (uint32_t i = 0; i < c; i++) {\n      _rebind_symbols_for_image(_dyld_get_image_header(i), _dyld_get_image_vmaddr_slide(i));\n    }\n  }\n  return retval;\n}\n"
  },
  {
    "path": "Libraries/fishhook/fishhook.h",
    "content": "// Copyright (c) 2013, Facebook, Inc.\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//   * Redistributions of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//   * Redistributions in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//   * Neither the name Facebook nor the names of its contributors may be used to\n//     endorse or promote products derived from this software without specific\n//     prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef fishhook_h\n#define fishhook_h\n\n#include <stddef.h>\n#include <stdint.h>\n\n#if !defined(FISHHOOK_EXPORT)\n#define FISHHOOK_VISIBILITY __attribute__((visibility(\"hidden\")))\n#else\n#define FISHHOOK_VISIBILITY __attribute__((visibility(\"default\")))\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif //__cplusplus\n\n/*\n * A structure representing a particular intended rebinding from a symbol\n * name to its replacement\n */\nstruct rebinding {\n  const char *name;\n  void *replacement;\n  void **replaced;\n};\n\n/*\n * For each rebinding in rebindings, rebinds references to external, indirect\n * symbols with the specified name to instead point at replacement for each\n * image in the calling process as well as for all future images that are loaded\n * by the process. If rebind_functions is called more than once, the symbols to\n * rebind are added to the existing list of rebindings, and if a given symbol\n * is rebound more than once, the later rebinding will take precedence.\n */\nFISHHOOK_VISIBILITY\nint rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel);\n\n/*\n * Rebinds as above, but only in the specified image. The header should point\n * to the mach-o header, the slide should be the slide offset. Others as above.\n */\nFISHHOOK_VISIBILITY\nint rebind_symbols_image(void *header,\n                         intptr_t slide,\n                         struct rebinding rebindings[],\n                         size_t rebindings_nel);\n\n#ifdef __cplusplus\n}\n#endif //__cplusplus\n\n#endif //fishhook_h\n\n"
  },
  {
    "path": "Libraries/polyfills/Array.es6.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Array.es6\n * @polyfill\n * @nolint\n */\n\n/* eslint-disable consistent-this */\n\n/**\n * Creates an array from array like objects.\n *\n * https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from\n */\nif (!Array.from) {\n  Array.from = function(arrayLike /*, mapFn, thisArg */) {\n    if (arrayLike == null) {\n      throw new TypeError('Object is null or undefined');\n    }\n\n    // Optional args.\n    var mapFn = arguments[1];\n    var thisArg = arguments[2];\n\n    var C = this;\n    var items = Object(arrayLike);\n    var symbolIterator = typeof Symbol === 'function'\n      ? Symbol.iterator\n      : '@@iterator';\n    var mapping = typeof mapFn === 'function';\n    var usingIterator = typeof items[symbolIterator] === 'function';\n    var key = 0;\n    var ret;\n    var value;\n\n    if (usingIterator) {\n      ret = typeof C === 'function'\n        ? new C()\n        : [];\n      var it = items[symbolIterator]();\n      var next;\n\n      while (!(next = it.next()).done) {\n        value = next.value;\n\n        if (mapping) {\n          value = mapFn.call(thisArg, value, key);\n        }\n\n        ret[key] = value;\n        key += 1;\n      }\n\n      ret.length = key;\n      return ret;\n    }\n\n    var len = items.length;\n    if (isNaN(len) || len < 0) {\n      len = 0;\n    }\n\n    ret = typeof C === 'function'\n      ? new C(len)\n      : new Array(len);\n\n    while (key < len) {\n      value = items[key];\n\n      if (mapping) {\n        value = mapFn.call(thisArg, value, key);\n      }\n\n      ret[key] = value;\n\n      key += 1;\n    }\n\n    ret.length = key;\n    return ret;\n  };\n}\n"
  },
  {
    "path": "Libraries/polyfills/Array.prototype.es6.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Array.prototype.es6\n * @polyfill\n * @nolint\n */\n\n/* eslint-disable no-bitwise, no-extend-native, radix, no-self-compare */\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex\nfunction findIndex(predicate, context) {\n  if (this == null) {\n    throw new TypeError(\n      'Array.prototype.findIndex called on null or undefined'\n    );\n  }\n  if (typeof predicate !== 'function') {\n    throw new TypeError('predicate must be a function');\n  }\n  var list = Object(this);\n  var length = list.length >>> 0;\n  for (var i = 0; i < length; i++) {\n    if (predicate.call(context, list[i], i, list)) {\n      return i;\n    }\n  }\n  return -1;\n}\n\nif (!Array.prototype.findIndex) {\n  Object.defineProperty(Array.prototype, 'findIndex', {\n    enumerable: false,\n    writable: true,\n    configurable: true,\n    value: findIndex\n  });\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\nif (!Array.prototype.find) {\n  Object.defineProperty(Array.prototype, 'find', {\n    enumerable: false,\n    writable: true,\n    configurable: true,\n    value: function(predicate, context) {\n      if (this == null) {\n        throw new TypeError(\n          'Array.prototype.find called on null or undefined'\n        );\n      }\n      var index = findIndex.call(this, predicate, context);\n      return index === -1 ? undefined : this[index];\n    }\n  });\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes\nif (!Array.prototype.includes) {\n  Object.defineProperty(Array.prototype, 'includes', {\n    enumerable: false,\n    writable: true,\n    configurable: true,\n    value: function (searchElement) {\n      var O = Object(this);\n      var len = parseInt(O.length) || 0;\n      if (len === 0) {\n        return false;\n      }\n      var n = parseInt(arguments[1]) || 0;\n      var k;\n      if (n >= 0) {\n        k = n;\n      } else {\n        k = len + n;\n        if (k < 0) {\n          k = 0;\n        }\n      }\n      var currentElement;\n      while (k < len) {\n        currentElement = O[k];\n        if (searchElement === currentElement ||\n          (searchElement !== searchElement && currentElement !== currentElement)) {\n          return true;\n        }\n        k++;\n      }\n      return false;\n    }\n  });\n}\n"
  },
  {
    "path": "Libraries/polyfills/Number.es6.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Number.es6\n * @polyfill\n * @nolint\n */\n\nif (Number.EPSILON === undefined) {\n  Object.defineProperty(Number, 'EPSILON', {\n    value: Math.pow(2, -52),\n  });\n}\nif (Number.MAX_SAFE_INTEGER === undefined) {\n  Object.defineProperty(Number, 'MAX_SAFE_INTEGER', {\n    value: Math.pow(2, 53) - 1,\n  });\n}\nif (Number.MIN_SAFE_INTEGER === undefined) {\n  Object.defineProperty(Number, 'MIN_SAFE_INTEGER', {\n    value: -(Math.pow(2, 53) - 1),\n  });\n}\nif (!Number.isNaN) {\n  // https://github.com/dherman/tc39-codex-wiki/blob/master/data/es6/number/index.md#polyfill-for-numberisnan\n  const globalIsNaN = global.isNaN;\n  Object.defineProperty(Number, 'isNaN', {\n    configurable: true,\n    enumerable: false,\n    value: function isNaN(value) {\n      return typeof value === 'number' && globalIsNaN(value);\n    },\n    writable: true,\n  });\n}\n"
  },
  {
    "path": "Libraries/polyfills/Object.es6.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Object.es6\n * @polyfill\n * @nolint\n */\n\n// WARNING: This is an optimized version that fails on hasOwnProperty checks\n// and non objects. It's not spec-compliant. It's a perf optimization.\n// This is only needed for iOS 8 and current Android JSC.\n\nObject.assign = function(target, sources) {\n  if (__DEV__) {\n    if (target == null) {\n      throw new TypeError('Object.assign target cannot be null or undefined');\n    }\n    if (typeof target !== 'object' && typeof target !== 'function') {\n      throw new TypeError(\n        'In this environment the target of assign MUST be an object. ' +\n        'This error is a performance optimization and not spec compliant.'\n      );\n    }\n  }\n\n  for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {\n    var nextSource = arguments[nextIndex];\n    if (nextSource == null) {\n      continue;\n    }\n\n    if (__DEV__) {\n      if (typeof nextSource !== 'object' &&\n          typeof nextSource !== 'function') {\n        throw new TypeError(\n          'In this environment the sources for assign MUST be an object. ' +\n          'This error is a performance optimization and not spec compliant.'\n        );\n      }\n    }\n\n    // We don't currently support accessors nor proxies. Therefore this\n    // copy cannot throw. If we ever supported this then we must handle\n    // exceptions and side-effects.\n\n    for (var key in nextSource) {\n      if (__DEV__) {\n        var hasOwnProperty = Object.prototype.hasOwnProperty;\n        if (!hasOwnProperty.call(nextSource, key)) {\n          throw new TypeError(\n            'One of the sources for assign has an enumerable key on the ' +\n            'prototype chain. Are you trying to assign a prototype property? ' +\n            'We don\\'t allow it, as this is an edge case that we do not support. ' +\n            'This error is a performance optimization and not spec compliant.'\n          );\n        }\n      }\n      target[key] = nextSource[key];\n    }\n  }\n\n  return target;\n};\n"
  },
  {
    "path": "Libraries/polyfills/Object.es7.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Object.es7\n * @polyfill\n * @nolint\n */\n\n(function() {\n  'use strict';\n\n  const hasOwnProperty = Object.prototype.hasOwnProperty;\n\n  /**\n   * Returns an array of the given object's own enumerable entries.\n   * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries\n   */\n  if (typeof Object.entries !== 'function') {\n    Object.entries = function(object) {\n      // `null` and `undefined` values are not allowed.\n      if (object == null) {\n        throw new TypeError('Object.entries called on non-object');\n      }\n\n      const entries = [];\n      for (const key in object) {\n        if (hasOwnProperty.call(object, key)) {\n          entries.push([key, object[key]]);\n        }\n      }\n      return entries;\n    };\n  }\n\n  /**\n   * Returns an array of the given object's own enumerable entries.\n   * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values\n   */\n  if (typeof Object.values !== 'function') {\n    Object.values = function(object) {\n      // `null` and `undefined` values are not allowed.\n      if (object == null) {\n        throw new TypeError('Object.values called on non-object');\n      }\n\n      const values = [];\n      for (const key in object) {\n        if (hasOwnProperty.call(object, key)) {\n          values.push(object[key]);\n        }\n      }\n      return values;\n    };\n  }\n\n})();\n"
  },
  {
    "path": "Libraries/polyfills/String.prototype.es6.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule String.prototype.es6\n * @polyfill\n * @nolint\n */\n\n/* eslint-disable no-extend-native, no-bitwise */\n\n/*\n * NOTE: We use (Number(x) || 0) to replace NaN values with zero.\n */\n\nif (!String.prototype.startsWith) {\n  String.prototype.startsWith = function(search) {\n    'use strict';\n    if (this == null) {\n      throw TypeError();\n    }\n    var string = String(this);\n    var pos = arguments.length > 1 ?\n      (Number(arguments[1]) || 0) : 0;\n    var start = Math.min(Math.max(pos, 0), string.length);\n    return string.indexOf(String(search), pos) === start;\n  };\n}\n\nif (!String.prototype.endsWith) {\n  String.prototype.endsWith = function(search) {\n    'use strict';\n    if (this == null) {\n      throw TypeError();\n    }\n    var string = String(this);\n    var stringLength = string.length;\n    var searchString = String(search);\n    var pos = arguments.length > 1 ?\n      (Number(arguments[1]) || 0) : stringLength;\n    var end = Math.min(Math.max(pos, 0), stringLength);\n    var start = end - searchString.length;\n    if (start < 0) {\n      return false;\n    }\n    return string.lastIndexOf(searchString, start) === start;\n  };\n}\n\nif (!String.prototype.repeat) {\n  String.prototype.repeat = function(count) {\n    'use strict';\n    if (this == null) {\n      throw TypeError();\n    }\n    var string = String(this);\n    count = Number(count) || 0;\n    if (count < 0 || count === Infinity) {\n      throw RangeError();\n    }\n    if (count === 1) {\n      return string;\n    }\n    var result = '';\n    while (count) {\n      if (count & 1) {\n        result += string;\n      }\n      if ((count >>= 1)) {\n        string += string;\n      }\n    }\n    return result;\n  };\n}\n\nif (!String.prototype.includes) {\n  String.prototype.includes = function(search, start) {\n    'use strict';\n    if (typeof start !== 'number') {\n      start = 0;\n    }\n\n    if (start + search.length > this.length) {\n      return false;\n    } else {\n      return this.indexOf(search, start) !== -1;\n    }\n  };\n}\n\nif (!String.prototype.codePointAt) {\n  String.prototype.codePointAt = function(position) {\n    if (this == null) {\n      throw TypeError();\n    }\n    var string = String(this);\n    var size = string.length;\n    // `ToInteger`\n    var index = position ? Number(position) : 0;\n    if (Number.isNaN(index)) {\n      index = 0;\n    }\n    // Account for out-of-bounds indices:\n    if (index < 0 || index >= size) {\n      return undefined;\n    }\n    // Get the first code unit\n    var first = string.charCodeAt(index);\n    var second;\n    if (\n      // check if it’s the start of a surrogate pair\n      first >= 0xd800 &&\n      first <= 0xdbff && // high surrogate\n      size > index + 1 // there is a next code unit\n    ) {\n      second = string.charCodeAt(index + 1);\n      if (second >= 0xdc00 && second <= 0xdfff) {\n        // low surrogate\n        // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n        return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000;\n      }\n    }\n    return first;\n  };\n}\n"
  },
  {
    "path": "Libraries/polyfills/__tests__/Object.es7-test.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+jsinfra\n */\n\n'use strict';\n\ndescribe('Object (ES7)', () => {\n  beforeEach(() => {\n    delete Object.entries;\n    delete Object.values;\n    jest.resetModules();\n    require('../Object.es7');\n  });\n\n  describe('Object.entries', () => {\n    it('should have a length of 1', () => {\n      expect(Object.entries.length).toBe(1);\n    });\n\n    it('should check for type', () => {\n      expect(Object.entries.bind(null, null)).toThrow(TypeError(\n        'Object.entries called on non-object'\n      ));\n      expect(Object.entries.bind(null, undefined)).toThrow(TypeError(\n        'Object.entries called on non-object'\n      ));\n      expect(Object.entries.bind(null, [])).not.toThrow();\n      expect(Object.entries.bind(null, () => {})).not.toThrow();\n      expect(Object.entries.bind(null, {})).not.toThrow();\n      expect(Object.entries.bind(null, 'abc')).not.toThrow();\n    });\n\n    it('should return enumerable entries', () => {\n      const foo = Object.defineProperties({}, {\n        x: {value: 10, enumerable: true},\n        y: {value: 20},\n      });\n\n      expect(Object.entries(foo)).toEqual([['x', 10]]);\n\n      const bar = {x: 10, y: 20};\n      expect(Object.entries(bar)).toEqual([['x', 10], ['y', 20]]);\n    });\n\n    it('should work with proto-less objects', () => {\n      const foo = Object.create(null, {\n        x: {value: 10, enumerable: true},\n        y: {value: 20},\n      });\n\n      expect(Object.entries(foo)).toEqual([['x', 10]]);\n    });\n\n    it('should return only own entries', () => {\n      const foo = Object.create({z: 30}, {\n        x: {value: 10, enumerable: true},\n        y: {value: 20},\n      });\n\n      expect(Object.entries(foo)).toEqual([['x', 10]]);\n    });\n\n    it('should convert to object primitive string', () => {\n      expect(Object.entries('ab')).toEqual([['0', 'a'], ['1', 'b']]);\n    });\n  });\n\n  describe('Object.values', () => {\n    it('should have a length of 1', () => {\n      expect(Object.values.length).toBe(1);\n    });\n\n    it('should check for type', () => {\n      expect(Object.values.bind(null, null)).toThrow(TypeError(\n        'Object.values called on non-object'\n      ));\n      expect(Object.values.bind(null, [])).not.toThrow();\n      expect(Object.values.bind(null, () => {})).not.toThrow();\n      expect(Object.values.bind(null, {})).not.toThrow();\n    });\n\n    it('should return enumerable values', () => {\n      const foo = Object.defineProperties({}, {\n        x: {value: 10, enumerable: true},\n        y: {value: 20},\n      });\n\n      expect(Object.values(foo)).toEqual([10]);\n\n      const bar = {x: 10, y: 20};\n      expect(Object.values(bar)).toEqual([10, 20]);\n    });\n\n    it('should work with proto-less objects', () => {\n      const foo = Object.create(null, {\n        x: {value: 10, enumerable: true},\n        y: {value: 20},\n      });\n\n      expect(Object.values(foo)).toEqual([10]);\n    });\n\n    it('should return only own values', () => {\n      const foo = Object.create({z: 30}, {\n        x: {value: 10, enumerable: true},\n        y: {value: 20},\n      });\n\n      expect(Object.values(foo)).toEqual([10]);\n    });\n\n    it('should convert to object primitive string', () => {\n      expect(Object.values('ab')).toEqual(['a', 'b']);\n    });\n  });\n});\n"
  },
  {
    "path": "Libraries/polyfills/babelHelpers.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule babelHelpers\n * @polyfill\n * @nolint\n */\n\n/* eslint-disable quotes, curly, no-proto, no-undef-init, dot-notation */\n\n// Created by running:\n// require('babel-core').buildExternalHelpers('_extends classCallCheck createClass createRawReactElement defineProperty get inherits  interopRequireDefault interopRequireWildcard objectWithoutProperties possibleConstructorReturn slicedToArray taggedTemplateLiteral toArray toConsumableArray '.split(' '))\n// then replacing the `global` reference in the last line to also use `this`.\n//\n// actually, that's a lie, because babel6 omits _extends and createRawReactElement\n\nvar babelHelpers = global.babelHelpers = {};\n\nbabelHelpers.typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n  return typeof obj;\n} : function (obj) {\n  return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nbabelHelpers.createRawReactElement = (function () {\n  var REACT_ELEMENT_TYPE = typeof Symbol === \"function\" && Symbol.for && Symbol.for(\"react.element\") || 0xeac7;\n  return function createRawReactElement(type, key, props) {\n    return {\n      $$typeof: REACT_ELEMENT_TYPE,\n      type: type,\n      key: key,\n      ref: null,\n      props: props,\n      _owner: null\n    };\n  };\n})();\n\nbabelHelpers.classCallCheck = function (instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n};\n\nbabelHelpers.createClass = (function () {\n  function defineProperties(target, props) {\n    for (var i = 0; i < props.length; i++) {\n      var descriptor = props[i];\n      descriptor.enumerable = descriptor.enumerable || false;\n      descriptor.configurable = true;\n      if (\"value\" in descriptor) descriptor.writable = true;\n      Object.defineProperty(target, descriptor.key, descriptor);\n    }\n  }\n\n  return function (Constructor, protoProps, staticProps) {\n    if (protoProps) defineProperties(Constructor.prototype, protoProps);\n    if (staticProps) defineProperties(Constructor, staticProps);\n    return Constructor;\n  };\n})();\n\nbabelHelpers.defineEnumerableProperties = function(obj, descs) {\n  for (var key in descs) {\n    var desc = descs[key];\n    desc.configurable = (desc.enumerable = true);\n    if ('value' in desc) desc.writable = true;\n    Object.defineProperty(obj, key, desc);\n  }\n  return obj;\n};\n\nbabelHelpers.defineProperty = function (obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n};\n\nbabelHelpers._extends = babelHelpers.extends = Object.assign || function (target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i];\n\n    for (var key in source) {\n      if (Object.prototype.hasOwnProperty.call(source, key)) {\n        target[key] = source[key];\n      }\n    }\n  }\n\n  return target;\n};\n\nbabelHelpers.get = function get(object, property, receiver) {\n  if (object === null) object = Function.prototype;\n  var desc = Object.getOwnPropertyDescriptor(object, property);\n\n  if (desc === undefined) {\n    var parent = Object.getPrototypeOf(object);\n\n    if (parent === null) {\n      return undefined;\n    } else {\n      return get(parent, property, receiver);\n    }\n  } else if (\"value\" in desc) {\n    return desc.value;\n  } else {\n    var getter = desc.get;\n\n    if (getter === undefined) {\n      return undefined;\n    }\n\n    return getter.call(receiver);\n  }\n};\n\nbabelHelpers.inherits = function (subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n  }\n\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      enumerable: false,\n      writable: true,\n      configurable: true\n    }\n  });\n  if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\nbabelHelpers.interopRequireDefault = function (obj) {\n  return obj && obj.__esModule ? obj : {\n    default: obj\n  };\n};\n\nbabelHelpers.interopRequireWildcard = function (obj) {\n  if (obj && obj.__esModule) {\n    return obj;\n  } else {\n    var newObj = {};\n\n    if (obj != null) {\n      for (var key in obj) {\n        if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n      }\n    }\n\n    newObj.default = obj;\n    return newObj;\n  }\n};\n\nbabelHelpers.objectWithoutProperties = function (obj, keys) {\n  var target = {};\n\n  for (var i in obj) {\n    if (keys.indexOf(i) >= 0) continue;\n    if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n    target[i] = obj[i];\n  }\n\n  return target;\n};\n\nbabelHelpers.possibleConstructorReturn = function (self, call) {\n  if (!self) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n\n  return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\nbabelHelpers.slicedToArray = (function () {\n  function sliceIterator(arr, i) {\n    var _arr = [];\n    var _n = true;\n    var _d = false;\n    var _e = undefined;\n\n    try {\n      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n        _arr.push(_s.value);\n\n        if (i && _arr.length === i) break;\n      }\n    } catch (err) {\n      _d = true;\n      _e = err;\n    } finally {\n      try {\n        if (!_n && _i[\"return\"]) _i[\"return\"]();\n      } finally {\n        if (_d) throw _e;\n      }\n    }\n\n    return _arr;\n  }\n\n  return function (arr, i) {\n    if (Array.isArray(arr)) {\n      return arr;\n    } else if (Symbol.iterator in Object(arr)) {\n      return sliceIterator(arr, i);\n    } else {\n      throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n    }\n  };\n})();\n\nbabelHelpers.taggedTemplateLiteral = function (strings, raw) {\n  return Object.freeze(Object.defineProperties(strings, {\n    raw: {\n      value: Object.freeze(raw)\n    }\n  }));\n};\n\nbabelHelpers.toArray = function (arr) {\n  return Array.isArray(arr) ? arr : Array.from(arr);\n};\n\nbabelHelpers.toConsumableArray = function (arr) {\n  if (Array.isArray(arr)) {\n    for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n    return arr2;\n  } else {\n    return Array.from(arr);\n  }\n};\n"
  },
  {
    "path": "Libraries/polyfills/console.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule console\n * @polyfill\n * @nolint\n * @format\n */\n\n/* eslint-disable no-shadow, eqeqeq, curly, no-unused-vars, no-void */\n\n/**\n * This pipes all of our console logging functions to native logging so that\n * JavaScript errors in required modules show up in Xcode via NSLog.\n */\nconst inspect = (function() {\n  // Copyright Joyent, Inc. and other Node contributors.\n  //\n  // Permission is hereby granted, free of charge, to any person obtaining a\n  // copy of this software and associated documentation files (the\n  // \"Software\"), to deal in the Software without restriction, including\n  // without limitation the rights to use, copy, modify, merge, publish,\n  // distribute, sublicense, and/or sell copies of the Software, and to permit\n  // persons to whom the Software is furnished to do so, subject to the\n  // following conditions:\n  //\n  // The above copyright notice and this permission notice shall be included\n  // in all copies or substantial portions of the Software.\n  //\n  // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n  // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n  // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n  // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n  // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n  // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n  // USE OR OTHER DEALINGS IN THE SOFTWARE.\n  //\n  // https://github.com/joyent/node/blob/master/lib/util.js\n\n  function inspect(obj, opts) {\n    var ctx = {\n      seen: [],\n      stylize: stylizeNoColor,\n    };\n    return formatValue(ctx, obj, opts.depth);\n  }\n\n  function stylizeNoColor(str, styleType) {\n    return str;\n  }\n\n  function arrayToHash(array) {\n    var hash = {};\n\n    array.forEach(function(val, idx) {\n      hash[val] = true;\n    });\n\n    return hash;\n  }\n\n  function formatValue(ctx, value, recurseTimes) {\n    // Primitive types cannot have properties\n    var primitive = formatPrimitive(ctx, value);\n    if (primitive) {\n      return primitive;\n    }\n\n    // Look up the keys of the object.\n    var keys = Object.keys(value);\n    var visibleKeys = arrayToHash(keys);\n\n    // IE doesn't make error fields non-enumerable\n    // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n    if (\n      isError(value) &&\n      (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)\n    ) {\n      return formatError(value);\n    }\n\n    // Some type of object without properties can be shortcutted.\n    if (keys.length === 0) {\n      if (isFunction(value)) {\n        var name = value.name ? ': ' + value.name : '';\n        return ctx.stylize('[Function' + name + ']', 'special');\n      }\n      if (isRegExp(value)) {\n        return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n      }\n      if (isDate(value)) {\n        return ctx.stylize(Date.prototype.toString.call(value), 'date');\n      }\n      if (isError(value)) {\n        return formatError(value);\n      }\n    }\n\n    var base = '',\n      array = false,\n      braces = ['{', '}'];\n\n    // Make Array say that they are Array\n    if (isArray(value)) {\n      array = true;\n      braces = ['[', ']'];\n    }\n\n    // Make functions say that they are functions\n    if (isFunction(value)) {\n      var n = value.name ? ': ' + value.name : '';\n      base = ' [Function' + n + ']';\n    }\n\n    // Make RegExps say that they are RegExps\n    if (isRegExp(value)) {\n      base = ' ' + RegExp.prototype.toString.call(value);\n    }\n\n    // Make dates with properties first say the date\n    if (isDate(value)) {\n      base = ' ' + Date.prototype.toUTCString.call(value);\n    }\n\n    // Make error with message first say the error\n    if (isError(value)) {\n      base = ' ' + formatError(value);\n    }\n\n    if (keys.length === 0 && (!array || value.length == 0)) {\n      return braces[0] + base + braces[1];\n    }\n\n    if (recurseTimes < 0) {\n      if (isRegExp(value)) {\n        return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n      } else {\n        return ctx.stylize('[Object]', 'special');\n      }\n    }\n\n    ctx.seen.push(value);\n\n    var output;\n    if (array) {\n      output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n    } else {\n      output = keys.map(function(key) {\n        return formatProperty(\n          ctx,\n          value,\n          recurseTimes,\n          visibleKeys,\n          key,\n          array,\n        );\n      });\n    }\n\n    ctx.seen.pop();\n\n    return reduceToSingleString(output, base, braces);\n  }\n\n  function formatPrimitive(ctx, value) {\n    if (isUndefined(value)) return ctx.stylize('undefined', 'undefined');\n    if (isString(value)) {\n      var simple =\n        \"'\" +\n        JSON.stringify(value)\n          .replace(/^\"|\"$/g, '')\n          .replace(/'/g, \"\\\\'\")\n          .replace(/\\\\\"/g, '\"') +\n        \"'\";\n      return ctx.stylize(simple, 'string');\n    }\n    if (isNumber(value)) return ctx.stylize('' + value, 'number');\n    if (isBoolean(value)) return ctx.stylize('' + value, 'boolean');\n    // For some reason typeof null is \"object\", so special case here.\n    if (isNull(value)) return ctx.stylize('null', 'null');\n  }\n\n  function formatError(value) {\n    return '[' + Error.prototype.toString.call(value) + ']';\n  }\n\n  function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n    var output = [];\n    for (var i = 0, l = value.length; i < l; ++i) {\n      if (hasOwnProperty(value, String(i))) {\n        output.push(\n          formatProperty(\n            ctx,\n            value,\n            recurseTimes,\n            visibleKeys,\n            String(i),\n            true,\n          ),\n        );\n      } else {\n        output.push('');\n      }\n    }\n    keys.forEach(function(key) {\n      if (!key.match(/^\\d+$/)) {\n        output.push(\n          formatProperty(ctx, value, recurseTimes, visibleKeys, key, true),\n        );\n      }\n    });\n    return output;\n  }\n\n  function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n    var name, str, desc;\n    desc = Object.getOwnPropertyDescriptor(value, key) || {value: value[key]};\n    if (desc.get) {\n      if (desc.set) {\n        str = ctx.stylize('[Getter/Setter]', 'special');\n      } else {\n        str = ctx.stylize('[Getter]', 'special');\n      }\n    } else {\n      if (desc.set) {\n        str = ctx.stylize('[Setter]', 'special');\n      }\n    }\n    if (!hasOwnProperty(visibleKeys, key)) {\n      name = '[' + key + ']';\n    }\n    if (!str) {\n      if (ctx.seen.indexOf(desc.value) < 0) {\n        if (isNull(recurseTimes)) {\n          str = formatValue(ctx, desc.value, null);\n        } else {\n          str = formatValue(ctx, desc.value, recurseTimes - 1);\n        }\n        if (str.indexOf('\\n') > -1) {\n          if (array) {\n            str = str\n              .split('\\n')\n              .map(function(line) {\n                return '  ' + line;\n              })\n              .join('\\n')\n              .substr(2);\n          } else {\n            str =\n              '\\n' +\n              str\n                .split('\\n')\n                .map(function(line) {\n                  return '   ' + line;\n                })\n                .join('\\n');\n          }\n        }\n      } else {\n        str = ctx.stylize('[Circular]', 'special');\n      }\n    }\n    if (isUndefined(name)) {\n      if (array && key.match(/^\\d+$/)) {\n        return str;\n      }\n      name = JSON.stringify('' + key);\n      if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n        name = name.substr(1, name.length - 2);\n        name = ctx.stylize(name, 'name');\n      } else {\n        name = name\n          .replace(/'/g, \"\\\\'\")\n          .replace(/\\\\\"/g, '\"')\n          .replace(/(^\"|\"$)/g, \"'\");\n        name = ctx.stylize(name, 'string');\n      }\n    }\n\n    return name + ': ' + str;\n  }\n\n  function reduceToSingleString(output, base, braces) {\n    var numLinesEst = 0;\n    var length = output.reduce(function(prev, cur) {\n      numLinesEst++;\n      if (cur.indexOf('\\n') >= 0) numLinesEst++;\n      return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n    }, 0);\n\n    if (length > 60) {\n      return (\n        braces[0] +\n        (base === '' ? '' : base + '\\n ') +\n        ' ' +\n        output.join(',\\n  ') +\n        ' ' +\n        braces[1]\n      );\n    }\n\n    return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n  }\n\n  // NOTE: These type checking functions intentionally don't use `instanceof`\n  // because it is fragile and can be easily faked with `Object.create()`.\n  function isArray(ar) {\n    return Array.isArray(ar);\n  }\n\n  function isBoolean(arg) {\n    return typeof arg === 'boolean';\n  }\n\n  function isNull(arg) {\n    return arg === null;\n  }\n\n  function isNullOrUndefined(arg) {\n    return arg == null;\n  }\n\n  function isNumber(arg) {\n    return typeof arg === 'number';\n  }\n\n  function isString(arg) {\n    return typeof arg === 'string';\n  }\n\n  function isSymbol(arg) {\n    return typeof arg === 'symbol';\n  }\n\n  function isUndefined(arg) {\n    return arg === void 0;\n  }\n\n  function isRegExp(re) {\n    return isObject(re) && objectToString(re) === '[object RegExp]';\n  }\n\n  function isObject(arg) {\n    return typeof arg === 'object' && arg !== null;\n  }\n\n  function isDate(d) {\n    return isObject(d) && objectToString(d) === '[object Date]';\n  }\n\n  function isError(e) {\n    return (\n      isObject(e) &&\n      (objectToString(e) === '[object Error]' || e instanceof Error)\n    );\n  }\n\n  function isFunction(arg) {\n    return typeof arg === 'function';\n  }\n\n  function isPrimitive(arg) {\n    return (\n      arg === null ||\n      typeof arg === 'boolean' ||\n      typeof arg === 'number' ||\n      typeof arg === 'string' ||\n      typeof arg === 'symbol' || // ES6 symbol\n      typeof arg === 'undefined'\n    );\n  }\n\n  function objectToString(o) {\n    return Object.prototype.toString.call(o);\n  }\n\n  function hasOwnProperty(obj, prop) {\n    return Object.prototype.hasOwnProperty.call(obj, prop);\n  }\n\n  return inspect;\n})();\n\nconst OBJECT_COLUMN_NAME = '(index)';\nconst LOG_LEVELS = {\n  trace: 0,\n  info: 1,\n  warn: 2,\n  error: 3,\n};\nconst INSPECTOR_LEVELS = [];\nINSPECTOR_LEVELS[LOG_LEVELS.trace] = 'debug';\nINSPECTOR_LEVELS[LOG_LEVELS.info] = 'log';\nINSPECTOR_LEVELS[LOG_LEVELS.warn] = 'warning';\nINSPECTOR_LEVELS[LOG_LEVELS.error] = 'error';\n\n// Strip the inner function in getNativeLogFunction(), if in dev also\n// strip method printing to originalConsole.\nconst INSPECTOR_FRAMES_TO_SKIP = __DEV__ ? 2 : 1;\n\nif (global.nativeLoggingHook) {\n  function getNativeLogFunction(level) {\n    return function() {\n      let str;\n      if (arguments.length === 1 && typeof arguments[0] === 'string') {\n        str = arguments[0];\n      } else {\n        str = Array.prototype.map\n          .call(arguments, function(arg) {\n            return inspect(arg, {depth: 10});\n          })\n          .join(', ');\n      }\n\n      let logLevel = level;\n      if (str.slice(0, 9) === 'Warning: ' && logLevel >= LOG_LEVELS.error) {\n        // React warnings use console.error so that a stack trace is shown,\n        // but we don't (currently) want these to show a redbox\n        // (Note: Logic duplicated in ExceptionsManager.js.)\n        logLevel = LOG_LEVELS.warn;\n      }\n      if (global.__inspectorLog) {\n        global.__inspectorLog(\n          INSPECTOR_LEVELS[logLevel],\n          str,\n          [].slice.call(arguments),\n          INSPECTOR_FRAMES_TO_SKIP,\n        );\n      }\n      global.nativeLoggingHook(str, logLevel);\n    };\n  }\n\n  function repeat(element, n) {\n    return Array.apply(null, Array(n)).map(function() {\n      return element;\n    });\n  }\n\n  function consoleTablePolyfill(rows) {\n    // convert object -> array\n    if (!Array.isArray(rows)) {\n      var data = rows;\n      rows = [];\n      for (var key in data) {\n        if (data.hasOwnProperty(key)) {\n          var row = data[key];\n          row[OBJECT_COLUMN_NAME] = key;\n          rows.push(row);\n        }\n      }\n    }\n    if (rows.length === 0) {\n      global.nativeLoggingHook('', LOG_LEVELS.info);\n      return;\n    }\n\n    var columns = Object.keys(rows[0]).sort();\n    var stringRows = [];\n    var columnWidths = [];\n\n    // Convert each cell to a string. Also\n    // figure out max cell width for each column\n    columns.forEach(function(k, i) {\n      columnWidths[i] = k.length;\n      for (var j = 0; j < rows.length; j++) {\n        var cellStr = (rows[j][k] || '?').toString();\n        stringRows[j] = stringRows[j] || [];\n        stringRows[j][i] = cellStr;\n        columnWidths[i] = Math.max(columnWidths[i], cellStr.length);\n      }\n    });\n\n    // Join all elements in the row into a single string with | separators\n    // (appends extra spaces to each cell to make separators  | alligned)\n    function joinRow(row, space) {\n      var cells = row.map(function(cell, i) {\n        var extraSpaces = repeat(' ', columnWidths[i] - cell.length).join('');\n        return cell + extraSpaces;\n      });\n      space = space || ' ';\n      return cells.join(space + '|' + space);\n    }\n\n    var separators = columnWidths.map(function(columnWidth) {\n      return repeat('-', columnWidth).join('');\n    });\n    var separatorRow = joinRow(separators, '-');\n    var header = joinRow(columns);\n    var table = [header, separatorRow];\n\n    for (var i = 0; i < rows.length; i++) {\n      table.push(joinRow(stringRows[i]));\n    }\n\n    // Notice extra empty line at the beginning.\n    // Native logging hook adds \"RCTLog >\" at the front of every\n    // logged string, which would shift the header and screw up\n    // the table\n    global.nativeLoggingHook('\\n' + table.join('\\n'), LOG_LEVELS.info);\n  }\n\n  const originalConsole = global.console;\n  global.console = {\n    error: getNativeLogFunction(LOG_LEVELS.error),\n    info: getNativeLogFunction(LOG_LEVELS.info),\n    log: getNativeLogFunction(LOG_LEVELS.info),\n    warn: getNativeLogFunction(LOG_LEVELS.warn),\n    trace: getNativeLogFunction(LOG_LEVELS.trace),\n    debug: getNativeLogFunction(LOG_LEVELS.trace),\n    table: consoleTablePolyfill,\n  };\n\n  // If available, also call the original `console` method since that is\n  // sometimes useful. Ex: on OS X, this will let you see rich output in\n  // the Safari Web Inspector console.\n  if (__DEV__ && originalConsole) {\n    // Preserve the original `console` as `originalConsole`\n    const descriptor = Object.getOwnPropertyDescriptor(global, 'console');\n    if (descriptor) {\n      Object.defineProperty(global, 'originalConsole', descriptor);\n    }\n\n    Object.keys(console).forEach(methodName => {\n      const reactNativeMethod = console[methodName];\n      if (originalConsole[methodName]) {\n        console[methodName] = function() {\n          originalConsole[methodName](...arguments);\n          reactNativeMethod.apply(console, arguments);\n        };\n      }\n    });\n  }\n} else if (!global.console) {\n  const log = global.print || function consoleLoggingStub() {};\n  global.console = {\n    error: log,\n    info: log,\n    log: log,\n    warn: log,\n    trace: log,\n    debug: log,\n    table: log,\n  };\n}\n"
  },
  {
    "path": "Libraries/polyfills/error-guard.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule error-guard\n * @polyfill\n * @nolint\n */\n\nlet _inGuard = 0;\n\n/**\n * This is the error handler that is called when we encounter an exception\n * when loading a module. This will report any errors encountered before\n * ExceptionsManager is configured.\n */\nlet _globalHandler = function onError(e) {\n  throw e;\n};\n\n/**\n * The particular require runtime that we are using looks for a global\n * `ErrorUtils` object and if it exists, then it requires modules with the\n * error handler specified via ErrorUtils.setGlobalHandler by calling the\n * require function with applyWithGuard. Since the require module is loaded\n * before any of the modules, this ErrorUtils must be defined (and the handler\n * set) globally before requiring anything.\n */\nconst ErrorUtils = {\n  setGlobalHandler(fun) {\n    _globalHandler = fun;\n  },\n  getGlobalHandler() {\n    return _globalHandler;\n  },\n  reportError(error) {\n    _globalHandler && _globalHandler(error);\n  },\n  reportFatalError(error) {\n    _globalHandler && _globalHandler(error, true);\n  },\n  applyWithGuard(fun, context, args) {\n    try {\n      _inGuard++;\n      return fun.apply(context, args);\n    } catch (e) {\n      ErrorUtils.reportError(e);\n    } finally {\n      _inGuard--;\n    }\n    return null;\n  },\n  applyWithGuardIfNeeded(fun, context, args) {\n    if (ErrorUtils.inGuard()) {\n      return fun.apply(context, args);\n    } else {\n      ErrorUtils.applyWithGuard(fun, context, args);\n    }\n    return null;\n  },\n  inGuard() {\n    return _inGuard;\n  },\n  guard(fun, name, context) {\n    if (typeof fun !== 'function') {\n      console.warn('A function must be passed to ErrorUtils.guard, got ', fun);\n      return null;\n    }\n    name = name || fun.name || '<generated guard>';\n    function guarded() {\n      return (\n        ErrorUtils.applyWithGuard(\n          fun,\n          context || this,\n          arguments,\n          null,\n          name\n        )\n      );\n    }\n\n    return guarded;\n  },\n};\n\nglobal.ErrorUtils = ErrorUtils;\n"
  },
  {
    "path": "Libraries/promiseRejectionIsError.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule promiseRejectionIsError\n * @flow\n */\n'use strict';\n\nrequire('Promise'); // make sure the default rejection handler is installed\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst rejectionTracking = require('promise/setimmediate/rejection-tracking');\n\nmodule.exports = () => {\n  rejectionTracking.enable({\n    allRejections: true,\n    onUnhandled: (id, error) => {\n      console.error(error);\n    },\n    onHandled: () => {},\n  });\n};\n"
  },
  {
    "path": "Libraries/react-native/React.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule React\n */\n\n'use strict';\n\nmodule.exports = require('react');\n"
  },
  {
    "path": "Libraries/react-native/react-native-implementation.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule react-native-implementation\n * @flow\n */\n'use strict';\n\nconst invariant = require('fbjs/lib/invariant');\n\n// Export React, plus some native additions.\nconst ReactNative = {\n  // Components\n  get Appearance() { return require('Appearance'); },\n  get AccessibilityInfo() { return require('AccessibilityInfo'); },\n  get ActivityIndicator() { return require('ActivityIndicator'); },\n  get ART() { return require('ReactNativeART'); },\n  get Button() { return require('Button'); },\n  get CheckBox() { return require('CheckBox'); },\n  get Cursor() { return require('Cursor'); },\n  get DatePickerIOS() { return require('DatePickerIOS'); },\n  get DrawerLayoutAndroid() { return require('DrawerLayoutAndroid'); },\n  get FlatList() { return require('FlatList'); },\n  get Image() { return require('Image'); },\n  get ImageBackground() { return require('ImageBackground'); },\n  get ImageEditor() { return require('ImageEditor'); },\n  get ImageStore() { return require('ImageStore'); },\n  get KeyboardAvoidingView() { return require('KeyboardAvoidingView'); },\n  get ListView() { return require('ListView'); },\n  get MaskedViewIOS() { return require('MaskedViewIOS'); },\n  get Modal() { return require('Modal'); },\n  get NavigatorIOS() { return require('NavigatorIOS'); },\n  get Picker() { return require('Picker'); },\n  get PickerIOS() { return require('PickerIOS'); },\n  get ProgressBarAndroid() { return require('ProgressBarAndroid'); },\n  get ProgressViewIOS() { return require('ProgressViewIOS'); },\n  get SafeAreaView() { return require('SafeAreaView'); },\n  get ScrollView() { return require('ScrollView'); },\n  get SectionList() { return require('SectionList'); },\n  get SegmentedControlIOS() { return require('SegmentedControlIOS'); },\n  get Slider() { return require('Slider'); },\n  get SnapshotViewIOS() { return require('SnapshotViewIOS'); },\n  get Switch() { return require('Switch'); },\n  get RefreshControl() { return require('RefreshControl'); },\n  get StatusBar() { return require('StatusBar'); },\n  get SwipeableFlatList() { return require('SwipeableFlatList'); },\n  get SwipeableListView() { return require('SwipeableListView'); },\n  get TabBarIOS() { return require('TabBarIOS'); },\n  get Text() { return require('Text'); },\n  get TextInput() { return require('TextInput'); },\n  get Touchable() { return require('Touchable'); },\n  get TouchableHighlight() { return require('TouchableHighlight'); },\n  get TouchableNativeFeedback() { return require('TouchableNativeFeedback'); },\n  get TouchableOpacity() { return require('TouchableOpacity'); },\n  get TouchableWithoutFeedback() { return require('TouchableWithoutFeedback'); },\n  get View() { return require('View'); },\n  get ViewPagerAndroid() { return require('ViewPagerAndroid'); },\n  get VirtualizedList() { return require('VirtualizedList'); },\n  get WebView() { return require('WebView'); },\n\n  // APIs\n  get ActionSheetIOS() { return require('ActionSheetIOS'); },\n  get Alert() { return require('Alert'); },\n  get AlertIOS() { return require('AlertIOS'); },\n  get Animated() { return require('Animated'); },\n  get AppRegistry() { return require('AppRegistry'); },\n  get AppState() { return require('AppState'); },\n  get AsyncStorage() { return require('AsyncStorage'); },\n  get BackAndroid() { return require('BackAndroid'); }, // deprecated: use BackHandler instead\n  get BackHandler() { return require('BackHandler'); },\n  get CameraRoll() { return require('CameraRoll'); },\n  get Clipboard() { return require('Clipboard'); },\n  get DatePickerAndroid() { return require('DatePickerAndroid'); },\n  get DeviceInfo() { return require('DeviceInfo'); },\n  get Dimensions() { return require('Dimensions'); },\n  get Easing() { return require('Easing'); },\n  get findNodeHandle() { return require('ReactNative').findNodeHandle; },\n  get I18nManager() { return require('I18nManager'); },\n  get ImagePickerIOS() { return require('ImagePickerIOS'); },\n  get InteractionManager() { return require('InteractionManager'); },\n  get Keyboard() { return require('Keyboard'); },\n  get LayoutAnimation() { return require('LayoutAnimation'); },\n  get Linking() { return require('Linking'); },\n  get NativeEventEmitter() { return require('NativeEventEmitter'); },\n  get NetInfo() { return require('NetInfo'); },\n  get MenuManager() { return require('MenuManager'); },\n  get PanResponder() { return require('PanResponder'); },\n  get PermissionsAndroid() { return require('PermissionsAndroid'); },\n  get PixelRatio() { return require('PixelRatio'); },\n  get PushNotificationIOS() { return require('PushNotificationIOS'); },\n  get Settings() { return require('Settings'); },\n  get Share() { return require('Share'); },\n  get StatusBarIOS() { return require('StatusBarIOS'); },\n  get StyleSheet() { return require('StyleSheet'); },\n  get Systrace() { return require('Systrace'); },\n  get TimePickerAndroid() { return require('TimePickerAndroid'); },\n  get TVEventHandler() { return require('TVEventHandler'); },\n  get UIManager() { return require('UIManager'); },\n  get unstable_batchedUpdates() { return require('ReactNative').unstable_batchedUpdates; },\n  get Vibration() { return require('Vibration'); },\n  get VibrationIOS() { return require('VibrationIOS'); },\n  get YellowBox() { return require('YellowBox'); },\n\n  // Plugins\n  get DeviceEventEmitter() { return require('RCTDeviceEventEmitter'); },\n  get NativeAppEventEmitter() { return require('RCTNativeAppEventEmitter'); },\n  get NativeModules() { return require('NativeModules'); },\n  get Platform() { return require('Platform'); },\n  get processColor() { return require('processColor'); },\n  get requireNativeComponent() { return require('requireNativeComponent'); },\n  get takeSnapshot() { return require('takeSnapshot'); },\n\n  // Prop Types\n  get ColorPropType() { return require('ColorPropType'); },\n  get EdgeInsetsPropType() { return require('EdgeInsetsPropType'); },\n  get PointPropType() { return require('PointPropType'); },\n  get ViewPropTypes() { return require('ViewPropTypes'); },\n\n  // Deprecated\n  get Navigator() {\n    invariant(\n      false,\n      'Navigator is deprecated and has been removed from this package. It can now be installed ' +\n      'and imported from `react-native-deprecated-custom-components` instead of `react-native`. ' +\n      'Learn about alternative navigation solutions at http://facebook.github.io/react-native/docs/navigation.html'\n    );\n  },\n};\n\nmodule.exports = ReactNative;\n"
  },
  {
    "path": "Libraries/react-native/react-native-interface.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule react-native-interface\n */\n'use strict';\n\n// see also react-native.js\n\ndeclare var __DEV__: boolean;\n\ndeclare var __REACT_DEVTOOLS_GLOBAL_HOOK__: any; /*?{\n  inject: ?((stuff: Object) => void)\n};*/\n\ndeclare var fetch: any;\ndeclare var Headers: any;\ndeclare var Request: any;\ndeclare var Response: any;\ndeclare module requestAnimationFrame {\n  declare module.exports: (callback: any) => any;\n}\n"
  },
  {
    "path": "Libraries/vendor/core/ErrorUtils.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ErrorUtils\n * @flow\n */\n\n/* eslint-disable strict */\n\n/**\n * The particular require runtime that we are using looks for a global\n * `ErrorUtils` object and if it exists, then it requires modules with the\n * error handler specified via ErrorUtils.setGlobalHandler by calling the\n * require function with applyWithGuard. Since the require module is loaded\n * before any of the modules, this ErrorUtils must be defined (and the handler\n * set) globally before requiring anything.\n *\n * However, we still want to treat ErrorUtils as a module so that other modules\n * that use it aren't just using a global variable, so simply export the global\n * variable here. ErrorUtils is originally defined in a file named error-guard.js.\n */\nmodule.exports = global.ErrorUtils;\n"
  },
  {
    "path": "Libraries/vendor/core/Map.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Map\n * @preventMunge\n * @typechecks\n */\n\n/* eslint-disable no-extend-native, no-shadow-restricted-names */\n\n'use strict';\n\nvar _shouldPolyfillES6Collection = require('_shouldPolyfillES6Collection');\nvar guid = require('guid');\nvar isNode = require('fbjs/lib/isNode');\nvar toIterator = require('toIterator');\n\nmodule.exports = (function(global, undefined) {\n  // Since our implementation is spec-compliant for the most part we can safely\n  // delegate to a built-in version if exists and is implemented correctly.\n  // Firefox had gotten a few implementation details wrong across different\n  // versions so we guard against that.\n  if (!_shouldPolyfillES6Collection('Map')) {\n    return global.Map;\n  }\n\n  /**\n   * == ES6 Map Collection ==\n   *\n   * This module is meant to implement a Map collection as described in chapter\n   * 23.1 of the ES6 specification.\n   *\n   * Map objects are collections of key/value pairs where both the keys and\n   * values may be arbitrary ECMAScript language values. A distinct key value\n   * may only occur in one key/value pair within the Map's collection.\n   *\n   * https://people.mozilla.org/~jorendorff/es6-draft.html#sec-map-objects\n   *\n   * There only two -- rather small -- diviations from the spec:\n   *\n   * 1. The use of frozen objects as keys.\n   *    We decided not to allow and simply throw an error. The reason being is\n   *    we store a \"hash\" on the object for fast access to it's place in the\n   *    internal map entries.\n   *    If this turns out to be a popular use case it's possible to implement by\n   *    overiding `Object.freeze` to store a \"hash\" property on the object\n   *    for later use with the map.\n   *\n   * 2. The `size` property on a map object is a regular property and not a\n   *    computed property on the prototype as described by the spec.\n   *    The reason being is that we simply want to support ES3 environments\n   *    which doesn't implement computed properties.\n   *\n   * == Usage ==\n   *\n   * var map = new Map(iterable);\n   *\n   * map.set(key, value);\n   * map.get(key); // value\n   * map.has(key); // true\n   * map.delete(key); // true\n   *\n   * var iterator = map.keys();\n   * iterator.next(); // {value: key, done: false}\n   *\n   * var iterator = map.values();\n   * iterator.next(); // {value: value, done: false}\n   *\n   * var iterator = map.entries();\n   * iterator.next(); // {value: [key, value], done: false}\n   *\n   * map.forEach(function(value, key){ this === thisArg }, thisArg);\n   *\n   * map.clear(); // resets map.\n   */\n\n  /**\n   * Constants\n   */\n\n  // Kinds of map iterations 23.1.5.3\n  var KIND_KEY = 'key';\n  var KIND_VALUE = 'value';\n  var KIND_KEY_VALUE = 'key+value';\n\n  // In older browsers we can't create a null-prototype object so we have to\n  // defend against key collisions with built-in methods.\n  var KEY_PREFIX = '$map_';\n\n  // This property will be used as the internal size variable to disallow\n  // writing and to issue warnings for writings in development.\n  var SECRET_SIZE_PROP;\n  if (__DEV__) {\n    SECRET_SIZE_PROP = '$size' + guid();\n  }\n\n  // In oldIE we use the DOM Node `uniqueID` property to get create the hash.\n  var OLD_IE_HASH_PREFIX = 'IE_HASH_';\n\n  class Map {\n\n    /**\n     * 23.1.1.1\n     * Takes an `iterable` which is basically any object that implements a\n     * Symbol.iterator (@@iterator) method. The iterable is expected to be a\n     * collection of pairs. Each pair is a key/value pair that will be used\n     * to instantiate the map.\n     *\n     * @param {*} iterable\n     */\n    constructor(iterable) {\n      if (!isObject(this)) {\n        throw new TypeError('Wrong map object type.');\n      }\n\n      initMap(this);\n\n      if (iterable != null) {\n        var it = toIterator(iterable);\n        var next;\n        while (!(next = it.next()).done) {\n          if (!isObject(next.value)) {\n            throw new TypeError('Expected iterable items to be pair objects.');\n          }\n          this.set(next.value[0], next.value[1]);\n        }\n      }\n    }\n\n    /**\n     * 23.1.3.1\n     * Clears the map from all keys and values.\n     */\n    clear() {\n      initMap(this);\n    }\n\n    /**\n     * 23.1.3.7\n     * Check if a key exists in the collection.\n     *\n     * @param {*} key\n     * @return {boolean}\n     */\n    has(key) {\n      var index = getIndex(this, key);\n      return !!(index != null && this._mapData[index]);\n    }\n\n    /**\n     * 23.1.3.9\n     * Adds a key/value pair to the collection.\n     *\n     * @param {*} key\n     * @param {*} value\n     * @return {map}\n     */\n    set(key, value) {\n      var index = getIndex(this, key);\n\n      if (index != null && this._mapData[index]) {\n        this._mapData[index][1] = value;\n      } else {\n        index = this._mapData.push([\n          key,\n          value\n        ]) - 1;\n        setIndex(this, key, index);\n        if (__DEV__) {\n          this[SECRET_SIZE_PROP] += 1;\n        } else {\n          this.size += 1;\n        }\n      }\n\n      return this;\n    }\n\n    /**\n     * 23.1.3.6\n     * Gets a value associated with a key in the collection.\n     *\n     * @param {*} key\n     * @return {*}\n     */\n    get(key) {\n      var index = getIndex(this, key);\n      if (index == null) {\n        return undefined;\n      } else {\n        return this._mapData[index][1];\n      }\n    }\n\n\n    /**\n     * 23.1.3.3\n     * Delete a key/value from the collection.\n     *\n     * @param {*} key\n     * @return {boolean} Whether the key was found and deleted.\n     */\n    delete(key) {\n      var index = getIndex(this, key);\n      if (index != null && this._mapData[index]) {\n        setIndex(this, key, undefined);\n        this._mapData[index] = undefined;\n        if (__DEV__) {\n          this[SECRET_SIZE_PROP] -= 1;\n        } else {\n          this.size -= 1;\n        }\n        return true;\n      } else {\n        return false;\n      }\n    }\n\n    /**\n     * 23.1.3.4\n     * Returns an iterator over the key/value pairs (in the form of an Array) in\n     * the collection.\n     *\n     * @return {MapIterator}\n     */\n    entries() {\n      return new MapIterator(this, KIND_KEY_VALUE);\n    }\n\n    /**\n     * 23.1.3.8\n     * Returns an iterator over the keys in the collection.\n     *\n     * @return {MapIterator}\n     */\n    keys() {\n      return new MapIterator(this, KIND_KEY);\n    }\n\n    /**\n     * 23.1.3.11\n     * Returns an iterator over the values pairs in the collection.\n     *\n     * @return {MapIterator}\n     */\n    values() {\n      return new MapIterator(this, KIND_VALUE);\n    }\n\n    /**\n     * 23.1.3.5\n     * Iterates over the key/value pairs in the collection calling `callback`\n     * with [value, key, map]. An optional `thisArg` can be passed to set the\n     * context when `callback` is called.\n     *\n     * @param {function} callback\n     * @param {?object} thisArg\n     */\n    forEach(callback, thisArg) {\n      if (typeof callback !== 'function') {\n        throw new TypeError('Callback must be callable.');\n      }\n\n      var boundCallback = callback.bind(thisArg || undefined);\n      var mapData = this._mapData;\n\n      // Note that `mapData.length` should be computed on each iteration to\n      // support iterating over new items in the map that were added after the\n      // start of the iteration.\n      for (var i = 0; i < mapData.length; i++) {\n        var entry = mapData[i];\n        if (entry != null) {\n          boundCallback(entry[1], entry[0], this);\n        }\n      }\n    }\n  }\n\n  // 23.1.3.12\n  Map.prototype[toIterator.ITERATOR_SYMBOL] = Map.prototype.entries;\n\n  class MapIterator {\n\n    /**\n     * 23.1.5.1\n     * Create a `MapIterator` for a given `map`. While this class is private it\n     * will create objects that will be passed around publicily.\n     *\n     * @param {map} map\n     * @param {string} kind\n     */\n    constructor(map, kind) {\n      if (!(isObject(map) && map._mapData)) {\n        throw new TypeError('Object is not a map.');\n      }\n\n      if ([KIND_KEY, KIND_KEY_VALUE, KIND_VALUE].indexOf(kind) === -1) {\n        throw new Error('Invalid iteration kind.');\n      }\n\n      this._map = map;\n      this._nextIndex = 0;\n      this._kind = kind;\n    }\n\n    /**\n     * 23.1.5.2.1\n     * Get the next iteration.\n     *\n     * @return {object}\n     */\n    next() {\n      if (!this instanceof Map) {\n        throw new TypeError('Expected to be called on a MapIterator.');\n      }\n\n      var map = this._map;\n      var index = this._nextIndex;\n      var kind = this._kind;\n\n      if (map == null) {\n        return createIterResultObject(undefined, true);\n      }\n\n      var entries = map._mapData;\n\n      while (index < entries.length) {\n        var record = entries[index];\n\n        index += 1;\n        this._nextIndex = index;\n\n        if (record) {\n          if (kind === KIND_KEY) {\n            return createIterResultObject(record[0], false);\n          } else if (kind === KIND_VALUE) {\n            return createIterResultObject(record[1], false);\n          } else if (kind) {\n            return createIterResultObject(record, false);\n          }\n        }\n      }\n\n      this._map = undefined;\n\n      return createIterResultObject(undefined, true);\n    }\n  }\n\n  // We can put this in the class definition once we have computed props\n  // transform.\n  // 23.1.5.2.2\n  MapIterator.prototype[toIterator.ITERATOR_SYMBOL] = function() {\n    return this;\n  };\n\n  /**\n   * Helper Functions.\n   */\n\n  /**\n   * Return an index to map.[[MapData]] array for a given Key.\n   *\n   * @param {map} map\n   * @param {*} key\n   * @return {?number}\n   */\n  function getIndex(map, key) {\n    if (isObject(key)) {\n      var hash = getHash(key);\n      return map._objectIndex[hash];\n    } else {\n      var prefixedKey = KEY_PREFIX + key;\n      if (typeof key === 'string') {\n        return map._stringIndex[prefixedKey];\n      } else {\n        return map._otherIndex[prefixedKey];\n      }\n    }\n  }\n\n  /**\n   * Setup an index that refer to the key's location in map.[[MapData]].\n   *\n   * @param {map} map\n   * @param {*} key\n   */\n  function setIndex(map, key, index) {\n    var shouldDelete = index == null;\n\n    if (isObject(key)) {\n      var hash = getHash(key);\n      if (shouldDelete) {\n        delete map._objectIndex[hash];\n      } else {\n        map._objectIndex[hash] = index;\n      }\n    } else {\n      var prefixedKey = KEY_PREFIX + key;\n      if (typeof key === 'string') {\n        if (shouldDelete) {\n          delete map._stringIndex[prefixedKey];\n        } else {\n          map._stringIndex[prefixedKey] = index;\n        }\n      } else {\n        if (shouldDelete) {\n          delete map._otherIndex[prefixedKey];\n        } else {\n          map._otherIndex[prefixedKey] = index;\n        }\n      }\n    }\n  }\n\n  /**\n   * Instantiate a map with internal slots.\n   *\n   * @param {map} map\n   */\n  function initMap(map) {\n    // Data structure design inspired by Traceur's Map implementation.\n    // We maintain an internal array for all the entries. The array is needed\n    // to remember order. However, to have a reasonable HashMap performance\n    // i.e. O(1) for insertion, deletion, and retrieval. We maintain indices\n    // in objects for fast look ups. Indices are split up according to data\n    // types to avoid collisions.\n    map._mapData = [];\n\n    // Object index maps from an object \"hash\" to index. The hash being a unique\n    // property of our choosing that we associate with the object. Association\n    // is done by ways of keeping a non-enumerable property on the object.\n    // Ideally these would be `Object.create(null)` objects but since we're\n    // trying to support ES3 we'll have to gaurd against collisions using\n    // prefixes on the keys rather than rely on null prototype objects.\n    map._objectIndex = {};\n\n    // String index maps from strings to index.\n    map._stringIndex = {};\n\n    // Numbers, booleans, undefined, and null.\n    map._otherIndex = {};\n\n    // Unfortunately we have to support ES3 and cannot have `Map.prototype.size`\n    // be a getter method but just a regular method. The biggest problem with\n    // this is safety. Clients can change the size property easily and possibly\n    // without noticing (e.g. `if (map.size = 1) {..}` kind of typo). What we\n    // can do to mitigate use getters and setters in development to disallow\n    // and issue a warning for changing the `size` property.\n    if (__DEV__) {\n      if (isES5) {\n        // If the `SECRET_SIZE_PROP` property is already defined then we're not\n        // in the first call to `initMap` (e.g. coming from `map.clear()`) so\n        // all we need to do is reset the size without defining the properties.\n        if (map.hasOwnProperty(SECRET_SIZE_PROP)) {\n          map[SECRET_SIZE_PROP] = 0;\n        } else {\n          Object.defineProperty(map, SECRET_SIZE_PROP, {\n            value: 0,\n            writable: true\n          });\n          Object.defineProperty(map, 'size', {\n            set: (v) => {\n              console.error(\n                'PLEASE FIX ME: You are changing the map size property which ' +\n                'should not be writable and will break in production.'\n              );\n              throw new Error('The map size property is not writable.');\n            },\n            get: () => map[SECRET_SIZE_PROP]\n          });\n        }\n\n        // NOTE: Early return to implement immutable `.size` in DEV.\n        return;\n      }\n    }\n\n    // This is a diviation from the spec. `size` should be a getter on\n    // `Map.prototype`. However, we have to support IE8.\n    map.size = 0;\n  }\n\n  /**\n   * Check if something is an object.\n   *\n   * @param {*} o\n   * @return {boolean}\n   */\n  function isObject(o) {\n    return o != null && (typeof o === 'object' || typeof o === 'function');\n  }\n\n  /**\n   * Create an iteration object.\n   *\n   * @param {*} value\n   * @param {boolean} done\n   * @return {object}\n   */\n  function createIterResultObject(value, done) {\n    return {value, done};\n  }\n\n  // Are we in a legit ES5 environment. Spoiler alert: that doesn't include IE8.\n  var isES5 = (function() {\n    try {\n      Object.defineProperty({}, 'x', {});\n      return true;\n    } catch (e) {\n      return false;\n    }\n  })();\n\n  /**\n   * Check if an object can be extended.\n   *\n   * @param {object|array|function|regexp} o\n   * @return {boolean}\n   */\n  function isExtensible(o) {\n    if (!isES5) {\n      return true;\n    } else {\n      return Object.isExtensible(o);\n    }\n  }\n\n  /**\n   * IE has a `uniqueID` set on every DOM node. So we construct the hash from\n   * this uniqueID to avoid memory leaks and the IE cloneNode bug where it\n   * clones properties in addition to the attributes.\n   *\n   * @param {object} node\n   * @return {?string}\n   */\n  function getIENodeHash(node) {\n    var uniqueID;\n    switch (node.nodeType) {\n      case 1: // Element\n        uniqueID = node.uniqueID;\n        break;\n      case 9: // Document\n        uniqueID = node.documentElement.uniqueID;\n        break;\n      default:\n        return null;\n    }\n\n    if (uniqueID) {\n      return  OLD_IE_HASH_PREFIX + uniqueID;\n    } else {\n      return null;\n    }\n  }\n\n  var getHash = (function() {\n    var propIsEnumerable = Object.prototype.propertyIsEnumerable;\n    var hashProperty = guid();\n    var hashCounter = 0;\n\n    /**\n     * Get the \"hash\" associated with an object.\n     *\n     * @param {object|array|function|regexp} o\n     * @return {number}\n     */\n    return function getHash(o) { // eslint-disable-line no-shadow\n      if (o[hashProperty]) {\n        return o[hashProperty];\n      } else if (!isES5 &&\n                  o.propertyIsEnumerable &&\n                  o.propertyIsEnumerable[hashProperty]) {\n        return o.propertyIsEnumerable[hashProperty];\n      } else if (!isES5 &&\n                  isNode(o) &&\n                  getIENodeHash(o)) {\n        return getIENodeHash(o);\n      } else if (!isES5 && o[hashProperty]) {\n        return o[hashProperty];\n      }\n\n      if (isExtensible(o)) {\n        hashCounter += 1;\n        if (isES5) {\n          Object.defineProperty(o, hashProperty, {\n            enumerable: false,\n            writable: false,\n            configurable: false,\n            value: hashCounter\n          });\n        } else if (o.propertyIsEnumerable) {\n          // Since we can't define a non-enumerable property on the object\n          // we'll hijack one of the less-used non-enumerable properties to\n          // save our hash on it. Addiotionally, since this is a function it\n          // will not show up in `JSON.stringify` which is what we want.\n          o.propertyIsEnumerable = function() {\n            return propIsEnumerable.apply(this, arguments);\n          };\n          o.propertyIsEnumerable[hashProperty] = hashCounter;\n        } else if (isNode(o)) {\n          // At this point we couldn't get the IE `uniqueID` to use as a hash\n          // and we couldn't use a non-enumerable property to exploit the\n          // dontEnum bug so we simply add the `hashProperty` on the node\n          // itself.\n          o[hashProperty] = hashCounter;\n        } else {\n          throw new Error('Unable to set a non-enumerable property on object.');\n        }\n        return hashCounter;\n      } else {\n        throw new Error('Non-extensible objects are not allowed as keys.');\n      }\n    };\n  })();\n\n  return Map;\n})(Function('return this')()); // eslint-disable-line no-new-func\n"
  },
  {
    "path": "Libraries/vendor/core/Set.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Set\n * @preventMunge\n * @typechecks\n */\n\n/* eslint-disable no-extend-native */\n\n'use strict';\n\nvar Map = require('Map');\n\nvar _shouldPolyfillES6Collection = require('_shouldPolyfillES6Collection');\nvar toIterator = require('toIterator');\n\nmodule.exports = (function(global) {\n  // Since our implementation is spec-compliant for the most part we can safely\n  // delegate to a built-in version if exists and is implemented correctly.\n  // Firefox had gotten a few implementation details wrong across different\n  // versions so we guard against that.\n  // These checks are adapted from es6-shim https://fburl.com/34437854\n  if (!_shouldPolyfillES6Collection('Set')) {\n    return global.Set;\n  }\n\n  /**\n   * == ES6 Set Collection ==\n   *\n   * This module is meant to implement a Set collection as described in chapter\n   * 23.2 of the ES6 specification.\n   *\n   * Set objects are collections of unique values. Where values can be any\n   * JavaScript value.\n   * https://people.mozilla.org/~jorendorff/es6-draft.html#sec-map-objects\n   *\n   * There only two -- rather small -- diviations from the spec:\n   *\n   * 1. The use of frozen objects as keys. @see Map module for more on this.\n   *\n   * 2. The `size` property on a map object is a regular property and not a\n   *    computed property on the prototype as described by the spec.\n   *    The reason being is that we simply want to support ES3 environments\n   *    which doesn't implement computed properties.\n   *\n   * == Usage ==\n   *\n   * var set = new set(iterable);\n   *\n   * set.set(value);\n   * set.has(value); // true\n   * set.delete(value); // true\n   *\n   * var iterator = set.keys();\n   * iterator.next(); // {value: value, done: false}\n   *\n   * var iterator = set.values();\n   * iterator.next(); // {value: value, done: false}\n   *\n   * var iterator = set.entries();\n   * iterator.next(); // {value: [value, value], done: false}\n   *\n   * set.forEach(function(value, value){ this === thisArg }, thisArg);\n   *\n   * set.clear(); // resets set.\n   */\n\n  class Set {\n\n    /**\n     * 23.2.1.1\n     *\n     * Takes an optional `iterable` (which is basically any object that\n     * implements a Symbol.iterator (@@iterator) method). That is a collection\n     * of values used to instantiate the set.\n     *\n     * @param {*} iterable\n     */\n    constructor(iterable) {\n      if (this == null ||\n          (typeof this !== 'object' && typeof this !== 'function')) {\n        throw new TypeError('Wrong set object type.');\n      }\n\n      initSet(this);\n\n      if (iterable != null) {\n        var it = toIterator(iterable);\n        var next;\n        while (!(next = it.next()).done) {\n          this.add(next.value);\n        }\n      }\n    }\n\n    /**\n     * 23.2.3.1\n     *\n     * If it doesn't already exist in the collection a `value` is added.\n     *\n     * @param {*} value\n     * @return {set}\n     */\n    add(value) {\n      this._map.set(value, value);\n      this.size = this._map.size;\n      return this;\n    }\n\n    /**\n     * 23.2.3.2\n     *\n     * Clears the set.\n     */\n    clear() {\n      initSet(this);\n    }\n\n    /**\n     * 23.2.3.4\n     *\n     * Deletes a `value` from the collection if it exists.\n     * Returns true if the value was found and deleted and false otherwise.\n     *\n     * @param {*} value\n     * @return {boolean}\n     */\n    delete(value) {\n      var ret = this._map.delete(value);\n      this.size = this._map.size;\n      return ret;\n    }\n\n    /**\n     * 23.2.3.5\n     *\n     * Returns an iterator over a collection of [value, value] tuples.\n     */\n    entries() {\n      return this._map.entries();\n    }\n\n    /**\n     * 23.2.3.6\n     *\n     * Iterate over the collection calling `callback` with (value, value, set).\n     *\n     * @param {function} callback\n     */\n    forEach(callback) {\n      var thisArg = arguments[1];\n      var it = this._map.keys();\n      var next;\n      while (!(next = it.next()).done) {\n        callback.call(thisArg, next.value, next.value, this);\n      }\n    }\n\n    /**\n     * 23.2.3.7\n     *\n     * Iterate over the collection calling `callback` with (value, value, set).\n     *\n     * @param {*} value\n     * @return {boolean}\n     */\n    has(value) {\n      return this._map.has(value);\n    }\n\n    /**\n     * 23.2.3.7\n     *\n     * Returns an iterator over the colleciton of values.\n     */\n    values() {\n      return this._map.values();\n    }\n  }\n\n  // 23.2.3.11\n  Set.prototype[toIterator.ITERATOR_SYMBOL] = Set.prototype.values;\n\n  // 23.2.3.7\n  Set.prototype.keys = Set.prototype.values;\n\n  function initSet(set) {\n    set._map = new Map();\n    set.size = set._map.size;\n  }\n\n  return Set;\n})(Function('return this')()); // eslint-disable-line no-new-func\n"
  },
  {
    "path": "Libraries/vendor/core/_shouldPolyfillES6Collection.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule _shouldPolyfillES6Collection\n * @preventMunge\n * @flow\n */\n'use strict';\n\n/**\n * Checks whether a collection name (e.g. \"Map\" or \"Set\") has a native polyfill\n * that is safe to be used.\n */\nfunction _shouldActuallyPolyfillES6Collection(collectionName: string): boolean {\n  var Collection = global[collectionName];\n  if (Collection == null) {\n    return true;\n  }\n\n  // The iterator protocol depends on `Symbol.iterator`. If a collection is\n  // implemented, but `Symbol` is not, it's going to break iteration because\n  // we'll be using custom \"@@iterator\" instead, which is not implemented on\n  // native collections.\n  if (typeof global.Symbol !== 'function') {\n    return true;\n  }\n\n  var proto = Collection.prototype;\n\n  // These checks are adapted from es6-shim: https://fburl.com/34437854\n  // NOTE: `isCallableWithoutNew` and `!supportsSubclassing` are not checked\n  // because they make debugging with \"break on exceptions\" difficult.\n  return Collection == null ||\n    typeof Collection !== 'function' ||\n    typeof proto.clear !== 'function' ||\n    new Collection().size !== 0 ||\n    typeof proto.keys !== 'function' ||\n    typeof proto.forEach !== 'function';\n}\n\nconst cache: { [name: string]: bool } = {};\n\n  /**\n   * Checks whether a collection name (e.g. \"Map\" or \"Set\") has a native polyfill\n   * that is safe to be used and caches this result.\n   * Make sure to make a first call to this function before a corresponding\n   * property on global was overriden in any way.\n   */\nfunction _shouldPolyfillES6Collection(collectionName: string) {\n    let result = cache[collectionName];\n    if (result !== undefined) {\n      return result;\n    }\n\n    result = _shouldActuallyPolyfillES6Collection(collectionName);\n    cache[collectionName] = result;\n    return result;\n}\n\nmodule.exports = _shouldPolyfillES6Collection;\n"
  },
  {
    "path": "Libraries/vendor/core/getObjectValues.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getObjectValues\n * @typechecks\n */\n'use strict';\n\n/**\n * Retrieve an object's values as an array.\n *\n * If you are looking for a function that creates an Array instance based\n * on an \"Array-like\" object, use createArrayFrom instead.\n *\n * @param {object} obj An object.\n * @return {array}     The object's values.\n */\nfunction getObjectValues(obj) {\n  var values = [];\n  for (var key in obj) {\n    values.push(obj[key]);\n  }\n  return values;\n}\n\nmodule.exports = getObjectValues;\n"
  },
  {
    "path": "Libraries/vendor/core/guid.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule guid\n */\n\n/* eslint-disable no-bitwise */\n\n'use strict';\n\n/**\n * Module that provides a function for creating a unique identifier.\n * The returned value does not conform to the GUID standard, but should\n * be globally unique in the context of the browser.\n */\nfunction guid() {\n  return 'f' + (Math.random() * (1 << 30)).toString(16).replace('.', '');\n}\n\nmodule.exports = guid;\n"
  },
  {
    "path": "Libraries/vendor/core/isEmpty.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule isEmpty\n */\n'use strict';\n\n/**\n * Mimics empty from PHP.\n */\nfunction isEmpty(obj) {\n  if (Array.isArray(obj)) {\n    return obj.length === 0;\n  } else if (typeof obj === 'object') {\n    for (var i in obj) {\n      return false;\n    }\n    return true;\n  } else {\n    return !obj;\n  }\n}\n\nmodule.exports = isEmpty;\n"
  },
  {
    "path": "Libraries/vendor/core/merge.js",
    "content": "/**\n * @generated SignedSource<<0e3063b19e14ed191102b1dffe45551f>>\n *\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n * !! This file is a check-in of a static_upstream project!      !!\n * !!                                                            !!\n * !! You should not modify this file directly. Instead:         !!\n * !! 1) Use `fjs use-upstream` to temporarily replace this with !!\n * !!    the latest version from upstream.                       !!\n * !! 2) Make your changes, test them, etc.                      !!\n * !! 3) Use `fjs push-upstream` to copy your changes back to    !!\n * !!    static_upstream.                                        !!\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n *\n * Copyright 2013-2014 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule merge\n */\n\n\"use strict\";\n\nvar mergeInto = require('mergeInto');\n\n/**\n * Shallow merges two structures into a return value, without mutating either.\n *\n * @param {?object} one Optional object with properties to merge from.\n * @param {?object} two Optional object with properties to merge from.\n * @return {object} The shallow extension of one by two.\n */\nvar merge = function(one, two) {\n  var result = {};\n  mergeInto(result, one);\n  mergeInto(result, two);\n  return result;\n};\n\nmodule.exports = merge;\n"
  },
  {
    "path": "Libraries/vendor/core/mergeHelpers.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule mergeHelpers\n *\n * requiresPolyfills: Array.isArray\n */\n\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\n\n/**\n * Maximum number of levels to traverse. Will catch circular structures.\n * @const\n */\nvar MAX_MERGE_DEPTH = 36;\n\n/**\n * We won't worry about edge cases like new String('x') or new Boolean(true).\n * Functions and Dates are considered terminals, and arrays are not.\n * @param {*} o The item/object/value to test.\n * @return {boolean} true iff the argument is a terminal.\n */\nvar isTerminal = function(o) {\n  return typeof o !== 'object' || o instanceof Date || o === null;\n};\n\nvar mergeHelpers = {\n\n  MAX_MERGE_DEPTH: MAX_MERGE_DEPTH,\n\n  isTerminal: isTerminal,\n\n  /**\n   * Converts null/undefined values into empty object.\n   *\n   * @param {?Object=} arg Argument to be normalized (nullable optional)\n   * @return {!Object}\n   */\n  normalizeMergeArg: function(arg) {\n    return arg === undefined || arg === null ? {} : arg;\n  },\n\n  /**\n   * If merging Arrays, a merge strategy *must* be supplied. If not, it is\n   * likely the caller's fault. If this function is ever called with anything\n   * but `one` and `two` being `Array`s, it is the fault of the merge utilities.\n   *\n   * @param {*} one Array to merge into.\n   * @param {*} two Array to merge from.\n   */\n  checkMergeArrayArgs: function(one, two) {\n    invariant(\n      Array.isArray(one) && Array.isArray(two),\n      'Tried to merge arrays, instead got %s and %s.',\n      one,\n      two\n    );\n  },\n\n  /**\n   * @param {*} one Object to merge into.\n   * @param {*} two Object to merge from.\n   */\n  checkMergeObjectArgs: function(one, two) {\n    mergeHelpers.checkMergeObjectArg(one);\n    mergeHelpers.checkMergeObjectArg(two);\n  },\n\n  /**\n   * @param {*} arg\n   */\n  checkMergeObjectArg: function(arg) {\n    invariant(\n      !isTerminal(arg) && !Array.isArray(arg),\n      'Tried to merge an object, instead got %s.',\n      arg\n    );\n  },\n\n  /**\n   * @param {*} arg\n   */\n  checkMergeIntoObjectArg: function(arg) {\n    invariant(\n      (!isTerminal(arg) || typeof arg === 'function') && !Array.isArray(arg),\n      'Tried to merge into an object, instead got %s.',\n      arg\n    );\n  },\n\n  /**\n   * Checks that a merge was not given a circular object or an object that had\n   * too great of depth.\n   *\n   * @param {number} Level of recursion to validate against maximum.\n   */\n  checkMergeLevel: function(level) {\n    invariant(\n      level < MAX_MERGE_DEPTH,\n      'Maximum deep merge depth exceeded. You may be attempting to merge ' +\n      'circular structures in an unsupported way.'\n    );\n  },\n\n  /**\n   * Checks that the supplied merge strategy is valid.\n   *\n   * @param {string} Array merge strategy.\n   */\n  checkArrayStrategy: function(strategy) {\n    invariant(\n      strategy === undefined || strategy in mergeHelpers.ArrayStrategies,\n      'You must provide an array strategy to deep merge functions to ' +\n      'instruct the deep merge how to resolve merging two arrays.'\n    );\n  },\n\n  /**\n   * Set of possible behaviors of merge algorithms when encountering two Arrays\n   * that must be merged together.\n   * - `clobber`: The left `Array` is ignored.\n   * - `indexByIndex`: The result is achieved by recursively deep merging at\n   *   each index. (not yet supported.)\n   */\n  ArrayStrategies: {\n    Clobber: 'Clobber',\n    Concat: 'Concat',\n    IndexByIndex: 'IndexByIndex',\n  },\n\n};\n\nmodule.exports = mergeHelpers;\n"
  },
  {
    "path": "Libraries/vendor/core/mergeInto.js",
    "content": "/**\n * @generated SignedSource<<d3caa35be27b17ea4dd4c76bef72d1ab>>\n *\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n * !! This file is a check-in of a static_upstream project!      !!\n * !!                                                            !!\n * !! You should not modify this file directly. Instead:         !!\n * !! 1) Use `fjs use-upstream` to temporarily replace this with !!\n * !!    the latest version from upstream.                       !!\n * !! 2) Make your changes, test them, etc.                      !!\n * !! 3) Use `fjs push-upstream` to copy your changes back to    !!\n * !!    static_upstream.                                        !!\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n *\n * Copyright 2013-2014 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule mergeInto\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar mergeHelpers = require('mergeHelpers');\n\nvar checkMergeObjectArg = mergeHelpers.checkMergeObjectArg;\nvar checkMergeIntoObjectArg = mergeHelpers.checkMergeIntoObjectArg;\n\n/**\n * Shallow merges two structures by mutating the first parameter.\n *\n * @param {object|function} one Object to be merged into.\n * @param {?object} two Optional object with properties to merge from.\n */\nfunction mergeInto(one, two) {\n  checkMergeIntoObjectArg(one);\n  if (two != null) {\n    checkMergeObjectArg(two);\n    for (var key in two) {\n      if (!two.hasOwnProperty(key)) {\n        continue;\n      }\n      one[key] = two[key];\n    }\n  }\n}\n\nmodule.exports = mergeInto;\n"
  },
  {
    "path": "Libraries/vendor/core/toIterator.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule toIterator\n */\n'use strict';\n\n/**\n * Given an object `toIterator` will return the itrator for that object. If the\n * object has a `Symbol.iterator` method we just call that. Otherwise we\n * implement the ES6 `Array` and `String` Iterator.\n */\n\n/**\n * Constants\n */\n\nvar KIND_KEY = 'key';\nvar KIND_VALUE = 'value';\nvar KIND_KEY_VAL = 'key+value';\n/*global Symbol: true*/\nvar ITERATOR_SYMBOL = (typeof Symbol === 'function')\n    ? Symbol.iterator\n    : '@@iterator';\n\nvar toIterator = (function() {\n  if (!(Array.prototype[ITERATOR_SYMBOL] &&\n        String.prototype[ITERATOR_SYMBOL])) {\n    // IIFE to avoid creating classes for no reason because of hoisting.\n    return (function() {\n      class ArrayIterator {\n        // 22.1.5.1 CreateArrayIterator Abstract Operation\n        constructor(array, kind) {\n          if (!Array.isArray(array)) {\n            throw new TypeError('Object is not an Array');\n          }\n          this._iteratedObject = array;\n          this._kind = kind;\n          this._nextIndex = 0;\n        }\n\n        // 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n        next() {\n          if (!this instanceof ArrayIterator) {\n            throw new TypeError('Object is not an ArrayIterator');\n          }\n\n          if (this._iteratedObject == null) {\n            return createIterResultObject(undefined, true);\n          }\n\n          var array = this._iteratedObject;\n          var len = this._iteratedObject.length;\n          var index = this._nextIndex;\n          var kind = this._kind;\n\n          if (index >= len) {\n            this._iteratedObject = undefined;\n            return createIterResultObject(undefined, true);\n          }\n\n          this._nextIndex = index + 1;\n\n          if (kind === KIND_KEY) {\n            return createIterResultObject(index, false);\n          } else if (kind === KIND_VALUE) {\n            return createIterResultObject(array[index], false);\n          } else if (kind === KIND_KEY_VAL) {\n            return createIterResultObject([index, array[index]], false);\n          }\n        }\n\n        // 22.1.5.2.2 %ArrayIteratorPrototype%[@@iterator]()\n        '@@iterator'() {\n          return this;\n        }\n      }\n\n      class StringIterator {\n        // 21.1.5.1 CreateStringIterator Abstract Operation\n        constructor(string) {\n          if (typeof string !== 'string') {\n            throw new TypeError('Object is not a string');\n          }\n          this._iteratedString = string;\n          this._nextIndex = 0;\n        }\n\n        // 21.1.5.2.1 %StringIteratorPrototype%.next()\n        next() {\n          if (!this instanceof StringIterator) {\n            throw new TypeError('Object is not a StringIterator');\n          }\n\n          if (this._iteratedString == null) {\n            return createIterResultObject(undefined, true);\n          }\n\n          var index = this._nextIndex;\n          var s = this._iteratedString;\n          var len = s.length;\n\n          if (index >= len) {\n            this._iteratedString = undefined;\n            return createIterResultObject(undefined, true);\n          }\n\n          var ret;\n          var first = s.charCodeAt(index);\n\n          if (first < 0xD800 || first > 0xDBFF || index + 1 === len) {\n            ret = s[index];\n          } else {\n            var second = s.charCodeAt(index + 1);\n            if (second < 0xDC00 || second > 0xDFFF) {\n              ret = s[index];\n            } else {\n              ret = s[index] + s[index + 1];\n            }\n          }\n\n          this._nextIndex = index + ret.length;\n\n          return createIterResultObject(ret, false);\n        }\n\n        // 21.1.5.2.2 %StringIteratorPrototype%[@@ITERATOR_SYMBOL]()\n        '@@iterator'() {\n          return this;\n        }\n      }\n\n      // 7.4.7 createIterResultObject(value, done)\n      function createIterResultObject(value, done) {\n        return {value: value, done: done};\n      }\n\n      return function(object, kind) {\n        if (typeof object === 'string') {\n          return new StringIterator(object);\n        } else if (Array.isArray(object)) {\n          return new ArrayIterator(object, kind || KIND_VALUE);\n        } else {\n          return object[ITERATOR_SYMBOL]();\n        }\n      };\n    })();\n  } else {\n    return function(object) {\n      return object[ITERATOR_SYMBOL]();\n    };\n  }\n})();\n\n/**\n * Export constants\n */\n\nObject.assign(toIterator, {\n  KIND_KEY,\n  KIND_VALUE,\n  KIND_KEY_VAL,\n  ITERATOR_SYMBOL\n});\n\nmodule.exports = toIterator;\n"
  },
  {
    "path": "Libraries/vendor/document/selection/DocumentSelectionState.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DocumentSelectionState\n * @typechecks\n */\n\n'use strict';\n\nvar mixInEventEmitter = require('mixInEventEmitter');\n\n/**\n * DocumentSelectionState is responsible for maintaining selection information\n * for a document.\n *\n * It is intended for use by AbstractTextEditor-based components for\n * identifying the appropriate start/end positions to modify the\n * DocumentContent, and for programatically setting browser selection when\n * components re-render.\n */\nclass DocumentSelectionState {\n  /**\n   * @param {number} anchor\n   * @param {number} focus\n   */\n  constructor(anchor, focus) {\n    this._anchorOffset = anchor;\n    this._focusOffset = focus;\n    this._hasFocus = false;\n  }\n\n  /**\n   * Apply an update to the state. If either offset value has changed,\n   * set the values and emit the `change` event. Otherwise no-op.\n   *\n   * @param {number} anchor\n   * @param {number} focus\n   */\n  update(anchor, focus) {\n    if (this._anchorOffset !== anchor || this._focusOffset !== focus) {\n      this._anchorOffset = anchor;\n      this._focusOffset = focus;\n      this.emit('update');\n    }\n  }\n\n  /**\n   * Given a max text length, constrain our selection offsets to ensure\n   * that the selection remains strictly within the text range.\n   *\n   * @param {number} maxLength\n   */\n  constrainLength(maxLength) {\n    this.update(\n      Math.min(this._anchorOffset, maxLength),\n      Math.min(this._focusOffset, maxLength)\n    );\n  }\n\n  focus() {\n    if (!this._hasFocus) {\n      this._hasFocus = true;\n      this.emit('focus');\n    }\n  }\n\n  blur() {\n    if (this._hasFocus) {\n      this._hasFocus = false;\n      this.emit('blur');\n    }\n  }\n\n  /**\n   * @return {boolean}\n   */\n  hasFocus() {\n    return this._hasFocus;\n  }\n\n  /**\n   * @return {boolean}\n   */\n  isCollapsed() {\n    return this._anchorOffset === this._focusOffset;\n  }\n\n  /**\n   * @return {boolean}\n   */\n  isBackward() {\n    return this._anchorOffset > this._focusOffset;\n  }\n\n  /**\n   * @return {?number}\n   */\n  getAnchorOffset() {\n    return this._hasFocus ? this._anchorOffset : null;\n  }\n\n  /**\n   * @return {?number}\n   */\n  getFocusOffset() {\n    return this._hasFocus ? this._focusOffset : null;\n  }\n\n  /**\n   * @return {?number}\n   */\n  getStartOffset() {\n    return (\n      this._hasFocus ? Math.min(this._anchorOffset, this._focusOffset) : null\n    );\n  }\n\n  /**\n   * @return {?number}\n   */\n  getEndOffset() {\n    return (\n      this._hasFocus ? Math.max(this._anchorOffset, this._focusOffset) : null\n    );\n  }\n\n  /**\n   * @param {number} start\n   * @param {number} end\n   * @return {boolean}\n   */\n  overlaps(start, end) {\n    return (\n      this.hasFocus() &&\n      this.getStartOffset() <= end && start <= this.getEndOffset()\n    );\n  }\n}\n\nmixInEventEmitter(DocumentSelectionState, {\n  'blur': true,\n  'focus': true,\n  'update': true\n});\n\nmodule.exports = DocumentSelectionState;\n"
  },
  {
    "path": "Libraries/vendor/emitter/EmitterSubscription.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EmitterSubscription\n * @flow\n */\n'use strict';\n\nconst EventSubscription = require('EventSubscription');\n\nimport type EventEmitter from 'EventEmitter';\nimport type EventSubscriptionVendor from 'EventSubscriptionVendor';\n\n/**\n * EmitterSubscription represents a subscription with listener and context data.\n */\nclass EmitterSubscription extends EventSubscription {\n\n  emitter: EventEmitter;\n  listener: Function;\n  context: ?Object;\n\n  /**\n   * @param {EventEmitter} emitter - The event emitter that registered this\n   *   subscription\n   * @param {EventSubscriptionVendor} subscriber - The subscriber that controls\n   *   this subscription\n   * @param {function} listener - Function to invoke when the specified event is\n   *   emitted\n   * @param {*} context - Optional context object to use when invoking the\n   *   listener\n   */\n  constructor(\n    emitter: EventEmitter,\n    subscriber: EventSubscriptionVendor,\n    listener: Function,\n    context: ?Object\n  ) {\n    super(subscriber);\n    this.emitter = emitter;\n    this.listener = listener;\n    this.context = context;\n  }\n\n  /**\n   * Removes this subscription from the emitter that registered it.\n   * Note: we're overriding the `remove()` method of EventSubscription here\n   * but deliberately not calling `super.remove()` as the responsibility\n   * for removing the subscription lies with the EventEmitter.\n   */\n  remove() {\n    this.emitter.removeSubscription(this);\n  }\n}\n\nmodule.exports = EmitterSubscription;\n"
  },
  {
    "path": "Libraries/vendor/emitter/EventEmitter.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EventEmitter\n * @noflow\n * @typecheck\n */\n'use strict';\n\nconst EmitterSubscription = require('EmitterSubscription');\nconst EventSubscriptionVendor = require('EventSubscriptionVendor');\n\nconst emptyFunction = require('fbjs/lib/emptyFunction');\nconst invariant = require('fbjs/lib/invariant');\n\n/**\n * @class EventEmitter\n * @description\n * An EventEmitter is responsible for managing a set of listeners and publishing\n * events to them when it is told that such events happened. In addition to the\n * data for the given event it also sends a event control object which allows\n * the listeners/handlers to prevent the default behavior of the given event.\n *\n * The emitter is designed to be generic enough to support all the different\n * contexts in which one might want to emit events. It is a simple multicast\n * mechanism on top of which extra functionality can be composed. For example, a\n * more advanced emitter may use an EventHolder and EventFactory.\n */\nclass EventEmitter {\n\n  _subscriber: EventSubscriptionVendor;\n  _currentSubscription: ?EmitterSubscription;\n\n  /**\n   * @constructor\n   *\n   * @param {EventSubscriptionVendor} subscriber - Optional subscriber instance\n   *   to use. If omitted, a new subscriber will be created for the emitter.\n   */\n  constructor(subscriber: ?EventSubscriptionVendor) {\n    this._subscriber = subscriber || new EventSubscriptionVendor();\n  }\n\n  /**\n   * Adds a listener to be invoked when events of the specified type are\n   * emitted. An optional calling context may be provided. The data arguments\n   * emitted will be passed to the listener function.\n   *\n   * TODO: Annotate the listener arg's type. This is tricky because listeners\n   *       can be invoked with varargs.\n   *\n   * @param {string} eventType - Name of the event to listen to\n   * @param {function} listener - Function to invoke when the specified event is\n   *   emitted\n   * @param {*} context - Optional context object to use when invoking the\n   *   listener\n   */\n  addListener(\n    eventType: string, listener: Function, context: ?Object): EmitterSubscription {\n\n    return (this._subscriber.addSubscription(\n      eventType,\n      new EmitterSubscription(this, this._subscriber, listener, context)\n    ) : any);\n  }\n\n  /**\n   * Similar to addListener, except that the listener is removed after it is\n   * invoked once.\n   *\n   * @param {string} eventType - Name of the event to listen to\n   * @param {function} listener - Function to invoke only once when the\n   *   specified event is emitted\n   * @param {*} context - Optional context object to use when invoking the\n   *   listener\n   */\n  once(eventType: string, listener: Function, context: ?Object): EmitterSubscription {\n    return this.addListener(eventType, (...args) => {\n      this.removeCurrentListener();\n      listener.apply(context, args);\n    });\n  }\n\n  /**\n   * Removes all of the registered listeners, including those registered as\n   * listener maps.\n   *\n   * @param {?string} eventType - Optional name of the event whose registered\n   *   listeners to remove\n   */\n  removeAllListeners(eventType: ?string) {\n    this._subscriber.removeAllSubscriptions(eventType);\n  }\n\n  /**\n   * Provides an API that can be called during an eventing cycle to remove the\n   * last listener that was invoked. This allows a developer to provide an event\n   * object that can remove the listener (or listener map) during the\n   * invocation.\n   *\n   * If it is called when not inside of an emitting cycle it will throw.\n   *\n   * @throws {Error} When called not during an eventing cycle\n   *\n   * @example\n   *   var subscription = emitter.addListenerMap({\n   *     someEvent: function(data, event) {\n   *       console.log(data);\n   *       emitter.removeCurrentListener();\n   *     }\n   *   });\n   *\n   *   emitter.emit('someEvent', 'abc'); // logs 'abc'\n   *   emitter.emit('someEvent', 'def'); // does not log anything\n   */\n  removeCurrentListener() {\n    invariant(\n      !!this._currentSubscription,\n      'Not in an emitting cycle; there is no current subscription'\n    );\n    this.removeSubscription(this._currentSubscription);\n  }\n\n  /**\n   * Removes a specific subscription. Called by the `remove()` method of the\n   * subscription itself to ensure any necessary cleanup is performed.\n   */\n  removeSubscription(subscription: EmitterSubscription) {\n    invariant(\n      subscription.emitter === this,\n      'Subscription does not belong to this emitter.'\n    );\n    this._subscriber.removeSubscription(subscription);\n  }\n\n  /**\n   * Returns an array of listeners that are currently registered for the given\n   * event.\n   *\n   * @param {string} eventType - Name of the event to query\n   * @returns {array}\n   */\n  listeners(eventType: string): [EmitterSubscription] {\n    const subscriptions: ?[EmitterSubscription] = (this._subscriber.getSubscriptionsForType(eventType): any);\n    return subscriptions\n      ? subscriptions.filter(emptyFunction.thatReturnsTrue).map(\n          function(subscription) {\n            return subscription.listener;\n          })\n      : [];\n  }\n\n  /**\n   * Emits an event of the given type with the given data. All handlers of that\n   * particular type will be notified.\n   *\n   * @param {string} eventType - Name of the event to emit\n   * @param {...*} Arbitrary arguments to be passed to each registered listener\n   *\n   * @example\n   *   emitter.addListener('someEvent', function(message) {\n   *     console.log(message);\n   *   });\n   *\n   *   emitter.emit('someEvent', 'abc'); // logs 'abc'\n   */\n  emit(eventType: string) {\n    const subscriptions: ?[EmitterSubscription] = (this._subscriber.getSubscriptionsForType(eventType): any);\n    if (subscriptions) {\n      for (let i = 0, l = subscriptions.length; i < l; i++) {\n        const subscription = subscriptions[i];\n\n        // The subscription may have been removed during this event loop.\n        if (subscription) {\n          this._currentSubscription = subscription;\n          subscription.listener.apply(\n            subscription.context,\n            Array.prototype.slice.call(arguments, 1)\n          );\n        }\n      }\n      this._currentSubscription = null;\n    }\n  }\n\n  /**\n   * Removes the given listener for event of specific type.\n   *\n   * @param {string} eventType - Name of the event to emit\n   * @param {function} listener - Function to invoke when the specified event is\n   *   emitted\n   *\n   * @example\n   *   emitter.removeListener('someEvent', function(message) {\n   *     console.log(message);\n   *   }); // removes the listener if already registered\n   *\n   */\n  removeListener(eventType: String, listener) {\n    const subscriptions: ?[EmitterSubscription] = (this._subscriber.getSubscriptionsForType(eventType): any);\n    if (subscriptions) {\n      for (let i = 0, l = subscriptions.length; i < l; i++) {\n        const subscription = subscriptions[i];\n\n        // The subscription may have been removed during this event loop.\n        // its listener matches the listener in method parameters\n        if (subscription && subscription.listener === listener) {\n          subscription.remove();\n        }\n      }\n    }\n  }\n}\n\nmodule.exports = EventEmitter;\n"
  },
  {
    "path": "Libraries/vendor/emitter/EventEmitterWithHolding.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EventEmitterWithHolding\n * @flow\n */\n'use strict';\n\nimport type EmitterSubscription from 'EmitterSubscription';\nimport type EventEmitter from 'EventEmitter';\nimport type EventHolder from 'EventHolder';\n\n/**\n * @class EventEmitterWithHolding\n * @description\n * An EventEmitterWithHolding decorates an event emitter and enables one to\n * \"hold\" or cache events and then have a handler register later to actually\n * handle them.\n *\n * This is separated into its own decorator so that only those who want to use\n * the holding functionality have to and others can just use an emitter. Since\n * it implements the emitter interface it can also be combined with anything\n * that uses an emitter.\n */\nclass EventEmitterWithHolding {\n\n  _emitter: EventEmitter;\n  _eventHolder: EventHolder;\n  _currentEventToken: ?Object;\n  _emittingHeldEvents: boolean;\n\n  /**\n   * @constructor\n   * @param {object} emitter - The object responsible for emitting the actual\n   *   events.\n   * @param {object} holder - The event holder that is responsible for holding\n   *   and then emitting held events.\n   */\n  constructor(emitter: EventEmitter, holder: EventHolder) {\n    this._emitter = emitter;\n    this._eventHolder = holder;\n    this._currentEventToken = null;\n    this._emittingHeldEvents = false;\n  }\n\n  /**\n   * @see EventEmitter#addListener\n   */\n  addListener(eventType: string, listener: Function, context: ?Object) {\n    return this._emitter.addListener(eventType, listener, context);\n  }\n\n  /**\n   * @see EventEmitter#once\n   */\n  once(eventType: string, listener: Function, context: ?Object) {\n    return this._emitter.once(eventType, listener, context);\n  }\n\n  /**\n   * Adds a listener to be invoked when events of the specified type are\n   * emitted. An optional calling context may be provided. The data arguments\n   * emitted will be passed to the listener function. In addition to subscribing\n   * to all subsequent events, this method will also handle any events that have\n   * already been emitted, held, and not released.\n   *\n   * @param {string} eventType - Name of the event to listen to\n   * @param {function} listener - Function to invoke when the specified event is\n   *   emitted\n   * @param {*} context - Optional context object to use when invoking the\n   *   listener\n   *\n   * @example\n   *   emitter.emitAndHold('someEvent', 'abc');\n   *\n   *   emitter.addRetroactiveListener('someEvent', function(message) {\n   *     console.log(message);\n   *   }); // logs 'abc'\n   */\n  addRetroactiveListener(\n    eventType: string, listener: Function, context: ?Object): EmitterSubscription {\n    const subscription = this._emitter.addListener(eventType, listener, context);\n\n    this._emittingHeldEvents = true;\n    this._eventHolder.emitToListener(eventType, listener, context);\n    this._emittingHeldEvents = false;\n\n    return subscription;\n  }\n\n  /**\n   * @see EventEmitter#removeAllListeners\n   */\n  removeAllListeners(eventType: string) {\n    this._emitter.removeAllListeners(eventType);\n  }\n\n  /**\n   * @see EventEmitter#removeCurrentListener\n   */\n  removeCurrentListener() {\n    this._emitter.removeCurrentListener();\n  }\n\n  /**\n   * @see EventEmitter#listeners\n   */\n  listeners(eventType: string) /* TODO: Annotate return type here */ {\n    return this._emitter.listeners(eventType);\n  }\n\n  /**\n   * @see EventEmitter#emit\n   */\n  emit(eventType: string, ...args: any) {\n    this._emitter.emit(eventType, ...args);\n  }\n\n  /**\n   * Emits an event of the given type with the given data, and holds that event\n   * in order to be able to dispatch it to a later subscriber when they say they\n   * want to handle held events.\n   *\n   * @param {string} eventType - Name of the event to emit\n   * @param {...*} Arbitrary arguments to be passed to each registered listener\n   *\n   * @example\n   *   emitter.emitAndHold('someEvent', 'abc');\n   *\n   *   emitter.addRetroactiveListener('someEvent', function(message) {\n   *     console.log(message);\n   *   }); // logs 'abc'\n   */\n  emitAndHold(eventType: string, ...args: any) {\n    this._currentEventToken = this._eventHolder.holdEvent(eventType, ...args);\n    this._emitter.emit(eventType, ...args);\n    this._currentEventToken = null;\n  }\n\n  /**\n   * @see EventHolder#releaseCurrentEvent\n   */\n  releaseCurrentEvent() {\n    if (this._currentEventToken) {\n      this._eventHolder.releaseEvent(this._currentEventToken);\n    } else if (this._emittingHeldEvents) {\n      this._eventHolder.releaseCurrentEvent();\n    }\n  }\n\n  /**\n   * @see EventHolder#releaseEventType\n   * @param {string} eventType\n   */\n  releaseHeldEventType(eventType: string) {\n    this._eventHolder.releaseEventType(eventType);\n  }\n}\n\nmodule.exports = EventEmitterWithHolding;\n"
  },
  {
    "path": "Libraries/vendor/emitter/EventHolder.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EventHolder\n * @flow\n */\n'use strict';\n\nconst invariant = require('fbjs/lib/invariant');\n\nclass EventHolder {\n\n  _heldEvents: Object;\n  _currentEventKey: ?Object;\n\n  constructor() {\n    this._heldEvents = {};\n    this._currentEventKey = null;\n  }\n\n  /**\n   * Holds a given event for processing later.\n   *\n   * TODO: Annotate return type better. The structural type of the return here\n   *       is pretty obvious.\n   *\n   * @param {string} eventType - Name of the event to hold and later emit\n   * @param {...*} Arbitrary arguments to be passed to each registered listener\n   * @return {object} Token that can be used to release the held event\n   *\n   * @example\n   *\n   *   holder.holdEvent({someEvent: 'abc'});\n   *\n   *   holder.emitToHandler({\n   *     someEvent: function(data, event) {\n   *       console.log(data);\n   *     }\n   *   }); //logs 'abc'\n   *\n   */\n  holdEvent(eventType: string, ...args: any) {\n    this._heldEvents[eventType] = this._heldEvents[eventType] || [];\n    const eventsOfType = this._heldEvents[eventType];\n    const key = {\n      eventType: eventType,\n      index: eventsOfType.length\n    };\n    eventsOfType.push(args);\n    return key;\n  }\n\n  /**\n   * Emits the held events of the specified type to the given listener.\n   *\n   * @param {?string} eventType - Optional name of the events to replay\n   * @param {function} listener - The listener to which to dispatch the event\n   * @param {?object} context - Optional context object to use when invoking\n   *   the listener\n   */\n  emitToListener(eventType: ?string , listener: Function, context: ?Object) {\n    const eventsOfType = this._heldEvents[eventType];\n    if (!eventsOfType) {\n      return;\n    }\n    const origEventKey = this._currentEventKey;\n    eventsOfType.forEach((/*?array*/ eventHeld, /*number*/ index) => {\n      if (!eventHeld) {\n        return;\n      }\n      this._currentEventKey = {\n        eventType: eventType,\n        index: index\n      };\n      listener.apply(context, eventHeld);\n    });\n    this._currentEventKey = origEventKey;\n  }\n\n  /**\n   * Provides an API that can be called during an eventing cycle to release\n   * the last event that was invoked, so that it is no longer \"held\".\n   *\n   * If it is called when not inside of an emitting cycle it will throw.\n   *\n   * @throws {Error} When called not during an eventing cycle\n   */\n  releaseCurrentEvent() {\n    invariant(\n      this._currentEventKey !== null,\n      'Not in an emitting cycle; there is no current event'\n    );\n    this._currentEventKey && this.releaseEvent(this._currentEventKey);\n  }\n\n  /**\n   * Releases the event corresponding to the handle that was returned when the\n   * event was first held.\n   *\n   * @param {object} token - The token returned from holdEvent\n   */\n  releaseEvent(token: Object) {\n    delete this._heldEvents[token.eventType][token.index];\n  }\n\n  /**\n   * Releases all events of a certain type.\n   *\n   * @param {string} type\n   */\n  releaseEventType(type: string) {\n    this._heldEvents[type] = [];\n  }\n}\n\nmodule.exports = EventHolder;\n"
  },
  {
    "path": "Libraries/vendor/emitter/EventSubscription.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EventSubscription\n * @flow\n */\n'use strict';\n\nimport type EventSubscriptionVendor from 'EventSubscriptionVendor';\n\n/**\n * EventSubscription represents a subscription to a particular event. It can\n * remove its own subscription.\n */\nclass EventSubscription {\n\n  eventType: string;\n  key: number;\n  subscriber: EventSubscriptionVendor;\n\n  /**\n   * @param {EventSubscriptionVendor} subscriber the subscriber that controls\n   *   this subscription.\n   */\n  constructor(subscriber: EventSubscriptionVendor) {\n    this.subscriber = subscriber;\n  }\n\n  /**\n   * Removes this subscription from the subscriber that controls it.\n   */\n  remove() {\n    this.subscriber.removeSubscription(this);\n  }\n}\n\nmodule.exports = EventSubscription;\n"
  },
  {
    "path": "Libraries/vendor/emitter/EventSubscriptionVendor.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EventSubscriptionVendor\n * @flow\n */\n'use strict';\n\nconst invariant = require('fbjs/lib/invariant');\n\nimport type EventSubscription from 'EventSubscription';\n\n/**\n * EventSubscriptionVendor stores a set of EventSubscriptions that are\n * subscribed to a particular event type.\n */\nclass EventSubscriptionVendor {\n\n  _subscriptionsForType: Object;\n  _currentSubscription: ?EventSubscription;\n\n  constructor() {\n    this._subscriptionsForType = {};\n    this._currentSubscription = null;\n  }\n\n  /**\n   * Adds a subscription keyed by an event type.\n   *\n   * @param {string} eventType\n   * @param {EventSubscription} subscription\n   */\n  addSubscription(\n    eventType: string, subscription: EventSubscription): EventSubscription {\n    invariant(\n      subscription.subscriber === this,\n      'The subscriber of the subscription is incorrectly set.');\n    if (!this._subscriptionsForType[eventType]) {\n      this._subscriptionsForType[eventType] = [];\n    }\n    const key = this._subscriptionsForType[eventType].length;\n    this._subscriptionsForType[eventType].push(subscription);\n    subscription.eventType = eventType;\n    subscription.key = key;\n    return subscription;\n  }\n\n  /**\n   * Removes a bulk set of the subscriptions.\n   *\n   * @param {?string} eventType - Optional name of the event type whose\n   *   registered supscriptions to remove, if null remove all subscriptions.\n   */\n  removeAllSubscriptions(eventType: ?string) {\n    if (eventType === undefined) {\n      this._subscriptionsForType = {};\n    } else {\n      delete this._subscriptionsForType[eventType];\n    }\n  }\n\n  /**\n   * Removes a specific subscription. Instead of calling this function, call\n   * `subscription.remove()` directly.\n   *\n   * @param {object} subscription\n   */\n  removeSubscription(subscription: Object) {\n    const eventType = subscription.eventType;\n    const key = subscription.key;\n\n    const subscriptionsForType = this._subscriptionsForType[eventType];\n    if (subscriptionsForType) {\n      delete subscriptionsForType[key];\n    }\n  }\n\n  /**\n   * Returns the array of subscriptions that are currently registered for the\n   * given event type.\n   *\n   * Note: This array can be potentially sparse as subscriptions are deleted\n   * from it when they are removed.\n   *\n   * TODO: This returns a nullable array. wat?\n   *\n   * @param {string} eventType\n   * @returns {?array}\n   */\n  getSubscriptionsForType(eventType: string): ?[EventSubscription] {\n   return this._subscriptionsForType[eventType];\n  }\n}\n\nmodule.exports = EventSubscriptionVendor;\n"
  },
  {
    "path": "Libraries/vendor/emitter/EventValidator.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EventValidator\n * @flow\n */\n'use strict';\n\n/**\n * EventValidator is designed to validate event types to make it easier to catch\n * common mistakes. It accepts a map of all of the different types of events\n * that the emitter can emit. Then, if a user attempts to emit an event that is\n * not one of those specified types the emitter will throw an error. Also, it\n * provides a relatively simple matcher so that if it thinks that you likely\n * mistyped the event name it will suggest what you might have meant to type in\n * the error message.\n */\nconst EventValidator = {\n  /**\n   * @param {Object} emitter - The object responsible for emitting the actual\n   *                             events\n   * @param {Object} types - The collection of valid types that will be used to\n   *                         check for errors\n   * @return {Object} A new emitter with event type validation\n   * @example\n   *   const types = {someEvent: true, anotherEvent: true};\n   *   const emitter = EventValidator.addValidation(emitter, types);\n   */\n  addValidation: function(emitter: Object, types: Object) {\n    const eventTypes = Object.keys(types);\n    const emitterWithValidation = Object.create(emitter);\n\n    Object.assign(emitterWithValidation, {\n      emit: function emit(type, a, b, c, d, e, _) {\n        assertAllowsEventType(type, eventTypes);\n        return emitter.emit.call(this, type, a, b, c, d, e, _);\n      }\n    });\n\n    return emitterWithValidation;\n  }\n};\n\nfunction assertAllowsEventType(type, allowedTypes) {\n  if (allowedTypes.indexOf(type) === -1) {\n    throw new TypeError(errorMessageFor(type, allowedTypes));\n  }\n}\n\nfunction errorMessageFor(type, allowedTypes) {\n  let message = 'Unknown event type \"' + type + '\". ';\n  if (__DEV__) {\n    message += recommendationFor(type, allowedTypes);\n  }\n  message += 'Known event types: ' + allowedTypes.join(', ') + '.';\n  return message;\n}\n\n// Allow for good error messages\nif (__DEV__) {\n  var recommendationFor = function (type, allowedTypes) {\n    const closestTypeRecommendation = closestTypeFor(type, allowedTypes);\n    if (isCloseEnough(closestTypeRecommendation, type)) {\n      return 'Did you mean \"' + closestTypeRecommendation.type + '\"? ';\n    } else {\n      return '';\n    }\n  };\n\n  var closestTypeFor = function (type, allowedTypes) {\n    const typeRecommendations = allowedTypes.map(\n      typeRecommendationFor.bind(this, type)\n    );\n    return typeRecommendations.sort(recommendationSort)[0];\n  };\n\n  var typeRecommendationFor = function (type, recomendedType) {\n    return {\n      type: recomendedType,\n      distance: damerauLevenshteinDistance(type, recomendedType)\n    };\n  };\n\n  var recommendationSort = function (recommendationA, recommendationB) {\n    if (recommendationA.distance < recommendationB.distance) {\n      return -1;\n    } else if (recommendationA.distance > recommendationB.distance) {\n      return 1;\n    } else {\n      return 0;\n    }\n  };\n\n  var isCloseEnough = function (closestType, actualType) {\n    return (closestType.distance / actualType.length) < 0.334;\n  };\n\n  var damerauLevenshteinDistance = function (a, b) {\n    let i, j;\n    const d = [];\n\n    for (i = 0; i <= a.length; i++) {\n      d[i] = [i];\n    }\n\n    for (j = 1; j <= b.length; j++) {\n      d[0][j] = j;\n    }\n\n    for (i = 1; i <= a.length; i++) {\n      for (j = 1; j <= b.length; j++) {\n        const cost = a.charAt(i - 1) === b.charAt(j - 1) ? 0 : 1;\n\n        d[i][j] = Math.min(\n          d[i - 1][j] + 1,\n          d[i][j - 1] + 1,\n          d[i - 1][j - 1] + cost\n        );\n\n        if (i > 1 && j > 1 &&\n            a.charAt(i - 1) === b.charAt(j - 2) &&\n            a.charAt(i - 2) === b.charAt(j - 1)) {\n          d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost);\n        }\n      }\n    }\n\n    return d[a.length][b.length];\n  };\n}\n\nmodule.exports = EventValidator;\n"
  },
  {
    "path": "Libraries/vendor/emitter/mixInEventEmitter.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule mixInEventEmitter\n * @flow\n */\n'use strict';\n\nconst EventEmitter = require('EventEmitter');\nconst EventEmitterWithHolding = require('EventEmitterWithHolding');\nconst EventHolder = require('EventHolder');\n\nconst invariant = require('fbjs/lib/invariant');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst keyOf = require('fbjs/lib/keyOf');\n\nimport type EmitterSubscription from 'EmitterSubscription';\n\nconst TYPES_KEY = keyOf({__types: true});\n\n/**\n * API to setup an object or constructor to be able to emit data events.\n *\n * @example\n * function Dog() { ...dog stuff... }\n * mixInEventEmitter(Dog, {bark: true});\n *\n * var puppy = new Dog();\n * puppy.addListener('bark', function (volume) {\n *   console.log('Puppy', this, 'barked at volume:', volume);\n * });\n * puppy.emit('bark', 'quiet');\n * // Puppy <puppy> barked at volume: quiet\n *\n *\n * // A \"singleton\" object may also be commissioned:\n *\n * var Singleton = {};\n * mixInEventEmitter(Singleton, {lonely: true});\n * Singleton.emit('lonely', true);\n */\nfunction mixInEventEmitter(cls: Function | Object, types: Object) {\n  invariant(types, 'Must supply set of valid event types');\n\n  // If this is a constructor, write to the prototype, otherwise write to the\n  // singleton object.\n  const target = cls.prototype || cls;\n\n  invariant(!target.__eventEmitter, 'An active emitter is already mixed in');\n\n  const ctor = cls.constructor;\n  if (ctor) {\n    invariant(\n      ctor === Object || ctor === Function,\n      'Mix EventEmitter into a class, not an instance'\n    );\n  }\n\n  // Keep track of the provided types, union the types if they already exist,\n  // which allows for prototype subclasses to provide more types.\n  if (target.hasOwnProperty(TYPES_KEY)) {\n    Object.assign(target.__types, types);\n  } else if (target.__types) {\n    target.__types = Object.assign({}, target.__types, types);\n  } else {\n    target.__types = types;\n  }\n  Object.assign(target, EventEmitterMixin);\n}\n\nconst EventEmitterMixin = {\n  emit: function(eventType, a, b, c, d, e, _) {\n    return this.__getEventEmitter().emit(eventType, a, b, c, d, e, _);\n  },\n\n  emitAndHold: function(eventType, a, b, c, d, e, _) {\n    return this.__getEventEmitter().emitAndHold(eventType, a, b, c, d, e, _);\n  },\n\n  addListener: function(eventType, listener, context): EmitterSubscription {\n    return this.__getEventEmitter().addListener(eventType, listener, context);\n  },\n\n  once: function(eventType, listener, context) {\n    return this.__getEventEmitter().once(eventType, listener, context);\n  },\n\n  addRetroactiveListener: function(eventType, listener, context) {\n    return this.__getEventEmitter().addRetroactiveListener(\n      eventType,\n      listener,\n      context\n    );\n  },\n\n  addListenerMap: function(listenerMap, context) {\n    return this.__getEventEmitter().addListenerMap(listenerMap, context);\n  },\n\n  addRetroactiveListenerMap: function(listenerMap, context) {\n    return this.__getEventEmitter().addListenerMap(listenerMap, context);\n  },\n\n  removeAllListeners: function() {\n    this.__getEventEmitter().removeAllListeners();\n  },\n\n  removeCurrentListener: function() {\n    this.__getEventEmitter().removeCurrentListener();\n  },\n\n  releaseHeldEventType: function(eventType) {\n    this.__getEventEmitter().releaseHeldEventType(eventType);\n  },\n\n  __getEventEmitter: function() {\n    if (!this.__eventEmitter) {\n      let emitter = new EventEmitter();\n      if (__DEV__) {\n        const EventValidator = require('EventValidator');\n        emitter = EventValidator.addValidation(emitter, this.__types);\n      }\n\n      const holder = new EventHolder();\n      this.__eventEmitter = new EventEmitterWithHolding(emitter, holder);\n    }\n    return this.__eventEmitter;\n  }\n};\n\nmodule.exports = mixInEventEmitter;\n"
  },
  {
    "path": "Libraries/vendor/react/vendor/core/ExecutionEnvironment.macos.js",
    "content": "/**\n * Copyright 2013-2014 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ExecutionEnvironment1\n *\n * Stubs SignedSource<<7afee88a05412d0c4eef54817419648e>>\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nvar canUseDOM = false;\n\n/**\n * Simple, lightweight module assisting with the detection and context of\n * Worker. Helps avoid circular dependencies and allows code to reason about\n * whether or not they are in a Worker, even if they never include the main\n * `ReactWorker` dependency.\n */\nvar ExecutionEnvironment = {\n\n  canUseDOM: canUseDOM,\n\n  canUseWorkers: typeof Worker !== 'undefined',\n\n  canUseEventListeners:\n    canUseDOM && !!(window.addEventListener || window.attachEvent),\n\n  canUseViewport: canUseDOM && !!window.screen,\n\n  isInWorker: !canUseDOM // For now, this is true - might change in the future.\n\n};\n\nmodule.exports = ExecutionEnvironment;\n"
  },
  {
    "path": "Libraries/vendor/tinycolor/tinycolor.js",
    "content": "/**\n * @providesModule tinycolor\n * @nolint\n */\n'use strict';\n\n// TinyColor v1.2.1\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\nvar trimLeft = /^[\\s,#]+/,\n    trimRight = /\\s+$/,\n    tinyCounter = 0,\n    mathRound = Math.round,\n    mathMin = Math.min,\n    mathMax = Math.max;\n\nfunction tinycolor (color, opts) {\n    // If we are called as a function, call using new instead\n    if (!(this instanceof tinycolor)) {\n        return new tinycolor(color, opts);\n    }\n\n    color = (color) ? color : '';\n    opts = opts || { };\n\n    var rgb = inputToRGB(color);\n    this._r = rgb.r,\n    this._g = rgb.g,\n    this._b = rgb.b,\n    this._a = rgb.a,\n\n    this._ok = rgb.ok;\n}\n\ntinycolor.prototype = {\n    toRgb: function() {\n        return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };\n    },\n    isValid: function() {\n        return this._ok;\n    },\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n//     \"red\"\n//     \"#f00\" or \"f00\"\n//     \"#f00f\" or \"f00f\"\n//     \"#ff0000\" or \"ff0000\"\n//     \"#ff0000ff\" or \"ff0000ff\"\n//     \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n//     \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n//     \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n//     \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n//     \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n//     \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n//     \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n    var rgb = { r: 0, g: 0, b: 0 };\n    var a = 1;\n    var ok = false;\n    var format = false;\n\n    if (typeof color == \"string\") {\n        color = stringInputToObject(color);\n    }\n\n    if (typeof color == \"object\") {\n        if (color.hasOwnProperty(\"r\") && color.hasOwnProperty(\"g\") && color.hasOwnProperty(\"b\")) {\n            rgb = rgbToRgb(color.r, color.g, color.b);\n            ok = true;\n        }\n        else if (color.hasOwnProperty(\"h\") && color.hasOwnProperty(\"s\") && color.hasOwnProperty(\"v\")) {\n            color.s = convertToPercentage(color.s);\n            color.v = convertToPercentage(color.v);\n            rgb = hsvToRgb(color.h, color.s, color.v);\n            ok = true;\n        }\n        else if (color.hasOwnProperty(\"h\") && color.hasOwnProperty(\"s\") && color.hasOwnProperty(\"l\")) {\n            color.s = convertToPercentage(color.s);\n            color.l = convertToPercentage(color.l);\n            rgb = hslToRgb(color.h, color.s, color.l);\n            ok = true;\n        }\n\n        if (color.hasOwnProperty(\"a\")) {\n            a = color.a;\n        }\n    }\n\n    a = boundAlpha(a);\n\n    return {\n        ok: ok,\n        r: mathMin(255, mathMax(rgb.r, 0)),\n        g: mathMin(255, mathMax(rgb.g, 0)),\n        b: mathMin(255, mathMax(rgb.b, 0)),\n        a: a\n    };\n}\n\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>\n\n// `rgbToRgb`\n// Handle bounds / percentage checking to conform to CSS color spec\n// <http://www.w3.org/TR/css3-color/>\n// *Assumes:* r, g, b in [0, 255] or [0, 1]\n// *Returns:* { r, g, b } in [0, 255]\nfunction rgbToRgb(r, g, b){\n    return {\n        r: bound01(r, 255) * 255,\n        g: bound01(g, 255) * 255,\n        b: bound01(b, 255) * 255\n    };\n}\n\n// `hslToRgb`\n// Converts an HSL color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hslToRgb(h, s, l) {\n    var r, g, b;\n\n    h = bound01(h, 360);\n    s = bound01(s, 100);\n    l = bound01(l, 100);\n\n    function hue2rgb(p, q, t) {\n        if(t < 0) t += 1;\n        if(t > 1) t -= 1;\n        if(t < 1/6) return p + (q - p) * 6 * t;\n        if(t < 1/2) return q;\n        if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n        return p;\n    }\n\n    if(s === 0) {\n        r = g = b = l; // achromatic\n    }\n    else {\n        var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n        var p = 2 * l - q;\n        r = hue2rgb(p, q, h + 1/3);\n        g = hue2rgb(p, q, h);\n        b = hue2rgb(p, q, h - 1/3);\n    }\n\n    return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `hsvToRgb`\n// Converts an HSV color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n    h = bound01(h, 360) * 6;\n    s = bound01(s, 100);\n    v = bound01(v, 100);\n\n    var i = math.floor(h),\n        f = h - i,\n        p = v * (1 - s),\n        q = v * (1 - f * s),\n        t = v * (1 - (1 - f) * s),\n        mod = i % 6,\n        r = [v, q, p, p, t, v][mod],\n        g = [t, v, v, q, p, p][mod],\n        b = [p, p, t, v, v, q][mod];\n\n    return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// Big List of Colors\n// ------------------\n// <http://www.w3.org/TR/css3-color/#svg-color>\nvar names = tinycolor.names = {\n    aliceblue: \"f0f8ff\",\n    antiquewhite: \"faebd7\",\n    aqua: \"0ff\",\n    aquamarine: \"7fffd4\",\n    azure: \"f0ffff\",\n    beige: \"f5f5dc\",\n    bisque: \"ffe4c4\",\n    black: \"000\",\n    blanchedalmond: \"ffebcd\",\n    blue: \"00f\",\n    blueviolet: \"8a2be2\",\n    brown: \"a52a2a\",\n    burlywood: \"deb887\",\n    burntsienna: \"ea7e5d\",\n    cadetblue: \"5f9ea0\",\n    chartreuse: \"7fff00\",\n    chocolate: \"d2691e\",\n    coral: \"ff7f50\",\n    cornflowerblue: \"6495ed\",\n    cornsilk: \"fff8dc\",\n    crimson: \"dc143c\",\n    cyan: \"0ff\",\n    darkblue: \"00008b\",\n    darkcyan: \"008b8b\",\n    darkgoldenrod: \"b8860b\",\n    darkgray: \"a9a9a9\",\n    darkgreen: \"006400\",\n    darkgrey: \"a9a9a9\",\n    darkkhaki: \"bdb76b\",\n    darkmagenta: \"8b008b\",\n    darkolivegreen: \"556b2f\",\n    darkorange: \"ff8c00\",\n    darkorchid: \"9932cc\",\n    darkred: \"8b0000\",\n    darksalmon: \"e9967a\",\n    darkseagreen: \"8fbc8f\",\n    darkslateblue: \"483d8b\",\n    darkslategray: \"2f4f4f\",\n    darkslategrey: \"2f4f4f\",\n    darkturquoise: \"00ced1\",\n    darkviolet: \"9400d3\",\n    deeppink: \"ff1493\",\n    deepskyblue: \"00bfff\",\n    dimgray: \"696969\",\n    dimgrey: \"696969\",\n    dodgerblue: \"1e90ff\",\n    firebrick: \"b22222\",\n    floralwhite: \"fffaf0\",\n    forestgreen: \"228b22\",\n    fuchsia: \"f0f\",\n    gainsboro: \"dcdcdc\",\n    ghostwhite: \"f8f8ff\",\n    gold: \"ffd700\",\n    goldenrod: \"daa520\",\n    gray: \"808080\",\n    green: \"008000\",\n    greenyellow: \"adff2f\",\n    grey: \"808080\",\n    honeydew: \"f0fff0\",\n    hotpink: \"ff69b4\",\n    indianred: \"cd5c5c\",\n    indigo: \"4b0082\",\n    ivory: \"fffff0\",\n    khaki: \"f0e68c\",\n    lavender: \"e6e6fa\",\n    lavenderblush: \"fff0f5\",\n    lawngreen: \"7cfc00\",\n    lemonchiffon: \"fffacd\",\n    lightblue: \"add8e6\",\n    lightcoral: \"f08080\",\n    lightcyan: \"e0ffff\",\n    lightgoldenrodyellow: \"fafad2\",\n    lightgray: \"d3d3d3\",\n    lightgreen: \"90ee90\",\n    lightgrey: \"d3d3d3\",\n    lightpink: \"ffb6c1\",\n    lightsalmon: \"ffa07a\",\n    lightseagreen: \"20b2aa\",\n    lightskyblue: \"87cefa\",\n    lightslategray: \"789\",\n    lightslategrey: \"789\",\n    lightsteelblue: \"b0c4de\",\n    lightyellow: \"ffffe0\",\n    lime: \"0f0\",\n    limegreen: \"32cd32\",\n    linen: \"faf0e6\",\n    magenta: \"f0f\",\n    maroon: \"800000\",\n    mediumaquamarine: \"66cdaa\",\n    mediumblue: \"0000cd\",\n    mediumorchid: \"ba55d3\",\n    mediumpurple: \"9370db\",\n    mediumseagreen: \"3cb371\",\n    mediumslateblue: \"7b68ee\",\n    mediumspringgreen: \"00fa9a\",\n    mediumturquoise: \"48d1cc\",\n    mediumvioletred: \"c71585\",\n    midnightblue: \"191970\",\n    mintcream: \"f5fffa\",\n    mistyrose: \"ffe4e1\",\n    moccasin: \"ffe4b5\",\n    navajowhite: \"ffdead\",\n    navy: \"000080\",\n    oldlace: \"fdf5e6\",\n    olive: \"808000\",\n    olivedrab: \"6b8e23\",\n    orange: \"ffa500\",\n    orangered: \"ff4500\",\n    orchid: \"da70d6\",\n    palegoldenrod: \"eee8aa\",\n    palegreen: \"98fb98\",\n    paleturquoise: \"afeeee\",\n    palevioletred: \"db7093\",\n    papayawhip: \"ffefd5\",\n    peachpuff: \"ffdab9\",\n    peru: \"cd853f\",\n    pink: \"ffc0cb\",\n    plum: \"dda0dd\",\n    powderblue: \"b0e0e6\",\n    purple: \"800080\",\n    rebeccapurple: \"663399\",\n    red: \"f00\",\n    rosybrown: \"bc8f8f\",\n    royalblue: \"4169e1\",\n    saddlebrown: \"8b4513\",\n    salmon: \"fa8072\",\n    sandybrown: \"f4a460\",\n    seagreen: \"2e8b57\",\n    seashell: \"fff5ee\",\n    sienna: \"a0522d\",\n    silver: \"c0c0c0\",\n    skyblue: \"87ceeb\",\n    slateblue: \"6a5acd\",\n    slategray: \"708090\",\n    slategrey: \"708090\",\n    snow: \"fffafa\",\n    springgreen: \"00ff7f\",\n    steelblue: \"4682b4\",\n    tan: \"d2b48c\",\n    teal: \"008080\",\n    thistle: \"d8bfd8\",\n    tomato: \"ff6347\",\n    turquoise: \"40e0d0\",\n    violet: \"ee82ee\",\n    wheat: \"f5deb3\",\n    white: \"fff\",\n    whitesmoke: \"f5f5f5\",\n    yellow: \"ff0\",\n    yellowgreen: \"9acd32\"\n};\n\n// Return a valid alpha value [0,1] with all invalid values being set to 1\nfunction boundAlpha(a) {\n    a = parseFloat(a);\n\n    if (isNaN(a) || a < 0 || a > 1) {\n        a = 1;\n    }\n\n    return a;\n}\n\n// Take input from [0, n] and return it as [0, 1]\nfunction bound01(n, max) {\n    if (isOnePointZero(n)) { n = \"100%\"; }\n\n    var processPercent = isPercentage(n);\n    n = mathMin(max, mathMax(0, parseFloat(n)));\n\n    // Automatically convert percentage into number\n    if (processPercent) {\n        n = parseInt(n * max, 10) / 100;\n    }\n\n    // Handle floating point rounding errors\n    if ((Math.abs(n - max) < 0.000001)) {\n        return 1;\n    }\n\n    // Convert into [0, 1] range if it isn't already\n    return (n % max) / parseFloat(max);\n}\n\n// Parse a base-16 hex value into a base-10 integer\nfunction parseIntFromHex(val) {\n    return parseInt(val, 16);\n}\n\n// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>\nfunction isOnePointZero(n) {\n    return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n}\n\n// Check to see if string passed in is a percentage\nfunction isPercentage(n) {\n    return typeof n === \"string\" && n.indexOf('%') != -1;\n}\n\n// Replace a decimal with it's percentage value\nfunction convertToPercentage(n) {\n    if (n <= 1) {\n        n = (n * 100) + \"%\";\n    }\n\n    return n;\n}\n\n// Converts a hex value to a decimal\nfunction convertHexToDecimal(h) {\n    return (parseIntFromHex(h) / 255);\n}\n\nvar matchers = (function() {\n    // <http://www.w3.org/TR/css3-values/#integers>\n    var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n    // <http://www.w3.org/TR/css3-values/#number-value>\n    var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n    // Allow positive/negative integer/number.  Don't capture the either/or, just the entire outcome.\n    var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n    // Actual matching.\n    // Parentheses and commas are optional, but not required.\n    // Whitespace can take the place of commas or opening paren\n    var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n    var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n\n    return {\n        rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n        rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n        hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n        hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n        hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n        hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n        hex3: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n        hex4: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n        hex6: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n        hex8: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n    };\n})();\n\n// `stringInputToObject`\n// Permissive string parsing.  Take in a number of formats, and output an object\n// based on detected format.  Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\nfunction stringInputToObject(color) {\n    color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();\n    var named = false;\n    if (names[color]) {\n        color = names[color];\n        named = true;\n    }\n    else if (color == 'transparent') {\n        return { r: 0, g: 0, b: 0, a: 0, format: \"name\" };\n    }\n\n    // Try to match string input using regular expressions.\n    // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n    // Just return an object and let the conversion functions handle that.\n    // This way the result will be the same whether the tinycolor is initialized with string or object.\n    var match;\n    if ((match = matchers.rgb.exec(color))) {\n        return { r: match[1], g: match[2], b: match[3] };\n    }\n    if ((match = matchers.rgba.exec(color))) {\n        return { r: match[1], g: match[2], b: match[3], a: match[4] };\n    }\n    if ((match = matchers.hsl.exec(color))) {\n        return { h: match[1], s: match[2], l: match[3] };\n    }\n    if ((match = matchers.hsla.exec(color))) {\n        return { h: match[1], s: match[2], l: match[3], a: match[4] };\n    }\n    if ((match = matchers.hsv.exec(color))) {\n        return { h: match[1], s: match[2], v: match[3] };\n    }\n    if ((match = matchers.hsva.exec(color))) {\n        return { h: match[1], s: match[2], v: match[3], a: match[4] };\n    }\n    if ((match = matchers.hex8.exec(color))) {\n        return {\n            r: parseIntFromHex(match[1]),\n            g: parseIntFromHex(match[2]),\n            b: parseIntFromHex(match[3]),\n            a: convertHexToDecimal(match[4]),\n            format: named ? \"name\" : \"hex\"\n        };\n    }\n    if ((match = matchers.hex6.exec(color))) {\n        return {\n            r: parseIntFromHex(match[1]),\n            g: parseIntFromHex(match[2]),\n            b: parseIntFromHex(match[3]),\n            format: named ? \"name\" : \"hex\"\n        };\n    }\n    if ((match = matchers.hex4.exec(color))) {\n        return {\n            r: parseIntFromHex(match[1] + '' + match[1]),\n            g: parseIntFromHex(match[2] + '' + match[2]),\n            b: parseIntFromHex(match[3] + '' + match[3]),\n            a: convertHexToDecimal(match[4] + '' + match[4]),\n            format: named ? \"name\" : \"hex\"\n        };\n    }\n    if ((match = matchers.hex3.exec(color))) {\n        return {\n            r: parseIntFromHex(match[1] + '' + match[1]),\n            g: parseIntFromHex(match[2] + '' + match[2]),\n            b: parseIntFromHex(match[3] + '' + match[3]),\n            format: named ? \"name\" : \"hex\"\n        };\n    }\n\n    return false;\n}\n\nmodule.exports = tinycolor;\n"
  },
  {
    "path": "README.md",
    "content": "# Deprecation #\n\nThe project is no longer maintained.\n\nThere is an Microsoft version: [https://microsoft.github.io/react-native-windows/](https://microsoft.github.io/react-native-windows/)\n\nYou can run React Native on Catalyst [https://github.com/react-native-community/discussions-and-proposals/issues/131](https://github.com/react-native-community/discussions-and-proposals/issues/131)\n\n\n\n\n\n\n\n# React Native macOS (ex react-native-desktop)\n\nBuild macOS desktop applications using React Native.\n\n----\n\n[![Build Status](https://travis-ci.org/ptmt/react-native-macos.svg)](https://travis-ci.org/ptmt/react-native-macos) [![npm version](https://badge.fury.io/js/react-native-macos.svg)](https://badge.fury.io/js/react-native-macos) [![discord #react-native-platforms](https://img.shields.io/badge/reactiflux-%23react--native--platforms-blue.svg)](http://reactiflux.com)\n\n```jsx\n<View>\n  <Button onPress={() => alert('clicked!')} />\n</View>\n```\n\n## Getting Started\n\nNode 4.x+, OS X 10.11+ required.\n\n_Previous React Native experience is highly recommended_.\n\n```bash\n$ npm install react-native-macos-cli -g\n$ react-native-macos init MyProject\n$ cd MyProject\n$ react-native-macos run-macos\n```\n\nIf you want to add macOS target to the existing iOS/Android/Windows project, make the steps above, merge this new folder into your current React Native project, then put [rn-cli.config.js](https://gist.github.com/ptmt/b1473dead098cf53d667e355aedf2a7b) in the root.\n\n## Documentation\n\nSince React Native macOS is just a fork, you can follow [the same instructions on the React Native Documentation](http://facebook.github.io/react-native/docs/getting-started.html#content).\n\n## Disclaimer\n\nReact Native macOS is a fork of React Native for iOS. The project is still a fairly new so proceed at your own risk.\n\n## Community Help\n\nPlease use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests and have limited bandwidth to address them.\n\n- Ask a question on [StackOverflow](https://stackoverflow.com/) and tag it with `react-native-macos`\n- Chat with us on [Reactiflux](https://discord.gg/0ZcbPKXt5bWJVmUY) in `#react-native-platforms` (mentioning @ptmt)\n- DM @ptmt on twitter\n\n## Examples\n\n### RNTesterApp\n\nRNTesterApp includes a set of component examples that illustrate their functionality. It also allows you to load external JavaScript bundle files through HTTP. Just copy and paste a URL into the Search Field.\n\n[Download UIExplorer](https://github.com/ptmt/react-native-macos/files/199128/UIExplorer.zip)\n\n![screenshot 2016-03-31 21 06 33](https://cloud.githubusercontent.com/assets/1004115/14185918/91648d8c-f784-11e5-82b6-fcd08b74b89a.png)\n\n![screenshot 2016-03-31 21 00 30](https://cloud.githubusercontent.com/assets/1004115/14185806/1cd2dfdc-f784-11e5-8c14-de0ca21f7ead.png)\n\n![screenshot 2015-10-24 16 40 36](https://cloud.githubusercontent.com/assets/1004115/14185895/7c133eb0-f784-11e5-8e3c-ca36aa351a26.png)\n\n## License\n\nReact Native is MIT licensed.\n"
  },
  {
    "path": "RNTester/.eslintrc",
    "content": "{\n  \"rules\": {\n    // This folder currently runs through babel and doesn't need to be\n    // compatible with node 4\n    \"comma-dangle\": 0\n  }\n}\n"
  },
  {
    "path": "RNTester/README.md",
    "content": "# RNTester\n\nThe RNTester showcases React Native views and modules.\n\n## Running this app\n\nBefore running the app, make sure you ran:\n\n    git clone https://github.com/facebook/react-native.git\n    cd react-native\n    npm install\n\n### Running on iOS\n\nMac OS and Xcode are required.\n\n- Open `RNTester/RNTester.xcodeproj` in Xcode\n- Hit the Run button\n\nSee [Running on device](https://facebook.github.io/react-native/docs/running-on-device.html) if you want to use a physical device.\n\n### Running on Android\n\nYou'll need to have all the [prerequisites](https://github.com/facebook/react-native/tree/master/ReactAndroid#prerequisites) (SDK, NDK) for Building React Native installed.\n\nStart an Android emulator ([Genymotion](https://www.genymotion.com) is recommended).\n\n    cd react-native\n    ./gradlew :RNTester:android:app:installDebug\n    ./scripts/packager.sh\n\n_Note: Building for the first time can take a while._\n\nOpen the RNTester app in your emulator.\n\nSee [Running on Device](https://facebook.github.io/react-native/docs/running-on-device.html) in case you want to use a physical device.\n\n### Running with Buck\n\nFollow the same setup as running with gradle.\n\nInstall Buck from [here](https://buckbuild.com/setup/install.html).\n\nRun the following commands from the react-native folder:\n\n    ./gradlew :ReactAndroid:packageReactNdkLibsForBuck\n    buck fetch rntester\n    buck install -r rntester\n    ./scripts/packager.sh\n\n_Note: The native libs are still built using gradle. Full build with buck is coming soon(tm)._\n\n## Built from source\n\nBuilding the app on both iOS and Android means building the React Native framework from source. This way you're running the latest native and JS code the way you see it in your clone of the github repo.\n\nThis is different from apps created using `react-native init` which have a dependency on a specific version of React Native JS and native code, declared in a `package.json` file (and `build.gradle` for Android apps).\n"
  },
  {
    "path": "RNTester/RNTester/AppDelegate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <AppKit/AppKit.h>\n\n@class RCTBridge;\n\n@interface AppDelegate : NSObject <NSApplicationDelegate, NSToolbarDelegate, NSWindowDelegate>\n\n@property (strong, nonatomic) NSWindow *window;\n@property (strong, nonatomic) NSArray<NSString *> *argv;\n@property (assign, nonatomic) Class<NSWindowRestoration> restorationClass;\n@property (nonatomic, readonly) RCTBridge *bridge;\n@property (strong, nonatomic) NSURL *sourceURL;\n\n@end\n"
  },
  {
    "path": "RNTester/RNTester/AppDelegate.m",
    "content": "/**\n * The examples provided by Facebook are for non-commercial testing and\n * evaluation purposes only.\n *\n * Facebook reserves all rights not expressly granted.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL\n * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#import \"AppDelegate.h\"\n#import <Cocoa/Cocoa.h>\n\n#import <React/RCTBridge.h>\n#import <React/RCTBundleURLProvider.h>\n#import <React/RCTJavaScriptLoader.h>\n#import <React/RCTLinkingManager.h>\n#import <React/RCTRootView.h>\n#import <React/RCTEventDispatcher.h>\n\n@interface AppDelegate() <RCTBridgeDelegate, NSSearchFieldDelegate>\n\n@end\n\n\n@implementation AppDelegate\n\n-(id)init\n{\n  if(self = [super init]) {\n\n    // -- Init Window\n    NSRect contentSize = NSMakeRect(200, 500, 1000, 500); \n\n    self.window = [[NSWindow alloc] initWithContentRect:contentSize\n                                              styleMask:NSTitledWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask | NSClosableWindowMask \n                                                backing:NSBackingStoreBuffered\n                                                  defer:NO];\n    NSWindowController *windowController = [[NSWindowController alloc] initWithWindow:self.window];\n\n    [[self window] setTitle:@\"RNTester\"];\n    [[self window] setTitleVisibility:NSWindowTitleHidden];\n    [windowController showWindow:self.window];\n\n    [windowController setShouldCascadeWindows:NO];\n    [windowController setWindowFrameAutosaveName:@\"RNTester\"];\n    [self setDefaultURL];\n\n    // -- Init Toolbar\n    NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:@\"mainToolbar\"];\n    [toolbar setDelegate:self];\n    [toolbar setSizeMode:NSToolbarSizeModeRegular];\n\n    [self.window setToolbar:toolbar];\n\n    // -- Init Menu\n    [self setUpMainMenu];\n  }\n  return self;\n}\n\n- (void)applicationDidFinishLaunching:(NSNotification * __unused)aNotification\n{\n\n  _bridge = [[RCTBridge alloc] initWithDelegate:self\n                                  launchOptions:@{@\"argv\": [self argv]}];\n\n  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:_bridge\n                                                   moduleName:@\"RNTesterApp\"\n                                            initialProperties:nil];\n\n\n\n  [self.window setContentView:rootView];\n}\n\n- (void)setDefaultURL\n{\n  _sourceURL = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"RNTester/js/RNTesterApp.macos\"\n                                                        fallbackResource:nil];\n}\n\n- (void)resetBridgeToDefault\n{\n  [self setDefaultURL];\n  [_bridge reload];\n}\n\n\n- (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge\n{\n  return _sourceURL;\n}\n\n- (void)loadSourceForBridge:(RCTBridge *)bridge\n                 onProgress:(RCTSourceLoadProgressBlock)onProgress\n                 onComplete:(RCTSourceLoadBlock)loadCallback\n{\n  [RCTJavaScriptLoader loadBundleAtURL:[self sourceURLForBridge:bridge]\n                            onProgress:onProgress\n                            onComplete:loadCallback];\n}\n\n- (NSArray *)toolbarAllowedItemIdentifiers:(__unused NSToolbar *)toolbar\n{\n  return @[NSToolbarFlexibleSpaceItemIdentifier, @\"searchBar\", NSToolbarFlexibleSpaceItemIdentifier, @\"resetButton\"];\n}\n\n- (NSArray *)toolbarDefaultItemIdentifiers:(__unused NSToolbar *)toolbar\n{\n  return @[NSToolbarFlexibleSpaceItemIdentifier, @\"searchBar\", NSToolbarFlexibleSpaceItemIdentifier, @\"resetButton\"];\n}\n\n- (NSToolbarItem *)toolbar:(NSToolbar * __unused)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL __unused)flag {\n\n  if ([itemIdentifier isEqualToString:@\"searchBar\"]) {\n    NSSearchField *searchField = [[NSSearchField alloc] init];\n    [searchField setFrameSize:NSMakeSize(400, searchField.intrinsicContentSize.height)];\n    [searchField setDelegate:self];\n    [searchField setRecentsAutosaveName:@\"mainSearchField\"];\n    [searchField setPlaceholderString:@\"Search Example\"];\n    [searchField setAction:@selector(searchURLorQuery:)];\n    NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier];\n    [item setView:searchField];\n    return item;\n  }\n\n  if ([itemIdentifier isEqualToString:@\"resetButton\"]) {\n    NSButton *button = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 50, 33)];\n    [button setBezelStyle:NSRoundedBezelStyle];\n    [button setImage:[NSImage imageNamed:NSImageNameRefreshTemplate]];\n    [button setTarget:self];\n    [button setAction:@selector(resetBridgeToDefault)];\n    NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier];\n    [item setView:button];\n    [item setAction:@selector(resetBridgeToDefault)];\n\n    return item;\n  }\n  return nil;\n\n}\n\n- (IBAction)searchURLorQuery:(id)sender {\n  if ([[sender stringValue] containsString:@\"http\"]) {\n    _sourceURL =[NSURL URLWithString:[sender stringValue]];\n    _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil];\n    NSString * moduleName = [_sourceURL.lastPathComponent stringByReplacingOccurrencesOfString:@\".macos.bundle\" withString:@\"\"];\n    RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:_bridge\n                                                     moduleName:moduleName\n                                              initialProperties:nil];\n    [self.window setContentView:rootView];\n  } else {\n    [_bridge.eventDispatcher sendDeviceEventWithName:@\"onSearchExample\"\n                                                body:@{@\"query\": [sender stringValue]}\n     ];\n  }\n}\n\n- (void) setUpMainMenu\n{\n  NSMenu *mainMenu = [[NSMenu alloc] initWithTitle:@\"\" ];\n  NSMenuItem *containerItem = [[NSMenuItem alloc] init];\n  NSMenu *rootMenu = [[NSMenu alloc] initWithTitle:@\"\" ];\n  [containerItem setSubmenu:rootMenu];\n  [mainMenu addItem:containerItem];\n  [rootMenu addItemWithTitle:@\"Quit UIExplorer\" action:@selector(terminate:) keyEquivalent:@\"q\"];\n  [NSApp setMainMenu:mainMenu];\n\n  NSMenuItem *editItemContainer = [[NSMenuItem alloc] init];\n  NSMenu *editMenu = [[NSMenu alloc] initWithTitle:@\"Edit\"];\n  [editItemContainer setSubmenu:editMenu];\n  [editMenu setAutoenablesItems:NO];\n  [editMenu addItem:[self addEditMenuItem:@\"Undo\" action:@selector(undo) key:@\"z\" ]];\n  [editMenu addItem:[self addEditMenuItem:@\"Redo\" action:@selector(redo) key:@\"Z\" ]];\n  [editMenu addItem:[self addEditMenuItem:@\"Cut\" action:@selector(cut:) key:@\"x\" ]];\n  [editMenu addItem:[self addEditMenuItem:@\"Copy\" action:@selector(copy:) key:@\"c\" ]];\n  [editMenu addItem:[self addEditMenuItem:@\"Paste\" action:@selector(paste:) key:@\"v\" ]];\n  [editMenu addItem:[self addEditMenuItem:@\"SelectAll\" action:@selector(selectAll:) key:@\"a\" ]];\n  [[NSApp mainMenu] addItem:editItemContainer];\n}\n\n- (NSMenuItem *)addEditMenuItem:(NSString *)title\n                         action:(SEL _Nullable)action\n                            key:(NSString *)key\n{\n  NSMenuItem * menuItem = [[NSMenuItem alloc] init];\n  [menuItem setTitle:title];\n  [menuItem setEnabled:YES];\n  [menuItem setAction:action];\n  [menuItem setKeyEquivalent:key];\n  return menuItem;\n}\n\n- (void)undo\n{\n  [[[self window] undoManager] undo];\n}\n\n- (void)redo\n{\n  [[[self window] undoManager] redo];\n}\n\n- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication * __unused)theApplication {\n  return YES;\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTester/Base.lproj/LaunchScreen.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"12120\" systemVersion=\"16F73\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" colorMatched=\"YES\">\n    <device id=\"retina4_7\" orientation=\"portrait\">\n        <adaptation id=\"fullscreen\"/>\n    </device>\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"12088\"/>\n        <capability name=\"Constraints with non-1.0 multipliers\" minToolsVersion=\"5.1\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\"/>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"480\"/>\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n            <subviews>\n                <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"  Copyright (c) 2015 Facebook. All rights reserved.\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"9\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"8ie-xW-0ye\">\n                    <rect key=\"frame\" x=\"20\" y=\"439\" width=\"441\" height=\"21\"/>\n                    <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                    <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"RNTester\" textAlignment=\"center\" lineBreakMode=\"middleTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"18\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"kId-c2-rCX\">\n                    <rect key=\"frame\" x=\"20\" y=\"140\" width=\"441\" height=\"43\"/>\n                    <fontDescription key=\"fontDescription\" type=\"boldSystem\" pointSize=\"36\"/>\n                    <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n            </subviews>\n            <color key=\"backgroundColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n            <constraints>\n                <constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"centerY\" secondItem=\"iN0-l3-epB\" secondAttribute=\"bottom\" multiplier=\"1/3\" constant=\"1\" id=\"5cJ-9S-tgC\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"kId-c2-rCX\" secondAttribute=\"centerX\" id=\"Koa-jz-hwk\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"bottom\" constant=\"20\" id=\"Kzo-t9-V3l\"/>\n                <constraint firstItem=\"8ie-xW-0ye\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"MfP-vx-nX0\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"centerX\" id=\"ZEH-qu-HZ9\"/>\n                <constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"fvb-Df-36g\"/>\n            </constraints>\n            <nil key=\"simulatedStatusBarMetrics\"/>\n            <freeformSimulatedSizeMetrics key=\"simulatedDestinationMetrics\"/>\n            <point key=\"canvasLocation\" x=\"548\" y=\"455\"/>\n        </view>\n    </objects>\n</document>\n"
  },
  {
    "path": "RNTester/RNTester/Images.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"16x16\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"16x16\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"32x32\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"32x32\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"128x128\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"128x128\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"256x256\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"256x256\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"512x512\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"512x512\",\n      \"scale\" : \"2x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "RNTester/RNTester/Images.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "RNTester/RNTester/Images.xcassets/NavBarButtonPlus.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"NavBarButtonPlus@3x.png\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "RNTester/RNTester/Images.xcassets/story-background.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\",\n      \"filename\" : \"story-background@2x.png\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "RNTester/RNTester/Images.xcassets/tabnav_list.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\",\n      \"filename\" : \"tabnav_list@3x.png\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "RNTester/RNTester/Images.xcassets/tabnav_notification.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\",\n      \"filename\" : \"tabnav_notification@3x.png\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "RNTester/RNTester/Images.xcassets/tabnav_settings.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\",\n      \"filename\" : \"tabnav_settings@3x.png\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "RNTester/RNTester/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIconFile</key>\n\t<string></string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSApplicationCategoryType</key>\n\t<string></string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>$(MACOSX_DEPLOYMENT_TARGET)</string>\n\t<key>NSAppTransportSecurity</key>\n\t<dict>\n\t\t<key>NSAllowsArbitraryLoads</key>\n\t\t<true/>\n\t</dict>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>Copyright © 2015 Facebook. All rights reserved.</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "RNTester/RNTester/NativeExampleViews/FlexibleSizeExampleView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTView.h>\n\n@interface FlexibleSizeExampleView : RCTView\n\n@end\n"
  },
  {
    "path": "RNTester/RNTester/NativeExampleViews/FlexibleSizeExampleView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import \"FlexibleSizeExampleView.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTRootView.h>\n#import <React/RCTRootViewDelegate.h>\n#import <React/RCTViewManager.h>\n\n#import \"AppDelegate.h\"\n\n@interface FlexibleSizeExampleViewManager : RCTViewManager\n\n@end\n\n@implementation FlexibleSizeExampleViewManager\n\nRCT_EXPORT_MODULE();\n\n- (NSView *)view\n{\n  return [FlexibleSizeExampleView new];\n}\n\n@end\n\n\n@interface FlexibleSizeExampleView () <RCTRootViewDelegate>\n\n@end\n\n\n@implementation FlexibleSizeExampleView\n{\n  RCTRootView *_resizableRootView;\n  NSTextView *_currentSizeTextView;\n  BOOL _sizeUpdated;\n}\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if ((self = [super initWithFrame:frame])) {\n    _sizeUpdated = NO;\n\n    AppDelegate *appDelegate = (AppDelegate*)[NSApplication sharedApplication].delegate;\n\n    _resizableRootView = [[RCTRootView alloc] initWithBridge:appDelegate.bridge\n                                                  moduleName:@\"RootViewSizeFlexibilityExampleApp\"\n                                           initialProperties:@{}];\n\n    [_resizableRootView setSizeFlexibility:RCTRootViewSizeFlexibilityHeight];\n\n    _currentSizeTextView = [NSTextView new];\n    _currentSizeTextView.editable = NO;\n    [_currentSizeTextView setString:@\"Resizable view has not been resized yet\"];\n    _currentSizeTextView.textColor = [NSColor blackColor];\n    _currentSizeTextView.backgroundColor = [NSColor whiteColor];\n    _currentSizeTextView.font = [NSFont boldSystemFontOfSize:10];\n\n    _resizableRootView.delegate = self;\n\n    [self addSubview:_currentSizeTextView];\n    [self addSubview:_resizableRootView];\n  }\n  return self;\n}\n\n- (void)layoutSubviews\n{\n  float textViewHeight = 60;\n  float spacingHeight = 10;\n  [_resizableRootView setFrame:CGRectMake(0, textViewHeight + spacingHeight, self.frame.size.width, _resizableRootView.frame.size.height)];\n  [_currentSizeTextView setFrame:CGRectMake(0, 0, self.frame.size.width, textViewHeight)];\n}\n\n\n- (NSArray<NSView<RCTComponent> *> *)reactSubviews\n{\n  // this is to avoid unregistering our RCTRootView when the component is removed from RN hierarchy\n  (void)[super reactSubviews];\n  return @[];\n}\n\n\n#pragma mark - RCTRootViewDelegate\n\n- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView\n{\n  CGRect newFrame = rootView.frame;\n  newFrame.size = rootView.intrinsicContentSize;\n\n  if (!_sizeUpdated) {\n    _sizeUpdated = TRUE;\n    _currentSizeTextView.string = [NSString stringWithFormat:@\"RCTRootViewDelegate: content with initially unknown size has appeared, updating root view's size so the content fits.\"];\n\n  } else {\n    _currentSizeTextView.string = [NSString stringWithFormat:@\"RCTRootViewDelegate: content size has been changed to (%ld, %ld), updating root view's size.\",\n                                 (long)newFrame.size.width,\n                                 (long)newFrame.size.height];\n\n  }\n\n  rootView.frame = newFrame;\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTester/NativeExampleViews/UpdatePropertiesExampleView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTView.h>\n\n@interface UpdatePropertiesExampleView : RCTView\n\n@end\n"
  },
  {
    "path": "RNTester/RNTester/NativeExampleViews/UpdatePropertiesExampleView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import \"UpdatePropertiesExampleView.h\"\n\n#import <React/RCTRootView.h>\n#import <React/RCTViewManager.h>\n\n#import \"AppDelegate.h\"\n\n@interface UpdatePropertiesExampleViewManager : RCTViewManager\n\n@end\n\n@implementation UpdatePropertiesExampleViewManager\n\nRCT_EXPORT_MODULE();\n\n- (NSView *)view\n{\n  return [UpdatePropertiesExampleView new];\n}\n\n@end\n\n@implementation UpdatePropertiesExampleView\n{\n  RCTRootView *_rootView;\n  NSButton *_button;\n  BOOL _beige;\n}\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  self = [super initWithFrame:frame];\n  if (self) {\n    _beige = YES;\n\n    AppDelegate *appDelegate = (AppDelegate *)[[NSApplication sharedApplication] delegate];\n\n    _rootView = [[RCTRootView alloc] initWithBridge:appDelegate.bridge\n                                         moduleName:@\"SetPropertiesExampleApp\"\n                                  initialProperties:@{@\"color\":@\"beige\"}];\n\n    _button = [[NSButton alloc] init];\n    [_button setTitle:@\"Native Button\" ];\n    //[_button setT:[NSColor whiteColor]];\n    //[_button setBackgroundColor:[NSColor grayColor]];\n\n    [_button setTarget:self];\n    [_button setAction:@selector(changeColor)];\n\n\n    [self addSubview:_button];\n    [self addSubview:_rootView];\n  }\n  return self;\n}\n\n- (void)layoutSubviews\n{\n  float spaceHeight = 20;\n  float buttonHeight = 40;\n  float rootViewWidth = self.bounds.size.width;\n  float rootViewHeight = self.bounds.size.height - spaceHeight - buttonHeight;\n\n  [_rootView setFrame:CGRectMake(0, 0, rootViewWidth, rootViewHeight)];\n  [_button setFrame:CGRectMake(0, rootViewHeight + spaceHeight, rootViewWidth, buttonHeight)];\n}\n\n- (void)changeColor\n{\n  _beige = !_beige;\n  [_rootView setAppProperties:@{@\"color\":_beige ? @\"beige\" : @\"purple\"}];\n}\n\n- (NSArray<NSView<RCTComponent> *> *)reactSubviews\n{\n  // this is to avoid unregistering our RCTRootView when the component is removed from RN hierarchy\n  (void)[super reactSubviews];\n  return @[];\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTester/RNTesterBundle/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>Copyright © 2016 Facebook. All rights reserved.</string>\n\t<key>NSPrincipalClass</key>\n\t<string></string>\n</dict>\n</plist>\n"
  },
  {
    "path": "RNTester/RNTester/RNTesterBundle/OtherImages.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "RNTester/RNTester/RNTesterBundle/OtherImages.xcassets/ImageInAssetCatalog.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"react-logo.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "RNTester/RNTester/main.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <AppKit/AppKit.h>\n\n#import \"AppDelegate.h\"\n\nint main(__unused int argc, char* argv[]) {\n  @autoreleasepool {\n    NSApplication * application = [NSApplication sharedApplication];\n    NSMenu *mainMenu = [[NSMenu alloc] initWithTitle:@\"Application\"];\n    [NSApp setMainMenu:mainMenu];\n    AppDelegate * appDelegate = [[AppDelegate alloc] init];\n    [application setDelegate:appDelegate];\n    if (argc > 1) {\n      NSMutableArray *argvArray = [[NSMutableArray alloc] init];\n      for (int i = 1; i < argc; i++) {\n        [argvArray addObject:[[NSString alloc] initWithUTF8String:argv[i]]];\n      }\n      [appDelegate setArgv:argvArray];\n    } else {\n      [appDelegate setArgv:[[NSArray alloc] init]];\n    }\n    \n    [application run];\n    return EXIT_SUCCESS;\n  }\n}\n"
  },
  {
    "path": "RNTester/RNTester-tvOS/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>NSAppTransportSecurity</key>\n\t<dict>\n\t\t<key>NSAllowsArbitraryLoads</key>\n\t\t<true/>\n\t</dict>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>arm64</string>\n\t</array>\n\t<key>UIUserInterfaceStyle</key>\n\t<string>Automatic</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "RNTester/RNTester.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t001BFCE41D838343008E587E /* RCTMultipartStreamReaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */; };\n\t\t1300627F1B59179B0043FE5A /* RCTGzipTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1300627E1B59179B0043FE5A /* RCTGzipTests.m */; };\n\t\t13129DD41C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */; };\n\t\t13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FE81AA91428003F314A /* libRCTImage.a */; };\n\t\t134180011AA9153C003F314A /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FEF1AA914B8003F314A /* libRCTText.a */; };\n\t\t1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1341802B1AA91779003F314A /* libRCTNetwork.a */; };\n\t\t134CB92A1C85A38800265FA6 /* RCTModuleInitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 134CB9291C85A38800265FA6 /* RCTModuleInitTests.m */; };\n\t\t138D6A181B53CD440074A87E /* RCTShadowViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 138D6A161B53CD440074A87E /* RCTShadowViewTests.m */; };\n\t\t139FDEDB1B0651FB00C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDED91B0651EA00C62182 /* libRCTWebSocket.a */; };\n\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n\t\t13B6C1A31C34225900D3FAF5 /* RCTURLUtilsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B6C1A21C34225900D3FAF5 /* RCTURLUtilsTests.m */; };\n\t\t13BCE84F1C9C209600DD7AAD /* RCTComponentPropsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BCE84E1C9C209600DD7AAD /* RCTComponentPropsTests.m */; };\n\t\t13DB03481B5D2ED500C27245 /* RCTJSONTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DB03471B5D2ED500C27245 /* RCTJSONTests.m */; };\n\t\t13DF61B61B67A45000EDB188 /* RCTMethodArgumentTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DF61B51B67A45000EDB188 /* RCTMethodArgumentTests.m */; };\n\t\t143BC5A11B21E45C00462512 /* RNTesterSnapshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 143BC5A01B21E45C00462512 /* RNTesterSnapshotTests.m */; };\n\t\t144D21241B2204C5006DB32B /* RCTImageUtilTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 144D21231B2204C5006DB32B /* RCTImageUtilTests.m */; };\n\t\t1497CFAC1B21F5E400C1F8F2 /* RCTAllocationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */; };\n\t\t1497CFAF1B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */; };\n\t\t1497CFB01B21F5E400C1F8F2 /* RCTFontTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA81B21F5E400C1F8F2 /* RCTFontTests.m */; };\n\t\t1497CFB11B21F5E400C1F8F2 /* RCTEventDispatcherTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */; };\n\t\t1497CFB31B21F5E400C1F8F2 /* RCTUIManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFAB1B21F5E400C1F8F2 /* RCTUIManagerTests.m */; };\n\t\t14AADF051AC3DBB1002390C9 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14AADF041AC3DB95002390C9 /* libReact.a */; };\n\t\t14B6DA821B276C5900BF4DD1 /* libRCTTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58005BEE1ABA80530062E044 /* libRCTTest.a */; };\n\t\t14D6D7111B220EB3001FB087 /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14D6D7101B220EB3001FB087 /* libOCMock.a */; };\n\t\t14D6D7211B2222EF001FB087 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FE81AA91428003F314A /* libRCTImage.a */; };\n\t\t14D6D7221B2222EF001FB087 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1341802B1AA91779003F314A /* libRCTNetwork.a */; };\n\t\t14D6D7251B2222EF001FB087 /* libRCTTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58005BEE1ABA80530062E044 /* libRCTTest.a */; };\n\t\t14D6D7261B2222EF001FB087 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FEF1AA914B8003F314A /* libRCTText.a */; };\n\t\t14D6D7281B2222EF001FB087 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDED91B0651EA00C62182 /* libRCTWebSocket.a */; };\n\t\t14D6D7291B2222EF001FB087 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14AADF041AC3DB95002390C9 /* libReact.a */; };\n\t\t192F69B81E82409A008692C7 /* RCTAnimationUtilsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 192F69B51E82409A008692C7 /* RCTAnimationUtilsTests.m */; };\n\t\t192F69B91E82409A008692C7 /* RCTConvert_YGValueTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 192F69B61E82409A008692C7 /* RCTConvert_YGValueTests.m */; };\n\t\t192F69BA1E82409A008692C7 /* RCTNativeAnimatedNodesManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 192F69B71E82409A008692C7 /* RCTNativeAnimatedNodesManagerTests.m */; };\n\t\t272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; };\n\t\t27B885561BED29AF00008352 /* RCTRootViewIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */; };\n\t\t27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; };\n\t\t2D4624FA1DA2EAC300C74D09 /* RCTLoggingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */; };\n\t\t2D4624FB1DA2EAC300C74D09 /* RCTRootViewIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */; };\n\t\t2D4624FC1DA2EAC300C74D09 /* RNTesterIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DB99D0B1BA0340600302749 /* RNTesterIntegrationTests.m */; };\n\t\t2D4624FD1DA2EAC300C74D09 /* RNTesterSnapshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 143BC5A01B21E45C00462512 /* RNTesterSnapshotTests.m */; };\n\t\t2D4624FE1DA2EAC300C74D09 /* RCTUIManagerScenarioTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 83636F8E1B53F22C009F943E /* RCTUIManagerScenarioTests.m */; };\n\t\t2D4625351DA2EBBE00C74D09 /* libRCTTest-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323CC1DA2DD8B000FE1B8 /* libRCTTest-tvOS.a */; };\n\t\t2D4BD8D21DA2E20D005AC8A8 /* RCTURLUtilsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B6C1A21C34225900D3FAF5 /* RCTURLUtilsTests.m */; };\n\t\t2D4BD8D31DA2E20D005AC8A8 /* RCTBundleURLProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FF44371CF6111500720EFD /* RCTBundleURLProviderTests.m */; };\n\t\t2D4BD8D41DA2E20D005AC8A8 /* RCTAllocationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */; };\n\t\t2D4BD8D71DA2E20D005AC8A8 /* RCTConvert_NSURLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */; };\n\t\t2D4BD8D81DA2E20D005AC8A8 /* RCTFontTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA81B21F5E400C1F8F2 /* RCTFontTests.m */; };\n\t\t2D4BD8D91DA2E20D005AC8A8 /* RCTEventDispatcherTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */; };\n\t\t2D4BD8DA1DA2E20D005AC8A8 /* RCTGzipTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1300627E1B59179B0043FE5A /* RCTGzipTests.m */; };\n\t\t2D4BD8DB1DA2E20D005AC8A8 /* RCTImageLoaderHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */; };\n\t\t2D4BD8DC1DA2E20D005AC8A8 /* RCTImageLoaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8385CEF41B873B5C00C6273E /* RCTImageLoaderTests.m */; };\n\t\t2D4BD8DD1DA2E20D005AC8A8 /* RCTImageUtilTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 144D21231B2204C5006DB32B /* RCTImageUtilTests.m */; };\n\t\t2D4BD8DE1DA2E20D005AC8A8 /* RCTJSONTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DB03471B5D2ED500C27245 /* RCTJSONTests.m */; };\n\t\t2D4BD8DF1DA2E20D005AC8A8 /* RCTMethodArgumentTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DF61B51B67A45000EDB188 /* RCTMethodArgumentTests.m */; };\n\t\t2D4BD8E01DA2E20D005AC8A8 /* RCTModuleInitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 134CB9291C85A38800265FA6 /* RCTModuleInitTests.m */; };\n\t\t2D4BD8E11DA2E20D005AC8A8 /* RCTModuleInitNotificationRaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */; };\n\t\t2D4BD8E31DA2E20D005AC8A8 /* RCTShadowViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 138D6A161B53CD440074A87E /* RCTShadowViewTests.m */; };\n\t\t2D4BD8E41DA2E20D005AC8A8 /* RCTUIManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFAB1B21F5E400C1F8F2 /* RCTUIManagerTests.m */; };\n\t\t2D4BD8E51DA2E20D005AC8A8 /* RCTComponentPropsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BCE84E1C9C209600DD7AAD /* RCTComponentPropsTests.m */; };\n\t\t2D4BD8E61DA2E20D005AC8A8 /* RNTesterUnitTestsBundle.js in Resources */ = {isa = PBXBuildFile; fileRef = 3DD981D51D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js */; };\n\t\t2D4BD8E71DA2E20D005AC8A8 /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14D6D7101B220EB3001FB087 /* libOCMock.a */; };\n\t\t2D8C2E321DA40403000EE098 /* RCTMultipartStreamReaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */; };\n\t\t2DD323DC1DA2DDBF000FE1B8 /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; };\n\t\t2DD323DD1DA2DDBF000FE1B8 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; };\n\t\t2DD323DE1DA2DDBF000FE1B8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n\t\t2DD323DF1DA2DDBF000FE1B8 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t2DD323E01DA2DDBF000FE1B8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n\t\t2DD323E11DA2DDBF000FE1B8 /* legacy_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */; };\n\t\t2DD323E21DA2DDBF000FE1B8 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB61A68108700A75B9A /* Info.plist */; };\n\t\t2DD323E51DA2DE3F000FE1B8 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323BF1DA2DD8B000FE1B8 /* libRCTLinking-tvOS.a */; };\n\t\t2DD323E61DA2DE3F000FE1B8 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323C31DA2DD8B000FE1B8 /* libRCTNetwork-tvOS.a */; };\n\t\t2DD323E71DA2DE3F000FE1B8 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323C81DA2DD8B000FE1B8 /* libRCTSettings-tvOS.a */; };\n\t\t2DD323E81DA2DE3F000FE1B8 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323D01DA2DD8B000FE1B8 /* libRCTText-tvOS.a */; };\n\t\t2DD323E91DA2DE3F000FE1B8 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323D51DA2DD8B000FE1B8 /* libRCTWebSocket-tvOS.a */; };\n\t\t2DD323EA1DA2DE3F000FE1B8 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323D91DA2DD8B000FE1B8 /* libReact.a */; };\n\t\t39AA31A41DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 39AA31A31DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m */; };\n\t\t3D05746D1DE6008900184BB4 /* (null) in Frameworks */ = {isa = PBXBuildFile; };\n\t\t3D13F8481D6F6AF900E69E0E /* ImageInBundle.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F8441D6F6AF200E69E0E /* ImageInBundle.png */; };\n\t\t3D13F84A1D6F6AFD00E69E0E /* OtherImages.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F8451D6F6AF200E69E0E /* OtherImages.xcassets */; };\n\t\t3D299BAF1D33EBFA00FA1057 /* RCTLoggingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */; };\n\t\t3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */; };\n\t\t3D302F221DF8285100D6DDAE /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323BB1DA2DD8B000FE1B8 /* libRCTImage-tvOS.a */; };\n\t\t3D56F9F11D6F6E9B00F53A06 /* RNTesterBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F83E1D6F6AE000E69E0E /* RNTesterBundle.bundle */; };\n\t\t3DB99D0C1BA0340600302749 /* RNTesterIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DB99D0B1BA0340600302749 /* RNTesterIntegrationTests.m */; };\n\t\t3DD981D61D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js in Resources */ = {isa = PBXBuildFile; fileRef = 3DD981D51D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js */; };\n\t\t68FF44381CF6111500720EFD /* RCTBundleURLProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FF44371CF6111500720EFD /* RCTBundleURLProviderTests.m */; };\n\t\t83636F8F1B53F22C009F943E /* RCTUIManagerScenarioTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 83636F8E1B53F22C009F943E /* RCTUIManagerScenarioTests.m */; };\n\t\t8385CEF51B873B5C00C6273E /* RCTImageLoaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8385CEF41B873B5C00C6273E /* RCTImageLoaderTests.m */; };\n\t\t8385CF041B87479200C6273E /* RCTImageLoaderHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */; };\n\t\tBC9C03401DC9F1D600B1C635 /* RCTDevMenuTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9C033F1DC9F1D600B1C635 /* RCTDevMenuTests.m */; };\n\t\tC654F0B31EB34A73000B7A9A /* RNTesterTestModule.m in Sources */ = {isa = PBXBuildFile; fileRef = C654F0B21EB34A73000B7A9A /* RNTesterTestModule.m */; };\n\t\tC654F17E1EB34D24000B7A9A /* RNTesterTestModule.m in Sources */ = {isa = PBXBuildFile; fileRef = C654F0B21EB34A73000B7A9A /* RNTesterTestModule.m */; };\n\t\tD44BE24B1EC741D7007E8CF4 /* libART.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 034675011CEF5D59009A625D /* libART.a */; };\n\t\tD44BE26A1EC741E4007E8CF4 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D44BE2511EC741D7007E8CF4 /* libRCTLinking.a */; };\n\t\tD44BE27D1EC775F6007E8CF4 /* libcxxreact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D05748C1DE6008900184BB4 /* libcxxreact.a */; };\n\t\tD48573601EDC4D07005C4623 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D48BABFB1ED8712100616092 /* libRCTAnimation.a */; };\n\t\tD4946EA61EE42870005FD93C /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D48BABFB1ED8712100616092 /* libRCTAnimation.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t034675001CEF5D59009A625D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 034674FC1CEF5D59009A625D /* ART.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 0CF68AC11AF0540F00FF9E5C;\n\t\t\tremoteInfo = ART;\n\t\t};\n\t\t035D95A71C9352CC00B095A8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 13B07F861A680F5B00A75B9A;\n\t\t\tremoteInfo = RNTester;\n\t\t};\n\t\t13417FE71AA91428003F314A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5115D1A9E6B3D00147676;\n\t\t\tremoteInfo = RCTImage;\n\t\t};\n\t\t13417FEE1AA914B8003F314A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5119B1A9E6C1200147676;\n\t\t\tremoteInfo = RCTText;\n\t\t};\n\t\t1341802A1AA91779003F314A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 134180261AA91779003F314A /* RCTNetwork.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B511DB1A9E6C8500147676;\n\t\t\tremoteInfo = RCTNetwork;\n\t\t};\n\t\t139FDED81B0651EA00C62182 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3C86DF461ADF2C930047B81A;\n\t\t\tremoteInfo = RCTWebSocket;\n\t\t};\n\t\t143BC59B1B21E3E100462512 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 13B07F861A680F5B00A75B9A;\n\t\t\tremoteInfo = RNTester;\n\t\t};\n\t\t14AADF031AC3DB95002390C9 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;\n\t\t\tremoteInfo = React;\n\t\t};\n\t\t2D4624C31DA2EA6900C74D09 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 2DD3238F1DA2DD8A000FE1B8;\n\t\t\tremoteInfo = \"RNTester-tvOS\";\n\t\t};\n\t\t2DD323A61DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 2DD3238F1DA2DD8A000FE1B8;\n\t\t\tremoteInfo = \"RNTester-tvOS\";\n\t\t};\n\t\t2DD323BA1DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A283A1D9B042B00D4039D;\n\t\t\tremoteInfo = \"RCTImage-tvOS\";\n\t\t};\n\t\t2DD323C21DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 134180261AA91779003F314A /* RCTNetwork.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28541D9B044C00D4039D;\n\t\t\tremoteInfo = \"RCTNetwork-tvOS\";\n\t\t};\n\t\t2DD323C71DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13CC9D481AEED2B90020D1C2 /* RCTSettings.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28611D9B046600D4039D;\n\t\t\tremoteInfo = \"RCTSettings-tvOS\";\n\t\t};\n\t\t2DD323CB1DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 58005BE41ABA80530062E044 /* RCTTest.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A286E1D9B047700D4039D;\n\t\t\tremoteInfo = \"RCTTest-tvOS\";\n\t\t};\n\t\t2DD323CF1DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A287B1D9B048500D4039D;\n\t\t\tremoteInfo = \"RCTText-tvOS\";\n\t\t};\n\t\t2DD323D41DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28881D9B049200D4039D;\n\t\t\tremoteInfo = \"RCTWebSocket-tvOS\";\n\t\t};\n\t\t2DD323D81DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28131D9B038B00D4039D;\n\t\t\tremoteInfo = \"React-tvOS\";\n\t\t};\n\t\t3D05748B1DE6008900184BB4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4;\n\t\t\tremoteInfo = cxxreact;\n\t\t};\n\t\t3D05748D1DE6008900184BB4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;\n\t\t\tremoteInfo = \"cxxreact-tvOS\";\n\t\t};\n\t\t3D05748F1DE6008900184BB4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4;\n\t\t\tremoteInfo = jschelpers;\n\t\t};\n\t\t3D0574911DE6008900184BB4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;\n\t\t\tremoteInfo = \"jschelpers-tvOS\";\n\t\t};\n\t\t3D13F84B1D6F6B5F00E69E0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D13F83D1D6F6AE000E69E0E;\n\t\t\tremoteInfo = RNTesterBundle;\n\t\t};\n\t\t3D3C08801DE3424E00C268FA /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3C059A1DE3340900C268FA;\n\t\t\tremoteInfo = yoga;\n\t\t};\n\t\t3D3C08821DE3424E00C268FA /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3C06751DE3340C00C268FA;\n\t\t\tremoteInfo = \"yoga-tvOS\";\n\t\t};\n\t\t3D507F411EBC88B700B56834 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 139D7ECE1E25DB7D00323FB7;\n\t\t\tremoteInfo = \"third-party\";\n\t\t};\n\t\t3D507F431EBC88B700B56834 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 139D7E881E25C6D100323FB7;\n\t\t\tremoteInfo = \"double-conversion\";\n\t\t};\n\t\t58005BED1ABA80530062E044 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 58005BE41ABA80530062E044 /* RCTTest.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 580C376F1AB104AF0015E709;\n\t\t\tremoteInfo = RCTTest;\n\t\t};\n\t\tD44BE2491EC741D7007E8CF4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 034674FC1CEF5D59009A625D /* ART.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 323A12871E5F266B004975B8;\n\t\t\tremoteInfo = \"ART-tvOS\";\n\t\t};\n\t\tD44BE2501EC741D7007E8CF4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 031465011CAA6DF30005E5B6 /* RCTLinking.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTLinking;\n\t\t};\n\t\tD44BE2521EC741D7007E8CF4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 031465011CAA6DF30005E5B6 /* RCTLinking.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28471D9B043800D4039D;\n\t\t\tremoteInfo = \"RCTLinking-tvOS\";\n\t\t};\n\t\tD44BE2581EC741D7007E8CF4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13CC9D481AEED2B90020D1C2 /* RCTSettings.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTSettings;\n\t\t};\n\t\tD48BABFA1ED8712100616092 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = D48BABF31ED8712000616092 /* RCTAnimation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTAnimation;\n\t\t};\n\t\tD48BABFC1ED8712100616092 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = D48BABF31ED8712000616092 /* RCTAnimation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28201D9B03D100D4039D;\n\t\t\tremoteInfo = \"RCTAnimation-tvOS\";\n\t\t};\n\t\tD4EEE2B3201DE86200C4CBB6 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3DBE0D001F3B181A0099AA32;\n\t\t\tremoteInfo = fishhook;\n\t\t};\n\t\tD4EEE2B5201DE86200C4CBB6 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;\n\t\t\tremoteInfo = \"fishhook-tvOS\";\n\t\t};\n\t\tD4EEE2E5201DEB2300C4CBB6 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = EBF21BDC1FC498900052F4D5;\n\t\t\tremoteInfo = jsinspector;\n\t\t};\n\t\tD4EEE2E7201DEB2300C4CBB6 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = EBF21BFA1FC4989A0052F4D5;\n\t\t\tremoteInfo = \"jsinspector-tvOS\";\n\t\t};\n\t\tD4EEE2E9201DEB2300C4CBB6 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D383D3C1EBD27B6005632C8;\n\t\t\tremoteInfo = \"third-party-tvOS\";\n\t\t};\n\t\tD4EEE2EB201DEB2300C4CBB6 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D383D621EBD27B9005632C8;\n\t\t\tremoteInfo = \"double-conversion-tvOS\";\n\t\t};\n\t\tD4EEE2ED201DEB2300C4CBB6 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 9936F3131F5F2E4B0010BF04;\n\t\t\tremoteInfo = privatedata;\n\t\t};\n\t\tD4EEE2EF201DEB2300C4CBB6 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 9936F32F1F5F2E5B0010BF04;\n\t\t\tremoteInfo = \"privatedata-tvOS\";\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMultipartStreamReaderTests.m; sourceTree = \"<group>\"; };\n\t\t004D289E1AAF61C70097A701 /* RNTesterUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNTesterUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t031465011CAA6DF30005E5B6 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTLinking.xcodeproj; path = ../Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = \"<group>\"; };\n\t\t034674FC1CEF5D59009A625D /* ART.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = ART.xcodeproj; path = ../Libraries/ART/ART.xcodeproj; sourceTree = \"<group>\"; };\n\t\t1300627E1B59179B0043FE5A /* RCTGzipTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTGzipTests.m; sourceTree = \"<group>\"; };\n\t\t13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModuleInitNotificationRaceTests.m; sourceTree = \"<group>\"; };\n\t\t13417FE31AA91428003F314A /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTImage.xcodeproj; path = ../Libraries/Image/RCTImage.xcodeproj; sourceTree = \"<group>\"; };\n\t\t13417FEA1AA914B8003F314A /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTText.xcodeproj; path = ../Libraries/Text/RCTText.xcodeproj; sourceTree = \"<group>\"; };\n\t\t134180261AA91779003F314A /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTNetwork.xcodeproj; path = ../Libraries/Network/RCTNetwork.xcodeproj; sourceTree = \"<group>\"; };\n\t\t134CB9291C85A38800265FA6 /* RCTModuleInitTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModuleInitTests.m; sourceTree = \"<group>\"; };\n\t\t138D6A161B53CD440074A87E /* RCTShadowViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTShadowViewTests.m; sourceTree = \"<group>\"; };\n\t\t139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTWebSocket.xcodeproj; path = ../Libraries/WebSocket/RCTWebSocket.xcodeproj; sourceTree = \"<group>\"; };\n\t\t13B07F961A680F5B00A75B9A /* RNTester.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNTester.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNTester/AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = RNTester/AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNTester/Images.xcassets; sourceTree = \"<group>\"; };\n\t\t13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNTester/Info.plist; sourceTree = \"<group>\"; };\n\t\t13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = RNTester/main.m; sourceTree = \"<group>\"; };\n\t\t13B6C1A21C34225900D3FAF5 /* RCTURLUtilsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTURLUtilsTests.m; sourceTree = \"<group>\"; };\n\t\t13BCE84E1C9C209600DD7AAD /* RCTComponentPropsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTComponentPropsTests.m; sourceTree = \"<group>\"; };\n\t\t13CC9D481AEED2B90020D1C2 /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTSettings.xcodeproj; path = ../Libraries/Settings/RCTSettings.xcodeproj; sourceTree = \"<group>\"; };\n\t\t13DB03471B5D2ED500C27245 /* RCTJSONTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJSONTests.m; sourceTree = \"<group>\"; };\n\t\t13DF61B51B67A45000EDB188 /* RCTMethodArgumentTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMethodArgumentTests.m; sourceTree = \"<group>\"; };\n\t\t143BC57E1B21E18100462512 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t143BC5951B21E3E100462512 /* RNTesterIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNTesterIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t143BC5981B21E3E100462512 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t143BC5A01B21E45C00462512 /* RNTesterSnapshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterSnapshotTests.m; sourceTree = \"<group>\"; };\n\t\t144D21231B2204C5006DB32B /* RCTImageUtilTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageUtilTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAllocationTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert_NSURLTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFA81B21F5E400C1F8F2 /* RCTFontTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTFontTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTEventDispatcherTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFAB1B21F5E400C1F8F2 /* RCTUIManagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManagerTests.m; sourceTree = \"<group>\"; };\n\t\t14AADEFF1AC3DB95002390C9 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = React.xcodeproj; path = ../React/React.xcodeproj; sourceTree = \"<group>\"; };\n\t\t14D6D7021B220AE3001FB087 /* NSNotificationCenter+OCMAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"NSNotificationCenter+OCMAdditions.h\"; sourceTree = \"<group>\"; };\n\t\t14D6D7031B220AE3001FB087 /* OCMArg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMArg.h; sourceTree = \"<group>\"; };\n\t\t14D6D7041B220AE3001FB087 /* OCMConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMConstraint.h; sourceTree = \"<group>\"; };\n\t\t14D6D7051B220AE3001FB087 /* OCMLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMLocation.h; sourceTree = \"<group>\"; };\n\t\t14D6D7061B220AE3001FB087 /* OCMMacroState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMMacroState.h; sourceTree = \"<group>\"; };\n\t\t14D6D7071B220AE3001FB087 /* OCMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMock.h; sourceTree = \"<group>\"; };\n\t\t14D6D7081B220AE3001FB087 /* OCMockObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMockObject.h; sourceTree = \"<group>\"; };\n\t\t14D6D7091B220AE3001FB087 /* OCMRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMRecorder.h; sourceTree = \"<group>\"; };\n\t\t14D6D70A1B220AE3001FB087 /* OCMStubRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMStubRecorder.h; sourceTree = \"<group>\"; };\n\t\t14D6D7101B220EB3001FB087 /* libOCMock.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libOCMock.a; sourceTree = \"<group>\"; };\n\t\t192F69B51E82409A008692C7 /* RCTAnimationUtilsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAnimationUtilsTests.m; sourceTree = \"<group>\"; };\n\t\t192F69B61E82409A008692C7 /* RCTConvert_YGValueTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert_YGValueTests.m; sourceTree = \"<group>\"; };\n\t\t192F69B71E82409A008692C7 /* RCTNativeAnimatedNodesManagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNativeAnimatedNodesManagerTests.m; sourceTree = \"<group>\"; };\n\t\t272E6B3B1BEA849E001FCF37 /* UpdatePropertiesExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UpdatePropertiesExampleView.h; path = RNTester/NativeExampleViews/UpdatePropertiesExampleView.h; sourceTree = \"<group>\"; };\n\t\t272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UpdatePropertiesExampleView.m; path = RNTester/NativeExampleViews/UpdatePropertiesExampleView.m; sourceTree = \"<group>\"; };\n\t\t27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootViewIntegrationTests.m; sourceTree = \"<group>\"; };\n\t\t27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlexibleSizeExampleView.m; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.m; sourceTree = \"<group>\"; };\n\t\t27F441EA1BEBE5030039B79C /* FlexibleSizeExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlexibleSizeExampleView.h; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.h; sourceTree = \"<group>\"; };\n\t\t2D4624E01DA2EA6900C74D09 /* RNTester-tvOSIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = \"RNTester-tvOSIntegrationTests.xctest\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t2DD323901DA2DD8A000FE1B8 /* RNTester-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"RNTester-tvOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t2DD323A01DA2DD8B000FE1B8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t2DD323A51DA2DD8B000FE1B8 /* RNTester-tvOSUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = \"RNTester-tvOSUnitTests.xctest\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t39AA31A31DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUnicodeDecodeTests.m; sourceTree = \"<group>\"; };\n\t\t3D13F83E1D6F6AE000E69E0E /* RNTesterBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNTesterBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D13F8401D6F6AE000E69E0E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../Info.plist; sourceTree = \"<group>\"; };\n\t\t3D13F8441D6F6AF200E69E0E /* ImageInBundle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ImageInBundle.png; sourceTree = \"<group>\"; };\n\t\t3D13F8451D6F6AF200E69E0E /* OtherImages.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = OtherImages.xcassets; sourceTree = \"<group>\"; };\n\t\t3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLoggingTests.m; sourceTree = \"<group>\"; };\n\t\t3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = \"legacy_image@2x.png\"; path = \"RNTester/legacy_image@2x.png\"; sourceTree = \"<group>\"; };\n\t\t3DB99D0B1BA0340600302749 /* RNTesterIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterIntegrationTests.m; sourceTree = \"<group>\"; };\n\t\t3DD981D51D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = RNTesterUnitTestsBundle.js; sourceTree = \"<group>\"; };\n\t\t58005BE41ABA80530062E044 /* RCTTest.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTTest.xcodeproj; path = ../Libraries/RCTTest/RCTTest.xcodeproj; sourceTree = \"<group>\"; };\n\t\t68FF44371CF6111500720EFD /* RCTBundleURLProviderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBundleURLProviderTests.m; sourceTree = \"<group>\"; };\n\t\t83636F8E1B53F22C009F943E /* RCTUIManagerScenarioTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManagerScenarioTests.m; sourceTree = \"<group>\"; };\n\t\t8385CEF41B873B5C00C6273E /* RCTImageLoaderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoaderTests.m; sourceTree = \"<group>\"; };\n\t\t8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoaderHelpers.m; sourceTree = \"<group>\"; };\n\t\t8385CF051B8747A000C6273E /* RCTImageLoaderHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTImageLoaderHelpers.h; sourceTree = \"<group>\"; };\n\t\tBC9C033F1DC9F1D600B1C635 /* RCTDevMenuTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDevMenuTests.m; sourceTree = \"<group>\"; };\n\t\tC654F0B21EB34A73000B7A9A /* RNTesterTestModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterTestModule.m; sourceTree = \"<group>\"; };\n\t\tD44BE26C1EC741EB007E8CF4 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };\n\t\tD48BABF31ED8712000616092 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTAnimation.xcodeproj; path = ../Libraries/NativeAnimation/RCTAnimation.xcodeproj; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t004D289B1AAF61C70097A701 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tD4946EA61EE42870005FD93C /* libRCTAnimation.a in Frameworks */,\n\t\t\t\t14D6D7211B2222EF001FB087 /* libRCTImage.a in Frameworks */,\n\t\t\t\t14D6D7221B2222EF001FB087 /* libRCTNetwork.a in Frameworks */,\n\t\t\t\t14D6D7251B2222EF001FB087 /* libRCTTest.a in Frameworks */,\n\t\t\t\t14D6D7261B2222EF001FB087 /* libRCTText.a in Frameworks */,\n\t\t\t\t14D6D7281B2222EF001FB087 /* libRCTWebSocket.a in Frameworks */,\n\t\t\t\t14D6D7291B2222EF001FB087 /* libReact.a in Frameworks */,\n\t\t\t\t14D6D7111B220EB3001FB087 /* libOCMock.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tD48573601EDC4D07005C4623 /* libRCTAnimation.a in Frameworks */,\n\t\t\t\tD44BE27D1EC775F6007E8CF4 /* libcxxreact.a in Frameworks */,\n\t\t\t\tD44BE26A1EC741E4007E8CF4 /* libRCTLinking.a in Frameworks */,\n\t\t\t\tD44BE24B1EC741D7007E8CF4 /* libART.a in Frameworks */,\n\t\t\t\t14AADF051AC3DBB1002390C9 /* libReact.a in Frameworks */,\n\t\t\t\t1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */,\n\t\t\t\t13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */,\n\t\t\t\t134180011AA9153C003F314A /* libRCTText.a in Frameworks */,\n\t\t\t\t139FDEDB1B0651FB00C62182 /* libRCTWebSocket.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t143BC5921B21E3E100462512 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t14B6DA821B276C5900BF4DD1 /* libRCTTest.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D4624D91DA2EA6900C74D09 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D4625351DA2EBBE00C74D09 /* libRCTTest-tvOS.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD3238D1DA2DD8A000FE1B8 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2DD323EA1DA2DE3F000FE1B8 /* libReact.a in Frameworks */,\n\t\t\t\t3D302F221DF8285100D6DDAE /* libRCTImage-tvOS.a in Frameworks */,\n\t\t\t\t2DD323E51DA2DE3F000FE1B8 /* libRCTLinking-tvOS.a in Frameworks */,\n\t\t\t\t2DD323E61DA2DE3F000FE1B8 /* libRCTNetwork-tvOS.a in Frameworks */,\n\t\t\t\t3D05746D1DE6008900184BB4 /* (null) in Frameworks */,\n\t\t\t\t2DD323E71DA2DE3F000FE1B8 /* libRCTSettings-tvOS.a in Frameworks */,\n\t\t\t\t2DD323E81DA2DE3F000FE1B8 /* libRCTText-tvOS.a in Frameworks */,\n\t\t\t\t2DD323E91DA2DE3F000FE1B8 /* libRCTWebSocket-tvOS.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD323A21DA2DD8B000FE1B8 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D4BD8E71DA2E20D005AC8A8 /* libOCMock.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D13F83B1D6F6AE000E69E0E /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t031465021CAA6DF30005E5B6 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD44BE2511EC741D7007E8CF4 /* libRCTLinking.a */,\n\t\t\t\tD44BE2531EC741D7007E8CF4 /* libRCTLinking-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t034674FD1CEF5D59009A625D /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t034675011CEF5D59009A625D /* libART.a */,\n\t\t\t\tD44BE24A1EC741D7007E8CF4 /* libART-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1316A21D1AA397F400C0188E /* Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD48BABF31ED8712000616092 /* RCTAnimation.xcodeproj */,\n\t\t\t\t034674FC1CEF5D59009A625D /* ART.xcodeproj */,\n\t\t\t\t14AADEFF1AC3DB95002390C9 /* React.xcodeproj */,\n\t\t\t\t13417FE31AA91428003F314A /* RCTImage.xcodeproj */,\n\t\t\t\t031465011CAA6DF30005E5B6 /* RCTLinking.xcodeproj */,\n\t\t\t\t134180261AA91779003F314A /* RCTNetwork.xcodeproj */,\n\t\t\t\t13CC9D481AEED2B90020D1C2 /* RCTSettings.xcodeproj */,\n\t\t\t\t58005BE41ABA80530062E044 /* RCTTest.xcodeproj */,\n\t\t\t\t13417FEA1AA914B8003F314A /* RCTText.xcodeproj */,\n\t\t\t\t139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */,\n\t\t\t);\n\t\t\tname = Libraries;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1323F18D1C04ABAC0091BED0 /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */,\n\t\t\t\t13B07FB61A68108700A75B9A /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13417FE41AA91428003F314A /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13417FE81AA91428003F314A /* libRCTImage.a */,\n\t\t\t\t2DD323BB1DA2DD8B000FE1B8 /* libRCTImage-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13417FEB1AA914B8003F314A /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13417FEF1AA914B8003F314A /* libRCTText.a */,\n\t\t\t\t2DD323D01DA2DD8B000FE1B8 /* libRCTText-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t134180271AA91779003F314A /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1341802B1AA91779003F314A /* libRCTNetwork.a */,\n\t\t\t\t2DD323C31DA2DD8B000FE1B8 /* libRCTNetwork-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139FDECB1B0651EA00C62182 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139FDED91B0651EA00C62182 /* libRCTWebSocket.a */,\n\t\t\t\t2DD323D51DA2DD8B000FE1B8 /* libRCTWebSocket-tvOS.a */,\n\t\t\t\tD4EEE2B4201DE86200C4CBB6 /* libfishhook.a */,\n\t\t\t\tD4EEE2B6201DE86200C4CBB6 /* libfishhook-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13B07FAE1A68108700A75B9A /* RNTester */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t272E6B3A1BEA846C001FCF37 /* NativeExampleViews */,\n\t\t\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */,\n\t\t\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */,\n\t\t\t\t13B07FB51A68108700A75B9A /* Images.xcassets */,\n\t\t\t\t13B07FB71A68108700A75B9A /* main.m */,\n\t\t\t\t1323F18D1C04ABAC0091BED0 /* Supporting Files */,\n\t\t\t);\n\t\t\tname = RNTester;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t143BC57C1B21E18100462512 /* RNTesterUnitTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t192F69B51E82409A008692C7 /* RCTAnimationUtilsTests.m */,\n\t\t\t\t192F69B61E82409A008692C7 /* RCTConvert_YGValueTests.m */,\n\t\t\t\t192F69B71E82409A008692C7 /* RCTNativeAnimatedNodesManagerTests.m */,\n\t\t\t\t13B6C1A21C34225900D3FAF5 /* RCTURLUtilsTests.m */,\n\t\t\t\t68FF44371CF6111500720EFD /* RCTBundleURLProviderTests.m */,\n\t\t\t\t1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */,\n\t\t\t\t1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */,\n\t\t\t\t1497CFA81B21F5E400C1F8F2 /* RCTFontTests.m */,\n\t\t\t\t1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */,\n\t\t\t\t1300627E1B59179B0043FE5A /* RCTGzipTests.m */,\n\t\t\t\t8385CF051B8747A000C6273E /* RCTImageLoaderHelpers.h */,\n\t\t\t\t8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */,\n\t\t\t\t8385CEF41B873B5C00C6273E /* RCTImageLoaderTests.m */,\n\t\t\t\t144D21231B2204C5006DB32B /* RCTImageUtilTests.m */,\n\t\t\t\t13DB03471B5D2ED500C27245 /* RCTJSONTests.m */,\n\t\t\t\t13DF61B51B67A45000EDB188 /* RCTMethodArgumentTests.m */,\n\t\t\t\t134CB9291C85A38800265FA6 /* RCTModuleInitTests.m */,\n\t\t\t\t13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */,\n\t\t\t\t001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */,\n\t\t\t\t138D6A161B53CD440074A87E /* RCTShadowViewTests.m */,\n\t\t\t\t1497CFAB1B21F5E400C1F8F2 /* RCTUIManagerTests.m */,\n\t\t\t\tBC9C033F1DC9F1D600B1C635 /* RCTDevMenuTests.m */,\n\t\t\t\t13BCE84E1C9C209600DD7AAD /* RCTComponentPropsTests.m */,\n\t\t\t\t39AA31A31DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m */,\n\t\t\t\t143BC57E1B21E18100462512 /* Info.plist */,\n\t\t\t\t3DD981D51D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js */,\n\t\t\t\t14D6D7101B220EB3001FB087 /* libOCMock.a */,\n\t\t\t\t14D6D7011B220AE3001FB087 /* OCMock */,\n\t\t\t);\n\t\t\tpath = RNTesterUnitTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t143BC5961B21E3E100462512 /* RNTesterIntegrationTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */,\n\t\t\t\t27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */,\n\t\t\t\t3DB99D0B1BA0340600302749 /* RNTesterIntegrationTests.m */,\n\t\t\t\t143BC5A01B21E45C00462512 /* RNTesterSnapshotTests.m */,\n\t\t\t\tC654F0B21EB34A73000B7A9A /* RNTesterTestModule.m */,\n\t\t\t\t83636F8E1B53F22C009F943E /* RCTUIManagerScenarioTests.m */,\n\t\t\t\t143BC5971B21E3E100462512 /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = RNTesterIntegrationTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t143BC5971B21E3E100462512 /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t143BC5981B21E3E100462512 /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t14AADF001AC3DB95002390C9 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t14AADF041AC3DB95002390C9 /* libReact.a */,\n\t\t\t\t2DD323D91DA2DD8B000FE1B8 /* libReact.a */,\n\t\t\t\t3D3C08811DE3424E00C268FA /* libyoga.a */,\n\t\t\t\t3D3C08831DE3424E00C268FA /* libyoga.a */,\n\t\t\t\t3D05748C1DE6008900184BB4 /* libcxxreact.a */,\n\t\t\t\t3D05748E1DE6008900184BB4 /* libcxxreact.a */,\n\t\t\t\t3D0574901DE6008900184BB4 /* libjschelpers.a */,\n\t\t\t\t3D0574921DE6008900184BB4 /* libjschelpers.a */,\n\t\t\t\tD4EEE2E6201DEB2300C4CBB6 /* libjsinspector.a */,\n\t\t\t\tD4EEE2E8201DEB2300C4CBB6 /* libjsinspector-tvOS.a */,\n\t\t\t\t3D507F421EBC88B700B56834 /* libthird-party.a */,\n\t\t\t\tD4EEE2EA201DEB2300C4CBB6 /* libthird-party.a */,\n\t\t\t\t3D507F441EBC88B700B56834 /* libdouble-conversion.a */,\n\t\t\t\tD4EEE2EC201DEB2300C4CBB6 /* libdouble-conversion.a */,\n\t\t\t\tD4EEE2EE201DEB2300C4CBB6 /* libprivatedata.a */,\n\t\t\t\tD4EEE2F0201DEB2300C4CBB6 /* libprivatedata-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t14D6D6EA1B2205C0001FB087 /* OCMock */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tpath = OCMock;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t14D6D7011B220AE3001FB087 /* OCMock */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t14D6D7021B220AE3001FB087 /* NSNotificationCenter+OCMAdditions.h */,\n\t\t\t\t14D6D7031B220AE3001FB087 /* OCMArg.h */,\n\t\t\t\t14D6D7041B220AE3001FB087 /* OCMConstraint.h */,\n\t\t\t\t14D6D7051B220AE3001FB087 /* OCMLocation.h */,\n\t\t\t\t14D6D7061B220AE3001FB087 /* OCMMacroState.h */,\n\t\t\t\t14D6D7071B220AE3001FB087 /* OCMock.h */,\n\t\t\t\t14D6D7081B220AE3001FB087 /* OCMockObject.h */,\n\t\t\t\t14D6D7091B220AE3001FB087 /* OCMRecorder.h */,\n\t\t\t\t14D6D70A1B220AE3001FB087 /* OCMStubRecorder.h */,\n\t\t\t);\n\t\t\tpath = OCMock;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t272E6B3A1BEA846C001FCF37 /* NativeExampleViews */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */,\n\t\t\t\t27F441EA1BEBE5030039B79C /* FlexibleSizeExampleView.h */,\n\t\t\t\t272E6B3B1BEA849E001FCF37 /* UpdatePropertiesExampleView.h */,\n\t\t\t\t272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */,\n\t\t\t);\n\t\t\tname = NativeExampleViews;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2DD323911DA2DD8B000FE1B8 /* RNTester-tvOS */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2DD323A01DA2DD8B000FE1B8 /* Info.plist */,\n\t\t\t);\n\t\t\tpath = \"RNTester-tvOS\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D13F83F1D6F6AE000E69E0E /* RNTesterBundle */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D13F8401D6F6AE000E69E0E /* Info.plist */,\n\t\t\t\t3D13F8441D6F6AF200E69E0E /* ImageInBundle.png */,\n\t\t\t\t3D13F8451D6F6AF200E69E0E /* OtherImages.xcassets */,\n\t\t\t);\n\t\t\tname = RNTesterBundle;\n\t\t\tpath = RNTester/RNTesterBundle;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58005BE51ABA80530062E044 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t58005BEE1ABA80530062E044 /* libRCTTest.a */,\n\t\t\t\t2DD323CC1DA2DD8B000FE1B8 /* libRCTTest-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t834C36CE1AF8DA610019C93C /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD44BE2591EC741D7007E8CF4 /* libRCTSettings.a */,\n\t\t\t\t2DD323C81DA2DD8B000FE1B8 /* libRCTSettings-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBB9F61A601CBA00E9B192 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07FAE1A68108700A75B9A /* RNTester */,\n\t\t\t\t1316A21D1AA397F400C0188E /* Libraries */,\n\t\t\t\t143BC57C1B21E18100462512 /* RNTesterUnitTests */,\n\t\t\t\t143BC5961B21E3E100462512 /* RNTesterIntegrationTests */,\n\t\t\t\t3D13F83F1D6F6AE000E69E0E /* RNTesterBundle */,\n\t\t\t\t14D6D6EA1B2205C0001FB087 /* OCMock */,\n\t\t\t\t2DD323911DA2DD8B000FE1B8 /* RNTester-tvOS */,\n\t\t\t\t83CBBA001A601CBA00E9B192 /* Products */,\n\t\t\t\tD44BE26B1EC741EA007E8CF4 /* Frameworks */,\n\t\t\t\tD4EEE29E201DE86000C4CBB6 /* Recovered References */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t};\n\t\t83CBBA001A601CBA00E9B192 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07F961A680F5B00A75B9A /* RNTester.app */,\n\t\t\t\t004D289E1AAF61C70097A701 /* RNTesterUnitTests.xctest */,\n\t\t\t\t143BC5951B21E3E100462512 /* RNTesterIntegrationTests.xctest */,\n\t\t\t\t3D13F83E1D6F6AE000E69E0E /* RNTesterBundle.bundle */,\n\t\t\t\t2DD323901DA2DD8A000FE1B8 /* RNTester-tvOS.app */,\n\t\t\t\t2DD323A51DA2DD8B000FE1B8 /* RNTester-tvOSUnitTests.xctest */,\n\t\t\t\t2D4624E01DA2EA6900C74D09 /* RNTester-tvOSIntegrationTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tD44BE26B1EC741EA007E8CF4 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD44BE26C1EC741EB007E8CF4 /* AppKit.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tD48BABF41ED8712000616092 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD48BABFB1ED8712100616092 /* libRCTAnimation.a */,\n\t\t\t\tD48BABFD1ED8712100616092 /* libRCTAnimation.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tD4EEE29E201DE86000C4CBB6 /* Recovered References */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2DD323BF1DA2DD8B000FE1B8 /* libRCTLinking-tvOS.a */,\n\t\t\t);\n\t\t\tname = \"Recovered References\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t004D289D1AAF61C70097A701 /* RNTesterUnitTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 004D28AD1AAF61C70097A701 /* Build configuration list for PBXNativeTarget \"RNTesterUnitTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t004D289A1AAF61C70097A701 /* Sources */,\n\t\t\t\t004D289B1AAF61C70097A701 /* Frameworks */,\n\t\t\t\t004D289C1AAF61C70097A701 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t035D95A81C9352CC00B095A8 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = RNTesterUnitTests;\n\t\t\tproductName = RNTesterTests;\n\t\t\tproductReference = 004D289E1AAF61C70097A701 /* RNTesterUnitTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t13B07F861A680F5B00A75B9A /* RNTester */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"RNTester\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t13B07F871A680F5B00A75B9A /* Sources */,\n\t\t\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */,\n\t\t\t\t13B07F8E1A680F5B00A75B9A /* Resources */,\n\t\t\t\t68CD48B71D2BCB2C007E06A9 /* Run Script */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t3D13F84C1D6F6B5F00E69E0E /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = RNTester;\n\t\t\tproductName = \"Hello World\";\n\t\t\tproductReference = 13B07F961A680F5B00A75B9A /* RNTester.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t143BC5941B21E3E100462512 /* RNTesterIntegrationTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 143BC59D1B21E3E100462512 /* Build configuration list for PBXNativeTarget \"RNTesterIntegrationTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t143BC5911B21E3E100462512 /* Sources */,\n\t\t\t\t143BC5921B21E3E100462512 /* Frameworks */,\n\t\t\t\t143BC5931B21E3E100462512 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t143BC59C1B21E3E100462512 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = RNTesterIntegrationTests;\n\t\t\tproductName = RNTesterIntegrationTests;\n\t\t\tproductReference = 143BC5951B21E3E100462512 /* RNTesterIntegrationTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t2D4624C11DA2EA6900C74D09 /* RNTester-tvOSIntegrationTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D4624DD1DA2EA6900C74D09 /* Build configuration list for PBXNativeTarget \"RNTester-tvOSIntegrationTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2D4624C41DA2EA6900C74D09 /* Sources */,\n\t\t\t\t2D4624D91DA2EA6900C74D09 /* Frameworks */,\n\t\t\t\t2D4624DB1DA2EA6900C74D09 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t2D4624C21DA2EA6900C74D09 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"RNTester-tvOSIntegrationTests\";\n\t\t\tproductName = \"RNTester-tvOSUnitTests\";\n\t\t\tproductReference = 2D4624E01DA2EA6900C74D09 /* RNTester-tvOSIntegrationTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t2DD3238F1DA2DD8A000FE1B8 /* RNTester-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2DD323DA1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget \"RNTester-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2DD3238C1DA2DD8A000FE1B8 /* Sources */,\n\t\t\t\t2DD3238D1DA2DD8A000FE1B8 /* Frameworks */,\n\t\t\t\t2DD3238E1DA2DD8A000FE1B8 /* Resources */,\n\t\t\t\t2DD323EB1DA2DEC1000FE1B8 /* ShellScript */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"RNTester-tvOS\";\n\t\t\tproductName = \"RNTester-tvOS\";\n\t\t\tproductReference = 2DD323901DA2DD8A000FE1B8 /* RNTester-tvOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t2DD323A41DA2DD8B000FE1B8 /* RNTester-tvOSUnitTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2DD323DB1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget \"RNTester-tvOSUnitTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2DD323A11DA2DD8B000FE1B8 /* Sources */,\n\t\t\t\t2DD323A21DA2DD8B000FE1B8 /* Frameworks */,\n\t\t\t\t2DD323A31DA2DD8B000FE1B8 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t2DD323A71DA2DD8B000FE1B8 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"RNTester-tvOSUnitTests\";\n\t\t\tproductName = \"RNTester-tvOSUnitTests\";\n\t\t\tproductReference = 2DD323A51DA2DD8B000FE1B8 /* RNTester-tvOSUnitTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t3D13F83D1D6F6AE000E69E0E /* RNTesterBundle */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D13F8411D6F6AE000E69E0E /* Build configuration list for PBXNativeTarget \"RNTesterBundle\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D13F83A1D6F6AE000E69E0E /* Sources */,\n\t\t\t\t3D13F83B1D6F6AE000E69E0E /* Frameworks */,\n\t\t\t\t3D13F83C1D6F6AE000E69E0E /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RNTesterBundle;\n\t\t\tproductName = RNTesterBundle;\n\t\t\tproductReference = 3D13F83E1D6F6AE000E69E0E /* RNTesterBundle.bundle */;\n\t\t\tproductType = \"com.apple.product-type.bundle\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t83CBB9F71A601CBA00E9B192 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0820;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t004D289D1AAF61C70097A701 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t\t143BC5941B21E3E100462512 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.3.2;\n\t\t\t\t\t\tTestTargetID = 13B07F861A680F5B00A75B9A;\n\t\t\t\t\t};\n\t\t\t\t\t2DD3238F1DA2DD8A000FE1B8 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t2DD323A41DA2DD8B000FE1B8 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t\tTestTargetID = 2DD3238F1DA2DD8A000FE1B8;\n\t\t\t\t\t};\n\t\t\t\t\t3D13F83D1D6F6AE000E69E0E = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 7.3.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"RNTester\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 83CBB9F61A601CBA00E9B192;\n\t\t\tproductRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 034674FD1CEF5D59009A625D /* Products */;\n\t\t\t\t\tProjectRef = 034674FC1CEF5D59009A625D /* ART.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = D48BABF41ED8712000616092 /* Products */;\n\t\t\t\t\tProjectRef = D48BABF31ED8712000616092 /* RCTAnimation.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 13417FE41AA91428003F314A /* Products */;\n\t\t\t\t\tProjectRef = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 031465021CAA6DF30005E5B6 /* Products */;\n\t\t\t\t\tProjectRef = 031465011CAA6DF30005E5B6 /* RCTLinking.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 134180271AA91779003F314A /* Products */;\n\t\t\t\t\tProjectRef = 134180261AA91779003F314A /* RCTNetwork.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 834C36CE1AF8DA610019C93C /* Products */;\n\t\t\t\t\tProjectRef = 13CC9D481AEED2B90020D1C2 /* RCTSettings.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 58005BE51ABA80530062E044 /* Products */;\n\t\t\t\t\tProjectRef = 58005BE41ABA80530062E044 /* RCTTest.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 13417FEB1AA914B8003F314A /* Products */;\n\t\t\t\t\tProjectRef = 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 139FDECB1B0651EA00C62182 /* Products */;\n\t\t\t\t\tProjectRef = 139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 14AADF001AC3DB95002390C9 /* Products */;\n\t\t\t\t\tProjectRef = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t13B07F861A680F5B00A75B9A /* RNTester */,\n\t\t\t\t004D289D1AAF61C70097A701 /* RNTesterUnitTests */,\n\t\t\t\t143BC5941B21E3E100462512 /* RNTesterIntegrationTests */,\n\t\t\t\t3D13F83D1D6F6AE000E69E0E /* RNTesterBundle */,\n\t\t\t\t2DD3238F1DA2DD8A000FE1B8 /* RNTester-tvOS */,\n\t\t\t\t2DD323A41DA2DD8B000FE1B8 /* RNTester-tvOSUnitTests */,\n\t\t\t\t2D4624C11DA2EA6900C74D09 /* RNTester-tvOSIntegrationTests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\t034675011CEF5D59009A625D /* libART.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libART.a;\n\t\t\tremoteRef = 034675001CEF5D59009A625D /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t13417FE81AA91428003F314A /* libRCTImage.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTImage.a;\n\t\t\tremoteRef = 13417FE71AA91428003F314A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t13417FEF1AA914B8003F314A /* libRCTText.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTText.a;\n\t\t\tremoteRef = 13417FEE1AA914B8003F314A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t1341802B1AA91779003F314A /* libRCTNetwork.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTNetwork.a;\n\t\t\tremoteRef = 1341802A1AA91779003F314A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t139FDED91B0651EA00C62182 /* libRCTWebSocket.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTWebSocket.a;\n\t\t\tremoteRef = 139FDED81B0651EA00C62182 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t14AADF041AC3DB95002390C9 /* libReact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libReact.a;\n\t\t\tremoteRef = 14AADF031AC3DB95002390C9 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323BB1DA2DD8B000FE1B8 /* libRCTImage-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTImage-tvOS.a\";\n\t\t\tremoteRef = 2DD323BA1DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323BF1DA2DD8B000FE1B8 /* libRCTLinking-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTLinking-tvOS.a\";\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323C31DA2DD8B000FE1B8 /* libRCTNetwork-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTNetwork-tvOS.a\";\n\t\t\tremoteRef = 2DD323C21DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323C81DA2DD8B000FE1B8 /* libRCTSettings-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTSettings-tvOS.a\";\n\t\t\tremoteRef = 2DD323C71DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323CC1DA2DD8B000FE1B8 /* libRCTTest-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTTest-tvOS.a\";\n\t\t\tremoteRef = 2DD323CB1DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323D01DA2DD8B000FE1B8 /* libRCTText-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTText-tvOS.a\";\n\t\t\tremoteRef = 2DD323CF1DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323D51DA2DD8B000FE1B8 /* libRCTWebSocket-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTWebSocket-tvOS.a\";\n\t\t\tremoteRef = 2DD323D41DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323D91DA2DD8B000FE1B8 /* libReact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libReact.a;\n\t\t\tremoteRef = 2DD323D81DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3D05748C1DE6008900184BB4 /* libcxxreact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libcxxreact.a;\n\t\t\tremoteRef = 3D05748B1DE6008900184BB4 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3D05748E1DE6008900184BB4 /* libcxxreact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libcxxreact.a;\n\t\t\tremoteRef = 3D05748D1DE6008900184BB4 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3D0574901DE6008900184BB4 /* libjschelpers.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjschelpers.a;\n\t\t\tremoteRef = 3D05748F1DE6008900184BB4 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3D0574921DE6008900184BB4 /* libjschelpers.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjschelpers.a;\n\t\t\tremoteRef = 3D0574911DE6008900184BB4 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3D3C08811DE3424E00C268FA /* libyoga.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libyoga.a;\n\t\t\tremoteRef = 3D3C08801DE3424E00C268FA /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3D3C08831DE3424E00C268FA /* libyoga.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libyoga.a;\n\t\t\tremoteRef = 3D3C08821DE3424E00C268FA /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3D507F421EBC88B700B56834 /* libthird-party.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libthird-party.a\";\n\t\t\tremoteRef = 3D507F411EBC88B700B56834 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3D507F441EBC88B700B56834 /* libdouble-conversion.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libdouble-conversion.a\";\n\t\t\tremoteRef = 3D507F431EBC88B700B56834 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t58005BEE1ABA80530062E044 /* libRCTTest.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTTest.a;\n\t\t\tremoteRef = 58005BED1ABA80530062E044 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD44BE24A1EC741D7007E8CF4 /* libART-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libART-tvOS.a\";\n\t\t\tremoteRef = D44BE2491EC741D7007E8CF4 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD44BE2511EC741D7007E8CF4 /* libRCTLinking.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTLinking.a;\n\t\t\tremoteRef = D44BE2501EC741D7007E8CF4 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD44BE2531EC741D7007E8CF4 /* libRCTLinking-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTLinking-tvOS.a\";\n\t\t\tremoteRef = D44BE2521EC741D7007E8CF4 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD44BE2591EC741D7007E8CF4 /* libRCTSettings.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTSettings.a;\n\t\t\tremoteRef = D44BE2581EC741D7007E8CF4 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD48BABFB1ED8712100616092 /* libRCTAnimation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTAnimation.a;\n\t\t\tremoteRef = D48BABFA1ED8712100616092 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD48BABFD1ED8712100616092 /* libRCTAnimation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTAnimation.a;\n\t\t\tremoteRef = D48BABFC1ED8712100616092 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD4EEE2B4201DE86200C4CBB6 /* libfishhook.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libfishhook.a;\n\t\t\tremoteRef = D4EEE2B3201DE86200C4CBB6 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD4EEE2B6201DE86200C4CBB6 /* libfishhook-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libfishhook-tvOS.a\";\n\t\t\tremoteRef = D4EEE2B5201DE86200C4CBB6 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD4EEE2E6201DEB2300C4CBB6 /* libjsinspector.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjsinspector.a;\n\t\t\tremoteRef = D4EEE2E5201DEB2300C4CBB6 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD4EEE2E8201DEB2300C4CBB6 /* libjsinspector-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libjsinspector-tvOS.a\";\n\t\t\tremoteRef = D4EEE2E7201DEB2300C4CBB6 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD4EEE2EA201DEB2300C4CBB6 /* libthird-party.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libthird-party.a\";\n\t\t\tremoteRef = D4EEE2E9201DEB2300C4CBB6 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD4EEE2EC201DEB2300C4CBB6 /* libdouble-conversion.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libdouble-conversion.a\";\n\t\t\tremoteRef = D4EEE2EB201DEB2300C4CBB6 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD4EEE2EE201DEB2300C4CBB6 /* libprivatedata.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libprivatedata.a;\n\t\t\tremoteRef = D4EEE2ED201DEB2300C4CBB6 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD4EEE2F0201DEB2300C4CBB6 /* libprivatedata-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libprivatedata-tvOS.a\";\n\t\t\tremoteRef = D4EEE2EF201DEB2300C4CBB6 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t004D289C1AAF61C70097A701 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DD981D61D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F8E1A680F5B00A75B9A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,\n\t\t\t\t3D56F9F11D6F6E9B00F53A06 /* RNTesterBundle.bundle in Resources */,\n\t\t\t\t3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t143BC5931B21E3E100462512 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D4624DB1DA2EA6900C74D09 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD3238E1DA2DD8A000FE1B8 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2DD323DF1DA2DDBF000FE1B8 /* Images.xcassets in Resources */,\n\t\t\t\t2DD323E11DA2DDBF000FE1B8 /* legacy_image@2x.png in Resources */,\n\t\t\t\t2DD323E21DA2DDBF000FE1B8 /* Info.plist in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD323A31DA2DD8B000FE1B8 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D4BD8E61DA2E20D005AC8A8 /* RNTesterUnitTestsBundle.js in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D13F83C1D6F6AE000E69E0E /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D13F8481D6F6AF900E69E0E /* ImageInBundle.png in Resources */,\n\t\t\t\t3D13F84A1D6F6AFD00E69E0E /* OtherImages.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t2DD323EB1DA2DEC1000FE1B8 /* ShellScript */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"export NODE_BINARY=node\\n$SRCROOT/../packager/react-native-xcode.sh Examples/RNTester/js/RNTesterApp.ios.js\";\n\t\t};\n\t\t68CD48B71D2BCB2C007E06A9 /* Run Script */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Run Script\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"export NODE_BINARY=node\\n$SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.macos.js\";\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t004D289A1AAF61C70097A701 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1497CFB01B21F5E400C1F8F2 /* RCTFontTests.m in Sources */,\n\t\t\t\t13BCE84F1C9C209600DD7AAD /* RCTComponentPropsTests.m in Sources */,\n\t\t\t\t144D21241B2204C5006DB32B /* RCTImageUtilTests.m in Sources */,\n\t\t\t\t1300627F1B59179B0043FE5A /* RCTGzipTests.m in Sources */,\n\t\t\t\t1497CFAF1B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m in Sources */,\n\t\t\t\t13129DD41C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m in Sources */,\n\t\t\t\t192F69B81E82409A008692C7 /* RCTAnimationUtilsTests.m in Sources */,\n\t\t\t\t134CB92A1C85A38800265FA6 /* RCTModuleInitTests.m in Sources */,\n\t\t\t\t192F69BA1E82409A008692C7 /* RCTNativeAnimatedNodesManagerTests.m in Sources */,\n\t\t\t\t1497CFB11B21F5E400C1F8F2 /* RCTEventDispatcherTests.m in Sources */,\n\t\t\t\t1497CFB31B21F5E400C1F8F2 /* RCTUIManagerTests.m in Sources */,\n\t\t\t\t13DB03481B5D2ED500C27245 /* RCTJSONTests.m in Sources */,\n\t\t\t\t1497CFAC1B21F5E400C1F8F2 /* RCTAllocationTests.m in Sources */,\n\t\t\t\t001BFCE41D838343008E587E /* RCTMultipartStreamReaderTests.m in Sources */,\n\t\t\t\t13DF61B61B67A45000EDB188 /* RCTMethodArgumentTests.m in Sources */,\n\t\t\t\t138D6A181B53CD440074A87E /* RCTShadowViewTests.m in Sources */,\n\t\t\t\t39AA31A41DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m in Sources */,\n\t\t\t\t13B6C1A31C34225900D3FAF5 /* RCTURLUtilsTests.m in Sources */,\n\t\t\t\t8385CF041B87479200C6273E /* RCTImageLoaderHelpers.m in Sources */,\n\t\t\t\t192F69B91E82409A008692C7 /* RCTConvert_YGValueTests.m in Sources */,\n\t\t\t\tBC9C03401DC9F1D600B1C635 /* RCTDevMenuTests.m in Sources */,\n\t\t\t\t68FF44381CF6111500720EFD /* RCTBundleURLProviderTests.m in Sources */,\n\t\t\t\t8385CEF51B873B5C00C6273E /* RCTImageLoaderTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F871A680F5B00A75B9A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */,\n\t\t\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,\n\t\t\t\t27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */,\n\t\t\t\t13B07FC11A68108700A75B9A /* main.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t143BC5911B21E3E100462512 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tC654F0B31EB34A73000B7A9A /* RNTesterTestModule.m in Sources */,\n\t\t\t\t3DB99D0C1BA0340600302749 /* RNTesterIntegrationTests.m in Sources */,\n\t\t\t\t83636F8F1B53F22C009F943E /* RCTUIManagerScenarioTests.m in Sources */,\n\t\t\t\t3D299BAF1D33EBFA00FA1057 /* RCTLoggingTests.m in Sources */,\n\t\t\t\t143BC5A11B21E45C00462512 /* RNTesterSnapshotTests.m in Sources */,\n\t\t\t\t27B885561BED29AF00008352 /* RCTRootViewIntegrationTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D4624C41DA2EA6900C74D09 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tC654F17E1EB34D24000B7A9A /* RNTesterTestModule.m in Sources */,\n\t\t\t\t2D4624FC1DA2EAC300C74D09 /* RNTesterIntegrationTests.m in Sources */,\n\t\t\t\t2D4624FA1DA2EAC300C74D09 /* RCTLoggingTests.m in Sources */,\n\t\t\t\t2D4624FE1DA2EAC300C74D09 /* RCTUIManagerScenarioTests.m in Sources */,\n\t\t\t\t2D4624FD1DA2EAC300C74D09 /* RNTesterSnapshotTests.m in Sources */,\n\t\t\t\t2D4624FB1DA2EAC300C74D09 /* RCTRootViewIntegrationTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD3238C1DA2DD8A000FE1B8 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2DD323DC1DA2DDBF000FE1B8 /* FlexibleSizeExampleView.m in Sources */,\n\t\t\t\t2DD323DD1DA2DDBF000FE1B8 /* UpdatePropertiesExampleView.m in Sources */,\n\t\t\t\t2DD323E01DA2DDBF000FE1B8 /* main.m in Sources */,\n\t\t\t\t2DD323DE1DA2DDBF000FE1B8 /* AppDelegate.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD323A11DA2DD8B000FE1B8 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D4BD8DC1DA2E20D005AC8A8 /* RCTImageLoaderTests.m in Sources */,\n\t\t\t\t2D4BD8D91DA2E20D005AC8A8 /* RCTEventDispatcherTests.m in Sources */,\n\t\t\t\t2D4BD8D41DA2E20D005AC8A8 /* RCTAllocationTests.m in Sources */,\n\t\t\t\t2D4BD8DA1DA2E20D005AC8A8 /* RCTGzipTests.m in Sources */,\n\t\t\t\t2D4BD8DB1DA2E20D005AC8A8 /* RCTImageLoaderHelpers.m in Sources */,\n\t\t\t\t2D4BD8E51DA2E20D005AC8A8 /* RCTComponentPropsTests.m in Sources */,\n\t\t\t\t2D4BD8D71DA2E20D005AC8A8 /* RCTConvert_NSURLTests.m in Sources */,\n\t\t\t\t2D4BD8E11DA2E20D005AC8A8 /* RCTModuleInitNotificationRaceTests.m in Sources */,\n\t\t\t\t2D4BD8DF1DA2E20D005AC8A8 /* RCTMethodArgumentTests.m in Sources */,\n\t\t\t\t2D4BD8D31DA2E20D005AC8A8 /* RCTBundleURLProviderTests.m in Sources */,\n\t\t\t\t2D4BD8D21DA2E20D005AC8A8 /* RCTURLUtilsTests.m in Sources */,\n\t\t\t\t2D8C2E321DA40403000EE098 /* RCTMultipartStreamReaderTests.m in Sources */,\n\t\t\t\t2D4BD8DE1DA2E20D005AC8A8 /* RCTJSONTests.m in Sources */,\n\t\t\t\t2D4BD8E31DA2E20D005AC8A8 /* RCTShadowViewTests.m in Sources */,\n\t\t\t\t2D4BD8D81DA2E20D005AC8A8 /* RCTFontTests.m in Sources */,\n\t\t\t\t2D4BD8DD1DA2E20D005AC8A8 /* RCTImageUtilTests.m in Sources */,\n\t\t\t\t2D4BD8E41DA2E20D005AC8A8 /* RCTUIManagerTests.m in Sources */,\n\t\t\t\t2D4BD8E01DA2E20D005AC8A8 /* RCTModuleInitTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D13F83A1D6F6AE000E69E0E /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t035D95A81C9352CC00B095A8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 13B07F861A680F5B00A75B9A /* RNTester */;\n\t\t\ttargetProxy = 035D95A71C9352CC00B095A8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t143BC59C1B21E3E100462512 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 13B07F861A680F5B00A75B9A /* RNTester */;\n\t\t\ttargetProxy = 143BC59B1B21E3E100462512 /* PBXContainerItemProxy */;\n\t\t};\n\t\t2D4624C21DA2EA6900C74D09 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 2DD3238F1DA2DD8A000FE1B8 /* RNTester-tvOS */;\n\t\t\ttargetProxy = 2D4624C31DA2EA6900C74D09 /* PBXContainerItemProxy */;\n\t\t};\n\t\t2DD323A71DA2DD8B000FE1B8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 2DD3238F1DA2DD8A000FE1B8 /* RNTester-tvOS */;\n\t\t\ttargetProxy = 2DD323A61DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D13F84C1D6F6B5F00E69E0E /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D13F83D1D6F6AE000E69E0E /* RNTesterBundle */;\n\t\t\ttargetProxy = 3D13F84B1D6F6B5F00E69E0E /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin XCBuildConfiguration section */\n\t\t004D28A61AAF61C70097A701 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterUnitTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t004D28A71AAF61C70097A701 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterUnitTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t13B07F941A680F5B00A75B9A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tINFOPLIST_FILE = \"$(SRCROOT)/RNTester/Info.plist\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp;\n\t\t\t\tPRODUCT_NAME = RNTester;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t13B07F951A680F5B00A75B9A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tDEVELOPMENT_TEAM = \"\";\n\t\t\t\tINFOPLIST_FILE = \"$(SRCROOT)/RNTester/Info.plist\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp;\n\t\t\t\tPRODUCT_NAME = RNTester;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t143BC59E1B21E3E100462512 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"FB_REFERENCE_IMAGE_DIR=\\\"\\\\\\\"$(SOURCE_ROOT)/$(PROJECT_NAME)IntegrationTests/ReferenceImages\\\\\\\"\\\"\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.React.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester.app/Contents/MacOS/RNTester\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t143BC59F1B21E3E100462512 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.React.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester.app/Contents/MacOS/RNTester\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t2D4624DE1DA2EA6900C74D09 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"FB_REFERENCE_IMAGE_DIR=\\\"\\\\\\\"$(SOURCE_ROOT)/$(PROJECT_NAME)IntegrationTests/ReferenceImages\\\\\\\"\\\"\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOSIntegrationTests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester-tvOS.app/RNTester-tvOS\";\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D4624DF1DA2EA6900C74D09 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOSIntegrationTests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester-tvOS.app/RNTester-tvOS\";\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t2DD323AC1DA2DD8B000FE1B8 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = \"App Icon & Top Shelf Image\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = \"RNTester-tvOS/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOS\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = 3;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2DD323AD1DA2DD8B000FE1B8 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = \"App Icon & Top Shelf Image\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = \"RNTester-tvOS/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOS\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = 3;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t2DD323AE1DA2DD8B000FE1B8 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/RNTesterUnitTests/**\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterUnitTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOSUnitTests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester-tvOS.app/RNTester-tvOS\";\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2DD323AF1DA2DD8B000FE1B8 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/RNTesterUnitTests/**\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterUnitTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOSUnitTests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester-tvOS.app/RNTester-tvOS\";\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D13F8421D6F6AE000E69E0E /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = RNTester/RNTesterBundle/Info.plist;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterBundle;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tWRAPPER_EXTENSION = bundle;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D13F8431D6F6AE000E69E0E /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = RNTester/RNTesterBundle/Info.plist;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterBundle;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tWRAPPER_EXTENSION = bundle;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA201A601CBA00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_ASSIGN_ENUM = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_STRICT_SELECTOR_MATCH = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNKNOWN_PRAGMAS = YES;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_LABEL = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Wextra\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t\t\"-Wno-semicolon-before-method-body\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA211A601CBA00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_ASSIGN_ENUM = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_STRICT_SELECTOR_MATCH = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNKNOWN_PRAGMAS = YES;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_LABEL = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Wextra\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t\t\"-Wno-semicolon-before-method-body\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t004D28AD1AAF61C70097A701 /* Build configuration list for PBXNativeTarget \"RNTesterUnitTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t004D28A61AAF61C70097A701 /* Debug */,\n\t\t\t\t004D28A71AAF61C70097A701 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"RNTester\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t13B07F941A680F5B00A75B9A /* Debug */,\n\t\t\t\t13B07F951A680F5B00A75B9A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t143BC59D1B21E3E100462512 /* Build configuration list for PBXNativeTarget \"RNTesterIntegrationTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t143BC59E1B21E3E100462512 /* Debug */,\n\t\t\t\t143BC59F1B21E3E100462512 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t2D4624DD1DA2EA6900C74D09 /* Build configuration list for PBXNativeTarget \"RNTester-tvOSIntegrationTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D4624DE1DA2EA6900C74D09 /* Debug */,\n\t\t\t\t2D4624DF1DA2EA6900C74D09 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t2DD323DA1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget \"RNTester-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2DD323AC1DA2DD8B000FE1B8 /* Debug */,\n\t\t\t\t2DD323AD1DA2DD8B000FE1B8 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t2DD323DB1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget \"RNTester-tvOSUnitTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2DD323AE1DA2DD8B000FE1B8 /* Debug */,\n\t\t\t\t2DD323AF1DA2DD8B000FE1B8 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D13F8411D6F6AE000E69E0E /* Build configuration list for PBXNativeTarget \"RNTesterBundle\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D13F8421D6F6AE000E69E0E /* Debug */,\n\t\t\t\t3D13F8431D6F6AE000E69E0E /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"RNTester\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA201A601CBA00E9B192 /* Debug */,\n\t\t\t\t83CBBA211A601CBA00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;\n}\n"
  },
  {
    "path": "RNTester/RNTester.xcodeproj/xcshareddata/xcschemes/RNTester-tvOS.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0820\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"NO\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2D2A28121D9B038B00D4039D\"\n               BuildableName = \"libReact.a\"\n               BlueprintName = \"React-tvOS\"\n               ReferencedContainer = \"container:../React/React.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2DD3238F1DA2DD8A000FE1B8\"\n               BuildableName = \"RNTester-tvOS.app\"\n               BlueprintName = \"RNTester-tvOS\"\n               ReferencedContainer = \"container:RNTester.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      language = \"\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2DD323A41DA2DD8B000FE1B8\"\n               BuildableName = \"RNTester-tvOSUnitTests.xctest\"\n               BlueprintName = \"RNTester-tvOSUnitTests\"\n               ReferencedContainer = \"container:RNTester.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2D4624C11DA2EA6900C74D09\"\n               BuildableName = \"RNTester-tvOSIntegrationTests.xctest\"\n               BlueprintName = \"RNTester-tvOSIntegrationTests\"\n               ReferencedContainer = \"container:RNTester.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"2DD3238F1DA2DD8A000FE1B8\"\n            BuildableName = \"RNTester-tvOS.app\"\n            BlueprintName = \"RNTester-tvOS\"\n            ReferencedContainer = \"container:RNTester.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      language = \"\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"2DD3238F1DA2DD8A000FE1B8\"\n            BuildableName = \"RNTester-tvOS.app\"\n            BlueprintName = \"RNTester-tvOS\"\n            ReferencedContainer = \"container:RNTester.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <EnvironmentVariables>\n         <EnvironmentVariable\n            key = \"CI_USE_PACKAGER\"\n            value = \"1\"\n            isEnabled = \"YES\">\n         </EnvironmentVariable>\n      </EnvironmentVariables>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"2DD3238F1DA2DD8A000FE1B8\"\n            BuildableName = \"RNTester-tvOS.app\"\n            BlueprintName = \"RNTester-tvOS\"\n            ReferencedContainer = \"container:RNTester.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "RNTester/RNTester.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0820\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"NO\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"83CBBA2D1A601D0E00E9B192\"\n               BuildableName = \"libReact.a\"\n               BlueprintName = \"React\"\n               ReferencedContainer = \"container:../React/React.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"3D13F83D1D6F6AE000E69E0E\"\n               BuildableName = \"RNTesterBundle.bundle\"\n               BlueprintName = \"RNTesterBundle\"\n               ReferencedContainer = \"container:RNTester.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n               BuildableName = \"RNTester.app\"\n               BlueprintName = \"RNTester\"\n               ReferencedContainer = \"container:RNTester.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"NO\"\n            buildForProfiling = \"NO\"\n            buildForArchiving = \"NO\"\n            buildForAnalyzing = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"004D289D1AAF61C70097A701\"\n               BuildableName = \"RNTesterUnitTests.xctest\"\n               BlueprintName = \"RNTesterUnitTests\"\n               ReferencedContainer = \"container:RNTester.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"NO\"\n            buildForProfiling = \"NO\"\n            buildForArchiving = \"NO\"\n            buildForAnalyzing = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"143BC5941B21E3E100462512\"\n               BuildableName = \"RNTesterIntegrationTests.xctest\"\n               BlueprintName = \"RNTesterIntegrationTests\"\n               ReferencedContainer = \"container:RNTester.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      language = \"\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"004D289D1AAF61C70097A701\"\n               BuildableName = \"RNTesterUnitTests.xctest\"\n               BlueprintName = \"RNTesterUnitTests\"\n               ReferencedContainer = \"container:RNTester.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"143BC5941B21E3E100462512\"\n               BuildableName = \"RNTesterIntegrationTests.xctest\"\n               BlueprintName = \"RNTesterIntegrationTests\"\n               ReferencedContainer = \"container:RNTester.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"RNTester.app\"\n            BlueprintName = \"RNTester\"\n            ReferencedContainer = \"container:RNTester.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      language = \"\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"RNTester.app\"\n            BlueprintName = \"RNTester\"\n            ReferencedContainer = \"container:RNTester.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <EnvironmentVariables>\n         <EnvironmentVariable\n            key = \"CI_USE_PACKAGER\"\n            value = \"1\"\n            isEnabled = \"YES\">\n         </EnvironmentVariable>\n      </EnvironmentVariables>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"RNTester.app\"\n            BlueprintName = \"RNTester\"\n            ReferencedContainer = \"container:RNTester.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "RNTester/RNTesterIntegrationTests/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "RNTester/RNTesterIntegrationTests/RCTLoggingTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <React/RCTAssert.h>\n#import <React/RCTBridge.h>\n#import <React/RCTLog.h>\n\n@interface RCTLoggingTests : XCTestCase\n\n@end\n\n@implementation RCTLoggingTests\n{\n  RCTBridge *_bridge;\n\n  dispatch_semaphore_t _logSem;\n  RCTLogLevel _lastLogLevel;\n  RCTLogSource _lastLogSource;\n  NSString *_lastLogMessage;\n}\n\n- (void)setUp\n{\n  NSURL *scriptURL;\n  if (getenv(\"CI_USE_PACKAGER\")) {\n    NSString *app = @\"IntegrationTests/IntegrationTestsApp\";\n    scriptURL = [NSURL URLWithString:[NSString stringWithFormat:@\"http://localhost:8081/%@.bundle?platform=macos&dev=true\", app]];\n  } else {\n    scriptURL = [[NSBundle bundleForClass:[RCTBridge class]] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n  }\n  RCTAssert(scriptURL != nil, @\"No scriptURL set\");\n\n  _bridge = [[RCTBridge alloc] initWithBundleURL:scriptURL moduleProvider:NULL launchOptions:nil];\n  NSDate *date = [NSDate dateWithTimeIntervalSinceNow:60];\n  while (date.timeIntervalSinceNow > 0 && _bridge.loading) {\n    [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];\n  }\n  XCTAssertFalse(_bridge.loading);\n\n  _logSem = dispatch_semaphore_create(0);\n}\n\n- (void)tearDown\n{\n  [_bridge invalidate];\n  _bridge = nil;\n\n  RCTSetLogFunction(RCTDefaultLogFunction);\n}\n\n- (void)testLogging\n{\n  // First console log call will fire after 2.0 sec, to allow for any initial log messages\n  // that might come in (seeing this in tvOS)\n  [_bridge enqueueJSCall:@\"LoggingTestModule.logToConsoleAfterWait\" args:@[@\"Invoking console.log\",@2000]];\n  // Spin native layer for 1.9 sec\n  [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.9]];\n  // Now set the log function to signal the semaphore\n  RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, __unused NSString *fileName, __unused NSNumber *lineNumber, NSString *message) {\n    if (source == RCTLogSourceJavaScript) {\n      self->_lastLogLevel = level;\n      self->_lastLogSource = source;\n      self->_lastLogMessage = message;\n      dispatch_semaphore_signal(self->_logSem);\n    }\n  });\n  // Wait for console log to signal the semaphore\n  dispatch_semaphore_wait(_logSem, DISPATCH_TIME_FOREVER);\n\n  XCTAssertEqual(_lastLogLevel, RCTLogLevelInfo);\n  XCTAssertEqual(_lastLogSource, RCTLogSourceJavaScript);\n  XCTAssertEqualObjects(_lastLogMessage, @\"Invoking console.log\");\n\n  [_bridge enqueueJSCall:@\"LoggingTestModule.warning\" args:@[@\"Generating warning\"]];\n  dispatch_semaphore_wait(_logSem, DISPATCH_TIME_FOREVER);\n\n  XCTAssertEqual(_lastLogLevel, RCTLogLevelWarning);\n  XCTAssertEqual(_lastLogSource, RCTLogSourceJavaScript);\n  XCTAssertEqualObjects(_lastLogMessage, @\"Warning: Generating warning\");\n\n  [_bridge enqueueJSCall:@\"LoggingTestModule.invariant\" args:@[@\"Invariant failed\"]];\n  dispatch_semaphore_wait(_logSem, DISPATCH_TIME_FOREVER);\n\n  XCTAssertEqual(_lastLogLevel, RCTLogLevelError);\n  XCTAssertEqual(_lastLogSource, RCTLogSourceJavaScript);\n  XCTAssertEqualObjects(_lastLogMessage, @\"Invariant failed\");\n\n  [_bridge enqueueJSCall:@\"LoggingTestModule.logErrorToConsole\" args:@[@\"Invoking console.error\"]];\n  dispatch_semaphore_wait(_logSem, DISPATCH_TIME_FOREVER);\n\n  // For local bundles, we'll first get a warning about symbolication\n  if ([_bridge.bundleURL isFileURL]) {\n    dispatch_semaphore_wait(_logSem, DISPATCH_TIME_FOREVER);\n  }\n\n  XCTAssertEqual(_lastLogLevel, RCTLogLevelError);\n  XCTAssertEqual(_lastLogSource, RCTLogSourceJavaScript);\n  XCTAssertEqualObjects(_lastLogMessage, @\"Invoking console.error\");\n\n  [_bridge enqueueJSCall:@\"LoggingTestModule.throwError\" args:@[@\"Throwing an error\"]];\n  dispatch_semaphore_wait(_logSem, DISPATCH_TIME_FOREVER);\n\n  // For local bundles, we'll first get a warning about symbolication\n  if ([_bridge.bundleURL isFileURL]) {\n    dispatch_semaphore_wait(_logSem, DISPATCH_TIME_FOREVER);\n  }\n\n  XCTAssertEqual(_lastLogLevel, RCTLogLevelError);\n  XCTAssertEqual(_lastLogSource, RCTLogSourceJavaScript);\n  XCTAssertEqualObjects(_lastLogMessage, @\"Throwing an error\");\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterIntegrationTests/RCTRootViewIntegrationTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <AppKit/AppKit.h>\n#import <XCTest/XCTest.h>\n\n#import <RCTTest/RCTTestRunner.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTRootView.h>\n#import <React/RCTRootViewDelegate.h>\n\n#define RCT_TEST_DATA_CONFIGURATION_BLOCK(appName, testType, input, block) \\\n- (void)DISABLED_test##appName##_##testType##_##input                      \\\n{                                                                          \\\n  [_runner runTest:_cmd                                                    \\\n            module:@#appName                                               \\\n      initialProps:@{@#input:@YES}                                         \\\nconfigurationBlock:block];                                                 \\\n}\n\n#define RCT_TEST_CONFIGURATION_BLOCK(appName, block)  \\\n- (void)DISABLED_test##appName                        \\\n{                                                     \\\n  [_runner runTest:_cmd                               \\\n            module:@#appName                          \\\n      initialProps:nil                                \\\nconfigurationBlock:block];                            \\\n}\n\n#define RCTNone   RCTRootViewSizeFlexibilityNone\n#define RCTHeight RCTRootViewSizeFlexibilityHeight\n#define RCTWidth  RCTRootViewSizeFlexibilityWidth\n#define RCTBoth   RCTRootViewSizeFlexibilityWidthAndHeight\n\ntypedef void (^ControlBlock)(RCTRootView*);\n\n@interface SizeFlexibilityTestDelegate : NSObject<RCTRootViewDelegate>\n@end\n\n@implementation SizeFlexibilityTestDelegate\n\n- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView\n{\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n\n  [rootView.bridge.eventDispatcher sendAppEventWithName:@\"rootViewDidChangeIntrinsicSize\"\n                                                   body:@{@\"width\": @(rootView.intrinsicSize.width),\n                                                          @\"height\": @(rootView.intrinsicSize.height)}];\n#pragma clang diagnostic pop\n}\n\n@end\n\nstatic SizeFlexibilityTestDelegate *sizeFlexibilityDelegate()\n{\n  static SizeFlexibilityTestDelegate *delegate;\n  if (delegate == nil) {\n    delegate = [SizeFlexibilityTestDelegate new];\n  }\n\n  return delegate;\n}\n\nstatic ControlBlock simpleSizeFlexibilityBlock(RCTRootViewSizeFlexibility sizeFlexibility)\n{\n  return ^(RCTRootView *rootView){\n    rootView.delegate = sizeFlexibilityDelegate();\n    rootView.sizeFlexibility = sizeFlexibility;\n  };\n}\n\nstatic ControlBlock multipleSizeFlexibilityUpdatesBlock(RCTRootViewSizeFlexibility finalSizeFlexibility)\n{\n  return ^(RCTRootView *rootView){\n\n    NSInteger arr[4] = {RCTNone,\n                        RCTHeight,\n                        RCTWidth,\n                        RCTBoth};\n\n    rootView.delegate = sizeFlexibilityDelegate();\n\n    for (int i = 0; i < 4; ++i) {\n      if (arr[i] != finalSizeFlexibility) {\n        rootView.sizeFlexibility = arr[i];\n      }\n    }\n\n    rootView.sizeFlexibility = finalSizeFlexibility;\n  };\n}\n\nstatic ControlBlock reactContentSizeUpdateBlock(RCTRootViewSizeFlexibility sizeFlexibility)\n{\n  return ^(RCTRootView *rootView){\n    rootView.delegate = sizeFlexibilityDelegate();\n    rootView.sizeFlexibility = sizeFlexibility;\n  };\n}\n\n@interface RCTRootViewIntegrationTests : XCTestCase\n\n@end\n\n@implementation RCTRootViewIntegrationTests\n{\n  RCTTestRunner *_runner;\n}\n\n- (void)setUp\n{\n  _runner = RCTInitRunnerForApp(@\"IntegrationTests/RCTRootViewIntegrationTestApp\", nil, nil);\n}\n\n#pragma mark Logic Tests\n\n// This list should be kept in sync with RCTRootViewIntegrationTestsApp.js\n\n// Simple size flexibility tests - test if the content is measured properly\nRCT_TEST_DATA_CONFIGURATION_BLOCK(SizeFlexibilityUpdateTest, SingleUpdate, none, simpleSizeFlexibilityBlock(RCTNone));\nRCT_TEST_DATA_CONFIGURATION_BLOCK(SizeFlexibilityUpdateTest, SingleUpdate, height, simpleSizeFlexibilityBlock(RCTHeight));\nRCT_TEST_DATA_CONFIGURATION_BLOCK(SizeFlexibilityUpdateTest, SingleUpdate, width, simpleSizeFlexibilityBlock(RCTWidth));\nRCT_TEST_DATA_CONFIGURATION_BLOCK(SizeFlexibilityUpdateTest, SingleUpdate, both, simpleSizeFlexibilityBlock(RCTBoth));\n\n// Consider multiple size flexibility updates in a row. Test if the view's flexibility mode eventually is set to the expected value\nRCT_TEST_DATA_CONFIGURATION_BLOCK(SizeFlexibilityUpdateTest, MultipleUpdates, none, multipleSizeFlexibilityUpdatesBlock(RCTNone));\nRCT_TEST_DATA_CONFIGURATION_BLOCK(SizeFlexibilityUpdateTest, MultipleUpdates, height, multipleSizeFlexibilityUpdatesBlock(RCTHeight));\nRCT_TEST_DATA_CONFIGURATION_BLOCK(SizeFlexibilityUpdateTest, MultipleUpdates, width, multipleSizeFlexibilityUpdatesBlock(RCTWidth));\nRCT_TEST_DATA_CONFIGURATION_BLOCK(SizeFlexibilityUpdateTest, MultipleUpdates, both, multipleSizeFlexibilityUpdatesBlock(RCTBoth));\n\n// Test if the 'rootViewDidChangeIntrinsicSize' delegate method is called after the RN app decides internally to resize\nRCT_TEST_CONFIGURATION_BLOCK(ReactContentSizeUpdateTest, reactContentSizeUpdateBlock(RCTBoth))\n\n// Test if setting 'appProperties' property updates the RN app\nRCT_TEST_CONFIGURATION_BLOCK(PropertiesUpdateTest, ^(RCTRootView *rootView) {\n  rootView.appProperties = @{@\"markTestPassed\":@YES};\n})\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterIntegrationTests/RCTUIManagerScenarioTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <AppKit/AppKit.h>\n#import <XCTest/XCTest.h>\n\n#import <React/RCTUIManager.h>\n#import <React/NSView+React.h>\n\n@interface RCTUIManager (Testing)\n\n- (void)_manageChildren:(NSNumber *)containerReactTag\n        moveFromIndices:(NSArray *)moveFromIndices\n          moveToIndices:(NSArray *)moveToIndices\n      addChildReactTags:(NSArray *)addChildReactTags\n           addAtIndices:(NSArray *)addAtIndices\n        removeAtIndices:(NSArray *)removeAtIndices\n               registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)registry;\n\n@property (nonatomic, readonly) NSMutableDictionary<NSNumber *, NSView *> *viewRegistry;\n\n@end\n\n@interface RCTUIManagerScenarioTests : XCTestCase\n\n@property (nonatomic, readwrite, strong) RCTUIManager *uiManager;\n\n@end\n\n@implementation RCTUIManagerScenarioTests\n\n- (void)setUp\n{\n  [super setUp];\n\n  _uiManager = [RCTUIManager new];\n\n  // Register 20 views to use in the tests\n  for (NSInteger i = 1; i <= 20; i++) {\n    NSView *registeredView = [NSView new];\n    registeredView.reactTag = @(i);\n    _uiManager.viewRegistry[@(i)] = registeredView;\n  }\n}\n\n- (void)testManagingChildrenToAddViews\n{\n\n  NSView *containerView = _uiManager.viewRegistry[@(20)];\n\n  NSMutableArray *addedViews = [NSMutableArray array];\n\n  NSArray *tagsToAdd = @[@1, @2, @3, @4, @5];\n  NSArray *addAtIndices = @[@0, @1, @2, @3, @4];\n  for (NSNumber *tag in tagsToAdd) {\n    [addedViews addObject:_uiManager.viewRegistry[tag]];\n  }\n\n  // Add views 1-5 to view 20\n  [_uiManager _manageChildren:@20\n              moveFromIndices:nil\n                moveToIndices:nil\n            addChildReactTags:tagsToAdd\n                 addAtIndices:addAtIndices\n              removeAtIndices:nil\n                     registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)_uiManager.viewRegistry];\n\n  [_uiManager.viewRegistry[@20] didUpdateReactSubviews];\n\n  XCTAssertTrue([[containerView reactSubviews] count] == 5,\n               @\"Expect to have 5 react subviews after calling manage children \\\n               with 5 tags to add, instead have %lu\", (unsigned long)[[containerView reactSubviews] count]);\n  for (NSView *view in addedViews) {\n    XCTAssertTrue([view superview] == containerView,\n                 @\"Expected to have manage children successfully add children\");\n    [view removeFromSuperview];\n  }\n}\n\n- (void)testManagingChildrenToRemoveViews\n{\n  NSView *containerView = _uiManager.viewRegistry[@(20)];\n\n  NSMutableArray *removedViews = [NSMutableArray array];\n\n  NSArray *removeAtIndices = @[@0, @4, @8, @12, @16];\n  for (NSNumber *index in removeAtIndices) {\n    NSNumber *reactTag = @(index.integerValue + 2);\n    [removedViews addObject:_uiManager.viewRegistry[reactTag]];\n  }\n  for (NSInteger i = 2; i < 20; i++) {\n    NSView *view = _uiManager.viewRegistry[@(i)];\n    [containerView insertReactSubview:view atIndex:containerView.reactSubviews.count];\n  }\n\n  // Remove views 1-5 from view 20\n  [_uiManager _manageChildren:@20\n              moveFromIndices:nil\n                moveToIndices:nil\n            addChildReactTags:nil\n                 addAtIndices:nil\n              removeAtIndices:removeAtIndices\n                     registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)_uiManager.viewRegistry];\n\n [_uiManager.viewRegistry[@20] didUpdateReactSubviews];\n\n  XCTAssertEqual(containerView.reactSubviews.count, (NSUInteger)13,\n               @\"Expect to have 13 react subviews after calling manage children\\\n               with 5 tags to remove and 18 prior children, instead have %zd\",\n               containerView.reactSubviews.count);\n  for (NSView *view in removedViews) {\n    XCTAssertTrue([view superview] == nil,\n                 @\"Expected to have manage children successfully remove children\");\n    // After removing views are unregistered - we need to reregister\n    _uiManager.viewRegistry[view.reactTag] = view;\n  }\n  for (NSInteger i = 2; i < 20; i++) {\n\n    NSView *view = _uiManager.viewRegistry[@(i)];\n\n    if (![removedViews containsObject:view]) {\n      XCTAssertTrue([view superview] == containerView,\n                   @\"Should not have removed view with react tag %ld during delete but did\", (long)i);\n      [view removeFromSuperview];\n    }\n  }\n}\n\n// We want to start with views 1-10 added at indices 0-9\n// Then we'll remove indices 2, 3, 5 and 8\n// Add views 11 and 12 to indices 0 and 6\n// And move indices 4 and 9 to 1 and 7\n// So in total it goes from:\n// [1,2,3,4,5,6,7,8,9,10]\n// to\n// [11,5,1,2,7,8,12,10]\n- (void)testManagingChildrenToAddRemoveAndMove\n{\n  NSView *containerView = _uiManager.viewRegistry[@(20)];\n\n  NSArray *removeAtIndices = @[@2, @3, @5, @8];\n  NSArray *addAtIndices = @[@0, @6];\n  NSArray *tagsToAdd = @[@11, @12];\n  NSArray *moveFromIndices = @[@4, @9];\n  NSArray *moveToIndices = @[@1, @7];\n\n  // We need to keep these in array to keep them around\n  NSMutableArray *viewsToRemove = [NSMutableArray array];\n  for (NSUInteger i = 0; i < removeAtIndices.count; i++) {\n    NSNumber *reactTagToRemove = @([removeAtIndices[i] integerValue] + 1);\n    NSView *viewToRemove = _uiManager.viewRegistry[reactTagToRemove];\n    [viewsToRemove addObject:viewToRemove];\n  }\n\n  for (NSInteger i = 1; i < 11; i++) {\n    NSView *view = _uiManager.viewRegistry[@(i)];\n    [containerView insertReactSubview:view atIndex:containerView.reactSubviews.count];\n\n  }\n\n  [_uiManager _manageChildren:@20\n              moveFromIndices:moveFromIndices\n                moveToIndices:moveToIndices\n            addChildReactTags:tagsToAdd\n                 addAtIndices:addAtIndices\n              removeAtIndices:removeAtIndices\n                     registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)_uiManager.viewRegistry];\n\n  XCTAssertTrue([[containerView reactSubviews] count] == 8,\n               @\"Expect to have 8 react subviews after calling manage children,\\\n               instead have the following subviews %@\", [containerView reactSubviews]);\n\n  NSArray *expectedReactTags = @[@11, @5, @1, @2, @7, @8, @12, @10];\n  for (NSUInteger i = 0; i < containerView.subviews.count; i++) {\n    XCTAssertEqualObjects([[containerView reactSubviews][i] reactTag], expectedReactTags[i],\n                 @\"Expected subview at index %ld to have react tag #%@ but has tag #%@\",\n                         (long)i, expectedReactTags[i], [[containerView reactSubviews][i] reactTag]);\n  }\n\n  // Clean up after ourselves\n  for (NSInteger i = 1; i < 13; i++) {\n    NSView *view = _uiManager.viewRegistry[@(i)];\n    [view removeFromSuperview];\n  }\n  for (NSView *view in viewsToRemove) {\n    _uiManager.viewRegistry[view.reactTag] = view;\n  }\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterIntegrationTests/RNTesterIntegrationTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n#import <XCTest/XCTest.h>\n\n#import <RCTTest/RCTTestRunner.h>\n\n\n#define RCT_TEST(name)                  \\\n- (void)test##name                      \\\n{                                       \\\n  [_runner runTest:_cmd module:@#name]; \\\n}\n\n#define RCT_TEST_ONLY_WITH_PACKAGER(name) \\\n- (void)test##name                        \\\n{                                         \\\n  if (getenv(\"CI_USE_PACKAGER\")) {        \\\n    [_runner runTest:_cmd module:@#name]; \\\n  }                                       \\\n}\n\n@interface RNTesterIntegrationTests : XCTestCase\n\n@end\n\n@implementation RNTesterIntegrationTests\n{\n  RCTTestRunner *_runner;\n}\n\n- (void)setUp\n{\n  _runner = RCTInitRunnerForApp(@\"IntegrationTests/IntegrationTestsApp\", nil, nil);\n  _runner.recordMode = NO;\n}\n\n#pragma mark - Test harness\n\n- (void)testTheTester_waitOneFrame\n{\n  [_runner runTest:_cmd\n            module:@\"IntegrationTestHarnessTest\"\n      initialProps:@{@\"waitOneFrame\": @YES}\nconfigurationBlock:nil];\n}\n\n- (void)testTheTester_ExpectError\n{\n  [_runner runTest:_cmd\n            module:@\"IntegrationTestHarnessTest\"\n      initialProps:@{@\"shouldThrow\": @YES}\nconfigurationBlock:nil\n  expectErrorRegex:@\"because shouldThrow\"];\n}\n\n#pragma mark - JS tests\n\n// This list should be kept in sync with IntegrationTestsApp.js\nRCT_TEST(IntegrationTestHarnessTest)\nRCT_TEST(AsyncStorageTest)\nRCT_TEST(TimersTest)\nRCT_TEST(AppEventsTest)\n// RCT_TEST(ImageCachePolicyTest) // Fix Image cache policy\n// RCT_TEST(ImageSnapshotTest) // Fix snapshots\n//RCT_TEST(LayoutEventsTest) // Disabled due to flakiness: #8686784\n// RCT_TEST(SimpleSnapshotTest)\nRCT_TEST(SyncMethodTest)\nRCT_TEST(PromiseTest)\nRCT_TEST_ONLY_WITH_PACKAGER(WebSocketTest)\nRCT_TEST(AccessibilityManagerTest)\n\n#if !TARGET_OS_TV // tvOS does not fully support WebView\nRCT_TEST(WebViewTest)\n#endif\n\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterIntegrationTests/RNTesterSnapshotTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <AppKit/AppKit.h>\n#import <XCTest/XCTest.h>\n\n#import <RCTTest/RCTTestRunner.h>\n\n@interface RNTesterSnapshotTests : XCTestCase\n{\n  RCTTestRunner *_runner;\n}\n\n@end\n\n@implementation RNTesterSnapshotTests\n\n- (void)setUp\n{\n  _runner = RCTInitRunnerForApp(@\"RNTester/js/RNTesterApp.macos\", nil, nil);\n  _runner.recordMode = NO;\n}\n\n#define RCT_TEST(name)                  \\\n- (void)test##name                      \\\n{                                       \\\n  [_runner runTest:_cmd module:@#name]; \\\n}\n\n//RCT_TEST(ViewExample)\n//RCT_TEST(LayoutExample)\n//RCT_TEST(ARTExample)\n//RCT_TEST(ScrollViewExample)\n//RCT_TEST(TextExample)\n#if !TARGET_OS_TV\n// No switch or slider available on tvOS\n//RCT_TEST(SwitchExample)\n//RCT_TEST(SliderExample)\n// TabBarExample on tvOS passes locally but not on Travis\n// RCT_TEST(TabBarExample)\n#endif\n\n- (void)testZZZNotInRecordMode\n{\n  XCTAssertFalse(_runner.recordMode, @\"Don't forget to turn record mode back to off\");\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterIntegrationTests/RNTesterTestModule.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridgeModule.h>\n\n@interface RNTesterTestModule : NSObject <RCTBridgeModule>\n\n@end\n\n@implementation RNTesterTestModule\n\nRCT_EXPORT_MODULE(RNTesterTestModule)\n\nRCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(echoString:(NSString *)input)\n{\n  return input;\n}\n\nRCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(methodThatReturnsNil)\n{\n  return nil;\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterLegacy.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t001BFCE41D838343008E587E /* RCTMultipartStreamReaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */; };\n\t\t1300627F1B59179B0043FE5A /* RCTGzipTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1300627E1B59179B0043FE5A /* RCTGzipTests.m */; };\n\t\t13129DD41C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */; };\n\t\t13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FE81AA91428003F314A /* libRCTImage.a */; };\n\t\t134180011AA9153C003F314A /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FEF1AA914B8003F314A /* libRCTText.a */; };\n\t\t1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1341802B1AA91779003F314A /* libRCTNetwork.a */; };\n\t\t134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 134A8A251AACED6A00945AAE /* libRCTGeolocation.a */; };\n\t\t134CB92A1C85A38800265FA6 /* RCTModuleInitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 134CB9291C85A38800265FA6 /* RCTModuleInitTests.m */; };\n\t\t1380DCD41E70C44800E7C47D /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1380DC991E70C0DD00E7C47D /* libReact.a */; };\n\t\t138D6A181B53CD440074A87E /* RCTShadowViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 138D6A161B53CD440074A87E /* RCTShadowViewTests.m */; };\n\t\t138DEE241B9EDFB6007F4EA5 /* libRCTCameraRoll.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 138DEE091B9EDDDB007F4EA5 /* libRCTCameraRoll.a */; };\n\t\t1393D0381B68CD1300E1B601 /* RCTModuleMethodTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1393D0371B68CD1300E1B601 /* RCTModuleMethodTests.mm */; };\n\t\t139FDEDB1B0651FB00C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDED91B0651EA00C62182 /* libRCTWebSocket.a */; };\n\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n\t\t13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };\n\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n\t\t13B6C1A31C34225900D3FAF5 /* RCTURLUtilsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B6C1A21C34225900D3FAF5 /* RCTURLUtilsTests.m */; };\n\t\t13BCE84F1C9C209600DD7AAD /* RCTComponentPropsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BCE84E1C9C209600DD7AAD /* RCTComponentPropsTests.m */; };\n\t\t13DB03481B5D2ED500C27245 /* RCTJSONTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DB03471B5D2ED500C27245 /* RCTJSONTests.m */; };\n\t\t13DF61B61B67A45000EDB188 /* RCTMethodArgumentTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DF61B51B67A45000EDB188 /* RCTMethodArgumentTests.m */; };\n\t\t13E501F11D07A84A005F35D8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13E501A31D07A502005F35D8 /* libRCTAnimation.a */; };\n\t\t143BC5A11B21E45C00462512 /* RNTesterSnapshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 143BC5A01B21E45C00462512 /* RNTesterSnapshotTests.m */; };\n\t\t144D21241B2204C5006DB32B /* RCTImageUtilTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 144D21231B2204C5006DB32B /* RCTImageUtilTests.m */; };\n\t\t147CED4C1AB3532B00DA3E4C /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 147CED4B1AB34F8C00DA3E4C /* libRCTActionSheet.a */; };\n\t\t1497CFAC1B21F5E400C1F8F2 /* RCTAllocationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */; };\n\t\t1497CFAD1B21F5E400C1F8F2 /* RCTBridgeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA51B21F5E400C1F8F2 /* RCTBridgeTests.m */; };\n\t\t1497CFAE1B21F5E400C1F8F2 /* RCTJSCExecutorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA61B21F5E400C1F8F2 /* RCTJSCExecutorTests.m */; settings = {COMPILER_FLAGS = \"-fno-objc-arc\"; }; };\n\t\t1497CFAF1B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */; };\n\t\t1497CFB01B21F5E400C1F8F2 /* RCTFontTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA81B21F5E400C1F8F2 /* RCTFontTests.m */; };\n\t\t1497CFB11B21F5E400C1F8F2 /* RCTEventDispatcherTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */; };\n\t\t1497CFB31B21F5E400C1F8F2 /* RCTUIManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFAB1B21F5E400C1F8F2 /* RCTUIManagerTests.m */; };\n\t\t14B6DA821B276C5900BF4DD1 /* libRCTTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58005BEE1ABA80530062E044 /* libRCTTest.a */; };\n\t\t14D6D7111B220EB3001FB087 /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14D6D7101B220EB3001FB087 /* libOCMock.a */; };\n\t\t14D6D71E1B2222EF001FB087 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 147CED4B1AB34F8C00DA3E4C /* libRCTActionSheet.a */; };\n\t\t14D6D7201B2222EF001FB087 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 134A8A251AACED6A00945AAE /* libRCTGeolocation.a */; };\n\t\t14D6D7211B2222EF001FB087 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FE81AA91428003F314A /* libRCTImage.a */; };\n\t\t14D6D7221B2222EF001FB087 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1341802B1AA91779003F314A /* libRCTNetwork.a */; };\n\t\t14D6D7231B2222EF001FB087 /* libRCTPushNotification.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14DC67F11AB71876001358AB /* libRCTPushNotification.a */; };\n\t\t14D6D7241B2222EF001FB087 /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 834C36D21AF8DA610019C93C /* libRCTSettings.a */; };\n\t\t14D6D7251B2222EF001FB087 /* libRCTTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58005BEE1ABA80530062E044 /* libRCTTest.a */; };\n\t\t14D6D7261B2222EF001FB087 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FEF1AA914B8003F314A /* libRCTText.a */; };\n\t\t14D6D7271B2222EF001FB087 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D85B829C1AB6D5CE003F4FE2 /* libRCTVibration.a */; };\n\t\t14D6D7281B2222EF001FB087 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDED91B0651EA00C62182 /* libRCTWebSocket.a */; };\n\t\t14DC67F41AB71881001358AB /* libRCTPushNotification.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14DC67F11AB71876001358AB /* libRCTPushNotification.a */; };\n\t\t272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; };\n\t\t27B885561BED29AF00008352 /* RCTRootViewIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */; };\n\t\t27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; };\n\t\t2D4624FA1DA2EAC300C74D09 /* RCTLoggingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */; };\n\t\t2D4624FB1DA2EAC300C74D09 /* RCTRootViewIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */; };\n\t\t2D4624FC1DA2EAC300C74D09 /* RNTesterIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DB99D0B1BA0340600302749 /* RNTesterIntegrationTests.m */; };\n\t\t2D4624FD1DA2EAC300C74D09 /* RNTesterSnapshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 143BC5A01B21E45C00462512 /* RNTesterSnapshotTests.m */; };\n\t\t2D4624FE1DA2EAC300C74D09 /* RCTUIManagerScenarioTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 83636F8E1B53F22C009F943E /* RCTUIManagerScenarioTests.m */; };\n\t\t2D4625351DA2EBBE00C74D09 /* libRCTTest-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323CC1DA2DD8B000FE1B8 /* libRCTTest-tvOS.a */; };\n\t\t2D4BD8D21DA2E20D005AC8A8 /* RCTURLUtilsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B6C1A21C34225900D3FAF5 /* RCTURLUtilsTests.m */; };\n\t\t2D4BD8D31DA2E20D005AC8A8 /* RCTBundleURLProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FF44371CF6111500720EFD /* RCTBundleURLProviderTests.m */; };\n\t\t2D4BD8D41DA2E20D005AC8A8 /* RCTAllocationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */; };\n\t\t2D4BD8D51DA2E20D005AC8A8 /* RCTBridgeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA51B21F5E400C1F8F2 /* RCTBridgeTests.m */; };\n\t\t2D4BD8D61DA2E20D005AC8A8 /* RCTJSCExecutorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA61B21F5E400C1F8F2 /* RCTJSCExecutorTests.m */; };\n\t\t2D4BD8D71DA2E20D005AC8A8 /* RCTConvert_NSURLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */; };\n\t\t2D4BD8D81DA2E20D005AC8A8 /* RCTFontTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA81B21F5E400C1F8F2 /* RCTFontTests.m */; };\n\t\t2D4BD8D91DA2E20D005AC8A8 /* RCTEventDispatcherTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */; };\n\t\t2D4BD8DA1DA2E20D005AC8A8 /* RCTGzipTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1300627E1B59179B0043FE5A /* RCTGzipTests.m */; };\n\t\t2D4BD8DB1DA2E20D005AC8A8 /* RCTImageLoaderHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */; };\n\t\t2D4BD8DC1DA2E20D005AC8A8 /* RCTImageLoaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8385CEF41B873B5C00C6273E /* RCTImageLoaderTests.m */; };\n\t\t2D4BD8DD1DA2E20D005AC8A8 /* RCTImageUtilTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 144D21231B2204C5006DB32B /* RCTImageUtilTests.m */; };\n\t\t2D4BD8DE1DA2E20D005AC8A8 /* RCTJSONTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DB03471B5D2ED500C27245 /* RCTJSONTests.m */; };\n\t\t2D4BD8DF1DA2E20D005AC8A8 /* RCTMethodArgumentTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DF61B51B67A45000EDB188 /* RCTMethodArgumentTests.m */; };\n\t\t2D4BD8E01DA2E20D005AC8A8 /* RCTModuleInitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 134CB9291C85A38800265FA6 /* RCTModuleInitTests.m */; };\n\t\t2D4BD8E11DA2E20D005AC8A8 /* RCTModuleInitNotificationRaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */; };\n\t\t2D4BD8E21DA2E20D005AC8A8 /* RCTModuleMethodTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1393D0371B68CD1300E1B601 /* RCTModuleMethodTests.mm */; };\n\t\t2D4BD8E31DA2E20D005AC8A8 /* RCTShadowViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 138D6A161B53CD440074A87E /* RCTShadowViewTests.m */; };\n\t\t2D4BD8E41DA2E20D005AC8A8 /* RCTUIManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFAB1B21F5E400C1F8F2 /* RCTUIManagerTests.m */; };\n\t\t2D4BD8E51DA2E20D005AC8A8 /* RCTComponentPropsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BCE84E1C9C209600DD7AAD /* RCTComponentPropsTests.m */; };\n\t\t2D4BD8E61DA2E20D005AC8A8 /* RNTesterUnitTestsBundle.js in Resources */ = {isa = PBXBuildFile; fileRef = 3DD981D51D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js */; };\n\t\t2D4BD8E71DA2E20D005AC8A8 /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14D6D7101B220EB3001FB087 /* libOCMock.a */; };\n\t\t2D8C2E321DA40403000EE098 /* RCTMultipartStreamReaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */; };\n\t\t2DD323DC1DA2DDBF000FE1B8 /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; };\n\t\t2DD323DD1DA2DDBF000FE1B8 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; };\n\t\t2DD323DE1DA2DDBF000FE1B8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n\t\t2DD323DF1DA2DDBF000FE1B8 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t2DD323E01DA2DDBF000FE1B8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n\t\t2DD323E11DA2DDBF000FE1B8 /* legacy_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */; };\n\t\t2DD323E21DA2DDBF000FE1B8 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB61A68108700A75B9A /* Info.plist */; };\n\t\t2DD323E31DA2DE3F000FE1B8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323B51DA2DD8B000FE1B8 /* libRCTAnimation.a */; };\n\t\t2DD323E51DA2DE3F000FE1B8 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323BF1DA2DD8B000FE1B8 /* libRCTLinking-tvOS.a */; };\n\t\t2DD323E61DA2DE3F000FE1B8 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323C31DA2DD8B000FE1B8 /* libRCTNetwork-tvOS.a */; };\n\t\t2DD323E71DA2DE3F000FE1B8 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323C81DA2DD8B000FE1B8 /* libRCTSettings-tvOS.a */; };\n\t\t2DD323E81DA2DE3F000FE1B8 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323D01DA2DD8B000FE1B8 /* libRCTText-tvOS.a */; };\n\t\t2DD323E91DA2DE3F000FE1B8 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323D51DA2DD8B000FE1B8 /* libRCTWebSocket-tvOS.a */; };\n\t\t3578590A1B28D2CF00341EDB /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 357859011B28D2C500341EDB /* libRCTLinking.a */; };\n\t\t39AA31A41DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 39AA31A31DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m */; };\n\t\t3D05746D1DE6008900184BB4 /* libRCTPushNotification-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D05746C1DE6008900184BB4 /* libRCTPushNotification-tvOS.a */; };\n\t\t3D13F8481D6F6AF900E69E0E /* ImageInBundle.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F8441D6F6AF200E69E0E /* ImageInBundle.png */; };\n\t\t3D13F84A1D6F6AFD00E69E0E /* OtherImages.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F8451D6F6AF200E69E0E /* OtherImages.xcassets */; };\n\t\t3D299BAF1D33EBFA00FA1057 /* RCTLoggingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */; };\n\t\t3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */; };\n\t\t3D302F221DF8285100D6DDAE /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323BB1DA2DD8B000FE1B8 /* libRCTImage-tvOS.a */; };\n\t\t3D4153591F276F4E005B8EFE /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1380DC991E70C0DD00E7C47D /* libReact.a */; };\n\t\t3D4153631F27700D005B8EFE /* libART.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D4153601F276FF9005B8EFE /* libART.a */; };\n\t\t3D4153641F277011005B8EFE /* libART-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D4153621F276FF9005B8EFE /* libART-tvOS.a */; };\n\t\t3D56F9F11D6F6E9B00F53A06 /* RNTesterBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F83E1D6F6AE000E69E0E /* RNTesterBundle.bundle */; };\n\t\t3DB99D0C1BA0340600302749 /* RNTesterIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DB99D0B1BA0340600302749 /* RNTesterIntegrationTests.m */; };\n\t\t3DCE52BC1FEAAF8F00613583 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1380DC9B1E70C0DD00E7C47D /* libReact.a */; };\n\t\t3DD981D61D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js in Resources */ = {isa = PBXBuildFile; fileRef = 3DD981D51D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js */; };\n\t\t68FF44381CF6111500720EFD /* RCTBundleURLProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FF44371CF6111500720EFD /* RCTBundleURLProviderTests.m */; };\n\t\t834C36EC1AF8DED70019C93C /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 834C36D21AF8DA610019C93C /* libRCTSettings.a */; };\n\t\t83636F8F1B53F22C009F943E /* RCTUIManagerScenarioTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 83636F8E1B53F22C009F943E /* RCTUIManagerScenarioTests.m */; };\n\t\t8385CEF51B873B5C00C6273E /* RCTImageLoaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8385CEF41B873B5C00C6273E /* RCTImageLoaderTests.m */; };\n\t\t8385CF041B87479200C6273E /* RCTImageLoaderHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */; };\n\t\tBC9C03401DC9F1D600B1C635 /* RCTDevMenuTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9C033F1DC9F1D600B1C635 /* RCTDevMenuTests.m */; };\n\t\tC654F14C1EB34D0C000B7A9A /* RNTesterTestModule.m in Sources */ = {isa = PBXBuildFile; fileRef = C654F14B1EB34D0C000B7A9A /* RNTesterTestModule.m */; };\n\t\tC654F16E1EB34D14000B7A9A /* RNTesterTestModule.m in Sources */ = {isa = PBXBuildFile; fileRef = C654F14B1EB34D0C000B7A9A /* RNTesterTestModule.m */; };\n\t\tD85B829E1AB6D5D7003F4FE2 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D85B829C1AB6D5CE003F4FE2 /* libRCTVibration.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t13417FE71AA91428003F314A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5115D1A9E6B3D00147676;\n\t\t\tremoteInfo = RCTImage;\n\t\t};\n\t\t13417FEE1AA914B8003F314A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5119B1A9E6C1200147676;\n\t\t\tremoteInfo = RCTText;\n\t\t};\n\t\t1341802A1AA91779003F314A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 134180261AA91779003F314A /* RCTNetwork.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B511DB1A9E6C8500147676;\n\t\t\tremoteInfo = RCTNetwork;\n\t\t};\n\t\t134A8A241AACED6A00945AAE /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTGeolocation;\n\t\t};\n\t\t1380DC981E70C0DD00E7C47D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1380DC8B1E70C0DC00E7C47D /* ReactLegacy.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;\n\t\t\tremoteInfo = React;\n\t\t};\n\t\t1380DC9A1E70C0DD00E7C47D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1380DC8B1E70C0DC00E7C47D /* ReactLegacy.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28131D9B038B00D4039D;\n\t\t\tremoteInfo = \"React-tvOS\";\n\t\t};\n\t\t1380DC9C1E70C0DD00E7C47D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1380DC8B1E70C0DC00E7C47D /* ReactLegacy.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3C059A1DE3340900C268FA;\n\t\t\tremoteInfo = yoga;\n\t\t};\n\t\t1380DC9E1E70C0DD00E7C47D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1380DC8B1E70C0DC00E7C47D /* ReactLegacy.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3C06751DE3340C00C268FA;\n\t\t\tremoteInfo = \"yoga-tvOS\";\n\t\t};\n\t\t1380DCA01E70C0DD00E7C47D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1380DC8B1E70C0DC00E7C47D /* ReactLegacy.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4;\n\t\t\tremoteInfo = cxxreact;\n\t\t};\n\t\t1380DCA21E70C0DD00E7C47D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1380DC8B1E70C0DC00E7C47D /* ReactLegacy.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;\n\t\t\tremoteInfo = \"cxxreact-tvOS\";\n\t\t};\n\t\t1380DCA41E70C0DD00E7C47D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1380DC8B1E70C0DC00E7C47D /* ReactLegacy.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4;\n\t\t\tremoteInfo = jschelpers;\n\t\t};\n\t\t1380DCA61E70C0DD00E7C47D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1380DC8B1E70C0DC00E7C47D /* ReactLegacy.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;\n\t\t\tremoteInfo = \"jschelpers-tvOS\";\n\t\t};\n\t\t138DEE081B9EDDDB007F4EA5 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 138DEE021B9EDDDB007F4EA5 /* RCTCameraRoll.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5115D1A9E6B3D00147676;\n\t\t\tremoteInfo = RCTImage;\n\t\t};\n\t\t139FDED81B0651EA00C62182 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3C86DF461ADF2C930047B81A;\n\t\t\tremoteInfo = RCTWebSocket;\n\t\t};\n\t\t13E501A21D07A502005F35D8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13E5019C1D07A502005F35D8 /* RCTAnimation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTAnimation;\n\t\t};\n\t\t143BC59B1B21E3E100462512 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 13B07F861A680F5B00A75B9A;\n\t\t\tremoteInfo = RNTester;\n\t\t};\n\t\t147CED4A1AB34F8C00DA3E4C /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14E0EEC81AB118F7000DECC3 /* RCTActionSheet.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTActionSheet;\n\t\t};\n\t\t14DC67F01AB71876001358AB /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14DC67E71AB71876001358AB /* RCTPushNotification.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTPushNotification;\n\t\t};\n\t\t2D4624C31DA2EA6900C74D09 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 2DD3238F1DA2DD8A000FE1B8;\n\t\t\tremoteInfo = \"RNTester-tvOS\";\n\t\t};\n\t\t2DD323A61DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 2DD3238F1DA2DD8A000FE1B8;\n\t\t\tremoteInfo = \"RNTester-tvOS\";\n\t\t};\n\t\t2DD323B41DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13E5019C1D07A502005F35D8 /* RCTAnimation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28201D9B03D100D4039D;\n\t\t\tremoteInfo = \"RCTAnimation-tvOS\";\n\t\t};\n\t\t2DD323BA1DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A283A1D9B042B00D4039D;\n\t\t\tremoteInfo = \"RCTImage-tvOS\";\n\t\t};\n\t\t2DD323BE1DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 357858F81B28D2C400341EDB /* RCTLinking.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28471D9B043800D4039D;\n\t\t\tremoteInfo = \"RCTLinking-tvOS\";\n\t\t};\n\t\t2DD323C21DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 134180261AA91779003F314A /* RCTNetwork.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28541D9B044C00D4039D;\n\t\t\tremoteInfo = \"RCTNetwork-tvOS\";\n\t\t};\n\t\t2DD323C71DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13CC9D481AEED2B90020D1C2 /* RCTSettings.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28611D9B046600D4039D;\n\t\t\tremoteInfo = \"RCTSettings-tvOS\";\n\t\t};\n\t\t2DD323CB1DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 58005BE41ABA80530062E044 /* RCTTest.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A286E1D9B047700D4039D;\n\t\t\tremoteInfo = \"RCTTest-tvOS\";\n\t\t};\n\t\t2DD323CF1DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A287B1D9B048500D4039D;\n\t\t\tremoteInfo = \"RCTText-tvOS\";\n\t\t};\n\t\t2DD323D41DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28881D9B049200D4039D;\n\t\t\tremoteInfo = \"RCTWebSocket-tvOS\";\n\t\t};\n\t\t357859001B28D2C500341EDB /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 357858F81B28D2C400341EDB /* RCTLinking.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTLinking;\n\t\t};\n\t\t3D05746B1DE6008900184BB4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 14DC67E71AB71876001358AB /* RCTPushNotification.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D05745F1DE6004600184BB4;\n\t\t\tremoteInfo = \"RCTPushNotification-tvOS\";\n\t\t};\n\t\t3D13F84B1D6F6B5F00E69E0E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D13F83D1D6F6AE000E69E0E;\n\t\t\tremoteInfo = RNTesterBundle;\n\t\t};\n\t\t3D41535F1F276FF9005B8EFE /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 3D41535A1F276FF9005B8EFE /* ART.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 0CF68AC11AF0540F00FF9E5C;\n\t\t\tremoteInfo = ART;\n\t\t};\n\t\t3D4153611F276FF9005B8EFE /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 3D41535A1F276FF9005B8EFE /* ART.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 323A12871E5F266B004975B8;\n\t\t\tremoteInfo = \"ART-tvOS\";\n\t\t};\n\t\t3DBE0D6D1F3B18810099AA32 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3DBE0D001F3B181A0099AA32;\n\t\t\tremoteInfo = fishhook;\n\t\t};\n\t\t3DBE0D6F1F3B18810099AA32 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;\n\t\t\tremoteInfo = \"fishhook-tvOS\";\n\t\t};\n\t\t58005BED1ABA80530062E044 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 58005BE41ABA80530062E044 /* RCTTest.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 580C376F1AB104AF0015E709;\n\t\t\tremoteInfo = RCTTest;\n\t\t};\n\t\t834C36D11AF8DA610019C93C /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 13CC9D481AEED2B90020D1C2 /* RCTSettings.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTSettings;\n\t\t};\n\t\tD85B829B1AB6D5CE003F4FE2 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 832C81801AAF6DEF007FA2F7;\n\t\t\tremoteInfo = RCTVibration;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMultipartStreamReaderTests.m; sourceTree = \"<group>\"; };\n\t\t004D289E1AAF61C70097A701 /* RNTesterUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNTesterUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t1300627E1B59179B0043FE5A /* RCTGzipTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTGzipTests.m; sourceTree = \"<group>\"; };\n\t\t13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModuleInitNotificationRaceTests.m; sourceTree = \"<group>\"; };\n\t\t13417FE31AA91428003F314A /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTImage.xcodeproj; path = ../Libraries/Image/RCTImage.xcodeproj; sourceTree = \"<group>\"; };\n\t\t13417FEA1AA914B8003F314A /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTText.xcodeproj; path = ../Libraries/Text/RCTText.xcodeproj; sourceTree = \"<group>\"; };\n\t\t134180261AA91779003F314A /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTNetwork.xcodeproj; path = ../Libraries/Network/RCTNetwork.xcodeproj; sourceTree = \"<group>\"; };\n\t\t134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTGeolocation.xcodeproj; path = ../Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = \"<group>\"; };\n\t\t134CB9291C85A38800265FA6 /* RCTModuleInitTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModuleInitTests.m; sourceTree = \"<group>\"; };\n\t\t1380DC8B1E70C0DC00E7C47D /* ReactLegacy.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = ReactLegacy.xcodeproj; path = ../React/ReactLegacy.xcodeproj; sourceTree = \"<group>\"; };\n\t\t138D6A161B53CD440074A87E /* RCTShadowViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTShadowViewTests.m; sourceTree = \"<group>\"; };\n\t\t138DEE021B9EDDDB007F4EA5 /* RCTCameraRoll.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTCameraRoll.xcodeproj; path = ../Libraries/CameraRoll/RCTCameraRoll.xcodeproj; sourceTree = \"<group>\"; };\n\t\t1393D0371B68CD1300E1B601 /* RCTModuleMethodTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTModuleMethodTests.mm; sourceTree = \"<group>\"; };\n\t\t139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTWebSocket.xcodeproj; path = ../Libraries/WebSocket/RCTWebSocket.xcodeproj; sourceTree = \"<group>\"; };\n\t\t13B07F961A680F5B00A75B9A /* RNTester.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNTester.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNTester/AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = RNTester/AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = \"<group>\"; };\n\t\t13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNTester/Images.xcassets; sourceTree = \"<group>\"; };\n\t\t13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNTester/Info.plist; sourceTree = \"<group>\"; };\n\t\t13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = RNTester/main.m; sourceTree = \"<group>\"; };\n\t\t13B6C1A21C34225900D3FAF5 /* RCTURLUtilsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTURLUtilsTests.m; sourceTree = \"<group>\"; };\n\t\t13BCE84E1C9C209600DD7AAD /* RCTComponentPropsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTComponentPropsTests.m; sourceTree = \"<group>\"; };\n\t\t13CC9D481AEED2B90020D1C2 /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTSettings.xcodeproj; path = ../Libraries/Settings/RCTSettings.xcodeproj; sourceTree = \"<group>\"; };\n\t\t13DB03471B5D2ED500C27245 /* RCTJSONTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJSONTests.m; sourceTree = \"<group>\"; };\n\t\t13DF61B51B67A45000EDB188 /* RCTMethodArgumentTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMethodArgumentTests.m; sourceTree = \"<group>\"; };\n\t\t13E5019C1D07A502005F35D8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTAnimation.xcodeproj; path = ../Libraries/NativeAnimation/RCTAnimation.xcodeproj; sourceTree = \"<group>\"; };\n\t\t143BC57E1B21E18100462512 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t143BC5951B21E3E100462512 /* RNTesterIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNTesterIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t143BC5981B21E3E100462512 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t143BC5A01B21E45C00462512 /* RNTesterSnapshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterSnapshotTests.m; sourceTree = \"<group>\"; };\n\t\t144D21231B2204C5006DB32B /* RCTImageUtilTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageUtilTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAllocationTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFA51B21F5E400C1F8F2 /* RCTBridgeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBridgeTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFA61B21F5E400C1F8F2 /* RCTJSCExecutorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJSCExecutorTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert_NSURLTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFA81B21F5E400C1F8F2 /* RCTFontTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTFontTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTEventDispatcherTests.m; sourceTree = \"<group>\"; };\n\t\t1497CFAB1B21F5E400C1F8F2 /* RCTUIManagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManagerTests.m; sourceTree = \"<group>\"; };\n\t\t14D6D7021B220AE3001FB087 /* NSNotificationCenter+OCMAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"NSNotificationCenter+OCMAdditions.h\"; sourceTree = \"<group>\"; };\n\t\t14D6D7031B220AE3001FB087 /* OCMArg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMArg.h; sourceTree = \"<group>\"; };\n\t\t14D6D7041B220AE3001FB087 /* OCMConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMConstraint.h; sourceTree = \"<group>\"; };\n\t\t14D6D7051B220AE3001FB087 /* OCMLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMLocation.h; sourceTree = \"<group>\"; };\n\t\t14D6D7061B220AE3001FB087 /* OCMMacroState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMMacroState.h; sourceTree = \"<group>\"; };\n\t\t14D6D7071B220AE3001FB087 /* OCMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMock.h; sourceTree = \"<group>\"; };\n\t\t14D6D7081B220AE3001FB087 /* OCMockObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMockObject.h; sourceTree = \"<group>\"; };\n\t\t14D6D7091B220AE3001FB087 /* OCMRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMRecorder.h; sourceTree = \"<group>\"; };\n\t\t14D6D70A1B220AE3001FB087 /* OCMStubRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMStubRecorder.h; sourceTree = \"<group>\"; };\n\t\t14D6D7101B220EB3001FB087 /* libOCMock.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libOCMock.a; sourceTree = \"<group>\"; };\n\t\t14DC67E71AB71876001358AB /* RCTPushNotification.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTPushNotification.xcodeproj; path = ../Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj; sourceTree = \"<group>\"; };\n\t\t14E0EEC81AB118F7000DECC3 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTActionSheet.xcodeproj; path = ../Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = \"<group>\"; };\n\t\t272E6B3B1BEA849E001FCF37 /* UpdatePropertiesExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UpdatePropertiesExampleView.h; path = RNTester/NativeExampleViews/UpdatePropertiesExampleView.h; sourceTree = \"<group>\"; };\n\t\t272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UpdatePropertiesExampleView.m; path = RNTester/NativeExampleViews/UpdatePropertiesExampleView.m; sourceTree = \"<group>\"; };\n\t\t27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootViewIntegrationTests.m; sourceTree = \"<group>\"; };\n\t\t27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlexibleSizeExampleView.m; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.m; sourceTree = \"<group>\"; };\n\t\t27F441EA1BEBE5030039B79C /* FlexibleSizeExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlexibleSizeExampleView.h; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.h; sourceTree = \"<group>\"; };\n\t\t2D4624E01DA2EA6900C74D09 /* RNTester-tvOSIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = \"RNTester-tvOSIntegrationTests.xctest\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t2DD323901DA2DD8A000FE1B8 /* RNTester-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"RNTester-tvOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t2DD323A01DA2DD8B000FE1B8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t2DD323A51DA2DD8B000FE1B8 /* RNTester-tvOSUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = \"RNTester-tvOSUnitTests.xctest\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t357858F81B28D2C400341EDB /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTLinking.xcodeproj; path = ../Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = \"<group>\"; };\n\t\t39AA31A31DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUnicodeDecodeTests.m; sourceTree = \"<group>\"; };\n\t\t3D13F83E1D6F6AE000E69E0E /* RNTesterBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNTesterBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D13F8401D6F6AE000E69E0E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../Info.plist; sourceTree = \"<group>\"; };\n\t\t3D13F8441D6F6AF200E69E0E /* ImageInBundle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ImageInBundle.png; sourceTree = \"<group>\"; };\n\t\t3D13F8451D6F6AF200E69E0E /* OtherImages.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = OtherImages.xcassets; sourceTree = \"<group>\"; };\n\t\t3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLoggingTests.m; sourceTree = \"<group>\"; };\n\t\t3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = \"legacy_image@2x.png\"; path = \"RNTester/legacy_image@2x.png\"; sourceTree = \"<group>\"; };\n\t\t3D41535A1F276FF9005B8EFE /* ART.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = ART.xcodeproj; path = ../Libraries/ART/ART.xcodeproj; sourceTree = \"<group>\"; };\n\t\t3DB99D0B1BA0340600302749 /* RNTesterIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterIntegrationTests.m; sourceTree = \"<group>\"; };\n\t\t3DD981D51D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = RNTesterUnitTestsBundle.js; sourceTree = \"<group>\"; };\n\t\t58005BE41ABA80530062E044 /* RCTTest.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTTest.xcodeproj; path = ../Libraries/RCTTest/RCTTest.xcodeproj; sourceTree = \"<group>\"; };\n\t\t68FF44371CF6111500720EFD /* RCTBundleURLProviderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBundleURLProviderTests.m; sourceTree = \"<group>\"; };\n\t\t83636F8E1B53F22C009F943E /* RCTUIManagerScenarioTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManagerScenarioTests.m; sourceTree = \"<group>\"; };\n\t\t8385CEF41B873B5C00C6273E /* RCTImageLoaderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoaderTests.m; sourceTree = \"<group>\"; };\n\t\t8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoaderHelpers.m; sourceTree = \"<group>\"; };\n\t\t8385CF051B8747A000C6273E /* RCTImageLoaderHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTImageLoaderHelpers.h; sourceTree = \"<group>\"; };\n\t\tBC9C033F1DC9F1D600B1C635 /* RCTDevMenuTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDevMenuTests.m; sourceTree = \"<group>\"; };\n\t\tC654F14B1EB34D0C000B7A9A /* RNTesterTestModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterTestModule.m; sourceTree = \"<group>\"; };\n\t\tD85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTVibration.xcodeproj; path = ../Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t004D289B1AAF61C70097A701 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D4153591F276F4E005B8EFE /* libReact.a in Frameworks */,\n\t\t\t\t14D6D71E1B2222EF001FB087 /* libRCTActionSheet.a in Frameworks */,\n\t\t\t\t14D6D7201B2222EF001FB087 /* libRCTGeolocation.a in Frameworks */,\n\t\t\t\t14D6D7211B2222EF001FB087 /* libRCTImage.a in Frameworks */,\n\t\t\t\t14D6D7221B2222EF001FB087 /* libRCTNetwork.a in Frameworks */,\n\t\t\t\t14D6D7231B2222EF001FB087 /* libRCTPushNotification.a in Frameworks */,\n\t\t\t\t14D6D7241B2222EF001FB087 /* libRCTSettings.a in Frameworks */,\n\t\t\t\t14D6D7251B2222EF001FB087 /* libRCTTest.a in Frameworks */,\n\t\t\t\t14D6D7261B2222EF001FB087 /* libRCTText.a in Frameworks */,\n\t\t\t\t14D6D7271B2222EF001FB087 /* libRCTVibration.a in Frameworks */,\n\t\t\t\t14D6D7281B2222EF001FB087 /* libRCTWebSocket.a in Frameworks */,\n\t\t\t\t14D6D7111B220EB3001FB087 /* libOCMock.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D4153631F27700D005B8EFE /* libART.a in Frameworks */,\n\t\t\t\t1380DCD41E70C44800E7C47D /* libReact.a in Frameworks */,\n\t\t\t\t147CED4C1AB3532B00DA3E4C /* libRCTActionSheet.a in Frameworks */,\n\t\t\t\t13E501F11D07A84A005F35D8 /* libRCTAnimation.a in Frameworks */,\n\t\t\t\t138DEE241B9EDFB6007F4EA5 /* libRCTCameraRoll.a in Frameworks */,\n\t\t\t\t134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */,\n\t\t\t\t1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */,\n\t\t\t\t13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */,\n\t\t\t\t3578590A1B28D2CF00341EDB /* libRCTLinking.a in Frameworks */,\n\t\t\t\t14DC67F41AB71881001358AB /* libRCTPushNotification.a in Frameworks */,\n\t\t\t\t834C36EC1AF8DED70019C93C /* libRCTSettings.a in Frameworks */,\n\t\t\t\t134180011AA9153C003F314A /* libRCTText.a in Frameworks */,\n\t\t\t\tD85B829E1AB6D5D7003F4FE2 /* libRCTVibration.a in Frameworks */,\n\t\t\t\t139FDEDB1B0651FB00C62182 /* libRCTWebSocket.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t143BC5921B21E3E100462512 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t14B6DA821B276C5900BF4DD1 /* libRCTTest.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D4624D91DA2EA6900C74D09 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D4625351DA2EBBE00C74D09 /* libRCTTest-tvOS.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD3238D1DA2DD8A000FE1B8 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DCE52BC1FEAAF8F00613583 /* libReact.a in Frameworks */,\n\t\t\t\t3D4153641F277011005B8EFE /* libART-tvOS.a in Frameworks */,\n\t\t\t\t2DD323E31DA2DE3F000FE1B8 /* libRCTAnimation.a in Frameworks */,\n\t\t\t\t3D302F221DF8285100D6DDAE /* libRCTImage-tvOS.a in Frameworks */,\n\t\t\t\t2DD323E51DA2DE3F000FE1B8 /* libRCTLinking-tvOS.a in Frameworks */,\n\t\t\t\t2DD323E61DA2DE3F000FE1B8 /* libRCTNetwork-tvOS.a in Frameworks */,\n\t\t\t\t3D05746D1DE6008900184BB4 /* libRCTPushNotification-tvOS.a in Frameworks */,\n\t\t\t\t2DD323E71DA2DE3F000FE1B8 /* libRCTSettings-tvOS.a in Frameworks */,\n\t\t\t\t2DD323E81DA2DE3F000FE1B8 /* libRCTText-tvOS.a in Frameworks */,\n\t\t\t\t2DD323E91DA2DE3F000FE1B8 /* libRCTWebSocket-tvOS.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD323A21DA2DD8B000FE1B8 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D4BD8E71DA2E20D005AC8A8 /* libOCMock.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D13F83B1D6F6AE000E69E0E /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t1316A21D1AA397F400C0188E /* Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1380DC8B1E70C0DC00E7C47D /* ReactLegacy.xcodeproj */,\n\t\t\t\t3D41535A1F276FF9005B8EFE /* ART.xcodeproj */,\n\t\t\t\t14E0EEC81AB118F7000DECC3 /* RCTActionSheet.xcodeproj */,\n\t\t\t\t13E5019C1D07A502005F35D8 /* RCTAnimation.xcodeproj */,\n\t\t\t\t138DEE021B9EDDDB007F4EA5 /* RCTCameraRoll.xcodeproj */,\n\t\t\t\t134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */,\n\t\t\t\t13417FE31AA91428003F314A /* RCTImage.xcodeproj */,\n\t\t\t\t357858F81B28D2C400341EDB /* RCTLinking.xcodeproj */,\n\t\t\t\t134180261AA91779003F314A /* RCTNetwork.xcodeproj */,\n\t\t\t\t14DC67E71AB71876001358AB /* RCTPushNotification.xcodeproj */,\n\t\t\t\t13CC9D481AEED2B90020D1C2 /* RCTSettings.xcodeproj */,\n\t\t\t\t58005BE41ABA80530062E044 /* RCTTest.xcodeproj */,\n\t\t\t\t13417FEA1AA914B8003F314A /* RCTText.xcodeproj */,\n\t\t\t\tD85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */,\n\t\t\t\t139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */,\n\t\t\t);\n\t\t\tname = Libraries;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1323F18D1C04ABAC0091BED0 /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */,\n\t\t\t\t13B07FB61A68108700A75B9A /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13417FE41AA91428003F314A /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13417FE81AA91428003F314A /* libRCTImage.a */,\n\t\t\t\t2DD323BB1DA2DD8B000FE1B8 /* libRCTImage-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13417FEB1AA914B8003F314A /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13417FEF1AA914B8003F314A /* libRCTText.a */,\n\t\t\t\t2DD323D01DA2DD8B000FE1B8 /* libRCTText-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t134180271AA91779003F314A /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1341802B1AA91779003F314A /* libRCTNetwork.a */,\n\t\t\t\t2DD323C31DA2DD8B000FE1B8 /* libRCTNetwork-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t134A8A211AACED6A00945AAE /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134A8A251AACED6A00945AAE /* libRCTGeolocation.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1380DC8C1E70C0DC00E7C47D /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1380DC991E70C0DD00E7C47D /* libReact.a */,\n\t\t\t\t1380DC9B1E70C0DD00E7C47D /* libReact.a */,\n\t\t\t\t1380DC9D1E70C0DD00E7C47D /* libyoga.a */,\n\t\t\t\t1380DC9F1E70C0DD00E7C47D /* libyoga.a */,\n\t\t\t\t1380DCA11E70C0DD00E7C47D /* libcxxreact.a */,\n\t\t\t\t1380DCA31E70C0DD00E7C47D /* libcxxreact.a */,\n\t\t\t\t1380DCA51E70C0DD00E7C47D /* libjschelpers.a */,\n\t\t\t\t1380DCA71E70C0DD00E7C47D /* libjschelpers.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t138DEE031B9EDDDB007F4EA5 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t138DEE091B9EDDDB007F4EA5 /* libRCTCameraRoll.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139FDECB1B0651EA00C62182 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139FDED91B0651EA00C62182 /* libRCTWebSocket.a */,\n\t\t\t\t2DD323D51DA2DD8B000FE1B8 /* libRCTWebSocket-tvOS.a */,\n\t\t\t\t3DBE0D6E1F3B18810099AA32 /* libfishhook.a */,\n\t\t\t\t3DBE0D701F3B18810099AA32 /* libfishhook-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13B07FAE1A68108700A75B9A /* RNTester */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t272E6B3A1BEA846C001FCF37 /* NativeExampleViews */,\n\t\t\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */,\n\t\t\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */,\n\t\t\t\t13B07FB51A68108700A75B9A /* Images.xcassets */,\n\t\t\t\t13B07FB11A68108700A75B9A /* LaunchScreen.xib */,\n\t\t\t\t13B07FB71A68108700A75B9A /* main.m */,\n\t\t\t\t1323F18D1C04ABAC0091BED0 /* Supporting Files */,\n\t\t\t);\n\t\t\tname = RNTester;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13E5019D1D07A502005F35D8 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13E501A31D07A502005F35D8 /* libRCTAnimation.a */,\n\t\t\t\t2DD323B51DA2DD8B000FE1B8 /* libRCTAnimation.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t143BC57C1B21E18100462512 /* RNTesterUnitTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B6C1A21C34225900D3FAF5 /* RCTURLUtilsTests.m */,\n\t\t\t\t68FF44371CF6111500720EFD /* RCTBundleURLProviderTests.m */,\n\t\t\t\t1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */,\n\t\t\t\t1497CFA51B21F5E400C1F8F2 /* RCTBridgeTests.m */,\n\t\t\t\t1497CFA61B21F5E400C1F8F2 /* RCTJSCExecutorTests.m */,\n\t\t\t\t1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */,\n\t\t\t\t1497CFA81B21F5E400C1F8F2 /* RCTFontTests.m */,\n\t\t\t\t1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */,\n\t\t\t\t1300627E1B59179B0043FE5A /* RCTGzipTests.m */,\n\t\t\t\t8385CF051B8747A000C6273E /* RCTImageLoaderHelpers.h */,\n\t\t\t\t8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */,\n\t\t\t\t8385CEF41B873B5C00C6273E /* RCTImageLoaderTests.m */,\n\t\t\t\t144D21231B2204C5006DB32B /* RCTImageUtilTests.m */,\n\t\t\t\t13DB03471B5D2ED500C27245 /* RCTJSONTests.m */,\n\t\t\t\t13DF61B51B67A45000EDB188 /* RCTMethodArgumentTests.m */,\n\t\t\t\t134CB9291C85A38800265FA6 /* RCTModuleInitTests.m */,\n\t\t\t\t13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */,\n\t\t\t\t1393D0371B68CD1300E1B601 /* RCTModuleMethodTests.mm */,\n\t\t\t\t001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */,\n\t\t\t\t138D6A161B53CD440074A87E /* RCTShadowViewTests.m */,\n\t\t\t\t1497CFAB1B21F5E400C1F8F2 /* RCTUIManagerTests.m */,\n\t\t\t\tBC9C033F1DC9F1D600B1C635 /* RCTDevMenuTests.m */,\n\t\t\t\t13BCE84E1C9C209600DD7AAD /* RCTComponentPropsTests.m */,\n\t\t\t\t39AA31A31DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m */,\n\t\t\t\t143BC57E1B21E18100462512 /* Info.plist */,\n\t\t\t\t3DD981D51D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js */,\n\t\t\t\t14D6D7101B220EB3001FB087 /* libOCMock.a */,\n\t\t\t\t14D6D7011B220AE3001FB087 /* OCMock */,\n\t\t\t);\n\t\t\tpath = RNTesterUnitTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t143BC5961B21E3E100462512 /* RNTesterIntegrationTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */,\n\t\t\t\t27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */,\n\t\t\t\t3DB99D0B1BA0340600302749 /* RNTesterIntegrationTests.m */,\n\t\t\t\t143BC5A01B21E45C00462512 /* RNTesterSnapshotTests.m */,\n\t\t\t\tC654F14B1EB34D0C000B7A9A /* RNTesterTestModule.m */,\n\t\t\t\t83636F8E1B53F22C009F943E /* RCTUIManagerScenarioTests.m */,\n\t\t\t\t143BC5971B21E3E100462512 /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = RNTesterIntegrationTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t143BC5971B21E3E100462512 /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t143BC5981B21E3E100462512 /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t147CED471AB34F8C00DA3E4C /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t147CED4B1AB34F8C00DA3E4C /* libRCTActionSheet.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t14D6D6EA1B2205C0001FB087 /* OCMock */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tpath = OCMock;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t14D6D7011B220AE3001FB087 /* OCMock */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t14D6D7021B220AE3001FB087 /* NSNotificationCenter+OCMAdditions.h */,\n\t\t\t\t14D6D7031B220AE3001FB087 /* OCMArg.h */,\n\t\t\t\t14D6D7041B220AE3001FB087 /* OCMConstraint.h */,\n\t\t\t\t14D6D7051B220AE3001FB087 /* OCMLocation.h */,\n\t\t\t\t14D6D7061B220AE3001FB087 /* OCMMacroState.h */,\n\t\t\t\t14D6D7071B220AE3001FB087 /* OCMock.h */,\n\t\t\t\t14D6D7081B220AE3001FB087 /* OCMockObject.h */,\n\t\t\t\t14D6D7091B220AE3001FB087 /* OCMRecorder.h */,\n\t\t\t\t14D6D70A1B220AE3001FB087 /* OCMStubRecorder.h */,\n\t\t\t);\n\t\t\tpath = OCMock;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t14DC67E81AB71876001358AB /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t14DC67F11AB71876001358AB /* libRCTPushNotification.a */,\n\t\t\t\t3D05746C1DE6008900184BB4 /* libRCTPushNotification-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t272E6B3A1BEA846C001FCF37 /* NativeExampleViews */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */,\n\t\t\t\t27F441EA1BEBE5030039B79C /* FlexibleSizeExampleView.h */,\n\t\t\t\t272E6B3B1BEA849E001FCF37 /* UpdatePropertiesExampleView.h */,\n\t\t\t\t272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */,\n\t\t\t);\n\t\t\tname = NativeExampleViews;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2DD323911DA2DD8B000FE1B8 /* RNTester-tvOS */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2DD323A01DA2DD8B000FE1B8 /* Info.plist */,\n\t\t\t);\n\t\t\tpath = \"RNTester-tvOS\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t357858F91B28D2C400341EDB /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t357859011B28D2C500341EDB /* libRCTLinking.a */,\n\t\t\t\t2DD323BF1DA2DD8B000FE1B8 /* libRCTLinking-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D13F83F1D6F6AE000E69E0E /* RNTesterBundle */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D13F8401D6F6AE000E69E0E /* Info.plist */,\n\t\t\t\t3D13F8441D6F6AF200E69E0E /* ImageInBundle.png */,\n\t\t\t\t3D13F8451D6F6AF200E69E0E /* OtherImages.xcassets */,\n\t\t\t);\n\t\t\tname = RNTesterBundle;\n\t\t\tpath = RNTester/RNTesterBundle;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D41535B1F276FF9005B8EFE /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D4153601F276FF9005B8EFE /* libART.a */,\n\t\t\t\t3D4153621F276FF9005B8EFE /* libART-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3DCE52B31FEAAF8F00613583 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58005BE51ABA80530062E044 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t58005BEE1ABA80530062E044 /* libRCTTest.a */,\n\t\t\t\t2DD323CC1DA2DD8B000FE1B8 /* libRCTTest-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t834C36CE1AF8DA610019C93C /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t834C36D21AF8DA610019C93C /* libRCTSettings.a */,\n\t\t\t\t2DD323C81DA2DD8B000FE1B8 /* libRCTSettings-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBB9F61A601CBA00E9B192 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07FAE1A68108700A75B9A /* RNTester */,\n\t\t\t\t1316A21D1AA397F400C0188E /* Libraries */,\n\t\t\t\t143BC57C1B21E18100462512 /* RNTesterUnitTests */,\n\t\t\t\t143BC5961B21E3E100462512 /* RNTesterIntegrationTests */,\n\t\t\t\t3D13F83F1D6F6AE000E69E0E /* RNTesterBundle */,\n\t\t\t\t14D6D6EA1B2205C0001FB087 /* OCMock */,\n\t\t\t\t2DD323911DA2DD8B000FE1B8 /* RNTester-tvOS */,\n\t\t\t\t83CBBA001A601CBA00E9B192 /* Products */,\n\t\t\t\t3DCE52B31FEAAF8F00613583 /* Frameworks */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t83CBBA001A601CBA00E9B192 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07F961A680F5B00A75B9A /* RNTester.app */,\n\t\t\t\t004D289E1AAF61C70097A701 /* RNTesterUnitTests.xctest */,\n\t\t\t\t143BC5951B21E3E100462512 /* RNTesterIntegrationTests.xctest */,\n\t\t\t\t3D13F83E1D6F6AE000E69E0E /* RNTesterBundle.bundle */,\n\t\t\t\t2DD323901DA2DD8A000FE1B8 /* RNTester-tvOS.app */,\n\t\t\t\t2DD323A51DA2DD8B000FE1B8 /* RNTester-tvOSUnitTests.xctest */,\n\t\t\t\t2D4624E01DA2EA6900C74D09 /* RNTester-tvOSIntegrationTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tD85B82921AB6D5CE003F4FE2 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD85B829C1AB6D5CE003F4FE2 /* libRCTVibration.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t004D289D1AAF61C70097A701 /* RNTesterUnitTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 004D28AD1AAF61C70097A701 /* Build configuration list for PBXNativeTarget \"RNTesterUnitTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t004D289A1AAF61C70097A701 /* Sources */,\n\t\t\t\t004D289B1AAF61C70097A701 /* Frameworks */,\n\t\t\t\t004D289C1AAF61C70097A701 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RNTesterUnitTests;\n\t\t\tproductName = RNTesterTests;\n\t\t\tproductReference = 004D289E1AAF61C70097A701 /* RNTesterUnitTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t13B07F861A680F5B00A75B9A /* RNTester */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"RNTester\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t13B07F871A680F5B00A75B9A /* Sources */,\n\t\t\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */,\n\t\t\t\t13B07F8E1A680F5B00A75B9A /* Resources */,\n\t\t\t\t68CD48B71D2BCB2C007E06A9 /* Run Script */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t3D13F84C1D6F6B5F00E69E0E /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = RNTester;\n\t\t\tproductName = \"Hello World\";\n\t\t\tproductReference = 13B07F961A680F5B00A75B9A /* RNTester.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t143BC5941B21E3E100462512 /* RNTesterIntegrationTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 143BC59D1B21E3E100462512 /* Build configuration list for PBXNativeTarget \"RNTesterIntegrationTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t143BC5911B21E3E100462512 /* Sources */,\n\t\t\t\t143BC5921B21E3E100462512 /* Frameworks */,\n\t\t\t\t143BC5931B21E3E100462512 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t143BC59C1B21E3E100462512 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = RNTesterIntegrationTests;\n\t\t\tproductName = RNTesterIntegrationTests;\n\t\t\tproductReference = 143BC5951B21E3E100462512 /* RNTesterIntegrationTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t2D4624C11DA2EA6900C74D09 /* RNTester-tvOSIntegrationTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D4624DD1DA2EA6900C74D09 /* Build configuration list for PBXNativeTarget \"RNTester-tvOSIntegrationTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2D4624C41DA2EA6900C74D09 /* Sources */,\n\t\t\t\t2D4624D91DA2EA6900C74D09 /* Frameworks */,\n\t\t\t\t2D4624DB1DA2EA6900C74D09 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t2D4624C21DA2EA6900C74D09 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"RNTester-tvOSIntegrationTests\";\n\t\t\tproductName = \"RNTester-tvOSUnitTests\";\n\t\t\tproductReference = 2D4624E01DA2EA6900C74D09 /* RNTester-tvOSIntegrationTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t2DD3238F1DA2DD8A000FE1B8 /* RNTester-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2DD323DA1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget \"RNTester-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2DD3238C1DA2DD8A000FE1B8 /* Sources */,\n\t\t\t\t2DD3238D1DA2DD8A000FE1B8 /* Frameworks */,\n\t\t\t\t2DD3238E1DA2DD8A000FE1B8 /* Resources */,\n\t\t\t\t2DD323EB1DA2DEC1000FE1B8 /* ShellScript */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"RNTester-tvOS\";\n\t\t\tproductName = \"RNTester-tvOS\";\n\t\t\tproductReference = 2DD323901DA2DD8A000FE1B8 /* RNTester-tvOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t2DD323A41DA2DD8B000FE1B8 /* RNTester-tvOSUnitTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2DD323DB1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget \"RNTester-tvOSUnitTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2DD323A11DA2DD8B000FE1B8 /* Sources */,\n\t\t\t\t2DD323A21DA2DD8B000FE1B8 /* Frameworks */,\n\t\t\t\t2DD323A31DA2DD8B000FE1B8 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t2DD323A71DA2DD8B000FE1B8 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"RNTester-tvOSUnitTests\";\n\t\t\tproductName = \"RNTester-tvOSUnitTests\";\n\t\t\tproductReference = 2DD323A51DA2DD8B000FE1B8 /* RNTester-tvOSUnitTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t3D13F83D1D6F6AE000E69E0E /* RNTesterBundle */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D13F8411D6F6AE000E69E0E /* Build configuration list for PBXNativeTarget \"RNTesterBundle\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D13F83A1D6F6AE000E69E0E /* Sources */,\n\t\t\t\t3D13F83B1D6F6AE000E69E0E /* Frameworks */,\n\t\t\t\t3D13F83C1D6F6AE000E69E0E /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RNTesterBundle;\n\t\t\tproductName = RNTesterBundle;\n\t\t\tproductReference = 3D13F83E1D6F6AE000E69E0E /* RNTesterBundle.bundle */;\n\t\t\tproductType = \"com.apple.product-type.bundle\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t83CBB9F71A601CBA00E9B192 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0820;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t004D289D1AAF61C70097A701 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t\t143BC5941B21E3E100462512 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.3.2;\n\t\t\t\t\t\tTestTargetID = 13B07F861A680F5B00A75B9A;\n\t\t\t\t\t};\n\t\t\t\t\t2DD3238F1DA2DD8A000FE1B8 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t2DD323A41DA2DD8B000FE1B8 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t\tTestTargetID = 2DD3238F1DA2DD8A000FE1B8;\n\t\t\t\t\t};\n\t\t\t\t\t3D13F83D1D6F6AE000E69E0E = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 7.3.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"RNTesterLegacy\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 83CBB9F61A601CBA00E9B192;\n\t\t\tproductRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 3D41535B1F276FF9005B8EFE /* Products */;\n\t\t\t\t\tProjectRef = 3D41535A1F276FF9005B8EFE /* ART.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 147CED471AB34F8C00DA3E4C /* Products */;\n\t\t\t\t\tProjectRef = 14E0EEC81AB118F7000DECC3 /* RCTActionSheet.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 13E5019D1D07A502005F35D8 /* Products */;\n\t\t\t\t\tProjectRef = 13E5019C1D07A502005F35D8 /* RCTAnimation.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 138DEE031B9EDDDB007F4EA5 /* Products */;\n\t\t\t\t\tProjectRef = 138DEE021B9EDDDB007F4EA5 /* RCTCameraRoll.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 134A8A211AACED6A00945AAE /* Products */;\n\t\t\t\t\tProjectRef = 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 13417FE41AA91428003F314A /* Products */;\n\t\t\t\t\tProjectRef = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 357858F91B28D2C400341EDB /* Products */;\n\t\t\t\t\tProjectRef = 357858F81B28D2C400341EDB /* RCTLinking.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 134180271AA91779003F314A /* Products */;\n\t\t\t\t\tProjectRef = 134180261AA91779003F314A /* RCTNetwork.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 14DC67E81AB71876001358AB /* Products */;\n\t\t\t\t\tProjectRef = 14DC67E71AB71876001358AB /* RCTPushNotification.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 834C36CE1AF8DA610019C93C /* Products */;\n\t\t\t\t\tProjectRef = 13CC9D481AEED2B90020D1C2 /* RCTSettings.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 58005BE51ABA80530062E044 /* Products */;\n\t\t\t\t\tProjectRef = 58005BE41ABA80530062E044 /* RCTTest.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 13417FEB1AA914B8003F314A /* Products */;\n\t\t\t\t\tProjectRef = 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = D85B82921AB6D5CE003F4FE2 /* Products */;\n\t\t\t\t\tProjectRef = D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 139FDECB1B0651EA00C62182 /* Products */;\n\t\t\t\t\tProjectRef = 139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 1380DC8C1E70C0DC00E7C47D /* Products */;\n\t\t\t\t\tProjectRef = 1380DC8B1E70C0DC00E7C47D /* ReactLegacy.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t13B07F861A680F5B00A75B9A /* RNTester */,\n\t\t\t\t004D289D1AAF61C70097A701 /* RNTesterUnitTests */,\n\t\t\t\t143BC5941B21E3E100462512 /* RNTesterIntegrationTests */,\n\t\t\t\t3D13F83D1D6F6AE000E69E0E /* RNTesterBundle */,\n\t\t\t\t2DD3238F1DA2DD8A000FE1B8 /* RNTester-tvOS */,\n\t\t\t\t2DD323A41DA2DD8B000FE1B8 /* RNTester-tvOSUnitTests */,\n\t\t\t\t2D4624C11DA2EA6900C74D09 /* RNTester-tvOSIntegrationTests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\t13417FE81AA91428003F314A /* libRCTImage.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTImage.a;\n\t\t\tremoteRef = 13417FE71AA91428003F314A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t13417FEF1AA914B8003F314A /* libRCTText.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTText.a;\n\t\t\tremoteRef = 13417FEE1AA914B8003F314A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t1341802B1AA91779003F314A /* libRCTNetwork.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTNetwork.a;\n\t\t\tremoteRef = 1341802A1AA91779003F314A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t134A8A251AACED6A00945AAE /* libRCTGeolocation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTGeolocation.a;\n\t\t\tremoteRef = 134A8A241AACED6A00945AAE /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t1380DC991E70C0DD00E7C47D /* libReact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libReact.a;\n\t\t\tremoteRef = 1380DC981E70C0DD00E7C47D /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t1380DC9B1E70C0DD00E7C47D /* libReact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libReact.a;\n\t\t\tremoteRef = 1380DC9A1E70C0DD00E7C47D /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t1380DC9D1E70C0DD00E7C47D /* libyoga.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libyoga.a;\n\t\t\tremoteRef = 1380DC9C1E70C0DD00E7C47D /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t1380DC9F1E70C0DD00E7C47D /* libyoga.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libyoga.a;\n\t\t\tremoteRef = 1380DC9E1E70C0DD00E7C47D /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t1380DCA11E70C0DD00E7C47D /* libcxxreact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libcxxreact.a;\n\t\t\tremoteRef = 1380DCA01E70C0DD00E7C47D /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t1380DCA31E70C0DD00E7C47D /* libcxxreact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libcxxreact.a;\n\t\t\tremoteRef = 1380DCA21E70C0DD00E7C47D /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t1380DCA51E70C0DD00E7C47D /* libjschelpers.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjschelpers.a;\n\t\t\tremoteRef = 1380DCA41E70C0DD00E7C47D /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t1380DCA71E70C0DD00E7C47D /* libjschelpers.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjschelpers.a;\n\t\t\tremoteRef = 1380DCA61E70C0DD00E7C47D /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t138DEE091B9EDDDB007F4EA5 /* libRCTCameraRoll.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTCameraRoll.a;\n\t\t\tremoteRef = 138DEE081B9EDDDB007F4EA5 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t139FDED91B0651EA00C62182 /* libRCTWebSocket.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTWebSocket.a;\n\t\t\tremoteRef = 139FDED81B0651EA00C62182 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t13E501A31D07A502005F35D8 /* libRCTAnimation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTAnimation.a;\n\t\t\tremoteRef = 13E501A21D07A502005F35D8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t147CED4B1AB34F8C00DA3E4C /* libRCTActionSheet.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTActionSheet.a;\n\t\t\tremoteRef = 147CED4A1AB34F8C00DA3E4C /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t14DC67F11AB71876001358AB /* libRCTPushNotification.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTPushNotification.a;\n\t\t\tremoteRef = 14DC67F01AB71876001358AB /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323B51DA2DD8B000FE1B8 /* libRCTAnimation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTAnimation.a;\n\t\t\tremoteRef = 2DD323B41DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323BB1DA2DD8B000FE1B8 /* libRCTImage-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTImage-tvOS.a\";\n\t\t\tremoteRef = 2DD323BA1DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323BF1DA2DD8B000FE1B8 /* libRCTLinking-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTLinking-tvOS.a\";\n\t\t\tremoteRef = 2DD323BE1DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323C31DA2DD8B000FE1B8 /* libRCTNetwork-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTNetwork-tvOS.a\";\n\t\t\tremoteRef = 2DD323C21DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323C81DA2DD8B000FE1B8 /* libRCTSettings-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTSettings-tvOS.a\";\n\t\t\tremoteRef = 2DD323C71DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323CC1DA2DD8B000FE1B8 /* libRCTTest-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTTest-tvOS.a\";\n\t\t\tremoteRef = 2DD323CB1DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323D01DA2DD8B000FE1B8 /* libRCTText-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTText-tvOS.a\";\n\t\t\tremoteRef = 2DD323CF1DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2DD323D51DA2DD8B000FE1B8 /* libRCTWebSocket-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTWebSocket-tvOS.a\";\n\t\t\tremoteRef = 2DD323D41DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t357859011B28D2C500341EDB /* libRCTLinking.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTLinking.a;\n\t\t\tremoteRef = 357859001B28D2C500341EDB /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3D05746C1DE6008900184BB4 /* libRCTPushNotification-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTPushNotification-tvOS.a\";\n\t\t\tremoteRef = 3D05746B1DE6008900184BB4 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3D4153601F276FF9005B8EFE /* libART.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libART.a;\n\t\t\tremoteRef = 3D41535F1F276FF9005B8EFE /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3D4153621F276FF9005B8EFE /* libART-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libART-tvOS.a\";\n\t\t\tremoteRef = 3D4153611F276FF9005B8EFE /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DBE0D6E1F3B18810099AA32 /* libfishhook.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libfishhook.a;\n\t\t\tremoteRef = 3DBE0D6D1F3B18810099AA32 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DBE0D701F3B18810099AA32 /* libfishhook-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libfishhook-tvOS.a\";\n\t\t\tremoteRef = 3DBE0D6F1F3B18810099AA32 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t58005BEE1ABA80530062E044 /* libRCTTest.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTTest.a;\n\t\t\tremoteRef = 58005BED1ABA80530062E044 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t834C36D21AF8DA610019C93C /* libRCTSettings.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTSettings.a;\n\t\t\tremoteRef = 834C36D11AF8DA610019C93C /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tD85B829C1AB6D5CE003F4FE2 /* libRCTVibration.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTVibration.a;\n\t\t\tremoteRef = D85B829B1AB6D5CE003F4FE2 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t004D289C1AAF61C70097A701 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DD981D61D33C6FB007DC7BE /* RNTesterUnitTestsBundle.js in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F8E1A680F5B00A75B9A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,\n\t\t\t\t3D56F9F11D6F6E9B00F53A06 /* RNTesterBundle.bundle in Resources */,\n\t\t\t\t3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */,\n\t\t\t\t13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t143BC5931B21E3E100462512 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D4624DB1DA2EA6900C74D09 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD3238E1DA2DD8A000FE1B8 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2DD323DF1DA2DDBF000FE1B8 /* Images.xcassets in Resources */,\n\t\t\t\t2DD323E11DA2DDBF000FE1B8 /* legacy_image@2x.png in Resources */,\n\t\t\t\t2DD323E21DA2DDBF000FE1B8 /* Info.plist in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD323A31DA2DD8B000FE1B8 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D4BD8E61DA2E20D005AC8A8 /* RNTesterUnitTestsBundle.js in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D13F83C1D6F6AE000E69E0E /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D13F8481D6F6AF900E69E0E /* ImageInBundle.png in Resources */,\n\t\t\t\t3D13F84A1D6F6AFD00E69E0E /* OtherImages.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t2DD323EB1DA2DEC1000FE1B8 /* ShellScript */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"export NODE_BINARY=node\\n$SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js\";\n\t\t};\n\t\t68CD48B71D2BCB2C007E06A9 /* Run Script */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Run Script\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"export NODE_BINARY=node\\n$SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js\";\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t004D289A1AAF61C70097A701 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1497CFB01B21F5E400C1F8F2 /* RCTFontTests.m in Sources */,\n\t\t\t\t13BCE84F1C9C209600DD7AAD /* RCTComponentPropsTests.m in Sources */,\n\t\t\t\t144D21241B2204C5006DB32B /* RCTImageUtilTests.m in Sources */,\n\t\t\t\t1393D0381B68CD1300E1B601 /* RCTModuleMethodTests.mm in Sources */,\n\t\t\t\t1300627F1B59179B0043FE5A /* RCTGzipTests.m in Sources */,\n\t\t\t\t1497CFAF1B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m in Sources */,\n\t\t\t\t1497CFAE1B21F5E400C1F8F2 /* RCTJSCExecutorTests.m in Sources */,\n\t\t\t\t13129DD41C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m in Sources */,\n\t\t\t\t1497CFAD1B21F5E400C1F8F2 /* RCTBridgeTests.m in Sources */,\n\t\t\t\t134CB92A1C85A38800265FA6 /* RCTModuleInitTests.m in Sources */,\n\t\t\t\t1497CFB11B21F5E400C1F8F2 /* RCTEventDispatcherTests.m in Sources */,\n\t\t\t\t1497CFB31B21F5E400C1F8F2 /* RCTUIManagerTests.m in Sources */,\n\t\t\t\t13DB03481B5D2ED500C27245 /* RCTJSONTests.m in Sources */,\n\t\t\t\t1497CFAC1B21F5E400C1F8F2 /* RCTAllocationTests.m in Sources */,\n\t\t\t\t001BFCE41D838343008E587E /* RCTMultipartStreamReaderTests.m in Sources */,\n\t\t\t\t13DF61B61B67A45000EDB188 /* RCTMethodArgumentTests.m in Sources */,\n\t\t\t\t138D6A181B53CD440074A87E /* RCTShadowViewTests.m in Sources */,\n\t\t\t\t39AA31A41DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m in Sources */,\n\t\t\t\t13B6C1A31C34225900D3FAF5 /* RCTURLUtilsTests.m in Sources */,\n\t\t\t\t8385CF041B87479200C6273E /* RCTImageLoaderHelpers.m in Sources */,\n\t\t\t\tBC9C03401DC9F1D600B1C635 /* RCTDevMenuTests.m in Sources */,\n\t\t\t\t68FF44381CF6111500720EFD /* RCTBundleURLProviderTests.m in Sources */,\n\t\t\t\t8385CEF51B873B5C00C6273E /* RCTImageLoaderTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F871A680F5B00A75B9A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */,\n\t\t\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,\n\t\t\t\t27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */,\n\t\t\t\t13B07FC11A68108700A75B9A /* main.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t143BC5911B21E3E100462512 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tC654F14C1EB34D0C000B7A9A /* RNTesterTestModule.m in Sources */,\n\t\t\t\t3DB99D0C1BA0340600302749 /* RNTesterIntegrationTests.m in Sources */,\n\t\t\t\t83636F8F1B53F22C009F943E /* RCTUIManagerScenarioTests.m in Sources */,\n\t\t\t\t3D299BAF1D33EBFA00FA1057 /* RCTLoggingTests.m in Sources */,\n\t\t\t\t143BC5A11B21E45C00462512 /* RNTesterSnapshotTests.m in Sources */,\n\t\t\t\t27B885561BED29AF00008352 /* RCTRootViewIntegrationTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D4624C41DA2EA6900C74D09 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tC654F16E1EB34D14000B7A9A /* RNTesterTestModule.m in Sources */,\n\t\t\t\t2D4624FC1DA2EAC300C74D09 /* RNTesterIntegrationTests.m in Sources */,\n\t\t\t\t2D4624FA1DA2EAC300C74D09 /* RCTLoggingTests.m in Sources */,\n\t\t\t\t2D4624FE1DA2EAC300C74D09 /* RCTUIManagerScenarioTests.m in Sources */,\n\t\t\t\t2D4624FD1DA2EAC300C74D09 /* RNTesterSnapshotTests.m in Sources */,\n\t\t\t\t2D4624FB1DA2EAC300C74D09 /* RCTRootViewIntegrationTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD3238C1DA2DD8A000FE1B8 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2DD323DC1DA2DDBF000FE1B8 /* FlexibleSizeExampleView.m in Sources */,\n\t\t\t\t2DD323DD1DA2DDBF000FE1B8 /* UpdatePropertiesExampleView.m in Sources */,\n\t\t\t\t2DD323E01DA2DDBF000FE1B8 /* main.m in Sources */,\n\t\t\t\t2DD323DE1DA2DDBF000FE1B8 /* AppDelegate.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2DD323A11DA2DD8B000FE1B8 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D4BD8DC1DA2E20D005AC8A8 /* RCTImageLoaderTests.m in Sources */,\n\t\t\t\t2D4BD8D51DA2E20D005AC8A8 /* RCTBridgeTests.m in Sources */,\n\t\t\t\t2D4BD8D91DA2E20D005AC8A8 /* RCTEventDispatcherTests.m in Sources */,\n\t\t\t\t2D4BD8D41DA2E20D005AC8A8 /* RCTAllocationTests.m in Sources */,\n\t\t\t\t2D4BD8DA1DA2E20D005AC8A8 /* RCTGzipTests.m in Sources */,\n\t\t\t\t2D4BD8DB1DA2E20D005AC8A8 /* RCTImageLoaderHelpers.m in Sources */,\n\t\t\t\t2D4BD8E51DA2E20D005AC8A8 /* RCTComponentPropsTests.m in Sources */,\n\t\t\t\t2D4BD8D71DA2E20D005AC8A8 /* RCTConvert_NSURLTests.m in Sources */,\n\t\t\t\t2D4BD8E21DA2E20D005AC8A8 /* RCTModuleMethodTests.mm in Sources */,\n\t\t\t\t2D4BD8E11DA2E20D005AC8A8 /* RCTModuleInitNotificationRaceTests.m in Sources */,\n\t\t\t\t2D4BD8DF1DA2E20D005AC8A8 /* RCTMethodArgumentTests.m in Sources */,\n\t\t\t\t2D4BD8D61DA2E20D005AC8A8 /* RCTJSCExecutorTests.m in Sources */,\n\t\t\t\t2D4BD8D31DA2E20D005AC8A8 /* RCTBundleURLProviderTests.m in Sources */,\n\t\t\t\t2D4BD8D21DA2E20D005AC8A8 /* RCTURLUtilsTests.m in Sources */,\n\t\t\t\t2D8C2E321DA40403000EE098 /* RCTMultipartStreamReaderTests.m in Sources */,\n\t\t\t\t2D4BD8DE1DA2E20D005AC8A8 /* RCTJSONTests.m in Sources */,\n\t\t\t\t2D4BD8E31DA2E20D005AC8A8 /* RCTShadowViewTests.m in Sources */,\n\t\t\t\t2D4BD8D81DA2E20D005AC8A8 /* RCTFontTests.m in Sources */,\n\t\t\t\t2D4BD8DD1DA2E20D005AC8A8 /* RCTImageUtilTests.m in Sources */,\n\t\t\t\t2D4BD8E41DA2E20D005AC8A8 /* RCTUIManagerTests.m in Sources */,\n\t\t\t\t2D4BD8E01DA2E20D005AC8A8 /* RCTModuleInitTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D13F83A1D6F6AE000E69E0E /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t143BC59C1B21E3E100462512 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 13B07F861A680F5B00A75B9A /* RNTester */;\n\t\t\ttargetProxy = 143BC59B1B21E3E100462512 /* PBXContainerItemProxy */;\n\t\t};\n\t\t2D4624C21DA2EA6900C74D09 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 2DD3238F1DA2DD8A000FE1B8 /* RNTester-tvOS */;\n\t\t\ttargetProxy = 2D4624C31DA2EA6900C74D09 /* PBXContainerItemProxy */;\n\t\t};\n\t\t2DD323A71DA2DD8B000FE1B8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 2DD3238F1DA2DD8A000FE1B8 /* RNTester-tvOS */;\n\t\t\ttargetProxy = 2DD323A61DA2DD8B000FE1B8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D13F84C1D6F6B5F00E69E0E /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D13F83D1D6F6AE000E69E0E /* RNTesterBundle */;\n\t\t\ttargetProxy = 3D13F84B1D6F6B5F00E69E0E /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin PBXVariantGroup section */\n\t\t13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07FB21A68108700A75B9A /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.xib;\n\t\t\tpath = RNTester;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t004D28A61AAF61C70097A701 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterUnitTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t004D28A71AAF61C70097A701 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterUnitTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t13B07F941A680F5B00A75B9A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tINFOPLIST_FILE = \"$(SRCROOT)/RNTester/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp;\n\t\t\t\tPRODUCT_NAME = RNTester;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t13B07F951A680F5B00A75B9A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tDEVELOPMENT_TEAM = V9WTTPBFK9;\n\t\t\t\tINFOPLIST_FILE = \"$(SRCROOT)/RNTester/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp;\n\t\t\t\tPRODUCT_NAME = RNTester;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t143BC59E1B21E3E100462512 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"FB_REFERENCE_IMAGE_DIR=\\\"\\\\\\\"$(SOURCE_ROOT)/$(PROJECT_NAME)IntegrationTests/ReferenceImages\\\\\\\"\\\"\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.React.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester.app/RNTester\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t143BC59F1B21E3E100462512 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.React.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester.app/RNTester\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t2D4624DE1DA2EA6900C74D09 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"FB_REFERENCE_IMAGE_DIR=\\\"\\\\\\\"$(SOURCE_ROOT)/$(PROJECT_NAME)IntegrationTests/ReferenceImages\\\\\\\"\\\"\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOSIntegrationTests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester-tvOS.app/RNTester-tvOS\";\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D4624DF1DA2EA6900C74D09 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOSIntegrationTests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester-tvOS.app/RNTester-tvOS\";\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t2DD323AC1DA2DD8B000FE1B8 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = \"App Icon & Top Shelf Image\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = \"RNTester-tvOS/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOS\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = 3;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2DD323AD1DA2DD8B000FE1B8 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = \"App Icon & Top Shelf Image\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = \"RNTester-tvOS/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOS\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = 3;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t2DD323AE1DA2DD8B000FE1B8 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/RNTesterUnitTests/**\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterUnitTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOSUnitTests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester-tvOS.app/RNTester-tvOS\";\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2DD323AF1DA2DD8B000FE1B8 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/RNTesterUnitTests/**\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = RNTesterUnitTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/RNTesterUnitTests\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.RNTester-tvOSUnitTests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/RNTester-tvOS.app/RNTester-tvOS\";\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D13F8421D6F6AE000E69E0E /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = RNTester/RNTesterBundle/Info.plist;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterBundle;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tWRAPPER_EXTENSION = bundle;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D13F8431D6F6AE000E69E0E /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = RNTester/RNTesterBundle/Info.plist;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterBundle;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tWRAPPER_EXTENSION = bundle;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA201A601CBA00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_ASSIGN_ENUM = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_STRICT_SELECTOR_MATCH = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNKNOWN_PRAGMAS = YES;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_LABEL = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Wextra\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t\t\"-Wincompatible-pointer-types\",\n\t\t\t\t\t\"-Wincompatible-pointer-types-discards-qualifiers\",\n\t\t\t\t\t\"-Wshadow\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA211A601CBA00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_ASSIGN_ENUM = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_STRICT_SELECTOR_MATCH = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNKNOWN_PRAGMAS = YES;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_LABEL = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Wextra\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t\t\"-Wincompatible-pointer-types\",\n\t\t\t\t\t\"-Wincompatible-pointer-types-discards-qualifiers\",\n\t\t\t\t\t\"-Wshadow\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t004D28AD1AAF61C70097A701 /* Build configuration list for PBXNativeTarget \"RNTesterUnitTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t004D28A61AAF61C70097A701 /* Debug */,\n\t\t\t\t004D28A71AAF61C70097A701 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"RNTester\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t13B07F941A680F5B00A75B9A /* Debug */,\n\t\t\t\t13B07F951A680F5B00A75B9A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t143BC59D1B21E3E100462512 /* Build configuration list for PBXNativeTarget \"RNTesterIntegrationTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t143BC59E1B21E3E100462512 /* Debug */,\n\t\t\t\t143BC59F1B21E3E100462512 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t2D4624DD1DA2EA6900C74D09 /* Build configuration list for PBXNativeTarget \"RNTester-tvOSIntegrationTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D4624DE1DA2EA6900C74D09 /* Debug */,\n\t\t\t\t2D4624DF1DA2EA6900C74D09 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t2DD323DA1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget \"RNTester-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2DD323AC1DA2DD8B000FE1B8 /* Debug */,\n\t\t\t\t2DD323AD1DA2DD8B000FE1B8 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t2DD323DB1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget \"RNTester-tvOSUnitTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2DD323AE1DA2DD8B000FE1B8 /* Debug */,\n\t\t\t\t2DD323AF1DA2DD8B000FE1B8 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D13F8411D6F6AE000E69E0E /* Build configuration list for PBXNativeTarget \"RNTesterBundle\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D13F8421D6F6AE000E69E0E /* Debug */,\n\t\t\t\t3D13F8431D6F6AE000E69E0E /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"RNTesterLegacy\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA201A601CBA00E9B192 /* Debug */,\n\t\t\t\t83CBBA211A601CBA00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;\n}\n"
  },
  {
    "path": "RNTester/RNTesterLegacy.xcodeproj/xcshareddata/xcschemes/RNTester-tvOS.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0820\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"NO\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2D2A28121D9B038B00D4039D\"\n               BuildableName = \"libReact.a\"\n               BlueprintName = \"React-tvOS\"\n               ReferencedContainer = \"container:../React/ReactLegacy.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"3D13F83D1D6F6AE000E69E0E\"\n               BuildableName = \"RNTesterBundle.bundle\"\n               BlueprintName = \"RNTesterBundle\"\n               ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2DD3238F1DA2DD8A000FE1B8\"\n               BuildableName = \"RNTester-tvOS.app\"\n               BlueprintName = \"RNTester-tvOS\"\n               ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2DD323A41DA2DD8B000FE1B8\"\n               BuildableName = \"RNTester-tvOSUnitTests.xctest\"\n               BlueprintName = \"RNTester-tvOSUnitTests\"\n               ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2D4624C11DA2EA6900C74D09\"\n               BuildableName = \"RNTester-tvOSIntegrationTests.xctest\"\n               BlueprintName = \"RNTester-tvOSIntegrationTests\"\n               ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"2DD3238F1DA2DD8A000FE1B8\"\n            BuildableName = \"RNTester-tvOS.app\"\n            BlueprintName = \"RNTester-tvOS\"\n            ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"2DD3238F1DA2DD8A000FE1B8\"\n            BuildableName = \"RNTester-tvOS.app\"\n            BlueprintName = \"RNTester-tvOS\"\n            ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"2DD3238F1DA2DD8A000FE1B8\"\n            BuildableName = \"RNTester-tvOS.app\"\n            BlueprintName = \"RNTester-tvOS\"\n            ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "RNTester/RNTesterLegacy.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0820\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"NO\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"83CBBA2D1A601D0E00E9B192\"\n               BuildableName = \"libReact.a\"\n               BlueprintName = \"React\"\n               ReferencedContainer = \"container:../React/ReactLegacy.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"3D13F83D1D6F6AE000E69E0E\"\n               BuildableName = \"RNTesterBundle.bundle\"\n               BlueprintName = \"RNTesterBundle\"\n               ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n               BuildableName = \"RNTester.app\"\n               BlueprintName = \"RNTester\"\n               ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"NO\"\n            buildForProfiling = \"NO\"\n            buildForArchiving = \"NO\"\n            buildForAnalyzing = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"004D289D1AAF61C70097A701\"\n               BuildableName = \"RNTesterUnitTests.xctest\"\n               BlueprintName = \"RNTesterUnitTests\"\n               ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"NO\"\n            buildForProfiling = \"NO\"\n            buildForArchiving = \"NO\"\n            buildForAnalyzing = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"143BC5941B21E3E100462512\"\n               BuildableName = \"RNTesterIntegrationTests.xctest\"\n               BlueprintName = \"RNTesterIntegrationTests\"\n               ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"004D289D1AAF61C70097A701\"\n               BuildableName = \"RNTesterUnitTests.xctest\"\n               BlueprintName = \"RNTesterUnitTests\"\n               ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"143BC5941B21E3E100462512\"\n               BuildableName = \"RNTesterIntegrationTests.xctest\"\n               BlueprintName = \"RNTesterIntegrationTests\"\n               ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"RNTester.app\"\n            BlueprintName = \"RNTester\"\n            ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"RNTester.app\"\n            BlueprintName = \"RNTester\"\n            ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <EnvironmentVariables>\n         <EnvironmentVariable\n            key = \"CI_USE_PACKAGER\"\n            value = \"1\"\n            isEnabled = \"YES\">\n         </EnvironmentVariable>\n      </EnvironmentVariables>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"RNTester.app\"\n            BlueprintName = \"RNTester\"\n            ReferencedContainer = \"container:RNTesterLegacy.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/OCMock/NSNotificationCenter+OCMAdditions.h",
    "content": "/*\n *  Copyright (c) 2009-2014 Erik Doernenburg and contributors\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n *  not use these files except in compliance with the License. You may obtain\n *  a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n *  License for the specific language governing permissions and limitations\n *  under the License.\n */\n\n#import <Foundation/Foundation.h>\n\n@class OCObserverMockObject;\n\n\n@interface NSNotificationCenter(OCMAdditions)\n\n- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender;\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/OCMock/OCMArg.h",
    "content": "/*\n *  Copyright (c) 2009-2014 Erik Doernenburg and contributors\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n *  not use these files except in compliance with the License. You may obtain\n *  a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n *  License for the specific language governing permissions and limitations\n *  under the License.\n */\n\n#import <Foundation/Foundation.h>\n\n@interface OCMArg : NSObject\n\n// constraining arguments\n\n+ (id)any;\n+ (SEL)anySelector;\n+ (void *)anyPointer;\n+ (id __autoreleasing *)anyObjectRef;\n+ (id)isNil;\n+ (id)isNotNil;\n+ (id)isEqual:(id)value;\n+ (id)isNotEqual:(id)value;\n+ (id)isKindOfClass:(Class)cls;\n+ (id)checkWithSelector:(SEL)selector onObject:(id)anObject;\n+ (id)checkWithBlock:(BOOL (^)(id obj))block;\n\n// manipulating arguments\n\n+ (id *)setTo:(id)value;\n+ (void *)setToValue:(NSValue *)value;\n\n// internal use only\n\n+ (id)resolveSpecialValues:(NSValue *)value;\n\n@end\n\n#define OCMOCK_ANY [OCMArg any]\n\n#if defined(__GNUC__) && !defined(__STRICT_ANSI__)\n  #define OCMOCK_VALUE(variable) \\\n    ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; })\n#else\n  #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))]\n#endif\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/OCMock/OCMConstraint.h",
    "content": "/*\n *  Copyright (c) 2007-2014 Erik Doernenburg and contributors\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n *  not use these files except in compliance with the License. You may obtain\n *  a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n *  License for the specific language governing permissions and limitations\n *  under the License.\n */\n\n#import <Foundation/Foundation.h>\n\n\n@interface OCMConstraint : NSObject\n\n+ (instancetype)constraint;\n- (BOOL)evaluate:(id)value;\n\n// if you are looking for any, isNil, etc, they have moved to OCMArg\n\n// try to use [OCMArg checkWith...] instead of the constraintWith... methods below\n\n+ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject;\n+ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue;\n\n\n@end\n\n@interface OCMAnyConstraint : OCMConstraint\n@end\n\n@interface OCMIsNilConstraint : OCMConstraint\n@end\n\n@interface OCMIsNotNilConstraint : OCMConstraint\n@end\n\n@interface OCMIsNotEqualConstraint : OCMConstraint\n{\n\t@public\n\tid testValue;\n}\n\n@end\n\n@interface OCMInvocationConstraint : OCMConstraint\n{\n\t@public\n\tNSInvocation *invocation;\n}\n\n@end\n\n@interface OCMBlockConstraint : OCMConstraint\n{\n\tBOOL (^block)(id);\n}\n\n- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block;\n\n@end\n\n\n#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self]\n#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)]\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/OCMock/OCMLocation.h",
    "content": "/*\n *  Copyright (c) 2014 Erik Doernenburg and contributors\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n *  not use these files except in compliance with the License. You may obtain\n *  a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n *  License for the specific language governing permissions and limitations\n *  under the License.\n */\n\n#import <Foundation/Foundation.h>\n\n@interface OCMLocation : NSObject\n{\n    id          testCase;\n    NSString    *file;\n    NSUInteger  line;\n}\n\n+ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;\n\n- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;\n\n- (id)testCase;\n- (NSString *)file;\n- (NSUInteger)line;\n\n@end\n\nextern OCMLocation *OCMMakeLocation(id testCase, const char *file, int line);\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/OCMock/OCMMacroState.h",
    "content": "/*\n *  Copyright (c) 2014 Erik Doernenburg and contributors\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n *  not use these files except in compliance with the License. You may obtain\n *  a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n *  License for the specific language governing permissions and limitations\n *  under the License.\n */\n\n#import <Foundation/Foundation.h>\n\n@class OCMLocation;\n@class OCMRecorder;\n@class OCMStubRecorder;\n@class OCMockObject;\n\n\n@interface OCMMacroState : NSObject\n{\n    OCMRecorder *recorder;\n}\n\n+ (void)beginStubMacro;\n+ (OCMStubRecorder *)endStubMacro;\n\n+ (void)beginExpectMacro;\n+ (OCMStubRecorder *)endExpectMacro;\n\n+ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation;\n+ (void)endVerifyMacro;\n\n+ (OCMMacroState *)globalState;\n\n- (OCMRecorder *)recorder;\n\n- (void)switchToClassMethod;\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/OCMock/OCMRecorder.h",
    "content": "/*\n *  Copyright (c) 2014 Erik Doernenburg and contributors\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n *  not use these files except in compliance with the License. You may obtain\n *  a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n *  License for the specific language governing permissions and limitations\n *  under the License.\n */\n\n#import <Foundation/Foundation.h>\n\n@class OCMockObject;\n@class OCMInvocationMatcher;\n\n\n@interface OCMRecorder : NSProxy\n{\n    OCMockObject         *mockObject;\n    OCMInvocationMatcher *invocationMatcher;\n}\n\n- (instancetype)init;\n- (instancetype)initWithMockObject:(OCMockObject *)aMockObject;\n\n- (void)setMockObject:(OCMockObject *)aMockObject;\n\n- (OCMInvocationMatcher *)invocationMatcher;\n\n- (id)classMethod;\n- (id)ignoringNonObjectArgs;\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/OCMock/OCMStubRecorder.h",
    "content": "/*\n *  Copyright (c) 2004-2014 Erik Doernenburg and contributors\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n *  not use these files except in compliance with the License. You may obtain\n *  a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n *  License for the specific language governing permissions and limitations\n *  under the License.\n */\n\n#import <OCMock/OCMRecorder.h>\n\n\n@interface OCMStubRecorder : OCMRecorder\n\n- (id)andReturn:(id)anObject;\n- (id)andReturnValue:(NSValue *)aValue;\n- (id)andThrow:(NSException *)anException;\n- (id)andPost:(NSNotification *)aNotification;\n- (id)andCall:(SEL)selector onObject:(id)anObject;\n- (id)andDo:(void (^)(NSInvocation *invocation))block;\n- (id)andForwardToRealObject;\n\n@end\n\n\n@interface OCMStubRecorder (Properties)\n\n#define andReturn(aValue) _andReturn(({ __typeof__(aValue) _v = (aValue); [NSValue value:&_v withObjCType:@encode(__typeof__(_v))]; }))\n@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *);\n\n#define andThrow(anException) _andThrow(anException)\n@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *);\n\n#define andPost(aNotification) _andPost(aNotification)\n@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *);\n\n#define andCall(anObject, aSelector) _andCall(anObject, aSelector)\n@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL);\n\n#define andDo(aBlock) _andDo(aBlock)\n@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *));\n\n#define andForwardToRealObject() _andForwardToRealObject()\n@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void);\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/OCMock/OCMock.h",
    "content": "/*\n *  Copyright (c) 2004-2014 Erik Doernenburg and contributors\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n *  not use these files except in compliance with the License. You may obtain\n *  a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n *  License for the specific language governing permissions and limitations\n *  under the License.\n */\n\n#import <OCMock/OCMockObject.h>\n#import <OCMock/OCMRecorder.h>\n#import <OCMock/OCMStubRecorder.h>\n#import <OCMock/OCMConstraint.h>\n#import <OCMock/OCMArg.h>\n#import <OCMock/OCMLocation.h>\n#import <OCMock/OCMMacroState.h>\n#import <OCMock/NSNotificationCenter+OCMAdditions.h>\n\n\n#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls]\n\n#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls]\n\n#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol]\n\n#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol]\n\n#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj]\n\n#define OCMObserverMock() [OCMockObject observerMock]\n\n\n#define OCMStub(invocation) \\\n({ \\\n    _OCMSilenceWarnings( \\\n        [OCMMacroState beginStubMacro]; \\\n        invocation; \\\n        [OCMMacroState endStubMacro]; \\\n    ); \\\n})\n\n#define OCMExpect(invocation) \\\n({ \\\n    _OCMSilenceWarnings( \\\n        [OCMMacroState beginExpectMacro]; \\\n        invocation; \\\n        [OCMMacroState endExpectMacro]; \\\n    ); \\\n})\n\n#define ClassMethod(invocation) \\\n    _OCMSilenceWarnings( \\\n        [[OCMMacroState globalState] switchToClassMethod]; \\\n        invocation; \\\n    );\n\n\n#define OCMVerifyAll(mock) [mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]\n\n#define OCMVerifyAllWithDelay(mock, delay) [mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)]\n\n#define OCMVerify(invocation) \\\n({ \\\n    _OCMSilenceWarnings( \\\n        [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \\\n        invocation; \\\n        [OCMMacroState endVerifyMacro]; \\\n    ); \\\n})\n\n#define _OCMSilenceWarnings(macro) \\\n({ \\\n    _Pragma(\"clang diagnostic push\") \\\n    _Pragma(\"clang diagnostic ignored \\\"-Wunused-value\\\"\") \\\n    macro \\\n    _Pragma(\"clang diagnostic pop\") \\\n})\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/OCMock/OCMockObject.h",
    "content": "/*\n *  Copyright (c) 2004-2014 Erik Doernenburg and contributors\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n *  not use these files except in compliance with the License. You may obtain\n *  a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n *  License for the specific language governing permissions and limitations\n *  under the License.\n */\n\n#import <Foundation/Foundation.h>\n\n@class OCMLocation;\n@class OCMInvocationStub;\n@class OCMStubRecorder;\n@class OCMInvocationMatcher;\n@class OCMInvocationExpectation;\n\n\n@interface OCMockObject : NSProxy\n{\n\tBOOL\t\t\tisNice;\n\tBOOL\t\t\texpectationOrderMatters;\n\tNSMutableArray\t*stubs;\n\tNSMutableArray\t*expectations;\n\tNSMutableArray\t*exceptions;\n    NSMutableArray  *invocations;\n}\n\n+ (id)mockForClass:(Class)aClass;\n+ (id)mockForProtocol:(Protocol *)aProtocol;\n+ (id)partialMockForObject:(NSObject *)anObject;\n\n+ (id)niceMockForClass:(Class)aClass;\n+ (id)niceMockForProtocol:(Protocol *)aProtocol;\n\n+ (id)observerMock;\n\n- (instancetype)init;\n\n- (void)setExpectationOrderMatters:(BOOL)flag;\n\n- (id)stub;\n- (id)expect;\n- (id)reject;\n\n- (id)verify;\n- (id)verifyAtLocation:(OCMLocation *)location;\n\n- (void)verifyWithDelay:(NSTimeInterval)delay;\n- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location;\n\n- (void)stopMocking;\n\n// internal use only\n\n- (void)addStub:(OCMInvocationStub *)aStub;\n- (void)addExpectation:(OCMInvocationExpectation *)anExpectation;\n\n- (BOOL)handleInvocation:(NSInvocation *)anInvocation;\n- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation;\n- (BOOL)handleSelector:(SEL)sel;\n\n- (void)verifyInvocation:(OCMInvocationMatcher *)matcher;\n- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location;\n\n@end\n\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTAllocationTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <Foundation/Foundation.h>\n#import <XCTest/XCTest.h>\n\n#import <RCTTest/RCTTestRunner.h>\n#import <React/RCTBridge+Private.h>\n#import <React/RCTBridge.h>\n#import <React/RCTModuleMethod.h>\n#import <React/RCTRootView.h>\n\n@interface RCTJavaScriptContext : NSObject\n\n@property (nonatomic, assign, readonly) JSGlobalContextRef ctx;\n\n@end\n\n@interface AllocationTestModule : NSObject<RCTBridgeModule, RCTInvalidating>\n\n@property (nonatomic, assign, getter=isValid) BOOL valid;\n\n@end\n\n@implementation AllocationTestModule\n\nRCT_EXPORT_MODULE();\n\n- (instancetype)init\n{\n  if ((self = [super init])) {\n    _valid = YES;\n  }\n  return self;\n}\n\n- (void)invalidate\n{\n  _valid = NO;\n}\n\nRCT_EXPORT_METHOD(test:(__unused NSString *)a\n                      :(__unused NSNumber *)b\n                      :(__unused RCTResponseSenderBlock)c\n                      :(__unused RCTResponseErrorBlock)d) {}\n\n@end\n\n@interface RCTAllocationTests : XCTestCase\n@end\n\n@implementation RCTAllocationTests {\n  NSURL *_bundleURL;\n}\n\n- (void)setUp\n{\n  [super setUp];\n\n  NSString *bundleContents =\n  @\"var __fbBatchedBridge = {\"\n   \"  callFunctionReturnFlushedQueue: function() { return null; },\"\n   \"  invokeCallbackAndReturnFlushedQueue: function() { return null; },\"\n   \"  flushedQueue: function() { return null; },\"\n   \"  callFunctionReturnResultAndFlushedQueue: function() { return null; },\"\n   \"};\";\n\n  NSURL *tempDir = [NSURL fileURLWithPath:NSTemporaryDirectory() isDirectory:YES];\n  [[NSFileManager defaultManager] createDirectoryAtURL:tempDir withIntermediateDirectories:YES attributes:nil error:NULL];\n  NSString *guid = [[NSProcessInfo processInfo] globallyUniqueString];\n  NSString *fileName = [NSString stringWithFormat:@\"rctallocationtests-bundle-%@.js\", guid];\n\n  _bundleURL = [tempDir URLByAppendingPathComponent:fileName];\n  NSError *saveError;\n  if (![bundleContents writeToURL:_bundleURL atomically:YES encoding:NSUTF8StringEncoding error:&saveError]) {\n    XCTFail(@\"Failed to save test bundle to %@, error: %@\", _bundleURL, saveError);\n  };\n}\n\n- (void)tearDown\n{\n  [super tearDown];\n\n  [[NSFileManager defaultManager] removeItemAtURL:_bundleURL error:NULL];\n}\n\n- (void)testBridgeIsDeallocated\n{\n  __weak RCTBridge *weakBridge;\n  @autoreleasepool {\n    RCTRootView *view = [[RCTRootView alloc] initWithBundleURL:_bundleURL\n                                                    moduleName:@\"\"\n                                             initialProperties:nil\n                                                 launchOptions:nil];\n    weakBridge = view.bridge;\n    XCTAssertNotNil(weakBridge, @\"RCTBridge should have been created\");\n    (void)view;\n  }\n\n  // XCTAssertNil(weakBridge, @\"RCTBridge should have been deallocated\");\n}\n\n- (void)testModulesAreInvalidated\n{\n  AllocationTestModule *module = [AllocationTestModule new];\n  @autoreleasepool {\n    RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:_bundleURL\n                                              moduleProvider:^{ return @[module]; }\n                                               launchOptions:nil];\n    XCTAssertTrue(module.isValid, @\"AllocationTestModule should be valid\");\n    (void)bridge;\n  }\n\n  RCT_RUN_RUNLOOP_WHILE(module.isValid)\n  XCTAssertFalse(module.isValid, @\"AllocationTestModule should have been invalidated by the bridge\");\n}\n\n// TODO: Fix deallocating\n- (void)testModulesAreDeallocated\n{\n  __weak AllocationTestModule *weakModule;\n  @autoreleasepool {\n    AllocationTestModule *module = [AllocationTestModule new];\n    RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:_bundleURL\n                                              moduleProvider:^{ return @[module]; }\n                                               launchOptions:nil];\n    XCTAssertNotNil(module, @\"AllocationTestModule should have been created\");\n    weakModule = module;\n    (void)bridge;\n  }\n\n  //RCT_RUN_RUNLOOP_WHILE(weakModule);\n  //XCTAssertNil(weakModule, @\"AllocationTestModule should have been deallocated\");\n}\n\n- (void)testModuleMethodsAreDeallocated\n{\n  static RCTMethodInfo methodInfo = {\n    .objcName = \"test:(NSString *)a :(nonnull NSNumber *)b :(RCTResponseSenderBlock)c :(RCTResponseErrorBlock)d\",\n    .jsName = \"\",\n    .isSync = false\n  };\n\n  __weak RCTModuleMethod *weakMethod;\n  @autoreleasepool {\n    __autoreleasing RCTModuleMethod *method = [[RCTModuleMethod alloc] initWithExportedMethod:&methodInfo\n                                                                                  moduleClass:[AllocationTestModule class]];\n    XCTAssertNotNil(method, @\"RCTModuleMethod should have been created\");\n    weakMethod = method;\n  }\n\n  RCT_RUN_RUNLOOP_WHILE(weakMethod)\n  XCTAssertNil(weakMethod, @\"RCTModuleMethod should have been deallocated\");\n}\n\n- (void)testContentViewIsInvalidated\n{\n  RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:_bundleURL\n                                            moduleProvider:nil\n                                             launchOptions:nil];\n  __weak NSView *rootContentView;\n  @autoreleasepool {\n    RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@\"\" initialProperties:nil];\n    RCT_RUN_RUNLOOP_WHILE(!(rootContentView = [rootView valueForKey:@\"contentView\"]))\n    // XCTAssertTrue(rootContentView.userInteractionEnabled, @\"RCTContentView should be valid\");\n    (void)rootView;\n  }\n\n#if !TARGET_OS_TV // userInteractionEnabled is true for Apple TV views\n  // XCTAssertFalse(rootContentView.userInteractionEnabled, @\"RCTContentView should have been invalidated\");\n#endif\n}\n\n- (void)testUnderlyingBridgeIsDeallocated\n{\n  RCTBridge *bridge;\n  __weak id batchedBridge;\n  @autoreleasepool {\n    bridge = [[RCTBridge alloc] initWithBundleURL:_bundleURL moduleProvider:nil launchOptions:nil];\n    batchedBridge = bridge.batchedBridge;\n    XCTAssertTrue([batchedBridge isValid], @\"RCTBatchedBridge should be valid\");\n    [bridge reload];\n  }\n\n  RCT_RUN_RUNLOOP_WHILE(batchedBridge != nil)\n\n  XCTAssertNotNil(bridge, @\"RCTBridge should not have been deallocated\");\n  //XCTAssertNil(batchedBridge, @\"RCTBatchedBridge should have been deallocated\");\n\n  // Wait to complete the test until the new batchedbridge is also deallocated\n  @autoreleasepool {\n    batchedBridge = bridge.batchedBridge;\n    [bridge invalidate];\n    bridge = nil;\n  }\n\n  RCT_RUN_RUNLOOP_WHILE(batchedBridge != nil);\n  // TODO: fix batchedBridge being not null\n  //XCTAssertNil(batchedBridge);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTAnimationUtilsTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <RCTAnimation/RCTAnimationUtils.h>\n\n@interface RCTAnimationUtilsTests : XCTestCase\n\n@end\n\nstatic CGFloat RCTSimpleInterpolation(CGFloat value, NSArray<NSNumber *> *inputRange, NSArray<NSNumber *> *outputRange) {\n  return RCTInterpolateValueInRange(value,\n                                    inputRange,\n                                    outputRange,\n                                    EXTRAPOLATE_TYPE_EXTEND,\n                                    EXTRAPOLATE_TYPE_EXTEND);\n}\n\n@implementation RCTAnimationUtilsTests\n\n// RCTInterpolateValueInRange\n\n- (void)testSimpleOneToOneMapping\n{\n  NSArray<NSNumber *> *input = @[@0, @1];\n  NSArray<NSNumber *> *output = @[@0, @1];\n  XCTAssertEqual(RCTSimpleInterpolation(0, input, output), 0);\n  XCTAssertEqual(RCTSimpleInterpolation(0.5, input, output), 0.5);\n  XCTAssertEqual(RCTSimpleInterpolation(0.8, input, output), 0.8);\n  XCTAssertEqual(RCTSimpleInterpolation(1, input, output), 1);\n}\n\n- (void)testWiderOutputRange\n{\n  NSArray<NSNumber *> *input = @[@0, @1];\n  NSArray<NSNumber *> *output = @[@100, @200];\n  XCTAssertEqual(RCTSimpleInterpolation(0, input, output), 100);\n  XCTAssertEqual(RCTSimpleInterpolation(0.5, input, output), 150);\n  XCTAssertEqual(RCTSimpleInterpolation(0.8, input, output), 180);\n  XCTAssertEqual(RCTSimpleInterpolation(1, input, output), 200);\n}\n\n- (void)testWiderInputRange\n{\n  NSArray<NSNumber *> *input = @[@2000, @3000];\n  NSArray<NSNumber *> *output = @[@1, @2];\n  XCTAssertEqual(RCTSimpleInterpolation(2000, input, output), 1);\n  XCTAssertEqual(RCTSimpleInterpolation(2250, input, output), 1.25);\n  XCTAssertEqual(RCTSimpleInterpolation(2800, input, output), 1.8);\n  XCTAssertEqual(RCTSimpleInterpolation(3000, input, output), 2);\n}\n\n- (void)testManySegments\n{\n  NSArray<NSNumber *> *input = @[@-1, @1, @5];\n  NSArray<NSNumber *> *output = @[@0, @10, @20];\n  XCTAssertEqual(RCTSimpleInterpolation(-1, input, output), 0);\n  XCTAssertEqual(RCTSimpleInterpolation(0, input, output), 5);\n  XCTAssertEqual(RCTSimpleInterpolation(1, input, output), 10);\n  XCTAssertEqual(RCTSimpleInterpolation(2, input, output), 12.5);\n  XCTAssertEqual(RCTSimpleInterpolation(5, input, output), 20);\n}\n\n- (void)testExtendExtrapolate\n{\n  NSArray<NSNumber *> *input = @[@10, @20];\n  NSArray<NSNumber *> *output = @[@0, @1];\n  XCTAssertEqual(RCTSimpleInterpolation(30, input, output), 2);\n  XCTAssertEqual(RCTSimpleInterpolation(5, input, output), -0.5);\n}\n\n- (void)testClampExtrapolate\n{\n  NSArray<NSNumber *> *input = @[@10, @20];\n  NSArray<NSNumber *> *output = @[@0, @1];\n  CGFloat value;\n  value = RCTInterpolateValueInRange(30,\n                                     input,\n                                     output,\n                                     EXTRAPOLATE_TYPE_CLAMP,\n                                     EXTRAPOLATE_TYPE_CLAMP);\n  XCTAssertEqual(value, 1);\n  value = RCTInterpolateValueInRange(5,\n                                     input,\n                                     output,\n                                     EXTRAPOLATE_TYPE_CLAMP,\n                                     EXTRAPOLATE_TYPE_CLAMP);\n  XCTAssertEqual(value, 0);\n}\n\n- (void)testIdentityExtrapolate\n{\n  NSArray<NSNumber *> *input = @[@10, @20];\n  NSArray<NSNumber *> *output = @[@0, @1];\n  CGFloat value;\n  value = RCTInterpolateValueInRange(30,\n                                     input,\n                                     output,\n                                     EXTRAPOLATE_TYPE_IDENTITY,\n                                     EXTRAPOLATE_TYPE_IDENTITY);\n  XCTAssertEqual(value, 30);\n  value = RCTInterpolateValueInRange(5,\n                                     input,\n                                     output,\n                                     EXTRAPOLATE_TYPE_IDENTITY,\n                                     EXTRAPOLATE_TYPE_IDENTITY);\n  XCTAssertEqual(value, 5);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTBridgeTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <Foundation/Foundation.h>\n#import <XCTest/XCTest.h>\n\n#import <RCTTest/RCTTestRunner.h>\n#import <React/RCTBridge+Private.h>\n#import <React/RCTBridge.h>\n#import <React/RCTBridgeModule.h>\n#import <React/RCTJavaScriptExecutor.h>\n#import <React/RCTUtils.h>\n\nstatic const NSUInteger kNameIndex = 0;\nstatic const NSUInteger kConstantsIndex = 1;\nstatic const NSUInteger kMethodsIndex = 2;\n\n@interface TestExecutor : NSObject <RCTJavaScriptExecutor>\n\n@property (nonatomic, readonly, copy) NSMutableDictionary<NSString *, id> *injectedStuff;\n\n@end\n\n@implementation TestExecutor\n\n@synthesize valid = _valid;\n\nRCT_EXPORT_MODULE()\n\n- (void)setUp {}\n\n- (instancetype)init\n{\n  if (self = [super init]) {\n    _injectedStuff = [NSMutableDictionary dictionary];\n  }\n  return self;\n}\n\n- (BOOL)isValid\n{\n  return _valid;\n}\n\n- (void)flushedQueue:(RCTJavaScriptCallback)onComplete\n{\n  onComplete(nil, nil);\n}\n\n- (void)callFunctionOnModule:(__unused NSString *)module\n                      method:(__unused NSString *)method\n                   arguments:(__unused NSArray *)args\n                    callback:(RCTJavaScriptCallback)onComplete\n{\n  onComplete(nil, nil);\n}\n\n- (void)invokeCallbackID:(__unused NSNumber *)cbID\n               arguments:(__unused NSArray *)args\n                callback:(RCTJavaScriptCallback)onComplete\n{\n  onComplete(nil, nil);\n}\n\n- (void)executeApplicationScript:(__unused NSString *)script\n                       sourceURL:(__unused NSURL *)url\n                      onComplete:(RCTJavaScriptCompleteBlock)onComplete\n{\n  onComplete(nil);\n}\n\n- (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block\n{\n  block();\n}\n\n- (void)executeAsyncBlockOnJavaScriptQueue:(dispatch_block_t)block\n{\n  block();\n}\n\n- (void)injectJSONText:(NSString *)script\n   asGlobalObjectNamed:(NSString *)objectName\n              callback:(RCTJavaScriptCompleteBlock)onComplete\n{\n  _injectedStuff[objectName] = script;\n  onComplete(nil);\n}\n\n- (void)invalidate\n{\n  _valid = NO;\n}\n\n@end\n\n// Define a module that is not explicitly registered with RCT_EXPORT_MODULE\n@interface UnregisteredTestModule : NSObject <RCTBridgeModule>\n\n@property (nonatomic, assign) BOOL testMethodCalled;\n\n@end\n\n@implementation UnregisteredTestModule\n\n@synthesize methodQueue = _methodQueue;\n\n+ (NSString *)moduleName\n{\n  return @\"UnregisteredTestModule\";\n}\n\nRCT_EXPORT_METHOD(testMethod)\n{\n  _testMethodCalled = YES;\n}\n\n@end\n\n@interface RCTBridgeTests : XCTestCase <RCTBridgeModule>\n{\n  RCTBridge *_bridge;\n  __weak TestExecutor *_jsExecutor;\n\n  BOOL _testMethodCalled;\n  UnregisteredTestModule *_unregisteredTestModule;\n}\n@end\n\n@implementation RCTBridgeTests\n\n@synthesize methodQueue = _methodQueue;\n\nRCT_EXPORT_MODULE(TestModule)\n\n- (void)setUp\n{\n  [super setUp];\n\n  _unregisteredTestModule = [UnregisteredTestModule new];\n  NSBundle *bundle = [NSBundle bundleForClass:[self class]];\n  _bridge = [[RCTBridge alloc] initWithBundleURL:[bundle URLForResource:@\"RNTesterUnitTestsBundle\" withExtension:@\"js\"]\n                                  moduleProvider:^{ return @[self, self->_unregisteredTestModule]; }\n                                   launchOptions:nil];\n\n  _bridge.executorClass = [TestExecutor class];\n\n  // Force to recreate the executor with the new class\n  // - reload: doesn't work here since bridge hasn't loaded yet.\n  [_bridge invalidate];\n  [_bridge setUp];\n\n  _jsExecutor = _bridge.batchedBridge.javaScriptExecutor;\n  XCTAssertNotNil(_jsExecutor);\n}\n\n- (void)tearDown\n{\n  [super tearDown];\n\n  _testMethodCalled = NO;\n\n  [_bridge invalidate];\n  RCT_RUN_RUNLOOP_WHILE(_jsExecutor.isValid);\n  _bridge = nil;\n}\n\n- (void)testHookRegistration\n{\n  NSString *injectedStuff;\n  RCT_RUN_RUNLOOP_WHILE(!(injectedStuff = _jsExecutor.injectedStuff[@\"__fbBatchedBridgeConfig\"]));\n  XCTAssertNotNil(injectedStuff);\n\n  __block NSNumber *testModuleID = nil;\n  __block NSDictionary<NSString *, id> *testConstants = nil;\n  __block NSNumber *testMethodID = nil;\n\n  NSArray *remoteModuleConfig = RCTJSONParse(injectedStuff, NULL)[@\"remoteModuleConfig\"];\n  [remoteModuleConfig enumerateObjectsUsingBlock:^(id moduleConfig, NSUInteger i, BOOL *stop) {\n    if ([moduleConfig isKindOfClass:[NSArray class]] && [moduleConfig[kNameIndex] isEqualToString:@\"TestModule\"]) {\n      testModuleID = @(i);\n      testConstants = moduleConfig[kConstantsIndex];\n      testMethodID = @([moduleConfig[kMethodsIndex] indexOfObject:@\"testMethod\"]);\n      *stop = YES;\n    }\n  }];\n\n  XCTAssertNotNil(remoteModuleConfig);\n  XCTAssertNotNil(testModuleID);\n  XCTAssertNotNil(testConstants);\n  XCTAssertEqualObjects(testConstants[@\"eleventyMillion\"], @42);\n  XCTAssertNotNil(testMethodID);\n}\n\n- (void)testCallNativeMethod\n{\n  NSString *injectedStuff;\n  RCT_RUN_RUNLOOP_WHILE(!(injectedStuff = _jsExecutor.injectedStuff[@\"__fbBatchedBridgeConfig\"]));\n  XCTAssertNotNil(injectedStuff);\n\n  __block NSNumber *testModuleID = nil;\n  __block NSNumber *testMethodID = nil;\n\n  NSArray *remoteModuleConfig = RCTJSONParse(injectedStuff, NULL)[@\"remoteModuleConfig\"];\n  [remoteModuleConfig enumerateObjectsUsingBlock:^(id moduleConfig, NSUInteger i, __unused BOOL *stop) {\n    if ([moduleConfig isKindOfClass:[NSArray class]] && [moduleConfig[kNameIndex] isEqualToString:@\"TestModule\"]) {\n      testModuleID = @(i);\n      testMethodID = @([moduleConfig[kMethodsIndex] indexOfObject:@\"testMethod\"]);\n      *stop = YES;\n    }\n  }];\n\n  XCTAssertNotNil(testModuleID);\n  XCTAssertNotNil(testMethodID);\n\n  NSArray *args = @[@1234, @5678, @\"stringy\", @{@\"a\": @1}, @42];\n  NSArray *buffer = @[@[testModuleID], @[testMethodID], @[args]];\n\n  [_bridge.batchedBridge handleBuffer:buffer batchEnded:YES];\n\n  dispatch_sync(_methodQueue, ^{\n    // clear the queue\n    XCTAssertTrue(self->_testMethodCalled);\n  });\n}\n\n- (void)testCallUnregisteredModuleMethod\n{\n  NSString *injectedStuff;\n  RCT_RUN_RUNLOOP_WHILE(!(injectedStuff = _jsExecutor.injectedStuff[@\"__fbBatchedBridgeConfig\"]));\n  XCTAssertNotNil(injectedStuff);\n\n  __block NSNumber *testModuleID = nil;\n  __block NSNumber *testMethodID = nil;\n\n  NSArray *remoteModuleConfig = RCTJSONParse(injectedStuff, NULL)[@\"remoteModuleConfig\"];\n  [remoteModuleConfig enumerateObjectsUsingBlock:^(id moduleConfig, NSUInteger i, __unused BOOL *stop) {\n    if ([moduleConfig isKindOfClass:[NSArray class]] && [moduleConfig[kNameIndex] isEqualToString:@\"UnregisteredTestModule\"]) {\n      testModuleID = @(i);\n      testMethodID = @([moduleConfig[kMethodsIndex] indexOfObject:@\"testMethod\"]);\n      *stop = YES;\n    }\n  }];\n\n  XCTAssertNotNil(testModuleID);\n  XCTAssertNotNil(testMethodID);\n\n  NSArray *args = @[];\n  NSArray *buffer = @[@[testModuleID], @[testMethodID], @[args]];\n\n  [_bridge.batchedBridge handleBuffer:buffer batchEnded:YES];\n\n  dispatch_sync(_unregisteredTestModule.methodQueue, ^{\n    XCTAssertTrue(self->_unregisteredTestModule.testMethodCalled);\n  });\n}\n\n- (void)DISABLED_testBadArgumentsCount\n{\n  //NSArray *bufferWithMissingArgument = @[@[@1], @[@0], @[@[@1234, @5678, @\"stringy\", @{@\"a\": @1}/*, @42*/]], @[], @1234567];\n  //[_bridge handleBuffer:bufferWithMissingArgument];\n  NSLog(@\"WARNING: testBadArgumentsCount is temporarily disabled until we have a better way to test cases that we expect to trigger redbox errors\");\n}\n\nRCT_EXPORT_METHOD(testMethod:(NSInteger)integer\n                  number:(nonnull NSNumber *)number\n                  string:(NSString *)string\n                  dictionary:(NSDictionary *)dict\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  _testMethodCalled = YES;\n\n  XCTAssertTrue(integer == 1234);\n  XCTAssertEqualObjects(number, @5678);\n  XCTAssertEqualObjects(string, @\"stringy\");\n  XCTAssertEqualObjects(dict, @{@\"a\": @1});\n  XCTAssertNotNil(callback);\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  return @{@\"eleventyMillion\": @42};\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTBundleURLProviderTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n#import <XCTest/XCTest.h>\n\n#import <React/RCTBundleURLProvider.h>\n#import <React/RCTUtils.h>\n\nstatic NSString *const testFile = @\"test.jsbundle\";\nstatic NSString *const mainBundle = @\"main.jsbundle\";\n\nstatic NSURL *mainBundleURL()\n{\n  return [[[NSBundle mainBundle] bundleURL] URLByAppendingPathComponent:mainBundle];\n}\n\nstatic NSURL *localhostBundleURL()\n{\n  return [NSURL URLWithString:[NSString stringWithFormat:@\"http://localhost:8081/%@.bundle?platform=macos&dev=true&minify=false\", testFile]];\n}\n\nstatic NSURL *ipBundleURL()\n{\n  return [NSURL URLWithString:[NSString stringWithFormat:@\"http://192.168.1.1:8081/%@.bundle?platform=macos&dev=true&minify=false\", testFile]];\n}\n\n@implementation NSBundle (RCTBundleURLProviderTests)\n\n- (NSURL *)RCT_URLForResource:(NSString *)name withExtension:(NSString *)ext\n{\n  // Ensure that test files is always reported as existing\n  if ([[name stringByAppendingFormat:@\".%@\", ext] isEqualToString:mainBundle]) {\n    return [[self bundleURL] URLByAppendingPathComponent:mainBundle];\n  }\n  return [self RCT_URLForResource:name withExtension:ext];\n}\n\n@end\n\n@interface RCTBundleURLProviderTests : XCTestCase\n@end\n\n@implementation RCTBundleURLProviderTests\n\n- (void)setUp\n{\n  [super setUp];\n\n  RCTSwapInstanceMethods([NSBundle class],\n                         @selector(URLForResource:withExtension:),\n                          @selector(RCT_URLForResource:withExtension:));\n}\n\n- (void)tearDown\n{\n  RCTSwapInstanceMethods([NSBundle class],\n                         @selector(URLForResource:withExtension:),\n                         @selector(RCT_URLForResource:withExtension:));\n\n  [super tearDown];\n}\n\n- (void)testBundleURL\n{\n  RCTBundleURLProvider *settings = [RCTBundleURLProvider sharedSettings];\n  settings.jsLocation = nil;\n  NSURL *URL = [settings jsBundleURLForBundleRoot:testFile fallbackResource:nil];\n  if (!getenv(\"CI_USE_PACKAGER\")) {\n    XCTAssertEqualObjects(URL, mainBundleURL());\n  } else {\n    XCTAssertEqualObjects(URL, localhostBundleURL());\n  }\n}\n\n- (void)testLocalhostURL\n{\n  RCTBundleURLProvider *settings = [RCTBundleURLProvider sharedSettings];\n  settings.jsLocation = @\"localhost\";\n  NSURL *URL = [settings jsBundleURLForBundleRoot:testFile fallbackResource:nil];\n  XCTAssertEqualObjects(URL, localhostBundleURL());\n}\n\n- (void)testIPURL\n{\n  RCTBundleURLProvider *settings = [RCTBundleURLProvider sharedSettings];\n  settings.jsLocation = @\"192.168.1.1\";\n  NSURL *URL = [settings jsBundleURLForBundleRoot:testFile fallbackResource:nil];\n  XCTAssertEqualObjects(URL, ipBundleURL());\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTComponentPropsTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <RCTTest/RCTTestRunner.h>\n#import <React/RCTRootShadowView.h>\n#import <React/RCTShadowView.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTView.h>\n#import <React/RCTViewManager.h>\n\n@interface RCTUIManager ()\n\n- (void)createView:(NSNumber *)reactTag\n          viewName:(NSString *)viewName\n           rootTag:(NSNumber *)rootTag\n             props:(NSDictionary *)props;\n\n- (void)updateView:(nonnull NSNumber *)reactTag\n          viewName:(NSString *)viewName\n             props:(NSDictionary *)props;\n\n@property (nonatomic, copy, readonly) NSMutableDictionary<NSNumber *, RCTShadowView *> *shadowViewRegistry;\n\n@end\n\n@interface RCTPropsTestView : NSView\n\n@property (nonatomic, assign) NSInteger integerProp;\n@property (nonatomic, strong) id objectProp;\n@property (nonatomic, assign) CGPoint structProp;\n@property (nonatomic, copy) NSString *customProp;\n\n@end\n\n@implementation RCTPropsTestView\n@end\n\n@interface RCTPropsTestViewManager : RCTViewManager\n@end\n\n@implementation RCTPropsTestViewManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  RCTPropsTestView *view = [RCTPropsTestView new];\n  view.integerProp = 57;\n  view.objectProp = @9;\n  view.structProp = CGPointMake(5, 6);\n  view.customProp = @\"Hello\";\n  return view;\n}\n\nRCT_EXPORT_VIEW_PROPERTY(integerProp, NSInteger)\nRCT_EXPORT_VIEW_PROPERTY(objectProp, NSNumber)\nRCT_EXPORT_VIEW_PROPERTY(structProp, CGPoint)\nRCT_CUSTOM_VIEW_PROPERTY(customProp, NSString, RCTPropsTestView)\n{\n  view.customProp = json ? [RCTConvert NSString:json] : defaultView.customProp;\n}\n\n@end\n\n@interface RCTComponentPropsTests : XCTestCase\n\n@end\n\n@implementation RCTComponentPropsTests\n{\n  RCTBridge *_bridge;\n  NSNumber *_rootViewReactTag;\n}\n\n- (void)setUp\n{\n  [super setUp];\n\n  NSBundle *bundle = [NSBundle bundleForClass:[self class]];\n  _bridge = [[RCTBridge alloc] initWithBundleURL:[bundle URLForResource:@\"RNTesterUnitTestsBundle\" withExtension:@\"js\"]\n                                  moduleProvider:nil\n                                   launchOptions:nil];\n\n  _rootViewReactTag = @1;\n  RCTUIManager *uiManager = _bridge.uiManager;\n\n  dispatch_async(uiManager.methodQueue, ^{\n    RCTRootShadowView *rootShadowView = [RCTRootShadowView new];\n    rootShadowView.reactTag = self->_rootViewReactTag;\n    uiManager.shadowViewRegistry[rootShadowView.reactTag] = rootShadowView;\n  });\n\n  RCT_RUN_RUNLOOP_WHILE(_bridge.isLoading);\n}\n\n- (void)testSetProps\n{\n  __block RCTPropsTestView *view;\n  RCTUIManager *uiManager = _bridge.uiManager;\n  NSDictionary *props = @{@\"integerProp\": @58,\n                          @\"objectProp\": @10,\n                          @\"structProp\": @{@\"x\": @7, @\"y\": @8},\n                          @\"customProp\": @\"Goodbye\"};\n\n  dispatch_async(uiManager.methodQueue, ^{\n    [uiManager createView:@2 viewName:@\"RCTPropsTestView\" rootTag:self->_rootViewReactTag props:props];\n    [uiManager addUIBlock:^(__unused RCTUIManager *_uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n      view = (RCTPropsTestView *)viewRegistry[@2];\n      XCTAssertEqual(view.integerProp, 58);\n      XCTAssertEqualObjects(view.objectProp, @10);\n      XCTAssertTrue(CGPointEqualToPoint(view.structProp, CGPointMake(7, 8)));\n      XCTAssertEqualObjects(view.customProp, @\"Goodbye\");\n    }];\n    [uiManager setNeedsLayout];\n  });\n\n  RCT_RUN_RUNLOOP_WHILE(view == nil);\n}\n\n- (void)testResetProps\n{\n  __block RCTPropsTestView *view;\n  RCTUIManager *uiManager = _bridge.uiManager;\n  NSDictionary *props = @{@\"integerProp\": @58,\n                          @\"objectProp\": @10,\n                          @\"structProp\": @{@\"x\": @7, @\"y\": @8},\n                          @\"customProp\": @\"Goodbye\"};\n\n  NSDictionary *resetProps = @{@\"integerProp\": [NSNull null],\n                               @\"objectProp\": [NSNull null],\n                               @\"structProp\": [NSNull null],\n                               @\"customProp\": [NSNull null]};\n\n  dispatch_async(uiManager.methodQueue, ^{\n    [uiManager createView:@2 viewName:@\"RCTPropsTestView\" rootTag:self->_rootViewReactTag props:props];\n    [uiManager updateView:@2 viewName:@\"RCTPropsTestView\" props:resetProps];\n    [uiManager addUIBlock:^(__unused RCTUIManager *_uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n      view = (RCTPropsTestView *)viewRegistry[@2];\n      XCTAssertEqual(view.integerProp, 57);\n      XCTAssertEqualObjects(view.objectProp, @9);\n      XCTAssertTrue(CGPointEqualToPoint(view.structProp, CGPointMake(5, 6)));\n      XCTAssertEqualObjects(view.customProp, @\"Hello\");\n    }];\n    [uiManager setNeedsLayout];\n  });\n\n  RCT_RUN_RUNLOOP_WHILE(view == nil);\n}\n\n- (void)testResetBackgroundColor\n{\n  __block RCTView *view;\n  RCTUIManager *uiManager = _bridge.uiManager;\n  NSDictionary *props = @{@\"backgroundColor\": @0xffffffff};\n  NSDictionary *resetProps = @{@\"backgroundColor\": [NSNull null]};\n\n  dispatch_async(uiManager.methodQueue, ^{\n    [uiManager createView:@2 viewName:@\"RCTView\" rootTag:self->_rootViewReactTag props:props];\n    [uiManager addUIBlock:^(__unused RCTUIManager *_uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n      view = (RCTView *)viewRegistry[@2];\n      NSColor *viewBackgroundColor = [NSColor colorWithCGColor:view.layer.backgroundColor];\n      NSColor *expected = [RCTConvert NSColor:@0xffffffff];\n      XCTAssertEqualObjects(viewBackgroundColor, expected);\n    }];\n    [uiManager updateView:@2 viewName:@\"RCTView\" props:resetProps];\n    [uiManager addUIBlock:^(__unused RCTUIManager *_uiManager, __unused NSDictionary<NSNumber *,NSView *> *viewRegistry) {\n      view = (RCTView *)viewRegistry[@2];\n      XCTAssertNil(view.layer);\n    }];\n    [uiManager setNeedsLayout];\n  });\n\n  RCT_RUN_RUNLOOP_WHILE(view == nil);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTConvert_NSURLTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <React/RCTConvert.h>\n#import <React/RCTUtils.h>\n\n@interface RCTConvert_NSURLTests : XCTestCase\n\n@end\n\n@implementation RCTConvert_NSURLTests\n\n#define TEST_URL(name, _input, _expectedURL) \\\n- (void)test_##name { \\\n  NSURL *result = [RCTConvert NSURL:_input]; \\\n  XCTAssertEqualObjects(result.absoluteString, _expectedURL); \\\n} \\\n\n#define TEST_PATH(name, _input, _expectedPath) \\\n- (void)test_##name { \\\n  NSURL *result = [RCTConvert NSURL:_input]; \\\n  XCTAssertEqualObjects(result.path, _expectedPath); \\\n} \\\n\n#define TEST_BUNDLE_PATH(name, _input, _expectedPath) \\\nTEST_PATH(name, _input, [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:_expectedPath])\n\n// Basic tests\nTEST_URL(basic, @\"http://example.com\", @\"http://example.com\")\nTEST_URL(null, (id)kCFNull, nil)\n\n// Resource files\nTEST_PATH(fileURL, @\"file:///blah/hello.jsbundle\", @\"/blah/hello.jsbundle\")\nTEST_BUNDLE_PATH(filePath, @\"blah/hello.jsbundle\", @\"blah/hello.jsbundle\")\nTEST_BUNDLE_PATH(filePathWithSpaces, @\"blah blah/hello.jsbundle\", @\"blah blah/hello.jsbundle\")\nTEST_BUNDLE_PATH(filePathWithEncodedSpaces, @\"blah%20blah/hello.jsbundle\", @\"blah blah/hello.jsbundle\")\nTEST_BUNDLE_PATH(imageAt2XPath, @\"images/foo@2x.jpg\",  @\"images/foo@2x.jpg\")\nTEST_BUNDLE_PATH(imageFile, @\"foo.jpg\",  @\"foo.jpg\")\n\n// User documents\nTEST_PATH(documentsFolder, @\"~/Documents\",\n          [NSSearchPathForDirectoriesInDomains\n           (NSDocumentDirectory, NSUserDomainMask, YES) firstObject])\n\n// Remote files\nTEST_URL(fullURL, @\"http://example.com/blah/hello.jsbundle\", @\"http://example.com/blah/hello.jsbundle\")\nTEST_URL(urlWithSpaces, @\"http://example.com/blah blah/foo\", @\"http://example.com/blah%20blah/foo\")\nTEST_URL(urlWithEncodedSpaces, @\"http://example.com/blah%20blah/foo\", @\"http://example.com/blah%20blah/foo\")\nTEST_URL(imageURL, @\"http://example.com/foo@2x.jpg\",  @\"http://example.com/foo@2x.jpg\")\nTEST_URL(imageURLWithSpaces, @\"http://example.com/blah foo@2x.jpg\",  @\"http://example.com/blah%20foo@2x.jpg\")\n\n// Unicode\nTEST_URL(unicodeURL,\n         @\"https://ru.wikipedia.org/wiki/\\u0417\\u0430\\u0433\\u043B\\u0430\\u0432\"\n         \"\\u043D\\u0430\\u044F_\\u0441\\u0442\\u0440\\u0430\\u043D\\u0438\\u0446\\u0430\",\n         @\"https://ru.wikipedia.org/wiki/%D0%97%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2\"\n         \"%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0\")\n\n// Data URLs\n- (void)testDataURL\n{\n  NSURL *expectedURL = RCTDataURL(@\"text/plain\", [@\"abcde\" dataUsingEncoding:NSUTF8StringEncoding]);\n  NSURL *testURL = [NSURL URLWithString:@\"data:text/plain;base64,YWJjZGU=\"];\n  XCTAssertEqualObjects([testURL absoluteString], [expectedURL absoluteString]);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTConvert_YGValueTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <React/RCTConvert.h>\n\n@interface RCTConvert_YGValueTests : XCTestCase\n\n@end\n\n@implementation RCTConvert_YGValueTests\n\n- (void)testUndefined\n{\n  YGValue value = [RCTConvert YGValue:nil];\n  XCTAssertEqual(value.unit, YGUnitUndefined);\n}\n\n- (void)testNumberPoints\n{\n  YGValue value = [RCTConvert YGValue:@100];\n  XCTAssertEqual(value.unit, YGUnitPoint);\n  XCTAssertEqual(value.value, 100);\n}\n\n- (void)testStringPercent\n{\n  YGValue value = [RCTConvert YGValue:@\"100%\"];\n  XCTAssertEqual(value.unit, YGUnitPercent);\n  XCTAssertEqual(value.value, 100);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTDevMenuTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <RCTTest/RCTTestRunner.h>\n#import <React/RCTBridge.h>\n#import <React/RCTDevMenu.h>\n\n// typedef void(^RCTDevMenuAlertActionHandler)(UIAlertAction *action);\n\n@interface RCTDevMenu ()\n\n// - (RCTDevMenuAlertActionHandler)alertActionHandlerForDevItem:(RCTDevMenuItem *)item;\n\n@end\n\n@interface RCTDevMenuTests : XCTestCase\n\n@end\n\n@implementation RCTDevMenuTests\n{\n  RCTBridge *_bridge;\n}\n\n- (void)setUp\n{\n  [super setUp];\n\n  NSBundle *bundle = [NSBundle bundleForClass:[self class]];\n  _bridge = [[RCTBridge alloc] initWithBundleURL:[bundle URLForResource:@\"RNTesterUnitTestsBundle\" withExtension:@\"js\"]\n                                  moduleProvider:nil\n                                   launchOptions:nil];\n\n  RCT_RUN_RUNLOOP_WHILE(_bridge.isLoading);\n}\n\n- (void)testShowCreatingActionSheet\n{\n  XCTAssertFalse([_bridge.devMenu isActionSheetShown]);\n  [_bridge.devMenu show];\n  XCTAssertTrue([_bridge.devMenu isActionSheetShown]);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTEventDispatcherTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <AppKit/AppKit.h>\n#import <XCTest/XCTest.h>\n\n#import <OCMock/OCMock.h>\n\n#import <React/RCTEventDispatcher.h>\n\n@interface RCTTestEvent : NSObject <RCTEvent>\n@property (atomic, assign, readwrite) BOOL canCoalesce;\n@end\n\n@implementation RCTTestEvent\n{\n  NSDictionary<NSString *, id> *_body;\n}\n\n@synthesize viewTag = _viewTag;\n@synthesize eventName = _eventName;\n@synthesize coalescingKey = _coalescingKey;\n\n- (instancetype)initWithViewTag:(NSNumber *)viewTag\n                      eventName:(NSString *)eventName\n                           body:(NSDictionary<NSString *, id> *)body\n                  coalescingKey:(uint16_t)coalescingKey\n{\n  if (self = [super init]) {\n    _viewTag = viewTag;\n    _eventName = eventName;\n    _body = body;\n    _canCoalesce = YES;\n    _coalescingKey = coalescingKey;\n  }\n  return self;\n}\n\n- (id<RCTEvent>)coalesceWithEvent:(id<RCTEvent>)newEvent\n{\n  return newEvent;\n}\n\n+ (NSString *)moduleDotMethod\n{\n  return @\"MyCustomEventemitter.emit\";\n}\n\n- (NSArray *)arguments\n{\n  return @[_eventName, _body];\n}\n\n@end\n\n@interface RCTDummyBridge : RCTBridge\n- (void)dispatchBlock:(dispatch_block_t)block\n                queue:(dispatch_queue_t)queue;\n@end\n\n@implementation RCTDummyBridge\n- (void)dispatchBlock:(dispatch_block_t)block\n                queue:(dispatch_queue_t)queue\n{}\n@end\n\n@interface RCTEventDispatcherTests : XCTestCase\n@end\n\n@implementation RCTEventDispatcherTests\n{\n  id _bridge;\n  RCTEventDispatcher *_eventDispatcher;\n\n  NSString *_eventName;\n  NSDictionary<NSString *, id> *_body;\n  RCTTestEvent *_testEvent;\n  NSString *_JSMethod;\n}\n\n\n- (void)setUp\n{\n  [super setUp];\n\n  _bridge = [OCMockObject mockForClass:[RCTDummyBridge class]];\n\n  _eventDispatcher = [RCTEventDispatcher new];\n  [_eventDispatcher setValue:_bridge forKey:@\"bridge\"];\n\n  _eventName = RCTNormalizeInputEventName(@\"sampleEvent\");\n  _body = @{ @\"foo\": @\"bar\" };\n  _testEvent = [[RCTTestEvent alloc] initWithViewTag:nil\n                                           eventName:_eventName\n                                                body:_body\n                                       coalescingKey:0];\n\n  _JSMethod = [[_testEvent class] moduleDotMethod];\n}\n\n- (void)testLegacyEventsAreImmediatelyDispatched\n{\n  [[_bridge expect] enqueueJSCall:@\"RCTDeviceEventEmitter\"\n                           method:@\"emit\"\n                             args:[_testEvent arguments]\n                       completion:NULL];\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n  [_eventDispatcher sendDeviceEventWithName:_eventName body:_body];\n#pragma clang diagnostic pop\n\n  [_bridge verify];\n}\n\n- (void)testNonCoalescingEventIsImmediatelyDispatched\n{\n  _testEvent.canCoalesce = NO;\n\n  [[_bridge expect] dispatchBlock:OCMOCK_ANY queue:RCTJSThread];\n\n  [_eventDispatcher sendEvent:_testEvent];\n\n  [_bridge verify];\n}\n\n- (void)testCoalescingEventIsImmediatelyDispatched\n{\n  _testEvent.canCoalesce = YES;\n\n  [[_bridge expect] dispatchBlock:OCMOCK_ANY queue:RCTJSThread];\n\n  [_eventDispatcher sendEvent:_testEvent];\n\n  [_bridge verify];\n}\n\n- (void)testMultipleEventsResultInOnlyOneDispatchAfterTheFirstOne\n{\n  [[_bridge expect] dispatchBlock:OCMOCK_ANY queue:RCTJSThread];\n  [_eventDispatcher sendEvent:_testEvent];\n  [_eventDispatcher sendEvent:_testEvent];\n  [_eventDispatcher sendEvent:_testEvent];\n  [_eventDispatcher sendEvent:_testEvent];\n  [_eventDispatcher sendEvent:_testEvent];\n  [_bridge verify];\n}\n\n- (void)testRunningTheDispatchedBlockResultInANewOneBeingEnqueued\n{\n  __block dispatch_block_t eventsEmittingBlock;\n  [[_bridge expect] dispatchBlock:[OCMArg checkWithBlock:^(dispatch_block_t block) {\n    eventsEmittingBlock = block;\n    return YES;\n  }] queue:RCTJSThread];\n  [_eventDispatcher sendEvent:_testEvent];\n  [_bridge verify];\n\n  // eventsEmittingBlock would be called when js is no longer busy, which will result in emitting events\n  [[_bridge expect] enqueueJSCall:[[_testEvent class] moduleDotMethod]\n                             args:[_testEvent arguments]];\n  eventsEmittingBlock();\n  [_bridge verify];\n\n\n  [[_bridge expect] dispatchBlock:OCMOCK_ANY queue:RCTJSThread];\n  [_eventDispatcher sendEvent:_testEvent];\n  [_bridge verify];\n}\n\n- (void)testBasicCoalescingReturnsLastEvent\n{\n  __block dispatch_block_t eventsEmittingBlock;\n  [[_bridge expect] dispatchBlock:[OCMArg checkWithBlock:^(dispatch_block_t block) {\n    eventsEmittingBlock = block;\n    return YES;\n  }] queue:RCTJSThread];\n  [[_bridge expect] enqueueJSCall:[[_testEvent class] moduleDotMethod]\n                             args:[_testEvent arguments]];\n\n  RCTTestEvent *ignoredEvent = [[RCTTestEvent alloc] initWithViewTag:nil\n                                                           eventName:_eventName\n                                                                body:@{ @\"other\": @\"body\" }\n                                                       coalescingKey:0];\n  [_eventDispatcher sendEvent:ignoredEvent];\n  [_eventDispatcher sendEvent:_testEvent];\n  eventsEmittingBlock();\n\n  [_bridge verify];\n}\n\n- (void)testDifferentEventTypesDontCoalesce\n{\n  NSString *firstEventName = RCTNormalizeInputEventName(@\"firstEvent\");\n  RCTTestEvent *firstEvent = [[RCTTestEvent alloc] initWithViewTag:nil\n                                                         eventName:firstEventName\n                                                              body:_body\n                                                     coalescingKey:0];\n\n  __block dispatch_block_t eventsEmittingBlock;\n  [[_bridge expect] dispatchBlock:[OCMArg checkWithBlock:^(dispatch_block_t block) {\n    eventsEmittingBlock = block;\n    return YES;\n  }] queue:RCTJSThread];\n  [[_bridge expect] enqueueJSCall:[[_testEvent class] moduleDotMethod]\n                             args:[firstEvent arguments]];\n  [[_bridge expect] enqueueJSCall:[[_testEvent class] moduleDotMethod]\n                             args:[_testEvent arguments]];\n\n\n  [_eventDispatcher sendEvent:firstEvent];\n  [_eventDispatcher sendEvent:_testEvent];\n  eventsEmittingBlock();\n\n  [_bridge verify];\n}\n\n- (void)testSameEventTypesWithDifferentCoalesceKeysDontCoalesce\n{\n  NSString *eventName = RCTNormalizeInputEventName(@\"firstEvent\");\n  RCTTestEvent *firstEvent = [[RCTTestEvent alloc] initWithViewTag:nil\n                                                         eventName:eventName\n                                                              body:_body\n                                                     coalescingKey:0];\n  RCTTestEvent *secondEvent = [[RCTTestEvent alloc] initWithViewTag:nil\n                                                         eventName:eventName\n                                                              body:_body\n                                                     coalescingKey:1];\n\n  __block dispatch_block_t eventsEmittingBlock;\n  [[_bridge expect] dispatchBlock:[OCMArg checkWithBlock:^(dispatch_block_t block) {\n    eventsEmittingBlock = block;\n    return YES;\n  }] queue:RCTJSThread];\n  [[_bridge expect] enqueueJSCall:[[_testEvent class] moduleDotMethod]\n                             args:[firstEvent arguments]];\n  [[_bridge expect] enqueueJSCall:[[_testEvent class] moduleDotMethod]\n                             args:[secondEvent arguments]];\n\n\n  [_eventDispatcher sendEvent:firstEvent];\n  [_eventDispatcher sendEvent:secondEvent];\n  [_eventDispatcher sendEvent:firstEvent];\n  [_eventDispatcher sendEvent:secondEvent];\n  [_eventDispatcher sendEvent:secondEvent];\n  [_eventDispatcher sendEvent:firstEvent];\n  [_eventDispatcher sendEvent:firstEvent];\n\n  eventsEmittingBlock();\n\n  [_bridge verify];\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTFontTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <CoreText/CoreText.h>\n#import <XCTest/XCTest.h>\n\n#import <React/RCTFont.h>\n\n@interface RCTFontTests : XCTestCase\n\n@end\n\n@implementation RCTFontTests\n\n// It can happen (particularly in tvOS simulator) that expected and result font objects\n// will be different objects, but the same font, so this macro now explicitly\n// checks that fontName (which includes the style) and pointSize are equal.\n#define RCTAssertEqualFonts(font1, font2) { \\\n  XCTAssertTrue([font1.fontName isEqualToString:font2.fontName]); \\\n  XCTAssertEqual(font1.pointSize,font2.pointSize); \\\n}\n\n- (void)testWeight\n{\n  {\n    NSFont *expected = [NSFont systemFontOfSize:14 weight:NSFontWeightBold];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontWeight\": @\"bold\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *expected = [NSFont systemFontOfSize:14 weight:NSFontWeightMedium];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontWeight\": @\"500\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *expected = [NSFont systemFontOfSize:14 weight:NSFontWeightUltraLight];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontWeight\": @\"100\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *expected = [NSFont systemFontOfSize:14 weight:NSFontWeightRegular];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontWeight\": @\"normal\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n}\n\n- (void)testSize\n{\n  {\n    NSFont *expected = [NSFont systemFontOfSize:18.5];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontSize\": @18.5}];\n    RCTAssertEqualFonts(expected, result);\n  }\n}\n\n- (void)testFamily\n{\n#if !TARGET_OS_TV\n  {\n    NSFont *expected = [NSFont fontWithName:@\"Cochin\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"Cochin\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n#endif\n  {\n    NSFont *expected = [NSFont fontWithName:@\"HelveticaNeue\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"Helvetica Neue\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *expected = [NSFont fontWithName:@\"HelveticaNeue-Italic\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"HelveticaNeue-Italic\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n}\n\n- (void)testStyle\n{\n  {\n    NSFont *font = [NSFont systemFontOfSize:14];\n    NSFontDescriptor *fontDescriptor = [font fontDescriptor];\n    NSFontSymbolicTraits symbolicTraits = fontDescriptor.symbolicTraits;\n    symbolicTraits |= NSFontItalicTrait;\n    fontDescriptor = [fontDescriptor fontDescriptorWithSymbolicTraits:symbolicTraits];\n    NSFont *expected = [NSFont fontWithDescriptor:fontDescriptor size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontStyle\": @\"italic\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *expected = [NSFont systemFontOfSize:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontStyle\": @\"normal\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n}\n\n- (void)testStyleAndWeight\n{\n  {\n    NSFont *font = [NSFont systemFontOfSize:14 weight:NSFontWeightUltraLight];\n    NSFontDescriptor *fontDescriptor = [font fontDescriptor];\n    NSFontSymbolicTraits symbolicTraits = fontDescriptor.symbolicTraits;\n    symbolicTraits |= NSFontItalicTrait;\n    fontDescriptor = [fontDescriptor fontDescriptorWithSymbolicTraits:symbolicTraits];\n    NSFont *expected = [NSFont fontWithDescriptor:fontDescriptor size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontStyle\": @\"italic\", @\"fontWeight\": @\"100\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *font = [NSFont systemFontOfSize:14 weight:NSFontWeightBold];\n    NSFontDescriptor *fontDescriptor = [font fontDescriptor];\n    NSFontSymbolicTraits symbolicTraits = fontDescriptor.symbolicTraits;\n    symbolicTraits |= NSFontItalicTrait;\n    fontDescriptor = [fontDescriptor fontDescriptorWithSymbolicTraits:symbolicTraits];\n    NSFont *expected = [NSFont fontWithDescriptor:fontDescriptor size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontStyle\": @\"italic\", @\"fontWeight\": @\"bold\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n}\n\n- (void)testFamilyAndWeight\n{\n  {\n    NSFont *expected = [NSFont fontWithName:@\"HelveticaNeue-Bold\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"Helvetica Neue\", @\"fontWeight\": @\"bold\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *expected = [NSFont fontWithName:@\"HelveticaNeue\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"HelveticaNeue-Bold\", @\"fontWeight\": @\"normal\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n#if !TARGET_OS_TV\n  {\n    NSFont *expected = [NSFont fontWithName:@\"Cochin-Bold\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"Cochin\", @\"fontWeight\": @\"700\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *expected = [NSFont fontWithName:@\"Cochin\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"Cochin\", @\"fontWeight\": @\"100\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n#endif\n}\n\n- (void)testFamilyAndStyle\n{\n  {\n    NSFont *expected = [NSFont fontWithName:@\"HelveticaNeue-Italic\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"Helvetica Neue\", @\"fontStyle\": @\"italic\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *expected = [NSFont fontWithName:@\"HelveticaNeue\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"HelveticaNeue-Italic\", @\"fontStyle\": @\"normal\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n}\n\n- (void)testFamilyStyleAndWeight\n{\n  {\n    NSFont *expected = [NSFont fontWithName:@\"HelveticaNeue-LightItalic\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"Helvetica Neue\", @\"fontStyle\": @\"italic\", @\"fontWeight\": @\"300\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *expected = [NSFont fontWithName:@\"HelveticaNeue-Bold\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"HelveticaNeue-Italic\", @\"fontStyle\": @\"normal\", @\"fontWeight\": @\"bold\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *expected = [NSFont fontWithName:@\"HelveticaNeue\" size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"HelveticaNeue-Italic\", @\"fontStyle\": @\"normal\", @\"fontWeight\": @\"normal\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n}\n\n- (void)testVariant\n{\n  {\n    NSFont *expected = [NSFont monospacedDigitSystemFontOfSize:14 weight:NSFontWeightRegular];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontVariant\": @[@\"tabular-nums\"]}];\n    // RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *monospaceFont = [NSFont monospacedDigitSystemFontOfSize:14 weight:NSFontWeightRegular];\n    NSFontDescriptor *fontDescriptor = [monospaceFont.fontDescriptor fontDescriptorByAddingAttributes:@{\n      NSFontFeatureSettingsAttribute: @[@{\n        NSFontFeatureTypeIdentifierKey: @(kLowerCaseType),\n        NSFontFeatureSelectorIdentifierKey: @(kLowerCaseSmallCapsSelector),\n      }]\n    }];\n    NSFont *expected = [NSFont fontWithDescriptor:fontDescriptor size:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontVariant\": @[@\"tabular-nums\", @\"small-caps\"]}];\n    // RCTAssertEqualFonts(expected, result);\n  }\n}\n\n- (void)testInvalidFont\n{\n  {\n    NSFont *expected = [NSFont systemFontOfSize:14];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"foobar\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n  {\n    NSFont *expected = [NSFont systemFontOfSize:14 weight:NSFontWeightBold];\n    NSFont *result = [RCTConvert NSFont:@{@\"fontFamily\": @\"foobar\", @\"fontWeight\": @\"bold\"}];\n    RCTAssertEqualFonts(expected, result);\n  }\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTGzipTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <RCTTest/RCTTestRunner.h>\n#import <React/RCTNetworking.h>\n#import <React/RCTUtils.h>\n\nextern BOOL RCTIsGzippedData(NSData *data);\n\n@interface RCTNetworking (Private)\n\n- (void)buildRequest:(NSDictionary<NSString *, id> *)query\n     completionBlock:(void (^)(NSURLRequest *request))block;\n\n@end\n\n@interface RCTGzipTests : XCTestCase\n\n@end\n\n@implementation RCTGzipTests\n\n- (void)testGzip\n{\n  //set up data\n  NSString *inputString = @\"Hello World!\";\n  NSData *inputData = [inputString dataUsingEncoding:NSUTF8StringEncoding];\n\n  //compress\n  NSData *outputData = RCTGzipData(inputData, -1);\n  XCTAssertTrue(RCTIsGzippedData(outputData));\n}\n\n- (void)testDontRezipZippedData\n{\n  //set up data\n  NSString *inputString = @\"Hello World!\";\n  NSData *inputData = [inputString dataUsingEncoding:NSUTF8StringEncoding];\n\n  //compress\n  NSData *compressedData = RCTGzipData(inputData, -1);\n  inputString = [[NSString alloc] initWithData:compressedData encoding:NSUTF8StringEncoding];\n\n  //compress again\n  NSData *outputData = RCTGzipData(inputData, -1);\n  NSString *outputString = [[NSString alloc] initWithData:outputData encoding:NSUTF8StringEncoding];\n  XCTAssertEqualObjects(outputString, inputString);\n}\n\n- (void)testRequestBodyEncoding\n{\n  NSDictionary *query = @{\n    @\"url\": @\"http://example.com\",\n    @\"method\": @\"POST\",\n    @\"data\": @{@\"string\": @\"Hello World\"},\n    @\"headers\": @{@\"Content-Encoding\": @\"gzip\"},\n  };\n\n  RCTNetworking *networker = [RCTNetworking new];\n  [networker setValue:dispatch_get_main_queue() forKey:@\"methodQueue\"];\n  __block NSURLRequest *request = nil;\n  [networker buildRequest:query completionBlock:^(NSURLRequest *_request) {\n    request = _request;\n  }];\n\n  RCT_RUN_RUNLOOP_WHILE(request == nil);\n\n  XCTAssertNotNil(request);\n  XCTAssertNotNil(request.HTTPBody);\n  XCTAssertTrue(RCTIsGzippedData(request.HTTPBody));\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTImageLoaderHelpers.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <React/RCTImageLoader.h>\n\ntypedef BOOL (^RCTImageURLLoaderCanLoadImageURLHandler)(NSURL *requestURL);\ntypedef RCTImageLoaderCancellationBlock (^RCTImageURLLoaderLoadImageURLHandler)(NSURL *imageURL, CGSize size, CGFloat scale, RCTResizeMode resizeMode, RCTImageLoaderProgressBlock progressHandler, RCTImageLoaderCompletionBlock completionHandler);\n\n@interface RCTConcreteImageURLLoader : NSObject <RCTImageURLLoader>\n\n- (instancetype)initWithPriority:(float)priority\n          canLoadImageURLHandler:(RCTImageURLLoaderCanLoadImageURLHandler)canLoadImageURLHandler\n             loadImageURLHandler:(RCTImageURLLoaderLoadImageURLHandler)loadImageURLHandler;\n\n@end\n\ntypedef BOOL (^RCTImageDataDecoderCanDecodeImageDataHandler)(NSData *imageData);\ntypedef RCTImageLoaderCancellationBlock (^RCTImageDataDecoderDecodeImageDataHandler)(NSData *imageData, CGSize size, CGFloat scale, RCTResizeMode resizeMode, RCTImageLoaderCompletionBlock completionHandler);\n\n@interface RCTConcreteImageDecoder : NSObject <RCTImageDataDecoder>\n\n- (instancetype)initWithPriority:(float)priority\n       canDecodeImageDataHandler:(RCTImageDataDecoderCanDecodeImageDataHandler)canDecodeImageDataHandler\n          decodeImageDataHandler:(RCTImageDataDecoderDecodeImageDataHandler)decodeImageDataHandler;\n\n@end\n\n#define _RCTDefineImageHandler(SUPERCLASS, CLASS_NAME) \\\n@interface CLASS_NAME : SUPERCLASS @end \\\n@implementation CLASS_NAME RCT_EXPORT_MODULE() @end\n\n#define RCTDefineImageURLLoader(CLASS_NAME) \\\n_RCTDefineImageHandler(RCTConcreteImageURLLoader, CLASS_NAME)\n\n#define RCTDefineImageDecoder(CLASS_NAME) \\\n_RCTDefineImageHandler(RCTConcreteImageDecoder, CLASS_NAME)\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTImageLoaderHelpers.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import \"RCTImageLoaderHelpers.h\"\n\n@implementation RCTConcreteImageURLLoader\n{\n  RCTImageURLLoaderCanLoadImageURLHandler _canLoadImageURLHandler;\n  RCTImageURLLoaderLoadImageURLHandler _loadImageURLHandler;\n  float _priority;\n}\n\n+ (NSString *)moduleName\n{\n  return nil;\n}\n\n- (instancetype)init\n{\n  return nil;\n}\n\n- (instancetype)initWithPriority:(float)priority canLoadImageURLHandler:(RCTImageURLLoaderCanLoadImageURLHandler)canLoadImageURLHandler loadImageURLHandler:(RCTImageURLLoaderLoadImageURLHandler)loadImageURLHandler\n{\n  if ((self = [super init])) {\n    _canLoadImageURLHandler = [canLoadImageURLHandler copy];\n    _loadImageURLHandler = [loadImageURLHandler copy];\n    _priority = priority;\n  }\n\n  return self;\n}\n\n- (BOOL)canLoadImageURL:(NSURL *)requestURL\n{\n  return _canLoadImageURLHandler(requestURL);\n}\n\n- (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL\n                                              size:(CGSize)size\n                                             scale:(CGFloat)scale\n                                        resizeMode:(RCTResizeMode)resizeMode\n                                   progressHandler:(RCTImageLoaderProgressBlock)progressHandler\n                                partialLoadHandler:(__unused RCTImageLoaderPartialLoadBlock)partialLoadHandler\n                                 completionHandler:(RCTImageLoaderCompletionBlock)completionHandler\n{\n  return _loadImageURLHandler(imageURL, size, scale, resizeMode, progressHandler, completionHandler);\n}\n\n- (float)loaderPriority\n{\n  return _priority;\n}\n\n@end\n\n@implementation RCTConcreteImageDecoder\n{\n  RCTImageDataDecoderCanDecodeImageDataHandler _canDecodeImageDataHandler;\n  RCTImageDataDecoderDecodeImageDataHandler _decodeImageDataHandler;\n  float _priority;\n}\n\n+ (NSString *)moduleName\n{\n  return nil;\n}\n\n- (instancetype)init\n{\n  return nil;\n}\n\n- (instancetype)initWithPriority:(float)priority canDecodeImageDataHandler:(RCTImageDataDecoderCanDecodeImageDataHandler)canDecodeImageDataHandler decodeImageDataHandler:(RCTImageDataDecoderDecodeImageDataHandler)decodeImageDataHandler\n{\n  if ((self = [super init])) {\n    _canDecodeImageDataHandler = [canDecodeImageDataHandler copy];\n    _decodeImageDataHandler = [decodeImageDataHandler copy];\n    _priority = priority;\n  }\n\n  return self;\n}\n\n- (BOOL)canDecodeImageData:(NSData *)imageData\n{\n  return _canDecodeImageDataHandler(imageData);\n}\n\n- (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData size:(CGSize)size scale:(CGFloat)scale resizeMode:(RCTResizeMode)resizeMode completionHandler:(RCTImageLoaderCompletionBlock)completionHandler\n{\n  return _decodeImageDataHandler(imageData, size, scale, resizeMode, completionHandler);\n}\n\n- (float)decoderPriority\n{\n  return _priority;\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTImageLoaderTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <React/RCTBridge.h>\n#import <React/RCTImageLoader.h>\n\n#import \"RCTImageLoaderHelpers.h\"\n\nunsigned char blackGIF[] = {\n  0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x01, 0x00, 0x01, 0x00, 0x80, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00,\n  0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x44, 0x01, 0x00, 0x3b\n};\n\nRCTDefineImageURLLoader(RCTImageLoaderTestsURLLoader1)\nRCTDefineImageURLLoader(RCTImageLoaderTestsURLLoader2)\nRCTDefineImageDecoder(RCTImageLoaderTestsDecoder1)\nRCTDefineImageDecoder(RCTImageLoaderTestsDecoder2)\n\n@interface RCTImageLoaderTests : XCTestCase\n\n@end\n\n@implementation RCTImageLoaderTests {\n  NSURL *_bundleURL;\n}\n\n- (void)setUp\n{\n  NSBundle *bundle = [NSBundle bundleForClass:[self class]];\n  _bundleURL = [bundle URLForResource:@\"RNTesterUnitTestsBundle\" withExtension:@\"js\"];\n}\n\n- (void)testImageLoading\n{\n  NSImage *image = [NSImage new];\n\n  id<RCTImageURLLoader> loader = [[RCTImageLoaderTestsURLLoader1 alloc] initWithPriority:1.0 canLoadImageURLHandler:^BOOL(__unused NSURL *requestURL) {\n    return YES;\n  } loadImageURLHandler:^RCTImageLoaderCancellationBlock(__unused NSURL *imageURL, __unused CGSize size, __unused CGFloat scale, __unused RCTResizeMode resizeMode, RCTImageLoaderProgressBlock progressHandler, RCTImageLoaderCompletionBlock completionHandler) {\n    progressHandler(1, 1);\n    completionHandler(nil, image);\n    return nil;\n  }];\n\n  NS_VALID_UNTIL_END_OF_SCOPE RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:_bundleURL moduleProvider:^{ return @[loader]; } launchOptions:nil];\n\n  NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@\"https://facebook.github.io/react-native/img/opengraph.png\"]];\n  [bridge.imageLoader loadImageWithURLRequest:urlRequest size:CGSizeMake(100, 100) scale:1.0 clipped:YES resizeMode:RCTResizeModeContain progressBlock:^(int64_t progress, int64_t total) {\n    XCTAssertEqual(progress, 1);\n    XCTAssertEqual(total, 1);\n  } partialLoadBlock:nil completionBlock:^(NSError *loadError, id loadedImage) {\n    XCTAssertEqualObjects(loadedImage, image);\n    XCTAssertNil(loadError);\n  }];\n}\n\n- (void)testImageLoaderUsesImageURLLoaderWithHighestPriority\n{\n  NSImage *image = [NSImage new];\n\n  id<RCTImageURLLoader> loader1 = [[RCTImageLoaderTestsURLLoader1 alloc] initWithPriority:1.0 canLoadImageURLHandler:^BOOL(__unused NSURL *requestURL) {\n    return YES;\n  } loadImageURLHandler:^RCTImageLoaderCancellationBlock(__unused NSURL *imageURL, __unused CGSize size, __unused CGFloat scale, __unused RCTResizeMode resizeMode, RCTImageLoaderProgressBlock progressHandler, RCTImageLoaderCompletionBlock completionHandler) {\n    progressHandler(1, 1);\n    completionHandler(nil, image);\n    return nil;\n  }];\n\n  id<RCTImageURLLoader> loader2 = [[RCTImageLoaderTestsURLLoader2 alloc] initWithPriority:0.5 canLoadImageURLHandler:^BOOL(__unused NSURL *requestURL) {\n    return YES;\n  } loadImageURLHandler:^RCTImageLoaderCancellationBlock(__unused NSURL *imageURL, __unused CGSize size, __unused CGFloat scale, __unused RCTResizeMode resizeMode, __unused RCTImageLoaderProgressBlock progressHandler, __unused RCTImageLoaderCompletionBlock completionHandler) {\n    XCTFail(@\"Should not have used loader2\");\n    return nil;\n  }];\n\n  NS_VALID_UNTIL_END_OF_SCOPE RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:_bundleURL moduleProvider:^{ return @[loader1, loader2]; } launchOptions:nil];\n\n  NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@\"https://facebook.github.io/react-native/img/opengraph.png\"]];\n  [bridge.imageLoader loadImageWithURLRequest:urlRequest size:CGSizeMake(100, 100) scale:1.0 clipped:YES resizeMode:RCTResizeModeContain progressBlock:^(int64_t progress, int64_t total) {\n    XCTAssertEqual(progress, 1);\n    XCTAssertEqual(total, 1);\n  } partialLoadBlock:nil completionBlock:^(NSError *loadError, id loadedImage) {\n    XCTAssertEqualObjects(loadedImage, image);\n    XCTAssertNil(loadError);\n  }];\n}\n\n- (void)testImageDecoding\n{\n  NSData *data = [NSData dataWithBytesNoCopy:blackGIF length:sizeof(blackGIF) freeWhenDone:NO];\n  NSImage *image = [[NSImage alloc] initWithData:data];\n\n  id<RCTImageDataDecoder> decoder = [[RCTImageLoaderTestsDecoder1 alloc] initWithPriority:1.0 canDecodeImageDataHandler:^BOOL(__unused NSData *imageData) {\n    return YES;\n  } decodeImageDataHandler:^RCTImageLoaderCancellationBlock(NSData *imageData, __unused CGSize size, __unused CGFloat scale, __unused RCTResizeMode resizeMode, RCTImageLoaderCompletionBlock completionHandler) {\n    XCTAssertEqualObjects(imageData, data);\n    completionHandler(nil, image);\n    return nil;\n  }];\n\n  NS_VALID_UNTIL_END_OF_SCOPE RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:_bundleURL moduleProvider:^{ return @[decoder]; } launchOptions:nil];\n\n  RCTImageLoaderCancellationBlock cancelBlock = [bridge.imageLoader decodeImageData:data size:CGSizeMake(1, 1) scale:1.0 clipped:NO resizeMode:RCTResizeModeStretch completionBlock:^(NSError *decodeError, id decodedImage) {\n    XCTAssertEqualObjects(decodedImage, image);\n    XCTAssertNil(decodeError);\n  }];\n  XCTAssertNotNil(cancelBlock);\n}\n\n- (void)testImageLoaderUsesImageDecoderWithHighestPriority\n{\n  NSData *data = [NSData dataWithBytesNoCopy:blackGIF length:sizeof(blackGIF) freeWhenDone:NO];\n  NSImage *image = [[NSImage alloc] initWithData:data];\n\n  id<RCTImageDataDecoder> decoder1 = [[RCTImageLoaderTestsDecoder1 alloc] initWithPriority:1.0 canDecodeImageDataHandler:^BOOL(__unused NSData *imageData) {\n    return YES;\n  } decodeImageDataHandler:^RCTImageLoaderCancellationBlock(NSData *imageData, __unused CGSize size, __unused CGFloat scale, __unused RCTResizeMode resizeMode, RCTImageLoaderCompletionBlock completionHandler) {\n    XCTAssertEqualObjects(imageData, data);\n    completionHandler(nil, image);\n    return nil;\n  }];\n\n  id<RCTImageDataDecoder> decoder2 = [[RCTImageLoaderTestsDecoder2 alloc] initWithPriority:0.5 canDecodeImageDataHandler:^BOOL(__unused NSData *imageData) {\n    return YES;\n  } decodeImageDataHandler:^RCTImageLoaderCancellationBlock(__unused NSData *imageData, __unused CGSize size, __unused CGFloat scale, __unused RCTResizeMode resizeMode, __unused RCTImageLoaderCompletionBlock completionHandler) {\n    XCTFail(@\"Should not have used decoder2\");\n    return nil;\n  }];\n\n  NS_VALID_UNTIL_END_OF_SCOPE RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:_bundleURL moduleProvider:^{ return @[decoder1, decoder2]; } launchOptions:nil];\n\n  RCTImageLoaderCancellationBlock cancelBlock = [bridge.imageLoader decodeImageData:data size:CGSizeMake(1, 1) scale:1.0 clipped:NO resizeMode:RCTResizeModeStretch completionBlock:^(NSError *decodeError, id decodedImage) {\n    XCTAssertEqualObjects(decodedImage, image);\n    XCTAssertNil(decodeError);\n  }];\n  XCTAssertNotNil(cancelBlock);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTImageUtilTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <CoreGraphics/CoreGraphics.h>\n#import <Foundation/Foundation.h>\n#import <APpKit/NSView.h>\n#import <XCTest/XCTest.h>\n\n#import <RCTImage/RCTImageUtils.h>\n\n#define RCTAssertEqualPoints(a, b) { \\\nXCTAssertEqual(a.x, b.x); \\\nXCTAssertEqual(a.y, b.y); \\\n}\n\n#define RCTAssertEqualSizes(a, b) { \\\nXCTAssertEqual(a.width, b.width); \\\nXCTAssertEqual(a.height, b.height); \\\n}\n\n#define RCTAssertEqualRects(a, b) { \\\nRCTAssertEqualPoints(a.origin, b.origin); \\\nRCTAssertEqualSizes(a.size, b.size); \\\n}\n\n@interface RCTImageUtilTests : XCTestCase\n\n@end\n\n@implementation RCTImageUtilTests\n\n- (void)testLandscapeSourceLandscapeTarget\n{\n  CGSize content = {1000, 100};\n  CGSize target = {100, 20};\n\n  {\n    CGRect expected = {CGPointZero, {100, 20}};\n    CGRect result = RCTTargetRect(content, target, 1, RCTResizeModeStretch);\n    RCTAssertEqualRects(expected, result);\n  }\n\n  {\n    CGRect expected = {{0, 5}, {100, 10}};\n    CGRect result = RCTTargetRect(content, target, 1, RCTResizeModeContain);\n    RCTAssertEqualRects(expected, result);\n  }\n\n  {\n    CGRect expected = {{-50, 0}, {200, 20}};\n    CGRect result = RCTTargetRect(content, target, 1, RCTResizeModeCover);\n    RCTAssertEqualRects(expected, result);\n  }\n}\n\n- (void)testPortraitSourceLandscapeTarget\n{\n  CGSize content = {10, 100};\n  CGSize target = {100, 20};\n\n  {\n    CGRect expected = {CGPointZero, {100, 20}};\n    CGRect result = RCTTargetRect(content, target, 1, RCTResizeModeStretch);\n    RCTAssertEqualRects(expected, result);\n  }\n\n  {\n    CGRect expected = {{49, 0}, {2, 20}};\n    CGRect result = RCTTargetRect(content, target, 1, RCTResizeModeContain);\n    RCTAssertEqualRects(expected, result);\n  }\n\n  {\n    CGRect expected = {{0, -490}, {100, 1000}};\n    CGRect result = RCTTargetRect(content, target, 1, RCTResizeModeCover);\n    RCTAssertEqualRects(expected, result);\n  }\n}\n\n- (void)testPortraitSourcePortraitTarget\n{\n  CGSize content = {10, 100};\n  CGSize target = {20, 50};\n\n  {\n    CGRect expected = {CGPointZero, {20, 50}};\n    CGRect result = RCTTargetRect(content, target, 1, RCTResizeModeStretch);\n    RCTAssertEqualRects(expected, result);\n  }\n\n  {\n    CGRect expected = {{7,0}, {5, 50}};\n    CGRect result = RCTTargetRect(content, target, 1, RCTResizeModeContain);\n    RCTAssertEqualRects(expected, result);\n  }\n\n  {\n    CGRect expected = {{0, -75}, {20, 200}};\n    CGRect result = RCTTargetRect(content, target, 2, RCTResizeModeCover);\n    RCTAssertEqualRects(expected, result);\n  }\n}\n\n- (void)testRounding\n{\n  CGSize content = {10, 100};\n  CGSize target = {20, 50};\n\n  {\n    CGRect expected = {{0, -75}, {20, 200}};\n    CGRect result = RCTTargetRect(content, target, 1, RCTResizeModeCover);\n    RCTAssertEqualRects(expected, result);\n  }\n}\n\n- (void)testScaling\n{\n  CGSize content = {2, 2};\n  CGSize target = {3, 3};\n\n  CGRect expected = {CGPointZero, {3, 3}};\n  CGRect result = RCTTargetRect(content, target, 1, RCTResizeModeStretch);\n  RCTAssertEqualRects(expected, result);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTJSCExecutorTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <mach/mach_time.h>\n\n#import <XCTest/XCTest.h>\n\n#import <React/RCTJSCExecutor.h>\n\n@interface RCTJSCExecutorTests : XCTestCase\n\n@end\n\n@implementation RCTJSCExecutorTests\n{\n  RCTJSCExecutor *_executor;\n}\n\n- (void)setUp\n{\n  [super setUp];\n  _executor = [RCTJSCExecutor new];\n  [_executor setUp];\n}\n\n- (void)testNativeLoggingHookExceptionBehavior\n{\n  dispatch_semaphore_t doneSem = dispatch_semaphore_create(0);\n  [_executor executeApplicationScript:[@\"var x = {toString: function() { throw 1; }}; nativeLoggingHook(x);\" dataUsingEncoding:NSUTF8StringEncoding]\n                           sourceURL:[NSURL URLWithString:@\"file://\"]\n                          onComplete:^(__unused id error){\n                            dispatch_semaphore_signal(doneSem);\n                          }];\n  dispatch_semaphore_wait(doneSem, DISPATCH_TIME_FOREVER);\n  [_executor invalidate];\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTJSONTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <React/RCTUtils.h>\n\n@interface RCTJSONTests : XCTestCase\n\n@end\n\n@implementation RCTJSONTests\n\n- (void)testEncodingObject\n{\n  NSDictionary<NSString *, id> *obj = @{@\"foo\": @\"bar\"};\n  NSString *json = @\"{\\\"foo\\\":\\\"bar\\\"}\";\n  XCTAssertEqualObjects(json, RCTJSONStringify(obj, NULL));\n}\n\n- (void)testEncodingArray\n{\n  NSArray<id> *array = @[@\"foo\", @\"bar\"];\n  NSString *json = @\"[\\\"foo\\\",\\\"bar\\\"]\";\n  XCTAssertEqualObjects(json, RCTJSONStringify(array, NULL));\n}\n\n- (void)testEncodingString\n{\n  NSString *text = @\"Hello\\nWorld\";\n  NSString *json = @\"\\\"Hello\\\\nWorld\\\"\";\n  XCTAssertEqualObjects(json, RCTJSONStringify(text, NULL));\n}\n\n- (void)testEncodingNSError\n{\n  NSError *underlyingError = [NSError errorWithDomain:@\"underlyingDomain\" code:421 userInfo:nil];\n  NSError *err = [NSError errorWithDomain:@\"domain\" code:68 userInfo:@{@\"NSUnderlyingError\": underlyingError}];\n\n  // An assertion on the full object would be too brittle since it contains an iOS stack trace\n  // so we are relying on the behavior of RCTJSONParse, which is tested below.\n  NSDictionary<NSString *, id> *jsonObject = RCTJSErrorFromNSError(err);\n  NSString *jsonString = RCTJSONStringify(jsonObject, NULL);\n  NSDictionary<NSString *, id> *json = RCTJSONParse(jsonString, NULL);\n  XCTAssertEqualObjects(json[@\"code\"], @\"EDOMAIN68\");\n  XCTAssertEqualObjects(json[@\"message\"], @\"The operation couldn\\u2019t be completed. (domain error 68.)\");\n  XCTAssertEqualObjects(json[@\"domain\"], @\"domain\");\n  XCTAssertEqualObjects(json[@\"userInfo\"][@\"NSUnderlyingError\"][@\"code\"], @\"421\");\n  XCTAssertEqualObjects(json[@\"userInfo\"][@\"NSUnderlyingError\"][@\"message\"], @\"underlying error\");\n  XCTAssertEqualObjects(json[@\"userInfo\"][@\"NSUnderlyingError\"][@\"domain\"], @\"underlyingDomain\");\n}\n\n\n- (void)testDecodingObject\n{\n  NSDictionary<NSString *, id> *obj = @{@\"foo\": @\"bar\"};\n  NSString *json = @\"{\\\"foo\\\":\\\"bar\\\"}\";\n  XCTAssertEqualObjects(obj, RCTJSONParse(json, NULL));\n}\n\n- (void)testDecodingArray\n{\n  NSArray<id> *array = @[@\"foo\", @\"bar\"];\n  NSString *json = @\"[\\\"foo\\\",\\\"bar\\\"]\";\n  XCTAssertEqualObjects(array, RCTJSONParse(json, NULL));\n}\n\n- (void)testDecodingString\n{\n  NSString *text = @\"Hello\\nWorld\";\n  NSString *json = @\"\\\"Hello\\\\nWorld\\\"\";\n  XCTAssertEqualObjects(text, RCTJSONParse(json, NULL));\n}\n\n- (void)testDecodingMutableArray\n{\n  NSString *json = @\"[1,2,3]\";\n  NSMutableArray<id> *array = RCTJSONParseMutable(json, NULL);\n  XCTAssertNoThrow([array addObject:@4]);\n  XCTAssertEqualObjects(array, (@[@1, @2, @3, @4]));\n}\n\n- (void)testLeadingWhitespace\n{\n  NSDictionary<NSString *, id> *obj = @{@\"foo\": @\"bar\"};\n  NSString *json = @\" \\r\\n\\t{\\\"foo\\\":\\\"bar\\\"}\";\n  XCTAssertEqualObjects(obj, RCTJSONParse(json, NULL));\n}\n\n- (void)testNotJSONSerializable\n{\n  NSDictionary<NSString *, id> *obj = @{@\"foo\": [NSDate date]};\n  NSString *json = @\"{\\\"foo\\\":null}\";\n  XCTAssertEqualObjects(json, RCTJSONStringify(obj, NULL));\n}\n\n- (void)testNaN\n{\n  NSDictionary<NSString *, id> *obj = @{@\"foo\": @(NAN)};\n  NSString *json = @\"{\\\"foo\\\":0}\";\n  XCTAssertEqualObjects(json, RCTJSONStringify(obj, NULL));\n}\n\n- (void)testNotUTF8Convertible\n{\n  //see https://gist.github.com/0xced/56035d2f57254cf518b5\n  NSString *string = [[NSString alloc] initWithBytes:\"\\xd8\\x00\" length:2 encoding:NSUTF16StringEncoding];\n  NSDictionary<NSString *, id> *obj = @{@\"foo\": string};\n  NSString *json = @\"{\\\"foo\\\":null}\";\n  XCTAssertEqualObjects(json, RCTJSONStringify(obj, NULL));\n}\n\n- (void)testErrorPointer\n{\n  NSDictionary<NSString *, id> *obj = @{@\"foo\": [NSDate date]};\n  NSError *error;\n  XCTAssertNil(RCTJSONStringify(obj, &error));\n  XCTAssertNotNil(error);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTMethodArgumentTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <AppKit/AppKit.h>\n#import <XCTest/XCTest.h>\n\n#import <React/RCTModuleMethod.h>\n\n@interface RCTMethodArgumentTests : XCTestCase\n\n@end\n\n@implementation RCTMethodArgumentTests\n\nextern NSString *RCTParseMethodSignature(const char *methodSignature, NSArray **argTypes);\n\n- (void)testOneArgument\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(NSInteger)foo\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)1);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSInteger\");\n}\n\n- (void)testTwoArguments\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(NSInteger)foo bar:(BOOL)bar\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:bar:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)2);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSInteger\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[1]).type, @\"BOOL\");\n}\n\n- (void)testSpaces\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo : (NSInteger)foo bar : (BOOL) bar\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:bar:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)2);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSInteger\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[1]).type, @\"BOOL\");\n}\n\n- (void)testNewlines\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo : (NSInteger)foo\\nbar : (BOOL) bar\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:bar:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)2);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSInteger\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[1]).type, @\"BOOL\");\n}\n\n- (void)testUnnamedArgs\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(NSInteger)foo:(BOOL)bar\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo::\");\n  XCTAssertEqual(arguments.count, (NSUInteger)2);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSInteger\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[1]).type, @\"BOOL\");\n}\n\n- (void)testUntypedUnnamedArgs\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:foo:bar:bar\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:::\");\n  XCTAssertEqual(arguments.count, (NSUInteger)3);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"id\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[1]).type, @\"id\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[2]).type, @\"id\");\n}\n\n- (void)testNamespacedCxxStruct\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(foo::type &)foo bar:(bar::type &)bar\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:bar:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)2);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"foo::type\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[1]).type, @\"bar::type\");\n}\n\n- (void)testAttributes\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(__attribute__((unused)) NSString *)foo bar:(__unused BOOL)bar\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:bar:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)2);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSString\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[1]).type, @\"BOOL\");\n}\n\n- (void)testNullability\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(nullable NSString *)foo bar:(nonnull NSNumber *)bar baz:(id)baz\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:bar:baz:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)3);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSString\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[1]).type, @\"NSNumber\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[2]).type, @\"id\");\n  XCTAssertEqual(((RCTMethodArgument *)arguments[0]).nullability, RCTNullable);\n  XCTAssertEqual(((RCTMethodArgument *)arguments[1]).nullability, RCTNonnullable);\n  XCTAssertEqual(((RCTMethodArgument *)arguments[2]).nullability, RCTNullabilityUnspecified);\n}\n\n- (void)testSemicolonStripping\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(NSString *)foo bar:(BOOL)bar;\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:bar:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)2);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSString\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[1]).type, @\"BOOL\");\n}\n\n- (void)testUnused\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(__unused NSString *)foo bar:(NSNumber *)bar\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:bar:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)2);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSString\");\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[1]).type, @\"NSNumber\");\n  XCTAssertTrue(((RCTMethodArgument *)arguments[0]).unused);\n  XCTAssertFalse(((RCTMethodArgument *)arguments[1]).unused);\n}\n\n- (void)testGenericArray\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(NSArray<NSString *> *)foo;\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)1);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSStringArray\");\n}\n\n- (void)testNestedGenericArray\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(NSArray<NSArray<NSString *> *> *)foo;\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)1);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSStringArrayArray\");\n}\n\n- (void)testGenericSet\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(NSSet<NSNumber *> *)foo;\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)1);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSNumberSet\");\n}\n\n- (void)testGenericDictionary\n{\n  NSArray *arguments;\n  const char *methodSignature = \"foo:(NSDictionary<NSString *, NSNumber *> *)foo;\";\n  NSString *selector = RCTParseMethodSignature(methodSignature, &arguments);\n  XCTAssertEqualObjects(selector, @\"foo:\");\n  XCTAssertEqual(arguments.count, (NSUInteger)1);\n  XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @\"NSNumberDictionary\");\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTModuleInitNotificationRaceTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <Foundation/Foundation.h>\n#import <XCTest/XCTest.h>\n\n#import <RCTTest/RCTTestRunner.h>\n#import <React/RCTBridge.h>\n#import <React/RCTBridgeModule.h>\n#import <React/RCTJavaScriptExecutor.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTViewManager.h>\n\n@interface RCTTestViewManager : RCTViewManager\n@end\n\n@implementation RCTTestViewManager\n\nRCT_EXPORT_MODULE()\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-implementations\"\n\n- (NSArray<NSString *> *)customBubblingEventTypes\n{\n  return @[@\"foo\"];\n}\n\n#pragma clang diagnostic pop\n\n@end\n\n\n@interface RCTNotificationObserverModule : NSObject <RCTBridgeModule>\n\n@property (nonatomic, assign) BOOL didDetectViewManagerInit;\n\n@end\n\n@implementation RCTNotificationObserverModule\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  _bridge = bridge;\n  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didInitViewManager:) name:RCTDidInitializeModuleNotification object:nil];\n}\n\n- (void)didInitViewManager:(NSNotification *)note\n{\n  id<RCTBridgeModule> module = note.userInfo[@\"module\"];\n  if ([module isKindOfClass:[RCTTestViewManager class]]) {\n    _didDetectViewManagerInit = YES;\n  }\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n@end\n\n@interface RCTModuleInitNotificationRaceTests : XCTestCase <RCTBridgeDelegate>\n{\n  RCTBridge *_bridge;\n  RCTNotificationObserverModule *_notificationObserver;\n}\n@end\n\n@implementation RCTModuleInitNotificationRaceTests\n\n- (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge\n{\n  NSBundle *bundle = [NSBundle bundleForClass:[self class]];\n  return [bundle URLForResource:@\"RNTesterUnitTestsBundle\" withExtension:@\"js\"];\n}\n\n- (NSArray *)extraModulesForBridge:(__unused RCTBridge *)bridge\n{\n  return @[[RCTTestViewManager new], _notificationObserver];\n}\n\n- (void)setUp\n{\n  [super setUp];\n\n  _notificationObserver = [RCTNotificationObserverModule new];\n  _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil];\n\n  dispatch_async(dispatch_get_main_queue(), ^{\n    [[self->_bridge uiManager] constantsToExport];\n  });\n}\n\n- (void)tearDown\n{\n  [super tearDown];\n\n  _notificationObserver = nil;\n  [_bridge invalidate];\n  _bridge = nil;\n}\n\n- (void)testViewManagerNotInitializedBeforeSetBridgeModule\n{\n  RCT_RUN_RUNLOOP_WHILE(!_notificationObserver.didDetectViewManagerInit);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTModuleInitTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <Foundation/Foundation.h>\n#import <XCTest/XCTest.h>\n\n#import <RCTTest/RCTTestRunner.h>\n#import <React/RCTBridge+Private.h>\n#import <React/RCTBridge.h>\n#import <React/RCTBridgeModule.h>\n#import <React/RCTJavaScriptExecutor.h>\n#import <React/RCTUtils.h>\n\n@interface RCTTestInjectedModule : NSObject <RCTBridgeModule>\n@end\n\n@implementation RCTTestInjectedModule\n\n@synthesize bridge = _bridge;\n@synthesize methodQueue = _methodQueue;\n\nRCT_EXPORT_MODULE()\n\n@end\n\n\n@interface RCTTestCustomInitModule : NSObject <RCTBridgeModule>\n\n@property (nonatomic, assign) BOOL initializedOnMainQueue;\n\n@end\n\n@implementation RCTTestCustomInitModule\n\n@synthesize bridge = _bridge;\n@synthesize methodQueue = _methodQueue;\n\nRCT_EXPORT_MODULE()\n\n- (id)init\n{\n  if ((self = [super init])) {\n    _initializedOnMainQueue = RCTIsMainQueue();\n  }\n  return self;\n}\n\n@end\n\n\n@interface RCTTestCustomSetBridgeModule : NSObject <RCTBridgeModule>\n\n@property (nonatomic, assign) BOOL setBridgeOnMainQueue;\n\n@end\n\n@implementation RCTTestCustomSetBridgeModule\n\n@synthesize bridge = _bridge;\n@synthesize methodQueue = _methodQueue;\n\nRCT_EXPORT_MODULE()\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  _bridge = bridge;\n  _setBridgeOnMainQueue = RCTIsMainQueue();\n}\n\n@end\n\n\n@interface RCTTestExportConstantsModule : NSObject <RCTBridgeModule>\n\n@property (nonatomic, assign) BOOL exportedConstants;\n@property (nonatomic, assign) BOOL exportedConstantsOnMainQueue;\n\n@end\n\n@implementation RCTTestExportConstantsModule\n\n@synthesize bridge = _bridge;\n@synthesize methodQueue = _methodQueue;\n\nRCT_EXPORT_MODULE()\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  _exportedConstants = YES;\n  _exportedConstantsOnMainQueue = RCTIsMainQueue();\n  return @{ @\"foo\": @\"bar\" };\n}\n\n@end\n\n\n@interface RCTLazyInitModule : NSObject <RCTBridgeModule>\n@end\n\n@implementation RCTLazyInitModule\n\n@synthesize bridge = _bridge;\n@synthesize methodQueue = _methodQueue;\n\nRCT_EXPORT_MODULE()\n\n@end\n\n\n@interface RCTModuleInitTests : XCTestCase <RCTBridgeDelegate>\n{\n  RCTBridge *_bridge;\n  BOOL _injectedModuleInitNotificationSent;\n  BOOL _customInitModuleNotificationSent;\n  BOOL _customSetBridgeModuleNotificationSent;\n  BOOL _exportConstantsModuleNotificationSent;\n  BOOL _lazyInitModuleNotificationSent;\n  BOOL _lazyInitModuleNotificationSentOnMainQueue;\n  BOOL _viewManagerModuleNotificationSent;\n  RCTTestInjectedModule *_injectedModule;\n}\n@end\n\n@implementation RCTModuleInitTests\n\n- (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge\n{\n  NSBundle *bundle = [NSBundle bundleForClass:[self class]];\n  return [bundle URLForResource:@\"RNTesterUnitTestsBundle\" withExtension:@\"js\"];\n}\n\n- (NSArray *)extraModulesForBridge:(__unused RCTBridge *)bridge\n{\n  return @[_injectedModule];\n}\n\n- (void)setUp\n{\n  [super setUp];\n\n  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moduleDidInit:) name:RCTDidInitializeModuleNotification object:nil];\n\n  _injectedModuleInitNotificationSent = NO;\n  _customInitModuleNotificationSent = NO;\n  _customSetBridgeModuleNotificationSent = NO;\n  _exportConstantsModuleNotificationSent = NO;\n  _lazyInitModuleNotificationSent = NO;\n  _viewManagerModuleNotificationSent = NO;\n  _injectedModule = [RCTTestInjectedModule new];\n  _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil];\n}\n\n- (void)tearDown\n{\n  [super tearDown];\n\n  [[NSNotificationCenter defaultCenter] removeObserver:self name:RCTDidInitializeModuleNotification object:nil];\n\n  [_bridge invalidate];\n  _bridge = nil;\n}\n\n- (void)moduleDidInit:(NSNotification *)note\n{\n  id<RCTBridgeModule> module = note.userInfo[@\"module\"];\n  if ([module isKindOfClass:[RCTTestInjectedModule class]]) {\n    _injectedModuleInitNotificationSent = YES;\n  } else if ([module isKindOfClass:[RCTTestCustomInitModule class]]) {\n    _customInitModuleNotificationSent = YES;\n  } else if ([module isKindOfClass:[RCTTestCustomSetBridgeModule class]]) {\n    _customSetBridgeModuleNotificationSent = YES;\n  } else if ([module isKindOfClass:[RCTTestExportConstantsModule class]]) {\n    _exportConstantsModuleNotificationSent = YES;\n  } else if ([module isKindOfClass:[RCTLazyInitModule class]]) {\n    _lazyInitModuleNotificationSent = YES;\n    _lazyInitModuleNotificationSentOnMainQueue = RCTIsMainQueue();\n  }\n}\n\n- (void)testInjectedModulesInitializedDuringBridgeInit\n{\n  XCTAssertEqual(_injectedModule, [_bridge moduleForClass:[RCTTestInjectedModule class]]);\n  XCTAssertEqual(_injectedModule.bridge, _bridge.batchedBridge);\n  XCTAssertNotNil(_injectedModule.methodQueue);\n  RCT_RUN_RUNLOOP_WHILE(!_injectedModuleInitNotificationSent);\n  XCTAssertTrue(_injectedModuleInitNotificationSent);\n}\n\n- (void)testCustomInitModuleInitializedAtBridgeStartup\n{\n  RCT_RUN_RUNLOOP_WHILE(!_customInitModuleNotificationSent);\n  XCTAssertTrue(_customInitModuleNotificationSent);\n  RCTTestCustomInitModule *module = [_bridge moduleForClass:[RCTTestCustomInitModule class]];\n  XCTAssertTrue(module.initializedOnMainQueue);\n  XCTAssertEqual(module.bridge, _bridge.batchedBridge);\n  XCTAssertNotNil(module.methodQueue);\n}\n\n- (void)testCustomSetBridgeModuleInitializedAtBridgeStartup\n{\n  XCTAssertFalse(_customSetBridgeModuleNotificationSent);\n\n  __block RCTTestCustomSetBridgeModule *module;\n  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n    module = [self->_bridge moduleForClass:[RCTTestCustomSetBridgeModule class]];\n  });\n\n  RCT_RUN_RUNLOOP_WHILE(!module);\n  XCTAssertTrue(_customSetBridgeModuleNotificationSent);\n  XCTAssertFalse(module.setBridgeOnMainQueue);\n  XCTAssertEqual(module.bridge, _bridge.batchedBridge);\n  XCTAssertNotNil(module.methodQueue);\n}\n\n- (void)testExportConstantsModuleInitializedAtBridgeStartup\n{\n  RCT_RUN_RUNLOOP_WHILE(!_exportConstantsModuleNotificationSent);\n  XCTAssertTrue(_exportConstantsModuleNotificationSent);\n  RCTTestExportConstantsModule *module = [_bridge moduleForClass:[RCTTestExportConstantsModule class]];\n  RCT_RUN_RUNLOOP_WHILE(!module.exportedConstants);\n  XCTAssertTrue(module.exportedConstants);\n  XCTAssertTrue(module.exportedConstantsOnMainQueue);\n  XCTAssertEqual(module.bridge, _bridge.batchedBridge);\n  XCTAssertNotNil(module.methodQueue);\n}\n\n- (void)testLazyInitModuleNotInitializedDuringBridgeInit\n{\n  XCTAssertFalse(_lazyInitModuleNotificationSent);\n\n  __block RCTLazyInitModule *module;\n  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n    module = [self->_bridge moduleForClass:[RCTLazyInitModule class]];\n  });\n\n  RCT_RUN_RUNLOOP_WHILE(!module);\n  XCTAssertTrue(_lazyInitModuleNotificationSent);\n  XCTAssertFalse(_lazyInitModuleNotificationSentOnMainQueue);\n  XCTAssertNotNil(module);\n  XCTAssertEqual(module.bridge, _bridge.batchedBridge);\n  XCTAssertNotNil(module.methodQueue);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTModuleMethodTests.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <AppKit/AppKit.h>\n#import <XCTest/XCTest.h>\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTLog.h>\n#import <React/RCTModuleMethod.h>\n\nstatic BOOL RCTLogsError(void (^block)(void))\n{\n  __block BOOL loggedError = NO;\n  RCTPerformBlockWithLogFunction(block, ^(RCTLogLevel level,\n                                          __unused RCTLogSource source,\n                                          __unused NSString *fileName,\n                                          __unused NSNumber *lineNumber,\n                                          __unused NSString *message) {\n    loggedError = (level == RCTLogLevelError);\n  });\n  return loggedError;\n}\n\n@interface RCTModuleMethodTests : XCTestCase <RCTBridgeModule>\n\n@end\n\n@implementation RCTModuleMethodTests\n{\n  CGRect _s;\n}\n\nstatic RCTModuleMethod *buildDefaultMethodWithMethodSignature(const char *methodSignature)\n{\n  // This leaks a RCTMethodInfo, but it's a test, so...\n  RCTMethodInfo *methodInfo = new RCTMethodInfo {.objcName = methodSignature, .isSync = NO};\n  return [[RCTModuleMethod alloc] initWithExportedMethod:methodInfo moduleClass:[RCTModuleMethodTests class]];\n}\n\nstatic RCTModuleMethod *buildSyncMethodWithMethodSignature(const char *methodSignature)\n{\n  // This leaks a RCTMethodInfo, but it's a test, so...\n  RCTMethodInfo *methodInfo = new RCTMethodInfo {.objcName = methodSignature, .isSync = YES};\n  return [[RCTModuleMethod alloc] initWithExportedMethod:methodInfo moduleClass:[RCTModuleMethodTests class]];\n}\n\n+ (NSString *)moduleName { return nil; }\n\n- (void)doFoo { }\n\n- (void)doFooWithBar:(__unused NSString *)bar { }\n\n- (id)echoString:(NSString *)input { return input; }\n- (id)methodThatReturnsNil { return nil; }\n\n- (void)testNonnull\n{\n  const char *methodSignature = \"doFooWithBar:(nonnull NSString *)bar\";\n  RCTModuleMethod *method = buildDefaultMethodWithMethodSignature(methodSignature);\n  XCTAssertFalse(RCTLogsError(^{\n    [method invokeWithBridge:nil module:self arguments:@[@\"Hello World\"]];\n  }));\n\n  XCTAssertTrue(RCTLogsError(^{\n    [method invokeWithBridge:nil module:self arguments:@[[NSNull null]]];\n  }));\n}\n\n- (void)doFooWithNumber:(__unused NSNumber *)n { }\n- (void)doFooWithDouble:(__unused double)n { }\n- (void)doFooWithInteger:(__unused NSInteger)n { }\n- (void)doFooWithCGRect:(CGRect)s { _s = s; }\n\n- (void)doFoo : (__unused NSString *)foo { }\n\n- (void)testNumbersNonnull\n{\n  {\n    // Specifying an NSNumber param without nonnull isn't allowed\n    XCTAssertTrue(RCTLogsError(^{\n      const char *methodSignature = \"doFooWithNumber:(NSNumber *)n\";\n      RCTModuleMethod *method = buildDefaultMethodWithMethodSignature(methodSignature);\n      // Invoke method to trigger parsing\n      [method invokeWithBridge:nil module:self arguments:@[@1]];\n    }));\n  }\n\n  {\n    const char *methodSignature = \"doFooWithNumber:(nonnull NSNumber *)n\";\n    RCTModuleMethod *method = buildDefaultMethodWithMethodSignature(methodSignature);\n    XCTAssertTrue(RCTLogsError(^{\n      [method invokeWithBridge:nil module:self arguments:@[[NSNull null]]];\n    }));\n  }\n\n  {\n    const char *methodSignature = \"doFooWithDouble:(double)n\";\n    RCTModuleMethod *method = buildDefaultMethodWithMethodSignature(methodSignature);\n    XCTAssertTrue(RCTLogsError(^{\n      [method invokeWithBridge:nil module:self arguments:@[[NSNull null]]];\n    }));\n  }\n\n  {\n    const char *methodSignature = \"doFooWithInteger:(NSInteger)n\";\n    RCTModuleMethod *method = buildDefaultMethodWithMethodSignature(methodSignature);\n    XCTAssertTrue(RCTLogsError(^{\n      [method invokeWithBridge:nil module:self arguments:@[[NSNull null]]];\n    }));\n  }\n}\n\n- (void)testStructArgument\n{\n  const char *methodSignature = \"doFooWithCGRect:(CGRect)s\";\n  RCTModuleMethod *method = buildDefaultMethodWithMethodSignature(methodSignature);\n\n  CGRect r = CGRectMake(10, 20, 30, 40);\n  [method invokeWithBridge:nil module:self arguments:@[@[@10, @20, @30, @40]]];\n  XCTAssertTrue(CGRectEqualToRect(r, _s));\n}\n\n- (void)testWhitespaceTolerance\n{\n  const char *methodSignature = \"doFoo : \\t (NSString *)foo\";\n\n  __block RCTModuleMethod *method;\n  XCTAssertFalse(RCTLogsError(^{\n    method = buildDefaultMethodWithMethodSignature(methodSignature);\n  }));\n\n  XCTAssertEqualObjects(@(method.JSMethodName), @\"doFoo\");\n\n  XCTAssertFalse(RCTLogsError(^{\n    [method invokeWithBridge:nil module:self arguments:@[@\"bar\"]];\n  }));\n}\n\n- (void)testFunctionType\n{\n  {\n    const char *methodSignature = \"doFoo\";\n    RCTModuleMethod *method = buildDefaultMethodWithMethodSignature(methodSignature);\n    XCTAssertTrue(method.functionType == RCTFunctionTypeNormal);\n  }\n\n  {\n    const char *methodSignature = \"openURL:(NSURL *)URL resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject\";\n    RCTModuleMethod *method = buildDefaultMethodWithMethodSignature(methodSignature);\n    XCTAssertTrue(method.functionType == RCTFunctionTypePromise);\n  }\n\n  {\n    const char *methodSignature = \"echoString:(NSString *)input\";\n    RCTModuleMethod *method = buildSyncMethodWithMethodSignature(methodSignature);\n    XCTAssertTrue(method.functionType == RCTFunctionTypeSync);\n  }\n}\n\n- (void)testReturnsValueForSyncFunction\n{\n  {\n    const char *methodSignature = \"echoString:(NSString *)input\";\n    RCTModuleMethod *method = buildSyncMethodWithMethodSignature(methodSignature);\n    id result = [method invokeWithBridge:nil module:self arguments:@[@\"Test String Value\"]];\n    XCTAssertEqualObjects(result, @\"Test String Value\");\n  }\n\n  {\n    const char *methodSignature = \"methodThatReturnsNil\";\n    RCTModuleMethod *method = buildSyncMethodWithMethodSignature(methodSignature);\n    id result = [method invokeWithBridge:nil module:self arguments:@[]];\n    XCTAssertNil(result);\n  }\n}\n\n- (void)testReturnsNilForDefaultFunction\n{\n  const char *methodSignature = \"doFoo\";\n  RCTModuleMethod *method = buildDefaultMethodWithMethodSignature(methodSignature);\n  id result = [method invokeWithBridge:nil module:self arguments:@[]];\n  XCTAssertNil(result);\n}\n\n- (void)testReturnTypeForSyncFunction\n{\n  {\n    const char *methodSignature = \"methodThatReturnsNil\";\n    RCTModuleMethod *method = buildSyncMethodWithMethodSignature(methodSignature);\n    XCTAssertFalse(RCTLogsError(^{\n      // Invoke method to trigger parsing\n      __unused SEL selector = method.selector;\n    }), @\"Unexpected error when parsing sync function with (id) return type\");\n  }\n\n  {\n    const char *methodSignature = \"doFoo\";\n    RCTModuleMethod *method = buildSyncMethodWithMethodSignature(methodSignature);\n    XCTAssertTrue(RCTLogsError(^{\n      // Invoke method to trigger parsing\n      __unused SEL selector = method.selector;\n    }), @\"Failed to trigger an error when parsing sync function with non-(id) return type\");\n  }\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTMultipartStreamReaderTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <React/RCTMultipartStreamReader.h>\n\n@interface RCTMultipartStreamReaderTests : XCTestCase\n\n@end\n\n@implementation RCTMultipartStreamReaderTests\n\n- (void)testSimpleCase {\n  NSString *response =\n  @\"preable, should be ignored\\r\\n\"\n  @\"--sample_boundary\\r\\n\"\n  @\"Content-Type: application/json; charset=utf-8\\r\\n\"\n  @\"Content-Length: 2\\r\\n\\r\\n\"\n  @\"{}\\r\\n\"\n  @\"--sample_boundary--\\r\\n\"\n  @\"epilogue, should be ignored\";\n\n  NSInputStream *inputStream = [NSInputStream inputStreamWithData:[response dataUsingEncoding:NSUTF8StringEncoding]];\n  RCTMultipartStreamReader *reader = [[RCTMultipartStreamReader alloc] initWithInputStream:inputStream boundary:@\"sample_boundary\"];\n  __block NSInteger count = 0;\n  BOOL success = [reader readAllPartsWithCompletionCallback:^(NSDictionary *headers, NSData *content, BOOL done) {\n    XCTAssertTrue(done);\n    XCTAssertEqualObjects(headers[@\"Content-Type\"], @\"application/json; charset=utf-8\");\n    XCTAssertEqualObjects([[NSString alloc] initWithData:content encoding:NSUTF8StringEncoding], @\"{}\");\n    count++;\n  } progressCallback: nil];\n  XCTAssertTrue(success);\n  XCTAssertEqual(count, 1);\n}\n\n- (void)testMultipleParts {\n  NSString *response =\n  @\"preable, should be ignored\\r\\n\"\n  @\"--sample_boundary\\r\\n\"\n  @\"1\\r\\n\"\n  @\"--sample_boundary\\r\\n\"\n  @\"2\\r\\n\"\n  @\"--sample_boundary\\r\\n\"\n  @\"3\\r\\n\"\n  @\"--sample_boundary--\\r\\n\"\n  @\"epilogue, should be ignored\";\n\n  NSInputStream *inputStream = [NSInputStream inputStreamWithData:[response dataUsingEncoding:NSUTF8StringEncoding]];\n  RCTMultipartStreamReader *reader = [[RCTMultipartStreamReader alloc] initWithInputStream:inputStream boundary:@\"sample_boundary\"];\n  __block NSInteger count = 0;\n  BOOL success = [reader readAllPartsWithCompletionCallback:^(__unused NSDictionary *headers, NSData *content, BOOL done) {\n    count++;\n    XCTAssertEqual(done, count == 3);\n    NSString *expectedBody = [NSString stringWithFormat:@\"%ld\", (long)count];\n    NSString *actualBody = [[NSString alloc] initWithData:content encoding:NSUTF8StringEncoding];\n    XCTAssertEqualObjects(actualBody, expectedBody);\n  } progressCallback:nil];\n  XCTAssertTrue(success);\n  XCTAssertEqual(count, 3);\n}\n\n- (void)testNoDelimiter {\n  NSString *response = @\"Yolo\";\n\n  NSInputStream *inputStream = [NSInputStream inputStreamWithData:[response dataUsingEncoding:NSUTF8StringEncoding]];\n  RCTMultipartStreamReader *reader = [[RCTMultipartStreamReader alloc] initWithInputStream:inputStream boundary:@\"sample_boundary\"];\n  __block NSInteger count = 0;\n  BOOL success = [reader readAllPartsWithCompletionCallback:^(__unused NSDictionary *headers, __unused NSData *content, __unused BOOL done) {\n    count++;\n  } progressCallback:nil];\n  XCTAssertFalse(success);\n  XCTAssertEqual(count, 0);\n}\n\n- (void)testNoCloseDelimiter {\n  NSString *response =\n  @\"preable, should be ignored\\r\\n\"\n  @\"--sample_boundary\\r\\n\"\n  @\"Content-Type: application/json; charset=utf-8\\r\\n\"\n  @\"Content-Length: 2\\r\\n\\r\\n\"\n  @\"{}\\r\\n\"\n  @\"--sample_boundary\\r\\n\"\n  @\"incomplete message...\";\n\n  NSInputStream *inputStream = [NSInputStream inputStreamWithData:[response dataUsingEncoding:NSUTF8StringEncoding]];\n  RCTMultipartStreamReader *reader = [[RCTMultipartStreamReader alloc] initWithInputStream:inputStream boundary:@\"sample_boundary\"];\n  __block NSInteger count = 0;\n  BOOL success = [reader readAllPartsWithCompletionCallback:^(__unused NSDictionary *headers, __unused NSData *content, __unused BOOL done) {\n    count++;\n  } progressCallback:nil];\n  XCTAssertFalse(success);\n  XCTAssertEqual(count, 1);\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <OCMock/OCMock.h>\n\n#import <RCTAnimation/RCTNativeAnimatedNodesManager.h>\n#import <RCTAnimation/RCTValueAnimatedNode.h>\n#import <React/RCTUIManager.h>\n\nstatic const NSTimeInterval FRAME_LENGTH = 1.0 / 60.0;\n\n@interface RCTFakeDisplayLink : NSTimer\n\n@end\n\n@implementation RCTFakeDisplayLink\n{\n  NSTimeInterval _timestamp;\n}\n\n- (instancetype)init\n{\n  self = [super init];\n  if (self) {\n    _timestamp = 1124.1234143251; // Random\n  }\n  return self;\n}\n\n- (NSTimeInterval)timestamp\n{\n  _timestamp += FRAME_LENGTH;\n  return _timestamp;\n}\n\n- (NSTimeInterval)timeInterval\n{\n  _timestamp += FRAME_LENGTH;\n  return _timestamp;\n}\n\n- (NSDate *)fireDate\n{\n  _timestamp += FRAME_LENGTH;\n  return [NSDate dateWithTimeIntervalSinceReferenceDate:_timestamp];\n}\n\n- (NSTimeInterval)timeIntervalSince1970\n{\n  return _timestamp;\n}\n\n@end\n\n@interface RCTFakeValueObserver : NSObject<RCTValueAnimatedNodeObserver>\n\n@property (nonatomic, strong) NSMutableArray<NSNumber *> *calls;\n\n@end\n\n@implementation RCTFakeValueObserver\n\n- (instancetype)init\n{\n  self = [super init];\n  if (self) {\n    _calls = [NSMutableArray new];\n  }\n  return self;\n}\n\n- (void)animatedNode:(__unused RCTValueAnimatedNode *)node didUpdateValue:(CGFloat)value\n{\n  [_calls addObject:@(value)];\n}\n\n@end\n\n@interface RCTFakeEvent : NSObject<RCTEvent>\n\n@end\n\n@implementation RCTFakeEvent\n{\n  NSArray *_arguments;\n}\n\n@synthesize eventName = _eventName;\n@synthesize viewTag = _viewTag;\n@synthesize coalescingKey = _coalescingKey;\n\n- (instancetype)initWithName:(NSString *)name viewTag:(NSNumber *)viewTag arguments:(NSArray *)arguments\n{\n  self = [super init];\n  if (self) {\n    _eventName = name;\n    _viewTag = viewTag;\n    _arguments = arguments;\n  }\n  return self;\n}\n\n- (NSArray *)arguments\n{\n  return _arguments;\n}\n\nRCT_NOT_IMPLEMENTED(+ (NSString *)moduleDotMethod);\nRCT_NOT_IMPLEMENTED(- (BOOL)canCoalesce);\nRCT_NOT_IMPLEMENTED(- (id<RCTEvent>)coalesceWithEvent:(id<RCTEvent>)newEvent);\n\n@end\n\nstatic id RCTPropChecker(NSString *prop, NSNumber *value)\n{\n  return [OCMArg checkWithBlock:^BOOL(NSDictionary<NSString *, NSNumber *> *props) {\n    BOOL match = fabs(props[prop].doubleValue - value.doubleValue) < FLT_EPSILON;\n    if (!match) {\n      NSLog(@\"Props `%@` with value `%@` is not close to `%@`\", prop, props[prop], value);\n    }\n    return match;\n  }];\n}\n\n@interface RCTNativeAnimatedNodesManagerTests : XCTestCase\n\n@end\n\n@implementation RCTNativeAnimatedNodesManagerTests\n{\n  id _uiManager;\n  RCTNativeAnimatedNodesManager *_nodesManager;\n  RCTFakeDisplayLink *_displayLink;\n}\n\n- (void)setUp\n{\n  [super setUp];\n\n  _uiManager = [OCMockObject niceMockForClass:[RCTUIManager class]];\n  _nodesManager = [[RCTNativeAnimatedNodesManager alloc] initWithUIManager:_uiManager];\n  _displayLink = [RCTFakeDisplayLink new];\n}\n\n/**\n * Generates a simple animated nodes graph and attaches the props node to a given viewTag\n * Parameter opacity is used as a initial value for the \"opacity\" attribute.\n *\n * Nodes are connected as follows (nodes IDs in parens):\n * ValueNode(1) -> StyleNode(2) -> PropNode(3)\n */\n- (void)createSimpleAnimatedView:(NSNumber *)viewTag withOpacity:(CGFloat)opacity\n{\n  [_nodesManager createAnimatedNode:@1\n                             config:@{@\"type\": @\"value\", @\"value\": @(opacity), @\"offset\": @0}];\n  [_nodesManager createAnimatedNode:@2\n                             config:@{@\"type\": @\"style\", @\"style\": @{@\"opacity\": @1}}];\n  [_nodesManager createAnimatedNode:@3\n                             config:@{@\"type\": @\"props\", @\"props\": @{@\"style\": @2}}];\n\n  [_nodesManager connectAnimatedNodes:@1 childTag:@2];\n  [_nodesManager connectAnimatedNodes:@2 childTag:@3];\n  [_nodesManager connectAnimatedNodeToView:@3 viewTag:viewTag viewName:@\"UIView\"];\n}\n\n- (void)testFramesAnimation\n{\n  [self createSimpleAnimatedView:@1000 withOpacity:0];\n  NSArray<NSNumber *> *frames = @[@0, @0.2, @0.4, @0.6, @0.8, @1];\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @1}\n                        endCallback:nil];\n\n  for (NSNumber *frame in frames) {\n    [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1000\n                                                  viewName:@\"NSView\"\n                                                     props:RCTPropChecker(@\"opacity\", frame)];\n    [_nodesManager stepAnimations:_displayLink];\n    [_uiManager verify];\n  }\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1000\n                                                viewName:@\"NSView\"\n                                                   props:RCTPropChecker(@\"opacity\", @1)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n- (void)testFramesAnimationLoop\n{\n  [self createSimpleAnimatedView:@1000 withOpacity:0];\n  NSArray<NSNumber *> *frames = @[@0, @0.2, @0.4, @0.6, @0.8, @1];\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @1, @\"iterations\": @5}\n                        endCallback:nil];\n\n  for (NSUInteger it = 0; it < 5; it++) {\n    for (NSNumber *frame in frames) {\n      [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1000\n                                                    viewName:@\"UIView\"\n                                                       props:RCTPropChecker(@\"opacity\", frame)];\n      [_nodesManager stepAnimations:_displayLink];\n      [_uiManager verify];\n    }\n  }\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1000\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"opacity\", @1)];\n\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n- (void)testNodeValueListenerIfNotListening\n{\n  NSNumber *nodeId = @1;\n  [self createSimpleAnimatedView:@1000 withOpacity:0];\n  NSArray<NSNumber *> *frames = @[@0, @0.2, @0.4, @0.6, @0.8, @1];\n\n  RCTFakeValueObserver *observer = [RCTFakeValueObserver new];\n  [_nodesManager startListeningToAnimatedNodeValue:nodeId valueObserver:observer];\n\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:nodeId\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @1}\n                        endCallback:nil];\n\n  [_nodesManager stepAnimations:_displayLink];\n  XCTAssertEqual(observer.calls.count, 1UL);\n  XCTAssertEqualObjects(observer.calls[0], @0);\n\n  [_nodesManager stopListeningToAnimatedNodeValue:nodeId];\n\n  [_nodesManager stepAnimations:_displayLink];\n  XCTAssertEqual(observer.calls.count, 1UL);\n}\n\n- (void)testNodeValueListenerIfListening\n{\n  NSNumber *nodeId = @1;\n  [self createSimpleAnimatedView:@1000 withOpacity:0];\n  NSArray<NSNumber *> *frames = @[@0, @0.2, @0.4, @0.6, @0.8, @1];\n\n  RCTFakeValueObserver *observer = [RCTFakeValueObserver new];\n  [_nodesManager startListeningToAnimatedNodeValue:nodeId valueObserver:observer];\n\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:nodeId\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @1}\n                        endCallback:nil];\n\n  for (NSUInteger i = 0; i < frames.count; i++) {\n    [_nodesManager stepAnimations:_displayLink];\n    XCTAssertEqual(observer.calls.count, i + 1);\n    XCTAssertEqualWithAccuracy(observer.calls[i].doubleValue, frames[i].doubleValue, FLT_EPSILON);\n  }\n\n  [_nodesManager stepAnimations:_displayLink];\n  XCTAssertEqual(observer.calls.count, 7UL);\n  XCTAssertEqualObjects(observer.calls[6], @1);\n\n  [_nodesManager stepAnimations:_displayLink];\n  XCTAssertEqual(observer.calls.count, 7UL);\n}\n\n- (void)performSpringAnimationTestWithConfig:(NSDictionary*)config isCriticallyDamped:(BOOL)testForCriticallyDamped\n{\n  [self createSimpleAnimatedView:@1000 withOpacity:0];\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:config\n                        endCallback:nil];\n\n  BOOL wasGreaterThanOne = NO;\n  CGFloat previousValue = 0;\n  __block CGFloat currentValue;\n  [[[_uiManager stub] andDo:^(NSInvocation *invocation) {\n    __unsafe_unretained NSDictionary<NSString *, NSNumber *> *props;\n    [invocation getArgument:&props atIndex:4];\n    currentValue = props[@\"opacity\"].doubleValue;\n  }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n\n  // Run for 3 seconds.\n  for (NSUInteger i = 0; i < 3 * 60; i++) {\n    [_nodesManager stepAnimations:_displayLink];\n\n    if (currentValue > 1) {\n      wasGreaterThanOne = YES;\n    }\n\n    // Verify that animation step is relatively small.\n    XCTAssertLessThan(fabs(currentValue - previousValue), 0.12);\n\n    previousValue = currentValue;\n  }\n\n  // Verify that we've reach the final value at the end of animation.\n  XCTAssertEqual(previousValue, 1.0);\n\n  // Verify that value has reached some maximum value that is greater than the final value (bounce).\n  if (testForCriticallyDamped) {\n    XCTAssertFalse(wasGreaterThanOne);\n  } else {\n    XCTAssertTrue(wasGreaterThanOne);\n  }\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n- (void)testUnderdampedSpringAnimation\n{\n  [self performSpringAnimationTestWithConfig:@{@\"type\": @\"spring\",\n                                               @\"stiffness\": @230.3,\n                                               @\"damping\": @22,\n                                               @\"mass\": @1,\n                                               @\"initialVelocity\": @0,\n                                               @\"toValue\": @1,\n                                               @\"restSpeedThreshold\": @0.001,\n                                               @\"restDisplacementThreshold\": @0.001,\n                                               @\"overshootClamping\": @NO}\n                          isCriticallyDamped:NO];\n}\n\n- (void)testCritcallyDampedSpringAnimation\n{\n  [self performSpringAnimationTestWithConfig:@{@\"type\": @\"spring\",\n                                               @\"stiffness\": @1000,\n                                               @\"damping\": @500,\n                                               @\"mass\": @3,\n                                               @\"initialVelocity\": @0,\n                                               @\"toValue\": @1,\n                                               @\"restSpeedThreshold\": @0.001,\n                                               @\"restDisplacementThreshold\": @0.001,\n                                               @\"overshootClamping\": @NO}\n                          isCriticallyDamped:YES];\n}\n\n- (void)testDecayAnimation\n{\n  [self createSimpleAnimatedView:@1000 withOpacity:0];\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:@{@\"type\": @\"decay\",\n                                      @\"velocity\": @0.5,\n                                      @\"deceleration\": @0.998}\n                        endCallback:nil];\n\n\n  __block CGFloat previousValue;\n  __block CGFloat currentValue;\n  CGFloat previousDiff = CGFLOAT_MAX;\n\n  [_nodesManager stepAnimations:_displayLink];\n\n  [[[_uiManager stub] andDo:^(NSInvocation *invocation) {\n    __unsafe_unretained NSDictionary<NSString *, NSNumber *> *props;\n    [invocation getArgument:&props atIndex:4];\n    currentValue = props[@\"opacity\"].doubleValue;\n  }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n\n  // Run 3 secs of animation.\n  for (NSUInteger i = 0; i < 3 * 60; i++) {\n    [_nodesManager stepAnimations:_displayLink];\n    CGFloat currentDiff = currentValue - previousValue;\n    // Verify monotonicity.\n    // Greater *or equal* because the animation stops during these 3 seconds.\n    XCTAssertGreaterThanOrEqual(currentValue, previousValue);\n    // Verify decay.\n    XCTAssertLessThanOrEqual(currentDiff, previousDiff);\n    previousValue = currentValue;\n    previousDiff = currentDiff;\n  }\n\n  // Should be done in 3 secs.\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n- (void)testDecayAnimationLoop\n{\n  [self createSimpleAnimatedView:@1000 withOpacity:0];\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:@{@\"type\": @\"decay\",\n                                      @\"velocity\": @0.5,\n                                      @\"deceleration\": @0.998,\n                                      @\"iterations\": @5}\n                        endCallback:nil];\n\n\n  __block CGFloat previousValue;\n  __block CGFloat currentValue;\n  BOOL didComeToRest = NO;\n  NSUInteger numberOfResets = 0;\n\n  [[[_uiManager stub] andDo:^(NSInvocation *invocation) {\n    __unsafe_unretained NSDictionary<NSString *, NSNumber *> *props;\n    [invocation getArgument:&props atIndex:4];\n    currentValue = props[@\"opacity\"].doubleValue;\n  }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n\n  // Run 3 secs of animation five times.\n  for (NSUInteger i = 0; i < 3 * 60 * 5; i++) {\n    [_nodesManager stepAnimations:_displayLink];\n\n    // Verify monotonicity when not resetting the animation.\n    // Greater *or equal* because the animation stops during these 3 seconds.\n    if (!didComeToRest) {\n      XCTAssertGreaterThanOrEqual(currentValue, previousValue);\n    }\n\n    if (didComeToRest && currentValue != previousValue) {\n      numberOfResets++;\n      didComeToRest = NO;\n    }\n\n    // Test if animation has come to rest using the 0.1 threshold from DecayAnimation.m.\n    didComeToRest = fabs(currentValue - previousValue) < 0.1;\n    previousValue = currentValue;\n  }\n\n  // The animation should have reset 4 times.\n  XCTAssertEqual(numberOfResets, 4u);\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n- (void)testSpringAnimationLoop\n{\n  [self createSimpleAnimatedView:@1000 withOpacity:0];\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:@{@\"type\": @\"spring\",\n                                      @\"iterations\": @5,\n                                      @\"stiffness\": @230.2,\n                                      @\"damping\": @22,\n                                      @\"mass\": @1,\n                                      @\"initialVelocity\": @0,\n                                      @\"toValue\": @1,\n                                      @\"restSpeedThreshold\": @0.001,\n                                      @\"restDisplacementThreshold\": @0.001,\n                                      @\"overshootClamping\": @NO}\n                        endCallback:nil];\n\n  BOOL didComeToRest = NO;\n  CGFloat previousValue = 0;\n  NSUInteger numberOfResets = 0;\n  __block CGFloat currentValue;\n  [[[_uiManager stub] andDo:^(NSInvocation *invocation) {\n    __unsafe_unretained NSDictionary<NSString *, NSNumber *> *props;\n    [invocation getArgument:&props atIndex:4];\n    currentValue = props[@\"opacity\"].doubleValue;\n  }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n\n  // Run for 3 seconds five times.\n  for (NSUInteger i = 0; i < 3 * 60 * 5; i++) {\n    [_nodesManager stepAnimations:_displayLink];\n\n    if (!didComeToRest) {\n      // Verify that animation step is relatively small.\n      XCTAssertLessThan(fabs(currentValue - previousValue), 0.12);\n    }\n\n    // Test to see if it reset after coming to rest\n    if (didComeToRest && currentValue == 0) {\n      didComeToRest = NO;\n      numberOfResets++;\n    }\n\n    // Record that the animation did come to rest when it rests on toValue.\n    didComeToRest = fabs(currentValue - 1) < 0.001 && fabs(currentValue - previousValue) < 0.001;\n\n    previousValue = currentValue;\n  }\n\n  // Verify that value reset 4 times after finishing a full animation and is currently resting.\n  XCTAssertEqual(numberOfResets, 4u);\n  XCTAssertTrue(didComeToRest);\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n- (void)testAnimationCallbackFinish\n{\n  [self createSimpleAnimatedView:@1000 withOpacity:0];\n  NSArray<NSNumber *> *frames = @[@0, @1];\n\n  __block NSInteger endCallbackCalls = 0;\n\n  RCTResponseSenderBlock endCallback = ^(NSArray *response) {\n    endCallbackCalls++;\n    XCTAssertEqualObjects(response, @[@{@\"finished\": @YES}]);\n  };\n\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @1}\n                        endCallback:endCallback];\n\n  [_nodesManager stepAnimations:_displayLink];\n  [_nodesManager stepAnimations:_displayLink];\n  XCTAssertEqual(endCallbackCalls, 0);\n  [_nodesManager stepAnimations:_displayLink];\n  XCTAssertEqual(endCallbackCalls, 1);\n  [_nodesManager stepAnimations:_displayLink];\n  XCTAssertEqual(endCallbackCalls, 1);\n}\n\n/**\n * Creates a following graph of nodes:\n * Value(1, firstValue) ----> Add(3) ---> Style(4) ---> Props(5) ---> View(viewTag)\n *                         |\n * Value(2, secondValue) --+\n *\n * Add(3) node maps to a \"translateX\" attribute of the Style(4) node.\n */\n- (void)createAnimatedGraphWithAdditionNode:(NSNumber *)viewTag\n                                 firstValue:(CGFloat)firstValue\n                                secondValue:(CGFloat)secondValue\n{\n  [_nodesManager createAnimatedNode:@1\n                             config:@{@\"type\": @\"value\", @\"value\": @(firstValue), @\"offset\": @0}];\n  [_nodesManager createAnimatedNode:@2\n                             config:@{@\"type\": @\"value\", @\"value\": @(secondValue), @\"offset\": @0}];\n  [_nodesManager createAnimatedNode:@3\n                             config:@{@\"type\": @\"addition\", @\"input\": @[@1, @2]}];\n  [_nodesManager createAnimatedNode:@4\n                             config:@{@\"type\": @\"style\", @\"style\": @{@\"translateX\": @3}}];\n  [_nodesManager createAnimatedNode:@5\n                             config:@{@\"type\": @\"props\", @\"props\": @{@\"style\": @4}}];\n\n  [_nodesManager connectAnimatedNodes:@1 childTag:@3];\n  [_nodesManager connectAnimatedNodes:@2 childTag:@3];\n  [_nodesManager connectAnimatedNodes:@3 childTag:@4];\n  [_nodesManager connectAnimatedNodes:@4 childTag:@5];\n  [_nodesManager connectAnimatedNodeToView:@5 viewTag:viewTag viewName:@\"UIView\"];\n}\n\n- (void)testAdditionNode\n{\n  NSNumber *viewTag = @50;\n  [self createAnimatedGraphWithAdditionNode:viewTag firstValue:100 secondValue:1000];\n\n  NSArray<NSNumber *> *frames = @[@0, @1];\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @101}\n                        endCallback:nil];\n  [_nodesManager startAnimatingNode:@2\n                            nodeTag:@2\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @1010}\n                        endCallback:nil];\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"translateX\", @1100)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"translateX\", @1111)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"translateX\", @1111)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n/**\n * Verifies that views are updated properly when one of the addition input nodes has started animating\n * while the other one has not.\n *\n * We expect that the output of the addition node will take the starting value of the second input\n * node even though the node hasn't been connected to an active animation driver.\n */\n- (void)testViewReceiveUpdatesIfOneOfAnimationHasntStarted\n{\n  NSNumber *viewTag = @50;\n  [self createAnimatedGraphWithAdditionNode:viewTag firstValue:100 secondValue:1000];\n\n  NSArray<NSNumber *> *frames = @[@0, @1];\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @101}\n                        endCallback:nil];\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"translateX\", @1100)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"translateX\", @1101)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"translateX\", @1101)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n/**\n * Verifies that views are updated properly when one of the addition input nodes animation finishes\n * before the other.\n *\n * We expect that the output of the addition node after one of the animation has finished will\n * take the last value of the animated node and the view will receive updates up until the second\n * animation is over.\n */\n- (void)testViewReceiveUpdatesWhenOneOfAnimationHasFinished\n{\n  NSNumber *viewTag = @50;\n  [self createAnimatedGraphWithAdditionNode:viewTag firstValue:100 secondValue:1000];\n\n  NSArray<NSNumber *> *firstFrames = @[@0, @1];\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:@{@\"type\": @\"frames\", @\"frames\": firstFrames, @\"toValue\": @200}\n                        endCallback:nil];\n  NSArray<NSNumber *> *secondFrames = @[@0, @0.2, @0.4, @0.6, @0.8, @1];\n  [_nodesManager startAnimatingNode:@2\n                            nodeTag:@2\n                             config:@{@\"type\": @\"frames\", @\"frames\": secondFrames, @\"toValue\": @1010}\n                        endCallback:nil];\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"translateX\", @1100)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  for (NSUInteger i = 1; i < secondFrames.count; i++) {\n    CGFloat expected = 1200.0 + secondFrames[i].doubleValue * 10.0;\n    [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                  viewName:@\"UIView\"\n                                                     props:RCTPropChecker(@\"translateX\", @(expected))];\n    [_nodesManager stepAnimations:_displayLink];\n    [_uiManager verify];\n  }\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"translateX\", @1210)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n- (void)testMultiplicationNode\n{\n  NSNumber *viewTag = @50;\n  [_nodesManager createAnimatedNode:@1\n                             config:@{@\"type\": @\"value\", @\"value\": @1, @\"offset\": @0}];\n  [_nodesManager createAnimatedNode:@2\n                             config:@{@\"type\": @\"value\", @\"value\": @5, @\"offset\": @0}];\n  [_nodesManager createAnimatedNode:@3\n                             config:@{@\"type\": @\"multiplication\", @\"input\": @[@1, @2]}];\n  [_nodesManager createAnimatedNode:@4\n                             config:@{@\"type\": @\"style\", @\"style\": @{@\"translateX\": @3}}];\n  [_nodesManager createAnimatedNode:@5\n                             config:@{@\"type\": @\"props\", @\"props\": @{@\"style\": @4}}];\n\n  [_nodesManager connectAnimatedNodes:@1 childTag:@3];\n  [_nodesManager connectAnimatedNodes:@2 childTag:@3];\n  [_nodesManager connectAnimatedNodes:@3 childTag:@4];\n  [_nodesManager connectAnimatedNodes:@4 childTag:@5];\n  [_nodesManager connectAnimatedNodeToView:@5 viewTag:viewTag viewName:@\"UIView\"];\n\n  NSArray<NSNumber *> *frames = @[@0, @1];\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @2}\n                        endCallback:nil];\n  [_nodesManager startAnimatingNode:@2\n                            nodeTag:@2\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @10}\n                        endCallback:nil];\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"translateX\", @5)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"translateX\", @20)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"translateX\", @20)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n- (void)testHandleStoppingAnimation\n{\n  [self createSimpleAnimatedView:@1000 withOpacity:0];\n  NSArray<NSNumber *> *frames = @[@0, @0.2, @0.4, @0.6, @0.8, @1];\n\n  __block BOOL endCallbackCalled = NO;\n\n  RCTResponseSenderBlock endCallback = ^(NSArray *response) {\n    endCallbackCalled = YES;\n    XCTAssertEqualObjects(response, @[@{@\"finished\": @NO}]);\n  };\n\n  [_nodesManager startAnimatingNode:@404\n                            nodeTag:@1\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @1}\n                        endCallback:endCallback];\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n  [_nodesManager stopAnimation:@404];\n  XCTAssertEqual(endCallbackCalled, YES);\n\n  // Run \"update\" loop a few more times -> we expect no further updates nor callback calls to be\n  // triggered\n  for (NSUInteger i = 0; i < 5; i++) {\n    [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n    [_nodesManager stepAnimations:_displayLink];\n    [_uiManager verify];\n  }\n}\n\n- (void)testInterpolationNode\n{\n  NSNumber *viewTag = @50;\n  [_nodesManager createAnimatedNode:@1\n                             config:@{@\"type\": @\"value\", @\"value\": @10, @\"offset\": @0}];\n  [_nodesManager createAnimatedNode:@2\n                             config:@{@\"type\": @\"interpolation\",\n                                      @\"inputRange\": @[@10, @20],\n                                      @\"outputRange\": @[@0, @1],\n                                      @\"extrapolateLeft\": @\"extend\",\n                                      @\"extrapolateRight\": @\"extend\"}];\n  [_nodesManager createAnimatedNode:@3\n                             config:@{@\"type\": @\"style\", @\"style\": @{@\"opacity\": @2}}];\n  [_nodesManager createAnimatedNode:@4\n                             config:@{@\"type\": @\"props\", @\"props\": @{@\"style\": @3}}];\n\n  [_nodesManager connectAnimatedNodes:@1 childTag:@2];\n  [_nodesManager connectAnimatedNodes:@2 childTag:@3];\n  [_nodesManager connectAnimatedNodes:@3 childTag:@4];\n  [_nodesManager connectAnimatedNodeToView:@4 viewTag:viewTag viewName:@\"UIView\"];\n\n  NSArray<NSNumber *> *frames = @[@0, @0.2, @0.4, @0.6, @0.8, @1];\n  [_nodesManager startAnimatingNode:@1\n                            nodeTag:@1\n                             config:@{@\"type\": @\"frames\", @\"frames\": frames, @\"toValue\": @20}\n                        endCallback:nil];\n\n  for (NSNumber *frame in frames) {\n    [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                  viewName:@\"UIView\"\n                                                     props:RCTPropChecker(@\"opacity\", frame)];\n    [_nodesManager stepAnimations:_displayLink];\n    [_uiManager verify];\n  }\n\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"opacity\", @1)];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n- (id<RCTEvent>)createScrollEventWithTag:(NSNumber *)viewTag value:(CGFloat)value\n{\n  // The event value is the 3rd argument.\n  NSArray *arguments = @[@1, @1, @{@\"contentOffset\": @{@\"y\": @(value)}}];\n  return [[RCTFakeEvent alloc] initWithName:@\"topScroll\"\n                                    viewTag:viewTag\n                                  arguments:arguments];\n}\n\n- (void)testNativeAnimatedEventDoUpdate\n{\n  NSNumber *viewTag = @1000;\n  [self createSimpleAnimatedView:viewTag withOpacity:0];\n\n  [_nodesManager addAnimatedEventToView:viewTag\n                              eventName:@\"topScroll\"\n                           eventMapping:@{@\"animatedValueTag\": @1,\n                                          @\"nativeEventPath\": @[@\"contentOffset\", @\"y\"]}];\n\n\n\n  // Make sure that the update actually happened synchronously in `handleAnimatedEvent` and does\n  // not wait for the next animation loop.\n  [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag\n                                                viewName:@\"UIView\"\n                                                   props:RCTPropChecker(@\"opacity\", @10)];\n  [_nodesManager handleAnimatedEvent:[self createScrollEventWithTag:viewTag value:10]];\n  [_uiManager verify];\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager stepAnimations:_displayLink];\n  [_uiManager verify];\n}\n\n- (void)testNativeAnimatedEventDoNotUpdate\n{\n  NSNumber *viewTag = @1000;\n  [self createSimpleAnimatedView:viewTag withOpacity:0];\n\n  [_nodesManager addAnimatedEventToView:viewTag\n                              eventName:@\"otherEvent\"\n                           eventMapping:@{@\"animatedValueTag\": @1,\n                                          @\"nativeEventPath\": @[@\"contentOffset\", @\"y\"]}];\n\n  [_nodesManager addAnimatedEventToView:@999\n                              eventName:@\"topScroll\"\n                           eventMapping:@{@\"animatedValueTag\": @1,\n                                          @\"nativeEventPath\": @[@\"contentOffset\", @\"y\"]}];\n\n  [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY];\n  [_nodesManager handleAnimatedEvent:[self createScrollEventWithTag:viewTag value:10]];\n  [_uiManager verify];\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTShadowViewTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <React/RCTRootShadowView.h>\n#import <React/RCTShadowView+Layout.h>\n#import <React/RCTShadowView.h>\n\n\n@interface RCTShadowViewTests : XCTestCase\n@property (nonatomic, strong) RCTRootShadowView *parentView;\n@end\n\n@implementation RCTShadowViewTests\n\n- (void)setUp\n{\n  [super setUp];\n\n  self.parentView = [RCTRootShadowView new];\n  YGNodeStyleSetFlexDirection(self.parentView.yogaNode, YGFlexDirectionColumn);\n  YGNodeStyleSetWidth(self.parentView.yogaNode, 440);\n  YGNodeStyleSetHeight(self.parentView.yogaNode, 440);\n  self.parentView.reactTag = @1; // must be valid rootView tag\n}\n\n// Just a basic sanity test to ensure css-layout is applied correctly in the context of our shadow view hierarchy.\n//\n// ====================================\n// ||             header             ||\n// ====================================\n// ||       ||              ||       ||\n// || left  ||    center    || right ||\n// ||       ||              ||       ||\n// ====================================\n// ||             footer             ||\n// ====================================\n//\n- (void)testApplyingLayoutRecursivelyToShadowView\n{\n  RCTShadowView *leftView = [self _shadowViewWithConfig:^(YGNodeRef node) {\n    YGNodeStyleSetFlex(node, 1);\n  }];\n\n  RCTShadowView *centerView = [self _shadowViewWithConfig:^(YGNodeRef node) {\n    YGNodeStyleSetFlex(node, 2);\n    YGNodeStyleSetMargin(node, YGEdgeLeft, 10);\n    YGNodeStyleSetMargin(node, YGEdgeRight, 10);\n  }];\n\n  RCTShadowView *rightView = [self _shadowViewWithConfig:^(YGNodeRef node) {\n    YGNodeStyleSetFlex(node, 1);\n  }];\n\n  RCTShadowView *mainView = [self _shadowViewWithConfig:^(YGNodeRef node) {\n    YGNodeStyleSetFlexDirection(node, YGFlexDirectionRow);\n    YGNodeStyleSetFlex(node, 2);\n    YGNodeStyleSetMargin(node, YGEdgeTop, 10);\n    YGNodeStyleSetMargin(node, YGEdgeBottom, 10);\n  }];\n\n  [mainView insertReactSubview:leftView atIndex:0];\n  [mainView insertReactSubview:centerView atIndex:1];\n  [mainView insertReactSubview:rightView atIndex:2];\n\n  RCTShadowView *headerView = [self _shadowViewWithConfig:^(YGNodeRef node) {\n    YGNodeStyleSetFlex(node, 1);\n  }];\n\n  RCTShadowView *footerView = [self _shadowViewWithConfig:^(YGNodeRef node) {\n    YGNodeStyleSetFlex(node, 1);\n  }];\n\n  YGNodeStyleSetPadding(self.parentView.yogaNode, YGEdgeLeft, 10);\n  YGNodeStyleSetPadding(self.parentView.yogaNode, YGEdgeTop, 10);\n  YGNodeStyleSetPadding(self.parentView.yogaNode, YGEdgeRight, 10);\n  YGNodeStyleSetPadding(self.parentView.yogaNode, YGEdgeBottom, 10);\n\n  [self.parentView insertReactSubview:headerView atIndex:0];\n  [self.parentView insertReactSubview:mainView atIndex:1];\n  [self.parentView insertReactSubview:footerView atIndex:2];\n\n  [self.parentView collectViewsWithUpdatedFrames];\n\n  XCTAssertTrue(CGRectEqualToRect([self.parentView measureLayoutRelativeToAncestor:self.parentView], CGRectMake(0, 0, 440, 440)));\n\n\n  XCTAssertTrue(CGRectEqualToRect([headerView measureLayoutRelativeToAncestor:self.parentView], CGRectMake(10, 10, 420, 100)));\n  XCTAssertTrue(CGRectEqualToRect([mainView measureLayoutRelativeToAncestor:self.parentView], CGRectMake(10, 120, 420, 200)));\n  XCTAssertTrue(CGRectEqualToRect([footerView measureLayoutRelativeToAncestor:self.parentView], CGRectMake(10, 330, 420, 100)));\n\n  XCTAssertTrue(CGRectEqualToRect([leftView measureLayoutRelativeToAncestor:self.parentView], CGRectMake(10, 120, 100, 200)));\n  XCTAssertTrue(CGRectEqualToRect([centerView measureLayoutRelativeToAncestor:self.parentView], CGRectMake(120, 120, 200, 200)));\n  XCTAssertTrue(CGRectEqualToRect([rightView measureLayoutRelativeToAncestor:self.parentView], CGRectMake(330, 120, 100, 200)));\n}\n\n- (void)testAncestorCheck\n{\n  RCTShadowView *centerView = [self _shadowViewWithConfig:^(YGNodeRef node) {\n    YGNodeStyleSetFlex(node, 1);\n  }];\n\n  RCTShadowView *mainView = [self _shadowViewWithConfig:^(YGNodeRef node) {\n    YGNodeStyleSetFlex(node, 1);\n  }];\n\n  [mainView insertReactSubview:centerView atIndex:0];\n\n  RCTShadowView *footerView = [self _shadowViewWithConfig:^(YGNodeRef node) {\n    YGNodeStyleSetFlex(node, 1);\n  }];\n\n  [self.parentView insertReactSubview:mainView atIndex:0];\n  [self.parentView insertReactSubview:footerView atIndex:1];\n\n  XCTAssertTrue([centerView viewIsDescendantOf:mainView]);\n  XCTAssertFalse([footerView viewIsDescendantOf:mainView]);\n}\n\n- (void)testAssignsSuggestedWidthDimension\n{\n  [self _withShadowViewWithStyle:^(YGNodeRef node) {\n                                   YGNodeStyleSetPositionType(node, YGPositionTypeAbsolute);\n                                   YGNodeStyleSetPosition(node, YGEdgeLeft, 0);\n                                   YGNodeStyleSetPosition(node, YGEdgeTop, 0);\n                                   YGNodeStyleSetHeight(node, 10);\n                                 }\n            assertRelativeLayout:CGRectMake(0, 0, 3, 10)\n        withIntrinsicContentSize:CGSizeMake(3, NSViewNoInstrinsicMetric)];\n}\n\n- (void)testAssignsSuggestedHeightDimension\n{\n  [self _withShadowViewWithStyle:^(YGNodeRef node) {\n                                   YGNodeStyleSetPositionType(node, YGPositionTypeAbsolute);\n                                   YGNodeStyleSetPosition(node, YGEdgeLeft, 0);\n                                   YGNodeStyleSetPosition(node, YGEdgeTop, 0);\n                                   YGNodeStyleSetWidth(node, 10);\n                                 }\n            assertRelativeLayout:CGRectMake(0, 0, 10, 4)\n        withIntrinsicContentSize:CGSizeMake(NSViewNoInstrinsicMetric, 4)];\n}\n\n- (void)testDoesNotOverrideDimensionStyleWithSuggestedDimensions\n{\n  [self _withShadowViewWithStyle:^(YGNodeRef node) {\n                                   YGNodeStyleSetPositionType(node, YGPositionTypeAbsolute);\n                                   YGNodeStyleSetPosition(node, YGEdgeLeft, 0);\n                                   YGNodeStyleSetPosition(node, YGEdgeTop, 0);\n                                   YGNodeStyleSetWidth(node, 10);\n                                   YGNodeStyleSetHeight(node, 10);\n                                 }\n          assertRelativeLayout:CGRectMake(0, 0, 10, 10)\n      withIntrinsicContentSize:CGSizeMake(3, 4)];\n}\n\n- (void)testDoesNotAssignSuggestedDimensionsWhenStyledWithFlexAttribute\n{\n  float parentWidth = YGNodeStyleGetWidth(self.parentView.yogaNode).value;\n  float parentHeight = YGNodeStyleGetHeight(self.parentView.yogaNode).value;\n  [self _withShadowViewWithStyle:^(YGNodeRef node) {\n                                   YGNodeStyleSetFlex(node, 1);\n                                 }\n            assertRelativeLayout:CGRectMake(0, 0, parentWidth, parentHeight)\n        withIntrinsicContentSize:CGSizeMake(3, 4)];\n}\n\n- (void)_withShadowViewWithStyle:(void(^)(YGNodeRef node))configBlock\n            assertRelativeLayout:(CGRect)expectedRect\n        withIntrinsicContentSize:(CGSize)contentSize\n{\n  RCTShadowView *view = [self _shadowViewWithConfig:configBlock];\n  [self.parentView insertReactSubview:view atIndex:0];\n  view.intrinsicContentSize = contentSize;\n  [self.parentView collectViewsWithUpdatedFrames];\n  CGRect actualRect = [view measureLayoutRelativeToAncestor:self.parentView];\n  XCTAssertTrue(CGRectEqualToRect(expectedRect, actualRect),\n                @\"Layouts are different\");\n}\n\n- (RCTShadowView *)_shadowViewWithConfig:(void(^)(YGNodeRef node))configBlock\n{\n  RCTShadowView *shadowView = [RCTShadowView new];\n  configBlock(shadowView.yogaNode);\n  return shadowView;\n}\n\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTUIManagerTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <React/RCTUIManager.h>\n#import <React/NSView+React.h>\n\n@interface RCTUIManager (Testing)\n\n- (void)_manageChildren:(NSNumber *)containerReactTag\n        moveFromIndices:(NSArray *)moveFromIndices\n          moveToIndices:(NSArray *)moveToIndices\n      addChildReactTags:(NSArray *)addChildReactTags\n           addAtIndices:(NSArray *)addAtIndices\n        removeAtIndices:(NSArray *)removeAtIndices\n               registry:(NSDictionary<NSNumber *, id<RCTComponent>> *)registry;\n\n@property (nonatomic, copy, readonly) NSMutableDictionary<NSNumber *, NSView *> *viewRegistry;\n\n@end\n\n@interface RCTUIManagerTests : XCTestCase\n\n@property (nonatomic, readwrite, strong) RCTUIManager *uiManager;\n\n@end\n\n@implementation RCTUIManagerTests\n\n- (void)setUp\n{\n  [super setUp];\n\n  _uiManager = [RCTUIManager new];\n\n  // Register 20 views to use in the tests\n  for (NSInteger i = 1; i <= 20; i++) {\n    NSView *registeredView = [NSView new];\n    registeredView.reactTag = @(i);\n    _uiManager.viewRegistry[@(i)] = registeredView;\n  }\n}\n\n- (void)testManagingChildrenToAddViews\n{\n  NSView *containerView = _uiManager.viewRegistry[@20];\n  NSMutableArray *addedViews = [NSMutableArray array];\n\n  NSArray *tagsToAdd = @[@1, @2, @3, @4, @5];\n  NSArray *addAtIndices = @[@0, @1, @2, @3, @4];\n  for (NSNumber *tag in tagsToAdd) {\n    [addedViews addObject:_uiManager.viewRegistry[tag]];\n  }\n\n  // Add views 1-5 to view 20\n  [_uiManager _manageChildren:@20\n              moveFromIndices:nil\n                moveToIndices:nil\n            addChildReactTags:tagsToAdd\n                 addAtIndices:addAtIndices\n              removeAtIndices:nil\n                     registry:_uiManager.viewRegistry];\n\n  [containerView didUpdateReactSubviews];\n\n  XCTAssertTrue([[containerView reactSubviews] count] == 5,\n               @\"Expect to have 5 react subviews after calling manage children \\\n               with 5 tags to add, instead have %lu\", (unsigned long)[[containerView reactSubviews] count]);\n  for (NSView *view in addedViews) {\n    XCTAssertTrue([view reactSuperview] == containerView,\n                 @\"Expected to have manage children successfully add children\");\n    [view removeFromSuperview];\n  }\n}\n\n- (void)testManagingChildrenToRemoveViews\n{\n  NSView *containerView = _uiManager.viewRegistry[@20];\n  NSMutableArray *removedViews = [NSMutableArray array];\n\n  NSArray *removeAtIndices = @[@0, @4, @8, @12, @16];\n  for (NSNumber *index in removeAtIndices) {\n    NSNumber *reactTag = @(index.integerValue + 2);\n    [removedViews addObject:_uiManager.viewRegistry[reactTag]];\n  }\n  for (NSInteger i = 2; i < 20; i++) {\n    NSView *view = _uiManager.viewRegistry[@(i)];\n    [containerView insertReactSubview:view atIndex:containerView.reactSubviews.count];\n  }\n\n  // Remove views 1-5 from view 20\n  [_uiManager _manageChildren:@20\n              moveFromIndices:nil\n                moveToIndices:nil\n            addChildReactTags:nil\n                 addAtIndices:nil\n              removeAtIndices:removeAtIndices\n                     registry:_uiManager.viewRegistry];\n\n  [containerView didUpdateReactSubviews];\n\n  XCTAssertEqual(containerView.reactSubviews.count, (NSUInteger)13,\n               @\"Expect to have 13 react subviews after calling manage children\\\n               with 5 tags to remove and 18 prior children, instead have %zd\",\n               containerView.reactSubviews.count);\n  for (NSView *view in removedViews) {\n    XCTAssertTrue([view reactSuperview] == nil,\n                 @\"Expected to have manage children successfully remove children\");\n    // After removing views are unregistered - we need to reregister\n    _uiManager.viewRegistry[view.reactTag] = view;\n  }\n  for (NSInteger i = 2; i < 20; i++) {\n    NSView *view = _uiManager.viewRegistry[@(i)];\n    if (![removedViews containsObject:view]) {\n      XCTAssertTrue([view superview] == containerView,\n                   @\"Should not have removed view with react tag %ld during delete but did\", (long)i);\n      [view removeFromSuperview];\n    }\n  }\n}\n\n// We want to start with views 1-10 added at indices 0-9\n// Then we'll remove indices 2, 3, 5 and 8\n// Add views 11 and 12 to indices 0 and 6\n// And move indices 4 and 9 to 1 and 7\n// So in total it goes from:\n// [1,2,3,4,5,6,7,8,9,10]\n// to\n// [11,5,1,2,7,8,12,10]\n- (void)testManagingChildrenToAddRemoveAndMove\n{\n  NSView *containerView = _uiManager.viewRegistry[@20];\n\n  NSArray *removeAtIndices = @[@2, @3, @5, @8];\n  NSArray *addAtIndices = @[@0, @6];\n  NSArray *tagsToAdd = @[@11, @12];\n  NSArray *moveFromIndices = @[@4, @9];\n  NSArray *moveToIndices = @[@1, @7];\n\n  // We need to keep these in array to keep them around\n  NSMutableArray *viewsToRemove = [NSMutableArray array];\n  for (NSUInteger i = 0; i < removeAtIndices.count; i++) {\n    NSNumber *reactTagToRemove = @([removeAtIndices[i] integerValue] + 1);\n    NSView *viewToRemove = _uiManager.viewRegistry[reactTagToRemove];\n    [viewsToRemove addObject:viewToRemove];\n  }\n\n  for (NSInteger i = 1; i < 11; i++) {\n    NSView *view = _uiManager.viewRegistry[@(i)];\n    [containerView insertReactSubview:view atIndex:containerView.reactSubviews.count];\n  }\n\n  [_uiManager _manageChildren:@20\n              moveFromIndices:moveFromIndices\n                moveToIndices:moveToIndices\n            addChildReactTags:tagsToAdd\n                 addAtIndices:addAtIndices\n              removeAtIndices:removeAtIndices\n                     registry:_uiManager.viewRegistry];\n\n  [containerView didUpdateReactSubviews];\n\n  XCTAssertTrue([[containerView reactSubviews] count] == 8,\n               @\"Expect to have 8 react subviews after calling manage children,\\\n               instead have the following subviews %@\", [containerView reactSubviews]);\n\n  NSArray *expectedReactTags = @[@11, @5, @1, @2, @7, @8, @12, @10];\n  for (NSUInteger i = 0; i < containerView.subviews.count; i++) {\n    XCTAssertEqualObjects([[containerView reactSubviews][i] reactTag], expectedReactTags[i],\n                 @\"Expected subview at index %ld to have react tag #%@ but has tag #%@\",\n                         (long)i, expectedReactTags[i], [[containerView reactSubviews][i] reactTag]);\n  }\n\n  // Clean up after ourselves\n  for (NSInteger i = 1; i < 13; i++) {\n    NSView *view = _uiManager.viewRegistry[@(i)];\n    [view removeFromSuperview];\n  }\n  for (NSView *view in viewsToRemove) {\n    _uiManager.viewRegistry[view.reactTag] = view;\n  }\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTURLUtilsTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <React/RCTUtils.h>\n\n@interface RCTURLUtilsTests : XCTestCase\n\n@end\n\n@implementation RCTURLUtilsTests\n\n- (void)testGetQueryParam\n{\n  NSURL *URL = [NSURL URLWithString:@\"http://example.com?foo=bar&bar=foo\"];\n  NSString *foo = RCTGetURLQueryParam(URL, @\"foo\");\n  NSString *bar = RCTGetURLQueryParam(URL, @\"bar\");\n  XCTAssertEqualObjects(foo, @\"bar\");\n  XCTAssertEqualObjects(bar, @\"foo\");\n}\n\n- (void)testGetEncodedParam\n{\n  NSURL *URL = [NSURL URLWithString:@\"http://example.com?foo=You%20%26%20Me\"];\n  NSString *foo = RCTGetURLQueryParam(URL, @\"foo\");\n  XCTAssertEqualObjects(foo, @\"You & Me\");\n}\n\n- (void)testQueryParamNotFound\n{\n  NSURL *URL = [NSURL URLWithString:@\"http://example.com?foo=bar\"];\n  NSString *bar = RCTGetURLQueryParam(URL, @\"bar\");\n  XCTAssertNil(bar);\n}\n\n- (void)testDuplicateParamTakesLatter\n{\n  NSURL *URL = [NSURL URLWithString:@\"http://example.com?foo=bar&foo=foo\"];\n  NSString *foo = RCTGetURLQueryParam(URL, @\"foo\");\n  XCTAssertEqualObjects(foo, @\"foo\");\n}\n\n- (void)testNilURLGetQueryParam\n{\n  NSURL *URL = nil;\n  NSString *foo = RCTGetURLQueryParam(URL, @\"foo\");\n  XCTAssertNil(foo);\n}\n\n- (void)testReplaceParam\n{\n  NSURL *URL = [NSURL URLWithString:@\"http://example.com?foo=bar&bar=foo\"];\n  NSURL *result = RCTURLByReplacingQueryParam(URL, @\"foo\", @\"foo\");\n  XCTAssertEqualObjects(result.absoluteString, @\"http://example.com?foo=foo&bar=foo\");\n}\n\n- (void)testReplaceEncodedParam\n{\n  NSURL *URL = [NSURL URLWithString:@\"http://example.com?foo=You%20%26%20Me\"];\n  NSURL *result = RCTURLByReplacingQueryParam(URL, @\"foo\", @\"Me & You\");\n  XCTAssertEqualObjects(result.absoluteString, @\"http://example.com?foo=Me%20%26%20You\");\n}\n\n- (void)testAppendParam\n{\n  NSURL *URL = [NSURL URLWithString:@\"http://example.com?bar=foo\"];\n  NSURL *result = RCTURLByReplacingQueryParam(URL, @\"foo\", @\"bar\");\n  XCTAssertEqualObjects(result.absoluteString, @\"http://example.com?bar=foo&foo=bar\");\n}\n\n- (void)testRemoveParam\n{\n  NSURL *URL = [NSURL URLWithString:@\"http://example.com?bar=foo&foo=bar\"];\n  NSURL *result = RCTURLByReplacingQueryParam(URL, @\"bar\", nil);\n  XCTAssertEqualObjects(result.absoluteString, @\"http://example.com?foo=bar\");\n}\n\n- (void)testNilURLAppendQueryParam\n{\n  NSURL *URL = nil;\n  NSURL *result = RCTURLByReplacingQueryParam(URL, @\"foo\", @\"bar\");\n  XCTAssertNil(result);\n}\n\n- (void)testIsLocalAssetsURLParam\n{\n  NSString *libraryAssetsPath = [RCTLibraryPath() stringByAppendingPathComponent:@\"assets/foo.png\"];\n  NSURL *libraryAssetsURL = [NSURL fileURLWithPath:libraryAssetsPath];\n  XCTAssertTrue(RCTIsLocalAssetURL(libraryAssetsURL));\n  NSString *bundleAssetsPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@\"assets/foo.png\"];\n  NSURL *bundleAssetsURL = [NSURL fileURLWithPath:bundleAssetsPath];\n  XCTAssertTrue(RCTIsLocalAssetURL(bundleAssetsURL));\n  NSString *otherAssetsPath = @\"/assets/foo.png\";\n  NSURL *otherAssetsURL = [NSURL fileURLWithPath:otherAssetsPath];\n  XCTAssertFalse(RCTIsLocalAssetURL(otherAssetsURL));\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RCTUnicodeDecodeTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n#import <XCTest/XCTest.h>\n\n#import <React/RCTNetworking.h>\n\nstatic NSString *const niqqudStringB64 = @\"15HWsNa816jWtdeQ16nWtNeB15nXqiwg15HWuNa816jWuNeQINeQ1rHXnNa515TWtNeZ150sINeQ1rXXqiDXlNa316nWuNa814HXnta315nWtNedLCDXldaw15DWtdeqINeU1rjXkNa416jWttelLg==\";\n\n@interface RCTNetworking ()\n\n+ (NSString *)decodeTextData:(NSData *)data fromResponse:(NSURLResponse *)response withCarryData:(NSMutableData *)inputCarryData;\n\n@end\n\n@interface RCTUnicodeDecodeTests : XCTestCase\n\n@end\n\n@implementation RCTUnicodeDecodeTests\n\n- (void)runTestForString:(NSString *)unicodeString usingEncoding:(NSString *)encodingName cutAt:(NSUInteger)cutPoint\n{\n  CFStringEncoding cfEncoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)encodingName);\n  NSStringEncoding encoding = CFStringConvertEncodingToNSStringEncoding(cfEncoding);\n\n  NSData *unicodeBytes = [unicodeString dataUsingEncoding:encoding];\n\n  NSURLResponse *fakeResponse = [[NSHTTPURLResponse alloc] initWithURL:[NSURL URLWithString:@\"testurl://\"]\n                                                            statusCode:200\n                                                           HTTPVersion:@\"1.1\"\n                                                          headerFields:@{@\"content-type\": [NSString stringWithFormat:@\"text/plain; charset=%@\", encodingName]}];\n  XCTAssert([fakeResponse.textEncodingName isEqualToString:encodingName]);\n\n  NSMutableData *carryStorage = [NSMutableData new];\n  NSMutableString *parsedString = [NSMutableString new];\n\n  [parsedString appendString:[RCTNetworking decodeTextData:[unicodeBytes subdataWithRange:NSMakeRange(0, cutPoint)]\n                                              fromResponse:fakeResponse\n                                             withCarryData:carryStorage] ?: @\"\"];\n\n  [parsedString appendString:[RCTNetworking decodeTextData:[unicodeBytes subdataWithRange:NSMakeRange(cutPoint, unicodeBytes.length - cutPoint)]\n                                              fromResponse:fakeResponse\n                                             withCarryData:carryStorage] ?: @\"\"];\n\n  XCTAssert(carryStorage.length == 0);\n  XCTAssert([parsedString isEqualToString:unicodeString]);\n}\n\n- (void)testNiqqud\n{\n  NSString *unicodeString = [[NSString alloc] initWithData:[[NSData alloc] initWithBase64EncodedString:niqqudStringB64\n                                                                                               options:(NSDataBase64DecodingOptions)0]\n                                                  encoding:NSUTF8StringEncoding];\n\n  [self runTestForString:unicodeString usingEncoding:@\"utf-8\" cutAt:25];\n}\n\n- (void)testEmojis\n{\n  NSString *unicodeString = @\"\\U0001F602\\U0001F602\";\n\n  [self runTestForString:unicodeString usingEncoding:@\"utf-8\" cutAt:7];\n}\n\n@end\n"
  },
  {
    "path": "RNTester/RNTesterUnitTests/RNTesterUnitTestsBundle.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RNTesterUnitTestsBundle\n */\n'use strict';\n\nconst __fbBatchedBridge = { // eslint-disable-line no-unused-vars\n  flushedQueue: function() {\n    return null;\n  }\n};\n"
  },
  {
    "path": "RNTester/android/app/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_binary(\n    name = \"app\",\n    keystore = \"//keystores:debug\",\n    manifest = \"src/main/AndroidManifest.xml\",\n    deps = [\n        \":rntester-lib\",\n    ],\n)\n\nandroid_library(\n    name = \"rntester-lib\",\n    srcs = glob([\"src/main/java/**/*.java\"]),\n    deps = [\n        \":res\",\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n        react_native_dep(\"third-party/android/support/v7/appcompat-orig:appcompat\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react:react\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/shell:shell\"),\n        react_native_target(\"jni/prebuilt:android-jsc\"),\n        # .so files are prebuilt by Gradle with `./gradlew :ReactAndroid:packageReactNdkLibsForBuck`\n        react_native_target(\"jni/prebuilt:reactnative-libs\"),\n    ],\n)\n\nandroid_resource(\n    name = \"res\",\n    package = \"com.facebook.react.uiapp\",\n    res = \"src/main/res\",\n)\n"
  },
  {
    "path": "RNTester/android/app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nimport com.android.build.OutputFile\n\n/**\n * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets\n * and bundleReleaseJsAndAssets).\n * These basically call `react-native bundle` with the correct arguments during the Android build\n * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the\n * bundle directly from the development server. Below you can see all the possible configurations\n * and their defaults. If you decide to add a configuration block, make sure to add it before the\n * `apply from: \"react.gradle\"` line.\n *\n * project.ext.react = [\n *   // the name of the generated asset file containing your JS bundle\n *   bundleAssetName: \"index.android.bundle\",\n *\n *   // the entry file for bundle generation\n *   entryFile: \"index.android.js\",\n *\n *   // whether to bundle JS and assets in debug mode\n *   bundleInDebug: false,\n *\n *   // whether to bundle JS and assets in release mode\n *   bundleInRelease: true,\n *\n *   // whether to bundle JS and assets in another build variant (if configured).\n *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants\n *   // The configuration property is in the format 'bundleIn${productFlavor}${buildType}'\n *   // bundleInFreeDebug: true,\n *   // bundleInPaidRelease: true,\n *   // bundleInBeta: true,\n *\n *   // the root of your project, i.e. where \"package.json\" lives\n *   root: \"../../\",\n *\n *   // where to put the JS bundle asset in debug mode\n *   jsBundleDirDebug: \"$buildDir/intermediates/assets/debug\",\n *\n *   // where to put the JS bundle asset in release mode\n *   jsBundleDirRelease: \"$buildDir/intermediates/assets/release\",\n *\n *   // where to put drawable resources / React Native assets, e.g. the ones you use via\n *   // require('./image.png')), in debug mode\n *   resourcesDirDebug: \"$buildDir/intermediates/res/merged/debug\",\n *\n *   // where to put drawable resources / React Native assets, e.g. the ones you use via\n *   // require('./image.png')), in release mode\n *   resourcesDirRelease: \"$buildDir/intermediates/res/merged/release\",\n *\n *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means\n *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to\n *   // date; if you have any other folders that you want to ignore for performance reasons (gradle\n *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/\n *   // for example, you might want to remove it from here.\n *   inputExcludes: [\"android/**\", \"ios/**\"]\n * ]\n */\n\nproject.ext.react = [\n    bundleAssetName: \"RNTesterApp.android.bundle\",\n    entryFile: file(\"../../js/RNTesterApp.android.js\"),\n    root: \"../../../../\",\n    inputExcludes: [\"android/**\", \"./**\"]\n]\n\napply from: \"react.gradle\"\n\n/**\n * Set this to true to create three separate APKs instead of one:\n *   - A universal APK that works on all devices\n *   - An APK that only works on ARM devices\n *   - An APK that only works on x86 devices\n * The advantage is the size of the APK is reduced by about 4MB.\n * Upload all the APKs to the Play Store and people will download\n * the correct one based on the CPU architecture of their device.\n */\ndef enableSeparateBuildPerCPUArchitecture = false\n\n/**\n * Run Proguard to shrink the Java bytecode in release builds.\n */\ndef enableProguardInReleaseBuilds = false\n\nandroid {\n    compileSdkVersion 23\n    buildToolsVersion \"23.0.1\"\n\n    defaultConfig {\n        applicationId \"com.facebook.react.uiapp\"\n        minSdkVersion 16\n        targetSdkVersion 23\n        versionCode 1\n        versionName \"1.0\"\n        ndk {\n            abiFilters \"armeabi-v7a\", \"x86\"\n        }\n    }\n    signingConfigs {\n        release {\n            storeFile file(MYAPP_RELEASE_STORE_FILE)\n            storePassword MYAPP_RELEASE_STORE_PASSWORD\n            keyAlias MYAPP_RELEASE_KEY_ALIAS\n            keyPassword MYAPP_RELEASE_KEY_PASSWORD\n        }\n    }\n    splits {\n        abi {\n            enable enableSeparateBuildPerCPUArchitecture\n            universalApk false\n            reset()\n            include \"armeabi-v7a\", \"x86\"\n        }\n    }\n    buildTypes {\n        release {\n            minifyEnabled enableProguardInReleaseBuilds\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n            signingConfig signingConfigs.release\n        }\n    }\n    // applicationVariants are e.g. debug, release\n    applicationVariants.all { variant ->\n        variant.outputs.each { output ->\n            // For each separate APK per architecture, set a unique version code as described here:\n            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits\n            def versionCodes = [\"armeabi-v7a\":1, \"x86\":2]\n            def abi = output.getFilter(OutputFile.ABI)\n            if (abi != null) {  // null for the universal-debug, universal-release variants\n                output.versionCodeOverride =\n                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode\n            }\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    compile 'com.android.support:appcompat-v7:23.0.1'\n\n    // Build React Native from source\n    compile project(':ReactAndroid')\n}\n"
  },
  {
    "path": "RNTester/android/app/gradle.properties",
    "content": "android.useDeprecatedNdk=true\nMYAPP_RELEASE_STORE_FILE=my-release-key.keystore\nMYAPP_RELEASE_KEY_ALIAS=my-key-alias\nMYAPP_RELEASE_STORE_PASSWORD=*****\nMYAPP_RELEASE_KEY_PASSWORD=*****\n"
  },
  {
    "path": "RNTester/android/app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "RNTester/android/app/react.gradle",
    "content": "import org.apache.tools.ant.taskdefs.condition.Os\n\ndef config = project.hasProperty(\"react\") ? project.react : [];\n\ndef bundleAssetName = config.bundleAssetName ?: \"index.android.bundle\"\ndef entryFile = config.entryFile ?: \"index.android.js\"\n\n// because elvis operator\ndef elvisFile(thing) {\n    return thing ? file(thing) : null;\n}\n\ndef reactRoot = elvisFile(config.root) ?: file(\"../../\")\ndef inputExcludes = config.inputExcludes ?: [\"android/**\", \"ios/**\"]\n\nvoid runBefore(String dependentTaskName, Task task) {\n    Task dependentTask = tasks.findByPath(dependentTaskName);\n    if (dependentTask != null) {\n        dependentTask.dependsOn task\n    }\n}\n\ngradle.projectsEvaluated {\n    // Grab all build types and product flavors\n    def buildTypes = android.buildTypes.collect { type -> type.name }\n    def productFlavors = android.productFlavors.collect { flavor -> flavor.name }\n\n    // When no product flavors defined, use empty\n    if (!productFlavors) productFlavors.add('')\n\n    productFlavors.each { productFlavorName ->\n        buildTypes.each { buildTypeName ->\n            // Create variant and source names\n            def sourceName = \"${buildTypeName}\"\n            def targetName = \"${sourceName.capitalize()}\"\n            if (productFlavorName) {\n                sourceName = \"${productFlavorName}${targetName}\"\n            }\n\n            // React js bundle directories\n            def jsBundleDirConfigName = \"jsBundleDir${targetName}\"\n            def jsBundleDir = elvisFile(config.\"$jsBundleDirConfigName\") ?:\n                    file(\"$buildDir/intermediates/assets/${sourceName}\")\n\n            def resourcesDirConfigName = \"jsBundleDir${targetName}\"\n            def resourcesDir = elvisFile(config.\"${resourcesDirConfigName}\") ?:\n                    file(\"$buildDir/intermediates/res/merged/${sourceName}\")\n            def jsBundleFile = file(\"$jsBundleDir/$bundleAssetName\")\n\n            // Bundle task name for variant\n            def bundleJsAndAssetsTaskName = \"bundle${targetName}JsAndAssets\"\n\n            def currentBundleTask = tasks.create(\n                    name: bundleJsAndAssetsTaskName,\n                    type: Exec) {\n                group = \"react\"\n                description = \"bundle JS and assets for ${targetName}.\"\n\n                // Create dirs if they are not there (e.g. the \"clean\" task just ran)\n                doFirst {\n                    jsBundleDir.mkdirs()\n                    resourcesDir.mkdirs()\n                }\n\n                // Set up inputs and outputs so gradle can cache the result\n                inputs.files fileTree(dir: reactRoot, excludes: inputExcludes)\n                outputs.dir jsBundleDir\n                outputs.dir resourcesDir\n\n                // Set up the call to the react-native cli\n                workingDir reactRoot\n\n                // Set up dev mode\n                def devEnabled = !targetName.toLowerCase().contains(\"release\")\n                if (Os.isFamily(Os.FAMILY_WINDOWS)) {\n                    commandLine \"cmd\", \"/c\", \"node\", \"./local-cli/cli.js\", \"bundle\", \"--platform\", \"android\", \"--dev\", \"${devEnabled}\",\n                            \"--entry-file\", entryFile, \"--bundle-output\", jsBundleFile, \"--assets-dest\", resourcesDir\n                } else {\n                    commandLine \"node\", \"./local-cli/cli.js\", \"bundle\", \"--platform\", \"android\", \"--dev\", \"${devEnabled}\",\n                            \"--entry-file\", entryFile, \"--bundle-output\", jsBundleFile, \"--assets-dest\", resourcesDir\n                }\n\n                enabled config.\"bundleIn${targetName}\" ?: targetName.toLowerCase().contains(\"release\")\n            }\n\n            // Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process\n            currentBundleTask.dependsOn(\"merge${targetName}Resources\")\n            currentBundleTask.dependsOn(\"merge${targetName}Assets\")\n\n            runBefore(\"processArmeabi-v7a${targetName}Resources\", currentBundleTask)\n            runBefore(\"processX86${targetName}Resources\", currentBundleTask)\n            runBefore(\"processUniversal${targetName}Resources\", currentBundleTask)\n            runBefore(\"process${targetName}Resources\", currentBundleTask)\n        }\n    }\n}\n"
  },
  {
    "path": "RNTester/android/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  package=\"com.facebook.react.uiapp\"\n  android:versionCode=\"1\"\n  android:versionName=\"1.0\">\n\n  <uses-permission android:name=\"android.permission.INTERNET\" />\n  <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>\n  <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>\n  <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>\n  <uses-permission android:name=\"android.permission.VIBRATE\"/>\n  <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>\n\n  <!--Just to show permissions example-->\n  <uses-permission android:name=\"android.permission.CAMERA\"/>\n  <uses-permission android:name=\"android.permission.READ_CALENDAR\"/>\n\n  <uses-sdk\n    android:minSdkVersion=\"16\"\n    android:targetSdkVersion=\"23\" />\n\n  <application\n      android:name=\".RNTesterApplication\"\n      android:allowBackup=\"true\"\n      android:icon=\"@drawable/launcher_icon\"\n      android:label=\"@string/app_name\"\n      android:theme=\"@style/Theme.ReactNative.AppCompat.Light\" >\n    <activity\n        android:name=\".RNTesterActivity\"\n        android:label=\"@string/app_name\"\n        android:screenOrientation=\"fullSensor\"\n        android:configChanges=\"orientation|screenSize\" >\n      <intent-filter>\n        <action android:name=\"android.intent.action.MAIN\" />\n        <category android:name=\"android.intent.category.LAUNCHER\" />\n      </intent-filter>\n      <intent-filter>\n        <action android:name=\"android.intent.action.VIEW\" />\n        <category android:name=\"android.intent.category.DEFAULT\" />\n        <category android:name=\"android.intent.category.BROWSABLE\" />\n        <!-- Accepts URIs that begin with \"rntester://example” -->\n        <data android:scheme=\"rntester\" android:host=\"example\" />\n      </intent-filter>\n    </activity>\n    <activity android:name=\"com.facebook.react.devsupport.DevSettingsActivity\" />\n  </application>\n\n</manifest>\n"
  },
  {
    "path": "RNTester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterActivity.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\npackage com.facebook.react.uiapp;\n\nimport android.app.Activity;\nimport android.os.Bundle;\n\nimport com.facebook.react.ReactActivity;\nimport com.facebook.react.ReactActivityDelegate;\n\nimport javax.annotation.Nullable;\n\npublic class RNTesterActivity extends ReactActivity {\n  public static class RNTesterActivityDelegate extends ReactActivityDelegate {\n    private static final String PARAM_ROUTE = \"route\";\n    private Bundle mInitialProps = null;\n    private final @Nullable Activity mActivity;\n\n    public RNTesterActivityDelegate(Activity activity, String mainComponentName) {\n      super(activity, mainComponentName);\n      this.mActivity = activity;\n    }\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n      // Get remote param before calling super which uses it\n      Bundle bundle = mActivity.getIntent().getExtras();\n      if (bundle != null && bundle.containsKey(PARAM_ROUTE)) {\n        String routeUri = new StringBuilder(\"rntester://example/\")\n          .append(bundle.getString(PARAM_ROUTE))\n          .append(\"Example\")\n          .toString();\n        mInitialProps = new Bundle();\n        mInitialProps.putString(\"exampleFromAppetizeParams\", routeUri);\n      }\n      super.onCreate(savedInstanceState);\n    }\n\n    @Override\n    protected Bundle getLaunchOptions() {\n      return mInitialProps;\n    }\n  }\n\n  @Override\n  protected ReactActivityDelegate createReactActivityDelegate() {\n    return new RNTesterActivityDelegate(this, getMainComponentName());\n  }\n\n  @Override\n  protected String getMainComponentName() {\n    return \"RNTesterApp\";\n  }\n}\n"
  },
  {
    "path": "RNTester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\npackage com.facebook.react.uiapp;\n\nimport android.app.Application;\n\nimport com.facebook.react.ReactApplication;\nimport com.facebook.react.ReactNativeHost;\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.shell.MainReactPackage;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport javax.annotation.Nullable;\n\npublic class RNTesterApplication extends Application implements ReactApplication {\n  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {\n    @Override\n    public String getJSMainModuleName() {\n      return \"RNTester/js/RNTesterApp.android\";\n    }\n\n    @Override\n    public @Nullable String getBundleAssetName() {\n      return \"RNTesterApp.android.bundle\";\n    }\n\n    @Override\n    public boolean getUseDeveloperSupport() {\n      return true;\n    }\n\n    @Override\n    public List<ReactPackage> getPackages() {\n      return Arrays.<ReactPackage>asList(\n        new MainReactPackage()\n      );\n    }\n  };\n\n  @Override\n  public ReactNativeHost getReactNativeHost() {\n    return mReactNativeHost;\n  }\n};\n"
  },
  {
    "path": "RNTester/android/app/src/main/res/layout/activity_main.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\".RNTesterApp\">\n\n    <com.facebook.react.ReactRootView\n      android:layout_width=\"match_parent\"\n      android:layout_height=\"match_parent\"\n      android:id=\"@+id/react_root_view\"/>\n\n</RelativeLayout>\n"
  },
  {
    "path": "RNTester/android/app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">RNTester App</string>\n</resources>\n"
  },
  {
    "path": "RNTester/android/app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\">\n        <!-- Customize your theme here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "RNTester/js/ARTExample.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ARTExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  ART,\n  Platform,\n  View,\n} = ReactNative;\n\nconst {\n  Surface,\n  Path,\n  Group,\n  Transform,\n  Shape,\n} = ART;\n\n\nvar scale = Platform.isTVOS ? 4 : 1;\n\nclass ARTExample extends React.Component<{}> {\n    render(){\n        const pathRect = new Path()\n            .moveTo(scale * 0,scale * 0)\n            .lineTo(scale * 0,scale * 110)\n            .lineTo(scale * 110,scale * 110)\n            .lineTo(scale * 110,scale * 0)\n            .close();\n\n        const pathCircle0 = new Path()\n            .moveTo(scale * 30,scale * 5)\n            .arc(scale * 0,scale * 50,scale * 25)\n            .arc(scale * 0,-scale * 50,scale * 25)\n            .close();\n\n        const pathCircle1 = new Path()\n            .moveTo(scale * 30,scale * 55)\n            .arc(scale * 0,scale * 50,scale * 25)\n            .arc(scale * 0,-scale * 50,scale * 25)\n            .close();\n\n        const pathCircle2 = new Path()\n            .moveTo(scale * 55,scale * 30)\n            .arc(scale * 50,scale * 0,scale * 25)\n            .arc(-scale * 50,scale * 0,scale * 25)\n            .close();\n\n        const pathCircle3 = new Path()\n            .moveTo(scale * 55,scale * 80)\n            .arc(scale * 50,scale * 0,scale * 25)\n            .arc(-scale * 50,scale * 0,scale * 25)\n            .close();\n\n        return (\n            <View>\n                <Surface width={scale * 200} height={scale * 200}>\n                    <Group>\n                        <Shape d={pathRect} stroke=\"#000080\" fill=\"#000080\" strokeWidth={scale}/>\n                        <Shape d={pathCircle0} stroke=\"#FF0000\" fill=\"#FF0000\" strokeWidth={scale}/>\n                        <Shape d={pathCircle1} stroke=\"#00FF00\" fill=\"#00FF00\" strokeWidth={scale}/>\n                        <Shape d={pathCircle2} stroke=\"#00FFFF\" fill=\"#00FFFF\" strokeWidth={scale}/>\n                        <Shape d={pathCircle3} stroke=\"#FFFFFF\" fill=\"#FFFFFF\" strokeWidth={scale}/>\n                    </Group>\n                </Surface>\n            </View>\n        );\n    }\n}\n\nexports.title = '<ART>';\nexports.displayName = 'ARTExample';\nexports.description = 'ART input for numeric values';\nexports.examples = [\n  {\n    title: 'ART Example',\n    render(): React.Element<any> {\n      return <ARTExample />;\n    }\n  },\n];\n"
  },
  {
    "path": "RNTester/js/AccessibilityAndroidExample.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AccessibilityAndroidExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  AccessibilityInfo,\n  StyleSheet,\n  Text,\n  View,\n  ToastAndroid,\n  TouchableWithoutFeedback,\n} = ReactNative;\n\nvar RNTesterBlock = require('./RNTesterBlock');\nvar RNTesterPage = require('./RNTesterPage');\n\nvar importantForAccessibilityValues = ['auto', 'yes', 'no', 'no-hide-descendants'];\n\nclass AccessibilityAndroidExample extends React.Component {\n  static title = 'Accessibility';\n  static description = 'Examples of using Accessibility API.';\n\n  state = {\n    count: 0,\n    backgroundImportantForAcc: 0,\n    forgroundImportantForAcc: 0,\n    screenReaderEnabled: false,\n  };\n\n  componentDidMount() {\n    AccessibilityInfo.addEventListener(\n      'change',\n      this._handleScreenReaderToggled\n    );\n    AccessibilityInfo.fetch().done((isEnabled) => {\n      this.setState({\n        screenReaderEnabled: isEnabled\n      });\n    });\n  }\n\n  componentWillUnmount() {\n    AccessibilityInfo.removeEventListener(\n      'change',\n      this._handleScreenReaderToggled\n    );\n  }\n\n  _handleScreenReaderToggled = (isEnabled) => {\n    this.setState({\n      screenReaderEnabled: isEnabled,\n    });\n  }\n\n  _addOne = () => {\n    this.setState({\n      count: ++this.state.count,\n    });\n  };\n\n  _changeBackgroundImportantForAcc = () => {\n    this.setState({\n      backgroundImportantForAcc: (this.state.backgroundImportantForAcc + 1) % 4,\n    });\n  };\n\n  _changeForgroundImportantForAcc = () => {\n    this.setState({\n      forgroundImportantForAcc: (this.state.forgroundImportantForAcc + 1) % 4,\n    });\n  };\n\n  render() {\n    return (\n      <RNTesterPage title={'Accessibility'}>\n\n        <RNTesterBlock title=\"Nonaccessible view with TextViews\">\n          <View>\n            <Text style={{color: 'green',}}>\n              This is\n            </Text>\n            <Text style={{color: 'blue'}}>\n              nontouchable normal view.\n            </Text>\n          </View>\n        </RNTesterBlock>\n\n        <RNTesterBlock title=\"Accessible view with TextViews wihout label\">\n          <View accessible={true}>\n            <Text style={{color: 'green',}}>\n              This is\n            </Text>\n            <Text style={{color: 'blue'}}>\n              nontouchable accessible view without label.\n            </Text>\n          </View>\n        </RNTesterBlock>\n\n        <RNTesterBlock title=\"Accessible view with TextViews with label\">\n          <View accessible={true}\n            accessibilityLabel=\"I have label, so I read it instead of embedded text.\">\n            <Text style={{color: 'green',}}>\n              This is\n            </Text>\n            <Text style={{color: 'blue'}}>\n              nontouchable accessible view with label.\n            </Text>\n          </View>\n        </RNTesterBlock>\n\n        <RNTesterBlock title=\"Touchable with component type = button\">\n          <TouchableWithoutFeedback\n            onPress={() => ToastAndroid.show('Toasts work by default', ToastAndroid.SHORT)}\n            accessibilityComponentType=\"button\">\n            <View style={styles.embedded}>\n              <Text>Click me</Text>\n              <Text>Or not</Text>\n            </View>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n\n        <RNTesterBlock title=\"LiveRegion\">\n          <TouchableWithoutFeedback onPress={this._addOne}>\n            <View style={styles.embedded}>\n              <Text>Click me</Text>\n            </View>\n          </TouchableWithoutFeedback>\n          <Text accessibilityLiveRegion=\"polite\">\n            Clicked {this.state.count} times\n          </Text>\n        </RNTesterBlock>\n\n        <RNTesterBlock title=\"Check if the screen reader is enabled\">\n          <Text>\n            The screen reader is {this.state.screenReaderEnabled ? 'enabled' : 'disabled'}.\n          </Text>\n        </RNTesterBlock>\n\n        <RNTesterBlock title=\"Overlapping views and importantForAccessibility property\">\n          <View style={styles.container}>\n            <View\n              style={{\n                position: 'absolute',\n                left: 10,\n                top: 10,\n                right: 10,\n                height: 100,\n                backgroundColor: 'green'}}\n              accessible={true}\n              accessibilityLabel=\"First layout\"\n              importantForAccessibility={\n                importantForAccessibilityValues[this.state.backgroundImportantForAcc]}>\n              <View accessible={true}>\n                <Text style={{fontSize: 25}}>\n                  Hello\n                </Text>\n              </View>\n            </View>\n            <View\n              style={{\n                position: 'absolute',\n                left: 10,\n                top: 25,\n                right: 10,\n                height: 110,\n                backgroundColor: 'yellow', opacity: 0.5}}\n              accessible={true}\n              accessibilityLabel=\"Second layout\"\n              importantForAccessibility={\n                importantForAccessibilityValues[this.state.forgroundImportantForAcc]}>\n              <View accessible={true}>\n                <Text style={{fontSize: 20}}>\n                  world\n                </Text>\n              </View>\n            </View>\n          </View>\n          <TouchableWithoutFeedback onPress={this._changeBackgroundImportantForAcc}>\n            <View style={styles.embedded}>\n              <Text>\n                Change importantForAccessibility for background layout.\n              </Text>\n            </View>\n          </TouchableWithoutFeedback>\n          <View accessible={true}>\n            <Text>\n              Background layout importantForAccessibility\n            </Text>\n            <Text>\n              {importantForAccessibilityValues[this.state.backgroundImportantForAcc]}\n            </Text>\n          </View>\n          <TouchableWithoutFeedback onPress={this._changeForgroundImportantForAcc}>\n            <View style={styles.embedded}>\n              <Text>\n                Change importantForAccessibility for forground layout.\n              </Text>\n            </View>\n          </TouchableWithoutFeedback>\n          <View accessible={true}>\n            <Text>\n              Forground layout importantForAccessibility\n            </Text>\n            <Text>\n              {importantForAccessibilityValues[this.state.forgroundImportantForAcc]}\n            </Text>\n          </View>\n        </RNTesterBlock>\n\n      </RNTesterPage>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n   embedded: {\n    backgroundColor: 'yellow',\n    padding:10,\n  },\n  container: {\n    flex: 1,\n    backgroundColor: 'white',\n    padding: 10,\n    height:150,\n  },\n});\n\nmodule.exports = AccessibilityAndroidExample;\n"
  },
  {
    "path": "RNTester/js/AccessibilityIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule AccessibilityIOSExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  AccessibilityInfo,\n  Text,\n  View,\n} = ReactNative;\n\nclass AccessibilityIOSExample extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <View\n          onAccessibilityTap={() => alert('onAccessibilityTap success')}\n          accessible={true}>\n          <Text>\n            Accessibility normal tap example\n          </Text>\n        </View>\n        <View onMagicTap={() => alert('onMagicTap success')}\n              accessible={true}>\n          <Text>\n            Accessibility magic tap example\n          </Text>\n        </View>\n        <View accessibilityLabel=\"Some announcement\"\n              accessible={true}>\n          <Text>\n            Accessibility label example\n          </Text>\n        </View>\n        <View accessibilityTraits={['button', 'selected']}\n              accessible={true}>\n          <Text>\n            Accessibility traits example\n          </Text>\n        </View>\n        <Text>\n          Text's accessibilityLabel is the raw text itself unless it is set explicitly.\n        </Text>\n        <Text accessibilityLabel=\"Test of accessibilityLabel\"\n          accessible={true}>\n          This text component's accessibilityLabel is set explicitly.\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass ScreenReaderStatusExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    screenReaderEnabled: false,\n  }\n\n  componentDidMount() {\n    AccessibilityInfo.addEventListener(\n      'change',\n      this._handleScreenReaderToggled\n    );\n    AccessibilityInfo.fetch().done((isEnabled) => {\n      this.setState({\n        screenReaderEnabled: isEnabled\n      });\n    });\n  }\n\n  componentWillUnmount() {\n    AccessibilityInfo.removeEventListener(\n      'change',\n      this._handleScreenReaderToggled\n    );\n  }\n\n  _handleScreenReaderToggled = (isEnabled) => {\n    this.setState({\n      screenReaderEnabled: isEnabled,\n    });\n  }\n\n  render() {\n    return (\n      <View>\n        <Text>\n          The screen reader is {this.state.screenReaderEnabled ? 'enabled' : 'disabled'}.\n        </Text>\n      </View>\n    );\n  }\n}\n\nexports.title = 'AccessibilityIOS';\nexports.description = 'Interface to show iOS\\' accessibility samples';\nexports.examples = [\n  {\n    title: 'Accessibility elements',\n    render(): React.Element<any> { return <AccessibilityIOSExample />; }\n  },\n  {\n    title: 'Check if the screen reader is enabled',\n    render(): React.Element<any> { return <ScreenReaderStatusExample />; }\n  },\n];\n"
  },
  {
    "path": "RNTester/js/ActionSheetIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ActionSheetIOSExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  ActionSheetIOS,\n  StyleSheet,\n  takeSnapshot,\n  Text,\n  View,\n} = ReactNative;\n\nvar BUTTONS = [\n  'Option 0',\n  'Option 1',\n  'Option 2',\n  'Delete',\n  'Cancel',\n];\nvar DESTRUCTIVE_INDEX = 3;\nvar CANCEL_INDEX = 4;\n\nclass ActionSheetExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    clicked: 'none',\n  };\n\n  render() {\n    return (\n      <View>\n        <Text onPress={this.showActionSheet} style={style.button}>\n          Click to show the ActionSheet\n        </Text>\n        <Text>\n          Clicked button: {this.state.clicked}\n        </Text>\n      </View>\n    );\n  }\n\n  showActionSheet = () => {\n    ActionSheetIOS.showActionSheetWithOptions({\n      options: BUTTONS,\n      cancelButtonIndex: CANCEL_INDEX,\n      destructiveButtonIndex: DESTRUCTIVE_INDEX,\n    },\n    (buttonIndex) => {\n      this.setState({ clicked: BUTTONS[buttonIndex] });\n    });\n  };\n}\n\nclass ActionSheetTintExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    clicked: 'none',\n  };\n\n  render() {\n    return (\n      <View>\n        <Text onPress={this.showActionSheet} style={style.button}>\n          Click to show the ActionSheet\n        </Text>\n        <Text>\n          Clicked button: {this.state.clicked}\n        </Text>\n      </View>\n    );\n  }\n\n  showActionSheet = () => {\n    ActionSheetIOS.showActionSheetWithOptions({\n      options: BUTTONS,\n      cancelButtonIndex: CANCEL_INDEX,\n      destructiveButtonIndex: DESTRUCTIVE_INDEX,\n      tintColor: 'green',\n    },\n    (buttonIndex) => {\n      this.setState({ clicked: BUTTONS[buttonIndex] });\n    });\n  };\n}\n\nclass ShareActionSheetExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  state = {\n    text: ''\n  };\n\n  render() {\n    return (\n      <View>\n        <Text onPress={this.showShareActionSheet} style={style.button}>\n          Click to show the Share ActionSheet\n        </Text>\n        <Text>\n          {this.state.text}\n        </Text>\n      </View>\n    );\n  }\n\n  showShareActionSheet = () => {\n    ActionSheetIOS.showShareActionSheetWithOptions({\n      url: this.props.url,\n      message: 'message to go with the shared url',\n      subject: 'a subject to go in the email heading',\n      excludedActivityTypes: [\n        'com.apple.UIKit.activity.PostToTwitter'\n      ]\n    },\n    (error) => alert(error),\n    (completed, method) => {\n      var text;\n      if (completed) {\n        text = `Shared via ${method}`;\n      } else {\n        text = 'You didn\\'t share';\n      }\n      this.setState({text});\n    });\n  };\n}\n\nclass ShareScreenshotExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    text: ''\n  };\n\n  render() {\n    return (\n      <View>\n        <Text onPress={this.showShareActionSheet} style={style.button}>\n          Click to show the Share ActionSheet\n        </Text>\n        <Text>\n          {this.state.text}\n        </Text>\n      </View>\n    );\n  }\n\n  showShareActionSheet = () => {\n    // Take the snapshot (returns a temp file uri)\n    takeSnapshot('window').then((uri) => {\n      // Share image data\n      ActionSheetIOS.showShareActionSheetWithOptions({\n        url: uri,\n        excludedActivityTypes: [\n          'com.apple.UIKit.activity.PostToTwitter'\n        ]\n      },\n      (error) => alert(error),\n      (completed, method) => {\n        var text;\n        if (completed) {\n          text = `Shared via ${method}`;\n        } else {\n          text = 'You didn\\'t share';\n        }\n        this.setState({text});\n      });\n    }).catch((error) => alert(error));\n  };\n}\n\nvar style = StyleSheet.create({\n  button: {\n    marginBottom: 10,\n    fontWeight: '500',\n  }\n});\n\nexports.title = 'ActionSheetIOS';\nexports.description = 'Interface to show iOS\\' action sheets';\nexports.examples = [\n  {\n    title: 'Show Action Sheet',\n    render(): React.Element<any> { return <ActionSheetExample />; }\n  },\n  {\n    title: 'Show Action Sheet with tinted buttons',\n    render(): React.Element<any> { return <ActionSheetTintExample />; }\n  },\n  {\n    title: 'Show Share Action Sheet',\n    render(): React.Element<any> {\n      return <ShareActionSheetExample url=\"https://code.facebook.com\" />;\n    }\n  },\n  {\n    title: 'Share Local Image',\n    render(): React.Element<any> {\n      return <ShareActionSheetExample url=\"bunny.png\" />;\n    }\n  },\n  {\n    title: 'Share Screenshot',\n    render(): React.Element<any> {\n      return <ShareScreenshotExample />;\n    }\n  }\n];\n"
  },
  {
    "path": "RNTester/js/ActivityIndicatorExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ActivityIndicatorExample\n */\n'use strict';\n\nimport React, { Component } from 'react';\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\n\n/**\n * Optional Flowtype state and timer types definition\n */\ntype State = { animating: boolean; };\ntype Timer = number;\n\nclass ToggleAnimatingActivityIndicator extends Component<$FlowFixMeProps, State> {\n  _timer: Timer;\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      animating: true,\n    };\n  }\n\n  componentDidMount() {\n    this.setToggleTimeout();\n  }\n\n  componentWillUnmount() {\n    /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n     * error found when Flow v0.63 was deployed. To see the error delete this\n     * comment and run Flow. */\n    clearTimeout(this._timer);\n  }\n\n  setToggleTimeout() {\n    /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n     * error found when Flow v0.63 was deployed. To see the error delete this\n     * comment and run Flow. */\n    this._timer = setTimeout(() => {\n      this.setState({animating: !this.state.animating});\n      this.setToggleTimeout();\n    }, 2000);\n  }\n\n  render() {\n    return (\n      <ActivityIndicator\n        animating={this.state.animating}\n        style={[styles.centering, {height: 80}]}\n        size=\"large\"\n      />\n    );\n  }\n}\n\n\n\nexports.displayName = (undefined: ?string);\nexports.framework = 'React';\nexports.title = '<ActivityIndicator>';\nexports.description = 'Animated loading indicators.';\n\nexports.examples = [\n  {\n    title: 'Default (small, white)',\n    render() {\n      return (\n        <ActivityIndicator\n          style={[styles.centering, styles.gray]}\n          color=\"white\"\n        />\n      );\n    }\n  },\n  {\n    title: 'Gray',\n    render() {\n      return (\n        <View>\n          <ActivityIndicator\n            style={[styles.centering]}\n          />\n          <ActivityIndicator\n            style={[styles.centering, {backgroundColor: '#eeeeee'}]}\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Custom colors',\n    render() {\n      return (\n        <View style={styles.horizontal}>\n          <ActivityIndicator color=\"#0000ff\" />\n          <ActivityIndicator color=\"#aa00aa\" />\n          <ActivityIndicator color=\"#aa3300\" />\n          <ActivityIndicator color=\"#00aa00\" />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Large',\n    render() {\n      return (\n        <ActivityIndicator\n          style={[styles.centering, styles.gray]}\n          size=\"large\"\n          color=\"white\"\n        />\n      );\n    }\n  },\n  {\n    title: 'Large, custom colors',\n    render() {\n      return (\n        <View style={styles.horizontal}>\n          <ActivityIndicator\n            size=\"large\"\n            color=\"#0000ff\"\n          />\n          <ActivityIndicator\n            size=\"large\"\n            color=\"#aa00aa\"\n          />\n          <ActivityIndicator\n            size=\"large\"\n            color=\"#aa3300\"\n          />\n          <ActivityIndicator\n            size=\"large\"\n            color=\"#00aa00\"\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Start/stop',\n    render() {\n      return <ToggleAnimatingActivityIndicator />;\n    }\n  },\n  {\n    title: 'Custom size',\n    render() {\n      return (\n        <ActivityIndicator\n          style={[styles.centering, {transform: [{scale: 1.5}]}]}\n          size=\"large\"\n        />\n      );\n    }\n  },\n  {\n    platform: 'android',\n    title: 'Custom size (size: 75)',\n    render() {\n      return (\n        <ActivityIndicator\n          style={styles.centering}\n          size={75}\n        />\n      );\n    }\n  },\n];\n\n\nconst styles = StyleSheet.create({\n  centering: {\n    alignItems: 'center',\n    justifyContent: 'center',\n    padding: 8,\n  },\n  gray: {\n    backgroundColor: '#cccccc',\n  },\n  horizontal: {\n    flexDirection: 'row',\n    justifyContent: 'space-around',\n    padding: 8,\n  },\n});\n"
  },
  {
    "path": "RNTester/js/AlertExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AlertExample\n */\n\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Alert,\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  View,\n} = ReactNative;\n\nvar RNTesterBlock = require('./RNTesterBlock');\n\n// corporate ipsum > lorem ipsum\nvar alertMessage = 'Credibly reintermediate next-generation potentialities after goal-oriented ' +\n                   'catalysts for change. Dynamically revolutionize.';\n\n/**\n * Simple alert examples.\n */\nclass SimpleAlertExampleBlock extends React.Component {\n  render() {\n    return (\n      <View>\n        <TouchableHighlight style={styles.wrapper}\n          onPress={() => Alert.alert(\n            'Alert Title',\n            alertMessage,\n          )}>\n          <View style={styles.button}>\n            <Text>Alert with message and default button</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight style={styles.wrapper}\n          onPress={() => Alert.alert(\n            'Alert Title',\n            alertMessage,\n            [\n              {text: 'OK', onPress: () => console.log('OK Pressed!')},\n            ]\n          )}>\n          <View style={styles.button}>\n            <Text>Alert with one button</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight style={styles.wrapper}\n          onPress={() => Alert.alert(\n            'Alert Title',\n            alertMessage,\n            [\n              {text: 'Cancel', onPress: () => console.log('Cancel Pressed!')},\n              {text: 'OK', onPress: () => console.log('OK Pressed!')},\n            ]\n          )}>\n          <View style={styles.button}>\n            <Text>Alert with two buttons</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight style={styles.wrapper}\n          onPress={() => Alert.alert(\n            'Alert Title',\n            null,\n            [\n              {text: 'Foo', onPress: () => console.log('Foo Pressed!')},\n              {text: 'Bar', onPress: () => console.log('Bar Pressed!')},\n              {text: 'Baz', onPress: () => console.log('Baz Pressed!')},\n            ]\n          )}>\n          <View style={styles.button}>\n            <Text>Alert with three buttons</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight style={styles.wrapper}\n          onPress={() => Alert.alert(\n            'Foo Title',\n            alertMessage,\n            '..............'.split('').map((dot, index) => ({\n              text: 'Button ' + index,\n              onPress: () => console.log('Pressed ' + index)\n            }))\n          )}>\n          <View style={styles.button}>\n            <Text>Alert with too many buttons</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight style={styles.wrapper}\n          onPress={() => Alert.alert(\n            'Alert Title',\n            null,\n            [\n              {text: 'OK', onPress: () => console.log('OK Pressed!')},\n            ],\n            {\n              cancelable: false\n            }\n          )}>\n          <View style={styles.button}>\n            <Text>Alert that cannot be dismissed</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight style={styles.wrapper}\n          onPress={() => Alert.alert(\n            '',\n            alertMessage,\n            [\n              {text: 'OK', onPress: () => console.log('OK Pressed!')},\n            ]\n          )}>\n          <View style={styles.button}>\n            <Text>Alert without title</Text>\n          </View>\n        </TouchableHighlight>\n      </View>\n    );\n  }\n}\n\nclass AlertExample extends React.Component {\n  static title = 'Alert';\n\n  static description = 'Alerts display a concise and informative message ' +\n  'and prompt the user to make a decision.';\n\n  render() {\n    return (\n      <RNTesterBlock title={'Alert'}>\n        <SimpleAlertExampleBlock />\n      </RNTesterBlock>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  wrapper: {\n    borderRadius: 5,\n    marginBottom: 5,\n  },\n  button: {\n    backgroundColor: '#eeeeee',\n    padding: 10,\n  },\n});\n\nmodule.exports = {\n  AlertExample,\n  SimpleAlertExampleBlock,\n};\n"
  },
  {
    "path": "RNTester/js/AlertIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule AlertIOSExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  View,\n  Text,\n  TouchableHighlight,\n  AlertIOS,\n} = ReactNative;\n\nvar { SimpleAlertExampleBlock } = require('./AlertExample');\n\nexports.framework = 'React';\nexports.title = 'AlertIOS';\nexports.description = 'iOS alerts and action sheets';\nexports.examples = [{\n  title: 'Alerts',\n  render() {\n    return <SimpleAlertExampleBlock />;\n  }\n},\n{\n  title: 'Prompt Options',\n  render(): React.Element<any> {\n    return <PromptOptions />;\n  }\n},\n{\n  title: 'Prompt Types',\n  render() {\n    return (\n      <View>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Plain Text Entry')}>\n\n          <View style={styles.button}>\n            <Text>\n              plain-text\n            </Text>\n          </View>\n\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Secure Text', null, null, 'secure-text')}>\n\n          <View style={styles.button}>\n            <Text>\n              secure-text\n            </Text>\n          </View>\n\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Login & Password', null, null, 'login-password')}>\n\n          <View style={styles.button}>\n            <Text>\n              login-password\n            </Text>\n          </View>\n\n        </TouchableHighlight>\n      </View>\n    );\n  }\n}];\n\nclass PromptOptions extends React.Component<$FlowFixMeProps, any> {\n  customButtons: Array<Object>;\n\n  constructor(props) {\n    super(props);\n\n    // $FlowFixMe this seems to be a Flow bug, `saveResponse` is defined below\n    this.saveResponse = this.saveResponse.bind(this);\n\n    this.customButtons = [{\n      text: 'Custom OK',\n      onPress: this.saveResponse\n    }, {\n      text: 'Custom Cancel',\n      style: 'cancel',\n    }];\n\n    this.state = {\n      promptValue: undefined,\n    };\n  }\n\n  render() {\n    return (\n      <View>\n        <Text style={{marginBottom: 10}}>\n          <Text style={{fontWeight: 'bold'}}>Prompt value:</Text> {this.state.promptValue}\n        </Text>\n\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Type a value', null, this.saveResponse)}>\n\n          <View style={styles.button}>\n            <Text>\n              prompt with title & callback\n            </Text>\n          </View>\n        </TouchableHighlight>\n\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Type a value', null, this.customButtons)}>\n\n          <View style={styles.button}>\n            <Text>\n              prompt with title & custom buttons\n            </Text>\n          </View>\n        </TouchableHighlight>\n\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Type a phone number', null, null, 'plain-text', undefined, 'phone-pad')}>\n\n          <View style={styles.button}>\n            <Text>\n              prompt with title & custom keyboard\n            </Text>\n          </View>\n        </TouchableHighlight>\n\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Type a value', null, this.saveResponse, undefined, 'Default value')}>\n\n          <View style={styles.button}>\n            <Text>\n              prompt with title, callback & default value\n            </Text>\n          </View>\n        </TouchableHighlight>\n\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Type a value', null, this.customButtons, 'login-password', 'admin@site.com')}>\n\n          <View style={styles.button}>\n            <Text>\n              prompt with title, custom buttons, login/password & default value\n            </Text>\n          </View>\n        </TouchableHighlight>\n      </View>\n    );\n  }\n\n  saveResponse(promptValue) {\n    this.setState({ promptValue: JSON.stringify(promptValue) });\n  }\n}\n\nvar styles = StyleSheet.create({\n  wrapper: {\n    borderRadius: 5,\n    marginBottom: 5,\n  },\n  button: {\n    backgroundColor: '#eeeeee',\n    padding: 10,\n  },\n});\n"
  },
  {
    "path": "RNTester/js/AlertOSXExample.js",
    "content": "/**\n * The examples provided by Facebook are for non-commercial testing and\n * evaluation purposes only.\n *\n * Facebook reserves all rights not expressly granted.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL\n * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  View,\n  Text,\n  TouchableHighlight,\n  AlertIOS,\n} = ReactNative;\n\nvar { SimpleAlertExampleBlock } = require('./AlertExample');\n\nexports.framework = 'React';\nexports.title = 'AlertIOS';\nexports.description = 'iOS alerts and action sheets';\nexports.examples = [{\n  title: 'Alerts',\n  render() {\n    return <SimpleAlertExampleBlock />;\n  }\n},\n{\n  title: 'Prompt Options',\n  render() {\n    return <PromptOptions />;\n  }\n},\n{\n  title: 'Prompt Types',\n  render() {\n    return (\n      <View>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Plain Text Entry')}>\n\n          <View style={styles.button}>\n            <Text>\n              plain-text\n            </Text>\n          </View>\n\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Secure Text', null, null, 'secure-text')}>\n\n          <View style={styles.button}>\n            <Text>\n              secure-text\n            </Text>\n          </View>\n\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Login & Password', null, null, 'login-password')}>\n\n          <View style={styles.button}>\n            <Text>\n              login-password\n            </Text>\n          </View>\n\n        </TouchableHighlight>\n      </View>\n    );\n  }\n}];\n\nclass PromptOptions extends React.Component {\n  state: any;\n  customButtons: Array<Object>;\n  saveResponse: Function;\n  constructor(props) {\n    super(props);\n\n    this.saveResponse = this.saveResponse.bind(this);\n\n    this.customButtons = [{\n      text: 'Custom OK',\n      onPress: this.saveResponse\n    }, {\n      text: 'Custom Cancel',\n      style: 'cancel',\n    }];\n\n    this.state = {\n      promptValue: undefined,\n    };\n  }\n\n  render() {\n    return (\n      <View>\n        <Text style={{marginBottom: 10}}>\n          <Text style={{fontWeight: 'bold'}}>Prompt value:</Text> {this.state.promptValue}\n        </Text>\n\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Type a value', null, this.saveResponse)}>\n\n          <View style={styles.button}>\n            <Text>\n              prompt with title & callback\n            </Text>\n          </View>\n        </TouchableHighlight>\n\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Type a value', null, this.customButtons)}>\n\n          <View style={styles.button}>\n            <Text>\n              prompt with title & custom buttons\n            </Text>\n          </View>\n        </TouchableHighlight>\n\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Type a value', null, this.saveResponse, undefined, 'Default value')}>\n\n          <View style={styles.button}>\n            <Text>\n              prompt with title, callback & default value\n            </Text>\n          </View>\n        </TouchableHighlight>\n\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => AlertIOS.prompt('Type a value', null, this.customButtons, 'login-password', 'admin@site.com')}>\n\n          <View style={styles.button}>\n            <Text>\n              prompt with title, custom buttons, login/password & default value\n            </Text>\n          </View>\n        </TouchableHighlight>\n      </View>\n    );\n  }\n\n  saveResponse(promptValue) {\n    this.setState({ promptValue: JSON.stringify(promptValue) });\n  }\n}\n\nvar styles = StyleSheet.create({\n  wrapper: {\n    borderRadius: 5,\n    marginBottom: 5,\n  },\n  button: {\n    backgroundColor: '#eeeeee',\n    padding: 10,\n  },\n});\n"
  },
  {
    "path": "RNTester/js/AnimatedExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule AnimatedExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Animated,\n  Easing,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\nvar RNTesterButton = require('./RNTesterButton');\n\nexports.framework = 'React';\nexports.title = 'Animated - Examples';\nexports.description = 'Animated provides a powerful ' +\n  'and easy-to-use API for building modern, ' +\n  'interactive user experiences.';\n\nexports.examples = [\n  {\n    title: 'FadeInView',\n    description: 'Uses a simple timing animation to ' +\n      'bring opacity from 0 to 1 when the component ' +\n      'mounts.',\n    render: function() {\n      class FadeInView extends React.Component<$FlowFixMeProps, any> {\n        constructor(props) {\n          super(props);\n          this.state = {\n            fadeAnim: new Animated.Value(0), // opacity 0\n          };\n        }\n        componentDidMount() {\n          Animated.timing(       // Uses easing functions\n            this.state.fadeAnim, // The value to drive\n            {\n              toValue: 1,        // Target\n              duration: 2000,    // Configuration\n            },\n          ).start();             // Don't forget start!\n        }\n        render() {\n          return (\n            <Animated.View   // Special animatable View\n              style={{\n                opacity: this.state.fadeAnim,  // Binds\n              }}>\n              {this.props.children}\n            </Animated.View>\n          );\n        }\n      }\n      class FadeInExample extends React.Component<$FlowFixMeProps, any> {\n        constructor(props) {\n          super(props);\n          this.state = {\n            show: true,\n          };\n        }\n        render() {\n          return (\n            <View>\n              <RNTesterButton onPress={() => {\n                  this.setState((state) => (\n                    {show: !state.show}\n                  ));\n                }}>\n                Press to {this.state.show ?\n                  'Hide' : 'Show'}\n              </RNTesterButton>\n              {this.state.show && <FadeInView>\n                <View style={styles.content}>\n                  <Text>FadeInView</Text>\n                </View>\n              </FadeInView>}\n            </View>\n          );\n        }\n      }\n      return <FadeInExample />;\n    },\n  },\n  {\n    title: 'Transform Bounce',\n    description: 'One `Animated.Value` is driven by a ' +\n      'spring with custom constants and mapped to an ' +\n      'ordered set of transforms.  Each transform has ' +\n      'an interpolation to convert the value into the ' +\n      'right range and units.',\n    render: function() {\n      this.anim = this.anim || new Animated.Value(0);\n      return (\n        <View>\n          <RNTesterButton onPress={() => {\n            Animated.spring(this.anim, {\n              toValue: 0,   // Returns to the start\n              velocity: 3,  // Velocity makes it move\n              tension: -10, // Slow\n              friction: 1,  // Oscillate a lot\n            }).start(); }}>\n            Press to Fling it!\n          </RNTesterButton>\n          <Animated.View\n            style={[styles.content, {\n              transform: [   // Array order matters\n                {scale: this.anim.interpolate({\n                  inputRange: [0, 1],\n                  outputRange: [1, 4],\n                })},\n                {translateX: this.anim.interpolate({\n                  inputRange: [0, 1],\n                  outputRange: [0, 500],\n                })},\n                {rotate: this.anim.interpolate({\n                  inputRange: [0, 1],\n                  outputRange: [\n                    '0deg', '360deg' // 'deg' or 'rad'\n                  ],\n                })},\n              ]}\n            ]}>\n            <Text>Transforms!</Text>\n          </Animated.View>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Composite Animations with Easing',\n    description: 'Sequence, parallel, delay, and ' +\n      'stagger with different easing functions.',\n    render: function() {\n      this.anims = this.anims || [1,2,3].map(\n        () => new Animated.Value(0)\n      );\n      return (\n        <View>\n          <RNTesterButton onPress={() => {\n            var timing = Animated.timing;\n            Animated.sequence([ // One after the other\n              timing(this.anims[0], {\n                toValue: 200,\n                easing: Easing.linear,\n              }),\n              Animated.delay(400), // Use with sequence\n              timing(this.anims[0], {\n                toValue: 0,\n                easing: Easing.elastic(2), // Springy\n              }),\n              Animated.delay(400),\n              Animated.stagger(200,\n                this.anims.map((anim) => timing(\n                  anim, {toValue: 200}\n                )).concat(\n                this.anims.map((anim) => timing(\n                  anim, {toValue: 0}\n                ))),\n              ),\n              Animated.delay(400),\n              Animated.parallel([\n                Easing.inOut(Easing.quad), // Symmetric\n                Easing.back(1.5),  // Goes backwards first\n                Easing.ease        // Default bezier\n              ].map((easing, ii) => (\n                timing(this.anims[ii], {\n                  toValue: 320, easing, duration: 3000,\n                })\n              ))),\n              Animated.delay(400),\n              Animated.stagger(200,\n                this.anims.map((anim) => timing(anim, {\n                  toValue: 0,\n                  easing: Easing.bounce, // Like a ball\n                  duration: 2000,\n                })),\n              ),\n            ]).start(); }}>\n            Press to Animate\n          </RNTesterButton>\n          {['Composite', 'Easing', 'Animations!'].map(\n            (text, ii) => (\n              <Animated.View\n                key={text}\n                style={[styles.content, {\n                  left: this.anims[ii]\n                }]}>\n                <Text>{text}</Text>\n              </Animated.View>\n            )\n          )}\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Continuous Interactions',\n    description: 'Gesture events, chaining, 2D ' +\n      'values, interrupting and transitioning ' +\n      'animations, etc.',\n    render: () => (\n      <Text>Checkout the Gratuitous Animation App!</Text>\n    ),\n  }\n];\n\nvar styles = StyleSheet.create({\n  content: {\n    backgroundColor: 'deepskyblue',\n    borderWidth: 1,\n    borderColor: 'dodgerblue',\n    padding: 20,\n    margin: 20,\n    borderRadius: 10,\n    alignItems: 'center',\n  },\n});\n"
  },
  {
    "path": "RNTester/js/AnimatedGratuitousApp/AnExApp.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnExApp\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Animated,\n  LayoutAnimation,\n  PanResponder,\n  StyleSheet,\n  View,\n} = ReactNative;\n\nvar AnExSet = require('AnExSet');\n\nvar CIRCLE_SIZE = 80;\nvar CIRCLE_MARGIN = 18;\nvar NUM_CIRCLES = 30;\n\nclass Circle extends React.Component<any, any> {\n  longTimer: number;\n\n  _onLongPress: () => void;\n  _toggleIsActive: () => void;\n  constructor(props: Object): void {\n    super();\n    this._onLongPress = this._onLongPress.bind(this);\n    this._toggleIsActive = this._toggleIsActive.bind(this);\n    this.state = {\n      isActive: false,\n      pan: new Animated.ValueXY(), // Vectors reduce boilerplate.  (step1: uncomment)\n      pop: new Animated.Value(0),  // Initial value.               (step2a: uncomment)\n    };\n  }\n\n  _onLongPress(): void {\n    var config = {tension: 40, friction: 3};\n    this.state.pan.addListener((value) => {  // Async listener for state changes  (step1: uncomment)\n      this.props.onMove && this.props.onMove(value);\n    });\n    Animated.spring(this.state.pop, {\n      toValue: 1,                  //  Pop to larger size.                      (step2b: uncomment)\n      ...config,                   //  Reuse config for convenient consistency  (step2b: uncomment)\n    }).start();\n    this.setState({panResponder: PanResponder.create({\n      onPanResponderMove: Animated.event([\n        null,                                         // native event - ignore      (step1: uncomment)\n        {dx: this.state.pan.x, dy: this.state.pan.y}, // links pan to gestureState  (step1: uncomment)\n      ]),\n      onPanResponderRelease: (e, gestureState) => {\n        LayoutAnimation.easeInEaseOut();  // @flowfixme animates layout update as one batch (step3: uncomment)\n        Animated.spring(this.state.pop, {\n          toValue: 0,                     // Pop back to 0                       (step2c: uncomment)\n          ...config,\n        }).start();\n        this.setState({panResponder: undefined});\n        this.props.onMove && this.props.onMove({\n          x: gestureState.dx + this.props.restLayout.x,\n          y: gestureState.dy + this.props.restLayout.y,\n        });\n        this.props.onDeactivate();\n        this.state.pan.removeAllListeners();\n      },\n    })}, () => {\n      this.props.onActivate();\n    });\n  }\n\n  render(): React.Node {\n    if (this.state.panResponder) {\n      var handlers = this.state.panResponder.panHandlers;\n      var dragStyle = {                 //  Used to position while dragging\n        position: 'absolute',           //  Hoist out of layout                    (step1: uncomment)\n        ...this.state.pan.getLayout(),  //  Convenience converter                  (step1: uncomment)\n      };\n    } else {\n      handlers = {\n        onStartShouldSetResponder: () => !this.state.isActive,\n        onResponderGrant: () => {\n          this.state.pan.setValue({x: 0, y: 0});           // reset                (step1: uncomment)\n          this.state.pan.setOffset(this.props.restLayout); // offset from onLayout (step1: uncomment)\n          /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses\n           * an error found when Flow v0.63 was deployed. To see the error\n           * delete this comment and run Flow. */\n          this.longTimer = setTimeout(this._onLongPress, 300);\n        },\n        onResponderRelease: () => {\n          if (!this.state.panResponder) {\n            /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment\n             * suppresses an error found when Flow v0.63 was deployed. To see\n             * the error delete this comment and run Flow. */\n            clearTimeout(this.longTimer);\n            this._toggleIsActive();\n          }\n        }\n      };\n    }\n    var animatedStyle: Object = {\n      shadowOpacity: this.state.pop,    // no need for interpolation            (step2d: uncomment)\n      transform: [\n        {scale: this.state.pop.interpolate({\n          inputRange: [0, 1],\n          outputRange: [1, 1.3]         // scale up from 1 to 1.3               (step2d: uncomment)\n        })},\n      ],\n    };\n    var openVal = this.props.openVal;\n    if (this.props.dummy) {\n      animatedStyle.opacity = 0;\n    } else if (this.state.isActive) {\n      var innerOpenStyle = [styles.open, {                                 // (step4: uncomment)\n        left: openVal.interpolate({inputRange: [0, 1], outputRange: [this.props.restLayout.x, 0]}),\n        top: openVal.interpolate({inputRange: [0, 1], outputRange: [this.props.restLayout.y, 0]}),\n        width: openVal.interpolate({inputRange: [0, 1], outputRange: [CIRCLE_SIZE, this.props.containerLayout.width]}),\n        height: openVal.interpolate({inputRange: [0, 1], outputRange: [CIRCLE_SIZE, this.props.containerLayout.height]}),\n        margin: openVal.interpolate({inputRange: [0, 1], outputRange: [CIRCLE_MARGIN, 0]}),\n        borderRadius: openVal.interpolate({inputRange: [-0.15, 0, 0.5, 1], outputRange: [0, CIRCLE_SIZE / 2, CIRCLE_SIZE * 1.3, 0]}),\n      }];\n    }\n    return (\n      <Animated.View\n        onLayout={this.props.onLayout}\n        style={[styles.dragView, dragStyle, animatedStyle, this.state.isActive ? styles.open : null]}\n        {...handlers}>\n        <Animated.View style={[styles.circle, innerOpenStyle]}>\n          <AnExSet\n            containerLayout={this.props.containerLayout}\n            id={this.props.id}\n            isActive={this.state.isActive}\n            openVal={this.props.openVal}\n            onDismiss={this._toggleIsActive}\n          />\n        </Animated.View>\n      </Animated.View>\n    );\n  }\n  _toggleIsActive(velocity) {\n    var config = {tension: 30, friction: 7};\n    if (this.state.isActive) {\n      Animated.spring(this.props.openVal, {toValue: 0, ...config}).start(() => { // (step4: uncomment)\n        this.setState({isActive: false}, this.props.onDeactivate);\n      });                                                                        // (step4: uncomment)\n    } else {\n      this.props.onActivate();\n      this.setState({isActive: true, panResponder: undefined}, () => {\n        // this.props.openVal.setValue(1);                                             // (step4: comment)\n        Animated.spring(this.props.openVal, {toValue: 1, ...config}).start();    // (step4: uncomment)\n      });\n    }\n  }\n}\n\nclass AnExApp extends React.Component<any, any> {\n  static title = 'Animated - Gratuitous App';\n  static description = 'Bunch of Animations - tap a circle to ' +\n    'open a view with more animations, or longPress and drag to reorder circles.';\n\n  _onMove: (position: Point) => void;\n  constructor(props: any): void {\n    super(props);\n    var keys = [];\n    for (var idx = 0; idx < NUM_CIRCLES; idx++) {\n      keys.push('E' + idx);\n    }\n    this.state = {\n      keys,\n      restLayouts: [],\n      openVal: new Animated.Value(0),\n    };\n    this._onMove = this._onMove.bind(this);\n  }\n\n  render(): React.Node {\n    var circles = this.state.keys.map((key, idx) => {\n      if (key === this.state.activeKey) {\n        return <Circle key={key + 'd'} dummy={true} />;\n      } else {\n        if (!this.state.restLayouts[idx]) {\n          var onLayout = function(index, e) {\n            var layout = e.nativeEvent.layout;\n            this.setState((state) => {\n              state.restLayouts[index] = layout;\n              return state;\n            });\n          }.bind(this, idx);\n        }\n        return (\n          <Circle\n            key={key}\n            id={key}\n            openVal={this.state.openVal}\n            onLayout={onLayout}\n            restLayout={this.state.restLayouts[idx]}\n            onActivate={this.setState.bind(this, {\n              activeKey: key,\n              activeInitialLayout: this.state.restLayouts[idx],\n            })}\n          />\n        );\n      }\n    });\n    if (this.state.activeKey) {\n      circles.push(\n        <Animated.View key=\"dark\" style={[styles.darkening, {opacity: this.state.openVal}]} />\n      );\n      circles.push(\n        <Circle\n          openVal={this.state.openVal}\n          key={this.state.activeKey}\n          id={this.state.activeKey}\n          restLayout={this.state.activeInitialLayout}\n          containerLayout={this.state.layout}\n          onMove={this._onMove}\n          onDeactivate={() => { this.setState({activeKey: undefined}); }}\n        />\n      );\n    }\n    return (\n      <View style={styles.container}>\n        <View style={styles.grid} onLayout={(e) => this.setState({layout: e.nativeEvent.layout})}>\n          {circles}\n        </View>\n      </View>\n    );\n  }\n\n  _onMove(position: Point): void {\n    var newKeys = moveToClosest(this.state, position);\n    if (newKeys !== this.state.keys) {\n      LayoutAnimation.easeInEaseOut();  // animates layout update as one batch (step3: uncomment)\n      this.setState({keys: newKeys});\n    }\n  }\n}\n\ntype Point = {x: number, y: number};\nfunction distance(p1: Point, p2: Point): number {\n  var dx = p1.x - p2.x;\n  var dy = p1.y - p2.y;\n  return dx * dx + dy * dy;\n}\n\nfunction moveToClosest({activeKey, keys, restLayouts}, position) {\n  var activeIdx = -1;\n  var closestIdx = activeIdx;\n  var minDist = Infinity;\n  var newKeys = [];\n  keys.forEach((key, idx) => {\n    var dist = distance(position, restLayouts[idx]);\n    if (key === activeKey) {\n      idx = activeIdx;\n    } else {\n      newKeys.push(key);\n    }\n    if (dist < minDist) {\n      minDist = dist;\n      closestIdx = idx;\n    }\n  });\n  if (closestIdx === activeIdx) {\n    return keys; // nothing changed\n  } else {\n    newKeys.splice(closestIdx, 0, activeKey);\n    return newKeys;\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  grid: {\n    flex: 1,\n    justifyContent: 'center',\n    flexDirection: 'row',\n    flexWrap: 'wrap',\n    backgroundColor: 'transparent',\n  },\n  circle: {\n    width: CIRCLE_SIZE,\n    height: CIRCLE_SIZE,\n    borderRadius: CIRCLE_SIZE / 2,\n    borderWidth: 1,\n    borderColor: 'black',\n    margin: CIRCLE_MARGIN,\n    overflow: 'hidden',\n  },\n  dragView: {\n    shadowRadius: 10,\n    shadowColor: 'rgba(0,0,0,0.7)',\n    shadowOffset: {height: 8},\n    alignSelf: 'flex-start',\n    backgroundColor: 'transparent',\n  },\n  open: {\n    position: 'absolute',\n    left: 0,\n    top: 0,\n    right: 0,\n    bottom: 0,\n    width: undefined, // unset value from styles.circle\n    height: undefined, // unset value from styles.circle\n    borderRadius: 0, // unset value from styles.circle\n  },\n  darkening: {\n    backgroundColor: 'black',\n    position: 'absolute',\n    left: 0,\n    top: 0,\n    right: 0,\n    bottom: 0,\n  },\n});\n\nmodule.exports = AnExApp;\n"
  },
  {
    "path": "RNTester/js/AnimatedGratuitousApp/AnExBobble.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnExBobble\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Animated,\n  PanResponder,\n  StyleSheet,\n  View,\n} = ReactNative;\n\nvar NUM_BOBBLES = 5;\nvar RAD_EACH = Math.PI / 2 / (NUM_BOBBLES - 2);\nvar RADIUS = 160;\nvar BOBBLE_SPOTS = [...Array(NUM_BOBBLES)].map((_, i) => {  // static positions\n  return i === 0 ? {x: 0, y: 0} : {                         // first bobble is the selector\n    x: -Math.cos(RAD_EACH * (i - 1)) * RADIUS,\n    y: -Math.sin(RAD_EACH * (i - 1)) * RADIUS,\n  };\n});\n\nclass AnExBobble extends React.Component<Object, any> {\n  constructor(props: Object) {\n    super(props);\n    this.state = {};\n    this.state.bobbles = BOBBLE_SPOTS.map((_, i) => {\n      return new Animated.ValueXY();\n    });\n    this.state.selectedBobble = null;\n    var bobblePanListener = (e, gestureState) => {     // async events => change selection\n      var newSelected = computeNewSelected(gestureState);\n      if (this.state.selectedBobble !== newSelected) {\n        if (this.state.selectedBobble !== null) {\n          var restSpot = BOBBLE_SPOTS[this.state.selectedBobble];\n          Animated.spring(this.state.bobbles[this.state.selectedBobble], {\n            toValue: restSpot,       // return previously selected bobble to rest position\n          }).start();\n        }\n        if (newSelected !== null && newSelected !== 0) {\n          Animated.spring(this.state.bobbles[newSelected], {\n            toValue: this.state.bobbles[0],    // newly selected should track the selector\n          }).start();\n        }\n        this.state.selectedBobble = newSelected;\n      }\n    };\n    var releaseBobble = () => {\n      this.state.bobbles.forEach((bobble, i) => {\n        Animated.spring(bobble, {\n          toValue: {x: 0, y: 0}           // all bobbles return to zero\n        }).start();\n      });\n    };\n    this.state.bobbleResponder = PanResponder.create({\n      onStartShouldSetPanResponder: () => true,\n      onPanResponderGrant: () => {\n        BOBBLE_SPOTS.forEach((spot, idx) => {\n          Animated.spring(this.state.bobbles[idx], {\n            toValue: spot,                // spring each bobble to its spot\n            friction: 3,                  // less friction => bouncier\n          }).start();\n        });\n      },\n      onPanResponderMove: Animated.event(\n        [ null, {dx: this.state.bobbles[0].x, dy: this.state.bobbles[0].y} ],\n        {listener: bobblePanListener}     // async state changes with arbitrary logic\n      ),\n      onPanResponderRelease: releaseBobble,\n      onPanResponderTerminate: releaseBobble,\n    });\n  }\n\n  render(): React.Node {\n    return (\n      <View style={styles.bobbleContainer}>\n        {this.state.bobbles.map((_, i) => {\n          var j = this.state.bobbles.length - i - 1; // reverse so lead on top\n          var handlers = j > 0 ? {} : this.state.bobbleResponder.panHandlers;\n          return (\n            <Animated.Image\n              {...handlers}\n              key={i}\n              source={{uri: BOBBLE_IMGS[j]}}\n              style={[styles.circle, {\n                backgroundColor: randColor(),                             // re-renders are obvious\n                transform: this.state.bobbles[j].getTranslateTransform(), // simple conversion\n              }]}\n            />\n          );\n        })}\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  circle: {\n    position: 'absolute',\n    height: 60,\n    width: 60,\n    borderRadius: 30,\n    borderWidth: 0.5,\n  },\n  bobbleContainer: {\n    top: -68,\n    paddingRight: 66,\n    flexDirection: 'row',\n    flex: 1,\n    justifyContent: 'flex-end',\n    backgroundColor: 'transparent',\n  },\n});\n\nfunction computeNewSelected(\n  gestureState: Object,\n): ?number {\n  var {dx, dy} = gestureState;\n  var minDist = Infinity;\n  var newSelected = null;\n  var pointRadius = Math.sqrt(dx * dx + dy * dy);\n  if (Math.abs(RADIUS - pointRadius) < 80) {\n    BOBBLE_SPOTS.forEach((spot, idx) => {\n      var delta = {x: spot.x - dx, y: spot.y - dy};\n      var dist = delta.x * delta.x + delta.y * delta.y;\n      if (dist < minDist) {\n        minDist = dist;\n        newSelected = idx;\n      }\n    });\n  }\n  return newSelected;\n}\n\nfunction randColor(): string {\n  var colors = [0,1,2].map(() => Math.floor(Math.random() * 150 + 100));\n  return 'rgb(' + colors.join(',') + ')';\n}\n\nvar BOBBLE_IMGS = [\n  'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xpf1/t39.1997-6/10173489_272703316237267_1025826781_n.png',\n  'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xaf1/l/t39.1997-6/p240x240/851578_631487400212668_2087073502_n.png',\n  'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xaf1/t39.1997-6/p240x240/851583_654446917903722_178118452_n.png',\n  'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xaf1/t39.1997-6/p240x240/851565_641023175913294_875343096_n.png',\n  'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xaf1/t39.1997-6/851562_575284782557566_1188781517_n.png',\n];\n\nmodule.exports = AnExBobble;\n"
  },
  {
    "path": "RNTester/js/AnimatedGratuitousApp/AnExChained.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnExChained\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Animated,\n  PanResponder,\n  StyleSheet,\n  View,\n} = ReactNative;\n\nclass AnExChained extends React.Component<Object, any> {\n  constructor(props: Object) {\n    super(props);\n    this.state = {\n      stickers: [new Animated.ValueXY()],                    // 1 leader\n    };\n    var stickerConfig = {tension: 2, friction: 3};           // soft spring\n    for (var i = 0; i < 4; i++) {                            // 4 followers\n      var sticker = new Animated.ValueXY();\n      Animated.spring(sticker, {\n        ...stickerConfig,\n        toValue: this.state.stickers[i],               // Animated toValue's are tracked\n      }).start();\n      this.state.stickers.push(sticker);               // push on the followers\n    }\n    var releaseChain = (e, gestureState) => {\n      this.state.stickers[0].flattenOffset();          // merges offset into value and resets\n      Animated.sequence([                              // spring to start after decay finishes\n        Animated.decay(this.state.stickers[0], {       // coast to a stop\n          velocity: {x: gestureState.vx, y: gestureState.vy},\n          deceleration: 0.997,\n        }),\n        Animated.spring(this.state.stickers[0], {\n          toValue: {x: 0, y: 0}                        // return to start\n        }),\n      ]).start();\n    };\n    this.state.chainResponder = PanResponder.create({\n      onStartShouldSetPanResponder: () => true,\n      onPanResponderGrant: () => {\n        this.state.stickers[0].stopAnimation((value) => {\n          this.state.stickers[0].setOffset(value);           // start where sticker animated to\n          this.state.stickers[0].setValue({x: 0, y: 0});     // avoid flicker before next event\n        });\n      },\n      onPanResponderMove: Animated.event(\n        [null, {dx: this.state.stickers[0].x, dy: this.state.stickers[0].y}] // map gesture to leader\n      ),\n      onPanResponderRelease: releaseChain,\n      onPanResponderTerminate: releaseChain,\n    });\n  }\n\n  render() {\n    return (\n      <View style={styles.chained}>\n        {this.state.stickers.map((_, i) => {\n          var j = this.state.stickers.length - i - 1; // reverse so leader is on top\n          var handlers = (j === 0) ? this.state.chainResponder.panHandlers : {};\n          return (\n            <Animated.Image\n              {...handlers}\n              key={i}\n              source={CHAIN_IMGS[j]}\n              style={[styles.sticker, {\n                transform: this.state.stickers[j].getTranslateTransform(), // simple conversion\n              }]}\n            />\n          );\n        })}\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  chained: {\n    alignSelf: 'flex-end',\n    top: -160,\n    right: 126\n  },\n  sticker: {\n    position: 'absolute',\n    height: 120,\n    width: 120,\n    backgroundColor: 'transparent',\n  },\n});\n\nvar CHAIN_IMGS = [\n  require('../hawk.png'),\n  require('../bunny.png'),\n  require('../relay.png'),\n  require('../hawk.png'),\n  require('../bunny.png')\n];\n\nmodule.exports = AnExChained;\n"
  },
  {
    "path": "RNTester/js/AnimatedGratuitousApp/AnExScroll.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnExScroll\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Animated,\n  Image,\n  ScrollView,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nclass AnExScroll extends React.Component<$FlowFixMeProps, any> {\n  state: any = { scrollX: new Animated.Value(0) };\n\n  render() {\n    var width = this.props.panelWidth;\n    return (\n      <View style={styles.container}>\n        <ScrollView\n          automaticallyAdjustContentInsets={false}\n          scrollEventThrottle={16 /* get all events */ }\n          onScroll={Animated.event(\n            [{nativeEvent: {contentOffset: {x: this.state.scrollX}}}]  // nested event mapping\n          )}\n          contentContainerStyle={{flex: 1, padding: 10}}\n          pagingEnabled={true}\n          horizontal={true}>\n          <View style={[styles.page, {width}]}>\n            <Image\n              style={{width: 180, height: 180}}\n              source={HAWK_PIC}\n            />\n            <Text style={styles.text}>\n              {'I\\'ll find something to put here.'}\n            </Text>\n          </View>\n          <View style={[styles.page, {width}]}>\n            <Text style={styles.text}>{'And here.'}</Text>\n          </View>\n          <View style={[styles.page, {width}]}>\n            <Text>{'But not here.'}</Text>\n          </View>\n        </ScrollView>\n        <Animated.Image\n          pointerEvents=\"none\"\n          style={[styles.bunny, {transform: [\n            {\n              translateX: this.state.scrollX.interpolate({\n                inputRange: [0, width, 2 * width],\n                outputRange: [0, 0, width / 3],\n                extrapolate: 'clamp',\n              }),\n            },\n            {\n              translateY: this.state.scrollX.interpolate({\n                inputRange: [0, width, 2 * width],\n                outputRange: [0, -200, -260],\n                extrapolate: 'clamp',\n              }),\n            },\n            {\n              scale: this.state.scrollX.interpolate({\n                inputRange: [0, width, 2 * width],\n                outputRange: [0.5, 0.5, 2],\n                extrapolate: 'clamp',\n              }),\n            },\n          ]}]}\n          source={BUNNY_PIC}\n        />\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    backgroundColor: 'transparent',\n    flex: 1,\n  },\n  text: {\n    padding: 4,\n    paddingBottom: 10,\n    fontWeight: 'bold',\n    fontSize: 18,\n    backgroundColor: 'transparent',\n  },\n  bunny: {\n    backgroundColor: 'transparent',\n    position: 'absolute',\n    height: 160,\n    width: 160,\n  },\n  page: {\n    alignItems: 'center',\n    justifyContent: 'flex-end',\n  },\n});\n\nvar HAWK_PIC = {uri: 'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xfa1/t39.1997-6/10734304_1562225620659674_837511701_n.png'};\nvar BUNNY_PIC = {uri: 'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xaf1/t39.1997-6/851564_531111380292237_1898871086_n.png'};\n\nmodule.exports = AnExScroll;\n"
  },
  {
    "path": "RNTester/js/AnimatedGratuitousApp/AnExSet.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnExSet\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Animated,\n  PanResponder,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nvar AnExBobble = require('./AnExBobble');\nvar AnExChained = require('./AnExChained');\nvar AnExScroll = require('./AnExScroll');\nvar AnExTilt = require('./AnExTilt');\n\nclass AnExSet extends React.Component<Object, any> {\n  constructor(props: Object) {\n    super(props);\n    function randColor() {\n      var colors = [0,1,2].map(() => Math.floor(Math.random() * 150 + 100));\n      return 'rgb(' + colors.join(',') + ')';\n    }\n    this.state = {\n      closeColor: randColor(),\n      openColor: randColor(),\n    };\n  }\n  render(): React.Node {\n    var backgroundColor = this.props.openVal ?\n      this.props.openVal.interpolate({\n        inputRange: [0, 1],\n        outputRange: [\n          this.state.closeColor,  // interpolates color strings\n          this.state.openColor\n        ],\n      }) :\n      this.state.closeColor;\n    var panelWidth = this.props.containerLayout && this.props.containerLayout.width || 320;\n    return (\n      <View style={styles.container}>\n        <Animated.View\n          style={[styles.header, { backgroundColor }]}\n          {...this.state.dismissResponder.panHandlers}>\n          <Text style={[styles.text, styles.headerText]}>\n            {this.props.id}\n          </Text>\n        </Animated.View>\n        {this.props.isActive &&\n          <View style={styles.stream}>\n            <View style={styles.card}>\n              <Text style={styles.text}>\n                July 2nd\n              </Text>\n              <AnExTilt isActive={this.props.isActive} />\n              <AnExBobble />\n            </View>\n            <AnExScroll panelWidth={panelWidth}/>\n            <AnExChained />\n          </View>\n        }\n      </View>\n    );\n  }\n\n  componentWillMount() {\n    this.state.dismissY = new Animated.Value(0);\n    this.state.dismissResponder = PanResponder.create({\n      onStartShouldSetPanResponder: () => this.props.isActive,\n      onPanResponderGrant: () => {\n        Animated.spring(this.props.openVal, {          // Animated value passed in.\n          toValue: this.state.dismissY.interpolate({   // Track dismiss gesture\n            inputRange: [0, 300],                      // and interpolate pixel distance\n            outputRange: [1, 0],                       // to a fraction.\n          }),\n        }).start();\n      },\n      onPanResponderMove: Animated.event(\n        [null, {dy: this.state.dismissY}],             // track pan gesture\n      ),\n      onPanResponderRelease: (e, gestureState) => {\n        if (gestureState.dy > 100) {\n          this.props.onDismiss(gestureState.vy);  // delegates dismiss action to parent\n        } else {\n          Animated.spring(this.props.openVal, {\n            toValue: 1,                           // animate back open if released early\n          }).start();\n        }\n      },\n    });\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  header: {\n    alignItems: 'center',\n    paddingTop: 18,\n    height: 90,\n  },\n  stream: {\n    flex: 1,\n    backgroundColor: 'rgb(230, 230, 230)',\n  },\n  card: {\n    margin: 8,\n    padding: 8,\n    borderRadius: 6,\n    backgroundColor: 'white',\n    shadowRadius: 2,\n    shadowColor: 'black',\n    shadowOpacity: 0.2,\n    shadowOffset: {height: 0.5},\n  },\n  text: {\n    padding: 4,\n    paddingBottom: 10,\n    fontWeight: 'bold',\n    fontSize: 18,\n    backgroundColor: 'transparent',\n  },\n  headerText: {\n    fontSize: 25,\n    color: 'white',\n    shadowRadius: 3,\n    shadowColor: 'black',\n    shadowOpacity: 1,\n    shadowOffset: {height: 1},\n  },\n});\n\nmodule.exports = AnExSet;\n"
  },
  {
    "path": "RNTester/js/AnimatedGratuitousApp/AnExSlides.md",
    "content": "<br /><br />\n# React Native: Animated\n\nReactEurope 2015, Paris - Spencer Ahrens - Facebook\n\n<br /><br />\n\n## Fluid Interactions\n\n- People expect smooth, delightful experiences\n- Complex interactions are hard\n- Common patterns can be optimized\n\n<br /><br />\n\n\n## Declarative Interactions\n\n- Wire up inputs (events) to outputs (props) + transforms (springs, easing, etc.)\n- Arbitrary code can define/update this config\n- Config can be serialized -> native/main thread\n- No refs or lifecycle to worry about\n\n<br /><br />\n\n\n## var { Animated } = require('react-native');\n\n- New library soon to be released for React Native\n- 100% JS implementation -> X-Platform\n- Per-platform native optimizations planned\n- This talk -> usage examples, not implementation\n\n<br /><br />\n\n\n## Gratuitous Animation Demo App\n\n- Layout uses `flexWrap: 'wrap'`\n- longPress -> drag to reorder\n- Tap to open example sets\n\n<br /><br />\n\n## Gratuitous Animation Codez\n\n- Step 1: 2D tracking pan gesture\n- Step 2: Simple pop-out spring on select\n- Step 3: Animate grid reordering with `LayoutAnimation`\n- Step 4: Opening animation\n\n<br /><br />\n\n## Animation Example Set\n\n- `Animated.Value` `this.props.open` passed in from parent\n- `interpolate` works with string \"shapes,\" e.g. `'rgb(0, 0, 255)'`, `'45deg'`\n- Examples easily composed as separate components\n- Dismissing tracks interpolated gesture\n- Custom release logic\n\n<br /><br />\n\n\n## Tilting Photo\n\n- Pan -> translateX * 2, rotate, opacity (via tracking)\n- Gesture release triggers separate animations\n- `addListener` for async, arbitrary logic on animation progress\n- `interpolate` easily creates parallax and other effects\n\n<br /><br />\n\n## Bobbles\n\n- Static positions defined\n- Listens to events to maybe change selection\n - Springs previous selection back\n - New selection tracks selector\n- `getTranslateTransform` adds convenience\n\n<br /><br />\n\n## Chained\n\n- Classic \"Chat Heads\" animation\n- Each sticker tracks the one before it with a soft spring\n- `decay` maintains gesture velocity, followed by `spring` to home\n- `stopAnimation` provides the last value for `setOffset`\n\n<br /><br />\n\n## Scrolling\n\n- `Animated.event` can track all sorts of stuff\n- Multi-part ranges and extrapolation options\n- Transforms decompose into ordered components\n\n<br /><br />\n\n# React Native: Animated\n\n- Landing soon in master (days)\n- GitHub: @vjeux, @sahrens\n- Questions?\n\n<br />\n"
  },
  {
    "path": "RNTester/js/AnimatedGratuitousApp/AnExTilt.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AnExTilt\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Animated,\n  PanResponder,\n  StyleSheet,\n} = ReactNative;\n\nclass AnExTilt extends React.Component<Object, any> {\n  constructor(props: Object) {\n    super(props);\n    this.state = {\n      panX: new Animated.Value(0),\n      opacity: new Animated.Value(1),\n      burns: new Animated.Value(1.15),\n    };\n    this.state.tiltPanResponder = PanResponder.create({\n      onStartShouldSetPanResponder: () => true,\n      onPanResponderGrant: () => {\n        Animated.timing(this.state.opacity, {\n          toValue: this.state.panX.interpolate({\n            inputRange: [-300, 0, 300],            // pan is in pixels\n            outputRange: [0, 1, 0],                // goes to zero at both edges\n          }),\n          duration: 0,                             // direct tracking\n        }).start();\n      },\n      onPanResponderMove: Animated.event(\n        [null, {dx: this.state.panX}]              // panX is linked to the gesture\n      ),\n      onPanResponderRelease: (e, gestureState) => {\n        var toValue = 0;\n        if (gestureState.dx > 100) {\n          toValue = 500;\n        } else if (gestureState.dx < -100) {\n          toValue = -500;\n        }\n        Animated.spring(this.state.panX, {\n          toValue,                         // animate back to center or off screen\n          velocity: gestureState.vx,       // maintain gesture velocity\n          tension: 10,\n          friction: 3,\n        }).start();\n        this.state.panX.removeAllListeners();\n        var id = this.state.panX.addListener(({value}) => { // listen until offscreen\n          if (Math.abs(value) > 400) {\n            this.state.panX.removeListener(id);             // offscreen, so stop listening\n            Animated.timing(this.state.opacity, {\n              toValue: 1,   // Fade back in.  This unlinks it from tracking this.state.panX\n            }).start();\n            this.state.panX.setValue(0);                    // Note: stops the spring animation\n            toValue !== 0 && this._startBurnsZoom();\n          }\n        });\n      },\n    });\n  }\n\n  _startBurnsZoom() {\n    this.state.burns.setValue(1);     // reset to beginning\n    Animated.decay(this.state.burns, {\n      velocity: 1,                    // sublte zoom\n      deceleration: 0.9999,           // slow decay\n    }).start();\n  }\n\n  componentWillMount() {\n    this._startBurnsZoom();\n  }\n\n  render(): React.Node {\n    return (\n      <Animated.View\n        {...this.state.tiltPanResponder.panHandlers}\n        style={[styles.tilt, {\n          opacity: this.state.opacity,\n          transform: [\n            {rotate: this.state.panX.interpolate({\n              inputRange: [-320, 320],\n              outputRange: ['-15deg', '15deg']})},  // interpolate string \"shapes\"\n            {translateX: this.state.panX},\n          ],\n        }]}>\n        <Animated.Image\n          pointerEvents=\"none\"\n          style={{\n            flex: 1,\n            transform: [\n              {translateX: this.state.panX.interpolate({\n                inputRange: [-3, 3],     // small range is extended by default\n                outputRange: [2, -2]})   // parallax\n              },\n              {scale: this.state.burns.interpolate({\n                inputRange: [1, 3000],\n                outputRange: [1, 1.25]}) // simple multiplier\n              },\n            ],\n          }}\n          source={require('./trees.jpg')}\n        />\n      </Animated.View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  tilt: {\n    overflow: 'hidden',\n    height: 200,\n    marginBottom: 4,\n    backgroundColor: 'rgb(130, 130, 255)',\n    borderColor: 'rgba(0, 0, 0, 0.2)',\n    borderWidth: 1,\n    borderRadius: 20,\n  },\n});\n\nmodule.exports = AnExTilt;\n"
  },
  {
    "path": "RNTester/js/AppStateExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AppStateExample\n * @flow\n */\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\nconst {\n  AppState,\n  Text,\n  View\n} = ReactNative;\n\nclass AppStateSubscription extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  state = {\n    appState: AppState.currentState,\n    previousAppStates: [],\n    memoryWarnings: 0,\n  };\n\n  componentDidMount() {\n    AppState.addEventListener('change', this._handleAppStateChange);\n    AppState.addEventListener('memoryWarning', this._handleMemoryWarning);\n  }\n\n  componentWillUnmount() {\n    AppState.removeEventListener('change', this._handleAppStateChange);\n    AppState.removeEventListener('memoryWarning', this._handleMemoryWarning);\n  }\n\n  _handleMemoryWarning = () => {\n    this.setState({memoryWarnings: this.state.memoryWarnings + 1});\n  };\n\n  _handleAppStateChange = (appState) => {\n    var previousAppStates = this.state.previousAppStates.slice();\n    previousAppStates.push(this.state.appState);\n    this.setState({\n      appState,\n      previousAppStates,\n    });\n  };\n\n  render() {\n    if (this.props.showMemoryWarnings) {\n      return (\n        <View>\n          <Text>{this.state.memoryWarnings}</Text>\n        </View>\n      );\n    }\n    if (this.props.showCurrentOnly) {\n      return (\n        <View>\n          <Text>{this.state.appState}</Text>\n        </View>\n      );\n    }\n    return (\n      <View>\n        <Text>{JSON.stringify(this.state.previousAppStates)}</Text>\n      </View>\n    );\n  }\n}\n\nexports.title = 'AppState';\nexports.description = 'app background status';\nexports.examples = [\n  {\n    title: 'AppState.currentState',\n    description: 'Can be null on app initialization',\n    render() { return <Text>{AppState.currentState}</Text>; }\n  },\n  {\n    title: 'Subscribed AppState:',\n    description: 'This changes according to the current state, so you can only ever see it rendered as \"active\"',\n    render(): React.Element<any> { return <AppStateSubscription showCurrentOnly={true} />; }\n  },\n  {\n    title: 'Previous states:',\n    render(): React.Element<any> { return <AppStateSubscription showCurrentOnly={false} />; }\n  },\n  {\n    platform: 'ios',\n    title: 'Memory Warnings',\n    description: 'In the IOS simulator, hit Shift+Command+M to simulate a memory warning.',\n    render(): React.Element<any> { return <AppStateSubscription showMemoryWarnings={true} />; }\n  },\n];\n"
  },
  {
    "path": "RNTester/js/AppearanceContext.js",
    "content": "/* @flow */\nimport React from 'react';\nimport { Appearance } from 'react-native';\n\nimport * as colorUtils from 'polished'\n\n// TODO: after upgrading to React 16.3+ move to React Context APIs\n// export const AppearanceContext = React.createContext(\n//   Appearance.initial\n// );\n\n// export const AppearanceContextConsumer = AppearanceContext.Consumer;\nconst AppearanceManager = new Appearance();\n\n\nexport class AppearanceConsumer extends React.Component<any, Appearance.AppearanceConfig> {\n  listener: any;\n  constructor(props: any) {\n    super(props);\n    this.state = {\n      ...Appearance.initial,\n      resolvedColors: props.resolveColors ? props.resolveColors(Appearance.initial, colorUtils) : {},\n    }\n  }\n  componentDidMount() {\n    this.listener = AppearanceManager.addEventListener(\"onAppearanceChange\", async e => {\n      this.setState(e);\n      if (this.props.resolveColors) {\n        const resolvedColors = this.props.resolveColors(e, colorUtils);\n        this.setState({ resolvedColors })\n      }\n    }); \n  }\n  componentWillUnmount() {\n    AppearanceManager.removeSubscription(this.listener);\n  }\n  render() {\n    return this.props.children(this.state, this.state.resolvedColors);\n  }\n}\n"
  },
  {
    "path": "RNTester/js/AppearanceExample.macos.js",
    "content": "/**\n * @flow\n */\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\n\nconst {\n  StyleSheet,\n  Text,\n  View,\n  Appearance,\n  TextInput,\n  Slider,\n} = ReactNative;\n\n\nimport { AppearanceConsumer } from './AppearanceContext'\n\n\nclass AppearanceListenerExample extends React.Component<{}> {\n  \n  componentDidMount() {\n    new Appearance().addEventListener(\"onAppearanceChange\", e => this.setState(e));\n  }\n  state: any = Appearance.initial;\n  render() {\n   \n    return (\n      <View style={styles.container}>\n        <AppearanceConsumer>{appearance => (\n            <Text>Current appearance name: <Text style={{ fontWeight: \"bold\"}} >{this.state.currentAppearance}</Text></Text>\n          )}\n        </AppearanceConsumer>\n      </View>\n    );\n  }\n}\n\nclass ColorHelpersExample extends React.Component<{}, { color: string, level: Number, highlightedColor?: string }> {\n  \n  state = { color: \"#ddd\", level: 0}\n  componentDidMount() {\n    this.changeHighlightColor(0)\n  }\n  changeHighlightColor = async (level) => {\n    this.setState({ level })\n    \n    const highlightedColor = await Appearance.highlightWithLevel(this.state.color, level);\n    this.setState({ highlightedColor })\n    const shadowedColor = await Appearance.shadowWithLevel(this.state.color, level);\n    this.setState({ shadowedColor })\n  }\n  render() {\n    return (\n      <AppearanceConsumer>{appearance => (\n        <View style={styles.container}>\n          <View style={{ flexDirection: \"row\", justifyContent: \"space-between\"}}>\n            <Text style={{ color: appearance.colors.textColor}}>Input color</Text>\n            <TextInput value={this.state.color} style={{ width: \"50%\"}} onChangeText={color => this.setState({ color }, () => this.changeHighlightColor(this.state.level))} />\n          </View>\n        \n          <Text style={{ color: appearance.colors.textColor}}>Level {this.state.level} </Text>\n          <Slider step={0.1} minimumValue={0} maximumValue={1} onValueChange={this.changeHighlightColor} />\n          \n          <View style={{ flexDirection: \"row\", justifyContent: \"space-between\"}}>\n            {this.state.highlightedColor && <View style={[{ backgroundColor: this.state.highlightedColor }, styles.colorBlock]}><Text>highlighted</Text></View>}\n            {this.state.highlightedColor && <View style={[{ backgroundColor: this.state.shadowedColor}, styles.colorBlock]}><Text>shadowed</Text></View>}\n          </View>\n        </View>\n        )}\n      </AppearanceConsumer>\n    );\n  }\n}\n\nclass ColorsExample extends React.Component<{}> {\n  \n  componentDidMount() {\n    new Appearance().addEventListener(\"onAppearanceChange\", e => this.setState(e));\n  }\n  state: any = Appearance.initial;\n  render() {\n    return (\n      <AppearanceConsumer>{appearance => (\n        <View style={styles.container}>\n          {Object.keys(this.state.colors).sort((a, b) => a > b ? 1 : -1).map(key =>\n            <View key={key} style={{ marginVertical: 6 }}>\n              <Text style={{ color: appearance.colors.textColor}}>{key}</Text> \n              <Text style={{ fontSize: 11, color: appearance.colors.secondaryLabelColor }} >{this.state.colors[key]}</Text>\n              <View style={{ borderWidth: 0.5, borderColor: \"gray\", width: \"100%\", height: 30, marginVertical: 5, backgroundColor: this.state.colors[key] }} />\n            </View>\n          )}\n        </View>\n      )}\n      </AppearanceConsumer>\n    );\n  }\n}\n\nexports.displayName = (undefined: ?string);\nexports.framework = 'React';\nexports.title = 'Appearance';\nexports.description = 'macOS 10.14+ Mojave Appearance';\nexports.examples = [{\n  title: 'System Appearance listener',\n  render() {\n    return (\n      <AppearanceListenerExample />\n    );\n  }\n}, \n{\n  title: 'Color helpers',\n  render() {\n    return (\n      <ColorHelpersExample />\n    );\n  }\n}, {\n  title: 'Dynamic system colors (NSColor)',\n  render() {\n    return (\n      <ColorsExample />\n    );\n  }\n}];\n\nvar styles = StyleSheet.create({\n  container: {\n    backgroundColor: 'transparent',\n  },\n  colorBlock: {\n    width: \"30%\", height: 30, justifyContent: \"center\", alignItems: \"center\"\n  }\n});\n"
  },
  {
    "path": "RNTester/js/AssetScaledImageExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule AssetScaledImageExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  StyleSheet,\n  View,\n  ScrollView\n} = ReactNative;\n\nclass AssetScaledImageExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  state = {\n    asset: this.props.asset\n  };\n\n  render() {\n    var image = this.state.asset.node.image;\n    return (\n      <ScrollView>\n        <View style={styles.row}>\n          <Image source={image} style={styles.imageWide}/>\n        </View>\n        <View style={styles.row}>\n          <Image source={image} style={styles.imageThumb}/>\n          <Image source={image} style={styles.imageThumb}/>\n          <Image source={image} style={styles.imageThumb}/>\n        </View>\n        <View style={styles.row}>\n          <Image source={image} style={styles.imageT1}/>\n          <Image source={image} style={styles.imageT2}/>\n        </View>\n      </ScrollView>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  row: {\n    padding: 5,\n    flex: 1,\n    flexDirection: 'row',\n    alignSelf: 'center',\n  },\n  textColumn: {\n    flex: 1,\n    flexDirection: 'column',\n  },\n  imageWide: {\n    borderWidth: 1,\n    borderColor: 'black',\n    width: 320,\n    height: 240,\n    margin: 5,\n  },\n  imageThumb: {\n    borderWidth: 1,\n    borderColor: 'black',\n    width: 100,\n    height: 100,\n    margin: 5,\n  },\n  imageT1: {\n    borderWidth: 1,\n    borderColor: 'black',\n    width: 212,\n    height: 320,\n    margin: 5,\n  },\n  imageT2: {\n    borderWidth: 1,\n    borderColor: 'black',\n    width: 100,\n    height: 320,\n    margin: 5,\n  },\n});\n\nexports.title = '<AssetScaledImageExample>';\nexports.description = 'Example component that displays the automatic scaling capabilities of the <Image /> tag';\nmodule.exports = AssetScaledImageExample;\n"
  },
  {
    "path": "RNTester/js/AsyncStorageExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule AsyncStorageExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  AsyncStorage,\n  PickerIOS,\n  Text,\n  View\n} = ReactNative;\nvar PickerItemIOS = PickerIOS.Item;\n\nvar STORAGE_KEY = '@AsyncStorageExample:key';\nvar COLORS = ['red', 'orange', 'yellow', 'green', 'blue'];\n\nclass BasicStorageExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    selectedValue: COLORS[0],\n    messages: [],\n  };\n\n  componentDidMount() {\n    this._loadInitialState().done();\n  }\n\n  _loadInitialState = async () => {\n    try {\n      var value = await AsyncStorage.getItem(STORAGE_KEY);\n      if (value !== null){\n        this.setState({selectedValue: value});\n        this._appendMessage('Recovered selection from disk: ' + value);\n      } else {\n        this._appendMessage('Initialized with no selection on disk.');\n      }\n    } catch (error) {\n      this._appendMessage('AsyncStorage error: ' + error.message);\n    }\n  };\n\n  render() {\n    var color = this.state.selectedValue;\n    return (\n      <View>\n        <PickerIOS\n          selectedValue={color}\n          onValueChange={this._onValueChange}>\n          {COLORS.map((value) => (\n            <PickerItemIOS\n              key={value}\n              value={value}\n              label={value}\n            />\n          ))}\n        </PickerIOS>\n        <Text>\n          {'Selected: '}\n          <Text style={{color}}>\n            {this.state.selectedValue}\n          </Text>\n        </Text>\n        <Text>{' '}</Text>\n        <Text onPress={this._removeStorage}>\n          Press here to remove from storage.\n        </Text>\n        <Text>{' '}</Text>\n        <Text>Messages:</Text>\n        {this.state.messages.map((m) => <Text key={m}>{m}</Text>)}\n      </View>\n    );\n  }\n\n  _onValueChange = async (selectedValue) => {\n    this.setState({selectedValue});\n    try {\n      await AsyncStorage.setItem(STORAGE_KEY, selectedValue);\n      this._appendMessage('Saved selection to disk: ' + selectedValue);\n    } catch (error) {\n      this._appendMessage('AsyncStorage error: ' + error.message);\n    }\n  };\n\n  _removeStorage = async () => {\n    try {\n      await AsyncStorage.removeItem(STORAGE_KEY);\n      this._appendMessage('Selection removed from disk.');\n    } catch (error) {\n      this._appendMessage('AsyncStorage error: ' + error.message);\n    }\n  };\n\n  _appendMessage = (message) => {\n    this.setState({messages: this.state.messages.concat(message)});\n  };\n}\n\nexports.title = 'AsyncStorage';\nexports.description = 'Asynchronous local disk storage.';\nexports.examples = [\n  {\n    title: 'Basics - getItem, setItem, removeItem',\n    render(): React.Element<any> { return <BasicStorageExample />; }\n  },\n];\n"
  },
  {
    "path": "RNTester/js/BorderExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BorderExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  View\n} = ReactNative;\n\nvar styles = StyleSheet.create({\n  box: {\n    width: 100,\n    height: 100,\n  },\n  border1: {\n    borderWidth: 10,\n    borderColor: 'brown',\n  },\n  borderRadius: {\n    borderWidth: 10,\n    borderRadius: 10,\n    borderColor: 'cyan',\n  },\n  border2: {\n    borderWidth: 10,\n    borderTopColor: 'red',\n    borderRightColor: 'yellow',\n    borderBottomColor: 'green',\n    borderLeftColor: 'blue',\n  },\n  border3: {\n    borderColor: 'purple',\n    borderTopWidth: 10,\n    borderRightWidth: 20,\n    borderBottomWidth: 30,\n    borderLeftWidth: 40,\n  },\n  border4: {\n    borderTopWidth: 10,\n    borderTopColor: 'red',\n    borderRightWidth: 20,\n    borderRightColor: 'yellow',\n    borderBottomWidth: 30,\n    borderBottomColor: 'green',\n    borderLeftWidth: 40,\n    borderLeftColor: 'blue',\n  },\n  border5: {\n    borderRadius: 50,\n    borderTopWidth: 10,\n    borderTopColor: 'red',\n    borderRightWidth: 20,\n    borderRightColor: 'yellow',\n    borderBottomWidth: 30,\n    borderBottomColor: 'green',\n    borderLeftWidth: 40,\n    borderLeftColor: 'blue',\n  },\n  border6: {\n    borderTopWidth: 10,\n    borderTopColor: 'red',\n    borderRightWidth: 20,\n    borderRightColor: 'yellow',\n    borderBottomWidth: 30,\n    borderBottomColor: 'green',\n    borderLeftWidth: 40,\n    borderLeftColor: 'blue',\n\n    borderTopLeftRadius: 100,\n  },\n  border7: {\n    borderWidth: 10,\n    borderColor: '#f007',\n    borderRadius: 30,\n    overflow: 'hidden',\n  },\n  border7_inner: {\n    backgroundColor: 'blue',\n    width: 100,\n    height: 100\n  },\n  border8: {\n    width: 60,\n    height: 60,\n    borderColor: 'black',\n    marginRight: 10,\n    backgroundColor: 'lightgrey',\n  },\n  border9: {\n    borderWidth: 10,\n    borderTopLeftRadius: 10,\n    borderBottomRightRadius: 20,\n    borderColor: 'black',\n  },\n  border10: {\n    borderWidth: 10,\n    backgroundColor: 'white',\n    borderTopLeftRadius: 10,\n    borderBottomRightRadius: 20,\n    borderColor: 'black',\n    elevation: 10,\n  },\n  border11: {\n    width: 0,\n    height: 0,\n    borderStyle: 'solid',\n    overflow: 'hidden',\n    borderTopWidth: 50,\n    borderRightWidth: 0,\n    borderBottomWidth: 50,\n    borderLeftWidth: 100,\n    borderTopColor: 'transparent',\n    borderRightColor: 'transparent',\n    borderBottomColor: 'transparent',\n    borderLeftColor: 'red',\n  },\n  border12: {\n    borderStyle: 'solid',\n    overflow: 'hidden',\n    borderTopWidth: 10,\n    borderRightWidth: 20,\n    borderBottomWidth: 30,\n    borderLeftWidth: 40,\n    borderRadius: 20,\n  },\n  border13: {\n    borderStyle: 'solid',\n    overflow: 'hidden',\n    borderTopWidth: 10,\n    borderRightWidth: 20,\n    borderBottomWidth: 30,\n    borderLeftWidth: 40,\n    borderTopColor: 'red',\n    borderRightColor: 'green',\n    borderBottomColor: 'blue',\n    borderLeftColor: 'magenta',\n    borderRadius: 20,\n  },\n  border14: {\n    borderStyle: 'solid',\n    overflow: 'hidden',\n    borderTopWidth: 10,\n    borderRightWidth: 20,\n    borderBottomWidth: 30,\n    borderLeftWidth: 40,\n    borderTopColor: 'red',\n    borderRightColor: 'green',\n    borderBottomColor: 'blue',\n    borderLeftColor: 'magenta',\n    borderTopLeftRadius: 10,\n    borderTopRightRadius: 40,\n    borderBottomRightRadius: 30,\n    borderBottomLeftRadius: 40,\n  }\n});\n\nexports.title = 'Border';\nexports.description = 'Demonstrates some of the border styles available to Views.';\nexports.examples = [\n  {\n    title: 'Equal-Width / Same-Color',\n    description: 'borderWidth & borderColor',\n    render() {\n      return <View style={[styles.box, styles.border1]} />;\n    }\n  },\n  {\n    title: 'Equal-Width / Same-Color',\n    description: 'borderWidth & borderColor & borderRadius',\n    render() {\n      return <View style={[styles.box, styles.borderRadius]} />;\n    }\n  },\n  {\n    title: 'Equal-Width Borders',\n    description: 'borderWidth & border*Color',\n    render() {\n      return <View style={[styles.box, styles.border2]} />;\n    }\n  },\n  {\n    title: 'Same-Color Borders',\n    description: 'border*Width & borderColor',\n    render() {\n      return <View style={[styles.box, styles.border3]} />;\n    }\n  },\n  {\n    title: 'Custom Borders',\n    description: 'border*Width & border*Color',\n    render() {\n      return <View style={[styles.box, styles.border4]} />;\n    }\n  },\n  {\n    title: 'Custom Borders',\n    description: 'border*Width & border*Color',\n    platform: 'ios',\n    render() {\n      return <View style={[styles.box, styles.border5]} />;\n    }\n  },\n  {\n    title: 'Custom Borders',\n    description: 'border*Width & border*Color',\n    platform: 'ios',\n    render() {\n      return <View style={[styles.box, styles.border6]} />;\n    }\n  },\n  {\n    title: 'Custom Borders',\n    description: 'borderRadius & clipping',\n    platform: 'ios',\n    render() {\n      return (\n        <View style={[styles.box, styles.border7]}>\n          <View style={styles.border7_inner} />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Single Borders',\n    description: 'top, left, bottom right',\n    render() {\n      return (\n        <View style={{flexDirection: 'row'}}>\n          <View style={[styles.box, styles.border8, {borderTopWidth: 5}]} />\n          <View style={[styles.box, styles.border8, {borderLeftWidth: 5}]} />\n          <View style={[styles.box, styles.border8, {borderBottomWidth: 5}]} />\n          <View style={[styles.box, styles.border8, {borderRightWidth: 5}]} />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Corner Radii',\n    description: 'borderTopLeftRadius & borderBottomRightRadius',\n    render() {\n      return <View style={[styles.box, styles.border9]} />;\n    }\n  },\n  {\n    title: 'Corner Radii / Elevation',\n    description: 'borderTopLeftRadius & borderBottomRightRadius & elevation',\n    platform: 'android',\n    render() {\n      return <View style={[styles.box, styles.border10]} />;\n    }\n  },\n  {\n    title: 'CSS Trick - Triangle',\n    description: 'create a triangle by manipulating border colors and widths',\n    render() {\n      return <View style={[styles.border11]} />;\n    }\n  },\n  {\n    title: 'Curved border(Left|Right|Bottom|Top)Width',\n    description: 'Make a non-uniform width curved border',\n    render() {\n      return <View style={[styles.box, styles.border12]} />;\n    }\n  },\n  {\n    title: 'Curved border(Left|Right|Bottom|Top)Color',\n    description: 'Make a non-uniform color curved border',\n    render() {\n      return <View style={[styles.box, styles.border13]} />;\n    }\n  },\n  {\n    title: 'Curved border(Top|Bottom)(Left|Right)Radius',\n    description: 'Make a non-uniform radius curved border',\n    render() {\n      return <View style={[styles.box, styles.border14]} />;\n    }\n  }\n];\n"
  },
  {
    "path": "RNTester/js/BoxShadowExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BoxShadowExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  StyleSheet,\n  View\n} = ReactNative;\n\nvar styles = StyleSheet.create({\n  box: {\n    width: 100,\n    height: 100,\n    borderWidth: 2,\n  },\n  shadow1: {\n    shadowOpacity: 0.5,\n    shadowRadius: 3,\n    shadowOffset: {width: 2, height: 2},\n  },\n  shadow2: {\n    shadowOpacity: 1.0,\n    shadowColor: 'red',\n    shadowRadius: 0,\n    shadowOffset: {width: 3, height: 3},\n  },\n});\n\nexports.title = 'Box Shadow';\nexports.description = 'Demonstrates some of the shadow styles available to Views.';\nexports.examples = [\n  {\n    title: 'Basic shadow',\n    description: 'shadowOpacity: 0.5, shadowOffset: {2, 2}',\n    render() {\n      return <View style={[styles.box, styles.shadow1]} />;\n    }\n  },\n  {\n    title: 'Colored shadow',\n    description: 'shadowColor: \\'red\\', shadowRadius: 0',\n    render() {\n      return <View style={[styles.box, styles.shadow2]} />;\n    }\n  },\n  {\n    title: 'Shaped shadow',\n    description: 'borderRadius: 50',\n    render() {\n      return <View style={[styles.box, styles.shadow1, {borderRadius: 50}]} />;\n    }\n  },\n  {\n    title: 'Image shadow',\n    description: 'Image shadows are derived exactly from the pixels.',\n    render() {\n      return <Image\n        source={require('./hawk.png')}\n        style={[styles.box, styles.shadow1, {borderWidth: 0, overflow: 'visible'}]}\n      />;\n    }\n  },\n  {\n    title: 'Child shadow',\n    description: 'For views without an opaque background color, shadow will be derived from the subviews.',\n    render() {\n      return <View style={[styles.box, styles.shadow1, {backgroundColor: 'transparent'}]}>\n        <View style={[styles.box, {width: 80, height: 80, borderRadius: 40, margin: 8, backgroundColor: 'red'}]}/>\n      </View>;\n    }\n  },\n];\n"
  },
  {
    "path": "RNTester/js/ButtonExample.js",
    "content": "/*\n  @flow\n*/\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\n\nconst { Button, View } = ReactNative;\n\nconst BEZEL_STYLES = [\n  'rounded',\n  'regularSquare',\n  'thickSquare',\n  'thickerSquare',\n  'disclosure',\n  'shadowlessSquare',\n  'circular',\n  'texturedSquare',\n  'helpButton',\n  'smallSquare',\n  'texturedRounded',\n  'roundRect',\n  'recessed',\n  'roundedDisclosure',\n  'inline',\n];\n\nconst AllStyles = ({ type }) => {\n  return (\n    <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>\n      {BEZEL_STYLES.map((style, i) => (\n        <Button\n          key={i}\n          style={{ width: 150, margin: 15 }}\n          type={type}\n          title={style.toString()}\n          toolTip={`tooltip: for style=${style} with type=${type}`}\n          bezelStyle={style}\n          onPress={() => alert(`clicked on: style=${style} type=${type}`)}\n        />\n      ))}\n    </View>\n  );\n};\n\nexports.title = '<Button>';\nexports.description = 'macOS native buttons with different styles';\nexports.examples = [\n  {\n    title: 'Default',\n    description: 'Default button',\n    render() {\n      return (\n        <Button\n          title=\"Button\"\n          onPress={() => alert(`clicked on default button`)}\n        />\n      );\n    },\n  },\n  {\n    title: 'Momentary Light',\n    description: 'This type of button is best for simply triggering actions because it doesn’t show its state; it always displays its normal image or title.',\n    render() {\n      return <AllStyles type={'momentaryLight'} />;\n    },\n  },\n  {\n    title: 'Push button',\n    description: 'When the button is clicked (on state), it appears illuminated. If the button has borders, it may also appear recessed. A second click returns it to its normal (off) state.',\n    render() {\n      return <AllStyles type={'push'} />;\n    },\n  },\n  {\n    title: 'Toggle',\n    description: 'After the first click, the button displays its alternate image or title (on state); a second click returns the button to its normal (off) state.',\n    render() {\n      return (\n        <Button\n          type={'toggle'}\n          style={{ width: 200 }}\n          title={'button title'}\n          alternateTitle={'Alternate title'}\n        />\n      );\n    },\n  },\n  {\n    title: 'Switch',\n    description: 'This style is a variant of NSToggleButton that has no border and is typically used to represent a checkbox.',\n    render() {\n      return (\n        <View>\n          <Button\n            type={'switch'}\n            style={{ width: 250 }}\n            title={'Single Checkbox'}\n            state={0}\n          />\n          <Button\n            type={'switch'}\n            style={{ width: 250 }}\n            title={'Single Checkbox'}\n            state={1}\n          />\n          <Button\n            type={'switch'}\n            style={{ width: 250 }}\n            title={'Single Checkbox'}\n            allowsMixedState={true}\n            state={-1}\n          />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Radio',\n    description: 'This style is similar to NSSwitchButton, but it is used to constrain a selection to a single element from several elements.',\n    render() {\n      return (\n        <View>\n          <Button\n            type={'radio'}\n            style={{ width: 200 }}\n            title={'Single Radio'}\n            state={0}\n          />\n          <Button\n            type={'radio'}\n            style={{ width: 200 }}\n            title={'Single Radio'}\n            state={1}\n          />\n          <Button\n            type={'radio'}\n            style={{ width: 200 }}\n            title={'Single Radio'}\n            allowsMixedState={true}\n            state={-1}\n          />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'onOff button',\n    description: 'The first click highlights the button; a second click returns it to the normal (unhighlighted) state.',\n    render() {\n      return <AllStyles type={'onOff'} />;\n    },\n  },\n  {\n    title: 'Image Button',\n    description: 'four different styles (circular, disclosure, roundedDisclosure, helpButton)',\n    render() {\n      return (\n        <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>\n          <Button\n            bezelStyle={'circular'}\n            image={require('./uie_thumb_normal.png')}\n            style={styles.icon}\n          />\n          <Button\n            bezelStyle={'disclosure'}\n            image={require('./uie_thumb_normal.png')}\n            style={styles.icon}\n          />\n          <Button\n            bezelStyle={'roundedDisclosure'}\n            image={require('./uie_thumb_normal.png')}\n            style={styles.icon}\n          />\n          <Button bezelStyle={'helpButton'} title={''} style={styles.icon} />\n        </View>\n      );\n    },\n  },\n];\n\nconst styles = {\n  icon: {\n    width: 60,\n    height: 60,\n  },\n};\n"
  },
  {
    "path": "RNTester/js/CameraRollExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule CameraRollExample\n * @format\n */\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\nconst {\n  CameraRoll,\n  Image,\n  Slider,\n  StyleSheet,\n  Switch,\n  Text,\n  View,\n  TouchableOpacity,\n} = ReactNative;\n\nconst invariant = require('fbjs/lib/invariant');\n\nconst CameraRollView = require('./CameraRollView');\n\nconst AssetScaledImageExampleView = require('./AssetScaledImageExample');\n\nclass CameraRollExample extends React.Component<\n  $FlowFixMeProps,\n  $FlowFixMeState,\n> {\n  state = {\n    groupTypes: 'SavedPhotos',\n    sliderValue: 1,\n    bigImages: true,\n  };\n  _cameraRollView: ?CameraRollView;\n  render() {\n    return (\n      <View>\n        <Switch\n          onValueChange={this._onSwitchChange}\n          value={this.state.bigImages}\n        />\n        <Text>{(this.state.bigImages ? 'Big' : 'Small') + ' Images'}</Text>\n        <Slider\n          value={this.state.sliderValue}\n          onValueChange={this._onSliderChange}\n        />\n        <Text>{'Group Type: ' + this.state.groupTypes}</Text>\n        <CameraRollView\n          ref={ref => {\n            this._cameraRollView = ref;\n          }}\n          batchSize={20}\n          groupTypes={this.state.groupTypes}\n          renderImage={this._renderImage}\n        />\n      </View>\n    );\n  }\n\n  loadAsset(asset) {\n    if (this.props.navigator) {\n      this.props.navigator.push({\n        title: 'Camera Roll Image',\n        component: AssetScaledImageExampleView,\n        backButtonTitle: 'Back',\n        passProps: {asset: asset},\n      });\n    }\n  }\n\n  _renderImage = asset => {\n    const imageSize = this.state.bigImages ? 150 : 75;\n    const imageStyle = [styles.image, {width: imageSize, height: imageSize}];\n    const {location} = asset.node;\n    const locationStr = location\n      ? JSON.stringify(location)\n      : 'Unknown location';\n    return (\n      <TouchableOpacity key={asset} onPress={this.loadAsset.bind(this, asset)}>\n        <View style={styles.row}>\n          <Image source={asset.node.image} style={imageStyle} />\n          <View style={styles.info}>\n            <Text style={styles.url}>{asset.node.image.uri}</Text>\n            <Text>{locationStr}</Text>\n            <Text>{asset.node.group_name}</Text>\n            <Text>{new Date(asset.node.timestamp).toString()}</Text>\n          </View>\n        </View>\n      </TouchableOpacity>\n    );\n  };\n\n  _onSliderChange = value => {\n    const options = Object.keys(CameraRoll.GroupTypesOptions);\n    const index = Math.floor(value * options.length * 0.99);\n    const groupTypes = options[index];\n    if (groupTypes !== this.state.groupTypes) {\n      this.setState({groupTypes: groupTypes});\n    }\n  };\n\n  _onSwitchChange = value => {\n    invariant(this._cameraRollView, 'ref should be set');\n    this._cameraRollView.rendererChanged();\n    this.setState({bigImages: value});\n  };\n}\n\nconst styles = StyleSheet.create({\n  row: {\n    flexDirection: 'row',\n    flex: 1,\n  },\n  url: {\n    fontSize: 9,\n    marginBottom: 14,\n  },\n  image: {\n    margin: 4,\n  },\n  info: {\n    flex: 1,\n  },\n});\n\nexports.title = 'Camera Roll';\nexports.description =\n  \"Example component that uses CameraRoll to list user's photos\";\nexports.examples = [\n  {\n    title: 'Photos',\n    render(): React.Element<any> {\n      return <CameraRollExample />;\n    },\n  },\n];\n"
  },
  {
    "path": "RNTester/js/CameraRollView.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CameraRollView\n * @flow\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nconst PropTypes = require('prop-types');\nvar ReactNative = require('react-native');\nvar {\n  ActivityIndicator,\n  Alert,\n  CameraRoll,\n  Image,\n  ListView,\n  PermissionsAndroid,\n  Platform,\n  StyleSheet,\n  View,\n} = ReactNative;\n\nvar groupByEveryN = require('groupByEveryN');\nvar logError = require('logError');\n\nvar propTypes = {\n  /**\n   * The group where the photos will be fetched from. Possible\n   * values are 'Album', 'All', 'Event', 'Faces', 'Library', 'PhotoStream'\n   * and SavedPhotos.\n   */\n  groupTypes: PropTypes.oneOf([\n    'Album',\n    'All',\n    'Event',\n    'Faces',\n    'Library',\n    'PhotoStream',\n    'SavedPhotos',\n  ]),\n\n  /**\n   * Number of images that will be fetched in one page.\n   */\n  batchSize: PropTypes.number,\n\n  /**\n   * A function that takes a single image as a parameter and renders it.\n   */\n  renderImage: PropTypes.func,\n\n  /**\n   * imagesPerRow: Number of images to be shown in each row.\n   */\n  imagesPerRow: PropTypes.number,\n\n   /**\n   * The asset type, one of 'Photos', 'Videos' or 'All'\n   */\n  assetType: PropTypes.oneOf([\n    'Photos',\n    'Videos',\n    'All',\n  ]),\n\n};\n\nvar CameraRollView = createReactClass({\n  displayName: 'CameraRollView',\n  // $FlowFixMe(>=0.41.0)\n  propTypes: propTypes,\n\n  getDefaultProps: function(): Object {\n    return {\n      groupTypes: 'SavedPhotos',\n      batchSize: 5,\n      imagesPerRow: 1,\n      assetType: 'Photos',\n      renderImage: function(asset) {\n        var imageSize = 150;\n        var imageStyle = [styles.image, {width: imageSize, height: imageSize}];\n        return (\n          <Image\n            source={asset.node.image}\n            style={imageStyle}\n          />\n        );\n      },\n    };\n  },\n\n  getInitialState: function() {\n    var ds = new ListView.DataSource({rowHasChanged: this._rowHasChanged});\n\n    return {\n      assets: ([]: Array<Image>),\n      groupTypes: this.props.groupTypes,\n      lastCursor: (null : ?string),\n      assetType: this.props.assetType,\n      noMore: false,\n      loadingMore: false,\n      dataSource: ds,\n    };\n  },\n\n  /**\n   * This should be called when the image renderer is changed to tell the\n   * component to re-render its assets.\n   */\n  rendererChanged: function() {\n    var ds = new ListView.DataSource({rowHasChanged: this._rowHasChanged});\n    this.state.dataSource = ds.cloneWithRows(\n      // $FlowFixMe(>=0.41.0)\n      groupByEveryN(this.state.assets, this.props.imagesPerRow)\n    );\n  },\n\n  componentDidMount: function() {\n    this.fetch();\n  },\n\n  componentWillReceiveProps: function(nextProps: {groupTypes?: string}) {\n    if (this.props.groupTypes !== nextProps.groupTypes) {\n      this.fetch(true);\n    }\n  },\n\n  _fetch: async function(clear?: boolean) {\n    if (clear) {\n      this.setState(this.getInitialState(), this.fetch);\n      return;\n    }\n\n    if (Platform.OS === 'android') {\n      const result = await PermissionsAndroid.request(\n        PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE,\n        {\n          title: 'Permission Explanation',\n          message: 'RNTester would like to access your pictures.',\n        },\n      );\n      if (result !== 'granted') {\n        Alert.alert('Access to pictures was denied.');\n        return;\n      }\n    }\n\n    const fetchParams: Object = {\n      first: this.props.batchSize,\n      groupTypes: this.props.groupTypes,\n      assetType: this.props.assetType,\n    };\n    if (Platform.OS === 'android') {\n      // not supported in android\n      delete fetchParams.groupTypes;\n    }\n    if (this.state.lastCursor) {\n      fetchParams.after = this.state.lastCursor;\n    }\n\n    try {\n      const data = await CameraRoll.getPhotos(fetchParams);\n      this._appendAssets(data);\n    } catch (e) {\n      logError(e);\n    }\n  },\n\n  /**\n   * Fetches more images from the camera roll. If clear is set to true, it will\n   * set the component to its initial state and re-fetch the images.\n   */\n  fetch: function(clear?: boolean) {\n    if (!this.state.loadingMore) {\n      this.setState({loadingMore: true}, () => { this._fetch(clear); });\n    }\n  },\n\n  render: function() {\n    return (\n      <ListView\n        renderRow={this._renderRow}\n        renderFooter={this._renderFooterSpinner}\n        onEndReached={this._onEndReached}\n        style={styles.container}\n        dataSource={this.state.dataSource}\n        enableEmptySections\n      />\n    );\n  },\n\n  _rowHasChanged: function(r1: Array<Image>, r2: Array<Image>): boolean {\n    if (r1.length !== r2.length) {\n      return true;\n    }\n\n    for (var i = 0; i < r1.length; i++) {\n      if (r1[i] !== r2[i]) {\n        return true;\n      }\n    }\n\n    return false;\n  },\n\n  _renderFooterSpinner: function() {\n    if (!this.state.noMore) {\n      return <ActivityIndicator />;\n    }\n    return null;\n  },\n\n  // rowData is an array of images\n  _renderRow: function(rowData: Array<Image>, sectionID: string, rowID: string)  {\n    var images = rowData.map((image) => {\n      if (image === null) {\n        return null;\n      }\n      // $FlowFixMe(>=0.41.0)\n      return this.props.renderImage(image);\n    });\n\n    return (\n      <View style={styles.row}>\n        {images}\n      </View>\n    );\n  },\n\n  _appendAssets: function(data: Object) {\n    var assets = data.edges;\n    var newState: Object = { loadingMore: false };\n\n    if (!data.page_info.has_next_page) {\n      newState.noMore = true;\n    }\n\n    if (assets.length > 0) {\n      newState.lastCursor = data.page_info.end_cursor;\n      newState.assets = this.state.assets.concat(assets);\n      newState.dataSource = this.state.dataSource.cloneWithRows(\n        // $FlowFixMe(>=0.41.0)\n        groupByEveryN(newState.assets, this.props.imagesPerRow)\n      );\n    }\n\n    this.setState(newState);\n  },\n\n  _onEndReached: function() {\n    if (!this.state.noMore) {\n      this.fetch();\n    }\n  },\n});\n\nvar styles = StyleSheet.create({\n  row: {\n    flexDirection: 'row',\n    flex: 1,\n  },\n  url: {\n    fontSize: 9,\n    marginBottom: 14,\n  },\n  image: {\n    margin: 4,\n  },\n  info: {\n    flex: 1,\n  },\n  container: {\n    flex: 1,\n  },\n});\n\nmodule.exports = CameraRollView;\n"
  },
  {
    "path": "RNTester/js/CheckBoxExample.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule CheckBoxExample\n * @format\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {CheckBox, Text, View} = ReactNative;\n\nclass BasicCheckBoxExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    trueCheckBoxIsOn: true,\n    falseCheckBoxIsOn: false,\n  };\n\n  render() {\n    return (\n      <View>\n        <CheckBox\n          onValueChange={value => this.setState({falseCheckBoxIsOn: value})}\n          style={{marginBottom: 10}}\n          value={this.state.falseCheckBoxIsOn}\n        />\n        <CheckBox\n          onValueChange={value => this.setState({trueCheckBoxIsOn: value})}\n          value={this.state.trueCheckBoxIsOn}\n        />\n      </View>\n    );\n  }\n}\n\nclass DisabledCheckBoxExample extends React.Component<{}, $FlowFixMeState> {\n  render() {\n    return (\n      <View>\n        <CheckBox disabled={true} style={{marginBottom: 10}} value={true} />\n        <CheckBox disabled={true} value={false} />\n      </View>\n    );\n  }\n}\n\nclass EventCheckBoxExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    eventCheckBoxIsOn: false,\n    eventCheckBoxRegressionIsOn: true,\n  };\n\n  render() {\n    return (\n      <View style={{flexDirection: 'row', justifyContent: 'space-around'}}>\n        <View>\n          <CheckBox\n            onValueChange={value => this.setState({eventCheckBoxIsOn: value})}\n            style={{marginBottom: 10}}\n            value={this.state.eventCheckBoxIsOn}\n          />\n          <CheckBox\n            onValueChange={value => this.setState({eventCheckBoxIsOn: value})}\n            style={{marginBottom: 10}}\n            value={this.state.eventCheckBoxIsOn}\n          />\n          <Text>{this.state.eventCheckBoxIsOn ? 'On' : 'Off'}</Text>\n        </View>\n        <View>\n          <CheckBox\n            onValueChange={value =>\n              this.setState({eventCheckBoxRegressionIsOn: value})\n            }\n            style={{marginBottom: 10}}\n            value={this.state.eventCheckBoxRegressionIsOn}\n          />\n          <CheckBox\n            onValueChange={value =>\n              this.setState({eventCheckBoxRegressionIsOn: value})\n            }\n            style={{marginBottom: 10}}\n            value={this.state.eventCheckBoxRegressionIsOn}\n          />\n          <Text>{this.state.eventCheckBoxRegressionIsOn ? 'On' : 'Off'}</Text>\n        </View>\n      </View>\n    );\n  }\n}\n\nlet examples = [\n  {\n    title: 'CheckBoxes can be set to true or false',\n    render(): React.Element<any> {\n      return <BasicCheckBoxExample />;\n    },\n  },\n  {\n    title: 'CheckBoxes can be disabled',\n    render(): React.Element<any> {\n      return <DisabledCheckBoxExample />;\n    },\n  },\n  {\n    title: 'Change events can be detected',\n    render(): React.Element<any> {\n      return <EventCheckBoxExample />;\n    },\n  },\n  {\n    title: 'CheckBoxes are controlled components',\n    render(): React.Element<any> {\n      return <CheckBox />;\n    },\n  },\n];\n\nexports.title = '<CheckBox>';\nexports.displayName = 'CheckBoxExample';\nexports.description = 'Native boolean input';\nexports.examples = examples;\n"
  },
  {
    "path": "RNTester/js/ClipboardExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ClipboardExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Clipboard,\n  View,\n  Text,\n} = ReactNative;\n\nclass ClipboardExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    content: 'Content will appear here'\n  };\n\n  _setClipboardContent = async () => {\n    Clipboard.setString('Hello World');\n    try {\n      var content = await Clipboard.getString();\n      this.setState({content});\n    } catch (e) {\n      this.setState({content:e.message});\n    }\n  };\n\n  render() {\n    return (\n      <View>\n        <Text onPress={this._setClipboardContent} style={{color: 'blue'}}>\n          Tap to put \"Hello World\" in the clipboard\n        </Text>\n        <Text style={{color: 'red', marginTop: 20}}>\n          {this.state.content}\n        </Text>\n      </View>\n    );\n  }\n}\n\nexports.title = 'Clipboard';\nexports.description = 'Show Clipboard contents.';\nexports.examples = [\n  {\n    title: 'Clipboard.setString() and getString()',\n    render() {\n      return <ClipboardExample/>;\n    }\n  }\n];\n"
  },
  {
    "path": "RNTester/js/DatePickerAndroidExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DatePickerAndroidExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  DatePickerAndroid,\n  StyleSheet,\n  Text,\n  TouchableWithoutFeedback,\n} = ReactNative;\n\nvar RNTesterBlock = require('./RNTesterBlock');\nvar RNTesterPage = require('./RNTesterPage');\n\nclass DatePickerAndroidExample extends React.Component {\n  static title = 'DatePickerAndroid';\n  static description = 'Standard Android date picker dialog';\n\n  state = {\n    presetDate: new Date(2020, 4, 5),\n    simpleDate: new Date(2020, 4, 5),\n    spinnerDate: new Date(2020, 4, 5),\n    calendarDate: new Date(2020, 4, 5),\n    defaultDate: new Date(2020, 4, 5),\n    allDate: new Date(2020, 4, 5),\n    simpleText: 'pick a date',\n    spinnerText: 'pick a date',\n    calendarText: 'pick a date',\n    defaultText: 'pick a date',\n    minText: 'pick a date, no earlier than today',\n    maxText: 'pick a date, no later than today',\n    presetText: 'pick a date, preset to 2020/5/5',\n    allText: 'pick a date between 2020/5/1 and 2020/5/10',\n  };\n\n  showPicker = async (stateKey, options) => {\n    try {\n      var newState = {};\n      const {action, year, month, day} = await DatePickerAndroid.open(options);\n      if (action === DatePickerAndroid.dismissedAction) {\n        newState[stateKey + 'Text'] = 'dismissed';\n      } else {\n        var date = new Date(year, month, day);\n        newState[stateKey + 'Text'] = date.toLocaleDateString();\n        newState[stateKey + 'Date'] = date;\n      }\n      this.setState(newState);\n    } catch ({code, message}) {\n      console.warn(`Error in example '${stateKey}': `, message);\n    }\n  };\n\n  render() {\n    return (\n      <RNTesterPage title=\"DatePickerAndroid\">\n        <RNTesterBlock title=\"Simple date picker\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'simple', {date: this.state.simpleDate})}>\n            <Text style={styles.text}>{this.state.simpleText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Simple spinner date picker\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'spinner', {date: this.state.spinnerDate, mode: 'spinner'})}>\n            <Text style={styles.text}>{this.state.spinnerText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Simple calendar date picker\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'calendar', {date: this.state.calendarDate, mode: 'calendar'})}>\n            <Text style={styles.text}>{this.state.calendarText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Simple default date picker\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'default', {date: this.state.defaultDate, mode: 'default'})}>\n            <Text style={styles.text}>{this.state.defaultText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Date picker with pre-set date\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'preset', {date: this.state.presetDate})}>\n            <Text style={styles.text}>{this.state.presetText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Date picker with minDate\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'min', {\n              date: this.state.minDate,\n              minDate: new Date(),\n            })}>\n            <Text style={styles.text}>{this.state.minText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Date picker with maxDate\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'max', {\n              date: this.state.maxDate,\n              maxDate: new Date(),\n            })}>\n            <Text style={styles.text}>{this.state.maxText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Date picker with all options\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'all', {\n              date: this.state.allDate,\n              minDate: new Date(2020, 4, 1),\n              maxDate: new Date(2020, 4, 10),\n            })}>\n            <Text style={styles.text}>{this.state.allText}</Text>\n          </TouchableWithoutFeedback>\n          </RNTesterBlock>\n      </RNTesterPage>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  text: {\n    color: 'black',\n  },\n});\n\nmodule.exports = DatePickerAndroidExample;\n"
  },
  {
    "path": "RNTester/js/DatePickerIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule DatePickerIOSExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  DatePickerIOS,\n  StyleSheet,\n  Text,\n  TextInput,\n  View,\n} = ReactNative;\n\nclass DatePickerExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  static defaultProps = {\n    date: new Date(),\n    timeZoneOffsetInHours: (-1) * (new Date()).getTimezoneOffset() / 60,\n  };\n\n  state = {\n    date: this.props.date,\n    timeZoneOffsetInHours: this.props.timeZoneOffsetInHours,\n  };\n\n  onDateChange = (date) => {\n    this.setState({date: date});\n  };\n\n  onTimezoneChange = (event) => {\n    var offset = parseInt(event.nativeEvent.text, 10);\n    if (isNaN(offset)) {\n      return;\n    }\n    this.setState({timeZoneOffsetInHours: offset});\n  };\n\n  render() {\n    // Ideally, the timezone input would be a picker rather than a\n    // text input, but we don't have any pickers yet :(\n    return (\n      <View>\n        <WithLabel label=\"Value:\">\n          <Text>{\n            this.state.date.toLocaleDateString() +\n            ' ' +\n            this.state.date.toLocaleTimeString()\n          }</Text>\n        </WithLabel>\n        <WithLabel label=\"Timezone:\">\n          <TextInput\n            onChange={this.onTimezoneChange}\n            style={styles.textinput}\n            value={this.state.timeZoneOffsetInHours.toString()}\n          />\n          <Text> hours from UTC</Text>\n        </WithLabel>\n        <Heading label=\"Date + time picker\" />\n        <DatePickerIOS\n          date={this.state.date}\n          mode=\"datetime\"\n          dataPickerStyle=\"clockAndCalendar\"\n          timeZoneOffsetInMinutes={this.state.timeZoneOffsetInHours * 60}\n          onDateChange={this.onDateChange}\n        />\n        <Heading label=\"Date picker\" />\n        <DatePickerIOS\n          date={this.state.date}\n          mode=\"date\"\n          timeZoneOffsetInMinutes={this.state.timeZoneOffsetInHours * 60}\n          onDateChange={this.onDateChange}\n        />\n      </View>\n    );\n  }\n}\n\nclass WithLabel extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <View style={styles.labelContainer}>\n        <View style={styles.labelView}>\n          <Text style={styles.label}>\n            {this.props.label}\n          </Text>\n        </View>\n        {this.props.children}\n      </View>\n    );\n  }\n}\n\nclass Heading extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <View style={styles.headingContainer}>\n        <Text style={styles.heading}>\n          {this.props.label}\n        </Text>\n      </View>\n    );\n  }\n}\n\nexports.displayName = (undefined: ?string);\nexports.title = '<DatePickerIOS>';\nexports.description = 'Select dates and times using the native UIDatePicker.';\nexports.examples = [\n{\n  title: '<DatePickerIOS>',\n  render: function(): React.Element<any> {\n    return <DatePickerExample />;\n  },\n}];\n\nvar styles = StyleSheet.create({\n  textinput: {\n    height: 26,\n    width: 50,\n    borderWidth: 0.5,\n    borderColor: '#0f0f0f',\n    padding: 4,\n    fontSize: 13,\n  },\n  labelContainer: {\n    flexDirection: 'row',\n    alignItems: 'center',\n    marginVertical: 2,\n  },\n  labelView: {\n    marginRight: 10,\n    paddingVertical: 2,\n  },\n  label: {\n    fontWeight: '500',\n  },\n  headingContainer: {\n    padding: 4,\n    backgroundColor: '#f6f7f8',\n  },\n  heading: {\n    fontWeight: '500',\n    fontSize: 14,\n  },\n});\n"
  },
  {
    "path": "RNTester/js/DimensionsExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DimensionsExample\n * @flow\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  Dimensions,\n  Text,\n  View\n} = ReactNative;\n\nclass DimensionsSubscription extends React.Component<{dim: string}, {dims: Object}> {\n  state = {\n    dims: Dimensions.get(this.props.dim),\n  };\n\n  componentDidMount() {\n    Dimensions.addEventListener('change', this._handleDimensionsChange);\n  }\n\n  componentWillUnmount() {\n    Dimensions.removeEventListener('change', this._handleDimensionsChange);\n  }\n\n  _handleDimensionsChange = (dimensions) => {\n    this.setState({\n      dims: dimensions[this.props.dim],\n    });\n  };\n\n  render() {\n    return (\n      <View>\n        <Text>{JSON.stringify(this.state.dims)}</Text>\n      </View>\n    );\n  }\n}\n\nexports.title = 'Dimensions';\nexports.description = 'Dimensions of the viewport';\nexports.examples = [\n  {\n    title: 'window',\n    render(): React.Element<any> { return <DimensionsSubscription dim=\"window\" />; }\n  },\n  {\n    title: 'screen',\n    render(): React.Element<any> { return <DimensionsSubscription dim=\"screen\" />; }\n  },\n];\n"
  },
  {
    "path": "RNTester/js/DragnDropExample.macos.js",
    "content": "/**\n * The examples provided by Facebook are for non-commercial testing and\n * evaluation purposes only.\n *\n * Facebook reserves all rights not expressly granted.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL\n * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Text,\n  View,\n} = ReactNative;\n\nexports.title = 'Dran\\'n\\'Drop';\nexports.description = 'Dragging APIs';\n\nclass DragExample extends React.Component {\n  state = {\n    dragOver: false,\n    mouseOver: false,\n    files: []\n  };\n\n  render() {\n    return (\n      <View\n        style={{\n          backgroundColor: this.state.dragOver ?\n            'yellow' :\n            this.state.mouseOver ? 'orange' : 'white',\n          padding: 40, alignItems: 'center'}}\n        draggedTypes={['NSFilenamesPboardType']}\n        onMouseEnter={() => this.setState({mouseOver: true})}\n        onMouseLeave={() => this.setState({mouseOver: false})}\n        onDragEnter={() => this.setState({dragOver: true})}\n        onDragLeave={() => this.setState({dragOver: false})}\n        onDrop={(e) => this.setState({files: e.nativeEvent.files, dragOver: false})}>\n        <Text style={{fontSize: 14, color: 'black'}}>\n          {this.state.files.length > 0 ? this.state.files : 'Drag here a file'}\n        </Text>\n\n      </View>\n    );\n  }\n}\n\nexports.displayName = 'Dran\\'n\\'Drop';\nexports.examples = [\n  {\n    title: 'Simple events',\n    render: function() {\n      return (\n        <DragExample />\n      );\n    },\n  }\n];\n"
  },
  {
    "path": "RNTester/js/ExampleTypes.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ExampleTypes\n * @flow\n */\n'use strict';\n\n/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n * suppresses an error when upgrading Flow's support for React. To see the\n * error delete this comment and run Flow. */\nimport type React from 'react';\n\nexport type Example = {\n  title: string,\n  render: () => ?React.Element<any>,\n  description?: string,\n  platform?: string,\n};\n\nexport type ExampleModule = {\n  title: string,\n  description: string,\n  examples: Array<Example>,\n};\n"
  },
  {
    "path": "RNTester/js/FlatListExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule FlatListExample\n */\n'use strict';\n\nconst Alert = require('Alert');\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  Animated,\n  FlatList,\n  StyleSheet,\n  View,\n} = ReactNative;\n\nconst RNTesterPage = require('./RNTesterPage');\n\nconst infoLog = require('infoLog');\n\nconst {\n  FooterComponent,\n  HeaderComponent,\n  ItemComponent,\n  ItemSeparatorComponent,\n  PlainInput,\n  SeparatorComponent,\n  Spindicator,\n  genItemData,\n  getItemLayout,\n  pressItem,\n  renderSmallSwitchOption,\n} = require('./ListExampleShared');\n\nconst AnimatedFlatList = Animated.createAnimatedComponent(FlatList);\n\nconst VIEWABILITY_CONFIG = {\n  minimumViewTime: 3000,\n  viewAreaCoveragePercentThreshold: 100,\n  waitForInteraction: true,\n};\n\nclass FlatListExample extends React.PureComponent<{}, $FlowFixMeState> {\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.getNode().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    {useNativeDriver: true},\n  );\n  _scrollSinkY = Animated.event(\n    [{nativeEvent: { contentOffset: { y: this._scrollPos } }}],\n    {useNativeDriver: true},\n  );\n\n  componentDidUpdate() {\n    this._listRef.getNode().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    );\n    const filteredData = this.state.data.filter(filter);\n    return (\n      <RNTesterPage\n        noSpacer={true}\n        noScroll={true}>\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            ListHeaderComponent={<HeaderComponent />}\n            ListFooterComponent={FooterComponent}\n            data={filteredData}\n            debug={this.state.debug}\n            disableVirtualization={!this.state.virtualized}\n            getItemLayout={this.state.fixedHeight ?\n              this._getItemLayout :\n              undefined\n            }\n            horizontal={this.state.horizontal}\n            inverted={this.state.inverted}\n            key={(this.state.horizontal ? 'h' : 'v') +\n              (this.state.fixedHeight ? 'f' : 'd')\n            }\n            keyboardShouldPersistTaps=\"always\"\n            keyboardDismissMode=\"on-drag\"\n            legacyImplementation={false}\n            numColumns={1}\n            onEndReached={this._onEndReached}\n            onRefresh={this._onRefresh}\n            onScroll={this.state.horizontal ? this._scrollSinkX : this._scrollSinkY}\n            onViewableItemsChanged={this._onViewableItemsChanged}\n            ref={this._captureRef}\n            refreshing={false}\n            renderItem={this._renderItemComponent}\n            contentContainerStyle={styles.list}\n            viewabilityConfig={VIEWABILITY_CONFIG}\n          />\n        </View>\n      </RNTesterPage>\n    );\n  }\n  _captureRef = (ref) => { this._listRef = ref; };\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 = () => Alert.alert('onRefresh: nothing to refresh :P');\n  _renderItemComponent = ({item, separators}) => {\n    return (\n      <ItemComponent\n        item={item}\n        horizontal={this.state.horizontal}\n        fixedHeight={this.state.fixedHeight}\n        onPress={this._pressItem}\n        onShowUnderlay={separators.highlight}\n        onHideUnderlay={separators.unhighlight}\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  ) => {\n    // Impressions can be logged here\n    if (this.state.logViewable) {\n      infoLog(\n        'onViewableItemsChanged: ',\n        info.changed.map((v) => ({...v, item: '...'})),\n      );\n    }\n  };\n  _pressItem = (key: string) => {\n    this._listRef.getNode().recordInteraction();\n    pressItem(this, key);\n  };\n  _listRef: AnimatedFlatList;\n}\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    paddingHorizontal: 10,\n  },\n});\n\nmodule.exports = FlatListExample;\n"
  },
  {
    "path": "RNTester/js/GeolocationExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule GeolocationExample\n */\n'use strict';\n\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nexports.framework = 'React';\nexports.title = 'Geolocation';\nexports.description = 'Examples of using the Geolocation API.';\n\nexports.examples = [\n  {\n    title: 'navigator.geolocation',\n    render: function(): React.Element<any> {\n      return <GeolocationExample />;\n    },\n  }\n];\n\nclass GeolocationExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    initialPosition: 'unknown',\n    lastPosition: 'unknown',\n  };\n\n  watchID: ?number = null;\n\n  componentDidMount() {\n    navigator.geolocation.getCurrentPosition(\n      (position) => {\n        var initialPosition = JSON.stringify(position);\n        this.setState({initialPosition});\n      },\n      (error) => alert(JSON.stringify(error)),\n      {enableHighAccuracy: true, timeout: 20000, maximumAge: 1000}\n    );\n    this.watchID = navigator.geolocation.watchPosition((position) => {\n      var lastPosition = JSON.stringify(position);\n      this.setState({lastPosition});\n    });\n  }\n\n  componentWillUnmount() {\n    this.watchID != null && navigator.geolocation.clearWatch(this.watchID);\n  }\n\n  render() {\n    return (\n      <View>\n        <Text>\n          <Text style={styles.title}>Initial position: </Text>\n          {this.state.initialPosition}\n        </Text>\n        <Text>\n          <Text style={styles.title}>Current position: </Text>\n          {this.state.lastPosition}\n        </Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  title: {\n    fontWeight: '500',\n  },\n});\n"
  },
  {
    "path": "RNTester/js/ImageCapInsetsExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ImageCapInsetsExample\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\n\nvar nativeImageSource = require('nativeImageSource');\nvar {\n  Image,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nclass ImageCapInsetsExample extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <View style={styles.background}>\n          <Text>\n            capInsets: none\n          </Text>\n          <Image\n            source={nativeImageSource({\n              ios: 'story-background',\n              width: 60,\n              height: 60\n            })}\n            style={styles.storyBackground}\n            resizeMode={Image.resizeMode.stretch}\n            capInsets={{left: 0, right: 0, bottom: 0, top: 0}}\n          />\n        </View>\n        <View style={[styles.background, {paddingTop: 10}]}>\n          <Text>\n            capInsets: 15\n          </Text>\n          <Image\n            source={nativeImageSource({\n              ios: 'story-background',\n              width: 60,\n              height: 60\n            })}\n            style={styles.storyBackground}\n            resizeMode={Image.resizeMode.stretch}\n            capInsets={{left: 15, right: 15, bottom: 15, top: 15}}\n          />\n        </View>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  background: {\n    backgroundColor: '#F6F6F6',\n    justifyContent: 'center',\n    alignItems: 'center',\n  },\n  horizontal: {\n    flexDirection: 'row',\n  },\n  storyBackground: {\n    width: 250,\n    height: 150,\n    borderWidth: 1,\n  },\n  text: {\n    fontSize: 13.5,\n  }\n});\n\nmodule.exports = ImageCapInsetsExample;\n"
  },
  {
    "path": "RNTester/js/ImageEditingExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ImageEditingExample\n */\n"
  },
  {
    "path": "RNTester/js/ImageExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ImageExample\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\nvar {\n  ActivityIndicator,\n  Image,\n  Platform,\n  StyleSheet,\n  Text,\n  View,\n  ImageBackground,\n} = ReactNative;\n\nvar base64Icon = '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==';\n\nvar ImageCapInsetsExample = require('./ImageCapInsetsExample');\nconst IMAGE_PREFETCH_URL = 'http://origami.design/public/images/bird-logo.png?r=1&t=' + Date.now();\nvar prefetchTask = Image.prefetch(IMAGE_PREFETCH_URL);\n\n/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an error\n * found when Flow v0.63 was deployed. To see the error delete this comment and\n * run Flow. */\nvar NetworkImageCallbackExample = createReactClass({\n  displayName: 'NetworkImageCallbackExample',\n  getInitialState: function() {\n    return {\n      events: [],\n      startLoadPrefetched: false,\n      mountTime: new Date(),\n    };\n  },\n\n  componentWillMount() {\n    this.setState({mountTime: new Date()});\n  },\n\n  render: function() {\n    var { mountTime } = this.state;\n\n    return (\n      <View>\n        <Image\n          source={this.props.source}\n          style={[styles.base, {overflow: 'visible'}]}\n          onLoadStart={() => this._loadEventFired(`✔ onLoadStart (+${new Date() - mountTime}ms)`)}\n          onLoad={(event) => {\n            // Currently this image source feature is only available on iOS.\n            if (event.nativeEvent.source) {\n              const url = event.nativeEvent.source.url;\n              this._loadEventFired(`✔ onLoad (+${new Date() - mountTime}ms) for URL ${url}`);\n            } else {\n              this._loadEventFired(`✔ onLoad (+${new Date() - mountTime}ms)`);\n            }\n          }}\n          onLoadEnd={() => {\n            this._loadEventFired(`✔ onLoadEnd (+${new Date() - mountTime}ms)`);\n            this.setState({startLoadPrefetched: true}, () => {\n              prefetchTask.then(() => {\n                this._loadEventFired(`✔ Prefetch OK (+${new Date() - mountTime}ms)`);\n              }, error => {\n                this._loadEventFired(`✘ Prefetch failed (+${new Date() - mountTime}ms)`);\n              });\n            });\n          }}\n        />\n        {this.state.startLoadPrefetched ?\n          <Image\n            source={this.props.prefetchedSource}\n            style={[styles.base, {overflow: 'visible'}]}\n            onLoadStart={() => this._loadEventFired(`✔ (prefetched) onLoadStart (+${new Date() - mountTime}ms)`)}\n            onLoad={(event) => {\n              // Currently this image source feature is only available on iOS.\n              if (event.nativeEvent.source) {\n                const url = event.nativeEvent.source.url;\n                this._loadEventFired(`✔ (prefetched) onLoad (+${new Date() - mountTime}ms) for URL ${url}`);\n              } else {\n                this._loadEventFired(`✔ (prefetched) onLoad (+${new Date() - mountTime}ms)`);\n              }\n            }}\n            onLoadEnd={() => this._loadEventFired(`✔ (prefetched) onLoadEnd (+${new Date() - mountTime}ms)`)}\n          />\n          : null}\n        <Text style={{marginTop: 20}}>\n          {this.state.events.join('\\n')}\n        </Text>\n      </View>\n    );\n  },\n\n  _loadEventFired(event) {\n    this.setState((state) => {\n      return state.events = [...state.events, event];\n    });\n  }\n});\n\nvar NetworkImageExample = createReactClass({\n  getInitialState: function() {\n    return {\n      error: false,\n      loading: false,\n      progress: 0\n    };\n  },\n  render: function() {\n    var loader = this.state.loading ?\n      <View style={styles.progress}>\n        <Text>{this.state.progress}%</Text>\n        <ActivityIndicator style={{marginLeft:5}} />\n      </View> : null;\n    return this.state.error ?\n      <Text>{this.state.error}</Text> :\n      <ImageBackground\n        source={this.props.source}\n        style={[styles.base, {overflow: 'visible'}]}\n        onLoadStart={(e) => this.setState({loading: true})}\n        onError={(e) => this.setState({error: e.nativeEvent.error, loading: false})}\n        onProgress={(e) => this.setState({progress: Math.round(100 * e.nativeEvent.loaded / e.nativeEvent.total)})}\n        onLoad={() => this.setState({loading: false, error: false})}>\n        {loader}\n      </ImageBackground>;\n  }\n});\n\nvar ImageSizeExample = createReactClass({\n  getInitialState: function() {\n    return {\n      width: 0,\n      height: 0,\n    };\n  },\n  componentDidMount: function() {\n    Image.getSize(this.props.source.uri, (width, height) => {\n      this.setState({width, height});\n    });\n  },\n  render: function() {\n    return (\n      <View style={{flexDirection: 'row'}}>\n        <Image\n          style={{\n            width: 60,\n            height: 60,\n            backgroundColor: 'transparent',\n            marginRight: 10,\n          }}\n          source={this.props.source} />\n        <Text>\n          Actual dimensions:{'\\n'}\n          Width: {this.state.width}, Height: {this.state.height}\n        </Text>\n      </View>\n    );\n  },\n});\n\nvar MultipleSourcesExample = createReactClass({\n  getInitialState: function() {\n    return {\n      width: 30,\n      height: 30,\n    };\n  },\n  render: function() {\n    return (\n      <View>\n        <View style={{flexDirection: 'row', justifyContent: 'space-between'}}>\n          <Text\n            style={styles.touchableText}\n            onPress={this.decreaseImageSize} >\n            Decrease image size\n          </Text>\n          <Text\n            style={styles.touchableText}\n            onPress={this.increaseImageSize} >\n            Increase image size\n          </Text>\n        </View>\n        <Text>Container image size: {this.state.width}x{this.state.height} </Text>\n        <View\n          style={{height: this.state.height, width: this.state.width}} >\n          <Image\n            style={{flex: 1}}\n            source={[\n              {uri: 'https://facebook.github.io/react-native/img/favicon.png', width: 38, height: 38},\n              {uri: 'https://facebook.github.io/react-native/img/favicon.png', width: 76, height: 76},\n              {uri: 'https://facebook.github.io/react-native/img/opengraph.png', width: 400, height: 400}\n            ]}\n          />\n        </View>\n      </View>\n    );\n  },\n  increaseImageSize: function() {\n    if (this.state.width >= 100) {\n      return;\n    }\n    this.setState({\n      width: this.state.width + 10,\n      height: this.state.height + 10,\n    });\n  },\n  decreaseImageSize: function() {\n    if (this.state.width <= 10) {\n      return;\n    }\n    this.setState({\n      width: this.state.width - 10,\n      height: this.state.height - 10,\n    });\n  },\n});\n\nexports.displayName = (undefined: ?string);\nexports.framework = 'React';\nexports.title = '<Image>';\nexports.description = 'Base component for displaying different types of images.';\n\nexports.examples = [\n  {\n    title: 'Plain Network Image',\n    description: 'If the `source` prop `uri` property is prefixed with ' +\n    '\"http\", then it will be downloaded from the network.',\n    render: function() {\n      return (\n        <Image\n          source={fullImage}\n          style={styles.base}\n        />\n      );\n    },\n  },\n  {\n    title: 'Plain Static Image',\n    description: 'Static assets should be placed in the source code tree, and ' +\n    'required in the same way as JavaScript modules.',\n    render: function() {\n      return (\n        <View style={styles.horizontal}>\n          <Image source={require('./uie_thumb_normal.png')} style={styles.icon} />\n          <Image source={require('./uie_thumb_selected.png')} style={styles.icon} />\n          <Image source={require('./uie_comment_normal.png')} style={styles.icon} />\n          <Image source={require('./uie_comment_highlighted.png')} style={styles.icon} />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Image Loading Events',\n    render: function() {\n      return (\n        <NetworkImageCallbackExample source={{uri: 'http://origami.design/public/images/bird-logo.png?r=1&t=' + Date.now()}}\n          prefetchedSource={{uri: IMAGE_PREFETCH_URL}}/>\n      );\n    },\n  },\n  {\n    title: 'Error Handler',\n    render: function() {\n      return (\n        <NetworkImageExample source={{uri: 'https://TYPO_ERROR_facebook.github.io/react/logo-og.png'}} />\n      );\n    },\n    platform: 'ios',\n  },\n  {\n    title: 'Image Download Progress',\n    render: function() {\n      return (\n        <NetworkImageExample source={{uri: 'http://origami.design/public/images/bird-logo.png?r=1'}}/>\n      );\n    },\n    platform: 'ios',\n  },\n  {\n    title: 'defaultSource',\n    description: 'Show a placeholder image when a network image is loading',\n    render: function() {\n      return (\n        <Image\n          defaultSource={require('./bunny.png')}\n          source={{uri: 'https://facebook.github.io/origami/public/images/birds.jpg'}}\n          style={styles.base}\n        />\n      );\n    },\n    platform: 'ios',\n  },\n  {\n    title: 'Cache Policy',\n    description: 'First image has never been loaded before and is instructed not to load unless in cache.' +\n    'Placeholder image from above will stay. Second image is the same but forced to load regardless of' +\n    ' local cache state.',\n    render: function () {\n      return (\n        <View style={styles.horizontal}>\n          <Image\n            defaultSource={require('./bunny.png')}\n            source={{\n              uri: smallImage.uri + '?cacheBust=notinCache' + Date.now(),\n              cache: 'only-if-cached'\n            }}\n            style={styles.base}\n          />\n          <Image\n            defaultSource={require('./bunny.png')}\n            source={{\n              uri: smallImage.uri + '?cacheBust=notinCache' + Date.now(),\n              cache: 'reload'\n            }}\n            style={styles.base}\n          />\n        </View>\n      );\n    },\n    platform: 'ios',\n  },\n  {\n    title: 'Border Color',\n    render: function() {\n      return (\n        <View style={styles.horizontal}>\n          <Image\n            source={smallImage}\n            style={[\n              styles.base,\n              styles.background,\n              {borderWidth: 3, borderColor: '#f099f0'}\n            ]}\n          />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Border Width',\n    render: function() {\n      return (\n        <View style={styles.horizontal}>\n          <Image\n            source={smallImage}\n            style={[\n              styles.base,\n              styles.background,\n              {borderWidth: 5, borderColor: '#f099f0'}\n            ]}\n          />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Border Radius',\n    render: function() {\n      return (\n        <View style={styles.horizontal}>\n          <Image\n            style={[styles.base, {borderRadius: 5}]}\n            source={fullImage}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin, {borderRadius: 19}]}\n            source={fullImage}\n          />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Background Color',\n    render: function() {\n      return (\n        <View style={styles.horizontal}>\n          <Image source={smallImage} style={styles.base} />\n          <Image\n            style={[\n              styles.base,\n              styles.leftMargin,\n              {backgroundColor: 'rgba(0, 0, 100, 0.25)'}\n            ]}\n            source={smallImage}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin, {backgroundColor: 'red'}]}\n            source={smallImage}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin, {backgroundColor: 'black'}]}\n            source={smallImage}\n          />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Opacity',\n    render: function() {\n      return (\n        <View style={styles.horizontal}>\n          <Image\n            style={[styles.base, {opacity: 1}]}\n            source={fullImage}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin, {opacity: 0.8}]}\n            source={fullImage}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin, {opacity: 0.6}]}\n            source={fullImage}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin, {opacity: 0.4}]}\n            source={fullImage}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin, {opacity: 0.2}]}\n            source={fullImage}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin, {opacity: 0}]}\n            source={fullImage}\n          />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Nesting content inside <Image> component',\n    render: function() {\n      return (\n        <View style={{width: 60, height: 60}}>\n          <Image\n            style={{...StyleSheet.absoluteFillObject}}\n            source={fullImage}/>\n          <Text style={styles.nestedText}>\n            React\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Nesting content inside <ImageBackground> component',\n    render: function() {\n      return (\n        <ImageBackground\n          style={{width: 60, height: 60, backgroundColor: 'transparent'}}\n          source={fullImage}>\n          <Text style={styles.nestedText}>\n            React\n          </Text>\n        </ImageBackground>\n      );\n    },\n  },\n  {\n    title: 'Tint Color',\n    description: 'The `tintColor` style prop changes all the non-alpha ' +\n      'pixels to the tint color.',\n    render: function() {\n      return (\n        <View>\n          <View style={styles.horizontal}>\n            <Image\n              source={require('./uie_thumb_normal.png')}\n              style={[styles.icon, {borderRadius: 5, tintColor: '#5ac8fa' }]}\n            />\n            <Image\n              source={require('./uie_thumb_normal.png')}\n              style={[styles.icon, styles.leftMargin, {borderRadius: 5, tintColor: '#4cd964' }]}\n            />\n            <Image\n              source={require('./uie_thumb_normal.png')}\n              style={[styles.icon, styles.leftMargin, {borderRadius: 5, tintColor: '#ff2d55' }]}\n            />\n            <Image\n              source={require('./uie_thumb_normal.png')}\n              style={[styles.icon, styles.leftMargin, {borderRadius: 5, tintColor: '#8e8e93' }]}\n            />\n          </View>\n          <Text style={styles.sectionText}>\n            It also works with downloaded images:\n          </Text>\n          <View style={styles.horizontal}>\n            <Image\n              source={smallImage}\n              style={[styles.base, {borderRadius: 5, tintColor: '#5ac8fa' }]}\n            />\n            <Image\n              source={smallImage}\n              style={[styles.base, styles.leftMargin, {borderRadius: 5, tintColor: '#4cd964' }]}\n            />\n            <Image\n              source={smallImage}\n              style={[styles.base, styles.leftMargin, {borderRadius: 5, tintColor: '#ff2d55' }]}\n            />\n            <Image\n              source={smallImage}\n              style={[styles.base, styles.leftMargin, {borderRadius: 5, tintColor: '#8e8e93' }]}\n            />\n          </View>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Resize Mode',\n    description: 'The `resizeMode` style prop controls how the image is ' +\n      'rendered within the frame.',\n    render: function() {\n      return (\n        <View>\n          {[smallImage, fullImage].map((image, index) => {\n            return (\n            <View key={index}>\n              <View style={styles.horizontal}>\n                <View>\n                  <Text style={[styles.resizeModeText]}>\n                    Contain\n                  </Text>\n                  <Image\n                    style={styles.resizeMode}\n                    resizeMode={Image.resizeMode.contain}\n                    source={image}\n                  />\n                </View>\n                <View style={styles.leftMargin}>\n                  <Text style={[styles.resizeModeText]}>\n                    Cover\n                  </Text>\n                  <Image\n                    style={styles.resizeMode}\n                    resizeMode={Image.resizeMode.cover}\n                    source={image}\n                  />\n                </View>\n              </View>\n              <View style={styles.horizontal}>\n                <View>\n                  <Text style={[styles.resizeModeText]}>\n                    Stretch\n                  </Text>\n                  <Image\n                    style={styles.resizeMode}\n                    resizeMode={Image.resizeMode.stretch}\n                    source={image}\n                  />\n                </View>\n                { Platform.OS === 'ios' ?\n                  <View style={styles.leftMargin}>\n                    <Text style={[styles.resizeModeText]}>\n                      Repeat\n                    </Text>\n                    <Image\n                      style={styles.resizeMode}\n                      resizeMode={Image.resizeMode.repeat}\n                      source={image}\n                    />\n                  </View>\n                : null }\n                { Platform.OS === 'android' ?\n                  <View style={styles.leftMargin}>\n                    <Text style={[styles.resizeModeText]}>\n                      Center\n                    </Text>\n                    <Image\n                      style={styles.resizeMode}\n                      resizeMode={Image.resizeMode.center}\n                      source={image}\n                    />\n                  </View>\n                : null }\n              </View>\n            </View>\n          );\n        })}\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Animated GIF',\n    render: function() {\n      return (\n        <Image\n          style={styles.gif}\n          source={{uri: 'https://38.media.tumblr.com/9e9bd08c6e2d10561dd1fb4197df4c4e/tumblr_mfqekpMktw1rn90umo1_500.gif'}}\n        />\n      );\n    },\n    platform: 'ios',\n  },\n  {\n    title: 'Base64 image',\n    render: function() {\n      return (\n        <Image\n          style={styles.base64}\n          source={{uri: base64Icon, scale: 3}}\n        />\n      );\n    },\n    platform: 'ios',\n  },\n  {\n    title: 'Cap Insets',\n    description:\n      'When the image is resized, the corners of the size specified ' +\n      'by capInsets will stay a fixed size, but the center content and ' +\n      'borders of the image will be stretched. This is useful for creating ' +\n      'resizable rounded buttons, shadows, and other resizable assets.',\n    render: function() {\n      return <ImageCapInsetsExample />;\n    },\n    platform: 'ios',\n  },\n  {\n    title: 'Image Size',\n    render: function() {\n      return <ImageSizeExample source={fullImage} />;\n    },\n  },\n  {\n    title: 'MultipleSourcesExample',\n    description:\n      'The `source` prop allows passing in an array of uris, so that native to choose which image ' +\n      'to diplay based on the size of the of the target image',\n    render: function() {\n      return <MultipleSourcesExample />;\n    },\n  },\n  {\n    title: 'Legacy local image',\n    description:\n      'Images shipped with the native bundle, but not managed ' +\n      'by the JS packager',\n    render: function() {\n      return (\n        <Image\n          source={{uri: 'legacy_image', width: 120, height: 120}}\n        />\n      );\n    },\n  },\n  {\n    title: 'Bundled images',\n    description:\n      'Images shipped in a separate native bundle',\n    render: function() {\n      return (\n        <View style={{flexDirection: 'row'}}>\n          <Image\n            source={{\n              uri: 'ImageInBundle',\n              bundle: 'RNTesterBundle',\n              width: 100,\n              height: 100,\n            }}\n            style={{borderColor: 'yellow', borderWidth: 4}}\n          />\n          <Image\n            source={{\n              uri: 'ImageInAssetCatalog',\n              bundle: 'RNTesterBundle',\n              width: 100,\n              height: 100,\n            }}\n            style={{marginLeft: 10, borderColor: 'blue', borderWidth: 4}}\n          />\n        </View>\n      );\n    },\n    platform: 'ios',\n  },\n  {\n    title: 'Blur Radius',\n    render: function() {\n      return (\n        <View style={styles.horizontal}>\n          <Image\n            style={[styles.base,]}\n            source={fullImage}\n            blurRadius={0}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin]}\n            source={fullImage}\n            blurRadius={5}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin]}\n            source={fullImage}\n            blurRadius={10}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin]}\n            source={fullImage}\n            blurRadius={15}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin]}\n            source={fullImage}\n            blurRadius={20}\n          />\n          <Image\n            style={[styles.base, styles.leftMargin]}\n            source={fullImage}\n            blurRadius={25}\n          />\n        </View>\n      );\n    },\n  },\n];\n\nvar fullImage = {uri: 'https://facebook.github.io/react-native/img/opengraph.png'};\nvar smallImage = {uri: 'https://facebook.github.io/react-native/img/favicon.png'};\n\nvar styles = StyleSheet.create({\n  base: {\n    width: 38,\n    height: 38,\n  },\n  progress: {\n    flex: 1,\n    alignItems: 'center',\n    flexDirection: 'row',\n    width: 100\n  },\n  leftMargin: {\n    marginLeft: 10,\n  },\n  background: {\n    backgroundColor: '#222222'\n  },\n  sectionText: {\n    marginVertical: 6,\n  },\n  nestedText: {\n    marginLeft: 12,\n    marginTop: 20,\n    backgroundColor: 'transparent',\n    color: 'white'\n  },\n  resizeMode: {\n    width: 90,\n    height: 60,\n    borderWidth: 0.5,\n    borderColor: 'black'\n  },\n  resizeModeText: {\n    fontSize: 11,\n    marginBottom: 3,\n  },\n  icon: {\n    width: 15,\n    height: 15,\n  },\n  horizontal: {\n    flexDirection: 'row',\n  },\n  gif: {\n    flex: 1,\n    height: 200,\n  },\n  base64: {\n    flex: 1,\n    height: 50,\n    resizeMode: 'contain',\n  },\n  touchableText: {\n    fontWeight: '500',\n    color: 'blue',\n  },\n});\n"
  },
  {
    "path": "RNTester/js/KeyboardAvoidingViewExample.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule KeyboardAvoidingViewExample\n */\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\nconst {\n  KeyboardAvoidingView,\n  Modal,\n  SegmentedControlIOS,\n  StyleSheet,\n  Text,\n  TextInput,\n  TouchableHighlight,\n  View,\n} = ReactNative;\n\nconst RNTesterBlock = require('./RNTesterBlock');\nconst RNTesterPage = require('./RNTesterPage');\n\nclass KeyboardAvoidingViewExample extends React.Component {\n  static title = '<KeyboardAvoidingView>';\n  static description = 'Base component for views that automatically adjust their height or position to move out of the way of the keyboard.';\n\n  state = {\n    behavior: 'padding',\n    modalOpen: false,\n  };\n\n  onSegmentChange = (segment: String) => {\n    this.setState({behavior: segment.toLowerCase()});\n  };\n\n  renderExample = () => {\n    return (\n      <View style={styles.outerContainer}>\n        <Modal animationType=\"fade\" visible={this.state.modalOpen}>\n          <KeyboardAvoidingView behavior={this.state.behavior} style={styles.container}>\n            <SegmentedControlIOS\n              onValueChange={this.onSegmentChange}\n              selectedIndex={this.state.behavior === 'padding' ? 0 : 1}\n              style={styles.segment}\n              values={['Padding', 'Position']} />\n            <TextInput\n              placeholder=\"<TextInput />\"\n              style={styles.textInput} />\n          </KeyboardAvoidingView>\n          <TouchableHighlight\n            onPress={() => this.setState({modalOpen: false})}\n            style={styles.closeButton}>\n            <Text>Close</Text>\n          </TouchableHighlight>\n        </Modal>\n\n        <TouchableHighlight onPress={() => this.setState({modalOpen: true})}>\n          <Text>Open Example</Text>\n        </TouchableHighlight>\n      </View>\n    );\n  };\n\n  render() {\n    return (\n      <RNTesterPage title=\"Keyboard Avoiding View\">\n        <RNTesterBlock title=\"Keyboard-avoiding views move out of the way of the keyboard.\">\n          {this.renderExample()}\n        </RNTesterBlock>\n      </RNTesterPage>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  outerContainer: {\n    flex: 1,\n  },\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    paddingHorizontal: 20,\n    paddingTop: 20,\n  },\n  textInput: {\n    borderRadius: 5,\n    borderWidth: 1,\n    height: 44,\n    paddingHorizontal: 10,\n  },\n  segment: {\n    marginBottom: 10,\n  },\n  closeButton: {\n    position: 'absolute',\n    top: 30,\n    left: 10,\n  }\n});\n\nmodule.exports = KeyboardAvoidingViewExample;\n"
  },
  {
    "path": "RNTester/js/LayoutAnimationExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule LayoutAnimationExample\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  LayoutAnimation,\n  StyleSheet,\n  Text,\n  View,\n  TouchableOpacity,\n} = ReactNative;\n\nclass AddRemoveExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    views: [],\n  };\n\n  componentWillUpdate() {\n    LayoutAnimation.easeInEaseOut();\n  }\n\n  _onPressAddView = () => {\n    this.setState((state) => ({views: [...state.views, {}]}));\n  };\n\n  _onPressRemoveView = () => {\n    this.setState((state) => ({views: state.views.slice(0, -1)}));\n  };\n\n  render() {\n    const views = this.state.views.map((view, i) =>\n      <View key={i} style={styles.view}>\n        <Text>{i}</Text>\n      </View>\n    );\n    return (\n      <View style={styles.container}>\n        <TouchableOpacity onPress={this._onPressAddView}>\n          <View style={styles.button}>\n            <Text>Add view</Text>\n          </View>\n        </TouchableOpacity>\n        <TouchableOpacity onPress={this._onPressRemoveView}>\n          <View style={styles.button}>\n            <Text>Remove view</Text>\n          </View>\n        </TouchableOpacity>\n        <View style={styles.viewContainer}>\n          {views}\n        </View>\n      </View>\n    );\n  }\n}\n\nconst GreenSquare = () =>\n  <View style={styles.greenSquare}>\n    <Text>Green square</Text>\n  </View>;\n\nconst BlueSquare = () =>\n  <View style={styles.blueSquare}>\n    <Text>Blue square</Text>\n  </View>;\n\nclass CrossFadeExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    toggled: false,\n  };\n\n  _onPressToggle = () => {\n    LayoutAnimation.easeInEaseOut();\n    this.setState((state) => ({toggled: !state.toggled}));\n  };\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <TouchableOpacity onPress={this._onPressToggle}>\n          <View style={styles.button}>\n            <Text>Toggle</Text>\n          </View>\n        </TouchableOpacity>\n        <View style={styles.viewContainer}>\n          {\n            this.state.toggled ?\n            <GreenSquare /> :\n            <BlueSquare />\n          }\n        </View>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  button: {\n    borderRadius: 5,\n    backgroundColor: '#eeeeee',\n    padding: 10,\n    marginBottom: 10,\n  },\n  buttonText: {\n    fontSize: 16,\n  },\n  viewContainer: {\n    flex: 1,\n    flexDirection: 'row',\n    flexWrap: 'wrap',\n  },\n  view: {\n    height: 54,\n    width: 54,\n    backgroundColor: 'red',\n    margin: 8,\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  greenSquare: {\n    width: 150,\n    height: 150,\n    backgroundColor: 'green',\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  blueSquare: {\n    width: 150,\n    height: 150,\n    backgroundColor: 'blue',\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n});\n\nexports.title = 'Layout Animation';\nexports.description = 'Layout animation';\nexports.examples = [{\n  title: 'Add and remove views',\n  render(): React.Element<any> {\n    return <AddRemoveExample />;\n  },\n}, {\n  title: 'Cross fade views',\n  render(): React.Element<any> {\n    return <CrossFadeExample />;\n  },\n}];\n"
  },
  {
    "path": "RNTester/js/LayoutEventsExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule LayoutEventsExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  LayoutAnimation,\n  StyleSheet,\n  Text,\n  View,\n  TouchableOpacity\n} = ReactNative;\n\nimport type {ViewLayout, ViewLayoutEvent} from 'ViewPropTypes';\n\ntype State = {\n  containerStyle?: { width: number },\n  extraText?: string,\n  imageLayout?: ViewLayout,\n  textLayout?: ViewLayout,\n  viewLayout?: ViewLayout,\n  viewStyle: { margin: number },\n};\n\nclass LayoutEventExample extends React.Component<{}, State> {\n  state: State = {\n    viewStyle: {\n      margin: 20,\n    },\n  };\n\n  animateViewLayout = () => {\n    // LayoutAnimation.configureNext(\n    //   LayoutAnimation.Presets.spring,\n    //   () => {\n    //     console.log('layout animation done.');\n    //     this.addWrapText();\n    //   }\n    // );\n    LayoutAnimation.easeInEaseOut();\n    this.setState({\n      viewStyle: {\n        margin: this.state.viewStyle.margin > 20 ? 20 : 60,\n      }\n    });\n  };\n\n  addWrapText = () => {\n    this.setState(\n      {extraText: '  And a bunch more text to wrap around a few lines.'},\n      this.changeContainer\n    );\n  };\n\n  changeContainer = () => {\n    this.setState({containerStyle: {width: 280}});\n  };\n\n  onViewLayout = (e: ViewLayoutEvent) => {\n    console.log('received view layout event\\n', e.nativeEvent);\n    this.setState({viewLayout: e.nativeEvent.layout});\n  };\n\n  onTextLayout = (e: ViewLayoutEvent) => {\n    console.log('received text layout event\\n', e.nativeEvent);\n    this.setState({textLayout: e.nativeEvent.layout});\n  };\n\n  onImageLayout = (e: ViewLayoutEvent) => {\n    console.log('received image layout event\\n', e.nativeEvent);\n    this.setState({imageLayout: e.nativeEvent.layout});\n  };\n\n  render() {\n    var viewStyle = [styles.view, this.state.viewStyle];\n    var textLayout = this.state.textLayout || {width: '?', height: '?'};\n    var imageLayout = this.state.imageLayout || {x: '?', y: '?'};\n    return (\n      <View style={this.state.containerStyle}>\n        <Text>\n          layout events are called on mount and whenever layout is recalculated. Note that the layout event will typically be received <Text style={styles.italicText}>before</Text> the layout has updated on screen, especially when using layout animations.{'  '}\n        </Text>\n        <TouchableOpacity onPress={this.animateViewLayout}>\n          <Text style={styles.pressText}>\n            Press here to change layout.\n          </Text>\n        </TouchableOpacity>\n        <View ref=\"view\" onLayout={this.onViewLayout} style={viewStyle}>\n          <Image\n            ref=\"img\"\n            onLayout={this.onImageLayout}\n            style={styles.image}\n            source={{uri: 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-prn1/t39.1997/p128x128/851561_767334496626293_1958532586_n.png'}}\n          />\n          <Text>\n            ViewLayout: {JSON.stringify(this.state.viewLayout, null, '  ') + '\\n\\n'}\n          </Text>\n          <Text ref=\"txt\" onLayout={this.onTextLayout} style={styles.text}>\n            A simple piece of text.{this.state.extraText}\n          </Text>\n          <Text>\n            {'\\n'}\n            Text w/h: {textLayout.width}/{textLayout.height + '\\n'}\n            Image x/y: {imageLayout.x}/{imageLayout.y}\n          </Text>\n        </View>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  view: {\n    padding: 12,\n    borderWidth: 0.5,\n    backgroundColor: 'rgba(0, 0, 0, 0.1)',\n  },\n  text: {\n    alignSelf: 'flex-start',\n    borderColor: 'rgba(0, 0, 255, 0.2)',\n    borderWidth: 0.5,\n  },\n  image: {\n    width: 50,\n    height: 50,\n    marginBottom: 10,\n    alignSelf: 'center',\n  },\n  pressText: {\n    fontWeight: 'bold',\n  },\n  italicText: {\n    fontStyle: 'italic',\n  },\n});\n\nexports.title = 'Layout Events';\nexports.description = 'Examples that show how Layout events can be used to ' +\n  'measure view size and position.';\nexports.examples = [\n{\n  title: 'LayoutEventExample',\n  render: function(): React.Element<any> {\n    return <LayoutEventExample />;\n  },\n}];\n"
  },
  {
    "path": "RNTester/js/LayoutExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule LayoutExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nvar RNTesterBlock = require('./RNTesterBlock');\nvar RNTesterPage = require('./RNTesterPage');\n\nclass Circle extends React.Component<$FlowFixMeProps> {\n  render() {\n    var size = this.props.size || 20;\n    var backgroundColor = this.props.bgColor || '#527fe4';\n    return (\n      <View\n        style={{\n          borderRadius: size / 2,\n          backgroundColor: backgroundColor,\n          width: size,\n          height: size,\n          margin: 1,\n        }}\n      />\n    );\n  }\n}\n\nclass CircleBlock extends React.Component<$FlowFixMeProps> {\n  render() {\n    var circleStyle = {\n      flexDirection: 'row',\n      backgroundColor: '#f6f7f8',\n      borderWidth: 0.5,\n      borderColor: '#d6d7da',\n      marginBottom: 2,\n    };\n    return (\n      <View style={[circleStyle, this.props.style]}>\n        {this.props.children}\n      </View>\n    );\n  }\n}\n\nclass LayoutExample extends React.Component<$FlowFixMeProps> {\n  static title = 'Layout - Flexbox';\n  static description = 'Examples of using the flexbox API to layout views.';\n  static displayName = 'LayoutExample';\n\n  render() {\n    var fiveColoredCircles = [\n      <Circle bgColor=\"#527fe4\" key=\"blue\" />,\n      <Circle bgColor=\"#D443E3\" key=\"violet\" />,\n      <Circle bgColor=\"#FF9049\" key=\"orange\" />,\n      <Circle bgColor=\"#FFE649\" key=\"yellow\" />,\n      <Circle bgColor=\"#7FE040\" key=\"green\" />\n    ];\n\n    return (\n      <RNTesterPage title={this.props.navigator ? null : 'Layout'}>\n        <RNTesterBlock title=\"Flex Direction\">\n          <Text>row</Text>\n          <CircleBlock style={{flexDirection: 'row'}}>\n            {fiveColoredCircles}\n          </CircleBlock>\n          <Text>row-reverse</Text>\n          <CircleBlock style={{flexDirection: 'row-reverse'}}>\n            {fiveColoredCircles}\n          </CircleBlock>\n          <Text>column</Text>\n          <CircleBlock style={{flexDirection: 'column'}}>\n            {fiveColoredCircles}\n          </CircleBlock>\n          <Text>column-reverse</Text>\n          <CircleBlock style={{flexDirection: 'column-reverse'}}>\n            {fiveColoredCircles}\n          </CircleBlock>\n          <View style={[styles.overlay, {position: 'absolute', top: 15, left: 160}]}>\n            <Text>{'top: 15, left: 160'}</Text>\n          </View>\n        </RNTesterBlock>\n\n        <RNTesterBlock title=\"Justify Content - Main Direction\">\n          <Text>flex-start</Text>\n          <CircleBlock style={{justifyContent: 'flex-start'}}>\n            {fiveColoredCircles}\n          </CircleBlock>\n          <Text>center</Text>\n          <CircleBlock style={{justifyContent: 'center'}}>\n            {fiveColoredCircles}\n          </CircleBlock>\n          <Text>flex-end</Text>\n          <CircleBlock style={{justifyContent: 'flex-end'}}>\n            {fiveColoredCircles}\n          </CircleBlock>\n          <Text>space-between</Text>\n          <CircleBlock style={{justifyContent: 'space-between'}}>\n            {fiveColoredCircles}\n          </CircleBlock>\n          <Text>space-around</Text>\n          <CircleBlock style={{justifyContent: 'space-around'}}>\n            {fiveColoredCircles}\n          </CircleBlock>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Align Items - Other Direction\">\n          <Text>flex-start</Text>\n          <CircleBlock style={{alignItems: 'flex-start', height: 30}}>\n            <Circle size={15} /><Circle size={10} /><Circle size={20} />\n            <Circle size={17} /><Circle size={12} /><Circle size={15} />\n            <Circle size={10} /><Circle size={20} /><Circle size={17} />\n            <Circle size={12} /><Circle size={15} /><Circle size={10} />\n            <Circle size={20} /><Circle size={17} /><Circle size={12} />\n            <Circle size={15} /><Circle size={8} />\n          </CircleBlock>\n          <Text>center</Text>\n          <CircleBlock style={{alignItems: 'center', height: 30}}>\n            <Circle size={15} /><Circle size={10} /><Circle size={20} />\n            <Circle size={17} /><Circle size={12} /><Circle size={15} />\n            <Circle size={10} /><Circle size={20} /><Circle size={17} />\n            <Circle size={12} /><Circle size={15} /><Circle size={10} />\n            <Circle size={20} /><Circle size={17} /><Circle size={12} />\n            <Circle size={15} /><Circle size={8} />\n          </CircleBlock>\n          <Text>flex-end</Text>\n          <CircleBlock style={{alignItems: 'flex-end', height: 30}}>\n            <Circle size={15} /><Circle size={10} /><Circle size={20} />\n            <Circle size={17} /><Circle size={12} /><Circle size={15} />\n            <Circle size={10} /><Circle size={20} /><Circle size={17} />\n            <Circle size={12} /><Circle size={15} /><Circle size={10} />\n            <Circle size={20} /><Circle size={17} /><Circle size={12} />\n            <Circle size={15} /><Circle size={8} />\n          </CircleBlock>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Flex Wrap\">\n          <CircleBlock style={{flexWrap: 'wrap'}}>\n            {'oooooooooooooooo'.split('').map((char, i) => <Circle key={i} />)}\n          </CircleBlock>\n        </RNTesterBlock>\n      </RNTesterPage>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  overlay: {\n    backgroundColor: '#aaccff',\n    borderRadius: 10,\n    borderWidth: 0.5,\n    opacity: 0.5,\n    padding: 5,\n  },\n});\n\nmodule.exports = LayoutExample;\n"
  },
  {
    "path": "RNTester/js/LinkingExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule LinkingExample\n */\n'use strict';\n\nvar React = require('react');\nvar PropTypes = require('prop-types');\nvar ReactNative = require('react-native');\nvar {\n  Linking,\n  StyleSheet,\n  Text,\n  TouchableOpacity,\n  View,\n} = ReactNative;\nvar RNTesterBlock = require('./RNTesterBlock');\n\nclass OpenURLButton extends React.Component {\n  static propTypes = {\n    url: PropTypes.string,\n  };\n\n  handleClick = () => {\n    Linking.canOpenURL(this.props.url).then(supported => {\n      if (supported) {\n        Linking.openURL(this.props.url);\n      } else {\n        console.log('Don\\'t know how to open URI: ' + this.props.url);\n      }\n    });\n  };\n\n  render() {\n    return (\n      <TouchableOpacity\n        onPress={this.handleClick}>\n        <View style={styles.button}>\n          <Text style={styles.text}>Open {this.props.url}</Text>\n        </View>\n      </TouchableOpacity>\n    );\n  }\n}\n\nclass IntentAndroidExample extends React.Component {\n  static title = 'Linking';\n  static description = 'Shows how to use Linking to open URLs.';\n\n  render() {\n    return (\n      <RNTesterBlock title=\"Open external URLs\">\n        <OpenURLButton url={'https://www.facebook.com'} />\n        <OpenURLButton url={'http://www.facebook.com'} />\n        <OpenURLButton url={'http://facebook.com'} />\n        <OpenURLButton url={'fb://notifications'} />\n        <OpenURLButton url={'geo:37.484847,-122.148386'} />\n        <OpenURLButton url={'tel:9876543210'} />\n      </RNTesterBlock>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    backgroundColor: 'white',\n    padding: 10,\n    paddingTop: 30,\n  },\n  button: {\n    padding: 10,\n    backgroundColor: '#3B5998',\n    marginBottom: 10,\n  },\n  text: {\n    color: 'white',\n  },\n});\n\nmodule.exports = IntentAndroidExample;\n"
  },
  {
    "path": "RNTester/js/ListExampleShared.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ListExampleShared\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  Animated,\n  Image,\n  Platform,\n  TouchableHighlight,\n  StyleSheet,\n  Switch,\n  Text,\n  TextInput,\n  View,\n} = ReactNative;\n\ntype Item = {title: string, text: string, key: string, pressed: boolean, noImage?: ?boolean};\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\nconst HORIZ_WIDTH = 200;\nconst ITEM_HEIGHT = 72;\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      <TouchableHighlight\n        onPress={this._onPress}\n        onShowUnderlay={this.props.onShowUnderlay}\n        onHideUnderlay={this.props.onHideUnderlay}\n        style={horizontal ? styles.horizItem : styles.item}>\n        <View style={[\n          styles.row, horizontal && {width: HORIZ_WIDTH}, fixedHeight && {height: ITEM_HEIGHT}]}>\n          {!item.noImage && <Image style={styles.thumb} source={imgSource} />}\n          <Text\n            style={styles.text}\n            numberOfLines={(horizontal || fixedHeight) ? 3 : undefined}>\n            {item.title} - {item.text}\n          </Text>\n        </View>\n      </TouchableHighlight>\n    );\n  }\n}\n\nconst renderStackedItem = ({item}: {item: Item}) => {\n  const itemHash = Math.abs(hashCode(item.title));\n  const imgSource = THUMB_URLS[itemHash % THUMB_URLS.length];\n  return (\n    <View style={styles.stacked}>\n      <Text style={styles.stackedText}>{item.title} - {item.text}</Text>\n      <Image style={styles.thumb} source={imgSource} />\n    </View>\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<$FlowFixMeProps> {\n  render() {\n    const style = this.props.highlighted\n      ? [styles.itemSeparator, {marginLeft: 0, backgroundColor: 'rgb(217, 217, 217)'}]\n      : styles.itemSeparator;\n    return <View style={style} />;\n  }\n}\n\nclass Spindicator extends React.PureComponent<$FlowFixMeProps> {\n  render() {\n    return (\n      <Animated.View style={[styles.spindicator, {\n        transform: [\n          {rotate: this.props.value.interpolate({\n            inputRange: [0, 5000],\n            outputRange: ['0deg', '360deg'],\n            extrapolate: 'extend',\n          })}\n        ]\n      }]} />\n    );\n  }\n}\n\nconst THUMB_URLS = [\n  require('./Thumbnails/like.png'),\n  require('./Thumbnails/dislike.png'),\n  require('./Thumbnails/call.png'),\n  require('./Thumbnails/fist.png'),\n  require('./Thumbnails/bandaged.png'),\n  require('./Thumbnails/flowers.png'),\n  require('./Thumbnails/heart.png'),\n  require('./Thumbnails/liking.png'),\n  require('./Thumbnails/party.png'),\n  require('./Thumbnails/poke.png'),\n  require('./Thumbnails/superlike.png'),\n  require('./Thumbnails/victory.png'),\n];\n\nconst LOREM_IPSUM = 'Lorem ipsum dolor sit amet, ius ad pertinax oportere accommodare, an vix \\\ncivibus corrumpit referrentur. Te nam case ludus inciderint, te mea facilisi adipiscing. Sea id \\\nintegre luptatum. In tota sale consequuntur nec. Erat ocurreret mei ei. Eu paulo sapientem \\\nvulputate est, vel an accusam intellegam interesset. Nam eu stet pericula reprimique, ea vim illud \\\nmodus, putant invidunt reprehendunt ne qui.';\n\n/* eslint no-bitwise: 0 */\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\nconst HEADER = {height: 30, width: 100};\nconst SEPARATOR_HEIGHT = StyleSheet.hairlineWidth;\n\nfunction getItemLayout(data: any, index: number, horizontal?: boolean) {\n  const [length, separator, header] = horizontal ?\n    [HORIZ_WIDTH, 0, HEADER.width] : [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  if(Platform.isTVOS) {\n    return null;\n  }\n  return (\n    <View style={styles.option}>\n      <Text>{key}:</Text>\n      <Switch\n        style={styles.smallSwitch}\n        value={context.state[key]}\n        onValueChange={(value) => context.setState({[key]: value})}\n      />\n    </View>\n  );\n}\n\nfunction PlainInput(props: Object) {\n  return (\n    <TextInput\n      autoCapitalize=\"none\"\n      autoCorrect={false}\n      clearButtonMode=\"always\"\n      underlineColorAndroid=\"transparent\"\n      style={styles.searchTextInput}\n      {...props}\n    />\n  );\n}\n\nconst styles = StyleSheet.create({\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    paddingRight: 0,\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: Platform.select({\n    android: {\n      top: 1,\n      margin: -6,\n      transform: [{scale: 0.7}],\n    },\n    ios: {\n      top: 4,\n      margin: -10,\n      transform: [{scale: 0.5}],\n    },\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\nmodule.exports = {\n  FooterComponent,\n  HeaderComponent,\n  ItemComponent,\n  ItemSeparatorComponent,\n  PlainInput,\n  SeparatorComponent,\n  Spindicator,\n  genItemData,\n  getItemLayout,\n  pressItem,\n  renderSmallSwitchOption,\n  renderStackedItem,\n};\n"
  },
  {
    "path": "RNTester/js/ListViewExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ListViewExample\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  ListView,\n  TouchableHighlight,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nvar RNTesterPage = require('./RNTesterPage');\n\nvar ListViewSimpleExample = createReactClass({\n  displayName: 'ListViewSimpleExample',\n  statics: {\n    title: '<ListView>',\n    description: 'Performant, scrollable list of data.'\n  },\n\n  getInitialState: function() {\n    var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});\n    return {\n      dataSource: ds.cloneWithRows(this._genRows({})),\n    };\n  },\n\n  _pressData: ({}: {[key: number]: boolean}),\n\n  componentWillMount: function() {\n    this._pressData = {};\n  },\n\n  render: function() {\n    return (\n      <RNTesterPage\n        title={this.props.navigator ? null : '<ListView>'}\n        noSpacer={true}\n        noScroll={true}>\n        <ListView\n          dataSource={this.state.dataSource}\n          renderRow={this._renderRow}\n          renderSeparator={this._renderSeparator}\n        />\n      </RNTesterPage>\n    );\n  },\n\n  _renderRow: function(rowData: string, sectionID: number, rowID: number, highlightRow: (sectionID: number, rowID: number) => void) {\n    var rowHash = Math.abs(hashCode(rowData));\n    var imgSource = THUMB_URLS[rowHash % THUMB_URLS.length];\n    return (\n      <TouchableHighlight onPress={() => {\n          this._pressRow(rowID);\n          highlightRow(sectionID, rowID);\n        }}>\n        <View>\n          <View style={styles.row}>\n            <Image style={styles.thumb} source={imgSource} />\n            <Text style={styles.text}>\n              {rowData + ' - ' + LOREM_IPSUM.substr(0, rowHash % 301 + 10)}\n            </Text>\n          </View>\n        </View>\n      </TouchableHighlight>\n    );\n  },\n\n  _genRows: function(pressData: {[key: number]: boolean}): Array<string> {\n    var dataBlob = [];\n    for (var ii = 0; ii < 100; ii++) {\n      var pressedText = pressData[ii] ? ' (pressed)' : '';\n      dataBlob.push('Row ' + ii + pressedText);\n    }\n    return dataBlob;\n  },\n\n  _pressRow: function(rowID: number) {\n    this._pressData[rowID] = !this._pressData[rowID];\n    this.setState({dataSource: this.state.dataSource.cloneWithRows(\n      this._genRows(this._pressData)\n    )});\n  },\n\n  _renderSeparator: function(sectionID: number, rowID: number, adjacentRowHighlighted: bool) {\n    return (\n      <View\n        key={`${sectionID}-${rowID}`}\n        style={{\n          height: adjacentRowHighlighted ? 4 : 1,\n          backgroundColor: adjacentRowHighlighted ? '#3B5998' : '#CCCCCC',\n        }}\n      />\n    );\n  }\n});\n\nvar THUMB_URLS = [\n  require('./Thumbnails/like.png'),\n  require('./Thumbnails/dislike.png'),\n  require('./Thumbnails/call.png'),\n  require('./Thumbnails/fist.png'),\n  require('./Thumbnails/bandaged.png'),\n  require('./Thumbnails/flowers.png'),\n  require('./Thumbnails/heart.png'),\n  require('./Thumbnails/liking.png'),\n  require('./Thumbnails/party.png'),\n  require('./Thumbnails/poke.png'),\n  require('./Thumbnails/superlike.png'),\n  require('./Thumbnails/victory.png'),\n  ];\nvar LOREM_IPSUM = 'Lorem ipsum dolor sit amet, ius ad pertinax oportere accommodare, an vix civibus corrumpit referrentur. Te nam case ludus inciderint, te mea facilisi adipiscing. Sea id integre luptatum. In tota sale consequuntur nec. Erat ocurreret mei ei. Eu paulo sapientem vulputate est, vel an accusam intellegam interesset. Nam eu stet pericula reprimique, ea vim illud modus, putant invidunt reprehendunt ne qui.';\n\n/* eslint no-bitwise: 0 */\nvar hashCode = function(str) {\n  var hash = 15;\n  for (var ii = str.length - 1; ii >= 0; ii--) {\n    hash = ((hash << 5) - hash) + str.charCodeAt(ii);\n  }\n  return hash;\n};\n\nvar styles = StyleSheet.create({\n  row: {\n    flexDirection: 'row',\n    justifyContent: 'center',\n    padding: 10,\n    backgroundColor: '#F6F6F6',\n  },\n  thumb: {\n    width: 64,\n    height: 64,\n  },\n  text: {\n    flex: 1,\n  },\n});\n\nmodule.exports = ListViewSimpleExample;\n"
  },
  {
    "path": "RNTester/js/ListViewGridLayoutExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ListViewGridLayoutExample\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  ListView,\n  TouchableHighlight,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nvar THUMB_URLS = [\n  require('./Thumbnails/like.png'),\n  require('./Thumbnails/dislike.png'),\n  require('./Thumbnails/call.png'),\n  require('./Thumbnails/fist.png'),\n  require('./Thumbnails/bandaged.png'),\n  require('./Thumbnails/flowers.png'),\n  require('./Thumbnails/heart.png'),\n  require('./Thumbnails/liking.png'),\n  require('./Thumbnails/party.png'),\n  require('./Thumbnails/poke.png'),\n  require('./Thumbnails/superlike.png'),\n  require('./Thumbnails/victory.png'),\n];\n\nvar ListViewGridLayoutExample = createReactClass({\n  displayName: 'ListViewGridLayoutExample',\n\n  statics: {\n    title: '<ListView> - Grid Layout',\n    description: 'Flexbox grid layout.'\n  },\n\n  getInitialState: function() {\n    var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});\n    return {\n      dataSource: ds.cloneWithRows(this._genRows({})),\n    };\n  },\n\n  _pressData: ({}: {[key: number]: boolean}),\n\n  componentWillMount: function() {\n    this._pressData = {};\n  },\n\n  render: function() {\n    return (\n      // ListView wraps ScrollView and so takes on its properties.\n      // With that in mind you can use the ScrollView's contentContainerStyle prop to style the items.\n      <ListView\n        contentContainerStyle={styles.list}\n        dataSource={this.state.dataSource}\n        initialListSize={21}\n        pageSize={3} // should be a multiple of the no. of visible cells per row\n        scrollRenderAheadDistance={500}\n        renderRow={this._renderRow}\n      />\n    );\n  },\n\n  _renderRow: function(rowData: string, sectionID: number, rowID: number) {\n    var rowHash = Math.abs(hashCode(rowData));\n    var imgSource = THUMB_URLS[rowHash % THUMB_URLS.length];\n    return (\n      <TouchableHighlight onPress={() => this._pressRow(rowID)} underlayColor=\"transparent\">\n        <View>\n          <View style={styles.row}>\n            <Image style={styles.thumb} source={imgSource} />\n            <Text style={styles.text}>\n              {rowData}\n            </Text>\n          </View>\n        </View>\n      </TouchableHighlight>\n    );\n  },\n\n  _genRows: function(pressData: {[key: number]: boolean}): Array<string> {\n    var dataBlob = [];\n    for (var ii = 0; ii < 100; ii++) {\n      var pressedText = pressData[ii] ? ' (X)' : '';\n      dataBlob.push('Cell ' + ii + pressedText);\n    }\n    return dataBlob;\n  },\n\n  _pressRow: function(rowID: number) {\n    this._pressData[rowID] = !this._pressData[rowID];\n    this.setState({dataSource: this.state.dataSource.cloneWithRows(\n      this._genRows(this._pressData)\n    )});\n  },\n});\n\n/* eslint no-bitwise: 0 */\nvar hashCode = function(str) {\n  var hash = 15;\n  for (var ii = str.length - 1; ii >= 0; ii--) {\n    hash = ((hash << 5) - hash) + str.charCodeAt(ii);\n  }\n  return hash;\n};\n\nvar styles = StyleSheet.create({\n  list: {\n    justifyContent: 'space-around',\n    flexDirection: 'row',\n    flexWrap: 'wrap',\n    alignItems: 'flex-start'\n  },\n  row: {\n    justifyContent: 'center',\n    padding: 5,\n    margin: 3,\n    width: 100,\n    height: 100,\n    backgroundColor: '#F6F6F6',\n    alignItems: 'center',\n    borderWidth: 1,\n    borderRadius: 5,\n    borderColor: '#CCC'\n  },\n  thumb: {\n    width: 64,\n    height: 64\n  },\n  text: {\n    flex: 1,\n    marginTop: 5,\n    fontWeight: 'bold'\n  },\n});\n\nmodule.exports = ListViewGridLayoutExample;\n"
  },
  {
    "path": "RNTester/js/ListViewPagingExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ListViewPagingExample\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  LayoutAnimation,\n  ListView,\n  StyleSheet,\n  Text,\n  TouchableOpacity,\n  View,\n} = ReactNative;\n\nvar NativeModules = require('NativeModules');\nvar {\n  UIManager,\n} = NativeModules;\n\nvar THUMB_URLS = [\n  require('./Thumbnails/like.png'),\n  require('./Thumbnails/dislike.png'),\n  require('./Thumbnails/call.png'),\n  require('./Thumbnails/fist.png'),\n  require('./Thumbnails/bandaged.png'),\n  require('./Thumbnails/flowers.png'),\n  require('./Thumbnails/heart.png'),\n  require('./Thumbnails/liking.png'),\n  require('./Thumbnails/party.png'),\n  require('./Thumbnails/poke.png'),\n  require('./Thumbnails/superlike.png'),\n  require('./Thumbnails/victory.png'),\n];\nvar NUM_SECTIONS = 100;\nvar NUM_ROWS_PER_SECTION = 10;\n\nclass Thumb extends React.Component<{}, $FlowFixMeState> {\n  componentWillMount() {\n    UIManager.setLayoutAnimationEnabledExperimental &&\n      UIManager.setLayoutAnimationEnabledExperimental(true);\n  }\n\n  _getThumbIdx = () => {\n    return Math.floor(Math.random() * THUMB_URLS.length);\n  };\n\n  _onPressThumb = () => {\n    var config = layoutAnimationConfigs[this.state.thumbIndex % layoutAnimationConfigs.length];\n    LayoutAnimation.configureNext(config);\n    this.setState({\n      thumbIndex: this._getThumbIdx(),\n      dir: this.state.dir === 'row' ? 'column' : 'row',\n    });\n  };\n\n  state = {thumbIndex: this._getThumbIdx(), dir: 'row'};\n\n  render() {\n    return (\n      <TouchableOpacity\n        onPress={this._onPressThumb}\n        style={[styles.buttonContents, {flexDirection: this.state.dir}]}>\n        <Image style={styles.img} source={THUMB_URLS[this.state.thumbIndex]} />\n        <Image style={styles.img} source={THUMB_URLS[this.state.thumbIndex]} />\n        <Image style={styles.img} source={THUMB_URLS[this.state.thumbIndex]} />\n        {this.state.dir === 'column' ?\n          <Text>\n            Oooo, look at this new text!  So awesome it may just be crazy.\n            Let me keep typing here so it wraps at least one line.\n          </Text> :\n          <Text />\n        }\n      </TouchableOpacity>\n    );\n  }\n}\n\nclass ListViewPagingExample extends React.Component<$FlowFixMeProps, *> {\n  static title = '<ListView> - Paging';\n  static description = 'Floating headers & layout animations.';\n\n  // $FlowFixMe found when converting React.createClass to ES6\n  constructor(props) {\n    super(props);\n    var getSectionData = (dataBlob, sectionID) => {\n      return dataBlob[sectionID];\n    };\n    var getRowData = (dataBlob, sectionID, rowID) => {\n      return dataBlob[rowID];\n    };\n\n    var dataSource = new ListView.DataSource({\n      getRowData: getRowData,\n      getSectionHeaderData: getSectionData,\n      rowHasChanged: (row1, row2) => row1 !== row2,\n      sectionHeaderHasChanged: (s1, s2) => s1 !== s2,\n    });\n\n    var dataBlob = {};\n    var sectionIDs = [];\n    var rowIDs = [];\n    for (var ii = 0; ii < NUM_SECTIONS; ii++) {\n      var sectionName = 'Section ' + ii;\n      sectionIDs.push(sectionName);\n      dataBlob[sectionName] = sectionName;\n      rowIDs[ii] = [];\n\n      for (var jj = 0; jj < NUM_ROWS_PER_SECTION; jj++) {\n        var rowName = 'S' + ii + ', R' + jj;\n        rowIDs[ii].push(rowName);\n        dataBlob[rowName] = rowName;\n      }\n    }\n\n    this.state = {\n      dataSource: dataSource.cloneWithRowsAndSections(dataBlob, sectionIDs, rowIDs),\n      headerPressCount: 0,\n    };\n  }\n\n  renderRow = (rowData: string, sectionID: string, rowID: string): React.Element<any> => {\n    return (<Thumb text={rowData}/>);\n  };\n\n  renderSectionHeader = (sectionData: string, sectionID: string) => {\n    return (\n      <View style={styles.section}>\n        <Text style={styles.text}>\n          {sectionData}\n        </Text>\n      </View>\n    );\n  };\n\n  renderHeader = () => {\n    var headerLikeText = this.state.headerPressCount % 2 ?\n      <View><Text style={styles.text}>1 Like</Text></View> :\n      null;\n    return (\n      <TouchableOpacity onPress={this._onPressHeader} style={styles.header}>\n        {headerLikeText}\n        <View>\n          <Text style={styles.text}>\n            Table Header (click me)\n          </Text>\n        </View>\n      </TouchableOpacity>\n    );\n  };\n\n  renderFooter = () => {\n    return (\n      <View style={styles.header}>\n        <Text onPress={() => console.log('Footer!')} style={styles.text}>\n          Table Footer\n        </Text>\n      </View>\n    );\n  };\n\n  render() {\n    return (\n      <ListView\n        style={styles.listview}\n        dataSource={this.state.dataSource}\n        onChangeVisibleRows={(visibleRows, changedRows) => console.log({visibleRows, changedRows})}\n        renderHeader={this.renderHeader}\n        renderFooter={this.renderFooter}\n        renderSectionHeader={this.renderSectionHeader}\n        renderRow={this.renderRow}\n        initialListSize={10}\n        pageSize={4}\n        scrollRenderAheadDistance={500}\n        stickySectionHeadersEnabled\n      />\n    );\n  }\n\n  _onPressHeader = () => {\n    var config = layoutAnimationConfigs[Math.floor(this.state.headerPressCount / 2) % layoutAnimationConfigs.length];\n    LayoutAnimation.configureNext(config);\n    this.setState({headerPressCount: this.state.headerPressCount + 1});\n  };\n}\n\nvar styles = StyleSheet.create({\n  listview: {\n    backgroundColor: '#B0C4DE',\n  },\n  header: {\n    height: 40,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: '#3B5998',\n    flexDirection: 'row',\n  },\n  text: {\n    color: 'white',\n    paddingHorizontal: 8,\n  },\n  rowText: {\n    color: '#888888',\n  },\n  thumbText: {\n    fontSize: 20,\n    color: '#888888',\n  },\n  buttonContents: {\n    flexDirection: 'row',\n    justifyContent: 'center',\n    alignItems: 'center',\n    marginHorizontal: 5,\n    marginVertical: 3,\n    padding: 5,\n    backgroundColor: '#EAEAEA',\n    borderRadius: 3,\n    paddingVertical: 10,\n  },\n  img: {\n    width: 64,\n    height: 64,\n    marginHorizontal: 10,\n    backgroundColor: 'transparent',\n  },\n  section: {\n    flexDirection: 'column',\n    justifyContent: 'center',\n    alignItems: 'flex-start',\n    padding: 6,\n    backgroundColor: '#5890ff',\n  },\n});\n\nvar animations = {\n  layout: {\n    spring: {\n      duration: 750,\n      create: {\n        duration: 300,\n        type: LayoutAnimation.Types.easeInEaseOut,\n        property: LayoutAnimation.Properties.opacity,\n      },\n      update: {\n        type: LayoutAnimation.Types.spring,\n        springDamping: 0.4,\n      },\n    },\n    easeInEaseOut: {\n      duration: 300,\n      create: {\n        type: LayoutAnimation.Types.easeInEaseOut,\n        property: LayoutAnimation.Properties.scaleXY,\n      },\n      update: {\n        delay: 100,\n        type: LayoutAnimation.Types.easeInEaseOut,\n      },\n    },\n  },\n};\n\nvar layoutAnimationConfigs = [\n  animations.layout.spring,\n  animations.layout.easeInEaseOut,\n];\n\nmodule.exports = ListViewPagingExample;\n"
  },
  {
    "path": "RNTester/js/MaskedViewExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule MaskedViewExample\n */\n'use strict';\n\nconst React = require('react');\nconst RNTesterBlock = require('RNTesterBlock');\nconst RNTesterPage = require('RNTesterPage');\nconst {\n  Animated,\n  Image,\n  MaskedViewIOS,\n  StyleSheet,\n  Text,\n  View,\n} = require('react-native');\n\nclass MaskedViewExample extends React.Component<{}, $FlowFixMeState> {\n  static title = '<MaskedViewIOS>';\n  static description = 'Renders the child view with a mask specified in the `renderMask` prop.';\n\n  state = {\n    alternateChildren: true,\n  };\n\n  _maskRotateAnimatedValue = new Animated.Value(0);\n  _maskScaleAnimatedValue = new Animated.Value(1);\n\n  componentDidMount() {\n    setInterval(() => {\n      this.setState(state => ({\n        alternateChildren: !state.alternateChildren,\n      }));\n    }, 1000);\n\n    Animated.loop(\n      Animated.sequence([\n        Animated.timing(this._maskScaleAnimatedValue, {\n          toValue: 1.3,\n          timing: 750,\n          useNativeDriver: true,\n        }),\n        Animated.timing(this._maskScaleAnimatedValue, {\n          toValue: 1,\n          timing: 750,\n          useNativeDriver: true,\n        }),\n      ])\n    ).start();\n\n    Animated.loop(\n      Animated.timing(this._maskRotateAnimatedValue, {\n        toValue: 360,\n        timing: 2000,\n        useNativeDriver: true,\n      })\n    ).start();\n  }\n\n  render() {\n    return (\n      <RNTesterPage title=\"<MaskedViewIOS>\">\n        <RNTesterBlock title=\"Basic Mask\">\n          <View style={{ width: 300, height: 300, alignSelf: 'center' }}>\n            <MaskedViewIOS\n              style={{ flex: 1 }}\n              maskElement={\n                <View style={styles.maskContainerStyle}>\n                  <Text style={styles.maskTextStyle}>\n                    Basic Mask\n                  </Text>\n                </View>\n              }>\n              <View style={{ flex: 1, backgroundColor: 'blue' }} />\n              <View style={{ flex: 1, backgroundColor: 'red' }} />\n            </MaskedViewIOS>\n          </View>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Image Mask\">\n          <View\n            style={{\n              width: 300,\n              height: 300,\n              alignSelf: 'center',\n              backgroundColor: '#eeeeee',\n            }}>\n            <MaskedViewIOS\n              style={{ flex: 1 }}\n              maskElement={\n                <View style={styles.maskContainerStyle}>\n                  <Image\n                    style={{ height: 200, width: 200 }}\n                    source={require('./imageMask.png')}\n                  />\n                </View>\n              }>\n              <View style={styles.maskContainerStyle}>\n                <Image\n                  resizeMode=\"cover\"\n                  style={{ width: 200, height: 200 }}\n                  source={{\n                    uri:\n                      'https://38.media.tumblr.com/9e9bd08c6e2d10561dd1fb4197df4c4e/tumblr_mfqekpMktw1rn90umo1_500.gif',\n                  }}\n                />\n              </View>\n            </MaskedViewIOS>\n          </View>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Animated Mask\">\n          <View style={{ width: 300, height: 300, alignSelf: 'center' }}>\n            <MaskedViewIOS\n              style={{ flex: 1 }}\n              maskElement={\n                <Animated.View\n                  style={[\n                    styles.maskContainerStyle,\n                    { transform: [{ scale: this._maskScaleAnimatedValue }] },\n                  ]}>\n                  <Text style={styles.maskTextStyle}>\n                    Basic Mask\n                  </Text>\n                </Animated.View>\n              }>\n              <Animated.View\n                style={{\n                  flex: 1,\n                  transform: [\n                    {\n                      rotate: this._maskRotateAnimatedValue.interpolate({\n                        inputRange: [0, 360],\n                        outputRange: ['0deg', '360deg'],\n                      }),\n                    },\n                  ],\n                }}>\n                <View style={{ flex: 1, backgroundColor: 'blue' }} />\n                <View style={{ flex: 1, backgroundColor: 'red' }} />\n              </Animated.View>\n            </MaskedViewIOS>\n          </View>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Mask w/ Changing Children\">\n          <View style={{ width: 300, height: 300, alignSelf: 'center' }}>\n            <MaskedViewIOS\n              style={{ flex: 1 }}\n              maskElement={\n                <View style={styles.maskContainerStyle}>\n                  <Text style={styles.maskTextStyle}>\n                    Basic Mask\n                  </Text>\n                </View>\n              }>\n              {this.state.alternateChildren\n                ? [\n                    <View\n                      key={1}\n                      style={{ flex: 1, backgroundColor: 'blue' }}\n                    />,\n                    <View\n                      key={2}\n                      style={{ flex: 1, backgroundColor: 'red' }}\n                    />,\n                  ]\n                : null}\n            </MaskedViewIOS>\n          </View>\n        </RNTesterBlock>\n      </RNTesterPage>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  maskContainerStyle: {\n    flex: 1,\n    backgroundColor: 'transparent',\n    justifyContent: 'center',\n    alignItems: 'center',\n  },\n  maskTextStyle: {\n    backgroundColor: 'transparent',\n    fontSize: 40,\n    fontWeight: 'bold',\n  },\n});\n\nmodule.exports = MaskedViewExample;\n"
  },
  {
    "path": "RNTester/js/MenuExample.macos.js",
    "content": "/**\n * @flow\n */\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\n\nconst {\n  MenuManager,\n  TouchableOpacity,\n  StyleSheet,\n  Text,\n  TextInput,\n  AlertIOS,\n  View,\n} = ReactNative;\n\nclass MenuManagerExample extends React.Component {\n  state = {\n    title: 'Example',\n    itemTitle: '',\n    items: [{\n      title: 'First submenu',\n      key: 'f',\n      callback: () => AlertIOS.alert('Menu Example', 'You have clicked on the test item', [\n        {text: 'OK', onPress: () => console.log('OK Pressed!')},\n      ])\n    }]\n  };\n\n  _addNewSubmenu = () => {\n    MenuManager.addSubmenu(this.state.title, this.state.items);\n  };\n\n  _addNewItemToSubmenu = () => {\n    MenuManager.addItemToSubmenu(this.state.title, {\n      title: this.state.itemTitle,\n    });\n  };\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text>Enter title of the new submenu:</Text>\n        <View style={styles.row}>\n          <TextInput\n            style={styles.input}\n            placeholder={'Submenu title'}\n            onChange={(e) => this.setState({title: e.nativeEvent.text})} />\n          <TouchableOpacity style={styles.button} onPress={this._addNewSubmenu}>\n            <Text style={styles.buttonText}>Add submenu</Text>\n          </TouchableOpacity>\n        </View>\n        <Text>Enter title of the new item for submenu:</Text>\n        <View style={styles.row}>\n          <TextInput\n            style={styles.input}\n            placeholder={'Item title'}\n            onChange={(e) => this.setState({itemTitle: e.nativeEvent.text})} />\n          <TouchableOpacity style={styles.button} onPress={this._addNewItemToSubmenu}>\n            <Text style={styles.buttonText}>Add item</Text>\n          </TouchableOpacity>\n        </View>\n      </View>\n    );\n  }\n}\n\nexports.displayName = (undefined: ?string);\nexports.framework = 'React';\nexports.title = 'MenuManager';\nexports.description = 'NSMenu APIs';\nexports.examples = [{\n  title: 'Managing Main Application Menu',\n  render() {\n    return (\n      <MenuManagerExample />\n    );\n  }\n}];\n\nvar styles = StyleSheet.create({\n  container: {\n    marginTop: 20,\n    backgroundColor: 'transparent',\n  },\n  row: {\n    flexDirection: 'row',\n    flex: 1,\n    marginTop: 20\n  },\n  button: {\n    padding: 5\n  },\n  input: {width: 150, height: 30},\n  buttonText: {\n    color: 'darkblue'\n  }\n});\n"
  },
  {
    "path": "RNTester/js/ModalExample.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * The examples provided by Facebook are for non-commercial testing and\n * evaluation purposes only.\n *\n * Facebook reserves all rights not expressly granted.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL\n * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * @flow\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar { Modal, StyleSheet, Switch, Text, Button, View } = ReactNative;\n\nexports.displayName = (undefined: ?string);\nexports.framework = 'React';\nexports.title = '<Modal>';\nexports.description = 'Component for presenting modal views.';\n\nclass ModalExample extends React.Component {\n  state = {\n    presentationType: 'window',\n    modalVisible: false,\n    transparent: false,\n  };\n\n  _setModalVisible = visible => {\n    this.setState({ modalVisible: visible });\n    console.log('hide modal');\n  };\n\n  _setPresentationType(type) {\n    this.setState({ presentationType: type });\n  }\n\n  _toggleTransparent = () => {\n    this.setState({ transparent: !this.state.transparent });\n  };\n\n  render() {\n    var modalBackgroundStyle = {\n      backgroundColor: this.state.transparent\n        ? 'rgba(0, 0, 0, 0.5)'\n        : '#f5fcff',\n    };\n    var innerContainerTransparentStyle = this.state.transparent\n      ? { backgroundColor: '#fff', padding: 20 }\n      : null;\n    var activeButtonStyle = {\n      backgroundColor: '#ddd',\n    };\n\n    return (\n      <View>\n        <Modal\n          width={300}\n          presentationType={this.state.presentationType}\n          transparent={this.state.transparent}\n          visible={this.state.modalVisible}\n          onRequestClose={() => {\n            this._setModalVisible(false);\n          }}>\n          <View style={[styles.container, modalBackgroundStyle]}>\n            <View\n              style={[styles.innerContainer, innerContainerTransparentStyle]}>\n              <Text>\n                This modal was presented with type:\n                {' '}\n                {this.state.presentationType}\n                .\n              </Text>\n              <Button\n                onPress={this._setModalVisible.bind(this, false)}\n                style={styles.modalButton}\n                title=\"Close\"\n              />\n            </View>\n          </View>\n        </Modal>\n        <View style={styles.row}>\n          <Text style={styles.rowTitle}>Presentation Type</Text>\n          <Button\n            onClick={this._setPresentationType.bind(this, 'window')}\n            state={this.state.presentationType === 'window'}\n            style={{ width: 200 }}\n            type=\"radio\"\n            title=\"window\"\n          />\n          <Button\n            onClick={this._setPresentationType.bind(this, 'sheet')}\n            state={this.state.presentationType === 'sheet'}\n            style={{ width: 200 }}\n            type=\"radio\"\n            title=\"sheet\"\n          />\n          <Button\n            onClick={this._setPresentationType.bind(this, 'popover')}\n            state={this.state.presentationType === 'popover'}\n            style={{ width: 200 }}\n            type=\"radio\"\n            title=\"popover\"\n          />\n        </View>\n\n        <View style={styles.row}>\n          <Text style={styles.rowTitle}>Transparent</Text>\n          <Switch\n            value={this.state.transparent}\n            onValueChange={this._toggleTransparent}\n          />\n        </View>\n\n        <Button\n          bezelStyle={'rounded'}\n          style={{ width: 100, fontSize: 18, height: 40 }}\n          onClick={this._setModalVisible.bind(this, true)}\n          title=\"Present\"\n        />\n\n      </View>\n    );\n  }\n}\n\nexports.examples = [\n  {\n    title: 'Modal Presentation',\n    description: 'Modals can be presented with or without animation',\n    render: () => <ModalExample />,\n  },\n];\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    padding: 20,\n  },\n  innerContainer: {\n    borderRadius: 10,\n    alignItems: 'center',\n  },\n  row: {\n    alignItems: 'center',\n    flex: 1,\n    flexDirection: 'row',\n    marginBottom: 20,\n  },\n  rowTitle: {\n    flex: 1,\n    fontWeight: 'bold',\n  },\n  button: {\n    borderRadius: 5,\n    margin: 10,\n    backgroundColor: 'lightblue',\n    flex: 1,\n    height: 44,\n    alignSelf: 'stretch',\n    justifyContent: 'center',\n    overflow: 'hidden',\n  },\n  buttonText: {\n    fontSize: 18,\n    margin: 5,\n    textAlign: 'center',\n  },\n  modalButton: {\n    marginTop: 10,\n  },\n});\n"
  },
  {
    "path": "RNTester/js/MultiColumnExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule MultiColumnExample\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  FlatList,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nconst RNTesterPage = require('./RNTesterPage');\n\nconst infoLog = require('infoLog');\n\nconst {\n  FooterComponent,\n  HeaderComponent,\n  ItemComponent,\n  PlainInput,\n  SeparatorComponent,\n  genItemData,\n  getItemLayout,\n  pressItem,\n  renderSmallSwitchOption,\n} = require('./ListExampleShared');\n\nclass MultiColumnExample extends React.PureComponent<$FlowFixMeProps, $FlowFixMeState> {\n  static title = '<FlatList> - MultiColumn';\n  static description = 'Performant, scrollable grid of data.';\n\n  state = {\n    data: genItemData(1000),\n    filterText: '',\n    fixedHeight: true,\n    logViewable: false,\n    numColumns: 2,\n    virtualized: true,\n  };\n  _onChangeFilterText = (filterText) => {\n    this.setState(() => ({filterText}));\n  };\n  _onChangeNumColumns = (numColumns) => {\n    this.setState(() => ({numColumns: Number(numColumns)}));\n  };\n  render() {\n    const filterRegex = new RegExp(String(this.state.filterText), 'i');\n    const filter = (item) => (filterRegex.test(item.text) || filterRegex.test(item.title));\n    const filteredData = this.state.data.filter(filter);\n    return (\n      <RNTesterPage\n        title={this.props.navigator ? null : '<FlatList> - MultiColumn'}\n        noSpacer={true}\n        noScroll={true}>\n        <View style={styles.searchRow}>\n          <View style={styles.row}>\n            <PlainInput\n              onChangeText={this._onChangeFilterText}\n              placeholder=\"Search...\"\n              value={this.state.filterText}\n            />\n            <Text>   numColumns: </Text>\n            <PlainInput\n              clearButtonMode=\"never\"\n              onChangeText={this._onChangeNumColumns}\n              value={this.state.numColumns ? String(this.state.numColumns) : ''}\n            />\n          </View>\n          <View style={styles.row}>\n            {renderSmallSwitchOption(this, 'virtualized')}\n            {renderSmallSwitchOption(this, 'fixedHeight')}\n            {renderSmallSwitchOption(this, 'logViewable')}\n          </View>\n        </View>\n        <SeparatorComponent />\n        <FlatList\n          ListFooterComponent={FooterComponent}\n          ListHeaderComponent={HeaderComponent}\n          getItemLayout={this.state.fixedHeight ? this._getItemLayout : undefined}\n          data={filteredData}\n          key={this.state.numColumns + (this.state.fixedHeight ? 'f' : 'v')}\n          numColumns={this.state.numColumns || 1}\n          onRefresh={() => alert('onRefresh: nothing to refresh :P')}\n          refreshing={false}\n          renderItem={this._renderItemComponent}\n          disableVirtualization={!this.state.virtualized}\n          onViewableItemsChanged={this._onViewableItemsChanged}\n          legacyImplementation={false}\n        />\n      </RNTesterPage>\n    );\n  }\n  _getItemLayout(data: any, index: number): {length: number, offset: number, index: number} {\n    const length = getItemLayout(data, index).length + 2 * (CARD_MARGIN + BORDER_WIDTH);\n    return {length, offset: length * index, index};\n  }\n  _renderItemComponent = ({item}) => {\n    return (\n      <View style={styles.card}>\n        <ItemComponent\n          item={item}\n          fixedHeight={this.state.fixedHeight}\n          onPress={this._pressItem}\n        />\n      </View>\n    );\n  };\n  // This is called when items change viewability by scrolling into or out of the viewable area.\n  _onViewableItemsChanged = (info: {\n    changed: Array<{\n      key: string, isViewable: boolean, item: {columns: Array<*>}, index: ?number, section?: any\n    }>},\n  ) => {\n    // Impressions can be logged here\n    if (this.state.logViewable) {\n      infoLog('onViewableItemsChanged: ', info.changed.map((v) => ({...v, item: '...'})));\n    }\n  };\n  _pressItem = (key: string) => {\n    pressItem(this, key);\n  };\n}\n\nconst CARD_MARGIN = 4;\nconst BORDER_WIDTH = 1;\n\nconst styles = StyleSheet.create({\n  card: {\n    margin: CARD_MARGIN,\n    borderRadius: 10,\n    flex: 1,\n    overflow: 'hidden',\n    borderColor: 'lightgray',\n    borderWidth: BORDER_WIDTH,\n  },\n  row: {\n    flexDirection: 'row',\n    alignItems: 'center',\n  },\n  searchRow: {\n    padding: 10,\n  },\n});\n\nmodule.exports = MultiColumnExample;\n"
  },
  {
    "path": "RNTester/js/NativeAnimationsExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule NativeAnimationsExample\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  View,\n  Text,\n  Animated,\n  StyleSheet,\n  TouchableWithoutFeedback,\n  Slider,\n} = ReactNative;\n\nvar AnimatedSlider = Animated.createAnimatedComponent(Slider);\n\nclass Tester extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  state = {\n    native: new Animated.Value(0),\n    js: new Animated.Value(0),\n  };\n\n  current = 0;\n\n  onPress = () => {\n    const animConfig = this.current && this.props.reverseConfig\n      ? this.props.reverseConfig\n      : this.props.config;\n    this.current = this.current ? 0 : 1;\n    const config: Object = {\n      ...animConfig,\n      toValue: this.current,\n    };\n\n    Animated[this.props.type](this.state.native, {\n      ...config,\n      useNativeDriver: true,\n    }).start();\n    Animated[this.props.type](this.state.js, {\n      ...config,\n      useNativeDriver: false,\n    }).start();\n  };\n\n  render() {\n    return (\n      <TouchableWithoutFeedback onPress={this.onPress}>\n        <View>\n          <View>\n            <Text>Native:</Text>\n          </View>\n          <View style={styles.row}>\n            {this.props.children(this.state.native)}\n          </View>\n          <View>\n            <Text>JavaScript:</Text>\n          </View>\n          <View style={styles.row}>\n            {this.props.children(this.state.js)}\n          </View>\n        </View>\n      </TouchableWithoutFeedback>\n    );\n  }\n}\n\nclass ValueListenerExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    anim: new Animated.Value(0),\n    progress: 0,\n  };\n  _current = 0;\n\n  componentDidMount() {\n    this.state.anim.addListener(e => this.setState({progress: e.value}));\n  }\n\n  componentWillUnmount() {\n    this.state.anim.removeAllListeners();\n  }\n\n  _onPress = () => {\n    this._current = this._current ? 0 : 1;\n    const config = {\n      duration: 1000,\n      toValue: this._current,\n    };\n\n    Animated.timing(this.state.anim, {\n      ...config,\n      useNativeDriver: true,\n    }).start();\n  };\n\n  render() {\n    return (\n      <TouchableWithoutFeedback onPress={this._onPress}>\n        <View>\n          <View style={styles.row}>\n            <Animated.View\n              style={[\n                styles.block,\n                {\n                  opacity: this.state.anim,\n                },\n              ]}\n            />\n          </View>\n          <Text>Value: {this.state.progress}</Text>\n        </View>\n      </TouchableWithoutFeedback>\n    );\n  }\n}\n\nclass LoopExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    value: new Animated.Value(0),\n  };\n\n  componentDidMount() {\n    Animated.loop(\n      Animated.timing(this.state.value, {\n        toValue: 1,\n        duration: 5000,\n        useNativeDriver: true,\n      }),\n    ).start();\n  }\n\n  render() {\n    return (\n      <View style={styles.row}>\n        <Animated.View\n          style={[\n            styles.block,\n            {\n              opacity: this.state.value.interpolate({\n                inputRange: [0, 0.5, 1],\n                outputRange: [0, 1, 0],\n              }),\n            },\n          ]}\n        />\n      </View>\n    );\n  }\n}\n\nconst RNTesterSettingSwitchRow = require('RNTesterSettingSwitchRow');\nclass InternalSettings extends React.Component<{}, {busyTime: number | string, filteredStall: number}> {\n  _stallInterval: ?number;\n  render() {\n    return (\n      <View>\n        <RNTesterSettingSwitchRow\n          initialValue={false}\n          label=\"Force JS Stalls\"\n          onEnable={() => {\n            /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment\n             * suppresses an error found when Flow v0.63 was deployed. To see\n             * the error delete this comment and run Flow. */\n            this._stallInterval = setInterval(() => {\n              const start = Date.now();\n              console.warn('burn CPU');\n              while (Date.now() - start < 100) {\n              }\n            }, 300);\n          }}\n          onDisable={() => {\n            /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment\n             * suppresses an error found when Flow v0.63 was deployed. To see\n             * the error delete this comment and run Flow. */\n            clearInterval(this._stallInterval || 0);\n          }}\n        />\n        <RNTesterSettingSwitchRow\n          initialValue={false}\n          label=\"Track JS Stalls\"\n          onEnable={() => {\n            require('JSEventLoopWatchdog').install({thresholdMS: 25});\n            this.setState({busyTime: '<none>'});\n            require('JSEventLoopWatchdog').addHandler({\n              onStall: ({busyTime}) =>\n                this.setState(state => ({\n                  busyTime,\n                  filteredStall: (state.filteredStall || 0) * 0.97 +\n                    busyTime * 0.03,\n                })),\n            });\n          }}\n          onDisable={() => {\n            console.warn('Cannot disable yet....');\n          }}\n        />\n        {this.state &&\n          <Text>\n            {`JS Stall filtered: ${Math.round(this.state.filteredStall)}, `}\n            {`last: ${this.state.busyTime}`}\n          </Text>}\n      </View>\n    );\n  }\n}\n\nclass EventExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    scrollX: new Animated.Value(0),\n  };\n\n  render() {\n    const opacity = this.state.scrollX.interpolate({\n      inputRange: [0, 200],\n      outputRange: [1, 0],\n    });\n    return (\n      <View>\n        <Animated.View\n          style={[\n            styles.block,\n            {\n              opacity,\n            },\n          ]}\n        />\n        <Animated.ScrollView\n          horizontal\n          style={{height: 100, marginTop: 16}}\n          scrollEventThrottle={16}\n          onScroll={Animated.event(\n            [{nativeEvent: {contentOffset: {x: this.state.scrollX}}}],\n            {useNativeDriver: true},\n          )}>\n          <View\n            style={{\n              width: 600,\n              backgroundColor: '#eee',\n              justifyContent: 'center',\n            }}>\n            <Text>Scroll me!</Text>\n          </View>\n        </Animated.ScrollView>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  row: {\n    padding: 10,\n    zIndex: 1,\n  },\n  block: {\n    width: 50,\n    height: 50,\n    backgroundColor: 'blue',\n  },\n});\n\nexports.framework = 'React';\nexports.title = 'Native Animated Example';\nexports.description = 'Test out Native Animations';\n\nexports.examples = [\n  {\n    title: 'Multistage With Multiply and rotation',\n    render: function() {\n      return (\n        <Tester type=\"timing\" config={{duration: 1000}}>\n          {anim => (\n            <Animated.View\n              style={[\n                styles.block,\n                {\n                  transform: [\n                    {\n                      translateX: anim.interpolate({\n                        inputRange: [0, 1],\n                        outputRange: [0, 200],\n                      }),\n                    },\n                    {\n                      translateY: anim.interpolate({\n                        inputRange: [0, 0.5, 1],\n                        outputRange: [0, 50, 0],\n                      }),\n                    },\n                    {\n                      rotate: anim.interpolate({\n                        inputRange: [0, 0.5, 1],\n                        outputRange: ['0deg', '90deg', '0deg'],\n                      }),\n                    },\n                  ],\n                  opacity: Animated.multiply(\n                    anim.interpolate({\n                      inputRange: [0, 1],\n                      outputRange: [1, 0],\n                    }),\n                    anim.interpolate({\n                      inputRange: [0, 1],\n                      outputRange: [0.25, 1],\n                    }),\n                  ),\n                },\n              ]}\n            />\n          )}\n        </Tester>\n      );\n    },\n  },\n  {\n    title: 'Multistage With Multiply',\n    render: function() {\n      return (\n        <Tester type=\"timing\" config={{duration: 1000}}>\n          {anim => (\n            <Animated.View\n              style={[\n                styles.block,\n                {\n                  transform: [\n                    {\n                      translateX: anim.interpolate({\n                        inputRange: [0, 1],\n                        outputRange: [0, 200],\n                      }),\n                    },\n                    {\n                      translateY: anim.interpolate({\n                        inputRange: [0, 0.5, 1],\n                        outputRange: [0, 50, 0],\n                      }),\n                    },\n                  ],\n                  opacity: Animated.multiply(\n                    anim.interpolate({\n                      inputRange: [0, 1],\n                      outputRange: [1, 0],\n                    }),\n                    anim.interpolate({\n                      inputRange: [0, 1],\n                      outputRange: [0.25, 1],\n                    }),\n                  ),\n                },\n              ]}\n            />\n          )}\n        </Tester>\n      );\n    },\n  },\n  {\n    title: 'Scale interpolation with clamping',\n    render: function() {\n      return (\n        <Tester type=\"timing\" config={{duration: 1000}}>\n          {anim => (\n            <Animated.View\n              style={[\n                styles.block,\n                {\n                  transform: [\n                    {\n                      scale: anim.interpolate({\n                        inputRange: [0, 0.5],\n                        outputRange: [1, 1.4],\n                        extrapolateRight: 'clamp',\n                      }),\n                    },\n                  ],\n                },\n              ]}\n            />\n          )}\n        </Tester>\n      );\n    },\n  },\n  {\n    title: 'Opacity with delay',\n    render: function() {\n      return (\n        <Tester type=\"timing\" config={{duration: 1000, delay: 1000}}>\n          {anim => (\n            <Animated.View\n              style={[\n                styles.block,\n                {\n                  opacity: anim,\n                },\n              ]}\n            />\n          )}\n        </Tester>\n      );\n    },\n  },\n  {\n    title: 'Rotate interpolation',\n    render: function() {\n      return (\n        <Tester type=\"timing\" config={{duration: 1000}}>\n          {anim => (\n            <Animated.View\n              style={[\n                styles.block,\n                {\n                  transform: [\n                    {\n                      rotate: anim.interpolate({\n                        inputRange: [0, 1],\n                        outputRange: ['0deg', '90deg'],\n                      }),\n                    },\n                  ],\n                },\n              ]}\n            />\n          )}\n        </Tester>\n      );\n    },\n  },\n  {\n    title: 'translateX => Animated.spring (bounciness/speed)',\n    render: function() {\n      return (\n        <Tester type=\"spring\" config={{bounciness: 0}}>\n          {anim => (\n            <Animated.View\n              style={[\n                styles.block,\n                {\n                  transform: [\n                    {\n                      translateX: anim.interpolate({\n                        inputRange: [0, 1],\n                        outputRange: [0, 100],\n                      }),\n                    },\n                  ],\n                },\n              ]}\n            />\n          )}\n        </Tester>\n      );\n    },\n  },\n  {\n    title: 'translateX => Animated.spring (stiffness/damping/mass)',\n    render: function() {\n      return (\n        <Tester type=\"spring\" config={{stiffness: 1000, damping: 500, mass: 3 }}>\n          {anim => (\n            <Animated.View\n              style={[\n                styles.block,\n                {\n                  transform: [\n                    {\n                      translateX: anim.interpolate({\n                        inputRange: [0, 1],\n                        outputRange: [0, 100],\n                      }),\n                    },\n                  ],\n                },\n              ]}\n            />\n          )}\n        </Tester>\n      );\n    },\n  },\n  {\n    title: 'translateX => Animated.decay',\n    render: function() {\n      return (\n        <Tester\n          type=\"decay\"\n          config={{velocity: 0.5}}\n          reverseConfig={{velocity: -0.5}}>\n          {anim => (\n            <Animated.View\n              style={[\n                styles.block,\n                {\n                  transform: [\n                    {\n                      translateX: anim,\n                    },\n                  ],\n                },\n              ]}\n            />\n          )}\n        </Tester>\n      );\n    },\n  },\n  {\n    title: 'Drive custom property',\n    render: function() {\n      return (\n        <Tester type=\"timing\" config={{duration: 1000}}>\n          {anim => <AnimatedSlider style={{}} value={anim} />}\n        </Tester>\n      );\n    },\n  },\n  {\n    title: 'Animated value listener',\n    render: function() {\n      return <ValueListenerExample />;\n    },\n  },\n  {\n    title: 'Animated loop',\n    render: function() {\n      return <LoopExample />;\n    },\n  },\n  {\n    title: 'Animated events',\n    render: function() {\n      return <EventExample />;\n    },\n  },\n  {\n    title: 'Internal Settings',\n    render: function() {\n      return <InternalSettings />;\n    },\n  },\n];\n"
  },
  {
    "path": "RNTester/js/NavigatorIOSBarStyleExample.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * The examples provided by Facebook are for non-commercial testing and\n * evaluation purposes only.\n *\n * Facebook reserves all rights not expressly granted.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL\n * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * @providesModule NavigatorIOSBarStyleExample\n */\n\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  NavigatorIOS,\n  StatusBar,\n  StyleSheet,\n  Text,\n  View\n} = ReactNative;\n\nclass EmptyPage extends React.Component<{\n  text: string,\n}> {\n  render() {\n    return (\n      <View style={styles.emptyPage}>\n        <Text style={styles.emptyPageText}>\n          {this.props.text}\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass NavigatorIOSColors extends React.Component<{}> {\n  static title = '<NavigatorIOS> - Custom Bar Style';\n  static description = 'iOS navigation with custom nav bar colors';\n\n  render() {\n    // Set StatusBar with light contents to get better contrast\n    StatusBar.setBarStyle('light-content');\n\n    return (\n      <NavigatorIOS\n        style={styles.container}\n        initialRoute={{\n          component: EmptyPage,\n          title: '<NavigatorIOS>',\n          rightButtonTitle: 'Done',\n          onRightButtonPress: () => {\n            StatusBar.setBarStyle('default');\n            this.props.onExampleExit();\n          },\n          passProps: {\n            text: 'The nav bar is black with barStyle prop.',\n          },\n        }}\n        barStyle=\"black\"\n      />\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  emptyPage: {\n    flex: 1,\n    paddingTop: 64,\n  },\n  emptyPageText: {\n    margin: 10,\n  },\n});\n\nNavigatorIOSColors.external = true;\n\nmodule.exports = NavigatorIOSColors;\n"
  },
  {
    "path": "RNTester/js/NavigatorIOSColorsExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule NavigatorIOSColorsExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  NavigatorIOS,\n  StatusBar,\n  StyleSheet,\n  Text,\n  View\n} = ReactNative;\n\nclass EmptyPage extends React.Component {\n  render() {\n    return (\n      <View style={styles.emptyPage}>\n        <Text style={styles.emptyPageText}>\n          {this.props.text}\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass NavigatorIOSColors extends React.Component {\n  static title = '<NavigatorIOS> - Custom Colors';\n  static description = 'iOS navigation with custom nav bar colors';\n\n  render() {\n    // Set StatusBar with light contents to get better contrast\n    StatusBar.setBarStyle('light-content');\n\n    return (\n      <NavigatorIOS\n        style={styles.container}\n        initialRoute={{\n          component: EmptyPage,\n          title: '<NavigatorIOS>',\n          rightButtonTitle: 'Done',\n          onRightButtonPress: () => {\n            StatusBar.setBarStyle('default');\n            this.props.onExampleExit();\n          },\n          passProps: {\n            text: 'The nav bar has custom colors with tintColor, ' +\n              'barTintColor and titleTextColor props.',\n          },\n        }}\n        tintColor=\"#FFFFFF\"\n        barTintColor=\"#183E63\"\n        titleTextColor=\"#FFFFFF\"\n        translucent={true}\n      />\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  emptyPage: {\n    flex: 1,\n    paddingTop: 64,\n  },\n  emptyPageText: {\n    margin: 10,\n  },\n});\n\nNavigatorIOSColors.external = true;\n\nmodule.exports = NavigatorIOSColors;\n"
  },
  {
    "path": "RNTester/js/NavigatorIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule NavigatorIOSExample\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst ViewExample = require('./ViewExample');\n\nconst createExamplePage = require('./createExamplePage');\nconst nativeImageSource = require('nativeImageSource');\nconst {\n  AlertIOS,\n  NavigatorIOS,\n  ScrollView,\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  View,\n} = ReactNative;\n\nclass EmptyPage extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <View style={styles.emptyPage}>\n        <Text style={styles.emptyPageText}>\n          {this.props.text}\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass NavigatorIOSExamplePage extends React.Component<$FlowFixMeProps> {\n  render() {\n    var recurseTitle = 'Recurse Navigation';\n    if (!this.props.depth || this.props.depth === 1) {\n      recurseTitle += ' - more examples here';\n    }\n    return (\n      <ScrollView style={styles.list}>\n        <View style={styles.line}/>\n        <View style={styles.group}>\n          {this._renderRow(recurseTitle, () => {\n            this.props.navigator.push({\n              title: NavigatorIOSExample.title,\n              component: NavigatorIOSExamplePage,\n              backButtonTitle: 'Custom Back',\n              passProps: {depth: this.props.depth ? this.props.depth + 1 : 1},\n            });\n          })}\n          {this._renderRow('Push View Example', () => {\n            this.props.navigator.push({\n              title: 'Very Long Custom View Example Title',\n              component: createExamplePage(null, ViewExample),\n            });\n          })}\n          {this._renderRow('Custom title image Example', () => {\n            this.props.navigator.push({\n              title: 'Custom title image Example',\n              titleImage: require('./relay.png'),\n              component: createExamplePage(null, ViewExample),\n            });\n          })}\n          {this._renderRow('Custom Right Button', () => {\n            this.props.navigator.push({\n              title: NavigatorIOSExample.title,\n              component: EmptyPage,\n              rightButtonTitle: 'Cancel',\n              onRightButtonPress: () => this.props.navigator.pop(),\n              passProps: {\n                text: 'This page has a right button in the nav bar',\n              }\n            });\n          })}\n          {this._renderRow('Custom Right System Button', () => {\n            this.props.navigator.push({\n              title: NavigatorIOSExample.title,\n              component: EmptyPage,\n              rightButtonSystemIcon: 'bookmarks',\n              onRightButtonPress: () => this.props.navigator.pop(),\n              passProps: {\n                text: 'This page has a right system button in the nav bar',\n              }\n            });\n          })}\n          {this._renderRow('Custom Left & Right Icons', () => {\n            this.props.navigator.push({\n              title: NavigatorIOSExample.title,\n              component: EmptyPage,\n              leftButtonTitle: 'Custom Left',\n              onLeftButtonPress: () => this.props.navigator.pop(),\n              rightButtonIcon: nativeImageSource({\n                ios: 'NavBarButtonPlus',\n                width: 17,\n                height: 17\n              }),\n              onRightButtonPress: () => {\n                AlertIOS.alert(\n                  'Bar Button Action',\n                  'Recognized a tap on the bar button icon',\n                  [\n                    {\n                      text: 'OK',\n                      onPress: () => console.log('Tapped OK'),\n                    },\n                  ]\n                );\n              },\n              passProps: {\n                text: 'This page has an icon for the right button in the nav bar',\n              }\n            });\n          })}\n          {this._renderRow('Custom Left & Right System Icons', () => {\n            this.props.navigator.push({\n              title: NavigatorIOSExample.title,\n              component: EmptyPage,\n              leftButtonSystemIcon: 'cancel',\n              onLeftButtonPress: () => this.props.navigator.pop(),\n              rightButtonSystemIcon: 'search',\n              onRightButtonPress: () => {\n                AlertIOS.alert(\n                  'Bar Button Action',\n                  'Recognized a tap on the bar button icon',\n                  [\n                    {\n                      text: 'OK',\n                      onPress: () => console.log('Tapped OK'),\n                    },\n                  ]\n                );\n              },\n              passProps: {\n                text: 'This page has an icon for the right button in the nav bar',\n              }\n            });\n          })}\n          {this._renderRow('Pop', () => {\n            this.props.navigator.pop();\n          })}\n          {this._renderRow('Pop to top', () => {\n            this.props.navigator.popToTop();\n          })}\n          {this._renderReplace()}\n          {this._renderReplacePrevious()}\n          {this._renderReplacePreviousAndPop()}\n          {this._renderRow('Exit NavigatorIOS Example', this.props.onExampleExit)}\n        </View>\n        <View style={styles.line}/>\n      </ScrollView>\n    );\n  }\n\n  _renderReplace = () => {\n    if (!this.props.depth) {\n      // this is to avoid replacing the top of the stack\n      return null;\n    }\n    return this._renderRow('Replace here', () => {\n      var prevRoute = this.props.route;\n      this.props.navigator.replace({\n        title: 'New Navigation',\n        component: EmptyPage,\n        rightButtonTitle: 'Undo',\n        onRightButtonPress: () => this.props.navigator.replace(prevRoute),\n        passProps: {\n          text: 'The component is replaced, but there is currently no ' +\n            'way to change the right button or title of the current route',\n        }\n      });\n    });\n  };\n\n  _renderReplacePrevious = () => {\n    if (!this.props.depth || this.props.depth < 2) {\n      // this is to avoid replacing the top of the stack\n      return null;\n    }\n    return this._renderRow('Replace previous', () => {\n      this.props.navigator.replacePrevious({\n        title: 'Replaced',\n        component: EmptyPage,\n        passProps: {\n          text: 'This is a replaced \"previous\" page',\n        },\n        wrapperStyle: styles.customWrapperStyle,\n      });\n    });\n  };\n\n  _renderReplacePreviousAndPop = () => {\n    if (!this.props.depth || this.props.depth < 2) {\n      // this is to avoid replacing the top of the stack\n      return null;\n    }\n    return this._renderRow('Replace previous and pop', () => {\n      this.props.navigator.replacePreviousAndPop({\n        title: 'Replaced and Popped',\n        component: EmptyPage,\n        passProps: {\n          text: 'This is a replaced \"previous\" page',\n        },\n        wrapperStyle: styles.customWrapperStyle,\n      });\n    });\n  };\n\n  _renderRow = (title: string, onPress: Function) => {\n    return (\n      <View>\n        <TouchableHighlight onPress={onPress}>\n          <View style={styles.row}>\n            <Text style={styles.rowText}>\n              {title}\n            </Text>\n          </View>\n        </TouchableHighlight>\n        <View style={styles.separator} />\n      </View>\n    );\n  };\n}\n\nclass NavigatorIOSExample extends React.Component<$FlowFixMeProps> {\n  static title = '<NavigatorIOS>';\n  static description = 'iOS navigation capabilities';\n  static external = true;\n\n  render() {\n    const {onExampleExit} = this.props;\n    return (\n      <NavigatorIOS\n        style={styles.container}\n        initialRoute={{\n          title: NavigatorIOSExample.title,\n          component: NavigatorIOSExamplePage,\n          passProps: {onExampleExit},\n        }}\n        tintColor=\"#008888\"\n      />\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  customWrapperStyle: {\n    backgroundColor: '#bbdddd',\n  },\n  emptyPage: {\n    flex: 1,\n    paddingTop: 64,\n  },\n  emptyPageText: {\n    margin: 10,\n  },\n  list: {\n    backgroundColor: '#eeeeee',\n    marginTop: 10,\n  },\n  group: {\n    backgroundColor: 'white',\n  },\n  groupSpace: {\n    height: 15,\n  },\n  line: {\n    backgroundColor: '#bbbbbb',\n    height: StyleSheet.hairlineWidth,\n  },\n  row: {\n    backgroundColor: 'white',\n    justifyContent: 'center',\n    paddingHorizontal: 15,\n    paddingVertical: 15,\n  },\n  separator: {\n    height: StyleSheet.hairlineWidth,\n    backgroundColor: '#bbbbbb',\n    marginLeft: 15,\n  },\n  rowNote: {\n    fontSize: 17,\n  },\n  rowText: {\n    fontSize: 17,\n    fontWeight: '500',\n  },\n});\n\nmodule.exports = NavigatorIOSExample;\n"
  },
  {
    "path": "RNTester/js/NetInfoExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule NetInfoExample\n */\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\nconst {\n  NetInfo,\n  Text,\n  View,\n  TouchableWithoutFeedback,\n} = ReactNative;\n\nclass ConnectionInfoSubscription extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    connectionInfoHistory: [],\n  };\n\n  componentDidMount() {\n    NetInfo.addEventListener(\n        'change',\n        this._handleConnectionInfoChange\n    );\n  }\n\n  componentWillUnmount() {\n    NetInfo.removeEventListener(\n        'change',\n        this._handleConnectionInfoChange\n    );\n  }\n\n  _handleConnectionInfoChange = (connectionInfo) => {\n    const connectionInfoHistory = this.state.connectionInfoHistory.slice();\n    connectionInfoHistory.push(connectionInfo);\n    this.setState({\n      connectionInfoHistory,\n    });\n  };\n\n  render() {\n    return (\n        <View>\n          <Text>{JSON.stringify(this.state.connectionInfoHistory)}</Text>\n        </View>\n    );\n  }\n}\n\nclass ConnectionInfoCurrent extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    connectionInfo: null,\n  };\n\n  componentDidMount() {\n    NetInfo.addEventListener(\n        'change',\n        this._handleConnectionInfoChange\n    );\n    NetInfo.fetch().done(\n        (connectionInfo) => { this.setState({connectionInfo}); }\n    );\n  }\n\n  componentWillUnmount() {\n    NetInfo.removeEventListener(\n        'change',\n        this._handleConnectionInfoChange\n    );\n  }\n\n  _handleConnectionInfoChange = (connectionInfo) => {\n    this.setState({\n      connectionInfo,\n    });\n  };\n\n  render() {\n    return (\n        <View>\n          <Text>{this.state.connectionInfo}</Text>\n        </View>\n    );\n  }\n}\n\nclass IsConnected extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    isConnected: null,\n  };\n\n  componentDidMount() {\n    NetInfo.isConnected.addEventListener(\n        'change',\n        this._handleConnectivityChange\n    );\n    NetInfo.isConnected.fetch().done(\n        (isConnected) => { this.setState({isConnected}); }\n    );\n  }\n\n  componentWillUnmount() {\n    NetInfo.isConnected.removeEventListener(\n        'change',\n        this._handleConnectivityChange\n    );\n  }\n\n  _handleConnectivityChange = (isConnected) => {\n    this.setState({\n      isConnected,\n    });\n  };\n\n  render() {\n    return (\n        <View>\n          <Text>{this.state.isConnected ? 'Online' : 'Offline'}</Text>\n        </View>\n    );\n  }\n}\n\nclass IsConnectionExpensive extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    isConnectionExpensive: (null : ?boolean),\n  };\n\n  _checkIfExpensive = () => {\n    NetInfo.isConnectionExpensive().then(\n        isConnectionExpensive => { this.setState({isConnectionExpensive}); }\n    );\n  };\n\n  render() {\n    return (\n        <View>\n          <TouchableWithoutFeedback onPress={this._checkIfExpensive}>\n            <View>\n              <Text>Click to see if connection is expensive:\n                {this.state.isConnectionExpensive === true ? 'Expensive' :\n                this.state.isConnectionExpensive === false ? 'Not expensive'\n                : 'Unknown'}\n              </Text>\n            </View>\n          </TouchableWithoutFeedback>\n        </View>\n    );\n  }\n}\n\nexports.title = 'NetInfo';\nexports.description = 'Monitor network status';\nexports.examples = [\n  {\n    title: 'NetInfo.isConnected',\n    description: 'Asynchronously load and observe connectivity',\n    render(): React.Element<any> { return <IsConnected />; }\n  },\n  {\n    title: 'NetInfo.update',\n    description: 'Asynchronously load and observe connectionInfo',\n    render(): React.Element<any> { return <ConnectionInfoCurrent />; }\n  },\n  {\n    title: 'NetInfo.updateHistory',\n    description: 'Observed updates to connectionInfo',\n    render(): React.Element<any> { return <ConnectionInfoSubscription />; }\n  },\n  {\n    platform: 'android',\n    title: 'NetInfo.isConnectionExpensive (Android)',\n    description: 'Asynchronously check isConnectionExpensive',\n    render(): React.Element<any> { return <IsConnectionExpensive />; }\n  },\n];\n"
  },
  {
    "path": "RNTester/js/OrientationChangeExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule OrientationChangeExample\n * @flow\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  DeviceEventEmitter,\n  Text,\n  View,\n} = ReactNative;\n\nimport type EmitterSubscription from 'EmitterSubscription';\n\nclass OrientationChangeExample extends React.Component<{}, $FlowFixMeState> {\n  _orientationSubscription: EmitterSubscription;\n\n  state = {\n    currentOrientation: '',\n    orientationDegrees: 0,\n    isLandscape: false,\n  };\n\n  componentDidMount() {\n    this._orientationSubscription = DeviceEventEmitter.addListener(\n      'namedOrientationDidChange', this._onOrientationChange,\n    );\n  }\n\n  componentWillUnmount() {\n    this._orientationSubscription.remove();\n  }\n\n  _onOrientationChange = (orientation: Object) => {\n    this.setState({\n      currentOrientation: orientation.name,\n      orientationDegrees: orientation.rotationDegrees,\n      isLandscape: orientation.isLandscape,\n    });\n  }\n\n  render() {\n    return (\n      <View>\n        <Text>{JSON.stringify(this.state)}</Text>\n      </View>\n    );\n  }\n}\n\nexports.title = 'OrientationChangeExample';\nexports.description = 'listening to orientation changes';\nexports.examples = [\n  {\n    title: 'OrientationChangeExample',\n    description: 'listening to device orientation changes',\n    render() { return <OrientationChangeExample />; },\n  },\n];\n"
  },
  {
    "path": "RNTester/js/PanResponderExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow weak\n * @providesModule PanResponderExample\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\nvar {\n  PanResponder,\n  StyleSheet,\n  View,\n} = ReactNative;\n\nvar CIRCLE_SIZE = 80;\n\nvar PanResponderExample = createReactClass({\n  displayName: 'PanResponderExample',\n\n  statics: {\n    title: 'PanResponder Sample',\n    description: 'Shows the use of PanResponder to provide basic gesture handling.',\n  },\n\n  _panResponder: {},\n  _previousLeft: 0,\n  _previousTop: 0,\n  _circleStyles: {},\n  circle: (null : ?{ setNativeProps(props: Object): void }),\n\n  componentWillMount: function() {\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      style: {\n        left: this._previousLeft,\n        top: this._previousTop,\n        backgroundColor: 'green',\n      }\n    };\n  },\n\n  componentDidMount: function() {\n    this._updateNativeStyles();\n  },\n\n  render: function() {\n    return (\n      <View\n        style={styles.container}>\n        <View\n          ref={(circle) => {\n            this.circle = circle;\n          }}\n          style={styles.circle}\n          {...this._panResponder.panHandlers}\n        />\n      </View>\n    );\n  },\n\n  _highlight: function() {\n    this._circleStyles.style.backgroundColor = 'blue';\n    this._updateNativeStyles();\n  },\n\n  _unHighlight: function() {\n    this._circleStyles.style.backgroundColor = 'green';\n    this._updateNativeStyles();\n  },\n\n  _updateNativeStyles: function() {\n    this.circle && this.circle.setNativeProps(this._circleStyles);\n  },\n\n  _handleStartShouldSetPanResponder: function(e: Object, gestureState: Object): boolean {\n    // Should we become active when the user presses down on the circle?\n    return true;\n  },\n\n  _handleMoveShouldSetPanResponder: function(e: Object, gestureState: Object): boolean {\n    // Should we become active when the user moves a touch over the circle?\n    return true;\n  },\n\n  _handlePanResponderGrant: function(e: Object, gestureState: Object) {\n    this._highlight();\n  },\n  _handlePanResponderMove: function(e: Object, gestureState: Object) {\n    this._circleStyles.style.left = this._previousLeft + gestureState.dx;\n    this._circleStyles.style.top = this._previousTop + gestureState.dy;\n    this._updateNativeStyles();\n  },\n  _handlePanResponderEnd: function(e: Object, gestureState: Object) {\n    this._unHighlight();\n    this._previousLeft += gestureState.dx;\n    this._previousTop += gestureState.dy;\n  },\n});\n\nvar 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  },\n  container: {\n    flex: 1,\n    paddingTop: 64,\n  },\n});\n\nmodule.exports = PanResponderExample;\n"
  },
  {
    "path": "RNTester/js/PermissionsExampleAndroid.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PermissionsExampleAndroid\n * @flow\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  PermissionsAndroid,\n  Picker,\n  StyleSheet,\n  Text,\n  TouchableWithoutFeedback,\n  View,\n} = ReactNative;\n\nconst Item = Picker.Item;\n\nexports.displayName = (undefined: ?string);\nexports.framework = 'React';\nexports.title = 'PermissionsAndroid';\nexports.description = 'Permissions example for API 23+.';\n\nclass PermissionsExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    permission: PermissionsAndroid.PERMISSIONS.CAMERA,\n    hasPermission: 'Not Checked',\n  };\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text style={styles.text}>Permission Name:</Text>\n        <Picker\n          style={styles.picker}\n          selectedValue={this.state.permission}\n          onValueChange={this._onSelectPermission.bind(this)}>\n          <Item label={PermissionsAndroid.PERMISSIONS.CAMERA} value={PermissionsAndroid.PERMISSIONS.CAMERA} />\n          <Item label={PermissionsAndroid.PERMISSIONS.READ_CALENDAR} value={PermissionsAndroid.PERMISSIONS.READ_CALENDAR} />\n          <Item label={PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION} value={PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION} />\n        </Picker>\n        <TouchableWithoutFeedback onPress={this._checkPermission}>\n          <View>\n            <Text style={[styles.touchable, styles.text]}>Check Permission</Text>\n          </View>\n        </TouchableWithoutFeedback>\n        <Text style={styles.text}>Permission Status: {this.state.hasPermission}</Text>\n        <TouchableWithoutFeedback onPress={this._requestPermission}>\n          <View>\n            <Text style={[styles.touchable, styles.text]}>Request Permission</Text>\n          </View>\n        </TouchableWithoutFeedback>\n      </View>\n    );\n  }\n\n  _onSelectPermission = (permission: string) => {\n    this.setState({\n      permission: permission,\n    });\n  };\n\n  _checkPermission = async () => {\n    let result = await PermissionsAndroid.check(this.state.permission);\n    this.setState({\n      hasPermission: (result ? 'Granted' : 'Revoked') + ' for ' +\n        this.state.permission,\n    });\n  };\n\n  _requestPermission = async () => {\n    let result = await PermissionsAndroid.request(\n      this.state.permission,\n      {\n        title: 'Permission Explanation',\n        message:\n          'The app needs the following permission ' + this.state.permission +\n          ' because of reasons. Please approve.'\n      },\n    );\n\n    this.setState({\n      hasPermission: result + ' for ' +\n        this.state.permission,\n    });\n  };\n}\n\nexports.examples = [\n  {\n    title: 'Permissions Example',\n    description: 'Short example of how to use the runtime permissions API introduced in Android M.',\n    render: () => <PermissionsExample />,\n  },\n];\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    backgroundColor: 'white',\n  },\n  singleLine: {\n    fontSize: 16,\n    padding: 4,\n  },\n  text: {\n    margin: 10,\n  },\n  touchable: {\n    color: '#007AFF',\n  },\n  picker: {\n    flex: 1,\n  }\n});\n"
  },
  {
    "path": "RNTester/js/PickerExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule PickerExample\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst StyleSheet = require('StyleSheet');\nconst RNTesterBlock = require('RNTesterBlock');\nconst RNTesterPage = require('RNTesterPage');\n\nconst {\n  Picker,\n  Text,\n} = ReactNative;\n\nconst Item = Picker.Item;\n\nclass PickerExample extends React.Component<{}, $FlowFixMeState> {\n  static title = '<Picker>';\n  static description = 'Provides multiple options to choose from, using either a dropdown menu or a dialog.';\n\n  state = {\n    selected1: 'key1',\n    selected2: 'key1',\n    selected3: 'key1',\n    color: 'red',\n    mode: Picker.MODE_DIALOG,\n  };\n\n  render() {\n    return (\n      <RNTesterPage title=\"<Picker>\">\n        <RNTesterBlock title=\"Basic Picker\">\n          <Picker\n            style={styles.picker}\n            selectedValue={this.state.selected1}\n            onValueChange={this.onValueChange.bind(this, 'selected1')}>\n            <Item label=\"hello\" value=\"key0\" />\n            <Item label=\"world\" value=\"key1\" />\n          </Picker>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Disabled picker\">\n          <Picker style={styles.picker} enabled={false} selectedValue={this.state.selected1}>\n            <Item label=\"hello\" value=\"key0\" />\n            <Item label=\"world\" value=\"key1\" />\n          </Picker>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Dropdown Picker\">\n          <Picker\n            style={styles.picker}\n            selectedValue={this.state.selected2}\n            onValueChange={this.onValueChange.bind(this, 'selected2')}\n            mode=\"dropdown\">\n            <Item label=\"hello\" value=\"key0\" />\n            <Item label=\"world\" value=\"key1\" />\n          </Picker>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Picker with prompt message\">\n          <Picker\n            style={styles.picker}\n            selectedValue={this.state.selected3}\n            onValueChange={this.onValueChange.bind(this, 'selected3')}\n            prompt=\"Pick one, just one\">\n            <Item label=\"hello\" value=\"key0\" />\n            <Item label=\"world\" value=\"key1\" />\n          </Picker>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Picker with no listener\">\n          <Picker style={styles.picker}>\n            <Item label=\"hello\" value=\"key0\" />\n            <Item label=\"world\" value=\"key1\" />\n          </Picker>\n          <Text>\n            Cannot change the value of this picker because it doesn't update selectedValue.\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Colorful pickers\">\n          <Picker\n            style={[styles.picker, {color: 'white', backgroundColor: '#333'}]}\n            selectedValue={this.state.color}\n            onValueChange={this.onValueChange.bind(this, 'color')}\n            mode=\"dropdown\">\n            <Item label=\"red\" color=\"red\" value=\"red\" />\n            <Item label=\"green\" color=\"green\" value=\"green\" />\n            <Item label=\"blue\" color=\"blue\" value=\"blue\" />\n          </Picker>\n          <Picker\n            style={styles.picker}\n            selectedValue={this.state.color}\n            onValueChange={this.onValueChange.bind(this, 'color')}\n            mode=\"dialog\">\n            <Item label=\"red\" color=\"red\" value=\"red\" />\n            <Item label=\"green\" color=\"green\" value=\"green\" />\n            <Item label=\"blue\" color=\"blue\" value=\"blue\" />\n          </Picker>\n        </RNTesterBlock>\n      </RNTesterPage>\n    );\n  }\n\n  changeMode = () => {\n    const newMode = this.state.mode === Picker.MODE_DIALOG\n        ? Picker.MODE_DROPDOWN\n        : Picker.MODE_DIALOG;\n    this.setState({mode: newMode});\n  };\n\n  onValueChange = (key: string, value: string) => {\n    const newState = {};\n    newState[key] = value;\n    this.setState(newState);\n  };\n}\n\nvar styles = StyleSheet.create({\n  picker: {\n    width: 100,\n  },\n});\n\nmodule.exports = PickerExample;\n"
  },
  {
    "path": "RNTester/js/PickerIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule PickerIOSExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  PickerIOS,\n  Text,\n  View,\n} = ReactNative;\n\nvar PickerItemIOS = PickerIOS.Item;\n\nvar CAR_MAKES_AND_MODELS = {\n  amc: {\n    name: 'AMC',\n    models: ['AMX', 'Concord', 'Eagle', 'Gremlin', 'Matador', 'Pacer'],\n  },\n  alfa: {\n    name: 'Alfa-Romeo',\n    models: ['159', '4C', 'Alfasud', 'Brera', 'GTV6', 'Giulia', 'MiTo', 'Spider'],\n  },\n  aston: {\n    name: 'Aston Martin',\n    models: ['DB5', 'DB9', 'DBS', 'Rapide', 'Vanquish', 'Vantage'],\n  },\n  audi: {\n    name: 'Audi',\n    models: ['90', '4000', '5000', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'Q5', 'Q7'],\n  },\n  austin: {\n    name: 'Austin',\n    models: ['America', 'Maestro', 'Maxi', 'Mini', 'Montego', 'Princess'],\n  },\n  borgward: {\n    name: 'Borgward',\n    models: ['Hansa', 'Isabella', 'P100'],\n  },\n  buick: {\n    name: 'Buick',\n    models: ['Electra', 'LaCrosse', 'LeSabre', 'Park Avenue', 'Regal',\n             'Roadmaster', 'Skylark'],\n  },\n  cadillac: {\n    name: 'Cadillac',\n    models: ['Catera', 'Cimarron', 'Eldorado', 'Fleetwood', 'Sedan de Ville'],\n  },\n  chevrolet: {\n    name: 'Chevrolet',\n    models: ['Astro', 'Aveo', 'Bel Air', 'Captiva', 'Cavalier', 'Chevelle',\n             'Corvair', 'Corvette', 'Cruze', 'Nova', 'SS', 'Vega', 'Volt'],\n  },\n};\n\nclass PickerExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    carMake: 'cadillac',\n    modelIndex: 3,\n  };\n\n  render() {\n    var make = CAR_MAKES_AND_MODELS[this.state.carMake];\n    var selectionString = make.name + ' ' + make.models[this.state.modelIndex];\n    return (\n      <View>\n        <Text>Please choose a make for your car:</Text>\n        <PickerIOS\n          selectedValue={this.state.carMake}\n          onValueChange={(carMake) => this.setState({carMake, modelIndex: 0})}>\n          {Object.keys(CAR_MAKES_AND_MODELS).map((carMake) => (\n            <PickerItemIOS\n              key={carMake}\n              value={carMake}\n              label={CAR_MAKES_AND_MODELS[carMake].name}\n            />\n          ))}\n        </PickerIOS>\n        <Text>Please choose a model of {make.name}:</Text>\n        <PickerIOS\n          selectedValue={this.state.modelIndex}\n          key={this.state.carMake}\n          onValueChange={(modelIndex) => this.setState({modelIndex})}>\n          {CAR_MAKES_AND_MODELS[this.state.carMake].models.map((modelName, modelIndex) => (\n            <PickerItemIOS\n              key={this.state.carMake + '_' + modelIndex}\n              value={modelIndex}\n              label={modelName}\n            />\n          ))}\n        </PickerIOS>\n        <Text>You selected: {selectionString}</Text>\n      </View>\n    );\n  }\n}\n\nclass PickerStyleExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    carMake: 'cadillac',\n    modelIndex: 0,\n  };\n\n  render() {\n    return (\n      <PickerIOS\n        itemStyle={{fontSize: 25, color: 'red', textAlign: 'left', fontWeight: 'bold'}}\n        selectedValue={this.state.carMake}\n        onValueChange={(carMake) => this.setState({carMake, modelIndex: 0})}>\n        {Object.keys(CAR_MAKES_AND_MODELS).map((carMake) => (\n          <PickerItemIOS\n            key={carMake}\n            value={carMake}\n            label={CAR_MAKES_AND_MODELS[carMake].name}\n          />\n        ))}\n      </PickerIOS>\n    );\n  }\n}\n\nexports.displayName = (undefined: ?string);\nexports.title = '<PickerIOS>';\nexports.description = 'Render lists of selectable options with UIPickerView.';\nexports.examples = [\n{\n  title: '<PickerIOS>',\n  render: function(): React.Element<any> {\n    return <PickerExample />;\n  },\n},\n{\n  title: '<PickerIOS> with custom styling',\n  render: function(): React.Element<any> {\n    return <PickerStyleExample />;\n  },\n}];\n"
  },
  {
    "path": "RNTester/js/PointerEventsExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule PointerEventsExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nclass ExampleBox extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  state = {\n    log: [],\n  };\n\n  handleLog = (msg) => {\n    this.state.log = this.state.log.concat([msg]);\n  };\n\n  flushReactChanges = () => {\n    this.forceUpdate();\n  };\n\n  /**\n   * Capture phase of bubbling to append separator before any of the bubbling\n   * happens.\n   */\n  handleTouchCapture = () => {\n    this.state.log = this.state.log.concat(['---']);\n  };\n\n  render() {\n    return (\n      <View>\n        <View\n          onTouchEndCapture={this.handleTouchCapture}\n          onTouchStart={this.flushReactChanges}>\n          {/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n            * comment suppresses an error when upgrading Flow's support for\n            * React. To see the error delete this comment and run Flow. */}\n          <this.props.Component onLog={this.handleLog} />\n        </View>\n        <View\n          style={styles.logBox}>\n          <DemoText style={styles.logText}>\n            {this.state.log.join('\\n')}\n          </DemoText>\n        </View>\n      </View>\n    );\n  }\n}\n\nclass NoneExample extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <View\n        onTouchStart={() => this.props.onLog('A unspecified touched')}\n        style={styles.box}>\n        <DemoText style={styles.text}>\n          A: unspecified\n        </DemoText>\n        <View\n          pointerEvents=\"none\"\n          onTouchStart={() => this.props.onLog('B none touched')}\n          style={[styles.box, styles.boxPassedThrough]}>\n          <DemoText style={[styles.text, styles.textPassedThrough]}>\n            B: none\n          </DemoText>\n          <View\n            onTouchStart={() => this.props.onLog('C unspecified touched')}\n            style={[styles.box, styles.boxPassedThrough]}>\n            <DemoText style={[styles.text, styles.textPassedThrough]}>\n              C: unspecified\n            </DemoText>\n          </View>\n        </View>\n      </View>\n    );\n  }\n}\n\n/**\n * Special demo text that makes itself untouchable so that it doesn't destroy\n * the experiment and confuse the output.\n */\nclass DemoText extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <View pointerEvents=\"none\">\n        <Text\n          style={this.props.style}>\n          {this.props.children}\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass BoxNoneExample extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <View\n        onTouchStart={() => this.props.onLog('A unspecified touched')}\n        style={styles.box}>\n        <DemoText style={styles.text}>\n          A: unspecified\n        </DemoText>\n        <View\n          pointerEvents=\"box-none\"\n          onTouchStart={() => this.props.onLog('B box-none touched')}\n          style={[styles.box, styles.boxPassedThrough]}>\n          <DemoText style={[styles.text, styles.textPassedThrough]}>\n            B: box-none\n          </DemoText>\n          <View\n            onTouchStart={() => this.props.onLog('C unspecified touched')}\n            style={styles.box}>\n            <DemoText style={styles.text}>\n              C: unspecified\n            </DemoText>\n          </View>\n          <View\n            pointerEvents=\"auto\"\n            onTouchStart={() => this.props.onLog('C explicitly unspecified touched')}\n            style={[styles.box]}>\n            <DemoText style={[styles.text]}>\n              C: explicitly unspecified\n            </DemoText>\n          </View>\n        </View>\n      </View>\n    );\n  }\n}\n\nclass BoxOnlyExample extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <View\n        onTouchStart={() => this.props.onLog('A unspecified touched')}\n        style={styles.box}>\n        <DemoText style={styles.text}>\n          A: unspecified\n        </DemoText>\n        <View\n          pointerEvents=\"box-only\"\n          onTouchStart={() => this.props.onLog('B box-only touched')}\n          style={styles.box}>\n          <DemoText style={styles.text}>\n            B: box-only\n          </DemoText>\n          <View\n            onTouchStart={() => this.props.onLog('C unspecified touched')}\n            style={[styles.box, styles.boxPassedThrough]}>\n            <DemoText style={[styles.text, styles.textPassedThrough]}>\n              C: unspecified\n            </DemoText>\n          </View>\n          <View\n            pointerEvents=\"auto\"\n            onTouchStart={() => this.props.onLog('C explicitly unspecified touched')}\n            style={[styles.box, styles.boxPassedThrough]}>\n            <DemoText style={[styles.text, styles.textPassedThrough]}>\n              C: explicitly unspecified\n            </DemoText>\n          </View>\n        </View>\n      </View>\n    );\n  }\n}\n\ntype ExampleClass = {\n  Component: React.ComponentType<any>,\n  title: string,\n  description: string,\n};\n\nvar exampleClasses: Array<ExampleClass> = [\n  {\n    Component: NoneExample,\n    title: '`none`',\n    description: '`none` causes touch events on the container and its child components to pass through to the parent container.',\n  },\n  {\n    Component: BoxNoneExample,\n    title: '`box-none`',\n    description: '`box-none` causes touch events on the container to pass through and will only detect touch events on its child components.',\n  },\n  {\n    Component: BoxOnlyExample,\n    title: '`box-only`',\n    description: '`box-only` causes touch events on the container\\'s child components to pass through and will only detect touch events on the container itself.',\n  }\n];\n\nvar infoToExample = (info) => {\n  return {\n    title: info.title,\n    description: info.description,\n    render: function() {\n      return <ExampleBox key={info.title} Component={info.Component} />;\n    },\n  };\n};\n\nvar styles = StyleSheet.create({\n  text: {\n    fontSize: 10,\n    color: '#5577cc',\n  },\n  textPassedThrough: {\n    color: '#88aadd',\n  },\n  box: {\n    backgroundColor: '#aaccff',\n    borderWidth: 1,\n    borderColor: '#7799cc',\n    padding: 10,\n    margin: 5,\n  },\n  boxPassedThrough: {\n    borderColor: '#99bbee',\n  },\n  logText: {\n    fontSize: 9,\n  },\n  logBox: {\n    padding: 20,\n    margin: 10,\n    borderWidth: 0.5,\n    borderColor: '#f0f0f0',\n    backgroundColor: '#f9f9f9',\n  },\n  bottomSpacer: {\n    marginBottom: 100,\n  },\n});\n\nexports.framework = 'React';\nexports.title = 'Pointer Events';\nexports.description = 'Demonstrates the use of the pointerEvents prop of a ' +\n  'View to control how touches should be handled.';\nexports.examples = exampleClasses.map(infoToExample);\n"
  },
  {
    "path": "RNTester/js/ProgressBarAndroidExample.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ProgressBarAndroidExample\n */\n'use strict';\n\nvar ProgressBar = require('ProgressBarAndroid');\nvar React = require('React');\nvar createReactClass = require('create-react-class');\nvar RNTesterBlock = require('RNTesterBlock');\nvar RNTesterPage = require('RNTesterPage');\n\nvar TimerMixin = require('react-timer-mixin');\n\nvar MovingBar = createReactClass({\n  displayName: 'MovingBar',\n  mixins: [TimerMixin],\n\n  getInitialState: function() {\n    return {\n      progress: 0\n    };\n  },\n\n  componentDidMount: function() {\n    this.setInterval(\n      () => {\n        var progress = (this.state.progress + 0.02) % 1;\n        this.setState({progress: progress});\n      }, 50\n    );\n  },\n\n  render: function() {\n    return <ProgressBar progress={this.state.progress} {...this.props} />;\n  },\n});\n\nclass ProgressBarAndroidExample extends React.Component<{}> {\n  static title = '<ProgressBarAndroid>';\n  static description = 'Horizontal bar to show the progress of some operation.';\n\n  render() {\n    return (\n      <RNTesterPage title=\"ProgressBar Examples\">\n        <RNTesterBlock title=\"Horizontal Indeterminate ProgressBar\">\n          <ProgressBar styleAttr=\"Horizontal\" />\n        </RNTesterBlock>\n\n        <RNTesterBlock title=\"Horizontal ProgressBar\">\n          <MovingBar styleAttr=\"Horizontal\" indeterminate={false} />\n        </RNTesterBlock>\n\n        <RNTesterBlock title=\"Horizontal Black Indeterminate ProgressBar\">\n          <ProgressBar styleAttr=\"Horizontal\" color=\"black\" />\n        </RNTesterBlock>\n\n        <RNTesterBlock title=\"Horizontal Blue ProgressBar\">\n          <MovingBar styleAttr=\"Horizontal\" indeterminate={false} color=\"blue\" />\n        </RNTesterBlock>\n      </RNTesterPage>\n    );\n  }\n}\n\nmodule.exports = ProgressBarAndroidExample;\n"
  },
  {
    "path": "RNTester/js/ProgressViewIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ProgressViewIOSExample\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\nvar {\n  ProgressViewIOS,\n  StyleSheet,\n  View,\n} = ReactNative;\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar TimerMixin = require('react-timer-mixin');\n\nvar ProgressViewExample = createReactClass({\n  displayName: 'ProgressViewExample',\n  mixins: [TimerMixin],\n\n  getInitialState() {\n    return {\n      progress: 0,\n    };\n  },\n\n  componentDidMount() {\n    this.updateProgress();\n  },\n\n  updateProgress() {\n    var progress = this.state.progress + 0.01;\n    this.setState({ progress });\n    this.requestAnimationFrame(() => this.updateProgress());\n  },\n\n  getProgress(offset) {\n    var progress = this.state.progress + offset;\n    return Math.sin(progress % Math.PI) % 1;\n  },\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <ProgressViewIOS style={styles.progressView} progress={this.getProgress(0)}/>\n        <ProgressViewIOS style={styles.progressView} progressTintColor=\"purple\" progress={this.getProgress(0.2)}/>\n        <ProgressViewIOS style={styles.progressView} progressTintColor=\"red\" progress={this.getProgress(0.4)}/>\n        <ProgressViewIOS style={styles.progressView} progressTintColor=\"orange\" progress={this.getProgress(0.6)}/>\n        <ProgressViewIOS style={styles.progressView} progressTintColor=\"yellow\" progress={this.getProgress(0.8)}/>\n      </View>\n    );\n  },\n});\n\nexports.displayName = (undefined: ?string);\nexports.framework = 'React';\nexports.title = 'ProgressViewIOS';\nexports.description = 'ProgressViewIOS';\nexports.examples = [{\n  title: 'ProgressViewIOS',\n  render() {\n    return (\n      <ProgressViewExample/>\n    );\n  }\n}];\n\nvar styles = StyleSheet.create({\n  container: {\n    marginTop: -20,\n    backgroundColor: 'transparent',\n  },\n  progressView: {\n    marginTop: 20,\n  }\n});\n"
  },
  {
    "path": "RNTester/js/PushNotificationIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule PushNotificationIOSExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  AlertIOS,\n  PushNotificationIOS,\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  View,\n} = ReactNative;\n\nclass Button extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <TouchableHighlight\n        underlayColor={'white'}\n        style={styles.button}\n        onPress={this.props.onPress}>\n        <Text style={styles.buttonLabel}>\n          {this.props.label}\n        </Text>\n      </TouchableHighlight>\n    );\n  }\n}\n\nclass NotificationExample extends React.Component<{}> {\n  componentWillMount() {\n    PushNotificationIOS.addEventListener('register', this._onRegistered);\n    PushNotificationIOS.addEventListener('registrationError', this._onRegistrationError);\n    PushNotificationIOS.addEventListener('notification', this._onRemoteNotification);\n    PushNotificationIOS.addEventListener('localNotification', this._onLocalNotification);\n\n    PushNotificationIOS.requestPermissions();\n  }\n\n  componentWillUnmount() {\n    PushNotificationIOS.removeEventListener('register', this._onRegistered);\n    PushNotificationIOS.removeEventListener('registrationError', this._onRegistrationError);\n    PushNotificationIOS.removeEventListener('notification', this._onRemoteNotification);\n    PushNotificationIOS.removeEventListener('localNotification', this._onLocalNotification);\n  }\n\n  render() {\n    return (\n      <View>\n        <Button\n          onPress={this._sendNotification}\n          label=\"Send fake notification\"\n        />\n\n        <Button\n          onPress={this._sendLocalNotification}\n          label=\"Send fake local notification\"\n        />\n      </View>\n    );\n  }\n\n  _sendNotification() {\n    require('RCTDeviceEventEmitter').emit('remoteNotificationReceived', {\n      remote: true,\n      aps: {\n        alert: 'Sample notification',\n        badge: '+1',\n        sound: 'default',\n        category: 'REACT_NATIVE',\n        'content-available': 1,\n      },\n    });\n  }\n\n  _sendLocalNotification() {\n    require('RCTDeviceEventEmitter').emit('localNotificationReceived', {\n      aps: {\n        alert: 'Sample local notification',\n        badge: '+1',\n        sound: 'default',\n        category: 'REACT_NATIVE'\n      },\n    });\n  }\n\n  _onRegistered(deviceToken) {\n    AlertIOS.alert(\n      'Registered For Remote Push',\n      `Device Token: ${deviceToken}`,\n      [{\n        text: 'Dismiss',\n        onPress: null,\n      }]\n    );\n  }\n\n  _onRegistrationError(error) {\n    AlertIOS.alert(\n      'Failed To Register For Remote Push',\n      `Error (${error.code}): ${error.message}`,\n      [{\n        text: 'Dismiss',\n        onPress: null,\n      }]\n    );\n  }\n\n  _onRemoteNotification(notification) {\n    const result = `Message: ${notification.getMessage()};\\n\n      badge: ${notification.getBadgeCount()};\\n\n      sound: ${notification.getSound()};\\n\n      category: ${notification.getCategory()};\\n\n      content-available: ${notification.getContentAvailable()}.`;\n\n    AlertIOS.alert(\n      'Push Notification Received',\n      result,\n      [{\n        text: 'Dismiss',\n        onPress: null,\n      }]\n    );\n  }\n\n  _onLocalNotification(notification){\n    AlertIOS.alert(\n      'Local Notification Received',\n      'Alert message: ' + notification.getMessage(),\n      [{\n        text: 'Dismiss',\n        onPress: null,\n      }]\n    );\n  }\n}\n\nclass NotificationPermissionExample extends React.Component<$FlowFixMeProps, any> {\n  constructor(props) {\n    super(props);\n    this.state = {permissions: null};\n  }\n\n  render() {\n    return (\n      <View>\n        <Button\n          onPress={this._showPermissions.bind(this)}\n          label=\"Show enabled permissions\"\n        />\n        <Text>\n          {JSON.stringify(this.state.permissions)}\n        </Text>\n      </View>\n    );\n  }\n\n  _showPermissions() {\n    PushNotificationIOS.checkPermissions((permissions) => {\n      this.setState({permissions});\n    });\n  }\n}\n\nvar styles = StyleSheet.create({\n  button: {\n    padding: 10,\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  buttonLabel: {\n    color: 'blue',\n  },\n});\n\nexports.title = 'PushNotificationIOS';\nexports.description = 'Apple PushNotification and badge value';\nexports.examples = [\n{\n  title: 'Badge Number',\n  render(): React.Element<any> {\n    return (\n      <View>\n        <Button\n          onPress={() => PushNotificationIOS.setApplicationIconBadgeNumber(42)}\n          label=\"Set app's icon badge to 42\"\n        />\n        <Button\n          onPress={() => PushNotificationIOS.setApplicationIconBadgeNumber(0)}\n          label=\"Clear app's icon badge\"\n        />\n      </View>\n    );\n  },\n},\n{\n  title: 'Push Notifications',\n  render(): React.Element<any> {\n    return <NotificationExample />;\n  }\n},\n{\n  title: 'Notifications Permissions',\n  render(): React.Element<any> {\n    return <NotificationPermissionExample />;\n  }\n}];\n"
  },
  {
    "path": "RNTester/js/RCTRootViewIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule RCTRootViewIOSExample\n */\n\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\nconst {\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nconst requireNativeComponent = require('requireNativeComponent');\n\nclass AppPropertiesUpdateExample extends React.Component<{}> {\n  render() {\n    // Do not require this unless we are actually rendering.\n    const UpdatePropertiesExampleView = requireNativeComponent('UpdatePropertiesExampleView');\n    return (\n      <View style={styles.container}>\n        <Text style={styles.text}>\n          Press the button to update the field below by passing new properties to the RN app.\n        </Text>\n        <UpdatePropertiesExampleView style={styles.nativeView}>\n          <Text style={styles.text}>\n            Error: This demo is accessible only from RNTester app\n          </Text>\n        </UpdatePropertiesExampleView>\n      </View>\n    );\n  }\n}\n\nclass RootViewSizeFlexibilityExample extends React.Component<{}> {\n  render() {\n    // Do not require this unless we are actually rendering.\n    const FlexibleSizeExampleView = requireNativeComponent('FlexibleSizeExampleView');\n    return (\n      <View style={styles.container}>\n        <Text style={styles.text}>\n          Press the button to resize it. On resize, RCTRootViewDelegate is notified. You can use it to handle content size updates.\n        </Text>\n        <FlexibleSizeExampleView style={styles.nativeView}>\n          <Text style={styles.text}>\n            Error: This demo is accessible only from RNTester app\n          </Text>\n        </FlexibleSizeExampleView>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    backgroundColor: '#F5FCFF',\n  },\n  text: {\n    marginBottom: 20\n  },\n  nativeView: {\n    height: 140,\n    width: 280\n  }\n});\n\nexports.title = 'RCTRootView';\nexports.description = 'Examples that show useful methods when embedding React Native in a native application';\nexports.examples = [\n{\n  title: 'Updating app properties in runtime',\n  render(): React.Element<any> {\n    return (\n      <AppPropertiesUpdateExample/>\n    );\n  },\n},\n{\n  title: 'RCTRootView\\'s size flexibility',\n  render(): React.Element<any> {\n    return (\n      <RootViewSizeFlexibilityExample/>\n    );\n  },\n}];\n"
  },
  {
    "path": "RNTester/js/RNTesterActions.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule RNTesterActions\n */\n'use strict';\n\nexport type RNTesterBackAction = {\n  type: 'RNTesterBackAction',\n};\n\nexport type RNTesterListAction = {\n  type: 'RNTesterListAction',\n};\n\nexport type RNTesterExampleAction = {\n  type: 'RNTesterExampleAction',\n  openExample: string,\n};\n\nexport type RNTesterAction = (\n  RNTesterBackAction |\n  RNTesterListAction |\n  RNTesterExampleAction\n);\n\n\nfunction Back(): RNTesterBackAction {\n  return {\n    type: 'RNTesterBackAction',\n  };\n}\n\nfunction ExampleList(): RNTesterListAction {\n  return {\n    type: 'RNTesterListAction',\n  };\n}\n\nfunction ExampleAction(openExample: string): RNTesterExampleAction {\n  return {\n    type: 'RNTesterExampleAction',\n    openExample,\n  };\n}\n\nconst RNTesterActions = {\n  Back,\n  ExampleList,\n  ExampleAction,\n};\n\nmodule.exports = RNTesterActions;\n"
  },
  {
    "path": "RNTester/js/RNTesterApp.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RNTesterApp\n * @flow\n */\n'use strict';\n\nconst AppRegistry = require('AppRegistry');\nconst AsyncStorage = require('AsyncStorage');\nconst BackHandler = require('BackHandler');\nconst Dimensions = require('Dimensions');\nconst DrawerLayoutAndroid = require('DrawerLayoutAndroid');\nconst Linking = require('Linking');\nconst React = require('react');\nconst StatusBar = require('StatusBar');\nconst StyleSheet = require('StyleSheet');\nconst ToolbarAndroid = require('ToolbarAndroid');\nconst RNTesterActions = require('./RNTesterActions');\nconst RNTesterExampleContainer = require('./RNTesterExampleContainer');\nconst RNTesterExampleList = require('./RNTesterExampleList');\nconst RNTesterList = require('./RNTesterList');\nconst RNTesterNavigationReducer = require('./RNTesterNavigationReducer');\nconst UIManager = require('UIManager');\nconst URIActionMap = require('./URIActionMap');\nconst View = require('View');\n\nconst nativeImageSource = require('nativeImageSource');\n\nimport type { RNTesterNavigationState } from './RNTesterNavigationReducer';\n\nUIManager.setLayoutAnimationEnabledExperimental(true);\n\nconst DRAWER_WIDTH_LEFT = 56;\n\ntype Props = {\n  exampleFromAppetizeParams: string,\n};\n\nconst APP_STATE_KEY = 'RNTesterAppState.v2';\n\nconst HEADER_LOGO_ICON = nativeImageSource({\n  android: 'launcher_icon',\n  width: 132,\n  height: 144\n});\n\nconst HEADER_NAV_ICON = nativeImageSource({\n  android: 'ic_menu_black_24dp',\n  width: 48,\n  height: 48\n});\n\nclass RNTesterApp extends React.Component<Props, RNTesterNavigationState> {\n  componentWillMount() {\n    BackHandler.addEventListener('hardwareBackPress', this._handleBackButtonPress);\n  }\n\n  componentDidMount() {\n    Linking.getInitialURL().then((url) => {\n      AsyncStorage.getItem(APP_STATE_KEY, (err, storedString) => {\n        const exampleAction = URIActionMap(this.props.exampleFromAppetizeParams);\n        const urlAction = URIActionMap(url);\n        const launchAction = exampleAction || urlAction;\n        if (err || !storedString) {\n          const initialAction = launchAction || {type: 'InitialAction'};\n          this.setState(RNTesterNavigationReducer(null, initialAction));\n          return;\n        }\n        const storedState = JSON.parse(storedString);\n        if (launchAction) {\n          this.setState(RNTesterNavigationReducer(storedState, launchAction));\n          return;\n        }\n        this.setState(storedState);\n      });\n    });\n  }\n\n  render() {\n    if (!this.state) {\n      return null;\n    }\n    return (\n      <DrawerLayoutAndroid\n        drawerPosition={DrawerLayoutAndroid.positions.Left}\n        drawerWidth={Dimensions.get('window').width - DRAWER_WIDTH_LEFT}\n        keyboardDismissMode=\"on-drag\"\n        onDrawerOpen={() => {\n          this._overrideBackPressForDrawerLayout = true;\n        }}\n        onDrawerClose={() => {\n          this._overrideBackPressForDrawerLayout = false;\n        }}\n        ref={(drawer) => { this.drawer = drawer; }}\n        renderNavigationView={this._renderDrawerContent}\n        statusBarBackgroundColor=\"#589c90\">\n        {this._renderApp()}\n      </DrawerLayoutAndroid>\n    );\n  }\n\n  _renderDrawerContent = () => {\n    return (\n      <View style={styles.drawerContentWrapper}>\n        <RNTesterExampleList\n          list={RNTesterList}\n          displayTitleRow={true}\n          disableSearch={true}\n          onNavigate={this._handleAction}\n        />\n      </View>\n    );\n  };\n\n  _renderApp() {\n    const {\n      openExample,\n    } = this.state;\n\n    if (openExample) {\n      const ExampleModule = RNTesterList.Modules[openExample];\n      if (ExampleModule.external) {\n        return (\n          <ExampleModule\n            onExampleExit={() => {\n              this._handleAction(RNTesterActions.Back());\n            }}\n            ref={(example) => { this._exampleRef = example; }}\n          />\n        );\n      } else if (ExampleModule) {\n        return (\n          <View style={styles.container}>\n            <ToolbarAndroid\n              logo={HEADER_LOGO_ICON}\n              navIcon={HEADER_NAV_ICON}\n              onIconClicked={() => this.drawer.openDrawer()}\n              style={styles.toolbar}\n              title={ExampleModule.title}\n            />\n            <RNTesterExampleContainer\n              module={ExampleModule}\n              ref={(example) => { this._exampleRef = example; }}\n            />\n          </View>\n        );\n      }\n    }\n\n    return (\n      <View style={styles.container}>\n        <ToolbarAndroid\n          logo={HEADER_LOGO_ICON}\n          navIcon={HEADER_NAV_ICON}\n          onIconClicked={() => this.drawer.openDrawer()}\n          style={styles.toolbar}\n          title=\"RNTester\"\n        />\n        <RNTesterExampleList\n          onNavigate={this._handleAction}\n          list={RNTesterList}\n        />\n      </View>\n    );\n  }\n\n  _handleAction = (action: Object): boolean => {\n    this.drawer && this.drawer.closeDrawer();\n    const newState = RNTesterNavigationReducer(this.state, action);\n    if (this.state !== newState) {\n      this.setState(\n        newState,\n        () => AsyncStorage.setItem(APP_STATE_KEY, JSON.stringify(this.state))\n      );\n      return true;\n    }\n    return false;\n  };\n\n  _handleBackButtonPress = () => {\n    if (this._overrideBackPressForDrawerLayout) {\n      // This hack is necessary because drawer layout provides an imperative API\n      // with open and close methods. This code would be cleaner if the drawer\n      // layout provided an `isOpen` prop and allowed us to pass a `onDrawerClose` handler.\n      this.drawer && this.drawer.closeDrawer();\n      return true;\n    }\n    if (\n      this._exampleRef &&\n      this._exampleRef.handleBackAction &&\n      this._exampleRef.handleBackAction()\n    ) {\n      return true;\n    }\n    return this._handleAction(RNTesterActions.Back());\n  };\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  toolbar: {\n    backgroundColor: '#E9EAED',\n    height: 56,\n  },\n  drawerContentWrapper: {\n    flex: 1,\n    paddingTop: StatusBar.currentHeight,\n    backgroundColor: 'white',\n  },\n});\n\nAppRegistry.registerComponent('RNTesterApp', () => RNTesterApp);\n\nmodule.exports = RNTesterApp;\n"
  },
  {
    "path": "RNTester/js/RNTesterApp.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RNTesterApp\n * @flow\n */\n'use strict';\n\nconst AsyncStorage = require('AsyncStorage');\nconst BackHandler = require('BackHandler');\nconst Linking = require('Linking');\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst RNTesterActions = require('./RNTesterActions');\nconst RNTesterExampleContainer = require('./RNTesterExampleContainer');\nconst RNTesterExampleList = require('./RNTesterExampleList');\nconst RNTesterList = require('./RNTesterList.ios');\nconst RNTesterNavigationReducer = require('./RNTesterNavigationReducer');\nconst URIActionMap = require('./URIActionMap');\n\nconst {\n  Button,\n  AppRegistry,\n  SnapshotViewIOS,\n  StyleSheet,\n  Text,\n  View,\n  SafeAreaView\n} = ReactNative;\n\nimport type { RNTesterExample } from './RNTesterList.ios';\nimport type { RNTesterAction } from './RNTesterActions';\nimport type { RNTesterNavigationState } from './RNTesterNavigationReducer';\n\ntype Props = {\n  exampleFromAppetizeParams: string,\n};\n\nconst APP_STATE_KEY = 'RNTesterAppState.v2';\n\nconst Header = ({ onBack, title }: { onBack?: () => mixed, title: string }) => (\n  <SafeAreaView style={styles.headerContainer}>\n    <View style={styles.header}>\n      <View style={styles.headerCenter}>\n        <Text style={styles.title}>{title}</Text>\n      </View>\n      {onBack && <View style={styles.headerLeft}>\n        <Button title=\"Back\" onPress={onBack} />\n      </View>}\n    </View>\n  </SafeAreaView>\n);\n\nclass RNTesterApp extends React.Component<Props, RNTesterNavigationState> {\n  componentWillMount() {\n    BackHandler.addEventListener('hardwareBackPress', this._handleBack);\n  }\n\n  componentDidMount() {\n    Linking.getInitialURL().then((url) => {\n      AsyncStorage.getItem(APP_STATE_KEY, (err, storedString) => {\n        const exampleAction = URIActionMap(this.props.exampleFromAppetizeParams);\n        const urlAction = URIActionMap(url);\n        const launchAction = exampleAction || urlAction;\n        if (err || !storedString) {\n          const initialAction = launchAction || {type: 'InitialAction'};\n          this.setState(RNTesterNavigationReducer(undefined, initialAction));\n          return;\n        }\n        const storedState = JSON.parse(storedString);\n        if (launchAction) {\n          this.setState(RNTesterNavigationReducer(storedState, launchAction));\n          return;\n        }\n        this.setState(storedState);\n      });\n    });\n\n    Linking.addEventListener('url', (url) => {\n      this._handleAction(URIActionMap(url));\n    });\n  }\n\n  _handleBack = () => {\n    this._handleAction(RNTesterActions.Back());\n  }\n\n  _handleAction = (action: ?RNTesterAction) => {\n    if (!action) {\n      return;\n    }\n    const newState = RNTesterNavigationReducer(this.state, action);\n    if (this.state !== newState) {\n      this.setState(\n        newState,\n        () => AsyncStorage.setItem(APP_STATE_KEY, JSON.stringify(this.state))\n      );\n    }\n  }\n\n  render() {\n    if (!this.state) {\n      return null;\n    }\n    if (this.state.openExample) {\n      const Component = RNTesterList.Modules[this.state.openExample];\n      if (Component.external) {\n        return (\n          <Component\n            onExampleExit={this._handleBack}\n          />\n        );\n      } else {\n        return (\n          <View style={styles.exampleContainer}>\n            <Header onBack={this._handleBack} title={Component.title} />\n            <RNTesterExampleContainer module={Component} />\n          </View>\n        );\n      }\n\n    }\n    return (\n      <View style={styles.exampleContainer}>\n        <Header title=\"RNTester\" />\n        {/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n          * comment suppresses an error when upgrading Flow's support for\n          * React. To see the error delete this comment and run Flow. */}\n        <RNTesterExampleList\n          onNavigate={this._handleAction}\n          list={RNTesterList}\n        />\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  headerContainer: {\n    borderBottomWidth: StyleSheet.hairlineWidth,\n    borderBottomColor: '#96969A',\n    backgroundColor: '#F5F5F6',\n  },\n  header: { \n    height: 40, \n    flexDirection: 'row' \n  },\n  headerLeft: {\n  },\n  headerCenter: {\n    flex: 1,\n    position: 'absolute',\n    top: 7,\n    left: 0,\n    right: 0,\n  },\n  title: {\n    fontSize: 19,\n    fontWeight: '600',\n    textAlign: 'center',\n  },\n  exampleContainer: {\n    flex: 1,\n  },\n});\n\nAppRegistry.registerComponent('SetPropertiesExampleApp', () => require('./SetPropertiesExampleApp'));\nAppRegistry.registerComponent('RootViewSizeFlexibilityExampleApp', () => require('./RootViewSizeFlexibilityExampleApp'));\nAppRegistry.registerComponent('RNTesterApp', () => RNTesterApp);\n\n// Register suitable examples for snapshot tests\nRNTesterList.ComponentExamples.concat(RNTesterList.APIExamples).forEach((Example: RNTesterExample) => {\n  const ExampleModule = Example.module;\n  if (ExampleModule.displayName) {\n    class Snapshotter extends React.Component<{}> {\n      render() {\n        return (\n          <SnapshotViewIOS>\n            <RNTesterExampleContainer module={ExampleModule} />\n          </SnapshotViewIOS>\n        );\n      }\n    }\n\n    AppRegistry.registerComponent(ExampleModule.displayName, () => Snapshotter);\n  }\n});\n\nmodule.exports = RNTesterApp;\n"
  },
  {
    "path": "RNTester/js/RNTesterApp.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RNTesterApp\n * @flow\n */\n'use strict';\n\nconst AsyncStorage = require('AsyncStorage');\nconst Linking = require('Linking');\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst RNTesterActions = require('./RNTesterActions');\nconst RNTesterExampleContainer = require('./RNTesterExampleContainer');\nconst RNTesterExampleList = require('./RNTesterExampleList');\nconst RNTesterList = require('./RNTesterList.macos');\nconst RNTesterNavigationReducer = require('./RNTesterNavigationReducer');\nconst URIActionMap = require('./URIActionMap');\n\nimport { AppearanceConsumer } from './AppearanceContext';\n\n\nconst {\n  AppRegistry,\n  SnapshotViewIOS,\n  StyleSheet,\n  View,\n  Text,\n  Appearance,\n} = ReactNative;\n\nimport type { RNTesterExample } from './RNTesterList.ios';\nimport type { RNTesterAction } from './RNTesterActions';\nimport type { RNTesterNavigationState } from './RNTesterNavigationReducer';\n\ntype Props = {\n  exampleFromAppetizeParams: string,\n};\n\nconst APP_STATE_KEY = 'RNTesterAppState.v2';\n\nclass RNTesterApp extends React.Component<Props, RNTesterNavigationState> {\n  state = {}\n  componentDidMount() {\n    Linking.getInitialURL().then((url) => {\n      AsyncStorage.getItem(APP_STATE_KEY, (err, storedString) => {\n        const exampleAction = URIActionMap(this.props.exampleFromAppetizeParams);\n        const urlAction = URIActionMap(url);\n        const launchAction = exampleAction || urlAction;\n        if (err || !storedString) {\n          const initialAction = launchAction || {type: 'InitialAction'};\n          this.setState(RNTesterNavigationReducer(undefined, initialAction));\n          return;\n        }\n        const storedState = JSON.parse(storedString);\n        if (launchAction) {\n          this.setState(RNTesterNavigationReducer(storedState, launchAction));\n          return;\n        }\n        this.setState(storedState);\n      });\n    });\n\n    Linking.addEventListener('url', (url) => {\n      this._handleAction(URIActionMap(url));\n    });\n  }\n\n  _handleBack = () => {\n    this._handleAction(RNTesterActions.Back());\n  }\n\n  _handleAction = (action: ?RNTesterAction) => {\n    if (!action) {\n      return;\n    }\n    const newState = RNTesterNavigationReducer(this.state, action);\n    if (this.state !== newState) {\n      this.setState(\n        newState,\n        () => AsyncStorage.setItem(APP_STATE_KEY, JSON.stringify(this.state))\n      );\n    }\n  }\n\n  renderInnerComponent() {\n    if (this.state.openExample) {\n      const Component = RNTesterList.Modules[this.state.openExample];\n      if (Component.external) {\n        return (\n          <Component\n            onExampleExit={this._handleBack}\n          />\n        );\n      } else {\n        return (\n            <RNTesterExampleContainer module={Component} />\n        );\n      }\n    }\n    return <Welcome />;\n  }\n\n  render() {\n    return (\n      <View\n        style={styles.container}>\n        <View style={[styles.leftPanel, { width: '30%' }]}>\n          <RNTesterExampleList\n            onNavigate={this._handleAction}\n            list={RNTesterList}\n            openExample={this.state.openExample}\n          />\n        </View>\n        <View\n          style={[styles.rightPanel]}\n          >\n          {this.renderInnerComponent()}\n        </View>\n      </View>\n\n    );\n  }\n}\n\n\nclass Welcome extends React.Component<{}> {\n  render() {\n    return (\n      <AppearanceConsumer>\n        {appearance => ( \n          <View style={[styles.welcomeWrapper, { backgroundColor: appearance.colors.windowBackgroundColor }]}>\n            <Text style={styles.welcomeText}>\n              Choose an example on the left side\n            </Text>\n          </View>\n        )}\n      </AppearanceConsumer>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    flexDirection: 'row',\n  },\n  leftPanel: {\n    width: 300,\n  },\n  rightPanel: {\n    flex: 1,\n    width: '100%',\n  },\n  welcomeWrapper: {\n    flex: 1,\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  welcomeText: {\n    color: '#999',\n    fontSize: 18,\n  },\n});\n\nAppRegistry.registerComponent('SetPropertiesExampleApp', () => require('./SetPropertiesExampleApp'));\nAppRegistry.registerComponent('RootViewSizeFlexibilityExampleApp', () => require('./RootViewSizeFlexibilityExampleApp'));\nAppRegistry.registerComponent('RNTesterApp', () => RNTesterApp);\n\n// Register suitable examples for snapshot tests\nRNTesterList.ComponentExamples.concat(RNTesterList.APIExamples).forEach((Example: RNTesterExample) => {\n  const ExampleModule = Example.module;\n  if (ExampleModule.displayName) {\n    class Snapshotter extends React.Component<{}> {\n      render() {\n        return (\n          <SnapshotViewIOS>\n            <RNTesterExampleContainer module={ExampleModule} />\n          </SnapshotViewIOS>\n        );\n      }\n    }\n\n    AppRegistry.registerComponent(ExampleModule.displayName, () => Snapshotter);\n  }\n});\n\nmodule.exports = RNTesterApp;\n"
  },
  {
    "path": "RNTester/js/RNTesterBlock.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RNTesterBlock\n * @flow\n */\n'use strict';\n\nvar React = require('react');\nvar PropTypes = require('prop-types');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nimport { AppearanceConsumer } from './AppearanceContext'\n\n\nclass RNTesterBlock extends React.Component<{\n  title?: string,\n  description?: string,\n}, $FlowFixMeState> {\n  static propTypes = {\n    title: PropTypes.string,\n    description: PropTypes.string,\n  };\n\n  state = {description: (null: ?string)};\n\n  backgroundColor(appearance: any) {\n    return appearance.currentAppearance.indexOf(\"Dark\") > -1 ? \"#292A2F\" : \"white\"\n  }\n\n  borderColor(appearance: any, utils) {\n    const isDark = appearance.currentAppearance.indexOf(\"Dark\") > -1;\n    return isDark ? utils.tint(0.86, this.backgroundColor(appearance)) : utils.shade(0.85, this.backgroundColor(appearance))\n  }\n\n  render() {\n    var description;\n    if (this.props.description) {\n      description =\n        <Text style={styles.descriptionText}>\n          {this.props.description}\n        </Text>;\n    }\n\n    return (\n      <AppearanceConsumer resolveColors={(a, utils) => ({ borderColor: this.borderColor(a, utils) })}>\n        {(appearance, { borderColor }) => (\n          <View style={[styles.container, { borderColor, backgroundColor: this.backgroundColor(appearance)}]}>\n            <View style={[styles.titleContainer, {backgroundColor: appearance.colors.textBackgroundColor, borderBottomColor: borderColor }]}>\n              <Text style={[styles.titleText, { color: appearance.colors.textColor } ]}>\n                {this.props.title}\n              </Text>\n              {description}\n            </View>\n            <View style={styles.children}>\n              {\n                // $FlowFixMe found when converting React.createClass to ES6\n                this.props.children}\n            </View>\n          </View>\n        )}\n      </AppearanceConsumer>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    borderRadius: 3,\n    borderWidth: 0.5,\n    margin: 10,\n    marginVertical: 5,\n    overflow: 'hidden',\n  },\n  titleContainer: {\n    borderBottomWidth: 0.5,\n    borderTopLeftRadius: 3,\n    borderTopRightRadius: 2.5,\n    \n    paddingHorizontal: 10,\n    paddingVertical: 5,\n  },\n  titleText: {\n    fontSize: 14,\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\nmodule.exports = RNTesterBlock;\n"
  },
  {
    "path": "RNTester/js/RNTesterButton.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule RNTesterButton\n */\n'use strict';\n\nvar React = require('react');\nvar PropTypes = require('prop-types');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n} = ReactNative;\n\nclass RNTesterButton extends React.Component<{onPress?: Function}> {\n  static propTypes = {\n    onPress: PropTypes.func,\n  };\n\n  render() {\n    return (\n      <TouchableHighlight\n        onPress={this.props.onPress}\n        style={styles.button}\n        underlayColor=\"grey\">\n        <Text>\n          {\n            // $FlowFixMe found when converting React.createClass to ES6\n            this.props.children}\n        </Text>\n      </TouchableHighlight>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  button: {\n    borderColor: '#696969',\n    borderRadius: 8,\n    borderWidth: 1,\n    padding: 10,\n    margin: 5,\n    alignItems: 'center',\n    justifyContent: 'center',\n    backgroundColor: '#d3d3d3',\n  },\n});\n\nmodule.exports = RNTesterButton;\n"
  },
  {
    "path": "RNTester/js/RNTesterExampleContainer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RNTesterExampleContainer\n */\n'use strict';\n\nconst React = require('react');\nconst {\n  Platform,\n} = require('react-native');\nconst RNTesterBlock = require('./RNTesterBlock');\nconst RNTesterPage = require('./RNTesterPage');\n\nclass RNTesterExampleContainer extends React.Component {\n  renderExample(example, i) {\n    // Filter platform-specific examples\n    var {title, description, platform} = example;\n    if (platform) {\n      if (Platform.OS !== platform) {\n        return null;\n      }\n      title += ' (' + platform + ' only)';\n    }\n    return (\n      <RNTesterBlock\n        key={i}\n        title={title}\n        description={description}>\n        {example.render()}\n      </RNTesterBlock>\n    );\n  }\n\n  render(): React.Element<any> {\n    if (!this.props.module.examples) {\n      return <this.props.module />;\n    }\n\n    return (\n      <RNTesterPage title={this.props.title}>\n        {this.props.module.examples.map(this.renderExample)}\n      </RNTesterPage>\n    );\n  }\n}\n\nmodule.exports = RNTesterExampleContainer;\n"
  },
  {
    "path": "RNTester/js/RNTesterExampleList.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule RNTesterExampleList\n */\n'use strict';\n\nconst Platform = require('Platform');\nconst React = require('react');\nconst SectionList = require('SectionList');\nconst StyleSheet = require('StyleSheet');\nconst Text = require('Text');\nconst TextInput = require('TextInput');\nconst TouchableOpacity = require('TouchableOpacity');\nconst RNTesterActions = require('./RNTesterActions');\nconst RNTesterStatePersister = require('./RNTesterStatePersister');\nconst View = require('View');\nconst RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\nconst { AppearanceConsumer } = require('./AppearanceContext')\n\n\nimport type {\n  RNTesterExample,\n} from './RNTesterList.macos';\nimport type {\n  PassProps,\n} from './RNTesterStatePersister';\nimport type {\n  StyleObj,\n} from 'StyleSheetTypes';\n\ntype Props = {\n  onNavigate: Function,\n  list: {\n    ComponentExamples: Array<RNTesterExample>,\n    APIExamples: Array<RNTesterExample>,\n  },\n  persister: PassProps<*>,\n  searchTextInputStyle: StyleObj,\n  style?: ?StyleObj,\n  exampleKey?: string,\n};\n\nclass RowComponent extends React.PureComponent<{\n  item: Object,\n  onNavigate: Function,\n  onPress?: Function,\n  onShowUnderlay?: Function,\n  onHideUnderlay?: Function,\n}> {\n  _onPress = () => {\n    if (this.props.onPress) {\n      this.props.onPress();\n      return;\n    }\n    this.props.onNavigate(RNTesterActions.ExampleAction(this.props.item.key));\n  };\n  render() {\n    const {item} = this.props;\n\n    return (\n      <AppearanceConsumer>\n        {appearance => (\n          <TouchableOpacity {...this.props} onPress={this._onPress}>\n            <View style={[styles.row, this.props.selected ? styles.selectedRow : {}]}>\n              <Text style={[styles.rowTitleText, { color: appearance.colors.textColor}]}>\n                {item.module.title}\n              </Text>\n              <Text style={[styles.rowDetailText, { color: appearance.colors.secondaryLabelColor}]}>\n                {item.module.description}\n              </Text>\n            </View>\n          </TouchableOpacity>\n        )}\n      </AppearanceConsumer>\n    );\n  }\n}\n\nconst renderSectionHeader = ({section}) =>\n  <AppearanceConsumer>\n    {appearance => (\n      <View style={{ backgroundColor: \"transparent\" }} >\n      <Text style={[styles.sectionHeader, \n      { color: appearance.colors.secondaryLabelColor }]}>\n        {section.title}\n      </Text>\n      </View>)\n    }\n  </AppearanceConsumer>;\n\n\nclass RNTesterExampleList extends React.Component<Props, $FlowFixMeState> {\n\n  componentDidMount() {\n    RCTDeviceEventEmitter.addListener(\n      'onSearchExample',\n      ({ query }) => this.props.persister.setState(() => ({filter: query}))\n    );\n  }\n  render() {\n    const filterText = this.props.persister.state.filter;\n    const filterRegex = new RegExp(String(filterText), 'i');\n    const filter = (example) =>\n      this.props.disableSearch ||\n        filterRegex.test(example.module.title) &&\n        (!Platform.isTVOS || example.supportsTVOS);\n\n\n    const sections = [\n      {\n        data: this.props.list.ComponentExamples.filter(filter),\n        title: 'Components',\n        key: 'c',\n      },\n      {\n        data: this.props.list.APIExamples.filter(filter),\n        title: 'APIs',\n        key: 'a',\n      },\n    ];\n\n    return (\n      <View style={[styles.listContainer, this.props.style]}>\n        {this._renderTitleRow()}\n        {/* {this._renderTextInput()} */}\n        <SectionList\n          style={styles.list}\n          sections={sections}\n          renderItem={this._renderItem}\n          enableEmptySections={true}\n          extraData={Math.random()}\n          keyboardShouldPersistTaps=\"handled\"\n          automaticallyAdjustContentInsets={false}\n          keyboardDismissMode=\"on-drag\"\n          legacyImplementation={false}\n          scrollsToTop={false}\n          renderSectionHeader={renderSectionHeader}\n        />\n      </View>\n    );\n  }\n\n  _renderItem = ({item, separators}) => (\n    <RowComponent\n      item={item}\n      selected={item.key === this.props.openExample}\n      onNavigate={this.props.onNavigate}\n      onShowUnderlay={separators.highlight}\n      onHideUnderlay={separators.unhighlight}\n    />\n  );\n\n  _renderTitleRow(): ?React.Element<any> {\n    if (!this.props.displayTitleRow) {\n      return null;\n    }\n    return (\n      <RowComponent\n        item={{module: {\n          title: 'RNTester',\n          description: 'React Native Examples',\n        }}}\n        onNavigate={this.props.onNavigate}\n        onPress={() => {\n          this.props.onNavigate(RNTesterActions.ExampleList());\n        }}\n      />\n    );\n  }\n\n  _renderTextInput(): ?React.Element<any> {\n    if (this.props.disableSearch) {\n      return null;\n    }\n    return (\n      <View style={styles.searchRow}>\n        <TextInput\n          autoCapitalize=\"none\"\n          autoCorrect={false}\n          clearButtonMode=\"always\"\n          onChangeText={text => {\n            this.props.persister.setState(() => ({filter: text}));\n          }}\n          placeholder=\"Search...\"\n          underlineColorAndroid=\"transparent\"\n          style={[styles.searchTextInput, this.props.searchTextInputStyle]}\n          testID=\"explorer_search\"\n          value={this.props.persister.state.filter}\n        />\n      </View>\n    );\n  }\n\n  _handleRowPress(exampleKey: string): void {\n    this.setState({ exampleKey });\n    this.props.onNavigate(RNTesterActions.ExampleAction(exampleKey));\n  }\n}\n\nconst ItemSeparator = ({highlighted}) => (\n  <View style={highlighted ? styles.separatorHighlighted : styles.separator} />\n);\n\nRNTesterExampleList = RNTesterStatePersister.createContainer(RNTesterExampleList, {\n  cacheKeySuffix: () => 'mainList',\n  getInitialState: () => ({filter: ''}),\n});\n\nconst styles = StyleSheet.create({\n  listContainer: {\n    flex: 1,\n  },\n  list: {\n  },\n  sectionHeader: {\n    marginLeft: 4,\n    padding: 5,\n    fontWeight: '500',\n    fontSize: 11,\n  },\n  row: {\n    justifyContent: 'center',\n    paddingHorizontal: 15,\n    paddingVertical: 8,\n  },\n  separator: {\n    height: StyleSheet.hairlineWidth,\n    backgroundColor: '#bbbbbb',\n    marginLeft: 15,\n  },\n  separatorHighlighted: {\n    height: StyleSheet.hairlineWidth,\n    backgroundColor: 'rgb(217, 217, 217)',\n  },\n  rowTitleText: {\n    fontSize: 13,\n    fontWeight: '500',\n  },\n  rowDetailText: {\n    fontSize: 11,\n    color:  '#AAA', // : '#888888',\n    lineHeight: 15,\n  },\n  searchRow: {\n    backgroundColor: '#eeeeee',\n    padding: 10,\n  },\n  searchTextInput: {\n    backgroundColor: 'white',\n    borderColor: '#cccccc',\n    borderRadius: 3,\n    borderWidth: 1,\n    paddingLeft: 8,\n    paddingVertical: 0,\n    height: 35,\n  },\n  selectedRow: {\n    backgroundColor: \"rgba(0, 0, 0, 0.2)\",\n  },\n});\n\nmodule.exports = RNTesterExampleList;\n"
  },
  {
    "path": "RNTester/js/RNTesterList.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule RNTesterList\n */\n'use strict';\n\nexport type RNTesterExample = {\n  key: string,\n  module: Object,\n};\n\nconst ComponentExamples: Array<RNTesterExample> = [\n  {\n    key: 'ActivityIndicatorExample',\n    module: require('./ActivityIndicatorExample'),\n  },\n  {\n    key: 'ButtonExample',\n    module: require('./ButtonExample'),\n  },\n  {\n    key: 'CheckBoxExample',\n    module: require('./CheckBoxExample'),\n  },\n  {\n    key: 'FlatListExample',\n    module: require('./FlatListExample'),\n  },\n  {\n    key: 'ImageExample',\n    module: require('./ImageExample'),\n  },\n  {\n    key: 'ListViewExample',\n    module: require('./ListViewExample'),\n  },\n  {\n    key: 'ListViewGridLayoutExample',\n    module: require('./ListViewGridLayoutExample'),\n  },\n  {\n    key: 'ListViewPagingExample',\n    module: require('./ListViewPagingExample'),\n  },\n  {\n    key: 'ModalExample',\n    module: require('./ModalExample'),\n  },\n  {\n    key: 'MultiColumnExample',\n    module: require('./MultiColumnExample'),\n  },\n  {\n    key: 'PickerExample',\n    module: require('./PickerExample'),\n  },\n  {\n    key: 'ProgressBarAndroidExample',\n    module: require('./ProgressBarAndroidExample'),\n  },\n  {\n    key: 'RefreshControlExample',\n    module: require('./RefreshControlExample'),\n  },\n  {\n    key: 'ScrollViewSimpleExample',\n    module: require('./ScrollViewSimpleExample'),\n  },\n  {\n    key: 'SectionListExample',\n    module: require('./SectionListExample'),\n  },\n  {\n    key: 'SliderExample',\n    module: require('./SliderExample'),\n  },\n  {\n    key: 'StatusBarExample',\n    module: require('./StatusBarExample'),\n  },\n  {\n    key: 'SwipeableFlatListExample',\n    module: require('./SwipeableFlatListExample')\n  },\n  {\n    key: 'SwipeableListViewExample',\n    module: require('./SwipeableListViewExample')\n  },\n  {\n    key: 'SwitchExample',\n    module: require('./SwitchExample'),\n  },\n  {\n    key: 'TextExample',\n    module: require('./TextExample'),\n  },\n  {\n    key: 'TextInputExample',\n    module: require('./TextInputExample'),\n  },\n  {\n    key: 'ToolbarAndroidExample',\n    module: require('./ToolbarAndroidExample'),\n  },\n  {\n    key: 'TouchableExample',\n    module: require('./TouchableExample'),\n  },\n  {\n    key: 'ViewExample',\n    module: require('./ViewExample'),\n  },\n  {\n    key: 'ViewPagerAndroidExample',\n    module: require('./ViewPagerAndroidExample'),\n  },\n  {\n    key: 'WebViewExample',\n    module: require('./WebViewExample'),\n  },\n];\n\nconst APIExamples: Array<RNTesterExample> = [\n  {\n    key: 'AccessibilityAndroidExample',\n    module: require('./AccessibilityAndroidExample'),\n  },\n  {\n    key: 'AlertExample',\n    module: require('./AlertExample').AlertExample,\n  },\n  {\n    key: 'AnimatedExample',\n    module: require('./AnimatedExample'),\n  },\n  {\n    key: 'AppStateExample',\n    module: require('./AppStateExample'),\n  },\n  {\n    key: 'BorderExample',\n    module: require('./BorderExample'),\n  },\n  {\n    key: 'CameraRollExample',\n    module: require('./CameraRollExample'),\n  },\n  {\n    key: 'ClipboardExample',\n    module: require('./ClipboardExample'),\n  },\n  {\n    key: 'DatePickerAndroidExample',\n    module: require('./DatePickerAndroidExample'),\n  },\n  {\n    key: 'Dimensions',\n    module: require('./DimensionsExample'),\n  },\n  {\n    key: 'GeolocationExample',\n    module: require('./GeolocationExample'),\n  },\n  {\n    key: 'ImageEditingExample',\n    module: require('./ImageEditingExample'),\n  },\n  {\n    key: 'LayoutEventsExample',\n    module: require('./LayoutEventsExample'),\n  },\n  {\n    key: 'LinkingExample',\n    module: require('./LinkingExample'),\n  },\n  {\n    key: 'LayoutAnimationExample',\n    module: require('./LayoutAnimationExample'),\n  },\n  {\n    key: 'LayoutExample',\n    module: require('./LayoutExample'),\n  },\n  {\n    key: 'NativeAnimationsExample',\n    module: require('./NativeAnimationsExample'),\n  },\n  {\n    key: 'NetInfoExample',\n    module: require('./NetInfoExample'),\n  },\n  {\n    key: 'OrientationChangeExample',\n    module: require('./OrientationChangeExample'),\n  },\n  {\n    key: 'PanResponderExample',\n    module: require('./PanResponderExample'),\n  },\n  {\n    key: 'PermissionsExampleAndroid',\n    module: require('./PermissionsExampleAndroid'),\n  },\n  {\n    key: 'PointerEventsExample',\n    module: require('./PointerEventsExample'),\n  },\n  {\n    key: 'RTLExample',\n    module: require('./RTLExample'),\n  },\n  {\n    key: 'ShareExample',\n    module: require('./ShareExample'),\n  },\n  {\n    key: 'TimePickerAndroidExample',\n    module: require('./TimePickerAndroidExample'),\n  },\n  {\n    key: 'TimerExample',\n    module: require('./TimerExample'),\n  },\n  {\n    key: 'ToastAndroidExample',\n    module: require('./ToastAndroidExample'),\n  },\n  {\n    key: 'TransformExample',\n    module: require('./TransformExample'),\n  },\n  {\n    key: 'VibrationExample',\n    module: require('./VibrationExample'),\n  },\n  {\n    key: 'WebSocketExample',\n    module: require('./WebSocketExample'),\n  },\n  {\n    key: 'XHRExample',\n    module: require('./XHRExample'),\n  },\n];\n\nconst Modules = {};\n\nAPIExamples.concat(ComponentExamples).forEach(Example => {\n  Modules[Example.key] = Example.module;\n});\n\nconst RNTesterList = {\n  APIExamples,\n  ComponentExamples,\n  Modules,\n};\n\nmodule.exports = RNTesterList;\n"
  },
  {
    "path": "RNTester/js/RNTesterList.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule RNTesterList\n */\n'use strict';\n\nexport type RNTesterExample = {\n  key: string,\n  module: Object,\n  supportsTVOS: boolean\n};\n\nconst ComponentExamples: Array<RNTesterExample> = [\n  {\n    key: 'ActivityIndicatorExample',\n    module: require('./ActivityIndicatorExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'ARTExample',\n    module: require('./ARTExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'ButtonExample',\n    module: require('./ButtonExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'DatePickerIOSExample',\n    module: require('./DatePickerIOSExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'FlatListExample',\n    module: require('./FlatListExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'ImageExample',\n    module: require('./ImageExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'KeyboardAvoidingViewExample',\n    module: require('./KeyboardAvoidingViewExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'LayoutEventsExample',\n    module: require('./LayoutEventsExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'ListViewExample',\n    module: require('./ListViewExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'ListViewGridLayoutExample',\n    module: require('./ListViewGridLayoutExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'ListViewPagingExample',\n    module: require('./ListViewPagingExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'MaskedViewExample',\n    module: require('./MaskedViewExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'ModalExample',\n    module: require('./ModalExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'MultiColumnExample',\n    module: require('./MultiColumnExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'NavigatorIOSColorsExample',\n    module: require('./NavigatorIOSColorsExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'NavigatorIOSBarStyleExample',\n    module: require('./NavigatorIOSBarStyleExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'NavigatorIOSExample',\n    module: require('./NavigatorIOSExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'PickerExample',\n    module: require('./PickerExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'PickerIOSExample',\n    module: require('./PickerIOSExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'ProgressViewIOSExample',\n    module: require('./ProgressViewIOSExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'RefreshControlExample',\n    module: require('./RefreshControlExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'SafeAreaViewExample',\n    module: require('./SafeAreaViewExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'ScrollViewExample',\n    module: require('./ScrollViewExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'SectionListExample',\n    module: require('./SectionListExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'SegmentedControlIOSExample',\n    module: require('./SegmentedControlIOSExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'SliderExample',\n    module: require('./SliderExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'StatusBarExample',\n    module: require('./StatusBarExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'SwipeableFlatListExample',\n    module: require('./SwipeableFlatListExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'SwipeableListViewExample',\n    module: require('./SwipeableListViewExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'SwitchExample',\n    module: require('./SwitchExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'TabBarIOSExample',\n    module: require('./TabBarIOSExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'TabBarIOSBarStyleExample',\n    module: require('./TabBarIOSBarStyleExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'TextExample',\n    module: require('./TextExample.ios'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'TextInputExample',\n    module: require('./TextInputExample.ios'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'TouchableExample',\n    module: require('./TouchableExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'TransparentHitTestExample',\n    module: require('./TransparentHitTestExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'ViewExample',\n    module: require('./ViewExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'WebViewExample',\n    module: require('./WebViewExample'),\n    supportsTVOS: false,\n  },\n];\n\nconst APIExamples: Array<RNTesterExample> = [\n  {\n    key: 'AccessibilityIOSExample',\n    module: require('./AccessibilityIOSExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'ActionSheetIOSExample',\n    module: require('./ActionSheetIOSExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'AlertExample',\n    module: require('./AlertExample').AlertExample,\n    supportsTVOS: true,\n  },\n  {\n    key: 'AlertIOSExample',\n    module: require('./AlertIOSExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'AnimatedExample',\n    module: require('./AnimatedExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'AnExApp',\n    module: require('./AnimatedGratuitousApp/AnExApp'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'AppStateExample',\n    module: require('./AppStateExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'AsyncStorageExample',\n    module: require('./AsyncStorageExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'BorderExample',\n    module: require('./BorderExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'BoxShadowExample',\n    module: require('./BoxShadowExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'CameraRollExample',\n    module: require('./CameraRollExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'ClipboardExample',\n    module: require('./ClipboardExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'Dimensions',\n    module: require('./DimensionsExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'GeolocationExample',\n    module: require('./GeolocationExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'ImageEditingExample',\n    module: require('./ImageEditingExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'LayoutAnimationExample',\n    module: require('./LayoutAnimationExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'LayoutExample',\n    module: require('./LayoutExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'LinkingExample',\n    module: require('./LinkingExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'NativeAnimationsExample',\n    module: require('./NativeAnimationsExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'NetInfoExample',\n    module: require('./NetInfoExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'OrientationChangeExample',\n    module: require('./OrientationChangeExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'PanResponderExample',\n    module: require('./PanResponderExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'PointerEventsExample',\n    module: require('./PointerEventsExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'PushNotificationIOSExample',\n    module: require('./PushNotificationIOSExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'RCTRootViewIOSExample',\n    module: require('./RCTRootViewIOSExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'RTLExample',\n    module: require('./RTLExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'ShareExample',\n    module: require('./ShareExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'SnapshotExample',\n    module: require('./SnapshotExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'TimerExample',\n    module: require('./TimerExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'TransformExample',\n    module: require('./TransformExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'TVEventHandlerExample',\n    module: require('./TVEventHandlerExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'VibrationExample',\n    module: require('./VibrationExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'WebSocketExample',\n    module: require('./WebSocketExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'XHRExample',\n    module: require('./XHRExample'),\n    supportsTVOS: true,\n  },\n];\n\nconst Modules = {};\n\nAPIExamples.concat(ComponentExamples).forEach(Example => {\n  Modules[Example.key] = Example.module;\n});\n\nconst RNTesterList = {\n  APIExamples,\n  ComponentExamples,\n  Modules,\n};\n\nmodule.exports = RNTesterList;\n"
  },
  {
    "path": "RNTester/js/RNTesterList.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule RNTesterList\n */\n'use strict';\n\nexport type RNTesterExample = {\n  key: string,\n  module: Object,\n  supportsTVOS: boolean\n};\n\nconst ComponentExamples: Array<RNTesterExample> = [\n  {\n    key: 'ActivityIndicatorExample',\n    module: require('./ActivityIndicatorExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'ARTExample',\n  //   module: require('./ARTExample'),\n  //   supportsTVOS: true,\n  // },\n  {\n    key: 'ButtonExample',\n    module: require('./ButtonExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'DatePickerIOSExample',\n  //   module: require('./DatePickerIOSExample'),\n  //   supportsTVOS: false,\n  // },\n  {\n    key: 'FlatListExample',\n    module: require('./FlatListExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'ImageExample',\n    module: require('./ImageExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'KeyboardAvoidingViewExample',\n  //   module: require('./KeyboardAvoidingViewExample'),\n  //   supportsTVOS: false,\n  // },\n  {\n    key: 'LayoutEventsExample',\n    module: require('./LayoutEventsExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'ListViewExample',\n  //   module: require('./ListViewExample'),\n  //   supportsTVOS: true,\n  // },\n  // {\n  //   key: 'ListViewGridLayoutExample',\n  //   module: require('./ListViewGridLayoutExample'),\n  //   supportsTVOS: true,\n  // },\n  // {\n  //   key: 'ListViewPagingExample',\n  //   module: require('./ListViewPagingExample'),\n  //   supportsTVOS: true,\n  // },\n  // {\n  //   key: 'MaskedViewExample',\n  //   module: require('./MaskedViewExample'),\n  //   supportsTVOS: true,\n  // },\n  {\n    key: 'ModalExample',\n    module: require('./ModalExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'MultiColumnExample',\n    module: require('./MultiColumnExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'NavigatorIOSColorsExample',\n  //   module: require('./NavigatorIOSColorsExample'),\n  //   supportsTVOS: false,\n  // },\n  // {\n  //   key: 'NavigatorIOSBarStyleExample',\n  //   module: require('./NavigatorIOSBarStyleExample'),\n  //   supportsTVOS: false,\n  // },\n  // {\n  //   key: 'NavigatorIOSExample',\n  //   module: require('./NavigatorIOSExample'),\n  //   supportsTVOS: true,\n  // },\n  // {\n  //   key: 'PickerExample',\n  //   module: require('./PickerExample'),\n  //   supportsTVOS: false,\n  // },\n  // {\n  //   key: 'PickerIOSExample',\n  //   module: require('./PickerIOSExample'),\n  //   supportsTVOS: false,\n  // },\n  // {\n  //   key: 'ProgressViewIOSExample',\n  //   module: require('./ProgressViewIOSExample'),\n  //   supportsTVOS: true,\n  // },\n  // {\n  //   key: 'RefreshControlExample',\n  //   module: require('./RefreshControlExample'),\n  //   supportsTVOS: false,\n  // },\n  // {\n  //   key: 'SafeAreaViewExample',\n  //   module: require('./SafeAreaViewExample'),\n  //   supportsTVOS: true,\n  // },\n  // {\n  //   key: 'ScrollViewExample',\n  //   module: require('./ScrollViewExample'),\n  //   supportsTVOS: true,\n  // },\n  {\n    key: 'SectionListExample',\n    module: require('./SectionListExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'SegmentedControlIOSExample',\n  //   module: require('./SegmentedControlIOSExample'),\n  //   supportsTVOS: false,\n  // },\n  {\n    key: 'SliderExample',\n    module: require('./SliderExample'),\n    supportsTVOS: false,\n  },\n  // {\n  //   key: 'StatusBarExample',\n  //   module: require('./StatusBarExample'),\n  //   supportsTVOS: false,\n  // },\n  {\n    key: 'SwipeableFlatListExample',\n    module: require('./SwipeableFlatListExample'),\n    supportsTVOS: false,\n  },\n  // {\n  //   key: 'SwipeableListViewExample',\n  //   module: require('./SwipeableListViewExample'),\n  //   supportsTVOS: false,\n  // },\n  // {\n  //   key: 'SwitchExample',\n  //   module: require('./SwitchExample'),\n  //   supportsTVOS: false,\n  // },\n  // {\n  //   key: 'TabBarIOSExample',\n  //   module: require('./TabBarIOSExample'),\n  //   supportsTVOS: true,\n  // },\n  // {\n  //   key: 'TabBarIOSBarStyleExample',\n  //   module: require('./TabBarIOSBarStyleExample'),\n  //   supportsTVOS: false,\n  // },\n  {\n    key: 'TextExample',\n    module: require('./TextExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'TextInputExample',\n    module: require('./TextInputExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'TouchableExample',\n    module: require('./TouchableExample'),\n    supportsTVOS: false,\n  },\n  // {\n  //   key: 'TransparentHitTestExample',\n  //   module: require('./TransparentHitTestExample'),\n  //   supportsTVOS: false,\n  // },\n  {\n    key: 'ViewExample',\n    module: require('./ViewExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'WebViewExample',\n    module: require('./WebViewExample'),\n    supportsTVOS: false,\n  },\n];\n\nconst APIExamples: Array<RNTesterExample> = [\n  {\n    key: 'ApperanceExample',\n    module: require('./AppearanceExample.macos'),\n    supportsTVOS: false,\n  },\n  // {\n  //   key: 'AccessibilityIOSExample',\n  //   module: require('./AccessibilityIOSExample'),\n  //   supportsTVOS: false,\n  // },\n  // {\n  //   key: 'ActionSheetIOSExample',\n  //   module: require('./ActionSheetIOSExample'),\n  //   supportsTVOS: true,\n  // },\n  {\n    key: 'AlertExample',\n    module: require('./AlertExample').AlertExample,\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'AlertIOSExample',\n  //   module: require('./AlertIOSExample'),\n  //   supportsTVOS: true,\n  // },\n  {\n    key: 'AnimatedExample',\n    module: require('./AnimatedExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'AnExApp',\n    module: require('./AnimatedGratuitousApp/AnExApp'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'AppStateExample',\n    module: require('./AppStateExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'AsyncStorageExample',\n    module: require('./AsyncStorageExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'BorderExample',\n    module: require('./BorderExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'BoxShadowExample',\n    module: require('./BoxShadowExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'CameraRollExample',\n  //   module: require('./CameraRollExample'),\n  //   supportsTVOS: false,\n  // },\n  {\n    key: 'ClipboardExample',\n    module: require('./ClipboardExample'),\n    supportsTVOS: false,\n  },\n  {\n    key: 'Dimensions',\n    module: require('./DimensionsExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'GeolocationExample',\n  //   module: require('./GeolocationExample'),\n  //   supportsTVOS: false,\n  // },\n  // {\n  //   key: 'ImageEditingExample',\n  //   module: require('./ImageEditingExample'),\n  //   supportsTVOS: false,\n  // },\n  {\n    key: 'LayoutAnimationExample',\n    module: require('./LayoutAnimationExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'LayoutExample',\n    module: require('./LayoutExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'LinkingExample',\n  //   module: require('./LinkingExample'),\n  //   supportsTVOS: true,\n  // },\n  {\n    key: 'NativeAnimationsExample',\n    module: require('./NativeAnimationsExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'NetInfoExample',\n  //   module: require('./NetInfoExample'),\n  //   supportsTVOS: true,\n  // },\n  // {\n  //   key: 'OrientationChangeExample',\n  //   module: require('./OrientationChangeExample'),\n  //   supportsTVOS: false,\n  // },\n  {\n    key: 'PanResponderExample',\n    module: require('./PanResponderExample'),\n    supportsTVOS: false,\n  },\n  // {\n  //   key: 'PointerEventsExample',\n  //   module: require('./PointerEventsExample'),\n  //   supportsTVOS: false,\n  // },\n  // {\n  //   key: 'PushNotificationIOSExample',\n  //   module: require('./PushNotificationIOSExample'),\n  //   supportsTVOS: false,\n  // },\n  {\n    key: 'RCTRootViewIOSExample',\n    module: require('./RCTRootViewIOSExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'RTLExample',\n  //   module: require('./RTLExample'),\n  //   supportsTVOS: true,\n  // },\n  // {\n  //   key: 'ShareExample',\n  //   module: require('./ShareExample'),\n  //   supportsTVOS: true,\n  // },\n  // {\n  //   key: 'SnapshotExample',\n  //   module: require('./SnapshotExample'),\n  //   supportsTVOS: true,\n  // },\n  {\n    key: 'TimerExample',\n    module: require('./TimerExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'TransformExample',\n    module: require('./TransformExample'),\n    supportsTVOS: true,\n  },\n  // {\n  //   key: 'TVEventHandlerExample',\n  //   module: require('./TVEventHandlerExample'),\n  //   supportsTVOS: true,\n  // },\n  // {\n  //   key: 'VibrationExample',\n  //   module: require('./VibrationExample'),\n  //   supportsTVOS: false,\n  // },\n  {\n    key: 'WebSocketExample',\n    module: require('./WebSocketExample'),\n    supportsTVOS: true,\n  },\n  {\n    key: 'XHRExample',\n    module: require('./XHRExample'),\n    supportsTVOS: true,\n  },\n];\n\nconst Modules = {};\n\nAPIExamples.concat(ComponentExamples).forEach(Example => {\n  Modules[Example.key] = Example.module;\n});\n\nconst RNTesterList = {\n  APIExamples,\n  ComponentExamples,\n  Modules,\n};\n\nmodule.exports = RNTesterList;\n"
  },
  {
    "path": "RNTester/js/RNTesterNavigationReducer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule RNTesterNavigationReducer\n */\n'use strict';\n\n// $FlowFixMe : This is a platform-forked component, and flow seems to only run on iOS?\nconst RNTesterList = require('./RNTesterList');\n\nexport type RNTesterNavigationState = {\n  openExample: ?string,\n  query: string,\n};\n\nfunction RNTesterNavigationReducer(\n  state: ?RNTesterNavigationState,\n  action: any\n): RNTesterNavigationState {\n\n  if (\n    // Default value is to see example list\n    !state ||\n\n    // Handle the explicit list action\n    action.type === 'RNTesterListAction' ||\n\n    // Handle requests to go back to the list when an example is open\n    (state.openExample && action.type === 'RNTesterBackAction')\n  ) {\n    return {\n      // A null openExample will cause the views to display the RNTester example list\n      openExample: null,\n    };\n  }\n\n  if (action.type === 'RNTesterExampleAction') {\n\n    // Make sure we see the module before returning the new state\n    const ExampleModule = RNTesterList.Modules[action.openExample];\n\n    if (ExampleModule) {\n      return {\n        openExample: action.openExample,\n      };\n    }\n  }\n\n  return state;\n}\n\nmodule.exports = RNTesterNavigationReducer;\n"
  },
  {
    "path": "RNTester/js/RNTesterPage.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RNTesterPage\n * @flow\n */\n'use strict';\n\nvar PropTypes = require('prop-types');\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  ScrollView,\n  StyleSheet,\n  View,\n} = ReactNative;\n\nvar RNTesterTitle = require('./RNTesterTitle');\n\nclass RNTesterPage extends React.Component<{\n  noScroll?: boolean,\n  noSpacer?: boolean,\n}> {\n  static propTypes = {\n    noScroll: PropTypes.bool,\n    noSpacer: PropTypes.bool,\n  };\n\n  render() {\n    var ContentWrapper;\n    var wrapperProps = {};\n    if (this.props.noScroll) {\n      ContentWrapper = ((View: any): React.ComponentType<any>);\n    } else {\n      ContentWrapper = (ScrollView: React.ComponentType<any>);\n      // $FlowFixMe found when converting React.createClass to ES6\n      wrapperProps.automaticallyAdjustContentInsets = !this.props.title;\n      wrapperProps.keyboardShouldPersistTaps = 'handled';\n      wrapperProps.keyboardDismissMode = 'interactive';\n    }\n    var title = this.props.title ?\n      <RNTesterTitle title={this.props.title} /> :\n      null;\n    var spacer = this.props.noSpacer ? null : <View style={styles.spacer} />;\n\n    return (\n      <View style={styles.container}>\n        {title}\n        <ContentWrapper\n          style={styles.wrapper}\n          {...wrapperProps}>\n            {\n              // $FlowFixMe found when converting React.createClass to ES6\n              this.props.children}\n            {spacer}\n        </ContentWrapper>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    backgroundColor: 'transparent',\n    flex: 1,\n  },\n  spacer: {\n    height: 270,\n  },\n  wrapper: {\n    flex: 1,\n    paddingTop: 10,\n  },\n});\n\nmodule.exports = RNTesterPage;\n"
  },
  {
    "path": "RNTester/js/RNTesterSettingSwitchRow.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RNTesterSettingSwitchRow\n * @flow\n */\n'use strict';\n\nconst React = require('React');\nconst StyleSheet = require('StyleSheet');\nconst Switch = require('Switch');\nconst Text = require('Text');\nconst RNTesterStatePersister = require('./RNTesterStatePersister');\nconst View = require('View');\n\nclass RNTesterSettingSwitchRow extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  componentWillReceiveProps(newProps) {\n    const {onEnable, onDisable, persister} = this.props;\n    if (newProps.persister.state !== persister.state) {\n      newProps.persister.state ? onEnable() : onDisable();\n    }\n  }\n  render() {\n    const {label, persister} = this.props;\n    return (\n      <View style={styles.row}>\n        <Text>{label}</Text>\n        <Switch\n          value={persister.state}\n          onValueChange={(value) => {\n            persister.setState(() => value);\n          }}\n        />\n      </View>\n    );\n  }\n}\nconst styles = StyleSheet.create({\n  row: {\n    padding: 10,\n    flexDirection: 'row',\n    justifyContent: 'space-between',\n  },\n});\nRNTesterSettingSwitchRow = RNTesterStatePersister.createContainer(RNTesterSettingSwitchRow, {\n  cacheKeySuffix: ({label}) => 'Switch:' + label,\n  getInitialState: ({initialValue}) => initialValue,\n});\nmodule.exports = RNTesterSettingSwitchRow;\n"
  },
  {
    "path": "RNTester/js/RNTesterStatePersister.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule RNTesterStatePersister\n */\n'use strict';\n\nconst AsyncStorage = require('AsyncStorage');\nconst React = require('React');\n\nexport type PassProps<State> = {\n  state: State,\n  setState: (stateLamda: (state: State) => State) => void,\n};\n\n/**\n * A simple container for persisting some state and passing it into the wrapped component as\n * `props.persister.state`. Update it with `props.persister.setState`. The component is initially\n * rendered using `getInitialState` in the spec and is then re-rendered with the persisted data\n * once it's fetched.\n *\n * This is currently tied to RNTester because it's generally not good to use AsyncStorage like\n * this in real apps with user data, but we could maybe pull it out for other internal settings-type\n * usage.\n */\nfunction createContainer<Props: Object, State>(\n  Component: React.ComponentType<Props & {persister: PassProps<State>}>,\n  spec: {\n    cacheKeySuffix: (props: Props) => string,\n    getInitialState: (props: Props) => State,\n    version?: string,\n  },\n): React.ComponentType<Props> {\n  return class ComponentWithPersistedState extends React.Component<Props, $FlowFixMeState> {\n    /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n     * suppresses an error when upgrading Flow's support for React. To see the\n     * error delete this comment and run Flow. */\n    static displayName = `RNTesterStatePersister(${Component.displayName || Component.name})`;\n    state = {value: spec.getInitialState(this.props)};\n    _cacheKey = `RNTester:${spec.version || 'v1'}:${spec.cacheKeySuffix(this.props)}`;\n    componentDidMount() {\n      AsyncStorage.getItem(this._cacheKey, (err, value) => {\n        if (!err && value) {\n          this.setState({value: JSON.parse(value)});\n        }\n      });\n    }\n    _passSetState = (stateLamda: (state: State) => State): void => {\n      this.setState((state) => {\n        const value = stateLamda(state.value);\n        AsyncStorage.setItem(this._cacheKey, JSON.stringify(value));\n        return {value};\n      });\n    };\n    render(): React.Node {\n      return (\n        <Component\n          {...this.props}\n          persister={{\n            state: this.state.value,\n            setState: this._passSetState,\n          }}\n        />\n      );\n    }\n  };\n}\n\nconst RNTesterStatePersister = {\n  createContainer,\n};\n\nmodule.exports = RNTesterStatePersister;\n"
  },
  {
    "path": "RNTester/js/RNTesterTitle.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RNTesterTitle\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nclass RNTesterTitle extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text style={styles.text}>\n          {this.props.title}\n        </Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    borderRadius: 4,\n    borderWidth: 0.5,\n    borderColor: '#d6d7da',\n    margin: 10,\n    marginBottom: 0,\n    height: 45,\n    padding: 10,\n    backgroundColor: 'white',\n  },\n  text: {\n    fontSize: 19,\n    fontWeight: '500',\n  },\n});\n\nmodule.exports = RNTesterTitle;\n"
  },
  {
    "path": "RNTester/js/RTLExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @format\n * @providesModule RTLExample\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  Alert,\n  Animated,\n  I18nManager,\n  Image,\n  PanResponder,\n  PixelRatio,\n  ScrollView,\n  StyleSheet,\n  Text,\n  TouchableWithoutFeedback,\n  Switch,\n  View,\n  Button,\n} = ReactNative;\nconst Platform = require('Platform');\n\nconst RNTesterPage = require('./RNTesterPage');\nconst RNTesterBlock = require('./RNTesterBlock');\n\ntype State = {\n  toggleStatus: any,\n  pan: Object,\n  linear: Object,\n  isRTL: boolean,\n  windowWidth: number,\n};\n\nconst SCALE = PixelRatio.get();\nconst IMAGE_DIMENSION = 100 * SCALE;\nconst IMAGE_SIZE = [IMAGE_DIMENSION, IMAGE_DIMENSION];\n\nconst IS_RTL = I18nManager.isRTL;\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        <View style={styles.smallButton}>\n          <Text style={styles.fontSizeSmall}>Button</Text>\n        </View>\n      </View>\n    </View>\n  );\n}\n\nfunction TextAlignmentExample(props) {\n  return (\n    <RNTesterBlock title={props.title} description={props.description}>\n      <View>\n        <Text style={props.style}>\n          Left-to-Right language without text alignment.\n        </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    </RNTesterBlock>\n  );\n}\n\nfunction AnimationBlock(props) {\n  return (\n    <View style={styles.block}>\n      <TouchableWithoutFeedback onPress={props.onPress}>\n        <Animated.Image\n          style={[styles.img, props.imgStyle]}\n          source={require('./Thumbnails/poke.png')}\n        />\n      </TouchableWithoutFeedback>\n    </View>\n  );\n}\n\ntype RTLSwitcherComponentState = {|\n  isRTL: boolean,\n|};\n\nfunction withRTLState(Component) {\n  return class extends React.Component<*, RTLSwitcherComponentState> {\n    constructor(...args) {\n      super(...args);\n      this.state = {\n        isRTL: IS_RTL,\n      };\n    }\n\n    render() {\n      const setRTL = isRTL => this.setState({isRTL: isRTL});\n      return <Component isRTL={this.state.isRTL} setRTL={setRTL} />;\n    }\n  };\n}\n\nconst RTLToggler = ({isRTL, setRTL}) => {\n  if (Platform.OS === 'android') {\n    return <Text style={styles.rtlToggler}>{isRTL ? 'RTL' : 'LTR'}</Text>;\n  }\n\n  const toggleRTL = () => setRTL(!isRTL);\n  return (\n    <Button\n      onPress={toggleRTL}\n      title={isRTL ? 'RTL' : 'LTR'}\n      color=\"gray\"\n      accessibilityLabel=\"Change layout direction\"\n    />\n  );\n};\n\nconst PaddingExample = withRTLState(({isRTL, setRTL}) => {\n  const color = 'teal';\n\n  return (\n    <RNTesterBlock 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        style={{\n          backgroundColor: color,\n          paddingStart: 50,\n          paddingEnd: 10,\n          borderWidth: 1,\n          borderColor: color,\n          direction: isRTL ? 'rtl' : 'ltr',\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          <RTLToggler setRTL={setRTL} isRTL={isRTL} />\n        </View>\n      </View>\n    </RNTesterBlock>\n  );\n});\n\nconst MarginExample = withRTLState(({isRTL, setRTL}) => {\n  return (\n    <RNTesterBlock 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        style={{\n          backgroundColor: 'green',\n          borderWidth: 1,\n          borderColor: 'green',\n          direction: isRTL ? 'rtl' : 'ltr',\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          <RTLToggler setRTL={setRTL} isRTL={isRTL} />\n        </View>\n      </View>\n    </RNTesterBlock>\n  );\n});\n\nconst PositionExample = withRTLState(({isRTL, setRTL}) => {\n  return (\n    <RNTesterBlock 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        style={{\n          backgroundColor: 'orange',\n          borderWidth: 1,\n          borderColor: 'orange',\n          direction: isRTL ? 'rtl' : 'ltr',\n        }}>\n        <View\n          style={{\n            backgroundColor: 'white',\n            start: 50,\n            borderColor: 'gray',\n          }}>\n          <RTLToggler setRTL={setRTL} isRTL={isRTL} />\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        style={{\n          backgroundColor: 'orange',\n          borderWidth: 1,\n          borderColor: 'orange',\n          direction: isRTL ? 'rtl' : 'ltr',\n        }}>\n        <View\n          style={{\n            backgroundColor: 'white',\n            end: 50,\n            borderColor: 'gray',\n          }}>\n          <RTLToggler setRTL={setRTL} isRTL={isRTL} />\n        </View>\n      </View>\n    </RNTesterBlock>\n  );\n});\n\nconst BorderWidthExample = withRTLState(({isRTL, setRTL}) => {\n  return (\n    <RNTesterBlock title={'Border Width Start/End'}>\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 style={{direction: isRTL ? 'rtl' : 'ltr'}}>\n        <View\n          style={{\n            borderStartWidth: 10,\n            borderEndWidth: 50,\n          }}>\n          <View>\n            <RTLToggler setRTL={setRTL} isRTL={isRTL} />\n          </View>\n        </View>\n      </View>\n    </RNTesterBlock>\n  );\n});\n\nconst BorderColorExample = withRTLState(({isRTL, setRTL}) => {\n  return (\n    <RNTesterBlock title={'Border Color Start/End'}>\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 style={{direction: isRTL ? 'rtl' : 'ltr'}}>\n        <View\n          style={{\n            borderStartColor: 'red',\n            borderEndColor: 'green',\n            borderLeftWidth: 20,\n            borderRightWidth: 20,\n            padding: 10,\n          }}>\n          <View>\n            <RTLToggler setRTL={setRTL} isRTL={isRTL} />\n          </View>\n        </View>\n      </View>\n    </RNTesterBlock>\n  );\n});\n\nconst BorderRadiiExample = withRTLState(({isRTL, setRTL}) => {\n  return (\n    <RNTesterBlock title={'Border Radii Start/End'}>\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 style={{direction: 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          <View>\n            <RTLToggler setRTL={setRTL} isRTL={isRTL} />\n          </View>\n        </View>\n      </View>\n    </RNTesterBlock>\n  );\n});\n\nconst BorderExample = withRTLState(({isRTL, setRTL}) => {\n  return (\n    <RNTesterBlock title={'Border '}>\n      <Text style={styles.bold}>Styles</Text>\n      <Text>borderStartColor: 'red',</Text>\n      <Text>borderEndColor: 'green',</Text>\n      <Text>borderStartWidth: 10,</Text>\n      <Text>borderEndWidth: 50,</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 style={{direction: isRTL ? 'rtl' : 'ltr'}}>\n        <View\n          style={{\n            borderStartColor: 'red',\n            borderEndColor: 'green',\n            borderStartWidth: 10,\n            borderEndWidth: 50,\n            borderTopStartRadius: 10,\n            borderTopEndRadius: 20,\n            borderBottomStartRadius: 30,\n            borderBottomEndRadius: 40,\n            padding: 10,\n          }}>\n          <View>\n            <RTLToggler setRTL={setRTL} isRTL={isRTL} />\n          </View>\n        </View>\n      </View>\n    </RNTesterBlock>\n  );\n});\n\nclass RTLExample extends React.Component<any, State> {\n  static title = 'RTLExample';\n  static description = 'Examples to show how to apply components to RTL layout.';\n\n  _panResponder: Object;\n\n  constructor(props: Object) {\n    super(props);\n    const pan = new Animated.ValueXY();\n\n    this._panResponder = PanResponder.create({\n      onStartShouldSetPanResponder: () => true,\n      onPanResponderGrant: this._onPanResponderGrant,\n      onPanResponderMove: Animated.event([null, {dx: pan.x, dy: pan.y}]),\n      onPanResponderRelease: this._onPanResponderEnd,\n      onPanResponderTerminate: this._onPanResponderEnd,\n    });\n\n    this.state = {\n      toggleStatus: {},\n      pan,\n      linear: new Animated.Value(0),\n      isRTL: IS_RTL,\n      windowWidth: 0,\n    };\n  }\n\n  render() {\n    return (\n      <ScrollView\n        style={[\n          styles.container,\n          // `direction` property is supported only on iOS now.\n          Platform.OS === 'ios'\n            ? {direction: this.state.isRTL ? 'rtl' : 'ltr'}\n            : null,\n        ]}\n        onLayout={this._onLayout}>\n        <RNTesterPage title={'Right-to-Left (RTL) UI Layout'}>\n          <RNTesterBlock title={'Current Layout Direction'}>\n            <View style={styles.directionBox}>\n              <Text style={styles.directionText}>\n                {this.state.isRTL ? 'Right-to-Left' : 'Left-to-Right'}\n              </Text>\n            </View>\n          </RNTesterBlock>\n          <RNTesterBlock title={'Quickly Test RTL Layout'}>\n            <View style={styles.flexDirectionRow}>\n              <Text style={styles.switchRowTextView}>forceRTL</Text>\n              <View style={styles.switchRowSwitchView}>\n                <Switch\n                  onValueChange={this._onDirectionChange}\n                  style={styles.rightAlignStyle}\n                  value={this.state.isRTL}\n                />\n              </View>\n            </View>\n          </RNTesterBlock>\n          <RNTesterBlock title={'A Simple List Item Layout'}>\n            <View style={styles.list}>\n              <ListItem imageSource={require('./Thumbnails/like.png')} />\n              <ListItem imageSource={require('./Thumbnails/poke.png')} />\n            </View>\n          </RNTesterBlock>\n          <TextAlignmentExample\n            title={'Default Text Alignment'}\n            description={\n              'In iOS, it depends on active language. ' +\n              'In Android, it depends on the text content.'\n            }\n            style={styles.fontSizeSmall}\n          />\n          <TextAlignmentExample\n            title={\"Using textAlign: 'left'\"}\n            description={\n              'In iOS/Android, text alignment flips regardless of ' +\n              'languages or text content.'\n            }\n            style={[styles.fontSizeSmall, styles.textAlignLeft]}\n          />\n          <TextAlignmentExample\n            title={\"Using textAlign: 'right'\"}\n            description={\n              'In iOS/Android, text alignment flips regardless of ' +\n              'languages or text content.'\n            }\n            style={[styles.fontSizeSmall, styles.textAlignRight]}\n          />\n          <RNTesterBlock title={'Working With Icons'}>\n            <View style={styles.flexDirectionRow}>\n              <View>\n                <Image\n                  source={require('./Thumbnails/like.png')}\n                  style={styles.image}\n                />\n                <Text style={styles.fontSizeExtraSmall}>\n                  Without directional meaning\n                </Text>\n              </View>\n              <View style={styles.rightAlignStyle}>\n                <Image\n                  source={require('./Thumbnails/poke.png')}\n                  style={[styles.image, styles.withRTLStyle]}\n                />\n                <Text style={styles.fontSizeExtraSmall}>\n                  With directional meaning\n                </Text>\n              </View>\n            </View>\n          </RNTesterBlock>\n          <RNTesterBlock\n            title={'Controlling Animation'}\n            description={'Animation direction according to layout'}>\n            <View Style={styles.view}>\n              <AnimationBlock\n                onPress={this._linearTap}\n                imgStyle={{\n                  transform: [\n                    {translateX: this.state.linear},\n                    {scaleX: IS_RTL ? -1 : 1},\n                  ],\n                }}\n              />\n            </View>\n          </RNTesterBlock>\n          <PaddingExample />\n          <MarginExample />\n          <PositionExample />\n          <BorderWidthExample />\n          <BorderColorExample />\n          <BorderRadiiExample />\n          <BorderExample />\n        </RNTesterPage>\n      </ScrollView>\n    );\n  }\n\n  _onLayout = (e: Object) => {\n    this.setState({\n      windowWidth: e.nativeEvent.layout.width,\n    });\n  };\n\n  _onDirectionChange = () => {\n    I18nManager.forceRTL(!this.state.isRTL);\n    this.setState({isRTL: !this.state.isRTL});\n    Alert.alert(\n      'Reload this page',\n      'Please reload this page to change the UI direction! ' +\n        'All examples in this app will be affected. ' +\n        'Check them out to see what they look like in RTL layout.',\n    );\n  };\n\n  _linearTap = (refName: string, e: Object) => {\n    this.setState({\n      toggleStatus: {\n        ...this.state.toggleStatus,\n        [refName]: !this.state.toggleStatus[refName],\n      },\n    });\n    const offset = IMAGE_SIZE[0] / SCALE / 2 + 10;\n    const toMaxDistance =\n      (IS_RTL ? -1 : 1) * (this.state.windowWidth / 2 - offset);\n    Animated.timing(this.state.linear, {\n      toValue: this.state.toggleStatus[refName] ? toMaxDistance : 0,\n      duration: 2000,\n      useNativeDriver: true,\n    }).start();\n  };\n\n  _onPanResponderGrant = (e: Object, gestureState: Object) => {\n    this.state.pan.stopAnimation(value => {\n      this.state.pan.setOffset(value);\n    });\n  };\n\n  _onPanResponderEnd = (e: Object, gestureState: Object) => {\n    this.state.pan.flattenOffset();\n    Animated.sequence([\n      Animated.decay(this.state.pan, {\n        velocity: {x: gestureState.vx, y: gestureState.vy},\n        deceleration: 0.995,\n      }),\n      Animated.spring(this.state.pan, {toValue: {x: 0, y: 0}}),\n    ]).start();\n  };\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    backgroundColor: '#e9eaed',\n    paddingTop: 15,\n  },\n  directionBox: {\n    flex: 1,\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  switchRowTextView: {\n    flex: 1,\n    marginBottom: 5,\n    marginTop: 5,\n    textAlign: 'center',\n  },\n  switchRowSwitchView: {\n    flex: 3,\n  },\n  rightAlignStyle: {\n    right: 10,\n    position: 'absolute',\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  },\n  column2: {\n    flex: 2.5,\n    padding: 6,\n  },\n  column3: {\n    flex: 1.5,\n  },\n  icon: {\n    width: 48,\n    height: 48,\n    margin: 6,\n    borderWidth: 0.5,\n    borderColor: '#e5e5e5',\n  },\n  withRTLStyle: {\n    transform: [{scaleX: IS_RTL ? -1 : 1}],\n  },\n  image: {\n    left: 30,\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    top: 18,\n    borderRadius: 5,\n    height: 24,\n    width: 64,\n    backgroundColor: '#e5e5e5',\n    justifyContent: 'center',\n    alignItems: 'center',\n  },\n  fontSizeSmall: {\n    fontSize: 10,\n  },\n  fontSizeExtraSmall: {\n    fontSize: 8,\n  },\n  textAlignLeft: {\n    textAlign: 'left',\n  },\n  textAlignRight: {\n    textAlign: 'right',\n  },\n  textBox: {\n    width: 28,\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\nmodule.exports = RTLExample;\n"
  },
  {
    "path": "RNTester/js/RefreshControlExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RefreshControlExample\n */\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\nconst {\n  ScrollView,\n  StyleSheet,\n  RefreshControl,\n  Text,\n  TouchableWithoutFeedback,\n  View,\n} = ReactNative;\n\nconst styles = StyleSheet.create({\n  row: {\n    borderColor: 'grey',\n    borderWidth: 1,\n    padding: 20,\n    backgroundColor: '#3a5795',\n    margin: 5,\n  },\n  text: {\n    alignSelf: 'center',\n    color: '#fff',\n  },\n  scrollview: {\n    flex: 1,\n  },\n});\n\nclass Row extends React.Component {\n  _onClick = () => {\n    this.props.onClick(this.props.data);\n  };\n\n  render() {\n    return (\n     <TouchableWithoutFeedback onPress={this._onClick} >\n        <View style={styles.row}>\n          <Text style={styles.text}>\n            {this.props.data.text + ' (' + this.props.data.clicks + ' clicks)'}\n          </Text>\n        </View>\n      </TouchableWithoutFeedback>\n    );\n  }\n}\n\nclass RefreshControlExample extends React.Component {\n  static title = '<RefreshControl>';\n  static description = 'Adds pull-to-refresh support to a scrollview.';\n\n  state = {\n    isRefreshing: false,\n    loaded: 0,\n    rowData: Array.from(new Array(20)).map(\n      (val, i) => ({text: 'Initial row ' + i, clicks: 0})),\n  };\n\n  _onClick = (row) => {\n    row.clicks++;\n    this.setState({\n      rowData: this.state.rowData,\n    });\n  };\n\n  render() {\n    const rows = this.state.rowData.map((row, ii) => {\n      return <Row key={ii} data={row} onClick={this._onClick}/>;\n    });\n    return (\n      <ScrollView\n        style={styles.scrollview}\n        refreshControl={\n          <RefreshControl\n            refreshing={this.state.isRefreshing}\n            onRefresh={this._onRefresh}\n            tintColor=\"#ff0000\"\n            title=\"Loading...\"\n            titleColor=\"#00ff00\"\n            colors={['#ff0000', '#00ff00', '#0000ff']}\n            progressBackgroundColor=\"#ffff00\"\n          />\n        }>\n        {rows}\n      </ScrollView>\n    );\n  }\n\n  _onRefresh = () => {\n    this.setState({isRefreshing: true});\n    setTimeout(() => {\n      // prepend 10 items\n      const rowData = Array.from(new Array(10))\n      .map((val, i) => ({\n        text: 'Loaded row ' + (+this.state.loaded + i),\n        clicks: 0,\n      }))\n      .concat(this.state.rowData);\n\n      this.setState({\n        loaded: this.state.loaded + 10,\n        isRefreshing: false,\n        rowData: rowData,\n      });\n    }, 5000);\n  };\n}\n\nmodule.exports = RefreshControlExample;\n"
  },
  {
    "path": "RNTester/js/RootViewSizeFlexibilityExampleApp.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule RootViewSizeFlexibilityExampleApp\n */\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\nconst {\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  View,\n} = ReactNative;\n\nclass RootViewSizeFlexibilityExampleApp extends React.Component<{toggled: boolean}, any> {\n  constructor(props: {toggled: boolean}) {\n    super(props);\n    this.state = { toggled: false };\n  }\n\n  _onPressButton() {\n    this.setState({ toggled: !this.state.toggled });\n  }\n\n  render() {\n    const viewStyle = this.state.toggled ? styles.bigContainer : styles.smallContainer;\n\n    return (\n      <TouchableHighlight onPress={this._onPressButton.bind(this)}>\n        <View style={viewStyle}>\n          <View style={styles.center}>\n            <Text style={styles.whiteText}>\n              React Native Button\n            </Text>\n          </View>\n        </View>\n      </TouchableHighlight>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  bigContainer: {\n    flex: 1,\n    height: 60,\n    backgroundColor: 'gray',\n  },\n  smallContainer: {\n    flex: 1,\n    height: 40,\n    backgroundColor: 'gray',\n  },\n  center: {\n    flex: 1,\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  whiteText: {\n    color: 'white',\n  }\n});\n\nmodule.exports = RootViewSizeFlexibilityExampleApp;\n"
  },
  {
    "path": "RNTester/js/SafeAreaViewExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @format\n * @providesModule SafeAreaViewExample\n */\n'use strict';\n\nconst Button = require('Button');\nconst DeviceInfo = require('DeviceInfo');\nconst Modal = require('Modal');\nconst React = require('react');\nconst SafeAreaView = require('SafeAreaView');\nconst StyleSheet = require('StyleSheet');\nconst Text = require('Text');\nconst View = require('View');\n\nexports.displayName = (undefined: ?string);\nexports.framework = 'React';\nexports.title = '<SafeAreaView>';\nexports.description =\n  'SafeAreaView automatically applies paddings reflect the portion of the view that is not covered by other (special) ancestor views.';\n\nclass SafeAreaViewExample extends React.Component<\n  {},\n  {|modalVisible: boolean|},\n> {\n  state = {\n    modalVisible: false,\n  };\n\n  _setModalVisible = visible => {\n    this.setState({modalVisible: visible});\n  };\n\n  render() {\n    return (\n      <View>\n        <Modal\n          visible={this.state.modalVisible}\n          onRequestClose={() => this._setModalVisible(false)}\n          animationType=\"slide\"\n          supportedOrientations={['portrait', 'landscape']}>\n          <View style={styles.modal}>\n            <SafeAreaView style={styles.safeArea}>\n              <View style={styles.safeAreaContent}>\n                <Button\n                  onPress={this._setModalVisible.bind(this, false)}\n                  title=\"Close\"\n                />\n              </View>\n            </SafeAreaView>\n          </View>\n        </Modal>\n        <Button\n          onPress={this._setModalVisible.bind(this, true)}\n          title=\"Present Modal Screen with SafeAreaView\"\n        />\n      </View>\n    );\n  }\n}\n\nclass IsIPhoneXExample extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <Text>\n          Is this an iPhone X:{' '}\n          {DeviceInfo.isIPhoneX_deprecated\n            ? 'Yeah!'\n            : 'Nope. (Or `isIPhoneX_deprecated` was already removed.)'}\n        </Text>\n      </View>\n    );\n  }\n}\n\nexports.examples = [\n  {\n    title: '<SafeAreaView> Example',\n    description:\n      'SafeAreaView automatically applies paddings reflect the portion of the view that is not covered by other (special) ancestor views.',\n    render: () => <SafeAreaViewExample />,\n  },\n  {\n    title: 'isIPhoneX_deprecated Example',\n    description:\n      '`DeviceInfo.isIPhoneX_deprecated` returns true only on iPhone X. ' +\n      'Note: This prop is deprecated and will be removed right after June 01, 2018. ' +\n      'Please use this only for a quick and temporary solution. ' +\n      'Use <SafeAreaView> instead.',\n    render: () => <IsIPhoneXExample />,\n  },\n];\n\nvar styles = StyleSheet.create({\n  modal: {\n    flex: 1,\n  },\n  safeArea: {\n    flex: 1,\n    height: 1000,\n  },\n  safeAreaContent: {\n    flex: 1,\n    backgroundColor: '#ffaaaa',\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n});\n"
  },
  {
    "path": "RNTester/js/ScrollViewExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ScrollViewExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Platform,\n  ScrollView,\n  StyleSheet,\n  Text,\n  TouchableOpacity,\n  View,\n  Image\n} = ReactNative;\n\nexports.displayName = 'ScrollViewExample';\nexports.title = '<ScrollView>';\nexports.description = 'Component that enables scrolling through child components';\nexports.examples = [\n{\n  title: '<ScrollView>',\n  description: 'To make content scrollable, wrap it within a <ScrollView> component',\n  render: function() {\n    var _scrollView: ScrollView;\n    return (\n      <View>\n        <ScrollView\n          ref={(scrollView) => { _scrollView = scrollView; }}\n          automaticallyAdjustContentInsets={false}\n          onScroll={() => { console.log('onScroll!'); }}\n          scrollEventThrottle={200}\n          style={styles.scrollView}>\n          {THUMB_URLS.map(createThumbRow)}\n        </ScrollView>\n        <TouchableOpacity\n          style={styles.button}\n          onPress={() => { _scrollView.scrollTo({y: 0}); }}>\n          <Text>Scroll to top</Text>\n        </TouchableOpacity>\n        <TouchableOpacity\n          style={styles.button}\n          onPress={() => { _scrollView.scrollToEnd({animated: true}); }}>\n          <Text>Scroll to bottom</Text>\n        </TouchableOpacity>\n        <TouchableOpacity\n          style={styles.button}\n          onPress={() => { _scrollView.flashScrollIndicators(); }}>\n          <Text>Flash scroll indicators</Text>\n        </TouchableOpacity>\n      </View>\n    );\n  }\n}, {\n  title: '<ScrollView> (horizontal = true)',\n  description: 'You can display <ScrollView>\\'s child components horizontally rather than vertically',\n  render: function() {\n\n    function renderScrollView(title: string, addtionalStyles: typeof StyleSheet) {\n      var _scrollView: ScrollView;\n      return (\n        <View style={addtionalStyles}>\n          <Text style={styles.text}>{title}</Text>\n          <ScrollView\n            ref={(scrollView) => { _scrollView = scrollView; }}\n            automaticallyAdjustContentInsets={false}\n            horizontal={true}\n            style={[styles.scrollView, styles.horizontalScrollView]}>\n            {THUMB_URLS.map(createThumbRow)}\n          </ScrollView>\n          <TouchableOpacity\n            style={styles.button}\n            onPress={() => { _scrollView.scrollTo({x: 0}); }}>\n            <Text>Scroll to start</Text>\n          </TouchableOpacity>\n          <TouchableOpacity\n            style={styles.button}\n            onPress={() => { _scrollView.scrollToEnd({animated: true}); }}>\n            <Text>Scroll to end</Text>\n          </TouchableOpacity>\n          <TouchableOpacity\n            style={styles.button}\n            onPress={() => { _scrollView.flashScrollIndicators(); }}>\n            <Text>Flash scroll indicators</Text>\n          </TouchableOpacity>\n        </View>\n      );\n    }\n\n    return (\n      <View>\n        {renderScrollView('LTR layout', {direction: 'ltr'})}\n        {renderScrollView('RTL layout', {direction: 'rtl'})}\n      </View>\n    );\n  }\n}];\n\nclass Thumb extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  shouldComponentUpdate(nextProps, nextState) {\n    return false;\n  }\n\n  render() {\n    return (\n      <View style={styles.thumb}>\n        <Image style={styles.img} source={this.props.source} />\n      </View>\n    );\n  }\n}\n\nvar THUMB_URLS = [\n  require('./Thumbnails/like.png'),\n  require('./Thumbnails/dislike.png'),\n  require('./Thumbnails/call.png'),\n  require('./Thumbnails/fist.png'),\n  require('./Thumbnails/bandaged.png'),\n  require('./Thumbnails/flowers.png'),\n  require('./Thumbnails/heart.png'),\n  require('./Thumbnails/liking.png'),\n  require('./Thumbnails/party.png'),\n  require('./Thumbnails/poke.png'),\n  require('./Thumbnails/superlike.png'),\n  require('./Thumbnails/victory.png'),\n];\n\nTHUMB_URLS = THUMB_URLS.concat(THUMB_URLS); // double length of THUMB_URLS\n\nvar createThumbRow = (uri, i) => <Thumb key={i} source={uri} />;\n\nvar styles = StyleSheet.create({\n  scrollView: {\n    backgroundColor: '#eeeeee',\n    height: 300,\n  },\n  horizontalScrollView: {\n    height: 106,\n  },\n  text: {\n    fontSize: 16,\n    fontWeight: 'bold',\n    margin: 5,\n  },\n  button: {\n    margin: 5,\n    padding: 5,\n    alignItems: 'center',\n    backgroundColor: '#cccccc',\n    borderRadius: 3,\n  },\n  thumb: {\n    margin: 5,\n    padding: 5,\n    backgroundColor: '#cccccc',\n    borderRadius: 3,\n    minWidth: 96,\n  },\n  img: {\n    width: 64,\n    height: 64,\n  }\n});\n"
  },
  {
    "path": "RNTester/js/ScrollViewSimpleExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ScrollViewSimpleExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  ScrollView,\n  StyleSheet,\n  Text,\n  TouchableOpacity\n} = ReactNative;\n\nvar NUM_ITEMS = 20;\n\nclass ScrollViewSimpleExample extends React.Component<{}> {\n  static title = '<ScrollView>';\n  static description = 'Component that enables scrolling through child components.';\n\n  makeItems = (nItems: number, styles): Array<any> => {\n    var items = [];\n    for (var i = 0; i < nItems; i++) {\n       items[i] = (\n         <TouchableOpacity key={i} style={styles}>\n           <Text>{'Item ' + i}</Text>\n         </TouchableOpacity>\n       );\n    }\n    return items;\n  };\n\n  render() {\n    // One of the items is a horizontal scroll view\n    var items = this.makeItems(NUM_ITEMS, styles.itemWrapper);\n    items[4] = (\n      <ScrollView key={'scrollView'} horizontal={true}>\n        {this.makeItems(NUM_ITEMS, [styles.itemWrapper, styles.horizontalItemWrapper])}\n      </ScrollView>\n    );\n    items.push(\n      <ScrollView\n        key={'scrollViewSnap'}\n        horizontal\n        snapToInterval={210}\n        pagingEnabled\n      >\n        {this.makeItems(NUM_ITEMS, [\n          styles.itemWrapper,\n          styles.horizontalItemWrapper,\n          styles.horizontalPagingItemWrapper,\n        ])}\n      </ScrollView>\n    );\n\n    var verticalScrollView = (\n      <ScrollView style={styles.verticalScrollView}>\n        {items}\n      </ScrollView>\n    );\n\n    return verticalScrollView;\n  }\n}\n\nvar styles = StyleSheet.create({\n  verticalScrollView: {\n    margin: 10,\n  },\n  itemWrapper: {\n    backgroundColor: '#dddddd',\n    alignItems: 'center',\n    borderRadius: 5,\n    borderWidth: 5,\n    borderColor: '#a52a2a',\n    padding: 30,\n    margin: 5,\n  },\n  horizontalItemWrapper: {\n    padding: 50\n  },\n  horizontalPagingItemWrapper: {\n    width: 200,\n  },\n});\n\nmodule.exports = ScrollViewSimpleExample;\n"
  },
  {
    "path": "RNTester/js/SectionListExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule SectionListExample\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  Alert,\n  Animated,\n  Button,\n  SectionList,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nconst RNTesterPage = require('./RNTesterPage');\n\nconst infoLog = require('infoLog');\n\nconst {\n  HeaderComponent,\n  FooterComponent,\n  ItemComponent,\n  PlainInput,\n  SeparatorComponent,\n  Spindicator,\n  genItemData,\n  pressItem,\n  renderSmallSwitchOption,\n  renderStackedItem,\n} = require('./ListExampleShared');\n\nconst AnimatedSectionList = Animated.createAnimatedComponent(SectionList);\n\nconst VIEWABILITY_CONFIG = {\n  minimumViewTime: 3000,\n  viewAreaCoveragePercentThreshold: 100,\n  waitForInteraction: true,\n};\n\nconst renderSectionHeader = ({section}) => (\n  <View style={styles.header}>\n    <Text style={styles.headerText}>SECTION HEADER: {section.key}</Text>\n    <SeparatorComponent />\n  </View>\n);\n\nconst renderSectionFooter = ({section}) => (\n  <View style={styles.header}>\n    <Text style={styles.headerText}>SECTION FOOTER: {section.key}</Text>\n    <SeparatorComponent />\n  </View>\n);\n\nconst CustomSeparatorComponent = ({highlighted, text}) => (\n  <View style={[styles.customSeparator, highlighted && {backgroundColor: 'rgb(217, 217, 217)'}]}>\n    <Text style={styles.separatorText}>{text}</Text>\n  </View>\n);\n\nclass SectionListExample extends React.PureComponent<{}, $FlowFixMeState> {\n  static title = '<SectionList>';\n  static description = 'Performant, scrollable list of data.';\n\n  state = {\n    data: genItemData(1000),\n    debug: false,\n    filterText: '',\n    logViewable: false,\n    virtualized: true,\n  };\n\n  _scrollPos = new Animated.Value(0);\n  _scrollSinkY = Animated.event(\n    [{nativeEvent: { contentOffset: { y: this._scrollPos } }}],\n    {useNativeDriver: true},\n  );\n\n  _sectionListRef: any;\n  _captureRef = (ref) => { this._sectionListRef = ref; };\n\n  _scrollToLocation(sectionIndex: number, itemIndex: number) {\n    this._sectionListRef\n      .getNode()\n      .scrollToLocation({ sectionIndex, itemIndex });\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    );\n    const filteredData = this.state.data.filter(filter);\n    const filteredSectionData = [];\n    let startIndex = 0;\n    const endIndex = filteredData.length - 1;\n    for (let ii = 10; ii <= endIndex + 10; ii += 10) {\n      filteredSectionData.push({\n        key: `${filteredData[startIndex].key} - ${filteredData[Math.min(ii - 1, endIndex)].key}`,\n        data: filteredData.slice(startIndex, ii),\n      });\n      startIndex = ii;\n    }\n    return (\n      <RNTesterPage\n        noSpacer={true}\n        noScroll={true}>\n        <View style={styles.searchRow}>\n          <PlainInput\n            onChangeText={filterText => {\n              this.setState(() => ({filterText}));\n            }}\n            placeholder=\"Search...\"\n            value={this.state.filterText}\n          />\n          <View style={styles.optionSection}>\n            {renderSmallSwitchOption(this, 'virtualized')}\n            {renderSmallSwitchOption(this, 'logViewable')}\n            {renderSmallSwitchOption(this, 'debug')}\n            <Spindicator value={this._scrollPos} />\n          </View>\n          <View style={styles.scrollToRow}>\n            <Text>scroll to:</Text>\n            <Button title=\"Item A\" onPress={() => this._scrollToLocation(2, 1)}/>\n            <Button title=\"Item B\" onPress={() => this._scrollToLocation(3, 6)}/>\n            <Button title=\"Item C\" onPress={() => this._scrollToLocation(6, 3)}/>\n          </View>\n        </View>\n        <SeparatorComponent />\n        <AnimatedSectionList\n          ref={this._captureRef}\n          ListHeaderComponent={HeaderComponent}\n          ListFooterComponent={FooterComponent}\n          SectionSeparatorComponent={(info) =>\n            <CustomSeparatorComponent {...info} text=\"SECTION SEPARATOR\" />\n          }\n          ItemSeparatorComponent={(info) =>\n            <CustomSeparatorComponent {...info} text=\"ITEM SEPARATOR\" />\n          }\n          debug={this.state.debug}\n          enableVirtualization={this.state.virtualized}\n          onRefresh={() => Alert.alert('onRefresh: nothing to refresh :P')}\n          onScroll={this._scrollSinkY}\n          onViewableItemsChanged={this._onViewableItemsChanged}\n          refreshing={false}\n          renderItem={this._renderItemComponent}\n          renderSectionHeader={renderSectionHeader}\n          renderSectionFooter={renderSectionFooter}\n          stickySectionHeadersEnabled\n          sections={[\n            {\n              key: 'empty section',\n              data: [],\n            },\n            {\n              renderItem: renderStackedItem,\n              key: 's1',\n              data: [\n                {title: 'Item In Header Section', text: 'Section s1', key: 'header item'},\n              ],\n            },\n            {\n              key: 's2',\n              data: [\n                {noImage: true, title: '1st item', text: 'Section s2', key: 'noimage0'},\n                {noImage: true, title: '2nd item', text: 'Section s2', key: 'noimage1'},\n              ],\n            },\n            ...filteredSectionData,\n          ]}\n          style={styles.list}\n          viewabilityConfig={VIEWABILITY_CONFIG}\n        />\n      </RNTesterPage>\n    );\n  }\n\n  _renderItemComponent = ({item, separators}) => (\n    <ItemComponent\n      item={item}\n      onPress={this._pressItem}\n      onHideUnderlay={separators.unhighlight}\n      onShowUnderlay={separators.highlight}\n    />\n  );\n\n  // This is called when items change viewability by scrolling into our out of\n  // the viewable area.\n  _onViewableItemsChanged = (info: {\n    changed: Array<{\n      key: string,\n      isViewable: boolean,\n      item: {columns: Array<*>},\n      index: ?number,\n      section?: any\n    }>},\n  ) => {\n    // Impressions can be logged here\n    if (this.state.logViewable) {\n      infoLog('onViewableItemsChanged: ', info.changed.map((v: Object) => (\n        {...v, item: '...', section: v.section.key}\n      )));\n    }\n  };\n\n  _pressItem = (key: string) => {\n    !isNaN(key) && pressItem(this, key);\n  };\n}\n\nconst styles = StyleSheet.create({\n  customSeparator: {\n    backgroundColor: 'rgb(200, 199, 204)',\n  },\n  header: {\n    backgroundColor: '#e9eaed',\n  },\n  headerText: {\n    padding: 4,\n    fontWeight: '600',\n  },\n  list: {\n    backgroundColor: 'white',\n  },\n  optionSection: {\n    flexDirection: 'row',\n  },\n  searchRow: {\n    paddingHorizontal: 10,\n  },\n  scrollToRow: {\n    flexDirection: 'row',\n    alignItems: 'center',\n    paddingHorizontal: 8,\n  },\n  separatorText: {\n    color: 'gray',\n    alignSelf: 'center',\n    fontSize: 7,\n  },\n});\n\nmodule.exports = SectionListExample;\n"
  },
  {
    "path": "RNTester/js/SegmentedControlIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule SegmentedControlIOSExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  SegmentedControlIOS,\n  Text,\n  View,\n  StyleSheet\n} = ReactNative;\n\nclass BasicSegmentedControlExample extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <View style={{marginBottom: 10}}>\n          <SegmentedControlIOS values={['One', 'Two']} />\n        </View>\n        <View>\n          <SegmentedControlIOS values={['One', 'Two', 'Three', 'Four', 'Five']} />\n        </View>\n      </View>\n    );\n  }\n}\n\nclass PreSelectedSegmentedControlExample extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <View>\n          <SegmentedControlIOS values={['One', 'Two']} selectedIndex={0} />\n        </View>\n      </View>\n    );\n  }\n}\n\nclass MomentarySegmentedControlExample extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <View>\n          <SegmentedControlIOS values={['One', 'Two']} momentary={true} />\n        </View>\n      </View>\n    );\n  }\n}\n\nclass DisabledSegmentedControlExample extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <View>\n          <SegmentedControlIOS enabled={false} values={['One', 'Two']} selectedIndex={1} />\n        </View>\n      </View>\n    );\n  }\n}\n\nclass ColorSegmentedControlExample extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <View style={{marginBottom: 10}}>\n          <SegmentedControlIOS tintColor=\"#ff0000\" values={['One', 'Two', 'Three', 'Four']} selectedIndex={0} />\n        </View>\n        <View>\n          <SegmentedControlIOS tintColor=\"#00ff00\" values={['One', 'Two', 'Three']} selectedIndex={1} />\n        </View>\n      </View>\n    );\n  }\n}\n\nclass EventSegmentedControlExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    values: ['One', 'Two', 'Three'],\n    value: 'Not selected',\n    selectedIndex: undefined\n  };\n\n  render() {\n    return (\n      <View>\n        <Text style={styles.text} >\n          Value: {this.state.value}\n        </Text>\n        <Text style={styles.text} >\n          Index: {this.state.selectedIndex}\n        </Text>\n        <SegmentedControlIOS\n          values={this.state.values}\n          selectedIndex={this.state.selectedIndex}\n          onChange={this._onChange}\n          onValueChange={this._onValueChange} />\n      </View>\n    );\n  }\n\n  _onChange = (event) => {\n    this.setState({\n      selectedIndex: event.nativeEvent.selectedSegmentIndex,\n    });\n  };\n\n  _onValueChange = (value) => {\n    this.setState({\n      value: value,\n    });\n  };\n}\n\nvar styles = StyleSheet.create({\n  text: {\n    fontSize: 14,\n    textAlign: 'center',\n    fontWeight: '500',\n    margin: 10,\n  },\n});\n\nexports.title = '<SegmentedControlIOS>';\nexports.displayName = 'SegmentedControlExample';\nexports.description = 'Native segmented control';\nexports.examples = [\n  {\n    title: 'Segmented controls can have values',\n    render(): React.Element<any> { return <BasicSegmentedControlExample />; }\n  },\n  {\n    title: 'Segmented controls can have a pre-selected value',\n    render(): React.Element<any> { return <PreSelectedSegmentedControlExample />; }\n  },\n  {\n    title: 'Segmented controls can be momentary',\n    render(): React.Element<any> { return <MomentarySegmentedControlExample />; }\n  },\n  {\n    title: 'Segmented controls can be disabled',\n    render(): React.Element<any> { return <DisabledSegmentedControlExample />; }\n  },\n  {\n    title: 'Custom colors can be provided',\n    render(): React.Element<any> { return <ColorSegmentedControlExample />; }\n  },\n  {\n    title: 'Change events can be detected',\n    render(): React.Element<any> { return <EventSegmentedControlExample />; }\n  }\n];\n"
  },
  {
    "path": "RNTester/js/SetPropertiesExampleApp.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule SetPropertiesExampleApp\n */\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\nconst {\n  Text,\n  View,\n} = ReactNative;\n\nclass SetPropertiesExampleApp extends React.Component<$FlowFixMeProps> {\n\n  render() {\n    const wrapperStyle = {\n      backgroundColor: this.props.color,\n      flex: 1,\n      alignItems: 'center',\n      justifyContent: 'center'\n    };\n\n    return (\n      <View style={wrapperStyle}>\n        <Text>\n          Embedded React Native view\n        </Text>\n      </View>\n    );\n  }\n\n}\n\nmodule.exports = SetPropertiesExampleApp;\n"
  },
  {
    "path": "RNTester/js/ShareExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ShareExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  View,\n  Text,\n  TouchableHighlight,\n  Share,\n} = ReactNative;\n\nexports.framework = 'React';\nexports.title = 'Share';\nexports.description = 'Share data with other Apps.';\nexports.examples = [{\n  title: 'Share Text Content',\n  render() {\n    return <ShareMessageExample />;\n  }\n}];\n\nclass ShareMessageExample extends React.Component<$FlowFixMeProps, any> {\n  _shareMessage: Function;\n  _shareText: Function;\n  _showResult: Function;\n\n  constructor(props) {\n    super(props);\n\n    this._shareMessage = this._shareMessage.bind(this);\n    this._shareText = this._shareText.bind(this);\n    this._showResult = this._showResult.bind(this);\n\n    this.state = {\n      result: ''\n    };\n  }\n\n  render() {\n    return (\n      <View>\n        <TouchableHighlight style={styles.wrapper}\n          onPress={this._shareMessage}>\n          <View style={styles.button}>\n            <Text>Click to share message</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight style={styles.wrapper}\n          onPress={this._shareText}>\n          <View style={styles.button}>\n            <Text>Click to share message, URL and title</Text>\n          </View>\n        </TouchableHighlight>\n        <Text>{this.state.result}</Text>\n      </View>\n    );\n  }\n\n  _shareMessage() {\n    Share.share({\n      message: 'React Native | A framework for building native apps using React'\n    })\n    .then(this._showResult)\n    .catch((error) => this.setState({result: 'error: ' + error.message}));\n  }\n\n  _shareText() {\n    Share.share({\n      message: 'A framework for building native apps using React',\n      url: 'http://facebook.github.io/react-native/',\n      title: 'React Native'\n    }, {\n      subject: 'A subject to go in the email heading',\n      dialogTitle: 'Share React Native website',\n      excludedActivityTypes: [\n        'com.apple.UIKit.activity.PostToTwitter'\n      ],\n      tintColor: 'green'\n    })\n    .then(this._showResult)\n    .catch((error) => this.setState({result: 'error: ' + error.message}));\n  }\n\n  _showResult(result) {\n    if (result.action === Share.sharedAction) {\n      if (result.activityType) {\n        this.setState({result: 'shared with an activityType: ' + result.activityType});\n      } else {\n        this.setState({result: 'shared'});\n      }\n    } else if (result.action === Share.dismissedAction) {\n      this.setState({result: 'dismissed'});\n    }\n  }\n}\n\n\nvar styles = StyleSheet.create({\n  wrapper: {\n    borderRadius: 5,\n    marginBottom: 5,\n  },\n  button: {\n    backgroundColor: '#eeeeee',\n    padding: 10,\n  },\n});\n"
  },
  {
    "path": "RNTester/js/SliderExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule SliderExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Slider,\n  Text,\n  StyleSheet,\n  View,\n} = ReactNative;\n\nclass SliderExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  static defaultProps = {\n    value: 0,\n  };\n\n  state = {\n    value: this.props.value,\n  };\n\n  render() {\n    return (\n      <View>\n        <Text style={styles.text} >\n          {this.state.value && +this.state.value.toFixed(3)}\n        </Text>\n        <Slider\n          {...this.props}\n          onValueChange={(value) => this.setState({value: value})} />\n      </View>\n    );\n  }\n}\n\nclass SlidingCompleteExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  state = {\n    slideCompletionValue: 0,\n    slideCompletionCount: 0,\n  };\n\n  render() {\n    return (\n      <View>\n        <SliderExample\n          {...this.props}\n          onSlidingComplete={(value) => this.setState({\n              slideCompletionValue: value,\n              slideCompletionCount: this.state.slideCompletionCount + 1})} />\n        <Text>\n          Completions: {this.state.slideCompletionCount} Value: {this.state.slideCompletionValue}\n        </Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  slider: {\n    height: 10,\n    margin: 10,\n  },\n  text: {\n    fontSize: 14,\n    textAlign: 'center',\n    fontWeight: '500',\n    margin: 10,\n  },\n});\n\nexports.title = '<Slider>';\nexports.displayName = 'SliderExample';\nexports.description = 'Slider input for numeric values';\nexports.examples = [\n  {\n    title: 'Default settings',\n    render(): React.Element<any> {\n      return <SliderExample />;\n    }\n  },\n  {\n    title: 'Initial value: 0.5',\n    render(): React.Element<any> {\n      return <SliderExample value={0.5} />;\n    }\n  },\n  {\n    title: 'minimumValue: -1, maximumValue: 2',\n    render(): React.Element<any> {\n      return (\n        <SliderExample\n          minimumValue={-1}\n          maximumValue={2}\n        />\n      );\n    }\n  },\n  {\n    title: 'step: 0.25',\n    render(): React.Element<any> {\n      return <SliderExample step={0.25} />;\n    }\n  },\n  {\n    title: 'onSlidingComplete',\n    render(): React.Element<any> {\n      return (\n        <SlidingCompleteExample />\n      );\n    }\n  },\n  {\n    title: 'Custom min/max track tint color',\n    render(): React.Element<any> {\n      return (\n        <SliderExample\n          minimumTrackTintColor={'blue'}\n          maximumTrackTintColor={'red'}\n          value={0.5}\n        />\n      );\n    }\n  },\n  {\n    title: 'Custom thumb color',\n    platform: 'android',\n    render(): React.Element<any> {\n      return <SliderExample thumbTintColor={'blue'} />;\n    }\n  },\n  {\n    title: 'Custom thumb image',\n    platform: 'ios',\n    render(): React.Element<any> {\n      return <SliderExample thumbImage={require('./uie_thumb_big.png')} />;\n    }\n  },\n  {\n    title: 'Custom track image',\n    platform: 'ios',\n    render(): React.Element<any> {\n      return <SliderExample trackImage={require('./slider.png')} />;\n    }\n  },\n  {\n    title: 'Custom min/max track image',\n    platform: 'ios',\n    render(): React.Element<any> {\n      return (\n        <SliderExample\n          minimumTrackImage={require('./slider-left.png')}\n          maximumTrackImage={require('./slider-right.png')}\n        />\n      );\n    }\n  },\n];\n"
  },
  {
    "path": "RNTester/js/SnapshotExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule SnapshotExample\n * @format\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {Alert, Image, StyleSheet, Text, View} = ReactNative;\n\nclass ScreenshotExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    uri: undefined,\n  };\n\n  render() {\n    return (\n      <View>\n        <Text onPress={this.takeScreenshot} style={style.button}>\n          Click to take a screenshot\n        </Text>\n        <Image style={style.image} source={{uri: this.state.uri}} />\n      </View>\n    );\n  }\n\n  takeScreenshot = () => {\n    ReactNative.takeSnapshot('window', {format: 'jpeg', quality: 0.8}) // See UIManager.js for options\n      .then(uri => this.setState({uri}))\n      .catch(error => Alert.alert(error));\n  };\n}\n\nconst style = StyleSheet.create({\n  button: {\n    marginBottom: 10,\n    fontWeight: '500',\n  },\n  image: {\n    flex: 1,\n    height: 300,\n    resizeMode: 'contain',\n    backgroundColor: 'black',\n  },\n});\n\nexports.title = 'Snapshot / Screenshot';\nexports.description = 'API to capture images from the screen.';\nexports.examples = [\n  {\n    title: 'Take screenshot',\n    render(): React.Element<any> {\n      return <ScreenshotExample />;\n    },\n  },\n];\n"
  },
  {
    "path": "RNTester/js/StatusBarExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule StatusBarExample\n */\n'use strict';\n\nconst React = require('React');\nconst ReactNative = require('react-native');\nconst {\n  StatusBar,\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  View,\n} = ReactNative;\n\nexports.framework = 'React';\nexports.title = '<StatusBar>';\nexports.description = 'Component for controlling the status bar';\n\nconst colors = [\n  '#ff0000',\n  '#00ff00',\n  '#0000ff',\n  'rgba(0, 0, 0, 0.4)',\n];\n\nconst barStyles = [\n  'default',\n  'light-content',\n];\n\nconst showHideTransitions = [\n  'fade',\n  'slide',\n];\n\nfunction getValue<T>(values: Array<T>, index: number): T {\n  return values[index % values.length];\n}\n\nclass StatusBarHiddenExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    animated: true,\n    hidden: false,\n    showHideTransition: getValue(showHideTransitions, 0),\n  };\n\n  _showHideTransitionIndex = 0;\n\n  _onChangeAnimated = () => {\n    this.setState({animated: !this.state.animated});\n  };\n\n  _onChangeHidden = () => {\n    this.setState({hidden: !this.state.hidden});\n  };\n\n  _onChangeTransition = () => {\n    this._showHideTransitionIndex++;\n    this.setState({\n      showHideTransition: getValue(showHideTransitions, this._showHideTransitionIndex),\n    });\n  };\n\n  render() {\n    return (\n      <View>\n        <StatusBar\n          hidden={this.state.hidden}\n          showHideTransition={this.state.showHideTransition}\n          animated={this.state.animated}\n        />\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this._onChangeHidden}>\n          <View style={styles.button}>\n            <Text>hidden: {this.state.hidden ? 'true' : 'false'}</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this._onChangeAnimated}>\n          <View style={styles.button}>\n            <Text>animated (ios only): {this.state.animated ? 'true' : 'false'}</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this._onChangeTransition}>\n          <View style={styles.button}>\n            <Text>\n              showHideTransition (ios only):\n              '{getValue(showHideTransitions, this._showHideTransitionIndex)}'\n            </Text>\n          </View>\n        </TouchableHighlight>\n      </View>\n    );\n  }\n}\n\nclass StatusBarStyleExample extends React.Component<{}, $FlowFixMeState> {\n  _barStyleIndex = 0;\n\n  _onChangeBarStyle = () => {\n    this._barStyleIndex++;\n    this.setState({barStyle: getValue(barStyles, this._barStyleIndex)});\n  };\n\n  _onChangeAnimated = () => {\n    this.setState({animated: !this.state.animated});\n  };\n\n  state = {\n    animated: true,\n    barStyle: getValue(barStyles, this._barStyleIndex),\n  };\n\n  render() {\n    return (\n      <View>\n        <StatusBar\n          animated={this.state.animated}\n          barStyle={this.state.barStyle}\n        />\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this._onChangeBarStyle}>\n          <View style={styles.button}>\n            <Text>style: '{getValue(barStyles, this._barStyleIndex)}'</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this._onChangeAnimated}>\n          <View style={styles.button}>\n            <Text>animated: {this.state.animated ? 'true' : 'false'}</Text>\n          </View>\n        </TouchableHighlight>\n      </View>\n    );\n  }\n}\n\nclass StatusBarNetworkActivityExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    networkActivityIndicatorVisible: false,\n  };\n\n  _onChangeNetworkIndicatorVisible = () => {\n    this.setState({\n      networkActivityIndicatorVisible: !this.state.networkActivityIndicatorVisible,\n    });\n  };\n\n  render() {\n    return (\n      <View>\n        <StatusBar\n          networkActivityIndicatorVisible={this.state.networkActivityIndicatorVisible}\n        />\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this._onChangeNetworkIndicatorVisible}>\n          <View style={styles.button}>\n            <Text>\n              networkActivityIndicatorVisible:\n              {this.state.networkActivityIndicatorVisible ? 'true' : 'false'}\n            </Text>\n          </View>\n        </TouchableHighlight>\n      </View>\n    );\n  }\n}\n\nclass StatusBarBackgroundColorExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    animated: true,\n    backgroundColor: getValue(colors, 0),\n  };\n\n  _colorIndex = 0;\n\n  _onChangeBackgroundColor = () => {\n    this._colorIndex++;\n    this.setState({backgroundColor: getValue(colors, this._colorIndex)});\n  };\n\n  _onChangeAnimated = () => {\n    this.setState({animated: !this.state.animated});\n  };\n\n  render() {\n    return (\n      <View>\n        <StatusBar\n          backgroundColor={this.state.backgroundColor}\n          animated={this.state.animated}\n        />\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this._onChangeBackgroundColor}>\n          <View style={styles.button}>\n            <Text>backgroundColor: '{getValue(colors, this._colorIndex)}'</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this._onChangeAnimated}>\n          <View style={styles.button}>\n            <Text>animated: {this.state.animated ? 'true' : 'false'}</Text>\n          </View>\n        </TouchableHighlight>\n      </View>\n    );\n  }\n}\n\nclass StatusBarTranslucentExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    translucent: false,\n  };\n\n  _onChangeTranslucent = () => {\n    this.setState({\n      translucent: !this.state.translucent,\n    });\n  };\n\n  render() {\n    return (\n      <View>\n        <StatusBar\n          translucent={this.state.translucent}\n        />\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this._onChangeTranslucent}>\n          <View style={styles.button}>\n            <Text>translucent: {this.state.translucent ? 'true' : 'false'}</Text>\n          </View>\n        </TouchableHighlight>\n      </View>\n    );\n  }\n}\n\nclass StatusBarStaticIOSExample extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setHidden(true, 'slide');\n          }}>\n          <View style={styles.button}>\n            <Text>setHidden(true, 'slide')</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setHidden(false, 'fade');\n          }}>\n          <View style={styles.button}>\n            <Text>setHidden(false, 'fade')</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setBarStyle('default', true);\n          }}>\n          <View style={styles.button}>\n            <Text>setBarStyle('default', true)</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setBarStyle('light-content', true);\n          }}>\n          <View style={styles.button}>\n            <Text>setBarStyle('light-content', true)</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setNetworkActivityIndicatorVisible(true);\n          }}>\n          <View style={styles.button}>\n            <Text>setNetworkActivityIndicatorVisible(true)</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setNetworkActivityIndicatorVisible(false);\n          }}>\n          <View style={styles.button}>\n            <Text>setNetworkActivityIndicatorVisible(false)</Text>\n          </View>\n        </TouchableHighlight>\n      </View>\n    );\n  }\n}\n\nclass StatusBarStaticAndroidExample extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setHidden(true);\n          }}>\n          <View style={styles.button}>\n            <Text>setHidden(true)</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setHidden(false);\n          }}>\n          <View style={styles.button}>\n            <Text>setHidden(false)</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setBackgroundColor('#ff00ff', true);\n          }}>\n          <View style={styles.button}>\n            <Text>setBackgroundColor('#ff00ff', true)</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setBackgroundColor('#00ff00', true);\n          }}>\n          <View style={styles.button}>\n            <Text>setBackgroundColor('#00ff00', true)</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setTranslucent(true);\n            StatusBar.setBackgroundColor('rgba(0, 0, 0, 0.4)', true);\n          }}>\n          <View style={styles.button}>\n            <Text>setTranslucent(true) and setBackgroundColor('rgba(0, 0, 0, 0.4)', true)</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => {\n            StatusBar.setTranslucent(false);\n            StatusBar.setBackgroundColor('black', true);\n          }}>\n          <View style={styles.button}>\n            <Text>setTranslucent(false) and setBackgroundColor('black', true)</Text>\n          </View>\n        </TouchableHighlight>\n      </View>\n    );\n  }\n}\n\nconst examples = [{\n  title: 'StatusBar hidden',\n  render() {\n    return <StatusBarHiddenExample />;\n  },\n}, {\n  title: 'StatusBar style',\n  render() {\n    return <StatusBarStyleExample />;\n  },\n  platform: 'ios',\n}, {\n  title: 'StatusBar network activity indicator',\n  render() {\n    return <StatusBarNetworkActivityExample />;\n  },\n  platform: 'ios',\n}, {\n  title: 'StatusBar background color',\n  render() {\n    return <StatusBarBackgroundColorExample />;\n  },\n  platform: 'android',\n}, {\n  title: 'StatusBar translucent',\n  render() {\n    return <StatusBarTranslucentExample />;\n  },\n  platform: 'android',\n}, {\n  title: 'StatusBar static API',\n  render() {\n    return <StatusBarStaticIOSExample />;\n  },\n  platform: 'ios',\n}, {\n  title: 'StatusBar static API',\n  render() {\n    return <StatusBarStaticAndroidExample />;\n  },\n  platform: 'android',\n}, {\n  title: 'StatusBar dimensions',\n  render() {\n    return (\n      <View>\n        <Text>Height (Android only): {StatusBar.currentHeight} pts</Text>\n      </View>\n    );\n  },\n  platform: 'android',\n}];\n\nexports.examples = examples;\n\nvar styles = StyleSheet.create({\n  wrapper: {\n    borderRadius: 5,\n    marginBottom: 5,\n  },\n  button: {\n    borderRadius: 5,\n    backgroundColor: '#eeeeee',\n    padding: 10,\n  },\n  title: {\n    marginTop: 16,\n    marginBottom: 8,\n    fontWeight: 'bold',\n  }\n});\n"
  },
  {
    "path": "RNTester/js/SwipeableFlatListExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SwipeableFlatListExample\n * @flow\n * @format\n */\n'use strict';\n\nconst React = require('react');\nconst createReactClass = require('create-react-class');\nconst ReactNative = require('react-native');\nconst {\n  Image,\n  SwipeableFlatList,\n  TouchableHighlight,\n  StyleSheet,\n  Text,\n  View,\n  Alert,\n} = ReactNative;\n\nconst RNTesterPage = require('./RNTesterPage');\n\nconst data = [\n  {\n    key: 'like',\n    icon: require('./Thumbnails/like.png'),\n    data: 'Like!',\n  },\n  {\n    key: 'heart',\n    icon: require('./Thumbnails/heart.png'),\n    data: 'Heart!',\n  },\n  {\n    key: 'party',\n    icon: require('./Thumbnails/party.png'),\n    data: 'Party!',\n  },\n];\n\nconst SwipeableFlatListExample = createReactClass({\n  displayName: 'SwipeableFlatListExample',\n  statics: {\n    title: '<SwipeableFlatList>',\n    description: 'Performant, scrollable, swipeable list of data.',\n  },\n\n  render: function() {\n    return (\n      <RNTesterPage\n        title={this.props.navigator ? null : '<SwipeableListView>'}\n        noSpacer={true}\n        noScroll={true}>\n        <SwipeableFlatList\n          data={data}\n          bounceFirstRowOnMount={true}\n          maxSwipeDistance={160}\n          renderItem={this._renderItem.bind(this)}\n          renderQuickActions={this._renderQuickActions.bind(this)}\n        />\n      </RNTesterPage>\n    );\n  },\n\n  _renderItem: function({item}): ?React.Element<any> {\n    return (\n      <View style={styles.row}>\n        <Image style={styles.rowIcon} source={item.icon} />\n        <View style={styles.rowData}>\n          <Text style={styles.rowDataText}>{item.data}</Text>\n        </View>\n      </View>\n    );\n  },\n\n  _renderQuickActions: function({item}: Object): ?React.Element<any> {\n    return (\n      <View style={styles.actionsContainer}>\n        <TouchableHighlight\n          style={styles.actionButton}\n          onPress={() => {\n            Alert.alert(\n              'Tips',\n              'You could do something with this edit action!',\n            );\n          }}>\n          <Text style={styles.actionButtonText}>Edit</Text>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={[styles.actionButton, styles.actionButtonDestructive]}\n          onPress={() => {\n            Alert.alert(\n              'Tips',\n              'You could do something with this remove action!',\n            );\n          }}>\n          <Text style={styles.actionButtonText}>Remove</Text>\n        </TouchableHighlight>\n      </View>\n    );\n  },\n});\n\nvar styles = StyleSheet.create({\n  row: {\n    flexDirection: 'row',\n    justifyContent: 'center',\n    alignItems: 'center',\n    padding: 10,\n    backgroundColor: '#F6F6F6',\n  },\n  rowIcon: {\n    width: 64,\n    height: 64,\n    marginRight: 20,\n  },\n  rowData: {\n    flex: 1,\n  },\n  rowDataText: {\n    fontSize: 24,\n  },\n  actionsContainer: {\n    flex: 1,\n    flexDirection: 'row',\n    justifyContent: 'flex-end',\n    alignItems: 'center',\n  },\n  actionButton: {\n    padding: 10,\n    width: 80,\n    backgroundColor: '#999999',\n  },\n  actionButtonDestructive: {\n    backgroundColor: '#FF0000',\n  },\n  actionButtonText: {\n    textAlign: 'center',\n  },\n});\n\nmodule.exports = SwipeableFlatListExample;\n"
  },
  {
    "path": "RNTester/js/SwipeableListViewExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule SwipeableListViewExample\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  SwipeableListView,\n  TouchableHighlight,\n  StyleSheet,\n  Text,\n  View,\n  Alert,\n} = ReactNative;\n\nvar RNTesterPage = require('./RNTesterPage');\n\nvar SwipeableListViewSimpleExample = createReactClass({\n  displayName: 'SwipeableListViewSimpleExample',\n  statics: {\n    title: '<SwipeableListView>',\n    description: 'Performant, scrollable, swipeable list of data.'\n  },\n\n  getInitialState: function() {\n    var ds = SwipeableListView.getNewDataSource();\n    return {\n      dataSource: ds.cloneWithRowsAndSections(...this._genDataSource({})),\n    };\n  },\n\n  _pressData: ({}: {[key: number]: boolean}),\n\n  componentWillMount: function() {\n    this._pressData = {};\n  },\n\n  render: function() {\n    return (\n      <RNTesterPage\n        title={this.props.navigator ? null : '<SwipeableListView>'}\n        noSpacer={true}\n        noScroll={true}>\n        <SwipeableListView\n          dataSource={this.state.dataSource}\n          maxSwipeDistance={100}\n          renderQuickActions={\n            (rowData: Object, sectionID: string, rowID: string) => {\n            return (<View style={styles.actionsContainer}>\n              <TouchableHighlight onPress={() => {\n                Alert.alert('Tips', 'You could do something with this row: ' + rowData.text);\n              }}>\n                <Text>Remove</Text>\n              </TouchableHighlight>\n            </View>);\n          }}\n          renderRow={this._renderRow}\n          renderSeparator={this._renderSeperator}\n        />\n      </RNTesterPage>\n    );\n  },\n\n  _renderRow: function(rowData: Object, sectionID: number, rowID: number, highlightRow: (sectionID: number, rowID: number) => void) {\n    var rowHash = Math.abs(hashCode(rowData.id));\n    var imgSource = THUMB_URLS[rowHash % THUMB_URLS.length];\n    return (\n      <TouchableHighlight onPress={() => {}}>\n        <View>\n          <View style={styles.row}>\n            <Image style={styles.thumb} source={imgSource} />\n            <Text style={styles.text}>\n              {rowData.id + ' - ' + LOREM_IPSUM.substr(0, rowHash % 301 + 10)}\n            </Text>\n          </View>\n        </View>\n      </TouchableHighlight>\n    );\n  },\n\n  _genDataSource: function(pressData: {[key: number]: boolean}): Array<any> {\n    var dataBlob = {};\n    var sectionIDs = ['Section 0'];\n    var rowIDs = [[]];\n    /**\n     * dataBlob example below:\n      {\n        'Section 0': {\n          'Row 0': {\n            id: '0',\n            text: 'row 0 text'\n          },\n          'Row 1': {\n            id: '1',\n            text: 'row 1 text'\n          }\n        }\n      }\n    */\n    // only one section in this example\n    dataBlob['Section 0'] = {};\n    for (var ii = 0; ii < 100; ii++) {\n      var pressedText = pressData[ii] ? ' (pressed)' : '';\n      dataBlob[sectionIDs[0]]['Row ' + ii] = {id: 'Row ' + ii, text: 'Row ' + ii + pressedText};\n      rowIDs[0].push('Row ' + ii);\n    }\n    return [dataBlob, sectionIDs, rowIDs];\n  },\n\n  _renderSeperator: function(sectionID: number, rowID: number, adjacentRowHighlighted: bool) {\n    return (\n      <View\n        key={`${sectionID}-${rowID}`}\n        style={{\n          height: adjacentRowHighlighted ? 4 : 1,\n          backgroundColor: adjacentRowHighlighted ? '#3B5998' : '#CCCCCC',\n        }}\n      />\n    );\n  }\n});\n\nvar THUMB_URLS = [\n  require('./Thumbnails/like.png'),\n  require('./Thumbnails/dislike.png'),\n  require('./Thumbnails/call.png'),\n  require('./Thumbnails/fist.png'),\n  require('./Thumbnails/bandaged.png'),\n  require('./Thumbnails/flowers.png'),\n  require('./Thumbnails/heart.png'),\n  require('./Thumbnails/liking.png'),\n  require('./Thumbnails/party.png'),\n  require('./Thumbnails/poke.png'),\n  require('./Thumbnails/superlike.png'),\n  require('./Thumbnails/victory.png'),\n  ];\nvar LOREM_IPSUM = 'Lorem ipsum dolor sit amet, ius ad pertinax oportere accommodare, an vix civibus corrumpit referrentur. Te nam case ludus inciderint, te mea facilisi adipiscing. Sea id integre luptatum. In tota sale consequuntur nec. Erat ocurreret mei ei. Eu paulo sapientem vulputate est, vel an accusam intellegam interesset. Nam eu stet pericula reprimique, ea vim illud modus, putant invidunt reprehendunt ne qui.';\n\n/* eslint no-bitwise: 0 */\nvar hashCode = function(str) {\n  var hash = 15;\n  for (var ii = str.length - 1; ii >= 0; ii--) {\n    hash = ((hash << 5) - hash) + str.charCodeAt(ii);\n  }\n  return hash;\n};\n\nvar styles = StyleSheet.create({\n  row: {\n    flexDirection: 'row',\n    justifyContent: 'center',\n    padding: 10,\n    backgroundColor: '#F6F6F6',\n  },\n  thumb: {\n    width: 64,\n    height: 64,\n  },\n  text: {\n    flex: 1,\n  },\n  actionsContainer: {\n    flex: 1,\n    flexDirection: 'row',\n    justifyContent: 'flex-end',\n    alignItems: 'center',\n  },\n});\n\nmodule.exports = SwipeableListViewSimpleExample;\n"
  },
  {
    "path": "RNTester/js/SwitchExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule SwitchExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Platform,\n  Switch,\n  Text,\n  View\n} = ReactNative;\n\nclass BasicSwitchExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    trueSwitchIsOn: true,\n    falseSwitchIsOn: false,\n  };\n\n  render() {\n    return (\n      <View>\n        <Switch\n          onValueChange={(value) => this.setState({falseSwitchIsOn: value})}\n          style={{marginBottom: 10}}\n          value={this.state.falseSwitchIsOn} />\n        <Switch\n          onValueChange={(value) => this.setState({trueSwitchIsOn: value})}\n          value={this.state.trueSwitchIsOn} />\n      </View>\n    );\n  }\n}\n\nclass DisabledSwitchExample extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <Switch\n          disabled={true}\n          style={{marginBottom: 10}}\n          value={true} />\n        <Switch\n          disabled={true}\n          value={false} />\n      </View>\n    );\n  }\n}\n\nclass ColorSwitchExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    colorTrueSwitchIsOn: true,\n    colorFalseSwitchIsOn: false,\n  };\n\n  render() {\n    return (\n      <View>\n        <Switch\n          onValueChange={(value) => this.setState({colorFalseSwitchIsOn: value})}\n          onTintColor=\"#00ff00\"\n          style={{marginBottom: 10}}\n          thumbTintColor=\"#0000ff\"\n          tintColor=\"#ff0000\"\n          value={this.state.colorFalseSwitchIsOn} />\n        <Switch\n          onValueChange={(value) => this.setState({colorTrueSwitchIsOn: value})}\n          onTintColor=\"#00ff00\"\n          thumbTintColor=\"#0000ff\"\n          tintColor=\"#ff0000\"\n          value={this.state.colorTrueSwitchIsOn} />\n      </View>\n    );\n  }\n}\n\nclass EventSwitchExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    eventSwitchIsOn: false,\n    eventSwitchRegressionIsOn: true,\n  };\n\n  render() {\n    return (\n      <View style={{ flexDirection: 'row', justifyContent: 'space-around' }}>\n        <View>\n          <Switch\n            onValueChange={(value) => this.setState({eventSwitchIsOn: value})}\n            style={{marginBottom: 10}}\n            value={this.state.eventSwitchIsOn} />\n          <Switch\n            onValueChange={(value) => this.setState({eventSwitchIsOn: value})}\n            style={{marginBottom: 10}}\n            value={this.state.eventSwitchIsOn} />\n          <Text>{this.state.eventSwitchIsOn ? 'On' : 'Off'}</Text>\n        </View>\n        <View>\n          <Switch\n            onValueChange={(value) => this.setState({eventSwitchRegressionIsOn: value})}\n            style={{marginBottom: 10}}\n            value={this.state.eventSwitchRegressionIsOn} />\n          <Switch\n            onValueChange={(value) => this.setState({eventSwitchRegressionIsOn: value})}\n            style={{marginBottom: 10}}\n            value={this.state.eventSwitchRegressionIsOn} />\n          <Text>{this.state.eventSwitchRegressionIsOn ? 'On' : 'Off'}</Text>\n        </View>\n      </View>\n    );\n  }\n}\n\nvar examples = [\n  {\n    title: 'Switches can be set to true or false',\n    render(): React.Element<any> { return <BasicSwitchExample />; }\n  },\n  {\n    title: 'Switches can be disabled',\n    render(): React.Element<any> { return <DisabledSwitchExample />; }\n  },\n  {\n    title: 'Change events can be detected',\n    render(): React.Element<any> { return <EventSwitchExample />; }\n  },\n  {\n    title: 'Switches are controlled components',\n    render(): React.Element<any> { return <Switch />; }\n  },\n  {\n    title: 'Custom colors can be provided',\n    render(): React.Element<any> { return <ColorSwitchExample />; }\n  }\n];\n\nexports.title = '<Switch>';\nexports.displayName = 'SwitchExample';\nexports.description = 'Native boolean input';\nexports.examples = examples;\n"
  },
  {
    "path": "RNTester/js/TVEventHandlerExample.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TVEventHandlerExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\n\nvar {\n  Platform,\n  StyleSheet,\n  View,\n  Text,\n  TouchableOpacity,\n  TVEventHandler,\n} = ReactNative;\n\nexports.framework = 'React';\nexports.title = 'TVEventHandler example';\nexports.description = 'iOS alerts and action sheets';\nexports.examples = [{\n  title: 'TVEventHandler',\n  render() {return <TVEventHandlerView/>;}\n}];\n\nclass TVEventHandlerView extends React.Component<$FlowFixMeProps, {\n  lastEventType: string\n}> {\n  constructor(props) {\n    super(props);\n    this.state = {\n      lastEventType: ''\n    };\n  }\n\n  _tvEventHandler: any;\n\n  _enableTVEventHandler() {\n    this._tvEventHandler = new TVEventHandler();\n    this._tvEventHandler.enable(this, function(cmp, evt) {\n      cmp.setState({\n        lastEventType: evt.eventType\n      });\n    });\n  }\n\n  _disableTVEventHandler() {\n    if (this._tvEventHandler) {\n      this._tvEventHandler.disable();\n      delete this._tvEventHandler;\n    }\n  }\n\n  componentDidMount() {\n    this._enableTVEventHandler();\n  }\n\n  componentWillUnmount() {\n    this._disableTVEventHandler();\n  }\n\n  render() {\n\n    if (Platform.isTVOS) {\n      return (\n        <View>\n          <TouchableOpacity onPress={() => {}}>\n          <Text>\n            This example enables an instance of TVEventHandler to show the last event detected from the Apple TV Siri remote or from a keyboard.\n          </Text>\n          </TouchableOpacity>\n          <Text style={{color: 'blue'}}>\n            {this.state.lastEventType}\n          </Text>\n        </View>\n      );\n    } else {\n      return (\n        <View>\n          <Text>\n            This example is intended to be run on Apple TV.\n          </Text>\n        </View>\n      );\n    }\n  }\n}\n"
  },
  {
    "path": "RNTester/js/TabBarIOSBarStyleExample.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * The examples provided by Facebook are for non-commercial testing and\n * evaluation purposes only.\n *\n * Facebook reserves all rights not expressly granted.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL\n * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * @providesModule TabBarIOSBarStyleExample\n * @flow\n */\n\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  TabBarIOS,\n  Text,\n  View,\n} = ReactNative;\n\nvar base64Icon = '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==';\n\nclass TabBarIOSBarStyleExample extends React.Component<{}> {\n  static title = '<TabBarIOS> - Custom Bar Style';\n  static description = 'Tab-based navigation.';\n  static displayName = 'TabBarIOSBarStyleExample';\n\n  render() {\n    return (\n      <TabBarIOS barStyle=\"black\">\n        <TabBarIOS.Item\n          title=\"Tab\"\n          icon={{uri: base64Icon, scale: 3}}\n          selected>\n          <View style={styles.tabContent}>\n            <Text style={styles.tabText}>Single page</Text>\n          </View>\n        </TabBarIOS.Item>\n      </TabBarIOS>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  tabContent: {\n    flex: 1,\n    alignItems: 'center',\n  },\n  tabText: {\n    color: 'white',\n    margin: 50,\n  },\n});\n\nmodule.exports = TabBarIOSBarStyleExample;\n"
  },
  {
    "path": "RNTester/js/TabBarIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TabBarIOSExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  TabBarIOS,\n  Text,\n  View,\n} = ReactNative;\n\nvar base64Icon = '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==';\n\nclass TabBarExample extends React.Component<{}, $FlowFixMeState> {\n  static title = '<TabBarIOS>';\n  static description = 'Tab-based navigation.';\n  static displayName = 'TabBarExample';\n\n  state = {\n    selectedTab: 'redTab',\n    notifCount: 0,\n    presses: 0,\n  };\n\n  _renderContent = (color: string, pageText: string, num?: number) => {\n    return (\n      <View style={[styles.tabContent, {backgroundColor: color}]}>\n        <Text style={styles.tabText}>{pageText}</Text>\n        <Text style={styles.tabText}>{num} re-renders of the {pageText}</Text>\n      </View>\n    );\n  };\n\n  render() {\n    return (\n      <TabBarIOS\n        unselectedTintColor=\"yellow\"\n        tintColor=\"white\"\n        unselectedItemTintColor=\"red\"\n        barTintColor=\"darkslateblue\">\n        <TabBarIOS.Item\n          title=\"Blue Tab\"\n          icon={{uri: base64Icon, scale: 3}}\n          selected={this.state.selectedTab === 'blueTab'}\n          onPress={() => {\n            this.setState({\n              selectedTab: 'blueTab',\n            });\n          }}>\n          {this._renderContent('#414A8C', 'Blue Tab')}\n        </TabBarIOS.Item>\n        <TabBarIOS.Item\n          systemIcon=\"history\"\n          badge={this.state.notifCount > 0 ? this.state.notifCount : undefined}\n          badgeColor=\"black\"\n          selected={this.state.selectedTab === 'redTab'}\n          onPress={() => {\n            this.setState({\n              selectedTab: 'redTab',\n              notifCount: this.state.notifCount + 1,\n            });\n          }}>\n          {this._renderContent('#783E33', 'Red Tab', this.state.notifCount)}\n        </TabBarIOS.Item>\n        <TabBarIOS.Item\n          icon={require('./flux.png')}\n          selectedIcon={require('./relay.png')}\n          renderAsOriginal\n          title=\"More\"\n          selected={this.state.selectedTab === 'greenTab'}\n          onPress={() => {\n            this.setState({\n              selectedTab: 'greenTab',\n              presses: this.state.presses + 1\n            });\n          }}>\n          {this._renderContent('#21551C', 'Green Tab', this.state.presses)}\n        </TabBarIOS.Item>\n      </TabBarIOS>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  tabContent: {\n    flex: 1,\n    alignItems: 'center',\n  },\n  tabText: {\n    color: 'white',\n    margin: 50,\n  },\n});\n\nmodule.exports = TabBarExample;\n"
  },
  {
    "path": "RNTester/js/TextExample.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TextExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\nvar RNTesterBlock = require('./RNTesterBlock');\nvar RNTesterPage = require('./RNTesterPage');\n\nclass Entity extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <Text style={{fontWeight: 'bold', color: '#527fe4'}}>\n        {this.props.children}\n      </Text>\n    );\n  }\n}\n\nclass AttributeToggler extends React.Component<{}, $FlowFixMeState> {\n  state = {fontWeight: 'bold', fontSize: 15};\n\n  toggleWeight = () => {\n    this.setState({\n      fontWeight: this.state.fontWeight === 'bold' ? 'normal' : 'bold'\n    });\n  };\n\n  increaseSize = () => {\n    this.setState({\n      fontSize: this.state.fontSize + 1\n    });\n  };\n\n  render() {\n    var curStyle = {fontWeight: this.state.fontWeight, fontSize: this.state.fontSize};\n    return (\n      <View>\n        <Text style={curStyle}>\n          Tap the controls below to change attributes.\n        </Text>\n        <Text>\n          <Text>See how it will even work on <Text style={curStyle}>this nested text</Text></Text>\n        </Text>\n        <Text>\n          <Text onPress={this.toggleWeight}>Toggle Weight</Text>\n          {' (with highlight onPress)'}\n        </Text>\n        <Text onPress={this.increaseSize} suppressHighlighting={true}>\n          Increase Size (suppressHighlighting true)\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass TextExample extends React.Component<{}> {\n  static title = '<Text>';\n  static description = 'Base component for rendering styled text.';\n\n  render() {\n    return (\n      <RNTesterPage title=\"<Text>\">\n        <RNTesterBlock title=\"Wrap\">\n          <Text>\n            The text should wrap if it goes on multiple lines.\n            See, this is going to the next line.\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Padding\">\n          <Text style={{padding: 10}}>\n            This text is indented by 10px padding on all sides.\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Font Family\">\n          <Text style={{fontFamily: 'sans-serif'}}>\n            Sans-Serif\n          </Text>\n          <Text style={{fontFamily: 'sans-serif', fontWeight: 'bold'}}>\n            Sans-Serif Bold\n          </Text>\n          <Text style={{fontFamily: 'serif'}}>\n            Serif\n          </Text>\n          <Text style={{fontFamily: 'serif', fontWeight: 'bold'}}>\n            Serif Bold\n          </Text>\n          <Text style={{fontFamily: 'monospace'}}>\n            Monospace\n          </Text>\n          <Text style={{fontFamily: 'monospace', fontWeight: 'bold'}}>\n            Monospace Bold (After 5.0)\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Android Material Design fonts\">\n          <View style={{flexDirection: 'row', alignItems: 'flex-start'}}>\n            <View style={{flex: 1}}>\n              <Text style={{fontFamily: 'sans-serif'}}>\n                Roboto Regular\n              </Text>\n              <Text style={{fontFamily: 'sans-serif', fontStyle: 'italic'}}>\n                Roboto Italic\n              </Text>\n              <Text style={{fontFamily: 'sans-serif', fontWeight: 'bold'}}>\n                Roboto Bold\n              </Text>\n              <Text style={{fontFamily: 'sans-serif', fontStyle: 'italic', fontWeight: 'bold'}}>\n                Roboto Bold Italic\n              </Text>\n              <Text style={{fontFamily: 'sans-serif-light'}}>\n                Roboto Light\n              </Text>\n              <Text style={{fontFamily: 'sans-serif-light', fontStyle: 'italic'}}>\n                Roboto Light Italic\n              </Text>\n              <Text style={{fontFamily: 'sans-serif-thin'}}>\n                Roboto Thin (After 4.2)\n              </Text>\n              <Text style={{fontFamily: 'sans-serif-thin', fontStyle: 'italic'}}>\n                Roboto Thin Italic (After 4.2)\n              </Text>\n              <Text style={{fontFamily: 'sans-serif-condensed'}}>\n                Roboto Condensed\n              </Text>\n              <Text style={{fontFamily: 'sans-serif-condensed', fontStyle: 'italic'}}>\n                Roboto Condensed Italic\n              </Text>\n              <Text style={{fontFamily: 'sans-serif-condensed', fontWeight: 'bold'}}>\n                Roboto Condensed Bold\n              </Text>\n              <Text style={{\n                  fontFamily: 'sans-serif-condensed',\n                  fontStyle: 'italic',\n                  fontWeight: 'bold'}}>\n                Roboto Condensed Bold Italic\n              </Text>\n              <Text style={{fontFamily: 'sans-serif-medium'}}>\n                Roboto Medium (After 5.0)\n              </Text>\n              <Text style={{fontFamily: 'sans-serif-medium', fontStyle: 'italic'}}>\n                Roboto Medium Italic (After 5.0)\n              </Text>\n            </View>\n          </View>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Custom Fonts\">\n          <View style={{flexDirection: 'row', alignItems: 'flex-start'}}>\n            <View style={{flex: 1}}>\n              <Text style={{fontFamily: 'notoserif'}}>\n                NotoSerif Regular\n              </Text>\n              <Text style={{fontFamily: 'notoserif', fontStyle: 'italic', fontWeight: 'bold'}}>\n                NotoSerif Bold Italic\n              </Text>\n              <Text style={{fontFamily: 'notoserif', fontStyle: 'italic'}}>\n                NotoSerif Italic (Missing Font file)\n              </Text>\n            </View>\n          </View>\n        </RNTesterBlock>\n\n        <RNTesterBlock title=\"Font Size\">\n          <Text style={{fontSize: 23}}>\n            Size 23\n          </Text>\n          <Text style={{fontSize: 8}}>\n            Size 8\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Color\">\n          <Text style={{color: 'red'}}>\n            Red color\n          </Text>\n          <Text style={{color: 'blue'}}>\n            Blue color\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Font Weight\">\n          <Text style={{fontWeight: 'bold'}}>\n            Move fast and be bold\n          </Text>\n          <Text style={{fontWeight: 'normal'}}>\n            Move fast and be bold\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Font Style\">\n          <Text style={{fontStyle: 'italic'}}>\n            Move fast and be bold\n          </Text>\n          <Text style={{fontStyle: 'normal'}}>\n            Move fast and be bold\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Font Style and Weight\">\n          <Text style={{fontStyle: 'italic', fontWeight: 'bold'}}>\n            Move fast and be bold\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Text Decoration\">\n          <Text style={{textDecorationLine: 'underline'}}>\n            Solid underline\n          </Text>\n          <Text style={{textDecorationLine: 'none'}}>\n            None textDecoration\n          </Text>\n          <Text style={{textDecorationLine: 'line-through', textDecorationStyle: 'solid'}}>\n            Solid line-through\n          </Text>\n          <Text style={{textDecorationLine: 'underline line-through'}}>\n            Both underline and line-through\n          </Text>\n          <Text>\n            Mixed text with <Text style={{textDecorationLine: 'underline'}}>underline</Text> and <Text style={{textDecorationLine: 'line-through'}}>line-through</Text> text nodes\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Nested\">\n          <Text onPress={() => console.log('1st')}>\n            (Normal text,\n            <Text style={{color: 'red', fontWeight: 'bold'}}>\n              (R)red\n              <Text style={{color: 'green', fontWeight: 'normal'}}>\n                (G)green\n                <Text style={{color: 'blue', fontWeight: 'bold'}}>\n                  (B)blue\n                  <Text style={{color: 'cyan', fontWeight: 'normal'}}>\n                    (C)cyan\n                    <Text style={{color: 'magenta', fontWeight: 'bold'}}>\n                      (M)magenta\n                      <Text style={{color: 'yellow', fontWeight: 'normal'}}>\n                        (Y)yellow\n                        <Text style={{color: 'black', fontWeight: 'bold'}}>\n                          (K)black\n                        </Text>\n                      </Text>\n                    </Text>\n                  </Text>\n                </Text>\n              </Text>\n            </Text>\n            <Text style={{fontWeight: 'bold'}} onPress={() => console.log('2nd')}>\n              (and bold\n              <Text style={{fontStyle: 'italic', fontSize: 11, color: '#527fe4'}} onPress={() => console.log('3rd')}>\n                (and tiny bold italic blue\n                <Text style={{fontWeight: 'normal', fontStyle: 'normal'}} onPress={() => console.log('4th')}>\n                  (and tiny normal blue)\n                </Text>\n                )\n              </Text>\n              )\n            </Text>\n            )\n          </Text>\n          <Text style={{fontFamily: 'serif'}} onPress={() => console.log('1st')}>\n            (Serif\n            <Text style={{fontStyle: 'italic', fontWeight: 'bold'}} onPress={() => console.log('2nd')}>\n              (Serif Bold Italic\n              <Text\n                style={{fontFamily: 'monospace', fontStyle: 'normal', fontWeight: 'normal'}}\n                onPress={() => console.log('3rd')}>\n                (Monospace Normal\n                <Text\n                  style={{fontFamily: 'sans-serif', fontWeight: 'bold'}}\n                  onPress={() => console.log('4th')}>\n                  (Sans-Serif Bold\n                  <Text style={{fontWeight: 'normal'}} onPress={() => console.log('5th')}>\n                    (and Sans-Serif Normal)\n                  </Text>\n                  )\n                </Text>\n                )\n              </Text>\n              )\n            </Text>\n            )\n          </Text>\n          <Text style={{fontSize: 12}}>\n            <Entity>Entity Name</Entity>\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Text Align\">\n          <Text>\n            auto (default) - english LTR\n          </Text>\n          <Text>\n            أحب اللغة العربية auto (default) - arabic RTL\n          </Text>\n          <Text style={{textAlign: 'left'}}>\n            left left left left left left left left left left left left left left left\n          </Text>\n          <Text style={{textAlign: 'center'}}>\n            center center center center center center center center center center center\n          </Text>\n          <Text style={{textAlign: 'right'}}>\n            right right right right right right right right right right right right right\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Unicode\">\n          <View>\n            <View style={{flexDirection: 'row'}}>\n              <Text style={{backgroundColor: 'red'}}>\n                星际争霸是世界上最好的游戏。\n              </Text>\n            </View>\n            <View>\n              <Text style={{backgroundColor: 'red'}}>\n                星际争霸是世界上最好的游戏。\n              </Text>\n            </View>\n            <View style={{alignItems: 'center'}}>\n              <Text style={{backgroundColor: 'red'}}>\n                星际争霸是世界上最好的游戏。\n              </Text>\n            </View>\n            <View>\n              <Text style={{backgroundColor: 'red'}}>\n                星际争霸是世界上最好的游戏。星际争霸是世界上最好的游戏。星际争霸是世界上最好的游戏。星际争霸是世界上最好的游戏。\n              </Text>\n            </View>\n          </View>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Spaces\">\n          <Text>\n            A {'generated'} {' '} {'string'} and    some &nbsp;&nbsp;&nbsp; spaces\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Line Height\">\n          <Text style={{lineHeight: 35}}>\n            Holisticly formulate inexpensive ideas before best-of-breed benefits. <Text style={{fontSize: 20}}>Continually</Text> expedite magnetic potentialities rather than client-focused interfaces.\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Empty Text\">\n          <Text />\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toggling Attributes\">\n          <AttributeToggler />\n        </RNTesterBlock>\n        <RNTesterBlock title=\"backgroundColor attribute\">\n          <Text style={{backgroundColor: '#ffaaaa'}}>\n            Red background,\n            <Text style={{backgroundColor: '#aaaaff'}}>\n              {' '}blue background,\n              <Text>\n                {' '}inherited blue background,\n                <Text style={{backgroundColor: '#aaffaa'}}>\n                  {' '}nested green background.\n                </Text>\n              </Text>\n            </Text>\n          </Text>\n          <Text style={{backgroundColor: 'rgba(100, 100, 100, 0.3)'}}>\n            Same alpha as background,\n            <Text>\n              Inherited alpha from background,\n              <Text style={{backgroundColor: 'rgba(100, 100, 100, 0.3)'}}>\n                Reapply alpha\n              </Text>\n            </Text>\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"containerBackgroundColor attribute\">\n          <View style={{flexDirection: 'row', height: 85}}>\n            <View style={{backgroundColor: '#ffaaaa', width: 150}} />\n            <View style={{backgroundColor: '#aaaaff', width: 150}} />\n          </View>\n          <Text style={[styles.backgroundColorText, {top: -80}]}>\n            Default containerBackgroundColor (inherited) + backgroundColor wash\n          </Text>\n          <Text style={[styles.backgroundColorText, {top: -70, backgroundColor: 'transparent'}]}>\n            {\"containerBackgroundColor: 'transparent' + backgroundColor wash\"}\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"numberOfLines attribute\">\n          <Text numberOfLines={1}>\n            Maximum of one line no matter now much I write here. If I keep writing it{\"'\"}ll just truncate after one line\n          </Text>\n          <Text numberOfLines={2} style={{marginTop: 20}}>\n            Maximum of two lines no matter now much I write here. If I keep writing it{\"'\"}ll just truncate after two lines\n          </Text>\n          <Text style={{marginTop: 20}}>\n            No maximum lines specified no matter now much I write here. If I keep writing it{\"'\"}ll just keep going and going\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"selectable attribute\">\n          <Text selectable>\n            This text is selectable if you click-and-hold, and will offer the native Android selection menus.\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"selectionColor attribute\">\n          <Text selectable selectionColor=\"orange\">\n            This text will have a orange highlight on selection.\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Inline images\">\n          <Text>\n            This text contains an inline image <Image source={require('./flux.png')}/>. Neat, huh?\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Text shadow\">\n          <Text style={{fontSize: 20, textShadowOffset: {width: 2, height: 2}, textShadowRadius: 1, textShadowColor: '#00cccc'}}>\n            Demo text shadow\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Ellipsize mode\">\n          <Text numberOfLines={1}>\n            This very long text should be truncated with dots in the end.\n          </Text>\n          <Text ellipsizeMode=\"middle\" numberOfLines={1}>\n            This very long text should be truncated with dots in the middle.\n          </Text>\n          <Text ellipsizeMode=\"head\" numberOfLines={1}>\n            This very long text should be truncated with dots in the beginning.\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Include Font Padding\">\n          <View style={{flexDirection: 'row', justifyContent: 'space-around', marginBottom: 10}}>\n            <View style={{alignItems: 'center'}}>\n              <Text style={styles.includeFontPaddingText}>\n                Ey\n              </Text>\n              <Text>Default</Text>\n            </View>\n            <View style={{alignItems: 'center'}}>\n              <Text style={[styles.includeFontPaddingText, {includeFontPadding: false, marginLeft: 10}]}>\n                Ey\n              </Text>\n              <Text>includeFontPadding: false</Text>\n            </View>\n          </View>\n          <Text>By default Android will put extra space above text to allow for upper-case accents or other ascenders. With some fonts, this can make text look slightly misaligned when centered vertically.</Text>\n        </RNTesterBlock>\n      </RNTesterPage>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  backgroundColorText: {\n    left: 5,\n    backgroundColor: 'rgba(100, 100, 100, 0.3)'\n  },\n  includeFontPaddingText: {\n    fontSize: 120,\n    fontFamily: 'sans-serif',\n    backgroundColor: '#EEEEEE',\n    color: '#000000',\n    textAlignVertical: 'center',\n    alignSelf: 'center',\n  }\n});\n\nmodule.exports = TextExample;\n"
  },
  {
    "path": "RNTester/js/TextExample.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TextExample\n */\n'use strict';\n\nconst Platform = require('Platform');\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\nvar {Image, Text, View, LayoutAnimation, Button} = ReactNative;\n\ntype TextAlignExampleRTLState = {|\n  isRTL: boolean,\n|};\n\nclass TextAlignRTLExample extends React.Component<*, TextAlignExampleRTLState> {\n  constructor(...args: Array<*>) {\n    super(...args);\n\n    this.state = {\n      isRTL: false,\n    };\n  }\n\n  render() {\n    const {isRTL} = this.state;\n    const toggleRTL = () => this.setState({isRTL: !isRTL});\n    return (\n      <View style={{direction: isRTL ? 'rtl' : 'ltr'}}>\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 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\n          right 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\n          last one span the available width of the parent container.\n        </Text>\n        <Button\n          onPress={toggleRTL}\n          title={`Switch to ${isRTL ? 'LTR' : 'RTL'}`}\n        />\n      </View>\n    );\n  }\n}\n\nclass Entity extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <Text style={{fontWeight: '500', color: '#527fe4'}}>\n        {this.props.children}\n      </Text>\n    );\n  }\n}\n\nclass AttributeToggler extends React.Component<{}, $FlowFixMeState> {\n  state = {fontWeight: 'bold', fontSize: 15};\n\n  toggleWeight = () => {\n    this.setState({\n      fontWeight: this.state.fontWeight === 'bold' ? 'normal' : 'bold',\n    });\n  };\n\n  increaseSize = () => {\n    this.setState({\n      fontSize: this.state.fontSize + 1,\n    });\n  };\n\n  render() {\n    var curStyle = {\n      fontWeight: this.state.fontWeight,\n      fontSize: this.state.fontSize,\n    };\n    return (\n      <View>\n        <Text style={curStyle}>\n          Tap the controls below to change attributes.\n        </Text>\n        <Text>\n          <Text>\n            See how it will even work on{' '}\n            <Text style={curStyle}>this nested text</Text>\n          </Text>\n        </Text>\n        <Text\n          style={{backgroundColor: '#ffaaaa', marginTop: 5}}\n          onPress={this.toggleWeight}>\n          Toggle Weight\n        </Text>\n        <Text\n          style={{backgroundColor: '#aaaaff', marginTop: 5}}\n          onPress={this.increaseSize}>\n          Increase Size\n        </Text>\n      </View>\n    );\n  }\n}\n\nvar AdjustingFontSize = createReactClass({\n  displayName: 'AdjustingFontSize',\n  getInitialState: function() {\n    return {dynamicText: '', shouldRender: true};\n  },\n  reset: function() {\n    LayoutAnimation.easeInEaseOut();\n    this.setState({\n      shouldRender: false,\n    });\n    setTimeout(() => {\n      LayoutAnimation.easeInEaseOut();\n      this.setState({\n        dynamicText: '',\n        shouldRender: true,\n      });\n    }, 300);\n  },\n  addText: function() {\n    this.setState({\n      dynamicText:\n        this.state.dynamicText +\n        (Math.floor((Math.random() * 10) % 2) ? ' foo' : ' bar'),\n    });\n  },\n  removeText: function() {\n    this.setState({\n      dynamicText: this.state.dynamicText.slice(\n        0,\n        this.state.dynamicText.length - 4,\n      ),\n    });\n  },\n  render: function() {\n    if (!this.state.shouldRender) {\n      return <View />;\n    }\n    return (\n      <View>\n        <Text\n          ellipsizeMode=\"tail\"\n          numberOfLines={1}\n          style={{fontSize: 36, marginVertical: 6}}>\n          Truncated text is baaaaad.\n        </Text>\n        <Text\n          numberOfLines={1}\n          adjustsFontSizeToFit={true}\n          style={{fontSize: 40, marginVertical: 6}}>\n          Shrinking to fit available space is much better!\n        </Text>\n\n        <Text\n          adjustsFontSizeToFit={true}\n          numberOfLines={1}\n          style={{fontSize: 30, marginVertical: 6}}>\n          {'Add text to me to watch me shrink!' + ' ' + this.state.dynamicText}\n        </Text>\n\n        <Text\n          adjustsFontSizeToFit={true}\n          numberOfLines={4}\n          style={{fontSize: 20, marginVertical: 6}}>\n          {'Multiline text component shrinking is supported, watch as this reeeeaaaally loooooong teeeeeeext grooooows and then shriiiinks as you add text to me! ioahsdia soady auydoa aoisyd aosdy ' +\n            ' ' +\n            this.state.dynamicText}\n        </Text>\n\n        <Text\n          adjustsFontSizeToFit={true}\n          numberOfLines={1}\n          style={{marginVertical: 6}}>\n          <Text style={{fontSize: 14}}>\n            {'Differently sized nested elements will shrink together. '}\n          </Text>\n          <Text style={{fontSize: 20}}>\n            {'LARGE TEXT! ' + this.state.dynamicText}\n          </Text>\n        </Text>\n\n        <View\n          style={{\n            flexDirection: 'row',\n            justifyContent: 'space-around',\n            marginTop: 5,\n            marginVertical: 6,\n          }}>\n          <Text style={{backgroundColor: '#ffaaaa'}} onPress={this.reset}>\n            Reset\n          </Text>\n          <Text style={{backgroundColor: '#aaaaff'}} onPress={this.removeText}>\n            Remove Text\n          </Text>\n          <Text style={{backgroundColor: '#aaffaa'}} onPress={this.addText}>\n            Add Text\n          </Text>\n        </View>\n      </View>\n    );\n  },\n});\n\nexports.title = '<Text>';\nexports.description = 'Base component for rendering styled text.';\nexports.displayName = 'TextExample';\nexports.examples = [\n  {\n    title: 'Wrap',\n    render: function() {\n      return (\n        <Text>\n          The text should wrap if it goes on multiple lines. See, this is going\n          to the next line.\n        </Text>\n      );\n    },\n  },\n  {\n    title: 'Padding',\n    render: function() {\n      return (\n        <Text style={{padding: 10}}>\n          This text is indented by 10px padding on all sides.\n        </Text>\n      );\n    },\n  },\n  {\n    title: 'Font Family',\n    render: function() {\n      return (\n        <View>\n          <Text style={{fontFamily: Platform.isTVOS ? 'Times' : 'Cochin'}}>\n            Cochin\n          </Text>\n          <Text\n            style={{\n              fontFamily: Platform.isTVOS ? 'Times' : 'Cochin',\n              fontWeight: 'bold',\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: Platform.isTVOS ? 'Courier' : 'Verdana'}}>\n            Verdana\n          </Text>\n          <Text\n            style={{\n              fontFamily: Platform.isTVOS ? 'Courier' : 'Verdana',\n              fontWeight: 'bold',\n            }}>\n            Verdana bold\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Font Size',\n    render: function() {\n      return (\n        <View>\n          <Text style={{fontSize: 23}}>Size 23</Text>\n          <Text style={{fontSize: 8}}>Size 8</Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Color',\n    render: function() {\n      return (\n        <View>\n          <Text style={{color: 'red'}}>Red color</Text>\n          <Text style={{color: 'blue'}}>Blue color</Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Font Weight',\n    render: function() {\n      return (\n        <View>\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  },\n  {\n    title: 'Font Style',\n    render: function() {\n      return (\n        <View>\n          <Text style={{fontStyle: 'normal'}}>Normal text</Text>\n          <Text style={{fontStyle: 'italic'}}>Italic text</Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Selectable',\n    render: function() {\n      return (\n        <View>\n          <Text selectable={true}>\n            This text is <Text style={{fontWeight: 'bold'}}>selectable</Text> if\n            you click-and-hold.\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Text Decoration',\n    render: function() {\n      return (\n        <View>\n          <Text\n            style={{\n              textDecorationLine: 'underline',\n              textDecorationStyle: 'solid',\n            }}>\n            Solid underline\n          </Text>\n          <Text\n            style={{\n              textDecorationLine: 'underline',\n              textDecorationStyle: 'double',\n              textDecorationColor: '#ff0000',\n            }}>\n            Double underline with custom color\n          </Text>\n          <Text\n            style={{\n              textDecorationLine: 'underline',\n              textDecorationStyle: 'dashed',\n              textDecorationColor: '#9CDC40',\n            }}>\n            Dashed underline with custom color\n          </Text>\n          <Text\n            style={{\n              textDecorationLine: 'underline',\n              textDecorationStyle: 'dotted',\n              textDecorationColor: 'blue',\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            Solid line-through\n          </Text>\n          <Text\n            style={{\n              textDecorationLine: 'line-through',\n              textDecorationStyle: 'double',\n              textDecorationColor: '#ff0000',\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            Dashed line-through with custom color\n          </Text>\n          <Text\n            style={{\n              textDecorationLine: 'line-through',\n              textDecorationStyle: 'dotted',\n              textDecorationColor: 'blue',\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  },\n  {\n    title: 'Nested',\n    description:\n      'Nested text components will inherit the styles of their ' +\n      'parents (only backgroundColor is inherited from non-Text parents).  ' +\n      '<Text> only supports other <Text> and raw text (strings) as children.',\n    render: function() {\n      return (\n        <View>\n          <Text>\n            (Normal text,\n            <Text style={{fontWeight: 'bold'}}>\n              (and bold\n              <Text style={{fontSize: 11, color: '#527fe4'}}>\n                (and tiny inherited bold blue)\n              </Text>\n              )\n            </Text>\n            )\n          </Text>\n          <Text style={{opacity: 0.7}}>\n            (opacity\n            <Text>\n              (is inherited\n              <Text style={{opacity: 0.7}}>\n                (and accumulated\n                <Text style={{backgroundColor: '#ffaaaa'}}>\n                  (and also applies to the background)\n                </Text>\n                )\n              </Text>\n              )\n            </Text>\n            )\n          </Text>\n          <Text style={{fontSize: 12}}>\n            <Entity>Entity Name</Entity>\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Text Align',\n    render: function() {\n      return (\n        <View>\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\n            left left\n          </Text>\n          <Text style={{textAlign: 'center'}}>\n            center center center center center center center center center\n            center center\n          </Text>\n          <Text style={{textAlign: 'right'}}>\n            right right right right right right right right right right right\n            right 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\n            last one span the available width of the parent container.\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Letter Spacing',\n    render: function() {\n      return (\n        <View>\n          <Text style={{letterSpacing: 0}}>letterSpacing = 0</Text>\n          <Text style={{letterSpacing: 2, marginTop: 5}}>\n            letterSpacing = 2\n          </Text>\n          <Text style={{letterSpacing: 9, marginTop: 5}}>\n            letterSpacing = 9\n          </Text>\n          <Text style={{letterSpacing: -1, marginTop: 5}}>\n            letterSpacing = -1\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Spaces',\n    render: function() {\n      return (\n        <Text>\n          A {'generated'} {' '} {'string'} and    some &nbsp;&nbsp;&nbsp; spaces\n        </Text>\n      );\n    },\n  },\n  {\n    title: 'Line Height',\n    render: function() {\n      return (\n        <Text>\n          <Text style={{lineHeight: 35}}>\n            A lot of space between the lines of this long passage that should\n            wrap once.\n          </Text>\n        </Text>\n      );\n    },\n  },\n  {\n    title: 'Empty Text',\n    description: \"It's ok to have Text with zero or null children.\",\n    render: function() {\n      return <Text />;\n    },\n  },\n  {\n    title: 'Toggling Attributes',\n    render: function(): React.Element<any> {\n      return <AttributeToggler />;\n    },\n  },\n  {\n    title: 'backgroundColor attribute',\n    description: 'backgroundColor is inherited from all types of views.',\n    render: function() {\n      return (\n        <Text style={{backgroundColor: 'yellow'}}>\n          Yellow container background,\n          <Text style={{backgroundColor: '#ffaaaa'}}>\n            {' '}\n            red background,\n            <Text style={{backgroundColor: '#aaaaff'}}>\n              {' '}\n              blue background,\n              <Text>\n                {' '}\n                inherited blue background,\n                <Text style={{backgroundColor: '#aaffaa'}}>\n                  {' '}\n                  nested green background.\n                </Text>\n              </Text>\n            </Text>\n          </Text>\n        </Text>\n      );\n    },\n  },\n  {\n    title: 'numberOfLines attribute',\n    render: function() {\n      return (\n        <View>\n          <Text numberOfLines={1}>\n            Maximum of one line, no matter how much I write here. If I keep\n            writing, it{\"'\"}ll just truncate after one line.\n          </Text>\n          <Text numberOfLines={2} style={{marginTop: 20}}>\n            Maximum of two lines, no matter how much I write here. If I keep\n            writing, it{\"'\"}ll just truncate after two lines.\n          </Text>\n          <Text style={{marginTop: 20}}>\n            No maximum lines specified, no matter how much I write here. If I\n            keep writing, it{\"'\"}ll just keep going and going.\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Text highlighting (tap the link to see highlight)',\n    render: function() {\n      return (\n        <View>\n          <Text>\n            Lorem ipsum dolor sit amet,{' '}\n            <Text\n              suppressHighlighting={false}\n              style={{\n                backgroundColor: 'white',\n                textDecorationLine: 'underline',\n                color: 'blue',\n              }}\n              onPress={() => null}>\n              consectetur adipiscing elit, sed do eiusmod tempor incididunt ut\n              labore et dolore magna aliqua. Ut enim ad minim veniam, quis\n              nostrud\n            </Text>{' '}\n            exercitation ullamco laboris nisi ut aliquip ex ea commodo\n            consequat.\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'allowFontScaling attribute',\n    render: function() {\n      return (\n        <View>\n          <Text>\n            By default, text will respect Text Size accessibility setting on\n            iOS. It means that all font sizes will be increased or descreased\n            depending on the value of Text Size setting in{' '}\n            <Text style={{fontWeight: 'bold'}}>\n              Settings.app - Display & Brightness - Text Size\n            </Text>\n          </Text>\n          <Text style={{marginTop: 10}}>\n            You can disable scaling for your Text component by passing {'\"'}allowFontScaling={'{'}false{'}\"'}{' '}\n            prop.\n          </Text>\n          <Text allowFontScaling={false} style={{marginTop: 20}}>\n            This text will not scale.\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Inline views',\n    render: function() {\n      return (\n        <View>\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              source={require('./flux.png')}\n              style={{width: 30, height: 11, resizeMode: 'cover'}}\n            />. Neat, huh?\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Text shadow',\n    render: function() {\n      return (\n        <View>\n          <Text\n            style={{\n              fontSize: 20,\n              textShadowOffset: {width: 2, height: 2},\n              textShadowRadius: 1,\n              textShadowColor: '#00cccc',\n            }}>\n            Demo text shadow\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Ellipsize mode',\n    render: function() {\n      return (\n        <View>\n          <Text numberOfLines={1}>\n            This very long text should be truncated with dots in the end.\n          </Text>\n          <Text ellipsizeMode=\"middle\" numberOfLines={1}>\n            This very long text should be truncated with dots in the middle.\n          </Text>\n          <Text ellipsizeMode=\"head\" numberOfLines={1}>\n            This very long text should be truncated with dots in the beginning.\n          </Text>\n          <Text ellipsizeMode=\"clip\" numberOfLines={1}>\n            This very looooooooooooooooooooooooooooong text should be clipped.\n          </Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Font variants',\n    render: function() {\n      return (\n        <View>\n          <Text style={{fontVariant: ['small-caps']}}>Small Caps{'\\n'}</Text>\n          <Text\n            style={{\n              fontFamily: Platform.isTVOS ? 'Times' : 'Hoefler Text',\n              fontVariant: ['oldstyle-nums'],\n            }}>\n            Old Style nums 0123456789{'\\n'}\n          </Text>\n          <Text\n            style={{\n              fontFamily: Platform.isTVOS ? 'Times' : 'Hoefler Text',\n              fontVariant: ['lining-nums'],\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  },\n  {\n    title: 'Dynamic Font Size Adjustment',\n    render: function(): React.Element<any> {\n      return <AdjustingFontSize />;\n    },\n  },\n  {\n    title: 'Text Align with RTL',\n    render: function() {\n      return <TextAlignRTLExample />;\n    },\n  },\n];\n"
  },
  {
    "path": "RNTester/js/TextExample.macos.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * The examples provided by Facebook are for non-commercial testing and\n * evaluation purposes only.\n *\n * Facebook reserves all rights not expressly granted.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL\n * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * @flow\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nclass Entity extends React.Component {\n  render() {\n    return (\n      <Text style={{fontWeight: '500', color: '#527fe4'}}>\n        {this.props.children}\n      </Text>\n    );\n  }\n}\n\nclass AttributeToggler extends React.Component {\n  state = {fontWeight: 'bold', fontSize: 15};\n\n  toggleWeight = () => {\n    this.setState({\n      fontWeight: this.state.fontWeight === 'bold' ? 'normal' : 'bold'\n    });\n  };\n\n  increaseSize = () => {\n    this.setState({\n      fontSize: this.state.fontSize + 1\n    });\n  };\n\n  render() {\n    var curStyle = {fontWeight: this.state.fontWeight, fontSize: this.state.fontSize};\n    return (\n      <View>\n        <Text style={curStyle}>\n          Tap the controls below to change attributes.\n        </Text>\n        <Text>\n          <Text>See how it will even work on <Text style={curStyle}>this nested text</Text></Text>\n        </Text>\n        <Text\n          style={{backgroundColor: '#ffaaaa', marginTop: 5}}\n          onPress={this.toggleWeight}>\n          Toggle Weight\n        </Text>\n        <Text\n          style={{backgroundColor: '#aaaaff', marginTop: 5}}\n          onPress={this.increaseSize}>\n          Increase Size\n        </Text>\n      </View>\n    );\n  }\n}\n\nexports.title = '<Text>';\nexports.description = 'Base component for rendering styled text.';\nexports.displayName = 'TextExample';\nexports.examples = [\n{\n  title: 'Wrap',\n  render: function() {\n    return (\n      <Text>\n        The text should wrap if it goes on multiple lines. See, this is going to\n        the next line.\n      </Text>\n    );\n  },\n}, {\n  title: 'Padding',\n  render: function() {\n    return (\n      <Text style={{padding: 10}}>\n        This text is indented by 10px padding on all sides.\n      </Text>\n    );\n  },\n}, {\n  title: 'Font Family',\n  render: function() {\n    return (\n      <View>\n        <Text style={{fontFamily: 'Cochin'}}>\n          Cochin\n        </Text>\n        <Text style={{fontFamily: 'Cochin', fontWeight: 'bold'}}>\n          Cochin bold\n        </Text>\n        <Text style={{fontFamily: 'Helvetica'}}>\n          Helvetica\n        </Text>\n        <Text style={{fontFamily: 'Helvetica', fontWeight: 'bold'}}>\n          Helvetica bold\n        </Text>\n        <Text style={{fontFamily: 'Verdana'}}>\n          Verdana\n        </Text>\n        <Text style={{fontFamily: 'Verdana', fontWeight: 'bold'}}>\n          Verdana bold\n        </Text>\n      </View>\n    );\n  },\n}, {\n  title: 'Font Size',\n  render: function() {\n    return (\n      <View>\n        <Text style={{fontSize: 23}}>\n          Size 23\n        </Text>\n        <Text style={{fontSize: 8}}>\n          Size 8\n        </Text>\n      </View>\n    );\n  },\n}, {\n  title: 'Color',\n  render: function() {\n    return (\n      <View>\n        <Text style={{color: 'red'}}>\n          Red color\n        </Text>\n        <Text style={{color: 'blue'}}>\n          Blue color\n        </Text>\n      </View>\n    );\n  },\n}, {\n  title: 'Font Weight',\n  render: function() {\n    return (\n      <View>\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},  {\n  title: 'Font Style',\n  render: function() {\n    return (\n      <View>\n        <Text style={{fontStyle: 'normal'}}>\n          Normal text\n        </Text>\n        <Text style={{fontStyle: 'italic'}}>\n          Italic text\n        </Text>\n      </View>\n    );\n  },\n}, {\n  title: 'Text Decoration',\n  render: function() {\n    return (\n      <View>\n        <Text style={{textDecorationLine: 'underline', textDecorationStyle: 'solid'}}>\n          Solid underline\n        </Text>\n        <Text style={{textDecorationLine: 'underline', textDecorationStyle: 'double', textDecorationColor: '#ff0000'}}>\n          Double underline with custom color\n        </Text>\n        <Text style={{textDecorationLine: 'underline', textDecorationStyle: 'dashed', textDecorationColor: '#9CDC40'}}>\n          Dashed underline with custom color\n        </Text>\n        <Text style={{textDecorationLine: 'underline', textDecorationStyle: 'dotted', textDecorationColor: 'blue'}}>\n          Dotted underline with custom color\n        </Text>\n        <Text style={{textDecorationLine: 'none'}}>\n          None textDecoration\n        </Text>\n        <Text style={{textDecorationLine: 'line-through', textDecorationStyle: 'solid'}}>\n          Solid line-through\n        </Text>\n        <Text style={{textDecorationLine: 'line-through', textDecorationStyle: 'double', textDecorationColor: '#ff0000'}}>\n          Double line-through with custom color\n        </Text>\n        <Text style={{textDecorationLine: 'line-through', textDecorationStyle: 'dashed', textDecorationColor: '#9CDC40'}}>\n          Dashed line-through with custom color\n        </Text>\n        <Text style={{textDecorationLine: 'line-through', textDecorationStyle: 'dotted', textDecorationColor: 'blue'}}>\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}, {\n  title: 'Nested',\n  description: 'Nested text components will inherit the styles of their ' +\n    'parents (only backgroundColor is inherited from non-Text parents).  ' +\n    '<Text> only supports other <Text> and raw text (strings) as children.',\n  render: function() {\n    return (\n      <View>\n        <Text>\n          (Normal text,\n          <Text style={{fontWeight: 'bold'}}>\n            (and bold\n            <Text style={{fontSize: 11, color: '#527fe4'}}>\n              (and tiny inherited bold blue)\n            </Text>\n            )\n          </Text>\n          )\n        </Text>\n        <Text style={{opacity:0.7}}>\n          (opacity\n            <Text>\n              (is inherited\n                <Text style={{opacity:0.7}}>\n                  (and accumulated\n                    <Text style={{backgroundColor:'#ffaaaa'}}>\n                      (and also applies to the background)\n                    </Text>\n                  )\n                </Text>\n              )\n            </Text>\n          )\n        </Text>\n        <Text style={{fontSize: 12}}>\n          <Entity>Entity Name</Entity>\n        </Text>\n      </View>\n    );\n  },\n}, {\n  title: 'Text Align',\n  render: function() {\n    return (\n      <View>\n        <Text>\n          auto (default) - english LTR\n        </Text>\n        <Text>\n          أحب اللغة العربية auto (default) - arabic RTL\n        </Text>\n        <Text style={{textAlign: 'left'}}>\n          left left left left left left left left left left left left left left left\n        </Text>\n        <Text style={{textAlign: 'center'}}>\n          center center center center center center center center center center center\n        </Text>\n        <Text style={{textAlign: 'right'}}>\n          right right right right right right right right right right right right right\n        </Text>\n        <Text style={{textAlign: 'justify'}}>\n          justify: this text component{\"'\"}s contents are laid out with \"textAlign: justify\"\n          and as you can see all of the lines except the last one span the\n          available width of the parent container.\n        </Text>\n      </View>\n    );\n  },\n}, {\n  title: 'Letter Spacing',\n  render: function() {\n    return (\n      <View>\n        <Text style={{letterSpacing: 0}}>\n          letterSpacing = 0\n        </Text>\n        <Text style={{letterSpacing: 2, marginTop: 5}}>\n          letterSpacing = 2\n        </Text>\n        <Text style={{letterSpacing: 9, marginTop: 5}}>\n          letterSpacing = 9\n        </Text>\n        <Text style={{letterSpacing: -1, marginTop: 5}}>\n          letterSpacing = -1\n        </Text>\n      </View>\n    );\n  },\n}, {\n  title: 'Spaces',\n  render: function() {\n    return (\n      <Text>\n        A {'generated'} {' '} {'string'} and    some &nbsp;&nbsp;&nbsp; spaces\n      </Text>\n    );\n  },\n}, {\n  title: 'Line Height',\n  render: function() {\n    return (\n      <Text>\n        <Text style={{lineHeight: 35}}>\n          A lot of space between the lines of this long passage that should\n          wrap once.\n        </Text>\n      </Text>\n    );\n  },\n}, {\n  title: 'Empty Text',\n  description: 'It\\'s ok to have Text with zero or null children.',\n  render: function() {\n    return (\n      <Text />\n    );\n  },\n}, {\n  title: 'Toggling Attributes',\n  render: function() {\n    return <AttributeToggler />;\n  },\n}, {\n  title: 'backgroundColor attribute',\n  description: 'backgroundColor is inherited from all types of views.',\n  render: function() {\n    return (\n      <Text style={{backgroundColor: 'yellow'}}>\n        Yellow container background,\n        <Text style={{backgroundColor: '#ffaaaa'}}>\n          {' '}red background,\n          <Text style={{backgroundColor: '#aaaaff'}}>\n            {' '}blue background,\n            <Text>\n              {' '}inherited blue background,\n              <Text style={{backgroundColor: '#aaffaa'}}>\n                {' '}nested green background.\n              </Text>\n            </Text>\n          </Text>\n        </Text>\n      </Text>\n    );\n  },\n}, {\n  title: 'numberOfLines attribute',\n  render: function() {\n    return (\n      <View>\n        <Text numberOfLines={1}>\n          Maximum of one line, no matter how much I write here. If I keep writing, it{\"'\"}ll just truncate after one line.\n        </Text>\n        <Text numberOfLines={2} style={{marginTop: 20}}>\n          Maximum of two lines, no matter how much I write here. If I keep writing, it{\"'\"}ll just truncate after two lines.\n        </Text>\n        <Text style={{marginTop: 20}}>\n          No maximum lines specified, no matter how much I write here. If I keep writing, it{\"'\"}ll just keep going and going.\n        </Text>\n      </View>\n    );\n  },\n}, {\n  title: 'Text highlighting (tap the link to see highlight)',\n  render: function() {\n    return (\n      <View>\n        <Text>Lorem ipsum dolor sit amet, <Text suppressHighlighting={false} style={{backgroundColor: 'white', textDecorationLine: 'underline', color: 'blue'}} onPress={() => null}>consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud</Text> exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</Text>\n      </View>\n    );\n  },\n}, {\n  title: 'allowFontScaling attribute',\n  render: function() {\n    return (\n      <View>\n        <Text>\n          By default, text will respect Text Size accessibility setting on iOS.\n          It means that all font sizes will be increased or descreased depending on the value of Text Size setting in\n          {\" \"}<Text style={{fontWeight: 'bold'}}>Settings.app - Display & Brightness - Text Size</Text>\n        </Text>\n        <Text style={{marginTop: 10}}>\n          You can disable scaling for your Text component by passing {\"\\\"\"}allowFontScaling={\"{\"}false{\"}\\\"\"} prop.\n        </Text>\n        <Text allowFontScaling={false} style={{marginTop: 20}}>\n          This text will not scale.\n        </Text>\n      </View>\n    );\n  },\n}, {\n  title: 'Inline views',\n  render: function() {\n    return (\n      <View>\n        <Text>\n          This text contains an inline blue view <View style={{width: 25, height: 25, backgroundColor: 'steelblue'}} /> and\n          an inline image <Image source={require('./flux.png')} style={{width: 30, height: 11, resizeMode: 'cover'}}/>. Neat, huh?\n        </Text>\n      </View>\n    );\n  },\n}, {\n  title: 'Text shadow',\n  render: function() {\n    return (\n      <View>\n        <Text style={{fontSize: 20, textShadowOffset: {width: 2, height: 2}, textShadowRadius: 1, textShadowColor: '#00cccc'}}>\n          Demo text shadow\n        </Text>\n      </View>\n    );\n  },\n}];\n\nvar styles = StyleSheet.create({\n  backgroundColorText: {\n    margin: 5,\n    marginBottom: 0,\n    backgroundColor: 'rgba(100, 100, 100, 0.3)'\n  },\n});\n"
  },
  {
    "path": "RNTester/js/TextInputExample.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TextInputExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Text,\n  TextInput,\n  View,\n  StyleSheet,\n  Slider,\n  Switch,\n} = ReactNative;\n\nclass TextEventsExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    curText: '<No Event>',\n    prevText: '<No Event>',\n    prev2Text: '<No Event>',\n    prev3Text: '<No Event>',\n  };\n\n  updateText = (text) => {\n    this.setState((state) => {\n      return {\n        curText: text,\n        prevText: state.curText,\n        prev2Text: state.prevText,\n        prev3Text: state.prev2Text,\n      };\n    });\n  };\n\n  render() {\n    return (\n      <View>\n        <TextInput\n          autoCapitalize=\"none\"\n          placeholder=\"Enter text to see events\"\n          autoCorrect={false}\n          multiline\n          onFocus={() => this.updateText('onFocus')}\n          onBlur={() => this.updateText('onBlur')}\n          onChange={(event) => this.updateText(\n            'onChange text: ' + event.nativeEvent.text\n          )}\n          onContentSizeChange={(event) => this.updateText(\n            'onContentSizeChange size: ' + event.nativeEvent.contentSize\n          )}\n          onEndEditing={(event) => this.updateText(\n            'onEndEditing text: ' + event.nativeEvent.text\n          )}\n          onSubmitEditing={(event) => this.updateText(\n            'onSubmitEditing text: ' + event.nativeEvent.text\n          )}\n          onKeyPress={(event) => this.updateText(\n            'onKeyPress key: ' + event.nativeEvent.key\n          )}\n          style={styles.singleLine}\n        />\n        <Text style={styles.eventLabel}>\n          {this.state.curText}{'\\n'}\n          (prev: {this.state.prevText}){'\\n'}\n          (prev2: {this.state.prev2Text}){'\\n'}\n          (prev3: {this.state.prev3Text})\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass RewriteExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  constructor(props) {\n    super(props);\n    this.state = {text: ''};\n  }\n  render() {\n    var limit = 20;\n    var remainder = limit - this.state.text.length;\n    var remainderColor = remainder > 5 ? 'blue' : 'red';\n    return (\n      <View style={styles.rewriteContainer}>\n        <TextInput\n          multiline={false}\n          maxLength={limit}\n          onChangeText={(text) => {\n            text = text.replace(/ /g, '_');\n            this.setState({text});\n          }}\n          style={styles.default}\n          value={this.state.text}\n        />\n        <Text style={[styles.remainder, {color: remainderColor}]}>\n          {remainder}\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass TokenizedTextExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  constructor(props) {\n    super(props);\n    this.state = {text: 'Hello #World'};\n  }\n  render() {\n\n    //define delimiter\n    let delimiter = /\\s+/;\n\n    //split string\n    let _text = this.state.text;\n    let token, index, parts = [];\n    while (_text) {\n      delimiter.lastIndex = 0;\n      token = delimiter.exec(_text);\n      if (token === null) {\n        break;\n      }\n      index = token.index;\n      if (token[0].length === 0) {\n        index = 1;\n      }\n      parts.push(_text.substr(0, index));\n      parts.push(token[0]);\n      index = index + token[0].length;\n      _text = _text.slice(index);\n    }\n    parts.push(_text);\n\n    //highlight hashtags\n    parts = parts.map((text) => {\n      if (/^#/.test(text)) {\n        return <Text key={text} style={styles.hashtag}>{text}</Text>;\n      } else {\n        return text;\n      }\n    });\n\n    return (\n      <View>\n        <TextInput\n          multiline={true}\n          style={styles.multiline}\n          onChangeText={(text) => {\n            this.setState({text});\n          }}>\n          <Text>{parts}</Text>\n        </TextInput>\n      </View>\n    );\n  }\n}\n\nclass BlurOnSubmitExample extends React.Component<{}> {\n  focusNextField = (nextField) => {\n    this.refs[nextField].focus();\n  };\n\n  render() {\n    return (\n      <View>\n        <TextInput\n          ref=\"1\"\n          style={styles.singleLine}\n          placeholder=\"blurOnSubmit = false\"\n          returnKeyType=\"next\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('2')}\n        />\n        <TextInput\n          ref=\"2\"\n          style={styles.singleLine}\n          keyboardType=\"email-address\"\n          placeholder=\"blurOnSubmit = false\"\n          returnKeyType=\"next\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('3')}\n        />\n        <TextInput\n          ref=\"3\"\n          style={styles.singleLine}\n          keyboardType=\"url\"\n          placeholder=\"blurOnSubmit = false\"\n          returnKeyType=\"next\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('4')}\n        />\n        <TextInput\n          ref=\"4\"\n          style={styles.singleLine}\n          keyboardType=\"numeric\"\n          placeholder=\"blurOnSubmit = false\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('5')}\n        />\n        <TextInput\n          ref=\"5\"\n          style={styles.singleLine}\n          keyboardType=\"numbers-and-punctuation\"\n          placeholder=\"blurOnSubmit = true\"\n          returnKeyType=\"done\"\n        />\n      </View>\n    );\n  }\n}\n\nclass ToggleDefaultPaddingExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> {\n  constructor(props) {\n    super(props);\n    this.state = {hasPadding: false};\n  }\n  render() {\n    return (\n      <View>\n        <TextInput style={this.state.hasPadding ? { padding: 0 } : null}/>\n        <Text onPress={() => this.setState({hasPadding: !this.state.hasPadding})}>\n          Toggle padding\n        </Text>\n      </View>\n    );\n  }\n}\n\ntype SelectionExampleState = {\n  selection: {\n    start: number;\n    end: number;\n  };\n  value: string;\n};\n\nclass SelectionExample extends React.Component<$FlowFixMeProps, SelectionExampleState> {\n  _textInput: any;\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      selection: {start: 0, end: 0},\n      value: props.value\n    };\n  }\n\n  onSelectionChange({nativeEvent: {selection}}) {\n    this.setState({selection});\n  }\n\n  getRandomPosition() {\n    var length = this.state.value.length;\n    return Math.round(Math.random() * length);\n  }\n\n  select(start, end) {\n    this._textInput.focus();\n    this.setState({selection: {start, end}});\n  }\n\n  selectRandom() {\n    var positions = [this.getRandomPosition(), this.getRandomPosition()].sort();\n    this.select(...positions);\n  }\n\n  placeAt(position) {\n    this.select(position, position);\n  }\n\n  placeAtRandom() {\n    this.placeAt(this.getRandomPosition());\n  }\n\n  render() {\n    var length = this.state.value.length;\n\n    return (\n      <View>\n        <TextInput\n          multiline={this.props.multiline}\n          onChangeText={(value) => this.setState({value})}\n          onSelectionChange={this.onSelectionChange.bind(this)}\n          ref={textInput => (this._textInput = textInput)}\n          selection={this.state.selection}\n          style={this.props.style}\n          value={this.state.value}\n        />\n        <View>\n          <Text>\n            selection = {JSON.stringify(this.state.selection)}\n          </Text>\n          <Text onPress={this.placeAt.bind(this, 0)}>\n            Place at Start (0, 0)\n          </Text>\n          <Text onPress={this.placeAt.bind(this, length)}>\n            Place at End ({length}, {length})\n          </Text>\n          <Text onPress={this.placeAtRandom.bind(this)}>\n            Place at Random\n          </Text>\n          <Text onPress={this.select.bind(this, 0, length)}>\n            Select All\n          </Text>\n          <Text onPress={this.selectRandom.bind(this)}>\n            Select Random\n          </Text>\n        </View>\n      </View>\n    );\n  }\n}\n\nclass AutogrowingTextInputExample extends React.Component<{}> {\n\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      width: 100,\n      multiline: true,\n      text: '',\n      contentSize: {\n        width: 0,\n        height: 0,\n      },\n    };\n  }\n\n  componentWillReceiveProps(props) {\n    this.setState({\n      multiline: props.multiline,\n    });\n  }\n\n  render() {\n    var {style, multiline, ...props} = this.props;\n    return (\n      <View>\n        <Text>Width:</Text>\n        <Slider\n          value={100}\n          minimumValue={0}\n          maximumValue={100}\n          step={10}\n          onValueChange={(value) => this.setState({width: value})}\n        />\n        <Text>Multiline:</Text>\n        <Switch\n          value={this.state.multiline}\n          onValueChange={(value) => this.setState({multiline: value})}\n        />\n        <Text>TextInput:</Text>\n        <TextInput\n          multiline={this.state.multiline}\n          style={[style, {width: this.state.width + '%'}]}\n          onChangeText={(value) => this.setState({text: value})}\n          onContentSizeChange={(event) => this.setState({contentSize: event.nativeEvent.contentSize})}\n          {...props}\n        />\n        <Text>Plain text value representation:</Text>\n        <Text>{this.state.text}</Text>\n        <Text>Content Size: {JSON.stringify(this.state.contentSize)}</Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  multiline: {\n    height: 60,\n    fontSize: 16,\n  },\n  eventLabel: {\n    margin: 3,\n    fontSize: 12,\n  },\n  singleLine: {\n    fontSize: 16,\n  },\n  singleLineWithHeightTextInput: {\n    height: 30,\n  },\n  hashtag: {\n    color: 'blue',\n    fontWeight: 'bold',\n  },\n});\n\nexports.title = '<TextInput>';\nexports.description = 'Single and multi-line text inputs.';\nexports.examples = [\n  {\n    title: 'Auto-focus',\n    render: function() {\n      return (\n        <TextInput\n          autoFocus={true}\n          multiline={true}\n          style={styles.input}\n          accessibilityLabel=\"I am the accessibility label for text input\"\n        />\n      );\n    }\n  },\n  {\n    title: \"Live Re-Write (<sp>  ->  '_')\",\n    render: function() {\n      return <RewriteExample />;\n    }\n  },\n  {\n    title: 'Auto-capitalize',\n    render: function() {\n      var autoCapitalizeTypes = [\n        'none',\n        'sentences',\n        'words',\n        'characters',\n      ];\n      var examples = autoCapitalizeTypes.map((type) => {\n        return (\n          <TextInput\n            key={type}\n            autoCapitalize={type}\n            placeholder={'autoCapitalize: ' + type}\n            style={styles.singleLine}\n          />\n        );\n      });\n      return <View>{examples}</View>;\n    }\n  },\n  {\n    title: 'Auto-correct',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            autoCorrect={true}\n            placeholder=\"This has autoCorrect\"\n            style={styles.singleLine}\n          />\n          <TextInput\n            autoCorrect={false}\n            placeholder=\"This does not have autoCorrect\"\n            style={styles.singleLine}\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Keyboard types',\n    render: function() {\n      var keyboardTypes = [\n        'default',\n        'email-address',\n        'numeric',\n        'phone-pad',\n      ];\n      var examples = keyboardTypes.map((type) => {\n        return (\n          <TextInput\n            key={type}\n            keyboardType={type}\n            placeholder={'keyboardType: ' + type}\n            style={styles.singleLine}\n          />\n        );\n      });\n      return <View>{examples}</View>;\n    }\n  },\n  {\n    title: 'Blur on submit',\n    render: function(): React.Element<any> { return <BlurOnSubmitExample />; },\n  },\n  {\n    title: 'Event handling',\n    render: function(): React.Element<any> { return <TextEventsExample />; },\n  },\n  {\n    title: 'Colors and text inputs',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            style={[styles.singleLine]}\n            defaultValue=\"Default color text\"\n          />\n          <TextInput\n            style={[styles.singleLine, {color: 'green'}]}\n            defaultValue=\"Green Text\"\n          />\n          <TextInput\n            placeholder=\"Default placeholder text color\"\n            style={styles.singleLine}\n          />\n          <TextInput\n            placeholder=\"Red placeholder text color\"\n            placeholderTextColor=\"red\"\n            style={styles.singleLine}\n          />\n          <TextInput\n            placeholder=\"Default underline color\"\n            style={styles.singleLine}\n          />\n          <TextInput\n            placeholder=\"Blue underline color\"\n            style={styles.singleLine}\n            underlineColorAndroid=\"blue\"\n          />\n          <TextInput\n            defaultValue=\"Same BackgroundColor as View \"\n            style={[styles.singleLine, {backgroundColor: 'rgba(100, 100, 100, 0.3)'}]}>\n            <Text style={{backgroundColor: 'rgba(100, 100, 100, 0.3)'}}>\n              Darker backgroundColor\n            </Text>\n          </TextInput>\n          <TextInput\n            defaultValue=\"Highlight Color is red\"\n            selectionColor={'red'}\n            style={styles.singleLine} />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Text input, themes and heights',\n    render: function() {\n      return (\n        <TextInput\n          placeholder=\"If you set height, beware of padding set from themes\"\n          style={[styles.singleLineWithHeightTextInput]}\n        />\n      );\n    }\n  },\n  {\n    title: 'fontFamily, fontWeight and fontStyle',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            style={[styles.singleLine, {fontFamily: 'sans-serif'}]}\n            placeholder=\"Custom fonts like Sans-Serif are supported\"\n          />\n          <TextInput\n            style={[styles.singleLine, {fontFamily: 'sans-serif', fontWeight: 'bold'}]}\n            placeholder=\"Sans-Serif bold\"\n          />\n          <TextInput\n            style={[styles.singleLine, {fontFamily: 'sans-serif', fontStyle: 'italic'}]}\n            placeholder=\"Sans-Serif italic\"\n          />\n          <TextInput\n            style={[styles.singleLine, {fontFamily: 'serif'}]}\n            placeholder=\"Serif\"\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Passwords',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            defaultValue=\"iloveturtles\"\n            secureTextEntry={true}\n            style={styles.singleLine}\n          />\n          <TextInput\n            secureTextEntry={true}\n            style={[styles.singleLine, {color: 'red'}]}\n            placeholder=\"color is supported too\"\n            placeholderTextColor=\"red\"\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Editable',\n    render: function() {\n      return (\n        <TextInput\n           defaultValue=\"Can't touch this! (>'-')> ^(' - ')^ <('-'<) (>'-')> ^(' - ')^\"\n           editable={false}\n           style={styles.singleLine}\n         />\n      );\n    }\n  },\n  {\n    title: 'Multiline',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            autoCorrect={true}\n            placeholder=\"multiline, aligned top-left\"\n            placeholderTextColor=\"red\"\n            multiline={true}\n            style={[styles.multiline, {textAlign: 'left', textAlignVertical: 'top'}]}\n          />\n          <TextInput\n            autoCorrect={true}\n            placeholder=\"multiline, aligned center\"\n            placeholderTextColor=\"green\"\n            multiline={true}\n            style={[styles.multiline, {textAlign: 'center', textAlignVertical: 'center'}]}\n          />\n          <TextInput\n            autoCorrect={true}\n            multiline={true}\n            style={[styles.multiline, {color: 'blue'}, {textAlign: 'right', textAlignVertical: 'bottom'}]}>\n            <Text style={styles.multiline}>multiline with children, aligned bottom-right</Text>\n          </TextInput>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Fixed number of lines',\n    platform: 'android',\n    render: function() {\n      return (\n        <View>\n          <TextInput numberOfLines={2}\n            multiline={true}\n            placeholder=\"Two line input\"\n          />\n          <TextInput numberOfLines={5}\n            multiline={true}\n            placeholder=\"Five line input\"\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Auto-expanding',\n    render: function() {\n      return (\n        <View>\n          <AutogrowingTextInputExample\n            enablesReturnKeyAutomatically={true}\n            returnKeyType=\"done\"\n            multiline={true}\n            style={{maxHeight: 400, minHeight: 20, backgroundColor: '#eeeeee'}}\n          >\n            generic generic generic\n            <Text style={{fontSize: 6, color: 'red'}}>\n              small small small small small small\n            </Text>\n            <Text>regular regular</Text>\n            <Text style={{fontSize: 30, color: 'green'}}>\n              huge huge huge huge huge\n            </Text>\n            generic generic generic\n          </AutogrowingTextInputExample>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Attributed text',\n    render: function() {\n      return <TokenizedTextExample />;\n    }\n  },\n  {\n    title: 'Return key',\n    render: function() {\n      var returnKeyTypes = [\n        'none',\n        'go',\n        'search',\n        'send',\n        'done',\n        'previous',\n        'next',\n      ];\n      var returnKeyLabels = [\n        'Compile',\n        'React Native',\n      ];\n      var examples = returnKeyTypes.map((type) => {\n        return (\n          <TextInput\n            key={type}\n            returnKeyType={type}\n            placeholder={'returnKeyType: ' + type}\n            style={styles.singleLine}\n          />\n        );\n      });\n      var types = returnKeyLabels.map((type) => {\n        return (\n          <TextInput\n            key={type}\n            returnKeyLabel={type}\n            placeholder={'returnKeyLabel: ' + type}\n            style={styles.singleLine}\n          />\n        );\n      });\n      return <View>{examples}{types}</View>;\n    }\n  },\n  {\n    title: 'Inline Images',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            inlineImageLeft=\"ic_menu_black_24dp\"\n            placeholder=\"This has drawableLeft set\"\n            style={styles.singleLine}\n          />\n          <TextInput\n            inlineImageLeft=\"ic_menu_black_24dp\"\n            inlineImagePadding={30}\n            placeholder=\"This has drawableLeft and drawablePadding set\"\n            style={styles.singleLine}\n          />\n          <TextInput\n            placeholder=\"This does not have drawable props set\"\n            style={styles.singleLine}\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Toggle Default Padding',\n    render: function(): React.Element<any> { return <ToggleDefaultPaddingExample />; },\n  },\n  {\n    title: 'Text selection & cursor placement',\n    render: function() {\n      return (\n        <View>\n          <SelectionExample\n            style={styles.default}\n            value=\"text selection can be changed\"\n          />\n          <SelectionExample\n            multiline\n            style={styles.multiline}\n            value={'multiline text selection\\ncan also be changed'}\n          />\n        </View>\n      );\n    }\n  },\n];\n"
  },
  {
    "path": "RNTester/js/TextInputExample.ios.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TextInputExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  Text,\n  TextInput,\n  View,\n  StyleSheet,\n} = ReactNative;\n\nclass WithLabel extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <View style={styles.labelContainer}>\n        <View style={styles.label}>\n          <Text>{this.props.label}</Text>\n        </View>\n        {this.props.children}\n      </View>\n    );\n  }\n}\n\nclass TextEventsExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    curText: '<No Event>',\n    prevText: '<No Event>',\n    prev2Text: '<No Event>',\n    prev3Text: '<No Event>',\n  };\n\n  updateText = (text) => {\n    this.setState((state) => {\n      return {\n        curText: text,\n        prevText: state.curText,\n        prev2Text: state.prevText,\n        prev3Text: state.prev2Text,\n      };\n    });\n  };\n\n  render() {\n    return (\n      <View>\n        <TextInput\n          autoCapitalize=\"none\"\n          placeholder=\"Enter text to see events\"\n          autoCorrect={false}\n          onFocus={() => this.updateText('onFocus')}\n          onBlur={() => this.updateText('onBlur')}\n          onChange={(event) => this.updateText(\n            'onChange text: ' + event.nativeEvent.text\n          )}\n          onEndEditing={(event) => this.updateText(\n            'onEndEditing text: ' + event.nativeEvent.text\n          )}\n          onSubmitEditing={(event) => this.updateText(\n            'onSubmitEditing text: ' + event.nativeEvent.text\n          )}\n          onSelectionChange={(event) => this.updateText(\n            'onSelectionChange range: ' +\n              event.nativeEvent.selection.start + ',' +\n              event.nativeEvent.selection.end\n          )}\n          onKeyPress={(event) => {\n            this.updateText('onKeyPress key: ' + event.nativeEvent.key);\n          }}\n          style={styles.default}\n        />\n        <Text style={styles.eventLabel}>\n          {this.state.curText}{'\\n'}\n          (prev: {this.state.prevText}){'\\n'}\n          (prev2: {this.state.prev2Text}){'\\n'}\n          (prev3: {this.state.prev3Text})\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass RewriteExample extends React.Component<$FlowFixMeProps, any> {\n  constructor(props) {\n    super(props);\n    this.state = {text: ''};\n  }\n  render() {\n    var limit = 20;\n    var remainder = limit - this.state.text.length;\n    var remainderColor = remainder > 5 ? 'blue' : 'red';\n    return (\n      <View style={styles.rewriteContainer}>\n        <TextInput\n          multiline={false}\n          maxLength={limit}\n          onChangeText={(text) => {\n            text = text.replace(/ /g, '_');\n            this.setState({text});\n          }}\n          style={styles.default}\n          value={this.state.text}\n        />\n        <Text style={[styles.remainder, {color: remainderColor}]}>\n          {remainder}\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass RewriteExampleInvalidCharacters extends React.Component<$FlowFixMeProps, any> {\n  constructor(props) {\n    super(props);\n    this.state = {text: ''};\n  }\n  render() {\n    return (\n      <View style={styles.rewriteContainer}>\n        <TextInput\n          multiline={false}\n          onChangeText={(text) => {\n            this.setState({text: text.replace(/\\s/g, '')});\n          }}\n          style={styles.default}\n          value={this.state.text}\n        />\n      </View>\n    );\n  }\n}\n\nclass TokenizedTextExample extends React.Component<$FlowFixMeProps, any> {\n  constructor(props) {\n    super(props);\n    this.state = {text: 'Hello #World'};\n  }\n  render() {\n\n    //define delimiter\n    let delimiter = /\\s+/;\n\n    //split string\n    let _text = this.state.text;\n    let token, index, parts = [];\n    while (_text) {\n      delimiter.lastIndex = 0;\n      token = delimiter.exec(_text);\n      if (token === null) {\n        break;\n      }\n      index = token.index;\n      if (token[0].length === 0) {\n        index = 1;\n      }\n      parts.push(_text.substr(0, index));\n      parts.push(token[0]);\n      index = index + token[0].length;\n      _text = _text.slice(index);\n    }\n    parts.push(_text);\n\n    //highlight hashtags\n    parts = parts.map((text) => {\n      if (/^#/.test(text)) {\n        return <Text key={text} style={styles.hashtag}>{text}</Text>;\n      } else {\n        return text;\n      }\n    });\n\n    return (\n      <View>\n        <TextInput\n          multiline={true}\n          style={styles.multiline}\n          onChangeText={(text) => {\n            this.setState({text});\n          }}>\n          <Text>{parts}</Text>\n        </TextInput>\n      </View>\n    );\n  }\n}\n\nclass BlurOnSubmitExample extends React.Component<{}> {\n  focusNextField = (nextField) => {\n    this.refs[nextField].focus();\n  };\n\n  render() {\n    return (\n      <View>\n        <TextInput\n          ref=\"1\"\n          style={styles.default}\n          placeholder=\"blurOnSubmit = false\"\n          returnKeyType=\"next\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('2')}\n        />\n        <TextInput\n          ref=\"2\"\n          style={styles.default}\n          keyboardType=\"email-address\"\n          placeholder=\"blurOnSubmit = false\"\n          returnKeyType=\"next\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('3')}\n        />\n        <TextInput\n          ref=\"3\"\n          style={styles.default}\n          keyboardType=\"url\"\n          placeholder=\"blurOnSubmit = false\"\n          returnKeyType=\"next\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('4')}\n        />\n        <TextInput\n          ref=\"4\"\n          style={styles.default}\n          keyboardType=\"numeric\"\n          returnKeyType=\"done\"\n          placeholder=\"blurOnSubmit = false\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('5')}\n        />\n        <TextInput\n          ref=\"5\"\n          style={styles.default}\n          keyboardType=\"numbers-and-punctuation\"\n          placeholder=\"blurOnSubmit = true\"\n          returnKeyType=\"done\"\n        />\n      </View>\n    );\n  }\n}\n\ntype SelectionExampleState = {\n  selection: {\n    start: number;\n    end?: number;\n  };\n  value: string;\n};\n\nclass SelectionExample extends React.Component<$FlowFixMeProps, SelectionExampleState> {\n  _textInput: any;\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      selection: {start: 0, end: 0},\n      value: props.value\n    };\n  }\n\n  onSelectionChange({nativeEvent: {selection}}) {\n    this.setState({selection});\n  }\n\n  getRandomPosition() {\n    var length = this.state.value.length;\n    return Math.round(Math.random() * length);\n  }\n\n  select(start, end) {\n    this._textInput.focus();\n    this.setState({selection: {start, end}});\n  }\n\n  selectRandom() {\n    var positions = [this.getRandomPosition(), this.getRandomPosition()].sort((a, b) => a - b);\n    this.select(...positions);\n  }\n\n  placeAt(position) {\n    this.select(position, position);\n  }\n\n  placeAtRandom() {\n    this.placeAt(this.getRandomPosition());\n  }\n\n  render() {\n    var length = this.state.value.length;\n\n    return (\n      <View>\n        <TextInput\n          multiline={this.props.multiline}\n          onChangeText={(value) => this.setState({value})}\n          onSelectionChange={this.onSelectionChange.bind(this)}\n          ref={textInput => (this._textInput = textInput)}\n          selection={this.state.selection}\n          style={this.props.style}\n          value={this.state.value}\n        />\n        <View>\n          <Text>\n            selection = {JSON.stringify(this.state.selection)}\n          </Text>\n          <Text onPress={this.placeAt.bind(this, 0)}>\n            Place at Start (0, 0)\n          </Text>\n          <Text onPress={this.placeAt.bind(this, length)}>\n            Place at End ({length}, {length})\n          </Text>\n          <Text onPress={this.placeAtRandom.bind(this)}>\n            Place at Random\n          </Text>\n          <Text onPress={this.select.bind(this, 0, length)}>\n            Select All\n          </Text>\n          <Text onPress={this.selectRandom.bind(this)}>\n            Select Random\n          </Text>\n        </View>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  page: {\n    paddingBottom: 300,\n  },\n  default: {\n    borderWidth: StyleSheet.hairlineWidth,\n    borderColor: '#0f0f0f',\n    flex: 1,\n    fontSize: 13,\n    padding: 4,\n  },\n  multiline: {\n    borderWidth: StyleSheet.hairlineWidth,\n    borderColor: '#0f0f0f',\n    flex: 1,\n    fontSize: 13,\n    height: 50,\n    padding: 4,\n    marginBottom: 4,\n  },\n  multilineExpandable: {\n    height: 'auto',\n    maxHeight: 100,\n  },\n  multilineWithFontStyles: {\n    color: 'blue',\n    fontWeight: 'bold',\n    fontSize: 18,\n    fontFamily: 'Cochin',\n    height: 60,\n  },\n  multilineChild: {\n    width: 50,\n    height: 40,\n    position: 'absolute',\n    right: 5,\n    backgroundColor: 'red',\n  },\n  eventLabel: {\n    margin: 3,\n    fontSize: 12,\n  },\n  labelContainer: {\n    flexDirection: 'row',\n    marginVertical: 2,\n    flex: 1,\n  },\n  label: {\n    width: 115,\n    alignItems: 'flex-end',\n    marginRight: 10,\n    paddingTop: 2,\n  },\n  rewriteContainer: {\n    flexDirection: 'row',\n    alignItems: 'center',\n  },\n  remainder: {\n    textAlign: 'right',\n    width: 24,\n  },\n  hashtag: {\n    color: 'blue',\n    fontWeight: 'bold',\n  },\n});\n\nexports.displayName = (undefined: ?string);\nexports.title = '<TextInput>';\nexports.description = 'Single and multi-line text inputs.';\nexports.examples = [\n  {\n    title: 'Auto-focus',\n    render: function() {\n      return (\n        <TextInput\n          autoFocus={true}\n          style={styles.default}\n          accessibilityLabel=\"I am the accessibility label for text input\"\n        />\n      );\n    }\n  },\n  {\n    title: \"Live Re-Write (<sp>  ->  '_') + maxLength\",\n    render: function() {\n      return <RewriteExample />;\n    }\n  },\n  {\n    title: 'Live Re-Write (no spaces allowed)',\n    render: function() {\n      return <RewriteExampleInvalidCharacters />;\n    }\n  },\n  {\n    title: 'Auto-capitalize',\n    render: function() {\n      return (\n        <View>\n          <WithLabel label=\"none\">\n            <TextInput\n              autoCapitalize=\"none\"\n              style={styles.default}\n            />\n          </WithLabel>\n          <WithLabel label=\"sentences\">\n            <TextInput\n              autoCapitalize=\"sentences\"\n              style={styles.default}\n            />\n          </WithLabel>\n          <WithLabel label=\"words\">\n            <TextInput\n              autoCapitalize=\"words\"\n              style={styles.default}\n            />\n          </WithLabel>\n          <WithLabel label=\"characters\">\n            <TextInput\n              autoCapitalize=\"characters\"\n              style={styles.default}\n            />\n          </WithLabel>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Auto-correct',\n    render: function() {\n      return (\n        <View>\n          <WithLabel label=\"true\">\n            <TextInput autoCorrect={true} style={styles.default} />\n          </WithLabel>\n          <WithLabel label=\"false\">\n            <TextInput autoCorrect={false} style={styles.default} />\n          </WithLabel>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Keyboard types',\n    render: function() {\n      var keyboardTypes = [\n        'default',\n        'ascii-capable',\n        'numbers-and-punctuation',\n        'url',\n        'number-pad',\n        'phone-pad',\n        'name-phone-pad',\n        'email-address',\n        'decimal-pad',\n        'twitter',\n        'web-search',\n        'numeric',\n      ];\n      var examples = keyboardTypes.map((type) => {\n        return (\n          <WithLabel key={type} label={type}>\n            <TextInput\n              keyboardType={type}\n              style={styles.default}\n            />\n          </WithLabel>\n        );\n      });\n      return <View>{examples}</View>;\n    }\n  },\n  {\n    title: 'Keyboard appearance',\n    render: function() {\n      var keyboardAppearance = [\n        'default',\n        'light',\n        'dark',\n      ];\n      var examples = keyboardAppearance.map((type) => {\n        return (\n          <WithLabel key={type} label={type}>\n            <TextInput\n              keyboardAppearance={type}\n              style={styles.default}\n            />\n          </WithLabel>\n        );\n      });\n      return <View>{examples}</View>;\n    }\n  },\n  {\n    title: 'Return key types',\n    render: function() {\n      var returnKeyTypes = [\n        'default',\n        'go',\n        'google',\n        'join',\n        'next',\n        'route',\n        'search',\n        'send',\n        'yahoo',\n        'done',\n        'emergency-call',\n      ];\n      var examples = returnKeyTypes.map((type) => {\n        return (\n          <WithLabel key={type} label={type}>\n            <TextInput\n              returnKeyType={type}\n              style={styles.default}\n            />\n          </WithLabel>\n        );\n      });\n      return <View>{examples}</View>;\n    }\n  },\n  {\n    title: 'Enable return key automatically',\n    render: function() {\n      return (\n        <View>\n          <WithLabel label=\"true\">\n            <TextInput enablesReturnKeyAutomatically={true} style={styles.default} />\n          </WithLabel>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Secure text entry',\n    render: function() {\n      return (\n        <View>\n          <WithLabel label=\"true\">\n            <TextInput secureTextEntry={true} style={styles.default} defaultValue=\"abc\" />\n          </WithLabel>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Event handling',\n    render: function(): React.Element<any> { return <TextEventsExample />; },\n  },\n  {\n    title: 'Colored input text',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            style={[styles.default, {color: 'blue'}]}\n            defaultValue=\"Blue\"\n          />\n          <TextInput\n            style={[styles.default, {color: 'green'}]}\n            defaultValue=\"Green\"\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Colored highlight/cursor for text input',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            style={styles.default}\n            selectionColor={'green'}\n            defaultValue=\"Highlight me\"\n          />\n          <TextInput\n            style={styles.default}\n            selectionColor={'rgba(86, 76, 205, 1)'}\n            defaultValue=\"Highlight me\"\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Clear button mode',\n    render: function () {\n      return (\n        <View>\n          <WithLabel label=\"never\">\n            <TextInput\n              style={styles.default}\n              clearButtonMode=\"never\"\n            />\n          </WithLabel>\n          <WithLabel label=\"while editing\">\n            <TextInput\n              style={styles.default}\n              clearButtonMode=\"while-editing\"\n            />\n          </WithLabel>\n          <WithLabel label=\"unless editing\">\n            <TextInput\n              style={styles.default}\n              clearButtonMode=\"unless-editing\"\n            />\n          </WithLabel>\n          <WithLabel label=\"always\">\n            <TextInput\n              style={styles.default}\n              clearButtonMode=\"always\"\n            />\n          </WithLabel>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Clear and select',\n    render: function() {\n      return (\n        <View>\n          <WithLabel label=\"clearTextOnFocus\">\n            <TextInput\n              placeholder=\"text is cleared on focus\"\n              defaultValue=\"text is cleared on focus\"\n              style={styles.default}\n              clearTextOnFocus={true}\n            />\n          </WithLabel>\n          <WithLabel label=\"selectTextOnFocus\">\n            <TextInput\n              placeholder=\"text is selected on focus\"\n              defaultValue=\"text is selected on focus\"\n              style={styles.default}\n              selectTextOnFocus={true}\n            />\n          </WithLabel>\n          <WithLabel label=\"clearTextOnFocus (multiline)\">\n            <TextInput\n              placeholder=\"text is cleared on focus\"\n              defaultValue=\"text is cleared on focus\"\n              style={styles.default}\n              clearTextOnFocus={true}\n              multiline={true}\n            />\n          </WithLabel>\n          <WithLabel label=\"selectTextOnFocus (multiline)\">\n            <TextInput\n              placeholder=\"text is selected on focus\"\n              defaultValue=\"text is selected on focus\"\n              style={styles.default}\n              selectTextOnFocus={true}\n              multiline={true}\n            />\n          </WithLabel>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Blur on submit',\n    render: function(): React.Element<any> { return <BlurOnSubmitExample />; },\n  },\n  {\n    title: 'Multiline blur on submit',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            style={styles.multiline}\n            placeholder=\"blurOnSubmit = true\"\n            returnKeyType=\"next\"\n            blurOnSubmit={true}\n            multiline={true}\n            onSubmitEditing={event => alert(event.nativeEvent.text)}\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Multiline',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            placeholder=\"multiline text input\"\n            multiline={true}\n            style={styles.multiline}\n          />\n          <TextInput\n            placeholder=\"multiline text input with font styles and placeholder\"\n            multiline={true}\n            clearTextOnFocus={true}\n            autoCorrect={true}\n            autoCapitalize=\"words\"\n            placeholderTextColor=\"red\"\n            keyboardType=\"url\"\n            style={[styles.multiline, styles.multilineWithFontStyles]}\n          />\n          <TextInput\n            placeholder=\"multiline text input with max length\"\n            maxLength={5}\n            multiline={true}\n            style={styles.multiline}\n          />\n          <TextInput\n            placeholder=\"uneditable multiline text input\"\n            editable={false}\n            multiline={true}\n            style={styles.multiline}\n          />\n          <TextInput\n            defaultValue=\"uneditable multiline text input with phone number detection: 88888888.\"\n            editable={false}\n            multiline={true}\n            style={styles.multiline}\n            dataDetectorTypes=\"phoneNumber\"\n          />\n          <TextInput\n            placeholder=\"multiline with children\"\n            multiline={true}\n            enablesReturnKeyAutomatically={true}\n            returnKeyType=\"go\"\n            style={styles.multiline}>\n            <View style={styles.multilineChild}/>\n          </TextInput>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'TextInput Intrinsic Size',\n    render: function() {\n      return (\n        <View>\n          <Text>Singleline TextInput</Text>\n          <View style={{height: 80}}>\n            <TextInput\n              style={{\n                position: 'absolute',\n                fontSize: 16,\n                backgroundColor: '#eeeeee',\n                borderColor: '#666666',\n                borderWidth: 5,\n                borderTopWidth: 20,\n                borderRadius: 10,\n                borderBottomRightRadius: 20,\n                padding: 10,\n                paddingTop: 20,\n              }}\n              testID=\"singleline_textinput\"\n              placeholder=\"Placeholder defines intrinsic size\"\n            />\n          </View>\n          <Text>Multiline TextInput</Text>\n          <View style={{height: 130}}>\n            <TextInput\n              style={{\n                position: 'absolute',\n                fontSize: 16,\n                backgroundColor: '#eeeeee',\n                borderColor: '#666666',\n                borderWidth: 5,\n                borderTopWidth: 20,\n                borderRadius: 10,\n                borderBottomRightRadius: 20,\n                padding: 10,\n                paddingTop: 20,\n                maxHeight: 100\n              }}\n              testID=\"multiline_textinput\"\n              multiline={true}\n              placeholder=\"Placeholder defines intrinsic size\"\n            />\n          </View>\n          <View>\n            <TextInput\n              style={{\n                fontSize: 16,\n                backgroundColor: '#eeeeee',\n                borderColor: '#666666',\n                borderWidth: 5,\n                borderTopWidth: 20,\n                borderRadius: 10,\n                borderBottomRightRadius: 20,\n                padding: 10,\n                paddingTop: 20,\n              }}\n              testID=\"multiline_textinput_with_flex\"\n              multiline={true}\n              placeholder=\"Placeholder defines intrinsic size\"\n            />\n          </View>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Auto-expanding',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            placeholder=\"height increases with content\"\n            defaultValue=\"React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native.\"\n            multiline={true}\n            enablesReturnKeyAutomatically={true}\n            returnKeyType=\"go\"\n            style={[styles.multiline, styles.multilineExpandable]}\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Attributed text',\n    render: function() {\n      return <TokenizedTextExample />;\n    }\n  },\n  {\n    title: 'Text selection & cursor placement',\n    render: function() {\n      return (\n        <View>\n          <SelectionExample\n            style={styles.default}\n            value=\"text selection can be changed\"\n          />\n          <SelectionExample\n            multiline\n            style={styles.multiline}\n            value={'multiline text selection\\ncan also be changed'}\n          />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'TextInput maxLength',\n    render: function() {\n      return (\n        <View>\n          <WithLabel label=\"maxLength: 5\">\n            <TextInput\n              maxLength={5}\n              style={styles.default}\n            />\n          </WithLabel>\n          <WithLabel label=\"maxLength: 5 with placeholder\">\n            <TextInput\n              maxLength={5}\n              placeholder=\"ZIP code entry\"\n              style={styles.default}\n            />\n          </WithLabel>\n          <WithLabel label=\"maxLength: 5 with default value already set\">\n            <TextInput\n              maxLength={5}\n              defaultValue=\"94025\"\n              style={styles.default}\n            />\n          </WithLabel>\n          <WithLabel label=\"maxLength: 5 with very long default value already set\">\n            <TextInput\n              maxLength={5}\n              defaultValue=\"9402512345\"\n              style={styles.default}\n            />\n          </WithLabel>\n        </View>\n      );\n    }\n  },\n];\n"
  },
  {
    "path": "RNTester/js/TextInputExample.macos.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TextInputExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  Text,\n  TextInput,\n  View,\n  StyleSheet,\n} = ReactNative;\n\nclass WithLabel extends React.Component<$FlowFixMeProps> {\n  render() {\n    return (\n      <View style={styles.labelContainer}>\n        <View style={styles.label}>\n          <Text>{this.props.label}</Text>\n        </View>\n        {this.props.children}\n      </View>\n    );\n  }\n}\n\nclass TextEventsExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    curText: '<No Event>',\n    prevText: '<No Event>',\n    prev2Text: '<No Event>',\n    prev3Text: '<No Event>',\n  };\n\n  updateText = (text) => {\n    this.setState((state) => {\n      return {\n        curText: text,\n        prevText: state.curText,\n        prev2Text: state.prevText,\n        prev3Text: state.prev2Text,\n      };\n    });\n  };\n\n  render() {\n    return (\n      <View>\n        <TextInput\n          //autoCapitalize=\"none\"\n          placeholder=\"Enter text to see events\"\n          //autoCorrect={false}\n          onFocus={() => this.updateText('onFocus')}\n          onBlur={() => this.updateText('onBlur')}\n          onChange={(event) => this.updateText(\n            'onChange text: ' + event.nativeEvent.text\n          )}\n          onEndEditing={(event) => this.updateText(\n            'onEndEditing text: ' + event.nativeEvent.text\n          )}\n          onSubmitEditing={(event) => this.updateText(\n            'onSubmitEditing text: ' + event.nativeEvent.text\n          )}\n          onSelectionChange={(event) => this.updateText(\n            'onSelectionChange range: ' +\n              event.nativeEvent.selection.start + ',' +\n              event.nativeEvent.selection.end\n          )}\n          onKeyPress={(event) => {\n            this.updateText('onKeyPress key: ' + event.nativeEvent.key);\n          }}\n          style={styles.default}\n        />\n        <Text style={styles.eventLabel}>\n          {this.state.curText}{'\\n'}\n          (prev: {this.state.prevText}){'\\n'}\n          (prev2: {this.state.prev2Text}){'\\n'}\n          (prev3: {this.state.prev3Text})\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass RewriteExample extends React.Component<$FlowFixMeProps, any> {\n  constructor(props) {\n    super(props);\n    this.state = {text: ''};\n  }\n  render() {\n    var limit = 20;\n    var remainder = limit - this.state.text.length;\n    var remainderColor = remainder > 5 ? 'blue' : 'red';\n    return (\n      <View style={styles.rewriteContainer}>\n        <TextInput\n          multiline={false}\n          maxLength={limit}\n          onChangeText={(text) => {\n            text = text.replace(/ /g, '_');\n            this.setState({text});\n          }}\n          style={styles.default}\n          value={this.state.text}\n        />\n        <Text style={[styles.remainder, {color: remainderColor}]}>\n          {remainder}\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass RewriteExampleInvalidCharacters extends React.Component<$FlowFixMeProps, any> {\n  constructor(props) {\n    super(props);\n    this.state = {text: ''};\n  }\n  render() {\n    return (\n      <View style={styles.rewriteContainer}>\n        <TextInput\n          multiline={false}\n          onChangeText={(text) => {\n            this.setState({text: text.replace(/\\s/g, '')});\n          }}\n          style={styles.default}\n          value={this.state.text}\n        />\n      </View>\n    );\n  }\n}\n\nclass TokenizedTextExample extends React.Component<$FlowFixMeProps, any> {\n  constructor(props) {\n    super(props);\n    this.state = {text: 'Hello #World'};\n  }\n  render() {\n\n    //define delimiter\n    let delimiter = /\\s+/;\n\n    //split string\n    let _text = this.state.text;\n    let token, index, parts = [];\n    while (_text) {\n      delimiter.lastIndex = 0;\n      token = delimiter.exec(_text);\n      if (token === null) {\n        break;\n      }\n      index = token.index;\n      if (token[0].length === 0) {\n        index = 1;\n      }\n      parts.push(_text.substr(0, index));\n      parts.push(token[0]);\n      index = index + token[0].length;\n      _text = _text.slice(index);\n    }\n    parts.push(_text);\n\n    //highlight hashtags\n    parts = parts.map((text) => {\n      if (/^#/.test(text)) {\n        return <Text key={text} style={styles.hashtag}>{text}</Text>;\n      } else {\n        return text;\n      }\n    });\n\n    return (\n      <View>\n        <TextInput\n          multiline={true}\n          style={styles.multiline}\n          onChangeText={(text) => {\n            this.setState({text});\n          }}>\n          <Text>{parts}</Text>\n        </TextInput>\n      </View>\n    );\n  }\n}\n\nclass BlurOnSubmitExample extends React.Component<{}> {\n  focusNextField = (nextField) => {\n    this.refs[nextField].focus();\n  };\n\n  render() {\n    return (\n      <View>\n        <TextInput\n          ref=\"1\"\n          style={styles.default}\n          placeholder=\"blurOnSubmit = false\"\n          returnKeyType=\"next\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('2')}\n        />\n        <TextInput\n          ref=\"2\"\n          style={styles.default}\n          keyboardType=\"email-address\"\n          placeholder=\"blurOnSubmit = false\"\n          returnKeyType=\"next\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('3')}\n        />\n        <TextInput\n          ref=\"3\"\n          style={styles.default}\n          keyboardType=\"url\"\n          placeholder=\"blurOnSubmit = false\"\n          returnKeyType=\"next\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('4')}\n        />\n        <TextInput\n          ref=\"4\"\n          style={styles.default}\n          keyboardType=\"numeric\"\n          returnKeyType=\"done\"\n          placeholder=\"blurOnSubmit = false\"\n          blurOnSubmit={false}\n          onSubmitEditing={() => this.focusNextField('5')}\n        />\n        <TextInput\n          ref=\"5\"\n          style={styles.default}\n          keyboardType=\"numbers-and-punctuation\"\n          placeholder=\"blurOnSubmit = true\"\n          returnKeyType=\"done\"\n        />\n      </View>\n    );\n  }\n}\n\ntype SelectionExampleState = {\n  selection: {\n    start: number;\n    end?: number;\n  };\n  value: string;\n};\n\nclass SelectionExample extends React.Component<$FlowFixMeProps, SelectionExampleState> {\n  _textInput: any;\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      selection: {start: 0, end: 0},\n      value: props.value\n    };\n  }\n\n  onSelectionChange({nativeEvent: {selection}}) {\n    this.setState({selection});\n  }\n\n  getRandomPosition() {\n    var length = this.state.value.length;\n    return Math.round(Math.random() * length);\n  }\n\n  select(start, end) {\n    this._textInput.focus();\n    this.setState({selection: {start, end}});\n  }\n\n  selectRandom() {\n    var positions = [this.getRandomPosition(), this.getRandomPosition()].sort((a, b) => a - b);\n    this.select(...positions);\n  }\n\n  placeAt(position) {\n    this.select(position, position);\n  }\n\n  placeAtRandom() {\n    this.placeAt(this.getRandomPosition());\n  }\n\n  render() {\n    var length = this.state.value.length;\n\n    return (\n      <View>\n        <TextInput\n          multiline={this.props.multiline}\n          onChangeText={(value) => this.setState({value})}\n          onSelectionChange={this.onSelectionChange.bind(this)}\n          ref={textInput => (this._textInput = textInput)}\n          selection={this.state.selection}\n          style={this.props.style}\n          value={this.state.value}\n        />\n        <View>\n          <Text>\n            selection = {JSON.stringify(this.state.selection)}\n          </Text>\n          <Text onPress={this.placeAt.bind(this, 0)}>\n            Place at Start (0, 0)\n          </Text>\n          <Text onPress={this.placeAt.bind(this, length)}>\n            Place at End ({length}, {length})\n          </Text>\n          <Text onPress={this.placeAtRandom.bind(this)}>\n            Place at Random\n          </Text>\n          <Text onPress={this.select.bind(this, 0, length)}>\n            Select All\n          </Text>\n          <Text onPress={this.selectRandom.bind(this)}>\n            Select Random\n          </Text>\n        </View>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  page: {\n    paddingBottom: 300,\n  },\n  default: {\n    borderWidth: StyleSheet.hairlineWidth,\n    borderColor: '#0f0f0f',\n    flex: 1,\n    fontSize: 13,\n    padding: 4,\n  },\n  multiline: {\n    borderWidth: StyleSheet.hairlineWidth,\n    borderColor: 'rgba(0, 0, 0, 0.1)',\n    flex: 1,\n    fontSize: 13,\n    height: 50,\n    padding: 4,\n    marginBottom: 4,\n  },\n  multilineExpandable: {\n    height: 'auto',\n    maxHeight: 100,\n  },\n  multilineWithFontStyles: {\n    color: 'blue',\n    fontWeight: 'bold',\n    fontSize: 18,\n    fontFamily: 'Cochin',\n    height: 60,\n  },\n  multilineChild: {\n    width: 50,\n    height: 40,\n    position: 'absolute',\n    right: 5,\n    backgroundColor: 'red',\n  },\n  eventLabel: {\n    margin: 3,\n    fontSize: 12,\n  },\n  labelContainer: {\n    flexDirection: 'row',\n    marginVertical: 2,\n    flex: 1,\n  },\n  label: {\n    width: 115,\n    alignItems: 'flex-end',\n    marginRight: 10,\n    paddingTop: 2,\n  },\n  rewriteContainer: {\n    flexDirection: 'row',\n    alignItems: 'center',\n  },\n  remainder: {\n    textAlign: 'right',\n    width: 24,\n  },\n  hashtag: {\n    color: 'blue',\n    fontWeight: 'bold',\n  },\n});\n\nexports.displayName = (undefined: ?string);\nexports.title = '<TextInput>';\nexports.description = 'Single and multi-line text inputs.';\nexports.examples = [\n  {\n    title: 'Auto-focus',\n    render: function() {\n      return (\n        <TextInput\n          autoFocus={true}\n          style={styles.default}\n          placeholder=\"text\"\n          accessibilityLabel=\"I am the accessibility label for text input\"\n        />\n      );\n    }\n  },\n  {\n    title: \"Live Re-Write (<sp>  ->  '_') + maxLength\",\n    render: function() {\n      return <RewriteExample />;\n    }\n  },\n  {\n    title: 'Live Re-Write (no spaces allowed)',\n    render: function() {\n      return <RewriteExampleInvalidCharacters />;\n    }\n  },\n  // {\n  //   title: 'Auto-capitalize',\n  //   render: function() {\n  //     return (\n  //       <View>\n  //         <WithLabel label=\"none\">\n  //           <TextInput\n  //             autoCapitalize=\"none\"\n  //             style={styles.default}\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"sentences\">\n  //           <TextInput\n  //             autoCapitalize=\"sentences\"\n  //             style={styles.default}\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"words\">\n  //           <TextInput\n  //             autoCapitalize=\"words\"\n  //             style={styles.default}\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"characters\">\n  //           <TextInput\n  //             autoCapitalize=\"characters\"\n  //             style={styles.default}\n  //           />\n  //         </WithLabel>\n  //       </View>\n  //     );\n  //   }\n  // },\n  // {\n  //   title: 'Auto-correct',\n  //   render: function() {\n  //     return (\n  //       <View>\n  //         <WithLabel label=\"true\">\n  //           <TextInput autoCorrect={true} style={styles.default} />\n  //         </WithLabel>\n  //         <WithLabel label=\"false\">\n  //           <TextInput autoCorrect={false} style={styles.default} />\n  //         </WithLabel>\n  //       </View>\n  //     );\n  //   }\n  // },\n  // {\n  //   title: 'Keyboard types',\n  //   render: function() {\n  //     var keyboardTypes = [\n  //       'default',\n  //       'ascii-capable',\n  //       'numbers-and-punctuation',\n  //       'url',\n  //       'number-pad',\n  //       'phone-pad',\n  //       'name-phone-pad',\n  //       'email-address',\n  //       'decimal-pad',\n  //       'twitter',\n  //       'web-search',\n  //       'numeric',\n  //     ];\n  //     var examples = keyboardTypes.map((type) => {\n  //       return (\n  //         <WithLabel key={type} label={type}>\n  //           <TextInput\n  //             keyboardType={type}\n  //             style={styles.default}\n  //           />\n  //         </WithLabel>\n  //       );\n  //     });\n  //     return <View>{examples}</View>;\n  //   }\n  // },\n  // {\n  //   title: 'Keyboard appearance',\n  //   render: function() {\n  //     var keyboardAppearance = [\n  //       'default',\n  //       'light',\n  //       'dark',\n  //     ];\n  //     var examples = keyboardAppearance.map((type) => {\n  //       return (\n  //         <WithLabel key={type} label={type}>\n  //           <TextInput\n  //             keyboardAppearance={type}\n  //             style={styles.default}\n  //           />\n  //         </WithLabel>\n  //       );\n  //     });\n  //     return <View>{examples}</View>;\n  //   }\n  // },\n  // {\n  //   title: 'Return key types',\n  //   render: function() {\n  //     var returnKeyTypes = [\n  //       'default',\n  //       'go',\n  //       'google',\n  //       'join',\n  //       'next',\n  //       'route',\n  //       'search',\n  //       'send',\n  //       'yahoo',\n  //       'done',\n  //       'emergency-call',\n  //     ];\n  //     var examples = returnKeyTypes.map((type) => {\n  //       return (\n  //         <WithLabel key={type} label={type}>\n  //           <TextInput\n  //             returnKeyType={type}\n  //             style={styles.default}\n  //           />\n  //         </WithLabel>\n  //       );\n  //     });\n  //     return <View>{examples}</View>;\n  //   }\n  // },\n  // {\n  //   title: 'Enable return key automatically',\n  //   render: function() {\n  //     return (\n  //       <View>\n  //         <WithLabel label=\"true\">\n  //           <TextInput enablesReturnKeyAutomatically={true} style={styles.default} />\n  //         </WithLabel>\n  //       </View>\n  //     );\n  //   }\n  // },\n  {\n    title: 'Password',\n    render: function() {\n      return (\n        <View>\n          <WithLabel label=\"true\">\n            <TextInput password={true} style={styles.default} defaultValue=\"abc\" />\n          </WithLabel>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Event handling',\n    render: function(): React.Element<any> { return <TextEventsExample />; },\n  },\n  // {\n  //   title: 'Colored input text',\n  //   render: function() {\n  //     return (\n  //       <View>\n  //         <TextInput\n  //           style={[styles.default, {color: 'blue'}]}\n  //           defaultValue=\"Blue\"\n  //         />\n  //         <TextInput\n  //           style={[styles.default, {color: 'green'}]}\n  //           defaultValue=\"Green\"\n  //         />\n  //       </View>\n  //     );\n  //   }\n  // },\n  // {\n  //   title: 'Colored highlight/cursor for text input',\n  //   render: function() {\n  //     return (\n  //       <View>\n  //         <TextInput\n  //           style={styles.default}\n  //           selectionColor={'green'}\n  //           defaultValue=\"Highlight me\"\n  //         />\n  //         <TextInput\n  //           style={styles.default}\n  //           selectionColor={'rgba(86, 76, 205, 1)'}\n  //           defaultValue=\"Highlight me\"\n  //         />\n  //       </View>\n  //     );\n  //   }\n  // },\n  // {\n  //   title: 'Clear button mode',\n  //   render: function () {\n  //     return (\n  //       <View>\n  //         <WithLabel label=\"never\">\n  //           <TextInput\n  //             style={styles.default}\n  //             clearButtonMode=\"never\"\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"while editing\">\n  //           <TextInput\n  //             style={styles.default}\n  //             clearButtonMode=\"while-editing\"\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"unless editing\">\n  //           <TextInput\n  //             style={styles.default}\n  //             clearButtonMode=\"unless-editing\"\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"always\">\n  //           <TextInput\n  //             style={styles.default}\n  //             clearButtonMode=\"always\"\n  //           />\n  //         </WithLabel>\n  //       </View>\n  //     );\n  //   }\n  // },\n  // {\n  //   title: 'Clear and select',\n  //   render: function() {\n  //     return (\n  //       <View>\n  //         <WithLabel label=\"clearTextOnFocus\">\n  //           <TextInput\n  //             placeholder=\"text is cleared on focus\"\n  //             defaultValue=\"text is cleared on focus\"\n  //             style={styles.default}\n  //             clearTextOnFocus={true}\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"selectTextOnFocus\">\n  //           <TextInput\n  //             placeholder=\"text is selected on focus\"\n  //             defaultValue=\"text is selected on focus\"\n  //             style={styles.default}\n  //             selectTextOnFocus={true}\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"clearTextOnFocus (multiline)\">\n  //           <TextInput\n  //             placeholder=\"text is cleared on focus\"\n  //             defaultValue=\"text is cleared on focus\"\n  //             style={styles.default}\n  //             clearTextOnFocus={true}\n  //             multiline={true}\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"selectTextOnFocus (multiline)\">\n  //           <TextInput\n  //             placeholder=\"text is selected on focus\"\n  //             defaultValue=\"text is selected on focus\"\n  //             style={styles.default}\n  //             selectTextOnFocus={true}\n  //             multiline={true}\n  //           />\n  //         </WithLabel>\n  //       </View>\n  //     );\n  //   }\n  // },\n  // {\n  //   title: 'Blur on submit',\n  //   render: function(): React.Element<any> { return <BlurOnSubmitExample />; },\n  // },\n  // {\n  //   title: 'Multiline blur on submit',\n  //   render: function() {\n  //     return (\n  //       <View>\n  //         <TextInput\n  //           style={styles.multiline}\n  //           placeholder=\"blurOnSubmit = true\"\n  //           returnKeyType=\"next\"\n  //           blurOnSubmit={true}\n  //           multiline={true}\n  //           onSubmitEditing={event => alert(event.nativeEvent.text)}\n  //         />\n  //       </View>\n  //     );\n  //   }\n  // },\n  {\n    title: 'Multiline',\n    render: function() {\n      return (\n        <View>\n          <TextInput\n            placeholder=\"multiline text input\"\n            multiline={true}\n            style={styles.multiline}\n          />\n          <TextInput\n            placeholder=\"multiline text input with font styles and placeholder\"\n            multiline={true}\n            clearTextOnFocus={true}\n            //autoCorrect={true}\n            //autoCapitalize=\"words\"\n            placeholderTextColor=\"red\"\n            keyboardType=\"url\"\n            style={[styles.multiline, styles.multilineWithFontStyles]}\n          />\n          <TextInput\n            placeholder=\"multiline text input with max length\"\n            maxLength={5}\n            multiline={true}\n            style={styles.multiline}\n          />\n          <TextInput\n            placeholder=\"uneditable multiline text input\"\n            editable={false}\n            multiline={true}\n            style={styles.multiline}\n          />\n          {/* <TextInput\n             defaultValue=\"uneditable multiline text input with phone number detection: 88888888.\"\n             editable={false}\n             multiline={true}\n             style={styles.multiline}\n             dataDetectorTypes=\"phoneNumber\"\n          /> */}\n          <TextInput\n            placeholder=\"multiline with children\"\n            multiline={true}\n            enablesReturnKeyAutomatically={true}\n            returnKeyType=\"go\"\n            style={styles.multiline}>\n            <View style={styles.multilineChild}/>\n          </TextInput>\n        </View>\n      );\n    }\n  },\n  {\n    title: 'TextInput Intrinsic Size',\n    render: function() {\n      return (\n        <View>\n          <Text>Singleline TextInput</Text>\n          <View style={{height: 80}}>\n            <TextInput\n              style={{\n                position: 'absolute',\n                fontSize: 16,\n                backgroundColor: '#eeeeee',\n                borderColor: '#666666',\n                borderWidth: 5,\n                borderTopWidth: 20,\n                borderRadius: 10,\n                borderBottomRightRadius: 20,\n                padding: 10,\n                paddingTop: 20,\n              }}\n              testID=\"singleline_textinput\"\n              placeholder=\"Placeholder defines intrinsic size\"\n            />\n          </View>\n          <Text>Multiline TextInput</Text>\n          <View style={{height: 130}}>\n            <TextInput\n              style={{\n                position: 'absolute',\n                fontSize: 16,\n                backgroundColor: '#eeeeee',\n                borderColor: '#666666',\n                borderWidth: 5,\n                borderTopWidth: 20,\n                borderRadius: 10,\n                borderBottomRightRadius: 20,\n                padding: 10,\n                paddingTop: 20,\n                maxHeight: 100\n              }}\n              testID=\"multiline_textinput\"\n              multiline={true}\n              placeholder=\"Placeholder defines intrinsic size\"\n            />\n          </View>\n          <View>\n            <TextInput\n              style={{\n                fontSize: 16,\n                backgroundColor: '#eeeeee',\n                borderColor: '#666666',\n                borderWidth: 5,\n                borderTopWidth: 20,\n                borderRadius: 10,\n                borderBottomRightRadius: 20,\n                padding: 10,\n                paddingTop: 20,\n              }}\n              testID=\"multiline_textinput_with_flex\"\n              multiline={true}\n              placeholder=\"Placeholder defines intrinsic size\"\n            />\n          </View>\n        </View>\n      );\n    }\n  },\n  // {\n  //   title: 'Auto-expanding',\n  //   render: function() {\n  //     return (\n  //       <View>\n  //         <TextInput\n  //           placeholder=\"height increases with content\"\n  //           defaultValue=\"React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native.\"\n  //           multiline={true}\n  //           enablesReturnKeyAutomatically={true}\n  //           returnKeyType=\"go\"\n  //           style={[styles.multiline, styles.multilineExpandable]}\n  //         />\n  //       </View>\n  //     );\n  //   }\n  // },\n  {\n    title: 'Attributed text',\n    render: function() {\n      return <TokenizedTextExample />;\n    }\n  },\n  // {\n  //   title: 'Text selection & cursor placement',\n  //   render: function() {\n  //     return (\n  //       <View>\n  //         <SelectionExample\n  //           style={styles.default}\n  //           value=\"text selection can be changed\"\n  //         />\n  //         <SelectionExample\n  //           multiline\n  //           style={styles.multiline}\n  //           value={'multiline text selection\\ncan also be changed'}\n  //         />\n  //       </View>\n  //     );\n  //   }\n  // },\n  // {\n  //   title: 'TextInput maxLength',\n  //   render: function() {\n  //     return (\n  //       <View>\n  //         <WithLabel label=\"maxLength: 5\">\n  //           <TextInput\n  //             maxLength={5}\n  //             style={styles.default}\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"maxLength: 5 with placeholder\">\n  //           <TextInput\n  //             maxLength={5}\n  //             placeholder=\"ZIP code entry\"\n  //             style={styles.default}\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"maxLength: 5 with default value already set\">\n  //           <TextInput\n  //             maxLength={5}\n  //             defaultValue=\"94025\"\n  //             style={styles.default}\n  //           />\n  //         </WithLabel>\n  //         <WithLabel label=\"maxLength: 5 with very long default value already set\">\n  //           <TextInput\n  //             maxLength={5}\n  //             defaultValue=\"9402512345\"\n  //             style={styles.default}\n  //           />\n  //         </WithLabel>\n  //       </View>\n  //     );\n  //   }\n//  },\n];\n"
  },
  {
    "path": "RNTester/js/TimePickerAndroidExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TimePickerAndroidExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  TimePickerAndroid,\n  StyleSheet,\n  Text,\n  TouchableWithoutFeedback,\n} = ReactNative;\n\nvar RNTesterBlock = require('./RNTesterBlock');\nvar RNTesterPage = require('./RNTesterPage');\n\nclass TimePickerAndroidExample extends React.Component {\n  static title = 'TimePickerAndroid';\n  static description = 'Standard Android time picker dialog';\n\n  state = {\n    isoFormatText: 'pick a time (24-hour format)',\n    presetHour: 4,\n    presetMinute: 4,\n    presetText: 'pick a time, default: 4:04AM',\n    simpleText: 'pick a time',\n    clockText: 'pick a time',\n    spinnerText: 'pick a time',\n    defaultText: 'pick a time',\n  };\n\n  showPicker = async (stateKey, options) => {\n    try {\n      const {action, minute, hour} = await TimePickerAndroid.open(options);\n      var newState = {};\n      if (action === TimePickerAndroid.timeSetAction) {\n        newState[stateKey + 'Text'] = _formatTime(hour, minute);\n        newState[stateKey + 'Hour'] = hour;\n        newState[stateKey + 'Minute'] = minute;\n      } else if (action === TimePickerAndroid.dismissedAction) {\n        newState[stateKey + 'Text'] = 'dismissed';\n      }\n      this.setState(newState);\n    } catch ({code, message}) {\n      console.warn(`Error in example '${stateKey}': `, message);\n    }\n  };\n\n  render() {\n    return (\n      <RNTesterPage title=\"TimePickerAndroid\">\n        <RNTesterBlock title=\"Simple time picker\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'simple', {})}>\n            <Text style={styles.text}>{this.state.simpleText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Simple clock time picker\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'clock', {mode: 'clock'})}>\n            <Text style={styles.text}>{this.state.clockText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Simple spinner time picker\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'spinner', {mode: 'spinner'})}>\n            <Text style={styles.text}>{this.state.spinnerText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Simple default time picker\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'default', {mode: 'default'})}>\n            <Text style={styles.text}>{this.state.defaultText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Time picker with pre-set time\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'preset', {\n              hour: this.state.presetHour,\n              minute: this.state.presetMinute,\n            })}>\n            <Text style={styles.text}>{this.state.presetText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Time picker with 24-hour time format\">\n          <TouchableWithoutFeedback\n            onPress={this.showPicker.bind(this, 'isoFormat', {\n              hour: this.state.isoFormatHour,\n              minute: this.state.isoFormatMinute,\n              is24Hour: true,\n            })}>\n            <Text style={styles.text}>{this.state.isoFormatText}</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n      </RNTesterPage>\n    );\n  }\n}\n\n/**\n * Returns e.g. '3:05'.\n */\nfunction _formatTime(hour, minute) {\n  return hour + ':' + (minute < 10 ? '0' + minute : minute);\n}\n\nvar styles = StyleSheet.create({\n  text: {\n    color: 'black',\n  },\n});\n\nmodule.exports = TimePickerAndroidExample;\n\n"
  },
  {
    "path": "RNTester/js/TimerExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TimerExample\n */\n'use strict';\n\nvar React = require('react');\nvar createReactClass = require('create-react-class');\nvar ReactNative = require('react-native');\nvar {\n  AlertIOS,\n  Platform,\n  ToastAndroid,\n  Text,\n  View,\n} = ReactNative;\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar TimerMixin = require('react-timer-mixin');\nvar RNTesterButton = require('./RNTesterButton');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nvar performanceNow = require('fbjs/lib/performanceNow');\n\nfunction burnCPU(milliseconds) {\n  const start = performanceNow();\n  while (performanceNow() < (start + milliseconds)) {}\n}\n\nclass RequestIdleCallbackTester extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    message: '-',\n  };\n\n  _idleTimer: any = null;\n  _iters = 0;\n\n  componentWillUnmount() {\n    cancelIdleCallback(this._idleTimer);\n  }\n\n  render() {\n    return (\n      <View>\n        <RNTesterButton onPress={this._run.bind(this, false)}>\n          Run requestIdleCallback\n        </RNTesterButton>\n\n        <RNTesterButton onPress={this._run.bind(this, true)}>\n          Burn CPU inside of requestIdleCallback\n        </RNTesterButton>\n\n        <RNTesterButton onPress={this._runWithTimeout.bind(this)}>\n          Run requestIdleCallback with timeout option\n        </RNTesterButton>\n\n        <RNTesterButton onPress={this._runBackground}>\n          Run background task\n        </RNTesterButton>\n\n        <RNTesterButton onPress={this._stopBackground}>\n          Stop background task\n        </RNTesterButton>\n\n        <Text>{this.state.message}</Text>\n      </View>\n    );\n  }\n\n  _run = (shouldBurnCPU) => {\n    cancelIdleCallback(this._idleTimer);\n    this._idleTimer = requestIdleCallback((deadline) => {\n      let message = '';\n\n      if (shouldBurnCPU) {\n        burnCPU(10);\n        message = 'Burned CPU for 10ms,';\n      }\n      this.setState({message: `${message} ${deadline.timeRemaining()}ms remaining in frame`});\n    });\n  };\n\n  _runWithTimeout = () => {\n    cancelIdleCallback(this._idleTimer);\n    this._idleTimer = requestIdleCallback((deadline) => {\n      this.setState({\n        message: `${deadline.timeRemaining()}ms remaining in frame, it did timeout: ${deadline.didTimeout ? 'yes' : 'no'}`\n      });\n    }, { timeout: 100 });\n    burnCPU(100);\n  };\n\n  _runBackground = () => {\n    cancelIdleCallback(this._idleTimer);\n    const handler = (deadline) => {\n      while (deadline.timeRemaining() > 5) {\n        burnCPU(5);\n        this.setState({message: `Burned CPU for 5ms ${this._iters++} times, ${deadline.timeRemaining()}ms remaining in frame`});\n      }\n\n      this._idleTimer = requestIdleCallback(handler);\n    };\n    this._idleTimer = requestIdleCallback(handler);\n  };\n\n  _stopBackground = () => {\n    this._iters = 0;\n    cancelIdleCallback(this._idleTimer);\n  };\n}\n\nvar TimerTester = createReactClass({\n  displayName: 'TimerTester',\n  mixins: [TimerMixin],\n\n  _ii: 0,\n  _iters: 0,\n  _start: 0,\n  _timerFn: (null : ?(() => any)),\n  _handle: (null : any),\n\n  render: function() {\n    var args = 'fn' + (this.props.dt !== undefined ? ', ' + this.props.dt : '');\n    return (\n      <RNTesterButton onPress={this._run}>\n        Measure: {this.props.type}({args}) - {this._ii || 0}\n      </RNTesterButton>\n    );\n  },\n\n  _run: function() {\n    if (!this._start) {\n      var d = new Date();\n      this._start = d.getTime();\n      this._iters = 100;\n      this._ii = 0;\n      if (this.props.type === 'setTimeout') {\n        if (this.props.dt < 1) {\n          this._iters = 5000;\n        } else if (this.props.dt > 20) {\n          this._iters = 10;\n        }\n        this._timerFn = () => this.setTimeout(this._run, this.props.dt);\n      } else if (this.props.type === 'requestAnimationFrame') {\n        this._timerFn = () => this.requestAnimationFrame(this._run);\n      } else if (this.props.type === 'setImmediate') {\n        this._iters = 5000;\n        this._timerFn = () => this.setImmediate(this._run);\n      } else if (this.props.type === 'setInterval') {\n        this._iters = 30; // Only used for forceUpdate periodicidy\n        this._timerFn = null;\n        this._handle = this.setInterval(this._run, this.props.dt);\n      }\n    }\n    if (this._ii >= this._iters && !this._handle) {\n      var d = new Date();\n      var e = (d.getTime() - this._start);\n      var msg = 'Finished ' + this._ii + ' ' + this.props.type + ' calls.\\n' +\n        'Elapsed time: ' + e + ' ms\\n' + (e / this._ii) + ' ms / iter';\n      console.log(msg);\n      if (Platform.OS === 'ios') {\n        AlertIOS.alert(msg);\n      } else if (Platform.OS === 'android') {\n        ToastAndroid.show(msg, ToastAndroid.SHORT);\n      }\n      this._start = 0;\n      this.forceUpdate(() => { this._ii = 0; });\n      return;\n    }\n    this._ii++;\n    // Only re-render occasionally so we don't slow down timers.\n    if (this._ii % (this._iters / 5) === 0) {\n      this.forceUpdate();\n    }\n    this._timerFn && this._timerFn();\n  },\n\n  clear: function() {\n    this.clearInterval(this._handle); // invalid handles are ignored\n    if (this._handle) {\n      // Configure things so we can do a final run to update UI and reset state.\n      this._handle = null;\n      this._iters = this._ii;\n      this._run();\n    }\n  },\n});\n\nexports.framework = 'React';\nexports.title = 'Timers, TimerMixin';\nexports.description = 'The TimerMixin provides timer functions for executing ' +\n  'code in the future that are safely cleaned up when the component unmounts.';\n\nexports.examples = [\n  {\n    title: 'this.setTimeout(fn, t)',\n    description: 'Execute function fn t milliseconds in the future.  If ' +\n      't === 0, it will be enqueued immediately in the next event loop.  ' +\n      'Larger values will fire on the closest frame.',\n    render: function() {\n      return (\n        <View>\n          <TimerTester type=\"setTimeout\" dt={0} />\n          <TimerTester type=\"setTimeout\" dt={1} />\n          <TimerTester type=\"setTimeout\" dt={100} />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'this.requestAnimationFrame(fn)',\n    description: 'Execute function fn on the next frame.',\n    render: function() {\n      return (\n        <View>\n          <TimerTester type=\"requestAnimationFrame\" />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'this.requestIdleCallback(fn)',\n    description: 'Execute function fn on the next JS frame that has idle time',\n    render: function() {\n      return (\n        <View>\n          <RequestIdleCallbackTester />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'this.setImmediate(fn)',\n    description: 'Execute function fn at the end of the current JS event loop.',\n    render: function() {\n      return (\n        <View>\n          <TimerTester type=\"setImmediate\" />\n        </View>\n      );\n    },\n  },\n  {\n    title: 'this.setInterval(fn, t)',\n    description: 'Execute function fn every t milliseconds until cancelled ' +\n      'or component is unmounted.',\n    render: function(): React.Element<any> {\n      class IntervalExample extends React.Component<{}, $FlowFixMeState> {\n        state = {\n          showTimer: true,\n        };\n\n        render() {\n          return (\n            <View>\n              {this.state.showTimer && this._renderTimer()}\n              <RNTesterButton onPress={this._toggleTimer}>\n                {this.state.showTimer ? 'Unmount timer' : 'Mount new timer'}\n              </RNTesterButton>\n            </View>\n          );\n        }\n\n        _renderTimer = () => {\n          return (\n            <View>\n              <TimerTester ref=\"interval\" dt={25} type=\"setInterval\" />\n              <RNTesterButton onPress={() => this.refs.interval.clear() }>\n                Clear interval\n              </RNTesterButton>\n            </View>\n          );\n        };\n\n        _toggleTimer = () => {\n          this.setState({showTimer: !this.state.showTimer});\n        };\n      }\n\n      return <IntervalExample />;\n    },\n  },\n];\n"
  },
  {
    "path": "RNTester/js/ToastAndroidExample.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ToastAndroidExample\n */\n\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  ToastAndroid,\n  TouchableWithoutFeedback,\n} = ReactNative;\n\nvar RNTesterBlock = require('RNTesterBlock');\nvar RNTesterPage = require('RNTesterPage');\n\nclass ToastExample extends React.Component<{}, $FlowFixMeState> {\n  static title = 'Toast Example';\n  static description = 'Example that demonstrates the use of an Android Toast to provide feedback.';\n  state = {};\n\n  render() {\n    return (\n      <RNTesterPage title=\"ToastAndroid\">\n        <RNTesterBlock title=\"Simple toast\">\n          <TouchableWithoutFeedback\n            onPress={() =>\n              ToastAndroid.show('This is a toast with short duration', ToastAndroid.SHORT)}>\n            <Text style={styles.text}>Click me.</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toast with long duration\">\n          <TouchableWithoutFeedback\n            onPress={() =>\n              ToastAndroid.show('This is a toast with long duration', ToastAndroid.LONG)}>\n            <Text style={styles.text}>Click me.</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toast with top gravity\">\n          <TouchableWithoutFeedback\n            onPress={() =>\n              ToastAndroid.showWithGravity(\n                'This is a toast with top gravity',\n                ToastAndroid.SHORT,\n                ToastAndroid.TOP,\n              )\n            }>\n            <Text style={styles.text}>Click me.</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toast with center gravity\">\n          <TouchableWithoutFeedback\n            onPress={() =>\n              ToastAndroid.showWithGravity(\n                'This is a toast with center gravity',\n                ToastAndroid.SHORT,\n                ToastAndroid.CENTER,\n              )\n            }>\n            <Text style={styles.text}>Click me.</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toast with bottom gravity\">\n          <TouchableWithoutFeedback\n            onPress={() =>\n              ToastAndroid.showWithGravity(\n                'This is a toast with bottom gravity',\n                ToastAndroid.SHORT,\n                ToastAndroid.BOTTOM,\n              )\n            }>\n            <Text style={styles.text}>Click me.</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toast with x offset\">\n          <TouchableWithoutFeedback\n            onPress={() =>\n              ToastAndroid.showWithGravityAndOffset(\n                'This is a toast with x offset',\n                ToastAndroid.SHORT,\n                ToastAndroid.CENTER,\n                50,\n                0,\n              )\n            }>\n            <Text style={styles.text}>Click me.</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toast with y offset\">\n          <TouchableWithoutFeedback\n            onPress={() =>\n              ToastAndroid.showWithGravityAndOffset(\n                'This is a toast with y offset',\n                ToastAndroid.SHORT,\n                ToastAndroid.BOTTOM,\n                0,\n                50,\n              )\n            }>\n            <Text style={styles.text}>Click me.</Text>\n          </TouchableWithoutFeedback>\n        </RNTesterBlock>\n      </RNTesterPage>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  text: {\n    color: 'black',\n  },\n});\n\nmodule.exports = ToastExample;\n"
  },
  {
    "path": "RNTester/js/ToolbarAndroidExample.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ToolbarAndroidExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\n\nvar nativeImageSource = require('nativeImageSource');\nvar {\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\nvar RNTesterBlock = require('./RNTesterBlock');\nvar RNTesterPage = require('./RNTesterPage');\n\nvar Switch = require('Switch');\nvar ToolbarAndroid = require('ToolbarAndroid');\n\nclass ToolbarAndroidExample extends React.Component<{}, $FlowFixMeState> {\n  static title = '<ToolbarAndroid>';\n  static description = 'Examples of using the Android toolbar.';\n\n  state = {\n    actionText: 'Example app with toolbar component',\n    toolbarSwitch: false,\n    colorProps: {\n      titleColor: '#3b5998',\n      subtitleColor: '#6a7180',\n    },\n  };\n\n  render() {\n    return (\n      <RNTesterPage title=\"<ToolbarAndroid>\">\n        <RNTesterBlock title=\"Toolbar with title/subtitle and actions\">\n          <ToolbarAndroid\n            actions={toolbarActions}\n            navIcon={nativeImageSource({\n              android: 'ic_menu_black_24dp',\n              width: 48,\n              height: 48\n            })}\n            onActionSelected={this._onActionSelected}\n            onIconClicked={() => this.setState({actionText: 'Icon clicked'})}\n            style={styles.toolbar}\n            subtitle={this.state.actionText}\n            title=\"Toolbar\" />\n          <Text>{this.state.actionText}</Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toolbar with logo & custom title view (a View with Switch+Text)\">\n          <ToolbarAndroid\n            logo={nativeImageSource({\n              android: 'launcher_icon',\n              width: 132,\n              height: 144\n            })}\n            style={styles.toolbar}>\n            <View style={{height: 56, flexDirection: 'row', alignItems: 'center'}}>\n              <Switch\n                value={this.state.toolbarSwitch}\n                onValueChange={(value) => this.setState({'toolbarSwitch': value})} />\n              <Text>{'\\'Tis but a switch'}</Text>\n            </View>\n          </ToolbarAndroid>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toolbar with no icon\">\n          <ToolbarAndroid\n            actions={toolbarActions}\n            style={styles.toolbar}\n            subtitle=\"There be no icon here\" />\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toolbar with navIcon & logo, no title\">\n          <ToolbarAndroid\n            actions={toolbarActions}\n            logo={nativeImageSource({\n              android: 'launcher_icon',\n              width: 132,\n              height: 144\n            })}\n            navIcon={nativeImageSource({\n              android: 'ic_menu_black_24dp',\n              width: 48,\n              height: 48\n            })}\n            style={styles.toolbar} />\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toolbar with custom title colors\">\n          <ToolbarAndroid\n            navIcon={nativeImageSource({\n              android: 'ic_menu_black_24dp',\n              width: 48,\n              height: 48\n            })}\n            onIconClicked={() => this.setState({colorProps: {}})}\n            title=\"Wow, such toolbar\"\n            style={styles.toolbar}\n            subtitle=\"Much native\"\n            {...this.state.colorProps} />\n          <Text>\n            Touch the icon to reset the custom colors to the default (theme-provided) ones.\n          </Text>\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toolbar with remote logo & navIcon\">\n          <ToolbarAndroid\n            actions={[{title: 'Bunny', icon: require('./bunny.png'), show: 'always'}]}\n            logo={require('./hawk.png')}\n            navIcon={require('./bunny.png')}\n            title=\"Bunny and Hawk\"\n            style={styles.toolbar} />\n        </RNTesterBlock>\n        <RNTesterBlock title=\"Toolbar with custom overflowIcon\">\n          <ToolbarAndroid\n            actions={toolbarActions}\n            overflowIcon={require('./bunny.png')}\n            style={styles.toolbar} />\n        </RNTesterBlock>\n      </RNTesterPage>\n    );\n  }\n\n  _onActionSelected = (position) => {\n    this.setState({\n      actionText: 'Selected ' + toolbarActions[position].title,\n    });\n  };\n}\n\nvar toolbarActions = [\n  {title: 'Create', icon: nativeImageSource({\n    android: 'ic_create_black_48dp',\n    width: 96,\n    height: 96\n  }), show: 'always'},\n  {title: 'Filter'},\n  {title: 'Settings', icon: nativeImageSource({\n    android: 'ic_settings_black_48dp',\n    width: 96,\n    height: 96\n  }), show: 'always'},\n];\n\nvar styles = StyleSheet.create({\n  toolbar: {\n    backgroundColor: '#e9eaed',\n    height: 56,\n  },\n});\n\nmodule.exports = ToolbarAndroidExample;\n"
  },
  {
    "path": "RNTester/js/TouchableExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TouchableExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Animated,\n  Image,\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  TouchableOpacity,\n  TouchableNativeFeedback,\n  View,\n} = ReactNative;\n\nconst NativeModules = require('NativeModules');\n\nconst forceTouchAvailable = (NativeModules.PlatformConstants &&\n  NativeModules.PlatformConstants.forceTouchAvailable) || false;\n\nexports.displayName = (undefined: ?string);\nexports.description = 'Touchable and onPress examples.';\nexports.title = '<Touchable*> and onPress';\nexports.examples = [\n{\n  title: '<TouchableHighlight>',\n  description: 'TouchableHighlight works by adding an extra view with a ' +\n    'black background under the single child view.  This works best when the ' +\n    'child view is fully opaque, although it can be made to work as a simple ' +\n    'background color change as well with the activeOpacity and ' +\n    'underlayColor props.',\n  render: function() {\n    return (\n      <View>\n        <View style={styles.row}>\n          <TouchableHighlight\n            style={styles.wrapper}\n            onPress={() => console.log('stock THW image - highlight')}>\n            <Image\n              source={heartImage}\n              style={styles.image}\n            />\n          </TouchableHighlight>\n          <TouchableHighlight\n            style={styles.wrapper}\n            activeOpacity={1}\n            animationVelocity={0}\n            underlayColor=\"rgb(210, 230, 255)\"\n            onPress={() => console.log('custom THW text - highlight')}>\n            <View style={styles.wrapperCustom}>\n              <Text style={styles.text}>\n                Tap Here For Custom Highlight!\n              </Text>\n            </View>\n          </TouchableHighlight>\n        </View>\n      </View>\n    );\n  },\n }, {\n  title: 'TouchableNativeFeedback with Animated child',\n  description: 'TouchableNativeFeedback can have an AnimatedComponent as a' +\n    'direct child.',\n  platform: 'android',\n  render: function() {\n    const mScale = new Animated.Value(1);\n    Animated.timing(mScale, {toValue: 0.3, duration: 1000}).start();\n    const style = {\n      backgroundColor: 'rgb(180, 64, 119)',\n      width: 200,\n      height: 100,\n      transform: [{scale: mScale}]\n    };\n    return (\n      <View>\n        <View style={styles.row}>\n          <TouchableNativeFeedback>\n            <Animated.View style={style}/>\n          </TouchableNativeFeedback>\n        </View>\n      </View>\n    );\n  },\n}, {\n  title: '<Text onPress={fn}> with highlight',\n  render: function(): React.Element<any> {\n    return <TextOnPressBox />;\n  },\n}, {\n  title: 'Touchable feedback events',\n  description: '<Touchable*> components accept onPress, onPressIn, ' +\n    'onPressOut, and onLongPress as props.',\n  render: function(): React.Element<any> {\n    return <TouchableFeedbackEvents />;\n  },\n}, {\n  title: 'Touchable delay for events',\n  description: '<Touchable*> components also accept delayPressIn, ' +\n    'delayPressOut, and delayLongPress as props. These props impact the ' +\n    'timing of feedback events.',\n  render: function(): React.Element<any> {\n    return <TouchableDelayEvents />;\n  },\n}, {\n  title: '3D Touch / Force Touch',\n  description: 'iPhone 6s and 6s plus support 3D touch, which adds a force property to touches',\n  render: function(): React.Element<any> {\n    return <ForceTouchExample />;\n  },\n  platform: 'ios',\n}, {\n   title: 'Touchable Hit Slop',\n   description: '<Touchable*> components accept hitSlop prop which extends the touch area ' +\n     'without changing the view bounds.',\n   render: function(): React.Element<any> {\n     return <TouchableHitSlop />;\n   },\n}, {\n   title: 'Disabled Touchable*',\n   description: '<Touchable*> components accept disabled prop which prevents ' +\n     'any interaction with component',\n   render: function(): React.Element<any> {\n     return <TouchableDisabled />;\n   },\n }];\n\nclass TextOnPressBox extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    timesPressed: 0,\n  };\n\n  textOnPress = () => {\n    this.setState({\n      timesPressed: this.state.timesPressed + 1,\n    });\n  };\n\n  render() {\n    var textLog = '';\n    if (this.state.timesPressed > 1) {\n      textLog = this.state.timesPressed + 'x text onPress';\n    } else if (this.state.timesPressed > 0) {\n      textLog = 'text onPress';\n    }\n\n    return (\n      <View>\n        <Text\n          style={styles.textBlock}\n          onPress={this.textOnPress}>\n          Text has built-in onPress handling\n        </Text>\n        <View style={styles.logBox}>\n          <Text>\n            {textLog}\n          </Text>\n        </View>\n      </View>\n    );\n  }\n}\n\nclass TouchableFeedbackEvents extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    eventLog: [],\n  };\n\n  render() {\n    return (\n      <View testID=\"touchable_feedback_events\">\n        <View style={[styles.row, {justifyContent: 'center'}]}>\n          <TouchableOpacity\n            style={styles.wrapper}\n            testID=\"touchable_feedback_events_button\"\n            accessibilityLabel=\"touchable feedback events\"\n            accessibilityTraits=\"button\"\n            accessibilityComponentType=\"button\"\n            onPress={() => this._appendEvent('press')}\n            onPressIn={() => this._appendEvent('pressIn')}\n            onPressOut={() => this._appendEvent('pressOut')}\n            onLongPress={() => this._appendEvent('longPress')}>\n            <Text style={styles.button}>\n              Press Me\n            </Text>\n          </TouchableOpacity>\n        </View>\n        <View testID=\"touchable_feedback_events_console\" style={styles.eventLogBox}>\n          {this.state.eventLog.map((e, ii) => <Text key={ii}>{e}</Text>)}\n        </View>\n      </View>\n    );\n  }\n\n  _appendEvent = (eventName) => {\n    var limit = 6;\n    var eventLog = this.state.eventLog.slice(0, limit - 1);\n    eventLog.unshift(eventName);\n    this.setState({eventLog});\n  };\n}\n\nclass TouchableDelayEvents extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    eventLog: [],\n  };\n\n  render() {\n    return (\n      <View testID=\"touchable_delay_events\">\n        <View style={[styles.row, {justifyContent: 'center'}]}>\n          <TouchableOpacity\n            style={styles.wrapper}\n            testID=\"touchable_delay_events_button\"\n            onPress={() => this._appendEvent('press')}\n            delayPressIn={400}\n            onPressIn={() => this._appendEvent('pressIn - 400ms delay')}\n            delayPressOut={1000}\n            onPressOut={() => this._appendEvent('pressOut - 1000ms delay')}\n            delayLongPress={800}\n            onLongPress={() => this._appendEvent('longPress - 800ms delay')}>\n            <Text style={styles.button}>\n              Press Me\n            </Text>\n          </TouchableOpacity>\n        </View>\n        <View style={styles.eventLogBox} testID=\"touchable_delay_events_console\">\n          {this.state.eventLog.map((e, ii) => <Text key={ii}>{e}</Text>)}\n        </View>\n      </View>\n    );\n  }\n\n  _appendEvent = (eventName) => {\n    var limit = 6;\n    var eventLog = this.state.eventLog.slice(0, limit - 1);\n    eventLog.unshift(eventName);\n    this.setState({eventLog});\n  };\n}\n\nclass ForceTouchExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    force: 0,\n  };\n\n  _renderConsoleText = () => {\n    return forceTouchAvailable ?\n      'Force: ' + this.state.force.toFixed(3) :\n      '3D Touch is not available on this device';\n  };\n\n  render() {\n    return (\n      <View testID=\"touchable_3dtouch_event\">\n        <View style={styles.forceTouchBox} testID=\"touchable_3dtouch_output\">\n          <Text>{this._renderConsoleText()}</Text>\n        </View>\n        <View style={[styles.row, {justifyContent: 'center'}]}>\n          <View\n            style={styles.wrapper}\n            testID=\"touchable_3dtouch_button\"\n            onStartShouldSetResponder={() => true}\n            onResponderMove={(event) => this.setState({force: event.nativeEvent.force})}\n            onResponderRelease={(event) => this.setState({force: 0})}>\n            <Text style={styles.button}>\n              Press Me\n            </Text>\n          </View>\n        </View>\n      </View>\n    );\n  }\n}\n\nclass TouchableHitSlop extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    timesPressed: 0,\n  };\n\n  onPress = () => {\n    this.setState({\n      timesPressed: this.state.timesPressed + 1,\n    });\n  };\n\n  render() {\n    var log = '';\n    if (this.state.timesPressed > 1) {\n      log = this.state.timesPressed + 'x onPress';\n    } else if (this.state.timesPressed > 0) {\n      log = 'onPress';\n    }\n\n    return (\n      <View testID=\"touchable_hit_slop\">\n        <View style={[styles.row, {justifyContent: 'center'}]}>\n          <TouchableOpacity\n            onPress={this.onPress}\n            style={styles.hitSlopWrapper}\n            hitSlop={{top: 30, bottom: 30, left: 60, right: 60}}\n            testID=\"touchable_hit_slop_button\">\n            <Text style={styles.hitSlopButton}>\n              Press Outside This View\n            </Text>\n          </TouchableOpacity>\n         </View>\n        <View style={styles.logBox}>\n          <Text>\n            {log}\n          </Text>\n        </View>\n      </View>\n    );\n  }\n}\n\nclass TouchableDisabled extends React.Component<{}> {\n  render() {\n    return (\n      <View>\n        <TouchableOpacity disabled={true} style={[styles.row, styles.block]}>\n          <Text style={styles.disabledButton}>Disabled TouchableOpacity</Text>\n        </TouchableOpacity>\n\n        <TouchableOpacity disabled={false} style={[styles.row, styles.block]}>\n          <Text style={styles.button}>Enabled TouchableOpacity</Text>\n        </TouchableOpacity>\n\n        <TouchableHighlight\n          activeOpacity={1}\n          disabled={true}\n          animationVelocity={0}\n          underlayColor=\"rgb(210, 230, 255)\"\n          style={[styles.row, styles.block]}\n          onPress={() => console.log('custom THW text - highlight')}>\n          <Text style={styles.disabledButton}>\n            Disabled TouchableHighlight\n          </Text>\n        </TouchableHighlight>\n\n        <TouchableHighlight\n          activeOpacity={1}\n          animationVelocity={0}\n          underlayColor=\"rgb(210, 230, 255)\"\n          style={[styles.row, styles.block]}\n          onPress={() => console.log('custom THW text - highlight')}>\n          <Text style={styles.button}>\n            Enabled TouchableHighlight\n          </Text>\n        </TouchableHighlight>\n\n      </View>\n    );\n  }\n}\n\nvar heartImage = {uri: 'https://pbs.twimg.com/media/BlXBfT3CQAA6cVZ.png:small'};\n\nvar styles = StyleSheet.create({\n  row: {\n    justifyContent: 'center',\n    flexDirection: 'row',\n  },\n  icon: {\n    width: 24,\n    height: 24,\n  },\n  image: {\n    width: 50,\n    height: 50,\n  },\n  text: {\n    fontSize: 16,\n  },\n  block: {\n    padding: 10,\n  },\n  button: {\n    color: '#007AFF',\n  },\n  disabledButton: {\n    color: '#007AFF',\n    opacity: 0.5,\n  },\n  nativeFeedbackButton: {\n    textAlign: 'center',\n    margin: 10,\n  },\n  hitSlopButton: {\n    color: 'white',\n  },\n  wrapper: {\n    borderRadius: 8,\n  },\n  wrapperCustom: {\n    borderRadius: 8,\n    padding: 6,\n  },\n  hitSlopWrapper: {\n    backgroundColor: 'red',\n    marginVertical: 30,\n  },\n  logBox: {\n    padding: 20,\n    margin: 10,\n    borderWidth: StyleSheet.hairlineWidth,\n    borderColor: '#f0f0f0',\n    backgroundColor: '#f9f9f9',\n  },\n  eventLogBox: {\n    padding: 10,\n    margin: 10,\n    height: 120,\n    borderWidth: StyleSheet.hairlineWidth,\n    borderColor: '#f0f0f0',\n    backgroundColor: '#f9f9f9',\n  },\n  forceTouchBox: {\n    padding: 10,\n    margin: 10,\n    borderWidth: StyleSheet.hairlineWidth,\n    borderColor: '#f0f0f0',\n    backgroundColor: '#f9f9f9',\n    alignItems: 'center',\n  },\n  textBlock: {\n    fontWeight: '500',\n    color: 'blue',\n  },\n});\n"
  },
  {
    "path": "RNTester/js/TransformExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TransformExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Animated,\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\n\nclass Flip extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    theta: new Animated.Value(45),\n  };\n\n  componentDidMount() {\n    this._animate();\n  }\n\n  _animate = () => {\n    this.state.theta.setValue(0);\n    Animated.timing(this.state.theta, {\n      toValue: 360,\n      duration: 5000,\n    }).start(this._animate);\n  };\n\n  render() {\n    return (\n      <View style={styles.flipCardContainer}>\n        <Animated.View style={[\n          styles.flipCard,\n          {transform: [\n            {perspective: 850},\n            {rotateX: this.state.theta.interpolate({\n              inputRange: [0, 180],\n              outputRange: ['0deg', '180deg']\n            })},\n          ]}]}>\n          <Text style={styles.flipText}>\n            This text is flipping great.\n          </Text>\n        </Animated.View>\n        <Animated.View style={[styles.flipCard, {\n          position: 'absolute',\n          top: 0,\n          backgroundColor: 'red',\n          transform: [\n            {perspective: 850},\n            {rotateX: this.state.theta.interpolate({\n              inputRange: [0, 180],\n              outputRange: ['180deg', '360deg']\n            })},\n          ]}]}>\n          <Text style={styles.flipText}>\n            On the flip side...\n          </Text>\n        </Animated.View>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    height: 300,\n  },\n  box1: {\n    left: 0,\n    backgroundColor: 'green',\n    height: 50,\n    position: 'absolute',\n    top: 0,\n    transform: [\n      {translateX: 100},\n      {translateY: 50},\n      {rotate: '30deg'},\n      {scaleX: 2},\n      {scaleY: 2},\n    ],\n    width: 50,\n  },\n  box2: {\n    left: 0,\n    backgroundColor: 'purple',\n    height: 50,\n    position: 'absolute',\n    top: 0,\n    transform: [\n      {scaleX: 2},\n      {scaleY: 2},\n      {translateX: 100},\n      {translateY: 50},\n      {rotate: '30deg'},\n    ],\n    width: 50,\n  },\n  box3step1: {\n    left: 0,\n    backgroundColor: 'lightpink',\n    height: 50,\n    position: 'absolute',\n    top: 0,\n    transform: [\n      {rotate: '30deg'},\n    ],\n    width: 50,\n  },\n  box3step2: {\n    left: 0,\n    backgroundColor: 'hotpink',\n    height: 50,\n    opacity: 0.5,\n    position: 'absolute',\n    top: 0,\n    transform: [\n      {rotate: '30deg'},\n      {scaleX: 2},\n      {scaleY: 2},\n    ],\n    width: 50,\n  },\n  box3step3: {\n    left: 0,\n    backgroundColor: 'deeppink',\n    height: 50,\n    opacity: 0.5,\n    position: 'absolute',\n    top: 0,\n    transform: [\n      {rotate: '30deg'},\n      {scaleX: 2},\n      {scaleY: 2},\n      {translateX: 100},\n      {translateY: 50},\n    ],\n    width: 50,\n  },\n  box4: {\n    left: 0,\n    backgroundColor: 'darkorange',\n    height: 50,\n    position: 'absolute',\n    top: 0,\n    transform: [\n      {translate: [200, 35]},\n      {scale: 2.5},\n      {rotate: '-0.2rad'},\n    ],\n    width: 100,\n  },\n  box5: {\n    backgroundColor: 'maroon',\n    height: 50,\n    position: 'absolute',\n    right: 0,\n    top: 0,\n    width: 50,\n  },\n  box5Transform: {\n    transform: [\n      {translate: [-50, 35]},\n      {rotate: '50deg'},\n      {scale: 2},\n    ],\n  },\n  flipCardContainer: {\n    marginVertical: 100,\n    flex: 1,\n    alignSelf: 'center',\n  },\n  flipCard: {\n    width: 100,\n    height: 100,\n    alignItems: 'center',\n    justifyContent: 'center',\n    backgroundColor: 'blue',\n    backfaceVisibility: 'hidden',\n  },\n  flipText: {\n    width: 90,\n    fontSize: 20,\n    color: 'white',\n    fontWeight: 'bold',\n  }\n});\n\nexports.title = 'Transforms';\nexports.description = 'View transforms';\nexports.examples = [\n  {\n    title: 'Perspective, Rotate, Animation',\n    description: 'perspective: 850, rotateX: Animated.timing(0 -> 360)',\n    render(): React.Element<any> { return <Flip />; }\n  },\n  {\n    title: 'Translate, Rotate, Scale',\n    description: \"translateX: 100, translateY: 50, rotate: '30deg', scaleX: 2, scaleY: 2\",\n    render() {\n      return (\n        <View style={styles.container}>\n          <View style={styles.box1} />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Scale, Translate, Rotate, ',\n    description: \"scaleX: 2, scaleY: 2, translateX: 100, translateY: 50, rotate: '30deg'\",\n    render() {\n      return (\n        <View style={styles.container}>\n          <View style={styles.box2} />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Rotate',\n    description: \"rotate: '30deg'\",\n    render() {\n      return (\n        <View style={styles.container}>\n          <View style={styles.box3step1} />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Rotate, Scale',\n    description: \"rotate: '30deg', scaleX: 2, scaleY: 2\",\n    render() {\n      return (\n        <View style={styles.container}>\n          <View style={styles.box3step2} />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Rotate, Scale, Translate ',\n    description: \"rotate: '30deg', scaleX: 2, scaleY: 2, translateX: 100, translateY: 50\",\n    render() {\n      return (\n        <View style={styles.container}>\n          <View style={styles.box3step3} />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Translate, Scale, Rotate',\n    description: \"translate: [200, 350], scale: 2.5, rotate: '-0.2rad'\",\n    render() {\n      return (\n        <View style={styles.container}>\n          <View style={styles.box4} />\n        </View>\n      );\n    }\n  },\n  {\n    title: 'Translate, Rotate, Scale',\n    description: \"translate: [-50, 35], rotate: '50deg', scale: 2\",\n    render() {\n      return (\n        <View style={styles.container}>\n          <View style={[styles.box5, styles.box5Transform]} />\n        </View>\n      );\n    }\n  }\n];\n"
  },
  {
    "path": "RNTester/js/TransparentHitTestExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule TransparentHitTestExample\n */\n\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Text,\n  View,\n  TouchableOpacity,\n} = ReactNative;\n\nclass TransparentHitTestExample extends React.Component<{}> {\n  render() {\n    return (\n      <View style={{flex: 1}}>\n        <TouchableOpacity onPress={() => alert('Hi!')}>\n          <Text>HELLO!</Text>\n        </TouchableOpacity>\n\n        <View style={{\n          position: 'absolute',\n          backgroundColor: 'green',\n          top: 0,\n          left: 0,\n          bottom: 0,\n          right: 0,\n          opacity: 0.0}} />\n      </View>\n    );\n  }\n}\n\nexports.title = '<TransparentHitTestExample>';\nexports.displayName = 'TransparentHitTestExample';\nexports.description = 'Transparent view receiving touch events';\nexports.examples = [\n  {\n    title: 'TransparentHitTestExample',\n    render(): React.Element<any> { return <TransparentHitTestExample />; }\n  }\n];\n"
  },
  {
    "path": "RNTester/js/URIActionMap.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule URIActionMap\n */\n'use strict';\n\nconst ReactNative = require('react-native');\nconst RNTesterActions = require('./RNTesterActions');\n// $FlowFixMe : This is a platform-forked component, and flow seems to only run on iOS?\nconst RNTesterList = require('./RNTesterList');\n\nconst {\n  Alert,\n} = ReactNative;\n\nimport type { RNTesterAction } from './RNTesterActions';\n\nfunction PathActionMap(path: string): ?RNTesterAction {\n  // Warning! Hacky parsing for example code. Use a library for this!\n  const exampleParts = path.split('/example/');\n  const exampleKey = exampleParts[1];\n  if (exampleKey) {\n    if (!RNTesterList.Modules[exampleKey]) {\n      Alert.alert(`${exampleKey} example could not be found!`);\n      return null;\n    }\n    return RNTesterActions.ExampleAction(exampleKey);\n  }\n  return null;\n}\n\nfunction URIActionMap(uri: ?string): ?RNTesterAction {\n  if (!uri) {\n    return null;\n  }\n  // Warning! Hacky parsing for example code. Use a library for this!\n  const parts = uri.split('rntester:/');\n  if (!parts[1]) {\n    return null;\n  }\n  const path = parts[1];\n  return PathActionMap(path);\n}\n\nmodule.exports = URIActionMap;\n"
  },
  {
    "path": "RNTester/js/VibrationExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule VibrationExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  View,\n  Text,\n  TouchableHighlight,\n  Vibration,\n  Platform,\n} = ReactNative;\n\nexports.framework = 'React';\nexports.title = 'Vibration';\nexports.description = 'Vibration API';\n\nvar pattern, patternLiteral, patternDescription;\nif (Platform.OS === 'android') {\n  pattern = [0, 500, 200, 500];\n  patternLiteral = '[0, 500, 200, 500]';\n  patternDescription = `${patternLiteral}\narg 0: duration to wait before turning the vibrator on.\narg with odd: vibration length.\narg with even: duration to wait before next vibration.\n`;\n} else {\n  pattern = [0, 1000, 2000, 3000];\n  patternLiteral = '[0, 1000, 2000, 3000]';\n  patternDescription = `${patternLiteral}\nvibration length on iOS is fixed.\npattern controls durations BETWEEN each vibration only.\n\narg 0: duration to wait before turning the vibrator on.\nsubsequent args: duration to wait before next vibration.\n`;\n}\n\nexports.examples = [\n  {\n    title: 'Pattern Descriptions',\n    render() {\n      return (\n        <View style={styles.wrapper}>\n          <Text>{patternDescription}</Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Vibration.vibrate()',\n    render() {\n      return (\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => Vibration.vibrate()}>\n          <View style={styles.button}>\n            <Text>Vibrate</Text>\n          </View>\n        </TouchableHighlight>\n      );\n    },\n  },\n  {\n    title: `Vibration.vibrate(${patternLiteral})`,\n    render() {\n      return (\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => Vibration.vibrate(pattern)}>\n          <View style={styles.button}>\n            <Text>Vibrate once</Text>\n          </View>\n        </TouchableHighlight>\n      );\n    },\n  },\n  {\n    title: `Vibration.vibrate(${patternLiteral}, true)`,\n    render() {\n      return (\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => Vibration.vibrate(pattern, true)}>\n          <View style={styles.button}>\n            <Text>Vibrate until cancel</Text>\n          </View>\n        </TouchableHighlight>\n      );\n    },\n  },\n  {\n    title: 'Vibration.cancel()',\n    render() {\n      return (\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={() => Vibration.cancel()}>\n          <View style={styles.button}>\n            <Text>Cancel</Text>\n          </View>\n        </TouchableHighlight>\n      );\n    },\n  },\n];\n\nvar styles = StyleSheet.create({\n  wrapper: {\n    borderRadius: 5,\n    marginBottom: 5,\n  },\n  button: {\n    backgroundColor: '#eeeeee',\n    padding: 10,\n  },\n});\n"
  },
  {
    "path": "RNTester/js/VibrationIOSExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule VibrationIOSExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  View,\n  Text,\n  TouchableHighlight,\n  VibrationIOS\n} = ReactNative;\n\nexports.framework = 'React';\nexports.title = 'VibrationIOS';\nexports.description = 'Vibration API for iOS';\nexports.examples = [{\n  title: 'VibrationIOS.vibrate()',\n  render() {\n    return (\n      <TouchableHighlight\n        style={styles.wrapper}\n        onPress={() => VibrationIOS.vibrate()}>\n        <View style={styles.button}>\n          <Text>Vibrate</Text>\n        </View>\n      </TouchableHighlight>\n    );\n  },\n}];\n\nvar styles = StyleSheet.create({\n  wrapper: {\n    borderRadius: 5,\n    marginBottom: 5,\n  },\n  button: {\n    backgroundColor: '#eeeeee',\n    padding: 10,\n  },\n});\n"
  },
  {
    "path": "RNTester/js/ViewExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ViewExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  View,\n} = ReactNative;\nvar TouchableWithoutFeedback = require('TouchableWithoutFeedback');\n\nvar styles = StyleSheet.create({\n  box: {\n    backgroundColor: '#527FE4',\n    borderColor: '#000033',\n    borderWidth: 1,\n  },\n  zIndex: {\n    justifyContent: 'space-around',\n    width: 100,\n    height: 50,\n    marginTop: -10,\n  },\n});\n\nclass ViewBorderStyleExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    showBorder: true\n  };\n\n  t: number;\n\n  render() {\n    return (\n      <TouchableWithoutFeedback onPress={this._handlePress}>\n        <View>\n          <View style={{\n            borderWidth: 1,\n            borderStyle: this.state.showBorder ? 'dashed' : null,\n            padding: 5\n          }}>\n            <Text style={{fontSize: 11}}>\n              Dashed border style\n            </Text>\n          </View>\n          <View style={{\n            marginTop: 5,\n            borderWidth: 1,\n            borderRadius: 5,\n            borderStyle: this.state.showBorder ? 'dotted' : null,\n            padding: 5\n          }}>\n            <Text style={{fontSize: 11}}>\n              Dotted border style\n            </Text>\n          </View>\n        </View>\n      </TouchableWithoutFeedback>\n    );\n  }\n\n  _handlePress = () => {\n    this.setState({showBorder: !this.state.showBorder});\n  };\n}\n\nclass ZIndexExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    flipped: false\n  };\n\n  render() {\n    const indices = this.state.flipped ? [-1, 0, 1, 2] : [2, 1, 0, -1];\n    return (\n      <TouchableWithoutFeedback onPress={this._handlePress}>\n        <View>\n          <Text style={{paddingBottom: 10}}>Tap to flip sorting order</Text>\n          <View style={[\n            styles.zIndex,\n            {marginTop: 0, backgroundColor: '#E57373', zIndex: indices[0]}\n          ]}>\n            <Text>ZIndex {indices[0]}</Text>\n          </View>\n          <View style={[\n            styles.zIndex,\n            {marginLeft: 50, backgroundColor: '#FFF176', zIndex: indices[1]}\n          ]}>\n            <Text>ZIndex {indices[1]}</Text>\n          </View>\n          <View style={[\n            styles.zIndex,\n            {marginLeft: 100, backgroundColor: '#81C784', zIndex: indices[2]}\n          ]}>\n            <Text>ZIndex {indices[2]}</Text>\n          </View>\n          <View style={[\n            styles.zIndex,\n            {marginLeft: 150, backgroundColor: '#64B5F6', zIndex: indices[3]}\n          ]}>\n            <Text>ZIndex {indices[3]}</Text>\n          </View>\n        </View>\n      </TouchableWithoutFeedback>\n    );\n  }\n\n  _handlePress = () => {\n    this.setState({flipped: !this.state.flipped});\n  };\n}\n\nclass BackgroundUpdatesExample extends React.Component {\n  state = {\n    backgroundColorIndex: 0\n  };\n\n  t: number;\n\n  componentWillMount() {\n    const changeColor = () => {\n      this.t = setTimeout(() => {\n        this.setState({\n          backgroundColorIndex: this.state.backgroundColorIndex === 3 ?\n            0 :  this.state.backgroundColorIndex + 1\n        });\n        changeColor();\n      }, 1000);\n    };\n    changeColor();\n  }\n  componentWillUnmount() {\n    clearTimeout(this.t);\n  }\n\n  render() {\n    const colors = ['yellow', 'red', 'blue', 'green'];\n    return (\n      <View>\n        <View style={{\n          width: 100,\n          height: 100,\n          borderWidth: 1,\n          borderRadius: 50,\n          borderColor: 'orange',\n          backgroundColor: colors[this.state.backgroundColorIndex],\n        }} />\n      </View>\n    );\n  }\n}\n\nexports.title = '<View>';\nexports.description = 'Basic building block of all UI, examples that ' +\n  'demonstrate some of the many styles available.';\n\nexports.displayName = 'ViewExample';\nexports.examples = [\n  {\n    title: 'Background Color',\n    render: function() {\n      return (\n        <View style={{backgroundColor: '#527FE4', padding: 5}}>\n          <Text style={{fontSize: 11}}>\n            Blue background\n          </Text>\n        </View>\n      );\n    },\n  }, {\n    title: 'Background Color with updates',\n    render: function() {\n      return <BackgroundUpdatesExample />;\n    },\n  }, {\n    title: 'Border',\n    render: function() {\n      return (\n        <View style={{borderColor: '#527FE4', borderWidth: 5, padding: 10}}>\n          <Text style={{fontSize: 11}}>5px blue border</Text>\n        </View>\n      );\n    },\n  }, {\n    title: 'Padding/Margin',\n    render: function() {\n      return (\n        <View style={{borderColor: '#bb0000', borderWidth: 0.5}}>\n          <View style={[styles.box, {padding: 5}]}>\n            <Text style={{fontSize: 11}}>5px padding</Text>\n          </View>\n          <View style={[styles.box, {margin: 5}]}>\n            <Text style={{fontSize: 11}}>5px margin</Text>\n          </View>\n          <View style={[styles.box, {margin: 5, padding: 5, alignSelf: 'flex-start'}]}>\n            <Text style={{fontSize: 11}}>\n              5px margin and padding,\n            </Text>\n            <Text style={{fontSize: 11}}>\n              widthAutonomous=true\n            </Text>\n          </View>\n        </View>\n      );\n    },\n  }, {\n    title: 'Border Radius',\n    render: function() {\n      return (\n        <View style={{borderWidth: 0.5, borderRadius: 5, padding: 5}}>\n          <Text style={{fontSize: 11}}>\n            Too much use of `borderRadius` (especially large radii) on\n            anything which is scrolling may result in dropped frames.\n            Use sparingly.\n          </Text>\n        </View>\n      );\n    },\n  }, {\n    title: 'Border Style',\n    render: function() {\n      return <ViewBorderStyleExample />;\n    },\n  }, {\n    title: 'Circle with Border Radius',\n    render: function() {\n      return (\n        <View style={{borderRadius: 10, borderWidth: 1, width: 20, height: 20}} />\n      );\n    },\n  },\n  {\n    title: 'Circle with Border Radius coloured',\n    render: function() {\n      return (\n        <View style={{backgroundColor: '#527FE4', borderWidth: 10, borderColor: '#bb0000', borderRadius: 30, width: 60, height: 60}} />\n      );\n    },\n  },\n  {\n    title: 'Overflow',\n    render: function() {\n      return (\n        <View style={{flexDirection: 'row'}}>\n          <View\n            style={{\n              width: 95,\n              height: 10,\n              marginRight: 10,\n              marginBottom: 5,\n              overflow: 'hidden',\n              borderWidth: 0.5,\n            }}>\n            <View style={{width: 200, height: 20}}>\n              <Text>Overflow hidden</Text>\n            </View>\n          </View>\n          <View style={{width: 95, height: 10, marginBottom: 5, borderWidth: 0.5}}>\n            <View style={{width: 200, height: 20}}>\n              <Text>Overflow visible</Text>\n            </View>\n          </View>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Circle with Border Radius coloured and overflow',\n    render: function() {\n      return (\n        <View style={{\n          backgroundColor: '#527FE4',\n          borderWidth: 5,\n          borderColor: '#bb0000',\n          borderRadius: 30,\n          width: 60,\n          height: 60}}>\n          <Text>Overflow visible</Text>\n        </View>\n      );\n    },\n  },\n  {\n    title: 'Opacity',\n    render: function() {\n      return (\n        <View>\n          <View style={{opacity: 0}}><Text>Opacity 0</Text></View>\n          <View style={{opacity: 0.1}}><Text>Opacity 0.1</Text></View>\n          <View style={{opacity: 0.3}}><Text>Opacity 0.3</Text></View>\n          <View style={{opacity: 0.5}}><Text>Opacity 0.5</Text></View>\n          <View style={{opacity: 0.7}}><Text>Opacity 0.7</Text></View>\n          <View style={{opacity: 0.9}}><Text>Opacity 0.9</Text></View>\n          <View style={{opacity: 1}}><Text>Opacity 1</Text></View>\n        </View>\n      );\n    },\n  }, {\n    title: 'ZIndex',\n    render: function() {\n      return <ZIndexExample />;\n    },\n  },\n];\n"
  },
  {
    "path": "RNTester/js/ViewPagerAndroidExample.android.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ViewPagerAndroidExample\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  Image,\n  StyleSheet,\n  Text,\n  TouchableWithoutFeedback,\n  TouchableOpacity,\n  View,\n  ViewPagerAndroid,\n} = ReactNative;\n\nimport type { ViewPagerScrollState } from 'ViewPagerAndroid';\n\nvar PAGES = 5;\nvar BGCOLOR = ['#fdc08e', '#fff6b9', '#99d1b7', '#dde5fe', '#f79273'];\nvar IMAGE_URIS = [\n  'https://apod.nasa.gov/apod/image/1410/20141008tleBaldridge001h990.jpg',\n  'https://apod.nasa.gov/apod/image/1409/volcanicpillar_vetter_960.jpg',\n  'https://apod.nasa.gov/apod/image/1409/m27_snyder_960.jpg',\n  'https://apod.nasa.gov/apod/image/1409/PupAmulti_rot0.jpg',\n  'https://apod.nasa.gov/apod/image/1510/lunareclipse_27Sep_beletskycrop4.jpg',\n];\n\nclass LikeCount extends React.Component {\n  state = {\n    likes: 7,\n  };\n\n  onClick = () => {\n    this.setState({likes: this.state.likes + 1});\n  };\n\n  render() {\n    var thumbsUp = '\\uD83D\\uDC4D';\n    return (\n      <View style={styles.likeContainer}>\n        <TouchableOpacity onPress={this.onClick} style={styles.likeButton}>\n          <Text style={styles.likesText}>\n            {thumbsUp + ' Like'}\n          </Text>\n        </TouchableOpacity>\n        <Text style={styles.likesText}>\n          {this.state.likes + ' likes'}\n        </Text>\n      </View>\n    );\n  }\n}\n\nclass Button extends React.Component {\n  _handlePress = () => {\n    if (this.props.enabled && this.props.onPress) {\n      this.props.onPress();\n    }\n  };\n\n  render() {\n    return (\n      <TouchableWithoutFeedback onPress={this._handlePress}>\n        <View style={[styles.button, this.props.enabled ? {} : styles.buttonDisabled]}>\n          <Text style={styles.buttonText}>{this.props.text}</Text>\n        </View>\n      </TouchableWithoutFeedback>\n    );\n  }\n}\n\nclass ProgressBar extends React.Component {\n  render() {\n    var fractionalPosition = (this.props.progress.position + this.props.progress.offset);\n    var progressBarSize = (fractionalPosition / (PAGES - 1)) * this.props.size;\n    return (\n      <View style={[styles.progressBarContainer, {width: this.props.size}]}>\n        <View style={[styles.progressBar, {width: progressBarSize}]}/>\n      </View>\n    );\n  }\n}\n\nclass ViewPagerAndroidExample extends React.Component {\n  static title = '<ViewPagerAndroid>';\n  static description = 'Container that allows to flip left and right between child views.';\n\n  state = {\n    page: 0,\n    animationsAreEnabled: true,\n    scrollEnabled: true,\n    progress: {\n      position: 0,\n      offset: 0,\n    },\n  };\n\n  onPageSelected = (e) => {\n    this.setState({page: e.nativeEvent.position});\n  };\n\n  onPageScroll = (e) => {\n    this.setState({progress: e.nativeEvent});\n  };\n\n  onPageScrollStateChanged = (state : ViewPagerScrollState) => {\n    this.setState({scrollState: state});\n  };\n\n  move = (delta) => {\n    var page = this.state.page + delta;\n    this.go(page);\n  };\n\n  go = (page) => {\n    if (this.state.animationsAreEnabled) {\n      this.viewPager.setPage(page);\n    } else {\n      this.viewPager.setPageWithoutAnimation(page);\n    }\n\n    this.setState({page});\n  };\n\n  render() {\n    var pages = [];\n    for (var i = 0; i < PAGES; i++) {\n      var pageStyle = {\n        backgroundColor: BGCOLOR[i % BGCOLOR.length],\n        alignItems: 'center',\n        padding: 20,\n      };\n      pages.push(\n        <View key={i} style={pageStyle} collapsable={false}>\n          <Image\n            style={styles.image}\n            source={{uri: IMAGE_URIS[i % BGCOLOR.length]}}\n          />\n          <LikeCount />\n       </View>\n      );\n    }\n    var { page, animationsAreEnabled } = this.state;\n    return (\n      <View style={styles.container}>\n        <ViewPagerAndroid\n          style={styles.viewPager}\n          initialPage={0}\n          scrollEnabled={this.state.scrollEnabled}\n          onPageScroll={this.onPageScroll}\n          onPageSelected={this.onPageSelected}\n          onPageScrollStateChanged={this.onPageScrollStateChanged}\n          pageMargin={10}\n          ref={viewPager => { this.viewPager = viewPager; }}>\n          {pages}\n        </ViewPagerAndroid>\n        <View style={styles.buttons}>\n          <Button\n            enabled={true}\n            text={this.state.scrollEnabled ? 'Scroll Enabled' : 'Scroll Disabled'}\n            onPress={() => this.setState({scrollEnabled: !this.state.scrollEnabled})}\n          />\n        </View>\n        <View style={styles.buttons}>\n          { animationsAreEnabled ?\n            <Button\n              text=\"Turn off animations\"\n              enabled={true}\n              onPress={() => this.setState({animationsAreEnabled: false})}\n            /> :\n            <Button\n              text=\"Turn animations back on\"\n              enabled={true}\n              onPress={() => this.setState({animationsAreEnabled: true})}\n            /> }\n          <Text style={styles.scrollStateText}>ScrollState[ {this.state.scrollState} ]</Text>\n        </View>\n        <View style={styles.buttons}>\n          <Button text=\"Start\" enabled={page > 0} onPress={() => this.go(0)}/>\n          <Button text=\"Prev\" enabled={page > 0} onPress={() => this.move(-1)}/>\n          <Text style={styles.buttonText}>Page {page + 1} / {PAGES}</Text>\n          <ProgressBar size={100} progress={this.state.progress}/>\n          <Button text=\"Next\" enabled={page < PAGES - 1} onPress={() => this.move(1)}/>\n          <Button text=\"Last\" enabled={page < PAGES - 1} onPress={() => this.go(PAGES - 1)}/>\n        </View>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  buttons: {\n    flexDirection: 'row',\n    height: 30,\n    backgroundColor: 'black',\n    alignItems: 'center',\n    justifyContent: 'space-between',\n  },\n  button: {\n    flex: 1,\n    width: 0,\n    margin: 5,\n    borderColor: 'gray',\n    borderWidth: 1,\n    backgroundColor: 'gray',\n  },\n  buttonDisabled: {\n    backgroundColor: 'black',\n    opacity: 0.5,\n  },\n  buttonText: {\n    color: 'white',\n  },\n  scrollStateText: {\n    color: '#99d1b7',\n  },\n  container: {\n    flex: 1,\n    backgroundColor: 'white',\n  },\n  image: {\n    width: 300,\n    height: 200,\n    padding: 20,\n  },\n  likeButton: {\n    backgroundColor: 'rgba(0, 0, 0, 0.1)',\n    borderColor: '#333333',\n    borderWidth: 1,\n    borderRadius: 5,\n    flex: 1,\n    margin: 8,\n    padding: 8,\n  },\n  likeContainer: {\n    flexDirection: 'row',\n  },\n  likesText: {\n    flex: 1,\n    fontSize: 18,\n    alignSelf: 'center',\n  },\n  progressBarContainer: {\n    height: 10,\n    margin: 10,\n    borderColor: '#eeeeee',\n    borderWidth: 2,\n  },\n  progressBar: {\n    alignSelf: 'flex-start',\n    flex: 1,\n    backgroundColor: '#eeeeee',\n  },\n  viewPager: {\n    flex: 1,\n  },\n});\n\nmodule.exports = ViewPagerAndroidExample;\n"
  },
  {
    "path": "RNTester/js/WebSocketExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule WebSocketExample\n * @format\n */\n'use strict';\n\n/* eslint-env browser */\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  Image,\n  PixelRatio,\n  ScrollView,\n  StyleSheet,\n  Text,\n  TextInput,\n  TouchableOpacity,\n  View,\n} = ReactNative;\n\nconst DEFAULT_WS_URL = 'ws://localhost:5555/';\nconst DEFAULT_HTTP_URL = 'http://localhost:5556/';\nconst WS_EVENTS = ['close', 'error', 'message', 'open'];\nconst WS_STATES = [\n  /* 0 */ 'CONNECTING',\n  /* 1 */ 'OPEN',\n  /* 2 */ 'CLOSING',\n  /* 3 */ 'CLOSED',\n];\n\nclass Button extends React.Component {\n  render(): React.Element<any> {\n    const label = <Text style={styles.buttonLabel}>{this.props.label}</Text>;\n    if (this.props.disabled) {\n      return (\n        <View style={[styles.button, styles.disabledButton]}>{label}</View>\n      );\n    }\n    return (\n      <TouchableOpacity onPress={this.props.onPress} style={styles.button}>\n        {label}\n      </TouchableOpacity>\n    );\n  }\n}\n\nclass Row extends React.Component {\n  render(): React.Element<any> {\n    return (\n      <View style={styles.row}>\n        <Text>{this.props.label}</Text>\n        {this.props.value ? <Text>{this.props.value}</Text> : null}\n        {this.props.children}\n      </View>\n    );\n  }\n}\n\nclass WebSocketImage extends React.Component {\n  ws: ?WebSocket = null;\n  state: {blob: ?Blob} = {blob: null};\n  componentDidMount() {\n    let ws = (this.ws = new WebSocket(this.props.url));\n    ws.binaryType = 'blob';\n    ws.onmessage = event => {\n      if (event.data instanceof Blob) {\n        const blob = event.data;\n        if (this.state.blob) {\n          this.state.blob.close();\n        }\n        this.setState({blob});\n      }\n    };\n    ws.onopen = event => {\n      ws.send('getImage');\n    };\n  }\n  componentUnmount() {\n    if (this.state.blob) {\n      this.state.blob.close();\n    }\n    this.ws && this.ws.close();\n  }\n  render() {\n    if (!this.state.blob) {\n      return <View />;\n    }\n    return (\n      <Image\n        source={{uri: URL.createObjectURL(this.state.blob)}}\n        style={{width: 50, height: 50}}\n      />\n    );\n  }\n}\n\nfunction showValue(value) {\n  if (value === undefined || value === null) {\n    return '(no value)';\n  }\n  if (\n    typeof ArrayBuffer !== 'undefined' &&\n    typeof Uint8Array !== 'undefined' &&\n    value instanceof ArrayBuffer\n  ) {\n    return `ArrayBuffer {${String(Array.from(new Uint8Array(value)))}}`;\n  }\n  return value;\n}\n\ntype State = {\n  url: string,\n  httpUrl: string,\n  fetchStatus: ?string,\n  socket: ?WebSocket,\n  socketState: ?number,\n  lastSocketEvent: ?string,\n  lastMessage: ?string | ?ArrayBuffer,\n  outgoingMessage: string,\n};\n\nclass WebSocketExample extends React.Component<any, any, State> {\n  static title = 'WebSocket';\n  static description = 'WebSocket API';\n\n  state: State = {\n    url: DEFAULT_WS_URL,\n    httpUrl: DEFAULT_HTTP_URL,\n    fetchStatus: null,\n    socket: null,\n    socketState: null,\n    lastSocketEvent: null,\n    lastMessage: null,\n    outgoingMessage: '',\n  };\n\n  _connect = () => {\n    const socket = new WebSocket(this.state.url);\n    WS_EVENTS.forEach(ev => socket.addEventListener(ev, this._onSocketEvent));\n    this.setState({\n      socket,\n      socketState: socket.readyState,\n    });\n  };\n\n  _disconnect = () => {\n    if (!this.state.socket) {\n      return;\n    }\n    this.state.socket.close();\n  };\n\n  _onSocketEvent = (event: MessageEvent) => {\n    const state: any = {\n      socketState: event.target.readyState,\n      lastSocketEvent: event.type,\n    };\n    if (event.type === 'message') {\n      state.lastMessage = event.data;\n    }\n    this.setState(state);\n  };\n\n  _sendText = () => {\n    if (!this.state.socket) {\n      return;\n    }\n    this.state.socket.send(this.state.outgoingMessage);\n    this.setState({outgoingMessage: ''});\n  };\n\n  _sendHttp = () => {\n    this.setState({\n      fetchStatus: 'fetching',\n    });\n    fetch(this.state.httpUrl).then(response => {\n      if (response.status >= 200 && response.status < 400) {\n        this.setState({\n          fetchStatus: 'OK',\n        });\n      }\n    });\n  };\n\n  _sendBinary = () => {\n    if (\n      !this.state.socket ||\n      typeof ArrayBuffer === 'undefined' ||\n      typeof Uint8Array === 'undefined'\n    ) {\n      return;\n    }\n    const {outgoingMessage} = this.state;\n    const buffer = new Uint8Array(outgoingMessage.length);\n    for (let i = 0; i < outgoingMessage.length; i++) {\n      buffer[i] = outgoingMessage.charCodeAt(i);\n    }\n    this.state.socket.send(buffer);\n    this.setState({outgoingMessage: ''});\n  };\n\n  render(): React.Element<any> {\n    const socketState = WS_STATES[this.state.socketState || -1];\n    const canConnect =\n      !this.state.socket || this.state.socket.readyState >= WebSocket.CLOSING;\n    const canSend = socketState === 'OPEN';\n    return (\n      <ScrollView style={styles.container}>\n        <View style={styles.note}>\n          <Text>To start the WS test server:</Text>\n          <Text style={styles.monospace}>\n            ./RNTester/js/websocket_test_server.js\n          </Text>\n        </View>\n        <Row label=\"Current WebSocket state\" value={showValue(socketState)} />\n        <Row\n          label=\"Last WebSocket event\"\n          value={showValue(this.state.lastSocketEvent)}\n        />\n        <Row\n          label=\"Last message received\"\n          value={showValue(this.state.lastMessage)}\n        />\n        <Row label=\"Last image received\">\n          {canSend ? <WebSocketImage url={this.state.url} /> : null}\n        </Row>\n        <TextInput\n          style={styles.textInput}\n          autoCorrect={false}\n          placeholder=\"Server URL...\"\n          onChangeText={url => this.setState({url})}\n          value={this.state.url}\n        />\n        <View style={styles.buttonRow}>\n          <Button\n            onPress={this._connect}\n            label=\"Connect\"\n            disabled={!canConnect}\n          />\n          <Button\n            onPress={this._disconnect}\n            label=\"Disconnect\"\n            disabled={canConnect}\n          />\n        </View>\n        <TextInput\n          style={styles.textInput}\n          autoCorrect={false}\n          placeholder=\"Type message here...\"\n          onChangeText={outgoingMessage => this.setState({outgoingMessage})}\n          value={this.state.outgoingMessage}\n        />\n        <View style={styles.buttonRow}>\n          <Button\n            onPress={this._sendText}\n            label=\"Send as text\"\n            disabled={!canSend}\n          />\n          <Button\n            onPress={this._sendBinary}\n            label=\"Send as binary\"\n            disabled={!canSend}\n          />\n        </View>\n        <View style={styles.note}>\n          <Text>To start the HTTP test server:</Text>\n          <Text style={styles.monospace}>\n            ./RNTester/js/http_test_server.js\n          </Text>\n        </View>\n        <TextInput\n          style={styles.textInput}\n          autoCorrect={false}\n          placeholder=\"HTTP URL...\"\n          onChangeText={httpUrl => this.setState({httpUrl})}\n          value={this.state.httpUrl}\n        />\n        <View style={styles.buttonRow}>\n          <Button\n            onPress={this._sendHttp}\n            label=\"Send HTTP request to set cookie\"\n            disabled={this.state.fetchStatus === 'fetching'}\n          />\n        </View>\n        <View style={styles.note}>\n          <Text>\n            {this.state.fetchStatus === 'OK'\n              ? 'Done. Check your WS server console to see if the next WS requests include the cookie (should be \"wstest=OK\")'\n              : '-'}\n          </Text>\n        </View>\n      </ScrollView>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  note: {\n    padding: 8,\n    margin: 4,\n    backgroundColor: 'white',\n  },\n  monospace: {\n    fontFamily: 'courier',\n    fontSize: 11,\n  },\n  row: {\n    height: 40,\n    padding: 4,\n    backgroundColor: 'white',\n    flexDirection: 'row',\n    justifyContent: 'space-between',\n    alignItems: 'center',\n    borderBottomWidth: 1 / PixelRatio.get(),\n    borderColor: 'grey',\n  },\n  button: {\n    margin: 8,\n    padding: 8,\n    borderRadius: 4,\n    backgroundColor: 'blue',\n    alignSelf: 'center',\n  },\n  disabledButton: {\n    opacity: 0.5,\n  },\n  buttonLabel: {\n    color: 'white',\n  },\n  buttonRow: {\n    flexDirection: 'row',\n    justifyContent: 'center',\n  },\n  textInput: {\n    height: 40,\n    backgroundColor: 'white',\n    margin: 8,\n    padding: 8,\n  },\n});\n\nmodule.exports = WebSocketExample;\n"
  },
  {
    "path": "RNTester/js/WebViewExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule WebViewExample\n */\n'use strict';\n\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  TextInput,\n  TouchableWithoutFeedback,\n  TouchableOpacity,\n  View,\n  WebView\n} = ReactNative;\n\nvar HEADER = '#3b5998';\nvar BGWASH = 'rgba(255,255,255,0.8)';\nvar DISABLED_WASH = 'rgba(255,255,255,0.25)';\n\nvar TEXT_INPUT_REF = 'urlInput';\nvar WEBVIEW_REF = 'webview';\nvar DEFAULT_URL = 'https://m.facebook.com';\n\nclass WebViewExample extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    url: DEFAULT_URL,\n    status: 'No Page Loaded',\n    backButtonEnabled: false,\n    forwardButtonEnabled: false,\n    loading: true,\n    scalesPageToFit: true,\n  };\n\n  inputText = '';\n\n  handleTextInputChange = (event) => {\n    var url = event.nativeEvent.text;\n    if (!/^[a-zA-Z-_]+:/.test(url)) {\n      url = 'http://' + url;\n    }\n    this.inputText = url;\n  };\n\n  render() {\n    this.inputText = this.state.url;\n\n    return (\n      <View style={[styles.container]}>\n        <View style={[styles.addressBarRow]}>\n          <TouchableOpacity\n            onPress={this.goBack}\n            style={this.state.backButtonEnabled ? styles.navButton : styles.disabledButton}>\n            <Text>\n               {'<'}\n            </Text>\n          </TouchableOpacity>\n          <TouchableOpacity\n            onPress={this.goForward}\n            style={this.state.forwardButtonEnabled ? styles.navButton : styles.disabledButton}>\n            <Text>\n              {'>'}\n            </Text>\n          </TouchableOpacity>\n          <TextInput\n            ref={TEXT_INPUT_REF}\n            autoCapitalize=\"none\"\n            defaultValue={this.state.url}\n            onSubmitEditing={this.onSubmitEditing}\n            onChange={this.handleTextInputChange}\n            clearButtonMode=\"while-editing\"\n            style={styles.addressBarTextInput}\n          />\n          <TouchableOpacity onPress={this.pressGoButton}>\n            <View style={styles.goButton}>\n              <Text>\n                 Go!\n              </Text>\n            </View>\n          </TouchableOpacity>\n        </View>\n        <WebView\n          ref={WEBVIEW_REF}\n          automaticallyAdjustContentInsets={false}\n          style={styles.webView}\n          source={{uri: this.state.url}}\n          javaScriptEnabled={true}\n          domStorageEnabled={true}\n          decelerationRate=\"normal\"\n          onNavigationStateChange={this.onNavigationStateChange}\n          onShouldStartLoadWithRequest={this.onShouldStartLoadWithRequest}\n          startInLoadingState={true}\n          scalesPageToFit={this.state.scalesPageToFit}\n        />\n        <View style={styles.statusBar}>\n          <Text style={styles.statusBarText}>{this.state.status}</Text>\n        </View>\n      </View>\n    );\n  }\n\n  goBack = () => {\n    this.refs[WEBVIEW_REF].goBack();\n  };\n\n  goForward = () => {\n    this.refs[WEBVIEW_REF].goForward();\n  };\n\n  reload = () => {\n    this.refs[WEBVIEW_REF].reload();\n  };\n\n  onShouldStartLoadWithRequest = (event) => {\n    // Implement any custom loading logic here, don't forget to return!\n    return true;\n  };\n\n  onNavigationStateChange = (navState) => {\n    this.setState({\n      backButtonEnabled: navState.canGoBack,\n      forwardButtonEnabled: navState.canGoForward,\n      url: navState.url,\n      status: navState.title,\n      loading: navState.loading,\n      scalesPageToFit: true\n    });\n  };\n\n  onSubmitEditing = (event) => {\n    this.pressGoButton();\n  };\n\n  pressGoButton = () => {\n    var url = this.inputText.toLowerCase();\n    if (url === this.state.url) {\n      this.reload();\n    } else {\n      this.setState({\n        url: url,\n      });\n    }\n    // dismiss keyboard\n    this.refs[TEXT_INPUT_REF].blur();\n  };\n}\n\nclass Button extends React.Component<$FlowFixMeProps> {\n  _handlePress = () => {\n    if (this.props.enabled !== false && this.props.onPress) {\n      this.props.onPress();\n    }\n  };\n\n  render() {\n    return (\n      <TouchableWithoutFeedback onPress={this._handlePress}>\n        <View style={styles.button}>\n          <Text>{this.props.text}</Text>\n        </View>\n      </TouchableWithoutFeedback>\n    );\n  }\n}\n\nclass ScaledWebView extends React.Component<{}, $FlowFixMeState> {\n  state = {\n    scalingEnabled: true,\n  };\n\n  render() {\n    return (\n      <View>\n        <WebView\n          style={{\n            backgroundColor: BGWASH,\n            height: 200,\n          }}\n          source={{uri: 'https://facebook.github.io/react/'}}\n          scalesPageToFit={this.state.scalingEnabled}\n        />\n        <View style={styles.buttons}>\n        { this.state.scalingEnabled ?\n          <Button\n            text=\"Scaling:ON\"\n            enabled={true}\n            onPress={() => this.setState({scalingEnabled: false})}\n          /> :\n          <Button\n            text=\"Scaling:OFF\"\n            enabled={true}\n            onPress={() => this.setState({scalingEnabled: true})}\n          /> }\n        </View>\n      </View>\n    );\n  }\n}\n\nclass MessagingTest extends React.Component<{}, $FlowFixMeState> {\n  webview = null\n\n  state = {\n    messagesReceivedFromWebView: 0,\n    message: '',\n  }\n\n  onMessage = e => this.setState({\n    messagesReceivedFromWebView: this.state.messagesReceivedFromWebView + 1,\n    message: e.nativeEvent.data,\n  })\n\n  postMessage = () => {\n    if (this.webview) {\n      this.webview.postMessage('\"Hello\" from React Native!');\n    }\n  }\n\n  render(): React.Node {\n    const {messagesReceivedFromWebView, message} = this.state;\n\n    return (\n      <View style={[styles.container, { height: 200 }]}>\n        <View style={styles.container}>\n          <Text>Messages received from web view: {messagesReceivedFromWebView}</Text>\n          <Text>{message || '(No message)'}</Text>\n          <View style={styles.buttons}>\n            <Button text=\"Send Message to Web View\" enabled onPress={this.postMessage} />\n          </View>\n        </View>\n        <View style={styles.container}>\n          <WebView\n            ref={webview => { this.webview = webview; }}\n            style={{\n              backgroundColor: BGWASH,\n              height: 100,\n            }}\n            source={require('./messagingtest.html')}\n            onMessage={this.onMessage}\n          />\n        </View>\n      </View>\n    );\n  }\n}\n\nclass InjectJS extends React.Component<{}> {\n  webview = null;\n  injectJS = () => {\n    const script = 'document.write(\"Injected JS \")';\n    if (this.webview) {\n      this.webview.injectJavaScript(script);\n    }\n  }\n  render() {\n    return (\n      <View>\n        <WebView\n          ref={webview => { this.webview = webview; }}\n          style={{\n            backgroundColor: BGWASH,\n            height: 300,\n          }}\n          source={{uri: 'https://www.facebook.com'}}\n          scalesPageToFit={true}\n        />\n        <View style={styles.buttons}>\n          <Button text=\"Inject JS\" enabled onPress={this.injectJS} />\n        </View>\n    </View>\n    );\n  }\n}\n\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    backgroundColor: HEADER,\n  },\n  addressBarRow: {\n    flexDirection: 'row',\n    padding: 8,\n  },\n  webView: {\n    backgroundColor: BGWASH,\n    height: 350,\n  },\n  addressBarTextInput: {\n    backgroundColor: BGWASH,\n    borderColor: 'transparent',\n    borderRadius: 3,\n    borderWidth: 1,\n    height: 24,\n    paddingLeft: 10,\n    paddingTop: 3,\n    paddingBottom: 3,\n    flex: 1,\n    fontSize: 14,\n  },\n  navButton: {\n    width: 20,\n    padding: 3,\n    marginRight: 3,\n    alignItems: 'center',\n    justifyContent: 'center',\n    backgroundColor: BGWASH,\n    borderColor: 'transparent',\n    borderRadius: 3,\n  },\n  disabledButton: {\n    width: 20,\n    padding: 3,\n    marginRight: 3,\n    alignItems: 'center',\n    justifyContent: 'center',\n    backgroundColor: DISABLED_WASH,\n    borderColor: 'transparent',\n    borderRadius: 3,\n  },\n  goButton: {\n    height: 24,\n    padding: 3,\n    marginLeft: 8,\n    alignItems: 'center',\n    backgroundColor: BGWASH,\n    borderColor: 'transparent',\n    borderRadius: 3,\n    alignSelf: 'stretch',\n  },\n  statusBar: {\n    flexDirection: 'row',\n    alignItems: 'center',\n    paddingLeft: 5,\n    height: 22,\n  },\n  statusBarText: {\n    color: 'white',\n    fontSize: 13,\n  },\n  spinner: {\n    width: 20,\n    marginRight: 6,\n  },\n  buttons: {\n    flexDirection: 'row',\n    height: 30,\n    backgroundColor: 'black',\n    alignItems: 'center',\n    justifyContent: 'space-between',\n  },\n  button: {\n    flex: 0.5,\n    width: 0,\n    margin: 5,\n    borderColor: 'gray',\n    borderWidth: 1,\n    backgroundColor: 'gray',\n  },\n});\n\nconst HTML = `\n<!DOCTYPE html>\\n\n<html>\n  <head>\n    <title>Hello Static World</title>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n    <meta name=\"viewport\" content=\"width=320, user-scalable=no\">\n    <style type=\"text/css\">\n      body {\n        margin: 0;\n        padding: 0;\n        font: 62.5% arial, sans-serif;\n        background: #ccc;\n      }\n      h1 {\n        padding: 45px;\n        margin: 0;\n        text-align: center;\n        color: #33f;\n      }\n    </style>\n  </head>\n  <body>\n    <h1>Hello Static World</h1>\n  </body>\n</html>\n`;\n\nexports.displayName = (undefined: ?string);\nexports.title = '<WebView>';\nexports.description = 'Base component to display web content';\nexports.examples = [\n  {\n    title: 'Simple Browser',\n    render(): React.Element<any> { return <WebViewExample />; }\n  },\n  {\n    title: 'Scale Page to Fit',\n    render(): React.Element<any> { return <ScaledWebView/>; }\n  },\n  {\n    title: 'Bundled HTML',\n    render(): React.Element<any> {\n      return (\n        <WebView\n          style={{\n            backgroundColor: BGWASH,\n            height: 100,\n          }}\n          source={require('./helloworld.html')}\n          scalesPageToFit={true}\n        />\n      );\n    }\n  },\n  {\n    title: 'Static HTML',\n    render(): React.Element<any> {\n      return (\n        <WebView\n          style={{\n            backgroundColor: BGWASH,\n            height: 100,\n          }}\n          source={{html: HTML}}\n          scalesPageToFit={true}\n        />\n      );\n    }\n  },\n  {\n    title: 'POST Test',\n    render(): React.Element<any> {\n      return (\n        <WebView\n          style={{\n            backgroundColor: BGWASH,\n            height: 100,\n          }}\n          source={{\n            uri: 'http://www.posttestserver.com/post.php',\n            method: 'POST',\n            body: 'foo=bar&bar=foo'\n          }}\n          scalesPageToFit={false}\n        />\n      );\n    }\n  },\n  {\n    title: 'Messaging Test',\n    render(): React.Element<any> { return <MessagingTest />; }\n  },\n  {\n    title: 'Inject JavaScript',\n    render(): React.Element<any> { return <InjectJS />; }\n  },\n];\n"
  },
  {
    "path": "RNTester/js/XHRExample.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule XHRExample\n */\n'use strict';\n\nvar React = require('react');\n\nvar XHRExampleDownload = require('./XHRExampleDownload');\nvar XHRExampleBinaryUpload = require('./XHRExampleBinaryUpload');\nvar XHRExampleFormData = require('./XHRExampleFormData');\nvar XHRExampleHeaders = require('./XHRExampleHeaders');\nvar XHRExampleFetch = require('./XHRExampleFetch');\nvar XHRExampleOnTimeOut = require('./XHRExampleOnTimeOut');\nvar XHRExampleCookies = require('./XHRExampleCookies');\n\nexports.framework = 'React';\nexports.title = 'XMLHttpRequest';\nexports.description = 'Example that demonstrates upload and download ' +\n  'requests using XMLHttpRequest.';\nexports.examples = [{\n  title: 'File Download',\n  render() {\n    return <XHRExampleDownload/>;\n  }\n}, {\n  title: 'multipart/form-data Upload',\n  render() {\n    return <XHRExampleBinaryUpload/>;\n  }\n}, {\n  title: 'multipart/form-data Upload',\n  render() {\n    return <XHRExampleFormData/>;\n  }\n}, {\n  title: 'Fetch Test',\n  render() {\n    return <XHRExampleFetch/>;\n  }\n}, {\n  title: 'Headers',\n  render() {\n    return <XHRExampleHeaders/>;\n  }\n}, {\n  title: 'Time Out Test',\n  render() {\n    return <XHRExampleOnTimeOut/>;\n  }\n}, {\n  title: 'Cookies',\n  render() {\n    return <XHRExampleCookies/>;\n  }\n}];\n"
  },
  {
    "path": "RNTester/js/XHRExampleBinaryUpload.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule XHRExampleBinaryUpload\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  Alert,\n  Linking,\n  Picker,\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  View,\n} = ReactNative;\n\nconst BINARY_TYPES = {\n  String,\n  ArrayBuffer,\n  Int8Array,\n  Uint8Array,\n  Uint8ClampedArray,\n  Int16Array,\n  Uint16Array,\n  Int32Array,\n  Uint32Array,\n  Float32Array,\n  Float64Array,\n  DataView,\n};\n\nconst SAMPLE_TEXT = `\nI am the spirit that negates.\nAnd rightly so, for all that comes to be\nDeserves to perish wretchedly;\n'Twere better nothing would begin.\nThus everything that that your terms, sin,\nDestruction, evil represent—\nThat is my proper element.\n\n--Faust, JW Goethe\n`;\n\n\nclass XHRExampleBinaryUpload extends React.Component<{}, $FlowFixMeState> {\n\n  static handlePostTestServerUpload(xhr: XMLHttpRequest) {\n    if (xhr.status !== 200) {\n      Alert.alert(\n        'Upload failed',\n        'Expected HTTP 200 OK response, got ' + xhr.status\n      );\n      return;\n    }\n    if (!xhr.responseText) {\n      Alert.alert(\n        'Upload failed',\n        'No response payload.'\n      );\n      return;\n    }\n    var index = xhr.responseText.indexOf('http://www.posttestserver.com/');\n    if (index === -1) {\n      Alert.alert(\n        'Upload failed',\n        'Invalid response payload.'\n      );\n      return;\n    }\n    var url = xhr.responseText.slice(index).split('\\n')[0];\n    console.log('Upload successful: ' + url);\n    Linking.openURL(url);\n  }\n\n  state = {\n    type: 'Uint8Array',\n  };\n\n  _upload = () => {\n    var xhr = new XMLHttpRequest();\n    xhr.open('POST', 'http://posttestserver.com/post.php');\n    xhr.onload = () => XHRExampleBinaryUpload.handlePostTestServerUpload(xhr);\n    xhr.setRequestHeader('Content-Type', 'text/plain');\n\n    if (this.state.type === 'String') {\n      xhr.send(SAMPLE_TEXT);\n      return;\n    }\n\n    const arrayBuffer = new ArrayBuffer(256);\n    const asBytes = new Uint8Array(arrayBuffer);\n    for (let i = 0; i < SAMPLE_TEXT.length; i++) {\n      asBytes[i] = SAMPLE_TEXT.charCodeAt(i);\n    }\n    if (this.state.type === 'ArrayBuffer') {\n      xhr.send(arrayBuffer);\n      return;\n    }\n    if (this.state.type === 'Uint8Array') {\n      xhr.send(asBytes);\n      return;\n    }\n\n    const TypedArrayClass = BINARY_TYPES[this.state.type];\n    xhr.send(new TypedArrayClass(arrayBuffer));\n  };\n\n  render() {\n    return (\n      <View>\n        <Text>Upload 255 bytes as...</Text>\n        <Picker\n          selectedValue={this.state.type}\n          onValueChange={(type) => this.setState({type})}>\n          {Object.keys(BINARY_TYPES).map((type) => (\n            <Picker.Item key={type} label={type} value={type} />\n          ))}\n        </Picker>\n        <View style={styles.uploadButton}>\n          <TouchableHighlight onPress={this._upload}>\n            <View style={styles.uploadButtonBox}>\n              <Text style={styles.uploadButtonLabel}>Upload</Text>\n            </View>\n          </TouchableHighlight>\n        </View>\n      </View>\n    );\n  }\n\n}\n\nconst styles = StyleSheet.create({\n  uploadButton: {\n    marginTop: 16,\n  },\n  uploadButtonBox: {\n    flex: 1,\n    paddingVertical: 12,\n    alignItems: 'center',\n    backgroundColor: 'blue',\n    borderRadius: 4,\n  },\n  uploadButtonLabel: {\n    color: 'white',\n    fontSize: 16,\n    fontWeight: '500',\n  },\n});\n\nmodule.exports = XHRExampleBinaryUpload;\n"
  },
  {
    "path": "RNTester/js/XHRExampleCookies.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule XHRExampleCookies\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  View,\n  WebView,\n} = ReactNative;\n\nvar RCTNetworking = require('RCTNetworking');\n\nclass XHRExampleCookies extends React.Component<any, any> {\n  cancelled: boolean;\n\n  constructor(props: any) {\n    super(props);\n    this.cancelled = false;\n    this.state = {\n      status: '',\n      a: 1,\n      b: 2,\n    };\n  }\n\n  setCookie(domain: string) {\n    var {a, b} = this.state;\n    var url = `https://${domain}/cookies/set?a=${a}&b=${b}`;\n    fetch(url).then((response) => {\n      this.setStatus(`Cookies a=${a}, b=${b} set`);\n      this.refreshWebview();\n    });\n\n    this.setState({\n      status: 'Setting cookies...',\n      a: a + 1,\n      b: b + 2,\n    });\n  }\n\n  getCookies(domain: string) {\n    fetch(`https://${domain}/cookies`).then((response) => {\n      return response.json();\n    }).then((data) => {\n      this.setStatus(`Got cookies ${JSON.stringify(data.cookies)} from server`);\n      this.refreshWebview();\n    });\n\n    this.setStatus('Getting cookies...');\n  }\n\n  clearCookies() {\n    RCTNetworking.clearCookies((cleared) => {\n      this.setStatus('Cookies cleared, had cookies=' + cleared.toString());\n      this.refreshWebview();\n    });\n  }\n\n  refreshWebview() {\n    this.refs.webview.reload();\n  }\n\n  setStatus(status: string) {\n    this.setState({status});\n  }\n\n  render() {\n    return (\n      <View>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this.setCookie.bind(this, 'httpbin.org')}>\n          <View style={styles.button}>\n            <Text>Set cookie</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this.setCookie.bind(this, 'eu.httpbin.org')}>\n          <View style={styles.button}>\n            <Text>Set cookie (EU)</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this.getCookies.bind(this, 'httpbin.org')}>\n          <View style={styles.button}>\n            <Text>Get cookies</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this.getCookies.bind(this, 'eu.httpbin.org')}>\n          <View style={styles.button}>\n            <Text>Get cookies (EU)</Text>\n          </View>\n        </TouchableHighlight>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this.clearCookies.bind(this)}>\n          <View style={styles.button}>\n            <Text>Clear cookies</Text>\n          </View>\n        </TouchableHighlight>\n        <Text>{this.state.status}</Text>\n        <TouchableHighlight\n          style={styles.wrapper}\n          onPress={this.refreshWebview.bind(this)}>\n          <View style={styles.button}>\n            <Text>Refresh Webview</Text>\n          </View>\n        </TouchableHighlight>\n        <WebView\n          ref=\"webview\"\n          source={{uri: 'http://httpbin.org/cookies'}}\n          style={{height: 100}}\n        />\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  wrapper: {\n    borderRadius: 5,\n    marginBottom: 5,\n  },\n  button: {\n    backgroundColor: '#eeeeee',\n    padding: 8,\n  },\n});\n\nmodule.exports = XHRExampleCookies;\n"
  },
  {
    "path": "RNTester/js/XHRExampleDownload.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule XHRExampleDownload\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  Alert,\n  Platform,\n  ProgressBarAndroid,\n  ProgressViewIOS,\n  StyleSheet,\n  Switch,\n  Text,\n  TouchableHighlight,\n  View,\n} = ReactNative;\n\n/**\n * Convert number of bytes to MB and round to the nearest 0.1 MB.\n */\nfunction roundKilo(value: number): number {\n  return Math.round(value / 1000);\n}\n\nclass ProgressBar extends React.Component<$FlowFixMeProps> {\n  render() {\n    if (Platform.OS === 'android') {\n      return (\n        <ProgressBarAndroid\n          progress={this.props.progress}\n          styleAttr=\"Horizontal\"\n          indeterminate={false}\n        />\n      );\n    }\n    return (\n      <ProgressViewIOS\n        progress={this.props.progress}\n      />\n    );\n  }\n}\n\nclass XHRExampleDownload extends React.Component<{}, Object> {\n  state: Object = {\n    downloading: false,\n    // set by onreadystatechange\n    contentLength: 1,\n    responseLength: 0,\n    // set by onprogress\n    progressTotal: 1,\n    progressLoaded: 0,\n\n    readystateHandler: false,\n    progressHandler: true,\n    arraybuffer: false,\n  };\n\n  xhr: ?XMLHttpRequest = null;\n  cancelled: boolean = false;\n\n  _download = () => {\n    let xhr;\n    if (this.xhr) {\n      xhr = this.xhr;\n      xhr.abort();\n    } else {\n      xhr = this.xhr = new XMLHttpRequest();\n    }\n\n    const onreadystatechange = () => {\n      if (xhr.readyState === xhr.HEADERS_RECEIVED) {\n        const contentLength =\n          parseInt(xhr.getResponseHeader('Content-Length'), 10);\n        this.setState({\n          contentLength,\n          responseLength: 0,\n        });\n      } else if (xhr.readyState === xhr.LOADING && xhr.response) {\n        this.setState({\n          responseLength: xhr.response.length,\n        });\n      }\n    };\n    const onprogress = (event) => {\n      this.setState({\n        progressTotal: event.total,\n        progressLoaded: event.loaded,\n      });\n    };\n\n    if (this.state.readystateHandler) {\n      xhr.onreadystatechange = onreadystatechange;\n    }\n    if (this.state.progressHandler) {\n      xhr.onprogress = onprogress;\n    }\n    if (this.state.arraybuffer) {\n      xhr.responseType = 'arraybuffer';\n    }\n    xhr.onload = () => {\n      this.setState({downloading: false});\n      if (this.cancelled) {\n        this.cancelled = false;\n        return;\n      }\n      if (xhr.status === 200) {\n        let responseType =\n          `Response is a string, ${xhr.response.length} characters long.`;\n        if (xhr.response instanceof ArrayBuffer) {\n          responseType =\n            `Response is an ArrayBuffer, ${xhr.response.byteLength} bytes long.`;\n        }\n        Alert.alert('Download complete!', responseType);\n      } else if (xhr.status !== 0) {\n        Alert.alert(\n          'Error',\n          `Server returned HTTP status of ${xhr.status}: ${xhr.responseText}`\n        );\n      } else {\n        Alert.alert('Error', xhr.responseText);\n      }\n    };\n    xhr.open('GET', 'http://aleph.gutenberg.org/cache/epub/100/pg100.txt.utf8');\n    // Avoid gzip so we can actually show progress\n    xhr.setRequestHeader('Accept-Encoding', '');\n    xhr.send();\n\n    this.setState({downloading: true});\n  }\n\n  componentWillUnmount() {\n    this.cancelled = true;\n    this.xhr && this.xhr.abort();\n  }\n\n  render() {\n    const button = this.state.downloading ? (\n      <View style={styles.wrapper}>\n        <View style={styles.button}>\n          <Text>Downloading...</Text>\n        </View>\n      </View>\n    ) : (\n      <TouchableHighlight\n        style={styles.wrapper}\n        onPress={this._download}>\n        <View style={styles.button}>\n          <Text>Download 5MB Text File</Text>\n        </View>\n      </TouchableHighlight>\n    );\n\n    let readystate = null;\n    let progress = null;\n    if (this.state.readystateHandler && !this.state.arraybuffer) {\n      const { responseLength, contentLength } = this.state;\n      readystate = (\n        <View>\n          <Text style={styles.progressBarLabel}>\n            responseText:{' '}\n            {roundKilo(responseLength)}/{roundKilo(contentLength)}k chars\n          </Text>\n          <ProgressBar\n            progress={(responseLength / contentLength)}\n          />\n        </View>\n      );\n    }\n    if (this.state.progressHandler) {\n      const { progressLoaded, progressTotal } = this.state;\n      progress = (\n        <View>\n          <Text style={styles.progressBarLabel}>\n            onprogress:{' '}\n            {roundKilo(progressLoaded)}/{roundKilo(progressTotal)} KB\n          </Text>\n          <ProgressBar\n            progress={(progressLoaded / progressTotal)}\n          />\n        </View>\n      );\n    }\n\n    return (\n      <View>\n        <View style={styles.configRow}>\n          <Text>onreadystatechange handler</Text>\n          <Switch\n            value={this.state.readystateHandler}\n            onValueChange={(readystateHandler => this.setState({readystateHandler}))}\n          />\n        </View>\n        <View style={styles.configRow}>\n          <Text>onprogress handler</Text>\n          <Switch\n            value={this.state.progressHandler}\n            onValueChange={(progressHandler => this.setState({progressHandler}))}\n          />\n        </View>\n        <View style={styles.configRow}>\n          <Text>download as arraybuffer</Text>\n          <Switch\n            value={this.state.arraybuffer}\n            onValueChange={(arraybuffer => this.setState({arraybuffer}))}\n          />\n        </View>\n        {button}\n        {readystate}\n        {progress}\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  wrapper: {\n    borderRadius: 5,\n    marginBottom: 5,\n  },\n  button: {\n    backgroundColor: '#eeeeee',\n    padding: 8,\n  },\n  progressBarLabel: {\n    marginTop: 12,\n    marginBottom: 8,\n  },\n  configRow: {\n    flexDirection: 'row',\n    paddingVertical: 8,\n    alignItems: 'center',\n    justifyContent: 'space-between',\n  },\n});\n\nmodule.exports = XHRExampleDownload;\n"
  },
  {
    "path": "RNTester/js/XHRExampleFetch.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule XHRExampleFetch\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  TextInput,\n  View,\n  Platform,\n} = ReactNative;\n\n\nclass XHRExampleFetch extends React.Component<any, any> {\n  responseURL: ?string;\n  responseHeaders: ?Object;\n\n  constructor(props: any) {\n    super(props);\n    this.state = {\n     responseText: null,\n    };\n    this.responseURL = null;\n    this.responseHeaders = null;\n  }\n\n  submit(uri: String) {\n    fetch(uri).then((response) => {\n      this.responseURL = response.url;\n      this.responseHeaders = response.headers;\n      return response.text();\n    }).then((body) => {\n      this.setState({responseText: body});\n    });\n  }\n\n  _renderHeaders() {\n    if (!this.responseHeaders) {\n      return null;\n    }\n\n    var responseHeaders = [];\n    var keys = Object.keys(this.responseHeaders.map);\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i];\n      var value = this.responseHeaders.get(key);\n      responseHeaders.push(<Text>{key}: {value}</Text>);\n    }\n    return responseHeaders;\n  }\n\n  render() {\n\n    var responseURL = this.responseURL ? (\n      <View style={{marginTop: 10}}>\n        <Text style={styles.label}>Server response URL:</Text>\n        <Text>{this.responseURL}</Text>\n      </View>\n    ) : null;\n\n    var responseHeaders = this.responseHeaders ? (\n      <View style={{marginTop: 10}}>\n        <Text style={styles.label}>Server response headers:</Text>\n        {this._renderHeaders()}\n      </View>\n    ) : null;\n\n    var response = this.state.responseText ? (\n      <View style={{marginTop: 10}}>\n        <Text style={styles.label}>Server response:</Text>\n        <TextInput\n          editable={false}\n          multiline={true}\n          defaultValue={this.state.responseText}\n          style={styles.textOutput}\n        />\n      </View>\n    ) : null;\n\n    return (\n      <View>\n        <Text style={styles.label}>Edit URL to submit:</Text>\n        <TextInput\n          returnKeyType=\"go\"\n          defaultValue=\"http://www.posttestserver.com/post.php\"\n          onSubmitEditing={(event)=> {\n            this.submit(event.nativeEvent.text);\n          }}\n          style={styles.textInput}\n        />\n        {responseURL}\n        {responseHeaders}\n        {response}\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  textInput: {\n    flex: 1,\n    borderRadius: 3,\n    borderColor: 'grey',\n    borderWidth: 1,\n    height: Platform.OS === 'android' ? 44 : 30,\n    paddingLeft: 8,\n  },\n  label: {\n    flex: 1,\n    color: '#aaa',\n    fontWeight: '500',\n    height: 20,\n  },\n  textOutput: {\n    flex: 1,\n    fontSize: 17,\n    borderRadius: 3,\n    borderColor: 'grey',\n    borderWidth: 1,\n    height: 200,\n    paddingLeft: 8,\n  },\n});\n\nmodule.exports = XHRExampleFetch;\n"
  },
  {
    "path": "RNTester/js/XHRExampleFormData.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule XHRExampleFormData\n */\n'use strict';\n\nconst React = require('react');\nconst ReactNative = require('react-native');\nconst {\n  Alert,\n  CameraRoll,\n  Image,\n  ImageEditor,\n  Linking,\n  Platform,\n  StyleSheet,\n  Text,\n  TextInput,\n  TouchableHighlight,\n  View,\n} = ReactNative;\n\nconst XHRExampleBinaryUpload = require('./XHRExampleBinaryUpload');\n\nconst PAGE_SIZE = 20;\n\nclass XHRExampleFormData extends React.Component<Object, Object> {\n  state: Object = {\n    isUploading: false,\n    uploadProgress: null,\n    randomPhoto: null,\n    textParams: [],\n  };\n\n  _isMounted: boolean = true;\n\n  constructor(props: Object) {\n    super(props);\n    this._fetchRandomPhoto();\n  }\n\n  componentWillUnmount() {\n    this._isMounted = false;\n  }\n\n  _fetchRandomPhoto = () => {\n    return;\n    CameraRoll.getPhotos(\n      {first: PAGE_SIZE}\n    ).then(\n      (data) => {\n        if (!this._isMounted) {\n          return;\n        }\n        var edges = data.edges;\n        var edge = edges[Math.floor(Math.random() * edges.length)];\n        var randomPhoto = edge && edge.node && edge.node.image;\n        if (randomPhoto) {\n          let {width, height} = randomPhoto;\n          width *= 0.25;\n          height *= 0.25;\n          ImageEditor.cropImage(\n            randomPhoto.uri,\n            {offset: {x: 0, y: 0}, size: {width, height}},\n            (uri) => this.setState({randomPhoto: {uri}}),\n            (error) => undefined\n          );\n        }\n      },\n      (error) => undefined\n    );\n  };\n\n  _addTextParam = () => {\n    var textParams = this.state.textParams;\n    textParams.push({name: '', value: ''});\n    this.setState({textParams});\n  };\n\n  _onTextParamNameChange(index, text) {\n    var textParams = this.state.textParams;\n    textParams[index].name = text;\n    this.setState({textParams});\n  }\n\n  _onTextParamValueChange(index, text) {\n    var textParams = this.state.textParams;\n    textParams[index].value = text;\n    this.setState({textParams});\n  }\n\n  _upload = () => {\n    var xhr = new XMLHttpRequest();\n    xhr.open('POST', 'http://posttestserver.com/post.php');\n    xhr.onload = () => {\n      this.setState({isUploading: false});\n      XHRExampleBinaryUpload.handlePostTestServerUpload(xhr);\n    };\n    var formdata = new FormData();\n    if (this.state.randomPhoto) {\n      formdata.append('image', {\n        ...this.state.randomPhoto,\n        type: 'image/jpg',\n        name: 'image.jpg',\n      });\n    }\n    this.state.textParams.forEach(\n      (param) => formdata.append(param.name, param.value)\n    );\n    xhr.upload.onprogress = (event) => {\n      if (event.lengthComputable) {\n        this.setState({uploadProgress: event.loaded / event.total});\n      }\n    };\n\n    xhr.send(formdata);\n    this.setState({isUploading: true});\n  };\n\n  render() {\n    var image = null;\n    if (this.state.randomPhoto) {\n      image = (\n        <Image\n          source={this.state.randomPhoto}\n          style={styles.randomPhoto}\n        />\n      );\n    }\n    var textItems = this.state.textParams.map((item, index) => (\n      <View style={styles.paramRow}>\n        <TextInput\n          autoCapitalize=\"none\"\n          autoCorrect={false}\n          onChangeText={this._onTextParamNameChange.bind(this, index)}\n          placeholder=\"name...\"\n          style={styles.textInput}\n        />\n        <Text style={styles.equalSign}>=</Text>\n        <TextInput\n          autoCapitalize=\"none\"\n          autoCorrect={false}\n          onChangeText={this._onTextParamValueChange.bind(this, index)}\n          placeholder=\"value...\"\n          style={styles.textInput}\n        />\n      </View>\n    ));\n    var uploadButtonLabel = this.state.isUploading ? 'Uploading...' : 'Upload';\n    var uploadProgress = this.state.uploadProgress;\n    if (uploadProgress !== null) {\n      uploadButtonLabel += ' ' + Math.round(uploadProgress * 100) + '%';\n    }\n    var uploadButton = (\n      <View style={styles.uploadButtonBox}>\n        <Text style={styles.uploadButtonLabel}>{uploadButtonLabel}</Text>\n      </View>\n    );\n    if (!this.state.isUploading) {\n      uploadButton = (\n        <TouchableHighlight onPress={this._upload}>\n          {uploadButton}\n        </TouchableHighlight>\n      );\n    }\n    return (\n      <View>\n        <View style={styles.paramRow}>\n          <Text style={styles.photoLabel}>\n            Random photo from your library\n            (<Text style={styles.textButton} onPress={this._fetchRandomPhoto}>\n              update\n            </Text>)\n          </Text>\n          {image}\n        </View>\n        {textItems}\n        <View>\n          <Text\n            style={[styles.textButton, styles.addTextParamButton]}\n            onPress={this._addTextParam}>\n            Add a text param\n          </Text>\n        </View>\n        <View style={styles.uploadButton}>\n          {uploadButton}\n        </View>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  paramRow: {\n    flexDirection: 'row',\n    paddingVertical: 8,\n    alignItems: 'center',\n    borderBottomWidth: StyleSheet.hairlineWidth,\n    borderBottomColor: 'grey',\n  },\n  photoLabel: {\n    flex: 1,\n  },\n  randomPhoto: {\n    width: 50,\n    height: 50,\n  },\n  textButton: {\n    color: 'blue',\n  },\n  addTextParamButton: {\n    marginTop: 8,\n  },\n  textInput: {\n    flex: 1,\n    borderRadius: 3,\n    borderColor: 'grey',\n    borderWidth: 1,\n    height: Platform.OS === 'android' ? 50 : 30,\n    paddingLeft: 8,\n  },\n  equalSign: {\n    paddingHorizontal: 4,\n  },\n  uploadButton: {\n    marginTop: 16,\n  },\n  uploadButtonBox: {\n    flex: 1,\n    paddingVertical: 12,\n    alignItems: 'center',\n    backgroundColor: 'blue',\n    borderRadius: 4,\n  },\n  uploadButtonLabel: {\n    color: 'white',\n    fontSize: 16,\n    fontWeight: '500',\n  },\n});\n\nmodule.exports = XHRExampleFormData;\n"
  },
  {
    "path": "RNTester/js/XHRExampleHeaders.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @noflow\n * @providesModule XHRExampleHeaders\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  View,\n} = ReactNative;\n\nclass XHRExampleHeaders extends React.Component {\n\n  xhr: XMLHttpRequest;\n  cancelled: boolean;\n\n  constructor(props) {\n    super(props);\n    this.cancelled = false;\n    this.state = {\n      status: '',\n      headers: '',\n      contentSize: 1,\n      downloaded: 0,\n    };\n  }\n\n  download() {\n    this.xhr && this.xhr.abort();\n\n    var xhr = this.xhr || new XMLHttpRequest();\n    xhr.onreadystatechange = () => {\n      if (xhr.readyState === xhr.DONE) {\n        if (this.cancelled) {\n          this.cancelled = false;\n          return;\n        }\n        if (xhr.status === 200) {\n          this.setState({\n            status: 'Download complete!',\n            headers: xhr.getAllResponseHeaders()\n          });\n        } else if (xhr.status !== 0) {\n          this.setState({\n            status: 'Error: Server returned HTTP status of ' + xhr.status + ' ' + xhr.responseText,\n          });\n        } else {\n          this.setState({\n            status: 'Error: ' + xhr.responseText,\n          });\n        }\n      }\n    };\n    xhr.open('GET', 'https://httpbin.org/response-headers?header1=value&header2=value1&header2=value2');\n    xhr.send();\n    this.xhr = xhr;\n\n    this.setState({status: 'Downloading...'});\n  }\n\n  componentWillUnmount() {\n    this.cancelled = true;\n    this.xhr && this.xhr.abort();\n  }\n\n  render() {\n    var button = this.state.status === 'Downloading...' ? (\n      <View style={styles.wrapper}>\n        <View style={styles.button}>\n          <Text>...</Text>\n        </View>\n      </View>\n    ) : (\n      <TouchableHighlight\n        style={styles.wrapper}\n        onPress={this.download.bind(this)}>\n        <View style={styles.button}>\n         <Text>Get headers</Text>\n        </View>\n      </TouchableHighlight>\n    );\n\n    return (\n      <View>\n        {button}\n        <Text>{this.state.headers}</Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  wrapper: {\n    borderRadius: 5,\n    marginBottom: 5,\n  },\n  button: {\n    backgroundColor: '#eeeeee',\n    padding: 8,\n  },\n});\n\nmodule.exports = XHRExampleHeaders;\n"
  },
  {
    "path": "RNTester/js/XHRExampleOnTimeOut.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule XHRExampleOnTimeOut\n */\n'use strict';\n\nvar React = require('React');\nvar ReactNative = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  View,\n} = ReactNative;\n\nclass XHRExampleOnTimeOut extends React.Component<any, any> {\n  xhr: XMLHttpRequest;\n\n  constructor(props: any) {\n    super(props);\n    this.state = {\n      status: '',\n      loading: false\n    };\n  }\n\n  loadTimeOutRequest() {\n    this.xhr && this.xhr.abort();\n\n    var xhr = this.xhr || new XMLHttpRequest();\n\n    xhr.onerror = ()=> {\n      console.log('Status ', xhr.status);\n      console.log('Error ', xhr.responseText);\n    };\n\n    xhr.ontimeout = () => {\n      this.setState({\n        status: xhr.responseText,\n        loading: false\n      });\n    };\n\n    xhr.onload = () => {\n      console.log('Status ', xhr.status);\n      console.log('Response ', xhr.responseText);\n    };\n\n    xhr.open('GET', 'https://httpbin.org/delay/5'); // request to take 5 seconds to load\n    xhr.timeout = 2000; // request times out in 2 seconds\n    xhr.send();\n    this.xhr = xhr;\n\n    this.setState({loading: true});\n  }\n\n  componentWillUnmount() {\n    this.xhr && this.xhr.abort();\n  }\n\n  render() {\n    var button = this.state.loading ? (\n      <View style={styles.wrapper}>\n        <View style={styles.button}>\n          <Text>Loading...</Text>\n        </View>\n      </View>\n    ) : (\n      <TouchableHighlight\n        style={styles.wrapper}\n        onPress={this.loadTimeOutRequest.bind(this)}>\n        <View style={styles.button}>\n         <Text>Make Time Out Request</Text>\n        </View>\n      </TouchableHighlight>\n    );\n\n    return (\n      <View>\n        {button}\n        <Text>{this.state.status}</Text>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  wrapper: {\n    borderRadius: 5,\n    marginBottom: 5,\n  },\n  button: {\n    backgroundColor: '#eeeeee',\n    padding: 8,\n  },\n});\n\nmodule.exports = XHRExampleOnTimeOut;\n"
  },
  {
    "path": "RNTester/js/createExamplePage.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule createExamplePage\n * @flow\n */\n'use strict';\n\nconst React = require('react');\n\nconst RNTesterExampleContainer = require('./RNTesterExampleContainer');\n\nimport type { ExampleModule } from 'ExampleTypes';\n\nvar createExamplePage = function(title: ?string, exampleModule: ExampleModule)\n  : React.ComponentType<any> {\n\n  class ExamplePage extends React.Component<{}> {\n    render() {\n      return <RNTesterExampleContainer module={exampleModule} title={title} />;\n    }\n  }\n\n  return ExamplePage;\n};\n\nmodule.exports = createExamplePage;\n"
  },
  {
    "path": "RNTester/js/helloworld.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <title>Hello Bundled World</title>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n    <meta name=\"viewport\" content=\"width=320, user-scalable=no\">\n    <style type=\"text/css\">\n      body {\n        margin: 0;\n        padding: 0;\n        font: 62.5% arial, sans-serif;\n        background: #ccc;\n      }\n      h1 {\n        padding: 45px;\n        margin: 0;\n        text-align: center;\n        color: #f33;\n      }\n    </style>\n  </head>\n  <body>\n    <h1>Hello Bundled World</h1>\n  </body>\n</html>\n"
  },
  {
    "path": "RNTester/js/http_test_server.js",
    "content": "#!/usr/bin/env node\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule http_test_server\n */\n'use strict';\n\n/* eslint-env node */\n\nconsole.log(`\\\nTest server for WebSocketExample\n\nThis will set a cookie named \"wstest\" on the response of any incoming request.\n`);\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst connect = require('connect');\nconst http = require('http');\n\nconst app = connect();\n\napp.use(function(req, res) {\n  console.log('received request');\n  const cookieOptions = {\n    //httpOnly: true, // the cookie is not accessible by the user (javascript,...)\n    secure: false, // allow HTTP\n  };\n  res.cookie('wstest', 'OK', cookieOptions);\n  res.end('Cookie has been set!\\n');\n});\n\nhttp.createServer(app).listen(5556);\n"
  },
  {
    "path": "RNTester/js/messagingtest.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <title>Messaging Test</title>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n    <meta name=\"viewport\" content=\"width=320, user-scalable=no\">\n  </head>\n  <body>\n    <p>Messages recieved from React Native: 0</p>\n    <p>(No messages)</p>\n    <button type=\"button\">\n      Send message to React Native\n    </button>\n  </body>\n  <script>\n    var messagesReceivedFromReactNative = 0;\n    document.addEventListener('message', function(e) {\n      messagesReceivedFromReactNative += 1;\n      document.getElementsByTagName('p')[0].innerHTML =\n        'Messages recieved from React Native: ' + messagesReceivedFromReactNative;\n      document.getElementsByTagName('p')[1].innerHTML = e.data;\n    });\n\n    document.getElementsByTagName('button')[0].addEventListener('click', function() {\n      window.postMessage('\"Hello\" from the web view');\n    });\n  </script>\n</html>\n"
  },
  {
    "path": "RNTester/js/websocket_test_server.js",
    "content": "#!/usr/bin/env node\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule websocket_test_server\n */\n'use strict';\n\n/* eslint-env node */\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst WebSocket = require('ws');\n\nconst fs = require('fs');\nconst path = require('path');\n\nconsole.log(`\\\nTest server for WebSocketExample\n\nThis will send each incoming message right back to the other side.\nRestart with the '--binary' command line flag to have it respond with an\nArrayBuffer instead of a string.\n`);\n\nconst respondWithBinary = process.argv.indexOf('--binary') !== -1;\nconst server = new WebSocket.Server({port: 5555});\nserver.on('connection', (ws) => {\n  ws.on('message', (message) => {\n    console.log('Received message:', message);\n    console.log('Cookie:', ws.upgradeReq.headers.cookie);\n    if (respondWithBinary) {\n      message = new Buffer(message);\n    }\n    if (message === 'getImage') {\n      message = fs.readFileSync(path.resolve(__dirname, 'flux@3x.png'));\n    }\n    console.log('Replying with:', message);\n    ws.send(message);\n  });\n\n  console.log('Incoming connection!');\n  ws.send('Why hello there!');\n});\n"
  },
  {
    "path": "React/Base/RCTAssert.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTDefines.h>\n\n/*\n * Defined in RCTUtils.m\n */\nRCT_EXTERN BOOL RCTIsMainQueue(void);\n\n/**\n * This is the main assert macro that you should use. Asserts should be compiled out\n * in production builds. You can customize the assert behaviour by setting a custom\n * assert handler through `RCTSetAssertFunction`.\n */\n#ifndef NS_BLOCK_ASSERTIONS\n#define RCTAssert(condition, ...) do { \\\n  if ((condition) == 0) { \\\n    _RCTAssertFormat(#condition, __FILE__, __LINE__, __func__, __VA_ARGS__); \\\n    if (RCT_NSASSERT) { \\\n      [[NSAssertionHandler currentHandler] handleFailureInFunction:@(__func__) \\\n        file:@(__FILE__) lineNumber:__LINE__ description:__VA_ARGS__]; \\\n    } \\\n  } \\\n} while (false)\n#else\n#define RCTAssert(condition, ...) do {} while (false)\n#endif\nRCT_EXTERN void _RCTAssertFormat(\n  const char *, const char *, int, const char *, NSString *, ...\n) NS_FORMAT_FUNCTION(5,6);\n\n/**\n * Report a fatal condition when executing. These calls will _NOT_ be compiled out\n * in production, and crash the app by default. You can customize the fatal behaviour\n * by setting a custom fatal handler through `RCTSetFatalHandler`.\n */\nRCT_EXTERN void RCTFatal(NSError *error);\n\n/**\n * The default error domain to be used for React errors.\n */\nRCT_EXTERN NSString *const RCTErrorDomain;\n\n/**\n * JS Stack trace provided as part of an NSError's userInfo\n */\nRCT_EXTERN NSString *const RCTJSStackTraceKey;\n\n/**\n * Raw JS Stack trace string provided as part of an NSError's userInfo\n */\nRCT_EXTERN NSString *const RCTJSRawStackTraceKey;\n\n/**\n * Name of fatal exceptions generated by RCTFatal\n */\nRCT_EXTERN NSString *const RCTFatalExceptionName;\n\n/**\n * A block signature to be used for custom assertion handling.\n */\ntypedef void (^RCTAssertFunction)(NSString *condition,\n                                  NSString *fileName,\n                                  NSNumber *lineNumber,\n                                  NSString *function,\n                                  NSString *message);\n\ntypedef void (^RCTFatalHandler)(NSError *error);\n\n/**\n * Convenience macro for asserting that a parameter is non-nil/non-zero.\n */\n#define RCTAssertParam(name) RCTAssert(name, @\"'%s' is a required parameter\", #name)\n\n/**\n * Convenience macro for asserting that we're running on main queue.\n */\n#define RCTAssertMainQueue() RCTAssert(RCTIsMainQueue(), \\\n  @\"This function must be called on the main queue\")\n\n/**\n * Convenience macro for asserting that we're running off the main queue.\n */\n#define RCTAssertNotMainQueue() RCTAssert(!RCTIsMainQueue(), \\\n@\"This function must not be called on the main queue\")\n\n/**\n * These methods get and set the current assert function called by the RCTAssert\n * macros. You can use these to replace the standard behavior with custom assert\n * functionality.\n */\nRCT_EXTERN void RCTSetAssertFunction(RCTAssertFunction assertFunction);\nRCT_EXTERN RCTAssertFunction RCTGetAssertFunction(void);\n\n/**\n * This appends additional code to the existing assert function, without\n * replacing the existing functionality. Useful if you just want to forward\n * assert info to an extra service without changing the default behavior.\n */\nRCT_EXTERN void RCTAddAssertFunction(RCTAssertFunction assertFunction);\n\n/**\n * This method temporarily overrides the assert function while performing the\n * specified block. This is useful for testing purposes (to detect if a given\n * function asserts something) or to suppress or override assertions temporarily.\n */\nRCT_EXTERN void RCTPerformBlockWithAssertFunction(void (^block)(void), RCTAssertFunction assertFunction);\n\n/**\n These methods get and set the current fatal handler called by the RCTFatal method.\n */\nRCT_EXTERN void RCTSetFatalHandler(RCTFatalHandler fatalHandler);\nRCT_EXTERN RCTFatalHandler RCTGetFatalHandler(void);\n\n/**\n * Get the current thread's name (or the current queue, if in debug mode)\n */\nRCT_EXTERN NSString *RCTCurrentThreadName(void);\n\n/**\n * Helper to get generate exception message from NSError\n */\nRCT_EXTERN NSString *RCTFormatError(NSString *message, NSArray<NSDictionary<NSString *, id> *> *stacktrace, NSUInteger maxMessageLength);\n\n/**\n * Convenience macro to assert which thread is currently running (DEBUG mode only)\n */\n#if DEBUG\n\n#define RCTAssertThread(thread, format...) \\\n_Pragma(\"clang diagnostic push\") \\\n_Pragma(\"clang diagnostic ignored \\\"-Wdeprecated-declarations\\\"\") \\\nRCTAssert( \\\n  [(id)thread isKindOfClass:[NSString class]] ? \\\n    [RCTCurrentThreadName() isEqualToString:(NSString *)thread] : \\\n    [(id)thread isKindOfClass:[NSThread class]] ? \\\n      [NSThread currentThread] ==  (NSThread *)thread : \\\n      dispatch_get_current_queue() == (dispatch_queue_t)thread, \\\n  format); \\\n_Pragma(\"clang diagnostic pop\")\n\n#else\n\n#define RCTAssertThread(thread, format...) do { } while (0)\n\n#endif\n"
  },
  {
    "path": "React/Base/RCTAssert.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAssert.h\"\n#import \"RCTLog.h\"\n\nNSString *const RCTErrorDomain = @\"RCTErrorDomain\";\nNSString *const RCTJSStackTraceKey = @\"RCTJSStackTraceKey\";\nNSString *const RCTJSRawStackTraceKey = @\"RCTJSRawStackTraceKey\";\nNSString *const RCTFatalExceptionName = @\"RCTFatalException\";\n\nstatic NSString *const RCTAssertFunctionStack = @\"RCTAssertFunctionStack\";\n\nRCTAssertFunction RCTCurrentAssertFunction = nil;\nRCTFatalHandler RCTCurrentFatalHandler = nil;\n\nNSException *_RCTNotImplementedException(SEL, Class);\nNSException *_RCTNotImplementedException(SEL cmd, Class cls)\n{\n  NSString *msg = [NSString stringWithFormat:@\"%s is not implemented \"\n                   \"for the class %@\", sel_getName(cmd), cls];\n  return [NSException exceptionWithName:@\"RCTNotDesignatedInitializerException\"\n                                 reason:msg userInfo:nil];\n}\n\nvoid RCTSetAssertFunction(RCTAssertFunction assertFunction)\n{\n  RCTCurrentAssertFunction = assertFunction;\n}\n\nRCTAssertFunction RCTGetAssertFunction(void)\n{\n  return RCTCurrentAssertFunction;\n}\n\nvoid RCTAddAssertFunction(RCTAssertFunction assertFunction)\n{\n  RCTAssertFunction existing = RCTCurrentAssertFunction;\n  if (existing) {\n    RCTCurrentAssertFunction = ^(NSString *condition,\n                                 NSString *fileName,\n                                 NSNumber *lineNumber,\n                                 NSString *function,\n                                 NSString *message) {\n\n      existing(condition, fileName, lineNumber, function, message);\n      assertFunction(condition, fileName, lineNumber, function, message);\n    };\n  } else {\n    RCTCurrentAssertFunction = assertFunction;\n  }\n}\n\n/**\n * returns the topmost stacked assert function for the current thread, which\n * may not be the same as the current value of RCTCurrentAssertFunction.\n */\nstatic RCTAssertFunction RCTGetLocalAssertFunction()\n{\n  NSMutableDictionary *threadDictionary = [NSThread currentThread].threadDictionary;\n  NSArray<RCTAssertFunction> *functionStack = threadDictionary[RCTAssertFunctionStack];\n  RCTAssertFunction assertFunction = functionStack.lastObject;\n  if (assertFunction) {\n    return assertFunction;\n  }\n  return RCTCurrentAssertFunction;\n}\n\nvoid RCTPerformBlockWithAssertFunction(void (^block)(void), RCTAssertFunction assertFunction)\n{\n  NSMutableDictionary *threadDictionary = [NSThread currentThread].threadDictionary;\n  NSMutableArray<RCTAssertFunction> *functionStack = threadDictionary[RCTAssertFunctionStack];\n  if (!functionStack) {\n    functionStack = [NSMutableArray new];\n    threadDictionary[RCTAssertFunctionStack] = functionStack;\n  }\n  [functionStack addObject:assertFunction];\n  block();\n  [functionStack removeLastObject];\n}\n\nNSString *RCTCurrentThreadName(void)\n{\n  NSThread *thread = [NSThread currentThread];\n  NSString *threadName = RCTIsMainQueue() || thread.isMainThread ? @\"main\" : thread.name;\n  if (threadName.length == 0) {\n    const char *label = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL);\n    if (label && strlen(label) > 0) {\n      threadName = @(label);\n    } else {\n      threadName = [NSString stringWithFormat:@\"%p\", thread];\n    }\n  }\n  return threadName;\n}\n\nvoid _RCTAssertFormat(\n  const char *condition,\n  const char *fileName,\n  int lineNumber,\n  const char *function,\n  NSString *format, ...)\n{\n  RCTAssertFunction assertFunction = RCTGetLocalAssertFunction();\n  if (assertFunction) {\n    va_list args;\n    va_start(args, format);\n    NSString *message = [[NSString alloc] initWithFormat:format arguments:args];\n    va_end(args);\n\n    assertFunction(@(condition), @(fileName), @(lineNumber), @(function), message);\n  }\n}\n\nvoid RCTFatal(NSError *error)\n{\n  _RCTLogNativeInternal(RCTLogLevelFatal, NULL, 0, @\"%@\", error.localizedDescription);\n\n  RCTFatalHandler fatalHandler = RCTGetFatalHandler();\n  if (fatalHandler) {\n    fatalHandler(error);\n  } else {\n#if DEBUG\n    @try {\n#endif\n      NSString *name = [NSString stringWithFormat:@\"%@: %@\", RCTFatalExceptionName, error.localizedDescription];\n      NSString *message = RCTFormatError(error.localizedDescription, error.userInfo[RCTJSStackTraceKey], 75);\n      @throw [[NSException alloc]  initWithName:name reason:message userInfo:nil];\n#if DEBUG\n    } @catch (NSException *e) {}\n#endif\n  }\n}\n\nvoid RCTSetFatalHandler(RCTFatalHandler fatalhandler)\n{\n  RCTCurrentFatalHandler = fatalhandler;\n}\n\nRCTFatalHandler RCTGetFatalHandler(void)\n{\n  return RCTCurrentFatalHandler;\n}\n\nNSString *RCTFormatError(NSString *message, NSArray<NSDictionary<NSString *, id> *> *stackTrace, NSUInteger maxMessageLength)\n{\n  if (maxMessageLength > 0 && message.length > maxMessageLength) {\n    message = [[message substringToIndex:maxMessageLength] stringByAppendingString:@\"...\"];\n  }\n\n  NSMutableString *prettyStack = [NSMutableString string];\n  if (stackTrace) {\n    [prettyStack appendString:@\", stack:\\n\"];\n\n    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@\"^(\\\\d+\\\\.js)$\"\n                                                                           options:NSRegularExpressionCaseInsensitive\n                                                                             error:NULL];\n    for (NSDictionary<NSString *, id> *frame in stackTrace) {\n      NSString *fileName = [frame[@\"file\"] lastPathComponent];\n      if (fileName && [regex numberOfMatchesInString:fileName options:0 range:NSMakeRange(0, [fileName length])]) {\n        fileName = [fileName stringByAppendingString:@\":\"];\n      } else {\n        fileName = @\"\";\n      }\n\n      [prettyStack appendFormat:@\"%@@%@%@:%@\\n\", frame[@\"methodName\"], fileName, frame[@\"lineNumber\"], frame[@\"column\"]];\n    }\n  }\n\n  return [NSString stringWithFormat:@\"%@%@\", message, prettyStack];\n}\n"
  },
  {
    "path": "React/Base/RCTBatchedBridge.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import \"RCTAssert.h\"\n\n#import \"RCTBridge+Private.h\"\n#import \"RCTBridge.h\"\n#import \"RCTBridgeMethod.h\"\n#import \"RCTConvert.h\"\n#import \"RCTDisplayLink.h\"\n#import \"RCTJSCExecutor.h\"\n#import \"RCTJavaScriptLoader.h\"\n#import \"RCTLog.h\"\n#import \"RCTModuleData.h\"\n#import \"RCTPerformanceLogger.h\"\n#import \"RCTUtils.h\"\n\n#import <React/RCTDevSettings.h>\n#import <React/RCTProfile.h>\n#import <React/RCTRedBox.h>\n\n#if RCT_DEV && __has_include(\"RCTDevLoadingView.h\")\n#import \"RCTDevLoadingView.h\"\n#endif\n\n#define RCTAssertJSThread() \\\n  RCTAssert(![NSStringFromClass([self->_javaScriptExecutor class]) isEqualToString:@\"RCTJSCExecutor\"] || \\\n              [[[NSThread currentThread] name] isEqualToString:RCTJSCThreadName], \\\n            @\"This method must be called on JS thread\")\n\n/**\n * Must be kept in sync with `MessageQueue.js`.\n */\ntypedef NS_ENUM(NSUInteger, RCTBridgeFields) {\n  RCTBridgeFieldRequestModuleIDs = 0,\n  RCTBridgeFieldMethodIDs,\n  RCTBridgeFieldParams,\n  RCTBridgeFieldCallID,\n};\n\n@implementation RCTBatchedBridge\n{\n  std::atomic_bool _wasBatchActive;\n  NSMutableArray<dispatch_block_t> *_pendingCalls;\n  NSDictionary<NSString *, RCTModuleData *> *_moduleDataByName;\n  NSArray<RCTModuleData *> *_moduleDataByID;\n  NSArray<Class> *_moduleClassesByID;\n  NSUInteger _modulesInitializedOnMainQueue;\n  RCTDisplayLink *_displayLink;\n}\n\n@synthesize flowID = _flowID;\n@synthesize flowIDMap = _flowIDMap;\n@synthesize flowIDMapLock = _flowIDMapLock;\n@synthesize loading = _loading;\n@synthesize valid = _valid;\n@synthesize performanceLogger = _performanceLogger;\n@synthesize bridgeDescription = _bridgeDescription;\n\n- (instancetype)initWithParentBridge:(RCTBridge *)bridge\n{\n  RCTAssertParam(bridge);\n\n  if (self = [super initWithDelegate:bridge.delegate\n                           bundleURL:bridge.bundleURL\n                      moduleProvider:bridge.moduleProvider\n                       launchOptions:bridge.launchOptions]) {\n    _parentBridge = bridge;\n    _performanceLogger = [bridge performanceLogger];\n\n    RCTLogInfo(@\"Initializing %@ (parent: %@, executor: %@)\", self, bridge, [self executorClass]);\n\n    /**\n     * Set Initial State\n     */\n    _valid = YES;\n    _loading = YES;\n    _pendingCalls = [NSMutableArray new];\n    _displayLink = [RCTDisplayLink new];\n\n    [RCTBridge setCurrentBridge:self];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithDelegate:(__unused id<RCTBridgeDelegate>)delegate\n                                           bundleURL:(__unused NSURL *)bundleURL\n                                      moduleProvider:(__unused RCTBridgeModuleListProvider)block\n                                       launchOptions:(__unused NSDictionary *)launchOptions)\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleURL\n                                       moduleProvider:(__unused RCTBridgeModuleListProvider)block\n                                        launchOptions:(__unused NSDictionary *)launchOptions)\n\n- (void)start\n{\n  [[NSNotificationCenter defaultCenter]\n    postNotificationName:RCTJavaScriptWillStartLoadingNotification\n    object:_parentBridge userInfo:@{@\"bridge\": self}];\n\n  RCT_PROFILE_BEGIN_EVENT(0, @\"-[RCTBatchedBridge setUp]\", nil);\n\n  dispatch_queue_t bridgeQueue = dispatch_queue_create(\"com.facebook.react.RCTBridgeQueue\", DISPATCH_QUEUE_CONCURRENT);\n\n  dispatch_group_t initModulesAndLoadSource = dispatch_group_create();\n\n  // Asynchronously load source code\n  dispatch_group_enter(initModulesAndLoadSource);\n  __weak RCTBatchedBridge *weakSelf = self;\n  __block NSData *sourceCode;\n  [self loadSource:^(NSError *error, RCTSource *source) {\n    if (error) {\n      RCTLogWarn(@\"Failed to load source: %@\", error);\n      dispatch_async(dispatch_get_main_queue(), ^{\n        [weakSelf stopLoadingWithError:error];\n      });\n    }\n\n    sourceCode = source.data;\n    dispatch_group_leave(initModulesAndLoadSource);\n  } onProgress:^(RCTLoadingProgress *progressData) {\n#if RCT_DEV && __has_include(\"RCTDevLoadingView.h\")\n    RCTDevLoadingView *loadingView = [weakSelf moduleForClass:[RCTDevLoadingView class]];\n    [loadingView updateProgress:progressData];\n#endif\n  }];\n\n  // Synchronously initialize all native modules that cannot be loaded lazily\n  [self initModulesWithDispatchGroup:initModulesAndLoadSource];\n\n  RCTPerformanceLogger *performanceLogger = self->_performanceLogger;\n  __block NSString *config;\n  dispatch_group_enter(initModulesAndLoadSource);\n  dispatch_async(bridgeQueue, ^{\n    dispatch_group_t setupJSExecutorAndModuleConfig = dispatch_group_create();\n\n    // Asynchronously initialize the JS executor\n    dispatch_group_async(setupJSExecutorAndModuleConfig, bridgeQueue, ^{\n      [performanceLogger markStartForTag:RCTPLJSCExecutorSetup];\n      [weakSelf setUpExecutor];\n      [performanceLogger markStopForTag:RCTPLJSCExecutorSetup];\n    });\n\n    // Asynchronously gather the module config\n    dispatch_group_async(setupJSExecutorAndModuleConfig, bridgeQueue, ^{\n      if (weakSelf.valid) {\n        RCT_PROFILE_BEGIN_EVENT(0, @\"-[RCTBatchedBridge moduleConfig\", nil);\n        [performanceLogger markStartForTag:RCTPLNativeModulePrepareConfig];\n        config = [weakSelf moduleConfig];\n        [performanceLogger markStopForTag:RCTPLNativeModulePrepareConfig];\n        RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n      }\n    });\n\n    dispatch_group_notify(setupJSExecutorAndModuleConfig, bridgeQueue, ^{\n      // We're not waiting for this to complete to leave dispatch group, since\n      // injectJSONConfiguration and executeSourceCode will schedule operations\n      // on the same queue anyway.\n      [performanceLogger markStartForTag:RCTPLNativeModuleInjectConfig];\n      [weakSelf injectJSONConfiguration:config onComplete:^(NSError *error) {\n        [performanceLogger markStopForTag:RCTPLNativeModuleInjectConfig];\n        if (error) {\n          RCTLogWarn(@\"Failed to inject config: %@\", error);\n          dispatch_async(dispatch_get_main_queue(), ^{\n            [weakSelf stopLoadingWithError:error];\n          });\n        }\n      }];\n      dispatch_group_leave(initModulesAndLoadSource);\n    });\n  });\n\n  dispatch_group_notify(initModulesAndLoadSource, bridgeQueue, ^{\n    RCTBatchedBridge *strongSelf = weakSelf;\n    if (sourceCode && strongSelf.loading) {\n      [strongSelf executeSourceCode:sourceCode];\n    }\n  });\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n- (void)loadSource:(RCTSourceLoadBlock)_onSourceLoad onProgress:(RCTSourceLoadProgressBlock)onProgress\n{\n  [_performanceLogger markStartForTag:RCTPLScriptDownload];\n\n  RCTPerformanceLogger *performanceLogger = _performanceLogger;\n  RCTSourceLoadBlock onSourceLoad = ^(NSError *error, RCTSource *source) {\n    [performanceLogger markStopForTag:RCTPLScriptDownload];\n    [performanceLogger setValue:source.length forTag:RCTPLBundleSize];\n    _onSourceLoad(error, source);\n  };\n\n  if ([self.delegate respondsToSelector:@selector(loadSourceForBridge:onProgress:onComplete:)]) {\n    [self.delegate loadSourceForBridge:_parentBridge onProgress:onProgress onComplete:onSourceLoad];\n  } else if ([self.delegate respondsToSelector:@selector(loadSourceForBridge:withBlock:)]) {\n    [self.delegate loadSourceForBridge:_parentBridge withBlock:onSourceLoad];\n  } else if (!self.bundleURL) {\n    NSError *error = RCTErrorWithMessage(@\"No bundle URL present.\\n\\nMake sure you're running a packager \" \\\n                                         \"server or have included a .jsbundle file in your application bundle.\");\n    onSourceLoad(error, nil);\n  } else {\n    [RCTJavaScriptLoader loadBundleAtURL:self.bundleURL onProgress:onProgress onComplete:^(NSError *error, RCTSource *source) {\n      if (error) {\n        RCTLogError(@\"Failed to load bundle(%@) with error:(%@ %@)\", self.bundleURL, error.localizedDescription, error.localizedFailureReason);\n      }\n      onSourceLoad(error, source);\n    }];\n  }\n}\n\n- (NSArray<Class> *)moduleClasses\n{\n  if (RCT_DEBUG && _valid && _moduleClassesByID == nil) {\n    RCTLogError(@\"Bridge modules have not yet been initialized. You may be \"\n                \"trying to access a module too early in the startup procedure.\");\n  }\n  return _moduleClassesByID;\n}\n\n/**\n * Used by RCTUIManager\n */\n- (RCTModuleData *)moduleDataForName:(NSString *)moduleName\n{\n  return _moduleDataByName[moduleName];\n}\n\n- (id)moduleForName:(NSString *)moduleName\n{\n  return _moduleDataByName[moduleName].instance;\n}\n\n- (BOOL)moduleIsInitialized:(Class)moduleClass\n{\n  return _moduleDataByName[RCTBridgeModuleNameForClass(moduleClass)].hasInstance;\n}\n\n- (NSArray *)configForModuleName:(NSString *)moduleName\n{\n  return _moduleDataByName[moduleName].config;\n}\n\n- (void)initModulesWithDispatchGroup:(dispatch_group_t)dispatchGroup\n{\n  RCT_PROFILE_BEGIN_EVENT(0, @\"-[RCTBatchedBridge initModules]\", nil);\n  [_performanceLogger markStartForTag:RCTPLNativeModuleInit];\n\n  NSArray<id<RCTBridgeModule>> *extraModules = nil;\n  if (self.delegate) {\n    if ([self.delegate respondsToSelector:@selector(extraModulesForBridge:)]) {\n      extraModules = [self.delegate extraModulesForBridge:_parentBridge];\n    }\n  } else if (self.moduleProvider) {\n    extraModules = self.moduleProvider();\n  }\n\n#if RCT_DEBUG\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    RCTVerifyAllModulesExported(extraModules);\n  });\n#endif\n\n  NSMutableArray<Class> *moduleClassesByID = [NSMutableArray new];\n  NSMutableArray<RCTModuleData *> *moduleDataByID = [NSMutableArray new];\n  NSMutableDictionary<NSString *, RCTModuleData *> *moduleDataByName = [NSMutableDictionary new];\n\n  // Set up moduleData for pre-initialized module instances\n  RCT_PROFILE_BEGIN_EVENT(0, @\"extraModules\", nil);\n  for (id<RCTBridgeModule> module in extraModules) {\n    Class moduleClass = [module class];\n    NSString *moduleName = RCTBridgeModuleNameForClass(moduleClass);\n\n    if (RCT_DEBUG) {\n      // Check for name collisions between preregistered modules\n      RCTModuleData *moduleData = moduleDataByName[moduleName];\n      if (moduleData) {\n        RCTLogError(@\"Attempted to register RCTBridgeModule class %@ for the \"\n                    \"name '%@', but name was already registered by class %@\",\n                    moduleClass, moduleName, moduleData.moduleClass);\n        continue;\n      }\n    }\n\n    // Instantiate moduleData container\n    RCTModuleData *moduleData = [[RCTModuleData alloc] initWithModuleInstance:module\n                                                                       bridge:self];\n    moduleDataByName[moduleName] = moduleData;\n    [moduleClassesByID addObject:moduleClass];\n    [moduleDataByID addObject:moduleData];\n\n    // Set executor instance\n    if (moduleClass == self.executorClass) {\n      _javaScriptExecutor = (id<RCTJavaScriptExecutor>)module;\n    }\n  }\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n  // The executor is a bridge module, but we want it to be instantiated before\n  // any other module has access to the bridge, in case they need the JS thread.\n  // TODO: once we have more fine-grained control of init (t11106126) we can\n  // probably just replace this with [self moduleForClass:self.executorClass]\n  RCT_PROFILE_BEGIN_EVENT(0, @\"JavaScriptExecutor\", nil);\n  if (!_javaScriptExecutor) {\n    id<RCTJavaScriptExecutor> executorModule = [self.executorClass new];\n    RCTModuleData *moduleData = [[RCTModuleData alloc] initWithModuleInstance:executorModule\n                                                                       bridge:self];\n    moduleDataByName[moduleData.name] = moduleData;\n    [moduleClassesByID addObject:self.executorClass];\n    [moduleDataByID addObject:moduleData];\n\n    // NOTE: _javaScriptExecutor is a weak reference\n    _javaScriptExecutor = executorModule;\n  }\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n  // Set up moduleData for automatically-exported modules\n  RCT_PROFILE_BEGIN_EVENT(0, @\"ModuleData\", nil);\n  for (Class moduleClass in RCTGetModuleClasses()) {\n    NSString *moduleName = RCTBridgeModuleNameForClass(moduleClass);\n\n    // Check for module name collisions\n    RCTModuleData *moduleData = moduleDataByName[moduleName];\n    if (moduleData) {\n      if (moduleData.hasInstance) {\n        // Existing module was preregistered, so it takes precedence\n        continue;\n      } else if ([moduleClass new] == nil) {\n        // The new module returned nil from init, so use the old module\n        continue;\n      } else if ([moduleData.moduleClass new] != nil) {\n        // Both modules were non-nil, so it's unclear which should take precedence\n        RCTLogError(@\"Attempted to register RCTBridgeModule class %@ for the \"\n                    \"name '%@', but name was already registered by class %@\",\n                    moduleClass, moduleName, moduleData.moduleClass);\n      }\n    }\n\n    // Instantiate moduleData (TODO: can we defer this until config generation?)\n    moduleData = [[RCTModuleData alloc] initWithModuleClass:moduleClass\n                                                     bridge:self];\n    moduleDataByName[moduleName] = moduleData;\n    [moduleClassesByID addObject:moduleClass];\n    [moduleDataByID addObject:moduleData];\n  }\n\n  // Store modules\n  _moduleDataByID = [moduleDataByID copy];\n  _moduleDataByName = [moduleDataByName copy];\n  _moduleClassesByID = [moduleClassesByID copy];\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n  // Synchronously set up the pre-initialized modules\n  RCT_PROFILE_BEGIN_EVENT(0, @\"extraModules\", nil);\n  for (RCTModuleData *moduleData in _moduleDataByID) {\n    if (moduleData.hasInstance &&\n        (!moduleData.requiresMainQueueSetup || RCTIsMainQueue())) {\n      // Modules that were pre-initialized should ideally be set up before\n      // bridge init has finished, otherwise the caller may try to access the\n      // module directly rather than via `[bridge moduleForClass:]`, which won't\n      // trigger the lazy initialization process. If the module cannot safely be\n      // set up on the current thread, it will instead be async dispatched\n      // to the main thread to be set up in the loop below.\n      (void)[moduleData instance];\n    }\n  }\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n  // From this point on, RCTDidInitializeModuleNotification notifications will\n  // be sent the first time a module is accessed.\n  _moduleSetupComplete = YES;\n\n  [self prepareModulesWithDispatchGroup:dispatchGroup];\n\n  [_performanceLogger markStopForTag:RCTPLNativeModuleInit];\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n- (void)prepareModulesWithDispatchGroup:(dispatch_group_t)dispatchGroup\n{\n  RCT_PROFILE_BEGIN_EVENT(0, @\"-[RCTBatchedBridge prepareModulesWithDispatch]\", nil);\n\n  BOOL initializeImmediately = NO;\n  if (dispatchGroup == NULL) {\n    // If no dispatchGroup is passed in, we must prepare everything immediately.\n    // We better be on the right thread too.\n    RCTAssertMainQueue();\n    initializeImmediately = YES;\n  }\n\n  // Set up modules that require main thread init or constants export\n  for (RCTModuleData *moduleData in _moduleDataByID) {\n    if (moduleData.requiresMainQueueSetup || moduleData.hasConstantsToExport) {\n      // Modules that need to be set up on the main thread cannot be initialized\n      // lazily when required without doing a dispatch_sync to the main thread,\n      // which can result in deadlock. To avoid this, we initialize all of these\n      // modules on the main thread in parallel with loading the JS code, so\n      // they will already be available before they are ever required.\n      dispatch_block_t block = ^{\n        if (self.valid) {\n          [self->_performanceLogger appendStartForTag:RCTPLNativeModuleMainThread];\n          (void)[moduleData instance];\n          [moduleData gatherConstants];\n          [self->_performanceLogger appendStopForTag:RCTPLNativeModuleMainThread];\n        }\n      };\n\n      if (initializeImmediately && RCTIsMainQueue()) {\n        block();\n      } else {\n        // We've already checked that dispatchGroup is non-null, but this satisifies the\n        // Xcode analyzer\n        if (dispatchGroup) {\n          dispatch_group_async(dispatchGroup, dispatch_get_main_queue(), block);\n        }\n      }\n      _modulesInitializedOnMainQueue++;\n    }\n  }\n\n  [_performanceLogger setValue:_modulesInitializedOnMainQueue forTag:RCTPLNativeModuleMainThreadUsesCount];\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n- (void)setUpExecutor\n{\n  [_javaScriptExecutor setUp];\n}\n\n- (void)registerModuleForFrameUpdates:(id<RCTBridgeModule>)module\n                       withModuleData:(RCTModuleData *)moduleData\n{\n  [_displayLink registerModuleForFrameUpdates:module withModuleData:moduleData];\n}\n\n- (NSString *)moduleConfig\n{\n  NSMutableArray<NSArray *> *config = [NSMutableArray new];\n  for (RCTModuleData *moduleData in _moduleDataByID) {\n    if (self.executorClass == [RCTJSCExecutor class]) {\n      [config addObject:@[moduleData.name]];\n    } else {\n      [config addObject:RCTNullIfNil(moduleData.config)];\n    }\n  }\n\n  return RCTJSONStringify(@{\n    @\"remoteModuleConfig\": config,\n  }, NULL);\n}\n\n- (void)injectJSONConfiguration:(NSString *)configJSON\n                     onComplete:(void (^)(NSError *))onComplete\n{\n  if (!_valid) {\n    return;\n  }\n\n  [_javaScriptExecutor injectJSONText:configJSON\n                  asGlobalObjectNamed:@\"__fbBatchedBridgeConfig\"\n                             callback:onComplete];\n}\n\n- (void)executeSourceCode:(NSData *)sourceCode\n{\n  if (!_valid || !_javaScriptExecutor) {\n    return;\n  }\n\n  [self enqueueApplicationScript:sourceCode url:self.bundleURL onComplete:^(NSError *loadError) {\n    if (!self->_valid) {\n      return;\n    }\n\n    if (loadError) {\n      RCTLogWarn(@\"Failed to execute source code: %@ %@\", [loadError localizedDescription], [loadError localizedFailureReason]);\n      dispatch_async(dispatch_get_main_queue(), ^{\n        [self stopLoadingWithError:loadError];\n      });\n      return;\n    }\n\n    // Register the display link to start sending js calls after everything is setup\n    NSRunLoop *targetRunLoop = [self->_javaScriptExecutor isKindOfClass:[RCTJSCExecutor class]] ? [NSRunLoop currentRunLoop] : [NSRunLoop mainRunLoop];\n    [self->_displayLink addToRunLoop:targetRunLoop];\n\n    // Log metrics about native requires during the bridge startup.\n    uint64_t nativeRequiresCount = [self->_performanceLogger valueForTag:RCTPLRAMNativeRequiresCount];\n    [self->_performanceLogger setValue:nativeRequiresCount forTag:RCTPLRAMStartupNativeRequiresCount];\n    uint64_t nativeRequires = [self->_performanceLogger valueForTag:RCTPLRAMNativeRequires];\n    [self->_performanceLogger setValue:nativeRequires forTag:RCTPLRAMStartupNativeRequires];\n\n    [self->_performanceLogger markStopForTag:RCTPLBridgeStartup];\n\n    // Perform the notification on the main thread, so we can't run into\n    // timing issues with RCTRootView\n    dispatch_async(dispatch_get_main_queue(), ^{\n      [[NSNotificationCenter defaultCenter]\n       postNotificationName:RCTJavaScriptDidLoadNotification\n       object:self->_parentBridge userInfo:@{@\"bridge\": self}];\n\n#if RCT_DEV\n      RCTLogWarn(@\"RCTBatchedBridge is deprecated and will be removed in a future React Native release. \"\n        \"See https://fb.me/react-cxx-bridge for upgrade instructions.\");\n#endif\n    });\n\n    [self _flushPendingCalls];\n  }];\n\n#if RCT_DEV\n  if (_parentBridge.devSettings.isHotLoadingEnabled) {\n    NSString *path = [self.bundleURL.path substringFromIndex:1]; // strip initial slash\n    NSString *host = self.bundleURL.host;\n    NSNumber *port = self.bundleURL.port;\n    [self enqueueJSCall:@\"HMRClient\"\n                 method:@\"enable\"\n                   args:@[@\"macos\", path, host, RCTNullIfNil(port)]\n             completion:NULL];\n  }\n#endif\n}\n\n- (void)_flushPendingCalls\n{\n  RCTAssertJSThread();\n\n  RCT_PROFILE_BEGIN_EVENT(0, @\"Processing pendingCalls\", @{ @\"count\": @(_pendingCalls.count) });\n  _loading = NO;\n  NSArray *pendingCalls = _pendingCalls;\n  _pendingCalls = nil;\n  for (dispatch_block_t call in pendingCalls) {\n    call();\n  }\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n- (void)stopLoadingWithError:(NSError *)error\n{\n  RCTAssertMainQueue();\n\n  if (!_valid || !_loading) {\n    return;\n  }\n\n  _loading = NO;\n  [_javaScriptExecutor invalidate];\n\n  [[NSNotificationCenter defaultCenter]\n   postNotificationName:RCTJavaScriptDidFailToLoadNotification\n   object:_parentBridge userInfo:@{@\"bridge\": self, @\"error\": error}];\n\n  if ([error userInfo][RCTJSStackTraceKey]) {\n    [self.redBox showErrorMessage:[error localizedDescription]\n                        withStack:[error userInfo][RCTJSStackTraceKey]];\n  }\n  RCTFatal(error);\n}\n\n/**\n * Prevent super from calling setUp (that'd create another batchedBridge)\n */\n- (void)setUp {}\n\n- (void)reload\n{\n  [_parentBridge reload];\n}\n\n- (void)requestReload\n{\n  [_parentBridge requestReload];\n}\n\n- (Class)executorClass\n{\n  return _parentBridge.executorClass ?: [RCTJSCExecutor class];\n}\n\n- (void)setExecutorClass:(Class)executorClass\n{\n  RCTAssertMainQueue();\n\n  _parentBridge.executorClass = executorClass;\n}\n\n- (NSURL *)bundleURL\n{\n  return _parentBridge.bundleURL;\n}\n\n- (void)setBundleURL:(NSURL *)bundleURL\n{\n  _parentBridge.bundleURL = bundleURL;\n}\n\n- (id<RCTBridgeDelegate>)delegate\n{\n  return _parentBridge.delegate;\n}\n\n- (BOOL)isLoading\n{\n  return _loading;\n}\n\n- (BOOL)isValid\n{\n  return _valid;\n}\n\n- (void)dispatchBlock:(dispatch_block_t)block\n                queue:(dispatch_queue_t)queue\n{\n  if (queue == RCTJSThread) {\n    RCTProfileBeginFlowEvent();\n    RCTAssert(_javaScriptExecutor != nil, @\"Need JS executor to schedule JS work\");\n\n    [_javaScriptExecutor executeBlockOnJavaScriptQueue:^{\n      RCTProfileEndFlowEvent();\n\n      RCT_PROFILE_BEGIN_EVENT(0, @\"-[RCTBatchedBridge dispatchBlock\", @{ @\"loading\": @(self.loading) });\n\n      if (self.loading) {\n        RCTAssert(self->_pendingCalls != nil, @\"Can't add pending call, bridge is no longer loading\");\n        [self->_pendingCalls addObject:block];\n      } else {\n        block();\n      }\n\n      RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n    }];\n  } else if (queue) {\n    dispatch_async(queue, block);\n  }\n}\n\n#pragma mark - RCTInvalidating\n\n- (void)invalidate\n{\n  if (!_valid) {\n    return;\n  }\n\n  RCTAssertMainQueue();\n  RCTAssert(_javaScriptExecutor != nil, @\"Can't complete invalidation without a JS executor\");\n\n  _loading = NO;\n  _valid = NO;\n  if ([RCTBridge currentBridge] == self) {\n    [RCTBridge setCurrentBridge:nil];\n  }\n\n  // Invalidate modules\n  dispatch_group_t group = dispatch_group_create();\n  for (RCTModuleData *moduleData in _moduleDataByID) {\n    // Be careful when grabbing an instance here, we don't want to instantiate\n    // any modules just to invalidate them.\n    id<RCTBridgeModule> instance = nil;\n    if ([moduleData hasInstance]) {\n      instance = moduleData.instance;\n    }\n\n    if (instance == _javaScriptExecutor) {\n      continue;\n    }\n\n    if ([instance respondsToSelector:@selector(invalidate)]) {\n      dispatch_group_enter(group);\n      [self dispatchBlock:^{\n        [(id<RCTInvalidating>)instance invalidate];\n        dispatch_group_leave(group);\n      } queue:moduleData.methodQueue];\n    }\n    [moduleData invalidate];\n  }\n\n  dispatch_group_notify(group, dispatch_get_main_queue(), ^{\n    [self->_javaScriptExecutor executeBlockOnJavaScriptQueue:^{\n      [self->_displayLink invalidate];\n      self->_displayLink = nil;\n\n      [self->_javaScriptExecutor invalidate];\n      self->_javaScriptExecutor = nil;\n\n      if (RCTProfileIsProfiling()) {\n        RCTProfileUnhookModules(self);\n      }\n\n      self->_moduleDataByName = nil;\n      self->_moduleDataByID = nil;\n      self->_moduleClassesByID = nil;\n      self->_pendingCalls = nil;\n\n      if (self->_flowIDMap != NULL) {\n        CFRelease(self->_flowIDMap);\n      }\n    }];\n  });\n}\n\n- (void)logMessage:(NSString *)message level:(NSString *)level\n{\n  if (RCT_DEBUG && [_javaScriptExecutor isValid]) {\n    [self enqueueJSCall:@\"RCTLog\"\n                 method:@\"logIfNoNativeHook\"\n                   args:@[level, message]\n             completion:NULL];\n  }\n}\n\n#pragma mark - RCTBridge methods\n\n/**\n * Public. Can be invoked from any thread.\n */\n- (void)enqueueJSCall:(NSString *)module method:(NSString *)method args:(NSArray *)args completion:(dispatch_block_t)completion\n{\n  /**\n   * AnyThread\n   */\n  if (!_valid) {\n    return;\n  }\n\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"-[RCTBatchedBridge enqueueJSCall:]\", nil);\n  __weak __typeof(self) weakSelf = self;\n  [self dispatchBlock:^{\n    [weakSelf _actuallyInvokeAndProcessModule:module method:method arguments:args ?: @[]];\n    if (completion) {\n      completion();\n    }\n  } queue:RCTJSThread];\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n/**\n * Called by RCTModuleMethod from any thread.\n */\n- (void)enqueueCallback:(NSNumber *)cbID args:(NSArray *)args\n{\n  /**\n   * AnyThread\n   */\n  if (!_valid) {\n    return;\n  }\n\n  __weak __typeof(self) weakSelf = self;\n  [self dispatchBlock:^{\n    [weakSelf _actuallyInvokeCallback:cbID arguments:args];\n  } queue:RCTJSThread];\n}\n\n/**\n * JS thread only\n */\n- (JSValue *)callFunctionOnModule:(NSString *)module\n                           method:(NSString *)method\n                        arguments:(NSArray *)arguments\n                            error:(NSError __autoreleasing **)error\n{\n  RCTJSCExecutor *jsExecutor = (RCTJSCExecutor *)_javaScriptExecutor;\n  if (![jsExecutor isKindOfClass:[RCTJSCExecutor class]]) {\n    RCTLogWarn(@\"FBReactBridgeJSExecutor is only supported when running in JSC\");\n    return nil;\n  }\n\n  __block JSValue *jsResult = nil;\n\n  RCTAssertJSThread();\n  RCT_PROFILE_BEGIN_EVENT(0, @\"callFunctionOnModule\", (@{ @\"module\": module, @\"method\": method }));\n  [jsExecutor callFunctionOnModule:module\n                            method:method\n                         arguments:arguments ?: @[]\n                   jsValueCallback:^(JSValue *result, NSError *jsError) {\n    if (error) {\n      *error = jsError;\n    }\n\n    JSValue *length = result[@\"length\"];\n    RCTAssert([length isNumber] && [length toUInt32] == 2,\n              @\"Return value of a callFunction must be an array of size 2\");\n\n    jsResult = [result valueAtIndex:0];\n\n    NSArray *nativeModuleCalls = [[result valueAtIndex:1] toArray];\n    [self handleBuffer:nativeModuleCalls batchEnded:YES];\n  }];\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"js_call\");\n\n  return jsResult;\n}\n\n\n/**\n * Private hack to support `setTimeout(fn, 0)`\n */\n- (void)_immediatelyCallTimer:(NSNumber *)timer\n{\n  RCTAssertJSThread();\n  [_javaScriptExecutor executeAsyncBlockOnJavaScriptQueue:^{\n    [self _actuallyInvokeAndProcessModule:@\"JSTimers\"\n                                   method:@\"callTimers\"\n                                arguments:@[@[timer]]];\n  }];\n}\n\n- (void)enqueueApplicationScript:(NSData *)script\n                             url:(NSURL *)url\n                      onComplete:(RCTJavaScriptCompleteBlock)onComplete\n{\n  RCTAssert(onComplete != nil, @\"onComplete block passed in should be non-nil\");\n\n  RCTProfileBeginFlowEvent();\n  [_javaScriptExecutor executeApplicationScript:script sourceURL:url onComplete:^(NSError *scriptLoadError) {\n    RCTProfileEndFlowEvent();\n    RCTAssertJSThread();\n\n    if (scriptLoadError) {\n      onComplete(scriptLoadError);\n      return;\n    }\n\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"FetchApplicationScriptCallbacks\", nil);\n    [self->_javaScriptExecutor flushedQueue:^(id json, NSError *error)\n     {\n       RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"js_call,init\");\n       [self handleBuffer:json batchEnded:YES];\n       onComplete(error);\n     }];\n  }];\n}\n\n#pragma mark - Payload Generation\n\n- (void)_actuallyInvokeAndProcessModule:(NSString *)module\n                                 method:(NSString *)method\n                              arguments:(NSArray *)args\n{\n  RCTAssertJSThread();\n\n  __weak __typeof(self) weakSelf = self;\n  [_javaScriptExecutor callFunctionOnModule:module\n                                     method:method\n                                  arguments:args\n                                   callback:^(id json, NSError *error) {\n                                     [weakSelf _processResponse:json error:error];\n                                   }];\n}\n\n- (void)_actuallyInvokeCallback:(NSNumber *)cbID\n                      arguments:(NSArray *)args\n{\n  RCTAssertJSThread();\n\n  __weak __typeof(self) weakSelf = self;\n  [_javaScriptExecutor invokeCallbackID:cbID\n                              arguments:args\n                               callback:^(id json, NSError *error) {\n                                 [weakSelf _processResponse:json error:error];\n                               }];\n}\n\n- (void)_processResponse:(id)json error:(NSError *)error\n{\n  if (error) {\n    if ([error userInfo][RCTJSStackTraceKey]) {\n      [self.redBox showErrorMessage:[error localizedDescription]\n                          withStack:[error userInfo][RCTJSStackTraceKey]];\n    }\n    RCTFatal(error);\n  }\n\n  if (!_valid) {\n    return;\n  }\n  [self handleBuffer:json batchEnded:YES];\n}\n\n#pragma mark - Payload Processing\n\n- (void)handleBuffer:(id)buffer batchEnded:(BOOL)batchEnded\n{\n  RCTAssertJSThread();\n\n  if (!self.valid) {\n    return;\n  }\n\n  if (buffer != nil && buffer != (id)kCFNull) {\n    _wasBatchActive = YES;\n    [self handleBuffer:buffer];\n    [self partialBatchDidFlush];\n  }\n\n  if (batchEnded) {\n    if (_wasBatchActive) {\n      [self batchDidComplete];\n    }\n\n    _wasBatchActive = NO;\n  }\n}\n\n- (void)handleBuffer:(NSArray *)buffer\n{\n  NSArray *requestsArray = [RCTConvert NSArray:buffer];\n\n  if (RCT_DEBUG && requestsArray.count <= RCTBridgeFieldParams) {\n    RCTLogError(@\"Buffer should contain at least %tu sub-arrays. Only found %tu\",\n                RCTBridgeFieldParams + 1, requestsArray.count);\n    return;\n  }\n\n  NSArray<NSNumber *> *moduleIDs = [RCTConvert NSNumberArray:requestsArray[RCTBridgeFieldRequestModuleIDs]];\n  NSArray<NSNumber *> *methodIDs = [RCTConvert NSNumberArray:requestsArray[RCTBridgeFieldMethodIDs]];\n  NSArray<NSArray *> *paramsArrays = [RCTConvert NSArrayArray:requestsArray[RCTBridgeFieldParams]];\n\n  int64_t callID = -1;\n\n  if (requestsArray.count > 3) {\n    callID = [requestsArray[RCTBridgeFieldCallID] longLongValue];\n  }\n\n  if (RCT_DEBUG && (moduleIDs.count != methodIDs.count || moduleIDs.count != paramsArrays.count)) {\n    RCTLogError(@\"Invalid data message - all must be length: %zd\", moduleIDs.count);\n    return;\n  }\n\n  NSMapTable *buckets = [[NSMapTable alloc] initWithKeyOptions:NSPointerFunctionsStrongMemory\n                                                  valueOptions:NSPointerFunctionsStrongMemory\n                                                      capacity:_moduleDataByName.count];\n\n  [moduleIDs enumerateObjectsUsingBlock:^(NSNumber *moduleID, NSUInteger i, __unused BOOL *stop) {\n    RCTModuleData *moduleData = self->_moduleDataByID[moduleID.integerValue];\n    dispatch_queue_t queue = moduleData.methodQueue;\n    NSMutableOrderedSet<NSNumber *> *set = [buckets objectForKey:queue];\n    if (!set) {\n      set = [NSMutableOrderedSet new];\n      [buckets setObject:set forKey:queue];\n    }\n    [set addObject:@(i)];\n  }];\n\n  for (dispatch_queue_t queue in buckets) {\n    RCTProfileBeginFlowEvent();\n\n    dispatch_block_t block = ^{\n      RCTProfileEndFlowEvent();\n\n      NSOrderedSet *calls = [buckets objectForKey:queue];\n      RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"-[RCTBatchedBridge handleBuffer:]\", (@{\n        @\"calls\": @(calls.count),\n      }));\n\n      @autoreleasepool {\n        for (NSNumber *indexObj in calls) {\n          NSUInteger index = indexObj.unsignedIntegerValue;\n#if RCT_PROFILE\n          if (RCT_DEV && callID != -1 && self->_flowIDMap != NULL && RCTProfileIsProfiling()) {\n            [self.flowIDMapLock lock];\n            NSUInteger newFlowID = (NSUInteger)CFDictionaryGetValue(self->_flowIDMap, (const void *)(self->_flowID + index));\n            _RCTProfileEndFlowEvent(newFlowID);\n            CFDictionaryRemoveValue(self->_flowIDMap, (const void *)(self->_flowID + index));\n            [self.flowIDMapLock unlock];\n          }\n#endif\n          [self callNativeModule:[moduleIDs[index] integerValue]\n                          method:[methodIDs[index] integerValue]\n                          params:paramsArrays[index]];\n        }\n      }\n\n      RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"objc_call,dispatch_async\");\n    };\n\n    [self dispatchBlock:block queue:queue];\n  }\n\n  _flowID = callID;\n}\n\n- (void)partialBatchDidFlush\n{\n  for (RCTModuleData *moduleData in _moduleDataByID) {\n    if (moduleData.hasInstance && moduleData.implementsPartialBatchDidFlush) {\n      [self dispatchBlock:^{\n        [moduleData.instance partialBatchDidFlush];\n      } queue:moduleData.methodQueue];\n    }\n  }\n}\n\n- (void)batchDidComplete\n{\n  // TODO: batchDidComplete is only used by RCTUIManager - can we eliminate this special case?\n  for (RCTModuleData *moduleData in _moduleDataByID) {\n    if (moduleData.hasInstance && moduleData.implementsBatchDidComplete) {\n      [self dispatchBlock:^{\n        [moduleData.instance batchDidComplete];\n      } queue:moduleData.methodQueue];\n    }\n  }\n}\n\n- (id)callNativeModule:(NSUInteger)moduleID\n                method:(NSUInteger)methodID\n                params:(NSArray *)params\n{\n  if (!_valid) {\n    return nil;\n  }\n\n  RCTModuleData *moduleData = _moduleDataByID[moduleID];\n  if (RCT_DEBUG && !moduleData) {\n    RCTLogError(@\"No module found for id '%zd'\", moduleID);\n    return nil;\n  }\n\n  id<RCTBridgeMethod> method = moduleData.methods[methodID];\n  if (RCT_DEBUG && !method) {\n    RCTLogError(@\"Unknown methodID: %zd for module: %zd (%@)\", methodID, moduleID, moduleData.name);\n    return nil;\n  }\n\n  @try {\n    return [method invokeWithBridge:self module:moduleData.instance arguments:params];\n  }\n  @catch (NSException *exception) {\n    // Pass on JS exceptions\n    if ([exception.name hasPrefix:RCTFatalExceptionName]) {\n      @throw exception;\n    }\n\n    NSString *message = [NSString stringWithFormat:\n                         @\"Exception '%@' was thrown while invoking %s on target %@ with params %@\",\n                         exception, method.JSMethodName, moduleData.name, params];\n    RCTFatal(RCTErrorWithMessage(message));\n    return nil;\n  }\n}\n\n- (void)startProfiling\n{\n  RCTAssertMainQueue();\n\n  [_javaScriptExecutor executeBlockOnJavaScriptQueue:^{\n    RCTProfileInit(self);\n  }];\n}\n\n- (void)stopProfiling:(void (^)(NSData *))callback\n{\n  RCTAssertMainQueue();\n\n  [_javaScriptExecutor executeBlockOnJavaScriptQueue:^{\n    RCTProfileEnd(self, ^(NSString *log) {\n      NSData *logData = [log dataUsingEncoding:NSUTF8StringEncoding];\n      callback(logData);\n    });\n  }];\n}\n\n- (BOOL)isBatchActive\n{\n  return _wasBatchActive;\n}\n\n#pragma mark - JavaScriptCore\n\n- (JSGlobalContextRef)jsContextRef\n{\n  return [self.jsContext JSGlobalContextRef];\n}\n\n- (JSContext *)jsContext\n{\n  if ([_javaScriptExecutor isKindOfClass:[RCTJSCExecutor class]]) {\n    return [(RCTJSCExecutor *)_javaScriptExecutor jsContext];\n  } else {\n    return nil;\n  }\n}\n\n#pragma mark - Inspector\n\n- (BOOL)isInspectable {\n  return NO;\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTBridge+Private.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <JavaScriptCore/JavaScriptCore.h>\n#import <JavaScriptCore/JSBase.h>\n\n#import <React/RCTBridge.h>\n\n@class RCTModuleData;\n@protocol RCTJavaScriptExecutor;\n\nRCT_EXTERN NSArray<Class> *RCTGetModuleClasses(void);\n\nRCT_EXTERN __attribute__((weak)) void RCTFBQuickPerformanceLoggerConfigureHooks(JSGlobalContextRef ctx);\n\n#if RCT_DEBUG\nRCT_EXTERN void RCTVerifyAllModulesExported(NSArray *extraModules);\n#endif\n\n@interface RCTBridge ()\n\n// Private designated initializer\n- (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate\n                       bundleURL:(NSURL *)bundleURL\n                  moduleProvider:(RCTBridgeModuleListProvider)block\n                   launchOptions:(NSDictionary *)launchOptions NS_DESIGNATED_INITIALIZER;\n\n// Used for the profiler flow events between JS and native\n@property (nonatomic, assign) int64_t flowID;\n@property (nonatomic, assign) CFMutableDictionaryRef flowIDMap;\n@property (nonatomic, strong) NSLock *flowIDMapLock;\n\n// Used by RCTDevMenu\n@property (nonatomic, copy) NSString *bridgeDescription;\n\n+ (instancetype)currentBridge;\n+ (void)setCurrentBridge:(RCTBridge *)bridge;\n\n/**\n * Bridge setup code - creates an instance of RCTBachedBridge. Exposed for\n * test only\n */\n- (void)setUp;\n\n/**\n * This method is used to invoke a callback that was registered in the\n * JavaScript application context. Safe to call from any thread.\n */\n- (void)enqueueCallback:(NSNumber *)cbID args:(NSArray *)args;\n\n/**\n * This property is mostly used on the main thread, but may be touched from\n * a background thread if the RCTBridge happens to deallocate on a background\n * thread. Therefore, we want all writes to it to be seen atomically.\n */\n@property (atomic, strong) RCTBridge *batchedBridge;\n\n/**\n * The block that creates the modules' instances to be added to the bridge.\n * Exposed for the RCTBatchedBridge\n */\n@property (nonatomic, copy, readonly) RCTBridgeModuleListProvider moduleProvider;\n\n/**\n * Used by RCTDevMenu to override the `hot` param of the current bundleURL.\n */\n@property (nonatomic, strong, readwrite) NSURL *bundleURL;\n\n@end\n\n@interface RCTBridge (RCTBatchedBridge)\n\n/**\n * Access the underlying JavaScript executor. You can use this in unit tests to detect\n * when the executor has been invalidated, or when you want to schedule calls on the\n * JS VM outside of React Native. Use with care!\n */\n@property (nonatomic, weak, readonly) id<RCTJavaScriptExecutor> javaScriptExecutor;\n\n/**\n * Used by RCTModuleData\n */\n\n@property (nonatomic, weak, readonly) RCTBridge *parentBridge;\n\n/**\n * Used by RCTModuleData\n */\n@property (nonatomic, assign, readonly) BOOL moduleSetupComplete;\n\n/**\n * Called on the child bridge to run the executor and start loading.\n */\n- (void)start;\n\n/**\n * Used by RCTModuleData to register the module for frame updates after it is\n * lazily initialized.\n */\n- (void)registerModuleForFrameUpdates:(id<RCTBridgeModule>)module\n                       withModuleData:(RCTModuleData *)moduleData;\n\n/**\n * Dispatch work to a module's queue - this is also suports the fake RCTJSThread\n * queue. Exposed for the RCTProfiler\n */\n- (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue;\n\n/**\n * Get the module data for a given module name. Used by UIManager to implement\n * the `dispatchViewManagerCommand` method.\n */\n- (RCTModuleData *)moduleDataForName:(NSString *)moduleName;\n\n/**\n* Registers additional classes with the ModuleRegistry.\n*/\n- (void)registerAdditionalModuleClasses:(NSArray<Class> *)newModules;\n\n/**\n * Systrace profiler toggling methods exposed for the RCTDevMenu\n */\n- (void)startProfiling;\n- (void)stopProfiling:(void (^)(NSData *))callback;\n\n/**\n * Exposed for the RCTJSCExecutor for sending native methods called from\n * JavaScript in the middle of a batch.\n */\n- (void)handleBuffer:(NSArray<NSArray *> *)buffer batchEnded:(BOOL)hasEnded;\n\n/**\n * Synchronously call a specific native module's method and return the result\n */\n- (id)callNativeModule:(NSUInteger)moduleID\n                method:(NSUInteger)methodID\n                params:(NSArray *)params;\n\n/**\n * Exposed for the RCTJSCExecutor for lazily loading native modules\n */\n- (NSArray *)configForModuleName:(NSString *)moduleName;\n\n/**\n * Hook exposed for RCTLog to send logs to JavaScript when not running in JSC\n */\n- (void)logMessage:(NSString *)message level:(NSString *)level;\n\n/**\n * Allow super fast, one time, timers to skip the queue and be directly executed\n */\n- (void)_immediatelyCallTimer:(NSNumber *)timer;\n\n@end\n\n@interface RCTBridge (JavaScriptCore)\n\n/**\n * The raw JSGlobalContextRef used by the bridge.\n */\n@property (nonatomic, readonly, assign) JSGlobalContextRef jsContextRef;\n\n@end\n\n@interface RCTBridge (Inspector)\n\n@property (nonatomic, readonly, getter=isInspectable) BOOL inspectable;\n\n@end\n\n@interface RCTBatchedBridge : RCTBridge <RCTInvalidating>\n\n@property (nonatomic, weak, readonly) RCTBridge *parentBridge;\n@property (nonatomic, weak, readonly) id<RCTJavaScriptExecutor> javaScriptExecutor;\n@property (nonatomic, assign, readonly) BOOL moduleSetupComplete;\n\n- (instancetype)initWithParentBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;\n- (void)start;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTBridge.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n//#import <UIKit/UIKit.h>\n\n#import <React/RCTBridgeDelegate.h>\n#import <React/RCTBridgeModule.h>\n#import <React/RCTDefines.h>\n#import <React/RCTFrameUpdate.h>\n#import <React/RCTInvalidating.h>\n\n@class JSValue;\n@class RCTBridge;\n@class RCTEventDispatcher;\n@class RCTPerformanceLogger;\n\n/**\n * This notification fires when the bridge starts loading the JS bundle.\n */\nRCT_EXTERN NSString *const RCTJavaScriptWillStartLoadingNotification;\n\n/**\n * This notification fires when the bridge has finished loading the JS bundle.\n */\nRCT_EXTERN NSString *const RCTJavaScriptDidLoadNotification;\n\n/**\n * This notification fires when the bridge failed to load the JS bundle. The\n * `error` key can be used to determine the error that occured.\n */\nRCT_EXTERN NSString *const RCTJavaScriptDidFailToLoadNotification;\n\n/**\n * This notification fires each time a native module is instantiated. The\n * `module` key will contain a reference to the newly-created module instance.\n * Note that this notification may be fired before the module is available via\n * the `[bridge moduleForClass:]` method.\n */\nRCT_EXTERN NSString *const RCTDidInitializeModuleNotification;\n\n/**\n * This notification fires just before the bridge starts processing a request to\n * reload.\n */\nRCT_EXTERN NSString *const RCTBridgeWillReloadNotification;\n\n/**\n * This notification fires just before the bridge begins downloading a script\n * from the packager.\n */\nRCT_EXTERN NSString *const RCTBridgeWillDownloadScriptNotification;\n\n/**\n * This notification fires just after the bridge finishes downloading a script\n * from the packager.\n */\nRCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotification;\n\n/**\n * Key for the RCTSource object in the RCTBridgeDidDownloadScriptNotification\n * userInfo dictionary.\n */\nRCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotificationSourceKey;\n\n/**\n * This block can be used to instantiate modules that require additional\n * init parameters, or additional configuration prior to being used.\n * The bridge will call this block to instatiate the modules, and will\n * be responsible for invalidating/releasing them when the bridge is destroyed.\n * For this reason, the block should always return new module instances, and\n * module instances should not be shared between bridges.\n */\ntypedef NSArray<id<RCTBridgeModule>> *(^RCTBridgeModuleListProvider)(void);\n\n/**\n * This function returns the module name for a given class.\n */\nRCT_EXTERN NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass);\n\n/**\n * Async batched bridge used to communicate with the JavaScript application.\n */\n@interface RCTBridge : NSObject <RCTInvalidating>\n\n/**\n * Creates a new bridge with a custom RCTBridgeDelegate.\n *\n * All the interaction with the JavaScript context should be done using the bridge\n * instance of the RCTBridgeModules. Modules will be automatically instantiated\n * using the default contructor, but you can optionally pass in an array of\n * pre-initialized module instances if they require additional init parameters\n * or configuration.\n */\n- (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate\n                   launchOptions:(NSDictionary *)launchOptions;\n\n/**\n * DEPRECATED: Use initWithDelegate:launchOptions: instead\n *\n * The designated initializer. This creates a new bridge on top of the specified\n * executor. The bridge should then be used for all subsequent communication\n * with the JavaScript code running in the executor. Modules will be automatically\n * instantiated using the default contructor, but you can optionally pass in an\n * array of pre-initialized module instances if they require additional init\n * parameters or configuration.\n */\n- (instancetype)initWithBundleURL:(NSURL *)bundleURL\n                   moduleProvider:(RCTBridgeModuleListProvider)block\n                    launchOptions:(NSDictionary *)launchOptions;\n\n/**\n * This method is used to call functions in the JavaScript application context.\n * It is primarily intended for use by modules that require two-way communication\n * with the JavaScript code. Safe to call from any thread.\n */\n- (void)enqueueJSCall:(NSString *)moduleDotMethod args:(NSArray *)args;\n- (void)enqueueJSCall:(NSString *)module method:(NSString *)method args:(NSArray *)args completion:(dispatch_block_t)completion;\n\n/**\n * This method is used to call functions in the JavaScript application context\n * synchronously.  This is intended for use by applications which do their own\n * thread management and are careful to manage multi-threaded access to the JSVM.\n * See also -[RCTBridgeDelgate shouldBridgeLoadJavaScriptSynchronously], which\n * may be needed to ensure that any requires JS code is loaded before this method\n * is called.  If the underlying executor is not JSC, this will return nil.  Safe\n * to call from any thread.\n *\n * @experimental\n */\n- (JSValue *)callFunctionOnModule:(NSString *)module\n                           method:(NSString *)method\n                        arguments:(NSArray *)arguments\n                            error:(NSError **)error;\n\n/**\n * This method registers the file path of an additional JS segment by its ID.\n *\n * @experimental\n */\n- (void)registerSegmentWithId:(NSUInteger)segmentId path:(NSString *)path;\n\n/**\n * Retrieve a bridge module instance by name or class. Note that modules are\n * lazily instantiated, so calling these methods for the first time with a given\n * module name/class may cause the class to be sychronously instantiated,\n * potentially blocking both the calling thread and main thread for a short time.\n */\n- (id)moduleForName:(NSString *)moduleName;\n- (id)moduleForClass:(Class)moduleClass;\n\n/**\n * Convenience method for retrieving all modules conforming to a given protocol.\n * Modules will be sychronously instantiated if they haven't already been,\n * potentially blocking both the calling thread and main thread for a short time.\n */\n- (NSArray *)modulesConformingToProtocol:(Protocol *)protocol;\n\n/**\n * Test if a module has been initialized. Use this prior to calling\n * `moduleForClass:` or `moduleForName:` if you do not want to cause the module\n * to be instantiated if it hasn't been already.\n */\n- (BOOL)moduleIsInitialized:(Class)moduleClass;\n\n/**\n * All registered bridge module classes.\n */\n@property (nonatomic, copy, readonly) NSArray<Class> *moduleClasses;\n\n/**\n * URL of the script that was loaded into the bridge.\n */\n@property (nonatomic, strong, readonly) NSURL *bundleURL;\n\n/**\n * The class of the executor currently being used. Changes to this value will\n * take effect after the bridge is reloaded.\n */\n@property (nonatomic, strong) Class executorClass;\n\n/**\n * The delegate provided during the bridge initialization\n */\n@property (nonatomic, weak, readonly) id<RCTBridgeDelegate> delegate;\n\n/**\n * The launch options that were used to initialize the bridge.\n */\n@property (nonatomic, copy, readonly) NSDictionary *launchOptions;\n\n/**\n * Use this to check if the bridge is currently loading.\n */\n@property (nonatomic, readonly, getter=isLoading) BOOL loading;\n\n/**\n * Use this to check if the bridge has been invalidated.\n */\n@property (nonatomic, readonly, getter=isValid) BOOL valid;\n\n/**\n * Link to the Performance Logger that logs React Native perf events.\n */\n@property (nonatomic, readonly, strong) RCTPerformanceLogger *performanceLogger;\n\n/**\n * Reload the bundle and reset executor & modules. Safe to call from any thread.\n */\n- (void)reload;\n\n/**\n * Inform the bridge, and anything subscribing to it, that it should reload.\n */\n- (void)requestReload __deprecated_msg(\"Call reload instead\");\n\n/**\n * Says whether bridge has started recieving calls from javascript.\n */\n- (BOOL)isBatchActive;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTBridge.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTBridge.h\"\n#import \"RCTBridge+Private.h\"\n\n#import <objc/runtime.h>\n\n#import \"RCTConvert.h\"\n#import \"RCTEventDispatcher.h\"\n#if RCT_ENABLE_INSPECTOR\n#import \"RCTInspectorDevServerHelper.h\"\n#endif\n#import \"RCTLog.h\"\n#import \"RCTModuleData.h\"\n#import \"RCTPerformanceLogger.h\"\n#import \"RCTProfile.h\"\n#import \"RCTReloadCommand.h\"\n#import \"RCTUtils.h\"\n\nNSString *const RCTJavaScriptWillStartLoadingNotification = @\"RCTJavaScriptWillStartLoadingNotification\";\nNSString *const RCTJavaScriptDidLoadNotification = @\"RCTJavaScriptDidLoadNotification\";\nNSString *const RCTJavaScriptDidFailToLoadNotification = @\"RCTJavaScriptDidFailToLoadNotification\";\nNSString *const RCTDidInitializeModuleNotification = @\"RCTDidInitializeModuleNotification\";\nNSString *const RCTBridgeWillReloadNotification = @\"RCTBridgeWillReloadNotification\";\nNSString *const RCTBridgeWillDownloadScriptNotification = @\"RCTBridgeWillDownloadScriptNotification\";\nNSString *const RCTBridgeDidDownloadScriptNotification = @\"RCTBridgeDidDownloadScriptNotification\";\nNSString *const RCTBridgeDidDownloadScriptNotificationSourceKey = @\"source\";\n\nstatic NSMutableArray<Class> *RCTModuleClasses;\nNSArray<Class> *RCTGetModuleClasses(void)\n{\n  return RCTModuleClasses;\n}\n\nvoid RCTFBQuickPerformanceLoggerConfigureHooks(__unused JSGlobalContextRef ctx) { }\n\n/**\n * Register the given class as a bridge module. All modules must be registered\n * prior to the first bridge initialization.\n */\nvoid RCTRegisterModule(Class);\nvoid RCTRegisterModule(Class moduleClass)\n{\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    RCTModuleClasses = [NSMutableArray new];\n  });\n\n  RCTAssert([moduleClass conformsToProtocol:@protocol(RCTBridgeModule)],\n            @\"%@ does not conform to the RCTBridgeModule protocol\",\n            moduleClass);\n\n  // Register module\n  [RCTModuleClasses addObject:moduleClass];\n}\n\n/**\n * This function returns the module name for a given class.\n */\nNSString *RCTBridgeModuleNameForClass(Class cls)\n{\n#if RCT_DEBUG\n  RCTAssert([cls conformsToProtocol:@protocol(RCTBridgeModule)],\n            @\"Bridge module `%@` does not conform to RCTBridgeModule\", cls);\n#endif\n\n  NSString *name = [cls moduleName];\n  if (name.length == 0) {\n    name = NSStringFromClass(cls);\n  }\n\n  if ([name hasPrefix:@\"RK\"]) {\n    name = [name substringFromIndex:2];\n  } else if ([name hasPrefix:@\"RCT\"]) {\n    name = [name substringFromIndex:3];\n  }\n\n  return name;\n}\n\n#if RCT_DEBUG\nvoid RCTVerifyAllModulesExported(NSArray *extraModules)\n{\n  // Check for unexported modules\n  unsigned int classCount;\n  Class *classes = objc_copyClassList(&classCount);\n\n  NSMutableSet *moduleClasses = [NSMutableSet new];\n  [moduleClasses addObjectsFromArray:RCTGetModuleClasses()];\n  [moduleClasses addObjectsFromArray:[extraModules valueForKeyPath:@\"class\"]];\n\n  for (unsigned int i = 0; i < classCount; i++) {\n    Class cls = classes[i];\n    Class superclass = cls;\n    while (superclass) {\n      if (class_conformsToProtocol(superclass, @protocol(RCTBridgeModule))) {\n        if ([moduleClasses containsObject:cls]) {\n          break;\n        }\n\n        // Verify it's not a super-class of one of our moduleClasses\n        BOOL isModuleSuperClass = NO;\n        for (Class moduleClass in moduleClasses) {\n          if ([moduleClass isSubclassOfClass:cls]) {\n            isModuleSuperClass = YES;\n            break;\n          }\n        }\n        if (isModuleSuperClass) {\n          break;\n        }\n\n        RCTLogWarn(@\"Class %@ was not exported. Did you forget to use RCT_EXPORT_MODULE()?\", cls);\n        break;\n      }\n      superclass = class_getSuperclass(superclass);\n    }\n  }\n\n  free(classes);\n}\n#endif\n\n@interface RCTBridge () <RCTReloadListener>\n@end\n\n@implementation RCTBridge\n{\n  NSURL *_delegateBundleURL;\n}\n\ndispatch_queue_t RCTJSThread;\n\n+ (void)initialize\n{\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n\n    // Set up JS thread\n    RCTJSThread = (id)kCFNull;\n  });\n}\n\nstatic RCTBridge *RCTCurrentBridgeInstance = nil;\n\n/**\n * The last current active bridge instance. This is set automatically whenever\n * the bridge is accessed. It can be useful for static functions or singletons\n * that need to access the bridge for purposes such as logging, but should not\n * be relied upon to return any particular instance, due to race conditions.\n */\n+ (instancetype)currentBridge\n{\n  return RCTCurrentBridgeInstance;\n}\n\n+ (void)setCurrentBridge:(RCTBridge *)currentBridge\n{\n  RCTCurrentBridgeInstance = currentBridge;\n}\n\n- (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate\n                   launchOptions:(NSDictionary *)launchOptions\n{\n  return [self initWithDelegate:delegate\n                      bundleURL:nil\n                 moduleProvider:nil\n                  launchOptions:launchOptions];\n}\n\n- (instancetype)initWithBundleURL:(NSURL *)bundleURL\n                   moduleProvider:(RCTBridgeModuleListProvider)block\n                    launchOptions:(NSDictionary *)launchOptions\n{\n  return [self initWithDelegate:nil\n                      bundleURL:bundleURL\n                 moduleProvider:block\n                  launchOptions:launchOptions];\n}\n\n- (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate\n                       bundleURL:(NSURL *)bundleURL\n                  moduleProvider:(RCTBridgeModuleListProvider)block\n                   launchOptions:(NSDictionary *)launchOptions\n{\n  if (self = [super init]) {\n    _delegate = delegate;\n    _bundleURL = bundleURL;\n    _moduleProvider = block;\n    _launchOptions = [launchOptions copy];\n\n    [self setUp];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (void)dealloc\n{\n  /**\n   * This runs only on the main thread, but crashes the subclass\n   * RCTAssertMainQueue();\n   */\n  [self invalidate];\n}\n\n- (void)didReceiveReloadCommand\n{\n  [self reload];\n}\n\n- (NSArray<Class> *)moduleClasses\n{\n  return self.batchedBridge.moduleClasses;\n}\n\n- (id)moduleForName:(NSString *)moduleName\n{\n  return [self.batchedBridge moduleForName:moduleName];\n}\n\n- (id)moduleForClass:(Class)moduleClass\n{\n  return [self moduleForName:RCTBridgeModuleNameForClass(moduleClass)];\n}\n\n- (NSArray *)modulesConformingToProtocol:(Protocol *)protocol\n{\n  NSMutableArray *modules = [NSMutableArray new];\n  for (Class moduleClass in self.moduleClasses) {\n    if ([moduleClass conformsToProtocol:protocol]) {\n      id module = [self moduleForClass:moduleClass];\n      if (module) {\n        [modules addObject:module];\n      }\n    }\n  }\n  return [modules copy];\n}\n\n- (BOOL)moduleIsInitialized:(Class)moduleClass\n{\n  return [self.batchedBridge moduleIsInitialized:moduleClass];\n}\n\n- (void)reload\n{\n  #if RCT_ENABLE_INSPECTOR\n  // Disable debugger to resume the JsVM & avoid thread locks while reloading\n  [RCTInspectorDevServerHelper disableDebugger];\n  #endif\n\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTBridgeWillReloadNotification object:self];\n\n  /**\n   * Any thread\n   */\n  dispatch_async(dispatch_get_main_queue(), ^{\n    [self invalidate];\n    [self setUp];\n  });\n}\n\n- (void)requestReload\n{\n  [self reload];\n}\n\n- (Class)bridgeClass\n{\n  // In order to facilitate switching between bridges with only build\n  // file changes, this uses reflection to check which bridges are\n  // available.  This is a short-term hack until RCTBatchedBridge is\n  // removed.\n\n  Class batchedBridgeClass = objc_lookUpClass(\"RCTBatchedBridge\");\n  Class cxxBridgeClass = objc_lookUpClass(\"RCTCxxBridge\");\n\n  Class implClass = nil;\n\n  if ([self.delegate respondsToSelector:@selector(shouldBridgeUseCxxBridge:)]) {\n    if ([self.delegate shouldBridgeUseCxxBridge:self]) {\n      implClass = cxxBridgeClass;\n    } else {\n      implClass = batchedBridgeClass;\n    }\n  } else if (cxxBridgeClass != nil) {\n    implClass = cxxBridgeClass;\n  } else if (batchedBridgeClass != nil) {\n    implClass = batchedBridgeClass;\n  }\n\n  RCTAssert(implClass != nil, @\"No bridge implementation is available, giving up.\");\n  return implClass;\n}\n\n- (void)setUp\n{\n  RCT_PROFILE_BEGIN_EVENT(0, @\"-[RCTBridge setUp]\", nil);\n\n  _performanceLogger = [RCTPerformanceLogger new];\n  [_performanceLogger markStartForTag:RCTPLBridgeStartup];\n  [_performanceLogger markStartForTag:RCTPLTTI];\n\n  Class bridgeClass = self.bridgeClass;\n\n  #if RCT_DEV\n  RCTExecuteOnMainQueue(^{\n    RCTRegisterReloadCommandListener(self);\n  });\n  #endif\n\n  // Only update bundleURL from delegate if delegate bundleURL has changed\n  NSURL *previousDelegateURL = _delegateBundleURL;\n  _delegateBundleURL = [self.delegate sourceURLForBridge:self];\n  if (_delegateBundleURL && ![_delegateBundleURL isEqual:previousDelegateURL]) {\n    _bundleURL = _delegateBundleURL;\n  }\n\n  // Sanitize the bundle URL\n  _bundleURL = [RCTConvert NSURL:_bundleURL.absoluteString];\n\n  self.batchedBridge = [[bridgeClass alloc] initWithParentBridge:self];\n  [self.batchedBridge start];\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n- (BOOL)isLoading\n{\n  return self.batchedBridge.loading;\n}\n\n- (BOOL)isValid\n{\n  return self.batchedBridge.valid;\n}\n\n- (BOOL)isBatchActive\n{\n  return [_batchedBridge isBatchActive];\n}\n\n- (void)invalidate\n{\n  RCTBridge *batchedBridge = self.batchedBridge;\n  self.batchedBridge = nil;\n\n  if (batchedBridge) {\n    RCTExecuteOnMainQueue(^{\n      [batchedBridge invalidate];\n    });\n  }\n}\n\n- (void)registerAdditionalModuleClasses:(NSArray<Class> *)modules\n{\n  [self.batchedBridge registerAdditionalModuleClasses:modules];\n}\n\n- (void)enqueueJSCall:(NSString *)moduleDotMethod args:(NSArray *)args\n{\n  NSArray<NSString *> *ids = [moduleDotMethod componentsSeparatedByString:@\".\"];\n  NSString *module = ids[0];\n  NSString *method = ids[1];\n  [self enqueueJSCall:module method:method args:args completion:NULL];\n}\n\n- (void)enqueueJSCall:(NSString *)module method:(NSString *)method args:(NSArray *)args completion:(dispatch_block_t)completion\n{\n  [self.batchedBridge enqueueJSCall:module method:method args:args completion:completion];\n}\n\n- (void)enqueueCallback:(NSNumber *)cbID args:(NSArray *)args\n{\n  [self.batchedBridge enqueueCallback:cbID args:args];\n}\n\n- (JSValue *)callFunctionOnModule:(NSString *)module\n                           method:(NSString *)method\n                        arguments:(NSArray *)arguments\n                            error:(NSError **)error\n{\n  return [self.batchedBridge callFunctionOnModule:module method:method arguments:arguments error:error];\n}\n\n- (void)registerSegmentWithId:(NSUInteger)segmentId path:(NSString *)path\n{\n  [self.batchedBridge registerSegmentWithId:segmentId path:path];\n}\n\n- (JSGlobalContextRef)jsContextRef\n{\n  return [self.batchedBridge jsContextRef];\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTBridgeDelegate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTJavaScriptLoader.h>\n\n@class RCTBridge;\n@protocol RCTBridgeModule;\n\n@protocol RCTBridgeDelegate <NSObject>\n\n/**\n * The location of the JavaScript source file. When running from the packager\n * this should be an absolute URL, e.g. `http://localhost:8081/index.ios.bundle`.\n * When running from a locally bundled JS file, this should be a `file://` url\n * pointing to a path inside the app resources, e.g. `file://.../main.jsbundle`.\n */\n- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge;\n\n@optional\n\n/**\n * The bridge initializes any registered RCTBridgeModules automatically, however\n * if you wish to instantiate your own module instances, you can return them\n * from this method.\n *\n * Note: You should always return a new instance for each call, rather than\n * returning the same instance each time the bridge is reloaded. Module instances\n * should not be shared between bridges, and this may cause unexpected behavior.\n *\n * It is also possible to override standard modules with your own implementations\n * by returning a class with the same `moduleName` from this method, but this is\n * not recommended in most cases - if the module methods and behavior do not\n * match exactly, it may lead to bugs or crashes.\n */\n- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge;\n\n/**\n * Configure whether the JSCExecutor created should use the system JSC API or\n * alternative hooks provided. When returning YES from this method, you must have\n * previously called facebook::react::setCustomJSCWrapper.\n *\n * @experimental\n */\n- (BOOL)shouldBridgeUseCustomJSC:(RCTBridge *)bridge;\n\n/**\n * Configure whether the legacy RCTBatchedBridge or new RCTCxxBridge\n * should be used.  If this method is implemented and the specified\n * bridge is not linked in, startup will fail.  If this method is not\n * implemented, the implementation will default to RCTBatchedBridge,\n * but if it is not linked in, will try RCTCxxBridge instead.  If\n * neither bridge is linked in, startup will fail.  This order will be\n * reversed in the near future, as the legacy bridge is closer to\n * being removed.\n *\n * @experimental\n */\n- (BOOL)shouldBridgeUseCxxBridge:(RCTBridge *)bridge;\n\n/**\n* The bridge will call this method when a module been called from JS\n* cannot be found among registered modules.\n* It should return YES if the module with name 'moduleName' was registered\n* in the implementation, and the system must attempt to look for it again among registered.\n* If the module was not registered, return NO to prevent further searches.\n*/\n- (BOOL)bridge:(RCTBridge *)bridge didNotFindModule:(NSString *)moduleName;\n\n/**\n * The bridge will automatically attempt to load the JS source code from the\n * location specified by the `sourceURLForBridge:` method, however, if you want\n * to handle loading the JS yourself, you can do so by implementing this method.\n */\n- (void)loadSourceForBridge:(RCTBridge *)bridge\n                 onProgress:(RCTSourceLoadProgressBlock)onProgress\n                 onComplete:(RCTSourceLoadBlock)loadCallback;\n\n/**\n * Similar to loadSourceForBridge:onProgress:onComplete: but without progress\n * reporting.\n */\n- (void)loadSourceForBridge:(RCTBridge *)bridge\n                  withBlock:(RCTSourceLoadBlock)loadCallback;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTBridgeMethod.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n@class RCTBridge;\n\ntypedef NS_ENUM(NSUInteger, RCTFunctionType) {\n  RCTFunctionTypeNormal,\n  RCTFunctionTypePromise,\n  RCTFunctionTypeSync,\n};\n\nstatic inline const char *RCTFunctionDescriptorFromType(RCTFunctionType type) {\n  switch (type) {\n    case RCTFunctionTypeNormal:\n      return \"async\";\n    case RCTFunctionTypePromise:\n      return \"promise\";\n    case RCTFunctionTypeSync:\n      return \"sync\";\n  }\n};\n\n@protocol RCTBridgeMethod <NSObject>\n\n@property (nonatomic, readonly) const char *JSMethodName;\n@property (nonatomic, readonly) RCTFunctionType functionType;\n\n- (id)invokeWithBridge:(RCTBridge *)bridge\n                module:(id)module\n             arguments:(NSArray *)arguments;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTBridgeModule.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTDefines.h>\n\n@class RCTBridge;\n@protocol RCTBridgeMethod;\n\n/**\n * The type of a block that is capable of sending a response to a bridged\n * operation. Use this for returning callback methods to JS.\n */\ntypedef void (^RCTResponseSenderBlock)(NSArray *response);\n\n/**\n * The type of a block that is capable of sending an error response to a\n * bridged operation. Use this for returning error information to JS.\n */\ntypedef void (^RCTResponseErrorBlock)(NSError *error);\n\n/**\n * Block that bridge modules use to resolve the JS promise waiting for a result.\n * Nil results are supported and are converted to JS's undefined value.\n */\ntypedef void (^RCTPromiseResolveBlock)(id result);\n\n/**\n * Block that bridge modules use to reject the JS promise waiting for a result.\n * The error may be nil but it is preferable to pass an NSError object for more\n * precise error messages.\n */\ntypedef void (^RCTPromiseRejectBlock)(NSString *code, NSString *message, NSError *error);\n\n/**\n * This constant can be returned from +methodQueue to force module\n * methods to be called on the JavaScript thread. This can have serious\n * implications for performance, so only use this if you're sure it's what\n * you need.\n *\n * NOTE: RCTJSThread is not a real libdispatch queue\n */\nRCT_EXTERN dispatch_queue_t RCTJSThread;\n\nRCT_EXTERN_C_BEGIN\n\ntypedef struct RCTMethodInfo {\n  const char *const jsName;\n  const char *const objcName;\n  const BOOL isSync;\n} RCTMethodInfo;\n\nRCT_EXTERN_C_END\n\n/**\n * Provides the interface needed to register a bridge module.\n */\n@protocol RCTBridgeModule <NSObject>\n\n/**\n * Place this macro in your class implementation to automatically register\n * your module with the bridge when it loads. The optional js_name argument\n * will be used as the JS module name. If omitted, the JS module name will\n * match the Objective-C class name.\n */\n#define RCT_EXPORT_MODULE(js_name) \\\nRCT_EXTERN void RCTRegisterModule(Class); \\\n+ (NSString *)moduleName { return @#js_name; } \\\n+ (void)load { RCTRegisterModule(self); }\n\n// Implemented by RCT_EXPORT_MODULE\n+ (NSString *)moduleName;\n\n@optional\n\n/**\n * A reference to the RCTBridge. Useful for modules that require access\n * to bridge features, such as sending events or making JS calls. This\n * will be set automatically by the bridge when it initializes the module.\n * To implement this in your module, just add `@synthesize bridge = _bridge;`\n */\n@property (nonatomic, weak, readonly) RCTBridge *bridge;\n\n/**\n * The queue that will be used to call all exported methods. If omitted, this\n * will call on a default background queue, which is avoids blocking the main\n * thread.\n *\n * If the methods in your module need to interact with UIKit methods, they will\n * probably need to call those on the main thread, as most of UIKit is main-\n * thread-only. You can tell React Native to call your module methods on the\n * main thread by returning a reference to the main queue, like this:\n *\n * - (dispatch_queue_t)methodQueue\n * {\n *   return dispatch_get_main_queue();\n * }\n *\n * If you don't want to specify the queue yourself, but you need to use it\n * inside your class (e.g. if you have internal methods that need to dispatch\n * onto that queue), you can just add `@synthesize methodQueue = _methodQueue;`\n * and the bridge will populate the methodQueue property for you automatically\n * when it initializes the module.\n */\n@property (nonatomic, strong, readonly) dispatch_queue_t methodQueue;\n\n/**\n * Wrap the parameter line of your method implementation with this macro to\n * expose it to JS. By default the exposed method will match the first part of\n * the Objective-C method selector name (up to the first colon). Use\n * RCT_REMAP_METHOD to specify the JS name of the method.\n *\n * For example, in ModuleName.m:\n *\n * - (void)doSomething:(NSString *)aString withA:(NSInteger)a andB:(NSInteger)b\n * { ... }\n *\n * becomes\n *\n * RCT_EXPORT_METHOD(doSomething:(NSString *)aString\n *                   withA:(NSInteger)a\n *                   andB:(NSInteger)b)\n * { ... }\n *\n * and is exposed to JavaScript as `NativeModules.ModuleName.doSomething`.\n *\n * ## Promises\n *\n * Bridge modules can also define methods that are exported to JavaScript as\n * methods that return a Promise, and are compatible with JS async functions.\n *\n * Declare the last two parameters of your native method to be a resolver block\n * and a rejecter block. The resolver block must precede the rejecter block.\n *\n * For example:\n *\n * RCT_EXPORT_METHOD(doSomethingAsync:(NSString *)aString\n *                           resolver:(RCTPromiseResolveBlock)resolve\n *                           rejecter:(RCTPromiseRejectBlock)reject\n * { ... }\n *\n * Calling `NativeModules.ModuleName.doSomethingAsync(aString)` from\n * JavaScript will return a promise that is resolved or rejected when your\n * native method implementation calls the respective block.\n *\n */\n#define RCT_EXPORT_METHOD(method) \\\n  RCT_REMAP_METHOD(, method)\n\n/**\n * Same as RCT_EXPORT_METHOD but the method is called from JS\n * synchronously **on the JS thread**, possibly returning a result.\n *\n * WARNING: in the vast majority of cases, you should use RCT_EXPORT_METHOD which\n * allows your native module methods to be called asynchronously: calling\n * methods synchronously can have strong performance penalties and introduce\n * threading-related bugs to your native modules.\n *\n * The return type must be of object type (id) and should be serializable\n * to JSON. This means that the hook can only return nil or JSON values\n * (e.g. NSNumber, NSString, NSArray, NSDictionary).\n *\n * Calling these methods when running under the websocket executor\n * is currently not supported.\n */\n#define RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(method) \\\n  RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(id, method)\n\n#define RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(returnType, method) \\\n  RCT_REMAP_BLOCKING_SYNCHRONOUS_METHOD(, returnType, method)\n\n\n/**\n * Similar to RCT_EXPORT_METHOD but lets you set the JS name of the exported\n * method. Example usage:\n *\n * RCT_REMAP_METHOD(executeQueryWithParameters,\n *   executeQuery:(NSString *)query parameters:(NSDictionary *)parameters)\n * { ... }\n */\n#define RCT_REMAP_METHOD(js_name, method) \\\n  _RCT_EXTERN_REMAP_METHOD(js_name, method, NO) \\\n  - (void)method;\n\n/**\n * Similar to RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD but lets you set\n * the JS name of the exported method. Example usage:\n *\n * RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(executeQueryWithParameters,\n *   executeQuery:(NSString *)query parameters:(NSDictionary *)parameters)\n * { ... }\n */\n#define RCT_REMAP_BLOCKING_SYNCHRONOUS_METHOD(js_name, returnType, method) \\\n  _RCT_EXTERN_REMAP_METHOD(js_name, method, YES) \\\n  - (returnType)method;\n\n/**\n * Use this macro in a private Objective-C implementation file to automatically\n * register an external module with the bridge when it loads. This allows you to\n * register Swift or private Objective-C classes with the bridge.\n *\n * For example if one wanted to export a Swift class to the bridge:\n *\n * MyModule.swift:\n *\n *   @objc(MyModule) class MyModule: NSObject {\n *\n *     @objc func doSomething(string: String! withFoo a: Int, bar b: Int) { ... }\n *\n *   }\n *\n * MyModuleExport.m:\n *\n *   #import <React/RCTBridgeModule.h>\n *\n *   @interface RCT_EXTERN_MODULE(MyModule, NSObject)\n *\n *   RCT_EXTERN_METHOD(doSomething:(NSString *)string withFoo:(NSInteger)a bar:(NSInteger)b)\n *\n *   @end\n *\n * This will now expose MyModule and the method to JavaScript via\n * `NativeModules.MyModule.doSomething`\n */\n#define RCT_EXTERN_MODULE(objc_name, objc_supername) \\\n  RCT_EXTERN_REMAP_MODULE(, objc_name, objc_supername)\n\n/**\n * Like RCT_EXTERN_MODULE, but allows setting a custom JavaScript name.\n */\n#define RCT_EXTERN_REMAP_MODULE(js_name, objc_name, objc_supername) \\\n  objc_name : objc_supername \\\n  @end \\\n  @interface objc_name (RCTExternModule) <RCTBridgeModule> \\\n  @end \\\n  @implementation objc_name (RCTExternModule) \\\n  RCT_EXPORT_MODULE(js_name)\n\n/**\n * Use this macro in accordance with RCT_EXTERN_MODULE to export methods\n * of an external module.\n */\n#define RCT_EXTERN_METHOD(method) \\\n  _RCT_EXTERN_REMAP_METHOD(, method, NO)\n\n/**\n * Use this macro in accordance with RCT_EXTERN_MODULE to export methods\n * of an external module that should be invoked synchronously.\n */\n#define RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(method) \\\n  _RCT_EXTERN_REMAP_METHOD(, method, YES)\n\n/**\n * Like RCT_EXTERN_REMAP_METHOD, but allows setting a custom JavaScript name\n * and also whether this method is synchronous.\n */\n#define _RCT_EXTERN_REMAP_METHOD(js_name, method, is_blocking_synchronous_method) \\\n  + (const RCTMethodInfo *)RCT_CONCAT(__rct_export__, RCT_CONCAT(js_name, RCT_CONCAT(__LINE__, __COUNTER__))) { \\\n    static RCTMethodInfo config = {#js_name, #method, is_blocking_synchronous_method}; \\\n    return &config; \\\n  }\n\n/**\n * Most modules can be used from any thread. All of the modules exported non-sync method will be called on its\n * methodQueue, and the module will be constructed lazily when its first invoked. Some modules have main need to access\n * information that's main queue only (e.g. most UIKit classes). Since we don't want to dispatch synchronously to the\n * main thread to this safely, we construct these moduels and export their constants ahead-of-time.\n *\n * Note that when set to false, the module constructor will be called from any thread.\n *\n * This requirement is currently inferred by checking if the module has a custom initializer or if there's exported\n * constants. In the future, we'll stop automatically inferring this and instead only rely on this method.\n */\n+ (BOOL)requiresMainQueueSetup;\n\n/**\n * Injects methods into JS.  Entries in this array are used in addition to any\n * methods defined using the macros above.  This method is called only once,\n * before registration.\n */\n- (NSArray<id<RCTBridgeMethod>> *)methodsToExport;\n\n/**\n * Injects constants into JS. These constants are made accessible via NativeModules.ModuleName.X. It is only called once\n * for the lifetime of the bridge, so it is not suitable for returning dynamic values, but may be used for long-lived\n * values such as session keys, that are regenerated only as part of a reload of the entire React application.\n *\n * If you implement this method and do not implement `requiresMainThreadSetup`, you will trigger deprecated logic\n * that eagerly initializes your module on bridge startup. In the future, this behaviour will be changed to default\n * to initializing lazily, and even modules with constants will be initialized lazily.\n */\n- (NSDictionary *)constantsToExport;\n\n/**\n * Notifies the module that a batch of JS method invocations has just completed.\n */\n- (void)batchDidComplete;\n\n/**\n * Notifies the module that the active batch of JS method invocations has been\n * partially flushed.\n *\n * This occurs before -batchDidComplete, and more frequently.\n */\n- (void)partialBatchDidFlush;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTBundleURLProvider.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\nextern NSString *const RCTBundleURLProviderUpdatedNotification;\n\nextern const NSUInteger kRCTBundleURLProviderDefaultPort;\n\n@interface RCTBundleURLProvider : NSObject\n\n/**\n * Set default settings on NSUserDefaults.\n */\n- (void)setDefaults;\n\n/**\n * Reset every settings to default.\n */\n- (void)resetToDefaults;\n\n/**\n * Returns the jsBundleURL for a given bundle entrypoint and\n * the fallback offline JS bundle if the packager is not running.\n * if resourceName or extension are nil, \"main\" and \"jsbundle\" will be\n * used, respectively.\n */\n- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot\n                   fallbackResource:(NSString *)resourceName\n                  fallbackExtension:(NSString *)extension;\n\n/**\n * Returns the jsBundleURL for a given bundle entrypoint and\n * the fallback offline JS bundle if the packager is not running.\n */\n- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot\n                   fallbackResource:(NSString *)resourceName;\n\n/**\n * Returns the jsBundleURL for a given bundle entrypoint and\n * the fallback offline JS bundle. If resourceName or extension\n * are nil, \"main\" and \"jsbundle\" will be used, respectively.\n */\n- (NSURL *)jsBundleURLForFallbackResource:(NSString *)resourceName\n                        fallbackExtension:(NSString *)extension;\n\n/**\n * Returns the resourceURL for a given bundle entrypoint and\n * the fallback offline resource file if the packager is not running.\n */\n- (NSURL *)resourceURLForResourceRoot:(NSString *)root\n                         resourceName:(NSString *)name\n                    resourceExtension:(NSString *)extension\n                        offlineBundle:(NSBundle *)offlineBundle;\n\n/**\n * The IP address or hostname of the packager.\n */\n@property (nonatomic, copy) NSString *jsLocation;\n\n@property (nonatomic, assign) BOOL enableLiveReload;\n@property (nonatomic, assign) BOOL enableMinification;\n@property (nonatomic, assign) BOOL enableDev;\n\n+ (instancetype)sharedSettings;\n\n/**\n Given a hostname for the packager and a bundle root, returns the URL to the js bundle. Generally you should use the\n instance method -jsBundleURLForBundleRoot:fallbackResource: which includes logic to guess if the packager is running\n and fall back to a pre-packaged bundle if it is not.\n */\n+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot\n                       packagerHost:(NSString *)packagerHost\n                          enableDev:(BOOL)enableDev\n                 enableMinification:(BOOL)enableMinification;\n\n/**\n * Given a hostname for the packager and a resource path (including \"/\"), return the URL to the resource.\n * In general, please use the instance method to decide if the packager is running and fallback to the pre-packaged\n * resource if it is not: -resourceURLForResourceRoot:resourceName:resourceExtension:offlineBundle:\n */\n+ (NSURL *)resourceURLForResourcePath:(NSString *)path\n                         packagerHost:(NSString *)packagerHost\n                                query:(NSString *)query;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTBundleURLProvider.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTBundleURLProvider.h\"\n\n#import \"RCTConvert.h\"\n#import \"RCTDefines.h\"\n\nNSString *const RCTBundleURLProviderUpdatedNotification = @\"RCTBundleURLProviderUpdatedNotification\";\n\nconst NSUInteger kRCTBundleURLProviderDefaultPort = RCT_METRO_PORT;\n\nstatic NSString *const kRCTJsLocationKey = @\"RCT_jsLocation\";\nstatic NSString *const kRCTEnableLiveReloadKey = @\"RCT_enableLiveReload\";\nstatic NSString *const kRCTEnableDevKey = @\"RCT_enableDev\";\nstatic NSString *const kRCTEnableMinificationKey = @\"RCT_enableMinification\";\n\n@implementation RCTBundleURLProvider\n\n- (instancetype)init\n{\n  self = [super init];\n  if (self) {\n    [self setDefaults];\n  }\n  return self;\n}\n\n- (NSDictionary *)defaults\n{\n  return @{\n    kRCTEnableLiveReloadKey: @NO,\n    kRCTEnableDevKey: @YES,\n    kRCTEnableMinificationKey: @NO,\n  };\n}\n\n- (void)settingsUpdated\n{\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTBundleURLProviderUpdatedNotification object:self];\n}\n\n- (void)setDefaults\n{\n  [[NSUserDefaults standardUserDefaults] registerDefaults:[self defaults]];\n}\n\n- (void)resetToDefaults\n{\n  for (NSString *key in [[self defaults] allKeys]) {\n    [[NSUserDefaults standardUserDefaults] removeObjectForKey:key];\n  }\n  [self setDefaults];\n  [self settingsUpdated];\n}\n\nstatic NSURL *serverRootWithHost(NSString *host)\n{\n  return [NSURL URLWithString:\n          [NSString stringWithFormat:@\"http://%@:%lu/\",\n           host, (unsigned long)kRCTBundleURLProviderDefaultPort]];\n}\n\n#if RCT_DEV\n- (BOOL)isPackagerRunning:(NSString *)host\n{\n  NSURL *url = [serverRootWithHost(host) URLByAppendingPathComponent:@\"status\"];\n  NSURLRequest *request = [NSURLRequest requestWithURL:url];\n  NSURLResponse *response;\n  NSError *error;\n  NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];\n  if (error) {\n    RCTLogWarn(@\"The packager is unreachable: %@\", error.localizedDescription);\n  }\n  NSString *status = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];\n  return [status isEqualToString:@\"packager-status:running\"];\n}\n\n- (NSString *)guessPackagerHost\n{\n  static NSString *ipGuess;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    NSString *ipPath = [[NSBundle mainBundle] pathForResource:@\"ip\" ofType:@\"txt\"];\n    ipGuess = [[NSString stringWithContentsOfFile:ipPath encoding:NSUTF8StringEncoding error:nil]\n               stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];\n  });\n\n  NSString *host = ipGuess ?: @\"localhost\";\n  if ([self isPackagerRunning:host]) {\n    return host;\n  }\n  // second, attempt\n  // wait for it\n  [NSThread sleepForTimeInterval:3];\n  if ([self isPackagerRunning:host]) {\n    return host;\n  }\n  return nil;\n}\n#endif\n\n- (NSString *)packagerServerHost\n{\n  NSString *location = [self jsLocation];\n  if (location != nil) {\n    return location;\n  }\n#if RCT_DEV\n  NSString *host = [self guessPackagerHost];\n  if (host) {\n    return host;\n  }\n#endif\n  return nil;\n}\n\n- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackResource:(NSString *)resourceName fallbackExtension:(NSString *)extension\n{\n  NSString *packagerServerHost = [self packagerServerHost];\n  if (!packagerServerHost) {\n    return [self jsBundleURLForFallbackResource:resourceName fallbackExtension:extension];\n  } else {\n    return [RCTBundleURLProvider jsBundleURLForBundleRoot:bundleRoot\n                                             packagerHost:packagerServerHost\n                                                enableDev:[self enableDev]\n                                       enableMinification:[self enableMinification]];\n  }\n}\n\n- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackResource:(NSString *)resourceName\n{\n  return [self jsBundleURLForBundleRoot:bundleRoot fallbackResource:resourceName fallbackExtension:nil];\n}\n\n- (NSURL *)jsBundleURLForFallbackResource:(NSString *)resourceName\n                        fallbackExtension:(NSString *)extension\n{\n  resourceName = resourceName ?: @\"main\";\n  extension = extension ?: @\"jsbundle\";\n  return [[NSBundle mainBundle] URLForResource:resourceName withExtension:extension];\n}\n\n- (NSURL *)resourceURLForResourceRoot:(NSString *)root\n                         resourceName:(NSString *)name\n                    resourceExtension:(NSString *)extension\n                        offlineBundle:(NSBundle *)offlineBundle\n{\n  NSString *packagerServerHost = [self packagerServerHost];\n  if (!packagerServerHost) {\n    // Serve offline bundle (local file)\n    NSBundle *bundle = offlineBundle ?: [NSBundle mainBundle];\n    return [bundle URLForResource:name withExtension:extension];\n  }\n  NSString *path = [NSString stringWithFormat:@\"/%@/%@.%@\", root, name, extension];\n  return [[self class] resourceURLForResourcePath:path packagerHost:packagerServerHost query:nil];\n}\n\n+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot\n                       packagerHost:(NSString *)packagerHost\n                          enableDev:(BOOL)enableDev\n                 enableMinification:(BOOL)enableMinification\n{\n  NSString *path = [NSString stringWithFormat:@\"/%@.bundle\", bundleRoot];\n  // When we support only iOS 8 and above, use queryItems for a better API.\n  NSString *query = [NSString stringWithFormat:@\"platform=macos&dev=%@&minify=%@\",\n                      enableDev ? @\"true\" : @\"false\",\n                      enableMinification ? @\"true\": @\"false\"];\n  return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost query:query];\n}\n\n+ (NSURL *)resourceURLForResourcePath:(NSString *)path\n                         packagerHost:(NSString *)packagerHost\n                                query:(NSString *)query\n{\n  NSURLComponents *components = [NSURLComponents componentsWithURL:serverRootWithHost(packagerHost) resolvingAgainstBaseURL:NO];\n  components.path = path;\n  if (query != nil) {\n    components.query = query;\n  }\n  return components.URL;\n}\n\n- (void)updateValue:(id)object forKey:(NSString *)key\n{\n  [[NSUserDefaults standardUserDefaults] setObject:object forKey:key];\n  [[NSUserDefaults standardUserDefaults] synchronize];\n  [self settingsUpdated];\n}\n\n- (BOOL)enableDev\n{\n  return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableDevKey];\n}\n\n- (BOOL)enableLiveReload\n{\n  return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableLiveReloadKey];\n}\n\n- (BOOL)enableMinification\n{\n  return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableMinificationKey];\n}\n\n- (NSString *)jsLocation\n{\n  return [[NSUserDefaults standardUserDefaults] stringForKey:kRCTJsLocationKey];\n}\n\n- (void)setEnableDev:(BOOL)enableDev\n{\n  [self updateValue:@(enableDev) forKey:kRCTEnableDevKey];\n}\n\n- (void)setEnableLiveReload:(BOOL)enableLiveReload\n{\n  [self updateValue:@(enableLiveReload) forKey:kRCTEnableLiveReloadKey];\n}\n\n- (void)setJsLocation:(NSString *)jsLocation\n{\n  [self updateValue:jsLocation forKey:kRCTJsLocationKey];\n}\n\n- (void)setEnableMinification:(BOOL)enableMinification\n{\n  [self updateValue:@(enableMinification) forKey:kRCTEnableMinificationKey];\n}\n\n+ (instancetype)sharedSettings\n{\n  static RCTBundleURLProvider *sharedInstance;\n  static dispatch_once_t once_token;\n  dispatch_once(&once_token, ^{\n    sharedInstance = [RCTBundleURLProvider new];\n  });\n  return sharedInstance;\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTConvert.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <QuartzCore/QuartzCore.h>\n#import <AppKit/AppKit.h>\n\n#import <React/RCTAnimationType.h>\n#import <React/RCTBorderStyle.h>\n#import <React/RCTDefines.h>\n#import <React/RCTLog.h>\n#import <React/RCTPointerEvents.h>\n#import <React/RCTTextDecorationLineType.h>\n#import <yoga/Yoga.h>\n\n/**\n * This class provides a collection of conversion functions for mapping\n * JSON objects to native types and classes. These are useful when writing\n * custom RCTViewManager setter methods.\n */\n@interface RCTConvert : NSObject\n\n+ (id)id:(id)json;\n\n+ (BOOL)BOOL:(id)json;\n+ (double)double:(id)json;\n+ (float)float:(id)json;\n+ (int)int:(id)json;\n\n+ (int64_t)int64_t:(id)json;\n+ (uint64_t)uint64_t:(id)json;\n\n+ (NSInteger)NSInteger:(id)json;\n+ (NSUInteger)NSUInteger:(id)json;\n\n+ (NSArray *)NSArray:(id)json;\n+ (NSDictionary *)NSDictionary:(id)json;\n+ (NSString *)NSString:(id)json;\n+ (NSNumber *)NSNumber:(id)json;\n\n+ (NSSet *)NSSet:(id)json;\n+ (NSData *)NSData:(id)json;\n+ (NSIndexSet *)NSIndexSet:(id)json;\n\n+ (NSURLRequestCachePolicy)NSURLRequestCachePolicy:(id)json;\n+ (NSURL *)NSURL:(id)json;\n+ (NSURLRequest *)NSURLRequest:(id)json;\n\ntypedef NSURL RCTFileURL;\n+ (RCTFileURL *)RCTFileURL:(id)json;\n\n+ (NSDate *)NSDate:(id)json;\n+ (NSLocale *)NSLocale:(id)json;\n+ (NSTimeZone *)NSTimeZone:(id)json;\n+ (NSTimeInterval)NSTimeInterval:(id)json;\n\n+ (NSLineBreakMode)NSLineBreakMode:(id)json;\n+ (NSTextAlignment)NSTextAlignment:(id)json;\n+ (NSUnderlineStyle)NSUnderlineStyle:(id)json;\n+ (NSWritingDirection)NSWritingDirection:(id)json;\n\n+ (CGFloat)CGFloat:(id)json;\n+ (CGPoint)CGPoint:(id)json;\n+ (CGSize)CGSize:(id)json;\n+ (CGRect)CGRect:(id)json;\n+ (NSEdgeInsets)NSEdgeInsets:(id)json;\n\n+ (CGLineCap)CGLineCap:(id)json;\n+ (CGLineJoin)CGLineJoin:(id)json;\n\n+ (CGAffineTransform)CGAffineTransform:(id)json;\n//\n+ (NSColor *)NSColor:(id)json;\n+ (CGColorRef)CGColor:(id)json CF_RETURNS_NOT_RETAINED;\n\n+ (YGValue)YGValue:(id)json;\n\n+ (NSArray<NSArray *> *)NSArrayArray:(id)json;\n+ (NSArray<NSString *> *)NSStringArray:(id)json;\n+ (NSArray<NSArray<NSString *> *> *)NSStringArrayArray:(id)json;\n+ (NSArray<NSDictionary *> *)NSDictionaryArray:(id)json;\n+ (NSArray<NSURL *> *)NSURLArray:(id)json;\n+ (NSArray<RCTFileURL *> *)RCTFileURLArray:(id)json;\n+ (NSArray<NSNumber *> *)NSNumberArray:(id)json;\n+ (NSArray<NSColor *> *)NSColorArray:(id)json;\n\ntypedef NSArray CGColorArray;\n+ (CGColorArray *)CGColorArray:(id)json;\n\n/**\n * Convert a JSON object to a Plist-safe equivalent by stripping null values.\n */\ntypedef id NSPropertyList;\n+ (NSPropertyList)NSPropertyList:(id)json;\n\ntypedef BOOL css_backface_visibility_t;\n+ (YGOverflow)YGOverflow:(id)json;\n+ (YGDisplay)YGDisplay:(id)json;\n+ (css_backface_visibility_t)css_backface_visibility_t:(id)json;\n+ (YGFlexDirection)YGFlexDirection:(id)json;\n+ (YGJustify)YGJustify:(id)json;\n+ (YGAlign)YGAlign:(id)json;\n+ (YGPositionType)YGPositionType:(id)json;\n+ (YGWrap)YGWrap:(id)json;\n+ (YGDirection)YGDirection:(id)json;\n\n+ (RCTPointerEvents)RCTPointerEvents:(id)json;\n+ (RCTAnimationType)RCTAnimationType:(id)json;\n+ (RCTBorderStyle)RCTBorderStyle:(id)json;\n+ (RCTTextDecorationLineType)RCTTextDecorationLineType:(id)json;\n\n@end\n\n@interface RCTConvert (Deprecated)\n\n/**\n * Use lightweight generics syntax instead, e.g. NSArray<NSString *>\n */\ntypedef NSArray NSArrayArray __deprecated_msg(\"Use NSArray<NSArray *>\");\ntypedef NSArray NSStringArray __deprecated_msg(\"Use NSArray<NSString *>\");\ntypedef NSArray NSStringArrayArray __deprecated_msg(\"Use NSArray<NSArray<NSString *> *>\");\ntypedef NSArray NSDictionaryArray __deprecated_msg(\"Use NSArray<NSDictionary *>\");\ntypedef NSArray NSURLArray __deprecated_msg(\"Use NSArray<NSURL *>\");\ntypedef NSArray RCTFileURLArray __deprecated_msg(\"Use NSArray<RCTFileURL *>\");\ntypedef NSArray NSNumberArray __deprecated_msg(\"Use NSArray<NSNumber *>\");\ntypedef NSArray NSColorArray __deprecated_msg(\"Use NSArray<NSColor *>\");\n\n/**\n * Synchronous image loading is generally a bad idea for performance reasons.\n * If you need to pass image references, try to use `RCTImageSource` and then\n * `RCTImageLoader` instead of converting directly to a UIImage.\n */\n+ (NSImage *)NSImage:(id)json;\n+ (CGImageRef)CGImage:(id)json CF_RETURNS_NOT_RETAINED;\n\n@end\n\n/**\n * Underlying implementations of RCT_XXX_CONVERTER macros. Ignore these.\n */\nRCT_EXTERN NSNumber *RCTConvertEnumValue(const char *, NSDictionary *, NSNumber *, id);\nRCT_EXTERN NSNumber *RCTConvertMultiEnumValue(const char *, NSDictionary *, NSNumber *, id);\nRCT_EXTERN NSArray *RCTConvertArrayValue(SEL, id);\n\n/**\n * This macro is used for logging conversion errors. This is just used to\n * avoid repeating the same boilerplate for every error message.\n */\n#define RCTLogConvertError(json, typeName) \\\nRCTLogError(@\"JSON value '%@' of type %@ cannot be converted to %@\", \\\njson, [json classForCoder], typeName)\n\n/**\n * This macro is used for creating simple converter functions that just call\n * the specified getter method on the json value.\n */\n#define RCT_CONVERTER(type, name, getter) \\\nRCT_CUSTOM_CONVERTER(type, name, [json getter])\n\n/**\n * This macro is used for creating converter functions with arbitrary logic.\n */\n#define RCT_CUSTOM_CONVERTER(type, name, code) \\\n+ (type)name:(id)json                          \\\n{                                              \\\n  if (!RCT_DEBUG) {                            \\\n    return code;                               \\\n  } else {                                     \\\n    @try {                                     \\\n      return code;                             \\\n    }                                          \\\n    @catch (__unused NSException *e) {         \\\n      RCTLogConvertError(json, @#type);        \\\n      json = nil;                              \\\n      return code;                             \\\n    }                                          \\\n  }                                            \\\n}\n\n/**\n * This macro is similar to RCT_CONVERTER, but specifically geared towards\n * numeric types. It will handle string input correctly, and provides more\n * detailed error reporting if an invalid value is passed in.\n */\n#define RCT_NUMBER_CONVERTER(type, getter) \\\nRCT_CUSTOM_CONVERTER(type, type, [RCT_DEBUG ? [self NSNumber:json] : json getter])\n\n/**\n * When using RCT_ENUM_CONVERTER in ObjC, the compiler is OK with us returning\n * the underlying NSInteger/NSUInteger. In ObjC++, this is a type mismatch and\n * we need to explicitly cast the return value to expected enum return type.\n */\n#ifdef __cplusplus\n#define _RCT_CAST(type, expr) static_cast<type>(expr)\n#else\n#define _RCT_CAST(type, expr) expr\n#endif\n\n/**\n * This macro is used for creating converters for enum types.\n */\n#define RCT_ENUM_CONVERTER(type, values, default, getter) \\\n+ (type)type:(id)json                                     \\\n{                                                         \\\n  static NSDictionary *mapping;                           \\\n  static dispatch_once_t onceToken;                       \\\n  dispatch_once(&onceToken, ^{                            \\\n    mapping = values;                                     \\\n  });                                                     \\\n  return _RCT_CAST(type, [RCTConvertEnumValue(#type, mapping, @(default), json) getter]); \\\n}\n\n/**\n * This macro is used for creating converters for enum types for\n * multiple enum values combined with | operator\n */\n#define RCT_MULTI_ENUM_CONVERTER(type, values, default, getter) \\\n+ (type)type:(id)json                                     \\\n{                                                         \\\n  static NSDictionary *mapping;                           \\\n  static dispatch_once_t onceToken;                       \\\n  dispatch_once(&onceToken, ^{                            \\\n    mapping = values;                                     \\\n  });                                                     \\\n  return _RCT_CAST(type, [RCTConvertMultiEnumValue(#type, mapping, @(default), json) getter]); \\\n}\n\n/**\n * This macro is used for creating explicitly-named converter functions\n * for typed arrays.\n */\n#define RCT_ARRAY_CONVERTER_NAMED(type, name)          \\\n+ (NSArray<type *> *)name##Array:(id)json              \\\n{                                                      \\\n  return RCTConvertArrayValue(@selector(name:), json); \\\n}\n\n/**\n * This macro is used for creating converter functions for typed arrays.\n * RCT_ARRAY_CONVERTER_NAMED may be used when type contains characters\n * which are disallowed in selector names.\n */\n#define RCT_ARRAY_CONVERTER(type) RCT_ARRAY_CONVERTER_NAMED(type, type)\n"
  },
  {
    "path": "React/Base/RCTConvert.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTConvert.h\"\n\n#import <objc/message.h>\n\n#import <CoreText/CoreText.h>\n\n#import \"RCTDefines.h\"\n#import \"RCTImageSource.h\"\n#import \"RCTParserUtils.h\"\n#import \"RCTUtils.h\"\n#import \"UIImageUtils.h\"\n\n@implementation RCTConvert\n\nRCT_CONVERTER(id, id, self)\n\nRCT_CONVERTER(BOOL, BOOL, boolValue)\nRCT_NUMBER_CONVERTER(double, doubleValue)\nRCT_NUMBER_CONVERTER(float, floatValue)\nRCT_NUMBER_CONVERTER(int, intValue)\n\nRCT_NUMBER_CONVERTER(int64_t, longLongValue);\nRCT_NUMBER_CONVERTER(uint64_t, unsignedLongLongValue);\n\nRCT_NUMBER_CONVERTER(NSInteger, integerValue)\nRCT_NUMBER_CONVERTER(NSUInteger, unsignedIntegerValue)\n\n/**\n * This macro is used for creating converter functions for directly\n * representable json values that require no conversion.\n */\n#if RCT_DEBUG\n#define RCT_JSON_CONVERTER(type)           \\\n+ (type *)type:(id)json                    \\\n{                                          \\\n  if ([json isKindOfClass:[type class]]) { \\\n    return json;                           \\\n  } else if (json) {                       \\\n    RCTLogConvertError(json, @#type);      \\\n  }                                        \\\n  return nil;                              \\\n}\n#else\n#define RCT_JSON_CONVERTER(type)           \\\n+ (type *)type:(id)json { return json; }\n#endif\n\nRCT_JSON_CONVERTER(NSArray)\nRCT_JSON_CONVERTER(NSDictionary)\nRCT_JSON_CONVERTER(NSString)\nRCT_JSON_CONVERTER(NSNumber)\n\nRCT_CUSTOM_CONVERTER(NSSet *, NSSet, [NSSet setWithArray:json])\nRCT_CUSTOM_CONVERTER(NSData *, NSData, [json dataUsingEncoding:NSUTF8StringEncoding])\n\n+ (NSIndexSet *)NSIndexSet:(id)json\n{\n  json = [self NSNumberArray:json];\n  NSMutableIndexSet *indexSet = [NSMutableIndexSet new];\n  for (NSNumber *number in json) {\n    NSInteger index = number.integerValue;\n    if (RCT_DEBUG && index < 0) {\n      RCTLogError(@\"Invalid index value %lld. Indices must be positive.\", (long long)index);\n    }\n    [indexSet addIndex:index];\n  }\n  return indexSet;\n}\n\n\n+ (NSURL *)NSURL:(id)json\n{\n  NSString *path = [self NSString:json];\n  if (!path) {\n    return nil;\n  }\n\n  @try { // NSURL has a history of crashing with bad input, so let's be safe\n\n    NSURL *URL = [NSURL URLWithString:path];\n    if (URL.scheme) { // Was a well-formed absolute URL\n      return URL;\n    }\n\n    // Check if it has a scheme\n    if ([path rangeOfString:@\":\"].location != NSNotFound) {\n      path = [path stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];\n      URL = [NSURL URLWithString:path];\n      if (URL) {\n        return URL;\n      }\n    }\n\n    // Assume that it's a local path\n    path = path.stringByRemovingPercentEncoding;\n    if ([path hasPrefix:@\"~\"]) {\n      // Path is inside user directory\n      path = path.stringByExpandingTildeInPath;\n    } else if (!path.absolutePath) {\n      // Assume it's a resource path\n      path = [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:path];\n    }\n    if (!(URL = [NSURL fileURLWithPath:path])) {\n      RCTLogConvertError(json, @\"a valid URL\");\n    }\n    return URL;\n  }\n  @catch (__unused NSException *e) {\n    RCTLogConvertError(json, @\"a valid URL\");\n    return nil;\n  }\n}\n\nRCT_ENUM_CONVERTER(NSURLRequestCachePolicy, (@{\n                                               @\"default\": @(NSURLRequestUseProtocolCachePolicy),\n                                               @\"reload\": @(NSURLRequestReloadIgnoringLocalCacheData),\n                                               @\"force-cache\": @(NSURLRequestReturnCacheDataElseLoad),\n                                               @\"only-if-cached\": @(NSURLRequestReturnCacheDataDontLoad),\n                                               }), NSURLRequestUseProtocolCachePolicy, integerValue)\n\n\n+ (NSURLRequest *)NSURLRequest:(id)json\n{\n  if ([json isKindOfClass:[NSString class]]) {\n    NSURL *URL = [self NSURL:json];\n    return URL ? [NSURLRequest requestWithURL:URL] : nil;\n  }\n  if ([json isKindOfClass:[NSDictionary class]]) {\n    NSString *URLString = json[@\"uri\"] ?: json[@\"url\"];\n\n    NSURL *URL;\n    NSString *bundleName = json[@\"bundle\"];\n    if (bundleName) {\n      URLString = [NSString stringWithFormat:@\"%@.bundle/%@\", bundleName, URLString];\n    }\n\n    URL = [self NSURL:URLString];\n    if (!URL) {\n      return nil;\n    }\n\n    NSData *body = [self NSData:json[@\"body\"]];\n    NSString *method = [self NSString:json[@\"method\"]].uppercaseString ?: @\"GET\";\n    NSURLRequestCachePolicy cachePolicy = [self NSURLRequestCachePolicy:json[@\"cache\"]];\n    NSDictionary *headers = [self NSDictionary:json[@\"headers\"]];\n    if ([method isEqualToString:@\"GET\"] && headers == nil && body == nil && cachePolicy == NSURLRequestUseProtocolCachePolicy) {\n      return [NSURLRequest requestWithURL:URL];\n    }\n\n    if (headers) {\n      __block BOOL allHeadersAreStrings = YES;\n      [headers enumerateKeysAndObjectsUsingBlock:^(NSString *key, id header, BOOL *stop) {\n        if (![header isKindOfClass:[NSString class]]) {\n          RCTLogError(@\"Values of HTTP headers passed must be  of type string. \"\n                      \"Value of header '%@' is not a string.\", key);\n          allHeadersAreStrings = NO;\n          *stop = YES;\n        }\n      }];\n      if (!allHeadersAreStrings) {\n        // Set headers to nil here to avoid crashing later.\n        headers = nil;\n      }\n    }\n\n    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];\n    request.HTTPBody = body;\n    request.HTTPMethod = method;\n    request.cachePolicy = cachePolicy;\n    request.allHTTPHeaderFields = headers;\n    return [request copy];\n  }\n  if (json) {\n    RCTLogConvertError(json, @\"a valid URLRequest\");\n  }\n  return nil;\n}\n\n+ (RCTFileURL *)RCTFileURL:(id)json\n{\n  NSURL *fileURL = [self NSURL:json];\n  if (!fileURL.fileURL) {\n    RCTLogError(@\"URI must be a local file, '%@' isn't.\", fileURL);\n    return nil;\n  }\n  if (![[NSFileManager defaultManager] fileExistsAtPath:fileURL.path]) {\n    RCTLogError(@\"File '%@' could not be found.\", fileURL);\n    return nil;\n  }\n  return fileURL;\n}\n\n+ (NSDate *)NSDate:(id)json\n{\n  if ([json isKindOfClass:[NSNumber class]]) {\n    return [NSDate dateWithTimeIntervalSince1970:[self NSTimeInterval:json]];\n  } else if ([json isKindOfClass:[NSString class]]) {\n    static NSDateFormatter *formatter;\n    static dispatch_once_t onceToken;\n    dispatch_once(&onceToken, ^{\n      formatter = [NSDateFormatter new];\n      formatter.dateFormat = @\"yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ\";\n      formatter.locale = [NSLocale localeWithLocaleIdentifier:@\"en_US_POSIX\"];\n      formatter.timeZone = [NSTimeZone timeZoneWithName:@\"UTC\"];\n    });\n    NSDate *date = [formatter dateFromString:json];\n    if (!date) {\n      RCTLogError(@\"JSON String '%@' could not be interpreted as a date. \"\n                  \"Expected format: YYYY-MM-DD'T'HH:mm:ss.sssZ\", json);\n    }\n    return date;\n  } else if (json) {\n    RCTLogConvertError(json, @\"a date\");\n  }\n  return nil;\n}\n\n+ (NSLocale *)NSLocale:(id)json\n{\n  if ([json isKindOfClass:[NSString class]]) {\n    NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:json];\n    if (!locale) {\n      RCTLogError(@\"JSON String '%@' could not be interpreted as a valid locale. \", json);\n    }\n    return locale;\n  } else if (json) {\n    RCTLogConvertError(json, @\"a locale\");\n  }\n  return nil;\n}\n\n// JS Standard for time is milliseconds\nRCT_CUSTOM_CONVERTER(NSTimeInterval, NSTimeInterval, [self double:json] / 1000.0)\n\n// JS standard for time zones is minutes.\nRCT_CUSTOM_CONVERTER(NSTimeZone *, NSTimeZone, [NSTimeZone timeZoneForSecondsFromGMT:[self double:json] * 60.0])\n\nNSNumber *RCTConvertEnumValue(const char *typeName, NSDictionary *mapping, NSNumber *defaultValue, id json)\n{\n  if (!json) {\n    return defaultValue;\n  }\n  if ([json isKindOfClass:[NSNumber class]]) {\n    NSArray *allValues = mapping.allValues;\n    if ([allValues containsObject:json] || [json isEqual:defaultValue]) {\n      return json;\n    }\n    RCTLogError(@\"Invalid %s '%@'. should be one of: %@\", typeName, json, allValues);\n    return defaultValue;\n  }\n  if (RCT_DEBUG && ![json isKindOfClass:[NSString class]]) {\n    RCTLogError(@\"Expected NSNumber or NSString for %s, received %@: %@\",\n                typeName, [json classForCoder], json);\n  }\n  id value = mapping[json];\n  if (RCT_DEBUG && !value && [json description].length > 0) {\n    RCTLogError(@\"Invalid %s '%@'. should be one of: %@\", typeName, json, [[mapping allKeys] sortedArrayUsingSelector: @selector(caseInsensitiveCompare:)]);\n  }\n  return value ?: defaultValue;\n}\n\nNSNumber *RCTConvertMultiEnumValue(const char *typeName, NSDictionary *mapping, NSNumber *defaultValue, id json)\n{\n  if ([json isKindOfClass:[NSArray class]]) {\n    if ([json count] == 0) {\n      return defaultValue;\n    }\n    long long result = 0;\n    for (id arrayElement in json) {\n      NSNumber *value = RCTConvertEnumValue(typeName, mapping, defaultValue, arrayElement);\n      result |= value.longLongValue;\n    }\n    return @(result);\n  }\n  return RCTConvertEnumValue(typeName, mapping, defaultValue, json);\n}\n\nRCT_ENUM_CONVERTER(NSLineBreakMode, (@{\n  @\"clip\": @(NSLineBreakByClipping),\n  @\"head\": @(NSLineBreakByTruncatingHead),\n  @\"tail\": @(NSLineBreakByTruncatingTail),\n  @\"middle\": @(NSLineBreakByTruncatingMiddle),\n  @\"wordWrapping\": @(NSLineBreakByWordWrapping),\n}), NSLineBreakByTruncatingTail, integerValue)\n\nRCT_ENUM_CONVERTER(NSTextAlignment, (@{\n  @\"auto\": @(NSTextAlignmentNatural),\n  @\"left\": @(NSTextAlignmentLeft),\n  @\"center\": @(NSTextAlignmentCenter),\n  @\"right\": @(NSTextAlignmentRight),\n  @\"justify\": @(NSTextAlignmentJustified),\n}), NSTextAlignmentNatural, integerValue)\n\nRCT_ENUM_CONVERTER(NSUnderlineStyle, (@{\n  @\"solid\": @(NSUnderlineStyleSingle),\n  @\"double\": @(NSUnderlineStyleDouble),\n  @\"dotted\": @(NSUnderlinePatternDot | NSUnderlineStyleSingle),\n  @\"dashed\": @(NSUnderlinePatternDash | NSUnderlineStyleSingle),\n}), NSUnderlineStyleSingle, integerValue)\n\nRCT_ENUM_CONVERTER(RCTBorderStyle, (@{\n  @\"solid\": @(RCTBorderStyleSolid),\n  @\"dotted\": @(RCTBorderStyleDotted),\n  @\"dashed\": @(RCTBorderStyleDashed),\n}), RCTBorderStyleSolid, integerValue)\n\nRCT_ENUM_CONVERTER(RCTTextDecorationLineType, (@{\n  @\"none\": @(RCTTextDecorationLineTypeNone),\n  @\"underline\": @(RCTTextDecorationLineTypeUnderline),\n  @\"line-through\": @(RCTTextDecorationLineTypeStrikethrough),\n  @\"underline line-through\": @(RCTTextDecorationLineTypeUnderlineStrikethrough),\n}), RCTTextDecorationLineTypeNone, integerValue)\n\nRCT_ENUM_CONVERTER(NSWritingDirection, (@{\n  @\"auto\": @(NSWritingDirectionNatural),\n  @\"ltr\": @(NSWritingDirectionLeftToRight),\n  @\"rtl\": @(NSWritingDirectionRightToLeft),\n}), NSWritingDirectionNatural, integerValue)\n\nRCT_ENUM_CONVERTER(UIViewContentMode, (@{\n  @\"scale-to-fill\": @(UIViewContentModeScaleToFill),\n  @\"scale-aspect-fit\": @(UIViewContentModeScaleAspectFit),\n  @\"scale-aspect-fill\": @(UIViewContentModeScaleAspectFill),\n  @\"redraw\": @(UIViewContentModeRedraw),\n  @\"center\": @(UIViewContentModeCenter),\n  @\"top\": @(UIViewContentModeTop),\n  @\"bottom\": @(UIViewContentModeBottom),\n  @\"left\": @(UIViewContentModeLeft),\n  @\"right\": @(UIViewContentModeRight),\n  @\"top-left\": @(UIViewContentModeTopLeft),\n  @\"top-right\": @(UIViewContentModeTopRight),\n  @\"bottom-left\": @(UIViewContentModeBottomLeft),\n  @\"bottom-right\": @(UIViewContentModeBottomRight),\n  // Cross-platform values\n  @\"cover\": @(UIViewContentModeScaleAspectFill),\n  @\"contain\": @(UIViewContentModeScaleAspectFit),\n  @\"stretch\": @(UIViewContentModeScaleToFill),\n}), UIViewContentModeScaleAspectFill, integerValue)\n\nstatic void convertCGStruct(const char *type, NSArray *fields, CGFloat *result, id json)\n{\n  NSUInteger count = fields.count;\n  if ([json isKindOfClass:[NSArray class]]) {\n    if (RCT_DEBUG && [json count] != count) {\n      RCTLogError(@\"Expected array with count %llu, but count is %llu: %@\", (unsigned long long)count, (unsigned long long)[json count], json);\n    } else {\n      for (NSUInteger i = 0; i < count; i++) {\n        result[i] = [RCTConvert CGFloat:RCTNilIfNull(json[i])];\n      }\n    }\n  } else if ([json isKindOfClass:[NSDictionary class]]) {\n    for (NSUInteger i = 0; i < count; i++) {\n      result[i] = [RCTConvert CGFloat:RCTNilIfNull(json[fields[i]])];\n    }\n  } else if (json) {\n    RCTLogConvertError(json, @(type));\n  }\n}\n\n/**\n * This macro is used for creating converter functions for structs that consist\n * of a number of CGFloat properties, such as CGPoint, CGRect, etc.\n */\n#define RCT_CGSTRUCT_CONVERTER(type, values)                \\\n+ (type)type:(id)json                                       \\\n{                                                           \\\n  static NSArray *fields;                                   \\\n  static dispatch_once_t onceToken;                         \\\n  dispatch_once(&onceToken, ^{                              \\\n    fields = values;                                        \\\n  });                                                       \\\n  type result;                                              \\\n  convertCGStruct(#type, fields, (CGFloat *)&result, json); \\\n  return result;                                            \\\n}\n\nRCT_CUSTOM_CONVERTER(CGFloat, CGFloat, [self double:json])\n\nRCT_CGSTRUCT_CONVERTER(CGPoint, (@[@\"x\", @\"y\"]))\nRCT_CGSTRUCT_CONVERTER(CGSize, (@[@\"width\", @\"height\"]))\nRCT_CGSTRUCT_CONVERTER(CGRect, (@[@\"x\", @\"y\", @\"width\", @\"height\"]))\nRCT_CGSTRUCT_CONVERTER(NSEdgeInsets, (@[@\"top\", @\"left\", @\"bottom\", @\"right\"]))\n\nRCT_ENUM_CONVERTER(CGLineJoin, (@{\n  @\"miter\": @(kCGLineJoinMiter),\n  @\"round\": @(kCGLineJoinRound),\n  @\"bevel\": @(kCGLineJoinBevel),\n}), kCGLineJoinMiter, intValue)\n\nRCT_ENUM_CONVERTER(CGLineCap, (@{\n  @\"butt\": @(kCGLineCapButt),\n  @\"round\": @(kCGLineCapRound),\n  @\"square\": @(kCGLineCapSquare),\n}), kCGLineCapButt, intValue)\n\nRCT_CGSTRUCT_CONVERTER(CGAffineTransform, (@[\n  @\"a\", @\"b\", @\"c\", @\"d\", @\"tx\", @\"ty\"\n]))\n\n+ (NSColor *)NSColor:(id)json\n{\n  if (!json) {\n    return nil;\n  }\n  if ([json isKindOfClass:[NSArray class]]) {\n    NSArray *components = [self NSNumberArray:json];\n    CGFloat alpha = components.count > 3 ? [self CGFloat:components[3]] : 1.0;\n    return [NSColor colorWithRed:[self CGFloat:components[0]]\n                           green:[self CGFloat:components[1]]\n                            blue:[self CGFloat:components[2]]\n                           alpha:alpha];\n  } else if ([json isKindOfClass:[NSNumber class]]) {\n    NSUInteger argb = [self NSUInteger:json];\n    CGFloat a = ((argb >> 24) & 0xFF) / 255.0;\n    CGFloat r = ((argb >> 16) & 0xFF) / 255.0;\n    CGFloat g = ((argb >> 8) & 0xFF) / 255.0;\n    CGFloat b = (argb & 0xFF) / 255.0;\n    return [NSColor colorWithRed:r green:g blue:b alpha:a];\n  } else {\n    RCTLogConvertError(json, @\"a UIColor. Did you forget to call processColor() on the JS side?\");\n    return nil;\n  }\n}\n\n+ (CGColorRef)CGColor:(id)json\n{\n  return [self NSColor:json].CGColor;\n}\n\n+ (YGValue)YGValue:(id)json\n{\n  if (!json) {\n    return YGValueUndefined;\n  } else if ([json isKindOfClass:[NSNumber class]]) {\n    return (YGValue) { [json floatValue], YGUnitPoint };\n  } else if ([json isKindOfClass:[NSString class]]) {\n    NSString *s = (NSString *) json;\n    if ([s isEqualToString:@\"auto\"]) {\n      return (YGValue) { YGUndefined, YGUnitAuto };\n    } else if ([s hasSuffix:@\"%\"]) {\n      return (YGValue) { [[s substringToIndex:s.length] floatValue], YGUnitPercent };\n    } else {\n      RCTLogConvertError(json, @\"a YGValue. Did you forget the % or pt suffix?\");\n    }\n  } else {\n    RCTLogConvertError(json, @\"a YGValue.\");\n  }\n  return YGValueUndefined;\n}\n\nNSArray *RCTConvertArrayValue(SEL type, id json)\n{\n  __block BOOL copy = NO;\n  __block NSArray *values = json = [RCTConvert NSArray:json];\n  [json enumerateObjectsUsingBlock:^(id jsonValue, NSUInteger idx, __unused BOOL *stop) {\n    id value = ((id(*)(Class, SEL, id))objc_msgSend)([RCTConvert class], type, jsonValue);\n    if (copy) {\n      if (value) {\n        [(NSMutableArray *)values addObject:value];\n      }\n    } else if (value != jsonValue) {\n      // Converted value is different, so we'll need to copy the array\n      values = [[NSMutableArray alloc] initWithCapacity:values.count];\n      for (NSUInteger i = 0; i < idx; i++) {\n        [(NSMutableArray *)values addObject:json[i]];\n      }\n      if (value) {\n        [(NSMutableArray *)values addObject:value];\n      }\n      copy = YES;\n    }\n  }];\n  return values;\n}\n\nRCT_ARRAY_CONVERTER(NSURL)\nRCT_ARRAY_CONVERTER(RCTFileURL)\nRCT_ARRAY_CONVERTER(NSColor)\n\n/**\n * This macro is used for creating converter functions for directly\n * representable json array values that require no conversion.\n */\n#if RCT_DEBUG\n#define RCT_JSON_ARRAY_CONVERTER_NAMED(type, name) RCT_ARRAY_CONVERTER_NAMED(type, name)\n#else\n#define RCT_JSON_ARRAY_CONVERTER_NAMED(type, name) + (NSArray *)name##Array:(id)json { return json; }\n#endif\n#define RCT_JSON_ARRAY_CONVERTER(type) RCT_JSON_ARRAY_CONVERTER_NAMED(type, type)\n\nRCT_JSON_ARRAY_CONVERTER(NSArray)\nRCT_JSON_ARRAY_CONVERTER(NSString)\nRCT_JSON_ARRAY_CONVERTER_NAMED(NSArray<NSString *>, NSStringArray)\nRCT_JSON_ARRAY_CONVERTER(NSDictionary)\nRCT_JSON_ARRAY_CONVERTER(NSNumber)\n\n// Can't use RCT_ARRAY_CONVERTER due to bridged cast\n+ (NSArray *)CGColorArray:(id)json\n{\n  NSMutableArray *colors = [NSMutableArray new];\n  for (id value in [self NSArray:json]) {\n    [colors addObject:(__bridge id)[self CGColor:value]];\n  }\n  return colors;\n}\n\nstatic id RCTConvertPropertyListValue(id json)\n{\n  if (!json || json == (id)kCFNull) {\n    return nil;\n  }\n\n  if ([json isKindOfClass:[NSDictionary class]]) {\n    __block BOOL copy = NO;\n    NSMutableDictionary *values = [[NSMutableDictionary alloc] initWithCapacity:[json count]];\n    [json enumerateKeysAndObjectsUsingBlock:^(NSString *key, id jsonValue, __unused BOOL *stop) {\n      id value = RCTConvertPropertyListValue(jsonValue);\n      if (value) {\n        values[key] = value;\n      }\n      copy |= value != jsonValue;\n    }];\n    return copy ? values : json;\n  }\n\n  if ([json isKindOfClass:[NSArray class]]) {\n    __block BOOL copy = NO;\n    __block NSArray *values = json;\n    [json enumerateObjectsUsingBlock:^(id jsonValue, NSUInteger idx, __unused BOOL *stop) {\n      id value = RCTConvertPropertyListValue(jsonValue);\n      if (copy) {\n        if (value) {\n          [(NSMutableArray *)values addObject:value];\n        }\n      } else if (value != jsonValue) {\n        // Converted value is different, so we'll need to copy the array\n        values = [[NSMutableArray alloc] initWithCapacity:values.count];\n        for (NSUInteger i = 0; i < idx; i++) {\n          [(NSMutableArray *)values addObject:json[i]];\n        }\n        if (value) {\n          [(NSMutableArray *)values addObject:value];\n        }\n        copy = YES;\n      }\n    }];\n    return values;\n  }\n\n  // All other JSON types are supported by property lists\n  return json;\n}\n\n+ (NSPropertyList)NSPropertyList:(id)json\n{\n  return RCTConvertPropertyListValue(json);\n}\n\nRCT_ENUM_CONVERTER(css_backface_visibility_t, (@{\n  @\"hidden\": @NO,\n  @\"visible\": @YES\n}), YES, boolValue)\n\nRCT_ENUM_CONVERTER(YGOverflow, (@{\n  @\"hidden\": @(YGOverflowHidden),\n  @\"visible\": @(YGOverflowVisible),\n  @\"scroll\": @(YGOverflowScroll),\n}), YGOverflowVisible, intValue)\n\nRCT_ENUM_CONVERTER(YGDisplay, (@{\n  @\"flex\": @(YGDisplayFlex),\n  @\"none\": @(YGDisplayNone),\n}), YGDisplayFlex, intValue)\n\nRCT_ENUM_CONVERTER(YGFlexDirection, (@{\n  @\"row\": @(YGFlexDirectionRow),\n  @\"row-reverse\": @(YGFlexDirectionRowReverse),\n  @\"column\": @(YGFlexDirectionColumn),\n  @\"column-reverse\": @(YGFlexDirectionColumnReverse)\n}), YGFlexDirectionColumn, intValue)\n\nRCT_ENUM_CONVERTER(YGJustify, (@{\n  @\"flex-start\": @(YGJustifyFlexStart),\n  @\"flex-end\": @(YGJustifyFlexEnd),\n  @\"center\": @(YGJustifyCenter),\n  @\"space-between\": @(YGJustifySpaceBetween),\n  @\"space-around\": @(YGJustifySpaceAround),\n  @\"space-evenly\": @(YGJustifySpaceEvenly)\n}), YGJustifyFlexStart, intValue)\n\nRCT_ENUM_CONVERTER(YGAlign, (@{\n  @\"flex-start\": @(YGAlignFlexStart),\n  @\"flex-end\": @(YGAlignFlexEnd),\n  @\"center\": @(YGAlignCenter),\n  @\"auto\": @(YGAlignAuto),\n  @\"stretch\": @(YGAlignStretch),\n  @\"baseline\": @(YGAlignBaseline),\n  @\"space-between\": @(YGAlignSpaceBetween),\n  @\"space-around\": @(YGAlignSpaceAround)\n}), YGAlignFlexStart, intValue)\n\nRCT_ENUM_CONVERTER(YGDirection, (@{\n  @\"inherit\": @(YGDirectionInherit),\n  @\"ltr\": @(YGDirectionLTR),\n  @\"rtl\": @(YGDirectionRTL),\n}), YGDirectionInherit, intValue)\n\nRCT_ENUM_CONVERTER(YGPositionType, (@{\n  @\"absolute\": @(YGPositionTypeAbsolute),\n  @\"relative\": @(YGPositionTypeRelative)\n}), YGPositionTypeRelative, intValue)\n\nRCT_ENUM_CONVERTER(YGWrap, (@{\n  @\"wrap\": @(YGWrapWrap),\n  @\"nowrap\": @(YGWrapNoWrap)\n}), YGWrapNoWrap, intValue)\n\nRCT_ENUM_CONVERTER(RCTPointerEvents, (@{\n  @\"none\": @(RCTPointerEventsNone),\n  @\"box-only\": @(RCTPointerEventsBoxOnly),\n  @\"box-none\": @(RCTPointerEventsBoxNone),\n  @\"auto\": @(RCTPointerEventsUnspecified)\n}), RCTPointerEventsUnspecified, integerValue)\n\nRCT_ENUM_CONVERTER(RCTAnimationType, (@{\n  @\"spring\": @(RCTAnimationTypeSpring),\n  @\"linear\": @(RCTAnimationTypeLinear),\n  @\"easeIn\": @(RCTAnimationTypeEaseIn),\n  @\"easeOut\": @(RCTAnimationTypeEaseOut),\n  @\"easeInEaseOut\": @(RCTAnimationTypeEaseInEaseOut),\n  @\"keyboard\": @(RCTAnimationTypeKeyboard),\n}), RCTAnimationTypeEaseInEaseOut, integerValue)\n\n@end\n\n@interface RCTImageSource (Packager)\n\n@property (nonatomic, assign) BOOL packagerAsset;\n\n@end\n\n@implementation RCTConvert (Deprecated)\n\n/* This method is only used when loading images synchronously, e.g. for tabbar icons */\n+ (NSImage *)NSImage:(id)json\n{\n  if (!json) {\n    return nil;\n  }\n\n  RCTImageSource *imageSource = [self RCTImageSource:json];\n  if (!imageSource) {\n    return nil;\n  }\n\n  __block NSImage *image;\n  if (![NSThread isMainThread]) {\n    // It seems that none of the UIImage loading methods can be guaranteed\n    // thread safe, so we'll pick the lesser of two evils here and block rather\n    // than run the risk of crashing\n    RCTLogWarn(@\"Calling [RCTConvert UIImage:] on a background thread is not recommended\");\n    RCTUnsafeExecuteOnMainQueueSync(^{\n      image = [self NSImage:json];\n    });\n    return image;\n  }\n\n  NSURL *URL = imageSource.request.URL;\n  NSString *scheme = URL.scheme.lowercaseString;\n  if ([scheme isEqualToString:@\"file\"]) {\n    image = RCTImageFromLocalAssetURL(URL);\n    if (!image) {\n      RCTLogConvertError(json, @\"an image. File not found.\");\n    }\n  } else if ([scheme isEqualToString:@\"data\"]) {\n    image = [[NSImage alloc] initWithData:[NSData dataWithContentsOfURL:URL]];\n  } else if ([scheme isEqualToString:@\"http\"] && imageSource.packagerAsset) {\n    image = [[NSImage alloc] initWithData:[NSData dataWithContentsOfURL:URL]];\n  } else {\n    RCTLogConvertError(json, @\"an image. Only local files or data URIs are supported.\");\n    return nil;\n  }\n\n  CGFloat scale = imageSource.scale;\n  CGImageRef imageRef;\n  if (!scale && imageSource.size.width) {\n    // If no scale provided, set scale to image width / source width\n    imageRef = [image CGImageForProposedRect:nil context:nil hints:nil];\n    scale = CGImageGetWidth(imageRef) / imageSource.size.width;\n  }\n\n  if (scale) {\n    imageRef = [image CGImageForProposedRect:nil context:nil hints:nil];\n    image = [[NSImage alloc] initWithCGImage:imageRef size:NSMakeSize(image.size.width/scale, image.size.height/scale)];\n  }\n\n  if (!CGSizeEqualToSize(imageSource.size, CGSizeZero) &&\n      !CGSizeEqualToSize(imageSource.size, image.size)) {\n    RCTLogError(@\"Image source size %@ x %f does not match loaded image size %f x %f\", URL.path.lastPathComponent, imageSource.size.height, image.size.width, image.size.height);\n  }\n\n  return image;\n}\n\n+ (CGImageRef)CGImage:(id)json\n{\n  return [[self NSImage:json] CGImageForProposedRect:nil context:nil hints:nil];\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTCxxConvert.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n/**\n * This class provides a collection of conversion functions for mapping\n * JSON objects to cxx types. Extensible via categories.\n * Convert methods are expected to return cxx objects wraped in RCTManagedPointer.\n */\n\n@interface RCTCxxConvert : NSObject\n\n@end\n"
  },
  {
    "path": "React/Base/RCTCxxConvert.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTCxxConvert.h\"\n\n@implementation RCTCxxConvert\n\n@end\n"
  },
  {
    "path": "React/Base/RCTDefines.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#if __OBJC__\n#  import <Foundation/Foundation.h>\n#endif\n\n/**\n * Make global functions usable in C++\n */\n#if defined(__cplusplus)\n#define RCT_EXTERN extern \"C\" __attribute__((visibility(\"default\")))\n#define RCT_EXTERN_C_BEGIN extern \"C\" {\n#define RCT_EXTERN_C_END }\n#else\n#define RCT_EXTERN extern __attribute__((visibility(\"default\")))\n#define RCT_EXTERN_C_BEGIN\n#define RCT_EXTERN_C_END\n#endif\n\n/**\n * The RCT_DEBUG macro can be used to exclude error checking and logging code\n * from release builds to improve performance and reduce binary size.\n */\n#ifndef RCT_DEBUG\n#if DEBUG\n#define RCT_DEBUG 1\n#else\n#define RCT_DEBUG 0\n#endif\n#endif\n\n/**\n * The RCT_DEV macro can be used to enable or disable development tools\n * such as the debug executors, dev menu, red box, etc.\n */\n#ifndef RCT_DEV\n#if DEBUG\n#define RCT_DEV 1\n#else\n#define RCT_DEV 0\n#endif\n#endif\n\n#ifndef RCT_ENABLE_INSPECTOR\n#if RCT_DEV && __has_include(<React/RCTInspectorDevServerHelper.h>)\n#define RCT_ENABLE_INSPECTOR 1\n#else\n#define RCT_ENABLE_INSPECTOR 0\n#endif\n#endif\n\n#ifndef ENABLE_PACKAGER_CONNECTION\n#if RCT_DEV && __has_include(<React/RCTPackagerConnection.h>)\n#define ENABLE_PACKAGER_CONNECTION 1\n#else\n#define ENABLE_PACKAGER_CONNECTION 0\n#endif\n#endif\n\n#if RCT_DEV\n#define RCT_IF_DEV(...) __VA_ARGS__\n#else\n#define RCT_IF_DEV(...)\n#endif\n\n#ifndef RCT_PROFILE\n#define RCT_PROFILE RCT_DEV\n#endif\n\n/**\n * Add the default Metro packager port number\n */\n#ifndef RCT_METRO_PORT\n#define RCT_METRO_PORT 8081\n#else\n// test if RCT_METRO_PORT is empty\n#define RCT_METRO_PORT_DO_EXPAND(VAL)  VAL ## 1\n#define RCT_METRO_PORT_EXPAND(VAL)     RCT_METRO_PORT_DO_EXPAND(VAL)\n#if !defined(RCT_METRO_PORT) || (RCT_METRO_PORT_EXPAND(RCT_METRO_PORT) == 1)\n// Only here if RCT_METRO_PORT is not defined\n// OR RCT_METRO_PORT is the empty string\n#undef RCT_METRO_PORT\n#define RCT_METRO_PORT 8081\n#endif\n#endif\n\n/**\n * By default, only raise an NSAssertion in debug mode\n * (custom assert functions will still be called).\n */\n#ifndef RCT_NSASSERT\n#define RCT_NSASSERT RCT_DEBUG\n#endif\n\n/**\n * Concat two literals. Supports macro expansions,\n * e.g. RCT_CONCAT(foo, __FILE__).\n */\n#define RCT_CONCAT2(A, B) A ## B\n#define RCT_CONCAT(A, B) RCT_CONCAT2(A, B)\n\n/**\n * Throw an assertion for unimplemented methods.\n */\n#define RCT_NOT_IMPLEMENTED(method) \\\n_Pragma(\"clang diagnostic push\") \\\n_Pragma(\"clang diagnostic ignored \\\"-Wmissing-method-return-type\\\"\") \\\n_Pragma(\"clang diagnostic ignored \\\"-Wunused-parameter\\\"\") \\\nRCT_EXTERN NSException *_RCTNotImplementedException(SEL, Class); \\\nmethod NS_UNAVAILABLE { @throw _RCTNotImplementedException(_cmd, [self class]); } \\\n_Pragma(\"clang diagnostic pop\")\n"
  },
  {
    "path": "React/Base/RCTDisplayLink.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#define RCT_TIME_PER_FRAME 0.0166\n\n@protocol RCTBridgeModule;\n@class RCTModuleData;\n\n@interface RCTDisplayLink : NSObject\n\n- (instancetype)init;\n- (void)invalidate;\n- (void)registerModuleForFrameUpdates:(id<RCTBridgeModule>)module\n                       withModuleData:(RCTModuleData *)moduleData;\n- (void)addToRunLoop:(NSRunLoop *)runLoop;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTDisplayLink.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDisplayLink.h\"\n\n#import <Foundation/Foundation.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTBridgeModule.h\"\n#import \"RCTFrameUpdate.h\"\n#import \"RCTModuleData.h\"\n#import \"RCTProfile.h\"\n\n#define RCTAssertRunLoop() \\\n  RCTAssert(_runLoop == [NSRunLoop currentRunLoop], \\\n  @\"This method must be called on the CADisplayLink run loop\")\n\n@implementation RCTDisplayLink\n{\n  NSTimer * _jsTimer;\n  NSMutableSet<RCTModuleData *> *_frameUpdateObservers;\n  NSRunLoop *_runLoop;\n  NSDate *_pauseStart;\n  NSDate *_previousFireDate;\n}\n\n- (instancetype)init\n{\n  if ((self = [super init])) {\n    _frameUpdateObservers = [NSMutableSet new];\n    _jsTimer = [NSTimer\n                   timerWithTimeInterval:RCT_TIME_PER_FRAME\n                   target:self\n                   selector:@selector(_jsThreadUpdate:)\n                   userInfo:nil\n                   repeats:YES];\n  }\n\n  return self;\n}\n\n- (void)registerModuleForFrameUpdates:(id<RCTBridgeModule>)module\n                       withModuleData:(RCTModuleData *)moduleData\n{\n  if (![moduleData.moduleClass conformsToProtocol:@protocol(RCTFrameUpdateObserver)] ||\n      [_frameUpdateObservers containsObject:moduleData]) {\n    return;\n  }\n\n  [_frameUpdateObservers addObject:moduleData];\n\n  // Don't access the module instance via moduleData, as this will cause deadlock\n  id<RCTFrameUpdateObserver> observer = (id<RCTFrameUpdateObserver>)module;\n  __weak typeof(self) weakSelf = self;\n  observer.pauseCallback = ^{\n    typeof(self) strongSelf = weakSelf;\n    if (!strongSelf) {\n      return;\n    }\n\n    CFRunLoopRef cfRunLoop = [strongSelf->_runLoop getCFRunLoop];\n    if (!cfRunLoop) {\n      return;\n    }\n\n    if ([NSRunLoop currentRunLoop] == strongSelf->_runLoop) {\n      [weakSelf updateJSDisplayLinkState];\n    } else {\n      CFRunLoopPerformBlock(cfRunLoop, kCFRunLoopDefaultMode, ^{\n        [weakSelf updateJSDisplayLinkState];\n      });\n      CFRunLoopWakeUp(cfRunLoop);\n    }\n  };\n\n  // Assuming we're paused right now, we only need to update the display link's state\n  // when the new observer is not paused. If it not paused, the observer will immediately\n  // start receiving updates anyway.\n  if (![observer isPaused] && _runLoop) {\n    CFRunLoopPerformBlock([_runLoop getCFRunLoop], kCFRunLoopDefaultMode, ^{\n      [self updateJSDisplayLinkState];\n    });\n  }\n}\n\n- (void)addToRunLoop:(NSRunLoop *)runLoop\n{\n  _runLoop = runLoop;\n  [_runLoop addTimer:_jsTimer forMode:NSRunLoopCommonModes];\n}\n\n- (void)invalidate\n{\n  [_jsTimer invalidate];\n}\n\n- (void)dispatchBlock:(dispatch_block_t)block\n                queue:(dispatch_queue_t)queue\n{\n  if (queue == RCTJSThread) {\n    block();\n  } else if (queue) {\n    dispatch_async(queue, block);\n  }\n}\n\n- (void)_jsThreadUpdate:(__unused id)sender\n{\n  RCTAssertRunLoop();\n\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"-[RCTDisplayLink _jsThreadUpdate:]\", nil);\n\n  RCTFrameUpdate *frameUpdate = [[RCTFrameUpdate alloc] initWithTimer:_jsTimer];\n  for (RCTModuleData *moduleData in _frameUpdateObservers) {\n    id<RCTFrameUpdateObserver> observer = (id<RCTFrameUpdateObserver>)moduleData.instance;\n    if (!observer.paused) {\n      RCTProfileBeginFlowEvent();\n\n      [self dispatchBlock:^{\n        RCTProfileEndFlowEvent();\n        [observer didUpdateFrame:frameUpdate];\n      } queue:moduleData.methodQueue];\n    }\n  }\n\n  [self updateJSDisplayLinkState];\n\n  RCTProfileImmediateEvent(RCTProfileTagAlways, @\"JS Thread Tick\", CACurrentMediaTime(), 'g');\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"objc_call\");\n}\n\n-(void)pauseTimer\n{\n  _pauseStart = [NSDate dateWithTimeIntervalSinceNow:0];\n  _previousFireDate = [_jsTimer fireDate];\n  [_jsTimer setFireDate:[NSDate distantFuture]];\n}\n\n-(void)resumeTimer\n{\n  float pauseTime = -1 * [_pauseStart timeIntervalSinceNow];\n  [_jsTimer setFireDate:[_previousFireDate initWithTimeInterval:pauseTime sinceDate:_previousFireDate]];\n}\n\n- (void)updateJSDisplayLinkState\n{\n  RCTAssertRunLoop();\n\n  BOOL pauseDisplayLink = YES;\n  for (RCTModuleData *moduleData in _frameUpdateObservers) {\n    id<RCTFrameUpdateObserver> observer = (id<RCTFrameUpdateObserver>)moduleData.instance;\n    if (!observer.paused) {\n      pauseDisplayLink = NO;\n      break;\n    }\n  }\n  // TODO: investigate pausing / resuming\n//  if (pauseDisplayLink) {\n//    [self pauseTimer];\n//  } else {\n//    [self resumeTimer];\n//  }\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTErrorCustomizer.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n@class RCTErrorInfo;\n\n/**\n * Provides an interface to customize React Native error messages and stack\n * traces from exceptions.\n */\n@protocol RCTErrorCustomizer <NSObject>\n\n/**\n * Customizes the given error, returning the passed info argument if no\n * customization is required.\n */\n- (nonnull RCTErrorInfo *)customizeErrorInfo:(nonnull RCTErrorInfo *)info;\n@end\n"
  },
  {
    "path": "React/Base/RCTErrorInfo.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n@class RCTJSStackFrame;\n\n/**\n * An ObjC wrapper for React Native errors.\n */\n@interface RCTErrorInfo : NSObject\n@property (nonatomic, copy, readonly) NSString *errorMessage;\n@property (nonatomic, copy, readonly) NSArray<RCTJSStackFrame *> *stack;\n\n\n- (instancetype)initWithErrorMessage:(NSString *)errorMessage\n                               stack:(NSArray<RCTJSStackFrame *> *)stack;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTErrorInfo.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTErrorInfo.h\"\n\n#import \"RCTJSStackFrame.h\"\n\n@implementation RCTErrorInfo\n\n- (instancetype)initWithErrorMessage:(NSString *)errorMessage\n                               stack:(NSArray<RCTJSStackFrame *> *)stack {\n  self = [super init];\n  if (self) {\n    _errorMessage = [errorMessage copy];\n    _stack = [stack copy];\n  }\n  return self;\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTEventDispatcher.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBridge.h>\n\ntypedef NS_ENUM(NSInteger, RCTTextEventType)\n{\n  RCTTextEventTypeFocus,\n  RCTTextEventTypeBlur,\n  RCTTextEventTypeChange,\n  RCTTextEventTypeSubmit,\n  RCTTextEventTypeEnd,\n  RCTTextEventTypeKeyPress\n};\n\n/**\n * The threshold at which text inputs will start warning that the JS thread\n * has fallen behind (resulting in poor input performance, missed keys, etc.)\n */\nRCT_EXTERN const NSInteger RCTTextUpdateLagWarningThreshold;\n\n/**\n * Takes an input event name and normalizes it to the form that is required\n * by the events system (currently that means starting with the \"top\" prefix,\n * but that's an implementation detail that may change in future).\n */\nRCT_EXTERN NSString *RCTNormalizeInputEventName(NSString *eventName);\n\n@protocol RCTEvent <NSObject>\n@required\n\n@property (nonatomic, strong, readonly) NSNumber *viewTag;\n@property (nonatomic, copy, readonly) NSString *eventName;\n@property (nonatomic, assign, readonly) uint16_t coalescingKey;\n\n- (BOOL)canCoalesce;\n- (id<RCTEvent>)coalesceWithEvent:(id<RCTEvent>)newEvent;\n\n// used directly for doing a JS call\n+ (NSString *)moduleDotMethod;\n// must contain only JSON compatible values\n- (NSArray *)arguments;\n\n@end\n\n/**\n * This protocol allows observing events dispatched by RCTEventDispatcher.\n */\n@protocol RCTEventDispatcherObserver <NSObject>\n\n/**\n * Called before dispatching an event, on the same thread the event was\n * dispatched from.\n */\n- (void)eventDispatcherWillDispatchEvent:(id<RCTEvent>)event;\n\n@end\n\n\n/**\n * This class wraps the -[RCTBridge enqueueJSCall:args:] method, and\n * provides some convenience methods for generating event calls.\n */\n@interface RCTEventDispatcher : NSObject <RCTBridgeModule>\n\n/**\n * Deprecated, do not use.\n */\n- (void)sendAppEventWithName:(NSString *)name body:(id)body\n__deprecated_msg(\"Subclass RCTEventEmitter instead\");\n\n/**\n * Deprecated, do not use.\n */\n- (void)sendDeviceEventWithName:(NSString *)name body:(id)body\n__deprecated_msg(\"Subclass RCTEventEmitter instead\");\n\n/**\n * Deprecated, do not use.\n */\n- (void)sendInputEventWithName:(NSString *)name body:(NSDictionary *)body\n__deprecated_msg(\"Use RCTDirectEventBlock or RCTBubblingEventBlock instead\");\n\n/**\n * Send a text input/focus event. For internal use only.\n */\n- (void)sendTextEventWithType:(RCTTextEventType)type\n                     reactTag:(NSNumber *)reactTag\n                         text:(NSString *)text\n                          key:(NSString *)key\n                   eventCount:(NSInteger)eventCount;\n\n/**\n * Send a pre-prepared event object.\n *\n * If the event can be coalesced it is added to a pool of events that are sent at the beginning of the next js frame.\n * Otherwise if the event cannot be coalesced we first flush the pool of coalesced events and the new event after that.\n *\n * Why it works this way?\n * Making sure js gets events in the right order is crucial for correctly interpreting gestures.\n * Unfortunately we cannot emit all events as they come. If we would do that we would have to emit scroll and touch moved event on every frame,\n * which is too much data to transfer and process on older devices. This is especially bad when js starts lagging behind main thread.\n */\n- (void)sendEvent:(id<RCTEvent>)event;\n\n/**\n * Add an event dispatcher observer.\n */\n- (void)addDispatchObserver:(id<RCTEventDispatcherObserver>)observer;\n\n/**\n * Remove an event dispatcher observer.\n */\n- (void)removeDispatchObserver:(id<RCTEventDispatcherObserver>)observer;\n\n@end\n\n@interface RCTBridge (RCTEventDispatcher)\n\n- (RCTEventDispatcher *)eventDispatcher;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTEventDispatcher.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTEventDispatcher.h\"\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge.h\"\n#import \"RCTBridge+Private.h\"\n#import \"RCTUtils.h\"\n#import \"RCTProfile.h\"\n\nconst NSInteger RCTTextUpdateLagWarningThreshold = 3;\n\nNSString *RCTNormalizeInputEventName(NSString *eventName)\n{\n  if ([eventName hasPrefix:@\"on\"]) {\n    eventName = [eventName stringByReplacingCharactersInRange:(NSRange){0, 2} withString:@\"top\"];\n  } else if (![eventName hasPrefix:@\"top\"]) {\n    eventName = [[@\"top\" stringByAppendingString:[eventName substringToIndex:1].uppercaseString]\n                 stringByAppendingString:[eventName substringFromIndex:1]];\n  }\n  return eventName;\n}\n\nstatic NSNumber *RCTGetEventID(id<RCTEvent> event)\n{\n  return @(\n    event.viewTag.intValue |\n    (((uint64_t)event.eventName.hash & 0xFFFF) << 32) |\n    (((uint64_t)event.coalescingKey) << 48)\n  );\n}\n\n@implementation RCTEventDispatcher\n{\n  // We need this lock to protect access to _events, _eventQueue and _eventsDispatchScheduled. It's filled in on main thread and consumed on js thread.\n  NSLock *_eventQueueLock;\n  // We have this id -> event mapping so we coalesce effectively.\n  NSMutableDictionary<NSNumber *, id<RCTEvent>> *_events;\n  // This array contains ids of events in order they come in, so we can emit them to JS in the exact same order.\n  NSMutableArray<NSNumber *> *_eventQueue;\n  BOOL _eventsDispatchScheduled;\n  NSHashTable<id<RCTEventDispatcherObserver>> *_observers;\n  NSLock *_observersLock;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  _bridge = bridge;\n  _events = [NSMutableDictionary new];\n  _eventQueue = [NSMutableArray new];\n  _eventQueueLock = [NSLock new];\n  _eventsDispatchScheduled = NO;\n  _observers = [NSHashTable weakObjectsHashTable];\n  _observersLock = [NSLock new];\n}\n\n- (void)sendAppEventWithName:(NSString *)name body:(id)body\n{\n  [_bridge enqueueJSCall:@\"RCTNativeAppEventEmitter\"\n                  method:@\"emit\"\n                    args:body ? @[name, body] : @[name]\n              completion:NULL];\n}\n\n- (void)sendDeviceEventWithName:(NSString *)name body:(id)body\n{\n  [_bridge enqueueJSCall:@\"RCTDeviceEventEmitter\"\n                  method:@\"emit\"\n                    args:body ? @[name, body] : @[name]\n              completion:NULL];\n}\n\n- (void)sendInputEventWithName:(NSString *)name body:(NSDictionary *)body\n{\n  if (RCT_DEBUG) {\n    RCTAssert([body[@\"target\"] isKindOfClass:[NSNumber class]],\n      @\"Event body dictionary must include a 'target' property containing a React tag\");\n  }\n\n  name = RCTNormalizeInputEventName(name);\n  [_bridge enqueueJSCall:@\"RCTEventEmitter\"\n                  method:@\"receiveEvent\"\n                    args:body ? @[body[@\"target\"], name, body] : @[body[@\"target\"], name]\n              completion:NULL];\n}\n\n- (void)sendTextEventWithType:(RCTTextEventType)type\n                     reactTag:(NSNumber *)reactTag\n                         text:(NSString *)text\n                          key:(NSString *)key\n                   eventCount:(NSInteger)eventCount\n{\n  static NSString *events[] = {\n    @\"focus\",\n    @\"blur\",\n    @\"change\",\n    @\"submitEditing\",\n    @\"endEditing\",\n    @\"keyPress\"\n  };\n\n  NSMutableDictionary *body = [[NSMutableDictionary alloc] initWithDictionary:@{\n    @\"eventCount\": @(eventCount),\n    @\"target\": reactTag\n  }];\n\n  if (text) {\n    body[@\"text\"] = text;\n  }\n\n  if (key) {\n    if (key.length == 0) {\n      key = @\"Backspace\"; // backspace\n    } else {\n      switch ([key characterAtIndex:0]) {\n        case '\\t':\n          key = @\"Tab\";\n          break;\n        case '\\n':\n          key = @\"Enter\";\n        default:\n          break;\n      }\n    }\n    body[@\"key\"] = key;\n  }\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n  [self sendInputEventWithName:events[type] body:body];\n#pragma clang diagnostic pop\n}\n\n- (void)sendEvent:(id<RCTEvent>)event\n{\n  [_observersLock lock];\n\n  for (id<RCTEventDispatcherObserver> observer in _observers) {\n    [observer eventDispatcherWillDispatchEvent:event];\n  }\n\n  [_observersLock unlock];\n\n  [_eventQueueLock lock];\n\n  NSNumber *eventID = RCTGetEventID(event);\n\n  id<RCTEvent> previousEvent = _events[eventID];\n  if (previousEvent) {\n    RCTAssert([event canCoalesce], @\"Got event %@ which cannot be coalesced, but has the same eventID %@ as the previous event %@\", event, eventID, previousEvent);\n    event = [previousEvent coalesceWithEvent:event];\n  } else {\n    [_eventQueue addObject:eventID];\n  }\n  _events[eventID] = event;\n\n  BOOL scheduleEventsDispatch = NO;\n  if (!_eventsDispatchScheduled) {\n    _eventsDispatchScheduled = YES;\n    scheduleEventsDispatch = YES;\n  }\n\n  // We have to release the lock before dispatching block with events,\n  // since dispatchBlock: can be executed synchronously on the same queue.\n  // (This is happening when chrome debugging is turned on.)\n  [_eventQueueLock unlock];\n\n  if (scheduleEventsDispatch) {\n    [_bridge dispatchBlock:^{\n      [self flushEventsQueue];\n    } queue:RCTJSThread];\n  }\n}\n\n- (void)addDispatchObserver:(id<RCTEventDispatcherObserver>)observer\n{\n  [_observersLock lock];\n  [_observers addObject:observer];\n  [_observersLock unlock];\n}\n\n- (void)removeDispatchObserver:(id<RCTEventDispatcherObserver>)observer\n{\n  [_observersLock lock];\n  [_observers removeObject:observer];\n  [_observersLock unlock];\n}\n\n- (void)dispatchEvent:(id<RCTEvent>)event\n{\n  [_bridge enqueueJSCall:[[event class] moduleDotMethod] args:[event arguments]];\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  return RCTJSThread;\n}\n\n// js thread only (which suprisingly can be the main thread, depends on used JS executor)\n- (void)flushEventsQueue\n{\n  [_eventQueueLock lock];\n  NSDictionary *events = _events;\n  _events = [NSMutableDictionary new];\n  NSMutableArray *eventQueue = _eventQueue;\n  _eventQueue = [NSMutableArray new];\n  _eventsDispatchScheduled = NO;\n  [_eventQueueLock unlock];\n\n  for (NSNumber *eventId in eventQueue) {\n    [self dispatchEvent:events[eventId]];\n  }\n}\n\n@end\n\n@implementation RCTBridge (RCTEventDispatcher)\n\n- (RCTEventDispatcher *)eventDispatcher\n{\n  return [self moduleForClass:[RCTEventDispatcher class]];\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTFrameUpdate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n#import \"AppKit/AppKit.h\"\n\n//@class CVDisplayLink;\n\n/**\n * Interface containing the information about the last screen refresh.\n */\n@interface RCTFrameUpdate : NSObject\n\n/**\n * Timestamp for the actual screen refresh\n */\n@property (nonatomic, readonly) CFTimeInterval timestamp;\n\n/**\n * Time since the last frame update ( >= 16.6ms )\n */\n@property (nonatomic, readonly) CFTimeInterval deltaTime;\n\n//- (instancetype)initWithDisplayLink:(CVDisplayLinkRef)displayLink NS_DESIGNATED_INITIALIZER;\n- (instancetype)initWithTimer:(NSTimer*)timer NS_DESIGNATED_INITIALIZER;\n\n@end\n\n/**\n * Protocol that must be implemented for subscribing to display refreshes (DisplayLink updates)\n */\n@protocol RCTFrameUpdateObserver <NSObject>\n\n/**\n * Method called on every screen refresh (if paused != YES)\n */\n- (void)didUpdateFrame:(RCTFrameUpdate *)update;\n\n/**\n * Synthesize and set to true to pause the calls to -[didUpdateFrame:]\n */\n@property (nonatomic, readonly, getter=isPaused) BOOL paused;\n\n/**\n * Callback for pause/resume observer.\n * Observer should call it when paused property is changed.\n */\n@property (nonatomic, copy) dispatch_block_t pauseCallback;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTFrameUpdate.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <QuartzCore/CVDisplayLink.h>\n#import <Foundation/Foundation.h>\n#import \"RCTFrameUpdate.h\"\n\n#import \"RCTUtils.h\"\n#import \"AppKit/AppKit.h\"\n\n@implementation RCTFrameUpdate\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (instancetype)initWithTimer:(NSTimer *)timer\n{\n  if ((self = [super init])) {\n    _timestamp = timer.fireDate.timeIntervalSince1970;\n    _deltaTime = timer.timeInterval;\n  }\n  return self;\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTImageSource.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTConvert.h>\n\n/**\n * Object containing an image URL and associated metadata.\n */\n@interface RCTImageSource : NSObject\n\n@property (nonatomic, copy, readonly) NSURLRequest *request;\n@property (nonatomic, assign, readonly) CGSize size;\n@property (nonatomic, assign, readonly) CGFloat scale;\n\n/**\n * Create a new image source object.\n * Pass a size of CGSizeZero if you do not know or wish to specify the image\n * size. Pass a scale of zero if you do not know or wish to specify the scale.\n */\n- (instancetype)initWithURLRequest:(NSURLRequest *)request\n                              size:(CGSize)size\n                             scale:(CGFloat)scale;\n\n/**\n * Create a copy of the image source with the specified size and scale.\n */\n- (instancetype)imageSourceWithSize:(CGSize)size scale:(CGFloat)scale;\n\n@end\n\n@interface RCTConvert (ImageSource)\n\n+ (RCTImageSource *)RCTImageSource:(id)json;\n+ (NSArray<RCTImageSource *> *)RCTImageSourceArray:(id)json;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTImageSource.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTImageSource.h\"\n#import \"RCTUtils.h\"\n\n@interface RCTImageSource ()\n\n@property (nonatomic, assign) BOOL packagerAsset;\n\n@end\n\n@implementation RCTImageSource\n\n- (instancetype)initWithURLRequest:(NSURLRequest *)request size:(CGSize)size scale:(CGFloat)scale\n{\n  if ((self = [super init])) {\n    _request = [request copy];\n    _size = size;\n    _scale = scale;\n  }\n  return self;\n}\n\n- (instancetype)imageSourceWithSize:(CGSize)size scale:(CGFloat)scale\n{\n  RCTImageSource *imageSource = [[RCTImageSource alloc] initWithURLRequest:_request\n                                                                      size:size\n                                                                     scale:scale];\n  imageSource.packagerAsset = _packagerAsset;\n  return imageSource;\n}\n\n- (BOOL)isEqual:(RCTImageSource *)object\n{\n  if (![object isKindOfClass:[RCTImageSource class]]) {\n    return NO;\n  }\n  return [_request isEqual:object.request] && _scale == object.scale &&\n  (CGSizeEqualToSize(_size, object.size) || CGSizeEqualToSize(object.size, CGSizeZero));\n}\n\n- (NSString *)description\n{\n  return [NSString stringWithFormat:@\"<RCTImageSource: %p URL=%@, size=%@, scale=%0.f>\",\n          self, _request.URL, NSStringFromSize(_size), _scale];\n}\n\n@end\n\n@implementation RCTConvert (ImageSource)\n\n+ (RCTImageSource *)RCTImageSource:(id)json\n{\n  if (!json) {\n    return nil;\n  }\n\n  NSURLRequest *request;\n  CGSize size = CGSizeZero;\n  CGFloat scale = 1.0;\n  BOOL packagerAsset = NO;\n  if ([json isKindOfClass:[NSDictionary class]]) {\n    if (!(request = [self NSURLRequest:json])) {\n      return nil;\n    }\n    size = [self CGSize:json];\n    scale = [self CGFloat:json[@\"scale\"]] ?: [self BOOL:json[@\"deprecated\"]] ? 0.0 : 1.0;\n    packagerAsset = [self BOOL:json[@\"__packager_asset\"]];\n  } else if ([json isKindOfClass:[NSString class]]) {\n    request = [self NSURLRequest:json];\n  } else {\n    RCTLogConvertError(json, @\"an image. Did you forget to call resolveAssetSource() on the JS side?\");\n    return nil;\n  }\n\n  RCTImageSource *imageSource = [[RCTImageSource alloc] initWithURLRequest:request\n                                                                      size:size\n                                                                     scale:scale];\n  imageSource.packagerAsset = packagerAsset;\n  return imageSource;\n}\n\nRCT_ARRAY_CONVERTER(RCTImageSource)\n\n@end\n"
  },
  {
    "path": "React/Base/RCTInvalidating.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n@protocol RCTInvalidating <NSObject>\n\n- (void)invalidate;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTJSCErrorHandling.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <JavaScriptCore/JavaScriptCore.h>\n\n#import <React/RCTDefines.h>\n\n/**\n Translates a given exception into an NSError.\n\n @param exception The JavaScript exception object to translate into an NSError. This must be\n a JavaScript Error object, otherwise no stack trace information will be available.\n\n @return The translated NSError object\n\n - The JS exception's name property is incorporated in the NSError's localized description\n - The JS exception's message property is the NSError's failure reason\n - The JS exception's unsymbolicated stack trace is available via the NSError userInfo's RCTJSExceptionUnsymbolicatedStackTraceKey\n */\nRCT_EXTERN NSError *RCTNSErrorFromJSError(JSValue *exception);\n\n/**\n Translates a given exception into an NSError.\n\n @see RCTNSErrorFromJSError for details\n */\nRCT_EXTERN NSError *RCTNSErrorFromJSErrorRef(JSValueRef exceptionRef, JSGlobalContextRef ctx);\n"
  },
  {
    "path": "React/Base/RCTJSCErrorHandling.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"RCTJSCErrorHandling.h\"\n\n#import <jschelpers/JavaScriptCore.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTJSStackFrame.h\"\n#import \"RCTLog.h\"\n\nNSString *const RCTJSExceptionUnsymbolicatedStackTraceKey = @\"RCTJSExceptionUnsymbolicatedStackTraceKey\";\n\nNSError *RCTNSErrorFromJSError(JSValue *exception)\n{\n  NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];\n  userInfo[NSLocalizedDescriptionKey] = [NSString stringWithFormat:@\"Unhandled JS Exception: %@\", [exception[@\"name\"] toString] ?: @\"Unknown\"];\n  NSString *const exceptionMessage = [exception[@\"message\"] toString];\n  if ([exceptionMessage length]) {\n    userInfo[NSLocalizedFailureReasonErrorKey] = exceptionMessage;\n  }\n  NSString *const stack = [exception[@\"stack\"] toString];\n  if ([@\"undefined\" isEqualToString:stack]) {\n    RCTLogWarn(@\"Couldn't get stack trace for %@:%@\", exception[@\"sourceURL\"], exception[@\"line\"]);\n  } else if ([stack length]) {\n    NSArray<RCTJSStackFrame *> *const unsymbolicatedFrames = [RCTJSStackFrame stackFramesWithLines:stack];\n    userInfo[RCTJSStackTraceKey] = unsymbolicatedFrames;\n  }\n  return [NSError errorWithDomain:RCTErrorDomain code:1 userInfo:userInfo];\n}\n\nNSError *RCTNSErrorFromJSErrorRef(JSValueRef exceptionRef, JSGlobalContextRef ctx)\n{\n  JSContext *context = [JSC_JSContext(ctx) contextWithJSGlobalContextRef:ctx];\n  JSValue *exception = [JSC_JSValue(ctx) valueWithJSValueRef:exceptionRef inContext:context];\n  return RCTNSErrorFromJSError(exception);\n}\n"
  },
  {
    "path": "React/Base/RCTJSStackFrame.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n@interface RCTJSStackFrame : NSObject\n\n@property (nonatomic, copy, readonly) NSString *methodName;\n@property (nonatomic, copy, readonly) NSString *file;\n@property (nonatomic, readonly) NSInteger lineNumber;\n@property (nonatomic, readonly) NSInteger column;\n\n- (instancetype)initWithMethodName:(NSString *)methodName file:(NSString *)file lineNumber:(NSInteger)lineNumber column:(NSInteger)column;\n- (NSDictionary *)toDictionary;\n\n+ (instancetype)stackFrameWithLine:(NSString *)line;\n+ (instancetype)stackFrameWithDictionary:(NSDictionary *)dict;\n+ (NSArray<RCTJSStackFrame *> *)stackFramesWithLines:(NSString *)lines;\n+ (NSArray<RCTJSStackFrame *> *)stackFramesWithDictionaries:(NSArray<NSDictionary *> *)dicts;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTJSStackFrame.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTJSStackFrame.h\"\n\n#import \"RCTLog.h\"\n#import \"RCTUtils.h\"\n\nstatic NSRegularExpression *RCTJSStackFrameRegex()\n{\n  static dispatch_once_t onceToken;\n  static NSRegularExpression *_regex;\n  dispatch_once(&onceToken, ^{\n    NSError *regexError;\n    _regex = [NSRegularExpression regularExpressionWithPattern:@\"^(?:([^@]+)@)?(.*):(\\\\d+):(\\\\d+)$\" options:0 error:&regexError];\n    if (regexError) {\n      RCTLogError(@\"Failed to build regex: %@\", [regexError localizedDescription]);\n    }\n  });\n  return _regex;\n}\n\n@implementation RCTJSStackFrame\n\n- (instancetype)initWithMethodName:(NSString *)methodName file:(NSString *)file lineNumber:(NSInteger)lineNumber column:(NSInteger)column\n{\n  if (self = [super init]) {\n    _methodName = methodName;\n    _file = file;\n    _lineNumber = lineNumber;\n    _column = column;\n  }\n  return self;\n}\n\n- (NSDictionary *)toDictionary\n{\n  return @{\n     @\"methodName\": RCTNullIfNil(self.methodName),\n     @\"file\": RCTNullIfNil(self.file),\n     @\"lineNumber\": @(self.lineNumber),\n     @\"column\": @(self.column)\n  };\n}\n\n+ (instancetype)stackFrameWithLine:(NSString *)line\n{\n  NSTextCheckingResult *match = [RCTJSStackFrameRegex() firstMatchInString:line options:0 range:NSMakeRange(0, line.length)];\n  if (!match) {\n    return nil;\n  }\n\n  // methodName may not be present for e.g. anonymous functions\n  const NSRange methodNameRange = [match rangeAtIndex:1];\n  NSString *methodName = methodNameRange.location == NSNotFound ? nil : [line substringWithRange:methodNameRange];\n  NSString *file = [line substringWithRange:[match rangeAtIndex:2]];\n  NSString *lineNumber = [line substringWithRange:[match rangeAtIndex:3]];\n  NSString *column = [line substringWithRange:[match rangeAtIndex:4]];\n\n  return [[self alloc] initWithMethodName:methodName\n                                     file:file\n                               lineNumber:[lineNumber integerValue]\n                                   column:[column integerValue]];\n}\n\n+ (instancetype)stackFrameWithDictionary:(NSDictionary *)dict\n{\n  return [[self alloc] initWithMethodName:RCTNilIfNull(dict[@\"methodName\"])\n                                     file:dict[@\"file\"]\n                               lineNumber:[RCTNilIfNull(dict[@\"lineNumber\"]) integerValue]\n                                   column:[RCTNilIfNull(dict[@\"column\"]) integerValue]];\n}\n\n+ (NSArray<RCTJSStackFrame *> *)stackFramesWithLines:(NSString *)lines\n{\n  NSMutableArray *stack = [NSMutableArray new];\n  for (NSString *line in [lines componentsSeparatedByString:@\"\\n\"]) {\n    RCTJSStackFrame *frame = [self stackFrameWithLine:line];\n    if (frame) {\n      [stack addObject:frame];\n    }\n  }\n  return stack;\n}\n\n+ (NSArray<RCTJSStackFrame *> *)stackFramesWithDictionaries:(NSArray<NSDictionary *> *)dicts\n{\n  NSMutableArray *stack = [NSMutableArray new];\n  for (NSDictionary *dict in dicts) {\n    RCTJSStackFrame *frame = [self stackFrameWithDictionary:dict];\n    if (frame) {\n      [stack addObject:frame];\n    }\n  }\n  return stack;\n}\n\n- (NSString *)description {\n  return [NSString stringWithFormat:@\"<%@: %p method name: %@; file name: %@; line: %ld; column: %ld>\",\n          self.class,\n          self,\n          self.methodName,\n          self.file,\n          (long)self.lineNumber,\n          (long)self.column];\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTJavaScriptExecutor.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <objc/runtime.h>\n\n#import <JavaScriptCore/JavaScriptCore.h>\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTInvalidating.h>\n\ntypedef void (^RCTJavaScriptCompleteBlock)(NSError *error);\ntypedef void (^RCTJavaScriptCallback)(id result, NSError *error);\n\n/**\n * Abstracts away a JavaScript execution context - we may be running code in a\n * web view (for debugging purposes), or may be running code in a `JSContext`.\n */\n@protocol RCTJavaScriptExecutor <RCTInvalidating, RCTBridgeModule>\n\n/**\n * Used to set up the executor after the bridge has been fully initialized.\n * Do any expensive setup in this method instead of `-init`.\n */\n- (void)setUp;\n\n/**\n * Whether the executor has been invalidated\n */\n@property (nonatomic, readonly, getter=isValid) BOOL valid;\n\n/**\n * Executes BatchedBridge.flushedQueue on JS thread and calls the given callback\n * with JSValue, containing the next queue, and JSContext.\n */\n- (void)flushedQueue:(RCTJavaScriptCallback)onComplete;\n\n/**\n * Executes BatchedBridge.callFunctionReturnFlushedQueue with the module name,\n * method name and optional additional arguments on the JS thread and calls the\n * given callback with JSValue, containing the next queue, and JSContext.\n */\n- (void)callFunctionOnModule:(NSString *)module\n                      method:(NSString *)method\n                   arguments:(NSArray *)args\n                    callback:(RCTJavaScriptCallback)onComplete;\n\n/**\n * Executes BatchedBridge.invokeCallbackAndReturnFlushedQueue with the cbID,\n * and optional additional arguments on the JS thread and calls the\n * given callback with JSValue, containing the next queue, and JSContext.\n */\n- (void)invokeCallbackID:(NSNumber *)cbID\n               arguments:(NSArray *)args\n                callback:(RCTJavaScriptCallback)onComplete;\n\n/**\n * Runs an application script, and notifies of the script load being complete via `onComplete`.\n */\n- (void)executeApplicationScript:(NSData *)script\n                       sourceURL:(NSURL *)sourceURL\n                      onComplete:(RCTJavaScriptCompleteBlock)onComplete;\n\n- (void)injectJSONText:(NSString *)script\n   asGlobalObjectNamed:(NSString *)objectName\n              callback:(RCTJavaScriptCompleteBlock)onComplete;\n\n/**\n * Enqueue a block to run in the executors JS thread. Fallback to `dispatch_async`\n * on the main queue if the executor doesn't own a thread.\n */\n- (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block;\n\n/**\n * Special case for Timers + ContextExecutor - instead of the default\n *   if jsthread then call else dispatch call on jsthread\n * ensure the call is made async on the jsthread\n */\n- (void)executeAsyncBlockOnJavaScriptQueue:(dispatch_block_t)block;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTJavaScriptLoader.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTDefines.h>\n\nextern NSString *const RCTJavaScriptLoaderErrorDomain;\n\nNS_ENUM(NSInteger) {\n  RCTJavaScriptLoaderErrorNoScriptURL = 1,\n  RCTJavaScriptLoaderErrorFailedOpeningFile = 2,\n  RCTJavaScriptLoaderErrorFailedReadingFile = 3,\n  RCTJavaScriptLoaderErrorFailedStatingFile = 3,\n  RCTJavaScriptLoaderErrorURLLoadFailed = 3,\n  RCTJavaScriptLoaderErrorBCVersion = 4,\n  RCTJavaScriptLoaderErrorBCNotSupported = 4,\n\n  RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously = 1000,\n};\n\nNS_ENUM(NSInteger) {\n  RCTSourceFilesChangedCountNotBuiltByBundler = -2,\n  RCTSourceFilesChangedCountRebuiltFromScratch = -1,\n};\n\n@interface RCTLoadingProgress : NSObject\n\n@property (nonatomic, copy) NSString *status;\n@property (strong, nonatomic) NSNumber *done;\n@property (strong, nonatomic) NSNumber *total;\n\n@end\n\n@interface RCTSource : NSObject\n\n/**\n * URL of the source object.\n */\n@property (strong, nonatomic, readonly) NSURL *url;\n\n/**\n * JS source (or simply the binary header in the case of a RAM bundle).\n */\n@property (strong, nonatomic, readonly) NSData *data;\n\n/**\n * Length of the entire JS bundle. Note that self.length != self.data.length in the case of certain bundle formats. For\n * instance, when using RAM bundles:\n *\n *  - self.data will point to the bundle header\n *  - self.data.length is the length of the bundle header, i.e. sizeof(facebook::react::BundleHeader)\n *  - self.length is the length of the entire bundle file (header + contents)\n */\n@property (nonatomic, readonly) NSUInteger length;\n\n/**\n * Returns number of files changed when building this bundle:\n *\n *  - RCTSourceFilesChangedCountNotBuiltByBundler if the source wasn't built by the bundler (e.g. read from disk)\n *  - RCTSourceFilesChangedCountRebuiltFromScratch if the source was rebuilt from scratch by the bundler\n *  - Otherwise, the number of files changed when incrementally rebuilding the source\n */\n@property (nonatomic, readonly) NSInteger filesChangedCount;\n\n@end\n\ntypedef void (^RCTSourceLoadProgressBlock)(RCTLoadingProgress *progressData);\ntypedef void (^RCTSourceLoadBlock)(NSError *error, RCTSource *source);\n\n@interface RCTJavaScriptLoader : NSObject\n\n+ (void)loadBundleAtURL:(NSURL *)scriptURL onProgress:(RCTSourceLoadProgressBlock)onProgress onComplete:(RCTSourceLoadBlock)onComplete;\n\n/**\n * @experimental\n * Attempts to synchronously load the script at the given URL. The following two conditions must be met:\n *   1. It must be a file URL.\n *   2. It must not point to a text/javascript file.\n * If the URL does not meet those conditions, this method will return nil and supply an error with the domain\n * RCTJavaScriptLoaderErrorDomain and the code RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously.\n */\n+ (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL\n                               runtimeBCVersion:(int32_t)runtimeBCVersion\n                                   sourceLength:(int64_t *)sourceLength\n                                          error:(NSError **)error;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTJavaScriptLoader.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTJavaScriptLoader.h\"\n\n#import <sys/stat.h>\n\n#import <cxxreact/JSBundleType.h>\n#import <jschelpers/JavaScriptCore.h>\n\n#import \"RCTBridge.h\"\n#import \"RCTConvert.h\"\n#import \"RCTMultipartDataTask.h\"\n#import \"RCTPerformanceLogger.h\"\n#import \"RCTUtils.h\"\n\nNSString *const RCTJavaScriptLoaderErrorDomain = @\"RCTJavaScriptLoaderErrorDomain\";\n\n@interface RCTSource()\n{\n@public\n  NSURL *_url;\n  NSData *_data;\n  NSUInteger _length;\n  NSInteger _filesChangedCount;\n}\n\n@end\n\n@implementation RCTSource\n\nstatic RCTSource *RCTSourceCreate(NSURL *url, NSData *data, int64_t length) NS_RETURNS_RETAINED\n{\n  RCTSource *source = [RCTSource new];\n  source->_url = url;\n  source->_data = data;\n  source->_length = length;\n  source->_filesChangedCount = RCTSourceFilesChangedCountNotBuiltByBundler;\n  return source;\n}\n\n@end\n\n@implementation RCTLoadingProgress\n\n- (NSString *)description\n{\n  NSMutableString *desc = [NSMutableString new];\n  [desc appendString:_status ?: @\"Loading\"];\n\n  if ([_total integerValue] > 0) {\n    [desc appendFormat:@\" %ld%% (%@/%@)\", (long)(100 * [_done integerValue] / [_total integerValue]), _done, _total];\n  }\n  [desc appendString:@\"\\u2026\"];\n  return desc;\n}\n\n@end\n\n@implementation RCTJavaScriptLoader\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n+ (void)loadBundleAtURL:(NSURL *)scriptURL onProgress:(RCTSourceLoadProgressBlock)onProgress onComplete:(RCTSourceLoadBlock)onComplete\n{\n  int64_t sourceLength;\n  NSError *error;\n  NSData *data = [self attemptSynchronousLoadOfBundleAtURL:scriptURL\n                                          runtimeBCVersion:JSNoBytecodeFileFormatVersion\n                                              sourceLength:&sourceLength\n                                                     error:&error];\n  if (data) {\n    onComplete(nil, RCTSourceCreate(scriptURL, data, sourceLength));\n    return;\n  }\n\n  const BOOL isCannotLoadSyncError =\n  [error.domain isEqualToString:RCTJavaScriptLoaderErrorDomain]\n  && error.code == RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously;\n\n  if (isCannotLoadSyncError) {\n    attemptAsynchronousLoadOfBundleAtURL(scriptURL, onProgress, onComplete);\n  } else {\n    onComplete(error, nil);\n  }\n}\n\n+ (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL\n                               runtimeBCVersion:(int32_t)runtimeBCVersion\n                                   sourceLength:(int64_t *)sourceLength\n                                          error:(NSError **)error\n{\n  NSString *unsanitizedScriptURLString = scriptURL.absoluteString;\n  // Sanitize the script URL\n  scriptURL = sanitizeURL(scriptURL);\n\n  if (!scriptURL) {\n    if (error) {\n      *error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain\n                                   code:RCTJavaScriptLoaderErrorNoScriptURL\n                               userInfo:@{NSLocalizedDescriptionKey:\n                                            [NSString stringWithFormat:@\"No script URL provided. Make sure the packager is \"\n                                             @\"running or you have embedded a JS bundle in your application bundle.\\n\\n\"\n                                             @\"unsanitizedScriptURLString = %@\", unsanitizedScriptURLString]}];\n    }\n    return nil;\n  }\n\n  // Load local script file\n  if (!scriptURL.fileURL) {\n    if (error) {\n      *error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain\n                                   code:RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously\n                               userInfo:@{NSLocalizedDescriptionKey:\n                                            [NSString stringWithFormat:@\"Cannot load %@ URLs synchronously\",\n                                             scriptURL.scheme]}];\n    }\n    return nil;\n  }\n\n  // Load the first 4 bytes to check if the bundle is regular or RAM (\"Random Access Modules\" bundle).\n  // The RAM bundle has a magic number in the 4 first bytes `(0xFB0BD1E5)`.\n  // The benefit of RAM bundle over a regular bundle is that we can lazily inject\n  // modules into JSC as they're required.\n  FILE *bundle = fopen(scriptURL.path.UTF8String, \"r\");\n  if (!bundle) {\n    if (error) {\n      *error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain\n                                   code:RCTJavaScriptLoaderErrorFailedOpeningFile\n                               userInfo:@{NSLocalizedDescriptionKey:\n                                            [NSString stringWithFormat:@\"Error opening bundle %@\", scriptURL.path]}];\n    }\n    return nil;\n  }\n\n  facebook::react::BundleHeader header;\n  size_t readResult = fread(&header, sizeof(header), 1, bundle);\n  fclose(bundle);\n  if (readResult != 1) {\n    if (error) {\n      *error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain\n                                   code:RCTJavaScriptLoaderErrorFailedReadingFile\n                               userInfo:@{NSLocalizedDescriptionKey:\n                                            [NSString stringWithFormat:@\"Error reading bundle %@\", scriptURL.path]}];\n    }\n    return nil;\n  }\n\n  facebook::react::ScriptTag tag = facebook::react::parseTypeFromHeader(header);\n  switch (tag) {\n  case facebook::react::ScriptTag::RAMBundle:\n    break;\n\n  case facebook::react::ScriptTag::String: {\n#if RCT_ENABLE_INSPECTOR\n    NSData *source = [NSData dataWithContentsOfFile:scriptURL.path\n                                            options:NSDataReadingMappedIfSafe\n                                              error:error];\n    if (sourceLength && source != nil) {\n      *sourceLength = source.length;\n    }\n    return source;\n#else\n    if (error) {\n      *error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain\n                                   code:RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously\n                               userInfo:@{NSLocalizedDescriptionKey:\n                                            @\"Cannot load text/javascript files synchronously\"}];\n    }\n    return nil;\n#endif\n  }\n  case facebook::react::ScriptTag::BCBundle:\n    if (runtimeBCVersion == JSNoBytecodeFileFormatVersion || runtimeBCVersion < 0) {\n      if (error) {\n        *error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain\n                                     code:RCTJavaScriptLoaderErrorBCNotSupported\n                                 userInfo:@{NSLocalizedDescriptionKey:\n                                              @\"Bytecode bundles are not supported by this runtime.\"}];\n      }\n      return nil;\n    }\n    else if ((uint32_t)runtimeBCVersion != header.version) {\n      if (error) {\n        NSString *errDesc =\n          [NSString stringWithFormat:@\"BC Version Mismatch. Expect: %d, Actual: %u\",\n                    runtimeBCVersion, header.version];\n\n        *error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain\n                                     code:RCTJavaScriptLoaderErrorBCVersion\n                                 userInfo:@{NSLocalizedDescriptionKey: errDesc}];\n      }\n      return nil;\n    }\n    break;\n  }\n\n  struct stat statInfo;\n  if (stat(scriptURL.path.UTF8String, &statInfo) != 0) {\n    if (error) {\n      *error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain\n                                   code:RCTJavaScriptLoaderErrorFailedStatingFile\n                               userInfo:@{NSLocalizedDescriptionKey:\n                                            [NSString stringWithFormat:@\"Error stating bundle %@\", scriptURL.path]}];\n    }\n    return nil;\n  }\n  if (sourceLength) {\n    *sourceLength = statInfo.st_size;\n  }\n  return [NSData dataWithBytes:&header length:sizeof(header)];\n}\n\nstatic void parseHeaders(NSDictionary *headers, RCTSource *source) {\n  source->_filesChangedCount = [headers[@\"X-Metro-Files-Changed-Count\"] integerValue];\n}\n\nstatic void attemptAsynchronousLoadOfBundleAtURL(NSURL *scriptURL, RCTSourceLoadProgressBlock onProgress, RCTSourceLoadBlock onComplete)\n{\n  scriptURL = sanitizeURL(scriptURL);\n\n  if (scriptURL.fileURL) {\n    // Reading in a large bundle can be slow. Dispatch to the background queue to do it.\n    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n      NSError *error = nil;\n      NSData *source = [NSData dataWithContentsOfFile:scriptURL.path\n                                              options:NSDataReadingMappedIfSafe\n                                                error:&error];\n      onComplete(error, RCTSourceCreate(scriptURL, source, source.length));\n    });\n    return;\n  }\n\n  RCTMultipartDataTask *task = [[RCTMultipartDataTask alloc] initWithURL:scriptURL partHandler:^(NSInteger statusCode, NSDictionary *headers, NSData *data, NSError *error, BOOL done) {\n    if (!done) {\n      if (onProgress) {\n        onProgress(progressEventFromData(data));\n      }\n      return;\n    }\n\n    // Handle general request errors\n    if (error) {\n      if ([error.domain isEqualToString:NSURLErrorDomain]) {\n        error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain\n                                    code:RCTJavaScriptLoaderErrorURLLoadFailed\n                                userInfo:\n                 @{\n                   NSLocalizedDescriptionKey:\n                     [@\"Could not connect to development server.\\n\\n\"\n                      \"Ensure the following:\\n\"\n                      \"- Node server is running and available on the same network - run 'npm start' from react-native root\\n\"\n                      \"- Node server URL is correctly set in AppDelegate\\n\"\n                      \"- WiFi is enabled and connected to the same network as the Node Server\\n\\n\"\n                      \"URL: \" stringByAppendingString:scriptURL.absoluteString],\n                   NSLocalizedFailureReasonErrorKey: error.localizedDescription,\n                   NSUnderlyingErrorKey: error,\n                   }];\n      }\n      onComplete(error, nil);\n      return;\n    }\n\n    // For multipart responses packager sets X-Http-Status header in case HTTP status code\n    // is different from 200 OK\n    NSString *statusCodeHeader = headers[@\"X-Http-Status\"];\n    if (statusCodeHeader) {\n      statusCode = [statusCodeHeader integerValue];\n    }\n\n    if (statusCode != 200) {\n      error = [NSError errorWithDomain:@\"JSServer\"\n                                  code:statusCode\n                              userInfo:userInfoForRawResponse([[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding])];\n      onComplete(error, nil);\n      return;\n    }\n\n    // Validate that the packager actually returned javascript.\n    NSString *contentType = headers[@\"Content-Type\"];\n    NSString *mimeType = [[contentType componentsSeparatedByString:@\";\"] firstObject];\n    if (![mimeType isEqualToString:@\"application/javascript\"] &&\n        ![mimeType isEqualToString:@\"text/javascript\"]) {\n      NSString *description = [NSString stringWithFormat:@\"Expected MIME-Type to be 'application/javascript' or 'text/javascript', but got '%@'.\", mimeType];\n      error = [NSError errorWithDomain:@\"JSServer\"\n                                  code:NSURLErrorCannotParseResponse\n                              userInfo:@{\n                                         NSLocalizedDescriptionKey: description,\n                                         @\"headers\": headers,\n                                         @\"data\": data\n                                       }];\n      onComplete(error, nil);\n      return;\n    }\n\n    RCTSource *source = RCTSourceCreate(scriptURL, data, data.length);\n    parseHeaders(headers, source);\n    onComplete(nil, source);\n  } progressHandler:^(NSDictionary *headers, NSNumber *loaded, NSNumber *total) {\n    // Only care about download progress events for the javascript bundle part.\n    if ([headers[@\"Content-Type\"] isEqualToString:@\"application/javascript\"]) {\n      onProgress(progressEventFromDownloadProgress(loaded, total));\n    }\n  }];\n\n  [task startTask];\n}\n\nstatic NSURL *sanitizeURL(NSURL *url)\n{\n  // Why we do this is lost to time. We probably shouldn't; passing a valid URL is the caller's responsibility not ours.\n  return [RCTConvert NSURL:url.absoluteString];\n}\n\nstatic RCTLoadingProgress *progressEventFromData(NSData *rawData)\n{\n  NSString *text = [[NSString alloc] initWithData:rawData encoding:NSUTF8StringEncoding];\n  id info = RCTJSONParse(text, nil);\n  if (!info || ![info isKindOfClass:[NSDictionary class]]) {\n    return nil;\n  }\n\n  RCTLoadingProgress *progress = [RCTLoadingProgress new];\n  progress.status = info[@\"status\"];\n  progress.done = info[@\"done\"];\n  progress.total = info[@\"total\"];\n  return progress;\n}\n\nstatic RCTLoadingProgress *progressEventFromDownloadProgress(NSNumber *total, NSNumber *done)\n{\n  RCTLoadingProgress *progress = [RCTLoadingProgress new];\n  progress.status = @\"Downloading JavaScript bundle\";\n  // Progress values are in bytes transform them to kilobytes for smaller numbers.\n  progress.done = done != nil ? @([done integerValue] / 1024) : nil;\n  progress.total = total != nil ? @([total integerValue] / 1024) : nil;\n  return progress;\n}\n\nstatic NSDictionary *userInfoForRawResponse(NSString *rawText)\n{\n  NSDictionary *parsedResponse = RCTJSONParse(rawText, nil);\n  if (![parsedResponse isKindOfClass:[NSDictionary class]]) {\n    return @{NSLocalizedDescriptionKey: rawText};\n  }\n  NSArray *errors = parsedResponse[@\"errors\"];\n  if (![errors isKindOfClass:[NSArray class]]) {\n    return @{NSLocalizedDescriptionKey: rawText};\n  }\n  NSMutableArray<NSDictionary *> *fakeStack = [NSMutableArray new];\n  for (NSDictionary *err in errors) {\n    [fakeStack addObject: @{\n       @\"methodName\": err[@\"description\"] ?: @\"\",\n       @\"file\": err[@\"filename\"] ?: @\"\",\n       @\"lineNumber\": err[@\"lineNumber\"] ?: @0\n    }];\n  }\n  return @{NSLocalizedDescriptionKey: parsedResponse[@\"message\"] ?: @\"No message provided\", @\"stack\": [fakeStack copy]};\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTKeyCommands.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@interface RCTKeyCommands : NSObject\n\n+ (instancetype)sharedInstance;\n\n/**\n * Register a single-press keyboard command.\n */\n- (void)registerKeyCommandWithInput:(NSString *)input\n                      modifierFlags:(NSEventModifierFlags)flags\n                             action:(void (^)(NSEvent *command))block;\n\n/**\n * Unregister a single-press keyboard command.\n */\n- (void)unregisterKeyCommandWithInput:(NSString *)input\n                        modifierFlags:(NSEventModifierFlags)flags;\n\n/**\n * Check if a single-press command is registered.\n */\n- (BOOL)isKeyCommandRegisteredForInput:(NSString *)input\n                         modifierFlags:(NSEventModifierFlags)flags;\n\n/**\n * Register a double-press keyboard command.\n */\n- (void)registerDoublePressKeyCommandWithInput:(NSString *)input\n                      modifierFlags:(NSEventModifierFlags)flags\n                             action:(void (^)(NSEvent *command))block;\n\n/**\n * Unregister a double-press keyboard command.\n */\n- (void)unregisterDoublePressKeyCommandWithInput:(NSString *)input\n                        modifierFlags:(NSEventModifierFlags)flags;\n\n/**\n * Check if a double-press command is registered.\n */\n- (BOOL)isDoublePressKeyCommandRegisteredForInput:(NSString *)input\n                         modifierFlags:(NSEventModifierFlags)flags;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTKeyCommands.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTKeyCommands.h\"\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTDefines.h\"\n#import \"RCTUtils.h\"\n\n#if RCT_DEV\n\n@interface RCTKeyCommand : NSObject <NSCopying>\n\n@property (nonatomic, strong) NSString *keyCommand;\n@property (nonatomic) NSEventModifierFlags modifierFlags;\n@property (nonatomic, copy) void (^block)(NSEvent *);\n\n@end\n\n@implementation RCTKeyCommand\n\n- (instancetype)initWithKeyCommand:(NSString *)keyCommand\n                     modifierFlags:(NSEventModifierFlags)modifierFlags\n                             block:(void (^)(NSEvent *))block\n{\n  if ((self = [super init])) {\n    _keyCommand = keyCommand;\n    _modifierFlags = modifierFlags;\n    _block = block;\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (id)copyWithZone:(__unused NSZone *)zone\n{\n  return self;\n}\n\n- (NSUInteger)hash\n{\n  return _keyCommand.hash ^ _modifierFlags;\n}\n\n- (BOOL)isEqual:(RCTKeyCommand *)object\n{\n  if (![object isKindOfClass:[RCTKeyCommand class]]) {\n    return NO;\n  }\n  return [self matchesInput:object.keyCommand\n                      flags:object.modifierFlags];\n}\n\n- (BOOL)matchesInput:(NSString*)keyCommand flags:(int)flags\n{\n  return [_keyCommand isEqual:keyCommand] && _modifierFlags == flags;\n}\n\n- (NSString *)description\n{\n  return [NSString stringWithFormat:@\"<%@:%p input=\\\"%@\\\" flags=%zd hasBlock=%@>\",\n          [self class], self, _keyCommand, _modifierFlags,\n          _block ? @\"YES\" : @\"NO\"];\n}\n\n@end\n\n@interface RCTKeyCommands ()\n\n@property (nonatomic, strong) NSMutableSet<RCTKeyCommand *> *commands;\n\n@end\n\n\n@implementation NSWindow (RCTKeyCommands)\n\n- (void)keyDown:(NSEvent *)theEvent\n{\n  for (RCTKeyCommand *command in [RCTKeyCommands sharedInstance].commands) {\n    if ([command.keyCommand isEqualToString:theEvent.characters] &&\n        command.modifierFlags == (theEvent.modifierFlags & NSDeviceIndependentModifierFlagsMask)) {\n      if (command.block) {\n        command.block(theEvent);\n      }\n      return;\n    }\n  }\n\n  [super keyDown:theEvent];\n}\n\n@end\n\n@implementation RCTKeyCommands\n\n+ (void)initialize\n{\n\n}\n\n+ (instancetype)sharedInstance\n{\n  static RCTKeyCommands *sharedInstance;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    sharedInstance = [self new];\n  });\n\n  return sharedInstance;\n}\n\n- (instancetype)init\n{\n  if ((self = [super init])) {\n    _commands = [NSMutableSet new];\n  }\n  return self;\n}\n\n- (void)registerKeyCommandWithInput:(NSString *)input\n                      modifierFlags:(NSEventModifierFlags)flags\n                             action:(void (^)(NSEvent *))block\n{\n  RCTAssertMainQueue();\n\n  RCTKeyCommand *keyCommand = [[RCTKeyCommand alloc] initWithKeyCommand:input modifierFlags:flags block:block];\n  [_commands removeObject:keyCommand];\n  [_commands addObject:keyCommand];\n}\n\n- (void)unregisterKeyCommandWithInput:(NSString *)input\n                        modifierFlags:(NSEventModifierFlags)flags\n{\n  RCTAssertMainQueue();\n\n  for (RCTKeyCommand *command in _commands.allObjects) {\n    if ([command matchesInput:input flags:flags]) {\n      [_commands removeObject:command];\n      break;\n    }\n  }\n}\n\n- (BOOL)isKeyCommandRegisteredForInput:(NSString *)input\n                         modifierFlags:(NSEventModifierFlags)flags\n{\n  RCTAssertMainQueue();\n\n  for (RCTKeyCommand *command in _commands) {\n    if ([command matchesInput:input flags:flags]) {\n      return YES;\n    }\n  }\n  return NO;\n}\n\n- (void)registerDoublePressKeyCommandWithInput:(NSString *)input\n                      modifierFlags:(NSEventModifierFlags)flags\n                             action:(void (^)(NSEvent *))block\n{\n  RCTAssertMainQueue();\n\n//  NSEvent *command = [NSEvent keyCommandWithInput:input\n//                                              modifierFlags:flags\n//                                                     action:@selector(RCT_handleDoublePressKeyCommand:)];\n//\n//  RCTKeyCommand *keyCommand = [[RCTKeyCommand alloc] initWithKeyCommand:command block:block];\n//  [_commands removeObject:keyCommand];\n//  [_commands addObject:keyCommand];\n}\n\n- (void)unregisterDoublePressKeyCommandWithInput:(NSString *)input\n                        modifierFlags:(NSEventModifierFlags)flags\n{\n  RCTAssertMainQueue();\n\n  for (RCTKeyCommand *command in _commands.allObjects) {\n    if ([command matchesInput:input flags:flags]) {\n      [_commands removeObject:command];\n      break;\n    }\n  }\n}\n\n- (BOOL)isDoublePressKeyCommandRegisteredForInput:(NSString *)input\n                         modifierFlags:(NSEventModifierFlags)flags\n{\n  RCTAssertMainQueue();\n\n  for (RCTKeyCommand *command in _commands) {\n    if ([command matchesInput:input flags:flags]) {\n      return YES;\n    }\n  }\n  return NO;\n}\n\n@end\n\n#else\n\n@implementation RCTKeyCommands\n\n+ (instancetype)sharedInstance\n{\n  return nil;\n}\n\n- (void)registerKeyCommandWithInput:(__unused NSString *)input\n                      modifierFlags:(__unused NSEventModifierFlags)flags\n                             action:(void (^)(__unused NSEvent *))block {}\n\n- (void)unregisterKeyCommandWithInput:(__unused NSString *)input\n                        modifierFlags:(__unused NSEventModifierFlags)flags {}\n\n- (BOOL)isKeyCommandRegisteredForInput:(__unused NSString *)input\n                         modifierFlags:(__unused NSEventModifierFlags)flags\n{\n  return NO;\n}\n\n- (void)registerDoublePressKeyCommandWithInput:(NSString *)input\n                      modifierFlags:(NSEventModifierFlags)flags\n                             action:(void (^)(NSEvent *))block {}\n\n- (void)unregisterDoublePressKeyCommandWithInput:(NSString *)input\n                        modifierFlags:(NSEventModifierFlags)flags {}\n\n- (BOOL)isDoublePressKeyCommandRegisteredForInput:(NSString *)input\n                         modifierFlags:(NSEventModifierFlags)flags\n{\n  return NO;\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/Base/RCTLog.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTAssert.h>\n#import <React/RCTDefines.h>\n#import <React/RCTUtils.h>\n\n#ifndef RCTLOG_ENABLED\n#define RCTLOG_ENABLED 1\n#endif\n\n/**\n * Thresholds for logs to display a redbox. You can override these values when debugging\n * in order to tweak the default logging behavior.\n */\n#ifndef RCTLOG_REDBOX_LEVEL\n#define RCTLOG_REDBOX_LEVEL RCTLogLevelError\n#endif\n\n/**\n * Logging macros. Use these to log information, warnings and errors in your\n * own code.\n */\n#define RCTLog(...) _RCTLog(RCTLogLevelInfo, __VA_ARGS__)\n#define RCTLogTrace(...) _RCTLog(RCTLogLevelTrace, __VA_ARGS__)\n#define RCTLogInfo(...) _RCTLog(RCTLogLevelInfo, __VA_ARGS__)\n#define RCTLogAdvice(string, ...) RCTLogWarn([@\"(ADVICE) \" stringByAppendingString:(NSString *)string], __VA_ARGS__)\n#define RCTLogWarn(...) _RCTLog(RCTLogLevelWarning, __VA_ARGS__)\n#define RCTLogError(...) _RCTLog(RCTLogLevelError, __VA_ARGS__)\n\n/**\n * An enum representing the severity of the log message.\n */\ntypedef NS_ENUM(NSInteger, RCTLogLevel) {\n  RCTLogLevelTrace = 0,\n  RCTLogLevelInfo = 1,\n  RCTLogLevelWarning = 2,\n  RCTLogLevelError = 3,\n  RCTLogLevelFatal = 4\n};\n\n/**\n * An enum representing the source of a log message.\n */\ntypedef NS_ENUM(NSInteger, RCTLogSource) {\n  RCTLogSourceNative = 1,\n  RCTLogSourceJavaScript = 2\n};\n\n/**\n * A block signature to be used for custom logging functions. In most cases you\n * will want to pass these arguments to the RCTFormatLog function in order to\n * generate a string.\n */\ntypedef void (^RCTLogFunction)(\n  RCTLogLevel level,\n  RCTLogSource source,\n  NSString *fileName,\n  NSNumber *lineNumber,\n  NSString *message\n);\n\n/**\n * A method to generate a string from a collection of log data. To omit any\n * particular data from the log, just pass nil or zero for the argument.\n */\nRCT_EXTERN NSString *RCTFormatLog(\n  NSDate *timestamp,\n  RCTLogLevel level,\n  NSString *fileName,\n  NSNumber *lineNumber,\n  NSString *message\n);\n\n/**\n * The default logging function used by RCTLogXX.\n */\nextern RCTLogFunction RCTDefaultLogFunction;\n\n/**\n * These methods get and set the global logging threshold. This is the level\n * below which logs will be ignored. Default is RCTLogLevelInfo for debug and\n * RCTLogLevelError for production.\n */\nRCT_EXTERN void RCTSetLogThreshold(RCTLogLevel threshold);\nRCT_EXTERN RCTLogLevel RCTGetLogThreshold(void);\n\n/**\n * These methods get and set the global logging function called by the RCTLogXX\n * macros. You can use these to replace the standard behavior with custom log\n * functionality.\n */\nRCT_EXTERN void RCTSetLogFunction(RCTLogFunction logFunction);\nRCT_EXTERN RCTLogFunction RCTGetLogFunction(void);\n\n/**\n * This appends additional code to the existing log function, without replacing\n * the existing functionality. Useful if you just want to forward logs to an\n * extra service without changing the default behavior.\n */\nRCT_EXTERN void RCTAddLogFunction(RCTLogFunction logFunction);\n\n/**\n * This method temporarily overrides the log function while performing the\n * specified block. This is useful for testing purposes (to detect if a given\n * function logs something) or to suppress or override logging temporarily.\n */\nRCT_EXTERN void RCTPerformBlockWithLogFunction(void (^block)(void), RCTLogFunction logFunction);\n\n/**\n * This method adds a conditional prefix to any messages logged within the scope\n * of the passed block. This is useful for adding additional context to log\n * messages. The block will be performed synchronously on the current thread.\n */\nRCT_EXTERN void RCTPerformBlockWithLogPrefix(void (^block)(void), NSString *prefix);\n\n/**\n * Private logging function - ignore this.\n */\n#if RCTLOG_ENABLED\n#define _RCTLog(lvl, ...) _RCTLogNativeInternal(lvl, __FILE__, __LINE__, __VA_ARGS__)\n#else\n#define _RCTLog(lvl, ...) do { } while (0)\n#endif\n\nRCT_EXTERN void _RCTLogNativeInternal(RCTLogLevel, const char *, int, NSString *, ...) NS_FORMAT_FUNCTION(4,5);\nRCT_EXTERN void _RCTLogJavaScriptInternal(RCTLogLevel, NSString *);\n"
  },
  {
    "path": "React/Base/RCTLog.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTLog.h\"\n\n#include <asl.h>\n#include <cxxabi.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge+Private.h\"\n#import \"RCTBridge.h\"\n#import \"RCTDefines.h\"\n#import \"RCTRedBox.h\"\n#import \"RCTUtils.h\"\n\nstatic NSString *const RCTLogFunctionStack = @\"RCTLogFunctionStack\";\n\nconst char *RCTLogLevels[] = {\n  \"trace\",\n  \"info\",\n  \"warn\",\n  \"error\",\n  \"fatal\",\n};\n\n#if RCT_DEBUG\nstatic const RCTLogLevel RCTDefaultLogThreshold = (RCTLogLevel)(RCTLogLevelInfo - 1);\n#else\nstatic const RCTLogLevel RCTDefaultLogThreshold = RCTLogLevelError;\n#endif\n\nstatic RCTLogFunction RCTCurrentLogFunction;\nstatic RCTLogLevel RCTCurrentLogThreshold = RCTDefaultLogThreshold;\n\nRCTLogLevel RCTGetLogThreshold()\n{\n  return RCTCurrentLogThreshold;\n}\n\nvoid RCTSetLogThreshold(RCTLogLevel threshold) {\n  RCTCurrentLogThreshold = threshold;\n}\n\nRCTLogFunction RCTDefaultLogFunction = ^(\n  RCTLogLevel level,\n  __unused RCTLogSource source,\n  NSString *fileName,\n  NSNumber *lineNumber,\n  NSString *message\n)\n{\n  NSString *log = RCTFormatLog([NSDate date], level, fileName, lineNumber, message);\n  fprintf(stderr, \"%s\\n\", log.UTF8String);\n  fflush(stderr);\n\n  int aslLevel;\n  switch(level) {\n    case RCTLogLevelTrace:\n      aslLevel = ASL_LEVEL_DEBUG;\n      break;\n    case RCTLogLevelInfo:\n      aslLevel = ASL_LEVEL_NOTICE;\n      break;\n    case RCTLogLevelWarning:\n      aslLevel = ASL_LEVEL_WARNING;\n      break;\n    case RCTLogLevelError:\n      aslLevel = ASL_LEVEL_ERR;\n      break;\n    case RCTLogLevelFatal:\n      aslLevel = ASL_LEVEL_CRIT;\n      break;\n  }\n  asl_log(NULL, NULL, aslLevel, \"%s\", message.UTF8String);\n};\n\nvoid RCTSetLogFunction(RCTLogFunction logFunction)\n{\n  RCTCurrentLogFunction = logFunction;\n}\n\nRCTLogFunction RCTGetLogFunction()\n{\n  if (!RCTCurrentLogFunction) {\n    RCTCurrentLogFunction = RCTDefaultLogFunction;\n  }\n  return RCTCurrentLogFunction;\n}\n\nvoid RCTAddLogFunction(RCTLogFunction logFunction)\n{\n  RCTLogFunction existing = RCTGetLogFunction();\n  if (existing) {\n    RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {\n      existing(level, source, fileName, lineNumber, message);\n      logFunction(level, source, fileName, lineNumber, message);\n    });\n  } else {\n    RCTSetLogFunction(logFunction);\n  }\n}\n\n/**\n * returns the topmost stacked log function for the current thread, which\n * may not be the same as the current value of RCTCurrentLogFunction.\n */\nstatic RCTLogFunction RCTGetLocalLogFunction()\n{\n  NSMutableDictionary *threadDictionary = [NSThread currentThread].threadDictionary;\n  NSArray<RCTLogFunction> *functionStack = threadDictionary[RCTLogFunctionStack];\n  RCTLogFunction logFunction = functionStack.lastObject;\n  if (logFunction) {\n    return logFunction;\n  }\n  return RCTGetLogFunction();\n}\n\nvoid RCTPerformBlockWithLogFunction(void (^block)(void), RCTLogFunction logFunction)\n{\n  NSMutableDictionary *threadDictionary = [NSThread currentThread].threadDictionary;\n  NSMutableArray<RCTLogFunction> *functionStack = threadDictionary[RCTLogFunctionStack];\n  if (!functionStack) {\n    functionStack = [NSMutableArray new];\n    threadDictionary[RCTLogFunctionStack] = functionStack;\n  }\n  [functionStack addObject:logFunction];\n  block();\n  [functionStack removeLastObject];\n}\n\nvoid RCTPerformBlockWithLogPrefix(void (^block)(void), NSString *prefix)\n{\n  RCTLogFunction logFunction = RCTGetLocalLogFunction();\n  if (logFunction) {\n    RCTPerformBlockWithLogFunction(block, ^(RCTLogLevel level, RCTLogSource source,\n                                            NSString *fileName, NSNumber *lineNumber,\n                                            NSString *message) {\n      logFunction(level, source, fileName, lineNumber, [prefix stringByAppendingString:message]);\n    });\n  }\n}\n\nNSString *RCTFormatLog(\n  NSDate *timestamp,\n  RCTLogLevel level,\n  NSString *fileName,\n  NSNumber *lineNumber,\n  NSString *message\n)\n{\n  NSMutableString *log = [NSMutableString new];\n  if (timestamp) {\n    static NSDateFormatter *formatter;\n    static dispatch_once_t onceToken;\n    dispatch_once(&onceToken, ^{\n      formatter = [NSDateFormatter new];\n      formatter.dateFormat = formatter.dateFormat = @\"yyyy-MM-dd HH:mm:ss.SSS \";\n    });\n    [log appendString:[formatter stringFromDate:timestamp]];\n  }\n  if (level) {\n    [log appendFormat:@\"[%s]\", RCTLogLevels[level]];\n  }\n\n  [log appendFormat:@\"[tid:%@]\", RCTCurrentThreadName()];\n\n  if (fileName) {\n    fileName = fileName.lastPathComponent;\n    if (lineNumber) {\n      [log appendFormat:@\"[%@:%@]\", fileName, lineNumber];\n    } else {\n      [log appendFormat:@\"[%@]\", fileName];\n    }\n  }\n  if (message) {\n    [log appendString:@\" \"];\n    [log appendString:message];\n  }\n  return log;\n}\n\nstatic NSRegularExpression *nativeStackFrameRegex()\n{\n  static dispatch_once_t onceToken;\n  static NSRegularExpression *_regex;\n  dispatch_once(&onceToken, ^{\n    NSError *regexError;\n    _regex = [NSRegularExpression regularExpressionWithPattern:@\"0x[0-9a-f]+ (.*) \\\\+ (\\\\d+)$\" options:0 error:&regexError];\n    if (regexError) {\n      RCTLogError(@\"Failed to build regex: %@\", [regexError localizedDescription]);\n    }\n  });\n  return _regex;\n}\n\nvoid _RCTLogNativeInternal(RCTLogLevel level, const char *fileName, int lineNumber, NSString *format, ...)\n{\n  RCTLogFunction logFunction = RCTGetLocalLogFunction();\n  BOOL log = RCT_DEBUG || (logFunction != nil);\n  if (log && level >= RCTGetLogThreshold()) {\n    // Get message\n    va_list args;\n    va_start(args, format);\n    NSString *message = [[NSString alloc] initWithFormat:format arguments:args];\n    va_end(args);\n\n    // Call log function\n    if (logFunction) {\n      logFunction(level, RCTLogSourceNative, fileName ? @(fileName) : nil, lineNumber > 0 ? @(lineNumber) : nil, message);\n    }\n\n#if RCT_DEBUG\n\n    // Log to red box in debug mode.\n    if (RCTSharedApplication() && level >= RCTLOG_REDBOX_LEVEL) {\n      NSArray<NSString *> *stackSymbols = [NSThread callStackSymbols];\n      NSMutableArray<NSDictionary *> *stack =\n        [NSMutableArray arrayWithCapacity:(stackSymbols.count - 1)];\n      [stackSymbols enumerateObjectsUsingBlock:^(NSString *frameSymbols, NSUInteger idx, __unused BOOL *stop) {\n        if (idx == 0) {\n          // don't include the current frame\n          return;\n        }\n\n        NSRange range = NSMakeRange(0, frameSymbols.length);\n        NSTextCheckingResult *match = [nativeStackFrameRegex() firstMatchInString:frameSymbols options:0 range:range];\n        if (!match) {\n          return;\n        }\n\n        NSString *methodName = [frameSymbols substringWithRange:[match rangeAtIndex:1]];\n        char *demangledName = abi::__cxa_demangle([methodName UTF8String], NULL, NULL, NULL);\n        if (demangledName) {\n          methodName = @(demangledName);\n          free(demangledName);\n        }\n\n        if (idx == 1 && fileName) {\n          [stack addObject:@{@\"methodName\": methodName, @\"file\": @(fileName), @\"lineNumber\": @(lineNumber)}];\n        } else {\n          [stack addObject:@{@\"methodName\": methodName}];\n        }\n      }];\n\n      dispatch_async(dispatch_get_main_queue(), ^{\n        // red box is thread safe, but by deferring to main queue we avoid a startup\n        // race condition that causes the module to be accessed before it has loaded\n        [[RCTBridge currentBridge].redBox showErrorMessage:message withStack:stack];\n      });\n    }\n\n    if (!RCTRunningInTestEnvironment()) {\n      // Log to JS executor\n      [[RCTBridge currentBridge] logMessage:message level:level ? @(RCTLogLevels[level]) : @\"info\"];\n    }\n\n#endif\n\n  }\n}\n\nvoid _RCTLogJavaScriptInternal(RCTLogLevel level, NSString *message)\n{\n  RCTLogFunction logFunction = RCTGetLocalLogFunction();\n  BOOL log = RCT_DEBUG || (logFunction != nil);\n  if (log && level >= RCTGetLogThreshold()) {\n    if (logFunction) {\n      logFunction(level, RCTLogSourceJavaScript, nil, nil, message);\n    }\n  }\n}\n"
  },
  {
    "path": "React/Base/RCTManagedPointer.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#ifdef __cplusplus\n\n#include <memory>\n\n#import <Foundation/Foundation.h>\n\n/**\n * Type erased wrapper over any cxx value that can be passed as an argument\n * to native method.\n */\n\n@interface RCTManagedPointer: NSObject\n\n@property (nonatomic, readonly) void *voidPointer;\n\n- (instancetype)initWithPointer:(std::shared_ptr<void>)pointer;\n\n@end\n\nnamespace facebook {\nnamespace react {\n\ntemplate <typename T, typename P>\nRCTManagedPointer *managedPointer(P initializer)\n{\n  auto ptr = std::shared_ptr<void>(new T(initializer));\n  return [[RCTManagedPointer alloc] initWithPointer:std::move(ptr)];\n}\n\n} }\n\n#endif\n"
  },
  {
    "path": "React/Base/RCTManagedPointer.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTManagedPointer.h\"\n\n@implementation RCTManagedPointer {\n  std::shared_ptr<void> _pointer;\n}\n\n- (instancetype)initWithPointer:(std::shared_ptr<void>)pointer {\n  if (self = [super init]) {\n    _pointer = std::move(pointer);\n  }\n  return self;\n}\n\n- (void *)voidPointer {\n  return _pointer.get();\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTModuleData.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTInvalidating.h>\n\n@protocol RCTBridgeMethod;\n@protocol RCTBridgeModule;\n@class RCTBridge;\n\ntypedef id<RCTBridgeModule>(^RCTBridgeModuleProvider)(void);\n\n@interface RCTModuleData : NSObject <RCTInvalidating>\n\n- (instancetype)initWithModuleClass:(Class)moduleClass\n                             bridge:(RCTBridge *)bridge;\n\n- (instancetype)initWithModuleClass:(Class)moduleClass\n                     moduleProvider:(RCTBridgeModuleProvider)moduleProvider\n                             bridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;\n\n- (instancetype)initWithModuleInstance:(id<RCTBridgeModule>)instance\n                                bridge:(RCTBridge *)bridge;\n\n/**\n * Calls `constantsToExport` on the module and stores the result. Note that\n * this will init the module if it has not already been created. This method\n * can be called on any thread, but may block the main thread briefly if the\n * module implements `constantsToExport`.\n */\n- (void)gatherConstants;\n\n/**\n * Sets the bridge for the module instance. This is only needed when using the\n * `initWithModuleInstance:bridge:` constructor. Otherwise, the bridge will be set\n * automatically when the module is first accessed.\n */\n- (void)setBridgeForInstance;\n\n/**\n * Sets the methodQueue and performs the remaining setup for the module. This is\n * only needed when using the `initWithModuleInstance:bridge:` constructor.\n * Otherwise it will be done automatically when the module is first accessed.\n */\n- (void)finishSetupForInstance;\n\n@property (nonatomic, strong, readonly) Class moduleClass;\n@property (nonatomic, copy, readonly) NSString *name;\n\n/**\n * Returns the module methods. Note that this will gather the methods the first\n * time it is called and then memoize the results.\n */\n@property (nonatomic, copy, readonly) NSArray<id<RCTBridgeMethod>> *methods;\n\n/**\n * Returns the module's constants, if it exports any\n */\n@property (nonatomic, copy, readonly) NSDictionary<NSString *, id> *exportedConstants;\n\n/**\n * Returns YES if module instance has already been initialized; NO otherwise.\n */\n@property (nonatomic, assign, readonly) BOOL hasInstance;\n\n/**\n * Returns YES if module instance must be created on the main thread.\n */\n@property (nonatomic, assign) BOOL requiresMainQueueSetup;\n\n/**\n * Returns YES if module has constants to export.\n */\n@property (nonatomic, assign, readonly) BOOL hasConstantsToExport;\n\n/**\n * Returns the current module instance. Note that this will init the instance\n * if it has not already been created. To check if the module instance exists\n * without causing it to be created, use `hasInstance` instead.\n */\n@property (nonatomic, strong, readonly) id<RCTBridgeModule> instance;\n\n/**\n * Returns the module method dispatch queue. Note that this will init both the\n * queue and the module itself if they have not already been created.\n */\n@property (nonatomic, strong, readonly) dispatch_queue_t methodQueue;\n\n/**\n * Returns the module config. Calls `gatherConstants` internally, so the same\n * usage caveats apply.\n */\n@property (nonatomic, copy, readonly) NSArray *config;\n\n/**\n * Whether the receiver has a valid `instance` which implements -batchDidComplete.\n */\n@property (nonatomic, assign, readonly) BOOL implementsBatchDidComplete;\n\n/**\n * Whether the receiver has a valid `instance` which implements\n * -partialBatchDidFlush.\n */\n@property (nonatomic, assign, readonly) BOOL implementsPartialBatchDidFlush;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTModuleData.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTModuleData.h\"\n\n#import <objc/runtime.h>\n#include <mutex>\n\n#import \"RCTBridge+Private.h\"\n#import \"RCTBridge.h\"\n#import \"RCTLog.h\"\n#import \"RCTModuleMethod.h\"\n#import \"RCTProfile.h\"\n#import \"RCTUtils.h\"\n\n@implementation RCTModuleData\n{\n  NSDictionary<NSString *, id> *_constantsToExport;\n  NSString *_queueName;\n  __weak RCTBridge *_bridge;\n  RCTBridgeModuleProvider _moduleProvider;\n  std::mutex _instanceLock;\n  BOOL _setupComplete;\n}\n\n@synthesize methods = _methods;\n@synthesize instance = _instance;\n@synthesize methodQueue = _methodQueue;\n\n- (void)setUp\n{\n  _implementsBatchDidComplete = [_moduleClass instancesRespondToSelector:@selector(batchDidComplete)];\n  _implementsPartialBatchDidFlush = [_moduleClass instancesRespondToSelector:@selector(partialBatchDidFlush)];\n\n  // If a module overrides `constantsToExport` and doesn't implement `requiresMainQueueSetup`, then we must assume\n  // that it must be called on the main thread, because it may need to access UIKit.\n  _hasConstantsToExport = [_moduleClass instancesRespondToSelector:@selector(constantsToExport)];\n\n  const BOOL implementsRequireMainQueueSetup = [_moduleClass respondsToSelector:@selector(requiresMainQueueSetup)];\n  if (implementsRequireMainQueueSetup) {\n    _requiresMainQueueSetup = [_moduleClass requiresMainQueueSetup];\n  } else {\n    static IMP objectInitMethod;\n    static dispatch_once_t onceToken;\n    dispatch_once(&onceToken, ^{\n      objectInitMethod = [NSObject instanceMethodForSelector:@selector(init)];\n    });\n\n    // If a module overrides `init` then we must assume that it expects to be\n    // initialized on the main thread, because it may need to access UIKit.\n    const BOOL hasCustomInit = !_instance && [_moduleClass instanceMethodForSelector:@selector(init)] != objectInitMethod;\n\n    _requiresMainQueueSetup = _hasConstantsToExport || hasCustomInit;\n    if (_requiresMainQueueSetup) {\n      const char *methodName = \"\";\n      if (_hasConstantsToExport) {\n        methodName = \"constantsToExport\";\n      } else if (hasCustomInit) {\n        methodName = \"init\";\n      }\n      RCTLogWarn(@\"Module %@ requires main queue setup since it overrides `%s` but doesn't implement \"\n        \"`requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules \"\n        \"on a background thread unless explicitly opted-out of.\", _moduleClass, methodName);\n    }\n  }\n}\n\n- (instancetype)initWithModuleClass:(Class)moduleClass\n                             bridge:(RCTBridge *)bridge\n{\n  return [self initWithModuleClass:moduleClass\n                    moduleProvider:^id<RCTBridgeModule>{ return [moduleClass new]; }\n                            bridge:bridge];\n}\n\n- (instancetype)initWithModuleClass:(Class)moduleClass\n                     moduleProvider:(RCTBridgeModuleProvider)moduleProvider\n                             bridge:(RCTBridge *)bridge\n{\n  if (self = [super init]) {\n    _bridge = bridge;\n    _moduleClass = moduleClass;\n    _moduleProvider = [moduleProvider copy];\n    [self setUp];\n  }\n  return self;\n}\n\n- (instancetype)initWithModuleInstance:(id<RCTBridgeModule>)instance\n                                bridge:(RCTBridge *)bridge\n{\n  if (self = [super init]) {\n    _bridge = bridge;\n    _instance = instance;\n    _moduleClass = [instance class];\n    [self setUp];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init);\n\n#pragma mark - private setup methods\n\n- (void)setUpInstanceAndBridge\n{\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"[RCTModuleData setUpInstanceAndBridge]\", @{\n    @\"moduleClass\": NSStringFromClass(_moduleClass)\n  });\n  {\n    std::unique_lock<std::mutex> lock(_instanceLock);\n\n    if (!_setupComplete && _bridge.valid) {\n      if (!_instance) {\n        if (RCT_DEBUG && _requiresMainQueueSetup) {\n          RCTAssertMainQueue();\n        }\n        RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"[RCTModuleData setUpInstanceAndBridge] Create module\", nil);\n        _instance = _moduleProvider ? _moduleProvider() : nil;\n        RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n        if (!_instance) {\n          // Module init returned nil, probably because automatic instantatiation\n          // of the module is not supported, and it is supposed to be passed in to\n          // the bridge constructor. Mark setup complete to avoid doing more work.\n          _setupComplete = YES;\n          RCTLogWarn(@\"The module %@ is returning nil from its constructor. You \"\n                     \"may need to instantiate it yourself and pass it into the \"\n                     \"bridge.\", _moduleClass);\n        }\n      }\n\n      if (_instance && RCTProfileIsProfiling()) {\n        RCTProfileHookInstance(_instance);\n      }\n\n      // Bridge must be set before methodQueue is set up, as methodQueue\n      // initialization requires it (View Managers get their queue by calling\n      // self.bridge.uiManager.methodQueue)\n      [self setBridgeForInstance];\n    }\n\n    [self setUpMethodQueue];\n  }\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n  // This is called outside of the lock in order to prevent deadlock issues\n  // because the logic in `finishSetupForInstance` can cause\n  // `moduleData.instance` to be accessed re-entrantly.\n  if (_bridge.moduleSetupComplete) {\n    [self finishSetupForInstance];\n  } else {\n    // If we're here, then the module is completely initialized,\n    // except for what finishSetupForInstance does.  When the instance\n    // method is called after moduleSetupComplete,\n    // finishSetupForInstance will run.  If _requiresMainQueueSetup\n    // is true, getting the instance will block waiting for the main\n    // thread, which could take a while if the main thread is busy\n    // (I've seen 50ms in testing).  So we clear that flag, since\n    // nothing in finishSetupForInstance needs to be run on the main\n    // thread.\n    _requiresMainQueueSetup = NO;\n  }\n}\n\n- (void)setBridgeForInstance\n{\n  if ([_instance respondsToSelector:@selector(bridge)] && _instance.bridge != _bridge) {\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"[RCTModuleData setBridgeForInstance]\", nil);\n    @try {\n      [(id)_instance setValue:_bridge forKey:@\"bridge\"];\n    }\n    @catch (NSException *exception) {\n      RCTLogError(@\"%@ has no setter or ivar for its bridge, which is not \"\n                  \"permitted. You must either @synthesize the bridge property, \"\n                  \"or provide your own setter method.\", self.name);\n    }\n    RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n  }\n}\n\n- (void)finishSetupForInstance\n{\n  if (!_setupComplete && _instance) {\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"[RCTModuleData finishSetupForInstance]\", nil);\n    _setupComplete = YES;\n    [_bridge registerModuleForFrameUpdates:_instance withModuleData:self];\n    [[NSNotificationCenter defaultCenter] postNotificationName:RCTDidInitializeModuleNotification\n                                                        object:_bridge\n                                                      userInfo:@{@\"module\": _instance, @\"bridge\": RCTNullIfNil(_bridge.parentBridge)}];\n    RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n  }\n}\n\n- (void)setUpMethodQueue\n{\n  if (_instance && !_methodQueue && _bridge.valid) {\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"[RCTModuleData setUpMethodQueue]\", nil);\n    BOOL implementsMethodQueue = [_instance respondsToSelector:@selector(methodQueue)];\n    if (implementsMethodQueue && _bridge.valid) {\n      _methodQueue = _instance.methodQueue;\n    }\n    if (!_methodQueue && _bridge.valid) {\n      // Create new queue (store queueName, as it isn't retained by dispatch_queue)\n      _queueName = [NSString stringWithFormat:@\"com.facebook.react.%@Queue\", self.name];\n      _methodQueue = dispatch_queue_create(_queueName.UTF8String, DISPATCH_QUEUE_SERIAL);\n\n      // assign it to the module\n      if (implementsMethodQueue) {\n        @try {\n          [(id)_instance setValue:_methodQueue forKey:@\"methodQueue\"];\n        }\n        @catch (NSException *exception) {\n          RCTLogError(@\"%@ is returning nil for its methodQueue, which is not \"\n                      \"permitted. You must either return a pre-initialized \"\n                      \"queue, or @synthesize the methodQueue to let the bridge \"\n                      \"create a queue for you.\", self.name);\n        }\n      }\n    }\n    RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n  }\n}\n\n#pragma mark - public getters\n\n- (BOOL)hasInstance\n{\n  std::unique_lock<std::mutex> lock(_instanceLock);\n  return _instance != nil;\n}\n\n- (id<RCTBridgeModule>)instance\n{\n  if (!_setupComplete) {\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, ([NSString stringWithFormat:@\"[RCTModuleData instanceForClass:%@]\", _moduleClass]), nil);\n    if (_requiresMainQueueSetup) {\n      // The chances of deadlock here are low, because module init very rarely\n      // calls out to other threads, however we can't control when a module might\n      // get accessed by client code during bridge setup, and a very low risk of\n      // deadlock is better than a fairly high risk of an assertion being thrown.\n      RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"[RCTModuleData instance] main thread setup\", nil);\n\n      if (!RCTIsMainQueue()) {\n        RCTLogWarn(@\"RCTBridge required dispatch_sync to load %@. This may lead to deadlocks\", _moduleClass);\n      }\n\n      RCTUnsafeExecuteOnMainQueueSync(^{\n        [self setUpInstanceAndBridge];\n      });\n      RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n    } else {\n      [self setUpInstanceAndBridge];\n    }\n    RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n  }\n  return _instance;\n}\n\n- (NSString *)name\n{\n  return RCTBridgeModuleNameForClass(_moduleClass);\n}\n\n- (NSArray<id<RCTBridgeMethod>> *)methods\n{\n  if (!_methods) {\n    NSMutableArray<id<RCTBridgeMethod>> *moduleMethods = [NSMutableArray new];\n\n    if ([_moduleClass instancesRespondToSelector:@selector(methodsToExport)]) {\n      [moduleMethods addObjectsFromArray:[self.instance methodsToExport]];\n    }\n\n    unsigned int methodCount;\n    Class cls = _moduleClass;\n    while (cls && cls != [NSObject class] && cls != [NSProxy class]) {\n      Method *methods = class_copyMethodList(object_getClass(cls), &methodCount);\n\n      for (unsigned int i = 0; i < methodCount; i++) {\n        Method method = methods[i];\n        SEL selector = method_getName(method);\n        if ([NSStringFromSelector(selector) hasPrefix:@\"__rct_export__\"]) {\n          IMP imp = method_getImplementation(method);\n          auto exportedMethod = ((const RCTMethodInfo *(*)(id, SEL))imp)(_moduleClass, selector);\n          id<RCTBridgeMethod> moduleMethod = [[RCTModuleMethod alloc] initWithExportedMethod:exportedMethod\n                                                                                 moduleClass:_moduleClass];\n          [moduleMethods addObject:moduleMethod];\n        }\n      }\n\n      free(methods);\n      cls = class_getSuperclass(cls);\n    }\n\n    _methods = [moduleMethods copy];\n  }\n  return _methods;\n}\n\n- (void)gatherConstants\n{\n  if (_hasConstantsToExport && !_constantsToExport) {\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, ([NSString stringWithFormat:@\"[RCTModuleData gatherConstants] %@\", _moduleClass]), nil);\n    (void)[self instance];\n    if (_requiresMainQueueSetup) {\n      if (!RCTIsMainQueue()) {\n        RCTLogWarn(@\"Required dispatch_sync to load constants for %@. This may lead to deadlocks\", _moduleClass);\n      }\n\n      RCTUnsafeExecuteOnMainQueueSync(^{\n        self->_constantsToExport = [self->_instance constantsToExport] ?: @{};\n      });\n    } else {\n      _constantsToExport = [_instance constantsToExport] ?: @{};\n    }\n    RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n  }\n}\n\n- (NSDictionary<NSString *, id> *)exportedConstants\n{\n  [self gatherConstants];\n  NSDictionary<NSString *, id> *constants = _constantsToExport;\n  _constantsToExport = nil; // Not needed anymore\n  return constants;\n}\n\n// TODO 10487027: this method can go once RCTBatchedBridge is gone\n- (NSArray *)config\n{\n  NSDictionary<NSString *, id> *constants = [self exportedConstants];\n  if (constants.count == 0 && self.methods.count == 0) {\n    return (id)kCFNull; // Nothing to export\n  }\n\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, ([NSString stringWithFormat:@\"[RCTModuleData config] %@\", _moduleClass]), nil);\n  NSMutableArray<NSString *> *methods = self.methods.count ? [NSMutableArray new] : nil;\n  NSMutableArray<NSNumber *> *promiseMethods = nil;\n  NSMutableArray<NSNumber *> *syncMethods = nil;\n\n  for (id<RCTBridgeMethod> method in self.methods) {\n    if (method.functionType == RCTFunctionTypePromise) {\n      if (!promiseMethods) {\n        promiseMethods = [NSMutableArray new];\n      }\n      [promiseMethods addObject:@(methods.count)];\n    }\n    else if (method.functionType == RCTFunctionTypeSync) {\n      if (!syncMethods) {\n        syncMethods = [NSMutableArray new];\n      }\n      [syncMethods addObject:@(methods.count)];\n    }\n    [methods addObject:@(method.JSMethodName)];\n  }\n\n  NSArray *config = @[\n    self.name,\n    RCTNullIfNil(constants),\n    RCTNullIfNil(methods),\n    RCTNullIfNil(promiseMethods),\n    RCTNullIfNil(syncMethods)\n  ];\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, ([NSString stringWithFormat:@\"[RCTModuleData config] %@\", _moduleClass]));\n  return config;\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  (void)[self instance];\n  RCTAssert(_methodQueue != nullptr, @\"Module %@ has no methodQueue (instance: %@, bridge.valid: %d)\",\n            self, _instance, _bridge.valid);\n  return _methodQueue;\n}\n\n- (void)invalidate\n{\n  _methodQueue = nil;\n}\n\n- (NSString *)description\n{\n  return [NSString stringWithFormat:@\"<%@: %p; name=\\\"%@\\\">\", [self class], self, self.name];\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTModuleMethod.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridgeMethod.h>\n#import <React/RCTBridgeModule.h>\n#import <React/RCTNullability.h>\n\n@class RCTBridge;\n\n@interface RCTMethodArgument : NSObject\n\n@property (nonatomic, copy, readonly) NSString *type;\n@property (nonatomic, readonly) RCTNullability nullability;\n@property (nonatomic, readonly) BOOL unused;\n\n@end\n\n@interface RCTModuleMethod : NSObject <RCTBridgeMethod>\n\n@property (nonatomic, readonly) Class moduleClass;\n@property (nonatomic, readonly) SEL selector;\n\n- (instancetype)initWithExportedMethod:(const RCTMethodInfo *)exportMethod\n                           moduleClass:(Class)moduleClass NS_DESIGNATED_INITIALIZER;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTModuleMethod.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTModuleMethod.h\"\n\n#import <objc/message.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge+Private.h\"\n#import \"RCTBridge.h\"\n#import \"RCTConvert.h\"\n#import \"RCTLog.h\"\n#import \"RCTParserUtils.h\"\n#import \"RCTProfile.h\"\n#import \"RCTUtils.h\"\n\ntypedef BOOL (^RCTArgumentBlock)(RCTBridge *, NSUInteger, id);\n\n@implementation RCTMethodArgument\n\n- (instancetype)initWithType:(NSString *)type\n                 nullability:(RCTNullability)nullability\n                      unused:(BOOL)unused\n{\n  if (self = [super init]) {\n    _type = [type copy];\n    _nullability = nullability;\n    _unused = unused;\n  }\n  return self;\n}\n\n@end\n\n@implementation RCTModuleMethod\n{\n  Class _moduleClass;\n  NSInvocation *_invocation;\n  NSArray<RCTArgumentBlock> *_argumentBlocks;\n  NSString *_methodSignature;\n  SEL _selector;\n  BOOL _isSync;\n}\n\n@synthesize JSMethodName = _JSMethodName;\n\nstatic void RCTLogArgumentError(RCTModuleMethod *method, NSUInteger index,\n                                id valueOrType, const char *issue)\n{\n  RCTLogError(@\"Argument %tu (%@) of %@.%@ %s\", index, valueOrType,\n              RCTBridgeModuleNameForClass(method->_moduleClass),\n              method->_JSMethodName, issue);\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n// returns YES if the selector ends in a colon (indicating that there is at\n// least one argument, and maybe more selector parts) or NO if it doesn't.\nstatic BOOL RCTParseSelectorPart(const char **input, NSMutableString *selector)\n{\n  NSString *selectorPart;\n  if (RCTParseIdentifier(input, &selectorPart)) {\n    [selector appendString:selectorPart];\n  }\n  RCTSkipWhitespace(input);\n  if (RCTReadChar(input, ':')) {\n    [selector appendString:@\":\"];\n    RCTSkipWhitespace(input);\n    return YES;\n  }\n  return NO;\n}\n\nstatic BOOL RCTParseUnused(const char **input)\n{\n  return RCTReadString(input, \"__unused\") ||\n         RCTReadString(input, \"__attribute__((unused))\");\n}\n\nstatic RCTNullability RCTParseNullability(const char **input)\n{\n  if (RCTReadString(input, \"nullable\")) {\n    return RCTNullable;\n  } else if (RCTReadString(input, \"nonnull\")) {\n    return RCTNonnullable;\n  }\n  return RCTNullabilityUnspecified;\n}\n\nstatic RCTNullability RCTParseNullabilityPostfix(const char **input)\n{\n  if (RCTReadString(input, \"_Nullable\")) {\n    return RCTNullable;\n  } else if (RCTReadString(input, \"_Nonnull\")) {\n    return RCTNonnullable;\n  }\n  return RCTNullabilityUnspecified;\n}\n\n// returns YES if execution is safe to proceed (enqueue callback invocation), NO if callback has already been invoked\nstatic BOOL RCTCheckCallbackMultipleInvocations(BOOL *didInvoke) {\n  if (*didInvoke) {\n      RCTFatal(RCTErrorWithMessage(@\"Illegal callback invocation from native module. This callback type only permits a single invocation from native code.\"));\n      return NO;\n  } else {\n      *didInvoke = YES;\n      return YES;\n  }\n}\n\nSEL RCTParseMethodSignature(NSString *, NSArray<RCTMethodArgument *> **);\nSEL RCTParseMethodSignature(NSString *methodSignature, NSArray<RCTMethodArgument *> **arguments)\n{\n  const char *input = methodSignature.UTF8String;\n  RCTSkipWhitespace(&input);\n\n  NSMutableArray *args;\n  NSMutableString *selector = [NSMutableString new];\n  while (RCTParseSelectorPart(&input, selector)) {\n    if (!args) {\n      args = [NSMutableArray new];\n    }\n\n    // Parse type\n    if (RCTReadChar(&input, '(')) {\n      RCTSkipWhitespace(&input);\n\n      BOOL unused = RCTParseUnused(&input);\n      RCTSkipWhitespace(&input);\n\n      RCTNullability nullability = RCTParseNullability(&input);\n      RCTSkipWhitespace(&input);\n\n      NSString *type = RCTParseType(&input);\n      RCTSkipWhitespace(&input);\n      if (nullability == RCTNullabilityUnspecified) {\n        nullability = RCTParseNullabilityPostfix(&input);\n      }\n      [args addObject:[[RCTMethodArgument alloc] initWithType:type\n                                                  nullability:nullability\n                                                       unused:unused]];\n      RCTSkipWhitespace(&input);\n      RCTReadChar(&input, ')');\n      RCTSkipWhitespace(&input);\n    } else {\n      // Type defaults to id if unspecified\n      [args addObject:[[RCTMethodArgument alloc] initWithType:@\"id\"\n                                                  nullability:RCTNullable\n                                                       unused:NO]];\n    }\n\n    // Argument name\n    RCTParseIdentifier(&input, NULL);\n    RCTSkipWhitespace(&input);\n  }\n\n  *arguments = [args copy];\n  return NSSelectorFromString(selector);\n}\n\n- (instancetype)initWithMethodSignature:(NSString *)methodSignature\n                           JSMethodName:(NSString *)JSMethodName\n                                 isSync:(BOOL)isSync\n                            moduleClass:(Class)moduleClass\n{\n  if (self = [super init]) {\n    _moduleClass = moduleClass;\n    _methodSignature = [methodSignature copy];\n    _JSMethodName = [JSMethodName copy];\n    _isSync = isSync;\n  }\n\n  return self;\n}\n\n- (void)processMethodSignature\n{\n  NSArray<RCTMethodArgument *> *arguments;\n  _selector = RCTParseMethodSignature(_methodSignature, &arguments);\n  RCTAssert(_selector, @\"%@ is not a valid selector\", _methodSignature);\n\n  // Create method invocation\n  NSMethodSignature *methodSignature = [_moduleClass instanceMethodSignatureForSelector:_selector];\n  RCTAssert(methodSignature, @\"%@ is not a recognized Objective-C method.\", _methodSignature);\n  NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSignature];\n  invocation.selector = _selector;\n  _invocation = invocation;\n\n  // Process arguments\n  NSUInteger numberOfArguments = methodSignature.numberOfArguments;\n  NSMutableArray<RCTArgumentBlock> *argumentBlocks =\n    [[NSMutableArray alloc] initWithCapacity:numberOfArguments - 2];\n\n#define RCT_ARG_BLOCK(_logic) \\\n[argumentBlocks addObject:^(__unused RCTBridge *bridge, NSUInteger index, id json) { \\\n  _logic \\\n  [invocation setArgument:&value atIndex:(index) + 2]; \\\n  return YES; \\\n}];\n\n/**\n * Explicitly copy the block and retain it, since NSInvocation doesn't retain them.\n */\n#define RCT_BLOCK_ARGUMENT(block...) \\\n  id value = json ? [block copy] : (id)^(__unused NSArray *_){}; \\\n  CFBridgingRetain(value)\n\n  __weak RCTModuleMethod *weakSelf = self;\n\n  void (^addBlockArgument)(void) = ^{\n    RCT_ARG_BLOCK(\n      if (RCT_DEBUG && json && ![json isKindOfClass:[NSNumber class]]) {\n        RCTLogArgumentError(weakSelf, index, json, \"should be a function\");\n        return NO;\n      }\n\n      __block BOOL didInvoke = NO;\n      RCT_BLOCK_ARGUMENT(^(NSArray *args) {\n        if (RCTCheckCallbackMultipleInvocations(&didInvoke)) {\n          [bridge enqueueCallback:json args:args];\n        }\n      });\n    )\n  };\n\n  for (NSUInteger i = 2; i < numberOfArguments; i++) {\n    const char *objcType = [methodSignature getArgumentTypeAtIndex:i];\n    BOOL isNullableType = NO;\n    RCTMethodArgument *argument = arguments[i - 2];\n    NSString *typeName = argument.type;\n    SEL selector = RCTConvertSelectorForType(typeName);\n    if ([RCTConvert respondsToSelector:selector]) {\n      switch (objcType[0]) {\n\n#define RCT_CASE(_value, _type) \\\n        case _value: { \\\n          _type (*convert)(id, SEL, id) = (typeof(convert))objc_msgSend; \\\n          RCT_ARG_BLOCK( _type value = convert([RCTConvert class], selector, json); ) \\\n          break; \\\n        }\n\n        RCT_CASE(_C_CHR, char)\n        RCT_CASE(_C_UCHR, unsigned char)\n        RCT_CASE(_C_SHT, short)\n        RCT_CASE(_C_USHT, unsigned short)\n        RCT_CASE(_C_INT, int)\n        RCT_CASE(_C_UINT, unsigned int)\n        RCT_CASE(_C_LNG, long)\n        RCT_CASE(_C_ULNG, unsigned long)\n        RCT_CASE(_C_LNG_LNG, long long)\n        RCT_CASE(_C_ULNG_LNG, unsigned long long)\n        RCT_CASE(_C_FLT, float)\n        RCT_CASE(_C_DBL, double)\n        RCT_CASE(_C_BOOL, BOOL)\n\n#define RCT_NULLABLE_CASE(_value, _type) \\\n        case _value: { \\\n          isNullableType = YES; \\\n          _type (*convert)(id, SEL, id) = (typeof(convert))objc_msgSend; \\\n          RCT_ARG_BLOCK( _type value = convert([RCTConvert class], selector, json); ) \\\n          break; \\\n        }\n\n        RCT_NULLABLE_CASE(_C_SEL, SEL)\n        RCT_NULLABLE_CASE(_C_CHARPTR, const char *)\n        RCT_NULLABLE_CASE(_C_PTR, void *)\n\n        case _C_ID: {\n          isNullableType = YES;\n          id (*convert)(id, SEL, id) = (typeof(convert))objc_msgSend;\n          RCT_ARG_BLOCK(\n            id value = convert([RCTConvert class], selector, json);\n            CFBridgingRetain(value);\n          )\n          break;\n        }\n\n        case _C_STRUCT_B: {\n\n          NSMethodSignature *typeSignature = [RCTConvert methodSignatureForSelector:selector];\n          NSInvocation *typeInvocation = [NSInvocation invocationWithMethodSignature:typeSignature];\n          typeInvocation.selector = selector;\n          typeInvocation.target = [RCTConvert class];\n\n          [argumentBlocks addObject:^(__unused RCTBridge *bridge, NSUInteger index, id json) {\n            void *returnValue = malloc(typeSignature.methodReturnLength);\n            [typeInvocation setArgument:&json atIndex:2];\n            [typeInvocation invoke];\n            [typeInvocation getReturnValue:returnValue];\n            [invocation setArgument:returnValue atIndex:index + 2];\n            free(returnValue);\n            return YES;\n          }];\n          break;\n        }\n\n        default: {\n          static const char *blockType = @encode(typeof(^{}));\n          if (!strcmp(objcType, blockType)) {\n            addBlockArgument();\n          } else {\n            RCTLogError(@\"Unsupported argument type '%@' in method %@.\",\n                        typeName, [self methodName]);\n          }\n        }\n      }\n    } else if ([typeName isEqualToString:@\"RCTResponseSenderBlock\"]) {\n      addBlockArgument();\n    } else if ([typeName isEqualToString:@\"RCTResponseErrorBlock\"]) {\n      RCT_ARG_BLOCK(\n\n        if (RCT_DEBUG && json && ![json isKindOfClass:[NSNumber class]]) {\n          RCTLogArgumentError(weakSelf, index, json, \"should be a function\");\n          return NO;\n        }\n\n        __block BOOL didInvoke = NO;\n        RCT_BLOCK_ARGUMENT(^(NSError *error) {\n          if (RCTCheckCallbackMultipleInvocations(&didInvoke)) {\n            [bridge enqueueCallback:json args:@[RCTJSErrorFromNSError(error)]];\n          }\n        });\n      )\n    } else if ([typeName isEqualToString:@\"RCTPromiseResolveBlock\"]) {\n      RCTAssert(i == numberOfArguments - 2,\n                @\"The RCTPromiseResolveBlock must be the second to last parameter in -[%@ %@]\",\n                _moduleClass, _methodSignature);\n      RCT_ARG_BLOCK(\n        if (RCT_DEBUG && ![json isKindOfClass:[NSNumber class]]) {\n          RCTLogArgumentError(weakSelf, index, json, \"should be a promise resolver function\");\n          return NO;\n        }\n\n        __block BOOL didInvoke = NO;\n        RCT_BLOCK_ARGUMENT(^(id result) {\n          if (RCTCheckCallbackMultipleInvocations(&didInvoke)) {\n            [bridge enqueueCallback:json args:result ? @[result] : @[]];\n          }\n        });\n      )\n    } else if ([typeName isEqualToString:@\"RCTPromiseRejectBlock\"]) {\n      RCTAssert(i == numberOfArguments - 1,\n                @\"The RCTPromiseRejectBlock must be the last parameter in -[%@ %@]\",\n                _moduleClass, _methodSignature);\n      RCT_ARG_BLOCK(\n        if (RCT_DEBUG && ![json isKindOfClass:[NSNumber class]]) {\n          RCTLogArgumentError(weakSelf, index, json, \"should be a promise rejecter function\");\n          return NO;\n        }\n\n        __block BOOL didInvoke = NO;\n        RCT_BLOCK_ARGUMENT(^(NSString *code, NSString *message, NSError *error) {\n          if (RCTCheckCallbackMultipleInvocations(&didInvoke)) {\n            NSDictionary *errorJSON = RCTJSErrorFromCodeMessageAndNSError(code, message, error);\n            [bridge enqueueCallback:json args:@[errorJSON]];\n          }\n        });\n      )\n    } else {\n\n      // Unknown argument type\n      RCTLogError(@\"Unknown argument type '%@' in method %@. Extend RCTConvert\"\n                  \" to support this type.\", typeName, [self methodName]);\n    }\n\n    if (RCT_DEBUG) {\n\n      RCTNullability nullability = argument.nullability;\n      if (!isNullableType) {\n        if (nullability == RCTNullable) {\n          RCTLogArgumentError(weakSelf, i - 2, typeName, \"is marked as \"\n                              \"nullable, but is not a nullable type.\");\n        }\n        nullability = RCTNonnullable;\n      }\n\n      /**\n       * Special case - Numbers are not nullable in Android, so we\n       * don't support this for now. In future we may allow it.\n       */\n      if ([typeName isEqualToString:@\"NSNumber\"]) {\n        BOOL unspecified = (nullability == RCTNullabilityUnspecified);\n        if (!argument.unused && (nullability == RCTNullable || unspecified)) {\n          RCTLogArgumentError(weakSelf, i - 2, typeName,\n            [unspecified ? @\"has unspecified nullability\" : @\"is marked as nullable\"\n             stringByAppendingString: @\" but React requires that all NSNumber \"\n             \"arguments are explicitly marked as `nonnull` to ensure \"\n             \"compatibility with Android.\"].UTF8String);\n        }\n        nullability = RCTNonnullable;\n      }\n\n      if (nullability == RCTNonnullable) {\n        RCTArgumentBlock oldBlock = argumentBlocks[i - 2];\n        argumentBlocks[i - 2] = ^(RCTBridge *bridge, NSUInteger index, id json) {\n          if (json != nil) {\n            if (!oldBlock(bridge, index, json)) {\n              return NO;\n            }\n            if (isNullableType) {\n              // Check converted value wasn't null either, as method probably\n              // won't gracefully handle a nil vallue for a nonull argument\n              void *value;\n              [invocation getArgument:&value atIndex:index + 2];\n              if (value == NULL) {\n                return NO;\n              }\n            }\n            return YES;\n          }\n          RCTLogArgumentError(weakSelf, index, typeName, \"must not be null\");\n          return NO;\n        };\n      }\n    }\n  }\n\n  if (RCT_DEBUG) {\n    const char *objcType = _invocation.methodSignature.methodReturnType;\n    if (_isSync && objcType[0] != _C_ID)\n      RCTLogError(@\"Return type of %@.%@ should be (id) as the method is \\\"sync\\\"\",\n                  RCTBridgeModuleNameForClass(_moduleClass), _JSMethodName);\n  }\n\n  _argumentBlocks = [argumentBlocks copy];\n}\n\n- (SEL)selector\n{\n  if (_selector == NULL) {\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"\", (@{ @\"module\": NSStringFromClass(_moduleClass),\n                                                          @\"method\": _methodSignature }));\n    [self processMethodSignature];\n    RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n  }\n  return _selector;\n}\n\n- (NSString *)JSMethodName\n{\n  NSString *methodName = _JSMethodName;\n  if (methodName.length == 0) {\n    methodName = _methodSignature;\n    NSRange colonRange = [methodName rangeOfString:@\":\"];\n    if (colonRange.location != NSNotFound) {\n      methodName = [methodName substringToIndex:colonRange.location];\n    }\n    methodName = [methodName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];\n    RCTAssert(methodName.length, @\"%@ is not a valid JS function name, please\"\n              \" supply an alternative using RCT_REMAP_METHOD()\", _methodSignature);\n  }\n  return methodName;\n}\n\n- (RCTFunctionType)functionType\n{\n  if ([_methodSignature rangeOfString:@\"RCTPromise\"].length) {\n    RCTAssert(!_isSync, @\"Promises cannot be used in sync functions\");\n\n    return RCTFunctionTypePromise;\n  } else if (_isSync) {\n    return RCTFunctionTypeSync;\n  } else {\n    return RCTFunctionTypeNormal;\n  }\n}\n\n- (id)invokeWithBridge:(RCTBridge *)bridge\n                module:(id)module\n             arguments:(NSArray *)arguments\n{\n  if (_argumentBlocks == nil) {\n    [self processMethodSignature];\n  }\n\n  if (RCT_DEBUG) {\n    // Sanity check\n    RCTAssert([module class] == _moduleClass, @\"Attempted to invoke method \\\n              %@ on a module of class %@\", [self methodName], [module class]);\n\n    // Safety check\n    if (arguments.count != _argumentBlocks.count) {\n      NSInteger actualCount = arguments.count;\n      NSInteger expectedCount = _argumentBlocks.count;\n\n      // Subtract the implicit Promise resolver and rejecter functions for implementations of async functions\n      if (self.functionType == RCTFunctionTypePromise) {\n        actualCount -= 2;\n        expectedCount -= 2;\n      }\n\n      RCTLogError(@\"%@.%@ was called with %zd arguments but expects %zd arguments. \"\n                  @\"If you haven\\'t changed this method yourself, this usually means that \"\n                  @\"your versions of the native code and JavaScript code are out of sync. \"\n                  @\"Updating both should make this error go away.\",\n                  RCTBridgeModuleNameForClass(_moduleClass), _JSMethodName,\n                  actualCount, expectedCount);\n      return nil;\n    }\n  }\n\n  // Set arguments\n  NSUInteger index = 0;\n  for (id json in arguments) {\n    RCTArgumentBlock block = _argumentBlocks[index];\n    if (!block(bridge, index, RCTNilIfNull(json))) {\n      // Invalid argument, abort\n      RCTLogArgumentError(self, index, json,\n                          \"could not be processed. Aborting method call.\");\n      return nil;\n    }\n    index++;\n  }\n\n  // Invoke method\n  [_invocation invokeWithTarget:module];\n\n  RCTAssert(\n    @encode(RCTArgumentBlock)[0] == _C_ID,\n    @\"Block type encoding has changed, it won't be released. A check for the block\"\n     \"type encoding (%s) has to be added below.\",\n    @encode(RCTArgumentBlock)\n  );\n\n  index = 2;\n  for (NSUInteger length = _invocation.methodSignature.numberOfArguments; index < length; index++) {\n    if ([_invocation.methodSignature getArgumentTypeAtIndex:index][0] == _C_ID) {\n      __unsafe_unretained id value;\n      [_invocation getArgument:&value atIndex:index];\n\n      if (value) {\n        CFRelease((__bridge CFTypeRef)value);\n      }\n    }\n  }\n\n  id result = nil;\n  if (_isSync) {\n    void *pointer;\n    [_invocation getReturnValue:&pointer];\n    result = (__bridge id)pointer;\n  }\n\n  return result;\n}\n\n- (NSString *)methodName\n{\n  if (_selector == NULL) {\n    [self processMethodSignature];\n  }\n  return [NSString stringWithFormat:@\"-[%@ %@]\", _moduleClass,\n          NSStringFromSelector(_selector)];\n}\n\n- (NSString *)description\n{\n  return [NSString stringWithFormat:@\"<%@: %p; exports %@ as %@(); type: %s>\",\n          [self class], self, [self methodName], self.JSMethodName, RCTFunctionDescriptorFromType(self.functionType)];\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTModuleMethod.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTModuleMethod.h\"\n\n#import <objc/message.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge+Private.h\"\n#import \"RCTBridge.h\"\n#import \"RCTConvert.h\"\n#import \"RCTCxxConvert.h\"\n#import \"RCTLog.h\"\n#import \"RCTManagedPointer.h\"\n#import \"RCTParserUtils.h\"\n#import \"RCTProfile.h\"\n#import \"RCTUtils.h\"\n\ntypedef BOOL (^RCTArgumentBlock)(RCTBridge *, NSUInteger, id);\n\n/**\n * Get the converter function for the specified type\n */\nstatic SEL selectorForType(NSString *type)\n{\n  const char *input = type.UTF8String;\n  return NSSelectorFromString([RCTParseType(&input) stringByAppendingString:@\":\"]);\n}\n\n@implementation RCTMethodArgument\n\n- (instancetype)initWithType:(NSString *)type\n                 nullability:(RCTNullability)nullability\n                      unused:(BOOL)unused\n{\n  if (self = [super init]) {\n    _type = [type copy];\n    _nullability = nullability;\n    _unused = unused;\n  }\n  return self;\n}\n\n@end\n\n@implementation RCTModuleMethod\n{\n  Class _moduleClass;\n  const RCTMethodInfo *_methodInfo;\n  NSString *_JSMethodName;\n\n  SEL _selector;\n  NSInvocation *_invocation;\n  NSArray<RCTArgumentBlock> *_argumentBlocks;\n  NSMutableArray *_retainedObjects;\n}\n\nstatic void RCTLogArgumentError(RCTModuleMethod *method, NSUInteger index,\n                                id valueOrType, const char *issue)\n{\n  RCTLogError(@\"Argument %tu (%@) of %@.%s %s\", index, valueOrType,\n              RCTBridgeModuleNameForClass(method->_moduleClass),\n              method.JSMethodName, issue);\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\nRCT_EXTERN_C_BEGIN\n\n// returns YES if the selector ends in a colon (indicating that there is at\n// least one argument, and maybe more selector parts) or NO if it doesn't.\nstatic BOOL RCTParseSelectorPart(const char **input, NSMutableString *selector)\n{\n  NSString *selectorPart;\n  if (RCTParseSelectorIdentifier(input, &selectorPart)) {\n    [selector appendString:selectorPart];\n  }\n  RCTSkipWhitespace(input);\n  if (RCTReadChar(input, ':')) {\n    [selector appendString:@\":\"];\n    RCTSkipWhitespace(input);\n    return YES;\n  }\n  return NO;\n}\n\nstatic BOOL RCTParseUnused(const char **input)\n{\n  return RCTReadString(input, \"__unused\") ||\n         RCTReadString(input, \"__attribute__((unused))\");\n}\n\nstatic RCTNullability RCTParseNullability(const char **input)\n{\n  if (RCTReadString(input, \"nullable\")) {\n    return RCTNullable;\n  } else if (RCTReadString(input, \"nonnull\")) {\n    return RCTNonnullable;\n  }\n  return RCTNullabilityUnspecified;\n}\n\nstatic RCTNullability RCTParseNullabilityPostfix(const char **input)\n{\n  if (RCTReadString(input, \"_Nullable\")) {\n    return RCTNullable;\n  } else if (RCTReadString(input, \"_Nonnull\")) {\n    return RCTNonnullable;\n  }\n  return RCTNullabilityUnspecified;\n}\n\n// returns YES if execution is safe to proceed (enqueue callback invocation), NO if callback has already been invoked\n#if RCT_DEBUG\nstatic BOOL checkCallbackMultipleInvocations(BOOL *didInvoke) {\n  if (*didInvoke) {\n      RCTFatal(RCTErrorWithMessage(@\"Illegal callback invocation from native module. This callback type only permits a single invocation from native code.\"));\n      return NO;\n  } else {\n      *didInvoke = YES;\n      return YES;\n  }\n}\n#endif\n\nextern NSString *RCTParseMethodSignature(const char *input, NSArray<RCTMethodArgument *> **arguments);\nNSString *RCTParseMethodSignature(const char *input, NSArray<RCTMethodArgument *> **arguments)\n{\n  RCTSkipWhitespace(&input);\n\n  NSMutableArray *args;\n  NSMutableString *selector = [NSMutableString new];\n  while (RCTParseSelectorPart(&input, selector)) {\n    if (!args) {\n      args = [NSMutableArray new];\n    }\n\n    // Parse type\n    if (RCTReadChar(&input, '(')) {\n      RCTSkipWhitespace(&input);\n\n      BOOL unused = RCTParseUnused(&input);\n      RCTSkipWhitespace(&input);\n\n      RCTNullability nullability = RCTParseNullability(&input);\n      RCTSkipWhitespace(&input);\n\n      NSString *type = RCTParseType(&input);\n      RCTSkipWhitespace(&input);\n      if (nullability == RCTNullabilityUnspecified) {\n        nullability = RCTParseNullabilityPostfix(&input);\n      }\n      [args addObject:[[RCTMethodArgument alloc] initWithType:type\n                                                  nullability:nullability\n                                                       unused:unused]];\n      RCTSkipWhitespace(&input);\n      RCTReadChar(&input, ')');\n      RCTSkipWhitespace(&input);\n    } else {\n      // Type defaults to id if unspecified\n      [args addObject:[[RCTMethodArgument alloc] initWithType:@\"id\"\n                                                  nullability:RCTNullable\n                                                       unused:NO]];\n    }\n\n    // Argument name\n    RCTParseArgumentIdentifier(&input, NULL);\n    RCTSkipWhitespace(&input);\n  }\n\n  *arguments = [args copy];\n  return selector;\n}\n\nRCT_EXTERN_C_END\n\n- (instancetype)initWithExportedMethod:(const RCTMethodInfo *)exportedMethod\n                           moduleClass:(Class)moduleClass\n{\n  if (self = [super init]) {\n    _moduleClass = moduleClass;\n    _methodInfo = exportedMethod;\n  }\n  return self;\n}\n\n- (void)processMethodSignature\n{\n  NSArray<RCTMethodArgument *> *arguments;\n  _selector = NSSelectorFromString(RCTParseMethodSignature(_methodInfo->objcName, &arguments));\n  RCTAssert(_selector, @\"%s is not a valid selector\", _methodInfo->objcName);\n\n  // Create method invocation\n  NSMethodSignature *methodSignature = [_moduleClass instanceMethodSignatureForSelector:_selector];\n  RCTAssert(methodSignature, @\"%s is not a recognized Objective-C method.\", sel_getName(_selector));\n  NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSignature];\n  invocation.selector = _selector;\n  _invocation = invocation;\n  NSMutableArray *retainedObjects = [NSMutableArray array];\n  _retainedObjects = retainedObjects;\n\n  // Process arguments\n  NSUInteger numberOfArguments = methodSignature.numberOfArguments;\n  NSMutableArray<RCTArgumentBlock> *argumentBlocks =\n    [[NSMutableArray alloc] initWithCapacity:numberOfArguments - 2];\n\n#if RCT_DEBUG\n  __weak RCTModuleMethod *weakSelf = self;\n#endif\n\n#define RCT_RETAINED_ARG_BLOCK(_logic) \\\n[argumentBlocks addObject:^(__unused RCTBridge *bridge, NSUInteger index, id json) { \\\n  _logic                                                                             \\\n  [invocation setArgument:&value atIndex:(index) + 2];                               \\\n  if (value) {                                                                       \\\n    [retainedObjects addObject:value];                                               \\\n  }                                                                                  \\\n  return YES;                                                                        \\\n}]\n\n#define __PRIMITIVE_CASE(_type, _nullable) {                                           \\\n  isNullableType = _nullable;                                                          \\\n  _type (*convert)(id, SEL, id) = (__typeof__(convert))objc_msgSend;                   \\\n  [argumentBlocks addObject:^(__unused RCTBridge *bridge, NSUInteger index, id json) { \\\n    _type value = convert([RCTConvert class], selector, json);                         \\\n    [invocation setArgument:&value atIndex:(index) + 2];                               \\\n    return YES;                                                                        \\\n  }];                                                                                  \\\n  break;                                                                               \\\n}\n\n#define PRIMITIVE_CASE(_type) __PRIMITIVE_CASE(_type, NO)\n#define NULLABLE_PRIMITIVE_CASE(_type) __PRIMITIVE_CASE(_type, YES)\n\n// Explicitly copy the block\n#define __COPY_BLOCK(block...)         \\\n  id value = [block copy];             \\\n  if (value) {                         \\\n    [retainedObjects addObject:value]; \\\n  }                                    \\\n\n#if RCT_DEBUG\n#define BLOCK_CASE(_block_args, _block) RCT_RETAINED_ARG_BLOCK(         \\\n  if (json && ![json isKindOfClass:[NSNumber class]]) {                 \\\n    RCTLogArgumentError(weakSelf, index, json, \"should be a function\"); \\\n    return NO;                                                          \\\n  }                                                                     \\\n  __block BOOL didInvoke = NO;                                          \\\n  __COPY_BLOCK(^_block_args {                                           \\\n    if (checkCallbackMultipleInvocations(&didInvoke)) _block            \\\n  });                                                                   \\\n)\n#else\n#define BLOCK_CASE(_block_args, _block) \\\n  RCT_RETAINED_ARG_BLOCK( __COPY_BLOCK(^_block_args { _block }); )\n#endif\n\n  for (NSUInteger i = 2; i < numberOfArguments; i++) {\n    const char *objcType = [methodSignature getArgumentTypeAtIndex:i];\n    BOOL isNullableType = NO;\n    RCTMethodArgument *argument = arguments[i - 2];\n    NSString *typeName = argument.type;\n    SEL selector = selectorForType(typeName);\n    if ([RCTConvert respondsToSelector:selector]) {\n      switch (objcType[0]) {\n        // Primitives\n        case _C_CHR: PRIMITIVE_CASE(char)\n        case _C_UCHR: PRIMITIVE_CASE(unsigned char)\n        case _C_SHT: PRIMITIVE_CASE(short)\n        case _C_USHT: PRIMITIVE_CASE(unsigned short)\n        case _C_INT: PRIMITIVE_CASE(int)\n        case _C_UINT: PRIMITIVE_CASE(unsigned int)\n        case _C_LNG: PRIMITIVE_CASE(long)\n        case _C_ULNG: PRIMITIVE_CASE(unsigned long)\n        case _C_LNG_LNG: PRIMITIVE_CASE(long long)\n        case _C_ULNG_LNG: PRIMITIVE_CASE(unsigned long long)\n        case _C_FLT: PRIMITIVE_CASE(float)\n        case _C_DBL: PRIMITIVE_CASE(double)\n        case _C_BOOL: PRIMITIVE_CASE(BOOL)\n        case _C_SEL: NULLABLE_PRIMITIVE_CASE(SEL)\n        case _C_CHARPTR: NULLABLE_PRIMITIVE_CASE(const char *)\n        case _C_PTR: NULLABLE_PRIMITIVE_CASE(void *)\n\n        case _C_ID: {\n          isNullableType = YES;\n          id (*convert)(id, SEL, id) = (__typeof__(convert))objc_msgSend;\n          RCT_RETAINED_ARG_BLOCK(\n            id value = convert([RCTConvert class], selector, json);\n          );\n          break;\n        }\n\n        case _C_STRUCT_B: {\n          NSMethodSignature *typeSignature = [RCTConvert methodSignatureForSelector:selector];\n          NSInvocation *typeInvocation = [NSInvocation invocationWithMethodSignature:typeSignature];\n          typeInvocation.selector = selector;\n          typeInvocation.target = [RCTConvert class];\n\n          [argumentBlocks addObject:^(__unused RCTBridge *bridge, NSUInteger index, id json) {\n            void *returnValue = malloc(typeSignature.methodReturnLength);\n            [typeInvocation setArgument:&json atIndex:2];\n            [typeInvocation invoke];\n            [typeInvocation getReturnValue:returnValue];\n            [invocation setArgument:returnValue atIndex:index + 2];\n            free(returnValue);\n            return YES;\n          }];\n          break;\n        }\n\n        default: {\n          static const char *blockType = @encode(__typeof__(^{}));\n          if (!strcmp(objcType, blockType)) {\n            BLOCK_CASE((NSArray *args), {\n              [bridge enqueueCallback:json args:args];\n            });\n          } else {\n            RCTLogError(@\"Unsupported argument type '%@' in method %@.\",\n                        typeName, [self methodName]);\n          }\n        }\n      }\n    } else if ([typeName isEqualToString:@\"RCTResponseSenderBlock\"]) {\n      BLOCK_CASE((NSArray *args), {\n        [bridge enqueueCallback:json args:args];\n      });\n    } else if ([typeName isEqualToString:@\"RCTResponseErrorBlock\"]) {\n      BLOCK_CASE((NSError *error), {\n        [bridge enqueueCallback:json args:@[RCTJSErrorFromNSError(error)]];\n      });\n    } else if ([typeName isEqualToString:@\"RCTPromiseResolveBlock\"]) {\n      RCTAssert(i == numberOfArguments - 2,\n                @\"The RCTPromiseResolveBlock must be the second to last parameter in %@\",\n                [self methodName]);\n      BLOCK_CASE((id result), {\n        [bridge enqueueCallback:json args:result ? @[result] : @[]];\n      });\n    } else if ([typeName isEqualToString:@\"RCTPromiseRejectBlock\"]) {\n      RCTAssert(i == numberOfArguments - 1,\n                @\"The RCTPromiseRejectBlock must be the last parameter in %@\",\n                [self methodName]);\n      BLOCK_CASE((NSString *code, NSString *message, NSError *error), {\n        NSDictionary *errorJSON = RCTJSErrorFromCodeMessageAndNSError(code, message, error);\n        [bridge enqueueCallback:json args:@[errorJSON]];\n      });\n    } else if ([typeName hasPrefix:@\"JS::\"]) {\n      NSString *selectorNameForCxxType =\n      [[typeName stringByReplacingOccurrencesOfString:@\"::\" withString:@\"_\"]\n       stringByAppendingString:@\":\"];\n      selector = NSSelectorFromString(selectorNameForCxxType);\n\n      [argumentBlocks addObject:^(__unused RCTBridge *bridge, NSUInteger index, id json) {\n        RCTManagedPointer *(*convert)(id, SEL, id) = (__typeof__(convert))objc_msgSend;\n        RCTManagedPointer *box = convert([RCTCxxConvert class], selector, json);\n\n        void *pointer = box.voidPointer;\n        [invocation setArgument:&pointer atIndex:index + 2];\n        [retainedObjects addObject:box];\n\n        return YES;\n      }];\n    } else {\n      // Unknown argument type\n      RCTLogError(@\"Unknown argument type '%@' in method %@. Extend RCTConvert to support this type.\",\n                  typeName, [self methodName]);\n    }\n\n#if RCT_DEBUG\n    RCTNullability nullability = argument.nullability;\n    if (!isNullableType) {\n      if (nullability == RCTNullable) {\n        RCTLogArgumentError(weakSelf, i - 2, typeName, \"is marked as \"\n                            \"nullable, but is not a nullable type.\");\n      }\n      nullability = RCTNonnullable;\n    }\n\n    /**\n     * Special case - Numbers are not nullable in Android, so we\n     * don't support this for now. In future we may allow it.\n     */\n    if ([typeName isEqualToString:@\"NSNumber\"]) {\n      BOOL unspecified = (nullability == RCTNullabilityUnspecified);\n      if (!argument.unused && (nullability == RCTNullable || unspecified)) {\n        RCTLogArgumentError(weakSelf, i - 2, typeName,\n          [unspecified ? @\"has unspecified nullability\" : @\"is marked as nullable\"\n           stringByAppendingString: @\" but React requires that all NSNumber \"\n           \"arguments are explicitly marked as `nonnull` to ensure \"\n           \"compatibility with Android.\"].UTF8String);\n      }\n      nullability = RCTNonnullable;\n    }\n\n    if (nullability == RCTNonnullable) {\n      RCTArgumentBlock oldBlock = argumentBlocks[i - 2];\n      argumentBlocks[i - 2] = ^(RCTBridge *bridge, NSUInteger index, id json) {\n        if (json != nil) {\n          if (!oldBlock(bridge, index, json)) {\n            return NO;\n          }\n          if (isNullableType) {\n            // Check converted value wasn't null either, as method probably\n            // won't gracefully handle a nil vallue for a nonull argument\n            void *value;\n            [invocation getArgument:&value atIndex:index + 2];\n            if (value == NULL) {\n              return NO;\n            }\n          }\n          return YES;\n        }\n        RCTLogArgumentError(weakSelf, index, typeName, \"must not be null\");\n        return NO;\n      };\n    }\n#endif\n  }\n\n#if RCT_DEBUG\n  const char *objcType = _invocation.methodSignature.methodReturnType;\n  if (_methodInfo->isSync && objcType[0] != _C_ID) {\n    RCTLogError(@\"Return type of %@.%s should be (id) as the method is \\\"sync\\\"\",\n                RCTBridgeModuleNameForClass(_moduleClass), self.JSMethodName);\n  }\n#endif\n\n  _argumentBlocks = argumentBlocks;\n}\n\n- (SEL)selector\n{\n  if (_selector == NULL) {\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"\", (@{ @\"module\": NSStringFromClass(_moduleClass),\n                                                          @\"method\": @(_methodInfo->objcName) }));\n    [self processMethodSignature];\n    RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n  }\n  return _selector;\n}\n\n- (const char *)JSMethodName\n{\n  NSString *methodName = _JSMethodName;\n  if (!methodName) {\n    const char *jsName = _methodInfo->jsName;\n    if (jsName && strlen(jsName) > 0) {\n      methodName = @(jsName);\n    } else {\n      methodName = @(_methodInfo->objcName);\n      NSRange colonRange = [methodName rangeOfString:@\":\"];\n      if (colonRange.location != NSNotFound) {\n        methodName = [methodName substringToIndex:colonRange.location];\n      }\n      methodName = [methodName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];\n      RCTAssert(methodName.length, @\"%s is not a valid JS function name, please\"\n                \" supply an alternative using RCT_REMAP_METHOD()\", _methodInfo->objcName);\n    }\n    _JSMethodName = methodName;\n  }\n  return methodName.UTF8String;\n}\n\n- (RCTFunctionType)functionType\n{\n  if (strstr(_methodInfo->objcName, \"RCTPromise\") != NULL) {\n    RCTAssert(!_methodInfo->isSync, @\"Promises cannot be used in sync functions\");\n    return RCTFunctionTypePromise;\n  } else if (_methodInfo->isSync) {\n    return RCTFunctionTypeSync;\n  } else {\n    return RCTFunctionTypeNormal;\n  }\n}\n\n- (id)invokeWithBridge:(RCTBridge *)bridge\n                module:(id)module\n             arguments:(NSArray *)arguments\n{\n  if (_argumentBlocks == nil) {\n    [self processMethodSignature];\n  }\n\n#if RCT_DEBUG\n  // Sanity check\n  RCTAssert([module class] == _moduleClass, @\"Attempted to invoke method \\\n            %@ on a module of class %@\", [self methodName], [module class]);\n\n  // Safety check\n  if (arguments.count != _argumentBlocks.count) {\n    NSInteger actualCount = arguments.count;\n    NSInteger expectedCount = _argumentBlocks.count;\n\n    // Subtract the implicit Promise resolver and rejecter functions for implementations of async functions\n    if (self.functionType == RCTFunctionTypePromise) {\n      actualCount -= 2;\n      expectedCount -= 2;\n    }\n\n    RCTLogError(@\"%@.%s was called with %lld arguments but expects %lld arguments. \"\n                @\"If you haven\\'t changed this method yourself, this usually means that \"\n                @\"your versions of the native code and JavaScript code are out of sync. \"\n                @\"Updating both should make this error go away.\",\n                RCTBridgeModuleNameForClass(_moduleClass), self.JSMethodName,\n                (long long)actualCount, (long long)expectedCount);\n    return nil;\n  }\n#endif\n\n  // Set arguments\n  NSUInteger index = 0;\n  for (id json in arguments) {\n    RCTArgumentBlock block = _argumentBlocks[index];\n    if (!block(bridge, index, RCTNilIfNull(json))) {\n      // Invalid argument, abort\n      RCTLogArgumentError(self, index, json, \"could not be processed. Aborting method call.\");\n      return nil;\n    }\n    index++;\n  }\n\n  // Invoke method\n#ifdef RCT_MAIN_THREAD_WATCH_DOG_THRESHOLD\n  if (RCTIsMainQueue()) {\n    CFTimeInterval start = CACurrentMediaTime();\n    [_invocation invokeWithTarget:module];\n    CFTimeInterval duration = CACurrentMediaTime() - start;\n    if (duration > RCT_MAIN_THREAD_WATCH_DOG_THRESHOLD) {\n      RCTLogWarn(\n                 @\"Main Thread Watchdog: Invocation of %@ blocked the main thread for %dms. \"\n                 \"Consider using background-threaded modules and asynchronous calls \"\n                 \"to spend less time on the main thread and keep the app's UI responsive.\",\n                 [self methodName],\n                 (int)(duration * 1000)\n                 );\n    }\n  } else {\n    [_invocation invokeWithTarget:module];\n  }\n#else\n  [_invocation invokeWithTarget:module];\n#endif\n\n  index = 2;\n  [_retainedObjects removeAllObjects];\n\n  if (_methodInfo->isSync) {\n    void *returnValue;\n    [_invocation getReturnValue:&returnValue];\n    return (__bridge id)returnValue;\n  }\n  return nil;\n}\n\n- (NSString *)methodName\n{\n  if (!_selector) {\n    [self processMethodSignature];\n  }\n  return [NSString stringWithFormat:@\"-[%@ %s]\", _moduleClass, sel_getName(_selector)];\n}\n\n- (NSString *)description\n{\n  return [NSString stringWithFormat:@\"<%@: %p; exports %@ as %s(); type: %s>\",\n          [self class], self, [self methodName], self.JSMethodName, RCTFunctionDescriptorFromType(self.functionType)];\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTMultipartDataTask.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTMultipartStreamReader.h>\n\ntypedef void (^RCTMultipartDataTaskCallback)(NSInteger statusCode, NSDictionary *headers, NSData *content, NSError *error, BOOL done);\n\n@interface RCTMultipartDataTask : NSObject\n\n- (instancetype)initWithURL:(NSURL *)url\n                partHandler:(RCTMultipartDataTaskCallback)partHandler\n            progressHandler:(RCTMultipartProgressCallback)progressHandler;\n\n- (void)startTask;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTMultipartDataTask.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTMultipartDataTask.h\"\n\n@interface RCTMultipartDataTask () <NSURLSessionDataDelegate, NSURLSessionDataDelegate>\n\n@end\n\n// We need this ugly runtime check because [streamTask captureStreams] below fails on iOS version\n// earlier than 9.0. Unfortunately none of the proper ways of checking worked:\n//\n// - NSURLSessionStreamTask class is available and is not Null on iOS 8\n// - [[NSURLSessionStreamTask new] respondsToSelector:@selector(captureStreams)] is always NO\n// - The instance we get in URLSession:dataTask:didBecomeStreamTask: is of __NSCFURLLocalStreamTaskFromDataTask\n//   and it responds to captureStreams on iOS 9+ but doesn't on iOS 8. Which means we can't get direct access\n//   to the streams on iOS 8 and at that point it's too late to change the behavior back to dataTask\n// - The compile-time #ifdef's can't be used because an app compiled for iOS8 can still run on iOS9\n\nstatic BOOL isStreamTaskSupported() {\n  return [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){9,0,0}];\n}\n\n@implementation RCTMultipartDataTask {\n  NSURL *_url;\n  RCTMultipartDataTaskCallback _partHandler;\n  RCTMultipartProgressCallback _progressHandler;\n  NSInteger _statusCode;\n  NSDictionary *_headers;\n  NSString *_boundary;\n  NSMutableData *_data;\n}\n\n- (instancetype)initWithURL:(NSURL *)url\n                partHandler:(RCTMultipartDataTaskCallback)partHandler\n            progressHandler:(RCTMultipartProgressCallback)progressHandler\n{\n  if (self = [super init]) {\n    _url = url;\n    _partHandler = [partHandler copy];\n    _progressHandler = [progressHandler copy];\n  }\n  return self;\n}\n\n- (void)startTask\n{\n  NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]\n                                                        delegate:self delegateQueue:nil];\n  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:_url];\n  if (isStreamTaskSupported()) {\n    [request addValue:@\"multipart/mixed\" forHTTPHeaderField:@\"Accept\"];\n  }\n  NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request];\n  [dataTask resume];\n  [session finishTasksAndInvalidate];\n}\n\n- (void)URLSession:(__unused NSURLSession *)session\n          dataTask:(__unused NSURLSessionDataTask *)dataTask\ndidReceiveResponse:(NSURLResponse *)response\n completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler\n{\n  if ([response isKindOfClass:[NSHTTPURLResponse class]]) {\n    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;\n    _headers = [httpResponse allHeaderFields];\n    _statusCode = [httpResponse statusCode];\n\n    NSString *contentType = @\"\";\n    for (NSString *key in [_headers keyEnumerator]) {\n      if ([[key lowercaseString] isEqualToString:@\"content-type\"]) {\n        contentType = [_headers valueForKey:key];\n        break;\n      }\n    }\n\n    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@\"multipart/mixed;.*boundary=\\\"([^\\\"]+)\\\"\" options:0 error:nil];\n    NSTextCheckingResult *match = [regex firstMatchInString:contentType options:0 range:NSMakeRange(0, contentType.length)];\n    if (match) {\n      _boundary = [contentType substringWithRange:[match rangeAtIndex:1]];\n      completionHandler(NSURLSessionResponseBecomeStream);\n      return;\n    }\n  }\n\n  // In case the server doesn't support multipart/mixed responses, fallback to normal download\n  _data = [[NSMutableData alloc] initWithCapacity:1024 * 1024];\n  completionHandler(NSURLSessionResponseAllow);\n}\n\n- (void)URLSession:(__unused NSURLSession *)session task:(__unused NSURLSessionTask *)task didCompleteWithError:(NSError *)error\n{\n  if (_partHandler) {\n    _partHandler(_statusCode, _headers, _data, error, YES);\n  }\n}\n\n- (void)URLSession:(__unused NSURLSession *)session dataTask:(__unused NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data\n{\n  [_data appendData:data];\n}\n\n- (void)URLSession:(__unused NSURLSession *)session dataTask:(__unused NSURLSessionDataTask *)dataTask didBecomeStreamTask:(NSURLSessionStreamTask *)streamTask\n{\n  [streamTask captureStreams];\n}\n\n- (void)URLSession:(__unused NSURLSession *)session\n        streamTask:(__unused NSURLSessionStreamTask *)streamTask\ndidBecomeInputStream:(NSInputStream *)inputStream\n      outputStream:(__unused NSOutputStream *)outputStream\n{\n  RCTMultipartStreamReader *reader = [[RCTMultipartStreamReader alloc] initWithInputStream:inputStream boundary:_boundary];\n  RCTMultipartDataTaskCallback partHandler = _partHandler;\n  _partHandler = nil;\n  NSInteger statusCode = _statusCode;\n\n  BOOL completed = [reader readAllPartsWithCompletionCallback:^(NSDictionary *headers, NSData *content, BOOL done) {\n    partHandler(statusCode, headers, content, nil, done);\n  } progressCallback:_progressHandler];\n  if (!completed) {\n    partHandler(statusCode, nil, nil, [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:nil], YES);\n  }\n}\n\n\n@end\n"
  },
  {
    "path": "React/Base/RCTMultipartStreamReader.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\ntypedef void (^RCTMultipartCallback)(NSDictionary *headers, NSData *content, BOOL done);\ntypedef void (^RCTMultipartProgressCallback)(NSDictionary *headers, NSNumber *loaded, NSNumber *total);\n\n\n// RCTMultipartStreamReader can be used to parse responses with Content-Type: multipart/mixed\n// See https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html\n@interface RCTMultipartStreamReader : NSObject\n\n- (instancetype)initWithInputStream:(NSInputStream *)stream boundary:(NSString *)boundary;\n- (BOOL)readAllPartsWithCompletionCallback:(RCTMultipartCallback)callback\n                          progressCallback:(RCTMultipartProgressCallback)progressCallback;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTMultipartStreamReader.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTMultipartStreamReader.h\"\n\n#import <QuartzCore/CAAnimation.h>\n\n#define CRLF @\"\\r\\n\"\n\n@implementation RCTMultipartStreamReader {\n  __strong NSInputStream *_stream;\n  __strong NSString *_boundary;\n  CFTimeInterval _lastDownloadProgress;\n}\n\n- (instancetype)initWithInputStream:(NSInputStream *)stream boundary:(NSString *)boundary\n{\n  if (self = [super init]) {\n    _stream = stream;\n    _boundary = boundary;\n    _lastDownloadProgress = CACurrentMediaTime();\n  }\n  return self;\n}\n\n- (NSDictionary *)parseHeaders:(NSData *)data\n{\n  NSMutableDictionary *headers = [NSMutableDictionary new];\n  NSString *text = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];\n  NSArray<NSString *> *lines = [text componentsSeparatedByString:CRLF];\n  for (NSString *line in lines) {\n    NSUInteger location = [line rangeOfString:@\":\"].location;\n    if (location == NSNotFound) {\n      continue;\n    }\n    NSString *key = [line substringToIndex:location];\n    NSString *value = [[line substringFromIndex:location + 1] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];\n    [headers setValue:value forKey:key];\n  }\n  return headers;\n}\n\n- (void)emitChunk:(NSData *)data headers:(NSDictionary *)headers callback:(RCTMultipartCallback)callback done:(BOOL)done\n{\n  NSData *marker = [CRLF CRLF dataUsingEncoding:NSUTF8StringEncoding];\n  NSRange range = [data rangeOfData:marker options:0 range:NSMakeRange(0, data.length)];\n  if (range.location == NSNotFound) {\n    callback(nil, data, done);\n  } else if (headers != nil) {\n    // If headers were parsed already just use that to avoid doing it twice.\n    NSInteger bodyStart = range.location + marker.length;\n    NSData *bodyData = [data subdataWithRange:NSMakeRange(bodyStart, data.length - bodyStart)];\n    callback(headers, bodyData, done);\n  } else {\n    NSData *headersData = [data subdataWithRange:NSMakeRange(0, range.location)];\n    NSInteger bodyStart = range.location + marker.length;\n    NSData *bodyData = [data subdataWithRange:NSMakeRange(bodyStart, data.length - bodyStart)];\n    callback([self parseHeaders:headersData], bodyData, done);\n  }\n}\n\n- (void)emitProgress:(NSDictionary *)headers\n       contentLength:(NSUInteger)contentLength\n               final:(BOOL)final\n            callback:(RCTMultipartProgressCallback)callback\n{\n  if (headers == nil) {\n    return;\n  }\n  // Throttle progress events so we don't send more that around 60 per second.\n  CFTimeInterval currentTime = CACurrentMediaTime();\n\n  NSInteger headersContentLength = headers[@\"Content-Length\"] != nil ? [headers[@\"Content-Length\"] integerValue] : 0;\n  if (callback && (currentTime - _lastDownloadProgress > 0.016 || final)) {\n    _lastDownloadProgress = currentTime;\n    callback(headers, @(headersContentLength), @(contentLength));\n  }\n}\n\n- (BOOL)readAllPartsWithCompletionCallback:(RCTMultipartCallback)callback\n                          progressCallback:(RCTMultipartProgressCallback)progressCallback\n{\n  NSInteger chunkStart = 0;\n  NSInteger bytesSeen = 0;\n\n  NSData *delimiter = [[NSString stringWithFormat:@\"%@--%@%@\", CRLF, _boundary, CRLF] dataUsingEncoding:NSUTF8StringEncoding];\n  NSData *closeDelimiter = [[NSString stringWithFormat:@\"%@--%@--%@\", CRLF, _boundary, CRLF] dataUsingEncoding:NSUTF8StringEncoding];\n  NSMutableData *content = [[NSMutableData alloc] initWithCapacity:1];\n  NSDictionary *currentHeaders = nil;\n  NSUInteger currentHeadersLength = 0;\n\n  const NSUInteger bufferLen = 4 * 1024;\n  uint8_t buffer[bufferLen];\n\n  [_stream open];\n  while (true) {\n    BOOL isCloseDelimiter = NO;\n    // Search only a subset of chunk that we haven't seen before + few bytes\n    // to allow for the edge case when the delimiter is cut by read call\n    NSInteger searchStart = MAX(bytesSeen - (NSInteger)closeDelimiter.length, chunkStart);\n    NSRange remainingBufferRange = NSMakeRange(searchStart, content.length - searchStart);\n\n    // Check for delimiters.\n    NSRange range = [content rangeOfData:delimiter options:0 range:remainingBufferRange];\n    if (range.location == NSNotFound) {\n      isCloseDelimiter = YES;\n      range = [content rangeOfData:closeDelimiter options:0 range:remainingBufferRange];\n    }\n\n    if (range.location == NSNotFound) {\n      if (currentHeaders == nil) {\n        // Check for the headers delimiter.\n        NSData *headersMarker = [CRLF CRLF dataUsingEncoding:NSUTF8StringEncoding];\n        NSRange headersRange = [content rangeOfData:headersMarker options:0 range:remainingBufferRange];\n        if (headersRange.location != NSNotFound) {\n          NSData *headersData = [content subdataWithRange:NSMakeRange(chunkStart, headersRange.location - chunkStart)];\n          currentHeadersLength = headersData.length;\n          currentHeaders = [self parseHeaders:headersData];\n        }\n      } else {\n        // When headers are loaded start sending progress callbacks.\n        [self emitProgress:currentHeaders\n             contentLength:content.length - currentHeadersLength\n                     final:NO\n                  callback:progressCallback];\n      }\n\n      bytesSeen = content.length;\n      NSInteger bytesRead = [_stream read:buffer maxLength:bufferLen];\n      if (bytesRead <= 0 || _stream.streamError) {\n        return NO;\n      }\n      [content appendBytes:buffer length:bytesRead];\n      continue;\n    }\n\n    NSInteger chunkEnd = range.location;\n    NSInteger length = chunkEnd - chunkStart;\n    bytesSeen = chunkEnd;\n\n    // Ignore preamble\n    if (chunkStart > 0) {\n      NSData *chunk = [content subdataWithRange:NSMakeRange(chunkStart, length)];\n      [self emitProgress:currentHeaders\n           contentLength:chunk.length - currentHeadersLength\n                   final:YES\n                callback:progressCallback];\n      [self emitChunk:chunk headers:currentHeaders callback:callback done:isCloseDelimiter];\n      currentHeaders = nil;\n      currentHeadersLength = 0;\n    }\n\n    if (isCloseDelimiter) {\n      return YES;\n    }\n\n    chunkStart = chunkEnd + delimiter.length;\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTNullability.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\ntypedef NS_ENUM(NSUInteger, RCTNullability) {\n  RCTNullabilityUnspecified,\n  RCTNullable,\n  RCTNonnullable,\n};\n"
  },
  {
    "path": "React/Base/RCTParserUtils.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTDefines.h>\n\n@interface RCTParserUtils : NSObject\n\n/**\n * Generic utility functions for parsing Objective-C source code.\n */\nRCT_EXTERN BOOL RCTReadChar(const char **input, char c);\nRCT_EXTERN BOOL RCTReadString(const char **input, const char *string);\nRCT_EXTERN void RCTSkipWhitespace(const char **input);\nRCT_EXTERN BOOL RCTParseSelectorIdentifier(const char **input, NSString **string);\nRCT_EXTERN BOOL RCTParseArgumentIdentifier(const char **input, NSString **string);\n\n/**\n * Parse an Objective-C type into a form that can be used by RCTConvert.\n * This doesn't really belong here, but it's used by both RCTConvert and\n * RCTModuleMethod, which makes it difficult to find a better home for it.\n */\nRCT_EXTERN NSString *RCTParseType(const char **input);\n\n@end\n"
  },
  {
    "path": "React/Base/RCTParserUtils.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTParserUtils.h\"\n\n#import \"RCTLog.h\"\n\n@implementation RCTParserUtils\n\nBOOL RCTReadChar(const char **input, char c)\n{\n  if (**input == c) {\n    (*input)++;\n    return YES;\n  }\n  return NO;\n}\n\nBOOL RCTReadString(const char **input, const char *string)\n{\n  int i;\n  for (i = 0; string[i] != 0; i++) {\n    if (string[i] != (*input)[i]) {\n      return NO;\n    }\n  }\n  *input += i;\n  return YES;\n}\n\nvoid RCTSkipWhitespace(const char **input)\n{\n  while (isspace(**input)) {\n    (*input)++;\n  }\n}\n\nstatic BOOL RCTIsIdentifierHead(const char c)\n{\n  return isalpha(c) || c == '_';\n}\n\nstatic BOOL RCTIsIdentifierTail(const char c)\n{\n  return isalnum(c) || c == '_';\n}\n\nBOOL RCTParseArgumentIdentifier(const char **input, NSString **string)\n{\n  const char *start = *input;\n\n  do {\n    if (!RCTIsIdentifierHead(**input)) {\n      return NO;\n    }\n    (*input)++;\n\n    while (RCTIsIdentifierTail(**input)) {\n      (*input)++;\n    }\n\n  // allow namespace resolution operator\n  } while (RCTReadString(input, \"::\"));\n\n  if (string) {\n    *string = [[NSString alloc] initWithBytes:start\n                                       length:(NSInteger)(*input - start)\n                                     encoding:NSASCIIStringEncoding];\n  }\n  return YES;\n}\n\nBOOL RCTParseSelectorIdentifier(const char **input, NSString **string)\n{\n  const char *start = *input;\n  if (!RCTIsIdentifierHead(**input)) {\n    return NO;\n  }\n  (*input)++;\n  while (RCTIsIdentifierTail(**input)) {\n    (*input)++;\n  }\n  if (string) {\n    *string = [[NSString alloc] initWithBytes:start\n                                       length:(NSInteger)(*input - start)\n                                     encoding:NSASCIIStringEncoding];\n  }\n  return YES;\n}\n\nstatic BOOL RCTIsCollectionType(NSString *type)\n{\n  static NSSet *collectionTypes;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    collectionTypes = [[NSSet alloc] initWithObjects:\n                       @\"NSArray\", @\"NSSet\", @\"NSDictionary\", nil];\n  });\n  return [collectionTypes containsObject:type];\n}\n\nNSString *RCTParseType(const char **input)\n{\n  NSString *type;\n  RCTParseArgumentIdentifier(input, &type);\n  RCTSkipWhitespace(input);\n  if (RCTReadChar(input, '<')) {\n    RCTSkipWhitespace(input);\n    NSString *subtype = RCTParseType(input);\n    if (RCTIsCollectionType(type)) {\n      if ([type isEqualToString:@\"NSDictionary\"]) {\n        // Dictionaries have both a key *and* value type, but the key type has\n        // to be a string for JSON, so we only care about the value type\n        if (RCT_DEBUG && ![subtype isEqualToString:@\"NSString\"]) {\n          RCTLogError(@\"%@ is not a valid key type for a JSON dictionary\", subtype);\n        }\n        RCTSkipWhitespace(input);\n        RCTReadChar(input, ',');\n        RCTSkipWhitespace(input);\n        subtype = RCTParseType(input);\n      }\n      if (![subtype isEqualToString:@\"id\"]) {\n        type = [type stringByReplacingCharactersInRange:(NSRange){0, 2 /* \"NS\" */}\n                                             withString:subtype];\n      }\n    } else {\n      // It's a protocol rather than a generic collection - ignore it\n    }\n    RCTSkipWhitespace(input);\n    RCTReadChar(input, '>');\n  }\n  RCTSkipWhitespace(input);\n  if (!RCTReadChar(input, '*')) {\n    RCTReadChar(input, '&');\n  }\n  return type;\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTPerformanceLogger.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\ntypedef NS_ENUM(NSUInteger, RCTPLTag) {\n  RCTPLScriptDownload = 0,\n  RCTPLScriptExecution,\n  RCTPLRAMBundleLoad,\n  RCTPLRAMStartupCodeSize,\n  RCTPLRAMStartupNativeRequires,\n  RCTPLRAMStartupNativeRequiresCount,\n  RCTPLRAMNativeRequires,\n  RCTPLRAMNativeRequiresCount,\n  RCTPLNativeModuleInit,\n  RCTPLNativeModuleMainThread,\n  RCTPLNativeModulePrepareConfig,\n  RCTPLNativeModuleInjectConfig,\n  RCTPLNativeModuleMainThreadUsesCount,\n  RCTPLJSCWrapperOpenLibrary,\n  RCTPLJSCExecutorSetup,\n  RCTPLBridgeStartup,\n  RCTPLTTI,\n  RCTPLBundleSize,\n  RCTPLSize\n};\n\n@interface RCTPerformanceLogger : NSObject\n\n/**\n * Starts measuring a metric with the given tag.\n * Overrides previous value if the measurement has been already started.\n * If RCTProfile is enabled it also begins appropriate async event.\n * All work is scheduled on the background queue so this doesn't block current thread.\n */\n- (void)markStartForTag:(RCTPLTag)tag;\n\n/**\n * Stops measuring a metric with given tag.\n * Checks if RCTPerformanceLoggerStart() has been called before\n * and doesn't do anything and log a message if it hasn't.\n * If RCTProfile is enabled it also ends appropriate async event.\n * All work is scheduled on the background queue so this doesn't block current thread.\n */\n- (void)markStopForTag:(RCTPLTag)tag;\n\n/**\n * Sets given value for a metric with given tag.\n * All work is scheduled on the background queue so this doesn't block current thread.\n */\n- (void)setValue:(int64_t)value forTag:(RCTPLTag)tag;\n\n/**\n * Adds given value to the current value for a metric with given tag.\n * All work is scheduled on the background queue so this doesn't block current thread.\n */\n- (void)addValue:(int64_t)value forTag:(RCTPLTag)tag;\n\n/**\n * Starts an additional measurement for a metric with given tag.\n * It doesn't override previous measurement, instead it'll append a new value\n * to the old one.\n * All work is scheduled on the background queue so this doesn't block current thread.\n */\n- (void)appendStartForTag:(RCTPLTag)tag;\n\n/**\n * Stops measurement and appends the result to the metric with given tag.\n * Checks if RCTPerformanceLoggerAppendStart() has been called before\n * and doesn't do anything and log a message if it hasn't.\n * All work is scheduled on the background queue so this doesn't block current thread.\n */\n- (void)appendStopForTag:(RCTPLTag)tag;\n\n/**\n * Returns an array with values for all tags.\n * Use RCTPLTag to go over the array, there's a pair of values\n * for each tag: start and stop (with indexes 2 * tag and 2 * tag + 1).\n */\n- (NSArray<NSNumber *> *)valuesForTags;\n\n/**\n * Returns a duration in ms (stop_time - start_time) for given RCTPLTag.\n */\n- (int64_t)durationForTag:(RCTPLTag)tag;\n\n/**\n * Returns a value for given RCTPLTag.\n */\n- (int64_t)valueForTag:(RCTPLTag)tag;\n\n/**\n * Returns an array with values for all tags.\n * Use RCTPLTag to go over the array.\n */\n- (NSArray<NSString *> *)labelsForTags;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTPerformanceLogger.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <QuartzCore/QuartzCore.h>\n\n#import \"RCTPerformanceLogger.h\"\n#import \"RCTRootView.h\"\n#import \"RCTLog.h\"\n#import \"RCTProfile.h\"\n\n@interface RCTPerformanceLogger ()\n{\n  int64_t _data[RCTPLSize][2];\n  NSUInteger _cookies[RCTPLSize];\n}\n\n@property (nonatomic, copy) NSArray<NSString *> *labelsForTags;\n\n@end\n\n@implementation RCTPerformanceLogger\n\n- (instancetype)init\n{\n  if (self = [super init]) {\n    _labelsForTags = @[\n      @\"ScriptDownload\",\n      @\"ScriptExecution\",\n      @\"RAMBundleLoad\",\n      @\"RAMStartupCodeSize\",\n      @\"RAMStartupNativeRequires\",\n      @\"RAMStartupNativeRequiresCount\",\n      @\"RAMNativeRequires\",\n      @\"RAMNativeRequiresCount\",\n      @\"NativeModuleInit\",\n      @\"NativeModuleMainThread\",\n      @\"NativeModulePrepareConfig\",\n      @\"NativeModuleInjectConfig\",\n      @\"NativeModuleMainThreadUsesCount\",\n      @\"JSCWrapperOpenLibrary\",\n      @\"JSCExecutorSetup\",\n      @\"BridgeStartup\",\n      @\"RootViewTTI\",\n      @\"BundleSize\",\n    ];\n  }\n  return self;\n}\n\n- (void)markStartForTag:(RCTPLTag)tag\n{\n#if RCT_PROFILE\n  if (RCTProfileIsProfiling()) {\n    NSString *label = _labelsForTags[tag];\n    _cookies[tag] = RCTProfileBeginAsyncEvent(RCTProfileTagAlways, label, nil);\n  }\n#endif\n  _data[tag][0] = CACurrentMediaTime() * 1000;\n  _data[tag][1] = 0;\n}\n\n\n- (void)markStopForTag:(RCTPLTag)tag\n{\n#if RCT_PROFILE\n  if (RCTProfileIsProfiling()) {\n    NSString *label =_labelsForTags[tag];\n    RCTProfileEndAsyncEvent(RCTProfileTagAlways, @\"native\", _cookies[tag], label, @\"RCTPerformanceLogger\");\n  }\n#endif\n  if (_data[tag][0] != 0 && _data[tag][1] == 0) {\n    _data[tag][1] = CACurrentMediaTime() * 1000;\n  } else {\n    RCTLogInfo(@\"Unbalanced calls start/end for tag %li\", (unsigned long)tag);\n  }\n}\n\n- (void)setValue:(int64_t)value forTag:(RCTPLTag)tag\n{\n  _data[tag][0] = 0;\n  _data[tag][1] = value;\n}\n\n- (void)addValue:(int64_t)value forTag:(RCTPLTag)tag\n{\n  _data[tag][0] = 0;\n  _data[tag][1] += value;\n}\n\n- (void)appendStartForTag:(RCTPLTag)tag\n{\n  _data[tag][0] = CACurrentMediaTime() * 1000;\n}\n\n- (void)appendStopForTag:(RCTPLTag)tag\n{\n  if (_data[tag][0] != 0) {\n    _data[tag][1] += CACurrentMediaTime() * 1000 - _data[tag][0];\n    _data[tag][0] = 0;\n  } else {\n    RCTLogInfo(@\"Unbalanced calls start/end for tag %li\", (unsigned long)tag);\n  }\n}\n\n- (NSArray<NSNumber *> *)valuesForTags\n{\n  NSMutableArray *result = [NSMutableArray array];\n  for (NSUInteger index = 0; index < RCTPLSize; index++) {\n    [result addObject:@(_data[index][0])];\n    [result addObject:@(_data[index][1])];\n  }\n  return result;\n}\n\n- (int64_t)durationForTag:(RCTPLTag)tag\n{\n  return _data[tag][1] - _data[tag][0];\n}\n\n- (int64_t)valueForTag:(RCTPLTag)tag\n{\n  return _data[tag][1];\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTPlatform.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridgeModule.h>\n\n@interface RCTPlatform : NSObject <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "React/Base/RCTPlatform.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTPlatform.h\"\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTUtils.h\"\n#import \"RCTVersion.h\"\n\n//static NSString *interfaceIdiom(UIUserInterfaceIdiom idiom) {\n//  switch(idiom) {\n//    case UIUserInterfaceIdiomPhone:\n//      return @\"phone\";\n//    case UIUserInterfaceIdiomPad:\n//      return @\"pad\";\n//    case UIUserInterfaceIdiomTV:\n//      return @\"tv\";\n//    case UIUserInterfaceIdiomCarPlay:\n//      return @\"carplay\";\n//    default:\n//      return @\"unknown\";\n//  }\n//}\n\n@implementation RCTPlatform\n\nRCT_EXPORT_MODULE(PlatformConstants)\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES;\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n\n  return @{\n    @\"forceTouchAvailable\": @(RCTForceTouchAvailable()),\n    @\"osVersion\": [[NSProcessInfo processInfo] operatingSystemVersionString],\n    @\"systemName\": [[NSProcessInfo processInfo] operatingSystemVersionString],\n    @\"interfaceIdiom\": @\"macos\",\n    @\"isTesting\": @(RCTRunningInTestEnvironment()),\n    @\"reactNativeVersion\": RCT_REACT_NATIVE_VERSION,\n  };\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTReloadCommand.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTDefines.h>\n\n@protocol RCTReloadListener\n- (void)didReceiveReloadCommand;\n@end\n\n/** Registers a weakly-held observer of the Command+R reload key command. */\nRCT_EXTERN void RCTRegisterReloadCommandListener(id<RCTReloadListener> listener);\n\n/** Triggers a reload for all current listeners. You shouldn't need to use this directly in most cases. */\nRCT_EXTERN void RCTTriggerReloadCommandListeners(void);\n"
  },
  {
    "path": "React/Base/RCTReloadCommand.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTReloadCommand.h\"\n\n#import \"RCTAssert.h\"\n#import \"RCTKeyCommands.h\"\n\n/** main queue only */\nstatic NSHashTable<id<RCTReloadListener>> *listeners;\n\nvoid RCTRegisterReloadCommandListener(id<RCTReloadListener> listener)\n{\n  RCTAssertMainQueue(); // because registerKeyCommandWithInput: must be called on the main thread\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    listeners = [NSHashTable weakObjectsHashTable];\n    [[RCTKeyCommands sharedInstance] registerKeyCommandWithInput:@\"r\"\n                                                   modifierFlags:NSEventModifierFlagCommand\n                                                          action:\n     ^(__unused NSEvent *command) {\n       RCTTriggerReloadCommandListeners();\n     }];\n  });\n  [listeners addObject:listener];\n}\n\nvoid RCTTriggerReloadCommandListeners(void)\n{\n  RCTAssertMainQueue();\n  // Copy to protect against mutation-during-enumeration.\n  // If listeners hasn't been initialized yet we get nil, which works just fine.\n  NSArray<id<RCTReloadListener>> *copiedListeners = [listeners allObjects];\n  for (id<RCTReloadListener> l in copiedListeners) {\n    [l didReceiveReloadCommand];\n  }\n}\n"
  },
  {
    "path": "React/Base/RCTRootContentView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTInvalidating.h>\n#import <React/RCTRootView.h>\n#import <React/RCTView.h>\n\n@class RCTBridge;\n@class RCTTouchHandler;\n\n@interface RCTRootContentView : RCTView <RCTInvalidating>\n\n@property (nonatomic, readonly, weak) RCTBridge *bridge;\n@property (nonatomic, readonly, assign) BOOL contentHasAppeared;\n@property (nonatomic, readonly, strong) RCTTouchHandler *touchHandler;\n@property (nonatomic, readonly, assign) CGSize availableSize;\n\n\n@property (nonatomic, assign) BOOL passThroughTouches;\n@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility;\n\n- (instancetype)initWithFrame:(CGRect)frame\n                       bridge:(RCTBridge *)bridge\n                     reactTag:(NSNumber *)reactTag\n               sizeFlexiblity:(RCTRootViewSizeFlexibility)sizeFlexibility NS_DESIGNATED_INITIALIZER;\n\n- (NSColor *)backgroundColor;\n@end\n"
  },
  {
    "path": "React/Base/RCTRootContentView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTRootContentView.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTPerformanceLogger.h\"\n#import \"RCTRootView.h\"\n#import \"RCTRootViewInternal.h\"\n#import \"RCTTouchHandler.h\"\n#import \"RCTUIManager.h\"\n#import \"NSView+React.h\"\n\n@implementation RCTRootContentView\n\n- (instancetype)initWithFrame:(CGRect)frame\n                       bridge:(RCTBridge *)bridge\n                     reactTag:(NSNumber *)reactTag\n               sizeFlexiblity:(RCTRootViewSizeFlexibility)sizeFlexibility\n{\n  if ((self = [super initWithFrame:frame])) {\n    _bridge = bridge;\n    self.reactTag = reactTag;\n    _sizeFlexibility = sizeFlexibility;\n    _touchHandler = [[RCTTouchHandler alloc] initWithBridge:_bridge];\n    [_touchHandler attachToView:self];\n    [_bridge.uiManager registerRootView:self];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder:(nonnull NSCoder *)aDecoder)\n\n- (void)layout\n{\n  [super layout];\n  [self updateAvailableSize];\n}\n\n- (void)addSubview:(NSView *)subview\n{\n  [super addSubview:subview];\n  [_bridge.performanceLogger markStopForTag:RCTPLTTI];\n  dispatch_async(dispatch_get_main_queue(), ^{\n    if (!self->_contentHasAppeared) {\n      self->_contentHasAppeared = YES;\n      [[NSNotificationCenter defaultCenter] postNotificationName:RCTContentDidAppearNotification\n                                                          object:self.superview];\n    }\n  });\n}\n\n- (void)setSizeFlexibility:(RCTRootViewSizeFlexibility)sizeFlexibility\n{\n  if (_sizeFlexibility == sizeFlexibility) {\n    return;\n  }\n\n  _sizeFlexibility = sizeFlexibility;\n  [self setNeedsLayout: YES];\n}\n\n- (CGSize)availableSize\n{\n  CGSize size = self.bounds.size;\n  return CGSizeMake(\n      _sizeFlexibility & RCTRootViewSizeFlexibilityWidth ? INFINITY : size.width,\n      _sizeFlexibility & RCTRootViewSizeFlexibilityHeight ? INFINITY : size.height\n    );\n}\n\n- (void)updateAvailableSize\n{\n  if (!self.reactTag || !_bridge.isValid) {\n    return;\n  }\n\n  [_bridge.uiManager setAvailableSize:self.availableSize forRootView:self];\n}\n\n- (NSView *)hitTest:(CGPoint)point withEvent:(NSEvent *)event\n{\n  // The root content view itself should never receive touches\n//  NSView *hitView = [super hitTest:point withEvent:event];\n//  if (_passThroughTouches && hitView == self) {\n//    return nil;\n//  }\n//  return hitView;\n  return nil;\n}\n\n- (void)invalidate\n{\n  //if (self.userInteractionEnabled) {\n    // self.userInteractionEnabled = NO;\n    [(RCTRootView *)self.superview contentViewInvalidated];\n    [_bridge enqueueJSCall:@\"AppRegistry\"\n                    method:@\"unmountApplicationComponentAtRootTag\"\n                      args:@[self.reactTag]\n                completion:NULL];\n  //}\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTRootView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBridge.h>\n\n@protocol RCTRootViewDelegate;\n\n/**\n * This enum is used to define size flexibility type of the root view.\n * If a dimension is flexible, the view will recalculate that dimension\n * so the content fits. Recalculations are performed when the root's frame,\n * size flexibility mode or content size changes. After a recalculation,\n * rootViewDidChangeIntrinsicSize method of the RCTRootViewDelegate will be called.\n */\ntypedef NS_ENUM(NSInteger, RCTRootViewSizeFlexibility) {\n  RCTRootViewSizeFlexibilityNone           = 0,\n  RCTRootViewSizeFlexibilityWidth          = 1 << 0,\n  RCTRootViewSizeFlexibilityHeight         = 1 << 1,\n  RCTRootViewSizeFlexibilityWidthAndHeight = RCTRootViewSizeFlexibilityWidth | RCTRootViewSizeFlexibilityHeight,\n};\n\n/**\n * This notification is sent when the first subviews are added to the root view\n * after the application has loaded. This is used to hide the `loadingView`, and\n * is a good indicator that the application is ready to use.\n */\nextern NSString *const RCTContentDidAppearNotification;\n\n/**\n * Native view used to host React-managed views within the app. Can be used just\n * like any ordinary UIView. You can have multiple RCTRootViews on screen at\n * once, all controlled by the same JavaScript application.\n */\n@interface RCTRootView : NSVisualEffectView\n\n/**\n * - Designated initializer -\n */\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n                    moduleName:(NSString *)moduleName\n             initialProperties:(NSDictionary *)initialProperties NS_DESIGNATED_INITIALIZER;\n\n/**\n * - Convenience initializer -\n * A bridge will be created internally.\n * This initializer is intended to be used when the app has a single RCTRootView,\n * otherwise create an `RCTBridge` and pass it in via `initWithBridge:moduleName:`\n * to all the instances.\n */\n- (instancetype)initWithBundleURL:(NSURL *)bundleURL\n                       moduleName:(NSString *)moduleName\n                initialProperties:(NSDictionary *)initialProperties\n                    launchOptions:(NSDictionary *)launchOptions;\n\n/**\n * The name of the JavaScript module to execute within the\n * specified scriptURL (required). Setting this will not have\n * any immediate effect, but it must be done prior to loading\n * the script.\n */\n@property (nonatomic, copy, readonly) NSString *moduleName;\n\n/**\n * The bridge used by the root view. Bridges can be shared between multiple\n * root views, so you can use this property to initialize another RCTRootView.\n */\n@property (nonatomic, strong, readonly) RCTBridge *bridge;\n\n/**\n * The properties to apply to the view. Use this property to update\n * application properties and rerender the view. Initialized with\n * initialProperties argument of the initializer.\n *\n * Set this property only on the main thread.\n */\n@property (nonatomic, copy, readwrite) NSDictionary *appProperties;\n\n/**\n * The class of the RCTJavaScriptExecutor to use with this view.\n * If not specified, it will default to using RCTJSCExecutor.\n * Changes will take effect next time the bundle is reloaded.\n */\n@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility;\n\n/**\n * The delegate that handles intrinsic size updates.\n */\n@property (nonatomic, weak) id<RCTRootViewDelegate> delegate;\n\n/**\n * The backing view controller of the root view.\n */\n@property (nonatomic, strong) NSViewController *reactViewController;\n\n/**\n * The React-managed contents view of the root view.\n */\n@property (nonatomic, strong, readonly) NSView *contentView;\n\n/**\n * A view to display while the JavaScript is loading, so users aren't presented\n * with a blank screen. By default this is nil, but you can override it with\n * (for example) a UIActivityIndicatorView or a placeholder image.\n */\n@property (nonatomic, strong) NSView *loadingView;\n\n/**\n * Calling this will result in emitting a \"touches cancelled\" event to js,\n * which effectively cancels all js \"gesture recognizers\" such as touchable components\n * (unless they explicitely ignore cancellation events, but no one should do that).\n *\n * This API is exposed for integration purposes where you embed RN rootView\n * in a native view with a native gesture recognizer,\n * whose activation should prevent any in-flight js \"gesture recognizer\" from activating.\n *\n * An example would be RN rootView embedded in an UIScrollView.\n * When you touch down on a touchable component and drag your finger up,\n * you don't want any touch to be registered as soon as the UIScrollView starts scrolling.\n *\n * Note that this doesn't help with tapping on a touchable element that is being scrolled,\n * unless you can call cancelTouches exactly between \"touches began\" and \"touches ended\" events.\n * This is a reason why this API may be soon removed in favor of a better solution.\n */\n- (void)cancelTouches;\n\n/**\n * When set, any touches on the RCTRootView that are not matched up to any of the child\n * views will be passed to siblings of the RCTRootView. See -[UIView hitTest:withEvent:]\n * for details on iOS hit testing.\n *\n * Enable this to support a semi-transparent RN view that occupies the whole screen but\n * has visible content below it that the user can interact with.\n *\n * The default value is NO.\n */\n@property (nonatomic, assign) BOOL passThroughTouches;\n\n/**\n * Timings for hiding the loading view after the content has loaded. Both of\n * these values default to 0.25 seconds.\n */\n@property (nonatomic, assign) NSTimeInterval loadingViewFadeDelay;\n@property (nonatomic, assign) NSTimeInterval loadingViewFadeDuration;\n\n@end\n\n@interface RCTRootView (Deprecated)\n\n/**\n * The intrinsic size of the root view's content. This is set right before the\n * `rootViewDidChangeIntrinsicSize` method of `RCTRootViewDelegate` is called.\n * This property is deprecated and will be removed in next releases.\n * Use UIKit `intrinsicContentSize` propery instead.\n */\n@property (readonly, nonatomic, assign) CGSize intrinsicSize\n__deprecated_msg(\"Use `intrinsicContentSize` instead.\");\n\n@end\n"
  },
  {
    "path": "React/Base/RCTRootView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTRootView.h\"\n#import \"RCTRootViewDelegate.h\"\n#import \"RCTRootViewInternal.h\"\n\n#import <objc/runtime.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge.h\"\n#import \"RCTBridge+Private.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTKeyCommands.h\"\n#import \"RCTLog.h\"\n#import \"RCTPerformanceLogger.h\"\n#import \"RCTProfile.h\"\n#import \"RCTRootContentView.h\"\n#import \"RCTTouchHandler.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTUIManagerUtils.h\"\n#import \"RCTUtils.h\"\n#import \"RCTView.h\"\n#import \"NSView+React.h\"\n\n#if TARGET_OS_TV\n#import \"RCTTVRemoteHandler.h\"\n#import \"RCTTVNavigationEventEmitter.h\"\n#endif\n\nNSString *const RCTContentDidAppearNotification = @\"RCTContentDidAppearNotification\";\n\n@interface RCTUIManager (RCTRootView)\n\n- (NSNumber *)allocateRootTag;\n\n@end\n\n@implementation RCTRootView\n{\n  RCTBridge *_bridge;\n  NSString *_moduleName;\n  RCTRootContentView *_contentView;\n  BOOL _passThroughTouches;\n  CGSize _intrinsicContentSize;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n                    moduleName:(NSString *)moduleName\n             initialProperties:(NSDictionary *)initialProperties\n{\n  RCTAssertMainQueue();\n  RCTAssert(bridge, @\"A bridge instance is required to create an RCTRootView\");\n  RCTAssert(moduleName, @\"A moduleName is required to create an RCTRootView\");\n\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"-[RCTRootView init]\", nil);\n  if (!bridge.isLoading) {\n    [bridge.performanceLogger markStartForTag:RCTPLTTI];\n  }\n\n  // TODO: Turn on layer backing just to avoid https://github.com/ptmt/react-native-macos/issues/47\n  // Maybe we could turn it off after the bug fixed in the future.\n  if (([self window].styleMask & NSFullSizeContentViewWindowMask) != NSFullSizeContentViewWindowMask\n        && [self window].contentView == self) {\n        [self setWantsLayer:YES];\n  }\n\n  if (self = [super initWithFrame:CGRectZero]) {\n    self.backgroundColor = [NSColor clearColor];\n\n    [self setNeedsLayout:NO];\n\n    _bridge = bridge;\n    _moduleName = moduleName;\n    _appProperties = [initialProperties copy];\n    _loadingViewFadeDelay = 0.25;\n    _loadingViewFadeDuration = 0.25;\n    _sizeFlexibility = RCTRootViewSizeFlexibilityNone;\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(bridgeDidReload)\n                                                 name:RCTJavaScriptWillStartLoadingNotification\n                                               object:_bridge];\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(javaScriptDidLoad:)\n                                                 name:RCTJavaScriptDidLoadNotification\n                                               object:_bridge];\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(hideLoadingView)\n                                                 name:RCTContentDidAppearNotification\n                                               object:self];\n\n#if TARGET_OS_TV\n    self.tvRemoteHandler = [RCTTVRemoteHandler new];\n    for (NSString *key in [self.tvRemoteHandler.tvRemoteGestureRecognizers allKeys]) {\n      [self addGestureRecognizer:self.tvRemoteHandler.tvRemoteGestureRecognizers[key]];\n    }\n#endif\n\n    [self showLoadingView];\n\n    // Immediately schedule the application to be started.\n    // (Sometimes actual `_bridge` is already batched bridge here.)\n    [self bundleFinishedLoading:([_bridge batchedBridge] ?: _bridge)];\n  }\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n  return self;\n}\n\n- (instancetype)initWithBundleURL:(NSURL *)bundleURL\n                       moduleName:(NSString *)moduleName\n                initialProperties:(NSDictionary *)initialProperties\n                    launchOptions:(NSDictionary *)launchOptions\n{\n  RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:bundleURL\n                                            moduleProvider:nil\n                                             launchOptions:launchOptions];\n\n  return [self initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n#if TARGET_OS_TV\n- (UIView *)preferredFocusedView\n{\n  if (self.reactPreferredFocusedView) {\n    return self.reactPreferredFocusedView;\n  }\n  return [super preferredFocusedView];\n}\n#endif\n\n- (void)viewDidMoveToWindow\n{\n  [super viewDidMoveToWindow];\n  NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:NSZeroRect\n                                                              options:NSTrackingActiveInActiveApp | NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | NSTrackingInVisibleRect\n                                                                owner:self\n                                                             userInfo:nil];\n\n  [self addTrackingArea:trackingArea];\n}\n\n- (void)mouseMoved:(NSEvent *)theEvent\n{\n  [[_contentView touchHandler] mouseMoved:theEvent];\n}\n\n- (void)setBackgroundColor:(NSColor *)backgroundColor\n{\n  [super.layer setBackgroundColor:[backgroundColor CGColor]];\n}\n\n#pragma mark - passThroughTouches\n\n- (BOOL)passThroughTouches\n{\n  return _contentView.passThroughTouches;\n}\n\n- (void)setPassThroughTouches:(BOOL)passThroughTouches\n{\n  _passThroughTouches = passThroughTouches;\n  _contentView.passThroughTouches = passThroughTouches;\n}\n\n#pragma mark - Layout\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  CGSize fitSize = _intrinsicContentSize;\n  CGSize currentSize = self.bounds.size;\n\n  // Following the current `size` and current `sizeFlexibility` policy.\n  fitSize = CGSizeMake(\n      _sizeFlexibility & RCTRootViewSizeFlexibilityWidth ? fitSize.width : currentSize.width,\n      _sizeFlexibility & RCTRootViewSizeFlexibilityHeight ? fitSize.height : currentSize.height\n    );\n\n  // Following the given size constraints.\n  fitSize = CGSizeMake(\n      MIN(size.width, fitSize.width),\n      MIN(size.height, fitSize.height)\n    );\n\n  return fitSize;\n}\n\n- (void)layout\n{\n  [super layout];\n  _contentView.frame = self.bounds;\n}\n\n- (NSViewController *)reactViewController\n{\n  return _reactViewController ?: [super reactViewController];\n}\n\n- (BOOL)canBecomeFirstResponder\n{\n  return YES;\n}\n\n- (BOOL)isFlipped\n{\n  return NO;\n}\n\n- (void)setLoadingView:(NSView *)loadingView\n{\n  _loadingView = loadingView;\n  if (!_contentView.contentHasAppeared) {\n    [self showLoadingView];\n  }\n}\n\n- (void)showLoadingView\n{\n  if (_loadingView && !_contentView.contentHasAppeared) {\n    _loadingView.hidden = NO;\n    [self addSubview:_loadingView];\n  }\n}\n\n- (void)hideLoadingView\n{\n  if (_loadingView.superview == self && _contentView.contentHasAppeared) {\n    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(_loadingViewFadeDelay * NSEC_PER_SEC)),\n                   dispatch_get_main_queue(), ^{\n\n      _loadingView.hidden = YES;\n    });\n  }\n}\n\n- (NSNumber *)reactTag\n{\n  RCTAssertMainQueue();\n  if (!super.reactTag) {\n    /**\n     * Every root view that is created must have a unique react tag.\n     * Numbering of these tags goes from 1, 11, 21, 31, etc\n     *\n     * NOTE: Since the bridge persists, the RootViews might be reused, so the\n     * react tag must be re-assigned every time a new UIManager is created.\n     */\n    self.reactTag = RCTAllocateRootViewTag();\n  }\n  return super.reactTag;\n}\n\n- (void)bridgeDidReload\n{\n  RCTAssertMainQueue();\n  // Clear the reactTag so it can be re-assigned\n  self.reactTag = nil;\n}\n\n- (void)javaScriptDidLoad:(NSNotification *)notification\n{\n  RCTAssertMainQueue();\n\n  // Use the (batched) bridge that's sent in the notification payload, so the\n  // RCTRootContentView is scoped to the right bridge\n  RCTBridge *bridge = notification.userInfo[@\"bridge\"];\n  if (bridge != _contentView.bridge) {\n    [self bundleFinishedLoading:bridge];\n  }\n}\n\n- (void)bundleFinishedLoading:(RCTBridge *)bridge\n{\n  RCTAssert(bridge != nil, @\"Bridge cannot be nil\");\n  if (!bridge.valid) {\n    return;\n  }\n\n  NSViewController *rootController = [NSViewController new];\n  rootController.view = self;\n  _reactViewController = rootController;\n\n  [_contentView removeFromSuperview];\n  _contentView = [[RCTRootContentView alloc] initWithFrame:self.bounds\n                                                    bridge:bridge\n                                                  reactTag:self.reactTag\n                                            sizeFlexiblity:_sizeFlexibility];\n  [self runApplication:bridge];\n\n  _contentView.passThroughTouches = _passThroughTouches;\n  [self addSubview:_contentView];\n\n  if (_sizeFlexibility == RCTRootViewSizeFlexibilityNone) {\n    self.intrinsicContentSize = self.bounds.size;\n  }\n}\n\n- (void)runApplication:(RCTBridge *)bridge\n{\n  NSString *moduleName = _moduleName ?: @\"\";\n  NSDictionary *appParameters = @{\n    @\"rootTag\": _contentView.reactTag,\n    @\"initialProps\": _appProperties ?: @{},\n  };\n\n  RCTLogInfo(@\"Running application %@ (%@)\", moduleName, appParameters);\n  [bridge enqueueJSCall:@\"AppRegistry\"\n                 method:@\"runApplication\"\n                   args:@[moduleName, appParameters]\n             completion:NULL];\n}\n\n- (void)setSizeFlexibility:(RCTRootViewSizeFlexibility)sizeFlexibility\n{\n  if (_sizeFlexibility == sizeFlexibility) {\n    return;\n  }\n\n  _sizeFlexibility = sizeFlexibility;\n  [self setNeedsLayout:YES];\n  _contentView.sizeFlexibility = _sizeFlexibility;\n}\n\n- (NSView *)hitTest:(CGPoint)point withEvent:(NSEvent *)event\n{\n  // The root view itself should never receive touches\n//  NSView *hitView = [super hitTest:point withEvent:event];\n//  if (self.passThroughTouches && hitView == self) {\n//    return nil;\n//  }\n//  return hitView;\n  return nil;\n}\n\n- (void)setAppProperties:(NSDictionary *)appProperties\n{\n  RCTAssertMainQueue();\n\n  if ([_appProperties isEqualToDictionary:appProperties]) {\n    return;\n  }\n\n  _appProperties = [appProperties copy];\n\n  if (_contentView && _bridge.valid && !_bridge.loading) {\n    [self runApplication:_bridge];\n  }\n}\n\n- (void)setIntrinsicContentSize:(CGSize)intrinsicContentSize\n{\n  BOOL oldSizeHasAZeroDimension = _intrinsicContentSize.height == 0 || _intrinsicContentSize.width == 0;\n  BOOL newSizeHasAZeroDimension = intrinsicContentSize.height == 0 || intrinsicContentSize.width == 0;\n  BOOL bothSizesHaveAZeroDimension = oldSizeHasAZeroDimension && newSizeHasAZeroDimension;\n\n  BOOL sizesAreEqual = CGSizeEqualToSize(_intrinsicContentSize, intrinsicContentSize);\n\n  _intrinsicContentSize = intrinsicContentSize;\n\n  [self invalidateIntrinsicContentSize];\n  [self.superview setNeedsLayout: YES];\n\n  // Don't notify the delegate if the content remains invisible or its size has not changed\n  if (bothSizesHaveAZeroDimension || sizesAreEqual) {\n    return;\n  }\n\n  [_delegate rootViewDidChangeIntrinsicSize:self];\n}\n\n- (CGSize)intrinsicContentSize\n{\n  return _intrinsicContentSize;\n}\n\n- (void)contentViewInvalidated\n{\n  [_contentView removeFromSuperview];\n  _contentView = nil;\n  [self showLoadingView];\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n  [_contentView invalidate];\n}\n\n- (void)cancelTouches\n{\n  [[_contentView touchHandler] cancel];\n}\n\n@end\n\n@implementation RCTRootView (Deprecated)\n\n- (CGSize)intrinsicSize\n{\n  RCTLogWarn(@\"Calling deprecated `[-RCTRootView intrinsicSize]`.\");\n  return self.intrinsicContentSize;\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTRootViewDelegate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n@class RCTRootView;\n\n@protocol RCTRootViewDelegate <NSObject>\n\n/**\n * Called after the root view's intrinsic content size is changed.\n *\n * The method is not called when both old size and new size have\n * a dimension that equals to zero.\n *\n * The delegate can use this callback to appropriately resize\n * the root view's frame to fit the new intrinsic content view size,\n * but usually it is not necessary because the root view will also call\n * `setNeedsLayout` for its superview which in its turn will trigger relayout.\n *\n * The new intrinsic content size is available via the `intrinsicContentSize`\n * propery of the root view. The view will not resize itself.\n */\n- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTRootViewInternal.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTRootView.h>\n\n@class RCTTVRemoteHandler;\n\n/**\n * The interface provides a set of functions that allow other internal framework\n * classes to change the RCTRootViews's internal state.\n */\n@interface RCTRootView ()\n\n/**\n * This setter should be used only by RCTUIManager on react root view\n * intrinsic content size update.\n */\n@property (readwrite, nonatomic, assign) CGSize intrinsicContentSize;\n\n/**\n * TV remote gesture recognizers\n */\n#if TARGET_OS_TV\n@property (nonatomic, strong) RCTTVRemoteHandler *tvRemoteHandler;\n@property (nonatomic, strong) UIView *reactPreferredFocusedView;\n#endif\n\n- (void)contentViewInvalidated;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTTVRemoteHandler.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\n\nextern NSString *const RCTTVRemoteEventMenu;\nextern NSString *const RCTTVRemoteEventPlayPause;\nextern NSString *const RCTTVRemoteEventSelect;\n\nextern NSString *const RCTTVRemoteEventLongPlayPause;\nextern NSString *const RCTTVRemoteEventLongSelect;\n\nextern NSString *const RCTTVRemoteEventLeft;\nextern NSString *const RCTTVRemoteEventRight;\nextern NSString *const RCTTVRemoteEventUp;\nextern NSString *const RCTTVRemoteEventDown;\n\nextern NSString *const RCTTVRemoteEventSwipeLeft;\nextern NSString *const RCTTVRemoteEventSwipeRight;\nextern NSString *const RCTTVRemoteEventSwipeUp;\nextern NSString *const RCTTVRemoteEventSwipeDown;\n\n@interface RCTTVRemoteHandler : NSObject\n\n@property (nonatomic, copy, readonly) NSDictionary *tvRemoteGestureRecognizers;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTTVRemoteHandler.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTVRemoteHandler.h\"\n\n#import <UIKit/UIGestureRecognizerSubclass.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTLog.h\"\n#import \"RCTRootView.h\"\n#import \"RCTTVNavigationEventEmitter.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTUtils.h\"\n#import \"RCTView.h\"\n#import \"UIView+React.h\"\n\n#if __has_include(\"RCTDevMenu.h\")\n#import \"RCTDevMenu.h\"\n#endif\n\nNSString *const RCTTVRemoteEventMenu = @\"menu\";\nNSString *const RCTTVRemoteEventPlayPause = @\"playPause\";\nNSString *const RCTTVRemoteEventSelect = @\"select\";\n\nNSString *const RCTTVRemoteEventLongPlayPause = @\"longPlayPause\";\nNSString *const RCTTVRemoteEventLongSelect = @\"longSelect\";\n\nNSString *const RCTTVRemoteEventLeft = @\"left\";\nNSString *const RCTTVRemoteEventRight = @\"right\";\nNSString *const RCTTVRemoteEventUp = @\"up\";\nNSString *const RCTTVRemoteEventDown = @\"down\";\n\nNSString *const RCTTVRemoteEventSwipeLeft = @\"swipeLeft\";\nNSString *const RCTTVRemoteEventSwipeRight = @\"swipeRight\";\nNSString *const RCTTVRemoteEventSwipeUp = @\"swipeUp\";\nNSString *const RCTTVRemoteEventSwipeDown = @\"swipeDown\";\n\n\n@implementation RCTTVRemoteHandler {\n  NSMutableDictionary<NSString *, UIGestureRecognizer *> *_tvRemoteGestureRecognizers;\n}\n\n- (instancetype)init\n{\n  if ((self = [super init])) {\n    _tvRemoteGestureRecognizers = [NSMutableDictionary dictionary];\n\n    // Recognizers for Apple TV remote buttons\n\n    // Play/Pause\n    [self addTapGestureRecognizerWithSelector:@selector(playPausePressed:)\n                                    pressType:UIPressTypePlayPause\n                                         name:RCTTVRemoteEventPlayPause];\n\n    // Menu\n    [self addTapGestureRecognizerWithSelector:@selector(menuPressed:)\n                                    pressType:UIPressTypeMenu\n                                         name:RCTTVRemoteEventMenu];\n\n    // Select\n    [self addTapGestureRecognizerWithSelector:@selector(selectPressed:)\n                                    pressType:UIPressTypeSelect\n                                         name:RCTTVRemoteEventSelect];\n\n    // Up\n    [self addTapGestureRecognizerWithSelector:@selector(swipedUp:)\n                                    pressType:UIPressTypeUpArrow\n                                         name:RCTTVRemoteEventUp];\n\n    // Down\n    [self addTapGestureRecognizerWithSelector:@selector(swipedDown:)\n                                    pressType:UIPressTypeDownArrow\n                                         name:RCTTVRemoteEventDown];\n\n    // Left\n    [self addTapGestureRecognizerWithSelector:@selector(swipedLeft:)\n                                    pressType:UIPressTypeLeftArrow\n                                         name:RCTTVRemoteEventLeft];\n\n    // Right\n    [self addTapGestureRecognizerWithSelector:@selector(swipedRight:)\n                                    pressType:UIPressTypeRightArrow\n                                         name:RCTTVRemoteEventRight];\n\n    // Recognizers for long button presses\n    // We don't intercept long menu press -- that's used by the system to go to the home screen\n\n    [self addLongPressGestureRecognizerWithSelector:@selector(longPlayPausePressed:)\n                                          pressType:UIPressTypePlayPause\n                                               name:RCTTVRemoteEventLongPlayPause];\n\n    [self addLongPressGestureRecognizerWithSelector:@selector(longSelectPressed:)\n                                          pressType:UIPressTypeSelect\n                                               name:RCTTVRemoteEventLongSelect];\n\n    // Recognizers for Apple TV remote trackpad swipes\n\n    // Up\n    [self addSwipeGestureRecognizerWithSelector:@selector(swipedUp:)\n                                      direction:UISwipeGestureRecognizerDirectionUp\n                                           name:RCTTVRemoteEventSwipeUp];\n\n    // Down\n    [self addSwipeGestureRecognizerWithSelector:@selector(swipedDown:)\n                                      direction:UISwipeGestureRecognizerDirectionDown\n                                           name:RCTTVRemoteEventSwipeDown];\n\n    // Left\n    [self addSwipeGestureRecognizerWithSelector:@selector(swipedLeft:)\n                                      direction:UISwipeGestureRecognizerDirectionLeft\n                                           name:RCTTVRemoteEventSwipeLeft];\n\n    // Right\n    [self addSwipeGestureRecognizerWithSelector:@selector(swipedRight:)\n                                      direction:UISwipeGestureRecognizerDirectionRight\n                                           name:RCTTVRemoteEventSwipeRight];\n\n  }\n\n  return self;\n}\n\n- (void)playPausePressed:(UIGestureRecognizer *)r\n{\n  [self sendAppleTVEvent:RCTTVRemoteEventPlayPause toView:r.view];\n}\n\n- (void)menuPressed:(UIGestureRecognizer *)r\n{\n  [self sendAppleTVEvent:RCTTVRemoteEventMenu toView:r.view];\n}\n\n- (void)selectPressed:(UIGestureRecognizer *)r\n{\n  [self sendAppleTVEvent:RCTTVRemoteEventSelect toView:r.view];\n}\n\n- (void)longPlayPausePressed:(UIGestureRecognizer *)r\n{\n  [self sendAppleTVEvent:RCTTVRemoteEventLongPlayPause toView:r.view];\n\n#if __has_include(\"RCTDevMenu.h\") && RCT_DEV\n  // If shake to show is enabled on device, use long play/pause event to show dev menu\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTShowDevMenuNotification object:nil];\n#endif\n}\n\n- (void)longSelectPressed:(UIGestureRecognizer *)r\n{\n  [self sendAppleTVEvent:RCTTVRemoteEventLongSelect toView:r.view];\n}\n\n- (void)swipedUp:(UIGestureRecognizer *)r\n{\n  [self sendAppleTVEvent:RCTTVRemoteEventUp toView:r.view];\n}\n\n- (void)swipedDown:(UIGestureRecognizer *)r\n{\n  [self sendAppleTVEvent:RCTTVRemoteEventDown toView:r.view];\n}\n\n- (void)swipedLeft:(UIGestureRecognizer *)r\n{\n  [self sendAppleTVEvent:RCTTVRemoteEventLeft toView:r.view];\n}\n\n- (void)swipedRight:(UIGestureRecognizer *)r\n{\n  [self sendAppleTVEvent:RCTTVRemoteEventRight toView:r.view];\n}\n\n#pragma mark -\n\n- (void)addLongPressGestureRecognizerWithSelector:(nonnull SEL)selector pressType:(UIPressType)pressType name:(NSString *)name\n{\n  UILongPressGestureRecognizer *recognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:selector];\n  recognizer.allowedPressTypes = @[@(pressType)];\n\n  _tvRemoteGestureRecognizers[name] = recognizer;\n}\n\n- (void)addTapGestureRecognizerWithSelector:(nonnull SEL)selector pressType:(UIPressType)pressType name:(NSString *)name\n{\n  UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:selector];\n  recognizer.allowedPressTypes = @[@(pressType)];\n\n  _tvRemoteGestureRecognizers[name] = recognizer;\n}\n\n- (void)addSwipeGestureRecognizerWithSelector:(nonnull SEL)selector direction:(UISwipeGestureRecognizerDirection)direction name:(NSString *)name\n{\n  UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:selector];\n  recognizer.direction = direction;\n\n  _tvRemoteGestureRecognizers[name] = recognizer;\n}\n\n- (void)sendAppleTVEvent:(NSString *)eventType toView:(__unused UIView *)v\n{\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVNavigationEventNotification\n                                                      object:@{@\"eventType\":eventType}];\n}\n\n\n@end\n"
  },
  {
    "path": "React/Base/RCTTouchEvent.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTEventDispatcher.h>\n\n/**\n * Represents a touch event, which may be composed of several touches (one for every finger).\n * For more information on contents of passed data structures see RCTTouchHandler.\n */\n@interface RCTTouchEvent : NSObject <RCTEvent>\n\n- (instancetype)initWithEventName:(NSString *)eventName\n                         reactTag:(NSNumber *)reactTag\n                     reactTouches:(NSArray<NSDictionary *> *)reactTouches\n                   changedIndexes:(NSArray<NSNumber *> *)changedIndexes\n                    coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER;\n@end\n"
  },
  {
    "path": "React/Base/RCTTouchEvent.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTouchEvent.h\"\n\n#import \"RCTAssert.h\"\n\n@implementation RCTTouchEvent\n{\n  NSArray<NSDictionary *> *_reactTouches;\n  NSArray<NSNumber *> *_changedIndexes;\n  uint16_t _coalescingKey;\n}\n\n@synthesize eventName = _eventName;\n@synthesize viewTag = _viewTag;\n\n- (instancetype)initWithEventName:(NSString *)eventName\n                         reactTag:(NSNumber *)reactTag\n                     reactTouches:(NSArray<NSDictionary *> *)reactTouches\n                   changedIndexes:(NSArray<NSNumber *> *)changedIndexes\n                    coalescingKey:(uint16_t)coalescingKey\n{\n  if (self = [super init]) {\n    _viewTag = reactTag;\n    _eventName = eventName;\n    _reactTouches = reactTouches;\n    _changedIndexes = changedIndexes;\n    _coalescingKey = coalescingKey;\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n#pragma mark - RCTEvent\n\n- (BOOL)canCoalesce\n{\n  return [_eventName isEqual:@\"touchMove\"];\n}\n\n// We coalesce only move events, while holding some assumptions that seem reasonable but there are no explicit guarantees about them.\n- (id<RCTEvent>)coalesceWithEvent:(id<RCTEvent>)newEvent\n{\n  RCTAssert([newEvent isKindOfClass:[RCTTouchEvent class]], @\"Touch event cannot be coalesced with any other type of event, such as provided %@\", newEvent);\n  RCTTouchEvent *newTouchEvent = (RCTTouchEvent *)newEvent;\n  RCTAssert([_reactTouches count] == [newTouchEvent->_reactTouches count], @\"Touch events have different number of touches. %@ %@\", self, newEvent);\n\n  BOOL newEventIsMoreRecent = NO;\n  BOOL oldEventIsMoreRecent = NO;\n  NSInteger count = _reactTouches.count;\n  for (int i = 0; i<count; i++) {\n    NSDictionary *touch = _reactTouches[i];\n    NSDictionary *newTouch = newTouchEvent->_reactTouches[i];\n    RCTAssert([touch[@\"identifier\"] isEqual:newTouch[@\"identifier\"]], @\"Touch events doesn't have touches in the same order. %@ %@\", touch, newTouch);\n    if ([touch[@\"timestamp\"] doubleValue] > [newTouch[@\"timestamp\"] doubleValue]) {\n      oldEventIsMoreRecent = YES;\n    } else {\n      newEventIsMoreRecent = YES;\n    }\n  }\n  RCTAssert(!(oldEventIsMoreRecent && newEventIsMoreRecent), @\"Neither touch event is exclusively more recent than the other one. %@ %@\", _reactTouches, newTouchEvent->_reactTouches);\n  return newEventIsMoreRecent ? newEvent : self;\n}\n\n+ (NSString *)moduleDotMethod\n{\n  return @\"RCTEventEmitter.receiveTouches\";\n}\n\n- (NSArray *)arguments\n{\n  return @[RCTNormalizeInputEventName(_eventName), _reactTouches, _changedIndexes];\n}\n\n- (uint16_t)coalescingKey\n{\n  return _coalescingKey;\n}\n\n- (NSString *)description\n{\n  return [NSString stringWithFormat:@\"<%@: %p; name = %@; coalescing key = %hu>\", [self class], self, _eventName, _coalescingKey];\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTTouchHandler.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTFrameUpdate.h>\n\n@class RCTBridge;\n\n@interface RCTTouchHandler : NSGestureRecognizer\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;\n\n- (void)attachToView:(NSView *)view;\n- (void)detachFromView:(NSView *)view;\n\n- (void)cancel;\n\n- (void)mouseMoved:(NSEvent *)theEvent;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTTouchHandler.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTouchHandler.h\"\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTTouchEvent.h\"\n#import \"RCTLog.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTUtils.h\"\n#import \"NSView+React.h\"\n\n@interface RCTTouchHandler () <NSGestureRecognizerDelegate>\n@end\n\n// TODO: this class behaves a lot like a module, and could be implemented as a\n// module if we were to assume that modules and RootViews had a 1:1 relationship\n@implementation RCTTouchHandler\n{\n  __weak RCTBridge *_bridge;\n  __weak RCTEventDispatcher *_eventDispatcher;\n\n  /**\n   * Arrays managed in parallel tracking native touch object along with the\n   * native view that was touched, and the React touch data dictionary.\n   * These must be kept track of because `UIKit` destroys the touch targets\n   * if touches are canceled, and we have no other way to recover this info.\n   */\n  NSMutableOrderedSet<NSEvent *> *_nativeTouches;\n  NSMutableArray<NSMutableDictionary *> *_reactTouches;\n  NSMutableArray<NSView *> *_touchViews;\n\n  uint16_t _coalescingKey;\n  \n  BOOL _dispatchedInitialTouches;\n  BOOL _recordingInteractionTiming;\n  CFTimeInterval _mostRecentEnqueueJS;\n  \n  /*\n   * Storing tag to dispatch mouseEnter and mouseLeave events\n   */\n  NSNumber *_currentMouseOverTag;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  RCTAssertParam(bridge);\n\n  if ((self = [super initWithTarget:nil action:NULL])) {\n    _bridge = bridge;\n    _eventDispatcher = [bridge moduleForClass:[RCTEventDispatcher class]];\n\n    _nativeTouches = [NSMutableOrderedSet new];\n    _reactTouches = [NSMutableArray new];\n    _touchViews = [NSMutableArray new];\n\n    // `cancelsTouchesInView` and `delaysTouches*` are needed in order to be used as a top level\n    // event delegated recognizer. Otherwise, lower-level components not built\n    // using RCT, will fail to recognize gestures.\n    \n    self.delegate = self;\n  }\n\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithTarget:(id)target action:(SEL)action)\n\n- (void)attachToView:(NSView *)view\n{\n  RCTAssert(self.view == nil, @\"RCTTouchHandler already has attached view.\");\n\n  [view addGestureRecognizer:self];\n}\n\n- (void)detachFromView:(NSView *)view\n{\n  RCTAssertParam(view);\n  RCTAssert(self.view == view, @\"RCTTouchHandler attached to another view.\");\n\n  [view removeGestureRecognizer:self];\n}\n\n#pragma mark - Bookkeeping for touch indices\n\n- (void)_recordNewTouches:(NSSet<NSEvent *> *)touches\n{\n  for (NSEvent *touch in touches) {\n\n    NSUInteger index = [_nativeTouches indexOfObjectPassingTest:^BOOL(id obj, __unused NSUInteger idx, __unused BOOL *stop) {\n      return touch.eventNumber == ((NSEvent *)obj).eventNumber;\n    }];\n\n    RCTAssert(index == NSNotFound,\n              @\"Touch is already recorded. This is a critical bug.\");\n\n    NSPoint touchLocation = [touch locationInWindow];\n\n    // adjust touchLocation if our view placed inside custom PopoverWindow\n    if ([[self.view window].className isEqualToString:@\"_NSPopoverWindow\"]) {\n      NSPoint rootOrigin = [self.view window].contentView.frame.origin;\n      touchLocation = NSMakePoint(touchLocation.x - rootOrigin.x, touchLocation.y - rootOrigin.y);\n    }\n\n    // TODO: get rid of explicit comparison\n    //\n    // Check if item is becoming first responder to delete touch\n    NSView *targetView = [self.view hitTest:touchLocation];\n\n    if (![targetView.className isEqualToString:@\"RCTView\"] &&\n        ![targetView.className isEqualToString:@\"RCTTextView\"] &&\n        ![targetView.className isEqualToString:@\"RCTImageView\"] &&\n        ![targetView.className isEqualToString:@\"ARTSurfaceView\"]) {\n      self.state = NSGestureRecognizerStateEnded;\n      return;\n    }\n\n    NSNumber *reactTag = [self.view reactTagAtPoint:CGPointMake(touchLocation.x, touchLocation.y)];\n\n    if (!reactTag) {\n      return;\n    }\n\n    // Get new, unique touch identifier for the react touch\n    const NSUInteger RCTMaxTouches = 11; // This is the maximum supported by iDevices\n    NSInteger touchID = ([_reactTouches.lastObject[@\"identifier\"] integerValue] + 1) % RCTMaxTouches;\n    for (NSDictionary *reactTouch in _reactTouches) {\n      NSInteger usedID = [reactTouch[@\"identifier\"] integerValue];\n      if (usedID == touchID) {\n        // ID has already been used, try next value\n        touchID ++;\n      } else if (usedID > touchID) {\n        // If usedID > touchID, touchID must be unique, so we can stop looking\n        break;\n      }\n    }\n\n    // Create touch\n    NSMutableDictionary *reactTouch = [[NSMutableDictionary alloc] initWithCapacity:9];\n    reactTouch[@\"target\"] = reactTag;\n    reactTouch[@\"identifier\"] = @(touchID);\n    reactTouch[@\"touches\"] = (id)kCFNull;        // We hijack this touchObj to serve both as an event\n    reactTouch[@\"changedTouches\"] = (id)kCFNull; // and as a Touch object, so making this JIT friendly.\n\n    // Add to arrays\n    [_touchViews addObject:targetView];\n    [_nativeTouches addObject:touch];\n    [_reactTouches addObject:reactTouch];\n  }\n}\n\n- (void)_recordRemovedTouches:(NSSet<NSEvent *> *)touches\n{\n  for (NSEvent *touch in touches) {\n    NSUInteger index = [_nativeTouches indexOfObjectPassingTest:^BOOL(id obj, __unused NSUInteger idx, __unused BOOL *stop) {\n      return touch.eventNumber == ((NSEvent *)obj).eventNumber;\n    }];\n    if(index == NSNotFound) {\n      continue;\n    }\n\n    [_touchViews removeObjectAtIndex:index];\n    [_nativeTouches removeObjectAtIndex:index];\n    [_reactTouches removeObjectAtIndex:index];\n  }\n}\n\n- (void)_updateReactTouchAtIndex:(NSInteger)touchIndex withNativeTouch:(NSEvent *)nativeTouch\n{\n  CGPoint location = [nativeTouch locationInWindow];\n  CGPoint flippedLocation = CGPointMake(location.x, self.view.window.frame.size.height - location.y);\n\n  // adjust touchLocation if our view placed inside custom PopoverWindow\n  if ([[self.view window].className isEqualToString:@\"_NSPopoverWindow\"]) {\n    NSPoint rootOrigin = [self.view window].contentView.frame.origin;\n    flippedLocation = NSMakePoint(flippedLocation.x - rootOrigin.x, flippedLocation.y - rootOrigin.y);\n  }\n\n  NSMutableDictionary *reactTouch = _reactTouches[touchIndex];\n  reactTouch[@\"pageX\"] = @(RCTSanitizeNaNValue(flippedLocation.x, @\"touchEvent.pageX\"));\n  reactTouch[@\"pageY\"] = @(RCTSanitizeNaNValue(flippedLocation.y, @\"touchEvent.pageY\"));\n  reactTouch[@\"locationX\"] = @(RCTSanitizeNaNValue(flippedLocation.x, @\"touchEvent.locationX\"));\n  reactTouch[@\"locationY\"] = @(RCTSanitizeNaNValue(flippedLocation.y, @\"touchEvent.locationY\"));\n  reactTouch[@\"timestamp\"] =  @(nativeTouch.timestamp * 1000); // in ms, for JS\n}\n\n/**\n * Constructs information about touch events to send across the serialized\n * boundary. This data should be compliant with W3C `Touch` objects. This data\n * alone isn't sufficient to construct W3C `Event` objects. To construct that,\n * there must be a simple receiver on the other side of the bridge that\n * organizes the touch objects into `Event`s.\n *\n * We send the data as an array of `Touch`es, the type of action\n * (start/end/move/cancel) and the indices that represent \"changed\" `Touch`es\n * from that array.\n */\n- (void)_updateAndDispatchTouches:(NSSet<NSEvent *> *)touches\n                        eventName:(NSString *)eventName\n{\n  NSMutableArray *changedIndexes = [NSMutableArray new];\n  for (NSEvent *touch in touches) {\n    NSUInteger index = [_nativeTouches indexOfObjectPassingTest:^BOOL(id obj, __unused NSUInteger idx, __unused BOOL *stop) {\n      return touch.eventNumber == ((NSEvent *)obj).eventNumber;\n    }];\n    if (index == NSNotFound) {\n      continue;\n    }\n\n    [self _updateReactTouchAtIndex:index withNativeTouch:touch];\n    [changedIndexes addObject:@(index)];\n  }\n\n  if (changedIndexes.count == 0) {\n    return;\n  }\n\n  // Deep copy the touches because they will be accessed from another thread\n  // TODO: would it be safer to do this in the bridge or executor, rather than trusting caller?\n  NSMutableArray<NSDictionary *> *reactTouches =\n  [[NSMutableArray alloc] initWithCapacity:_reactTouches.count];\n  for (NSDictionary *touch in _reactTouches) {\n    [reactTouches addObject:[touch copy]];\n  }\n\n  BOOL canBeCoalesced = [eventName isEqualToString:@\"touchMove\"];\n\n  // We increment `_coalescingKey` twice here just for sure that\n  // this `_coalescingKey` will not be reused by ahother (preceding or following) event\n  // (yes, even if coalescing only happens (and makes sense) on events of the same type).\n\n  if (!canBeCoalesced) {\n    _coalescingKey++;\n  }\n\n  RCTTouchEvent *event = [[RCTTouchEvent alloc] initWithEventName:eventName\n                                                         reactTag:self.view.reactTag\n                                                     reactTouches:reactTouches\n                                                   changedIndexes:changedIndexes\n                                                    coalescingKey:_coalescingKey];\n\n  if (!canBeCoalesced) {\n    _coalescingKey++;\n  }\n  [_eventDispatcher sendEvent:event];\n}\n\n#pragma mark - Gesture Recognizer Delegate Callbacks\n\n//static BOOL RCTAllTouchesAreCancelledOrEnded(NSSet *touches)\n//{\n//  for (NSEvent *touch in touches) {\n//\n//    if (touch.phase == NSTouchPhaseBegan ||\n//        touch.phase == NSTouchPhaseMoved ||\n//        touch.phase == NSTouchPhaseStationary) {\n//      return NO;\n//    }\n//  }\n//  return YES;\n//}\n//\n//static BOOL RCTAnyTouchesChanged(NSSet *touches)\n//{\n//  for (NSEvent *touch in touches) {\n//    if (touch.phase == NSTouchPhaseBegan ||\n//        touch.phase == NSTouchPhaseMoved) {\n//      return YES;\n//    }\n//  }\n//  return NO;\n//}\n\n- (void)handleGesture\n{\n  // If gesture just recognized, send all touches to JS as if they just began.\n  if (self.state == NSGestureRecognizerStateBegan) {\n    [self _updateAndDispatchTouches:_nativeTouches.set eventName:@\"topTouchStart\"];\n    \n    // We store this flag separately from `state` because after a gesture is\n    // recognized, its `state` changes immediately but its action (this\n    // method) isn't fired until dependent gesture recognizers have failed. We\n    // only want to send move/end/cancel touches if we've sent the touchStart.\n    _dispatchedInitialTouches = YES;\n  }\n}\n\n#pragma mark - `UIResponder`-ish touch-delivery methods\n\n- (void)mouseDown:(NSEvent *)event\n{\n  [super mouseDown:event];\n\n  // \"start\" has to record new touches *before* extracting the event.\n  // \"end\"/\"cancel\" needs to remove the touch *after* extracting the event.\n  NSSet *touches = [NSSet setWithObject:event];\n  [self _recordNewTouches:touches];\n\n  [self _updateAndDispatchTouches:touches eventName:@\"touchStart\"];\n\n  if (self.state == NSGestureRecognizerStatePossible) {\n    self.state = NSGestureRecognizerStateBegan;\n  } else if (self.state == NSGestureRecognizerStateBegan) {\n    self.state = NSGestureRecognizerStateChanged;\n  }\n  [self handleGesture];\n}\n\n- (void)mouseDragged:(NSEvent *)event\n{\n  [super mouseDragged:event];\n  \n  NSSet *touches = [NSSet setWithObject:event];\n  if (_dispatchedInitialTouches) {\n    [self _updateAndDispatchTouches:touches eventName:@\"touchMove\"];\n    self.state = NSGestureRecognizerStateChanged;\n  }\n}\n\n- (void)mouseMoved:(NSEvent *)event\n{\n  NSPoint touchLocation = [event locationInWindow];\n  NSNumber *reactTag = [self.view reactTagAtPoint:touchLocation];\n  if (reactTag == nil) {\n    return;\n  }\n  if (_currentMouseOverTag != reactTag && _currentMouseOverTag.intValue > 0) {\n    [_bridge enqueueJSCall:@\"RCTEventEmitter.receiveEvent\"\n                      args:@[_currentMouseOverTag, @\"topMouseLeave\"]];\n    [_bridge enqueueJSCall:@\"RCTEventEmitter.receiveEvent\"\n                      args:@[reactTag, @\"topMouseEnter\"]];\n    _currentMouseOverTag = reactTag;\n  } else if (_currentMouseOverTag == 0) {\n    [_bridge enqueueJSCall:@\"RCTEventEmitter.receiveEvent\"\n                      args:@[reactTag, @\"topMouseEnter\"]];\n    _currentMouseOverTag = reactTag;\n  }\n}\n\n- (void)mouseUp:(NSEvent *)event\n{\n  [super mouseUp:event];\n  \n  NSSet *touches = [NSSet setWithObject:event];\n  if (_dispatchedInitialTouches) {\n    \n    [self _updateAndDispatchTouches:touches eventName:@\"touchEnd\"];\n    \n    self.state = NSGestureRecognizerStateEnded;\n  }\n  [self _recordRemovedTouches:touches];\n}\n\n\n- (BOOL)canPreventGestureRecognizer:(__unused NSGestureRecognizer *)preventedGestureRecognizer\n{\n  return NO;\n}\n\n- (BOOL)canBePreventedByGestureRecognizer:(NSGestureRecognizer *)preventingGestureRecognizer\n{\n  // We fail in favour of other external gesture recognizers.\n  // iOS will ask `delegate`'s opinion about this gesture recognizer little bit later.\n  // return ![preventingGestureRecognizer.view isDescendantOfView:self.view];\n  return NO;\n}\n\n- (void)reset\n{\n  if (_nativeTouches.count != 0) {\n    [self _updateAndDispatchTouches:_nativeTouches.set eventName:@\"touchCancel\"];\n\n    [_nativeTouches removeAllObjects];\n    [_reactTouches removeAllObjects];\n    [_touchViews removeAllObjects];\n  }\n}\n\n#pragma mark - Other\n\n- (void)cancel\n{\n  self.enabled = NO;\n  self.enabled = YES;\n}\n\n#pragma mark - UIGestureRecognizerDelegate\n\n- (BOOL)gestureRecognizer:(__unused NSGestureRecognizer *)gestureRecognizer shouldRequireFailureOfGestureRecognizer:(NSGestureRecognizer *)otherGestureRecognizer\n{\n  // Same condition for `failure of` as for `be prevented by`.\n  return [self canBePreventedByGestureRecognizer:otherGestureRecognizer];\n}\n\n@end\n"
  },
  {
    "path": "React/Base/RCTURLRequestDelegate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n/**\n * An abstract interface used by request handler modules to send\n * data back over the bridge back to JS.\n */\n@protocol RCTURLRequestDelegate <NSObject>\n\n/**\n * Call this when you send request data to the server. This is used to track\n * upload progress, so should be called multiple times for large request bodies.\n */\n- (void)URLRequest:(id)requestToken didSendDataWithProgress:(int64_t)bytesSent;\n\n/**\n * Call this when you first receives a response from the server. This should\n * include response headers, etc.\n */\n- (void)URLRequest:(id)requestToken didReceiveResponse:(NSURLResponse *)response;\n\n/**\n * Call this when you receive data from the server. This can be called multiple\n * times with partial data chunks, or just once with the full data packet.\n */\n- (void)URLRequest:(id)requestToken didReceiveData:(NSData *)data;\n\n/**\n * Call this when the request is complete and/or if an error is encountered.\n * For a successful request, the error parameter should be nil.\n */\n- (void)URLRequest:(id)requestToken didCompleteWithError:(NSError *)error;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTURLRequestHandler.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTURLRequestDelegate.h>\n\n/**\n * Provides the interface needed to register a request handler. Request handlers\n * are also bridge modules, so should be registered using RCT_EXPORT_MODULE().\n */\n@protocol RCTURLRequestHandler <RCTBridgeModule>\n\n/**\n * Indicates whether this handler is capable of processing the specified\n * request. Typically the handler would examine the scheme/protocol of the\n * request URL (and possibly the HTTP method and/or headers) to determine this.\n */\n- (BOOL)canHandleRequest:(NSURLRequest *)request;\n\n/**\n * Send a network request and call the delegate with the response data. The\n * method should return a token, which can be anything, including the request\n * itself. This will be used later to refer to the request in callbacks. The\n * `sendRequest:withDelegate:` method *must* return before calling any of the\n * delegate methods, or the delegate won't recognize the token.\n * Following common Objective-C pattern, `delegate` will not be retained.\n */\n- (id)sendRequest:(NSURLRequest *)request\n     withDelegate:(id<RCTURLRequestDelegate>)delegate;\n\n@optional\n\n/**\n * Not all request types can be cancelled, but this method can be implemented\n * for ones that can. It should be used to free up any resources on ongoing\n * processes associated with the request.\n */\n- (void)cancelRequest:(id)requestToken;\n\n/**\n * If more than one RCTURLRequestHandler responds YES to `canHandleRequest:`\n * then `handlerPriority` is used to determine which one to use. The handler\n * with the highest priority will be selected. Default priority is zero. If\n * two or more valid handlers have the same priority, the selection order is\n * undefined.\n */\n- (float)handlerPriority;\n\n@end\n"
  },
  {
    "path": "React/Base/RCTUtils.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <tgmath.h>\n\n#import <AppKit/AppKit.h>\n\n#import <CoreGraphics/CoreGraphics.h>\n#import <Foundation/Foundation.h>\n\n#import <React/RCTAssert.h>\n#import <React/RCTDefines.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n// JSON serialization/deserialization\nRCT_EXTERN NSString *__nullable RCTJSONStringify(id __nullable jsonObject, NSError **error);\nRCT_EXTERN id __nullable RCTJSONParse(NSString *__nullable jsonString, NSError **error);\nRCT_EXTERN id __nullable RCTJSONParseMutable(NSString *__nullable jsonString, NSError **error);\n\n// Sanitize a JSON object by stripping invalid types and/or NaN values\nRCT_EXTERN id RCTJSONClean(id object);\n\n// Get MD5 hash of a string\nRCT_EXTERN NSString *RCTMD5Hash(NSString *string);\n\n// Check if we are currently on the main queue (not to be confused with\n// the main thread, which is not neccesarily the same thing)\n// https://twitter.com/olebegemann/status/738656134731599872\nRCT_EXTERN BOOL RCTIsMainQueue(void);\n\n// Execute the specified block on the main queue. Unlike dispatch_async()\n// this will execute immediately if we're already on the main queue.\nRCT_EXTERN void RCTExecuteOnMainQueue(dispatch_block_t block);\n\n// Legacy function to execute the specified block on the main queue synchronously.\n// Please do not use this unless you know what you're doing.\nRCT_EXTERN void RCTUnsafeExecuteOnMainQueueSync(dispatch_block_t block);\n\n// Get screen metrics in a thread-safe way\nRCT_EXTERN CGFloat RCTScreenScale(void);\nRCT_EXTERN CGSize RCTScreenSize(void);\n\n// Round float coordinates to nearest whole screen pixel (not point)\nRCT_EXTERN CGFloat RCTRoundPixelValue(CGFloat value);\nRCT_EXTERN CGFloat RCTCeilPixelValue(CGFloat value);\nRCT_EXTERN CGFloat RCTFloorPixelValue(CGFloat value);\n\n// Convert a size in points to pixels, rounded up to the nearest integral size\nRCT_EXTERN CGSize RCTSizeInPixels(CGSize pointSize, CGFloat scale);\n\n// Method swizzling\nRCT_EXTERN void RCTSwapClassMethods(Class cls, SEL original, SEL replacement);\nRCT_EXTERN void RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement);\n\n// Module subclass support\nRCT_EXTERN BOOL RCTClassOverridesClassMethod(Class cls, SEL selector);\nRCT_EXTERN BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector);\n\n// Creates a standardized error object to return in callbacks\nRCT_EXTERN NSDictionary<NSString *, id> *RCTMakeError(NSString *message, id __nullable toStringify, NSDictionary<NSString *, id> *__nullable extraData);\nRCT_EXTERN NSDictionary<NSString *, id> *RCTMakeAndLogError(NSString *message, id __nullable toStringify, NSDictionary<NSString *, id> *__nullable extraData);\nRCT_EXTERN NSDictionary<NSString *, id> *RCTJSErrorFromNSError(NSError *error);\nRCT_EXTERN NSDictionary<NSString *, id> *RCTJSErrorFromCodeMessageAndNSError(NSString *code, NSString *message, NSError *__nullable error);\n\n// The default error code to use as the `code` property for callback error objects\nRCT_EXTERN NSString *const RCTErrorUnspecified;\n\n// Returns YES if React is running in a test environment\nRCT_EXTERN BOOL RCTRunningInTestEnvironment(void);\n\n// Returns YES if React is running in an iOS App Extension\nRCT_EXTERN BOOL RCTRunningInAppExtension(void);\n\n// Returns the shared UIApplication instance, or nil if running in an App Extension\nRCT_EXTERN NSApplication *__nullable RCTSharedApplication(void);\n\n// Returns the current main window, useful if you need to access the root view\n// or view controller, e.g. to present a modal view controller or alert.\nRCT_EXTERN NSWindow *__nullable RCTKeyWindow(void);\n\n// Returns the presented view controller, useful if you need\n// e.g. to present a modal view controller or alert over it\nRCT_EXTERN NSViewController *__nullable RCTPresentedViewController(void);\n\n// Does this device support force touch (aka 3D Touch)?\nRCT_EXTERN BOOL RCTForceTouchAvailable(void);\n\n// Return a UIAlertView initialized with the given values\n// or nil if running in an app extension\nRCT_EXTERN NSAlert *__nullable RCTAlertView(NSString *title,\n                                            NSString *__nullable message,\n                                            id __nullable delegate,\n                                            NSString *__nullable cancelButtonTitle,\n                                            NSArray<NSString *> *__nullable otherButtonTitles);\n\n// Create an NSError in the RCTErrorDomain\nRCT_EXTERN NSError *RCTErrorWithMessage(NSString *message);\n\n// Convert nil values to NSNull, and vice-versa\n#define RCTNullIfNil(value) (value ?: (id)kCFNull)\n#define RCTNilIfNull(value) \\\n  ({ __typeof__(value) t = (value); (id)t == (id)kCFNull ? (__typeof(value))nil : t; })\n\n// Convert NaN or infinite values to zero, as these aren't JSON-safe\nRCT_EXTERN double RCTZeroIfNaN(double value);\n\n// Returns `0` and log special warning if value is NaN or INF.\nRCT_EXTERN double RCTSanitizeNaNValue(double value, NSString *property);\n\n// Convert data to a Base64-encoded data URL\nRCT_EXTERN NSURL *RCTDataURL(NSString *mimeType, NSData *data);\n\n// Gzip functionality - compression level in range 0 - 1 (-1 for default)\nRCT_EXTERN NSData *__nullable RCTGzipData(NSData *__nullable data, float level);\n\n// Returns the relative path within the main bundle for an absolute URL\n// (or nil, if the URL does not specify a path within the main bundle)\nRCT_EXTERN NSString *__nullable RCTBundlePathForURL(NSURL *__nullable URL);\n\n// Returns the Path of Library directory\nRCT_EXTERN NSString *__nullable RCTLibraryPath(void);\n\n// Returns the relative path within the library for an absolute URL\n// (or nil, if the URL does not specify a path within the Library directory)\nRCT_EXTERN NSString *__nullable RCTLibraryPathForURL(NSURL *__nullable URL);\n\n// Determines if a given image URL refers to a image in bundle\nRCT_EXTERN BOOL RCTIsBundleAssetURL(NSURL *__nullable imageURL);\n\n// Determines if a given image URL refers to a image in library\nRCT_EXTERN BOOL RCTIsLibraryAssetURL(NSURL *__nullable imageURL);\n\n// Determines if a given image URL refers to a local image\nRCT_EXTERN BOOL RCTIsLocalAssetURL(NSURL *__nullable imageURL);\n\n// Returns an UIImage for a local image asset. Returns nil if the URL\n// does not correspond to a local asset.\nRCT_EXTERN NSImage *__nullable RCTImageFromLocalAssetURL(NSURL *imageURL);\n\n// Creates a new, unique temporary file path with the specified extension\nRCT_EXTERN NSString *__nullable RCTTempFilePath(NSString *__nullable extension, NSError **error);\n\n// Converts a CGColor to a hex string\nRCT_EXTERN NSString *RCTColorToHexString(CGColorRef color);\n\n// Get standard localized string (if it exists)\nRCT_EXTERN NSString *RCTUIKitLocalizedString(NSString *string);\n\n// URL manipulation\nRCT_EXTERN NSString *__nullable RCTGetURLQueryParam(NSURL *__nullable URL, NSString *param);\nRCT_EXTERN NSURL *__nullable RCTURLByReplacingQueryParam(NSURL *__nullable URL, NSString *param, NSString *__nullable value);\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Base/RCTUtils.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTUtils.h\"\n\n#import <dlfcn.h>\n#import <mach/mach_time.h>\n#import <objc/message.h>\n#import <objc/runtime.h>\n#import <zlib.h>\n\n#import <AppKit/AppKit.h>\n\n#import <CommonCrypto/CommonCrypto.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTLog.h\"\n\nNSString *const RCTErrorUnspecified = @\"EUNSPECIFIED\";\n\nstatic NSString *__nullable _RCTJSONStringifyNoRetry(id __nullable jsonObject, NSError **error)\n{\n  if (!jsonObject) {\n    return nil;\n  }\n\n  static SEL JSONKitSelector = NULL;\n  static NSSet<Class> *collectionTypes;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    SEL selector = NSSelectorFromString(@\"JSONStringWithOptions:error:\");\n    if ([NSDictionary instancesRespondToSelector:selector]) {\n      JSONKitSelector = selector;\n      collectionTypes = [NSSet setWithObjects:\n                         [NSArray class], [NSMutableArray class],\n                         [NSDictionary class], [NSMutableDictionary class], nil];\n    }\n  });\n\n  @try {\n\n    // Use JSONKit if available and object is not a fragment\n    if (JSONKitSelector && [collectionTypes containsObject:[jsonObject classForCoder]]) {\n      return ((NSString *(*)(id, SEL, int, NSError **))objc_msgSend)(jsonObject, JSONKitSelector, 0, error);\n    }\n\n    // Use Foundation JSON method\n    NSData *jsonData = [NSJSONSerialization\n                        dataWithJSONObject:jsonObject options:(NSJSONWritingOptions)NSJSONReadingAllowFragments\n                        error:error];\n\n    return jsonData ? [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding] : nil;\n  }\n  @catch (NSException *exception) {\n\n    // Convert exception to error\n    if (error) {\n      *error = [NSError errorWithDomain:RCTErrorDomain code:0 userInfo:@{\n        NSLocalizedDescriptionKey: exception.description ?: @\"\"\n      }];\n    }\n    return nil;\n  }\n}\n\nNSString *__nullable RCTJSONStringify(id __nullable jsonObject, NSError **error)\n{\n  if (error) {\n    return _RCTJSONStringifyNoRetry(jsonObject, error);\n  } else {\n    NSError *localError;\n    NSString *json = _RCTJSONStringifyNoRetry(jsonObject, &localError);\n    if (localError) {\n      RCTLogError(@\"RCTJSONStringify() encountered the following error: %@\",\n                  localError.localizedDescription);\n      // Sanitize the data, then retry. This is slow, but it prevents uncaught\n      // data issues from crashing in production\n      return _RCTJSONStringifyNoRetry(RCTJSONClean(jsonObject), NULL);\n    }\n    return json;\n  }\n}\n\nstatic id __nullable _RCTJSONParse(NSString *__nullable jsonString, BOOL mutable, NSError **error)\n{\n  static SEL JSONKitSelector = NULL;\n  static SEL JSONKitMutableSelector = NULL;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    SEL selector = NSSelectorFromString(@\"objectFromJSONStringWithParseOptions:error:\");\n    if ([NSString instancesRespondToSelector:selector]) {\n      JSONKitSelector = selector;\n      JSONKitMutableSelector = NSSelectorFromString(@\"mutableObjectFromJSONStringWithParseOptions:error:\");\n    }\n  });\n\n  if (jsonString) {\n\n    // Use JSONKit if available and string is not a fragment\n    if (JSONKitSelector) {\n      NSInteger length = jsonString.length;\n      for (NSInteger i = 0; i < length; i++) {\n        unichar c = [jsonString characterAtIndex:i];\n        if (strchr(\"{[\", c)) {\n          static const int options = (1 << 2); // loose unicode\n          SEL selector = mutable ? JSONKitMutableSelector : JSONKitSelector;\n          return ((id (*)(id, SEL, int, NSError **))objc_msgSend)(jsonString, selector, options, error);\n        }\n        if (!strchr(\" \\r\\n\\t\", c)) {\n          break;\n        }\n      }\n    }\n\n    // Use Foundation JSON method\n    NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];\n    if (!jsonData) {\n      jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];\n      if (jsonData) {\n        RCTLogWarn(@\"RCTJSONParse received the following string, which could \"\n                   \"not be losslessly converted to UTF8 data: '%@'\", jsonString);\n      } else {\n        NSString *errorMessage = @\"RCTJSONParse received invalid UTF8 data\";\n        if (error) {\n          *error = RCTErrorWithMessage(errorMessage);\n        } else {\n          RCTLogError(@\"%@\", errorMessage);\n        }\n        return nil;\n      }\n    }\n    NSJSONReadingOptions options = NSJSONReadingAllowFragments;\n    if (mutable) {\n      options |= NSJSONReadingMutableContainers;\n    }\n    return [NSJSONSerialization JSONObjectWithData:jsonData\n                                           options:options\n                                             error:error];\n  }\n  return nil;\n}\n\nid __nullable RCTJSONParse(NSString *__nullable jsonString, NSError **error)\n{\n  return _RCTJSONParse(jsonString, NO, error);\n}\n\nid __nullable RCTJSONParseMutable(NSString *__nullable jsonString, NSError **error)\n{\n  return _RCTJSONParse(jsonString, YES, error);\n}\n\nid RCTJSONClean(id object)\n{\n  static dispatch_once_t onceToken;\n  static NSSet<Class> *validLeafTypes;\n  dispatch_once(&onceToken, ^{\n    validLeafTypes = [[NSSet alloc] initWithArray:@[\n      [NSString class],\n      [NSMutableString class],\n      [NSNumber class],\n      [NSNull class],\n    ]];\n  });\n\n  if ([validLeafTypes containsObject:[object classForCoder]]) {\n    if ([object isKindOfClass:[NSNumber class]]) {\n      return @(RCTZeroIfNaN([object doubleValue]));\n    }\n    if ([object isKindOfClass:[NSString class]]) {\n      if ([object UTF8String] == NULL) {\n        return (id)kCFNull;\n      }\n    }\n    return object;\n  }\n\n  if ([object isKindOfClass:[NSDictionary class]]) {\n    __block BOOL copy = NO;\n    NSMutableDictionary<NSString *, id> *values = [[NSMutableDictionary alloc] initWithCapacity:[object count]];\n    [object enumerateKeysAndObjectsUsingBlock:^(NSString *key, id item, __unused BOOL *stop) {\n      id value = RCTJSONClean(item);\n      values[key] = value;\n      copy |= value != item;\n    }];\n    return copy ? values : object;\n  }\n\n  if ([object isKindOfClass:[NSArray class]]) {\n    __block BOOL copy = NO;\n    __block NSArray *values = object;\n    [object enumerateObjectsUsingBlock:^(id item, NSUInteger idx, __unused BOOL *stop) {\n      id value = RCTJSONClean(item);\n      if (copy) {\n        [(NSMutableArray *)values addObject:value];\n      } else if (value != item) {\n        // Converted value is different, so we'll need to copy the array\n        values = [[NSMutableArray alloc] initWithCapacity:values.count];\n        for (NSUInteger i = 0; i < idx; i++) {\n          [(NSMutableArray *)values addObject:object[i]];\n        }\n        [(NSMutableArray *)values addObject:value];\n        copy = YES;\n      }\n    }];\n    return values;\n  }\n\n  return (id)kCFNull;\n}\n\nNSString *RCTMD5Hash(NSString *string)\n{\n  const char *str = string.UTF8String;\n  unsigned char result[CC_MD5_DIGEST_LENGTH];\n  CC_MD5(str, (CC_LONG)strlen(str), result);\n\n  return [NSString stringWithFormat:@\"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\",\n    result[0], result[1], result[2], result[3],\n    result[4], result[5], result[6], result[7],\n    result[8], result[9], result[10], result[11],\n    result[12], result[13], result[14], result[15]\n  ];\n}\n\nBOOL RCTIsMainQueue()\n{\n  static void *mainQueueKey = &mainQueueKey;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    dispatch_queue_set_specific(dispatch_get_main_queue(),\n                                mainQueueKey, mainQueueKey, NULL);\n  });\n  return dispatch_get_specific(mainQueueKey) == mainQueueKey;\n}\n\nvoid RCTExecuteOnMainQueue(dispatch_block_t block)\n{\n  if (RCTIsMainQueue()) {\n    block();\n  } else {\n    dispatch_async(dispatch_get_main_queue(), ^{\n      block();\n    });\n  }\n}\n\n// Please do not use this method\n// unless you know what you are doing.\nvoid RCTUnsafeExecuteOnMainQueueSync(dispatch_block_t block)\n{\n  if (RCTIsMainQueue()) {\n    block();\n  } else {\n    dispatch_sync(dispatch_get_main_queue(), ^{\n      block();\n    });\n  }\n}\n\nstatic void RCTUnsafeExecuteOnMainQueueOnceSync(dispatch_once_t *onceToken, dispatch_block_t block)\n{\n  // The solution was borrowed from a post by Ben Alpert:\n  // https://benalpert.com/2014/04/02/dispatch-once-initialization-on-the-main-thread.html\n  // See also: https://www.mikeash.com/pyblog/friday-qa-2014-06-06-secrets-of-dispatch_once.html\n  if (RCTIsMainQueue()) {\n    dispatch_once(onceToken, block);\n  } else {\n    if (DISPATCH_EXPECT(*onceToken == 0L, NO)) {\n      dispatch_sync(dispatch_get_main_queue(), ^{\n        dispatch_once(onceToken, block);\n      });\n    }\n  }\n}\n\nCGFloat RCTScreenScale()\n{\n  static dispatch_once_t onceToken;\n  static CGFloat scale;\n\n  RCTUnsafeExecuteOnMainQueueOnceSync(&onceToken, ^{\n      scale = [NSScreen mainScreen].backingScaleFactor; // TODO:\n  });\n\n  return scale;\n}\n\nCGSize RCTScreenSize()\n{\n  // FIXME: this caches the bounds at app start, whatever those were, and then\n  // doesn't update when the device is rotated. We need to find another thread-\n  // safe way to get the screen size.\n\n  static CGSize size;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    RCTUnsafeExecuteOnMainQueueSync(^{\n      size = [NSScreen mainScreen].frame.size;\n    });\n  });\n\n  return size;\n}\n\nCGFloat RCTRoundPixelValue(CGFloat value)\n{\n  CGFloat scale = RCTScreenScale();\n  return round(value * scale) / scale;\n}\n\nCGFloat RCTCeilPixelValue(CGFloat value)\n{\n  CGFloat scale = RCTScreenScale();\n  return ceil(value * scale) / scale;\n}\n\nCGFloat RCTFloorPixelValue(CGFloat value)\n{\n  CGFloat scale = RCTScreenScale();\n  return floor(value * scale) / scale;\n}\n\nCGSize RCTSizeInPixels(CGSize pointSize, CGFloat scale)\n{\n  return (CGSize){\n    ceil(pointSize.width * scale),\n    ceil(pointSize.height * scale),\n  };\n}\n\nvoid RCTSwapClassMethods(Class cls, SEL original, SEL replacement)\n{\n  Method originalMethod = class_getClassMethod(cls, original);\n  IMP originalImplementation = method_getImplementation(originalMethod);\n  const char *originalArgTypes = method_getTypeEncoding(originalMethod);\n\n  Method replacementMethod = class_getClassMethod(cls, replacement);\n  IMP replacementImplementation = method_getImplementation(replacementMethod);\n  const char *replacementArgTypes = method_getTypeEncoding(replacementMethod);\n\n  if (class_addMethod(cls, original, replacementImplementation, replacementArgTypes)) {\n    class_replaceMethod(cls, replacement, originalImplementation, originalArgTypes);\n  } else {\n    method_exchangeImplementations(originalMethod, replacementMethod);\n  }\n}\n\nvoid RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement)\n{\n  Method originalMethod = class_getInstanceMethod(cls, original);\n  IMP originalImplementation = method_getImplementation(originalMethod);\n  const char *originalArgTypes = method_getTypeEncoding(originalMethod);\n\n  Method replacementMethod = class_getInstanceMethod(cls, replacement);\n  IMP replacementImplementation = method_getImplementation(replacementMethod);\n  const char *replacementArgTypes = method_getTypeEncoding(replacementMethod);\n\n  if (class_addMethod(cls, original, replacementImplementation, replacementArgTypes)) {\n    class_replaceMethod(cls, replacement, originalImplementation, originalArgTypes);\n  } else {\n    method_exchangeImplementations(originalMethod, replacementMethod);\n  }\n}\n\nBOOL RCTClassOverridesClassMethod(Class cls, SEL selector)\n{\n  return RCTClassOverridesInstanceMethod(object_getClass(cls), selector);\n}\n\nBOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector)\n{\n  unsigned int numberOfMethods;\n  Method *methods = class_copyMethodList(cls, &numberOfMethods);\n  for (unsigned int i = 0; i < numberOfMethods; i++) {\n    if (method_getName(methods[i]) == selector) {\n      free(methods);\n      return YES;\n    }\n  }\n  free(methods);\n  return NO;\n}\n\nNSDictionary<NSString *, id> *RCTMakeError(NSString *message,\n                                           id __nullable toStringify,\n                                           NSDictionary<NSString *, id> *__nullable extraData)\n{\n  if (toStringify) {\n    message = [message stringByAppendingString:[toStringify description]];\n  }\n\n  NSMutableDictionary<NSString *, id> *error = [extraData mutableCopy] ?: [NSMutableDictionary new];\n  error[@\"message\"] = message;\n  return error;\n}\n\nNSDictionary<NSString *, id> *RCTMakeAndLogError(NSString *message,\n                                                 id __nullable toStringify,\n                                                 NSDictionary<NSString *, id> *__nullable extraData)\n{\n  NSDictionary<NSString *, id> *error = RCTMakeError(message, toStringify, extraData);\n  RCTLogError(@\"\\nError: %@\", error);\n  return error;\n}\n\nNSDictionary<NSString *, id> *RCTJSErrorFromNSError(NSError *error)\n{\n  NSString *codeWithDomain = [NSString stringWithFormat:@\"E%@%lld\", error.domain.uppercaseString, (long long)error.code];\n  return RCTJSErrorFromCodeMessageAndNSError(codeWithDomain,\n                                             error.localizedDescription,\n                                             error);\n}\n\n// TODO: Can we just replace RCTMakeError with this function instead?\nNSDictionary<NSString *, id> *RCTJSErrorFromCodeMessageAndNSError(NSString *code,\n                                                                  NSString *message,\n                                                                  NSError *__nullable error)\n{\n  NSString *errorMessage;\n  NSArray<NSString *> *stackTrace = [NSThread callStackSymbols];\n  NSMutableDictionary *userInfo;\n  NSMutableDictionary<NSString *, id> *errorInfo =\n  [NSMutableDictionary dictionaryWithObject:stackTrace forKey:@\"nativeStackIOS\"];\n\n  if (error) {\n    errorMessage = error.localizedDescription ?: @\"Unknown error from a native module\";\n    errorInfo[@\"domain\"] = error.domain ?: RCTErrorDomain;\n    if (error.userInfo) {\n      userInfo = [error.userInfo mutableCopy];\n      if (userInfo != nil && userInfo[NSUnderlyingErrorKey] != nil) {\n        NSError *underlyingError = error.userInfo[NSUnderlyingErrorKey];\n        NSString *underlyingCode = [NSString stringWithFormat:@\"%d\", (int)underlyingError.code];\n        userInfo[NSUnderlyingErrorKey] = RCTJSErrorFromCodeMessageAndNSError(underlyingCode, @\"underlying error\", underlyingError);\n      }\n    }\n  } else {\n    errorMessage = @\"Unknown error from a native module\";\n    errorInfo[@\"domain\"] = RCTErrorDomain;\n    userInfo = nil;\n  }\n  errorInfo[@\"code\"] = code ?: RCTErrorUnspecified;\n  errorInfo[@\"userInfo\"] = RCTNullIfNil(userInfo);\n\n  // Allow for explicit overriding of the error message\n  errorMessage = message ?: errorMessage;\n\n  return RCTMakeError(errorMessage, nil, errorInfo);\n}\n\nBOOL RCTRunningInTestEnvironment(void)\n{\n  static BOOL isTestEnvironment = NO;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    NSDictionary *environment = [[NSProcessInfo processInfo] environment];\n    isTestEnvironment = objc_lookUpClass(\"SenTestCase\") || objc_lookUpClass(\"XCTest\") ||\n      [environment[@\"IS_TESTING\"] boolValue];\n  });\n  return isTestEnvironment;\n}\n\nBOOL RCTRunningInAppExtension(void)\n{\n  return [[[[NSBundle mainBundle] bundlePath] pathExtension] isEqualToString:@\"appex\"];\n}\n\nNSApplication *__nullable RCTSharedApplication(void)\n{\n  if (RCTRunningInAppExtension()) {\n    return nil;\n  }\n\n  return [[NSApplication class] performSelector:@selector(sharedApplication)];\n}\n\nNSWindow *__nullable RCTKeyWindow(void)\n{\n  if (RCTRunningInAppExtension()) {\n    return nil;\n  }\n\n  // TODO: replace with a more robust solution\n  return RCTSharedApplication().keyWindow;\n}\n\nNSViewController *__nullable RCTPresentedViewController(void)\n{\n  if (RCTRunningInAppExtension()) {\n    return nil;\n  }\n  NSViewController *controller = RCTKeyWindow().contentViewController;\n\n//  while (presentedController && ![presentedController isBeingDismissed]) {\n//    controller = presentedController;\n//    presentedController = controller.presentedViewController;\n//  }\n\n  return controller;\n}\n\nBOOL RCTForceTouchAvailable(void)\n{\n  static BOOL forceSupported;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    forceSupported = NO;\n  });\n  //TODO:\n  return forceSupported;\n}\n\nNSError *RCTErrorWithMessage(NSString *message)\n{\n  NSDictionary<NSString *, id> *errorInfo = @{NSLocalizedDescriptionKey: message};\n  return [[NSError alloc] initWithDomain:RCTErrorDomain code:0 userInfo:errorInfo];\n}\n\ndouble RCTZeroIfNaN(double value)\n{\n  return isnan(value) || isinf(value) ? 0 : value;\n}\n\ndouble RCTSanitizeNaNValue(double value, NSString *property)\n{\n  if (!isnan(value) && !isinf(value)) {\n    return value;\n  }\n\n  RCTLogWarn(@\"The value `%@` equals NaN or INF and will be replaced by `0`.\", property);\n  return 0;\n}\n\nNSURL *RCTDataURL(NSString *mimeType, NSData *data)\n{\n  return [NSURL URLWithString:\n          [NSString stringWithFormat:@\"data:%@;base64,%@\", mimeType,\n           [data base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0]]];\n}\n\nBOOL RCTIsGzippedData(NSData *__nullable); // exposed for unit testing purposes\nBOOL RCTIsGzippedData(NSData *__nullable data)\n{\n  UInt8 *bytes = (UInt8 *)data.bytes;\n  return (data.length >= 2 && bytes[0] == 0x1f && bytes[1] == 0x8b);\n}\n\nNSData *__nullable RCTGzipData(NSData *__nullable input, float level)\n{\n  if (input.length == 0 || RCTIsGzippedData(input)) {\n    return input;\n  }\n\n  void *libz = dlopen(\"/usr/lib/libz.dylib\", RTLD_LAZY);\n  int (*deflateInit2_)(z_streamp, int, int, int, int, int, const char *, int) = dlsym(libz, \"deflateInit2_\");\n  int (*deflate)(z_streamp, int) = dlsym(libz, \"deflate\");\n  int (*deflateEnd)(z_streamp) = dlsym(libz, \"deflateEnd\");\n\n  z_stream stream;\n  stream.zalloc = Z_NULL;\n  stream.zfree = Z_NULL;\n  stream.opaque = Z_NULL;\n  stream.avail_in = (uint)input.length;\n  stream.next_in = (Bytef *)input.bytes;\n  stream.total_out = 0;\n  stream.avail_out = 0;\n\n  static const NSUInteger RCTGZipChunkSize = 16384;\n\n  NSMutableData *output = nil;\n  int compression = (level < 0.0f)? Z_DEFAULT_COMPRESSION: (int)(roundf(level * 9));\n  if (deflateInit2(&stream, compression, Z_DEFLATED, 31, 8, Z_DEFAULT_STRATEGY) == Z_OK) {\n    output = [NSMutableData dataWithLength:RCTGZipChunkSize];\n    while (stream.avail_out == 0) {\n      if (stream.total_out >= output.length) {\n        output.length += RCTGZipChunkSize;\n      }\n      stream.next_out = (uint8_t *)output.mutableBytes + stream.total_out;\n      stream.avail_out = (uInt)(output.length - stream.total_out);\n      deflate(&stream, Z_FINISH);\n    }\n    deflateEnd(&stream);\n    output.length = stream.total_out;\n  }\n\n  dlclose(libz);\n\n  return output;\n}\n\nstatic NSString *RCTRelativePathForURL(NSString *basePath, NSURL *__nullable URL)\n{\n  if (!URL.fileURL) {\n    // Not a file path\n    return nil;\n  }\n  NSString *path = [NSString stringWithUTF8String:[URL fileSystemRepresentation]];\n  if (![path hasPrefix:basePath]) {\n    // Not a bundle-relative file\n    return nil;\n  }\n  path = [path substringFromIndex:basePath.length];\n  if ([path hasPrefix:@\"/\"]) {\n    path = [path substringFromIndex:1];\n  }\n  return path;\n}\n\nNSString *__nullable RCTLibraryPath(void)\n{\n    static NSString *libraryPath = nil;\n    static dispatch_once_t onceToken;\n    dispatch_once(&onceToken, ^{\n        libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject];\n    });\n    return libraryPath;\n}\n\nNSString *__nullable RCTBundlePathForURL(NSURL *__nullable URL)\n{\n  return RCTRelativePathForURL([[NSBundle mainBundle] resourcePath], URL);\n\n}\n\nNSString *__nullable RCTLibraryPathForURL(NSURL *__nullable URL)\n{\n  return RCTRelativePathForURL(RCTLibraryPath(), URL);\n}\n\nstatic BOOL RCTIsImageAssetsPath(NSString *path)\n{\n  NSString *extension = [path pathExtension];\n  return [extension isEqualToString:@\"png\"] || [extension isEqualToString:@\"jpg\"];\n}\n\nBOOL RCTIsBundleAssetURL(NSURL *__nullable imageURL)\n{\n  return RCTIsImageAssetsPath(RCTBundlePathForURL(imageURL));\n}\n\nBOOL RCTIsLibraryAssetURL(NSURL *__nullable imageURL)\n{\n  return RCTIsImageAssetsPath(RCTLibraryPathForURL(imageURL));\n}\n\nBOOL RCTIsLocalAssetURL(NSURL *__nullable imageURL)\n{\n  return RCTIsBundleAssetURL(imageURL) || RCTIsLibraryAssetURL(imageURL);\n}\n\nstatic NSString *bundleName(NSBundle *bundle)\n{\n  NSString *name = bundle.infoDictionary[@\"CFBundleName\"];\n  if (!name) {\n    name = [[bundle.bundlePath lastPathComponent] stringByDeletingPathExtension];\n  }\n  return name;\n}\n\nstatic NSBundle *bundleForPath(NSString *key)\n{\n  static NSMutableDictionary *bundleCache;\n  if (!bundleCache) {\n    bundleCache = [NSMutableDictionary new];\n    bundleCache[@\"main\"] = [NSBundle mainBundle];\n\n    // Initialize every bundle in the array\n    for (NSString *path in [[NSBundle mainBundle] pathsForResourcesOfType:@\"bundle\" inDirectory:nil]) {\n      [NSBundle bundleWithPath:path];\n    }\n\n    // The bundles initialized above will now also be in `allBundles`\n    for (NSBundle *bundle in [NSBundle allBundles]) {\n      bundleCache[bundleName(bundle)] = bundle;\n    }\n  }\n\n  return bundleCache[key];\n}\n\nNSImage *__nullable RCTImageFromLocalAssetURL(NSURL *imageURL)\n{\n  NSString *imageName = RCTBundlePathForURL(imageURL);\n\n  NSBundle *bundle = nil;\n  NSArray *imagePathComponents = [imageName pathComponents];\n  if ([imagePathComponents count] > 1 &&\n      [[[imagePathComponents firstObject] pathExtension] isEqualToString:@\"bundle\"]) {\n    NSString *bundlePath = [imagePathComponents firstObject];\n    bundle = bundleForPath([bundlePath stringByDeletingPathExtension]);\n    imageName = [imageName substringFromIndex:(bundlePath.length + 1)];\n  }\n\n  NSImage *image = nil;\n  if (bundle) {\n    image = [bundle imageForResource:imageName];\n  } else {\n    image = [NSImage imageNamed:imageName];\n  }\n\n  if (!image) {\n    // Attempt to load from the file system\n    NSData *fileData;\n    if (imageURL.pathExtension.length == 0) {\n      fileData = [NSData dataWithContentsOfURL:[imageURL URLByAppendingPathExtension:@\"png\"]];\n    } else {\n      fileData = [NSData dataWithContentsOfURL:imageURL];\n    }\n    image = [[NSImage alloc] initWithData:fileData];\n  }\n\n  if (!image && !bundle) {\n    // We did not find the image in the mainBundle, check in other shipped frameworks.\n    NSArray<NSURL *> *possibleFrameworks = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:[[NSBundle mainBundle] privateFrameworksURL]\n                                                                        includingPropertiesForKeys:@[]\n                                                                                           options:0\n                                                                                             error:nil];\n    for (NSURL *frameworkURL in possibleFrameworks) {\n      bundle = [NSBundle bundleWithURL:frameworkURL];\n      image = [bundle imageForResource:imageName];\n      if (image) {\n        RCTLogWarn(@\"Image %@ not found in mainBundle, but found in %@\", imageName, bundle);\n        break;\n      }\n    }\n  }\n  return image;\n}\n\nRCT_EXTERN NSString *__nullable RCTTempFilePath(NSString *extension, NSError **error)\n{\n  static NSError *setupError = nil;\n  static NSString *directory;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    directory = [NSTemporaryDirectory() stringByAppendingPathComponent:@\"ReactNative\"];\n    // If the temporary directory already exists, we'll delete it to ensure\n    // that temp files from the previous run have all been deleted. This is not\n    // a security measure, it simply prevents the temp directory from using too\n    // much space, as the circumstances under which iOS clears it automatically\n    // are not well-defined.\n    NSFileManager *fileManager = [NSFileManager new];\n    if ([fileManager fileExistsAtPath:directory]) {\n      [fileManager removeItemAtPath:directory error:NULL];\n    }\n    if (![fileManager fileExistsAtPath:directory]) {\n      NSError *localError = nil;\n      if (![fileManager createDirectoryAtPath:directory\n                  withIntermediateDirectories:YES\n                                   attributes:nil\n                                        error:&localError]) {\n        // This is bad\n        RCTLogError(@\"Failed to create temporary directory: %@\", localError);\n        setupError = localError;\n        directory = nil;\n      }\n    }\n  });\n\n  if (!directory || setupError) {\n    if (error) {\n      *error = setupError;\n    }\n    return nil;\n  }\n\n  // Append a unique filename\n  NSString *filename = [NSUUID new].UUIDString;\n  if (extension) {\n    filename = [filename stringByAppendingPathExtension:extension];\n  }\n  return [directory stringByAppendingPathComponent:filename];\n}\n\nstatic void RCTGetRGBAColorComponents(CGColorRef color, CGFloat rgba[4])\n{\n  CGColorSpaceModel model = CGColorSpaceGetModel(CGColorGetColorSpace(color));\n  const CGFloat *components = CGColorGetComponents(color);\n  switch (model)\n  {\n    case kCGColorSpaceModelMonochrome:\n    {\n      rgba[0] = components[0];\n      rgba[1] = components[0];\n      rgba[2] = components[0];\n      rgba[3] = components[1];\n      break;\n    }\n    case kCGColorSpaceModelRGB:\n    {\n      rgba[0] = components[0];\n      rgba[1] = components[1];\n      rgba[2] = components[2];\n      rgba[3] = components[3];\n      break;\n    }\n    case kCGColorSpaceModelCMYK:\n    case kCGColorSpaceModelDeviceN:\n    case kCGColorSpaceModelIndexed:\n    case kCGColorSpaceModelLab:\n    case kCGColorSpaceModelPattern:\n    case kCGColorSpaceModelUnknown:\n    {\n\n#ifdef RCT_DEBUG\n      //unsupported format\n      RCTLogError(@\"Unsupported color model: %i\", model);\n#endif\n\n      rgba[0] = 0.0;\n      rgba[1] = 0.0;\n      rgba[2] = 0.0;\n      rgba[3] = 1.0;\n      break;\n    }\n  }\n}\n\nNSString *RCTColorToHexString(CGColorRef color)\n{\n  CGFloat rgba[4];\n  RCTGetRGBAColorComponents(color, rgba);\n  uint8_t r = rgba[0]*255;\n  uint8_t g = rgba[1]*255;\n  uint8_t b = rgba[2]*255;\n  uint8_t a = rgba[3]*255;\n  if (a < 255) {\n    return [NSString stringWithFormat:@\"#%02x%02x%02x%02x\", r, g, b, a];\n  } else {\n    return [NSString stringWithFormat:@\"#%02x%02x%02x\", r, g, b];\n  }\n}\n\n// (https://github.com/0xced/XCDFormInputAccessoryView/blob/master/XCDFormInputAccessoryView/XCDFormInputAccessoryView.m#L10-L14)\nNSString *RCTUIKitLocalizedString(NSString *string)\n{\n  NSBundle *UIKitBundle = [NSBundle bundleForClass:[NSApplication class]];\n  return UIKitBundle ? [UIKitBundle localizedStringForKey:string value:string table:nil] : string;\n}\n\nNSString *__nullable RCTGetURLQueryParam(NSURL *__nullable URL, NSString *param)\n{\n  RCTAssertParam(param);\n  if (!URL) {\n    return nil;\n  }\n\n  NSURLComponents *components = [NSURLComponents componentsWithURL:URL\n                                           resolvingAgainstBaseURL:YES];\n  for (NSURLQueryItem *queryItem in [components.queryItems reverseObjectEnumerator]) {\n    if ([queryItem.name isEqualToString:param]) {\n      return queryItem.value;\n    }\n  }\n\n  return nil;\n}\n\nNSURL *__nullable RCTURLByReplacingQueryParam(NSURL *__nullable URL, NSString *param, NSString *__nullable value)\n{\n  RCTAssertParam(param);\n  if (!URL) {\n    return nil;\n  }\n\n  NSURLComponents *components = [NSURLComponents componentsWithURL:URL\n                                           resolvingAgainstBaseURL:YES];\n\n  __block NSInteger paramIndex = NSNotFound;\n  NSMutableArray<NSURLQueryItem *> *queryItems = [components.queryItems mutableCopy];\n  [queryItems enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:\n   ^(NSURLQueryItem *item, NSUInteger i, BOOL *stop) {\n     if ([item.name isEqualToString:param]) {\n       paramIndex = i;\n       *stop = YES;\n     }\n   }];\n\n  if (!value) {\n    if (paramIndex != NSNotFound) {\n      [queryItems removeObjectAtIndex:paramIndex];\n    }\n  } else {\n    NSURLQueryItem *newItem  = [NSURLQueryItem queryItemWithName:param\n                                                           value:value];\n    if (paramIndex == NSNotFound) {\n      [queryItems addObject:newItem];\n    } else {\n      [queryItems replaceObjectAtIndex:paramIndex withObject:newItem];\n    }\n  }\n  components.queryItems = queryItems;\n  return components.URL;\n}\n\nNSAlert *__nullable RCTAlertView(NSString *title,\n                                 NSString *__nullable message,\n                                 id __nullable delegate,\n                                 NSString *__nullable cancelButtonTitle,\n                                 NSArray<NSString *> *__nullable otherButtonTitles)\n{\n  if (RCTRunningInAppExtension()) {\n    RCTLogError(@\"RCTAlertView is unavailable when running in an app extension\");\n    return nil;\n  }\n  NSAlert *alertView = [[NSAlert alloc] init];\n  alertView.messageText = title;\n  alertView.informativeText = message;\n  alertView.delegate = delegate;\n  if (cancelButtonTitle != nil) {\n    [alertView addButtonWithTitle:cancelButtonTitle];\n  }\n  for (NSString *buttonTitle in otherButtonTitles) {\n    [alertView addButtonWithTitle:buttonTitle];\n  }\n  return alertView;\n}\n"
  },
  {
    "path": "React/Base/RCTVersion.h",
    "content": "/**\n * @generated by scripts/bump-oss-version.js\n *\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#define RCT_REACT_NATIVE_VERSION @{ \\\n  @\"major\": @(0), \\\n  @\"minor\": @(0), \\\n  @\"patch\": @(0), \\\n  @\"prerelease\": [NSNull null], \\\n}\n"
  },
  {
    "path": "React/Base/Surface/RCTSurface.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTSurfaceStage.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@class RCTBridge;\n@class RCTSurfaceView;\n@protocol RCTSurfaceDelegate;\n\n/**\n * RCTSurface instance represents React Native-powered piece of a user interface\n * which can be a full-screen app, separate modal view controller,\n * or even small widget.\n * It is called \"Surface\".\n *\n * The RCTSurface instance is completely thread-safe by design;\n * it can be created on any thread, and any its method can be called from\n * any thread (if the opposite is not mentioned explicitly).\n *\n * The primary goals of the RCTSurface are:\n *  * ability to measure and layout the surface in a thread-safe\n *    and synchronous manner;\n *  * ability to create a UIView instance on demand (later);\n *  * ability to communicate the current stage of the surface granularly.\n */\n@interface RCTSurface : NSObject\n\n@property (atomic, readonly) RCTSurfaceStage stage;\n@property (atomic, readonly) RCTBridge *bridge;\n@property (atomic, readonly) NSString *moduleName;\n@property (atomic, readonly) NSNumber *rootViewTag;\n\n@property (atomic, readwrite, weak, nullable) id<RCTSurfaceDelegate> delegate;\n\n@property (atomic, copy, readwrite) NSDictionary *properties;\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n                    moduleName:(NSString *)moduleName\n             initialProperties:(NSDictionary *)initialProperties NS_DESIGNATED_INITIALIZER;\n\n#pragma mark - Dealing with UIView representation, the Main thread only access\n\n/**\n * Creates (if needed) and returns `UIView` instance which represents the Surface.\n * The Surface will cache and *retain* this object.\n * Returning the UIView instance does not mean that the Surface is ready\n * to execute and layout. It can be just a handler which Surface will use later\n * to mount the actual views.\n * RCTSurface does not control (or influence in any way) the size or origin\n * of this view. Some superview (or another owner) must use other methods\n * of this class to setup proper layout and interop interactions with UIKit\n * or another UI framework.\n * This method must be called only from the main queue.\n */\n- (RCTSurfaceView *)view;\n\n#pragma mark - Layout: Setting the size constrains\n\n/**\n * Sets `minimumSize` and `maximumSize` layout constraints for the Surface.\n */\n- (void)setMinimumSize:(CGSize)minimumSize\n           maximumSize:(CGSize)maximumSize;\n\n/**\n * Previously set `minimumSize` layout constraint.\n * Defaults to `{0, 0}`.\n */\n@property (atomic, assign, readonly) CGSize minimumSize;\n\n/**\n * Previously set `maximumSize` layout constraint.\n * Defaults to `{CGFLOAT_MAX, CGFLOAT_MAX}`.\n */\n@property (atomic, assign, readonly) CGSize maximumSize;\n\n\n/**\n * Simple shortcut to `-[RCTSurface setMinimumSize:size maximumSize:size]`.\n */\n- (void)setSize:(CGSize)size;\n\n#pragma mark - Layout: Measuring\n\n/**\n * Measures the Surface with given constraints.\n * This method does not cause any side effects on the surface object.\n */\n- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize\n                      maximumSize:(CGSize)maximumSize;\n\n/**\n * Return the current size of the root view based on (but not clamp by) current\n * size constraints.\n */\n@property (atomic, assign, readonly) CGSize intrinsicSize;\n\n#pragma mark - Synchronous waiting\n\n/**\n * Synchronously blocks the current thread up to given `timeout` until\n * the Surface will not have given `stage`.\n * Do nothing, if called from the main or `UIManager` queue.\n */\n- (BOOL)synchronouslyWaitForStage:(RCTSurfaceStage)stage timeout:(NSTimeInterval)timeout;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Base/Surface/RCTSurface.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSurface.h\"\n#import \"RCTSurfaceView+Internal.h\"\n\n#import <mutex>\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge+Private.h\"\n#import \"RCTBridge.h\"\n#import \"RCTShadowView+Layout.h\"\n#import \"RCTSurfaceDelegate.h\"\n#import \"RCTSurfaceRootShadowView.h\"\n#import \"RCTSurfaceRootShadowViewDelegate.h\"\n#import \"RCTSurfaceRootView.h\"\n#import \"RCTSurfaceView.h\"\n#import \"RCTTouchHandler.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTUIManagerUtils.h\"\n\n@interface RCTSurface () <RCTSurfaceRootShadowViewDelegate>\n@end\n\n@implementation RCTSurface {\n  // Immutable\n  RCTBridge *_bridge;\n  NSString *_moduleName;\n  NSNumber *_rootViewTag;\n\n  // Protected by the `_mutex`\n  std::mutex _mutex;\n  RCTBridge *_batchedBridge;\n  RCTSurfaceStage _stage;\n  NSDictionary *_properties;\n  CGSize _minimumSize;\n  CGSize _maximumSize;\n  CGSize _intrinsicSize;\n\n  // The Main thread only\n  RCTSurfaceView *_Nullable _view;\n  RCTTouchHandler *_Nullable _touchHandler;\n\n  // Semaphores\n  dispatch_semaphore_t _rootShadowViewDidStartRenderingSemaphore;\n  dispatch_semaphore_t _rootShadowViewDidStartLayingOutSemaphore;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n                    moduleName:(NSString *)moduleName\n             initialProperties:(NSDictionary *)initialProperties\n{\n  RCTAssert(bridge.valid, @\"Valid bridge is required to instanciate `RCTSurface`.\");\n\n  if (self = [super init]) {\n    _bridge = bridge;\n    _batchedBridge = [_bridge batchedBridge] ?: _bridge;\n    _moduleName = moduleName;\n    _properties = [initialProperties copy];\n    _rootViewTag = RCTAllocateRootViewTag();\n    _rootShadowViewDidStartRenderingSemaphore = dispatch_semaphore_create(0);\n    _rootShadowViewDidStartLayingOutSemaphore = dispatch_semaphore_create(0);\n\n    _minimumSize = CGSizeZero;\n    _maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(handleBridgeWillLoadJavaScriptNotification:)\n                                                 name:RCTJavaScriptWillStartLoadingNotification\n                                               object:_bridge];\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(handleBridgeDidLoadJavaScriptNotification:)\n                                                 name:RCTJavaScriptDidLoadNotification\n                                               object:_bridge];\n\n    _stage = RCTSurfaceStageSurfaceDidInitialize;\n\n    if (!bridge.loading) {\n      _stage = _stage | RCTSurfaceStageBridgeDidLoad;\n    }\n\n    [self _registerRootView];\n    [self _run];\n  }\n\n  return self;\n}\n\n- (void)dealloc\n{\n  [self _stop];\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n#pragma mark - Immutable Properties (no need to enforce synchonization)\n\n- (RCTBridge *)bridge\n{\n  return _bridge;\n}\n\n- (NSString *)moduleName\n{\n  return _moduleName;\n}\n\n- (NSNumber *)rootViewTag\n{\n  return _rootViewTag;\n}\n\n#pragma mark - Convinience Internal Thread-Safe Properties\n\n- (RCTBridge *)_batchedBridge\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n  return _batchedBridge;\n}\n\n- (RCTUIManager *)_uiManager\n{\n  return self._batchedBridge.uiManager;\n}\n\n#pragma mark - Main-Threaded Routines\n\n- (RCTSurfaceView *)view\n{\n  RCTAssertMainQueue();\n\n  if (!_view) {\n    _view = [[RCTSurfaceView alloc] initWithSurface:self];\n\n    _touchHandler = [[RCTTouchHandler alloc] initWithBridge:self.bridge];\n    [_touchHandler attachToView:_view];\n\n    [self _mountRootViewIfNeeded];\n  }\n\n  return _view;\n}\n\n- (void)_mountRootViewIfNeeded\n{\n  RCTAssertMainQueue();\n\n  RCTSurfaceView *view = self->_view;\n  if (!view) {\n    return;\n  }\n\n  RCTSurfaceRootView *rootView =\n    (RCTSurfaceRootView *)[self._uiManager viewForReactTag:self->_rootViewTag];\n  if (!rootView) {\n    return;\n  }\n\n  RCTAssert([rootView isKindOfClass:[RCTSurfaceRootView class]],\n    @\"Received root view is not an instanse of `RCTSurfaceRootView`.\");\n\n  if (rootView.superview != view) {\n    view.rootView = rootView;\n  }\n}\n\n#pragma mark - Bridge Events\n\n- (void)handleBridgeWillLoadJavaScriptNotification:(NSNotification *)notification\n{\n  RCTAssertMainQueue();\n\n  [self _setStage:RCTSurfaceStageBridgeDidLoad];\n}\n\n- (void)handleBridgeDidLoadJavaScriptNotification:(NSNotification *)notification\n{\n  RCTAssertMainQueue();\n\n  [self _setStage:RCTSurfaceStageModuleDidLoad];\n\n  RCTBridge *bridge = notification.userInfo[@\"bridge\"];\n\n  BOOL isRerunNeeded = NO;\n\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n\n    if (bridge != _batchedBridge) {\n      _batchedBridge = bridge;\n      isRerunNeeded = YES;\n    }\n  }\n\n  if (isRerunNeeded) {\n    [self _run];\n  }\n}\n\n#pragma mark - Stage management\n\n- (RCTSurfaceStage)stage\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n  return _stage;\n}\n\n- (void)_setStage:(RCTSurfaceStage)stage\n{\n  RCTSurfaceStage updatedStage;\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n\n    if (_stage & stage) {\n      return;\n    }\n\n    updatedStage = (RCTSurfaceStage)(_stage | stage);\n    _stage = updatedStage;\n  }\n\n  [self _propagateStageChange:updatedStage];\n}\n\n- (void)_propagateStageChange:(RCTSurfaceStage)stage\n{\n  // Updating the `view`\n  RCTExecuteOnMainQueue(^{\n    self->_view.stage = stage;\n  });\n\n  // Notifying the `delegate`\n  id<RCTSurfaceDelegate> delegate = self.delegate;\n  if ([delegate respondsToSelector:@selector(surface:didChangeStage:)]) {\n    [delegate surface:self didChangeStage:stage];\n  }\n}\n\n#pragma mark - Properties Management\n\n- (NSDictionary *)properties\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n  return _properties;\n}\n\n- (void)setProperties:(NSDictionary *)properties\n{\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n\n    if ([properties isEqualToDictionary:_properties]) {\n      return;\n    }\n\n    _properties = [properties copy];\n  }\n\n  [self _run];\n}\n\n#pragma mark - Running\n\n- (void)_run\n{\n  RCTBridge *batchedBridge;\n  NSDictionary *properties;\n\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n\n    batchedBridge = _batchedBridge;\n    properties = _properties;\n  }\n\n  if (!batchedBridge.valid) {\n    return;\n  }\n\n  NSDictionary *applicationParameters =\n    @{\n      @\"rootTag\": _rootViewTag,\n      @\"initialProps\": properties,\n    };\n\n  RCTLogInfo(@\"Running surface %@ (%@)\", _moduleName, applicationParameters);\n\n  [batchedBridge enqueueJSCall:@\"AppRegistry\"\n                        method:@\"runApplication\"\n                          args:@[_moduleName, applicationParameters]\n                    completion:NULL];\n\n  [self _setStage:RCTSurfaceStageSurfaceDidRun];\n}\n\n- (void)_stop\n{\n  RCTBridge *batchedBridge = self._batchedBridge;\n  [batchedBridge enqueueJSCall:@\"AppRegistry\"\n                        method:@\"unmountApplicationComponentAtRootTag\"\n                          args:@[self->_rootViewTag]\n                    completion:NULL];\n}\n\n- (void)_registerRootView\n{\n  RCTBridge *batchedBridge;\n  CGSize minimumSize;\n  CGSize maximumSize;\n\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n    batchedBridge = _batchedBridge;\n    minimumSize = _minimumSize;\n    maximumSize = _maximumSize;\n  }\n\n  RCTUIManager *uiManager = batchedBridge.uiManager;\n\n  RCTExecuteOnUIManagerQueue(^{\n    [uiManager registerRootViewTag:self->_rootViewTag];\n\n    RCTSurfaceRootShadowView *rootShadowView =\n      (RCTSurfaceRootShadowView *)[uiManager shadowViewForReactTag:self->_rootViewTag];\n    RCTAssert([rootShadowView isKindOfClass:[RCTSurfaceRootShadowView class]],\n      @\"Received shadow view is not an instanse of `RCTSurfaceRootShadowView`.\");\n\n    [rootShadowView setMinimumSize:minimumSize\n                       maximumSize:maximumSize];\n    rootShadowView.delegate = self;\n  });\n}\n\n#pragma mark - Layout\n\n- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize\n                      maximumSize:(CGSize)maximumSize\n{\n  RCTUIManager *uiManager = self._uiManager;\n  __block CGSize fittingSize;\n\n  RCTUnsafeExecuteOnUIManagerQueueSync(^{\n    RCTSurfaceRootShadowView *rootShadowView =\n      (RCTSurfaceRootShadowView *)[uiManager shadowViewForReactTag:self->_rootViewTag];\n\n    RCTAssert([rootShadowView isKindOfClass:[RCTSurfaceRootShadowView class]],\n      @\"Received shadow view is not an instanse of `RCTSurfaceRootShadowView`.\");\n\n    fittingSize = [rootShadowView sizeThatFitsMinimumSize:minimumSize\n                                              maximumSize:maximumSize];\n  });\n\n  return fittingSize;\n}\n\n#pragma mark - Size Constraints\n\n- (void)setSize:(CGSize)size\n{\n  [self setMinimumSize:size maximumSize:size];\n}\n\n- (void)setMinimumSize:(CGSize)minimumSize\n           maximumSize:(CGSize)maximumSize\n{\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n    if (CGSizeEqualToSize(minimumSize, _minimumSize) &&\n        CGSizeEqualToSize(maximumSize, _maximumSize)) {\n      return;\n    }\n\n    _maximumSize = maximumSize;\n    _minimumSize = minimumSize;\n  }\n\n  RCTUIManager *uiManager = self._uiManager;\n\n  RCTUnsafeExecuteOnUIManagerQueueSync(^{\n    RCTSurfaceRootShadowView *rootShadowView =\n      (RCTSurfaceRootShadowView *)[uiManager shadowViewForReactTag:self->_rootViewTag];\n    RCTAssert([rootShadowView isKindOfClass:[RCTSurfaceRootShadowView class]],\n      @\"Received shadow view is not an instanse of `RCTSurfaceRootShadowView`.\");\n\n    [rootShadowView setMinimumSize:minimumSize maximumSize:maximumSize];\n    [uiManager setNeedsLayout];\n  });\n}\n\n- (CGSize)minimumSize\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n  return _minimumSize;\n}\n\n- (CGSize)maximumSize\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n  return _maximumSize;\n}\n\n#pragma mark - intrinsicSize\n\n- (void)setIntrinsicSize:(CGSize)intrinsicSize\n{\n  {\n    std::lock_guard<std::mutex> lock(_mutex);\n    if (CGSizeEqualToSize(intrinsicSize, _intrinsicSize)) {\n      return;\n    }\n\n    _intrinsicSize = intrinsicSize;\n  }\n\n  // Notifying `delegate`\n  id<RCTSurfaceDelegate> delegate = self.delegate;\n  if ([delegate respondsToSelector:@selector(surface:didChangeIntrinsicSize:)]) {\n    [delegate surface:self didChangeIntrinsicSize:intrinsicSize];\n  }\n}\n\n- (CGSize)intrinsicSize\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n  return _intrinsicSize;\n}\n\n#pragma mark - Synchronous Waiting\n\n- (BOOL)synchronouslyWaitForStage:(RCTSurfaceStage)stage timeout:(NSTimeInterval)timeout\n{\n  dispatch_semaphore_t semaphore;\n  switch (stage) {\n    case RCTSurfaceStageSurfaceDidInitialLayout:\n      semaphore = _rootShadowViewDidStartLayingOutSemaphore;\n      break;\n    case RCTSurfaceStageSurfaceDidInitialRendering:\n      semaphore = _rootShadowViewDidStartRenderingSemaphore;\n      break;\n    default:\n      RCTAssert(NO, @\"Only waiting for `RCTSurfaceStageSurfaceDidInitialRendering` and `RCTSurfaceStageSurfaceDidInitialLayout` stages is supported.\");\n  }\n\n  if (RCTIsMainQueue()) {\n    RCTLogInfo(@\"Synchronous waiting is not supported on the main queue.\");\n    return NO;\n  }\n\n  if (RCTIsUIManagerQueue()) {\n    RCTLogInfo(@\"Synchronous waiting is not supported on UIManager queue.\");\n    return NO;\n  }\n\n  BOOL timeoutOccured = dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, timeout * NSEC_PER_SEC));\n  if (!timeoutOccured) {\n    // Balancing the semaphore.\n    // Note: `dispatch_semaphore_wait` reverts the decrement in case when timeout occured.\n    dispatch_semaphore_signal(semaphore);\n  }\n\n  return !timeoutOccured;\n}\n\n#pragma mark - RCTSurfaceRootShadowViewDelegate\n\n- (void)rootShadowView:(RCTRootShadowView *)rootShadowView didChangeIntrinsicSize:(CGSize)intrinsicSize\n{\n  self.intrinsicSize = intrinsicSize;\n}\n\n- (void)rootShadowViewDidStartRendering:(RCTSurfaceRootShadowView *)rootShadowView\n{\n  [self _setStage:RCTSurfaceStageSurfaceDidInitialRendering];\n\n  dispatch_semaphore_signal(_rootShadowViewDidStartRenderingSemaphore);\n}\n\n- (void)rootShadowViewDidStartLayingOut:(RCTSurfaceRootShadowView *)rootShadowView\n{\n  [self _setStage:RCTSurfaceStageSurfaceDidInitialLayout];\n\n  dispatch_semaphore_signal(_rootShadowViewDidStartLayingOutSemaphore);\n\n  RCTExecuteOnMainQueue(^{\n    // Rendering is happening, let's mount `rootView` into `view` if we already didn't do this.\n    [self _mountRootViewIfNeeded];\n  });\n}\n\n@end\n"
  },
  {
    "path": "React/Base/Surface/RCTSurfaceDelegate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTSurfaceStage.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@class RCTSurface;\n\n@protocol RCTSurfaceDelegate <NSObject>\n\n@optional\n\n/**\n * Notifies a receiver that a surface transitioned to a new stage.\n * See `RCTSurfaceStage` for more details.\n */\n- (void)surface:(RCTSurface *)surface didChangeStage:(RCTSurfaceStage)stage;\n\n/**\n * Notifies a receiver that root view got a new (intrinsic) size during the last\n * layout pass.\n */\n- (void)surface:(RCTSurface *)surface didChangeIntrinsicSize:(CGSize)intrinsicSize;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Base/Surface/RCTSurfaceRootShadowView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTShadowView.h>\n#import <React/RCTSurfaceRootShadowViewDelegate.h>\n#import <yoga/YGEnums.h>\n\n@interface RCTSurfaceRootShadowView : RCTShadowView\n\n@property (nonatomic, assign, readonly) CGSize minimumSize;\n@property (nonatomic, assign, readonly) CGSize maximumSize;\n\n- (void)setMinimumSize:(CGSize)size maximumSize:(CGSize)maximumSize;\n\n@property (nonatomic, assign, readonly) CGSize intrinsicSize;\n\n@property (nonatomic, weak) id<RCTSurfaceRootShadowViewDelegate> delegate;\n\n/**\n * Layout direction (LTR or RTL) inherited from native environment and\n * is using as a base direction value in layout engine.\n * Defaults to value inferred from current locale.\n */\n@property (nonatomic, assign) YGDirection baseDirection;\n\n/**\n * Calculate all views whose frame needs updating after layout has been calculated.\n * Returns a set contains the shadowviews that need updating.\n */\n- (NSSet<RCTShadowView *> *)collectViewsWithUpdatedFrames;\n\n@end\n"
  },
  {
    "path": "React/Base/Surface/RCTSurfaceRootShadowView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSurfaceRootShadowView.h\"\n\n#import \"RCTI18nUtil.h\"\n#import \"RCTShadowView+Layout.h\"\n#import \"RCTUIManagerUtils.h\"\n\n@implementation RCTSurfaceRootShadowView {\n  CGSize _intrinsicSize;\n  BOOL _isRendered;\n  BOOL _isLaidOut;\n}\n\n- (instancetype)init\n{\n  if (self = [super init]) {\n    self.viewName = @\"RCTSurfaceRootView\";\n    _baseDirection = [[RCTI18nUtil sharedInstance] isRTL] ? YGDirectionRTL : YGDirectionLTR;\n    _minimumSize = CGSizeZero;\n    _maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);\n\n    self.alignSelf = YGAlignStretch;\n    self.flex = 1;\n  }\n\n  return self;\n}\n\n- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex\n{\n  [super insertReactSubview:subview atIndex:atIndex];\n  if (!_isRendered) {\n    [_delegate rootShadowViewDidStartRendering:self];\n    _isRendered = YES;\n  }\n}\n\n- (void)calculateLayoutWithMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximimSize\n{\n  YGNodeRef yogaNode = self.yogaNode;\n\n  YGNodeStyleSetMinWidth(yogaNode, RCTYogaFloatFromCoreGraphicsFloat(maximimSize.width));\n  YGNodeStyleSetMinHeight(yogaNode, RCTYogaFloatFromCoreGraphicsFloat(maximimSize.height));\n\n  YGNodeCalculateLayout(\n    self.yogaNode,\n    RCTYogaFloatFromCoreGraphicsFloat(maximimSize.width),\n    RCTYogaFloatFromCoreGraphicsFloat(maximimSize.height),\n    _baseDirection\n  );\n}\n\n- (NSSet<RCTShadowView *> *)collectViewsWithUpdatedFrames\n{\n  [self calculateLayoutWithMinimumSize:_minimumSize\n                           maximumSize:_maximumSize];\n\n  NSMutableSet<RCTShadowView *> *viewsWithNewFrame = [NSMutableSet set];\n  [self applyLayoutNode:self.yogaNode viewsWithNewFrame:viewsWithNewFrame absolutePosition:CGPointZero];\n\n  self.intrinsicSize = self.frame.size;\n\n  if (_isRendered && !_isLaidOut) {\n    [_delegate rootShadowViewDidStartLayingOut:self];\n    _isLaidOut = YES;\n  }\n\n  return viewsWithNewFrame;\n}\n\n- (void)setMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize\n{\n  if (CGSizeEqualToSize(minimumSize, _minimumSize) &&\n      CGSizeEqualToSize(maximumSize, _maximumSize)) {\n    return;\n  }\n\n  _maximumSize = maximumSize;\n  _minimumSize = minimumSize;\n}\n\n- (void)setIntrinsicSize:(CGSize)intrinsicSize\n{\n  if (CGSizeEqualToSize(_intrinsicSize, intrinsicSize)) {\n    return;\n  }\n\n  _intrinsicSize = intrinsicSize;\n\n  [_delegate rootShadowView:self didChangeIntrinsicSize:intrinsicSize];\n}\n\n- (CGSize)intrinsicSize\n{\n  return _intrinsicSize;\n}\n\n@end\n"
  },
  {
    "path": "React/Base/Surface/RCTSurfaceRootShadowViewDelegate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@class RCTSurfaceRootShadowView;\n\n@protocol RCTSurfaceRootShadowViewDelegate <NSObject>\n\n- (void)rootShadowView:(RCTSurfaceRootShadowView *)rootShadowView didChangeIntrinsicSize:(CGSize)instrinsicSize;\n- (void)rootShadowViewDidStartRendering:(RCTSurfaceRootShadowView *)rootShadowView;\n- (void)rootShadowViewDidStartLayingOut:(RCTSurfaceRootShadowView *)rootShadowView;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Base/Surface/RCTSurfaceRootView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTView.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n/**\n * Internal class represents Surface's root view.\n */\n@interface RCTSurfaceRootView : RCTView\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Base/Surface/RCTSurfaceRootView.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSurfaceRootView.h\"\n\n#import \"RCTDefines.h\"\n\n@implementation RCTSurfaceRootView\n\nRCT_NOT_IMPLEMENTED(- (nullable instancetype)initWithCoder:(NSCoder *)coder)\n\n@end\n"
  },
  {
    "path": "React/Base/Surface/RCTSurfaceStage.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTDefines.h>\n\n/**\n * The stage of the Surface\n */\ntypedef NS_OPTIONS(NSInteger, RCTSurfaceStage) {\n  RCTSurfaceStageSurfaceDidInitialize = 1 << 0,        // Surface object was created\n  RCTSurfaceStageBridgeDidLoad = 1 << 1,               // Bridge was loaded\n  RCTSurfaceStageModuleDidLoad = 1 << 2,               // Module (JavaScript code) was loaded\n  RCTSurfaceStageSurfaceDidRun = 1 << 3,               // Module (JavaScript code) was run\n  RCTSurfaceStageSurfaceDidInitialRendering = 1 << 4,  // UIManager created the first shadow views\n  RCTSurfaceStageSurfaceDidInitialLayout = 1 << 5,     // UIManager completed the first layout pass\n  RCTSurfaceStageSurfaceDidInitialMounting = 1 << 6,   // UIManager completed the first mounting pass\n  RCTSurfaceStageSurfaceDidStop = 1 << 7,              // Surface stopped\n};\n\n/**\n * Returns `YES` if the stage is suitable for displaying normal React Native app.\n */\nRCT_EXTERN BOOL RCTSurfaceStageIsRunning(RCTSurfaceStage stage);\n\n/**\n * Returns `YES` if the stage is suitable for displaying activity indicator.\n */\nRCT_EXTERN BOOL RCTSurfaceStageIsPreparing(RCTSurfaceStage stage);\n"
  },
  {
    "path": "React/Base/Surface/RCTSurfaceStage.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSurfaceStage.h\"\n\nBOOL RCTSurfaceStageIsRunning(RCTSurfaceStage stage) {\n  return\n    (stage & RCTSurfaceStageSurfaceDidInitialLayout) &&\n    !(stage & RCTSurfaceStageSurfaceDidStop);\n}\n\nBOOL RCTSurfaceStageIsPreparing(RCTSurfaceStage stage) {\n  return\n    !(stage & RCTSurfaceStageSurfaceDidInitialLayout) &&\n    !(stage & RCTSurfaceStageSurfaceDidStop);\n}\n"
  },
  {
    "path": "React/Base/Surface/RCTSurfaceView+Internal.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTSurfaceStage.h>\n#import <React/RCTSurfaceView.h>\n\n@class RCTSurfaceRootView;\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTSurfaceView (Internal)\n\n@property (nonatomic, strong) RCTSurfaceRootView *rootView;\n@property (nonatomic, assign) RCTSurfaceStage stage;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Base/Surface/RCTSurfaceView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@class RCTSurface;\n\n/**\n * UIView instance which represents the Surface\n */\n@interface RCTSurfaceView : NSView\n\n- (instancetype)initWithSurface:(RCTSurface *)surface NS_DESIGNATED_INITIALIZER;\n\n@property (nonatomic, weak, readonly, nullable) RCTSurface *surface;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Base/Surface/RCTSurfaceView.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSurfaceView.h\"\n#import \"RCTSurfaceView+Internal.h\"\n\n#import \"RCTDefines.h\"\n#import \"RCTSurface.h\"\n#import \"RCTSurfaceRootView.h\"\n\n@implementation RCTSurfaceView {\n  RCTSurfaceRootView *_Nullable _rootView;\n  RCTSurfaceStage _stage;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (nullable instancetype)initWithCoder:(NSCoder *)coder)\n\n- (instancetype)initWithSurface:(RCTSurface *)surface\n{\n  if (self = [super initWithFrame:CGRectZero]) {\n    _stage = surface.stage;\n    _surface = surface;\n  }\n\n  return self;\n}\n\n#pragma mark - Internal Interface\n\n- (void)setRootView:(RCTSurfaceRootView *)rootView\n{\n  if (_rootView == rootView) {\n    return;\n  }\n\n  [_rootView removeFromSuperview];\n  _rootView = rootView;\n  [self _updateStage];\n}\n\n- (RCTSurfaceRootView *)rootView\n{\n  return _rootView;\n}\n\n#pragma mark - stage\n\n- (void)setStage:(RCTSurfaceStage)stage\n{\n  if (stage == _stage) {\n    return;\n  }\n\n  _stage = stage;\n\n  [self _updateStage];\n}\n\n- (RCTSurfaceStage)stage\n{\n  return _stage;\n}\n\n#pragma mark - Private\n\n- (void)_updateStage\n{\n  if (RCTSurfaceStageIsRunning(_stage)) {\n    if (_rootView.superview != self) {\n      [self addSubview:_rootView];\n    }\n  }\n  else {\n    [_rootView removeFromSuperview];\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTSurfaceSizeMeasureMode.h>\n#import <React/RCTSurfaceStage.h>\n\n@class RCTBridge;\n@class RCTSurface;\n\ntypedef NSView *(^RCTSurfaceHostingViewActivityIndicatorViewFactory)();\n\nNS_ASSUME_NONNULL_BEGIN\n\n/**\n * UIView subclass which providers interoperability between UIKit and\n * Surface regarding layout and life-cycle.\n * This class can be used as easy-to-use general purpose integration point\n * of ReactNative-powered experiences in UIKit based apps.\n */\n@interface RCTSurfaceHostingView : NSView\n\n/**\n * Designated initializer.\n * Instanciates a view with given Surface object.\n * Note: The view retains the surface object.\n */\n- (instancetype)initWithSurface:(RCTSurface *)surface NS_DESIGNATED_INITIALIZER;\n\n/**\n * Convenience initializer.\n * Instanciates a Surface object with given `bridge`, `moduleName`, and\n * `initialProperties`, and then use it to instanciate a view.\n */\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n                    moduleName:(NSString *)moduleName\n             initialProperties:(NSDictionary *)initialProperties;\n\n/**\n * Surface object which is currently using to power the view.\n * Read-only.\n */\n@property (nonatomic, strong, readonly) RCTSurface *surface;\n\n/**\n * Size measure mode which are defining relationship between UIKit and ReactNative\n * layout approaches.\n * Defaults to `RCTSurfaceSizeMeasureModeWidthAtMost | RCTSurfaceSizeMeasureModeHeightAtMost`.\n */\n@property (nonatomic, assign) RCTSurfaceSizeMeasureMode sizeMeasureMode;\n\n/**\n * Activity indicator factory.\n * A hosting view may use this block to instantiate and display custom activity\n * (loading) indicator (aka \"spinner\") when it needed.\n * Defaults to `nil` (no activity indicator).\n */\n@property (nonatomic, copy, nullable) RCTSurfaceHostingViewActivityIndicatorViewFactory activityIndicatorViewFactory;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSurfaceHostingView.h\"\n\n#import \"RCTDefines.h\"\n#import \"RCTSurface.h\"\n#import \"RCTSurfaceDelegate.h\"\n#import \"RCTSurfaceView.h\"\n#import \"RCTUtils.h\"\n\n@interface RCTSurfaceHostingView () <RCTSurfaceDelegate>\n\n@property (nonatomic, assign) BOOL isActivityIndicatorViewVisible;\n@property (nonatomic, assign) BOOL isSurfaceViewVisible;\n\n@end\n\n@implementation RCTSurfaceHostingView {\n  NSView *_Nullable _activityIndicatorView;\n  NSView *_Nullable _surfaceView;\n  RCTSurfaceStage _stage;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (nullable instancetype)initWithCoder:(NSCoder *)coder)\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n                    moduleName:(NSString *)moduleName\n             initialProperties:(NSDictionary *)initialProperties\n{\n  RCTSurface *surface =\n    [[RCTSurface alloc] initWithBridge:bridge\n                            moduleName:moduleName\n                     initialProperties:initialProperties];\n\n  return [self initWithSurface:surface];\n}\n\n- (instancetype)initWithSurface:(RCTSurface *)surface\n{\n  if (self = [super initWithFrame:CGRectZero]) {\n    _surface = surface;\n\n    _sizeMeasureMode =\n      RCTSurfaceSizeMeasureModeWidthAtMost |\n      RCTSurfaceSizeMeasureModeHeightAtMost;\n\n    _surface.delegate = self;\n    _stage = surface.stage;\n    [self _updateViews];\n  }\n\n  return self;\n}\n\n- (CGSize)intrinsicContentSize\n{\n  if (RCTSurfaceStageIsPreparing(_stage)) {\n    if (_activityIndicatorView) {\n      return _activityIndicatorView.intrinsicContentSize;\n    }\n\n    return CGSizeZero;\n  }\n\n  return _surface.intrinsicSize;\n}\n\n- (CGSize)sizeThatFits:(CGSize)size\n{\n  if (RCTSurfaceStageIsPreparing(_stage)) {\n    if (_activityIndicatorView) {\n     \n      return _activityIndicatorView.fittingSize;\n    }\n\n    return CGSizeZero;\n  }\n\n  CGSize minimumSize = CGSizeZero;\n  CGSize maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);\n\n  if (_sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) {\n    minimumSize.width = size.width;\n    maximumSize.width = size.width;\n  }\n  else if (_sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) {\n    maximumSize.width = size.width;\n  }\n\n  if (_sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) {\n    minimumSize.height = size.height;\n    maximumSize.height = size.height;\n  }\n  else if (_sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) {\n    maximumSize.height = size.height;\n  }\n\n  return [_surface sizeThatFitsMinimumSize:minimumSize\n                               maximumSize:maximumSize];\n}\n\n- (void)setStage:(RCTSurfaceStage)stage\n{\n  if (stage == _stage) {\n    return;\n  }\n\n  BOOL shouldInvalidateLayout =\n    RCTSurfaceStageIsRunning(stage) != RCTSurfaceStageIsRunning(_stage) ||\n    RCTSurfaceStageIsPreparing(stage) != RCTSurfaceStageIsPreparing(_stage);\n\n  _stage = stage;\n\n  if (shouldInvalidateLayout) {\n    [self _invalidateLayout];\n    [self _updateViews];\n  }\n}\n\n- (void)setSizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode\n{\n  if (sizeMeasureMode == _sizeMeasureMode) {\n    return;\n  }\n\n  _sizeMeasureMode = sizeMeasureMode;\n  [self _invalidateLayout];\n}\n\n#pragma mark - isActivityIndicatorViewVisible\n\n- (void)setIsActivityIndicatorViewVisible:(BOOL)visible\n{\n  if (_isActivityIndicatorViewVisible == visible) {\n    return;\n  }\n\n  if (visible) {\n    if (_activityIndicatorViewFactory) {\n      _activityIndicatorView = _activityIndicatorViewFactory();\n      _activityIndicatorView.frame = self.bounds;\n      _activityIndicatorView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;\n      [self addSubview:_activityIndicatorView];\n    }\n  } else {\n    [_activityIndicatorView removeFromSuperview];\n    _activityIndicatorView = nil;\n  }\n}\n\n#pragma mark - isSurfaceViewVisible\n\n- (void)setIsSurfaceViewVisible:(BOOL)visible\n{\n  if (_isSurfaceViewVisible == visible) {\n    return;\n  }\n\n  if (visible) {\n    _surfaceView = _surface.view;\n    _surfaceView.frame = self.bounds;\n    _surfaceView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;\n    [self addSubview:_surfaceView];\n  } else {\n    [_surfaceView removeFromSuperview];\n    _surfaceView = nil;\n  }\n}\n\n#pragma mark - activityIndicatorViewFactory\n\n- (void)setActivityIndicatorViewFactory:(RCTSurfaceHostingViewActivityIndicatorViewFactory)activityIndicatorViewFactory\n{\n  _activityIndicatorViewFactory = activityIndicatorViewFactory;\n  if (_isActivityIndicatorViewVisible) {\n    _isActivityIndicatorViewVisible = NO;\n    self.isActivityIndicatorViewVisible = YES;\n  }\n}\n\n#pragma mark - Private stuff\n\n- (void)_invalidateLayout\n{\n  [self.superview setNeedsLayout:YES];\n}\n\n- (void)_updateViews\n{\n  self.isSurfaceViewVisible = RCTSurfaceStageIsRunning(_stage);\n  self.isActivityIndicatorViewVisible = RCTSurfaceStageIsPreparing(_stage);\n}\n\n- (void)viewDidMoveToWindow\n{\n  [super viewDidMoveToWindow];\n  [self _updateViews];\n}\n\n#pragma mark - RCTSurfaceDelegate\n\n- (void)surface:(RCTSurface *)surface didChangeStage:(RCTSurfaceStage)stage\n{\n  RCTExecuteOnMainQueue(^{\n    [self setStage:stage];\n  });\n}\n\n- (void)surface:(RCTSurface *)surface didChangeIntrinsicSize:(CGSize)intrinsicSize\n{\n  RCTExecuteOnMainQueue(^{\n    [self _invalidateLayout];\n  });\n}\n\n@end\n"
  },
  {
    "path": "React/Base/Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n/**\n * Bitmask defines how size constrains from `-[UIView sizeThatFits:]`\n * are translated to `-[RCTSurface sizeThatFitsMinimumSize:maximumSize:]`.\n */\ntypedef NS_OPTIONS(NSInteger, RCTSurfaceSizeMeasureMode) {\n  RCTSurfaceSizeMeasureModeWidthUndefined    = 0 << 0,\n  RCTSurfaceSizeMeasureModeWidthExact        = 1 << 0,\n  RCTSurfaceSizeMeasureModeWidthAtMost       = 2 << 0,\n  RCTSurfaceSizeMeasureModeHeightUndefined   = 0 << 2,\n  RCTSurfaceSizeMeasureModeHeightExact       = 1 << 2,\n  RCTSurfaceSizeMeasureModeHeightAtMost      = 2 << 2,\n};\n"
  },
  {
    "path": "React/Base/UIImageUtils.h",
    "content": "//\n//  UIImageUtils.h\n//  RCTTest\n//\n//  Copyright © 2015 Facebook. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import <AppKit/AppKit.h>\n\n\ntypedef NS_ENUM(NSInteger, UIViewContentMode) {\n  UIViewContentModeScaleToFill,\n  UIViewContentModeScaleAspectFit,\n  UIViewContentModeScaleAspectFill,\n  UIViewContentModeRedraw,\n  UIViewContentModeCenter,\n  UIViewContentModeTop,\n  UIViewContentModeBottom,\n  UIViewContentModeLeft,\n  UIViewContentModeRight,\n  UIViewContentModeTopLeft,\n  UIViewContentModeTopRight,\n  UIViewContentModeBottomLeft,\n  UIViewContentModeBottomRight,\n};\n\n\nNSData *UIImagePNGRepresentation(NSImage *image);\nNSData *UIImageJPEGRepresentation(NSImage *image, float quality);\n\nvoid UIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale);\n\nvoid UIGraphicsPushContext(CGContextRef ctx);\nvoid UIGraphicsPopContext();\n\nCGContextRef UIGraphicsGetCurrentContext();\n\nNSImage *UIGraphicsGetImageFromCurrentImageContext();\n\nvoid UIGraphicsEndImageContext();\n\nCGImageRef RCTGetCGImageRef(NSImage *image);\n"
  },
  {
    "path": "React/Base/UIImageUtils.m",
    "content": "//\n//  UIImageUtils.m\n//  RCTTest\n//\n//  Copyright © 2015 Facebook. All rights reserved.\n//\n\n#import \"UIImageUtils.h\"\n#import <Foundation/Foundation.h>\n#import <AppKit/AppKit.h>\n\nNSData *UIImagePNGRepresentation(NSImage *image)\n{\n  CGImageSourceRef source = CGImageSourceCreateWithData((CFDataRef)[image TIFFRepresentation], NULL);\n  CGImageRef maskRef =  CGImageSourceCreateImageAtIndex(source, 0, NULL);\n\n  NSBitmapImageRep *newRep = [[NSBitmapImageRep alloc] initWithCGImage:maskRef];\n\n  NSData *pngData = [newRep representationUsingType:NSPNGFileType properties:[NSDictionary dictionaryWithObjectsAndKeys:\n                                                                              [NSNumber numberWithBool:YES], NSImageProgressive, nil]];\n  return pngData;\n}\n\nNSData *UIImageJPEGRepresentation(NSImage *image, float quality)\n{\n  CGImageSourceRef source = CGImageSourceCreateWithData((CFDataRef)[image TIFFRepresentation], NULL);\n  CGImageRef maskRef =  CGImageSourceCreateImageAtIndex(source, 0, NULL);\n\n  NSBitmapImageRep *newRep = [[NSBitmapImageRep alloc] initWithCGImage:maskRef];\n\n  NSNumber *compressionFactor = [NSNumber numberWithFloat:quality];\n  NSDictionary *imageProps = [NSDictionary dictionaryWithObject:compressionFactor\n                                                         forKey:NSImageCompressionFactor];\n\n  NSData *jpgData = [newRep representationUsingType:NSJPEGFileType properties:imageProps];\n  return jpgData;\n}\n\n\n\nstatic NSMutableArray *contextStack = nil;\nstatic NSMutableArray *imageContextStack = nil;\n\n\nvoid UIGraphicsPushContext(CGContextRef ctx)\n{\n  if (!contextStack) {\n    contextStack = [[NSMutableArray alloc] initWithCapacity:1];\n  }\n\n  if ([NSGraphicsContext currentContext]) {\n    [contextStack addObject:[NSGraphicsContext currentContext]];\n  }\n\n  [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:(void *)ctx flipped:YES]];\n}\n\nvoid UIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale)\n{\n  if (scale == 0.f) {\n    scale = [NSScreen mainScreen].backingScaleFactor ?: 1;\n  }\n\n  const size_t width = size.width * scale;\n  const size_t height = size.height * scale;\n\n  if (width > 0 && height > 0) {\n    if (!imageContextStack) {\n      imageContextStack = [[NSMutableArray alloc] initWithCapacity:1];\n    }\n\n    [imageContextStack addObject:[NSNumber numberWithFloat:scale]];\n\n    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();\n    CGContextRef ctx = CGBitmapContextCreate(NULL, width, height, 8, 4*width, colorSpace, (opaque? kCGImageAlphaNoneSkipFirst : kCGImageAlphaPremultipliedFirst));\n    CGContextConcatCTM(ctx, CGAffineTransformMake(1, 0, 0, -1, 0, height));\n    CGContextScaleCTM(ctx, scale, scale);\n    CGColorSpaceRelease(colorSpace);\n    UIGraphicsPushContext(ctx);\n    CGContextRelease(ctx);\n  }\n}\n\n\nCGContextRef UIGraphicsGetCurrentContext()\n{\n  return [[NSGraphicsContext currentContext] graphicsPort];\n}\n\nNSImage *UIGraphicsGetImageFromCurrentImageContext()\n{\n  if ([imageContextStack lastObject]) {\n    CGImageRef theCGImage = CGBitmapContextCreateImage(UIGraphicsGetCurrentContext());\n    NSImage *image = [[NSImage alloc]\n                      initWithCGImage:theCGImage\n                      size:NSSizeFromCGSize(CGSizeMake(CGImageGetWidth(theCGImage), CGImageGetHeight(theCGImage) ))];\n    CGImageRelease(theCGImage);\n    return image;\n  } else {\n    return nil;\n  }\n}\n\nvoid UIGraphicsPopContext()\n{\n  if ([contextStack lastObject]) {\n    [NSGraphicsContext setCurrentContext:[contextStack lastObject]];\n    [contextStack removeLastObject];\n  }\n}\n\n\nvoid UIGraphicsEndImageContext()\n{\n  if ([imageContextStack lastObject]) {\n    [imageContextStack removeLastObject];\n    UIGraphicsPopContext();\n  }\n}\n\nCGImageRef RCTGetCGImageRef(NSImage *image)\n{\n  return [image CGImageForProposedRect:nil context:nil hints:nil];\n}\n\n"
  },
  {
    "path": "React/CxxBridge/NSDataBigString.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n#import <Foundation/Foundation.h>\n\n#include <cxxreact/JSBigString.h>\n\nnamespace facebook {\nnamespace react {\n\nclass NSDataBigString : public JSBigString {\npublic:\n  // The NSData passed in must be be null-terminated.\n  NSDataBigString(NSData *data);\n\n  // The ASCII optimization is not enabled on iOS\n  bool isAscii() const override {\n    return false;\n  }\n\n  const char *c_str() const override {\n    return (const char *)[m_data bytes];\n  }\n\n  size_t size() const override {\n    return m_length;\n  }\n\nprivate:\n  NSData *m_data;\n  size_t m_length;\n};\n\n} }\n"
  },
  {
    "path": "React/CxxBridge/NSDataBigString.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n#import \"NSDataBigString.h\"\n\nnamespace facebook {\nnamespace react {\n\nstatic NSData *ensureNullTerminated(NSData *source)\n{\n  if (!source || source.length == 0) {\n    return nil;\n  }\n\n  NSUInteger sourceLength = source.length;\n  unsigned char lastByte;\n  [source getBytes:&lastByte range:NSMakeRange(sourceLength - 1, 1)];\n\n  // TODO: bundles from the packager should always include a NULL byte\n  // or we should we relax this requirement and only read as much from the\n  // buffer as length indicates\n  if (lastByte == '\\0') {\n    return source;\n  } else {\n    NSMutableData *data = [source mutableCopy];\n    unsigned char nullByte = '\\0';\n    [data appendBytes:&nullByte length:1];\n    return data;\n  }\n}\n\nNSDataBigString::NSDataBigString(NSData *data)\n{\n  m_length = [data length];\n  m_data = ensureNullTerminated(data);\n}\n\n} }\n"
  },
  {
    "path": "React/CxxBridge/RCTCxxBridge.mm",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <atomic>\n#include <future>\n\n#import <React/RCTAssert.h>\n#import <React/RCTBridge+Private.h>\n#import <React/RCTBridge.h>\n#import <React/RCTBridgeMethod.h>\n#import <React/RCTConvert.h>\n#import <React/RCTCxxBridgeDelegate.h>\n#import <React/RCTCxxModule.h>\n#import <React/RCTCxxUtils.h>\n#import <React/RCTDevSettings.h>\n#import <React/RCTDisplayLink.h>\n#import <React/RCTJavaScriptLoader.h>\n#import <React/RCTLog.h>\n#import <React/RCTModuleData.h>\n#import <React/RCTPerformanceLogger.h>\n#import <React/RCTProfile.h>\n#import <React/RCTRedBox.h>\n#import <React/RCTUtils.h>\n#import <React/RCTFollyConvert.h>\n#import <cxxreact/CxxNativeModule.h>\n#import <cxxreact/Instance.h>\n#import <cxxreact/JSBundleType.h>\n#import <cxxreact/JSCExecutor.h>\n#import <cxxreact/JSIndexedRAMBundle.h>\n#import <cxxreact/Platform.h>\n#import <cxxreact/RAMBundleRegistry.h>\n#import <jschelpers/Value.h>\n\n#import \"NSDataBigString.h\"\n#import \"RCTJSCHelpers.h\"\n#import \"RCTMessageThread.h\"\n#import \"RCTObjcExecutor.h\"\n\n#ifdef WITH_FBSYSTRACE\n#import <React/RCTFBSystrace.h>\n#endif\n\n#if RCT_DEV && __has_include(\"RCTDevLoadingView.h\")\n#import \"RCTDevLoadingView.h\"\n#endif\n\n@interface RCTCxxBridge : RCTBridge\n@end\n\n#define RCTAssertJSThread() \\\n  RCTAssert(self.executorClass || self->_jsThread == [NSThread currentThread], \\\n            @\"This method must be called on JS thread\")\n\nstatic NSString *const RCTJSThreadName = @\"com.facebook.react.JavaScript\";\n\ntypedef void (^RCTPendingCall)();\n\nusing namespace facebook::react;\n\n/**\n * Must be kept in sync with `MessageQueue.js`.\n */\ntypedef NS_ENUM(NSUInteger, RCTBridgeFields) {\n  RCTBridgeFieldRequestModuleIDs = 0,\n  RCTBridgeFieldMethodIDs,\n  RCTBridgeFieldParams,\n  RCTBridgeFieldCallID,\n};\n\nnamespace {\n\nclass GetDescAdapter : public JSExecutorFactory {\npublic:\n  GetDescAdapter(RCTCxxBridge *bridge, std::shared_ptr<JSExecutorFactory> factory)\n    : bridge_(bridge)\n    , factory_(factory) {}\n  std::unique_ptr<JSExecutor> createJSExecutor(\n      std::shared_ptr<ExecutorDelegate> delegate,\n      std::shared_ptr<MessageQueueThread> jsQueue) override {\n    auto ret = factory_->createJSExecutor(delegate, jsQueue);\n    bridge_.bridgeDescription =\n      [NSString stringWithFormat:@\"RCTCxxBridge %s\",\n                ret->getDescription().c_str()];\n    return std::move(ret);\n  }\n\nprivate:\n  RCTCxxBridge *bridge_;\n  std::shared_ptr<JSExecutorFactory> factory_;\n};\n\n}\n\nstatic bool isRAMBundle(NSData *script) {\n  BundleHeader header;\n  [script getBytes:&header length:sizeof(header)];\n  return parseTypeFromHeader(header) == ScriptTag::RAMBundle;\n}\n\nstatic void registerPerformanceLoggerHooks(RCTPerformanceLogger *performanceLogger) {\n  __weak RCTPerformanceLogger *weakPerformanceLogger = performanceLogger;\n  ReactMarker::logTaggedMarker = [weakPerformanceLogger](const ReactMarker::ReactMarkerId markerId, const char *tag) {\n    switch (markerId) {\n      case ReactMarker::RUN_JS_BUNDLE_START:\n        [weakPerformanceLogger markStartForTag:RCTPLScriptExecution];\n        break;\n      case ReactMarker::RUN_JS_BUNDLE_STOP:\n        [weakPerformanceLogger markStopForTag:RCTPLScriptExecution];\n        break;\n      case ReactMarker::NATIVE_REQUIRE_START:\n        [weakPerformanceLogger appendStartForTag:RCTPLRAMNativeRequires];\n        break;\n      case ReactMarker::NATIVE_REQUIRE_STOP:\n        [weakPerformanceLogger appendStopForTag:RCTPLRAMNativeRequires];\n        [weakPerformanceLogger addValue:1 forTag:RCTPLRAMNativeRequiresCount];\n        break;\n      case ReactMarker::CREATE_REACT_CONTEXT_STOP:\n      case ReactMarker::JS_BUNDLE_STRING_CONVERT_START:\n      case ReactMarker::JS_BUNDLE_STRING_CONVERT_STOP:\n      case ReactMarker::NATIVE_MODULE_SETUP_START:\n      case ReactMarker::NATIVE_MODULE_SETUP_STOP:\n        // These are not used on iOS.\n        break;\n    }\n  };\n}\n\n@interface RCTCxxBridge ()\n\n@property (nonatomic, weak, readonly) RCTBridge *parentBridge;\n@property (nonatomic, assign, readonly) BOOL moduleSetupComplete;\n\n- (instancetype)initWithParentBridge:(RCTBridge *)bridge;\n- (void)partialBatchDidFlush;\n- (void)batchDidComplete;\n\n@end\n\nstruct RCTInstanceCallback : public InstanceCallback {\n  __weak RCTCxxBridge *bridge_;\n  RCTInstanceCallback(RCTCxxBridge *bridge): bridge_(bridge) {};\n  void onBatchComplete() override {\n    // There's no interface to call this per partial batch\n    [bridge_ partialBatchDidFlush];\n    [bridge_ batchDidComplete];\n  }\n};\n\n@implementation RCTCxxBridge\n{\n  BOOL _wasBatchActive;\n  BOOL _didInvalidate;\n\n  NSMutableArray<RCTPendingCall> *_pendingCalls;\n  std::atomic<NSInteger> _pendingCount;\n\n  // Native modules\n  NSMutableDictionary<NSString *, RCTModuleData *> *_moduleDataByName;\n  NSMutableArray<RCTModuleData *> *_moduleDataByID;\n  NSMutableArray<Class> *_moduleClassesByID;\n  NSUInteger _modulesInitializedOnMainQueue;\n  RCTDisplayLink *_displayLink;\n\n  // JS thread management\n  NSThread *_jsThread;\n  std::shared_ptr<RCTMessageThread> _jsMessageThread;\n\n  // This is uniquely owned, but weak_ptr is used.\n  std::shared_ptr<Instance> _reactInstance;\n}\n\n@synthesize bridgeDescription = _bridgeDescription;\n@synthesize loading = _loading;\n@synthesize performanceLogger = _performanceLogger;\n@synthesize valid = _valid;\n\n+ (void)initialize\n{\n  if (self == [RCTCxxBridge class]) {\n    RCTPrepareJSCExecutor();\n  }\n}\n\n- (JSGlobalContextRef)jsContextRef\n{\n  return (JSGlobalContextRef)(self->_reactInstance ? self->_reactInstance->getJavaScriptContext() : nullptr);\n}\n\n- (BOOL)isInspectable {\n  return self->_reactInstance->isInspectable();\n}\n\n- (instancetype)initWithParentBridge:(RCTBridge *)bridge\n{\n  RCTAssertParam(bridge);\n\n  if ((self = [super initWithDelegate:bridge.delegate\n                            bundleURL:bridge.bundleURL\n                       moduleProvider:bridge.moduleProvider\n                        launchOptions:bridge.launchOptions])) {\n    _parentBridge = bridge;\n    _performanceLogger = [bridge performanceLogger];\n\n    registerPerformanceLoggerHooks(_performanceLogger);\n\n    RCTLogInfo(@\"Initializing %@ (parent: %@, executor: %@)\", self, bridge, [self executorClass]);\n\n    /**\n     * Set Initial State\n     */\n    _valid = YES;\n    _loading = YES;\n    _pendingCalls = [NSMutableArray new];\n    _displayLink = [RCTDisplayLink new];\n\n    _moduleDataByName = [NSMutableDictionary new];\n    _moduleClassesByID = [NSMutableArray new];\n    _moduleDataByID = [NSMutableArray new];\n\n    [RCTBridge setCurrentBridge:self];\n  }\n  return self;\n}\n\n+ (void)runRunLoop\n{\n  @autoreleasepool {\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"-[RCTCxxBridge runJSRunLoop] setup\", nil);\n\n    // copy thread name to pthread name\n    pthread_setname_np([NSThread currentThread].name.UTF8String);\n\n    // Set up a dummy runloop source to avoid spinning\n    CFRunLoopSourceContext noSpinCtx = {0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};\n    CFRunLoopSourceRef noSpinSource = CFRunLoopSourceCreate(NULL, 0, &noSpinCtx);\n    CFRunLoopAddSource(CFRunLoopGetCurrent(), noSpinSource, kCFRunLoopDefaultMode);\n    CFRelease(noSpinSource);\n\n    RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n    // run the run loop\n    while (kCFRunLoopRunStopped != CFRunLoopRunInMode(kCFRunLoopDefaultMode, ((NSDate *)[NSDate distantFuture]).timeIntervalSinceReferenceDate, NO)) {\n      RCTAssert(NO, @\"not reached assertion\"); // runloop spun. that's bad.\n    }\n  }\n}\n\n- (void)_tryAndHandleError:(dispatch_block_t)block\n{\n  NSError *error = tryAndReturnError(block);\n  if (error) {\n    [self handleError:error];\n  }\n}\n\n/**\n * Ensure block is run on the JS thread. If we're already on the JS thread, the block will execute synchronously.\n * If we're not on the JS thread, the block is dispatched to that thread. Any errors encountered while executing\n * the block will go through handleError:\n */\n- (void)ensureOnJavaScriptThread:(dispatch_block_t)block\n{\n  RCTAssert(_jsThread, @\"This method must not be called before the JS thread is created\");\n\n  // This does not use _jsMessageThread because it may be called early before the runloop reference is captured\n  // and _jsMessageThread is valid. _jsMessageThread also doesn't allow us to shortcut the dispatch if we're\n  // already on the correct thread.\n\n  if ([NSThread currentThread] == _jsThread) {\n    [self _tryAndHandleError:block];\n  } else {\n    [self performSelector:@selector(_tryAndHandleError:)\n          onThread:_jsThread\n          withObject:block\n          waitUntilDone:NO];\n  }\n}\n\n- (void)start\n{\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"-[RCTCxxBridge start]\", nil);\n\n  [[NSNotificationCenter defaultCenter]\n    postNotificationName:RCTJavaScriptWillStartLoadingNotification\n    object:_parentBridge userInfo:@{@\"bridge\": self}];\n\n  // Set up the JS thread early\n  _jsThread = [[NSThread alloc] initWithTarget:[self class]\n                                      selector:@selector(runRunLoop)\n                                        object:nil];\n  _jsThread.name = RCTJSThreadName;\n  _jsThread.qualityOfService = NSOperationQualityOfServiceUserInteractive;\n#if RCT_DEBUG\n  _jsThread.stackSize *= 2;\n#endif\n  [_jsThread start];\n\n  dispatch_group_t prepareBridge = dispatch_group_create();\n\n  [_performanceLogger markStartForTag:RCTPLNativeModuleInit];\n\n  [self registerExtraModules];\n  // Initialize all native modules that cannot be loaded lazily\n  [self _initModules:RCTGetModuleClasses() withDispatchGroup:prepareBridge lazilyDiscovered:NO];\n\n  [_performanceLogger markStopForTag:RCTPLNativeModuleInit];\n\n  // This doesn't really do anything.  The real work happens in initializeBridge.\n  _reactInstance.reset(new Instance);\n\n  __weak RCTCxxBridge *weakSelf = self;\n\n  // Prepare executor factory (shared_ptr for copy into block)\n  std::shared_ptr<JSExecutorFactory> executorFactory;\n  if (!self.executorClass) {\n    if ([self.delegate conformsToProtocol:@protocol(RCTCxxBridgeDelegate)]) {\n      id<RCTCxxBridgeDelegate> cxxDelegate = (id<RCTCxxBridgeDelegate>) self.delegate;\n      executorFactory = [cxxDelegate jsExecutorFactoryForBridge:self];\n    }\n    if (!executorFactory) {\n      BOOL useCustomJSC =\n        [self.delegate respondsToSelector:@selector(shouldBridgeUseCustomJSC:)] &&\n        [self.delegate shouldBridgeUseCustomJSC:self];\n      // We use the name of the device and the app for debugging & metrics\n      NSString *deviceName = [[NSHost currentHost] localizedName];\n      NSString *appName = [[NSBundle mainBundle] bundleIdentifier];\n      // The arg is a cache dir.  It's not used with standard JSC.\n      executorFactory.reset(new JSCExecutorFactory(folly::dynamic::object\n        (\"OwnerIdentity\", \"ReactNative\")\n        (\"AppIdentity\", [(appName ?: @\"unknown\") UTF8String])\n        (\"DeviceIdentity\", [(deviceName ?: @\"unknown\") UTF8String])\n        (\"UseCustomJSC\", (bool)useCustomJSC)\n  #if RCT_PROFILE\n        (\"StartSamplingProfilerOnInit\", (bool)self.devSettings.startSamplingProfilerOnLaunch)\n  #endif\n      ));\n    }\n  } else {\n    id<RCTJavaScriptExecutor> objcExecutor = [self moduleForClass:self.executorClass];\n    executorFactory.reset(new RCTObjcExecutorFactory(objcExecutor, ^(NSError *error) {\n      if (error) {\n        [weakSelf handleError:error];\n      }\n    }));\n  }\n\n  // Dispatch the instance initialization as soon as the initial module metadata has\n  // been collected (see initModules)\n  dispatch_group_enter(prepareBridge);\n  [self ensureOnJavaScriptThread:^{\n    [weakSelf _initializeBridge:executorFactory];\n    dispatch_group_leave(prepareBridge);\n  }];\n\n  // Load the source asynchronously, then store it for later execution.\n  dispatch_group_enter(prepareBridge);\n  __block NSData *sourceCode;\n  [self loadSource:^(NSError *error, RCTSource *source) {\n    if (error) {\n      [weakSelf handleError:error];\n    }\n\n    sourceCode = source.data;\n    dispatch_group_leave(prepareBridge);\n  } onProgress:^(RCTLoadingProgress *progressData) {\n#if RCT_DEV && __has_include(\"RCTDevLoadingView.h\")\n    RCTDevLoadingView *loadingView = [weakSelf moduleForClass:[RCTDevLoadingView class]];\n    [loadingView updateProgress:progressData];\n#endif\n  }];\n\n  // Wait for both the modules and source code to have finished loading\n  dispatch_group_notify(prepareBridge, dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{\n    RCTCxxBridge *strongSelf = weakSelf;\n    if (sourceCode && strongSelf.loading) {\n      [strongSelf executeSourceCode:sourceCode sync:NO];\n    }\n  });\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n- (void)loadSource:(RCTSourceLoadBlock)_onSourceLoad onProgress:(RCTSourceLoadProgressBlock)onProgress\n{\n  NSNotificationCenter *center = [NSNotificationCenter defaultCenter];\n  [center postNotificationName:RCTBridgeWillDownloadScriptNotification object:_parentBridge];\n  [_performanceLogger markStartForTag:RCTPLScriptDownload];\n  NSUInteger cookie = RCTProfileBeginAsyncEvent(0, @\"JavaScript download\", nil);\n\n  // Suppress a warning if RCTProfileBeginAsyncEvent gets compiled out\n  (void)cookie;\n\n  RCTPerformanceLogger *performanceLogger = _performanceLogger;\n  RCTSourceLoadBlock onSourceLoad = ^(NSError *error, RCTSource *source) {\n    RCTProfileEndAsyncEvent(0, @\"native\", cookie, @\"JavaScript download\", @\"JS async\");\n    [performanceLogger markStopForTag:RCTPLScriptDownload];\n    [performanceLogger setValue:source.length forTag:RCTPLBundleSize];\n\n    NSDictionary *userInfo = source ? @{ RCTBridgeDidDownloadScriptNotificationSourceKey: source } : nil;\n    [center postNotificationName:RCTBridgeDidDownloadScriptNotification object:self->_parentBridge userInfo:userInfo];\n\n    _onSourceLoad(error, source);\n  };\n\n  if ([self.delegate respondsToSelector:@selector(loadSourceForBridge:onProgress:onComplete:)]) {\n    [self.delegate loadSourceForBridge:_parentBridge onProgress:onProgress onComplete:onSourceLoad];\n  } else if ([self.delegate respondsToSelector:@selector(loadSourceForBridge:withBlock:)]) {\n    [self.delegate loadSourceForBridge:_parentBridge withBlock:onSourceLoad];\n  } else if (!self.bundleURL) {\n    NSError *error = RCTErrorWithMessage(@\"No bundle URL present.\\n\\nMake sure you're running a packager \" \\\n                                         \"server or have included a .jsbundle file in your application bundle.\");\n    onSourceLoad(error, nil);\n  } else {\n    [RCTJavaScriptLoader loadBundleAtURL:self.bundleURL onProgress:onProgress onComplete:^(NSError *error, RCTSource *source) {\n      if (error) {\n        RCTLogError(@\"Failed to load bundle: %@\\n\\n%@ %@\", self.bundleURL, error.localizedDescription, error.localizedFailureReason ?: @\"\");\n        return;\n      }\n      onSourceLoad(error, source);\n    }];\n  }\n}\n\n- (NSArray<Class> *)moduleClasses\n{\n  if (RCT_DEBUG && _valid && _moduleClassesByID == nil) {\n    RCTLogError(@\"Bridge modules have not yet been initialized. You may be \"\n                \"trying to access a module too early in the startup procedure.\");\n  }\n  return _moduleClassesByID;\n}\n\n/**\n * Used by RCTUIManager\n */\n- (RCTModuleData *)moduleDataForName:(NSString *)moduleName\n{\n  return _moduleDataByName[moduleName];\n}\n\n- (id)moduleForName:(NSString *)moduleName\n{\n  return _moduleDataByName[moduleName].instance;\n}\n\n- (BOOL)moduleIsInitialized:(Class)moduleClass\n{\n  return _moduleDataByName[RCTBridgeModuleNameForClass(moduleClass)].hasInstance;\n}\n\n- (std::shared_ptr<ModuleRegistry>)_buildModuleRegistry\n{\n  if (!self.valid) {\n    return {};\n  }\n\n  [_performanceLogger markStartForTag:RCTPLNativeModulePrepareConfig];\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"-[RCTCxxBridge buildModuleRegistry]\", nil);\n\n  __weak __typeof(self) weakSelf = self;\n  ModuleRegistry::ModuleNotFoundCallback moduleNotFoundCallback = ^bool(const std::string &name) {\n    __strong __typeof(weakSelf) strongSelf = weakSelf;\n    return [strongSelf.delegate respondsToSelector:@selector(bridge:didNotFindModule:)] &&\n           [strongSelf.delegate bridge:strongSelf didNotFindModule:@(name.c_str())];\n  };\n\n  auto registry = std::make_shared<ModuleRegistry>(\n         createNativeModules(_moduleDataByID, self, _reactInstance),\n         moduleNotFoundCallback);\n\n  [_performanceLogger markStopForTag:RCTPLNativeModulePrepareConfig];\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n  return registry;\n}\n\n- (void)_initializeBridge:(std::shared_ptr<JSExecutorFactory>)executorFactory\n{\n  if (!self.valid) {\n    return;\n  }\n\n  RCTAssertJSThread();\n  __weak RCTCxxBridge *weakSelf = self;\n  _jsMessageThread = std::make_shared<RCTMessageThread>([NSRunLoop currentRunLoop], ^(NSError *error) {\n    if (error) {\n      [weakSelf handleError:error];\n    }\n  });\n\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"-[RCTCxxBridge initializeBridge:]\", nil);\n  // This can only be false if the bridge was invalidated before startup completed\n  if (_reactInstance) {\n#if RCT_DEV\n    executorFactory = std::make_shared<GetDescAdapter>(self, executorFactory);\n#endif\n\n    // This is async, but any calls into JS are blocked by the m_syncReady CV in Instance\n    _reactInstance->initializeBridge(\n      std::make_unique<RCTInstanceCallback>(self),\n      executorFactory,\n      _jsMessageThread,\n      [self _buildModuleRegistry]);\n\n#if RCT_PROFILE\n    if (RCTProfileIsProfiling()) {\n      _reactInstance->setGlobalVariable(\n        \"__RCTProfileIsProfiling\",\n        std::make_unique<JSBigStdString>(\"true\"));\n    }\n#endif\n  }\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n- (NSArray *)configForModuleName:(NSString *)moduleName\n{\n  return _moduleDataByName[moduleName].config;\n}\n\n- (NSArray<RCTModuleData *> *)registerModulesForClasses:(NSArray<Class> *)moduleClasses\n{\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways,\n                          @\"-[RCTCxxBridge initModulesWithDispatchGroup:] autoexported moduleData\", nil);\n\n  NSMutableArray<RCTModuleData *> *moduleDataByID = [NSMutableArray arrayWithCapacity:moduleClasses.count];\n  for (Class moduleClass in moduleClasses) {\n    NSString *moduleName = RCTBridgeModuleNameForClass(moduleClass);\n\n    // Don't initialize the old executor in the new bridge.\n    // TODO mhorowitz #10487027: after D3175632 lands, we won't need\n    // this, because it won't be eagerly initialized.\n    if ([moduleName isEqualToString:@\"RCTJSCExecutor\"]) {\n      continue;\n    }\n\n    // Check for module name collisions\n    RCTModuleData *moduleData = _moduleDataByName[moduleName];\n    if (moduleData) {\n      if (moduleData.hasInstance) {\n        // Existing module was preregistered, so it takes precedence\n        continue;\n      } else if ([moduleClass new] == nil) {\n        // The new module returned nil from init, so use the old module\n        continue;\n      } else if ([moduleData.moduleClass new] != nil) {\n        // Both modules were non-nil, so it's unclear which should take precedence\n        RCTLogError(@\"Attempted to register RCTBridgeModule class %@ for the \"\n                    \"name '%@', but name was already registered by class %@\",\n                    moduleClass, moduleName, moduleData.moduleClass);\n      }\n    }\n\n    // Instantiate moduleData\n    // TODO #13258411: can we defer this until config generation?\n    moduleData = [[RCTModuleData alloc] initWithModuleClass:moduleClass bridge:self];\n\n    _moduleDataByName[moduleName] = moduleData;\n    [_moduleClassesByID addObject:moduleClass];\n    [moduleDataByID addObject:moduleData];\n  }\n  [_moduleDataByID addObjectsFromArray:moduleDataByID];\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n  return moduleDataByID;\n}\n\n- (void)registerExtraModules\n{\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways,\n                          @\"-[RCTCxxBridge initModulesWithDispatchGroup:] extraModules\", nil);\n\n  NSArray<id<RCTBridgeModule>> *extraModules = nil;\n  if ([self.delegate respondsToSelector:@selector(extraModulesForBridge:)]) {\n    extraModules = [self.delegate extraModulesForBridge:_parentBridge];\n  } else if (self.moduleProvider) {\n    extraModules = self.moduleProvider();\n  }\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n#if RCT_DEBUG\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    RCTVerifyAllModulesExported(extraModules);\n  });\n#endif\n\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways,\n                          @\"-[RCTCxxBridge initModulesWithDispatchGroup:] preinitialized moduleData\", nil);\n  // Set up moduleData for pre-initialized module instances\n  for (id<RCTBridgeModule> module in extraModules) {\n    Class moduleClass = [module class];\n    NSString *moduleName = RCTBridgeModuleNameForClass(moduleClass);\n\n    if (RCT_DEBUG) {\n      // Check for name collisions between preregistered modules\n      RCTModuleData *moduleData = _moduleDataByName[moduleName];\n      if (moduleData) {\n        RCTLogError(@\"Attempted to register RCTBridgeModule class %@ for the \"\n                    \"name '%@', but name was already registered by class %@\",\n                    moduleClass, moduleName, moduleData.moduleClass);\n        continue;\n      }\n    }\n\n    // Instantiate moduleData container\n    RCTModuleData *moduleData = [[RCTModuleData alloc] initWithModuleInstance:module bridge:self];\n    _moduleDataByName[moduleName] = moduleData;\n    [_moduleClassesByID addObject:moduleClass];\n    [_moduleDataByID addObject:moduleData];\n  }\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n- (void)_initModules:(NSArray<id<RCTBridgeModule>> *)modules\n   withDispatchGroup:(dispatch_group_t)dispatchGroup\n    lazilyDiscovered:(BOOL)lazilyDiscovered\n{\n  RCTAssert(!(RCTIsMainQueue() && lazilyDiscovered), @\"Lazy discovery can only happen off the Main Queue\");\n\n  // Set up moduleData for automatically-exported modules\n  NSArray<RCTModuleData *> *moduleDataById = [self registerModulesForClasses:modules];\n\n#ifdef RCT_DEBUG\n  if (lazilyDiscovered) {\n    // Lazily discovered modules do not require instantiation here,\n    // as they are not allowed to have pre-instantiated instance\n    // and must not require the main queue.\n    for (RCTModuleData *moduleData in moduleDataById) {\n      RCTAssert(!(moduleData.requiresMainQueueSetup || moduleData.hasInstance),\n        @\"Module \\'%@\\' requires initialization on the Main Queue or has pre-instantiated, which is not supported for the lazily discovered modules.\", moduleData.name);\n    }\n  }\n  else\n#endif\n  {\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways,\n                            @\"-[RCTCxxBridge initModulesWithDispatchGroup:] moduleData.hasInstance\", nil);\n    // Dispatch module init onto main thread for those modules that require it\n    // For non-lazily discovered modules we run through the entire set of modules\n    // that we have, otherwise some modules coming from the delegate\n    // or module provider block, will not be properly instantiated.\n    for (RCTModuleData *moduleData in _moduleDataByID) {\n      if (moduleData.hasInstance && (!moduleData.requiresMainQueueSetup || RCTIsMainQueue())) {\n        // Modules that were pre-initialized should ideally be set up before\n        // bridge init has finished, otherwise the caller may try to access the\n        // module directly rather than via `[bridge moduleForClass:]`, which won't\n        // trigger the lazy initialization process. If the module cannot safely be\n        // set up on the current thread, it will instead be async dispatched\n        // to the main thread to be set up in _prepareModulesWithDispatchGroup:.\n        (void)[moduleData instance];\n      }\n    }\n    RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n    // From this point on, RCTDidInitializeModuleNotification notifications will\n    // be sent the first time a module is accessed.\n    _moduleSetupComplete = YES;\n    [self _prepareModulesWithDispatchGroup:dispatchGroup];\n  }\n\n#if RCT_PROFILE\n  if (RCTProfileIsProfiling()) {\n    // Depends on moduleDataByID being loaded\n    RCTProfileHookModules(self);\n  }\n#endif\n}\n\n- (void)registerAdditionalModuleClasses:(NSArray<Class> *)modules\n{\n  [self _initModules:modules withDispatchGroup:NULL lazilyDiscovered:YES];\n}\n\n- (void)_prepareModulesWithDispatchGroup:(dispatch_group_t)dispatchGroup\n{\n  RCT_PROFILE_BEGIN_EVENT(0, @\"-[RCTBatchedBridge prepareModulesWithDispatch]\", nil);\n\n  BOOL initializeImmediately = NO;\n  if (dispatchGroup == NULL) {\n    // If no dispatchGroup is passed in, we must prepare everything immediately.\n    // We better be on the right thread too.\n    RCTAssertMainQueue();\n    initializeImmediately = YES;\n  }\n\n  // Set up modules that require main thread init or constants export\n  [_performanceLogger setValue:0 forTag:RCTPLNativeModuleMainThread];\n\n  for (RCTModuleData *moduleData in _moduleDataByID) {\n    if (moduleData.requiresMainQueueSetup) {\n      // Modules that need to be set up on the main thread cannot be initialized\n      // lazily when required without doing a dispatch_sync to the main thread,\n      // which can result in deadlock. To avoid this, we initialize all of these\n      // modules on the main thread in parallel with loading the JS code, so\n      // they will already be available before they are ever required.\n      dispatch_block_t block = ^{\n        if (self.valid && ![moduleData.moduleClass isSubclassOfClass:[RCTCxxModule class]]) {\n          [self->_performanceLogger appendStartForTag:RCTPLNativeModuleMainThread];\n          (void)[moduleData instance];\n          [moduleData gatherConstants];\n          [self->_performanceLogger appendStopForTag:RCTPLNativeModuleMainThread];\n        }\n      };\n\n      if (initializeImmediately && RCTIsMainQueue()) {\n        block();\n      } else {\n        // We've already checked that dispatchGroup is non-null, but this satisifies the\n        // Xcode analyzer\n        if (dispatchGroup) {\n          dispatch_group_async(dispatchGroup, dispatch_get_main_queue(), block);\n        }\n      }\n      _modulesInitializedOnMainQueue++;\n    }\n  }\n  [_performanceLogger setValue:_modulesInitializedOnMainQueue forTag:RCTPLNativeModuleMainThreadUsesCount];\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n- (void)registerModuleForFrameUpdates:(id<RCTBridgeModule>)module\n                       withModuleData:(RCTModuleData *)moduleData\n{\n  [_displayLink registerModuleForFrameUpdates:module withModuleData:moduleData];\n}\n\n- (void)executeSourceCode:(NSData *)sourceCode sync:(BOOL)sync\n{\n  // This will get called from whatever thread was actually executing JS.\n  dispatch_block_t completion = ^{\n    // Log start up metrics early before processing any other js calls\n    [self logStartupFinish];\n    // Flush pending calls immediately so we preserve ordering\n    [self _flushPendingCalls];\n\n    // Perform the state update and notification on the main thread, so we can't run into\n    // timing issues with RCTRootView\n    dispatch_async(dispatch_get_main_queue(), ^{\n      [[NSNotificationCenter defaultCenter]\n       postNotificationName:RCTJavaScriptDidLoadNotification\n       object:self->_parentBridge userInfo:@{@\"bridge\": self}];\n\n      // Starting the display link is not critical to startup, so do it last\n      [self ensureOnJavaScriptThread:^{\n        // Register the display link to start sending js calls after everything is setup\n        [self->_displayLink addToRunLoop:[NSRunLoop currentRunLoop]];\n      }];\n    });\n  };\n\n  if (sync) {\n    [self executeApplicationScriptSync:sourceCode url:self.bundleURL];\n    completion();\n  } else {\n    [self enqueueApplicationScript:sourceCode url:self.bundleURL onComplete:completion];\n  }\n\n#if RCT_DEV\n  if (self.devSettings.isHotLoadingAvailable && self.devSettings.isHotLoadingEnabled) {\n    NSString *path = [self.bundleURL.path substringFromIndex:1]; // strip initial slash\n    NSString *host = self.bundleURL.host;\n    NSNumber *port = self.bundleURL.port;\n    [self enqueueJSCall:@\"HMRClient\"\n                 method:@\"enable\"\n                   args:@[@\"macos\", path, host, RCTNullIfNil(port)]\n             completion:NULL];  }\n#endif\n}\n\n- (void)handleError:(NSError *)error\n{\n  // This is generally called when the infrastructure throws an\n  // exception while calling JS.  Most product exceptions will not go\n  // through this method, but through RCTExceptionManager.\n\n  // There are three possible states:\n  // 1. initializing == _valid && _loading\n  // 2. initializing/loading finished (success or failure) == _valid && !_loading\n  // 3. invalidated == !_valid && !_loading\n\n  // !_valid && _loading can't happen.\n\n  // In state 1: on main queue, move to state 2, reset the bridge, and RCTFatal.\n  // In state 2: go directly to RCTFatal.  Do not enqueue, do not collect $200.\n  // In state 3: do nothing.\n\n  if (self->_valid && !self->_loading) {\n    if ([error userInfo][RCTJSRawStackTraceKey]) {\n      [self.redBox showErrorMessage:[error localizedDescription]\n                       withRawStack:[error userInfo][RCTJSRawStackTraceKey]];\n    }\n\n    RCTFatal(error);\n\n    // RN will stop, but let the rest of the app keep going.\n    return;\n  }\n\n  if (!_valid || !_loading) {\n    return;\n  }\n\n  // Hack: once the bridge is invalidated below, it won't initialize any new native\n  // modules. Initialize the redbox module now so we can still report this error.\n  RCTRedBox *redBox = [self redBox];\n\n  _loading = NO;\n  _valid = NO;\n\n  dispatch_async(dispatch_get_main_queue(), ^{\n    if (self->_jsMessageThread) {\n      // Make sure initializeBridge completed\n      self->_jsMessageThread->runOnQueueSync([] {});\n    }\n\n    self->_reactInstance.reset();\n    self->_jsMessageThread.reset();\n\n    [[NSNotificationCenter defaultCenter]\n     postNotificationName:RCTJavaScriptDidFailToLoadNotification\n     object:self->_parentBridge userInfo:@{@\"bridge\": self, @\"error\": error}];\n\n    if ([error userInfo][RCTJSRawStackTraceKey]) {\n      [redBox showErrorMessage:[error localizedDescription]\n                  withRawStack:[error userInfo][RCTJSRawStackTraceKey]];\n    }\n\n    RCTFatal(error);\n  });\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithDelegate:(__unused id<RCTBridgeDelegate>)delegate\n                                           bundleURL:(__unused NSURL *)bundleURL\n                                      moduleProvider:(__unused RCTBridgeModuleListProvider)block\n                                       launchOptions:(__unused NSDictionary *)launchOptions)\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleURL\n                                       moduleProvider:(__unused RCTBridgeModuleListProvider)block\n                                        launchOptions:(__unused NSDictionary *)launchOptions)\n\n/**\n * Prevent super from calling setUp (that'd create another batchedBridge)\n */\n- (void)setUp {}\n\n- (void)reload\n{\n  [_parentBridge reload];\n}\n\n- (Class)executorClass\n{\n  return _parentBridge.executorClass;\n}\n\n- (void)setExecutorClass:(Class)executorClass\n{\n  RCTAssertMainQueue();\n\n  _parentBridge.executorClass = executorClass;\n}\n\n- (NSURL *)bundleURL\n{\n  return _parentBridge.bundleURL;\n}\n\n- (void)setBundleURL:(NSURL *)bundleURL\n{\n  _parentBridge.bundleURL = bundleURL;\n}\n\n- (id<RCTBridgeDelegate>)delegate\n{\n  return _parentBridge.delegate;\n}\n\n- (void)dispatchBlock:(dispatch_block_t)block\n                queue:(dispatch_queue_t)queue\n{\n  if (queue == RCTJSThread) {\n    [self ensureOnJavaScriptThread:block];\n  } else if (queue) {\n    dispatch_async(queue, block);\n  }\n}\n\n#pragma mark - RCTInvalidating\n\n- (void)invalidate\n{\n  if (_didInvalidate) {\n    return;\n  }\n\n  RCTAssertMainQueue();\n  RCTLogInfo(@\"Invalidating %@ (parent: %@, executor: %@)\", self, _parentBridge, [self executorClass]);\n\n  _loading = NO;\n  _valid = NO;\n  _didInvalidate = YES;\n\n  if ([RCTBridge currentBridge] == self) {\n    [RCTBridge setCurrentBridge:nil];\n  }\n\n  // Stop JS instance and message thread\n  [self ensureOnJavaScriptThread:^{\n    [self->_displayLink invalidate];\n    self->_displayLink = nil;\n\n    if (RCTProfileIsProfiling()) {\n      RCTProfileUnhookModules(self);\n    }\n\n    // Invalidate modules\n    // We're on the JS thread (which we'll be suspending soon), so no new calls will be made to native modules after\n    // this completes. We must ensure all previous calls were dispatched before deallocating the instance (and module\n    // wrappers) or we may have invalid pointers still in flight.\n    dispatch_group_t moduleInvalidation = dispatch_group_create();\n    for (RCTModuleData *moduleData in self->_moduleDataByID) {\n      // Be careful when grabbing an instance here, we don't want to instantiate\n      // any modules just to invalidate them.\n      if (![moduleData hasInstance]) {\n        continue;\n      }\n\n      if ([moduleData.instance respondsToSelector:@selector(invalidate)]) {\n        dispatch_group_enter(moduleInvalidation);\n        [self dispatchBlock:^{\n          [(id<RCTInvalidating>)moduleData.instance invalidate];\n          dispatch_group_leave(moduleInvalidation);\n        } queue:moduleData.methodQueue];\n      }\n      [moduleData invalidate];\n    }\n\n    if (dispatch_group_wait(moduleInvalidation, dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC))) {\n      RCTLogError(@\"Timed out waiting for modules to be invalidated\");\n    }\n\n    self->_reactInstance.reset();\n    self->_jsMessageThread.reset();\n\n    self->_moduleDataByName = nil;\n    self->_moduleDataByID = nil;\n    self->_moduleClassesByID = nil;\n    self->_pendingCalls = nil;\n\n    [self->_jsThread cancel];\n    self->_jsThread = nil;\n    CFRunLoopStop(CFRunLoopGetCurrent());\n  }];\n}\n\n- (void)logMessage:(NSString *)message level:(NSString *)level\n{\n  if (RCT_DEBUG && _valid) {\n    [self enqueueJSCall:@\"RCTLog\"\n                 method:@\"logIfNoNativeHook\"\n                   args:@[level, message]\n             completion:NULL];\n  }\n}\n\n#pragma mark - RCTBridge methods\n\n- (void)_runAfterLoad:(RCTPendingCall)block\n{\n  // Ordering here is tricky.  Ideally, the C++ bridge would provide\n  // functionality to defer calls until after the app is loaded.  Until that\n  // happens, we do this.  _pendingCount keeps a count of blocks which have\n  // been deferred.  It is incremented using an atomic barrier call before each\n  // block is added to the js queue, and decremented using an atomic barrier\n  // call after the block is executed.  If _pendingCount is zero, there is no\n  // work either in the js queue, or in _pendingCalls, so it is safe to add new\n  // work to the JS queue directly.\n\n  if (self.loading || _pendingCount > 0) {\n    // From the callers' perspecive:\n\n    // Phase 1: jsQueueBlocks are added to the queue; _pendingCount is\n    // incremented for each.  If the first block is created after self.loading is\n    // true, phase 1 will be nothing.\n    _pendingCount++;\n    dispatch_block_t jsQueueBlock = ^{\n      // From the perspective of the JS queue:\n      if (self.loading) {\n        // Phase A: jsQueueBlocks are executed.  self.loading is true, so they\n        // are added to _pendingCalls.\n        [self->_pendingCalls addObject:block];\n      } else {\n        // Phase C: More jsQueueBlocks are executed.  self.loading is false, so\n        // each block is executed, adding work to the queue, and _pendingCount is\n        // decremented.\n        block();\n        self->_pendingCount--;\n      }\n    };\n    [self ensureOnJavaScriptThread:jsQueueBlock];\n  } else {\n    // Phase 2/Phase D: blocks are executed directly, adding work to the JS queue.\n    block();\n  }\n}\n\n- (void)logStartupFinish\n{\n  // Log metrics about native requires during the bridge startup.\n  uint64_t nativeRequiresCount = [_performanceLogger valueForTag:RCTPLRAMNativeRequiresCount];\n  [_performanceLogger setValue:nativeRequiresCount forTag:RCTPLRAMStartupNativeRequiresCount];\n  uint64_t nativeRequires = [_performanceLogger valueForTag:RCTPLRAMNativeRequires];\n  [_performanceLogger setValue:nativeRequires forTag:RCTPLRAMStartupNativeRequires];\n\n  [_performanceLogger markStopForTag:RCTPLBridgeStartup];\n}\n\n- (void)_flushPendingCalls\n{\n  RCT_PROFILE_BEGIN_EVENT(0, @\"Processing pendingCalls\", @{ @\"count\": [@(_pendingCalls.count) stringValue] });\n  // Phase B: _flushPendingCalls happens.  Each block in _pendingCalls is\n  // executed, adding work to the queue, and _pendingCount is decremented.\n  // loading is set to NO.\n  NSArray<RCTPendingCall> *pendingCalls = _pendingCalls;\n  _pendingCalls = nil;\n  for (RCTPendingCall call in pendingCalls) {\n    call();\n    _pendingCount--;\n  }\n  _loading = NO;\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n/**\n * Public. Can be invoked from any thread.\n */\n- (void)enqueueJSCall:(NSString *)module method:(NSString *)method args:(NSArray *)args completion:(dispatch_block_t)completion\n{\n  if (!self.valid) {\n    return;\n  }\n\n  /**\n   * AnyThread\n   */\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"-[RCTCxxBridge enqueueJSCall:]\", nil);\n\n  RCTProfileBeginFlowEvent();\n  __weak __typeof(self) weakSelf = self;\n  [self _runAfterLoad:^(){\n    RCTProfileEndFlowEvent();\n    __strong __typeof(weakSelf) strongSelf = weakSelf;\n    if (!strongSelf) {\n      return;\n    }\n\n    if (strongSelf->_reactInstance) {\n      strongSelf->_reactInstance->callJSFunction([module UTF8String], [method UTF8String],\n                                             convertIdToFollyDynamic(args ?: @[]));\n\n      // ensureOnJavaScriptThread may execute immediately, so use jsMessageThread, to make sure\n      // the block is invoked after callJSFunction\n      if (completion) {\n        if (strongSelf->_jsMessageThread) {\n          strongSelf->_jsMessageThread->runOnQueue(completion);\n        } else {\n          RCTLogWarn(@\"Can't invoke completion without messageThread\");\n        }\n      }\n    }\n  }];\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\n/**\n * Called by RCTModuleMethod from any thread.\n */\n- (void)enqueueCallback:(NSNumber *)cbID args:(NSArray *)args\n{\n  if (!self.valid) {\n    return;\n  }\n\n  /**\n   * AnyThread\n   */\n\n  RCTProfileBeginFlowEvent();\n  __weak __typeof(self) weakSelf = self;\n  [self _runAfterLoad:^(){\n    RCTProfileEndFlowEvent();\n    __strong __typeof(weakSelf) strongSelf = weakSelf;\n    if (!strongSelf) {\n      return;\n    }\n\n    if (strongSelf->_reactInstance) {\n      strongSelf->_reactInstance->callJSCallback([cbID unsignedLongLongValue], convertIdToFollyDynamic(args ?: @[]));\n    }\n  }];\n}\n\n/**\n * Private hack to support `setTimeout(fn, 0)`\n */\n- (void)_immediatelyCallTimer:(NSNumber *)timer\n{\n  RCTAssertJSThread();\n\n  if (_reactInstance) {\n    _reactInstance->callJSFunction(\"JSTimers\", \"callTimers\",\n                                   folly::dynamic::array(folly::dynamic::array([timer doubleValue])));\n  }\n}\n\n- (void)enqueueApplicationScript:(NSData *)script\n                             url:(NSURL *)url\n                      onComplete:(dispatch_block_t)onComplete\n{\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"-[RCTCxxBridge enqueueApplicationScript]\", nil);\n\n  [self executeApplicationScript:script url:url async:YES];\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n  // Assumes that onComplete can be called when the next block on the JS thread is scheduled\n  if (onComplete) {\n    RCTAssert(_jsMessageThread != nullptr, @\"Cannot invoke completion without jsMessageThread\");\n    _jsMessageThread->runOnQueue(onComplete);\n  }\n}\n\n- (void)executeApplicationScriptSync:(NSData *)script url:(NSURL *)url\n{\n  [self executeApplicationScript:script url:url async:NO];\n}\n\n- (void)executeApplicationScript:(NSData *)script\n                             url:(NSURL *)url\n                           async:(BOOL)async\n{\n  [self _tryAndHandleError:^{\n    NSString *sourceUrlStr = deriveSourceURL(url);\n    if (isRAMBundle(script)) {\n      [self->_performanceLogger markStartForTag:RCTPLRAMBundleLoad];\n      auto ramBundle = std::make_unique<JSIndexedRAMBundle>(sourceUrlStr.UTF8String);\n      std::unique_ptr<const JSBigString> scriptStr = ramBundle->getStartupCode();\n      [self->_performanceLogger markStopForTag:RCTPLRAMBundleLoad];\n      [self->_performanceLogger setValue:scriptStr->size() forTag:RCTPLRAMStartupCodeSize];\n      if (self->_reactInstance) {\n        auto registry = RAMBundleRegistry::multipleBundlesRegistry(std::move(ramBundle), JSIndexedRAMBundle::buildFactory());\n        self->_reactInstance->loadRAMBundle(std::move(registry), std::move(scriptStr),\n                                            sourceUrlStr.UTF8String, !async);\n      }\n    } else if (self->_reactInstance) {\n      self->_reactInstance->loadScriptFromString(std::make_unique<NSDataBigString>(script),\n                                                 sourceUrlStr.UTF8String, !async);\n    } else {\n      std::string methodName = async ? \"loadApplicationScript\" : \"loadApplicationScriptSync\";\n      throw std::logic_error(\"Attempt to call \" + methodName + \": on uninitialized bridge\");\n    }\n  }];\n}\n\n- (JSValue *)callFunctionOnModule:(NSString *)module\n                           method:(NSString *)method\n                        arguments:(NSArray *)arguments\n                            error:(NSError **)error\n{\n  if (!_reactInstance) {\n    if (error) {\n      *error = RCTErrorWithMessage(\n        @\"callFunctionOnModule was called on uninitialized bridge\");\n    }\n    return nil;\n  } else if (self.executorClass) {\n    if (error) {\n      *error = RCTErrorWithMessage(\n        @\"callFunctionOnModule can only be used with JSC executor\");\n    }\n    return nil;\n  } else if (!self.valid) {\n    if (error) {\n      *error = RCTErrorWithMessage(\n        @\"Bridge is no longer valid\");\n    }\n    return nil;\n  } else if (self.loading) {\n    if (error) {\n      *error = RCTErrorWithMessage(\n        @\"Bridge is still loading\");\n    }\n    return nil;\n  }\n\n  RCT_PROFILE_BEGIN_EVENT(0, @\"callFunctionOnModule\", (@{ @\"module\": module, @\"method\": method }));\n  __block JSValue *ret = nil;\n  NSError *errorObj = tryAndReturnError(^{\n    Value result = self->_reactInstance->callFunctionSync([module UTF8String], [method UTF8String], (id)arguments);\n    JSContext *context = contextForGlobalContextRef(JSC_JSContextGetGlobalContext(result.context()));\n    ret = [JSC_JSValue(result.context()) valueWithJSValueRef:result inContext:context];\n  });\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"js_call\");\n\n  if (error) {\n    *error = errorObj;\n  }\n\n  return ret;\n}\n\n- (void)registerSegmentWithId:(NSUInteger)segmentId path:(NSString *)path\n{\n  if (_reactInstance) {\n    _reactInstance->registerBundle(static_cast<uint32_t>(segmentId), path.UTF8String);\n  }\n}\n\n#pragma mark - Payload Processing\n\n- (void)partialBatchDidFlush\n{\n  for (RCTModuleData *moduleData in _moduleDataByID) {\n    if (moduleData.implementsPartialBatchDidFlush) {\n      [self dispatchBlock:^{\n        [moduleData.instance partialBatchDidFlush];\n      } queue:moduleData.methodQueue];\n    }\n  }\n}\n\n- (void)batchDidComplete\n{\n  // TODO #12592471: batchDidComplete is only used by RCTUIManager,\n  // can we eliminate this special case?\n  for (RCTModuleData *moduleData in _moduleDataByID) {\n    if (moduleData.implementsBatchDidComplete) {\n      [self dispatchBlock:^{\n        [moduleData.instance batchDidComplete];\n      } queue:moduleData.methodQueue];\n    }\n  }\n}\n\n- (void)startProfiling\n{\n  RCTAssertMainQueue();\n\n  [self ensureOnJavaScriptThread:^{\n    #if WITH_FBSYSTRACE\n    [RCTFBSystrace registerCallbacks];\n    #endif\n    RCTProfileInit(self);\n\n    [self enqueueJSCall:@\"Systrace\" method:@\"setEnabled\" args:@[@YES] completion:NULL];\n  }];\n}\n\n- (void)stopProfiling:(void (^)(NSData *))callback\n{\n  RCTAssertMainQueue();\n\n  [self ensureOnJavaScriptThread:^{\n    [self enqueueJSCall:@\"Systrace\" method:@\"setEnabled\" args:@[@NO] completion:NULL];\n    RCTProfileEnd(self, ^(NSString *log) {\n      NSData *logData = [log dataUsingEncoding:NSUTF8StringEncoding];\n      callback(logData);\n      #if WITH_FBSYSTRACE\n      [RCTFBSystrace unregisterCallbacks];\n      #endif\n    });\n  }];\n}\n\n- (BOOL)isBatchActive\n{\n  return _wasBatchActive;\n}\n\n@end\n"
  },
  {
    "path": "React/CxxBridge/RCTCxxBridgeDelegate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <memory>\n\n#import <React/RCTBridgeDelegate.h>\n\nnamespace facebook {\nnamespace react {\n\nclass JSExecutorFactory;\n\n}\n}\n\n// This is a separate class so non-C++ implementations don't need to\n// take a C++ dependency.\n\n@protocol RCTCxxBridgeDelegate <RCTBridgeDelegate>\n\n/**\n * In the RCTCxxBridge, if this method is implemented, return a\n * ExecutorFactory instance which can be used to create the executor.\n * If not implemented, or returns an empty pointer, JSCExecutorFactory\n * will be used.\n */\n- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge;\n\n@end\n"
  },
  {
    "path": "React/CxxBridge/RCTJSCHelpers.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n/**\n * This must be invoked on iOS to set up platform dependencies before\n * creating an instance of JSCExecutor.\n */\n\nvoid RCTPrepareJSCExecutor();\n"
  },
  {
    "path": "React/CxxBridge/RCTJSCHelpers.mm",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"RCTJSCHelpers.h\"\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridge+Private.h>\n#import <React/RCTCxxUtils.h>\n#import <React/RCTLog.h>\n#import <cxxreact/Platform.h>\n#import <jschelpers/Value.h>\n\nusing namespace facebook::react;\n\nnamespace {\n\nJSValueRef nativeLoggingHook(\n    JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount,\n    const JSValueRef arguments[], JSValueRef *exception) {\n  RCTLogLevel level = RCTLogLevelInfo;\n  if (argumentCount > 1) {\n    level = MAX(level, (RCTLogLevel)Value(ctx, arguments[1]).asNumber());\n  }\n  if (argumentCount > 0) {\n    JSContext *contextObj = contextForGlobalContextRef(JSC_JSContextGetGlobalContext(ctx));\n    JSValue *msg = [JSC_JSValue(ctx) valueWithJSValueRef:arguments[0] inContext:contextObj];\n    _RCTLogJavaScriptInternal(level, [msg toString]);\n  }\n  return Value::makeUndefined(ctx);\n}\n\nJSValueRef nativePerformanceNow(\n    JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount,\n    const JSValueRef arguments[], JSValueRef *exception) {\n  return Value::makeNumber(ctx, CACurrentMediaTime() * 1000);\n}\n\n}\n\nvoid RCTPrepareJSCExecutor() {\n  ReactMarker::logTaggedMarker = [](const ReactMarker::ReactMarkerId, const char *tag) {};\n  JSCNativeHooks::loggingHook = nativeLoggingHook;\n  JSCNativeHooks::nowHook = nativePerformanceNow;\n  JSCNativeHooks::installPerfHooks = RCTFBQuickPerformanceLoggerConfigureHooks;\n}\n"
  },
  {
    "path": "React/CxxBridge/RCTMessageThread.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <string>\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTJavaScriptExecutor.h>\n#import <cxxreact/MessageQueueThread.h>\n\nnamespace facebook {\nnamespace react {\n\nclass RCTMessageThread : public MessageQueueThread {\n public:\n  RCTMessageThread(NSRunLoop *runLoop, RCTJavaScriptCompleteBlock errorBlock);\n  ~RCTMessageThread() override;\n  void runOnQueue(std::function<void()>&&) override;\n  void runOnQueueSync(std::function<void()>&&) override;\n  void quitSynchronous() override;\n  void setRunLoop(NSRunLoop *runLoop);\n\n private:\n  void tryFunc(const std::function<void()>& func);\n  void runAsync(std::function<void()> func);\n  void runSync(std::function<void()> func);\n\n  CFRunLoopRef m_cfRunLoop;\n  RCTJavaScriptCompleteBlock m_errorBlock;\n  std::atomic_bool m_shutdown;\n};\n\n}\n}\n"
  },
  {
    "path": "React/CxxBridge/RCTMessageThread.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"RCTMessageThread.h\"\n\n#include <condition_variable>\n#include <mutex>\n\n#import <React/RCTCxxUtils.h>\n#import <React/RCTUtils.h>\n#include <jschelpers/JSCHelpers.h>\n\n// A note about the implementation: This class is not used\n// generically.  It's a thin wrapper around a run loop which\n// implements a C++ interface, for use by the C++ xplat bridge code.\n// This means it can make certain non-generic assumptions.  In\n// particular, the sync functions are only used for bridge setup and\n// teardown, and quitSynchronous is guaranteed to be called.\n\nnamespace facebook {\nnamespace react {\n\nRCTMessageThread::RCTMessageThread(NSRunLoop *runLoop, RCTJavaScriptCompleteBlock errorBlock)\n  : m_cfRunLoop([runLoop getCFRunLoop])\n  , m_errorBlock(errorBlock)\n  , m_shutdown(false) {\n  CFRetain(m_cfRunLoop);\n}\n\nRCTMessageThread::~RCTMessageThread() {\n  CFRelease(m_cfRunLoop);\n}\n\n// This is analogous to dispatch_async\nvoid RCTMessageThread::runAsync(std::function<void()> func) {\n  CFRunLoopPerformBlock(m_cfRunLoop, kCFRunLoopCommonModes, ^{ func(); });\n  CFRunLoopWakeUp(m_cfRunLoop);\n}\n\n// This is analogous to dispatch_sync\nvoid RCTMessageThread::runSync(std::function<void()> func) {\n  if (m_cfRunLoop == CFRunLoopGetCurrent()) {\n    func();\n    return;\n  }\n\n  dispatch_semaphore_t sema = dispatch_semaphore_create(0);\n  runAsync([func=std::make_shared<std::function<void()>>(std::move(func)), &sema] {\n    (*func)();\n    dispatch_semaphore_signal(sema);\n  });\n  dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);\n}\n\nvoid RCTMessageThread::tryFunc(const std::function<void()>& func) {\n  NSError *error = tryAndReturnError(func);\n  if (error) {\n    m_errorBlock(error);\n  }\n}\n\nvoid RCTMessageThread::runOnQueue(std::function<void()>&& func) {\n  if (m_shutdown) {\n    return;\n  }\n\n  runAsync([this, func=std::make_shared<std::function<void()>>(std::move(func))] {\n    if (!m_shutdown) {\n      tryFunc(*func);\n    }\n  });\n}\n\nvoid RCTMessageThread::runOnQueueSync(std::function<void()>&& func) {\n  if (m_shutdown) {\n    return;\n  }\n  runSync([this, func=std::move(func)] {\n    if (!m_shutdown) {\n      tryFunc(func);\n    }\n  });\n}\n\nvoid RCTMessageThread::quitSynchronous() {\n  m_shutdown = true;\n  runSync([]{});\n  CFRunLoopStop(m_cfRunLoop);\n}\n\nvoid RCTMessageThread::setRunLoop(NSRunLoop *runLoop) {\n  CFRelease(m_cfRunLoop);\n  m_cfRunLoop = [runLoop getCFRunLoop];\n  CFRetain(m_cfRunLoop);\n}\n\n}\n}\n"
  },
  {
    "path": "React/CxxBridge/RCTObjcExecutor.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <functional>\n#include <memory>\n\n#import <React/RCTDefines.h>\n#import <React/RCTJavaScriptExecutor.h>\n#import <cxxreact/JSExecutor.h>\n\nnamespace facebook {\nnamespace react {\n\nclass RCTObjcExecutorFactory : public JSExecutorFactory {\npublic:\n  RCTObjcExecutorFactory(id<RCTJavaScriptExecutor> jse, RCTJavaScriptCompleteBlock errorBlock);\n  std::unique_ptr<JSExecutor> createJSExecutor(\n    std::shared_ptr<ExecutorDelegate> delegate,\n    std::shared_ptr<MessageQueueThread> jsQueue) override;\n\nprivate:\n  id<RCTJavaScriptExecutor> m_jse;\n  RCTJavaScriptCompleteBlock m_errorBlock;\n};\n\n}\n}\n"
  },
  {
    "path": "React/CxxBridge/RCTObjcExecutor.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTObjcExecutor.h\"\n\n#import <React/RCTCxxUtils.h>\n#import <React/RCTFollyConvert.h>\n#import <React/RCTJavaScriptExecutor.h>\n#import <React/RCTLog.h>\n#import <React/RCTProfile.h>\n#import <React/RCTUtils.h>\n#import <cxxreact/JSBigString.h>\n#import <cxxreact/JSExecutor.h>\n#import <cxxreact/MessageQueueThread.h>\n#import <cxxreact/ModuleRegistry.h>\n#import <folly/json.h>\n\nnamespace facebook {\nnamespace react {\n\nnamespace {\n\nclass JSEException : public std::runtime_error {\npublic:\n  JSEException(NSError *error)\n    : runtime_error([[error description] UTF8String]) {}\n};\n\nclass RCTObjcExecutor : public JSExecutor {\npublic:\n  RCTObjcExecutor(id<RCTJavaScriptExecutor> jse,\n                  RCTJavaScriptCompleteBlock errorBlock,\n                  std::shared_ptr<MessageQueueThread> jsThread,\n                  std::shared_ptr<ExecutorDelegate> delegate)\n    : m_jse(jse)\n    , m_errorBlock(errorBlock)\n    , m_jsThread(std::move(jsThread))\n    , m_delegate(std::move(delegate))\n  {\n    m_jsCallback = ^(id json, NSError *error) {\n      if (error) {\n        // Do not use \"m_errorBlock\" here as the bridge might be in the middle\n        // of invalidation as a result of error handling and \"this\" can be\n        // already deallocated.\n        errorBlock(error);\n        return;\n      }\n\n      m_jsThread->runOnQueue([this, json]{\n        m_delegate->callNativeModules(*this, convertIdToFollyDynamic(json), true);\n      });\n    };\n\n    // Synchronously initialize the executor\n    [jse setUp];\n\n    folly::dynamic nativeModuleConfig = folly::dynamic::array;\n    auto moduleRegistry = m_delegate->getModuleRegistry();\n    for (const auto &name : moduleRegistry->moduleNames()) {\n      auto config = moduleRegistry->getConfig(name);\n      nativeModuleConfig.push_back(config ? config->config : nullptr);\n    }\n\n    folly::dynamic config =\n      folly::dynamic::object(\"remoteModuleConfig\", std::move(nativeModuleConfig));\n\n    setGlobalVariable(\n      \"__fbBatchedBridgeConfig\",\n      std::make_unique<JSBigStdString>(folly::toJson(config)));\n  }\n\n  void loadApplicationScript(\n      std::unique_ptr<const JSBigString> script,\n      std::string sourceURL) override {\n    RCTProfileBeginFlowEvent();\n    [m_jse executeApplicationScript:[NSData dataWithBytes:script->c_str() length:script->size()]\n           sourceURL:[[NSURL alloc]\n                         initWithString:@(sourceURL.c_str())]\n           onComplete:^(NSError *error) {\n        RCTProfileEndFlowEvent();\n\n        if (error) {\n          m_errorBlock(error);\n          return;\n        }\n\n        [m_jse flushedQueue:m_jsCallback];\n      }];\n  }\n\n  void setBundleRegistry(std::unique_ptr<RAMBundleRegistry>) override {\n    RCTAssert(NO, @\"RAM bundles are not supported in RCTObjcExecutor\");\n  }\n\n  void registerBundle(uint32_t bundleId, const std::string &bundlePath) override {\n    RCTAssert(NO, @\"RAM bundles are not supported in RCTObjcExecutor\");\n  }\n\n  void callFunction(const std::string &module, const std::string &method,\n                    const folly::dynamic &arguments) override {\n    [m_jse callFunctionOnModule:@(module.c_str())\n           method:@(method.c_str())\n           arguments:convertFollyDynamicToId(arguments)\n           callback:m_jsCallback];\n  }\n\n  void invokeCallback(double callbackId, const folly::dynamic &arguments) override {\n    [m_jse invokeCallbackID:@(callbackId)\n           arguments:convertFollyDynamicToId(arguments)\n           callback:m_jsCallback];\n  }\n\n  virtual void setGlobalVariable(\n      std::string propName,\n      std::unique_ptr<const JSBigString> jsonValue) override {\n    [m_jse injectJSONText:@(jsonValue->c_str())\n           asGlobalObjectNamed:@(propName.c_str())\n           callback:m_errorBlock];\n  }\n\n  virtual std::string getDescription() override {\n    return [NSStringFromClass([m_jse class]) UTF8String];\n  }\n\nprivate:\n  id<RCTJavaScriptExecutor> m_jse;\n  RCTJavaScriptCompleteBlock m_errorBlock;\n  std::shared_ptr<ExecutorDelegate> m_delegate;\n  std::shared_ptr<MessageQueueThread> m_jsThread;\n  RCTJavaScriptCallback m_jsCallback;\n};\n\n}\n\nRCTObjcExecutorFactory::RCTObjcExecutorFactory(\n  id<RCTJavaScriptExecutor> jse, RCTJavaScriptCompleteBlock errorBlock)\n  : m_jse(jse)\n  , m_errorBlock(errorBlock) {}\n\nstd::unique_ptr<JSExecutor> RCTObjcExecutorFactory::createJSExecutor(\n    std::shared_ptr<ExecutorDelegate> delegate,\n    std::shared_ptr<MessageQueueThread> jsQueue) {\n  return std::unique_ptr<JSExecutor>(\n    new RCTObjcExecutor(m_jse, m_errorBlock, jsQueue, delegate));\n}\n\n}\n}\n"
  },
  {
    "path": "React/CxxModule/DispatchMessageQueueThread.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <React/RCTLog.h>\n#include <cxxreact/MessageQueueThread.h>\n\nnamespace facebook {\nnamespace react {\n\n// RCTNativeModule arranges for native methods to be invoked on a queue which\n// is not the JS thread.  C++ modules don't use RCTNativeModule, so this little\n// adapter does the work.\n\nclass DispatchMessageQueueThread : public MessageQueueThread {\npublic:\n  DispatchMessageQueueThread(RCTModuleData *moduleData)\n    : moduleData_(moduleData) {}\n\n  void runOnQueue(std::function<void()>&& func) override {\n    dispatch_queue_t queue = moduleData_.methodQueue;\n    dispatch_block_t block = [func=std::move(func)] { func(); };\n    RCTAssert(block != nullptr, @\"Invalid block generated in call to %@\", moduleData_);\n    if (queue && block) {\n      dispatch_async(queue, block);\n    }\n  }\n  void runOnQueueSync(std::function<void()>&& func) override {\n    LOG(FATAL) << \"Unsupported operation\";\n  }\n  void quitSynchronous() override {\n    LOG(FATAL) << \"Unsupported operation\";\n  }\n\nprivate:\n  RCTModuleData *moduleData_;\n};\n\n} }\n"
  },
  {
    "path": "React/CxxModule/RCTCxxMethod.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridgeMethod.h>\n#import <cxxreact/CxxModule.h>\n\n@interface RCTCxxMethod : NSObject <RCTBridgeMethod>\n\n- (instancetype)initWithCxxMethod:(const facebook::xplat::module::CxxModule::Method &)cxxMethod;\n\n@end\n"
  },
  {
    "path": "React/CxxModule/RCTCxxMethod.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTCxxMethod.h\"\n\n#import <React/RCTBridge+Private.h>\n#import <React/RCTBridge.h>\n#import <React/RCTConvert.h>\n#import <React/RCTFollyConvert.h>\n#import <cxxreact/JsArgumentHelpers.h>\n#import <folly/Memory.h>\n\n#import \"RCTCxxUtils.h\"\n\nusing facebook::xplat::module::CxxModule;\nusing namespace facebook::react;\n\n@implementation RCTCxxMethod\n{\n  std::unique_ptr<CxxModule::Method> _method;\n}\n\n- (instancetype)initWithCxxMethod:(const CxxModule::Method &)method\n{\n  if ((self = [super init])) {\n    _method = folly::make_unique<CxxModule::Method>(method);\n  }\n  return self;\n}\n\n- (const char *)JSMethodName\n{\n  return _method->name.c_str();\n}\n\n- (RCTFunctionType)functionType\n{\n  std::string type(_method->getType());\n  if (type == \"sync\") {\n    return RCTFunctionTypeSync;\n  } else if (type == \"async\") {\n    return RCTFunctionTypeNormal;\n  } else {\n    return RCTFunctionTypePromise;\n  }\n}\n\n- (id)invokeWithBridge:(RCTBridge *)bridge\n                module:(id)module\n             arguments:(NSArray *)arguments\n{\n  // module is unused except for printing errors. The C++ object it represents\n  // is also baked into _method.\n\n  // the last N arguments are callbacks, according to the Method data.  The\n  // preceding arguments are values whic have already been parsed from JS: they\n  // may be NSNumber (bool, int, double), NSString, NSArray, or NSObject.\n\n  CxxModule::Callback first;\n  CxxModule::Callback second;\n\n  if (arguments.count < _method->callbacks) {\n    RCTLogError(@\"Method %@.%s expects at least %zu arguments, but got %tu\",\n                RCTBridgeModuleNameForClass([module class]), _method->name.c_str(),\n                _method->callbacks, arguments.count);\n    return nil;\n  }\n\n  if (_method->callbacks >= 1) {\n    if (![arguments[arguments.count - 1] isKindOfClass:[NSNumber class]]) {\n      RCTLogError(@\"Argument %tu (%@) of %@.%s should be a function\",\n                  arguments.count - 1, arguments[arguments.count - 1],\n                  RCTBridgeModuleNameForClass([module class]), _method->name.c_str());\n      return nil;\n    }\n\n    NSNumber *id1;\n    if (_method->callbacks == 2) {\n      if (![arguments[arguments.count - 2] isKindOfClass:[NSNumber class]]) {\n        RCTLogError(@\"Argument %tu (%@) of %@.%s should be a function\",\n                    arguments.count - 2, arguments[arguments.count - 2],\n                    RCTBridgeModuleNameForClass([module class]), _method->name.c_str());\n        return nil;\n      }\n\n      id1 = arguments[arguments.count - 2];\n      NSNumber *id2 = arguments[arguments.count - 1];\n\n      second = ^(std::vector<folly::dynamic> args) {\n        [bridge enqueueCallback:id2 args:convertFollyDynamicToId(folly::dynamic(args.begin(), args.end()))];\n      };\n    } else {\n      id1 = arguments[arguments.count - 1];\n    }\n\n    first = ^(std::vector<folly::dynamic> args) {\n      [bridge enqueueCallback:id1 args:convertFollyDynamicToId(folly::dynamic(args.begin(), args.end()))];\n    };\n  }\n\n  folly::dynamic args = convertIdToFollyDynamic(arguments);\n  args.resize(args.size() - _method->callbacks);\n\n  try {\n    if (_method->func) {\n      _method->func(std::move(args), first, second);\n      return nil;\n    } else {\n      auto result = _method->syncFunc(std::move(args));\n      // TODO: we should convert this to JSValue directly\n      return convertFollyDynamicToId(result);\n    }\n  } catch (const facebook::xplat::JsArgumentException &ex) {\n    RCTLogError(@\"Method %@.%s argument error: %s\",\n                RCTBridgeModuleNameForClass([module class]), _method->name.c_str(),\n                ex.what());\n    return nil;\n  }\n}\n\n- (NSString *)description\n{\n  return [NSString stringWithFormat:@\"<%@: %p; name = %s>\", [self class], self, self.JSMethodName];\n}\n\n@end\n"
  },
  {
    "path": "React/CxxModule/RCTCxxModule.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <memory>\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridgeModule.h>\n\nnamespace facebook {\nnamespace xplat {\nnamespace module {\nclass CxxModule;\n}\n}\n}\n\n/**\n * Subclass RCTCxxModule to use cross-platform CxxModule on iOS.\n *\n * Subclasses must implement the createModule method to lazily produce the module. When running under the Cxx bridge\n * modules will be accessed directly, under the Objective-C bridge method access is wrapped through RCTCxxMethod.\n */\n@interface RCTCxxModule : NSObject <RCTBridgeModule>\n\n// To be implemented by subclasses\n- (std::unique_ptr<facebook::xplat::module::CxxModule>)createModule;\n\n@end\n"
  },
  {
    "path": "React/CxxModule/RCTCxxModule.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTCxxModule.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTFollyConvert.h>\n#import <React/RCTLog.h>\n#import <cxxreact/CxxModule.h>\n\n#import \"RCTCxxMethod.h\"\n\nusing namespace facebook::react;\n\n@implementation RCTCxxModule\n{\n  std::unique_ptr<facebook::xplat::module::CxxModule> _module;\n}\n\n+ (NSString *)moduleName\n{\n  return @\"\";\n}\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return NO;\n}\n\n- (void)lazyInit\n{\n  if (!_module) {\n    _module = [self createModule];\n\n    if (_module) {\n      RCTAssert([RCTBridgeModuleNameForClass([self class]) isEqualToString:@(_module->getName().c_str())],\n                @\"CxxModule class name %@ does not match runtime name %s\",\n                RCTBridgeModuleNameForClass([self class]), _module->getName().c_str());\n    }\n  }\n}\n\n- (std::unique_ptr<facebook::xplat::module::CxxModule>)createModule\n{\n  RCTAssert(NO, @\"Subclass %@ must override createModule\", [self class]);\n  return nullptr;\n}\n\n- (NSArray<id<RCTBridgeMethod>> *)methodsToExport;\n{\n  [self lazyInit];\n  if (!_module) {\n    return nil;\n  }\n\n  NSMutableArray *moduleMethods = [NSMutableArray new];\n  for (const auto &method : _module->getMethods()) {\n    [moduleMethods addObject:[[RCTCxxMethod alloc] initWithCxxMethod:method]];\n  }\n  return moduleMethods;\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport;\n{\n  [self lazyInit];\n  if (!_module) {\n    return nil;\n  }\n\n  NSMutableDictionary *moduleConstants = [NSMutableDictionary new];\n  for (const auto &c : _module->getConstants()) {\n    moduleConstants[@(c.first.c_str())] = convertFollyDynamicToId(c.second);\n  }\n  return moduleConstants;\n}\n\n@end\n"
  },
  {
    "path": "React/CxxModule/RCTCxxUtils.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <memory>\n\n#import <JavaScriptCore/JavaScriptCore.h>\n\n#import <cxxreact/JSCExecutor.h>\n#import <jschelpers/JavaScriptCore.h>\n\n@class RCTBridge;\n@class RCTModuleData;\n\nnamespace facebook {\nnamespace react {\n\nclass Instance;\n\nstd::vector<std::unique_ptr<NativeModule>> createNativeModules(NSArray<RCTModuleData *> *modules, RCTBridge *bridge, const std::shared_ptr<Instance> &instance);\n\nJSContext *contextForGlobalContextRef(JSGlobalContextRef contextRef);\n\ntemplate<>\nstruct JSCValueEncoder<id> {\n  static Value toJSCValue(JSGlobalContextRef ctx, id obj) {\n    JSValue *value = [JSC_JSValue(ctx) valueWithObject:obj inContext:contextForGlobalContextRef(ctx)];\n    return {ctx, [value JSValueRef]};\n  }\n};\n\nNSError *tryAndReturnError(const std::function<void()>& func);\nNSString *deriveSourceURL(NSURL *url);\n\n} }\n"
  },
  {
    "path": "React/CxxModule/RCTCxxUtils.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTCxxUtils.h\"\n\n#import <React/RCTFollyConvert.h>\n#import <React/RCTModuleData.h>\n#import <React/RCTUtils.h>\n#import <cxxreact/CxxNativeModule.h>\n#import <jschelpers/Value.h>\n\n#import \"DispatchMessageQueueThread.h\"\n#import \"RCTCxxModule.h\"\n#import \"RCTNativeModule.h\"\n\nnamespace facebook {\nnamespace react {\n\nstd::vector<std::unique_ptr<NativeModule>> createNativeModules(NSArray<RCTModuleData *> *modules, RCTBridge *bridge, const std::shared_ptr<Instance> &instance)\n{\n  std::vector<std::unique_ptr<NativeModule>> nativeModules;\n  for (RCTModuleData *moduleData in modules) {\n    if ([moduleData.moduleClass isSubclassOfClass:[RCTCxxModule class]]) {\n      nativeModules.emplace_back(std::make_unique<CxxNativeModule>(\n        instance,\n        [moduleData.name UTF8String],\n        [moduleData] { return [(RCTCxxModule *)(moduleData.instance) createModule]; },\n        std::make_shared<DispatchMessageQueueThread>(moduleData)));\n    } else {\n      nativeModules.emplace_back(std::make_unique<RCTNativeModule>(bridge, moduleData));\n    }\n  }\n  return nativeModules;\n}\n\nJSContext *contextForGlobalContextRef(JSGlobalContextRef contextRef)\n{\n  static std::mutex s_mutex;\n  static NSMapTable *s_contextCache;\n\n  if (!contextRef) {\n    return nil;\n  }\n\n  // Adding our own lock here, since JSC internal ones are insufficient\n  std::lock_guard<std::mutex> lock(s_mutex);\n  if (!s_contextCache) {\n    NSPointerFunctionsOptions keyOptions = NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality;\n    NSPointerFunctionsOptions valueOptions = NSPointerFunctionsWeakMemory | NSPointerFunctionsObjectPersonality;\n    s_contextCache = [[NSMapTable alloc] initWithKeyOptions:keyOptions valueOptions:valueOptions capacity:0];\n  }\n\n  JSContext *ctx = [s_contextCache objectForKey:(__bridge id)contextRef];\n  if (!ctx) {\n    ctx = [JSC_JSContext(contextRef) contextWithJSGlobalContextRef:contextRef];\n    [s_contextCache setObject:ctx forKey:(__bridge id)contextRef];\n  }\n  return ctx;\n}\n\nstatic NSError *errorWithException(const std::exception &e)\n{\n  NSString *msg = @(e.what());\n  NSMutableDictionary *errorInfo = [NSMutableDictionary dictionary];\n\n  const JSException *jsException = dynamic_cast<const JSException*>(&e);\n  if (jsException) {\n    errorInfo[RCTJSRawStackTraceKey] = @(jsException->getStack().c_str());\n    msg = [@\"Unhandled JS Exception: \" stringByAppendingString:msg];\n  }\n\n  NSError *nestedError;\n  try {\n    std::rethrow_if_nested(e);\n  } catch(const std::exception &e) {\n    nestedError = errorWithException(e);\n  } catch(...) {}\n\n  if (nestedError) {\n    msg = [NSString stringWithFormat:@\"%@\\n\\n%@\", msg, [nestedError localizedDescription]];\n  }\n\n  errorInfo[NSLocalizedDescriptionKey] = msg;\n  return [NSError errorWithDomain:RCTErrorDomain code:1 userInfo:errorInfo];\n}\n\nNSError *tryAndReturnError(const std::function<void()>& func)\n{\n  try {\n    @try {\n      func();\n      return nil;\n    }\n    @catch (NSException *exception) {\n      NSString *message =\n      [NSString stringWithFormat:@\"Exception '%@' was thrown from JS thread\", exception];\n      return RCTErrorWithMessage(message);\n    }\n    @catch (id exception) {\n      // This will catch any other ObjC exception, but no C++ exceptions\n      return RCTErrorWithMessage(@\"non-std ObjC Exception\");\n    }\n  } catch (const std::exception &ex) {\n    return errorWithException(ex);\n  } catch (...) {\n    // On a 64-bit platform, this would catch ObjC exceptions, too, but not on\n    // 32-bit platforms, so we catch those with id exceptions above.\n    return RCTErrorWithMessage(@\"non-std C++ exception\");\n  }\n}\n\nNSString *deriveSourceURL(NSURL *url)\n{\n  NSString *sourceUrl;\n  if (url.isFileURL) {\n    // Url will contain only path to resource (i.g. file:// will be removed)\n    sourceUrl = url.path;\n  } else {\n    // Url will include protocol (e.g. http://)\n    sourceUrl = url.absoluteString;\n  }\n  return sourceUrl ?: @\"\";\n}\n\n} }\n"
  },
  {
    "path": "React/CxxModule/RCTNativeModule.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTModuleData.h>\n#import <cxxreact/NativeModule.h>\n\nnamespace facebook {\nnamespace react {\n\nclass RCTNativeModule : public NativeModule {\n public:\n  RCTNativeModule(RCTBridge *bridge, RCTModuleData *moduleData);\n\n  std::string getName() override;\n  std::vector<MethodDescriptor> getMethods() override;\n  folly::dynamic getConstants() override;\n  void invoke(unsigned int methodId, folly::dynamic &&params, int callId) override;\n  MethodCallResult callSerializableNativeHook(unsigned int reactMethodId, folly::dynamic &&params) override;\n\n private:\n  __weak RCTBridge *m_bridge;\n  RCTModuleData *m_moduleData;\n};\n\n}\n}\n"
  },
  {
    "path": "React/CxxModule/RCTNativeModule.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTNativeModule.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTBridgeMethod.h>\n#import <React/RCTBridgeModule.h>\n#import <React/RCTCxxUtils.h>\n#import <React/RCTFollyConvert.h>\n#import <React/RCTLog.h>\n#import <React/RCTProfile.h>\n#import <React/RCTUtils.h>\n\n#ifdef WITH_FBSYSTRACE\n#include <fbsystrace.h>\n#endif\n\nnamespace facebook {\nnamespace react {\n\nstatic MethodCallResult invokeInner(RCTBridge *bridge, RCTModuleData *moduleData, unsigned int methodId, const folly::dynamic &params);\n\nRCTNativeModule::RCTNativeModule(RCTBridge *bridge, RCTModuleData *moduleData)\n    : m_bridge(bridge)\n    , m_moduleData(moduleData) {}\n\nstd::string RCTNativeModule::getName() {\n  return [m_moduleData.name UTF8String];\n}\n\nstd::vector<MethodDescriptor> RCTNativeModule::getMethods() {\n  std::vector<MethodDescriptor> descs;\n\n  for (id<RCTBridgeMethod> method in m_moduleData.methods) {\n    descs.emplace_back(\n      method.JSMethodName,\n      RCTFunctionDescriptorFromType(method.functionType)\n    );\n  }\n\n  return descs;\n}\n\nfolly::dynamic RCTNativeModule::getConstants() {\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways,\n    @\"[RCTNativeModule getConstants] moduleData.exportedConstants\", nil);\n  NSDictionary *constants = m_moduleData.exportedConstants;\n  folly::dynamic ret = convertIdToFollyDynamic(constants);\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n  return ret;\n}\n\nvoid RCTNativeModule::invoke(unsigned int methodId, folly::dynamic &&params, int callId) {\n  // capture by weak pointer so that we can safely use these variables in a callback\n  __weak RCTBridge *weakBridge = m_bridge;\n  __weak RCTModuleData *weakModuleData = m_moduleData;\n  // The BatchedBridge version of this buckets all the callbacks by thread, and\n  // queues one block on each.  This is much simpler; we'll see how it goes and\n  // iterate.\n  dispatch_block_t block = [weakBridge, weakModuleData, methodId, params=std::move(params), callId] {\n    #ifdef WITH_FBSYSTRACE\n    if (callId != -1) {\n      fbsystrace_end_async_flow(TRACE_TAG_REACT_APPS, \"native\", callId);\n    }\n    #endif\n    invokeInner(weakBridge, weakModuleData, methodId, std::move(params));\n  };\n\n  dispatch_queue_t queue = m_moduleData.methodQueue;\n  if (queue == RCTJSThread) {\n    block();\n  } else if (queue) {\n    dispatch_async(queue, block);\n  }\n}\n\nMethodCallResult RCTNativeModule::callSerializableNativeHook(unsigned int reactMethodId, folly::dynamic &&params) {\n  return invokeInner(m_bridge, m_moduleData, reactMethodId, params);\n}\n\nstatic MethodCallResult invokeInner(RCTBridge *bridge, RCTModuleData *moduleData, unsigned int methodId, const folly::dynamic &params) {\n  if (!bridge || !bridge.valid || !moduleData) {\n    return folly::none;\n  }\n\n  id<RCTBridgeMethod> method = moduleData.methods[methodId];\n  if (RCT_DEBUG && !method) {\n    RCTLogError(@\"Unknown methodID: %ud for module: %@\",\n                methodId, moduleData.name);\n  }\n\n  NSArray *objcParams = convertFollyDynamicToId(params);\n  @try {\n    id result = [method invokeWithBridge:bridge module:moduleData.instance arguments:objcParams];\n    return convertIdToFollyDynamic(result);\n  }\n  @catch (NSException *exception) {\n    // Pass on JS exceptions\n    if ([exception.name hasPrefix:RCTFatalExceptionName]) {\n      @throw exception;\n    }\n\n    NSString *message = [NSString stringWithFormat:\n                         @\"Exception '%@' was thrown while invoking %s on target %@ with params %@\\ncallstack: %@\",\n                         exception, method.JSMethodName, moduleData.name, objcParams, exception.callStackSymbols];\n    RCTFatal(RCTErrorWithMessage(message));\n  }\n\n  return folly::none;\n}\n\n}\n}\n"
  },
  {
    "path": "React/CxxUtils/RCTFollyConvert.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#include <folly/dynamic.h>\n\nnamespace facebook {\nnamespace react {\n\nfolly::dynamic convertIdToFollyDynamic(id json);\nid convertFollyDynamicToId(const folly::dynamic &dyn);\n\n} }\n"
  },
  {
    "path": "React/CxxUtils/RCTFollyConvert.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTFollyConvert.h\"\n\n#import <objc/runtime.h>\n\nnamespace facebook {\nnamespace react {\n\nid convertFollyDynamicToId(const folly::dynamic &dyn) {\n  // I could imagine an implementation which avoids copies by wrapping the\n  // dynamic in a derived class of NSDictionary.  We can do that if profiling\n  // implies it will help.\n\n  switch (dyn.type()) {\n    case folly::dynamic::NULLT:\n      return (id)kCFNull;\n    case folly::dynamic::BOOL:\n      return dyn.getBool() ? @YES : @NO;\n    case folly::dynamic::INT64:\n      return @(dyn.getInt());\n    case folly::dynamic::DOUBLE:\n      return @(dyn.getDouble());\n    case folly::dynamic::STRING:\n      return [[NSString alloc] initWithBytes:dyn.c_str() length:dyn.size()\n                                   encoding:NSUTF8StringEncoding];\n    case folly::dynamic::ARRAY: {\n      NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:dyn.size()];\n      for (auto &elem : dyn) {\n        [array addObject:convertFollyDynamicToId(elem)];\n      }\n      return array;\n    }\n    case folly::dynamic::OBJECT: {\n      NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:dyn.size()];\n      for (auto &elem : dyn.items()) {\n        dict[convertFollyDynamicToId(elem.first)] = convertFollyDynamicToId(elem.second);\n      }\n      return dict;\n    }\n  }\n}\n\nfolly::dynamic convertIdToFollyDynamic(id json)\n{\n  if (json == nil || json == (id)kCFNull) {\n    return nullptr;\n  } else if ([json isKindOfClass:[NSNumber class]]) {\n    const char *objCType = [json objCType];\n    switch (objCType[0]) {\n      // This is a c++ bool or C99 _Bool.  On some platforms, BOOL is a bool.\n      case _C_BOOL:\n        return (bool) [json boolValue];\n      case _C_CHR:\n        // On some platforms, objc BOOL is a signed char, but it\n        // might also be a small number.  Use the same hack JSC uses\n        // to distinguish them:\n        // https://phabricator.intern.facebook.com/diffusion/FBS/browse/master/fbobjc/xplat/third-party/jsc/safari-600-1-4-17/JavaScriptCore/API/JSValue.mm;b8ee03916489f8b12143cd5c0bca546da5014fc9$901\n        if ([json isKindOfClass:[@YES class]]) {\n          return (bool) [json boolValue];\n        } else {\n          return [json longLongValue];\n        }\n      case _C_UCHR:\n      case _C_SHT:\n      case _C_USHT:\n      case _C_INT:\n      case _C_UINT:\n      case _C_LNG:\n      case _C_ULNG:\n      case _C_LNG_LNG:\n      case _C_ULNG_LNG:\n        return [json longLongValue];\n\n      case _C_FLT:\n      case _C_DBL:\n        return [json doubleValue];\n\n      // default:\n      //   fall through\n    }\n  } else if ([json isKindOfClass:[NSString class]]) {\n    NSData *data = [json dataUsingEncoding:NSUTF8StringEncoding];\n    return std::string(reinterpret_cast<const char*>(data.bytes),\n                       data.length);\n  } else if ([json isKindOfClass:[NSArray class]]) {\n    folly::dynamic array = folly::dynamic::array;\n    for (id element in json) {\n      array.push_back(convertIdToFollyDynamic(element));\n    }\n    return array;\n  } else if ([json isKindOfClass:[NSDictionary class]]) {\n    __block folly::dynamic object = folly::dynamic::object();\n\n    [json enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, __unused BOOL *stop) {\n      object.insert(convertIdToFollyDynamic(key),\n                    convertIdToFollyDynamic(value));\n      }];\n\n    return object;\n  }\n\n  return nil;\n}\n\n} }\n"
  },
  {
    "path": "React/DevSupport/RCTDevLoadingView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridgeModule.h>\n\n@class RCTLoadingProgress;\n\n@interface RCTDevLoadingView : NSObject <RCTBridgeModule>\n\n+ (void)setEnabled:(BOOL)enabled;\n- (void)showWithURL:(NSURL *)URL;\n- (void)updateProgress:(RCTLoadingProgress *)progress;\n- (void)hide;\n\n@end\n"
  },
  {
    "path": "React/DevSupport/RCTDevLoadingView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDevLoadingView.h\"\n\n#import <QuartzCore/QuartzCore.h>\n#import <AppKit/AppKit.h>\n#import \"RCTBridge.h\"\n#import \"RCTDefines.h\"\n#import \"RCTModalHostViewController.h\"\n#import \"RCTUtils.h\"\n\n\n#if RCT_DEV\n\nstatic BOOL isEnabled = YES;\n\n@implementation RCTDevLoadingView\n{\n  NSWindow *_window;\n  NSTextField *_label;\n  NSView *_back;\n  NSDate *_showDate;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n+ (void)setEnabled:(BOOL)enabled\n{\n  isEnabled = enabled;\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES;\n}\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  _bridge = bridge;\n\n  [[NSNotificationCenter defaultCenter] addObserver:self\n                                           selector:@selector(hide)\n                                               name:RCTJavaScriptDidLoadNotification\n                                             object:nil];\n  [[NSNotificationCenter defaultCenter] addObserver:self\n                                           selector:@selector(hide)\n                                               name:RCTJavaScriptDidFailToLoadNotification\n                                             object:nil];\n\n  if (bridge.loading) {\n    [self showWithURL:bridge.bundleURL];\n  }\n}\n\nRCT_EXPORT_METHOD(showMessage:(NSString *)message color:(NSColor *)color backgroundColor:(NSColor *)backgroundColor)\n{\n  if (!isEnabled) {\n    return;\n  }\n\n  dispatch_async(dispatch_get_main_queue(), ^{\n    _showDate = [NSDate date];\n    if (!_window && !RCTRunningInTestEnvironment()) {\n      CGFloat screenWidth = [NSScreen mainScreen].frame.size.width;\n      _window = [[NSWindow alloc]\n                 initWithContentRect:CGRectMake(0, 0, screenWidth, 50)\n                 styleMask:0\n                 backing:NSBackingStoreBuffered\n                 defer:NO];\n\n      CGRect frame = _window.frame;\n      frame.origin.y = -10;\n      [_window setOpaque:YES];\n      [_window setAlphaValue:0.9];\n      [_window setBackgroundColor:backgroundColor];\n      [_window setLevel:NSScreenSaverWindowLevel + 1];\n\n      _label = [[NSTextField alloc] initWithFrame:frame];\n      _label.font = [NSFont systemFontOfSize:22.0];\n      _label.textColor = color;\n      _label.bordered = NO;\n      _label.editable = NO;\n      _label.selectable = NO;\n      [_label setBackgroundColor:[NSColor clearColor]];\n      [_label setAlignment:NSCenterTextAlignment];\n      _back = [[NSView alloc] initWithFrame:_window.frame];\n      [_back.layer setBackgroundColor:[backgroundColor CGColor]];\n      [_back addSubview:_label];\n      [_window setContentView:_back];\n      [_window makeKeyAndOrderFront:nil];\n    }\n\n\n    [_label setStringValue:message];\n    //[_label setTextColor:color];\n    [_label setBackgroundColor:backgroundColor];\n    [_back.layer setBackgroundColor:[backgroundColor CGColor]];\n\n  });\n}\n\nRCT_EXPORT_METHOD(hide)\n{\n  if (!isEnabled) {\n    return;\n  }\n\n  dispatch_async(dispatch_get_main_queue(), ^{\n    const NSTimeInterval MIN_PRESENTED_TIME = 0.6;\n    NSTimeInterval presentedTime = [[NSDate date] timeIntervalSinceDate:self->_showDate];\n    NSTimeInterval delay = MAX(0, MIN_PRESENTED_TIME - presentedTime);\n    [NSThread sleepForTimeInterval:delay]; // blocking the thread\n    CGRect windowFrame = _window.frame;\n\n    [NSAnimationContext beginGrouping];\n    [[NSAnimationContext currentContext] setDuration:0.35];\n    [[_window animator] setFrame: CGRectOffset(windowFrame, 0, -windowFrame.size.height) display:YES animate:YES];\n    [NSAnimationContext endGrouping];\n    \n    _window = nil;\n    \n\n  });\n}\n\n- (void)showWithURL:(NSURL *)URL\n{\n  NSColor *color;\n  NSColor *backgroundColor;\n  NSString *source;\n  if (URL.fileURL) {\n    color = [NSColor grayColor];\n    backgroundColor = [NSColor blackColor];\n    source = @\"pre-bundled file\";\n  } else {\n    color = [NSColor whiteColor];\n    backgroundColor = [NSColor colorWithHue:1./3 saturation:1 brightness:.35 alpha:1];\n    source = [NSString stringWithFormat:@\"%@:%@\", URL.host, URL.port];\n  }\n\n  [self showMessage:[NSString stringWithFormat:@\"Loading from %@...\", source]\n              color:color\n    backgroundColor:backgroundColor];\n}\n\n- (void)updateProgress:(RCTLoadingProgress *)progress\n{\n  if (!progress) {\n    return;\n  }\n  dispatch_async(dispatch_get_main_queue(), ^{\n      [_label setStringValue:[progress description]];\n  });\n}\n\n- (void)invalidate\n{\n  dispatch_async(dispatch_get_main_queue(), ^{\n    [_window setFrame: CGRectOffset(_window.frame, 0, -_window.frame.size.height) display:NO animate:NO];\n    _window = nil;\n  });\n}\n\n@end\n\n#else\n\n@implementation RCTDevLoadingView\n\n+ (NSString *)moduleName { return nil; }\n+ (void)setEnabled:(BOOL)enabled { }\n- (void)showWithURL:(NSURL *)URL { }\n- (void)updateProgress:(RCTLoadingProgress *)progress { }\n- (void)hide { }\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/DevSupport/RCTDevMenu.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBridge.h>\n#import <React/RCTBridgeModule.h>\n\n#if RCT_DEV\n\nRCT_EXTERN NSString *const RCTShowDevMenuNotification;\n\n#endif\n\n\n@class RCTDevMenuItem;\n\n/**\n * Developer menu, useful for exposing extra functionality when debugging.\n */\n@interface RCTDevMenu : NSObject\n\n/**\n * Deprecated, use RCTDevSettings instead.\n */\n@property (nonatomic, assign) BOOL shakeToShow DEPRECATED_ATTRIBUTE;\n\n/**\n * Deprecated, use RCTDevSettings instead.\n */\n@property (nonatomic, assign) BOOL profilingEnabled DEPRECATED_ATTRIBUTE;\n\n/**\n * Deprecated, use RCTDevSettings instead.\n */\n@property (nonatomic, assign) BOOL liveReloadEnabled DEPRECATED_ATTRIBUTE;\n\n/**\n * Deprecated, use RCTDevSettings instead.\n */\n@property (nonatomic, assign) BOOL hotLoadingEnabled DEPRECATED_ATTRIBUTE;\n\n/**\n * Presented items in development menu\n */\n@property (nonatomic, copy, readonly) NSArray<RCTDevMenuItem *> *presentedItems;\n\n/**\n * Detect if actions sheet (development menu) is shown\n */\n- (BOOL)isActionSheetShown;\n\n/**\n * Manually show the dev menu (can be called from JS).\n */\n- (void)show;\n\n/**\n * Deprecated, use -[RCTBRidge reload] instead.\n */\n- (void)reload DEPRECATED_ATTRIBUTE;\n\n/**\n * Deprecated. Use the `-addItem:` method instead.\n */\n- (void)addItem:(NSString *)title\n        handler:(void(^)(void))handler DEPRECATED_ATTRIBUTE;\n\n/**\n * Add custom item to the development menu. The handler will be called\n * when user selects the item.\n */\n- (void)addItem:(RCTDevMenuItem *)item;\n\n/**\n * Update setting\n */\n- (void)updateSetting:(NSString *)name value:(id)value;\n\n@end\n\ntypedef NSString *(^RCTDevMenuItemTitleBlock)(void);\n\n/**\n * Developer menu item, used to expose additional functionality via the menu.\n */\n@interface RCTDevMenuItem : NSMenuItem\n\n/**\n * This creates an item with a simple push-button interface, used to trigger an\n * action.\n */\n+ (instancetype)buttonItemWithTitle:(NSString *)title\n                             hotkey:(NSString *)hotkey\n                            handler:(dispatch_block_t)handler;\n\n+ (instancetype)buttonItemWithTitle:(NSString *)title\n                            handler:(dispatch_block_t)handler;\n\n/**\n * This creates an item with a simple push-button interface, used to trigger an\n * action. getTitleForPresentation is called each time the item is about to be\n * presented, and should return the item's title.\n */\n+ (instancetype)buttonItemWithTitleBlock:(RCTDevMenuItemTitleBlock)titleBlock\n                                  hotkey:(NSString *)hotkey\n                                 handler:(dispatch_block_t)handler;\n\n+ (instancetype)buttonItemWithTitleBlock:(RCTDevMenuItemTitleBlock)titleBlock\n                                 handler:(dispatch_block_t)handler;\n\n@end\n\n/**\n * This category makes the developer menu instance available via the\n * RCTBridge, which is useful for any class that needs to access the menu.\n */\n@interface RCTBridge (RCTDevMenu)\n\n@property (nonatomic, readonly) RCTDevMenu *devMenu;\n\n@end\n"
  },
  {
    "path": "React/DevSupport/RCTDevMenu.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDevMenu.h\"\n\n#import \"RCTBridge+Private.h\"\n#import \"RCTDevSettings.h\"\n#import \"RCTKeyCommands.h\"\n#import \"RCTLog.h\"\n#import \"RCTUtils.h\"\n\n#define RCT_DEVMENU_TITLE @\"React Native\"\n\n#if RCT_DEV\n\n#if RCT_ENABLE_INSPECTOR\n#import \"RCTInspectorDevServerHelper.h\"\n#endif\n\nNSString *const RCTShowDevMenuNotification = @\"RCTShowDevMenuNotification\";\n\n@interface RCTDevMenuItem ()\n\n@property (nonatomic, copy, readonly) NSString *key;\n@property (nonatomic, copy) id value;\n@property (nonatomic, copy) NSString *hotKey;\n\n- (void)callHandler;\n\n@end\n\n@implementation RCTDevMenuItem\n{\n  RCTDevMenuItemTitleBlock _titleBlock;\n  dispatch_block_t _handler;\n}\n\n- (instancetype)initWithTitleBlock:(RCTDevMenuItemTitleBlock)titleBlock\n                           hotkey:(NSString *)hotkey\n                           handler:(dispatch_block_t)handler\n{\n  if ((self = [super init])) {\n    _titleBlock = [titleBlock copy];\n    _handler = [handler copy];\n    [self setAction:@selector(callHandler)];\n    [self setTarget:self];\n    [self setKeyEquivalent:hotkey];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n+ (instancetype)buttonItemWithTitleBlock:(NSString *(^)(void))titleBlock\n                                  hotkey:(NSString *)hotkey\n                                 handler:(dispatch_block_t)handler\n{\n  return [[self alloc] initWithTitleBlock:titleBlock hotkey:hotkey handler:handler];\n}\n\n+ (instancetype)buttonItemWithTitleBlock:(NSString *(^)(void))titleBlock\n                                 handler:(dispatch_block_t)handler\n{\n  return [[self alloc] initWithTitleBlock:titleBlock hotkey:@\"\" handler:handler];\n}\n\n+ (instancetype)buttonItemWithTitle:(NSString *)title\n                             hotkey:(NSString *)hotkey\n                            handler:(dispatch_block_t)handler\n{\n  return [[self alloc] initWithTitleBlock:^NSString *{ return title; } hotkey:hotkey handler:handler];\n}\n\n+ (instancetype)buttonItemWithTitle:(NSString *)title\n                            handler:(dispatch_block_t)handler\n{\n  return [[self alloc] initWithTitleBlock:^NSString *{ return title; } hotkey:@\"\" handler:handler];\n}\n\n- (void)callHandler\n{\n  if (_handler) {\n    _handler();\n  }\n}\n\n- (NSString *)title\n{\n  if (_titleBlock) {\n    return _titleBlock();\n  }\n  return nil;\n}\n\n@end\n\n@interface RCTDevMenu () <RCTBridgeModule, RCTInvalidating>\n\n@end\n\n@implementation RCTDevMenu\n{\n  NSMutableArray<RCTDevMenuItem *> *_extraMenuItems;\n  BOOL isShown;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n+ (void)initialize\n{\n  // We're swizzling here because it's poor form to override methods in a category,\n  // however UIWindow doesn't actually implement motionEnded:withEvent:, so there's\n  // no need to call the original implementation.\n  // RCTSwapInstanceMethods([UIWindow class], @selector(motionEnded:withEvent:), @selector(RCT_motionEnded:withEvent:));\n}\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES;\n}\n\n- (instancetype)init\n{\n  if ((self = [super init])) {\n    isShown = NO;\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(showOnShake)\n                                                 name:RCTShowDevMenuNotification\n                                               object:nil];\n    _extraMenuItems = [NSMutableArray new];\n\n#if DEBUG\n    RCTKeyCommands *commands = [RCTKeyCommands sharedInstance];\n    __weak __typeof(self) weakSelf = self;\n    // Toggle debug menu\n    [commands registerKeyCommandWithInput:@\"d\"\n                            modifierFlags:NSEventModifierFlagCommand\n                                   action:^(__unused NSEvent *command) {\n                                     [weakSelf toggle];\n                                   }];\n\n    // Toggle element inspector\n    [commands registerKeyCommandWithInput:@\"i\"\n                            modifierFlags:NSEventModifierFlagCommand\n                                   action:^(__unused NSEvent *command) {\n                                     [weakSelf.bridge.devSettings toggleElementInspector];\n                                   }];\n\n    // Reload in normal mode\n    [commands registerKeyCommandWithInput:@\"n\"\n                            modifierFlags:NSEventModifierFlagCommand\n                                   action:^(__unused NSEvent *command) {\n                                     [weakSelf.bridge.devSettings setIsDebuggingRemotely:NO];\n                                   }];\n\n#endif\n  }\n  return self;\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n- (void)invalidate\n{\n  _presentedItems = nil;\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (void)showOnShake\n{\n  if ([_bridge.devSettings isShakeToShowDevMenuEnabled]) {\n    [self show];\n  }\n}\n\n- (BOOL)isActionSheetShown\n{\n  return isShown;\n}\n\n- (void)toggle\n{\n  // TODO: add invalidating/hiding\n  [self show];\n}\n\n- (void)addItem:(NSString *)title handler:(void(^)(void))handler\n{\n  [self addItem:[RCTDevMenuItem buttonItemWithTitle:title handler:handler]];\n}\n\n- (void)addItem:(RCTDevMenuItem *)item\n{\n  [_extraMenuItems addObject:item];\n}\n\n- (NSArray<RCTDevMenuItem *> *)_menuItemsToPresent\n{\n  NSMutableArray<RCTDevMenuItem *> *items = [NSMutableArray new];\n\n  // Add built-in items\n  __weak RCTBridge *bridge = _bridge;\n  __weak RCTDevSettings *devSettings = _bridge.devSettings;\n\n  [items addObject:[RCTDevMenuItem buttonItemWithTitle:@\"Reload\"  hotkey:@\"r\" handler:^{\n    [bridge reload];\n  }]];\n\n  if (devSettings.isNuclideDebuggingAvailable) {\n    [items addObject:[RCTDevMenuItem buttonItemWithTitle:[NSString stringWithFormat:@\"Debug JS in Nuclide %@\", @\"\\U0001F4AF\"] handler:^{\n#if RCT_ENABLE_INSPECTOR\n      [RCTInspectorDevServerHelper attachDebugger:@\"ReactNative\" withBundleURL:bridge.bundleURL withView: RCTPresentedViewController()];\n#endif\n    }]];\n  }\n\n  if (!devSettings.isRemoteDebuggingAvailable) {\n    [items addObject:[RCTDevMenuItem buttonItemWithTitle:@\"Remote JS Debugger Unavailable\" handler:^{\n      NSAlert *alert = RCTAlertView(@\"Remote JS Debugger Unavailable\",\n                                    @\"You need to include the RCTWebSocket library to enable remote JS debugging\",\n                                    nil,\n                                    @\"OK\",\n                                    nil);\n      [alert runModal];\n    }]];\n  } else {\n    [items addObject:[RCTDevMenuItem buttonItemWithTitleBlock:^NSString *{\n      NSString *title = devSettings.isDebuggingRemotely ? @\"Stop Remote JS Debugging\" : @\"Debug JS Remotely\";\n      if (devSettings.isNuclideDebuggingAvailable) {\n        return [NSString stringWithFormat:@\"%@ %@\", title, @\"\\U0001F645\"];\n      } else {\n        return title;\n      }\n    }\n                                                       hotkey:@\"R\"\n                                                      handler:^{\n      devSettings.isDebuggingRemotely = !devSettings.isDebuggingRemotely;\n      [self show];\n    }]];\n  }\n\n  if (devSettings.isLiveReloadAvailable) {\n    [items addObject:[RCTDevMenuItem buttonItemWithTitleBlock:^NSString *{\n      return devSettings.isLiveReloadEnabled ? @\"Disable Live Reload\" : @\"Enable Live Reload\";\n    } handler:^{\n      devSettings.isLiveReloadEnabled = !devSettings.isLiveReloadEnabled;\n      [self show];\n    }]];\n    [items addObject:[RCTDevMenuItem buttonItemWithTitleBlock:^NSString *{\n      return devSettings.isProfilingEnabled ? @\"Stop Systrace\" : @\"Start Systrace\";\n    } handler:^{\n      devSettings.isProfilingEnabled = !devSettings.isProfilingEnabled;\n      [self show];\n    }]];\n  }\n\n  if (_bridge.devSettings.isHotLoadingAvailable) {\n    [items addObject:[RCTDevMenuItem buttonItemWithTitleBlock:^NSString *{\n      return devSettings.isHotLoadingEnabled ? @\"Disable Hot Reloading\" : @\"Enable Hot Reloading\";\n    } handler:^{\n      devSettings.isHotLoadingEnabled = !devSettings.isHotLoadingEnabled;\n      [self show];\n    }]];\n  }\n\n  if (devSettings.isJSCSamplingProfilerAvailable) {\n    // Note: bridge.jsContext is not implemented in the old bridge, so this code is\n    // duplicated in RCTJSCExecutor\n    [items addObject:[RCTDevMenuItem buttonItemWithTitle:@\"Start / Stop JS Sampling Profiler\" handler:^{\n      [devSettings toggleJSCSamplingProfiler];\n      [self show];\n    }]];\n  }\n\n  [items addObject:[RCTDevMenuItem buttonItemWithTitleBlock:^NSString *{\n    return @\"Toggle Inspector\";\n  } handler:^{\n    [devSettings toggleElementInspector];\n    [self show];\n  }]];\n\n  [items addObjectsFromArray:_extraMenuItems];\n  return items;\n}\n\n// TODO: Use Unified Menu API, update settings, update menu titles\n- (NSMenu *)getDeveloperMenu\n{\n  if ([[NSApp mainMenu] indexOfItemWithTitle:RCT_DEVMENU_TITLE] > -1) {\n    return [[NSApp mainMenu] itemWithTitle:RCT_DEVMENU_TITLE].submenu;\n  } else {\n    NSMenuItem *developerItemContainer = [[NSMenuItem alloc] init];\n    NSMenu *developerMenu = [[NSMenu alloc] initWithTitle:RCT_DEVMENU_TITLE];\n    developerItemContainer.title = RCT_DEVMENU_TITLE;\n    [[NSApp mainMenu] addItem:developerItemContainer];\n    [[NSApp mainMenu] setSubmenu:developerMenu forItem:developerItemContainer];\n    return developerMenu;\n  }\n}\n\n\n\nRCT_EXPORT_METHOD(show)\n{\n  if (!_bridge || RCTRunningInAppExtension()) {\n    return;\n  }\n\n  isShown = YES;\n\n  NSArray<RCTDevMenuItem *> *items = [self _menuItemsToPresent];\n  NSMenu *developerMenu = [self getDeveloperMenu];\n  [developerMenu removeAllItems];\n  for (RCTDevMenuItem *item in items) {\n    [developerMenu addItem:item];\n  }\n\n  _presentedItems = items;\n}\n\n//- (RCTDevMenuAlertActionHandler)alertActionHandlerForDevItem:(RCTDevMenuItem *__nullable)item\n//{\n//  return ^(__unused UIAlertAction *action) {\n//    if (item) {\n//      [item callHandler];\n//    }\n//\n//    self->_actionSheet = nil;\n//  };\n//}\n\n#pragma mark - deprecated methods and properties\n\n#define WARN_DEPRECATED_DEV_MENU_EXPORT() RCTLogWarn(@\"Using deprecated method %s, use RCTDevSettings instead\", __func__)\n\n- (void)setShakeToShow:(BOOL)shakeToShow\n{\n  _bridge.devSettings.isShakeToShowDevMenuEnabled = shakeToShow;\n}\n\n- (BOOL)shakeToShow\n{\n  return _bridge.devSettings.isShakeToShowDevMenuEnabled;\n}\n\nRCT_EXPORT_METHOD(reload)\n{\n  WARN_DEPRECATED_DEV_MENU_EXPORT();\n  [_bridge reload];\n}\n\nRCT_EXPORT_METHOD(debugRemotely:(BOOL)enableDebug)\n{\n  WARN_DEPRECATED_DEV_MENU_EXPORT();\n  _bridge.devSettings.isDebuggingRemotely = enableDebug;\n}\n\nRCT_EXPORT_METHOD(setProfilingEnabled:(BOOL)enabled)\n{\n  WARN_DEPRECATED_DEV_MENU_EXPORT();\n  _bridge.devSettings.isProfilingEnabled = enabled;\n}\n\n- (BOOL)profilingEnabled\n{\n  return _bridge.devSettings.isProfilingEnabled;\n}\n\nRCT_EXPORT_METHOD(setLiveReloadEnabled:(BOOL)enabled)\n{\n  WARN_DEPRECATED_DEV_MENU_EXPORT();\n  _bridge.devSettings.isLiveReloadEnabled = enabled;\n}\n\n- (BOOL)liveReloadEnabled\n{\n  return _bridge.devSettings.isLiveReloadEnabled;\n}\n\nRCT_EXPORT_METHOD(setHotLoadingEnabled:(BOOL)enabled)\n{\n  WARN_DEPRECATED_DEV_MENU_EXPORT();\n  _bridge.devSettings.isHotLoadingEnabled = enabled;\n}\n\n- (BOOL)hotLoadingEnabled\n{\n  return _bridge.devSettings.isHotLoadingEnabled;\n}\n\n@end\n\n#else // Unavailable when not in dev mode\n\n@implementation RCTDevMenu\n\n- (void)show {}\n- (void)reload {}\n- (void)addItem:(NSString *)title handler:(dispatch_block_t)handler {}\n- (void)addItem:(RCTDevMenu *)item {}\n- (BOOL)isActionSheetShown { return NO; }\n\n@end\n\n@implementation RCTDevMenuItem\n\n+ (instancetype)buttonItemWithTitle:(NSString *)title handler:(void(^)(void))handler {return nil;}\n+ (instancetype)buttonItemWithTitleBlock:(NSString * (^)(void))titleBlock\n                                 handler:(void(^)(void))handler {return nil;}\n\n@end\n\n#endif\n\n@implementation  RCTBridge (RCTDevMenu)\n\n- (RCTDevMenu *)devMenu\n{\n#if RCT_DEV\n  return [self moduleForClass:[RCTDevMenu class]];\n#else\n  return nil;\n#endif\n}\n\n@end\n"
  },
  {
    "path": "React/DevSupport/RCTInspectorDevServerHelper.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <Foundation/Foundation.h>\n#import <JavaScriptCore/JSBase.h>\n#import <AppKit/AppKit.h>\n\n#import <React/RCTDefines.h>\n\n#if RCT_DEV\n\n@interface RCTInspectorDevServerHelper : NSObject\n\n+ (void)connectWithBundleURL:(NSURL *)bundleURL;\n+ (void)disableDebugger;\n+ (void)attachDebugger:(NSString *)owner\n         withBundleURL:(NSURL *)bundleURL\n              withView:(NSViewController *)view;\n@end\n\n#endif\n"
  },
  {
    "path": "React/DevSupport/RCTInspectorDevServerHelper.mm",
    "content": "#import \"RCTInspectorDevServerHelper.h\"\n\n#if RCT_DEV\n\n#import <jschelpers/JSCWrapper.h>\n#import <AppKit/AppKit.h>\n#import <React/RCTLog.h>\n\n#import \"RCTDefines.h\"\n#import \"RCTInspectorPackagerConnection.h\"\n\nusing namespace facebook::react;\n\nstatic NSString *const kDebuggerMsgDisable = @\"{ \\\"id\\\":1,\\\"method\\\":\\\"Debugger.disable\\\" }\";\n\nstatic NSString *getServerHost(NSURL *bundleURL, NSNumber *port)\n{\n  NSString *host = [bundleURL host];\n  if (!host) {\n    host = @\"localhost\";\n  }\n\n  // this is consistent with the Android implementation, where http:// is the\n  // hardcoded implicit scheme for the debug server. Note, packagerURL\n  // technically looks like it could handle schemes/protocols other than HTTP,\n  // so rather than force HTTP, leave it be for now, in case someone is relying\n  // on that ability when developing against iOS.\n  return [NSString stringWithFormat:@\"%@:%@\", host, port];\n}\n\nstatic NSURL *getInspectorDeviceUrl(NSURL *bundleURL)\n{\n  NSNumber *inspectorProxyPort = @8082;\n  NSString *escapedDeviceName = [[[NSHost currentHost] localizedName] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];\n  NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];\n  return [NSURL URLWithString:[NSString stringWithFormat:@\"http://%@/inspector/device?name=%@&app=%@\",\n                                                        getServerHost(bundleURL, inspectorProxyPort),\n                                                        escapedDeviceName,\n                                                        escapedAppName]];\n}\n\nstatic NSURL *getAttachDeviceUrl(NSURL *bundleURL, NSString *title)\n{\n  NSNumber *metroBundlerPort = @8081;\n  NSString *escapedDeviceName = [[[NSHost currentHost] localizedName] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];\n  NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];\n  return [NSURL URLWithString:[NSString stringWithFormat:@\"http://%@/attach-debugger-nuclide?title=%@&device=%@&app=%@\",\n                               getServerHost(bundleURL, metroBundlerPort),\n                               title,\n                               escapedDeviceName,\n                               escapedAppName]];\n}\n\n@implementation RCTInspectorDevServerHelper\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\nstatic NSMutableDictionary<NSString *, RCTInspectorPackagerConnection *> *socketConnections = nil;\n\nstatic void sendEventToAllConnections(NSString *event)\n{\n  for (NSString *socketId in socketConnections) {\n    [socketConnections[socketId] sendEventToAllConnections:event];\n  }\n}\n\nstatic void displayErrorAlert(NSViewController *view, NSString *message) {\n  NSAlert *alert = [[NSAlert alloc] init];\n  alert.messageText = message;\n  [alert runModal];\n}\n\n+ (void)attachDebugger:(NSString *)owner\n         withBundleURL:(NSURL *)bundleURL\n              withView:(NSViewController *)view\n{\n  NSURL *url = getAttachDeviceUrl(bundleURL, owner);\n\n  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];\n  [request setHTTPMethod:@\"GET\"];\n\n  __weak NSViewController *viewCapture = view;\n  [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:\n    ^(NSData *_Nullable data,\n      NSURLResponse *_Nullable response,\n      NSError *_Nullable error) {\n      NSViewController *viewCaptureStrong = viewCapture;\n      if (error != nullptr && viewCaptureStrong != nullptr) {\n        displayErrorAlert(viewCaptureStrong, @\"The request to attach Nuclide couldn't reach Metro Bundler!\");\n      }\n    }] resume];\n}\n\n+ (void)disableDebugger\n{\n  sendEventToAllConnections(kDebuggerMsgDisable);\n}\n\n+ (void)connectWithBundleURL:(NSURL *)bundleURL\n{\n  NSURL *inspectorURL = getInspectorDeviceUrl(bundleURL);\n\n  // Note, using a static dictionary isn't really the greatest design, but\n  // the packager connection does the same thing, so it's at least consistent.\n  // This is a static map that holds different inspector clients per the inspectorURL\n  if (socketConnections == nil) {\n    socketConnections = [NSMutableDictionary new];\n  }\n\n  NSString *key = [inspectorURL absoluteString];\n  RCTInspectorPackagerConnection *connection = socketConnections[key];\n  if (!connection) {\n    connection = [[RCTInspectorPackagerConnection alloc] initWithURL:inspectorURL];\n    socketConnections[key] = connection;\n    [connection connect];\n  }\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/DevSupport/RCTPackagerClient.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTDefines.h>\n\n#if RCT_DEV // Only supported in dev mode\n\n@class RCTPackagerClientResponder;\n@class RCTReconnectingWebSocket;\n\nextern const int RCT_PACKAGER_CLIENT_PROTOCOL_VERSION;\n\n@protocol RCTPackagerClientMethod <NSObject>\n\n- (void)handleRequest:(NSDictionary<NSString *, id> *)params withResponder:(RCTPackagerClientResponder *)responder;\n- (void)handleNotification:(NSDictionary<NSString *, id> *)params;\n\n@optional\n\n/** By default object will receive its methods on the main queue, unless this method is overriden. */\n- (dispatch_queue_t)methodQueue;\n\n@end\n\n@interface RCTPackagerClientResponder : NSObject\n\n- (instancetype)initWithId:(id)msgId socket:(RCTReconnectingWebSocket *)socket;\n- (void)respondWithResult:(id)result;\n- (void)respondWithError:(id)error;\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/DevSupport/RCTPackagerClient.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTPackagerClient.h\"\n\n#import <React/RCTLog.h>\n#import <React/RCTReconnectingWebSocket.h>\n#import <React/RCTUtils.h>\n\n#if RCT_DEV // Only supported in dev mode\n\nconst int RCT_PACKAGER_CLIENT_PROTOCOL_VERSION = 2;\n\n@implementation RCTPackagerClientResponder {\n  id _msgId;\n  __weak RCTReconnectingWebSocket *_socket;\n}\n\n- (instancetype)initWithId:(id)msgId socket:(RCTReconnectingWebSocket *)socket\n{\n  if (self = [super init]) {\n    _msgId = msgId;\n    _socket = socket;\n  }\n  return self;\n}\n\n- (void)respondWithResult:(id)result\n{\n  NSDictionary<NSString *, id> *msg = @{\n                                        @\"version\": @(RCT_PACKAGER_CLIENT_PROTOCOL_VERSION),\n                                        @\"id\": _msgId,\n                                        @\"result\": result,\n                                        };\n  NSError *jsError = nil;\n  NSString *message = RCTJSONStringify(msg, &jsError);\n  if (jsError) {\n    RCTLogError(@\"%@ failed to stringify message with error %@\", [self class], jsError);\n  } else {\n    [_socket send:message];\n  }\n}\n\n- (void)respondWithError:(id)error\n{\n  NSDictionary<NSString *, id> *msg = @{\n                                        @\"version\": @(RCT_PACKAGER_CLIENT_PROTOCOL_VERSION),\n                                        @\"id\": _msgId,\n                                        @\"error\": error,\n                                        };\n  NSError *jsError = nil;\n  NSString *message = RCTJSONStringify(msg, &jsError);\n  if (jsError) {\n    RCTLogError(@\"%@ failed to stringify message with error %@\", [self class], jsError);\n  } else {\n    [_socket send:message];\n  }\n}\n@end\n\n#endif\n"
  },
  {
    "path": "React/DevSupport/RCTPackagerConnection.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTDefines.h>\n\n#if RCT_DEV\n\nNS_ASSUME_NONNULL_BEGIN\n\n@protocol RCTPackagerClientMethod;\n@class RCTPackagerClientResponder;\n\ntypedef uint32_t RCTHandlerToken;\ntypedef void (^RCTNotificationHandler)(NSDictionary<NSString *, id> *);\ntypedef void (^RCTRequestHandler)(NSDictionary<NSString *, id> *, RCTPackagerClientResponder *);\ntypedef void (^RCTConnectedHandler)(void);\n\n/** Encapsulates singleton connection to React Native packager. */\n@interface RCTPackagerConnection : NSObject\n\n+ (instancetype)sharedPackagerConnection;\n\n/**\n * Registers a handler for a notification broadcast from the packager. An\n * example is \"reload\" - an instruction to reload from the packager.\n * If multiple notification handlers are registered for the same method, they\n * will all be invoked sequentially.\n */\n- (RCTHandlerToken)addNotificationHandler:(RCTNotificationHandler)handler\n                                    queue:(dispatch_queue_t)queue\n                                forMethod:(NSString *)method;\n\n/**\n * Registers a handler for a request from the packager. An example is\n * pokeSamplingProfiler; it asks for profile data from the client.\n * Only one handler can be registered for a given method; calling this\n * displaces any previous request handler registered for that method.\n */\n- (RCTHandlerToken)addRequestHandler:(RCTRequestHandler)handler\n                               queue:(dispatch_queue_t)queue\n                           forMethod:(NSString *)method;\n\n/**\n * Registers a handler that runs at most once, when the connection to the\n * packager has been established. The handler will be dispatched immediately\n * if the connection is already established.\n */\n- (RCTHandlerToken)addConnectedHandler:(RCTConnectedHandler)handler\n                                 queue:(dispatch_queue_t)queue;\n\n/** Removes a handler. Silently does nothing if the token is not valid. */\n- (void)removeHandler:(RCTHandlerToken)token;\n\n/** Disconnects and removes all handlers. */\n- (void)stop;\n\n/**\n * Historically no distinction was made between notification and request\n * handlers. If you use this method, it will be registered as *both* a\n * notification handler *and* a request handler. You should migrate to the\n * new block-based API instead.\n */\n- (void)addHandler:(id<RCTPackagerClientMethod>)handler\n         forMethod:(NSString *)method __deprecated_msg(\"Use addRequestHandler or addNotificationHandler instead\");\n\n@end\n\nNS_ASSUME_NONNULL_END\n\n#endif\n"
  },
  {
    "path": "React/DevSupport/RCTPackagerConnection.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTPackagerConnection.h\"\n\n#import <algorithm>\n#import <objc/runtime.h>\n#import <vector>\n\n#import <React/RCTAssert.h>\n#import <React/RCTBridge.h>\n#import <React/RCTBundleURLProvider.h>\n#import <React/RCTConvert.h>\n#import <React/RCTDefines.h>\n#import <React/RCTLog.h>\n#import <React/RCTPackagerClient.h>\n#import <React/RCTReconnectingWebSocket.h>\n#import <React/RCTSRWebSocket.h>\n#import <React/RCTUtils.h>\n\n#if RCT_DEV\n@interface RCTPackagerConnection () <RCTReconnectingWebSocketDelegate>\n@end\n\ntemplate <typename Handler>\nstruct Registration {\n  NSString *method;\n  Handler handler;\n  dispatch_queue_t queue;\n  uint32_t token;\n};\n\n@implementation RCTPackagerConnection {\n  std::mutex _mutex; // protects all ivars\n  RCTReconnectingWebSocket *_socket;\n  BOOL _socketConnected;\n  NSString *_jsLocationForSocket;\n  id _bundleURLChangeObserver;\n  uint32_t _nextToken;\n  std::vector<Registration<RCTNotificationHandler>> _notificationRegistrations;\n  std::vector<Registration<RCTRequestHandler>> _requestRegistrations;\n  std::vector<Registration<RCTConnectedHandler>> _connectedRegistrations;\n}\n\n+ (instancetype)sharedPackagerConnection\n{\n  static RCTPackagerConnection *connection;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    connection = [RCTPackagerConnection new];\n  });\n  return connection;\n}\n\n- (instancetype)init\n{\n  if (self = [super init]) {\n    _nextToken = 1; // Prevent randomly erasing a handler if you pass a bogus 0 token\n    _jsLocationForSocket = [RCTBundleURLProvider sharedSettings].jsLocation;\n    _socket = socketForLocation(_jsLocationForSocket);\n    _socket.delegate = self;\n    [_socket start];\n\n    RCTPackagerConnection *const __weak weakSelf = self;\n    _bundleURLChangeObserver =\n    [[NSNotificationCenter defaultCenter]\n     addObserverForName:RCTBundleURLProviderUpdatedNotification\n     object:nil\n     queue:[NSOperationQueue mainQueue]\n     usingBlock:^(NSNotification *_Nonnull note) {\n       [weakSelf bundleURLSettingsChanged];\n     }];\n  }\n  return self;\n}\n\nstatic RCTReconnectingWebSocket *socketForLocation(NSString *const jsLocation)\n{\n  NSURLComponents *const components = [NSURLComponents new];\n  components.host = jsLocation ?: @\"localhost\";\n  components.scheme = @\"http\";\n  components.port = @(kRCTBundleURLProviderDefaultPort);\n  components.path = @\"/message\";\n  components.queryItems = @[[NSURLQueryItem queryItemWithName:@\"role\" value:@\"ios\"]];\n  static dispatch_queue_t queue;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    queue = dispatch_queue_create(\"com.facebook.RCTPackagerConnectionQueue\", DISPATCH_QUEUE_SERIAL);\n  });\n  return [[RCTReconnectingWebSocket alloc] initWithURL:components.URL queue:queue];\n}\n\n- (void)stop\n{\n  std::lock_guard<std::mutex> l(_mutex);\n  if (_socket == nil) {\n    // Already stopped\n    return;\n  }\n  [[NSNotificationCenter defaultCenter] removeObserver:_bundleURLChangeObserver];\n  _bundleURLChangeObserver = nil;\n  _socketConnected = NO;\n  [_socket stop];\n  _socket = nil;\n  _notificationRegistrations.clear();\n  _requestRegistrations.clear();\n}\n\n- (void)bundleURLSettingsChanged\n{\n  std::lock_guard<std::mutex> l(_mutex);\n  if (_socket == nil) {\n    return; // already stopped\n  }\n\n  NSString *const jsLocation = [RCTBundleURLProvider sharedSettings].jsLocation;\n  if ([jsLocation isEqual:_jsLocationForSocket]) {\n    return; // unchanged\n  }\n\n  _socket.delegate = nil;\n  [_socket stop];\n  _jsLocationForSocket = jsLocation;\n  _socket = socketForLocation(jsLocation);\n  _socket.delegate = self;\n  [_socket start];\n}\n\n- (RCTHandlerToken)addNotificationHandler:(RCTNotificationHandler)handler queue:(dispatch_queue_t)queue forMethod:(NSString *)method\n{\n  std::lock_guard<std::mutex> l(_mutex);\n  const auto token = _nextToken++;\n  _notificationRegistrations.push_back({method, handler, queue, token});\n  return token;\n}\n\n- (RCTHandlerToken)addRequestHandler:(RCTRequestHandler)handler queue:(dispatch_queue_t)queue forMethod:(NSString *)method\n{\n  std::lock_guard<std::mutex> l(_mutex);\n  const auto token = _nextToken++;\n  _requestRegistrations.push_back({method, handler, queue, token});\n  return token;\n}\n\n- (RCTHandlerToken)addConnectedHandler:(RCTConnectedHandler)handler queue:(dispatch_queue_t)queue\n{\n  std::lock_guard<std::mutex> l(_mutex);\n  if (_socketConnected) {\n    dispatch_async(queue, ^{\n      handler();\n    });\n    return 0; // _nextToken starts at 1, so 0 is a no-op token\n  } else {\n    const auto token = _nextToken++;\n    _connectedRegistrations.push_back({nil, handler, queue, token});\n    return token;\n  }\n}\n\n- (void)removeHandler:(RCTHandlerToken)token\n{\n  std::lock_guard<std::mutex> l(_mutex);\n  eraseRegistrationsWithToken(_notificationRegistrations, token);\n  eraseRegistrationsWithToken(_requestRegistrations, token);\n  eraseRegistrationsWithToken(_connectedRegistrations, token);\n}\n\ntemplate <typename Handler>\nstatic void eraseRegistrationsWithToken(std::vector<Registration<Handler>> &registrations, RCTHandlerToken token)\n{\n  registrations.erase(std::remove_if(registrations.begin(), registrations.end(),\n                                     [&token](const auto &reg) { return reg.token == token; }),\n                      registrations.end());\n}\n\n- (void)addHandler:(id<RCTPackagerClientMethod>)handler forMethod:(NSString *)method\n{\n  dispatch_queue_t queue = [handler respondsToSelector:@selector(methodQueue)]\n  ? [handler methodQueue] : dispatch_get_main_queue();\n\n  [self addNotificationHandler:^(NSDictionary<NSString *, id> *notification) {\n    [handler handleNotification:notification];\n  } queue:queue forMethod:method];\n  [self addRequestHandler:^(NSDictionary<NSString *, id> *request, RCTPackagerClientResponder *responder) {\n    [handler handleRequest:request withResponder:responder];\n  } queue:queue forMethod:method];\n}\n\nstatic BOOL isSupportedVersion(NSNumber *version)\n{\n  NSArray<NSNumber *> *const kSupportedVersions = @[ @(RCT_PACKAGER_CLIENT_PROTOCOL_VERSION) ];\n  return [kSupportedVersions containsObject:version];\n}\n\n#pragma mark - RCTReconnectingWebSocketDelegate\n\n- (void)reconnectingWebSocketDidOpen:(RCTReconnectingWebSocket *)webSocket\n{\n  std::vector<Registration<RCTConnectedHandler>> registrations;\n  {\n    std::lock_guard<std::mutex> l(_mutex);\n    _socketConnected = YES;\n    registrations = _connectedRegistrations;\n    _connectedRegistrations.clear();\n  }\n  for (const auto &registration : registrations) {\n    // Beware: don't capture the reference to handler in a dispatched block!\n    RCTConnectedHandler handler = registration.handler;\n    dispatch_async(registration.queue, ^{ handler(); });\n  }\n}\n\n- (void)reconnectingWebSocket:(RCTReconnectingWebSocket *)webSocket didReceiveMessage:(id)message\n{\n  NSError *error = nil;\n  NSDictionary<NSString *, id> *msg = RCTJSONParse(message, &error);\n\n  if (error) {\n    RCTLogError(@\"%@ failed to parse message with error %@\\n<message>\\n%@\\n</message>\", [self class], error, msg);\n    return;\n  }\n\n  if (!isSupportedVersion(msg[@\"version\"])) {\n    RCTLogError(@\"%@ received message with not supported version %@\", [self class], msg[@\"version\"]);\n    return;\n  }\n\n  NSString *const method = msg[@\"method\"];\n  NSDictionary<NSString *, id> *const params = msg[@\"params\"];\n  id messageId = msg[@\"id\"];\n\n  if (messageId) { // Request\n    const std::vector<Registration<RCTRequestHandler>> registrations(registrationsWithMethod(_mutex, _requestRegistrations, method));\n    if (registrations.empty()) {\n      RCTLogError(@\"No handler found for packager method %@\", msg[@\"method\"]);\n      [[[RCTPackagerClientResponder alloc] initWithId:messageId\n                                               socket:webSocket]\n       respondWithError:\n       [NSString stringWithFormat:@\"No handler found for packager method %@\", msg[@\"method\"]]];\n    } else {\n      // If there are multiple matching request registrations, only one can win;\n      // otherwise the packager would get multiple responses. Choose the last one.\n      RCTRequestHandler handler = registrations.back().handler;\n      dispatch_async(registrations.back().queue, ^{\n        handler(params, [[RCTPackagerClientResponder alloc] initWithId:messageId socket:webSocket]);\n      });\n    }\n  } else { // Notification\n    const std::vector<Registration<RCTNotificationHandler>> registrations(registrationsWithMethod(_mutex, _notificationRegistrations, method));\n    for (const auto &registration : registrations) {\n      // Beware: don't capture the reference to handler in a dispatched block!\n      RCTNotificationHandler handler = registration.handler;\n      dispatch_async(registration.queue, ^{ handler(params); });\n    }\n  }\n}\n\n- (void)reconnectingWebSocketDidClose:(RCTReconnectingWebSocket *)webSocket\n{\n  std::lock_guard<std::mutex> l(_mutex);\n  _socketConnected = NO;\n}\n\ntemplate <typename Handler>\nstatic std::vector<Registration<Handler>> registrationsWithMethod(std::mutex &mutex, const std::vector<Registration<Handler>> &registrations, NSString *method)\n{\n  std::lock_guard<std::mutex> l(mutex); // Scope lock acquisition to prevent deadlock when calling out\n  std::vector<Registration<Handler>> matches;\n  for (const auto &reg : registrations) {\n    if ([reg.method isEqual:method]) {\n      matches.push_back(reg);\n    }\n  }\n  return matches;\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/Executors/RCTJSCExecutor.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <JavaScriptCore/JavaScriptCore.h>\n\n#import <React/RCTJavaScriptExecutor.h>\n\ntypedef void (^RCTJavaScriptValueCallback)(JSValue *result, NSError *error);\n\n/**\n * Default name for the JS thread\n */\nRCT_EXTERN NSString *const RCTJSCThreadName;\n\n/**\n * This notification fires on the JS thread immediately after a `JSContext`\n * is fully initialized, but before the JS bundle has been loaded. The object\n * of this notification is the `JSContext`. Native modules should listen for\n * notification only if they need to install custom functionality into the\n * context. Note that this notification won't fire when debugging in Chrome.\n */\nRCT_EXTERN NSString *const RCTJavaScriptContextCreatedNotification;\n\n/**\n * Uses a JavaScriptCore context as the execution engine.\n */\n@interface RCTJSCExecutor : NSObject <RCTJavaScriptExecutor>\n\n/**\n * Returns whether executor uses custom JSC library.\n * This value is used to initialize RCTJSCWrapper.\n * @default is NO.\n */\n@property (nonatomic, readonly, assign) BOOL useCustomJSCLibrary;\n\n/**\n * Returns the bytecode file format that the underlying runtime supports.\n */\n@property (nonatomic, readonly) int32_t bytecodeFileFormatVersion;\n\n/**\n * Specify a name for the JSContext used, which will be visible in debugging tools\n * @default is \"RCTJSContext\"\n */\n@property (nonatomic, copy) NSString *contextName;\n\n/**\n * Inits a new executor instance with given flag that's used\n * to initialize RCTJSCWrapper.\n */\n- (instancetype)initWithUseCustomJSCLibrary:(BOOL)useCustomJSCLibrary;\n\n/**\n * @experimental\n * synchronouslyExecuteApplicationScript:sourceURL:JSContext:error:\n *\n * Run the provided JS Script/Bundle, blocking the caller until it finishes.\n * If there is an error during execution, it is returned, otherwise `NULL` is\n * returned.\n */\n- (NSError *)synchronouslyExecuteApplicationScript:(NSData *)script\n                                         sourceURL:(NSURL *)sourceURL;\n\n/**\n * Invokes the given module/method directly. The completion block will be called with the\n * JSValue returned by the JS context.\n *\n * Currently this does not flush the JS-to-native message queue.\n */\n- (void)callFunctionOnModule:(NSString *)module\n                      method:(NSString *)method\n                   arguments:(NSArray *)args\n             jsValueCallback:(RCTJavaScriptValueCallback)onComplete;\n\n/**\n * Get the JavaScriptCore context associated with this executor instance.\n */\n- (JSContext *)jsContext;\n\n@end\n\n/**\n * @experimental\n * May be used to pre-create the JSContext to make RCTJSCExecutor creation less costly.\n * Avoid using this; it's experimental and is not likely to be supported long-term.\n */\n@interface RCTJSContextProvider : NSObject\n\n- (instancetype)initWithUseCustomJSCLibrary:(BOOL)useCustomJSCLibrary;\n\n/**\n * Marks whether the provider uses the custom implementation of JSC and not the system one.\n */\n@property (nonatomic, readonly, assign) BOOL useCustomJSCLibrary;\n\n/**\n * @experimental\n * Create an RCTJSCExecutor from an provider instance. This may only be called once.\n * The underlying JSContext will be returned in the JSContext pointer if it is non-NULL.\n */\n- (RCTJSCExecutor *)createExecutorWithContext:(JSContext **)JSContext;\n\n@end\n"
  },
  {
    "path": "React/Executors/RCTJSCExecutor.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTJSCExecutor.h\"\n\n#import <cinttypes>\n#import <memory>\n#import <pthread.h>\n#import <string>\n#import <unordered_map>\n\n// #import <UIKit/UIDevice.h>\n\n#import <cxxreact/JSBundleType.h>\n#import <jschelpers/JavaScriptCore.h>\n#import <React/RCTAssert.h>\n#import <React/RCTBridge+Private.h>\n#import <React/RCTDefines.h>\n#import <React/RCTDevSettings.h>\n#import <React/RCTJSCErrorHandling.h>\n#import <React/RCTJavaScriptLoader.h>\n#import <React/RCTLog.h>\n#import <React/RCTPerformanceLogger.h>\n#import <React/RCTProfile.h>\n#import <React/RCTUtils.h>\n\n#if (RCT_PROFILE || RCT_DEV) && __has_include(\"RCTDevMenu.h\")\n#import \"RCTDevMenu.h\"\n#endif\n\nNSString *const RCTJSCThreadName = @\"com.facebook.react.JavaScript\";\nNSString *const RCTJavaScriptContextCreatedNotification = @\"RCTJavaScriptContextCreatedNotification\";\n\nstruct __attribute__((packed)) ModuleData {\n  uint32_t offset;\n  uint32_t size;\n};\n\nusing file_ptr = std::unique_ptr<FILE, decltype(&fclose)>;\nusing memory_ptr = std::unique_ptr<void, decltype(&free)>;\n\nstruct RandomAccessBundleData {\n  file_ptr bundle;\n  size_t baseOffset;\n  size_t numTableEntries;\n  std::unique_ptr<ModuleData[]> table;\n  RandomAccessBundleData(): bundle(nullptr, fclose) {}\n};\n\nstruct RandomAccessBundleStartupCode {\n  memory_ptr code;\n  size_t size;\n  static RandomAccessBundleStartupCode empty() {\n    return RandomAccessBundleStartupCode{memory_ptr(nullptr, free), 0};\n  };\n  bool isEmpty() {\n    return !code;\n  }\n};\n\nstruct TaggedScript {\n  const facebook::react::ScriptTag tag;\n  const NSData *script;\n};\n\n#if RCT_PROFILE\n@interface RCTCookieMap : NSObject\n{\n  @package\n  std::unordered_map<NSUInteger, NSUInteger> _cookieMap;\n}\n@end\n@implementation RCTCookieMap @end\n#endif\n\nstruct RCTJSContextData {\n  BOOL useCustomJSCLibrary;\n  NSThread *javaScriptThread;\n  JSContext *context;\n};\n\n@interface RCTJavaScriptContext : NSObject <RCTInvalidating>\n\n@property (nonatomic, strong, readonly) JSContext *context;\n\n- (instancetype)initWithJSContext:(JSContext *)context\n                         onThread:(NSThread *)javaScriptThread NS_DESIGNATED_INITIALIZER;\n\n@end\n\n@implementation RCTJavaScriptContext\n{\n  RCTJavaScriptContext *_selfReference;\n  NSThread *_javaScriptThread;\n}\n\n- (instancetype)initWithJSContext:(JSContext *)context\n                         onThread:(NSThread *)javaScriptThread\n{\n  if ((self = [super init])) {\n    _context = context;\n    _context.name = @\"RCTJSContext\";\n    _javaScriptThread = javaScriptThread;\n\n    /**\n     * Explicitly introduce a retain cycle here - The RCTJSCExecutor might\n     * be deallocated while there's still work enqueued in the JS thread, so\n     * we wouldn't be able kill the JSContext. Instead we create this retain\n     * cycle, and enqueue the -invalidate message in this object, it then\n     * releases the JSContext, breaks the cycle and stops the runloop.\n     */\n    _selfReference = self;\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(-(instancetype)init)\n\n- (BOOL)isValid\n{\n  return _context != nil;\n}\n\n- (void)invalidate\n{\n  if (self.isValid) {\n    RCTAssertThread(_javaScriptThread, @\"Must be invalidated on JS thread.\");\n\n    _context = nil;\n    _selfReference = nil;\n    _javaScriptThread = nil;\n\n    CFRunLoopStop([[NSRunLoop currentRunLoop] getCFRunLoop]);\n  }\n}\n\n@end\n\n@implementation RCTJSCExecutor\n{\n  // Set at init time:\n  BOOL _useCustomJSCLibrary;\n  NSThread *_javaScriptThread;\n\n  // Set at setUp time:\n  RCTPerformanceLogger *_performanceLogger;\n  RCTJavaScriptContext *_context;\n\n  // Set as needed:\n  RandomAccessBundleData _randomAccessBundle;\n  JSValueRef _batchedBridgeRef;\n}\n\n@synthesize valid = _valid;\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n+ (void)runRunLoopThread\n{\n  @autoreleasepool {\n    // copy thread name to pthread name\n    pthread_setname_np([NSThread currentThread].name.UTF8String);\n\n    // Set up a dummy runloop source to avoid spinning\n    CFRunLoopSourceContext noSpinCtx = {0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};\n    CFRunLoopSourceRef noSpinSource = CFRunLoopSourceCreate(NULL, 0, &noSpinCtx);\n    CFRunLoopAddSource(CFRunLoopGetCurrent(), noSpinSource, kCFRunLoopDefaultMode);\n    CFRelease(noSpinSource);\n\n    // run the run loop\n    while (kCFRunLoopRunStopped != CFRunLoopRunInMode(kCFRunLoopDefaultMode, ((NSDate *)[NSDate distantFuture]).timeIntervalSinceReferenceDate, NO)) {\n      RCTAssert(NO, @\"not reached assertion\"); // runloop spun. that's bad.\n    }\n  }\n}\n\nstatic NSThread *newJavaScriptThread(void)\n{\n  NSThread *javaScriptThread = [[NSThread alloc] initWithTarget:[RCTJSCExecutor class]\n                                                       selector:@selector(runRunLoopThread)\n                                                         object:nil];\n  javaScriptThread.name = RCTJSCThreadName;\n  javaScriptThread.qualityOfService = NSOperationQualityOfServiceUserInteractive;\n  [javaScriptThread start];\n  return javaScriptThread;\n}\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  _bridge = bridge;\n  _performanceLogger = [bridge performanceLogger];\n}\n\n- (instancetype)init\n{\n  return [self initWithUseCustomJSCLibrary:NO];\n}\n\n- (instancetype)initWithUseCustomJSCLibrary:(BOOL)useCustomJSCLibrary\n{\n  RCT_PROFILE_BEGIN_EVENT(0, @\"-[RCTJSCExecutor init]\", nil);\n\n  if (self = [super init]) {\n    _useCustomJSCLibrary = useCustomJSCLibrary;\n    _valid = YES;\n    _javaScriptThread = newJavaScriptThread();\n  }\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n  return self;\n}\n\n- (instancetype)initWithJSContextData:(const RCTJSContextData &)data\n{\n  if (self = [super init]) {\n    _useCustomJSCLibrary = data.useCustomJSCLibrary;\n    _valid = YES;\n    _javaScriptThread = data.javaScriptThread;\n    _context = [[RCTJavaScriptContext alloc] initWithJSContext:data.context onThread:_javaScriptThread];\n  }\n  return self;\n}\n\n- (NSError *)synchronouslyExecuteApplicationScript:(NSData *)script\n                                         sourceURL:(NSURL *)sourceURL\n{\n  NSError *loadError;\n  TaggedScript taggedScript = loadTaggedScript(script, sourceURL, _performanceLogger, _randomAccessBundle, &loadError);\n\n  if (loadError) {\n    return loadError;\n  }\n\n  if (taggedScript.tag == facebook::react::ScriptTag::RAMBundle) {\n    registerNativeRequire(_context.context, self);\n  }\n\n  return executeApplicationScript(taggedScript, sourceURL,\n                                  _performanceLogger,\n                                  _context.context.JSGlobalContextRef);\n}\n\n- (RCTJavaScriptContext *)context\n{\n  if (!self.isValid) {\n    return nil;\n  }\n  return _context;\n}\n\n- (void)setUp\n{\n#if RCT_PROFILE\n#ifndef __clang_analyzer__\n  _bridge.flowIDMap = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);\n#endif\n  _bridge.flowIDMapLock = [NSLock new];\n\n  for (NSString *event in @[RCTProfileDidStartProfiling, RCTProfileDidEndProfiling]) {\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(toggleProfilingFlag:)\n                                                 name:event\n                                               object:nil];\n  }\n#endif\n\n  [self executeBlockOnJavaScriptQueue:^{\n    if (!self.valid) {\n      return;\n    }\n\n    JSGlobalContextRef contextRef = nullptr;\n    JSContext *context = nil;\n    if (self->_context) {\n      context = self->_context.context;\n      contextRef = context.JSGlobalContextRef;\n    } else {\n      if (self->_useCustomJSCLibrary) {\n        JSC_configureJSCForIOS(true, RCTJSONStringify(@{\n          @\"StartSamplingProfilerOnInit\": @(self->_bridge.devSettings.startSamplingProfilerOnLaunch)\n        }, NULL).UTF8String);\n      }\n      contextRef = JSC_JSGlobalContextCreateInGroup((bool)self->_useCustomJSCLibrary, nullptr, nullptr);\n      context = [JSC_JSContext(contextRef) contextWithJSGlobalContextRef:contextRef];\n      // We release the global context reference here to balance retainCount after JSGlobalContextCreateInGroup.\n      // The global context _is not_ going to be released since the JSContext keeps the strong reference to it.\n      JSC_JSGlobalContextRelease(contextRef);\n      self->_context = [[RCTJavaScriptContext alloc] initWithJSContext:context onThread:self->_javaScriptThread];\n      [[NSNotificationCenter defaultCenter] postNotificationName:RCTJavaScriptContextCreatedNotification\n                                                          object:context];\n\n      installBasicSynchronousHooksOnContext(context);\n    }\n\n    RCTFBQuickPerformanceLoggerConfigureHooks(context.JSGlobalContextRef);\n\n    __weak RCTJSCExecutor *weakSelf = self;\n    context[@\"nativeRequireModuleConfig\"] = ^NSArray *(NSString *moduleName) {\n      RCTJSCExecutor *strongSelf = weakSelf;\n      if (!strongSelf.valid) {\n        return nil;\n      }\n\n      RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"nativeRequireModuleConfig\", @{ @\"moduleName\": moduleName });\n      NSArray *result = [strongSelf->_bridge configForModuleName:moduleName];\n      RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"js_call,config\");\n      return RCTNullIfNil(result);\n    };\n\n    context[@\"nativeFlushQueueImmediate\"] = ^(NSArray<NSArray *> *calls){\n      RCTJSCExecutor *strongSelf = weakSelf;\n      if (!strongSelf.valid || !calls) {\n        return;\n      }\n\n      RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"nativeFlushQueueImmediate\", nil);\n      [strongSelf->_bridge handleBuffer:calls batchEnded:NO];\n      RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"js_call\");\n    };\n\n    context[@\"nativeCallSyncHook\"] = ^id(NSUInteger module, NSUInteger method, NSArray *args) {\n      RCTJSCExecutor *strongSelf = weakSelf;\n      if (!strongSelf.valid) {\n        return nil;\n      }\n\n      RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"nativeCallSyncHook\", nil);\n      id result = [strongSelf->_bridge callNativeModule:module method:method params:args];\n      RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"js_call,config\");\n      return result;\n    };\n\n#if RCT_PROFILE\n    __weak RCTBridge *weakBridge = self->_bridge;\n    context[@\"nativeTraceBeginAsyncFlow\"] = ^(__unused uint64_t tag, __unused NSString *name, int64_t cookie) {\n      if (RCTProfileIsProfiling()) {\n        [weakBridge.flowIDMapLock lock];\n        NSUInteger newCookie = _RCTProfileBeginFlowEvent();\n        CFDictionarySetValue(weakBridge.flowIDMap, (const void *)cookie, (const void *)newCookie);\n        [weakBridge.flowIDMapLock unlock];\n      }\n    };\n\n    context[@\"nativeTraceEndAsyncFlow\"] = ^(__unused uint64_t tag, __unused NSString *name, int64_t cookie) {\n      if (RCTProfileIsProfiling()) {\n        [weakBridge.flowIDMapLock lock];\n        NSUInteger newCookie = (NSUInteger)CFDictionaryGetValue(weakBridge.flowIDMap, (const void *)cookie);\n        _RCTProfileEndFlowEvent(newCookie);\n        CFDictionaryRemoveValue(weakBridge.flowIDMap, (const void *)cookie);\n        [weakBridge.flowIDMapLock unlock];\n      }\n    };\n\n    // Add toggles for JSC's sampling profiler, if the profiler is enabled\n    if (JSC_JSSamplingProfilerEnabled(context.JSGlobalContextRef)) {\n      // Mark this thread as the main JS thread before starting profiling.\n      JSC_JSStartSamplingProfilingOnMainJSCThread(context.JSGlobalContextRef);\n\n      __weak JSContext *weakContext = self->_context.context;\n\n#if __has_include(\"RCTDevMenu.h\")\n      // Allow to toggle the sampling profiler through RN's dev menu\n      [self->_bridge.devMenu addItem:[RCTDevMenuItem buttonItemWithTitle:@\"Start / Stop JS Sampling Profiler\" handler:^{\n        RCTJSCExecutor *strongSelf = weakSelf;\n        if (!strongSelf.valid || !weakContext) {\n          return;\n        }\n        [weakSelf.bridge.devSettings toggleJSCSamplingProfiler];\n      }]];\n#endif\n\n      // Allow for the profiler to be poked from JS code as well\n      // (see SamplingProfiler.js for an example of how it could be used with the JSCSamplingProfiler module).\n      context[@\"pokeSamplingProfiler\"] = ^NSDictionary *() {\n        if (!weakContext) {\n          return @{};\n        }\n        JSGlobalContextRef ctx = weakContext.JSGlobalContextRef;\n        JSValueRef result = JSC_JSPokeSamplingProfiler(ctx);\n        return [[JSC_JSValue(ctx) valueWithJSValueRef:result inContext:weakContext] toObject];\n      };\n    }\n#endif\n\n#if RCT_DEV\n    // Inject handler used by HMR\n    context[@\"nativeInjectHMRUpdate\"] = ^(NSString *sourceCode, NSString *sourceCodeURL) {\n      RCTJSCExecutor *strongSelf = weakSelf;\n      if (!strongSelf.valid) {\n        return;\n      }\n\n      JSGlobalContextRef ctx = strongSelf->_context.context.JSGlobalContextRef;\n      JSStringRef execJSString = JSC_JSStringCreateWithUTF8CString(ctx, sourceCode.UTF8String);\n      JSStringRef jsURL = JSC_JSStringCreateWithUTF8CString(ctx, sourceCodeURL.UTF8String);\n      JSC_JSEvaluateScript(ctx, execJSString, NULL, jsURL, 0, NULL);\n      JSC_JSStringRelease(ctx, jsURL);\n      JSC_JSStringRelease(ctx, execJSString);\n    };\n#endif\n  }];\n}\n\n/** Installs synchronous hooks that don't require a weak reference back to the RCTJSCExecutor. */\nstatic void installBasicSynchronousHooksOnContext(JSContext *context)\n{\n  context[@\"nativeLoggingHook\"] = ^(NSString *message, NSNumber *logLevel) {\n    RCTLogLevel level = RCTLogLevelInfo;\n    if (logLevel) {\n      level = MAX(level, (RCTLogLevel)logLevel.integerValue);\n    }\n\n    _RCTLogJavaScriptInternal(level, message);\n  };\n  context[@\"nativePerformanceNow\"] = ^{\n    return @(CACurrentMediaTime() * 1000);\n  };\n#if RCT_PROFILE\n  if (RCTProfileIsProfiling()) {\n    // Cheating, since it's not a \"hook\", but meh\n    context[@\"__RCTProfileIsProfiling\"] = @YES;\n  }\n  context[@\"nativeTraceBeginSection\"] = ^(NSNumber *tag, NSString *profileName, NSDictionary *args) {\n    static int profileCounter = 1;\n    if (!profileName) {\n      profileName = [NSString stringWithFormat:@\"Profile %d\", profileCounter++];\n    }\n\n    RCT_PROFILE_BEGIN_EVENT(tag.longLongValue, profileName, args);\n  };\n  context[@\"nativeTraceEndSection\"] = ^(NSNumber *tag) {\n    RCT_PROFILE_END_EVENT(tag.longLongValue, @\"console\");\n  };\n  RCTCookieMap *cookieMap = [RCTCookieMap new];\n  context[@\"nativeTraceBeginAsyncSection\"] = ^(uint64_t tag, NSString *name, NSUInteger cookie) {\n    NSUInteger newCookie = RCTProfileBeginAsyncEvent(tag, name, nil);\n    cookieMap->_cookieMap.insert({cookie, newCookie});\n  };\n  context[@\"nativeTraceEndAsyncSection\"] = ^(uint64_t tag, NSString *name, NSUInteger cookie) {\n    NSUInteger newCookie = 0;\n    const auto &it = cookieMap->_cookieMap.find(cookie);\n    if (it != cookieMap->_cookieMap.end()) {\n      newCookie = it->second;\n      cookieMap->_cookieMap.erase(it);\n    }\n    RCTProfileEndAsyncEvent(tag, @\"js,async\", newCookie, name, @\"JS async\");\n  };\n#endif\n}\n\n- (void)toggleProfilingFlag:(NSNotification *)notification\n{\n  [self executeBlockOnJavaScriptQueue:^{\n    BOOL enabled = [notification.name isEqualToString:RCTProfileDidStartProfiling];\n    [self->_bridge enqueueJSCall:@\"Systrace\"\n                          method:@\"setEnabled\"\n                            args:@[enabled ? @YES : @NO]\n                      completion:NULL];\n  }];\n}\n\n- (void)invalidate\n{\n  if (!self.isValid) {\n    return;\n  }\n\n  _valid = NO;\n\n#if RCT_PROFILE\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n#endif\n}\n\n- (int32_t)bytecodeFileFormatVersion\n{\n  return _useCustomJSCLibrary\n    ? facebook::react::customJSCWrapper()->JSBytecodeFileFormatVersion\n    : JSNoBytecodeFileFormatVersion;\n}\n\n- (NSString *)contextName\n{\n  return [_context.context name];\n}\n\nRCT_EXPORT_METHOD(setContextName:(nonnull NSString *)contextName)\n{\n  [_context.context setName:contextName];\n}\n\n- (void)dealloc\n{\n  [self invalidate];\n\n  [_context performSelector:@selector(invalidate)\n                   onThread:_javaScriptThread\n                 withObject:nil\n              waitUntilDone:NO];\n  _context = nil;\n\n  _randomAccessBundle.bundle.reset();\n  _randomAccessBundle.table.reset();\n}\n\n- (void)flushedQueue:(RCTJavaScriptCallback)onComplete\n{\n  // TODO: Make this function handle first class instead of dynamically dispatching it. #9317773\n  [self _executeJSCall:@\"flushedQueue\" arguments:@[] unwrapResult:YES callback:onComplete];\n}\n\n- (void)_callFunctionOnModule:(NSString *)module\n                       method:(NSString *)method\n                    arguments:(NSArray *)args\n                  returnValue:(BOOL)returnValue\n                 unwrapResult:(BOOL)unwrapResult\n                     callback:(RCTJavaScriptCallback)onComplete\n{\n  // TODO: Make this function handle first class instead of dynamically dispatching it. #9317773\n  NSString *bridgeMethod = returnValue ? @\"callFunctionReturnFlushedQueue\" : @\"callFunctionReturnResultAndFlushedQueue\";\n  [self _executeJSCall:bridgeMethod arguments:@[module, method, args] unwrapResult:unwrapResult callback:onComplete];\n}\n\n- (void)callFunctionOnModule:(NSString *)module method:(NSString *)method arguments:(NSArray *)args callback:(RCTJavaScriptCallback)onComplete\n{\n  [self _callFunctionOnModule:module method:method arguments:args returnValue:YES unwrapResult:YES callback:onComplete];\n}\n\n- (void)callFunctionOnModule:(NSString *)module method:(NSString *)method arguments:(NSArray *)args jsValueCallback:(RCTJavaScriptValueCallback)onComplete\n{\n  [self _callFunctionOnModule:module method:method arguments:args returnValue:NO unwrapResult:NO callback:onComplete];\n}\n\n- (void)invokeCallbackID:(NSNumber *)cbID\n               arguments:(NSArray *)args\n                callback:(RCTJavaScriptCallback)onComplete\n{\n  // TODO: Make this function handle first class instead of dynamically dispatching it. #9317773\n  [self _executeJSCall:@\"invokeCallbackAndReturnFlushedQueue\" arguments:@[cbID, args] unwrapResult:YES callback:onComplete];\n}\n\n- (void)_executeJSCall:(NSString *)method\n             arguments:(NSArray *)arguments\n          unwrapResult:(BOOL)unwrapResult\n              callback:(RCTJavaScriptCallback)onComplete\n{\n  RCTAssert(onComplete != nil, @\"onComplete block should not be nil\");\n  __weak RCTJSCExecutor *weakSelf = self;\n  [self executeBlockOnJavaScriptQueue:^{\n    RCTJSCExecutor *strongSelf = weakSelf;\n    if (!strongSelf || !strongSelf.isValid) {\n      return;\n    }\n\n    RCT_PROFILE_BEGIN_EVENT(0, @\"executeJSCall\", (@{@\"method\": method, @\"args\": arguments}));\n\n    JSContext *context = strongSelf->_context.context;\n    JSGlobalContextRef ctx = context.JSGlobalContextRef;\n\n    // get the BatchedBridge object\n    JSValueRef errorJSRef = NULL;\n    JSValueRef batchedBridgeRef = strongSelf->_batchedBridgeRef;\n    if (!batchedBridgeRef) {\n      JSStringRef moduleNameJSStringRef = JSC_JSStringCreateWithUTF8CString(ctx, \"__fbBatchedBridge\");\n      JSObjectRef globalObjectJSRef = JSC_JSContextGetGlobalObject(ctx);\n      batchedBridgeRef = JSC_JSObjectGetProperty(ctx, globalObjectJSRef, moduleNameJSStringRef, &errorJSRef);\n      JSC_JSStringRelease(ctx, moduleNameJSStringRef);\n      strongSelf->_batchedBridgeRef = batchedBridgeRef;\n    }\n\n    NSError *error;\n    JSValueRef resultJSRef = NULL;\n    if (batchedBridgeRef != NULL && errorJSRef == NULL && JSC_JSValueGetType(ctx, batchedBridgeRef) != kJSTypeUndefined) {\n      // get method\n      JSStringRef methodNameJSStringRef = JSC_JSStringCreateWithCFString(ctx, (__bridge CFStringRef)method);\n      JSValueRef methodJSRef = JSC_JSObjectGetProperty(ctx, (JSObjectRef)batchedBridgeRef, methodNameJSStringRef, &errorJSRef);\n      JSC_JSStringRelease(ctx, methodNameJSStringRef);\n\n      if (methodJSRef != NULL && errorJSRef == NULL && JSC_JSValueGetType(ctx, methodJSRef) != kJSTypeUndefined) {\n        JSValueRef jsArgs[arguments.count];\n        for (NSUInteger i = 0; i < arguments.count; i++) {\n          jsArgs[i] = [JSC_JSValue(ctx) valueWithObject:arguments[i] inContext:context].JSValueRef;\n        }\n        resultJSRef = JSC_JSObjectCallAsFunction(ctx, (JSObjectRef)methodJSRef, (JSObjectRef)batchedBridgeRef, arguments.count, jsArgs, &errorJSRef);\n      } else {\n        if (!errorJSRef && JSC_JSValueGetType(ctx, methodJSRef) == kJSTypeUndefined) {\n          error = RCTErrorWithMessage([NSString stringWithFormat:@\"Unable to execute JS call: method %@ is undefined\", method]);\n        }\n      }\n    } else {\n      if (!errorJSRef && JSC_JSValueGetType(ctx, batchedBridgeRef) == kJSTypeUndefined) {\n        error = RCTErrorWithMessage(@\"Unable to execute JS call: __fbBatchedBridge is undefined. This can happen \"\n                                    \"if you try to execute JS and the bridge has not set up, for example if it encountered \"\n                                    \"an incomplete bundle or a fatal script execution error during startup. Verify that a \"\n                                    \"valid JS bundle is included with your app and that it loaded correctly, or try \"\n                                    \"reinstalling the app.\");\n      }\n    }\n\n    id objcValue;\n    if (errorJSRef || error) {\n      if (!error) {\n        error = RCTNSErrorFromJSError([JSC_JSValue(ctx) valueWithJSValueRef:errorJSRef inContext:context]);\n      }\n    } else {\n      // We often return `null` from JS when there is nothing for native side. [JSValue toValue]\n      // returns [NSNull null] in this case, which we don't want.\n      if (JSC_JSValueGetType(ctx, resultJSRef) != kJSTypeNull) {\n        JSValue *result = [JSC_JSValue(ctx) valueWithJSValueRef:resultJSRef inContext:context];\n        objcValue = unwrapResult ? [result toObject] : result;\n      }\n    }\n\n    RCT_PROFILE_END_EVENT(0, @\"js_call\");\n\n    onComplete(objcValue, error);\n  }];\n}\n\n- (void)executeApplicationScript:(NSData *)script\n                       sourceURL:(NSURL *)sourceURL\n                      onComplete:(RCTJavaScriptCompleteBlock)onComplete\n{\n  RCTAssertParam(script);\n  RCTAssertParam(sourceURL);\n\n  NSError *loadError;\n  TaggedScript taggedScript = loadTaggedScript(script, sourceURL,\n                                               _performanceLogger,\n                                               _randomAccessBundle,\n                                               &loadError);\n  if (!taggedScript.script) {\n    if (onComplete) {\n      onComplete(loadError);\n    }\n    return;\n  }\n\n  RCTProfileBeginFlowEvent();\n  [self executeBlockOnJavaScriptQueue:^{\n    RCTProfileEndFlowEvent();\n    if (!self.isValid) {\n      return;\n    }\n\n    if (taggedScript.tag == facebook::react::ScriptTag::RAMBundle) {\n      registerNativeRequire(self.context.context, self);\n    }\n\n    NSError *error = executeApplicationScript(taggedScript, sourceURL,\n                                              self->_performanceLogger,\n                                              self->_context.context.JSGlobalContextRef);\n    if (onComplete) {\n      onComplete(error);\n    }\n  }];\n}\n\nstatic TaggedScript loadTaggedScript(NSData *script,\n                                     NSURL *sourceURL,\n                                     RCTPerformanceLogger *performanceLogger,\n                                     RandomAccessBundleData &randomAccessBundle,\n                                     NSError **error)\n{\n  RCT_PROFILE_BEGIN_EVENT(0, @\"executeApplicationScript / prepare bundle\", nil);\n\n  facebook::react::BundleHeader header;\n  [script getBytes:&header length:sizeof(header)];\n  facebook::react::ScriptTag tag = facebook::react::parseTypeFromHeader(header);\n\n  NSData *loadedScript = NULL;\n  switch (tag) {\n    case facebook::react::ScriptTag::RAMBundle:\n      [performanceLogger markStartForTag:RCTPLRAMBundleLoad];\n\n      loadedScript = loadRAMBundle(sourceURL, error, randomAccessBundle);\n\n      [performanceLogger markStopForTag:RCTPLRAMBundleLoad];\n      [performanceLogger setValue:loadedScript.length forTag:RCTPLRAMStartupCodeSize];\n      break;\n\n    case facebook::react::ScriptTag::BCBundle:\n      loadedScript = script;\n      break;\n\n    case facebook::react::ScriptTag::String: {\n      NSMutableData *nullTerminatedScript = [NSMutableData dataWithData:script];\n      [nullTerminatedScript appendBytes:\"\" length:1];\n      loadedScript = nullTerminatedScript;\n    }\n  }\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n  return { .tag = tag, .script = loadedScript };\n}\n\nstatic void registerNativeRequire(JSContext *context, RCTJSCExecutor *executor)\n{\n  __weak RCTJSCExecutor *weakExecutor = executor;\n  context[@\"nativeRequire\"] = ^(NSNumber *moduleID) { [weakExecutor _nativeRequire:moduleID]; };\n}\n\nstatic NSError *executeApplicationScript(TaggedScript taggedScript,\n                                         NSURL *sourceURL,\n                                         RCTPerformanceLogger *performanceLogger,\n                                         JSGlobalContextRef ctx)\n{\n  RCT_PROFILE_BEGIN_EVENT(0, @\"executeApplicationScript / execute script\", (@{\n    @\"url\": sourceURL.absoluteString, @\"size\": @(taggedScript.script.length)\n  }));\n\n  [performanceLogger markStartForTag:RCTPLScriptExecution];\n  JSValueRef jsError = NULL;\n  JSStringRef bundleURL = JSC_JSStringCreateWithUTF8CString(ctx, sourceURL.absoluteString.UTF8String);\n\n  switch (taggedScript.tag) {\n    case facebook::react::ScriptTag::RAMBundle:\n      /* fallthrough */\n    case facebook::react::ScriptTag::String: {\n      JSStringRef execJSString = JSC_JSStringCreateWithUTF8CString(ctx, (const char *)taggedScript.script.bytes);\n      JSC_JSEvaluateScript(ctx, execJSString, NULL, bundleURL, 0, &jsError);\n      JSC_JSStringRelease(ctx, execJSString);\n      break;\n    }\n\n    case facebook::react::ScriptTag::BCBundle: {\n      file_ptr source(fopen(sourceURL.path.UTF8String, \"r\"), fclose);\n      int sourceFD = fileno(source.get());\n\n      JSC_JSEvaluateBytecodeBundle(ctx, NULL, sourceFD, bundleURL, &jsError);\n      break;\n    }\n  }\n\n  JSC_JSStringRelease(ctx, bundleURL);\n  [performanceLogger markStopForTag:RCTPLScriptExecution];\n\n  NSError *error = jsError\n    ? RCTNSErrorFromJSErrorRef(jsError, ctx)\n    : nil;\n\n  RCT_PROFILE_END_EVENT(0, @\"js_call\");\n  return error;\n}\n\n- (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block\n{\n  if ([NSThread currentThread] != _javaScriptThread) {\n    [self performSelector:@selector(executeBlockOnJavaScriptQueue:)\n                 onThread:_javaScriptThread withObject:block waitUntilDone:NO];\n  } else {\n    block();\n  }\n}\n\n- (void)executeAsyncBlockOnJavaScriptQueue:(dispatch_block_t)block\n{\n  [self performSelector:@selector(executeBlockOnJavaScriptQueue:)\n               onThread:_javaScriptThread\n             withObject:block\n          waitUntilDone:NO];\n}\n\n- (void)injectJSONText:(NSString *)script\n   asGlobalObjectNamed:(NSString *)objectName\n              callback:(RCTJavaScriptCompleteBlock)onComplete\n{\n  if (RCT_DEBUG) {\n    RCTAssert(RCTJSONParse(script, NULL) != nil, @\"%@ wasn't valid JSON!\", script);\n  }\n\n  __weak RCTJSCExecutor *weakSelf = self;\n  RCTProfileBeginFlowEvent();\n  [self executeBlockOnJavaScriptQueue:^{\n    RCTProfileEndFlowEvent();\n\n    RCTJSCExecutor *strongSelf = weakSelf;\n    if (!strongSelf || !strongSelf.isValid) {\n      return;\n    }\n\n    RCT_PROFILE_BEGIN_EVENT(0, @\"injectJSONText\", @{@\"objectName\": objectName});\n    JSGlobalContextRef ctx = strongSelf->_context.context.JSGlobalContextRef;\n    JSStringRef execJSString = JSC_JSStringCreateWithCFString(ctx, (__bridge CFStringRef)script);\n    JSValueRef valueToInject = JSC_JSValueMakeFromJSONString(ctx, execJSString);\n    JSC_JSStringRelease(ctx, execJSString);\n\n    NSError *error;\n    if (!valueToInject) {\n      NSString *errorMessage = [NSString stringWithFormat:@\"Can't make JSON value from script '%@'\", script];\n      error = [NSError errorWithDomain:RCTErrorDomain code:2 userInfo:@{NSLocalizedDescriptionKey: errorMessage}];\n      RCTLogError(@\"%@\", errorMessage);\n    } else {\n      JSObjectRef globalObject = JSC_JSContextGetGlobalObject(ctx);\n      JSStringRef JSName = JSC_JSStringCreateWithCFString(ctx, (__bridge CFStringRef)objectName);\n      JSValueRef jsError = NULL;\n      JSC_JSObjectSetProperty(ctx, globalObject, JSName, valueToInject, kJSPropertyAttributeNone, &jsError);\n      JSC_JSStringRelease(ctx, JSName);\n\n      if (jsError) {\n        error = RCTNSErrorFromJSErrorRef(jsError, ctx);\n      }\n    }\n    RCT_PROFILE_END_EVENT(0, @\"js_call,json_call\");\n\n    if (onComplete) {\n      onComplete(error);\n    }\n  }];\n}\n\nstatic bool readRandomAccessModule(const RandomAccessBundleData &bundleData, size_t offset, size_t size, char *data)\n{\n  return fseek(bundleData.bundle.get(), offset + bundleData.baseOffset, SEEK_SET) == 0 &&\n         fread(data, 1, size, bundleData.bundle.get()) == size;\n}\n\nstatic void executeRandomAccessModule(RCTJSCExecutor *executor, uint32_t moduleID, size_t offset, size_t size)\n{\n  auto data = std::make_unique<char[]>(size);\n  if (!readRandomAccessModule(executor->_randomAccessBundle, offset, size, data.get())) {\n    RCTFatal(RCTErrorWithMessage(@\"Error loading RAM module\"));\n    return;\n  }\n\n  char url[14]; // 10 = maximum decimal digits in a 32bit unsigned int + \".js\" + null byte\n  sprintf(url, \"%\" PRIu32 \".js\", moduleID);\n\n  JSGlobalContextRef ctx = executor->_context.context.JSGlobalContextRef;\n  JSStringRef code = JSC_JSStringCreateWithUTF8CString(ctx, data.get());\n  JSValueRef jsError = NULL;\n  JSStringRef sourceURL = JSC_JSStringCreateWithUTF8CString(ctx, url);\n  JSValueRef result = JSC_JSEvaluateScript(ctx, code, NULL, sourceURL, 0, &jsError);\n\n  JSC_JSStringRelease(ctx, code);\n  JSC_JSStringRelease(ctx, sourceURL);\n\n  if (!result) {\n    NSError *error = RCTNSErrorFromJSErrorRef(jsError, ctx);\n    dispatch_async(dispatch_get_main_queue(), ^{\n      RCTFatal(error);\n      [executor invalidate];\n    });\n  }\n}\n\n- (void)_nativeRequire:(NSNumber *)moduleID\n{\n  if (!moduleID) {\n    return;\n  }\n\n  [_performanceLogger addValue:1 forTag:RCTPLRAMNativeRequiresCount];\n  [_performanceLogger appendStartForTag:RCTPLRAMNativeRequires];\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, ([@\"nativeRequire_\" stringByAppendingFormat:@\"%@\", moduleID]), nil);\n\n  const uint32_t ID = [moduleID unsignedIntValue];\n\n  if (ID < _randomAccessBundle.numTableEntries) {\n    ModuleData *moduleData = &_randomAccessBundle.table[ID];\n    const uint32_t size = NSSwapLittleIntToHost(moduleData->size);\n\n    // sparse entry in the table -- module does not exist or is contained in the startup section\n    if (size == 0) {\n      return;\n    }\n\n    executeRandomAccessModule(self, ID, NSSwapLittleIntToHost(moduleData->offset), size);\n  }\n\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"js_call\");\n  [_performanceLogger appendStopForTag:RCTPLRAMNativeRequires];\n}\n\nstatic RandomAccessBundleStartupCode readRAMBundle(file_ptr bundle, RandomAccessBundleData &randomAccessBundle)\n{\n  // read in magic header, number of entries, and length of the startup section\n  uint32_t header[3];\n  if (fread(&header, 1, sizeof(header), bundle.get()) != sizeof(header)) {\n    return RandomAccessBundleStartupCode::empty();\n  }\n\n  const size_t numTableEntries = NSSwapLittleIntToHost(header[1]);\n  const size_t startupCodeSize = NSSwapLittleIntToHost(header[2]);\n  const size_t tableSize = numTableEntries * sizeof(ModuleData);\n\n  // allocate memory for meta data and lookup table. malloc instead of new to avoid constructor calls\n  auto table = std::make_unique<ModuleData[]>(numTableEntries);\n  if (!table) {\n    return RandomAccessBundleStartupCode::empty();\n  }\n\n  // read the lookup table from the file\n  if (fread(table.get(), 1, tableSize, bundle.get()) != tableSize) {\n    return RandomAccessBundleStartupCode::empty();\n  }\n\n  // read the startup code\n  memory_ptr code(malloc(startupCodeSize), free);\n  if (!code || fread(code.get(), 1, startupCodeSize, bundle.get()) != startupCodeSize) {\n    return RandomAccessBundleStartupCode::empty();\n  }\n\n  randomAccessBundle.bundle = std::move(bundle);\n  randomAccessBundle.baseOffset = sizeof(header) + tableSize;\n  randomAccessBundle.numTableEntries = numTableEntries;\n  randomAccessBundle.table = std::move(table);\n\n  return {std::move(code), startupCodeSize};\n}\n\nstatic NSData *loadRAMBundle(NSURL *sourceURL, NSError **error, RandomAccessBundleData &randomAccessBundle)\n{\n  file_ptr bundle(fopen(sourceURL.path.UTF8String, \"r\"), fclose);\n  if (!bundle) {\n    if (error) {\n      *error = RCTErrorWithMessage([NSString stringWithFormat:@\"Bundle %@ cannot be opened: %d\", sourceURL.path, errno]);\n    }\n    return nil;\n  }\n\n  auto startupCode = readRAMBundle(std::move(bundle), randomAccessBundle);\n  if (startupCode.isEmpty()) {\n    if (error) {\n      *error = RCTErrorWithMessage(@\"Error loading RAM Bundle\");\n    }\n    return nil;\n  }\n\n  return [NSData dataWithBytesNoCopy:startupCode.code.release() length:startupCode.size freeWhenDone:YES];\n}\n\n- (JSContext *)jsContext\n{\n  return [self context].context;\n}\n\n@end\n\n@implementation RCTJSContextProvider\n{\n  dispatch_semaphore_t _semaphore;\n  NSThread *_javaScriptThread;\n  JSContext *_context;\n}\n\n- (instancetype)initWithUseCustomJSCLibrary:(BOOL)useCustomJSCLibrary\n{\n  if (self = [super init]) {\n    _semaphore = dispatch_semaphore_create(0);\n    _useCustomJSCLibrary = useCustomJSCLibrary;\n    _javaScriptThread = newJavaScriptThread();\n    [self performSelector:@selector(_createContext) onThread:_javaScriptThread withObject:nil waitUntilDone:NO];\n  }\n  return self;\n}\n\n- (void)_createContext\n{\n  if (_useCustomJSCLibrary) {\n    JSC_configureJSCForIOS(true, \"{}\");\n  }\n  JSGlobalContextRef ctx = JSC_JSGlobalContextCreateInGroup((bool)_useCustomJSCLibrary, nullptr, nullptr);\n  _context = [JSC_JSContext(ctx) contextWithJSGlobalContextRef:ctx];\n  installBasicSynchronousHooksOnContext(_context);\n  dispatch_semaphore_signal(_semaphore);\n}\n\n- (RCTJSContextData)data\n{\n  // Be sure this method is only called once, otherwise it will hang here forever:\n  dispatch_semaphore_wait(_semaphore, DISPATCH_TIME_FOREVER);\n  return {\n    .useCustomJSCLibrary = _useCustomJSCLibrary,\n    .javaScriptThread = _javaScriptThread,\n    .context = _context,\n  };\n}\n\n\n- (RCTJSCExecutor *)createExecutorWithContext:(JSContext **)JSContext\n{\n  const RCTJSContextData data = self.data;\n  if (JSContext) {\n    *JSContext = data.context;\n  }\n  return [[RCTJSCExecutor alloc] initWithJSContextData:data];\n}\n\n@end\n"
  },
  {
    "path": "React/Executors/RCTWebViewExecutor.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDefines.h\"\n\n#if RCT_DEV // Debug executors are only supported in dev mode\n\n#import <WebKit/WebKit.h> //TODO:\n\n#import \"RCTJavaScriptExecutor.h\"\n\n/**\n * Uses an embedded web view merely for the purpose of being able to reuse the\n * existing webkit debugging tools. Fulfills the role of a very constrained\n * `JSContext`, which we call `RCTJavaScriptExecutor`.\n *\n * TODO: To ensure production-identical execution, scrub the window\n * environment. And ensure main thread operations are actually added to a queue\n * instead of being executed immediately if already on the main thread.\n */\n@interface RCTWebViewExecutor : NSObject<RCTJavaScriptExecutor>\n\n// Only one callback stored - will only be invoked for the latest issued\n// application script request.\n@property (nonatomic, copy) RCTJavaScriptCompleteBlock onApplicationScriptLoaded;\n\n/**\n * Instantiate with a specific webview instance\n */\n- (instancetype)initWithWebView:(WebView *)webView NS_DESIGNATED_INITIALIZER;\n\n/**\n * Invoke this to reclaim the web view for reuse. This is necessary in order to\n * allow debuggers to remain open, when creating a new `RCTWebViewExecutor`.\n * This guards against the web view being invalidated, and makes sure the\n * `delegate` is cleared first.\n */\n- (WebView *)invalidateAndReclaimWebView;\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/Executors/RCTWebViewExecutor.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <WebKit/WebKit.h>\n\n#import \"RCTDefines.h\"\n\n#if RCT_DEV // Debug executors are only supported in dev mode\n\n#import \"RCTWebViewExecutor.h\"\n\n#import <objc/runtime.h>\n\n#import \"RCTLog.h\"\n#import \"RCTUtils.h\"\n\nstatic void RCTReportError(RCTJavaScriptCallback callback, NSString *fmt, ...)\n{\n  va_list args;\n  va_start(args, fmt);\n\n  NSString *description = [[NSString alloc] initWithFormat:fmt arguments:args];\n  RCTLogError(@\"%@\", description);\n\n  NSError *error = [NSError errorWithDomain:NSStringFromClass([RCTWebViewExecutor class])\n                                       code:3\n                                   userInfo:@{NSLocalizedDescriptionKey:description}];\n  callback(nil, error);\n\n  va_end(args);\n}\n\n@interface RCTWebViewExecutor () <WebResourceLoadDelegate>\n\n@end\n\n@implementation RCTWebViewExecutor\n{\n  WebView *_webView;\n  NSMutableDictionary *_objectsToInject;\n  NSRegularExpression *_commentsRegex;\n  NSRegularExpression *_scriptTagsRegex;\n}\n\nRCT_EXPORT_MODULE()\n\n@synthesize valid = _valid;\n\n- (instancetype)initWithWebView:(WebView *)webView\n{\n  if ((self = [super init])) {\n    _webView = webView;\n  }\n  return self;\n}\n\n- (instancetype)init\n{\n  return [self initWithWebView:nil];\n}\n\n- (void)setUp\n{\n  if (!_webView) {\n    [self executeBlockOnJavaScriptQueue:^{\n      _webView = [WebView new];\n     // _webView.delegate = self;\n    }];\n  }\n\n  _objectsToInject = [NSMutableDictionary new];\n  _commentsRegex = [NSRegularExpression regularExpressionWithPattern:@\"(^ *?\\\\/\\\\/.*?$|\\\\/\\\\*\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)\" options:NSRegularExpressionAnchorsMatchLines error:NULL];\n  _scriptTagsRegex = [NSRegularExpression regularExpressionWithPattern:@\"<(\\\\/?script[^>]*?)>\" options:0 error:NULL];\n}\n\n- (void)invalidate\n{\n  _valid = NO;\n  //_webView.delegate = nil;\n  _webView = nil;\n}\n\n- (WebView *)invalidateAndReclaimWebView\n{\n  WebView *webView = _webView;\n  [self invalidate];\n  return webView;\n}\n\n- (void)executeJSCall:(NSString *)name\n               method:(NSString *)method\n            arguments:(NSArray *)arguments\n             callback:(RCTJavaScriptCallback)onComplete\n{\n  RCTAssert(onComplete != nil, @\"\");\n  [self executeBlockOnJavaScriptQueue:^{\n    if (!self.isValid) {\n      return;\n    }\n\n    NSError *error;\n    NSString *argsString = RCTJSONStringify(arguments, &error);\n    if (!argsString) {\n      RCTReportError(onComplete, @\"Cannot convert argument to string: %@\", error);\n      return;\n    }\n    NSString *execString = [NSString stringWithFormat:@\"JSON.stringify(require('%@').%@.apply(null, %@));\", name, method, argsString];\n\n    NSString *ret = [_webView stringByEvaluatingJavaScriptFromString:execString];\n    if (ret.length == 0) {\n      RCTReportError(onComplete, @\"Empty return string: JavaScript error running script: %@\", execString);\n      return;\n    }\n\n    id objcValue = RCTJSONParse(ret, &error);\n    if (!objcValue) {\n      RCTReportError(onComplete, @\"Cannot parse json response: %@\", error);\n      return;\n    }\n    onComplete(objcValue, nil);\n  }];\n}\n\n/**\n * We cannot use the standard eval JS method. Source will not show up in the\n * debugger. So we have to use this (essentially) async API - and register\n * ourselves as the webview delegate to be notified when load is complete.\n */\n- (void)executeApplicationScript:(NSData *)script\n                       sourceURL:(NSURL *)url\n                      onComplete:(RCTJavaScriptCompleteBlock)onComplete\n{\n  if (![NSThread isMainThread]) {\n    dispatch_sync(dispatch_get_main_queue(), ^{\n      [self executeApplicationScript:script sourceURL:url onComplete:onComplete];\n    });\n    return;\n  }\n\n  RCTAssert(onComplete != nil, @\"\");\n  NSString *scriptString = [[NSString alloc] initWithData:script encoding:NSUTF8StringEncoding];\n  __weak RCTWebViewExecutor *weakSelf = self;\n  _onApplicationScriptLoaded = ^(NSError *error){\n    RCTWebViewExecutor *strongSelf = weakSelf;\n    if (!strongSelf) {\n      return;\n    }\n    strongSelf->_valid = error == nil;\n    onComplete(error);\n  };\n\n  if (_objectsToInject.count > 0) {\n    NSMutableString *scriptWithInjections = [[NSMutableString alloc] initWithString:@\"/* BEGIN NATIVELY INJECTED OBJECTS */\\n\"];\n    [_objectsToInject enumerateKeysAndObjectsUsingBlock:\n     ^(NSString *objectName, NSString *blockScript, __unused BOOL *stop) {\n      [scriptWithInjections appendString:objectName];\n      [scriptWithInjections appendString:@\" = (\"];\n      [scriptWithInjections appendString:blockScript];\n      [scriptWithInjections appendString:@\");\\n\"];\n    }];\n    [_objectsToInject removeAllObjects];\n    [scriptWithInjections appendString:@\"/* END NATIVELY INJECTED OBJECTS */\\n\"];\n    [scriptWithInjections appendString:scriptString];\n    scriptString = scriptWithInjections;\n  }\n\n  scriptString = [_commentsRegex stringByReplacingMatchesInString:scriptString\n                                                          options:0\n                                                            range:NSMakeRange(0, script.length)\n                                                     withTemplate:@\"\"];\n  scriptString = [_scriptTagsRegex stringByReplacingMatchesInString:scriptString\n                                                            options:0\n                                                              range:NSMakeRange(0, script.length)\n                                                       withTemplate:@\"\\\\\\\\<$1\\\\\\\\>\"];\n\n  NSString *runScript =\n    [NSString\n      stringWithFormat:@\"<html><head></head><body><script type='text/javascript'>%@</script></body></html>\",\n      scriptString\n    ];\n  [[_webView mainFrame] loadHTMLString:runScript baseURL:url];\n}\n\n- (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block\n{\n\n  if ([NSThread isMainThread]) {\n    block();\n  } else {\n    dispatch_async(dispatch_get_main_queue(), block);\n  }\n}\n\n- (void)executeAsyncBlockOnJavaScriptQueue:(dispatch_block_t)block\n{\n  dispatch_async(dispatch_get_main_queue(), block);\n}\n\n/**\n * `UIWebViewDelegate` methods. Handle application script load.\n */\n- (void)webViewDidFinishLoad:(__unused WebView *)webView\n{\n  RCTAssertMainThread();\n  if (_onApplicationScriptLoaded) {\n    _onApplicationScriptLoaded(nil); // TODO(frantic): how to fetch error from UIWebView?\n  }\n  _onApplicationScriptLoaded = nil;\n}\n\n- (void)injectJSONText:(NSString *)script\n   asGlobalObjectNamed:(NSString *)objectName\n              callback:(RCTJavaScriptCompleteBlock)onComplete\n{\n  if (RCT_DEBUG) {\n    RCTAssert(!_objectsToInject[objectName],\n              @\"already injected object named %@\", _objectsToInject[objectName]);\n  }\n  _objectsToInject[objectName] = script;\n  onComplete(nil);\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/Inspector/RCTInspector.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <Foundation/Foundation.h>\n#import <React/RCTDefines.h>\n\n#if RCT_DEV\n\n@class RCTInspectorRemoteConnection;\n\n@interface RCTInspectorLocalConnection : NSObject\n- (void)sendMessage:(NSString *)message;\n- (void)disconnect;\n@end\n\n@interface RCTInspectorPage : NSObject\n@property (nonatomic, readonly) NSInteger id;\n@property (nonatomic, readonly) NSString *title;\n@end\n\n@interface RCTInspector : NSObject\n+ (NSArray<RCTInspectorPage *> *)pages;\n+ (RCTInspectorLocalConnection *)connectPage:(NSInteger)pageId\n                         forRemoteConnection:(RCTInspectorRemoteConnection *)remote;\n@end\n\n#endif\n"
  },
  {
    "path": "React/Inspector/RCTInspector.mm",
    "content": "\n#import \"RCTInspector.h\"\n\n#if RCT_DEV\n\n#include <jschelpers/JavaScriptCore.h>\n#include <jsinspector/InspectorInterfaces.h>\n\n#import \"RCTDefines.h\"\n#import \"RCTInspectorPackagerConnection.h\"\n#import \"RCTLog.h\"\n#import \"RCTSRWebSocket.h\"\n#import \"RCTUtils.h\"\n\nusing namespace facebook::react;\n\n// This is a port of the Android impl, at\n// react-native-github/ReactAndroid/src/main/java/com/facebook/react/bridge/Inspector.java\n// react-native-github/ReactAndroid/src/main/jni/react/jni/JInspector.cpp\n// please keep consistent :)\n\nclass RemoteConnection : public IRemoteConnection {\npublic:\nRemoteConnection(RCTInspectorRemoteConnection *connection) :\n  _connection(connection) {}\n\n  virtual void onMessage(std::string message) override {\n    [_connection onMessage:@(message.c_str())];\n  }\n\n  virtual void onDisconnect() override {\n    [_connection onDisconnect];\n  }\nprivate:\n  const RCTInspectorRemoteConnection *_connection;\n};\n\n@interface RCTInspectorPage () {\n  NSInteger _id;\n  NSString *_title;\n}\n- (instancetype)initWithId:(NSInteger)id\n                     title:(NSString *)title;\n@end\n\n@interface RCTInspectorLocalConnection () {\n  std::unique_ptr<ILocalConnection> _connection;\n}\n- (instancetype)initWithConnection:(std::unique_ptr<ILocalConnection>)connection;\n@end\n\nstatic IInspector *getInstance()\n{\n  return &facebook::react::getInspectorInstance();\n}\n\n@implementation RCTInspector\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n+ (NSArray<RCTInspectorPage *> *)pages\n{\n  std::vector<InspectorPage> pages = getInstance()->getPages();\n  NSMutableArray<RCTInspectorPage *> *array = [NSMutableArray arrayWithCapacity:pages.size()];\n  for (size_t i = 0; i < pages.size(); i++) {\n    RCTInspectorPage *pageWrapper = [[RCTInspectorPage alloc] initWithId:pages[i].id\n                                                                   title:@(pages[i].title.c_str())];\n    [array addObject:pageWrapper];\n\n  }\n  return array;\n}\n\n+ (RCTInspectorLocalConnection *)connectPage:(NSInteger)pageId\n                         forRemoteConnection:(RCTInspectorRemoteConnection *)remote\n{\n  auto localConnection = getInstance()->connect(pageId, std::make_unique<RemoteConnection>(remote));\n  return [[RCTInspectorLocalConnection alloc] initWithConnection:std::move(localConnection)];\n}\n\n@end\n\n@implementation RCTInspectorPage\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (instancetype)initWithId:(NSInteger)id\n                     title:(NSString *)title\n{\n  if (self = [super init]) {\n    _id = id;\n    _title = title;\n  }\n  return self;\n}\n\n@end\n\n@implementation RCTInspectorLocalConnection\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (instancetype)initWithConnection:(std::unique_ptr<ILocalConnection>)connection\n{\n  if (self = [super init]) {\n    _connection = std::move(connection);\n  }\n  return self;\n}\n\n- (void)sendMessage:(NSString *)message\n{\n  _connection->sendMessage([message UTF8String]);\n}\n\n- (void)disconnect\n{\n  _connection->disconnect();\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/Inspector/RCTInspectorPackagerConnection.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#import <Foundation/Foundation.h>\n#import <React/RCTDefines.h>\n#import <React/RCTInspector.h>\n\n#if RCT_DEV\n\n@interface RCTInspectorPackagerConnection : NSObject\n- (instancetype)initWithURL:(NSURL *)url;\n- (void)connect;\n- (void)closeQuietly;\n- (void)sendEventToAllConnections:(NSString *)event;\n@end\n\n@interface RCTInspectorRemoteConnection : NSObject\n- (void)onMessage:(NSString *)message;\n- (void)onDisconnect;\n@end\n\n#endif\n"
  },
  {
    "path": "React/Inspector/RCTInspectorPackagerConnection.m",
    "content": "#import \"RCTInspectorPackagerConnection.h\"\n\n#if RCT_DEV\n\n#import \"RCTDefines.h\"\n#import \"RCTInspector.h\"\n#import \"RCTLog.h\"\n#import \"RCTSRWebSocket.h\"\n#import \"RCTUtils.h\"\n\n// This is a port of the Android impl, at\n// ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorPackagerConnection.java\n// please keep consistent :)\n\nconst int RECONNECT_DELAY_MS = 2000;\n\n@interface RCTInspectorPackagerConnection () <RCTSRWebSocketDelegate> {\n  NSURL *_url;\n  NSMutableDictionary<NSString *, RCTInspectorLocalConnection *> *_inspectorConnections;\n  RCTSRWebSocket *_webSocket;\n  dispatch_queue_t _jsQueue;\n  BOOL _closed;\n  BOOL _suppressConnectionErrors;\n}\n@end\n\n@interface RCTInspectorRemoteConnection () {\n  __weak RCTInspectorPackagerConnection *_owningPackagerConnection;\n  NSString *_pageId;\n}\n- (instancetype)initWithPackagerConnection:(RCTInspectorPackagerConnection *)owningPackagerConnection\n                                    pageId:(NSString *)pageId;\n@end\n\nstatic NSDictionary<NSString *, id> *makePageIdPayload(NSString *pageId)\n{\n  return @{ @\"pageId\": pageId };\n}\n\n@implementation RCTInspectorPackagerConnection\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (instancetype)initWithURL:(NSURL *)url\n{\n  if (self = [super init]) {\n    _url = url;\n    _inspectorConnections = [NSMutableDictionary new];\n    _jsQueue = dispatch_queue_create(\"com.facebook.react.WebSocketExecutor\", DISPATCH_QUEUE_SERIAL);\n  }\n  return self;\n}\n\n- (void)handleProxyMessage:(NSDictionary<NSString *, id> *)message\n{\n  NSString *event = message[@\"event\"];\n  NSDictionary *payload = message[@\"payload\"];\n  if ([@\"getPages\" isEqualToString:event]) {\n    [self sendEvent:event payload:[self pages]];\n  } else if ([@\"wrappedEvent\" isEqualToString:event]) {\n    [self handleWrappedEvent:payload];\n  } else if ([@\"connect\" isEqualToString:event]) {\n    [self handleConnect:payload];\n  } else if ([@\"disconnect\" isEqualToString:event]) {\n    [self handleDisconnect:payload];\n  } else {\n    RCTLogError(@\"Unknown event: %@\", event);\n  }\n}\n\n- (void)sendEventToAllConnections:(NSString *)event\n{\n  for (NSString *pageId in _inspectorConnections) {\n    [_inspectorConnections[pageId] sendMessage:event];\n  }\n}\n\n- (void)closeAllConnections\n{\n  for (NSString *pageId in _inspectorConnections){\n    [[_inspectorConnections objectForKey:pageId] disconnect];\n  }\n  [_inspectorConnections removeAllObjects];\n}\n\n- (void)handleConnect:(NSDictionary *)payload\n{\n  NSString *pageId = payload[@\"pageId\"];\n  if (_inspectorConnections[pageId]) {\n    [_inspectorConnections removeObjectForKey:pageId];\n    RCTLogError(@\"Already connected: %@\", pageId);\n    return;\n  }\n\n  RCTInspectorRemoteConnection *remoteConnection =\n    [[RCTInspectorRemoteConnection alloc] initWithPackagerConnection:self\n                                                              pageId:pageId];\n\n  RCTInspectorLocalConnection *inspectorConnection = [RCTInspector connectPage:[pageId integerValue]\n                                                           forRemoteConnection:remoteConnection];\n  _inspectorConnections[pageId] = inspectorConnection;\n}\n\n- (void)handleDisconnect:(NSDictionary *)payload\n{\n  NSString *pageId = payload[@\"pageId\"];\n  RCTInspectorLocalConnection *inspectorConnection = _inspectorConnections[pageId];\n  if (inspectorConnection) {\n    [self removeConnectionForPage:pageId];\n    [inspectorConnection disconnect];\n  }\n}\n\n- (void)removeConnectionForPage:(NSString *)pageId\n{\n  [_inspectorConnections removeObjectForKey:pageId];\n}\n\n- (void)handleWrappedEvent:(NSDictionary *)payload\n{\n  NSString *pageId = payload[@\"pageId\"];\n  NSString *wrappedEvent = payload[@\"wrappedEvent\"];\n  RCTInspectorLocalConnection *inspectorConnection = _inspectorConnections[pageId];\n  if (!inspectorConnection) {\n    RCTLogWarn(\n      @\"Not connected to page: %@ , failed trying to handle event: %@\",\n      pageId,\n      wrappedEvent);\n    return;\n  }\n  [inspectorConnection sendMessage:wrappedEvent];\n}\n\n- (NSArray *)pages\n{\n  NSArray<RCTInspectorPage *> *pages = [RCTInspector pages];\n  NSMutableArray *array = [NSMutableArray arrayWithCapacity:pages.count];\n  for (RCTInspectorPage *page in pages) {\n    NSDictionary *jsonPage = @{\n      @\"id\": [@(page.id) stringValue],\n      @\"title\": page.title,\n      @\"app\": [[NSBundle mainBundle] bundleIdentifier],\n    };\n    [array addObject:jsonPage];\n  }\n  return array;\n}\n\n- (void)sendWrappedEvent:(NSString *)pageId\n                 message:(NSString *)message\n{\n  NSDictionary *payload = @{\n    @\"pageId\": pageId,\n    @\"wrappedEvent\": message,\n  };\n  [self sendEvent:@\"wrappedEvent\" payload:payload];\n}\n\n- (void)sendEvent:(NSString *)name payload:(id)payload\n{\n  NSDictionary *jsonMessage = @{\n    @\"event\": name,\n    @\"payload\": payload,\n  };\n  [self sendToPackager:jsonMessage];\n}\n\n// analogous to InspectorPackagerConnection.Connection.onFailure(...)\n- (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error\n{\n  if (_webSocket) {\n    [self abort:@\"Websocket exception\"\n      withCause:error];\n  }\n  if (!_closed) {\n    [self reconnect];\n  }\n}\n\n// analogous to InspectorPackagerConnection.Connection.onMessage(...)\n- (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)opaqueMessage\n{\n  // warn but don't die on unrecognized messages\n  if (![opaqueMessage isKindOfClass:[NSString class]]) {\n    RCTLogWarn(@\"Unrecognized inspector message, object is of type: %@\", [opaqueMessage class]);\n    return;\n  }\n\n  NSString *messageText = opaqueMessage;\n  NSError *error = nil;\n  id parsedJSON = RCTJSONParse(messageText, &error);\n  if (error) {\n    RCTLogWarn(@\"Unrecognized inspector message, string was not valid JSON: %@\",\n      messageText);\n    return;\n  }\n\n  [self handleProxyMessage:parsedJSON];\n}\n\n// analogous to InspectorPackagerConnection.Connection.onClosed(...)\n- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code\n                                                        reason:(NSString *)reason\n                                                      wasClean:(BOOL)wasClean\n{\n  _webSocket = nil;\n  [self closeAllConnections];\n  if (!_closed) {\n    [self reconnect];\n  }\n}\n\n- (void)connect\n{\n  if (_closed) {\n    RCTLogError(@\"Illegal state: Can't connect after having previously been closed.\");\n    return;\n  }\n\n  // The corresopnding android code has a lot of custom config options for\n  // timeouts, but it appears the iOS RCTSRWebSocket API doesn't have the same\n  // implemented options.\n  _webSocket = [[RCTSRWebSocket alloc] initWithURL:_url];\n  [_webSocket setDelegateDispatchQueue:_jsQueue];\n  _webSocket.delegate = self;\n  [_webSocket open];\n}\n\n- (void)reconnect\n{\n  if (_closed) {\n    RCTLogError(@\"Illegal state: Can't reconnect after having previously been closed.\");\n    return;\n  }\n\n  if (_suppressConnectionErrors) {\n    RCTLogWarn(@\"Couldn't connect to packager, will silently retry\");\n    _suppressConnectionErrors = true;\n  }\n\n  __weak RCTInspectorPackagerConnection *weakSelf = self;\n  dispatch_after(\n    dispatch_time(DISPATCH_TIME_NOW, RECONNECT_DELAY_MS *NSEC_PER_MSEC),\n    dispatch_get_main_queue(), ^{\n      RCTInspectorPackagerConnection *strongSelf = weakSelf;\n      if (strongSelf && !strongSelf->_closed) {\n        [strongSelf connect];\n      }\n  });\n}\n\n- (void)closeQuietly\n{\n  _closed = true;\n  [self disposeWebSocket];\n}\n\n- (void)sendToPackager:(NSDictionary *)messageObject\n{\n  __weak RCTInspectorPackagerConnection *weakSelf = self;\n  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n    RCTInspectorPackagerConnection *strongSelf = weakSelf;\n    if (strongSelf && !strongSelf->_closed) {\n      NSError *error;\n      NSString *messageText = RCTJSONStringify(messageObject, &error);\n      if (error) {\n        RCTLogWarn(@\"Couldn't send event to packager: %@\", error);\n      } else {\n        [strongSelf->_webSocket send:messageText];\n      }\n    }\n  });\n}\n\n- (void)abort:(NSString *)message\n    withCause:(NSError *)cause\n{\n  // Don't log ECONNREFUSED at all; it's expected in cases where the server isn't listening.\n  if (![cause.domain isEqual:NSPOSIXErrorDomain] || cause.code != ECONNREFUSED) {\n    RCTLogInfo(@\"Error occurred, shutting down websocket connection: %@ %@\", message, cause);\n  }\n\n  [self closeAllConnections];\n  [self disposeWebSocket];\n}\n\n- (void)disposeWebSocket\n{\n  if (_webSocket) {\n    [_webSocket closeWithCode:1000\n                       reason:@\"End of session\"];\n    _webSocket.delegate = nil;\n    _webSocket = nil;\n  }\n}\n\n@end\n\n@implementation RCTInspectorRemoteConnection\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (instancetype)initWithPackagerConnection:(RCTInspectorPackagerConnection *)owningPackagerConnection\n                                    pageId:(NSString *)pageId\n{\n  if (self = [super init]) {\n    _owningPackagerConnection = owningPackagerConnection;\n    _pageId = pageId;\n  }\n  return self;\n}\n\n- (void)onMessage:(NSString *)message\n{\n  [_owningPackagerConnection sendWrappedEvent:_pageId\n                                      message:message];\n}\n\n- (void)onDisconnect\n{\n  RCTInspectorPackagerConnection *owningPackagerConnectionStrong = _owningPackagerConnection;\n  if (owningPackagerConnectionStrong) {\n    [owningPackagerConnectionStrong removeConnectionForPage:_pageId];\n    [owningPackagerConnectionStrong sendEvent:@\"disconnect\"\n                                      payload:makePageIdPayload(_pageId)];\n  }\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/Modules/RCTAccessibilityManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridge.h>\n#import <React/RCTBridgeModule.h>\n\nextern NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification; // posted when multiplier is changed\n\n@interface RCTAccessibilityManager : NSObject <RCTBridgeModule>\n\n@property (nonatomic, readonly) CGFloat multiplier;\n\n/// map from UIKit categories to multipliers\n@property (nonatomic, copy) NSDictionary<NSString *, NSNumber *> *multipliers;\n\n@property (nonatomic, assign) BOOL isVoiceOverEnabled;\n\n@end\n\n@interface RCTBridge (RCTAccessibilityManager)\n\n@property (nonatomic, readonly) RCTAccessibilityManager *accessibilityManager;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTAccessibilityManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAccessibilityManager.h\"\n\n#import \"RCTUIManager.h\"\n#import \"RCTBridge.h\"\n#import \"RCTConvert.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTLog.h\"\n\nNSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification = @\"RCTAccessibilityManagerDidUpdateMultiplierNotification\";\n\nstatic NSString *UIKitCategoryFromJSCategory(NSString *JSCategory)\n{\n  static NSDictionary *map = nil;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    map = @{@\"extraSmall\": UIContentSizeCategoryExtraSmall,\n            @\"small\": UIContentSizeCategorySmall,\n            @\"medium\": UIContentSizeCategoryMedium,\n            @\"large\": UIContentSizeCategoryLarge,\n            @\"extraLarge\": UIContentSizeCategoryExtraLarge,\n            @\"extraExtraLarge\": UIContentSizeCategoryExtraExtraLarge,\n            @\"extraExtraExtraLarge\": UIContentSizeCategoryExtraExtraExtraLarge,\n            @\"accessibilityMedium\": UIContentSizeCategoryAccessibilityMedium,\n            @\"accessibilityLarge\": UIContentSizeCategoryAccessibilityLarge,\n            @\"accessibilityExtraLarge\": UIContentSizeCategoryAccessibilityExtraLarge,\n            @\"accessibilityExtraExtraLarge\": UIContentSizeCategoryAccessibilityExtraExtraLarge,\n            @\"accessibilityExtraExtraExtraLarge\": UIContentSizeCategoryAccessibilityExtraExtraExtraLarge};\n  });\n  return map[JSCategory];\n}\n\n@interface RCTAccessibilityManager ()\n\n@property (nonatomic, copy) NSString *contentSizeCategory;\n@property (nonatomic, assign) CGFloat multiplier;\n\n@end\n\n@implementation RCTAccessibilityManager\n\n@synthesize bridge = _bridge;\n@synthesize multipliers = _multipliers;\n\nRCT_EXPORT_MODULE()\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES;\n}\n\n- (instancetype)init\n{\n  if ((self = [super init])) {\n\n    // TODO: can this be moved out of the startup path?\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(didReceiveNewContentSizeCategory:)\n                                                 name:UIContentSizeCategoryDidChangeNotification\n                                               object:nil];\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(didReceiveNewVoiceOverStatus:)\n                                                 name:UIAccessibilityVoiceOverStatusChanged\n                                               object:nil];\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(accessibilityAnnouncementDidFinish:)\n                                                 name:UIAccessibilityAnnouncementDidFinishNotification\n                                               object:nil];\n\n    self.contentSizeCategory = RCTSharedApplication().preferredContentSizeCategory;\n    _isVoiceOverEnabled = UIAccessibilityIsVoiceOverRunning();\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (void)didReceiveNewContentSizeCategory:(NSNotification *)note\n{\n  // self.contentSizeCategory = note.userInfo[UIContentSizeCategoryNewValueKey];\n}\n\n- (void)didReceiveNewVoiceOverStatus:(__unused NSNotification *)notification\n{\n  BOOL newIsVoiceOverEnabled = UIAccessibilityIsVoiceOverRunning();\n  if (_isVoiceOverEnabled != newIsVoiceOverEnabled) {\n    _isVoiceOverEnabled = newIsVoiceOverEnabled;\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n    [_bridge.eventDispatcher sendDeviceEventWithName:@\"voiceOverDidChange\"\n                                                body:@(_isVoiceOverEnabled)];\n#pragma clang diagnostic pop\n  }\n}\n\n- (void)accessibilityAnnouncementDidFinish:(__unused NSNotification *)notification\n{\n  NSDictionary *userInfo = notification.userInfo;\n  // Response dictionary to populate the event with.\n  NSDictionary *response = @{@\"announcement\": userInfo[UIAccessibilityAnnouncementKeyStringValue],\n                              @\"success\": userInfo[UIAccessibilityAnnouncementKeyWasSuccessful]};\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n  [_bridge.eventDispatcher sendDeviceEventWithName:@\"announcementDidFinish\"\n                                              body:response];\n#pragma clang diagnostic pop\n}\n\n- (void)setContentSizeCategory:(NSString *)contentSizeCategory\n{\n  if (_contentSizeCategory != contentSizeCategory) {\n    _contentSizeCategory = [contentSizeCategory copy];\n    [self invalidateMultiplier];\n  }\n}\n\n- (void)invalidateMultiplier\n{\n  self.multiplier = [self multiplierForContentSizeCategory:_contentSizeCategory];\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTAccessibilityManagerDidUpdateMultiplierNotification object:self];\n}\n\n- (CGFloat)multiplierForContentSizeCategory:(NSString *)category\n{\n  NSNumber *m = self.multipliers[category];\n  if (m.doubleValue <= 0.0) {\n    RCTLogError(@\"Can't determinte multiplier for category %@. Using 1.0.\", category);\n    m = @1.0;\n  }\n  return m.doubleValue;\n}\n\n- (void)setMultipliers:(NSDictionary<NSString *, NSNumber *> *)multipliers\n{\n  if (_multipliers != multipliers) {\n    _multipliers = [multipliers copy];\n    [self invalidateMultiplier];\n  }\n}\n\n- (NSDictionary<NSString *, NSNumber *> *)multipliers\n{\n  if (_multipliers == nil) {\n    _multipliers = @{UIContentSizeCategoryExtraSmall: @0.823,\n                     UIContentSizeCategorySmall: @0.882,\n                     UIContentSizeCategoryMedium: @0.941,\n                     UIContentSizeCategoryLarge: @1.0,\n                     UIContentSizeCategoryExtraLarge: @1.118,\n                     UIContentSizeCategoryExtraExtraLarge: @1.235,\n                     UIContentSizeCategoryExtraExtraExtraLarge: @1.353,\n                     UIContentSizeCategoryAccessibilityMedium: @1.786,\n                     UIContentSizeCategoryAccessibilityLarge: @2.143,\n                     UIContentSizeCategoryAccessibilityExtraLarge: @2.643,\n                     UIContentSizeCategoryAccessibilityExtraExtraLarge: @3.143,\n                     UIContentSizeCategoryAccessibilityExtraExtraExtraLarge: @3.571};\n  }\n  return _multipliers;\n}\n\nRCT_EXPORT_METHOD(setAccessibilityContentSizeMultipliers:(NSDictionary *)JSMultipliers)\n{\n  NSMutableDictionary<NSString *, NSNumber *> *multipliers = [NSMutableDictionary new];\n  for (NSString *__nonnull JSCategory in JSMultipliers) {\n    NSNumber *m = [RCTConvert NSNumber:JSMultipliers[JSCategory]];\n    NSString *UIKitCategory = UIKitCategoryFromJSCategory(JSCategory);\n    multipliers[UIKitCategory] = m;\n  }\n  self.multipliers = multipliers;\n}\n\nRCT_EXPORT_METHOD(setAccessibilityFocus:(nonnull NSNumber *)reactTag)\n{\n  dispatch_async(dispatch_get_main_queue(), ^{\n    UIView *view = [self.bridge.uiManager viewForReactTag:reactTag];\n    UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, view);\n  });\n}\n\nRCT_EXPORT_METHOD(announceForAccessibility:(NSString *)announcement)\n{\n  UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, announcement);\n}\n\nRCT_EXPORT_METHOD(getMultiplier:(RCTResponseSenderBlock)callback)\n{\n  if (callback) {\n    callback(@[ @(self.multiplier) ]);\n  }\n}\n\nRCT_EXPORT_METHOD(getCurrentVoiceOverState:(RCTResponseSenderBlock)callback\n                  error:(__unused RCTResponseSenderBlock)error)\n{\n  callback(@[@(_isVoiceOverEnabled)]);\n}\n\n@end\n\n@implementation RCTBridge (RCTAccessibilityManager)\n\n- (RCTAccessibilityManager *)accessibilityManager\n{\n  return [self moduleForClass:[RCTAccessibilityManager class]];\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTAlertManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTInvalidating.h>\n\ntypedef NS_ENUM(NSInteger, RCTAlertViewStyle) {\n  RCTAlertViewStyleDefault = 0,\n  RCTAlertViewStyleSecureTextInput,\n  RCTAlertViewStylePlainTextInput,\n  RCTAlertViewStyleLoginAndPasswordInput\n};\n\n\n@interface RCTAlertManager : NSObject <RCTBridgeModule, RCTInvalidating>\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTAlertManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n#import <AppKit/AppKit.h>\n#import \"RCTAlertManager.h\"\n\n#import \"RCTAssert.h\"\n#import \"RCTConvert.h\"\n#import \"RCTLog.h\"\n#import \"RCTUtils.h\"\n\n@implementation RCTConvert (NSAlertViewStyle)\n\nRCT_ENUM_CONVERTER(RCTAlertViewStyle, (@{\n  @\"default\": @(RCTAlertViewStyleDefault),\n  @\"secure-text\": @(RCTAlertViewStyleSecureTextInput),\n  @\"plain-text\": @(RCTAlertViewStylePlainTextInput),\n  @\"login-password\": @(RCTAlertViewStyleLoginAndPasswordInput),\n}), RCTAlertViewStyleDefault, integerValue)\n\nRCT_ENUM_CONVERTER(NSAlertStyle, (@{\n  @\"default\": @(NSAlertStyleWarning),\n  @\"information\": @(NSAlertStyleInformational),\n  @\"critical\": @(NSAlertStyleCritical)\n}), NSAlertStyleWarning, integerValue)\n\n@end\n\n@interface RCTAlertManager() <NSAlertDelegate>\n\n@end\n\n@implementation RCTAlertManager\n{\n  NSMutableArray<NSAlert *> *_alerts;\n  NSMutableArray<RCTResponseSenderBlock> *_alertCallbacks;\n  NSMutableArray<NSArray<NSString *> *> *_alertButtonKeys;\n}\n\nRCT_EXPORT_MODULE()\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n- (void)invalidate\n{\n}\n\n/**\n * @param {NSDictionary} args Dictionary of the form\n *\n *   @{\n *     @\"message\": @\"<Alert message>\",\n *     @\"buttons\": @[\n *       @{@\"<key1>\": @\"<title1>\"},\n *       @{@\"<key2>\": @\"<title2>\"},\n *     ],\n *     @\"cancelButtonKey\": @\"<key2>\",\n *   }\n * The key from the `buttons` dictionary is passed back in the callback on click.\n * Buttons are displayed in the order they are specified.\n */\nRCT_EXPORT_METHOD(alertWithArgs:(NSDictionary *)args\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  NSString *title = args[@\"title\"];\n  NSString *message = args[@\"message\"];\n  RCTAlertViewStyle type = [RCTConvert RCTAlertViewStyle:args[@\"type\"]];\n  NSArray *buttons = args[@\"buttons\"];\n\n  if (!title && !message) {\n    RCTLogError(@\"Must specify either an alert title, or message, or both\");\n    return;\n  } else if (buttons.count == 0) {\n    RCTLogError(@\"Must have at least one button.\");\n    return;\n  }\n  \n  if (!title) {\n    title = message;\n  }\n\n  if (buttons.count == 0) {\n    if (type == RCTAlertViewStyleDefault) {\n      buttons = @[@{@\"0\": RCTUIKitLocalizedString(@\"OK\")}];\n    } else {\n      buttons = @[\n        @{@\"0\": RCTUIKitLocalizedString(@\"OK\")},\n        @{@\"1\": RCTUIKitLocalizedString(@\"Cancel\")},\n      ];\n    }\n  }\n\n  NSAlert *alertView = RCTAlertView(title, message, self, nil, nil);\n  alertView.alertStyle = [RCTConvert NSAlertStyle:args[@\"style\"]];\n  NSMutableArray *buttonKeys = [[NSMutableArray alloc] initWithCapacity:buttons.count];\n\n  NSInteger index = 0;\n  for (NSDictionary *button in buttons) {\n    if (button.count != 1) {\n      RCTLogError(@\"Button definitions should have exactly one key.\");\n    }\n    NSString *buttonKey = button.allKeys.firstObject;\n    NSString *buttonTitle = [button[buttonKey] description];\n    [alertView addButtonWithTitle:buttonTitle];\n    [buttonKeys addObject:buttonKey];\n    index ++;\n  }\n\n  [_alerts addObject:alertView];\n  [_alertCallbacks addObject:callback ?: ^(__unused id unused) {}];\n  [_alertButtonKeys addObject:buttonKeys];\n\n  NSInteger buttonPosition = [alertView runModal];\n  NSString *buttonKey = [buttonKeys objectAtIndex: buttonPosition - NSAlertFirstButtonReturn];\n  \n  if (buttonKey && callback) {\n    callback(@[buttonKey]);\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTAppState.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTEventEmitter.h>\n\n@interface RCTAppState : RCTEventEmitter\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTAppState.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAppState.h\"\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTUtils.h\"\n\nstatic NSString *RCTCurrentAppBackgroundState()\n{\n  static NSDictionary *states;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    states = @{\n//      @(NSApplication): @\"active\",\n//      @(UIApplicationStateBackground): @\"background\",\n//      @(UIApplicationStateInactive): @\"inactive\"\n    };\n  });\n\n  if (RCTRunningInAppExtension()) {\n    return @\"extension\";\n  }\n\n  //return states[@(RCTSharedApplication().applicationState)] ?: @\"unknown\";\n  return @\"unknown\";\n}\n\n@implementation RCTAppState\n{\n  NSString *_lastKnownState;\n}\n\nRCT_EXPORT_MODULE()\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES;\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n- (NSDictionary *)constantsToExport\n{\n  return @{@\"initialAppState\": RCTCurrentAppBackgroundState()};\n}\n\n#pragma mark - Lifecycle\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[@\"appStateDidChange\", @\"memoryWarning\"];\n}\n\n- (void)startObserving\n{\n  _lastKnownState = RCTCurrentAppBackgroundState();\n\n  for (NSString *name in @[NSApplicationWillBecomeActiveNotification,\n                           NSApplicationDidHideNotification,\n                           NSApplicationDidFinishLaunchingNotification]) {\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(handleAppStateDidChange)\n                                                 name:name\n                                               object:nil];\n  }\n}\n\n- (void)stopObserving\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n#pragma mark - App Notification Methods\n\n- (void)handleAppStateDidChange\n{\n  NSString *newState = RCTCurrentAppBackgroundState();\n  if (![newState isEqualToString:_lastKnownState]) {\n    _lastKnownState = newState;\n    [self sendEventWithName:@\"appStateDidChange\"\n                       body:@{@\"app_state\": _lastKnownState}];\n  }\n}\n\n#pragma mark - Public API\n\n/**\n * Get the current background/foreground state of the app\n */\nRCT_EXPORT_METHOD(getCurrentAppState:(RCTResponseSenderBlock)callback\n                  error:(__unused RCTResponseSenderBlock)error)\n{\n  callback(@[@{@\"app_state\": RCTCurrentAppBackgroundState()}]);\n}\n\nRCT_EXPORT_METHOD(exit)\n{\n  [RCTSharedApplication() terminate:self];\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTAppearance.h",
    "content": "#import <React/RCTBridgeModule.h>\n#import <React/RCTEventEmitter.h>\n\n@interface RCTAppearance : RCTEventEmitter\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTAppearance.m",
    "content": "#import \"RCTAppearance.h\"\n\n@implementation RCTAppearance\n\nRCT_EXPORT_MODULE()\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n- (void)startObserving\n{\n  [NSApp addObserver:self\n          forKeyPath:@\"effectiveAppearance\" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];\n\n}\n\n- (void)observeValueForKeyPath:(__unused NSString *)keyPath\n                      ofObject:(__unused id)object\n                        change:(__unused NSDictionary *)change\n                       context:(__unused void *)context {\n  [NSAppearance setCurrentAppearance:[NSApp mainWindow].effectiveAppearance];\n  [self sendEventWithName:@\"onAppearanceChange\" body:[self resolveConstants]];\n}\n\n- (void)stopObserving\n{\n  [NSApp removeObserver:self forKeyPath:@\"effectiveAppearance\"];\n}\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return NO;\n}\n\n\n- (NSDictionary<NSString *, id> *)resolveConstants\n{\n  return @{\n           @\"currentAppearance\": [NSAppearance currentAppearance].name,\n           @\"colors\": @{\n               @\"textColor\": [self rgba:[NSColor textColor]],\n               @\"textBackgroundColor\": [self rgba:[NSColor textBackgroundColor]],\n               @\"controlShadowColor\": [self rgba:[NSColor controlShadowColor]],\n               @\"controlDarkShadowColor\": [self rgba:[NSColor controlDarkShadowColor]],\n               @\"controlColor\": [self rgba:[NSColor controlColor]],\n               @\"controlHighlightColor\": [self rgba:[NSColor controlHighlightColor]],\n               @\"controlLightHighlightColor\": [self rgba:[NSColor controlLightHighlightColor]],\n               @\"controlBackgroundColor\": [self rgba:[NSColor controlBackgroundColor]],\n               @\"selectedControlTextColor\": [self rgba:[NSColor selectedControlTextColor]],\n               @\"disabledControlTextColor\": [self rgba:[NSColor disabledControlTextColor]],\n               @\"selectedTextColor\": [self rgba:[NSColor selectedTextColor]],\n               @\"selectedTextBackgroundColor\": [self rgba:[NSColor selectedTextBackgroundColor]],\n               @\"gridColor\": [self rgba:[NSColor gridColor]],\n               @\"keyboardFocusIndicatorColor\": [self rgba:[NSColor keyboardFocusIndicatorColor]],\n               @\"windowBackgroundColor\": [self rgba:[NSColor windowBackgroundColor]],\n               @\"underPageBackgroundColor\": [self rgba:[NSColor underPageBackgroundColor]],\n               @\"labelColor\": [self rgba:[NSColor labelColor]],\n               @\"secondaryLabelColor\": [self rgba:[NSColor secondaryLabelColor]],\n               @\"tertiaryLabelColor\": [self rgba:[NSColor tertiaryLabelColor]],\n               @\"quaternaryLabelColor\": [self rgba:[NSColor quaternaryLabelColor]],\n               @\"scrollBarColor\": [self rgba:[NSColor scrollBarColor]],\n               @\"knobColor\": [self rgba:[NSColor knobColor]],\n               @\"selectedKnobColor\": [self rgba:[NSColor selectedKnobColor]],\n               @\"windowFrameColor\": [self rgba:[NSColor windowFrameColor]],\n               @\"windowFrameTextColor\": [self rgba:[NSColor windowFrameTextColor]],\n               @\"selectedMenuItemColor\": [self rgba:[NSColor selectedMenuItemColor]],\n               @\"highlightColor\": [self rgba:[NSColor highlightColor]],\n               @\"shadowColor\": [self rgba:[NSColor shadowColor]],\n               @\"headerColor\": [self rgba:[NSColor headerColor]],\n               \n               @\"selectedMenuItemColor\": [self rgba:[NSColor selectedMenuItemColor]],\n               @\"highlightColor\": [self rgba:[NSColor highlightColor]],\n               @\"shadowColor\": [self rgba:[NSColor shadowColor]],\n               @\"headerColor\": [self rgba:[NSColor headerColor]],\n               @\"selectedMenuItemColor\": [self rgba:[NSColor selectedMenuItemColor]],\n               @\"highlightColor\": [self rgba:[NSColor highlightColor]],\n               @\"shadowColor\": [self rgba:[NSColor shadowColor]],\n               @\"headerColor\": [self rgba:[NSColor headerColor]],\n               @\"headerTextColor\": [self rgba:[NSColor headerTextColor]],\n               @\"alternateSelectedControlColor\": [self rgba:[NSColor alternateSelectedControlColor]],\n               @\"alternateSelectedControlTextColor\": [self rgba:[NSColor alternateSelectedControlTextColor]],\n               @\"headerColor\": [self rgba:[NSColor headerColor]],\n               \n               @\"systemRedColor\": [self rgba:[NSColor systemRedColor]],\n               @\"systemGreenColor\": [self rgba:[NSColor systemGreenColor]],\n               @\"systemBlueColor\": [self rgba:[NSColor systemBlueColor]],\n               @\"systemOrangeColor\": [self rgba:[NSColor systemOrangeColor]],\n               @\"systemBrownColor\": [self rgba:[NSColor systemBrownColor]],\n               @\"systemPinkColor\": [self rgba:[NSColor systemPinkColor]],\n               @\"systemPurpleColor\": [self rgba:[NSColor systemPurpleColor]],\n               @\"systemGrayColor\": [self rgba:[NSColor systemGrayColor]]\n               }\n           };\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  return [self resolveConstants];\n}\n\n- (NSString *)rgba:(NSColor *)color\n{\n  NSColor *convertedColor=[color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];\n  return [NSString stringWithFormat:@\"rgba(%f, %f, %f, %f)\", convertedColor.redComponent * 255.99999f,\n      convertedColor.greenComponent * 255.99999f,\n      convertedColor.blueComponent * 255.99999f,\n      convertedColor.alphaComponent];\n}\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[@\"onAppearanceChange\"];\n}\n\nRCT_EXPORT_METHOD(highlightWithLevel:(NSColor *)color\n                  level:(NSNumber * _Nonnull)level\n                  resolve:(RCTPromiseResolveBlock)resolve\n                  reject:(__unused RCTPromiseRejectBlock)reject)\n{\n  resolve([self rgba:[color highlightWithLevel:level.doubleValue]]);\n}\n\nRCT_EXPORT_METHOD(shadowWithLevel:(NSColor *)color\n                  level:(NSNumber * _Nonnull)level\n                  resolve:(RCTPromiseResolveBlock)resolve\n                  reject:(__unused RCTPromiseRejectBlock)reject)\n{\n  resolve([self rgba:[color shadowWithLevel:level.doubleValue]]);\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTAsyncLocalStorage.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTInvalidating.h>\n\n/**\n * A simple, asynchronous, persistent, key-value storage system designed as a\n * backend to the AsyncStorage JS module, which is modeled after LocalStorage.\n *\n * Current implementation stores small values in serialized dictionary and\n * larger values in separate files. Since we use a serial file queue\n * `RKFileQueue`, reading/writing from multiple threads should be perceived as\n * being atomic, unless someone bypasses the `RCTAsyncLocalStorage` API.\n *\n * Keys and values must always be strings or an error is returned.\n */\n@interface RCTAsyncLocalStorage : NSObject <RCTBridgeModule,RCTInvalidating>\n\n@property (nonatomic, assign) BOOL clearOnInvalidate;\n\n@property (nonatomic, readonly, getter=isValid) BOOL valid;\n\n// Clear the RCTAsyncLocalStorage data from native code\n- (void)clearAllData;\n\n// For clearing data when the bridge may not exist, e.g. when logging out.\n+ (void)clearAllData;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTAsyncLocalStorage.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTAsyncLocalStorage.h\"\n\n#import <Foundation/Foundation.h>\n\n#import <CommonCrypto/CommonCryptor.h>\n#import <CommonCrypto/CommonDigest.h>\n\n#import \"RCTConvert.h\"\n#import \"RCTLog.h\"\n#import \"RCTUtils.h\"\n\nstatic NSString *const RCTManifestFileName = @\"manifest.json\";\nstatic const NSUInteger RCTInlineValueThreshold = 1024;\n\n#pragma mark - Static helper functions\n\nstatic NSDictionary *RCTErrorForKey(NSString *key)\n{\n  if (![key isKindOfClass:[NSString class]]) {\n    return RCTMakeAndLogError(@\"Invalid key - must be a string.  Key: \", key, @{@\"key\": key});\n  } else if (key.length < 1) {\n    return RCTMakeAndLogError(@\"Invalid key - must be at least one character.  Key: \", key, @{@\"key\": key});\n  } else {\n    return nil;\n  }\n}\n\nstatic void RCTAppendError(NSDictionary *error, NSMutableArray<NSDictionary *> **errors)\n{\n  if (error && errors) {\n    if (!*errors) {\n      *errors = [NSMutableArray new];\n    }\n    [*errors addObject:error];\n  }\n}\n\nstatic NSString *RCTReadFile(NSString *filePath, NSString *key, NSDictionary **errorOut)\n{\n  if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {\n    NSError *error;\n    NSStringEncoding encoding;\n    NSString *entryString = [NSString stringWithContentsOfFile:filePath usedEncoding:&encoding error:&error];\n    NSDictionary *extraData = @{@\"key\": RCTNullIfNil(key)};\n\n    if (error) {\n      if (errorOut) *errorOut = RCTMakeError(@\"Failed to read storage file.\", error, extraData);\n      return nil;\n    }\n\n    if (encoding != NSUTF8StringEncoding) {\n      if (errorOut) *errorOut = RCTMakeError(@\"Incorrect encoding of storage file: \", @(encoding), extraData);\n      return nil;\n    }\n    return entryString;\n  }\n\n  return nil;\n}\n\nstatic NSString *RCTGetStorageDirectory()\n{\n  static NSString *storageDirectory = nil;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    storageDirectory = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES).firstObject;\n    storageDirectory = [storageDirectory stringByAppendingPathComponent:[[[NSBundle mainBundle] infoDictionary] objectForKey:(id)kCFBundleNameKey]];\n  });\n  return storageDirectory;\n}\n\nstatic NSString *RCTGetManifestFilePath()\n{\n  static NSString *manifestFilePath = nil;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    manifestFilePath = [RCTGetStorageDirectory() stringByAppendingPathComponent:RCTManifestFileName];\n  });\n  return manifestFilePath;\n}\n\n// Only merges objects - all other types are just clobbered (including arrays)\nstatic BOOL RCTMergeRecursive(NSMutableDictionary *destination, NSDictionary *source)\n{\n  BOOL modified = NO;\n  for (NSString *key in source) {\n    id sourceValue = source[key];\n    id destinationValue = destination[key];\n    if ([sourceValue isKindOfClass:[NSDictionary class]]) {\n      if ([destinationValue isKindOfClass:[NSDictionary class]]) {\n        if ([destinationValue classForCoder] != [NSMutableDictionary class]) {\n          destinationValue = [destinationValue mutableCopy];\n        }\n        if (RCTMergeRecursive(destinationValue, sourceValue)) {\n          destination[key] = destinationValue;\n          modified = YES;\n        }\n      } else {\n        destination[key] = [sourceValue copy];\n        modified = YES;\n      }\n    } else if (![source isEqual:destinationValue]) {\n      destination[key] = [sourceValue copy];\n      modified = YES;\n    }\n  }\n  return modified;\n}\n\nstatic dispatch_queue_t RCTGetMethodQueue()\n{\n  // We want all instances to share the same queue since they will be reading/writing the same files.\n  static dispatch_queue_t queue;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    queue = dispatch_queue_create(\"com.facebook.react.AsyncLocalStorageQueue\", DISPATCH_QUEUE_SERIAL);\n  });\n  return queue;\n}\n\nstatic NSCache *RCTGetCache()\n{\n  // We want all instances to share the same cache since they will be reading/writing the same files.\n  static NSCache *cache;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    cache = [NSCache new];\n    cache.totalCostLimit = 20 * 1024 * 1024; // 20MB\n  });\n  return cache;\n}\n\nstatic BOOL RCTHasCreatedStorageDirectory = NO;\nstatic NSDictionary *RCTDeleteStorageDirectory()\n{\n  NSError *error;\n  [[NSFileManager defaultManager] removeItemAtPath:RCTGetStorageDirectory() error:&error];\n  RCTHasCreatedStorageDirectory = NO;\n  return error ? RCTMakeError(@\"Failed to delete storage directory.\", error, nil) : nil;\n}\n\n#pragma mark - RCTAsyncLocalStorage\n\n@implementation RCTAsyncLocalStorage\n{\n  BOOL _haveSetup;\n  // The manifest is a dictionary of all keys with small values inlined.  Null values indicate values that are stored\n  // in separate files (as opposed to nil values which don't exist).  The manifest is read off disk at startup, and\n  // written to disk after all mutations.\n  NSMutableDictionary<NSString *, NSString *> *_manifest;\n}\n\nRCT_EXPORT_MODULE()\n\n- (dispatch_queue_t)methodQueue\n{\n  return RCTGetMethodQueue();\n}\n\n- (void)clearAllData\n{\n  dispatch_async(RCTGetMethodQueue(), ^{\n    [self->_manifest removeAllObjects];\n    [RCTGetCache() removeAllObjects];\n    RCTDeleteStorageDirectory();\n  });\n}\n\n+ (void)clearAllData\n{\n  dispatch_async(RCTGetMethodQueue(), ^{\n    [RCTGetCache() removeAllObjects];\n    RCTDeleteStorageDirectory();\n  });\n}\n\n- (void)invalidate\n{\n  if (_clearOnInvalidate) {\n    [RCTGetCache() removeAllObjects];\n    RCTDeleteStorageDirectory();\n  }\n  _clearOnInvalidate = NO;\n  [_manifest removeAllObjects];\n  _haveSetup = NO;\n}\n\n- (BOOL)isValid\n{\n  return _haveSetup;\n}\n\n- (void)dealloc\n{\n  [self invalidate];\n}\n\n- (NSString *)_filePathForKey:(NSString *)key\n{\n  NSString *safeFileName = RCTMD5Hash(key);\n  return [RCTGetStorageDirectory() stringByAppendingPathComponent:safeFileName];\n}\n\n- (NSDictionary *)_ensureSetup\n{\n  RCTAssertThread(RCTGetMethodQueue(), @\"Must be executed on storage thread\");\n\n#if TARGET_OS_TV\n  RCTLogWarn(@\"Persistent storage is not supported on tvOS, your data may be removed at any point.\");\n#endif\n\n  NSError *error = nil;\n  if (!RCTHasCreatedStorageDirectory) {\n    [[NSFileManager defaultManager] createDirectoryAtPath:RCTGetStorageDirectory()\n                              withIntermediateDirectories:YES\n                                               attributes:nil\n                                                    error:&error];\n    if (error) {\n      return RCTMakeError(@\"Failed to create storage directory.\", error, nil);\n    }\n    RCTHasCreatedStorageDirectory = YES;\n  }\n  if (!_haveSetup) {\n    NSDictionary *errorOut;\n    NSString *serialized = RCTReadFile(RCTGetManifestFilePath(), RCTManifestFileName, &errorOut);\n    _manifest = serialized ? RCTJSONParseMutable(serialized, &error) : [NSMutableDictionary new];\n    if (error) {\n      RCTLogWarn(@\"Failed to parse manifest - creating new one.\\n\\n%@\", error);\n      _manifest = [NSMutableDictionary new];\n    }\n    _haveSetup = YES;\n  }\n  return nil;\n}\n\n- (NSDictionary *)_writeManifest:(NSMutableArray<NSDictionary *> **)errors\n{\n  NSError *error;\n  NSString *serialized = RCTJSONStringify(_manifest, &error);\n  [serialized writeToFile:RCTGetManifestFilePath() atomically:YES encoding:NSUTF8StringEncoding error:&error];\n  NSDictionary *errorOut;\n  if (error) {\n    errorOut = RCTMakeError(@\"Failed to write manifest file.\", error, nil);\n    RCTAppendError(errorOut, errors);\n  }\n  return errorOut;\n}\n\n- (NSDictionary *)_appendItemForKey:(NSString *)key\n                            toArray:(NSMutableArray<NSArray<NSString *> *> *)result\n{\n  NSDictionary *errorOut = RCTErrorForKey(key);\n  if (errorOut) {\n    return errorOut;\n  }\n  NSString *value = [self _getValueForKey:key errorOut:&errorOut];\n  [result addObject:@[key, RCTNullIfNil(value)]]; // Insert null if missing or failure.\n  return errorOut;\n}\n\n- (NSString *)_getValueForKey:(NSString *)key errorOut:(NSDictionary **)errorOut\n{\n  NSString *value = _manifest[key]; // nil means missing, null means there may be a data file, else: NSString\n  if (value == (id)kCFNull) {\n    value = [RCTGetCache() objectForKey:key];\n    if (!value) {\n      NSString *filePath = [self _filePathForKey:key];\n      value = RCTReadFile(filePath, key, errorOut);\n      if (value) {\n        [RCTGetCache() setObject:value forKey:key cost:value.length];\n      } else {\n        // file does not exist after all, so remove from manifest (no need to save\n        // manifest immediately though, as cost of checking again next time is negligible)\n        [_manifest removeObjectForKey:key];\n      }\n    }\n  }\n  return value;\n}\n\n- (NSDictionary *)_writeEntry:(NSArray<NSString *> *)entry changedManifest:(BOOL *)changedManifest\n{\n  if (entry.count != 2) {\n    return RCTMakeAndLogError(@\"Entries must be arrays of the form [key: string, value: string], got: \", entry, nil);\n  }\n  NSString *key = entry[0];\n  NSDictionary *errorOut = RCTErrorForKey(key);\n  if (errorOut) {\n    return errorOut;\n  }\n  NSString *value = entry[1];\n  NSString *filePath = [self _filePathForKey:key];\n  NSError *error;\n  if (value.length <= RCTInlineValueThreshold) {\n    if (_manifest[key] == (id)kCFNull) {\n      // If the value already existed but wasn't inlined, remove the old file.\n      [[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];\n      [RCTGetCache() removeObjectForKey:key];\n    }\n    *changedManifest = YES;\n    _manifest[key] = value;\n    return nil;\n  }\n  [value writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:&error];\n  [RCTGetCache() setObject:value forKey:key cost:value.length];\n  if (error) {\n    errorOut = RCTMakeError(@\"Failed to write value.\", error, @{@\"key\": key});\n  } else if (_manifest[key] != (id)kCFNull) {\n    *changedManifest = YES;\n    _manifest[key] = (id)kCFNull;\n  }\n  return errorOut;\n}\n\n#pragma mark - Exported JS Functions\n\nRCT_EXPORT_METHOD(multiGet:(NSArray<NSString *> *)keys\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  NSDictionary *errorOut = [self _ensureSetup];\n  if (errorOut) {\n    callback(@[@[errorOut], (id)kCFNull]);\n    return;\n  }\n  NSMutableArray<NSDictionary *> *errors;\n  NSMutableArray<NSArray<NSString *> *> *result = [[NSMutableArray alloc] initWithCapacity:keys.count];\n  for (NSString *key in keys) {\n    id keyError;\n    id value = [self _getValueForKey:key errorOut:&keyError];\n    [result addObject:@[key, RCTNullIfNil(value)]];\n    RCTAppendError(keyError, &errors);\n  }\n  callback(@[RCTNullIfNil(errors), result]);\n}\n\nRCT_EXPORT_METHOD(multiSet:(NSArray<NSArray<NSString *> *> *)kvPairs\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  NSDictionary *errorOut = [self _ensureSetup];\n  if (errorOut) {\n    callback(@[@[errorOut]]);\n    return;\n  }\n  BOOL changedManifest = NO;\n  NSMutableArray<NSDictionary *> *errors;\n  for (NSArray<NSString *> *entry in kvPairs) {\n    NSDictionary *keyError = [self _writeEntry:entry changedManifest:&changedManifest];\n    RCTAppendError(keyError, &errors);\n  }\n  if (changedManifest) {\n    [self _writeManifest:&errors];\n  }\n  callback(@[RCTNullIfNil(errors)]);\n}\n\nRCT_EXPORT_METHOD(multiMerge:(NSArray<NSArray<NSString *> *> *)kvPairs\n                    callback:(RCTResponseSenderBlock)callback)\n{\n  NSDictionary *errorOut = [self _ensureSetup];\n  if (errorOut) {\n    callback(@[@[errorOut]]);\n    return;\n  }\n  BOOL changedManifest = NO;\n  NSMutableArray<NSDictionary *> *errors;\n  for (__strong NSArray<NSString *> *entry in kvPairs) {\n    NSDictionary *keyError;\n    NSString *value = [self _getValueForKey:entry[0] errorOut:&keyError];\n    if (!keyError) {\n      if (value) {\n        NSError *jsonError;\n        NSMutableDictionary *mergedVal = RCTJSONParseMutable(value, &jsonError);\n        if (RCTMergeRecursive(mergedVal, RCTJSONParse(entry[1], &jsonError))) {\n          entry = @[entry[0], RCTNullIfNil(RCTJSONStringify(mergedVal, NULL))];\n        }\n        if (jsonError) {\n          keyError = RCTJSErrorFromNSError(jsonError);\n        }\n      }\n      if (!keyError) {\n        keyError = [self _writeEntry:entry changedManifest:&changedManifest];\n      }\n    }\n    RCTAppendError(keyError, &errors);\n  }\n  if (changedManifest) {\n    [self _writeManifest:&errors];\n  }\n  callback(@[RCTNullIfNil(errors)]);\n}\n\nRCT_EXPORT_METHOD(multiRemove:(NSArray<NSString *> *)keys\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  NSDictionary *errorOut = [self _ensureSetup];\n  if (errorOut) {\n    callback(@[@[errorOut]]);\n    return;\n  }\n  NSMutableArray<NSDictionary *> *errors;\n  BOOL changedManifest = NO;\n  for (NSString *key in keys) {\n    NSDictionary *keyError = RCTErrorForKey(key);\n    if (!keyError) {\n      if (_manifest[key] == (id)kCFNull) {\n        NSString *filePath = [self _filePathForKey:key];\n        [[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];\n        [RCTGetCache() removeObjectForKey:key];\n        // remove the key from manifest, but no need to mark as changed just for\n        // this, as the cost of checking again next time is negligible.\n        [_manifest removeObjectForKey:key];\n      } else if (_manifest[key]) {\n        changedManifest = YES;\n        [_manifest removeObjectForKey:key];\n      }\n    }\n    RCTAppendError(keyError, &errors);\n  }\n  if (changedManifest) {\n    [self _writeManifest:&errors];\n  }\n  callback(@[RCTNullIfNil(errors)]);\n}\n\nRCT_EXPORT_METHOD(clear:(RCTResponseSenderBlock)callback)\n{\n  [_manifest removeAllObjects];\n  [RCTGetCache() removeAllObjects];\n  NSDictionary *error = RCTDeleteStorageDirectory();\n  callback(@[RCTNullIfNil(error)]);\n}\n\nRCT_EXPORT_METHOD(getAllKeys:(RCTResponseSenderBlock)callback)\n{\n  NSDictionary *errorOut = [self _ensureSetup];\n  if (errorOut) {\n    callback(@[errorOut, (id)kCFNull]);\n  } else {\n    callback(@[(id)kCFNull, _manifest.allKeys]);\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTClipboard.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridgeModule.h>\n\n@interface RCTClipboard : NSObject <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTClipboard.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTClipboard.h\"\n#import <AppKit/AppKit.h>\n#import <React/RCTUtils.h>\n\n@implementation RCTClipboard\n\nRCT_EXPORT_MODULE()\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n\nRCT_EXPORT_METHOD(setString:(NSString *)content)\n{\n  NSPasteboard *clipboard = [NSPasteboard generalPasteboard];\n  [clipboard clearContents];\n  [clipboard writeObjects:[NSArray arrayWithObject:content]];\n}\n\nRCT_EXPORT_METHOD(getString:(RCTPromiseResolveBlock)resolve\n                  rejecter:(__unused RCTPromiseRejectBlock)reject)\n{\n  NSPasteboard *clipboard = [NSPasteboard generalPasteboard];\n  resolve(@[RCTNullIfNil([clipboard  stringForType:NSPasteboardTypeString])]);\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTCursorManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n#import \"RCTBridgeModule.h\"\n\n@interface RCTCursorManager : NSObject <RCTBridgeModule>\n@end\n"
  },
  {
    "path": "React/Modules/RCTCursorManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTCursorManager.h\"\n\n// Macros for creation set methods for provided cursor type\n#define EXPORT_CURSOR_SET_METHOD(name) \\\n  RCT_EXPORT_METHOD(name) {            \\\n    [[NSCursor name] set];             \\\n  }\n\n\n@implementation RCTCursorManager\n\nRCT_EXPORT_MODULE();\n\nEXPORT_CURSOR_SET_METHOD(arrowCursor);\nEXPORT_CURSOR_SET_METHOD(IBeamCursor);\nEXPORT_CURSOR_SET_METHOD(crosshairCursor);\nEXPORT_CURSOR_SET_METHOD(closedHandCursor);\nEXPORT_CURSOR_SET_METHOD(openHandCursor);\nEXPORT_CURSOR_SET_METHOD(pointingHandCursor);\nEXPORT_CURSOR_SET_METHOD(resizeLeftCursor);\nEXPORT_CURSOR_SET_METHOD(resizeRightCursor);\nEXPORT_CURSOR_SET_METHOD(resizeLeftRightCursor);\nEXPORT_CURSOR_SET_METHOD(resizeUpCursor);\nEXPORT_CURSOR_SET_METHOD(resizeDownCursor);\nEXPORT_CURSOR_SET_METHOD(resizeUpDownCursor);\nEXPORT_CURSOR_SET_METHOD(disappearingItemCursor);\nEXPORT_CURSOR_SET_METHOD(IBeamCursorForVerticalLayout);\nEXPORT_CURSOR_SET_METHOD(operationNotAllowedCursor);\nEXPORT_CURSOR_SET_METHOD(dragLinkCursor);\nEXPORT_CURSOR_SET_METHOD(dragCopyCursor);\nEXPORT_CURSOR_SET_METHOD(contextualMenuCursor);\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTDevSettings.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridge.h>\n#import <React/RCTDefines.h>\n\n@protocol RCTPackagerClientMethod;\n\n/**\n * An abstraction for a key-value store to manage RCTDevSettings behavior.\n * The default implementation persists settings using NSUserDefaults.\n */\n@protocol RCTDevSettingsDataSource <NSObject>\n\n/**\n * Updates the setting with the given key to the given value.\n * How the data source's state changes depends on the implementation.\n */\n- (void)updateSettingWithValue:(id)value forKey:(NSString *)key;\n\n/**\n * Returns the value for the setting with the given key.\n */\n- (id)settingForKey:(NSString *)key;\n\n@end\n\n@interface RCTDevSettings : NSObject\n\n- (instancetype)initWithDataSource:(id<RCTDevSettingsDataSource>)dataSource;\n\n@property (nonatomic, readonly) BOOL isHotLoadingAvailable;\n@property (nonatomic, readonly) BOOL isLiveReloadAvailable;\n@property (nonatomic, readonly) BOOL isRemoteDebuggingAvailable;\n@property (nonatomic, readonly) BOOL isNuclideDebuggingAvailable;\n@property (nonatomic, readonly) BOOL isJSCSamplingProfilerAvailable;\n\n/**\n * Whether the bridge is connected to a remote JS executor.\n */\n@property (nonatomic, assign) BOOL isDebuggingRemotely;\n\n/*\n * Whether shaking will show RCTDevMenu. The menu is enabled by default if RCT_DEV=1, but\n * you may wish to disable it so that you can provide your own shake handler.\n */\n@property (nonatomic, assign) BOOL isShakeToShowDevMenuEnabled;\n\n/**\n * Whether performance profiling is enabled.\n */\n@property (nonatomic, assign, setter=setProfilingEnabled:) BOOL isProfilingEnabled;\n\n/**\n * Whether automatic polling for JS code changes is enabled. Only applicable when\n * running the app from a server.\n */\n@property (nonatomic, assign, setter=setLiveReloadEnabled:) BOOL isLiveReloadEnabled;\n\n/**\n * Whether hot loading is enabled.\n */\n@property (nonatomic, assign, setter=setHotLoadingEnabled:) BOOL isHotLoadingEnabled;\n\n/**\n * Toggle the element inspector.\n */\n- (void)toggleElementInspector;\n\n/**\n * Toggle JSC's sampling profiler.\n */\n- (void)toggleJSCSamplingProfiler;\n\n/**\n * Enables starting of profiling sampler on launch\n */\n@property (nonatomic, assign) BOOL startSamplingProfilerOnLaunch;\n\n/**\n * Whether the element inspector is visible.\n */\n@property (nonatomic, readonly) BOOL isElementInspectorShown;\n\n/**\n * Whether the performance monitor is visible.\n */\n@property (nonatomic, assign) BOOL isPerfMonitorShown;\n\n#if RCT_DEV\n- (void)addHandler:(id<RCTPackagerClientMethod>)handler forPackagerMethod:(NSString *)name __deprecated_msg(\"Use RCTPackagerConnection directly instead\");\n#endif\n\n@end\n\n@interface RCTBridge (RCTDevSettings)\n\n@property (nonatomic, readonly) RCTDevSettings *devSettings;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTDevSettings.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDevSettings.h\"\n\n#import <objc/runtime.h>\n\n#import <JavaScriptCore/JavaScriptCore.h>\n\n#import <jschelpers/JavaScriptCore.h>\n\n#import \"RCTBridge+Private.h\"\n#import \"RCTBridgeModule.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTJSCSamplingProfiler.h\"\n#import \"RCTLog.h\"\n#import \"RCTPackagerClient.h\"\n#import \"RCTProfile.h\"\n#import \"RCTUtils.h\"\n\nstatic NSString *const kRCTDevSettingProfilingEnabled = @\"profilingEnabled\";\nstatic NSString *const kRCTDevSettingHotLoadingEnabled = @\"hotLoadingEnabled\";\nstatic NSString *const kRCTDevSettingLiveReloadEnabled = @\"liveReloadEnabled\";\nstatic NSString *const kRCTDevSettingIsInspectorShown = @\"showInspector\";\nstatic NSString *const kRCTDevSettingIsDebuggingRemotely = @\"isDebuggingRemotely\";\nstatic NSString *const kRCTDevSettingExecutorOverrideClass = @\"executor-override\";\nstatic NSString *const kRCTDevSettingShakeToShowDevMenu = @\"shakeToShow\";\nstatic NSString *const kRCTDevSettingIsPerfMonitorShown = @\"RCTPerfMonitorKey\";\nstatic NSString *const kRCTDevSettingStartSamplingProfilerOnLaunch = @\"startSamplingProfilerOnLaunch\";\n\nstatic NSString *const kRCTDevSettingsUserDefaultsKey = @\"RCTDevMenu\";\n\n#if ENABLE_PACKAGER_CONNECTION\n#import \"RCTPackagerConnection.h\"\n#endif\n\n#if RCT_ENABLE_INSPECTOR\n#import \"RCTInspectorDevServerHelper.h\"\n#import <jschelpers/JSCWrapper.h>\n#endif\n\n#if RCT_DEV\n\n@interface RCTDevSettingsUserDefaultsDataSource : NSObject <RCTDevSettingsDataSource>\n\n@end\n\n@implementation RCTDevSettingsUserDefaultsDataSource {\n  NSMutableDictionary *_settings;\n  NSUserDefaults *_userDefaults;\n}\n\n- (instancetype)init\n{\n  return [self initWithDefaultValues:nil];\n}\n\n- (instancetype)initWithDefaultValues:(NSDictionary *)defaultValues\n{\n  if (self = [super init]) {\n    _userDefaults = [NSUserDefaults standardUserDefaults];\n    if (defaultValues) {\n      [self _reloadWithDefaults:defaultValues];\n    }\n  }\n  return self;\n}\n\n- (void)updateSettingWithValue:(id)value forKey:(NSString *)key\n{\n  RCTAssert((key != nil), @\"%@\", [NSString stringWithFormat:@\"%@: Tried to update nil key\", [self class]]);\n\n  id currentValue = [self settingForKey:key];\n  if (currentValue == value || [currentValue isEqual:value]) {\n    return;\n  }\n  if (value) {\n    _settings[key] = value;\n  } else {\n    [_settings removeObjectForKey:key];\n  }\n  [_userDefaults setObject:_settings forKey:kRCTDevSettingsUserDefaultsKey];\n}\n\n- (id)settingForKey:(NSString *)key\n{\n  return _settings[key];\n}\n\n- (void)_reloadWithDefaults:(NSDictionary *)defaultValues\n{\n  NSDictionary *existingSettings = [_userDefaults objectForKey:kRCTDevSettingsUserDefaultsKey];\n  _settings = existingSettings ? [existingSettings mutableCopy] : [NSMutableDictionary dictionary];\n  for (NSString *key in [defaultValues keyEnumerator]) {\n    if (!_settings[key]) {\n      _settings[key] = defaultValues[key];\n    }\n  }\n  [_userDefaults setObject:_settings forKey:kRCTDevSettingsUserDefaultsKey];\n}\n\n@end\n\n@interface RCTDevSettings () <RCTBridgeModule, RCTInvalidating>\n{\n  NSURLSessionDataTask *_liveReloadUpdateTask;\n  NSURL *_liveReloadURL;\n  BOOL _isJSLoaded;\n#if ENABLE_PACKAGER_CONNECTION\n  RCTHandlerToken _reloadToken;\n  RCTHandlerToken _pokeSamplingProfilerToken;\n#endif\n}\n\n@property (nonatomic, strong) Class executorClass;\n@property (nonatomic, readwrite, strong) id<RCTDevSettingsDataSource> dataSource;\n\n@end\n\n@implementation RCTDevSettings\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES; // RCT_DEV-only\n}\n\n- (instancetype)init\n{\n  // default behavior is to use NSUserDefaults\n  NSDictionary *defaultValues = @{\n    kRCTDevSettingShakeToShowDevMenu: @YES,\n  };\n  RCTDevSettingsUserDefaultsDataSource *dataSource = [[RCTDevSettingsUserDefaultsDataSource alloc] initWithDefaultValues:defaultValues];\n  return [self initWithDataSource:dataSource];\n}\n\n- (instancetype)initWithDataSource:(id<RCTDevSettingsDataSource>)dataSource\n{\n  if (self = [super init]) {\n    _dataSource = dataSource;\n\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(jsLoaded:)\n                                                 name:RCTJavaScriptDidLoadNotification\n                                               object:nil];\n\n    // Delay setup until after Bridge init\n    dispatch_async(dispatch_get_main_queue(), ^{\n      [self _synchronizeAllSettings];\n    });\n  }\n  return self;\n}\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  RCTAssert(_bridge == nil, @\"RCTDevSettings module should not be reused\");\n  _bridge = bridge;\n\n#if ENABLE_PACKAGER_CONNECTION\n  RCTBridge *__weak weakBridge = bridge;\n  _reloadToken =\n  [[RCTPackagerConnection sharedPackagerConnection]\n   addNotificationHandler:^(id params) {\n     if (params != (id)kCFNull && [params[@\"debug\"] boolValue]) {\n       weakBridge.executorClass = objc_lookUpClass(\"RCTWebSocketExecutor\");\n     }\n     [weakBridge reload];\n   }\n   queue:dispatch_get_main_queue()\n   forMethod:@\"reload\"];\n\n  _pokeSamplingProfilerToken =\n  [[RCTPackagerConnection sharedPackagerConnection]\n   addRequestHandler:^(NSDictionary<NSString *, id> *params, RCTPackagerClientResponder *responder) {\n     pokeSamplingProfiler(weakBridge, responder);\n   }\n   queue:dispatch_get_main_queue()\n   forMethod:@\"pokeSamplingProfiler\"];\n#endif\n\n#if RCT_ENABLE_INSPECTOR\n  // we need this dispatch back to the main thread because even though this\n  // is executed on the main thread, at this point the bridge is not yet\n  // finished with its initialisation. But it does finish by the time it\n  // relinquishes control of the main thread, so only queue on the JS thread\n  // after the current main thread operation is done.\n  if (self.isNuclideDebuggingAvailable) {\n    dispatch_async(dispatch_get_main_queue(), ^{\n      [bridge dispatchBlock:^{\n        [RCTInspectorDevServerHelper connectWithBundleURL:bridge.bundleURL];\n      } queue:RCTJSThread];\n    });\n  }\n#endif\n}\n\nstatic void pokeSamplingProfiler(RCTBridge *const bridge, RCTPackagerClientResponder *const responder)\n{\n  if (!bridge) {\n    [responder respondWithError:@\"The bridge is nil. Try again.\"];\n    return;\n  }\n\n  JSGlobalContextRef globalContext = bridge.jsContextRef;\n  if (!JSC_JSSamplingProfilerEnabled(globalContext)) {\n    [responder respondWithError:@\"The JSSamplingProfiler is disabled. See 'iOS specific setup' section here https://fburl.com/u4lw7xeq for some help\"];\n    return;\n  }\n\n  // JSPokeSamplingProfiler() toggles the profiling process\n  JSValueRef jsResult = JSC_JSPokeSamplingProfiler(globalContext);\n  if (JSC_JSValueGetType(globalContext, jsResult) == kJSTypeNull) {\n    [responder respondWithResult:@\"started\"];\n  } else {\n    JSContext *context = [JSC_JSContext(globalContext) contextWithJSGlobalContextRef:globalContext];\n    NSString *results = [[JSC_JSValue(globalContext) valueWithJSValueRef:jsResult inContext:context] toObject];\n    [responder respondWithResult:results];\n  }\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n- (void)invalidate\n{\n  [_liveReloadUpdateTask cancel];\n#if ENABLE_PACKAGER_CONNECTION\n  [[RCTPackagerConnection sharedPackagerConnection] removeHandler:_reloadToken];\n  [[RCTPackagerConnection sharedPackagerConnection] removeHandler:_pokeSamplingProfilerToken];\n#endif\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (void)_updateSettingWithValue:(id)value forKey:(NSString *)key\n{\n  [_dataSource updateSettingWithValue:value forKey:key];\n}\n\n- (id)settingForKey:(NSString *)key\n{\n  return [_dataSource settingForKey:key];\n}\n\n- (BOOL)isNuclideDebuggingAvailable\n{\n#if RCT_ENABLE_INSPECTOR\n  return _bridge.isInspectable;\n#else\n  return false;\n#endif // RCT_ENABLE_INSPECTOR\n}\n\n- (BOOL)isRemoteDebuggingAvailable\n{\n  Class jsDebuggingExecutorClass = objc_lookUpClass(\"RCTWebSocketExecutor\");\n  return (jsDebuggingExecutorClass != nil);\n}\n\n- (BOOL)isHotLoadingAvailable\n{\n  return _bridge.bundleURL && !_bridge.bundleURL.fileURL; // Only works when running from server\n}\n\n- (BOOL)isLiveReloadAvailable\n{\n  return (_liveReloadURL != nil);\n}\n\n- (BOOL)isJSCSamplingProfilerAvailable\n{\n  return JSC_JSSamplingProfilerEnabled(_bridge.jsContextRef);\n}\n\nRCT_EXPORT_METHOD(reload)\n{\n  [_bridge reload];\n}\n\nRCT_EXPORT_METHOD(setIsShakeToShowDevMenuEnabled:(BOOL)enabled)\n{\n  [self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingShakeToShowDevMenu];\n}\n\n- (BOOL)isShakeToShowDevMenuEnabled\n{\n  return [[self settingForKey:kRCTDevSettingShakeToShowDevMenu] boolValue];\n}\n\nRCT_EXPORT_METHOD(setIsDebuggingRemotely:(BOOL)enabled)\n{\n  [self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingIsDebuggingRemotely];\n  [self _remoteDebugSettingDidChange];\n}\n\n- (BOOL)isDebuggingRemotely\n{\n  return [[self settingForKey:kRCTDevSettingIsDebuggingRemotely] boolValue];\n}\n\n- (void)_remoteDebugSettingDidChange\n{\n  // This value is passed as a command-line argument, so fall back to reading from NSUserDefaults directly\n  NSString *executorOverride = [[NSUserDefaults standardUserDefaults] stringForKey:kRCTDevSettingExecutorOverrideClass];\n  Class executorOverrideClass = executorOverride ? NSClassFromString(executorOverride) : nil;\n  if (executorOverrideClass) {\n    self.executorClass = executorOverrideClass;\n  } else {\n    BOOL enabled = self.isRemoteDebuggingAvailable && self.isDebuggingRemotely;\n    self.executorClass = enabled ? objc_getClass(\"RCTWebSocketExecutor\") : nil;\n  }\n}\n\nRCT_EXPORT_METHOD(setProfilingEnabled:(BOOL)enabled)\n{\n  [self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingProfilingEnabled];\n  [self _profilingSettingDidChange];\n}\n\n- (BOOL)isProfilingEnabled\n{\n  return [[self settingForKey:kRCTDevSettingProfilingEnabled] boolValue];\n}\n\n- (void)_profilingSettingDidChange\n{\n  BOOL enabled = self.isProfilingEnabled;\n  if (_liveReloadURL && enabled != RCTProfileIsProfiling()) {\n    if (enabled) {\n      [_bridge startProfiling];\n    } else {\n      [_bridge stopProfiling:^(NSData *logData) {\n        RCTProfileSendResult(self->_bridge, @\"systrace\", logData);\n      }];\n    }\n  }\n}\n\nRCT_EXPORT_METHOD(setLiveReloadEnabled:(BOOL)enabled)\n{\n  [self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingLiveReloadEnabled];\n  [self _liveReloadSettingDidChange];\n}\n\n- (BOOL)isLiveReloadEnabled\n{\n  return [[self settingForKey:kRCTDevSettingLiveReloadEnabled] boolValue];\n}\n\n- (void)_liveReloadSettingDidChange\n{\n  BOOL liveReloadEnabled = (self.isLiveReloadAvailable && self.isLiveReloadEnabled);\n  if (liveReloadEnabled) {\n    [self _pollForLiveReload];\n  } else {\n    [_liveReloadUpdateTask cancel];\n    _liveReloadUpdateTask = nil;\n  }\n}\n\nRCT_EXPORT_METHOD(setHotLoadingEnabled:(BOOL)enabled)\n{\n  if (self.isHotLoadingEnabled != enabled) {\n    [self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingHotLoadingEnabled];\n    [_bridge reload];\n  }\n}\n\n- (BOOL)isHotLoadingEnabled\n{\n  return [[self settingForKey:kRCTDevSettingHotLoadingEnabled] boolValue];\n}\n\nRCT_EXPORT_METHOD(toggleElementInspector)\n{\n  BOOL value = [[self settingForKey:kRCTDevSettingIsInspectorShown] boolValue];\n  [self _updateSettingWithValue:@(!value) forKey:kRCTDevSettingIsInspectorShown];\n\n  if (_isJSLoaded) {\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n    [self.bridge.eventDispatcher sendDeviceEventWithName:@\"toggleElementInspector\" body:nil];\n#pragma clang diagnostic pop\n  }\n}\n\n- (void)toggleJSCSamplingProfiler\n{\n  JSGlobalContextRef globalContext = _bridge.jsContextRef;\n  // JSPokeSamplingProfiler() toggles the profiling process\n  JSValueRef jsResult = JSC_JSPokeSamplingProfiler(globalContext);\n\n  if (JSC_JSValueGetType(globalContext, jsResult) != kJSTypeNull) {\n    JSContext *context = [JSC_JSContext(globalContext) contextWithJSGlobalContextRef:globalContext];\n    NSString *results = [[JSC_JSValue(globalContext) valueWithJSValueRef:jsResult inContext:context] toObject];\n    RCTJSCSamplingProfiler *profilerModule = [_bridge moduleForClass:[RCTJSCSamplingProfiler class]];\n    [profilerModule operationCompletedWithResults:results];\n  }\n}\n\n- (BOOL)isElementInspectorShown\n{\n  return [[self settingForKey:kRCTDevSettingIsInspectorShown] boolValue];\n}\n\n- (void)setIsPerfMonitorShown:(BOOL)isPerfMonitorShown\n{\n  [self _updateSettingWithValue:@(isPerfMonitorShown) forKey:kRCTDevSettingIsPerfMonitorShown];\n}\n\n- (BOOL)isPerfMonitorShown\n{\n  return [[self settingForKey:kRCTDevSettingIsPerfMonitorShown] boolValue];\n}\n\n- (void)setStartSamplingProfilerOnLaunch:(BOOL)startSamplingProfilerOnLaunch\n{\n  [self _updateSettingWithValue:@(startSamplingProfilerOnLaunch) forKey:kRCTDevSettingStartSamplingProfilerOnLaunch];\n}\n\n- (BOOL)startSamplingProfilerOnLaunch\n{\n  return [[self settingForKey:kRCTDevSettingStartSamplingProfilerOnLaunch] boolValue];\n}\n\n- (void)setExecutorClass:(Class)executorClass\n{\n  _executorClass = executorClass;\n  if (_bridge.executorClass != executorClass) {\n\n    // TODO (6929129): we can remove this special case test once we have better\n    // support for custom executors in the dev menu. But right now this is\n    // needed to prevent overriding a custom executor with the default if a\n    // custom executor has been set directly on the bridge\n    if (executorClass == Nil &&\n        _bridge.executorClass != objc_lookUpClass(\"RCTWebSocketExecutor\")) {\n      return;\n    }\n\n    _bridge.executorClass = executorClass;\n    [_bridge reload];\n  }\n}\n\n#if RCT_DEV\n\n- (void)addHandler:(id<RCTPackagerClientMethod>)handler forPackagerMethod:(NSString *)name\n{\n#if ENABLE_PACKAGER_CONNECTION\n  [[RCTPackagerConnection sharedPackagerConnection] addHandler:handler forMethod:name];\n#endif\n}\n\n#endif\n\n#pragma mark - Internal\n\n/**\n *  Query the data source for all possible settings and make sure we're doing the right\n *  thing for the state of each setting.\n */\n- (void)_synchronizeAllSettings\n{\n  [self _liveReloadSettingDidChange];\n  [self _remoteDebugSettingDidChange];\n  [self _profilingSettingDidChange];\n}\n\n- (void)_pollForLiveReload\n{\n  if (!_isJSLoaded || ![[self settingForKey:kRCTDevSettingLiveReloadEnabled] boolValue] || !_liveReloadURL) {\n    return;\n  }\n\n  if (_liveReloadUpdateTask) {\n    return;\n  }\n\n  __weak RCTDevSettings *weakSelf = self;\n  _liveReloadUpdateTask = [[NSURLSession sharedSession] dataTaskWithURL:_liveReloadURL completionHandler:\n                           ^(__unused NSData *data, NSURLResponse *response, NSError *error) {\n\n                             dispatch_async(dispatch_get_main_queue(), ^{\n                               __strong RCTDevSettings *strongSelf = weakSelf;\n                               if (strongSelf && [[strongSelf settingForKey:kRCTDevSettingLiveReloadEnabled] boolValue]) {\n                                 NSHTTPURLResponse *HTTPResponse = (NSHTTPURLResponse *)response;\n                                 if (!error && HTTPResponse.statusCode == 205) {\n                                   [strongSelf reload];\n                                 } else {\n                                   if (error.code != NSURLErrorCancelled) {\n                                     strongSelf->_liveReloadUpdateTask = nil;\n                                     [strongSelf _pollForLiveReload];\n                                   }\n                                 }\n                               }\n                             });\n\n                           }];\n\n  [_liveReloadUpdateTask resume];\n}\n\n- (void)jsLoaded:(NSNotification *)notification\n{\n  if (notification.userInfo[@\"bridge\"] != _bridge) {\n    return;\n  }\n\n  _isJSLoaded = YES;\n\n  // Check if live reloading is available\n  NSURL *scriptURL = _bridge.bundleURL;\n  if (![scriptURL isFileURL]) {\n    // Live reloading is disabled when running from bundled JS file\n    _liveReloadURL = [[NSURL alloc] initWithString:@\"/onchange\" relativeToURL:scriptURL];\n  } else {\n    _liveReloadURL = nil;\n  }\n\n  dispatch_async(dispatch_get_main_queue(), ^{\n    // update state again after the bridge has finished loading\n    [self _synchronizeAllSettings];\n\n    // Inspector can only be shown after JS has loaded\n    if ([self isElementInspectorShown]) {\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n      [self.bridge.eventDispatcher sendDeviceEventWithName:@\"toggleElementInspector\" body:nil];\n#pragma clang diagnostic pop\n    }\n  });\n}\n\n@end\n\n#else // #if RCT_DEV\n\n@implementation RCTDevSettings\n\n- (instancetype)initWithDataSource:(id<RCTDevSettingsDataSource>)dataSource { return [super init]; }\n- (BOOL)isHotLoadingAvailable { return NO; }\n- (BOOL)isLiveReloadAvailable { return NO; }\n- (BOOL)isRemoteDebuggingAvailable { return NO; }\n- (id)settingForKey:(NSString *)key { return nil; }\n- (void)reload {}\n- (void)toggleElementInspector {}\n- (void)toggleJSCSamplingProfiler {}\n\n@end\n\n#endif\n\n@implementation RCTBridge (RCTDevSettings)\n\n- (RCTDevSettings *)devSettings\n{\n#if RCT_DEV\n  return [self moduleForClass:[RCTDevSettings class]];\n#else\n  return nil;\n#endif\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTDeviceInfo.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridge.h>\n#import <React/RCTBridgeModule.h>\n\n@interface RCTDeviceInfo : NSObject <RCTBridgeModule, RCTInvalidating>\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTDeviceInfo.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDeviceInfo.h\"\n#import <AppKit/AppKit.h>\n\n#import \"RCTAccessibilityManager.h\"\n#import \"RCTAssert.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTUtils.h\"\n\n@implementation RCTDeviceInfo {\n  id subscription;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES;\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  _bridge = bridge;\n  \n  NSWindow *currentWindow = RCTKeyWindow();\n  \n  subscription = [[NSNotificationCenter defaultCenter] addObserverForName:NSWindowDidResizeNotification\n                                                                   object:currentWindow queue:nil usingBlock:^(__unused NSNotification * n){\n    [self didReceiveNewContentSizeMultiplier];\n  }];\n}\n\nstatic BOOL RCTIsIPhoneX() {\n  static BOOL isIPhoneX = NO;\n  static dispatch_once_t onceToken;\n\n  dispatch_once(&onceToken, ^{\n    RCTAssertMainQueue();\n\n    isIPhoneX = NO;\n  });\n\n  return isIPhoneX;\n}\n\nstatic NSDictionary *RCTExportedDimensions(__unused RCTBridge *bridge)\n{\n  RCTAssertMainQueue();\n\n  // Don't use RCTScreenSize since it the interface orientation doesn't apply to it\n  CGRect screenSize = [[NSScreen mainScreen] frame];\n  NSDictionary *dims = @{\n                         @\"width\": @(screenSize.size.width),\n                         @\"height\": @(screenSize.size.height),\n                         @\"scale\": @(RCTScreenScale()),\n                         @\"fontScale\": @(1) // TODO: fix accessibility bridge.accessibilityManager.multiplier)\n                         };\n  \n  CGRect windowSize = RCTKeyWindow().frame;\n  NSDictionary *windowDims = @{\n                         @\"width\": @(windowSize.size.width),\n                         @\"height\": @(windowSize.size.height),\n                         @\"scale\": @(RCTScreenScale()),\n                         @\"fontScale\": @(1) // TODO: fix accessibility bridge.accessibilityManager.multiplier)\n                         };\n  return @{\n           @\"window\": windowDims,\n           @\"screen\": dims\n           };\n}\n\n- (void)dealloc\n{\n  [NSNotificationCenter.defaultCenter removeObserver:self];\n}\n\n- (void)invalidate\n{\n  RCTExecuteOnMainQueue(^{\n    self->_bridge = nil;\n    [[NSNotificationCenter defaultCenter] removeObserver:self];\n  });\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  return @{\n    @\"Dimensions\": RCTExportedDimensions(_bridge),\n  };\n}\n\n- (void)didReceiveNewContentSizeMultiplier\n{\n  RCTBridge *bridge = _bridge;\n  RCTExecuteOnMainQueue(^{\n    // Report the event across the bridge.\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n    [bridge.eventDispatcher sendDeviceEventWithName:@\"didUpdateDimensions\"\n                                        body:RCTExportedDimensions(bridge)];\n#pragma clang diagnostic pop\n  });\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTEventEmitter.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridge.h>\n\n/**\n * RCTEventEmitter is an abstract base class to be used for modules that emit\n * events to be observed by JS.\n */\n@interface RCTEventEmitter : NSObject <RCTBridgeModule>\n\n@property (nonatomic, weak) RCTBridge *bridge;\n\n/**\n * Override this method to return an array of supported event names. Attempting\n * to observe or send an event that isn't included in this list will result in\n * an error.\n */\n- (NSArray<NSString *> *)supportedEvents;\n\n/**\n * Send an event that does not relate to a specific view, e.g. a navigation\n * or data update notification.\n */\n- (void)sendEventWithName:(NSString *)name body:(id)body;\n\n/**\n * These methods will be called when the first observer is added and when the\n * last observer is removed (or when dealloc is called), respectively. These\n * should be overridden in your subclass in order to start/stop sending events.\n */\n- (void)startObserving;\n- (void)stopObserving;\n\n- (void)addListener:(NSString *)eventName;\n- (void)removeListeners:(double)count;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTEventEmitter.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTEventEmitter.h\"\n#import \"RCTAssert.h\"\n#import \"RCTUtils.h\"\n#import \"RCTLog.h\"\n\n@implementation RCTEventEmitter\n{\n  NSInteger _listenerCount;\n}\n\n+ (NSString *)moduleName\n{\n  return @\"\";\n}\n\n+ (void)initialize\n{\n  if (self != [RCTEventEmitter class]) {\n    RCTAssert(RCTClassOverridesInstanceMethod(self, @selector(supportedEvents)),\n              @\"You must override the `supportedEvents` method of %@\", self);\n  }\n}\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return nil;\n}\n\n- (void)sendEventWithName:(NSString *)eventName body:(id)body\n{\n  RCTAssert(_bridge != nil, @\"Error when sending event: %@ with body: %@. \"\n            \"Bridge is not set. This is probably because you've \"\n            \"explicitly synthesized the bridge in %@, even though it's inherited \"\n            \"from RCTEventEmitter.\", eventName, body, [self class]);\n\n  if (RCT_DEBUG && ![[self supportedEvents] containsObject:eventName]) {\n    RCTLogError(@\"`%@` is not a supported event type for %@. Supported events are: `%@`\",\n                eventName, [self class], [[self supportedEvents] componentsJoinedByString:@\"`, `\"]);\n  }\n  if (_listenerCount > 0) {\n    [_bridge enqueueJSCall:@\"RCTDeviceEventEmitter\"\n                    method:@\"emit\"\n                      args:body ? @[eventName, body] : @[eventName]\n                completion:NULL];\n  } else {\n    RCTLogWarn(@\"Sending `%@` with no listeners registered.\", eventName);\n  }\n}\n\n- (void)startObserving\n{\n  // Does nothing\n}\n\n- (void)stopObserving\n{\n  // Does nothing\n}\n\n- (void)dealloc\n{\n  if (_listenerCount > 0) {\n    [self stopObserving];\n  }\n}\n\nRCT_EXPORT_METHOD(addListener:(NSString *)eventName)\n{\n  if (RCT_DEBUG && ![[self supportedEvents] containsObject:eventName]) {\n    RCTLogError(@\"`%@` is not a supported event type for %@. Supported events are: `%@`\",\n                eventName, [self class], [[self supportedEvents] componentsJoinedByString:@\"`, `\"]);\n  }\n  _listenerCount++;\n  if (_listenerCount == 1) {\n    [self startObserving];\n  }\n}\n\nRCT_EXPORT_METHOD(removeListeners:(double)count)\n{\n  int currentCount = (int)count;\n  if (RCT_DEBUG && currentCount > _listenerCount) {\n    RCTLogError(@\"Attempted to remove more %@ listeners than added\", [self class]);\n  }\n  _listenerCount = MAX(_listenerCount - currentCount, 0);\n  if (_listenerCount == 0) {\n    [self stopObserving];\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTExceptionsManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridgeModule.h>\n\n@protocol RCTExceptionsManagerDelegate <NSObject>\n\n- (void)handleSoftJSExceptionWithMessage:(NSString *)message stack:(NSArray *)stack exceptionId:(NSNumber *)exceptionId;\n- (void)handleFatalJSExceptionWithMessage:(NSString *)message stack:(NSArray *)stack exceptionId:(NSNumber *)exceptionId;\n\n@optional\n- (void)updateJSExceptionWithMessage:(NSString *)message stack:(NSArray *)stack exceptionId:(NSNumber *)exceptionId;\n\n@end\n\n@interface RCTExceptionsManager : NSObject <RCTBridgeModule>\n\n- (instancetype)initWithDelegate:(id<RCTExceptionsManagerDelegate>)delegate;\n\n@property (nonatomic, weak) id<RCTExceptionsManagerDelegate> delegate;\n\n@property (nonatomic, assign) NSUInteger maxReloadAttempts;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTExceptionsManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTExceptionsManager.h\"\n\n#import \"RCTConvert.h\"\n#import \"RCTDefines.h\"\n#import \"RCTLog.h\"\n#import \"RCTRedBox.h\"\n#import \"RCTRootView.h\"\n\n@implementation RCTExceptionsManager\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n- (instancetype)initWithDelegate:(id<RCTExceptionsManagerDelegate>)delegate\n{\n  if ((self = [self init])) {\n    _delegate = delegate;\n  }\n  return self;\n}\n\nRCT_EXPORT_METHOD(reportSoftException:(NSString *)message\n                  stack:(NSArray<NSDictionary *> *)stack\n                  exceptionId:(nonnull NSNumber *)exceptionId)\n{\n  [_bridge.redBox showErrorMessage:message withStack:stack];\n\n  if (_delegate) {\n    [_delegate handleSoftJSExceptionWithMessage:message stack:stack exceptionId:exceptionId];\n  }\n}\n\nRCT_EXPORT_METHOD(reportFatalException:(NSString *)message\n                  stack:(NSArray<NSDictionary *> *)stack\n                  exceptionId:(nonnull NSNumber *)exceptionId)\n{\n  [_bridge.redBox showErrorMessage:message withStack:stack];\n\n  if (_delegate) {\n    [_delegate handleFatalJSExceptionWithMessage:message stack:stack exceptionId:exceptionId];\n  }\n\n  static NSUInteger reloadRetries = 0;\n  if (!RCT_DEBUG && reloadRetries < _maxReloadAttempts) {\n    reloadRetries++;\n    [_bridge reload];\n  } else {\n    NSString *description = [@\"Unhandled JS Exception: \" stringByAppendingString:message];\n    NSDictionary *errorInfo = @{ NSLocalizedDescriptionKey: description, RCTJSStackTraceKey: stack };\n    RCTFatal([NSError errorWithDomain:RCTErrorDomain code:0 userInfo:errorInfo]);\n  }\n}\n\nRCT_EXPORT_METHOD(updateExceptionMessage:(NSString *)message\n                  stack:(NSArray<NSDictionary *> *)stack\n                  exceptionId:(nonnull NSNumber *)exceptionId)\n{\n  [_bridge.redBox updateErrorMessage:message withStack:stack];\n\n  if (_delegate && [_delegate respondsToSelector:@selector(updateJSExceptionWithMessage:stack:exceptionId:)]) {\n    [_delegate updateJSExceptionWithMessage:message stack:stack exceptionId:exceptionId];\n  }\n}\n\n// Deprecated.  Use reportFatalException directly instead.\nRCT_EXPORT_METHOD(reportUnhandledException:(NSString *)message\n                  stack:(NSArray<NSDictionary *> *)stack)\n{\n  [self reportFatalException:message stack:stack exceptionId:@-1];\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTI18nManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTBridgeModule.h>\n\n/**\n * @experimental\n * This is a experimental module for RTL support\n * This module bridges the i18n utility from RCTI18nUtil\n */\n@interface RCTI18nManager : NSObject <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTI18nManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTI18nManager.h\"\n#import \"RCTI18nUtil.h\"\n\n@implementation RCTI18nManager\n\nRCT_EXPORT_MODULE()\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return NO;\n}\n\nRCT_EXPORT_METHOD(allowRTL:(BOOL)value)\n{\n  [[RCTI18nUtil sharedInstance] allowRTL:value];\n}\n\nRCT_EXPORT_METHOD(forceRTL:(BOOL)value)\n{\n  [[RCTI18nUtil sharedInstance] forceRTL:value];\n}\n\nRCT_EXPORT_METHOD(swapLeftAndRightInRTL:(BOOL)value)\n{\n  [[RCTI18nUtil sharedInstance] swapLeftAndRightInRTL:value];\n}\n\n- (NSDictionary *)constantsToExport\n{\n  return @{\n    @\"isRTL\": @([[RCTI18nUtil sharedInstance] isRTL]),\n    @\"doLeftAndRightSwapInRTL\": @([[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL])\n  };\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTI18nUtil.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n/**\n * @experimental\n * This is a experimental module for to expose constance IsRTL to js about the RTL status.\n * And it allows js to force RLT status for development propose.\n * This will also provide other i18n related utilities in the future.\n */\n@interface RCTI18nUtil : NSObject\n\n+ (instancetype)sharedInstance;\n\n- (BOOL)isRTL;\n- (BOOL)isRTLAllowed;\n- (void)allowRTL:(BOOL)value;\n- (BOOL)isRTLForced;\n- (void)forceRTL:(BOOL)value;\n- (BOOL)doLeftAndRightSwapInRTL;\n- (void)swapLeftAndRightInRTL:(BOOL)value;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTI18nUtil.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import \"RCTI18nUtil.h\"\n\n@implementation RCTI18nUtil\n\n+ (instancetype)sharedInstance\n{\n  static RCTI18nUtil *sharedInstance;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    sharedInstance = [self new];\n    [sharedInstance swapLeftAndRightInRTL: true];\n  });\n  \n  return sharedInstance;\n}\n\n/**\n * Check if the app is currently running on an RTL locale.\n * This only happens when the app:\n * - is forcing RTL layout, regardless of the active language (for development purpose)\n * - allows RTL layout when using RTL locale\n */\n- (BOOL)isRTL\n{\n  if ([self isRTLForced]) {\n    return YES;\n  }\n  if ([self isRTLAllowed] && [self isApplicationPreferredLanguageRTL]) {\n    return YES;\n  }\n  return NO;\n}\n\n/**\n * Should be used very early during app start up\n * Before the bridge is initialized\n * @return whether the app allows RTL layout, default is true\n */\n- (BOOL)isRTLAllowed\n{\n  NSNumber *value = [[NSUserDefaults standardUserDefaults] objectForKey:@\"RCTI18nUtil_allowRTL\"];\n  if (value == nil) {\n    return YES;\n  }\n  return [value boolValue];\n}\n\n- (void)allowRTL:(BOOL)rtlStatus\n{\n  [[NSUserDefaults standardUserDefaults] setBool:rtlStatus forKey:@\"RCTI18nUtil_allowRTL\"];\n  [[NSUserDefaults standardUserDefaults] synchronize];\n}\n\n/**\n * Could be used to test RTL layout with English\n * Used for development and testing purpose\n */\n- (BOOL)isRTLForced\n{\n  BOOL rtlStatus = [[NSUserDefaults standardUserDefaults]\n                            boolForKey:@\"RCTI18nUtil_forceRTL\"];\n  return rtlStatus;\n}\n\n- (void)forceRTL:(BOOL)rtlStatus\n{\n  [[NSUserDefaults standardUserDefaults] setBool:rtlStatus forKey:@\"RCTI18nUtil_forceRTL\"];\n  [[NSUserDefaults standardUserDefaults] synchronize];\n}\n\n- (BOOL)doLeftAndRightSwapInRTL\n{\n  return [[NSUserDefaults standardUserDefaults] boolForKey:@\"RCTI18nUtil_makeRTLFlipLeftAndRightStyles\"];\n}\n\n- (void)swapLeftAndRightInRTL:(BOOL)value\n{\n  [[NSUserDefaults standardUserDefaults] setBool:value forKey:@\"RCTI18nUtil_makeRTLFlipLeftAndRightStyles\"];\n  [[NSUserDefaults standardUserDefaults] synchronize];\n}\n\n// Check if the current device language is RTL\n- (BOOL)isDevicePreferredLanguageRTL\n{\n  NSLocaleLanguageDirection direction = [NSLocale characterDirectionForLanguage:[[NSLocale preferredLanguages] objectAtIndex:0]];\n  return direction == NSLocaleLanguageDirectionRightToLeft;\n}\n\n// Check if the current application language is RTL\n- (BOOL)isApplicationPreferredLanguageRTL\n{\n  NSString *preferredAppLanguage = [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];\n  NSLocaleLanguageDirection direction = [NSLocale characterDirectionForLanguage:preferredAppLanguage];\n  return direction == NSLocaleLanguageDirectionRightToLeft;\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTJSCSamplingProfiler.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridgeModule.h>\n\n@interface RCTJSCSamplingProfiler : NSObject <RCTBridgeModule>\n\n/**\n * Receives a JSON string containing the result of a JSC CPU Profiling run,\n *  and sends them to the packager to be symbolicated and saved to disk.\n * It is safe to call this method from any thread.\n */\n- (void)operationCompletedWithResults:(NSString *)results;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTJSCSamplingProfiler.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTJSCSamplingProfiler.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTLog.h\"\n\n@implementation RCTJSCSamplingProfiler\n\n@synthesize methodQueue = _methodQueue;\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE(RCTJSCSamplingProfiler);\n\n#ifdef RCT_PROFILE\nRCT_EXPORT_METHOD(operationComplete:(__unused int)token result:(id)profileData error:(id)error)\n{\n  if (error) {\n    RCTLogError(@\"JSC Sampling profiler ended with error: %@\", error);\n    return;\n  }\n\n  // Create a POST request with all of the datas\n  NSURL *url = [NSURL URLWithString:@\"/jsc-profile\" relativeToURL:self.bridge.bundleURL];\n  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url\n                                                         cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData\n                                                     timeoutInterval:60];\n  [request setHTTPMethod:@\"POST\"];\n  [request setHTTPBody:[profileData dataUsingEncoding:NSUTF8StringEncoding]];\n\n  // Send the request\n  NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];\n  NSURLSessionDataTask *sessionDataTask = [session dataTaskWithRequest:request completionHandler:^(__unused NSData *data, __unused NSURLResponse *response, NSError *sessionError) {\n    if (sessionError) {\n      RCTLogWarn(@\"JS CPU Profile data failed to send. Is the packager server running locally?\\nDetails: %@\", error);\n    } else {\n      RCTLogInfo(@\"JS CPU Profile data sent successfully.\");\n    }\n  }];\n\n  [sessionDataTask resume];\n}\n\n- (void)operationCompletedWithResults:(NSString *)results\n{\n  // Send the results to the packager, using the module's queue.\n  dispatch_async(self.methodQueue, ^{\n    [self operationComplete:0 result:results error:nil];\n  });\n}\n\n#endif\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTKeyboardObserver.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTEventEmitter.h>\n\n@interface RCTKeyboardObserver : RCTEventEmitter\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTKeyboardObserver.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTKeyboardObserver.h\"\n\n#import \"RCTEventDispatcher.h\"\n\nstatic NSDictionary *RCTParseKeyboardNotification(NSNotification *notification);\n\n@implementation RCTKeyboardObserver\n\nRCT_EXPORT_MODULE()\n\n- (void)startObserving\n{\n#if !TARGET_OS_TV\n\n  NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];\n\n#define ADD_KEYBOARD_HANDLER(NAME, SELECTOR) \\\n  [nc addObserver:self selector:@selector(SELECTOR:) name:NAME object:nil]\n\n  ADD_KEYBOARD_HANDLER(UIKeyboardWillShowNotification, keyboardWillShow);\n  ADD_KEYBOARD_HANDLER(UIKeyboardDidShowNotification, keyboardDidShow);\n  ADD_KEYBOARD_HANDLER(UIKeyboardWillHideNotification, keyboardWillHide);\n  ADD_KEYBOARD_HANDLER(UIKeyboardDidHideNotification, keyboardDidHide);\n  ADD_KEYBOARD_HANDLER(UIKeyboardWillChangeFrameNotification, keyboardWillChangeFrame);\n  ADD_KEYBOARD_HANDLER(UIKeyboardDidChangeFrameNotification, keyboardDidChangeFrame);\n\n#undef ADD_KEYBOARD_HANDLER\n\n#endif\n\n}\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[@\"keyboardWillShow\",\n           @\"keyboardDidShow\",\n           @\"keyboardWillHide\",\n           @\"keyboardDidHide\",\n           @\"keyboardWillChangeFrame\",\n           @\"keyboardDidChangeFrame\"];\n}\n\n- (void)stopObserving\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n// Bridge might be already invalidated by the time the keyboard is about to be dismissed.\n// This might happen, for example, when reload from the packager is performed.\n// Thus we need to check against nil here.\n#define IMPLEMENT_KEYBOARD_HANDLER(EVENT) \\\n- (void)EVENT:(NSNotification *)notification \\\n{ \\\n  if (!self.bridge) { \\\n    return; \\\n  } \\\n  [self sendEventWithName:@#EVENT \\\n    body:RCTParseKeyboardNotification(notification)]; \\\n}\n\nIMPLEMENT_KEYBOARD_HANDLER(keyboardWillShow)\nIMPLEMENT_KEYBOARD_HANDLER(keyboardDidShow)\nIMPLEMENT_KEYBOARD_HANDLER(keyboardWillHide)\nIMPLEMENT_KEYBOARD_HANDLER(keyboardDidHide)\nIMPLEMENT_KEYBOARD_HANDLER(keyboardWillChangeFrame)\nIMPLEMENT_KEYBOARD_HANDLER(keyboardDidChangeFrame)\n\n@end\n\nNS_INLINE NSDictionary *RCTRectDictionaryValue(CGRect rect)\n{\n  return @{\n    @\"screenX\": @(rect.origin.x),\n    @\"screenY\": @(rect.origin.y),\n    @\"width\": @(rect.size.width),\n    @\"height\": @(rect.size.height),\n  };\n}\n\nstatic NSString *RCTAnimationNameForCurve(UIViewAnimationCurve curve)\n{\n  switch (curve) {\n    case UIViewAnimationCurveEaseIn:\n      return @\"easeIn\";\n    case UIViewAnimationCurveEaseInOut:\n      return @\"easeInEaseOut\";\n    case UIViewAnimationCurveEaseOut:\n      return @\"easeOut\";\n    case UIViewAnimationCurveLinear:\n      return @\"linear\";\n    default:\n      return @\"keyboard\";\n  }\n}\n\nstatic NSDictionary *RCTParseKeyboardNotification(NSNotification *notification)\n{\n#if TARGET_OS_TV\n  return @{};\n#else\n  NSDictionary *userInfo = notification.userInfo;\n  CGRect beginFrame = [userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue];\n  CGRect endFrame = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];\n  NSTimeInterval duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];\n  UIViewAnimationCurve curve = [userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue];\n\n  return @{\n    @\"startCoordinates\": RCTRectDictionaryValue(beginFrame),\n    @\"endCoordinates\": RCTRectDictionaryValue(endFrame),\n    @\"duration\": @(duration * 1000.0), // ms\n    @\"easing\": RCTAnimationNameForCurve(curve),\n  };\n#endif\n}\n"
  },
  {
    "path": "React/Modules/RCTLayoutAnimation.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTAnimationType.h>\n\n@interface RCTLayoutAnimation : NSObject\n\n@property (nonatomic, readonly) NSTimeInterval duration;\n@property (nonatomic, readonly) NSTimeInterval delay;\n@property (nonatomic, readonly, copy) NSString *property;\n@property (nonatomic, readonly) CGFloat springDamping;\n@property (nonatomic, readonly) CGFloat initialVelocity;\n@property (nonatomic, readonly) RCTAnimationType animationType;\n\n+ (void)initializeStatics;\n\n- (instancetype)initWithDuration:(NSTimeInterval)duration\n                           delay:(NSTimeInterval)delay\n                        property:(NSString *)property\n                   springDamping:(CGFloat)springDamping\n                 initialVelocity:(CGFloat)initialVelocity\n                   animationType:(RCTAnimationType)animationType;\n\n- (instancetype)initWithDuration:(NSTimeInterval)duration\n                          config:(NSDictionary *)config;\n\n- (void)performAnimations:(void (^)(void))animations\n      withCompletionBlock:(void (^)(BOOL completed))completionBlock;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTLayoutAnimation.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTLayoutAnimation.h\"\n#import \"NSView+NSViewAnimationWithBlocks.h\"\n\n#import \"RCTConvert.h\"\n\n@implementation RCTLayoutAnimation\n\nstatic NSViewAnimationCurve _currentKeyboardAnimationCurve;\n\nstatic NSViewAnimationOptions NSViewAnimationOptionsFromRCTAnimationType(RCTAnimationType type)\n{\n  switch (type) {\n    case RCTAnimationTypeLinear:\n      return NSViewAnimationOptionCurveLinear;\n    case RCTAnimationTypeEaseIn:\n      return NSViewAnimationOptionCurveEaseIn;\n    case RCTAnimationTypeEaseOut:\n      return NSViewAnimationOptionCurveEaseOut;\n    case RCTAnimationTypeEaseInEaseOut:\n      return NSViewAnimationOptionCurveEaseInOut;\n    case RCTAnimationTypeKeyboard:\n      // http://stackoverflow.com/questions/18870447/how-to-use-the-default-ios7-uianimation-curve\n      return (NSViewAnimationOptions)(_currentKeyboardAnimationCurve << 16);\n    default:\n      RCTLogError(@\"Unsupported animation type %zd\", type);\n      return NSViewAnimationOptionCurveEaseInOut;\n  }\n}\n\n// Use a custom initialization function rather than implementing `+initialize` so that we can control\n// when the initialization code runs. `+initialize` runs immediately before the first message is sent\n// to the class which may be too late for us. By this time, we may have missed some\n// `UIKeyboardWillChangeFrameNotification`s.\n+ (void)initializeStatics\n{\n#if !TARGET_OS_TV\n//  static dispatch_once_t onceToken;\n//  dispatch_once(&onceToken, ^{\n//    [[NSNotificationCenter defaultCenter] addObserver:self\n//                                             selector:@selector(keyboardWillChangeFrame:)\n//                                                 name:UIKeyboardWillChangeFrameNotification\n//                                               object:nil];\n//  });\n#endif\n}\n\n+ (void)keyboardWillChangeFrame:(NSNotification *)notification\n{\n#if !TARGET_OS_TV\n  // NSDictionary *userInfo = notification.userInfo;\n  // _currentKeyboardAnimationCurve = [userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue];\n#endif\n}\n\n- (instancetype)initWithDuration:(NSTimeInterval)duration\n                           delay:(NSTimeInterval)delay\n                        property:(NSString *)property\n                   springDamping:(CGFloat)springDamping\n                 initialVelocity:(CGFloat)initialVelocity\n                   animationType:(RCTAnimationType)animationType\n{\n  if (self = [super init]) {\n    _duration = duration;\n    _delay = delay;\n    _property = property;\n    _springDamping = springDamping;\n    _initialVelocity = initialVelocity;\n    _animationType = animationType;\n  }\n\n  return self;\n}\n\n- (instancetype)initWithDuration:(NSTimeInterval)duration\n                          config:(NSDictionary *)config\n{\n  if (!config) {\n    return nil;\n  }\n\n  if (self = [super init]) {\n    _property = [RCTConvert NSString:config[@\"property\"]];\n\n    _duration = [RCTConvert NSTimeInterval:config[@\"duration\"]] ?: duration;\n    if (_duration > 0.0 && _duration < 0.01) {\n      RCTLogError(@\"RCTLayoutAnimationGroup expects timings to be in ms, not seconds.\");\n      _duration = _duration * 1000.0;\n    }\n\n    _delay = [RCTConvert NSTimeInterval:config[@\"delay\"]];\n    if (_delay > 0.0 && _delay < 0.01) {\n      RCTLogError(@\"RCTLayoutAnimationGroup expects timings to be in ms, not seconds.\");\n      _delay = _delay * 1000.0;\n    }\n\n    _animationType = [RCTConvert RCTAnimationType:config[@\"type\"]];\n    if (_animationType == RCTAnimationTypeSpring) {\n      _springDamping = [RCTConvert CGFloat:config[@\"springDamping\"]];\n      _initialVelocity = [RCTConvert CGFloat:config[@\"initialVelocity\"]];\n    }\n  }\n\n  return self;\n}\n\n- (void)performAnimations:(void (^)(void))animations\n      withCompletionBlock:(void (^)(BOOL completed))completionBlock\n{\n  if (_animationType == RCTAnimationTypeSpring) {\n    [NSView animateWithDuration:_duration\n                          delay:_delay\n         usingSpringWithDamping:_springDamping\n          initialSpringVelocity:_initialVelocity\n                        options:NSViewAnimationOptionBeginFromCurrentState\n                     animations:animations\n                     completion:completionBlock];\n  } else {\n    NSViewAnimationOptions options =\n      NSViewAnimationOptionBeginFromCurrentState |\n      NSViewAnimationOptionsFromRCTAnimationType(_animationType);\n\n    [NSView animateWithDuration:_duration\n                          delay:_delay\n                        options:options\n                     animations:animations\n                     completion:completionBlock];\n  }\n}\n\n- (BOOL)isEqual:(RCTLayoutAnimation *)animation\n{\n  return\n    _duration == animation.duration &&\n    _delay == animation.delay &&\n    (_property == animation.property || [_property isEqualToString:animation.property]) &&\n    _springDamping == animation.springDamping &&\n    _initialVelocity == animation.initialVelocity &&\n    _animationType == animation.animationType;\n}\n\n- (NSString *)description\n{\n  return [NSString stringWithFormat:@\"<%@: %p; duration: %f; delay: %f; property: %@; springDamping: %f; initialVelocity: %f; animationType: %li;>\",\n          NSStringFromClass([self class]), self, _duration, _delay, _property, _springDamping, _initialVelocity, (long)_animationType];\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTLayoutAnimationGroup.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBridgeModule.h>\n\n@class RCTLayoutAnimation;\n\n@interface RCTLayoutAnimationGroup : NSObject\n\n@property (nonatomic, readonly) RCTLayoutAnimation *creatingLayoutAnimation;\n@property (nonatomic, readonly) RCTLayoutAnimation *updatingLayoutAnimation;\n@property (nonatomic, readonly) RCTLayoutAnimation *deletingLayoutAnimation;\n\n@property (nonatomic, copy) RCTResponseSenderBlock callback;\n\n- (instancetype)initWithCreatingLayoutAnimation:(RCTLayoutAnimation *)creatingLayoutAnimation\n                        updatingLayoutAnimation:(RCTLayoutAnimation *)updatingLayoutAnimation\n                        deletingLayoutAnimation:(RCTLayoutAnimation *)deletingLayoutAnimation\n                                       callback:(RCTResponseSenderBlock)callback;\n\n- (instancetype)initWithConfig:(NSDictionary *)config\n                      callback:(RCTResponseSenderBlock)callback;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTLayoutAnimationGroup.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTLayoutAnimationGroup.h\"\n\n#import \"RCTLayoutAnimation.h\"\n#import \"RCTConvert.h\"\n\n@implementation RCTLayoutAnimationGroup\n\n- (instancetype)initWithCreatingLayoutAnimation:(RCTLayoutAnimation *)creatingLayoutAnimation\n                        updatingLayoutAnimation:(RCTLayoutAnimation *)updatingLayoutAnimation\n                        deletingLayoutAnimation:(RCTLayoutAnimation *)deletingLayoutAnimation\n                                       callback:(RCTResponseSenderBlock)callback\n{\n  if (self = [super init]) {\n    _creatingLayoutAnimation = creatingLayoutAnimation;\n    _updatingLayoutAnimation = updatingLayoutAnimation;\n    _deletingLayoutAnimation = deletingLayoutAnimation;\n    _callback = callback;\n  }\n\n  return self;\n}\n\n- (instancetype)initWithConfig:(NSDictionary *)config\n                      callback:(RCTResponseSenderBlock)callback\n{\n  if (!config) {\n    return nil;\n  }\n\n  if (self = [super init]) {\n    NSTimeInterval duration = [RCTConvert NSTimeInterval:config[@\"duration\"]];\n\n    if (duration > 0.0 && duration < 0.01) {\n      RCTLogError(@\"RCTLayoutAnimationGroup expects timings to be in ms, not seconds.\");\n      duration = duration * 1000.0;\n    }\n\n    _creatingLayoutAnimation = [[RCTLayoutAnimation alloc] initWithDuration:duration config:config[@\"create\"]];\n    _updatingLayoutAnimation = [[RCTLayoutAnimation alloc] initWithDuration:duration config:config[@\"update\"]];\n    _deletingLayoutAnimation = [[RCTLayoutAnimation alloc] initWithDuration:duration config:config[@\"delete\"]];\n    _callback = callback;\n  }\n\n  return self;\n}\n\n- (BOOL)isEqual:(RCTLayoutAnimationGroup *)layoutAnimation\n{\n  RCTLayoutAnimation *creatingLayoutAnimation = layoutAnimation.creatingLayoutAnimation;\n  RCTLayoutAnimation *updatingLayoutAnimation = layoutAnimation.updatingLayoutAnimation;\n  RCTLayoutAnimation *deletingLayoutAnimation = layoutAnimation.deletingLayoutAnimation;\n\n  return\n    (_creatingLayoutAnimation == creatingLayoutAnimation || [_creatingLayoutAnimation isEqual:creatingLayoutAnimation]) &&\n    (_updatingLayoutAnimation == updatingLayoutAnimation || [_updatingLayoutAnimation isEqual:updatingLayoutAnimation]) &&\n    (_deletingLayoutAnimation == deletingLayoutAnimation || [_deletingLayoutAnimation isEqual:deletingLayoutAnimation]);\n}\n\n- (NSString *)description\n{\n  return [NSString stringWithFormat:@\"<%@: %p; creatingLayoutAnimation: %@; updatingLayoutAnimation: %@; deletingLayoutAnimation: %@>\",\n          NSStringFromClass([self class]), self, [_creatingLayoutAnimation description], [_updatingLayoutAnimation description], [_deletingLayoutAnimation description]];\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTMenuManager.h",
    "content": "#import \"RCTBridgeModule.h\"\n\n@interface MenuManager : NSObject <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTMenuManager.m",
    "content": "#include \"RCTMenuManager.h\"\n#include \"Cocoa/Cocoa.h\"\n#import \"RCTBridge.h\"\n#import \"RCTEventDispatcher.h\"\n\n@implementation MenuManager {\n  BOOL toRefresh;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE();\n\n - (instancetype)init\n {\n   if (self = [super init]) {\n     toRefresh = NO;\n   }\n   return self;\n }\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  _bridge = bridge;\n  toRefresh = YES;\n}\n\n-(NSMenu *)ensureSubmenu:(NSString *)title\n {\n   if ([[NSApp mainMenu] indexOfItemWithTitle:title] > -1) {\n     if (toRefresh) {\n       [[NSApp mainMenu] removeItemAtIndex:[[NSApp mainMenu] indexOfItemWithTitle:title]];\n     } else {\n       return [[NSApp mainMenu] itemWithTitle:title].submenu;\n     }\n   }\n   NSMenuItem *itemContainer = [[NSMenuItem alloc] init];\n   itemContainer.title = title;\n   NSMenu *menu = [[NSMenu alloc] initWithTitle:title];\n   [itemContainer setSubmenu:menu];\n   [[NSApp mainMenu] addItem:itemContainer];\n   toRefresh = NO;\n   return menu;\n }\n\n-(void)callback:(id)sender\n{\n  NSMenuItem *item = (NSMenuItem *)sender;\n  if (item.keyEquivalent) {\n    NSString *keyPrefix = @\"onKeyPressed_\";\n\n    [_bridge.eventDispatcher\n     sendDeviceEventWithName:[keyPrefix stringByAppendingString:item.keyEquivalent]\n     body:@{}];\n  }\n  NSString *prefix = @\"onTitlePressed\";\n\n  [_bridge.eventDispatcher\n   sendDeviceEventWithName:[prefix stringByAppendingString:item.title]\n   body:@{}];\n\n}\n\nRCT_EXPORT_METHOD(addItemToSubmenu:(NSString *)title\n                  item:(NSDictionary *)item\n                  resolver:(RCTPromiseResolveBlock)resolve\n                  rejecter:(RCTPromiseRejectBlock)reject)\n{\n\n  if (!item || ![item valueForKey:@\"title\"]) {\n    reject(@\"Item requires title, key and callback\", nil, nil);\n  }\n\n  NSMenu *menu = [self ensureSubmenu:title];\n  if ([menu indexOfItemWithTitle:item[@\"title\"]] == -1) {\n    NSMenuItem *menuItem = [[NSMenuItem alloc] init];\n\n    menuItem.title = item[@\"title\"];\n    if ([item valueForKey:@\"key\"]) {\n       menuItem.keyEquivalent = item[@\"key\"];\n    }\n\n    if ([item valueForKey:@\"firstResponder\"]) {\n      menuItem.action = NSSelectorFromString([item valueForKey:@\"firstResponder\"]);\n      [menuItem setTarget:nil];\n    } else {\n      menuItem.action = @selector(callback:);\n      [menuItem setTarget:self];\n\n    }\n       [menu addItem:menuItem];\n    if ([item valueForKey:@\"separator\"]) {\n      [menu addItem:[NSMenuItem separatorItem]];\n    }\n    resolve(@[]);\n  }\n}\n\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTRedBox.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBridge.h>\n#import <React/RCTBridgeModule.h>\n#import <React/RCTErrorCustomizer.h>\n\n@class RCTJSStackFrame;\n\n@interface RCTRedBox : NSObject <RCTBridgeModule>\n\n- (void)registerErrorCustomizer:(id<RCTErrorCustomizer>)errorCustomizer;\n- (void)showError:(NSError *)error;\n- (void)showErrorMessage:(NSString *)message;\n- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details;\n- (void)showErrorMessage:(NSString *)message withRawStack:(NSString *)rawStack;\n- (void)showErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack;\n- (void)updateErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack;\n- (void)showErrorMessage:(NSString *)message withParsedStack:(NSArray<RCTJSStackFrame *> *)stack;\n- (void)updateErrorMessage:(NSString *)message withParsedStack:(NSArray<RCTJSStackFrame *> *)stack;\n\n- (void)dismiss;\n\n/** Overrides bridge.bundleURL. Modify on main thread only. You shouldn't need to use this. */\n@property (nonatomic, strong) NSURL *overrideBundleURL;\n\n/** Overrides the default behavior of calling [bridge reload] on reload. You shouldn't need to use this. */\n@property (nonatomic, strong) dispatch_block_t overrideReloadAction;\n\n@end\n\n/**RCTPerformanceLogger\n * This category makes the red box instance available via the RCTBridge, which\n * is useful for any class that needs to access the red box or error log.\n */\n@interface RCTBridge (RCTRedBox)\n\n@property (nonatomic, readonly) RCTRedBox *redBox;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTRedBox.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n#import <AppKit/AppKit.h>\n\n#import \"RCTRedBox.h\"\n\n#import \"RCTView.h\"\n#import \"RCTBridge.h\"\n#import \"RCTConvert.h\"\n#import \"RCTDefines.h\"\n#import \"RCTErrorInfo.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTJSStackFrame.h\"\n// #import \"RCTRedBoxExtraDataViewController.h\"\n#import \"RCTUtils.h\"\n\n#if RCT_DEBUG\n\nconst CGFloat buttonHeight = 50;\nconst CGFloat buttonMargin = 10;\n\n@interface ErrorNSTableView : NSTableView;\n@end\n\n@implementation ErrorNSTableView\n\n- (BOOL)isFlipped\n{\n  return YES;\n}\n\n- (void)setFrameSize:(NSSize)newSize\n{\n  // Add padding to the bottom of the scroll view.\n  newSize.height += buttonHeight + (buttonMargin * 2);\n  [super setFrameSize:newSize];\n}\n\n@end\n\n@class RCTRedBoxWindow;\n\n@interface RCTRedBoxButton : NSButton\n- (void)setBackgroundColor:(NSColor *)backgroundColor;\n@end\n\n@protocol RCTRedBoxWindowActionDelegate <NSObject>\n\n- (void)redBoxWindow:(RCTRedBoxWindow *)redBoxWindow openStackFrameInEditor:(RCTJSStackFrame *)stackFrame;\n- (void)reloadFromRedBoxWindow:(RCTRedBoxWindow *)redBoxWindow;\n- (void)loadExtraDataViewController;\n\n@end\n\n@interface RCTRedBoxWindow : NSWindow <NSTableViewDelegate, NSTableViewDataSource>\n@property (nonatomic, weak) id<RCTRedBoxWindowActionDelegate> actionDelegate;\n@property (nonatomic, weak) RCTBridge *bridge;\n@end\n\n@implementation RCTRedBoxWindow\n{\n  NSTableView *_stackTraceTableView;\n  NSString *_lastErrorMessage;\n  NSArray<RCTJSStackFrame *> *_lastStackTrace;\n  NSTextField * _temporaryHeader;\n}\n\n- (instancetype)initWithContentRect:(NSRect)frame\n{\n  self = [super initWithContentRect:frame\n                          styleMask:NSWindowStyleMaskClosable | NSWindowStyleMaskTitled\n                            backing:NSBackingStoreBuffered defer:NO];\n  if (self) {\n    NSColor *backgroundColor = [NSColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:1];\n    RCTView *rootView = [[RCTView alloc] initWithFrame:frame];\n    rootView.backgroundColor = backgroundColor;\n    \n    NSColor *buttonColor = [NSColor colorWithRed:0.8 green:0.15 blue:0.15 alpha:1];\n    CGSize  buttonSize   = {(frame.size.width / 3) - (buttonMargin * 2), buttonHeight};\n    CGPoint buttonOrigin = {buttonMargin, frame.size.height - buttonHeight - buttonMargin};\n    NSDictionary *buttonAttributes = @{\n      NSFontAttributeName: [NSFont systemFontOfSize:20],\n      NSForegroundColorAttributeName: [NSColor whiteColor],\n      NSBackgroundColorAttributeName: [NSColor clearColor],\n    };\n    \n    RCTRedBoxButton *dismissButton = [RCTRedBoxButton new];\n    dismissButton.frame = (CGRect){buttonOrigin, buttonSize};\n    dismissButton.backgroundColor = buttonColor;\n    dismissButton.accessibilityIdentifier = @\"redbox-dismiss\";\n    dismissButton.attributedTitle = [[NSAttributedString alloc] initWithString:@\"Dismiss (ESC)\" attributes:buttonAttributes];\n    dismissButton.target = self;\n    dismissButton.action = @selector(dismiss);\n    \n    buttonOrigin.x += frame.size.width / 3;\n    RCTRedBoxButton *reloadButton = [RCTRedBoxButton new];\n    reloadButton.frame = (CGRect){buttonOrigin, buttonSize};\n    reloadButton.backgroundColor = buttonColor;\n    reloadButton.accessibilityIdentifier = @\"redbox-reload\";\n    reloadButton.attributedTitle = [[NSAttributedString alloc] initWithString:@\"Reload JS (\\u2318R)\" attributes:buttonAttributes];\n    reloadButton.target = self;\n    reloadButton.action = @selector(reload);\n    \n    buttonOrigin.x += frame.size.width / 3;\n    RCTRedBoxButton *copyButton = [RCTRedBoxButton new];\n    copyButton.frame = (CGRect){buttonOrigin, buttonSize};\n    copyButton.backgroundColor = buttonColor;\n    copyButton.accessibilityIdentifier = @\"redbox-copy\";\n    copyButton.attributedTitle = [[NSAttributedString alloc] initWithString:@\"Copy (\\u2325\\u2318C)\" attributes:buttonAttributes];\n    copyButton.target = self;\n    copyButton.action = @selector(copyStack);\n    \n    _stackTraceTableView = [[ErrorNSTableView alloc] initWithFrame:CGRectZero];\n    _stackTraceTableView.backgroundColor = [NSColor clearColor];\n    _stackTraceTableView.headerView = nil;\n    _stackTraceTableView.dataSource = self;\n    _stackTraceTableView.delegate = self;\n    \n    NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:@\"column\"];\n    [_stackTraceTableView addTableColumn:column];\n    \n    CGFloat scrollPadding = 20;\n    frame = NSInsetRect(frame, scrollPadding, scrollPadding);\n    frame.size.width += scrollPadding;\n    frame.size.height += scrollPadding;\n    \n    NSScrollView *scrollView = [[NSScrollView alloc] initWithFrame:frame];\n    scrollView.backgroundColor = [NSColor clearColor];\n    scrollView.documentView = _stackTraceTableView;\n    scrollView.contentView.backgroundColor = backgroundColor;\n    \n    [rootView addSubview:scrollView];\n    [rootView addSubview:dismissButton];\n    [rootView addSubview:reloadButton];\n    [rootView addSubview:copyButton];\n    [self setContentView:rootView];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (void)dealloc\n{\n    _stackTraceTableView.dataSource = nil;\n    _stackTraceTableView.delegate = nil;\n    [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (NSString *)stripAnsi:(NSString *)text\n{\n  NSError *error = nil;\n  NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@\"\\\\x1b\\\\[[0-9;]*m\" options:NSRegularExpressionCaseInsensitive error:&error];\n  return [regex stringByReplacingMatchesInString:text options:0 range:NSMakeRange(0, [text length]) withTemplate:@\"\"];\n}\n\n- (void)showErrorMessage:(NSString *)message withStack:(NSArray<RCTJSStackFrame *> *)stack isUpdate:(BOOL)isUpdate\n{\n  // Remove ANSI color codes from the message\n  NSString *messageWithoutAnsi = [self stripAnsi:message];\n  \n  if (!self.isVisible || (isUpdate && [messageWithoutAnsi isEqualToString:_lastErrorMessage])) {\n    _lastStackTrace = [stack filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(RCTJSStackFrame *stackFrame, __unused NSDictionary *bindings) {\n      return stackFrame.file != nil;\n    }]];\n    _lastErrorMessage = messageWithoutAnsi;\n    \n    [_stackTraceTableView reloadData];\n    [_stackTraceTableView sizeToFit];\n    \n    NSApplication *app = [NSApplication sharedApplication];\n    [app setActivationPolicy:NSApplicationActivationPolicyRegular];\n    \n    [self makeKeyAndOrderFront:nil];\n    [self makeFirstResponder:self];\n  }\n}\n\n- (void)dismiss\n{\n  [self resignFirstResponder];\n  [[[NSApplication sharedApplication] mainWindow] makeKeyWindow];\n  [self orderOut:nil];\n}\n\n- (void)reload\n{\n    [_actionDelegate reloadFromRedBoxWindow:self];\n}\n\n- (void)showExtraDataViewController\n{\n    [_actionDelegate loadExtraDataViewController];\n}\n\n- (void)copyStack\n{\n  NSMutableString *fullStackTrace;\n\n  if (_lastErrorMessage != nil) {\n    fullStackTrace = [_lastErrorMessage mutableCopy];\n    [fullStackTrace appendString:@\"\\n\\n\"];\n  }\n  else {\n    fullStackTrace = [NSMutableString string];\n  }\n\n  for (RCTJSStackFrame *stackFrame in _lastStackTrace) {\n    [fullStackTrace appendString:[NSString stringWithFormat:@\"%@\\n\", stackFrame.methodName]];\n    if (stackFrame.file) {\n      [fullStackTrace appendFormat:@\"    %@\\n\", [self formatFrameSource:stackFrame]];\n    }\n  }\n\n  NSPasteboard *pb = [NSPasteboard generalPasteboard];\n  [pb clearContents];\n  [pb setString:fullStackTrace forType:NSPasteboardTypeString];\n}\n\n- (NSString *)formatFrameSource:(RCTJSStackFrame *)stackFrame\n{\n  NSString *fileName = stackFrame.file ? [stackFrame.file lastPathComponent] : @\"<unknown file>\";\n  NSString *lineInfo = [NSString stringWithFormat:@\"%@:%lld\",\n                        fileName,\n                        (long long)stackFrame.lineNumber];\n\n  if (stackFrame.column != 0) {\n    lineInfo = [lineInfo stringByAppendingFormat:@\":%lld\", (long long)stackFrame.column];\n  }\n  return lineInfo;\n}\n\n#pragma mark - TableView\n\n- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(__unused NSTableColumn *)tableColumn row:(NSInteger)row\n{\n  if (row == 0) {\n    NSTextField *cell = [tableView makeViewWithIdentifier:@\"msg-cell\" owner:self];\n    return [self reuseCell:cell forErrorMessage:_lastErrorMessage];\n  }\n  NSTextField *cell = [tableView makeViewWithIdentifier:@\"cell\" owner:self];\n  return [self reuseCell:cell forStackFrame:_lastStackTrace[row - 1]];\n}\n\n- (NSString *)truncateErrorMessage:(NSString *)message\n{\n  message = [message stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];\n  return [message substringToIndex:MIN((NSUInteger)10000, message.length)];\n}\n\n- (NSTextField *)reuseCell:(NSTextField *)cell forErrorMessage:(NSString *)message\n{\n  if (!cell) {\n    cell = [[NSTextField alloc] initWithFrame:self.contentView.frame];\n    cell.accessibilityIdentifier = @\"redbox-error-message\";\n    cell.textColor = [NSColor whiteColor];\n    cell.font = [NSFont boldSystemFontOfSize:16];\n    cell.lineBreakMode = NSLineBreakByWordWrapping;\n    cell.backgroundColor = [NSColor clearColor];\n    cell.bordered = false;\n    cell.editable = false;\n  }\n  [cell setStringValue:[self truncateErrorMessage:message]];\n  return cell;\n}\n\n- (NSTextField *)reuseCell:(NSTextField *)cell forStackFrame:(RCTJSStackFrame *)stackFrame\n{\n  if (!cell) {\n    cell = [[NSTextField alloc] initWithFrame:self.contentView.frame];\n    cell.accessibilityIdentifier = @\"redbox-stack-frame\";\n    cell.textColor = [NSColor whiteColor];\n    cell.font = [NSFont fontWithName:@\"Menlo-Regular\" size:16];\n    cell.lineBreakMode = NSLineBreakByCharWrapping;\n    cell.backgroundColor = [NSColor clearColor];\n    cell.bordered = false;\n    cell.editable = false;\n  }\n  \n  [cell setStringValue:[NSString stringWithFormat:@\"%@ @ %zd:%zd\",\n                      stackFrame.file.lastPathComponent,\n                      stackFrame.lineNumber,\n                      stackFrame.column]];\n  \n  return cell;\n}\n\n- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row\n{\n  if (row == 0) {\n    NSString *message = [self truncateErrorMessage:_lastErrorMessage];\n    \n    NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];\n    paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;\n    \n    NSDictionary *attributes = @{\n      NSFontAttributeName: [NSFont boldSystemFontOfSize:16],\n      NSParagraphStyleAttributeName: paragraphStyle,\n    };\n    \n    CGRect boundingRect = [message boundingRectWithSize:CGSizeMake(tableView.frame.size.width, CGFLOAT_MAX)\n                                                options:NSStringDrawingUsesLineFragmentOrigin\n                                             attributes:attributes\n                                                context:nil];\n    \n    return ceil(boundingRect.size.height) + 40;\n  } else {\n    return 50;\n  }\n}\n\n- (NSInteger)numberOfRowsInTableView:(__unused NSTableView *)tableView\n{\n  return 1 + _lastStackTrace.count;\n}\n\n-(NSInteger)numberOfColumns:(__unused NSTableView *)tableView\n{\n  return 1;\n}\n\n- (BOOL)tableView:(__unused NSTableView *)tableView shouldSelectRow:(NSInteger)row\n{\n  return row > 0;\n}\n\n- (void)tableViewSelectionDidChange:(__unused NSNotification *)notification\n{\n  NSInteger row = _stackTraceTableView.selectedRow;\n  if (row > 0) {\n    [_stackTraceTableView deselectRow:row];\n    [_actionDelegate redBoxWindow:self openStackFrameInEditor:_lastStackTrace[row - 1]];\n  }\n}\n\n#pragma mark - Key commands\n\n- (void)keyDown:(NSEvent *)theEvent {\n  [super keyDown:theEvent];\n  if (theEvent.modifierFlags == (NSCommandKeyMask & NSDeviceIndependentModifierFlagsMask)\n      && [theEvent.characters isEqualToString:@\"r\"]) {\n    [self reload];\n  }\n  if (theEvent.keyCode == 53)\n  {\n    [self dismiss];\n  }\n\n  // Copy = Cmd-Option C since Cmd-C in the simulator copies the pasteboard from\n  // the simulator to the desktop pasteboard.\n  if (theEvent.modifierFlags == (NSCommandKeyMask & NSAlternateKeyMask)\n      && [theEvent.characters isEqualToString:@\"c\"]) {\n    [self copyStack];\n  }\n}\n\n- (BOOL)canBecomeFirstResponder\n{\n    return YES;\n}\n\n- (BOOL)canBecomeKeyWindow\n{\n  return YES;\n}\n\n@end\n\n@interface RCTRedBox () <RCTInvalidating, RCTRedBoxWindowActionDelegate>\n@end\n\n@implementation RCTRedBox\n{\n    RCTRedBoxWindow *_window;\n    NSMutableArray<id<RCTErrorCustomizer>> *_errorCustomizers;\n    //RCTRedBoxExtraDataViewController *_extraDataViewController;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n- (void)registerErrorCustomizer:(id<RCTErrorCustomizer>)errorCustomizer\n{\n    dispatch_async(dispatch_get_main_queue(), ^{\n        if (!self->_errorCustomizers) {\n            self->_errorCustomizers = [NSMutableArray array];\n        }\n        if (![self->_errorCustomizers containsObject:errorCustomizer]) {\n            [self->_errorCustomizers addObject:errorCustomizer];\n        }\n    });\n}\n\n// WARNING: Should only be called from the main thread/dispatch queue.\n- (RCTErrorInfo *)_customizeError:(RCTErrorInfo *)error\n{\n    RCTAssertMainQueue();\n    if (!self->_errorCustomizers) {\n        return error;\n    }\n    for (id<RCTErrorCustomizer> customizer in self->_errorCustomizers) {\n        RCTErrorInfo *newInfo = [customizer customizeErrorInfo:error];\n        if (newInfo) {\n            error = newInfo;\n        }\n    }\n    return error;\n}\n\n- (void)showError:(NSError *)error\n{\n    [self showErrorMessage:error.localizedDescription\n               withDetails:error.localizedFailureReason\n                     stack:error.userInfo[RCTJSStackTraceKey]];\n}\n\n- (void)showErrorMessage:(NSString *)message\n{\n    [self showErrorMessage:message withParsedStack:nil isUpdate:NO];\n}\n\n- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details\n{\n    [self showErrorMessage:message withDetails:details stack:nil];\n}\n\n- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details stack:(NSArray<RCTJSStackFrame *> *)stack {\n    NSString *combinedMessage = message;\n    if (details) {\n        combinedMessage = [NSString stringWithFormat:@\"%@\\n\\n%@\", message, details];\n    }\n    [self showErrorMessage:combinedMessage withParsedStack:stack isUpdate:NO];\n}\n\n- (void)showErrorMessage:(NSString *)message withRawStack:(NSString *)rawStack\n{\n    NSArray<RCTJSStackFrame *> *stack = [RCTJSStackFrame stackFramesWithLines:rawStack];\n    [self showErrorMessage:message withParsedStack:stack isUpdate:NO];\n}\n\n- (void)showErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack\n{\n    [self showErrorMessage:message withParsedStack:[RCTJSStackFrame stackFramesWithDictionaries:stack] isUpdate:NO];\n}\n\n- (void)updateErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack\n{\n    [self showErrorMessage:message withParsedStack:[RCTJSStackFrame stackFramesWithDictionaries:stack] isUpdate:YES];\n}\n\n- (void)showErrorMessage:(NSString *)message withParsedStack:(NSArray<RCTJSStackFrame *> *)stack\n{\n    [self showErrorMessage:message withParsedStack:stack isUpdate:NO];\n}\n\n- (void)updateErrorMessage:(NSString *)message withParsedStack:(NSArray<RCTJSStackFrame *> *)stack\n{\n    [self showErrorMessage:message withParsedStack:stack isUpdate:YES];\n}\n\n- (void)showErrorMessage:(NSString *)message withParsedStack:(NSArray<RCTJSStackFrame *> *)stack isUpdate:(BOOL)isUpdate\n{\n    dispatch_async(dispatch_get_main_queue(), ^{\n        // if (self->_extraDataViewController == nil) {\n        //     self->_extraDataViewController = [RCTRedBoxExtraDataViewController new];\n        //     self->_extraDataViewController.actionDelegate = self;\n        // }\n        [self->_bridge.eventDispatcher sendDeviceEventWithName:@\"collectRedBoxExtraData\" body:nil];\n\n        if (!self->_window) {\n          NSSize screenSize = NSScreen.mainScreen.frame.size;\n          NSRect contentRect = (CGRect){NSZeroPoint, {screenSize.width / 3, screenSize.height / 1.5}};\n\n          self->_window = [[RCTRedBoxWindow alloc] initWithContentRect:contentRect];\n          self->_window.actionDelegate = self;\n          [self->_window center];\n        }\n\n        RCTErrorInfo *errorInfo = [[RCTErrorInfo alloc] initWithErrorMessage:message\n                                                                       stack:stack];\n        errorInfo = [self _customizeError:errorInfo];\n        [self->_window showErrorMessage:errorInfo.errorMessage\n                              withStack:errorInfo.stack\n                               isUpdate:isUpdate];\n    });\n}\n\n- (void)loadExtraDataViewController {\n    dispatch_async(dispatch_get_main_queue(), ^{\n        // Make sure the CMD+E shortcut doesn't call this twice\n        NSLog(@\"_extraDataViewController is not yet implemented\");\n      // if (self->_extraDataViewController != nil && ![self->_window.contentViewController presentedViewControllers]) {\n      //     [self->_window.contentViewController presentViewControllerAsSheet:self->_extraDataViewController];\n      //   }\n    });\n}\n\nRCT_EXPORT_METHOD(setExtraData:(NSDictionary *)extraData forIdentifier:(__unused NSString *)identifier) {\n    // [_extraDataViewController addExtraData:extraData forIdentifier:identifier];\n    NSLog(@\"_extraDataViewController is not yet implemented %@\", extraData);\n}\n\nRCT_EXPORT_METHOD(dismiss)\n{\n    dispatch_async(dispatch_get_main_queue(), ^{\n        [self->_window dismiss];\n    });\n}\n\n- (void)invalidate\n{\n    [self dismiss];\n}\n\n- (void)redBoxWindow:(__unused RCTRedBoxWindow *)redBoxWindow openStackFrameInEditor:(RCTJSStackFrame *)stackFrame\n{\n    NSURL *const bundleURL = _overrideBundleURL ?: _bridge.bundleURL;\n    if (![bundleURL.scheme hasPrefix:@\"http\"]) {\n        RCTLogWarn(@\"Cannot open stack frame in editor because you're not connected to the packager.\");\n        return;\n    }\n\n    NSData *stackFrameJSON = [RCTJSONStringify([stackFrame toDictionary], NULL) dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *postLength = [NSString stringWithFormat:@\"%tu\", stackFrameJSON.length];\n    NSMutableURLRequest *request = [NSMutableURLRequest new];\n    request.URL = [RCTConvert NSURL:@\"http://localhost:8081/open-stack-frame\"];\n    request.HTTPMethod = @\"POST\";\n    request.HTTPBody = stackFrameJSON;\n    [request setValue:postLength forHTTPHeaderField:@\"Content-Length\"];\n    [request setValue:@\"application/json\" forHTTPHeaderField:@\"Content-Type\"];\n\n    [[[NSURLSession sharedSession] dataTaskWithRequest:request] resume];\n}\n\n- (void)reload\n{\n    // Window is not used and can be nil\n    [self reloadFromRedBoxWindow:nil];\n}\n\n- (void)reloadFromRedBoxWindow:(__unused RCTRedBoxWindow *)redBoxWindow\n{\n    if (_overrideReloadAction) {\n        _overrideReloadAction();\n    } else {\n        [_bridge reload];\n    }\n    [self dismiss];\n}\n\n@end\n\n@interface RCTRedBoxButtonCell : NSButtonCell\n@end\n\n@implementation RCTRedBoxButton\n\n+ (Class)cellClass {\n  return [RCTRedBoxButtonCell class];\n}\n\n- (instancetype)init\n{\n    self = [super init];\n    if (self) {\n        self.bezelStyle = NSBezelStyleRecessed;\n    }\n    return self;\n}\n\n- (void)setBackgroundColor:(NSColor *)backgroundColor\n{\n  self.wantsLayer = true;\n  self.layer.backgroundColor = backgroundColor.CGColor;\n}\n\n@end\n\n@implementation RCTRedBoxButtonCell\n\n- (NSRect)titleRectForBounds:(NSRect)rect\n{\n    NSRect titleFrame = [super titleRectForBounds:rect];\n    NSSize titleSize = self.attributedTitle.size;\n    titleFrame.origin.x = (rect.size.width - titleSize.width) / 2;\n    titleFrame.origin.y = (rect.size.height - titleSize.height) / 2;\n    return titleFrame;\n}\n\n- (void)drawWithFrame:(NSRect)cellFrame inView:(__unused NSView *)controlView\n{\n    NSRect titleRect = [self titleRectForBounds:cellFrame];\n    [self.attributedTitle drawInRect:titleRect];\n}\n\n@end\n\n@implementation RCTBridge (RCTRedBox)\n\n- (RCTRedBox *)redBox\n{\n    return [self moduleForClass:[RCTRedBox class]];\n}\n\n@end\n\n#else // Disabled\n\n@implementation RCTRedBox\n\n+ (NSString *)moduleName { return nil; }\n- (void)registerErrorCustomizer:(id<RCTErrorCustomizer>)errorCustomizer {}\n- (void)showError:(NSError *)message {}\n- (void)showErrorMessage:(NSString *)message {}\n- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details {}\n- (void)showErrorMessage:(NSString *)message withRawStack:(NSString *)rawStack {}\n- (void)showErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack {}\n- (void)updateErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack {}\n- (void)showErrorMessage:(NSString *)message withParsedStack:(NSArray<RCTJSStackFrame *> *)stack {}\n- (void)updateErrorMessage:(NSString *)message withParsedStack:(NSArray<RCTJSStackFrame *> *)stack {}\n- (void)showErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack isUpdate:(BOOL)isUpdate {}\n- (void)dismiss {}\n\n@end\n\n@implementation RCTBridge (RCTRedBox)\n\n- (RCTRedBox *)redBox { return nil; }\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/Modules/RCTRedBoxExtraDataViewController.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@protocol RCTRedBoxExtraDataActionDelegate <NSObject>\n- (void)reload;\n@end\n\n@interface RCTRedBoxExtraDataViewController : NSViewController <NSTableViewDelegate, NSTableViewDataSource>\n\n@property (nonatomic, weak) id<RCTRedBoxExtraDataActionDelegate> actionDelegate;\n\n- (void)addExtraData:(NSDictionary *)data forIdentifier:(NSString *)identifier;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTRedBoxExtraDataViewController.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTRedBoxExtraDataViewController.h\"\n\n@interface RCTRedBoxExtraDataCell : NSTableCellView\n\n@property (nonatomic, strong) NSTextField *keyLabel;\n@property (nonatomic, strong) NSTextField *valueLabel;\n\n@end\n\n@implementation RCTRedBoxExtraDataCell\n\n- (instancetype)initWithStyle:(UITableViewCellStyle)style\n              reuseIdentifier:(NSString *)reuseIdentifier\n{\n    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {\n        self.backgroundColor = [NSColor colorWithRed:0.8\n                                               green:0 blue:0\n                                               alpha:1];\n       //  UILayoutGuide *contentLayout =  self.contentView.layoutMarginsGuide;\n\n        self.keyLabel = [NSTextField new];\n        [self.contentView addSubview:self.keyLabel];\n\n//        self.keyLabel.translatesAutoresizingMaskIntoConstraints = NO;\n//        [self.keyLabel.leadingAnchor\n//            constraintEqualToAnchor:contentLayout.leadingAnchor].active = YES;\n//        [self.keyLabel.topAnchor\n//            constraintEqualToAnchor:contentLayout.topAnchor].active = YES;\n//        [self.keyLabel.bottomAnchor\n//            constraintEqualToAnchor:contentLayout.bottomAnchor].active = YES;\n//        [self.keyLabel.widthAnchor\n//            constraintEqualToAnchor:contentLayout.widthAnchor\n//            multiplier:0.3].active = YES;\n\n\n        self.keyLabel.textColor = [UIColor whiteColor];\n        self.keyLabel.numberOfLines = 0;\n#if !TARGET_OS_TV\n        self.keyLabel.lineBreakMode = UILineBreakModeWordWrap;\n#endif\n        self.keyLabel.font = [UIFont fontWithName:@\"Menlo-Regular\" size:12.0f];\n\n        self.valueLabel = [UILabel new];\n        [self.contentView addSubview:self.valueLabel];\n\n        self.valueLabel.translatesAutoresizingMaskIntoConstraints = NO;\n        [self.valueLabel.leadingAnchor\n            constraintEqualToAnchor:self.keyLabel.trailingAnchor\n            constant:10.f].active = YES;\n        [self.valueLabel.trailingAnchor\n            constraintEqualToAnchor:contentLayout.trailingAnchor].active = YES;\n        [self.valueLabel.topAnchor\n            constraintEqualToAnchor:contentLayout.topAnchor].active = YES;\n        [self.valueLabel.bottomAnchor\n            constraintEqualToAnchor:contentLayout.bottomAnchor].active = YES;\n\n        self.valueLabel.textColor = [UIColor whiteColor];\n        self.valueLabel.numberOfLines = 0;\n#if !TARGET_OS_TV\n        self.valueLabel.lineBreakMode = UILineBreakModeWordWrap;\n#endif\n        self.valueLabel.font = [UIFont fontWithName:@\"Menlo-Regular\" size:12.0f];\n    }\n    return self;\n}\n\n@end\n\n@interface RCTRedBoxExtraDataViewController ()\n\n@end\n\n@implementation RCTRedBoxExtraDataViewController\n{\n    UITableView *_tableView;\n    NSMutableArray *_extraDataTitle;\n    NSMutableArray *_extraData;\n}\n\n@synthesize actionDelegate = _actionDelegate;\n\n- (instancetype)init\n{\n    if (self = [super init]) {\n        _extraData = [NSMutableArray new];\n        _extraDataTitle = [NSMutableArray new];\n        self.view.backgroundColor = [UIColor colorWithRed:0.8\n                                                    green:0\n                                                     blue:0\n                                                    alpha:1];\n\n        _tableView = [UITableView new];\n        _tableView.delegate = self;\n        _tableView.dataSource = self;\n        _tableView.backgroundColor = [UIColor clearColor];\n        _tableView.estimatedRowHeight = 200;\n#if !TARGET_OS_TV\n        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;\n#endif\n        _tableView.rowHeight = UITableViewAutomaticDimension;\n        _tableView.allowsSelection = NO;\n\n#if TARGET_OS_SIMULATOR\n        NSString *reloadText = @\"Reload JS (\\u2318R)\";\n        NSString *dismissText = @\"Dismiss (ESC)\";\n#else\n        NSString *reloadText = @\"Reload JS\";\n        NSString *dismissText = @\"Dismiss\";\n#endif\n\n        UIButton *dismissButton = [UIButton buttonWithType:UIButtonTypeCustom];\n        dismissButton.translatesAutoresizingMaskIntoConstraints = NO;\n        dismissButton.accessibilityIdentifier = @\"redbox-extra-data-dismiss\";\n        dismissButton.titleLabel.font = [UIFont systemFontOfSize:13];\n        [dismissButton setTitle:dismissText forState:UIControlStateNormal];\n        [dismissButton setTitleColor:[UIColor colorWithWhite:1 alpha:0.5]\n                            forState:UIControlStateNormal];\n        [dismissButton setTitleColor:[UIColor whiteColor]\n                            forState:UIControlStateHighlighted];\n        [dismissButton addTarget:self\n                          action:@selector(dismiss)\n                forControlEvents:UIControlEventTouchUpInside];\n\n        UIButton *reloadButton = [UIButton buttonWithType:UIButtonTypeCustom];\n        reloadButton.accessibilityIdentifier = @\"redbox-reload\";\n        reloadButton.titleLabel.font = [UIFont systemFontOfSize:13];\n        [reloadButton setTitle:reloadText forState:UIControlStateNormal];\n        [reloadButton setTitleColor:[UIColor colorWithWhite:1 alpha:0.5]\n                           forState:UIControlStateNormal];\n        [reloadButton setTitleColor:[UIColor whiteColor]\n                            forState:UIControlStateHighlighted];\n        [reloadButton addTarget:self\n                          action:@selector(reload)\n                forControlEvents:UIControlEventTouchUpInside];\n\n        UIStackView *buttonStackView = [UIStackView new];\n        buttonStackView.axis = UILayoutConstraintAxisHorizontal;\n        buttonStackView.distribution = UIStackViewDistributionEqualSpacing;\n        buttonStackView.alignment = UIStackViewAlignmentFill;\n        buttonStackView.spacing = 20;\n\n        [buttonStackView addArrangedSubview:dismissButton];\n        [buttonStackView addArrangedSubview:reloadButton];\n        buttonStackView.translatesAutoresizingMaskIntoConstraints = NO;\n\n        UIStackView *mainStackView = [UIStackView new];\n        mainStackView.axis = UILayoutConstraintAxisVertical;\n        mainStackView.backgroundColor = [UIColor colorWithRed:0.8\n                                                        green:0 blue:0\n                                                        alpha:1];\n        [mainStackView addArrangedSubview:_tableView];\n        [mainStackView addArrangedSubview:buttonStackView];\n        mainStackView.translatesAutoresizingMaskIntoConstraints = NO;\n\n        [self.view addSubview:mainStackView];\n\n        CGFloat tableHeight = self.view.bounds.size.height - 60.f;\n        [_tableView.heightAnchor constraintEqualToConstant:tableHeight].active = YES;\n        [_tableView.widthAnchor constraintEqualToAnchor:self.view.widthAnchor].active = YES;\n\n        CGFloat buttonWidth = self.view.bounds.size.width / 4;\n        [dismissButton.heightAnchor constraintEqualToConstant:60].active = YES;\n        [dismissButton.widthAnchor\n            constraintEqualToConstant:buttonWidth].active = YES;\n        [reloadButton.heightAnchor constraintEqualToConstant:60].active = YES;\n        [reloadButton.widthAnchor\n            constraintEqualToConstant:buttonWidth].active = YES;\n    }\n    return self;\n}\n\n- (void)viewDidAppear:(BOOL)animated\n{\n    [super viewDidAppear:animated];\n    [_tableView reloadData];\n}\n\n- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section\n{\n    return [[_extraData objectAtIndex:section] count];\n}\n\n- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section\n{\n    return 40;\n}\n\n- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section\n{\n    UIView *view = [UIView new];\n    view.backgroundColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];\n\n    UILabel *header = [UILabel new];\n    [view addSubview:header];\n\n    header.translatesAutoresizingMaskIntoConstraints = NO;\n    [header.leadingAnchor\n        constraintEqualToAnchor:view.leadingAnchor constant:5].active = YES;\n    [header.trailingAnchor\n        constraintEqualToAnchor:view.trailingAnchor].active = YES;\n    [header.topAnchor\n        constraintEqualToAnchor:view.topAnchor].active = YES;\n    [header.bottomAnchor\n        constraintEqualToAnchor:view.bottomAnchor].active = YES;\n\n    header.textColor = [UIColor whiteColor];\n    header.font = [UIFont fontWithName:@\"Menlo-Bold\" size:14.0f];\n    header.text = [_extraDataTitle[section] uppercaseString];\n\n    return view;\n}\n\n- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath\n{\n    static NSString *reuseIdentifier = @\"RedBoxExtraData\";\n\n    RCTRedBoxExtraDataCell *cell =\n            (RCTRedBoxExtraDataCell *)[tableView\n            dequeueReusableCellWithIdentifier:reuseIdentifier];\n\n    if (cell == nil) {\n        cell = [[RCTRedBoxExtraDataCell alloc]\n                initWithStyle:UITableViewCellStyleDefault\n                reuseIdentifier:reuseIdentifier];\n    }\n\n    NSArray *dataKVPair = _extraData[indexPath.section][indexPath.row];\n    cell.keyLabel.text = dataKVPair[0];\n    cell.valueLabel.text = dataKVPair[1];\n\n    return cell;\n}\n\n- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView\n{\n    return _extraDataTitle.count;\n}\n\n- (void)addExtraData:(NSDictionary *)data forIdentifier:(NSString *)identifier\n{\n    dispatch_async(dispatch_get_main_queue(), ^{\n        NSMutableArray *newData = [NSMutableArray new];\n        for (id key in data) {\n            [newData addObject:@[[NSString stringWithFormat:@\"%@\", key],\n                [NSString stringWithFormat:@\"%@\", [data objectForKey:key]]]];\n        }\n\n        NSInteger idx = [self->_extraDataTitle indexOfObject:identifier];\n        if (idx == NSNotFound) {\n            [self->_extraDataTitle addObject:identifier];\n            [self->_extraData addObject:newData];\n        } else {\n            [self->_extraData replaceObjectAtIndex:idx withObject:newData];\n        }\n\n        [self->_tableView reloadData];\n    });\n}\n\n- (void)dismiss\n{\n    [self dismissViewControllerAnimated:YES completion:nil];\n}\n\n- (void)reload\n{\n    [_actionDelegate reload];\n}\n\n#pragma mark - Key commands\n\n- (NSArray<UIKeyCommand *> *)keyCommands\n{\n    return @[\n             // Dismiss\n             [UIKeyCommand keyCommandWithInput:UIKeyInputEscape\n                                 modifierFlags:0\n                                        action:@selector(dismiss)],\n             // Reload\n             [UIKeyCommand keyCommandWithInput:@\"r\"\n                                 modifierFlags:UIKeyModifierCommand\n                                        action:@selector(reload)]\n    ];\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTSourceCode.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridgeModule.h>\n\n@interface RCTSourceCode : NSObject <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTSourceCode.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSourceCode.h\"\n\n#import \"RCTBridge.h\"\n\n@implementation RCTSourceCode\n\nRCT_EXPORT_MODULE()\n\n@synthesize bridge = _bridge;\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return NO;\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  return @{\n    @\"scriptURL\": self.bridge.bundleURL.absoluteString ?: @\"\",\n  };\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTStatusBarManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTConvert.h>\n#import <React/RCTEventEmitter.h>\n\n@interface RCTConvert (UIStatusBar)\n\n#if !TARGET_OS_TV\n+ (UIStatusBarStyle)UIStatusBarStyle:(id)json;\n+ (UIStatusBarAnimation)UIStatusBarAnimation:(id)json;\n#endif\n\n@end\n\n@interface RCTStatusBarManager : RCTEventEmitter\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTStatusBarManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTStatusBarManager.h\"\n\n#import \"RCTEventDispatcher.h\"\n#import \"RCTLog.h\"\n#import \"RCTUtils.h\"\n\n#@implementation RCTStatusBarManager\n\nstatic BOOL RCTViewControllerBasedStatusBarAppearance()\n{\n  static BOOL value;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    value = [[[NSBundle mainBundle] objectForInfoDictionaryKey:\n              @\"UIViewControllerBasedStatusBarAppearance\"] ?: @YES boolValue];\n  });\n\n  return value;\n}\n\nRCT_EXPORT_MODULE()\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[@\"statusBarFrameDidChange\",\n           @\"statusBarFrameWillChange\"];\n}\n\n#if !TARGET_OS_TV\n\n- (void)startObserving\n{\n  NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];\n  [nc addObserver:self selector:@selector(applicationDidChangeStatusBarFrame:) name:UIApplicationDidChangeStatusBarFrameNotification object:nil];\n  [nc addObserver:self selector:@selector(applicationWillChangeStatusBarFrame:) name:UIApplicationWillChangeStatusBarFrameNotification object:nil];\n}\n\n- (void)stopObserving\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n- (void)emitEvent:(NSString *)eventName forNotification:(NSNotification *)notification\n{\n  CGRect frame = [notification.userInfo[UIApplicationStatusBarFrameUserInfoKey] CGRectValue];\n  NSDictionary *event = @{\n    @\"frame\": @{\n      @\"x\": @(frame.origin.x),\n      @\"y\": @(frame.origin.y),\n      @\"width\": @(frame.size.width),\n      @\"height\": @(frame.size.height),\n    },\n  };\n  [self sendEventWithName:eventName body:event];\n}\n\n- (void)applicationDidChangeStatusBarFrame:(NSNotification *)notification\n{\n  [self emitEvent:@\"statusBarFrameDidChange\" forNotification:notification];\n}\n\n- (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification\n{\n  [self emitEvent:@\"statusBarFrameWillChange\" forNotification:notification];\n}\n\nRCT_EXPORT_METHOD(getHeight:(RCTResponseSenderBlock)callback)\n{\n  callback(@[@{\n    @\"height\": @(RCTSharedApplication().statusBarFrame.size.height),\n  }]);\n}\n\nRCT_EXPORT_METHOD(setStyle:(UIStatusBarStyle)statusBarStyle\n                  animated:(BOOL)animated)\n{\n  if (RCTViewControllerBasedStatusBarAppearance()) {\n    RCTLogError(@\"RCTStatusBarManager module requires that the \\\n                UIViewControllerBasedStatusBarAppearance key in the Info.plist is set to NO\");\n  } else {\n    [RCTSharedApplication() setStatusBarStyle:statusBarStyle\n                                     animated:animated];\n  }\n}\n\nRCT_EXPORT_METHOD(setHidden:(BOOL)hidden\n                  withAnimation:(UIStatusBarAnimation)animation)\n{\n  if (RCTViewControllerBasedStatusBarAppearance()) {\n    RCTLogError(@\"RCTStatusBarManager module requires that the \\\n                UIViewControllerBasedStatusBarAppearance key in the Info.plist is set to NO\");\n  } else {\n    [RCTSharedApplication() setStatusBarHidden:hidden\n                                 withAnimation:animation];\n  }\n}\n\nRCT_EXPORT_METHOD(setNetworkActivityIndicatorVisible:(BOOL)visible)\n{\n  RCTSharedApplication().networkActivityIndicatorVisible = visible;\n}\n\n#endif //TARGET_OS_TV\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTTVNavigationEventEmitter.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTEventEmitter.h\"\n\nRCT_EXTERN NSString *const RCTTVNavigationEventNotification;\n\n@interface RCTTVNavigationEventEmitter : RCTEventEmitter\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTTVNavigationEventEmitter.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTVNavigationEventEmitter.h\"\n\nNSString *const RCTTVNavigationEventNotification = @\"RCTTVNavigationEventNotification\";\n\nstatic NSString *const TVNavigationEventName = @\"onTVNavEvent\";\n\n@implementation RCTTVNavigationEventEmitter\n\nRCT_EXPORT_MODULE()\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return NO;\n}\n\n- (instancetype)init\n{\n  if (self = [super init]) {\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(handleTVNavigationEventNotification:)\n                                                 name:RCTTVNavigationEventNotification\n                                               object:nil];\n\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[TVNavigationEventName];\n}\n\n- (void)handleTVNavigationEventNotification:(NSNotification *)notif\n{\n  [self sendEventWithName:TVNavigationEventName body:notif.object];\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTTiming.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTFrameUpdate.h>\n#import <React/RCTInvalidating.h>\n\n@interface RCTTiming : NSObject <RCTBridgeModule, RCTInvalidating, RCTFrameUpdateObserver>\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTTiming.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTiming.h\"\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge+Private.h\"\n#import \"RCTBridge.h\"\n#import \"RCTLog.h\"\n#import \"RCTUtils.h\"\n\nstatic const NSTimeInterval kMinimumSleepInterval = 1;\n\n// These timing contants should be kept in sync with the ones in `JSTimers.js`.\n// The duration of a frame. This assumes that we want to run at 60 fps.\nstatic const NSTimeInterval kFrameDuration = 1.0 / 60.0;\n// The minimum time left in a frame to trigger the idle callback.\nstatic const NSTimeInterval kIdleCallbackFrameDeadline = 0.001;\n\n@interface _RCTTimer : NSObject\n\n@property (nonatomic, strong, readonly) NSDate *target;\n@property (nonatomic, assign, readonly) BOOL repeats;\n@property (nonatomic, copy, readonly) NSNumber *callbackID;\n@property (nonatomic, assign, readonly) NSTimeInterval interval;\n\n@end\n\n@implementation _RCTTimer\n\n- (instancetype)initWithCallbackID:(NSNumber *)callbackID\n                          interval:(NSTimeInterval)interval\n                        targetTime:(NSTimeInterval)targetTime\n                           repeats:(BOOL)repeats\n{\n  if ((self = [super init])) {\n    _interval = interval;\n    _repeats = repeats;\n    _callbackID = callbackID;\n    _target = [NSDate dateWithTimeIntervalSinceNow:targetTime];\n  }\n  return self;\n}\n\n/**\n * Returns `YES` if we should invoke the JS callback.\n */\n- (BOOL)shouldFire:(NSDate *)now\n{\n  if (_target && [_target timeIntervalSinceDate:now] <= 0) {\n    return YES;\n  }\n  return NO;\n}\n\n- (void)reschedule\n{\n  // The JS Timers will do fine grained calculating of expired timeouts.\n  _target = [NSDate dateWithTimeIntervalSinceNow:_interval];\n}\n\n@end\n\n@interface _RCTTimingProxy : NSObject\n\n@end\n\n// NSTimer retains its target, insert this class to break potential retain cycles\n@implementation _RCTTimingProxy\n{\n  __weak id _target;\n}\n\n+ (instancetype)proxyWithTarget:(id)target\n{\n  _RCTTimingProxy *proxy = [self new];\n  if (proxy) {\n    proxy->_target = target;\n  }\n  return proxy;\n}\n\n- (void)timerDidFire\n{\n  [_target timerDidFire];\n}\n\n@end\n\n@implementation RCTTiming\n{\n  NSMutableDictionary<NSNumber *, _RCTTimer *> *_timers;\n  NSTimer *_sleepTimer;\n  BOOL _sendIdleEvents;\n}\n\n@synthesize bridge = _bridge;\n@synthesize paused = _paused;\n@synthesize pauseCallback = _pauseCallback;\n\nRCT_EXPORT_MODULE()\n\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  RCTAssert(!_bridge, @\"Should never be initialized twice!\");\n\n  _paused = YES;\n  _timers = [NSMutableDictionary new];\n\n  for (NSString *name in @[NSApplicationDidResignActiveNotification,\n                             NSApplicationWillTerminateNotification]) {\n\n      [[NSNotificationCenter defaultCenter] addObserver:self\n                                               selector:@selector(stopTimers)\n                                                   name:name\n                                                 object:nil];\n  }\n\n  for (NSString *name in @[NSApplicationDidBecomeActiveNotification]) {\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(startTimers)\n                                                 name:name\n                                               object:nil];\n  }\n\n  _bridge = bridge;\n}\n\n- (void)dealloc\n{\n  [_sleepTimer invalidate];\n  [[NSNotificationCenter defaultCenter] removeObserver:self];\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  return RCTJSThread;\n}\n\n- (void)invalidate\n{\n  [self stopTimers];\n  _bridge = nil;\n}\n\n- (void)stopTimers\n{\n  if (!_paused) {\n    _paused = YES;\n    if (_pauseCallback) {\n      _pauseCallback();\n    }\n  }\n}\n\n- (void)startTimers\n{\n  if (!_bridge || ![self hasPendingTimers]) {\n    return;\n  }\n\n  if (_paused) {\n    _paused = NO;\n    if (_pauseCallback) {\n      _pauseCallback();\n    }\n  }\n}\n\n- (BOOL)hasPendingTimers\n{\n  return _sendIdleEvents || _timers.count > 0;\n}\n\n- (void)didUpdateFrame:(RCTFrameUpdate *)update\n{\n  NSDate *nextScheduledTarget = [NSDate distantFuture];\n  NSMutableArray<_RCTTimer *> *timersToCall = [NSMutableArray new];\n  NSDate *now = [NSDate date]; // compare all the timers to the same base time\n  for (_RCTTimer *timer in _timers.allValues) {\n    if ([timer shouldFire:now]) {\n      [timersToCall addObject:timer];\n    } else {\n      nextScheduledTarget = [nextScheduledTarget earlierDate:timer.target];\n    }\n  }\n\n  // Call timers that need to be called\n  if (timersToCall.count > 0) {\n    NSArray<NSNumber *> *sortedTimers = [[timersToCall sortedArrayUsingComparator:^(_RCTTimer *a, _RCTTimer *b) {\n      return [a.target compare:b.target];\n    }] valueForKey:@\"callbackID\"];\n    [_bridge enqueueJSCall:@\"JSTimers\"\n                    method:@\"callTimers\"\n                      args:@[sortedTimers]\n                completion:NULL];\n  }\n\n  for (_RCTTimer *timer in timersToCall) {\n    if (timer.repeats) {\n      [timer reschedule];\n      nextScheduledTarget = [nextScheduledTarget earlierDate:timer.target];\n    } else {\n      [_timers removeObjectForKey:timer.callbackID];\n    }\n  }\n\n  if (_sendIdleEvents) {\n    NSTimeInterval frameElapsed = (CACurrentMediaTime() - update.timestamp);\n    if (kFrameDuration - frameElapsed >= kIdleCallbackFrameDeadline) {\n      NSTimeInterval currentTimestamp = [[NSDate date] timeIntervalSince1970];\n      NSNumber *absoluteFrameStartMS = @((currentTimestamp - frameElapsed) * 1000);\n      [_bridge enqueueJSCall:@\"JSTimers\"\n                      method:@\"callIdleCallbacks\"\n                        args:@[absoluteFrameStartMS]\n                  completion:NULL];\n    }\n  }\n\n  // Switch to a paused state only if we didn't call any timer this frame, so if\n  // in response to this timer another timer is scheduled, we don't pause and unpause\n  // the displaylink frivolously.\n  if (!_sendIdleEvents && timersToCall.count == 0) {\n    // No need to call the pauseCallback as RCTDisplayLink will ask us about our paused\n    // status immediately after completing this call\n    if (_timers.count == 0) {\n      _paused = YES;\n    }\n    // If the next timer is more than 1 second out, pause and schedule an NSTimer;\n    else if ([nextScheduledTarget timeIntervalSinceNow] > kMinimumSleepInterval) {\n      [self scheduleSleepTimer:nextScheduledTarget];\n      _paused = YES;\n    }\n  }\n}\n\n- (void)scheduleSleepTimer:(NSDate *)sleepTarget\n{\n  if (!_sleepTimer || !_sleepTimer.valid) {\n    _sleepTimer = [[NSTimer alloc] initWithFireDate:sleepTarget\n                                           interval:0\n                                             target:[_RCTTimingProxy proxyWithTarget:self]\n                                           selector:@selector(timerDidFire)\n                                           userInfo:nil\n                                            repeats:NO];\n    [[NSRunLoop currentRunLoop] addTimer:_sleepTimer forMode:NSDefaultRunLoopMode];\n  } else {\n    _sleepTimer.fireDate = [_sleepTimer.fireDate earlierDate:sleepTarget];\n  }\n}\n\n- (void)timerDidFire\n{\n  _sleepTimer = nil;\n  if (_paused) {\n    [self startTimers];\n\n    // Immediately dispatch frame, so we don't have to wait on the displaylink.\n    [self didUpdateFrame:nil];\n  }\n}\n\n/**\n * There's a small difference between the time when we call\n * setTimeout/setInterval/requestAnimation frame and the time it actually makes\n * it here. This is important and needs to be taken into account when\n * calculating the timer's target time. We calculate this by passing in\n * Date.now() from JS and then subtracting that from the current time here.\n */\nRCT_EXPORT_METHOD(createTimer:(nonnull NSNumber *)callbackID\n                  duration:(NSTimeInterval)jsDuration\n                  jsSchedulingTime:(NSDate *)jsSchedulingTime\n                  repeats:(BOOL)repeats)\n{\n  if (jsDuration == 0 && repeats == NO) {\n    // For super fast, one-off timers, just enqueue them immediately rather than waiting a frame.\n    [_bridge _immediatelyCallTimer:callbackID];\n    return;\n  }\n\n  NSTimeInterval jsSchedulingOverhead = MAX(-jsSchedulingTime.timeIntervalSinceNow, 0);\n\n  NSTimeInterval targetTime = jsDuration - jsSchedulingOverhead;\n  if (jsDuration < 0.018) { // Make sure short intervals run each frame\n    jsDuration = 0;\n  }\n\n  _RCTTimer *timer = [[_RCTTimer alloc] initWithCallbackID:callbackID\n                                                  interval:jsDuration\n                                                targetTime:targetTime\n                                                   repeats:repeats];\n  _timers[callbackID] = timer;\n  if (_paused) {\n    if ([timer.target timeIntervalSinceNow] > kMinimumSleepInterval) {\n      [self scheduleSleepTimer:timer.target];\n    } else {\n      [self startTimers];\n    }\n  }\n}\n\nRCT_EXPORT_METHOD(deleteTimer:(nonnull NSNumber *)timerID)\n{\n  [_timers removeObjectForKey:timerID];\n  if (![self hasPendingTimers]) {\n    [self stopTimers];\n  }\n}\n\nRCT_EXPORT_METHOD(setSendIdleEvents:(BOOL)sendIdleEvents)\n{\n  _sendIdleEvents = sendIdleEvents;\n  if (sendIdleEvents) {\n    [self startTimers];\n  } else if (![self hasPendingTimers]) {\n    [self stopTimers];\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTUIManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBridge.h>\n#import <React/RCTBridgeModule.h>\n#import <React/RCTInvalidating.h>\n#import <React/RCTRootView.h>\n#import <React/RCTViewManager.h>\n\n/**\n * Posted right before re-render happens. This is a chance for views to invalidate their state so\n * next render cycle will pick up updated views and layout appropriately.\n */\nRCT_EXTERN NSString *const RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification;\n\n@class RCTLayoutAnimationGroup;\n@class RCTUIManagerObserverCoordinator;\n\n/**\n * The RCTUIManager is the module responsible for updating the view hierarchy.\n */\n@interface RCTUIManager : NSObject <RCTBridgeModule, RCTInvalidating>\n\n/**\n * Register a root view tag and creates corresponding `rootView` and\n * `rootShadowView`.\n */\n- (void)registerRootViewTag:(NSNumber *)rootTag;\n\n/**\n * Register a root view with the RCTUIManager.\n */\n- (void)registerRootView:(NSView *)rootView;\n\n/**\n * Gets the view name associated with a reactTag.\n */\n- (NSString *)viewNameForReactTag:(NSNumber *)reactTag;\n\n/**\n * Gets the view associated with a reactTag.\n */\n- (NSView *)viewForReactTag:(NSNumber *)reactTag;\n\n/**\n * Gets the shadow view associated with a reactTag.\n */\n- (RCTShadowView *)shadowViewForReactTag:(NSNumber *)reactTag;\n\n/**\n * Set the available size (`availableSize` property) for a root view.\n * This might be used in response to changes in external layout constraints.\n * This value will be directly trasmitted to layout engine and defines how big viewport is;\n * this value does not affect root node size style properties.\n * Can be considered as something similar to `setSize:forView:` but applicable only for root view.\n */\n- (void)setAvailableSize:(CGSize)availableSize forRootView:(NSView *)rootView;\n\n/**\n * Sets local data for a shadow view corresponded with given view.\n * In some cases we need a way to specify some environmental data to shadow view\n * to improve layout (or do something similar), so `localData` serves these needs.\n * For example, any stateful embedded native views may benefit from this.\n * Have in mind that this data is not supposed to interfere with the state of\n * the shadow view.\n * Please respect one-directional data flow of React.\n */\n- (void)setLocalData:(NSObject *)localData forView:(NSView *)view;\n\n/**\n * Set the size of a view. This might be in response to a screen rotation\n * or some other layout event outside of the React-managed view hierarchy.\n */\n- (void)setSize:(CGSize)size forView:(NSView *)view;\n\n/**\n * Set the natural size of a view, which is used when no explicit size is set.\n * Use `UIViewNoIntrinsicMetric` to ignore a dimension.\n * The `size` must NOT include padding and border.\n */\n- (void)setIntrinsicContentSize:(CGSize)intrinsicContentSize forView:(NSView *)view;\n\n/**\n * Sets up layout animation which will perform on next layout pass.\n * The animation will affect only one next layout pass.\n * Must be called on the main queue.\n */\n- (void)setNextLayoutAnimationGroup:(RCTLayoutAnimationGroup *)layoutAnimationGroup;\n\n/**\n * Schedule a block to be executed on the UI thread. Useful if you need to execute\n * view logic after all currently queued view updates have completed.\n */\n- (void)addUIBlock:(RCTViewManagerUIBlock)block;\n\n/**\n * Schedule a block to be executed on the UI thread. Useful if you need to execute\n * view logic before all currently queued view updates have completed.\n */\n- (void)prependUIBlock:(RCTViewManagerUIBlock)block;\n\n/**\n * Used by native animated module to bypass the process of updating the values through the shadow\n * view hierarchy. This method will directly update native views, which means that updates for\n * layout-related propertied won't be handled properly.\n * Make sure you know what you're doing before calling this method :)\n */\n- (void)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag\n                                 viewName:(NSString *)viewName\n                                    props:(NSDictionary *)props;\n\n/**\n * Given a reactTag from a component, find its root view, if possible.\n * Otherwise, this will give back nil.\n *\n * @param reactTag the component tag\n * @param completion the completion block that will hand over the rootView, if any.\n *\n */\n- (void)rootViewForReactTag:(NSNumber *)reactTag withCompletion:(void (^)(NSView *view))completion;\n\n/**\n * Finds a view that is tagged with nativeID as its nativeID prop\n * with the associated rootTag root tag view hierarchy. Returns the\n * view if found, nil otherwise.\n *\n * @param nativeID the id reference to native component relative to root view.\n * @param rootTag the react tag of root view hierarchy from which to find the view.\n */\n- (NSView *)viewForNativeID:(NSString *)nativeID withRootTag:(NSNumber *)rootTag;\n\n/**\n * The view that is currently first responder, according to the JS context.\n */\n+ (NSView *)JSResponder;\n\n/**\n * In some cases we might want to trigger layout from native side.\n * React won't be aware of this, so we need to make sure it happens.\n */\n- (void)setNeedsLayout;\n\n/**\n * Dedicated object for subscribing for UIManager events.\n * See `RCTUIManagerObserver` protocol for more details.\n */\n@property (atomic, retain, readonly) RCTUIManagerObserverCoordinator *observerCoordinator;\n\n@end\n\n/**\n * This category makes the current RCTUIManager instance available via the\n * RCTBridge, which is useful for RCTBridgeModules or RCTViewManagers that\n * need to access the RCTUIManager.\n */\n@interface RCTBridge (RCTUIManager)\n\n@property (nonatomic, readonly) RCTUIManager *uiManager;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTUIManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTUIManager.h\"\n\n#import <AVFoundation/AVFoundation.h>\n#import <Foundation/Foundation.h>\n\n#import \"RCTAccessibilityManager.h\"\n#import \"RCTAssert.h\"\n#import \"RCTBridge+Private.h\"\n#import \"RCTBridge.h\"\n#import \"RCTComponent.h\"\n#import \"RCTComponentData.h\"\n#import \"RCTConvert.h\"\n#import \"RCTDefines.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTLayoutAnimation.h\"\n#import \"RCTLayoutAnimationGroup.h\"\n#import \"RCTLog.h\"\n#import \"RCTModuleData.h\"\n#import \"RCTModuleMethod.h\"\n#import \"RCTProfile.h\"\n#import \"RCTRootContentView.h\"\n#import \"RCTRootShadowView.h\"\n#import \"RCTRootViewInternal.h\"\n#import \"RCTScrollableProtocol.h\"\n#import \"RCTShadowView+Internal.h\"\n#import \"RCTShadowView.h\"\n#import \"RCTSurfaceRootShadowView.h\"\n#import \"RCTSurfaceRootView.h\"\n#import \"RCTUIManagerObserverCoordinator.h\"\n#import \"RCTUIManagerUtils.h\"\n#import \"RCTUtils.h\"\n#import \"RCTView.h\"\n#import \"RCTViewManager.h\"\n#import \"NSView+React.h\"\n#import \"NSView+NSViewAnimationWithBlocks.h\"\n#import \"UIImageUtils.h\"\n\nstatic void RCTTraverseViewNodes(id<RCTComponent> view, void (^block)(id<RCTComponent>))\n{\n  if (view.reactTag) {\n    block(view);\n\n    for (id<RCTComponent> subview in view.reactSubviews) {\n      RCTTraverseViewNodes(subview, block);\n    }\n  }\n}\n\nNSString *const RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification = @\"RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification\";\n\n@implementation RCTUIManager\n{\n  // Root views are only mutated on the shadow queue\n  NSMutableSet<NSNumber *> *_rootViewTags;\n  NSMutableArray<RCTViewManagerUIBlock> *_pendingUIBlocks;\n\n  // Animation\n  RCTLayoutAnimationGroup *_layoutAnimationGroup; // Main thread only\n\n  NSMutableDictionary<NSNumber *, RCTShadowView *> *_shadowViewRegistry; // RCT thread only\n  NSMutableDictionary<NSNumber *, NSView *> *_viewRegistry; // Main thread only\n\n  NSMapTable<RCTShadowView *, NSArray<NSString *> *> *_shadowViewsWithUpdatedProps; // UIManager queue only.\n  NSHashTable<RCTShadowView *> *_shadowViewsWithUpdatedChildren; // UIManager queue only.\n\n  // Keyed by viewName\n  NSDictionary *_componentDataByName;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return NO;\n}\n\n- (void)dealloc\n{\n  [NSNotificationCenter.defaultCenter removeObserver:self];\n}\n\n- (void)invalidate\n{\n  /**\n   * Called on the JS Thread since all modules are invalidated on the JS thread\n   */\n\n  // This only accessed from the shadow queue\n  _pendingUIBlocks = nil;\n\n  RCTExecuteOnMainQueue(^{\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"UIManager invalidate\", nil);\n    for (NSNumber *rootViewTag in self->_rootViewTags) {\n      NSView *rootView = self->_viewRegistry[rootViewTag];\n      if ([rootView conformsToProtocol:@protocol(RCTInvalidating)]) {\n        [(id<RCTInvalidating>)rootView invalidate];\n      }\n    }\n\n    self->_rootViewTags = nil;\n    self->_shadowViewRegistry = nil;\n    self->_viewRegistry = nil;\n    self->_bridge = nil;\n\n    [[NSNotificationCenter defaultCenter] removeObserver:self];\n    RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n  });\n}\n\n- (NSMutableDictionary<NSNumber *, RCTShadowView *> *)shadowViewRegistry\n{\n  // NOTE: this method only exists so that it can be accessed by unit tests\n  if (!_shadowViewRegistry) {\n    _shadowViewRegistry = [NSMutableDictionary new];\n  }\n  return _shadowViewRegistry;\n}\n\n- (NSMutableDictionary<NSNumber *, NSView *> *)viewRegistry\n{\n  // NOTE: this method only exists so that it can be accessed by unit tests\n  if (!_viewRegistry) {\n    _viewRegistry = [NSMutableDictionary new];\n  }\n  return _viewRegistry;\n}\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  RCTAssert(_bridge == nil, @\"Should not re-use same UIIManager instance\");\n  _bridge = bridge;\n\n  _shadowViewRegistry = [NSMutableDictionary new];\n  _viewRegistry = [NSMutableDictionary new];\n\n  _shadowViewsWithUpdatedProps = [NSMapTable weakToStrongObjectsMapTable];\n  _shadowViewsWithUpdatedChildren = [NSHashTable weakObjectsHashTable];\n\n  // Internal resources\n  _pendingUIBlocks = [NSMutableArray new];\n  _rootViewTags = [NSMutableSet new];\n\n  _observerCoordinator = [RCTUIManagerObserverCoordinator new];\n\n  // Get view managers from bridge\n  NSMutableDictionary *componentDataByName = [NSMutableDictionary new];\n  for (Class moduleClass in _bridge.moduleClasses) {\n    if ([moduleClass isSubclassOfClass:[RCTViewManager class]]) {\n      RCTComponentData *componentData = [[RCTComponentData alloc] initWithManagerClass:moduleClass\n                                                                                bridge:_bridge];\n      componentDataByName[componentData.name] = componentData;\n    }\n  }\n\n  _componentDataByName = [componentDataByName copy];\n\n  [RCTLayoutAnimation initializeStatics];\n}\n\n#pragma mark - Event emitting\n\n- (void)didReceiveNewContentSizeMultiplier\n{\n  // Report the event across the bridge.\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n  [_bridge.eventDispatcher sendDeviceEventWithName:@\"didUpdateContentSizeMultiplier\"\n                                              body:@([_bridge.accessibilityManager multiplier])];\n#pragma clang diagnostic pop\n\n  RCTExecuteOnUIManagerQueue(^{\n    [[NSNotificationCenter defaultCenter] postNotificationName:RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification\n                                                        object:self];\n    [self setNeedsLayout];\n  });\n}\n\n#if !TARGET_OS_TV\n// Names and coordinate system from html5 spec:\n// https://developer.mozilla.org/en-US/docs/Web/API/Screen.orientation\n// https://developer.mozilla.org/en-US/docs/Web/API/Screen.lockOrientation\nstatic NSDictionary *deviceOrientationEventBody()\n{\n  NSString *name;\n  NSNumber *degrees = @0;\n  BOOL isLandscape = NO;\n//  switch(orientation) {\n//    case UIDeviceOrientationPortrait:\n//      name = @\"portrait-primary\";\n//      break;\n//    case UIDeviceOrientationPortraitUpsideDown:\n//      name = @\"portrait-secondary\";\n//      degrees = @180;\n//      break;\n//    case UIDeviceOrientationLandscapeRight:\n//      name = @\"landscape-primary\";\n//      degrees = @-90;\n//      isLandscape = YES;\n//      break;\n//    case UIDeviceOrientationLandscapeLeft:\n//      name = @\"landscape-secondary\";\n//      degrees = @90;\n//      isLandscape = YES;\n//      break;\n//    case UIDeviceOrientationFaceDown:\n//    case UIDeviceOrientationFaceUp:\n//    case UIDeviceOrientationUnknown:\n//      // Unsupported\n//      return nil;\n//  }\n  return @{\n    @\"name\": @\"portrait-primary\",\n    @\"rotationDegrees\": degrees,\n    @\"isLandscape\": @(isLandscape),\n  };\n}\n\n- (void)namedOrientationDidChange\n{\n//  NSDictionary *orientationEvent = deviceOrientationEventBody([UIDevice currentDevice].orientation);\n//  if (!orientationEvent) {\n//    return;\n//  }\n//\n//#pragma clang diagnostic push\n//#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n//  [_bridge.eventDispatcher sendDeviceEventWithName:@\"namedOrientationDidChange\"\n//                                              body:orientationEvent];\n//#pragma clang diagnostic pop\n}\n#endif\n\n- (dispatch_queue_t)methodQueue\n{\n  return RCTGetUIManagerQueue();\n}\n\n- (void)registerRootViewTag:(NSNumber *)rootTag\n{\n  RCTAssertUIManagerQueue();\n\n  RCTAssert(RCTIsReactRootView(rootTag),\n    @\"Attempt to register rootTag (%@) which is not actually root tag.\", rootTag);\n\n  RCTAssert(![_rootViewTags containsObject:rootTag],\n    @\"Attempt to register rootTag (%@) which was already registred.\", rootTag);\n\n  [_rootViewTags addObject:rootTag];\n\n  // Registering root shadow view\n  RCTSurfaceRootShadowView *shadowView = [RCTSurfaceRootShadowView new];\n  shadowView.reactTag = rootTag;\n  _shadowViewRegistry[rootTag] = shadowView;\n\n  // Registering root view\n  RCTExecuteOnMainQueue(^{\n    RCTSurfaceRootView *rootView = [RCTSurfaceRootView new];\n    rootView.reactTag = rootTag;\n    self->_viewRegistry[rootTag] = rootView;\n  });\n}\n\n- (void)registerRootView:(RCTRootContentView *)rootView\n{\n  RCTAssertMainQueue();\n\n  NSNumber *reactTag = rootView.reactTag;\n  RCTAssert(RCTIsReactRootView(reactTag),\n            @\"View %@ with tag #%@ is not a root view\", rootView, reactTag);\n\n  NSView *existingView = _viewRegistry[reactTag];\n  RCTAssert(existingView == nil || existingView == rootView,\n            @\"Expect all root views to have unique tag. Added %@ twice\", reactTag);\n\n  CGSize availableSize = rootView.availableSize;\n\n  // Register view\n  _viewRegistry[reactTag] = rootView;\n\n  // Register shadow view\n  RCTExecuteOnUIManagerQueue(^{\n    if (!self->_viewRegistry) {\n      return;\n    }\n\n    RCTRootShadowView *shadowView = [RCTRootShadowView new];\n    shadowView.availableSize = availableSize;\n    shadowView.reactTag = reactTag;\n    shadowView.viewName = NSStringFromClass([rootView class]);\n    self->_shadowViewRegistry[shadowView.reactTag] = shadowView;\n    [self->_rootViewTags addObject:reactTag];\n  });\n}\n\n- (NSString *)viewNameForReactTag:(NSNumber *)reactTag\n{\n  RCTAssertUIManagerQueue();\n  return _shadowViewRegistry[reactTag].viewName;\n}\n\n- (NSView *)viewForReactTag:(NSNumber *)reactTag\n{\n  RCTAssertMainQueue();\n  return _viewRegistry[reactTag];\n}\n\n- (RCTShadowView *)shadowViewForReactTag:(NSNumber *)reactTag\n{\n  RCTAssertUIManagerQueue();\n  return _shadowViewRegistry[reactTag];\n}\n\n- (void)_executeBlockWithShadowView:(void (^)(RCTShadowView *shadowView))block forTag:(NSNumber *)tag\n{\n  RCTAssertMainQueue();\n\n  RCTExecuteOnUIManagerQueue(^{\n    RCTShadowView *shadowView = self->_shadowViewRegistry[tag];\n\n    if (shadowView == nil) {\n      RCTLogInfo(@\"Could not locate shadow view with tag #%@, this is probably caused by a temporary inconsistency between native views and shadow views.\", tag);\n      return;\n    }\n\n    block(shadowView);\n  });\n}\n\n- (void)setAvailableSize:(CGSize)availableSize forRootView:(NSView *)rootView\n{\n  RCTAssertMainQueue();\n  [self _executeBlockWithShadowView:^(RCTShadowView *shadowView) {\n    RCTAssert([shadowView isKindOfClass:[RCTRootShadowView class]], @\"Located shadow view is actually not root view.\");\n\n    RCTRootShadowView *rootShadowView = (RCTRootShadowView *)shadowView;\n\n    if (CGSizeEqualToSize(availableSize, rootShadowView.availableSize)) {\n      return;\n    }\n\n    rootShadowView.availableSize = availableSize;\n    [self setNeedsLayout];\n  } forTag:rootView.reactTag];\n}\n\n- (void)setLocalData:(NSObject *)localData forView:(NSView *)view\n{\n  RCTAssertMainQueue();\n  [self _executeBlockWithShadowView:^(RCTShadowView *shadowView) {\n    shadowView.localData = localData;\n    [self setNeedsLayout];\n  } forTag:view.reactTag];\n}\n\n/**\n * TODO(yuwang): implement the nativeID functionality in a more efficient way\n *               instead of searching the whole view tree\n */\n- (NSView *)viewForNativeID:(NSString *)nativeID withRootTag:(NSNumber *)rootTag\n{\n  RCTAssertMainQueue();\n  NSView *view = [self viewForReactTag:rootTag];\n  return [self _lookupViewForNativeID:nativeID inView:view];\n}\n\n- (NSView *)_lookupViewForNativeID:(NSString *)nativeID inView:(NSView *)view\n{\n  RCTAssertMainQueue();\n  if (view != nil && [nativeID isEqualToString:view.nativeID]) {\n    return view;\n  }\n\n  for (NSView *subview in view.subviews) {\n    NSView *targetView = [self _lookupViewForNativeID:nativeID inView:subview];\n    if (targetView != nil) {\n      return targetView;\n    }\n  }\n  return nil;\n}\n\n- (void)setSize:(CGSize)size forView:(NSView *)view\n{\n  RCTAssertMainQueue();\n  [self _executeBlockWithShadowView:^(RCTShadowView *shadowView) {\n    if (CGSizeEqualToSize(size, shadowView.size)) {\n      return;\n    }\n\n    shadowView.size = size;\n    [self setNeedsLayout];\n  } forTag:view.reactTag];\n}\n\n- (void)setIntrinsicContentSize:(CGSize)intrinsicContentSize forView:(NSView *)view\n{\n  RCTAssertMainQueue();\n  [self _executeBlockWithShadowView:^(RCTShadowView *shadowView) {\n    if (CGSizeEqualToSize(shadowView.intrinsicContentSize, intrinsicContentSize)) {\n      return;\n    }\n\n    shadowView.intrinsicContentSize = intrinsicContentSize;\n    [self setNeedsLayout];\n  } forTag:view.reactTag];\n}\n\n/**\n * Unregisters views from registries\n */\n- (void)_purgeChildren:(NSArray<id<RCTComponent>> *)children\n          fromRegistry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)registry\n{\n  for (id<RCTComponent> child in children) {\n    RCTTraverseViewNodes(registry[child.reactTag], ^(id<RCTComponent> subview) {\n      RCTAssert(![subview isReactRootView], @\"Root views should not be unregistered\");\n      if ([subview conformsToProtocol:@protocol(RCTInvalidating)]) {\n        [(id<RCTInvalidating>)subview invalidate];\n      }\n      [registry removeObjectForKey:subview.reactTag];\n    });\n  }\n}\n\n- (void)addUIBlock:(RCTViewManagerUIBlock)block\n{\n  RCTAssertUIManagerQueue();\n\n  if (!block || !_viewRegistry) {\n    return;\n  }\n\n  [_pendingUIBlocks addObject:block];\n}\n\n- (void)prependUIBlock:(RCTViewManagerUIBlock)block\n{\n  RCTAssertUIManagerQueue();\n\n  if (!block || !_viewRegistry) {\n    return;\n  }\n\n  [_pendingUIBlocks insertObject:block atIndex:0];\n}\n\n- (void)setNextLayoutAnimationGroup:(RCTLayoutAnimationGroup *)layoutAnimationGroup\n{\n  RCTAssertMainQueue();\n\n  if (_layoutAnimationGroup && ![_layoutAnimationGroup isEqual:layoutAnimationGroup]) {\n    RCTLogWarn(@\"Warning: Overriding previous layout animation with new one before the first began:\\n%@ -> %@.\",\n      [_layoutAnimationGroup description],\n      [layoutAnimationGroup description]);\n  }\n\n  _layoutAnimationGroup = layoutAnimationGroup;\n}\n\n- (RCTViewManagerUIBlock)uiBlockWithLayoutUpdateForRootView:(RCTRootShadowView *)rootShadowView\n{\n  RCTAssertUIManagerQueue();\n\n  // This is nuanced. In the JS thread, we create a new update buffer\n  // `frameTags`/`frames` that is created/mutated in the JS thread. We access\n  // these structures in the UI-thread block. `NSMutableArray` is not thread\n  // safe so we rely on the fact that we never mutate it after it's passed to\n  // the main thread.\n  NSSet<RCTShadowView *> *viewsWithNewFrames = [rootShadowView collectViewsWithUpdatedFrames];\n\n  if (!viewsWithNewFrames.count) {\n    // no frame change results in no UI update block\n    return nil;\n  }\n\n  typedef struct {\n    CGRect frame;\n    NSUserInterfaceLayoutDirection layoutDirection;\n    BOOL isNew;\n    BOOL parentIsNew;\n    BOOL isHidden;\n  } RCTFrameData;\n\n  // Construct arrays then hand off to main thread\n  NSUInteger count = viewsWithNewFrames.count;\n  NSMutableArray *reactTags = [[NSMutableArray alloc] initWithCapacity:count];\n  NSMutableData *framesData = [[NSMutableData alloc] initWithLength:sizeof(RCTFrameData) * count];\n  {\n    NSUInteger index = 0;\n    RCTFrameData *frameDataArray = (RCTFrameData *)framesData.mutableBytes;\n    for (RCTShadowView *shadowView in viewsWithNewFrames) {\n      reactTags[index] = shadowView.reactTag;\n      frameDataArray[index++] = (RCTFrameData){\n        shadowView.frame,\n        shadowView.layoutDirection,\n        shadowView.isNewView,\n        shadowView.superview.isNewView,\n        shadowView.isHidden,\n      };\n    }\n  }\n\n  // These are blocks to be executed on each view, immediately after\n  // reactSetFrame: has been called. Note that if reactSetFrame: is not called,\n  // these won't be called either, so this is not a suitable place to update\n  // properties that aren't related to layout.\n  NSMutableDictionary<NSNumber *, RCTViewManagerUIBlock> *updateBlocks =\n  [NSMutableDictionary new];\n  for (RCTShadowView *shadowView in viewsWithNewFrames) {\n\n    // We have to do this after we build the parentsAreNew array.\n    shadowView.newView = NO;\n\n    NSNumber *reactTag = shadowView.reactTag;\n    RCTViewManager *manager = [_componentDataByName[shadowView.viewName] manager];\n    RCTViewManagerUIBlock block = [manager uiBlockToAmendWithShadowView:shadowView];\n    if (block) {\n      updateBlocks[reactTag] = block;\n    }\n\n    if (shadowView.onLayout) {\n      CGRect frame = shadowView.frame;\n      shadowView.onLayout(@{\n        @\"layout\": @{\n          @\"x\": @(frame.origin.x),\n          @\"y\": @(frame.origin.y),\n          @\"width\": @(frame.size.width),\n          @\"height\": @(frame.size.height),\n        },\n      });\n    }\n\n    if (RCTIsReactRootView(reactTag)) {\n      CGSize contentSize = shadowView.frame.size;\n\n      RCTExecuteOnMainQueue(^{\n        NSView *view = self->_viewRegistry[reactTag];\n        RCTAssert(view != nil, @\"view (for ID %@) not found\", reactTag);\n\n        RCTRootView *rootView = (RCTRootView *)[view superview];\n        if ([rootView isKindOfClass:[RCTRootView class]]) {\n          rootView.intrinsicContentSize = contentSize;\n        }\n      });\n    }\n  }\n\n  // Perform layout (possibly animated)\n  return ^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n\n    const RCTFrameData *frameDataArray = (const RCTFrameData *)framesData.bytes;\n    RCTLayoutAnimationGroup *layoutAnimationGroup = uiManager->_layoutAnimationGroup;\n\n    __block NSUInteger completionsCalled = 0;\n\n    NSInteger index = 0;\n    for (NSNumber *reactTag in reactTags) {\n      RCTFrameData frameData = frameDataArray[index++];\n\n      NSView *view = viewRegistry[reactTag];\n      CGRect frame = frameData.frame;\n\n      BOOL isHidden = frameData.isHidden;\n      NSUserInterfaceLayoutDirection layoutDirection = frameData.layoutDirection;\n      BOOL isNew = frameData.isNew;\n      RCTLayoutAnimation *updatingLayoutAnimation = isNew ? nil : layoutAnimationGroup.updatingLayoutAnimation;\n      BOOL shouldAnimateCreation = isNew && !frameData.parentIsNew;\n      RCTLayoutAnimation *creatingLayoutAnimation = shouldAnimateCreation ? layoutAnimationGroup.creatingLayoutAnimation : nil;\n\n      void (^completion)(BOOL) = ^(BOOL finished) {\n        completionsCalled++;\n        if (layoutAnimationGroup.callback && completionsCalled == count) {\n          layoutAnimationGroup.callback(@[@(finished)]);\n\n          // It's unsafe to call this callback more than once, so we nil it out here\n          // to make sure that doesn't happen.\n          layoutAnimationGroup.callback = nil;\n        }\n      };\n\n      if (view.isHidden != isHidden) {\n        view.hidden = isHidden;\n      }\n\n      if (view.reactLayoutDirection != layoutDirection) {\n        view.reactLayoutDirection = layoutDirection;\n      }\n\n      RCTViewManagerUIBlock updateBlock = updateBlocks[reactTag];\n      if (creatingLayoutAnimation) {\n\n        // Animate view creation\n        [view reactSetFrame:frame];\n\n        CATransform3D finalTransform = view.layer.transform;\n        CGFloat finalOpacity = view.layer.opacity;\n\n        NSString *property = creatingLayoutAnimation.property;\n        if ([property isEqualToString:@\"scaleXY\"]) {\n          view.layer.transform = CATransform3DMakeScale(0, 0, 0);\n        } else if ([property isEqualToString:@\"opacity\"]) {\n          view.layer.opacity = 0.0;\n        } else {\n          RCTLogError(@\"Unsupported layout animation createConfig property %@\",\n                      creatingLayoutAnimation.property);\n        }\n\n        [creatingLayoutAnimation performAnimations:^{\n          if ([property isEqualToString:@\"scaleXY\"]) {\n            view.layer.transform = finalTransform;\n          } else if ([property isEqualToString:@\"opacity\"]) {\n            view.layer.opacity = finalOpacity;\n          }\n          if (updateBlock) {\n            updateBlock(self, viewRegistry);\n          }\n        } withCompletionBlock:completion];\n\n      } else if (updatingLayoutAnimation) {\n\n        // Animate view update\n        [updatingLayoutAnimation performAnimations:^{\n          [[view animator] setFrame:frame];\n          [view reactSetFrame:frame];\n          if (updateBlock) {\n            updateBlock(self, viewRegistry);\n          }\n        } withCompletionBlock:completion];\n\n      } else {\n        // Workaround for https://github.com/ptmt/react-native-macos/issues/47\n        // Need to speedup layout or make a cancelling mechanism\n        if (!view.isReactRootView) {\n          [view reactSetFrame:frame];\n        }\n        if (updateBlock) {\n          updateBlock(self, viewRegistry);\n        }\n        completion(YES);\n      }\n    }\n\n    // Clean up\n    uiManager->_layoutAnimationGroup = nil;\n  };\n}\n\n- (void)_amendPendingUIBlocksWithStylePropagationUpdateForShadowView:(RCTShadowView *)topView\n{\n  NSMutableSet<RCTApplierBlock> *applierBlocks = [NSMutableSet setWithCapacity:1];\n  [topView collectUpdatedProperties:applierBlocks parentProperties:@{}];\n\n  if (applierBlocks.count) {\n    [self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n      for (RCTApplierBlock block in applierBlocks) {\n        block(viewRegistry);\n      }\n    }];\n  }\n}\n\n/**\n * A method to be called from JS, which takes a container ID and then releases\n * all subviews for that container upon receipt.\n */\nRCT_EXPORT_METHOD(removeSubviewsFromContainerWithID:(nonnull NSNumber *)containerID)\n{\n  id<RCTComponent> container = _shadowViewRegistry[containerID];\n  RCTAssert(container != nil, @\"container view (for ID %@) not found\", containerID);\n\n  NSUInteger subviewsCount = [container reactSubviews].count;\n  NSMutableArray<NSNumber *> *indices = [[NSMutableArray alloc] initWithCapacity:subviewsCount];\n  for (NSUInteger childIndex = 0; childIndex < subviewsCount; childIndex++) {\n    [indices addObject:@(childIndex)];\n  }\n\n  [self manageChildren:containerID\n       moveFromIndices:nil\n         moveToIndices:nil\n     addChildReactTags:nil\n          addAtIndices:nil\n       removeAtIndices:indices];\n}\n\n/**\n * Disassociates children from container. Doesn't remove from registries.\n * TODO: use [NSArray getObjects:buffer] to reuse same fast buffer each time.\n *\n * @returns Array of removed items.\n */\n- (NSArray<id<RCTComponent>> *)_childrenToRemoveFromContainer:(id<RCTComponent>)container\n                                                    atIndices:(NSArray<NSNumber *> *)atIndices\n{\n  // If there are no indices to move or the container has no subviews don't bother\n  // We support parents with nil subviews so long as they're all nil so this allows for this behavior\n  if (atIndices.count == 0 || [container reactSubviews].count == 0) {\n    return nil;\n  }\n  // Construction of removed children must be done \"up front\", before indices are disturbed by removals.\n  NSMutableArray<id<RCTComponent>> *removedChildren = [NSMutableArray arrayWithCapacity:atIndices.count];\n  RCTAssert(container != nil, @\"container view (for ID %@) not found\", container);\n  for (NSNumber *indexNumber in atIndices) {\n    NSUInteger index = indexNumber.unsignedIntegerValue;\n    if (index < [container reactSubviews].count) {\n      [removedChildren addObject:[container reactSubviews][index]];\n    }\n  }\n  if (removedChildren.count != atIndices.count) {\n    NSString *message = [NSString stringWithFormat:@\"removedChildren count (%tu) was not what we expected (%tu)\",\n                         removedChildren.count, atIndices.count];\n    RCTFatal(RCTErrorWithMessage(message));\n  }\n  return removedChildren;\n}\n\n- (void)_removeChildren:(NSArray<id<RCTComponent>> *)children\n          fromContainer:(id<RCTComponent>)container\n{\n  for (id<RCTComponent> removedChild in children) {\n    [container removeReactSubview:removedChild];\n  }\n}\n\n/**\n * Remove subviews from their parent with an animation.\n */\n- (void)_removeChildren:(NSArray<NSView *> *)children\n          fromContainer:(NSView *)container\n          withAnimation:(RCTLayoutAnimationGroup *)animation\n{\n  RCTAssertMainQueue();\n  RCTLayoutAnimation *deletingLayoutAnimation = animation.deletingLayoutAnimation;\n\n  __block NSUInteger completionsCalled = 0;\n  for (NSView *removedChild in children) {\n\n    void (^completion)(BOOL) = ^(BOOL finished) {\n      completionsCalled++;\n\n      [removedChild removeFromSuperview];\n\n      if (animation.callback && completionsCalled == children.count) {\n        animation.callback(@[@(finished)]);\n\n        // It's unsafe to call this callback more than once, so we nil it out here\n        // to make sure that doesn't happen.\n        animation.callback = nil;\n      }\n    };\n\n    // Hack: At this moment we have two contradict intents.\n    // First one: We want to delete the view from view hierarchy.\n    // Second one: We want to animate this view, which implies the existence of this view in the hierarchy.\n    // So, we have to remove this view from React's view hierarchy but postpone removing from UIKit's hierarchy.\n    // Here the problem: the default implementation of `-[UIView removeReactSubview:]` also removes the view from UIKit's hierarchy.\n    // So, let's temporary restore the view back after removing.\n    // To do so, we have to memorize original `superview` (which can differ from `container`) and an index of removed view.\n    NSView *originalSuperview = removedChild.superview;\n    NSUInteger originalIndex = [originalSuperview.subviews indexOfObjectIdenticalTo:removedChild];\n    [container removeReactSubview:removedChild];\n    // Disable user interaction while the view is animating\n    // since the view is (conseptually) deleted and not supposed to be interactive.\n    // removedChild.userInteractionEnabled = NO;\n    [originalSuperview addSubview:removedChild];// TODO: atIndex:originalIndex];\n\n    NSString *property = deletingLayoutAnimation.property;\n    [deletingLayoutAnimation performAnimations:^{\n      if ([property isEqualToString:@\"scaleXY\"]) {\n        removedChild.layer.transform = CATransform3DMakeScale(0.001, 0.001, 0.001);\n      } else if ([property isEqualToString:@\"opacity\"]) {\n        removedChild.layer.opacity = 0.0;\n      } else {\n        RCTLogError(@\"Unsupported layout animation createConfig property %@\",\n                    deletingLayoutAnimation.property);\n      }\n    } withCompletionBlock:completion];\n  }\n}\n\n\nRCT_EXPORT_METHOD(removeRootView:(nonnull NSNumber *)rootReactTag)\n{\n  RCTShadowView *rootShadowView = _shadowViewRegistry[rootReactTag];\n  RCTAssert(rootShadowView.superview == nil, @\"root view cannot have superview (ID %@)\", rootReactTag);\n  [self _purgeChildren:(NSArray<id<RCTComponent>> *)rootShadowView.reactSubviews\n          fromRegistry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)_shadowViewRegistry];\n  [_shadowViewRegistry removeObjectForKey:rootReactTag];\n  [_rootViewTags removeObject:rootReactTag];\n\n  [self addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry){\n    RCTAssertMainQueue();\n    NSView *rootView = viewRegistry[rootReactTag];\n    [uiManager _purgeChildren:(NSArray<id<RCTComponent>> *)rootView.reactSubviews\n                 fromRegistry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)viewRegistry];\n    [(NSMutableDictionary *)viewRegistry removeObjectForKey:rootReactTag];\n  }];\n}\n\nRCT_EXPORT_METHOD(replaceExistingNonRootView:(nonnull NSNumber *)reactTag\n                  withView:(nonnull NSNumber *)newReactTag)\n{\n  RCTShadowView *shadowView = _shadowViewRegistry[reactTag];\n  RCTAssert(shadowView != nil, @\"shadowView (for ID %@) not found\", reactTag);\n\n  RCTShadowView *superShadowView = shadowView.superview;\n  if (!superShadowView) {\n    RCTAssert(NO, @\"shadowView super (of ID %@) not found\", reactTag);\n    return;\n  }\n\n  NSUInteger indexOfView = [superShadowView.reactSubviews indexOfObjectIdenticalTo:shadowView];\n  RCTAssert(indexOfView != NSNotFound, @\"View's superview doesn't claim it as subview (id %@)\", reactTag);\n  NSArray<NSNumber *> *removeAtIndices = @[@(indexOfView)];\n  NSArray<NSNumber *> *addTags = @[newReactTag];\n  [self manageChildren:superShadowView.reactTag\n       moveFromIndices:nil\n         moveToIndices:nil\n     addChildReactTags:addTags\n          addAtIndices:removeAtIndices\n       removeAtIndices:removeAtIndices];\n}\n\nRCT_EXPORT_METHOD(setChildren:(nonnull NSNumber *)containerTag\n                  reactTags:(NSArray<NSNumber *> *)reactTags)\n{\n  RCTSetChildren(containerTag, reactTags,\n                 (NSDictionary<NSNumber *, id<RCTComponent>> *)_shadowViewRegistry);\n\n  [self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry){\n\n    RCTSetChildren(containerTag, reactTags,\n                   (NSDictionary<NSNumber *, id<RCTComponent>> *)viewRegistry);\n  }];\n\n  [self _shadowViewDidReceiveUpdatedChildren:_shadowViewRegistry[containerTag]];\n}\n\nstatic void RCTSetChildren(NSNumber *containerTag,\n                           NSArray<NSNumber *> *reactTags,\n                           NSDictionary<NSNumber *, id<RCTComponent>> *registry)\n{\n  id<RCTComponent> container = registry[containerTag];\n  NSInteger index = 0;\n  for (NSNumber *reactTag in reactTags) {\n    id<RCTComponent> view = registry[reactTag];\n    if (view) {\n      [container insertReactSubview:view atIndex:index++];\n    }\n  }\n}\n\nRCT_EXPORT_METHOD(manageChildren:(nonnull NSNumber *)containerTag\n                  moveFromIndices:(NSArray<NSNumber *> *)moveFromIndices\n                  moveToIndices:(NSArray<NSNumber *> *)moveToIndices\n                  addChildReactTags:(NSArray<NSNumber *> *)addChildReactTags\n                  addAtIndices:(NSArray<NSNumber *> *)addAtIndices\n                  removeAtIndices:(NSArray<NSNumber *> *)removeAtIndices)\n{\n  [self _manageChildren:containerTag\n        moveFromIndices:moveFromIndices\n          moveToIndices:moveToIndices\n      addChildReactTags:addChildReactTags\n           addAtIndices:addAtIndices\n        removeAtIndices:removeAtIndices\n               registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)_shadowViewRegistry];\n\n  [self addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry){\n    [uiManager _manageChildren:containerTag\n               moveFromIndices:moveFromIndices\n                 moveToIndices:moveToIndices\n             addChildReactTags:addChildReactTags\n                  addAtIndices:addAtIndices\n               removeAtIndices:removeAtIndices\n                      registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)viewRegistry];\n  }];\n\n  [self _shadowViewDidReceiveUpdatedChildren:_shadowViewRegistry[containerTag]];\n}\n\n- (void)_manageChildren:(NSNumber *)containerTag\n        moveFromIndices:(NSArray<NSNumber *> *)moveFromIndices\n          moveToIndices:(NSArray<NSNumber *> *)moveToIndices\n      addChildReactTags:(NSArray<NSNumber *> *)addChildReactTags\n           addAtIndices:(NSArray<NSNumber *> *)addAtIndices\n        removeAtIndices:(NSArray<NSNumber *> *)removeAtIndices\n               registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)registry\n{\n  id<RCTComponent> container = registry[containerTag];\n  RCTAssert(moveFromIndices.count == moveToIndices.count, @\"moveFromIndices had size %tu, moveToIndices had size %tu\", moveFromIndices.count, moveToIndices.count);\n  RCTAssert(addChildReactTags.count == addAtIndices.count, @\"there should be at least one React child to add\");\n\n  // Removes (both permanent and temporary moves) are using \"before\" indices\n  NSArray<id<RCTComponent>> *permanentlyRemovedChildren =\n  [self _childrenToRemoveFromContainer:container atIndices:removeAtIndices];\n  NSArray<id<RCTComponent>> *temporarilyRemovedChildren =\n  [self _childrenToRemoveFromContainer:container atIndices:moveFromIndices];\n\n  BOOL isUIViewRegistry = ((id)registry == (id)_viewRegistry);\n  if (isUIViewRegistry && _layoutAnimationGroup.deletingLayoutAnimation) {\n    [self _removeChildren:(NSArray<NSView *> *)permanentlyRemovedChildren\n            fromContainer:(NSView *)container\n            withAnimation:_layoutAnimationGroup];\n  } else {\n    [self _removeChildren:permanentlyRemovedChildren fromContainer:container];\n  }\n\n  [self _removeChildren:temporarilyRemovedChildren fromContainer:container];\n  [self _purgeChildren:permanentlyRemovedChildren fromRegistry:registry];\n\n  // Figure out what to insert - merge temporary inserts and adds\n  NSMutableDictionary *destinationsToChildrenToAdd = [NSMutableDictionary dictionary];\n  for (NSInteger index = 0, length = temporarilyRemovedChildren.count; index < length; index++) {\n    destinationsToChildrenToAdd[moveToIndices[index]] = temporarilyRemovedChildren[index];\n  }\n\n  for (NSInteger index = 0, length = addAtIndices.count; index < length; index++) {\n    id<RCTComponent> view = registry[addChildReactTags[index]];\n    if (view) {\n      destinationsToChildrenToAdd[addAtIndices[index]] = view;\n    }\n  }\n\n  NSArray<NSNumber *> *sortedIndices =\n  [destinationsToChildrenToAdd.allKeys sortedArrayUsingSelector:@selector(compare:)];\n  for (NSNumber *reactIndex in sortedIndices) {\n    [container insertReactSubview:destinationsToChildrenToAdd[reactIndex]\n                          atIndex:reactIndex.integerValue];\n  }\n}\n\nRCT_EXPORT_METHOD(createView:(nonnull NSNumber *)reactTag\n                  viewName:(NSString *)viewName\n                  rootTag:(nonnull NSNumber *)rootTag\n                  props:(NSDictionary *)props)\n{\n  RCTComponentData *componentData = _componentDataByName[viewName];\n  if (componentData == nil) {\n    RCTLogError(@\"No component found for view with name \\\"%@\\\"\", viewName);\n  }\n\n  // Register shadow view\n  RCTShadowView *shadowView = [componentData createShadowViewWithTag:reactTag];\n  if (shadowView) {\n    [componentData setProps:props forShadowView:shadowView];\n    _shadowViewRegistry[reactTag] = shadowView;\n    RCTShadowView *rootView = _shadowViewRegistry[rootTag];\n    RCTAssert([rootView isKindOfClass:[RCTRootShadowView class]] ||\n              [rootView isKindOfClass:[RCTSurfaceRootShadowView class]],\n      @\"Given `rootTag` (%@) does not correspond to a valid root shadow view instance.\", rootTag);\n    shadowView.rootView = (RCTRootShadowView *)rootView;\n  }\n\n  // Dispatch view creation directly to the main thread instead of adding to\n  // UIBlocks array. This way, it doesn't get deferred until after layout.\n  __block NSView *preliminaryCreatedView;\n\n  RCTExecuteOnMainQueue(^{\n    preliminaryCreatedView = [componentData createViewWithTag:reactTag];\n  });\n\n  [self addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    if (!preliminaryCreatedView) {\n      return;\n    }\n\n    uiManager->_viewRegistry[reactTag] = preliminaryCreatedView;\n    [componentData setProps:props forView:preliminaryCreatedView];\n  }];\n\n  [self _shadowView:shadowView didReceiveUpdatedProps:[props allKeys]];\n}\n\nRCT_EXPORT_METHOD(updateView:(nonnull NSNumber *)reactTag\n                  viewName:(NSString *)viewName // not always reliable, use shadowView.viewName if available\n                  props:(NSDictionary *)props)\n{\n  RCTShadowView *shadowView = _shadowViewRegistry[reactTag];\n  RCTComponentData *componentData = _componentDataByName[shadowView.viewName ?: viewName];\n  [componentData setProps:props forShadowView:shadowView];\n\n  [self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    NSView *view = viewRegistry[reactTag];\n    [componentData setProps:props forView:view];\n  }];\n\n  [self _shadowView:shadowView didReceiveUpdatedProps:[props allKeys]];\n}\n\n- (void)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag\n                                 viewName:(NSString *)viewName\n                                    props:(NSDictionary *)props\n{\n  RCTAssertMainQueue();\n  RCTComponentData *componentData = _componentDataByName[viewName];\n  NSView *view = _viewRegistry[reactTag];\n  [componentData setProps:props forView:view];\n}\n\nRCT_EXPORT_METHOD(focus:(nonnull NSNumber *)reactTag)\n{\n  [self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    NSView *newResponder = viewRegistry[reactTag];\n    [newResponder reactFocus];\n  }];\n}\n\nRCT_EXPORT_METHOD(blur:(nonnull NSNumber *)reactTag)\n{\n  [self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry){\n    NSView *currentResponder = viewRegistry[reactTag];\n    [currentResponder reactBlur];\n  }];\n}\n\nRCT_EXPORT_METHOD(findSubviewIn:(nonnull NSNumber *)reactTag atPoint:(CGPoint)point callback:(RCTResponseSenderBlock)callback)\n{\n  [self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    NSLog(@\"findSubViewin is not implemented\");\n//    NSView *view = viewRegistry[reactTag];\n//    NSView *target = [view hitTest:point withEvent:nil];\n//    CGRect frame = [target convertRect:target.bounds toView:view];\n//\n//    while (target.reactTag == nil && target.superview != nil) {\n//      target = target.superview;\n//    }\n//\n//    callback(@[\n//      RCTNullIfNil(target.reactTag),\n//      @(frame.origin.x),\n//      @(frame.origin.y),\n//      @(frame.size.width),\n//      @(frame.size.height),\n//    ]);\n  }];\n}\n\nRCT_EXPORT_METHOD(dispatchViewManagerCommand:(nonnull NSNumber *)reactTag\n                  commandID:(NSInteger)commandID\n                  commandArgs:(NSArray<id> *)commandArgs)\n{\n  RCTShadowView *shadowView = _shadowViewRegistry[reactTag];\n  RCTComponentData *componentData = _componentDataByName[shadowView.viewName];\n  Class managerClass = componentData.managerClass;\n  RCTModuleData *moduleData = [_bridge moduleDataForName:RCTBridgeModuleNameForClass(managerClass)];\n  id<RCTBridgeMethod> method = moduleData.methods[commandID];\n\n  NSArray *args = [@[reactTag] arrayByAddingObjectsFromArray:commandArgs];\n  [method invokeWithBridge:_bridge module:componentData.manager arguments:args];\n}\n\n- (void)batchDidComplete\n{\n  [self _layoutAndMount];\n}\n\n/**\n * Sets up animations, computes layout, creates UI mounting blocks for computed layout,\n * runs these blocks and all other already existing blocks.\n */\n- (void)_layoutAndMount\n{\n  // Gather blocks to be executed now that all view hierarchy manipulations have\n  // been completed (note that these may still take place before layout has finished)\n  for (RCTComponentData *componentData in _componentDataByName.allValues) {\n    RCTViewManagerUIBlock uiBlock = [componentData uiBlockToAmendWithShadowViewRegistry:_shadowViewRegistry];\n    [self addUIBlock:uiBlock];\n  }\n\n  [self _dispatchPropsDidChangeEvents];\n  [self _dispatchChildrenDidChangeEvents];\n\n  [_observerCoordinator uiManagerWillPerformLayout:self];\n\n  // Perform layout\n  for (NSNumber *reactTag in _rootViewTags) {\n    RCTRootShadowView *rootView = (RCTRootShadowView *)_shadowViewRegistry[reactTag];\n    [self addUIBlock:[self uiBlockWithLayoutUpdateForRootView:rootView]];\n  }\n\n  [_observerCoordinator uiManagerDidPerformLayout:self];\n\n  // Properies propagation\n  for (NSNumber *reactTag in _rootViewTags) {\n    RCTRootShadowView *rootView = (RCTRootShadowView *)_shadowViewRegistry[reactTag];\n    [self _amendPendingUIBlocksWithStylePropagationUpdateForShadowView:rootView];\n  }\n\n  [_observerCoordinator uiManagerWillPerformMounting:self];\n\n  [self flushUIBlocksWithCompletion:^{\n    [self->_observerCoordinator uiManagerDidPerformMounting:self];\n  }];\n}\n\n- (void)flushUIBlocksWithCompletion:(void (^)(void))completion;\n{\n  RCTAssertUIManagerQueue();\n\n  // First copy the previous blocks into a temporary variable, then reset the\n  // pending blocks to a new array. This guards against mutation while\n  // processing the pending blocks in another thread.\n  NSArray<RCTViewManagerUIBlock> *previousPendingUIBlocks = _pendingUIBlocks;\n  _pendingUIBlocks = [NSMutableArray new];\n\n  if (previousPendingUIBlocks.count == 0) {\n    completion();\n    return;\n  }\n\n  // Execute the previously queued UI blocks\n  RCTProfileBeginFlowEvent();\n  RCTExecuteOnMainQueue(^{\n    RCTProfileEndFlowEvent();\n    RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"-[UIManager flushUIBlocks]\", (@{\n      @\"count\": [@(previousPendingUIBlocks.count) stringValue],\n    }));\n    @try {\n      for (RCTViewManagerUIBlock block in previousPendingUIBlocks) {\n        block(self, self->_viewRegistry);\n      }\n    }\n    @catch (NSException *exception) {\n      RCTLogError(@\"Exception thrown while executing UI block: %@\", exception);\n    }\n    RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n\n    RCTExecuteOnUIManagerQueue(completion);\n  });\n}\n\n- (void)setNeedsLayout\n{\n  // If there is an active batch layout will happen when batch finished, so we will wait for that.\n  // Otherwise we immidiately trigger layout.\n  if (![_bridge isBatchActive] && ![_bridge isLoading]) {\n    [self _layoutAndMount];\n  }\n}\n\n- (void)_shadowView:(RCTShadowView *)shadowView didReceiveUpdatedProps:(NSArray<NSString *> *)props\n{\n  // We collect a set with changed `shadowViews` and its changed props,\n  // so we have to maintain this collection properly.\n  NSArray<NSString *> *previousProps;\n  if ((previousProps = [_shadowViewsWithUpdatedProps objectForKey:shadowView])) {\n    // Merging already registred changed props and new ones.\n    NSMutableSet *set = [NSMutableSet setWithArray:previousProps];\n    [set addObjectsFromArray:props];\n    props = [set allObjects];\n  }\n\n  [_shadowViewsWithUpdatedProps setObject:props forKey:shadowView];\n}\n\n- (void)_shadowViewDidReceiveUpdatedChildren:(RCTShadowView *)shadowView\n{\n  [_shadowViewsWithUpdatedChildren addObject:shadowView];\n}\n\n- (void)_dispatchChildrenDidChangeEvents\n{\n  if (_shadowViewsWithUpdatedChildren.count == 0) {\n    return;\n  }\n\n  NSHashTable<RCTShadowView *> *shadowViews = _shadowViewsWithUpdatedChildren;\n  _shadowViewsWithUpdatedChildren = [NSHashTable weakObjectsHashTable];\n\n  NSMutableArray *tags = [NSMutableArray arrayWithCapacity:shadowViews.count];\n\n  for (RCTShadowView *shadowView in shadowViews) {\n    [shadowView didUpdateReactSubviews];\n    [tags addObject:shadowView.reactTag];\n  }\n\n  [self addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    for (NSNumber *tag in tags) {\n      NSView<RCTComponent> *view = viewRegistry[tag];\n      [view didUpdateReactSubviews];\n    }\n  }];\n}\n\n- (void)_dispatchPropsDidChangeEvents\n{\n  if (_shadowViewsWithUpdatedProps.count == 0) {\n    return;\n  }\n\n  NSMapTable<RCTShadowView *, NSArray<NSString *> *> *shadowViews = _shadowViewsWithUpdatedProps;\n  _shadowViewsWithUpdatedProps = [NSMapTable weakToStrongObjectsMapTable];\n\n  NSMapTable<NSNumber *, NSArray<NSString *> *> *tags = [NSMapTable strongToStrongObjectsMapTable];\n\n  for (RCTShadowView *shadowView in shadowViews) {\n    NSArray<NSString *> *props = [shadowViews objectForKey:shadowView];\n    [shadowView didSetProps:props];\n    [tags setObject:props forKey:shadowView.reactTag];\n  }\n\n  [self addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    for (NSNumber *tag in tags) {\n      NSView<RCTComponent> *view = viewRegistry[tag];\n      [view didSetProps:[tags objectForKey:tag]];\n    }\n  }];\n}\n\nRCT_EXPORT_METHOD(measure:(nonnull NSNumber *)reactTag\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  [self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    NSView *view = viewRegistry[reactTag];\n    if (!view) {\n      // this view was probably collapsed out\n      RCTLogWarn(@\"measure cannot find view with tag #%@\", reactTag);\n      callback(@[]);\n      return;\n    }\n\n    NSView *rootView = view;\n    while (rootView && ![rootView isReactRootView]) {\n      rootView = rootView.superview;\n    }\n\n    // By convention, all coordinates, whether they be touch coordinates, or\n    // measurement coordinates are with respect to the root view.\n    CGRect frame = view.frame;\n    CGRect globalBounds = view.layer\n      ? [view.layer convertRect:view.bounds toLayer:rootView.layer]\n      : [view convertRect:view.bounds toView:rootView];\n\n    callback(@[\n      @(frame.origin.x),\n      @(frame.origin.y),\n      @(globalBounds.size.width),\n      @(globalBounds.size.height),\n      @(globalBounds.origin.x),\n      @(globalBounds.origin.y),\n    ]);\n  }];\n}\n\nRCT_EXPORT_METHOD(measureInWindow:(nonnull NSNumber *)reactTag\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  [self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    NSView *view = viewRegistry[reactTag];\n    if (!view) {\n      // this view was probably collapsed out\n      RCTLogWarn(@\"measure cannot find view with tag #%@\", reactTag);\n      callback(@[]);\n      return;\n    }\n\n    // Return frame coordinates in window\n    CGRect windowFrame = [view.window convertRectFromScreen:view.frame];\n    callback(@[\n      @(windowFrame.origin.x),\n      @(windowFrame.origin.y),\n      @(windowFrame.size.width),\n      @(windowFrame.size.height),\n    ]);\n  }];\n}\n\n/**\n * Returs if the shadow view provided has the `ancestor` shadow view as\n * an actual ancestor.\n */\nRCT_EXPORT_METHOD(viewIsDescendantOf:(nonnull NSNumber *)reactTag\n                  ancestor:(nonnull NSNumber *)ancestorReactTag\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  RCTShadowView *shadowView = _shadowViewRegistry[reactTag];\n  RCTShadowView *ancestorShadowView = _shadowViewRegistry[ancestorReactTag];\n  if (!shadowView) {\n    return;\n  }\n  if (!ancestorShadowView) {\n    return;\n  }\n  BOOL viewIsAncestor = [shadowView viewIsDescendantOf:ancestorShadowView];\n  callback(@[@(viewIsAncestor)]);\n}\n\nstatic void RCTMeasureLayout(RCTShadowView *view,\n                             RCTShadowView *ancestor,\n                             RCTResponseSenderBlock callback)\n{\n  if (!view) {\n    return;\n  }\n  if (!ancestor) {\n    return;\n  }\n  CGRect result = [view measureLayoutRelativeToAncestor:ancestor];\n  if (CGRectIsNull(result)) {\n    RCTLogError(@\"view %@ (tag #%@) is not a descendant of %@ (tag #%@)\",\n                view, view.reactTag, ancestor, ancestor.reactTag);\n    return;\n  }\n  CGFloat leftOffset = result.origin.x;\n  CGFloat topOffset = result.origin.y;\n  CGFloat width = result.size.width;\n  CGFloat height = result.size.height;\n  if (isnan(leftOffset) || isnan(topOffset) || isnan(width) || isnan(height)) {\n    RCTLogError(@\"Attempted to measure layout but offset or dimensions were NaN\");\n    return;\n  }\n  callback(@[@(leftOffset), @(topOffset), @(width), @(height)]);\n}\n\n/**\n * Returns the computed recursive offset layout in a dictionary form. The\n * returned values are relative to the `ancestor` shadow view. Returns `nil`, if\n * the `ancestor` shadow view is not actually an `ancestor`. Does not touch\n * anything on the main UI thread. Invokes supplied callback with (x, y, width,\n * height).\n */\nRCT_EXPORT_METHOD(measureLayout:(nonnull NSNumber *)reactTag\n                  relativeTo:(nonnull NSNumber *)ancestorReactTag\n                  errorCallback:(__unused RCTResponseSenderBlock)errorCallback\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  RCTShadowView *shadowView = _shadowViewRegistry[reactTag];\n  RCTShadowView *ancestorShadowView = _shadowViewRegistry[ancestorReactTag];\n  RCTMeasureLayout(shadowView, ancestorShadowView, callback);\n}\n\n/**\n * Returns the computed recursive offset layout in a dictionary form. The\n * returned values are relative to the `ancestor` shadow view. Returns `nil`, if\n * the `ancestor` shadow view is not actually an `ancestor`. Does not touch\n * anything on the main UI thread. Invokes supplied callback with (x, y, width,\n * height).\n */\nRCT_EXPORT_METHOD(measureLayoutRelativeToParent:(nonnull NSNumber *)reactTag\n                  errorCallback:(__unused RCTResponseSenderBlock)errorCallback\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  RCTShadowView *shadowView = _shadowViewRegistry[reactTag];\n  RCTMeasureLayout(shadowView, shadowView.reactSuperview, callback);\n}\n\n/**\n * Returns an array of computed offset layouts in a dictionary form. The layouts are of any React subviews\n * that are immediate descendants to the parent view found within a specified rect. The dictionary result\n * contains left, top, width, height and an index. The index specifies the position among the other subviews.\n * Only layouts for views that are within the rect passed in are returned. Invokes the error callback if the\n * passed in parent view does not exist. Invokes the supplied callback with the array of computed layouts.\n */\nRCT_EXPORT_METHOD(measureViewsInRect:(CGRect)rect\n                  parentView:(nonnull NSNumber *)reactTag\n                  errorCallback:(__unused RCTResponseSenderBlock)errorCallback\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  RCTShadowView *shadowView = _shadowViewRegistry[reactTag];\n  if (!shadowView) {\n    RCTLogError(@\"Attempting to measure view that does not exist (tag #%@)\", reactTag);\n    return;\n  }\n  NSArray<RCTShadowView *> *childShadowViews = [shadowView reactSubviews];\n  NSMutableArray<NSDictionary *> *results =\n    [[NSMutableArray alloc] initWithCapacity:childShadowViews.count];\n\n  [childShadowViews enumerateObjectsUsingBlock:\n   ^(RCTShadowView *childShadowView, NSUInteger idx, __unused BOOL *stop) {\n    CGRect childLayout = [childShadowView measureLayoutRelativeToAncestor:shadowView];\n    if (CGRectIsNull(childLayout)) {\n      RCTLogError(@\"View %@ (tag #%@) is not a descendant of %@ (tag #%@)\",\n                  childShadowView, childShadowView.reactTag, shadowView, shadowView.reactTag);\n      return;\n    }\n\n    CGFloat leftOffset = childLayout.origin.x;\n    CGFloat topOffset = childLayout.origin.y;\n    CGFloat width = childLayout.size.width;\n    CGFloat height = childLayout.size.height;\n\n    if (leftOffset <= rect.origin.x + rect.size.width &&\n        leftOffset + width >= rect.origin.x &&\n        topOffset <= rect.origin.y + rect.size.height &&\n        topOffset + height >= rect.origin.y) {\n\n      // This view is within the layout rect\n      NSDictionary *result = @{@\"index\": @(idx),\n                               @\"left\": @(leftOffset),\n                               @\"top\": @(topOffset),\n                               @\"width\": @(width),\n                               @\"height\": @(height)};\n\n      [results addObject:result];\n    }\n  }];\n  callback(@[results]);\n}\n\nRCT_EXPORT_METHOD(takeSnapshot:(id /* NSString or NSNumber */)target\n                  withOptions:(NSDictionary *)options\n                  resolve:(RCTPromiseResolveBlock)resolve\n                  reject:(RCTPromiseRejectBlock)reject)\n{\n  [self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n\n    // Get view\n    NSView *view;\n    if (target == nil || [target isEqual:@\"window\"]) {\n      view = RCTKeyWindow();\n    } else if ([target isKindOfClass:[NSNumber class]]) {\n      view = viewRegistry[target];\n      if (!view) {\n        RCTLogError(@\"No view found with reactTag: %@\", target);\n        return;\n      }\n    }\n\n    // Get options\n    CGSize size = [RCTConvert CGSize:options];\n    NSString *format = [RCTConvert NSString:options[@\"format\"] ?: @\"png\"];\n\n    // Capture image\n    if (size.width < 0.1 || size.height < 0.1) {\n      size = view.bounds.size;\n    }\n    NSImage *image =[[NSImage alloc] initWithData:[view dataWithPDFInsideRect:[view bounds]]];\n    if (!image) {\n      reject(RCTErrorUnspecified, @\"Failed to capture view snapshot.\", nil);\n      return;\n    }\n\n    // Convert image to data (on a background thread)\n    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n\n      NSData *data;\n      if ([format isEqualToString:@\"png\"]) {\n        data = UIImagePNGRepresentation(image);\n      } else if ([format isEqualToString:@\"jpeg\"]) {\n        CGFloat quality = [RCTConvert CGFloat:options[@\"quality\"] ?: @1];\n        data = UIImageJPEGRepresentation(image, quality);\n      } else {\n        RCTLogError(@\"Unsupported image format: %@\", format);\n        return;\n      }\n\n      // Save to a temp file\n      NSError *error = nil;\n      NSString *tempFilePath = RCTTempFilePath(format, &error);\n      if (tempFilePath) {\n        if ([data writeToFile:tempFilePath options:(NSDataWritingOptions)0 error:&error]) {\n          resolve(tempFilePath);\n          return;\n        }\n      }\n\n      // If we reached here, something went wrong\n      reject(RCTErrorUnspecified, error.localizedDescription, error);\n    });\n  }];\n}\n\n/**\n * JS sets what *it* considers to be the responder. Later, scroll views can use\n * this in order to determine if scrolling is appropriate.\n */\nRCT_EXPORT_METHOD(setJSResponder:(nonnull NSNumber *)reactTag\n                  blockNativeResponder:(__unused BOOL)blockNativeResponder)\n{\n  [self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    _jsResponder = viewRegistry[reactTag];\n    if (!_jsResponder) {\n      RCTLogError(@\"Invalid view set to be the JS responder - tag %@\", reactTag);\n    }\n  }];\n}\n\nRCT_EXPORT_METHOD(clearJSResponder)\n{\n  [self addUIBlock:^(__unused RCTUIManager *uiManager, __unused NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    _jsResponder = nil;\n  }];\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  NSMutableDictionary<NSString *, NSDictionary *> *constants = [NSMutableDictionary new];\n  NSMutableDictionary<NSString *, NSDictionary *> *directEvents = [NSMutableDictionary new];\n  NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents = [NSMutableDictionary new];\n\n  [_componentDataByName enumerateKeysAndObjectsUsingBlock:^(NSString *name, RCTComponentData *componentData, __unused BOOL *stop) {\n     NSMutableDictionary<NSString *, id> *moduleConstants = [NSMutableDictionary new];\n\n     // Register which event-types this view dispatches.\n     // React needs this for the event plugin.\n     NSMutableDictionary<NSString *, NSDictionary *> *bubblingEventTypes = [NSMutableDictionary new];\n     NSMutableDictionary<NSString *, NSDictionary *> *directEventTypes = [NSMutableDictionary new];\n\n     // Add manager class\n     moduleConstants[@\"Manager\"] = RCTBridgeModuleNameForClass(componentData.managerClass);\n\n     // Add native props\n     NSDictionary<NSString *, id> *viewConfig = [componentData viewConfig];\n     moduleConstants[@\"NativeProps\"] = viewConfig[@\"propTypes\"];\n     moduleConstants[@\"baseModuleName\"] = viewConfig[@\"baseModuleName\"];\n     moduleConstants[@\"bubblingEventTypes\"] = bubblingEventTypes;\n     moduleConstants[@\"directEventTypes\"] = directEventTypes;\n\n     // Add direct events\n     for (NSString *eventName in viewConfig[@\"directEvents\"]) {\n       if (!directEvents[eventName]) {\n         directEvents[eventName] = @{\n           @\"registrationName\": [eventName stringByReplacingCharactersInRange:(NSRange){0, 3} withString:@\"on\"],\n         };\n       }\n       directEventTypes[eventName] = directEvents[eventName];\n       if (RCT_DEBUG && bubblingEvents[eventName]) {\n         RCTLogError(@\"Component '%@' re-registered bubbling event '%@' as a \"\n                     \"direct event\", componentData.name, eventName);\n       }\n     }\n\n     // Add bubbling events\n     for (NSString *eventName in viewConfig[@\"bubblingEvents\"]) {\n       if (!bubblingEvents[eventName]) {\n         NSString *bubbleName = [eventName stringByReplacingCharactersInRange:(NSRange){0, 3} withString:@\"on\"];\n         bubblingEvents[eventName] = @{\n           @\"phasedRegistrationNames\": @{\n             @\"bubbled\": bubbleName,\n             @\"captured\": [bubbleName stringByAppendingString:@\"Capture\"],\n           }\n         };\n       }\n       bubblingEventTypes[eventName] = bubblingEvents[eventName];\n       if (RCT_DEBUG && directEvents[eventName]) {\n         RCTLogError(@\"Component '%@' re-registered direct event '%@' as a \"\n                     \"bubbling event\", componentData.name, eventName);\n       }\n     }\n\n     RCTAssert(!constants[name], @\"UIManager already has constants for %@\", componentData.name);\n     constants[name] = moduleConstants;\n  }];\n\n  return constants;\n}\n\nRCT_EXPORT_METHOD(configureNextLayoutAnimation:(NSDictionary *)config\n                  withCallback:(RCTResponseSenderBlock)callback\n                  errorCallback:(__unused RCTResponseSenderBlock)errorCallback)\n{\n  RCTLayoutAnimationGroup *layoutAnimationGroup =\n    [[RCTLayoutAnimationGroup alloc] initWithConfig:config\n                                           callback:callback];\n\n  [self addUIBlock:^(RCTUIManager *uiManager, __unused NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    [uiManager setNextLayoutAnimationGroup:layoutAnimationGroup];\n  }];\n}\n\n- (void)rootViewForReactTag:(NSNumber *)reactTag withCompletion:(void (^)(NSView *view))completion\n{\n  RCTAssertMainQueue();\n  RCTAssert(completion != nil, @\"Attempted to resolve rootView for tag %@ without a completion block\", reactTag);\n\n  if (reactTag == nil) {\n    completion(nil);\n    return;\n  }\n\n  RCTExecuteOnUIManagerQueue(^{\n    NSNumber *rootTag = [self shadowViewForReactTag:reactTag].rootView.reactTag;\n    RCTExecuteOnMainQueue(^{\n      NSView *rootView = nil;\n      if (rootTag != nil) {\n        rootView = [self viewForReactTag:rootTag];\n      }\n      completion(rootView);\n    });\n  });\n}\n\nstatic NSView *_jsResponder;\n\n+ (NSView *)JSResponder\n{\n  return _jsResponder;\n}\n\n@end\n\n@implementation RCTBridge (RCTUIManager)\n\n- (RCTUIManager *)uiManager\n{\n  return [self moduleForClass:[RCTUIManager class]];\n}\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTUIManagerObserverCoordinator.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTViewManager.h>\n\n/**\n * Allows hooking into UIManager internals. This can be used to execute code at\n * specific points during the view updating process.\n * New observers must not be added inside observer handlers.\n * The particular order of handler invocation is not guaranteed.\n * All observer handlers are called on UIManager queue.\n */\n@protocol RCTUIManagerObserver <NSObject>\n\n@optional\n\n/**\n * Called just before the UIManager layout views.\n * It allows performing some operation for components which contain custom\n * layout logic right before regular Yoga based layout. So, for instance,\n * some components which have own React-independent state can compute and cache\n * own intrinsic content size (which will be used by Yoga) at this point.\n */\n- (void)uiManagerWillPerformLayout:(RCTUIManager *)manager;\n\n/**\n * Called just after the UIManager layout views.\n * It allows performing custom layout logic right after regular Yoga based layout.\n * So, for instance, this can be used for computing final layout for a component,\n * since it has its final frame set by Yoga at this point.\n */\n- (void)uiManagerDidPerformLayout:(RCTUIManager *)manager;\n\n/**\n * Called before flushing UI blocks at the end of a batch.\n * This is called from the UIManager queue. Can be used to add UI operations in that batch.\n */\n- (void)uiManagerWillPerformMounting:(RCTUIManager *)manager;\n\n/**\n * Called just after flushing UI blocks.\n * This is called from the UIManager queue.\n */\n- (void)uiManagerDidPerformMounting:(RCTUIManager *)manager;\n\n@end\n\n/**\n * Simple helper which take care of RCTUIManager's observers.\n */\n@interface RCTUIManagerObserverCoordinator : NSObject <RCTUIManagerObserver>\n\n/**\n * Add a UIManagerObserver. See the `RCTUIManagerObserver` protocol for more info.\n * References to observers are held weakly.\n * This method can be called safely from any queue.\n */\n- (void)addObserver:(id<RCTUIManagerObserver>)observer;\n\n/**\n * Remove a `UIManagerObserver`.\n * This method can be called safely from any queue.\n */\n- (void)removeObserver:(id<RCTUIManagerObserver>)observer;\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTUIManagerObserverCoordinator.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTUIManagerObserverCoordinator.h\"\n\n#import <mutex>\n\n#import \"RCTUIManager.h\"\n\n@implementation RCTUIManagerObserverCoordinator {\n  NSHashTable<id<RCTUIManagerObserver>> *_observers;\n  std::mutex _mutex;\n}\n\n- (instancetype)init\n{\n  if (self = [super init]) {\n    _observers = [[NSHashTable alloc] initWithOptions:NSHashTableWeakMemory capacity:0];\n  }\n\n  return self;\n}\n\n- (void)addObserver:(id<RCTUIManagerObserver>)observer\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n  [self->_observers addObject:observer];\n}\n\n- (void)removeObserver:(id<RCTUIManagerObserver>)observer\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n  [self->_observers removeObject:observer];\n}\n\n#pragma mark - RCTUIManagerObserver\n\n- (void)uiManagerWillPerformLayout:(RCTUIManager *)manager\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n\n  for (id<RCTUIManagerObserver> observer in _observers) {\n    if ([observer respondsToSelector:@selector(uiManagerWillPerformLayout:)]) {\n      [observer uiManagerWillPerformLayout:manager];\n    }\n  }\n}\n\n- (void)uiManagerDidPerformLayout:(RCTUIManager *)manager\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n\n  for (id<RCTUIManagerObserver> observer in _observers) {\n    if ([observer respondsToSelector:@selector(uiManagerDidPerformLayout:)]) {\n      [observer uiManagerDidPerformLayout:manager];\n    }\n  }\n}\n\n- (void)uiManagerWillPerformMounting:(RCTUIManager *)manager\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n\n  for (id<RCTUIManagerObserver> observer in _observers) {\n    if ([observer respondsToSelector:@selector(uiManagerWillPerformMounting:)]) {\n      [observer uiManagerWillPerformMounting:manager];\n    }\n  }\n}\n\n- (void)uiManagerDidPerformMounting:(RCTUIManager *)manager\n{\n  std::lock_guard<std::mutex> lock(_mutex);\n\n  for (id<RCTUIManagerObserver> observer in _observers) {\n    if ([observer respondsToSelector:@selector(uiManagerDidPerformMounting:)]) {\n      [observer uiManagerDidPerformMounting:manager];\n    }\n  }\n}\n\n\n@end\n"
  },
  {
    "path": "React/Modules/RCTUIManagerUtils.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTAssert.h>\n#import <React/RCTDefines.h>\n\n/**\n * Queues Problem Intro:\n * UIManager queue is a special queue because it has a special relationship with\n * the Main queue.\n *\n * This particular relationship comes from two key factors:\n *  1. UIManager initiates execution of many blocks on the Main queue;\n *  2. In some cases, we want to initiate (and wait for) some UIManager's work *synchronously* from\n *     the Main queue.\n *\n * So, how can we meet these criteria?\n * \"Pseudo UIManager queue\" comes to rescue!\n *\n * \"Pseudo UIManager queue\" means the safe execution of typical UIManager's work\n * on the Main queue while the UIManager queue is explicitly blocked for preventing\n * simultaneous/concurrent memory access.\n *\n * So, how can we technically do this?\n *  1. `RCTAssertUIManagerQueue` is okay with execution on both actual UIManager and\n *     Pseudo UIManager queues.\n *  2. Both `RCTExecuteOnUIManagerQueue` and `RCTUnsafeExecuteOnUIManagerQueueSync`\n *     execute given block *synchronously* if they were called on actual UIManager\n *     or Pseudo UIManager queues.\n *  3. `RCTExecuteOnMainQueue` executes given block *synchronously* if we already on\n *     the Main queue.\n *  4. `RCTUnsafeExecuteOnUIManagerQueueSync` is smart enough to do the trick:\n *     It detects calling on the Main queue and in this case, instead of doing\n *     trivial *synchronous* dispatch, it does:\n *       - Block the Main queue;\n *       - Dispatch the special block on UIManager queue to block the queue and\n *         concurrent memory access;\n *       - Execute the given block on the Main queue;\n *       - Unblock the UIManager queue.\n *\n * Imagine the analogy: We have two queues: the Main one and UIManager one.\n * And these queues are two lanes of railway that go in parallel. Then,\n * at some point, we merge UIManager lane with the Main lane, and all cars use\n * the unified the Main lane.\n * And then we split lanes again.\n *\n * This solution assumes that the code running on UIManager queue will never\n * *explicitly* block the Main queue via calling `RCTUnsafeExecuteOnMainQueueSync`.\n * Otherwise, it can cause a deadlock.\n */\n\n/**\n * Returns UIManager queue.\n */\nRCT_EXTERN dispatch_queue_t RCTGetUIManagerQueue(void);\n\n/**\n * Default name for the UIManager queue.\n */\nRCT_EXTERN char *const RCTUIManagerQueueName;\n\n/**\n * Check if we are currently on UIManager queue.\n * Please do not use this unless you really know what you're doing.\n */\nRCT_EXTERN BOOL RCTIsUIManagerQueue(void);\n\n/**\n * Check if we are currently on Pseudo UIManager queue.\n * Please do not use this unless you really know what you're doing.\n */\nRCT_EXTERN BOOL RCTIsPseudoUIManagerQueue(void);\n\n/**\n * *Asynchronously* executes the specified block on the UIManager queue.\n * Unlike `dispatch_async()` this will execute the block immediately\n * if we're already on the UIManager queue.\n */\nRCT_EXTERN void RCTExecuteOnUIManagerQueue(dispatch_block_t block);\n\n/**\n * *Synchorously* executes the specified block on the UIManager queue.\n * Unlike `dispatch_sync()` this will execute the block immediately\n * if we're already on the UIManager queue.\n * Please do not use this unless you really know what you're doing.\n */\nRCT_EXTERN void RCTUnsafeExecuteOnUIManagerQueueSync(dispatch_block_t block);\n\n/**\n * Convenience macro for asserting that we're running on UIManager queue.\n */\n#define RCTAssertUIManagerQueue() RCTAssert(RCTIsUIManagerQueue() || RCTIsPseudoUIManagerQueue(), \\\n@\"This function must be called on the UIManager queue\")\n\n/**\n * Returns new unique root view tag.\n */\nRCT_EXTERN NSNumber *RCTAllocateRootViewTag(void);\n"
  },
  {
    "path": "React/Modules/RCTUIManagerUtils.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTUIManagerUtils.h\"\n\n#import <libkern/OSAtomic.h>\n\n#import \"RCTAssert.h\"\n\nchar *const RCTUIManagerQueueName = \"com.facebook.react.ShadowQueue\";\n\nstatic BOOL pseudoUIManagerQueueFlag = NO;\n\ndispatch_queue_t RCTGetUIManagerQueue(void)\n{\n  static dispatch_queue_t shadowQueue;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    if ([NSOperation instancesRespondToSelector:@selector(qualityOfService)]) {\n      dispatch_queue_attr_t attr = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INTERACTIVE, 0);\n      shadowQueue = dispatch_queue_create(RCTUIManagerQueueName, attr);\n    } else {\n      shadowQueue = dispatch_queue_create(RCTUIManagerQueueName, DISPATCH_QUEUE_SERIAL);\n      dispatch_set_target_queue(shadowQueue, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0));\n    }\n  });\n  return shadowQueue;\n}\n\nBOOL RCTIsUIManagerQueue()\n{\n  static void *queueKey = &queueKey;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    dispatch_queue_set_specific(RCTGetUIManagerQueue(), queueKey, queueKey, NULL);\n  });\n  return dispatch_get_specific(queueKey) == queueKey;\n}\n\nBOOL RCTIsPseudoUIManagerQueue()\n{\n  if (RCTIsMainQueue()) {\n    return pseudoUIManagerQueueFlag;\n  }\n\n  return NO;\n}\n\nvoid RCTExecuteOnUIManagerQueue(dispatch_block_t block)\n{\n  if (RCTIsUIManagerQueue() || RCTIsPseudoUIManagerQueue()) {\n    block();\n  } else {\n    dispatch_async(RCTGetUIManagerQueue(), ^{\n      block();\n    });\n  }\n}\n\nvoid RCTUnsafeExecuteOnUIManagerQueueSync(dispatch_block_t block)\n{\n  if (RCTIsUIManagerQueue() || RCTIsPseudoUIManagerQueue()) {\n    block();\n  } else {\n    if (RCTIsMainQueue()) {\n      dispatch_semaphore_t mainQueueBlockingSemaphore = dispatch_semaphore_create(0);\n      dispatch_semaphore_t uiManagerQueueBlockingSemaphore = dispatch_semaphore_create(0);\n\n      // Dispatching block which blocks UI Manager queue.\n      dispatch_async(RCTGetUIManagerQueue(), ^{\n        // Initiating `block` execution on main queue.\n        dispatch_semaphore_signal(mainQueueBlockingSemaphore);\n        // Waiting for finishing `block`.\n        dispatch_semaphore_wait(uiManagerQueueBlockingSemaphore, DISPATCH_TIME_FOREVER);\n      });\n\n      // Waiting for block on UIManager queue.\n      dispatch_semaphore_wait(mainQueueBlockingSemaphore, DISPATCH_TIME_FOREVER);\n      pseudoUIManagerQueueFlag = YES;\n      // `block` execution while UIManager queue is blocked by semaphore.\n      block();\n      pseudoUIManagerQueueFlag = NO;\n      // Signalling UIManager block.\n      dispatch_semaphore_signal(uiManagerQueueBlockingSemaphore);\n    } else {\n      dispatch_sync(RCTGetUIManagerQueue(), ^{\n        block();\n      });\n    }\n  }\n}\n\nNSNumber *RCTAllocateRootViewTag()\n{\n  // Numbering of these tags goes from 1, 11, 21, 31, ..., 100501, ...\n  static int64_t rootViewTagCounter = -1;\n  return @(OSAtomicIncrement64(&rootViewTagCounter) * 10 + 1);\n}\n"
  },
  {
    "path": "React/Profiler/RCTFPSGraph.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTDefines.h>\n\n#if RCT_DEV\n\n@interface RCTFPSGraph : NSView\n\n@property (nonatomic, assign, readonly) NSUInteger FPS;\n@property (nonatomic, assign, readonly) NSUInteger maxFPS;\n@property (nonatomic, assign, readonly) NSUInteger minFPS;\n\n- (instancetype)initWithFrame:(CGRect)frame\n                        color:(NSColor *)color NS_DESIGNATED_INITIALIZER;\n\n- (void)onTick:(NSTimeInterval)timestamp;\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/Profiler/RCTFPSGraph.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTFPSGraph.h\"\n#import \"QuartzCore/CAShapeLayer.h\"\n#import \"RCTAssert.h\"\n\n#if RCT_DEV\n\n@interface RCTFPSGraph()\n\n@property (nonatomic, strong, readonly) CAShapeLayer *graph;\n@property (nonatomic, strong, readonly) NSTextField *label;\n\n@end\n\n@implementation RCTFPSGraph\n{\n  CAShapeLayer *_graph;\n  NSTextField *_label;\n\n  CGFloat *_frames;\n  NSColor *_color;\n\n  NSTimeInterval _prevTime;\n  NSUInteger _frameCount;\n  NSUInteger _FPS;\n  NSUInteger _maxFPS;\n  NSUInteger _minFPS;\n  NSUInteger _length;\n  NSUInteger _height;\n}\n\n- (instancetype)initWithFrame:(CGRect)frame color:(NSColor *)color\n{\n  if ((self = [super initWithFrame:frame])) {\n    _frameCount = -1;\n    _prevTime = -1;\n    _maxFPS = 0;\n    _minFPS = 60;\n    _length = (NSUInteger)floor(frame.size.width);\n    _height = (NSUInteger)floor(frame.size.height);\n    _frames = calloc(sizeof(CGFloat), _length);\n    _color = color;\n\n    [self setWantsLayer:YES];\n    [self.layer addSublayer:self.graph];\n    [self addSubview:self.label];\n  }\n  return self;\n}\n\n- (void)dealloc\n{\n  free(_frames);\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (CAShapeLayer *)graph\n{\n  if (!_graph) {\n    _graph = [CAShapeLayer new];\n    _graph.frame = self.bounds;\n    _graph.backgroundColor = [_color colorWithAlphaComponent:0.2].CGColor;\n    _graph.fillColor = _color.CGColor;\n  }\n\n  return _graph;\n}\n\n- (NSTextField *)label\n{\n  if (!_label) {\n    _label = [[NSTextField alloc] initWithFrame:self.bounds];\n    _label.font = [NSFont boldSystemFontOfSize:13];\n    _label.alignment = NSTextAlignmentCenter;\n    _label.bezeled = NO;\n    _label.drawsBackground = NO;\n    _label.editable = NO;\n\n  }\n\n  return _label;\n}\n\n- (void)onTick:(NSTimeInterval)timestamp\n{\n  _frameCount++;\n  if (_prevTime == -1) {\n    _prevTime = timestamp;\n  } else if (timestamp - _prevTime >= 1) {\n    _FPS = round(_frameCount / (timestamp - _prevTime));\n    _minFPS = MIN(_minFPS, _FPS);\n    _maxFPS = MAX(_maxFPS, _FPS);\n\n    dispatch_async(dispatch_get_main_queue(), ^{\n      self->_label.stringValue = [NSString stringWithFormat:@\"%lu\", (unsigned long)self->_FPS];\n    });\n\n\n    CGFloat scale = 60.0 / _height;\n    for (NSUInteger i = 0; i < _length - 1; i++) {\n      _frames[i] = _frames[i + 1];\n    }\n    _frames[_length - 1] = _FPS / scale;\n\n    CGMutablePathRef path = CGPathCreateMutable();\n    CGPathMoveToPoint(path, NULL, 0, 0);\n    for (NSUInteger i = 0; i < _length; i++) {\n      CGPathAddLineToPoint(path, NULL, i, _frames[i]);\n    }\n    CGPathAddLineToPoint(path, NULL, _length - 1, 0);\n\n    _graph.path = path;\n    CGPathRelease(path);\n\n    _prevTime = timestamp;\n    _frameCount = 0;\n  }\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/Profiler/RCTJSCProfiler.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTJSCProfiler.h\"\n#import \"RCTLog.h\"\n#import <AppKit/AppKit.h>\n\n#import <React/RCTLog.h>\n\n#ifndef RCT_JSC_PROFILER\n#define RCT_JSC_PROFILER RCT_PROFILE\n#endif\n\n#if RCT_JSC_PROFILER\n\n#include <dlfcn.h>\n\n#ifndef RCT_JSC_PROFILER_DYLIB\n  #define RCT_JSC_PROFILER_DYLIB [[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@\"RCTJSCProfiler.macos%zd%zd%zd\", [[NSProcessInfo processInfo] operatingSystemVersion].majorVersion, [[NSProcessInfo processInfo] operatingSystemVersion].minorVersion] ofType:@\"dylib\" inDirectory:@\"RCTJSCProfiler\"] UTF8String]\n#endif\n\nstatic const char *const JSCProfileName = \"profile\";\n\ntypedef void (*JSCProfilerStartFunctionType)(JSContextRef, const char *);\ntypedef void (*JSCProfilerEndFunctionType)(JSContextRef, const char *, const char *);\ntypedef void (*JSCProfilerEnableFunctionType)(void);\n\nstatic NSMutableDictionary<NSValue *, NSNumber *> *RCTJSCProfilerStateMap;\n\nstatic JSCProfilerStartFunctionType RCTNativeProfilerStart  = NULL;\nstatic JSCProfilerEndFunctionType RCTNativeProfilerEnd    = NULL;\n\nNS_INLINE NSValue *RCTJSContextRefKey(JSContextRef ref) {\n  return [NSValue valueWithPointer:ref];\n}\n\nstatic void RCTJSCProfilerStateInit()\n{\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    RCTJSCProfilerStateMap = [NSMutableDictionary new];\n\n    void *JSCProfiler = dlopen(RCT_JSC_PROFILER_DYLIB, RTLD_NOW);\n\n    RCTNativeProfilerStart = (JSCProfilerStartFunctionType)dlsym(JSCProfiler, \"nativeProfilerStart\");\n    RCTNativeProfilerEnd =  (JSCProfilerEndFunctionType)dlsym(JSCProfiler, \"nativeProfilerEnd\");\n    JSCProfilerEnableFunctionType enableBytecode = (__typeof__(enableBytecode))dlsym(JSCProfiler, \"nativeProfilerEnableBytecode\");\n\n    if (RCTNativeProfilerStart && RCTNativeProfilerEnd && enableBytecode) {\n      enableBytecode();\n      RCTLogInfo(@\"JSC profiler is available.\");\n    } else {\n      RCTNativeProfilerStart = NULL;\n      RCTNativeProfilerEnd = NULL;\n      RCTLogInfo(@\"JSC profiler is not supported.\");\n    }\n  });\n}\n\n#endif\n\nvoid RCTJSCProfilerStart(JSContextRef ctx)\n{\n#if RCT_JSC_PROFILER\n  if (ctx != NULL) {\n    if (RCTJSCProfilerIsSupported()) {\n      NSValue *key = RCTJSContextRefKey(ctx);\n      BOOL isProfiling = [RCTJSCProfilerStateMap[key] boolValue];\n      if (!isProfiling) {\n        RCTLogInfo(@\"Starting JSC profiler for context: %p\", ctx);\n        RCTJSCProfilerStateMap[key] = @YES;\n        RCTNativeProfilerStart(ctx, JSCProfileName);\n      } else {\n        RCTLogWarn(@\"Trying to start JSC profiler on a context which is already profiled.\");\n      }\n    } else {\n      RCTLogWarn(@\"Cannot start JSC profiler as it's not supported.\");\n    }\n  } else {\n    RCTLogWarn(@\"Trying to start JSC profiler for NULL context.\");\n  }\n#endif\n}\n\nNSString *RCTJSCProfilerStop(JSContextRef ctx)\n{\n  NSString *outputFile = nil;\n#if RCT_JSC_PROFILER\n  if (ctx != NULL) {\n    RCTJSCProfilerStateInit();\n    NSValue *key = RCTJSContextRefKey(ctx);\n    BOOL isProfiling = [RCTJSCProfilerStateMap[key] boolValue];\n    if (isProfiling) {\n      NSString *filename = [NSString stringWithFormat:@\"cpu_profile_%ld.json\", (long)CFAbsoluteTimeGetCurrent()];\n      outputFile = [NSTemporaryDirectory() stringByAppendingPathComponent:filename];\n      if (RCTNativeProfilerEnd) {\n        RCTNativeProfilerEnd(ctx, JSCProfileName, outputFile.UTF8String);\n      }\n      RCTLogInfo(@\"Stopped JSC profiler for context: %p\", ctx);\n    } else {\n      RCTLogWarn(@\"Trying to stop JSC profiler on a context which is not being profiled.\");\n    }\n    [RCTJSCProfilerStateMap removeObjectForKey:key];\n  } else {\n    RCTLogWarn(@\"Trying to stop JSC profiler for NULL context.\");\n  }\n#endif\n  return outputFile;\n}\n\nBOOL RCTJSCProfilerIsProfiling(JSContextRef ctx)\n{\n  BOOL isProfiling = NO;\n#if RCT_JSC_PROFILER\n  if (ctx != NULL) {\n    RCTJSCProfilerStateInit();\n    isProfiling = [RCTJSCProfilerStateMap[RCTJSContextRefKey(ctx)] boolValue];\n  }\n#endif\n  return isProfiling;\n}\n\nBOOL RCTJSCProfilerIsSupported(void)\n{\n  BOOL isSupported = NO;\n#if RCT_JSC_PROFILER\n  RCTJSCProfilerStateInit();\n  isSupported = (RCTNativeProfilerStart != NULL);\n#endif\n  return isSupported;\n}\n"
  },
  {
    "path": "React/Profiler/RCTMacros.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#define _CONCAT(A, B) A##B\n#define CONCAT(A, B) _CONCAT(A, B)\n\n#if !defined(PIC_MODIFIER)\n#define PIC_MODIFIER\n#endif\n\n#define SYMBOL_NAME(name) CONCAT(__USER_LABEL_PREFIX__, name)\n#define SYMBOL_NAME_PIC(name) CONCAT(SYMBOL_NAME(name), PIC_MODIFIER)\n"
  },
  {
    "path": "React/Profiler/RCTPerfMonitor.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDefines.h\"\n\n#if RCT_DEV\n\n#import <dlfcn.h>\n\n#import <mach/mach.h>\n\n#import \"RCTBridge.h\"\n#import \"RCTDevSettings.h\"\n#import \"RCTFPSGraph.h\"\n#import \"RCTInvalidating.h\"\n#import \"RCTJavaScriptExecutor.h\"\n#import \"RCTPerformanceLogger.h\"\n#import \"RCTRootView.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTBridge+Private.h\"\n#import \"RCTUtils.h\"\n#import \"RCTDisplayLink.h\"\n\n#if __has_include(\"RCTDevMenu.h\")\n#import \"RCTDevMenu.h\"\n#endif\n\nstatic NSString *const RCTPerfMonitorCellIdentifier = @\"RCTPerfMonitorCellIdentifier\";\n\nstatic CGFloat const RCTPerfMonitorBarHeight = 50;\nstatic CGFloat const RCTPerfMonitorExpandHeight = 250;\n\ntypedef BOOL (*RCTJSCSetOptionType)(const char *);\n\nstatic BOOL RCTJSCSetOption(const char *option)\n{\n  static RCTJSCSetOptionType setOption;\n  static dispatch_once_t onceToken;\n\n  dispatch_once(&onceToken, ^{\n    /**\n     * JSC private C++ static method to toggle options at runtime\n     *\n     * JSC::Options::setOptions - JavaScriptCore/runtime/Options.h\n     */\n    setOption = dlsym(RTLD_DEFAULT, \"_ZN3JSC7Options9setOptionEPKc\");\n\n    if (RCT_DEBUG && setOption == NULL) {\n      RCTLogWarn(@\"The symbol used to enable JSC runtime options is not available in this iOS version\");\n    }\n  });\n\n  if (setOption) {\n    return setOption(option);\n  } else {\n    return NO;\n  }\n}\n\nstatic vm_size_t RCTGetResidentMemorySize(void)\n{\n  struct task_basic_info info;\n  mach_msg_type_number_t size = sizeof(info);\n  kern_return_t kerr = task_info(mach_task_self(),\n                                 TASK_BASIC_INFO,\n                                 (task_info_t)&info,\n                                 &size);\n  if (kerr != KERN_SUCCESS) {\n    return 0;\n  }\n\n  return info.resident_size;\n}\n\n@interface RCTPerfMonitor : NSObject <RCTBridgeModule, RCTInvalidating, NSTableViewDataSource, NSTableViewDelegate>\n\n@property (nonatomic, strong, readonly) RCTDevMenuItem *devMenuItem;\n@property (nonatomic, strong, readonly) NSView *container;\n@property (nonatomic, strong, readonly) NSTextField *memory;\n@property (nonatomic, strong, readonly) NSTextField *heap;\n@property (nonatomic, strong, readonly) NSTextField *views;\n@property (nonatomic, strong, readonly) NSTextField *layers;\n@property (nonatomic, strong, readonly) NSTableView *metrics;\n@property (nonatomic, strong, readonly) RCTFPSGraph *jsGraph;\n@property (nonatomic, strong, readonly) RCTFPSGraph *uiGraph;\n@property (nonatomic, strong, readonly) NSTextField *jsGraphLabel;\n@property (nonatomic, strong, readonly) NSTextField *uiGraphLabel;\n\n@end\n\n@implementation RCTPerfMonitor {\n#if __has_include(\"RCTDevMenu.h\")\n  RCTDevMenuItem *_devMenuItem;\n#endif\n  NSWindow *_window;\n  NSView *_container;\n  NSTextField *_memory;\n  NSTextField *_heap;\n  NSTextField *_views;\n  NSTextField *_layers;\n  NSTextField *_uiGraphLabel;\n  NSTextField *_jsGraphLabel;\n  NSTableView *_metrics;\n\n  RCTFPSGraph *_uiGraph;\n  RCTFPSGraph *_jsGraph;\n\n  NSTimer *_uiTimer;\n  NSTimer *_jsTimer;\n\n  NSUInteger _heapSize;\n\n  dispatch_queue_t _queue;\n  dispatch_io_t _io;\n  int _stderr;\n  int _pipe[2];\n  NSString *_remaining;\n\n  CGRect _storedMonitorFrame;\n\n  NSArray *_perfLoggerMarks;\n}\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES;\n}\n\n- (dispatch_queue_t)methodQueue\n{\n  return dispatch_get_main_queue();\n}\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  _bridge = bridge;\n\n#if __has_include(\"RCTDevMenu.h\")\n  [_bridge.devMenu addItem:self.devMenuItem];\n#endif\n}\n\n- (void)invalidate\n{\n  [self hide];\n}\n\n#if __has_include(\"RCTDevMenu.h\")\n- (RCTDevMenuItem *)devMenuItem\n{\n  if (!_devMenuItem) {\n    __weak __typeof__(self) weakSelf = self;\n    __weak RCTDevSettings *devSettings = self.bridge.devSettings;\n    _devMenuItem =\n    [RCTDevMenuItem buttonItemWithTitleBlock:^NSString *{\n      return (devSettings.isPerfMonitorShown) ?\n        @\"Hide Perf Monitor\" :\n        @\"Show Perf Monitor\";\n    } handler:^{\n      if (devSettings.isPerfMonitorShown) {\n        [weakSelf hide];\n        devSettings.isPerfMonitorShown = NO;\n      } else {\n        [weakSelf show];\n        devSettings.isPerfMonitorShown = YES;\n      }\n    }];\n  }\n\n  return _devMenuItem;\n}\n#endif\n\n- (NSView *)container\n{\n  if (!_container) {\n    _container = [[NSView alloc] initWithFrame:CGRectMake(10, 50, 280, RCTPerfMonitorBarHeight)];\n    _container.layer.backgroundColor = [[NSColor whiteColor] CGColor];\n    _container.layer.borderWidth = 1;\n    _container.layer.borderColor = [NSColor lightGrayColor].CGColor;\n  }\n\n  return _container;\n}\n\n- (NSTextField *)memory\n{\n  if (!_memory) {\n    _memory = [[NSTextField alloc] initWithFrame:CGRectMake(0, 0, 44, RCTPerfMonitorBarHeight)];\n    _memory.font = [NSFont systemFontOfSize:10];\n    _memory.alignment = NSTextAlignmentCenter;\n    _memory.editable = NO;\n    _memory.drawsBackground = NO;\n    _memory.bezeled = NO;\n  }\n\n  return _memory;\n}\n\n- (NSTextField *)heap\n{\n  if (!_heap) {\n    _heap = [[NSTextField alloc] initWithFrame:CGRectMake(44, 0, 44, RCTPerfMonitorBarHeight)];\n    _heap.font = [NSFont systemFontOfSize:10];\n    _heap.alignment = NSCenterTextAlignment;\n    _heap.editable = NO;\n    _heap.drawsBackground = NO;\n    _heap.bezeled = NO;\n  }\n\n  return _heap;\n}\n\n- (NSTextField *)views\n{\n  if (!_views) {\n    _views = [[NSTextField alloc] initWithFrame:CGRectMake(88, 0, 44, RCTPerfMonitorBarHeight)];\n    _views.font = [NSFont systemFontOfSize:10];\n    _views.alignment = NSTextAlignmentCenter;\n    _views.editable = NO;\n    _views.drawsBackground = NO;\n    _views.bezeled = NO;\n  }\n\n  return _views;\n}\n\n- (NSTextField *)layers\n{\n  if (!_layers) {\n    _layers = [[NSTextField alloc] initWithFrame:CGRectMake(132, 0, 44, RCTPerfMonitorBarHeight)];\n    _layers.font = [NSFont systemFontOfSize:10];\n    _layers.alignment = NSTextAlignmentCenter;\n    _layers.editable = NO;\n    _layers.drawsBackground = NO;\n    _layers.bezeled = NO;\n  }\n  return _layers;\n}\n\n- (RCTFPSGraph *)uiGraph\n{\n  if (!_uiGraph) {\n    _uiGraph = [[RCTFPSGraph alloc] initWithFrame:CGRectMake(174, self.container.frame.size.height - 45, 40, 30)\n                                            color:[NSColor lightGrayColor]];\n  }\n  return _uiGraph;\n}\n\n- (RCTFPSGraph *)jsGraph\n{\n  if (!_jsGraph) {\n    _jsGraph = [[RCTFPSGraph alloc] initWithFrame:CGRectMake(218, self.container.frame.size.height - 75, 40, 30)\n                                            color:[NSColor lightGrayColor]];\n  }\n  return _jsGraph;\n}\n\n- (NSTextField *)uiGraphLabel\n{\n  if (!_uiGraphLabel) {\n    _uiGraphLabel = [[NSTextField alloc] initWithFrame:CGRectMake(174, self.container.frame.size.height - 10, 40, 10)];\n    _uiGraphLabel.font = [NSFont systemFontOfSize:10];\n    _uiGraphLabel.alignment = NSTextAlignmentCenter;\n    _uiGraphLabel.stringValue = @\"UI\";\n    _uiGraphLabel.editable = NO;\n    _uiGraphLabel.bezeled = NO;\n    _uiGraphLabel.drawsBackground = NO;\n  }\n\n  return _uiGraphLabel;\n}\n\n- (NSTextField *)jsGraphLabel\n{\n  if (!_jsGraphLabel) {\n    _jsGraphLabel = [[NSTextField alloc] initWithFrame:CGRectMake(218, self.container.frame.size.height - 40, 38, 10)];\n    _jsGraphLabel.font = [NSFont systemFontOfSize:10];\n    _jsGraphLabel.alignment = NSTextAlignmentCenter;\n    _jsGraphLabel.stringValue = @\"JS\";\n    _jsGraphLabel.editable = NO;\n    _jsGraphLabel.bezeled = NO;\n    _jsGraphLabel.drawsBackground = NO;\n  }\n\n  return _jsGraphLabel;\n}\n\n- (NSTableView *)metrics\n{\n  if (!_metrics) {\n    _metrics = [[NSTableView alloc] initWithFrame:CGRectMake(\n      0,\n      RCTPerfMonitorBarHeight,\n      self.container.frame.size.width,\n      self.container.frame.size.height - RCTPerfMonitorBarHeight\n    )];\n    _metrics.dataSource = self;\n    _metrics.delegate = self;\n    _metrics.autoresizingMask = NSViewHeightSizable | NSViewWidthSizable;\n    //[_metrics registerClass:[NSTableViewCell class] forCellReuseIdentifier:RCTPerfMonitorCellIdentifier];\n  }\n\n  return _metrics;\n}\n\n- (void)show\n{\n  if (_container) {\n    return;\n  }\n\n  [self.container addSubview:self.memory];\n  [self.container addSubview:self.heap];\n  [self.container addSubview:self.views];\n  [self.container addSubview:self.layers];\n  [self.container addSubview:self.uiGraph];\n  [self.container addSubview:self.uiGraphLabel];\n\n  [self redirectLogs];\n\n  RCTJSCSetOption(\"logGC=1\");\n\n  [self updateStats];\n\n  NSRect frame = NSMakeRect(100, 100, self.container.frame.size.width, self.container.frame.size.height + 30);\n\n  _window = [[NSWindow alloc] initWithContentRect:frame\n                                                 styleMask:NSTitledWindowMask |  NSClosableWindowMask | NSFullSizeContentViewWindowMask\n                                                   backing:NSBackingStoreBuffered\n                                                     defer:NO];\n  NSWindowController *windowController = [[NSWindowController alloc] initWithWindow:_window];\n  [_window setContentView:self.container];\n  [_window setTitle:@\"Perf Monitor\"];\n  [_window setHidesOnDeactivate:NO];\n  [_window setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantLight ]];\n  [windowController showWindow:_window];\n\n\n  _uiTimer = [NSTimer\n              timerWithTimeInterval:RCT_TIME_PER_FRAME\n              target:self\n              selector:@selector(threadUpdate:)\n              userInfo:nil\n              repeats:YES];\n  [[NSRunLoop mainRunLoop] addTimer:_uiTimer forMode:NSRunLoopCommonModes];\n  \n  \n  [_bridge dispatchBlock:^{\n    _jsTimer = [NSTimer\n                timerWithTimeInterval:RCT_TIME_PER_FRAME\n                target:self\n                selector:@selector(threadUpdate:)\n                userInfo:nil\n                repeats:YES];\n    [[NSRunLoop mainRunLoop] addTimer:_jsTimer forMode:NSRunLoopCommonModes];\n  } queue:RCTJSThread];\n}\n\n- (void)hide\n{\n  if (!_container) {\n    return;\n  }\n\n  [self.container removeFromSuperview];\n  _container = nil;\n  _jsGraph = nil;\n  _uiGraph = nil;\n\n  RCTJSCSetOption(\"logGC=0\");\n\n  [self stopLogs];\n  [_window close];\n}\n\n- (void)redirectLogs\n{\n  _stderr = dup(STDERR_FILENO);\n\n  if (pipe(_pipe) != 0) {\n    return;\n  }\n\n  dup2(_pipe[1], STDERR_FILENO);\n  close(_pipe[1]);\n\n  __weak __typeof__(self) weakSelf = self;\n  _queue = dispatch_queue_create(\"com.facebook.react.RCTPerfMonitor\", DISPATCH_QUEUE_SERIAL);\n  _io = dispatch_io_create(\n    DISPATCH_IO_STREAM,\n    _pipe[0],\n    _queue,\n    ^(__unused int error) {});\n\n  dispatch_io_set_low_water(_io, 20);\n\n  dispatch_io_read(\n    _io,\n    0,\n    SIZE_MAX,\n    _queue,\n    ^(__unused bool done, dispatch_data_t data, __unused int error) {\n      if (!data) {\n        return;\n    }\n\n      dispatch_data_apply(\n        data,\n        ^bool(\n          __unused dispatch_data_t region,\n          __unused size_t offset,\n          const void *buffer,\n          size_t size\n        ) {\n          write(self->_stderr, buffer, size);\n\n          NSString *log = [[NSString alloc] initWithBytes:buffer\n                                                   length:size\n                                                 encoding:NSUTF8StringEncoding];\n          [weakSelf parse:log];\n          return true;\n        });\n    });\n}\n\n- (void)stopLogs\n{\n  dup2(_stderr, STDERR_FILENO);\n  dispatch_io_close(_io, 0);\n}\n\n- (void)parse:(NSString *)log\n{\n  static NSRegularExpression *GCRegex;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    NSString *pattern = @\"\\\\[GC: [\\\\d\\\\.]+ \\\\wb => (Eden|Full)Collection, (?:Skipped copying|Did copy), ([\\\\d\\\\.]+) \\\\wb, [\\\\d.]+ \\\\ws\\\\]\";\n    GCRegex = [NSRegularExpression regularExpressionWithPattern:pattern\n                                                        options:0\n                                                          error:nil];\n  });\n\n  if (_remaining) {\n    log = [_remaining stringByAppendingString:log];\n    _remaining = nil;\n  }\n\n  NSArray<NSString *> *lines = [log componentsSeparatedByString:@\"\\n\"];\n  if (lines.count == 1) { // no newlines\n    _remaining = log;\n    return;\n  }\n\n  for (NSString *line in lines) {\n    NSTextCheckingResult *match = [GCRegex firstMatchInString:line options:0 range:NSMakeRange(0, line.length)];\n    if (match) {\n      NSString *heapSizeStr = [line substringWithRange:[match rangeAtIndex:2]];\n      _heapSize = [heapSizeStr integerValue];\n    }\n  }\n}\n\n- (void)updateStats\n{\n  NSDictionary<NSNumber *, NSView *> *views = [_bridge.uiManager valueForKey:@\"viewRegistry\"];\n  NSUInteger viewCount = views.count;\n  NSUInteger visibleViewCount = 0;\n  NSUInteger layerBackedCount = 0;\n  NSUInteger layersCount = 0;\n  for (NSView *view in views.allValues) {\n    if (view.window || view.superview.window) {\n      visibleViewCount++;\n    }\n    if (view.wantsLayer) {\n      layerBackedCount++;\n    }\n    if (view.layer) {\n      layersCount++;\n    }\n  }\n\n  double mem = (double)RCTGetResidentMemorySize() / 1024 / 1024;\n  self.memory.stringValue  =[NSString stringWithFormat:@\"RAM\\n%.2lf\\nMB\", mem];\n  self.heap.stringValue = [NSString stringWithFormat:@\"JSC\\n%.2lf\\nMB\", (double)_heapSize / 1024];\n  self.views.stringValue = [NSString stringWithFormat:@\"Views\\n%lu\\n%lu\", (unsigned long)visibleViewCount, (unsigned long)viewCount];\n  self.layers.stringValue = [NSString stringWithFormat:@\"Layers\\n%lu\\n%lu\", (unsigned long)layerBackedCount, (unsigned long)layersCount];\n\n  __weak __typeof__(self) weakSelf = self;\n  dispatch_after(\n    dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)),\n    dispatch_get_main_queue(),\n    ^{\n      __strong __typeof__(weakSelf) strongSelf = weakSelf;\n      if (strongSelf && strongSelf->_container.superview) {\n        [strongSelf updateStats];\n      }\n    });\n}\n\n- (void)tap\n{\n  [self loadPerformanceLoggerData];\n  if (CGRectIsEmpty(_storedMonitorFrame)) {\n    _storedMonitorFrame = CGRectMake(0, 20, self.container.window.frame.size.width, RCTPerfMonitorExpandHeight);\n    [self.container addSubview:self.metrics];\n  } else {\n    [_metrics reloadData];\n  }\n\n  // [NSView animateWithDuration:.25 animations:^{\n    CGRect tmp = self.container.frame;\n    self.container.frame = self->_storedMonitorFrame;\n    self->_storedMonitorFrame = tmp;\n  // }];\n}\n\n- (void)threadUpdate:(id)sender\n{\n  RCTFPSGraph *graph = sender == _jsTimer ? _jsGraph : _uiGraph;\n  [graph onTick:CACurrentMediaTime()];\n}\n\n- (void)loadPerformanceLoggerData\n{\n  NSUInteger i = 0;\n  NSMutableArray<NSString *> *data = [NSMutableArray new];\n  RCTPerformanceLogger *performanceLogger = [_bridge performanceLogger];\n  NSArray<NSNumber *> *values = [performanceLogger valuesForTags];\n  for (NSString *label in [performanceLogger labelsForTags]) {\n    long long value = values[i+1].longLongValue - values[i].longLongValue;\n    NSString *unit = @\"ms\";\n    if ([label hasSuffix:@\"Size\"]) {\n      unit = @\"b\";\n    } else if ([label hasSuffix:@\"Count\"]) {\n      unit = @\"\";\n    }\n    [data addObject:[NSString stringWithFormat:@\"%@: %lld%@\", label, value, unit]];\n    i += 2;\n  }\n  _perfLoggerMarks = [data copy];\n}\n\n#pragma mark - NSTableViewDataSource\n\n- (NSInteger)numberOfSectionsInTableView:(__unused NSTableView *)tableView\n{\n  return 1;\n}\n\n- (NSInteger)tableView:(__unused NSTableView *)tableView\n numberOfRowsInSection:(__unused NSInteger)section\n{\n  return _perfLoggerMarks.count;\n}\n\n//- (NSTableViewCell *)tableView:(NSTableView *)tableView\n//         cellForRowAtIndexPath:(NSIndexPath *)indexPath\n//{\n//  NSTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:RCTPerfMonitorCellIdentifier\n//                                                          forIndexPath:indexPath];\n//\n//  if (!cell) {\n//    cell = [[NSTableViewCell alloc] initWithStyle:NSTableViewCellStyleDefault\n//                                  reuseIdentifier:RCTPerfMonitorCellIdentifier];\n//  }\n//\n//  cell.textLabel.text = _perfLoggerMarks[indexPath.row];\n//  cell.textLabel.font = [NSFont systemFontOfSize:12];\n//\n//  return cell;\n//}\n\n#pragma mark - NSTableViewDelegate\n\n- (CGFloat)tableView:(__unused NSTableView *)tableView\nheightForRowAtIndexPath:(__unused NSIndexPath *)indexPath\n{\n  return 20;\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "React/Profiler/RCTProfile.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTAssert.h>\n#import <React/RCTDefines.h>\n\n/**\n * RCTProfile\n *\n * This file provides a set of functions and macros for performance profiling\n *\n * NOTE: This API is a work in progress, please consider carefully before\n * using it.\n */\n\nRCT_EXTERN NSString *const RCTProfileDidStartProfiling;\nRCT_EXTERN NSString *const RCTProfileDidEndProfiling;\n\nRCT_EXTERN const uint64_t RCTProfileTagAlways;\n\n#if RCT_PROFILE\n\n@class RCTBridge;\n\n#define RCTProfileBeginFlowEvent() \\\n_Pragma(\"clang diagnostic push\") \\\n_Pragma(\"clang diagnostic ignored \\\"-Wshadow\\\"\") \\\nNSUInteger __rct_profile_flow_id = _RCTProfileBeginFlowEvent(); \\\n_Pragma(\"clang diagnostic pop\")\n\n#define RCTProfileEndFlowEvent() \\\n_RCTProfileEndFlowEvent(__rct_profile_flow_id)\n\nRCT_EXTERN dispatch_queue_t RCTProfileGetQueue(void);\n\nRCT_EXTERN NSUInteger _RCTProfileBeginFlowEvent(void);\nRCT_EXTERN void _RCTProfileEndFlowEvent(NSUInteger);\n\n/**\n * Returns YES if the profiling information is currently being collected\n */\nRCT_EXTERN BOOL RCTProfileIsProfiling(void);\n\n/**\n * Start collecting profiling information\n */\nRCT_EXTERN void RCTProfileInit(RCTBridge *);\n\n/**\n * Stop profiling and return a JSON string of the collected data - The data\n * returned is compliant with google's trace event format - the format used\n * as input to trace-viewer\n */\nRCT_EXTERN void RCTProfileEnd(RCTBridge *, void (^)(NSString *));\n\n/**\n * Collects the initial event information for the event and returns a reference ID\n */\nRCT_EXTERN void _RCTProfileBeginEvent(NSThread *calleeThread,\n                                      NSTimeInterval time,\n                                      uint64_t tag,\n                                      NSString *name,\n                                      NSDictionary<NSString *, NSString *> *args);\n#define RCT_PROFILE_BEGIN_EVENT(tag, name, args) \\\n  do { \\\n    if (RCTProfileIsProfiling()) { \\\n      NSThread *__calleeThread = [NSThread currentThread]; \\\n      NSTimeInterval __time = CACurrentMediaTime(); \\\n      _RCTProfileBeginEvent(__calleeThread, __time, tag, name, args); \\\n    } \\\n  } while(0)\n\n/**\n * The ID returned by BeginEvent should then be passed into EndEvent, with the\n * rest of the event information. Just at this point the event will actually be\n * registered\n */\nRCT_EXTERN void _RCTProfileEndEvent(NSThread *calleeThread,\n                                    NSString *threadName,\n                                    NSTimeInterval time,\n                                    uint64_t tag,\n                                    NSString *category);\n\n#define RCT_PROFILE_END_EVENT(tag, category) \\\n  do { \\\n    if (RCTProfileIsProfiling()) { \\\n      NSThread *__calleeThread = [NSThread currentThread]; \\\n      NSString *__threadName = RCTCurrentThreadName(); \\\n      NSTimeInterval __time = CACurrentMediaTime(); \\\n      _RCTProfileEndEvent(__calleeThread, __threadName, __time, tag, category); \\\n    } \\\n  } while(0)\n\n/**\n * Collects the initial event information for the event and returns a reference ID\n */\nRCT_EXTERN NSUInteger RCTProfileBeginAsyncEvent(uint64_t tag,\n                                                NSString *name,\n                                                NSDictionary<NSString *, NSString *> *args);\n\n/**\n * The ID returned by BeginEvent should then be passed into EndEvent, with the\n * rest of the event information. Just at this point the event will actually be\n * registered\n */\nRCT_EXTERN void RCTProfileEndAsyncEvent(uint64_t tag,\n                                        NSString *category,\n                                        NSUInteger cookie,\n                                        NSString *name,\n                                        NSString *threadName);\n\n/**\n * An event that doesn't have a duration (i.e. Notification, VSync, etc)\n */\nRCT_EXTERN void RCTProfileImmediateEvent(uint64_t tag,\n                                         NSString *name,\n                                         NSTimeInterval time,\n                                         char scope);\n\n/**\n * Helper to profile the duration of the execution of a block. This method uses\n * self and _cmd to name this event for simplicity sake.\n *\n * NOTE: The block can't expect any argument\n *\n * DEPRECATED: this approach breaks debugging and stepping through instrumented block functions\n */\n#define RCTProfileBlock(block, tag, category, arguments) \\\n^{ \\\n  RCT_PROFILE_BEGIN_EVENT(tag, @(__PRETTY_FUNCTION__), nil); \\\n  block(); \\\n  RCT_PROFILE_END_EVENT(tag, category, arguments); \\\n}\n\n/**\n * Hook into a bridge instance to log all bridge module's method calls\n */\nRCT_EXTERN void RCTProfileHookModules(RCTBridge *);\n\n/**\n * Unhook from a given bridge instance's modules\n */\nRCT_EXTERN void RCTProfileUnhookModules(RCTBridge *);\n\n/**\n * Hook into all of a module's methods\n */\nRCT_EXTERN void RCTProfileHookInstance(id instance);\n\n/**\n * Send systrace or cpu profiling information to the packager\n * to present to the user\n */\nRCT_EXTERN void RCTProfileSendResult(RCTBridge *bridge, NSString *route, NSData *profileData);\n\n/**\n * Systrace gluecode\n *\n * allow to use systrace to back RCTProfile\n */\n\ntypedef struct {\n  const char *key;\n  int key_len;\n  const char *value;\n  int value_len;\n} systrace_arg_t;\n\ntypedef struct {\n  char *(*start)(void);\n  void (*stop)(void);\n\n  void (*begin_section)(uint64_t tag, const char *name, size_t numArgs, systrace_arg_t *args);\n  void (*end_section)(uint64_t tag, size_t numArgs, systrace_arg_t *args);\n\n  void (*begin_async_section)(uint64_t tag, const char *name, int cookie, size_t numArgs, systrace_arg_t *args);\n  void (*end_async_section)(uint64_t tag, const char *name, int cookie, size_t numArgs, systrace_arg_t *args);\n\n  void (*instant_section)(uint64_t tag, const char *name, char scope);\n\n  void (*begin_async_flow)(uint64_t tag, const char *name, int cookie);\n  void (*end_async_flow)(uint64_t tag, const char *name, int cookie);\n} RCTProfileCallbacks;\n\nRCT_EXTERN void RCTProfileRegisterCallbacks(RCTProfileCallbacks *);\n\n/**\n * Systrace control window\n */\nRCT_EXTERN void RCTProfileShowControls(void);\nRCT_EXTERN void RCTProfileHideControls(void);\n\n#else\n\n#define RCTProfileBeginFlowEvent()\n#define _RCTProfileBeginFlowEvent() @0\n\n#define RCTProfileEndFlowEvent()\n#define _RCTProfileEndFlowEvent(...)\n\n#define RCTProfileIsProfiling(...) NO\n#define RCTProfileInit(...)\n#define RCTProfileEnd(...) @\"\"\n\n#define _RCTProfileBeginEvent(...)\n#define _RCTProfileEndEvent(...)\n\n#define RCT_PROFILE_BEGIN_EVENT(...)\n#define RCT_PROFILE_END_EVENT(...)\n\n#define RCTProfileBeginAsyncEvent(...) 0\n#define RCTProfileEndAsyncEvent(...)\n\n#define RCTProfileImmediateEvent(...)\n\n#define RCTProfileBlock(block, ...) block\n\n#define RCTProfileHookModules(...)\n#define RCTProfileHookInstance(...)\n#define RCTProfileUnhookModules(...)\n\n#define RCTProfileSendResult(...)\n\n#define RCTProfileShowControls(...)\n#define RCTProfileHideControls(...)\n\n#endif\n"
  },
  {
    "path": "React/Profiler/RCTProfile.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTProfile.h\"\n\n#import <dlfcn.h>\n#import <mach/mach.h>\n#import <objc/message.h>\n#import <objc/runtime.h>\n#import <stdatomic.h>\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge+Private.h\"\n#import \"RCTBridge.h\"\n#import \"RCTComponentData.h\"\n#import \"RCTDefines.h\"\n#import \"RCTLog.h\"\n#import \"RCTModuleData.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTUIManagerUtils.h\"\n#import \"RCTUtils.h\"\n\nNSString *const RCTProfileDidStartProfiling = @\"RCTProfileDidStartProfiling\";\nNSString *const RCTProfileDidEndProfiling = @\"RCTProfileDidEndProfiling\";\n\nconst uint64_t RCTProfileTagAlways = 1L << 0;\n\n#if RCT_PROFILE\n\n#pragma mark - Constants\n\nstatic NSString *const kProfileTraceEvents = @\"traceEvents\";\nstatic NSString *const kProfileSamples = @\"samples\";\nstatic NSString *const kProfilePrefix = @\"rct_profile_\";\n\n#pragma mark - Variables\n\nstatic atomic_bool RCTProfileProfiling = ATOMIC_VAR_INIT(NO);\n\nstatic NSDictionary *RCTProfileInfo;\nstatic NSMutableDictionary *RCTProfileOngoingEvents;\nstatic NSTimeInterval RCTProfileStartTime;\nstatic NSUInteger RCTProfileEventID = 0;\n\nstatic NSTimer *RCTProfileDisplayLink; // TODO: consider DisplayLink\nstatic __weak RCTBridge *_RCTProfilingBridge;\nstatic NSWindow *RCTProfileControlsWindow;\n\n\n#pragma mark - Macros\n\n#define RCTProfileAddEvent(type, props...) \\\n[RCTProfileInfo[type] addObject:@{ \\\n  @\"pid\": @([[NSProcessInfo processInfo] processIdentifier]), \\\n  props \\\n}];\n\n#define CHECK(...) \\\nif (!RCTProfileIsProfiling()) { \\\n  return __VA_ARGS__; \\\n}\n\n#pragma mark - systrace glue code\n\nstatic RCTProfileCallbacks *callbacks;\nstatic char *systrace_buffer;\n\nstatic systrace_arg_t *newSystraceArgsFromDictionary(NSDictionary<NSString *, NSString *> *args)\n{\n  if (args.count == 0) {\n    return NULL;\n  }\n\n  systrace_arg_t *systrace_args = malloc(sizeof(systrace_arg_t) * args.count);\n  __block size_t i = 0;\n  [args enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, __unused BOOL *stop) {\n    systrace_args[i].key = [key UTF8String];\n    systrace_args[i].key_len = [key length];\n    systrace_args[i].value = [value UTF8String];\n    systrace_args[i].value_len = [value length];\n    i++;\n  }];\n  return systrace_args;\n}\n\nvoid RCTProfileRegisterCallbacks(RCTProfileCallbacks *cb)\n{\n  callbacks = cb;\n}\n\n#pragma mark - Private Helpers\n\nstatic RCTBridge *RCTProfilingBridge(void)\n{\n  return _RCTProfilingBridge ?: [RCTBridge currentBridge];\n}\n\nstatic NSNumber *RCTProfileTimestamp(NSTimeInterval timestamp)\n{\n  return @((timestamp - RCTProfileStartTime) * 1e6);\n}\n\nstatic NSString *RCTProfileMemory(vm_size_t memory)\n{\n  double mem = ((double)memory) / 1024 / 1024;\n  return [NSString stringWithFormat:@\"%.2lfmb\", mem];\n}\n\nstatic NSDictionary *RCTProfileGetMemoryUsage(void)\n{\n  struct task_basic_info info;\n  mach_msg_type_number_t size = sizeof(info);\n  kern_return_t kerr = task_info(mach_task_self(),\n                                 TASK_BASIC_INFO,\n                                 (task_info_t)&info,\n                                 &size);\n  if ( kerr == KERN_SUCCESS ) {\n    return @{\n      @\"suspend_count\": @(info.suspend_count),\n      @\"virtual_size\": RCTProfileMemory(info.virtual_size),\n      @\"resident_size\": RCTProfileMemory(info.resident_size),\n    };\n  } else {\n    return @{};\n  }\n}\n\n#pragma mark - Module hooks\n\nstatic const char *RCTProfileProxyClassName(Class class)\n{\n  return [kProfilePrefix stringByAppendingString:NSStringFromClass(class)].UTF8String;\n}\n\nstatic dispatch_group_t RCTProfileGetUnhookGroup(void)\n{\n  static dispatch_group_t unhookGroup;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    unhookGroup = dispatch_group_create();\n  });\n\n  return unhookGroup;\n}\n\n// Used by RCTProfileTrampoline assembly file to call libc`malloc\nRCT_EXTERN void *RCTProfileMalloc(size_t size);\nvoid *RCTProfileMalloc(size_t size)\n{\n  return malloc(size);\n}\n\n// Used by RCTProfileTrampoline assembly file to call libc`free\nRCT_EXTERN void RCTProfileFree(void *buf);\nvoid RCTProfileFree(void *buf)\n{\n  free(buf);\n}\n\nRCT_EXTERN IMP RCTProfileGetImplementation(id obj, SEL cmd);\nIMP RCTProfileGetImplementation(id obj, SEL cmd)\n{\n  return class_getMethodImplementation([obj class], cmd);\n}\n\n/**\n * For the profiling we have to execute some code before and after every\n * function being profiled, the only way of doing that with pure Objective-C is\n * by using `-forwardInvocation:`, which is slow and could skew the profile\n * results.\n *\n * The alternative in assembly is much simpler, we just need to store all the\n * state at the beginning of the function, start the profiler, restore all the\n * state, call the actual function we want to profile and stop the profiler.\n *\n * The implementation can be found in RCTProfileTrampoline-<arch>.s where arch\n * is one of: i386, x86_64, arm, arm64.\n */\n#if defined(__i386__) || \\\n    defined(__x86_64__) || \\\n    defined(__arm__) || \\\n    defined(__arm64__)\n\n  RCT_EXTERN void RCTProfileTrampoline(void);\n#else\n  static void *RCTProfileTrampoline = NULL;\n#endif\n\nRCT_EXTERN void RCTProfileTrampolineStart(id, SEL);\nvoid RCTProfileTrampolineStart(id self, SEL cmd)\n{\n  /**\n   * This call might be during dealloc, so we shouldn't retain the object in the\n   * block.\n   */\n  Class klass = [self class];\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, ([NSString stringWithFormat:@\"-[%s %s]\", class_getName(klass), sel_getName(cmd)]), nil);\n}\n\nRCT_EXTERN void RCTProfileTrampolineEnd(void);\nvoid RCTProfileTrampolineEnd(void)\n{\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"objc_call,modules,auto\");\n}\n\nstatic NSView *(*originalCreateView)(RCTComponentData *, SEL, NSNumber *);\nstatic NSView *RCTProfileCreateView(RCTComponentData *self, SEL _cmd, NSNumber *tag)\n{\n  NSView *view = originalCreateView(self, _cmd, tag);\n  RCTProfileHookInstance(view);\n  return view;\n}\n\nstatic void RCTProfileHookUIManager(RCTUIManager *uiManager)\n{\n  dispatch_async(dispatch_get_main_queue(), ^{\n    for (id view in [uiManager valueForKey:@\"viewRegistry\"]) {\n      RCTProfileHookInstance([uiManager viewForReactTag:view]);\n    }\n\n    Method createView = class_getInstanceMethod([RCTComponentData class], @selector(createViewWithTag:));\n\n    if (method_getImplementation(createView) != (IMP)RCTProfileCreateView) {\n      originalCreateView = (typeof(originalCreateView))method_getImplementation(createView);\n      method_setImplementation(createView, (IMP)RCTProfileCreateView);\n    }\n  });\n}\n\nvoid RCTProfileHookInstance(id instance)\n{\n  Class moduleClass = object_getClass(instance);\n\n  /**\n   * We swizzle the instance -class method to return the original class, but\n   * object_getClass will return the actual class.\n   *\n   * If they are different, it means that the object is returning the original\n   * class, but it's actual class is the proxy subclass we created.\n   */\n  if ([instance class] != moduleClass) {\n    return;\n  }\n\n  Class proxyClass = objc_allocateClassPair(moduleClass, RCTProfileProxyClassName(moduleClass), 0);\n\n  if (!proxyClass) {\n    proxyClass = objc_getClass(RCTProfileProxyClassName(moduleClass));\n    if (proxyClass) {\n      object_setClass(instance, proxyClass);\n    }\n    return;\n  }\n\n  unsigned int methodCount;\n  Method *methods = class_copyMethodList(moduleClass, &methodCount);\n  for (NSUInteger i = 0; i < methodCount; i++) {\n    Method method = methods[i];\n    SEL selector = method_getName(method);\n\n    /**\n     * Bail out on struct returns (except arm64) - we don't use it enough\n     * to justify writing a stret version\n     */\n#ifdef __arm64__\n    BOOL returnsStruct = NO;\n#else\n    const char *typeEncoding = method_getTypeEncoding(method);\n    // bail out on structs and unions (since they might contain structs)\n    BOOL returnsStruct = typeEncoding[0] == '{' || typeEncoding[0] == '(';\n#endif\n\n    /**\n     * Avoid hooking into NSObject methods, methods generated by React Native\n     * and special methods that start `.` (e.g. .cxx_destruct)\n     */\n    if ([NSStringFromSelector(selector) hasPrefix:@\"rct\"] || [NSObject instancesRespondToSelector:selector] || sel_getName(selector)[0] == '.' || returnsStruct) {\n      continue;\n    }\n\n    const char *types = method_getTypeEncoding(method);\n    class_addMethod(proxyClass, selector, (IMP)RCTProfileTrampoline, types);\n  }\n  free(methods);\n\n  class_replaceMethod(object_getClass(proxyClass), @selector(initialize), imp_implementationWithBlock(^{}), \"v@:\");\n\n  for (Class cls in @[proxyClass, object_getClass(proxyClass)]) {\n    Method oldImp = class_getInstanceMethod(cls, @selector(class));\n    class_replaceMethod(cls, @selector(class), imp_implementationWithBlock(^{ return moduleClass; }), method_getTypeEncoding(oldImp));\n  }\n\n  objc_registerClassPair(proxyClass);\n  object_setClass(instance, proxyClass);\n}\n\nstatic NSView *(*originalCreateView)(RCTComponentData *, SEL, NSNumber *);\n\nvoid RCTProfileHookModules(RCTBridge *bridge)\n{\n  _RCTProfilingBridge = bridge;\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wtautological-pointer-compare\"\n  if (RCTProfileTrampoline == NULL) {\n    return;\n  }\n#pragma clang diagnostic pop\n\n  RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @\"RCTProfileHookModules\", nil);\n  for (RCTModuleData *moduleData in [bridge valueForKey:@\"moduleDataByID\"]) {\n    // Only hook modules with an instance, to prevent initializing everything\n    if ([moduleData hasInstance]) {\n      [bridge dispatchBlock:^{\n        RCTProfileHookInstance(moduleData.instance);\n      } queue:moduleData.methodQueue];\n    }\n  }\n  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @\"\");\n}\n\nstatic void RCTProfileUnhookInstance(id instance)\n{\n  if ([instance class] != object_getClass(instance)) {\n    object_setClass(instance, [instance class]);\n  }\n}\n\nvoid RCTProfileUnhookModules(RCTBridge *bridge)\n{\n  _RCTProfilingBridge = nil;\n\n  dispatch_group_enter(RCTProfileGetUnhookGroup());\n\n  NSDictionary *moduleDataByID = [bridge valueForKey:@\"moduleDataByID\"];\n  for (RCTModuleData *moduleData in moduleDataByID) {\n    if ([moduleData hasInstance]) {\n      RCTProfileUnhookInstance(moduleData.instance);\n    }\n  }\n\n  if ([bridge moduleIsInitialized:[RCTUIManager class]]) {\n    dispatch_async(dispatch_get_main_queue(), ^{\n      for (id view in [bridge.uiManager valueForKey:@\"viewRegistry\"]) {\n        RCTProfileUnhookInstance(view);\n      }\n\n      dispatch_group_leave(RCTProfileGetUnhookGroup());\n    });\n  }\n}\n\n#pragma mark - Private ObjC class only used for the vSYNC CADisplayLink target\n\n@interface RCTProfile : NSObject\n@end\n\n@implementation RCTProfile\n\n+ (void)vsync:(NSTimer *)timer\n{\n  RCTProfileImmediateEvent(RCTProfileTagAlways, @\"VSYNC\", CACurrentMediaTime(), 'g');\n}\n\n+ (void)reload\n{\n  [RCTProfilingBridge() reload];\n}\n\n+ (void)toggle:(NSButton *)target\n{\n  BOOL isProfiling = RCTProfileIsProfiling();\n\n  // Start and Stop are switched here, since we're going to toggle isProfiling\n  [target setTitle:isProfiling ? @\"Start\" : @\"Stop\"];\n\n  if (isProfiling) {\n    RCTProfileEnd(RCTProfilingBridge(), ^(NSString *result) {\n      NSString *outFile = [NSTemporaryDirectory() stringByAppendingString:@\"tmp_trace.json\"];\n      [result writeToFile:outFile\n               atomically:YES\n                 encoding:NSUTF8StringEncoding\n                    error:nil];\n#if !TARGET_OS_TV\n      NSLog(@\"TODO: open file: %@\", outFile);\n#endif\n    });\n  } else {\n    RCTProfileInit(RCTProfilingBridge());\n  }\n}\n\n@end\n\n#pragma mark - Public Functions\n\ndispatch_queue_t RCTProfileGetQueue(void)\n{\n  static dispatch_queue_t queue;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    queue = dispatch_queue_create(\"com.facebook.react.Profiler\", DISPATCH_QUEUE_SERIAL);\n  });\n  return queue;\n}\n\nBOOL RCTProfileIsProfiling(void)\n{\n  return atomic_load(&RCTProfileProfiling);\n}\n\nvoid RCTProfileInit(RCTBridge *bridge)\n{\n  // TODO: enable assert JS thread from any file (and assert here)\n  BOOL wasProfiling = atomic_fetch_or(&RCTProfileProfiling, 1);\n  if (wasProfiling) {\n    return;\n  }\n\n  if (callbacks != NULL) {\n    systrace_buffer = callbacks->start();\n  } else {\n    NSTimeInterval time = CACurrentMediaTime();\n    dispatch_async(RCTProfileGetQueue(), ^{\n      RCTProfileStartTime = time;\n      RCTProfileOngoingEvents = [NSMutableDictionary new];\n      RCTProfileInfo = @{\n        kProfileTraceEvents: [NSMutableArray new],\n        kProfileSamples: [NSMutableArray new],\n      };\n    });\n  }\n\n  // Set up thread ordering\n  dispatch_async(RCTProfileGetQueue(), ^{\n    NSArray *orderedThreads = @[@\"JS async\", @\"RCTPerformanceLogger\", @\"com.facebook.react.JavaScript\",\n                                @(RCTUIManagerQueueName), @\"main\"];\n    [orderedThreads enumerateObjectsUsingBlock:^(NSString *thread, NSUInteger idx, __unused BOOL *stop) {\n      RCTProfileAddEvent(kProfileTraceEvents,\n        @\"ph\": @\"M\", // metadata event\n        @\"name\": @\"thread_sort_index\",\n        @\"tid\": thread,\n        @\"args\": @{ @\"sort_index\": @(-1000 + (NSInteger)idx) }\n      );\n    }];\n  });\n\n  RCTProfileHookModules(bridge);\n\n  // TODO: replace NSTimer with hardcoded timeInterval\n  RCTProfileDisplayLink = [NSTimer\n                           timerWithTimeInterval:0.01\n                           target:[RCTProfile class]\n                           selector:@selector(vsync:)\n                           userInfo:nil\n                           repeats:YES];\n\n  [[NSRunLoop mainRunLoop] addTimer:RCTProfileDisplayLink forMode:NSRunLoopCommonModes];\n\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTProfileDidStartProfiling\n                                                      object:bridge];\n}\n\nvoid RCTProfileEnd(RCTBridge *bridge, void (^callback)(NSString *))\n{\n  // assert JavaScript thread here again\n  BOOL wasProfiling = atomic_fetch_and(&RCTProfileProfiling, 0);\n  if (!wasProfiling) {\n    return;\n  }\n\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTProfileDidEndProfiling\n                                                      object:bridge];\n\n  [RCTProfileDisplayLink invalidate];\n  RCTProfileDisplayLink = nil;\n\n  RCTProfileUnhookModules(bridge);\n\n  if (callbacks != NULL) {\n    if (systrace_buffer) {\n      callbacks->stop();\n      callback(@(systrace_buffer));\n    }\n  } else {\n    dispatch_async(RCTProfileGetQueue(), ^{\n      NSString *log = RCTJSONStringify(RCTProfileInfo, NULL);\n      RCTProfileEventID = 0;\n      RCTProfileInfo = nil;\n      RCTProfileOngoingEvents = nil;\n\n      callback(log);\n    });\n  }\n}\n\nstatic NSMutableArray<NSArray *> *RCTProfileGetThreadEvents(NSThread *thread)\n{\n  static NSString *const RCTProfileThreadEventsKey = @\"RCTProfileThreadEventsKey\";\n  NSMutableArray<NSArray *> *threadEvents =\n    thread.threadDictionary[RCTProfileThreadEventsKey];\n  if (!threadEvents) {\n    threadEvents = [NSMutableArray new];\n    thread.threadDictionary[RCTProfileThreadEventsKey] = threadEvents;\n  }\n  return threadEvents;\n}\n\nvoid _RCTProfileBeginEvent(\n  NSThread *calleeThread,\n  NSTimeInterval time,\n  uint64_t tag,\n  NSString *name,\n  NSDictionary<NSString *, NSString *> *args\n) {\n  CHECK();\n\n  if (callbacks != NULL) {\n    systrace_arg_t *systraceArgs = newSystraceArgsFromDictionary(args);\n    callbacks->begin_section(tag, name.UTF8String, args.count, systraceArgs);\n    free(systraceArgs);\n    return;\n  }\n\n  dispatch_async(RCTProfileGetQueue(), ^{\n    NSMutableArray *events = RCTProfileGetThreadEvents(calleeThread);\n    [events addObject:@[\n      RCTProfileTimestamp(time),\n      name,\n      RCTNullIfNil(args),\n    ]];\n  });\n}\n\nvoid _RCTProfileEndEvent(\n  NSThread *calleeThread,\n  NSString *threadName,\n  NSTimeInterval time,\n  uint64_t tag,\n  NSString *category\n) {\n  CHECK();\n\n  if (callbacks != NULL) {\n    callbacks->end_section(tag, 0, nil);\n    return;\n  }\n\n  dispatch_async(RCTProfileGetQueue(), ^{\n    NSMutableArray<NSArray *> *events = RCTProfileGetThreadEvents(calleeThread);\n    NSArray *event = events.lastObject;\n    [events removeLastObject];\n\n    if (!event) {\n      return;\n    }\n\n    NSNumber *start = event[0];\n    RCTProfileAddEvent(kProfileTraceEvents,\n      @\"tid\": threadName,\n      @\"name\": event[1],\n      @\"cat\": category,\n      @\"ph\": @\"X\",\n      @\"ts\": start,\n      @\"dur\": @(RCTProfileTimestamp(time).doubleValue - start.doubleValue),\n      @\"args\": event[2],\n    );\n  });\n}\n\nNSUInteger RCTProfileBeginAsyncEvent(\n  uint64_t tag,\n  NSString *name,\n  NSDictionary<NSString *, NSString *> *args\n) {\n  CHECK(0);\n\n  static NSUInteger eventID = 0;\n\n  NSTimeInterval time = CACurrentMediaTime();\n  NSUInteger currentEventID = ++eventID;\n\n  if (callbacks != NULL) {\n    systrace_arg_t *systraceArgs = newSystraceArgsFromDictionary(args);\n    callbacks->begin_async_section(tag, name.UTF8String, (int)(currentEventID % INT_MAX), args.count, systraceArgs);\n    free(systraceArgs);\n  } else {\n    dispatch_async(RCTProfileGetQueue(), ^{\n      RCTProfileOngoingEvents[@(currentEventID)] = @[\n        RCTProfileTimestamp(time),\n        name,\n        RCTNullIfNil(args),\n      ];\n    });\n  }\n\n  return currentEventID;\n}\n\nvoid RCTProfileEndAsyncEvent(\n  uint64_t tag,\n  NSString *category,\n  NSUInteger cookie,\n  NSString *name,\n  NSString *threadName\n) {\n  CHECK();\n\n  if (callbacks != NULL) {\n    callbacks->end_async_section(tag, name.UTF8String, (int)(cookie % INT_MAX), 0, nil);\n    return;\n  }\n\n  NSTimeInterval time = CACurrentMediaTime();\n\n  dispatch_async(RCTProfileGetQueue(), ^{\n    NSArray *event = RCTProfileOngoingEvents[@(cookie)];\n\n    if (event) {\n      NSNumber *endTimestamp = RCTProfileTimestamp(time);\n\n      RCTProfileAddEvent(kProfileTraceEvents,\n        @\"tid\": threadName,\n        @\"name\": event[1],\n        @\"cat\": category,\n        @\"ph\": @\"X\",\n        @\"ts\": event[0],\n        @\"dur\": @(endTimestamp.doubleValue - [event[0] doubleValue]),\n        @\"args\": event[2],\n      );\n      [RCTProfileOngoingEvents removeObjectForKey:@(cookie)];\n    }\n  });\n}\n\nvoid RCTProfileImmediateEvent(\n  uint64_t tag,\n  NSString *name,\n  NSTimeInterval time,\n  char scope\n) {\n  CHECK();\n\n  if (callbacks != NULL) {\n    callbacks->instant_section(tag, name.UTF8String, scope);\n    return;\n  }\n\n  NSString *threadName = RCTCurrentThreadName();\n\n  dispatch_async(RCTProfileGetQueue(), ^{\n    RCTProfileAddEvent(kProfileTraceEvents,\n      @\"tid\": threadName,\n      @\"name\": name,\n      @\"ts\": RCTProfileTimestamp(time),\n      @\"scope\": @(scope),\n      @\"ph\": @\"i\",\n      @\"args\": RCTProfileGetMemoryUsage(),\n    );\n  });\n}\n\nNSUInteger _RCTProfileBeginFlowEvent(void)\n{\n  static NSUInteger flowID = 0;\n\n  CHECK(0);\n\n  NSUInteger cookie = ++flowID;\n  if (callbacks != NULL) {\n    callbacks->begin_async_flow(1, \"flow\", (int)cookie);\n    return cookie;\n  }\n\n  NSTimeInterval time = CACurrentMediaTime();\n  NSString *threadName = RCTCurrentThreadName();\n\n  dispatch_async(RCTProfileGetQueue(), ^{\n    RCTProfileAddEvent(kProfileTraceEvents,\n      @\"tid\": threadName,\n      @\"name\": @\"flow\",\n      @\"id\": @(cookie),\n      @\"cat\": @\"flow\",\n      @\"ph\": @\"s\",\n      @\"ts\": RCTProfileTimestamp(time),\n    );\n\n  });\n\n  return cookie;\n}\n\nvoid _RCTProfileEndFlowEvent(NSUInteger cookie)\n{\n  CHECK();\n\n  if (callbacks != NULL) {\n    callbacks->end_async_flow(1, \"flow\", (int)cookie);\n    return;\n  }\n\n  NSTimeInterval time = CACurrentMediaTime();\n  NSString *threadName = RCTCurrentThreadName();\n\n  dispatch_async(RCTProfileGetQueue(), ^{\n    RCTProfileAddEvent(kProfileTraceEvents,\n      @\"tid\": threadName,\n      @\"name\": @\"flow\",\n      @\"id\": @(cookie),\n      @\"cat\": @\"flow\",\n      @\"ph\": @\"f\",\n      @\"ts\": RCTProfileTimestamp(time),\n    );\n  });\n}\n\nvoid RCTProfileSendResult(RCTBridge *bridge, NSString *route, NSData *data)\n{\n  if (![bridge.bundleURL.scheme hasPrefix:@\"http\"]) {\n    RCTLogWarn(@\"Cannot upload profile information because you're not connected to the packager. The profiling data is still saved in the app container.\");\n    return;\n  }\n\n  NSURL *URL = [NSURL URLWithString:[@\"/\" stringByAppendingString:route] relativeToURL:bridge.bundleURL];\n\n  NSMutableURLRequest *URLRequest = [NSMutableURLRequest requestWithURL:URL];\n  URLRequest.HTTPMethod = @\"POST\";\n  [URLRequest setValue:@\"application/json\"\n    forHTTPHeaderField:@\"Content-Type\"];\n\n  NSURLSessionTask *task =\n    [[NSURLSession sharedSession] uploadTaskWithRequest:URLRequest\n                                               fromData:data\n                                    completionHandler:\n   ^(NSData *responseData, __unused NSURLResponse *response, NSError *error) {\n     if (error) {\n       RCTLogError(@\"%@\", error.localizedDescription);\n     } else {\n       NSString *message = [[NSString alloc] initWithData:responseData\n                                                 encoding:NSUTF8StringEncoding];\n\n       if (message.length) {\n#if !TARGET_OS_TV\n         NSAlert *view = RCTAlertView(@\"Profile\", message, nil, nil, nil);\n         [view runModal];\n#endif\n       }\n     }\n   }];\n\n  [task resume];\n}\n\nvoid RCTProfileShowControls(void)\n{\n  static const CGFloat height = 30;\n  static const CGFloat width = 60;\n\n  NSWindow *window = [[NSWindow alloc] initWithContentRect:CGRectMake(20, 80, width * 2, height)\n                                                 styleMask:0\n                                                   backing:NSBackingStoreBuffered\n                                                     defer:NO];\n\n  NSView *rootView = [[NSView alloc] initWithFrame:window.frame];\n  [rootView setWantsLayer:YES];\n  rootView.layer.backgroundColor = [NSColor lightGrayColor].CGColor;\n  rootView.layer.borderColor = [NSColor grayColor].CGColor;\n  rootView.layer.borderWidth = 1;\n  rootView.alphaValue = 0.8;\n\n  NSButton *startOrStop = [[NSButton alloc] initWithFrame:CGRectMake(0, 0, width, height)];\n  [startOrStop setTitle:RCTProfileIsProfiling() ? @\"Stop\" : @\"Start\"];\n  [startOrStop setAction:@selector(toggle:)];\n  startOrStop.font = [NSFont systemFontOfSize:12];\n\n  NSButton *reload = [[NSButton alloc] initWithFrame:CGRectMake(width, 0, width, height)];\n  [reload setTitle:@\"Reload\"];\n  [reload setAction:@selector(reload)];\n  reload.font = [NSFont systemFontOfSize:12];\n\n  [rootView addSubview:startOrStop];\n  [rootView addSubview:reload];\n  [window setContentView:rootView];\n\n  RCTProfileControlsWindow = window;\n}\n\nvoid RCTProfileHideControls(void)\n{\n  //RCTProfileControlsWindow.hidden = YES;\n  RCTProfileControlsWindow = nil;\n}\n\n#endif\n"
  },
  {
    "path": "React/Profiler/RCTProfileTrampoline-arm.S",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"RCTDefines.h\"\n#include \"RCTMacros.h\"\n\n#if RCT_PROFILE && defined(__arm__)\n\n  .thumb\n  .thumb_func\n  .globl SYMBOL_NAME(RCTProfileTrampoline)\nSYMBOL_NAME(RCTProfileTrampoline):\n  /**\n   * The explanation here is shorter, refer to the x86_64 implementation to a\n   * richer explanation\n   */\n\n  /**\n   * Save the parameter registers (r0-r3), r7 (frame pointer) and lr (link\n   * register (contains the address of the caller of RCTProfileTrampoline)\n   */\n  push {r0-r3, r7, lr}\n\n  /**\n   * Allocate memory to store values across function calls: 12-bytes are\n   * allocated to store 3 values: the previous value of the callee saved\n   * register used to save the pointer to the allocated memory, the caller of\n   * RCTProfileTrampoline and the address of the actual function we want to\n   * profile\n   */\n  mov r0, #0xc\n  bl SYMBOL_NAME(RCTProfileMalloc)\n  /**\n   * r4 is the callee saved register we'll use to refer to the allocated memory,\n   * store its initial value, so we can restore it later\n   */\n  str r4, [r0]\n  mov r4, r0\n\n  /**\n   * void RCTProfileGetImplementation(id object, SEL selector) in RCTProfile.m\n   *\n   * Load the first 2 argumenters (self and _cmd) used to call\n   * RCTProfileTrampoline from the stack and put them on the appropriate registers.\n   */\n  ldr r0, [sp]\n  ldr r1, [sp, #0x4]\n  bl SYMBOL_NAME(RCTProfileGetImplementation)\n  // store the actual function address in the allocated memory\n  str r0, [r4, #0x4]\n\n  /**\n   * void RCTProfileGetImplementation(id object, SEL selector) in RCTProfile.m\n   *\n   * Load the first 2 arguments again to start the profiler\n   */\n  ldr r0, [sp]\n  ldr r1, [sp, #0x4]\n  bl SYMBOL_NAME(RCTProfileTrampolineStart)\n\n  /**\n   * Restore the state to call the actual function we want to profile: pop\n   * all the registers\n   */\n  pop {r0-r3, r7, lr}\n\n  // store lr (the caller) since it'll be overridden by `blx` (call)\n  str lr, [r4, #0x8]\n  ldr r12, [r4, #0x4] // load the function address\n  blx r12 // call it\n  push {r0} // save return value\n\n  // void RCTProfileTrampolineEnd(void) in RCTProfile.m - just ends this profile\n  bl SYMBOL_NAME(RCTProfileTrampolineEnd)\n\n  /**\n   * Save the value we still need from the allocated memory (caller address),\n   * restore r4 and free the allocated memory (put its address in r0)\n   */\n  mov r0, r4\n  ldr r1, [r4, #0x8]\n  ldr r4, [r4]\n  push {r1} // save the caller on the stack\n  bl SYMBOL_NAME(RCTProfileFree)\n\n  pop {lr} // pop the caller\n  pop {r0} // pop the return value\n  bx lr // jump to the calleer\n\n  trap\n\n#endif\n"
  },
  {
    "path": "React/Profiler/RCTProfileTrampoline-arm64.S",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"RCTDefines.h\"\n#include \"RCTMacros.h\"\n\n#if RCT_PROFILE && defined(__arm64__)\n\n  .align 5\n  .globl SYMBOL_NAME(RCTProfileTrampoline)\nSYMBOL_NAME(RCTProfileTrampoline):\n  /**\n   * The explanation here is shorter, refer to the x86_64 implementation to  a\n   * richer explanation\n   */\n\n  // Basic prolog: save the frame pointer and the link register (caller address)\n  stp fp, lr, [sp, #-16]!\n  mov fp, sp\n\n  /**\n   * Store the value of all the parameter registers (x0-x8, q0-q7) so we can\n   * restore everything to the initial state at the time of the actual function\n   * call\n   */\n  sub\tsp, sp, #(10*8 + 8*16)\n  stp\tq0, q1, [sp, #(0*16)]\n  stp\tq2, q3, [sp, #(2*16)]\n  stp\tq4, q5, [sp, #(4*16)]\n  stp\tq6, q7, [sp, #(6*16)]\n  stp\tx0, x1, [sp, #(8*16+0*8)]\n  stp\tx2, x3, [sp, #(8*16+2*8)]\n  stp\tx4, x5, [sp, #(8*16+4*8)]\n  stp\tx6, x7, [sp, #(8*16+6*8)]\n  str\tx8,     [sp, #(8*16+8*8)]\n\n  /**\n   * Allocate 16-bytes for the values that have to be preserved across the call\n   * to the actual function, since the stack has to be in the exact initial\n   * state. During its lifetimewe use it to store the initial value of the\n   * callee saved registers we use to point the memory, the actual address of\n   * the implementation and the caller address.\n   */\n  mov x0, #0x10\n  bl SYMBOL_NAME(RCTProfileMalloc)\n  // store the initial value of r19, the callee saved register we'll use\n  str x19, [x0]\n  mov x19, x0\n\n  /**\n   * void RCTProfileGetImplementation(id object, SEL selector)\n   *\n   * Load the 2 first arguments from the stack, they are the same used to call\n   * this function\n   */\n  ldp\tx0, x1, [sp, #(8*16+0*8)]\n  bl SYMBOL_NAME(RCTProfileGetImplementation)\n  str x0, [x19, #0x8] // store the actual function address\n\n  /**\n   * void RCTProfileTrampolineStart(id, SEL) in RCTProfile.m\n   *\n   * start the profile, it takes the same first 2 arguments as above.\n   */\n  ldp\tx0, x1, [sp, #(8*16+0*8)]\n  bl SYMBOL_NAME(RCTProfileTrampolineStart)\n\n  // Restore all the parameter registers to the initial state.\n  ldp\tq0, q1, [sp, #(0*16)]\n  ldp\tq2, q3, [sp, #(2*16)]\n  ldp\tq4, q5, [sp, #(4*16)]\n  ldp\tq6, q7, [sp, #(6*16)]\n  ldp\tx0, x1, [sp, #(8*16+0*8)]\n  ldp\tx2, x3, [sp, #(8*16+2*8)]\n  ldp\tx4, x5, [sp, #(8*16+4*8)]\n  ldp\tx6, x7, [sp, #(8*16+6*8)]\n  ldr\tx8,     [sp, #(8*16+8*8)]\n\n  // Restore the stack pointer, frame pointer and link register\n  mov\tsp, fp\n  ldp\tfp, lr, [sp], #16\n\n\n  ldr x9, [x19, #0x8] // Load the function\n  str lr, [x19, #0x8] // store the address of the caller\n\n  blr x9 // call the actual function\n\n  /**\n   * allocate 32-bytes on the stack, for the 2 return values + the caller\n   * address that has to preserved across the call to `free`\n   */\n  sub sp, sp, #0x20\n  str q0, [sp, #0x0] // 16-byte return value\n  str x0, [sp, #0x10] // 8-byte return value\n\n  // void RCTProfileTrampolineEnd(void) in RCTProfile.m - just ends this profile\n  bl SYMBOL_NAME(RCTProfileTrampolineEnd)\n\n  /**\n   * restore the callee saved registers, move the values we still need to the\n   * stack and free the allocated memory\n   */\n  mov x0, x19 // move the address of the memory to x0, first argument\n  ldr x10, [x19, #0x8] //  load the caller address\n  ldr x19, [x19] // restore x19\n  str x10, [sp, #0x18] // store x10 on the stack space allocated above\n  bl SYMBOL_NAME(RCTProfileFree)\n\n  // Load both return values and link register from the stack\n  ldr q0, [sp, #0x0]\n  ldr x0, [sp, #0x10]\n  ldr lr, [sp, #0x18]\n\n  // restore the stack pointer\n  add sp, sp, #0x20\n\n  // jump to the calleer, without a link\n  br lr\n\n#endif\n"
  },
  {
    "path": "React/Profiler/RCTProfileTrampoline-i386.S",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"RCTDefines.h\"\n#include \"RCTMacros.h\"\n\n#if RCT_PROFILE && defined(__i386__)\n\n  .globl SYMBOL_NAME(RCTProfileTrampoline)\nSYMBOL_NAME(RCTProfileTrampoline):\n  /**\n   * The x86 version is much simpler, since all the arguments are passed in the\n   * stack, so we just have to preserve the stack pointer (%esp) and the callee\n   * saved register used to keep the memory allocated\n   *\n   * The explanation here is also shorter, refer to the x86_64 implementation to\n   * a richer explanation\n   */\n\n  /**\n   * Allocate memory to save the caller of RCTProfileTrampoline (used afterwards\n   * to return at the end of the function) and the initial value for the callee\n   * saved register (%edi) that will be used to point to the memory allocated.\n   */\n  subl $0x8, %esp // stack padding (16-byte alignment for function calls)\n  pushl $0xc // allocate 12-bytes\n  calll SYMBOL_NAME(RCTProfileMalloc)\n  addl $0xc, %esp // restore stack (8-byte padding + 4-byte argument)\n\n  /**\n   * actually store the values in the memory allocated\n   */\n  movl %edi, 0x0(%eax) // previous value of edi\n  popl 0x4(%eax) // caller of RCTProfileTrampoline\n\n  // save the pointer to the allocated memory in %edi\n  movl %eax, %edi\n\n  /**\n   * void RCTProfileGetImplementation(id object, SEL selector) in RCTProfile.m\n   *\n   * Get the address of the actual C function we have to profile\n   */\n  calll SYMBOL_NAME(RCTProfileGetImplementation)\n  movl %eax, 0x8(%edi) // Save it in the allocated memory\n\n  /**\n   * void RCTProfileTrampolineStart(id, SEL) in RCTProfile.m\n   *\n   * start profile - the arguments are already in the right position in the\n   * stack since it takes the same first 2 arguments as the any ObjC function -\n   * \"self\" and \"_cmd\"\n   */\n  calll SYMBOL_NAME(RCTProfileTrampolineStart)\n\n  /**\n   * Call the actual function and save it's return value, since it should be the\n   * return value of RCTProfileTrampoline\n   */\n  calll *0x8(%edi)\n  pushl %eax\n\n  // Align stack and end profile\n  subl $0xc, %esp\n  calll SYMBOL_NAME(RCTProfileTrampolineEnd)\n  addl $0xc, %esp // restore the stack\n\n  /**\n   * Move the values from the allocated memory to the stack, restore the\n   * value of %edi, and prepare to free the allocated memory.\n   */\n  pushl 0x4(%edi) // caller of RCTProfileTrampoline\n  subl $0x4, %esp // Stack padding\n  pushl %edi // push the memory address\n  movl 0x0(%edi), %edi // restore the value of %edi\n\n  /**\n   * Actually free the memory used to store the values across function calls,\n   * the stack has already been padded and the first and only argument, the\n   * memory address, is already in the bottom of the stack.\n   */\n  calll SYMBOL_NAME(RCTProfileFree)\n  addl $0x8, %esp\n\n  /**\n   * pop the caller address to %ecx and the actual function return value to\n   * %eax, so it's the return value of RCTProfileTrampoline\n   */\n  popl %ecx\n  popl %eax\n  jmpl *%ecx\n\n#endif\n"
  },
  {
    "path": "React/Profiler/RCTProfileTrampoline-x86_64.S",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"RCTDefines.h\"\n#include \"RCTMacros.h\"\n\n#if RCT_PROFILE && defined(__x86_64__)\n\n  .globl SYMBOL_NAME(RCTProfileTrampoline)\nSYMBOL_NAME(RCTProfileTrampoline):\n\n  /**\n   * Saves all the state so we can restore it before calling the functions being\n   * profiled. Registers have the same value at the point of the function call,\n   * the only thing we can change is the return value, so we return to\n   * `RCTProfileTrampoline` rather than to its caller.\n   *\n   * Save all the parameters registers (%rdi, %rsi, %rdx, %rcx, %r8, %r9), they\n   * have the 6 first arguments of the function call, and %rax which in special\n   * cases might be a pointer used for struct returns.\n   *\n   * We have to save %r12 since its value should be preserved across function\n   * calls and we'll use it to keep the stack pointer\n   */\n  subq $0x80+8, %rsp // 8 x 16-bytes xmm registers + 8-bytes alignment\n  movdqa  %xmm0, 0x70(%rsp)\n  movdqa  %xmm1, 0x60(%rsp)\n  movdqa  %xmm2, 0x50(%rsp)\n  movdqa  %xmm3, 0x40(%rsp)\n  movdqa  %xmm4, 0x30(%rsp)\n  movdqa  %xmm5, 0x20(%rsp)\n  movdqa  %xmm6, 0x10(%rsp)\n  movdqa  %xmm7, 0x00(%rsp)\n  pushq %rdi\n  pushq %rsi\n  pushq %rdx\n  pushq %rcx\n  pushq %r8\n  pushq %r9\n  pushq %rax\n  pushq %r12\n\n  /**\n   * Store the stack pointer in the callee saved register %r12 and align the\n   * stack - it has to 16-byte aligned at the point of the function call\n   */\n  movq %rsp, %r12\n  andq $-0x10, %rsp\n\n  /**\n   * void RCTProfileGetImplementation(id object, SEL selector)\n   *\n   * This is a C function defined in `RCTProfile.m`, the object and the selector\n   * already have to be on %rdi and %rsi respectively, as in any ObjC call.\n   */\n  callq SYMBOL_NAME_PIC(RCTProfileGetImplementation)\n\n  // Restore/unalign the stack pointer, so we can access the registers we stored\n  movq %r12, %rsp\n\n  /**\n   * pop %r12 before pushing %rax, which contains the address of the actual\n   * function we have to call, than we keep %r12 at the bottom of the stack to\n   * reference the stack pointer\n   */\n  popq %r12\n  pushq %rax\n  pushq %r12\n\n  // align stack\n  movq %rsp, %r12\n  andq $-0x10, %rsp\n\n  /**\n   * Allocate memory to save parent before start profiling: the address is put\n   * at the bottom of the stack at the function call, so ret can actually return\n   * to the caller. In this case it has the address of RCTProfileTrampoline's\n   * caller where we'll have to return to after we're finished.\n   *\n   * We can't store it on the stack or in any register, since we have to be in\n   * the exact same state we were at the moment we were called, so the solution\n   * is to allocate a tiny bit of memory to save this address\n   */\n\n  // allocate 16 bytes\n  movq $0x10, %rdi\n  callq SYMBOL_NAME_PIC(RCTProfileMalloc)\n\n  // store the initial value of calle saved registers %r13 and %r14\n  movq %r13, 0x0(%rax)\n  movq %r14, 0x8(%rax)\n\n  // mov the pointers we need to the callee saved registers\n  movq 0xd8(%rsp), %r13 // caller of RCTProfileTrampoline (0xd8 is stack top)\n  movq %rax, %r14 // allocated memory's address\n\n  /**\n   * Move self and cmd back to the registers and call start profile: it uses\n   * the object and the selector to label the call in the profile.\n   */\n  movq 0x40(%r12), %rdi // object\n  movq 0x38(%r12), %rsi // selector\n\n  // void RCTProfileTrampolineStart(id, SEL) in RCTProfile.m\n  callq SYMBOL_NAME_PIC(RCTProfileTrampolineStart)\n\n  // unalign the stack and restore %r12\n  movq %r12, %rsp\n  popq %r12\n\n  // Restore registers for actual function call\n  popq %r11\n  popq %rax\n  popq %r9\n  popq %r8\n  popq %rcx\n  popq %rdx\n  popq %rsi\n  popq %rdi\n  movdqa 0x00(%rsp), %xmm7\n  movdqa 0x10(%rsp), %xmm6\n  movdqa 0x20(%rsp), %xmm5\n  movdqa 0x30(%rsp), %xmm4\n  movdqa 0x40(%rsp), %xmm3\n  movdqa 0x50(%rsp), %xmm2\n  movdqa 0x60(%rsp), %xmm1\n  movdqa 0x70(%rsp), %xmm0\n  addq $0x80+8, %rsp\n\n  /**\n   * delete parent caller (saved in %r13) `call` will add the new address so\n   * we return to RCTProfileTrampoline rather than to its caller\n   */\n  addq $0x8, %rsp\n\n  // call the actual function and save the return value\n  callq *%r11\n  pushq %rax\n  pushq %rdx\n  subq $0x20, %rsp // 2 16-bytes xmm register\n  movdqa %xmm0, 0x00(%rsp)\n  movdqa %xmm1, 0x10(%rsp)\n\n  // void RCTProfileTrampolineEnd(void) in RCTProfile.m - just ends this profile\n  callq SYMBOL_NAME_PIC(RCTProfileTrampolineEnd)\n\n  /**\n   * Restore the initial value of the callee saved registers, saved in the\n   * memory allocated.\n   */\n  movq %r13, %rcx\n  movq %r14, %rdi\n  movq 0x0(%r14), %r13\n  movq 0x8(%r14), %r14\n\n  /**\n   * save caller address and actual function return (previously in the allocated\n   * memory) and align the stack\n   */\n  pushq %rcx\n  pushq %r12\n  movq %rsp, %r12\n  andq $-0x10, %rsp\n\n  // Free the memory allocated to stash callee saved registers\n  callq SYMBOL_NAME_PIC(RCTProfileFree)\n\n  // unalign  stack and restore %r12\n  movq %r12, %rsp\n  popq %r12\n\n  /**\n   * pop the caller address to %rcx and the actual function return value(s)\n   * so it's the return value of RCTProfileTrampoline\n   */\n  popq %rcx\n  movdqa 0x00(%rsp), %xmm0\n  movdqa 0x10(%rsp), %xmm1\n  addq $0x20, %rsp\n  popq %rdx\n  popq %rax\n\n  // jump to caller\n  jmpq *%rcx\n\n#endif\n"
  },
  {
    "path": "React/React.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t000E6CEB1AB0E980000CDF4D /* RCTSourceCode.m in Sources */ = {isa = PBXBuildFile; fileRef = 000E6CEA1AB0E980000CDF4D /* RCTSourceCode.m */; };\n\t\t001BFCD01D8381DE008E587E /* RCTMultipartStreamReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */; };\n\t\t006FC4141D9B20820057AAAD /* RCTMultipartDataTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 006FC4131D9B20820057AAAD /* RCTMultipartDataTask.m */; };\n\t\t008341F61D1DB34400876D9A /* RCTJSStackFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 008341F41D1DB34400876D9A /* RCTJSStackFrame.m */; };\n\t\t130443A11E3FEAA900D93A67 /* RCTFollyConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1304439F1E3FEAA900D93A67 /* RCTFollyConvert.h */; };\n\t\t130443A21E3FEAA900D93A67 /* RCTFollyConvert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 130443A01E3FEAA900D93A67 /* RCTFollyConvert.mm */; };\n\t\t130443A31E3FEAAE00D93A67 /* RCTFollyConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1304439F1E3FEAA900D93A67 /* RCTFollyConvert.h */; };\n\t\t130443A41E3FEAC600D93A67 /* RCTFollyConvert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 130443A01E3FEAA900D93A67 /* RCTFollyConvert.mm */; };\n\t\t130443C61E401A8C00D93A67 /* RCTConvert+Transform.m in Sources */ = {isa = PBXBuildFile; fileRef = 130443C41E401A8C00D93A67 /* RCTConvert+Transform.m */; };\n\t\t130443DB1E401ADD00D93A67 /* RCTConvert+Transform.m in Sources */ = {isa = PBXBuildFile; fileRef = 130443C41E401A8C00D93A67 /* RCTConvert+Transform.m */; };\n\t\t130443DC1E401AF400D93A67 /* RCTConvert+Transform.h in Headers */ = {isa = PBXBuildFile; fileRef = 130443C31E401A8C00D93A67 /* RCTConvert+Transform.h */; };\n\t\t130443DD1E401AF500D93A67 /* RCTConvert+Transform.h in Headers */ = {isa = PBXBuildFile; fileRef = 130443C31E401A8C00D93A67 /* RCTConvert+Transform.h */; };\n\t\t130E3D881E6A082100ACE484 /* RCTDevSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 130E3D861E6A082100ACE484 /* RCTDevSettings.h */; };\n\t\t130E3D891E6A082100ACE484 /* RCTDevSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = 130E3D871E6A082100ACE484 /* RCTDevSettings.mm */; };\n\t\t130E3D8A1E6A083600ACE484 /* RCTDevSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 130E3D861E6A082100ACE484 /* RCTDevSettings.h */; };\n\t\t130E3D8B1E6A083900ACE484 /* RCTDevSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = 130E3D871E6A082100ACE484 /* RCTDevSettings.mm */; };\n\t\t13134C861E296B2A00B9F3CB /* RCTCxxBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C741E296B2A00B9F3CB /* RCTCxxBridge.mm */; };\n\t\t13134C871E296B2A00B9F3CB /* RCTCxxBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C741E296B2A00B9F3CB /* RCTCxxBridge.mm */; };\n\t\t13134C8C1E296B2A00B9F3CB /* RCTMessageThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 13134C771E296B2A00B9F3CB /* RCTMessageThread.h */; };\n\t\t13134C8D1E296B2A00B9F3CB /* RCTMessageThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 13134C771E296B2A00B9F3CB /* RCTMessageThread.h */; };\n\t\t13134C8E1E296B2A00B9F3CB /* RCTMessageThread.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C781E296B2A00B9F3CB /* RCTMessageThread.mm */; };\n\t\t13134C8F1E296B2A00B9F3CB /* RCTMessageThread.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C781E296B2A00B9F3CB /* RCTMessageThread.mm */; };\n\t\t13134C941E296B2A00B9F3CB /* RCTObjcExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 13134C7B1E296B2A00B9F3CB /* RCTObjcExecutor.h */; };\n\t\t13134C951E296B2A00B9F3CB /* RCTObjcExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 13134C7B1E296B2A00B9F3CB /* RCTObjcExecutor.h */; };\n\t\t13134C961E296B2A00B9F3CB /* RCTObjcExecutor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C7C1E296B2A00B9F3CB /* RCTObjcExecutor.mm */; };\n\t\t13134C971E296B2A00B9F3CB /* RCTObjcExecutor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C7C1E296B2A00B9F3CB /* RCTObjcExecutor.mm */; };\n\t\t13134C981E296B2A00B9F3CB /* RCTCxxMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 13134C7E1E296B2A00B9F3CB /* RCTCxxMethod.h */; };\n\t\t13134C991E296B2A00B9F3CB /* RCTCxxMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 13134C7E1E296B2A00B9F3CB /* RCTCxxMethod.h */; };\n\t\t13134C9A1E296B2A00B9F3CB /* RCTCxxMethod.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C7F1E296B2A00B9F3CB /* RCTCxxMethod.mm */; };\n\t\t13134C9B1E296B2A00B9F3CB /* RCTCxxMethod.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C7F1E296B2A00B9F3CB /* RCTCxxMethod.mm */; };\n\t\t13134C9C1E296B2A00B9F3CB /* RCTCxxModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 13134C801E296B2A00B9F3CB /* RCTCxxModule.h */; };\n\t\t13134C9D1E296B2A00B9F3CB /* RCTCxxModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 13134C801E296B2A00B9F3CB /* RCTCxxModule.h */; };\n\t\t13134C9E1E296B2A00B9F3CB /* RCTCxxModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C811E296B2A00B9F3CB /* RCTCxxModule.mm */; };\n\t\t13134C9F1E296B2A00B9F3CB /* RCTCxxModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C811E296B2A00B9F3CB /* RCTCxxModule.mm */; };\n\t\t13134CA01E296B2A00B9F3CB /* RCTCxxUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 13134C821E296B2A00B9F3CB /* RCTCxxUtils.h */; };\n\t\t13134CA11E296B2A00B9F3CB /* RCTCxxUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 13134C821E296B2A00B9F3CB /* RCTCxxUtils.h */; };\n\t\t13134CA21E296B2A00B9F3CB /* RCTCxxUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C831E296B2A00B9F3CB /* RCTCxxUtils.mm */; };\n\t\t13134CA31E296B2A00B9F3CB /* RCTCxxUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13134C831E296B2A00B9F3CB /* RCTCxxUtils.mm */; };\n\t\t131B6AF41AF1093D00FFC3E0 /* RCTSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 131B6AF11AF1093D00FFC3E0 /* RCTSegmentedControl.m */; };\n\t\t131B6AF51AF1093D00FFC3E0 /* RCTSegmentedControlManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 131B6AF31AF1093D00FFC3E0 /* RCTSegmentedControlManager.m */; };\n\t\t133957881DF76D3500EC27BE /* YGEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77031DF767AF001F9587 /* YGEnums.h */; };\n\t\t133957891DF76D3500EC27BE /* YGMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77041DF767AF001F9587 /* YGMacros.h */; };\n\t\t1339578B1DF76D3500EC27BE /* Yoga.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77081DF767AF001F9587 /* Yoga.h */; };\n\t\t133CAE8E1B8E5CFD00F6AD92 /* RCTDatePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 133CAE8D1B8E5CFD00F6AD92 /* RCTDatePicker.m */; };\n\t\t13456E931ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */; };\n\t\t134D63C31F1FEC4B008872B5 /* RCTCxxBridgeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 134D63C21F1FEC4B008872B5 /* RCTCxxBridgeDelegate.h */; };\n\t\t134D63C41F1FEC65008872B5 /* RCTCxxBridgeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 134D63C21F1FEC4B008872B5 /* RCTCxxBridgeDelegate.h */; };\n\t\t13513F3C1B1F43F400FCE529 /* RCTProgressViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */; };\n\t\t135A9BFB1E7B0EAE00587AEB /* RCTJSCErrorHandling.h in Headers */ = {isa = PBXBuildFile; fileRef = 135A9BF91E7B0EAE00587AEB /* RCTJSCErrorHandling.h */; };\n\t\t135A9BFC1E7B0EAE00587AEB /* RCTJSCErrorHandling.mm in Sources */ = {isa = PBXBuildFile; fileRef = 135A9BFA1E7B0EAE00587AEB /* RCTJSCErrorHandling.mm */; };\n\t\t135A9BFF1E7B0EE600587AEB /* RCTJSCHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 135A9BFD1E7B0EE600587AEB /* RCTJSCHelpers.h */; };\n\t\t135A9C001E7B0EE600587AEB /* RCTJSCHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = 135A9BFE1E7B0EE600587AEB /* RCTJSCHelpers.mm */; };\n\t\t135A9C011E7B0F4700587AEB /* systemJSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 19DED2281E77E29200F089BB /* systemJSCWrapper.cpp */; };\n\t\t135A9C021E7B0F4800587AEB /* systemJSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 19DED2281E77E29200F089BB /* systemJSCWrapper.cpp */; };\n\t\t135A9C031E7B0F6100587AEB /* RCTJSCErrorHandling.h in Headers */ = {isa = PBXBuildFile; fileRef = 135A9BF91E7B0EAE00587AEB /* RCTJSCErrorHandling.h */; };\n\t\t135A9C041E7B0F6400587AEB /* RCTJSCErrorHandling.mm in Sources */ = {isa = PBXBuildFile; fileRef = 135A9BFA1E7B0EAE00587AEB /* RCTJSCErrorHandling.mm */; };\n\t\t135A9C051E7B0F7500587AEB /* RCTJSCHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = 135A9BFE1E7B0EE600587AEB /* RCTJSCHelpers.mm */; };\n\t\t135A9C061E7B0F7800587AEB /* RCTJSCHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 135A9BFD1E7B0EE600587AEB /* RCTJSCHelpers.h */; };\n\t\t1372B70A1AB030C200659ED6 /* RCTAppState.m in Sources */ = {isa = PBXBuildFile; fileRef = 1372B7091AB030C200659ED6 /* RCTAppState.m */; };\n\t\t1384E2081E806D4E00545659 /* RCTNativeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 1384E2061E806D4E00545659 /* RCTNativeModule.h */; };\n\t\t1384E2091E806D4E00545659 /* RCTNativeModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1384E2071E806D4E00545659 /* RCTNativeModule.mm */; };\n\t\t1384E20A1E806D5700545659 /* RCTNativeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 1384E2061E806D4E00545659 /* RCTNativeModule.h */; };\n\t\t1384E20B1E806D5B00545659 /* RCTNativeModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1384E2071E806D4E00545659 /* RCTNativeModule.mm */; };\n\t\t139D7E911E25C70B00323FB7 /* bignum-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E391E25C5A300323FB7 /* bignum-dtoa.cc */; };\n\t\t139D7E931E25C70B00323FB7 /* bignum.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E3B1E25C5A300323FB7 /* bignum.cc */; };\n\t\t139D7E951E25C70B00323FB7 /* cached-powers.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E3D1E25C5A300323FB7 /* cached-powers.cc */; };\n\t\t139D7E971E25C70B00323FB7 /* diy-fp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E3F1E25C5A300323FB7 /* diy-fp.cc */; };\n\t\t139D7E991E25C70B00323FB7 /* double-conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E411E25C5A300323FB7 /* double-conversion.cc */; };\n\t\t139D7E9B1E25C70B00323FB7 /* fast-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E431E25C5A300323FB7 /* fast-dtoa.cc */; };\n\t\t139D7E9D1E25C70B00323FB7 /* fixed-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E451E25C5A300323FB7 /* fixed-dtoa.cc */; };\n\t\t139D7EA01E25C70B00323FB7 /* strtod.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E481E25C5A300323FB7 /* strtod.cc */; };\n\t\t139D7EA51E25C85300323FB7 /* bignum-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E3A1E25C5A300323FB7 /* bignum-dtoa.h */; };\n\t\t139D7EA61E25C85300323FB7 /* bignum.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E3C1E25C5A300323FB7 /* bignum.h */; };\n\t\t139D7EA71E25C85300323FB7 /* cached-powers.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E3E1E25C5A300323FB7 /* cached-powers.h */; };\n\t\t139D7EA81E25C85300323FB7 /* diy-fp.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E401E25C5A300323FB7 /* diy-fp.h */; };\n\t\t139D7EA91E25C85300323FB7 /* double-conversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E421E25C5A300323FB7 /* double-conversion.h */; };\n\t\t139D7EAA1E25C85300323FB7 /* fast-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E441E25C5A300323FB7 /* fast-dtoa.h */; };\n\t\t139D7EAB1E25C85300323FB7 /* fixed-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E461E25C5A300323FB7 /* fixed-dtoa.h */; };\n\t\t139D7EAC1E25C85300323FB7 /* ieee.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E471E25C5A300323FB7 /* ieee.h */; };\n\t\t139D7EAD1E25C85300323FB7 /* strtod.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E491E25C5A300323FB7 /* strtod.h */; };\n\t\t139D7EAE1E25C85300323FB7 /* utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E4A1E25C5A300323FB7 /* utils.h */; };\n\t\t139D7F021E25DE1100323FB7 /* logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EDA1E25DBDC00323FB7 /* logging.cc */; };\n\t\t139D7F031E25DE1100323FB7 /* raw_logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EDB1E25DBDC00323FB7 /* raw_logging.cc */; };\n\t\t139D7F041E25DE1100323FB7 /* signalhandler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EDC1E25DBDC00323FB7 /* signalhandler.cc */; };\n\t\t139D7F051E25DE1100323FB7 /* symbolize.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EDE1E25DBDC00323FB7 /* symbolize.cc */; };\n\t\t139D7F061E25DE1100323FB7 /* utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EE01E25DBDC00323FB7 /* utilities.cc */; };\n\t\t139D7F071E25DE1100323FB7 /* vlog_is_on.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EE21E25DBDC00323FB7 /* vlog_is_on.cc */; };\n\t\t139D7F091E25DE3700323FB7 /* demangle.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7F081E25DE3700323FB7 /* demangle.cc */; };\n\t\t139D84AF1E273B5600323FB7 /* Bits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 139D849D1E273B5600323FB7 /* Bits.cpp */; };\n\t\t139D84B01E273B5600323FB7 /* Conv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 139D849F1E273B5600323FB7 /* Conv.cpp */; };\n\t\t139D84B11E273B5600323FB7 /* dynamic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 139D84A21E273B5600323FB7 /* dynamic.cpp */; };\n\t\t139D84B31E273B5600323FB7 /* json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 139D84A71E273B5600323FB7 /* json.cpp */; };\n\t\t13A0C2891B74F71200B29F6F /* RCTDevLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A0C2861B74F71200B29F6F /* RCTDevLoadingView.m */; };\n\t\t13A0C28A1B74F71200B29F6F /* RCTDevMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A0C2881B74F71200B29F6F /* RCTDevMenu.m */; };\n\t\t13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */; };\n\t\t13A6E20E1C19AA0C00845B82 /* RCTParserUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A6E20D1C19AA0C00845B82 /* RCTParserUtils.m */; };\n\t\t13AB90C11B6FA36700713B4F /* RCTComponentData.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AB90C01B6FA36700713B4F /* RCTComponentData.m */; };\n\t\t13AF20451AE707F9005F5298 /* RCTSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AF20441AE707F9005F5298 /* RCTSlider.m */; };\n\t\t13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */; };\n\t\t13B07FF01A69327A00A75B9A /* RCTExceptionsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */; };\n\t\t13B07FF21A69327A00A75B9A /* RCTTiming.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEE1A69327A00A75B9A /* RCTTiming.m */; };\n\t\t13B080201A69489C00A75B9A /* RCTActivityIndicatorViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */; };\n\t\t13BB3D021BECD54500932C10 /* RCTImageSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BB3D011BECD54500932C10 /* RCTImageSource.m */; };\n\t\t13BCE8091C99CB9D00DD7AAD /* RCTRootShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BCE8081C99CB9D00DD7AAD /* RCTRootShadowView.m */; };\n\t\t13C156051AB1A2840079392D /* RCTWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13C156021AB1A2840079392D /* RCTWebView.m */; };\n\t\t13C156061AB1A2840079392D /* RCTWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13C156041AB1A2840079392D /* RCTWebViewManager.m */; };\n\t\t13CC8A821B17642100940AE7 /* RCTBorderDrawing.m in Sources */ = {isa = PBXBuildFile; fileRef = 13CC8A811B17642100940AE7 /* RCTBorderDrawing.m */; };\n\t\t13D033631C1837FE0021DC29 /* RCTClipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D033621C1837FE0021DC29 /* RCTClipboard.m */; };\n\t\t13D9FEEB1CDCCECF00158BD7 /* RCTEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */; };\n\t\t13E0674A1A70F434002CDEE1 /* RCTUIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067491A70F434002CDEE1 /* RCTUIManager.m */; };\n\t\t13E067551A70F44B002CDEE1 /* RCTShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */; };\n\t\t13E067561A70F44B002CDEE1 /* RCTViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */; };\n\t\t13E067571A70F44B002CDEE1 /* RCTView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067501A70F44B002CDEE1 /* RCTView.m */; };\n\t\t13E067591A70F44B002CDEE1 /* NSView+React.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067541A70F44B002CDEE1 /* NSView+React.m */; };\n\t\t13E41EEB1C05CA0B00CD8DAC /* RCTProfileTrampoline-i386.S in Sources */ = {isa = PBXBuildFile; fileRef = 14BF717F1C04793D00C97D0C /* RCTProfileTrampoline-i386.S */; };\n\t\t13EBC6711E2870DE00880AC5 /* JSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */; };\n\t\t13EBC6731E2870DE00880AC5 /* Value.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B10C1E0369AD0018521A /* Value.cpp */; };\n\t\t13EBC6771E2870E400880AC5 /* JSCHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B1071E0369AD0018521A /* JSCHelpers.cpp */; };\n\t\t13EBC6781E2870E400880AC5 /* JSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */; };\n\t\t13EBC6791E2870E400880AC5 /* Unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B10A1E0369AD0018521A /* Unicode.cpp */; };\n\t\t13EBC67A1E2870E400880AC5 /* Value.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B10C1E0369AD0018521A /* Value.cpp */; };\n\t\t13EBC67B1E28723000880AC5 /* Unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B10A1E0369AD0018521A /* Unicode.cpp */; };\n\t\t13EBC67D1E28725900880AC5 /* JSCHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B1071E0369AD0018521A /* JSCHelpers.cpp */; };\n\t\t13EBC67E1E28726000880AC5 /* JSCHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B1081E0369AD0018521A /* JSCHelpers.h */; };\n\t\t13EBC6801E28733C00880AC5 /* noncopyable.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B1091E0369AD0018521A /* noncopyable.h */; };\n\t\t13EBC6811E28733C00880AC5 /* Unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B10B1E0369AD0018521A /* Unicode.h */; };\n\t\t13EBC6821E28733C00880AC5 /* Value.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B10D1E0369AD0018521A /* Value.h */; };\n\t\t13F17A851B8493E5007D4C75 /* RCTRedBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 13F17A841B8493E5007D4C75 /* RCTRedBox.m */; };\n\t\t13F880381E296D2800C3C7A1 /* JSCWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */; };\n\t\t13F887581E2971D400C3C7A1 /* Demangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13F887521E2971C500C3C7A1 /* Demangle.cpp */; };\n\t\t13F887591E2971D400C3C7A1 /* StringBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13F887531E2971C500C3C7A1 /* StringBase.cpp */; };\n\t\t13F8875A1E2971D400C3C7A1 /* Unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13F887541E2971C500C3C7A1 /* Unicode.cpp */; };\n\t\t13F8876E1E29726200C3C7A1 /* CxxNativeModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0A81E03699D0018521A /* CxxNativeModule.cpp */; };\n\t\t13F887701E29726200C3C7A1 /* Instance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0AE1E03699D0018521A /* Instance.cpp */; };\n\t\t13F887711E29726200C3C7A1 /* JSBundleType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */; };\n\t\t13F887721E29726200C3C7A1 /* JSCExecutor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0B21E03699D0018521A /* JSCExecutor.cpp */; };\n\t\t13F887741E29726200C3C7A1 /* JSCLegacyTracing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0B61E03699D0018521A /* JSCLegacyTracing.cpp */; };\n\t\t13F887751E29726200C3C7A1 /* JSCMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0B81E03699D0018521A /* JSCMemory.cpp */; };\n\t\t13F887761E29726200C3C7A1 /* JSCNativeModules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0BA1E03699D0018521A /* JSCNativeModules.cpp */; };\n\t\t13F887771E29726200C3C7A1 /* JSCPerfStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0BC1E03699D0018521A /* JSCPerfStats.cpp */; };\n\t\t13F887781E29726200C3C7A1 /* JSCSamplingProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0BE1E03699D0018521A /* JSCSamplingProfiler.cpp */; };\n\t\t13F887791E29726200C3C7A1 /* JSCUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0C21E03699D0018521A /* JSCUtils.cpp */; };\n\t\t13F8877B1E29726200C3C7A1 /* JSIndexedRAMBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0C61E03699D0018521A /* JSIndexedRAMBundle.cpp */; };\n\t\t13F8877C1E29726200C3C7A1 /* MethodCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0CA1E03699D0018521A /* MethodCall.cpp */; };\n\t\t13F8877D1E29726200C3C7A1 /* ModuleRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0CC1E03699D0018521A /* ModuleRegistry.cpp */; };\n\t\t13F8877E1E29726200C3C7A1 /* NativeToJsBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0CF1E03699D0018521A /* NativeToJsBridge.cpp */; };\n\t\t13F8877F1E29726200C3C7A1 /* Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0D11E03699D0018521A /* Platform.cpp */; };\n\t\t13F887801E29726200C3C7A1 /* SampleCxxModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0D31E03699D0018521A /* SampleCxxModule.cpp */; };\n\t\t13F887821E29726300C3C7A1 /* CxxNativeModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0A81E03699D0018521A /* CxxNativeModule.cpp */; };\n\t\t13F887841E29726300C3C7A1 /* Instance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0AE1E03699D0018521A /* Instance.cpp */; };\n\t\t13F887851E29726300C3C7A1 /* JSCExecutor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0B21E03699D0018521A /* JSCExecutor.cpp */; };\n\t\t13F887871E29726300C3C7A1 /* JSCLegacyTracing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0B61E03699D0018521A /* JSCLegacyTracing.cpp */; };\n\t\t13F887881E29726300C3C7A1 /* JSCMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0B81E03699D0018521A /* JSCMemory.cpp */; };\n\t\t13F887891E29726300C3C7A1 /* JSCNativeModules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0BA1E03699D0018521A /* JSCNativeModules.cpp */; };\n\t\t13F8878A1E29726300C3C7A1 /* JSCPerfStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0BC1E03699D0018521A /* JSCPerfStats.cpp */; };\n\t\t13F8878B1E29726300C3C7A1 /* JSCSamplingProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0BE1E03699D0018521A /* JSCSamplingProfiler.cpp */; };\n\t\t13F8878C1E29726300C3C7A1 /* JSCUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0C21E03699D0018521A /* JSCUtils.cpp */; };\n\t\t13F8878E1E29726300C3C7A1 /* JSIndexedRAMBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0C61E03699D0018521A /* JSIndexedRAMBundle.cpp */; };\n\t\t13F8878F1E29726300C3C7A1 /* MethodCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0CA1E03699D0018521A /* MethodCall.cpp */; };\n\t\t13F887901E29726300C3C7A1 /* ModuleRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0CC1E03699D0018521A /* ModuleRegistry.cpp */; };\n\t\t13F887911E29726300C3C7A1 /* NativeToJsBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0CF1E03699D0018521A /* NativeToJsBridge.cpp */; };\n\t\t13F887921E29726300C3C7A1 /* Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0D11E03699D0018521A /* Platform.cpp */; };\n\t\t13F887931E29726300C3C7A1 /* SampleCxxModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D92B0D31E03699D0018521A /* SampleCxxModule.cpp */; };\n\t\t13F8879F1E29741900C3C7A1 /* BitsFunctexcept.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13F8879C1E29740700C3C7A1 /* BitsFunctexcept.cpp */; };\n\t\t13F887A21E2977FF00C3C7A1 /* MallocImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13F887A01E2977D800C3C7A1 /* MallocImpl.cpp */; };\n\t\t142014191B32094000CC17BA /* RCTPerformanceLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 142014171B32094000CC17BA /* RCTPerformanceLogger.m */; };\n\t\t1450FF861BCFF28A00208362 /* RCTProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF811BCFF28A00208362 /* RCTProfile.m */; };\n\t\t1450FF871BCFF28A00208362 /* RCTProfileTrampoline-arm.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF821BCFF28A00208362 /* RCTProfileTrampoline-arm.S */; };\n\t\t1450FF881BCFF28A00208362 /* RCTProfileTrampoline-arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF831BCFF28A00208362 /* RCTProfileTrampoline-arm64.S */; };\n\t\t1450FF8A1BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF851BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S */; };\n\t\t14C2CA741B3AC64300E6CBB2 /* RCTModuleData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 14C2CA731B3AC64300E6CBB2 /* RCTModuleData.mm */; };\n\t\t14C2CA761B3AC64F00E6CBB2 /* RCTFrameUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C2CA751B3AC64F00E6CBB2 /* RCTFrameUpdate.m */; };\n\t\t14F3620D1AABD06A001CE568 /* RCTSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F362081AABD06A001CE568 /* RCTSwitch.m */; };\n\t\t14F3620E1AABD06A001CE568 /* RCTSwitchManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */; };\n\t\t14F484561AABFCE100FDF6B9 /* RCTSliderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */; };\n\t\t14F7A0EC1BDA3B3C003C6C10 /* RCTPerfMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F7A0EB1BDA3B3C003C6C10 /* RCTPerfMonitor.m */; };\n\t\t14F7A0F01BDA714B003C6C10 /* RCTFPSGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F7A0EF1BDA714B003C6C10 /* RCTFPSGraph.m */; };\n\t\t199B8A6F1F44DB16005DEF67 /* RCTVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 199B8A6E1F44DB16005DEF67 /* RCTVersion.h */; };\n\t\t199B8A761F44DEDA005DEF67 /* RCTVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 199B8A6E1F44DB16005DEF67 /* RCTVersion.h */; };\n\t\t19F61BFA1E8495CD00571D81 /* bignum-dtoa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E3A1E25C5A300323FB7 /* bignum-dtoa.h */; };\n\t\t19F61BFB1E8495CD00571D81 /* bignum.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E3C1E25C5A300323FB7 /* bignum.h */; };\n\t\t19F61BFC1E8495CD00571D81 /* cached-powers.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E3E1E25C5A300323FB7 /* cached-powers.h */; };\n\t\t19F61BFD1E8495CD00571D81 /* diy-fp.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E401E25C5A300323FB7 /* diy-fp.h */; };\n\t\t19F61BFE1E8495CD00571D81 /* double-conversion.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E421E25C5A300323FB7 /* double-conversion.h */; };\n\t\t19F61BFF1E8495CD00571D81 /* fast-dtoa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E441E25C5A300323FB7 /* fast-dtoa.h */; };\n\t\t19F61C001E8495CD00571D81 /* fixed-dtoa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E461E25C5A300323FB7 /* fixed-dtoa.h */; };\n\t\t19F61C011E8495CD00571D81 /* ieee.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E471E25C5A300323FB7 /* ieee.h */; };\n\t\t19F61C021E8495CD00571D81 /* strtod.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E491E25C5A300323FB7 /* strtod.h */; };\n\t\t19F61C031E8495CD00571D81 /* utils.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E4A1E25C5A300323FB7 /* utils.h */; };\n\t\t19F61C041E8495FF00571D81 /* JSCHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B1081E0369AD0018521A /* JSCHelpers.h */; };\n\t\t19F61C051E8495FF00571D81 /* noncopyable.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B1091E0369AD0018521A /* noncopyable.h */; };\n\t\t19F61C061E8495FF00571D81 /* Unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B10B1E0369AD0018521A /* Unicode.h */; };\n\t\t19F61C071E8495FF00571D81 /* Value.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B10D1E0369AD0018521A /* Value.h */; };\n\t\t27595AA41E575C7800CCE2B1 /* CxxModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A71E03699D0018521A /* CxxModule.h */; };\n\t\t27595AA51E575C7800CCE2B1 /* CxxNativeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A91E03699D0018521A /* CxxNativeModule.h */; };\n\t\t27595AA61E575C7800CCE2B1 /* JSExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* JSExecutor.h */; };\n\t\t27595AA91E575C7800CCE2B1 /* Instance.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AF1E03699D0018521A /* Instance.h */; };\n\t\t27595AAA1E575C7800CCE2B1 /* JsArgumentHelpers-inl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */; };\n\t\t27595AAB1E575C7800CCE2B1 /* JsArgumentHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B11E03699D0018521A /* JsArgumentHelpers.h */; };\n\t\t27595AAC1E575C7800CCE2B1 /* JSCExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B31E03699D0018521A /* JSCExecutor.h */; };\n\t\t27595AAE1E575C7800CCE2B1 /* JSCLegacyTracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B71E03699D0018521A /* JSCLegacyTracing.h */; };\n\t\t27595AAF1E575C7800CCE2B1 /* JSCMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B91E03699D0018521A /* JSCMemory.h */; };\n\t\t27595AB01E575C7800CCE2B1 /* JSCNativeModules.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BB1E03699D0018521A /* JSCNativeModules.h */; };\n\t\t27595AB11E575C7800CCE2B1 /* JSCPerfStats.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BD1E03699D0018521A /* JSCPerfStats.h */; };\n\t\t27595AB21E575C7800CCE2B1 /* JSCSamplingProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BF1E03699D0018521A /* JSCSamplingProfiler.h */; };\n\t\t27595AB31E575C7800CCE2B1 /* JSCUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C31E03699D0018521A /* JSCUtils.h */; };\n\t\t27595AB51E575C7800CCE2B1 /* JSIndexedRAMBundle.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C71E03699D0018521A /* JSIndexedRAMBundle.h */; };\n\t\t27595AB61E575C7800CCE2B1 /* MessageQueueThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C91E03699D0018521A /* MessageQueueThread.h */; };\n\t\t27595AB71E575C7800CCE2B1 /* MethodCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CB1E03699D0018521A /* MethodCall.h */; };\n\t\t27595AB81E575C7800CCE2B1 /* ModuleRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CD1E03699D0018521A /* ModuleRegistry.h */; };\n\t\t27595AB91E575C7800CCE2B1 /* NativeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CE1E03699D0018521A /* NativeModule.h */; };\n\t\t27595ABA1E575C7800CCE2B1 /* NativeToJsBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D01E03699D0018521A /* NativeToJsBridge.h */; };\n\t\t27595ABB1E575C7800CCE2B1 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D21E03699D0018521A /* Platform.h */; };\n\t\t27595ABC1E575C7800CCE2B1 /* SampleCxxModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D41E03699D0018521A /* SampleCxxModule.h */; };\n\t\t27595ABD1E575C7800CCE2B1 /* SystraceSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D51E03699D0018521A /* SystraceSection.h */; };\n\t\t27595ABF1E575C7800CCE2B1 /* CxxModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A71E03699D0018521A /* CxxModule.h */; };\n\t\t27595AC01E575C7800CCE2B1 /* CxxNativeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A91E03699D0018521A /* CxxNativeModule.h */; };\n\t\t27595AC11E575C7800CCE2B1 /* JSExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* JSExecutor.h */; };\n\t\t27595AC41E575C7800CCE2B1 /* Instance.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AF1E03699D0018521A /* Instance.h */; };\n\t\t27595AC51E575C7800CCE2B1 /* JsArgumentHelpers-inl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */; };\n\t\t27595AC61E575C7800CCE2B1 /* JsArgumentHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B11E03699D0018521A /* JsArgumentHelpers.h */; };\n\t\t27595AC71E575C7800CCE2B1 /* JSCExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B31E03699D0018521A /* JSCExecutor.h */; };\n\t\t27595AC91E575C7800CCE2B1 /* JSCLegacyTracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B71E03699D0018521A /* JSCLegacyTracing.h */; };\n\t\t27595ACA1E575C7800CCE2B1 /* JSCMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B91E03699D0018521A /* JSCMemory.h */; };\n\t\t27595ACB1E575C7800CCE2B1 /* JSCNativeModules.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BB1E03699D0018521A /* JSCNativeModules.h */; };\n\t\t27595ACC1E575C7800CCE2B1 /* JSCPerfStats.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BD1E03699D0018521A /* JSCPerfStats.h */; };\n\t\t27595ACD1E575C7800CCE2B1 /* JSCSamplingProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BF1E03699D0018521A /* JSCSamplingProfiler.h */; };\n\t\t27595ACE1E575C7800CCE2B1 /* JSCUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C31E03699D0018521A /* JSCUtils.h */; };\n\t\t27595AD01E575C7800CCE2B1 /* JSIndexedRAMBundle.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C71E03699D0018521A /* JSIndexedRAMBundle.h */; };\n\t\t27595AD11E575C7800CCE2B1 /* MessageQueueThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C91E03699D0018521A /* MessageQueueThread.h */; };\n\t\t27595AD21E575C7800CCE2B1 /* MethodCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CB1E03699D0018521A /* MethodCall.h */; };\n\t\t27595AD31E575C7800CCE2B1 /* ModuleRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CD1E03699D0018521A /* ModuleRegistry.h */; };\n\t\t27595AD41E575C7800CCE2B1 /* NativeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CE1E03699D0018521A /* NativeModule.h */; };\n\t\t27595AD51E575C7800CCE2B1 /* NativeToJsBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D01E03699D0018521A /* NativeToJsBridge.h */; };\n\t\t27595AD61E575C7800CCE2B1 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D21E03699D0018521A /* Platform.h */; };\n\t\t27595AD71E575C7800CCE2B1 /* SampleCxxModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D41E03699D0018521A /* SampleCxxModule.h */; };\n\t\t27595AD81E575C7800CCE2B1 /* SystraceSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D51E03699D0018521A /* SystraceSection.h */; };\n\t\t2D16E68E1FA4FD3900B85C8A /* RCTTVNavigationEventEmitter.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D0B842D1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h */; };\n\t\t2D1D83CD1F74E2CE00615550 /* libprivatedata-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9936F32F1F5F2E5B0010BF04 /* libprivatedata-tvOS.a */; };\n\t\t2D1D83CE1F74E2DA00615550 /* libdouble-conversion.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D383D621EBD27B9005632C8 /* libdouble-conversion.a */; };\n\t\t2D1D83EF1F74E76C00615550 /* RCTModalManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 91076A871F743AB00081B4FA /* RCTModalManager.m */; };\n\t\t2D3B5E931D9B087300451313 /* RCTErrorInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */; };\n\t\t2D3B5E941D9B087900451313 /* RCTBundleURLProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */; };\n\t\t2D3B5E951D9B087C00451313 /* RCTAssert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */; };\n\t\t2D3B5E971D9B089000451313 /* RCTBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA5F1A601EAA00E9B192 /* RCTBridge.m */; };\n\t\t2D3B5E981D9B089500451313 /* RCTConvert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBACB1A6023D300E9B192 /* RCTConvert.m */; };\n\t\t2D3B5E991D9B089A00451313 /* RCTDisplayLink.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */; };\n\t\t2D3B5E9A1D9B089D00451313 /* RCTEventDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */; };\n\t\t2D3B5E9B1D9B08A000451313 /* RCTFrameUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C2CA751B3AC64F00E6CBB2 /* RCTFrameUpdate.m */; };\n\t\t2D3B5E9C1D9B08A300451313 /* RCTImageSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BB3D011BECD54500932C10 /* RCTImageSource.m */; };\n\t\t2D3B5E9E1D9B08AD00451313 /* RCTJSStackFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 008341F41D1DB34400876D9A /* RCTJSStackFrame.m */; };\n\t\t2D3B5E9F1D9B08AF00451313 /* RCTKeyCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */; };\n\t\t2D3B5EA01D9B08B200451313 /* RCTLog.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4E1A601E3B00E9B192 /* RCTLog.mm */; };\n\t\t2D3B5EA11D9B08B600451313 /* RCTModuleData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 14C2CA731B3AC64300E6CBB2 /* RCTModuleData.mm */; };\n\t\t2D3B5EA31D9B08BE00451313 /* RCTParserUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A6E20D1C19AA0C00845B82 /* RCTParserUtils.m */; };\n\t\t2D3B5EA41D9B08C200451313 /* RCTPerformanceLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 142014171B32094000CC17BA /* RCTPerformanceLogger.m */; };\n\t\t2D3B5EA51D9B08C700451313 /* RCTRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 830A229D1A66C68A008503DA /* RCTRootView.m */; };\n\t\t2D3B5EA61D9B08CA00451313 /* RCTTouchEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 391E86A21C623EC800009732 /* RCTTouchEvent.m */; };\n\t\t2D3B5EA71D9B08CE00451313 /* RCTTouchHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */; };\n\t\t2D3B5EA81D9B08D300451313 /* RCTUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA501A601E3B00E9B192 /* RCTUtils.m */; };\n\t\t2D3B5EAE1D9B08F800451313 /* RCTEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */; };\n\t\t2D3B5EB01D9B08FE00451313 /* RCTAlertManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */; };\n\t\t2D3B5EB11D9B090100451313 /* RCTAppState.m in Sources */ = {isa = PBXBuildFile; fileRef = 1372B7091AB030C200659ED6 /* RCTAppState.m */; };\n\t\t2D3B5EB21D9B090300451313 /* RCTAsyncLocalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A4E1AAE93D500E7D092 /* RCTAsyncLocalStorage.m */; };\n\t\t2D3B5EB41D9B090A00451313 /* RCTDevLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A0C2861B74F71200B29F6F /* RCTDevLoadingView.m */; };\n\t\t2D3B5EB51D9B091100451313 /* RCTDevMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A0C2881B74F71200B29F6F /* RCTDevMenu.m */; };\n\t\t2D3B5EB61D9B091400451313 /* RCTExceptionsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */; };\n\t\t2D3B5EB71D9B091800451313 /* RCTRedBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 13F17A841B8493E5007D4C75 /* RCTRedBox.m */; };\n\t\t2D3B5EB81D9B091B00451313 /* RCTSourceCode.m in Sources */ = {isa = PBXBuildFile; fileRef = 000E6CEA1AB0E980000CDF4D /* RCTSourceCode.m */; };\n\t\t2D3B5EBA1D9B092100451313 /* RCTI18nUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */; };\n\t\t2D3B5EBB1D9B092300451313 /* RCTI18nManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B233E6E91D2D845D00BC68BA /* RCTI18nManager.m */; };\n\t\t2D3B5EBD1D9B092A00451313 /* RCTTiming.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEE1A69327A00A75B9A /* RCTTiming.m */; };\n\t\t2D3B5EBE1D9B092D00451313 /* RCTUIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067491A70F434002CDEE1 /* RCTUIManager.m */; };\n\t\t2D3B5EC01D9B093600451313 /* RCTPerfMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F7A0EB1BDA3B3C003C6C10 /* RCTPerfMonitor.m */; };\n\t\t2D3B5EC11D9B093900451313 /* RCTFPSGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F7A0EF1BDA714B003C6C10 /* RCTFPSGraph.m */; };\n\t\t2D3B5EC21D9B093B00451313 /* RCTProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF811BCFF28A00208362 /* RCTProfile.m */; };\n\t\t2D3B5EC31D9B094800451313 /* RCTProfileTrampoline-arm.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF821BCFF28A00208362 /* RCTProfileTrampoline-arm.S */; };\n\t\t2D3B5EC41D9B094B00451313 /* RCTProfileTrampoline-arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF831BCFF28A00208362 /* RCTProfileTrampoline-arm64.S */; };\n\t\t2D3B5EC51D9B094D00451313 /* RCTProfileTrampoline-i386.S in Sources */ = {isa = PBXBuildFile; fileRef = 14BF717F1C04793D00C97D0C /* RCTProfileTrampoline-i386.S */; };\n\t\t2D3B5EC61D9B095000451313 /* RCTProfileTrampoline-x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF851BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S */; };\n\t\t2D3B5EC71D9B095600451313 /* RCTActivityIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = B95154311D1B34B200FE7B80 /* RCTActivityIndicatorView.m */; };\n\t\t2D3B5EC81D9B095800451313 /* RCTActivityIndicatorViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */; };\n\t\t2D3B5EC91D9B095C00451313 /* RCTBorderDrawing.m in Sources */ = {isa = PBXBuildFile; fileRef = 13CC8A811B17642100940AE7 /* RCTBorderDrawing.m */; };\n\t\t2D3B5ECA1D9B095F00451313 /* RCTComponentData.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AB90C01B6FA36700713B4F /* RCTComponentData.m */; };\n\t\t2D3B5ECB1D9B096200451313 /* RCTConvert+CoreLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */; };\n\t\t2D3B5ECF1D9B096F00451313 /* RCTFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D37B5811D522B190042D5B5 /* RCTFont.mm */; };\n\t\t2D3B5ED41D9B097D00451313 /* RCTModalHostView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */; };\n\t\t2D3B5ED51D9B098000451313 /* RCTModalHostViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83392EB21B6634E10013B15F /* RCTModalHostViewController.m */; };\n\t\t2D3B5ED61D9B098400451313 /* RCTModalHostViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A1FE8E1B62643A00BE0E65 /* RCTModalHostViewManager.m */; };\n\t\t2D3B5EDD1D9B09A300451313 /* RCTProgressViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */; };\n\t\t2D3B5EE01D9B09AD00451313 /* RCTRootShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BCE8081C99CB9D00DD7AAD /* RCTRootShadowView.m */; };\n\t\t2D3B5EE31D9B09B700451313 /* RCTSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 131B6AF11AF1093D00FFC3E0 /* RCTSegmentedControl.m */; };\n\t\t2D3B5EE41D9B09BB00451313 /* RCTSegmentedControlManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 131B6AF31AF1093D00FFC3E0 /* RCTSegmentedControlManager.m */; };\n\t\t2D3B5EE51D9B09BE00451313 /* RCTShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */; };\n\t\t2D3B5EEE1D9B09DA00451313 /* RCTView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067501A70F44B002CDEE1 /* RCTView.m */; };\n\t\t2D3B5EEF1D9B09DC00451313 /* RCTViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */; };\n\t\t2D3B5EF11D9B09E700451313 /* NSView+React.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067541A70F44B002CDEE1 /* NSView+React.m */; };\n\t\t2D74EAFA1DAE9590003B751B /* RCTMultipartDataTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 006FC4131D9B20820057AAAD /* RCTMultipartDataTask.m */; };\n\t\t2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */; };\n\t\t352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */; };\n\t\t369123E11DDC75850095B341 /* RCTJSCSamplingProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 369123E01DDC75850095B341 /* RCTJSCSamplingProfiler.m */; };\n\t\t391E86A41C623EC800009732 /* RCTTouchEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 391E86A21C623EC800009732 /* RCTTouchEvent.m */; };\n\t\t3D05745A1DE5FFF500184BB4 /* RCTJavaScriptLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */; };\n\t\t3D0B84221EC0B3F600B2BD8E /* RCTResizeMode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */; };\n\t\t3D0B84231EC0B40D00B2BD8E /* RCTImageLoader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */; };\n\t\t3D0B84241EC0B40D00B2BD8E /* RCTImageStoreManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */; };\n\t\t3D0B84251EC0B42600B2BD8E /* RCTNetworking.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */; };\n\t\t3D0B84261EC0B42600B2BD8E /* RCTNetworkTask.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */; };\n\t\t3D0B84271EC0B45400B2BD8E /* RCTLinkingManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */; };\n\t\t3D0B842A1EC0B49400B2BD8E /* RCTTVRemoteHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0B84281EC0B49400B2BD8E /* RCTTVRemoteHandler.h */; };\n\t\t3D0B842B1EC0B49400B2BD8E /* RCTTVRemoteHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D0B84291EC0B49400B2BD8E /* RCTTVRemoteHandler.m */; };\n\t\t3D0B842F1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0B842D1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h */; };\n\t\t3D0B84301EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D0B842E1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.m */; };\n\t\t3D0E378A1F1CC40000DCAC9F /* RCTWebSocketModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */; };\n\t\t3D0E378C1F1CC58C00DCAC9F /* RCTWebSocketObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0E378B1F1CC58C00DCAC9F /* RCTWebSocketObserver.h */; };\n\t\t3D0E378D1F1CC58F00DCAC9F /* RCTWebSocketObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0E378B1F1CC58C00DCAC9F /* RCTWebSocketObserver.h */; };\n\t\t3D0E378E1F1CC59100DCAC9F /* RCTWebSocketModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */; };\n\t\t3D0E378F1F1CC5CF00DCAC9F /* RCTWebSocketModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */; };\n\t\t3D0E37901F1CC5E100DCAC9F /* RCTWebSocketModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */; };\n\t\t3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */; };\n\t\t3D302F1E1DF8265A00D6DDAE /* JavaScriptCore.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */; };\n\t\t3D302F1F1DF8265A00D6DDAE /* JSCWrapper.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */; };\n\t\t3D302F241DF828F800D6DDAE /* RCTImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */; };\n\t\t3D302F251DF828F800D6DDAE /* RCTImageStoreManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */; };\n\t\t3D302F261DF828F800D6DDAE /* RCTResizeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */; };\n\t\t3D302F271DF828F800D6DDAE /* RCTLinkingManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */; };\n\t\t3D302F281DF828F800D6DDAE /* RCTNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */; };\n\t\t3D302F291DF828F800D6DDAE /* RCTNetworkTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */; };\n\t\t3D302F2A1DF828F800D6DDAE /* RCTPushNotificationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08D1DE4F4EE00E03CC6 /* RCTPushNotificationManager.h */; };\n\t\t3D302F2B1DF828F800D6DDAE /* RCTAssert.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */; };\n\t\t3D302F2C1DF828F800D6DDAE /* RCTBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */; };\n\t\t3D302F2D1DF828F800D6DDAE /* RCTBridge+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */; };\n\t\t3D302F2E1DF828F800D6DDAE /* RCTBridgeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */; };\n\t\t3D302F2F1DF828F800D6DDAE /* RCTBridgeMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */; };\n\t\t3D302F301DF828F800D6DDAE /* RCTBridgeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 830213F31A654E0800B993E6 /* RCTBridgeModule.h */; };\n\t\t3D302F311DF828F800D6DDAE /* RCTBundleURLProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */; };\n\t\t3D302F321DF828F800D6DDAE /* RCTConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBACA1A6023D300E9B192 /* RCTConvert.h */; };\n\t\t3D302F331DF828F800D6DDAE /* RCTDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AF1F851AE6E777005F5298 /* RCTDefines.h */; };\n\t\t3D302F341DF828F800D6DDAE /* RCTDisplayLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */; };\n\t\t3D302F351DF828F800D6DDAE /* RCTErrorCustomizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */; };\n\t\t3D302F361DF828F800D6DDAE /* RCTErrorInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */; };\n\t\t3D302F371DF828F800D6DDAE /* RCTEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */; };\n\t\t3D302F381DF828F800D6DDAE /* RCTFrameUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */; };\n\t\t3D302F391DF828F800D6DDAE /* RCTImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 13BB3D001BECD54500932C10 /* RCTImageSource.h */; };\n\t\t3D302F3A1DF828F800D6DDAE /* RCTInvalidating.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */; };\n\t\t3D302F3B1DF828F800D6DDAE /* RCTJavaScriptExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */; };\n\t\t3D302F3C1DF828F800D6DDAE /* RCTJavaScriptLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */; };\n\t\t3D302F3D1DF828F800D6DDAE /* RCTJSStackFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 008341F51D1DB34400876D9A /* RCTJSStackFrame.h */; };\n\t\t3D302F3E1DF828F800D6DDAE /* RCTKeyCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */; };\n\t\t3D302F3F1DF828F800D6DDAE /* RCTLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4D1A601E3B00E9B192 /* RCTLog.h */; };\n\t\t3D302F401DF828F800D6DDAE /* RCTModuleData.h in Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */; };\n\t\t3D302F411DF828F800D6DDAE /* RCTModuleMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */; };\n\t\t3D302F421DF828F800D6DDAE /* RCTMultipartDataTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */; };\n\t\t3D302F431DF828F800D6DDAE /* RCTMultipartStreamReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */; };\n\t\t3D302F441DF828F800D6DDAE /* RCTNullability.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20F1C19ABC700845B82 /* RCTNullability.h */; };\n\t\t3D302F451DF828F800D6DDAE /* RCTParserUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */; };\n\t\t3D302F461DF828F800D6DDAE /* RCTPerformanceLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 142014181B32094000CC17BA /* RCTPerformanceLogger.h */; };\n\t\t3D302F471DF828F800D6DDAE /* RCTPlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7749421DC1065C007EC8D8 /* RCTPlatform.h */; };\n\t\t3D302F481DF828F800D6DDAE /* RCTRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 830A229C1A66C68A008503DA /* RCTRootView.h */; };\n\t\t3D302F491DF828F800D6DDAE /* RCTRootViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */; };\n\t\t3D302F4A1DF828F800D6DDAE /* RCTRootViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A15FB0C1BDF663500531DFB /* RCTRootViewInternal.h */; };\n\t\t3D302F4B1DF828F800D6DDAE /* RCTTouchEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 391E86A31C623EC800009732 /* RCTTouchEvent.h */; };\n\t\t3D302F4C1DF828F800D6DDAE /* RCTTouchHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */; };\n\t\t3D302F4D1DF828F800D6DDAE /* RCTURLRequestDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; };\n\t\t3D302F4E1DF828F800D6DDAE /* RCTURLRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; };\n\t\t3D302F4F1DF828F800D6DDAE /* RCTUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; };\n\t\t3D302F541DF828F800D6DDAE /* RCTJSCSamplingProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */; };\n\t\t3D302F561DF828F800D6DDAE /* RCTAlertManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */; };\n\t\t3D302F571DF828F800D6DDAE /* RCTAppState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1372B7081AB030C200659ED6 /* RCTAppState.h */; };\n\t\t3D302F581DF828F800D6DDAE /* RCTAsyncLocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */; };\n\t\t3D302F591DF828F800D6DDAE /* RCTClipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 13D033611C1837FE0021DC29 /* RCTClipboard.h */; };\n\t\t3D302F5A1DF828F800D6DDAE /* RCTDevLoadingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */; };\n\t\t3D302F5B1DF828F800D6DDAE /* RCTDevMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2871B74F71200B29F6F /* RCTDevMenu.h */; };\n\t\t3D302F5C1DF828F800D6DDAE /* RCTEventEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */; };\n\t\t3D302F5D1DF828F800D6DDAE /* RCTExceptionsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */; };\n\t\t3D302F5E1DF828F800D6DDAE /* RCTI18nManager.h in Headers */ = {isa = PBXBuildFile; fileRef = B233E6E81D2D843200BC68BA /* RCTI18nManager.h */; };\n\t\t3D302F5F1DF828F800D6DDAE /* RCTI18nUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */; };\n\t\t3D302F611DF828F800D6DDAE /* RCTRedBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 13F17A831B8493E5007D4C75 /* RCTRedBox.h */; };\n\t\t3D302F621DF828F800D6DDAE /* RCTSourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */; };\n\t\t3D302F641DF828F800D6DDAE /* RCTTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FED1A69327A00A75B9A /* RCTTiming.h */; };\n\t\t3D302F651DF828F800D6DDAE /* RCTUIManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E067481A70F434002CDEE1 /* RCTUIManager.h */; };\n\t\t3D302F661DF828F800D6DDAE /* RCTFPSGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */; };\n\t\t3D302F681DF828F800D6DDAE /* RCTMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BF71811C04795500C97D0C /* RCTMacros.h */; };\n\t\t3D302F691DF828F800D6DDAE /* RCTProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 1450FF801BCFF28A00208362 /* RCTProfile.h */; };\n\t\t3D302F6A1DF828F800D6DDAE /* RCTActivityIndicatorView.h in Headers */ = {isa = PBXBuildFile; fileRef = B95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */; };\n\t\t3D302F6B1DF828F800D6DDAE /* RCTActivityIndicatorViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */; };\n\t\t3D302F6C1DF828F800D6DDAE /* RCTAnimationType.h in Headers */ = {isa = PBXBuildFile; fileRef = 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */; };\n\t\t3D302F6D1DF828F800D6DDAE /* RCTAutoInsetsProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */; };\n\t\t3D302F6E1DF828F800D6DDAE /* RCTBorderDrawing.h in Headers */ = {isa = PBXBuildFile; fileRef = 13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */; };\n\t\t3D302F6F1DF828F800D6DDAE /* RCTBorderStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = ACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */; };\n\t\t3D302F701DF828F800D6DDAE /* RCTComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };\n\t\t3D302F711DF828F800D6DDAE /* RCTComponentData.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };\n\t\t3D302F721DF828F800D6DDAE /* RCTConvert+CoreLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };\n\t\t3D302F761DF828F800D6DDAE /* RCTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };\n\t\t3D302F7B1DF828F800D6DDAE /* RCTModalHostView.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };\n\t\t3D302F7C1DF828F800D6DDAE /* RCTModalHostViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };\n\t\t3D302F7D1DF828F800D6DDAE /* RCTModalHostViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };\n\t\t3D302F841DF828F800D6DDAE /* RCTPointerEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */; };\n\t\t3D302F851DF828F800D6DDAE /* RCTProgressViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */; };\n\t\t3D302F881DF828F800D6DDAE /* RCTRootShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */; };\n\t\t3D302F8C1DF828F800D6DDAE /* RCTSegmentedControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */; };\n\t\t3D302F8D1DF828F800D6DDAE /* RCTSegmentedControlManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */; };\n\t\t3D302F8E1DF828F800D6DDAE /* RCTShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */; };\n\t\t3D302F8F1DF828F800D6DDAE /* RCTSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AF20431AE707F8005F5298 /* RCTSlider.h */; };\n\t\t3D302F901DF828F800D6DDAE /* RCTSliderManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */; };\n\t\t3D302F911DF828F800D6DDAE /* RCTSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F362071AABD06A001CE568 /* RCTSwitch.h */; };\n\t\t3D302F921DF828F800D6DDAE /* RCTSwitchManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F362091AABD06A001CE568 /* RCTSwitchManager.h */; };\n\t\t3D302F971DF828F800D6DDAE /* RCTTextDecorationLineType.h in Headers */ = {isa = PBXBuildFile; fileRef = E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */; };\n\t\t3D302F981DF828F800D6DDAE /* RCTView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674F1A70F44B002CDEE1 /* RCTView.h */; };\n\t\t3D302F991DF828F800D6DDAE /* RCTViewControllerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */; };\n\t\t3D302F9A1DF828F800D6DDAE /* RCTViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */; };\n\t\t3D302F9F1DF828F800D6DDAE /* NSView+React.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E067531A70F44B002CDEE1 /* NSView+React.h */; };\n\t\t3D3030221DF8294C00D6DDAE /* JSBundleType.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */; };\n\t\t3D3030231DF8294C00D6DDAE /* oss-compat-util.h in Headers */ = {isa = PBXBuildFile; fileRef = AC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */; };\n\t\t3D3030251DF8295E00D6DDAE /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */; };\n\t\t3D3030261DF8295E00D6DDAE /* JSCWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */; };\n\t\t3D37B5821D522B190042D5B5 /* RCTFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D37B5811D522B190042D5B5 /* RCTFont.mm */; };\n\t\t3D383D1F1EBD27A8005632C8 /* RCTBridge+Private.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */; };\n\t\t3D383D201EBD27AF005632C8 /* RCTBridge+Private.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */; };\n\t\t3D383D251EBD27B6005632C8 /* Conv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 139D849F1E273B5600323FB7 /* Conv.cpp */; };\n\t\t3D383D261EBD27B6005632C8 /* StringBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13F887531E2971C500C3C7A1 /* StringBase.cpp */; };\n\t\t3D383D271EBD27B6005632C8 /* raw_logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EDB1E25DBDC00323FB7 /* raw_logging.cc */; };\n\t\t3D383D281EBD27B6005632C8 /* signalhandler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EDC1E25DBDC00323FB7 /* signalhandler.cc */; };\n\t\t3D383D291EBD27B6005632C8 /* dynamic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 139D84A21E273B5600323FB7 /* dynamic.cpp */; };\n\t\t3D383D2A1EBD27B6005632C8 /* utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EE01E25DBDC00323FB7 /* utilities.cc */; };\n\t\t3D383D2B1EBD27B6005632C8 /* MallocImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13F887A01E2977D800C3C7A1 /* MallocImpl.cpp */; };\n\t\t3D383D2C1EBD27B6005632C8 /* Bits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 139D849D1E273B5600323FB7 /* Bits.cpp */; };\n\t\t3D383D2D1EBD27B6005632C8 /* symbolize.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EDE1E25DBDC00323FB7 /* symbolize.cc */; };\n\t\t3D383D2E1EBD27B6005632C8 /* vlog_is_on.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EE21E25DBDC00323FB7 /* vlog_is_on.cc */; };\n\t\t3D383D2F1EBD27B6005632C8 /* Unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13F887541E2971C500C3C7A1 /* Unicode.cpp */; };\n\t\t3D383D301EBD27B6005632C8 /* demangle.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7F081E25DE3700323FB7 /* demangle.cc */; };\n\t\t3D383D311EBD27B6005632C8 /* Demangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13F887521E2971C500C3C7A1 /* Demangle.cpp */; };\n\t\t3D383D331EBD27B6005632C8 /* logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7EDA1E25DBDC00323FB7 /* logging.cc */; };\n\t\t3D383D341EBD27B6005632C8 /* json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 139D84A71E273B5600323FB7 /* json.cpp */; };\n\t\t3D383D351EBD27B6005632C8 /* BitsFunctexcept.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13F8879C1E29740700C3C7A1 /* BitsFunctexcept.cpp */; };\n\t\t3D383D401EBD27B9005632C8 /* bignum-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E391E25C5A300323FB7 /* bignum-dtoa.cc */; };\n\t\t3D383D411EBD27B9005632C8 /* bignum.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E3B1E25C5A300323FB7 /* bignum.cc */; };\n\t\t3D383D421EBD27B9005632C8 /* cached-powers.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E3D1E25C5A300323FB7 /* cached-powers.cc */; };\n\t\t3D383D431EBD27B9005632C8 /* diy-fp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E3F1E25C5A300323FB7 /* diy-fp.cc */; };\n\t\t3D383D441EBD27B9005632C8 /* double-conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E411E25C5A300323FB7 /* double-conversion.cc */; };\n\t\t3D383D451EBD27B9005632C8 /* fast-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E431E25C5A300323FB7 /* fast-dtoa.cc */; };\n\t\t3D383D461EBD27B9005632C8 /* fixed-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E451E25C5A300323FB7 /* fixed-dtoa.cc */; };\n\t\t3D383D471EBD27B9005632C8 /* strtod.cc in Sources */ = {isa = PBXBuildFile; fileRef = 139D7E481E25C5A300323FB7 /* strtod.cc */; };\n\t\t3D383D4A1EBD27B9005632C8 /* bignum-dtoa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E3A1E25C5A300323FB7 /* bignum-dtoa.h */; };\n\t\t3D383D4B1EBD27B9005632C8 /* bignum.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E3C1E25C5A300323FB7 /* bignum.h */; };\n\t\t3D383D4C1EBD27B9005632C8 /* cached-powers.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E3E1E25C5A300323FB7 /* cached-powers.h */; };\n\t\t3D383D4D1EBD27B9005632C8 /* diy-fp.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E401E25C5A300323FB7 /* diy-fp.h */; };\n\t\t3D383D4E1EBD27B9005632C8 /* double-conversion.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E421E25C5A300323FB7 /* double-conversion.h */; };\n\t\t3D383D4F1EBD27B9005632C8 /* fast-dtoa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E441E25C5A300323FB7 /* fast-dtoa.h */; };\n\t\t3D383D501EBD27B9005632C8 /* fixed-dtoa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E461E25C5A300323FB7 /* fixed-dtoa.h */; };\n\t\t3D383D511EBD27B9005632C8 /* ieee.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E471E25C5A300323FB7 /* ieee.h */; };\n\t\t3D383D521EBD27B9005632C8 /* strtod.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E491E25C5A300323FB7 /* strtod.h */; };\n\t\t3D383D531EBD27B9005632C8 /* utils.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 139D7E4A1E25C5A300323FB7 /* utils.h */; };\n\t\t3D383D551EBD27B9005632C8 /* bignum-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E3A1E25C5A300323FB7 /* bignum-dtoa.h */; };\n\t\t3D383D561EBD27B9005632C8 /* bignum.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E3C1E25C5A300323FB7 /* bignum.h */; };\n\t\t3D383D571EBD27B9005632C8 /* cached-powers.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E3E1E25C5A300323FB7 /* cached-powers.h */; };\n\t\t3D383D581EBD27B9005632C8 /* diy-fp.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E401E25C5A300323FB7 /* diy-fp.h */; };\n\t\t3D383D591EBD27B9005632C8 /* double-conversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E421E25C5A300323FB7 /* double-conversion.h */; };\n\t\t3D383D5A1EBD27B9005632C8 /* fast-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E441E25C5A300323FB7 /* fast-dtoa.h */; };\n\t\t3D383D5B1EBD27B9005632C8 /* fixed-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E461E25C5A300323FB7 /* fixed-dtoa.h */; };\n\t\t3D383D5C1EBD27B9005632C8 /* ieee.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E471E25C5A300323FB7 /* ieee.h */; };\n\t\t3D383D5D1EBD27B9005632C8 /* strtod.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E491E25C5A300323FB7 /* strtod.h */; };\n\t\t3D383D5E1EBD27B9005632C8 /* utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 139D7E4A1E25C5A300323FB7 /* utils.h */; };\n\t\t3D383D6D1EBD2940005632C8 /* libdouble-conversion.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139D7E881E25C6D100323FB7 /* libdouble-conversion.a */; };\n\t\t3D383D6E1EBD2940005632C8 /* libjschelpers.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */; };\n\t\t3D383D6F1EBD2940005632C8 /* libthird-party.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139D7ECE1E25DB7D00323FB7 /* libthird-party.a */; };\n\t\t3D383D711EBD2949005632C8 /* libjschelpers.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD9181DE5FBD800167DC4 /* libjschelpers.a */; };\n\t\t3D383D721EBD2949005632C8 /* libthird-party.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D383D3C1EBD27B6005632C8 /* libthird-party.a */; };\n\t\t3D3CD93D1DE5FC1400167DC4 /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */; };\n\t\t3D3CD93E1DE5FC1400167DC4 /* JSCWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */; };\n\t\t3D3CD9411DE5FC5300167DC4 /* libcxxreact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */; };\n\t\t3D3CD9451DE5FC7100167DC4 /* JSBundleType.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */; };\n\t\t3D3CD9471DE5FC7800167DC4 /* oss-compat-util.h in Headers */ = {isa = PBXBuildFile; fileRef = AC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */; };\n\t\t3D74547C1E54758900E74ADD /* JSBigString.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7454781E54757500E74ADD /* JSBigString.h */; };\n\t\t3D74547D1E54758900E74ADD /* JSBigString.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7454781E54757500E74ADD /* JSBigString.h */; };\n\t\t3D74547E1E54759A00E74ADD /* JSModulesUnbundle.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C81E03699D0018521A /* JSModulesUnbundle.h */; };\n\t\t3D74547F1E54759E00E74ADD /* JSModulesUnbundle.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C81E03699D0018521A /* JSModulesUnbundle.h */; };\n\t\t3D7454801E5475AF00E74ADD /* RecoverableError.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7454791E54757500E74ADD /* RecoverableError.h */; };\n\t\t3D7454811E5475AF00E74ADD /* RecoverableError.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7454791E54757500E74ADD /* RecoverableError.h */; };\n\t\t3D7749441DC1065C007EC8D8 /* RCTPlatform.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D7749431DC1065C007EC8D8 /* RCTPlatform.m */; };\n\t\t3D7AA9C41E548CD5001955CF /* NSDataBigString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D7AA9C31E548CD5001955CF /* NSDataBigString.mm */; };\n\t\t3D7AA9C51E548CDB001955CF /* NSDataBigString.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7454B31E54786200E74ADD /* NSDataBigString.h */; };\n\t\t3D7AA9C61E548CDD001955CF /* NSDataBigString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D7AA9C31E548CD5001955CF /* NSDataBigString.mm */; };\n\t\t3D7BFD151EA8E351008DFB7A /* RCTPackagerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFD0B1EA8E351008DFB7A /* RCTPackagerClient.h */; };\n\t\t3D7BFD161EA8E351008DFB7A /* RCTPackagerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFD0B1EA8E351008DFB7A /* RCTPackagerClient.h */; };\n\t\t3D7BFD171EA8E351008DFB7A /* RCTPackagerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D7BFD0C1EA8E351008DFB7A /* RCTPackagerClient.m */; };\n\t\t3D7BFD181EA8E351008DFB7A /* RCTPackagerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D7BFD0C1EA8E351008DFB7A /* RCTPackagerClient.m */; };\n\t\t3D7BFD1D1EA8E351008DFB7A /* RCTPackagerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFD0F1EA8E351008DFB7A /* RCTPackagerConnection.h */; };\n\t\t3D7BFD1E1EA8E351008DFB7A /* RCTPackagerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFD0F1EA8E351008DFB7A /* RCTPackagerConnection.h */; };\n\t\t3D7BFD1F1EA8E351008DFB7A /* RCTPackagerConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D7BFD101EA8E351008DFB7A /* RCTPackagerConnection.mm */; };\n\t\t3D7BFD201EA8E351008DFB7A /* RCTPackagerConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D7BFD101EA8E351008DFB7A /* RCTPackagerConnection.mm */; };\n\t\t3D7BFD291EA8E37B008DFB7A /* RCTDevSettings.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130E3D861E6A082100ACE484 /* RCTDevSettings.h */; };\n\t\t3D7BFD2D1EA8E3FA008DFB7A /* RCTReconnectingWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFD2B1EA8E3FA008DFB7A /* RCTReconnectingWebSocket.h */; };\n\t\t3D7BFD2E1EA8E3FA008DFB7A /* RCTReconnectingWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFD2B1EA8E3FA008DFB7A /* RCTReconnectingWebSocket.h */; };\n\t\t3D7BFD2F1EA8E3FA008DFB7A /* RCTSRWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFD2C1EA8E3FA008DFB7A /* RCTSRWebSocket.h */; };\n\t\t3D7BFD301EA8E3FA008DFB7A /* RCTSRWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFD2C1EA8E3FA008DFB7A /* RCTSRWebSocket.h */; };\n\t\t3D7BFD311EA8E41F008DFB7A /* RCTPackagerClient.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFD0B1EA8E351008DFB7A /* RCTPackagerClient.h */; };\n\t\t3D7BFD331EA8E433008DFB7A /* RCTPackagerClient.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFD0B1EA8E351008DFB7A /* RCTPackagerClient.h */; };\n\t\t3D7BFD351EA8E43F008DFB7A /* RCTDevSettings.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130E3D861E6A082100ACE484 /* RCTDevSettings.h */; };\n\t\t3D80D9181DF6F7A80028D040 /* JSBundleType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */; };\n\t\t3D80D91B1DF6F8200028D040 /* RCTPlatform.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D7749431DC1065C007EC8D8 /* RCTPlatform.m */; };\n\t\t3D80D91F1DF6FA890028D040 /* RCTImageLoader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */; };\n\t\t3D80D9201DF6FA890028D040 /* RCTImageStoreManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */; };\n\t\t3D80D9211DF6FA890028D040 /* RCTResizeMode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */; };\n\t\t3D80D9221DF6FA890028D040 /* RCTLinkingManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */; };\n\t\t3D80D9231DF6FA890028D040 /* RCTNetworking.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */; };\n\t\t3D80D9241DF6FA890028D040 /* RCTNetworkTask.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */; };\n\t\t3D80D9251DF6FA890028D040 /* RCTPushNotificationManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08D1DE4F4EE00E03CC6 /* RCTPushNotificationManager.h */; };\n\t\t3D80D9261DF6FA890028D040 /* RCTAssert.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */; };\n\t\t3D80D9271DF6FA890028D040 /* RCTBridge.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */; };\n\t\t3D80D9291DF6FA890028D040 /* RCTBridgeDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */; };\n\t\t3D80D92A1DF6FA890028D040 /* RCTBridgeMethod.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */; };\n\t\t3D80D92B1DF6FA890028D040 /* RCTBridgeModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 830213F31A654E0800B993E6 /* RCTBridgeModule.h */; };\n\t\t3D80D92C1DF6FA890028D040 /* RCTBundleURLProvider.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */; };\n\t\t3D80D92D1DF6FA890028D040 /* RCTConvert.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBACA1A6023D300E9B192 /* RCTConvert.h */; };\n\t\t3D80D92E1DF6FA890028D040 /* RCTDefines.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AF1F851AE6E777005F5298 /* RCTDefines.h */; };\n\t\t3D80D92F1DF6FA890028D040 /* RCTDisplayLink.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */; };\n\t\t3D80D9301DF6FA890028D040 /* RCTErrorCustomizer.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */; };\n\t\t3D80D9311DF6FA890028D040 /* RCTErrorInfo.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */; };\n\t\t3D80D9321DF6FA890028D040 /* RCTEventDispatcher.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */; };\n\t\t3D80D9331DF6FA890028D040 /* RCTFrameUpdate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */; };\n\t\t3D80D9341DF6FA890028D040 /* RCTImageSource.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13BB3D001BECD54500932C10 /* RCTImageSource.h */; };\n\t\t3D80D9351DF6FA890028D040 /* RCTInvalidating.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */; };\n\t\t3D80D9361DF6FA890028D040 /* RCTJavaScriptExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */; };\n\t\t3D80D9371DF6FA890028D040 /* RCTJavaScriptLoader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */; };\n\t\t3D80D9381DF6FA890028D040 /* RCTJSStackFrame.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 008341F51D1DB34400876D9A /* RCTJSStackFrame.h */; };\n\t\t3D80D9391DF6FA890028D040 /* RCTKeyCommands.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */; };\n\t\t3D80D93A1DF6FA890028D040 /* RCTLog.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4D1A601E3B00E9B192 /* RCTLog.h */; };\n\t\t3D80D93B1DF6FA890028D040 /* RCTModuleData.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */; };\n\t\t3D80D93C1DF6FA890028D040 /* RCTModuleMethod.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */; };\n\t\t3D80D93D1DF6FA890028D040 /* RCTMultipartDataTask.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */; };\n\t\t3D80D93E1DF6FA890028D040 /* RCTMultipartStreamReader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */; };\n\t\t3D80D93F1DF6FA890028D040 /* RCTNullability.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20F1C19ABC700845B82 /* RCTNullability.h */; };\n\t\t3D80D9401DF6FA890028D040 /* RCTParserUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */; };\n\t\t3D80D9411DF6FA890028D040 /* RCTPerformanceLogger.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 142014181B32094000CC17BA /* RCTPerformanceLogger.h */; };\n\t\t3D80D9421DF6FA890028D040 /* RCTPlatform.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7749421DC1065C007EC8D8 /* RCTPlatform.h */; };\n\t\t3D80D9431DF6FA890028D040 /* RCTRootView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 830A229C1A66C68A008503DA /* RCTRootView.h */; };\n\t\t3D80D9441DF6FA890028D040 /* RCTRootViewDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */; };\n\t\t3D80D9461DF6FA890028D040 /* RCTTouchEvent.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 391E86A31C623EC800009732 /* RCTTouchEvent.h */; };\n\t\t3D80D9471DF6FA890028D040 /* RCTTouchHandler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */; };\n\t\t3D80D9481DF6FA890028D040 /* RCTURLRequestDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; };\n\t\t3D80D9491DF6FA890028D040 /* RCTURLRequestHandler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; };\n\t\t3D80D94A1DF6FA890028D040 /* RCTUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; };\n\t\t3D80D94F1DF6FA890028D040 /* RCTJSCSamplingProfiler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */; };\n\t\t3D80D9511DF6FA890028D040 /* RCTAlertManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */; };\n\t\t3D80D9521DF6FA890028D040 /* RCTAppState.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1372B7081AB030C200659ED6 /* RCTAppState.h */; };\n\t\t3D80D9531DF6FA890028D040 /* RCTAsyncLocalStorage.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */; };\n\t\t3D80D9541DF6FA890028D040 /* RCTClipboard.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13D033611C1837FE0021DC29 /* RCTClipboard.h */; };\n\t\t3D80D9551DF6FA890028D040 /* RCTDevLoadingView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */; };\n\t\t3D80D9561DF6FA890028D040 /* RCTDevMenu.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2871B74F71200B29F6F /* RCTDevMenu.h */; };\n\t\t3D80D9571DF6FA890028D040 /* RCTEventEmitter.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */; };\n\t\t3D80D9581DF6FA890028D040 /* RCTExceptionsManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */; };\n\t\t3D80D9591DF6FA890028D040 /* RCTI18nManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = B233E6E81D2D843200BC68BA /* RCTI18nManager.h */; };\n\t\t3D80D95A1DF6FA890028D040 /* RCTI18nUtil.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */; };\n\t\t3D80D95C1DF6FA890028D040 /* RCTRedBox.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13F17A831B8493E5007D4C75 /* RCTRedBox.h */; };\n\t\t3D80D95D1DF6FA890028D040 /* RCTSourceCode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */; };\n\t\t3D80D95F1DF6FA890028D040 /* RCTTiming.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FED1A69327A00A75B9A /* RCTTiming.h */; };\n\t\t3D80D9601DF6FA890028D040 /* RCTUIManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E067481A70F434002CDEE1 /* RCTUIManager.h */; };\n\t\t3D80D9611DF6FA890028D040 /* RCTFPSGraph.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */; };\n\t\t3D80D9631DF6FA890028D040 /* RCTMacros.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14BF71811C04795500C97D0C /* RCTMacros.h */; };\n\t\t3D80D9641DF6FA890028D040 /* RCTProfile.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1450FF801BCFF28A00208362 /* RCTProfile.h */; };\n\t\t3D80D9651DF6FA890028D040 /* RCTActivityIndicatorView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = B95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */; };\n\t\t3D80D9661DF6FA890028D040 /* RCTActivityIndicatorViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */; };\n\t\t3D80D9671DF6FA890028D040 /* RCTAnimationType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */; };\n\t\t3D80D9681DF6FA890028D040 /* RCTAutoInsetsProtocol.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */; };\n\t\t3D80D9691DF6FA890028D040 /* RCTBorderDrawing.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */; };\n\t\t3D80D96A1DF6FA890028D040 /* RCTBorderStyle.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = ACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */; };\n\t\t3D80D96B1DF6FA890028D040 /* RCTComponent.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };\n\t\t3D80D96C1DF6FA890028D040 /* RCTComponentData.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };\n\t\t3D80D96D1DF6FA890028D040 /* RCTConvert+CoreLocation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };\n\t\t3D80D96F1DF6FA890028D040 /* RCTDatePicker.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */; };\n\t\t3D80D9701DF6FA890028D040 /* RCTDatePickerManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */; };\n\t\t3D80D9711DF6FA890028D040 /* RCTFont.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };\n\t\t3D80D9761DF6FA890028D040 /* RCTModalHostView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };\n\t\t3D80D9771DF6FA890028D040 /* RCTModalHostViewController.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };\n\t\t3D80D9781DF6FA890028D040 /* RCTModalHostViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };\n\t\t3D80D97D1DF6FA890028D040 /* RCTPicker.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58114A121AAE854800E7D092 /* RCTPicker.h */; };\n\t\t3D80D97E1DF6FA890028D040 /* RCTPickerManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58114A141AAE854800E7D092 /* RCTPickerManager.h */; };\n\t\t3D80D97F1DF6FA890028D040 /* RCTPointerEvents.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */; };\n\t\t3D80D9801DF6FA890028D040 /* RCTProgressViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */; };\n\t\t3D80D9831DF6FA890028D040 /* RCTRootShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */; };\n\t\t3D80D9871DF6FA890028D040 /* RCTSegmentedControl.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */; };\n\t\t3D80D9881DF6FA890028D040 /* RCTSegmentedControlManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */; };\n\t\t3D80D9891DF6FA890028D040 /* RCTShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */; };\n\t\t3D80D98A1DF6FA890028D040 /* RCTSlider.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AF20431AE707F8005F5298 /* RCTSlider.h */; };\n\t\t3D80D98B1DF6FA890028D040 /* RCTSliderManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */; };\n\t\t3D80D98C1DF6FA890028D040 /* RCTSwitch.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F362071AABD06A001CE568 /* RCTSwitch.h */; };\n\t\t3D80D98D1DF6FA890028D040 /* RCTSwitchManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F362091AABD06A001CE568 /* RCTSwitchManager.h */; };\n\t\t3D80D9921DF6FA890028D040 /* RCTTextDecorationLineType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */; };\n\t\t3D80D9931DF6FA890028D040 /* RCTView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674F1A70F44B002CDEE1 /* RCTView.h */; };\n\t\t3D80D9941DF6FA890028D040 /* RCTViewControllerProtocol.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */; };\n\t\t3D80D9951DF6FA890028D040 /* RCTViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */; };\n\t\t3D80D9961DF6FA890028D040 /* RCTWebView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C156011AB1A2840079392D /* RCTWebView.h */; };\n\t\t3D80D9971DF6FA890028D040 /* RCTWebViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C156031AB1A2840079392D /* RCTWebViewManager.h */; };\n\t\t3D80D99A1DF6FA890028D040 /* NSView+React.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E067531A70F44B002CDEE1 /* NSView+React.h */; };\n\t\t3D80DA191DF820620028D040 /* RCTImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */; };\n\t\t3D80DA1A1DF820620028D040 /* RCTImageStoreManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */; };\n\t\t3D80DA1B1DF820620028D040 /* RCTResizeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */; };\n\t\t3D80DA1C1DF820620028D040 /* RCTLinkingManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */; };\n\t\t3D80DA1D1DF820620028D040 /* RCTNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */; };\n\t\t3D80DA1E1DF820620028D040 /* RCTNetworkTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */; };\n\t\t3D80DA1F1DF820620028D040 /* RCTPushNotificationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08D1DE4F4EE00E03CC6 /* RCTPushNotificationManager.h */; };\n\t\t3D80DA201DF820620028D040 /* RCTAssert.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */; };\n\t\t3D80DA211DF820620028D040 /* RCTBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */; };\n\t\t3D80DA221DF820620028D040 /* RCTBridge+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */; };\n\t\t3D80DA231DF820620028D040 /* RCTBridgeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */; };\n\t\t3D80DA241DF820620028D040 /* RCTBridgeMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */; };\n\t\t3D80DA251DF820620028D040 /* RCTBridgeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 830213F31A654E0800B993E6 /* RCTBridgeModule.h */; };\n\t\t3D80DA261DF820620028D040 /* RCTBundleURLProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */; };\n\t\t3D80DA271DF820620028D040 /* RCTConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBACA1A6023D300E9B192 /* RCTConvert.h */; };\n\t\t3D80DA281DF820620028D040 /* RCTDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AF1F851AE6E777005F5298 /* RCTDefines.h */; };\n\t\t3D80DA291DF820620028D040 /* RCTDisplayLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */; };\n\t\t3D80DA2A1DF820620028D040 /* RCTErrorCustomizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */; };\n\t\t3D80DA2B1DF820620028D040 /* RCTErrorInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */; };\n\t\t3D80DA2C1DF820620028D040 /* RCTEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */; };\n\t\t3D80DA2D1DF820620028D040 /* RCTFrameUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */; };\n\t\t3D80DA2E1DF820620028D040 /* RCTImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 13BB3D001BECD54500932C10 /* RCTImageSource.h */; };\n\t\t3D80DA2F1DF820620028D040 /* RCTInvalidating.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */; };\n\t\t3D80DA301DF820620028D040 /* RCTJavaScriptExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */; };\n\t\t3D80DA311DF820620028D040 /* RCTJavaScriptLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */; };\n\t\t3D80DA321DF820620028D040 /* RCTJSStackFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 008341F51D1DB34400876D9A /* RCTJSStackFrame.h */; };\n\t\t3D80DA331DF820620028D040 /* RCTKeyCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */; };\n\t\t3D80DA341DF820620028D040 /* RCTLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4D1A601E3B00E9B192 /* RCTLog.h */; };\n\t\t3D80DA351DF820620028D040 /* RCTModuleData.h in Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */; };\n\t\t3D80DA361DF820620028D040 /* RCTModuleMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */; };\n\t\t3D80DA371DF820620028D040 /* RCTMultipartDataTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */; };\n\t\t3D80DA381DF820620028D040 /* RCTMultipartStreamReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */; };\n\t\t3D80DA391DF820620028D040 /* RCTNullability.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20F1C19ABC700845B82 /* RCTNullability.h */; };\n\t\t3D80DA3A1DF820620028D040 /* RCTParserUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */; };\n\t\t3D80DA3B1DF820620028D040 /* RCTPerformanceLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 142014181B32094000CC17BA /* RCTPerformanceLogger.h */; };\n\t\t3D80DA3C1DF820620028D040 /* RCTPlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7749421DC1065C007EC8D8 /* RCTPlatform.h */; };\n\t\t3D80DA3D1DF820620028D040 /* RCTRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 830A229C1A66C68A008503DA /* RCTRootView.h */; };\n\t\t3D80DA3E1DF820620028D040 /* RCTRootViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */; };\n\t\t3D80DA3F1DF820620028D040 /* RCTRootViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A15FB0C1BDF663500531DFB /* RCTRootViewInternal.h */; };\n\t\t3D80DA401DF820620028D040 /* RCTTouchEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 391E86A31C623EC800009732 /* RCTTouchEvent.h */; };\n\t\t3D80DA411DF820620028D040 /* RCTTouchHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */; };\n\t\t3D80DA421DF820620028D040 /* RCTURLRequestDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; };\n\t\t3D80DA431DF820620028D040 /* RCTURLRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; };\n\t\t3D80DA441DF820620028D040 /* RCTUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; };\n\t\t3D80DA491DF820620028D040 /* RCTJSCSamplingProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */; };\n\t\t3D80DA4B1DF820620028D040 /* RCTAlertManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */; };\n\t\t3D80DA4C1DF820620028D040 /* RCTAppState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1372B7081AB030C200659ED6 /* RCTAppState.h */; };\n\t\t3D80DA4D1DF820620028D040 /* RCTAsyncLocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */; };\n\t\t3D80DA4E1DF820620028D040 /* RCTClipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 13D033611C1837FE0021DC29 /* RCTClipboard.h */; };\n\t\t3D80DA4F1DF820620028D040 /* RCTDevLoadingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */; };\n\t\t3D80DA501DF820620028D040 /* RCTDevMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2871B74F71200B29F6F /* RCTDevMenu.h */; };\n\t\t3D80DA511DF820620028D040 /* RCTEventEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */; };\n\t\t3D80DA521DF820620028D040 /* RCTExceptionsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */; };\n\t\t3D80DA531DF820620028D040 /* RCTI18nManager.h in Headers */ = {isa = PBXBuildFile; fileRef = B233E6E81D2D843200BC68BA /* RCTI18nManager.h */; };\n\t\t3D80DA541DF820620028D040 /* RCTI18nUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */; };\n\t\t3D80DA561DF820620028D040 /* RCTRedBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 13F17A831B8493E5007D4C75 /* RCTRedBox.h */; };\n\t\t3D80DA571DF820620028D040 /* RCTSourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */; };\n\t\t3D80DA591DF820620028D040 /* RCTTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FED1A69327A00A75B9A /* RCTTiming.h */; };\n\t\t3D80DA5A1DF820620028D040 /* RCTUIManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E067481A70F434002CDEE1 /* RCTUIManager.h */; };\n\t\t3D80DA5B1DF820620028D040 /* RCTFPSGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */; };\n\t\t3D80DA5D1DF820620028D040 /* RCTMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BF71811C04795500C97D0C /* RCTMacros.h */; };\n\t\t3D80DA5E1DF820620028D040 /* RCTProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 1450FF801BCFF28A00208362 /* RCTProfile.h */; };\n\t\t3D80DA5F1DF820620028D040 /* RCTActivityIndicatorView.h in Headers */ = {isa = PBXBuildFile; fileRef = B95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */; };\n\t\t3D80DA601DF820620028D040 /* RCTActivityIndicatorViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */; };\n\t\t3D80DA611DF820620028D040 /* RCTAnimationType.h in Headers */ = {isa = PBXBuildFile; fileRef = 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */; };\n\t\t3D80DA621DF820620028D040 /* RCTAutoInsetsProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */; };\n\t\t3D80DA631DF820620028D040 /* RCTBorderDrawing.h in Headers */ = {isa = PBXBuildFile; fileRef = 13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */; };\n\t\t3D80DA641DF820620028D040 /* RCTBorderStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = ACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */; };\n\t\t3D80DA651DF820620028D040 /* RCTComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };\n\t\t3D80DA661DF820620028D040 /* RCTComponentData.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };\n\t\t3D80DA671DF820620028D040 /* RCTConvert+CoreLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };\n\t\t3D80DA691DF820620028D040 /* RCTDatePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */; };\n\t\t3D80DA6A1DF820620028D040 /* RCTDatePickerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */; };\n\t\t3D80DA6B1DF820620028D040 /* RCTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };\n\t\t3D80DA701DF820620028D040 /* RCTModalHostView.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };\n\t\t3D80DA711DF820620028D040 /* RCTModalHostViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };\n\t\t3D80DA721DF820620028D040 /* RCTModalHostViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };\n\t\t3D80DA771DF820620028D040 /* RCTPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 58114A121AAE854800E7D092 /* RCTPicker.h */; };\n\t\t3D80DA781DF820620028D040 /* RCTPickerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 58114A141AAE854800E7D092 /* RCTPickerManager.h */; };\n\t\t3D80DA791DF820620028D040 /* RCTPointerEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */; };\n\t\t3D80DA7A1DF820620028D040 /* RCTProgressViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */; };\n\t\t3D80DA7D1DF820620028D040 /* RCTRootShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */; };\n\t\t3D80DA811DF820620028D040 /* RCTSegmentedControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */; };\n\t\t3D80DA821DF820620028D040 /* RCTSegmentedControlManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */; };\n\t\t3D80DA831DF820620028D040 /* RCTShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */; };\n\t\t3D80DA841DF820620028D040 /* RCTSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AF20431AE707F8005F5298 /* RCTSlider.h */; };\n\t\t3D80DA851DF820620028D040 /* RCTSliderManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */; };\n\t\t3D80DA861DF820620028D040 /* RCTSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F362071AABD06A001CE568 /* RCTSwitch.h */; };\n\t\t3D80DA871DF820620028D040 /* RCTSwitchManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F362091AABD06A001CE568 /* RCTSwitchManager.h */; };\n\t\t3D80DA8C1DF820620028D040 /* RCTTextDecorationLineType.h in Headers */ = {isa = PBXBuildFile; fileRef = E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */; };\n\t\t3D80DA8D1DF820620028D040 /* RCTView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674F1A70F44B002CDEE1 /* RCTView.h */; };\n\t\t3D80DA8E1DF820620028D040 /* RCTViewControllerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */; };\n\t\t3D80DA8F1DF820620028D040 /* RCTViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */; };\n\t\t3D80DA901DF820620028D040 /* RCTWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C156011AB1A2840079392D /* RCTWebView.h */; };\n\t\t3D80DA911DF820620028D040 /* RCTWebViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C156031AB1A2840079392D /* RCTWebViewManager.h */; };\n\t\t3D80DA931DF820620028D040 /* NSView+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 83F15A171B7CC46900F10295 /* NSView+Private.h */; };\n\t\t3D80DA941DF820620028D040 /* NSView+React.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E067531A70F44B002CDEE1 /* NSView+React.h */; };\n\t\t3D8ED92C1E5B120100D83D20 /* libcxxreact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD9321DE5FBEE00167DC4 /* libcxxreact.a */; };\n\t\t3D8ED92D1E5B120100D83D20 /* libyoga.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3C06751DE3340C00C268FA /* libyoga.a */; };\n\t\t3DA9819E1E5B0DBB004F2374 /* NSDataBigString.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7454B31E54786200E74ADD /* NSDataBigString.h */; };\n\t\t3DA981A01E5B0E34004F2374 /* CxxModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A71E03699D0018521A /* CxxModule.h */; };\n\t\t3DA981A11E5B0E34004F2374 /* CxxNativeModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A91E03699D0018521A /* CxxNativeModule.h */; };\n\t\t3DA981A21E5B0E34004F2374 /* JSExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* JSExecutor.h */; };\n\t\t3DA981A51E5B0E34004F2374 /* Instance.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AF1E03699D0018521A /* Instance.h */; };\n\t\t3DA981A61E5B0E34004F2374 /* JsArgumentHelpers-inl.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */; };\n\t\t3DA981A71E5B0E34004F2374 /* JsArgumentHelpers.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B11E03699D0018521A /* JsArgumentHelpers.h */; };\n\t\t3DA981A81E5B0E34004F2374 /* JSBigString.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7454781E54757500E74ADD /* JSBigString.h */; };\n\t\t3DA981A91E5B0E34004F2374 /* JSBundleType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */; };\n\t\t3DA981AA1E5B0E34004F2374 /* JSCExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B31E03699D0018521A /* JSCExecutor.h */; };\n\t\t3DA981AC1E5B0E34004F2374 /* JSCLegacyTracing.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B71E03699D0018521A /* JSCLegacyTracing.h */; };\n\t\t3DA981AD1E5B0E34004F2374 /* JSCMemory.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B91E03699D0018521A /* JSCMemory.h */; };\n\t\t3DA981AE1E5B0E34004F2374 /* JSCNativeModules.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BB1E03699D0018521A /* JSCNativeModules.h */; };\n\t\t3DA981AF1E5B0E34004F2374 /* JSCPerfStats.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BD1E03699D0018521A /* JSCPerfStats.h */; };\n\t\t3DA981B01E5B0E34004F2374 /* JSCSamplingProfiler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BF1E03699D0018521A /* JSCSamplingProfiler.h */; };\n\t\t3DA981B11E5B0E34004F2374 /* JSCUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C31E03699D0018521A /* JSCUtils.h */; };\n\t\t3DA981B31E5B0E34004F2374 /* JSIndexedRAMBundle.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C71E03699D0018521A /* JSIndexedRAMBundle.h */; };\n\t\t3DA981B41E5B0E34004F2374 /* JSModulesUnbundle.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C81E03699D0018521A /* JSModulesUnbundle.h */; };\n\t\t3DA981B51E5B0E34004F2374 /* MessageQueueThread.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C91E03699D0018521A /* MessageQueueThread.h */; };\n\t\t3DA981B61E5B0E34004F2374 /* MethodCall.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CB1E03699D0018521A /* MethodCall.h */; };\n\t\t3DA981B71E5B0E34004F2374 /* ModuleRegistry.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CD1E03699D0018521A /* ModuleRegistry.h */; };\n\t\t3DA981B81E5B0E34004F2374 /* NativeModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CE1E03699D0018521A /* NativeModule.h */; };\n\t\t3DA981B91E5B0E34004F2374 /* NativeToJsBridge.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D01E03699D0018521A /* NativeToJsBridge.h */; };\n\t\t3DA981BA1E5B0E34004F2374 /* oss-compat-util.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = AC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */; };\n\t\t3DA981BB1E5B0E34004F2374 /* Platform.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D21E03699D0018521A /* Platform.h */; };\n\t\t3DA981BC1E5B0E34004F2374 /* RecoverableError.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7454791E54757500E74ADD /* RecoverableError.h */; };\n\t\t3DA981BD1E5B0E34004F2374 /* SampleCxxModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D41E03699D0018521A /* SampleCxxModule.h */; };\n\t\t3DA981BE1E5B0E34004F2374 /* SystraceSection.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D51E03699D0018521A /* SystraceSection.h */; };\n\t\t3DA981BF1E5B0F29004F2374 /* RCTAssert.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */; };\n\t\t3DA981C01E5B0F29004F2374 /* RCTBridge.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */; };\n\t\t3DA981C21E5B0F29004F2374 /* RCTBridgeDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */; };\n\t\t3DA981C31E5B0F29004F2374 /* RCTBridgeMethod.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */; };\n\t\t3DA981C41E5B0F29004F2374 /* RCTBridgeModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 830213F31A654E0800B993E6 /* RCTBridgeModule.h */; };\n\t\t3DA981C51E5B0F29004F2374 /* RCTBundleURLProvider.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */; };\n\t\t3DA981C61E5B0F29004F2374 /* RCTConvert.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBACA1A6023D300E9B192 /* RCTConvert.h */; };\n\t\t3DA981C71E5B0F29004F2374 /* RCTDefines.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AF1F851AE6E777005F5298 /* RCTDefines.h */; };\n\t\t3DA981C81E5B0F29004F2374 /* RCTDisplayLink.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */; };\n\t\t3DA981C91E5B0F29004F2374 /* RCTErrorCustomizer.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */; };\n\t\t3DA981CA1E5B0F29004F2374 /* RCTErrorInfo.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */; };\n\t\t3DA981CB1E5B0F29004F2374 /* RCTEventDispatcher.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */; };\n\t\t3DA981CC1E5B0F29004F2374 /* RCTFrameUpdate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */; };\n\t\t3DA981CD1E5B0F29004F2374 /* RCTImageSource.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13BB3D001BECD54500932C10 /* RCTImageSource.h */; };\n\t\t3DA981CE1E5B0F29004F2374 /* RCTInvalidating.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */; };\n\t\t3DA981CF1E5B0F29004F2374 /* RCTJavaScriptExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */; };\n\t\t3DA981D01E5B0F29004F2374 /* RCTJavaScriptLoader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */; };\n\t\t3DA981D11E5B0F29004F2374 /* RCTJSStackFrame.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 008341F51D1DB34400876D9A /* RCTJSStackFrame.h */; };\n\t\t3DA981D21E5B0F29004F2374 /* RCTKeyCommands.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */; };\n\t\t3DA981D31E5B0F29004F2374 /* RCTLog.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4D1A601E3B00E9B192 /* RCTLog.h */; };\n\t\t3DA981D41E5B0F29004F2374 /* RCTModuleData.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */; };\n\t\t3DA981D51E5B0F29004F2374 /* RCTModuleMethod.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */; };\n\t\t3DA981D61E5B0F29004F2374 /* RCTMultipartDataTask.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */; };\n\t\t3DA981D71E5B0F29004F2374 /* RCTMultipartStreamReader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */; };\n\t\t3DA981D81E5B0F29004F2374 /* RCTNullability.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20F1C19ABC700845B82 /* RCTNullability.h */; };\n\t\t3DA981D91E5B0F29004F2374 /* RCTParserUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */; };\n\t\t3DA981DA1E5B0F29004F2374 /* RCTPerformanceLogger.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 142014181B32094000CC17BA /* RCTPerformanceLogger.h */; };\n\t\t3DA981DB1E5B0F29004F2374 /* RCTPlatform.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7749421DC1065C007EC8D8 /* RCTPlatform.h */; };\n\t\t3DA981DC1E5B0F29004F2374 /* RCTReloadCommand.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; };\n\t\t3DA981DD1E5B0F29004F2374 /* RCTRootContentView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59A7B9FB1E577DBF0068EDBF /* RCTRootContentView.h */; };\n\t\t3DA981DE1E5B0F29004F2374 /* RCTRootView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 830A229C1A66C68A008503DA /* RCTRootView.h */; };\n\t\t3DA981DF1E5B0F29004F2374 /* RCTRootViewDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */; };\n\t\t3DA981E11E5B0F29004F2374 /* RCTTouchEvent.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 391E86A31C623EC800009732 /* RCTTouchEvent.h */; };\n\t\t3DA981E21E5B0F29004F2374 /* RCTTouchHandler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */; };\n\t\t3DA981E31E5B0F29004F2374 /* RCTURLRequestDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; };\n\t\t3DA981E41E5B0F29004F2374 /* RCTURLRequestHandler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; };\n\t\t3DA981E51E5B0F29004F2374 /* RCTUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; };\n\t\t3DA981E91E5B0F7F004F2374 /* RCTJSCSamplingProfiler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */; };\n\t\t3DA981EB1E5B0F7F004F2374 /* RCTAlertManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */; };\n\t\t3DA981EC1E5B0F7F004F2374 /* RCTAppState.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1372B7081AB030C200659ED6 /* RCTAppState.h */; };\n\t\t3DA981ED1E5B0F7F004F2374 /* RCTAsyncLocalStorage.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */; };\n\t\t3DA981EE1E5B0F7F004F2374 /* RCTClipboard.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13D033611C1837FE0021DC29 /* RCTClipboard.h */; };\n\t\t3DA981EF1E5B0F7F004F2374 /* RCTDevLoadingView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */; };\n\t\t3DA981F01E5B0F7F004F2374 /* RCTDevMenu.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2871B74F71200B29F6F /* RCTDevMenu.h */; };\n\t\t3DA981F11E5B0F7F004F2374 /* RCTEventEmitter.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */; };\n\t\t3DA981F21E5B0F7F004F2374 /* RCTExceptionsManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */; };\n\t\t3DA981F31E5B0F7F004F2374 /* RCTI18nManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = B233E6E81D2D843200BC68BA /* RCTI18nManager.h */; };\n\t\t3DA981F41E5B0F7F004F2374 /* RCTI18nUtil.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */; };\n\t\t3DA981F61E5B0F7F004F2374 /* RCTRedBox.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13F17A831B8493E5007D4C75 /* RCTRedBox.h */; };\n\t\t3DA981F71E5B0F7F004F2374 /* RCTSourceCode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */; };\n\t\t3DA981F91E5B0F7F004F2374 /* RCTTiming.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FED1A69327A00A75B9A /* RCTTiming.h */; };\n\t\t3DA981FA1E5B0F7F004F2374 /* RCTUIManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E067481A70F434002CDEE1 /* RCTUIManager.h */; };\n\t\t3DA981FB1E5B0F7F004F2374 /* RCTFPSGraph.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */; };\n\t\t3DA981FD1E5B0F7F004F2374 /* RCTMacros.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14BF71811C04795500C97D0C /* RCTMacros.h */; };\n\t\t3DA981FE1E5B0F7F004F2374 /* RCTProfile.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1450FF801BCFF28A00208362 /* RCTProfile.h */; };\n\t\t3DA981FF1E5B0F7F004F2374 /* RCTActivityIndicatorView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = B95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */; };\n\t\t3DA982001E5B0F7F004F2374 /* RCTActivityIndicatorViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */; };\n\t\t3DA982011E5B0F7F004F2374 /* RCTAnimationType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */; };\n\t\t3DA982021E5B0F7F004F2374 /* RCTAutoInsetsProtocol.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */; };\n\t\t3DA982031E5B0F7F004F2374 /* RCTBorderDrawing.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */; };\n\t\t3DA982041E5B0F7F004F2374 /* RCTBorderStyle.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = ACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */; };\n\t\t3DA982051E5B0F7F004F2374 /* RCTComponent.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };\n\t\t3DA982061E5B0F7F004F2374 /* RCTComponentData.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };\n\t\t3DA982071E5B0F7F004F2374 /* RCTConvert+CoreLocation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };\n\t\t3DA9820A1E5B0F7F004F2374 /* RCTDatePicker.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */; };\n\t\t3DA9820B1E5B0F7F004F2374 /* RCTDatePickerManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */; };\n\t\t3DA9820C1E5B0F7F004F2374 /* RCTFont.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };\n\t\t3DA982111E5B0F7F004F2374 /* RCTModalHostView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };\n\t\t3DA982121E5B0F7F004F2374 /* RCTModalHostViewController.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };\n\t\t3DA982131E5B0F7F004F2374 /* RCTModalHostViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };\n\t\t3DA982181E5B0F7F004F2374 /* RCTPicker.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58114A121AAE854800E7D092 /* RCTPicker.h */; };\n\t\t3DA982191E5B0F7F004F2374 /* RCTPickerManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58114A141AAE854800E7D092 /* RCTPickerManager.h */; };\n\t\t3DA9821A1E5B0F7F004F2374 /* RCTPointerEvents.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */; };\n\t\t3DA9821B1E5B0F7F004F2374 /* RCTProgressViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */; };\n\t\t3DA9821E1E5B0F7F004F2374 /* RCTRootShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */; };\n\t\t3DA982241E5B0F7F004F2374 /* RCTSegmentedControl.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */; };\n\t\t3DA982251E5B0F7F004F2374 /* RCTSegmentedControlManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */; };\n\t\t3DA982261E5B0F7F004F2374 /* RCTShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */; };\n\t\t3DA982271E5B0F7F004F2374 /* RCTSlider.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AF20431AE707F8005F5298 /* RCTSlider.h */; };\n\t\t3DA982281E5B0F7F004F2374 /* RCTSliderManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */; };\n\t\t3DA982291E5B0F7F004F2374 /* RCTSwitch.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F362071AABD06A001CE568 /* RCTSwitch.h */; };\n\t\t3DA9822A1E5B0F7F004F2374 /* RCTSwitchManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F362091AABD06A001CE568 /* RCTSwitchManager.h */; };\n\t\t3DA9822F1E5B0F7F004F2374 /* RCTTextDecorationLineType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */; };\n\t\t3DA982311E5B0F7F004F2374 /* RCTView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674F1A70F44B002CDEE1 /* RCTView.h */; };\n\t\t3DA982321E5B0F7F004F2374 /* RCTViewControllerProtocol.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */; };\n\t\t3DA982331E5B0F7F004F2374 /* RCTViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */; };\n\t\t3DA982341E5B0F7F004F2374 /* RCTWebView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C156011AB1A2840079392D /* RCTWebView.h */; };\n\t\t3DA982351E5B0F7F004F2374 /* RCTWebViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C156031AB1A2840079392D /* RCTWebViewManager.h */; };\n\t\t3DA982381E5B0F7F004F2374 /* NSView+React.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E067531A70F44B002CDEE1 /* NSView+React.h */; };\n\t\t3DA982391E5B0F8A004F2374 /* NSView+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 83F15A171B7CC46900F10295 /* NSView+Private.h */; };\n\t\t3DA9823B1E5B1053004F2374 /* CxxModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A71E03699D0018521A /* CxxModule.h */; };\n\t\t3DA9823C1E5B1053004F2374 /* CxxNativeModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A91E03699D0018521A /* CxxNativeModule.h */; };\n\t\t3DA9823D1E5B1053004F2374 /* JSExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* JSExecutor.h */; };\n\t\t3DA982401E5B1053004F2374 /* Instance.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AF1E03699D0018521A /* Instance.h */; };\n\t\t3DA982411E5B1053004F2374 /* JsArgumentHelpers-inl.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */; };\n\t\t3DA982421E5B1053004F2374 /* JsArgumentHelpers.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B11E03699D0018521A /* JsArgumentHelpers.h */; };\n\t\t3DA982431E5B1053004F2374 /* JSBigString.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7454781E54757500E74ADD /* JSBigString.h */; };\n\t\t3DA982441E5B1053004F2374 /* JSBundleType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */; };\n\t\t3DA982451E5B1053004F2374 /* JSCExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B31E03699D0018521A /* JSCExecutor.h */; };\n\t\t3DA982471E5B1053004F2374 /* JSCLegacyTracing.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B71E03699D0018521A /* JSCLegacyTracing.h */; };\n\t\t3DA982481E5B1053004F2374 /* JSCMemory.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B91E03699D0018521A /* JSCMemory.h */; };\n\t\t3DA982491E5B1053004F2374 /* JSCNativeModules.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BB1E03699D0018521A /* JSCNativeModules.h */; };\n\t\t3DA9824A1E5B1053004F2374 /* JSCPerfStats.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BD1E03699D0018521A /* JSCPerfStats.h */; };\n\t\t3DA9824B1E5B1053004F2374 /* JSCSamplingProfiler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0BF1E03699D0018521A /* JSCSamplingProfiler.h */; };\n\t\t3DA9824C1E5B1053004F2374 /* JSCUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C31E03699D0018521A /* JSCUtils.h */; };\n\t\t3DA9824E1E5B1053004F2374 /* JSIndexedRAMBundle.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C71E03699D0018521A /* JSIndexedRAMBundle.h */; };\n\t\t3DA9824F1E5B1053004F2374 /* JSModulesUnbundle.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C81E03699D0018521A /* JSModulesUnbundle.h */; };\n\t\t3DA982501E5B1053004F2374 /* MessageQueueThread.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0C91E03699D0018521A /* MessageQueueThread.h */; };\n\t\t3DA982511E5B1053004F2374 /* MethodCall.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CB1E03699D0018521A /* MethodCall.h */; };\n\t\t3DA982521E5B1053004F2374 /* ModuleRegistry.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CD1E03699D0018521A /* ModuleRegistry.h */; };\n\t\t3DA982531E5B1053004F2374 /* NativeModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0CE1E03699D0018521A /* NativeModule.h */; };\n\t\t3DA982541E5B1053004F2374 /* NativeToJsBridge.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D01E03699D0018521A /* NativeToJsBridge.h */; };\n\t\t3DA982551E5B1053004F2374 /* oss-compat-util.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = AC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */; };\n\t\t3DA982561E5B1053004F2374 /* Platform.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D21E03699D0018521A /* Platform.h */; };\n\t\t3DA982571E5B1053004F2374 /* RecoverableError.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7454791E54757500E74ADD /* RecoverableError.h */; };\n\t\t3DA982581E5B1053004F2374 /* SampleCxxModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D41E03699D0018521A /* SampleCxxModule.h */; };\n\t\t3DA982591E5B1053004F2374 /* SystraceSection.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D51E03699D0018521A /* SystraceSection.h */; };\n\t\t3DA9825A1E5B1079004F2374 /* JavaScriptCore.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */; };\n\t\t3DA9825B1E5B1079004F2374 /* JSCHelpers.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B1081E0369AD0018521A /* JSCHelpers.h */; };\n\t\t3DA9825C1E5B1079004F2374 /* JSCWrapper.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */; };\n\t\t3DA9825D1E5B1079004F2374 /* noncopyable.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B1091E0369AD0018521A /* noncopyable.h */; };\n\t\t3DA9825E1E5B1079004F2374 /* Unicode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B10B1E0369AD0018521A /* Unicode.h */; };\n\t\t3DA9825F1E5B1079004F2374 /* Value.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B10D1E0369AD0018521A /* Value.h */; };\n\t\t3DA982601E5B1089004F2374 /* JSCHelpers.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B1081E0369AD0018521A /* JSCHelpers.h */; };\n\t\t3DA982611E5B1089004F2374 /* noncopyable.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B1091E0369AD0018521A /* noncopyable.h */; };\n\t\t3DA982621E5B1089004F2374 /* Unicode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B10B1E0369AD0018521A /* Unicode.h */; };\n\t\t3DA982631E5B1089004F2374 /* Value.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B10D1E0369AD0018521A /* Value.h */; };\n\t\t3DC159E41E83E1AE007B1282 /* RCTRootContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A7B9FC1E577DBF0068EDBF /* RCTRootContentView.m */; };\n\t\t3DC159E51E83E1E9007B1282 /* JSBigString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27B958731E57587D0096647A /* JSBigString.cpp */; };\n\t\t3DC159E61E83E1FA007B1282 /* JSBigString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27B958731E57587D0096647A /* JSBigString.cpp */; };\n\t\t3DCD185D1DF978E7007FE5A1 /* RCTReloadCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = A2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */; };\n\t\t3DDEC1521DDCE0CA0020BBDF /* RCTJSCSamplingProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 369123E01DDC75850095B341 /* RCTJSCSamplingProfiler.m */; };\n\t\t3DE4F8681DF85D8E00B9E5A0 /* YGEnums.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77031DF767AF001F9587 /* YGEnums.h */; };\n\t\t3DE4F8691DF85D8E00B9E5A0 /* YGMacros.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77041DF767AF001F9587 /* YGMacros.h */; };\n\t\t3DE4F86A1DF85D8E00B9E5A0 /* Yoga.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77081DF767AF001F9587 /* Yoga.h */; };\n\t\t3DF1BE821F26576400068F1A /* JSCTracing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3DF1BE801F26576400068F1A /* JSCTracing.cpp */; };\n\t\t3DF1BE831F26576400068F1A /* JSCTracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DF1BE811F26576400068F1A /* JSCTracing.h */; };\n\t\t3DF1BE841F26577000068F1A /* JSCTracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DF1BE811F26576400068F1A /* JSCTracing.h */; };\n\t\t3DF1BE851F26577300068F1A /* JSCTracing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3DF1BE801F26576400068F1A /* JSCTracing.cpp */; };\n\t\t3DFE0D161DF8574D00459392 /* YGEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77031DF767AF001F9587 /* YGEnums.h */; };\n\t\t3DFE0D171DF8574D00459392 /* YGMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77041DF767AF001F9587 /* YGMacros.h */; };\n\t\t3DFE0D191DF8574D00459392 /* Yoga.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77081DF767AF001F9587 /* Yoga.h */; };\n\t\t3DFE0D1A1DF8575800459392 /* YGEnums.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77031DF767AF001F9587 /* YGEnums.h */; };\n\t\t3DFE0D1B1DF8575800459392 /* YGMacros.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77041DF767AF001F9587 /* YGMacros.h */; };\n\t\t3DFE0D1C1DF8575800459392 /* Yoga.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77081DF767AF001F9587 /* Yoga.h */; };\n\t\t3EDCA8A51D3591E700450C31 /* RCTErrorInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */; };\n\t\t5376C5E41FC6DDBC0083513D /* YGNodePrint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5376C5E11FC6DDB20083513D /* YGNodePrint.cpp */; };\n\t\t5376C5E51FC6DDBD0083513D /* YGNodePrint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5376C5E11FC6DDB20083513D /* YGNodePrint.cpp */; };\n\t\t5376C5E61FC6DDC10083513D /* YGNodePrint.h in Headers */ = {isa = PBXBuildFile; fileRef = 5376C5E01FC6DDB20083513D /* YGNodePrint.h */; };\n\t\t5376C5E71FC6DDC20083513D /* YGNodePrint.h in Headers */ = {isa = PBXBuildFile; fileRef = 5376C5E01FC6DDB20083513D /* YGNodePrint.h */; };\n\t\t53D123971FBF1DF5001B8A10 /* libyoga.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3C059A1DE3340900C268FA /* libyoga.a */; };\n\t\t53D1239A1FBF1EF2001B8A10 /* YGEnums.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBF1861FB4FE80002CBB31 /* YGEnums.cpp */; };\n\t\t53D1239B1FBF1EF4001B8A10 /* YGEnums.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBF1861FB4FE80002CBB31 /* YGEnums.cpp */; };\n\t\t53D1239E1FBF1EFB001B8A10 /* Yoga-internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 53CBF1851FB4FE80002CBB31 /* Yoga-internal.h */; };\n\t\t53D1239F1FBF1EFB001B8A10 /* Yoga-internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 53CBF1851FB4FE80002CBB31 /* Yoga-internal.h */; };\n\t\t53D123A01FBF1EFF001B8A10 /* Yoga.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBF1871FB4FE80002CBB31 /* Yoga.cpp */; };\n\t\t53D123A11FBF1EFF001B8A10 /* Yoga.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBF1871FB4FE80002CBB31 /* Yoga.cpp */; };\n\t\t53D123B21FBF220F001B8A10 /* Yoga.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77081DF767AF001F9587 /* Yoga.h */; };\n\t\t58114A161AAE854800E7D092 /* RCTPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A131AAE854800E7D092 /* RCTPicker.m */; };\n\t\t58114A171AAE854800E7D092 /* RCTPickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A151AAE854800E7D092 /* RCTPickerManager.m */; };\n\t\t58114A501AAE93D500E7D092 /* RCTAsyncLocalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A4E1AAE93D500E7D092 /* RCTAsyncLocalStorage.m */; };\n\t\t58C571C11AA56C1900CDF9C8 /* RCTDatePickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */; };\n\t\t590D7BFD1EBD458B00D8A370 /* RCTShadowView+Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 590D7BFB1EBD458B00D8A370 /* RCTShadowView+Layout.h */; };\n\t\t590D7BFE1EBD458B00D8A370 /* RCTShadowView+Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 590D7BFB1EBD458B00D8A370 /* RCTShadowView+Layout.h */; };\n\t\t590D7BFF1EBD458B00D8A370 /* RCTShadowView+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 590D7BFC1EBD458B00D8A370 /* RCTShadowView+Layout.m */; };\n\t\t590D7C001EBD458B00D8A370 /* RCTShadowView+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 590D7BFC1EBD458B00D8A370 /* RCTShadowView+Layout.m */; };\n\t\t59283CA01FD67321000EAAB9 /* RCTSurfaceStage.m in Sources */ = {isa = PBXBuildFile; fileRef = 59283C9F1FD67320000EAAB9 /* RCTSurfaceStage.m */; };\n\t\t59283CA11FD67321000EAAB9 /* RCTSurfaceStage.m in Sources */ = {isa = PBXBuildFile; fileRef = 59283C9F1FD67320000EAAB9 /* RCTSurfaceStage.m */; };\n\t\t594F0A321FD23228007FBE96 /* RCTSurfaceHostingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 594F0A2F1FD23228007FBE96 /* RCTSurfaceHostingView.h */; };\n\t\t594F0A331FD23228007FBE96 /* RCTSurfaceHostingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 594F0A2F1FD23228007FBE96 /* RCTSurfaceHostingView.h */; };\n\t\t594F0A341FD23228007FBE96 /* RCTSurfaceHostingView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 594F0A301FD23228007FBE96 /* RCTSurfaceHostingView.mm */; };\n\t\t594F0A351FD23228007FBE96 /* RCTSurfaceHostingView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 594F0A301FD23228007FBE96 /* RCTSurfaceHostingView.mm */; };\n\t\t594F0A361FD23228007FBE96 /* RCTSurfaceSizeMeasureMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 594F0A311FD23228007FBE96 /* RCTSurfaceSizeMeasureMode.h */; };\n\t\t594F0A371FD23228007FBE96 /* RCTSurfaceSizeMeasureMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 594F0A311FD23228007FBE96 /* RCTSurfaceSizeMeasureMode.h */; };\n\t\t594F0A381FD233A2007FBE96 /* RCTSurface.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2A1FB274970058CCF6 /* RCTSurface.h */; };\n\t\t594F0A391FD233A2007FBE96 /* RCTSurfaceDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2C1FB274970058CCF6 /* RCTSurfaceDelegate.h */; };\n\t\t594F0A3A1FD233A2007FBE96 /* RCTSurfaceRootShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2D1FB274970058CCF6 /* RCTSurfaceRootShadowView.h */; };\n\t\t594F0A3B1FD233A2007FBE96 /* RCTSurfaceRootShadowViewDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2F1FB274970058CCF6 /* RCTSurfaceRootShadowViewDelegate.h */; };\n\t\t594F0A3C1FD233A2007FBE96 /* RCTSurfaceRootView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA301FB274970058CCF6 /* RCTSurfaceRootView.h */; };\n\t\t594F0A3D1FD233A2007FBE96 /* RCTSurfaceStage.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA321FB274970058CCF6 /* RCTSurfaceStage.h */; };\n\t\t594F0A3E1FD233A2007FBE96 /* RCTSurfaceView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA341FB274970058CCF6 /* RCTSurfaceView.h */; };\n\t\t594F0A3F1FD233A2007FBE96 /* RCTSurfaceHostingView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 594F0A2F1FD23228007FBE96 /* RCTSurfaceHostingView.h */; };\n\t\t594F0A401FD233A2007FBE96 /* RCTSurfaceSizeMeasureMode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 594F0A311FD23228007FBE96 /* RCTSurfaceSizeMeasureMode.h */; };\n\t\t594F0A411FD233BD007FBE96 /* RCTSurface.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2A1FB274970058CCF6 /* RCTSurface.h */; };\n\t\t594F0A421FD233BD007FBE96 /* RCTSurfaceDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2C1FB274970058CCF6 /* RCTSurfaceDelegate.h */; };\n\t\t594F0A431FD233BD007FBE96 /* RCTSurfaceRootShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2D1FB274970058CCF6 /* RCTSurfaceRootShadowView.h */; };\n\t\t594F0A441FD233BD007FBE96 /* RCTSurfaceRootShadowViewDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2F1FB274970058CCF6 /* RCTSurfaceRootShadowViewDelegate.h */; };\n\t\t594F0A451FD233BD007FBE96 /* RCTSurfaceRootView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA301FB274970058CCF6 /* RCTSurfaceRootView.h */; };\n\t\t594F0A461FD233BD007FBE96 /* RCTSurfaceStage.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA321FB274970058CCF6 /* RCTSurfaceStage.h */; };\n\t\t594F0A471FD233BD007FBE96 /* RCTSurfaceView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 599FAA341FB274970058CCF6 /* RCTSurfaceView.h */; };\n\t\t594F0A481FD233BD007FBE96 /* RCTSurfaceHostingView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 594F0A2F1FD23228007FBE96 /* RCTSurfaceHostingView.h */; };\n\t\t594F0A491FD233BD007FBE96 /* RCTSurfaceSizeMeasureMode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 594F0A311FD23228007FBE96 /* RCTSurfaceSizeMeasureMode.h */; };\n\t\t59500D431F71C63F00B122B7 /* RCTUIManagerUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 59500D411F71C63700B122B7 /* RCTUIManagerUtils.h */; };\n\t\t59500D441F71C63F00B122B7 /* RCTUIManagerUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 59500D411F71C63700B122B7 /* RCTUIManagerUtils.h */; };\n\t\t59500D451F71C63F00B122B7 /* RCTUIManagerUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 59500D421F71C63F00B122B7 /* RCTUIManagerUtils.m */; };\n\t\t59500D461F71C63F00B122B7 /* RCTUIManagerUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 59500D421F71C63F00B122B7 /* RCTUIManagerUtils.m */; };\n\t\t59500D471F71C66700B122B7 /* RCTUIManagerUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59500D411F71C63700B122B7 /* RCTUIManagerUtils.h */; };\n\t\t59500D481F71C67600B122B7 /* RCTUIManagerUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59500D411F71C63700B122B7 /* RCTUIManagerUtils.h */; };\n\t\t5960C1B51F0804A00066FD5B /* RCTLayoutAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5960C1B11F0804A00066FD5B /* RCTLayoutAnimation.h */; };\n\t\t5960C1B61F0804A00066FD5B /* RCTLayoutAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5960C1B11F0804A00066FD5B /* RCTLayoutAnimation.h */; };\n\t\t5960C1B71F0804A00066FD5B /* RCTLayoutAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5960C1B21F0804A00066FD5B /* RCTLayoutAnimation.m */; };\n\t\t5960C1B81F0804A00066FD5B /* RCTLayoutAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5960C1B21F0804A00066FD5B /* RCTLayoutAnimation.m */; };\n\t\t5960C1B91F0804A00066FD5B /* RCTLayoutAnimationGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 5960C1B31F0804A00066FD5B /* RCTLayoutAnimationGroup.h */; };\n\t\t5960C1BA1F0804A00066FD5B /* RCTLayoutAnimationGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 5960C1B31F0804A00066FD5B /* RCTLayoutAnimationGroup.h */; };\n\t\t5960C1BB1F0804A00066FD5B /* RCTLayoutAnimationGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 5960C1B41F0804A00066FD5B /* RCTLayoutAnimationGroup.m */; };\n\t\t5960C1BC1F0804A00066FD5B /* RCTLayoutAnimationGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 5960C1B41F0804A00066FD5B /* RCTLayoutAnimationGroup.m */; };\n\t\t5960C1BD1F0804DF0066FD5B /* RCTLayoutAnimation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 5960C1B11F0804A00066FD5B /* RCTLayoutAnimation.h */; };\n\t\t5960C1BE1F0804DF0066FD5B /* RCTLayoutAnimationGroup.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 5960C1B31F0804A00066FD5B /* RCTLayoutAnimationGroup.h */; };\n\t\t5960C1BF1F0804F50066FD5B /* RCTLayoutAnimation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 5960C1B11F0804A00066FD5B /* RCTLayoutAnimation.h */; };\n\t\t5960C1C01F0804F50066FD5B /* RCTLayoutAnimationGroup.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 5960C1B31F0804A00066FD5B /* RCTLayoutAnimationGroup.h */; };\n\t\t597633361F4E021D005BE8A4 /* RCTShadowView+Internal.m in Sources */ = {isa = PBXBuildFile; fileRef = 597633341F4E021D005BE8A4 /* RCTShadowView+Internal.m */; };\n\t\t597633371F4E021D005BE8A4 /* RCTShadowView+Internal.m in Sources */ = {isa = PBXBuildFile; fileRef = 597633341F4E021D005BE8A4 /* RCTShadowView+Internal.m */; };\n\t\t597633381F4E021D005BE8A4 /* RCTShadowView+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 597633351F4E021D005BE8A4 /* RCTShadowView+Internal.h */; };\n\t\t597633391F4E021D005BE8A4 /* RCTShadowView+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 597633351F4E021D005BE8A4 /* RCTShadowView+Internal.h */; };\n\t\t598FD1921F816A2A006C54CB /* RAMBundleRegistry.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = C6D380181F71D75B00621378 /* RAMBundleRegistry.h */; };\n\t\t598FD1931F817284006C54CB /* PrivateDataBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9936F3351F5F2F480010BF04 /* PrivateDataBase.cpp */; };\n\t\t598FD1941F8172A9006C54CB /* PrivateDataBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9936F3361F5F2F480010BF04 /* PrivateDataBase.h */; };\n\t\t598FD1951F817335006C54CB /* RCTModalManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 91076A881F743AB00081B4FA /* RCTModalManager.h */; };\n\t\t598FD1961F817335006C54CB /* RCTModalManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 91076A871F743AB00081B4FA /* RCTModalManager.m */; };\n\t\t598FD1971F817336006C54CB /* RCTModalManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 91076A881F743AB00081B4FA /* RCTModalManager.h */; };\n\t\t599FAA361FB274980058CCF6 /* RCTSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2A1FB274970058CCF6 /* RCTSurface.h */; };\n\t\t599FAA371FB274980058CCF6 /* RCTSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2A1FB274970058CCF6 /* RCTSurface.h */; };\n\t\t599FAA381FB274980058CCF6 /* RCTSurface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 599FAA2B1FB274970058CCF6 /* RCTSurface.mm */; };\n\t\t599FAA391FB274980058CCF6 /* RCTSurface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 599FAA2B1FB274970058CCF6 /* RCTSurface.mm */; };\n\t\t599FAA3A1FB274980058CCF6 /* RCTSurfaceDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2C1FB274970058CCF6 /* RCTSurfaceDelegate.h */; };\n\t\t599FAA3B1FB274980058CCF6 /* RCTSurfaceDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2C1FB274970058CCF6 /* RCTSurfaceDelegate.h */; };\n\t\t599FAA3C1FB274980058CCF6 /* RCTSurfaceRootShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2D1FB274970058CCF6 /* RCTSurfaceRootShadowView.h */; };\n\t\t599FAA3D1FB274980058CCF6 /* RCTSurfaceRootShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2D1FB274970058CCF6 /* RCTSurfaceRootShadowView.h */; };\n\t\t599FAA3E1FB274980058CCF6 /* RCTSurfaceRootShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 599FAA2E1FB274970058CCF6 /* RCTSurfaceRootShadowView.m */; };\n\t\t599FAA3F1FB274980058CCF6 /* RCTSurfaceRootShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 599FAA2E1FB274970058CCF6 /* RCTSurfaceRootShadowView.m */; };\n\t\t599FAA401FB274980058CCF6 /* RCTSurfaceRootShadowViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2F1FB274970058CCF6 /* RCTSurfaceRootShadowViewDelegate.h */; };\n\t\t599FAA411FB274980058CCF6 /* RCTSurfaceRootShadowViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA2F1FB274970058CCF6 /* RCTSurfaceRootShadowViewDelegate.h */; };\n\t\t599FAA421FB274980058CCF6 /* RCTSurfaceRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA301FB274970058CCF6 /* RCTSurfaceRootView.h */; };\n\t\t599FAA431FB274980058CCF6 /* RCTSurfaceRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA301FB274970058CCF6 /* RCTSurfaceRootView.h */; };\n\t\t599FAA441FB274980058CCF6 /* RCTSurfaceRootView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 599FAA311FB274970058CCF6 /* RCTSurfaceRootView.mm */; };\n\t\t599FAA451FB274980058CCF6 /* RCTSurfaceRootView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 599FAA311FB274970058CCF6 /* RCTSurfaceRootView.mm */; };\n\t\t599FAA461FB274980058CCF6 /* RCTSurfaceStage.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA321FB274970058CCF6 /* RCTSurfaceStage.h */; };\n\t\t599FAA471FB274980058CCF6 /* RCTSurfaceStage.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA321FB274970058CCF6 /* RCTSurfaceStage.h */; };\n\t\t599FAA481FB274980058CCF6 /* RCTSurfaceView+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA331FB274970058CCF6 /* RCTSurfaceView+Internal.h */; };\n\t\t599FAA491FB274980058CCF6 /* RCTSurfaceView+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA331FB274970058CCF6 /* RCTSurfaceView+Internal.h */; };\n\t\t599FAA4A1FB274980058CCF6 /* RCTSurfaceView.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA341FB274970058CCF6 /* RCTSurfaceView.h */; };\n\t\t599FAA4B1FB274980058CCF6 /* RCTSurfaceView.h in Headers */ = {isa = PBXBuildFile; fileRef = 599FAA341FB274970058CCF6 /* RCTSurfaceView.h */; };\n\t\t599FAA4C1FB274980058CCF6 /* RCTSurfaceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 599FAA351FB274970058CCF6 /* RCTSurfaceView.mm */; };\n\t\t599FAA4D1FB274980058CCF6 /* RCTSurfaceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 599FAA351FB274970058CCF6 /* RCTSurfaceView.mm */; };\n\t\t59A7B9FD1E577DBF0068EDBF /* RCTRootContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A7B9FB1E577DBF0068EDBF /* RCTRootContentView.h */; };\n\t\t59A7B9FE1E577DBF0068EDBF /* RCTRootContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A7B9FC1E577DBF0068EDBF /* RCTRootContentView.m */; };\n\t\t59B1EBC91EBD46250047B19B /* RCTShadowView+Layout.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 590D7BFB1EBD458B00D8A370 /* RCTShadowView+Layout.h */; };\n\t\t59B1EBCA1EBD47520047B19B /* RCTShadowView+Layout.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 590D7BFB1EBD458B00D8A370 /* RCTShadowView+Layout.h */; };\n\t\t59EB6DBB1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB6DB91EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h */; };\n\t\t59EB6DBC1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB6DB91EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h */; };\n\t\t59EB6DBD1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 59EB6DBA1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.mm */; };\n\t\t59EB6DBE1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 59EB6DBA1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.mm */; };\n\t\t59EB6DBF1EBD6FFC0072A5E7 /* RCTUIManagerObserverCoordinator.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EB6DB91EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h */; };\n\t\t59EB6DC01EBD70130072A5E7 /* RCTUIManagerObserverCoordinator.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EB6DB91EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h */; };\n\t\t59EDBCA71FDF4E0C003573DE /* RCTScrollableProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9C1FDF4E0C003573DE /* RCTScrollableProtocol.h */; };\n\t\t59EDBCA81FDF4E0C003573DE /* RCTScrollableProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9C1FDF4E0C003573DE /* RCTScrollableProtocol.h */; };\n\t\t59EDBCA91FDF4E0C003573DE /* RCTScrollContentShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9D1FDF4E0C003573DE /* RCTScrollContentShadowView.h */; };\n\t\t59EDBCAA1FDF4E0C003573DE /* RCTScrollContentShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9D1FDF4E0C003573DE /* RCTScrollContentShadowView.h */; };\n\t\t59EDBCAB1FDF4E0C003573DE /* RCTScrollContentShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EDBC9E1FDF4E0C003573DE /* RCTScrollContentShadowView.m */; };\n\t\t59EDBCAC1FDF4E0C003573DE /* RCTScrollContentShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EDBC9E1FDF4E0C003573DE /* RCTScrollContentShadowView.m */; };\n\t\t59EDBCAD1FDF4E0C003573DE /* RCTScrollContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9F1FDF4E0C003573DE /* RCTScrollContentView.h */; };\n\t\t59EDBCAE1FDF4E0C003573DE /* RCTScrollContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9F1FDF4E0C003573DE /* RCTScrollContentView.h */; };\n\t\t59EDBCAF1FDF4E0C003573DE /* RCTScrollContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EDBCA01FDF4E0C003573DE /* RCTScrollContentView.m */; };\n\t\t59EDBCB01FDF4E0C003573DE /* RCTScrollContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EDBCA01FDF4E0C003573DE /* RCTScrollContentView.m */; };\n\t\t59EDBCB11FDF4E0C003573DE /* RCTScrollContentViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA11FDF4E0C003573DE /* RCTScrollContentViewManager.h */; };\n\t\t59EDBCB21FDF4E0C003573DE /* RCTScrollContentViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA11FDF4E0C003573DE /* RCTScrollContentViewManager.h */; };\n\t\t59EDBCB31FDF4E0C003573DE /* RCTScrollContentViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EDBCA21FDF4E0C003573DE /* RCTScrollContentViewManager.m */; };\n\t\t59EDBCB41FDF4E0C003573DE /* RCTScrollContentViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EDBCA21FDF4E0C003573DE /* RCTScrollContentViewManager.m */; };\n\t\t59EDBCB51FDF4E0C003573DE /* RCTScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA31FDF4E0C003573DE /* RCTScrollView.h */; };\n\t\t59EDBCB61FDF4E0C003573DE /* RCTScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA31FDF4E0C003573DE /* RCTScrollView.h */; };\n\t\t59EDBCB71FDF4E0C003573DE /* RCTScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EDBCA41FDF4E0C003573DE /* RCTScrollView.m */; };\n\t\t59EDBCB81FDF4E0C003573DE /* RCTScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EDBCA41FDF4E0C003573DE /* RCTScrollView.m */; };\n\t\t59EDBCB91FDF4E0C003573DE /* RCTScrollViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA51FDF4E0C003573DE /* RCTScrollViewManager.h */; };\n\t\t59EDBCBA1FDF4E0C003573DE /* RCTScrollViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA51FDF4E0C003573DE /* RCTScrollViewManager.h */; };\n\t\t59EDBCBB1FDF4E0C003573DE /* RCTScrollViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EDBCA61FDF4E0C003573DE /* RCTScrollViewManager.m */; };\n\t\t59EDBCBC1FDF4E0C003573DE /* RCTScrollViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EDBCA61FDF4E0C003573DE /* RCTScrollViewManager.m */; };\n\t\t59EDBCBD1FDF4E43003573DE /* RCTScrollableProtocol.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9C1FDF4E0C003573DE /* RCTScrollableProtocol.h */; };\n\t\t59EDBCBE1FDF4E43003573DE /* RCTScrollContentShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9D1FDF4E0C003573DE /* RCTScrollContentShadowView.h */; };\n\t\t59EDBCBF1FDF4E43003573DE /* RCTScrollContentView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9F1FDF4E0C003573DE /* RCTScrollContentView.h */; };\n\t\t59EDBCC01FDF4E43003573DE /* RCTScrollContentViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA11FDF4E0C003573DE /* RCTScrollContentViewManager.h */; };\n\t\t59EDBCC11FDF4E43003573DE /* RCTScrollView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA31FDF4E0C003573DE /* RCTScrollView.h */; };\n\t\t59EDBCC21FDF4E43003573DE /* RCTScrollViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA51FDF4E0C003573DE /* RCTScrollViewManager.h */; };\n\t\t59EDBCC31FDF4E55003573DE /* RCTScrollableProtocol.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9C1FDF4E0C003573DE /* RCTScrollableProtocol.h */; };\n\t\t59EDBCC41FDF4E55003573DE /* RCTScrollContentShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9D1FDF4E0C003573DE /* RCTScrollContentShadowView.h */; };\n\t\t59EDBCC51FDF4E55003573DE /* RCTScrollContentView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBC9F1FDF4E0C003573DE /* RCTScrollContentView.h */; };\n\t\t59EDBCC61FDF4E55003573DE /* RCTScrollContentViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA11FDF4E0C003573DE /* RCTScrollContentViewManager.h */; };\n\t\t59EDBCC71FDF4E55003573DE /* RCTScrollView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA31FDF4E0C003573DE /* RCTScrollView.h */; };\n\t\t59EDBCC81FDF4E55003573DE /* RCTScrollViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA51FDF4E0C003573DE /* RCTScrollViewManager.h */; };\n\t\t657734841EE834C900A0E9EA /* RCTInspectorDevServerHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 657734821EE834C900A0E9EA /* RCTInspectorDevServerHelper.h */; };\n\t\t657734851EE834C900A0E9EA /* RCTInspectorDevServerHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 657734831EE834C900A0E9EA /* RCTInspectorDevServerHelper.mm */; };\n\t\t657734861EE834D900A0E9EA /* RCTInspectorDevServerHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 657734831EE834C900A0E9EA /* RCTInspectorDevServerHelper.mm */; };\n\t\t657734871EE834E000A0E9EA /* RCTInspectorDevServerHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 657734821EE834C900A0E9EA /* RCTInspectorDevServerHelper.h */; };\n\t\t6577348E1EE8354A00A0E9EA /* RCTInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 6577348A1EE8354A00A0E9EA /* RCTInspector.h */; };\n\t\t6577348F1EE8354A00A0E9EA /* RCTInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6577348B1EE8354A00A0E9EA /* RCTInspector.mm */; };\n\t\t657734901EE8354A00A0E9EA /* RCTInspectorPackagerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 6577348C1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.h */; };\n\t\t657734911EE8354A00A0E9EA /* RCTInspectorPackagerConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 6577348D1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.m */; };\n\t\t657734921EE8356100A0E9EA /* RCTInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 6577348A1EE8354A00A0E9EA /* RCTInspector.h */; };\n\t\t657734931EE8356100A0E9EA /* RCTInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6577348B1EE8354A00A0E9EA /* RCTInspector.mm */; };\n\t\t657734941EE8356100A0E9EA /* RCTInspectorPackagerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 6577348C1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.h */; };\n\t\t657734951EE8356100A0E9EA /* RCTInspectorPackagerConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 6577348D1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.m */; };\n\t\t66CD94B11F1045E700CB3C7C /* RCTMaskedView.h in Headers */ = {isa = PBXBuildFile; fileRef = 66CD94AD1F1045E700CB3C7C /* RCTMaskedView.h */; };\n\t\t66CD94B21F1045E700CB3C7C /* RCTMaskedView.h in Headers */ = {isa = PBXBuildFile; fileRef = 66CD94AD1F1045E700CB3C7C /* RCTMaskedView.h */; };\n\t\t66CD94B31F1045E700CB3C7C /* RCTMaskedView.m in Sources */ = {isa = PBXBuildFile; fileRef = 66CD94AE1F1045E700CB3C7C /* RCTMaskedView.m */; };\n\t\t66CD94B41F1045E700CB3C7C /* RCTMaskedView.m in Sources */ = {isa = PBXBuildFile; fileRef = 66CD94AE1F1045E700CB3C7C /* RCTMaskedView.m */; };\n\t\t66CD94B51F1045E700CB3C7C /* RCTMaskedViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 66CD94AF1F1045E700CB3C7C /* RCTMaskedViewManager.h */; };\n\t\t66CD94B61F1045E700CB3C7C /* RCTMaskedViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 66CD94AF1F1045E700CB3C7C /* RCTMaskedViewManager.h */; };\n\t\t66CD94B71F1045E700CB3C7C /* RCTMaskedViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 66CD94B01F1045E700CB3C7C /* RCTMaskedViewManager.m */; };\n\t\t66CD94B81F1045E700CB3C7C /* RCTMaskedViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 66CD94B01F1045E700CB3C7C /* RCTMaskedViewManager.m */; };\n\t\t68EFE4EE1CF6EB3900A1DE13 /* RCTBundleURLProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */; };\n\t\t830A229E1A66C68A008503DA /* RCTRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 830A229D1A66C68A008503DA /* RCTRootView.m */; };\n\t\t83392EB31B6634E10013B15F /* RCTModalHostViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83392EB21B6634E10013B15F /* RCTModalHostViewController.m */; };\n\t\t83A1FE8C1B62640A00BE0E65 /* RCTModalHostView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */; };\n\t\t83A1FE8F1B62643A00BE0E65 /* RCTModalHostViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A1FE8E1B62643A00BE0E65 /* RCTModalHostViewManager.m */; };\n\t\t83CBBA511A601E3B00E9B192 /* RCTAssert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */; };\n\t\t83CBBA521A601E3B00E9B192 /* RCTLog.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4E1A601E3B00E9B192 /* RCTLog.mm */; };\n\t\t83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA501A601E3B00E9B192 /* RCTUtils.m */; };\n\t\t83CBBA601A601EAA00E9B192 /* RCTBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA5F1A601EAA00E9B192 /* RCTBridge.m */; };\n\t\t83CBBA691A601EF300E9B192 /* RCTEventDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */; };\n\t\t83CBBA981A6020BB00E9B192 /* RCTTouchHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */; };\n\t\t83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBACB1A6023D300E9B192 /* RCTConvert.m */; };\n\t\t916F9C2D1F743F57002E5920 /* RCTModalManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 91076A871F743AB00081B4FA /* RCTModalManager.m */; };\n\t\t9936F3371F5F2F480010BF04 /* PrivateDataBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9936F3351F5F2F480010BF04 /* PrivateDataBase.cpp */; };\n\t\t9936F3381F5F2F480010BF04 /* PrivateDataBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9936F3361F5F2F480010BF04 /* PrivateDataBase.h */; };\n\t\t9936F3391F5F2F5C0010BF04 /* PrivateDataBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9936F3361F5F2F480010BF04 /* PrivateDataBase.h */; };\n\t\t9936F33A1F5F2F7C0010BF04 /* PrivateDataBase.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 9936F3361F5F2F480010BF04 /* PrivateDataBase.h */; };\n\t\t9936F33B1F5F2F9D0010BF04 /* PrivateDataBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9936F3351F5F2F480010BF04 /* PrivateDataBase.cpp */; };\n\t\t9936F33C1F5F2FE70010BF04 /* PrivateDataBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9936F3361F5F2F480010BF04 /* PrivateDataBase.h */; };\n\t\t9936F33D1F5F2FF40010BF04 /* PrivateDataBase.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 9936F3361F5F2F480010BF04 /* PrivateDataBase.h */; };\n\t\t9936F33E1F5F2FFC0010BF04 /* PrivateDataBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9936F3351F5F2F480010BF04 /* PrivateDataBase.cpp */; };\n\t\tA2440AA21DF8D854006E7BFC /* RCTReloadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; };\n\t\tA2440AA31DF8D854006E7BFC /* RCTReloadCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = A2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */; };\n\t\tA2440AA41DF8D865006E7BFC /* RCTReloadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; };\n\t\tAC70D2E91DE489E4002E6351 /* RCTJavaScriptLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */; };\n\t\tB233E6EA1D2D845D00BC68BA /* RCTI18nManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B233E6E91D2D845D00BC68BA /* RCTI18nManager.m */; };\n\t\tB95154321D1B34B200FE7B80 /* RCTActivityIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = B95154311D1B34B200FE7B80 /* RCTActivityIndicatorView.m */; };\n\t\tC60128AB1F3D1258009DF9FF /* RCTCxxConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = C60128A91F3D1258009DF9FF /* RCTCxxConvert.h */; };\n\t\tC60128AC1F3D1258009DF9FF /* RCTCxxConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = C60128A91F3D1258009DF9FF /* RCTCxxConvert.h */; };\n\t\tC60128AD1F3D1258009DF9FF /* RCTCxxConvert.m in Sources */ = {isa = PBXBuildFile; fileRef = C60128AA1F3D1258009DF9FF /* RCTCxxConvert.m */; };\n\t\tC60128AE1F3D1258009DF9FF /* RCTCxxConvert.m in Sources */ = {isa = PBXBuildFile; fileRef = C60128AA1F3D1258009DF9FF /* RCTCxxConvert.m */; };\n\t\tC606692E1F3CC60500E67165 /* RCTModuleMethod.mm in Sources */ = {isa = PBXBuildFile; fileRef = C606692D1F3CC60500E67165 /* RCTModuleMethod.mm */; };\n\t\tC606692F1F3CC60500E67165 /* RCTModuleMethod.mm in Sources */ = {isa = PBXBuildFile; fileRef = C606692D1F3CC60500E67165 /* RCTModuleMethod.mm */; };\n\t\tC60669361F3CCF1B00E67165 /* RCTManagedPointer.mm in Sources */ = {isa = PBXBuildFile; fileRef = C60669351F3CCF1B00E67165 /* RCTManagedPointer.mm */; };\n\t\tC60669371F3CCF1B00E67165 /* RCTManagedPointer.mm in Sources */ = {isa = PBXBuildFile; fileRef = C60669351F3CCF1B00E67165 /* RCTManagedPointer.mm */; };\n\t\tC654505E1F3BD9280090799B /* RCTManagedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = C654505D1F3BD9280090799B /* RCTManagedPointer.h */; };\n\t\tC654505F1F3BD9280090799B /* RCTManagedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = C654505D1F3BD9280090799B /* RCTManagedPointer.h */; };\n\t\tC669D8981F72E3DE006748EB /* RAMBundleRegistry.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = C6D380181F71D75B00621378 /* RAMBundleRegistry.h */; };\n\t\tC6D3801A1F71D76100621378 /* RAMBundleRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D380181F71D75B00621378 /* RAMBundleRegistry.h */; };\n\t\tC6D3801B1F71D76200621378 /* RAMBundleRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D380181F71D75B00621378 /* RAMBundleRegistry.h */; };\n\t\tC6D3801C1F71D76700621378 /* RAMBundleRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D380191F71D75B00621378 /* RAMBundleRegistry.cpp */; };\n\t\tC6D3801D1F71D76800621378 /* RAMBundleRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D380191F71D75B00621378 /* RAMBundleRegistry.cpp */; };\n\t\tCF2731C01E7B8DE40044CA4F /* RCTDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = CF2731BE1E7B8DE40044CA4F /* RCTDeviceInfo.h */; };\n\t\tCF2731C11E7B8DE40044CA4F /* RCTDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = CF2731BF1E7B8DE40044CA4F /* RCTDeviceInfo.m */; };\n\t\tCF2731C21E7B8DEF0044CA4F /* RCTDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = CF2731BE1E7B8DE40044CA4F /* RCTDeviceInfo.h */; };\n\t\tCF2731C31E7B8DF30044CA4F /* RCTDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = CF2731BF1E7B8DE40044CA4F /* RCTDeviceInfo.m */; };\n\t\tD426ACD020D57642003B4C4D /* RCTAppearance.h in Headers */ = {isa = PBXBuildFile; fileRef = D426ACCF20D57642003B4C4D /* RCTAppearance.h */; };\n\t\tD426ACD220D57659003B4C4D /* RCTAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = D426ACD120D57659003B4C4D /* RCTAppearance.m */; };\n\t\tD49593DE202C937C00A7694B /* RCTCursorManager.h in Headers */ = {isa = PBXBuildFile; fileRef = D49593D8202C937B00A7694B /* RCTCursorManager.h */; };\n\t\tD49593DF202C937C00A7694B /* RCTCursorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D49593D9202C937B00A7694B /* RCTCursorManager.m */; };\n\t\tD49593E0202C937C00A7694B /* RCTMenuManager.h in Headers */ = {isa = PBXBuildFile; fileRef = D49593DA202C937B00A7694B /* RCTMenuManager.h */; };\n\t\tD49593E1202C937C00A7694B /* RCTMenuManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D49593DB202C937C00A7694B /* RCTMenuManager.m */; };\n\t\tD49593E5202C96FF00A7694B /* YGNode.h in Headers */ = {isa = PBXBuildFile; fileRef = D49593E3202C96FF00A7694B /* YGNode.h */; };\n\t\tD49593E6202C96FF00A7694B /* YGNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D49593E4202C96FF00A7694B /* YGNode.cpp */; };\n\t\tD49593E7202C970600A7694B /* YGNode.h in Headers */ = {isa = PBXBuildFile; fileRef = D49593E3202C96FF00A7694B /* YGNode.h */; };\n\t\tD49593E8202C972800A7694B /* YGNode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = D49593E3202C96FF00A7694B /* YGNode.h */; };\n\t\tD4EEE2F5201DF63F00C4CBB6 /* RCTButtonManager.h in Headers */ = {isa = PBXBuildFile; fileRef = D4EEE2F1201DF63F00C4CBB6 /* RCTButtonManager.h */; };\n\t\tD4EEE2F6201DF63F00C4CBB6 /* RCTButton.h in Headers */ = {isa = PBXBuildFile; fileRef = D4EEE2F2201DF63F00C4CBB6 /* RCTButton.h */; };\n\t\tD4EEE2F7201DF63F00C4CBB6 /* RCTButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE2F3201DF63F00C4CBB6 /* RCTButton.m */; };\n\t\tD4EEE2F8201DF63F00C4CBB6 /* RCTButtonManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE2F4201DF63F00C4CBB6 /* RCTButtonManager.m */; };\n\t\tD4EEE2FB201DF64800C4CBB6 /* NSView+NSViewAnimationWithBlocks.h in Headers */ = {isa = PBXBuildFile; fileRef = D4EEE2F9201DF64800C4CBB6 /* NSView+NSViewAnimationWithBlocks.h */; };\n\t\tD4EEE2FC201DF64800C4CBB6 /* NSView+NSViewAnimationWithBlocks.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE2FA201DF64800C4CBB6 /* NSView+NSViewAnimationWithBlocks.m */; };\n\t\tD4EEE2FF201F95F900C4CBB6 /* UIImageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = D4EEE2FD201F95F900C4CBB6 /* UIImageUtils.m */; };\n\t\tD4EEE300201F95F900C4CBB6 /* UIImageUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = D4EEE2FE201F95F900C4CBB6 /* UIImageUtils.h */; };\n\t\tD4EEE3542020933B00C4CBB6 /* UIImageUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = D4EEE2FE201F95F900C4CBB6 /* UIImageUtils.h */; };\n\t\tEBF21BBC1FC498270052F4D5 /* InspectorInterfaces.h in Headers */ = {isa = PBXBuildFile; fileRef = EBF21BBA1FC498270052F4D5 /* InspectorInterfaces.h */; };\n\t\tEBF21BBD1FC498270052F4D5 /* InspectorInterfaces.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF21BBB1FC498270052F4D5 /* InspectorInterfaces.cpp */; };\n\t\tEBF21BBE1FC498630052F4D5 /* InspectorInterfaces.h in Headers */ = {isa = PBXBuildFile; fileRef = EBF21BBA1FC498270052F4D5 /* InspectorInterfaces.h */; };\n\t\tEBF21BFB1FC498FC0052F4D5 /* InspectorInterfaces.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = EBF21BBA1FC498270052F4D5 /* InspectorInterfaces.h */; };\n\t\tEBF21BFC1FC4990B0052F4D5 /* InspectorInterfaces.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF21BBB1FC498270052F4D5 /* InspectorInterfaces.cpp */; };\n\t\tEBF21BFE1FC499840052F4D5 /* InspectorInterfaces.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = EBF21BBA1FC498270052F4D5 /* InspectorInterfaces.h */; };\n\t\tEBF21BFF1FC4998E0052F4D5 /* InspectorInterfaces.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF21BBB1FC498270052F4D5 /* InspectorInterfaces.cpp */; };\n\t\tEBF21C001FC499A80052F4D5 /* InspectorInterfaces.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF21BBB1FC498270052F4D5 /* InspectorInterfaces.cpp */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t1320081A1E283DC300F0C457 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 139D7ECD1E25DB7D00323FB7;\n\t\t\tremoteInfo = \"third-party\";\n\t\t};\n\t\t1320081C1E283DCB00F0C457 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 139D7E871E25C6D100323FB7;\n\t\t\tremoteInfo = \"double-conversion\";\n\t\t};\n\t\t3D0574541DE5FF9600184BB4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3C059B1DE3340C00C268FA;\n\t\t\tremoteInfo = \"yoga-tvOS\";\n\t\t};\n\t\t3D0574561DE5FF9600184BB4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3CD9261DE5FBEE00167DC4;\n\t\t\tremoteInfo = \"cxxreact-tvOS\";\n\t\t};\n\t\t3D383D631EBD27CE005632C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D383D211EBD27B6005632C8;\n\t\t\tremoteInfo = \"third-party-tvOS\";\n\t\t};\n\t\t3D383D651EBD27DB005632C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D383D3D1EBD27B9005632C8;\n\t\t\tremoteInfo = \"double-conversion-tvOS\";\n\t\t};\n\t\t3D3CD94B1DE5FCE700167DC4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3CD9191DE5FBEC00167DC4;\n\t\t\tremoteInfo = cxxreact;\n\t\t};\n\t\t3D3CD94F1DE5FDB900167DC4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3CD8FF1DE5FBD600167DC4;\n\t\t\tremoteInfo = jschelpers;\n\t\t};\n\t\t3DC159E71E83E2A0007B1282 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3CD90C1DE5FBD800167DC4;\n\t\t\tremoteInfo = \"jschelpers-tvOS\";\n\t\t};\n\t\t53D123981FBF1E0C001B8A10 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3C04B91DE3340900C268FA;\n\t\t\tremoteInfo = yoga;\n\t\t};\n\t\t9936F33F1F5F305D0010BF04 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 9936F2F81F5F2E4B0010BF04;\n\t\t\tremoteInfo = privatedata;\n\t\t};\n\t\t9936F3411F5F30640010BF04 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 9936F3141F5F2E5B0010BF04;\n\t\t\tremoteInfo = \"privatedata-tvOS\";\n\t\t};\n\t\t9936F3431F5F30780010BF04 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 9936F2F81F5F2E4B0010BF04;\n\t\t\tremoteInfo = privatedata;\n\t\t};\n\t\t9936F3451F5F30830010BF04 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 9936F3141F5F2E5B0010BF04;\n\t\t\tremoteInfo = \"privatedata-tvOS\";\n\t\t};\n\t\tEBF21C011FC499D10052F4D5 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = EBF21BBF1FC498900052F4D5;\n\t\t\tremoteInfo = jsinspector;\n\t\t};\n\t\tEBF21C031FC499D80052F4D5 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = EBF21BDD1FC4989A0052F4D5;\n\t\t\tremoteInfo = \"jsinspector-tvOS\";\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t139D7E861E25C6D100323FB7 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/$(PRODUCT_NAME)\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t19F61BFA1E8495CD00571D81 /* bignum-dtoa.h in CopyFiles */,\n\t\t\t\t19F61BFB1E8495CD00571D81 /* bignum.h in CopyFiles */,\n\t\t\t\t19F61BFC1E8495CD00571D81 /* cached-powers.h in CopyFiles */,\n\t\t\t\t19F61BFD1E8495CD00571D81 /* diy-fp.h in CopyFiles */,\n\t\t\t\t19F61BFE1E8495CD00571D81 /* double-conversion.h in CopyFiles */,\n\t\t\t\t19F61BFF1E8495CD00571D81 /* fast-dtoa.h in CopyFiles */,\n\t\t\t\t19F61C001E8495CD00571D81 /* fixed-dtoa.h in CopyFiles */,\n\t\t\t\t19F61C011E8495CD00571D81 /* ieee.h in CopyFiles */,\n\t\t\t\t19F61C021E8495CD00571D81 /* strtod.h in CopyFiles */,\n\t\t\t\t19F61C031E8495CD00571D81 /* utils.h in CopyFiles */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D302E191DF8249100D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/React;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t59EDBCC31FDF4E55003573DE /* RCTScrollableProtocol.h in Copy Headers */,\n\t\t\t\t59EDBCC41FDF4E55003573DE /* RCTScrollContentShadowView.h in Copy Headers */,\n\t\t\t\t59EDBCC51FDF4E55003573DE /* RCTScrollContentView.h in Copy Headers */,\n\t\t\t\t59EDBCC61FDF4E55003573DE /* RCTScrollContentViewManager.h in Copy Headers */,\n\t\t\t\t59EDBCC71FDF4E55003573DE /* RCTScrollView.h in Copy Headers */,\n\t\t\t\t59EDBCC81FDF4E55003573DE /* RCTScrollViewManager.h in Copy Headers */,\n\t\t\t\t594F0A411FD233BD007FBE96 /* RCTSurface.h in Copy Headers */,\n\t\t\t\t594F0A421FD233BD007FBE96 /* RCTSurfaceDelegate.h in Copy Headers */,\n\t\t\t\t594F0A431FD233BD007FBE96 /* RCTSurfaceRootShadowView.h in Copy Headers */,\n\t\t\t\t594F0A441FD233BD007FBE96 /* RCTSurfaceRootShadowViewDelegate.h in Copy Headers */,\n\t\t\t\t594F0A451FD233BD007FBE96 /* RCTSurfaceRootView.h in Copy Headers */,\n\t\t\t\t594F0A461FD233BD007FBE96 /* RCTSurfaceStage.h in Copy Headers */,\n\t\t\t\t594F0A471FD233BD007FBE96 /* RCTSurfaceView.h in Copy Headers */,\n\t\t\t\t594F0A481FD233BD007FBE96 /* RCTSurfaceHostingView.h in Copy Headers */,\n\t\t\t\t594F0A491FD233BD007FBE96 /* RCTSurfaceSizeMeasureMode.h in Copy Headers */,\n\t\t\t\t2D16E68E1FA4FD3900B85C8A /* RCTTVNavigationEventEmitter.h in Copy Headers */,\n\t\t\t\t59500D481F71C67600B122B7 /* RCTUIManagerUtils.h in Copy Headers */,\n\t\t\t\t3D0E37901F1CC5E100DCAC9F /* RCTWebSocketModule.h in Copy Headers */,\n\t\t\t\t5960C1BF1F0804F50066FD5B /* RCTLayoutAnimation.h in Copy Headers */,\n\t\t\t\t5960C1C01F0804F50066FD5B /* RCTLayoutAnimationGroup.h in Copy Headers */,\n\t\t\t\t59EB6DC01EBD70130072A5E7 /* RCTUIManagerObserverCoordinator.h in Copy Headers */,\n\t\t\t\t59B1EBCA1EBD47520047B19B /* RCTShadowView+Layout.h in Copy Headers */,\n\t\t\t\t3D0B84271EC0B45400B2BD8E /* RCTLinkingManager.h in Copy Headers */,\n\t\t\t\t3D0B84251EC0B42600B2BD8E /* RCTNetworking.h in Copy Headers */,\n\t\t\t\t3D0B84261EC0B42600B2BD8E /* RCTNetworkTask.h in Copy Headers */,\n\t\t\t\t3D0B84231EC0B40D00B2BD8E /* RCTImageLoader.h in Copy Headers */,\n\t\t\t\t3D0B84241EC0B40D00B2BD8E /* RCTImageStoreManager.h in Copy Headers */,\n\t\t\t\t3D0B84221EC0B3F600B2BD8E /* RCTResizeMode.h in Copy Headers */,\n\t\t\t\t3D383D201EBD27AF005632C8 /* RCTBridge+Private.h in Copy Headers */,\n\t\t\t\t3D7BFD351EA8E43F008DFB7A /* RCTDevSettings.h in Copy Headers */,\n\t\t\t\t3D7BFD331EA8E433008DFB7A /* RCTPackagerClient.h in Copy Headers */,\n\t\t\t\t3DA981E91E5B0F7F004F2374 /* RCTJSCSamplingProfiler.h in Copy Headers */,\n\t\t\t\t3DA981EB1E5B0F7F004F2374 /* RCTAlertManager.h in Copy Headers */,\n\t\t\t\t3DA981EC1E5B0F7F004F2374 /* RCTAppState.h in Copy Headers */,\n\t\t\t\t3DA981ED1E5B0F7F004F2374 /* RCTAsyncLocalStorage.h in Copy Headers */,\n\t\t\t\t3DA981EE1E5B0F7F004F2374 /* RCTClipboard.h in Copy Headers */,\n\t\t\t\t3DA981EF1E5B0F7F004F2374 /* RCTDevLoadingView.h in Copy Headers */,\n\t\t\t\t3DA981F01E5B0F7F004F2374 /* RCTDevMenu.h in Copy Headers */,\n\t\t\t\t3DA981F11E5B0F7F004F2374 /* RCTEventEmitter.h in Copy Headers */,\n\t\t\t\t3DA981F21E5B0F7F004F2374 /* RCTExceptionsManager.h in Copy Headers */,\n\t\t\t\t3DA981F31E5B0F7F004F2374 /* RCTI18nManager.h in Copy Headers */,\n\t\t\t\t3DA981F41E5B0F7F004F2374 /* RCTI18nUtil.h in Copy Headers */,\n\t\t\t\t3DA981F61E5B0F7F004F2374 /* RCTRedBox.h in Copy Headers */,\n\t\t\t\t3DA981F71E5B0F7F004F2374 /* RCTSourceCode.h in Copy Headers */,\n\t\t\t\t3DA981F91E5B0F7F004F2374 /* RCTTiming.h in Copy Headers */,\n\t\t\t\t3DA981FA1E5B0F7F004F2374 /* RCTUIManager.h in Copy Headers */,\n\t\t\t\t3DA981FB1E5B0F7F004F2374 /* RCTFPSGraph.h in Copy Headers */,\n\t\t\t\t3DA981FD1E5B0F7F004F2374 /* RCTMacros.h in Copy Headers */,\n\t\t\t\t3DA981FE1E5B0F7F004F2374 /* RCTProfile.h in Copy Headers */,\n\t\t\t\t3DA981FF1E5B0F7F004F2374 /* RCTActivityIndicatorView.h in Copy Headers */,\n\t\t\t\t3DA982001E5B0F7F004F2374 /* RCTActivityIndicatorViewManager.h in Copy Headers */,\n\t\t\t\t3DA982011E5B0F7F004F2374 /* RCTAnimationType.h in Copy Headers */,\n\t\t\t\t3DA982021E5B0F7F004F2374 /* RCTAutoInsetsProtocol.h in Copy Headers */,\n\t\t\t\t3DA982031E5B0F7F004F2374 /* RCTBorderDrawing.h in Copy Headers */,\n\t\t\t\t3DA982041E5B0F7F004F2374 /* RCTBorderStyle.h in Copy Headers */,\n\t\t\t\t3DA982051E5B0F7F004F2374 /* RCTComponent.h in Copy Headers */,\n\t\t\t\t3DA982061E5B0F7F004F2374 /* RCTComponentData.h in Copy Headers */,\n\t\t\t\t3DA982071E5B0F7F004F2374 /* RCTConvert+CoreLocation.h in Copy Headers */,\n\t\t\t\t3DA9820A1E5B0F7F004F2374 /* RCTDatePicker.h in Copy Headers */,\n\t\t\t\t3DA9820B1E5B0F7F004F2374 /* RCTDatePickerManager.h in Copy Headers */,\n\t\t\t\t3DA9820C1E5B0F7F004F2374 /* RCTFont.h in Copy Headers */,\n\t\t\t\t3DA982111E5B0F7F004F2374 /* RCTModalHostView.h in Copy Headers */,\n\t\t\t\t3DA982121E5B0F7F004F2374 /* RCTModalHostViewController.h in Copy Headers */,\n\t\t\t\t3DA982131E5B0F7F004F2374 /* RCTModalHostViewManager.h in Copy Headers */,\n\t\t\t\t3DA982181E5B0F7F004F2374 /* RCTPicker.h in Copy Headers */,\n\t\t\t\t3DA982191E5B0F7F004F2374 /* RCTPickerManager.h in Copy Headers */,\n\t\t\t\t3DA9821A1E5B0F7F004F2374 /* RCTPointerEvents.h in Copy Headers */,\n\t\t\t\t3DA9821B1E5B0F7F004F2374 /* RCTProgressViewManager.h in Copy Headers */,\n\t\t\t\t3DA9821E1E5B0F7F004F2374 /* RCTRootShadowView.h in Copy Headers */,\n\t\t\t\t3DA982241E5B0F7F004F2374 /* RCTSegmentedControl.h in Copy Headers */,\n\t\t\t\t3DA982251E5B0F7F004F2374 /* RCTSegmentedControlManager.h in Copy Headers */,\n\t\t\t\t3DA982261E5B0F7F004F2374 /* RCTShadowView.h in Copy Headers */,\n\t\t\t\t3DA982271E5B0F7F004F2374 /* RCTSlider.h in Copy Headers */,\n\t\t\t\t3DA982281E5B0F7F004F2374 /* RCTSliderManager.h in Copy Headers */,\n\t\t\t\t3DA982291E5B0F7F004F2374 /* RCTSwitch.h in Copy Headers */,\n\t\t\t\t3DA9822A1E5B0F7F004F2374 /* RCTSwitchManager.h in Copy Headers */,\n\t\t\t\t3DA9822F1E5B0F7F004F2374 /* RCTTextDecorationLineType.h in Copy Headers */,\n\t\t\t\t3DA982311E5B0F7F004F2374 /* RCTView.h in Copy Headers */,\n\t\t\t\t3DA982321E5B0F7F004F2374 /* RCTViewControllerProtocol.h in Copy Headers */,\n\t\t\t\t3DA982331E5B0F7F004F2374 /* RCTViewManager.h in Copy Headers */,\n\t\t\t\t3DA982341E5B0F7F004F2374 /* RCTWebView.h in Copy Headers */,\n\t\t\t\t3DA982351E5B0F7F004F2374 /* RCTWebViewManager.h in Copy Headers */,\n\t\t\t\t3DA982381E5B0F7F004F2374 /* NSView+React.h in Copy Headers */,\n\t\t\t\t3DA981BF1E5B0F29004F2374 /* RCTAssert.h in Copy Headers */,\n\t\t\t\t3DA981C01E5B0F29004F2374 /* RCTBridge.h in Copy Headers */,\n\t\t\t\t3DA981C21E5B0F29004F2374 /* RCTBridgeDelegate.h in Copy Headers */,\n\t\t\t\t3DA981C31E5B0F29004F2374 /* RCTBridgeMethod.h in Copy Headers */,\n\t\t\t\t3DA981C41E5B0F29004F2374 /* RCTBridgeModule.h in Copy Headers */,\n\t\t\t\t3DA981C51E5B0F29004F2374 /* RCTBundleURLProvider.h in Copy Headers */,\n\t\t\t\t3DA981C61E5B0F29004F2374 /* RCTConvert.h in Copy Headers */,\n\t\t\t\t3DA981C71E5B0F29004F2374 /* RCTDefines.h in Copy Headers */,\n\t\t\t\t3DA981C81E5B0F29004F2374 /* RCTDisplayLink.h in Copy Headers */,\n\t\t\t\t3DA981C91E5B0F29004F2374 /* RCTErrorCustomizer.h in Copy Headers */,\n\t\t\t\t3DA981CA1E5B0F29004F2374 /* RCTErrorInfo.h in Copy Headers */,\n\t\t\t\t3DA981CB1E5B0F29004F2374 /* RCTEventDispatcher.h in Copy Headers */,\n\t\t\t\t3DA981CC1E5B0F29004F2374 /* RCTFrameUpdate.h in Copy Headers */,\n\t\t\t\t3DA981CD1E5B0F29004F2374 /* RCTImageSource.h in Copy Headers */,\n\t\t\t\t3DA981CE1E5B0F29004F2374 /* RCTInvalidating.h in Copy Headers */,\n\t\t\t\t3DA981CF1E5B0F29004F2374 /* RCTJavaScriptExecutor.h in Copy Headers */,\n\t\t\t\t3DA981D01E5B0F29004F2374 /* RCTJavaScriptLoader.h in Copy Headers */,\n\t\t\t\t3DA981D11E5B0F29004F2374 /* RCTJSStackFrame.h in Copy Headers */,\n\t\t\t\t3DA981D21E5B0F29004F2374 /* RCTKeyCommands.h in Copy Headers */,\n\t\t\t\t3DA981D31E5B0F29004F2374 /* RCTLog.h in Copy Headers */,\n\t\t\t\t3DA981D41E5B0F29004F2374 /* RCTModuleData.h in Copy Headers */,\n\t\t\t\t3DA981D51E5B0F29004F2374 /* RCTModuleMethod.h in Copy Headers */,\n\t\t\t\t3DA981D61E5B0F29004F2374 /* RCTMultipartDataTask.h in Copy Headers */,\n\t\t\t\t3DA981D71E5B0F29004F2374 /* RCTMultipartStreamReader.h in Copy Headers */,\n\t\t\t\t3DA981D81E5B0F29004F2374 /* RCTNullability.h in Copy Headers */,\n\t\t\t\t3DA981D91E5B0F29004F2374 /* RCTParserUtils.h in Copy Headers */,\n\t\t\t\t3DA981DA1E5B0F29004F2374 /* RCTPerformanceLogger.h in Copy Headers */,\n\t\t\t\t3DA981DB1E5B0F29004F2374 /* RCTPlatform.h in Copy Headers */,\n\t\t\t\t3DA981DC1E5B0F29004F2374 /* RCTReloadCommand.h in Copy Headers */,\n\t\t\t\t3DA981DD1E5B0F29004F2374 /* RCTRootContentView.h in Copy Headers */,\n\t\t\t\t3DA981DE1E5B0F29004F2374 /* RCTRootView.h in Copy Headers */,\n\t\t\t\t3DA981DF1E5B0F29004F2374 /* RCTRootViewDelegate.h in Copy Headers */,\n\t\t\t\t3DA981E11E5B0F29004F2374 /* RCTTouchEvent.h in Copy Headers */,\n\t\t\t\t3DA981E21E5B0F29004F2374 /* RCTTouchHandler.h in Copy Headers */,\n\t\t\t\t3DA981E31E5B0F29004F2374 /* RCTURLRequestDelegate.h in Copy Headers */,\n\t\t\t\t3DA981E41E5B0F29004F2374 /* RCTURLRequestHandler.h in Copy Headers */,\n\t\t\t\t3DA981E51E5B0F29004F2374 /* RCTUtils.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D302F171DF825FE00D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/yoga;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3DFE0D1A1DF8575800459392 /* YGEnums.h in Copy Headers */,\n\t\t\t\t3DFE0D1B1DF8575800459392 /* YGMacros.h in Copy Headers */,\n\t\t\t\t3DFE0D1C1DF8575800459392 /* Yoga.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D302F1B1DF8263300D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/cxxreact;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t598FD1921F816A2A006C54CB /* RAMBundleRegistry.h in Copy Headers */,\n\t\t\t\t3DA9823B1E5B1053004F2374 /* CxxModule.h in Copy Headers */,\n\t\t\t\t3DA9823C1E5B1053004F2374 /* CxxNativeModule.h in Copy Headers */,\n\t\t\t\t3DA9823D1E5B1053004F2374 /* JSExecutor.h in Copy Headers */,\n\t\t\t\t3DA982401E5B1053004F2374 /* Instance.h in Copy Headers */,\n\t\t\t\t3DA982411E5B1053004F2374 /* JsArgumentHelpers-inl.h in Copy Headers */,\n\t\t\t\t3DA982421E5B1053004F2374 /* JsArgumentHelpers.h in Copy Headers */,\n\t\t\t\t3DA982431E5B1053004F2374 /* JSBigString.h in Copy Headers */,\n\t\t\t\t3DA982441E5B1053004F2374 /* JSBundleType.h in Copy Headers */,\n\t\t\t\t3DA982451E5B1053004F2374 /* JSCExecutor.h in Copy Headers */,\n\t\t\t\t3DA982471E5B1053004F2374 /* JSCLegacyTracing.h in Copy Headers */,\n\t\t\t\t3DA982481E5B1053004F2374 /* JSCMemory.h in Copy Headers */,\n\t\t\t\t3DA982491E5B1053004F2374 /* JSCNativeModules.h in Copy Headers */,\n\t\t\t\t3DA9824A1E5B1053004F2374 /* JSCPerfStats.h in Copy Headers */,\n\t\t\t\t3DA9824B1E5B1053004F2374 /* JSCSamplingProfiler.h in Copy Headers */,\n\t\t\t\t3DA9824C1E5B1053004F2374 /* JSCUtils.h in Copy Headers */,\n\t\t\t\t3DA9824E1E5B1053004F2374 /* JSIndexedRAMBundle.h in Copy Headers */,\n\t\t\t\t3DA9824F1E5B1053004F2374 /* JSModulesUnbundle.h in Copy Headers */,\n\t\t\t\t3DA982501E5B1053004F2374 /* MessageQueueThread.h in Copy Headers */,\n\t\t\t\t3DA982511E5B1053004F2374 /* MethodCall.h in Copy Headers */,\n\t\t\t\t3DA982521E5B1053004F2374 /* ModuleRegistry.h in Copy Headers */,\n\t\t\t\t3DA982531E5B1053004F2374 /* NativeModule.h in Copy Headers */,\n\t\t\t\t3DA982541E5B1053004F2374 /* NativeToJsBridge.h in Copy Headers */,\n\t\t\t\t3DA982551E5B1053004F2374 /* oss-compat-util.h in Copy Headers */,\n\t\t\t\t3DA982561E5B1053004F2374 /* Platform.h in Copy Headers */,\n\t\t\t\t3DA982571E5B1053004F2374 /* RecoverableError.h in Copy Headers */,\n\t\t\t\t3DA982581E5B1053004F2374 /* SampleCxxModule.h in Copy Headers */,\n\t\t\t\t3DA982591E5B1053004F2374 /* SystraceSection.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D302F1D1DF8264A00D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/jschelpers;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3DA982601E5B1089004F2374 /* JSCHelpers.h in Copy Headers */,\n\t\t\t\t3DA982611E5B1089004F2374 /* noncopyable.h in Copy Headers */,\n\t\t\t\t3DA982621E5B1089004F2374 /* Unicode.h in Copy Headers */,\n\t\t\t\t3DA982631E5B1089004F2374 /* Value.h in Copy Headers */,\n\t\t\t\t3D302F1E1DF8265A00D6DDAE /* JavaScriptCore.h in Copy Headers */,\n\t\t\t\t3D302F1F1DF8265A00D6DDAE /* JSCWrapper.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D383D491EBD27B9005632C8 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/$(PRODUCT_NAME)\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3D383D4A1EBD27B9005632C8 /* bignum-dtoa.h in CopyFiles */,\n\t\t\t\t3D383D4B1EBD27B9005632C8 /* bignum.h in CopyFiles */,\n\t\t\t\t3D383D4C1EBD27B9005632C8 /* cached-powers.h in CopyFiles */,\n\t\t\t\t3D383D4D1EBD27B9005632C8 /* diy-fp.h in CopyFiles */,\n\t\t\t\t3D383D4E1EBD27B9005632C8 /* double-conversion.h in CopyFiles */,\n\t\t\t\t3D383D4F1EBD27B9005632C8 /* fast-dtoa.h in CopyFiles */,\n\t\t\t\t3D383D501EBD27B9005632C8 /* fixed-dtoa.h in CopyFiles */,\n\t\t\t\t3D383D511EBD27B9005632C8 /* ieee.h in CopyFiles */,\n\t\t\t\t3D383D521EBD27B9005632C8 /* strtod.h in CopyFiles */,\n\t\t\t\t3D383D531EBD27B9005632C8 /* utils.h in CopyFiles */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D80D91E1DF6FA530028D040 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/React;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\tD4EEE3542020933B00C4CBB6 /* UIImageUtils.h in Copy Headers */,\n\t\t\t\t59EDBCBD1FDF4E43003573DE /* RCTScrollableProtocol.h in Copy Headers */,\n\t\t\t\t59EDBCBE1FDF4E43003573DE /* RCTScrollContentShadowView.h in Copy Headers */,\n\t\t\t\t59EDBCBF1FDF4E43003573DE /* RCTScrollContentView.h in Copy Headers */,\n\t\t\t\t59EDBCC01FDF4E43003573DE /* RCTScrollContentViewManager.h in Copy Headers */,\n\t\t\t\t59EDBCC11FDF4E43003573DE /* RCTScrollView.h in Copy Headers */,\n\t\t\t\t59EDBCC21FDF4E43003573DE /* RCTScrollViewManager.h in Copy Headers */,\n\t\t\t\t594F0A381FD233A2007FBE96 /* RCTSurface.h in Copy Headers */,\n\t\t\t\t594F0A391FD233A2007FBE96 /* RCTSurfaceDelegate.h in Copy Headers */,\n\t\t\t\t594F0A3A1FD233A2007FBE96 /* RCTSurfaceRootShadowView.h in Copy Headers */,\n\t\t\t\t594F0A3B1FD233A2007FBE96 /* RCTSurfaceRootShadowViewDelegate.h in Copy Headers */,\n\t\t\t\t594F0A3C1FD233A2007FBE96 /* RCTSurfaceRootView.h in Copy Headers */,\n\t\t\t\t594F0A3D1FD233A2007FBE96 /* RCTSurfaceStage.h in Copy Headers */,\n\t\t\t\t594F0A3E1FD233A2007FBE96 /* RCTSurfaceView.h in Copy Headers */,\n\t\t\t\t594F0A3F1FD233A2007FBE96 /* RCTSurfaceHostingView.h in Copy Headers */,\n\t\t\t\t594F0A401FD233A2007FBE96 /* RCTSurfaceSizeMeasureMode.h in Copy Headers */,\n\t\t\t\t59500D471F71C66700B122B7 /* RCTUIManagerUtils.h in Copy Headers */,\n\t\t\t\t3D0E378F1F1CC5CF00DCAC9F /* RCTWebSocketModule.h in Copy Headers */,\n\t\t\t\t5960C1BD1F0804DF0066FD5B /* RCTLayoutAnimation.h in Copy Headers */,\n\t\t\t\t5960C1BE1F0804DF0066FD5B /* RCTLayoutAnimationGroup.h in Copy Headers */,\n\t\t\t\t59EB6DBF1EBD6FFC0072A5E7 /* RCTUIManagerObserverCoordinator.h in Copy Headers */,\n\t\t\t\t59B1EBC91EBD46250047B19B /* RCTShadowView+Layout.h in Copy Headers */,\n\t\t\t\t3D383D1F1EBD27A8005632C8 /* RCTBridge+Private.h in Copy Headers */,\n\t\t\t\t3D7BFD311EA8E41F008DFB7A /* RCTPackagerClient.h in Copy Headers */,\n\t\t\t\t3D7BFD291EA8E37B008DFB7A /* RCTDevSettings.h in Copy Headers */,\n\t\t\t\t3D80D91F1DF6FA890028D040 /* RCTImageLoader.h in Copy Headers */,\n\t\t\t\t3D80D9201DF6FA890028D040 /* RCTImageStoreManager.h in Copy Headers */,\n\t\t\t\t3D80D9211DF6FA890028D040 /* RCTResizeMode.h in Copy Headers */,\n\t\t\t\t3D80D9221DF6FA890028D040 /* RCTLinkingManager.h in Copy Headers */,\n\t\t\t\t3D80D9231DF6FA890028D040 /* RCTNetworking.h in Copy Headers */,\n\t\t\t\t3D80D9241DF6FA890028D040 /* RCTNetworkTask.h in Copy Headers */,\n\t\t\t\t3D80D9251DF6FA890028D040 /* RCTPushNotificationManager.h in Copy Headers */,\n\t\t\t\t3D80D9261DF6FA890028D040 /* RCTAssert.h in Copy Headers */,\n\t\t\t\t3D80D9271DF6FA890028D040 /* RCTBridge.h in Copy Headers */,\n\t\t\t\t3D80D9291DF6FA890028D040 /* RCTBridgeDelegate.h in Copy Headers */,\n\t\t\t\t3D80D92A1DF6FA890028D040 /* RCTBridgeMethod.h in Copy Headers */,\n\t\t\t\t3D80D92B1DF6FA890028D040 /* RCTBridgeModule.h in Copy Headers */,\n\t\t\t\t3D80D92C1DF6FA890028D040 /* RCTBundleURLProvider.h in Copy Headers */,\n\t\t\t\t3D80D92D1DF6FA890028D040 /* RCTConvert.h in Copy Headers */,\n\t\t\t\t3D80D92E1DF6FA890028D040 /* RCTDefines.h in Copy Headers */,\n\t\t\t\t3D80D92F1DF6FA890028D040 /* RCTDisplayLink.h in Copy Headers */,\n\t\t\t\t3D80D9301DF6FA890028D040 /* RCTErrorCustomizer.h in Copy Headers */,\n\t\t\t\t3D80D9311DF6FA890028D040 /* RCTErrorInfo.h in Copy Headers */,\n\t\t\t\t3D80D9321DF6FA890028D040 /* RCTEventDispatcher.h in Copy Headers */,\n\t\t\t\t3D80D9331DF6FA890028D040 /* RCTFrameUpdate.h in Copy Headers */,\n\t\t\t\t3D80D9341DF6FA890028D040 /* RCTImageSource.h in Copy Headers */,\n\t\t\t\t3D80D9351DF6FA890028D040 /* RCTInvalidating.h in Copy Headers */,\n\t\t\t\t3D80D9361DF6FA890028D040 /* RCTJavaScriptExecutor.h in Copy Headers */,\n\t\t\t\t3D80D9371DF6FA890028D040 /* RCTJavaScriptLoader.h in Copy Headers */,\n\t\t\t\t3D80D9381DF6FA890028D040 /* RCTJSStackFrame.h in Copy Headers */,\n\t\t\t\t3D80D9391DF6FA890028D040 /* RCTKeyCommands.h in Copy Headers */,\n\t\t\t\t3D80D93A1DF6FA890028D040 /* RCTLog.h in Copy Headers */,\n\t\t\t\t3D80D93B1DF6FA890028D040 /* RCTModuleData.h in Copy Headers */,\n\t\t\t\t3D80D93C1DF6FA890028D040 /* RCTModuleMethod.h in Copy Headers */,\n\t\t\t\t3D80D93D1DF6FA890028D040 /* RCTMultipartDataTask.h in Copy Headers */,\n\t\t\t\t3D80D93E1DF6FA890028D040 /* RCTMultipartStreamReader.h in Copy Headers */,\n\t\t\t\t3D80D93F1DF6FA890028D040 /* RCTNullability.h in Copy Headers */,\n\t\t\t\t3D80D9401DF6FA890028D040 /* RCTParserUtils.h in Copy Headers */,\n\t\t\t\t3D80D9411DF6FA890028D040 /* RCTPerformanceLogger.h in Copy Headers */,\n\t\t\t\t3D80D9421DF6FA890028D040 /* RCTPlatform.h in Copy Headers */,\n\t\t\t\t3D80D9431DF6FA890028D040 /* RCTRootView.h in Copy Headers */,\n\t\t\t\t3D80D9441DF6FA890028D040 /* RCTRootViewDelegate.h in Copy Headers */,\n\t\t\t\t3D80D9461DF6FA890028D040 /* RCTTouchEvent.h in Copy Headers */,\n\t\t\t\t3D80D9471DF6FA890028D040 /* RCTTouchHandler.h in Copy Headers */,\n\t\t\t\t3D80D9481DF6FA890028D040 /* RCTURLRequestDelegate.h in Copy Headers */,\n\t\t\t\t3D80D9491DF6FA890028D040 /* RCTURLRequestHandler.h in Copy Headers */,\n\t\t\t\t3D80D94A1DF6FA890028D040 /* RCTUtils.h in Copy Headers */,\n\t\t\t\t3D80D94F1DF6FA890028D040 /* RCTJSCSamplingProfiler.h in Copy Headers */,\n\t\t\t\t3D80D9511DF6FA890028D040 /* RCTAlertManager.h in Copy Headers */,\n\t\t\t\t3D80D9521DF6FA890028D040 /* RCTAppState.h in Copy Headers */,\n\t\t\t\t3D80D9531DF6FA890028D040 /* RCTAsyncLocalStorage.h in Copy Headers */,\n\t\t\t\t3D80D9541DF6FA890028D040 /* RCTClipboard.h in Copy Headers */,\n\t\t\t\t3D80D9551DF6FA890028D040 /* RCTDevLoadingView.h in Copy Headers */,\n\t\t\t\t3D80D9561DF6FA890028D040 /* RCTDevMenu.h in Copy Headers */,\n\t\t\t\t3D80D9571DF6FA890028D040 /* RCTEventEmitter.h in Copy Headers */,\n\t\t\t\t3D80D9581DF6FA890028D040 /* RCTExceptionsManager.h in Copy Headers */,\n\t\t\t\t3D80D9591DF6FA890028D040 /* RCTI18nManager.h in Copy Headers */,\n\t\t\t\t3D80D95A1DF6FA890028D040 /* RCTI18nUtil.h in Copy Headers */,\n\t\t\t\t3D80D95C1DF6FA890028D040 /* RCTRedBox.h in Copy Headers */,\n\t\t\t\t3D80D95D1DF6FA890028D040 /* RCTSourceCode.h in Copy Headers */,\n\t\t\t\t3D80D95F1DF6FA890028D040 /* RCTTiming.h in Copy Headers */,\n\t\t\t\t3D80D9601DF6FA890028D040 /* RCTUIManager.h in Copy Headers */,\n\t\t\t\t3D80D9611DF6FA890028D040 /* RCTFPSGraph.h in Copy Headers */,\n\t\t\t\t3D80D9631DF6FA890028D040 /* RCTMacros.h in Copy Headers */,\n\t\t\t\t3D80D9641DF6FA890028D040 /* RCTProfile.h in Copy Headers */,\n\t\t\t\t3D80D9651DF6FA890028D040 /* RCTActivityIndicatorView.h in Copy Headers */,\n\t\t\t\t3D80D9661DF6FA890028D040 /* RCTActivityIndicatorViewManager.h in Copy Headers */,\n\t\t\t\t3D80D9671DF6FA890028D040 /* RCTAnimationType.h in Copy Headers */,\n\t\t\t\t3D80D9681DF6FA890028D040 /* RCTAutoInsetsProtocol.h in Copy Headers */,\n\t\t\t\t3D80D9691DF6FA890028D040 /* RCTBorderDrawing.h in Copy Headers */,\n\t\t\t\t3D80D96A1DF6FA890028D040 /* RCTBorderStyle.h in Copy Headers */,\n\t\t\t\t3D80D96B1DF6FA890028D040 /* RCTComponent.h in Copy Headers */,\n\t\t\t\t3D80D96C1DF6FA890028D040 /* RCTComponentData.h in Copy Headers */,\n\t\t\t\t3D80D96D1DF6FA890028D040 /* RCTConvert+CoreLocation.h in Copy Headers */,\n\t\t\t\t3D80D96F1DF6FA890028D040 /* RCTDatePicker.h in Copy Headers */,\n\t\t\t\t3D80D9701DF6FA890028D040 /* RCTDatePickerManager.h in Copy Headers */,\n\t\t\t\t3D80D9711DF6FA890028D040 /* RCTFont.h in Copy Headers */,\n\t\t\t\t3D80D9761DF6FA890028D040 /* RCTModalHostView.h in Copy Headers */,\n\t\t\t\t3D80D9771DF6FA890028D040 /* RCTModalHostViewController.h in Copy Headers */,\n\t\t\t\t3D80D9781DF6FA890028D040 /* RCTModalHostViewManager.h in Copy Headers */,\n\t\t\t\t3D80D97D1DF6FA890028D040 /* RCTPicker.h in Copy Headers */,\n\t\t\t\t3D80D97E1DF6FA890028D040 /* RCTPickerManager.h in Copy Headers */,\n\t\t\t\t3D80D97F1DF6FA890028D040 /* RCTPointerEvents.h in Copy Headers */,\n\t\t\t\t3D80D9801DF6FA890028D040 /* RCTProgressViewManager.h in Copy Headers */,\n\t\t\t\t3D80D9831DF6FA890028D040 /* RCTRootShadowView.h in Copy Headers */,\n\t\t\t\t3D80D9871DF6FA890028D040 /* RCTSegmentedControl.h in Copy Headers */,\n\t\t\t\t3D80D9881DF6FA890028D040 /* RCTSegmentedControlManager.h in Copy Headers */,\n\t\t\t\t3D80D9891DF6FA890028D040 /* RCTShadowView.h in Copy Headers */,\n\t\t\t\t3D80D98A1DF6FA890028D040 /* RCTSlider.h in Copy Headers */,\n\t\t\t\t3D80D98B1DF6FA890028D040 /* RCTSliderManager.h in Copy Headers */,\n\t\t\t\t3D80D98C1DF6FA890028D040 /* RCTSwitch.h in Copy Headers */,\n\t\t\t\t3D80D98D1DF6FA890028D040 /* RCTSwitchManager.h in Copy Headers */,\n\t\t\t\t3D80D9921DF6FA890028D040 /* RCTTextDecorationLineType.h in Copy Headers */,\n\t\t\t\t3D80D9931DF6FA890028D040 /* RCTView.h in Copy Headers */,\n\t\t\t\t3D80D9941DF6FA890028D040 /* RCTViewControllerProtocol.h in Copy Headers */,\n\t\t\t\t3D80D9951DF6FA890028D040 /* RCTViewManager.h in Copy Headers */,\n\t\t\t\t3D80D9961DF6FA890028D040 /* RCTWebView.h in Copy Headers */,\n\t\t\t\t3D80D9971DF6FA890028D040 /* RCTWebViewManager.h in Copy Headers */,\n\t\t\t\t3D80D99A1DF6FA890028D040 /* NSView+React.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D80DAB41DF8212E0028D040 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 12;\n\t\t\tdstPath = include/yoga;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\tD49593E8202C972800A7694B /* YGNode.h in Copy Headers */,\n\t\t\t\t3DE4F8681DF85D8E00B9E5A0 /* YGEnums.h in Copy Headers */,\n\t\t\t\t3DE4F8691DF85D8E00B9E5A0 /* YGMacros.h in Copy Headers */,\n\t\t\t\t3DE4F86A1DF85D8E00B9E5A0 /* Yoga.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D80DAB91DF821710028D040 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/cxxreact;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\tC669D8981F72E3DE006748EB /* RAMBundleRegistry.h in Copy Headers */,\n\t\t\t\t3DA981A01E5B0E34004F2374 /* CxxModule.h in Copy Headers */,\n\t\t\t\t3DA981A11E5B0E34004F2374 /* CxxNativeModule.h in Copy Headers */,\n\t\t\t\t3DA981A21E5B0E34004F2374 /* JSExecutor.h in Copy Headers */,\n\t\t\t\t3DA981A51E5B0E34004F2374 /* Instance.h in Copy Headers */,\n\t\t\t\t3DA981A61E5B0E34004F2374 /* JsArgumentHelpers-inl.h in Copy Headers */,\n\t\t\t\t3DA981A71E5B0E34004F2374 /* JsArgumentHelpers.h in Copy Headers */,\n\t\t\t\t3DA981A81E5B0E34004F2374 /* JSBigString.h in Copy Headers */,\n\t\t\t\t3DA981A91E5B0E34004F2374 /* JSBundleType.h in Copy Headers */,\n\t\t\t\t3DA981AA1E5B0E34004F2374 /* JSCExecutor.h in Copy Headers */,\n\t\t\t\t3DA981AC1E5B0E34004F2374 /* JSCLegacyTracing.h in Copy Headers */,\n\t\t\t\t3DA981AD1E5B0E34004F2374 /* JSCMemory.h in Copy Headers */,\n\t\t\t\t3DA981AE1E5B0E34004F2374 /* JSCNativeModules.h in Copy Headers */,\n\t\t\t\t3DA981AF1E5B0E34004F2374 /* JSCPerfStats.h in Copy Headers */,\n\t\t\t\t3DA981B01E5B0E34004F2374 /* JSCSamplingProfiler.h in Copy Headers */,\n\t\t\t\t3DA981B11E5B0E34004F2374 /* JSCUtils.h in Copy Headers */,\n\t\t\t\t3DA981B31E5B0E34004F2374 /* JSIndexedRAMBundle.h in Copy Headers */,\n\t\t\t\t3DA981B41E5B0E34004F2374 /* JSModulesUnbundle.h in Copy Headers */,\n\t\t\t\t3DA981B51E5B0E34004F2374 /* MessageQueueThread.h in Copy Headers */,\n\t\t\t\t3DA981B61E5B0E34004F2374 /* MethodCall.h in Copy Headers */,\n\t\t\t\t3DA981B71E5B0E34004F2374 /* ModuleRegistry.h in Copy Headers */,\n\t\t\t\t3DA981B81E5B0E34004F2374 /* NativeModule.h in Copy Headers */,\n\t\t\t\t3DA981B91E5B0E34004F2374 /* NativeToJsBridge.h in Copy Headers */,\n\t\t\t\t3DA981BA1E5B0E34004F2374 /* oss-compat-util.h in Copy Headers */,\n\t\t\t\t3DA981BB1E5B0E34004F2374 /* Platform.h in Copy Headers */,\n\t\t\t\t3DA981BC1E5B0E34004F2374 /* RecoverableError.h in Copy Headers */,\n\t\t\t\t3DA981BD1E5B0E34004F2374 /* SampleCxxModule.h in Copy Headers */,\n\t\t\t\t3DA981BE1E5B0E34004F2374 /* SystraceSection.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D80DABB1DF8218B0028D040 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/jschelpers;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3DA9825A1E5B1079004F2374 /* JavaScriptCore.h in Copy Headers */,\n\t\t\t\t3DA9825B1E5B1079004F2374 /* JSCHelpers.h in Copy Headers */,\n\t\t\t\t3DA9825C1E5B1079004F2374 /* JSCWrapper.h in Copy Headers */,\n\t\t\t\t3DA9825D1E5B1079004F2374 /* noncopyable.h in Copy Headers */,\n\t\t\t\t3DA9825E1E5B1079004F2374 /* Unicode.h in Copy Headers */,\n\t\t\t\t3DA9825F1E5B1079004F2374 /* Value.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t9936F3021F5F2E4B0010BF04 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/privatedata;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t9936F33D1F5F2FF40010BF04 /* PrivateDataBase.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t9936F31E1F5F2E5B0010BF04 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/privatedata;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t9936F33A1F5F2F7C0010BF04 /* PrivateDataBase.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tEBF21BCB1FC498900052F4D5 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/jsinspector;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\tEBF21BFB1FC498FC0052F4D5 /* InspectorInterfaces.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tEBF21BE91FC4989A0052F4D5 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/jsinspector;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\tEBF21BFE1FC499840052F4D5 /* InspectorInterfaces.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSourceCode.h; sourceTree = \"<group>\"; };\n\t\t000E6CEA1AB0E980000CDF4D /* RCTSourceCode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSourceCode.m; sourceTree = \"<group>\"; };\n\t\t001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMultipartStreamReader.h; sourceTree = \"<group>\"; };\n\t\t001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMultipartStreamReader.m; sourceTree = \"<group>\"; };\n\t\t006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMultipartDataTask.h; sourceTree = \"<group>\"; };\n\t\t006FC4131D9B20820057AAAD /* RCTMultipartDataTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMultipartDataTask.m; sourceTree = \"<group>\"; };\n\t\t008341F41D1DB34400876D9A /* RCTJSStackFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJSStackFrame.m; sourceTree = \"<group>\"; };\n\t\t008341F51D1DB34400876D9A /* RCTJSStackFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSStackFrame.h; sourceTree = \"<group>\"; };\n\t\t1304439F1E3FEAA900D93A67 /* RCTFollyConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTFollyConvert.h; path = CxxUtils/RCTFollyConvert.h; sourceTree = \"<group>\"; };\n\t\t130443A01E3FEAA900D93A67 /* RCTFollyConvert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RCTFollyConvert.mm; path = CxxUtils/RCTFollyConvert.mm; sourceTree = \"<group>\"; };\n\t\t130443C31E401A8C00D93A67 /* RCTConvert+Transform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"RCTConvert+Transform.h\"; sourceTree = \"<group>\"; };\n\t\t130443C41E401A8C00D93A67 /* RCTConvert+Transform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"RCTConvert+Transform.m\"; sourceTree = \"<group>\"; };\n\t\t130A77031DF767AF001F9587 /* YGEnums.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YGEnums.h; sourceTree = \"<group>\"; };\n\t\t130A77041DF767AF001F9587 /* YGMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YGMacros.h; sourceTree = \"<group>\"; };\n\t\t130A77081DF767AF001F9587 /* Yoga.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Yoga.h; sourceTree = \"<group>\"; };\n\t\t130E3D861E6A082100ACE484 /* RCTDevSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDevSettings.h; sourceTree = \"<group>\"; };\n\t\t130E3D871E6A082100ACE484 /* RCTDevSettings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTDevSettings.mm; sourceTree = \"<group>\"; };\n\t\t13134C741E296B2A00B9F3CB /* RCTCxxBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTCxxBridge.mm; sourceTree = \"<group>\"; };\n\t\t13134C771E296B2A00B9F3CB /* RCTMessageThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMessageThread.h; sourceTree = \"<group>\"; };\n\t\t13134C781E296B2A00B9F3CB /* RCTMessageThread.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTMessageThread.mm; sourceTree = \"<group>\"; };\n\t\t13134C7B1E296B2A00B9F3CB /* RCTObjcExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTObjcExecutor.h; sourceTree = \"<group>\"; };\n\t\t13134C7C1E296B2A00B9F3CB /* RCTObjcExecutor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTObjcExecutor.mm; sourceTree = \"<group>\"; };\n\t\t13134C7E1E296B2A00B9F3CB /* RCTCxxMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTCxxMethod.h; sourceTree = \"<group>\"; };\n\t\t13134C7F1E296B2A00B9F3CB /* RCTCxxMethod.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTCxxMethod.mm; sourceTree = \"<group>\"; };\n\t\t13134C801E296B2A00B9F3CB /* RCTCxxModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTCxxModule.h; sourceTree = \"<group>\"; };\n\t\t13134C811E296B2A00B9F3CB /* RCTCxxModule.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTCxxModule.mm; sourceTree = \"<group>\"; };\n\t\t13134C821E296B2A00B9F3CB /* RCTCxxUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTCxxUtils.h; sourceTree = \"<group>\"; };\n\t\t13134C831E296B2A00B9F3CB /* RCTCxxUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTCxxUtils.mm; sourceTree = \"<group>\"; };\n\t\t131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSegmentedControl.h; sourceTree = \"<group>\"; };\n\t\t131B6AF11AF1093D00FFC3E0 /* RCTSegmentedControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSegmentedControl.m; sourceTree = \"<group>\"; };\n\t\t131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSegmentedControlManager.h; sourceTree = \"<group>\"; };\n\t\t131B6AF31AF1093D00FFC3E0 /* RCTSegmentedControlManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSegmentedControlManager.m; sourceTree = \"<group>\"; };\n\t\t133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDatePicker.h; sourceTree = \"<group>\"; };\n\t\t133CAE8D1B8E5CFD00F6AD92 /* RCTDatePicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDatePicker.m; sourceTree = \"<group>\"; };\n\t\t13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAnimationType.h; sourceTree = \"<group>\"; };\n\t\t13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPointerEvents.h; sourceTree = \"<group>\"; };\n\t\t13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTViewControllerProtocol.h; sourceTree = \"<group>\"; };\n\t\t13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"RCTConvert+CoreLocation.h\"; sourceTree = \"<group>\"; };\n\t\t13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"RCTConvert+CoreLocation.m\"; sourceTree = \"<group>\"; };\n\t\t1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTURLRequestDelegate.h; sourceTree = \"<group>\"; };\n\t\t1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTURLRequestHandler.h; sourceTree = \"<group>\"; };\n\t\t134D63C21F1FEC4B008872B5 /* RCTCxxBridgeDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTCxxBridgeDelegate.h; sourceTree = \"<group>\"; };\n\t\t13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTProgressViewManager.h; sourceTree = \"<group>\"; };\n\t\t13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTProgressViewManager.m; sourceTree = \"<group>\"; };\n\t\t135A9BF91E7B0EAE00587AEB /* RCTJSCErrorHandling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSCErrorHandling.h; sourceTree = \"<group>\"; };\n\t\t135A9BFA1E7B0EAE00587AEB /* RCTJSCErrorHandling.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTJSCErrorHandling.mm; sourceTree = \"<group>\"; };\n\t\t135A9BFD1E7B0EE600587AEB /* RCTJSCHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSCHelpers.h; sourceTree = \"<group>\"; };\n\t\t135A9BFE1E7B0EE600587AEB /* RCTJSCHelpers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTJSCHelpers.mm; sourceTree = \"<group>\"; };\n\t\t1372B7081AB030C200659ED6 /* RCTAppState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAppState.h; sourceTree = \"<group>\"; };\n\t\t1372B7091AB030C200659ED6 /* RCTAppState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAppState.m; sourceTree = \"<group>\"; };\n\t\t1384E2061E806D4E00545659 /* RCTNativeModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNativeModule.h; sourceTree = \"<group>\"; };\n\t\t1384E2071E806D4E00545659 /* RCTNativeModule.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTNativeModule.mm; sourceTree = \"<group>\"; };\n\t\t139D7E391E25C5A300323FB7 /* bignum-dtoa.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = \"bignum-dtoa.cc\"; path = \"double-conversion-1.1.5/src/bignum-dtoa.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7E3A1E25C5A300323FB7 /* bignum-dtoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = \"bignum-dtoa.h\"; path = \"double-conversion-1.1.5/src/bignum-dtoa.h\"; sourceTree = \"<group>\"; };\n\t\t139D7E3B1E25C5A300323FB7 /* bignum.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bignum.cc; path = \"double-conversion-1.1.5/src/bignum.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7E3C1E25C5A300323FB7 /* bignum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bignum.h; path = \"double-conversion-1.1.5/src/bignum.h\"; sourceTree = \"<group>\"; };\n\t\t139D7E3D1E25C5A300323FB7 /* cached-powers.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = \"cached-powers.cc\"; path = \"double-conversion-1.1.5/src/cached-powers.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7E3E1E25C5A300323FB7 /* cached-powers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = \"cached-powers.h\"; path = \"double-conversion-1.1.5/src/cached-powers.h\"; sourceTree = \"<group>\"; };\n\t\t139D7E3F1E25C5A300323FB7 /* diy-fp.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = \"diy-fp.cc\"; path = \"double-conversion-1.1.5/src/diy-fp.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7E401E25C5A300323FB7 /* diy-fp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = \"diy-fp.h\"; path = \"double-conversion-1.1.5/src/diy-fp.h\"; sourceTree = \"<group>\"; };\n\t\t139D7E411E25C5A300323FB7 /* double-conversion.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = \"double-conversion.cc\"; path = \"double-conversion-1.1.5/src/double-conversion.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7E421E25C5A300323FB7 /* double-conversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = \"double-conversion.h\"; path = \"double-conversion-1.1.5/src/double-conversion.h\"; sourceTree = \"<group>\"; };\n\t\t139D7E431E25C5A300323FB7 /* fast-dtoa.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = \"fast-dtoa.cc\"; path = \"double-conversion-1.1.5/src/fast-dtoa.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7E441E25C5A300323FB7 /* fast-dtoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = \"fast-dtoa.h\"; path = \"double-conversion-1.1.5/src/fast-dtoa.h\"; sourceTree = \"<group>\"; };\n\t\t139D7E451E25C5A300323FB7 /* fixed-dtoa.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = \"fixed-dtoa.cc\"; path = \"double-conversion-1.1.5/src/fixed-dtoa.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7E461E25C5A300323FB7 /* fixed-dtoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = \"fixed-dtoa.h\"; path = \"double-conversion-1.1.5/src/fixed-dtoa.h\"; sourceTree = \"<group>\"; };\n\t\t139D7E471E25C5A300323FB7 /* ieee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ieee.h; path = \"double-conversion-1.1.5/src/ieee.h\"; sourceTree = \"<group>\"; };\n\t\t139D7E481E25C5A300323FB7 /* strtod.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = strtod.cc; path = \"double-conversion-1.1.5/src/strtod.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7E491E25C5A300323FB7 /* strtod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strtod.h; path = \"double-conversion-1.1.5/src/strtod.h\"; sourceTree = \"<group>\"; };\n\t\t139D7E4A1E25C5A300323FB7 /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utils.h; path = \"double-conversion-1.1.5/src/utils.h\"; sourceTree = \"<group>\"; };\n\t\t139D7E881E25C6D100323FB7 /* libdouble-conversion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libdouble-conversion.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t139D7ECE1E25DB7D00323FB7 /* libthird-party.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libthird-party.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t139D7ED81E25DBDC00323FB7 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config.h; path = \"glog-0.3.4/src/config.h\"; sourceTree = \"<group>\"; };\n\t\t139D7ED91E25DBDC00323FB7 /* demangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = demangle.h; path = \"glog-0.3.4/src/demangle.h\"; sourceTree = \"<group>\"; };\n\t\t139D7EDA1E25DBDC00323FB7 /* logging.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = logging.cc; path = \"glog-0.3.4/src/logging.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7EDB1E25DBDC00323FB7 /* raw_logging.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = raw_logging.cc; path = \"glog-0.3.4/src/raw_logging.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7EDC1E25DBDC00323FB7 /* signalhandler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = signalhandler.cc; path = \"glog-0.3.4/src/signalhandler.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7EDD1E25DBDC00323FB7 /* stacktrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stacktrace.h; path = \"glog-0.3.4/src/stacktrace.h\"; sourceTree = \"<group>\"; };\n\t\t139D7EDE1E25DBDC00323FB7 /* symbolize.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = symbolize.cc; path = \"glog-0.3.4/src/symbolize.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7EDF1E25DBDC00323FB7 /* symbolize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = symbolize.h; path = \"glog-0.3.4/src/symbolize.h\"; sourceTree = \"<group>\"; };\n\t\t139D7EE01E25DBDC00323FB7 /* utilities.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = utilities.cc; path = \"glog-0.3.4/src/utilities.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7EE11E25DBDC00323FB7 /* utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utilities.h; path = \"glog-0.3.4/src/utilities.h\"; sourceTree = \"<group>\"; };\n\t\t139D7EE21E25DBDC00323FB7 /* vlog_is_on.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = vlog_is_on.cc; path = \"glog-0.3.4/src/vlog_is_on.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7F081E25DE3700323FB7 /* demangle.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = demangle.cc; path = \"glog-0.3.4/src/demangle.cc\"; sourceTree = \"<group>\"; };\n\t\t139D7F111E25DEC900323FB7 /* log_severity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = log_severity.h; sourceTree = \"<group>\"; };\n\t\t139D7F121E25DEC900323FB7 /* logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logging.h; sourceTree = \"<group>\"; };\n\t\t139D7F141E25DEC900323FB7 /* raw_logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = raw_logging.h; sourceTree = \"<group>\"; };\n\t\t139D7F161E25DEC900323FB7 /* stl_logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stl_logging.h; sourceTree = \"<group>\"; };\n\t\t139D7F181E25DEC900323FB7 /* vlog_is_on.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vlog_is_on.h; sourceTree = \"<group>\"; };\n\t\t139D849C1E273B5600323FB7 /* AtomicIntrusiveLinkedList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicIntrusiveLinkedList.h; path = \"folly-2016.09.26.00/folly/AtomicIntrusiveLinkedList.h\"; sourceTree = \"<group>\"; };\n\t\t139D849D1E273B5600323FB7 /* Bits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Bits.cpp; path = \"folly-2016.09.26.00/folly/Bits.cpp\"; sourceTree = \"<group>\"; };\n\t\t139D849E1E273B5600323FB7 /* Bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Bits.h; path = \"folly-2016.09.26.00/folly/Bits.h\"; sourceTree = \"<group>\"; };\n\t\t139D849F1E273B5600323FB7 /* Conv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Conv.cpp; path = \"folly-2016.09.26.00/folly/Conv.cpp\"; sourceTree = \"<group>\"; };\n\t\t139D84A01E273B5600323FB7 /* Conv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Conv.h; path = \"folly-2016.09.26.00/folly/Conv.h\"; sourceTree = \"<group>\"; };\n\t\t139D84A11E273B5600323FB7 /* dynamic-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = \"dynamic-inl.h\"; path = \"folly-2016.09.26.00/folly/dynamic-inl.h\"; sourceTree = \"<group>\"; };\n\t\t139D84A21E273B5600323FB7 /* dynamic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dynamic.cpp; path = \"folly-2016.09.26.00/folly/dynamic.cpp\"; sourceTree = \"<group>\"; };\n\t\t139D84A31E273B5600323FB7 /* dynamic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dynamic.h; path = \"folly-2016.09.26.00/folly/dynamic.h\"; sourceTree = \"<group>\"; };\n\t\t139D84A41E273B5600323FB7 /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Exception.h; path = \"folly-2016.09.26.00/folly/Exception.h\"; sourceTree = \"<group>\"; };\n\t\t139D84A71E273B5600323FB7 /* json.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = json.cpp; path = \"folly-2016.09.26.00/folly/json.cpp\"; sourceTree = \"<group>\"; };\n\t\t139D84A81E273B5600323FB7 /* json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = json.h; path = \"folly-2016.09.26.00/folly/json.h\"; sourceTree = \"<group>\"; };\n\t\t139D84A91E273B5600323FB7 /* Memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Memory.h; path = \"folly-2016.09.26.00/folly/Memory.h\"; sourceTree = \"<group>\"; };\n\t\t139D84AA1E273B5600323FB7 /* MoveWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MoveWrapper.h; path = \"folly-2016.09.26.00/folly/MoveWrapper.h\"; sourceTree = \"<group>\"; };\n\t\t139D84AB1E273B5600323FB7 /* Optional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Optional.h; path = \"folly-2016.09.26.00/folly/Optional.h\"; sourceTree = \"<group>\"; };\n\t\t139D84AC1E273B5600323FB7 /* ScopeGuard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScopeGuard.h; path = \"folly-2016.09.26.00/folly/ScopeGuard.h\"; sourceTree = \"<group>\"; };\n\t\t13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTDevLoadingView.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13A0C2861B74F71200B29F6F /* RCTDevLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDevLoadingView.m; sourceTree = \"<group>\"; };\n\t\t13A0C2871B74F71200B29F6F /* RCTDevMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTDevMenu.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13A0C2881B74F71200B29F6F /* RCTDevMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDevMenu.m; sourceTree = \"<group>\"; };\n\t\t13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTKeyCommands.h; sourceTree = \"<group>\"; };\n\t\t13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTKeyCommands.m; sourceTree = \"<group>\"; };\n\t\t13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTParserUtils.h; sourceTree = \"<group>\"; };\n\t\t13A6E20D1C19AA0C00845B82 /* RCTParserUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTParserUtils.m; sourceTree = \"<group>\"; };\n\t\t13A6E20F1C19ABC700845B82 /* RCTNullability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNullability.h; sourceTree = \"<group>\"; };\n\t\t13AB90BF1B6FA36700713B4F /* RCTComponentData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTComponentData.h; sourceTree = \"<group>\"; };\n\t\t13AB90C01B6FA36700713B4F /* RCTComponentData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTComponentData.m; sourceTree = \"<group>\"; };\n\t\t13AF1F851AE6E777005F5298 /* RCTDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDefines.h; sourceTree = \"<group>\"; };\n\t\t13AF20431AE707F8005F5298 /* RCTSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSlider.h; sourceTree = \"<group>\"; };\n\t\t13AF20441AE707F9005F5298 /* RCTSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSlider.m; sourceTree = \"<group>\"; };\n\t\t13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBridgeMethod.h; sourceTree = \"<group>\"; };\n\t\t13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootViewDelegate.h; sourceTree = \"<group>\"; };\n\t\t13B07FE71A69327A00A75B9A /* RCTAlertManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAlertManager.h; sourceTree = \"<group>\"; };\n\t\t13B07FE81A69327A00A75B9A /* RCTAlertManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAlertManager.m; sourceTree = \"<group>\"; };\n\t\t13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTExceptionsManager.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTExceptionsManager.m; sourceTree = \"<group>\"; };\n\t\t13B07FED1A69327A00A75B9A /* RCTTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTiming.h; sourceTree = \"<group>\"; };\n\t\t13B07FEE1A69327A00A75B9A /* RCTTiming.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTiming.m; sourceTree = \"<group>\"; };\n\t\t13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTActivityIndicatorViewManager.h; sourceTree = \"<group>\"; };\n\t\t13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTActivityIndicatorViewManager.m; sourceTree = \"<group>\"; };\n\t\t13BB3D001BECD54500932C10 /* RCTImageSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTImageSource.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13BB3D011BECD54500932C10 /* RCTImageSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageSource.m; sourceTree = \"<group>\"; };\n\t\t13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootShadowView.h; sourceTree = \"<group>\"; };\n\t\t13BCE8081C99CB9D00DD7AAD /* RCTRootShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootShadowView.m; sourceTree = \"<group>\"; };\n\t\t13C156011AB1A2840079392D /* RCTWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebView.h; sourceTree = \"<group>\"; };\n\t\t13C156021AB1A2840079392D /* RCTWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWebView.m; sourceTree = \"<group>\"; };\n\t\t13C156031AB1A2840079392D /* RCTWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebViewManager.h; sourceTree = \"<group>\"; };\n\t\t13C156041AB1A2840079392D /* RCTWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWebViewManager.m; sourceTree = \"<group>\"; };\n\t\t13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAutoInsetsProtocol.h; sourceTree = \"<group>\"; };\n\t\t13C325281AA63B6A0048765F /* RCTComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTComponent.h; sourceTree = \"<group>\"; };\n\t\t13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBorderDrawing.h; sourceTree = \"<group>\"; };\n\t\t13CC8A811B17642100940AE7 /* RCTBorderDrawing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBorderDrawing.m; sourceTree = \"<group>\"; };\n\t\t13D033611C1837FE0021DC29 /* RCTClipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTClipboard.h; sourceTree = \"<group>\"; };\n\t\t13D033621C1837FE0021DC29 /* RCTClipboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTClipboard.m; sourceTree = \"<group>\"; };\n\t\t13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTEventEmitter.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTEventEmitter.m; sourceTree = \"<group>\"; };\n\t\t13E067481A70F434002CDEE1 /* RCTUIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUIManager.h; sourceTree = \"<group>\"; };\n\t\t13E067491A70F434002CDEE1 /* RCTUIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManager.m; sourceTree = \"<group>\"; };\n\t\t13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTShadowView.h; sourceTree = \"<group>\"; };\n\t\t13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTShadowView.m; sourceTree = \"<group>\"; };\n\t\t13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTViewManager.h; sourceTree = \"<group>\"; };\n\t\t13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTViewManager.m; sourceTree = \"<group>\"; };\n\t\t13E0674F1A70F44B002CDEE1 /* RCTView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTView.h; sourceTree = \"<group>\"; };\n\t\t13E067501A70F44B002CDEE1 /* RCTView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTView.m; sourceTree = \"<group>\"; };\n\t\t13E067531A70F44B002CDEE1 /* NSView+React.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"NSView+React.h\"; sourceTree = \"<group>\"; };\n\t\t13E067541A70F44B002CDEE1 /* NSView+React.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"NSView+React.m\"; sourceTree = \"<group>\"; };\n\t\t13F17A831B8493E5007D4C75 /* RCTRedBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRedBox.h; sourceTree = \"<group>\"; };\n\t\t13F17A841B8493E5007D4C75 /* RCTRedBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRedBox.m; sourceTree = \"<group>\"; };\n\t\t13F887521E2971C500C3C7A1 /* Demangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Demangle.cpp; path = \"folly-2016.09.26.00/folly/Demangle.cpp\"; sourceTree = \"<group>\"; };\n\t\t13F887531E2971C500C3C7A1 /* StringBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringBase.cpp; path = \"folly-2016.09.26.00/folly/StringBase.cpp\"; sourceTree = \"<group>\"; };\n\t\t13F887541E2971C500C3C7A1 /* Unicode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Unicode.cpp; path = \"folly-2016.09.26.00/folly/Unicode.cpp\"; sourceTree = \"<group>\"; };\n\t\t13F8879C1E29740700C3C7A1 /* BitsFunctexcept.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BitsFunctexcept.cpp; path = \"folly-2016.09.26.00/folly/portability/BitsFunctexcept.cpp\"; sourceTree = \"<group>\"; };\n\t\t13F887A01E2977D800C3C7A1 /* MallocImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MallocImpl.cpp; path = \"folly-2016.09.26.00/folly/detail/MallocImpl.cpp\"; sourceTree = \"<group>\"; };\n\t\t14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJavaScriptLoader.h; sourceTree = \"<group>\"; };\n\t\t142014171B32094000CC17BA /* RCTPerformanceLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPerformanceLogger.m; sourceTree = \"<group>\"; };\n\t\t142014181B32094000CC17BA /* RCTPerformanceLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPerformanceLogger.h; sourceTree = \"<group>\"; };\n\t\t1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTFrameUpdate.h; sourceTree = \"<group>\"; };\n\t\t1450FF801BCFF28A00208362 /* RCTProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTProfile.h; sourceTree = \"<group>\"; };\n\t\t1450FF811BCFF28A00208362 /* RCTProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTProfile.m; sourceTree = \"<group>\"; };\n\t\t1450FF821BCFF28A00208362 /* RCTProfileTrampoline-arm.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = \"RCTProfileTrampoline-arm.S\"; sourceTree = \"<group>\"; };\n\t\t1450FF831BCFF28A00208362 /* RCTProfileTrampoline-arm64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = \"RCTProfileTrampoline-arm64.S\"; sourceTree = \"<group>\"; };\n\t\t1450FF851BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = \"RCTProfileTrampoline-x86_64.S\"; sourceTree = \"<group>\"; };\n\t\t1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTBridgeDelegate.h; sourceTree = \"<group>\"; };\n\t\t14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"RCTBridge+Private.h\"; sourceTree = \"<group>\"; };\n\t\t14BF717F1C04793D00C97D0C /* RCTProfileTrampoline-i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = \"RCTProfileTrampoline-i386.S\"; sourceTree = \"<group>\"; };\n\t\t14BF71811C04795500C97D0C /* RCTMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMacros.h; sourceTree = \"<group>\"; };\n\t\t14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModuleMethod.h; sourceTree = \"<group>\"; };\n\t\t14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModuleData.h; sourceTree = \"<group>\"; };\n\t\t14C2CA731B3AC64300E6CBB2 /* RCTModuleData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTModuleData.mm; sourceTree = \"<group>\"; };\n\t\t14C2CA751B3AC64F00E6CBB2 /* RCTFrameUpdate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTFrameUpdate.m; sourceTree = \"<group>\"; };\n\t\t14F362071AABD06A001CE568 /* RCTSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSwitch.h; sourceTree = \"<group>\"; };\n\t\t14F362081AABD06A001CE568 /* RCTSwitch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSwitch.m; sourceTree = \"<group>\"; };\n\t\t14F362091AABD06A001CE568 /* RCTSwitchManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSwitchManager.h; sourceTree = \"<group>\"; };\n\t\t14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSwitchManager.m; sourceTree = \"<group>\"; };\n\t\t14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSliderManager.h; sourceTree = \"<group>\"; };\n\t\t14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSliderManager.m; sourceTree = \"<group>\"; };\n\t\t14F7A0EB1BDA3B3C003C6C10 /* RCTPerfMonitor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPerfMonitor.m; sourceTree = \"<group>\"; };\n\t\t14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTFPSGraph.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t14F7A0EF1BDA714B003C6C10 /* RCTFPSGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTFPSGraph.m; sourceTree = \"<group>\"; };\n\t\t199B8A6E1F44DB16005DEF67 /* RCTVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTVersion.h; sourceTree = \"<group>\"; };\n\t\t19DED2281E77E29200F089BB /* systemJSCWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = systemJSCWrapper.cpp; sourceTree = \"<group>\"; };\n\t\t27B958731E57587D0096647A /* JSBigString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBigString.cpp; sourceTree = \"<group>\"; };\n\t\t2D2A28131D9B038B00D4039D /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTI18nUtil.h; sourceTree = \"<group>\"; };\n\t\t352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTI18nUtil.m; sourceTree = \"<group>\"; };\n\t\t369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSCSamplingProfiler.h; sourceTree = \"<group>\"; };\n\t\t369123E01DDC75850095B341 /* RCTJSCSamplingProfiler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJSCSamplingProfiler.m; sourceTree = \"<group>\"; };\n\t\t391E86A21C623EC800009732 /* RCTTouchEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTouchEvent.m; sourceTree = \"<group>\"; };\n\t\t391E86A31C623EC800009732 /* RCTTouchEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTouchEvent.h; sourceTree = \"<group>\"; };\n\t\t3D0B84281EC0B49400B2BD8E /* RCTTVRemoteHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTVRemoteHandler.h; sourceTree = \"<group>\"; };\n\t\t3D0B84291EC0B49400B2BD8E /* RCTTVRemoteHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTVRemoteHandler.m; sourceTree = \"<group>\"; };\n\t\t3D0B842D1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTVNavigationEventEmitter.h; sourceTree = \"<group>\"; };\n\t\t3D0B842E1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTVNavigationEventEmitter.m; sourceTree = \"<group>\"; };\n\t\t3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTWebSocketModule.h; path = WebSocket/RCTWebSocketModule.h; sourceTree = \"<group>\"; };\n\t\t3D0E378B1F1CC58C00DCAC9F /* RCTWebSocketObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTWebSocketObserver.h; path = WebSocket/RCTWebSocketObserver.h; sourceTree = \"<group>\"; };\n\t\t3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDisplayLink.h; sourceTree = \"<group>\"; };\n\t\t3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDisplayLink.m; sourceTree = \"<group>\"; };\n\t\t3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworking.h; sourceTree = \"<group>\"; };\n\t\t3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworkTask.h; sourceTree = \"<group>\"; };\n\t\t3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageLoader.h; sourceTree = \"<group>\"; };\n\t\t3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageStoreManager.h; sourceTree = \"<group>\"; };\n\t\t3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTResizeMode.h; sourceTree = \"<group>\"; };\n\t\t3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLinkingManager.h; sourceTree = \"<group>\"; };\n\t\t3D1FA08D1DE4F4EE00E03CC6 /* RCTPushNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTPushNotificationManager.h; path = PushNotificationIOS/RCTPushNotificationManager.h; sourceTree = \"<group>\"; };\n\t\t3D37B5801D522B190042D5B5 /* RCTFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTFont.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t3D37B5811D522B190042D5B5 /* RCTFont.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTFont.mm; sourceTree = \"<group>\"; };\n\t\t3D383D3C1EBD27B6005632C8 /* libthird-party.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libthird-party.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D383D621EBD27B9005632C8 /* libdouble-conversion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libdouble-conversion.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D3C059A1DE3340900C268FA /* libyoga.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libyoga.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D3C06751DE3340C00C268FA /* libyoga.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libyoga.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBundleType.h; sourceTree = \"<group>\"; };\n\t\t3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjschelpers.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D3CD9181DE5FBD800167DC4 /* libjschelpers.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjschelpers.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcxxreact.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D3CD9321DE5FBEE00167DC4 /* libcxxreact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcxxreact.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D7454781E54757500E74ADD /* JSBigString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBigString.h; sourceTree = \"<group>\"; };\n\t\t3D7454791E54757500E74ADD /* RecoverableError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecoverableError.h; sourceTree = \"<group>\"; };\n\t\t3D7454B31E54786200E74ADD /* NSDataBigString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDataBigString.h; sourceTree = \"<group>\"; };\n\t\t3D7749421DC1065C007EC8D8 /* RCTPlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPlatform.h; sourceTree = \"<group>\"; };\n\t\t3D7749431DC1065C007EC8D8 /* RCTPlatform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPlatform.m; sourceTree = \"<group>\"; };\n\t\t3D788F841EBD2D240063D616 /* third-party.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = \"third-party.xcconfig\"; sourceTree = \"<group>\"; };\n\t\t3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptCore.h; sourceTree = \"<group>\"; };\n\t\t3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCWrapper.cpp; sourceTree = \"<group>\"; };\n\t\t3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCWrapper.h; sourceTree = \"<group>\"; };\n\t\t3D7AA9C31E548CD5001955CF /* NSDataBigString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NSDataBigString.mm; sourceTree = \"<group>\"; };\n\t\t3D7BFD0B1EA8E351008DFB7A /* RCTPackagerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPackagerClient.h; sourceTree = \"<group>\"; };\n\t\t3D7BFD0C1EA8E351008DFB7A /* RCTPackagerClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPackagerClient.m; sourceTree = \"<group>\"; };\n\t\t3D7BFD0F1EA8E351008DFB7A /* RCTPackagerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPackagerConnection.h; sourceTree = \"<group>\"; };\n\t\t3D7BFD101EA8E351008DFB7A /* RCTPackagerConnection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTPackagerConnection.mm; sourceTree = \"<group>\"; };\n\t\t3D7BFD2B1EA8E3FA008DFB7A /* RCTReconnectingWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTReconnectingWebSocket.h; path = WebSocket/RCTReconnectingWebSocket.h; sourceTree = \"<group>\"; };\n\t\t3D7BFD2C1EA8E3FA008DFB7A /* RCTSRWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTSRWebSocket.h; path = WebSocket/RCTSRWebSocket.h; sourceTree = \"<group>\"; };\n\t\t3D92B0A71E03699D0018521A /* CxxModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CxxModule.h; sourceTree = \"<group>\"; };\n\t\t3D92B0A81E03699D0018521A /* CxxNativeModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CxxNativeModule.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0A91E03699D0018521A /* CxxNativeModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CxxNativeModule.h; sourceTree = \"<group>\"; };\n\t\t3D92B0AB1E03699D0018521A /* JSExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExecutor.h; sourceTree = \"<group>\"; };\n\t\t3D92B0AE1E03699D0018521A /* Instance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Instance.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0AF1E03699D0018521A /* Instance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Instance.h; sourceTree = \"<group>\"; };\n\t\t3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"JsArgumentHelpers-inl.h\"; sourceTree = \"<group>\"; };\n\t\t3D92B0B11E03699D0018521A /* JsArgumentHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JsArgumentHelpers.h; sourceTree = \"<group>\"; };\n\t\t3D92B0B21E03699D0018521A /* JSCExecutor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCExecutor.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0B31E03699D0018521A /* JSCExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCExecutor.h; sourceTree = \"<group>\"; };\n\t\t3D92B0B61E03699D0018521A /* JSCLegacyTracing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCLegacyTracing.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0B71E03699D0018521A /* JSCLegacyTracing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCLegacyTracing.h; sourceTree = \"<group>\"; };\n\t\t3D92B0B81E03699D0018521A /* JSCMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCMemory.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0B91E03699D0018521A /* JSCMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCMemory.h; sourceTree = \"<group>\"; };\n\t\t3D92B0BA1E03699D0018521A /* JSCNativeModules.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCNativeModules.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0BB1E03699D0018521A /* JSCNativeModules.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCNativeModules.h; sourceTree = \"<group>\"; };\n\t\t3D92B0BC1E03699D0018521A /* JSCPerfStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCPerfStats.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0BD1E03699D0018521A /* JSCPerfStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCPerfStats.h; sourceTree = \"<group>\"; };\n\t\t3D92B0BE1E03699D0018521A /* JSCSamplingProfiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSamplingProfiler.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0BF1E03699D0018521A /* JSCSamplingProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSamplingProfiler.h; sourceTree = \"<group>\"; };\n\t\t3D92B0C21E03699D0018521A /* JSCUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCUtils.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0C31E03699D0018521A /* JSCUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCUtils.h; sourceTree = \"<group>\"; };\n\t\t3D92B0C61E03699D0018521A /* JSIndexedRAMBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIndexedRAMBundle.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0C71E03699D0018521A /* JSIndexedRAMBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIndexedRAMBundle.h; sourceTree = \"<group>\"; };\n\t\t3D92B0C81E03699D0018521A /* JSModulesUnbundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSModulesUnbundle.h; sourceTree = \"<group>\"; };\n\t\t3D92B0C91E03699D0018521A /* MessageQueueThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageQueueThread.h; sourceTree = \"<group>\"; };\n\t\t3D92B0CA1E03699D0018521A /* MethodCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MethodCall.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0CB1E03699D0018521A /* MethodCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MethodCall.h; sourceTree = \"<group>\"; };\n\t\t3D92B0CC1E03699D0018521A /* ModuleRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleRegistry.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0CD1E03699D0018521A /* ModuleRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleRegistry.h; sourceTree = \"<group>\"; };\n\t\t3D92B0CE1E03699D0018521A /* NativeModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeModule.h; sourceTree = \"<group>\"; };\n\t\t3D92B0CF1E03699D0018521A /* NativeToJsBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NativeToJsBridge.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0D01E03699D0018521A /* NativeToJsBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeToJsBridge.h; sourceTree = \"<group>\"; };\n\t\t3D92B0D11E03699D0018521A /* Platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Platform.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0D21E03699D0018521A /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Platform.h; sourceTree = \"<group>\"; };\n\t\t3D92B0D31E03699D0018521A /* SampleCxxModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SampleCxxModule.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B0D41E03699D0018521A /* SampleCxxModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleCxxModule.h; sourceTree = \"<group>\"; };\n\t\t3D92B0D51E03699D0018521A /* SystraceSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystraceSection.h; sourceTree = \"<group>\"; };\n\t\t3D92B1071E0369AD0018521A /* JSCHelpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCHelpers.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B1081E0369AD0018521A /* JSCHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCHelpers.h; sourceTree = \"<group>\"; };\n\t\t3D92B1091E0369AD0018521A /* noncopyable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = noncopyable.h; sourceTree = \"<group>\"; };\n\t\t3D92B10A1E0369AD0018521A /* Unicode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Unicode.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B10B1E0369AD0018521A /* Unicode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Unicode.h; sourceTree = \"<group>\"; };\n\t\t3D92B10C1E0369AD0018521A /* Value.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Value.cpp; sourceTree = \"<group>\"; };\n\t\t3D92B10D1E0369AD0018521A /* Value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Value.h; sourceTree = \"<group>\"; };\n\t\t3DF1BE801F26576400068F1A /* JSCTracing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCTracing.cpp; sourceTree = \"<group>\"; };\n\t\t3DF1BE811F26576400068F1A /* JSCTracing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCTracing.h; sourceTree = \"<group>\"; };\n\t\t3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTErrorCustomizer.h; sourceTree = \"<group>\"; };\n\t\t3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTErrorInfo.h; sourceTree = \"<group>\"; };\n\t\t3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTErrorInfo.m; sourceTree = \"<group>\"; };\n\t\t5376C5E01FC6DDB20083513D /* YGNodePrint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGNodePrint.h; sourceTree = \"<group>\"; };\n\t\t5376C5E11FC6DDB20083513D /* YGNodePrint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGNodePrint.cpp; sourceTree = \"<group>\"; };\n\t\t53CBF1851FB4FE80002CBB31 /* Yoga-internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"Yoga-internal.h\"; sourceTree = \"<group>\"; };\n\t\t53CBF1861FB4FE80002CBB31 /* YGEnums.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGEnums.cpp; sourceTree = \"<group>\"; };\n\t\t53CBF1871FB4FE80002CBB31 /* Yoga.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Yoga.cpp; sourceTree = \"<group>\"; };\n\t\t53D123831FBF1D49001B8A10 /* libyoga.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libyoga.a; path = \"../../../../../../../../../Library/Developer/Xcode/DerivedData/yoga-hdfifpwsinitsibujacpiefkjfdy/Build/Products/Debug/libyoga.a\"; sourceTree = \"<group>\"; };\n\t\t58114A121AAE854800E7D092 /* RCTPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPicker.h; sourceTree = \"<group>\"; };\n\t\t58114A131AAE854800E7D092 /* RCTPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPicker.m; sourceTree = \"<group>\"; };\n\t\t58114A141AAE854800E7D092 /* RCTPickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPickerManager.h; sourceTree = \"<group>\"; };\n\t\t58114A151AAE854800E7D092 /* RCTPickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPickerManager.m; sourceTree = \"<group>\"; };\n\t\t58114A4E1AAE93D500E7D092 /* RCTAsyncLocalStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAsyncLocalStorage.m; sourceTree = \"<group>\"; };\n\t\t58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAsyncLocalStorage.h; sourceTree = \"<group>\"; };\n\t\t58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDatePickerManager.m; sourceTree = \"<group>\"; };\n\t\t58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTDatePickerManager.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t590D7BFB1EBD458B00D8A370 /* RCTShadowView+Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"RCTShadowView+Layout.h\"; sourceTree = \"<group>\"; };\n\t\t590D7BFC1EBD458B00D8A370 /* RCTShadowView+Layout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"RCTShadowView+Layout.m\"; sourceTree = \"<group>\"; };\n\t\t59283C9F1FD67320000EAAB9 /* RCTSurfaceStage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSurfaceStage.m; sourceTree = \"<group>\"; };\n\t\t594F0A2F1FD23228007FBE96 /* RCTSurfaceHostingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceHostingView.h; sourceTree = \"<group>\"; };\n\t\t594F0A301FD23228007FBE96 /* RCTSurfaceHostingView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTSurfaceHostingView.mm; sourceTree = \"<group>\"; };\n\t\t594F0A311FD23228007FBE96 /* RCTSurfaceSizeMeasureMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceSizeMeasureMode.h; sourceTree = \"<group>\"; };\n\t\t59500D411F71C63700B122B7 /* RCTUIManagerUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUIManagerUtils.h; sourceTree = \"<group>\"; };\n\t\t59500D421F71C63F00B122B7 /* RCTUIManagerUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManagerUtils.m; sourceTree = \"<group>\"; };\n\t\t5960C1B11F0804A00066FD5B /* RCTLayoutAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLayoutAnimation.h; sourceTree = \"<group>\"; };\n\t\t5960C1B21F0804A00066FD5B /* RCTLayoutAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLayoutAnimation.m; sourceTree = \"<group>\"; };\n\t\t5960C1B31F0804A00066FD5B /* RCTLayoutAnimationGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLayoutAnimationGroup.h; sourceTree = \"<group>\"; };\n\t\t5960C1B41F0804A00066FD5B /* RCTLayoutAnimationGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLayoutAnimationGroup.m; sourceTree = \"<group>\"; };\n\t\t597633341F4E021D005BE8A4 /* RCTShadowView+Internal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"RCTShadowView+Internal.m\"; sourceTree = \"<group>\"; };\n\t\t597633351F4E021D005BE8A4 /* RCTShadowView+Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"RCTShadowView+Internal.h\"; sourceTree = \"<group>\"; };\n\t\t599FAA2A1FB274970058CCF6 /* RCTSurface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurface.h; sourceTree = \"<group>\"; };\n\t\t599FAA2B1FB274970058CCF6 /* RCTSurface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTSurface.mm; sourceTree = \"<group>\"; };\n\t\t599FAA2C1FB274970058CCF6 /* RCTSurfaceDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceDelegate.h; sourceTree = \"<group>\"; };\n\t\t599FAA2D1FB274970058CCF6 /* RCTSurfaceRootShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceRootShadowView.h; sourceTree = \"<group>\"; };\n\t\t599FAA2E1FB274970058CCF6 /* RCTSurfaceRootShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSurfaceRootShadowView.m; sourceTree = \"<group>\"; };\n\t\t599FAA2F1FB274970058CCF6 /* RCTSurfaceRootShadowViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceRootShadowViewDelegate.h; sourceTree = \"<group>\"; };\n\t\t599FAA301FB274970058CCF6 /* RCTSurfaceRootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceRootView.h; sourceTree = \"<group>\"; };\n\t\t599FAA311FB274970058CCF6 /* RCTSurfaceRootView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTSurfaceRootView.mm; sourceTree = \"<group>\"; };\n\t\t599FAA321FB274970058CCF6 /* RCTSurfaceStage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceStage.h; sourceTree = \"<group>\"; };\n\t\t599FAA331FB274970058CCF6 /* RCTSurfaceView+Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"RCTSurfaceView+Internal.h\"; sourceTree = \"<group>\"; };\n\t\t599FAA341FB274970058CCF6 /* RCTSurfaceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceView.h; sourceTree = \"<group>\"; };\n\t\t599FAA351FB274970058CCF6 /* RCTSurfaceView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTSurfaceView.mm; sourceTree = \"<group>\"; };\n\t\t59A7B9FB1E577DBF0068EDBF /* RCTRootContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootContentView.h; sourceTree = \"<group>\"; };\n\t\t59A7B9FC1E577DBF0068EDBF /* RCTRootContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootContentView.m; sourceTree = \"<group>\"; };\n\t\t59EB6DB91EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUIManagerObserverCoordinator.h; sourceTree = \"<group>\"; };\n\t\t59EB6DBA1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTUIManagerObserverCoordinator.mm; sourceTree = \"<group>\"; };\n\t\t59EDBC9C1FDF4E0C003573DE /* RCTScrollableProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollableProtocol.h; sourceTree = \"<group>\"; };\n\t\t59EDBC9D1FDF4E0C003573DE /* RCTScrollContentShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollContentShadowView.h; sourceTree = \"<group>\"; };\n\t\t59EDBC9E1FDF4E0C003573DE /* RCTScrollContentShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollContentShadowView.m; sourceTree = \"<group>\"; };\n\t\t59EDBC9F1FDF4E0C003573DE /* RCTScrollContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollContentView.h; sourceTree = \"<group>\"; };\n\t\t59EDBCA01FDF4E0C003573DE /* RCTScrollContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollContentView.m; sourceTree = \"<group>\"; };\n\t\t59EDBCA11FDF4E0C003573DE /* RCTScrollContentViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollContentViewManager.h; sourceTree = \"<group>\"; };\n\t\t59EDBCA21FDF4E0C003573DE /* RCTScrollContentViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollContentViewManager.m; sourceTree = \"<group>\"; };\n\t\t59EDBCA31FDF4E0C003573DE /* RCTScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollView.h; sourceTree = \"<group>\"; };\n\t\t59EDBCA41FDF4E0C003573DE /* RCTScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollView.m; sourceTree = \"<group>\"; };\n\t\t59EDBCA51FDF4E0C003573DE /* RCTScrollViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollViewManager.h; sourceTree = \"<group>\"; };\n\t\t59EDBCA61FDF4E0C003573DE /* RCTScrollViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollViewManager.m; sourceTree = \"<group>\"; };\n\t\t657734821EE834C900A0E9EA /* RCTInspectorDevServerHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTInspectorDevServerHelper.h; sourceTree = \"<group>\"; };\n\t\t657734831EE834C900A0E9EA /* RCTInspectorDevServerHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTInspectorDevServerHelper.mm; sourceTree = \"<group>\"; };\n\t\t6577348A1EE8354A00A0E9EA /* RCTInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTInspector.h; path = Inspector/RCTInspector.h; sourceTree = \"<group>\"; };\n\t\t6577348B1EE8354A00A0E9EA /* RCTInspector.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RCTInspector.mm; path = Inspector/RCTInspector.mm; sourceTree = \"<group>\"; };\n\t\t6577348C1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTInspectorPackagerConnection.h; path = Inspector/RCTInspectorPackagerConnection.h; sourceTree = \"<group>\"; };\n\t\t6577348D1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTInspectorPackagerConnection.m; path = Inspector/RCTInspectorPackagerConnection.m; sourceTree = \"<group>\"; };\n\t\t66CD94AD1F1045E700CB3C7C /* RCTMaskedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMaskedView.h; sourceTree = \"<group>\"; };\n\t\t66CD94AE1F1045E700CB3C7C /* RCTMaskedView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMaskedView.m; sourceTree = \"<group>\"; };\n\t\t66CD94AF1F1045E700CB3C7C /* RCTMaskedViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMaskedViewManager.h; sourceTree = \"<group>\"; };\n\t\t66CD94B01F1045E700CB3C7C /* RCTMaskedViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMaskedViewManager.m; sourceTree = \"<group>\"; };\n\t\t68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBundleURLProvider.h; sourceTree = \"<group>\"; };\n\t\t68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBundleURLProvider.m; sourceTree = \"<group>\"; };\n\t\t6A15FB0C1BDF663500531DFB /* RCTRootViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootViewInternal.h; sourceTree = \"<group>\"; };\n\t\t830213F31A654E0800B993E6 /* RCTBridgeModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTBridgeModule.h; sourceTree = \"<group>\"; };\n\t\t830A229C1A66C68A008503DA /* RCTRootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootView.h; sourceTree = \"<group>\"; };\n\t\t830A229D1A66C68A008503DA /* RCTRootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootView.m; sourceTree = \"<group>\"; };\n\t\t83392EB11B6634E10013B15F /* RCTModalHostViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModalHostViewController.h; sourceTree = \"<group>\"; };\n\t\t83392EB21B6634E10013B15F /* RCTModalHostViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModalHostViewController.m; sourceTree = \"<group>\"; };\n\t\t83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModalHostView.h; sourceTree = \"<group>\"; };\n\t\t83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModalHostView.m; sourceTree = \"<group>\"; };\n\t\t83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModalHostViewManager.h; sourceTree = \"<group>\"; };\n\t\t83A1FE8E1B62643A00BE0E65 /* RCTModalHostViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModalHostViewManager.m; sourceTree = \"<group>\"; };\n\t\t83CBBA2E1A601D0E00E9B192 /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAssert.h; sourceTree = \"<group>\"; };\n\t\t83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAssert.m; sourceTree = \"<group>\"; };\n\t\t83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTInvalidating.h; sourceTree = \"<group>\"; };\n\t\t83CBBA4D1A601E3B00E9B192 /* RCTLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLog.h; sourceTree = \"<group>\"; };\n\t\t83CBBA4E1A601E3B00E9B192 /* RCTLog.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTLog.mm; sourceTree = \"<group>\"; };\n\t\t83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUtils.h; sourceTree = \"<group>\"; };\n\t\t83CBBA501A601E3B00E9B192 /* RCTUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUtils.m; sourceTree = \"<group>\"; };\n\t\t83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBridge.h; sourceTree = \"<group>\"; };\n\t\t83CBBA5F1A601EAA00E9B192 /* RCTBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBridge.m; sourceTree = \"<group>\"; };\n\t\t83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTJavaScriptExecutor.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTEventDispatcher.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTEventDispatcher.m; sourceTree = \"<group>\"; };\n\t\t83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTouchHandler.h; sourceTree = \"<group>\"; };\n\t\t83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTouchHandler.m; sourceTree = \"<group>\"; };\n\t\t83CBBACA1A6023D300E9B192 /* RCTConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTConvert.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t83CBBACB1A6023D300E9B192 /* RCTConvert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert.m; sourceTree = \"<group>\"; };\n\t\t83F15A171B7CC46900F10295 /* NSView+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"NSView+Private.h\"; sourceTree = \"<group>\"; };\n\t\t91076A871F743AB00081B4FA /* RCTModalManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTModalManager.m; sourceTree = \"<group>\"; };\n\t\t91076A881F743AB00081B4FA /* RCTModalManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTModalManager.h; sourceTree = \"<group>\"; };\n\t\t9936F3131F5F2E4B0010BF04 /* libprivatedata.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libprivatedata.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t9936F32F1F5F2E5B0010BF04 /* libprivatedata-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libprivatedata-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t9936F3351F5F2F480010BF04 /* PrivateDataBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrivateDataBase.cpp; path = privatedata/PrivateDataBase.cpp; sourceTree = \"<group>\"; };\n\t\t9936F3361F5F2F480010BF04 /* PrivateDataBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PrivateDataBase.h; path = privatedata/PrivateDataBase.h; sourceTree = \"<group>\"; };\n\t\tA2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTReloadCommand.h; sourceTree = \"<group>\"; };\n\t\tA2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTReloadCommand.m; sourceTree = \"<group>\"; };\n\t\tAC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTJavaScriptLoader.mm; sourceTree = \"<group>\"; };\n\t\tAC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBundleType.cpp; sourceTree = \"<group>\"; };\n\t\tAC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"oss-compat-util.h\"; sourceTree = \"<group>\"; };\n\t\tACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBorderStyle.h; sourceTree = \"<group>\"; };\n\t\tB233E6E81D2D843200BC68BA /* RCTI18nManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTI18nManager.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\tB233E6E91D2D845D00BC68BA /* RCTI18nManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTI18nManager.m; sourceTree = \"<group>\"; };\n\t\tB95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTActivityIndicatorView.h; sourceTree = \"<group>\"; };\n\t\tB95154311D1B34B200FE7B80 /* RCTActivityIndicatorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTActivityIndicatorView.m; sourceTree = \"<group>\"; };\n\t\tC60128A91F3D1258009DF9FF /* RCTCxxConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTCxxConvert.h; sourceTree = \"<group>\"; };\n\t\tC60128AA1F3D1258009DF9FF /* RCTCxxConvert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTCxxConvert.m; sourceTree = \"<group>\"; };\n\t\tC606692D1F3CC60500E67165 /* RCTModuleMethod.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTModuleMethod.mm; sourceTree = \"<group>\"; };\n\t\tC60669351F3CCF1B00E67165 /* RCTManagedPointer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTManagedPointer.mm; sourceTree = \"<group>\"; };\n\t\tC654505D1F3BD9280090799B /* RCTManagedPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTManagedPointer.h; sourceTree = \"<group>\"; };\n\t\tC6D380181F71D75B00621378 /* RAMBundleRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAMBundleRegistry.h; sourceTree = \"<group>\"; };\n\t\tC6D380191F71D75B00621378 /* RAMBundleRegistry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RAMBundleRegistry.cpp; sourceTree = \"<group>\"; };\n\t\tCF2731BE1E7B8DE40044CA4F /* RCTDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDeviceInfo.h; sourceTree = \"<group>\"; };\n\t\tCF2731BF1E7B8DE40044CA4F /* RCTDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDeviceInfo.m; sourceTree = \"<group>\"; };\n\t\tD426ACCF20D57642003B4C4D /* RCTAppearance.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTAppearance.h; sourceTree = \"<group>\"; };\n\t\tD426ACD120D57659003B4C4D /* RCTAppearance.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTAppearance.m; sourceTree = \"<group>\"; };\n\t\tD49593D8202C937B00A7694B /* RCTCursorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTCursorManager.h; sourceTree = \"<group>\"; };\n\t\tD49593D9202C937B00A7694B /* RCTCursorManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTCursorManager.m; sourceTree = \"<group>\"; };\n\t\tD49593DA202C937B00A7694B /* RCTMenuManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMenuManager.h; sourceTree = \"<group>\"; };\n\t\tD49593DB202C937C00A7694B /* RCTMenuManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMenuManager.m; sourceTree = \"<group>\"; };\n\t\tD49593E3202C96FF00A7694B /* YGNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGNode.h; sourceTree = \"<group>\"; };\n\t\tD49593E4202C96FF00A7694B /* YGNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGNode.cpp; sourceTree = \"<group>\"; };\n\t\tD4EEE2F1201DF63F00C4CBB6 /* RCTButtonManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTButtonManager.h; sourceTree = \"<group>\"; };\n\t\tD4EEE2F2201DF63F00C4CBB6 /* RCTButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTButton.h; sourceTree = \"<group>\"; };\n\t\tD4EEE2F3201DF63F00C4CBB6 /* RCTButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTButton.m; sourceTree = \"<group>\"; };\n\t\tD4EEE2F4201DF63F00C4CBB6 /* RCTButtonManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTButtonManager.m; sourceTree = \"<group>\"; };\n\t\tD4EEE2F9201DF64800C4CBB6 /* NSView+NSViewAnimationWithBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"NSView+NSViewAnimationWithBlocks.h\"; sourceTree = \"<group>\"; };\n\t\tD4EEE2FA201DF64800C4CBB6 /* NSView+NSViewAnimationWithBlocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"NSView+NSViewAnimationWithBlocks.m\"; sourceTree = \"<group>\"; };\n\t\tD4EEE2FD201F95F900C4CBB6 /* UIImageUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIImageUtils.m; sourceTree = \"<group>\"; };\n\t\tD4EEE2FE201F95F900C4CBB6 /* UIImageUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIImageUtils.h; sourceTree = \"<group>\"; };\n\t\tE3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTTextDecorationLineType.h; sourceTree = \"<group>\"; };\n\t\tEBF21BBA1FC498270052F4D5 /* InspectorInterfaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInterfaces.h; sourceTree = \"<group>\"; };\n\t\tEBF21BBB1FC498270052F4D5 /* InspectorInterfaces.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorInterfaces.cpp; sourceTree = \"<group>\"; };\n\t\tEBF21BDC1FC498900052F4D5 /* libjsinspector.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjsinspector.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tEBF21BFA1FC4989A0052F4D5 /* libjsinspector-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libjsinspector-tvOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t3D3C08881DE342EE00C268FA /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t53D123971FBF1DF5001B8A10 /* libyoga.a in Frameworks */,\n\t\t\t\t3D383D6D1EBD2940005632C8 /* libdouble-conversion.a in Frameworks */,\n\t\t\t\t3D383D6E1EBD2940005632C8 /* libjschelpers.a in Frameworks */,\n\t\t\t\t3D383D6F1EBD2940005632C8 /* libthird-party.a in Frameworks */,\n\t\t\t\t3D3CD9411DE5FC5300167DC4 /* libcxxreact.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3C088B1DE342FE00C268FA /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D1D83CE1F74E2DA00615550 /* libdouble-conversion.a in Frameworks */,\n\t\t\t\t2D1D83CD1F74E2CE00615550 /* libprivatedata-tvOS.a in Frameworks */,\n\t\t\t\t3D383D711EBD2949005632C8 /* libjschelpers.a in Frameworks */,\n\t\t\t\t3D383D721EBD2949005632C8 /* libthird-party.a in Frameworks */,\n\t\t\t\t3D8ED92C1E5B120100D83D20 /* libcxxreact.a in Frameworks */,\n\t\t\t\t3D8ED92D1E5B120100D83D20 /* libyoga.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t1304439E1E3FEA8B00D93A67 /* CxxUtils */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1304439F1E3FEAA900D93A67 /* RCTFollyConvert.h */,\n\t\t\t\t130443A01E3FEAA900D93A67 /* RCTFollyConvert.mm */,\n\t\t\t);\n\t\t\tname = CxxUtils;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t130A77021DF767AF001F9587 /* yoga */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD49593E4202C96FF00A7694B /* YGNode.cpp */,\n\t\t\t\tD49593E3202C96FF00A7694B /* YGNode.h */,\n\t\t\t\t5376C5E11FC6DDB20083513D /* YGNodePrint.cpp */,\n\t\t\t\t5376C5E01FC6DDB20083513D /* YGNodePrint.h */,\n\t\t\t\t53CBF1861FB4FE80002CBB31 /* YGEnums.cpp */,\n\t\t\t\t53CBF1851FB4FE80002CBB31 /* Yoga-internal.h */,\n\t\t\t\t53CBF1871FB4FE80002CBB31 /* Yoga.cpp */,\n\t\t\t\t130A77031DF767AF001F9587 /* YGEnums.h */,\n\t\t\t\t130A77041DF767AF001F9587 /* YGMacros.h */,\n\t\t\t\t130A77081DF767AF001F9587 /* Yoga.h */,\n\t\t\t);\n\t\t\tname = yoga;\n\t\t\tpath = yoga/yoga;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13134C721E296B2A00B9F3CB /* CxxBridge */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134D63C21F1FEC4B008872B5 /* RCTCxxBridgeDelegate.h */,\n\t\t\t\t3D7454B31E54786200E74ADD /* NSDataBigString.h */,\n\t\t\t\t3D7AA9C31E548CD5001955CF /* NSDataBigString.mm */,\n\t\t\t\t13134C741E296B2A00B9F3CB /* RCTCxxBridge.mm */,\n\t\t\t\t135A9BFD1E7B0EE600587AEB /* RCTJSCHelpers.h */,\n\t\t\t\t135A9BFE1E7B0EE600587AEB /* RCTJSCHelpers.mm */,\n\t\t\t\t13134C771E296B2A00B9F3CB /* RCTMessageThread.h */,\n\t\t\t\t13134C781E296B2A00B9F3CB /* RCTMessageThread.mm */,\n\t\t\t\t13134C7B1E296B2A00B9F3CB /* RCTObjcExecutor.h */,\n\t\t\t\t13134C7C1E296B2A00B9F3CB /* RCTObjcExecutor.mm */,\n\t\t\t);\n\t\t\tpath = CxxBridge;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13134C7D1E296B2A00B9F3CB /* CxxModule */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1384E2061E806D4E00545659 /* RCTNativeModule.h */,\n\t\t\t\t1384E2071E806D4E00545659 /* RCTNativeModule.mm */,\n\t\t\t\t13134C7E1E296B2A00B9F3CB /* RCTCxxMethod.h */,\n\t\t\t\t13134C7F1E296B2A00B9F3CB /* RCTCxxMethod.mm */,\n\t\t\t\t13134C801E296B2A00B9F3CB /* RCTCxxModule.h */,\n\t\t\t\t13134C811E296B2A00B9F3CB /* RCTCxxModule.mm */,\n\t\t\t\t13134C821E296B2A00B9F3CB /* RCTCxxUtils.h */,\n\t\t\t\t13134C831E296B2A00B9F3CB /* RCTCxxUtils.mm */,\n\t\t\t);\n\t\t\tpath = CxxModule;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139D7E381E25C55B00323FB7 /* double-conversion */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139D7E391E25C5A300323FB7 /* bignum-dtoa.cc */,\n\t\t\t\t139D7E3A1E25C5A300323FB7 /* bignum-dtoa.h */,\n\t\t\t\t139D7E3B1E25C5A300323FB7 /* bignum.cc */,\n\t\t\t\t139D7E3C1E25C5A300323FB7 /* bignum.h */,\n\t\t\t\t139D7E3D1E25C5A300323FB7 /* cached-powers.cc */,\n\t\t\t\t139D7E3E1E25C5A300323FB7 /* cached-powers.h */,\n\t\t\t\t139D7E3F1E25C5A300323FB7 /* diy-fp.cc */,\n\t\t\t\t139D7E401E25C5A300323FB7 /* diy-fp.h */,\n\t\t\t\t139D7E411E25C5A300323FB7 /* double-conversion.cc */,\n\t\t\t\t139D7E421E25C5A300323FB7 /* double-conversion.h */,\n\t\t\t\t139D7E431E25C5A300323FB7 /* fast-dtoa.cc */,\n\t\t\t\t139D7E441E25C5A300323FB7 /* fast-dtoa.h */,\n\t\t\t\t139D7E451E25C5A300323FB7 /* fixed-dtoa.cc */,\n\t\t\t\t139D7E461E25C5A300323FB7 /* fixed-dtoa.h */,\n\t\t\t\t139D7E471E25C5A300323FB7 /* ieee.h */,\n\t\t\t\t139D7E481E25C5A300323FB7 /* strtod.cc */,\n\t\t\t\t139D7E491E25C5A300323FB7 /* strtod.h */,\n\t\t\t\t139D7E4A1E25C5A300323FB7 /* utils.h */,\n\t\t\t);\n\t\t\tname = \"double-conversion\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139D7ED71E25DB9200323FB7 /* glog */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139D7F101E25DEC900323FB7 /* glog */,\n\t\t\t\t139D7ED81E25DBDC00323FB7 /* config.h */,\n\t\t\t\t139D7F081E25DE3700323FB7 /* demangle.cc */,\n\t\t\t\t139D7ED91E25DBDC00323FB7 /* demangle.h */,\n\t\t\t\t139D7EDA1E25DBDC00323FB7 /* logging.cc */,\n\t\t\t\t139D7EDB1E25DBDC00323FB7 /* raw_logging.cc */,\n\t\t\t\t139D7EDC1E25DBDC00323FB7 /* signalhandler.cc */,\n\t\t\t\t139D7EDD1E25DBDC00323FB7 /* stacktrace.h */,\n\t\t\t\t139D7EDE1E25DBDC00323FB7 /* symbolize.cc */,\n\t\t\t\t139D7EDF1E25DBDC00323FB7 /* symbolize.h */,\n\t\t\t\t139D7EE01E25DBDC00323FB7 /* utilities.cc */,\n\t\t\t\t139D7EE11E25DBDC00323FB7 /* utilities.h */,\n\t\t\t\t139D7EE21E25DBDC00323FB7 /* vlog_is_on.cc */,\n\t\t\t);\n\t\t\tname = glog;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139D7F101E25DEC900323FB7 /* glog */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139D7F111E25DEC900323FB7 /* log_severity.h */,\n\t\t\t\t139D7F121E25DEC900323FB7 /* logging.h */,\n\t\t\t\t139D7F141E25DEC900323FB7 /* raw_logging.h */,\n\t\t\t\t139D7F161E25DEC900323FB7 /* stl_logging.h */,\n\t\t\t\t139D7F181E25DEC900323FB7 /* vlog_is_on.h */,\n\t\t\t);\n\t\t\tname = glog;\n\t\t\tpath = \"glog-0.3.4/src/glog\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139D849B1E2739EC00323FB7 /* folly */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13F887A01E2977D800C3C7A1 /* MallocImpl.cpp */,\n\t\t\t\t13F8879C1E29740700C3C7A1 /* BitsFunctexcept.cpp */,\n\t\t\t\t13F887521E2971C500C3C7A1 /* Demangle.cpp */,\n\t\t\t\t13F887531E2971C500C3C7A1 /* StringBase.cpp */,\n\t\t\t\t13F887541E2971C500C3C7A1 /* Unicode.cpp */,\n\t\t\t\t139D849C1E273B5600323FB7 /* AtomicIntrusiveLinkedList.h */,\n\t\t\t\t139D849D1E273B5600323FB7 /* Bits.cpp */,\n\t\t\t\t139D849E1E273B5600323FB7 /* Bits.h */,\n\t\t\t\t139D849F1E273B5600323FB7 /* Conv.cpp */,\n\t\t\t\t139D84A01E273B5600323FB7 /* Conv.h */,\n\t\t\t\t139D84A11E273B5600323FB7 /* dynamic-inl.h */,\n\t\t\t\t139D84A21E273B5600323FB7 /* dynamic.cpp */,\n\t\t\t\t139D84A31E273B5600323FB7 /* dynamic.h */,\n\t\t\t\t139D84A41E273B5600323FB7 /* Exception.h */,\n\t\t\t\t139D84A71E273B5600323FB7 /* json.cpp */,\n\t\t\t\t139D84A81E273B5600323FB7 /* json.h */,\n\t\t\t\t139D84A91E273B5600323FB7 /* Memory.h */,\n\t\t\t\t139D84AA1E273B5600323FB7 /* MoveWrapper.h */,\n\t\t\t\t139D84AB1E273B5600323FB7 /* Optional.h */,\n\t\t\t\t139D84AC1E273B5600323FB7 /* ScopeGuard.h */,\n\t\t\t);\n\t\t\tname = folly;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13B07FE01A69315300A75B9A /* Modules */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD49593D8202C937B00A7694B /* RCTCursorManager.h */,\n\t\t\t\tD49593D9202C937B00A7694B /* RCTCursorManager.m */,\n\t\t\t\tD49593DA202C937B00A7694B /* RCTMenuManager.h */,\n\t\t\t\tD49593DB202C937C00A7694B /* RCTMenuManager.m */,\n\t\t\t\t13B07FE71A69327A00A75B9A /* RCTAlertManager.h */,\n\t\t\t\t13B07FE81A69327A00A75B9A /* RCTAlertManager.m */,\n\t\t\t\t1372B7081AB030C200659ED6 /* RCTAppState.h */,\n\t\t\t\t1372B7091AB030C200659ED6 /* RCTAppState.m */,\n\t\t\t\t58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */,\n\t\t\t\t58114A4E1AAE93D500E7D092 /* RCTAsyncLocalStorage.m */,\n\t\t\t\t13D033611C1837FE0021DC29 /* RCTClipboard.h */,\n\t\t\t\t13D033621C1837FE0021DC29 /* RCTClipboard.m */,\n\t\t\t\tCF2731BE1E7B8DE40044CA4F /* RCTDeviceInfo.h */,\n\t\t\t\tCF2731BF1E7B8DE40044CA4F /* RCTDeviceInfo.m */,\n\t\t\t\t130E3D861E6A082100ACE484 /* RCTDevSettings.h */,\n\t\t\t\t130E3D871E6A082100ACE484 /* RCTDevSettings.mm */,\n\t\t\t\t13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */,\n\t\t\t\t13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */,\n\t\t\t\t13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */,\n\t\t\t\t13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */,\n\t\t\t\tB233E6E81D2D843200BC68BA /* RCTI18nManager.h */,\n\t\t\t\tB233E6E91D2D845D00BC68BA /* RCTI18nManager.m */,\n\t\t\t\t352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */,\n\t\t\t\t352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */,\n\t\t\t\t369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */,\n\t\t\t\t369123E01DDC75850095B341 /* RCTJSCSamplingProfiler.m */,\n\t\t\t\t5960C1B11F0804A00066FD5B /* RCTLayoutAnimation.h */,\n\t\t\t\t5960C1B21F0804A00066FD5B /* RCTLayoutAnimation.m */,\n\t\t\t\t5960C1B31F0804A00066FD5B /* RCTLayoutAnimationGroup.h */,\n\t\t\t\t5960C1B41F0804A00066FD5B /* RCTLayoutAnimationGroup.m */,\n\t\t\t\t13F17A831B8493E5007D4C75 /* RCTRedBox.h */,\n\t\t\t\t13F17A841B8493E5007D4C75 /* RCTRedBox.m */,\n\t\t\t\t000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */,\n\t\t\t\t000E6CEA1AB0E980000CDF4D /* RCTSourceCode.m */,\n\t\t\t\t13B07FED1A69327A00A75B9A /* RCTTiming.h */,\n\t\t\t\t13B07FEE1A69327A00A75B9A /* RCTTiming.m */,\n\t\t\t\t3D0B842D1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h */,\n\t\t\t\t3D0B842E1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.m */,\n\t\t\t\t13E067481A70F434002CDEE1 /* RCTUIManager.h */,\n\t\t\t\t13E067491A70F434002CDEE1 /* RCTUIManager.m */,\n\t\t\t\t59EB6DB91EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h */,\n\t\t\t\t59EB6DBA1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.mm */,\n\t\t\t\t59500D411F71C63700B122B7 /* RCTUIManagerUtils.h */,\n\t\t\t\t59500D421F71C63F00B122B7 /* RCTUIManagerUtils.m */,\n\t\t\t\tD426ACCF20D57642003B4C4D /* RCTAppearance.h */,\n\t\t\t\tD426ACD120D57659003B4C4D /* RCTAppearance.m */,\n\t\t\t);\n\t\t\tpath = Modules;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13B07FF31A6947C200A75B9A /* Views */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD4EEE2F9201DF64800C4CBB6 /* NSView+NSViewAnimationWithBlocks.h */,\n\t\t\t\tD4EEE2FA201DF64800C4CBB6 /* NSView+NSViewAnimationWithBlocks.m */,\n\t\t\t\tD4EEE2F2201DF63F00C4CBB6 /* RCTButton.h */,\n\t\t\t\tD4EEE2F3201DF63F00C4CBB6 /* RCTButton.m */,\n\t\t\t\tD4EEE2F1201DF63F00C4CBB6 /* RCTButtonManager.h */,\n\t\t\t\tD4EEE2F4201DF63F00C4CBB6 /* RCTButtonManager.m */,\n\t\t\t\tB95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */,\n\t\t\t\tB95154311D1B34B200FE7B80 /* RCTActivityIndicatorView.m */,\n\t\t\t\t13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */,\n\t\t\t\t13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */,\n\t\t\t\t13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */,\n\t\t\t\t13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */,\n\t\t\t\t13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */,\n\t\t\t\t13CC8A811B17642100940AE7 /* RCTBorderDrawing.m */,\n\t\t\t\tACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */,\n\t\t\t\t13C325281AA63B6A0048765F /* RCTComponent.h */,\n\t\t\t\t13AB90BF1B6FA36700713B4F /* RCTComponentData.h */,\n\t\t\t\t13AB90C01B6FA36700713B4F /* RCTComponentData.m */,\n\t\t\t\t13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */,\n\t\t\t\t13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */,\n\t\t\t\t130443C31E401A8C00D93A67 /* RCTConvert+Transform.h */,\n\t\t\t\t130443C41E401A8C00D93A67 /* RCTConvert+Transform.m */,\n\t\t\t\t133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */,\n\t\t\t\t133CAE8D1B8E5CFD00F6AD92 /* RCTDatePicker.m */,\n\t\t\t\t58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */,\n\t\t\t\t58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */,\n\t\t\t\t3D37B5801D522B190042D5B5 /* RCTFont.h */,\n\t\t\t\t3D37B5811D522B190042D5B5 /* RCTFont.mm */,\n\t\t\t\t66CD94AD1F1045E700CB3C7C /* RCTMaskedView.h */,\n\t\t\t\t66CD94AE1F1045E700CB3C7C /* RCTMaskedView.m */,\n\t\t\t\t66CD94AF1F1045E700CB3C7C /* RCTMaskedViewManager.h */,\n\t\t\t\t66CD94B01F1045E700CB3C7C /* RCTMaskedViewManager.m */,\n\t\t\t\t83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */,\n\t\t\t\t83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */,\n\t\t\t\t83392EB11B6634E10013B15F /* RCTModalHostViewController.h */,\n\t\t\t\t83392EB21B6634E10013B15F /* RCTModalHostViewController.m */,\n\t\t\t\t83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */,\n\t\t\t\t83A1FE8E1B62643A00BE0E65 /* RCTModalHostViewManager.m */,\n\t\t\t\t91076A881F743AB00081B4FA /* RCTModalManager.h */,\n\t\t\t\t91076A871F743AB00081B4FA /* RCTModalManager.m */,\n\t\t\t\t58114A121AAE854800E7D092 /* RCTPicker.h */,\n\t\t\t\t58114A131AAE854800E7D092 /* RCTPicker.m */,\n\t\t\t\t58114A141AAE854800E7D092 /* RCTPickerManager.h */,\n\t\t\t\t58114A151AAE854800E7D092 /* RCTPickerManager.m */,\n\t\t\t\t13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */,\n\t\t\t\t13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */,\n\t\t\t\t13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */,\n\t\t\t\t13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */,\n\t\t\t\t13BCE8081C99CB9D00DD7AAD /* RCTRootShadowView.m */,\n\t\t\t\t131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */,\n\t\t\t\t131B6AF11AF1093D00FFC3E0 /* RCTSegmentedControl.m */,\n\t\t\t\t131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */,\n\t\t\t\t131B6AF31AF1093D00FFC3E0 /* RCTSegmentedControlManager.m */,\n\t\t\t\t13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */,\n\t\t\t\t13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */,\n\t\t\t\t597633351F4E021D005BE8A4 /* RCTShadowView+Internal.h */,\n\t\t\t\t597633341F4E021D005BE8A4 /* RCTShadowView+Internal.m */,\n\t\t\t\t590D7BFB1EBD458B00D8A370 /* RCTShadowView+Layout.h */,\n\t\t\t\t590D7BFC1EBD458B00D8A370 /* RCTShadowView+Layout.m */,\n\t\t\t\t13AF20431AE707F8005F5298 /* RCTSlider.h */,\n\t\t\t\t13AF20441AE707F9005F5298 /* RCTSlider.m */,\n\t\t\t\t14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */,\n\t\t\t\t14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */,\n\t\t\t\t14F362071AABD06A001CE568 /* RCTSwitch.h */,\n\t\t\t\t14F362081AABD06A001CE568 /* RCTSwitch.m */,\n\t\t\t\t14F362091AABD06A001CE568 /* RCTSwitchManager.h */,\n\t\t\t\t14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */,\n\t\t\t\tE3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */,\n\t\t\t\t13E0674F1A70F44B002CDEE1 /* RCTView.h */,\n\t\t\t\t13E067501A70F44B002CDEE1 /* RCTView.m */,\n\t\t\t\t13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */,\n\t\t\t\t13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */,\n\t\t\t\t13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */,\n\t\t\t\t13C156011AB1A2840079392D /* RCTWebView.h */,\n\t\t\t\t13C156021AB1A2840079392D /* RCTWebView.m */,\n\t\t\t\t13C156031AB1A2840079392D /* RCTWebViewManager.h */,\n\t\t\t\t13C156041AB1A2840079392D /* RCTWebViewManager.m */,\n\t\t\t\t59D031E41F8353D3008361F0 /* SafeAreaView */,\n\t\t\t\t59EDBC9B1FDF4E0C003573DE /* ScrollView */,\n\t\t\t\t83F15A171B7CC46900F10295 /* NSView+Private.h */,\n\t\t\t\t13E067531A70F44B002CDEE1 /* NSView+React.h */,\n\t\t\t\t13E067541A70F44B002CDEE1 /* NSView+React.m */,\n\t\t\t);\n\t\t\tpath = Views;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1450FF7F1BCFF28A00208362 /* Profiler */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */,\n\t\t\t\t14F7A0EF1BDA714B003C6C10 /* RCTFPSGraph.m */,\n\t\t\t\t14BF71811C04795500C97D0C /* RCTMacros.h */,\n\t\t\t\t14F7A0EB1BDA3B3C003C6C10 /* RCTPerfMonitor.m */,\n\t\t\t\t1450FF801BCFF28A00208362 /* RCTProfile.h */,\n\t\t\t\t1450FF811BCFF28A00208362 /* RCTProfile.m */,\n\t\t\t\t1450FF821BCFF28A00208362 /* RCTProfileTrampoline-arm.S */,\n\t\t\t\t1450FF831BCFF28A00208362 /* RCTProfileTrampoline-arm64.S */,\n\t\t\t\t14BF717F1C04793D00C97D0C /* RCTProfileTrampoline-i386.S */,\n\t\t\t\t1450FF851BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S */,\n\t\t\t);\n\t\t\tpath = Profiler;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D10A3C71DDF3CED004A0F9D /* ReactCommon */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t9936F3341F5F2F360010BF04 /* privatedata */,\n\t\t\t\t130A77021DF767AF001F9587 /* yoga */,\n\t\t\t\tAC70D2EA1DE489FC002E6351 /* cxxreact */,\n\t\t\t\t3D4A621D1DDD3985001F41B4 /* jschelpers */,\n\t\t\t\tEBF21BB91FC497DA0052F4D5 /* jsinspector */,\n\t\t\t);\n\t\t\tname = ReactCommon;\n\t\t\tpath = ../ReactCommon;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D1FA0781DE4F2CD00E03CC6 /* Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D1FA0821DE4F36600E03CC6 /* Image */,\n\t\t\t\t3D1FA0891DE4F4B900E03CC6 /* LinkingIOS */,\n\t\t\t\t3D1FA0791DE4F2D200E03CC6 /* Network */,\n\t\t\t\t3D1FA08A1DE4F4D600E03CC6 /* PushNotificationIOS */,\n\t\t\t\t3D7BFD2A1EA8E3D3008DFB7A /* WebSocket */,\n\t\t\t);\n\t\t\tname = Libraries;\n\t\t\tpath = ../Libraries;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D1FA0791DE4F2D200E03CC6 /* Network */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */,\n\t\t\t\t3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */,\n\t\t\t);\n\t\t\tpath = Network;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D1FA0821DE4F36600E03CC6 /* Image */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */,\n\t\t\t\t3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */,\n\t\t\t\t3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */,\n\t\t\t);\n\t\t\tpath = Image;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D1FA0891DE4F4B900E03CC6 /* LinkingIOS */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */,\n\t\t\t);\n\t\t\tpath = LinkingIOS;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D1FA08A1DE4F4D600E03CC6 /* PushNotificationIOS */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D1FA08D1DE4F4EE00E03CC6 /* RCTPushNotificationManager.h */,\n\t\t\t);\n\t\t\tname = PushNotificationIOS;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D4A621D1DDD3985001F41B4 /* jschelpers */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t19DED2281E77E29200F089BB /* systemJSCWrapper.cpp */,\n\t\t\t\t3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */,\n\t\t\t\t3D92B1071E0369AD0018521A /* JSCHelpers.cpp */,\n\t\t\t\t3D92B1081E0369AD0018521A /* JSCHelpers.h */,\n\t\t\t\t3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */,\n\t\t\t\t3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */,\n\t\t\t\t3D92B1091E0369AD0018521A /* noncopyable.h */,\n\t\t\t\t3D92B10A1E0369AD0018521A /* Unicode.cpp */,\n\t\t\t\t3D92B10B1E0369AD0018521A /* Unicode.h */,\n\t\t\t\t3D92B10C1E0369AD0018521A /* Value.cpp */,\n\t\t\t\t3D92B10D1E0369AD0018521A /* Value.h */,\n\t\t\t);\n\t\t\tpath = jschelpers;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D7BFD0A1EA8E2D1008DFB7A /* DevSupport */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t657734821EE834C900A0E9EA /* RCTInspectorDevServerHelper.h */,\n\t\t\t\t657734831EE834C900A0E9EA /* RCTInspectorDevServerHelper.mm */,\n\t\t\t\t13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */,\n\t\t\t\t13A0C2861B74F71200B29F6F /* RCTDevLoadingView.m */,\n\t\t\t\t13A0C2871B74F71200B29F6F /* RCTDevMenu.h */,\n\t\t\t\t13A0C2881B74F71200B29F6F /* RCTDevMenu.m */,\n\t\t\t\t3D7BFD0B1EA8E351008DFB7A /* RCTPackagerClient.h */,\n\t\t\t\t3D7BFD0C1EA8E351008DFB7A /* RCTPackagerClient.m */,\n\t\t\t\t3D7BFD0F1EA8E351008DFB7A /* RCTPackagerConnection.h */,\n\t\t\t\t3D7BFD101EA8E351008DFB7A /* RCTPackagerConnection.mm */,\n\t\t\t);\n\t\t\tpath = DevSupport;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D7BFD2A1EA8E3D3008DFB7A /* WebSocket */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D0E378B1F1CC58C00DCAC9F /* RCTWebSocketObserver.h */,\n\t\t\t\t3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */,\n\t\t\t\t3D7BFD2B1EA8E3FA008DFB7A /* RCTReconnectingWebSocket.h */,\n\t\t\t\t3D7BFD2C1EA8E3FA008DFB7A /* RCTSRWebSocket.h */,\n\t\t\t);\n\t\t\tname = WebSocket;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D92B1151E036A690018521A /* ThirdParty */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139D849B1E2739EC00323FB7 /* folly */,\n\t\t\t\t139D7ED71E25DB9200323FB7 /* glog */,\n\t\t\t\t139D7E381E25C55B00323FB7 /* double-conversion */,\n\t\t\t);\n\t\t\tname = ThirdParty;\n\t\t\tpath = \"../third-party\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t53D123821FBF1D49001B8A10 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t53D123831FBF1D49001B8A10 /* libyoga.a */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t594F0A2E1FD23228007FBE96 /* SurfaceHostingView */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t594F0A2F1FD23228007FBE96 /* RCTSurfaceHostingView.h */,\n\t\t\t\t594F0A301FD23228007FBE96 /* RCTSurfaceHostingView.mm */,\n\t\t\t\t594F0A311FD23228007FBE96 /* RCTSurfaceSizeMeasureMode.h */,\n\t\t\t);\n\t\t\tpath = SurfaceHostingView;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t599FAA291FB274970058CCF6 /* Surface */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t599FAA2A1FB274970058CCF6 /* RCTSurface.h */,\n\t\t\t\t599FAA2B1FB274970058CCF6 /* RCTSurface.mm */,\n\t\t\t\t599FAA2C1FB274970058CCF6 /* RCTSurfaceDelegate.h */,\n\t\t\t\t599FAA2D1FB274970058CCF6 /* RCTSurfaceRootShadowView.h */,\n\t\t\t\t599FAA2E1FB274970058CCF6 /* RCTSurfaceRootShadowView.m */,\n\t\t\t\t599FAA2F1FB274970058CCF6 /* RCTSurfaceRootShadowViewDelegate.h */,\n\t\t\t\t599FAA301FB274970058CCF6 /* RCTSurfaceRootView.h */,\n\t\t\t\t599FAA311FB274970058CCF6 /* RCTSurfaceRootView.mm */,\n\t\t\t\t599FAA321FB274970058CCF6 /* RCTSurfaceStage.h */,\n\t\t\t\t59283C9F1FD67320000EAAB9 /* RCTSurfaceStage.m */,\n\t\t\t\t599FAA341FB274970058CCF6 /* RCTSurfaceView.h */,\n\t\t\t\t599FAA351FB274970058CCF6 /* RCTSurfaceView.mm */,\n\t\t\t\t599FAA331FB274970058CCF6 /* RCTSurfaceView+Internal.h */,\n\t\t\t\t594F0A2E1FD23228007FBE96 /* SurfaceHostingView */,\n\t\t\t);\n\t\t\tpath = Surface;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t59D031E41F8353D3008361F0 /* SafeAreaView */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tpath = SafeAreaView;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t59EDBC9B1FDF4E0C003573DE /* ScrollView */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t59EDBC9C1FDF4E0C003573DE /* RCTScrollableProtocol.h */,\n\t\t\t\t59EDBC9D1FDF4E0C003573DE /* RCTScrollContentShadowView.h */,\n\t\t\t\t59EDBC9E1FDF4E0C003573DE /* RCTScrollContentShadowView.m */,\n\t\t\t\t59EDBC9F1FDF4E0C003573DE /* RCTScrollContentView.h */,\n\t\t\t\t59EDBCA01FDF4E0C003573DE /* RCTScrollContentView.m */,\n\t\t\t\t59EDBCA11FDF4E0C003573DE /* RCTScrollContentViewManager.h */,\n\t\t\t\t59EDBCA21FDF4E0C003573DE /* RCTScrollContentViewManager.m */,\n\t\t\t\t59EDBCA31FDF4E0C003573DE /* RCTScrollView.h */,\n\t\t\t\t59EDBCA41FDF4E0C003573DE /* RCTScrollView.m */,\n\t\t\t\t59EDBCA51FDF4E0C003573DE /* RCTScrollViewManager.h */,\n\t\t\t\t59EDBCA61FDF4E0C003573DE /* RCTScrollViewManager.m */,\n\t\t\t);\n\t\t\tpath = ScrollView;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t657734881EE8352500A0E9EA /* Inspector */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t6577348A1EE8354A00A0E9EA /* RCTInspector.h */,\n\t\t\t\t6577348B1EE8354A00A0E9EA /* RCTInspector.mm */,\n\t\t\t\t6577348C1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.h */,\n\t\t\t\t6577348D1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.m */,\n\t\t\t);\n\t\t\tname = Inspector;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBB9F61A601CBA00E9B192 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t83CBBA2F1A601D0F00E9B192 /* React */,\n\t\t\t\t3D10A3C71DDF3CED004A0F9D /* ReactCommon */,\n\t\t\t\t3D1FA0781DE4F2CD00E03CC6 /* Libraries */,\n\t\t\t\t3D92B1151E036A690018521A /* ThirdParty */,\n\t\t\t\t83CBBA001A601CBA00E9B192 /* Products */,\n\t\t\t\t53D123821FBF1D49001B8A10 /* Frameworks */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t83CBBA001A601CBA00E9B192 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t83CBBA2E1A601D0E00E9B192 /* libReact.a */,\n\t\t\t\t2D2A28131D9B038B00D4039D /* libReact.a */,\n\t\t\t\t3D3C059A1DE3340900C268FA /* libyoga.a */,\n\t\t\t\t3D3C06751DE3340C00C268FA /* libyoga.a */,\n\t\t\t\t3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */,\n\t\t\t\t3D3CD9181DE5FBD800167DC4 /* libjschelpers.a */,\n\t\t\t\t3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */,\n\t\t\t\t3D3CD9321DE5FBEE00167DC4 /* libcxxreact.a */,\n\t\t\t\t139D7E881E25C6D100323FB7 /* libdouble-conversion.a */,\n\t\t\t\t139D7ECE1E25DB7D00323FB7 /* libthird-party.a */,\n\t\t\t\t3D383D3C1EBD27B6005632C8 /* libthird-party.a */,\n\t\t\t\t3D383D621EBD27B9005632C8 /* libdouble-conversion.a */,\n\t\t\t\t9936F3131F5F2E4B0010BF04 /* libprivatedata.a */,\n\t\t\t\t9936F32F1F5F2E5B0010BF04 /* libprivatedata-tvOS.a */,\n\t\t\t\tEBF21BDC1FC498900052F4D5 /* libjsinspector.a */,\n\t\t\t\tEBF21BFA1FC4989A0052F4D5 /* libjsinspector-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBBA2F1A601D0F00E9B192 /* React */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t83CBBA491A601E3B00E9B192 /* Base */,\n\t\t\t\t13134C721E296B2A00B9F3CB /* CxxBridge */,\n\t\t\t\t13134C7D1E296B2A00B9F3CB /* CxxModule */,\n\t\t\t\t1304439E1E3FEA8B00D93A67 /* CxxUtils */,\n\t\t\t\t3D7BFD0A1EA8E2D1008DFB7A /* DevSupport */,\n\t\t\t\t657734881EE8352500A0E9EA /* Inspector */,\n\t\t\t\t13B07FE01A69315300A75B9A /* Modules */,\n\t\t\t\t1450FF7F1BCFF28A00208362 /* Profiler */,\n\t\t\t\t3D788F841EBD2D240063D616 /* third-party.xcconfig */,\n\t\t\t\t13B07FF31A6947C200A75B9A /* Views */,\n\t\t\t);\n\t\t\tname = React;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBBA491A601E3B00E9B192 /* Base */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD4EEE2FE201F95F900C4CBB6 /* UIImageUtils.h */,\n\t\t\t\tD4EEE2FD201F95F900C4CBB6 /* UIImageUtils.m */,\n\t\t\t\t83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */,\n\t\t\t\t83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */,\n\t\t\t\t83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */,\n\t\t\t\t83CBBA5F1A601EAA00E9B192 /* RCTBridge.m */,\n\t\t\t\t14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */,\n\t\t\t\t1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */,\n\t\t\t\t13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */,\n\t\t\t\t830213F31A654E0800B993E6 /* RCTBridgeModule.h */,\n\t\t\t\t68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */,\n\t\t\t\t68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */,\n\t\t\t\t83CBBACA1A6023D300E9B192 /* RCTConvert.h */,\n\t\t\t\t83CBBACB1A6023D300E9B192 /* RCTConvert.m */,\n\t\t\t\tC60128A91F3D1258009DF9FF /* RCTCxxConvert.h */,\n\t\t\t\tC60128AA1F3D1258009DF9FF /* RCTCxxConvert.m */,\n\t\t\t\t13AF1F851AE6E777005F5298 /* RCTDefines.h */,\n\t\t\t\t3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */,\n\t\t\t\t3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */,\n\t\t\t\t3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */,\n\t\t\t\t3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */,\n\t\t\t\t3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */,\n\t\t\t\t83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */,\n\t\t\t\t83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */,\n\t\t\t\t1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */,\n\t\t\t\t14C2CA751B3AC64F00E6CBB2 /* RCTFrameUpdate.m */,\n\t\t\t\t13BB3D001BECD54500932C10 /* RCTImageSource.h */,\n\t\t\t\t13BB3D011BECD54500932C10 /* RCTImageSource.m */,\n\t\t\t\t83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */,\n\t\t\t\t83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */,\n\t\t\t\t14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */,\n\t\t\t\tAC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */,\n\t\t\t\t135A9BF91E7B0EAE00587AEB /* RCTJSCErrorHandling.h */,\n\t\t\t\t135A9BFA1E7B0EAE00587AEB /* RCTJSCErrorHandling.mm */,\n\t\t\t\t008341F51D1DB34400876D9A /* RCTJSStackFrame.h */,\n\t\t\t\t008341F41D1DB34400876D9A /* RCTJSStackFrame.m */,\n\t\t\t\t13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */,\n\t\t\t\t13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */,\n\t\t\t\t83CBBA4D1A601E3B00E9B192 /* RCTLog.h */,\n\t\t\t\t83CBBA4E1A601E3B00E9B192 /* RCTLog.mm */,\n\t\t\t\tC654505D1F3BD9280090799B /* RCTManagedPointer.h */,\n\t\t\t\tC60669351F3CCF1B00E67165 /* RCTManagedPointer.mm */,\n\t\t\t\t14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */,\n\t\t\t\t14C2CA731B3AC64300E6CBB2 /* RCTModuleData.mm */,\n\t\t\t\t14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */,\n\t\t\t\tC606692D1F3CC60500E67165 /* RCTModuleMethod.mm */,\n\t\t\t\t006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */,\n\t\t\t\t006FC4131D9B20820057AAAD /* RCTMultipartDataTask.m */,\n\t\t\t\t001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */,\n\t\t\t\t001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */,\n\t\t\t\t13A6E20F1C19ABC700845B82 /* RCTNullability.h */,\n\t\t\t\t13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */,\n\t\t\t\t13A6E20D1C19AA0C00845B82 /* RCTParserUtils.m */,\n\t\t\t\t142014181B32094000CC17BA /* RCTPerformanceLogger.h */,\n\t\t\t\t142014171B32094000CC17BA /* RCTPerformanceLogger.m */,\n\t\t\t\t3D7749421DC1065C007EC8D8 /* RCTPlatform.h */,\n\t\t\t\t3D7749431DC1065C007EC8D8 /* RCTPlatform.m */,\n\t\t\t\tA2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */,\n\t\t\t\tA2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */,\n\t\t\t\t59A7B9FB1E577DBF0068EDBF /* RCTRootContentView.h */,\n\t\t\t\t59A7B9FC1E577DBF0068EDBF /* RCTRootContentView.m */,\n\t\t\t\t830A229C1A66C68A008503DA /* RCTRootView.h */,\n\t\t\t\t830A229D1A66C68A008503DA /* RCTRootView.m */,\n\t\t\t\t13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */,\n\t\t\t\t6A15FB0C1BDF663500531DFB /* RCTRootViewInternal.h */,\n\t\t\t\t391E86A31C623EC800009732 /* RCTTouchEvent.h */,\n\t\t\t\t391E86A21C623EC800009732 /* RCTTouchEvent.m */,\n\t\t\t\t83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */,\n\t\t\t\t83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */,\n\t\t\t\t3D0B84281EC0B49400B2BD8E /* RCTTVRemoteHandler.h */,\n\t\t\t\t3D0B84291EC0B49400B2BD8E /* RCTTVRemoteHandler.m */,\n\t\t\t\t1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */,\n\t\t\t\t1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */,\n\t\t\t\t83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */,\n\t\t\t\t83CBBA501A601E3B00E9B192 /* RCTUtils.m */,\n\t\t\t\t199B8A6E1F44DB16005DEF67 /* RCTVersion.h */,\n\t\t\t\t599FAA291FB274970058CCF6 /* Surface */,\n\t\t\t);\n\t\t\tpath = Base;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t9936F3341F5F2F360010BF04 /* privatedata */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t9936F3351F5F2F480010BF04 /* PrivateDataBase.cpp */,\n\t\t\t\t9936F3361F5F2F480010BF04 /* PrivateDataBase.h */,\n\t\t\t);\n\t\t\tname = privatedata;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tAC70D2EA1DE489FC002E6351 /* cxxreact */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D92B0A71E03699D0018521A /* CxxModule.h */,\n\t\t\t\t3D92B0A81E03699D0018521A /* CxxNativeModule.cpp */,\n\t\t\t\t3D92B0A91E03699D0018521A /* CxxNativeModule.h */,\n\t\t\t\t3D92B0AE1E03699D0018521A /* Instance.cpp */,\n\t\t\t\t3D92B0AF1E03699D0018521A /* Instance.h */,\n\t\t\t\t3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */,\n\t\t\t\t3D92B0B11E03699D0018521A /* JsArgumentHelpers.h */,\n\t\t\t\t27B958731E57587D0096647A /* JSBigString.cpp */,\n\t\t\t\t3D7454781E54757500E74ADD /* JSBigString.h */,\n\t\t\t\tAC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */,\n\t\t\t\t3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */,\n\t\t\t\t3D92B0B21E03699D0018521A /* JSCExecutor.cpp */,\n\t\t\t\t3D92B0B31E03699D0018521A /* JSCExecutor.h */,\n\t\t\t\t3D92B0B61E03699D0018521A /* JSCLegacyTracing.cpp */,\n\t\t\t\t3D92B0B71E03699D0018521A /* JSCLegacyTracing.h */,\n\t\t\t\t3D92B0B81E03699D0018521A /* JSCMemory.cpp */,\n\t\t\t\t3D92B0B91E03699D0018521A /* JSCMemory.h */,\n\t\t\t\t3D92B0BA1E03699D0018521A /* JSCNativeModules.cpp */,\n\t\t\t\t3D92B0BB1E03699D0018521A /* JSCNativeModules.h */,\n\t\t\t\t3D92B0BC1E03699D0018521A /* JSCPerfStats.cpp */,\n\t\t\t\t3D92B0BD1E03699D0018521A /* JSCPerfStats.h */,\n\t\t\t\t3D92B0BE1E03699D0018521A /* JSCSamplingProfiler.cpp */,\n\t\t\t\t3D92B0BF1E03699D0018521A /* JSCSamplingProfiler.h */,\n\t\t\t\t3DF1BE801F26576400068F1A /* JSCTracing.cpp */,\n\t\t\t\t3DF1BE811F26576400068F1A /* JSCTracing.h */,\n\t\t\t\t3D92B0C21E03699D0018521A /* JSCUtils.cpp */,\n\t\t\t\t3D92B0C31E03699D0018521A /* JSCUtils.h */,\n\t\t\t\t3D92B0AB1E03699D0018521A /* JSExecutor.h */,\n\t\t\t\t3D92B0C61E03699D0018521A /* JSIndexedRAMBundle.cpp */,\n\t\t\t\t3D92B0C71E03699D0018521A /* JSIndexedRAMBundle.h */,\n\t\t\t\t3D92B0C81E03699D0018521A /* JSModulesUnbundle.h */,\n\t\t\t\t3D92B0C91E03699D0018521A /* MessageQueueThread.h */,\n\t\t\t\t3D92B0CA1E03699D0018521A /* MethodCall.cpp */,\n\t\t\t\t3D92B0CB1E03699D0018521A /* MethodCall.h */,\n\t\t\t\t3D92B0CC1E03699D0018521A /* ModuleRegistry.cpp */,\n\t\t\t\t3D92B0CD1E03699D0018521A /* ModuleRegistry.h */,\n\t\t\t\t3D92B0CE1E03699D0018521A /* NativeModule.h */,\n\t\t\t\t3D92B0CF1E03699D0018521A /* NativeToJsBridge.cpp */,\n\t\t\t\t3D92B0D01E03699D0018521A /* NativeToJsBridge.h */,\n\t\t\t\tAC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */,\n\t\t\t\t3D92B0D11E03699D0018521A /* Platform.cpp */,\n\t\t\t\t3D92B0D21E03699D0018521A /* Platform.h */,\n\t\t\t\tC6D380191F71D75B00621378 /* RAMBundleRegistry.cpp */,\n\t\t\t\tC6D380181F71D75B00621378 /* RAMBundleRegistry.h */,\n\t\t\t\t3D7454791E54757500E74ADD /* RecoverableError.h */,\n\t\t\t\t3D92B0D31E03699D0018521A /* SampleCxxModule.cpp */,\n\t\t\t\t3D92B0D41E03699D0018521A /* SampleCxxModule.h */,\n\t\t\t\t3D92B0D51E03699D0018521A /* SystraceSection.h */,\n\t\t\t);\n\t\t\tpath = cxxreact;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tEBF21BB91FC497DA0052F4D5 /* jsinspector */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tEBF21BBB1FC498270052F4D5 /* InspectorInterfaces.cpp */,\n\t\t\t\tEBF21BBA1FC498270052F4D5 /* InspectorInterfaces.h */,\n\t\t\t);\n\t\t\tpath = jsinspector;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t139D7EA41E25C7BD00323FB7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t139D7EA51E25C85300323FB7 /* bignum-dtoa.h in Headers */,\n\t\t\t\t139D7EA61E25C85300323FB7 /* bignum.h in Headers */,\n\t\t\t\t139D7EA71E25C85300323FB7 /* cached-powers.h in Headers */,\n\t\t\t\t139D7EA81E25C85300323FB7 /* diy-fp.h in Headers */,\n\t\t\t\t139D7EA91E25C85300323FB7 /* double-conversion.h in Headers */,\n\t\t\t\t139D7EAA1E25C85300323FB7 /* fast-dtoa.h in Headers */,\n\t\t\t\t139D7EAB1E25C85300323FB7 /* fixed-dtoa.h in Headers */,\n\t\t\t\t139D7EAC1E25C85300323FB7 /* ieee.h in Headers */,\n\t\t\t\t139D7EAD1E25C85300323FB7 /* strtod.h in Headers */,\n\t\t\t\t139D7EAE1E25C85300323FB7 /* utils.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D302F231DF828D100D6DDAE /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DA982391E5B0F8A004F2374 /* NSView+Private.h in Headers */,\n\t\t\t\t13134C8D1E296B2A00B9F3CB /* RCTMessageThread.h in Headers */,\n\t\t\t\t598FD1941F8172A9006C54CB /* PrivateDataBase.h in Headers */,\n\t\t\t\t3D7AA9C51E548CDB001955CF /* NSDataBigString.h in Headers */,\n\t\t\t\t5960C1BA1F0804A00066FD5B /* RCTLayoutAnimationGroup.h in Headers */,\n\t\t\t\t13134C991E296B2A00B9F3CB /* RCTCxxMethod.h in Headers */,\n\t\t\t\t3D0E378D1F1CC58F00DCAC9F /* RCTWebSocketObserver.h in Headers */,\n\t\t\t\t3D302F471DF828F800D6DDAE /* RCTPlatform.h in Headers */,\n\t\t\t\t13134C951E296B2A00B9F3CB /* RCTObjcExecutor.h in Headers */,\n\t\t\t\t590D7BFE1EBD458B00D8A370 /* RCTShadowView+Layout.h in Headers */,\n\t\t\t\t13134C9D1E296B2A00B9F3CB /* RCTCxxModule.h in Headers */,\n\t\t\t\t66CD94B61F1045E700CB3C7C /* RCTMaskedViewManager.h in Headers */,\n\t\t\t\t130443A31E3FEAAE00D93A67 /* RCTFollyConvert.h in Headers */,\n\t\t\t\t3D7BFD1E1EA8E351008DFB7A /* RCTPackagerConnection.h in Headers */,\n\t\t\t\t3D302F241DF828F800D6DDAE /* RCTImageLoader.h in Headers */,\n\t\t\t\t3D302F251DF828F800D6DDAE /* RCTImageStoreManager.h in Headers */,\n\t\t\t\tC60128AC1F3D1258009DF9FF /* RCTCxxConvert.h in Headers */,\n\t\t\t\t3D302F261DF828F800D6DDAE /* RCTResizeMode.h in Headers */,\n\t\t\t\t3D302F271DF828F800D6DDAE /* RCTLinkingManager.h in Headers */,\n\t\t\t\t3D7BFD161EA8E351008DFB7A /* RCTPackagerClient.h in Headers */,\n\t\t\t\t3D302F281DF828F800D6DDAE /* RCTNetworking.h in Headers */,\n\t\t\t\t3D302F291DF828F800D6DDAE /* RCTNetworkTask.h in Headers */,\n\t\t\t\t3D7BFD2E1EA8E3FA008DFB7A /* RCTReconnectingWebSocket.h in Headers */,\n\t\t\t\t3D302F2A1DF828F800D6DDAE /* RCTPushNotificationManager.h in Headers */,\n\t\t\t\t3D302F2B1DF828F800D6DDAE /* RCTAssert.h in Headers */,\n\t\t\t\t3D302F2C1DF828F800D6DDAE /* RCTBridge.h in Headers */,\n\t\t\t\t3D302F2D1DF828F800D6DDAE /* RCTBridge+Private.h in Headers */,\n\t\t\t\t3D302F2E1DF828F800D6DDAE /* RCTBridgeDelegate.h in Headers */,\n\t\t\t\t3D302F2F1DF828F800D6DDAE /* RCTBridgeMethod.h in Headers */,\n\t\t\t\t130E3D8A1E6A083600ACE484 /* RCTDevSettings.h in Headers */,\n\t\t\t\t3D0E378E1F1CC59100DCAC9F /* RCTWebSocketModule.h in Headers */,\n\t\t\t\t3D302F301DF828F800D6DDAE /* RCTBridgeModule.h in Headers */,\n\t\t\t\t3D302F311DF828F800D6DDAE /* RCTBundleURLProvider.h in Headers */,\n\t\t\t\t3D302F321DF828F800D6DDAE /* RCTConvert.h in Headers */,\n\t\t\t\t3D302F331DF828F800D6DDAE /* RCTDefines.h in Headers */,\n\t\t\t\t3D0B842F1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h in Headers */,\n\t\t\t\t3D302F341DF828F800D6DDAE /* RCTDisplayLink.h in Headers */,\n\t\t\t\t3D302F351DF828F800D6DDAE /* RCTErrorCustomizer.h in Headers */,\n\t\t\t\t3D302F361DF828F800D6DDAE /* RCTErrorInfo.h in Headers */,\n\t\t\t\t3D302F371DF828F800D6DDAE /* RCTEventDispatcher.h in Headers */,\n\t\t\t\t59EDBCAA1FDF4E0C003573DE /* RCTScrollContentShadowView.h in Headers */,\n\t\t\t\t594F0A371FD23228007FBE96 /* RCTSurfaceSizeMeasureMode.h in Headers */,\n\t\t\t\t3D302F381DF828F800D6DDAE /* RCTFrameUpdate.h in Headers */,\n\t\t\t\t3D302F391DF828F800D6DDAE /* RCTImageSource.h in Headers */,\n\t\t\t\t597633391F4E021D005BE8A4 /* RCTShadowView+Internal.h in Headers */,\n\t\t\t\t3D302F3A1DF828F800D6DDAE /* RCTInvalidating.h in Headers */,\n\t\t\t\t3D302F3B1DF828F800D6DDAE /* RCTJavaScriptExecutor.h in Headers */,\n\t\t\t\t3D302F3C1DF828F800D6DDAE /* RCTJavaScriptLoader.h in Headers */,\n\t\t\t\t3D302F3D1DF828F800D6DDAE /* RCTJSStackFrame.h in Headers */,\n\t\t\t\t599FAA491FB274980058CCF6 /* RCTSurfaceView+Internal.h in Headers */,\n\t\t\t\t59EDBCB61FDF4E0C003573DE /* RCTScrollView.h in Headers */,\n\t\t\t\t3D302F3E1DF828F800D6DDAE /* RCTKeyCommands.h in Headers */,\n\t\t\t\t135A9C031E7B0F6100587AEB /* RCTJSCErrorHandling.h in Headers */,\n\t\t\t\t599FAA411FB274980058CCF6 /* RCTSurfaceRootShadowViewDelegate.h in Headers */,\n\t\t\t\t3D302F3F1DF828F800D6DDAE /* RCTLog.h in Headers */,\n\t\t\t\t599FAA431FB274980058CCF6 /* RCTSurfaceRootView.h in Headers */,\n\t\t\t\t3D302F401DF828F800D6DDAE /* RCTModuleData.h in Headers */,\n\t\t\t\t5960C1B61F0804A00066FD5B /* RCTLayoutAnimation.h in Headers */,\n\t\t\t\t3D302F411DF828F800D6DDAE /* RCTModuleMethod.h in Headers */,\n\t\t\t\t3D302F421DF828F800D6DDAE /* RCTMultipartDataTask.h in Headers */,\n\t\t\t\t3D302F431DF828F800D6DDAE /* RCTMultipartStreamReader.h in Headers */,\n\t\t\t\t199B8A761F44DEDA005DEF67 /* RCTVersion.h in Headers */,\n\t\t\t\t3D302F441DF828F800D6DDAE /* RCTNullability.h in Headers */,\n\t\t\t\t3D302F451DF828F800D6DDAE /* RCTParserUtils.h in Headers */,\n\t\t\t\t3D302F461DF828F800D6DDAE /* RCTPerformanceLogger.h in Headers */,\n\t\t\t\t3D302F481DF828F800D6DDAE /* RCTRootView.h in Headers */,\n\t\t\t\t3D302F491DF828F800D6DDAE /* RCTRootViewDelegate.h in Headers */,\n\t\t\t\t3D302F4A1DF828F800D6DDAE /* RCTRootViewInternal.h in Headers */,\n\t\t\t\t59EDBCB21FDF4E0C003573DE /* RCTScrollContentViewManager.h in Headers */,\n\t\t\t\t3D302F4B1DF828F800D6DDAE /* RCTTouchEvent.h in Headers */,\n\t\t\t\t3D302F4C1DF828F800D6DDAE /* RCTTouchHandler.h in Headers */,\n\t\t\t\t3D302F4D1DF828F800D6DDAE /* RCTURLRequestDelegate.h in Headers */,\n\t\t\t\t3D302F4E1DF828F800D6DDAE /* RCTURLRequestHandler.h in Headers */,\n\t\t\t\t59500D441F71C63F00B122B7 /* RCTUIManagerUtils.h in Headers */,\n\t\t\t\t3D302F4F1DF828F800D6DDAE /* RCTUtils.h in Headers */,\n\t\t\t\t3D302F541DF828F800D6DDAE /* RCTJSCSamplingProfiler.h in Headers */,\n\t\t\t\t3D302F561DF828F800D6DDAE /* RCTAlertManager.h in Headers */,\n\t\t\t\t3D302F571DF828F800D6DDAE /* RCTAppState.h in Headers */,\n\t\t\t\t3D302F581DF828F800D6DDAE /* RCTAsyncLocalStorage.h in Headers */,\n\t\t\t\t3D302F591DF828F800D6DDAE /* RCTClipboard.h in Headers */,\n\t\t\t\t3D302F5A1DF828F800D6DDAE /* RCTDevLoadingView.h in Headers */,\n\t\t\t\t59EDBCBA1FDF4E0C003573DE /* RCTScrollViewManager.h in Headers */,\n\t\t\t\t3D0B842A1EC0B49400B2BD8E /* RCTTVRemoteHandler.h in Headers */,\n\t\t\t\t3D302F5B1DF828F800D6DDAE /* RCTDevMenu.h in Headers */,\n\t\t\t\t657734921EE8356100A0E9EA /* RCTInspector.h in Headers */,\n\t\t\t\t3D302F5C1DF828F800D6DDAE /* RCTEventEmitter.h in Headers */,\n\t\t\t\t3D302F5D1DF828F800D6DDAE /* RCTExceptionsManager.h in Headers */,\n\t\t\t\t599FAA4B1FB274980058CCF6 /* RCTSurfaceView.h in Headers */,\n\t\t\t\t599FAA3D1FB274980058CCF6 /* RCTSurfaceRootShadowView.h in Headers */,\n\t\t\t\t3D302F5E1DF828F800D6DDAE /* RCTI18nManager.h in Headers */,\n\t\t\t\t3D302F5F1DF828F800D6DDAE /* RCTI18nUtil.h in Headers */,\n\t\t\t\t3D302F611DF828F800D6DDAE /* RCTRedBox.h in Headers */,\n\t\t\t\t3D302F621DF828F800D6DDAE /* RCTSourceCode.h in Headers */,\n\t\t\t\t3D302F641DF828F800D6DDAE /* RCTTiming.h in Headers */,\n\t\t\t\t3D302F651DF828F800D6DDAE /* RCTUIManager.h in Headers */,\n\t\t\t\t599FAA3B1FB274980058CCF6 /* RCTSurfaceDelegate.h in Headers */,\n\t\t\t\t3D302F661DF828F800D6DDAE /* RCTFPSGraph.h in Headers */,\n\t\t\t\t3D302F681DF828F800D6DDAE /* RCTMacros.h in Headers */,\n\t\t\t\t3D302F691DF828F800D6DDAE /* RCTProfile.h in Headers */,\n\t\t\t\t3DF1BE841F26577000068F1A /* JSCTracing.h in Headers */,\n\t\t\t\t3D302F6A1DF828F800D6DDAE /* RCTActivityIndicatorView.h in Headers */,\n\t\t\t\t3D302F6B1DF828F800D6DDAE /* RCTActivityIndicatorViewManager.h in Headers */,\n\t\t\t\t3D7BFD301EA8E3FA008DFB7A /* RCTSRWebSocket.h in Headers */,\n\t\t\t\t59EDBCA81FDF4E0C003573DE /* RCTScrollableProtocol.h in Headers */,\n\t\t\t\t3D302F6C1DF828F800D6DDAE /* RCTAnimationType.h in Headers */,\n\t\t\t\t598FD1951F817335006C54CB /* RCTModalManager.h in Headers */,\n\t\t\t\t657734871EE834E000A0E9EA /* RCTInspectorDevServerHelper.h in Headers */,\n\t\t\t\t3D302F6D1DF828F800D6DDAE /* RCTAutoInsetsProtocol.h in Headers */,\n\t\t\t\t3D302F6E1DF828F800D6DDAE /* RCTBorderDrawing.h in Headers */,\n\t\t\t\t3D302F6F1DF828F800D6DDAE /* RCTBorderStyle.h in Headers */,\n\t\t\t\t3D302F701DF828F800D6DDAE /* RCTComponent.h in Headers */,\n\t\t\t\t3D302F711DF828F800D6DDAE /* RCTComponentData.h in Headers */,\n\t\t\t\t3D302F721DF828F800D6DDAE /* RCTConvert+CoreLocation.h in Headers */,\n\t\t\t\t3D302F761DF828F800D6DDAE /* RCTFont.h in Headers */,\n\t\t\t\t3D302F7B1DF828F800D6DDAE /* RCTModalHostView.h in Headers */,\n\t\t\t\t1384E20A1E806D5700545659 /* RCTNativeModule.h in Headers */,\n\t\t\t\t3D302F7C1DF828F800D6DDAE /* RCTModalHostViewController.h in Headers */,\n\t\t\t\t3D302F7D1DF828F800D6DDAE /* RCTModalHostViewManager.h in Headers */,\n\t\t\t\t594F0A331FD23228007FBE96 /* RCTSurfaceHostingView.h in Headers */,\n\t\t\t\t130443DD1E401AF500D93A67 /* RCTConvert+Transform.h in Headers */,\n\t\t\t\t134D63C41F1FEC65008872B5 /* RCTCxxBridgeDelegate.h in Headers */,\n\t\t\t\t135A9C061E7B0F7800587AEB /* RCTJSCHelpers.h in Headers */,\n\t\t\t\t3D302F841DF828F800D6DDAE /* RCTPointerEvents.h in Headers */,\n\t\t\t\t59EB6DBC1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h in Headers */,\n\t\t\t\t657734941EE8356100A0E9EA /* RCTInspectorPackagerConnection.h in Headers */,\n\t\t\t\t3D302F851DF828F800D6DDAE /* RCTProgressViewManager.h in Headers */,\n\t\t\t\tEBF21BBE1FC498630052F4D5 /* InspectorInterfaces.h in Headers */,\n\t\t\t\tC654505F1F3BD9280090799B /* RCTManagedPointer.h in Headers */,\n\t\t\t\tA2440AA41DF8D865006E7BFC /* RCTReloadCommand.h in Headers */,\n\t\t\t\t3D302F881DF828F800D6DDAE /* RCTRootShadowView.h in Headers */,\n\t\t\t\tCF2731C21E7B8DEF0044CA4F /* RCTDeviceInfo.h in Headers */,\n\t\t\t\t599FAA371FB274980058CCF6 /* RCTSurface.h in Headers */,\n\t\t\t\t3D302F8C1DF828F800D6DDAE /* RCTSegmentedControl.h in Headers */,\n\t\t\t\t66CD94B21F1045E700CB3C7C /* RCTMaskedView.h in Headers */,\n\t\t\t\t3D302F8D1DF828F800D6DDAE /* RCTSegmentedControlManager.h in Headers */,\n\t\t\t\t3D302F8E1DF828F800D6DDAE /* RCTShadowView.h in Headers */,\n\t\t\t\t3D302F8F1DF828F800D6DDAE /* RCTSlider.h in Headers */,\n\t\t\t\t3D302F901DF828F800D6DDAE /* RCTSliderManager.h in Headers */,\n\t\t\t\t3D302F911DF828F800D6DDAE /* RCTSwitch.h in Headers */,\n\t\t\t\t3D302F921DF828F800D6DDAE /* RCTSwitchManager.h in Headers */,\n\t\t\t\t59EDBCAE1FDF4E0C003573DE /* RCTScrollContentView.h in Headers */,\n\t\t\t\t3D302F971DF828F800D6DDAE /* RCTTextDecorationLineType.h in Headers */,\n\t\t\t\t3D302F981DF828F800D6DDAE /* RCTView.h in Headers */,\n\t\t\t\t3D302F991DF828F800D6DDAE /* RCTViewControllerProtocol.h in Headers */,\n\t\t\t\t3D302F9A1DF828F800D6DDAE /* RCTViewManager.h in Headers */,\n\t\t\t\t3D302F9F1DF828F800D6DDAE /* NSView+React.h in Headers */,\n\t\t\t\t599FAA471FB274980058CCF6 /* RCTSurfaceStage.h in Headers */,\n\t\t\t\t13134CA11E296B2A00B9F3CB /* RCTCxxUtils.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D30301C1DF8292200D6DDAE /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t53D1239F1FBF1EFB001B8A10 /* Yoga-internal.h in Headers */,\n\t\t\t\t3DFE0D161DF8574D00459392 /* YGEnums.h in Headers */,\n\t\t\t\t3DFE0D171DF8574D00459392 /* YGMacros.h in Headers */,\n\t\t\t\t5376C5E71FC6DDC20083513D /* YGNodePrint.h in Headers */,\n\t\t\t\t3DFE0D191DF8574D00459392 /* Yoga.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3030211DF8294400D6DDAE /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D74547E1E54759A00E74ADD /* JSModulesUnbundle.h in Headers */,\n\t\t\t\tC6D3801B1F71D76200621378 /* RAMBundleRegistry.h in Headers */,\n\t\t\t\t27595AD51E575C7800CCE2B1 /* NativeToJsBridge.h in Headers */,\n\t\t\t\t27595AC41E575C7800CCE2B1 /* Instance.h in Headers */,\n\t\t\t\t27595AD11E575C7800CCE2B1 /* MessageQueueThread.h in Headers */,\n\t\t\t\t27595ACE1E575C7800CCE2B1 /* JSCUtils.h in Headers */,\n\t\t\t\t3D7454811E5475AF00E74ADD /* RecoverableError.h in Headers */,\n\t\t\t\t27595AC51E575C7800CCE2B1 /* JsArgumentHelpers-inl.h in Headers */,\n\t\t\t\t27595AC91E575C7800CCE2B1 /* JSCLegacyTracing.h in Headers */,\n\t\t\t\t27595AD61E575C7800CCE2B1 /* Platform.h in Headers */,\n\t\t\t\t27595AD81E575C7800CCE2B1 /* SystraceSection.h in Headers */,\n\t\t\t\t27595AC61E575C7800CCE2B1 /* JsArgumentHelpers.h in Headers */,\n\t\t\t\t27595AD71E575C7800CCE2B1 /* SampleCxxModule.h in Headers */,\n\t\t\t\t27595AD21E575C7800CCE2B1 /* MethodCall.h in Headers */,\n\t\t\t\t3D3030221DF8294C00D6DDAE /* JSBundleType.h in Headers */,\n\t\t\t\t27595ACA1E575C7800CCE2B1 /* JSCMemory.h in Headers */,\n\t\t\t\t3D74547D1E54758900E74ADD /* JSBigString.h in Headers */,\n\t\t\t\t27595AC71E575C7800CCE2B1 /* JSCExecutor.h in Headers */,\n\t\t\t\t27595ACD1E575C7800CCE2B1 /* JSCSamplingProfiler.h in Headers */,\n\t\t\t\t27595ABF1E575C7800CCE2B1 /* CxxModule.h in Headers */,\n\t\t\t\t27595AD41E575C7800CCE2B1 /* NativeModule.h in Headers */,\n\t\t\t\t27595ACB1E575C7800CCE2B1 /* JSCNativeModules.h in Headers */,\n\t\t\t\t3D3030231DF8294C00D6DDAE /* oss-compat-util.h in Headers */,\n\t\t\t\t27595AC01E575C7800CCE2B1 /* CxxNativeModule.h in Headers */,\n\t\t\t\t27595AD01E575C7800CCE2B1 /* JSIndexedRAMBundle.h in Headers */,\n\t\t\t\t27595AD31E575C7800CCE2B1 /* ModuleRegistry.h in Headers */,\n\t\t\t\t27595ACC1E575C7800CCE2B1 /* JSCPerfStats.h in Headers */,\n\t\t\t\t27595AC11E575C7800CCE2B1 /* JSExecutor.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3030241DF8295800D6DDAE /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t19F61C041E8495FF00571D81 /* JSCHelpers.h in Headers */,\n\t\t\t\t19F61C051E8495FF00571D81 /* noncopyable.h in Headers */,\n\t\t\t\t19F61C061E8495FF00571D81 /* Unicode.h in Headers */,\n\t\t\t\t19F61C071E8495FF00571D81 /* Value.h in Headers */,\n\t\t\t\t3D3030251DF8295E00D6DDAE /* JavaScriptCore.h in Headers */,\n\t\t\t\t3D3030261DF8295E00D6DDAE /* JSCWrapper.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D383D541EBD27B9005632C8 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D383D551EBD27B9005632C8 /* bignum-dtoa.h in Headers */,\n\t\t\t\t3D383D561EBD27B9005632C8 /* bignum.h in Headers */,\n\t\t\t\t3D383D571EBD27B9005632C8 /* cached-powers.h in Headers */,\n\t\t\t\t3D383D581EBD27B9005632C8 /* diy-fp.h in Headers */,\n\t\t\t\t3D383D591EBD27B9005632C8 /* double-conversion.h in Headers */,\n\t\t\t\t3D383D5A1EBD27B9005632C8 /* fast-dtoa.h in Headers */,\n\t\t\t\t3D383D5B1EBD27B9005632C8 /* fixed-dtoa.h in Headers */,\n\t\t\t\t3D383D5C1EBD27B9005632C8 /* ieee.h in Headers */,\n\t\t\t\t3D383D5D1EBD27B9005632C8 /* strtod.h in Headers */,\n\t\t\t\t3D383D5E1EBD27B9005632C8 /* utils.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3C04BB1DE3340900C268FA /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tD49593E7202C970600A7694B /* YGNode.h in Headers */,\n\t\t\t\t53D1239E1FBF1EFB001B8A10 /* Yoga-internal.h in Headers */,\n\t\t\t\t133957881DF76D3500EC27BE /* YGEnums.h in Headers */,\n\t\t\t\t1339578B1DF76D3500EC27BE /* Yoga.h in Headers */,\n\t\t\t\t5376C5E61FC6DDC10083513D /* YGNodePrint.h in Headers */,\n\t\t\t\t133957891DF76D3500EC27BE /* YGMacros.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD9001DE5FBD600167DC4 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13EBC6821E28733C00880AC5 /* Value.h in Headers */,\n\t\t\t\t13EBC6811E28733C00880AC5 /* Unicode.h in Headers */,\n\t\t\t\t13EBC6801E28733C00880AC5 /* noncopyable.h in Headers */,\n\t\t\t\t13EBC67E1E28726000880AC5 /* JSCHelpers.h in Headers */,\n\t\t\t\t3D3CD93D1DE5FC1400167DC4 /* JavaScriptCore.h in Headers */,\n\t\t\t\t3D3CD93E1DE5FC1400167DC4 /* JSCWrapper.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD91A1DE5FBEC00167DC4 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D74547F1E54759E00E74ADD /* JSModulesUnbundle.h in Headers */,\n\t\t\t\tC6D3801A1F71D76100621378 /* RAMBundleRegistry.h in Headers */,\n\t\t\t\t27595ABA1E575C7800CCE2B1 /* NativeToJsBridge.h in Headers */,\n\t\t\t\t27595AA91E575C7800CCE2B1 /* Instance.h in Headers */,\n\t\t\t\t27595AB61E575C7800CCE2B1 /* MessageQueueThread.h in Headers */,\n\t\t\t\t27595AB31E575C7800CCE2B1 /* JSCUtils.h in Headers */,\n\t\t\t\t3D7454801E5475AF00E74ADD /* RecoverableError.h in Headers */,\n\t\t\t\t27595AAA1E575C7800CCE2B1 /* JsArgumentHelpers-inl.h in Headers */,\n\t\t\t\t27595AAE1E575C7800CCE2B1 /* JSCLegacyTracing.h in Headers */,\n\t\t\t\t27595ABB1E575C7800CCE2B1 /* Platform.h in Headers */,\n\t\t\t\t27595ABD1E575C7800CCE2B1 /* SystraceSection.h in Headers */,\n\t\t\t\t27595AAB1E575C7800CCE2B1 /* JsArgumentHelpers.h in Headers */,\n\t\t\t\t27595ABC1E575C7800CCE2B1 /* SampleCxxModule.h in Headers */,\n\t\t\t\t27595AB71E575C7800CCE2B1 /* MethodCall.h in Headers */,\n\t\t\t\t3D3CD9471DE5FC7800167DC4 /* oss-compat-util.h in Headers */,\n\t\t\t\t27595AAF1E575C7800CCE2B1 /* JSCMemory.h in Headers */,\n\t\t\t\t3D74547C1E54758900E74ADD /* JSBigString.h in Headers */,\n\t\t\t\t27595AAC1E575C7800CCE2B1 /* JSCExecutor.h in Headers */,\n\t\t\t\t27595AB21E575C7800CCE2B1 /* JSCSamplingProfiler.h in Headers */,\n\t\t\t\t27595AA41E575C7800CCE2B1 /* CxxModule.h in Headers */,\n\t\t\t\t27595AB91E575C7800CCE2B1 /* NativeModule.h in Headers */,\n\t\t\t\t27595AB01E575C7800CCE2B1 /* JSCNativeModules.h in Headers */,\n\t\t\t\t3D3CD9451DE5FC7100167DC4 /* JSBundleType.h in Headers */,\n\t\t\t\t27595AA51E575C7800CCE2B1 /* CxxNativeModule.h in Headers */,\n\t\t\t\t27595AB51E575C7800CCE2B1 /* JSIndexedRAMBundle.h in Headers */,\n\t\t\t\t27595AB81E575C7800CCE2B1 /* ModuleRegistry.h in Headers */,\n\t\t\t\t27595AB11E575C7800CCE2B1 /* JSCPerfStats.h in Headers */,\n\t\t\t\t27595AA61E575C7800CCE2B1 /* JSExecutor.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D80DA181DF820500028D040 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D80DA191DF820620028D040 /* RCTImageLoader.h in Headers */,\n\t\t\t\tC654505E1F3BD9280090799B /* RCTManagedPointer.h in Headers */,\n\t\t\t\t13134C941E296B2A00B9F3CB /* RCTObjcExecutor.h in Headers */,\n\t\t\t\tD49593E0202C937C00A7694B /* RCTMenuManager.h in Headers */,\n\t\t\t\t199B8A6F1F44DB16005DEF67 /* RCTVersion.h in Headers */,\n\t\t\t\t3D80DA1A1DF820620028D040 /* RCTImageStoreManager.h in Headers */,\n\t\t\t\t130443A11E3FEAA900D93A67 /* RCTFollyConvert.h in Headers */,\n\t\t\t\t3D80DA1B1DF820620028D040 /* RCTResizeMode.h in Headers */,\n\t\t\t\t3D80DA1C1DF820620028D040 /* RCTLinkingManager.h in Headers */,\n\t\t\t\t3D80DA1D1DF820620028D040 /* RCTNetworking.h in Headers */,\n\t\t\t\t3D80DA1E1DF820620028D040 /* RCTNetworkTask.h in Headers */,\n\t\t\t\t657734841EE834C900A0E9EA /* RCTInspectorDevServerHelper.h in Headers */,\n\t\t\t\t3D80DA1F1DF820620028D040 /* RCTPushNotificationManager.h in Headers */,\n\t\t\t\t3D80DA201DF820620028D040 /* RCTAssert.h in Headers */,\n\t\t\t\t3D80DA211DF820620028D040 /* RCTBridge.h in Headers */,\n\t\t\t\t13F880381E296D2800C3C7A1 /* JSCWrapper.h in Headers */,\n\t\t\t\t3D80DA221DF820620028D040 /* RCTBridge+Private.h in Headers */,\n\t\t\t\t599FAA461FB274980058CCF6 /* RCTSurfaceStage.h in Headers */,\n\t\t\t\t599FAA361FB274980058CCF6 /* RCTSurface.h in Headers */,\n\t\t\t\t3D80DA231DF820620028D040 /* RCTBridgeDelegate.h in Headers */,\n\t\t\t\t3D80DA241DF820620028D040 /* RCTBridgeMethod.h in Headers */,\n\t\t\t\t3D7BFD151EA8E351008DFB7A /* RCTPackagerClient.h in Headers */,\n\t\t\t\t3D80DA251DF820620028D040 /* RCTBridgeModule.h in Headers */,\n\t\t\t\t3D80DA261DF820620028D040 /* RCTBundleURLProvider.h in Headers */,\n\t\t\t\t599FAA401FB274980058CCF6 /* RCTSurfaceRootShadowViewDelegate.h in Headers */,\n\t\t\t\t5960C1B51F0804A00066FD5B /* RCTLayoutAnimation.h in Headers */,\n\t\t\t\t3D80DA271DF820620028D040 /* RCTConvert.h in Headers */,\n\t\t\t\t3D80DA281DF820620028D040 /* RCTDefines.h in Headers */,\n\t\t\t\t3D80DA291DF820620028D040 /* RCTDisplayLink.h in Headers */,\n\t\t\t\t597633381F4E021D005BE8A4 /* RCTShadowView+Internal.h in Headers */,\n\t\t\t\t3D80DA2A1DF820620028D040 /* RCTErrorCustomizer.h in Headers */,\n\t\t\t\tD4EEE2F6201DF63F00C4CBB6 /* RCTButton.h in Headers */,\n\t\t\t\t3D80DA2B1DF820620028D040 /* RCTErrorInfo.h in Headers */,\n\t\t\t\t1384E2081E806D4E00545659 /* RCTNativeModule.h in Headers */,\n\t\t\t\t3D7BFD2D1EA8E3FA008DFB7A /* RCTReconnectingWebSocket.h in Headers */,\n\t\t\t\t3D80DA2C1DF820620028D040 /* RCTEventDispatcher.h in Headers */,\n\t\t\t\t3D80DA2D1DF820620028D040 /* RCTFrameUpdate.h in Headers */,\n\t\t\t\t59EDBCA91FDF4E0C003573DE /* RCTScrollContentShadowView.h in Headers */,\n\t\t\t\t3D80DA2E1DF820620028D040 /* RCTImageSource.h in Headers */,\n\t\t\t\t3D80DA2F1DF820620028D040 /* RCTInvalidating.h in Headers */,\n\t\t\t\t598FD1971F817336006C54CB /* RCTModalManager.h in Headers */,\n\t\t\t\t599FAA3A1FB274980058CCF6 /* RCTSurfaceDelegate.h in Headers */,\n\t\t\t\t9936F3381F5F2F480010BF04 /* PrivateDataBase.h in Headers */,\n\t\t\t\t3D80DA301DF820620028D040 /* RCTJavaScriptExecutor.h in Headers */,\n\t\t\t\t135A9BFF1E7B0EE600587AEB /* RCTJSCHelpers.h in Headers */,\n\t\t\t\t3D80DA311DF820620028D040 /* RCTJavaScriptLoader.h in Headers */,\n\t\t\t\t130E3D881E6A082100ACE484 /* RCTDevSettings.h in Headers */,\n\t\t\t\t3D80DA321DF820620028D040 /* RCTJSStackFrame.h in Headers */,\n\t\t\t\t130443DC1E401AF400D93A67 /* RCTConvert+Transform.h in Headers */,\n\t\t\t\t3D80DA331DF820620028D040 /* RCTKeyCommands.h in Headers */,\n\t\t\t\t3D80DA341DF820620028D040 /* RCTLog.h in Headers */,\n\t\t\t\t3D80DA351DF820620028D040 /* RCTModuleData.h in Headers */,\n\t\t\t\t3D80DA361DF820620028D040 /* RCTModuleMethod.h in Headers */,\n\t\t\t\t3D80DA371DF820620028D040 /* RCTMultipartDataTask.h in Headers */,\n\t\t\t\t3D80DA381DF820620028D040 /* RCTMultipartStreamReader.h in Headers */,\n\t\t\t\tD4EEE2FB201DF64800C4CBB6 /* NSView+NSViewAnimationWithBlocks.h in Headers */,\n\t\t\t\t594F0A361FD23228007FBE96 /* RCTSurfaceSizeMeasureMode.h in Headers */,\n\t\t\t\t53D123B21FBF220F001B8A10 /* Yoga.h in Headers */,\n\t\t\t\t3D80DA391DF820620028D040 /* RCTNullability.h in Headers */,\n\t\t\t\t3D80DA3A1DF820620028D040 /* RCTParserUtils.h in Headers */,\n\t\t\t\t59EDBCB11FDF4E0C003573DE /* RCTScrollContentViewManager.h in Headers */,\n\t\t\t\t599FAA421FB274980058CCF6 /* RCTSurfaceRootView.h in Headers */,\n\t\t\t\t3D80DA3B1DF820620028D040 /* RCTPerformanceLogger.h in Headers */,\n\t\t\t\t3D80DA3C1DF820620028D040 /* RCTPlatform.h in Headers */,\n\t\t\t\t3D80DA3D1DF820620028D040 /* RCTRootView.h in Headers */,\n\t\t\t\t59EDBCB91FDF4E0C003573DE /* RCTScrollViewManager.h in Headers */,\n\t\t\t\t59EDBCB51FDF4E0C003573DE /* RCTScrollView.h in Headers */,\n\t\t\t\t135A9BFB1E7B0EAE00587AEB /* RCTJSCErrorHandling.h in Headers */,\n\t\t\t\t3D80DA3E1DF820620028D040 /* RCTRootViewDelegate.h in Headers */,\n\t\t\t\t3D80DA3F1DF820620028D040 /* RCTRootViewInternal.h in Headers */,\n\t\t\t\t3D80DA401DF820620028D040 /* RCTTouchEvent.h in Headers */,\n\t\t\t\t3D80DA411DF820620028D040 /* RCTTouchHandler.h in Headers */,\n\t\t\t\t13134C8C1E296B2A00B9F3CB /* RCTMessageThread.h in Headers */,\n\t\t\t\t59EB6DBB1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h in Headers */,\n\t\t\t\t3D80DA421DF820620028D040 /* RCTURLRequestDelegate.h in Headers */,\n\t\t\t\t3D80DA431DF820620028D040 /* RCTURLRequestHandler.h in Headers */,\n\t\t\t\t3D80DA441DF820620028D040 /* RCTUtils.h in Headers */,\n\t\t\t\t13134C981E296B2A00B9F3CB /* RCTCxxMethod.h in Headers */,\n\t\t\t\t3D80DA491DF820620028D040 /* RCTJSCSamplingProfiler.h in Headers */,\n\t\t\t\tD4EEE300201F95F900C4CBB6 /* UIImageUtils.h in Headers */,\n\t\t\t\t3D80DA4B1DF820620028D040 /* RCTAlertManager.h in Headers */,\n\t\t\t\t3D80DA4C1DF820620028D040 /* RCTAppState.h in Headers */,\n\t\t\t\t3D0E378C1F1CC58C00DCAC9F /* RCTWebSocketObserver.h in Headers */,\n\t\t\t\t3D80DA4D1DF820620028D040 /* RCTAsyncLocalStorage.h in Headers */,\n\t\t\t\t3D80DA4E1DF820620028D040 /* RCTClipboard.h in Headers */,\n\t\t\t\t3D80DA4F1DF820620028D040 /* RCTDevLoadingView.h in Headers */,\n\t\t\t\t3D80DA501DF820620028D040 /* RCTDevMenu.h in Headers */,\n\t\t\t\tD4EEE2F5201DF63F00C4CBB6 /* RCTButtonManager.h in Headers */,\n\t\t\t\t3D80DA511DF820620028D040 /* RCTEventEmitter.h in Headers */,\n\t\t\t\t59A7B9FD1E577DBF0068EDBF /* RCTRootContentView.h in Headers */,\n\t\t\t\t3D80DA521DF820620028D040 /* RCTExceptionsManager.h in Headers */,\n\t\t\t\t3D80DA531DF820620028D040 /* RCTI18nManager.h in Headers */,\n\t\t\t\t3D7BFD2F1EA8E3FA008DFB7A /* RCTSRWebSocket.h in Headers */,\n\t\t\t\t3D80DA541DF820620028D040 /* RCTI18nUtil.h in Headers */,\n\t\t\t\t3D80DA561DF820620028D040 /* RCTRedBox.h in Headers */,\n\t\t\t\t3D80DA571DF820620028D040 /* RCTSourceCode.h in Headers */,\n\t\t\t\tD426ACD020D57642003B4C4D /* RCTAppearance.h in Headers */,\n\t\t\t\tEBF21BBC1FC498270052F4D5 /* InspectorInterfaces.h in Headers */,\n\t\t\t\t3D80DA591DF820620028D040 /* RCTTiming.h in Headers */,\n\t\t\t\t3D80DA5A1DF820620028D040 /* RCTUIManager.h in Headers */,\n\t\t\t\t3D80DA5B1DF820620028D040 /* RCTFPSGraph.h in Headers */,\n\t\t\t\t3D80DA5D1DF820620028D040 /* RCTMacros.h in Headers */,\n\t\t\t\t3D80DA5E1DF820620028D040 /* RCTProfile.h in Headers */,\n\t\t\t\t3D80DA5F1DF820620028D040 /* RCTActivityIndicatorView.h in Headers */,\n\t\t\t\t3D80DA601DF820620028D040 /* RCTActivityIndicatorViewManager.h in Headers */,\n\t\t\t\t59500D431F71C63F00B122B7 /* RCTUIManagerUtils.h in Headers */,\n\t\t\t\t5960C1B91F0804A00066FD5B /* RCTLayoutAnimationGroup.h in Headers */,\n\t\t\t\tCF2731C01E7B8DE40044CA4F /* RCTDeviceInfo.h in Headers */,\n\t\t\t\t3D80DA611DF820620028D040 /* RCTAnimationType.h in Headers */,\n\t\t\t\tD49593E5202C96FF00A7694B /* YGNode.h in Headers */,\n\t\t\t\t3D0E378A1F1CC40000DCAC9F /* RCTWebSocketModule.h in Headers */,\n\t\t\t\t3D80DA621DF820620028D040 /* RCTAutoInsetsProtocol.h in Headers */,\n\t\t\t\tC60128AB1F3D1258009DF9FF /* RCTCxxConvert.h in Headers */,\n\t\t\t\t59EDBCAD1FDF4E0C003573DE /* RCTScrollContentView.h in Headers */,\n\t\t\t\t59EDBCA71FDF4E0C003573DE /* RCTScrollableProtocol.h in Headers */,\n\t\t\t\t3D80DA631DF820620028D040 /* RCTBorderDrawing.h in Headers */,\n\t\t\t\t3D80DA641DF820620028D040 /* RCTBorderStyle.h in Headers */,\n\t\t\t\t3D80DA651DF820620028D040 /* RCTComponent.h in Headers */,\n\t\t\t\t3D80DA661DF820620028D040 /* RCTComponentData.h in Headers */,\n\t\t\t\t3DA9819E1E5B0DBB004F2374 /* NSDataBigString.h in Headers */,\n\t\t\t\t3D80DA671DF820620028D040 /* RCTConvert+CoreLocation.h in Headers */,\n\t\t\t\t66CD94B11F1045E700CB3C7C /* RCTMaskedView.h in Headers */,\n\t\t\t\t3D80DA691DF820620028D040 /* RCTDatePicker.h in Headers */,\n\t\t\t\t3D80DA6A1DF820620028D040 /* RCTDatePickerManager.h in Headers */,\n\t\t\t\t3D80DA6B1DF820620028D040 /* RCTFont.h in Headers */,\n\t\t\t\t3D80DA701DF820620028D040 /* RCTModalHostView.h in Headers */,\n\t\t\t\t3D80DA711DF820620028D040 /* RCTModalHostViewController.h in Headers */,\n\t\t\t\t3DF1BE831F26576400068F1A /* JSCTracing.h in Headers */,\n\t\t\t\t3D80DA721DF820620028D040 /* RCTModalHostViewManager.h in Headers */,\n\t\t\t\t13134C9C1E296B2A00B9F3CB /* RCTCxxModule.h in Headers */,\n\t\t\t\t594F0A321FD23228007FBE96 /* RCTSurfaceHostingView.h in Headers */,\n\t\t\t\t3D80DA771DF820620028D040 /* RCTPicker.h in Headers */,\n\t\t\t\t3D80DA781DF820620028D040 /* RCTPickerManager.h in Headers */,\n\t\t\t\t3D80DA791DF820620028D040 /* RCTPointerEvents.h in Headers */,\n\t\t\t\t3D80DA7A1DF820620028D040 /* RCTProgressViewManager.h in Headers */,\n\t\t\t\tA2440AA21DF8D854006E7BFC /* RCTReloadCommand.h in Headers */,\n\t\t\t\t3D80DA7D1DF820620028D040 /* RCTRootShadowView.h in Headers */,\n\t\t\t\t134D63C31F1FEC4B008872B5 /* RCTCxxBridgeDelegate.h in Headers */,\n\t\t\t\t657734901EE8354A00A0E9EA /* RCTInspectorPackagerConnection.h in Headers */,\n\t\t\t\t3D7BFD1D1EA8E351008DFB7A /* RCTPackagerConnection.h in Headers */,\n\t\t\t\t3D80DA811DF820620028D040 /* RCTSegmentedControl.h in Headers */,\n\t\t\t\tD49593DE202C937C00A7694B /* RCTCursorManager.h in Headers */,\n\t\t\t\t599FAA3C1FB274980058CCF6 /* RCTSurfaceRootShadowView.h in Headers */,\n\t\t\t\t3D80DA821DF820620028D040 /* RCTSegmentedControlManager.h in Headers */,\n\t\t\t\t3D80DA831DF820620028D040 /* RCTShadowView.h in Headers */,\n\t\t\t\t3D80DA841DF820620028D040 /* RCTSlider.h in Headers */,\n\t\t\t\t3D80DA851DF820620028D040 /* RCTSliderManager.h in Headers */,\n\t\t\t\t3D80DA861DF820620028D040 /* RCTSwitch.h in Headers */,\n\t\t\t\t3D80DA871DF820620028D040 /* RCTSwitchManager.h in Headers */,\n\t\t\t\t66CD94B51F1045E700CB3C7C /* RCTMaskedViewManager.h in Headers */,\n\t\t\t\t3D80DA8C1DF820620028D040 /* RCTTextDecorationLineType.h in Headers */,\n\t\t\t\t6577348E1EE8354A00A0E9EA /* RCTInspector.h in Headers */,\n\t\t\t\t3D80DA8D1DF820620028D040 /* RCTView.h in Headers */,\n\t\t\t\t3D80DA8E1DF820620028D040 /* RCTViewControllerProtocol.h in Headers */,\n\t\t\t\t590D7BFD1EBD458B00D8A370 /* RCTShadowView+Layout.h in Headers */,\n\t\t\t\t3D80DA8F1DF820620028D040 /* RCTViewManager.h in Headers */,\n\t\t\t\t13134CA01E296B2A00B9F3CB /* RCTCxxUtils.h in Headers */,\n\t\t\t\t599FAA4A1FB274980058CCF6 /* RCTSurfaceView.h in Headers */,\n\t\t\t\t3D80DA901DF820620028D040 /* RCTWebView.h in Headers */,\n\t\t\t\t3D80DA911DF820620028D040 /* RCTWebViewManager.h in Headers */,\n\t\t\t\t3D80DA931DF820620028D040 /* NSView+Private.h in Headers */,\n\t\t\t\t3D80DA941DF820620028D040 /* NSView+React.h in Headers */,\n\t\t\t\t599FAA481FB274980058CCF6 /* RCTSurfaceView+Internal.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t9936F2FB1F5F2E4B0010BF04 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t9936F33C1F5F2FE70010BF04 /* PrivateDataBase.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t9936F3171F5F2E5B0010BF04 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t9936F3391F5F2F5C0010BF04 /* PrivateDataBase.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tEBF21BC41FC498900052F4D5 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tEBF21BE21FC4989A0052F4D5 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t139D7E871E25C6D100323FB7 /* double-conversion */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 139D7E8E1E25C6D100323FB7 /* Build configuration list for PBXNativeTarget \"double-conversion\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t190EE32F1E6A43DE00A8543A /* Install Third Party */,\n\t\t\t\t139D7EA41E25C7BD00323FB7 /* Headers */,\n\t\t\t\t139D7E841E25C6D100323FB7 /* Sources */,\n\t\t\t\t139D7E861E25C6D100323FB7 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"double-conversion\";\n\t\t\tproductName = ThirdParty;\n\t\t\tproductReference = 139D7E881E25C6D100323FB7 /* libdouble-conversion.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t139D7ECD1E25DB7D00323FB7 /* third-party */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 139D7ED41E25DB7D00323FB7 /* Build configuration list for PBXNativeTarget \"third-party\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t139D7ECA1E25DB7D00323FB7 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1320081D1E283DCB00F0C457 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"third-party\";\n\t\t\tproductName = \"third-party\";\n\t\t\tproductReference = 139D7ECE1E25DB7D00323FB7 /* libthird-party.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t2D2A28121D9B038B00D4039D /* React-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D2A281B1D9B038B00D4039D /* Build configuration list for PBXNativeTarget \"React-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2D6948301DA3088700B3FA97 /* Start Packager */,\n\t\t\t\t3D302F231DF828D100D6DDAE /* Headers */,\n\t\t\t\t3D302E191DF8249100D6DDAE /* Copy Headers */,\n\t\t\t\t2D2A280F1D9B038B00D4039D /* Sources */,\n\t\t\t\t2D6948201DA3042200B3FA97 /* Include RCTJSCProfiler */,\n\t\t\t\t3D3C088B1DE342FE00C268FA /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t3D0574551DE5FF9600184BB4 /* PBXTargetDependency */,\n\t\t\t\t3D0574571DE5FF9600184BB4 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"React-tvOS\";\n\t\t\tproductName = \"React-tvOS\";\n\t\t\tproductReference = 2D2A28131D9B038B00D4039D /* libReact.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D383D211EBD27B6005632C8 /* third-party-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D383D391EBD27B6005632C8 /* Build configuration list for PBXNativeTarget \"third-party-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D383D241EBD27B6005632C8 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t3D383D661EBD27DB005632C8 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"third-party-tvOS\";\n\t\t\tproductName = \"third-party\";\n\t\t\tproductReference = 3D383D3C1EBD27B6005632C8 /* libthird-party.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D383D3D1EBD27B9005632C8 /* double-conversion-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D383D5F1EBD27B9005632C8 /* Build configuration list for PBXNativeTarget \"double-conversion-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D383D3E1EBD27B9005632C8 /* Install Third Party */,\n\t\t\t\t3D383D541EBD27B9005632C8 /* Headers */,\n\t\t\t\t3D383D3F1EBD27B9005632C8 /* Sources */,\n\t\t\t\t3D383D491EBD27B9005632C8 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"double-conversion-tvOS\";\n\t\t\tproductName = ThirdParty;\n\t\t\tproductReference = 3D383D621EBD27B9005632C8 /* libdouble-conversion.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3C04B91DE3340900C268FA /* yoga */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3C05971DE3340900C268FA /* Build configuration list for PBXNativeTarget \"yoga\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D3C04BB1DE3340900C268FA /* Headers */,\n\t\t\t\t3D80DAB41DF8212E0028D040 /* Copy Headers */,\n\t\t\t\t3D3C05301DE3340900C268FA /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = yoga;\n\t\t\tproductName = React;\n\t\t\tproductReference = 3D3C059A1DE3340900C268FA /* libyoga.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3C059B1DE3340C00C268FA /* yoga-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3C06721DE3340C00C268FA /* Build configuration list for PBXNativeTarget \"yoga-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D30301C1DF8292200D6DDAE /* Headers */,\n\t\t\t\t3D302F171DF825FE00D6DDAE /* Copy Headers */,\n\t\t\t\t3D3C06181DE3340C00C268FA /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"yoga-tvOS\";\n\t\t\tproductName = \"React-tvOS\";\n\t\t\tproductReference = 3D3C06751DE3340C00C268FA /* libyoga.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3CD8FF1DE5FBD600167DC4 /* jschelpers */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3CD9081DE5FBD600167DC4 /* Build configuration list for PBXNativeTarget \"jschelpers\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D3CD9001DE5FBD600167DC4 /* Headers */,\n\t\t\t\t3D80DABB1DF8218B0028D040 /* Copy Headers */,\n\t\t\t\t3D3CD9051DE5FBD600167DC4 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t9936F3441F5F30780010BF04 /* PBXTargetDependency */,\n\t\t\t\t1320081B1E283DC300F0C457 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = jschelpers;\n\t\t\tproductName = React;\n\t\t\tproductReference = 3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3CD90C1DE5FBD800167DC4 /* jschelpers-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3CD9151DE5FBD800167DC4 /* Build configuration list for PBXNativeTarget \"jschelpers-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D3030241DF8295800D6DDAE /* Headers */,\n\t\t\t\t3D302F1D1DF8264A00D6DDAE /* Copy Headers */,\n\t\t\t\t3D3CD9121DE5FBD800167DC4 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t9936F3461F5F30830010BF04 /* PBXTargetDependency */,\n\t\t\t\t3D383D641EBD27CE005632C8 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"jschelpers-tvOS\";\n\t\t\tproductName = \"React-tvOS\";\n\t\t\tproductReference = 3D3CD9181DE5FBD800167DC4 /* libjschelpers.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3CD9191DE5FBEC00167DC4 /* cxxreact */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3CD9221DE5FBEC00167DC4 /* Build configuration list for PBXNativeTarget \"cxxreact\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D3CD91A1DE5FBEC00167DC4 /* Headers */,\n\t\t\t\t3D80DAB91DF821710028D040 /* Copy Headers */,\n\t\t\t\t3D3CD91F1DE5FBEC00167DC4 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\tEBF21C021FC499D10052F4D5 /* PBXTargetDependency */,\n\t\t\t\t9936F3401F5F305D0010BF04 /* PBXTargetDependency */,\n\t\t\t\t3D3CD9501DE5FDB900167DC4 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = cxxreact;\n\t\t\tproductName = React;\n\t\t\tproductReference = 3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3CD9261DE5FBEE00167DC4 /* cxxreact-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3CD92F1DE5FBEE00167DC4 /* Build configuration list for PBXNativeTarget \"cxxreact-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D3030211DF8294400D6DDAE /* Headers */,\n\t\t\t\t3D302F1B1DF8263300D6DDAE /* Copy Headers */,\n\t\t\t\t3D3CD92C1DE5FBEE00167DC4 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\tEBF21C041FC499D80052F4D5 /* PBXTargetDependency */,\n\t\t\t\t9936F3421F5F30640010BF04 /* PBXTargetDependency */,\n\t\t\t\t3DC159E81E83E2A0007B1282 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"cxxreact-tvOS\";\n\t\t\tproductName = \"React-tvOS\";\n\t\t\tproductReference = 3D3CD9321DE5FBEE00167DC4 /* libcxxreact.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t83CBBA2D1A601D0E00E9B192 /* React */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 83CBBA3F1A601D0F00E9B192 /* Build configuration list for PBXNativeTarget \"React\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t006B79A01A781F38006873D1 /* Start Packager */,\n\t\t\t\t3D80DA181DF820500028D040 /* Headers */,\n\t\t\t\t3D80D91E1DF6FA530028D040 /* Copy Headers */,\n\t\t\t\t83CBBA2A1A601D0E00E9B192 /* Sources */,\n\t\t\t\t142C4F7F1B582EA6001F0B58 /* Include RCTJSCProfiler */,\n\t\t\t\t3D3C08881DE342EE00C268FA /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t53D123991FBF1E0C001B8A10 /* PBXTargetDependency */,\n\t\t\t\t3D3CD94C1DE5FCE700167DC4 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = React;\n\t\t\tproductName = React;\n\t\t\tproductReference = 83CBBA2E1A601D0E00E9B192 /* libReact.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t9936F2F81F5F2E4B0010BF04 /* privatedata */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 9936F3101F5F2E4B0010BF04 /* Build configuration list for PBXNativeTarget \"privatedata\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t9936F2FB1F5F2E4B0010BF04 /* Headers */,\n\t\t\t\t9936F3021F5F2E4B0010BF04 /* Copy Headers */,\n\t\t\t\t9936F30A1F5F2E4B0010BF04 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = privatedata;\n\t\t\tproductName = React;\n\t\t\tproductReference = 9936F3131F5F2E4B0010BF04 /* libprivatedata.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t9936F3141F5F2E5B0010BF04 /* privatedata-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 9936F32C1F5F2E5B0010BF04 /* Build configuration list for PBXNativeTarget \"privatedata-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t9936F3171F5F2E5B0010BF04 /* Headers */,\n\t\t\t\t9936F31E1F5F2E5B0010BF04 /* Copy Headers */,\n\t\t\t\t9936F3261F5F2E5B0010BF04 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"privatedata-tvOS\";\n\t\t\tproductName = \"React-tvOS\";\n\t\t\tproductReference = 9936F32F1F5F2E5B0010BF04 /* libprivatedata-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tEBF21BBF1FC498900052F4D5 /* jsinspector */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = EBF21BD91FC498900052F4D5 /* Build configuration list for PBXNativeTarget \"jsinspector\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tEBF21BC41FC498900052F4D5 /* Headers */,\n\t\t\t\tEBF21BCB1FC498900052F4D5 /* Copy Headers */,\n\t\t\t\tEBF21BD31FC498900052F4D5 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = jsinspector;\n\t\t\tproductName = React;\n\t\t\tproductReference = EBF21BDC1FC498900052F4D5 /* libjsinspector.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tEBF21BDD1FC4989A0052F4D5 /* jsinspector-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = EBF21BF71FC4989A0052F4D5 /* Build configuration list for PBXNativeTarget \"jsinspector-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tEBF21BE21FC4989A0052F4D5 /* Headers */,\n\t\t\t\tEBF21BE91FC4989A0052F4D5 /* Copy Headers */,\n\t\t\t\tEBF21BF11FC4989A0052F4D5 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"jsinspector-tvOS\";\n\t\t\tproductName = \"React-tvOS\";\n\t\t\tproductReference = EBF21BFA1FC4989A0052F4D5 /* libjsinspector-tvOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t83CBB9F71A601CBA00E9B192 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0810;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t139D7E871E25C6D100323FB7 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.1;\n\t\t\t\t\t\tDevelopmentTeam = V9WTTPBFK9;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t139D7ECD1E25DB7D00323FB7 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.1;\n\t\t\t\t\t\tDevelopmentTeam = V9WTTPBFK9;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t2D2A28121D9B038B00D4039D = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t3D383D211EBD27B6005632C8 = {\n\t\t\t\t\t\tDevelopmentTeam = V9WTTPBFK9;\n\t\t\t\t\t};\n\t\t\t\t\t3D383D3D1EBD27B9005632C8 = {\n\t\t\t\t\t\tDevelopmentTeam = V9WTTPBFK9;\n\t\t\t\t\t};\n\t\t\t\t\t83CBBA2D1A601D0E00E9B192 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"React\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 83CBB9F61A601CBA00E9B192;\n\t\t\tproductRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t83CBBA2D1A601D0E00E9B192 /* React */,\n\t\t\t\t2D2A28121D9B038B00D4039D /* React-tvOS */,\n\t\t\t\t3D3C04B91DE3340900C268FA /* yoga */,\n\t\t\t\t3D3C059B1DE3340C00C268FA /* yoga-tvOS */,\n\t\t\t\t3D3CD9191DE5FBEC00167DC4 /* cxxreact */,\n\t\t\t\t3D3CD9261DE5FBEE00167DC4 /* cxxreact-tvOS */,\n\t\t\t\t3D3CD8FF1DE5FBD600167DC4 /* jschelpers */,\n\t\t\t\t3D3CD90C1DE5FBD800167DC4 /* jschelpers-tvOS */,\n\t\t\t\tEBF21BBF1FC498900052F4D5 /* jsinspector */,\n\t\t\t\tEBF21BDD1FC4989A0052F4D5 /* jsinspector-tvOS */,\n\t\t\t\t139D7ECD1E25DB7D00323FB7 /* third-party */,\n\t\t\t\t3D383D211EBD27B6005632C8 /* third-party-tvOS */,\n\t\t\t\t139D7E871E25C6D100323FB7 /* double-conversion */,\n\t\t\t\t3D383D3D1EBD27B9005632C8 /* double-conversion-tvOS */,\n\t\t\t\t9936F2F81F5F2E4B0010BF04 /* privatedata */,\n\t\t\t\t9936F3141F5F2E5B0010BF04 /* privatedata-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t006B79A01A781F38006873D1 /* Start Packager */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Start Packager\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"if [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\n  if nc -w 5 -z localhost 8081 ; then\\n    if ! curl -s \\\"http://localhost:8081/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\n      echo \\\"Port 8081 already in use, packager is either not running or not running correctly\\\"\\n      exit 2\\n    fi\\n  else\\n    open \\\"$SRCROOT/../scripts/launchPackager.command\\\" || echo \\\"Can't start packager automatically\\\"\\n  fi\\nfi\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t142C4F7F1B582EA6001F0B58 /* Include RCTJSCProfiler */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Include RCTJSCProfiler\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"if [[ \\\"$CONFIGURATION\\\" == \\\"Debug\\\" ]] && [[ -d \\\"/tmp/RCTJSCProfiler\\\" ]]; then\\n   find \\\"${CONFIGURATION_BUILD_DIR}\\\" -name '*.app' | xargs -I{} sh -c 'cp -r /tmp/RCTJSCProfiler \\\"$1\\\"' -- {}\\nfi\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t190EE32F1E6A43DE00A8543A /* Install Third Party */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Install Third Party\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"cd \\\"$SRCROOT/..\\\"\\nexec ./scripts/macos-install-third-party.sh\";\n\t\t};\n\t\t2D6948201DA3042200B3FA97 /* Include RCTJSCProfiler */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Include RCTJSCProfiler\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"if [[ \\\"$CONFIGURATION\\\" == \\\"Debug\\\" ]] && [[ -d \\\"/tmp/RCTJSCProfiler\\\" ]]; then\\nfind \\\"${CONFIGURATION_BUILD_DIR}\\\" -name '*.app' | xargs -I{} sh -c 'cp -r /tmp/RCTJSCProfiler \\\"$1\\\"' -- {}\\nfi\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t2D6948301DA3088700B3FA97 /* Start Packager */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Start Packager\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"if [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\nif nc -w 5 -z localhost 8081 ; then\\nif ! curl -s \\\"http://localhost:8081/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\necho \\\"Port 8081 already in use, packager is either not running or not running correctly\\\"\\nexit 2\\nfi\\nelse\\nopen \\\"$SRCROOT/../scripts/launchPackager.command\\\" || echo \\\"Can't start packager automatically\\\"\\nfi\\nfi\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t3D383D3E1EBD27B9005632C8 /* Install Third Party */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Install Third Party\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"cd \\\"$SRCROOT/..\\\"\\nexec ./scripts/macos-install-third-party.sh\";\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t139D7E841E25C6D100323FB7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t139D7E911E25C70B00323FB7 /* bignum-dtoa.cc in Sources */,\n\t\t\t\t139D7E931E25C70B00323FB7 /* bignum.cc in Sources */,\n\t\t\t\t139D7E951E25C70B00323FB7 /* cached-powers.cc in Sources */,\n\t\t\t\t139D7E971E25C70B00323FB7 /* diy-fp.cc in Sources */,\n\t\t\t\t139D7E991E25C70B00323FB7 /* double-conversion.cc in Sources */,\n\t\t\t\t139D7E9B1E25C70B00323FB7 /* fast-dtoa.cc in Sources */,\n\t\t\t\t139D7E9D1E25C70B00323FB7 /* fixed-dtoa.cc in Sources */,\n\t\t\t\t139D7EA01E25C70B00323FB7 /* strtod.cc in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t139D7ECA1E25DB7D00323FB7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t139D84B01E273B5600323FB7 /* Conv.cpp in Sources */,\n\t\t\t\t13F887591E2971D400C3C7A1 /* StringBase.cpp in Sources */,\n\t\t\t\t139D7F031E25DE1100323FB7 /* raw_logging.cc in Sources */,\n\t\t\t\t139D7F041E25DE1100323FB7 /* signalhandler.cc in Sources */,\n\t\t\t\t139D84B11E273B5600323FB7 /* dynamic.cpp in Sources */,\n\t\t\t\t139D7F061E25DE1100323FB7 /* utilities.cc in Sources */,\n\t\t\t\t13F887A21E2977FF00C3C7A1 /* MallocImpl.cpp in Sources */,\n\t\t\t\t139D84AF1E273B5600323FB7 /* Bits.cpp in Sources */,\n\t\t\t\t139D7F051E25DE1100323FB7 /* symbolize.cc in Sources */,\n\t\t\t\t139D7F071E25DE1100323FB7 /* vlog_is_on.cc in Sources */,\n\t\t\t\t13F8875A1E2971D400C3C7A1 /* Unicode.cpp in Sources */,\n\t\t\t\t139D7F091E25DE3700323FB7 /* demangle.cc in Sources */,\n\t\t\t\t13F887581E2971D400C3C7A1 /* Demangle.cpp in Sources */,\n\t\t\t\t139D7F021E25DE1100323FB7 /* logging.cc in Sources */,\n\t\t\t\t139D84B31E273B5600323FB7 /* json.cpp in Sources */,\n\t\t\t\t13F8879F1E29741900C3C7A1 /* BitsFunctexcept.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D2A280F1D9B038B00D4039D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t598FD1931F817284006C54CB /* PrivateDataBase.cpp in Sources */,\n\t\t\t\t3DC159E41E83E1AE007B1282 /* RCTRootContentView.m in Sources */,\n\t\t\t\t3D80D91B1DF6F8200028D040 /* RCTPlatform.m in Sources */,\n\t\t\t\t2D3B5EC91D9B095C00451313 /* RCTBorderDrawing.m in Sources */,\n\t\t\t\t66CD94B81F1045E700CB3C7C /* RCTMaskedViewManager.m in Sources */,\n\t\t\t\t2D3B5E991D9B089A00451313 /* RCTDisplayLink.m in Sources */,\n\t\t\t\t2D3B5EA11D9B08B600451313 /* RCTModuleData.mm in Sources */,\n\t\t\t\t590D7C001EBD458B00D8A370 /* RCTShadowView+Layout.m in Sources */,\n\t\t\t\t2D3B5EAE1D9B08F800451313 /* RCTEventEmitter.m in Sources */,\n\t\t\t\t2D3B5ECA1D9B095F00451313 /* RCTComponentData.m in Sources */,\n\t\t\t\t2D3B5EA31D9B08BE00451313 /* RCTParserUtils.m in Sources */,\n\t\t\t\t59500D461F71C63F00B122B7 /* RCTUIManagerUtils.m in Sources */,\n\t\t\t\t599FAA4D1FB274980058CCF6 /* RCTSurfaceView.mm in Sources */,\n\t\t\t\t59EDBCB41FDF4E0C003573DE /* RCTScrollContentViewManager.m in Sources */,\n\t\t\t\t2D3B5EA01D9B08B200451313 /* RCTLog.mm in Sources */,\n\t\t\t\t5960C1BC1F0804A00066FD5B /* RCTLayoutAnimationGroup.m in Sources */,\n\t\t\t\t2D3B5ECF1D9B096F00451313 /* RCTFont.mm in Sources */,\n\t\t\t\t2D3B5ED51D9B098000451313 /* RCTModalHostViewController.m in Sources */,\n\t\t\t\t657734931EE8356100A0E9EA /* RCTInspector.mm in Sources */,\n\t\t\t\t59EB6DBE1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.mm in Sources */,\n\t\t\t\t2D3B5E971D9B089000451313 /* RCTBridge.m in Sources */,\n\t\t\t\t2D3B5E9B1D9B08A000451313 /* RCTFrameUpdate.m in Sources */,\n\t\t\t\t2D3B5EE41D9B09BB00451313 /* RCTSegmentedControlManager.m in Sources */,\n\t\t\t\t59EDBCB81FDF4E0C003573DE /* RCTScrollView.m in Sources */,\n\t\t\t\t13134C9F1E296B2A00B9F3CB /* RCTCxxModule.mm in Sources */,\n\t\t\t\t2D3B5EE31D9B09B700451313 /* RCTSegmentedControl.m in Sources */,\n\t\t\t\t130443A41E3FEAC600D93A67 /* RCTFollyConvert.mm in Sources */,\n\t\t\t\t3D7BFD201EA8E351008DFB7A /* RCTPackagerConnection.mm in Sources */,\n\t\t\t\t5960C1B81F0804A00066FD5B /* RCTLayoutAnimation.m in Sources */,\n\t\t\t\t2D3B5EB71D9B091800451313 /* RCTRedBox.m in Sources */,\n\t\t\t\t3D7AA9C61E548CDD001955CF /* NSDataBigString.mm in Sources */,\n\t\t\t\t13134C8F1E296B2A00B9F3CB /* RCTMessageThread.mm in Sources */,\n\t\t\t\t2D3B5EF11D9B09E700451313 /* NSView+React.m in Sources */,\n\t\t\t\t2D3B5E931D9B087300451313 /* RCTErrorInfo.m in Sources */,\n\t\t\t\tC60669371F3CCF1B00E67165 /* RCTManagedPointer.mm in Sources */,\n\t\t\t\t2D3B5EE01D9B09AD00451313 /* RCTRootShadowView.m in Sources */,\n\t\t\t\t2D3B5EBA1D9B092100451313 /* RCTI18nUtil.m in Sources */,\n\t\t\t\t2D3B5EB41D9B090A00451313 /* RCTDevLoadingView.m in Sources */,\n\t\t\t\t2D3B5EEF1D9B09DC00451313 /* RCTViewManager.m in Sources */,\n\t\t\t\t13134C971E296B2A00B9F3CB /* RCTObjcExecutor.mm in Sources */,\n\t\t\t\t594F0A351FD23228007FBE96 /* RCTSurfaceHostingView.mm in Sources */,\n\t\t\t\t130E3D8B1E6A083900ACE484 /* RCTDevSettings.mm in Sources */,\n\t\t\t\t2D3B5E951D9B087C00451313 /* RCTAssert.m in Sources */,\n\t\t\t\t3DF1BE851F26577300068F1A /* JSCTracing.cpp in Sources */,\n\t\t\t\t2D3B5EB61D9B091400451313 /* RCTExceptionsManager.m in Sources */,\n\t\t\t\t2D3B5ED41D9B097D00451313 /* RCTModalHostView.m in Sources */,\n\t\t\t\t599FAA391FB274980058CCF6 /* RCTSurface.mm in Sources */,\n\t\t\t\tC606692F1F3CC60500E67165 /* RCTModuleMethod.mm in Sources */,\n\t\t\t\t2D3B5E9F1D9B08AF00451313 /* RCTKeyCommands.m in Sources */,\n\t\t\t\t2D3B5EA51D9B08C700451313 /* RCTRootView.m in Sources */,\n\t\t\t\t13134C871E296B2A00B9F3CB /* RCTCxxBridge.mm in Sources */,\n\t\t\t\tCF2731C31E7B8DF30044CA4F /* RCTDeviceInfo.m in Sources */,\n\t\t\t\t599FAA3F1FB274980058CCF6 /* RCTSurfaceRootShadowView.m in Sources */,\n\t\t\t\tEBF21C001FC499A80052F4D5 /* InspectorInterfaces.cpp in Sources */,\n\t\t\t\t597633371F4E021D005BE8A4 /* RCTShadowView+Internal.m in Sources */,\n\t\t\t\t2D3B5EB11D9B090100451313 /* RCTAppState.m in Sources */,\n\t\t\t\t1384E20B1E806D5B00545659 /* RCTNativeModule.mm in Sources */,\n\t\t\t\t2D3B5EC21D9B093B00451313 /* RCTProfile.m in Sources */,\n\t\t\t\t2D3B5ECB1D9B096200451313 /* RCTConvert+CoreLocation.m in Sources */,\n\t\t\t\t2D3B5EEE1D9B09DA00451313 /* RCTView.m in Sources */,\n\t\t\t\t2D3B5E981D9B089500451313 /* RCTConvert.m in Sources */,\n\t\t\t\t3D7BFD181EA8E351008DFB7A /* RCTPackagerClient.m in Sources */,\n\t\t\t\t2D3B5EA71D9B08CE00451313 /* RCTTouchHandler.m in Sources */,\n\t\t\t\t3D05745A1DE5FFF500184BB4 /* RCTJavaScriptLoader.mm in Sources */,\n\t\t\t\t2D3B5EA41D9B08C200451313 /* RCTPerformanceLogger.m in Sources */,\n\t\t\t\t2D3B5E9E1D9B08AD00451313 /* RCTJSStackFrame.m in Sources */,\n\t\t\t\t13134CA31E296B2A00B9F3CB /* RCTCxxUtils.mm in Sources */,\n\t\t\t\t2D3B5E941D9B087900451313 /* RCTBundleURLProvider.m in Sources */,\n\t\t\t\t2D3B5EB81D9B091B00451313 /* RCTSourceCode.m in Sources */,\n\t\t\t\t2D3B5EB51D9B091100451313 /* RCTDevMenu.m in Sources */,\n\t\t\t\t59EDBCAC1FDF4E0C003573DE /* RCTScrollContentShadowView.m in Sources */,\n\t\t\t\t2D3B5EBD1D9B092A00451313 /* RCTTiming.m in Sources */,\n\t\t\t\t135A9C041E7B0F6400587AEB /* RCTJSCErrorHandling.mm in Sources */,\n\t\t\t\t2D3B5EA81D9B08D300451313 /* RCTUtils.m in Sources */,\n\t\t\t\t599FAA451FB274980058CCF6 /* RCTSurfaceRootView.mm in Sources */,\n\t\t\t\t2D3B5EC81D9B095800451313 /* RCTActivityIndicatorViewManager.m in Sources */,\n\t\t\t\t598FD1961F817335006C54CB /* RCTModalManager.m in Sources */,\n\t\t\t\t3DCD185D1DF978E7007FE5A1 /* RCTReloadCommand.m in Sources */,\n\t\t\t\t130443DB1E401ADD00D93A67 /* RCTConvert+Transform.m in Sources */,\n\t\t\t\t3D0B84301EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.m in Sources */,\n\t\t\t\t2D3B5EC61D9B095000451313 /* RCTProfileTrampoline-x86_64.S in Sources */,\n\t\t\t\t2D3B5EA61D9B08CA00451313 /* RCTTouchEvent.m in Sources */,\n\t\t\t\t2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */,\n\t\t\t\t2D1D83EF1F74E76C00615550 /* RCTModalManager.m in Sources */,\n\t\t\t\t59EDBCBC1FDF4E0C003573DE /* RCTScrollViewManager.m in Sources */,\n\t\t\t\t59EDBCB01FDF4E0C003573DE /* RCTScrollContentView.m in Sources */,\n\t\t\t\t2D3B5EB01D9B08FE00451313 /* RCTAlertManager.m in Sources */,\n\t\t\t\t13134C9B1E296B2A00B9F3CB /* RCTCxxMethod.mm in Sources */,\n\t\t\t\t2D3B5E9C1D9B08A300451313 /* RCTImageSource.m in Sources */,\n\t\t\t\t3DDEC1521DDCE0CA0020BBDF /* RCTJSCSamplingProfiler.m in Sources */,\n\t\t\t\t2D3B5EC31D9B094800451313 /* RCTProfileTrampoline-arm.S in Sources */,\n\t\t\t\t3D0B842B1EC0B49400B2BD8E /* RCTTVRemoteHandler.m in Sources */,\n\t\t\t\t657734861EE834D900A0E9EA /* RCTInspectorDevServerHelper.mm in Sources */,\n\t\t\t\t66CD94B41F1045E700CB3C7C /* RCTMaskedView.m in Sources */,\n\t\t\t\t2D74EAFA1DAE9590003B751B /* RCTMultipartDataTask.m in Sources */,\n\t\t\t\t2D3B5EC51D9B094D00451313 /* RCTProfileTrampoline-i386.S in Sources */,\n\t\t\t\t657734951EE8356100A0E9EA /* RCTInspectorPackagerConnection.m in Sources */,\n\t\t\t\t59283CA11FD67321000EAAB9 /* RCTSurfaceStage.m in Sources */,\n\t\t\t\t2D3B5EC41D9B094B00451313 /* RCTProfileTrampoline-arm64.S in Sources */,\n\t\t\t\t2D3B5EBB1D9B092300451313 /* RCTI18nManager.m in Sources */,\n\t\t\t\t2D3B5EBE1D9B092D00451313 /* RCTUIManager.m in Sources */,\n\t\t\t\tC60128AE1F3D1258009DF9FF /* RCTCxxConvert.m in Sources */,\n\t\t\t\t2D3B5EDD1D9B09A300451313 /* RCTProgressViewManager.m in Sources */,\n\t\t\t\t2D3B5EC11D9B093900451313 /* RCTFPSGraph.m in Sources */,\n\t\t\t\t2D3B5E9A1D9B089D00451313 /* RCTEventDispatcher.m in Sources */,\n\t\t\t\t2D3B5ED61D9B098400451313 /* RCTModalHostViewManager.m in Sources */,\n\t\t\t\t2D3B5EE51D9B09BE00451313 /* RCTShadowView.m in Sources */,\n\t\t\t\t135A9C051E7B0F7500587AEB /* RCTJSCHelpers.mm in Sources */,\n\t\t\t\t2D3B5EC71D9B095600451313 /* RCTActivityIndicatorView.m in Sources */,\n\t\t\t\t2D3B5EB21D9B090300451313 /* RCTAsyncLocalStorage.m in Sources */,\n\t\t\t\t2D3B5EC01D9B093600451313 /* RCTPerfMonitor.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D383D241EBD27B6005632C8 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D383D251EBD27B6005632C8 /* Conv.cpp in Sources */,\n\t\t\t\t3D383D261EBD27B6005632C8 /* StringBase.cpp in Sources */,\n\t\t\t\t3D383D271EBD27B6005632C8 /* raw_logging.cc in Sources */,\n\t\t\t\t3D383D281EBD27B6005632C8 /* signalhandler.cc in Sources */,\n\t\t\t\t3D383D291EBD27B6005632C8 /* dynamic.cpp in Sources */,\n\t\t\t\t3D383D2A1EBD27B6005632C8 /* utilities.cc in Sources */,\n\t\t\t\t3D383D2B1EBD27B6005632C8 /* MallocImpl.cpp in Sources */,\n\t\t\t\t3D383D2C1EBD27B6005632C8 /* Bits.cpp in Sources */,\n\t\t\t\t3D383D2D1EBD27B6005632C8 /* symbolize.cc in Sources */,\n\t\t\t\t3D383D2E1EBD27B6005632C8 /* vlog_is_on.cc in Sources */,\n\t\t\t\t3D383D2F1EBD27B6005632C8 /* Unicode.cpp in Sources */,\n\t\t\t\t3D383D301EBD27B6005632C8 /* demangle.cc in Sources */,\n\t\t\t\t3D383D311EBD27B6005632C8 /* Demangle.cpp in Sources */,\n\t\t\t\t3D383D331EBD27B6005632C8 /* logging.cc in Sources */,\n\t\t\t\t3D383D341EBD27B6005632C8 /* json.cpp in Sources */,\n\t\t\t\t3D383D351EBD27B6005632C8 /* BitsFunctexcept.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D383D3F1EBD27B9005632C8 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D383D401EBD27B9005632C8 /* bignum-dtoa.cc in Sources */,\n\t\t\t\t3D383D411EBD27B9005632C8 /* bignum.cc in Sources */,\n\t\t\t\t3D383D421EBD27B9005632C8 /* cached-powers.cc in Sources */,\n\t\t\t\t3D383D431EBD27B9005632C8 /* diy-fp.cc in Sources */,\n\t\t\t\t3D383D441EBD27B9005632C8 /* double-conversion.cc in Sources */,\n\t\t\t\t3D383D451EBD27B9005632C8 /* fast-dtoa.cc in Sources */,\n\t\t\t\t3D383D461EBD27B9005632C8 /* fixed-dtoa.cc in Sources */,\n\t\t\t\t3D383D471EBD27B9005632C8 /* strtod.cc in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3C05301DE3340900C268FA /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t53D123A01FBF1EFF001B8A10 /* Yoga.cpp in Sources */,\n\t\t\t\t53D1239A1FBF1EF2001B8A10 /* YGEnums.cpp in Sources */,\n\t\t\t\t5376C5E41FC6DDBC0083513D /* YGNodePrint.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3C06181DE3340C00C268FA /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t53D123A11FBF1EFF001B8A10 /* Yoga.cpp in Sources */,\n\t\t\t\t53D1239B1FBF1EF4001B8A10 /* YGEnums.cpp in Sources */,\n\t\t\t\t5376C5E51FC6DDBD0083513D /* YGNodePrint.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD9051DE5FBD600167DC4 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13EBC6711E2870DE00880AC5 /* JSCWrapper.cpp in Sources */,\n\t\t\t\t13EBC6731E2870DE00880AC5 /* Value.cpp in Sources */,\n\t\t\t\t13EBC67D1E28725900880AC5 /* JSCHelpers.cpp in Sources */,\n\t\t\t\t135A9C021E7B0F4800587AEB /* systemJSCWrapper.cpp in Sources */,\n\t\t\t\t13EBC67B1E28723000880AC5 /* Unicode.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD9121DE5FBD800167DC4 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13EBC6791E2870E400880AC5 /* Unicode.cpp in Sources */,\n\t\t\t\t13EBC6781E2870E400880AC5 /* JSCWrapper.cpp in Sources */,\n\t\t\t\t13EBC6771E2870E400880AC5 /* JSCHelpers.cpp in Sources */,\n\t\t\t\t135A9C011E7B0F4700587AEB /* systemJSCWrapper.cpp in Sources */,\n\t\t\t\t13EBC67A1E2870E400880AC5 /* Value.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD91F1DE5FBEC00167DC4 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DC159E51E83E1E9007B1282 /* JSBigString.cpp in Sources */,\n\t\t\t\t13F8877B1E29726200C3C7A1 /* JSIndexedRAMBundle.cpp in Sources */,\n\t\t\t\t13F8877D1E29726200C3C7A1 /* ModuleRegistry.cpp in Sources */,\n\t\t\t\tC6D3801C1F71D76700621378 /* RAMBundleRegistry.cpp in Sources */,\n\t\t\t\t13F8876E1E29726200C3C7A1 /* CxxNativeModule.cpp in Sources */,\n\t\t\t\t13F887721E29726200C3C7A1 /* JSCExecutor.cpp in Sources */,\n\t\t\t\t13F887741E29726200C3C7A1 /* JSCLegacyTracing.cpp in Sources */,\n\t\t\t\t13F887771E29726200C3C7A1 /* JSCPerfStats.cpp in Sources */,\n\t\t\t\t13F887711E29726200C3C7A1 /* JSBundleType.cpp in Sources */,\n\t\t\t\t13F887791E29726200C3C7A1 /* JSCUtils.cpp in Sources */,\n\t\t\t\t13F887781E29726200C3C7A1 /* JSCSamplingProfiler.cpp in Sources */,\n\t\t\t\t13F887751E29726200C3C7A1 /* JSCMemory.cpp in Sources */,\n\t\t\t\t13F8877C1E29726200C3C7A1 /* MethodCall.cpp in Sources */,\n\t\t\t\t13F8877F1E29726200C3C7A1 /* Platform.cpp in Sources */,\n\t\t\t\t13F887701E29726200C3C7A1 /* Instance.cpp in Sources */,\n\t\t\t\t13F8877E1E29726200C3C7A1 /* NativeToJsBridge.cpp in Sources */,\n\t\t\t\t13F887761E29726200C3C7A1 /* JSCNativeModules.cpp in Sources */,\n\t\t\t\t13F887801E29726200C3C7A1 /* SampleCxxModule.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD92C1DE5FBEE00167DC4 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DC159E61E83E1FA007B1282 /* JSBigString.cpp in Sources */,\n\t\t\t\t13F8878E1E29726300C3C7A1 /* JSIndexedRAMBundle.cpp in Sources */,\n\t\t\t\t13F887901E29726300C3C7A1 /* ModuleRegistry.cpp in Sources */,\n\t\t\t\tC6D3801D1F71D76800621378 /* RAMBundleRegistry.cpp in Sources */,\n\t\t\t\t13F887851E29726300C3C7A1 /* JSCExecutor.cpp in Sources */,\n\t\t\t\t13F887871E29726300C3C7A1 /* JSCLegacyTracing.cpp in Sources */,\n\t\t\t\t13F8878A1E29726300C3C7A1 /* JSCPerfStats.cpp in Sources */,\n\t\t\t\t13F887841E29726300C3C7A1 /* Instance.cpp in Sources */,\n\t\t\t\t13F8878C1E29726300C3C7A1 /* JSCUtils.cpp in Sources */,\n\t\t\t\t13F8878B1E29726300C3C7A1 /* JSCSamplingProfiler.cpp in Sources */,\n\t\t\t\t13F887881E29726300C3C7A1 /* JSCMemory.cpp in Sources */,\n\t\t\t\t3D80D9181DF6F7A80028D040 /* JSBundleType.cpp in Sources */,\n\t\t\t\t13F8878F1E29726300C3C7A1 /* MethodCall.cpp in Sources */,\n\t\t\t\t13F887921E29726300C3C7A1 /* Platform.cpp in Sources */,\n\t\t\t\t13F887911E29726300C3C7A1 /* NativeToJsBridge.cpp in Sources */,\n\t\t\t\t13F887821E29726300C3C7A1 /* CxxNativeModule.cpp in Sources */,\n\t\t\t\t13F887891E29726300C3C7A1 /* JSCNativeModules.cpp in Sources */,\n\t\t\t\t13F887931E29726300C3C7A1 /* SampleCxxModule.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t83CBBA2A1A601D0E00E9B192 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13134C9A1E296B2A00B9F3CB /* RCTCxxMethod.mm in Sources */,\n\t\t\t\t59500D451F71C63F00B122B7 /* RCTUIManagerUtils.m in Sources */,\n\t\t\t\t597633361F4E021D005BE8A4 /* RCTShadowView+Internal.m in Sources */,\n\t\t\t\t000E6CEB1AB0E980000CDF4D /* RCTSourceCode.m in Sources */,\n\t\t\t\t001BFCD01D8381DE008E587E /* RCTMultipartStreamReader.m in Sources */,\n\t\t\t\t133CAE8E1B8E5CFD00F6AD92 /* RCTDatePicker.m in Sources */,\n\t\t\t\t14C2CA761B3AC64F00E6CBB2 /* RCTFrameUpdate.m in Sources */,\n\t\t\t\tD49593E6202C96FF00A7694B /* YGNode.cpp in Sources */,\n\t\t\t\t594F0A341FD23228007FBE96 /* RCTSurfaceHostingView.mm in Sources */,\n\t\t\t\t13134C861E296B2A00B9F3CB /* RCTCxxBridge.mm in Sources */,\n\t\t\t\t13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */,\n\t\t\t\t599FAA4C1FB274980058CCF6 /* RCTSurfaceView.mm in Sources */,\n\t\t\t\tD4EEE2F7201DF63F00C4CBB6 /* RCTButton.m in Sources */,\n\t\t\t\t352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */,\n\t\t\t\t66CD94B71F1045E700CB3C7C /* RCTMaskedViewManager.m in Sources */,\n\t\t\t\t008341F61D1DB34400876D9A /* RCTJSStackFrame.m in Sources */,\n\t\t\t\t13134C961E296B2A00B9F3CB /* RCTObjcExecutor.mm in Sources */,\n\t\t\t\tD4EEE2FC201DF64800C4CBB6 /* NSView+NSViewAnimationWithBlocks.m in Sources */,\n\t\t\t\t83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */,\n\t\t\t\t131B6AF41AF1093D00FFC3E0 /* RCTSegmentedControl.m in Sources */,\n\t\t\t\t830A229E1A66C68A008503DA /* RCTRootView.m in Sources */,\n\t\t\t\t13B07FF01A69327A00A75B9A /* RCTExceptionsManager.m in Sources */,\n\t\t\t\t13A0C28A1B74F71200B29F6F /* RCTDevMenu.m in Sources */,\n\t\t\t\t13BCE8091C99CB9D00DD7AAD /* RCTRootShadowView.m in Sources */,\n\t\t\t\t006FC4141D9B20820057AAAD /* RCTMultipartDataTask.m in Sources */,\n\t\t\t\t59EDBCB31FDF4E0C003573DE /* RCTScrollContentViewManager.m in Sources */,\n\t\t\t\t13CC8A821B17642100940AE7 /* RCTBorderDrawing.m in Sources */,\n\t\t\t\tC60128AD1F3D1258009DF9FF /* RCTCxxConvert.m in Sources */,\n\t\t\t\t83CBBA511A601E3B00E9B192 /* RCTAssert.m in Sources */,\n\t\t\t\t59EB6DBD1EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.mm in Sources */,\n\t\t\t\t13AF20451AE707F9005F5298 /* RCTSlider.m in Sources */,\n\t\t\t\t130443A21E3FEAA900D93A67 /* RCTFollyConvert.mm in Sources */,\n\t\t\t\t58114A501AAE93D500E7D092 /* RCTAsyncLocalStorage.m in Sources */,\n\t\t\t\t657734851EE834C900A0E9EA /* RCTInspectorDevServerHelper.mm in Sources */,\n\t\t\t\t130E3D891E6A082100ACE484 /* RCTDevSettings.mm in Sources */,\n\t\t\t\t59283CA01FD67321000EAAB9 /* RCTSurfaceStage.m in Sources */,\n\t\t\t\t13513F3C1B1F43F400FCE529 /* RCTProgressViewManager.m in Sources */,\n\t\t\t\t14F7A0F01BDA714B003C6C10 /* RCTFPSGraph.m in Sources */,\n\t\t\t\t3D7BFD171EA8E351008DFB7A /* RCTPackagerClient.m in Sources */,\n\t\t\t\t14F3620D1AABD06A001CE568 /* RCTSwitch.m in Sources */,\n\t\t\t\t13134C8E1E296B2A00B9F3CB /* RCTMessageThread.mm in Sources */,\n\t\t\t\t599FAA381FB274980058CCF6 /* RCTSurface.mm in Sources */,\n\t\t\t\t3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */,\n\t\t\t\t14F3620E1AABD06A001CE568 /* RCTSwitchManager.m in Sources */,\n\t\t\t\t13B080201A69489C00A75B9A /* RCTActivityIndicatorViewManager.m in Sources */,\n\t\t\t\t13E067561A70F44B002CDEE1 /* RCTViewManager.m in Sources */,\n\t\t\t\t13BB3D021BECD54500932C10 /* RCTImageSource.m in Sources */,\n\t\t\t\t13134CA21E296B2A00B9F3CB /* RCTCxxUtils.mm in Sources */,\n\t\t\t\t58C571C11AA56C1900CDF9C8 /* RCTDatePickerManager.m in Sources */,\n\t\t\t\tC606692E1F3CC60500E67165 /* RCTModuleMethod.mm in Sources */,\n\t\t\t\t1450FF8A1BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S in Sources */,\n\t\t\t\t13D9FEEB1CDCCECF00158BD7 /* RCTEventEmitter.m in Sources */,\n\t\t\t\t599FAA3E1FB274980058CCF6 /* RCTSurfaceRootShadowView.m in Sources */,\n\t\t\t\tAC70D2E91DE489E4002E6351 /* RCTJavaScriptLoader.mm in Sources */,\n\t\t\t\t14F7A0EC1BDA3B3C003C6C10 /* RCTPerfMonitor.m in Sources */,\n\t\t\t\t5960C1B71F0804A00066FD5B /* RCTLayoutAnimation.m in Sources */,\n\t\t\t\t13134C9E1E296B2A00B9F3CB /* RCTCxxModule.mm in Sources */,\n\t\t\t\t1450FF881BCFF28A00208362 /* RCTProfileTrampoline-arm64.S in Sources */,\n\t\t\t\t13E41EEB1C05CA0B00CD8DAC /* RCTProfileTrampoline-i386.S in Sources */,\n\t\t\t\t3D37B5821D522B190042D5B5 /* RCTFont.mm in Sources */,\n\t\t\t\t59EDBCB71FDF4E0C003573DE /* RCTScrollView.m in Sources */,\n\t\t\t\t59EDBCAB1FDF4E0C003573DE /* RCTScrollContentShadowView.m in Sources */,\n\t\t\t\t59EDBCBB1FDF4E0C003573DE /* RCTScrollViewManager.m in Sources */,\n\t\t\t\t369123E11DDC75850095B341 /* RCTJSCSamplingProfiler.m in Sources */,\n\t\t\t\t599FAA441FB274980058CCF6 /* RCTSurfaceRootView.mm in Sources */,\n\t\t\t\tC60669361F3CCF1B00E67165 /* RCTManagedPointer.mm in Sources */,\n\t\t\t\tA2440AA31DF8D854006E7BFC /* RCTReloadCommand.m in Sources */,\n\t\t\t\t3DF1BE821F26576400068F1A /* JSCTracing.cpp in Sources */,\n\t\t\t\t6577348F1EE8354A00A0E9EA /* RCTInspector.mm in Sources */,\n\t\t\t\t13A0C2891B74F71200B29F6F /* RCTDevLoadingView.m in Sources */,\n\t\t\t\t13B07FF21A69327A00A75B9A /* RCTTiming.m in Sources */,\n\t\t\t\t1372B70A1AB030C200659ED6 /* RCTAppState.m in Sources */,\n\t\t\t\t59A7B9FE1E577DBF0068EDBF /* RCTRootContentView.m in Sources */,\n\t\t\t\t13E067591A70F44B002CDEE1 /* NSView+React.m in Sources */,\n\t\t\t\t14F484561AABFCE100FDF6B9 /* RCTSliderManager.m in Sources */,\n\t\t\t\tCF2731C11E7B8DE40044CA4F /* RCTDeviceInfo.m in Sources */,\n\t\t\t\t3D7AA9C41E548CD5001955CF /* NSDataBigString.mm in Sources */,\n\t\t\t\t13D033631C1837FE0021DC29 /* RCTClipboard.m in Sources */,\n\t\t\t\t14C2CA741B3AC64300E6CBB2 /* RCTModuleData.mm in Sources */,\n\t\t\t\t142014191B32094000CC17BA /* RCTPerformanceLogger.m in Sources */,\n\t\t\t\t83CBBA981A6020BB00E9B192 /* RCTTouchHandler.m in Sources */,\n\t\t\t\t3EDCA8A51D3591E700450C31 /* RCTErrorInfo.m in Sources */,\n\t\t\t\t83CBBA521A601E3B00E9B192 /* RCTLog.mm in Sources */,\n\t\t\t\t13A6E20E1C19AA0C00845B82 /* RCTParserUtils.m in Sources */,\n\t\t\t\t13E067571A70F44B002CDEE1 /* RCTView.m in Sources */,\n\t\t\t\t3D7749441DC1065C007EC8D8 /* RCTPlatform.m in Sources */,\n\t\t\t\tD4EEE2FF201F95F900C4CBB6 /* UIImageUtils.m in Sources */,\n\t\t\t\tEBF21BBD1FC498270052F4D5 /* InspectorInterfaces.cpp in Sources */,\n\t\t\t\t59EDBCAF1FDF4E0C003573DE /* RCTScrollContentView.m in Sources */,\n\t\t\t\t135A9C001E7B0EE600587AEB /* RCTJSCHelpers.mm in Sources */,\n\t\t\t\tB233E6EA1D2D845D00BC68BA /* RCTI18nManager.m in Sources */,\n\t\t\t\t3D7BFD1F1EA8E351008DFB7A /* RCTPackagerConnection.mm in Sources */,\n\t\t\t\t13456E931ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m in Sources */,\n\t\t\t\tD49593DF202C937C00A7694B /* RCTCursorManager.m in Sources */,\n\t\t\t\t13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */,\n\t\t\t\t83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */,\n\t\t\t\t130443C61E401A8C00D93A67 /* RCTConvert+Transform.m in Sources */,\n\t\t\t\t13C156051AB1A2840079392D /* RCTWebView.m in Sources */,\n\t\t\t\t83CBBA601A601EAA00E9B192 /* RCTBridge.m in Sources */,\n\t\t\t\tD4EEE2F8201DF63F00C4CBB6 /* RCTButtonManager.m in Sources */,\n\t\t\t\t590D7BFF1EBD458B00D8A370 /* RCTShadowView+Layout.m in Sources */,\n\t\t\t\t66CD94B31F1045E700CB3C7C /* RCTMaskedView.m in Sources */,\n\t\t\t\tD49593E1202C937C00A7694B /* RCTMenuManager.m in Sources */,\n\t\t\t\t13C156061AB1A2840079392D /* RCTWebViewManager.m in Sources */,\n\t\t\t\t58114A161AAE854800E7D092 /* RCTPicker.m in Sources */,\n\t\t\t\t83A1FE8C1B62640A00BE0E65 /* RCTModalHostView.m in Sources */,\n\t\t\t\t13E067551A70F44B002CDEE1 /* RCTShadowView.m in Sources */,\n\t\t\t\t9936F3371F5F2F480010BF04 /* PrivateDataBase.cpp in Sources */,\n\t\t\t\t1450FF871BCFF28A00208362 /* RCTProfileTrampoline-arm.S in Sources */,\n\t\t\t\t131B6AF51AF1093D00FFC3E0 /* RCTSegmentedControlManager.m in Sources */,\n\t\t\t\t58114A171AAE854800E7D092 /* RCTPickerManager.m in Sources */,\n\t\t\t\tD426ACD220D57659003B4C4D /* RCTAppearance.m in Sources */,\n\t\t\t\t657734911EE8354A00A0E9EA /* RCTInspectorPackagerConnection.m in Sources */,\n\t\t\t\t68EFE4EE1CF6EB3900A1DE13 /* RCTBundleURLProvider.m in Sources */,\n\t\t\t\tB95154321D1B34B200FE7B80 /* RCTActivityIndicatorView.m in Sources */,\n\t\t\t\t5960C1BB1F0804A00066FD5B /* RCTLayoutAnimationGroup.m in Sources */,\n\t\t\t\t13F17A851B8493E5007D4C75 /* RCTRedBox.m in Sources */,\n\t\t\t\t135A9BFC1E7B0EAE00587AEB /* RCTJSCErrorHandling.mm in Sources */,\n\t\t\t\t83392EB31B6634E10013B15F /* RCTModalHostViewController.m in Sources */,\n\t\t\t\t83CBBA691A601EF300E9B192 /* RCTEventDispatcher.m in Sources */,\n\t\t\t\t83A1FE8F1B62643A00BE0E65 /* RCTModalHostViewManager.m in Sources */,\n\t\t\t\t13E0674A1A70F434002CDEE1 /* RCTUIManager.m in Sources */,\n\t\t\t\t1384E2091E806D4E00545659 /* RCTNativeModule.mm in Sources */,\n\t\t\t\t391E86A41C623EC800009732 /* RCTTouchEvent.m in Sources */,\n\t\t\t\t1450FF861BCFF28A00208362 /* RCTProfile.m in Sources */,\n\t\t\t\t13AB90C11B6FA36700713B4F /* RCTComponentData.m in Sources */,\n\t\t\t\t916F9C2D1F743F57002E5920 /* RCTModalManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t9936F30A1F5F2E4B0010BF04 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t9936F33E1F5F2FFC0010BF04 /* PrivateDataBase.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t9936F3261F5F2E5B0010BF04 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t9936F33B1F5F2F9D0010BF04 /* PrivateDataBase.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tEBF21BD31FC498900052F4D5 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tEBF21BFC1FC4990B0052F4D5 /* InspectorInterfaces.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tEBF21BF11FC4989A0052F4D5 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tEBF21BFF1FC4998E0052F4D5 /* InspectorInterfaces.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t1320081B1E283DC300F0C457 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 139D7ECD1E25DB7D00323FB7 /* third-party */;\n\t\t\ttargetProxy = 1320081A1E283DC300F0C457 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1320081D1E283DCB00F0C457 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 139D7E871E25C6D100323FB7 /* double-conversion */;\n\t\t\ttargetProxy = 1320081C1E283DCB00F0C457 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D0574551DE5FF9600184BB4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3C059B1DE3340C00C268FA /* yoga-tvOS */;\n\t\t\ttargetProxy = 3D0574541DE5FF9600184BB4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D0574571DE5FF9600184BB4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3CD9261DE5FBEE00167DC4 /* cxxreact-tvOS */;\n\t\t\ttargetProxy = 3D0574561DE5FF9600184BB4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D383D641EBD27CE005632C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D383D211EBD27B6005632C8 /* third-party-tvOS */;\n\t\t\ttargetProxy = 3D383D631EBD27CE005632C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D383D661EBD27DB005632C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D383D3D1EBD27B9005632C8 /* double-conversion-tvOS */;\n\t\t\ttargetProxy = 3D383D651EBD27DB005632C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D3CD94C1DE5FCE700167DC4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3CD9191DE5FBEC00167DC4 /* cxxreact */;\n\t\t\ttargetProxy = 3D3CD94B1DE5FCE700167DC4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D3CD9501DE5FDB900167DC4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3CD8FF1DE5FBD600167DC4 /* jschelpers */;\n\t\t\ttargetProxy = 3D3CD94F1DE5FDB900167DC4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3DC159E81E83E2A0007B1282 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3CD90C1DE5FBD800167DC4 /* jschelpers-tvOS */;\n\t\t\ttargetProxy = 3DC159E71E83E2A0007B1282 /* PBXContainerItemProxy */;\n\t\t};\n\t\t53D123991FBF1E0C001B8A10 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3C04B91DE3340900C268FA /* yoga */;\n\t\t\ttargetProxy = 53D123981FBF1E0C001B8A10 /* PBXContainerItemProxy */;\n\t\t};\n\t\t9936F3401F5F305D0010BF04 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 9936F2F81F5F2E4B0010BF04 /* privatedata */;\n\t\t\ttargetProxy = 9936F33F1F5F305D0010BF04 /* PBXContainerItemProxy */;\n\t\t};\n\t\t9936F3421F5F30640010BF04 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 9936F3141F5F2E5B0010BF04 /* privatedata-tvOS */;\n\t\t\ttargetProxy = 9936F3411F5F30640010BF04 /* PBXContainerItemProxy */;\n\t\t};\n\t\t9936F3441F5F30780010BF04 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 9936F2F81F5F2E4B0010BF04 /* privatedata */;\n\t\t\ttargetProxy = 9936F3431F5F30780010BF04 /* PBXContainerItemProxy */;\n\t\t};\n\t\t9936F3461F5F30830010BF04 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 9936F3141F5F2E5B0010BF04 /* privatedata-tvOS */;\n\t\t\ttargetProxy = 9936F3451F5F30830010BF04 /* PBXContainerItemProxy */;\n\t\t};\n\t\tEBF21C021FC499D10052F4D5 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = EBF21BBF1FC498900052F4D5 /* jsinspector */;\n\t\t\ttargetProxy = EBF21C011FC499D10052F4D5 /* PBXContainerItemProxy */;\n\t\t};\n\t\tEBF21C041FC499D80052F4D5 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = EBF21BDD1FC4989A0052F4D5 /* jsinspector-tvOS */;\n\t\t\ttargetProxy = EBF21C031FC499D80052F4D5 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin XCBuildConfiguration section */\n\t\t139D7E8F1E25C6D100323FB7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tDEVELOPMENT_TEAM = V9WTTPBFK9;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRIVATE_HEADERS_FOLDER_PATH = \"/usr/local/include/double-conversion\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t139D7E901E25C6D100323FB7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tDEVELOPMENT_TEAM = V9WTTPBFK9;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRIVATE_HEADERS_FOLDER_PATH = \"/usr/local/include/double-conversion\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t139D7ED51E25DB7D00323FB7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tDEVELOPMENT_TEAM = V9WTTPBFK9;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_CPLUSPLUSFLAGS = \"$(OTHER_CFLAGS)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t139D7ED61E25DB7D00323FB7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tDEVELOPMENT_TEAM = V9WTTPBFK9;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_CPLUSPLUSFLAGS = \"$(OTHER_CFLAGS)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t2D2A28191D9B038B00D4039D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = React;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/React;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D2A281A1D9B038B00D4039D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = React;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/React;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D383D3A1EBD27B6005632C8 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tDEVELOPMENT_TEAM = V9WTTPBFK9;\n\t\t\t\tOTHER_CPLUSPLUSFLAGS = \"$(OTHER_CFLAGS)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"third-party\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D383D3B1EBD27B6005632C8 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tDEVELOPMENT_TEAM = V9WTTPBFK9;\n\t\t\t\tOTHER_CPLUSPLUSFLAGS = \"$(OTHER_CFLAGS)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"third-party\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D383D601EBD27B9005632C8 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tDEVELOPMENT_TEAM = V9WTTPBFK9;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRIVATE_HEADERS_FOLDER_PATH = \"/usr/local/include/double-conversion\";\n\t\t\t\tPRODUCT_NAME = \"double-conversion\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D383D611EBD27B9005632C8 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tDEVELOPMENT_TEAM = V9WTTPBFK9;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRIVATE_HEADERS_FOLDER_PATH = \"/usr/local/include/double-conversion\";\n\t\t\t\tPRODUCT_NAME = \"double-conversion\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3C05981DE3340900C268FA /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/yoga;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3C05991DE3340900C268FA /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/yoga;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3C06731DE3340C00C268FA /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = yoga;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/yoga;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3C06741DE3340C00C268FA /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = yoga;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/yoga;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3CD9091DE5FBD600167DC4 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3CD90A1DE5FBD600167DC4 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3CD9161DE5FBD800167DC4 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = jschelpers;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3CD9171DE5FBD800167DC4 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = jschelpers;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3CD9231DE5FBEC00167DC4 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3CD9241DE5FBEC00167DC4 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3CD9301DE5FBEE00167DC4 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = cxxreact;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3CD9311DE5FBEE00167DC4 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = cxxreact;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA201A601CBA00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"RCT_DEBUG=1\",\n\t\t\t\t\t\"RCT_DEV=1\",\n\t\t\t\t\t\"RCT_NSASSERT=1\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Wextra\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t\t\"-Wno-semicolon-before-method-body\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA211A601CBA00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"\";\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Wextra\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t\t\"-Wno-semicolon-before-method-body\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA401A601D0F00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/React;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA411A601D0F00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/React;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t9936F3111F5F2E4B0010BF04 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/privatedata;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t9936F3121F5F2E4B0010BF04 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/privatedata;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t9936F32D1F5F2E5B0010BF04 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/privatedata;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t9936F32E1F5F2E5B0010BF04 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/privatedata;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tEBF21BDA1FC498900052F4D5 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jsinspector;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tEBF21BDB1FC498900052F4D5 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jsinspector;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tEBF21BF81FC4989A0052F4D5 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jsinspector;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tEBF21BF91FC4989A0052F4D5 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3D788F841EBD2D240063D616 /* third-party.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jsinspector;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t139D7E8E1E25C6D100323FB7 /* Build configuration list for PBXNativeTarget \"double-conversion\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t139D7E8F1E25C6D100323FB7 /* Debug */,\n\t\t\t\t139D7E901E25C6D100323FB7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t139D7ED41E25DB7D00323FB7 /* Build configuration list for PBXNativeTarget \"third-party\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t139D7ED51E25DB7D00323FB7 /* Debug */,\n\t\t\t\t139D7ED61E25DB7D00323FB7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t2D2A281B1D9B038B00D4039D /* Build configuration list for PBXNativeTarget \"React-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D2A28191D9B038B00D4039D /* Debug */,\n\t\t\t\t2D2A281A1D9B038B00D4039D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D383D391EBD27B6005632C8 /* Build configuration list for PBXNativeTarget \"third-party-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D383D3A1EBD27B6005632C8 /* Debug */,\n\t\t\t\t3D383D3B1EBD27B6005632C8 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D383D5F1EBD27B9005632C8 /* Build configuration list for PBXNativeTarget \"double-conversion-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D383D601EBD27B9005632C8 /* Debug */,\n\t\t\t\t3D383D611EBD27B9005632C8 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3C05971DE3340900C268FA /* Build configuration list for PBXNativeTarget \"yoga\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3C05981DE3340900C268FA /* Debug */,\n\t\t\t\t3D3C05991DE3340900C268FA /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3C06721DE3340C00C268FA /* Build configuration list for PBXNativeTarget \"yoga-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3C06731DE3340C00C268FA /* Debug */,\n\t\t\t\t3D3C06741DE3340C00C268FA /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3CD9081DE5FBD600167DC4 /* Build configuration list for PBXNativeTarget \"jschelpers\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3CD9091DE5FBD600167DC4 /* Debug */,\n\t\t\t\t3D3CD90A1DE5FBD600167DC4 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3CD9151DE5FBD800167DC4 /* Build configuration list for PBXNativeTarget \"jschelpers-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3CD9161DE5FBD800167DC4 /* Debug */,\n\t\t\t\t3D3CD9171DE5FBD800167DC4 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3CD9221DE5FBEC00167DC4 /* Build configuration list for PBXNativeTarget \"cxxreact\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3CD9231DE5FBEC00167DC4 /* Debug */,\n\t\t\t\t3D3CD9241DE5FBEC00167DC4 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3CD92F1DE5FBEE00167DC4 /* Build configuration list for PBXNativeTarget \"cxxreact-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3CD9301DE5FBEE00167DC4 /* Debug */,\n\t\t\t\t3D3CD9311DE5FBEE00167DC4 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"React\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA201A601CBA00E9B192 /* Debug */,\n\t\t\t\t83CBBA211A601CBA00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBBA3F1A601D0F00E9B192 /* Build configuration list for PBXNativeTarget \"React\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA401A601D0F00E9B192 /* Debug */,\n\t\t\t\t83CBBA411A601D0F00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t9936F3101F5F2E4B0010BF04 /* Build configuration list for PBXNativeTarget \"privatedata\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t9936F3111F5F2E4B0010BF04 /* Debug */,\n\t\t\t\t9936F3121F5F2E4B0010BF04 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t9936F32C1F5F2E5B0010BF04 /* Build configuration list for PBXNativeTarget \"privatedata-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t9936F32D1F5F2E5B0010BF04 /* Debug */,\n\t\t\t\t9936F32E1F5F2E5B0010BF04 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tEBF21BD91FC498900052F4D5 /* Build configuration list for PBXNativeTarget \"jsinspector\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tEBF21BDA1FC498900052F4D5 /* Debug */,\n\t\t\t\tEBF21BDB1FC498900052F4D5 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tEBF21BF71FC4989A0052F4D5 /* Build configuration list for PBXNativeTarget \"jsinspector-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tEBF21BF81FC4989A0052F4D5 /* Debug */,\n\t\t\t\tEBF21BF91FC4989A0052F4D5 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;\n}\n"
  },
  {
    "path": "React/ReactLegacy.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t000E6CEB1AB0E980000CDF4D /* RCTSourceCode.m in Sources */ = {isa = PBXBuildFile; fileRef = 000E6CEA1AB0E980000CDF4D /* RCTSourceCode.m */; };\n\t\t001BFCD01D8381DE008E587E /* RCTMultipartStreamReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */; };\n\t\t006FC4141D9B20820057AAAD /* RCTMultipartDataTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 006FC4131D9B20820057AAAD /* RCTMultipartDataTask.m */; };\n\t\t008341F61D1DB34400876D9A /* RCTJSStackFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 008341F41D1DB34400876D9A /* RCTJSStackFrame.m */; };\n\t\t131B6AF41AF1093D00FFC3E0 /* RCTSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 131B6AF11AF1093D00FFC3E0 /* RCTSegmentedControl.m */; };\n\t\t131B6AF51AF1093D00FFC3E0 /* RCTSegmentedControlManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 131B6AF31AF1093D00FFC3E0 /* RCTSegmentedControlManager.m */; };\n\t\t133957881DF76D3500EC27BE /* YGEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77031DF767AF001F9587 /* YGEnums.h */; };\n\t\t133957891DF76D3500EC27BE /* YGMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77041DF767AF001F9587 /* YGMacros.h */; };\n\t\t1339578B1DF76D3500EC27BE /* Yoga.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77081DF767AF001F9587 /* Yoga.h */; };\n\t\t133CAE8E1B8E5CFD00F6AD92 /* RCTDatePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 133CAE8D1B8E5CFD00F6AD92 /* RCTDatePicker.m */; };\n\t\t13456E931ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */; };\n\t\t134FCB3D1A6E7F0800051CC8 /* RCTJSCExecutor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 134FCB3A1A6E7F0800051CC8 /* RCTJSCExecutor.mm */; };\n\t\t13513F3C1B1F43F400FCE529 /* RCTProgressViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */; };\n\t\t13723B501A82FD3C00F88898 /* RCTStatusBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */; };\n\t\t1372B70A1AB030C200659ED6 /* RCTAppState.m in Sources */ = {isa = PBXBuildFile; fileRef = 1372B7091AB030C200659ED6 /* RCTAppState.m */; };\n\t\t137327E71AA5CF210034F82E /* RCTTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E01AA5CF210034F82E /* RCTTabBar.m */; };\n\t\t137327E81AA5CF210034F82E /* RCTTabBarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E21AA5CF210034F82E /* RCTTabBarItem.m */; };\n\t\t137327E91AA5CF210034F82E /* RCTTabBarItemManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E41AA5CF210034F82E /* RCTTabBarItemManager.m */; };\n\t\t137327EA1AA5CF210034F82E /* RCTTabBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E61AA5CF210034F82E /* RCTTabBarManager.m */; };\n\t\t139324FE1E70B069009FD7E0 /* RCTJSCErrorHandling.h in Headers */ = {isa = PBXBuildFile; fileRef = 139324FC1E70B069009FD7E0 /* RCTJSCErrorHandling.h */; };\n\t\t139324FF1E70B069009FD7E0 /* RCTJSCErrorHandling.mm in Sources */ = {isa = PBXBuildFile; fileRef = 139324FD1E70B069009FD7E0 /* RCTJSCErrorHandling.mm */; };\n\t\t13A0C2891B74F71200B29F6F /* RCTDevLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A0C2861B74F71200B29F6F /* RCTDevLoadingView.m */; };\n\t\t13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */; };\n\t\t13A6E20E1C19AA0C00845B82 /* RCTParserUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A6E20D1C19AA0C00845B82 /* RCTParserUtils.m */; };\n\t\t13AB90C11B6FA36700713B4F /* RCTComponentData.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AB90C01B6FA36700713B4F /* RCTComponentData.m */; };\n\t\t13AF20451AE707F9005F5298 /* RCTSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AF20441AE707F9005F5298 /* RCTSlider.m */; };\n\t\t13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */; };\n\t\t13B07FF01A69327A00A75B9A /* RCTExceptionsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */; };\n\t\t13B07FF21A69327A00A75B9A /* RCTTiming.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEE1A69327A00A75B9A /* RCTTiming.m */; };\n\t\t13B0801A1A69489C00A75B9A /* RCTNavigator.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B0800D1A69489C00A75B9A /* RCTNavigator.m */; };\n\t\t13B0801B1A69489C00A75B9A /* RCTNavigatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B0800F1A69489C00A75B9A /* RCTNavigatorManager.m */; };\n\t\t13B0801C1A69489C00A75B9A /* RCTNavItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080111A69489C00A75B9A /* RCTNavItem.m */; };\n\t\t13B0801D1A69489C00A75B9A /* RCTNavItemManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080131A69489C00A75B9A /* RCTNavItemManager.m */; };\n\t\t13B080201A69489C00A75B9A /* RCTActivityIndicatorViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */; };\n\t\t13B080261A694A8400A75B9A /* RCTWrapperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080241A694A8400A75B9A /* RCTWrapperViewController.m */; };\n\t\t13BB3D021BECD54500932C10 /* RCTImageSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BB3D011BECD54500932C10 /* RCTImageSource.m */; };\n\t\t13BCE8091C99CB9D00DD7AAD /* RCTRootShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BCE8081C99CB9D00DD7AAD /* RCTRootShadowView.m */; };\n\t\t13C156051AB1A2840079392D /* RCTWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13C156021AB1A2840079392D /* RCTWebView.m */; };\n\t\t13C156061AB1A2840079392D /* RCTWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13C156041AB1A2840079392D /* RCTWebViewManager.m */; };\n\t\t13CC8A821B17642100940AE7 /* RCTBorderDrawing.m in Sources */ = {isa = PBXBuildFile; fileRef = 13CC8A811B17642100940AE7 /* RCTBorderDrawing.m */; };\n\t\t13D033631C1837FE0021DC29 /* RCTClipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D033621C1837FE0021DC29 /* RCTClipboard.m */; };\n\t\t13D9FEEB1CDCCECF00158BD7 /* RCTEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */; };\n\t\t13D9FEEE1CDCD93000158BD7 /* RCTKeyboardObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D9FEED1CDCD93000158BD7 /* RCTKeyboardObserver.m */; };\n\t\t13E0674A1A70F434002CDEE1 /* RCTUIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067491A70F434002CDEE1 /* RCTUIManager.m */; };\n\t\t13E067551A70F44B002CDEE1 /* RCTShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */; };\n\t\t13E067561A70F44B002CDEE1 /* RCTViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */; };\n\t\t13E067571A70F44B002CDEE1 /* RCTView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067501A70F44B002CDEE1 /* RCTView.m */; };\n\t\t13E067591A70F44B002CDEE1 /* UIView+React.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067541A70F44B002CDEE1 /* UIView+React.m */; };\n\t\t13E41EEB1C05CA0B00CD8DAC /* RCTProfileTrampoline-i386.S in Sources */ = {isa = PBXBuildFile; fileRef = 14BF717F1C04793D00C97D0C /* RCTProfileTrampoline-i386.S */; };\n\t\t13F17A851B8493E5007D4C75 /* RCTRedBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 13F17A841B8493E5007D4C75 /* RCTRedBox.m */; };\n\t\t142014191B32094000CC17BA /* RCTPerformanceLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 142014171B32094000CC17BA /* RCTPerformanceLogger.m */; };\n\t\t1450FF861BCFF28A00208362 /* RCTProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF811BCFF28A00208362 /* RCTProfile.m */; };\n\t\t1450FF871BCFF28A00208362 /* RCTProfileTrampoline-arm.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF821BCFF28A00208362 /* RCTProfileTrampoline-arm.S */; };\n\t\t1450FF881BCFF28A00208362 /* RCTProfileTrampoline-arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF831BCFF28A00208362 /* RCTProfileTrampoline-arm64.S */; };\n\t\t1450FF8A1BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF851BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S */; };\n\t\t14C2CA741B3AC64300E6CBB2 /* RCTModuleData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 14C2CA731B3AC64300E6CBB2 /* RCTModuleData.mm */; };\n\t\t14C2CA761B3AC64F00E6CBB2 /* RCTFrameUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C2CA751B3AC64F00E6CBB2 /* RCTFrameUpdate.m */; };\n\t\t14C2CA781B3ACB0400E6CBB2 /* RCTBatchedBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 14C2CA771B3ACB0400E6CBB2 /* RCTBatchedBridge.mm */; };\n\t\t14F3620D1AABD06A001CE568 /* RCTSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F362081AABD06A001CE568 /* RCTSwitch.m */; };\n\t\t14F3620E1AABD06A001CE568 /* RCTSwitchManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */; };\n\t\t14F484561AABFCE100FDF6B9 /* RCTSliderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */; };\n\t\t14F7A0EC1BDA3B3C003C6C10 /* RCTPerfMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F7A0EB1BDA3B3C003C6C10 /* RCTPerfMonitor.m */; };\n\t\t14F7A0F01BDA714B003C6C10 /* RCTFPSGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F7A0EF1BDA714B003C6C10 /* RCTFPSGraph.m */; };\n\t\t191E3EBE1C29D9AF00C180A6 /* RCTRefreshControlManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 191E3EBD1C29D9AF00C180A6 /* RCTRefreshControlManager.m */; };\n\t\t191E3EC11C29DC3800C180A6 /* RCTRefreshControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 191E3EC01C29DC3800C180A6 /* RCTRefreshControl.m */; };\n\t\t2638623A1E732AB60010FEBF /* systemJSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65F3E41D1E73031C009375BD /* systemJSCWrapper.cpp */; };\n\t\t2638623B1E732AB70010FEBF /* systemJSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65F3E41D1E73031C009375BD /* systemJSCWrapper.cpp */; };\n\t\t2D074E381E609E65001D6DD0 /* RCTReconnectingWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = A12E9E281E5DEB860029001B /* RCTReconnectingWebSocket.h */; };\n\t\t2D074E391E609E68001D6DD0 /* RCTSRWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = A12E9E291E5DEB860029001B /* RCTSRWebSocket.h */; };\n\t\t2D3B5E931D9B087300451313 /* RCTErrorInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */; };\n\t\t2D3B5E941D9B087900451313 /* RCTBundleURLProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */; };\n\t\t2D3B5E951D9B087C00451313 /* RCTAssert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */; };\n\t\t2D3B5E961D9B088500451313 /* RCTBatchedBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 14C2CA771B3ACB0400E6CBB2 /* RCTBatchedBridge.mm */; };\n\t\t2D3B5E971D9B089000451313 /* RCTBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA5F1A601EAA00E9B192 /* RCTBridge.m */; };\n\t\t2D3B5E981D9B089500451313 /* RCTConvert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBACB1A6023D300E9B192 /* RCTConvert.m */; };\n\t\t2D3B5E991D9B089A00451313 /* RCTDisplayLink.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */; };\n\t\t2D3B5E9A1D9B089D00451313 /* RCTEventDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */; };\n\t\t2D3B5E9B1D9B08A000451313 /* RCTFrameUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C2CA751B3AC64F00E6CBB2 /* RCTFrameUpdate.m */; };\n\t\t2D3B5E9C1D9B08A300451313 /* RCTImageSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BB3D011BECD54500932C10 /* RCTImageSource.m */; };\n\t\t2D3B5E9E1D9B08AD00451313 /* RCTJSStackFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 008341F41D1DB34400876D9A /* RCTJSStackFrame.m */; };\n\t\t2D3B5E9F1D9B08AF00451313 /* RCTKeyCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */; };\n\t\t2D3B5EA01D9B08B200451313 /* RCTLog.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4E1A601E3B00E9B192 /* RCTLog.mm */; };\n\t\t2D3B5EA11D9B08B600451313 /* RCTModuleData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 14C2CA731B3AC64300E6CBB2 /* RCTModuleData.mm */; };\n\t\t2D3B5EA31D9B08BE00451313 /* RCTParserUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A6E20D1C19AA0C00845B82 /* RCTParserUtils.m */; };\n\t\t2D3B5EA41D9B08C200451313 /* RCTPerformanceLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 142014171B32094000CC17BA /* RCTPerformanceLogger.m */; };\n\t\t2D3B5EA51D9B08C700451313 /* RCTRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 830A229D1A66C68A008503DA /* RCTRootView.m */; };\n\t\t2D3B5EA61D9B08CA00451313 /* RCTTouchEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 391E86A21C623EC800009732 /* RCTTouchEvent.m */; };\n\t\t2D3B5EA71D9B08CE00451313 /* RCTTouchHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */; };\n\t\t2D3B5EA81D9B08D300451313 /* RCTUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA501A601E3B00E9B192 /* RCTUtils.m */; };\n\t\t2D3B5EAC1D9B08EF00451313 /* RCTJSCExecutor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 134FCB3A1A6E7F0800051CC8 /* RCTJSCExecutor.mm */; };\n\t\t2D3B5EAE1D9B08F800451313 /* RCTEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */; };\n\t\t2D3B5EAF1D9B08FB00451313 /* RCTAccessibilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E9B20B7A1B500126007A2DA7 /* RCTAccessibilityManager.m */; };\n\t\t2D3B5EB01D9B08FE00451313 /* RCTAlertManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */; };\n\t\t2D3B5EB11D9B090100451313 /* RCTAppState.m in Sources */ = {isa = PBXBuildFile; fileRef = 1372B7091AB030C200659ED6 /* RCTAppState.m */; };\n\t\t2D3B5EB21D9B090300451313 /* RCTAsyncLocalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A4E1AAE93D500E7D092 /* RCTAsyncLocalStorage.m */; };\n\t\t2D3B5EB41D9B090A00451313 /* RCTDevLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A0C2861B74F71200B29F6F /* RCTDevLoadingView.m */; };\n\t\t2D3B5EB61D9B091400451313 /* RCTExceptionsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */; };\n\t\t2D3B5EB71D9B091800451313 /* RCTRedBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 13F17A841B8493E5007D4C75 /* RCTRedBox.m */; };\n\t\t2D3B5EB81D9B091B00451313 /* RCTSourceCode.m in Sources */ = {isa = PBXBuildFile; fileRef = 000E6CEA1AB0E980000CDF4D /* RCTSourceCode.m */; };\n\t\t2D3B5EBA1D9B092100451313 /* RCTI18nUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */; };\n\t\t2D3B5EBB1D9B092300451313 /* RCTI18nManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B233E6E91D2D845D00BC68BA /* RCTI18nManager.m */; };\n\t\t2D3B5EBC1D9B092600451313 /* RCTKeyboardObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D9FEED1CDCD93000158BD7 /* RCTKeyboardObserver.m */; };\n\t\t2D3B5EBD1D9B092A00451313 /* RCTTiming.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEE1A69327A00A75B9A /* RCTTiming.m */; };\n\t\t2D3B5EBE1D9B092D00451313 /* RCTUIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067491A70F434002CDEE1 /* RCTUIManager.m */; };\n\t\t2D3B5EC01D9B093600451313 /* RCTPerfMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F7A0EB1BDA3B3C003C6C10 /* RCTPerfMonitor.m */; };\n\t\t2D3B5EC11D9B093900451313 /* RCTFPSGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F7A0EF1BDA714B003C6C10 /* RCTFPSGraph.m */; };\n\t\t2D3B5EC21D9B093B00451313 /* RCTProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF811BCFF28A00208362 /* RCTProfile.m */; };\n\t\t2D3B5EC31D9B094800451313 /* RCTProfileTrampoline-arm.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF821BCFF28A00208362 /* RCTProfileTrampoline-arm.S */; };\n\t\t2D3B5EC41D9B094B00451313 /* RCTProfileTrampoline-arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF831BCFF28A00208362 /* RCTProfileTrampoline-arm64.S */; };\n\t\t2D3B5EC51D9B094D00451313 /* RCTProfileTrampoline-i386.S in Sources */ = {isa = PBXBuildFile; fileRef = 14BF717F1C04793D00C97D0C /* RCTProfileTrampoline-i386.S */; };\n\t\t2D3B5EC61D9B095000451313 /* RCTProfileTrampoline-x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF851BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S */; };\n\t\t2D3B5EC71D9B095600451313 /* RCTActivityIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = B95154311D1B34B200FE7B80 /* RCTActivityIndicatorView.m */; };\n\t\t2D3B5EC81D9B095800451313 /* RCTActivityIndicatorViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */; };\n\t\t2D3B5EC91D9B095C00451313 /* RCTBorderDrawing.m in Sources */ = {isa = PBXBuildFile; fileRef = 13CC8A811B17642100940AE7 /* RCTBorderDrawing.m */; };\n\t\t2D3B5ECA1D9B095F00451313 /* RCTComponentData.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AB90C01B6FA36700713B4F /* RCTComponentData.m */; };\n\t\t2D3B5ECB1D9B096200451313 /* RCTConvert+CoreLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */; };\n\t\t2D3B5ECF1D9B096F00451313 /* RCTFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D37B5811D522B190042D5B5 /* RCTFont.mm */; };\n\t\t2D3B5ED41D9B097D00451313 /* RCTModalHostView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */; };\n\t\t2D3B5ED51D9B098000451313 /* RCTModalHostViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83392EB21B6634E10013B15F /* RCTModalHostViewController.m */; };\n\t\t2D3B5ED61D9B098400451313 /* RCTModalHostViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A1FE8E1B62643A00BE0E65 /* RCTModalHostViewManager.m */; };\n\t\t2D3B5ED71D9B098700451313 /* RCTNavigator.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B0800D1A69489C00A75B9A /* RCTNavigator.m */; };\n\t\t2D3B5ED81D9B098A00451313 /* RCTNavigatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B0800F1A69489C00A75B9A /* RCTNavigatorManager.m */; };\n\t\t2D3B5ED91D9B098E00451313 /* RCTNavItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080111A69489C00A75B9A /* RCTNavItem.m */; };\n\t\t2D3B5EDA1D9B099100451313 /* RCTNavItemManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080131A69489C00A75B9A /* RCTNavItemManager.m */; };\n\t\t2D3B5EDD1D9B09A300451313 /* RCTProgressViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */; };\n\t\t2D3B5EE01D9B09AD00451313 /* RCTRootShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BCE8081C99CB9D00DD7AAD /* RCTRootShadowView.m */; };\n\t\t2D3B5EE31D9B09B700451313 /* RCTSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 131B6AF11AF1093D00FFC3E0 /* RCTSegmentedControl.m */; };\n\t\t2D3B5EE41D9B09BB00451313 /* RCTSegmentedControlManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 131B6AF31AF1093D00FFC3E0 /* RCTSegmentedControlManager.m */; };\n\t\t2D3B5EE51D9B09BE00451313 /* RCTShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */; };\n\t\t2D3B5EEA1D9B09CD00451313 /* RCTTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E01AA5CF210034F82E /* RCTTabBar.m */; };\n\t\t2D3B5EEB1D9B09D000451313 /* RCTTabBarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E21AA5CF210034F82E /* RCTTabBarItem.m */; };\n\t\t2D3B5EEC1D9B09D400451313 /* RCTTabBarItemManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E41AA5CF210034F82E /* RCTTabBarItemManager.m */; };\n\t\t2D3B5EED1D9B09D700451313 /* RCTTabBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E61AA5CF210034F82E /* RCTTabBarManager.m */; };\n\t\t2D3B5EEE1D9B09DA00451313 /* RCTView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067501A70F44B002CDEE1 /* RCTView.m */; };\n\t\t2D3B5EEF1D9B09DC00451313 /* RCTViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */; };\n\t\t2D3B5EF01D9B09E300451313 /* RCTWrapperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080241A694A8400A75B9A /* RCTWrapperViewController.m */; };\n\t\t2D3B5EF11D9B09E700451313 /* UIView+React.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067541A70F44B002CDEE1 /* UIView+React.m */; };\n\t\t2D74EAFA1DAE9590003B751B /* RCTMultipartDataTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 006FC4131D9B20820057AAAD /* RCTMultipartDataTask.m */; };\n\t\t2D7B05391E9D82080032604E /* RCTBridge+Private.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */; };\n\t\t2D7FEB891E734B5700D3238C /* systemJSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65F3E41D1E73031C009375BD /* systemJSCWrapper.cpp */; };\n\t\t2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */; };\n\t\t2DD0EFE11DA84F2800B0C975 /* RCTStatusBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */; };\n\t\t352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */; };\n\t\t369123E11DDC75850095B341 /* RCTJSCSamplingProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 369123E01DDC75850095B341 /* RCTJSCSamplingProfiler.m */; };\n\t\t391E86A41C623EC800009732 /* RCTTouchEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 391E86A21C623EC800009732 /* RCTTouchEvent.m */; };\n\t\t3D03BC191FEAA2AE008D5730 /* RCTScrollableProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC0E1FEAA2AD008D5730 /* RCTScrollableProtocol.h */; };\n\t\t3D03BC1A1FEAA2AE008D5730 /* RCTScrollableProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC0E1FEAA2AD008D5730 /* RCTScrollableProtocol.h */; };\n\t\t3D03BC1B1FEAA2AE008D5730 /* RCTScrollContentShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC0F1FEAA2AD008D5730 /* RCTScrollContentShadowView.h */; };\n\t\t3D03BC1C1FEAA2AE008D5730 /* RCTScrollContentShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC0F1FEAA2AD008D5730 /* RCTScrollContentShadowView.h */; };\n\t\t3D03BC1D1FEAA2AE008D5730 /* RCTScrollContentShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC101FEAA2AD008D5730 /* RCTScrollContentShadowView.m */; };\n\t\t3D03BC1E1FEAA2AE008D5730 /* RCTScrollContentShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC101FEAA2AD008D5730 /* RCTScrollContentShadowView.m */; };\n\t\t3D03BC1F1FEAA2AE008D5730 /* RCTScrollContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC111FEAA2AD008D5730 /* RCTScrollContentView.h */; };\n\t\t3D03BC201FEAA2AE008D5730 /* RCTScrollContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC111FEAA2AD008D5730 /* RCTScrollContentView.h */; };\n\t\t3D03BC211FEAA2AE008D5730 /* RCTScrollContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC121FEAA2AD008D5730 /* RCTScrollContentView.m */; };\n\t\t3D03BC221FEAA2AE008D5730 /* RCTScrollContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC121FEAA2AD008D5730 /* RCTScrollContentView.m */; };\n\t\t3D03BC231FEAA2AE008D5730 /* RCTScrollContentViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC131FEAA2AD008D5730 /* RCTScrollContentViewManager.h */; };\n\t\t3D03BC241FEAA2AE008D5730 /* RCTScrollContentViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC131FEAA2AD008D5730 /* RCTScrollContentViewManager.h */; };\n\t\t3D03BC251FEAA2AE008D5730 /* RCTScrollContentViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC141FEAA2AD008D5730 /* RCTScrollContentViewManager.m */; };\n\t\t3D03BC261FEAA2AE008D5730 /* RCTScrollContentViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC141FEAA2AD008D5730 /* RCTScrollContentViewManager.m */; };\n\t\t3D03BC271FEAA2AE008D5730 /* RCTScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC151FEAA2AD008D5730 /* RCTScrollView.h */; };\n\t\t3D03BC281FEAA2AE008D5730 /* RCTScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC151FEAA2AD008D5730 /* RCTScrollView.h */; };\n\t\t3D03BC291FEAA2AE008D5730 /* RCTScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC161FEAA2AD008D5730 /* RCTScrollView.m */; };\n\t\t3D03BC2A1FEAA2AE008D5730 /* RCTScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC161FEAA2AD008D5730 /* RCTScrollView.m */; };\n\t\t3D03BC2B1FEAA2AE008D5730 /* RCTScrollViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC171FEAA2AD008D5730 /* RCTScrollViewManager.h */; };\n\t\t3D03BC2C1FEAA2AE008D5730 /* RCTScrollViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC171FEAA2AD008D5730 /* RCTScrollViewManager.h */; };\n\t\t3D03BC2D1FEAA2AE008D5730 /* RCTScrollViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC181FEAA2AD008D5730 /* RCTScrollViewManager.m */; };\n\t\t3D03BC2E1FEAA2AE008D5730 /* RCTScrollViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC181FEAA2AD008D5730 /* RCTScrollViewManager.m */; };\n\t\t3D03BC301FEAA384008D5730 /* RCTVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC2F1FEAA382008D5730 /* RCTVersion.h */; };\n\t\t3D03BC311FEAA384008D5730 /* RCTVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC2F1FEAA382008D5730 /* RCTVersion.h */; };\n\t\t3D03BC441FEAA38A008D5730 /* RCTSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC331FEAA38A008D5730 /* RCTSurface.h */; };\n\t\t3D03BC451FEAA38A008D5730 /* RCTSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC331FEAA38A008D5730 /* RCTSurface.h */; };\n\t\t3D03BC461FEAA38A008D5730 /* RCTSurface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC341FEAA38A008D5730 /* RCTSurface.mm */; };\n\t\t3D03BC471FEAA38A008D5730 /* RCTSurface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC341FEAA38A008D5730 /* RCTSurface.mm */; };\n\t\t3D03BC481FEAA38A008D5730 /* RCTSurfaceDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC351FEAA38A008D5730 /* RCTSurfaceDelegate.h */; };\n\t\t3D03BC491FEAA38A008D5730 /* RCTSurfaceDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC351FEAA38A008D5730 /* RCTSurfaceDelegate.h */; };\n\t\t3D03BC4A1FEAA38A008D5730 /* RCTSurfaceRootShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC361FEAA38A008D5730 /* RCTSurfaceRootShadowView.h */; };\n\t\t3D03BC4B1FEAA38A008D5730 /* RCTSurfaceRootShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC361FEAA38A008D5730 /* RCTSurfaceRootShadowView.h */; };\n\t\t3D03BC4C1FEAA38A008D5730 /* RCTSurfaceRootShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC371FEAA38A008D5730 /* RCTSurfaceRootShadowView.m */; };\n\t\t3D03BC4D1FEAA38A008D5730 /* RCTSurfaceRootShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC371FEAA38A008D5730 /* RCTSurfaceRootShadowView.m */; };\n\t\t3D03BC4E1FEAA38A008D5730 /* RCTSurfaceRootShadowViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC381FEAA38A008D5730 /* RCTSurfaceRootShadowViewDelegate.h */; };\n\t\t3D03BC4F1FEAA38A008D5730 /* RCTSurfaceRootShadowViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC381FEAA38A008D5730 /* RCTSurfaceRootShadowViewDelegate.h */; };\n\t\t3D03BC501FEAA38A008D5730 /* RCTSurfaceRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC391FEAA38A008D5730 /* RCTSurfaceRootView.h */; };\n\t\t3D03BC511FEAA38A008D5730 /* RCTSurfaceRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC391FEAA38A008D5730 /* RCTSurfaceRootView.h */; };\n\t\t3D03BC521FEAA38A008D5730 /* RCTSurfaceRootView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC3A1FEAA38A008D5730 /* RCTSurfaceRootView.mm */; };\n\t\t3D03BC531FEAA38A008D5730 /* RCTSurfaceRootView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC3A1FEAA38A008D5730 /* RCTSurfaceRootView.mm */; };\n\t\t3D03BC541FEAA38A008D5730 /* RCTSurfaceStage.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC3B1FEAA38A008D5730 /* RCTSurfaceStage.h */; };\n\t\t3D03BC551FEAA38A008D5730 /* RCTSurfaceStage.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC3B1FEAA38A008D5730 /* RCTSurfaceStage.h */; };\n\t\t3D03BC561FEAA38A008D5730 /* RCTSurfaceStage.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC3C1FEAA38A008D5730 /* RCTSurfaceStage.m */; };\n\t\t3D03BC571FEAA38A008D5730 /* RCTSurfaceStage.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC3C1FEAA38A008D5730 /* RCTSurfaceStage.m */; };\n\t\t3D03BC581FEAA38A008D5730 /* RCTSurfaceView+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC3D1FEAA38A008D5730 /* RCTSurfaceView+Internal.h */; };\n\t\t3D03BC591FEAA38A008D5730 /* RCTSurfaceView+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC3D1FEAA38A008D5730 /* RCTSurfaceView+Internal.h */; };\n\t\t3D03BC5A1FEAA38A008D5730 /* RCTSurfaceView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC3E1FEAA38A008D5730 /* RCTSurfaceView.h */; };\n\t\t3D03BC5B1FEAA38A008D5730 /* RCTSurfaceView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC3E1FEAA38A008D5730 /* RCTSurfaceView.h */; };\n\t\t3D03BC5C1FEAA38A008D5730 /* RCTSurfaceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC3F1FEAA38A008D5730 /* RCTSurfaceView.mm */; };\n\t\t3D03BC5D1FEAA38A008D5730 /* RCTSurfaceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC3F1FEAA38A008D5730 /* RCTSurfaceView.mm */; };\n\t\t3D03BC5E1FEAA38A008D5730 /* RCTSurfaceHostingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC411FEAA38A008D5730 /* RCTSurfaceHostingView.h */; };\n\t\t3D03BC5F1FEAA38A008D5730 /* RCTSurfaceHostingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC411FEAA38A008D5730 /* RCTSurfaceHostingView.h */; };\n\t\t3D03BC601FEAA38B008D5730 /* RCTSurfaceHostingView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC421FEAA38A008D5730 /* RCTSurfaceHostingView.mm */; };\n\t\t3D03BC611FEAA38B008D5730 /* RCTSurfaceHostingView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC421FEAA38A008D5730 /* RCTSurfaceHostingView.mm */; };\n\t\t3D03BC621FEAA38B008D5730 /* RCTSurfaceSizeMeasureMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC431FEAA38A008D5730 /* RCTSurfaceSizeMeasureMode.h */; };\n\t\t3D03BC631FEAA38B008D5730 /* RCTSurfaceSizeMeasureMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC431FEAA38A008D5730 /* RCTSurfaceSizeMeasureMode.h */; };\n\t\t3D03BC661FEAA456008D5730 /* YGNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC641FEAA454008D5730 /* YGNode.cpp */; };\n\t\t3D03BC671FEAA456008D5730 /* YGNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC641FEAA454008D5730 /* YGNode.cpp */; };\n\t\t3D03BC681FEAA456008D5730 /* YGNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC651FEAA456008D5730 /* YGNode.h */; };\n\t\t3D03BC691FEAA456008D5730 /* YGNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC651FEAA456008D5730 /* YGNode.h */; };\n\t\t3D03BC6C1FEAA48D008D5730 /* RCTRedBoxExtraDataViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC6A1FEAA48A008D5730 /* RCTRedBoxExtraDataViewController.m */; };\n\t\t3D03BC6D1FEAA48D008D5730 /* RCTRedBoxExtraDataViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC6A1FEAA48A008D5730 /* RCTRedBoxExtraDataViewController.m */; };\n\t\t3D03BC6E1FEAA48D008D5730 /* RCTRedBoxExtraDataViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC6B1FEAA48A008D5730 /* RCTRedBoxExtraDataViewController.h */; };\n\t\t3D03BC6F1FEAA48D008D5730 /* RCTRedBoxExtraDataViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC6B1FEAA48A008D5730 /* RCTRedBoxExtraDataViewController.h */; };\n\t\t3D03BC791FEAA5A6008D5730 /* RCTSafeAreaShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC711FEAA5A5008D5730 /* RCTSafeAreaShadowView.h */; };\n\t\t3D03BC7A1FEAA5A6008D5730 /* RCTSafeAreaShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC711FEAA5A5008D5730 /* RCTSafeAreaShadowView.h */; };\n\t\t3D03BC7B1FEAA5A6008D5730 /* RCTSafeAreaShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC721FEAA5A5008D5730 /* RCTSafeAreaShadowView.m */; };\n\t\t3D03BC7C1FEAA5A6008D5730 /* RCTSafeAreaShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC721FEAA5A5008D5730 /* RCTSafeAreaShadowView.m */; };\n\t\t3D03BC7D1FEAA5A6008D5730 /* RCTSafeAreaView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC731FEAA5A5008D5730 /* RCTSafeAreaView.h */; };\n\t\t3D03BC7E1FEAA5A6008D5730 /* RCTSafeAreaView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC731FEAA5A5008D5730 /* RCTSafeAreaView.h */; };\n\t\t3D03BC7F1FEAA5A6008D5730 /* RCTSafeAreaView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC741FEAA5A5008D5730 /* RCTSafeAreaView.m */; };\n\t\t3D03BC801FEAA5A6008D5730 /* RCTSafeAreaView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC741FEAA5A5008D5730 /* RCTSafeAreaView.m */; };\n\t\t3D03BC811FEAA5A6008D5730 /* RCTSafeAreaViewLocalData.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC751FEAA5A5008D5730 /* RCTSafeAreaViewLocalData.h */; };\n\t\t3D03BC821FEAA5A6008D5730 /* RCTSafeAreaViewLocalData.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC751FEAA5A5008D5730 /* RCTSafeAreaViewLocalData.h */; };\n\t\t3D03BC831FEAA5A6008D5730 /* RCTSafeAreaViewLocalData.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC761FEAA5A5008D5730 /* RCTSafeAreaViewLocalData.m */; };\n\t\t3D03BC841FEAA5A6008D5730 /* RCTSafeAreaViewLocalData.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC761FEAA5A5008D5730 /* RCTSafeAreaViewLocalData.m */; };\n\t\t3D03BC851FEAA5A6008D5730 /* RCTSafeAreaViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC771FEAA5A5008D5730 /* RCTSafeAreaViewManager.h */; };\n\t\t3D03BC861FEAA5A6008D5730 /* RCTSafeAreaViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D03BC771FEAA5A5008D5730 /* RCTSafeAreaViewManager.h */; };\n\t\t3D03BC871FEAA5A6008D5730 /* RCTSafeAreaViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC781FEAA5A5008D5730 /* RCTSafeAreaViewManager.m */; };\n\t\t3D03BC881FEAA5A6008D5730 /* RCTSafeAreaViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D03BC781FEAA5A5008D5730 /* RCTSafeAreaViewManager.m */; };\n\t\t3D05745A1DE5FFF500184BB4 /* RCTJavaScriptLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */; };\n\t\t3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */; };\n\t\t3D302F1C1DF8264000D6DDAE /* JSBundleType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */; };\n\t\t3D302F1E1DF8265A00D6DDAE /* JavaScriptCore.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */; };\n\t\t3D302F1F1DF8265A00D6DDAE /* JSCWrapper.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */; };\n\t\t3D302F241DF828F800D6DDAE /* RCTImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */; };\n\t\t3D302F251DF828F800D6DDAE /* RCTImageStoreManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */; };\n\t\t3D302F261DF828F800D6DDAE /* RCTResizeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */; };\n\t\t3D302F271DF828F800D6DDAE /* RCTLinkingManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */; };\n\t\t3D302F281DF828F800D6DDAE /* RCTNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */; };\n\t\t3D302F291DF828F800D6DDAE /* RCTNetworkTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */; };\n\t\t3D302F2A1DF828F800D6DDAE /* RCTPushNotificationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08D1DE4F4EE00E03CC6 /* RCTPushNotificationManager.h */; };\n\t\t3D302F2B1DF828F800D6DDAE /* RCTAssert.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */; };\n\t\t3D302F2C1DF828F800D6DDAE /* RCTBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */; };\n\t\t3D302F2D1DF828F800D6DDAE /* RCTBridge+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */; };\n\t\t3D302F2E1DF828F800D6DDAE /* RCTBridgeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */; };\n\t\t3D302F2F1DF828F800D6DDAE /* RCTBridgeMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */; };\n\t\t3D302F301DF828F800D6DDAE /* RCTBridgeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 830213F31A654E0800B993E6 /* RCTBridgeModule.h */; };\n\t\t3D302F311DF828F800D6DDAE /* RCTBundleURLProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */; };\n\t\t3D302F321DF828F800D6DDAE /* RCTConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBACA1A6023D300E9B192 /* RCTConvert.h */; };\n\t\t3D302F331DF828F800D6DDAE /* RCTDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AF1F851AE6E777005F5298 /* RCTDefines.h */; };\n\t\t3D302F341DF828F800D6DDAE /* RCTDisplayLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */; };\n\t\t3D302F351DF828F800D6DDAE /* RCTErrorCustomizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */; };\n\t\t3D302F361DF828F800D6DDAE /* RCTErrorInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */; };\n\t\t3D302F371DF828F800D6DDAE /* RCTEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */; };\n\t\t3D302F381DF828F800D6DDAE /* RCTFrameUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */; };\n\t\t3D302F391DF828F800D6DDAE /* RCTImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 13BB3D001BECD54500932C10 /* RCTImageSource.h */; };\n\t\t3D302F3A1DF828F800D6DDAE /* RCTInvalidating.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */; };\n\t\t3D302F3B1DF828F800D6DDAE /* RCTJavaScriptExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */; };\n\t\t3D302F3C1DF828F800D6DDAE /* RCTJavaScriptLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */; };\n\t\t3D302F3D1DF828F800D6DDAE /* RCTJSStackFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 008341F51D1DB34400876D9A /* RCTJSStackFrame.h */; };\n\t\t3D302F3E1DF828F800D6DDAE /* RCTKeyCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */; };\n\t\t3D302F3F1DF828F800D6DDAE /* RCTLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4D1A601E3B00E9B192 /* RCTLog.h */; };\n\t\t3D302F401DF828F800D6DDAE /* RCTModuleData.h in Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */; };\n\t\t3D302F411DF828F800D6DDAE /* RCTModuleMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */; };\n\t\t3D302F421DF828F800D6DDAE /* RCTMultipartDataTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */; };\n\t\t3D302F431DF828F800D6DDAE /* RCTMultipartStreamReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */; };\n\t\t3D302F441DF828F800D6DDAE /* RCTNullability.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20F1C19ABC700845B82 /* RCTNullability.h */; };\n\t\t3D302F451DF828F800D6DDAE /* RCTParserUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */; };\n\t\t3D302F461DF828F800D6DDAE /* RCTPerformanceLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 142014181B32094000CC17BA /* RCTPerformanceLogger.h */; };\n\t\t3D302F471DF828F800D6DDAE /* RCTPlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7749421DC1065C007EC8D8 /* RCTPlatform.h */; };\n\t\t3D302F481DF828F800D6DDAE /* RCTRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 830A229C1A66C68A008503DA /* RCTRootView.h */; };\n\t\t3D302F491DF828F800D6DDAE /* RCTRootViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */; };\n\t\t3D302F4A1DF828F800D6DDAE /* RCTRootViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A15FB0C1BDF663500531DFB /* RCTRootViewInternal.h */; };\n\t\t3D302F4B1DF828F800D6DDAE /* RCTTouchEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 391E86A31C623EC800009732 /* RCTTouchEvent.h */; };\n\t\t3D302F4C1DF828F800D6DDAE /* RCTTouchHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */; };\n\t\t3D302F4D1DF828F800D6DDAE /* RCTURLRequestDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; };\n\t\t3D302F4E1DF828F800D6DDAE /* RCTURLRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; };\n\t\t3D302F4F1DF828F800D6DDAE /* RCTUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; };\n\t\t3D302F531DF828F800D6DDAE /* RCTJSCExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */; };\n\t\t3D302F541DF828F800D6DDAE /* RCTJSCSamplingProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */; };\n\t\t3D302F551DF828F800D6DDAE /* RCTAccessibilityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E9B20B791B500126007A2DA7 /* RCTAccessibilityManager.h */; };\n\t\t3D302F561DF828F800D6DDAE /* RCTAlertManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */; };\n\t\t3D302F571DF828F800D6DDAE /* RCTAppState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1372B7081AB030C200659ED6 /* RCTAppState.h */; };\n\t\t3D302F581DF828F800D6DDAE /* RCTAsyncLocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */; };\n\t\t3D302F591DF828F800D6DDAE /* RCTClipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 13D033611C1837FE0021DC29 /* RCTClipboard.h */; };\n\t\t3D302F5A1DF828F800D6DDAE /* RCTDevLoadingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */; };\n\t\t3D302F5B1DF828F800D6DDAE /* RCTDevMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2871B74F71200B29F6F /* RCTDevMenu.h */; };\n\t\t3D302F5C1DF828F800D6DDAE /* RCTEventEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */; };\n\t\t3D302F5D1DF828F800D6DDAE /* RCTExceptionsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */; };\n\t\t3D302F5E1DF828F800D6DDAE /* RCTI18nManager.h in Headers */ = {isa = PBXBuildFile; fileRef = B233E6E81D2D843200BC68BA /* RCTI18nManager.h */; };\n\t\t3D302F5F1DF828F800D6DDAE /* RCTI18nUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */; };\n\t\t3D302F601DF828F800D6DDAE /* RCTKeyboardObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEEC1CDCD93000158BD7 /* RCTKeyboardObserver.h */; };\n\t\t3D302F611DF828F800D6DDAE /* RCTRedBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 13F17A831B8493E5007D4C75 /* RCTRedBox.h */; };\n\t\t3D302F621DF828F800D6DDAE /* RCTSourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */; };\n\t\t3D302F631DF828F800D6DDAE /* RCTStatusBarManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */; };\n\t\t3D302F641DF828F800D6DDAE /* RCTTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FED1A69327A00A75B9A /* RCTTiming.h */; };\n\t\t3D302F651DF828F800D6DDAE /* RCTUIManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E067481A70F434002CDEE1 /* RCTUIManager.h */; };\n\t\t3D302F661DF828F800D6DDAE /* RCTFPSGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */; };\n\t\t3D302F681DF828F800D6DDAE /* RCTMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BF71811C04795500C97D0C /* RCTMacros.h */; };\n\t\t3D302F691DF828F800D6DDAE /* RCTProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 1450FF801BCFF28A00208362 /* RCTProfile.h */; };\n\t\t3D302F6A1DF828F800D6DDAE /* RCTActivityIndicatorView.h in Headers */ = {isa = PBXBuildFile; fileRef = B95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */; };\n\t\t3D302F6B1DF828F800D6DDAE /* RCTActivityIndicatorViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */; };\n\t\t3D302F6C1DF828F800D6DDAE /* RCTAnimationType.h in Headers */ = {isa = PBXBuildFile; fileRef = 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */; };\n\t\t3D302F6D1DF828F800D6DDAE /* RCTAutoInsetsProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */; };\n\t\t3D302F6E1DF828F800D6DDAE /* RCTBorderDrawing.h in Headers */ = {isa = PBXBuildFile; fileRef = 13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */; };\n\t\t3D302F6F1DF828F800D6DDAE /* RCTBorderStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = ACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */; };\n\t\t3D302F701DF828F800D6DDAE /* RCTComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };\n\t\t3D302F711DF828F800D6DDAE /* RCTComponentData.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };\n\t\t3D302F721DF828F800D6DDAE /* RCTConvert+CoreLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };\n\t\t3D302F761DF828F800D6DDAE /* RCTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };\n\t\t3D302F7B1DF828F800D6DDAE /* RCTModalHostView.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };\n\t\t3D302F7C1DF828F800D6DDAE /* RCTModalHostViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };\n\t\t3D302F7D1DF828F800D6DDAE /* RCTModalHostViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };\n\t\t3D302F7E1DF828F800D6DDAE /* RCTNavigator.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B0800C1A69489C00A75B9A /* RCTNavigator.h */; };\n\t\t3D302F7F1DF828F800D6DDAE /* RCTNavigatorManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B0800E1A69489C00A75B9A /* RCTNavigatorManager.h */; };\n\t\t3D302F801DF828F800D6DDAE /* RCTNavItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B080101A69489C00A75B9A /* RCTNavItem.h */; };\n\t\t3D302F811DF828F800D6DDAE /* RCTNavItemManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B080121A69489C00A75B9A /* RCTNavItemManager.h */; };\n\t\t3D302F841DF828F800D6DDAE /* RCTPointerEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */; };\n\t\t3D302F851DF828F800D6DDAE /* RCTProgressViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */; };\n\t\t3D302F861DF828F800D6DDAE /* RCTRefreshControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 191E3EBF1C29DC3800C180A6 /* RCTRefreshControl.h */; };\n\t\t3D302F871DF828F800D6DDAE /* RCTRefreshControlManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 191E3EBC1C29D9AF00C180A6 /* RCTRefreshControlManager.h */; };\n\t\t3D302F881DF828F800D6DDAE /* RCTRootShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */; };\n\t\t3D302F8C1DF828F800D6DDAE /* RCTSegmentedControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */; };\n\t\t3D302F8D1DF828F800D6DDAE /* RCTSegmentedControlManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */; };\n\t\t3D302F8E1DF828F800D6DDAE /* RCTShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */; };\n\t\t3D302F8F1DF828F800D6DDAE /* RCTSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AF20431AE707F8005F5298 /* RCTSlider.h */; };\n\t\t3D302F901DF828F800D6DDAE /* RCTSliderManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */; };\n\t\t3D302F911DF828F800D6DDAE /* RCTSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F362071AABD06A001CE568 /* RCTSwitch.h */; };\n\t\t3D302F921DF828F800D6DDAE /* RCTSwitchManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F362091AABD06A001CE568 /* RCTSwitchManager.h */; };\n\t\t3D302F931DF828F800D6DDAE /* RCTTabBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 137327DF1AA5CF210034F82E /* RCTTabBar.h */; };\n\t\t3D302F941DF828F800D6DDAE /* RCTTabBarItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 137327E11AA5CF210034F82E /* RCTTabBarItem.h */; };\n\t\t3D302F951DF828F800D6DDAE /* RCTTabBarItemManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 137327E31AA5CF210034F82E /* RCTTabBarItemManager.h */; };\n\t\t3D302F961DF828F800D6DDAE /* RCTTabBarManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 137327E51AA5CF210034F82E /* RCTTabBarManager.h */; };\n\t\t3D302F971DF828F800D6DDAE /* RCTTextDecorationLineType.h in Headers */ = {isa = PBXBuildFile; fileRef = E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */; };\n\t\t3D302F981DF828F800D6DDAE /* RCTView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674F1A70F44B002CDEE1 /* RCTView.h */; };\n\t\t3D302F9A1DF828F800D6DDAE /* RCTViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */; };\n\t\t3D302F9D1DF828F800D6DDAE /* RCTWrapperViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B080231A694A8400A75B9A /* RCTWrapperViewController.h */; };\n\t\t3D302F9E1DF828F800D6DDAE /* UIView+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 83F15A171B7CC46900F10295 /* UIView+Private.h */; };\n\t\t3D302F9F1DF828F800D6DDAE /* UIView+React.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E067531A70F44B002CDEE1 /* UIView+React.h */; };\n\t\t3D302FA01DF8290600D6DDAE /* RCTImageLoader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */; };\n\t\t3D302FA11DF8290600D6DDAE /* RCTImageStoreManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */; };\n\t\t3D302FA21DF8290600D6DDAE /* RCTResizeMode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */; };\n\t\t3D302FA31DF8290600D6DDAE /* RCTLinkingManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */; };\n\t\t3D302FA41DF8290600D6DDAE /* RCTNetworking.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */; };\n\t\t3D302FA51DF8290600D6DDAE /* RCTNetworkTask.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */; };\n\t\t3D302FA61DF8290600D6DDAE /* RCTPushNotificationManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08D1DE4F4EE00E03CC6 /* RCTPushNotificationManager.h */; };\n\t\t3D302FA71DF8290600D6DDAE /* RCTAssert.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */; };\n\t\t3D302FA81DF8290600D6DDAE /* RCTBridge.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */; };\n\t\t3D302FAA1DF8290600D6DDAE /* RCTBridgeDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */; };\n\t\t3D302FAB1DF8290600D6DDAE /* RCTBridgeMethod.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */; };\n\t\t3D302FAC1DF8290600D6DDAE /* RCTBridgeModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 830213F31A654E0800B993E6 /* RCTBridgeModule.h */; };\n\t\t3D302FAD1DF8290600D6DDAE /* RCTBundleURLProvider.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */; };\n\t\t3D302FAE1DF8290600D6DDAE /* RCTConvert.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBACA1A6023D300E9B192 /* RCTConvert.h */; };\n\t\t3D302FAF1DF8290600D6DDAE /* RCTDefines.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AF1F851AE6E777005F5298 /* RCTDefines.h */; };\n\t\t3D302FB01DF8290600D6DDAE /* RCTDisplayLink.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */; };\n\t\t3D302FB11DF8290600D6DDAE /* RCTErrorCustomizer.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */; };\n\t\t3D302FB21DF8290600D6DDAE /* RCTErrorInfo.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */; };\n\t\t3D302FB31DF8290600D6DDAE /* RCTEventDispatcher.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */; };\n\t\t3D302FB41DF8290600D6DDAE /* RCTFrameUpdate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */; };\n\t\t3D302FB51DF8290600D6DDAE /* RCTImageSource.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13BB3D001BECD54500932C10 /* RCTImageSource.h */; };\n\t\t3D302FB61DF8290600D6DDAE /* RCTInvalidating.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */; };\n\t\t3D302FB71DF8290600D6DDAE /* RCTJavaScriptExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */; };\n\t\t3D302FB81DF8290600D6DDAE /* RCTJavaScriptLoader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */; };\n\t\t3D302FB91DF8290600D6DDAE /* RCTJSStackFrame.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 008341F51D1DB34400876D9A /* RCTJSStackFrame.h */; };\n\t\t3D302FBA1DF8290600D6DDAE /* RCTKeyCommands.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */; };\n\t\t3D302FBB1DF8290600D6DDAE /* RCTLog.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4D1A601E3B00E9B192 /* RCTLog.h */; };\n\t\t3D302FBC1DF8290600D6DDAE /* RCTModuleData.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */; };\n\t\t3D302FBD1DF8290600D6DDAE /* RCTModuleMethod.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */; };\n\t\t3D302FBE1DF8290600D6DDAE /* RCTMultipartDataTask.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */; };\n\t\t3D302FBF1DF8290600D6DDAE /* RCTMultipartStreamReader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */; };\n\t\t3D302FC01DF8290600D6DDAE /* RCTNullability.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20F1C19ABC700845B82 /* RCTNullability.h */; };\n\t\t3D302FC11DF8290600D6DDAE /* RCTParserUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */; };\n\t\t3D302FC21DF8290600D6DDAE /* RCTPerformanceLogger.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 142014181B32094000CC17BA /* RCTPerformanceLogger.h */; };\n\t\t3D302FC31DF8290600D6DDAE /* RCTPlatform.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7749421DC1065C007EC8D8 /* RCTPlatform.h */; };\n\t\t3D302FC41DF8290600D6DDAE /* RCTRootView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 830A229C1A66C68A008503DA /* RCTRootView.h */; };\n\t\t3D302FC51DF8290600D6DDAE /* RCTRootViewDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */; };\n\t\t3D302FC71DF8290600D6DDAE /* RCTTouchEvent.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 391E86A31C623EC800009732 /* RCTTouchEvent.h */; };\n\t\t3D302FC81DF8290600D6DDAE /* RCTTouchHandler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */; };\n\t\t3D302FC91DF8290600D6DDAE /* RCTURLRequestDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; };\n\t\t3D302FCA1DF8290600D6DDAE /* RCTURLRequestHandler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; };\n\t\t3D302FCB1DF8290600D6DDAE /* RCTUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; };\n\t\t3D302FCF1DF8290600D6DDAE /* RCTJSCExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */; };\n\t\t3D302FD01DF8290600D6DDAE /* RCTJSCSamplingProfiler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */; };\n\t\t3D302FD11DF8290600D6DDAE /* RCTAccessibilityManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = E9B20B791B500126007A2DA7 /* RCTAccessibilityManager.h */; };\n\t\t3D302FD21DF8290600D6DDAE /* RCTAlertManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */; };\n\t\t3D302FD31DF8290600D6DDAE /* RCTAppState.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1372B7081AB030C200659ED6 /* RCTAppState.h */; };\n\t\t3D302FD41DF8290600D6DDAE /* RCTAsyncLocalStorage.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */; };\n\t\t3D302FD51DF8290600D6DDAE /* RCTClipboard.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13D033611C1837FE0021DC29 /* RCTClipboard.h */; };\n\t\t3D302FD61DF8290600D6DDAE /* RCTDevLoadingView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */; };\n\t\t3D302FD71DF8290600D6DDAE /* RCTDevMenu.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2871B74F71200B29F6F /* RCTDevMenu.h */; };\n\t\t3D302FD81DF8290600D6DDAE /* RCTEventEmitter.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */; };\n\t\t3D302FD91DF8290600D6DDAE /* RCTExceptionsManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */; };\n\t\t3D302FDA1DF8290600D6DDAE /* RCTI18nManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = B233E6E81D2D843200BC68BA /* RCTI18nManager.h */; };\n\t\t3D302FDB1DF8290600D6DDAE /* RCTI18nUtil.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */; };\n\t\t3D302FDC1DF8290600D6DDAE /* RCTKeyboardObserver.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEEC1CDCD93000158BD7 /* RCTKeyboardObserver.h */; };\n\t\t3D302FDD1DF8290600D6DDAE /* RCTRedBox.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13F17A831B8493E5007D4C75 /* RCTRedBox.h */; };\n\t\t3D302FDE1DF8290600D6DDAE /* RCTSourceCode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */; };\n\t\t3D302FDF1DF8290600D6DDAE /* RCTStatusBarManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */; };\n\t\t3D302FE01DF8290600D6DDAE /* RCTTiming.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FED1A69327A00A75B9A /* RCTTiming.h */; };\n\t\t3D302FE11DF8290600D6DDAE /* RCTUIManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E067481A70F434002CDEE1 /* RCTUIManager.h */; };\n\t\t3D302FE21DF8290600D6DDAE /* RCTFPSGraph.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */; };\n\t\t3D302FE41DF8290600D6DDAE /* RCTMacros.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14BF71811C04795500C97D0C /* RCTMacros.h */; };\n\t\t3D302FE51DF8290600D6DDAE /* RCTProfile.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1450FF801BCFF28A00208362 /* RCTProfile.h */; };\n\t\t3D302FE61DF8290600D6DDAE /* RCTActivityIndicatorView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = B95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */; };\n\t\t3D302FE71DF8290600D6DDAE /* RCTActivityIndicatorViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */; };\n\t\t3D302FE81DF8290600D6DDAE /* RCTAnimationType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */; };\n\t\t3D302FE91DF8290600D6DDAE /* RCTAutoInsetsProtocol.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */; };\n\t\t3D302FEA1DF8290600D6DDAE /* RCTBorderDrawing.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */; };\n\t\t3D302FEB1DF8290600D6DDAE /* RCTBorderStyle.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = ACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */; };\n\t\t3D302FEC1DF8290600D6DDAE /* RCTComponent.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };\n\t\t3D302FED1DF8290600D6DDAE /* RCTComponentData.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };\n\t\t3D302FEE1DF8290600D6DDAE /* RCTConvert+CoreLocation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };\n\t\t3D302FF21DF8290600D6DDAE /* RCTFont.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };\n\t\t3D302FF71DF8290600D6DDAE /* RCTModalHostView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };\n\t\t3D302FF81DF8290600D6DDAE /* RCTModalHostViewController.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };\n\t\t3D302FF91DF8290600D6DDAE /* RCTModalHostViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };\n\t\t3D302FFA1DF8290600D6DDAE /* RCTNavigator.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B0800C1A69489C00A75B9A /* RCTNavigator.h */; };\n\t\t3D302FFB1DF8290600D6DDAE /* RCTNavigatorManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B0800E1A69489C00A75B9A /* RCTNavigatorManager.h */; };\n\t\t3D302FFC1DF8290600D6DDAE /* RCTNavItem.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B080101A69489C00A75B9A /* RCTNavItem.h */; };\n\t\t3D302FFD1DF8290600D6DDAE /* RCTNavItemManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B080121A69489C00A75B9A /* RCTNavItemManager.h */; };\n\t\t3D3030001DF8290600D6DDAE /* RCTPointerEvents.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */; };\n\t\t3D3030011DF8290600D6DDAE /* RCTProgressViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */; };\n\t\t3D3030021DF8290600D6DDAE /* RCTRefreshControl.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 191E3EBF1C29DC3800C180A6 /* RCTRefreshControl.h */; };\n\t\t3D3030031DF8290600D6DDAE /* RCTRefreshControlManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 191E3EBC1C29D9AF00C180A6 /* RCTRefreshControlManager.h */; };\n\t\t3D3030041DF8290600D6DDAE /* RCTRootShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */; };\n\t\t3D3030081DF8290600D6DDAE /* RCTSegmentedControl.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */; };\n\t\t3D3030091DF8290600D6DDAE /* RCTSegmentedControlManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */; };\n\t\t3D30300A1DF8290600D6DDAE /* RCTShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */; };\n\t\t3D30300B1DF8290600D6DDAE /* RCTSlider.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AF20431AE707F8005F5298 /* RCTSlider.h */; };\n\t\t3D30300C1DF8290600D6DDAE /* RCTSliderManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */; };\n\t\t3D30300D1DF8290600D6DDAE /* RCTSwitch.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F362071AABD06A001CE568 /* RCTSwitch.h */; };\n\t\t3D30300E1DF8290600D6DDAE /* RCTSwitchManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F362091AABD06A001CE568 /* RCTSwitchManager.h */; };\n\t\t3D30300F1DF8290600D6DDAE /* RCTTabBar.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 137327DF1AA5CF210034F82E /* RCTTabBar.h */; };\n\t\t3D3030101DF8290600D6DDAE /* RCTTabBarItem.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 137327E11AA5CF210034F82E /* RCTTabBarItem.h */; };\n\t\t3D3030111DF8290600D6DDAE /* RCTTabBarItemManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 137327E31AA5CF210034F82E /* RCTTabBarItemManager.h */; };\n\t\t3D3030121DF8290600D6DDAE /* RCTTabBarManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 137327E51AA5CF210034F82E /* RCTTabBarManager.h */; };\n\t\t3D3030131DF8290600D6DDAE /* RCTTextDecorationLineType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */; };\n\t\t3D3030141DF8290600D6DDAE /* RCTView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674F1A70F44B002CDEE1 /* RCTView.h */; };\n\t\t3D3030161DF8290600D6DDAE /* RCTViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */; };\n\t\t3D3030191DF8290600D6DDAE /* RCTWrapperViewController.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B080231A694A8400A75B9A /* RCTWrapperViewController.h */; };\n\t\t3D30301B1DF8290600D6DDAE /* UIView+React.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E067531A70F44B002CDEE1 /* UIView+React.h */; };\n\t\t3D3030221DF8294C00D6DDAE /* JSBundleType.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */; };\n\t\t3D3030231DF8294C00D6DDAE /* oss-compat-util.h in Headers */ = {isa = PBXBuildFile; fileRef = AC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */; };\n\t\t3D3030251DF8295E00D6DDAE /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */; };\n\t\t3D3030261DF8295E00D6DDAE /* JSCWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */; };\n\t\t3D37B5821D522B190042D5B5 /* RCTFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D37B5811D522B190042D5B5 /* RCTFont.mm */; };\n\t\t3D3C08891DE342FB00C268FA /* libyoga.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3C059A1DE3340900C268FA /* libyoga.a */; };\n\t\t3D3CD93D1DE5FC1400167DC4 /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */; };\n\t\t3D3CD93E1DE5FC1400167DC4 /* JSCWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */; };\n\t\t3D3CD9411DE5FC5300167DC4 /* libcxxreact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */; };\n\t\t3D3CD9421DE5FC5300167DC4 /* libjschelpers.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */; };\n\t\t3D3CD9431DE5FC6500167DC4 /* libcxxreact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD9321DE5FBEE00167DC4 /* libcxxreact.a */; };\n\t\t3D3CD9441DE5FC6500167DC4 /* libjschelpers.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD9181DE5FBD800167DC4 /* libjschelpers.a */; };\n\t\t3D3CD9451DE5FC7100167DC4 /* JSBundleType.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */; };\n\t\t3D3CD9471DE5FC7800167DC4 /* oss-compat-util.h in Headers */ = {isa = PBXBuildFile; fileRef = AC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */; };\n\t\t3D4153511F276ED7005B8EFE /* RCTLayoutAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D41534D1F276ED7005B8EFE /* RCTLayoutAnimation.h */; };\n\t\t3D4153521F276ED7005B8EFE /* RCTLayoutAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D41534E1F276ED7005B8EFE /* RCTLayoutAnimation.m */; };\n\t\t3D4153531F276ED7005B8EFE /* RCTLayoutAnimationGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D41534F1F276ED7005B8EFE /* RCTLayoutAnimationGroup.h */; };\n\t\t3D4153541F276ED7005B8EFE /* RCTLayoutAnimationGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D4153501F276ED7005B8EFE /* RCTLayoutAnimationGroup.m */; };\n\t\t3D4153551F276EDC005B8EFE /* RCTLayoutAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D41534D1F276ED7005B8EFE /* RCTLayoutAnimation.h */; };\n\t\t3D4153561F276EDF005B8EFE /* RCTLayoutAnimationGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D41534F1F276ED7005B8EFE /* RCTLayoutAnimationGroup.h */; };\n\t\t3D4153571F276EE1005B8EFE /* RCTLayoutAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D41534E1F276ED7005B8EFE /* RCTLayoutAnimation.m */; };\n\t\t3D4153581F276EE3005B8EFE /* RCTLayoutAnimationGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D4153501F276ED7005B8EFE /* RCTLayoutAnimationGroup.m */; };\n\t\t3D41536B1F277087005B8EFE /* RCTMaskedView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D4153651F277087005B8EFE /* RCTMaskedView.h */; };\n\t\t3D41536C1F277087005B8EFE /* RCTMaskedView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D4153661F277087005B8EFE /* RCTMaskedView.m */; };\n\t\t3D41536D1F277087005B8EFE /* RCTMaskedViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D4153671F277087005B8EFE /* RCTMaskedViewManager.h */; };\n\t\t3D41536E1F277087005B8EFE /* RCTMaskedViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D4153681F277087005B8EFE /* RCTMaskedViewManager.m */; };\n\t\t3D4153711F277092005B8EFE /* RCTConvert+Transform.h in Headers */ = {isa = PBXBuildFile; fileRef = 945929C21DD62ADD00653A7D /* RCTConvert+Transform.h */; };\n\t\t3D4153721F27709E005B8EFE /* RCTMaskedView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D4153651F277087005B8EFE /* RCTMaskedView.h */; };\n\t\t3D4153731F2770A0005B8EFE /* RCTMaskedView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D4153661F277087005B8EFE /* RCTMaskedView.m */; };\n\t\t3D4153741F2770A3005B8EFE /* RCTMaskedViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D4153671F277087005B8EFE /* RCTMaskedViewManager.h */; };\n\t\t3D4153751F2770A4005B8EFE /* RCTMaskedViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D4153681F277087005B8EFE /* RCTMaskedViewManager.m */; };\n\t\t3D5AC7131E0056C4000F9153 /* RCTTVView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5AC70F1E0056BC000F9153 /* RCTTVView.h */; };\n\t\t3D5AC7141E0056C7000F9153 /* RCTTVView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D5AC7101E0056BC000F9153 /* RCTTVView.m */; };\n\t\t3D5AC7191E0056E0000F9153 /* RCTTVNavigationEventEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5AC7151E0056D9000F9153 /* RCTTVNavigationEventEmitter.h */; };\n\t\t3D5AC71A1E0056E0000F9153 /* RCTTVNavigationEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D5AC7161E0056D9000F9153 /* RCTTVNavigationEventEmitter.m */; };\n\t\t3D5AC71B1E005723000F9153 /* RCTReloadCommand.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; };\n\t\t3D5AC71C1E005723000F9153 /* RCTTVNavigationEventEmitter.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D5AC7151E0056D9000F9153 /* RCTTVNavigationEventEmitter.h */; };\n\t\t3D5AC71D1E00572F000F9153 /* RCTTVView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D5AC70F1E0056BC000F9153 /* RCTTVView.h */; };\n\t\t3D5AC7221E005763000F9153 /* RCTTVRemoteHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5AC71E1E005750000F9153 /* RCTTVRemoteHandler.h */; };\n\t\t3D5AC7231E005766000F9153 /* RCTTVRemoteHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D5AC71F1E005750000F9153 /* RCTTVRemoteHandler.m */; };\n\t\t3D6B76D31E83DD1C008FA614 /* RCTJSCErrorHandling.h in Headers */ = {isa = PBXBuildFile; fileRef = 139324FC1E70B069009FD7E0 /* RCTJSCErrorHandling.h */; };\n\t\t3D6B76D41E83DD1C008FA614 /* RCTConvert+Transform.h in Headers */ = {isa = PBXBuildFile; fileRef = 945929C21DD62ADD00653A7D /* RCTConvert+Transform.h */; };\n\t\t3D6B76D51E83DD3A008FA614 /* RCTDevSettings.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = B505583C1E43DFB900F71A00 /* RCTDevSettings.h */; };\n\t\t3D6B76D61E83DD3A008FA614 /* RCTConvert+Transform.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 945929C21DD62ADD00653A7D /* RCTConvert+Transform.h */; };\n\t\t3D6B76D71E83DD59008FA614 /* RCTJSCErrorHandling.mm in Sources */ = {isa = PBXBuildFile; fileRef = 139324FD1E70B069009FD7E0 /* RCTJSCErrorHandling.mm */; };\n\t\t3D7749441DC1065C007EC8D8 /* RCTPlatform.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D7749431DC1065C007EC8D8 /* RCTPlatform.m */; };\n\t\t3D7BFCE71EA8E1F4008DFB7A /* RCTPackagerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFCE51EA8E1F4008DFB7A /* RCTPackagerConnection.h */; };\n\t\t3D7BFCE81EA8E1F4008DFB7A /* RCTPackagerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7BFCE51EA8E1F4008DFB7A /* RCTPackagerConnection.h */; };\n\t\t3D7BFCE91EA8E1F4008DFB7A /* RCTPackagerConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D7BFCE61EA8E1F4008DFB7A /* RCTPackagerConnection.mm */; };\n\t\t3D7BFCEA1EA8E1F4008DFB7A /* RCTPackagerConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D7BFCE61EA8E1F4008DFB7A /* RCTPackagerConnection.mm */; };\n\t\t3D7BFCEB1EA8E23A008DFB7A /* RCTDevSettings.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = B505583C1E43DFB900F71A00 /* RCTDevSettings.h */; };\n\t\t3D80D9171DF6F7A80028D040 /* JSBundleType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */; };\n\t\t3D80D9181DF6F7A80028D040 /* JSBundleType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */; };\n\t\t3D80D9191DF6F7CF0028D040 /* JSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */; };\n\t\t3D80D91A1DF6F7CF0028D040 /* JSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */; };\n\t\t3D80D91B1DF6F8200028D040 /* RCTPlatform.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D7749431DC1065C007EC8D8 /* RCTPlatform.m */; };\n\t\t3D80D91F1DF6FA890028D040 /* RCTImageLoader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */; };\n\t\t3D80D9201DF6FA890028D040 /* RCTImageStoreManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */; };\n\t\t3D80D9211DF6FA890028D040 /* RCTResizeMode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */; };\n\t\t3D80D9221DF6FA890028D040 /* RCTLinkingManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */; };\n\t\t3D80D9231DF6FA890028D040 /* RCTNetworking.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */; };\n\t\t3D80D9241DF6FA890028D040 /* RCTNetworkTask.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */; };\n\t\t3D80D9251DF6FA890028D040 /* RCTPushNotificationManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08D1DE4F4EE00E03CC6 /* RCTPushNotificationManager.h */; };\n\t\t3D80D9261DF6FA890028D040 /* RCTAssert.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */; };\n\t\t3D80D9271DF6FA890028D040 /* RCTBridge.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */; };\n\t\t3D80D9281DF6FA890028D040 /* RCTBridge+Private.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */; };\n\t\t3D80D9291DF6FA890028D040 /* RCTBridgeDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */; };\n\t\t3D80D92A1DF6FA890028D040 /* RCTBridgeMethod.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */; };\n\t\t3D80D92B1DF6FA890028D040 /* RCTBridgeModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 830213F31A654E0800B993E6 /* RCTBridgeModule.h */; };\n\t\t3D80D92C1DF6FA890028D040 /* RCTBundleURLProvider.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */; };\n\t\t3D80D92D1DF6FA890028D040 /* RCTConvert.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBACA1A6023D300E9B192 /* RCTConvert.h */; };\n\t\t3D80D92E1DF6FA890028D040 /* RCTDefines.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AF1F851AE6E777005F5298 /* RCTDefines.h */; };\n\t\t3D80D92F1DF6FA890028D040 /* RCTDisplayLink.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */; };\n\t\t3D80D9301DF6FA890028D040 /* RCTErrorCustomizer.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */; };\n\t\t3D80D9311DF6FA890028D040 /* RCTErrorInfo.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */; };\n\t\t3D80D9321DF6FA890028D040 /* RCTEventDispatcher.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */; };\n\t\t3D80D9331DF6FA890028D040 /* RCTFrameUpdate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */; };\n\t\t3D80D9341DF6FA890028D040 /* RCTImageSource.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13BB3D001BECD54500932C10 /* RCTImageSource.h */; };\n\t\t3D80D9351DF6FA890028D040 /* RCTInvalidating.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */; };\n\t\t3D80D9361DF6FA890028D040 /* RCTJavaScriptExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */; };\n\t\t3D80D9371DF6FA890028D040 /* RCTJavaScriptLoader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */; };\n\t\t3D80D9381DF6FA890028D040 /* RCTJSStackFrame.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 008341F51D1DB34400876D9A /* RCTJSStackFrame.h */; };\n\t\t3D80D9391DF6FA890028D040 /* RCTKeyCommands.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */; };\n\t\t3D80D93A1DF6FA890028D040 /* RCTLog.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4D1A601E3B00E9B192 /* RCTLog.h */; };\n\t\t3D80D93B1DF6FA890028D040 /* RCTModuleData.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */; };\n\t\t3D80D93C1DF6FA890028D040 /* RCTModuleMethod.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */; };\n\t\t3D80D93D1DF6FA890028D040 /* RCTMultipartDataTask.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */; };\n\t\t3D80D93E1DF6FA890028D040 /* RCTMultipartStreamReader.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */; };\n\t\t3D80D93F1DF6FA890028D040 /* RCTNullability.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20F1C19ABC700845B82 /* RCTNullability.h */; };\n\t\t3D80D9401DF6FA890028D040 /* RCTParserUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */; };\n\t\t3D80D9411DF6FA890028D040 /* RCTPerformanceLogger.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 142014181B32094000CC17BA /* RCTPerformanceLogger.h */; };\n\t\t3D80D9421DF6FA890028D040 /* RCTPlatform.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7749421DC1065C007EC8D8 /* RCTPlatform.h */; };\n\t\t3D80D9431DF6FA890028D040 /* RCTRootView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 830A229C1A66C68A008503DA /* RCTRootView.h */; };\n\t\t3D80D9441DF6FA890028D040 /* RCTRootViewDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */; };\n\t\t3D80D9461DF6FA890028D040 /* RCTTouchEvent.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 391E86A31C623EC800009732 /* RCTTouchEvent.h */; };\n\t\t3D80D9471DF6FA890028D040 /* RCTTouchHandler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */; };\n\t\t3D80D9481DF6FA890028D040 /* RCTURLRequestDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; };\n\t\t3D80D9491DF6FA890028D040 /* RCTURLRequestHandler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; };\n\t\t3D80D94A1DF6FA890028D040 /* RCTUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; };\n\t\t3D80D94E1DF6FA890028D040 /* RCTJSCExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */; };\n\t\t3D80D94F1DF6FA890028D040 /* RCTJSCSamplingProfiler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */; };\n\t\t3D80D9501DF6FA890028D040 /* RCTAccessibilityManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = E9B20B791B500126007A2DA7 /* RCTAccessibilityManager.h */; };\n\t\t3D80D9511DF6FA890028D040 /* RCTAlertManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */; };\n\t\t3D80D9521DF6FA890028D040 /* RCTAppState.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1372B7081AB030C200659ED6 /* RCTAppState.h */; };\n\t\t3D80D9531DF6FA890028D040 /* RCTAsyncLocalStorage.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */; };\n\t\t3D80D9541DF6FA890028D040 /* RCTClipboard.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13D033611C1837FE0021DC29 /* RCTClipboard.h */; };\n\t\t3D80D9551DF6FA890028D040 /* RCTDevLoadingView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */; };\n\t\t3D80D9561DF6FA890028D040 /* RCTDevMenu.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2871B74F71200B29F6F /* RCTDevMenu.h */; };\n\t\t3D80D9571DF6FA890028D040 /* RCTEventEmitter.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */; };\n\t\t3D80D9581DF6FA890028D040 /* RCTExceptionsManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */; };\n\t\t3D80D9591DF6FA890028D040 /* RCTI18nManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = B233E6E81D2D843200BC68BA /* RCTI18nManager.h */; };\n\t\t3D80D95A1DF6FA890028D040 /* RCTI18nUtil.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */; };\n\t\t3D80D95B1DF6FA890028D040 /* RCTKeyboardObserver.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEEC1CDCD93000158BD7 /* RCTKeyboardObserver.h */; };\n\t\t3D80D95C1DF6FA890028D040 /* RCTRedBox.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13F17A831B8493E5007D4C75 /* RCTRedBox.h */; };\n\t\t3D80D95D1DF6FA890028D040 /* RCTSourceCode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */; };\n\t\t3D80D95E1DF6FA890028D040 /* RCTStatusBarManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */; };\n\t\t3D80D95F1DF6FA890028D040 /* RCTTiming.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B07FED1A69327A00A75B9A /* RCTTiming.h */; };\n\t\t3D80D9601DF6FA890028D040 /* RCTUIManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E067481A70F434002CDEE1 /* RCTUIManager.h */; };\n\t\t3D80D9611DF6FA890028D040 /* RCTFPSGraph.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */; };\n\t\t3D80D9631DF6FA890028D040 /* RCTMacros.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14BF71811C04795500C97D0C /* RCTMacros.h */; };\n\t\t3D80D9641DF6FA890028D040 /* RCTProfile.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1450FF801BCFF28A00208362 /* RCTProfile.h */; };\n\t\t3D80D9651DF6FA890028D040 /* RCTActivityIndicatorView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = B95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */; };\n\t\t3D80D9661DF6FA890028D040 /* RCTActivityIndicatorViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */; };\n\t\t3D80D9671DF6FA890028D040 /* RCTAnimationType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */; };\n\t\t3D80D9681DF6FA890028D040 /* RCTAutoInsetsProtocol.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */; };\n\t\t3D80D9691DF6FA890028D040 /* RCTBorderDrawing.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */; };\n\t\t3D80D96A1DF6FA890028D040 /* RCTBorderStyle.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = ACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */; };\n\t\t3D80D96B1DF6FA890028D040 /* RCTComponent.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };\n\t\t3D80D96C1DF6FA890028D040 /* RCTComponentData.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };\n\t\t3D80D96D1DF6FA890028D040 /* RCTConvert+CoreLocation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };\n\t\t3D80D96F1DF6FA890028D040 /* RCTDatePicker.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */; };\n\t\t3D80D9701DF6FA890028D040 /* RCTDatePickerManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */; };\n\t\t3D80D9711DF6FA890028D040 /* RCTFont.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };\n\t\t3D80D9761DF6FA890028D040 /* RCTModalHostView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };\n\t\t3D80D9771DF6FA890028D040 /* RCTModalHostViewController.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };\n\t\t3D80D9781DF6FA890028D040 /* RCTModalHostViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };\n\t\t3D80D9791DF6FA890028D040 /* RCTNavigator.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B0800C1A69489C00A75B9A /* RCTNavigator.h */; };\n\t\t3D80D97A1DF6FA890028D040 /* RCTNavigatorManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B0800E1A69489C00A75B9A /* RCTNavigatorManager.h */; };\n\t\t3D80D97B1DF6FA890028D040 /* RCTNavItem.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B080101A69489C00A75B9A /* RCTNavItem.h */; };\n\t\t3D80D97C1DF6FA890028D040 /* RCTNavItemManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B080121A69489C00A75B9A /* RCTNavItemManager.h */; };\n\t\t3D80D97D1DF6FA890028D040 /* RCTPicker.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58114A121AAE854800E7D092 /* RCTPicker.h */; };\n\t\t3D80D97E1DF6FA890028D040 /* RCTPickerManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58114A141AAE854800E7D092 /* RCTPickerManager.h */; };\n\t\t3D80D97F1DF6FA890028D040 /* RCTPointerEvents.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */; };\n\t\t3D80D9801DF6FA890028D040 /* RCTProgressViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */; };\n\t\t3D80D9811DF6FA890028D040 /* RCTRefreshControl.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 191E3EBF1C29DC3800C180A6 /* RCTRefreshControl.h */; };\n\t\t3D80D9821DF6FA890028D040 /* RCTRefreshControlManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 191E3EBC1C29D9AF00C180A6 /* RCTRefreshControlManager.h */; };\n\t\t3D80D9831DF6FA890028D040 /* RCTRootShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */; };\n\t\t3D80D9871DF6FA890028D040 /* RCTSegmentedControl.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */; };\n\t\t3D80D9881DF6FA890028D040 /* RCTSegmentedControlManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */; };\n\t\t3D80D9891DF6FA890028D040 /* RCTShadowView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */; };\n\t\t3D80D98A1DF6FA890028D040 /* RCTSlider.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AF20431AE707F8005F5298 /* RCTSlider.h */; };\n\t\t3D80D98B1DF6FA890028D040 /* RCTSliderManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */; };\n\t\t3D80D98C1DF6FA890028D040 /* RCTSwitch.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F362071AABD06A001CE568 /* RCTSwitch.h */; };\n\t\t3D80D98D1DF6FA890028D040 /* RCTSwitchManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14F362091AABD06A001CE568 /* RCTSwitchManager.h */; };\n\t\t3D80D98E1DF6FA890028D040 /* RCTTabBar.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 137327DF1AA5CF210034F82E /* RCTTabBar.h */; };\n\t\t3D80D98F1DF6FA890028D040 /* RCTTabBarItem.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 137327E11AA5CF210034F82E /* RCTTabBarItem.h */; };\n\t\t3D80D9901DF6FA890028D040 /* RCTTabBarItemManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 137327E31AA5CF210034F82E /* RCTTabBarItemManager.h */; };\n\t\t3D80D9911DF6FA890028D040 /* RCTTabBarManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 137327E51AA5CF210034F82E /* RCTTabBarManager.h */; };\n\t\t3D80D9921DF6FA890028D040 /* RCTTextDecorationLineType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */; };\n\t\t3D80D9931DF6FA890028D040 /* RCTView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674F1A70F44B002CDEE1 /* RCTView.h */; };\n\t\t3D80D9951DF6FA890028D040 /* RCTViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */; };\n\t\t3D80D9961DF6FA890028D040 /* RCTWebView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C156011AB1A2840079392D /* RCTWebView.h */; };\n\t\t3D80D9971DF6FA890028D040 /* RCTWebViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C156031AB1A2840079392D /* RCTWebViewManager.h */; };\n\t\t3D80D9981DF6FA890028D040 /* RCTWrapperViewController.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B080231A694A8400A75B9A /* RCTWrapperViewController.h */; };\n\t\t3D80D9991DF6FA890028D040 /* UIView+Private.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83F15A171B7CC46900F10295 /* UIView+Private.h */; };\n\t\t3D80D99A1DF6FA890028D040 /* UIView+React.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13E067531A70F44B002CDEE1 /* UIView+React.h */; };\n\t\t3D80DA191DF820620028D040 /* RCTImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */; };\n\t\t3D80DA1A1DF820620028D040 /* RCTImageStoreManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */; };\n\t\t3D80DA1B1DF820620028D040 /* RCTResizeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */; };\n\t\t3D80DA1C1DF820620028D040 /* RCTLinkingManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */; };\n\t\t3D80DA1D1DF820620028D040 /* RCTNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */; };\n\t\t3D80DA1E1DF820620028D040 /* RCTNetworkTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */; };\n\t\t3D80DA1F1DF820620028D040 /* RCTPushNotificationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA08D1DE4F4EE00E03CC6 /* RCTPushNotificationManager.h */; };\n\t\t3D80DA201DF820620028D040 /* RCTAssert.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */; };\n\t\t3D80DA211DF820620028D040 /* RCTBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */; };\n\t\t3D80DA221DF820620028D040 /* RCTBridge+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */; };\n\t\t3D80DA231DF820620028D040 /* RCTBridgeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */; };\n\t\t3D80DA241DF820620028D040 /* RCTBridgeMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */; };\n\t\t3D80DA251DF820620028D040 /* RCTBridgeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 830213F31A654E0800B993E6 /* RCTBridgeModule.h */; };\n\t\t3D80DA261DF820620028D040 /* RCTBundleURLProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */; };\n\t\t3D80DA271DF820620028D040 /* RCTConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBACA1A6023D300E9B192 /* RCTConvert.h */; };\n\t\t3D80DA281DF820620028D040 /* RCTDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AF1F851AE6E777005F5298 /* RCTDefines.h */; };\n\t\t3D80DA291DF820620028D040 /* RCTDisplayLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */; };\n\t\t3D80DA2A1DF820620028D040 /* RCTErrorCustomizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */; };\n\t\t3D80DA2B1DF820620028D040 /* RCTErrorInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */; };\n\t\t3D80DA2C1DF820620028D040 /* RCTEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */; };\n\t\t3D80DA2D1DF820620028D040 /* RCTFrameUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */; };\n\t\t3D80DA2E1DF820620028D040 /* RCTImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 13BB3D001BECD54500932C10 /* RCTImageSource.h */; };\n\t\t3D80DA2F1DF820620028D040 /* RCTInvalidating.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */; };\n\t\t3D80DA301DF820620028D040 /* RCTJavaScriptExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */; };\n\t\t3D80DA311DF820620028D040 /* RCTJavaScriptLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */; };\n\t\t3D80DA321DF820620028D040 /* RCTJSStackFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 008341F51D1DB34400876D9A /* RCTJSStackFrame.h */; };\n\t\t3D80DA331DF820620028D040 /* RCTKeyCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */; };\n\t\t3D80DA341DF820620028D040 /* RCTLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4D1A601E3B00E9B192 /* RCTLog.h */; };\n\t\t3D80DA351DF820620028D040 /* RCTModuleData.h in Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */; };\n\t\t3D80DA361DF820620028D040 /* RCTModuleMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */; };\n\t\t3D80DA371DF820620028D040 /* RCTMultipartDataTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */; };\n\t\t3D80DA381DF820620028D040 /* RCTMultipartStreamReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */; };\n\t\t3D80DA391DF820620028D040 /* RCTNullability.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20F1C19ABC700845B82 /* RCTNullability.h */; };\n\t\t3D80DA3A1DF820620028D040 /* RCTParserUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */; };\n\t\t3D80DA3B1DF820620028D040 /* RCTPerformanceLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 142014181B32094000CC17BA /* RCTPerformanceLogger.h */; };\n\t\t3D80DA3C1DF820620028D040 /* RCTPlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7749421DC1065C007EC8D8 /* RCTPlatform.h */; };\n\t\t3D80DA3D1DF820620028D040 /* RCTRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 830A229C1A66C68A008503DA /* RCTRootView.h */; };\n\t\t3D80DA3E1DF820620028D040 /* RCTRootViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */; };\n\t\t3D80DA3F1DF820620028D040 /* RCTRootViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A15FB0C1BDF663500531DFB /* RCTRootViewInternal.h */; };\n\t\t3D80DA401DF820620028D040 /* RCTTouchEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 391E86A31C623EC800009732 /* RCTTouchEvent.h */; };\n\t\t3D80DA411DF820620028D040 /* RCTTouchHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */; };\n\t\t3D80DA421DF820620028D040 /* RCTURLRequestDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; };\n\t\t3D80DA431DF820620028D040 /* RCTURLRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; };\n\t\t3D80DA441DF820620028D040 /* RCTUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; };\n\t\t3D80DA481DF820620028D040 /* RCTJSCExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */; };\n\t\t3D80DA491DF820620028D040 /* RCTJSCSamplingProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */; };\n\t\t3D80DA4A1DF820620028D040 /* RCTAccessibilityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E9B20B791B500126007A2DA7 /* RCTAccessibilityManager.h */; };\n\t\t3D80DA4B1DF820620028D040 /* RCTAlertManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */; };\n\t\t3D80DA4C1DF820620028D040 /* RCTAppState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1372B7081AB030C200659ED6 /* RCTAppState.h */; };\n\t\t3D80DA4D1DF820620028D040 /* RCTAsyncLocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */; };\n\t\t3D80DA4E1DF820620028D040 /* RCTClipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 13D033611C1837FE0021DC29 /* RCTClipboard.h */; };\n\t\t3D80DA4F1DF820620028D040 /* RCTDevLoadingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */; };\n\t\t3D80DA501DF820620028D040 /* RCTDevMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 13A0C2871B74F71200B29F6F /* RCTDevMenu.h */; };\n\t\t3D80DA511DF820620028D040 /* RCTEventEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */; };\n\t\t3D80DA521DF820620028D040 /* RCTExceptionsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */; };\n\t\t3D80DA531DF820620028D040 /* RCTI18nManager.h in Headers */ = {isa = PBXBuildFile; fileRef = B233E6E81D2D843200BC68BA /* RCTI18nManager.h */; };\n\t\t3D80DA541DF820620028D040 /* RCTI18nUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */; };\n\t\t3D80DA551DF820620028D040 /* RCTKeyboardObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 13D9FEEC1CDCD93000158BD7 /* RCTKeyboardObserver.h */; };\n\t\t3D80DA561DF820620028D040 /* RCTRedBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 13F17A831B8493E5007D4C75 /* RCTRedBox.h */; };\n\t\t3D80DA571DF820620028D040 /* RCTSourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */; };\n\t\t3D80DA581DF820620028D040 /* RCTStatusBarManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */; };\n\t\t3D80DA591DF820620028D040 /* RCTTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B07FED1A69327A00A75B9A /* RCTTiming.h */; };\n\t\t3D80DA5A1DF820620028D040 /* RCTUIManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E067481A70F434002CDEE1 /* RCTUIManager.h */; };\n\t\t3D80DA5B1DF820620028D040 /* RCTFPSGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */; };\n\t\t3D80DA5D1DF820620028D040 /* RCTMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BF71811C04795500C97D0C /* RCTMacros.h */; };\n\t\t3D80DA5E1DF820620028D040 /* RCTProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 1450FF801BCFF28A00208362 /* RCTProfile.h */; };\n\t\t3D80DA5F1DF820620028D040 /* RCTActivityIndicatorView.h in Headers */ = {isa = PBXBuildFile; fileRef = B95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */; };\n\t\t3D80DA601DF820620028D040 /* RCTActivityIndicatorViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */; };\n\t\t3D80DA611DF820620028D040 /* RCTAnimationType.h in Headers */ = {isa = PBXBuildFile; fileRef = 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */; };\n\t\t3D80DA621DF820620028D040 /* RCTAutoInsetsProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */; };\n\t\t3D80DA631DF820620028D040 /* RCTBorderDrawing.h in Headers */ = {isa = PBXBuildFile; fileRef = 13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */; };\n\t\t3D80DA641DF820620028D040 /* RCTBorderStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = ACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */; };\n\t\t3D80DA651DF820620028D040 /* RCTComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };\n\t\t3D80DA661DF820620028D040 /* RCTComponentData.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };\n\t\t3D80DA671DF820620028D040 /* RCTConvert+CoreLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };\n\t\t3D80DA691DF820620028D040 /* RCTDatePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */; };\n\t\t3D80DA6A1DF820620028D040 /* RCTDatePickerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */; };\n\t\t3D80DA6B1DF820620028D040 /* RCTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };\n\t\t3D80DA701DF820620028D040 /* RCTModalHostView.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };\n\t\t3D80DA711DF820620028D040 /* RCTModalHostViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };\n\t\t3D80DA721DF820620028D040 /* RCTModalHostViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };\n\t\t3D80DA731DF820620028D040 /* RCTNavigator.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B0800C1A69489C00A75B9A /* RCTNavigator.h */; };\n\t\t3D80DA741DF820620028D040 /* RCTNavigatorManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B0800E1A69489C00A75B9A /* RCTNavigatorManager.h */; };\n\t\t3D80DA751DF820620028D040 /* RCTNavItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B080101A69489C00A75B9A /* RCTNavItem.h */; };\n\t\t3D80DA761DF820620028D040 /* RCTNavItemManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B080121A69489C00A75B9A /* RCTNavItemManager.h */; };\n\t\t3D80DA771DF820620028D040 /* RCTPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 58114A121AAE854800E7D092 /* RCTPicker.h */; };\n\t\t3D80DA781DF820620028D040 /* RCTPickerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 58114A141AAE854800E7D092 /* RCTPickerManager.h */; };\n\t\t3D80DA791DF820620028D040 /* RCTPointerEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */; };\n\t\t3D80DA7A1DF820620028D040 /* RCTProgressViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */; };\n\t\t3D80DA7B1DF820620028D040 /* RCTRefreshControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 191E3EBF1C29DC3800C180A6 /* RCTRefreshControl.h */; };\n\t\t3D80DA7C1DF820620028D040 /* RCTRefreshControlManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 191E3EBC1C29D9AF00C180A6 /* RCTRefreshControlManager.h */; };\n\t\t3D80DA7D1DF820620028D040 /* RCTRootShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */; };\n\t\t3D80DA811DF820620028D040 /* RCTSegmentedControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */; };\n\t\t3D80DA821DF820620028D040 /* RCTSegmentedControlManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */; };\n\t\t3D80DA831DF820620028D040 /* RCTShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */; };\n\t\t3D80DA841DF820620028D040 /* RCTSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AF20431AE707F8005F5298 /* RCTSlider.h */; };\n\t\t3D80DA851DF820620028D040 /* RCTSliderManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */; };\n\t\t3D80DA861DF820620028D040 /* RCTSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F362071AABD06A001CE568 /* RCTSwitch.h */; };\n\t\t3D80DA871DF820620028D040 /* RCTSwitchManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F362091AABD06A001CE568 /* RCTSwitchManager.h */; };\n\t\t3D80DA881DF820620028D040 /* RCTTabBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 137327DF1AA5CF210034F82E /* RCTTabBar.h */; };\n\t\t3D80DA891DF820620028D040 /* RCTTabBarItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 137327E11AA5CF210034F82E /* RCTTabBarItem.h */; };\n\t\t3D80DA8A1DF820620028D040 /* RCTTabBarItemManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 137327E31AA5CF210034F82E /* RCTTabBarItemManager.h */; };\n\t\t3D80DA8B1DF820620028D040 /* RCTTabBarManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 137327E51AA5CF210034F82E /* RCTTabBarManager.h */; };\n\t\t3D80DA8C1DF820620028D040 /* RCTTextDecorationLineType.h in Headers */ = {isa = PBXBuildFile; fileRef = E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */; };\n\t\t3D80DA8D1DF820620028D040 /* RCTView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674F1A70F44B002CDEE1 /* RCTView.h */; };\n\t\t3D80DA8F1DF820620028D040 /* RCTViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */; };\n\t\t3D80DA901DF820620028D040 /* RCTWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C156011AB1A2840079392D /* RCTWebView.h */; };\n\t\t3D80DA911DF820620028D040 /* RCTWebViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C156031AB1A2840079392D /* RCTWebViewManager.h */; };\n\t\t3D80DA921DF820620028D040 /* RCTWrapperViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B080231A694A8400A75B9A /* RCTWrapperViewController.h */; };\n\t\t3D80DA931DF820620028D040 /* UIView+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 83F15A171B7CC46900F10295 /* UIView+Private.h */; };\n\t\t3D80DA941DF820620028D040 /* UIView+React.h in Headers */ = {isa = PBXBuildFile; fileRef = 13E067531A70F44B002CDEE1 /* UIView+React.h */; };\n\t\t3D80DABA1DF821850028D040 /* JSBundleType.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */; };\n\t\t3D80DABC1DF821A00028D040 /* JavaScriptCore.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */; };\n\t\t3D80DABD1DF821A00028D040 /* JSCWrapper.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */; };\n\t\t3DCD185D1DF978E7007FE5A1 /* RCTReloadCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = A2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */; };\n\t\t3DCE52D91FEAB02700613583 /* libyoga.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3C06751DE3340C00C268FA /* libyoga.a */; };\n\t\t3DCE52DA1FEAB04200613583 /* YGEnums.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBF1BC1FB50263002CBB31 /* YGEnums.cpp */; };\n\t\t3DCE52DB1FEAB04200613583 /* YGEnums.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBF1BC1FB50263002CBB31 /* YGEnums.cpp */; };\n\t\t3DCE52DC1FEAB05000613583 /* Yoga-internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 53CBF1BB1FB50262002CBB31 /* Yoga-internal.h */; };\n\t\t3DCE52DD1FEAB05000613583 /* Yoga-internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 53CBF1BB1FB50262002CBB31 /* Yoga-internal.h */; };\n\t\t3DCE52DE1FEAB05200613583 /* Yoga.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBF1BD1FB50263002CBB31 /* Yoga.cpp */; };\n\t\t3DCE52DF1FEAB05300613583 /* Yoga.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBF1BD1FB50263002CBB31 /* Yoga.cpp */; };\n\t\t3DCE52E01FEAB06B00613583 /* RCTModalManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 91076A891F743AD70081B4FA /* RCTModalManager.m */; };\n\t\t3DCE52E11FEAB07600613583 /* RCTModalManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 91076A8A1F743AD70081B4FA /* RCTModalManager.h */; };\n\t\t3DCE52E21FEAB07600613583 /* RCTModalManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 91076A8A1F743AD70081B4FA /* RCTModalManager.h */; };\n\t\t3DDEC1521DDCE0CA0020BBDF /* RCTJSCSamplingProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 369123E01DDC75850095B341 /* RCTJSCSamplingProfiler.m */; };\n\t\t3DE4F8681DF85D8E00B9E5A0 /* YGEnums.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77031DF767AF001F9587 /* YGEnums.h */; };\n\t\t3DE4F8691DF85D8E00B9E5A0 /* YGMacros.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77041DF767AF001F9587 /* YGMacros.h */; };\n\t\t3DE4F86A1DF85D8E00B9E5A0 /* Yoga.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77081DF767AF001F9587 /* Yoga.h */; };\n\t\t3DFE0D161DF8574D00459392 /* YGEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77031DF767AF001F9587 /* YGEnums.h */; };\n\t\t3DFE0D171DF8574D00459392 /* YGMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77041DF767AF001F9587 /* YGMacros.h */; };\n\t\t3DFE0D191DF8574D00459392 /* Yoga.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77081DF767AF001F9587 /* Yoga.h */; };\n\t\t3DFE0D1A1DF8575800459392 /* YGEnums.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77031DF767AF001F9587 /* YGEnums.h */; };\n\t\t3DFE0D1B1DF8575800459392 /* YGMacros.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77041DF767AF001F9587 /* YGMacros.h */; };\n\t\t3DFE0D1C1DF8575800459392 /* Yoga.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77081DF767AF001F9587 /* Yoga.h */; };\n\t\t3EDCA8A51D3591E700450C31 /* RCTErrorInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */; };\n\t\t53330EE71FC6EE74008D7FA9 /* YGNodePrint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53330EE41FC6EE70008D7FA9 /* YGNodePrint.cpp */; };\n\t\t53330EE81FC6EE75008D7FA9 /* YGNodePrint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53330EE41FC6EE70008D7FA9 /* YGNodePrint.cpp */; };\n\t\t53330EEA1FC6EE7F008D7FA9 /* YGNodePrint.h in Headers */ = {isa = PBXBuildFile; fileRef = 53330EE31FC6EE70008D7FA9 /* YGNodePrint.h */; };\n\t\t53330EEB1FC6EE7F008D7FA9 /* YGNodePrint.h in Headers */ = {isa = PBXBuildFile; fileRef = 53330EE31FC6EE70008D7FA9 /* YGNodePrint.h */; };\n\t\t58114A161AAE854800E7D092 /* RCTPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A131AAE854800E7D092 /* RCTPicker.m */; };\n\t\t58114A171AAE854800E7D092 /* RCTPickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A151AAE854800E7D092 /* RCTPickerManager.m */; };\n\t\t58114A501AAE93D500E7D092 /* RCTAsyncLocalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A4E1AAE93D500E7D092 /* RCTAsyncLocalStorage.m */; };\n\t\t58C571C11AA56C1900CDF9C8 /* RCTDatePickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */; };\n\t\t595405571EC03A1700766D3C /* RCTShadowView+Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 595405551EC03A1700766D3C /* RCTShadowView+Layout.h */; };\n\t\t595405581EC03A1700766D3C /* RCTShadowView+Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 595405551EC03A1700766D3C /* RCTShadowView+Layout.h */; };\n\t\t595405591EC03A1700766D3C /* RCTShadowView+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 595405561EC03A1700766D3C /* RCTShadowView+Layout.m */; };\n\t\t5954055A1EC03A1700766D3C /* RCTShadowView+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 595405561EC03A1700766D3C /* RCTShadowView+Layout.m */; };\n\t\t5954055B1EC03A7F00766D3C /* RCTShadowView+Layout.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 595405551EC03A1700766D3C /* RCTShadowView+Layout.h */; };\n\t\t5954055C1EC03A8E00766D3C /* RCTShadowView+Layout.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 595405551EC03A1700766D3C /* RCTShadowView+Layout.h */; };\n\t\t597AD1BD1E577D7800152581 /* RCTRootContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 597AD1BB1E577D7800152581 /* RCTRootContentView.h */; };\n\t\t597AD1BE1E577D7800152581 /* RCTRootContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 597AD1BB1E577D7800152581 /* RCTRootContentView.h */; };\n\t\t597AD1BF1E577D7800152581 /* RCTRootContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 597AD1BC1E577D7800152581 /* RCTRootContentView.m */; };\n\t\t597AD1C01E577D7800152581 /* RCTRootContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 597AD1BC1E577D7800152581 /* RCTRootContentView.m */; };\n\t\t598C22D61EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 598C22D41EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.h */; };\n\t\t598C22D71EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 598C22D41EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.h */; };\n\t\t598C22D81EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 598C22D51EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.mm */; };\n\t\t598C22D91EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 598C22D51EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.mm */; };\n\t\t598C22DA1EDCBF61009AF445 /* RCTUIManagerObserverCoordinator.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 598C22D41EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.h */; };\n\t\t598C22DB1EDCBF82009AF445 /* RCTUIManagerObserverCoordinator.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 598C22D41EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.h */; };\n\t\t59DA562B1F71C6C700D9EADA /* RCTUIManagerUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 59DA56291F71C6C600D9EADA /* RCTUIManagerUtils.h */; };\n\t\t59DA562C1F71C6C700D9EADA /* RCTUIManagerUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 59DA56291F71C6C600D9EADA /* RCTUIManagerUtils.h */; };\n\t\t59DA562D1F71C6C700D9EADA /* RCTUIManagerUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 59DA562A1F71C6C700D9EADA /* RCTUIManagerUtils.m */; };\n\t\t59DA562E1F71C6C700D9EADA /* RCTUIManagerUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 59DA562A1F71C6C700D9EADA /* RCTUIManagerUtils.m */; };\n\t\t59DA562F1F71C73400D9EADA /* RCTUIManagerUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59DA56291F71C6C600D9EADA /* RCTUIManagerUtils.h */; };\n\t\t59DA56301F71C73F00D9EADA /* RCTUIManagerUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59DA56291F71C6C600D9EADA /* RCTUIManagerUtils.h */; };\n\t\t68EFE4EE1CF6EB3900A1DE13 /* RCTBundleURLProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */; };\n\t\t830A229E1A66C68A008503DA /* RCTRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 830A229D1A66C68A008503DA /* RCTRootView.m */; };\n\t\t83392EB31B6634E10013B15F /* RCTModalHostViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83392EB21B6634E10013B15F /* RCTModalHostViewController.m */; };\n\t\t83A1FE8C1B62640A00BE0E65 /* RCTModalHostView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */; };\n\t\t83A1FE8F1B62643A00BE0E65 /* RCTModalHostViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A1FE8E1B62643A00BE0E65 /* RCTModalHostViewManager.m */; };\n\t\t83CBBA511A601E3B00E9B192 /* RCTAssert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */; };\n\t\t83CBBA521A601E3B00E9B192 /* RCTLog.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4E1A601E3B00E9B192 /* RCTLog.mm */; };\n\t\t83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA501A601E3B00E9B192 /* RCTUtils.m */; };\n\t\t83CBBA601A601EAA00E9B192 /* RCTBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA5F1A601EAA00E9B192 /* RCTBridge.m */; };\n\t\t83CBBA691A601EF300E9B192 /* RCTEventDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */; };\n\t\t83CBBA981A6020BB00E9B192 /* RCTTouchHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */; };\n\t\t83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBACB1A6023D300E9B192 /* RCTConvert.m */; };\n\t\t916F9C2E1F743F7E002E5920 /* RCTModalManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 91076A891F743AD70081B4FA /* RCTModalManager.m */; };\n\t\t945929C41DD62ADD00653A7D /* RCTConvert+Transform.m in Sources */ = {isa = PBXBuildFile; fileRef = 945929C31DD62ADD00653A7D /* RCTConvert+Transform.m */; };\n\t\t945929C51DD62ADD00653A7D /* RCTConvert+Transform.m in Sources */ = {isa = PBXBuildFile; fileRef = 945929C31DD62ADD00653A7D /* RCTConvert+Transform.m */; };\n\t\tA12E9E1B1E5DEA350029001B /* RCTPackagerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A12E9E171E5DEA350029001B /* RCTPackagerClient.h */; };\n\t\tA12E9E1C1E5DEA350029001B /* RCTPackagerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = A12E9E181E5DEA350029001B /* RCTPackagerClient.m */; };\n\t\tA12E9E1F1E5DEAEF0029001B /* RCTPackagerClient.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = A12E9E171E5DEA350029001B /* RCTPackagerClient.h */; };\n\t\tA12E9E211E5DEAFB0029001B /* RCTPackagerClient.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = A12E9E171E5DEA350029001B /* RCTPackagerClient.h */; };\n\t\tA12E9E231E5DEB160029001B /* RCTPackagerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A12E9E171E5DEA350029001B /* RCTPackagerClient.h */; };\n\t\tA12E9E251E5DEB4D0029001B /* RCTPackagerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = A12E9E181E5DEA350029001B /* RCTPackagerClient.m */; };\n\t\tA12E9E2A1E5DEB860029001B /* RCTReconnectingWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = A12E9E281E5DEB860029001B /* RCTReconnectingWebSocket.h */; };\n\t\tA12E9E2B1E5DEB860029001B /* RCTSRWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = A12E9E291E5DEB860029001B /* RCTSRWebSocket.h */; };\n\t\tA2440AA21DF8D854006E7BFC /* RCTReloadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; };\n\t\tA2440AA31DF8D854006E7BFC /* RCTReloadCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = A2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */; };\n\t\tA2440AA41DF8D865006E7BFC /* RCTReloadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; };\n\t\tAC70D2E91DE489E4002E6351 /* RCTJavaScriptLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */; };\n\t\tB233E6EA1D2D845D00BC68BA /* RCTI18nManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B233E6E91D2D845D00BC68BA /* RCTI18nManager.m */; };\n\t\tB505583E1E43DFB900F71A00 /* RCTDevMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = B505583B1E43DFB900F71A00 /* RCTDevMenu.m */; };\n\t\tB505583F1E43DFB900F71A00 /* RCTDevSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = B505583C1E43DFB900F71A00 /* RCTDevSettings.h */; };\n\t\tB50558401E43DFB900F71A00 /* RCTDevSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = B505583D1E43DFB900F71A00 /* RCTDevSettings.mm */; };\n\t\tB50558411E43E13D00F71A00 /* RCTDevMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = B505583B1E43DFB900F71A00 /* RCTDevMenu.m */; };\n\t\tB50558421E43E14000F71A00 /* RCTDevSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = B505583D1E43DFB900F71A00 /* RCTDevSettings.mm */; };\n\t\tB50558431E43E64600F71A00 /* RCTDevSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = B505583C1E43DFB900F71A00 /* RCTDevSettings.h */; };\n\t\tB95154321D1B34B200FE7B80 /* RCTActivityIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = B95154311D1B34B200FE7B80 /* RCTActivityIndicatorView.m */; };\n\t\tC60128B11F3D128C009DF9FF /* RCTCxxConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = C60128AF1F3D128C009DF9FF /* RCTCxxConvert.h */; };\n\t\tC60128B21F3D128C009DF9FF /* RCTCxxConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = C60128AF1F3D128C009DF9FF /* RCTCxxConvert.h */; };\n\t\tC60128B31F3D128C009DF9FF /* RCTCxxConvert.m in Sources */ = {isa = PBXBuildFile; fileRef = C60128B01F3D128C009DF9FF /* RCTCxxConvert.m */; };\n\t\tC60128B41F3D128C009DF9FF /* RCTCxxConvert.m in Sources */ = {isa = PBXBuildFile; fileRef = C60128B01F3D128C009DF9FF /* RCTCxxConvert.m */; };\n\t\tC60669311F3CC7BD00E67165 /* RCTModuleMethod.mm in Sources */ = {isa = PBXBuildFile; fileRef = C60669301F3CC7BD00E67165 /* RCTModuleMethod.mm */; };\n\t\tC60669321F3CC7BD00E67165 /* RCTModuleMethod.mm in Sources */ = {isa = PBXBuildFile; fileRef = C60669301F3CC7BD00E67165 /* RCTModuleMethod.mm */; };\n\t\tC60669391F3CCF3F00E67165 /* RCTManagedPointer.mm in Sources */ = {isa = PBXBuildFile; fileRef = C60669381F3CCF3F00E67165 /* RCTManagedPointer.mm */; };\n\t\tC606693A1F3CCF3F00E67165 /* RCTManagedPointer.mm in Sources */ = {isa = PBXBuildFile; fileRef = C60669381F3CCF3F00E67165 /* RCTManagedPointer.mm */; };\n\t\tC65450611F3BD94C0090799B /* RCTManagedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = C65450601F3BD94C0090799B /* RCTManagedPointer.h */; };\n\t\tC65450621F3BD94C0090799B /* RCTManagedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = C65450601F3BD94C0090799B /* RCTManagedPointer.h */; };\n\t\tC6FC33521F70494E00643E54 /* RCTShadowView+Internal.m in Sources */ = {isa = PBXBuildFile; fileRef = C6FC33511F7048A800643E54 /* RCTShadowView+Internal.m */; };\n\t\tC6FC33531F70494F00643E54 /* RCTShadowView+Internal.m in Sources */ = {isa = PBXBuildFile; fileRef = C6FC33511F7048A800643E54 /* RCTShadowView+Internal.m */; };\n\t\tC6FC33541F70495200643E54 /* RCTShadowView+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C6FC33501F7048A800643E54 /* RCTShadowView+Internal.h */; };\n\t\tC6FC33551F70495300643E54 /* RCTShadowView+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C6FC33501F7048A800643E54 /* RCTShadowView+Internal.h */; };\n\t\tCF85BC321E79EC6B00F1EF3B /* RCTDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = CF85BC301E79EC6B00F1EF3B /* RCTDeviceInfo.h */; };\n\t\tCF85BC331E79EC6B00F1EF3B /* RCTDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = CF85BC311E79EC6B00F1EF3B /* RCTDeviceInfo.m */; };\n\t\tCF85BC341E79EC7A00F1EF3B /* RCTDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = CF85BC301E79EC6B00F1EF3B /* RCTDeviceInfo.h */; };\n\t\tCF85BC351E79EC7D00F1EF3B /* RCTDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = CF85BC311E79EC6B00F1EF3B /* RCTDeviceInfo.m */; };\n\t\tE9B20B7B1B500126007A2DA7 /* RCTAccessibilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E9B20B7A1B500126007A2DA7 /* RCTAccessibilityManager.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t3D0574541DE5FF9600184BB4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3C059B1DE3340C00C268FA;\n\t\t\tremoteInfo = \"yoga-tvOS\";\n\t\t};\n\t\t3D0574561DE5FF9600184BB4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3CD9261DE5FBEE00167DC4;\n\t\t\tremoteInfo = \"cxxreact-tvOS\";\n\t\t};\n\t\t3D0574581DE5FF9600184BB4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3CD90C1DE5FBD800167DC4;\n\t\t\tremoteInfo = \"jschelpers-tvOS\";\n\t\t};\n\t\t3D3CD9491DE5FCE700167DC4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3C04B91DE3340900C268FA;\n\t\t\tremoteInfo = yoga;\n\t\t};\n\t\t3D3CD94B1DE5FCE700167DC4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3CD9191DE5FBEC00167DC4;\n\t\t\tremoteInfo = cxxreact;\n\t\t};\n\t\t3D3CD94D1DE5FCE700167DC4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3CD8FF1DE5FBD600167DC4;\n\t\t\tremoteInfo = jschelpers;\n\t\t};\n\t\t3D3CD94F1DE5FDB900167DC4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 3D3CD8FF1DE5FBD600167DC4;\n\t\t\tremoteInfo = jschelpers;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t3D302E191DF8249100D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/React;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t59DA56301F71C73F00D9EADA /* RCTUIManagerUtils.h in Copy Headers */,\n\t\t\t\t598C22DB1EDCBF82009AF445 /* RCTUIManagerObserverCoordinator.h in Copy Headers */,\n\t\t\t\t5954055C1EC03A8E00766D3C /* RCTShadowView+Layout.h in Copy Headers */,\n\t\t\t\t2D7B05391E9D82080032604E /* RCTBridge+Private.h in Copy Headers */,\n\t\t\t\t3D6B76D51E83DD3A008FA614 /* RCTDevSettings.h in Copy Headers */,\n\t\t\t\t3D6B76D61E83DD3A008FA614 /* RCTConvert+Transform.h in Copy Headers */,\n\t\t\t\tA12E9E211E5DEAFB0029001B /* RCTPackagerClient.h in Copy Headers */,\n\t\t\t\t3D5AC71D1E00572F000F9153 /* RCTTVView.h in Copy Headers */,\n\t\t\t\t3D5AC71B1E005723000F9153 /* RCTReloadCommand.h in Copy Headers */,\n\t\t\t\t3D5AC71C1E005723000F9153 /* RCTTVNavigationEventEmitter.h in Copy Headers */,\n\t\t\t\t3D302FA01DF8290600D6DDAE /* RCTImageLoader.h in Copy Headers */,\n\t\t\t\t3D302FA11DF8290600D6DDAE /* RCTImageStoreManager.h in Copy Headers */,\n\t\t\t\t3D302FA21DF8290600D6DDAE /* RCTResizeMode.h in Copy Headers */,\n\t\t\t\t3D302FA31DF8290600D6DDAE /* RCTLinkingManager.h in Copy Headers */,\n\t\t\t\t3D302FA41DF8290600D6DDAE /* RCTNetworking.h in Copy Headers */,\n\t\t\t\t3D302FA51DF8290600D6DDAE /* RCTNetworkTask.h in Copy Headers */,\n\t\t\t\t3D302FA61DF8290600D6DDAE /* RCTPushNotificationManager.h in Copy Headers */,\n\t\t\t\t3D302FA71DF8290600D6DDAE /* RCTAssert.h in Copy Headers */,\n\t\t\t\t3D302FA81DF8290600D6DDAE /* RCTBridge.h in Copy Headers */,\n\t\t\t\t3D302FAA1DF8290600D6DDAE /* RCTBridgeDelegate.h in Copy Headers */,\n\t\t\t\t3D302FAB1DF8290600D6DDAE /* RCTBridgeMethod.h in Copy Headers */,\n\t\t\t\t3D302FAC1DF8290600D6DDAE /* RCTBridgeModule.h in Copy Headers */,\n\t\t\t\t3D302FAD1DF8290600D6DDAE /* RCTBundleURLProvider.h in Copy Headers */,\n\t\t\t\t3D302FAE1DF8290600D6DDAE /* RCTConvert.h in Copy Headers */,\n\t\t\t\t3D302FAF1DF8290600D6DDAE /* RCTDefines.h in Copy Headers */,\n\t\t\t\t3D302FB01DF8290600D6DDAE /* RCTDisplayLink.h in Copy Headers */,\n\t\t\t\t3D302FB11DF8290600D6DDAE /* RCTErrorCustomizer.h in Copy Headers */,\n\t\t\t\t3D302FB21DF8290600D6DDAE /* RCTErrorInfo.h in Copy Headers */,\n\t\t\t\t3D302FB31DF8290600D6DDAE /* RCTEventDispatcher.h in Copy Headers */,\n\t\t\t\t3D302FB41DF8290600D6DDAE /* RCTFrameUpdate.h in Copy Headers */,\n\t\t\t\t3D302FB51DF8290600D6DDAE /* RCTImageSource.h in Copy Headers */,\n\t\t\t\t3D302FB61DF8290600D6DDAE /* RCTInvalidating.h in Copy Headers */,\n\t\t\t\t3D302FB71DF8290600D6DDAE /* RCTJavaScriptExecutor.h in Copy Headers */,\n\t\t\t\t3D302FB81DF8290600D6DDAE /* RCTJavaScriptLoader.h in Copy Headers */,\n\t\t\t\t3D302FB91DF8290600D6DDAE /* RCTJSStackFrame.h in Copy Headers */,\n\t\t\t\t3D302FBA1DF8290600D6DDAE /* RCTKeyCommands.h in Copy Headers */,\n\t\t\t\t3D302FBB1DF8290600D6DDAE /* RCTLog.h in Copy Headers */,\n\t\t\t\t3D302FBC1DF8290600D6DDAE /* RCTModuleData.h in Copy Headers */,\n\t\t\t\t3D302FBD1DF8290600D6DDAE /* RCTModuleMethod.h in Copy Headers */,\n\t\t\t\t3D302FBE1DF8290600D6DDAE /* RCTMultipartDataTask.h in Copy Headers */,\n\t\t\t\t3D302FBF1DF8290600D6DDAE /* RCTMultipartStreamReader.h in Copy Headers */,\n\t\t\t\t3D302FC01DF8290600D6DDAE /* RCTNullability.h in Copy Headers */,\n\t\t\t\t3D302FC11DF8290600D6DDAE /* RCTParserUtils.h in Copy Headers */,\n\t\t\t\t3D302FC21DF8290600D6DDAE /* RCTPerformanceLogger.h in Copy Headers */,\n\t\t\t\t3D302FC31DF8290600D6DDAE /* RCTPlatform.h in Copy Headers */,\n\t\t\t\t3D302FC41DF8290600D6DDAE /* RCTRootView.h in Copy Headers */,\n\t\t\t\t3D302FC51DF8290600D6DDAE /* RCTRootViewDelegate.h in Copy Headers */,\n\t\t\t\t3D302FC71DF8290600D6DDAE /* RCTTouchEvent.h in Copy Headers */,\n\t\t\t\t3D302FC81DF8290600D6DDAE /* RCTTouchHandler.h in Copy Headers */,\n\t\t\t\t3D302FC91DF8290600D6DDAE /* RCTURLRequestDelegate.h in Copy Headers */,\n\t\t\t\t3D302FCA1DF8290600D6DDAE /* RCTURLRequestHandler.h in Copy Headers */,\n\t\t\t\t3D302FCB1DF8290600D6DDAE /* RCTUtils.h in Copy Headers */,\n\t\t\t\t3D302FCF1DF8290600D6DDAE /* RCTJSCExecutor.h in Copy Headers */,\n\t\t\t\t3D302FD01DF8290600D6DDAE /* RCTJSCSamplingProfiler.h in Copy Headers */,\n\t\t\t\t3D302FD11DF8290600D6DDAE /* RCTAccessibilityManager.h in Copy Headers */,\n\t\t\t\t3D302FD21DF8290600D6DDAE /* RCTAlertManager.h in Copy Headers */,\n\t\t\t\t3D302FD31DF8290600D6DDAE /* RCTAppState.h in Copy Headers */,\n\t\t\t\t3D302FD41DF8290600D6DDAE /* RCTAsyncLocalStorage.h in Copy Headers */,\n\t\t\t\t3D302FD51DF8290600D6DDAE /* RCTClipboard.h in Copy Headers */,\n\t\t\t\t3D302FD61DF8290600D6DDAE /* RCTDevLoadingView.h in Copy Headers */,\n\t\t\t\t3D302FD71DF8290600D6DDAE /* RCTDevMenu.h in Copy Headers */,\n\t\t\t\t3D302FD81DF8290600D6DDAE /* RCTEventEmitter.h in Copy Headers */,\n\t\t\t\t3D302FD91DF8290600D6DDAE /* RCTExceptionsManager.h in Copy Headers */,\n\t\t\t\t3D302FDA1DF8290600D6DDAE /* RCTI18nManager.h in Copy Headers */,\n\t\t\t\t3D302FDB1DF8290600D6DDAE /* RCTI18nUtil.h in Copy Headers */,\n\t\t\t\t3D302FDC1DF8290600D6DDAE /* RCTKeyboardObserver.h in Copy Headers */,\n\t\t\t\t3D302FDD1DF8290600D6DDAE /* RCTRedBox.h in Copy Headers */,\n\t\t\t\t3D302FDE1DF8290600D6DDAE /* RCTSourceCode.h in Copy Headers */,\n\t\t\t\t3D302FDF1DF8290600D6DDAE /* RCTStatusBarManager.h in Copy Headers */,\n\t\t\t\t3D302FE01DF8290600D6DDAE /* RCTTiming.h in Copy Headers */,\n\t\t\t\t3D302FE11DF8290600D6DDAE /* RCTUIManager.h in Copy Headers */,\n\t\t\t\t3D302FE21DF8290600D6DDAE /* RCTFPSGraph.h in Copy Headers */,\n\t\t\t\t3D302FE41DF8290600D6DDAE /* RCTMacros.h in Copy Headers */,\n\t\t\t\t3D302FE51DF8290600D6DDAE /* RCTProfile.h in Copy Headers */,\n\t\t\t\t3D302FE61DF8290600D6DDAE /* RCTActivityIndicatorView.h in Copy Headers */,\n\t\t\t\t3D302FE71DF8290600D6DDAE /* RCTActivityIndicatorViewManager.h in Copy Headers */,\n\t\t\t\t3D302FE81DF8290600D6DDAE /* RCTAnimationType.h in Copy Headers */,\n\t\t\t\t3D302FE91DF8290600D6DDAE /* RCTAutoInsetsProtocol.h in Copy Headers */,\n\t\t\t\t3D302FEA1DF8290600D6DDAE /* RCTBorderDrawing.h in Copy Headers */,\n\t\t\t\t3D302FEB1DF8290600D6DDAE /* RCTBorderStyle.h in Copy Headers */,\n\t\t\t\t3D302FEC1DF8290600D6DDAE /* RCTComponent.h in Copy Headers */,\n\t\t\t\t3D302FED1DF8290600D6DDAE /* RCTComponentData.h in Copy Headers */,\n\t\t\t\t3D302FEE1DF8290600D6DDAE /* RCTConvert+CoreLocation.h in Copy Headers */,\n\t\t\t\t3D302FF21DF8290600D6DDAE /* RCTFont.h in Copy Headers */,\n\t\t\t\t3D302FF71DF8290600D6DDAE /* RCTModalHostView.h in Copy Headers */,\n\t\t\t\t3D302FF81DF8290600D6DDAE /* RCTModalHostViewController.h in Copy Headers */,\n\t\t\t\t3D302FF91DF8290600D6DDAE /* RCTModalHostViewManager.h in Copy Headers */,\n\t\t\t\t3D302FFA1DF8290600D6DDAE /* RCTNavigator.h in Copy Headers */,\n\t\t\t\t3D302FFB1DF8290600D6DDAE /* RCTNavigatorManager.h in Copy Headers */,\n\t\t\t\t3D302FFC1DF8290600D6DDAE /* RCTNavItem.h in Copy Headers */,\n\t\t\t\t3D302FFD1DF8290600D6DDAE /* RCTNavItemManager.h in Copy Headers */,\n\t\t\t\t3D3030001DF8290600D6DDAE /* RCTPointerEvents.h in Copy Headers */,\n\t\t\t\t3D3030011DF8290600D6DDAE /* RCTProgressViewManager.h in Copy Headers */,\n\t\t\t\t3D3030021DF8290600D6DDAE /* RCTRefreshControl.h in Copy Headers */,\n\t\t\t\t3D3030031DF8290600D6DDAE /* RCTRefreshControlManager.h in Copy Headers */,\n\t\t\t\t3D3030041DF8290600D6DDAE /* RCTRootShadowView.h in Copy Headers */,\n\t\t\t\t3D3030081DF8290600D6DDAE /* RCTSegmentedControl.h in Copy Headers */,\n\t\t\t\t3D3030091DF8290600D6DDAE /* RCTSegmentedControlManager.h in Copy Headers */,\n\t\t\t\t3D30300A1DF8290600D6DDAE /* RCTShadowView.h in Copy Headers */,\n\t\t\t\t3D30300B1DF8290600D6DDAE /* RCTSlider.h in Copy Headers */,\n\t\t\t\t3D30300C1DF8290600D6DDAE /* RCTSliderManager.h in Copy Headers */,\n\t\t\t\t3D30300D1DF8290600D6DDAE /* RCTSwitch.h in Copy Headers */,\n\t\t\t\t3D30300E1DF8290600D6DDAE /* RCTSwitchManager.h in Copy Headers */,\n\t\t\t\t3D30300F1DF8290600D6DDAE /* RCTTabBar.h in Copy Headers */,\n\t\t\t\t3D3030101DF8290600D6DDAE /* RCTTabBarItem.h in Copy Headers */,\n\t\t\t\t3D3030111DF8290600D6DDAE /* RCTTabBarItemManager.h in Copy Headers */,\n\t\t\t\t3D3030121DF8290600D6DDAE /* RCTTabBarManager.h in Copy Headers */,\n\t\t\t\t3D3030131DF8290600D6DDAE /* RCTTextDecorationLineType.h in Copy Headers */,\n\t\t\t\t3D3030141DF8290600D6DDAE /* RCTView.h in Copy Headers */,\n\t\t\t\t3D3030161DF8290600D6DDAE /* RCTViewManager.h in Copy Headers */,\n\t\t\t\t3D3030191DF8290600D6DDAE /* RCTWrapperViewController.h in Copy Headers */,\n\t\t\t\t3D30301B1DF8290600D6DDAE /* UIView+React.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D302F171DF825FE00D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/yoga;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3DFE0D1A1DF8575800459392 /* YGEnums.h in Copy Headers */,\n\t\t\t\t3DFE0D1B1DF8575800459392 /* YGMacros.h in Copy Headers */,\n\t\t\t\t3DFE0D1C1DF8575800459392 /* Yoga.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D302F1B1DF8263300D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/cxxreact;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3D302F1C1DF8264000D6DDAE /* JSBundleType.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D302F1D1DF8264A00D6DDAE /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/jschelpers;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3D302F1E1DF8265A00D6DDAE /* JavaScriptCore.h in Copy Headers */,\n\t\t\t\t3D302F1F1DF8265A00D6DDAE /* JSCWrapper.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D80D91E1DF6FA530028D040 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/React;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t59DA562F1F71C73400D9EADA /* RCTUIManagerUtils.h in Copy Headers */,\n\t\t\t\t598C22DA1EDCBF61009AF445 /* RCTUIManagerObserverCoordinator.h in Copy Headers */,\n\t\t\t\t5954055B1EC03A7F00766D3C /* RCTShadowView+Layout.h in Copy Headers */,\n\t\t\t\t3D7BFCEB1EA8E23A008DFB7A /* RCTDevSettings.h in Copy Headers */,\n\t\t\t\tA12E9E1F1E5DEAEF0029001B /* RCTPackagerClient.h in Copy Headers */,\n\t\t\t\t3D80D91F1DF6FA890028D040 /* RCTImageLoader.h in Copy Headers */,\n\t\t\t\t3D80D9201DF6FA890028D040 /* RCTImageStoreManager.h in Copy Headers */,\n\t\t\t\t3D80D9211DF6FA890028D040 /* RCTResizeMode.h in Copy Headers */,\n\t\t\t\t3D80D9221DF6FA890028D040 /* RCTLinkingManager.h in Copy Headers */,\n\t\t\t\t3D80D9231DF6FA890028D040 /* RCTNetworking.h in Copy Headers */,\n\t\t\t\t3D80D9241DF6FA890028D040 /* RCTNetworkTask.h in Copy Headers */,\n\t\t\t\t3D80D9251DF6FA890028D040 /* RCTPushNotificationManager.h in Copy Headers */,\n\t\t\t\t3D80D9261DF6FA890028D040 /* RCTAssert.h in Copy Headers */,\n\t\t\t\t3D80D9271DF6FA890028D040 /* RCTBridge.h in Copy Headers */,\n\t\t\t\t3D80D9281DF6FA890028D040 /* RCTBridge+Private.h in Copy Headers */,\n\t\t\t\t3D80D9291DF6FA890028D040 /* RCTBridgeDelegate.h in Copy Headers */,\n\t\t\t\t3D80D92A1DF6FA890028D040 /* RCTBridgeMethod.h in Copy Headers */,\n\t\t\t\t3D80D92B1DF6FA890028D040 /* RCTBridgeModule.h in Copy Headers */,\n\t\t\t\t3D80D92C1DF6FA890028D040 /* RCTBundleURLProvider.h in Copy Headers */,\n\t\t\t\t3D80D92D1DF6FA890028D040 /* RCTConvert.h in Copy Headers */,\n\t\t\t\t3D80D92E1DF6FA890028D040 /* RCTDefines.h in Copy Headers */,\n\t\t\t\t3D80D92F1DF6FA890028D040 /* RCTDisplayLink.h in Copy Headers */,\n\t\t\t\t3D80D9301DF6FA890028D040 /* RCTErrorCustomizer.h in Copy Headers */,\n\t\t\t\t3D80D9311DF6FA890028D040 /* RCTErrorInfo.h in Copy Headers */,\n\t\t\t\t3D80D9321DF6FA890028D040 /* RCTEventDispatcher.h in Copy Headers */,\n\t\t\t\t3D80D9331DF6FA890028D040 /* RCTFrameUpdate.h in Copy Headers */,\n\t\t\t\t3D80D9341DF6FA890028D040 /* RCTImageSource.h in Copy Headers */,\n\t\t\t\t3D80D9351DF6FA890028D040 /* RCTInvalidating.h in Copy Headers */,\n\t\t\t\t3D80D9361DF6FA890028D040 /* RCTJavaScriptExecutor.h in Copy Headers */,\n\t\t\t\t3D80D9371DF6FA890028D040 /* RCTJavaScriptLoader.h in Copy Headers */,\n\t\t\t\t3D80D9381DF6FA890028D040 /* RCTJSStackFrame.h in Copy Headers */,\n\t\t\t\t3D80D9391DF6FA890028D040 /* RCTKeyCommands.h in Copy Headers */,\n\t\t\t\t3D80D93A1DF6FA890028D040 /* RCTLog.h in Copy Headers */,\n\t\t\t\t3D80D93B1DF6FA890028D040 /* RCTModuleData.h in Copy Headers */,\n\t\t\t\t3D80D93C1DF6FA890028D040 /* RCTModuleMethod.h in Copy Headers */,\n\t\t\t\t3D80D93D1DF6FA890028D040 /* RCTMultipartDataTask.h in Copy Headers */,\n\t\t\t\t3D80D93E1DF6FA890028D040 /* RCTMultipartStreamReader.h in Copy Headers */,\n\t\t\t\t3D80D93F1DF6FA890028D040 /* RCTNullability.h in Copy Headers */,\n\t\t\t\t3D80D9401DF6FA890028D040 /* RCTParserUtils.h in Copy Headers */,\n\t\t\t\t3D80D9411DF6FA890028D040 /* RCTPerformanceLogger.h in Copy Headers */,\n\t\t\t\t3D80D9421DF6FA890028D040 /* RCTPlatform.h in Copy Headers */,\n\t\t\t\t3D80D9431DF6FA890028D040 /* RCTRootView.h in Copy Headers */,\n\t\t\t\t3D80D9441DF6FA890028D040 /* RCTRootViewDelegate.h in Copy Headers */,\n\t\t\t\t3D80D9461DF6FA890028D040 /* RCTTouchEvent.h in Copy Headers */,\n\t\t\t\t3D80D9471DF6FA890028D040 /* RCTTouchHandler.h in Copy Headers */,\n\t\t\t\t3D80D9481DF6FA890028D040 /* RCTURLRequestDelegate.h in Copy Headers */,\n\t\t\t\t3D80D9491DF6FA890028D040 /* RCTURLRequestHandler.h in Copy Headers */,\n\t\t\t\t3D80D94A1DF6FA890028D040 /* RCTUtils.h in Copy Headers */,\n\t\t\t\t3D80D94E1DF6FA890028D040 /* RCTJSCExecutor.h in Copy Headers */,\n\t\t\t\t3D80D94F1DF6FA890028D040 /* RCTJSCSamplingProfiler.h in Copy Headers */,\n\t\t\t\t3D80D9501DF6FA890028D040 /* RCTAccessibilityManager.h in Copy Headers */,\n\t\t\t\t3D80D9511DF6FA890028D040 /* RCTAlertManager.h in Copy Headers */,\n\t\t\t\t3D80D9521DF6FA890028D040 /* RCTAppState.h in Copy Headers */,\n\t\t\t\t3D80D9531DF6FA890028D040 /* RCTAsyncLocalStorage.h in Copy Headers */,\n\t\t\t\t3D80D9541DF6FA890028D040 /* RCTClipboard.h in Copy Headers */,\n\t\t\t\t3D80D9551DF6FA890028D040 /* RCTDevLoadingView.h in Copy Headers */,\n\t\t\t\t3D80D9561DF6FA890028D040 /* RCTDevMenu.h in Copy Headers */,\n\t\t\t\t3D80D9571DF6FA890028D040 /* RCTEventEmitter.h in Copy Headers */,\n\t\t\t\t3D80D9581DF6FA890028D040 /* RCTExceptionsManager.h in Copy Headers */,\n\t\t\t\t3D80D9591DF6FA890028D040 /* RCTI18nManager.h in Copy Headers */,\n\t\t\t\t3D80D95A1DF6FA890028D040 /* RCTI18nUtil.h in Copy Headers */,\n\t\t\t\t3D80D95B1DF6FA890028D040 /* RCTKeyboardObserver.h in Copy Headers */,\n\t\t\t\t3D80D95C1DF6FA890028D040 /* RCTRedBox.h in Copy Headers */,\n\t\t\t\t3D80D95D1DF6FA890028D040 /* RCTSourceCode.h in Copy Headers */,\n\t\t\t\t3D80D95E1DF6FA890028D040 /* RCTStatusBarManager.h in Copy Headers */,\n\t\t\t\t3D80D95F1DF6FA890028D040 /* RCTTiming.h in Copy Headers */,\n\t\t\t\t3D80D9601DF6FA890028D040 /* RCTUIManager.h in Copy Headers */,\n\t\t\t\t3D80D9611DF6FA890028D040 /* RCTFPSGraph.h in Copy Headers */,\n\t\t\t\t3D80D9631DF6FA890028D040 /* RCTMacros.h in Copy Headers */,\n\t\t\t\t3D80D9641DF6FA890028D040 /* RCTProfile.h in Copy Headers */,\n\t\t\t\t3D80D9651DF6FA890028D040 /* RCTActivityIndicatorView.h in Copy Headers */,\n\t\t\t\t3D80D9661DF6FA890028D040 /* RCTActivityIndicatorViewManager.h in Copy Headers */,\n\t\t\t\t3D80D9671DF6FA890028D040 /* RCTAnimationType.h in Copy Headers */,\n\t\t\t\t3D80D9681DF6FA890028D040 /* RCTAutoInsetsProtocol.h in Copy Headers */,\n\t\t\t\t3D80D9691DF6FA890028D040 /* RCTBorderDrawing.h in Copy Headers */,\n\t\t\t\t3D80D96A1DF6FA890028D040 /* RCTBorderStyle.h in Copy Headers */,\n\t\t\t\t3D80D96B1DF6FA890028D040 /* RCTComponent.h in Copy Headers */,\n\t\t\t\t3D80D96C1DF6FA890028D040 /* RCTComponentData.h in Copy Headers */,\n\t\t\t\t3D80D96D1DF6FA890028D040 /* RCTConvert+CoreLocation.h in Copy Headers */,\n\t\t\t\t3D80D96F1DF6FA890028D040 /* RCTDatePicker.h in Copy Headers */,\n\t\t\t\t3D80D9701DF6FA890028D040 /* RCTDatePickerManager.h in Copy Headers */,\n\t\t\t\t3D80D9711DF6FA890028D040 /* RCTFont.h in Copy Headers */,\n\t\t\t\t3D80D9761DF6FA890028D040 /* RCTModalHostView.h in Copy Headers */,\n\t\t\t\t3D80D9771DF6FA890028D040 /* RCTModalHostViewController.h in Copy Headers */,\n\t\t\t\t3D80D9781DF6FA890028D040 /* RCTModalHostViewManager.h in Copy Headers */,\n\t\t\t\t3D80D9791DF6FA890028D040 /* RCTNavigator.h in Copy Headers */,\n\t\t\t\t3D80D97A1DF6FA890028D040 /* RCTNavigatorManager.h in Copy Headers */,\n\t\t\t\t3D80D97B1DF6FA890028D040 /* RCTNavItem.h in Copy Headers */,\n\t\t\t\t3D80D97C1DF6FA890028D040 /* RCTNavItemManager.h in Copy Headers */,\n\t\t\t\t3D80D97D1DF6FA890028D040 /* RCTPicker.h in Copy Headers */,\n\t\t\t\t3D80D97E1DF6FA890028D040 /* RCTPickerManager.h in Copy Headers */,\n\t\t\t\t3D80D97F1DF6FA890028D040 /* RCTPointerEvents.h in Copy Headers */,\n\t\t\t\t3D80D9801DF6FA890028D040 /* RCTProgressViewManager.h in Copy Headers */,\n\t\t\t\t3D80D9811DF6FA890028D040 /* RCTRefreshControl.h in Copy Headers */,\n\t\t\t\t3D80D9821DF6FA890028D040 /* RCTRefreshControlManager.h in Copy Headers */,\n\t\t\t\t3D80D9831DF6FA890028D040 /* RCTRootShadowView.h in Copy Headers */,\n\t\t\t\t3D80D9871DF6FA890028D040 /* RCTSegmentedControl.h in Copy Headers */,\n\t\t\t\t3D80D9881DF6FA890028D040 /* RCTSegmentedControlManager.h in Copy Headers */,\n\t\t\t\t3D80D9891DF6FA890028D040 /* RCTShadowView.h in Copy Headers */,\n\t\t\t\t3D80D98A1DF6FA890028D040 /* RCTSlider.h in Copy Headers */,\n\t\t\t\t3D80D98B1DF6FA890028D040 /* RCTSliderManager.h in Copy Headers */,\n\t\t\t\t3D80D98C1DF6FA890028D040 /* RCTSwitch.h in Copy Headers */,\n\t\t\t\t3D80D98D1DF6FA890028D040 /* RCTSwitchManager.h in Copy Headers */,\n\t\t\t\t3D80D98E1DF6FA890028D040 /* RCTTabBar.h in Copy Headers */,\n\t\t\t\t3D80D98F1DF6FA890028D040 /* RCTTabBarItem.h in Copy Headers */,\n\t\t\t\t3D80D9901DF6FA890028D040 /* RCTTabBarItemManager.h in Copy Headers */,\n\t\t\t\t3D80D9911DF6FA890028D040 /* RCTTabBarManager.h in Copy Headers */,\n\t\t\t\t3D80D9921DF6FA890028D040 /* RCTTextDecorationLineType.h in Copy Headers */,\n\t\t\t\t3D80D9931DF6FA890028D040 /* RCTView.h in Copy Headers */,\n\t\t\t\t3D80D9951DF6FA890028D040 /* RCTViewManager.h in Copy Headers */,\n\t\t\t\t3D80D9961DF6FA890028D040 /* RCTWebView.h in Copy Headers */,\n\t\t\t\t3D80D9971DF6FA890028D040 /* RCTWebViewManager.h in Copy Headers */,\n\t\t\t\t3D80D9981DF6FA890028D040 /* RCTWrapperViewController.h in Copy Headers */,\n\t\t\t\t3D80D9991DF6FA890028D040 /* UIView+Private.h in Copy Headers */,\n\t\t\t\t3D80D99A1DF6FA890028D040 /* UIView+React.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D80DAB41DF8212E0028D040 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 12;\n\t\t\tdstPath = include/yoga;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3DE4F8681DF85D8E00B9E5A0 /* YGEnums.h in Copy Headers */,\n\t\t\t\t3DE4F8691DF85D8E00B9E5A0 /* YGMacros.h in Copy Headers */,\n\t\t\t\t3DE4F86A1DF85D8E00B9E5A0 /* Yoga.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D80DAB91DF821710028D040 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/cxxreact;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3D80DABA1DF821850028D040 /* JSBundleType.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D80DABB1DF8218B0028D040 /* Copy Headers */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = include/jschelpers;\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t3D80DABC1DF821A00028D040 /* JavaScriptCore.h in Copy Headers */,\n\t\t\t\t3D80DABD1DF821A00028D040 /* JSCWrapper.h in Copy Headers */,\n\t\t\t);\n\t\t\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSourceCode.h; sourceTree = \"<group>\"; };\n\t\t000E6CEA1AB0E980000CDF4D /* RCTSourceCode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSourceCode.m; sourceTree = \"<group>\"; };\n\t\t001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMultipartStreamReader.h; sourceTree = \"<group>\"; };\n\t\t001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMultipartStreamReader.m; sourceTree = \"<group>\"; };\n\t\t006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMultipartDataTask.h; sourceTree = \"<group>\"; };\n\t\t006FC4131D9B20820057AAAD /* RCTMultipartDataTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMultipartDataTask.m; sourceTree = \"<group>\"; };\n\t\t008341F41D1DB34400876D9A /* RCTJSStackFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJSStackFrame.m; sourceTree = \"<group>\"; };\n\t\t008341F51D1DB34400876D9A /* RCTJSStackFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSStackFrame.h; sourceTree = \"<group>\"; };\n\t\t130A77031DF767AF001F9587 /* YGEnums.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YGEnums.h; sourceTree = \"<group>\"; };\n\t\t130A77041DF767AF001F9587 /* YGMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YGMacros.h; sourceTree = \"<group>\"; };\n\t\t130A77081DF767AF001F9587 /* Yoga.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Yoga.h; sourceTree = \"<group>\"; };\n\t\t131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSegmentedControl.h; sourceTree = \"<group>\"; };\n\t\t131B6AF11AF1093D00FFC3E0 /* RCTSegmentedControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSegmentedControl.m; sourceTree = \"<group>\"; };\n\t\t131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSegmentedControlManager.h; sourceTree = \"<group>\"; };\n\t\t131B6AF31AF1093D00FFC3E0 /* RCTSegmentedControlManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSegmentedControlManager.m; sourceTree = \"<group>\"; };\n\t\t133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDatePicker.h; sourceTree = \"<group>\"; };\n\t\t133CAE8D1B8E5CFD00F6AD92 /* RCTDatePicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDatePicker.m; sourceTree = \"<group>\"; };\n\t\t13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAnimationType.h; sourceTree = \"<group>\"; };\n\t\t13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPointerEvents.h; sourceTree = \"<group>\"; };\n\t\t13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"RCTConvert+CoreLocation.h\"; sourceTree = \"<group>\"; };\n\t\t13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"RCTConvert+CoreLocation.m\"; sourceTree = \"<group>\"; };\n\t\t1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTURLRequestDelegate.h; sourceTree = \"<group>\"; };\n\t\t1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTURLRequestHandler.h; sourceTree = \"<group>\"; };\n\t\t134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTJSCExecutor.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t134FCB3A1A6E7F0800051CC8 /* RCTJSCExecutor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTJSCExecutor.mm; sourceTree = \"<group>\"; };\n\t\t13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTProgressViewManager.h; sourceTree = \"<group>\"; };\n\t\t13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTProgressViewManager.m; sourceTree = \"<group>\"; };\n\t\t13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTStatusBarManager.h; sourceTree = \"<group>\"; };\n\t\t13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTStatusBarManager.m; sourceTree = \"<group>\"; };\n\t\t1372B7081AB030C200659ED6 /* RCTAppState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAppState.h; sourceTree = \"<group>\"; };\n\t\t1372B7091AB030C200659ED6 /* RCTAppState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAppState.m; sourceTree = \"<group>\"; };\n\t\t137327DF1AA5CF210034F82E /* RCTTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTabBar.h; sourceTree = \"<group>\"; };\n\t\t137327E01AA5CF210034F82E /* RCTTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTabBar.m; sourceTree = \"<group>\"; };\n\t\t137327E11AA5CF210034F82E /* RCTTabBarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTabBarItem.h; sourceTree = \"<group>\"; };\n\t\t137327E21AA5CF210034F82E /* RCTTabBarItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTabBarItem.m; sourceTree = \"<group>\"; };\n\t\t137327E31AA5CF210034F82E /* RCTTabBarItemManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTabBarItemManager.h; sourceTree = \"<group>\"; };\n\t\t137327E41AA5CF210034F82E /* RCTTabBarItemManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTabBarItemManager.m; sourceTree = \"<group>\"; };\n\t\t137327E51AA5CF210034F82E /* RCTTabBarManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTabBarManager.h; sourceTree = \"<group>\"; };\n\t\t137327E61AA5CF210034F82E /* RCTTabBarManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTabBarManager.m; sourceTree = \"<group>\"; };\n\t\t139324FC1E70B069009FD7E0 /* RCTJSCErrorHandling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSCErrorHandling.h; sourceTree = \"<group>\"; };\n\t\t139324FD1E70B069009FD7E0 /* RCTJSCErrorHandling.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTJSCErrorHandling.mm; sourceTree = \"<group>\"; };\n\t\t13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTDevLoadingView.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13A0C2861B74F71200B29F6F /* RCTDevLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDevLoadingView.m; sourceTree = \"<group>\"; };\n\t\t13A0C2871B74F71200B29F6F /* RCTDevMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTDevMenu.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTKeyCommands.h; sourceTree = \"<group>\"; };\n\t\t13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTKeyCommands.m; sourceTree = \"<group>\"; };\n\t\t13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTParserUtils.h; sourceTree = \"<group>\"; };\n\t\t13A6E20D1C19AA0C00845B82 /* RCTParserUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTParserUtils.m; sourceTree = \"<group>\"; };\n\t\t13A6E20F1C19ABC700845B82 /* RCTNullability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNullability.h; sourceTree = \"<group>\"; };\n\t\t13AB90BF1B6FA36700713B4F /* RCTComponentData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTComponentData.h; sourceTree = \"<group>\"; };\n\t\t13AB90C01B6FA36700713B4F /* RCTComponentData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTComponentData.m; sourceTree = \"<group>\"; };\n\t\t13AF1F851AE6E777005F5298 /* RCTDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDefines.h; sourceTree = \"<group>\"; };\n\t\t13AF20431AE707F8005F5298 /* RCTSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSlider.h; sourceTree = \"<group>\"; };\n\t\t13AF20441AE707F9005F5298 /* RCTSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSlider.m; sourceTree = \"<group>\"; };\n\t\t13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBridgeMethod.h; sourceTree = \"<group>\"; };\n\t\t13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootViewDelegate.h; sourceTree = \"<group>\"; };\n\t\t13B07FE71A69327A00A75B9A /* RCTAlertManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAlertManager.h; sourceTree = \"<group>\"; };\n\t\t13B07FE81A69327A00A75B9A /* RCTAlertManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAlertManager.m; sourceTree = \"<group>\"; };\n\t\t13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTExceptionsManager.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTExceptionsManager.m; sourceTree = \"<group>\"; };\n\t\t13B07FED1A69327A00A75B9A /* RCTTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTiming.h; sourceTree = \"<group>\"; };\n\t\t13B07FEE1A69327A00A75B9A /* RCTTiming.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTiming.m; sourceTree = \"<group>\"; };\n\t\t13B0800C1A69489C00A75B9A /* RCTNavigator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNavigator.h; sourceTree = \"<group>\"; };\n\t\t13B0800D1A69489C00A75B9A /* RCTNavigator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNavigator.m; sourceTree = \"<group>\"; };\n\t\t13B0800E1A69489C00A75B9A /* RCTNavigatorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNavigatorManager.h; sourceTree = \"<group>\"; };\n\t\t13B0800F1A69489C00A75B9A /* RCTNavigatorManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNavigatorManager.m; sourceTree = \"<group>\"; };\n\t\t13B080101A69489C00A75B9A /* RCTNavItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNavItem.h; sourceTree = \"<group>\"; };\n\t\t13B080111A69489C00A75B9A /* RCTNavItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNavItem.m; sourceTree = \"<group>\"; };\n\t\t13B080121A69489C00A75B9A /* RCTNavItemManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNavItemManager.h; sourceTree = \"<group>\"; };\n\t\t13B080131A69489C00A75B9A /* RCTNavItemManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNavItemManager.m; sourceTree = \"<group>\"; };\n\t\t13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTActivityIndicatorViewManager.h; sourceTree = \"<group>\"; };\n\t\t13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTActivityIndicatorViewManager.m; sourceTree = \"<group>\"; };\n\t\t13B080231A694A8400A75B9A /* RCTWrapperViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWrapperViewController.h; sourceTree = \"<group>\"; };\n\t\t13B080241A694A8400A75B9A /* RCTWrapperViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWrapperViewController.m; sourceTree = \"<group>\"; };\n\t\t13BB3D001BECD54500932C10 /* RCTImageSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTImageSource.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13BB3D011BECD54500932C10 /* RCTImageSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageSource.m; sourceTree = \"<group>\"; };\n\t\t13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootShadowView.h; sourceTree = \"<group>\"; };\n\t\t13BCE8081C99CB9D00DD7AAD /* RCTRootShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootShadowView.m; sourceTree = \"<group>\"; };\n\t\t13C156011AB1A2840079392D /* RCTWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebView.h; sourceTree = \"<group>\"; };\n\t\t13C156021AB1A2840079392D /* RCTWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWebView.m; sourceTree = \"<group>\"; };\n\t\t13C156031AB1A2840079392D /* RCTWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebViewManager.h; sourceTree = \"<group>\"; };\n\t\t13C156041AB1A2840079392D /* RCTWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWebViewManager.m; sourceTree = \"<group>\"; };\n\t\t13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAutoInsetsProtocol.h; sourceTree = \"<group>\"; };\n\t\t13C325281AA63B6A0048765F /* RCTComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTComponent.h; sourceTree = \"<group>\"; };\n\t\t13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBorderDrawing.h; sourceTree = \"<group>\"; };\n\t\t13CC8A811B17642100940AE7 /* RCTBorderDrawing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBorderDrawing.m; sourceTree = \"<group>\"; };\n\t\t13D033611C1837FE0021DC29 /* RCTClipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTClipboard.h; sourceTree = \"<group>\"; };\n\t\t13D033621C1837FE0021DC29 /* RCTClipboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTClipboard.m; sourceTree = \"<group>\"; };\n\t\t13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTEventEmitter.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTEventEmitter.m; sourceTree = \"<group>\"; };\n\t\t13D9FEEC1CDCD93000158BD7 /* RCTKeyboardObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTKeyboardObserver.h; sourceTree = \"<group>\"; };\n\t\t13D9FEED1CDCD93000158BD7 /* RCTKeyboardObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTKeyboardObserver.m; sourceTree = \"<group>\"; };\n\t\t13E067481A70F434002CDEE1 /* RCTUIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUIManager.h; sourceTree = \"<group>\"; };\n\t\t13E067491A70F434002CDEE1 /* RCTUIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManager.m; sourceTree = \"<group>\"; };\n\t\t13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTShadowView.h; sourceTree = \"<group>\"; };\n\t\t13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTShadowView.m; sourceTree = \"<group>\"; };\n\t\t13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTViewManager.h; sourceTree = \"<group>\"; };\n\t\t13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTViewManager.m; sourceTree = \"<group>\"; };\n\t\t13E0674F1A70F44B002CDEE1 /* RCTView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTView.h; sourceTree = \"<group>\"; };\n\t\t13E067501A70F44B002CDEE1 /* RCTView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTView.m; sourceTree = \"<group>\"; };\n\t\t13E067531A70F44B002CDEE1 /* UIView+React.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"UIView+React.h\"; sourceTree = \"<group>\"; };\n\t\t13E067541A70F44B002CDEE1 /* UIView+React.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"UIView+React.m\"; sourceTree = \"<group>\"; };\n\t\t13F17A831B8493E5007D4C75 /* RCTRedBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRedBox.h; sourceTree = \"<group>\"; };\n\t\t13F17A841B8493E5007D4C75 /* RCTRedBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRedBox.m; sourceTree = \"<group>\"; };\n\t\t14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJavaScriptLoader.h; sourceTree = \"<group>\"; };\n\t\t142014171B32094000CC17BA /* RCTPerformanceLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPerformanceLogger.m; sourceTree = \"<group>\"; };\n\t\t142014181B32094000CC17BA /* RCTPerformanceLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPerformanceLogger.h; sourceTree = \"<group>\"; };\n\t\t1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTFrameUpdate.h; sourceTree = \"<group>\"; };\n\t\t1450FF801BCFF28A00208362 /* RCTProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTProfile.h; sourceTree = \"<group>\"; };\n\t\t1450FF811BCFF28A00208362 /* RCTProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTProfile.m; sourceTree = \"<group>\"; };\n\t\t1450FF821BCFF28A00208362 /* RCTProfileTrampoline-arm.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = \"RCTProfileTrampoline-arm.S\"; sourceTree = \"<group>\"; };\n\t\t1450FF831BCFF28A00208362 /* RCTProfileTrampoline-arm64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = \"RCTProfileTrampoline-arm64.S\"; sourceTree = \"<group>\"; };\n\t\t1450FF851BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = \"RCTProfileTrampoline-x86_64.S\"; sourceTree = \"<group>\"; };\n\t\t1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTBridgeDelegate.h; sourceTree = \"<group>\"; };\n\t\t14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"RCTBridge+Private.h\"; sourceTree = \"<group>\"; };\n\t\t14BF717F1C04793D00C97D0C /* RCTProfileTrampoline-i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = \"RCTProfileTrampoline-i386.S\"; sourceTree = \"<group>\"; };\n\t\t14BF71811C04795500C97D0C /* RCTMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMacros.h; sourceTree = \"<group>\"; };\n\t\t14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModuleMethod.h; sourceTree = \"<group>\"; };\n\t\t14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModuleData.h; sourceTree = \"<group>\"; };\n\t\t14C2CA731B3AC64300E6CBB2 /* RCTModuleData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTModuleData.mm; sourceTree = \"<group>\"; };\n\t\t14C2CA751B3AC64F00E6CBB2 /* RCTFrameUpdate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTFrameUpdate.m; sourceTree = \"<group>\"; };\n\t\t14C2CA771B3ACB0400E6CBB2 /* RCTBatchedBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTBatchedBridge.mm; sourceTree = \"<group>\"; };\n\t\t14F362071AABD06A001CE568 /* RCTSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSwitch.h; sourceTree = \"<group>\"; };\n\t\t14F362081AABD06A001CE568 /* RCTSwitch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSwitch.m; sourceTree = \"<group>\"; };\n\t\t14F362091AABD06A001CE568 /* RCTSwitchManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSwitchManager.h; sourceTree = \"<group>\"; };\n\t\t14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSwitchManager.m; sourceTree = \"<group>\"; };\n\t\t14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSliderManager.h; sourceTree = \"<group>\"; };\n\t\t14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSliderManager.m; sourceTree = \"<group>\"; };\n\t\t14F7A0EB1BDA3B3C003C6C10 /* RCTPerfMonitor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPerfMonitor.m; sourceTree = \"<group>\"; };\n\t\t14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTFPSGraph.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t14F7A0EF1BDA714B003C6C10 /* RCTFPSGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTFPSGraph.m; sourceTree = \"<group>\"; };\n\t\t191E3EBC1C29D9AF00C180A6 /* RCTRefreshControlManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRefreshControlManager.h; sourceTree = \"<group>\"; };\n\t\t191E3EBD1C29D9AF00C180A6 /* RCTRefreshControlManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRefreshControlManager.m; sourceTree = \"<group>\"; };\n\t\t191E3EBF1C29DC3800C180A6 /* RCTRefreshControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRefreshControl.h; sourceTree = \"<group>\"; };\n\t\t191E3EC01C29DC3800C180A6 /* RCTRefreshControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRefreshControl.m; sourceTree = \"<group>\"; };\n\t\t2D2A28131D9B038B00D4039D /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTI18nUtil.h; sourceTree = \"<group>\"; };\n\t\t352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTI18nUtil.m; sourceTree = \"<group>\"; };\n\t\t369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSCSamplingProfiler.h; sourceTree = \"<group>\"; };\n\t\t369123E01DDC75850095B341 /* RCTJSCSamplingProfiler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJSCSamplingProfiler.m; sourceTree = \"<group>\"; };\n\t\t391E86A21C623EC800009732 /* RCTTouchEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTouchEvent.m; sourceTree = \"<group>\"; };\n\t\t391E86A31C623EC800009732 /* RCTTouchEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTouchEvent.h; sourceTree = \"<group>\"; };\n\t\t3D03BC0E1FEAA2AD008D5730 /* RCTScrollableProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollableProtocol.h; sourceTree = \"<group>\"; };\n\t\t3D03BC0F1FEAA2AD008D5730 /* RCTScrollContentShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollContentShadowView.h; sourceTree = \"<group>\"; };\n\t\t3D03BC101FEAA2AD008D5730 /* RCTScrollContentShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollContentShadowView.m; sourceTree = \"<group>\"; };\n\t\t3D03BC111FEAA2AD008D5730 /* RCTScrollContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollContentView.h; sourceTree = \"<group>\"; };\n\t\t3D03BC121FEAA2AD008D5730 /* RCTScrollContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollContentView.m; sourceTree = \"<group>\"; };\n\t\t3D03BC131FEAA2AD008D5730 /* RCTScrollContentViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollContentViewManager.h; sourceTree = \"<group>\"; };\n\t\t3D03BC141FEAA2AD008D5730 /* RCTScrollContentViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollContentViewManager.m; sourceTree = \"<group>\"; };\n\t\t3D03BC151FEAA2AD008D5730 /* RCTScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollView.h; sourceTree = \"<group>\"; };\n\t\t3D03BC161FEAA2AD008D5730 /* RCTScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollView.m; sourceTree = \"<group>\"; };\n\t\t3D03BC171FEAA2AD008D5730 /* RCTScrollViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollViewManager.h; sourceTree = \"<group>\"; };\n\t\t3D03BC181FEAA2AD008D5730 /* RCTScrollViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollViewManager.m; sourceTree = \"<group>\"; };\n\t\t3D03BC2F1FEAA382008D5730 /* RCTVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTVersion.h; sourceTree = \"<group>\"; };\n\t\t3D03BC331FEAA38A008D5730 /* RCTSurface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurface.h; sourceTree = \"<group>\"; };\n\t\t3D03BC341FEAA38A008D5730 /* RCTSurface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTSurface.mm; sourceTree = \"<group>\"; };\n\t\t3D03BC351FEAA38A008D5730 /* RCTSurfaceDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceDelegate.h; sourceTree = \"<group>\"; };\n\t\t3D03BC361FEAA38A008D5730 /* RCTSurfaceRootShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceRootShadowView.h; sourceTree = \"<group>\"; };\n\t\t3D03BC371FEAA38A008D5730 /* RCTSurfaceRootShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSurfaceRootShadowView.m; sourceTree = \"<group>\"; };\n\t\t3D03BC381FEAA38A008D5730 /* RCTSurfaceRootShadowViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceRootShadowViewDelegate.h; sourceTree = \"<group>\"; };\n\t\t3D03BC391FEAA38A008D5730 /* RCTSurfaceRootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceRootView.h; sourceTree = \"<group>\"; };\n\t\t3D03BC3A1FEAA38A008D5730 /* RCTSurfaceRootView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTSurfaceRootView.mm; sourceTree = \"<group>\"; };\n\t\t3D03BC3B1FEAA38A008D5730 /* RCTSurfaceStage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceStage.h; sourceTree = \"<group>\"; };\n\t\t3D03BC3C1FEAA38A008D5730 /* RCTSurfaceStage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSurfaceStage.m; sourceTree = \"<group>\"; };\n\t\t3D03BC3D1FEAA38A008D5730 /* RCTSurfaceView+Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"RCTSurfaceView+Internal.h\"; sourceTree = \"<group>\"; };\n\t\t3D03BC3E1FEAA38A008D5730 /* RCTSurfaceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceView.h; sourceTree = \"<group>\"; };\n\t\t3D03BC3F1FEAA38A008D5730 /* RCTSurfaceView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTSurfaceView.mm; sourceTree = \"<group>\"; };\n\t\t3D03BC411FEAA38A008D5730 /* RCTSurfaceHostingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceHostingView.h; sourceTree = \"<group>\"; };\n\t\t3D03BC421FEAA38A008D5730 /* RCTSurfaceHostingView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTSurfaceHostingView.mm; sourceTree = \"<group>\"; };\n\t\t3D03BC431FEAA38A008D5730 /* RCTSurfaceSizeMeasureMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSurfaceSizeMeasureMode.h; sourceTree = \"<group>\"; };\n\t\t3D03BC641FEAA454008D5730 /* YGNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGNode.cpp; sourceTree = \"<group>\"; };\n\t\t3D03BC651FEAA456008D5730 /* YGNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGNode.h; sourceTree = \"<group>\"; };\n\t\t3D03BC6A1FEAA48A008D5730 /* RCTRedBoxExtraDataViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRedBoxExtraDataViewController.m; sourceTree = \"<group>\"; };\n\t\t3D03BC6B1FEAA48A008D5730 /* RCTRedBoxExtraDataViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRedBoxExtraDataViewController.h; sourceTree = \"<group>\"; };\n\t\t3D03BC711FEAA5A5008D5730 /* RCTSafeAreaShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSafeAreaShadowView.h; sourceTree = \"<group>\"; };\n\t\t3D03BC721FEAA5A5008D5730 /* RCTSafeAreaShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSafeAreaShadowView.m; sourceTree = \"<group>\"; };\n\t\t3D03BC731FEAA5A5008D5730 /* RCTSafeAreaView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSafeAreaView.h; sourceTree = \"<group>\"; };\n\t\t3D03BC741FEAA5A5008D5730 /* RCTSafeAreaView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSafeAreaView.m; sourceTree = \"<group>\"; };\n\t\t3D03BC751FEAA5A5008D5730 /* RCTSafeAreaViewLocalData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSafeAreaViewLocalData.h; sourceTree = \"<group>\"; };\n\t\t3D03BC761FEAA5A5008D5730 /* RCTSafeAreaViewLocalData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSafeAreaViewLocalData.m; sourceTree = \"<group>\"; };\n\t\t3D03BC771FEAA5A5008D5730 /* RCTSafeAreaViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSafeAreaViewManager.h; sourceTree = \"<group>\"; };\n\t\t3D03BC781FEAA5A5008D5730 /* RCTSafeAreaViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSafeAreaViewManager.m; sourceTree = \"<group>\"; };\n\t\t3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDisplayLink.h; sourceTree = \"<group>\"; };\n\t\t3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDisplayLink.m; sourceTree = \"<group>\"; };\n\t\t3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworking.h; sourceTree = \"<group>\"; };\n\t\t3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworkTask.h; sourceTree = \"<group>\"; };\n\t\t3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageLoader.h; sourceTree = \"<group>\"; };\n\t\t3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageStoreManager.h; sourceTree = \"<group>\"; };\n\t\t3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTResizeMode.h; sourceTree = \"<group>\"; };\n\t\t3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLinkingManager.h; sourceTree = \"<group>\"; };\n\t\t3D1FA08D1DE4F4EE00E03CC6 /* RCTPushNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTPushNotificationManager.h; path = PushNotificationIOS/RCTPushNotificationManager.h; sourceTree = \"<group>\"; };\n\t\t3D37B5801D522B190042D5B5 /* RCTFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTFont.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t3D37B5811D522B190042D5B5 /* RCTFont.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTFont.mm; sourceTree = \"<group>\"; };\n\t\t3D3C059A1DE3340900C268FA /* libyoga.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libyoga.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D3C06751DE3340C00C268FA /* libyoga.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libyoga.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBundleType.h; sourceTree = \"<group>\"; };\n\t\t3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjschelpers.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D3CD9181DE5FBD800167DC4 /* libjschelpers.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjschelpers.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcxxreact.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D3CD9321DE5FBEE00167DC4 /* libcxxreact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcxxreact.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t3D41534D1F276ED7005B8EFE /* RCTLayoutAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLayoutAnimation.h; sourceTree = \"<group>\"; };\n\t\t3D41534E1F276ED7005B8EFE /* RCTLayoutAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLayoutAnimation.m; sourceTree = \"<group>\"; };\n\t\t3D41534F1F276ED7005B8EFE /* RCTLayoutAnimationGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLayoutAnimationGroup.h; sourceTree = \"<group>\"; };\n\t\t3D4153501F276ED7005B8EFE /* RCTLayoutAnimationGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLayoutAnimationGroup.m; sourceTree = \"<group>\"; };\n\t\t3D4153651F277087005B8EFE /* RCTMaskedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMaskedView.h; sourceTree = \"<group>\"; };\n\t\t3D4153661F277087005B8EFE /* RCTMaskedView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMaskedView.m; sourceTree = \"<group>\"; };\n\t\t3D4153671F277087005B8EFE /* RCTMaskedViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMaskedViewManager.h; sourceTree = \"<group>\"; };\n\t\t3D4153681F277087005B8EFE /* RCTMaskedViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMaskedViewManager.m; sourceTree = \"<group>\"; };\n\t\t3D5AC70F1E0056BC000F9153 /* RCTTVView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTVView.h; sourceTree = \"<group>\"; };\n\t\t3D5AC7101E0056BC000F9153 /* RCTTVView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTVView.m; sourceTree = \"<group>\"; };\n\t\t3D5AC7151E0056D9000F9153 /* RCTTVNavigationEventEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTVNavigationEventEmitter.h; sourceTree = \"<group>\"; };\n\t\t3D5AC7161E0056D9000F9153 /* RCTTVNavigationEventEmitter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTVNavigationEventEmitter.m; sourceTree = \"<group>\"; };\n\t\t3D5AC71E1E005750000F9153 /* RCTTVRemoteHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTVRemoteHandler.h; sourceTree = \"<group>\"; };\n\t\t3D5AC71F1E005750000F9153 /* RCTTVRemoteHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTVRemoteHandler.m; sourceTree = \"<group>\"; };\n\t\t3D7749421DC1065C007EC8D8 /* RCTPlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPlatform.h; sourceTree = \"<group>\"; };\n\t\t3D7749431DC1065C007EC8D8 /* RCTPlatform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPlatform.m; sourceTree = \"<group>\"; };\n\t\t3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptCore.h; sourceTree = \"<group>\"; };\n\t\t3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCWrapper.cpp; sourceTree = \"<group>\"; };\n\t\t3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCWrapper.h; sourceTree = \"<group>\"; };\n\t\t3D7BFCE51EA8E1F4008DFB7A /* RCTPackagerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPackagerConnection.h; sourceTree = \"<group>\"; };\n\t\t3D7BFCE61EA8E1F4008DFB7A /* RCTPackagerConnection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTPackagerConnection.mm; sourceTree = \"<group>\"; };\n\t\t3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTErrorCustomizer.h; sourceTree = \"<group>\"; };\n\t\t3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTErrorInfo.h; sourceTree = \"<group>\"; };\n\t\t3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTErrorInfo.m; sourceTree = \"<group>\"; };\n\t\t53330EE31FC6EE70008D7FA9 /* YGNodePrint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGNodePrint.h; sourceTree = \"<group>\"; };\n\t\t53330EE41FC6EE70008D7FA9 /* YGNodePrint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGNodePrint.cpp; sourceTree = \"<group>\"; };\n\t\t53CBF1BB1FB50262002CBB31 /* Yoga-internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"Yoga-internal.h\"; sourceTree = \"<group>\"; };\n\t\t53CBF1BC1FB50263002CBB31 /* YGEnums.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGEnums.cpp; sourceTree = \"<group>\"; };\n\t\t53CBF1BD1FB50263002CBB31 /* Yoga.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Yoga.cpp; sourceTree = \"<group>\"; };\n\t\t58114A121AAE854800E7D092 /* RCTPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPicker.h; sourceTree = \"<group>\"; };\n\t\t58114A131AAE854800E7D092 /* RCTPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPicker.m; sourceTree = \"<group>\"; };\n\t\t58114A141AAE854800E7D092 /* RCTPickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPickerManager.h; sourceTree = \"<group>\"; };\n\t\t58114A151AAE854800E7D092 /* RCTPickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPickerManager.m; sourceTree = \"<group>\"; };\n\t\t58114A4E1AAE93D500E7D092 /* RCTAsyncLocalStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAsyncLocalStorage.m; sourceTree = \"<group>\"; };\n\t\t58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAsyncLocalStorage.h; sourceTree = \"<group>\"; };\n\t\t58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDatePickerManager.m; sourceTree = \"<group>\"; };\n\t\t58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTDatePickerManager.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t595405551EC03A1700766D3C /* RCTShadowView+Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"RCTShadowView+Layout.h\"; sourceTree = \"<group>\"; };\n\t\t595405561EC03A1700766D3C /* RCTShadowView+Layout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"RCTShadowView+Layout.m\"; sourceTree = \"<group>\"; };\n\t\t597AD1BB1E577D7800152581 /* RCTRootContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootContentView.h; sourceTree = \"<group>\"; };\n\t\t597AD1BC1E577D7800152581 /* RCTRootContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootContentView.m; sourceTree = \"<group>\"; };\n\t\t598C22D41EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUIManagerObserverCoordinator.h; sourceTree = \"<group>\"; };\n\t\t598C22D51EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTUIManagerObserverCoordinator.mm; sourceTree = \"<group>\"; };\n\t\t59DA56291F71C6C600D9EADA /* RCTUIManagerUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUIManagerUtils.h; sourceTree = \"<group>\"; };\n\t\t59DA562A1F71C6C700D9EADA /* RCTUIManagerUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManagerUtils.m; sourceTree = \"<group>\"; };\n\t\t65F3E41D1E73031C009375BD /* systemJSCWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = systemJSCWrapper.cpp; sourceTree = \"<group>\"; };\n\t\t68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBundleURLProvider.h; sourceTree = \"<group>\"; };\n\t\t68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBundleURLProvider.m; sourceTree = \"<group>\"; };\n\t\t6A15FB0C1BDF663500531DFB /* RCTRootViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootViewInternal.h; sourceTree = \"<group>\"; };\n\t\t830213F31A654E0800B993E6 /* RCTBridgeModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTBridgeModule.h; sourceTree = \"<group>\"; };\n\t\t830A229C1A66C68A008503DA /* RCTRootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootView.h; sourceTree = \"<group>\"; };\n\t\t830A229D1A66C68A008503DA /* RCTRootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootView.m; sourceTree = \"<group>\"; };\n\t\t83392EB11B6634E10013B15F /* RCTModalHostViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModalHostViewController.h; sourceTree = \"<group>\"; };\n\t\t83392EB21B6634E10013B15F /* RCTModalHostViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModalHostViewController.m; sourceTree = \"<group>\"; };\n\t\t83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModalHostView.h; sourceTree = \"<group>\"; };\n\t\t83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModalHostView.m; sourceTree = \"<group>\"; };\n\t\t83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModalHostViewManager.h; sourceTree = \"<group>\"; };\n\t\t83A1FE8E1B62643A00BE0E65 /* RCTModalHostViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModalHostViewManager.m; sourceTree = \"<group>\"; };\n\t\t83CBBA2E1A601D0E00E9B192 /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAssert.h; sourceTree = \"<group>\"; };\n\t\t83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAssert.m; sourceTree = \"<group>\"; };\n\t\t83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTInvalidating.h; sourceTree = \"<group>\"; };\n\t\t83CBBA4D1A601E3B00E9B192 /* RCTLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLog.h; sourceTree = \"<group>\"; };\n\t\t83CBBA4E1A601E3B00E9B192 /* RCTLog.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTLog.mm; sourceTree = \"<group>\"; };\n\t\t83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUtils.h; sourceTree = \"<group>\"; };\n\t\t83CBBA501A601E3B00E9B192 /* RCTUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUtils.m; sourceTree = \"<group>\"; };\n\t\t83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBridge.h; sourceTree = \"<group>\"; };\n\t\t83CBBA5F1A601EAA00E9B192 /* RCTBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBridge.m; sourceTree = \"<group>\"; };\n\t\t83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTJavaScriptExecutor.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTEventDispatcher.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTEventDispatcher.m; sourceTree = \"<group>\"; };\n\t\t83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTouchHandler.h; sourceTree = \"<group>\"; };\n\t\t83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTouchHandler.m; sourceTree = \"<group>\"; };\n\t\t83CBBACA1A6023D300E9B192 /* RCTConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTConvert.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\t83CBBACB1A6023D300E9B192 /* RCTConvert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert.m; sourceTree = \"<group>\"; };\n\t\t83F15A171B7CC46900F10295 /* UIView+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"UIView+Private.h\"; sourceTree = \"<group>\"; };\n\t\t91076A891F743AD70081B4FA /* RCTModalManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTModalManager.m; sourceTree = \"<group>\"; };\n\t\t91076A8A1F743AD70081B4FA /* RCTModalManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTModalManager.h; sourceTree = \"<group>\"; };\n\t\t945929C21DD62ADD00653A7D /* RCTConvert+Transform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"RCTConvert+Transform.h\"; sourceTree = \"<group>\"; };\n\t\t945929C31DD62ADD00653A7D /* RCTConvert+Transform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"RCTConvert+Transform.m\"; sourceTree = \"<group>\"; };\n\t\tA12E9E171E5DEA350029001B /* RCTPackagerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPackagerClient.h; sourceTree = \"<group>\"; };\n\t\tA12E9E181E5DEA350029001B /* RCTPackagerClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPackagerClient.m; sourceTree = \"<group>\"; };\n\t\tA12E9E281E5DEB860029001B /* RCTReconnectingWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTReconnectingWebSocket.h; path = WebSocket/RCTReconnectingWebSocket.h; sourceTree = \"<group>\"; };\n\t\tA12E9E291E5DEB860029001B /* RCTSRWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTSRWebSocket.h; path = WebSocket/RCTSRWebSocket.h; sourceTree = \"<group>\"; };\n\t\tA2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTReloadCommand.h; sourceTree = \"<group>\"; };\n\t\tA2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTReloadCommand.m; sourceTree = \"<group>\"; };\n\t\tAC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTJavaScriptLoader.mm; sourceTree = \"<group>\"; };\n\t\tAC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBundleType.cpp; sourceTree = \"<group>\"; };\n\t\tAC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"oss-compat-util.h\"; sourceTree = \"<group>\"; };\n\t\tACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBorderStyle.h; sourceTree = \"<group>\"; };\n\t\tB233E6E81D2D843200BC68BA /* RCTI18nManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTI18nManager.h; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };\n\t\tB233E6E91D2D845D00BC68BA /* RCTI18nManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTI18nManager.m; sourceTree = \"<group>\"; };\n\t\tB505583B1E43DFB900F71A00 /* RCTDevMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDevMenu.m; sourceTree = \"<group>\"; };\n\t\tB505583C1E43DFB900F71A00 /* RCTDevSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDevSettings.h; sourceTree = \"<group>\"; };\n\t\tB505583D1E43DFB900F71A00 /* RCTDevSettings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTDevSettings.mm; sourceTree = \"<group>\"; };\n\t\tB95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTActivityIndicatorView.h; sourceTree = \"<group>\"; };\n\t\tB95154311D1B34B200FE7B80 /* RCTActivityIndicatorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTActivityIndicatorView.m; sourceTree = \"<group>\"; };\n\t\tC60128AF1F3D128C009DF9FF /* RCTCxxConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTCxxConvert.h; sourceTree = \"<group>\"; };\n\t\tC60128B01F3D128C009DF9FF /* RCTCxxConvert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTCxxConvert.m; sourceTree = \"<group>\"; };\n\t\tC60669301F3CC7BD00E67165 /* RCTModuleMethod.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTModuleMethod.mm; sourceTree = \"<group>\"; };\n\t\tC60669381F3CCF3F00E67165 /* RCTManagedPointer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTManagedPointer.mm; sourceTree = \"<group>\"; };\n\t\tC65450601F3BD94C0090799B /* RCTManagedPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTManagedPointer.h; sourceTree = \"<group>\"; };\n\t\tC6FC33501F7048A800643E54 /* RCTShadowView+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"RCTShadowView+Internal.h\"; sourceTree = \"<group>\"; };\n\t\tC6FC33511F7048A800643E54 /* RCTShadowView+Internal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"RCTShadowView+Internal.m\"; sourceTree = \"<group>\"; };\n\t\tCF85BC301E79EC6B00F1EF3B /* RCTDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDeviceInfo.h; sourceTree = \"<group>\"; };\n\t\tCF85BC311E79EC6B00F1EF3B /* RCTDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDeviceInfo.m; sourceTree = \"<group>\"; };\n\t\tE3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTTextDecorationLineType.h; sourceTree = \"<group>\"; };\n\t\tE9B20B791B500126007A2DA7 /* RCTAccessibilityManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAccessibilityManager.h; sourceTree = \"<group>\"; };\n\t\tE9B20B7A1B500126007A2DA7 /* RCTAccessibilityManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAccessibilityManager.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t3D3C08881DE342EE00C268FA /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D3CD9411DE5FC5300167DC4 /* libcxxreact.a in Frameworks */,\n\t\t\t\t3D3CD9421DE5FC5300167DC4 /* libjschelpers.a in Frameworks */,\n\t\t\t\t3D3C08891DE342FB00C268FA /* libyoga.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3C088B1DE342FE00C268FA /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DCE52D91FEAB02700613583 /* libyoga.a in Frameworks */,\n\t\t\t\t3D3CD9431DE5FC6500167DC4 /* libcxxreact.a in Frameworks */,\n\t\t\t\t3D3CD9441DE5FC6500167DC4 /* libjschelpers.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t130A77021DF767AF001F9587 /* yoga */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t53CBF1BC1FB50263002CBB31 /* YGEnums.cpp */,\n\t\t\t\t130A77031DF767AF001F9587 /* YGEnums.h */,\n\t\t\t\t130A77041DF767AF001F9587 /* YGMacros.h */,\n\t\t\t\t3D03BC641FEAA454008D5730 /* YGNode.cpp */,\n\t\t\t\t3D03BC651FEAA456008D5730 /* YGNode.h */,\n\t\t\t\t53330EE41FC6EE70008D7FA9 /* YGNodePrint.cpp */,\n\t\t\t\t53330EE31FC6EE70008D7FA9 /* YGNodePrint.h */,\n\t\t\t\t53CBF1BB1FB50262002CBB31 /* Yoga-internal.h */,\n\t\t\t\t53CBF1BD1FB50263002CBB31 /* Yoga.cpp */,\n\t\t\t\t130A77081DF767AF001F9587 /* Yoga.h */,\n\t\t\t);\n\t\t\tname = yoga;\n\t\t\tpath = yoga/yoga;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t134FCB381A6E7F0800051CC8 /* Executors */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */,\n\t\t\t\t134FCB3A1A6E7F0800051CC8 /* RCTJSCExecutor.mm */,\n\t\t\t);\n\t\t\tpath = Executors;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13B07FE01A69315300A75B9A /* Modules */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tE9B20B791B500126007A2DA7 /* RCTAccessibilityManager.h */,\n\t\t\t\tE9B20B7A1B500126007A2DA7 /* RCTAccessibilityManager.m */,\n\t\t\t\t13B07FE71A69327A00A75B9A /* RCTAlertManager.h */,\n\t\t\t\t13B07FE81A69327A00A75B9A /* RCTAlertManager.m */,\n\t\t\t\t1372B7081AB030C200659ED6 /* RCTAppState.h */,\n\t\t\t\t1372B7091AB030C200659ED6 /* RCTAppState.m */,\n\t\t\t\t58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */,\n\t\t\t\t58114A4E1AAE93D500E7D092 /* RCTAsyncLocalStorage.m */,\n\t\t\t\t13D033611C1837FE0021DC29 /* RCTClipboard.h */,\n\t\t\t\t13D033621C1837FE0021DC29 /* RCTClipboard.m */,\n\t\t\t\tCF85BC301E79EC6B00F1EF3B /* RCTDeviceInfo.h */,\n\t\t\t\tCF85BC311E79EC6B00F1EF3B /* RCTDeviceInfo.m */,\n\t\t\t\tB505583C1E43DFB900F71A00 /* RCTDevSettings.h */,\n\t\t\t\tB505583D1E43DFB900F71A00 /* RCTDevSettings.mm */,\n\t\t\t\t13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */,\n\t\t\t\t13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */,\n\t\t\t\t13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */,\n\t\t\t\t13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */,\n\t\t\t\tB233E6E81D2D843200BC68BA /* RCTI18nManager.h */,\n\t\t\t\tB233E6E91D2D845D00BC68BA /* RCTI18nManager.m */,\n\t\t\t\t352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */,\n\t\t\t\t352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */,\n\t\t\t\t369123DF1DDC75850095B341 /* RCTJSCSamplingProfiler.h */,\n\t\t\t\t369123E01DDC75850095B341 /* RCTJSCSamplingProfiler.m */,\n\t\t\t\t13D9FEEC1CDCD93000158BD7 /* RCTKeyboardObserver.h */,\n\t\t\t\t13D9FEED1CDCD93000158BD7 /* RCTKeyboardObserver.m */,\n\t\t\t\t3D41534D1F276ED7005B8EFE /* RCTLayoutAnimation.h */,\n\t\t\t\t3D41534E1F276ED7005B8EFE /* RCTLayoutAnimation.m */,\n\t\t\t\t3D41534F1F276ED7005B8EFE /* RCTLayoutAnimationGroup.h */,\n\t\t\t\t3D4153501F276ED7005B8EFE /* RCTLayoutAnimationGroup.m */,\n\t\t\t\t13F17A831B8493E5007D4C75 /* RCTRedBox.h */,\n\t\t\t\t13F17A841B8493E5007D4C75 /* RCTRedBox.m */,\n\t\t\t\t3D03BC6B1FEAA48A008D5730 /* RCTRedBoxExtraDataViewController.h */,\n\t\t\t\t3D03BC6A1FEAA48A008D5730 /* RCTRedBoxExtraDataViewController.m */,\n\t\t\t\t000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */,\n\t\t\t\t000E6CEA1AB0E980000CDF4D /* RCTSourceCode.m */,\n\t\t\t\t13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */,\n\t\t\t\t13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */,\n\t\t\t\t13B07FED1A69327A00A75B9A /* RCTTiming.h */,\n\t\t\t\t13B07FEE1A69327A00A75B9A /* RCTTiming.m */,\n\t\t\t\t3D5AC7151E0056D9000F9153 /* RCTTVNavigationEventEmitter.h */,\n\t\t\t\t3D5AC7161E0056D9000F9153 /* RCTTVNavigationEventEmitter.m */,\n\t\t\t\t13E067481A70F434002CDEE1 /* RCTUIManager.h */,\n\t\t\t\t13E067491A70F434002CDEE1 /* RCTUIManager.m */,\n\t\t\t\t598C22D41EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.h */,\n\t\t\t\t598C22D51EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.mm */,\n\t\t\t\t59DA56291F71C6C600D9EADA /* RCTUIManagerUtils.h */,\n\t\t\t\t59DA562A1F71C6C700D9EADA /* RCTUIManagerUtils.m */,\n\t\t\t);\n\t\t\tpath = Modules;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13B07FF31A6947C200A75B9A /* Views */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D03BC701FEAA5A5008D5730 /* SafeAreaView */,\n\t\t\t\t3D03BC0D1FEAA2AD008D5730 /* ScrollView */,\n\t\t\t\tB95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */,\n\t\t\t\tB95154311D1B34B200FE7B80 /* RCTActivityIndicatorView.m */,\n\t\t\t\t13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */,\n\t\t\t\t13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */,\n\t\t\t\t13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */,\n\t\t\t\t13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */,\n\t\t\t\t13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */,\n\t\t\t\t13CC8A811B17642100940AE7 /* RCTBorderDrawing.m */,\n\t\t\t\tACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */,\n\t\t\t\t13C325281AA63B6A0048765F /* RCTComponent.h */,\n\t\t\t\t13AB90BF1B6FA36700713B4F /* RCTComponentData.h */,\n\t\t\t\t13AB90C01B6FA36700713B4F /* RCTComponentData.m */,\n\t\t\t\t13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */,\n\t\t\t\t13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */,\n\t\t\t\t945929C21DD62ADD00653A7D /* RCTConvert+Transform.h */,\n\t\t\t\t945929C31DD62ADD00653A7D /* RCTConvert+Transform.m */,\n\t\t\t\t133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */,\n\t\t\t\t133CAE8D1B8E5CFD00F6AD92 /* RCTDatePicker.m */,\n\t\t\t\t58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */,\n\t\t\t\t58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */,\n\t\t\t\t3D37B5801D522B190042D5B5 /* RCTFont.h */,\n\t\t\t\t3D37B5811D522B190042D5B5 /* RCTFont.mm */,\n\t\t\t\t3D4153651F277087005B8EFE /* RCTMaskedView.h */,\n\t\t\t\t3D4153661F277087005B8EFE /* RCTMaskedView.m */,\n\t\t\t\t3D4153671F277087005B8EFE /* RCTMaskedViewManager.h */,\n\t\t\t\t3D4153681F277087005B8EFE /* RCTMaskedViewManager.m */,\n\t\t\t\t83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */,\n\t\t\t\t83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */,\n\t\t\t\t83392EB11B6634E10013B15F /* RCTModalHostViewController.h */,\n\t\t\t\t83392EB21B6634E10013B15F /* RCTModalHostViewController.m */,\n\t\t\t\t83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */,\n\t\t\t\t83A1FE8E1B62643A00BE0E65 /* RCTModalHostViewManager.m */,\n\t\t\t\t91076A8A1F743AD70081B4FA /* RCTModalManager.h */,\n\t\t\t\t91076A891F743AD70081B4FA /* RCTModalManager.m */,\n\t\t\t\t13B0800C1A69489C00A75B9A /* RCTNavigator.h */,\n\t\t\t\t13B0800D1A69489C00A75B9A /* RCTNavigator.m */,\n\t\t\t\t13B0800E1A69489C00A75B9A /* RCTNavigatorManager.h */,\n\t\t\t\t13B0800F1A69489C00A75B9A /* RCTNavigatorManager.m */,\n\t\t\t\t13B080101A69489C00A75B9A /* RCTNavItem.h */,\n\t\t\t\t13B080111A69489C00A75B9A /* RCTNavItem.m */,\n\t\t\t\t13B080121A69489C00A75B9A /* RCTNavItemManager.h */,\n\t\t\t\t13B080131A69489C00A75B9A /* RCTNavItemManager.m */,\n\t\t\t\t58114A121AAE854800E7D092 /* RCTPicker.h */,\n\t\t\t\t58114A131AAE854800E7D092 /* RCTPicker.m */,\n\t\t\t\t58114A141AAE854800E7D092 /* RCTPickerManager.h */,\n\t\t\t\t58114A151AAE854800E7D092 /* RCTPickerManager.m */,\n\t\t\t\t13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */,\n\t\t\t\t13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */,\n\t\t\t\t13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */,\n\t\t\t\t191E3EBF1C29DC3800C180A6 /* RCTRefreshControl.h */,\n\t\t\t\t191E3EC01C29DC3800C180A6 /* RCTRefreshControl.m */,\n\t\t\t\t191E3EBC1C29D9AF00C180A6 /* RCTRefreshControlManager.h */,\n\t\t\t\t191E3EBD1C29D9AF00C180A6 /* RCTRefreshControlManager.m */,\n\t\t\t\t13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */,\n\t\t\t\t13BCE8081C99CB9D00DD7AAD /* RCTRootShadowView.m */,\n\t\t\t\t131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */,\n\t\t\t\t131B6AF11AF1093D00FFC3E0 /* RCTSegmentedControl.m */,\n\t\t\t\t131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */,\n\t\t\t\t131B6AF31AF1093D00FFC3E0 /* RCTSegmentedControlManager.m */,\n\t\t\t\tC6FC33501F7048A800643E54 /* RCTShadowView+Internal.h */,\n\t\t\t\tC6FC33511F7048A800643E54 /* RCTShadowView+Internal.m */,\n\t\t\t\t13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */,\n\t\t\t\t13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */,\n\t\t\t\t595405551EC03A1700766D3C /* RCTShadowView+Layout.h */,\n\t\t\t\t595405561EC03A1700766D3C /* RCTShadowView+Layout.m */,\n\t\t\t\t13AF20431AE707F8005F5298 /* RCTSlider.h */,\n\t\t\t\t13AF20441AE707F9005F5298 /* RCTSlider.m */,\n\t\t\t\t14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */,\n\t\t\t\t14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */,\n\t\t\t\t14F362071AABD06A001CE568 /* RCTSwitch.h */,\n\t\t\t\t14F362081AABD06A001CE568 /* RCTSwitch.m */,\n\t\t\t\t14F362091AABD06A001CE568 /* RCTSwitchManager.h */,\n\t\t\t\t14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */,\n\t\t\t\t137327DF1AA5CF210034F82E /* RCTTabBar.h */,\n\t\t\t\t137327E01AA5CF210034F82E /* RCTTabBar.m */,\n\t\t\t\t137327E11AA5CF210034F82E /* RCTTabBarItem.h */,\n\t\t\t\t137327E21AA5CF210034F82E /* RCTTabBarItem.m */,\n\t\t\t\t137327E31AA5CF210034F82E /* RCTTabBarItemManager.h */,\n\t\t\t\t137327E41AA5CF210034F82E /* RCTTabBarItemManager.m */,\n\t\t\t\t137327E51AA5CF210034F82E /* RCTTabBarManager.h */,\n\t\t\t\t137327E61AA5CF210034F82E /* RCTTabBarManager.m */,\n\t\t\t\tE3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */,\n\t\t\t\t3D5AC70F1E0056BC000F9153 /* RCTTVView.h */,\n\t\t\t\t3D5AC7101E0056BC000F9153 /* RCTTVView.m */,\n\t\t\t\t13E0674F1A70F44B002CDEE1 /* RCTView.h */,\n\t\t\t\t13E067501A70F44B002CDEE1 /* RCTView.m */,\n\t\t\t\t13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */,\n\t\t\t\t13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */,\n\t\t\t\t13C156011AB1A2840079392D /* RCTWebView.h */,\n\t\t\t\t13C156021AB1A2840079392D /* RCTWebView.m */,\n\t\t\t\t13C156031AB1A2840079392D /* RCTWebViewManager.h */,\n\t\t\t\t13C156041AB1A2840079392D /* RCTWebViewManager.m */,\n\t\t\t\t13B080231A694A8400A75B9A /* RCTWrapperViewController.h */,\n\t\t\t\t13B080241A694A8400A75B9A /* RCTWrapperViewController.m */,\n\t\t\t\t83F15A171B7CC46900F10295 /* UIView+Private.h */,\n\t\t\t\t13E067531A70F44B002CDEE1 /* UIView+React.h */,\n\t\t\t\t13E067541A70F44B002CDEE1 /* UIView+React.m */,\n\t\t\t);\n\t\t\tpath = Views;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1450FF7F1BCFF28A00208362 /* Profiler */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */,\n\t\t\t\t14F7A0EF1BDA714B003C6C10 /* RCTFPSGraph.m */,\n\t\t\t\t14BF71811C04795500C97D0C /* RCTMacros.h */,\n\t\t\t\t14F7A0EB1BDA3B3C003C6C10 /* RCTPerfMonitor.m */,\n\t\t\t\t1450FF801BCFF28A00208362 /* RCTProfile.h */,\n\t\t\t\t1450FF811BCFF28A00208362 /* RCTProfile.m */,\n\t\t\t\t1450FF821BCFF28A00208362 /* RCTProfileTrampoline-arm.S */,\n\t\t\t\t1450FF831BCFF28A00208362 /* RCTProfileTrampoline-arm64.S */,\n\t\t\t\t14BF717F1C04793D00C97D0C /* RCTProfileTrampoline-i386.S */,\n\t\t\t\t1450FF851BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S */,\n\t\t\t);\n\t\t\tpath = Profiler;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D03BC0D1FEAA2AD008D5730 /* ScrollView */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D03BC0E1FEAA2AD008D5730 /* RCTScrollableProtocol.h */,\n\t\t\t\t3D03BC0F1FEAA2AD008D5730 /* RCTScrollContentShadowView.h */,\n\t\t\t\t3D03BC101FEAA2AD008D5730 /* RCTScrollContentShadowView.m */,\n\t\t\t\t3D03BC111FEAA2AD008D5730 /* RCTScrollContentView.h */,\n\t\t\t\t3D03BC121FEAA2AD008D5730 /* RCTScrollContentView.m */,\n\t\t\t\t3D03BC131FEAA2AD008D5730 /* RCTScrollContentViewManager.h */,\n\t\t\t\t3D03BC141FEAA2AD008D5730 /* RCTScrollContentViewManager.m */,\n\t\t\t\t3D03BC151FEAA2AD008D5730 /* RCTScrollView.h */,\n\t\t\t\t3D03BC161FEAA2AD008D5730 /* RCTScrollView.m */,\n\t\t\t\t3D03BC171FEAA2AD008D5730 /* RCTScrollViewManager.h */,\n\t\t\t\t3D03BC181FEAA2AD008D5730 /* RCTScrollViewManager.m */,\n\t\t\t);\n\t\t\tpath = ScrollView;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D03BC321FEAA38A008D5730 /* Surface */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D03BC331FEAA38A008D5730 /* RCTSurface.h */,\n\t\t\t\t3D03BC341FEAA38A008D5730 /* RCTSurface.mm */,\n\t\t\t\t3D03BC351FEAA38A008D5730 /* RCTSurfaceDelegate.h */,\n\t\t\t\t3D03BC361FEAA38A008D5730 /* RCTSurfaceRootShadowView.h */,\n\t\t\t\t3D03BC371FEAA38A008D5730 /* RCTSurfaceRootShadowView.m */,\n\t\t\t\t3D03BC381FEAA38A008D5730 /* RCTSurfaceRootShadowViewDelegate.h */,\n\t\t\t\t3D03BC391FEAA38A008D5730 /* RCTSurfaceRootView.h */,\n\t\t\t\t3D03BC3A1FEAA38A008D5730 /* RCTSurfaceRootView.mm */,\n\t\t\t\t3D03BC3B1FEAA38A008D5730 /* RCTSurfaceStage.h */,\n\t\t\t\t3D03BC3C1FEAA38A008D5730 /* RCTSurfaceStage.m */,\n\t\t\t\t3D03BC3D1FEAA38A008D5730 /* RCTSurfaceView+Internal.h */,\n\t\t\t\t3D03BC3E1FEAA38A008D5730 /* RCTSurfaceView.h */,\n\t\t\t\t3D03BC3F1FEAA38A008D5730 /* RCTSurfaceView.mm */,\n\t\t\t\t3D03BC401FEAA38A008D5730 /* SurfaceHostingView */,\n\t\t\t);\n\t\t\tpath = Surface;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D03BC401FEAA38A008D5730 /* SurfaceHostingView */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D03BC411FEAA38A008D5730 /* RCTSurfaceHostingView.h */,\n\t\t\t\t3D03BC421FEAA38A008D5730 /* RCTSurfaceHostingView.mm */,\n\t\t\t\t3D03BC431FEAA38A008D5730 /* RCTSurfaceSizeMeasureMode.h */,\n\t\t\t);\n\t\t\tpath = SurfaceHostingView;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D03BC701FEAA5A5008D5730 /* SafeAreaView */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D03BC711FEAA5A5008D5730 /* RCTSafeAreaShadowView.h */,\n\t\t\t\t3D03BC721FEAA5A5008D5730 /* RCTSafeAreaShadowView.m */,\n\t\t\t\t3D03BC731FEAA5A5008D5730 /* RCTSafeAreaView.h */,\n\t\t\t\t3D03BC741FEAA5A5008D5730 /* RCTSafeAreaView.m */,\n\t\t\t\t3D03BC751FEAA5A5008D5730 /* RCTSafeAreaViewLocalData.h */,\n\t\t\t\t3D03BC761FEAA5A5008D5730 /* RCTSafeAreaViewLocalData.m */,\n\t\t\t\t3D03BC771FEAA5A5008D5730 /* RCTSafeAreaViewManager.h */,\n\t\t\t\t3D03BC781FEAA5A5008D5730 /* RCTSafeAreaViewManager.m */,\n\t\t\t);\n\t\t\tpath = SafeAreaView;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D10A3C71DDF3CED004A0F9D /* ReactCommon */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t130A77021DF767AF001F9587 /* yoga */,\n\t\t\t\tAC70D2EA1DE489FC002E6351 /* cxxreact */,\n\t\t\t\t3D4A621D1DDD3985001F41B4 /* jschelpers */,\n\t\t\t);\n\t\t\tname = ReactCommon;\n\t\t\tpath = ../ReactCommon;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D1FA0781DE4F2CD00E03CC6 /* Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D1FA0821DE4F36600E03CC6 /* Image */,\n\t\t\t\t3D1FA0891DE4F4B900E03CC6 /* LinkingIOS */,\n\t\t\t\t3D1FA0791DE4F2D200E03CC6 /* Network */,\n\t\t\t\t3D1FA08A1DE4F4D600E03CC6 /* PushNotificationIOS */,\n\t\t\t\tA12E9E271E5DEB600029001B /* WebSocket */,\n\t\t\t);\n\t\t\tname = Libraries;\n\t\t\tpath = ../Libraries;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D1FA0791DE4F2D200E03CC6 /* Network */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */,\n\t\t\t\t3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */,\n\t\t\t);\n\t\t\tpath = Network;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D1FA0821DE4F36600E03CC6 /* Image */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D1FA0831DE4F3A000E03CC6 /* RCTImageLoader.h */,\n\t\t\t\t3D1FA0841DE4F3A000E03CC6 /* RCTImageStoreManager.h */,\n\t\t\t\t3D1FA0851DE4F3A000E03CC6 /* RCTResizeMode.h */,\n\t\t\t);\n\t\t\tpath = Image;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D1FA0891DE4F4B900E03CC6 /* LinkingIOS */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D1FA08B1DE4F4DD00E03CC6 /* RCTLinkingManager.h */,\n\t\t\t);\n\t\t\tpath = LinkingIOS;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D1FA08A1DE4F4D600E03CC6 /* PushNotificationIOS */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D1FA08D1DE4F4EE00E03CC6 /* RCTPushNotificationManager.h */,\n\t\t\t);\n\t\t\tname = PushNotificationIOS;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3D4A621D1DDD3985001F41B4 /* jschelpers */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t65F3E41D1E73031C009375BD /* systemJSCWrapper.cpp */,\n\t\t\t\t3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */,\n\t\t\t\t3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */,\n\t\t\t\t3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */,\n\t\t\t);\n\t\t\tpath = jschelpers;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3DCE52D81FEAB02700613583 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBB9F61A601CBA00E9B192 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D1FA0781DE4F2CD00E03CC6 /* Libraries */,\n\t\t\t\t83CBBA2F1A601D0F00E9B192 /* React */,\n\t\t\t\t3D10A3C71DDF3CED004A0F9D /* ReactCommon */,\n\t\t\t\t83CBBA001A601CBA00E9B192 /* Products */,\n\t\t\t\t3DCE52D81FEAB02700613583 /* Frameworks */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t83CBBA001A601CBA00E9B192 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t83CBBA2E1A601D0E00E9B192 /* libReact.a */,\n\t\t\t\t2D2A28131D9B038B00D4039D /* libReact.a */,\n\t\t\t\t3D3C059A1DE3340900C268FA /* libyoga.a */,\n\t\t\t\t3D3C06751DE3340C00C268FA /* libyoga.a */,\n\t\t\t\t3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */,\n\t\t\t\t3D3CD9181DE5FBD800167DC4 /* libjschelpers.a */,\n\t\t\t\t3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */,\n\t\t\t\t3D3CD9321DE5FBEE00167DC4 /* libcxxreact.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBBA2F1A601D0F00E9B192 /* React */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t83CBBA491A601E3B00E9B192 /* Base */,\n\t\t\t\tA12E9E161E5DEA260029001B /* DevSupport */,\n\t\t\t\t134FCB381A6E7F0800051CC8 /* Executors */,\n\t\t\t\t13B07FE01A69315300A75B9A /* Modules */,\n\t\t\t\t1450FF7F1BCFF28A00208362 /* Profiler */,\n\t\t\t\t13B07FF31A6947C200A75B9A /* Views */,\n\t\t\t);\n\t\t\tname = React;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBBA491A601E3B00E9B192 /* Base */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */,\n\t\t\t\t83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */,\n\t\t\t\t14C2CA771B3ACB0400E6CBB2 /* RCTBatchedBridge.mm */,\n\t\t\t\t83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */,\n\t\t\t\t83CBBA5F1A601EAA00E9B192 /* RCTBridge.m */,\n\t\t\t\t14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */,\n\t\t\t\t1482F9E61B55B927000ADFF3 /* RCTBridgeDelegate.h */,\n\t\t\t\t13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */,\n\t\t\t\t830213F31A654E0800B993E6 /* RCTBridgeModule.h */,\n\t\t\t\t68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */,\n\t\t\t\t68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */,\n\t\t\t\t83CBBACA1A6023D300E9B192 /* RCTConvert.h */,\n\t\t\t\t83CBBACB1A6023D300E9B192 /* RCTConvert.m */,\n\t\t\t\tC60128AF1F3D128C009DF9FF /* RCTCxxConvert.h */,\n\t\t\t\tC60128B01F3D128C009DF9FF /* RCTCxxConvert.m */,\n\t\t\t\t13AF1F851AE6E777005F5298 /* RCTDefines.h */,\n\t\t\t\t3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */,\n\t\t\t\t3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */,\n\t\t\t\t3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */,\n\t\t\t\t3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */,\n\t\t\t\t3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */,\n\t\t\t\t83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */,\n\t\t\t\t83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */,\n\t\t\t\t1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */,\n\t\t\t\t14C2CA751B3AC64F00E6CBB2 /* RCTFrameUpdate.m */,\n\t\t\t\t13BB3D001BECD54500932C10 /* RCTImageSource.h */,\n\t\t\t\t13BB3D011BECD54500932C10 /* RCTImageSource.m */,\n\t\t\t\t83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */,\n\t\t\t\t83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */,\n\t\t\t\t14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */,\n\t\t\t\tAC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */,\n\t\t\t\t139324FC1E70B069009FD7E0 /* RCTJSCErrorHandling.h */,\n\t\t\t\t139324FD1E70B069009FD7E0 /* RCTJSCErrorHandling.mm */,\n\t\t\t\t008341F51D1DB34400876D9A /* RCTJSStackFrame.h */,\n\t\t\t\t008341F41D1DB34400876D9A /* RCTJSStackFrame.m */,\n\t\t\t\t13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */,\n\t\t\t\t13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */,\n\t\t\t\t83CBBA4D1A601E3B00E9B192 /* RCTLog.h */,\n\t\t\t\t83CBBA4E1A601E3B00E9B192 /* RCTLog.mm */,\n\t\t\t\tC65450601F3BD94C0090799B /* RCTManagedPointer.h */,\n\t\t\t\tC60669381F3CCF3F00E67165 /* RCTManagedPointer.mm */,\n\t\t\t\t14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */,\n\t\t\t\t14C2CA731B3AC64300E6CBB2 /* RCTModuleData.mm */,\n\t\t\t\t14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */,\n\t\t\t\tC60669301F3CC7BD00E67165 /* RCTModuleMethod.mm */,\n\t\t\t\t006FC4121D9B20820057AAAD /* RCTMultipartDataTask.h */,\n\t\t\t\t006FC4131D9B20820057AAAD /* RCTMultipartDataTask.m */,\n\t\t\t\t001BFCCE1D8381DE008E587E /* RCTMultipartStreamReader.h */,\n\t\t\t\t001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */,\n\t\t\t\t13A6E20F1C19ABC700845B82 /* RCTNullability.h */,\n\t\t\t\t13A6E20C1C19AA0C00845B82 /* RCTParserUtils.h */,\n\t\t\t\t13A6E20D1C19AA0C00845B82 /* RCTParserUtils.m */,\n\t\t\t\t142014181B32094000CC17BA /* RCTPerformanceLogger.h */,\n\t\t\t\t142014171B32094000CC17BA /* RCTPerformanceLogger.m */,\n\t\t\t\t3D7749421DC1065C007EC8D8 /* RCTPlatform.h */,\n\t\t\t\t3D7749431DC1065C007EC8D8 /* RCTPlatform.m */,\n\t\t\t\tA2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */,\n\t\t\t\tA2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */,\n\t\t\t\t597AD1BB1E577D7800152581 /* RCTRootContentView.h */,\n\t\t\t\t597AD1BC1E577D7800152581 /* RCTRootContentView.m */,\n\t\t\t\t830A229C1A66C68A008503DA /* RCTRootView.h */,\n\t\t\t\t830A229D1A66C68A008503DA /* RCTRootView.m */,\n\t\t\t\t13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */,\n\t\t\t\t6A15FB0C1BDF663500531DFB /* RCTRootViewInternal.h */,\n\t\t\t\t391E86A31C623EC800009732 /* RCTTouchEvent.h */,\n\t\t\t\t391E86A21C623EC800009732 /* RCTTouchEvent.m */,\n\t\t\t\t83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */,\n\t\t\t\t83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */,\n\t\t\t\t3D5AC71E1E005750000F9153 /* RCTTVRemoteHandler.h */,\n\t\t\t\t3D5AC71F1E005750000F9153 /* RCTTVRemoteHandler.m */,\n\t\t\t\t1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */,\n\t\t\t\t1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */,\n\t\t\t\t83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */,\n\t\t\t\t83CBBA501A601E3B00E9B192 /* RCTUtils.m */,\n\t\t\t\t3D03BC2F1FEAA382008D5730 /* RCTVersion.h */,\n\t\t\t\t3D03BC321FEAA38A008D5730 /* Surface */,\n\t\t\t);\n\t\t\tpath = Base;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tA12E9E161E5DEA260029001B /* DevSupport */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */,\n\t\t\t\t13A0C2861B74F71200B29F6F /* RCTDevLoadingView.m */,\n\t\t\t\t13A0C2871B74F71200B29F6F /* RCTDevMenu.h */,\n\t\t\t\tB505583B1E43DFB900F71A00 /* RCTDevMenu.m */,\n\t\t\t\tA12E9E171E5DEA350029001B /* RCTPackagerClient.h */,\n\t\t\t\tA12E9E181E5DEA350029001B /* RCTPackagerClient.m */,\n\t\t\t\t3D7BFCE51EA8E1F4008DFB7A /* RCTPackagerConnection.h */,\n\t\t\t\t3D7BFCE61EA8E1F4008DFB7A /* RCTPackagerConnection.mm */,\n\t\t\t);\n\t\t\tpath = DevSupport;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tA12E9E271E5DEB600029001B /* WebSocket */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tA12E9E281E5DEB860029001B /* RCTReconnectingWebSocket.h */,\n\t\t\t\tA12E9E291E5DEB860029001B /* RCTSRWebSocket.h */,\n\t\t\t);\n\t\t\tname = WebSocket;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tAC70D2EA1DE489FC002E6351 /* cxxreact */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */,\n\t\t\t\tAC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */,\n\t\t\t\tAC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */,\n\t\t\t);\n\t\t\tpath = cxxreact;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t3D302F231DF828D100D6DDAE /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t59DA562C1F71C6C700D9EADA /* RCTUIManagerUtils.h in Headers */,\n\t\t\t\t3D6B76D31E83DD1C008FA614 /* RCTJSCErrorHandling.h in Headers */,\n\t\t\t\t3D6B76D41E83DD1C008FA614 /* RCTConvert+Transform.h in Headers */,\n\t\t\t\tA12E9E231E5DEB160029001B /* RCTPackagerClient.h in Headers */,\n\t\t\t\t3D03BC451FEAA38A008D5730 /* RCTSurface.h in Headers */,\n\t\t\t\t3D03BC281FEAA2AE008D5730 /* RCTScrollView.h in Headers */,\n\t\t\t\t3D302F241DF828F800D6DDAE /* RCTImageLoader.h in Headers */,\n\t\t\t\t3D302F251DF828F800D6DDAE /* RCTImageStoreManager.h in Headers */,\n\t\t\t\t3D03BC7A1FEAA5A6008D5730 /* RCTSafeAreaShadowView.h in Headers */,\n\t\t\t\t3D302F261DF828F800D6DDAE /* RCTResizeMode.h in Headers */,\n\t\t\t\t3D302F271DF828F800D6DDAE /* RCTLinkingManager.h in Headers */,\n\t\t\t\t3DCE52E21FEAB07600613583 /* RCTModalManager.h in Headers */,\n\t\t\t\t3D302F281DF828F800D6DDAE /* RCTNetworking.h in Headers */,\n\t\t\t\t3D302F291DF828F800D6DDAE /* RCTNetworkTask.h in Headers */,\n\t\t\t\t3D7BFCE81EA8E1F4008DFB7A /* RCTPackagerConnection.h in Headers */,\n\t\t\t\t3D302F2A1DF828F800D6DDAE /* RCTPushNotificationManager.h in Headers */,\n\t\t\t\t3D302F2B1DF828F800D6DDAE /* RCTAssert.h in Headers */,\n\t\t\t\tC65450621F3BD94C0090799B /* RCTManagedPointer.h in Headers */,\n\t\t\t\t3D302F2C1DF828F800D6DDAE /* RCTBridge.h in Headers */,\n\t\t\t\t3D302F2D1DF828F800D6DDAE /* RCTBridge+Private.h in Headers */,\n\t\t\t\t3D302F2E1DF828F800D6DDAE /* RCTBridgeDelegate.h in Headers */,\n\t\t\t\t3D302F2F1DF828F800D6DDAE /* RCTBridgeMethod.h in Headers */,\n\t\t\t\t3D302F301DF828F800D6DDAE /* RCTBridgeModule.h in Headers */,\n\t\t\t\t3D302F311DF828F800D6DDAE /* RCTBundleURLProvider.h in Headers */,\n\t\t\t\t3D302F321DF828F800D6DDAE /* RCTConvert.h in Headers */,\n\t\t\t\t3D302F331DF828F800D6DDAE /* RCTDefines.h in Headers */,\n\t\t\t\t3D302F341DF828F800D6DDAE /* RCTDisplayLink.h in Headers */,\n\t\t\t\t3D4153741F2770A3005B8EFE /* RCTMaskedViewManager.h in Headers */,\n\t\t\t\t3D302F351DF828F800D6DDAE /* RCTErrorCustomizer.h in Headers */,\n\t\t\t\t3D302F361DF828F800D6DDAE /* RCTErrorInfo.h in Headers */,\n\t\t\t\t3D03BC6F1FEAA48D008D5730 /* RCTRedBoxExtraDataViewController.h in Headers */,\n\t\t\t\t3D302F371DF828F800D6DDAE /* RCTEventDispatcher.h in Headers */,\n\t\t\t\t3D302F381DF828F800D6DDAE /* RCTFrameUpdate.h in Headers */,\n\t\t\t\t598C22D71EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.h in Headers */,\n\t\t\t\t3D5AC7221E005763000F9153 /* RCTTVRemoteHandler.h in Headers */,\n\t\t\t\t2D074E381E609E65001D6DD0 /* RCTReconnectingWebSocket.h in Headers */,\n\t\t\t\t3D302F391DF828F800D6DDAE /* RCTImageSource.h in Headers */,\n\t\t\t\tB50558431E43E64600F71A00 /* RCTDevSettings.h in Headers */,\n\t\t\t\t3D302F3A1DF828F800D6DDAE /* RCTInvalidating.h in Headers */,\n\t\t\t\t3D03BC591FEAA38A008D5730 /* RCTSurfaceView+Internal.h in Headers */,\n\t\t\t\t3D302F3B1DF828F800D6DDAE /* RCTJavaScriptExecutor.h in Headers */,\n\t\t\t\t3D302F3C1DF828F800D6DDAE /* RCTJavaScriptLoader.h in Headers */,\n\t\t\t\t3D03BC241FEAA2AE008D5730 /* RCTScrollContentViewManager.h in Headers */,\n\t\t\t\t3D302F3D1DF828F800D6DDAE /* RCTJSStackFrame.h in Headers */,\n\t\t\t\t3D302F3E1DF828F800D6DDAE /* RCTKeyCommands.h in Headers */,\n\t\t\t\t3D03BC5B1FEAA38A008D5730 /* RCTSurfaceView.h in Headers */,\n\t\t\t\t3D302F3F1DF828F800D6DDAE /* RCTLog.h in Headers */,\n\t\t\t\t3D302F401DF828F800D6DDAE /* RCTModuleData.h in Headers */,\n\t\t\t\tCF85BC341E79EC7A00F1EF3B /* RCTDeviceInfo.h in Headers */,\n\t\t\t\t3D302F411DF828F800D6DDAE /* RCTModuleMethod.h in Headers */,\n\t\t\t\t3D302F421DF828F800D6DDAE /* RCTMultipartDataTask.h in Headers */,\n\t\t\t\t3D302F431DF828F800D6DDAE /* RCTMultipartStreamReader.h in Headers */,\n\t\t\t\t3D03BC7E1FEAA5A6008D5730 /* RCTSafeAreaView.h in Headers */,\n\t\t\t\t3D302F441DF828F800D6DDAE /* RCTNullability.h in Headers */,\n\t\t\t\t3D302F451DF828F800D6DDAE /* RCTParserUtils.h in Headers */,\n\t\t\t\t3D302F461DF828F800D6DDAE /* RCTPerformanceLogger.h in Headers */,\n\t\t\t\t3D302F471DF828F800D6DDAE /* RCTPlatform.h in Headers */,\n\t\t\t\t3D03BC201FEAA2AE008D5730 /* RCTScrollContentView.h in Headers */,\n\t\t\t\t3D302F481DF828F800D6DDAE /* RCTRootView.h in Headers */,\n\t\t\t\t3D302F491DF828F800D6DDAE /* RCTRootViewDelegate.h in Headers */,\n\t\t\t\t3D302F4A1DF828F800D6DDAE /* RCTRootViewInternal.h in Headers */,\n\t\t\t\t3D302F4B1DF828F800D6DDAE /* RCTTouchEvent.h in Headers */,\n\t\t\t\t3D302F4C1DF828F800D6DDAE /* RCTTouchHandler.h in Headers */,\n\t\t\t\t3D302F4D1DF828F800D6DDAE /* RCTURLRequestDelegate.h in Headers */,\n\t\t\t\t3D03BC861FEAA5A6008D5730 /* RCTSafeAreaViewManager.h in Headers */,\n\t\t\t\t3D302F4E1DF828F800D6DDAE /* RCTURLRequestHandler.h in Headers */,\n\t\t\t\t3D302F4F1DF828F800D6DDAE /* RCTUtils.h in Headers */,\n\t\t\t\t3D302F531DF828F800D6DDAE /* RCTJSCExecutor.h in Headers */,\n\t\t\t\t3D302F541DF828F800D6DDAE /* RCTJSCSamplingProfiler.h in Headers */,\n\t\t\t\t3D302F551DF828F800D6DDAE /* RCTAccessibilityManager.h in Headers */,\n\t\t\t\t3D302F561DF828F800D6DDAE /* RCTAlertManager.h in Headers */,\n\t\t\t\t3D302F571DF828F800D6DDAE /* RCTAppState.h in Headers */,\n\t\t\t\t3D03BC4F1FEAA38A008D5730 /* RCTSurfaceRootShadowViewDelegate.h in Headers */,\n\t\t\t\t3D302F581DF828F800D6DDAE /* RCTAsyncLocalStorage.h in Headers */,\n\t\t\t\t3D03BC511FEAA38A008D5730 /* RCTSurfaceRootView.h in Headers */,\n\t\t\t\t3D302F591DF828F800D6DDAE /* RCTClipboard.h in Headers */,\n\t\t\t\t3D302F5A1DF828F800D6DDAE /* RCTDevLoadingView.h in Headers */,\n\t\t\t\t3D302F5B1DF828F800D6DDAE /* RCTDevMenu.h in Headers */,\n\t\t\t\t3D302F5C1DF828F800D6DDAE /* RCTEventEmitter.h in Headers */,\n\t\t\t\t3D03BC631FEAA38B008D5730 /* RCTSurfaceSizeMeasureMode.h in Headers */,\n\t\t\t\t3D302F5D1DF828F800D6DDAE /* RCTExceptionsManager.h in Headers */,\n\t\t\t\t3D302F5E1DF828F800D6DDAE /* RCTI18nManager.h in Headers */,\n\t\t\t\t3D302F5F1DF828F800D6DDAE /* RCTI18nUtil.h in Headers */,\n\t\t\t\t3D302F601DF828F800D6DDAE /* RCTKeyboardObserver.h in Headers */,\n\t\t\t\t3D302F611DF828F800D6DDAE /* RCTRedBox.h in Headers */,\n\t\t\t\t3D03BC2C1FEAA2AE008D5730 /* RCTScrollViewManager.h in Headers */,\n\t\t\t\t3D302F621DF828F800D6DDAE /* RCTSourceCode.h in Headers */,\n\t\t\t\t2D074E391E609E68001D6DD0 /* RCTSRWebSocket.h in Headers */,\n\t\t\t\t3D302F631DF828F800D6DDAE /* RCTStatusBarManager.h in Headers */,\n\t\t\t\t3D03BC1C1FEAA2AE008D5730 /* RCTScrollContentShadowView.h in Headers */,\n\t\t\t\t3D302F641DF828F800D6DDAE /* RCTTiming.h in Headers */,\n\t\t\t\t3D4153721F27709E005B8EFE /* RCTMaskedView.h in Headers */,\n\t\t\t\t3D302F651DF828F800D6DDAE /* RCTUIManager.h in Headers */,\n\t\t\t\t3D302F661DF828F800D6DDAE /* RCTFPSGraph.h in Headers */,\n\t\t\t\t3D302F681DF828F800D6DDAE /* RCTMacros.h in Headers */,\n\t\t\t\t3D302F691DF828F800D6DDAE /* RCTProfile.h in Headers */,\n\t\t\t\t3D302F6A1DF828F800D6DDAE /* RCTActivityIndicatorView.h in Headers */,\n\t\t\t\tC60128B21F3D128C009DF9FF /* RCTCxxConvert.h in Headers */,\n\t\t\t\t3D03BC821FEAA5A6008D5730 /* RCTSafeAreaViewLocalData.h in Headers */,\n\t\t\t\t597AD1BE1E577D7800152581 /* RCTRootContentView.h in Headers */,\n\t\t\t\t3D03BC4B1FEAA38A008D5730 /* RCTSurfaceRootShadowView.h in Headers */,\n\t\t\t\t3D302F6B1DF828F800D6DDAE /* RCTActivityIndicatorViewManager.h in Headers */,\n\t\t\t\t3D302F6C1DF828F800D6DDAE /* RCTAnimationType.h in Headers */,\n\t\t\t\t3D302F6D1DF828F800D6DDAE /* RCTAutoInsetsProtocol.h in Headers */,\n\t\t\t\t595405581EC03A1700766D3C /* RCTShadowView+Layout.h in Headers */,\n\t\t\t\t3D302F6E1DF828F800D6DDAE /* RCTBorderDrawing.h in Headers */,\n\t\t\t\t3D302F6F1DF828F800D6DDAE /* RCTBorderStyle.h in Headers */,\n\t\t\t\t3D302F701DF828F800D6DDAE /* RCTComponent.h in Headers */,\n\t\t\t\t3D302F711DF828F800D6DDAE /* RCTComponentData.h in Headers */,\n\t\t\t\t3D302F721DF828F800D6DDAE /* RCTConvert+CoreLocation.h in Headers */,\n\t\t\t\t3D302F761DF828F800D6DDAE /* RCTFont.h in Headers */,\n\t\t\t\t3D302F7B1DF828F800D6DDAE /* RCTModalHostView.h in Headers */,\n\t\t\t\t3D302F7C1DF828F800D6DDAE /* RCTModalHostViewController.h in Headers */,\n\t\t\t\t3D302F7D1DF828F800D6DDAE /* RCTModalHostViewManager.h in Headers */,\n\t\t\t\t3D03BC491FEAA38A008D5730 /* RCTSurfaceDelegate.h in Headers */,\n\t\t\t\t3D302F7E1DF828F800D6DDAE /* RCTNavigator.h in Headers */,\n\t\t\t\t3D302F7F1DF828F800D6DDAE /* RCTNavigatorManager.h in Headers */,\n\t\t\t\t3D4153561F276EDF005B8EFE /* RCTLayoutAnimationGroup.h in Headers */,\n\t\t\t\t3D302F801DF828F800D6DDAE /* RCTNavItem.h in Headers */,\n\t\t\t\t3D302F811DF828F800D6DDAE /* RCTNavItemManager.h in Headers */,\n\t\t\t\t3D302F841DF828F800D6DDAE /* RCTPointerEvents.h in Headers */,\n\t\t\t\t3D03BC551FEAA38A008D5730 /* RCTSurfaceStage.h in Headers */,\n\t\t\t\t3D302F851DF828F800D6DDAE /* RCTProgressViewManager.h in Headers */,\n\t\t\t\t3D302F861DF828F800D6DDAE /* RCTRefreshControl.h in Headers */,\n\t\t\t\t3D5AC7131E0056C4000F9153 /* RCTTVView.h in Headers */,\n\t\t\t\t3D302F871DF828F800D6DDAE /* RCTRefreshControlManager.h in Headers */,\n\t\t\t\tA2440AA41DF8D865006E7BFC /* RCTReloadCommand.h in Headers */,\n\t\t\t\t3D302F881DF828F800D6DDAE /* RCTRootShadowView.h in Headers */,\n\t\t\t\t3D4153551F276EDC005B8EFE /* RCTLayoutAnimation.h in Headers */,\n\t\t\t\t3D302F8C1DF828F800D6DDAE /* RCTSegmentedControl.h in Headers */,\n\t\t\t\t3D03BC1A1FEAA2AE008D5730 /* RCTScrollableProtocol.h in Headers */,\n\t\t\t\t3D302F8D1DF828F800D6DDAE /* RCTSegmentedControlManager.h in Headers */,\n\t\t\t\t3D302F8E1DF828F800D6DDAE /* RCTShadowView.h in Headers */,\n\t\t\t\t3D302F8F1DF828F800D6DDAE /* RCTSlider.h in Headers */,\n\t\t\t\t3D302F901DF828F800D6DDAE /* RCTSliderManager.h in Headers */,\n\t\t\t\t3D5AC7191E0056E0000F9153 /* RCTTVNavigationEventEmitter.h in Headers */,\n\t\t\t\t3D302F911DF828F800D6DDAE /* RCTSwitch.h in Headers */,\n\t\t\t\t3D302F921DF828F800D6DDAE /* RCTSwitchManager.h in Headers */,\n\t\t\t\t3D302F931DF828F800D6DDAE /* RCTTabBar.h in Headers */,\n\t\t\t\t3D302F941DF828F800D6DDAE /* RCTTabBarItem.h in Headers */,\n\t\t\t\t3D302F951DF828F800D6DDAE /* RCTTabBarItemManager.h in Headers */,\n\t\t\t\t3D03BC5F1FEAA38A008D5730 /* RCTSurfaceHostingView.h in Headers */,\n\t\t\t\t3D302F961DF828F800D6DDAE /* RCTTabBarManager.h in Headers */,\n\t\t\t\t3D302F971DF828F800D6DDAE /* RCTTextDecorationLineType.h in Headers */,\n\t\t\t\t3D302F981DF828F800D6DDAE /* RCTView.h in Headers */,\n\t\t\t\tC6FC33551F70495300643E54 /* RCTShadowView+Internal.h in Headers */,\n\t\t\t\t3D302F9A1DF828F800D6DDAE /* RCTViewManager.h in Headers */,\n\t\t\t\t3D302F9D1DF828F800D6DDAE /* RCTWrapperViewController.h in Headers */,\n\t\t\t\t3D302F9E1DF828F800D6DDAE /* UIView+Private.h in Headers */,\n\t\t\t\t3D302F9F1DF828F800D6DDAE /* UIView+React.h in Headers */,\n\t\t\t\t3D03BC311FEAA384008D5730 /* RCTVersion.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D30301C1DF8292200D6DDAE /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3DFE0D161DF8574D00459392 /* YGEnums.h in Headers */,\n\t\t\t\t3DCE52DD1FEAB05000613583 /* Yoga-internal.h in Headers */,\n\t\t\t\t3DFE0D171DF8574D00459392 /* YGMacros.h in Headers */,\n\t\t\t\t3DFE0D191DF8574D00459392 /* Yoga.h in Headers */,\n\t\t\t\t53330EEB1FC6EE7F008D7FA9 /* YGNodePrint.h in Headers */,\n\t\t\t\t3D03BC691FEAA456008D5730 /* YGNode.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3030211DF8294400D6DDAE /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D3030221DF8294C00D6DDAE /* JSBundleType.h in Headers */,\n\t\t\t\t3D3030231DF8294C00D6DDAE /* oss-compat-util.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3030241DF8295800D6DDAE /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D3030251DF8295E00D6DDAE /* JavaScriptCore.h in Headers */,\n\t\t\t\t3D3030261DF8295E00D6DDAE /* JSCWrapper.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3C04BB1DE3340900C268FA /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t133957881DF76D3500EC27BE /* YGEnums.h in Headers */,\n\t\t\t\t3DCE52DC1FEAB05000613583 /* Yoga-internal.h in Headers */,\n\t\t\t\t1339578B1DF76D3500EC27BE /* Yoga.h in Headers */,\n\t\t\t\t133957891DF76D3500EC27BE /* YGMacros.h in Headers */,\n\t\t\t\t53330EEA1FC6EE7F008D7FA9 /* YGNodePrint.h in Headers */,\n\t\t\t\t3D03BC681FEAA456008D5730 /* YGNode.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD9001DE5FBD600167DC4 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D3CD93D1DE5FC1400167DC4 /* JavaScriptCore.h in Headers */,\n\t\t\t\t3D3CD93E1DE5FC1400167DC4 /* JSCWrapper.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD91A1DE5FBEC00167DC4 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D3CD9471DE5FC7800167DC4 /* oss-compat-util.h in Headers */,\n\t\t\t\t3D3CD9451DE5FC7100167DC4 /* JSBundleType.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D80DA181DF820500028D040 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D80DA191DF820620028D040 /* RCTImageLoader.h in Headers */,\n\t\t\t\t3D80DA1A1DF820620028D040 /* RCTImageStoreManager.h in Headers */,\n\t\t\t\t3D80DA1B1DF820620028D040 /* RCTResizeMode.h in Headers */,\n\t\t\t\tC65450611F3BD94C0090799B /* RCTManagedPointer.h in Headers */,\n\t\t\t\t3D03BC231FEAA2AE008D5730 /* RCTScrollContentViewManager.h in Headers */,\n\t\t\t\t3D4153511F276ED7005B8EFE /* RCTLayoutAnimation.h in Headers */,\n\t\t\t\t3D80DA1C1DF820620028D040 /* RCTLinkingManager.h in Headers */,\n\t\t\t\t3D80DA1D1DF820620028D040 /* RCTNetworking.h in Headers */,\n\t\t\t\t3D80DA1E1DF820620028D040 /* RCTNetworkTask.h in Headers */,\n\t\t\t\t3D03BC1F1FEAA2AE008D5730 /* RCTScrollContentView.h in Headers */,\n\t\t\t\t3D80DA1F1DF820620028D040 /* RCTPushNotificationManager.h in Headers */,\n\t\t\t\t3D03BC501FEAA38A008D5730 /* RCTSurfaceRootView.h in Headers */,\n\t\t\t\t3D80DA201DF820620028D040 /* RCTAssert.h in Headers */,\n\t\t\t\t3D80DA211DF820620028D040 /* RCTBridge.h in Headers */,\n\t\t\t\t3D80DA221DF820620028D040 /* RCTBridge+Private.h in Headers */,\n\t\t\t\t3D80DA231DF820620028D040 /* RCTBridgeDelegate.h in Headers */,\n\t\t\t\t3D80DA241DF820620028D040 /* RCTBridgeMethod.h in Headers */,\n\t\t\t\t3D80DA251DF820620028D040 /* RCTBridgeModule.h in Headers */,\n\t\t\t\t3D80DA261DF820620028D040 /* RCTBundleURLProvider.h in Headers */,\n\t\t\t\t3D80DA271DF820620028D040 /* RCTConvert.h in Headers */,\n\t\t\t\tA12E9E1B1E5DEA350029001B /* RCTPackagerClient.h in Headers */,\n\t\t\t\t3D80DA281DF820620028D040 /* RCTDefines.h in Headers */,\n\t\t\t\t3D80DA291DF820620028D040 /* RCTDisplayLink.h in Headers */,\n\t\t\t\t3D80DA2A1DF820620028D040 /* RCTErrorCustomizer.h in Headers */,\n\t\t\t\t3D80DA2B1DF820620028D040 /* RCTErrorInfo.h in Headers */,\n\t\t\t\tC60128B11F3D128C009DF9FF /* RCTCxxConvert.h in Headers */,\n\t\t\t\t3D80DA2C1DF820620028D040 /* RCTEventDispatcher.h in Headers */,\n\t\t\t\t3D80DA2D1DF820620028D040 /* RCTFrameUpdate.h in Headers */,\n\t\t\t\t597AD1BD1E577D7800152581 /* RCTRootContentView.h in Headers */,\n\t\t\t\t3D80DA2E1DF820620028D040 /* RCTImageSource.h in Headers */,\n\t\t\t\t3D80DA2F1DF820620028D040 /* RCTInvalidating.h in Headers */,\n\t\t\t\t3D80DA301DF820620028D040 /* RCTJavaScriptExecutor.h in Headers */,\n\t\t\t\tA12E9E2A1E5DEB860029001B /* RCTReconnectingWebSocket.h in Headers */,\n\t\t\t\t3D80DA311DF820620028D040 /* RCTJavaScriptLoader.h in Headers */,\n\t\t\t\t3D03BC6E1FEAA48D008D5730 /* RCTRedBoxExtraDataViewController.h in Headers */,\n\t\t\t\t3D80DA321DF820620028D040 /* RCTJSStackFrame.h in Headers */,\n\t\t\t\tCF85BC321E79EC6B00F1EF3B /* RCTDeviceInfo.h in Headers */,\n\t\t\t\t3D80DA331DF820620028D040 /* RCTKeyCommands.h in Headers */,\n\t\t\t\tC6FC33541F70495200643E54 /* RCTShadowView+Internal.h in Headers */,\n\t\t\t\t3D80DA341DF820620028D040 /* RCTLog.h in Headers */,\n\t\t\t\t3D80DA351DF820620028D040 /* RCTModuleData.h in Headers */,\n\t\t\t\t3D03BC791FEAA5A6008D5730 /* RCTSafeAreaShadowView.h in Headers */,\n\t\t\t\t3D80DA361DF820620028D040 /* RCTModuleMethod.h in Headers */,\n\t\t\t\t3D03BC1B1FEAA2AE008D5730 /* RCTScrollContentShadowView.h in Headers */,\n\t\t\t\t3D80DA371DF820620028D040 /* RCTMultipartDataTask.h in Headers */,\n\t\t\t\t3D80DA381DF820620028D040 /* RCTMultipartStreamReader.h in Headers */,\n\t\t\t\t3D80DA391DF820620028D040 /* RCTNullability.h in Headers */,\n\t\t\t\t3D80DA3A1DF820620028D040 /* RCTParserUtils.h in Headers */,\n\t\t\t\t3D80DA3B1DF820620028D040 /* RCTPerformanceLogger.h in Headers */,\n\t\t\t\t3D80DA3C1DF820620028D040 /* RCTPlatform.h in Headers */,\n\t\t\t\t3D80DA3D1DF820620028D040 /* RCTRootView.h in Headers */,\n\t\t\t\t3D03BC7D1FEAA5A6008D5730 /* RCTSafeAreaView.h in Headers */,\n\t\t\t\t3D03BC271FEAA2AE008D5730 /* RCTScrollView.h in Headers */,\n\t\t\t\t3D80DA3E1DF820620028D040 /* RCTRootViewDelegate.h in Headers */,\n\t\t\t\t3D80DA3F1DF820620028D040 /* RCTRootViewInternal.h in Headers */,\n\t\t\t\t3D80DA401DF820620028D040 /* RCTTouchEvent.h in Headers */,\n\t\t\t\t3D80DA411DF820620028D040 /* RCTTouchHandler.h in Headers */,\n\t\t\t\t3D80DA421DF820620028D040 /* RCTURLRequestDelegate.h in Headers */,\n\t\t\t\t3D80DA431DF820620028D040 /* RCTURLRequestHandler.h in Headers */,\n\t\t\t\t3D80DA441DF820620028D040 /* RCTUtils.h in Headers */,\n\t\t\t\t3D80DA481DF820620028D040 /* RCTJSCExecutor.h in Headers */,\n\t\t\t\t3D80DA491DF820620028D040 /* RCTJSCSamplingProfiler.h in Headers */,\n\t\t\t\t3D80DA4A1DF820620028D040 /* RCTAccessibilityManager.h in Headers */,\n\t\t\t\t3D80DA4B1DF820620028D040 /* RCTAlertManager.h in Headers */,\n\t\t\t\t3D03BC301FEAA384008D5730 /* RCTVersion.h in Headers */,\n\t\t\t\t3D80DA4C1DF820620028D040 /* RCTAppState.h in Headers */,\n\t\t\t\t3D03BC541FEAA38A008D5730 /* RCTSurfaceStage.h in Headers */,\n\t\t\t\t3D80DA4D1DF820620028D040 /* RCTAsyncLocalStorage.h in Headers */,\n\t\t\t\t3D80DA4E1DF820620028D040 /* RCTClipboard.h in Headers */,\n\t\t\t\t3D80DA4F1DF820620028D040 /* RCTDevLoadingView.h in Headers */,\n\t\t\t\t3D80DA501DF820620028D040 /* RCTDevMenu.h in Headers */,\n\t\t\t\t3D80DA511DF820620028D040 /* RCTEventEmitter.h in Headers */,\n\t\t\t\t3D41536B1F277087005B8EFE /* RCTMaskedView.h in Headers */,\n\t\t\t\t3D80DA521DF820620028D040 /* RCTExceptionsManager.h in Headers */,\n\t\t\t\t3D80DA531DF820620028D040 /* RCTI18nManager.h in Headers */,\n\t\t\t\t3D03BC5A1FEAA38A008D5730 /* RCTSurfaceView.h in Headers */,\n\t\t\t\t598C22D61EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.h in Headers */,\n\t\t\t\t3D80DA541DF820620028D040 /* RCTI18nUtil.h in Headers */,\n\t\t\t\t3D80DA551DF820620028D040 /* RCTKeyboardObserver.h in Headers */,\n\t\t\t\t3D80DA561DF820620028D040 /* RCTRedBox.h in Headers */,\n\t\t\t\t3D03BC581FEAA38A008D5730 /* RCTSurfaceView+Internal.h in Headers */,\n\t\t\t\t595405571EC03A1700766D3C /* RCTShadowView+Layout.h in Headers */,\n\t\t\t\t3D80DA571DF820620028D040 /* RCTSourceCode.h in Headers */,\n\t\t\t\t3D03BC851FEAA5A6008D5730 /* RCTSafeAreaViewManager.h in Headers */,\n\t\t\t\t3D80DA581DF820620028D040 /* RCTStatusBarManager.h in Headers */,\n\t\t\t\t3D80DA591DF820620028D040 /* RCTTiming.h in Headers */,\n\t\t\t\t3D80DA5A1DF820620028D040 /* RCTUIManager.h in Headers */,\n\t\t\t\t3D80DA5B1DF820620028D040 /* RCTFPSGraph.h in Headers */,\n\t\t\t\tA12E9E2B1E5DEB860029001B /* RCTSRWebSocket.h in Headers */,\n\t\t\t\t3D03BC2B1FEAA2AE008D5730 /* RCTScrollViewManager.h in Headers */,\n\t\t\t\t3D03BC5E1FEAA38A008D5730 /* RCTSurfaceHostingView.h in Headers */,\n\t\t\t\t3D80DA5D1DF820620028D040 /* RCTMacros.h in Headers */,\n\t\t\t\t3D80DA5E1DF820620028D040 /* RCTProfile.h in Headers */,\n\t\t\t\t3D80DA5F1DF820620028D040 /* RCTActivityIndicatorView.h in Headers */,\n\t\t\t\t3D80DA601DF820620028D040 /* RCTActivityIndicatorViewManager.h in Headers */,\n\t\t\t\t3D80DA611DF820620028D040 /* RCTAnimationType.h in Headers */,\n\t\t\t\t3D03BC4E1FEAA38A008D5730 /* RCTSurfaceRootShadowViewDelegate.h in Headers */,\n\t\t\t\t3D03BC811FEAA5A6008D5730 /* RCTSafeAreaViewLocalData.h in Headers */,\n\t\t\t\t3D80DA621DF820620028D040 /* RCTAutoInsetsProtocol.h in Headers */,\n\t\t\t\t3D4153711F277092005B8EFE /* RCTConvert+Transform.h in Headers */,\n\t\t\t\t3D80DA631DF820620028D040 /* RCTBorderDrawing.h in Headers */,\n\t\t\t\t3D80DA641DF820620028D040 /* RCTBorderStyle.h in Headers */,\n\t\t\t\t3D80DA651DF820620028D040 /* RCTComponent.h in Headers */,\n\t\t\t\t3D03BC481FEAA38A008D5730 /* RCTSurfaceDelegate.h in Headers */,\n\t\t\t\t3D80DA661DF820620028D040 /* RCTComponentData.h in Headers */,\n\t\t\t\t3D80DA671DF820620028D040 /* RCTConvert+CoreLocation.h in Headers */,\n\t\t\t\t3D80DA691DF820620028D040 /* RCTDatePicker.h in Headers */,\n\t\t\t\t3D80DA6A1DF820620028D040 /* RCTDatePickerManager.h in Headers */,\n\t\t\t\t3D80DA6B1DF820620028D040 /* RCTFont.h in Headers */,\n\t\t\t\tB505583F1E43DFB900F71A00 /* RCTDevSettings.h in Headers */,\n\t\t\t\t3D80DA701DF820620028D040 /* RCTModalHostView.h in Headers */,\n\t\t\t\t3D80DA711DF820620028D040 /* RCTModalHostViewController.h in Headers */,\n\t\t\t\t3D80DA721DF820620028D040 /* RCTModalHostViewManager.h in Headers */,\n\t\t\t\t3D80DA731DF820620028D040 /* RCTNavigator.h in Headers */,\n\t\t\t\t3D80DA741DF820620028D040 /* RCTNavigatorManager.h in Headers */,\n\t\t\t\t3D4153531F276ED7005B8EFE /* RCTLayoutAnimationGroup.h in Headers */,\n\t\t\t\t3D7BFCE71EA8E1F4008DFB7A /* RCTPackagerConnection.h in Headers */,\n\t\t\t\t3D80DA751DF820620028D040 /* RCTNavItem.h in Headers */,\n\t\t\t\t3DCE52E11FEAB07600613583 /* RCTModalManager.h in Headers */,\n\t\t\t\t3D80DA761DF820620028D040 /* RCTNavItemManager.h in Headers */,\n\t\t\t\t3D80DA771DF820620028D040 /* RCTPicker.h in Headers */,\n\t\t\t\t3D80DA781DF820620028D040 /* RCTPickerManager.h in Headers */,\n\t\t\t\t3D80DA791DF820620028D040 /* RCTPointerEvents.h in Headers */,\n\t\t\t\t3D80DA7A1DF820620028D040 /* RCTProgressViewManager.h in Headers */,\n\t\t\t\t3D80DA7B1DF820620028D040 /* RCTRefreshControl.h in Headers */,\n\t\t\t\tA2440AA21DF8D854006E7BFC /* RCTReloadCommand.h in Headers */,\n\t\t\t\t3D80DA7C1DF820620028D040 /* RCTRefreshControlManager.h in Headers */,\n\t\t\t\t3D80DA7D1DF820620028D040 /* RCTRootShadowView.h in Headers */,\n\t\t\t\t59DA562B1F71C6C700D9EADA /* RCTUIManagerUtils.h in Headers */,\n\t\t\t\t3D80DA811DF820620028D040 /* RCTSegmentedControl.h in Headers */,\n\t\t\t\t3D80DA821DF820620028D040 /* RCTSegmentedControlManager.h in Headers */,\n\t\t\t\t3D80DA831DF820620028D040 /* RCTShadowView.h in Headers */,\n\t\t\t\t3D80DA841DF820620028D040 /* RCTSlider.h in Headers */,\n\t\t\t\t3D80DA851DF820620028D040 /* RCTSliderManager.h in Headers */,\n\t\t\t\t3D80DA861DF820620028D040 /* RCTSwitch.h in Headers */,\n\t\t\t\t3D80DA871DF820620028D040 /* RCTSwitchManager.h in Headers */,\n\t\t\t\t3D03BC441FEAA38A008D5730 /* RCTSurface.h in Headers */,\n\t\t\t\t3D80DA881DF820620028D040 /* RCTTabBar.h in Headers */,\n\t\t\t\t3D80DA891DF820620028D040 /* RCTTabBarItem.h in Headers */,\n\t\t\t\t3D80DA8A1DF820620028D040 /* RCTTabBarItemManager.h in Headers */,\n\t\t\t\t3D03BC191FEAA2AE008D5730 /* RCTScrollableProtocol.h in Headers */,\n\t\t\t\t139324FE1E70B069009FD7E0 /* RCTJSCErrorHandling.h in Headers */,\n\t\t\t\t3D80DA8B1DF820620028D040 /* RCTTabBarManager.h in Headers */,\n\t\t\t\t3D80DA8C1DF820620028D040 /* RCTTextDecorationLineType.h in Headers */,\n\t\t\t\t3D80DA8D1DF820620028D040 /* RCTView.h in Headers */,\n\t\t\t\t3D80DA8F1DF820620028D040 /* RCTViewManager.h in Headers */,\n\t\t\t\t3D80DA901DF820620028D040 /* RCTWebView.h in Headers */,\n\t\t\t\t3D80DA911DF820620028D040 /* RCTWebViewManager.h in Headers */,\n\t\t\t\t3D41536D1F277087005B8EFE /* RCTMaskedViewManager.h in Headers */,\n\t\t\t\t3D03BC621FEAA38B008D5730 /* RCTSurfaceSizeMeasureMode.h in Headers */,\n\t\t\t\t3D80DA921DF820620028D040 /* RCTWrapperViewController.h in Headers */,\n\t\t\t\t3D03BC4A1FEAA38A008D5730 /* RCTSurfaceRootShadowView.h in Headers */,\n\t\t\t\t3D80DA931DF820620028D040 /* UIView+Private.h in Headers */,\n\t\t\t\t3D80DA941DF820620028D040 /* UIView+React.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t2D2A28121D9B038B00D4039D /* React-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D2A281B1D9B038B00D4039D /* Build configuration list for PBXNativeTarget \"React-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2D6948301DA3088700B3FA97 /* Start Packager */,\n\t\t\t\t3D302F231DF828D100D6DDAE /* Headers */,\n\t\t\t\t3D302E191DF8249100D6DDAE /* Copy Headers */,\n\t\t\t\t2D2A280F1D9B038B00D4039D /* Sources */,\n\t\t\t\t2D6948201DA3042200B3FA97 /* Include RCTJSCProfiler */,\n\t\t\t\t3D3C088B1DE342FE00C268FA /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t3D0574551DE5FF9600184BB4 /* PBXTargetDependency */,\n\t\t\t\t3D0574571DE5FF9600184BB4 /* PBXTargetDependency */,\n\t\t\t\t3D0574591DE5FF9600184BB4 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"React-tvOS\";\n\t\t\tproductName = \"React-tvOS\";\n\t\t\tproductReference = 2D2A28131D9B038B00D4039D /* libReact.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3C04B91DE3340900C268FA /* yoga */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3C05971DE3340900C268FA /* Build configuration list for PBXNativeTarget \"yoga\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D3C04BB1DE3340900C268FA /* Headers */,\n\t\t\t\t3D80DAB41DF8212E0028D040 /* Copy Headers */,\n\t\t\t\t3D3C05301DE3340900C268FA /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = yoga;\n\t\t\tproductName = React;\n\t\t\tproductReference = 3D3C059A1DE3340900C268FA /* libyoga.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3C059B1DE3340C00C268FA /* yoga-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3C06721DE3340C00C268FA /* Build configuration list for PBXNativeTarget \"yoga-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D30301C1DF8292200D6DDAE /* Headers */,\n\t\t\t\t3D302F171DF825FE00D6DDAE /* Copy Headers */,\n\t\t\t\t3D3C06181DE3340C00C268FA /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"yoga-tvOS\";\n\t\t\tproductName = \"React-tvOS\";\n\t\t\tproductReference = 3D3C06751DE3340C00C268FA /* libyoga.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3CD8FF1DE5FBD600167DC4 /* jschelpers */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3CD9081DE5FBD600167DC4 /* Build configuration list for PBXNativeTarget \"jschelpers\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D3CD9001DE5FBD600167DC4 /* Headers */,\n\t\t\t\t3D80DABB1DF8218B0028D040 /* Copy Headers */,\n\t\t\t\t3D3CD9051DE5FBD600167DC4 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = jschelpers;\n\t\t\tproductName = React;\n\t\t\tproductReference = 3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3CD90C1DE5FBD800167DC4 /* jschelpers-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3CD9151DE5FBD800167DC4 /* Build configuration list for PBXNativeTarget \"jschelpers-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D3030241DF8295800D6DDAE /* Headers */,\n\t\t\t\t3D302F1D1DF8264A00D6DDAE /* Copy Headers */,\n\t\t\t\t3D3CD9121DE5FBD800167DC4 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"jschelpers-tvOS\";\n\t\t\tproductName = \"React-tvOS\";\n\t\t\tproductReference = 3D3CD9181DE5FBD800167DC4 /* libjschelpers.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3CD9191DE5FBEC00167DC4 /* cxxreact */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3CD9221DE5FBEC00167DC4 /* Build configuration list for PBXNativeTarget \"cxxreact\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D3CD91A1DE5FBEC00167DC4 /* Headers */,\n\t\t\t\t3D80DAB91DF821710028D040 /* Copy Headers */,\n\t\t\t\t3D3CD91F1DE5FBEC00167DC4 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t3D3CD9501DE5FDB900167DC4 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = cxxreact;\n\t\t\tproductName = React;\n\t\t\tproductReference = 3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t3D3CD9261DE5FBEE00167DC4 /* cxxreact-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 3D3CD92F1DE5FBEE00167DC4 /* Build configuration list for PBXNativeTarget \"cxxreact-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t3D3030211DF8294400D6DDAE /* Headers */,\n\t\t\t\t3D302F1B1DF8263300D6DDAE /* Copy Headers */,\n\t\t\t\t3D3CD92C1DE5FBEE00167DC4 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"cxxreact-tvOS\";\n\t\t\tproductName = \"React-tvOS\";\n\t\t\tproductReference = 3D3CD9321DE5FBEE00167DC4 /* libcxxreact.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t83CBBA2D1A601D0E00E9B192 /* React */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 83CBBA3F1A601D0F00E9B192 /* Build configuration list for PBXNativeTarget \"React\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t006B79A01A781F38006873D1 /* Start Packager */,\n\t\t\t\t3D80DA181DF820500028D040 /* Headers */,\n\t\t\t\t3D80D91E1DF6FA530028D040 /* Copy Headers */,\n\t\t\t\t83CBBA2A1A601D0E00E9B192 /* Sources */,\n\t\t\t\t142C4F7F1B582EA6001F0B58 /* Include RCTJSCProfiler */,\n\t\t\t\t3D3C08881DE342EE00C268FA /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t3D3CD94A1DE5FCE700167DC4 /* PBXTargetDependency */,\n\t\t\t\t3D3CD94C1DE5FCE700167DC4 /* PBXTargetDependency */,\n\t\t\t\t3D3CD94E1DE5FCE700167DC4 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = React;\n\t\t\tproductName = React;\n\t\t\tproductReference = 83CBBA2E1A601D0E00E9B192 /* libReact.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t83CBB9F71A601CBA00E9B192 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0820;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t2D2A28121D9B038B00D4039D = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t83CBBA2D1A601D0E00E9B192 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"ReactLegacy\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 83CBB9F61A601CBA00E9B192;\n\t\t\tproductRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t83CBBA2D1A601D0E00E9B192 /* React */,\n\t\t\t\t2D2A28121D9B038B00D4039D /* React-tvOS */,\n\t\t\t\t3D3C04B91DE3340900C268FA /* yoga */,\n\t\t\t\t3D3C059B1DE3340C00C268FA /* yoga-tvOS */,\n\t\t\t\t3D3CD9191DE5FBEC00167DC4 /* cxxreact */,\n\t\t\t\t3D3CD9261DE5FBEE00167DC4 /* cxxreact-tvOS */,\n\t\t\t\t3D3CD8FF1DE5FBD600167DC4 /* jschelpers */,\n\t\t\t\t3D3CD90C1DE5FBD800167DC4 /* jschelpers-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t006B79A01A781F38006873D1 /* Start Packager */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Start Packager\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"if [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\n  if nc -w 5 -z localhost 8081 ; then\\n    if ! curl -s \\\"http://localhost:8081/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\n      echo \\\"Port 8081 already in use, packager is either not running or not running correctly\\\"\\n      exit 2\\n    fi\\n  else\\n    open \\\"$SRCROOT/../scripts/launchPackager.command\\\" || echo \\\"Can't start packager automatically\\\"\\n  fi\\nfi\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t142C4F7F1B582EA6001F0B58 /* Include RCTJSCProfiler */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Include RCTJSCProfiler\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"if [[ \\\"$CONFIGURATION\\\" == \\\"Debug\\\" ]] && [[ -d \\\"/tmp/RCTJSCProfiler\\\" ]]; then\\n   find \\\"${CONFIGURATION_BUILD_DIR}\\\" -name '*.app' | xargs -I{} sh -c 'cp -r /tmp/RCTJSCProfiler \\\"$1\\\"' -- {}\\nfi\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t2D6948201DA3042200B3FA97 /* Include RCTJSCProfiler */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Include RCTJSCProfiler\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"if [[ \\\"$CONFIGURATION\\\" == \\\"Debug\\\" ]] && [[ -d \\\"/tmp/RCTJSCProfiler\\\" ]]; then\\nfind \\\"${CONFIGURATION_BUILD_DIR}\\\" -name '*.app' | xargs -I{} sh -c 'cp -r /tmp/RCTJSCProfiler \\\"$1\\\"' -- {}\\nfi\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t2D6948301DA3088700B3FA97 /* Start Packager */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Start Packager\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"if [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\nif nc -w 5 -z localhost 8081 ; then\\nif ! curl -s \\\"http://localhost:8081/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\necho \\\"Port 8081 already in use, packager is either not running or not running correctly\\\"\\nexit 2\\nfi\\nelse\\nopen \\\"$SRCROOT/../scripts/launchPackager.command\\\" || echo \\\"Can't start packager automatically\\\"\\nfi\\nfi\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t2D2A280F1D9B038B00D4039D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D6B76D71E83DD59008FA614 /* RCTJSCErrorHandling.mm in Sources */,\n\t\t\t\t3D03BC1E1FEAA2AE008D5730 /* RCTScrollContentShadowView.m in Sources */,\n\t\t\t\t3D80D91B1DF6F8200028D040 /* RCTPlatform.m in Sources */,\n\t\t\t\t2DD0EFE11DA84F2800B0C975 /* RCTStatusBarManager.m in Sources */,\n\t\t\t\t2D3B5EC91D9B095C00451313 /* RCTBorderDrawing.m in Sources */,\n\t\t\t\tB50558411E43E13D00F71A00 /* RCTDevMenu.m in Sources */,\n\t\t\t\t2D3B5E991D9B089A00451313 /* RCTDisplayLink.m in Sources */,\n\t\t\t\t2D3B5EA11D9B08B600451313 /* RCTModuleData.mm in Sources */,\n\t\t\t\t3D03BC801FEAA5A6008D5730 /* RCTSafeAreaView.m in Sources */,\n\t\t\t\t2D3B5EEA1D9B09CD00451313 /* RCTTabBar.m in Sources */,\n\t\t\t\t3D7BFCEA1EA8E1F4008DFB7A /* RCTPackagerConnection.mm in Sources */,\n\t\t\t\t2D3B5EAE1D9B08F800451313 /* RCTEventEmitter.m in Sources */,\n\t\t\t\tC606693A1F3CCF3F00E67165 /* RCTManagedPointer.mm in Sources */,\n\t\t\t\t2D3B5ECA1D9B095F00451313 /* RCTComponentData.m in Sources */,\n\t\t\t\t2D3B5EA31D9B08BE00451313 /* RCTParserUtils.m in Sources */,\n\t\t\t\t2D3B5EA01D9B08B200451313 /* RCTLog.mm in Sources */,\n\t\t\t\t3D03BC881FEAA5A6008D5730 /* RCTSafeAreaViewManager.m in Sources */,\n\t\t\t\t3D03BC471FEAA38A008D5730 /* RCTSurface.mm in Sources */,\n\t\t\t\t3D03BC531FEAA38A008D5730 /* RCTSurfaceRootView.mm in Sources */,\n\t\t\t\t3D4153581F276EE3005B8EFE /* RCTLayoutAnimationGroup.m in Sources */,\n\t\t\t\t3D4153751F2770A4005B8EFE /* RCTMaskedViewManager.m in Sources */,\n\t\t\t\t2D3B5ECF1D9B096F00451313 /* RCTFont.mm in Sources */,\n\t\t\t\t2D3B5ED51D9B098000451313 /* RCTModalHostViewController.m in Sources */,\n\t\t\t\t2D3B5EBC1D9B092600451313 /* RCTKeyboardObserver.m in Sources */,\n\t\t\t\t3D4153571F276EE1005B8EFE /* RCTLayoutAnimation.m in Sources */,\n\t\t\t\t59DA562E1F71C6C700D9EADA /* RCTUIManagerUtils.m in Sources */,\n\t\t\t\t2D3B5E971D9B089000451313 /* RCTBridge.m in Sources */,\n\t\t\t\t2D3B5E9B1D9B08A000451313 /* RCTFrameUpdate.m in Sources */,\n\t\t\t\t2D3B5EE41D9B09BB00451313 /* RCTSegmentedControlManager.m in Sources */,\n\t\t\t\t2D3B5EE31D9B09B700451313 /* RCTSegmentedControl.m in Sources */,\n\t\t\t\tA12E9E251E5DEB4D0029001B /* RCTPackagerClient.m in Sources */,\n\t\t\t\t2D3B5EB71D9B091800451313 /* RCTRedBox.m in Sources */,\n\t\t\t\t2D3B5EAF1D9B08FB00451313 /* RCTAccessibilityManager.m in Sources */,\n\t\t\t\t2D3B5EF11D9B09E700451313 /* UIView+React.m in Sources */,\n\t\t\t\t2D3B5E931D9B087300451313 /* RCTErrorInfo.m in Sources */,\n\t\t\t\t2D3B5EE01D9B09AD00451313 /* RCTRootShadowView.m in Sources */,\n\t\t\t\t2D3B5EBA1D9B092100451313 /* RCTI18nUtil.m in Sources */,\n\t\t\t\t2D3B5EB41D9B090A00451313 /* RCTDevLoadingView.m in Sources */,\n\t\t\t\t2D3B5EED1D9B09D700451313 /* RCTTabBarManager.m in Sources */,\n\t\t\t\t2D3B5EEF1D9B09DC00451313 /* RCTViewManager.m in Sources */,\n\t\t\t\t2D3B5ED81D9B098A00451313 /* RCTNavigatorManager.m in Sources */,\n\t\t\t\t2D3B5E951D9B087C00451313 /* RCTAssert.m in Sources */,\n\t\t\t\t2D3B5EB61D9B091400451313 /* RCTExceptionsManager.m in Sources */,\n\t\t\t\t2D3B5EEB1D9B09D000451313 /* RCTTabBarItem.m in Sources */,\n\t\t\t\t3DCE52E01FEAB06B00613583 /* RCTModalManager.m in Sources */,\n\t\t\t\t2D3B5E961D9B088500451313 /* RCTBatchedBridge.mm in Sources */,\n\t\t\t\t2D3B5ED41D9B097D00451313 /* RCTModalHostView.m in Sources */,\n\t\t\t\t2D3B5E9F1D9B08AF00451313 /* RCTKeyCommands.m in Sources */,\n\t\t\t\t3D03BC221FEAA2AE008D5730 /* RCTScrollContentView.m in Sources */,\n\t\t\t\t3D03BC5D1FEAA38A008D5730 /* RCTSurfaceView.mm in Sources */,\n\t\t\t\t2D3B5EA51D9B08C700451313 /* RCTRootView.m in Sources */,\n\t\t\t\t3D03BC2E1FEAA2AE008D5730 /* RCTScrollViewManager.m in Sources */,\n\t\t\t\t2D3B5EAC1D9B08EF00451313 /* RCTJSCExecutor.mm in Sources */,\n\t\t\t\t598C22D91EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.mm in Sources */,\n\t\t\t\t2D3B5EB11D9B090100451313 /* RCTAppState.m in Sources */,\n\t\t\t\t2D3B5EC21D9B093B00451313 /* RCTProfile.m in Sources */,\n\t\t\t\t3D03BC4D1FEAA38A008D5730 /* RCTSurfaceRootShadowView.m in Sources */,\n\t\t\t\t2D3B5ECB1D9B096200451313 /* RCTConvert+CoreLocation.m in Sources */,\n\t\t\t\tCF85BC351E79EC7D00F1EF3B /* RCTDeviceInfo.m in Sources */,\n\t\t\t\t2D3B5EEE1D9B09DA00451313 /* RCTView.m in Sources */,\n\t\t\t\t2D3B5E981D9B089500451313 /* RCTConvert.m in Sources */,\n\t\t\t\tC60128B41F3D128C009DF9FF /* RCTCxxConvert.m in Sources */,\n\t\t\t\t3D03BC6D1FEAA48D008D5730 /* RCTRedBoxExtraDataViewController.m in Sources */,\n\t\t\t\t2D3B5EA71D9B08CE00451313 /* RCTTouchHandler.m in Sources */,\n\t\t\t\t3D05745A1DE5FFF500184BB4 /* RCTJavaScriptLoader.mm in Sources */,\n\t\t\t\t2D3B5EA41D9B08C200451313 /* RCTPerformanceLogger.m in Sources */,\n\t\t\t\t2D7FEB891E734B5700D3238C /* systemJSCWrapper.cpp in Sources */,\n\t\t\t\t2D3B5E9E1D9B08AD00451313 /* RCTJSStackFrame.m in Sources */,\n\t\t\t\t2D3B5E941D9B087900451313 /* RCTBundleURLProvider.m in Sources */,\n\t\t\t\t2D3B5EB81D9B091B00451313 /* RCTSourceCode.m in Sources */,\n\t\t\t\t945929C51DD62ADD00653A7D /* RCTConvert+Transform.m in Sources */,\n\t\t\t\tC60669321F3CC7BD00E67165 /* RCTModuleMethod.mm in Sources */,\n\t\t\t\t2D3B5EBD1D9B092A00451313 /* RCTTiming.m in Sources */,\n\t\t\t\t2D3B5EA81D9B08D300451313 /* RCTUtils.m in Sources */,\n\t\t\t\t2D3B5EC81D9B095800451313 /* RCTActivityIndicatorViewManager.m in Sources */,\n\t\t\t\t3D03BC571FEAA38A008D5730 /* RCTSurfaceStage.m in Sources */,\n\t\t\t\t3D03BC611FEAA38B008D5730 /* RCTSurfaceHostingView.mm in Sources */,\n\t\t\t\t3DCD185D1DF978E7007FE5A1 /* RCTReloadCommand.m in Sources */,\n\t\t\t\tC6FC33531F70494F00643E54 /* RCTShadowView+Internal.m in Sources */,\n\t\t\t\t3D03BC841FEAA5A6008D5730 /* RCTSafeAreaViewLocalData.m in Sources */,\n\t\t\t\t2D3B5EC61D9B095000451313 /* RCTProfileTrampoline-x86_64.S in Sources */,\n\t\t\t\t3D5AC71A1E0056E0000F9153 /* RCTTVNavigationEventEmitter.m in Sources */,\n\t\t\t\t2D3B5EA61D9B08CA00451313 /* RCTTouchEvent.m in Sources */,\n\t\t\t\t5954055A1EC03A1700766D3C /* RCTShadowView+Layout.m in Sources */,\n\t\t\t\t2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */,\n\t\t\t\t2D3B5EF01D9B09E300451313 /* RCTWrapperViewController.m in Sources */,\n\t\t\t\t3D5AC7141E0056C7000F9153 /* RCTTVView.m in Sources */,\n\t\t\t\t2D3B5EEC1D9B09D400451313 /* RCTTabBarItemManager.m in Sources */,\n\t\t\t\t2D3B5EB01D9B08FE00451313 /* RCTAlertManager.m in Sources */,\n\t\t\t\t2D3B5E9C1D9B08A300451313 /* RCTImageSource.m in Sources */,\n\t\t\t\t3DDEC1521DDCE0CA0020BBDF /* RCTJSCSamplingProfiler.m in Sources */,\n\t\t\t\t3D4153731F2770A0005B8EFE /* RCTMaskedView.m in Sources */,\n\t\t\t\t3D5AC7231E005766000F9153 /* RCTTVRemoteHandler.m in Sources */,\n\t\t\t\tB50558421E43E14000F71A00 /* RCTDevSettings.mm in Sources */,\n\t\t\t\t2D3B5EC31D9B094800451313 /* RCTProfileTrampoline-arm.S in Sources */,\n\t\t\t\t2D3B5ED91D9B098E00451313 /* RCTNavItem.m in Sources */,\n\t\t\t\t3D03BC7C1FEAA5A6008D5730 /* RCTSafeAreaShadowView.m in Sources */,\n\t\t\t\t2D74EAFA1DAE9590003B751B /* RCTMultipartDataTask.m in Sources */,\n\t\t\t\t2D3B5EC51D9B094D00451313 /* RCTProfileTrampoline-i386.S in Sources */,\n\t\t\t\t3D03BC261FEAA2AE008D5730 /* RCTScrollContentViewManager.m in Sources */,\n\t\t\t\t597AD1C01E577D7800152581 /* RCTRootContentView.m in Sources */,\n\t\t\t\t2D3B5EC41D9B094B00451313 /* RCTProfileTrampoline-arm64.S in Sources */,\n\t\t\t\t2D3B5EBB1D9B092300451313 /* RCTI18nManager.m in Sources */,\n\t\t\t\t2D3B5EBE1D9B092D00451313 /* RCTUIManager.m in Sources */,\n\t\t\t\t2D3B5EDD1D9B09A300451313 /* RCTProgressViewManager.m in Sources */,\n\t\t\t\t2D3B5ED71D9B098700451313 /* RCTNavigator.m in Sources */,\n\t\t\t\t2D3B5EDA1D9B099100451313 /* RCTNavItemManager.m in Sources */,\n\t\t\t\t2D3B5EC11D9B093900451313 /* RCTFPSGraph.m in Sources */,\n\t\t\t\t3D03BC2A1FEAA2AE008D5730 /* RCTScrollView.m in Sources */,\n\t\t\t\t2D3B5E9A1D9B089D00451313 /* RCTEventDispatcher.m in Sources */,\n\t\t\t\t2D3B5ED61D9B098400451313 /* RCTModalHostViewManager.m in Sources */,\n\t\t\t\t2D3B5EE51D9B09BE00451313 /* RCTShadowView.m in Sources */,\n\t\t\t\t2D3B5EC71D9B095600451313 /* RCTActivityIndicatorView.m in Sources */,\n\t\t\t\t2D3B5EB21D9B090300451313 /* RCTAsyncLocalStorage.m in Sources */,\n\t\t\t\t2D3B5EC01D9B093600451313 /* RCTPerfMonitor.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3C05301DE3340900C268FA /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t53330EE71FC6EE74008D7FA9 /* YGNodePrint.cpp in Sources */,\n\t\t\t\t3DCE52DE1FEAB05200613583 /* Yoga.cpp in Sources */,\n\t\t\t\t3DCE52DA1FEAB04200613583 /* YGEnums.cpp in Sources */,\n\t\t\t\t3D03BC661FEAA456008D5730 /* YGNode.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3C06181DE3340C00C268FA /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t53330EE81FC6EE75008D7FA9 /* YGNodePrint.cpp in Sources */,\n\t\t\t\t3DCE52DF1FEAB05300613583 /* Yoga.cpp in Sources */,\n\t\t\t\t3DCE52DB1FEAB04200613583 /* YGEnums.cpp in Sources */,\n\t\t\t\t3D03BC671FEAA456008D5730 /* YGNode.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD9051DE5FBD600167DC4 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D80D9191DF6F7CF0028D040 /* JSCWrapper.cpp in Sources */,\n\t\t\t\t2638623A1E732AB60010FEBF /* systemJSCWrapper.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD9121DE5FBD800167DC4 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D80D91A1DF6F7CF0028D040 /* JSCWrapper.cpp in Sources */,\n\t\t\t\t2638623B1E732AB70010FEBF /* systemJSCWrapper.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD91F1DE5FBEC00167DC4 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D80D9171DF6F7A80028D040 /* JSBundleType.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t3D3CD92C1DE5FBEE00167DC4 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3D80D9181DF6F7A80028D040 /* JSBundleType.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t83CBBA2A1A601D0E00E9B192 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t597AD1BF1E577D7800152581 /* RCTRootContentView.m in Sources */,\n\t\t\t\t59DA562D1F71C6C700D9EADA /* RCTUIManagerUtils.m in Sources */,\n\t\t\t\t13723B501A82FD3C00F88898 /* RCTStatusBarManager.m in Sources */,\n\t\t\t\t000E6CEB1AB0E980000CDF4D /* RCTSourceCode.m in Sources */,\n\t\t\t\t916F9C2E1F743F7E002E5920 /* RCTModalManager.m in Sources */,\n\t\t\t\t001BFCD01D8381DE008E587E /* RCTMultipartStreamReader.m in Sources */,\n\t\t\t\t133CAE8E1B8E5CFD00F6AD92 /* RCTDatePicker.m in Sources */,\n\t\t\t\t14C2CA761B3AC64F00E6CBB2 /* RCTFrameUpdate.m in Sources */,\n\t\t\t\t13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */,\n\t\t\t\t352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */,\n\t\t\t\t3D03BC521FEAA38A008D5730 /* RCTSurfaceRootView.mm in Sources */,\n\t\t\t\t008341F61D1DB34400876D9A /* RCTJSStackFrame.m in Sources */,\n\t\t\t\t83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */,\n\t\t\t\t131B6AF41AF1093D00FFC3E0 /* RCTSegmentedControl.m in Sources */,\n\t\t\t\t830A229E1A66C68A008503DA /* RCTRootView.m in Sources */,\n\t\t\t\t13B07FF01A69327A00A75B9A /* RCTExceptionsManager.m in Sources */,\n\t\t\t\t13BCE8091C99CB9D00DD7AAD /* RCTRootShadowView.m in Sources */,\n\t\t\t\t595405591EC03A1700766D3C /* RCTShadowView+Layout.m in Sources */,\n\t\t\t\t006FC4141D9B20820057AAAD /* RCTMultipartDataTask.m in Sources */,\n\t\t\t\tC60669391F3CCF3F00E67165 /* RCTManagedPointer.mm in Sources */,\n\t\t\t\tA12E9E1C1E5DEA350029001B /* RCTPackagerClient.m in Sources */,\n\t\t\t\t13CC8A821B17642100940AE7 /* RCTBorderDrawing.m in Sources */,\n\t\t\t\t3D03BC5C1FEAA38A008D5730 /* RCTSurfaceView.mm in Sources */,\n\t\t\t\t83CBBA511A601E3B00E9B192 /* RCTAssert.m in Sources */,\n\t\t\t\t13AF20451AE707F9005F5298 /* RCTSlider.m in Sources */,\n\t\t\t\t58114A501AAE93D500E7D092 /* RCTAsyncLocalStorage.m in Sources */,\n\t\t\t\t598C22D81EDCBEE1009AF445 /* RCTUIManagerObserverCoordinator.mm in Sources */,\n\t\t\t\t13513F3C1B1F43F400FCE529 /* RCTProgressViewManager.m in Sources */,\n\t\t\t\t14F7A0F01BDA714B003C6C10 /* RCTFPSGraph.m in Sources */,\n\t\t\t\t3D03BC831FEAA5A6008D5730 /* RCTSafeAreaViewLocalData.m in Sources */,\n\t\t\t\t14F3620D1AABD06A001CE568 /* RCTSwitch.m in Sources */,\n\t\t\t\tC6FC33521F70494E00643E54 /* RCTShadowView+Internal.m in Sources */,\n\t\t\t\t3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */,\n\t\t\t\t14F3620E1AABD06A001CE568 /* RCTSwitchManager.m in Sources */,\n\t\t\t\t3D03BC601FEAA38B008D5730 /* RCTSurfaceHostingView.mm in Sources */,\n\t\t\t\t3D03BC211FEAA2AE008D5730 /* RCTScrollContentView.m in Sources */,\n\t\t\t\t13B080201A69489C00A75B9A /* RCTActivityIndicatorViewManager.m in Sources */,\n\t\t\t\t13E067561A70F44B002CDEE1 /* RCTViewManager.m in Sources */,\n\t\t\t\t3D7BFCE91EA8E1F4008DFB7A /* RCTPackagerConnection.mm in Sources */,\n\t\t\t\t13BB3D021BECD54500932C10 /* RCTImageSource.m in Sources */,\n\t\t\t\t58C571C11AA56C1900CDF9C8 /* RCTDatePickerManager.m in Sources */,\n\t\t\t\t1450FF8A1BCFF28A00208362 /* RCTProfileTrampoline-x86_64.S in Sources */,\n\t\t\t\t3D41536C1F277087005B8EFE /* RCTMaskedView.m in Sources */,\n\t\t\t\t13D9FEEB1CDCCECF00158BD7 /* RCTEventEmitter.m in Sources */,\n\t\t\t\tAC70D2E91DE489E4002E6351 /* RCTJavaScriptLoader.mm in Sources */,\n\t\t\t\t14F7A0EC1BDA3B3C003C6C10 /* RCTPerfMonitor.m in Sources */,\n\t\t\t\t1450FF881BCFF28A00208362 /* RCTProfileTrampoline-arm64.S in Sources */,\n\t\t\t\t13E41EEB1C05CA0B00CD8DAC /* RCTProfileTrampoline-i386.S in Sources */,\n\t\t\t\t3D37B5821D522B190042D5B5 /* RCTFont.mm in Sources */,\n\t\t\t\t137327EA1AA5CF210034F82E /* RCTTabBarManager.m in Sources */,\n\t\t\t\t369123E11DDC75850095B341 /* RCTJSCSamplingProfiler.m in Sources */,\n\t\t\t\t13B080261A694A8400A75B9A /* RCTWrapperViewController.m in Sources */,\n\t\t\t\tA2440AA31DF8D854006E7BFC /* RCTReloadCommand.m in Sources */,\n\t\t\t\tE9B20B7B1B500126007A2DA7 /* RCTAccessibilityManager.m in Sources */,\n\t\t\t\t3D03BC4C1FEAA38A008D5730 /* RCTSurfaceRootShadowView.m in Sources */,\n\t\t\t\t3D03BC461FEAA38A008D5730 /* RCTSurface.mm in Sources */,\n\t\t\t\t13A0C2891B74F71200B29F6F /* RCTDevLoadingView.m in Sources */,\n\t\t\t\t139324FF1E70B069009FD7E0 /* RCTJSCErrorHandling.mm in Sources */,\n\t\t\t\t13B07FF21A69327A00A75B9A /* RCTTiming.m in Sources */,\n\t\t\t\t3D03BC7B1FEAA5A6008D5730 /* RCTSafeAreaShadowView.m in Sources */,\n\t\t\t\t3D03BC6C1FEAA48D008D5730 /* RCTRedBoxExtraDataViewController.m in Sources */,\n\t\t\t\t1372B70A1AB030C200659ED6 /* RCTAppState.m in Sources */,\n\t\t\t\t134FCB3D1A6E7F0800051CC8 /* RCTJSCExecutor.mm in Sources */,\n\t\t\t\t14C2CA781B3ACB0400E6CBB2 /* RCTBatchedBridge.mm in Sources */,\n\t\t\t\tB50558401E43DFB900F71A00 /* RCTDevSettings.mm in Sources */,\n\t\t\t\t13E067591A70F44B002CDEE1 /* UIView+React.m in Sources */,\n\t\t\t\tB505583E1E43DFB900F71A00 /* RCTDevMenu.m in Sources */,\n\t\t\t\t14F484561AABFCE100FDF6B9 /* RCTSliderManager.m in Sources */,\n\t\t\t\t13D033631C1837FE0021DC29 /* RCTClipboard.m in Sources */,\n\t\t\t\tC60128B31F3D128C009DF9FF /* RCTCxxConvert.m in Sources */,\n\t\t\t\t14C2CA741B3AC64300E6CBB2 /* RCTModuleData.mm in Sources */,\n\t\t\t\t142014191B32094000CC17BA /* RCTPerformanceLogger.m in Sources */,\n\t\t\t\t3D03BC561FEAA38A008D5730 /* RCTSurfaceStage.m in Sources */,\n\t\t\t\t83CBBA981A6020BB00E9B192 /* RCTTouchHandler.m in Sources */,\n\t\t\t\t3EDCA8A51D3591E700450C31 /* RCTErrorInfo.m in Sources */,\n\t\t\t\t3D03BC2D1FEAA2AE008D5730 /* RCTScrollViewManager.m in Sources */,\n\t\t\t\t83CBBA521A601E3B00E9B192 /* RCTLog.mm in Sources */,\n\t\t\t\t13B0801D1A69489C00A75B9A /* RCTNavItemManager.m in Sources */,\n\t\t\t\t3D4153541F276ED7005B8EFE /* RCTLayoutAnimationGroup.m in Sources */,\n\t\t\t\t13A6E20E1C19AA0C00845B82 /* RCTParserUtils.m in Sources */,\n\t\t\t\t13E067571A70F44B002CDEE1 /* RCTView.m in Sources */,\n\t\t\t\t3D7749441DC1065C007EC8D8 /* RCTPlatform.m in Sources */,\n\t\t\t\t13D9FEEE1CDCD93000158BD7 /* RCTKeyboardObserver.m in Sources */,\n\t\t\t\tB233E6EA1D2D845D00BC68BA /* RCTI18nManager.m in Sources */,\n\t\t\t\t13456E931ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m in Sources */,\n\t\t\t\t137327E91AA5CF210034F82E /* RCTTabBarItemManager.m in Sources */,\n\t\t\t\t13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */,\n\t\t\t\t83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */,\n\t\t\t\t191E3EC11C29DC3800C180A6 /* RCTRefreshControl.m in Sources */,\n\t\t\t\t13C156051AB1A2840079392D /* RCTWebView.m in Sources */,\n\t\t\t\t83CBBA601A601EAA00E9B192 /* RCTBridge.m in Sources */,\n\t\t\t\t13C156061AB1A2840079392D /* RCTWebViewManager.m in Sources */,\n\t\t\t\t3D03BC7F1FEAA5A6008D5730 /* RCTSafeAreaView.m in Sources */,\n\t\t\t\t58114A161AAE854800E7D092 /* RCTPicker.m in Sources */,\n\t\t\t\t137327E81AA5CF210034F82E /* RCTTabBarItem.m in Sources */,\n\t\t\t\t83A1FE8C1B62640A00BE0E65 /* RCTModalHostView.m in Sources */,\n\t\t\t\tC60669311F3CC7BD00E67165 /* RCTModuleMethod.mm in Sources */,\n\t\t\t\t13E067551A70F44B002CDEE1 /* RCTShadowView.m in Sources */,\n\t\t\t\t3D03BC871FEAA5A6008D5730 /* RCTSafeAreaViewManager.m in Sources */,\n\t\t\t\t1450FF871BCFF28A00208362 /* RCTProfileTrampoline-arm.S in Sources */,\n\t\t\t\t131B6AF51AF1093D00FFC3E0 /* RCTSegmentedControlManager.m in Sources */,\n\t\t\t\t58114A171AAE854800E7D092 /* RCTPickerManager.m in Sources */,\n\t\t\t\t191E3EBE1C29D9AF00C180A6 /* RCTRefreshControlManager.m in Sources */,\n\t\t\t\t68EFE4EE1CF6EB3900A1DE13 /* RCTBundleURLProvider.m in Sources */,\n\t\t\t\tB95154321D1B34B200FE7B80 /* RCTActivityIndicatorView.m in Sources */,\n\t\t\t\t13B0801A1A69489C00A75B9A /* RCTNavigator.m in Sources */,\n\t\t\t\t137327E71AA5CF210034F82E /* RCTTabBar.m in Sources */,\n\t\t\t\t13F17A851B8493E5007D4C75 /* RCTRedBox.m in Sources */,\n\t\t\t\t3D03BC1D1FEAA2AE008D5730 /* RCTScrollContentShadowView.m in Sources */,\n\t\t\t\t83392EB31B6634E10013B15F /* RCTModalHostViewController.m in Sources */,\n\t\t\t\t3D03BC251FEAA2AE008D5730 /* RCTScrollContentViewManager.m in Sources */,\n\t\t\t\t13B0801C1A69489C00A75B9A /* RCTNavItem.m in Sources */,\n\t\t\t\t83CBBA691A601EF300E9B192 /* RCTEventDispatcher.m in Sources */,\n\t\t\t\t3D41536E1F277087005B8EFE /* RCTMaskedViewManager.m in Sources */,\n\t\t\t\t83A1FE8F1B62643A00BE0E65 /* RCTModalHostViewManager.m in Sources */,\n\t\t\t\t13E0674A1A70F434002CDEE1 /* RCTUIManager.m in Sources */,\n\t\t\t\t391E86A41C623EC800009732 /* RCTTouchEvent.m in Sources */,\n\t\t\t\t3D03BC291FEAA2AE008D5730 /* RCTScrollView.m in Sources */,\n\t\t\t\t1450FF861BCFF28A00208362 /* RCTProfile.m in Sources */,\n\t\t\t\t945929C41DD62ADD00653A7D /* RCTConvert+Transform.m in Sources */,\n\t\t\t\t13AB90C11B6FA36700713B4F /* RCTComponentData.m in Sources */,\n\t\t\t\t13B0801B1A69489C00A75B9A /* RCTNavigatorManager.m in Sources */,\n\t\t\t\t3D4153521F276ED7005B8EFE /* RCTLayoutAnimation.m in Sources */,\n\t\t\t\tCF85BC331E79EC6B00F1EF3B /* RCTDeviceInfo.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t3D0574551DE5FF9600184BB4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3C059B1DE3340C00C268FA /* yoga-tvOS */;\n\t\t\ttargetProxy = 3D0574541DE5FF9600184BB4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D0574571DE5FF9600184BB4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3CD9261DE5FBEE00167DC4 /* cxxreact-tvOS */;\n\t\t\ttargetProxy = 3D0574561DE5FF9600184BB4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D0574591DE5FF9600184BB4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3CD90C1DE5FBD800167DC4 /* jschelpers-tvOS */;\n\t\t\ttargetProxy = 3D0574581DE5FF9600184BB4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D3CD94A1DE5FCE700167DC4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3C04B91DE3340900C268FA /* yoga */;\n\t\t\ttargetProxy = 3D3CD9491DE5FCE700167DC4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D3CD94C1DE5FCE700167DC4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3CD9191DE5FBEC00167DC4 /* cxxreact */;\n\t\t\ttargetProxy = 3D3CD94B1DE5FCE700167DC4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D3CD94E1DE5FCE700167DC4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3CD8FF1DE5FBD600167DC4 /* jschelpers */;\n\t\t\ttargetProxy = 3D3CD94D1DE5FCE700167DC4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t3D3CD9501DE5FDB900167DC4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 3D3CD8FF1DE5FBD600167DC4 /* jschelpers */;\n\t\t\ttargetProxy = 3D3CD94F1DE5FDB900167DC4 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin XCBuildConfiguration section */\n\t\t2D2A28191D9B038B00D4039D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = React;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/React;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D2A281A1D9B038B00D4039D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = React;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/React;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3C05981DE3340900C268FA /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/yoga;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3C05991DE3340900C268FA /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/yoga;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3C06731DE3340C00C268FA /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = yoga;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/yoga;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3C06741DE3340C00C268FA /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = yoga;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/yoga;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3CD9091DE5FBD600167DC4 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3CD90A1DE5FBD600167DC4 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3CD9161DE5FBD800167DC4 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = jschelpers;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3CD9171DE5FBD800167DC4 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = jschelpers;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3CD9231DE5FBEC00167DC4 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3CD9241DE5FBEC00167DC4 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t3D3CD9301DE5FBEE00167DC4 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = cxxreact;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t3D3CD9311DE5FBEE00167DC4 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = cxxreact;\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact;\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA201A601CBA00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"RCT_DEBUG=1\",\n\t\t\t\t\t\"RCT_DEV=1\",\n\t\t\t\t\t\"RCT_NSASSERT=1\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Wextra\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t\t\"-Wno-semicolon-before-method-body\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA211A601CBA00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"\";\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWARNING_CFLAGS = (\n\t\t\t\t\t\"-Wextra\",\n\t\t\t\t\t\"-Wall\",\n\t\t\t\t\t\"-Wno-semicolon-before-method-body\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA401A601D0F00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/React;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA411A601D0F00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++14\";\n\t\t\t\tCLANG_STATIC_ANALYZER_MODE = deep;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = \"$(inherited)\";\n\t\t\t\tGCC_WARN_ABOUT_MISSING_NEWLINE = YES;\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/React;\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = NO;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t2D2A281B1D9B038B00D4039D /* Build configuration list for PBXNativeTarget \"React-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D2A28191D9B038B00D4039D /* Debug */,\n\t\t\t\t2D2A281A1D9B038B00D4039D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3C05971DE3340900C268FA /* Build configuration list for PBXNativeTarget \"yoga\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3C05981DE3340900C268FA /* Debug */,\n\t\t\t\t3D3C05991DE3340900C268FA /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3C06721DE3340C00C268FA /* Build configuration list for PBXNativeTarget \"yoga-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3C06731DE3340C00C268FA /* Debug */,\n\t\t\t\t3D3C06741DE3340C00C268FA /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3CD9081DE5FBD600167DC4 /* Build configuration list for PBXNativeTarget \"jschelpers\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3CD9091DE5FBD600167DC4 /* Debug */,\n\t\t\t\t3D3CD90A1DE5FBD600167DC4 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3CD9151DE5FBD800167DC4 /* Build configuration list for PBXNativeTarget \"jschelpers-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3CD9161DE5FBD800167DC4 /* Debug */,\n\t\t\t\t3D3CD9171DE5FBD800167DC4 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3CD9221DE5FBEC00167DC4 /* Build configuration list for PBXNativeTarget \"cxxreact\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3CD9231DE5FBEC00167DC4 /* Debug */,\n\t\t\t\t3D3CD9241DE5FBEC00167DC4 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t3D3CD92F1DE5FBEE00167DC4 /* Build configuration list for PBXNativeTarget \"cxxreact-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t3D3CD9301DE5FBEE00167DC4 /* Debug */,\n\t\t\t\t3D3CD9311DE5FBEE00167DC4 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"ReactLegacy\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA201A601CBA00E9B192 /* Debug */,\n\t\t\t\t83CBBA211A601CBA00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBBA3F1A601D0F00E9B192 /* Build configuration list for PBXNativeTarget \"React\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA401A601D0F00E9B192 /* Debug */,\n\t\t\t\t83CBBA411A601D0F00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;\n}\n"
  },
  {
    "path": "React/Views/NSView+NSViewAnimationWithBlocks.h",
    "content": "//\n//  Taken from\n//  https://github.com/BigZaphod/Chameleon/blob/master/UIKit/Classes/UIViewAnimationGroup.m\n\n\n#import <Cocoa/Cocoa.h>\n\ntypedef NSInteger NSViewAnimationTransition;\n\nenum NSViewAnimationTransition{\n  NSViewAnimationTransitionNone,\n  NSViewAnimationTransitionFlipFromLeft,\n  NSViewAnimationTransitionFlipFromRight,\n  NSViewAnimationTransitionCurlUp,\n  NSViewAnimationTransitionCurlDown,\n};\n\ntypedef NS_ENUM(NSInteger, NSViewAnimationGroupTransition) {\n  NSViewAnimationGroupTransitionNone,\n  NSViewAnimationGroupTransitionFlipFromLeft,\n  NSViewAnimationGroupTransitionFlipFromRight,\n  NSViewAnimationGroupTransitionCurlUp,\n  NSViewAnimationGroupTransitionCurlDown,\n  NSViewAnimationGroupTransitionFlipFromTop,\n  NSViewAnimationGroupTransitionFlipFromBottom,\n  NSViewAnimationGroupTransitionCrossDissolve,\n};\n\ntypedef NSUInteger NSViewAnimationOptions;\n\nenum NSViewAnimationOptions{\n  NSViewAnimationOptionLayoutSubviews            = 1 <<  0,\n  NSViewAnimationOptionAllowUserInteraction      = 1 <<  1, // turn on user interaction while animating\n  NSViewAnimationOptionBeginFromCurrentState     = 1 <<  2, // start all views from current value, not initial value\n  NSViewAnimationOptionRepeat                    = 1 <<  3, // repeat animation indefinitely\n  NSViewAnimationOptionAutoreverse               = 1 <<  4, // if repeat, run animation back and forth\n  NSViewAnimationOptionOverrideInheritedDuration = 1 <<  5, // ignore nested duration\n  NSViewAnimationOptionOverrideInheritedCurve    = 1 <<  6, // ignore nested curve\n  NSViewAnimationOptionAllowAnimatedContent      = 1 <<  7, // animate contents (applies to transitions only)\n  NSViewAnimationOptionShowHideTransitionViews   = 1 <<  8, // flip to/from hidden state instead of adding/removing\n\n  NSViewAnimationOptionCurveEaseInOut            = 0 << 16, // default\n  NSViewAnimationOptionCurveEaseIn               = 1 << 16,\n  NSViewAnimationOptionCurveEaseOut              = 2 << 16,\n  NSViewAnimationOptionCurveLinear               = 3 << 16,\n\n  NSViewAnimationOptionTransitionNone            = 0 << 20, // default\n  NSViewAnimationOptionTransitionFlipFromLeft    = 1 << 20,\n  NSViewAnimationOptionTransitionFlipFromRight   = 2 << 20,\n  NSViewAnimationOptionTransitionCurlUp          = 3 << 20,\n  NSViewAnimationOptionTransitionCurlDown        = 4 << 20,\n  NSViewAnimationOptionTransitionCrossDissolve   = 5 << 20,\n  NSViewAnimationOptionTransitionFlipFromTop     = 6 << 20,\n  NSViewAnimationOptionTransitionFlipFromBottom  = 7 << 20,\n};\n\ntypedef NSInteger NSViewAnimationCurve;\n\nenum NSViewAnimationCurve{\n  NSViewAnimationCurveEaseInOut,         // slow at beginning and end\n  NSViewAnimationCurveEaseIn,            // slow at beginning\n  NSViewAnimationCurveEaseOut,           // slow at end\n  NSViewAnimationCurveLinear\n};\n\nextern BOOL NSViewAnimationOptionIsSet(NSViewAnimationOptions options, NSViewAnimationOptions option);\n\n@interface NSView (NSViewAnimationWithBlocks)\n\n+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(NSViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion;\n\n+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay\n     usingSpringWithDamping:(CGFloat)damping\n      initialSpringVelocity:(CGFloat)springVelocity\n                    options:(NSViewAnimationOptions)options\n                 animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion;\n\n\n+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion; // delay = 0.0, options = 0\n\n+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations; // delay = 0.0, options = 0, completion = NULL\n\n+ (void)beginAnimations:(NSString *)animationID context:(void *)context;\n+ (void)commitAnimations;\n+ (BOOL)areAnimationsEnabled;\n+ (void)setAnimationsEnabled:(BOOL)enabled;\n\n@end\n\n@interface NSViewBlockAnimationDelegate : NSObject {\n  void (^_completion)(BOOL finished);\n  BOOL _ignoreInteractionEvents;\n}\n\n@property (nonatomic, copy) void (^completion)(BOOL finished);\n@property (nonatomic, assign) BOOL ignoreInteractionEvents;\n\n- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished;\n\n@end\n\n@interface NSViewAnimationGroup : NSObject\n\n@property (nonatomic, copy) NSString *name;\n@property (nonatomic, assign) void *context;\n@property (nonatomic, copy) void (^completionBlock)(BOOL finished);\n@property (nonatomic, assign) BOOL allowUserInteraction;\n@property (nonatomic, assign) BOOL beginsFromCurrentState;\n@property (nonatomic, assign) NSViewAnimationCurve curve;\n@property (nonatomic, assign) NSTimeInterval delay;\n@property (nonatomic, strong) id delegate;\n@property (nonatomic, assign) SEL didStopSelector;\n@property (nonatomic, assign) SEL willStartSelector;\n@property (nonatomic, assign) NSTimeInterval duration;\n@property (nonatomic, assign) BOOL repeatAutoreverses;\n@property (nonatomic, assign) float repeatCount;\n@property (nonatomic, assign) NSViewAnimationGroupTransition transition;\n\n- (id)initWithAnimationOptions:(NSViewAnimationOptions)options;\n\n- (id)actionForView:(NSView *)view forKey:(NSString *)keyPath;\n\n- (void)setAnimationBeginsFromCurrentState:(BOOL)beginFromCurrentState;\n- (void)setAnimationCurve:(NSViewAnimationCurve)curve;\n- (void)setAnimationDelay:(NSTimeInterval)delay;\n- (void)setAnimationDelegate:(id)delegate;\t\t\t// retained! (also true of the real UIKit)\n- (void)setAnimationDidStopSelector:(SEL)selector;\n- (void)setAnimationDuration:(NSTimeInterval)duration;\n- (void)setAnimationRepeatAutoreverses:(BOOL)repeatAutoreverses;\n- (void)setAnimationRepeatCount:(float)repeatCount;\n- (void)setAnimationWillStartSelector:(SEL)selector;\n\n- (void)commit;\n\n@end\n"
  },
  {
    "path": "React/Views/NSView+NSViewAnimationWithBlocks.m",
    "content": "//\n//  Taken from https://github.com/BigZaphod/Chameleon/blob/master/UIKit/Classes/UIViewAnimationGroup.m\n\n#import \"NSView+NSViewAnimationWithBlocks.h\"\n#import <QuartzCore/QuartzCore.h>\n\nstatic NSMutableSet *runningAnimationGroups = nil;\n\nstatic CAMediaTimingFunction *CAMediaTimingFunctionFromNSViewAnimationCurve(NSViewAnimationCurve curve)\n{\n  switch (curve) {\n    case NSViewAnimationCurveEaseInOut:\treturn [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];\n    case NSViewAnimationCurveEaseIn:\treturn [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];\n    case NSViewAnimationCurveEaseOut:\treturn [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];\n    case NSViewAnimationCurveLinear:\treturn [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];\n  }\n  return nil;\n}\n\n\nBOOL NSViewAnimationOptionIsSet(NSViewAnimationOptions options, NSViewAnimationOptions option)\n{\n  return ((options & option) == option);\n}\n\nstatic inline NSViewAnimationOptions NSViewAnimationOptionCurve(NSViewAnimationOptions options)\n{\n  return (options & (NSViewAnimationOptionCurveEaseInOut\n                     | NSViewAnimationOptionCurveEaseIn\n                     | NSViewAnimationOptionCurveEaseOut\n                     | NSViewAnimationOptionCurveLinear));\n}\n\n\nstatic inline NSViewAnimationOptions NSViewAnimationOptionTransition(NSViewAnimationOptions options)\n{\n  return (options & (NSViewAnimationOptionTransitionNone\n                     | NSViewAnimationOptionTransitionFlipFromLeft\n                     | NSViewAnimationOptionTransitionFlipFromRight\n                     | NSViewAnimationOptionTransitionCurlUp\n                     | NSViewAnimationOptionTransitionCurlDown\n                     | NSViewAnimationOptionTransitionCrossDissolve\n                     | NSViewAnimationOptionTransitionFlipFromTop\n                     | NSViewAnimationOptionTransitionFlipFromBottom));\n}\n\n\n@implementation NSViewAnimationGroup\n{\n  NSUInteger _waitingAnimations;\n  BOOL _didStart;\n  CFTimeInterval _animationBeginTime;\n  NSView *_transitionView;\n  BOOL _transitionShouldCache;\n  NSMutableSet *_animatingViews;\n}\n\n- (id)initWithAnimationOptions:(NSViewAnimationOptions)options\n{\n  if ((self=[super init])) {\n    _waitingAnimations = 1;\n    _animationBeginTime = CACurrentMediaTime();\n    _animatingViews = [NSMutableSet setWithCapacity:2];\n\n    self.duration = 200;\n\n    self.repeatCount = NSViewAnimationOptionIsSet(options, NSViewAnimationOptionRepeat)? FLT_MAX : 0;\n    self.allowUserInteraction = NSViewAnimationOptionIsSet(options, NSViewAnimationOptionAllowUserInteraction);\n    self.repeatAutoreverses = NSViewAnimationOptionIsSet(options, NSViewAnimationOptionAutoreverse);\n    self.beginsFromCurrentState = NSViewAnimationOptionIsSet(options, NSViewAnimationOptionBeginFromCurrentState);\n\n    const NSViewAnimationOptions animationCurve = NSViewAnimationOptionCurve(options);\n    if (animationCurve == NSViewAnimationOptionCurveEaseIn) {\n      self.curve = NSViewAnimationCurveEaseIn;\n    } else if (animationCurve == NSViewAnimationOptionCurveEaseOut) {\n      self.curve = NSViewAnimationCurveEaseOut;\n    } else if (animationCurve == NSViewAnimationOptionCurveLinear) {\n      self.curve = NSViewAnimationCurveLinear;\n    } else {\n      self.curve = NSViewAnimationCurveEaseInOut;\n    }\n\n    const NSViewAnimationOptions animationTransition = NSViewAnimationOptionTransition(options);\n    if (animationTransition == NSViewAnimationOptionTransitionFlipFromLeft) {\n      self.transition = NSViewAnimationGroupTransitionFlipFromLeft;\n    } else if (animationTransition == NSViewAnimationOptionTransitionFlipFromRight) {\n      self.transition = NSViewAnimationGroupTransitionFlipFromRight;\n    } else if (animationTransition == NSViewAnimationOptionTransitionCurlUp) {\n      self.transition = NSViewAnimationGroupTransitionCurlUp;\n    } else if (animationTransition == NSViewAnimationOptionTransitionCurlDown) {\n      self.transition = NSViewAnimationGroupTransitionCurlDown;\n    } else if (animationTransition == NSViewAnimationOptionTransitionCrossDissolve) {\n      self.transition = NSViewAnimationGroupTransitionCrossDissolve;\n    } else if (animationTransition == NSViewAnimationOptionTransitionFlipFromTop) {\n      self.transition = NSViewAnimationGroupTransitionFlipFromTop;\n    } else if (animationTransition == NSViewAnimationOptionTransitionFlipFromBottom) {\n      self.transition = NSViewAnimationGroupTransitionFlipFromBottom;\n    } else {\n      self.transition = NSViewAnimationGroupTransitionNone;\n    }\n  }\n  return self;\n}\n\n- (void)notifyAnimationsDidStartIfNeeded\n{\n  if (!_didStart) {\n    _didStart = YES;\n\n    @synchronized(runningAnimationGroups) {\n      [runningAnimationGroups addObject:self];\n    }\n\n    if ([self.delegate respondsToSelector:self.willStartSelector]) {\n      typedef void(*WillStartMethod)(id, SEL, NSString *, void *);\n      WillStartMethod method = (WillStartMethod)[self.delegate methodForSelector:self.willStartSelector];\n      method(self.delegate, self.willStartSelector, self.name, self.context);\n    }\n  }\n}\n\n- (void)animationDidStart:(CAAnimation *)theAnimation\n{\n  NSAssert([NSThread isMainThread], @\"expecting this to be on the main thread\");\n\n  [self notifyAnimationsDidStartIfNeeded];\n}\n\n- (void)notifyAnimationsDidStopIfNeededUsingStatus:(BOOL)animationsDidFinish\n{\n  if (_waitingAnimations == 0) {\n    if ([self.delegate respondsToSelector:self.didStopSelector]) {\n      NSNumber *finishedArgument = [NSNumber numberWithBool:animationsDidFinish];\n      typedef void(*DidFinishMethod)(id, SEL, NSString *, NSNumber *, void *);\n      DidFinishMethod method = (DidFinishMethod)[self.delegate methodForSelector:self.didStopSelector];\n      method(self.delegate, self.didStopSelector, self.name, finishedArgument, self.context);\n    }\n\n    if (self.completionBlock) {\n      self.completionBlock(animationsDidFinish);\n    }\n\n    @synchronized(runningAnimationGroups) {\n      [_animatingViews removeAllObjects];\n      [runningAnimationGroups removeObject:self];\n    }\n  }\n}\n\n- (void)setTransitionView:(NSView *)view shouldCache:(BOOL)cache\n{\n  _transitionView = view;\n  _transitionShouldCache = cache;\n}\n\n- (void)animationDidStop:(__unused CAAnimation *)theAnimation finished:(BOOL)flag\n{\n  NSAssert([NSThread isMainThread], @\"expecting this to be on the main thread\");\n\n  _waitingAnimations--;\n  [self notifyAnimationsDidStopIfNeededUsingStatus:flag];}\n\n- (CAAnimation *)addAnimation:(CAAnimation *)animation\n{\n  animation.timingFunction = CAMediaTimingFunctionFromNSViewAnimationCurve(self.curve);\n  animation.duration = self.duration;\n  animation.beginTime = _animationBeginTime + self.delay;\n  animation.repeatCount = self.repeatCount;\n  animation.autoreverses = self.repeatAutoreverses;\n  animation.fillMode = kCAFillModeBackwards;\n  animation.delegate = self;\n  animation.removedOnCompletion = YES;\n  _waitingAnimations++;\n  return animation;\n}\n\n- (id)actionForView:(NSView *)view forKey:(NSString *)keyPath\n{\n  @synchronized(runningAnimationGroups) {\n    [_animatingViews addObject:view];\n  }\n\n  if (_transitionView && self.transition != NSViewAnimationGroupTransitionNone) {\n    return nil;\n  } else {\n    CALayer *layer = view.layer;\n    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:keyPath];\n    animation.fromValue = self.beginsFromCurrentState? [layer.presentationLayer valueForKey:keyPath] : [layer valueForKey:keyPath];\n    return [self addAnimation:animation];\n  }\n}\n\n- (void)commit\n{\n  if (_transitionView && self.transition != NSViewAnimationGroupTransitionNone) {\n    CATransition *trans = [CATransition animation];\n\n    switch (self.transition) {\n      case NSViewAnimationGroupTransitionFlipFromLeft:\n        trans.type = kCATransitionPush;\n        trans.subtype = kCATransitionFromLeft;\n        break;\n\n      case NSViewAnimationGroupTransitionFlipFromRight:\n        trans.type = kCATransitionPush;\n        trans.subtype = kCATransitionFromRight;\n        break;\n\n      case NSViewAnimationGroupTransitionFlipFromTop:\n        trans.type = kCATransitionPush;\n        trans.subtype = kCATransitionFromTop;\n        break;\n\n      case NSViewAnimationGroupTransitionFlipFromBottom:\n        trans.type = kCATransitionPush;\n        trans.subtype = kCATransitionFromBottom;\n        break;\n\n      case NSViewAnimationGroupTransitionCurlUp:\n        trans.type = kCATransitionReveal;\n        trans.subtype = kCATransitionFromTop;\n        break;\n\n      case NSViewAnimationGroupTransitionCurlDown:\n        trans.type = kCATransitionReveal;\n        trans.subtype = kCATransitionFromBottom;\n        break;\n\n      case NSViewAnimationGroupTransitionCrossDissolve:\n      default:\n        trans.type = kCATransitionFade;\n        break;\n    }\n\n    [_animatingViews addObject:_transitionView];\n    [_transitionView.layer addAnimation:[self addAnimation:trans] forKey:kCATransition];\n  }\n\n  _waitingAnimations--;\n  [self notifyAnimationsDidStopIfNeededUsingStatus:YES];\n}\n\n@end\n\n\nstatic NSMutableArray *_animationGroups;\nstatic BOOL _animationsEnabled = YES;\n\n@implementation NSViewBlockAnimationDelegate\n@synthesize completion=_completion, ignoreInteractionEvents=_ignoreInteractionEvents;\n\n\n- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished\n{\n  if (_completion) {\n    _completion([finished boolValue]);\n  }\n\n  if (_ignoreInteractionEvents) {\n\n  }\n}\n\n@end\n\n@implementation NSView (NSViewAnimationWithBlocks)\n\n+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(NSViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion\n{\n  if (!_animationGroups) {\n    _animationGroups = [[NSMutableArray alloc] init];\n  }\n  [self _beginAnimationsWithOptions:options | NSViewAnimationOptionTransitionNone];\n  [self setAnimationDuration:duration];\n  [self setAnimationDelay:delay];\n  [self _setAnimationCompletionBlock:completion];\n\n  animations();\n\n  [self commitAnimations];\n}\n\n+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion\n{\n  [self animateWithDuration:duration\n                      delay:0\n                    options:NSViewAnimationOptionCurveEaseInOut\n                 animations:animations\n                 completion:completion];\n}\n\n+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations\n{\n  [self animateWithDuration:duration animations:animations completion:NULL];\n}\n\n\n//+ (void)beginAnimations:(NSString *)animationID context:(void *)context\n//{\n//    [_animationGroups addObject:[NSViewAnimationGroup animationGroupWithName:animationID context:context]];\n//}\n\n+ (void)commitAnimations\n{\n  if ([_animationGroups count] > 0) {\n    [[_animationGroups lastObject] commit];\n    [_animationGroups removeLastObject];\n  }\n}\n\n+ (void)setAnimationBeginsFromCurrentState:(BOOL)beginFromCurrentState\n{\n  [[_animationGroups lastObject] setBeginsFromCurrentState:beginFromCurrentState];\n}\n\n+ (void)setAnimationCurve:(NSViewAnimationCurve)curve\n{\n  [[_animationGroups lastObject] setCurve:curve];\n}\n\n+ (void)setAnimationDelay:(NSTimeInterval)delay\n{\n  [[_animationGroups lastObject] setDelay:delay];\n}\n\n+ (void)setAnimationDelegate:(id)delegate\n{\n  [[_animationGroups lastObject] setDelegate:delegate];\n}\n\n+ (void)setAnimationDidStopSelector:(SEL)selector\n{\n  [[_animationGroups lastObject] setDidStopSelector:selector];\n}\n\n+ (void)setAnimationDuration:(NSTimeInterval)duration\n{\n  [[_animationGroups lastObject] setDuration:duration];\n}\n\n+ (void)setAnimationRepeatAutoreverses:(BOOL)repeatAutoreverses\n{\n  [[_animationGroups lastObject] setRepeatAutoreverses:repeatAutoreverses];\n}\n\n+ (void)setAnimationRepeatCount:(float)repeatCount\n{\n  [[_animationGroups lastObject] setRepeatCount:repeatCount];\n}\n\n+ (void)setAnimationWillStartSelector:(SEL)selector\n{\n  [[_animationGroups lastObject] setAnimationWillStartSelector:selector];\n}\n\n+ (void)_setAnimationTransitionView:(NSView *)view\n{\n  [[_animationGroups lastObject] setTransitionView:view shouldCache:NO];\n}\n\n+ (void)_setAnimationCompletionBlock:(void (^)(BOOL finished))completion\n{\n  [(NSViewAnimationGroup *)[_animationGroups lastObject] setCompletionBlock:completion];\n}\n\n+ (void)_beginAnimationsWithOptions:(NSViewAnimationOptions)options\n{\n  NSViewAnimationGroup *group = [[NSViewAnimationGroup alloc] initWithAnimationOptions:options];\n  [_animationGroups addObject:group];\n}\n\n+ (void)transitionWithView:(NSView *)view duration:(NSTimeInterval)duration options:(NSViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion\n{\n  [self _beginAnimationsWithOptions:options];\n  [self setAnimationDuration:duration];\n  [self _setAnimationCompletionBlock:completion];\n  [self _setAnimationTransitionView:view];\n\n  if (animations) {\n    animations();\n  }\n\n  [self commitAnimations];\n}\n\n+ (void)transitionFromView:(NSView *)fromView toView:(NSView *)toView duration:(NSTimeInterval)duration options:(NSViewAnimationOptions)options completion:(void (^)(BOOL finished))completion\n{\n  [self transitionWithView:fromView.superview\n                  duration:duration\n                   options:options\n                animations:^{\n                  if (NSViewAnimationOptionIsSet(options, NSViewAnimationOptionShowHideTransitionViews)) {\n                    fromView.hidden = YES;\n                    toView.hidden = NO;\n                  } else {\n                    [fromView.superview addSubview:toView];\n                    [fromView removeFromSuperview];\n                  }\n                }\n                completion:completion];\n}\n\n+ (void)setAnimationTransition:(NSViewAnimationTransition)transition forView:(NSView *)view cache:(BOOL)cache\n{\n  [self _setAnimationTransitionView:view];\n\n  switch (transition) {\n    case NSViewAnimationTransitionNone:\n      [[_animationGroups lastObject] setTransition:NSViewAnimationGroupTransitionNone];\n      break;\n\n    case NSViewAnimationTransitionFlipFromLeft:\n      [[_animationGroups lastObject] setTransition:NSViewAnimationGroupTransitionFlipFromLeft];\n      break;\n\n    case NSViewAnimationTransitionFlipFromRight:\n      [[_animationGroups lastObject] setTransition:NSViewAnimationGroupTransitionFlipFromRight];\n      break;\n\n    case NSViewAnimationTransitionCurlUp:\n      [[_animationGroups lastObject] setTransition:NSViewAnimationGroupTransitionCurlUp];\n      break;\n\n    case NSViewAnimationTransitionCurlDown:\n      [[_animationGroups lastObject] setTransition:NSViewAnimationGroupTransitionCurlDown];\n      break;\n  }\n}\n\n- (id)actionForLayer:(CALayer *)theLayer forKey:(NSString *)event\n{\n  if (_animationsEnabled && [_animationGroups lastObject] && theLayer == _layer) {\n    return [[_animationGroups lastObject] actionForView:self forKey:event] ?: (id)[NSNull null];\n  } else {\n    return [NSNull null];\n  }\n}\n\n\n+ (BOOL)areAnimationsEnabled\n{\n  return _animationsEnabled;\n}\n\n+ (void)setAnimationsEnabled:(BOOL)enabled\n{\n  _animationsEnabled = enabled;\n}\n\n@end\n"
  },
  {
    "path": "React/Views/NSView+Private.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@interface NSView (Private)\n\n// remove clipped subviews implementation\n- (void)react_remountAllSubviews;\n- (void)react_updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(NSView *)clipView;\n- (NSView *)react_findClipView;\n\n@end\n"
  },
  {
    "path": "React/Views/NSView+React.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTComponent.h>\n#import <yoga/YGEnums.h>\n\n@class RCTShadowView;\n\n@interface NSView (React) <RCTComponent>\n\n/**\n * RCTComponent interface.\n */\n- (NSArray<NSView *> *)reactSubviews NS_REQUIRES_SUPER;\n- (NSView *)reactSuperview NS_REQUIRES_SUPER;\n- (void)insertReactSubview:(NSView *)subview atIndex:(NSInteger)atIndex NS_REQUIRES_SUPER;\n- (void)removeReactSubview:(NSView *)subview NS_REQUIRES_SUPER;\n\n/**\n * The native id of the view, used to locate view from native codes\n */\n@property (nonatomic, copy) NSString *nativeID;\n\n/**\n * Layout direction of the view.\n * Internally backed to `semanticContentAttribute` property.\n * Defaults to `LeftToRight` in case of ambiguity.\n */\n@property (nonatomic, assign) NSUserInterfaceLayoutDirection reactLayoutDirection;\n\n/**\n * Yoga `display` style property. Can be `flex` or `none`.\n * Defaults to `flex`.\n * May be used to temporary hide the view in a very efficient way.\n */\n@property (nonatomic, assign) YGDisplay reactDisplay;\n\n/**\n * The z-index of the view.\n */\n@property (nonatomic, assign) NSInteger reactZIndex;\n\n/**\n * Subviews sorted by z-index. Note that this method doesn't do any caching (yet)\n * and sorts all the views each call.\n */\n- (NSArray<NSView *> *)reactZIndexSortedSubviews;\n\n/**\n * Updates the subviews array based on the reactSubviews. Default behavior is\n * to insert the sortedReactSubviews into the UIView.\n */\n- (void)didUpdateReactSubviews;\n\n/**\n * Called each time props have been set.\n * The default implementation does nothing.\n */\n- (void)didSetProps:(NSArray<NSString *> *)changedProps;\n\n/**\n * Used by the UIIManager to set the view frame.\n * May be overriden to disable animation, etc.\n */\n- (void)reactSetFrame:(CGRect)frame;\n\n/**\n * This method finds and returns the containing view controller for the view.\n */\n- (NSViewController *)reactViewController;\n\n/**\n * This method attaches the specified controller as a child of the\n * the owning view controller of this view. Returns NO if no view\n * controller is found (which may happen if the view is not currently\n * attached to the view hierarchy).\n */\n- (void)reactAddControllerToClosestParent:(NSViewController *)controller;\n\n/**\n * Focus manipulation.\n */\n- (void)reactFocus;\n- (void)reactFocusIfNeeded;\n- (void)reactBlur;\n\n/**\n * Useful properties for computing layout.\n */\n@property (nonatomic, readonly) NSEdgeInsets reactBorderInsets;\n@property (nonatomic, readonly) NSEdgeInsets reactPaddingInsets;\n@property (nonatomic, readonly) NSEdgeInsets reactCompoundInsets;\n@property (nonatomic, readonly) CGRect reactContentFrame;\n\n/**\n * The (sub)view which represents this view in terms of accessibility.\n * ViewManager will apply all accessibility properties directly to this view.\n * May be overriten in view subclass which needs to be accessiblitywise\n * transparent in favour of some subview.\n * Defaults to `self`.\n */\n@property (nonatomic, readonly) NSView *reactAccessibilityElement;\n\n/*\n * UIKit replacement\n */\n@property (nonatomic, assign) BOOL clipsToBounds;\n\n@end\n"
  },
  {
    "path": "React/Views/NSView+React.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"NSView+React.h\"\n#import <AppKit/AppKit.h>\n#import <Foundation/Foundation.h>\n\n#import <objc/runtime.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTLog.h\"\n#import \"RCTShadowView.h\"\n\n@implementation NSView (React)\n\n- (NSNumber *)reactTag\n{\n  return objc_getAssociatedObject(self, _cmd);\n}\n\n- (void)setReactTag:(NSNumber *)reactTag\n{\n  objc_setAssociatedObject(self, @selector(reactTag), reactTag, OBJC_ASSOCIATION_RETAIN_NONATOMIC);\n}\n\n- (NSNumber *)nativeID\n{\n  return objc_getAssociatedObject(self, _cmd);\n}\n\n- (void)setNativeID:(NSNumber *)nativeID\n{\n  objc_setAssociatedObject(self, @selector(nativeID), nativeID, OBJC_ASSOCIATION_RETAIN_NONATOMIC);\n}\n\n- (BOOL)isReactRootView\n{\n  return RCTIsReactRootView(self.reactTag);\n}\n\n- (NSNumber *)reactTagAtPoint:(CGPoint)point\n{\n  NSView *view = [self hitTest:point];\n  while (view && !view.reactTag) {\n    view = view.superview;\n  }\n  return view.reactTag;\n}\n\n- (NSArray<NSView *> *)reactSubviews\n{\n  return objc_getAssociatedObject(self, _cmd);\n}\n\n- (NSView *)reactSuperview\n{\n  return self.superview;\n}\n\n- (void)insertReactSubview:(NSView *)subview atIndex:(NSInteger)atIndex\n{\n  // We access the associated object directly here in case someone overrides\n  // the `reactSubviews` getter method and returns an immutable array.\n  NSMutableArray *subviews = objc_getAssociatedObject(self, @selector(reactSubviews));\n  if (!subviews) {\n    subviews = [NSMutableArray new];\n    objc_setAssociatedObject(self, @selector(reactSubviews), subviews, OBJC_ASSOCIATION_RETAIN_NONATOMIC);\n  }\n  [subviews insertObject:subview atIndex:atIndex];\n}\n\n- (void)removeReactSubview:(NSView *)subview\n{\n  // We access the associated object directly here in case someone overrides\n  // the `reactSubviews` getter method and returns an immutable array.\n  NSMutableArray *subviews = objc_getAssociatedObject(self, @selector(reactSubviews));\n  [subviews removeObject:subview];\n  [subview removeFromSuperview];\n}\n\n#pragma mark - Display\n\n- (YGDisplay)reactDisplay\n{\n  return self.isHidden ? YGDisplayNone : YGDisplayFlex;\n}\n\n- (void)setReactDisplay:(YGDisplay)display\n{\n  self.hidden = display == YGDisplayNone;\n}\n\n#pragma mark - Layout Direction\n\n- (NSUserInterfaceLayoutDirection)reactLayoutDirection\n{\n  return [objc_getAssociatedObject(self, @selector(reactLayoutDirection)) integerValue];\n}\n\n- (void)setReactLayoutDirection:(NSUserInterfaceLayoutDirection)layoutDirection\n{\n  objc_setAssociatedObject(self, @selector(reactLayoutDirection), @(layoutDirection), OBJC_ASSOCIATION_RETAIN_NONATOMIC);\n}\n\n#pragma mark - zIndex\n\n- (NSInteger)reactZIndex\n{\n  return self.layer.zPosition;\n}\n\n- (void)setReactZIndex:(NSInteger)reactZIndex\n{\n  [self ensureLayerExists];\n  self.layer.zPosition = reactZIndex;\n}\n\n- (NSArray<NSView *> *)reactZIndexSortedSubviews\n{\n  // Check if sorting is required - in most cases it won't be.\n  BOOL sortingRequired = NO;\n  for (NSView *subview in self.subviews) {\n    if (subview.reactZIndex != 0) {\n      sortingRequired = YES;\n      break;\n    }\n  }\n  return sortingRequired ? [self.subviews sortedArrayUsingComparator:^NSComparisonResult(NSView *a, NSView *b) {\n    if (a.reactZIndex > b.reactZIndex) {\n      return NSOrderedDescending;\n    } else {\n      // Ensure sorting is stable by treating equal zIndex as ascending so\n      // that original order is preserved.\n      return NSOrderedAscending;\n    }\n  }] : self.subviews;\n}\n\n- (void)didUpdateReactSubviews\n{\n  for (NSView *subview in self.reactSubviews) {\n    [self addSubview:subview];\n  }\n}\n\n- (void)didSetProps:(__unused NSArray<NSString *> *)changedProps\n{\n  // The default implementation does nothing.\n}\n\n- (void)reactSetFrame:(CGRect)frame\n{\n//  if ([self respondsToSelector:@selector(respondsToLiveResizing)]) {\n//\n//  } else {\n//    NSLog(@\"%@\", self.reactTag);\n//  }\n  // These frames are in terms of anchorPoint = topLeft, but internally the\n  // views are anchorPoint = center for easier scale and rotation animations.\n  // Convert the frame so it works with anchorPoint = center.\n  CGPoint position = {CGRectGetMidX(frame), CGRectGetMidY(frame)};\n  CGRect bounds = {CGPointZero, frame.size};\n  CGPoint anchor = {0.5, 0.5};\n  \n  // Avoid crashes due to nan coords\n  if (isnan(position.x) || isnan(position.y) ||\n      isnan(bounds.origin.x) || isnan(bounds.origin.y) ||\n      isnan(bounds.size.width) || isnan(bounds.size.height)) {\n    RCTLogError(@\"Invalid layout for (%@)%@\", self.reactTag, self);\n    return;\n  }\n\n  self.frame = frame;\n  \n  // TODO: why position matters? It's only produce bugs\n  // OSX requires position and anchor point to rotate from center\n  self.layer.position = position;\n  self.layer.bounds = bounds;\n  self.layer.anchorPoint = anchor;\n}\n\n- (NSViewController *)reactViewController\n{\n  id responder = [self nextResponder];\n  if (responder == nil) {\n    NSView *rootCandidate = self.reactSuperview;\n    return rootCandidate.reactViewController;\n  }\n  while (responder) {\n    if ([responder isKindOfClass:[NSViewController class]]) {\n      return responder;\n    }\n    responder = [responder nextResponder];\n  }\n  return nil;\n}\n\n- (void)reactAddControllerToClosestParent:(NSViewController *)controller\n{\n  if (!controller.parentViewController) {\n    NSView *parentView = (NSView *)self.reactSuperview;\n    while (parentView) {\n      if (parentView.reactViewController) {\n        [parentView.reactViewController addChildViewController:controller];\n        //[controller didMoveToParentViewController:parentView.reactViewController];\n        break;\n      }\n      parentView = (NSView *)parentView.reactSuperview;\n    }\n    return;\n  }\n}\n\n/**\n * Focus manipulation.\n */\n- (BOOL)reactIsFocusNeeded\n{\n  return [(NSNumber *)objc_getAssociatedObject(self, @selector(reactIsFocusNeeded)) boolValue];\n}\n\n- (void)setReactIsFocusNeeded:(BOOL)isFocusNeeded\n{\n  objc_setAssociatedObject(self, @selector(reactIsFocusNeeded), @(isFocusNeeded), OBJC_ASSOCIATION_RETAIN_NONATOMIC);\n}\n\n- (void)reactFocus {\n  if (![self.window makeFirstResponder:self]) {\n    self.reactIsFocusNeeded = YES;\n  }\n}\n\n- (void)reactFocusIfNeeded {\n  if (self.reactIsFocusNeeded) {\n    if ([self.window makeFirstResponder:self]) {\n      self.reactIsFocusNeeded = NO;\n    }\n  }\n}\n\n- (void)reactBlur {\n  if (self == self.window.firstResponder) {\n    [self.window makeFirstResponder:nil];\n  }\n}\n\n#pragma mark - Layout\n\n- (NSEdgeInsets)reactBorderInsets\n{\n  CGFloat borderWidth = self.layer.borderWidth;\n  return NSEdgeInsetsMake(borderWidth, borderWidth, borderWidth, borderWidth);\n}\n\n- (NSEdgeInsets)reactPaddingInsets\n{\n  return NSEdgeInsetsZero;\n}\n\n- (NSEdgeInsets)reactCompoundInsets\n{\n  NSEdgeInsets borderInsets = self.reactBorderInsets;\n  NSEdgeInsets paddingInsets = self.reactPaddingInsets;\n\n  return NSEdgeInsetsMake(\n    borderInsets.top + paddingInsets.top,\n    borderInsets.left + paddingInsets.left,\n    borderInsets.bottom + paddingInsets.bottom,\n    borderInsets.right + paddingInsets.right\n  );\n}\n\nstatic inline CGRect NSEdgeInsetsInsetRect(CGRect rect, NSEdgeInsets insets) {\n  rect.origin.x    += insets.left;\n  rect.origin.y    += insets.top;\n  rect.size.width  -= (insets.left + insets.right);\n  rect.size.height -= (insets.top  + insets.bottom);\n  return rect;\n}\n\n- (CGRect)reactContentFrame\n{\n  return NSEdgeInsetsInsetRect(self.bounds, self.reactCompoundInsets);\n}\n\n#pragma mark - Accessiblity\n\n- (NSView *)reactAccessibilityElement\n{\n  return self;\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTActivityIndicatorView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@interface RCTActivityIndicatorView : NSProgressIndicator\n\n-(void)workaroundForLayer;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTActivityIndicatorView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTActivityIndicatorView.h\"\n\n@implementation RCTActivityIndicatorView {\n}\n\n- (void)setHidden:(BOOL)hidden\n{\n  [super setHidden: hidden];\n}\n\n-(void)workaroundForLayer {\n  CALayer *layer = [self layer];\n  CALayer *backgroundLayer = [[layer sublayers] firstObject];\n  [backgroundLayer setHidden:YES];\n}\n\n-(void)layout {\n  [self workaroundForLayer];\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTActivityIndicatorViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTConvert (NSProgressIndicator)\n\n//+ (UIActivityIndicatorViewStyle)UIActivityIndicatorViewStyle:(id)json;\n\n@end\n\n@interface RCTActivityIndicatorViewManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTActivityIndicatorViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTActivityIndicatorViewManager.h\"\n\n#import \"RCTActivityIndicatorView.h\"\n#import \"RCTConvert.h\"\n\n@implementation RCTConvert (NSProgressIndicator)\n\n// NOTE: It's pointless to support UIActivityIndicatorViewStyleGray\n// as we can set the color to any arbitrary value that we want to\n\n//RCT_ENUM_CONVERTER(UIActivityIndicatorViewStyle, (@{\n//  @\"large\": @(UIActivityIndicatorViewStyleWhiteLarge),\n//  @\"small\": @(UIActivityIndicatorViewStyleWhite),\n//}), UIActivityIndicatorViewStyleWhiteLarge, integerValue)\n\n@end\n\n@implementation RCTActivityIndicatorViewManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  RCTActivityIndicatorView* indicator = [[RCTActivityIndicatorView alloc] init];\n  [indicator setControlSize:NSRegularControlSize];\n  [indicator setStyle:NSProgressIndicatorStyleSpinning];\n  [indicator setUsesThreadedAnimation:YES];\n  [indicator setDisplayedWhenStopped:NO];\n  [indicator setHidden:YES];\n  indicator.controlTint = NSClearControlTint;\n  indicator.wantsLayer = YES;\n  \n  return indicator;\n}\n\n//RCT_EXPORT_VIEW_PROPERTY(color, NSColor) // implement drawRect\nRCT_REMAP_VIEW_PROPERTY(color, controlTint, NSColor)\n//RCT_EXPORT_VIEW_PROPERTY(hidesWhenStopped, BOOL)\n\nRCT_CUSTOM_VIEW_PROPERTY(animating, BOOL, __unused RCTActivityIndicatorView)\n{\n  //TODO: store animated property because NSProgressIndicator doesn't have a suitable method\n  BOOL animating = json ? [RCTConvert BOOL:json] : YES;\n  if (animating) {\n    [view setHidden:NO];\n    [view startAnimation:self];\n  } else {\n    [view stopAnimation:self];\n    [view setHidden:YES];\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTAnimationType.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\ntypedef NS_ENUM(NSInteger, RCTAnimationType) {\n  RCTAnimationTypeSpring = 0,\n  RCTAnimationTypeLinear,\n  RCTAnimationTypeEaseIn,\n  RCTAnimationTypeEaseOut,\n  RCTAnimationTypeEaseInEaseOut,\n  RCTAnimationTypeKeyboard,\n};\n"
  },
  {
    "path": "React/Views/RCTAutoInsetsProtocol.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n/**\n * Defines a View that wants to support auto insets adjustment\n */\n@protocol RCTAutoInsetsProtocol\n\n@property (nonatomic, assign, readwrite) NSEdgeInsets contentInset;\n@property (nonatomic, assign, readwrite) BOOL automaticallyAdjustContentInsets;\n\n/**\n * Automatically adjusted content inset depends on view controller's top and bottom\n * layout guides so if you've changed one of them (e.g. after rotation or manually) you should call this method\n * to recalculate and refresh content inset.\n * To handle case with changing navigation bar height call this method from viewDidLayoutSubviews:\n * of your view controller.\n */\n- (void)refreshContentInset;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTBorderDrawing.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBorderStyle.h>\n\ntypedef struct {\n  CGFloat topLeft;\n  CGFloat topRight;\n  CGFloat bottomLeft;\n  CGFloat bottomRight;\n} RCTCornerRadii;\n\ntypedef struct {\n  CGSize topLeft;\n  CGSize topRight;\n  CGSize bottomLeft;\n  CGSize bottomRight;\n} RCTCornerInsets;\n\ntypedef struct {\n  CGColorRef top;\n  CGColorRef left;\n  CGColorRef bottom;\n  CGColorRef right;\n} RCTBorderColors;\n\n/**\n * Determine if the border widths, colors and radii are all equal.\n */\nBOOL RCTBorderInsetsAreEqual(NSEdgeInsets borderInsets);\nBOOL RCTCornerRadiiAreEqual(RCTCornerRadii cornerRadii);\nBOOL RCTBorderColorsAreEqual(RCTBorderColors borderColors);\n\n/**\n * Convert RCTCornerRadii to RCTCornerInsets by applying border insets.\n * Effectively, returns radius - inset, with a lower bound of 0.0.\n */\nRCTCornerInsets RCTGetCornerInsets(RCTCornerRadii cornerRadii,\n                                   NSEdgeInsets borderInsets);\n\n/**\n * Create a CGPath representing a rounded rectangle with the specified bounds\n * and corner insets. Note that the CGPathRef must be released by the caller.\n */\nCGPathRef RCTPathCreateWithRoundedRect(CGRect bounds,\n                                       RCTCornerInsets cornerInsets,\n                                       const CGAffineTransform *transform);\n\n/**\n * Draw a CSS-compliant border as an image. You can determine if it's scalable\n * by inspecting the image's `capInsets`.\n *\n * `borderInsets` defines the border widths for each edge.\n */\nNSImage *RCTGetBorderImage(RCTBorderStyle borderStyle,\n                           CGSize viewSize,\n                           RCTCornerRadii cornerRadii,\n                           NSEdgeInsets borderInsets,\n                           RCTBorderColors borderColors,\n                           CGColorRef backgroundColor,\n                           BOOL drawToEdge);\n"
  },
  {
    "path": "React/Views/RCTBorderDrawing.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTBorderDrawing.h\"\n#import \"RCTLog.h\"\n#import \"UIImageUtils.h\"\n\nstatic const CGFloat RCTViewBorderThreshold = 0.001;\n\nBOOL RCTBorderInsetsAreEqual(NSEdgeInsets borderInsets)\n{\n  return\n  ABS(borderInsets.left - borderInsets.right) < RCTViewBorderThreshold &&\n  ABS(borderInsets.left - borderInsets.bottom) < RCTViewBorderThreshold &&\n  ABS(borderInsets.left - borderInsets.top) < RCTViewBorderThreshold;\n}\n\nBOOL RCTCornerRadiiAreEqual(RCTCornerRadii cornerRadii)\n{\n  return\n  ABS(cornerRadii.topLeft - cornerRadii.topRight) < RCTViewBorderThreshold &&\n  ABS(cornerRadii.topLeft - cornerRadii.bottomLeft) < RCTViewBorderThreshold &&\n  ABS(cornerRadii.topLeft - cornerRadii.bottomRight) < RCTViewBorderThreshold;\n}\n\nBOOL RCTBorderColorsAreEqual(RCTBorderColors borderColors)\n{\n  return\n  CGColorEqualToColor(borderColors.left, borderColors.right) &&\n  CGColorEqualToColor(borderColors.left, borderColors.top) &&\n  CGColorEqualToColor(borderColors.left, borderColors.bottom);\n}\n\nRCTCornerInsets RCTGetCornerInsets(RCTCornerRadii cornerRadii,\n                                   NSEdgeInsets edgeInsets)\n{\n  return (RCTCornerInsets) {\n    {\n      MAX(0, cornerRadii.topLeft - edgeInsets.left),\n      MAX(0, cornerRadii.topLeft - edgeInsets.top),\n    },\n    {\n      MAX(0, cornerRadii.topRight - edgeInsets.right),\n      MAX(0, cornerRadii.topRight - edgeInsets.top),\n    },\n    {\n      MAX(0, cornerRadii.bottomLeft - edgeInsets.left),\n      MAX(0, cornerRadii.bottomLeft - edgeInsets.bottom),\n    },\n    {\n      MAX(0, cornerRadii.bottomRight - edgeInsets.right),\n      MAX(0, cornerRadii.bottomRight - edgeInsets.bottom),\n    }\n  };\n}\n\nstatic NSEdgeInsets RCTRoundInsetsToPixel(NSEdgeInsets edgeInsets) {\n    edgeInsets.top = RCTRoundPixelValue(edgeInsets.top);\n    edgeInsets.bottom = RCTRoundPixelValue(edgeInsets.bottom);\n    edgeInsets.left = RCTRoundPixelValue(edgeInsets.left);\n    edgeInsets.right = RCTRoundPixelValue(edgeInsets.right);\n\n    return edgeInsets;\n}\n\nstatic void RCTPathAddEllipticArc(CGMutablePathRef path,\n                                  const CGAffineTransform *m,\n                                  CGPoint origin,\n                                  CGSize size,\n                                  CGFloat startAngle,\n                                  CGFloat endAngle,\n                                  BOOL clockwise)\n{\n  CGFloat xScale = 1, yScale = 1, radius = 0;\n  if (size.width != 0) {\n    xScale = 1;\n    yScale = size.height / size.width;\n    radius = size.width;\n  } else if (size.height != 0) {\n    xScale = size.width / size.height;\n    yScale = 1;\n    radius = size.height;\n  }\n\n  CGAffineTransform t = CGAffineTransformMakeTranslation(origin.x, origin.y);\n  t = CGAffineTransformScale(t, xScale, yScale);\n  if (m != NULL) {\n    t = CGAffineTransformConcat(t, *m);\n  }\n\n  CGPathAddArc(path, &t, 0, 0, radius, startAngle, endAngle, clockwise);\n}\n\nCGPathRef RCTPathCreateWithRoundedRect(CGRect bounds,\n                                       RCTCornerInsets cornerInsets,\n                                       const CGAffineTransform *transform)\n{\n  const CGFloat minX = CGRectGetMinX(bounds);\n  const CGFloat minY = CGRectGetMinY(bounds);\n  const CGFloat maxX = CGRectGetMaxX(bounds);\n  const CGFloat maxY = CGRectGetMaxY(bounds);\n\n  const CGSize topLeft = {\n    MAX(0, MIN(cornerInsets.topLeft.width, bounds.size.width - cornerInsets.topRight.width)),\n    MAX(0, MIN(cornerInsets.topLeft.height, bounds.size.height - cornerInsets.bottomLeft.height)),\n  };\n  const CGSize topRight = {\n    MAX(0, MIN(cornerInsets.topRight.width, bounds.size.width - cornerInsets.topLeft.width)),\n    MAX(0, MIN(cornerInsets.topRight.height, bounds.size.height - cornerInsets.bottomRight.height)),\n  };\n  const CGSize bottomLeft = {\n    MAX(0, MIN(cornerInsets.bottomLeft.width, bounds.size.width - cornerInsets.bottomRight.width)),\n    MAX(0, MIN(cornerInsets.bottomLeft.height, bounds.size.height - cornerInsets.topLeft.height)),\n  };\n  const CGSize bottomRight = {\n    MAX(0, MIN(cornerInsets.bottomRight.width, bounds.size.width - cornerInsets.bottomLeft.width)),\n    MAX(0, MIN(cornerInsets.bottomRight.height, bounds.size.height - cornerInsets.topRight.height)),\n  };\n\n  CGMutablePathRef path = CGPathCreateMutable();\n  RCTPathAddEllipticArc(path, transform, (CGPoint){\n    minX + topLeft.width, minY + topLeft.height\n  }, topLeft, M_PI, 3 * M_PI_2, NO);\n  RCTPathAddEllipticArc(path, transform, (CGPoint){\n    maxX - topRight.width, minY + topRight.height\n  }, topRight, 3 * M_PI_2, 0, NO);\n  RCTPathAddEllipticArc(path, transform, (CGPoint){\n    maxX - bottomRight.width, maxY - bottomRight.height\n  }, bottomRight, 0, M_PI_2, NO);\n  RCTPathAddEllipticArc(path, transform, (CGPoint){\n    minX + bottomLeft.width, maxY - bottomLeft.height\n  }, bottomLeft, M_PI_2, M_PI, NO);\n  CGPathCloseSubpath(path);\n  return path;\n}\n\nstatic void RCTEllipseGetIntersectionsWithLine(CGRect ellipseBounds,\n                                               CGPoint lineStart,\n                                               CGPoint lineEnd,\n                                               CGPoint intersections[2])\n{\n  const CGPoint ellipseCenter = {\n    CGRectGetMidX(ellipseBounds),\n    CGRectGetMidY(ellipseBounds)\n  };\n\n  lineStart.x -= ellipseCenter.x;\n  lineStart.y -= ellipseCenter.y;\n  lineEnd.x -= ellipseCenter.x;\n  lineEnd.y -= ellipseCenter.y;\n\n  const CGFloat m = (lineEnd.y - lineStart.y) / (lineEnd.x - lineStart.x);\n  const CGFloat a = ellipseBounds.size.width / 2;\n  const CGFloat b = ellipseBounds.size.height / 2;\n  const CGFloat c = lineStart.y - m * lineStart.x;\n  const CGFloat A = (b * b + a * a * m * m);\n  const CGFloat B = 2 * a * a * c * m;\n  const CGFloat D = sqrt((a * a * (b * b - c * c)) / A + pow(B / (2 * A), 2));\n\n  const CGFloat x_ = -B / (2 * A);\n  const CGFloat x1 = x_ + D;\n  const CGFloat x2 = x_ - D;\n  const CGFloat y1 = m * x1 + c;\n  const CGFloat y2 = m * x2 + c;\n\n  intersections[0] = (CGPoint){x1 + ellipseCenter.x, y1 + ellipseCenter.y};\n  intersections[1] = (CGPoint){x2 + ellipseCenter.x, y2 + ellipseCenter.y};\n}\n\n// Insets and returns the given NSRect by the given NSEdgeInsets.\nNS_INLINE CGRect NSEdgeInsetsInsetRect(NSRect rect, NSEdgeInsets insets) {\n  rect.origin.x\t+= insets.left;\n  rect.origin.y\t+= insets.top;\n  rect.size.width  -= (insets.left + insets.right);\n  rect.size.height -= (insets.top  + insets.bottom);\n  return rect;\n}\n\nstatic NSMutableArray *contextStack = nil;\nstatic NSMutableArray *imageContextStack = nil;\n\n\nNS_INLINE BOOL RCTCornerRadiiAreAboveThreshold(RCTCornerRadii cornerRadii) {\n  return (cornerRadii.topLeft > RCTViewBorderThreshold ||\n    cornerRadii.topRight > RCTViewBorderThreshold      ||\n    cornerRadii.bottomLeft > RCTViewBorderThreshold    ||\n    cornerRadii.bottomRight > RCTViewBorderThreshold);\n}\n\nstatic CGPathRef RCTPathCreateOuterOutline(BOOL drawToEdge, CGRect rect, RCTCornerRadii cornerRadii) {\n  if (drawToEdge) {\n    return CGPathCreateWithRect(rect, NULL);\n  }\n\n  return RCTPathCreateWithRoundedRect(rect, RCTGetCornerInsets(cornerRadii, NSEdgeInsetsZero), NULL);\n}\n\nstatic CGContextRef RCTUIGraphicsBeginImageContext(CGSize size, CGColorRef backgroundColor, BOOL hasCornerRadii, BOOL drawToEdge) {\n  const CGFloat alpha = CGColorGetAlpha(backgroundColor);\n  const BOOL opaque = (drawToEdge || !hasCornerRadii) && alpha == 1.0;\n  UIGraphicsBeginImageContextWithOptions(size, opaque, 0.0);\n  return UIGraphicsGetCurrentContext();\n}\n\nstatic NSImage *RCTGetSolidBorderImage(RCTCornerRadii cornerRadii,\n                                       CGSize viewSize,\n                                       NSEdgeInsets borderInsets,\n                                       RCTBorderColors borderColors,\n                                       CGColorRef backgroundColor,\n                                       BOOL drawToEdge)\n{\n  const BOOL hasCornerRadii = RCTCornerRadiiAreAboveThreshold(cornerRadii);\n  const RCTCornerInsets cornerInsets = RCTGetCornerInsets(cornerRadii, borderInsets);\n\n  // Incorrect render for borders that are not proportional to device pixel: borders get stretched and become\n  // significantly bigger than expected.\n  // Rdar: http://www.openradar.me/15959788\n  borderInsets = RCTRoundInsetsToPixel(borderInsets);\n\n  const BOOL makeStretchable =\n    (borderInsets.left + cornerInsets.topLeft.width +\n     borderInsets.right + cornerInsets.bottomRight.width <= viewSize.width) &&\n    (borderInsets.left + cornerInsets.bottomLeft.width +\n     borderInsets.right + cornerInsets.topRight.width <= viewSize.width) &&\n    (borderInsets.top + cornerInsets.topLeft.height +\n     borderInsets.bottom + cornerInsets.bottomRight.height <= viewSize.height) &&\n    (borderInsets.top + cornerInsets.topRight.height +\n     borderInsets.bottom + cornerInsets.bottomLeft.height <= viewSize.height);\n\n  const NSEdgeInsets edgeInsets = (NSEdgeInsets){\n    borderInsets.top + MAX(cornerInsets.topLeft.height, cornerInsets.topRight.height),\n    borderInsets.left + MAX(cornerInsets.topLeft.width, cornerInsets.bottomLeft.width),\n    borderInsets.bottom + MAX(cornerInsets.bottomLeft.height, cornerInsets.bottomRight.height),\n    borderInsets.right + MAX(cornerInsets.bottomRight.width, cornerInsets.topRight.width)\n  };\n\n  const CGSize size = viewSize;\n//  makeStretchable ? (CGSize){\n//    // 1pt for the middle stretchable area along each axis\n//    edgeInsets.left + 1 + edgeInsets.right,\n//    edgeInsets.top + 1 + edgeInsets.bottom\n//  } : viewSize;\n\n  CGContextRef ctx = RCTUIGraphicsBeginImageContext(size, backgroundColor, hasCornerRadii, drawToEdge);\n  const CGRect rect = {.size = size};\n\n  CGPathRef path = RCTPathCreateOuterOutline(drawToEdge, rect, cornerRadii);\n\n  if (backgroundColor) {\n    CGContextSetFillColorWithColor(ctx, backgroundColor);\n    CGContextAddPath(ctx, path);\n    CGContextFillPath(ctx);\n  }\n\n  CGContextAddPath(ctx, path);\n  CGPathRelease(path);\n\n  CGPathRef insetPath = RCTPathCreateWithRoundedRect(\n                                                     NSEdgeInsetsInsetRect(rect, borderInsets), cornerInsets, NULL);\n\n  CGContextAddPath(ctx, insetPath);\n  CGContextEOClip(ctx);\n\n  BOOL hasEqualColors = RCTBorderColorsAreEqual(borderColors);\n  if ((drawToEdge || !hasCornerRadii) && hasEqualColors) {\n\n    CGContextSetFillColorWithColor(ctx, borderColors.left);\n    CGContextAddRect(ctx, rect);\n    CGContextAddPath(ctx, insetPath);\n    CGContextEOFillPath(ctx);\n\n  } else {\n    CGPoint topLeft = (CGPoint){borderInsets.left, borderInsets.top};\n    if (cornerInsets.topLeft.width > 0 && cornerInsets.topLeft.height > 0) {\n      CGPoint points[2];\n      RCTEllipseGetIntersectionsWithLine((CGRect){\n        topLeft, {2 * cornerInsets.topLeft.width, 2 * cornerInsets.topLeft.height}\n      }, CGPointZero, topLeft, points);\n      if (!isnan(points[1].x) && !isnan(points[1].y)) {\n        topLeft = points[1];\n      }\n    }\n\n    CGPoint bottomLeft = (CGPoint){borderInsets.left, size.height - borderInsets.bottom};\n    if (cornerInsets.bottomLeft.width > 0 && cornerInsets.bottomLeft.height > 0) {\n      CGPoint points[2];\n      RCTEllipseGetIntersectionsWithLine((CGRect){\n        {bottomLeft.x, bottomLeft.y - 2 * cornerInsets.bottomLeft.height},\n        {2 * cornerInsets.bottomLeft.width, 2 * cornerInsets.bottomLeft.height}\n      }, (CGPoint){0, size.height}, bottomLeft, points);\n      if (!isnan(points[1].x) && !isnan(points[1].y)) {\n        bottomLeft = points[1];\n      }\n    }\n\n    CGPoint topRight = (CGPoint){size.width - borderInsets.right, borderInsets.top};\n    if (cornerInsets.topRight.width > 0 && cornerInsets.topRight.height > 0) {\n      CGPoint points[2];\n      RCTEllipseGetIntersectionsWithLine((CGRect){\n        {topRight.x - 2 * cornerInsets.topRight.width, topRight.y},\n        {2 * cornerInsets.topRight.width, 2 * cornerInsets.topRight.height}\n      }, (CGPoint){size.width, 0}, topRight, points);\n      if (!isnan(points[0].x) && !isnan(points[0].y)) {\n        topRight = points[0];\n      }\n    }\n\n    CGPoint bottomRight = (CGPoint){size.width - borderInsets.right, size.height - borderInsets.bottom};\n    if (cornerInsets.bottomRight.width > 0 && cornerInsets.bottomRight.height > 0) {\n      CGPoint points[2];\n      RCTEllipseGetIntersectionsWithLine((CGRect){\n        {bottomRight.x - 2 * cornerInsets.bottomRight.width, bottomRight.y - 2 * cornerInsets.bottomRight.height},\n        {2 * cornerInsets.bottomRight.width, 2 * cornerInsets.bottomRight.height}\n      }, (CGPoint){size.width, size.height}, bottomRight, points);\n      if (!isnan(points[0].x) && !isnan(points[0].y)) {\n        bottomRight = points[0];\n      }\n    }\n\n    CGColorRef currentColor = NULL;\n\n    // RIGHT\n    if (borderInsets.right > 0) {\n\n      const CGPoint points[] = {\n        (CGPoint){size.width, 0},\n        topRight,\n        bottomRight,\n        (CGPoint){size.width, size.height},\n      };\n\n      currentColor = borderColors.right;\n      CGContextAddLines(ctx, points, sizeof(points)/sizeof(*points));\n    }\n\n    // BOTTOM\n    if (borderInsets.bottom > 0) {\n\n      const CGPoint points[] = {\n        (CGPoint){0, size.height},\n        bottomLeft,\n        bottomRight,\n        (CGPoint){size.width, size.height},\n      };\n\n      if (!CGColorEqualToColor(currentColor, borderColors.bottom)) {\n        CGContextSetFillColorWithColor(ctx, currentColor);\n        CGContextFillPath(ctx);\n        currentColor = borderColors.bottom;\n      }\n      CGContextAddLines(ctx, points, sizeof(points)/sizeof(*points));\n    }\n\n    // LEFT\n    if (borderInsets.left > 0) {\n\n      const CGPoint points[] = {\n        CGPointZero,\n        topLeft,\n        bottomLeft,\n        (CGPoint){0, size.height},\n      };\n\n      if (!CGColorEqualToColor(currentColor, borderColors.left)) {\n        CGContextSetFillColorWithColor(ctx, currentColor);\n        CGContextFillPath(ctx);\n        currentColor = borderColors.left;\n      }\n      CGContextAddLines(ctx, points, sizeof(points)/sizeof(*points));\n    }\n\n    // TOP\n    if (borderInsets.top > 0) {\n\n      const CGPoint points[] = {\n        CGPointZero,\n        topLeft,\n        topRight,\n        (CGPoint){size.width, 0},\n      };\n\n      if (!CGColorEqualToColor(currentColor, borderColors.top)) {\n        CGContextSetFillColorWithColor(ctx, currentColor);\n        CGContextFillPath(ctx);\n        currentColor = borderColors.top;\n      }\n      CGContextAddLines(ctx, points, sizeof(points)/sizeof(*points));\n    }\n\n    CGContextSetFillColorWithColor(ctx, currentColor);\n    CGContextFillPath(ctx);\n  }\n\n  CGPathRelease(insetPath);\n\n  NSImage *image = UIGraphicsGetImageFromCurrentImageContext();\n  UIGraphicsEndImageContext();\n\n  if (makeStretchable) {\n    /*\n     * Strechable solid borders is not implemented\n     * image = [image resizableImageWithCapInsets:edgeInsets];\n     **/\n\n//    NSInteger left = edgeInsets.left;\n//    NSInteger top = edgeInsets.top;\n//    NSImage *strechableImage = [[NSImage alloc] initWithSize:viewSize];\n//    [strechableImage lockFocus];\n//    NSSize imgSize = viewSize;\n//\n//\n//    [image drawAtPoint:NSMakePoint(0, 0) fromRect:NSMakeRect(0, 0, left, top) operation:NSCompositeSourceOver fraction:1];\n//    [image drawInRect:NSMakeRect(left, 0, imgSize.width-2*left, top) fromRect:NSMakeRect(left, 0, imgSize.width-2*left, top) operation:NSCompositeSourceOver fraction:1];\n//    [image drawAtPoint:NSMakePoint(0 + imgSize.width - left, 0) fromRect:NSMakeRect(imgSize.width-left, 0, left, top) operation:NSCompositeSourceOver fraction:1];\n//    [strechableImage unlockFocus];\n//\n//    image = strechableImage;\n\n  }\n\n  return image;\n}\n\n// Currently, the dashed / dotted implementation only supports a single colour +\n// single width, as that's currently required and supported on Android.\n//\n// Supporting individual widths + colours on each side is possible by modifying\n// the current implementation. The idea is that we will draw four different lines\n// and clip appropriately for each side (might require adjustment of phase so that\n// they line up but even browsers don't do a good job at that).\n//\n// Firstly, create two paths for the outer and inner paths. The inner path is\n// generated exactly the same way as the outer, just given an inset rect, derived\n// from the insets on each side. Then clip using the odd-even rule\n// (CGContextEOClip()). This will give us a nice rounded (possibly) clip mask.\n//\n// +----------------------------------+\n// |@@@@@@@@  Clipped Space  @@@@@@@@@|\n// |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|\n// |@@+----------------------+@@@@@@@@|\n// |@@|                      |@@@@@@@@|\n// |@@|                      |@@@@@@@@|\n// |@@|                      |@@@@@@@@|\n// |@@+----------------------+@@@@@@@@|\n// |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|\n// +----------------------------------+\n//\n// Afterwards, we create a clip path for each border side (CGContextSaveGState()\n// and CGContextRestoreGState() when drawing each side). The clip mask for each\n// segment is a trapezoid connecting corresponding edges of the inner and outer\n// rects. For example, in the case of the top edge, the points would be:\n// - (MinX(outer), MinY(outer))\n// - (MaxX(outer), MinY(outer))\n// - (MinX(inner) + topLeftRadius, MinY(inner) + topLeftRadius)\n// - (MaxX(inner) - topRightRadius, MinY(inner) + topRightRadius)\n//\n//         +------------------+\n//         |\\                /|\n//         | \\              / |\n//         |  \\    top     /  |\n//         |   \\          /   |\n//         |    \\        /    |\n//         |     +------+     |\n//         |     |      |     |\n//         |     |      |     |\n//         |     |      |     |\n//         |left |      |right|\n//         |     |      |     |\n//         |     |      |     |\n//         |     +------+     |\n//         |    /        \\    |\n//         |   /          \\   |\n//         |  /            \\  |\n//         | /    bottom    \\ |\n//         |/                \\|\n//         +------------------+\n//\n//\n// Note that this approach will produce discontinous colour changes at the edge\n// (which is okay). The reason is that Quartz does not currently support drawing\n// of gradients _along_ a path (NB: clipping a path and drawing a linear gradient\n// is _not_ equivalent).\n\nstatic NSImage *RCTGetDashedOrDottedBorderImage(RCTBorderStyle borderStyle,\n                                                RCTCornerRadii cornerRadii,\n                                                CGSize viewSize,\n                                                NSEdgeInsets borderInsets,\n                                                RCTBorderColors borderColors,\n                                                CGColorRef backgroundColor,\n                                                BOOL drawToEdge)\n{\n  NSCParameterAssert(borderStyle == RCTBorderStyleDashed || borderStyle == RCTBorderStyleDotted);\n\n  if (!RCTBorderColorsAreEqual(borderColors) || !RCTBorderInsetsAreEqual(borderInsets)) {\n    RCTLogWarn(@\"Unsupported dashed / dotted border style\");\n    return nil;\n  }\n\n  const CGFloat lineWidth = borderInsets.top;\n  if (lineWidth <= 0.0) {\n    return nil;\n  }\n\n  const BOOL hasCornerRadii = RCTCornerRadiiAreAboveThreshold(cornerRadii);\n  CGContextRef ctx = RCTUIGraphicsBeginImageContext(viewSize, backgroundColor, hasCornerRadii, drawToEdge);\n  const CGRect rect = {.size = viewSize};\n\n  if (backgroundColor) {\n    CGPathRef outerPath = RCTPathCreateOuterOutline(drawToEdge, rect, cornerRadii);\n    CGContextAddPath(ctx, outerPath);\n    CGPathRelease(outerPath);\n\n    CGContextSetFillColorWithColor(ctx, backgroundColor);\n    CGContextFillPath(ctx);\n  }\n\n  // Stroking means that the width is divided in half and grows in both directions\n  // perpendicular to the path, that's why we inset by half the width, so that it\n  // reaches the edge of the rect.\n  CGRect pathRect = CGRectInset(rect, lineWidth / 2.0, lineWidth / 2.0);\n  CGPathRef path = RCTPathCreateWithRoundedRect(pathRect, RCTGetCornerInsets(cornerRadii, NSEdgeInsetsZero), NULL);\n\n  CGFloat dashLengths[2];\n  dashLengths[0] = dashLengths[1] = (borderStyle == RCTBorderStyleDashed ? 3 : 1) * lineWidth;\n\n  CGContextSetLineWidth(ctx, lineWidth);\n  CGContextSetLineDash(ctx, 0, dashLengths, sizeof(dashLengths) / sizeof(*dashLengths));\n\n  CGContextSetStrokeColorWithColor(ctx, [NSColor yellowColor].CGColor);\n\n  CGContextAddPath(ctx, path);\n  CGContextSetStrokeColorWithColor(ctx, borderColors.top);\n  CGContextStrokePath(ctx);\n\n  CGPathRelease(path);\n\n  NSImage *image = UIGraphicsGetImageFromCurrentImageContext();\n  UIGraphicsEndImageContext();\n\n  return image;\n}\n\nNSImage *RCTGetBorderImage(RCTBorderStyle borderStyle,\n                           CGSize viewSize,\n                           RCTCornerRadii cornerRadii,\n                           NSEdgeInsets borderInsets,\n                           RCTBorderColors borderColors,\n                           CGColorRef backgroundColor,\n                           BOOL drawToEdge)\n{\n\n  switch (borderStyle) {\n    case RCTBorderStyleSolid:\n      return RCTGetSolidBorderImage(cornerRadii, viewSize, borderInsets, borderColors, backgroundColor, drawToEdge);\n    case RCTBorderStyleDashed:\n    case RCTBorderStyleDotted:\n      return RCTGetDashedOrDottedBorderImage(borderStyle, cornerRadii, viewSize, borderInsets, borderColors, backgroundColor, drawToEdge);\n    case RCTBorderStyleUnset:\n      break;\n  }\n\n  return nil;\n}\n"
  },
  {
    "path": "React/Views/RCTBorderStyle.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\ntypedef NS_ENUM(NSInteger, RCTBorderStyle) {\n  RCTBorderStyleUnset = 0,\n  RCTBorderStyleSolid,\n  RCTBorderStyleDotted,\n  RCTBorderStyleDashed,\n};\n"
  },
  {
    "path": "React/Views/RCTButton.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTComponent.h>\n\n@interface RCTButton : NSButton\n\n@property (nonatomic, copy) RCTBubblingEventBlock onPress;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTButton.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTButton.h\"\n#import \"RCTUtils.h\"\n#import \"NSView+React.h\"\n\n@implementation RCTButton\n\n#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if ((self = [super initWithFrame:frame])) {\n    [self setTarget:self];\n    [self setAction:@selector(onPressHandler:)];\n    [self setAllowsMixedState:NO];\n\n  }\n  return self;\n}\n\n#endif\n\n-(BOOL)allowsVibrancy\n{\n  return NO;\n}\n\n-(void)onPressHandler:(__unused NSEvent *)theEvent\n{\n  if (_onPress) {\n    _onPress(@{@\"state\": @(self.state)});\n  }\n}\n\n- (void)reactSetFrame:(CGRect)frame\n{\n  [self setFrame:frame];\n}\n\n- (void)setBackgroundColor:(NSColor *)backgroundColor\n{\n  self.layer.backgroundColor = backgroundColor.CGColor;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n@end\n"
  },
  {
    "path": "React/Views/RCTButtonManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTButtonManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTButtonManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTButtonManager.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTButton.h\"\n#import \"RCTFont.h\"\n\n@implementation RCTConvert(RCTButton)\n\n\nRCT_ENUM_CONVERTER(NSButtonType, (@{\n                                    @\"momentaryLight\": @(NSMomentaryLightButton),\n                                    @\"push\": @(NSPushOnPushOffButton),\n                                    @\"toggle\": @(NSToggleButton),\n                                    @\"switch\": @(NSSwitchButton),\n                                    @\"radio\": @(NSRadioButton),\n                                    @\"momentaryChange\": @(NSMomentaryChangeButton),\n                                    @\"onOff\": @(NSOnOffButton),\n                                    @\"momentaryPushInButton\": @(NSMomentaryPushInButton),\n                                    @\"accelerator\": @(NSAcceleratorButton),\n                                    @\"multiLevelAccelerator\": @(NSMultiLevelAcceleratorButton),\n                                    }), NSMomentaryLightButton, integerValue)\n\nRCT_ENUM_CONVERTER(NSBezelStyle, (@{\n                                    @\"rounded\": @(NSRoundedBezelStyle),\n                                    @\"regularSquare\": @(NSRegularSquareBezelStyle),\n                                    @\"thickSquare\": @(NSThickSquareBezelStyle),\n                                    @\"thickerSquare\": @(NSThickerSquareBezelStyle),\n                                    @\"disclosure\": @(NSDisclosureBezelStyle),\n                                    @\"shadowlessSquare\": @(NSShadowlessSquareBezelStyle),\n                                    @\"circular\": @(NSCircularBezelStyle),\n                                    @\"texturedSquare\": @(NSTexturedSquareBezelStyle),\n                                    @\"helpButton\": @(NSHelpButtonBezelStyle),\n                                    @\"smallSquare\": @(NSSmallSquareBezelStyle),\n                                    @\"texturedRounded\": @(NSTexturedRoundedBezelStyle),\n                                    @\"roundRect\": @(NSRoundRectBezelStyle),\n                                    @\"recessed\": @(NSRecessedBezelStyle),\n                                    @\"roundedDisclosure\": @(NSRoundedDisclosureBezelStyle),\n                                    @\"inline\": @(NSInlineBezelStyle),\n                                    }), NSRoundedBezelStyle, integerValue)\n\n@end\n\n@implementation RCTButtonManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  if ([NSButton methodSignatureForSelector: @selector(buttonWithTitle:target:action:)]) {\n    RCTButton *button = [RCTButton buttonWithTitle:@\"Button\" target:nil action:nil];\n    [button setTarget:button];\n    [button setAction:@selector(onPressHandler:)];\n    return button;\n  } else {\n    return [RCTButton new];\n  }\n\n}\n\nRCT_EXPORT_VIEW_PROPERTY(title, NSString)\nRCT_EXPORT_VIEW_PROPERTY(alternateTitle, NSString)\nRCT_EXPORT_VIEW_PROPERTY(toolTip, NSString)\nRCT_EXPORT_VIEW_PROPERTY(bezelStyle, NSBezelStyle)\nRCT_EXPORT_VIEW_PROPERTY(image, NSImage)\nRCT_EXPORT_VIEW_PROPERTY(alternateImage, NSImage)\nRCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(allowsMixedState, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(state, NSInteger)\nRCT_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, RCTButton)\n{\n  view.font = [RCTFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)];\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused RCTButton)\n{\n  view.font = [RCTFont updateFont:view.font withWeight:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused RCTButton)\n{\n  view.font = [RCTFont updateFont:view.font withStyle:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, RCTButton)\n{\n  view.font = [RCTFont updateFont:view.font withFamily:json ?: defaultView.font.familyName];\n}\n\nRCT_CUSTOM_VIEW_PROPERTY(type, NSButtonType, __unused NSButton)\n{\n  if (json) {\n    [view setButtonType:[RCTConvert NSButtonType:json]];\n  }\n}\n\nRCT_CUSTOM_VIEW_PROPERTY(systemImage, NSString, __unused NSButton)\n{\n  if (json) {\n    [view setImage:[NSImage imageNamed:json]];\n  }\n}\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES;\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  NSButton *view = (NSButton *)[self view];\n  if (view.intrinsicContentSize.width > 0) {\n    return @{\n             @\"ComponentHeight\": @(view.intrinsicContentSize.height),\n             @\"ComponentWidth\": @(view.intrinsicContentSize.width)\n             };\n  } else {\n    return @{\n             @\"ComponentHeight\": @(view.frame.size.height),\n             @\"ComponentWidth\": @(view.frame.size.width)\n             };\n    \n  }\n\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTComponent.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n//#import <CoreGraphics/CoreGraphics.h>\n\n#import <Foundation/Foundation.h>\n\n/**\n * These block types can be used for mapping input event handlers from JS to view\n * properties. Unlike JS method callbacks, these can be called multiple times.\n */\ntypedef void (^RCTDirectEventBlock)(NSDictionary *body);\ntypedef void (^RCTBubblingEventBlock)(NSDictionary *body);\n\n/**\n * Logical node in a tree of application components. Both `ShadowView` and\n * `UIView` conforms to this. Allows us to write utilities that reason about\n * trees generally.\n */\n@protocol RCTComponent <NSObject>\n\n@property (nonatomic, copy) NSNumber *reactTag;\n\n- (void)insertReactSubview:(id<RCTComponent>)subview atIndex:(NSInteger)atIndex;\n- (void)removeReactSubview:(id<RCTComponent>)subview;\n- (NSArray<id<RCTComponent>> *)reactSubviews;\n- (id<RCTComponent>)reactSuperview;\n- (NSNumber *)reactTagAtPoint:(CGPoint)point;\n\n// View/ShadowView is a root view\n- (BOOL)isReactRootView;\n\n/**\n * Called each time props have been set.\n * Not all props have to be set - React can set only changed ones.\n * @param changedProps String names of all set props.\n */\n- (void)didSetProps:(NSArray<NSString *> *)changedProps;\n\n/**\n * Called each time subviews have been updated\n */\n- (void)didUpdateReactSubviews;\n\n@end\n\n// TODO: this is kinda dumb - let's come up with a\n// better way of identifying root React views please!\nstatic inline BOOL RCTIsReactRootView(NSNumber *reactTag)\n{\n  return reactTag.integerValue % 10 == 1;\n}\n"
  },
  {
    "path": "React/Views/RCTComponentData.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTComponent.h>\n#import <React/RCTDefines.h>\n#import <React/RCTViewManager.h>\n\n@class RCTBridge;\n@class RCTShadowView;\n@class RCTViewManager;\n@class NSView;\n\n@interface RCTComponentData : NSObject\n\n@property (nonatomic, readonly) Class managerClass;\n@property (nonatomic, copy, readonly) NSString *name;\n@property (nonatomic, weak, readonly) RCTViewManager *manager;\n\n- (instancetype)initWithManagerClass:(Class)managerClass\n                              bridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;\n\n- (NSView *)createViewWithTag:(NSNumber *)tag;\n- (RCTShadowView *)createShadowViewWithTag:(NSNumber *)tag;\n- (void)setProps:(NSDictionary<NSString *, id> *)props forView:(id<RCTComponent>)view;\n- (void)setProps:(NSDictionary<NSString *, id> *)props forShadowView:(RCTShadowView *)shadowView;\n\n- (NSDictionary<NSString *, id> *)viewConfig;\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary<NSNumber *, RCTShadowView *> *)registry;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTComponentData.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTComponentData.h\"\n\n#import <objc/message.h>\n\n#import \"RCTBridge.h\"\n#import \"RCTBridgeModule.h\"\n#import \"RCTConvert.h\"\n#import \"RCTParserUtils.h\"\n#import \"RCTShadowView.h\"\n#import \"RCTUtils.h\"\n#import \"RCTViewManager.h\"\n#import \"UIImageUtils.h\"\n#import \"NSView+React.h\"\n\n\ntypedef void (^RCTPropBlock)(id<RCTComponent> view, id json);\ntypedef NSMutableDictionary<NSString *, RCTPropBlock> RCTPropBlockDictionary;\n\n/**\n * Get the converter function for the specified type\n */\nstatic SEL selectorForType(NSString *type)\n{\n  const char *input = type.UTF8String;\n  return NSSelectorFromString([RCTParseType(&input) stringByAppendingString:@\":\"]);\n}\n\n\n@implementation RCTComponentData\n{\n  id<RCTComponent> _defaultView; // Only needed for RCT_CUSTOM_VIEW_PROPERTY\n  RCTPropBlockDictionary *_viewPropBlocks;\n  RCTPropBlockDictionary *_shadowPropBlocks;\n  BOOL _implementsUIBlockToAmendWithShadowViewRegistry;\n  __weak RCTBridge *_bridge;\n}\n\n@synthesize manager = _manager;\n\n- (instancetype)initWithManagerClass:(Class)managerClass\n                              bridge:(RCTBridge *)bridge\n{\n  if ((self = [super init])) {\n    _bridge = bridge;\n    _managerClass = managerClass;\n    _viewPropBlocks = [NSMutableDictionary new];\n    _shadowPropBlocks = [NSMutableDictionary new];\n\n    _name = moduleNameForClass(managerClass);\n\n    _implementsUIBlockToAmendWithShadowViewRegistry = NO;\n    Class cls = _managerClass;\n    while (cls != [RCTViewManager class]) {\n      _implementsUIBlockToAmendWithShadowViewRegistry = _implementsUIBlockToAmendWithShadowViewRegistry ||\n      RCTClassOverridesInstanceMethod(cls, @selector(uiBlockToAmendWithShadowViewRegistry:));\n      cls = [cls superclass];\n    }\n  }\n  return self;\n}\n\n- (RCTViewManager *)manager\n{\n  if (!_manager) {\n    _manager = [_bridge moduleForClass:_managerClass];\n  }\n  return _manager;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n- (NSView *)createViewWithTag:(NSNumber *)tag\n{\n  RCTAssertMainQueue();\n\n  NSView *view = [self.manager view];\n  view.reactTag = tag;\n  return view;\n}\n\n- (RCTShadowView *)createShadowViewWithTag:(NSNumber *)tag\n{\n  RCTShadowView *shadowView = [self.manager shadowView];\n  shadowView.reactTag = tag;\n  shadowView.viewName = _name;\n  return shadowView;\n}\n\n- (void)callCustomSetter:(SEL)setter onView:(id<RCTComponent>)view withProp:(id)json isShadowView:(BOOL)isShadowView\n{\n  json = RCTNilIfNull(json);\n  if (!isShadowView) {\n    if (!json && !_defaultView) {\n      // Only create default view if json is null\n      _defaultView = [self createViewWithTag:nil];\n    }\n    ((void (*)(id, SEL, id, id, id))objc_msgSend)(self.manager, setter, json, view, _defaultView);\n  } else {\n    ((void (*)(id, SEL, id, id))objc_msgSend)(self.manager, setter, json, view);\n  }\n}\n\nstatic RCTPropBlock createEventSetter(NSString *propName, SEL setter, RCTBridge *bridge)\n{\n  __weak RCTBridge *weakBridge = bridge;\n  return ^(id target, id json) {\n    void (^eventHandler)(NSDictionary *event) = nil;\n    if ([RCTConvert BOOL:json]) {\n      __weak id<RCTComponent> weakTarget = target;\n      eventHandler = ^(NSDictionary *event) {\n        // The component no longer exists, we shouldn't send the event\n        id<RCTComponent> strongTarget = weakTarget;\n        if (!strongTarget) {\n          return;\n        }\n\n        NSMutableDictionary *mutableEvent = [NSMutableDictionary dictionaryWithDictionary:event];\n        mutableEvent[@\"target\"] = strongTarget.reactTag;\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n        [weakBridge.eventDispatcher sendInputEventWithName:RCTNormalizeInputEventName(propName) body:mutableEvent];\n#pragma clang diagnostic pop\n      };\n    }\n    ((void (*)(id, SEL, id))objc_msgSend)(target, setter, eventHandler);\n  };\n}\n\nstatic RCTPropBlock createNSInvocationSetter(NSMethodSignature *typeSignature, SEL type, SEL getter, SEL setter)\n{\n  NSInvocation *typeInvocation = [NSInvocation invocationWithMethodSignature:typeSignature];\n  typeInvocation.selector = type;\n  typeInvocation.target = [RCTConvert class];\n\n  __block NSInvocation *targetInvocation = nil;\n  __block NSMutableData *defaultValue = nil;\n\n  return ^(id target, id json) {\n    if (!target) {\n      return;\n    }\n\n    // Get default value\n    if (!defaultValue) {\n      if (!json) {\n        // We only set the defaultValue when we first pass a non-null\n        // value, so if the first value sent for a prop is null, it's\n        // a no-op (we'd be resetting it to its default when its\n        // value is already the default).\n        return;\n      }\n      // Use NSMutableData to store defaultValue instead of malloc, so\n      // it will be freed automatically when setterBlock is released.\n      defaultValue = [[NSMutableData alloc] initWithLength:typeSignature.methodReturnLength];\n      if ([target respondsToSelector:getter]) {\n        NSMethodSignature *signature = [target methodSignatureForSelector:getter];\n        NSInvocation *sourceInvocation = [NSInvocation invocationWithMethodSignature:signature];\n        sourceInvocation.selector = getter;\n        [sourceInvocation invokeWithTarget:target];\n        [sourceInvocation getReturnValue:defaultValue.mutableBytes];\n      }\n    }\n\n    // Get value\n    BOOL freeValueOnCompletion = NO;\n    void *value = defaultValue.mutableBytes;\n    if (json) {\n      freeValueOnCompletion = YES;\n      value = malloc(typeSignature.methodReturnLength);\n      [typeInvocation setArgument:&json atIndex:2];\n      [typeInvocation invoke];\n      [typeInvocation getReturnValue:value];\n    }\n\n    // Set value\n    if (!targetInvocation) {\n      NSMethodSignature *signature = [target methodSignatureForSelector:setter];\n      targetInvocation = [NSInvocation invocationWithMethodSignature:signature];\n      targetInvocation.selector = setter;\n    }\n    [targetInvocation setArgument:value atIndex:2];\n    [targetInvocation invokeWithTarget:target];\n    if (freeValueOnCompletion) {\n      // Only free the value if we `malloc`d it locally, otherwise it\n      // points to `defaultValue.mutableBytes`, which is managed by ARC.\n      free(value);\n    }\n  };\n}\n\n- (RCTPropBlock)createPropBlock:(NSString *)name isShadowView:(BOOL)isShadowView\n{\n  // Get type\n  SEL type = NULL;\n  NSString *keyPath = nil;\n  SEL selector = NSSelectorFromString([NSString stringWithFormat:@\"propConfig%@_%@\", isShadowView ? @\"Shadow\" : @\"\", name]);\n  if ([_managerClass respondsToSelector:selector]) {\n    NSArray<NSString *> *typeAndKeyPath = ((NSArray<NSString *> *(*)(id, SEL))objc_msgSend)(_managerClass, selector);\n    type = selectorForType(typeAndKeyPath[0]);\n    keyPath = typeAndKeyPath.count > 1 ? typeAndKeyPath[1] : nil;\n  } else {\n    return ^(__unused id view, __unused id json) {};\n  }\n\n  // Check for custom setter\n  if ([keyPath isEqualToString:@\"__custom__\"]) {\n    // Get custom setter. There is no default view in the shadow case, so the selector is different.\n    NSString *selectorString;\n    if (!isShadowView) {\n      selectorString = [NSString stringWithFormat:@\"set_%@:for%@View:withDefaultView:\", name, isShadowView ? @\"Shadow\" : @\"\"];\n    } else {\n      selectorString = [NSString stringWithFormat:@\"set_%@:forShadowView:\", name];\n    }\n\n    SEL customSetter = NSSelectorFromString(selectorString);\n    __weak RCTComponentData *weakSelf = self;\n    return ^(id<RCTComponent> view, id json) {\n      [weakSelf callCustomSetter:customSetter onView:view withProp:json isShadowView:isShadowView];\n    };\n  } else {\n    // Disect keypath\n    NSString *key = name;\n    NSArray<NSString *> *parts = [keyPath componentsSeparatedByString:@\".\"];\n    if (parts) {\n      key = parts.lastObject;\n      parts = [parts subarrayWithRange:(NSRange){0, parts.count - 1}];\n    }\n\n    // Get property getter\n    SEL getter = NSSelectorFromString(key);\n\n    // Get property setter\n    SEL setter = NSSelectorFromString([NSString stringWithFormat:@\"set%@%@:\",\n                                       [key substringToIndex:1].uppercaseString,\n                                       [key substringFromIndex:1]]);\n\n    // Build setter block\n    void (^setterBlock)(id target, id json) = nil;\n    if (type == NSSelectorFromString(@\"RCTBubblingEventBlock:\") ||\n        type == NSSelectorFromString(@\"RCTDirectEventBlock:\")) {\n      // Special case for event handlers\n      setterBlock = createEventSetter(name, setter, _bridge);\n    } else {\n      // Ordinary property handlers\n      NSMethodSignature *typeSignature = [[RCTConvert class] methodSignatureForSelector:type];\n      if (!typeSignature) {\n        RCTLogError(@\"No +[RCTConvert %@] function found.\", NSStringFromSelector(type));\n        return ^(__unused id<RCTComponent> view, __unused id json){};\n      }\n      switch (typeSignature.methodReturnType[0]) {\n\n#define RCT_CASE(_value, _type)                                       \\\n  case _value: {                                                      \\\n    __block BOOL setDefaultValue = NO;                                \\\n    __block _type defaultValue;                                       \\\n    _type (*convert)(id, SEL, id) = (typeof(convert))objc_msgSend;    \\\n    _type (*get)(id, SEL) = (typeof(get))objc_msgSend;                \\\n    void (*set)(id, SEL, _type) = (typeof(set))objc_msgSend;          \\\n    setterBlock = ^(id target, id json) {                             \\\n      if (json) {                                                     \\\n        if (!setDefaultValue && target) {                             \\\n          if ([target respondsToSelector:getter]) {                   \\\n            defaultValue = get(target, getter);                       \\\n          }                                                           \\\n          setDefaultValue = YES;                                      \\\n        }                                                             \\\n        set(target, setter, convert([RCTConvert class], type, json)); \\\n      } else if (setDefaultValue) {                                   \\\n        set(target, setter, defaultValue);                            \\\n      }                                                               \\\n    };                                                                \\\n    break;                                                            \\\n  }\n\n        RCT_CASE(_C_SEL, SEL)\n        RCT_CASE(_C_CHARPTR, const char *)\n        RCT_CASE(_C_CHR, char)\n        RCT_CASE(_C_UCHR, unsigned char)\n        RCT_CASE(_C_SHT, short)\n        RCT_CASE(_C_USHT, unsigned short)\n        RCT_CASE(_C_INT, int)\n        RCT_CASE(_C_UINT, unsigned int)\n        RCT_CASE(_C_LNG, long)\n        RCT_CASE(_C_ULNG, unsigned long)\n        RCT_CASE(_C_LNG_LNG, long long)\n        RCT_CASE(_C_ULNG_LNG, unsigned long long)\n        RCT_CASE(_C_FLT, float)\n        RCT_CASE(_C_DBL, double)\n        RCT_CASE(_C_BOOL, BOOL)\n        RCT_CASE(_C_PTR, void *)\n        RCT_CASE(_C_ID, id)\n\n        case _C_STRUCT_B:\n        default: {\n          setterBlock = createNSInvocationSetter(typeSignature, type, getter, setter);\n          break;\n        }\n      }\n    }\n\n    return ^(__unused id view, __unused id json) {\n      // Follow keypath\n      id target = view;\n      for (NSString *part in parts) {\n        target = [target valueForKey:part];\n      }\n\n      // Set property with json\n      setterBlock(target, RCTNilIfNull(json));\n    };\n  }\n}\n\n- (RCTPropBlock)propBlockForKey:(NSString *)name isShadowView:(BOOL)isShadowView\n{\n  RCTPropBlockDictionary *propBlocks = isShadowView ? _shadowPropBlocks : _viewPropBlocks;\n  RCTPropBlock propBlock = propBlocks[name];\n  if (!propBlock) {\n    propBlock = [self createPropBlock:name isShadowView:isShadowView];\n\n#if RCT_DEBUG\n    // Provide more useful log feedback if there's an error\n    RCTPropBlock unwrappedBlock = propBlock;\n    __weak __typeof(self) weakSelf = self;\n    propBlock = ^(id<RCTComponent> view, id json) {\n      NSString *logPrefix = [NSString stringWithFormat:@\"Error setting property '%@' of %@ with tag #%@: \",\n                             name, weakSelf.name, view.reactTag];\n      RCTPerformBlockWithLogPrefix(^{\n        unwrappedBlock(view, json);\n      }, logPrefix);\n    };\n#endif\n    propBlocks[name] = [propBlock copy];\n  }\n  return propBlock;\n}\n\n- (void)setProps:(NSDictionary<NSString *, id> *)props forView:(id<RCTComponent>)view\n{\n  if (!view) {\n    return;\n  }\n\n  if (!_defaultView) {\n    _defaultView = [self createViewWithTag:nil];\n  }\n\n  [props enumerateKeysAndObjectsUsingBlock:^(NSString *key, id json, __unused BOOL *stop) {\n    [self propBlockForKey:key isShadowView:NO](view, json);\n  }];\n}\n\n- (void)setProps:(NSDictionary<NSString *, id> *)props forShadowView:(RCTShadowView *)shadowView\n{\n  if (!shadowView) {\n    return;\n  }\n\n  [props enumerateKeysAndObjectsUsingBlock:^(NSString *key, id json, __unused BOOL *stop) {\n    [self propBlockForKey:key isShadowView:YES](shadowView, json);\n  }];\n}\n\n- (NSDictionary<NSString *, id> *)viewConfig\n{\n  NSMutableArray<NSString *> *bubblingEvents = [NSMutableArray new];\n  NSMutableArray<NSString *> *directEvents = [NSMutableArray new];\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n  if (RCTClassOverridesInstanceMethod(_managerClass, @selector(customBubblingEventTypes))) {\n    NSArray<NSString *> *events = [self.manager customBubblingEventTypes];\n    for (NSString *event in events) {\n      [bubblingEvents addObject:RCTNormalizeInputEventName(event)];\n    }\n  }\n#pragma clang diagnostic pop\n\n  unsigned int count = 0;\n  NSMutableDictionary *propTypes = [NSMutableDictionary new];\n  Method *methods = class_copyMethodList(object_getClass(_managerClass), &count);\n  for (unsigned int i = 0; i < count; i++) {\n    SEL selector = method_getName(methods[i]);\n    const char *selectorName = sel_getName(selector);\n    if (strncmp(selectorName, \"propConfig\", strlen(\"propConfig\")) != 0) {\n      continue;\n    }\n\n    // We need to handle both propConfig_* and propConfigShadow_* methods\n    const char *underscorePos = strchr(selectorName + strlen(\"propConfig\"), '_');\n    if (!underscorePos) {\n      continue;\n    }\n\n    NSString *name = @(underscorePos + 1);\n    NSString *type = ((NSArray<NSString *> *(*)(id, SEL))objc_msgSend)(_managerClass, selector)[0];\n    if (RCT_DEBUG && propTypes[name] && ![propTypes[name] isEqualToString:type]) {\n      RCTLogError(@\"Property '%@' of component '%@' redefined from '%@' \"\n                  \"to '%@'\", name, _name, propTypes[name], type);\n    }\n\n    if ([type isEqualToString:@\"RCTBubblingEventBlock\"]) {\n      [bubblingEvents addObject:RCTNormalizeInputEventName(name)];\n      propTypes[name] = @\"BOOL\";\n    } else if ([type isEqualToString:@\"RCTDirectEventBlock\"]) {\n      [directEvents addObject:RCTNormalizeInputEventName(name)];\n      propTypes[name] = @\"BOOL\";\n    } else {\n      propTypes[name] = type;\n    }\n  }\n  free(methods);\n\n#if RCT_DEBUG\n  for (NSString *event in bubblingEvents) {\n    if ([directEvents containsObject:event]) {\n      RCTLogError(@\"Component '%@' registered '%@' as both a bubbling event \"\n                  \"and a direct event\", _name, event);\n    }\n  }\n#endif\n  \n  Class superClass = [_managerClass superclass];\n  \n  return @{\n    @\"propTypes\": propTypes,\n    @\"directEvents\": directEvents,\n    @\"bubblingEvents\": bubblingEvents,\n    @\"baseModuleName\": superClass == [NSObject class] ? (id)kCFNull : moduleNameForClass(superClass),\n  };\n}\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary<NSNumber *, RCTShadowView *> *)registry\n{\n  if (_implementsUIBlockToAmendWithShadowViewRegistry) {\n    return [[self manager] uiBlockToAmendWithShadowViewRegistry:registry];\n  }\n  return nil;\n}\n\nstatic NSString *moduleNameForClass(Class managerClass)\n{\n  // Hackety hack, this partially re-implements RCTBridgeModuleNameForClass\n  // We want to get rid of RCT and RK prefixes, but a lot of JS code still references\n  // view names by prefix. So, while RCTBridgeModuleNameForClass now drops these\n  // prefixes by default, we'll still keep them around here.\n  NSString *name = [managerClass moduleName];\n  if (name.length == 0) {\n    name = NSStringFromClass(managerClass);\n  }\n  if ([name hasPrefix:@\"RK\"]) {\n    name = [name stringByReplacingCharactersInRange:(NSRange){0, @\"RK\".length} withString:@\"RCT\"];\n  }\n  if ([name hasSuffix:@\"Manager\"]) {\n    name = [name substringToIndex:name.length - @\"Manager\".length];\n  }\n  \n  RCTAssert(name.length, @\"Invalid moduleName '%@'\", name);\n  \n  return name;\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTConvert+CoreLocation.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <CoreLocation/CoreLocation.h>\n\n#import <React/RCTConvert.h>\n\n@interface RCTConvert (CoreLocation)\n\n+ (CLLocationDegrees)CLLocationDegrees:(id)json;\n+ (CLLocationDistance)CLLocationDistance:(id)json;\n+ (CLLocationCoordinate2D)CLLocationCoordinate2D:(id)json;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTConvert+CoreLocation.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTConvert+CoreLocation.h\"\n\n@implementation RCTConvert(CoreLocation)\n\nRCT_CONVERTER(CLLocationDegrees, CLLocationDegrees, doubleValue);\nRCT_CONVERTER(CLLocationDistance, CLLocationDistance, doubleValue);\n\n+ (CLLocationCoordinate2D)CLLocationCoordinate2D:(id)json\n{\n  json = [self NSDictionary:json];\n  return (CLLocationCoordinate2D){\n    [self CLLocationDegrees:json[@\"latitude\"]],\n    [self CLLocationDegrees:json[@\"longitude\"]]\n  };\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTConvert+Transform.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTConvert.h\"\n\n@interface RCTConvert (Transform)\n\n+ (CATransform3D)CATransform3D:(id)json;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTConvert+Transform.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTConvert+Transform.h\"\n\nstatic const NSUInteger kMatrixArrayLength = 4 * 4;\n\n@implementation RCTConvert (Transform)\n\n+ (CGFloat)convertToRadians:(id)json\n{\n  if ([json isKindOfClass:[NSString class]]) {\n    NSString *stringValue = (NSString *)json;\n    if ([stringValue hasSuffix:@\"deg\"]) {\n      CGFloat degrees = [[stringValue substringToIndex:stringValue.length - 3] floatValue];\n      return degrees * M_PI / 180;\n    }\n    if ([stringValue hasSuffix:@\"rad\"]) {\n      return [[stringValue substringToIndex:stringValue.length - 3] floatValue];\n    }\n  }\n  return [json floatValue];\n}\n\n+ (CATransform3D)CATransform3DFromMatrix:(id)json\n{\n  CATransform3D transform = CATransform3DIdentity;\n  if (!json) {\n    return transform;\n  }\n  if (![json isKindOfClass:[NSArray class]]) {\n    RCTLogConvertError(json, @\"a CATransform3D. Expected array for transform matrix.\");\n    return transform;\n  }\n  if ([json count] != kMatrixArrayLength) {\n    RCTLogConvertError(json, @\"a CATransform3D. Expected 4x4 matrix array.\");\n    return transform;\n  }\n  for (NSUInteger i = 0; i < kMatrixArrayLength; i++) {\n    ((CGFloat *)&transform)[i] = [RCTConvert CGFloat:json[i]];\n  }\n  return transform;\n}\n\n+ (CATransform3D)CATransform3D:(id)json\n{\n  CATransform3D transform = CATransform3DIdentity;\n  if (!json) {\n    return transform;\n  }\n  if (![json isKindOfClass:[NSArray class]]) {\n    RCTLogConvertError(json, @\"a CATransform3D. Did you pass something other than an array?\");\n    return transform;\n  }\n  // legacy matrix support\n  if ([(NSArray *)json count] == kMatrixArrayLength && [json[0] isKindOfClass:[NSNumber class]]) {\n    RCTLogWarn(@\"[RCTConvert CATransform3D:] has deprecated a matrix as input. Pass an array of configs (which can contain a matrix key) instead.\");\n    return [self CATransform3DFromMatrix:json];\n  }\n\n  CGFloat zeroScaleThreshold = FLT_EPSILON;\n\n  for (NSDictionary *transformConfig in (NSArray<NSDictionary *> *)json) {\n    if (transformConfig.count != 1) {\n      RCTLogConvertError(json, @\"a CATransform3D. You must specify exactly one property per transform object.\");\n      return transform;\n    }\n    NSString *property = transformConfig.allKeys[0];\n    id value = transformConfig[property];\n\n    if ([property isEqualToString:@\"matrix\"]) {\n      transform = [self CATransform3DFromMatrix:value];\n\n    } else if ([property isEqualToString:@\"perspective\"]) {\n      transform.m34 = -1 / [value floatValue];\n\n    } else if ([property isEqualToString:@\"rotateX\"]) {\n      CGFloat rotate = [self convertToRadians:value];\n      transform = CATransform3DRotate(transform, rotate, 1, 0, 0);\n\n    } else if ([property isEqualToString:@\"rotateY\"]) {\n      CGFloat rotate = [self convertToRadians:value];\n      transform = CATransform3DRotate(transform, rotate, 0, 1, 0);\n\n    } else if ([property isEqualToString:@\"rotate\"] || [property isEqualToString:@\"rotateZ\"]) {\n      CGFloat rotate = [self convertToRadians:value];\n      transform = CATransform3DRotate(transform, rotate, 0, 0, 1);\n\n    } else if ([property isEqualToString:@\"scale\"]) {\n      CGFloat scale = [value floatValue];\n      scale = ABS(scale) < zeroScaleThreshold ? zeroScaleThreshold : scale;\n      transform = CATransform3DScale(transform, scale, scale, 1);\n\n    } else if ([property isEqualToString:@\"scaleX\"]) {\n      CGFloat scale = [value floatValue];\n      scale = ABS(scale) < zeroScaleThreshold ? zeroScaleThreshold : scale;\n      transform = CATransform3DScale(transform, scale, 1, 1);\n\n    } else if ([property isEqualToString:@\"scaleY\"]) {\n      CGFloat scale = [value floatValue];\n      scale = ABS(scale) < zeroScaleThreshold ? zeroScaleThreshold : scale;\n      transform = CATransform3DScale(transform, 1, scale, 1);\n\n    } else if ([property isEqualToString:@\"translate\"]) {\n      NSArray *array = (NSArray<NSNumber *> *)value;\n      CGFloat translateX = [array[0] floatValue];\n      CGFloat translateY = [array[1] floatValue];\n      CGFloat translateZ = array.count > 2 ? [array[2] floatValue] : 0;\n      transform = CATransform3DTranslate(transform, translateX, translateY, translateZ);\n\n    } else if ([property isEqualToString:@\"translateX\"]) {\n      CGFloat translate = [value floatValue];\n      transform = CATransform3DTranslate(transform, translate, 0, 0);\n\n    } else if ([property isEqualToString:@\"translateY\"]) {\n      CGFloat translate = [value floatValue];\n      transform = CATransform3DTranslate(transform, 0, translate, 0);\n\n    } else if ([property isEqualToString:@\"skewX\"]) {\n      CGFloat skew = [self convertToRadians:value];\n      transform.m21 = tanf(skew);\n\n    } else if ([property isEqualToString:@\"skewY\"]) {\n      CGFloat skew = [self convertToRadians:value];\n      transform.m12 = tanf(skew);\n\n    } else {\n      RCTLogError(@\"Unsupported transform type for a CATransform3D: %@.\", property);\n    }\n  }\n  return transform;\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTDatePicker.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@interface RCTDatePicker : NSDatePicker\n\n@end\n"
  },
  {
    "path": "React/Views/RCTDatePicker.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDatePicker.h\"\n\n#import \"RCTUtils.h\"\n#import \"NSView+React.h\"\n\n@interface RCTDatePicker ()\n\n@property (nonatomic, copy) RCTBubblingEventBlock onChange;\n\n@end\n\n@implementation RCTDatePicker\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if ((self = [super initWithFrame:frame])) {\n    [self setTarget:self];\n    [self setAction:@selector(didChange:)];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (void)didChange:(__unused id)sender\n{\n  if (_onChange) {\n    _onChange(@{\n      @\"timestamp\": @(self.dateValue.timeIntervalSince1970 * 1000.0),\n      @\"timeInterval\": @(self.timeInterval)\n    });\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTDatePickerManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTConvert.h>\n#import <React/RCTViewManager.h>\n\n@interface RCTConvert(NSDatePicker)\n\n+ (NSDatePickerMode)NSDatePickerMode:(id)json;\n\n@end\n\n@interface RCTDatePickerManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTDatePickerManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTDatePickerManager.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTDatePicker.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"NSView+React.h\"\n\n@implementation RCTConvert(NSDatePicker)\n\nRCT_ENUM_CONVERTER(NSDatePickerMode, (@{\n  @\"single\": @(NSSingleDateMode),\n  @\"range\": @(NSRangeDateMode),\n}), NSSingleDateMode, integerValue)\n\nRCT_ENUM_CONVERTER(NSDatePickerStyle, (@{\n  @\"textField\": @(NSTextFieldDatePickerStyle),\n  @\"clockAndCalendar\": @(NSClockAndCalendarDatePickerStyle),\n  @\"textFieldAndStepper\": @(NSTextFieldAndStepperDatePickerStyle),\n}), NSTextFieldAndStepperDatePickerStyle, integerValue)\n\n@end\n\n@implementation RCTDatePickerManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  return [RCTDatePicker new];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(date, NSDate)\nRCT_EXPORT_VIEW_PROPERTY(locale, NSLocale)\nRCT_EXPORT_VIEW_PROPERTY(minimumDate, NSDate)\nRCT_EXPORT_VIEW_PROPERTY(maximumDate, NSDate)\nRCT_EXPORT_VIEW_PROPERTY(minuteInterval, NSInteger)\nRCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(datePickerStyle, NSDatePickerStyle)\nRCT_EXPORT_VIEW_PROPERTY(datePickerMode, NSDatePickerMode)\nRCT_REMAP_VIEW_PROPERTY(timeZoneOffsetInMinutes, timeZone, NSTimeZone)\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES;\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  NSDatePicker *view = [NSDatePicker new];\n  return @{\n    @\"ComponentHeight\": @(view.intrinsicContentSize.height),\n    @\"ComponentWidth\": @(view.intrinsicContentSize.width),\n  };\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTFont.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import <React/RCTConvert.h>\n\n@interface RCTFont : NSObject\n\n/**\n * Update a font with a given font-family, size, weight and style.\n * If parameters are not specified, they'll be kept as-is.\n * If font is nil, the default system font of size 14 will be used.\n */\n+ (NSFont *)updateFont:(NSFont *)font\n            withFamily:(NSString *)family\n                  size:(NSNumber *)size\n                weight:(NSString *)weight\n                 style:(NSString *)style\n               variant:(NSArray<NSString *> *)variant\n       scaleMultiplier:(CGFloat)scaleMultiplier;\n\n+ (NSFont *)updateFont:(NSFont *)font withFamily:(NSString *)family;\n+ (NSFont *)updateFont:(NSFont *)font withSize:(NSNumber *)size;\n+ (NSFont *)updateFont:(NSFont *)font withWeight:(NSString *)weight;\n+ (NSFont *)updateFont:(NSFont *)font withStyle:(NSString *)style;\n\n@end\n\n@interface RCTConvert (RCTFont)\n\n+ (NSFont *)NSFont:(id)json;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTFont.mm",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTFont.h\"\n#import \"RCTLog.h\"\n\n#import <CoreText/CoreText.h>\n\n#import <mutex>\n\n#define NSFontWeightUltraLight -0.8\n#define NSFontWeightThin -0.6\n#define NSFontWeightLight -0.4\n#define NSFontWeightRegular 0\n#define NSFontWeightMedium 0.23\n#define NSFontWeightSemibold 0.3\n#define NSFontWeightBold 0.4\n#define NSFontWeightHeavy 0.56\n#define NSFontWeightBlack 0.62\n\ntypedef CGFloat RCTFontWeight;\nstatic RCTFontWeight weightOfFont(NSFont *font)\n{\n  static NSDictionary *nameToWeight;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    nameToWeight = @{\n       @\"normal\": @(NSFontWeightRegular),\n       @\"bold\": @(NSFontWeightBold),\n       @\"ultralight\": @(NSFontWeightUltraLight),\n       @\"thin\": @(NSFontWeightThin),\n       @\"light\": @(NSFontWeightLight),\n       @\"regular\": @(NSFontWeightRegular),\n       @\"medium\": @(NSFontWeightMedium),\n       @\"semibold\": @(NSFontWeightSemibold),\n       @\"bold\": @(NSFontWeightBold),\n       @\"heavy\": @(NSFontWeightHeavy),\n       @\"black\": @(NSFontWeightBlack),\n    };\n  });\n\n  NSDictionary *traits = [font.fontDescriptor objectForKey:NSFontTraitsAttribute];\n  RCTFontWeight weight = [traits[NSFontWeightTrait] doubleValue];\n  if (weight == 0.0) {\n    for (NSString *name in nameToWeight) {\n      if ([font.fontName.lowercaseString hasSuffix:name]) {\n        return [nameToWeight[name] doubleValue];\n      }\n    }\n  }\n\n  return weight;\n}\n\nstatic BOOL isItalicFont(NSFont *font)\n{\n  NSDictionary *traits = [font.fontDescriptor objectForKey:NSFontTraitsAttribute];\n  NSFontSymbolicTraits symbolicTraits = [traits[NSFontSymbolicTrait] unsignedIntValue];\n  return (symbolicTraits & NSFontItalicTrait) != 0;\n}\n\nstatic BOOL isCondensedFont(NSFont *font)\n{\n  NSDictionary *traits = [font.fontDescriptor objectForKey:NSFontTraitsAttribute];\n  NSFontSymbolicTraits symbolicTraits = [traits[NSFontSymbolicTrait] unsignedIntValue];\n  return (symbolicTraits & NSFontCondensedTrait) != 0;\n}\n\nstatic NSFont *cachedSystemFont(CGFloat size, RCTFontWeight weight)\n{\n  static NSCache *fontCache;\n  static std::mutex fontCacheMutex;\n\n  NSString *cacheKey = [NSString stringWithFormat:@\"%.1f/%.2f\", size, weight];\n  NSFont *font;\n  {\n    std::lock_guard<std::mutex> lock(fontCacheMutex);\n    if (!fontCache) {\n      fontCache = [NSCache new];\n    }\n    font = [fontCache objectForKey:cacheKey];\n  }\n\n  if (!font) {\n    // Only supported on iOS8.2 and above\n    if ([NSFont respondsToSelector:@selector(systemFontOfSize:weight:)]) {\n      font = [NSFont systemFontOfSize:size weight:weight];\n    } else {\n      if (weight >= NSFontWeightBold) {\n        font = [NSFont boldSystemFontOfSize:size];\n      } else if (weight >= NSFontWeightMedium) {\n        font = [NSFont systemFontOfSize:size weight:NSFontWeightMedium];\n      } else if (weight <= NSFontWeightLight) {\n        font = [NSFont systemFontOfSize:size weight:NSFontWeightLight];\n      } else {\n        font = [NSFont systemFontOfSize:size];\n      }\n    }\n\n\n    {\n      std::lock_guard<std::mutex> lock(fontCacheMutex);\n      [fontCache setObject:font forKey:cacheKey];\n    }\n  }\n\n  return font;\n}\n\n@implementation RCTConvert (RCTFont)\n\n+ (NSFont *)NSFont:(id)json\n{\n  json = [self NSDictionary:json];\n  return [RCTFont updateFont:nil\n                  withFamily:[RCTConvert NSString:json[@\"fontFamily\"]]\n                        size:[RCTConvert NSNumber:json[@\"fontSize\"]]\n                      weight:[RCTConvert NSString:json[@\"fontWeight\"]]\n                       style:[RCTConvert NSString:json[@\"fontStyle\"]]\n                     variant:[RCTConvert NSStringArray:json[@\"fontVariant\"]]\n             scaleMultiplier:1];\n}\n\nRCT_ENUM_CONVERTER(RCTFontWeight, (@{\n                                     @\"normal\": @(NSFontWeightRegular),\n                                     @\"bold\": @(NSFontWeightBold),\n                                     @\"100\": @(NSFontWeightUltraLight),\n                                     @\"200\": @(NSFontWeightThin),\n                                     @\"300\": @(NSFontWeightLight),\n                                     @\"400\": @(NSFontWeightRegular),\n                                     @\"500\": @(NSFontWeightMedium),\n                                     @\"600\": @(NSFontWeightSemibold),\n                                     @\"700\": @(NSFontWeightBold),\n                                     @\"800\": @(NSFontWeightHeavy),\n                                     @\"900\": @(NSFontWeightBlack),\n                                     }), NSFontWeightRegular, doubleValue)\n\ntypedef BOOL RCTFontStyle;\nRCT_ENUM_CONVERTER(RCTFontStyle, (@{\n                                    @\"normal\": @NO,\n                                    @\"italic\": @YES,\n                                    @\"oblique\": @YES,\n                                    }), NO, boolValue)\n\ntypedef NSDictionary RCTFontVariantDescriptor;\n+ (RCTFontVariantDescriptor *)RCTFontVariantDescriptor:(id)json\n{\n  static NSDictionary *mapping;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    mapping = @{\n      @\"small-caps\": @{\n          NSFontFeatureTypeIdentifierKey: @(kLowerCaseType),\n          NSFontFeatureSelectorIdentifierKey: @(kLowerCaseSmallCapsSelector),\n          },\n      @\"oldstyle-nums\": @{\n          NSFontFeatureTypeIdentifierKey: @(kNumberCaseType),\n          NSFontFeatureSelectorIdentifierKey: @(kLowerCaseNumbersSelector),\n          },\n      @\"lining-nums\": @{\n          NSFontFeatureTypeIdentifierKey: @(kNumberCaseType),\n          NSFontFeatureSelectorIdentifierKey: @(kUpperCaseNumbersSelector),\n          },\n      @\"tabular-nums\": @{\n          NSFontFeatureTypeIdentifierKey: @(kNumberSpacingType),\n          NSFontFeatureSelectorIdentifierKey: @(kMonospacedNumbersSelector),\n          },\n      @\"proportional-nums\": @{\n          NSFontFeatureTypeIdentifierKey: @(kNumberSpacingType),\n          NSFontFeatureSelectorIdentifierKey: @(kProportionalNumbersSelector),\n          },\n      };\n  });\n  RCTFontVariantDescriptor *value = mapping[json];\n  if (RCT_DEBUG && !value && [json description].length > 0) {\n    RCTLogError(@\"Invalid RCTFontVariantDescriptor '%@'. should be one of: %@\", json,\n                [[mapping allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]);\n  }\n  return value;\n}\n\nRCT_ARRAY_CONVERTER(RCTFontVariantDescriptor)\n\n@end\n\n@implementation RCTFont\n\n+ (NSFont *)updateFont:(NSFont *)font\n            withFamily:(NSString *)family\n                  size:(NSNumber *)size\n                weight:(NSString *)weight\n                 style:(NSString *)style\n               variant:(NSArray<RCTFontVariantDescriptor *> *)variant\n       scaleMultiplier:(CGFloat)scaleMultiplier\n{\n  // Defaults\n  static NSString *defaultFontFamily;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    defaultFontFamily = [NSFont systemFontOfSize:14].familyName;\n  });\n  const RCTFontWeight defaultFontWeight = NSFontWeightRegular;\n  const CGFloat defaultFontSize = 14;\n\n  // Initialize properties to defaults\n  CGFloat fontSize = defaultFontSize;\n  RCTFontWeight fontWeight = defaultFontWeight;\n  NSString *familyName = defaultFontFamily;\n  BOOL isItalic = NO;\n  BOOL isCondensed = NO;\n\n  if (font) {\n    familyName = font.familyName ?: defaultFontFamily;\n    fontSize = font.pointSize ?: defaultFontSize;\n    fontWeight = weightOfFont(font);\n    isItalic = isItalicFont(font);\n    isCondensed = isCondensedFont(font);\n  }\n\n  // Get font attributes\n  fontSize = [RCTConvert CGFloat:size] ?: fontSize;\n  if (scaleMultiplier > 0.0 && scaleMultiplier != 1.0) {\n    fontSize = round(fontSize * scaleMultiplier);\n  }\n  familyName = [RCTConvert NSString:family] ?: familyName;\n  isItalic = style ? [RCTConvert RCTFontStyle:style] : isItalic;\n  fontWeight = weight ? [RCTConvert RCTFontWeight:weight] : fontWeight;\n\n  BOOL didFindFont = NO;\n\n  // Handle system font as special case. This ensures that we preserve\n  // the specific metrics of the standard system font as closely as possible.\n  if ([familyName isEqual:defaultFontFamily] || [familyName isEqualToString:@\"System\"]) {\n    font = cachedSystemFont(fontSize, fontWeight);\n    if (font) {\n      didFindFont = YES;\n\n      if (isItalic || isCondensed) {\n        NSFontDescriptor *fontDescriptor = [font fontDescriptor];\n        NSFontSymbolicTraits symbolicTraits = fontDescriptor.symbolicTraits;\n        if (isItalic) {\n          symbolicTraits |= NSFontItalicTrait;\n        }\n        if (isCondensed) {\n          symbolicTraits |= NSFontCondensedTrait;\n        }\n        fontDescriptor = [fontDescriptor fontDescriptorWithSymbolicTraits:symbolicTraits];\n        font = [NSFont fontWithDescriptor:fontDescriptor size:fontSize];\n      }\n    }\n  }\n\n  // Gracefully handle being given a font name rather than font family, for\n  // example: \"Helvetica Light Oblique\" rather than just \"Helvetica\".\n  if (!didFindFont &&\n      [[NSFontManager sharedFontManager] availableMembersOfFontFamily:familyName].count == 0) {\n    font = [NSFont fontWithName:familyName size:fontSize];\n    if (font) {\n      // It's actually a font name, not a font family name,\n      // but we'll do what was meant, not what was said.\n      familyName = font.familyName;\n      fontWeight = weight ? fontWeight : weightOfFont(font);\n      isItalic = style ? isItalic : isItalicFont(font);\n      isCondensed = isCondensedFont(font);\n    } else {\n      // Not a valid font or family\n      RCTLogError(@\"Unrecognized font family '%@'\", familyName);\n      if ([NSFont respondsToSelector:@selector(systemFontOfSize:weight:)]) {\n        font = [NSFont systemFontOfSize:fontSize weight:fontWeight];\n      } else if (fontWeight > NSFontWeightRegular) {\n        font = [NSFont boldSystemFontOfSize:fontSize];\n      } else {\n        font = [NSFont systemFontOfSize:fontSize];\n      }\n    }\n  }\n\n  // Get the closest font that matches the given weight for the fontFamily\n  if (![familyName isEqual:defaultFontFamily]) {\n    CGFloat closestWeight = INFINITY;\n    for (NSArray *fontFamily in [[NSFontManager sharedFontManager] availableMembersOfFontFamily:familyName]) {\n      NSString *name = fontFamily[0];\n      NSFont *match = [NSFont fontWithName:name size:fontSize];\n      if (isItalic == isItalicFont(match) &&\n          isCondensed == isCondensedFont(match)) {\n        CGFloat testWeight = weightOfFont(match);\n        if (ABS(testWeight - fontWeight) < ABS(closestWeight - fontWeight)) {\n          font = match;\n          closestWeight = testWeight;\n        }\n      }\n    }\n\n  }\n\n  // If we still don't have a match at least return the first font in the fontFamily\n  // This is to support built-in font Zapfino and other custom single font families like Impact\n  if (!font) {\n    NSArray *names = [[NSFontManager sharedFontManager] availableMembersOfFontFamily:familyName];\n    if (names.count > 0) {\n      font = [NSFont fontWithName:names[0] size:fontSize];\n    }\n  }\n\n  // Apply font variants to font object\n  if (variant) {\n    NSArray *fontFeatures = [RCTConvert RCTFontVariantDescriptorArray:variant];\n    NSFontDescriptor *fontDescriptor = [font.fontDescriptor\n                                        fontDescriptorByAddingAttributes:@{\n      NSFontFeatureSettingsAttribute: fontFeatures\n    }];\n    font = [NSFont fontWithDescriptor:fontDescriptor size:fontSize];\n  }\n\n  return font;\n}\n\n+ (NSFont *)updateFont:(NSFont *)font withFamily:(NSString *)family\n{\n  return [self updateFont:font withFamily:family size:nil weight:nil style:nil variant:nil scaleMultiplier:1];\n}\n\n+ (NSFont *)updateFont:(NSFont *)font withSize:(NSNumber *)size\n{\n  return [self updateFont:font withFamily:nil size:size weight:nil style:nil variant:nil scaleMultiplier:1];\n}\n\n+ (NSFont *)updateFont:(NSFont *)font withWeight:(NSString *)weight\n{\n  return [self updateFont:font withFamily:nil size:nil weight:weight style:nil variant:nil scaleMultiplier:1];\n}\n\n+ (NSFont *)updateFont:(NSFont *)font withStyle:(NSString *)style\n{\n  return [self updateFont:font withFamily:nil size:nil weight:nil style:style variant:nil scaleMultiplier:1];\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTMaskedView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTView.h>\n\n@interface RCTMaskedView : RCTView\n\n@end\n"
  },
  {
    "path": "React/Views/RCTMaskedView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTMaskedView.h\"\n\n#import <React/NSView+React.h>\n\n@implementation RCTMaskedView\n\n- (void)didUpdateReactSubviews\n{\n  // RCTMaskedView expects that the first subview rendered is the mask.\n  NSView *maskView = [self.reactSubviews firstObject];\n  self.layer.mask = maskView.layer.mask;\n  // self.maskView = maskView;\n\n  // Add the other subviews to the view hierarchy\n  for (NSUInteger i = 1; i < self.reactSubviews.count; i++) {\n    NSView *subview = [self.reactSubviews objectAtIndex:i];\n    [self addSubview:subview];\n  }\n}\n\n- (void)displayLayer:(CALayer *)layer\n{\n  // RCTView uses displayLayer to do border rendering.\n  // We don't need to do that in RCTMaskedView, so we\n  // stub this method and override the default implementation.\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTMaskedViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTMaskedViewManager : RCTViewManager\n\n@end\n\n@interface RCTSecureTextFieldManager : RCTViewManager\n\n@end\n\n"
  },
  {
    "path": "React/Views/RCTMaskedViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTMaskedViewManager.h\"\n\n#import \"RCTMaskedView.h\"\n#import \"RCTUIManager.h\"\n\n@implementation RCTMaskedViewManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  return [RCTMaskedView new];\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTModalHostView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTInvalidating.h>\n#import <React/RCTModalHostViewManager.h>\n#import <React/RCTView.h>\n\n@class RCTBridge;\n@class RCTModalHostViewController;\n@class RCTTVRemoteHandler;\n\n@protocol RCTModalHostViewInteractor;\n\n@interface RCTModalHostView : NSView <RCTInvalidating, NSWindowDelegate>\n\n@property (nonatomic, copy) NSString *animationType;\n@property (nonatomic, copy) NSString *presentationType;\n@property (nonatomic, copy) NSView *containerView;\n@property (nonatomic, copy) NSNumber *width;\n@property (nonatomic, copy) NSNumber *height;\n@property (nonatomic, assign, getter=isTransparent) BOOL transparent;\n\n@property (nonatomic, copy) RCTDirectEventBlock onShow;\n@property (nonatomic, copy) RCTDirectEventBlock onRequestClose;\n\n@property (nonatomic, copy) NSNumber *identifier;\n\n@property (nonatomic, weak) id<RCTModalHostViewInteractor> delegate;\n\n@property (nonatomic, copy) NSArray<NSString *> *supportedOrientations;\n@property (nonatomic, copy) RCTDirectEventBlock onOrientationChange;\n\n#if TARGET_OS_TV\n@property (nonatomic, copy) RCTDirectEventBlock onRequestClose;\n@property (nonatomic, strong) RCTTVRemoteHandler *tvRemoteHandler;\n#endif\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;\n\n@end\n\n@protocol RCTModalHostViewInteractor <NSObject>\n\n- (void)presentModalHostView:(RCTModalHostView *)modalHostView withViewController:(RCTModalHostViewController *)viewController animated:(BOOL)animated;\n- (void)dismissModalHostView:(RCTModalHostView *)modalHostView withViewController:(RCTModalHostViewController *)viewController animated:(BOOL)animated;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTModalHostView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTModalHostView.h\"\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge.h\"\n#import \"RCTModalHostViewController.h\"\n#import \"RCTTouchHandler.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTUtils.h\"\n#import \"NSView+React.h\"\n\n@implementation RCTModalHostView\n{\n  __weak RCTBridge *_bridge;\n  BOOL _isPresented;\n  RCTModalHostViewController *_modalViewController;\n  RCTTouchHandler *_touchHandler;\n  NSView *_reactSubview;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:coder)\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  if ((self = [super initWithFrame:CGRectZero])) {\n    _bridge = bridge;\n    _modalViewController = [[RCTModalHostViewController alloc] initWithNibName:nil bundle:nil];\n\n    NSRect windowFrame = [NSApp mainWindow].frame;\n    NSRect frame = NSMakeRect(windowFrame.origin.x, windowFrame.origin.y,\n                              windowFrame.size.width, windowFrame.size.height - 100);\n\n    _containerView = [[NSView alloc] initWithFrame:frame];\n    _containerView.autoresizingMask = NSViewMaxXMargin | NSViewMaxYMargin;\n    _modalViewController.view = _containerView;\n    _modalViewController.title = [NSApp mainWindow].title;\n    _touchHandler = [[RCTTouchHandler alloc] initWithBridge:bridge];\n    _isPresented = NO;\n\n    __weak typeof(self) weakSelf = self;\n    _modalViewController.boundsDidChangeBlock = ^(CGRect newBounds) {\n      [weakSelf notifyForBoundsChange:newBounds];\n    };\n    _modalViewController.initCompletionHandler = ^(NSWindow *modal) {\n      modal.delegate = weakSelf;\n    };\n    _modalViewController.closeCompletionHandler = ^{\n      [self dismissModalViewController];\n    };\n  }\n\n  return self;\n}\n\n- (void)notifyForBoundsChange:(CGRect)newBounds\n{\n  if (_reactSubview && _isPresented) {\n    [_bridge.uiManager setSize:newBounds.size forView:_reactSubview];\n  }\n}\n\n- (void)insertReactSubview:(NSView *)subview atIndex:(NSInteger)atIndex\n{\n  RCTAssert(_reactSubview == nil, @\"Modal view can only have one subview\");\n  [super insertReactSubview:subview atIndex:atIndex];\n  [subview addGestureRecognizer:_touchHandler];\n  subview.autoresizingMask = NSViewMaxXMargin | NSViewMaxYMargin;\n\n  [_modalViewController.view addSubview:subview];\n  _reactSubview = subview;\n}\n\n- (void)removeReactSubview:(NSView *)subview\n{\n  RCTAssert(subview == _reactSubview, @\"Cannot remove view other than modal view\");\n  [super removeReactSubview:subview];\n  [_touchHandler detachFromView:subview];\n  _reactSubview = nil;\n}\n\n- (void)didUpdateReactSubviews\n{\n  // Do nothing, as subview (singular) is managed by `insertReactSubview:atIndex:`\n}\n\n- (void)dismissModalViewController\n{\n  if (_isPresented) {\n    // [self.reactViewController dismissViewController:_modalViewController];\n    _isPresented = NO;\n    _onRequestClose(nil);\n  }\n}\n\n- (void)viewDidMoveToWindow\n{\n  [super viewDidMoveToWindow];\n  if (!_isPresented && self.window) {\n    RCTAssert(self.reactViewController, @\"Can't present modal view controller without a presenting view controller\");\n\n    if ([self.presentationType isEqualToString:@\"window\"]) {\n      [self.reactViewController presentViewControllerAsModalWindow:_modalViewController];\n      [NSApp modalWindow].delegate = self;\n    } else if ([self.presentationType isEqualToString:@\"sheet\"]) {\n      [self.reactViewController presentViewControllerAsSheet:_modalViewController];\n    } else if ([self.presentationType isEqualToString:@\"popover\"]) {\n      // TODO: Pass the real positioning view\n      [self.reactViewController presentViewController:_modalViewController\n          asPopoverRelativeToRect:self.frame\n                           ofView:self\n                    preferredEdge:NSMinYEdge\n                         behavior:NSPopoverBehaviorTransient];\n    }\n\n    if (_onShow) {\n      _onShow(nil);\n    }\n\n    _isPresented = YES;\n  }\n}\n\n- (void)viewDidMoveToSuperview\n{\n  [super viewDidMoveToSuperview];\n\n  if (_isPresented && !self.superview) {\n    [self dismissModalViewController];\n  }\n}\n\n- (void)invalidate\n{\n  dispatch_async(dispatch_get_main_queue(), ^{\n    [self dismissModalViewController];\n  });\n}\n\n- (BOOL)isTransparent\n{\n  return YES; //return _modalViewController.modalPresentationStyle == UIModalPresentationCustom;\n}\n\n- (BOOL)hasAnimationType\n{\n  return ![self.animationType isEqualToString:@\"none\"];\n}\n\n- (void)setTransparent:(BOOL)transparent\n{\n  //  _modalViewController.modalPresentationStyle = transparent ? UIModalPresentationCustom : UIModalPresentationFullScreen;\n}\n\n- (void)setWidth:(NSNumber *)width\n{\n  NSRect frame = self.containerView.frame;\n  [self.containerView setFrame:NSMakeRect(frame.origin.x, frame.origin.y, width.floatValue, frame.size.height)];\n}\n\n- (void)setHeight:(NSNumber *)height\n{\n  NSRect frame = self.containerView.frame;\n  [self.containerView setFrame:NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, height.floatValue)];\n}\n\n- (BOOL)windowShouldClose:(NSNotification *)notification\n{\n  dispatch_async(dispatch_get_main_queue(), ^{\n    [self dismissModalViewController];\n  });\n  return NO;\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTModalHostViewController.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@interface RCTModalHostViewController : NSViewController\n\n@property (nonatomic, copy) void (^boundsDidChangeBlock)(CGRect newBounds);\n@property (nonatomic, copy) void (^initCompletionHandler)(NSWindow *window);\n@property (nonatomic, copy) void (^closeCompletionHandler)();\n\n@end\n"
  },
  {
    "path": "React/Views/RCTModalHostViewController.m",
    "content": "\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTModalHostViewController.h\"\n\n@implementation RCTModalHostViewController\n{\n  CGRect _lastViewFrame;\n}\n\n- (void)viewDidLayout\n{\n  [super viewDidLayout];\n\n  if (self.initCompletionHandler && [NSApp modalWindow]) {\n    self.initCompletionHandler([NSApp modalWindow]);\n  }\n\n  if (self.boundsDidChangeBlock && !CGRectEqualToRect(_lastViewFrame, self.view.frame)) {\n    self.boundsDidChangeBlock(self.view.bounds);\n    _lastViewFrame = self.view.frame;\n  }\n}\n\n- (void)viewDidDisappear\n{\n  dispatch_async(dispatch_get_main_queue(), ^{\n    self.closeCompletionHandler();\n  });\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTModalHostViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTViewManager.h\"\n\n#import \"RCTInvalidating.h\"\n\n@interface RCTModalHostViewManager : RCTViewManager <RCTInvalidating>\n\n@end"
  },
  {
    "path": "React/Views/RCTModalHostViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTModalHostViewManager.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTModalHostView.h\"\n#import \"RCTTouchHandler.h\"\n#import \"RCTShadowView.h\"\n#import \"RCTUtils.h\"\n\n@interface RCTModalHostShadowView : RCTShadowView\n\n@end\n\n@implementation RCTModalHostShadowView\n\n- (void)insertReactSubview:(id<RCTComponent>)subview atIndex:(NSInteger)atIndex\n{\n  [super insertReactSubview:subview atIndex:atIndex];\n  if ([subview isKindOfClass:[RCTShadowView class]]) {\n    ((RCTShadowView *)subview).size = RCTScreenSize();\n  }\n}\n\n@end\n\n@implementation RCTModalHostViewManager\n{\n  NSHashTable *_hostViews;\n}\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  NSView *view = [[RCTModalHostView alloc] initWithBridge:self.bridge];\n  if (_hostViews) {\n    _hostViews = [NSHashTable weakObjectsHashTable];\n  }\n  [_hostViews addObject:view];\n  return view;\n}\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTModalHostShadowView new];\n}\n\n- (void)invalidate\n{\n  for (RCTModalHostView *hostView in _hostViews) {\n    [hostView invalidate];\n  }\n  [_hostViews removeAllObjects];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(animationType, NSString)\nRCT_EXPORT_VIEW_PROPERTY(presentationType, NSString)\nRCT_EXPORT_VIEW_PROPERTY(width, NSNumber)\nRCT_EXPORT_VIEW_PROPERTY(height, NSNumber)\nRCT_EXPORT_VIEW_PROPERTY(transparent, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(onShow, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onRequestClose, RCTDirectEventBlock)\n\n@end\n"
  },
  {
    "path": "React/Views/RCTModalManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTEventEmitter.h>\n\n@interface RCTModalManager : RCTEventEmitter <RCTBridgeModule>\n\n- (void)modalDismissed:(NSNumber *)modalID;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTModalManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTModalManager.h\"\n\n@interface RCTModalManager ()\n\n@property BOOL shouldEmit;\n\n@end\n\n@implementation RCTModalManager\n\nRCT_EXPORT_MODULE();\n\n- (NSArray<NSString *> *)supportedEvents\n{\n  return @[ @\"modalDismissed\" ];\n}\n\n- (void)startObserving\n{\n  _shouldEmit = YES;\n}\n\n- (void)stopObserving\n{\n  _shouldEmit = NO;\n}\n\n- (void)modalDismissed:(NSNumber *)modalID\n{\n  if (_shouldEmit) {\n    [self sendEventWithName:@\"modalDismissed\" body:@{ @\"modalID\": modalID }];\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTNavItem.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTComponent.h>\n\n@interface RCTNavItem : NSView\n\n@property (nonatomic, copy) NSString *title;\n@property (nonatomic, strong) NSImage *titleImage;\n@property (nonatomic, strong) NSImage *leftButtonIcon;\n@property (nonatomic, copy) NSString *leftButtonTitle;\n@property (nonatomic, assign) UIBarButtonSystemItem leftButtonSystemIcon;\n@property (nonatomic, strong) UIImage *rightButtonIcon;\n@property (nonatomic, copy) NSString *rightButtonTitle;\n@property (nonatomic, assign) UIBarButtonSystemItem rightButtonSystemIcon;\n@property (nonatomic, strong) UIImage *backButtonIcon;\n@property (nonatomic, copy) NSString *backButtonTitle;\n@property (nonatomic, assign) BOOL navigationBarHidden;\n@property (nonatomic, assign) BOOL shadowHidden;\n@property (nonatomic, strong) NSColor *tintColor;\n@property (nonatomic, strong) NSColor *barTintColor;\n@property (nonatomic, strong) NSColor *titleTextColor;\n@property (nonatomic, assign) BOOL translucent;\n#if !TARGET_OS_TV\n@property (nonatomic, assign) UIBarStyle barStyle;\n#endif\n\n// @property (nonatomic, readonly) UIImageView *titleImageView;\n// @property (nonatomic, readonly) UIBarButtonItem *backButtonItem;\n// @property (nonatomic, readonly) UIBarButtonItem *leftButtonItem;\n// @property (nonatomic, readonly) UIBarButtonItem *rightButtonItem;\n\n@property (nonatomic, copy) RCTBubblingEventBlock onLeftButtonPress;\n@property (nonatomic, copy) RCTBubblingEventBlock onRightButtonPress;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTNavItem.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTNavItem.h\"\n\n@implementation RCTNavItem\n\n@synthesize backButtonItem = _backButtonItem;\n@synthesize leftButtonItem = _leftButtonItem;\n@synthesize rightButtonItem = _rightButtonItem;\n\n- (UIImageView *)titleImageView\n{\n  if (_titleImage) {\n    return [[UIImageView alloc] initWithImage:_titleImage];\n  } else {\n    return nil;\n  }\n}\n\n-(instancetype)init\n{\n  if (self = [super init]) {\n    _leftButtonSystemIcon = NSNotFound;\n    _rightButtonSystemIcon = NSNotFound;\n  }\n  return self;\n}\n\n- (void)setBackButtonTitle:(NSString *)backButtonTitle\n{\n  _backButtonTitle = backButtonTitle;\n  _backButtonItem = nil;\n}\n\n- (void)setBackButtonIcon:(UIImage *)backButtonIcon\n{\n  _backButtonIcon = backButtonIcon;\n  _backButtonItem = nil;\n}\n\n- (UIBarButtonItem *)backButtonItem\n{\n  if (!_backButtonItem) {\n    if (_backButtonIcon) {\n      _backButtonItem = [[UIBarButtonItem alloc] initWithImage:_backButtonIcon\n                                                         style:UIBarButtonItemStylePlain\n                                                        target:nil\n                                                        action:nil];\n    } else if (_backButtonTitle.length) {\n      _backButtonItem = [[UIBarButtonItem alloc] initWithTitle:_backButtonTitle\n                                                         style:UIBarButtonItemStylePlain\n                                                        target:nil\n                                                        action:nil];\n    } else {\n      _backButtonItem = nil;\n    }\n  }\n  return _backButtonItem;\n}\n\n- (void)setLeftButtonTitle:(NSString *)leftButtonTitle\n{\n  _leftButtonTitle = leftButtonTitle;\n  _leftButtonItem = nil;\n}\n\n- (void)setLeftButtonIcon:(UIImage *)leftButtonIcon\n{\n  _leftButtonIcon = leftButtonIcon;\n  _leftButtonItem = nil;\n}\n\n- (void)setLeftButtonSystemIcon:(UIBarButtonSystemItem)leftButtonSystemIcon\n{\n  _leftButtonSystemIcon = leftButtonSystemIcon;\n  _leftButtonItem = nil;\n}\n\n- (UIBarButtonItem *)leftButtonItem\n{\n  if (!_leftButtonItem) {\n    if (_leftButtonIcon) {\n      _leftButtonItem =\n      [[UIBarButtonItem alloc] initWithImage:_leftButtonIcon\n                                       style:UIBarButtonItemStylePlain\n                                      target:self\n                                      action:@selector(handleLeftButtonPress)];\n\n    } else if (_leftButtonTitle.length) {\n      _leftButtonItem =\n      [[UIBarButtonItem alloc] initWithTitle:_leftButtonTitle\n                                       style:UIBarButtonItemStylePlain\n                                      target:self\n                                      action:@selector(handleLeftButtonPress)];\n\n    } else if (_leftButtonSystemIcon != NSNotFound) {\n      _leftButtonItem =\n      [[UIBarButtonItem alloc] initWithBarButtonSystemItem:_leftButtonSystemIcon\n                                                    target:self\n                                                    action:@selector(handleLeftButtonPress)];\n    } else {\n      _leftButtonItem = nil;\n    }\n  }\n  return _leftButtonItem;\n}\n\n- (void)handleLeftButtonPress\n{\n  if (_onLeftButtonPress) {\n    _onLeftButtonPress(nil);\n  }\n}\n\n- (void)setRightButtonTitle:(NSString *)rightButtonTitle\n{\n  _rightButtonTitle = rightButtonTitle;\n  _rightButtonItem = nil;\n}\n\n- (void)setRightButtonIcon:(UIImage *)rightButtonIcon\n{\n  _rightButtonIcon = rightButtonIcon;\n  _rightButtonItem = nil;\n}\n\n- (void)setRightButtonSystemIcon:(UIBarButtonSystemItem)rightButtonSystemIcon\n{\n  _rightButtonSystemIcon = rightButtonSystemIcon;\n  _rightButtonItem = nil;\n}\n\n- (UIBarButtonItem *)rightButtonItem\n{\n  if (!_rightButtonItem) {\n    if (_rightButtonIcon) {\n      _rightButtonItem =\n      [[UIBarButtonItem alloc] initWithImage:_rightButtonIcon\n                                       style:UIBarButtonItemStylePlain\n                                      target:self\n                                      action:@selector(handleRightButtonPress)];\n\n    } else if (_rightButtonTitle.length) {\n      _rightButtonItem =\n      [[UIBarButtonItem alloc] initWithTitle:_rightButtonTitle\n                                       style:UIBarButtonItemStylePlain\n                                      target:self\n                                      action:@selector(handleRightButtonPress)];\n\n    } else if (_rightButtonSystemIcon != NSNotFound) {\n      _rightButtonItem =\n      [[UIBarButtonItem alloc] initWithBarButtonSystemItem:_rightButtonSystemIcon\n                                      target:self\n                                      action:@selector(handleRightButtonPress)];\n    } else {\n      _rightButtonItem = nil;\n    }\n  }\n  return _rightButtonItem;\n}\n\n- (void)handleRightButtonPress\n{\n  if (_onRightButtonPress) {\n    _onRightButtonPress(nil);\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTNavItemManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTConvert.h>\n#import <React/RCTViewManager.h>\n\n@interface RCTConvert (BarButtonSystemItem)\n\n+ (UIBarButtonSystemItem)UIBarButtonSystemItem:(id)json;\n\n@end\n\n@interface RCTNavItemManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTNavItemManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTNavItemManager.h\"\n\n#import \"RCTConvert.h\"\n#import \"RCTNavItem.h\"\n\n@implementation RCTConvert (BarButtonSystemItem)\n\nRCT_ENUM_CONVERTER(UIBarButtonSystemItem, (@{\n  @\"done\": @(UIBarButtonSystemItemDone),\n  @\"cancel\": @(UIBarButtonSystemItemCancel),\n  @\"edit\": @(UIBarButtonSystemItemEdit),\n  @\"save\": @(UIBarButtonSystemItemSave),\n  @\"add\": @(UIBarButtonSystemItemAdd),\n  @\"flexible-space\": @(UIBarButtonSystemItemFlexibleSpace),\n  @\"fixed-space\": @(UIBarButtonSystemItemFixedSpace),\n  @\"compose\": @(UIBarButtonSystemItemCompose),\n  @\"reply\": @(UIBarButtonSystemItemReply),\n  @\"action\": @(UIBarButtonSystemItemAction),\n  @\"organize\": @(UIBarButtonSystemItemOrganize),\n  @\"bookmarks\": @(UIBarButtonSystemItemBookmarks),\n  @\"search\": @(UIBarButtonSystemItemSearch),\n  @\"refresh\": @(UIBarButtonSystemItemRefresh),\n  @\"stop\": @(UIBarButtonSystemItemStop),\n  @\"camera\": @(UIBarButtonSystemItemCamera),\n  @\"trash\": @(UIBarButtonSystemItemTrash),\n  @\"play\": @(UIBarButtonSystemItemPlay),\n  @\"pause\": @(UIBarButtonSystemItemPause),\n  @\"rewind\": @(UIBarButtonSystemItemRewind),\n  @\"fast-forward\": @(UIBarButtonSystemItemFastForward),\n  @\"undo\": @(UIBarButtonSystemItemUndo),\n  @\"redo\": @(UIBarButtonSystemItemRedo),\n  @\"page-curl\": @(UIBarButtonSystemItemPageCurl)\n}), NSNotFound, integerValue);\n\n@end\n\n@implementation RCTNavItemManager\n\nRCT_EXPORT_MODULE()\n\n- (UIView *)view\n{\n  return [RCTNavItem new];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(navigationBarHidden, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(shadowHidden, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor)\nRCT_EXPORT_VIEW_PROPERTY(barTintColor, UIColor)\n#if !TARGET_OS_TV\nRCT_EXPORT_VIEW_PROPERTY(barStyle, UIBarStyle)\n#endif\nRCT_EXPORT_VIEW_PROPERTY(translucent, BOOL)\n\nRCT_EXPORT_VIEW_PROPERTY(title, NSString)\nRCT_EXPORT_VIEW_PROPERTY(titleTextColor, UIColor)\nRCT_EXPORT_VIEW_PROPERTY(titleImage, UIImage)\n\nRCT_EXPORT_VIEW_PROPERTY(backButtonIcon, UIImage)\nRCT_EXPORT_VIEW_PROPERTY(backButtonTitle, NSString)\n\nRCT_EXPORT_VIEW_PROPERTY(leftButtonTitle, NSString)\nRCT_EXPORT_VIEW_PROPERTY(leftButtonIcon, UIImage)\nRCT_EXPORT_VIEW_PROPERTY(leftButtonSystemIcon, UIBarButtonSystemItem)\n\nRCT_EXPORT_VIEW_PROPERTY(rightButtonIcon, UIImage)\nRCT_EXPORT_VIEW_PROPERTY(rightButtonTitle, NSString)\nRCT_EXPORT_VIEW_PROPERTY(rightButtonSystemIcon, UIBarButtonSystemItem)\n\nRCT_EXPORT_VIEW_PROPERTY(onLeftButtonPress, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onRightButtonPress, RCTBubblingEventBlock)\n\n@end\n"
  },
  {
    "path": "React/Views/RCTNavigator.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\n#import <React/RCTFrameUpdate.h>\n\n@class RCTBridge;\n\n@interface RCTNavigator : UIView <RCTFrameUpdateObserver>\n\n@property (nonatomic, strong) UIView *reactNavSuperviewLink;\n@property (nonatomic, assign) NSInteger requestedTopOfStack;\n@property (nonatomic, assign) BOOL interactivePopGestureEnabled;\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;\n\n/**\n * Schedules a JavaScript navigation and prevents `UIKit` from navigating until\n * JavaScript has sent its scheduled navigation.\n *\n * @returns Whether or not a JavaScript driven navigation could be\n * scheduled/reserved. If returning `NO`, JavaScript should usually just do\n * nothing at all.\n */\n- (BOOL)requestSchedulingJavaScriptNavigation;\n\n- (void)uiManagerDidPerformMounting;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTNavigator.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTNavigator.h\"\n\n#import \"RCTAssert.h\"\n#import \"RCTBridge.h\"\n#import \"RCTConvert.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTLog.h\"\n#import \"RCTNavItem.h\"\n#import \"RCTScrollView.h\"\n#import \"RCTUtils.h\"\n#import \"RCTView.h\"\n#import \"RCTWrapperViewController.h\"\n#import \"UIView+React.h\"\n\ntypedef NS_ENUM(NSUInteger, RCTNavigationLock) {\n  RCTNavigationLockNone,\n  RCTNavigationLockNative,\n  RCTNavigationLockJavaScript\n};\n\n// By default the interactive pop gesture will be enabled when the navigation bar is displayed\n// and disabled when hidden\n// RCTPopGestureStateDefault maps to the default behavior (mentioned above). Once popGestureState\n// leaves this value, it can never be returned back to it. This is because, due to a limitation in\n// the iOS APIs, once we override the default behavior of the gesture recognizer, we cannot return\n// back to it.\n// RCTPopGestureStateEnabled will enable the gesture independent of nav bar visibility\n// RCTPopGestureStateDisabled will disable the gesture independent of nav bar visibility\ntypedef NS_ENUM(NSUInteger, RCTPopGestureState) {\n  RCTPopGestureStateDefault = 0,\n  RCTPopGestureStateEnabled,\n  RCTPopGestureStateDisabled\n};\n\nNSInteger kNeverRequested = -1;\nNSInteger kNeverProgressed = -10000;\n\n\n@interface UINavigationController ()\n\n// need to declare this since `UINavigationController` doesnt publicly declare the fact that it implements\n// UINavigationBarDelegate :(\n- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item;\n\n@end\n\n// http://stackoverflow.com/questions/5115135/uinavigationcontroller-how-to-cancel-the-back-button-event\n// There's no other way to do this unfortunately :(\n@interface RCTNavigationController : UINavigationController <UINavigationBarDelegate>\n{\n  dispatch_block_t _scrollCallback;\n}\n\n@property (nonatomic, assign) RCTNavigationLock navigationLock;\n\n@end\n\n/**\n * In general, `RCTNavigator` examines `_currentViews` (which are React child\n * views), and compares them to `_navigationController.viewControllers` (which\n * are controlled by UIKit).\n *\n * It is possible for JavaScript (`_currentViews`) to \"get ahead\" of native\n * (`navigationController.viewControllers`) and vice versa. JavaScript gets\n * ahead by adding/removing React subviews. Native gets ahead by swiping back,\n * or tapping the back button. In both cases, the other system is initially\n * unaware. And in both cases, `RCTNavigator` helps the other side \"catch up\".\n *\n * If `RCTNavigator` sees the number of React children have changed, it\n * pushes/pops accordingly. If `RCTNavigator` sees a `UIKit` driven push/pop, it\n * notifies JavaScript that this has happened, and expects that JavaScript will\n * eventually render more children to match `UIKit`. There's no rush for\n * JavaScript to catch up. But if it does render anything, it must catch up to\n * UIKit. It cannot deviate.\n *\n * To implement this, we need a lock, which we store on the native thread. This\n * lock allows one of the systems to push/pop views. Whoever wishes to\n * \"get ahead\" must obtain the lock. Whoever wishes to \"catch up\" must obtain\n * the lock. One thread may not \"get ahead\" or \"catch up\" when the other has\n * the lock. Once a thread has the lock, it can only do the following:\n *\n * 1. If it is behind, it may only catch up.\n * 2. If it is caught up or ahead, it may push or pop.\n *\n *\n * ========= Acquiring The Lock ==========\n *\n * JavaScript asynchronously acquires the lock using a native hook. It might be\n * rejected and receive the return value `false`.\n *\n * We acquire the native lock in `shouldPopItem`, which is called right before\n * native tries to push/pop, but only if JavaScript doesn't already have the\n * lock.\n *\n * ========  While JavaScript Has Lock ====\n *\n * When JavaScript has the lock, we have to block all `UIKit` driven pops:\n *\n * 1. Block back button navigation:\n *   - Back button will invoke `shouldPopItem`, from which we return `NO` if\n *   JavaScript has the lock.\n *   - Back button will respect the return value `NO` and not permit\n *   navigation.\n *\n * 2. Block swipe-to-go-back navigation:\n *   - Swipe will trigger `shouldPopItem`, but swipe won't respect our `NO`\n *   return value so we must disable the gesture recognizer while JavaScript\n *   has the lock.\n *\n * ========  While Native Has Lock =======\n *\n * We simply deny JavaScript the right to acquire the lock.\n *\n *\n * ======== Releasing The Lock ===========\n *\n * Recall that the lock represents who has the right to either push/pop (or\n * catch up). As soon as we recognize that the side that has locked has carried\n * out what it scheduled to do, we can release the lock, but only after any\n * possible animations are completed.\n *\n * *IF* a scheduled operation results in a push/pop (not all do), then we can\n * only release the lock after the push/pop animation is complete because\n * UIKit. `didMoveToNavigationController` is invoked when the view is done\n * pushing/popping/animating. Native swipe-to-go-back interactions can be\n * aborted, however, and you'll never see that method invoked. So just to cover\n * that case, we also put an animation complete hook in\n * `animateAlongsideTransition` to make sure we free the lock, in case the\n * scheduled native push/pop never actually happened.\n *\n * For JavaScript:\n * - When we see that JavaScript has \"caught up\" to `UIKit`, and no pushes/pops\n * were needed, we can release the lock.\n * - When we see that JavaScript requires *some* push/pop, it's not yet done\n * carrying out what it scheduled to do. Just like with `UIKit` push/pops, we\n * still have to wait for it to be done animating\n * (`didMoveToNavigationController` is a suitable hook).\n *\n */\n@implementation RCTNavigationController\n\n/**\n * @param callback Callback that is invoked when a \"scroll\" interaction begins\n * so that `RCTNavigator` can notify `JavaScript`.\n */\n- (instancetype)initWithScrollCallback:(dispatch_block_t)callback\n{\n  if ((self = [super initWithNibName:nil bundle:nil])) {\n    _scrollCallback = callback;\n  }\n  return self;\n}\n\n/**\n * Invoked when either a navigation item has been popped off, or when a\n * swipe-back gesture has began. The swipe-back gesture doesn't respect the\n * return value of this method. The back button does. That's why we have to\n * completely disable the gesture recognizer for swipe-back while JS has the\n * lock.\n */\n- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item\n{\n#if !TARGET_OS_TV\n  if (self.interactivePopGestureRecognizer.state == UIGestureRecognizerStateBegan) {\n    if (self.navigationLock == RCTNavigationLockNone) {\n      self.navigationLock = RCTNavigationLockNative;\n      if (_scrollCallback) {\n        _scrollCallback();\n      }\n    } else if (self.navigationLock == RCTNavigationLockJavaScript) {\n      // This should never happen because we disable/enable the gesture\n      // recognizer when we lock the navigation.\n      RCTAssert(NO, @\"Should never receive gesture start while JS locks navigator\");\n    }\n  } else\n#endif //TARGET_OS_TV\n  {\n    if (self.navigationLock == RCTNavigationLockNone) {\n      // Must be coming from native interaction, lock it - it will be unlocked\n      // in `didMoveToNavigationController`\n      self.navigationLock = RCTNavigationLockNative;\n      if (_scrollCallback) {\n        _scrollCallback();\n      }\n    } else if (self.navigationLock == RCTNavigationLockJavaScript) {\n      // This should only occur when JS has the lock, and\n      // - JS is driving the pop\n      // - Or the back button was pressed\n      // TODO: We actually want to disable the backbutton while JS has the\n      // lock, but it's not so easy. Even returning `NO` wont' work because it\n      // will also block JS driven pops. We simply need to disallow a standard\n      // back button, and instead use a custom one that tells JS to pop to\n      // length (`currentReactCount` - 1).\n      return [super navigationBar:navigationBar shouldPopItem:item];\n    }\n  }\n  return [super navigationBar:navigationBar shouldPopItem:item];\n}\n\n@end\n\n@interface RCTNavigator() <RCTWrapperViewControllerNavigationListener, UINavigationControllerDelegate, UIGestureRecognizerDelegate>\n\n@property (nonatomic, copy) RCTDirectEventBlock onNavigationProgress;\n@property (nonatomic, copy) RCTBubblingEventBlock onNavigationComplete;\n\n@property (nonatomic, assign) NSInteger previousRequestedTopOfStack;\n\n@property (nonatomic, assign) RCTPopGestureState popGestureState;\n\n// Previous views are only mainted in order to detect incorrect\n// addition/removal of views below the `requestedTopOfStack`\n@property (nonatomic, copy, readwrite) NSArray<RCTNavItem *> *previousViews;\n@property (nonatomic, readwrite, strong) RCTNavigationController *navigationController;\n/**\n * Display link is used to get high frequency sample rate during\n * interaction/animation of view controller push/pop.\n *\n * - The run loop retains the displayLink.\n * - `displayLink` retains its target.\n * - We use `invalidate` to remove the `RCTNavigator`'s reference to the\n * `displayLink` and remove the `displayLink` from the run loop.\n *\n *\n * `displayLink`:\n * --------------\n *\n * - Even though we could implement the `displayLink` cleanup without the\n * `invalidate` hook by adding and removing it from the run loop at the\n * right times (begin/end animation), we need to account for the possibility\n * that the view itself is destroyed mid-interaction. So we always keep it\n * added to the run loop, but start/stop it with interactions/animations. We\n * remove it from the run loop when the view will be destroyed by React.\n *\n * +----------+              +--------------+\n * | run loop o----strong--->|  displayLink |\n * +----------+              +--o-----------+\n *                              |        ^\n *                              |        |\n *                            strong   strong\n *                              |        |\n *                              v        |\n *                             +---------o---+\n *                             | RCTNavigator |\n *                             +-------------+\n *\n * `dummyView`:\n * ------------\n * There's no easy way to get a callback that fires when the position of a\n * navigation item changes. The actual layers that are moved around during the\n * navigation transition are private. Our only hope is to use\n * `animateAlongsideTransition`, to set a dummy view's position to transition\n * anywhere from -1.0 to 1.0. We later set up a `CADisplayLink` to poll the\n * `presentationLayer` of that dummy view and report the value as a \"progress\"\n * percentage.\n *\n * It was critical that we added the dummy view as a subview of the\n * transitionCoordinator's `containerView`, otherwise the animations would not\n * work correctly when reversing the gesture direction etc. This seems to be\n * undocumented behavior/requirement.\n *\n */\n@property (nonatomic, readonly, assign) CGFloat mostRecentProgress;\n@property (nonatomic, readonly, strong) NSTimer *runTimer;\n@property (nonatomic, readonly, assign) NSInteger currentlyTransitioningFrom;\n@property (nonatomic, readonly, assign) NSInteger currentlyTransitioningTo;\n\n// Dummy view that we make animate with the same curve/interaction as the\n// navigation animation/interaction.\n@property (nonatomic, readonly, strong) UIView *dummyView;\n\n@end\n\n@implementation RCTNavigator\n{\n  __weak RCTBridge *_bridge;\n  NSInteger _numberOfViewControllerMovesToIgnore;\n}\n\n@synthesize paused = _paused;\n@synthesize pauseCallback = _pauseCallback;\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  RCTAssertParam(bridge);\n\n  if ((self = [super initWithFrame:CGRectZero])) {\n    _paused = YES;\n\n    _bridge = bridge;\n    _mostRecentProgress = kNeverProgressed;\n    _dummyView = [[UIView alloc] initWithFrame:CGRectZero];\n    _previousRequestedTopOfStack = kNeverRequested; // So that we initialize with a push.\n    _previousViews = @[];\n    __weak RCTNavigator *weakSelf = self;\n    _navigationController = [[RCTNavigationController alloc] initWithScrollCallback:^{\n      [weakSelf dispatchFakeScrollEvent];\n    }];\n    _navigationController.delegate = self;\n    RCTAssert([self requestSchedulingJavaScriptNavigation], @\"Could not acquire JS navigation lock on init\");\n\n    [self addSubview:_navigationController.view];\n    [_navigationController.view addSubview:_dummyView];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (void)didUpdateFrame:(__unused RCTFrameUpdate *)update\n{\n  if (_currentlyTransitioningFrom != _currentlyTransitioningTo) {\n    UIView *topView = _dummyView;\n    id presentationLayer = [topView.layer presentationLayer];\n    CGRect frame = [presentationLayer frame];\n    CGFloat nextProgress = ABS(frame.origin.x);\n    // Don't want to spam the bridge, when the user holds their finger still mid-navigation.\n    if (nextProgress == _mostRecentProgress) {\n      return;\n    }\n    _mostRecentProgress = nextProgress;\n    if (_onNavigationProgress) {\n      _onNavigationProgress(@{\n        @\"fromIndex\": @(_currentlyTransitioningFrom),\n        @\"toIndex\": @(_currentlyTransitioningTo),\n        @\"progress\": @(nextProgress),\n      });\n    }\n  }\n}\n\n- (void)setPaused:(BOOL)paused\n{\n  if (_paused != paused) {\n    _paused = paused;\n    if (_pauseCallback) {\n      _pauseCallback();\n    }\n  }\n}\n\n- (void)setInteractivePopGestureEnabled:(BOOL)interactivePopGestureEnabled\n{\n#if !TARGET_OS_TV\n  _interactivePopGestureEnabled = interactivePopGestureEnabled;\n\n  _navigationController.interactivePopGestureRecognizer.delegate = self;\n  _navigationController.interactivePopGestureRecognizer.enabled = interactivePopGestureEnabled;\n\n  _popGestureState = interactivePopGestureEnabled ? RCTPopGestureStateEnabled : RCTPopGestureStateDisabled;\n#endif\n}\n\n- (void)dealloc\n{\n#if !TARGET_OS_TV\n  if (_navigationController.interactivePopGestureRecognizer.delegate == self) {\n    _navigationController.interactivePopGestureRecognizer.delegate = nil;\n  }\n#endif\n  _navigationController.delegate = nil;\n  [_navigationController removeFromParentViewController];\n}\n\n- (UIViewController *)reactViewController\n{\n  return _navigationController;\n}\n\n- (BOOL)gestureRecognizerShouldBegin:(__unused UIGestureRecognizer *)gestureRecognizer\n{\n  return _navigationController.viewControllers.count > 1;\n}\n\n/**\n * See documentation about lock lifecycle. This is only here to clean up\n * swipe-back abort interaction, which leaves us *no* other way to clean up\n * locks aside from the animation complete hook.\n */\n- (void)navigationController:(UINavigationController *)navigationController\n      willShowViewController:(__unused UIViewController *)viewController\n                    animated:(__unused BOOL)animated\n{\n  id<UIViewControllerTransitionCoordinator> tc =\n    navigationController.topViewController.transitionCoordinator;\n  __weak RCTNavigator *weakSelf = self;\n  [tc.containerView addSubview: _dummyView];\n  [tc animateAlongsideTransition: ^(id<UIViewControllerTransitionCoordinatorContext> context) {\n    RCTWrapperViewController *fromController =\n      (RCTWrapperViewController *)[context viewControllerForKey:UITransitionContextFromViewControllerKey];\n    RCTWrapperViewController *toController =\n      (RCTWrapperViewController *)[context viewControllerForKey:UITransitionContextToViewControllerKey];\n\n    // This may be triggered by a navigation controller unrelated to me: if so, ignore.\n    if (fromController.navigationController != self->_navigationController ||\n        toController.navigationController != self->_navigationController) {\n      return;\n    }\n\n    NSUInteger indexOfFrom = [self.reactSubviews indexOfObject:fromController.navItem];\n    NSUInteger indexOfTo = [self.reactSubviews indexOfObject:toController.navItem];\n    CGFloat destination = indexOfFrom < indexOfTo ? 1.0 : -1.0;\n    self->_dummyView.frame = (CGRect){{destination, 0}, CGSizeZero};\n    self->_currentlyTransitioningFrom = indexOfFrom;\n    self->_currentlyTransitioningTo = indexOfTo;\n    self.paused = NO;\n  }\n  completion:^(__unused id<UIViewControllerTransitionCoordinatorContext> context) {\n    [weakSelf freeLock];\n    self->_currentlyTransitioningFrom = 0;\n    self->_currentlyTransitioningTo = 0;\n    self->_dummyView.frame = CGRectZero;\n    self.paused = YES;\n    // Reset the parallel position tracker\n  }];\n}\n\n- (BOOL)requestSchedulingJavaScriptNavigation\n{\n  if (_navigationController.navigationLock == RCTNavigationLockNone) {\n    _navigationController.navigationLock = RCTNavigationLockJavaScript;\n#if !TARGET_OS_TV\n    _navigationController.interactivePopGestureRecognizer.enabled = NO;\n#endif\n    return YES;\n  }\n  return NO;\n}\n\n- (void)freeLock\n{\n  _navigationController.navigationLock = RCTNavigationLockNone;\n\n  // Unless the pop gesture has been explicitly disabled (RCTPopGestureStateDisabled),\n  // Set interactivePopGestureRecognizer.enabled to YES\n  // If the popGestureState is RCTPopGestureStateDefault the default behavior will be maintained\n#if !TARGET_OS_TV\n  _navigationController.interactivePopGestureRecognizer.enabled = self.popGestureState != RCTPopGestureStateDisabled;\n#endif\n}\n\n/**\n * A React subview can be inserted/removed at any time, however if the\n * `requestedTopOfStack` changes, there had better be enough subviews present\n * to satisfy the push/pop.\n */\n- (void)insertReactSubview:(RCTNavItem *)view atIndex:(NSInteger)atIndex\n{\n  RCTAssert([view isKindOfClass:[RCTNavItem class]], @\"RCTNavigator only accepts RCTNavItem subviews\");\n  RCTAssert(\n    _navigationController.navigationLock == RCTNavigationLockJavaScript,\n    @\"Cannot change subviews from JS without first locking.\"\n  );\n  [super insertReactSubview:view atIndex:atIndex];\n}\n\n- (void)didUpdateReactSubviews\n{\n  // Do nothing, as subviews are managed by `uiManagerDidPerformMounting`\n}\n\n- (void)layoutSubviews\n{\n  [super layoutSubviews];\n  [self reactAddControllerToClosestParent:_navigationController];\n  _navigationController.view.frame = self.bounds;\n}\n\n- (void)removeReactSubview:(RCTNavItem *)subview\n{\n  if (self.reactSubviews.count <= 0 || subview == self.reactSubviews[0]) {\n    RCTLogError(@\"Attempting to remove invalid RCT subview of RCTNavigator\");\n    return;\n  }\n  [super removeReactSubview:subview];\n}\n\n- (void)handleTopOfStackChanged\n{\n  if (_onNavigationComplete) {\n    _onNavigationComplete(@{\n      @\"stackLength\":@(_navigationController.viewControllers.count)\n    });\n  }\n}\n\n- (void)dispatchFakeScrollEvent\n{\n  [_bridge.eventDispatcher sendFakeScrollEvent:self.reactTag];\n}\n\n/**\n * Must be overridden because UIKit removes the view's superview when used\n * as a navigator - it's considered outside the view hierarchy.\n */\n- (UIView *)reactSuperview\n{\n  RCTAssert(!_bridge.isValid || self.superview != nil, @\"put reactNavSuperviewLink back\");\n  UIView *superview = [super reactSuperview];\n  return superview ?: self.reactNavSuperviewLink;\n}\n\n- (void)uiManagerDidPerformMounting\n{\n  // we can't hook up the VC hierarchy in 'init' because the subviews aren't\n  // hooked up yet, so we do it on demand here\n  [self reactAddControllerToClosestParent:_navigationController];\n\n  NSUInteger viewControllerCount = _navigationController.viewControllers.count;\n  // The \"react count\" is the count of views that are visible on the navigation\n  // stack.  There may be more beyond this - that aren't visible, and may be\n  // deleted/purged soon.\n  NSUInteger previousReactCount =\n    _previousRequestedTopOfStack == kNeverRequested ? 0 : _previousRequestedTopOfStack + 1;\n  NSUInteger currentReactCount = _requestedTopOfStack + 1;\n\n  BOOL jsGettingAhead =\n    //    ----- previously caught up ------          ------ no longer caught up -------\n    viewControllerCount == previousReactCount && currentReactCount != viewControllerCount;\n  BOOL jsCatchingUp =\n    //    --- previously not caught up ----          --------- now caught up ----------\n    viewControllerCount != previousReactCount && currentReactCount == viewControllerCount;\n  BOOL jsMakingNoProgressButNeedsToCatchUp =\n    //    --- previously not caught up ----          ------- still the same -----------\n    viewControllerCount != previousReactCount && currentReactCount == previousReactCount;\n  BOOL jsMakingNoProgressAndDoesntNeedTo =\n    //    --- previously caught up --------          ------- still caught up ----------\n    viewControllerCount == previousReactCount && currentReactCount == previousReactCount;\n\nBOOL jsGettingtooSlow =\n  //    --- previously not caught up --------          ------- no longer caught up ----------\n  viewControllerCount < previousReactCount && currentReactCount < previousReactCount;\n\n  BOOL reactPushOne = jsGettingAhead && currentReactCount == previousReactCount + 1;\n  BOOL reactPopN = jsGettingAhead && currentReactCount < previousReactCount;\n\n  // We can actually recover from this situation, but it would be nice to know\n  // when this error happens. This simply means that JS hasn't caught up to a\n  // back navigation before progressing. It's likely a bug in the JS code that\n  // catches up/schedules navigations.\n  if (!(jsGettingAhead ||\n        jsCatchingUp ||\n        jsMakingNoProgressButNeedsToCatchUp ||\n        jsMakingNoProgressAndDoesntNeedTo ||\n        jsGettingtooSlow)) {\n    RCTLogError(@\"JS has only made partial progress to catch up to UIKit\");\n  }\n  if (currentReactCount > self.reactSubviews.count) {\n    RCTLogError(@\"Cannot adjust current top of stack beyond available views\");\n  }\n\n  // Views before the previous React count must not have changed. Views greater than previousReactCount\n  // up to currentReactCount may have changed.\n  for (NSUInteger i = 0; i < MIN(self.reactSubviews.count, MIN(_previousViews.count, previousReactCount)); i++) {\n    if (self.reactSubviews[i] != _previousViews[i]) {\n      RCTLogError(@\"current view should equal previous view\");\n    }\n  }\n  if (currentReactCount < 1) {\n    RCTLogError(@\"should be at least one current view\");\n  }\n  if (jsGettingAhead) {\n    if (reactPushOne) {\n      UIView *lastView = self.reactSubviews.lastObject;\n      RCTWrapperViewController *vc = [[RCTWrapperViewController alloc] initWithNavItem:(RCTNavItem *)lastView];\n      vc.navigationListener = self;\n      _numberOfViewControllerMovesToIgnore = 1;\n      [_navigationController pushViewController:vc animated:(currentReactCount > 1)];\n    } else if (reactPopN) {\n      UIViewController *viewControllerToPopTo = _navigationController.viewControllers[(currentReactCount - 1)];\n      _numberOfViewControllerMovesToIgnore = viewControllerCount - currentReactCount;\n      [_navigationController popToViewController:viewControllerToPopTo animated:YES];\n    } else {\n      RCTLogError(@\"Pushing or popping more than one view at a time from JS\");\n    }\n  } else if (jsCatchingUp) {\n    [self freeLock]; // Nothing to push/pop\n  } else {\n    // Else, JS making no progress, could have been unrelated to anything nav.\n    return;\n  }\n\n  // Only make a copy of the subviews whose validity we expect to be able to check (in the loop, above),\n  // otherwise we would unnecessarily retain a reference to view(s) no longer on the React navigation stack:\n  NSUInteger expectedCount = MIN(currentReactCount, self.reactSubviews.count);\n  _previousViews = [[self.reactSubviews subarrayWithRange: NSMakeRange(0, expectedCount)] copy];\n  _previousRequestedTopOfStack = _requestedTopOfStack;\n}\n\n// TODO: This will likely fail when performing multiple pushes/pops. We must\n// free the lock only after the *last* push/pop.\n- (void)wrapperViewController:(RCTWrapperViewController *)wrapperViewController\ndidMoveToNavigationController:(UINavigationController *)navigationController\n{\n  if (self.superview == nil) {\n    // If superview is nil, then a JS reload (Cmd+R) happened\n    // while a push/pop is in progress.\n    return;\n  }\n\n  RCTAssert(\n    (navigationController == nil || [_navigationController.viewControllers containsObject:wrapperViewController]),\n    @\"if navigation controller is not nil, it should contain the wrapper view controller\"\n  );\n  RCTAssert(_navigationController.navigationLock == RCTNavigationLockJavaScript ||\n           _numberOfViewControllerMovesToIgnore == 0,\n           @\"If JS doesn't have the lock there should never be any pending transitions\");\n  /**\n   * When JS has the lock we want to keep track of when the request completes\n   * the pending transition count hitting 0 signifies this, and should always\n   * remain at 0 when JS does not have the lock\n   */\n  if (_numberOfViewControllerMovesToIgnore > 0) {\n    _numberOfViewControllerMovesToIgnore -= 1;\n  }\n  if (_numberOfViewControllerMovesToIgnore == 0) {\n    [self handleTopOfStackChanged];\n    [self freeLock];\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTNavigatorManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTNavigatorManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTNavigatorManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTNavigatorManager.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTConvert.h\"\n#import \"RCTNavigator.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTUIManagerObserverCoordinator.h\"\n#import \"UIView+React.h\"\n\n@interface RCTNavigatorManager () <RCTUIManagerObserver>\n\n@end\n\n@implementation RCTNavigatorManager\n{\n  // The main thread only.\n  NSHashTable<RCTNavigator *> *_viewRegistry;\n}\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  [super setBridge:bridge];\n\n  [self.bridge.uiManager.observerCoordinator addObserver:self];\n}\n\n- (void)invalidate\n{\n  [self.bridge.uiManager.observerCoordinator removeObserver:self];\n}\n\nRCT_EXPORT_MODULE()\n\n- (UIView *)view\n{\n  if (!_viewRegistry) {\n    _viewRegistry = [NSHashTable hashTableWithOptions:NSPointerFunctionsWeakMemory];\n  }\n\n  RCTNavigator *view = [[RCTNavigator alloc] initWithBridge:self.bridge];\n  [_viewRegistry addObject:view];\n  return view;\n}\n\nRCT_EXPORT_VIEW_PROPERTY(requestedTopOfStack, NSInteger)\nRCT_EXPORT_VIEW_PROPERTY(onNavigationProgress, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onNavigationComplete, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(interactivePopGestureEnabled, BOOL)\n\nRCT_EXPORT_METHOD(requestSchedulingJavaScriptNavigation:(nonnull NSNumber *)reactTag\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  [self.bridge.uiManager addUIBlock:\n   ^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTNavigator *> *viewRegistry){\n    RCTNavigator *navigator = viewRegistry[reactTag];\n    if ([navigator isKindOfClass:[RCTNavigator class]]) {\n      BOOL wasAcquired = [navigator requestSchedulingJavaScriptNavigation];\n      callback(@[@(wasAcquired)]);\n    } else {\n      RCTLogError(@\"Cannot set lock: %@ (tag #%@) is not an RCTNavigator\", navigator, reactTag);\n    }\n  }];\n}\n\n#pragma mark - RCTUIManagerObserver\n\n- (void)uiManagerDidPerformMounting:(__unused RCTUIManager *)manager\n{\n  RCTExecuteOnMainQueue(^{\n    for (RCTNavigator *view in self->_viewRegistry) {\n      [view uiManagerDidPerformMounting];\n    }\n  });\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTPicker.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n#import \"NSView+React.h\"\n\n#import <React/NSView+React.h>\n\n@interface RCTPicker : NSComboBox\n\n@property (nonatomic, copy) NSArray<NSDictionary *> *items;\n@property (nonatomic, assign) NSInteger selectedIndex;\n\n@property (nonatomic, strong) NSColor *color;\n@property (nonatomic, strong) NSFont *font;\n@property (nonatomic, assign) NSTextAlignment textAlign;\n\n@property (nonatomic, copy) RCTBubblingEventBlock onChange;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTPicker.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTPicker.h\"\n\n#import \"RCTConvert.h\"\n#import \"RCTUtils.h\"\n#import \"NSView+React.h\"\n\n@interface RCTPicker() <NSComboBoxDataSource, NSComboBoxDelegate>\n\n@end\n\n@implementation RCTPicker\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if ((self = [super initWithFrame:frame])) {\n    _color = [NSColor blackColor];\n    _font = [NSFont systemFontOfSize:21]; // TODO: selected title default should be 23.5\n    _selectedIndex = NSNotFound;\n    _textAlign = NSTextAlignmentCenter;\n    self.delegate = self;\n    self.usesDataSource = YES;\n    [self setDataSource:self];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (void)setItems:(NSArray<NSDictionary *> *)items\n{\n  _items = [items copy];\n  [self layout];\n}\n\n- (BOOL)usesDataSource\n{\n  return YES;\n}\n\n- (void)selectItemAt:(NSInteger)selectedIndex\n{\n  if (_selectedIndex != selectedIndex) {\n    //BOOL animated = _selectedIndex != NSNotFound; // Don't animate the initial value\n    _selectedIndex = selectedIndex;\n    dispatch_async(dispatch_get_main_queue(), ^{\n      [self selectItemAtIndex:selectedIndex];\n    });\n  }\n}\n\n//#pragma mark - UIPickerViewDataSource protocol\n//\n- (NSInteger)numberOfItemsInComboBox:(__unused NSComboBox *)theComboBox\n{\n  return _items.count;\n}\n\n- (id)comboBox:(__unused NSComboBox *)aComboBox\nobjectValueForItemAtIndex:(NSInteger)index\n{\n  return _items[index][@\"label\"];\n}\n\n- (void)comboBoxSelectionDidChange:(__unused NSNotification *)notification\n{\n  _selectedIndex = [self indexOfSelectedItem];\n  if (_onChange) {\n    _onChange(@{\n                @\"newIndex\": @(_selectedIndex),\n                @\"newValue\": _items[_selectedIndex][@\"value\"]\n                });\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTPickerManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTPickerManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTPickerManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTPickerManager.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTPicker.h\"\n#import \"RCTFont.h\"\n\n@implementation RCTPickerManager\n\nRCT_EXPORT_MODULE()\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return NO;\n}\n\n- (NSView *)view\n{\n  return [RCTPicker new];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(items, NSArray<NSDictionary *>)\nRCT_EXPORT_VIEW_PROPERTY(selectedIndex, NSInteger)\nRCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(color, NSColor)\nRCT_EXPORT_VIEW_PROPERTY(textAlign, NSTextAlignment)\nRCT_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, RCTPicker)\n{\n  view.font = [RCTFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)];\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused RCTPicker)\n{\n  view.font = [RCTFont updateFont:view.font withWeight:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused RCTPicker)\n{\n  view.font = [RCTFont updateFont:view.font withStyle:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, RCTPicker)\n{\n  view.font = [RCTFont updateFont:view.font withFamily:json ?: defaultView.font.familyName];\n}\n\n//- (NSDictionary<NSString *, id> *)constantsToExport\n//{\n//  NSComboBox *view = [NSComboBox new];\n//  return @{\n//    @\"ComponentHeight\": @(view.intrinsicContentSize.height),\n//    @\"ComponentWidth\": @(view.intrinsicContentSize.width)\n//  };\n//}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTPointerEvents.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\ntypedef NS_ENUM(NSInteger, RCTPointerEvents) {\n  RCTPointerEventsUnspecified = 0, // Default\n  RCTPointerEventsNone,\n  RCTPointerEventsBoxNone,\n  RCTPointerEventsBoxOnly,\n};\n"
  },
  {
    "path": "React/Views/RCTProgressViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTProgressViewManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTProgressViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTProgressViewManager.h\"\n\n#import \"RCTConvert.h\"\n\n@implementation RCTConvert (RCTProgressViewManager)\n\n//RCT_ENUM_CONVERTER(UIProgressViewStyle, (@{\n//  @\"default\": @(UIProgressViewStyleDefault),\n//  @\"bar\": @(UIProgressViewStyleBar),\n//}), UIProgressViewStyleDefault, integerValue)\n\n@end\n\n@implementation RCTProgressViewManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  NSProgressIndicator *indicator = [NSProgressIndicator new];\n  [indicator setMinValue:0.0];\n  [indicator setMaxValue:1.0];\n  [indicator startAnimation:nil];\n  [indicator setIndeterminate:NO];\n  return indicator;\n\n}\n\nRCT_REMAP_VIEW_PROPERTY(progressTintColor, controlTint, NSColor)\n\n//RCT_EXPORT_VIEW_PROPERTY(trackTintColor, NSColor)\n//RCT_EXPORT_VIEW_PROPERTY(progressImage, NSImage)\n//RCT_EXPORT_VIEW_PROPERTY(trackImage, NSImage)\nRCT_CUSTOM_VIEW_PROPERTY(progress, BOOL, NSProgressIndicator)\n{\n  if (json) {\n    double progress = [json doubleValue];//NSNumber[RCTConvert double:json];\n    view.doubleValue = progress;\n  } else {\n    view.doubleValue = defaultView.doubleValue;\n  }\n}\n\n+ (BOOL)requiresMainQueueSetup\n{\n  return YES;\n}\n\n- (NSDictionary<NSString *, id> *)constantsToExport\n{\n  NSProgressIndicator *view = [NSProgressIndicator new];\n  return @{\n    @\"ComponentHeight\": @(view.intrinsicContentSize.height),\n  };\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTRefreshControl.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTRefreshControl.h\"\n\n#import \"RCTUtils.h\"\n\n@implementation RCTRefreshControl {\n  BOOL _isInitialRender;\n  BOOL _currentRefreshingState;\n  BOOL _refreshingProgrammatically;\n  NSString *_title;\n  UIColor *_titleColor;\n}\n\n- (instancetype)init\n{\n  if ((self = [super init])) {\n    [self addTarget:self action:@selector(refreshControlValueChanged) forControlEvents:UIControlEventValueChanged];\n    _isInitialRender = true;\n    _currentRefreshingState = false;\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (void)layoutSubviews\n{\n  [super layoutSubviews];\n\n  // Fix for bug #7976\n  // TODO: Remove when updating to use iOS 10 refreshControl UIScrollView prop.\n  if (self.backgroundColor == nil) {\n    self.backgroundColor = [UIColor clearColor];\n  }\n\n  // If the control is refreshing when mounted we need to call\n  // beginRefreshing in layoutSubview or it doesn't work.\n  if (_currentRefreshingState && _isInitialRender) {\n    [self beginRefreshing];\n  }\n  _isInitialRender = false;\n}\n\n- (void)beginRefreshingProgrammatically\n{\n  _refreshingProgrammatically = YES;\n  // When using begin refreshing we need to adjust the ScrollView content offset manually.\n  UIScrollView *scrollView = (UIScrollView *)self.superview;\n  CGPoint offset = {scrollView.contentOffset.x, scrollView.contentOffset.y - self.frame.size.height};\n\n  // `beginRefreshing` must be called after the animation is done. This is why it is impossible\n  // to use `setContentOffset` with `animated:YES`.\n  [UIView animateWithDuration:0.25\n                          delay:0\n                        options:UIViewAnimationOptionBeginFromCurrentState\n                     animations:^(void) {\n                       [scrollView setContentOffset:offset];\n                     } completion:^(__unused BOOL finished) {\n                       [super beginRefreshing];\n                     }];\n}\n\n- (void)endRefreshingProgrammatically\n{\n  // The contentOffset of the scrollview MUST be greater than 0 before calling\n  // endRefreshing otherwise the next pull to refresh will not work properly.\n  UIScrollView *scrollView = (UIScrollView *)self.superview;\n  if (_refreshingProgrammatically && scrollView.contentOffset.y < 0) {\n    CGPoint offset = {scrollView.contentOffset.x, 0};\n    [UIView animateWithDuration:0.25\n                          delay:0\n                        options:UIViewAnimationOptionBeginFromCurrentState\n                     animations:^(void) {\n                       [scrollView setContentOffset:offset];\n                     } completion:^(__unused BOOL finished) {\n                       [super endRefreshing];\n                     }];\n  } else {\n    [super endRefreshing];\n  }\n}\n\n- (NSString *)title\n{\n  return _title;\n}\n\n- (void)setTitle:(NSString *)title\n{\n  _title = title;\n  [self _updateTitle];\n}\n\n- (void)setTitleColor:(UIColor *)color\n{\n  _titleColor = color;\n  [self _updateTitle];\n}\n\n- (void)_updateTitle\n{\n  if (!_title) {\n    return;\n  }\n\n  NSMutableDictionary *attributes = [NSMutableDictionary dictionary];\n  if (_titleColor) {\n    attributes[NSForegroundColorAttributeName] = _titleColor;\n  }\n\n  self.attributedTitle = [[NSAttributedString alloc] initWithString:_title attributes:attributes];\n}\n\n- (void)setRefreshing:(BOOL)refreshing\n{\n  if (_currentRefreshingState != refreshing) {\n    _currentRefreshingState = refreshing;\n\n    if (refreshing) {\n      if (!_isInitialRender) {\n        [self beginRefreshingProgrammatically];\n      }\n    } else {\n      [self endRefreshingProgrammatically];\n    }\n  }\n}\n\n- (void)refreshControlValueChanged\n{\n  _currentRefreshingState = super.refreshing;\n  _refreshingProgrammatically = NO;\n\n  if (_onRefresh) {\n    _onRefresh(nil);\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTRefreshControlManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTRefreshControlManager.h\"\n\n#import \"RCTRefreshControl.h\"\n\n@implementation RCTRefreshControlManager\n\nRCT_EXPORT_MODULE()\n\n- (UIView *)view\n{\n  return [RCTRefreshControl new];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(onRefresh, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(refreshing, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor)\nRCT_EXPORT_VIEW_PROPERTY(title, NSString)\nRCT_EXPORT_VIEW_PROPERTY(titleColor, UIColor)\n\n@end\n"
  },
  {
    "path": "React/Views/RCTRootShadowView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTShadowView.h>\n#import <yoga/YGEnums.h>\n\n@interface RCTRootShadowView : RCTShadowView\n\n/**\n * Available size to layout all views.\n * Defaults to {INFINITY, INFINITY}\n */\n@property (nonatomic, assign) CGSize availableSize;\n\n/**\n * Layout direction (LTR or RTL) inherited from native environment and\n * is using as a base direction value in layout engine.\n * Defaults to value inferred from current locale.\n */\n@property (nonatomic, assign) YGDirection baseDirection;\n\n/**\n * Calculate all views whose frame needs updating after layout has been calculated.\n * Returns a set contains the shadowviews that need updating.\n */\n- (NSSet<RCTShadowView *> *)collectViewsWithUpdatedFrames;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTRootShadowView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTRootShadowView.h\"\n\n#import \"RCTI18nUtil.h\"\n\n@implementation RCTRootShadowView\n\n- (instancetype)init\n{\n  self = [super init];\n  if (self) {\n    _baseDirection = [[RCTI18nUtil sharedInstance] isRTL] ? YGDirectionRTL : YGDirectionLTR;\n    _availableSize = CGSizeMake(INFINITY, INFINITY);\n  }\n  return self;\n}\n\n- (NSSet<RCTShadowView *> *)collectViewsWithUpdatedFrames\n{\n  // Treating `INFINITY` as `YGUndefined` (which equals `NAN`).\n  float availableWidth = _availableSize.width == INFINITY ? YGUndefined : _availableSize.width;\n  float availableHeight = _availableSize.height == INFINITY ? YGUndefined : _availableSize.height;\n\n  YGNodeCalculateLayout(self.yogaNode, availableWidth, availableHeight, _baseDirection);\n\n  NSMutableSet<RCTShadowView *> *viewsWithNewFrame = [NSMutableSet set];\n  [self applyLayoutNode:self.yogaNode viewsWithNewFrame:viewsWithNewFrame absolutePosition:CGPointZero];\n  return viewsWithNewFrame;\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTSegmentedControl.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTComponent.h>\n\n@interface RCTSegmentedControl : NSSegmentedControl\n\n@property (nonatomic, copy) NSArray<NSString *> *values;\n@property (nonatomic, assign) NSInteger selectedIndex;\n@property (nonatomic, copy) RCTBubblingEventBlock onChange;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTSegmentedControl.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSegmentedControl.h\"\n\n#import \"RCTConvert.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"NSView+React.h\"\n\n@implementation RCTSegmentedControl\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if ((self = [super initWithFrame:frame])) {\n    _selectedIndex = self.selectedIndex;\n    [self setSegmentStyle:NSSegmentStyleRounded];\n    // TODO:\n\n//    [self addTarget:self action:@selector(didChange)\n//               forControlEvents:UIControlEventValueChanged];\n  }\n  return self;\n}\n\n- (void)setValues:(NSArray<NSString *> *)values\n{\n  _values = [values copy];\n  self.segmentCount = values.count;\n  for (NSUInteger i = 0; i < values.count; i++) {\n    //[self insertSegmentWithTitle:value atIndex:self.numberOfSegments animated:NO];\n    [self setLabel:[values objectAtIndex:i] forSegment:i];\n  }\n  self.selectedIndex = _selectedIndex;\n}\n\n- (void)setSelectedIndex:(NSInteger)selectedIndex\n{\n  _selectedIndex = selectedIndex;\n  [super setSelectedSegment:selectedIndex];\n}\n\n- (BOOL)isFlipped\n{\n  return YES;\n}\n\n- (void)didChange\n{\n  _selectedIndex = self.selectedIndex;\n  if (_onChange) {\n    _onChange(@{\n      @\"value\": [self labelForSegment:_selectedIndex],\n      @\"selectedSegmentIndex\": @(_selectedIndex)\n    });\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTSegmentedControlManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTSegmentedControlManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTSegmentedControlManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSegmentedControlManager.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTConvert.h\"\n#import \"RCTSegmentedControl.h\"\n\n@implementation RCTSegmentedControlManager\n\n// TODO: add styling\n\n//NSSegmentStyleAutomatic = 0,\n//NSSegmentStyleRounded = 1,\n//NSSegmentStyleTexturedRounded = 2,\n//NSSegmentStyleRoundRect = 3,\n//NSSegmentStyleTexturedSquare = 4,\n//NSSegmentStyleCapsule = 5,\n//NSSegmentStyleSmallSquare = 6,\n//NSSegmentStyleSeparated = 8,\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  return [RCTSegmentedControl new];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(values, NSArray<NSString *>)\nRCT_EXPORT_VIEW_PROPERTY(selectedIndex, NSInteger)\n//RCT_EXPORT_VIEW_PROPERTY(momentary, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(enabled, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)\n\n@end\n"
  },
  {
    "path": "React/Views/RCTShadowView+Internal.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTShadowView.h>\n\n@class RCTRootShadowView;\n\n@interface RCTShadowView (Internal)\n\n@property (nonatomic, weak, readwrite) RCTRootShadowView *rootView;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTShadowView+Internal.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTShadowView+Layout.h\"\n\n@interface RCTShadowView ()\n{\n  __weak RCTRootShadowView *_rootView;\n}\n\n@end\n\n@implementation RCTShadowView (Internal)\n\n- (void)setRootView:(RCTRootShadowView *)rootView\n{\n  _rootView = rootView;\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTShadowView+Layout.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTShadowView.h>\n\n/**\n * Converts float values between Yoga and CoreGraphics representations,\n * especially in terms of edge cases.\n */\nRCT_EXTERN float RCTYogaFloatFromCoreGraphicsFloat(CGFloat value);\nRCT_EXTERN CGFloat RCTCoreGraphicsFloatFromYogaFloat(float value);\n\n@interface RCTShadowView (Layout)\n\n#pragma mark - Computed Layout-Inferred Metrics\n\n@property (nonatomic, readonly) NSEdgeInsets paddingAsInsets;\n@property (nonatomic, readonly) NSEdgeInsets borderAsInsets;\n@property (nonatomic, readonly) NSEdgeInsets compoundInsets;\n@property (nonatomic, readonly) CGSize availableSize;\n\n#pragma mark - Measuring\n\n/**\n * Measures shadow view without side-effects.\n */\n- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize;\n\n#pragma mark - Dirty Propagation Control\n\n/**\n * Designated method to control dirty propagation mechanism.\n * Dirties the shadow view (and all affected shadow views, usually a superview)\n * in terms of layout.\n * The default implementaion does nothing.\n */\n- (void)dirtyLayout;\n\n/**\n * Designated method to control dirty propagation mechanism.\n * Clears (makes not dirty) the shadow view.\n * The default implementaion does nothing.\n */\n- (void)clearLayout;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTShadowView+Layout.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTShadowView+Layout.h\"\n\n#import <yoga/Yoga.h>\n\n/**\n * Yoga and CoreGraphics have different opinions about how \"infinity\" value\n * should be represented.\n * Yoga uses `NAN` which requires additional effort to compare all those values,\n * whereas GoreGraphics uses `GFLOAT_MAX` which can be easyly compared with\n * standard `==` operator.\n */\n\nfloat RCTYogaFloatFromCoreGraphicsFloat(CGFloat value)\n{\n  if (value == CGFLOAT_MAX || isnan(value) || isinf(value)) {\n    return YGUndefined;\n  }\n\n  return value;\n}\n\nCGFloat RCTCoreGraphicsFloatFromYogaFloat(float value)\n{\n  if (value == YGUndefined || isnan(value) || isinf(value)) {\n    return CGFLOAT_MAX;\n  }\n\n  return value;\n}\n\n@implementation RCTShadowView (Layout)\n\n#pragma mark - Computed Layout-Inferred Metrics\n\n- (NSEdgeInsets)paddingAsInsets\n{\n  YGNodeRef yogaNode = self.yogaNode;\n  return (NSEdgeInsets){\n    RCTCoreGraphicsFloatFromYogaFloat(YGNodeLayoutGetPadding(yogaNode, YGEdgeTop)),\n    RCTCoreGraphicsFloatFromYogaFloat(YGNodeLayoutGetPadding(yogaNode, YGEdgeLeft)),\n    RCTCoreGraphicsFloatFromYogaFloat(YGNodeLayoutGetPadding(yogaNode, YGEdgeBottom)),\n    RCTCoreGraphicsFloatFromYogaFloat(YGNodeLayoutGetPadding(yogaNode, YGEdgeRight))\n  };\n}\n\n- (NSEdgeInsets)borderAsInsets\n{\n  YGNodeRef yogaNode = self.yogaNode;\n  return (NSEdgeInsets){\n    RCTCoreGraphicsFloatFromYogaFloat(YGNodeLayoutGetBorder(yogaNode, YGEdgeTop)),\n    RCTCoreGraphicsFloatFromYogaFloat(YGNodeLayoutGetBorder(yogaNode, YGEdgeLeft)),\n    RCTCoreGraphicsFloatFromYogaFloat(YGNodeLayoutGetBorder(yogaNode, YGEdgeBottom)),\n    RCTCoreGraphicsFloatFromYogaFloat(YGNodeLayoutGetBorder(yogaNode, YGEdgeRight))\n  };\n}\n\n- (NSEdgeInsets)compoundInsets\n{\n  NSEdgeInsets borderAsInsets = self.borderAsInsets;\n  NSEdgeInsets paddingAsInsets = self.paddingAsInsets;\n\n  return (NSEdgeInsets){\n    borderAsInsets.top + paddingAsInsets.top,\n    borderAsInsets.left + paddingAsInsets.left,\n    borderAsInsets.bottom + paddingAsInsets.bottom,\n    borderAsInsets.right + paddingAsInsets.right\n  };\n}\n\nstatic inline CGRect NSEdgeInsetsInsetRect(CGRect rect, NSEdgeInsets insets) {\n  rect.origin.x    += insets.left;\n  rect.origin.y    += insets.top;\n  rect.size.width  -= (insets.left + insets.right);\n  rect.size.height -= (insets.top  + insets.bottom);\n  return rect;\n}\n\n- (NSSize)availableSize\n{\n  return  NSEdgeInsetsInsetRect((CGRect){CGPointZero, self.frame.size}, self.compoundInsets).size;\n}\n\n#pragma mark - Measuring\n\n- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize\n{\n  YGNodeRef clonnedYogaNode = YGNodeClone(self.yogaNode);\n  YGNodeRef constraintYogaNode = YGNodeNewWithConfig([[self class] yogaConfig]);\n\n  YGNodeInsertChild(constraintYogaNode, clonnedYogaNode, 0);\n\n  YGNodeStyleSetMinWidth(constraintYogaNode, RCTYogaFloatFromCoreGraphicsFloat(minimumSize.width));\n  YGNodeStyleSetMinHeight(constraintYogaNode, RCTYogaFloatFromCoreGraphicsFloat(minimumSize.height));\n  YGNodeStyleSetMaxWidth(constraintYogaNode, RCTYogaFloatFromCoreGraphicsFloat(maximumSize.width));\n  YGNodeStyleSetMaxHeight(constraintYogaNode, RCTYogaFloatFromCoreGraphicsFloat(maximumSize.height));\n\n  YGNodeCalculateLayout(\n    constraintYogaNode,\n    YGUndefined,\n    YGUndefined,\n    self.layoutDirection\n  );\n\n  CGSize measuredSize = (CGSize){\n    RCTCoreGraphicsFloatFromYogaFloat(YGNodeLayoutGetWidth(constraintYogaNode)),\n    RCTCoreGraphicsFloatFromYogaFloat(YGNodeLayoutGetHeight(constraintYogaNode)),\n  };\n\n  YGNodeRemoveChild(constraintYogaNode, clonnedYogaNode);\n  YGNodeFree(constraintYogaNode);\n  YGNodeFree(clonnedYogaNode);\n\n  return measuredSize;\n}\n\n#pragma mark - Dirty Propagation Control\n\n- (void)dirtyLayout\n{\n  // The default implementaion does nothing.\n}\n\n- (void)clearLayout\n{\n  // The default implementaion does nothing.\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTShadowView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTComponent.h>\n#import <React/RCTRootView.h>\n#import <yoga/Yoga.h>\n\n@class RCTRootShadowView;\n@class RCTSparseArray;\n\ntypedef NS_ENUM(NSUInteger, RCTUpdateLifecycle) {\n  RCTUpdateLifecycleUninitialized = 0,\n  RCTUpdateLifecycleComputed,\n  RCTUpdateLifecycleDirtied,\n};\n\ntypedef void (^RCTApplierBlock)(NSDictionary<NSNumber *, NSView *> *viewRegistry);\n\n/**\n * ShadowView tree mirrors RCT view tree. Every node is highly stateful.\n * 1. A node is in one of three lifecycles: uninitialized, computed, dirtied.\n * 1. RCTBridge may call any of the padding/margin/width/height/top/left setters. A setter would dirty\n *    the node and all of its ancestors.\n * 2. At the end of each Bridge transaction, we call collectUpdatedFrames:widthConstraint:heightConstraint\n *    at the root node to recursively lay out the entire hierarchy.\n * 3. If a node is \"computed\" and the constraint passed from above is identical to the constraint used to\n *    perform the last computation, we skip laying out the subtree entirely.\n */\n@interface RCTShadowView : NSObject <RCTComponent>\n\n/**\n * Yoga Config which will be used to create `yogaNode` property.\n * Override in subclass to enable special Yoga features.\n * Defaults to suitable to current device configuration.\n */\n+ (YGConfigRef)yogaConfig;\n\n/**\n * RCTComponent interface.\n */\n- (NSArray<RCTShadowView *> *)reactSubviews NS_REQUIRES_SUPER;\n- (RCTShadowView *)reactSuperview NS_REQUIRES_SUPER;\n- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex NS_REQUIRES_SUPER;\n- (void)removeReactSubview:(RCTShadowView *)subview NS_REQUIRES_SUPER;\n\n@property (nonatomic, weak, readonly) RCTRootShadowView *rootView;\n@property (nonatomic, weak, readonly) RCTShadowView *superview;\n@property (nonatomic, assign, readonly) YGNodeRef yogaNode;\n@property (nonatomic, copy) NSString *viewName;\n@property (nonatomic, copy) RCTDirectEventBlock onLayout;\n\n/**\n * In some cases we need a way to specify some environmental data to shadow view\n * to improve layout (or do something similar), so `localData` serves these needs.\n * For example, any stateful embedded native views may benefit from this.\n * Have in mind that this data is not supposed to interfere with the state of\n * the shadow view.\n * Please respect one-directional data flow of React.\n * Use `-[RCTUIManager setLocalData:forView:]` to set this property\n * (to provide local/environmental data for a shadow view) from the main thread.\n */\n- (void)setLocalData:(NSObject *)localData;\n\n/**\n * isNewView - Used to track the first time the view is introduced into the hierarchy.  It is initialized YES, then is\n * set to NO in RCTUIManager after the layout pass is done and all frames have been extracted to be applied to the\n * corresponding UIViews.\n */\n@property (nonatomic, assign, getter=isNewView) BOOL newView;\n\n/**\n * isHidden - RCTUIManager uses this to determine whether or not the UIView should be hidden. Useful if the\n * ShadowView determines that its UIView will be clipped and wants to hide it.\n */\n@property (nonatomic, assign, getter=isHidden) BOOL hidden;\n\n/**\n * Computed layout direction of the view.\n */\n@property (nonatomic, assign, readonly) NSUserInterfaceLayoutDirection layoutDirection;\n\n/**\n * Position and dimensions.\n * Defaults to { 0, 0, NAN, NAN }.\n */\n@property (nonatomic, assign) YGValue top;\n@property (nonatomic, assign) YGValue left;\n@property (nonatomic, assign) YGValue bottom;\n@property (nonatomic, assign) YGValue right;\n@property (nonatomic, assign) YGValue start;\n@property (nonatomic, assign) YGValue end;\n\n@property (nonatomic, assign) YGValue width;\n@property (nonatomic, assign) YGValue height;\n\n@property (nonatomic, assign) YGValue minWidth;\n@property (nonatomic, assign) YGValue maxWidth;\n@property (nonatomic, assign) YGValue minHeight;\n@property (nonatomic, assign) YGValue maxHeight;\n\n/**\n * Convenient alias to `width` and `height` in pixels.\n * Defaults to NAN in case of non-pixel dimention.\n */\n@property (nonatomic, assign) CGSize size;\n\n/**\n * Border. Defaults to { 0, 0, 0, 0 }.\n */\n@property (nonatomic, assign) float borderWidth;\n@property (nonatomic, assign) float borderTopWidth;\n@property (nonatomic, assign) float borderLeftWidth;\n@property (nonatomic, assign) float borderBottomWidth;\n@property (nonatomic, assign) float borderRightWidth;\n@property (nonatomic, assign) float borderStartWidth;\n@property (nonatomic, assign) float borderEndWidth;\n\n/**\n * Margin. Defaults to { 0, 0, 0, 0 }.\n */\n@property (nonatomic, assign) YGValue margin;\n@property (nonatomic, assign) YGValue marginVertical;\n@property (nonatomic, assign) YGValue marginHorizontal;\n@property (nonatomic, assign) YGValue marginTop;\n@property (nonatomic, assign) YGValue marginLeft;\n@property (nonatomic, assign) YGValue marginBottom;\n@property (nonatomic, assign) YGValue marginRight;\n@property (nonatomic, assign) YGValue marginStart;\n@property (nonatomic, assign) YGValue marginEnd;\n\n/**\n * Padding. Defaults to { 0, 0, 0, 0 }.\n */\n@property (nonatomic, assign) YGValue padding;\n@property (nonatomic, assign) YGValue paddingVertical;\n@property (nonatomic, assign) YGValue paddingHorizontal;\n@property (nonatomic, assign) YGValue paddingTop;\n@property (nonatomic, assign) YGValue paddingLeft;\n@property (nonatomic, assign) YGValue paddingBottom;\n@property (nonatomic, assign) YGValue paddingRight;\n@property (nonatomic, assign) YGValue paddingStart;\n@property (nonatomic, assign) YGValue paddingEnd;\n\n/**\n * Flexbox properties. All zero/disabled by default\n */\n@property (nonatomic, assign) YGFlexDirection flexDirection;\n@property (nonatomic, assign) YGJustify justifyContent;\n@property (nonatomic, assign) YGAlign alignSelf;\n@property (nonatomic, assign) YGAlign alignItems;\n@property (nonatomic, assign) YGAlign alignContent;\n@property (nonatomic, assign) YGPositionType position;\n@property (nonatomic, assign) YGWrap flexWrap;\n@property (nonatomic, assign) YGDisplay display;\n\n@property (nonatomic, assign) float flex;\n@property (nonatomic, assign) float flexGrow;\n@property (nonatomic, assign) float flexShrink;\n@property (nonatomic, assign) YGValue flexBasis;\n\n@property (nonatomic, assign) float aspectRatio;\n\n/**\n * Interface direction (LTR or RTL)\n */\n@property (nonatomic, assign) YGDirection direction;\n\n/**\n * Clipping properties\n */\n@property (nonatomic, assign) YGOverflow overflow;\n\n/**\n * Computed position of the view.\n */\n@property (nonatomic, assign, readonly) CGRect frame;\n\n/**\n * Represents the natural size of the view, which is used when explicit size is not set or is ambiguous.\n * Defaults to `{UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric}`.\n */\n@property (nonatomic, assign) CGSize intrinsicContentSize;\n\n/**\n * Calculate property changes that need to be propagated to the view.\n * The applierBlocks set contains RCTApplierBlock functions that must be applied\n * on the main thread in order to update the view.\n */\n- (void)collectUpdatedProperties:(NSMutableSet<RCTApplierBlock> *)applierBlocks\n                parentProperties:(NSDictionary<NSString *, id> *)parentProperties;\n\n/**\n * Process the updated properties and apply them to view. Shadow view classes\n * that add additional propagating properties should override this method.\n */\n- (NSDictionary<NSString *, id> *)processUpdatedProperties:(NSMutableSet<RCTApplierBlock> *)applierBlocks\n                                          parentProperties:(NSDictionary<NSString *, id> *)parentProperties NS_REQUIRES_SUPER;\n\n/**\n * Can be called by a parent on a child in order to calculate all views whose frame needs\n * updating in that branch. Adds these frames to `viewsWithNewFrame`. Useful if layout\n * enters a view where flex doesn't apply (e.g. Text) and then you want to resume flex\n * layout on a subview.\n */\n- (void)collectUpdatedFrames:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame\n                   withFrame:(CGRect)frame\n                      hidden:(BOOL)hidden\n            absolutePosition:(CGPoint)absolutePosition;\n\n/**\n * Apply the CSS layout.\n * This method also calls `applyLayoutToChildren:` internally. The functionality\n * is split into two methods so subclasses can override `applyLayoutToChildren:`\n * while using default implementation of `applyLayoutNode:`.\n */\n- (void)applyLayoutNode:(YGNodeRef)node\n      viewsWithNewFrame:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame\n       absolutePosition:(CGPoint)absolutePosition NS_REQUIRES_SUPER;\n\n/**\n * Enumerate the child nodes and tell them to apply layout.\n */\n- (void)applyLayoutToChildren:(YGNodeRef)node\n            viewsWithNewFrame:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame\n             absolutePosition:(CGPoint)absolutePosition;\n\n/**\n * Returns whether or not this view can have any subviews.\n * Adding/inserting a child view to leaf view (`canHaveSubviews` equals `NO`)\n * will throw an error.\n * Return `NO` for components which must not have any descendants\n * (like <Image>, for example.)\n * Defaults to `YES`. Can be overridden in subclasses.\n * Don't confuse this with `isYogaLeafNode`.\n */\n- (BOOL)canHaveSubviews;\n\n/**\n * Returns whether or not this node acts as a leaf node in the eyes of Yoga.\n * For example `RCTTextShadowView` has children which it does not want Yoga\n * to lay out so in the eyes of Yoga it is a leaf node.\n * Defaults to `NO`. Can be overridden in subclasses.\n * Don't confuse this with `canHaveSubviews`.\n */\n- (BOOL)isYogaLeafNode;\n\n- (void)dirtyPropagation NS_REQUIRES_SUPER;\n- (BOOL)isPropagationDirty;\n\n- (void)dirtyText NS_REQUIRES_SUPER;\n- (void)setTextComputed NS_REQUIRES_SUPER;\n- (BOOL)isTextDirty;\n\n/**\n * As described in RCTComponent protocol.\n */\n- (void)didUpdateReactSubviews NS_REQUIRES_SUPER;\n- (void)didSetProps:(NSArray<NSString *> *)changedProps NS_REQUIRES_SUPER;\n\n/**\n * Computes the recursive offset, meaning the sum of all descendant offsets -\n * this is the sum of all positions inset from parents. This is not merely the\n * sum of `top`/`left`s, as this function uses the *actual* positions of\n * children, not the style specified positions - it computes this based on the\n * resulting layout. It does not yet compensate for native scroll view insets or\n * transforms or anchor points.\n */\n- (CGRect)measureLayoutRelativeToAncestor:(RCTShadowView *)ancestor;\n\n/**\n * Checks if the current shadow view is a descendant of the provided `ancestor`\n */\n- (BOOL)viewIsDescendantOf:(RCTShadowView *)ancestor;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTShadowView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTShadowView.h\"\n\n#import \"RCTConvert.h\"\n#import \"RCTI18nUtil.h\"\n#import \"RCTLog.h\"\n#import \"RCTUtils.h\"\n#import \"NSView+Private.h\"\n#import \"NSView+React.h\"\n\ntypedef void (^RCTActionBlock)(RCTShadowView *shadowViewSelf, id value);\ntypedef void (^RCTResetActionBlock)(RCTShadowView *shadowViewSelf);\n\ntypedef NS_ENUM(unsigned int, meta_prop_t) {\n  META_PROP_LEFT,\n  META_PROP_TOP,\n  META_PROP_RIGHT,\n  META_PROP_BOTTOM,\n  META_PROP_START,\n  META_PROP_END,\n  META_PROP_HORIZONTAL,\n  META_PROP_VERTICAL,\n  META_PROP_ALL,\n  META_PROP_COUNT,\n};\n\n@implementation RCTShadowView\n{\n  RCTUpdateLifecycle _propagationLifecycle;\n  RCTUpdateLifecycle _textLifecycle;\n  NSDictionary *_lastParentProperties;\n  NSMutableArray<RCTShadowView *> *_reactSubviews;\n  BOOL _recomputePadding;\n  BOOL _recomputeMargin;\n  BOOL _recomputeBorder;\n  YGValue _paddingMetaProps[META_PROP_COUNT];\n  YGValue _marginMetaProps[META_PROP_COUNT];\n  YGValue _borderMetaProps[META_PROP_COUNT];\n}\n\n+ (YGConfigRef)yogaConfig\n{\n  static YGConfigRef yogaConfig;\n  static dispatch_once_t onceToken;\n  dispatch_once(&onceToken, ^{\n    yogaConfig = YGConfigNew();\n    // Turnig off pixel rounding.\n    YGConfigSetPointScaleFactor(yogaConfig, 0.0);\n    YGConfigSetUseLegacyStretchBehaviour(yogaConfig, true);\n  });\n  return yogaConfig;\n}\n\n@synthesize reactTag = _reactTag;\n\n// YogaNode API\n\nstatic void RCTPrint(YGNodeRef node)\n{\n  RCTShadowView *shadowView = (__bridge RCTShadowView *)YGNodeGetContext(node);\n  printf(\"%s(%lld), \", shadowView.viewName.UTF8String, (long long)shadowView.reactTag.integerValue);\n}\n\n#define RCT_SET_YGVALUE(ygvalue, setter, ...)    \\\nswitch (ygvalue.unit) {                          \\\n  case YGUnitAuto:                               \\\n  case YGUnitUndefined:                          \\\n    setter(__VA_ARGS__, YGUndefined);            \\\n    break;                                       \\\n  case YGUnitPoint:                              \\\n    setter(__VA_ARGS__, ygvalue.value);          \\\n    break;                                       \\\n  case YGUnitPercent:                            \\\n    setter##Percent(__VA_ARGS__, ygvalue.value); \\\n    break;                                       \\\n}\n\n#define RCT_SET_YGVALUE_AUTO(ygvalue, setter, ...) \\\nswitch (ygvalue.unit) {                            \\\n  case YGUnitAuto:                                 \\\n    setter##Auto(__VA_ARGS__);                     \\\n    break;                                         \\\n  case YGUnitUndefined:                            \\\n    setter(__VA_ARGS__, YGUndefined);              \\\n    break;                                         \\\n  case YGUnitPoint:                                \\\n    setter(__VA_ARGS__, ygvalue.value);            \\\n    break;                                         \\\n  case YGUnitPercent:                              \\\n    setter##Percent(__VA_ARGS__, ygvalue.value);   \\\n    break;                                         \\\n}\n\nstatic void RCTProcessMetaPropsPadding(const YGValue metaProps[META_PROP_COUNT], YGNodeRef node) {\n  if (![[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL]) {\n    RCT_SET_YGVALUE(metaProps[META_PROP_START], YGNodeStyleSetPadding, node, YGEdgeStart);\n    RCT_SET_YGVALUE(metaProps[META_PROP_END], YGNodeStyleSetPadding, node, YGEdgeEnd);\n    RCT_SET_YGVALUE(metaProps[META_PROP_LEFT], YGNodeStyleSetPadding, node, YGEdgeLeft);\n    RCT_SET_YGVALUE(metaProps[META_PROP_RIGHT], YGNodeStyleSetPadding, node, YGEdgeRight);\n  } else {\n    YGValue start = metaProps[META_PROP_START].unit == YGUnitUndefined ? metaProps[META_PROP_LEFT] : metaProps[META_PROP_START];\n    YGValue end = metaProps[META_PROP_END].unit == YGUnitUndefined ? metaProps[META_PROP_RIGHT] : metaProps[META_PROP_END];\n    RCT_SET_YGVALUE(start, YGNodeStyleSetPadding, node, YGEdgeStart);\n    RCT_SET_YGVALUE(end, YGNodeStyleSetPadding, node, YGEdgeEnd);\n  }\n  RCT_SET_YGVALUE(metaProps[META_PROP_TOP], YGNodeStyleSetPadding, node, YGEdgeTop);\n  RCT_SET_YGVALUE(metaProps[META_PROP_BOTTOM], YGNodeStyleSetPadding, node, YGEdgeBottom);\n  RCT_SET_YGVALUE(metaProps[META_PROP_HORIZONTAL], YGNodeStyleSetPadding, node, YGEdgeHorizontal);\n  RCT_SET_YGVALUE(metaProps[META_PROP_VERTICAL], YGNodeStyleSetPadding, node, YGEdgeVertical);\n  RCT_SET_YGVALUE(metaProps[META_PROP_ALL], YGNodeStyleSetPadding, node, YGEdgeAll);\n}\n\nstatic void RCTProcessMetaPropsMargin(const YGValue metaProps[META_PROP_COUNT], YGNodeRef node) {\n  if (![[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL]) {\n    RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_START], YGNodeStyleSetMargin, node, YGEdgeStart);\n    RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_END], YGNodeStyleSetMargin, node, YGEdgeEnd);\n    RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_LEFT], YGNodeStyleSetMargin, node, YGEdgeLeft);\n    RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_RIGHT], YGNodeStyleSetMargin, node, YGEdgeRight);\n  } else {\n    YGValue start = metaProps[META_PROP_START].unit == YGUnitUndefined ? metaProps[META_PROP_LEFT] : metaProps[META_PROP_START];\n    YGValue end = metaProps[META_PROP_END].unit == YGUnitUndefined ? metaProps[META_PROP_RIGHT] : metaProps[META_PROP_END];\n    RCT_SET_YGVALUE_AUTO(start, YGNodeStyleSetMargin, node, YGEdgeStart);\n    RCT_SET_YGVALUE_AUTO(end, YGNodeStyleSetMargin, node, YGEdgeEnd);\n  }\n  RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_TOP], YGNodeStyleSetMargin, node, YGEdgeTop);\n  RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_BOTTOM], YGNodeStyleSetMargin, node, YGEdgeBottom);\n  RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_HORIZONTAL], YGNodeStyleSetMargin, node, YGEdgeHorizontal);\n  RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_VERTICAL], YGNodeStyleSetMargin, node, YGEdgeVertical);\n  RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_ALL], YGNodeStyleSetMargin, node, YGEdgeAll);\n}\n\nstatic void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT], YGNodeRef node) {\n  if (![[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL]) {\n    YGNodeStyleSetBorder(node, YGEdgeStart, metaProps[META_PROP_START].value);\n    YGNodeStyleSetBorder(node, YGEdgeEnd, metaProps[META_PROP_END].value);\n    YGNodeStyleSetBorder(node, YGEdgeLeft, metaProps[META_PROP_LEFT].value);\n    YGNodeStyleSetBorder(node, YGEdgeRight, metaProps[META_PROP_RIGHT].value);\n  } else {\n    const float start = YGFloatIsUndefined(metaProps[META_PROP_START].value) ? metaProps[META_PROP_LEFT].value : metaProps[META_PROP_START].value;\n    const float end = YGFloatIsUndefined(metaProps[META_PROP_END].value) ? metaProps[META_PROP_RIGHT].value : metaProps[META_PROP_END].value;\n    YGNodeStyleSetBorder(node, YGEdgeStart, start);\n    YGNodeStyleSetBorder(node, YGEdgeEnd, end);\n  }\n  YGNodeStyleSetBorder(node, YGEdgeTop, metaProps[META_PROP_TOP].value);\n  YGNodeStyleSetBorder(node, YGEdgeBottom, metaProps[META_PROP_BOTTOM].value);\n  YGNodeStyleSetBorder(node, YGEdgeHorizontal, metaProps[META_PROP_HORIZONTAL].value);\n  YGNodeStyleSetBorder(node, YGEdgeVertical, metaProps[META_PROP_VERTICAL].value);\n  YGNodeStyleSetBorder(node, YGEdgeAll, metaProps[META_PROP_ALL].value);\n}\n\n// The absolute stuff is so that we can take into account our absolute position when rounding in order to\n// snap to the pixel grid. For example, say you have the following structure:\n//\n// +--------+---------+--------+\n// |        |+-------+|        |\n// |        ||       ||        |\n// |        |+-------+|        |\n// +--------+---------+--------+\n//\n// Say the screen width is 320 pts so the three big views will get the following x bounds from our layout system:\n// {0, 106.667}, {106.667, 213.333}, {213.333, 320}\n//\n// Assuming screen scale is 2, these numbers must be rounded to the nearest 0.5 to fit the pixel grid:\n// {0, 106.5}, {106.5, 213.5}, {213.5, 320}\n// You'll notice that the three widths are 106.5, 107, 106.5.\n//\n// This is great for the parent views but it gets trickier when we consider rounding for the subview.\n//\n// When we go to round the bounds for the subview in the middle, it's relative bounds are {0, 106.667}\n// which gets rounded to {0, 106.5}. This will cause the subview to be one pixel smaller than it should be.\n// this is why we need to pass in the absolute position in order to do the rounding relative to the screen's\n// grid rather than the view's grid.\n//\n// After passing in the absolutePosition of {106.667, y}, we do the following calculations:\n// absoluteLeft = round(absolutePosition.x + viewPosition.left) = round(106.667 + 0) = 106.5\n// absoluteRight = round(absolutePosition.x + viewPosition.left + viewSize.left) + round(106.667 + 0 + 106.667) = 213.5\n// width = 213.5 - 106.5 = 107\n// You'll notice that this is the same width we calculated for the parent view because we've taken its position into account.\n\n- (void)applyLayoutNode:(YGNodeRef)node\n      viewsWithNewFrame:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame\n       absolutePosition:(CGPoint)absolutePosition\n{\n  if (!YGNodeGetHasNewLayout(node)) {\n    return;\n  }\n\n  RCTAssert(!YGNodeIsDirty(node), @\"Attempt to get layout metrics from dirtied Yoga node.\");\n\n  YGNodeSetHasNewLayout(node, false);\n\n  if (YGNodeStyleGetDisplay(node) == YGDisplayNone) {\n    // If the node is hidden (has `display: none;`), its (and its descendants)\n    // layout metrics are invalid and/or dirtied, so we have to stop here.\n    return;\n  }\n\n#if RCT_DEBUG\n  // This works around a breaking change in Yoga layout where setting flexBasis needs to be set explicitly, instead of relying on flex to propagate.\n  // We check for it by seeing if a width/height is provided along with a flexBasis of 0 and the width/height is laid out as 0.\n  if (YGNodeStyleGetFlexBasis(node).unit == YGUnitPoint && YGNodeStyleGetFlexBasis(node).value == 0 &&\n      ((YGNodeStyleGetWidth(node).unit == YGUnitPoint && YGNodeStyleGetWidth(node).value > 0 && YGNodeLayoutGetWidth(node) == 0) ||\n      (YGNodeStyleGetHeight(node).unit == YGUnitPoint && YGNodeStyleGetHeight(node).value > 0 && YGNodeLayoutGetHeight(node) == 0))) {\n    RCTLogError(@\"View was rendered with explicitly set width/height but with a 0 flexBasis. (This might be fixed by changing flex: to flexGrow:) View: %@\", self);\n  }\n#endif\n\n  CGPoint absoluteTopLeft = {\n    absolutePosition.x + YGNodeLayoutGetLeft(node),\n    absolutePosition.y + YGNodeLayoutGetTop(node)\n  };\n\n  CGPoint absoluteBottomRight = {\n    absolutePosition.x + YGNodeLayoutGetLeft(node) + YGNodeLayoutGetWidth(node),\n    absolutePosition.y + YGNodeLayoutGetTop(node) + YGNodeLayoutGetHeight(node)\n  };\n\n  CGRect frame = {{\n    RCTRoundPixelValue(YGNodeLayoutGetLeft(node)),\n    RCTRoundPixelValue(YGNodeLayoutGetTop(node)),\n  }, {\n    RCTRoundPixelValue(absoluteBottomRight.x - absoluteTopLeft.x),\n    RCTRoundPixelValue(absoluteBottomRight.y - absoluteTopLeft.y)\n  }};\n\n  // Even if `YGNodeLayoutGetDirection` can return `YGDirectionInherit` here, it actually means\n  // that Yoga will use LTR layout for the view (even if layout process is not finished yet).\n  NSUserInterfaceLayoutDirection updatedLayoutDirection = YGNodeLayoutGetDirection(_yogaNode) == YGDirectionRTL ? NSUserInterfaceLayoutDirectionRightToLeft : NSUserInterfaceLayoutDirectionLeftToRight;\n\n  if (!CGRectEqualToRect(frame, _frame) || _layoutDirection != updatedLayoutDirection) {\n    _frame = frame;\n    _layoutDirection = updatedLayoutDirection;\n    [viewsWithNewFrame addObject:self];\n  }\n\n  absolutePosition.x += YGNodeLayoutGetLeft(node);\n  absolutePosition.y += YGNodeLayoutGetTop(node);\n\n  [self applyLayoutToChildren:node viewsWithNewFrame:viewsWithNewFrame absolutePosition:absolutePosition];\n}\n\n- (void)applyLayoutToChildren:(YGNodeRef)node\n            viewsWithNewFrame:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame\n             absolutePosition:(CGPoint)absolutePosition\n{\n  for (unsigned int i = 0; i < YGNodeGetChildCount(node); ++i) {\n    RCTShadowView *child = (RCTShadowView *)_reactSubviews[i];\n    [child applyLayoutNode:YGNodeGetChild(node, i)\n         viewsWithNewFrame:viewsWithNewFrame\n          absolutePosition:absolutePosition];\n  }\n}\n\n- (NSDictionary<NSString *, id> *)processUpdatedProperties:(NSMutableSet<RCTApplierBlock> *)applierBlocks\n                                          parentProperties:(NSDictionary<NSString *, id> *)parentProperties\n{\n  return parentProperties;\n}\n\n- (void)collectUpdatedProperties:(NSMutableSet<RCTApplierBlock> *)applierBlocks\n                parentProperties:(NSDictionary<NSString *, id> *)parentProperties\n{\n  if (_propagationLifecycle == RCTUpdateLifecycleComputed && [parentProperties isEqualToDictionary:_lastParentProperties]) {\n    return;\n  }\n  _propagationLifecycle = RCTUpdateLifecycleComputed;\n  _lastParentProperties = parentProperties;\n  NSDictionary<NSString *, id> *nextProps = [self processUpdatedProperties:applierBlocks parentProperties:parentProperties];\n  for (RCTShadowView *child in _reactSubviews) {\n    [child collectUpdatedProperties:applierBlocks parentProperties:nextProps];\n  }\n}\n\n- (void)collectUpdatedFrames:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame\n                   withFrame:(CGRect)frame\n                      hidden:(BOOL)hidden\n            absolutePosition:(CGPoint)absolutePosition\n{\n  // This is not the core layout method. It is only used by RCTTextShadowView to layout\n  // nested views.\n\n  if (_hidden != hidden) {\n    // The hidden state has changed. Even if the frame hasn't changed, add\n    // this ShadowView to viewsWithNewFrame so the UIManager will process\n    // this ShadowView's UIView and update its hidden state.\n    _hidden = hidden;\n    [viewsWithNewFrame addObject:self];\n  }\n\n  if (!CGRectEqualToRect(frame, _frame)) {\n    YGNodeStyleSetPositionType(_yogaNode, YGPositionTypeAbsolute);\n    YGNodeStyleSetWidth(_yogaNode, frame.size.width);\n    YGNodeStyleSetHeight(_yogaNode, frame.size.height);\n    YGNodeStyleSetPosition(_yogaNode, YGEdgeLeft, frame.origin.x);\n    YGNodeStyleSetPosition(_yogaNode, YGEdgeTop, frame.origin.y);\n  }\n\n  YGNodeCalculateLayout(_yogaNode, frame.size.width, frame.size.height, YGDirectionInherit);\n  [self applyLayoutNode:_yogaNode viewsWithNewFrame:viewsWithNewFrame absolutePosition:absolutePosition];\n}\n\n- (CGRect)measureLayoutRelativeToAncestor:(RCTShadowView *)ancestor\n{\n  CGPoint offset = CGPointZero;\n  NSInteger depth = 30; // max depth to search\n  RCTShadowView *shadowView = self;\n  while (depth && shadowView && shadowView != ancestor) {\n    offset.x += shadowView.frame.origin.x;\n    offset.y += shadowView.frame.origin.y;\n    shadowView = shadowView->_superview;\n    depth--;\n  }\n  if (ancestor != shadowView) {\n    return CGRectNull;\n  }\n  return (CGRect){offset, self.frame.size};\n}\n\n- (BOOL)viewIsDescendantOf:(RCTShadowView *)ancestor\n{\n  NSInteger depth = 30; // max depth to search\n  RCTShadowView *shadowView = self;\n  while (depth && shadowView && shadowView != ancestor) {\n    shadowView = shadowView->_superview;\n    depth--;\n  }\n  return ancestor == shadowView;\n}\n\n- (instancetype)init\n{\n  if ((self = [super init])) {\n    _frame = CGRectMake(0, 0, YGUndefined, YGUndefined);\n\n    for (unsigned int ii = 0; ii < META_PROP_COUNT; ii++) {\n      _paddingMetaProps[ii] = YGValueUndefined;\n      _marginMetaProps[ii] = YGValueUndefined;\n      _borderMetaProps[ii] = YGValueUndefined;\n    }\n\n    _intrinsicContentSize = CGSizeMake(NSViewNoIntrinsicMetric, NSViewNoIntrinsicMetric);\n\n    _newView = YES;\n    _propagationLifecycle = RCTUpdateLifecycleUninitialized;\n    _textLifecycle = RCTUpdateLifecycleUninitialized;\n\n    _reactSubviews = [NSMutableArray array];\n\n    _yogaNode = YGNodeNewWithConfig([[self class] yogaConfig]);\n     YGNodeSetContext(_yogaNode, (__bridge void *)self);\n     YGNodeSetPrintFunc(_yogaNode, RCTPrint);\n  }\n  return self;\n}\n\n- (BOOL)isReactRootView\n{\n  return RCTIsReactRootView(self.reactTag);\n}\n\n- (void)dealloc\n{\n  YGNodeFree(_yogaNode);\n}\n\n- (BOOL)canHaveSubviews\n{\n  return YES;\n}\n\n- (BOOL)isYogaLeafNode\n{\n  return NO;\n}\n\n- (void)dirtyPropagation\n{\n  if (_propagationLifecycle != RCTUpdateLifecycleDirtied) {\n    _propagationLifecycle = RCTUpdateLifecycleDirtied;\n    [_superview dirtyPropagation];\n  }\n}\n\n- (BOOL)isPropagationDirty\n{\n  return _propagationLifecycle != RCTUpdateLifecycleComputed;\n}\n\n- (void)dirtyText\n{\n  if (_textLifecycle != RCTUpdateLifecycleDirtied) {\n    _textLifecycle = RCTUpdateLifecycleDirtied;\n    [_superview dirtyText];\n  }\n}\n\n- (BOOL)isTextDirty\n{\n  return _textLifecycle != RCTUpdateLifecycleComputed;\n}\n\n- (void)setTextComputed\n{\n  _textLifecycle = RCTUpdateLifecycleComputed;\n}\n\n- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex\n{\n  RCTAssert(self.canHaveSubviews, @\"Attempt to insert subview inside leaf view.\");\n\n  [_reactSubviews insertObject:subview atIndex:atIndex];\n  if (![self isYogaLeafNode]) {\n    YGNodeInsertChild(_yogaNode, subview.yogaNode, (uint32_t)atIndex);\n  }\n  subview->_superview = self;\n  [self dirtyText];\n  [self dirtyPropagation];\n}\n\n- (void)removeReactSubview:(RCTShadowView *)subview\n{\n  [subview dirtyText];\n  [subview dirtyPropagation];\n  subview->_superview = nil;\n  [_reactSubviews removeObject:subview];\n  if (![self isYogaLeafNode]) {\n    YGNodeRemoveChild(_yogaNode, subview.yogaNode);\n  }\n}\n\n- (NSArray<RCTShadowView *> *)reactSubviews\n{\n  return _reactSubviews;\n}\n\n- (RCTShadowView *)reactSuperview\n{\n  return _superview;\n}\n\n- (NSNumber *)reactTagAtPoint:(CGPoint)point\n{\n  for (RCTShadowView *shadowView in _reactSubviews) {\n    if (CGRectContainsPoint(shadowView.frame, point)) {\n      CGPoint relativePoint = point;\n      CGPoint origin = shadowView.frame.origin;\n      relativePoint.x -= origin.x;\n      relativePoint.y -= origin.y;\n      return [shadowView reactTagAtPoint:relativePoint];\n    }\n  }\n  return self.reactTag;\n}\n\n- (NSString *)description\n{\n  NSString *description = super.description;\n  description = [[description substringToIndex:description.length - 1]\n                 stringByAppendingFormat:@\"; viewName: %@; reactTag: %@; frame: %f; %f;>\",\n                 self.viewName, self.reactTag, self.frame.size.height, self.frame.size.width];\n  return description;\n}\n\n- (void)addRecursiveDescriptionToString:(NSMutableString *)string atLevel:(NSUInteger)level\n{\n  for (NSUInteger i = 0; i < level; i++) {\n    [string appendString:@\"  | \"];\n  }\n\n  [string appendString:self.description];\n  [string appendString:@\"\\n\"];\n\n  for (RCTShadowView *subview in _reactSubviews) {\n    [subview addRecursiveDescriptionToString:string atLevel:level + 1];\n  }\n}\n\n- (NSString *)recursiveDescription\n{\n  NSMutableString *description = [NSMutableString string];\n  [self addRecursiveDescriptionToString:description atLevel:0];\n  return description;\n}\n\n// Margin\n\n#define RCT_MARGIN_PROPERTY(prop, metaProp)       \\\n- (void)setMargin##prop:(YGValue)value            \\\n{                                                 \\\n  _marginMetaProps[META_PROP_##metaProp] = value; \\\n  _recomputeMargin = YES;                         \\\n}                                                 \\\n- (YGValue)margin##prop                           \\\n{                                                 \\\n  return _marginMetaProps[META_PROP_##metaProp];  \\\n}\n\nRCT_MARGIN_PROPERTY(, ALL)\nRCT_MARGIN_PROPERTY(Vertical, VERTICAL)\nRCT_MARGIN_PROPERTY(Horizontal, HORIZONTAL)\nRCT_MARGIN_PROPERTY(Top, TOP)\nRCT_MARGIN_PROPERTY(Left, LEFT)\nRCT_MARGIN_PROPERTY(Bottom, BOTTOM)\nRCT_MARGIN_PROPERTY(Right, RIGHT)\nRCT_MARGIN_PROPERTY(Start, START)\nRCT_MARGIN_PROPERTY(End, END)\n\n// Padding\n\n#define RCT_PADDING_PROPERTY(prop, metaProp)       \\\n- (void)setPadding##prop:(YGValue)value            \\\n{                                                  \\\n  _paddingMetaProps[META_PROP_##metaProp] = value; \\\n  _recomputePadding = YES;                         \\\n}                                                  \\\n- (YGValue)padding##prop                           \\\n{                                                  \\\n  return _paddingMetaProps[META_PROP_##metaProp];  \\\n}\n\nRCT_PADDING_PROPERTY(, ALL)\nRCT_PADDING_PROPERTY(Vertical, VERTICAL)\nRCT_PADDING_PROPERTY(Horizontal, HORIZONTAL)\nRCT_PADDING_PROPERTY(Top, TOP)\nRCT_PADDING_PROPERTY(Left, LEFT)\nRCT_PADDING_PROPERTY(Bottom, BOTTOM)\nRCT_PADDING_PROPERTY(Right, RIGHT)\nRCT_PADDING_PROPERTY(Start, START)\nRCT_PADDING_PROPERTY(End, END)\n\n// Border\n\n#define RCT_BORDER_PROPERTY(prop, metaProp)             \\\n- (void)setBorder##prop##Width:(float)value             \\\n{                                                       \\\n  _borderMetaProps[META_PROP_##metaProp].value = value; \\\n  _recomputeBorder = YES;                               \\\n}                                                       \\\n- (float)border##prop##Width                            \\\n{                                                       \\\n  return _borderMetaProps[META_PROP_##metaProp].value;  \\\n}\n\nRCT_BORDER_PROPERTY(, ALL)\nRCT_BORDER_PROPERTY(Top, TOP)\nRCT_BORDER_PROPERTY(Left, LEFT)\nRCT_BORDER_PROPERTY(Bottom, BOTTOM)\nRCT_BORDER_PROPERTY(Right, RIGHT)\nRCT_BORDER_PROPERTY(Start, START)\nRCT_BORDER_PROPERTY(End, END)\n\n// Dimensions\n#define RCT_DIMENSION_PROPERTY(setProp, getProp, cssProp)           \\\n- (void)set##setProp:(YGValue)value                                 \\\n{                                                                   \\\n  RCT_SET_YGVALUE_AUTO(value, YGNodeStyleSet##cssProp, _yogaNode);  \\\n  [self dirtyText];                                                 \\\n}                                                                   \\\n- (YGValue)getProp                                                  \\\n{                                                                   \\\n  return YGNodeStyleGet##cssProp(_yogaNode);                        \\\n}\n\n#define RCT_MIN_MAX_DIMENSION_PROPERTY(setProp, getProp, cssProp)   \\\n- (void)set##setProp:(YGValue)value                                 \\\n{                                                                   \\\n  RCT_SET_YGVALUE(value, YGNodeStyleSet##cssProp, _yogaNode);       \\\n  [self dirtyText];                                                 \\\n}                                                                   \\\n- (YGValue)getProp                                                  \\\n{                                                                   \\\n  return YGNodeStyleGet##cssProp(_yogaNode);                        \\\n}\n\nRCT_DIMENSION_PROPERTY(Width, width, Width)\nRCT_DIMENSION_PROPERTY(Height, height, Height)\nRCT_MIN_MAX_DIMENSION_PROPERTY(MinWidth, minWidth, MinWidth)\nRCT_MIN_MAX_DIMENSION_PROPERTY(MinHeight, minHeight, MinHeight)\nRCT_MIN_MAX_DIMENSION_PROPERTY(MaxWidth, maxWidth, MaxWidth)\nRCT_MIN_MAX_DIMENSION_PROPERTY(MaxHeight, maxHeight, MaxHeight)\n\n// Position\n\n#define RCT_POSITION_PROPERTY(setProp, getProp, edge)               \\\n- (void)set##setProp:(YGValue)value                                 \\\n{                                                                   \\\n  RCT_SET_YGVALUE(value, YGNodeStyleSetPosition, _yogaNode, edge);  \\\n  [self dirtyText];                                                 \\\n}                                                                   \\\n- (YGValue)getProp                                                  \\\n{                                                                   \\\n  return YGNodeStyleGetPosition(_yogaNode, edge);                   \\\n}\n\n\nRCT_POSITION_PROPERTY(Top, top, YGEdgeTop)\nRCT_POSITION_PROPERTY(Bottom, bottom, YGEdgeBottom)\nRCT_POSITION_PROPERTY(Start, start, YGEdgeStart)\nRCT_POSITION_PROPERTY(End, end, YGEdgeEnd)\n\n- (void)setLeft:(YGValue)value\n{\n  YGEdge edge = [[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL] ? YGEdgeStart : YGEdgeLeft;\n  RCT_SET_YGVALUE(value, YGNodeStyleSetPosition, _yogaNode, edge);\n  [self dirtyText];\n}\n- (YGValue)left\n{\n  YGEdge edge = [[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL] ? YGEdgeStart : YGEdgeLeft;\n  return YGNodeStyleGetPosition(_yogaNode, edge);\n}\n\n- (void)setRight:(YGValue)value\n{\n  YGEdge edge = [[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL] ? YGEdgeEnd : YGEdgeRight;\n  RCT_SET_YGVALUE(value, YGNodeStyleSetPosition, _yogaNode, edge);\n  [self dirtyText];\n}\n- (YGValue)right\n{\n  YGEdge edge = [[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL] ? YGEdgeEnd : YGEdgeRight;\n  return YGNodeStyleGetPosition(_yogaNode, edge);\n}\n\n// Size\n\n- (CGSize)size\n{\n  YGValue width = YGNodeStyleGetWidth(_yogaNode);\n  YGValue height = YGNodeStyleGetHeight(_yogaNode);\n\n  return CGSizeMake(\n    width.unit == YGUnitPoint ? width.value : NAN,\n    height.unit == YGUnitPoint ? height.value : NAN\n  );\n}\n\n- (void)setSize:(CGSize)size\n{\n  YGNodeStyleSetWidth(_yogaNode, size.width);\n  YGNodeStyleSetHeight(_yogaNode, size.height);\n}\n\n// IntrinsicContentSize\n\nstatic inline YGSize RCTShadowViewMeasure(YGNodeRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)\n{\n  RCTShadowView *shadowView = (__bridge RCTShadowView *)YGNodeGetContext(node);\n\n  CGSize intrinsicContentSize = shadowView->_intrinsicContentSize;\n  // Replace `UIViewNoIntrinsicMetric` (which equals `-1`) with zero.\n  intrinsicContentSize.width = MAX(0, intrinsicContentSize.width);\n  intrinsicContentSize.height = MAX(0, intrinsicContentSize.height);\n\n  YGSize result;\n\n  switch (widthMode) {\n    case YGMeasureModeUndefined:\n      result.width = intrinsicContentSize.width;\n      break;\n    case YGMeasureModeExactly:\n      result.width = width;\n      break;\n    case YGMeasureModeAtMost:\n      result.width = MIN(width, intrinsicContentSize.width);\n      break;\n  }\n\n  switch (heightMode) {\n    case YGMeasureModeUndefined:\n      result.height = intrinsicContentSize.height;\n      break;\n    case YGMeasureModeExactly:\n      result.height = height;\n      break;\n    case YGMeasureModeAtMost:\n      result.height = MIN(height, intrinsicContentSize.height);\n      break;\n  }\n\n  return result;\n}\n\n- (void)setIntrinsicContentSize:(CGSize)intrinsicContentSize\n{\n  if (CGSizeEqualToSize(_intrinsicContentSize, intrinsicContentSize)) {\n    return;\n  }\n\n  _intrinsicContentSize = intrinsicContentSize;\n\n  if (CGSizeEqualToSize(_intrinsicContentSize, CGSizeMake(NSViewNoIntrinsicMetric, NSViewNoIntrinsicMetric))) {\n    YGNodeSetMeasureFunc(_yogaNode, NULL);\n  } else {\n    YGNodeSetMeasureFunc(_yogaNode, RCTShadowViewMeasure);\n  }\n\n  YGNodeMarkDirty(_yogaNode);\n}\n\n// Local Data\n\n- (void)setLocalData:(__unused NSObject *)localData\n{\n  // Do nothing by default.\n}\n\n// Flex\n\n- (void)setFlexBasis:(YGValue)value\n{\n  RCT_SET_YGVALUE_AUTO(value, YGNodeStyleSetFlexBasis, _yogaNode);\n}\n\n- (YGValue)flexBasis\n{\n  return YGNodeStyleGetFlexBasis(_yogaNode);\n}\n\n#define RCT_STYLE_PROPERTY(setProp, getProp, cssProp, type) \\\n- (void)set##setProp:(type)value                            \\\n{                                                           \\\n  YGNodeStyleSet##cssProp(_yogaNode, value);                \\\n}                                                           \\\n- (type)getProp                                             \\\n{                                                           \\\n  return YGNodeStyleGet##cssProp(_yogaNode);                \\\n}\n\nRCT_STYLE_PROPERTY(Flex, flex, Flex, float)\nRCT_STYLE_PROPERTY(FlexGrow, flexGrow, FlexGrow, float)\nRCT_STYLE_PROPERTY(FlexShrink, flexShrink, FlexShrink, float)\nRCT_STYLE_PROPERTY(FlexDirection, flexDirection, FlexDirection, YGFlexDirection)\nRCT_STYLE_PROPERTY(JustifyContent, justifyContent, JustifyContent, YGJustify)\nRCT_STYLE_PROPERTY(AlignSelf, alignSelf, AlignSelf, YGAlign)\nRCT_STYLE_PROPERTY(AlignItems, alignItems, AlignItems, YGAlign)\nRCT_STYLE_PROPERTY(AlignContent, alignContent, AlignContent, YGAlign)\nRCT_STYLE_PROPERTY(Position, position, PositionType, YGPositionType)\nRCT_STYLE_PROPERTY(FlexWrap, flexWrap, FlexWrap, YGWrap)\nRCT_STYLE_PROPERTY(Overflow, overflow, Overflow, YGOverflow)\nRCT_STYLE_PROPERTY(Display, display, Display, YGDisplay)\nRCT_STYLE_PROPERTY(Direction, direction, Direction, YGDirection)\nRCT_STYLE_PROPERTY(AspectRatio, aspectRatio, AspectRatio, float)\n\n- (void)didUpdateReactSubviews\n{\n  // Does nothing by default\n}\n\n- (void)didSetProps:(__unused NSArray<NSString *> *)changedProps\n{\n  if (_recomputePadding) {\n    RCTProcessMetaPropsPadding(_paddingMetaProps, _yogaNode);\n  }\n  if (_recomputeMargin) {\n    RCTProcessMetaPropsMargin(_marginMetaProps, _yogaNode);\n  }\n  if (_recomputeBorder) {\n    RCTProcessMetaPropsBorder(_borderMetaProps, _yogaNode);\n  }\n  _recomputeMargin = NO;\n  _recomputePadding = NO;\n  _recomputeBorder = NO;\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTSlider.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTComponent.h>\n\n@interface RCTSlider : NSSlider\n\n@property (nonatomic, copy) RCTBubblingEventBlock onValueChange;\n@property (nonatomic, copy) RCTBubblingEventBlock onSlidingComplete;\n\n@property (nonatomic, assign) float step;\n@end\n"
  },
  {
    "path": "React/Views/RCTSlider.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSlider.h\"\n\n@implementation RCTSlider\n{\n  float _unclippedValue;\n}\n\n- (void)setValue:(float)value\n{\n  _unclippedValue = value;\n  [self setDoubleValue:value];\n}\n\n- (void)setMinimumValue:(float)minimumValue\n{\n  self.minValue = minimumValue;\n  [self setDoubleValue:_unclippedValue];\n}\n\n- (void)setMaximumValue:(float)maximumValue\n{\n  self.maxValue = maximumValue;\n  [self setDoubleValue:_unclippedValue];\n}\n\n\n@end\n"
  },
  {
    "path": "React/Views/RCTSliderManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTSliderManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTSliderManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSliderManager.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTSlider.h\"\n#import \"NSView+React.h\"\n\n@implementation RCTSliderManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  RCTSlider *slider = [RCTSlider new];\n  slider.continuous = YES;\n  [slider setTarget:self];\n  [slider setAction:@selector(sliderValueChanged:)];\n  return slider;\n}\n\n- (void)sliderValueChanged:(RCTSlider*)sender {\n  float value = sender.floatValue;\n  NSEvent *event = [[NSApplication sharedApplication] currentEvent];\n  BOOL endingDrag = event.type == NSLeftMouseUp;\n  if (!endingDrag) {\n    if (sender.onValueChange) {\n      sender.onValueChange(@{@\"value\": @(value)});\n    }\n  } else {\n    if (sender.onSlidingComplete) {\n      sender.onSlidingComplete(@{@\"value\": @(value)});\n    }\n  }\n}\n\nRCT_EXPORT_VIEW_PROPERTY(value, float);\nRCT_EXPORT_VIEW_PROPERTY(step, float);\nRCT_EXPORT_VIEW_PROPERTY(trackImage, NSImage);\nRCT_EXPORT_VIEW_PROPERTY(minimumTrackImage, NSImage);\nRCT_EXPORT_VIEW_PROPERTY(maximumTrackImage, NSImage);\nRCT_EXPORT_VIEW_PROPERTY(minimumValue, float);\nRCT_EXPORT_VIEW_PROPERTY(maximumValue, float);\n//RCT_EXPORT_VIEW_PROPERTY(minimumTrackTintColor, NSColor);\n//RCT_EXPORT_VIEW_PROPERTY(maximumTrackTintColor, NSColor);\nRCT_EXPORT_VIEW_PROPERTY(onValueChange, RCTBubblingEventBlock);\nRCT_EXPORT_VIEW_PROPERTY(onSlidingComplete, RCTBubblingEventBlock);\n\nRCT_CUSTOM_VIEW_PROPERTY(disabled, BOOL, RCTSlider)\n{\n  if (json) {\n    view.enabled = !([RCTConvert BOOL:json]);\n  } else {\n    view.enabled = defaultView.enabled;\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTSwitch.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTComponent.h>\n\n@interface RCTSwitch : NSButton\n\n@property (nonatomic, assign) BOOL wasOn;\n@property (nonatomic, copy) RCTBubblingEventBlock onChange;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTSwitch.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSwitch.h\"\n\n#import \"RCTEventDispatcher.h\"\n#import \"NSView+React.h\"\n\n@implementation RCTSwitch\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if ((self = [super initWithFrame:frame])) {\n    [self setButtonType:NSSwitchButton];\n    [self setTitle:@\"\"];\n    [self setControlSize:NSRegularControlSize];\n    [self setStringValue:@\"\"];\n  }\n  return self;\n}\n\n- (void)setOn:(BOOL)on animated:(__unused BOOL)animated {\n  _wasOn = on;\n  [self setState:on ? 1 : 0];\n  //[self setOn:on animated:animated];\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTSwitchManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTSwitchManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTSwitchManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSwitchManager.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTSwitch.h\"\n#import \"NSView+React.h\"\n\n@implementation RCTSwitchManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  RCTSwitch *switcher = [RCTSwitch new];\n//  [switcher addTarget:self\n//               action:@selector(onChange:)\n//     forControlEvents:UIControlEventValueChanged];\n  return switcher;\n}\n\n//- (void)onChange:(RCTSwitch *)sender\n//{\n//  if (sender.wasOn != sender.on) {\n//    if (sender.onChange) {\n//      sender.onChange(@{ @\"value\": @(sender.on) });\n//    }\n//    sender.wasOn = sender.on;\n//  }\n//}\n\n//RCT_EXPORT_VIEW_PROPERTY(onTintColor, UIColor);\n//RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor);\n//RCT_EXPORT_VIEW_PROPERTY(thumbTintColor, UIColor);\n//RCT_REMAP_VIEW_PROPERTY(value, state, NSInteger);\nRCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock);\nRCT_CUSTOM_VIEW_PROPERTY(value, BOOL, RCTSwitch)\n{\n  if (json) {\n    BOOL on = [RCTConvert BOOL:json];\n    [view setState:on ? NSOnState : NSOffState];\n  } else {\n    [view setState:defaultView.state];\n\n  }\n}\nRCT_CUSTOM_VIEW_PROPERTY(disabled, BOOL, RCTSwitch)\n{\n  if (json) {\n    view.enabled = !([RCTConvert BOOL:json]);\n  } else {\n    view.enabled = defaultView.enabled;\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTTVView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n#import <UIKit/UIKit.h>\n\n#import <React/RCTView.h>\n\n//  A RCTView with additional properties and methods for user interaction using the Apple TV focus engine.\n@interface RCTTVView : RCTView\n\n/**\n * TV event handlers\n */\n@property (nonatomic, assign) BOOL isTVSelectable; // True if this view is TV-focusable\n\n/**\n *  Properties for Apple TV focus parallax effects\n */\n@property (nonatomic, copy) NSDictionary *tvParallaxProperties;\n\n/**\n * TV preferred focus\n */\n@property (nonatomic, assign) BOOL hasTVPreferredFocus;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTTVView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTVView.h\"\n\n#import \"RCTAutoInsetsProtocol.h\"\n#import \"RCTBorderDrawing.h\"\n#import \"RCTBridge.h\"\n#import \"RCTConvert.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTLog.h\"\n#import \"RCTRootViewInternal.h\"\n#import \"RCTTVNavigationEventEmitter.h\"\n#import \"RCTUtils.h\"\n#import \"RCTView.h\"\n#import \"UIView+React.h\"\n\n@implementation RCTTVView\n{\n  UITapGestureRecognizer *_selectRecognizer;\n}\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if (self = [super initWithFrame:frame]) {\n    self.tvParallaxProperties = @{\n      @\"enabled\": @YES,\n      @\"shiftDistanceX\": @2.0f,\n      @\"shiftDistanceY\": @2.0f,\n      @\"tiltAngle\": @0.05f,\n      @\"magnification\": @1.0f\n    };\n  }\n\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:unused)\n\n- (void)setIsTVSelectable:(BOOL)isTVSelectable {\n  self->_isTVSelectable = isTVSelectable;\n  if(isTVSelectable) {\n    UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSelect:)];\n    recognizer.allowedPressTypes = @[@(UIPressTypeSelect)];\n    _selectRecognizer = recognizer;\n    [self addGestureRecognizer:_selectRecognizer];\n  } else {\n    if(_selectRecognizer) {\n      [self removeGestureRecognizer:_selectRecognizer];\n    }\n  }\n}\n\n- (void)handleSelect:(__unused UIGestureRecognizer *)r\n{\n  [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVNavigationEventNotification\n                                                      object:@{@\"eventType\":@\"select\",@\"tag\":self.reactTag}];\n}\n\n- (BOOL)isUserInteractionEnabled\n{\n  return YES;\n}\n\n- (BOOL)canBecomeFocused\n{\n  return (self.isTVSelectable);\n}\n\n- (void)addParallaxMotionEffects\n{\n  // Size of shift movements\n  CGFloat const shiftDistanceX = [self.tvParallaxProperties[@\"shiftDistanceX\"] floatValue];\n  CGFloat const shiftDistanceY = [self.tvParallaxProperties[@\"shiftDistanceY\"] floatValue];\n\n  // Make horizontal movements shift the centre left and right\n  UIInterpolatingMotionEffect *xShift = [[UIInterpolatingMotionEffect alloc]\n                                         initWithKeyPath:@\"center.x\"\n                                         type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];\n  xShift.minimumRelativeValue = @( shiftDistanceX * -1.0f);\n  xShift.maximumRelativeValue = @( shiftDistanceX);\n\n  // Make vertical movements shift the centre up and down\n  UIInterpolatingMotionEffect *yShift = [[UIInterpolatingMotionEffect alloc]\n                                         initWithKeyPath:@\"center.y\"\n                                         type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];\n  yShift.minimumRelativeValue = @( shiftDistanceY * -1.0f);\n  yShift.maximumRelativeValue = @( shiftDistanceY);\n\n  // Size of tilt movements\n  CGFloat const tiltAngle = [self.tvParallaxProperties[@\"tiltAngle\"] floatValue];\n\n  // Now make horizontal movements effect a rotation about the Y axis for side-to-side rotation.\n  UIInterpolatingMotionEffect *xTilt = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@\"layer.transform\" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];\n\n  // CATransform3D value for minimumRelativeValue\n  CATransform3D transMinimumTiltAboutY = CATransform3DIdentity;\n  transMinimumTiltAboutY.m34 = 1.0 / 500;\n  transMinimumTiltAboutY = CATransform3DRotate(transMinimumTiltAboutY, tiltAngle * -1.0, 0, 1, 0);\n\n  // CATransform3D value for minimumRelativeValue\n  CATransform3D transMaximumTiltAboutY = CATransform3DIdentity;\n  transMaximumTiltAboutY.m34 = 1.0 / 500;\n  transMaximumTiltAboutY = CATransform3DRotate(transMaximumTiltAboutY, tiltAngle, 0, 1, 0);\n\n  // Set the transform property boundaries for the interpolation\n  xTilt.minimumRelativeValue = [NSValue valueWithCATransform3D: transMinimumTiltAboutY];\n  xTilt.maximumRelativeValue = [NSValue valueWithCATransform3D: transMaximumTiltAboutY];\n\n  // Now make vertical movements effect a rotation about the X axis for up and down rotation.\n  UIInterpolatingMotionEffect *yTilt = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@\"layer.transform\" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];\n\n  // CATransform3D value for minimumRelativeValue\n  CATransform3D transMinimumTiltAboutX = CATransform3DIdentity;\n  transMinimumTiltAboutX.m34 = 1.0 / 500;\n  transMinimumTiltAboutX = CATransform3DRotate(transMinimumTiltAboutX, tiltAngle * -1.0, 1, 0, 0);\n\n  // CATransform3D value for minimumRelativeValue\n  CATransform3D transMaximumTiltAboutX = CATransform3DIdentity;\n  transMaximumTiltAboutX.m34 = 1.0 / 500;\n  transMaximumTiltAboutX = CATransform3DRotate(transMaximumTiltAboutX, tiltAngle, 1, 0, 0);\n\n  // Set the transform property boundaries for the interpolation\n  yTilt.minimumRelativeValue = [NSValue valueWithCATransform3D: transMinimumTiltAboutX];\n  yTilt.maximumRelativeValue = [NSValue valueWithCATransform3D: transMaximumTiltAboutX];\n\n  // Add all of the motion effects to this group\n  self.motionEffects = @[xShift, yShift, xTilt, yTilt];\n\n  float magnification = [self.tvParallaxProperties[@\"magnification\"] floatValue];\n\n  [UIView animateWithDuration:0.2 animations:^{\n    self.transform = CGAffineTransformMakeScale(magnification, magnification);\n  }];\n}\n\n- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator\n{\n  if (context.nextFocusedView == self && self.isTVSelectable ) {\n    [self becomeFirstResponder];\n    [coordinator addCoordinatedAnimations:^(void){\n      if([self.tvParallaxProperties[@\"enabled\"] boolValue]) {\n        [self addParallaxMotionEffects];\n      }\n      [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVNavigationEventNotification\n                                                          object:@{@\"eventType\":@\"focus\",@\"tag\":self.reactTag}];\n    } completion:^(void){}];\n  } else {\n    [coordinator addCoordinatedAnimations:^(void){\n      [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVNavigationEventNotification\n                                                          object:@{@\"eventType\":@\"blur\",@\"tag\":self.reactTag}];\n      [UIView animateWithDuration:0.2 animations:^{\n        self.transform = CGAffineTransformMakeScale(1, 1);\n      }];\n\n      for (UIMotionEffect *effect in [self.motionEffects copy]){\n        [self removeMotionEffect:effect];\n      }\n    } completion:^(void){}];\n    [self resignFirstResponder];\n  }\n}\n\n- (void)setHasTVPreferredFocus:(BOOL)hasTVPreferredFocus\n{\n  _hasTVPreferredFocus = hasTVPreferredFocus;\n  if (hasTVPreferredFocus) {\n    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{\n      UIView *rootview = self;\n      while (![rootview isReactRootView] && rootview != nil) {\n        rootview = [rootview superview];\n      }\n      if (rootview == nil) return;\n\n      rootview = [rootview superview];\n\n      [(RCTRootView *)rootview setReactPreferredFocusedView:self];\n      [rootview setNeedsFocusUpdate];\n      [rootview updateFocusIfNeeded];\n    });\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTTabBar.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@interface RCTTabBar : UIView\n\n@property (nonatomic, strong) UIColor *unselectedTintColor;\n@property (nonatomic, strong) UIColor *tintColor;\n@property (nonatomic, strong) UIColor *barTintColor;\n@property (nonatomic, assign) BOOL translucent;\n#if !TARGET_OS_TV\n@property (nonatomic, assign) UIBarStyle barStyle;\n#endif\n\n- (void)uiManagerDidPerformMounting;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTTabBar.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTabBar.h\"\n\n#import \"RCTEventDispatcher.h\"\n#import \"RCTLog.h\"\n#import \"RCTTabBarItem.h\"\n#import \"RCTUtils.h\"\n#import \"RCTView.h\"\n#import \"RCTWrapperViewController.h\"\n#import \"UIView+React.h\"\n\n@interface RCTTabBar() <UITabBarControllerDelegate>\n\n@end\n\n@implementation RCTTabBar\n{\n  BOOL _tabsChanged;\n  UITabBarController *_tabController;\n}\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if ((self = [super initWithFrame:frame])) {\n    _tabController = [UITabBarController new];\n    _tabController.delegate = self;\n    [self addSubview:_tabController.view];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (UIViewController *)reactViewController\n{\n  return _tabController;\n}\n\n- (void)dealloc\n{\n  _tabController.delegate = nil;\n  [_tabController removeFromParentViewController];\n}\n\n- (void)insertReactSubview:(RCTTabBarItem *)subview atIndex:(NSInteger)atIndex\n{\n  if (![subview isKindOfClass:[RCTTabBarItem class]]) {\n    RCTLogError(@\"subview should be of type RCTTabBarItem\");\n    return;\n  }\n  [super insertReactSubview:subview atIndex:atIndex];\n  _tabsChanged = YES;\n}\n\n- (void)removeReactSubview:(RCTTabBarItem *)subview\n{\n  if (self.reactSubviews.count == 0) {\n    RCTLogError(@\"should have at least one view to remove a subview\");\n    return;\n  }\n  [super removeReactSubview:subview];\n  _tabsChanged = YES;\n}\n\n- (void)didUpdateReactSubviews\n{\n  // Do nothing, as subviews are managed by `uiManagerDidPerformMounting`\n}\n\n- (void)layoutSubviews\n{\n  [super layoutSubviews];\n  [self reactAddControllerToClosestParent:_tabController];\n  _tabController.view.frame = self.bounds;\n}\n\n- (void)uiManagerDidPerformMounting\n{\n  // we can't hook up the VC hierarchy in 'init' because the subviews aren't\n  // hooked up yet, so we do it on demand here whenever a transaction has finished\n  [self reactAddControllerToClosestParent:_tabController];\n\n  if (_tabsChanged) {\n\n    NSMutableArray<UIViewController *> *viewControllers = [NSMutableArray array];\n    for (RCTTabBarItem *tab in [self reactSubviews]) {\n      UIViewController *controller = tab.reactViewController;\n      if (!controller) {\n        controller = [[RCTWrapperViewController alloc] initWithContentView:tab];\n      }\n      [viewControllers addObject:controller];\n    }\n\n    _tabController.viewControllers = viewControllers;\n    _tabsChanged = NO;\n  }\n\n  [self.reactSubviews enumerateObjectsUsingBlock:^(UIView *view, NSUInteger index, __unused BOOL *stop) {\n\n    RCTTabBarItem *tab = (RCTTabBarItem *)view;\n    UIViewController *controller = self->_tabController.viewControllers[index];\n    if (self->_unselectedTintColor) {\n      [tab.barItem setTitleTextAttributes:@{NSForegroundColorAttributeName: self->_unselectedTintColor} forState:UIControlStateNormal];\n    }\n\n    [tab.barItem setTitleTextAttributes:@{NSForegroundColorAttributeName: self.tintColor} forState:UIControlStateSelected];\n\n    controller.tabBarItem = tab.barItem;\n#if TARGET_OS_TV\n// On Apple TV, disable JS control of selection after initial render\n    if (tab.selected && !tab.wasSelectedInJS) {\n      self->_tabController.selectedViewController = controller;\n    }\n    tab.wasSelectedInJS = YES;\n#else\n    if (tab.selected) {\n      self->_tabController.selectedViewController = controller;\n    }\n#endif\n  }];\n}\n\n- (UIColor *)barTintColor\n{\n  return _tabController.tabBar.barTintColor;\n}\n\n- (void)setBarTintColor:(UIColor *)barTintColor\n{\n  _tabController.tabBar.barTintColor = barTintColor;\n}\n\n- (UIColor *)tintColor\n{\n  return _tabController.tabBar.tintColor;\n}\n\n- (void)setTintColor:(UIColor *)tintColor\n{\n  _tabController.tabBar.tintColor = tintColor;\n}\n\n- (BOOL)translucent\n{\n  return _tabController.tabBar.isTranslucent;\n}\n\n- (void)setTranslucent:(BOOL)translucent\n{\n  _tabController.tabBar.translucent = translucent;\n}\n\n#if !TARGET_OS_TV\n- (UIBarStyle)barStyle\n{\n  return _tabController.tabBar.barStyle;\n}\n\n- (void)setBarStyle:(UIBarStyle)barStyle\n{\n  _tabController.tabBar.barStyle = barStyle;\n}\n#endif\n\n- (void)setUnselectedItemTintColor:(UIColor *)unselectedItemTintColor {\n#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0\n  if ([_tabController.tabBar respondsToSelector:@selector(unselectedItemTintColor)]) {\n    _tabController.tabBar.unselectedItemTintColor = unselectedItemTintColor;\n  }\n#endif\n}\n\n- (UITabBarItemPositioning)itemPositioning\n{\n#if TARGET_OS_TV\n  return 0;\n#else\n  return _tabController.tabBar.itemPositioning;\n#endif\n}\n\n- (void)setItemPositioning:(UITabBarItemPositioning)itemPositioning\n{\n#if !TARGET_OS_TV\n  _tabController.tabBar.itemPositioning = itemPositioning;\n#endif\n}\n\n#pragma mark - UITabBarControllerDelegate\n\n#if TARGET_OS_TV\n\n- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(nonnull UIViewController *)viewController\n{\n  NSUInteger index = [tabBarController.viewControllers indexOfObject:viewController];\n  RCTTabBarItem *tab = (RCTTabBarItem *)self.reactSubviews[index];\n  if (tab.onPress) tab.onPress(nil);\n  return;\n}\n\n#else\n\n- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController\n{\n  NSUInteger index = [tabBarController.viewControllers indexOfObject:viewController];\n  RCTTabBarItem *tab = (RCTTabBarItem *)self.reactSubviews[index];\n  if (tab.onPress) tab.onPress(nil);\n  return NO;\n}\n\n#endif\n\n#if TARGET_OS_TV\n\n- (BOOL)isUserInteractionEnabled\n{\n  return YES;\n}\n\n- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator\n{\n  if (context.nextFocusedView == self) {\n    [self becomeFirstResponder];\n  } else {\n    [self resignFirstResponder];\n  }\n}\n\n#endif\n\n@end\n"
  },
  {
    "path": "React/Views/RCTTabBarItem.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\n#import <React/RCTComponent.h>\n#import <React/RCTConvert.h>\n\n@interface RCTConvert (UITabBarSystemItem)\n\n+ (UITabBarSystemItem)UITabBarSystemItem:(id)json;\n\n@end\n\n@interface RCTTabBarItem : UIView\n\n@property (nonatomic, copy) id /* NSString or NSNumber */ badge;\n@property (nonatomic, strong) UIImage *icon;\n@property (nonatomic, strong) UIImage *selectedIcon;\n@property (nonatomic, assign) UITabBarSystemItem systemIcon;\n@property (nonatomic, assign) BOOL renderAsOriginal;\n@property (nonatomic, assign, getter=isSelected) BOOL selected;\n@property (nonatomic, readonly) UITabBarItem *barItem;\n@property (nonatomic, copy) RCTBubblingEventBlock onPress;\n@property (nonatomic, strong) NSString *testID;\n\n#if TARGET_OS_TV\n@property (nonatomic, assign) BOOL wasSelectedInJS;\n#endif\n\n@end\n"
  },
  {
    "path": "React/Views/RCTTabBarItem.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTabBarItem.h\"\n\n#import \"RCTConvert.h\"\n#import \"RCTLog.h\"\n#import \"UIView+React.h\"\n\n@implementation RCTConvert (UITabBarSystemItem)\n\nRCT_ENUM_CONVERTER(UITabBarSystemItem, (@{\n  @\"bookmarks\": @(UITabBarSystemItemBookmarks),\n  @\"contacts\": @(UITabBarSystemItemContacts),\n  @\"downloads\": @(UITabBarSystemItemDownloads),\n  @\"favorites\": @(UITabBarSystemItemFavorites),\n  @\"featured\": @(UITabBarSystemItemFeatured),\n  @\"history\": @(UITabBarSystemItemHistory),\n  @\"more\": @(UITabBarSystemItemMore),\n  @\"most-recent\": @(UITabBarSystemItemMostRecent),\n  @\"most-viewed\": @(UITabBarSystemItemMostViewed),\n  @\"recents\": @(UITabBarSystemItemRecents),\n  @\"search\": @(UITabBarSystemItemSearch),\n  @\"top-rated\": @(UITabBarSystemItemTopRated),\n}), NSNotFound, integerValue)\n\n@end\n\n@implementation RCTTabBarItem{\n  UITapGestureRecognizer *_selectRecognizer;\n}\n\n@synthesize barItem = _barItem;\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if ((self = [super initWithFrame:frame])) {\n    _systemIcon = NSNotFound;\n#if TARGET_OS_TV\n    _wasSelectedInJS = NO;\n#endif\n  }\n  return self;\n}\n\n- (UITabBarItem *)barItem\n{\n  if (!_barItem) {\n    _barItem = [UITabBarItem new];\n    _systemIcon = NSNotFound;\n  }\n  return _barItem;\n}\n\n- (void)setTestID:(NSString *)testID\n{\n  self.barItem.accessibilityIdentifier = testID;\n}\n\n- (void)setBadge:(id)badge\n{\n  _badge = [badge copy];\n  self.barItem.badgeValue = [badge description];\n}\n\n- (void)setSystemIcon:(UITabBarSystemItem)systemIcon\n{\n  if (_systemIcon != systemIcon) {\n    _systemIcon = systemIcon;\n    UITabBarItem *oldItem = _barItem;\n    _barItem = [[UITabBarItem alloc] initWithTabBarSystemItem:_systemIcon\n                                                          tag:oldItem.tag];\n    _barItem.title = oldItem.title;\n    _barItem.imageInsets = oldItem.imageInsets;\n    _barItem.badgeValue = oldItem.badgeValue;\n  }\n}\n\n- (void)setIcon:(UIImage *)icon\n{\n  _icon = icon;\n  if (_icon && _systemIcon != NSNotFound) {\n    _systemIcon = NSNotFound;\n    UITabBarItem *oldItem = _barItem;\n    _barItem = [UITabBarItem new];\n    _barItem.title = oldItem.title;\n    _barItem.imageInsets = oldItem.imageInsets;\n    _barItem.selectedImage = oldItem.selectedImage;\n    _barItem.badgeValue = oldItem.badgeValue;\n  }\n\n  if (_renderAsOriginal) {\n    self.barItem.image = [_icon imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];\n  } else {\n    self.barItem.image = _icon;\n  }\n}\n\n- (void)setSelectedIcon:(UIImage *)selectedIcon\n{\n  _selectedIcon = selectedIcon;\n\n  if (_renderAsOriginal) {\n    self.barItem.selectedImage = [_selectedIcon imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];\n  } else {\n    self.barItem.selectedImage = _selectedIcon;\n  }\n}\n\n- (void)setBadgeColor:(UIColor *)badgeColor\n{\n  // badgeColor available since iOS 10\n  if ([self.barItem respondsToSelector:@selector(badgeColor)]) {\n    self.barItem.badgeColor = badgeColor;\n  }\n}\n\n- (UIViewController *)reactViewController\n{\n  return self.superview.reactViewController;\n}\n\n#if TARGET_OS_TV\n\n// On Apple TV, we let native control the tab bar selection after initial render\n- (void)setSelected:(BOOL)selected\n{\n  if (!_wasSelectedInJS) {\n    _selected = selected;\n  }\n}\n\n#endif\n\n@end\n"
  },
  {
    "path": "React/Views/RCTTabBarItemManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTTabBarItemManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTTabBarItemManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTabBarItemManager.h\"\n\n#import \"RCTConvert.h\"\n#import \"RCTTabBarItem.h\"\n\n@implementation RCTTabBarItemManager\n\nRCT_EXPORT_MODULE()\n\n- (UIView *)view\n{\n  return [RCTTabBarItem new];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(badge, id /* NSString or NSNumber */)\nRCT_EXPORT_VIEW_PROPERTY(renderAsOriginal, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(selected, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(icon, UIImage)\nRCT_EXPORT_VIEW_PROPERTY(selectedIcon, UIImage)\nRCT_EXPORT_VIEW_PROPERTY(systemIcon, UITabBarSystemItem)\nRCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(badgeColor, UIColor)\nRCT_EXPORT_VIEW_PROPERTY(isTVSelectable, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(testID, NSString)\nRCT_CUSTOM_VIEW_PROPERTY(title, NSString, RCTTabBarItem)\n{\n  view.barItem.title = json ? [RCTConvert NSString:json] : defaultView.barItem.title;\n  view.barItem.imageInsets = view.barItem.title.length ? UIEdgeInsetsZero : (UIEdgeInsets){6, 0, -6, 0};\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTTabBarManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTTabBarManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTTabBarManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTTabBarManager.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTTabBar.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTUIManagerObserverCoordinator.h\"\n\n@implementation RCTConvert (UITabBar)\n\nRCT_ENUM_CONVERTER(UITabBarItemPositioning, (@{\n  @\"fill\" : @(UITabBarItemPositioningFill),\n  @\"auto\" : @(UITabBarItemPositioningAutomatic),\n  @\"center\" : @(UITabBarItemPositioningCentered)\n}), UITabBarItemPositioningAutomatic, integerValue)\n\n@end\n\n@interface RCTTabBarManager () <RCTUIManagerObserver>\n\n@end\n\n@implementation RCTTabBarManager\n{\n  // The main thread only.\n  NSHashTable<RCTTabBar *> *_viewRegistry;\n}\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n  [super setBridge:bridge];\n\n  [self.bridge.uiManager.observerCoordinator addObserver:self];\n}\n\n- (void)invalidate\n{\n  [self.bridge.uiManager.observerCoordinator removeObserver:self];\n}\n\nRCT_EXPORT_MODULE()\n\n- (UIView *)view\n{\n  if (!_viewRegistry) {\n    _viewRegistry = [NSHashTable hashTableWithOptions:NSPointerFunctionsWeakMemory];\n  }\n\n  RCTTabBar *view = [RCTTabBar new];\n  [_viewRegistry addObject:view];\n  return view;\n}\n\nRCT_EXPORT_VIEW_PROPERTY(unselectedTintColor, UIColor)\nRCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor)\nRCT_EXPORT_VIEW_PROPERTY(barTintColor, UIColor)\nRCT_EXPORT_VIEW_PROPERTY(translucent, BOOL)\n#if !TARGET_OS_TV\nRCT_EXPORT_VIEW_PROPERTY(barStyle, UIBarStyle)\n#endif\nRCT_EXPORT_VIEW_PROPERTY(itemPositioning, UITabBarItemPositioning)\nRCT_EXPORT_VIEW_PROPERTY(unselectedItemTintColor, UIColor)\n\n#pragma mark - RCTUIManagerObserver\n\n- (void)uiManagerDidPerformMounting:(__unused RCTUIManager *)manager\n{\n  RCTExecuteOnMainQueue(^{\n    for (RCTTabBar *view in self->_viewRegistry) {\n      [view uiManagerDidPerformMounting];\n    }\n  });\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTTextDecorationLineType.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\ntypedef NS_ENUM(NSInteger, RCTTextDecorationLineType) {\n  RCTTextDecorationLineTypeNone = 0,\n  RCTTextDecorationLineTypeUnderline,\n  RCTTextDecorationLineTypeStrikethrough,\n  RCTTextDecorationLineTypeUnderlineStrikethrough,\n};\n"
  },
  {
    "path": "React/Views/RCTView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBorderStyle.h>\n#import <React/RCTComponent.h>\n#import <React/RCTPointerEvents.h>\n#import <React/RCTView.h>\n\n@protocol RCTAutoInsetsProtocol;\n\n@class RCTView;\n\n@interface RCTView : NSView <CALayerDelegate>\n\n/**\n * Accessibility event handlers\n */\n@property (nonatomic, copy) RCTDirectEventBlock onAccessibilityAction;\n@property (nonatomic, copy) RCTDirectEventBlock onAccessibilityTap;\n@property (nonatomic, copy) RCTDirectEventBlock onMagicTap;\n\n/**\n * Accessibility properties\n */\n@property (nonatomic, copy) NSArray <NSString *> *accessibilityActions;\n\n/**\n * Used to control how touch events are processed.\n */\n@property (nonatomic, assign) RCTPointerEvents pointerEvents;\n\n+ (void)autoAdjustInsetsForView:(NSView<RCTAutoInsetsProtocol> *)parentView\n                 withScrollView:(NSScrollView *)scrollView\n                   updateOffset:(BOOL)updateOffset;\n\n/**\n * Find the first view controller whose view, or any subview is the specified view.\n */\n+ (NSEdgeInsets)contentInsetsForView:(NSView *)curView;\n\n- (void)setBackgroundColor:(NSColor *)backgroundColor;\n\n/**\n * Layout direction of the view.\n * This is inherited from UIView+React, but we override it here\n * to improve perfomance and make subclassing/overriding possible/easier.\n */\n@property (nonatomic, assign) NSUserInterfaceLayoutDirection reactLayoutDirection;\n\n/**\n * This is an optimization used to improve performance\n * for large scrolling views with many subviews, such as a\n * list or table. If set to YES, any clipped subviews will\n * be removed from the view hierarchy whenever -updateClippedSubviews\n * is called. This would typically be triggered by a scroll event\n */\n@property (nonatomic, assign) BOOL removeClippedSubviews;\n\n/**\n * Workaround on a lot of views with layers\n */\n@property (nonatomic, assign) BOOL respondsToLiveResizing;\n\n\n/**\n * Hide subviews if they are outside the view bounds.\n * This is an optimisation used predominantly with RKScrollViews\n * but it is applied recursively to all subviews that have\n * removeClippedSubviews set to YES\n */\n- (void)updateClippedSubviews;\n\n/**\n * Border radii.\n */\n@property (nonatomic, assign) CGFloat borderRadius;\n@property (nonatomic, assign) CGFloat borderTopLeftRadius;\n@property (nonatomic, assign) CGFloat borderTopRightRadius;\n@property (nonatomic, assign) CGFloat borderTopStartRadius;\n@property (nonatomic, assign) CGFloat borderTopEndRadius;\n@property (nonatomic, assign) CGFloat borderBottomLeftRadius;\n@property (nonatomic, assign) CGFloat borderBottomRightRadius;\n@property (nonatomic, assign) CGFloat borderBottomStartRadius;\n@property (nonatomic, assign) CGFloat borderBottomEndRadius;\n\n/**\n * Border colors (actually retained).\n */\n@property (nonatomic, assign) CGColorRef borderTopColor;\n@property (nonatomic, assign) CGColorRef borderRightColor;\n@property (nonatomic, assign) CGColorRef borderBottomColor;\n@property (nonatomic, assign) CGColorRef borderLeftColor;\n@property (nonatomic, assign) CGColorRef borderStartColor;\n@property (nonatomic, assign) CGColorRef borderEndColor;\n@property (nonatomic, assign) CGColorRef borderColor;\n\n/**\n * Border widths.\n */\n@property (nonatomic, assign) CGFloat borderTopWidth;\n@property (nonatomic, assign) CGFloat borderRightWidth;\n@property (nonatomic, assign) CGFloat borderBottomWidth;\n@property (nonatomic, assign) CGFloat borderLeftWidth;\n@property (nonatomic, assign) CGFloat borderStartWidth;\n@property (nonatomic, assign) CGFloat borderEndWidth;\n@property (nonatomic, assign) CGFloat borderWidth;\n\n/**\n * Initial tranformation for a view which is not rendered yet\n */\n@property (nonatomic, assign) CATransform3D transform;\n@property (nonatomic, assign) bool shouldBeTransformed;\n\n@property (nonatomic, copy) RCTDirectEventBlock onDragEnter;\n@property (nonatomic, copy) RCTDirectEventBlock onDragLeave;\n@property (nonatomic, copy) RCTDirectEventBlock onDrop;\n@property (nonatomic, copy) RCTDirectEventBlock onContextMenuItemClick;\n/**\n * Border styles.\n */\n@property (nonatomic, assign) RCTBorderStyle borderStyle;\n\n/**\n *  Insets used when hit testing inside this view.\n */\n@property (nonatomic, assign) NSEdgeInsets hitTestEdgeInsets;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTView.h\"\n\n#import \"RCTAutoInsetsProtocol.h\"\n#import \"RCTBorderDrawing.h\"\n#import \"RCTConvert.h\"\n#import \"RCTLog.h\"\n#import \"RCTUtils.h\"\n#import \"NSView+React.h\"\n#import \"UIImageUtils.h\"\n#import \"RCTI18nUtil.h\"\n\n@implementation NSView (RCTViewUnmounting)\n\n- (void)react_remountAllSubviews\n{\n  // Normal views don't support unmounting, so all\n  // this does is forward message to our subviews,\n  // in case any of those do support it\n\n  for (NSView *subview in self.subviews) {\n    [subview react_remountAllSubviews];\n  }\n}\n\n- (void)react_updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(NSView *)clipView\n{\n  // Even though we don't support subview unmounting\n  // we do support clipsToBounds, so if that's enabled\n  // we'll update the clipping\n\n  if (self.clipsToBounds && self.subviews.count > 0) {\n    clipRect = [clipView convertRect:clipRect toView:self];\n    clipRect = CGRectIntersection(clipRect, self.bounds);\n    clipView = self;\n  }\n\n  // Normal views don't support unmounting, so all\n  // this does is forward message to our subviews,\n  // in case any of those do support it\n\n  for (NSView *subview in self.subviews) {\n    [subview react_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView];\n  }\n}\n\n- (NSView *)react_findClipView\n{\n  NSView *testView = self;\n  NSView *clipView = nil;\n  CGRect clipRect = self.bounds;\n\n  // We will only look for a clipping view up the view hierarchy until we hit the root view.\n  while (testView) {\n    if (testView.clipsToBounds) {\n      if (clipView) {\n        CGRect testRect = [clipView convertRect:clipRect toView:testView];\n        if (!CGRectContainsRect(testView.bounds, testRect)) {\n          clipView = testView;\n          clipRect = CGRectIntersection(testView.bounds, testRect);\n        }\n      } else {\n        clipView = testView;\n        clipRect = [self convertRect:self.bounds toView:clipView];\n      }\n    }\n    if ([testView isReactRootView]) {\n      break;\n    }\n    testView = testView.superview;\n  }\n  return clipView ?: self.window.contentView;\n}\n\n@end\n\nstatic NSString *RCTRecursiveAccessibilityLabel(NSView *view)\n{\n  NSMutableString *str = [NSMutableString stringWithString:@\"\"];\n  for (NSView *subview in view.subviews) {\n    NSString *label = subview.accessibilityLabel;\n    if (!label) {\n      label = RCTRecursiveAccessibilityLabel(subview);\n    }\n    if (label && label.length > 0) {\n      if (str.length > 0) {\n        [str appendString:@\" \"];\n      }\n      [str appendString:label];\n    }\n  }\n  return str;\n}\n\n@implementation RCTView\n{\n  NSColor *_backgroundColor;\n}\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if ((self = [super initWithFrame:frame])) {\n    _borderWidth = -1;\n    _borderTopWidth = -1;\n    _borderRightWidth = -1;\n    _borderBottomWidth = -1;\n    _borderLeftWidth = -1;\n    _borderStartWidth = -1;\n    _borderEndWidth = -1;\n    _borderTopLeftRadius = -1;\n    _borderTopRightRadius = -1;\n    _borderTopStartRadius = -1;\n    _borderTopEndRadius = -1;\n    _borderBottomLeftRadius = -1;\n    _borderBottomRightRadius = -1;\n    _borderBottomStartRadius = -1;\n    _borderBottomEndRadius = -1;\n    _borderStyle = RCTBorderStyleSolid;\n    _hitTestEdgeInsets = NSEdgeInsetsZero;\n    self.clipsToBounds = NO;\n  }\n\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:unused)\n\n- (void)setReactTag:(NSNumber *)reactTag\n{\n  // The default view has no reactTag.\n  if (!reactTag && !self.reactTag) {\n    [self ensureLayerExists];\n  }\n\n  super.reactTag = reactTag;\n}\n\n- (void)setReactLayoutDirection:(NSUserInterfaceLayoutDirection)layoutDirection\n{\n  if (_reactLayoutDirection != layoutDirection) {\n    _reactLayoutDirection = layoutDirection;\n    [self.layer setNeedsDisplay];\n  }\n\n//  if ([self respondsToSelector:@selector(setSemanticContentAttribute:)]) {\n//    self.semanticContentAttribute =\n//      layoutDirection == UIUserInterfaceLayoutDirectionLeftToRight ?\n//        UISemanticContentAttributeForceLeftToRight :\n//        UISemanticContentAttributeForceRightToLeft;\n//  }\n}\n\n- (NSString *)accessibilityLabel\n{\n  NSString *label = super.accessibilityLabel;\n  if (label) {\n    return label;\n  }\n  return RCTRecursiveAccessibilityLabel(self);\n}\n\n- (BOOL)isFlipped\n{\n  return YES;\n}\n\n-(void) drawRect:(__unused NSRect)dirtyRect {}\n\n- (BOOL)wantsDefaultClipping\n{\n  return self.clipsToBounds;\n}\n\n- (void)setPointerEvents:(RCTPointerEvents)pointerEvents\n{\n   NSLog(@\" setPointerEvents is not implemented\");\n  _pointerEvents = pointerEvents;\n\n//  self.userInteractionEnabled = (pointerEvents != RCTPointerEventsNone);\n//  if (pointerEvents == RCTPointerEventsBoxNone) {\n//    self.accessibilityViewIsModal = NO;\n//  }\n}\n\n- (void)setTransform:(CATransform3D)transform\n{\n  _transform = transform;\n}\n\n- (NSView *)hitTest:(CGPoint)point\n{\n  // TODO: implement \"isUserInteractionEnabled\"\n//  BOOL canReceiveTouchEvents = ([self isUserInteractionEnabled] && ![self isHidden]);\n//  if(!canReceiveTouchEvents) {\n//    return nil;\n//  }\n\n  if (self.isHidden) {\n    return nil;\n  }\n\n  // `hitSubview` is the topmost subview which was hit. The hit point can\n  // be outside the bounds of `view` (e.g., if -clipsToBounds is NO).\n  NSView *hitSubview = nil;\n  BOOL isPointInside = [self pointInside:point];\n  BOOL needsHitSubview = !(_pointerEvents == RCTPointerEventsNone || _pointerEvents == RCTPointerEventsBoxOnly);\n  if (needsHitSubview && (![self clipsToBounds] || isPointInside)) {\n    // Take z-index into account when calculating the touch target.\n    NSArray<NSView *> *sortedSubviews = [self reactZIndexSortedSubviews];\n\n    // The default behaviour of UIKit is that if a view does not contain a point,\n    // then no subviews will be returned from hit testing, even if they contain\n    // the hit point. By doing hit testing directly on the subviews, we bypass\n    // the strict containment policy (i.e., UIKit guarantees that every ancestor\n    // of the hit view will return YES from -pointInside:withEvent:). See:\n    //  - https://developer.apple.com/library/ios/qa/qa2013/qa1812.html\n    for (NSView *subview in [sortedSubviews reverseObjectEnumerator]) {\n      CGPoint convertedPoint = subview.layer\n        ? [subview.layer convertPoint:point fromLayer:subview.layer.superlayer]\n        : [subview convertPoint:point fromView:self];\n\n      hitSubview = [subview hitTest:convertedPoint];\n      if (hitSubview != nil) {\n        break;\n      }\n    }\n  }\n\n  return hitSubview ?: (isPointInside ? self : nil);\n\n  // TODO: implement \"pointerEvents\"\n//  switch (_pointerEvents) {\n//    case RCTPointerEventsNone:\n//      return nil;\n//    case RCTPointerEventsUnspecified:\n//      return hitSubview ?: hitView;\n//    case RCTPointerEventsBoxOnly:\n//      return hitView;\n//    case RCTPointerEventsBoxNone:\n//      return hitSubview;\n//    default:\n//      RCTLogError(@\"Invalid pointer-events specified %lld on %@\", (long long)_pointerEvents, self);\n//      return hitSubview ?: hitView;\n//  }\n}\n\nstatic inline CGRect NSEdgeInsetsInsetRect(CGRect rect, NSEdgeInsets insets) {\n  rect.origin.x    += insets.left;\n  rect.origin.y    += insets.top;\n  rect.size.width  -= (insets.left + insets.right);\n  rect.size.height -= (insets.top  + insets.bottom);\n  return rect;\n}\n\n- (BOOL)pointInside:(CGPoint)point\n{\n  CGRect hitFrame = NSEdgeInsetsInsetRect(self.bounds, self.hitTestEdgeInsets);\n  return CGRectContainsPoint(hitFrame, point);\n}\n\n- (NSView *)reactAccessibilityElement\n{\n  return self;\n}\n\n- (BOOL)isAccessibilityElement\n{\n  if (self.reactAccessibilityElement == self) {\n    return [super isAccessibilityElement];\n  }\n\n  return NO;\n}\n\n- (BOOL)accessibilityActivate\n{\n  if (_onAccessibilityTap) {\n    _onAccessibilityTap(nil);\n    return YES;\n  } else {\n    return NO;\n  }\n}\n\n- (BOOL)accessibilityPerformMagicTap\n{\n  if (_onMagicTap) {\n    _onMagicTap(nil);\n    return YES;\n  } else {\n    return NO;\n  }\n}\n\n- (NSString *)description\n{\n  NSString *superDescription = super.description;\n  NSRange semicolonRange = [superDescription rangeOfString:@\";\"];\n  NSString *replacement = [NSString stringWithFormat:@\"; reactTag: %@;\", self.reactTag];\n  \n  if ([superDescription length] > 0 && semicolonRange.length > 0) {\n    return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement];\n  }\n  return [NSString stringWithFormat:@\"reactTag: %@;\", self.reactTag];\n}\n\n#pragma mark - Statics for dealing with layoutGuides\n\n+ (void)autoAdjustInsetsForView:(NSView<RCTAutoInsetsProtocol> *)parentView\n                 withScrollView:(NSScrollView *)scrollView\n                   updateOffset:(BOOL)updateOffset\n{\n  NSEdgeInsets baseInset = parentView.contentInset;\n  CGFloat previousInsetTop = scrollView.contentInsets.top;\n  //CGPoint contentOffset = scrollView.contentOffset;\n\n  if (parentView.automaticallyAdjustContentInsets) {\n    NSEdgeInsets autoInset = [self contentInsetsForView:parentView];\n    baseInset.top += autoInset.top;\n    baseInset.bottom += autoInset.bottom;\n    baseInset.left += autoInset.left;\n    baseInset.right += autoInset.right;\n  }\n  scrollView.contentInsets = baseInset;\n  //scrollView.scrollIndicatorInsets = baseInset;\n\n  if (updateOffset) {\n    // If we're adjusting the top inset, then let's also adjust the contentOffset so that the view\n    // elements above the top guide do not cover the content.\n    // This is generally only needed when your views are initially laid out, for\n    // manual changes to contentOffset, you can optionally disable this step\n    CGFloat currentInsetTop = scrollView.contentInsets.top;\n    if (currentInsetTop != previousInsetTop) {\n      //contentOffset.y -= (currentInsetTop - previousInsetTop);\n      //scrollView.contentOffset = contentOffset;\n    }\n  }\n}\n\n+ (NSEdgeInsets)contentInsetsForView:(__unused NSView *)view\n{\n  NSLog(@\"contentInsetsForView not implemented\");\n//  while (view) {\n//    NSViewController *controller = view.reactViewController;\n//    if (controller) {\n//      return (NSEdgeInsets){\n//        controller.topLayoutGuide.length, 0,\n//        controller.bottomLayoutGuide.length, 0\n//      };\n//    }\n//    view = view.superview;\n//  }\n  return NSEdgeInsetsZero;\n}\n\n#pragma mark - View unmounting\n\n- (void)react_remountAllSubviews\n{\n  if (_removeClippedSubviews) {\n    for (NSView *view in self.reactSubviews) {\n      if (view.superview != self) {\n        [self addSubview:view];\n        [view react_remountAllSubviews];\n      }\n    }\n  } else {\n    // If _removeClippedSubviews is false, we must already be showing all subviews\n    [super react_remountAllSubviews];\n  }\n}\n\n- (void)react_updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(NSView *)clipView\n{\n  // TODO (#5906496): for scrollviews (the primary use-case) we could\n  // optimize this by only doing a range check along the scroll axis,\n  // instead of comparing the whole frame\n\n  if (!_removeClippedSubviews) {\n    // Use default behavior if unmounting is disabled\n    return [super react_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView];\n  }\n\n  if (self.reactSubviews.count == 0) {\n    // Do nothing if we have no subviews\n    return;\n  }\n\n  if (CGSizeEqualToSize(self.bounds.size, CGSizeZero)) {\n    // Do nothing if layout hasn't happened yet\n    return;\n  }\n\n  // Convert clipping rect to local coordinates\n  clipRect = [clipView convertRect:clipRect toView:self];\n  clipRect = CGRectIntersection(clipRect, self.bounds);\n  clipView = self;\n\n  // Mount / unmount views\n  for (NSView *view in self.reactSubviews) {\n    if (!CGSizeEqualToSize(CGRectIntersection(clipRect, view.frame).size, CGSizeZero)) {\n      // View is at least partially visible, so remount it if unmounted\n      [self addSubview:view];\n\n      // Then test its subviews\n      if (CGRectContainsRect(clipRect, view.frame)) {\n        // View is fully visible, so remount all subviews\n        [view react_remountAllSubviews];\n      } else {\n        // View is partially visible, so update clipped subviews\n        [view react_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView];\n      }\n\n    } else if (view.superview) {\n\n      // View is completely outside the clipRect, so unmount it\n      [view removeFromSuperview];\n    }\n  }\n}\n\n- (void)setRemoveClippedSubviews:(BOOL)removeClippedSubviews\n{\n  if (!removeClippedSubviews && _removeClippedSubviews) {\n    [self react_remountAllSubviews];\n  }\n  _removeClippedSubviews = removeClippedSubviews;\n}\n\n- (void)didUpdateReactSubviews\n{\n  if (_removeClippedSubviews) {\n    [self updateClippedSubviews];\n  } else {\n    [super didUpdateReactSubviews];\n  }\n}\n\n- (void)updateClippedSubviews\n{\n  // Find a suitable view to use for clipping\n  NSView *clipView = [self react_findClipView];\n  if (clipView) {\n    [self react_updateClippedSubviewsWithClipRect:clipView.bounds relativeToView:clipView];\n  }\n}\n\n- (void)layout\n{\n  // TODO (#5906496): this a nasty performance drain, but necessary\n  // to prevent gaps appearing when the loading spinner disappears.\n  // We might be able to fix this another way by triggering a call\n  // to updateClippedSubviews manually after loading\n\n  [super layout];\n\n  if (_removeClippedSubviews) {\n    [self updateClippedSubviews];\n  }\n\n}\n\n#pragma mark - Borders\n\n- (NSColor *)backgroundColor\n{\n  return _backgroundColor;\n}\n\n- (void)setBackgroundColor:(NSColor *)backgroundColor\n{\n  if ([_backgroundColor isEqual:backgroundColor]) {\n    return;\n  }\n  if (backgroundColor == nil) {\n    [self setWantsLayer:NO];\n    self.layer = NULL;\n    return;\n  }\n  if (![self wantsLayer] || self.layer == nil) {\n    [self setWantsLayer:YES];\n    self.layer.delegate = self;\n  }\n  [self.layer setBackgroundColor:[backgroundColor CGColor]];\n  [self.layer setNeedsDisplay];\n  [self setNeedsDisplay:YES];\n  _backgroundColor = backgroundColor;\n}\n\nstatic CGFloat RCTDefaultIfNegativeTo(CGFloat defaultValue, CGFloat x) {\n  return x >= 0 ? x : defaultValue;\n};\n\n- (NSEdgeInsets)bordersAsInsets\n{\n  const CGFloat borderWidth = MAX(0, _borderWidth);\n  const BOOL isRTL = _reactLayoutDirection == NSUserInterfaceLayoutDirectionRightToLeft;\n\n  if ([[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL]) {\n    const CGFloat borderStartWidth = RCTDefaultIfNegativeTo(_borderLeftWidth, _borderStartWidth);\n    const CGFloat borderEndWidth = RCTDefaultIfNegativeTo(_borderRightWidth, _borderEndWidth);\n\n    const CGFloat directionAwareBorderLeftWidth = isRTL ? borderEndWidth : borderStartWidth;\n    const CGFloat directionAwareBorderRightWidth = isRTL ? borderStartWidth : borderEndWidth;\n\n    return (NSEdgeInsets) {\n      RCTDefaultIfNegativeTo(borderWidth, _borderTopWidth),\n      RCTDefaultIfNegativeTo(borderWidth, directionAwareBorderLeftWidth),\n      RCTDefaultIfNegativeTo(borderWidth, _borderBottomWidth),\n      RCTDefaultIfNegativeTo(borderWidth, directionAwareBorderRightWidth),\n    };\n  }\n\n  const CGFloat directionAwareBorderLeftWidth = isRTL ? _borderEndWidth : _borderStartWidth;\n  const CGFloat directionAwareBorderRightWidth = isRTL ? _borderStartWidth : _borderEndWidth;\n\n  return (NSEdgeInsets) {\n    RCTDefaultIfNegativeTo(borderWidth, _borderTopWidth),\n    RCTDefaultIfNegativeTo(borderWidth, RCTDefaultIfNegativeTo(_borderLeftWidth, directionAwareBorderLeftWidth)),\n    RCTDefaultIfNegativeTo(borderWidth, _borderBottomWidth),\n    RCTDefaultIfNegativeTo(borderWidth, RCTDefaultIfNegativeTo(_borderRightWidth, directionAwareBorderRightWidth)),\n  };\n}\n\n- (RCTCornerRadii)cornerRadii\n{\n  const BOOL isRTL = _reactLayoutDirection == NSUserInterfaceLayoutDirectionRightToLeft;\n  const CGFloat radius = MAX(0, _borderRadius);\n\n  CGFloat topLeftRadius;\n  CGFloat topRightRadius;\n  CGFloat bottomLeftRadius;\n  CGFloat bottomRightRadius;\n\n  if ([[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL]) {\n    const CGFloat topStartRadius = RCTDefaultIfNegativeTo(_borderTopLeftRadius, _borderTopStartRadius);\n    const CGFloat topEndRadius = RCTDefaultIfNegativeTo(_borderTopRightRadius, _borderTopEndRadius);\n    const CGFloat bottomStartRadius = RCTDefaultIfNegativeTo(_borderBottomLeftRadius, _borderBottomStartRadius);\n    const CGFloat bottomEndRadius = RCTDefaultIfNegativeTo(_borderBottomRightRadius, _borderBottomEndRadius);\n\n    const CGFloat directionAwareTopLeftRadius = isRTL ? topEndRadius : topStartRadius;\n    const CGFloat directionAwareTopRightRadius = isRTL ? topStartRadius : topEndRadius;\n    const CGFloat directionAwareBottomLeftRadius = isRTL ? bottomEndRadius : bottomStartRadius;\n    const CGFloat directionAwareBottomRightRadius = isRTL ? bottomStartRadius : bottomEndRadius;\n\n    topLeftRadius = RCTDefaultIfNegativeTo(radius, directionAwareTopLeftRadius);\n    topRightRadius = RCTDefaultIfNegativeTo(radius, directionAwareTopRightRadius);\n    bottomLeftRadius = RCTDefaultIfNegativeTo(radius, directionAwareBottomLeftRadius);\n    bottomRightRadius = RCTDefaultIfNegativeTo(radius, directionAwareBottomRightRadius);\n  } else {\n    const CGFloat directionAwareTopLeftRadius = isRTL ? _borderTopEndRadius : _borderTopStartRadius;\n    const CGFloat directionAwareTopRightRadius = isRTL ? _borderTopStartRadius : _borderTopEndRadius;\n    const CGFloat directionAwareBottomLeftRadius = isRTL ? _borderBottomEndRadius : _borderBottomStartRadius;\n    const CGFloat directionAwareBottomRightRadius = isRTL ? _borderBottomStartRadius : _borderBottomEndRadius;\n\n    topLeftRadius = RCTDefaultIfNegativeTo(radius, RCTDefaultIfNegativeTo(_borderTopLeftRadius, directionAwareTopLeftRadius));\n    topRightRadius = RCTDefaultIfNegativeTo(radius, RCTDefaultIfNegativeTo(_borderTopRightRadius, directionAwareTopRightRadius));\n    bottomLeftRadius = RCTDefaultIfNegativeTo(radius, RCTDefaultIfNegativeTo(_borderBottomLeftRadius, directionAwareBottomLeftRadius));\n    bottomRightRadius = RCTDefaultIfNegativeTo(radius, RCTDefaultIfNegativeTo(_borderBottomRightRadius, directionAwareBottomRightRadius));\n  }\n\n  // Get scale factors required to prevent radii from overlapping\n  const CGSize size = self.bounds.size;\n  const CGFloat topScaleFactor = RCTZeroIfNaN(MIN(1, size.width / (topLeftRadius + topRightRadius)));\n  const CGFloat bottomScaleFactor = RCTZeroIfNaN(MIN(1, size.width / (bottomLeftRadius + bottomRightRadius)));\n  const CGFloat rightScaleFactor = RCTZeroIfNaN(MIN(1, size.height / (topRightRadius + bottomRightRadius)));\n  const CGFloat leftScaleFactor = RCTZeroIfNaN(MIN(1, size.height / (topLeftRadius + bottomLeftRadius)));\n\n  // Return scaled radii\n  return (RCTCornerRadii){\n    topLeftRadius * MIN(topScaleFactor, leftScaleFactor),\n    topRightRadius * MIN(topScaleFactor, rightScaleFactor),\n    bottomLeftRadius * MIN(bottomScaleFactor, leftScaleFactor),\n    bottomRightRadius * MIN(bottomScaleFactor, rightScaleFactor),\n  };\n}\n\n- (RCTBorderColors)borderColors\n{\n  const BOOL isRTL = _reactLayoutDirection == NSUserInterfaceLayoutDirectionRightToLeft;\n\n  if ([[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL]) {\n    const CGColorRef borderStartColor = _borderStartColor ?: _borderLeftColor;\n    const CGColorRef borderEndColor = _borderEndColor ?: _borderRightColor;\n\n    const CGColorRef directionAwareBorderLeftColor = isRTL ? borderEndColor : borderStartColor;\n    const CGColorRef directionAwareBorderRightColor = isRTL ? borderStartColor : borderEndColor;\n\n    return (RCTBorderColors){\n      _borderTopColor ?: _borderColor,\n      directionAwareBorderLeftColor ?: _borderColor,\n      _borderBottomColor ?: _borderColor,\n      directionAwareBorderRightColor ?: _borderColor,\n    };\n  }\n\n  const CGColorRef directionAwareBorderLeftColor = isRTL ? _borderEndColor : _borderStartColor;\n  const CGColorRef directionAwareBorderRightColor = isRTL ? _borderStartColor : _borderEndColor;\n\n  return (RCTBorderColors){\n    _borderTopColor ?: _borderColor,\n    directionAwareBorderLeftColor ?: _borderLeftColor ?: _borderColor,\n    _borderBottomColor ?: _borderColor,\n    directionAwareBorderRightColor ?: _borderRightColor ?: _borderColor,\n  };\n}\n\n- (void)reactSetFrame:(CGRect)frame\n{\n  // TODO: understand if we need to be able to disable live resizing for certain use\n  //  if (self.inLiveResize && !self.respondsToLiveResizing) {\n  //    return;\n  //  }\n  // If frame is zero, or below the threshold where the border radii can\n  // be rendered as a stretchable image, we'll need to re-render.\n  // TODO: detect up-front if re-rendering is necessary\n  CGSize oldSize = self.bounds.size;\n  [super reactSetFrame:frame];\n  if (!CGSizeEqualToSize(self.bounds.size, oldSize)) {\n    [self.layer setNeedsDisplay];\n  }\n}\n\n- (void)ensureLayerExists\n{\n  if (!self.layer) {\n    // Set `wantsLayer` first to create a \"layer-backed view\" instead of a \"layer-hosting view\".\n    self.wantsLayer = YES;\n\n    CALayer *layer = [CALayer layer];\n    layer.delegate = self;\n    self.layer = layer;\n  }\n}\n\n- (void)displayLayer:(CALayer *)layer\n{\n  if (self.shouldBeTransformed) {\n    self.layer.transform = self.transform;\n    self.shouldBeTransformed = NO;\n  }\n  \n  if (CGSizeEqualToSize(layer.bounds.size, CGSizeZero)) {\n    return;\n  }\n\n  RCTUpdateShadowPathForView(self);\n\n  const RCTCornerRadii cornerRadii = [self cornerRadii];\n  const NSEdgeInsets borderInsets = [self bordersAsInsets];\n  const RCTBorderColors borderColors = [self borderColors];\n\n  BOOL useIOSBorderRendering =\n  !RCTRunningInTestEnvironment() &&\n  RCTCornerRadiiAreEqual(cornerRadii) &&\n  RCTBorderInsetsAreEqual(borderInsets) &&\n  RCTBorderColorsAreEqual(borderColors) &&\n  _borderStyle == RCTBorderStyleSolid &&\n\n  // iOS draws borders in front of the content whereas CSS draws them behind\n  // the content. For this reason, only use iOS border drawing when clipping\n  // or when the border is hidden.\n\n  (borderInsets.top == 0 || (borderColors.top && CGColorGetAlpha(borderColors.top) == 0) || self.clipsToBounds);\n\n  // iOS clips to the outside of the border, but CSS clips to the inside. To\n  // solve this, we'll need to add a container view inside the main view to\n  // correctly clip the subviews.\n  if (useIOSBorderRendering) {\n    layer.cornerRadius = cornerRadii.topLeft;\n    layer.borderColor = borderColors.left;\n    layer.borderWidth = borderInsets.left;\n    layer.contents = nil;\n    layer.needsDisplayOnBoundsChange = NO;\n    layer.mask = nil;\n    return;\n  }\n\n  NSImage *image = RCTGetBorderImage(_borderStyle,\n                                     layer.bounds.size,\n                                     cornerRadii,\n                                     borderInsets,\n                                     borderColors,\n                                     _backgroundColor.CGColor,\n                                     self.clipsToBounds);\n\n  layer.backgroundColor = NULL;\n\n  if (image == nil) {\n    layer.contents = nil;\n    layer.needsDisplayOnBoundsChange = NO;\n    return;\n  }\n\n  CGRect contentsCenter = ({\n    CGSize size = image.size;\n    NSEdgeInsets insets = image.capInsets;\n    CGRectMake(\n      insets.left / size.width,\n      insets.top / size.height,\n      1.0 / size.width,\n      1.0 / size.height\n    );\n  });\n\n  if (RCTRunningInTestEnvironment()) {\n    const CGSize size = self.bounds.size;\n    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);\n    [image drawInRect:(CGRect){CGPointZero, size}];\n    image = UIGraphicsGetImageFromCurrentImageContext();\n    UIGraphicsEndImageContext();\n    contentsCenter = CGRectMake(0, 0, 1, 1);\n  }\n\n  layer.contents = (id)image;\n  layer.contentsScale = [image recommendedLayerContentsScale:0.0];\n  layer.contentsCenter = contentsCenter;\n  layer.magnificationFilter = kCAFilterNearest;\n  layer.needsDisplayOnBoundsChange = YES;\n\n  [self updateClippingForLayer:layer];\n}\n\nstatic BOOL RCTLayerHasShadow(CALayer *layer)\n{\n  return layer.shadowOpacity * CGColorGetAlpha(layer.shadowColor) > 0;\n}\n\nstatic void RCTUpdateShadowPathForView(RCTView *view)\n{\n  if (RCTLayerHasShadow(view.layer)) {\n    if (CGColorGetAlpha(view.backgroundColor.CGColor) > 0.999) {\n\n      // If view has a solid background color, calculate shadow path from border\n      const RCTCornerRadii cornerRadii = [view cornerRadii];\n      const RCTCornerInsets cornerInsets = RCTGetCornerInsets(cornerRadii, NSEdgeInsetsZero);\n      CGPathRef shadowPath = RCTPathCreateWithRoundedRect(view.bounds, cornerInsets, NULL);\n      view.layer.shadowPath = shadowPath;\n      CGPathRelease(shadowPath);\n\n    } else {\n\n      // Can't accurately calculate box shadow, so fall back to pixel-based shadow\n      view.layer.shadowPath = nil;\n\n      RCTLogAdvice(@\"View #%@ of type %@ has a shadow set but cannot calculate \"\n        \"shadow efficiently. Consider setting a background color to \"\n        \"fix this, or apply the shadow to a more specific component.\",\n        view.reactTag, [view class]);\n    }\n  }\n}\n\n- (void)updateClippingForLayer:(CALayer *)layer\n{\n  CALayer *mask = nil;\n  CGFloat cornerRadius = 0;\n  if (self.clipsToBounds) {\n\n    const RCTCornerRadii cornerRadii = [self cornerRadii];\n    if (RCTCornerRadiiAreEqual(cornerRadii)) {\n      cornerRadius = cornerRadii.topLeft;\n    } else {\n      CAShapeLayer *shapeLayer = [CAShapeLayer layer];\n      CGPathRef path = RCTPathCreateWithRoundedRect(self.bounds, RCTGetCornerInsets(cornerRadii, NSEdgeInsetsZero), NULL);\n      shapeLayer.path = path;\n      CGPathRelease(path);\n      mask = shapeLayer;\n    }\n  }\n  layer.cornerRadius = cornerRadius;\n  layer.mask = mask;\n}\n\n- (void)contextMenuItemClicked:(NSMenuItem *)sender\n{\n  NSDictionary *menuItem = (NSDictionary *)sender.representedObject;\n  if (_onContextMenuItemClick) {\n    _onContextMenuItemClick(@{@\"menuItem\": menuItem});\n  } else {\n    RCTLogWarn(@\"Set onContextMenuItemClick to handle this event\");\n  }\n}\n\n- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender\n{\n  NSPasteboard *pboard;\n  NSDragOperation sourceDragMask;\n  sourceDragMask = [sender draggingSourceOperationMask];\n  pboard = [sender draggingPasteboard];\n\n  _onDragEnter(@{\n                 @\"sourceDragMask\": @(sourceDragMask),\n                 });\n  if ( [[pboard types] containsObject:NSColorPboardType] ) {\n    if (sourceDragMask & NSDragOperationGeneric) {\n      return NSDragOperationGeneric;\n    }\n  }\n  if ( [[pboard types] containsObject:NSFilenamesPboardType] ) {\n    if (sourceDragMask & NSDragOperationLink) {\n      return NSDragOperationLink;\n    } else if (sourceDragMask & NSDragOperationCopy) {\n      return NSDragOperationCopy;\n    }\n  }\n  return NSDragOperationNone;\n}\n\n- (void)draggingExited:(id<NSDraggingInfo>)sender\n{\n  _onDragLeave(@{@\"sourceDragMask\": @([sender draggingSourceOperationMask])});\n}\n\n- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender {\n  NSPasteboard *pboard = [sender draggingPasteboard];\n\n  if ( [[pboard types] containsObject:NSFilenamesPboardType] ) {\n    NSArray *files = [pboard propertyListForType:NSFilenamesPboardType];\n    _onDrop(@{@\"files\": files });\n  }\n  return YES;\n}\n\n#pragma mark Border Color\n\n#define setBorderColor(side)                                \\\n  - (void)setBorder##side##Color:(CGColorRef)color          \\\n  {                                                         \\\n    if (CGColorEqualToColor(_border##side##Color, color)) { \\\n      return;                                               \\\n    }                                                       \\\n    CGColorRelease(_border##side##Color);                   \\\n    _border##side##Color = CGColorRetain(color);            \\\n    [self.layer setNeedsDisplay];                           \\\n  }\n\nsetBorderColor()\nsetBorderColor(Top)\nsetBorderColor(Right)\nsetBorderColor(Bottom)\nsetBorderColor(Left)\nsetBorderColor(Start)\nsetBorderColor(End)\n\n#pragma mark - Border Width\n\n#define setBorderWidth(side)                    \\\n  - (void)setBorder##side##Width:(CGFloat)width \\\n  {                                             \\\n    if (_border##side##Width == width) {        \\\n      return;                                   \\\n    }                                           \\\n    _border##side##Width = width;               \\\n    [self.layer setNeedsDisplay];               \\\n  }\n\nsetBorderWidth()\nsetBorderWidth(Top)\nsetBorderWidth(Right)\nsetBorderWidth(Bottom)\nsetBorderWidth(Left)\nsetBorderWidth(Start)\nsetBorderWidth(End)\n\n#pragma mark - Border Radius\n\n#define setBorderRadius(side)                     \\\n  - (void)setBorder##side##Radius:(CGFloat)radius \\\n  {                                               \\\n    if (_border##side##Radius == radius) {        \\\n      return;                                     \\\n    }                                             \\\n    _border##side##Radius = radius;               \\\n    [self.layer setNeedsDisplay];                 \\\n  }\n\nsetBorderRadius()\nsetBorderRadius(TopLeft)\nsetBorderRadius(TopRight)\nsetBorderRadius(TopStart)\nsetBorderRadius(TopEnd)\nsetBorderRadius(BottomLeft)\nsetBorderRadius(BottomRight)\nsetBorderRadius(BottomStart)\nsetBorderRadius(BottomEnd)\n\n#pragma mark - Border Style\n\n#define setBorderStyle(side)                           \\\n  - (void)setBorder##side##Style:(RCTBorderStyle)style \\\n  {                                                    \\\n    if (_border##side##Style == style) {               \\\n      return;                                          \\\n    }                                                  \\\n    _border##side##Style = style;                      \\\n    [self.layer setNeedsDisplay];                      \\\n  }\n\nsetBorderStyle()\n\n- (void)dealloc\n{\n  CGColorRelease(_borderColor);\n  CGColorRelease(_borderTopColor);\n  CGColorRelease(_borderRightColor);\n  CGColorRelease(_borderBottomColor);\n  CGColorRelease(_borderLeftColor);\n  CGColorRelease(_borderStartColor);\n  CGColorRelease(_borderEndColor);\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTViewControllerProtocol.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/**\n * A simple protocol that any React-managed ViewControllers should implement.\n * We need all of our ViewControllers to cache layoutGuide changes so any View\n * in our View hierarchy can access accurate layoutGuide info at any time.\n */\n@protocol RCTViewControllerProtocol <NSObject>\n\n//@property (nonatomic, readonly, strong) id<UILayoutSupport> currentTopLayoutGuide;\n//@property (nonatomic, readonly, strong) id<UILayoutSupport> currentBottomLayoutGuide;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTBridgeModule.h>\n#import <React/RCTConvert.h>\n#import <React/RCTDefines.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTLog.h>\n#import <React/NSView+React.h>\n\n@class RCTBridge;\n@class RCTShadowView;\n@class RCTSparseArray;\n@class RCTUIManager;\n\ntypedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry);\n\n@interface RCTViewManager : NSObject <RCTBridgeModule>\n\n/**\n * The bridge can be used to access both the RCTUIIManager and the RCTEventDispatcher,\n * allowing the manager (or the views that it manages) to manipulate the view\n * hierarchy and send events back to the JS context.\n */\n@property (nonatomic, weak) RCTBridge *bridge;\n\n/**\n * This method instantiates a native view to be managed by the module. Override\n * this to return a custom view instance, which may be preconfigured with default\n * properties, subviews, etc. This method will be called many times, and should\n * return a fresh instance each time. The view module MUST NOT cache the returned\n * view and return the same instance for subsequent calls.\n */\n- (NSView *)view;\n\n/**\n * This method instantiates a shadow view to be managed by the module. If omitted,\n * an ordinary RCTShadowView instance will be created, which is typically fine for\n * most view types. As with the -view method, the -shadowView method should return\n * a fresh instance each time it is called.\n */\n- (RCTShadowView *)shadowView;\n\n/**\n * DEPRECATED: declare properties of type RCTBubblingEventBlock instead\n *\n * Returns an array of names of events that can be sent by native views. This\n * should return bubbling, directly-dispatched event types. The event name\n * should not include a prefix such as 'on' or 'top', as this will be applied\n * as needed. When subscribing to the event, use the 'Captured' suffix to\n * indicate the captured form, or omit the suffix for the bubbling form.\n *\n * Note that this method is not inherited when you subclass a view module, and\n * you should not call [super customBubblingEventTypes] when overriding it.\n */\n- (NSArray<NSString *> *)customBubblingEventTypes __deprecated_msg(\"Use RCTBubblingEventBlock props instead.\");\n\n/**\n * Called to notify manager that layout has finished, in case any calculated\n * properties need to be copied over from shadow view to view.\n */\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView;\n\n/**\n * Called after view hierarchy manipulation has finished, and all shadow props\n * have been set, but before layout has been performed. Useful for performing\n * custom layout logic or tasks that involve walking the view hierarchy.\n * To be deprecated, hopefully.\n */\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary<NSNumber *, RCTShadowView *> *)shadowViewRegistry;\n\n/**\n * This handles the simple case, where JS and native property names match.\n */\n#define RCT_EXPORT_VIEW_PROPERTY(name, type) \\\n+ (NSArray<NSString *> *)propConfig_##name { return @[@#type]; }\n\n/**\n * This macro maps a named property to an arbitrary key path in the view.\n */\n#define RCT_REMAP_VIEW_PROPERTY(name, keyPath, type) \\\n+ (NSArray<NSString *> *)propConfig_##name { return @[@#type, @#keyPath]; }\n\n/**\n * This macro can be used when you need to provide custom logic for setting\n * view properties. The macro should be followed by a method body, which can\n * refer to \"json\", \"view\" and \"defaultView\" to implement the required logic.\n */\n#define RCT_CUSTOM_VIEW_PROPERTY(name, type, viewClass) \\\nRCT_REMAP_VIEW_PROPERTY(name, __custom__, type)         \\\n- (void)set_##name:(id)json forView:(viewClass *)view withDefaultView:(viewClass *)defaultView\n\n/**\n * This macro is used to map properties to the shadow view, instead of the view.\n */\n#define RCT_EXPORT_SHADOW_PROPERTY(name, type) \\\n+ (NSArray<NSString *> *)propConfigShadow_##name { return @[@#type]; }\n\n/**\n * This macro maps a named property to an arbitrary key path in the shadow view.\n */\n#define RCT_REMAP_SHADOW_PROPERTY(name, keyPath, type) \\\n+ (NSArray<NSString *> *)propConfigShadow_##name { return @[@#type, @#keyPath]; }\n\n/**\n * This macro can be used when you need to provide custom logic for setting\n * shadow view properties. The macro should be followed by a method body, which can\n * refer to \"json\" and \"view\".\n */\n#define RCT_CUSTOM_SHADOW_PROPERTY(name, type, viewClass) \\\nRCT_REMAP_SHADOW_PROPERTY(name, __custom__, type)         \\\n- (void)set_##name:(id)json forShadowView:(viewClass *)view\n\n@end\n"
  },
  {
    "path": "React/Views/RCTViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTViewManager.h\"\n\n#import \"RCTBorderStyle.h\"\n#import \"RCTBridge.h\"\n#import \"RCTConvert.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTLog.h\"\n#import \"RCTShadowView.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTUIManagerUtils.h\"\n#import \"RCTUtils.h\"\n#import \"RCTView.h\"\n#import \"NSView+React.h\"\n#import \"RCTConvert+Transform.h\"\n\n#if TARGET_OS_TV\n#import \"RCTTVView.h\"\n#endif\n\n@implementation RCTViewManager\n\n@synthesize bridge = _bridge;\n\nRCT_EXPORT_MODULE()\n\n- (dispatch_queue_t)methodQueue\n{\n  return RCTGetUIManagerQueue();\n}\n\n- (NSView *)view\n{\n#if TARGET_OS_TV\n  return [RCTTVView new];\n#else\n  return [RCTView new];\n#endif\n}\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTShadowView new];\n}\n\n- (NSArray<NSString *> *)customBubblingEventTypes\n{\n  return @[\n\n    // Generic events\n    @\"press\",\n    @\"change\",\n    @\"focus\",\n    @\"blur\",\n    @\"submitEditing\",\n    @\"endEditing\",\n    @\"keyPress\",\n\n    // Touch events\n    @\"touchStart\",\n    @\"touchMove\",\n    @\"touchCancel\",\n    @\"touchEnd\",\n\n    // Mouse events\n    @\"mouseEnter\",\n    @\"mouseLeave\",\n  ];\n}\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(__unused RCTShadowView *)shadowView\n{\n  return nil;\n}\n\n- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(__unused NSDictionary<NSNumber *, RCTShadowView *> *)shadowViewRegistry\n{\n  return nil;\n}\n\n- (void)checkLayerExists:(NSView *)view\n{\n  if (!view.layer) {\n    [view setWantsLayer:YES];\n    CALayer *viewLayer = [CALayer layer];\n    viewLayer.delegate = (id<CALayerDelegate>)view;\n    [view setLayer:viewLayer];\n  }\n}\n\n#pragma mark - View properties\n\n#if TARGET_OS_TV\n// Apple TV properties\nRCT_EXPORT_VIEW_PROPERTY(isTVSelectable, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(hasTVPreferredFocus, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(tvParallaxProperties, NSDictionary)\n#endif\n\nRCT_EXPORT_VIEW_PROPERTY(nativeID, NSString)\n\n// Acessibility related properties\n// RCT_REMAP_VIEW_PROPERTY(accessible, reactAccessibilityElement.isAccessibilityElement, BOOL)\n// RCT_REMAP_VIEW_PROPERTY(accessibilityActions, reactAccessibilityElement.accessibilityActions, NSString)\n// RCT_REMAP_VIEW_PROPERTY(accessibilityLabel, reactAccessibilityElement.accessibilityLabel, NSString)\n// RCT_REMAP_VIEW_PROPERTY(accessibilityTraits, reactAccessibilityElement.accessibilityTraits, UIAccessibilityTraits)\n// RCT_REMAP_VIEW_PROPERTY(accessibilityViewIsModal, reactAccessibilityElement.accessibilityViewIsModal, BOOL)\n// RCT_REMAP_VIEW_PROPERTY(onAccessibilityAction, reactAccessibilityElement.onAccessibilityAction, RCTDirectEventBlock)\n// RCT_REMAP_VIEW_PROPERTY(onAccessibilityTap, reactAccessibilityElement.onAccessibilityTap, RCTDirectEventBlock)\n// RCT_REMAP_VIEW_PROPERTY(onMagicTap, reactAccessibilityElement.onMagicTap, RCTDirectEventBlock)\nRCT_REMAP_VIEW_PROPERTY(testID, reactAccessibilityElement.accessibilityIdentifier, NSString)\n\nRCT_EXPORT_VIEW_PROPERTY(backgroundColor, NSColor)\nRCT_REMAP_VIEW_PROPERTY(backfaceVisibility, layer.doubleSided, css_backface_visibility_t)\nRCT_REMAP_VIEW_PROPERTY(shadowColor, layer.shadowColor, CGColor)\nRCT_REMAP_VIEW_PROPERTY(shadowOffset, layer.shadowOffset, CGSize)\nRCT_REMAP_VIEW_PROPERTY(shadowOpacity, layer.shadowOpacity, float)\nRCT_REMAP_VIEW_PROPERTY(shadowRadius, layer.shadowRadius, CGFloat)\nRCT_REMAP_VIEW_PROPERTY(toolTip, toolTip, NSString)\nRCT_CUSTOM_VIEW_PROPERTY(overflow, YGOverflow, RCTView)\n{\n  if (json) {\n    view.clipsToBounds = [RCTConvert YGOverflow:json] != YGOverflowVisible;\n  } else {\n    view.clipsToBounds = defaultView.clipsToBounds;\n  }\n}\nRCT_CUSTOM_VIEW_PROPERTY(shouldRasterizeIOS, BOOL, RCTView)\n{\n  view.layer.shouldRasterize = json ? [RCTConvert BOOL:json] : defaultView.layer.shouldRasterize;\n  view.layer.rasterizationScale = view.layer.shouldRasterize ? [NSScreen mainScreen].backingScaleFactor : defaultView.layer.rasterizationScale;\n}\n\nRCT_CUSTOM_VIEW_PROPERTY(transform, CATransform3D, RCTView)\n{\n  CATransform3D transform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.transform;\n  if ([view respondsToSelector:@selector(shouldBeTransformed)] && !view.superview) {\n    view.shouldBeTransformed = YES;\n    view.transform = transform;\n  } else {\n    view.layer.transform = transform;\n  }\n\n  // TODO: Improve this by enabling edge antialiasing only for transforms with rotation or skewing\n  view.layer.edgeAntialiasingMask = !CATransform3DIsIdentity(transform);\n}\n\nRCT_CUSTOM_VIEW_PROPERTY(draggedTypes, NSArray*<NSString *>, RCTView)\n{\n    if (json) {\n        NSArray *types = [RCTConvert NSArray:json];\n        [view registerForDraggedTypes:types];\n    } else {\n        [view registerForDraggedTypes:defaultView.registeredDraggedTypes];\n    }\n}\n\nRCT_CUSTOM_VIEW_PROPERTY(opacity, float, RCTView)\n{\n    if (json) {\n        [self checkLayerExists:view];\n        [view.layer setOpacity:[RCTConvert float:json]];\n    } else {\n        [view.layer setOpacity:1];\n    }\n}\n\n\nRCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTPointerEvents, RCTView)\n{\n  if ([view respondsToSelector:@selector(setPointerEvents:)]) {\n    view.pointerEvents = json ? [RCTConvert RCTPointerEvents:json] : defaultView.pointerEvents;\n    return;\n  }\n}\n\n\nRCT_CUSTOM_VIEW_PROPERTY(removeClippedSubviews, BOOL, RCTView)\n{\n  if ([view respondsToSelector:@selector(setRemoveClippedSubviews:)]) {\n    view.removeClippedSubviews = json ? [RCTConvert BOOL:json] : defaultView.removeClippedSubviews;\n  }\n}\nRCT_CUSTOM_VIEW_PROPERTY(borderRadius, CGFloat, RCTView) {\n  if ([view respondsToSelector:@selector(setBorderRadius:)]) {\n    [self checkLayerExists:view];\n    view.borderRadius = json ? [RCTConvert CGFloat:json] : defaultView.borderRadius;\n  } else {\n    view.layer.cornerRadius = json ? [RCTConvert CGFloat:json] : defaultView.layer.cornerRadius;\n  }\n}\nRCT_CUSTOM_VIEW_PROPERTY(borderColor, CGColor, RCTView)\n{\n  if ([view respondsToSelector:@selector(setBorderColor:)]) {\n    [self checkLayerExists:view];\n    view.borderColor = json ? [RCTConvert CGColor:json] : defaultView.borderColor;\n  } else {\n    view.layer.borderColor = json ? [RCTConvert CGColor:json] : defaultView.layer.borderColor;\n  }\n}\nRCT_CUSTOM_VIEW_PROPERTY(borderWidth, float, RCTView)\n{\n  if ([view respondsToSelector:@selector(setBorderWidth:)]) {\n    [self checkLayerExists:view];\n    view.borderWidth = json ? [RCTConvert CGFloat:json] : defaultView.borderWidth;\n  } else {\n    view.layer.borderWidth = json ? [RCTConvert CGFloat:json] : defaultView.layer.borderWidth;\n  }\n}\nRCT_CUSTOM_VIEW_PROPERTY(borderStyle, RCTBorderStyle, RCTView)\n{\n  if ([view respondsToSelector:@selector(setBorderStyle:)]) {\n    view.borderStyle = json ? [RCTConvert RCTBorderStyle:json] : defaultView.borderStyle;\n  }\n}\nRCT_CUSTOM_VIEW_PROPERTY(hitSlop, UIEdgeInsets, RCTView)\n{\n  if ([view respondsToSelector:@selector(setHitTestEdgeInsets:)]) {\n    if (json) {\n      NSEdgeInsets hitSlopInsets = [RCTConvert NSEdgeInsets:json];\n      view.hitTestEdgeInsets = NSEdgeInsetsMake(-hitSlopInsets.top, -hitSlopInsets.left, -hitSlopInsets.bottom, -hitSlopInsets.right);\n    } else {\n      view.hitTestEdgeInsets = defaultView.hitTestEdgeInsets;\n    }\n  }\n}\n\n// RCT_EXPORT_VIEW_PROPERTY(onAccessibilityTap, RCTDirectEventBlock)\n// RCT_EXPORT_VIEW_PROPERTY(onMagicTap, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onDragEnter, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onDragLeave, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onDrop, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onContextMenuItemClick, RCTDirectEventBlock)\n\nRCT_CUSTOM_VIEW_PROPERTY(contextMenu, NSArray*<NSDictionary *>, __unused RCTView)\n{\n  if ([view respondsToSelector:@selector(setMenu:)] && json) {\n    NSArray *menuList = [RCTConvert NSArray:json];\n    if (menuList.count > 0) {\n      NSMenu *menu = [[NSMenu alloc] init];\n      for (NSUInteger i = 0; i < menuList.count; i++)\n      {\n        if (menuList[i][@\"isSeparator\"]) {\n          [menu addItem:[NSMenuItem separatorItem]];\n        } else {\n          NSMenuItem *menuItem = [[NSMenuItem alloc] init];\n          [menuItem setTarget:view];\n          [menuItem setAction:@selector(contextMenuItemClicked:)];\n          if (menuList[i][@\"key\"]) {\n            [menuItem setKeyEquivalent:menuList[i][@\"key\"]];\n          }\n\n          [menuItem setRepresentedObject:menuList[i]];\n          menuItem.title = menuList[i][@\"title\"];\n          [menu addItem:menuItem];\n        }\n      }\n      [view setMenu:menu];\n    }\n  }\n}\n\n#define RCT_VIEW_BORDER_PROPERTY(SIDE)                                  \\\nRCT_CUSTOM_VIEW_PROPERTY(border##SIDE##Width, float, RCTView)           \\\n{                                                                       \\\n  if ([view respondsToSelector:@selector(setBorder##SIDE##Width:)]) {   \\\n    [self checkLayerExists:view];                                       \\\n    view.border##SIDE##Width = json ? [RCTConvert CGFloat:json] : defaultView.border##SIDE##Width; \\\n  }                                                                     \\\n}                                                                       \\\nRCT_CUSTOM_VIEW_PROPERTY(border##SIDE##Color, NSColor, RCTView)         \\\n{                                                                       \\\n  if ([view respondsToSelector:@selector(setBorder##SIDE##Color:)]) {   \\\n    [self checkLayerExists:view];                                       \\\n    view.border##SIDE##Color = json ? [RCTConvert CGColor:json] : defaultView.border##SIDE##Color; \\\n  }                                                                     \\\n}\n\nRCT_VIEW_BORDER_PROPERTY(Top)\nRCT_VIEW_BORDER_PROPERTY(Right)\nRCT_VIEW_BORDER_PROPERTY(Bottom)\nRCT_VIEW_BORDER_PROPERTY(Left)\nRCT_VIEW_BORDER_PROPERTY(Start)\nRCT_VIEW_BORDER_PROPERTY(End)\n\n#define RCT_VIEW_BORDER_RADIUS_PROPERTY(SIDE)                           \\\nRCT_CUSTOM_VIEW_PROPERTY(border##SIDE##Radius, CGFloat, RCTView)        \\\n{                                                                       \\\n  if ([view respondsToSelector:@selector(setBorder##SIDE##Radius:)]) {  \\\n    view.border##SIDE##Radius = json ? [RCTConvert CGFloat:json] : defaultView.border##SIDE##Radius; \\\n  }                                                                     \\\n}                                                                       \\\n\nRCT_VIEW_BORDER_RADIUS_PROPERTY(TopLeft)\nRCT_VIEW_BORDER_RADIUS_PROPERTY(TopRight)\nRCT_VIEW_BORDER_RADIUS_PROPERTY(TopStart)\nRCT_VIEW_BORDER_RADIUS_PROPERTY(TopEnd)\nRCT_VIEW_BORDER_RADIUS_PROPERTY(BottomLeft)\nRCT_VIEW_BORDER_RADIUS_PROPERTY(BottomRight)\nRCT_VIEW_BORDER_RADIUS_PROPERTY(BottomStart)\nRCT_VIEW_BORDER_RADIUS_PROPERTY(BottomEnd)\n\nRCT_REMAP_VIEW_PROPERTY(display, reactDisplay, YGDisplay)\nRCT_REMAP_VIEW_PROPERTY(zIndex, reactZIndex, NSInteger)\n\n#pragma mark - ShadowView properties\n\nRCT_EXPORT_SHADOW_PROPERTY(top, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(right, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(start, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(end, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(bottom, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(left, YGValue)\n\nRCT_EXPORT_SHADOW_PROPERTY(width, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(height, YGValue)\n\nRCT_EXPORT_SHADOW_PROPERTY(minWidth, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(maxWidth, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(minHeight, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(maxHeight, YGValue)\n\nRCT_EXPORT_SHADOW_PROPERTY(borderTopWidth, float)\nRCT_EXPORT_SHADOW_PROPERTY(borderRightWidth, float)\nRCT_EXPORT_SHADOW_PROPERTY(borderBottomWidth, float)\nRCT_EXPORT_SHADOW_PROPERTY(borderLeftWidth, float)\nRCT_EXPORT_SHADOW_PROPERTY(borderStartWidth, float)\nRCT_EXPORT_SHADOW_PROPERTY(borderEndWidth, float)\nRCT_EXPORT_SHADOW_PROPERTY(borderWidth, float)\n\nRCT_EXPORT_SHADOW_PROPERTY(marginTop, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(marginRight, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(marginBottom, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(marginLeft, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(marginStart, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(marginEnd, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(marginVertical, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(marginHorizontal, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(margin, YGValue)\n\nRCT_EXPORT_SHADOW_PROPERTY(paddingTop, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(paddingRight, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(paddingBottom, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(paddingLeft, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(paddingStart, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(paddingEnd, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(paddingVertical, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(paddingHorizontal, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(padding, YGValue)\n\nRCT_EXPORT_SHADOW_PROPERTY(flex, float)\nRCT_EXPORT_SHADOW_PROPERTY(flexGrow, float)\nRCT_EXPORT_SHADOW_PROPERTY(flexShrink, float)\nRCT_EXPORT_SHADOW_PROPERTY(flexBasis, YGValue)\nRCT_EXPORT_SHADOW_PROPERTY(flexDirection, YGFlexDirection)\nRCT_EXPORT_SHADOW_PROPERTY(flexWrap, YGWrap)\nRCT_EXPORT_SHADOW_PROPERTY(justifyContent, YGJustify)\nRCT_EXPORT_SHADOW_PROPERTY(alignItems, YGAlign)\nRCT_EXPORT_SHADOW_PROPERTY(alignSelf, YGAlign)\nRCT_EXPORT_SHADOW_PROPERTY(alignContent, YGAlign)\nRCT_EXPORT_SHADOW_PROPERTY(position, YGPositionType)\nRCT_EXPORT_SHADOW_PROPERTY(aspectRatio, float)\n\nRCT_EXPORT_SHADOW_PROPERTY(overflow, YGOverflow)\nRCT_EXPORT_SHADOW_PROPERTY(display, YGDisplay)\n\nRCT_EXPORT_SHADOW_PROPERTY(onLayout, RCTDirectEventBlock)\n\nRCT_EXPORT_SHADOW_PROPERTY(direction, YGDirection)\n\n@end\n"
  },
  {
    "path": "React/Views/RCTWebView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTView.h>\n\n@class RCTWebView;\n\n/**\n * Special scheme used to pass messages to the injectedJavaScript\n * code without triggering a page load. Usage:\n *\n *   window.location.href = RCTJSNavigationScheme + '://hello'\n */\nextern NSString *const RCTJSNavigationScheme;\n\n@protocol RCTWebViewDelegate <NSObject>\n\n- (BOOL)webView:(RCTWebView *)webView\nshouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request\n   withCallback:(RCTDirectEventBlock)callback;\n\n@end\n\n@interface RCTWebView : RCTView\n\n@property (nonatomic, weak) id<RCTWebViewDelegate> delegate;\n\n@property (nonatomic, copy) NSDictionary *source;\n@property (nonatomic, assign) NSEdgeInsets contentInset;\n@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;\n@property (nonatomic, assign) BOOL messagingEnabled;\n@property (nonatomic, copy) NSString *injectedJavaScript;\n@property (nonatomic, assign) BOOL scalesPageToFit;\n\n- (void)goForward;\n- (void)goBack;\n- (void)reload;\n- (void)stopLoading;\n- (void)postMessage:(NSString *)message;\n- (void)injectJavaScript:(NSString *)script;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTWebView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTWebView.h\"\n\n#import <AppKit/AppKit.h>\n#import <WebKit/WebKit.h>\n\n#import \"RCTAutoInsetsProtocol.h\"\n#import \"RCTConvert.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTLog.h\"\n#import \"RCTUtils.h\"\n#import \"RCTView.h\"\n#import \"NSView+React.h\"\n\nNSString *const RCTJSNavigationScheme = @\"react-js-navigation\";\n\nstatic NSString *const kPostMessageHost = @\"postMessage\";\n\n@interface RCTWebView () <WebFrameLoadDelegate, WebResourceLoadDelegate, RCTAutoInsetsProtocol>\n\n@property (nonatomic, copy) RCTDirectEventBlock onLoadingStart;\n@property (nonatomic, copy) RCTDirectEventBlock onLoadingFinish;\n@property (nonatomic, copy) RCTDirectEventBlock onLoadingError;\n@property (nonatomic, copy) RCTDirectEventBlock onShouldStartLoadWithRequest;\n@property (nonatomic, copy) RCTDirectEventBlock onMessage;\n\n@end\n\n@implementation RCTWebView\n{\n  WebView *_webView;\n  NSString *_injectedJavaScript;\n}\n\n- (void)dealloc\n{\n  _webView.frameLoadDelegate = nil;\n  _webView.resourceLoadDelegate = nil;\n}\n\n- (instancetype)initWithFrame:(CGRect)frame\n{\n  if ((self = [super initWithFrame:frame])) {\n    CALayer *viewLayer = [CALayer layer];\n    [viewLayer setBackgroundColor:[[NSColor clearColor] CGColor]]; //RGB plus Alpha Channel\n    [self setWantsLayer:YES]; // view's backing store is using a Core Animation Layer\n    [self setLayer:viewLayer];\n    _automaticallyAdjustContentInsets = YES;\n    _contentInset = NSEdgeInsetsZero;\n    _webView = [[WebView alloc] initWithFrame:self.bounds];\n    [WebView registerURLSchemeAsLocal:RCTJSNavigationScheme];\n    [_webView setFrameLoadDelegate:self];\n    [_webView setResourceLoadDelegate:self];\n    [self addSubview:_webView];\n  }\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (void)goForward\n{\n  [_webView goForward];\n}\n\n- (void)goBack\n{\n  [_webView goBack];\n}\n\n- (void)reload\n{\n  [_webView reload:self];\n}\n\n- (void)reactSetFrame:(CGRect)frame\n{\n  [super reactSetFrame:frame];\n  [_webView setFrame:frame];\n}\n\n- (void)stopLoading\n{\n  [_webView.webFrame stopLoading];\n}\n\n- (void)postMessage:(NSString *)message\n{\n  NSDictionary *eventInitDict = @{\n    @\"data\": message,\n  };\n  NSString *source = [NSString\n    stringWithFormat:@\"document.dispatchEvent(new MessageEvent('message', %@));\",\n    RCTJSONStringify(eventInitDict, NULL)\n  ];\n  [_webView stringByEvaluatingJavaScriptFromString:source];\n}\n\n- (void)injectJavaScript:(NSString *)script\n{\n  [_webView stringByEvaluatingJavaScriptFromString:script];\n}\n\n- (void)setSource:(NSDictionary *)source\n{\n  if (![_source isEqualToDictionary:source]) {\n    _source = [source copy];\n\n    // Check for a static html source first\n    NSString *html = [RCTConvert NSString:source[@\"html\"]];\n    if (html) {\n      NSURL *baseURL = [RCTConvert NSURL:source[@\"baseUrl\"]];\n      if (!baseURL) {\n        baseURL = [NSURL URLWithString:@\"about:blank\"];\n      }\n      [_webView.mainFrame loadHTMLString:html baseURL:baseURL];\n      return;\n    }\n\n    NSURLRequest *request = [RCTConvert NSURLRequest:source];\n    // Because of the way React works, as pages redirect, we actually end up\n    // passing the redirect urls back here, so we ignore them if trying to load\n    // the same url. We'll expose a call to 'reload' to allow a user to load\n    // the existing page.\n    if ([request.URL isEqual:_webView.mainFrameURL]) {\n      return;\n    }\n    if (!request.URL) {\n      // Clear the webview\n      [_webView.mainFrame loadHTMLString:@\"\" baseURL:nil];\n      return;\n    }\n    [_webView.mainFrame loadRequest:request];\n  }\n}\n\n- (void)layout\n{\n  [super layout];\n  _webView.frame = self.bounds;\n}\n\n- (void)setContentInset:(NSEdgeInsets)contentInset\n{\n  _contentInset = contentInset;\n//  [RCTView autoAdjustInsetsForView:self\n//                    withScrollView:_webView.scrollView\n//                      updateOffset:NO];\n}\n\n- (BOOL)scalesPageToFit\n{\n  return YES;\n}\n\n- (void)setBackgroundColor:(NSColor *)backgroundColor\n{\n  CGFloat alpha = CGColorGetAlpha(backgroundColor.CGColor);\n  [self.layer setOpaque:(alpha == 1.0)];\n  [[_webView layer] setBackgroundColor:[backgroundColor CGColor]];\n}\n\n- (NSColor *)backgroundColor\n{\n  return _webView.layer.backgroundColor;\n}\n\n- (NSMutableDictionary<NSString *, id> *)baseEvent\n{\n  NSMutableDictionary<NSString *, id> *event = [[NSMutableDictionary alloc] initWithDictionary:@{\n    @\"url\": _webView.mainFrameURL ?: @\"\",\n    @\"loading\" : @(_webView.loading),\n    @\"title\": [_webView stringByEvaluatingJavaScriptFromString:@\"document.title\"],\n    @\"canGoBack\": @(_webView.canGoBack),\n    @\"canGoForward\" : @(_webView.canGoForward),\n  }];\n\n  return event;\n}\n\n- (void)refreshContentInset\n{\n//  [RCTView autoAdjustInsetsForView:self\n//                    withScrollView:_webView.scrollView\n//                      updateOffset:YES];\n}\n\n#pragma mark - UIWebViewDelegate methods\n\n- (void)webView:(WebView *)sender\nwillPerformClientRedirectToURL:(NSURL *)URL\n          delay:(NSTimeInterval)seconds\n       fireDate:(NSDate *)date\n       forFrame:(WebFrame *)frame {\n   BOOL isJSNavigation = [URL.scheme isEqualToString:RCTJSNavigationScheme];\n  if (isJSNavigation && [URL.host isEqualToString:kPostMessageHost]) {\n    NSString *data = URL.query;\n    data = [data stringByReplacingOccurrencesOfString:@\"+\" withString:@\" \"];\n    data = [data stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];\n\n    NSMutableDictionary<NSString *, id> *event = [self baseEvent];\n    [event addEntriesFromDictionary: @{\n                                       @\"data\": data,\n                                       }];\n    _onMessage(event);\n  }\n\n}\n- (NSURLRequest *)webView:(WebView *)sender\n                 resource:(id)identifier\n          willSendRequest:(NSURLRequest *)request\n         redirectResponse:(NSURLResponse *)redirectResponse\n           fromDataSource:(WebDataSource *)dataSource\n{\n  BOOL isJSNavigation = [request.URL.scheme isEqualToString:RCTJSNavigationScheme];\n  NSString *navigationType = @\"Not supported yet\";\n\n  // skip this for the JS Navigation handler\n  if (!isJSNavigation && _onShouldStartLoadWithRequest) {\n    NSMutableDictionary<NSString *, id> *event = [self baseEvent];\n    [event addEntriesFromDictionary: @{\n                                       @\"url\": (request.URL).absoluteString,\n                                       @\"navigationType\": navigationType\n                                       }];\n    if (![self.delegate webView:self\n      shouldStartLoadForRequest:event\n                   withCallback:_onShouldStartLoadWithRequest]) {\n      return nil;\n    }\n  }\n\n  if (_onLoadingStart) {\n    // We have this check to filter out iframe requests and whatnot\n    BOOL isTopFrame = [request.URL isEqual:request.mainDocumentURL];\n    if (isTopFrame) {\n      NSMutableDictionary<NSString *, id> *event = [self baseEvent];\n      [event addEntriesFromDictionary: @{\n                                         @\"url\": (request.URL).absoluteString,\n                                         @\"navigationType\": navigationType\n                                         }];\n      _onLoadingStart(event);\n    }\n  }\n\n  if (isJSNavigation && [request.URL.host isEqualToString:kPostMessageHost]) {\n    NSString *data = request.URL.query;\n    data = [data stringByReplacingOccurrencesOfString:@\"+\" withString:@\" \"];\n    data = [data stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];\n\n    NSMutableDictionary<NSString *, id> *event = [self baseEvent];\n    [event addEntriesFromDictionary: @{\n      @\"data\": data,\n    }];\n\n    NSString *source = @\"document.dispatchEvent(new MessageEvent('message:received'));\";\n\n    [_webView stringByEvaluatingJavaScriptFromString:source];\n\n    _onMessage(event);\n  }\n\n  // JS Navigation handler\n  return request;\n}\n- (void)webView:(__unused WebView *)sender didFailLoadWithError:(NSError *)error\n       forFrame:(__unused WebFrame *)frame\n{\n  if (_onLoadingError) {\n    if ([error.domain isEqualToString:NSURLErrorDomain] && error.code == NSURLErrorCancelled) {\n      // NSURLErrorCancelled is reported when a page has a redirect OR if you load\n      // a new URL in the WebView before the previous one came back. We can just\n      // ignore these since they aren't real errors.\n      // http://stackoverflow.com/questions/1024748/how-do-i-fix-nsurlerrordomain-error-999-in-iphone-3-0-os\n      return;\n    }\n\n    if ([error.domain isEqualToString:@\"WebKitErrorDomain\"] && error.code == 102) {\n      // Error code 102 \"Frame load interrupted\" is raised by the UIWebView if\n      // its delegate returns FALSE from webView:shouldStartLoadWithRequest:navigationType\n      // when the URL is from an http redirect. This is a common pattern when\n      // implementing OAuth with a WebView.\n      return;\n    }\n\n    NSMutableDictionary<NSString *, id> *event = [self baseEvent];\n    [event addEntriesFromDictionary:@{\n                                      @\"domain\": error.domain,\n                                      @\"code\": @(error.code),\n                                      @\"description\": error.localizedDescription,\n                                      }];\n    _onLoadingError(event);\n  }\n}\n\n- (void)webView:(WebView *)sender\ndecidePolicyForNavigationAction:(NSDictionary *)actionInformation\n        request:(NSURLRequest *)request frame:(WebFrame *)frame\ndecisionListener:(id<WebPolicyDecisionListener>)listener\n{\n  if (_messagingEnabled) {\n    #if RCT_DEV\n    // See isNative in lodash\n    NSString *testPostMessageNative = @\"String(window.postMessage) === String(Object.hasOwnProperty).replace('hasOwnProperty', 'postMessage')\";\n    BOOL postMessageIsNative = [\n      [_webView stringByEvaluatingJavaScriptFromString:testPostMessageNative]\n      isEqualToString:@\"true\"\n    ];\n    if (!postMessageIsNative) {\n      RCTLogError(@\"Setting onMessage on a WebView overrides existing values of window.postMessage, but a previous value was defined\");\n    }\n    #endif\n    NSString *source = [NSString stringWithFormat:\n      @\"(function() {\"\n        \"window.originalPostMessage = window.postMessage;\"\n\n        \"var messageQueue = [];\"\n        \"var messagePending = false;\"\n\n        \"function processQueue() {\"\n          \"if (!messageQueue.length || messagePending) return;\"\n          \"messagePending = true;\"\n          \"window.location = '%@://%@?' + encodeURIComponent(messageQueue.shift());\"\n        \"}\"\n\n        \"window.postMessage = function(data) {\"\n          \"messageQueue.push(String(data));\"\n          \"processQueue();\"\n        \"};\"\n\n        \"document.addEventListener('message:received', function(e) {\"\n          \"messagePending = false;\"\n          \"processQueue();\"\n        \"});\"\n      \"})();\", RCTJSNavigationScheme, kPostMessageHost\n    ];\n    [_webView stringByEvaluatingJavaScriptFromString:source];\n  }\n  if (_injectedJavaScript != nil) {\n    NSString *jsEvaluationValue = [frame.webView stringByEvaluatingJavaScriptFromString:_injectedJavaScript];\n\n    NSMutableDictionary<NSString *, id> *event = [self baseEvent];\n    event[@\"jsEvaluationValue\"] = jsEvaluationValue;\n\n    _onLoadingFinish(event);\n  }\n  // we only need the final 'finishLoad' call so only fire the event when we're actually done loading.\n\n  else if (_onLoadingFinish && ![frame.webView.mainFrameURL isEqualToString:@\"about:blank\"]) {\n    _onLoadingFinish([self baseEvent]);\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTWebViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTWebViewManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/RCTWebViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTWebViewManager.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTWebView.h\"\n#import \"NSView+React.h\"\n\n@interface RCTWebViewManager () <RCTWebViewDelegate>\n\n@end\n\n@implementation RCTWebViewManager\n{\n  NSConditionLock *_shouldStartLoadLock;\n  BOOL _shouldStartLoad;\n}\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  RCTWebView *webView = [RCTWebView new];\n  webView.delegate = self;\n  return webView;\n}\n\nRCT_EXPORT_VIEW_PROPERTY(source, NSDictionary)\nRCT_REMAP_VIEW_PROPERTY(bounces, _webView.scrollView.bounces, BOOL)\nRCT_REMAP_VIEW_PROPERTY(scrollEnabled, _webView.scrollView.scrollEnabled, BOOL)\nRCT_REMAP_VIEW_PROPERTY(decelerationRate, _webView.scrollView.decelerationRate, CGFloat)\nRCT_EXPORT_VIEW_PROPERTY(scalesPageToFit, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(messagingEnabled, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(injectedJavaScript, NSString)\nRCT_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets)\nRCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(onLoadingStart, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onLoadingFinish, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onLoadingError, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onMessage, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onShouldStartLoadWithRequest, RCTDirectEventBlock)\nRCT_REMAP_VIEW_PROPERTY(allowsInlineMediaPlayback, _webView.allowsInlineMediaPlayback, BOOL)\nRCT_REMAP_VIEW_PROPERTY(mediaPlaybackRequiresUserAction, _webView.mediaPlaybackRequiresUserAction, BOOL)\nRCT_REMAP_VIEW_PROPERTY(dataDetectorTypes, _webView.dataDetectorTypes, UIDataDetectorTypes)\n\nRCT_EXPORT_METHOD(goBack:(nonnull NSNumber *)reactTag)\n{\n  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWebView *> *viewRegistry) {\n    RCTWebView *view = viewRegistry[reactTag];\n    if (![view isKindOfClass:[RCTWebView class]]) {\n      RCTLogError(@\"Invalid view returned from registry, expecting RCTWebView, got: %@\", view);\n    } else {\n      [view goBack];\n    }\n  }];\n}\n\nRCT_EXPORT_METHOD(goForward:(nonnull NSNumber *)reactTag)\n{\n  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, NSView *> *viewRegistry) {\n    id view = viewRegistry[reactTag];\n    if (![view isKindOfClass:[RCTWebView class]]) {\n      RCTLogError(@\"Invalid view returned from registry, expecting RCTWebView, got: %@\", view);\n    } else {\n      [view goForward];\n    }\n  }];\n}\n\nRCT_EXPORT_METHOD(reload:(nonnull NSNumber *)reactTag)\n{\n  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWebView *> *viewRegistry) {\n    RCTWebView *view = viewRegistry[reactTag];\n    if (![view isKindOfClass:[RCTWebView class]]) {\n      RCTLogError(@\"Invalid view returned from registry, expecting RCTWebView, got: %@\", view);\n    } else {\n      [view reload];\n    }\n  }];\n}\n\nRCT_EXPORT_METHOD(stopLoading:(nonnull NSNumber *)reactTag)\n{\n  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWebView *> *viewRegistry) {\n    RCTWebView *view = viewRegistry[reactTag];\n    if (![view isKindOfClass:[RCTWebView class]]) {\n      RCTLogError(@\"Invalid view returned from registry, expecting RCTWebView, got: %@\", view);\n    } else {\n      [view stopLoading];\n    }\n  }];\n}\n\nRCT_EXPORT_METHOD(postMessage:(nonnull NSNumber *)reactTag message:(NSString *)message)\n{\n  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWebView *> *viewRegistry) {\n    RCTWebView *view = viewRegistry[reactTag];\n    if (![view isKindOfClass:[RCTWebView class]]) {\n      RCTLogError(@\"Invalid view returned from registry, expecting RCTWebView, got: %@\", view);\n    } else {\n      [view postMessage:message];\n    }\n  }];\n}\n\nRCT_EXPORT_METHOD(injectJavaScript:(nonnull NSNumber *)reactTag script:(NSString *)script)\n{\n  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWebView *> *viewRegistry) {\n    RCTWebView *view = viewRegistry[reactTag];\n    if (![view isKindOfClass:[RCTWebView class]]) {\n      RCTLogError(@\"Invalid view returned from registry, expecting RCTWebView, got: %@\", view);\n    } else {\n      [view injectJavaScript:script];\n    }\n  }];\n}\n\n#pragma mark - Exported synchronous methods\n\n- (BOOL)webView:(__unused RCTWebView *)webView\nshouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request\n   withCallback:(RCTDirectEventBlock)callback\n{\n  _shouldStartLoadLock = [[NSConditionLock alloc] initWithCondition:arc4random()];\n  _shouldStartLoad = YES;\n  request[@\"lockIdentifier\"] = @(_shouldStartLoadLock.condition);\n  callback(request);\n\n  // Block the main thread for a maximum of 250ms until the JS thread returns\n  if ([_shouldStartLoadLock lockWhenCondition:0 beforeDate:[NSDate dateWithTimeIntervalSinceNow:.25]]) {\n    BOOL returnValue = _shouldStartLoad;\n    [_shouldStartLoadLock unlock];\n    _shouldStartLoadLock = nil;\n    return returnValue;\n  } else {\n    RCTLogWarn(@\"Did not receive response to shouldStartLoad in time, defaulting to YES\");\n    return YES;\n  }\n}\n\nRCT_EXPORT_METHOD(startLoadWithResult:(BOOL)result lockIdentifier:(NSInteger)lockIdentifier)\n{\n  if ([_shouldStartLoadLock tryLockWhenCondition:lockIdentifier]) {\n    _shouldStartLoad = result;\n    [_shouldStartLoadLock unlockWithCondition:0];\n  } else {\n    RCTLogWarn(@\"startLoadWithResult invoked with invalid lockIdentifier: \"\n               \"got %lld, expected %lld\", (long long)lockIdentifier, (long long)_shouldStartLoadLock.condition);\n  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/RCTWrapperViewController.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n@class RCTNavItem;\n@class RCTWrapperViewController;\n\n@protocol RCTWrapperViewControllerNavigationListener <NSObject>\n\n- (void)wrapperViewController:(RCTWrapperViewController *)wrapperViewController\ndidMoveToNavigationController:(UINavigationController *)navigationController;\n\n@end\n\n@interface RCTWrapperViewController : UIViewController\n\n- (instancetype)initWithContentView:(UIView *)contentView NS_DESIGNATED_INITIALIZER;\n- (instancetype)initWithNavItem:(RCTNavItem *)navItem;\n\n@property (nonatomic, weak) id<RCTWrapperViewControllerNavigationListener> navigationListener;\n@property (nonatomic, strong) RCTNavItem *navItem;\n\n@end\n"
  },
  {
    "path": "React/Views/RCTWrapperViewController.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTWrapperViewController.h\"\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTEventDispatcher.h\"\n\n#import \"RCTUtils.h\"\n#import \"RCTViewControllerProtocol.h\"\n#import \"NSView+React.h\"\n#import \"RCTAutoInsetsProtocol.h\"\n\n@implementation RCTWrapperViewController\n{\n  NSView *_wrapperView;\n  NSView *_contentView;\n  RCTEventDispatcher *_eventDispatcher;\n  CGFloat _previousTopLayoutLength;\n  CGFloat _previousBottomLayoutLength;\n\n//@synthesize currentTopLayoutGuide = _currentTopLayoutGuide;\n//@synthesize currentBottomLayoutGuide = _currentBottomLayoutGuide;\n\n- (instancetype)initWithContentView:(NSView *)contentView\n{\n  RCTAssertParam(contentView);\n\n  if ((self = [super initWithNibName:nil bundle:nil])) {\n    _contentView = contentView;\n   // self.automaticallyAdjustsScrollViewInsets = NO;\n  }\n  return self;\n}\n\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithNibName:(NSString *)nn bundle:(NSBundle *)nb)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (void)viewWillLayoutSubviews\n{\n  //[super viewWillLayoutSubviews];\n\n//  _currentTopLayoutGuide = self.topLayoutGuide;\n//  _currentBottomLayoutGuide = self.bottomLayoutGuide;\n}\n\nstatic BOOL RCTFindScrollViewAndRefreshContentInsetInView(NSView *view)\n{\n  if ([view conformsToProtocol:@protocol(RCTAutoInsetsProtocol)]) {\n    [(id <RCTAutoInsetsProtocol>) view refreshContentInset];\n    return YES;\n  }\n  for (NSView *subview in view.subviews) {\n    if (RCTFindScrollViewAndRefreshContentInsetInView(subview)) {\n      return YES;\n    }\n  }\n  return NO;\n}\n\n- (void)viewDidLayoutSubviews\n{\n//  [super viewDidLayoutSubviews];\n//\n//  if (_previousTopLayoutLength != _currentTopLayoutGuide.length ||\n//      _previousBottomLayoutLength != _currentBottomLayoutGuide.length) {\n//    RCTFindScrollViewAndRefreshContentInsetInView(_contentView);\n//    _previousTopLayoutLength = _currentTopLayoutGuide.length;\n//    _previousBottomLayoutLength = _currentBottomLayoutGuide.length;\n//  }\n}\n//\n//static NSView *RCTFindNavBarShadowViewInView(NSView *view)\n//{\n//  if ([view isKindOfClass:[UIImageView class]] && view.bounds.size.height <= 1) {\n//    return view;\n//  }\n//  for (UIView *subview in view.subviews) {\n//    UIView *shadowView = RCTFindNavBarShadowViewInView(subview);\n//    if (shadowView) {\n//      return shadowView;\n//    }\n//  }\n//  return nil;\n//}\n\n- (void)viewWillAppear:(BOOL)animated\n{\n//  [super viewWillAppear:animated];\n\n  // TODO: find a way to make this less-tightly coupled to navigation controller\n//  if ([self.parentViewController isKindOfClass:[NSNavigationController class]])\n//  {\n//    [self.navigationController\n//     setNavigationBarHidden:_navItem.navigationBarHidden\n//     animated:animated];\n//\n//    UINavigationBar *bar = self.navigationController.navigationBar;\n//    bar.barTintColor = _navItem.barTintColor;\n//    bar.tintColor = _navItem.tintColor;\n//    bar.translucent = _navItem.translucent;\n//    bar.titleTextAttributes = _navItem.titleTextColor ? @{\n//      NSForegroundColorAttributeName: _navItem.titleTextColor\n//    } : nil;\n//\n//    RCTFindNavBarShadowViewInView(bar).hidden = _navItem.shadowHidden;\n//\n//    UINavigationItem *item = self.navigationItem;\n//    item.title = _navItem.title;\n//    item.titleView = _navItem.titleImageView;\n//#if !TARGET_OS_TV\n//    item.backBarButtonItem = _navItem.backButtonItem;\n//#endif //TARGET_OS_TV\n//    item.leftBarButtonItem = _navItem.leftButtonItem;\n//    item.rightBarButtonItem = _navItem.rightButtonItem;\n//  }\n}\n\n- (void)loadView\n{\n  // Add a wrapper so that the wrapper view managed by the\n  // UINavigationController doesn't end up resetting the frames for\n  //`contentView` which is a react-managed view.\n  _wrapperView = [[NSView alloc] initWithFrame:_contentView.bounds];\n  [_wrapperView addSubview:_contentView];\n  self.view = _wrapperView;\n}\n\n- (void)didMoveToParentViewController:(NSViewController *)parent\n{\n  // There's no clear setter for navigation controllers, but did move to parent\n  // view controller provides the desired effect. This is called after a pop\n  // finishes, be it a swipe to go back or a standard tap on the back button\n//  [super didMoveToParentViewController:parent];\n//  if (parent == nil || [parent isKindOfClass:[UINavigationController class]]) {\n//    [self.navigationListener wrapperViewController:self\n//                     didMoveToNavigationController:(UINavigationController *)parent];\n//  }\n}\n\n@end\n"
  },
  {
    "path": "React/Views/SafeAreaView/RCTSafeAreaShadowView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTShadowView.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTSafeAreaShadowView : RCTShadowView\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Views/SafeAreaView/RCTSafeAreaShadowView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSafeAreaShadowView.h\"\n\n#import <React/RCTAssert.h>\n#import <yoga/Yoga.h>\n\n#import \"RCTSafeAreaViewLocalData.h\"\n\n@implementation RCTSafeAreaShadowView\n\n- (void)setLocalData:(RCTSafeAreaViewLocalData *)localData\n{\n  RCTAssert([localData isKindOfClass:[RCTSafeAreaViewLocalData class]],\n    @\"Local data object for `RCTSafeAreaShadowView` must be `RCTSafeAreaViewLocalData` instance.\");\n\n  UIEdgeInsets insets = localData.insets;\n\n  super.paddingLeft = (YGValue){insets.left, YGUnitPoint};\n  super.paddingRight = (YGValue){insets.right, YGUnitPoint};\n  super.paddingTop = (YGValue){insets.top, YGUnitPoint};\n  super.paddingBottom = (YGValue){insets.bottom, YGUnitPoint};\n\n  [self didSetProps:@[@\"paddingLeft\", @\"paddingRight\", @\"paddingTop\", @\"paddingBottom\"]];\n}\n\n/**\n * Removing support for setting padding from any outside code\n * to prevent interferring this with local data.\n */\n- (void)setPadding:(YGValue)value {}\n- (void)setPaddingLeft:(YGValue)value {}\n- (void)setPaddingRight:(YGValue)value {}\n- (void)setPaddingTop:(YGValue)value {}\n- (void)setPaddingBottom:(YGValue)value {}\n\n@end\n"
  },
  {
    "path": "React/Views/SafeAreaView/RCTSafeAreaView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\n#import <React/RCTView.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@class RCTBridge;\n\n@interface RCTSafeAreaView : RCTView\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Views/SafeAreaView/RCTSafeAreaView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSafeAreaView.h\"\n\n#import <React/RCTBridge.h>\n#import <React/RCTUIManager.h>\n\n#import \"RCTSafeAreaViewLocalData.h\"\n\n@implementation RCTSafeAreaView {\n  __weak RCTBridge *_bridge;\n  UIEdgeInsets _currentSafeAreaInsets;\n}\n\n- (instancetype)initWithBridge:(RCTBridge *)bridge\n{\n  if (self = [super initWithFrame:CGRectZero]) {\n    _bridge = bridge;\n  }\n\n  return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)decoder)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\n\n#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */\n\nstatic BOOL UIEdgeInsetsEqualToEdgeInsetsWithThreshold(UIEdgeInsets insets1, UIEdgeInsets insets2, CGFloat threshold) {\n  return\n    ABS(insets1.left - insets2.left) <= threshold &&\n    ABS(insets1.right - insets2.right) <= threshold &&\n    ABS(insets1.top - insets2.top) <= threshold &&\n    ABS(insets1.bottom - insets2.bottom) <= threshold;\n}\n\n- (void)safeAreaInsetsDidChange\n{\n  if (![self respondsToSelector:@selector(safeAreaInsets)]) {\n    return;\n  }\n\n  UIEdgeInsets safeAreaInsets = self.safeAreaInsets;\n\n  if (UIEdgeInsetsEqualToEdgeInsetsWithThreshold(safeAreaInsets, _currentSafeAreaInsets, 1.0 / RCTScreenScale())) {\n    return;\n  }\n\n  _currentSafeAreaInsets = safeAreaInsets;\n\n  RCTSafeAreaViewLocalData *localData =\n    [[RCTSafeAreaViewLocalData alloc] initWithInsets:safeAreaInsets];\n  [_bridge.uiManager setLocalData:localData forView:self];\n}\n\n#endif\n\n@end\n"
  },
  {
    "path": "React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <UIKit/UIKit.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTSafeAreaViewLocalData : NSObject\n\n- (instancetype)initWithInsets:(UIEdgeInsets)insets;\n\n@property (atomic, readonly) UIEdgeInsets insets;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Views/SafeAreaView/RCTSafeAreaViewLocalData.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSafeAreaViewLocalData.h\"\n\n@implementation RCTSafeAreaViewLocalData\n\n- (instancetype)initWithInsets:(UIEdgeInsets)insets\n{\n  if (self = [super init]) {\n    _insets = insets;\n  }\n\n  return self;\n}\n\n@end\n"
  },
  {
    "path": "React/Views/SafeAreaView/RCTSafeAreaViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface RCTSafeAreaViewManager : RCTViewManager\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "React/Views/SafeAreaView/RCTSafeAreaViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTSafeAreaViewManager.h\"\n\n#import \"RCTSafeAreaShadowView.h\"\n#import \"RCTSafeAreaView.h\"\n#import \"RCTUIManager.h\"\n\n@implementation RCTSafeAreaViewManager\n\nRCT_EXPORT_MODULE()\n\n- (UIView *)view\n{\n  return [[RCTSafeAreaView alloc] initWithBridge:self.bridge];\n}\n\n- (RCTSafeAreaShadowView *)shadowView\n{\n  return [RCTSafeAreaShadowView new];\n}\n\n@end\n"
  },
  {
    "path": "React/Views/ScrollView/RCTScrollContentShadowView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTShadowView.h>\n\n@interface RCTScrollContentShadowView : RCTShadowView\n\n@end\n"
  },
  {
    "path": "React/Views/ScrollView/RCTScrollContentShadowView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTScrollContentShadowView.h\"\n\n#import <yoga/Yoga.h>\n\n#import \"RCTUtils.h\"\n\n@interface RCTShadowView () {\n  // This will be removed after t15757916, which will remove\n  // side-effects from `setFrame:` method.\n  @public CGRect _frame;\n}\n@end\n\n@implementation RCTScrollContentShadowView\n\n- (void)applyLayoutNode:(YGNodeRef)node\n      viewsWithNewFrame:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame\n       absolutePosition:(CGPoint)absolutePosition\n{\n  // Call super method if LTR layout is enforced.\n  if (YGNodeLayoutGetDirection(self.yogaNode) != YGDirectionRTL) {\n    [super applyLayoutNode:node\n         viewsWithNewFrame:viewsWithNewFrame\n          absolutePosition:absolutePosition];\n    return;\n  }\n\n  // Motivation:\n  // Yoga place `contentView` on the right side of `scrollView` when RTL layout is enfoced.\n  // That breaks everything; it is completly pointless to (re)position `contentView`\n  // because it is `contentView`'s job. So, we work around it here.\n\n  // Step 1. Compensate `absolutePosition` change.\n  CGFloat xCompensation = YGNodeLayoutGetRight(node) - YGNodeLayoutGetLeft(node);\n  absolutePosition.x += xCompensation;\n\n  // Step 2. Call super method.\n  [super applyLayoutNode:node\n       viewsWithNewFrame:viewsWithNewFrame\n        absolutePosition:absolutePosition];\n\n  // Step 3. Reset the position.\n  _frame.origin.x = RCTRoundPixelValue(YGNodeLayoutGetRight(node));\n}\n\n@end\n"
  },
  {
    "path": "React/Views/ScrollView/RCTScrollContentView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTView.h>\n\n@interface RCTScrollContentView : RCTView\n\n@end\n"
  },
  {
    "path": "React/Views/ScrollView/RCTScrollContentView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTScrollContentView.h\"\n\n#import <React/RCTAssert.h>\n#import <React/NSView+React.h>\n\n#import \"RCTScrollView.h\"\n\n@implementation RCTScrollContentView\n\n- (void)reactSetFrame:(CGRect)frame\n{\n  [super reactSetFrame:frame];\n\n  RCTNativeScrollView *scrollView = (RCTNativeScrollView *)self.superview.superview;\n\n  if (!scrollView) {\n    return;\n  }\n\n  RCTAssert([scrollView isKindOfClass:[RCTNativeScrollView class]],\n            @\"Unexpected view hierarchy of RCTScrollView component.\");\n\n  // [scrollView updateContentOffsetIfNeeded];\n}\n\n@end\n"
  },
  {
    "path": "React/Views/ScrollView/RCTScrollContentViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTViewManager.h>\n\n@interface RCTScrollContentViewManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/ScrollView/RCTScrollContentViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTScrollContentViewManager.h\"\n\n#import \"RCTScrollContentShadowView.h\"\n#import \"RCTScrollContentView.h\"\n\n@implementation RCTScrollContentViewManager\n\nRCT_EXPORT_MODULE()\n\n- (RCTScrollContentView *)view\n{\n  return [RCTScrollContentView new];\n}\n\n- (RCTShadowView *)shadowView\n{\n  return [RCTScrollContentShadowView new];\n}\n\n@end\n"
  },
  {
    "path": "React/Views/ScrollView/RCTScrollView.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import <React/RCTAutoInsetsProtocol.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTScrollableProtocol.h>\n#import <React/RCTView.h>\n\n@protocol NSScrollViewDelegate;\n\n// http://stackoverflow.com/questions/5169355/callbacks-when-an-nsscrollview-is-scrolled\n\n@interface RCTScrollView: RCTView <RCTScrollableProtocol, RCTAutoInsetsProtocol>\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;\n\n/**\n * The `RCTScrollView` may have at most one single subview. This will ensure\n * that the scroll view's `contentSize` will be efficiently set to the size of\n * the single subview's frame. That frame size will be determined somewhat\n * efficiently since it will have already been computed by the off-main-thread\n * layout system.\n */\n@property (nonatomic, readonly) NSView *contentView;\n\n/**\n * If the `contentSize` is not specified (or is specified as {0, 0}, then the\n * `contentSize` will automatically be determined by the size of the subview.\n */\n@property (nonatomic, assign) CGSize contentSize;\n\n/**\n * The underlying scrollView (TODO: can we remove this?)\n */\n@property (nonatomic, readonly) NSScrollView *scrollView;\n\n@property (nonatomic, assign) NSEdgeInsets contentInset;\n@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;\n@property (nonatomic, assign) BOOL DEPRECATED_sendUpdatedChildFrames;\n@property (nonatomic, assign) NSTimeInterval scrollEventThrottle;\n@property (nonatomic, assign) BOOL centerContent;\n@property (nonatomic, assign) int snapToInterval;\n@property (nonatomic, copy) NSString *snapToAlignment;\n\n// NOTE: currently these event props are only declared so we can export the\n// event names to JS - we don't call the blocks directly because scroll events\n// need to be coalesced before sending, for performance reasons.\n@property (nonatomic, copy) RCTDirectEventBlock onScrollBeginDrag;\n@property (nonatomic, copy) RCTDirectEventBlock onScroll;\n@property (nonatomic, copy) RCTDirectEventBlock onScrollEndDrag;\n@property (nonatomic, copy) RCTDirectEventBlock onMomentumScrollBegin;\n@property (nonatomic, copy) RCTDirectEventBlock onMomentumScrollEnd;\n\n@end\n\n@interface RCTScrollView (Internal)\n\n- (void)updateContentOffsetIfNeeded;\n\n@end\n\n@interface RCTEventDispatcher (RCTNativeScrollView)\n\n/**\n * Send a fake scroll event.\n */\n- (void)sendFakeScrollEvent:(NSNumber *)reactTag;\n\n@end\n\n/**\n * Temporary replacement for RTCScrollView\n */\n@interface RCTNativeScrollView : NSScrollView<RCTScrollableProtocol>\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;\n\n@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;\n@property (nonatomic, assign) NSTimeInterval scrollEventThrottle;\n@property (nonatomic, assign) BOOL DEPRECATED_sendUpdatedChildFrames;\n\n// NOTE: currently these event props are only declared so we can export the\n// event names to JS - we don't call the blocks directly because scroll events\n// need to be coalesced before sending, for performance reasons.\n@property (nonatomic, copy) RCTDirectEventBlock onScrollBeginDrag;\n@property (nonatomic, copy) RCTDirectEventBlock onScroll;\n@property (nonatomic, copy) RCTDirectEventBlock onScrollEndDrag;\n@property (nonatomic, copy) RCTDirectEventBlock onMomentumScrollBegin;\n@property (nonatomic, copy) RCTDirectEventBlock onMomentumScrollEnd;\n@property (nonatomic, copy) RCTDirectEventBlock onScrollAnimationEnd;\n\n@end\n"
  },
  {
    "path": "React/Views/ScrollView/RCTScrollView.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTScrollView.h\"\n\n#import <AppKit/AppKit.h>\n\n#import \"RCTConvert.h\"\n#import \"RCTEventDispatcher.h\"\n#import \"RCTLog.h\"\n#import \"RCTUIManager.h\"\n#import \"RCTUtils.h\"\n#import \"NSView+Private.h\"\n#import \"NSView+React.h\"\n\nCGFloat const ZINDEX_DEFAULT = 0;\nCGFloat const ZINDEX_STICKY_HEADER = 50;\n\n@interface RCTScrollEvent : NSObject <RCTEvent>\n\n- (instancetype)initWithEventName:(NSString *)eventName\n                         reactTag:(NSNumber *)reactTag\n                       scrollView:(NSScrollView *)scrollView\n                         userData:(NSDictionary *)userData\n                    coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER;\n\n@end\n\n@implementation RCTScrollEvent\n{\n  NSScrollView *_scrollView;\n  NSDictionary *_userData;\n  uint16_t _coalescingKey;\n  NSDictionary *_body;\n}\n\n@synthesize viewTag = _viewTag;\n@synthesize eventName = _eventName;\n\n- (instancetype)initWithEventName:(NSString *)eventName\n                         reactTag:(NSNumber *)reactTag\n                       scrollView:(NSScrollView *)scrollView\n                         userData:(NSDictionary *)userData\n                    coalescingKey:(uint16_t)coalescingKey\n{\n  RCTAssertParam(reactTag);\n\n  if ((self = [super init])) {\n    _eventName = [eventName copy];\n    _viewTag = reactTag;\n    _scrollView = scrollView;\n    _userData = userData;\n    _coalescingKey = coalescingKey;\n    _body = [self prepareBody];\n  }\n  return self;\n}\n\n- (uint16_t)coalescingKey\n{\n  return _coalescingKey;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)init)\n\n-(NSDictionary *)prepareBody\n{\n  NSDictionary *body = @{\n                         @\"contentOffset\": @{\n                             @\"x\": @([[_scrollView contentView] documentVisibleRect].origin.x),\n                             @\"y\": @([[_scrollView contentView] documentVisibleRect].origin.y)\n                             },\n                         @\"contentInset\": @{\n                             @\"top\": @(_scrollView.contentInsets.top),\n                             @\"left\": @(_scrollView.contentInsets.left),\n                             @\"bottom\": @(_scrollView.contentInsets.bottom),\n                             @\"right\": @(_scrollView.contentInsets.right)\n                             },\n                         @\"contentSize\": @{\n                             @\"width\": @([[_scrollView documentView] bounds].size.width),\n                             @\"height\": @([[_scrollView documentView] bounds].size.height)\n                             },\n                         @\"layoutMeasurement\": @{\n                             @\"width\": @(_scrollView.frame.size.width),\n                             @\"height\": @(_scrollView.frame.size.height)\n                             },\n                         @\"zoomScale\": @(1),\n                         };\n  \n  if (_userData) {\n    NSMutableDictionary *mutableBody = [body mutableCopy];\n    [mutableBody addEntriesFromDictionary:_userData];\n    body = mutableBody;\n  }\n  \n  return body;\n}\n- (NSDictionary *)body\n{\n  return _body;\n}\n\n- (BOOL)canCoalesce\n{\n  return YES;\n}\n\n- (RCTScrollEvent *)coalesceWithEvent:(RCTScrollEvent *)newEvent\n{\n  NSArray<NSDictionary *> *updatedChildFrames = [_userData[@\"updatedChildFrames\"] arrayByAddingObjectsFromArray:newEvent->_userData[@\"updatedChildFrames\"]];\n\n  if (updatedChildFrames) {\n    NSMutableDictionary *userData = [newEvent->_userData mutableCopy];\n    userData[@\"updatedChildFrames\"] = updatedChildFrames;\n    newEvent->_userData = userData;\n  }\n\n  return newEvent;\n}\n\n+ (NSString *)moduleDotMethod\n{\n  return @\"RCTEventEmitter.receiveEvent\";\n}\n\n- (NSArray *)arguments\n{\n  return @[self.viewTag, RCTNormalizeInputEventName(self.eventName), [self body]];\n}\n\n@end\n\n@implementation RCTEventDispatcher (RCTNativeScrollView)\n\n- (void)sendFakeScrollEvent:(NSNumber *)reactTag\n{\n  // Use the selector here in case the onScroll block property is ever renamed\n  NSString *eventName = NSStringFromSelector(@selector(onScroll));\n  RCTScrollEvent *fakeScrollEvent = [[RCTScrollEvent alloc] initWithEventName:eventName\n                                                                     reactTag:reactTag\n                                                                   scrollView:nil\n                                                                     userData:nil\n                                                                coalescingKey:0];\n  [self sendEvent:fakeScrollEvent];\n}\n@end\n\n\n@implementation RCTNativeScrollView\n{\n  NSColor * _backgroundColor;\n  BOOL _autoScrollToBottom;\n  BOOL _inAutoScrollToBottom;\n  RCTEventDispatcher *_eventDispatcher;\n  NSRect _oldDocumentFrame;\n  NSMutableArray *_cachedChildFrames;\n  NSTimeInterval _lastScrollDispatchTime;\n  BOOL _allowNextScrollNoMatterWhat;\n  CGRect _lastClippedToRect;\n  uint16_t _coalescingKey;\n  NSHashTable *_scrollListeners;\n  NSString *_lastEmittedEventName;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher\n{\n  if ((self = [super initWithFrame:CGRectZero])) {\n    _backgroundColor = [NSColor clearColor];\n    _eventDispatcher = eventDispatcher;\n    [self setDrawsBackground:NO];\n\n    [self.contentView setPostsBoundsChangedNotifications:YES];\n    [[NSNotificationCenter defaultCenter]\n                                  addObserver:self\n                                  selector:@selector(boundsDidChange:)\n                                  name:NSViewBoundsDidChangeNotification\n                                  object:self.contentView];\n\n    _scrollEventThrottle = 0.0;\n    _lastScrollDispatchTime = CACurrentMediaTime();\n    _cachedChildFrames = [NSMutableArray new];\n    _lastClippedToRect = CGRectNull;\n\n  }\n  return self;\n}\n\n- (void)insertReactSubview:(NSView *)view atIndex:(__unused NSInteger)atIndex\n{\n  [self setDocumentView:view];\n  if (_autoScrollToBottom) {\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(documentFrameDidChange:)\n                                                 name:NSViewFrameDidChangeNotification\n                                               object:view];\n\n    [self scrollToBottom];\n  }\n}\n\n- (void)setAutoScrollToBottom:(BOOL)autoScrollToBottom\n{\n  _autoScrollToBottom = autoScrollToBottom;\n  [self setDocumentView:[self documentView]];\n  [self setFrame:[self frame]];\n}\n\n\n- (void)setFrame:(NSRect)frameRect\n{\n  BOOL autoScroll = NO;\n\n  if (_autoScrollToBottom) {\n    NSRect\tdocumentVisibleRect = [self documentVisibleRect];\n    NSRect\tdocumentFrame = [[self documentView] frame];\n\n    //Autoscroll if we're scrolled close to the bottom\n    autoScroll = ((documentVisibleRect.origin.y + documentVisibleRect.size.height) > (documentFrame.size.height - 20));\n  }\n\n  [super setFrame:frameRect];\n\n  if (autoScroll) {\n    [self scrollToBottom];\n  }\n}\n\n//When our document resizes\n- (void)documentFrameDidChange:(__unused NSNotification *)notification\n{\n  //We guard against a recursive call to this method, which may occur if the user is resizing the view at the same time\n  //content is being modified\n  if (_autoScrollToBottom && !_inAutoScrollToBottom) {\n    NSRect\tdocumentVisibleRect =  [self documentVisibleRect];\n    NSRect\t   newDocumentFrame = [[self documentView] frame];\n\n    //We autoscroll if the height of the document frame changed AND (Using the old frame to calculate) we're scrolled close to the bottom.\n    if ((newDocumentFrame.size.height != _oldDocumentFrame.size.height) &&\n        ((documentVisibleRect.origin.y + documentVisibleRect.size.height) > (_oldDocumentFrame.size.height - 20))) {\n      _inAutoScrollToBottom = YES;\n      [self scrollToBottom];\n      _inAutoScrollToBottom = NO;\n    }\n\n    //Remember the new frame\n    _oldDocumentFrame = newDocumentFrame;\n  }\n}\n\n- (NSArray *)calculateChildFramesData\n{\n  NSMutableArray *updatedChildFrames = [NSMutableArray new];\n  [[_contentView reactSubviews] enumerateObjectsUsingBlock:\n   ^(NSView *subview, NSUInteger idx, __unused BOOL *stop) {\n\n     // Check if new or changed\n     CGRect newFrame = subview.frame;\n     BOOL frameChanged = NO;\n     if (_cachedChildFrames.count <= idx) {\n       frameChanged = YES;\n       //[_cachedChildFrames addObject:[NSValue valueWithCGRect:newFrame]];\n     } else if (!CGRectEqualToRect(newFrame, [_cachedChildFrames[idx] CGRectValue])) {\n       frameChanged = YES;\n       //_cachedChildFrames[idx] = [NSValue valueWithCGRect:newFrame];\n     }\n\n     // Create JS frame object\n     if (frameChanged) {\n       [updatedChildFrames addObject: @{\n                                        @\"index\": @(idx),\n                                        @\"x\": @(newFrame.origin.x),\n                                        @\"y\": @(newFrame.origin.y),\n                                        @\"width\": @(newFrame.size.width),\n                                        @\"height\": @(newFrame.size.height),\n                                        }];\n     }\n   }];\n\n  return updatedChildFrames;\n}\n\n- (void)scrollToBottom\n{\n  [[self documentView] scrollPoint:NSMakePoint(0, 100000)]; // TODO: avoid this hack\n}\n\n- (BOOL)opaque\n{\n  return NO;\n}\n\n- (void)setShowsVerticalScrollIndicator:(BOOL)value\n{\n  self.hasVerticalScroller = value;\n}\n\n- (void)setShowsHorizontalScrollIndicator:(BOOL)value\n{\n  self.hasHorizontalScroller = value;\n}\n\n- (void)removeReactSubview:(NSView *)subview\n{\n  [subview removeFromSuperview];\n}\n\n\n- (BOOL)isFlipped\n{\n  return YES;\n}\n\n- (void)setBackgroundColor:(NSColor *)backgroundColor\n{\n  if ([_backgroundColor isEqual:backgroundColor] || backgroundColor == NULL) {\n    return;\n  }\n  _backgroundColor = backgroundColor;\n\n  if (![self wantsLayer]) {\n    [self setWantsLayer:YES];\n    [self.layer setBackgroundColor:[backgroundColor CGColor]];\n  } else {\n    [self.layer setBackgroundColor:[backgroundColor CGColor]];\n  }\n  [self setNeedsDisplay:YES];\n}\n\n- (void)updateClippedSubviews\n{\n  // Find a suitable view to use for clipping\n  NSView *clipView = [self react_findClipView];\n  if (!clipView) {\n    return;\n  }\n\n  static const CGFloat leeway = 1.0;\n\n  const CGSize contentSize = [[self documentView] bounds].size;\n  const CGRect bounds = [[self contentView] bounds];\n  const BOOL scrollsHorizontally = contentSize.width > bounds.size.width;\n  const BOOL scrollsVertically = contentSize.height > bounds.size.height;\n  const BOOL shouldClipAgain =\n  CGRectIsNull(_lastClippedToRect) ||\n  (scrollsHorizontally && (bounds.size.width < leeway || fabs(_lastClippedToRect.origin.x - bounds.origin.x) >= leeway)) ||\n  (scrollsVertically && (bounds.size.height < leeway || fabs(_lastClippedToRect.origin.y - bounds.origin.y) >= leeway));\n\n  if (shouldClipAgain) {\n    const CGRect clipRect = CGRectInset(clipView.bounds, -leeway, -leeway);\n   // NSLog(@\"clipRect %f %f\", [[self contentView] bounds].size.height, [[self contentView] bounds].origin.y);\n\n    [self react_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView];\n    _lastClippedToRect = bounds;\n  }\n}\n\n- (void)setContentInset:(NSEdgeInsets)contentInset\n{\n  CGPoint contentOffset = self.documentVisibleRect.origin;\n\n  self.contentInsets = contentInset;\n//  [RCTView autoAdjustInsetsForView:self\n//                    withScrollView:_scrollView\n//                      updateOffset:NO];\n\n  [self.documentView setFrameOrigin:contentOffset];\n}\n\n- (void)scrollToOffset:(CGPoint)offset\n{\n  [self scrollToOffset:offset animated:YES];\n}\n\n- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated\n{\n  if (!CGPointEqualToPoint(self.documentVisibleRect.origin, offset)) {\n    // Ensure at least one scroll event will fire\n    _allowNextScrollNoMatterWhat = YES;\n    [self.documentView scrollPoint:offset];\n  }\n}\n\n- (void)zoomToRect:(CGRect)rect animated:(BOOL)animated\n{\n  // Not implemented\n  //[_scrollView zoomToRect:rect animated:animated];\n}\n\n- (void)refreshContentInset\n{\n  [RCTView autoAdjustInsetsForView:self\n                    withScrollView:self\n                      updateOffset:YES];\n}\n\n#pragma mark - ScrollView delegate\n\n#define RCT_SEND_SCROLL_EVENT(_eventName, _userData) { \\\n  NSString *eventName = NSStringFromSelector(@selector(_eventName)); \\\n  [self sendScrollEventWithName:eventName scrollView:self userData:_userData]; \\\n}\n\n#define RCT_FORWARD_SCROLL_EVENT(call) \\\nfor (NSObject<UIScrollViewDelegate> *scrollViewListener in _scrollListeners) { \\\n  if ([scrollViewListener respondsToSelector:_cmd]) { \\\n    [scrollViewListener call]; \\\n  } \\\n}\n\n#define RCT_SCROLL_EVENT_HANDLER(delegateMethod, eventName) \\\n- (void)delegateMethod:(NSScrollView *)scrollView           \\\n{                                                           \\\n  RCT_SEND_SCROLL_EVENT(eventName, nil);                    \\\n  RCT_FORWARD_SCROLL_EVENT(delegateMethod:scrollView);      \\\n}\n\n//RCT_SCROLL_EVENT_HANDLER(scrollViewWillBeginDecelerating, onMomentumScrollBegin)\n//RCT_SCROLL_EVENT_HANDLER(scrollViewDidZoom, onScroll)\n\n- (void)addScrollListener:(NSObject<NSScrollViewDelegate> *)scrollListener\n{\n  [_scrollListeners addObject:scrollListener];\n}\n\n- (void)removeScrollListener:(NSObject<NSScrollViewDelegate> *)scrollListener\n{\n  [_scrollListeners removeObject:scrollListener];\n}\n\n- (void)boundsDidChange:(__unused NSEvent *)theEvent\n{\n   //[_scrollView dockClosestSectionHeader];\n  [self updateClippedSubviews];\n  NSTimeInterval now = CACurrentMediaTime();\n\n  /**\n   * TODO: this logic looks wrong, and it may be because it is. Currently, if _scrollEventThrottle\n   * is set to zero (the default), the \"didScroll\" event is only sent once per scroll, instead of repeatedly\n   * while scrolling as expected. However, if you \"fix\" that bug, ScrollView will generate repeated\n   * warnings, and behave strangely (ListView works fine however), so don't fix it unless you fix that too!\n   */\n  if (_scrollEventThrottle == 0 ||\n        (_scrollEventThrottle > 0 && _scrollEventThrottle < (now - _lastScrollDispatchTime))) {\n\n    // Calculate changed frames\n    NSArray *childFrames = [self calculateChildFramesData];\n\n    // Dispatch event\n    RCT_SEND_SCROLL_EVENT(onScroll, (@{@\"updatedChildFrames\": childFrames}));\n\n    // Update dispatch time\n    _lastScrollDispatchTime = now;\n    _allowNextScrollNoMatterWhat = NO;\n  }\n\n  // TODO: do we need to forward this?\n  // RCT_FORWARD_SCROLL_EVENT(scrollViewDidScroll:self);\n}\n\n- (void)scrollViewWillBeginDragging:(NSScrollView *)scrollView\n{\n  _allowNextScrollNoMatterWhat = YES; // Ensure next scroll event is recorded, regardless of throttle\n  RCT_SEND_SCROLL_EVENT(onScrollBeginDrag, nil);\n  //RCT_FORWARD_SCROLL_EVENT(scrollViewWillBeginDragging:scrollView);\n}\n//\n//- (void)scrollViewWillEndDragging:(NSScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset\n//{\n//  // snapToInterval\n//  // An alternative to enablePaging which allows setting custom stopping intervals,\n//  // smaller than a full page size. Often seen in apps which feature horizonally\n//  // scrolling items. snapToInterval does not enforce scrolling one interval at a time\n//  // but guarantees that the scroll will stop at an interval point.\n//  if (self.snapToInterval) {\n//    CGFloat snapToIntervalF = (CGFloat)self.snapToInterval;\n//\n//    // Find which axis to snap\n//    BOOL isHorizontal = (scrollView.contentSize.width > self.frame.size.width);\n//\n//    // What is the current offset?\n//    CGFloat targetContentOffsetAlongAxis = isHorizontal ? targetContentOffset->x : targetContentOffset->y;\n//\n//    // Which direction is the scroll travelling?\n//    CGPoint translation = [scrollView.panGestureRecognizer translationInView:scrollView];\n//    CGFloat translationAlongAxis = isHorizontal ? translation.x : translation.y;\n//\n//    // Offset based on desired alignment\n//    CGFloat frameLength = isHorizontal ? self.frame.size.width : self.frame.size.height;\n//    CGFloat alignmentOffset = 0.0f;\n//    if ([self.snapToAlignment  isEqualToString: @\"center\"]) {\n//      alignmentOffset = (frameLength * 0.5f) + (snapToIntervalF * 0.5f);\n//    } else if ([self.snapToAlignment  isEqualToString: @\"end\"]) {\n//      alignmentOffset = frameLength;\n//    }\n//\n//    // Pick snap point based on direction and proximity\n//    NSInteger snapIndex = floor((targetContentOffsetAlongAxis + alignmentOffset) / snapToIntervalF);\n//    snapIndex = (translationAlongAxis < 0) ? snapIndex + 1 : snapIndex;\n//    CGFloat newTargetContentOffset = ( snapIndex * snapToIntervalF ) - alignmentOffset;\n//\n//    // Set new targetContentOffset\n//    if (isHorizontal) {\n//      targetContentOffset->x = newTargetContentOffset;\n//    } else {\n//      targetContentOffset->y = newTargetContentOffset;\n//    }\n//  }\n//\n//  NSDictionary *userData = @{\n//    @\"velocity\": @{\n//      @\"x\": @(velocity.x),\n//      @\"y\": @(velocity.y)\n//    },\n//    @\"targetContentOffset\": @{\n//      @\"x\": @(targetContentOffset->x),\n//      @\"y\": @(targetContentOffset->y)\n//    }\n//  };\n//  RCT_SEND_SCROLL_EVENT(onScrollEndDrag, userData);\n//  RCT_FORWARD_SCROLL_EVENT(scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset);\n//}\n//\n//- (void)scrollViewDidEndDragging:(NSScrollView *)scrollView willDecelerate:(BOOL)decelerate\n//{\n//  RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndDragging:scrollView willDecelerate:decelerate);\n//}\n//\n//- (void)scrollViewWillBeginZooming:(NSScrollView *)scrollView withView:(NSView *)view\n//{\n//  RCT_SEND_SCROLL_EVENT(onScrollBeginDrag, nil);\n//  RCT_FORWARD_SCROLL_EVENT(scrollViewWillBeginZooming:scrollView withView:view);\n//}\n//\n//- (void)scrollViewDidEndZooming:(NSScrollView *)scrollView withView:(NSView *)view atScale:(CGFloat)scale\n//{\n//  RCT_SEND_SCROLL_EVENT(onScrollEndDrag, nil);\n//  RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndZooming:scrollView withView:view atScale:scale);\n//}\n//\n//- (void)scrollViewDidEndDecelerating:(NSScrollView *)scrollView\n//{\n//  // Fire a final scroll event\n//  _allowNextScrollNoMatterWhat = YES;\n//  [self scrollViewDidScroll:scrollView];\n//\n//  // Fire the end deceleration event\n//  RCT_SEND_SCROLL_EVENT(onMomentumScrollEnd, nil);\n//  RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndDecelerating:scrollView);\n//}\n//\n//- (void)scrollViewDidEndScrollingAnimation:(NSScrollView *)scrollView\n//{\n//  // Fire a final scroll event\n//  _allowNextScrollNoMatterWhat = YES;\n//  [self scrollViewDidScroll:scrollView];\n//\n//  // Fire the end deceleration event\n//  RCT_SEND_SCROLL_EVENT(onMomentumScrollEnd, nil); //TODO: shouldn't this be onScrollAnimationEnd?\n//  RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndScrollingAnimation:scrollView);\n//}\n//\n//- (BOOL)scrollViewShouldScrollToTop:(NSScrollView *)scrollView\n//{\n//  if ([_nativeScrollDelegate respondsToSelector:_cmd]) {\n//    return [_nativeScrollDelegate scrollViewShouldScrollToTop:scrollView];\n//  }\n//  return YES;\n//}\n\n- (NSView *)viewForZoomingInScrollView:(__unused NSScrollView *)scrollView\n{\n  return _contentView;\n}\n\n#pragma mark - Setters\n\n- (CGSize)_calculateViewportSize\n{\n  CGSize viewportSize = self.bounds.size;\n  if (_automaticallyAdjustContentInsets) {\n    NSEdgeInsets contentInsets = [RCTView contentInsetsForView:self];\n    viewportSize = CGSizeMake(self.bounds.size.width - contentInsets.left - contentInsets.right,\n                                self.bounds.size.height - contentInsets.top - contentInsets.bottom);\n  }\n  return viewportSize;\n}\n\n- (CGPoint)calculateOffsetForContentSize:(CGSize)newContentSize\n{\n  CGPoint oldOffset = self.documentVisibleRect.origin;\n  CGPoint newOffset = oldOffset;\n\n  CGSize oldContentSize = self.contentSize;\n  CGSize viewportSize = [self _calculateViewportSize];\n\n  BOOL fitsinViewportY = oldContentSize.height <= viewportSize.height && newContentSize.height <= viewportSize.height;\n  if (newContentSize.height < oldContentSize.height && !fitsinViewportY) {\n    CGFloat offsetHeight = oldOffset.y + viewportSize.height;\n    if (oldOffset.y < 0) {\n      // overscrolled on top, leave offset alone\n    } else if (offsetHeight > oldContentSize.height) {\n      // overscrolled on the bottom, preserve overscroll amount\n      newOffset.y = MAX(0, oldOffset.y - (oldContentSize.height - newContentSize.height));\n    } else if (offsetHeight > newContentSize.height) {\n      // offset falls outside of bounds, scroll back to end of list\n      newOffset.y = MAX(0, newContentSize.height - viewportSize.height);\n    }\n  }\n\n  BOOL fitsinViewportX = oldContentSize.width <= viewportSize.width && newContentSize.width <= viewportSize.width;\n  if (newContentSize.width < oldContentSize.width && !fitsinViewportX) {\n    CGFloat offsetHeight = oldOffset.x + viewportSize.width;\n    if (oldOffset.x < 0) {\n      // overscrolled at the beginning, leave offset alone\n    } else if (offsetHeight > oldContentSize.width && newContentSize.width > viewportSize.width) {\n      // overscrolled at the end, preserve overscroll amount as much as possible\n      newOffset.x = MAX(0, oldOffset.x - (oldContentSize.width - newContentSize.width));\n    } else if (offsetHeight > newContentSize.width) {\n      // offset falls outside of bounds, scroll back to end\n      newOffset.x = MAX(0, newContentSize.width - viewportSize.width);\n    }\n  }\n\n  // all other cases, offset doesn't change\n  return newOffset;\n}\n\n- (void)reactBridgeDidFinishTransaction\n{\n  CGSize contentSize = self.contentSize;\n\n  // TODO: now it doesnt make sense\n  if (!CGSizeEqualToSize(self.contentSize, contentSize)) {\n    // When contentSize is set manually, ScrollView internals will reset\n    // contentOffset to  {0, 0}. Since we potentially set contentSize whenever\n    // anything in the ScrollView updates, we workaround this issue by manually\n    // adjusting contentOffset whenever this happens\n    CGPoint newOffset = [self calculateOffsetForContentSize:contentSize];\n    [self.contentView setFrameSize:contentSize];\n    [self.documentView setFrameOrigin:newOffset];\n  }\n}\n\n// Note: setting several properties of UIScrollView has the effect of\n// resetting its contentOffset to {0, 0}. To prevent this, we generate\n// setters here that will record the contentOffset beforehand, and\n// restore it after the property has been set.\n\n#define RCT_SET_AND_PRESERVE_OFFSET(setter, getter, type) \\\n- (void)setter:(type)value                                \\\n{                                                         \\\n  CGPoint contentOffset = _scrollView.contentOffset;      \\\n  [_scrollView setter:value];                             \\\n  _scrollView.contentOffset = contentOffset;              \\\n}                                                         \\\n- (type)getter                                            \\\n{                                                         \\\n  return [_scrollView getter];                            \\\n}\n\n- (void)setPagingEnabled:(__unused BOOL)pagingEnabled\n{\n  if (!pagingEnabled) {\n    // Paging is always enabled on macOS.\n    RCTLogError(@\"[RCTScrollView pagingEnabled] cannot be false\");\n  }\n}\n\n- (void)sendScrollEventWithName:(NSString *)eventName\n                     scrollView:(NSScrollView *)scrollView\n                       userData:(NSDictionary *)userData\n{\n  if (![_lastEmittedEventName isEqualToString:eventName]) {\n    _coalescingKey++;\n    _lastEmittedEventName = [eventName copy];\n  }\n  RCTScrollEvent *scrollEvent = [[RCTScrollEvent alloc] initWithEventName:eventName\n                                                                 reactTag:self.reactTag\n                                                               scrollView:scrollView\n                                                                 userData:userData\n                                                            coalescingKey:_coalescingKey];\n  [_eventDispatcher sendEvent:scrollEvent];\n}\n\n@end\n\n@implementation RCTEventDispatcher (RCTScrollView)\n\n- (void)sendFakeScrollEvent:(NSNumber *)reactTag\n{\n  // Use the selector here in case the onScroll block property is ever renamed\n  NSString *eventName = NSStringFromSelector(@selector(onScroll));\n  RCTScrollEvent *fakeScrollEvent = [[RCTScrollEvent alloc] initWithEventName:eventName\n                                                                     reactTag:reactTag\n                                                                   scrollView:nil\n                                                                     userData:nil\n                                                                coalescingKey:0];\n  [self sendEvent:fakeScrollEvent];\n}\n\n@end\n"
  },
  {
    "path": "React/Views/ScrollView/RCTScrollViewManager.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <React/RCTConvert.h>\n#import <React/RCTViewManager.h>\n\n/**\n * Workaround for AppKit NSScrollView\n *\n */\n@interface RCTNativeScrollViewManager : RCTViewManager\n\n@end\n"
  },
  {
    "path": "React/Views/ScrollView/RCTScrollViewManager.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"RCTScrollViewManager.h\"\n\n#import \"RCTBridge.h\"\n#import \"RCTScrollView.h\"\n#import \"RCTShadowView.h\"\n#import \"RCTUIManager.h\"\n\n@interface RCTNativeScrollView (Private)\n\n- (NSArray *)calculateChildFramesData;\n\n@end\n\n\n@implementation RCTConvert (NSScrollView)\n\n//RCT_ENUM_CONVERTER(UIScrollViewKeyboardDismissMode, (@{\n//  @\"none\": @(UIScrollViewKeyboardDismissModeNone),\n//  @\"on-drag\": @(UIScrollViewKeyboardDismissModeOnDrag),\n//  @\"interactive\": @(UIScrollViewKeyboardDismissModeInteractive),\n//  // Backwards compatibility\n//  @\"onDrag\": @(UIScrollViewKeyboardDismissModeOnDrag),\n//}), UIScrollViewKeyboardDismissModeNone, integerValue)\n//\n//RCT_ENUM_CONVERTER(UIScrollViewIndicatorStyle, (@{\n//  @\"default\": @(UIScrollViewIndicatorStyleDefault),\n//  @\"black\": @(UIScrollViewIndicatorStyleBlack),\n//  @\"white\": @(UIScrollViewIndicatorStyleWhite),\n//}), UIScrollViewIndicatorStyleDefault, integerValue)\n\n#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */\nRCT_ENUM_CONVERTER(UIScrollViewContentInsetAdjustmentBehavior, (@{\n  @\"automatic\": @(UIScrollViewContentInsetAdjustmentAutomatic),\n  @\"scrollableAxes\": @(UIScrollViewContentInsetAdjustmentScrollableAxes),\n  @\"never\": @(UIScrollViewContentInsetAdjustmentNever),\n  @\"always\": @(UIScrollViewContentInsetAdjustmentAlways),\n}), UIScrollViewContentInsetAdjustmentNever, integerValue)\n#endif\n\n@end\n\n@implementation RCTNativeScrollViewManager\n\nRCT_EXPORT_MODULE()\n\n- (NSView *)view\n{\n  return [[RCTNativeScrollView alloc] initWithEventDispatcher:self.bridge.eventDispatcher];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(autoScrollToBottom, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(alwaysBounceHorizontal, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(alwaysBounceVertical, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(bounces, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(bouncesZoom, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(canCancelContentTouches, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(centerContent, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(decelerationRate, CGFloat)\nRCT_EXPORT_VIEW_PROPERTY(directionalLockEnabled, BOOL)\n// RCT_EXPORT_VIEW_PROPERTY(indicatorStyle, UIScrollViewIndicatorStyle)\n\nRCT_EXPORT_VIEW_PROPERTY(maximumZoomScale, CGFloat)\nRCT_EXPORT_VIEW_PROPERTY(minimumZoomScale, CGFloat)\n// RCT_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL)\n\n#if !TARGET_OS_TV\nRCT_EXPORT_VIEW_PROPERTY(pagingEnabled, BOOL)\nRCT_REMAP_VIEW_PROPERTY(pinchGestureEnabled, scrollView.pinchGestureEnabled, BOOL)\n// RCT_EXPORT_VIEW_PROPERTY(scrollsToTop, BOOL)\n#endif\n\nRCT_EXPORT_VIEW_PROPERTY(showsHorizontalScrollIndicator, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(showsVerticalScrollIndicator, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(scrollEventThrottle, NSTimeInterval)\nRCT_EXPORT_VIEW_PROPERTY(zoomScale, CGFloat)\nRCT_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets)\nRCT_EXPORT_VIEW_PROPERTY(scrollIndicatorInsets, UIEdgeInsets)\nRCT_EXPORT_VIEW_PROPERTY(snapToInterval, int)\nRCT_EXPORT_VIEW_PROPERTY(snapToAlignment, NSString)\nRCT_REMAP_VIEW_PROPERTY(contentOffset, scrollView.contentOffset, CGPoint)\n// RCT_EXPORT_VIEW_PROPERTY(onScrollBeginDrag, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onScroll, RCTDirectEventBlock)\n\nRCT_EXPORT_VIEW_PROPERTY(onScrollEndDrag, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onMomentumScrollBegin, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(onMomentumScrollEnd, RCTDirectEventBlock)\nRCT_EXPORT_VIEW_PROPERTY(DEPRECATED_sendUpdatedChildFrames, BOOL)\n#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */\nRCT_EXPORT_VIEW_PROPERTY(contentInsetAdjustmentBehavior, UIScrollViewContentInsetAdjustmentBehavior)\n#endif\n\n// overflow is used both in css-layout as well as by react-native. In css-layout\n// we always want to treat overflow as scroll but depending on what the overflow\n// is set to from js we want to clip drawing or not. This piece of code ensures\n// that css-layout is always treating the contents of a scroll container as\n// overflow: 'scroll'.\nRCT_CUSTOM_SHADOW_PROPERTY(overflow, YGOverflow, RCTShadowView) {\n#pragma unused (json)\n  view.overflow = YGOverflowScroll;\n}\n\nRCT_EXPORT_METHOD(getContentSize:(nonnull NSNumber *)reactTag\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  [self.bridge.uiManager addUIBlock:\n   ^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTNativeScrollView *> *viewRegistry) {\n\n     RCTNativeScrollView *view = viewRegistry[reactTag];\n     if (!view) {\n       RCTLogError(@\"Cannot find RCTNativeScrollView with tag #%@\", reactTag);\n       return;\n     }\n\n     CGSize size = view.contentSize;\n     callback(@[@{\n                  @\"width\" : @(size.width),\n                  @\"height\" : @(size.height)\n                  }]);\n   }];\n}\n\nRCT_EXPORT_METHOD(calculateChildFrames:(nonnull NSNumber *)reactTag\n                  callback:(RCTResponseSenderBlock)callback)\n{\n  [self.bridge.uiManager addUIBlock:\n   ^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTNativeScrollView *> *viewRegistry) {\n\n     RCTNativeScrollView *view = viewRegistry[reactTag];\n     if (!view || ![view isKindOfClass:[RCTNativeScrollView class]]) {\n       RCTLogError(@\"Cannot find RCTNativeScrollView with tag #%@\", reactTag);\n       return;\n     }\n\n     NSArray<NSDictionary *> *childFrames = [view calculateChildFramesData];\n     if (childFrames) {\n       callback(@[childFrames]);\n     }\n   }];\n}\n\nRCT_EXPORT_METHOD(scrollTo:(nonnull NSNumber *)reactTag\n                  offsetX:(CGFloat)x\n                  offsetY:(CGFloat)y\n                  animated:(BOOL)animated)\n{\n  [self.bridge.uiManager addUIBlock:\n   ^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTNativeScrollView *> *viewRegistry){\n     RCTNativeScrollView *view = viewRegistry[reactTag];\n       if ([view conformsToProtocol:@protocol(RCTScrollableProtocol)]) {\n           [(id<RCTScrollableProtocol>)view scrollToOffset:(CGPoint){x, y} animated:animated];\n       } else {\n           RCTLogError(@\"tried to scrollTo: on non-RCTScrollableProtocol view %@ \"\n                       \"with tag #%@\", view, reactTag);\n       }\n   }];\n}\n\n\nRCT_EXPORT_METHOD(flashScrollIndicators:(nonnull NSNumber *)reactTag)\n{\n  [self.bridge.uiManager addUIBlock:\n   ^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTNativeScrollView *> *viewRegistry){\n\n     RCTNativeScrollView *view = viewRegistry[reactTag];\n     if (!view || ![view isKindOfClass:[RCTNativeScrollView class]]) {\n       RCTLogError(@\"Cannot find RCTScrollView with tag #%@\", reactTag);\n       return;\n     }\n\n    // [view.scrollView flashScrollIndicators];\n   }];\n}\n\n@end\n"
  },
  {
    "path": "React/Views/ScrollView/RCTScrollableProtocol.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n/**\n * Contains any methods related to scrolling. Any `RCTView` that has scrolling\n * features should implement these methods.\n */\n@protocol RCTScrollableProtocol\n\n@property (nonatomic, readonly) CGSize contentSize;\n\n- (void)scrollWheel:(NSEvent *)theEvent;\n- (void)scrollToOffset:(CGPoint)offset;\n- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated;\n/**\n * If this is a vertical scroll view, scrolls to the bottom.\n * If this is a horizontal scroll view, scrolls to the right.\n */\n- (void)scrollToEnd:(BOOL)animated;\n- (void)zoomToRect:(CGRect)rect animated:(BOOL)animated;\n\n//- (void)addScrollListener:(NSObject<UIScrollViewDelegate> *)scrollListener;\n//- (void)removeScrollListener:(NSObject<UIScrollViewDelegate> *)scrollListener;\n\n@end\n"
  },
  {
    "path": "React/third-party.xcconfig",
    "content": "//\n//  folly.xcconfig\n//  CxxReact\n//\n//  Created by Marc Horowitz on 1/12/17.\n//  Copyright © 2017 Facebook. All rights reserved.\n//\n\nHEADER_SEARCH_PATHS = $(SRCROOT)/../third-party/boost_1_63_0 $(SRCROOT)/../third-party/folly-2016.09.26.00 $(SRCROOT)/../third-party/glog-0.3.4/src\nOTHER_CFLAGS = -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1\n"
  },
  {
    "path": "React.podspec",
    "content": "require \"json\"\n\npackage = JSON.parse(File.read(File.join(__dir__, \"package.json\")))\nversion = package['version']\n\nsource = { :git => 'https://github.com/ptmt/react-native-macos.git' }\nif version == '1000.0.0'\n  # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.\n  source[:commit] = `git rev-parse HEAD`.strip\nelse\n  source[:tag] = \"v#{version}\"\nend\n\nfolly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'\n\nPod::Spec.new do |s|\n  s.name                    = \"React\"\n  s.version                 = version\n  s.summary                 = package[\"description\"]\n  s.description             = <<-DESC\n                                React Native apps are built using the React JS\n                                framework, and render directly to native UIKit\n                                elements using a fully asynchronous architecture.\n                                There is no browser and no HTML. We have picked what\n                                we think is the best set of features from these and\n                                other technologies to build what we hope to become\n                                the best product development framework available,\n                                with an emphasis on iteration speed, developer\n                                delight, continuity of technology, and absolutely\n                                beautiful and fast products with no compromises in\n                                quality or capability.\n                             DESC\n  s.homepage                = \"http://facebook.github.io/react-native/\"\n  s.license                 = package[\"license\"]\n  s.author                  = \"Facebook\"\n  s.source                  = source\n  s.default_subspec         = \"Core\"\n  s.requires_arc            = true\n  s.platforms               = { :ios => \"8.0\", :tvos => \"9.2\" }\n  s.pod_target_xcconfig     = { \"CLANG_CXX_LANGUAGE_STANDARD\" => \"c++14\" }\n  s.preserve_paths          = \"package.json\", \"LICENSE\", \"LICENSE-docs\", \"PATENTS\"\n  s.cocoapods_version       = \">= 1.2.0\"\n\n  s.subspec \"Core\" do |ss|\n    ss.dependency             \"yoga\", \"#{package[\"version\"]}.React\"\n    ss.source_files         = \"React/**/*.{c,h,m,mm,S,cpp}\"\n    ss.exclude_files        = \"**/__tests__/*\",\n                              \"IntegrationTests/*\",\n                              \"React/DevSupport/*\",\n                              \"React/Inspector/*\",\n                              \"ReactCommon/yoga/*\",\n                              \"React/Cxx*/*\",\n                              \"React/Base/RCTBatchedBridge.mm\",\n                              \"React/Executors/*\"\n    ss.ios.exclude_files    = \"React/**/RCTTV*.*\"\n    ss.tvos.exclude_files   = \"React/Modules/RCTClipboard*\",\n                              \"React/Views/RCTDatePicker*\",\n                              \"React/Views/RCTPicker*\",\n                              \"React/Views/RCTRefreshControl*\",\n                              \"React/Views/RCTSlider*\",\n                              \"React/Views/RCTSwitch*\",\n                              \"React/Views/RCTWebView*\"\n    ss.header_dir           = \"React\"\n    ss.framework            = \"JavaScriptCore\"\n    ss.libraries            = \"stdc++\"\n    ss.pod_target_xcconfig  = { \"HEADER_SEARCH_PATHS\" => \"\\\"$(PODS_TARGET_SRCROOT)/ReactCommon\\\"\" }\n  end\n\n  s.subspec \"BatchedBridge\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.dependency             \"React/cxxreact_legacy\"\n    ss.source_files         = \"React/Base/RCTBatchedBridge.mm\", \"React/Executors/*\"\n  end\n\n  s.subspec \"CxxBridge\" do |ss|\n    ss.dependency             \"Folly\", \"2016.09.26.00\"\n    ss.dependency             \"React/Core\"\n    ss.dependency             \"React/cxxreact\"\n    ss.compiler_flags       = folly_compiler_flags\n    ss.private_header_files = \"React/Cxx*/*.h\"\n    ss.source_files         = \"React/Cxx*/*.{h,m,mm}\"\n  end\n\n  s.subspec \"DevSupport\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.dependency             \"React/RCTWebSocket\"\n    ss.source_files         = \"React/DevSupport/*\",\n                              \"React/Inspector/*\"\n  end\n\n  s.subspec \"tvOS\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"React/**/RCTTV*.{h, m}\"\n  end\n\n  s.subspec \"jschelpers_legacy\" do |ss|\n    ss.source_files         = \"ReactCommon/jschelpers/{JavaScriptCore,JSCWrapper}.{cpp,h}\", \"ReactCommon/jschelpers/systemJSCWrapper.cpp\"\n    ss.private_header_files = \"ReactCommon/jschelpers/{JavaScriptCore,JSCWrapper}.h\"\n    ss.pod_target_xcconfig  = { \"HEADER_SEARCH_PATHS\" => \"\\\"$(PODS_TARGET_SRCROOT)/ReactCommon\\\"\" }\n    ss.framework            = \"JavaScriptCore\"\n  end\n\n  s.subspec \"jsinspector_legacy\" do |ss|\n    ss.source_files         = \"ReactCommon/jsinspector/{InspectorInterfaces}.{cpp,h}\"\n    ss.private_header_files = \"ReactCommon/jsinspector/{InspectorInterfaces}.h\"\n    ss.pod_target_xcconfig  = { \"HEADER_SEARCH_PATHS\" => \"\\\"$(PODS_TARGET_SRCROOT)/ReactCommon\\\"\" }\n  end\n\n  s.subspec \"cxxreact_legacy\" do |ss|\n    ss.dependency             \"React/jschelpers_legacy\"\n    ss.dependency             \"React/jsinspector_legacy\"\n    ss.source_files         = \"ReactCommon/cxxreact/{JSBundleType,oss-compat-util}.{cpp,h}\"\n    ss.private_header_files = \"ReactCommon/cxxreact/{JSBundleType,oss-compat-util}.h\"\n    ss.pod_target_xcconfig  = { \"HEADER_SEARCH_PATHS\" => \"\\\"$(PODS_TARGET_SRCROOT)/ReactCommon\\\"\" }\n  end\n\n  s.subspec \"jschelpers\" do |ss|\n    ss.dependency             \"Folly\", \"2016.09.26.00\"\n    ss.dependency             \"React/PrivateDatabase\"\n    ss.compiler_flags       = folly_compiler_flags\n    ss.source_files         = \"ReactCommon/jschelpers/*.{cpp,h}\"\n    ss.private_header_files = \"ReactCommon/jschelpers/*.h\"\n    ss.pod_target_xcconfig  = { \"HEADER_SEARCH_PATHS\" => \"\\\"$(PODS_TARGET_SRCROOT)/ReactCommon\\\"\" }\n    ss.framework            = \"JavaScriptCore\"\n  end\n\n  s.subspec \"jsinspector\" do |ss|\n    ss.source_files         = \"ReactCommon/jsinspector/*.{cpp,h}\"\n    ss.private_header_files = \"ReactCommon/jsinspector/*.h\"\n    ss.pod_target_xcconfig  = { \"HEADER_SEARCH_PATHS\" => \"\\\"$(PODS_TARGET_SRCROOT)/ReactCommon\\\"\" }\n  end\n\n  s.subspec \"PrivateDatabase\" do |ss|\n    ss.source_files         = \"ReactCommon/privatedata/*.{cpp,h}\"\n    ss.private_header_files = \"ReactCommon/privatedata/*.h\"\n    ss.pod_target_xcconfig  = { \"HEADER_SEARCH_PATHS\" => \"\\\"$(PODS_TARGET_SRCROOT)/ReactCommon\\\"\" }\n  end\n\n  s.subspec \"cxxreact\" do |ss|\n    ss.dependency             \"React/jschelpers\"\n    ss.dependency             \"React/jsinspector\"\n    ss.dependency             \"boost\"\n    ss.dependency             \"Folly\", \"2016.09.26.00\"\n    ss.compiler_flags       = folly_compiler_flags\n    ss.source_files         = \"ReactCommon/cxxreact/*.{cpp,h}\"\n    ss.exclude_files        = \"ReactCommon/cxxreact/SampleCxxModule.*\"\n    ss.private_header_files = \"ReactCommon/cxxreact/*.h\"\n    ss.pod_target_xcconfig  = { \"HEADER_SEARCH_PATHS\" => \"\\\"$(PODS_TARGET_SRCROOT)/ReactCommon\\\" \\\"$(PODS_ROOT)/boost\\\" \\\"$(PODS_ROOT)/DoubleConversion\\\" \\\"$(PODS_ROOT)/Folly\\\"\" }\n  end\n\n  s.subspec \"ART\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/ART/**/*.{h,m}\"\n  end\n\n  s.subspec \"RCTActionSheet\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/ActionSheetIOS/*.{h,m}\"\n  end\n\n  s.subspec \"RCTAnimation\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/NativeAnimation/{Drivers/*,Nodes/*,*}.{h,m}\"\n    ss.header_dir           = \"RCTAnimation\"\n  end\n\n  s.subspec \"RCTBlob\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/Blob/*.{h,m}\"\n    ss.preserve_paths       = \"Libraries/Blob/*.js\"\n  end\n\n  s.subspec \"RCTCameraRoll\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.dependency             'React/RCTImage'\n    ss.source_files         = \"Libraries/CameraRoll/*.{h,m}\"\n  end\n\n  s.subspec \"RCTGeolocation\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/Geolocation/*.{h,m}\"\n  end\n\n  s.subspec \"RCTImage\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.dependency             \"React/RCTNetwork\"\n    ss.source_files         = \"Libraries/Image/*.{h,m}\"\n  end\n\n  s.subspec \"RCTNetwork\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/Network/*.{h,m,mm}\"\n  end\n\n  s.subspec \"RCTPushNotification\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/PushNotificationIOS/*.{h,m}\"\n  end\n\n  s.subspec \"RCTSettings\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/Settings/*.{h,m}\"\n  end\n\n  s.subspec \"RCTText\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/Text/*.{h,m}\"\n  end\n\n  s.subspec \"RCTVibration\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/Vibration/*.{h,m}\"\n  end\n\n  s.subspec \"RCTWebSocket\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.dependency             \"React/RCTBlob\"\n    ss.dependency             \"React/fishhook\"\n    ss.source_files         = \"Libraries/WebSocket/*.{h,m}\"\n  end\n\n  s.subspec \"fishhook\" do |ss|\n    ss.header_dir           = \"fishhook\"\n    ss.source_files         = \"Libraries/fishhook/*.{h,c}\"\n  end\n\n  s.subspec \"RCTLinkingIOS\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/LinkingIOS/*.{h,m}\"\n  end\n\n  s.subspec \"RCTTest\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.source_files         = \"Libraries/RCTTest/**/*.{h,m}\"\n    ss.frameworks           = \"XCTest\"\n  end\n\n  s.subspec \"_ignore_me_subspec_for_linting_\" do |ss|\n    ss.dependency             \"React/Core\"\n    ss.dependency             \"React/CxxBridge\"\n  end\nend\n"
  },
  {
    "path": "ReactAndroid/DEFS",
    "content": "# Helpers for referring to React Native open source code.\n#\n# This lets us build React Native:\n# - At Facebook by running buck from the root of the fb repo\n# - Outside of Facebook by running buck in the root of the git repo\n\nIS_OSS_BUILD = True\n\nwith allow_unsafe_import():\n    import os\n\n# Example: react_native_target('java/com/facebook/react/common:common')\ndef react_native_target(path):\n  return '//ReactAndroid/src/main/' + path\n\n# Example: react_native_xplat_target('bridge:bridge')\ndef react_native_xplat_target(path):\n  return '//ReactCommon/' + path\n\n# Example: react_native_tests_target('java/com/facebook/react/modules:modules')\ndef react_native_tests_target(path):\n  return '//ReactAndroid/src/test/' + path\n\n# Example: react_native_integration_tests_target('java/com/facebook/react/testing:testing')\ndef react_native_integration_tests_target(path):\n  return '//ReactAndroid/src/androidTest/' + path\n\n# Helper for referring to non-RN code from RN OSS code.\n# Example: react_native_dep('java/com/facebook/systrace:systrace')\ndef react_native_dep(path):\n  return '//ReactAndroid/src/main/' + path\n\nJSC_INTERNAL_DEPS = [\n  '//native/third-party/jsc:jsc',\n  '//native/third-party/jsc:jsc_legacy_profiler',\n]\nJSC_DEPS = JSC_INTERNAL_DEPS\n\nYOGA_TARGET = '//ReactAndroid/src/main/java/com/facebook:yoga'\nFBGLOGINIT_TARGET = '//ReactAndroid/src/main/jni/first-party/fbgloginit:fbgloginit'\nFBJNI_TARGET = '//ReactAndroid/src/main/jni/first-party/fb:jni'\nJNI_TARGET = '//ReactAndroid/src/main/jni/first-party/jni-hack:jni-hack'\n\n# React property preprocessor\noriginal_android_library=android_library\ndef android_library(\n  name,\n  deps=[],\n  plugins=[],\n  *args,\n  **kwargs):\n\n  if react_native_target('java/com/facebook/react/uimanager/annotations:annotations') in deps and name != 'processing':\n    react_property_plugins = [\n      react_native_target('java/com/facebook/react/processing:processing'),\n    ]\n\n    plugins = list(set(plugins + react_property_plugins))\n\n  if react_native_target('java/com/facebook/react/module/annotations:annotations') in deps and name != 'processing':\n    react_module_plugins = [\n      react_native_target('java/com/facebook/react/module/processing:processing'),\n    ]\n\n    plugins = list(set(plugins + react_module_plugins))\n\n  original_android_library(\n    name=name,\n    deps=deps,\n    plugins=plugins,\n    *args,\n    **kwargs)\n\ndef rn_robolectric_test(name, srcs, vm_args = None, *args, **kwargs):\n  vm_args = vm_args or []\n\n  # We may need to create buck-out/gen/ if we're running after buck clean.\n  tmp = 'buck-out/gen/' + get_base_path() + '/__java_test_' + name + '_output__'\n  extra_vm_args = [\n    '-XX:+UseConcMarkSweepGC', # required by -XX:+CMSClassUnloadingEnabled\n    '-XX:+CMSClassUnloadingEnabled',\n    '-XX:ReservedCodeCacheSize=150M',\n    '-Drobolectric.dependency.dir=buck-out/gen/ReactAndroid/src/main/third-party/java/robolectric3/robolectric',\n    '-Dlibraries=buck-out/gen/ReactAndroid/src/main/third-party/java/robolectric3/robolectric/*.jar',\n    '-Drobolectric.logging.enabled=true',\n    '-XX:MaxPermSize=620m',\n    '-Drobolectric.offline=true',\n  ]\n  if os.path.isdir(\"/dev/shm\") and 'CIRCLECI' not in os.environ:\n      extra_vm_args.append('-Djava.io.tmpdir=/dev/shm')\n  else:\n      extra_vm_args.append(\n          '-Djava.io.tmpdir=%s' % os.path.join(os.path.abspath('.'),\n                                               'buck-out/bin'))\n\n  # RN tests use  Powermock, which means they get their own ClassLoaders.\n  # Because the yoga native library (or any native library) can only be loaded into one\n  # ClassLoader at a time, we need to run each in its own process, hence fork_mode = 'per_test'.\n  robolectric_test(\n    name = name,\n    use_cxx_libraries = True,\n    cxx_library_whitelist = [\n      '//ReactCommon/yoga:yoga',\n      '//ReactAndroid/src/main/jni/first-party/yogajni:jni',\n    ],\n    fork_mode = 'per_test',\n    srcs = srcs,\n    vm_args = vm_args + extra_vm_args,\n    *args, **kwargs)\n\n\ndef fb_xplat_cxx_library(allow_jni_merging=None, **kwargs):\n    cxx_library(**kwargs)\n"
  },
  {
    "path": "ReactAndroid/DevExperience.md",
    "content": "Here's how to test the whole dev experience end-to-end. This will be eventually merged into the [Getting Started guide](https://facebook.github.io/react-native/docs/getting-started.html).\n\nAssuming you have the [Android SDK](https://developer.android.com/sdk/installing/index.html) installed, run `android` to open the Android SDK Manager.\n\nMake sure you have the following installed:\n\n- Android SDK version 23\n- SDK build tools version 23\n- Android Support Repository 17 (for Android Support Library)\n\nFollow steps on https://github.com/facebook/react-native/blob/master/react-native-cli/CONTRIBUTING.md, but be sure to bump the version of react-native in package.json to some version > 0.9 (latest published npm version) or set up proxying properly for react-native\n\n- From the react-native-android repo:\n  - `./gradlew :ReactAndroid:installArchives`\n  - *Assuming you already have android-jsc installed to local maven repo, no steps included here*\n- `react-native init ProjectName`\n- Open up your Android emulator (Genymotion is recommended)\n- `cd ProjectName`\n- `react-native run-android`\n\nIn case the app crashed:\n\n- Run `adb logcat` and try to find a Java exception\n"
  },
  {
    "path": "ReactAndroid/README.md",
    "content": "# Building React Native for Android\n\nSee the [docs on the website](https://facebook.github.io/react-native/docs/android-building-from-source.html).\n\n# Running tests\n\nWhen you submit a pull request CircleCI will automatically run all tests. To run tests locally, see [Testing](https://facebook.github.io/react-native/docs/testing.html).\n"
  },
  {
    "path": "ReactAndroid/build.gradle",
    "content": "// Copyright 2015-present Facebook. All Rights Reserved.\n\napply plugin: 'com.android.library'\napply plugin: 'maven'\n\napply plugin: 'de.undercouch.download'\n\nimport de.undercouch.gradle.tasks.download.Download\nimport org.apache.tools.ant.taskdefs.condition.Os\nimport org.apache.tools.ant.filters.ReplaceTokens\n\n// We download various C++ open-source dependencies into downloads.\n// We then copy both the downloaded code and our custom makefiles and headers into third-party-ndk.\n// After that we build native code from src/main/jni with module path pointing at third-party-ndk.\n\ndef downloadsDir = new File(\"$buildDir/downloads\")\ndef thirdPartyNdkDir = new File(\"$buildDir/third-party-ndk\")\n\n// You need to have following folders in this directory:\n//   - boost_1_63_0\n//   - double-conversion-1.1.1\n//   - folly-deprecate-dynamic-initializer\n//   - glog-0.3.3\n//   - jsc-headers\ndef dependenciesPath = System.getenv(\"REACT_NATIVE_DEPENDENCIES\")\n\n// The Boost library is a very large download (>100MB).\n// If Boost is already present on your system, define the REACT_NATIVE_BOOST_PATH env variable\n// and the build will use that.\ndef boostPath = dependenciesPath ?: System.getenv(\"REACT_NATIVE_BOOST_PATH\")\n\ntask createNativeDepsDirectories {\n    downloadsDir.mkdirs()\n    thirdPartyNdkDir.mkdirs()\n}\n\ntask downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) {\n    src 'https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz'\n    onlyIfNewer true\n    overwrite false\n    dest new File(downloadsDir, 'boost_1_63_0.tar.gz')\n}\n\ntask prepareBoost(dependsOn: boostPath ? [] : [downloadBoost], type: Copy) {\n    from boostPath ?: tarTree(resources.gzip(downloadBoost.dest))\n    from 'src/main/jni/third-party/boost/Android.mk'\n    include 'Android.mk', 'boost_1_63_0/boost/**/*.hpp', 'boost/boost/**/*.hpp'\n    includeEmptyDirs = false\n    into \"$thirdPartyNdkDir/boost\"\n    doLast {\n        file(\"$thirdPartyNdkDir/boost/boost\").renameTo(\"$thirdPartyNdkDir/boost/boost_1_63_0\")\n    }\n}\n\ntask downloadDoubleConversion(dependsOn: createNativeDepsDirectories, type: Download) {\n    src 'https://github.com/google/double-conversion/archive/v1.1.1.tar.gz'\n    onlyIfNewer true\n    overwrite false\n    dest new File(downloadsDir, 'double-conversion-1.1.1.tar.gz')\n}\n\ntask prepareDoubleConversion(dependsOn: dependenciesPath ? [] : [downloadDoubleConversion], type: Copy) {\n    from dependenciesPath ?: tarTree(downloadDoubleConversion.dest)\n    from 'src/main/jni/third-party/double-conversion/Android.mk'\n    include 'double-conversion-1.1.1/src/**/*', 'Android.mk'\n    filesMatching('*/src/**/*', {fname -> fname.path = \"double-conversion/${fname.name}\"})\n    includeEmptyDirs = false\n    into \"$thirdPartyNdkDir/double-conversion\"\n}\n\ntask downloadFolly(dependsOn: createNativeDepsDirectories, type: Download) {\n    src 'https://github.com/facebook/folly/archive/v2016.09.26.00.tar.gz'\n    onlyIfNewer true\n    overwrite false\n    dest new File(downloadsDir, 'folly-2016.09.26.00.tar.gz');\n}\n\ntask prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy) {\n    from dependenciesPath ?: tarTree(downloadFolly.dest)\n    from 'src/main/jni/third-party/folly/Android.mk'\n    include 'folly-2016.09.26.00/folly/**/*', 'Android.mk'\n    eachFile {fname -> fname.path = (fname.path - \"folly-2016.09.26.00/\")}\n    includeEmptyDirs = false\n    into \"$thirdPartyNdkDir/folly\"\n}\n\ntask downloadGlog(dependsOn: createNativeDepsDirectories, type: Download) {\n    src 'https://github.com/google/glog/archive/v0.3.3.tar.gz'\n    onlyIfNewer true\n    overwrite false\n    dest new File(downloadsDir, 'glog-0.3.3.tar.gz')\n}\n\n// Prepare glog sources to be compiled, this task will perform steps that normally should've been\n// executed by automake. This way we can avoid dependencies on make/automake\ntask prepareGlog(dependsOn: dependenciesPath ? [] : [downloadGlog], type: Copy) {\n    from dependenciesPath ?: tarTree(downloadGlog.dest)\n    from 'src/main/jni/third-party/glog/'\n    include 'glog-0.3.3/src/**/*', 'Android.mk', 'config.h'\n    includeEmptyDirs = false\n    filesMatching('**/*.h.in') {\n        filter(ReplaceTokens, tokens: [\n                ac_cv_have_unistd_h: '1',\n                ac_cv_have_stdint_h: '1',\n                ac_cv_have_systypes_h: '1',\n                ac_cv_have_inttypes_h: '1',\n                ac_cv_have_libgflags: '0',\n                ac_google_start_namespace: 'namespace google {',\n                ac_cv_have_uint16_t: '1',\n                ac_cv_have_u_int16_t: '1',\n                ac_cv_have___uint16: '0',\n                ac_google_end_namespace: '}',\n                ac_cv_have___builtin_expect: '1',\n                ac_google_namespace: 'google',\n                ac_cv___attribute___noinline: '__attribute__ ((noinline))',\n                ac_cv___attribute___noreturn: '__attribute__ ((noreturn))',\n                ac_cv___attribute___printf_4_5: '__attribute__((__format__ (__printf__, 4, 5)))'\n        ])\n        it.path = (it.name - '.in')\n    }\n    into \"$thirdPartyNdkDir/glog\"\n}\n\ntask downloadJSCHeaders(type: Download) {\n    // in sync with webkit SVN revision 174650\n    def jscAPIBaseURL = 'https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/'\n    def jscHeaderFiles = ['JavaScript.h', 'JSBase.h', 'JSContextRef.h', 'JSObjectRef.h', 'JSRetainPtr.h', 'JSStringRef.h', 'JSValueRef.h', 'WebKitAvailability.h']\n    def output = new File(downloadsDir, 'jsc')\n    output.mkdirs()\n    src(jscHeaderFiles.collect { headerName -> \"$jscAPIBaseURL$headerName\" })\n    onlyIfNewer true\n    overwrite false\n    dest output\n}\n\n// Create Android.mk library module based on so files from mvn + include headers fetched from webkit.org\ntask prepareJSC(dependsOn: dependenciesPath ? [] : [downloadJSCHeaders]) << {\n    copy {\n        from zipTree(configurations.compile.fileCollection { dep -> dep.name == 'android-jsc' }.singleFile)\n        from dependenciesPath ? \"$dependenciesPath/jsc-headers\" : {downloadJSCHeaders.dest}\n        from 'src/main/jni/third-party/jsc/Android.mk'\n        include 'jni/**/*.so', '*.h', 'Android.mk'\n        filesMatching('*.h', { fname -> fname.path = \"JavaScriptCore/${fname.path}\"})\n        into \"$thirdPartyNdkDir/jsc\";\n    }\n}\n\ndef getNdkBuildName() {\n    if (Os.isFamily(Os.FAMILY_WINDOWS)) {\n        return \"ndk-build.cmd\"\n    } else {\n        return \"ndk-build\"\n    }\n}\n\ndef findNdkBuildFullPath() {\n    // we allow to provide full path to ndk-build tool\n    if (hasProperty('ndk.command')) {\n        return property('ndk.command')\n    }\n    // or just a path to the containing directory\n    if (hasProperty('ndk.path')) {\n        def ndkDir = property('ndk.path')\n        return new File(ndkDir, getNdkBuildName()).getAbsolutePath()\n    }\n    if (System.getenv('ANDROID_NDK') != null) {\n        def ndkDir = System.getenv('ANDROID_NDK')\n        return new File(ndkDir, getNdkBuildName()).getAbsolutePath()\n    }\n    def ndkDir = android.hasProperty('plugin') ? android.plugin.ndkFolder :\n            plugins.getPlugin('com.android.library').hasProperty('sdkHandler') ?\n                    plugins.getPlugin('com.android.library').sdkHandler.getNdkFolder() :\n                    android.ndkDirectory.absolutePath\n    if (ndkDir) {\n        return new File(ndkDir, getNdkBuildName()).getAbsolutePath()\n    }\n    return null\n}\n\ndef getNdkBuildFullPath() {\n    def ndkBuildFullPath = findNdkBuildFullPath()\n    if (ndkBuildFullPath == null) {\n        throw new GradleScriptException(\n            \"ndk-build binary cannot be found, check if you've set \" +\n            \"\\$ANDROID_NDK environment variable correctly or if ndk.dir is \" +\n            \"setup in local.properties\",\n            null)\n    }\n    if (!new File(ndkBuildFullPath).canExecute()) {\n        throw new GradleScriptException(\n            \"ndk-build binary \" + ndkBuildFullPath + \" doesn't exist or isn't executable.\\n\" +\n            \"Check that the \\$ANDROID_NDK environment variable, or ndk.dir in local.properties, is set correctly.\\n\" +\n            \"(On Windows, make sure you escape backslashes in local.properties or use forward slashes, e.g. C:\\\\\\\\ndk or C:/ndk rather than C:\\\\ndk)\",\n            null)\n    }\n    return ndkBuildFullPath\n}\n\ntask buildReactNdkLib(dependsOn: [prepareJSC, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog], type: Exec) {\n    inputs.file('src/main/jni/react')\n    outputs.dir(\"$buildDir/react-ndk/all\")\n    commandLine getNdkBuildFullPath(),\n            'NDK_PROJECT_PATH=null',\n            \"NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk\",\n            'NDK_OUT=' + temporaryDir,\n            \"NDK_LIBS_OUT=$buildDir/react-ndk/all\",\n            \"THIRD_PARTY_NDK_DIR=$buildDir/third-party-ndk\",\n            \"REACT_COMMON_DIR=$projectDir/../ReactCommon\",\n            '-C', file('src/main/jni/react/jni').absolutePath,\n            '--jobs', project.hasProperty(\"jobs\") ? project.property(\"jobs\") : Runtime.runtime.availableProcessors()\n}\n\ntask cleanReactNdkLib(type: Exec) {\n    commandLine getNdkBuildFullPath(),\n            \"NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk\",\n            \"THIRD_PARTY_NDK_DIR=$buildDir/third-party-ndk\",\n            \"REACT_COMMON_DIR=$projectDir/../ReactCommon\",\n            '-C', file('src/main/jni/react/jni').absolutePath,\n            'clean'\n}\n\ntask packageReactNdkLibs(dependsOn: buildReactNdkLib, type: Copy) {\n    from \"$buildDir/react-ndk/all\"\n    exclude '**/libjsc.so'\n    into \"$buildDir/react-ndk/exported\"\n}\n\ntask packageReactNdkLibsForBuck(dependsOn: packageReactNdkLibs, type: Copy) {\n    from \"$buildDir/react-ndk/exported\"\n    into \"src/main/jni/prebuilt/lib\"\n}\n\nandroid {\n    compileSdkVersion 23\n    buildToolsVersion \"23.0.1\"\n\n    defaultConfig {\n        minSdkVersion 16\n        targetSdkVersion 22\n        versionCode 1\n        versionName \"1.0\"\n\n        ndk {\n            moduleName \"reactnativejni\"\n        }\n\n        buildConfigField 'boolean', 'IS_INTERNAL_BUILD', 'false'\n        buildConfigField 'int', 'EXOPACKAGE_FLAGS', '0'\n        testApplicationId \"com.facebook.react.tests.gradle\"\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n    }\n\n    sourceSets.main {\n        jni.srcDirs = []\n        jniLibs.srcDir \"$buildDir/react-ndk/exported\"\n        res.srcDirs = ['src/main/res/devsupport', 'src/main/res/shell', 'src/main/res/views/modal', 'src/main/res/views/uimanager']\n        java {\n            srcDirs = ['src/main/java', 'src/main/libraries/soloader/java', 'src/main/jni/first-party/fb/jni/java']\n            exclude 'com/facebook/react/processing'\n            exclude 'com/facebook/react/module/processing'\n        }\n    }\n\n    tasks.withType(JavaCompile) {\n        compileTask -> compileTask.dependsOn packageReactNdkLibs\n    }\n\n    clean.dependsOn cleanReactNdkLib\n\n    lintOptions {\n        abortOnError false\n    }\n    packagingOptions {\n        exclude 'META-INF/NOTICE'\n        exclude 'META-INF/LICENSE'\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'src/main/third-party/java/infer-annotations/', include: ['*.jar'])\n    compile 'javax.inject:javax.inject:1'\n    compile 'com.android.support:appcompat-v7:23.0.1'\n    compile 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.0.0'\n    compile 'com.facebook.fresco:fresco:1.3.0'\n    compile 'com.facebook.fresco:imagepipeline-okhttp3:1.3.0'\n    compile 'com.facebook.soloader:soloader:0.1.0'\n    compile 'com.google.code.findbugs:jsr305:3.0.0'\n    compile 'com.squareup.okhttp3:okhttp:3.6.0'\n    compile 'com.squareup.okhttp3:okhttp-urlconnection:3.6.0'\n    compile 'com.squareup.okio:okio:1.13.0'\n    compile 'org.webkit:android-jsc:r174650'\n\n    testCompile \"junit:junit:${JUNIT_VERSION}\"\n    testCompile \"org.powermock:powermock-api-mockito:${POWERMOCK_VERSION}\"\n    testCompile \"org.powermock:powermock-module-junit4-rule:${POWERMOCK_VERSION}\"\n    testCompile \"org.powermock:powermock-classloading-xstream:${POWERMOCK_VERSION}\"\n    testCompile \"org.mockito:mockito-core:${MOCKITO_CORE_VERSION}\"\n    testCompile \"org.easytesting:fest-assert-core:${FEST_ASSERT_CORE_VERSION}\"\n    testCompile \"org.robolectric:robolectric:${ROBOLECTRIC_VERSION}\"\n\n    androidTestCompile fileTree(dir: 'src/main/third-party/java/buck-android-support/', include: ['*.jar'])\n    androidTestCompile 'com.android.support.test:runner:0.3'\n    androidTestCompile \"org.mockito:mockito-core:${MOCKITO_CORE_VERSION}\"\n}\n\napply from: 'release.gradle'\n"
  },
  {
    "path": "ReactAndroid/gradle.properties",
    "content": "VERSION_NAME=1000.0.0-master\nGROUP=com.facebook.react\n\nPOM_NAME=ReactNative\nPOM_ARTIFACT_ID=react-native\nPOM_PACKAGING=aar\n\nandroid.useDeprecatedNdk=true\n\nMOCKITO_CORE_VERSION=1.10.19\nPOWERMOCK_VERSION=1.6.2\nROBOLECTRIC_VERSION=3.0\nJUNIT_VERSION=4.12\nFEST_ASSERT_CORE_VERSION=2.0M10\n"
  },
  {
    "path": "ReactAndroid/libs/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_prebuilt_aar(\n    name = \"appcompat\",\n    aar = \":appcompat-binary-aar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"appcompat-binary-aar\",\n    sha1 = \"7d659f671541394a8bc2b9f909950aa2a5ec87ff\",\n    url = \"mvn:com.android.support:appcompat-v7:aar:23.0.1\",\n)\n\nandroid_prebuilt_aar(\n    name = \"android-jsc\",\n    aar = \":android-jsc-aar\",\n)\n\nremote_file(\n    name = \"android-jsc-aar\",\n    sha1 = \"880cedd93f43e0fc841f01f2fa185a63d9230f85\",\n    url = \"mvn:org.webkit:android-jsc:aar:r174650\",\n)\n"
  },
  {
    "path": "ReactAndroid/release.gradle",
    "content": "// Copyright 2015-present Facebook. All Rights Reserved.\n\napply plugin: 'maven'\napply plugin: 'signing'\n\n// Gradle tasks for publishing to maven\n// 1) To install in local maven repo use :installArchives task\n// 2) To upload artifact to maven central use: :uploadArchives (you'd need to have the permission to do that)\n\ndef isReleaseBuild() {\n    return VERSION_NAME.contains('SNAPSHOT') == false\n}\n\ndef getRepositoryUrl() {\n    return hasProperty('repositoryUrl') ? property('repositoryUrl') : 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'\n}\n\ndef getRepositoryUsername() {\n    return hasProperty('repositoryUsername') ? property('repositoryUsername') : ''\n}\n\ndef getRepositoryPassword() {\n    return hasProperty('repositoryPassword') ? property('repositoryPassword') : ''\n}\n\ndef configureReactNativePom(def pom) {\n    pom.project {\n        name POM_NAME\n        artifactId POM_ARTIFACT_ID\n        packaging POM_PACKAGING\n        description 'A framework for building native apps with React'\n        url 'https://github.com/facebook/react-native'\n\n        scm {\n            url 'https://github.com/facebook/react-native.git'\n            connection 'scm:git:https://github.com/facebook/react-native.git'\n            developerConnection 'scm:git:git@github.com:facebook/react-native.git'\n        }\n\n        licenses {\n            license {\n                name 'BSD License'\n                url 'https://github.com/facebook/react-native/blob/master/LICENSE'\n                distribution 'repo'\n            }\n        }\n\n        developers {\n            developer {\n                id 'facebook'\n                name 'Facebook'\n            }\n        }\n    }\n}\n\nif (JavaVersion.current().isJava8Compatible()) {\n  allprojects {\n    tasks.withType(Javadoc) {\n      options.addStringOption('Xdoclint:none', '-quiet')\n    }\n  }\n}\n\nafterEvaluate { project ->\n\n    task androidJavadoc(type: Javadoc) {\n        source = android.sourceSets.main.java.srcDirs\n        classpath += files(android.bootClasspath)\n        classpath += files(project.getConfigurations().getByName('compile').asList())\n        include '**/*.java'\n        exclude '**/ReactBuildConfig.java'\n    }\n\n    task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {\n        classifier = 'javadoc'\n        from androidJavadoc.destinationDir\n    }\n\n    task androidSourcesJar(type: Jar) {\n        classifier = 'sources'\n        from android.sourceSets.main.java.srcDirs\n        include '**/*.java'\n    }\n\n    android.libraryVariants.all { variant ->\n        def name = variant.name.capitalize()\n        task \"jar${name}\"(type: Jar, dependsOn: variant.javaCompile) {\n            from variant.javaCompile.destinationDir\n        }\n    }\n\n    artifacts {\n        archives androidSourcesJar\n        archives androidJavadocJar\n    }\n\n    version = VERSION_NAME\n    group = GROUP\n\n    signing {\n        required { isReleaseBuild() && gradle.taskGraph.hasTask('uploadArchives') }\n        sign configurations.archives\n    }\n\n    uploadArchives {\n        configuration = configurations.archives\n        repositories.mavenDeployer {\n            beforeDeployment {\n                MavenDeployment deployment -> signing.signPom(deployment)\n            }\n\n            repository(url: getRepositoryUrl()) {\n                authentication(\n                        userName: getRepositoryUsername(),\n                        password: getRepositoryPassword())\n\n            }\n\n            configureReactNativePom pom\n        }\n    }\n\n    task installArchives(type: Upload) {\n        configuration = configurations.archives\n        repositories.mavenDeployer {\n            // Deploy to react-native/android, ready to publish to npm\n            repository url: \"file://${projectDir}/../android\"\n\n            configureReactNativePom pom\n        }\n    }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/assets/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_resource(\n    name = \"assets\",\n    assets = \".\",\n    visibility = [\"PUBLIC\"],\n)\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/buck-runner/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\n# We are running instrumentation tests in simple mode: app code and instrumentation are in the same APK\n# Currently you need to run these commands to execute tests:\n#\n# node local-cli/cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js\n# gradle :ReactAndroid:packageReactNdkLibsForBuck\n# buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests\n# ./scripts/run-android-instrumentation-tests.sh com.facebook.react.tests\nandroid_binary(\n    name = \"instrumentation-tests\",\n    keystore = \"//keystores:debug\",\n    manifest = \"AndroidManifest.xml\",\n    deps = [\n        react_native_dep(\"android_res/com/facebook/catalyst/appcompat:appcompat\"),\n        react_native_dep(\"libraries/soloader/java/com/facebook/soloader:soloader\"),\n        react_native_dep(\"third-party/java/testing-support-lib:exposed-instrumentation-api\"),\n        react_native_integration_tests_target(\"assets:assets\"),\n        react_native_integration_tests_target(\"java/com/facebook/react/tests:tests\"),\n        react_native_target(\"java/com/facebook/react/devsupport:devsupport\"),\n        react_native_target(\"jni/prebuilt:android-jsc\"),\n        react_native_target(\"jni/prebuilt:reactnative-libs\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/AbstractScrollViewTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport java.util.ArrayList;\nimport java.util.concurrent.Semaphore;\nimport java.util.concurrent.TimeUnit;\n\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\n\n/**\n * Shared by {@link ReactScrollViewTestCase} and {@link ReactHorizontalScrollViewTestCase}.\n * See also ScrollViewTestModule.js\n */\npublic abstract class AbstractScrollViewTestCase extends ReactAppInstrumentationTestCase {\n\n  protected ScrollListenerModule mScrollListenerModule;\n\n  protected static interface ScrollViewTestModule extends JavaScriptModule {\n    public void scrollTo(float destX, float destY);\n  }\n\n  @Override\n  protected void tearDown() throws Exception {\n    waitForBridgeAndUIIdle(60000);\n    super.tearDown();\n  }\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    mScrollListenerModule = new ScrollListenerModule();\n    return super.createReactInstanceSpecForTest()\n        .addNativeModule(mScrollListenerModule);\n  }\n\n  // See ScrollViewListenerModule.js\n  protected static class ScrollListenerModule extends BaseJavaModule {\n\n    private final ArrayList<Double> mXOffsets = new ArrayList<Double>();\n    private final ArrayList<Double> mYOffsets = new ArrayList<Double>();\n    private final ArrayList<Integer> mItemsPressed = new ArrayList<Integer>();\n    private final Semaphore mScrollSignaler = new Semaphore(0);\n    private boolean mScrollBeginDragCalled;\n    private boolean mScrollEndDragCalled;\n\n    // Matches ScrollViewListenerModule.js\n    @Override\n    public String getName() {\n      return \"ScrollListener\";\n    }\n\n    @ReactMethod\n    public void onScroll(double x, double y) {\n      mXOffsets.add(x);\n      mYOffsets.add(y);\n      mScrollSignaler.release();\n    }\n\n    @ReactMethod\n    public void onItemPress(int itemNumber) {\n      mItemsPressed.add(itemNumber);\n    }\n\n    @ReactMethod\n    public void onScrollBeginDrag(double x, double y) {\n      mScrollBeginDragCalled = true;\n    }\n\n    @ReactMethod\n    public void onScrollEndDrag(double x, double y) {\n      mScrollEndDragCalled = true;\n    }\n\n    public void waitForScrollIdle() {\n      while (true) {\n        try {\n          boolean gotScrollSignal = mScrollSignaler.tryAcquire(1000, TimeUnit.MILLISECONDS);\n          if (!gotScrollSignal) {\n            return;\n          }\n        } catch (InterruptedException e) {\n          throw new RuntimeException(e);\n        }\n      }\n    }\n\n    public ArrayList<Double> getXOffsets() {\n      return mXOffsets;\n    }\n\n    public ArrayList<Double> getYOffsets() {\n      return mYOffsets;\n    }\n\n    public ArrayList<Integer> getItemsPressed() {\n      return mItemsPressed;\n    }\n\n    public boolean dragEventsMatch() {\n      return mScrollBeginDragCalled && mScrollEndDragCalled;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"testing\",\n    srcs = glob(\n        [\"**/*.java\"],\n        excludes = [\n            \"idledetection/**/*.java\",\n            \"network/**/*.java\",\n        ],\n    ),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/soloader/java/com/facebook/soloader:soloader\"),\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n        react_native_dep(\"third-party/java/buck-android-support:buck-android-support\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/junit:junit\"),\n        react_native_dep(\"third-party/java/mockito:mockito\"),\n        react_native_dep(\"third-party/java/testing-support-lib:runner\"),\n        react_native_integration_tests_target(\"java/com/facebook/react/testing/idledetection:idledetection\"),\n        react_native_integration_tests_target(\"java/com/facebook/react/testing/network:network\"),\n        react_native_target(\"java/com/facebook/react:react\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/devsupport:interfaces\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/module/model:model\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/modules/debug:interfaces\"),\n        react_native_target(\"java/com/facebook/react/shell:shell\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"res:uimanager\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/FakeWebSocketModule.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport javax.annotation.Nullable;\n\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\n\n/**\n * Dummy implementation of storage module, used for testing\n */\npublic final class FakeWebSocketModule extends BaseJavaModule {\n\n  @Override\n  public String getName() {\n    return \"WebSocketModule\";\n  }\n\n  @Override\n  public boolean canOverrideExistingModule() {\n    return true;\n  }\n\n  @ReactMethod\n  public void connect(\n    final String url,\n    @Nullable final ReadableArray protocols,\n    @Nullable final ReadableMap headers,\n    final int id) {\n  }\n\n  @ReactMethod\n  public void close(int code, String reason, int id) {\n  }\n\n  @ReactMethod\n  public void send(String message, int id) {\n  }\n\n  @ReactMethod\n  public void sendBinary(String base64String, int id) {\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/InstanceSpecForTestPackage.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport java.util.List;\n\nimport android.view.View;\n\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.ReactPackage;\n\n/**\n * This class wraps {@class ReactInstanceSpecForTest} in {@class ReactPackage} interface.\n * TODO(6788898): Refactor test code to use ReactPackage instead of SpecForTest\n */\npublic class InstanceSpecForTestPackage implements ReactPackage {\n\n  private final ReactInstanceSpecForTest mSpecForTest;\n\n  public InstanceSpecForTestPackage(ReactInstanceSpecForTest specForTest) {\n    mSpecForTest = specForTest;\n  }\n\n  @Override\n  public List<NativeModule> createNativeModules(\n      ReactApplicationContext catalystApplicationContext) {\n    return mSpecForTest.getExtraNativeModulesForTest();\n  }\n\n  @Override\n  public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {\n    return mSpecForTest.getExtraViewManagers();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactAppInstrumentationTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport javax.annotation.Nullable;\n\nimport java.util.concurrent.CountDownLatch;\nimport java.util.concurrent.TimeUnit;\n\nimport android.graphics.Bitmap;\nimport android.test.ActivityInstrumentationTestCase2;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.testing.idledetection.IdleWaiter;\n\n/**\n * Base class for instrumentation tests that runs React based react application in UI mode\n */\npublic abstract class ReactAppInstrumentationTestCase extends\n    ActivityInstrumentationTestCase2<ReactAppTestActivity> implements IdleWaiter {\n\n  public ReactAppInstrumentationTestCase() {\n    super(ReactAppTestActivity.class);\n  }\n\n  @Override\n  protected void setUp() throws Exception {\n    super.setUp();\n\n    final ReactAppTestActivity activity = getActivity();\n    try {\n      runTestOnUiThread(new Runnable() {\n        @Override\n        public void run() {\n          activity.loadApp(\n              getReactApplicationKeyUnderTest(),\n              createReactInstanceSpecForTest(),\n              getEnableDevSupport());\n        }\n      });\n    } catch (Throwable t) {\n      throw new Exception(\"Unable to load react app\", t);\n    }\n    waitForBridgeAndUIIdle();\n    assertTrue(\"Layout never occurred!\", activity.waitForLayout(5000));\n    waitForBridgeAndUIIdle();\n  }\n\n  @Override\n  protected void tearDown() throws Exception {\n    ReactAppTestActivity activity = getActivity();\n    super.tearDown();\n    activity.waitForDestroy(5000);\n  }\n\n  public ViewGroup getRootView() {\n    return (ViewGroup) getActivity().getRootView();\n  }\n\n  /**\n   * This method isn't safe since it doesn't factor in layout-only view removal. Use\n   * {@link #getViewByTestId(String)} instead.\n   */\n  @Deprecated\n  public <T extends View> T getViewAtPath(int... path) {\n    return ReactTestHelper.getViewAtPath((ViewGroup) getRootView().getParent(), path);\n  }\n\n  public <T extends View> T getViewByTestId(String testID) {\n    return (T) ReactTestHelper\n        .getViewWithReactTestId((ViewGroup) getRootView().getParent(), testID);\n  }\n\n  public SingleTouchGestureGenerator createGestureGenerator() {\n    return new SingleTouchGestureGenerator(getRootView(), this);\n  }\n\n  public void waitForBridgeAndUIIdle() {\n    getActivity().waitForBridgeAndUIIdle();\n  }\n\n  public void waitForBridgeAndUIIdle(long timeoutMs) {\n    getActivity().waitForBridgeAndUIIdle(timeoutMs);\n  }\n\n  protected Bitmap getScreenshot() {\n    // Wait for the UI to settle. If the UI is doing animations, this may be unsafe!\n    getInstrumentation().waitForIdleSync();\n\n    final CountDownLatch latch = new CountDownLatch(1);\n    final BitmapHolder bitmapHolder = new BitmapHolder();\n    final Runnable getScreenshotRunnable = new Runnable() {\n\n      private static final int MAX_TRIES = 1000;\n      // This is the constant used in the support library for APIs that don't have Choreographer\n      private static final int FRAME_DELAY_MS = 10;\n\n      private int mNumRuns = 0;\n\n      @Override\n      public void run() {\n        mNumRuns++;\n        ReactAppTestActivity activity = getActivity();\n        if (!activity.isScreenshotReady()) {\n          if (mNumRuns > MAX_TRIES) {\n            throw new RuntimeException(\n                \"Waited \" + MAX_TRIES + \" frames to get screenshot but it's still not ready!\");\n          }\n          activity.postDelayed(this, FRAME_DELAY_MS);\n          return;\n        }\n\n        bitmapHolder.bitmap = getActivity().getCurrentScreenshot();\n        latch.countDown();\n      }\n    };\n\n    getActivity().runOnUiThread(getScreenshotRunnable);\n    try {\n      if (!latch.await(5000, TimeUnit.MILLISECONDS)) {\n        throw new RuntimeException(\"Timed out waiting for screenshot runnable to run!\");\n      }\n    } catch (InterruptedException e) {\n      throw new RuntimeException(e);\n    }\n    return Assertions.assertNotNull(bitmapHolder.bitmap);\n  }\n\n  /**\n   * Implement this method to provide application key to be launched. List of available\n   * application is located in TestBundle.js file\n   */\n  protected abstract String getReactApplicationKeyUnderTest();\n\n  protected boolean getEnableDevSupport() {\n    return false;\n  }\n\n  /**\n   * Override this method to provide extra native modules to be loaded before the app starts\n   */\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    return new ReactInstanceSpecForTest();\n  }\n\n  protected ReactContext getReactContext() {\n    return getActivity().getReactContext();\n  }\n\n  /**\n   * Helper class to pass the bitmap between execution scopes in {@link #getScreenshot()}.\n   */\n  private static class BitmapHolder {\n\n    public @Nullable volatile Bitmap bitmap;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactAppTestActivity.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport android.graphics.Bitmap;\nimport android.os.Bundle;\nimport android.support.v4.app.FragmentActivity;\nimport android.view.View;\nimport android.view.ViewTreeObserver;\nimport android.widget.FrameLayout;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.ReactInstanceManager;\nimport com.facebook.react.ReactInstanceManagerBuilder;\nimport com.facebook.react.ReactRootView;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.common.LifecycleState;\nimport com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;\nimport com.facebook.react.modules.core.PermissionAwareActivity;\nimport com.facebook.react.modules.core.PermissionListener;\nimport com.facebook.react.shell.MainReactPackage;\nimport com.facebook.react.testing.idledetection.ReactBridgeIdleSignaler;\nimport com.facebook.react.testing.idledetection.ReactIdleDetectionUtil;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport java.util.concurrent.CountDownLatch;\nimport java.util.concurrent.TimeUnit;\nimport javax.annotation.Nullable;\n\npublic class ReactAppTestActivity extends FragmentActivity\n    implements DefaultHardwareBackBtnHandler, PermissionAwareActivity {\n\n  private static final String DEFAULT_BUNDLE_NAME = \"AndroidTestBundle.js\";\n  private static final int ROOT_VIEW_ID = 8675309;\n  // we need a bigger timeout for CI builds because they run on a slow emulator\n  private static final long IDLE_TIMEOUT_MS = 120000;\n\n  private CountDownLatch mLayoutEvent = new CountDownLatch(1);\n  private @Nullable ReactBridgeIdleSignaler mBridgeIdleSignaler;\n  private ScreenshotingFrameLayout mScreenshotingFrameLayout;\n  private final CountDownLatch mDestroyCountDownLatch = new CountDownLatch(1);\n  private @Nullable ReactInstanceManager mReactInstanceManager;\n  private @Nullable ReactRootView mReactRootView;\n  private LifecycleState mLifecycleState = LifecycleState.BEFORE_RESUME;\n\n  @Override\n  protected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n\n    overridePendingTransition(0, 0);\n\n    // We wrap screenshot layout in another FrameLayout in order to handle custom dimensions of the\n    // screenshot view set through {@link #setScreenshotDimensions}\n    FrameLayout rootView = new FrameLayout(this);\n    setContentView(rootView);\n\n    mScreenshotingFrameLayout = new ScreenshotingFrameLayout(this);\n    mScreenshotingFrameLayout.setId(ROOT_VIEW_ID);\n    rootView.addView(mScreenshotingFrameLayout);\n\n    mReactRootView = new ReactRootView(this);\n    mScreenshotingFrameLayout.addView(mReactRootView);\n  }\n\n  @Override\n  protected void onPause() {\n    super.onPause();\n\n    mLifecycleState = LifecycleState.BEFORE_RESUME;\n\n    overridePendingTransition(0, 0);\n\n    if (mReactInstanceManager != null) {\n      mReactInstanceManager.onHostPause();\n    }\n  }\n\n  @Override\n  protected void onResume() {\n    super.onResume();\n\n    mLifecycleState = LifecycleState.RESUMED;\n\n    if (mReactInstanceManager != null) {\n      mReactInstanceManager.onHostResume(this, this);\n    }\n  }\n\n  @Override\n  protected void onDestroy() {\n    super.onDestroy();\n    mDestroyCountDownLatch.countDown();\n\n    if (mReactInstanceManager != null) {\n      mReactInstanceManager.destroy();\n      mReactInstanceManager = null;\n    }\n    if (mReactRootView != null) {\n      mReactRootView.unmountReactApplication();\n      mReactRootView = null;\n    }\n\n    mScreenshotingFrameLayout.clean();\n  }\n\n  public void waitForDestroy(long timeoutMs) throws InterruptedException {\n    mDestroyCountDownLatch.await(timeoutMs, TimeUnit.MILLISECONDS);\n  }\n\n  public void loadApp(String appKey, ReactInstanceSpecForTest spec, boolean enableDevSupport) {\n    loadApp(appKey, spec, null, DEFAULT_BUNDLE_NAME, enableDevSupport);\n  }\n\n  public void loadApp(String appKey, ReactInstanceSpecForTest spec, String bundleName) {\n    loadApp(appKey, spec, null, bundleName, false /* = useDevSupport */);\n  }\n\n  public void loadApp(\n    String appKey,\n    ReactInstanceSpecForTest spec,\n    String bundleName,\n    UIImplementationProvider uiImplementationProvider) {\n    loadApp(appKey, spec, null, bundleName, false /* = useDevSupport */, uiImplementationProvider);\n  }\n\n  public void resetRootViewForScreenshotTests() {\n    if (mReactInstanceManager != null) {\n      mReactInstanceManager.destroy();\n      mReactInstanceManager = null;\n    }\n    if (mReactRootView != null) {\n      mReactRootView.unmountReactApplication();\n    }\n    mReactRootView = new ReactRootView(this);\n    mScreenshotingFrameLayout.removeAllViews();\n    mScreenshotingFrameLayout.clean();\n    mScreenshotingFrameLayout.addView(mReactRootView);\n  }\n\n  public void loadApp(\n      String appKey,\n      ReactInstanceSpecForTest spec,\n      @Nullable Bundle initialProps,\n      String bundleName,\n      boolean useDevSupport) {\n    loadApp(appKey, spec, initialProps, bundleName, useDevSupport, null);\n  }\n\n  public void loadApp(\n    String appKey,\n    ReactInstanceSpecForTest spec,\n    @Nullable Bundle initialProps,\n    String bundleName,\n    boolean useDevSupport,\n    UIImplementationProvider uiImplementationProvider) {\n\n    final CountDownLatch currentLayoutEvent = mLayoutEvent = new CountDownLatch(1);\n    mBridgeIdleSignaler = new ReactBridgeIdleSignaler();\n\n    ReactInstanceManagerBuilder builder =\n        ReactTestHelper.getReactTestFactory()\n            .getReactInstanceManagerBuilder()\n            .setApplication(getApplication())\n            .setBundleAssetName(bundleName);\n    if (!spec.getAlternativeReactPackagesForTest().isEmpty()) {\n      builder.addPackages(spec.getAlternativeReactPackagesForTest());\n    } else {\n      builder.addPackage(new MainReactPackage());\n    }\n    builder\n        .addPackage(new InstanceSpecForTestPackage(spec))\n        // By not setting a JS module name, we force the bundle to be always loaded from\n        // assets, not the devserver, even if dev mode is enabled (such as when testing redboxes).\n        // This makes sense because we never run the devserver in tests.\n        //.setJSMainModuleName()\n        .setUseDeveloperSupport(useDevSupport)\n        .setBridgeIdleDebugListener(mBridgeIdleSignaler)\n        .setInitialLifecycleState(mLifecycleState)\n        .setUIImplementationProvider(uiImplementationProvider);\n\n    mReactInstanceManager = builder.build();\n    mReactInstanceManager.onHostResume(this, this);\n\n    Assertions.assertNotNull(mReactRootView).getViewTreeObserver().addOnGlobalLayoutListener(\n        new ViewTreeObserver.OnGlobalLayoutListener() {\n          @Override\n          public void onGlobalLayout() {\n            currentLayoutEvent.countDown();\n          }\n        });\n    Assertions.assertNotNull(mReactRootView)\n        .startReactApplication(mReactInstanceManager, appKey, initialProps);\n  }\n\n  public boolean waitForLayout(long millis) throws InterruptedException {\n    return mLayoutEvent.await(millis, TimeUnit.MILLISECONDS);\n  }\n\n  public void waitForBridgeAndUIIdle() {\n    waitForBridgeAndUIIdle(IDLE_TIMEOUT_MS);\n  }\n\n  public void waitForBridgeAndUIIdle(long timeoutMs) {\n    ReactIdleDetectionUtil.waitForBridgeAndUIIdle(\n        Assertions.assertNotNull(mBridgeIdleSignaler),\n        getReactContext(),\n        timeoutMs);\n  }\n\n  public View getRootView() {\n    return Assertions.assertNotNull(mReactRootView);\n  }\n\n  public ReactContext getReactContext() {\n    return waitForReactContext();\n  }\n\n  // Because react context is created asynchronously, we may have to wait until it is available.\n  // It's simpler than exposing synchronosition mechanism to notify listener than react context\n  // creation has completed.\n  private ReactContext waitForReactContext() {\n    Assertions.assertNotNull(mReactInstanceManager);\n\n    try {\n      while (true) {\n        ReactContext reactContext = mReactInstanceManager.getCurrentReactContext();\n        if (reactContext != null) {\n           return reactContext;\n        }\n        Thread.sleep(100);\n      }\n    } catch (InterruptedException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public void postDelayed(Runnable r, int delayMS) {\n    getRootView().postDelayed(r, delayMS);\n  }\n\n  /**\n   * Does not ensure that this is run on the UI thread or that the UI Looper is idle like\n   * {@link ReactAppInstrumentationTestCase#getScreenshot()}. You probably want to use that\n   * instead.\n   */\n  public Bitmap getCurrentScreenshot() {\n    return mScreenshotingFrameLayout.getLastDrawnBitmap();\n  }\n\n  public boolean isScreenshotReady() {\n    return mScreenshotingFrameLayout.isScreenshotReady();\n  }\n\n  public void setScreenshotDimensions(int width, int height) {\n    mScreenshotingFrameLayout.setLayoutParams(new FrameLayout.LayoutParams(width, height));\n  }\n\n  @Override\n  public void invokeDefaultOnBackPressed() {\n    super.onBackPressed();\n  }\n\n  @Override\n  public void onRequestPermissionsResult(\n      int requestCode,\n      String[] permissions,\n      int[] grantResults) {\n  }\n\n  @Override\n  public void requestPermissions(\n      String[] permissions, int requestCode, PermissionListener listener) {}\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactInstanceSpecForTest.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport android.annotation.SuppressLint;\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\n/**\n * A spec that allows a test to add additional NativeModules/JS modules to the ReactInstance. This\n * can also be used to stub out existing native modules by adding another module with the same name\n * as a built-in module.\n */\n@SuppressLint(\"JavatestsIncorrectFolder\")\npublic class ReactInstanceSpecForTest {\n\n  private final List<NativeModule> mNativeModules =\n    new ArrayList<NativeModule>(Arrays.asList(new FakeWebSocketModule()));\n  private final List<Class<? extends JavaScriptModule>> mJSModuleSpecs = new ArrayList<>();\n  private final List<ViewManager> mViewManagers = new ArrayList<>();\n  private final ArrayList<ReactPackage> mReactPackages = new ArrayList<>();\n\n  public ReactInstanceSpecForTest addNativeModule(NativeModule module) {\n    mNativeModules.add(module);\n    return this;\n  }\n\n  public ReactInstanceSpecForTest setPackage(ReactPackage reactPackage) {\n    if (!mReactPackages.isEmpty()) {\n      throw new IllegalStateException(\n          \"setPackage is not allowed after addPackages. \" + reactPackage);\n    }\n    mReactPackages.add(reactPackage);\n    return this;\n  }\n\n  public ReactInstanceSpecForTest addPackages(List<ReactPackage> reactPackages) {\n    mReactPackages.addAll(reactPackages);\n    return this;\n  }\n\n  public ReactInstanceSpecForTest addViewManager(ViewManager viewManager) {\n    mViewManagers.add(viewManager);\n    return this;\n  }\n\n  public List<NativeModule> getExtraNativeModulesForTest() {\n    return mNativeModules;\n  }\n\n  public ReactPackage getAlternativeReactPackageForTest() {\n    if (mReactPackages.size() > 1) {\n      throw new IllegalStateException(\n          \"Multiple packages were added - use getAlternativeReactPackagesForTest instead.\");\n    }\n    return mReactPackages.get(0);\n  }\n\n  public List<ReactPackage> getAlternativeReactPackagesForTest() {\n    return mReactPackages;\n  }\n\n  public List<ViewManager> getExtraViewManagers() {\n    return mViewManagers;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactIntegrationTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport javax.annotation.Nullable;\n\nimport java.util.concurrent.CountDownLatch;\nimport java.util.concurrent.Semaphore;\nimport java.util.concurrent.TimeUnit;\n\nimport android.app.Application;\nimport android.support.test.InstrumentationRegistry;\nimport android.test.AndroidTestCase;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.SoftAssertions;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.common.futures.SimpleSettableFuture;\nimport com.facebook.react.devsupport.interfaces.DevSupportManager;\nimport com.facebook.react.modules.core.Timing;\nimport com.facebook.react.testing.idledetection.ReactBridgeIdleSignaler;\nimport com.facebook.react.testing.idledetection.ReactIdleDetectionUtil;\nimport com.facebook.soloader.SoLoader;\n\nimport static org.mockito.Mockito.mock;\n\n/**\n * Use this class for writing integration tests of catalyst. This class will run all JNI call\n * within separate android looper, thus you don't need to care about starting your own looper.\n *\n * Keep in mind that all JS remote method calls and script load calls are asynchronous and you\n * should not expect them to return results immediately.\n *\n * In order to write catalyst integration:\n *  1) Make {@link ReactIntegrationTestCase} a base class of your test case\n *  2) Use {@link ReactTestHelper#catalystInstanceBuilder()}\n *  instead of {@link com.facebook.react.bridge.CatalystInstanceImpl.Builder} to build catalyst\n *  instance for testing purposes\n *\n */\npublic abstract class ReactIntegrationTestCase extends AndroidTestCase {\n\n  // we need a bigger timeout for CI builds because they run on a slow emulator\n  private static final long IDLE_TIMEOUT_MS = 60000;\n\n  private @Nullable CatalystInstance mInstance;\n  private @Nullable ReactBridgeIdleSignaler mBridgeIdleSignaler;\n  private @Nullable ReactApplicationContext mReactContext;\n\n  @Override\n  public ReactApplicationContext getContext() {\n    if (mReactContext == null) {\n      mReactContext = new ReactApplicationContext(super.getContext());\n      Assertions.assertNotNull(mReactContext);\n    }\n\n    return mReactContext;\n  }\n\n  public void shutDownContext() {\n    if (mInstance != null) {\n      final ReactContext contextToDestroy = mReactContext;\n      mReactContext = null;\n      mInstance = null;\n\n      final SimpleSettableFuture<Void> semaphore = new SimpleSettableFuture<>();\n      UiThreadUtil.runOnUiThread(new Runnable() {\n        @Override\n        public void run() {\n          if (contextToDestroy != null) {\n            contextToDestroy.destroy();\n          }\n          semaphore.set(null);\n        }\n      });\n      semaphore.getOrThrow();\n    }\n  }\n\n  /**\n   * This method isn't safe since it doesn't factor in layout-only view removal. Use\n   * {@link #getViewByTestId} instead.\n   */\n  @Deprecated\n  public <T extends View> T getViewAtPath(ViewGroup rootView, int... path) {\n    return ReactTestHelper.getViewAtPath(rootView, path);\n  }\n\n  public <T extends View> T getViewByTestId(ViewGroup rootView, String testID) {\n    return (T) ReactTestHelper.getViewWithReactTestId(rootView, testID);\n  }\n\n  public static class Event {\n    private final CountDownLatch mLatch;\n\n    public Event() {\n      this(1);\n    }\n\n    public Event(int counter) {\n      mLatch = new CountDownLatch(counter);\n    }\n\n    public void occur() {\n      mLatch.countDown();\n    }\n\n    public boolean didOccur() {\n      return mLatch.getCount() == 0;\n    }\n\n    public boolean await(long millis) {\n      try {\n        return mLatch.await(millis, TimeUnit.MILLISECONDS);\n      } catch (InterruptedException ignore) {\n        return false;\n      }\n    }\n  }\n\n  /**\n   * Timing module needs to be created on the main thread so that it gets the correct Choreographer.\n   */\n  protected Timing createTimingModule() {\n    final SimpleSettableFuture<Timing> simpleSettableFuture = new SimpleSettableFuture<Timing>();\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            Timing timing = new Timing(getContext(), mock(DevSupportManager.class));\n            simpleSettableFuture.set(timing);\n          }\n        });\n    try {\n      return simpleSettableFuture.get(5000, TimeUnit.MILLISECONDS);\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public void initializeWithInstance(CatalystInstance instance) {\n    mInstance = instance;\n    mBridgeIdleSignaler = new ReactBridgeIdleSignaler();\n    mInstance.addBridgeIdleDebugListener(mBridgeIdleSignaler);\n    getContext().initializeWithInstance(mInstance);\n  }\n\n  public boolean waitForBridgeIdle(long millis) {\n    return Assertions.assertNotNull(mBridgeIdleSignaler).waitForIdle(millis);\n  }\n\n  public void waitForIdleSync() {\n    InstrumentationRegistry.getInstrumentation().waitForIdleSync();\n  }\n\n  public void waitForBridgeAndUIIdle() {\n    ReactIdleDetectionUtil.waitForBridgeAndUIIdle(\n        Assertions.assertNotNull(mBridgeIdleSignaler),\n        getContext(),\n        IDLE_TIMEOUT_MS);\n  }\n\n  @Override\n  protected void setUp() throws Exception {\n    super.setUp();\n    SoLoader.init(getContext(), /* native exopackage */ false);\n  }\n\n  @Override\n  protected void tearDown() throws Exception {\n    super.tearDown();\n    shutDownContext();\n  }\n\n  protected static void initializeJavaModule(final BaseJavaModule javaModule) {\n    final Semaphore semaphore = new Semaphore(0);\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            javaModule.initialize();\n            if (javaModule instanceof LifecycleEventListener) {\n              ((LifecycleEventListener) javaModule).onHostResume();\n            }\n            semaphore.release();\n          }\n        });\n    try {\n      SoftAssertions.assertCondition(\n          semaphore.tryAcquire(5000, TimeUnit.MILLISECONDS),\n          \"Timed out initializing timing module\");\n    } catch (InterruptedException e) {\n      throw new RuntimeException(e);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactSettingsForTests.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport com.facebook.react.modules.debug.interfaces.DeveloperSettings;\n\npublic class ReactSettingsForTests implements DeveloperSettings {\n\n  @Override\n  public boolean isFpsDebugEnabled() {\n    return false;\n  }\n\n  @Override\n  public boolean isAnimationFpsDebugEnabled() {\n    return false;\n  }\n\n  @Override\n  public boolean isJSDevModeEnabled() {\n    return true;\n  }\n\n  @Override\n  public boolean isJSMinifyEnabled() {\n    return false;\n  }\n\n  @Override\n  public boolean isElementInspectorEnabled() {\n    return false;\n  }\n\n  @Override\n  public boolean isNuclideJSDebugEnabled() {\n    return false;\n  }\n\n  @Override\n  public boolean isRemoteJSDebugEnabled() {\n    return false;\n  }\n\n  @Override\n  public void setRemoteJSDebugEnabled(boolean remoteJSDebugEnabled) {\n\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactTestAppShell.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport com.facebook.buck.android.support.exopackage.ApplicationLike;\nimport com.facebook.buck.android.support.exopackage.ExopackageApplication;\nimport com.facebook.react.common.build.ReactBuildConfig;\nimport com.facebook.soloader.SoLoader;\n\n/**\n * Application class for the Catalyst Launcher to allow it to work as an exopackage.\n *\n * Any app-specific code that should run before secondary dex files are loaded\n * (like setting up crash reporting) should go in onBaseContextAttached.\n * Anything that should run after secondary dex should go in CatalystApplicationImpl.onCreate.\n */\npublic class ReactTestAppShell extends ExopackageApplication<ApplicationLike> {\n\n  public ReactTestAppShell() {\n    super(\"com.facebook.react.testing.ReactTestApplicationImpl\", ReactBuildConfig.EXOPACKAGE_FLAGS);\n  }\n\n  @Override\n  protected void onBaseContextAttached() {\n    // This is a terrible hack.  Don't copy it.\n    // It's unfortunate that Instagram does the same thing.\n    // We need to do this here because internal apps use SoLoader,\n    // and Open Source Buck uses ExopackageSoLoader.\n    // If you feel the need to copy this, we should refactor it\n    // into an FB-specific subclass of ExopackageApplication.\n    SoLoader.init(this, (ReactBuildConfig.EXOPACKAGE_FLAGS & 2) != 0);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactTestApplicationImpl.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport android.app.Application;\n\nimport com.facebook.buck.android.support.exopackage.DefaultApplicationLike;\n\npublic class ReactTestApplicationImpl extends DefaultApplicationLike {\n\n  public ReactTestApplicationImpl() {\n    super();\n  }\n\n  public ReactTestApplicationImpl(Application application) {\n    super(application);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactTestFactory.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport android.content.Context;\n\nimport com.facebook.react.ReactInstanceManagerBuilder;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.NativeModule;\n\npublic interface ReactTestFactory {\n  public static interface ReactInstanceEasyBuilder {\n    ReactInstanceEasyBuilder setContext(Context context);\n    ReactInstanceEasyBuilder addNativeModule(NativeModule module);\n    CatalystInstance build();\n  }\n\n  ReactInstanceEasyBuilder getCatalystInstanceBuilder();\n  ReactInstanceManagerBuilder getReactInstanceManagerBuilder();\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactTestHelper.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport javax.annotation.Nullable;\n\nimport android.app.Instrumentation;\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.NativeModuleRegistryBuilder;\nimport com.facebook.react.R;\nimport com.facebook.react.ReactInstanceManager;\nimport com.facebook.react.ReactInstanceManagerBuilder;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.JavaScriptModuleRegistry;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.NativeModuleCallExceptionHandler;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;\nimport com.facebook.react.bridge.CatalystInstanceImpl;\nimport com.facebook.react.bridge.JSBundleLoader;\nimport com.facebook.react.bridge.JSCJavaScriptExecutorFactory;\nimport com.facebook.react.bridge.JavaScriptExecutor;\nimport com.facebook.react.modules.core.ReactChoreographer;\n\nimport com.android.internal.util.Predicate;\n\npublic class ReactTestHelper {\n  private static class DefaultReactTestFactory implements ReactTestFactory {\n    private static class ReactInstanceEasyBuilderImpl implements ReactInstanceEasyBuilder {\n\n      private NativeModuleRegistryBuilder mNativeModuleRegistryBuilder;\n\n      private @Nullable Context mContext;\n\n      @Override\n      public ReactInstanceEasyBuilder setContext(Context context) {\n        mContext = context;\n        return this;\n      }\n\n      @Override\n      public ReactInstanceEasyBuilder addNativeModule(NativeModule nativeModule) {\n        if (mNativeModuleRegistryBuilder == null) {\n          mNativeModuleRegistryBuilder = new NativeModuleRegistryBuilder(\n            (ReactApplicationContext) mContext,\n            null,\n            false);\n        }\n        Assertions.assertNotNull(nativeModule);\n        mNativeModuleRegistryBuilder.addNativeModule(nativeModule);\n        return this;\n      }\n\n      @Override\n      public CatalystInstance build() {\n        if (mNativeModuleRegistryBuilder == null) {\n          mNativeModuleRegistryBuilder = new NativeModuleRegistryBuilder(\n            (ReactApplicationContext) mContext,\n            null,\n            false);\n        }\n        JavaScriptExecutor executor = null;\n        try {\n          executor = new JSCJavaScriptExecutorFactory(\"ReactTestHelperApp\", \"ReactTestHelperDevice\").create();\n        } catch (Exception e) {\n          throw new RuntimeException(e);\n        }\n        return new CatalystInstanceImpl.Builder()\n          .setReactQueueConfigurationSpec(ReactQueueConfigurationSpec.createDefault())\n          .setJSExecutor(executor)\n          .setRegistry(mNativeModuleRegistryBuilder.build())\n          .setJSBundleLoader(JSBundleLoader.createAssetLoader(\n              mContext,\n              \"assets://AndroidTestBundle.js\",\n              false/* Asynchronous */))\n          .setNativeModuleCallExceptionHandler(\n            new NativeModuleCallExceptionHandler() {\n                @Override\n                public void handleException(Exception e) {\n                  throw new RuntimeException(e);\n                }\n            })\n          .build();\n      }\n    }\n\n    @Override\n    public ReactInstanceEasyBuilder getCatalystInstanceBuilder() {\n      return new ReactInstanceEasyBuilderImpl();\n    }\n\n    @Override\n    public ReactInstanceManagerBuilder getReactInstanceManagerBuilder() {\n      return ReactInstanceManager.builder();\n    }\n  }\n\n  public static ReactTestFactory getReactTestFactory() {\n    Instrumentation inst = InstrumentationRegistry.getInstrumentation();\n    if (!(inst instanceof ReactTestFactory)) {\n      return new DefaultReactTestFactory();\n    }\n\n    return (ReactTestFactory) inst;\n  }\n\n  public static ReactTestFactory.ReactInstanceEasyBuilder catalystInstanceBuilder(\n      final ReactIntegrationTestCase testCase) {\n    final ReactTestFactory.ReactInstanceEasyBuilder builder =\n      getReactTestFactory().getCatalystInstanceBuilder();\n    ReactTestFactory.ReactInstanceEasyBuilder postBuilder =\n      new ReactTestFactory.ReactInstanceEasyBuilder() {\n        @Override\n        public ReactTestFactory.ReactInstanceEasyBuilder setContext(Context context) {\n          builder.setContext(context);\n          return this;\n        }\n\n        @Override\n        public ReactTestFactory.ReactInstanceEasyBuilder addNativeModule(NativeModule module) {\n          builder.addNativeModule(module);\n          return this;\n        }\n\n        @Override\n        public CatalystInstance build() {\n          final CatalystInstance instance = builder.build();\n          testCase.initializeWithInstance(instance);\n          instance.runJSBundle();\n          InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {\n            @Override\n            public void run() {\n              ReactChoreographer.initialize();\n              instance.initialize();\n            }\n          });\n          testCase.waitForBridgeAndUIIdle();\n          return instance;\n        }\n      };\n\n    postBuilder.setContext(testCase.getContext());\n    return postBuilder;\n  }\n\n  /**\n   * Gets the view at given path in the UI hierarchy, ignoring modals.\n   */\n  public static <T extends View> T getViewAtPath(ViewGroup rootView, int... path) {\n    // The application root element is wrapped in a helper view in order\n    // to be able to display modals. See renderApplication.js.\n    ViewGroup appWrapperView = rootView;\n    View view = appWrapperView.getChildAt(0);\n    for (int i = 0; i < path.length; i++) {\n      view = ((ViewGroup) view).getChildAt(path[i]);\n    }\n    return (T) view;\n  }\n\n  /**\n   * Gets the view with a given react test ID in the UI hierarchy. React test ID is currently\n   * propagated into view content description.\n   */\n  public static View getViewWithReactTestId(View rootView, String testId) {\n    return findChild(rootView, hasTagValue(testId));\n  }\n\n  public static String getTestId(View view) {\n    return view.getTag(R.id.react_test_id) instanceof String\n      ? (String) view.getTag(R.id.react_test_id)\n      : null;\n  }\n\n  private static View findChild(View root, Predicate<View> predicate) {\n    if (predicate.apply(root)) {\n      return root;\n    }\n    if (root instanceof ViewGroup) {\n      ViewGroup viewGroup = (ViewGroup) root;\n      for (int i = 0; i < viewGroup.getChildCount(); i++) {\n        View child = viewGroup.getChildAt(i);\n        View result = findChild(child, predicate);\n        if (result != null) {\n          return result;\n        }\n      }\n    }\n    return null;\n  }\n\n  private static Predicate<View> hasTagValue(final String tagValue) {\n    return new Predicate<View>() {\n      @Override\n      public boolean apply(View view) {\n        Object tag = getTestId(view);\n        return tag != null && tag.equals(tagValue);\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/ScreenshotingFrameLayout.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing;\n\nimport javax.annotation.Nullable;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.os.Looper;\nimport android.widget.FrameLayout;\n\n/**\n * A FrameLayout that allows you to access the result of the last time its hierarchy was drawn. It\n * accomplishes this by drawing its hierarchy into a software Canvas, saving the resulting Bitmap\n * and then drawing that Bitmap to the actual Canvas provided by the system.\n */\npublic class ScreenshotingFrameLayout extends FrameLayout {\n\n  private @Nullable Bitmap mBitmap;\n  private Canvas mCanvas;\n\n  public ScreenshotingFrameLayout(Context context) {\n    super(context);\n    mCanvas = new Canvas();\n  }\n\n  @Override\n  protected void dispatchDraw(Canvas canvas) {\n    if (mBitmap == null) {\n      mBitmap = createNewBitmap(canvas);\n      mCanvas.setBitmap(mBitmap);\n    } else if (mBitmap.getWidth() != canvas.getWidth() ||\n        mBitmap.getHeight() != canvas.getHeight()) {\n      mBitmap.recycle();\n      mBitmap = createNewBitmap(canvas);\n      mCanvas.setBitmap(mBitmap);\n    }\n\n    super.dispatchDraw(mCanvas);\n    canvas.drawBitmap(mBitmap, 0, 0, null);\n  }\n\n  public void clean() {\n    if (mBitmap != null) {\n      mBitmap.recycle();\n      mBitmap = null;\n    }\n    mCanvas.setBitmap(null);\n  }\n\n  private static Bitmap createNewBitmap(Canvas canvas) {\n    return Bitmap.createBitmap(canvas.getWidth(), canvas.getHeight(), Bitmap.Config.ARGB_8888);\n  }\n\n  public Bitmap getLastDrawnBitmap() {\n    if (mBitmap == null) {\n      throw new RuntimeException(\"View has not been drawn yet!\");\n    }\n    if (Looper.getMainLooper() != Looper.myLooper()) {\n      throw new RuntimeException(\n          \"Must access screenshots from main thread or you may get partially drawn Bitmaps\");\n    }\n    if (!isScreenshotReady()) {\n      throw new RuntimeException(\"Trying to get screenshot, but the view is dirty or needs layout\");\n    }\n    return Bitmap.createBitmap(mBitmap);\n  }\n\n  public boolean isScreenshotReady() {\n    return !isDirty() && !isLayoutRequested();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/idledetection/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"idledetection\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/testing-support-lib:runner\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/idledetection/IdleWaiter.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing.idledetection;\n\n/**\n * Interface for something that knows how to wait for bridge and UI idle.\n */\npublic interface IdleWaiter {\n\n  void waitForBridgeAndUIIdle();\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/idledetection/ReactBridgeIdleSignaler.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing.idledetection;\n\nimport java.util.concurrent.Semaphore;\nimport java.util.concurrent.TimeUnit;\n\nimport com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener;\n\n/**\n * Utility class that uses {@link NotThreadSafeBridgeIdleDebugListener} interface to allow callers\n * to wait for the bridge to be idle.\n */\npublic class ReactBridgeIdleSignaler implements NotThreadSafeBridgeIdleDebugListener {\n\n  // Starts at 1 since bridge starts idle. The logic here is that the semaphore is only acquirable\n  // if the bridge is idle.\n  private final Semaphore mBridgeIdleSemaphore = new Semaphore(1);\n\n  private volatile boolean mIsBridgeIdle = true;\n\n  @Override\n  public void onTransitionToBridgeIdle() {\n    mIsBridgeIdle = true;\n    mBridgeIdleSemaphore.release();\n  }\n\n  @Override\n  public void onTransitionToBridgeBusy() {\n    mIsBridgeIdle = false;\n    try {\n      if (!mBridgeIdleSemaphore.tryAcquire(15000, TimeUnit.MILLISECONDS)) {\n        throw new RuntimeException(\n            \"Timed out waiting to acquire the test idle listener semaphore. Deadlock?\");\n      }\n    } catch (InterruptedException e) {\n      throw new RuntimeException(\"Got interrupted\", e);\n    }\n  }\n\n  public boolean isBridgeIdle() {\n    return mIsBridgeIdle;\n  }\n\n  public boolean waitForIdle(long millis) {\n    try {\n      if (mBridgeIdleSemaphore.tryAcquire(millis, TimeUnit.MILLISECONDS)) {\n        mBridgeIdleSemaphore.release();\n        return true;\n      }\n      return false;\n    } catch (InterruptedException e) {\n      throw new RuntimeException(\"Got interrupted\", e);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/idledetection/ReactIdleDetectionUtil.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing.idledetection;\n\nimport java.util.concurrent.CountDownLatch;\nimport java.util.concurrent.TimeUnit;\n\nimport android.app.Instrumentation;\nimport android.os.SystemClock;\nimport android.support.test.InstrumentationRegistry;\n\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.modules.core.ChoreographerCompat;\n\npublic class ReactIdleDetectionUtil {\n\n  /**\n   * Waits for both the UI thread and bridge to be idle. It determines this by waiting for the\n   * bridge to become idle, then waiting for the UI thread to become idle, then checking if the\n   * bridge is idle again (if the bridge was idle before and is still idle after running the UI\n   * thread to idle, then there are no more events to process in either place).\n   * <p/>\n   * Also waits for any Choreographer callbacks to run after the initial sync since things like UI\n   * events are initiated from Choreographer callbacks.\n   */\n  public static void waitForBridgeAndUIIdle(\n      ReactBridgeIdleSignaler idleSignaler,\n      final ReactContext reactContext,\n      long timeoutMs) {\n    UiThreadUtil.assertNotOnUiThread();\n\n    long startTime = SystemClock.uptimeMillis();\n    waitInner(idleSignaler, timeoutMs);\n\n    long timeToWait = Math.max(1, timeoutMs - (SystemClock.uptimeMillis() - startTime));\n    waitForChoreographer(timeToWait);\n    waitForJSIdle(reactContext);\n\n    timeToWait = Math.max(1, timeoutMs - (SystemClock.uptimeMillis() - startTime));\n    waitInner(idleSignaler, timeToWait);\n    timeToWait = Math.max(1, timeoutMs - (SystemClock.uptimeMillis() - startTime));\n    waitForChoreographer(timeToWait);\n  }\n\n  private static void waitForChoreographer(long timeToWait) {\n    final int waitFrameCount = 2;\n    final CountDownLatch latch = new CountDownLatch(1);\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            ChoreographerCompat.getInstance().postFrameCallback(\n                new ChoreographerCompat.FrameCallback() {\n\n                  private int frameCount = 0;\n\n                  @Override\n                  public void doFrame(long frameTimeNanos) {\n                    frameCount++;\n                    if (frameCount == waitFrameCount) {\n                      latch.countDown();\n                    } else {\n                      ChoreographerCompat.getInstance().postFrameCallback(this);\n                    }\n                  }\n                });\n          }\n        });\n    try {\n      if (!latch.await(timeToWait, TimeUnit.MILLISECONDS)) {\n        throw new RuntimeException(\"Timed out waiting for Choreographer\");\n      }\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  private static void waitForJSIdle(ReactContext reactContext) {\n    if (!reactContext.hasActiveCatalystInstance()) {\n      return;\n    }\n    final CountDownLatch latch = new CountDownLatch(1);\n\n    reactContext.runOnJSQueueThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            latch.countDown();\n          }\n        });\n\n    try {\n      if (!latch.await(5000, TimeUnit.MILLISECONDS)) {\n        throw new RuntimeException(\"Timed out waiting for JS thread\");\n      }\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  private static void waitInner(ReactBridgeIdleSignaler idleSignaler, long timeToWait) {\n    // TODO gets broken in gradle, do we need it?\n    Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();\n    long startTime = SystemClock.uptimeMillis();\n    boolean bridgeWasIdle = false;\n    while (SystemClock.uptimeMillis() - startTime < timeToWait) {\n      boolean bridgeIsIdle = idleSignaler.isBridgeIdle();\n      if (bridgeIsIdle && bridgeWasIdle) {\n        return;\n      }\n      bridgeWasIdle = bridgeIsIdle;\n      long newTimeToWait = Math.max(1, timeToWait - (SystemClock.uptimeMillis() - startTime));\n      idleSignaler.waitForIdle(newTimeToWait);\n      instrumentation.waitForIdleSync();\n    }\n    throw new RuntimeException(\"Timed out waiting for bridge and UI idle!\");\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/network/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"network\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/testing/network/NetworkRecordingModuleMock.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.testing.network;\n\nimport javax.annotation.Nullable;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.core.DeviceEventManagerModule;\n\n/**\n * Mock Networking module that records last request received by {@link #sendRequest} method and\n * returns response code and body that should be set with {@link #setResponse}\n */\n@ReactModule(name = \"Networking\", canOverrideExistingModule = true)\npublic class NetworkRecordingModuleMock extends ReactContextBaseJavaModule {\n\n  public int mRequestCount = 0;\n  public @Nullable String mRequestMethod;\n  public @Nullable String mRequestURL;\n  public @Nullable ReadableArray mRequestHeaders;\n  public @Nullable ReadableMap mRequestData;\n  public int mLastRequestId;\n  public boolean mAbortedRequest;\n\n  private boolean mCompleteRequest;\n\n  public NetworkRecordingModuleMock(ReactApplicationContext reactContext) {\n    this(reactContext, true);\n  }\n\n  public NetworkRecordingModuleMock(ReactApplicationContext reactContext, boolean completeRequest) {\n    super(reactContext);\n    mCompleteRequest = completeRequest;\n  }\n\n  public static interface RequestListener {\n    public void onRequest(String method, String url, ReadableArray header, ReadableMap data);\n  }\n\n  private int mResponseCode;\n  private @Nullable String mResponseBody;\n  private @Nullable RequestListener mRequestListener;\n\n  public void setResponse(int code, String body) {\n    mResponseCode = code;\n    mResponseBody = body;\n  }\n\n  public void setRequestListener(RequestListener requestListener) {\n    mRequestListener = requestListener;\n  }\n\n  @Override\n  public final String getName() {\n    return \"Networking\";\n  }\n\n  private void fireReactCallback(\n      Callback callback,\n      int status,\n      @Nullable String headers,\n      @Nullable String body) {\n    callback.invoke(status, headers, body);\n  }\n\n  @ReactMethod\n  public final void sendRequest(\n      String method,\n      String url,\n      int requestId,\n      ReadableArray headers,\n      ReadableMap data,\n      final String responseType,\n      boolean incrementalUpdates,\n      int timeout,\n      boolean withCredentials) {\n    mLastRequestId = requestId;\n    mRequestCount++;\n    mRequestMethod = method;\n    mRequestURL = url;\n    mRequestHeaders = headers;\n    mRequestData = data;\n    if (mRequestListener != null) {\n      mRequestListener.onRequest(method, url, headers, data);\n    }\n    if (mCompleteRequest) {\n      onResponseReceived(requestId, mResponseCode, null);\n      onDataReceived(requestId, mResponseBody);\n      onRequestComplete(requestId, null);\n    }\n  }\n\n  @ReactMethod\n  public void abortRequest(int requestId) {\n    mLastRequestId = requestId;\n    mAbortedRequest = true;\n  }\n\n  @Override\n  public boolean canOverrideExistingModule() {\n    return true;\n  }\n\n  public void setCompleteRequest(boolean completeRequest) {\n    mCompleteRequest = completeRequest;\n  }\n\n  private void onDataReceived(int requestId, String data) {\n    WritableArray args = Arguments.createArray();\n    args.pushInt(requestId);\n    args.pushString(data);\n\n    getEventEmitter().emit(\"didReceiveNetworkData\", args);\n  }\n\n  private void onRequestComplete(int requestId, @Nullable String error) {\n    WritableArray args = Arguments.createArray();\n    args.pushInt(requestId);\n    args.pushString(error);\n\n    getEventEmitter().emit(\"didCompleteNetworkResponse\", args);\n  }\n\n  private void onResponseReceived(int requestId, int code, WritableMap headers) {\n    WritableArray args = Arguments.createArray();\n    args.pushInt(requestId);\n    args.pushInt(code);\n    args.pushMap(headers);\n\n    getEventEmitter().emit(\"didReceiveNetworkResponse\", args);\n  }\n\n  private DeviceEventManagerModule.RCTDeviceEventEmitter getEventEmitter() {\n    return getReactApplicationContext()\n        .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\ndeps = [\n    react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    react_native_dep(\"third-party/java/junit:junit\"),\n    react_native_integration_tests_target(\"java/com/facebook/react/testing:testing\"),\n    react_native_integration_tests_target(\"java/com/facebook/react/testing/idledetection:idledetection\"),\n    react_native_target(\"java/com/facebook/react:react\"),\n    react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n    react_native_target(\"java/com/facebook/react/common:common\"),\n    react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    react_native_target(\"java/com/facebook/react/modules/appstate:appstate\"),\n    react_native_target(\"java/com/facebook/react/modules/core:core\"),\n    react_native_target(\"java/com/facebook/react/modules/datepicker:datepicker\"),\n    react_native_target(\"java/com/facebook/react/modules/deviceinfo:deviceinfo\"),\n    react_native_target(\"java/com/facebook/react/modules/share:share\"),\n    react_native_target(\"java/com/facebook/react/modules/systeminfo:systeminfo\"),\n    react_native_target(\"java/com/facebook/react/modules/timepicker:timepicker\"),\n    react_native_target(\"java/com/facebook/react/touch:touch\"),\n    react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n    react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n    react_native_target(\"java/com/facebook/react/uimanager/util:util\"),\n    react_native_target(\"java/com/facebook/react/views/picker:picker\"),\n    react_native_target(\"java/com/facebook/react/views/progressbar:progressbar\"),\n    react_native_target(\"java/com/facebook/react/views/scroll:scroll\"),\n    react_native_target(\"java/com/facebook/react/views/slider:slider\"),\n    react_native_target(\"java/com/facebook/react/views/swiperefresh:swiperefresh\"),\n    react_native_target(\"java/com/facebook/react/views/text:text\"),\n    react_native_target(\"java/com/facebook/react/views/textinput:textinput\"),\n    react_native_target(\"java/com/facebook/react/views/view:view\"),\n]\n\nandroid_library(\n    name = \"tests\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = deps,\n)\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/CatalystMeasureLayoutTest.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.testing.AssertModule;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\n\n/**\n * Tests for {@link UIManagerModule#measure}, {@link UIManagerModule#measureLayout}, and\n * {@link UIManagerModule#measureLayoutRelativeToParent}. Tests measurement for views in the\n * following hierarchy:\n *\n * +---------------------------------------------+\n * | A                                           |\n * |                                             |\n * |      +-----------+        +---------+       |\n * |      | B         |        | D       |       |\n * |      |    +---+  |        |         |       |\n * |      |    | C |  |        |         |       |\n * |      |    |   |  |        +---------+       |\n * |      |    +---+  |                          |\n * |      +-----------+                          |\n * |                                             |\n * |                                             |\n * |                                             |\n * +---------------------------------------------+\n *\n * View locations and dimensions:\n * A - (0,0) to (500, 500) (500x500)\n * B - (50,80) to (250, 380) (200x300)\n * C - (150,150) to (200, 300) (50x150)\n * D - (400,100) to (450, 300) (50x200)\n */\npublic class CatalystMeasureLayoutTest extends ReactAppInstrumentationTestCase {\n\n  private static interface MeasureLayoutTestModule extends JavaScriptModule {\n    public void verifyMeasureOnViewA();\n    public void verifyMeasureOnViewC();\n    public void verifyMeasureLayoutCRelativeToA();\n    public void verifyMeasureLayoutCRelativeToB();\n    public void verifyMeasureLayoutCRelativeToSelf();\n    public void verifyMeasureLayoutRelativeToParentOnViewA();\n    public void verifyMeasureLayoutRelativeToParentOnViewB();\n    public void verifyMeasureLayoutRelativeToParentOnViewC();\n    public void verifyMeasureLayoutDRelativeToB();\n    public void verifyMeasureLayoutNonExistentTag();\n    public void verifyMeasureLayoutNonExistentAncestor();\n    public void verifyMeasureLayoutRelativeToParentNonExistentTag();\n  }\n\n  private MeasureLayoutTestModule mTestJSModule;\n  private AssertModule mAssertModule;\n\n  @Override\n  protected void setUp() throws Exception {\n    super.setUp();\n    mTestJSModule = getReactContext().getJSModule(MeasureLayoutTestModule.class);\n  }\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"MeasureLayoutTestApp\";\n  }\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    mAssertModule = new AssertModule();\n    return super.createReactInstanceSpecForTest()\n        .addNativeModule(mAssertModule);\n  }\n\n  private void waitForBridgeIdleAndVerifyAsserts() {\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testMeasure() {\n    mTestJSModule.verifyMeasureOnViewA();\n    waitForBridgeIdleAndVerifyAsserts();\n    mTestJSModule.verifyMeasureOnViewC();\n    waitForBridgeIdleAndVerifyAsserts();\n  }\n\n  public void testMeasureLayout() {\n    mTestJSModule.verifyMeasureLayoutCRelativeToA();\n    waitForBridgeIdleAndVerifyAsserts();\n    mTestJSModule.verifyMeasureLayoutCRelativeToB();\n    waitForBridgeIdleAndVerifyAsserts();\n    mTestJSModule.verifyMeasureLayoutCRelativeToSelf();\n    waitForBridgeIdleAndVerifyAsserts();\n  }\n\n  public void testMeasureLayoutRelativeToParent() {\n    mTestJSModule.verifyMeasureLayoutRelativeToParentOnViewA();\n    waitForBridgeIdleAndVerifyAsserts();\n    mTestJSModule.verifyMeasureLayoutRelativeToParentOnViewB();\n    waitForBridgeIdleAndVerifyAsserts();\n    mTestJSModule.verifyMeasureLayoutRelativeToParentOnViewC();\n    waitForBridgeIdleAndVerifyAsserts();\n  }\n\n  public void testMeasureLayoutCallsErrorCallbackWhenViewIsNotChildOfAncestor() {\n    mTestJSModule.verifyMeasureLayoutDRelativeToB();\n    waitForBridgeIdleAndVerifyAsserts();\n  }\n\n  public void testMeasureLayoutCallsErrorCallbackWhenViewDoesNotExist() {\n    mTestJSModule.verifyMeasureLayoutNonExistentTag();\n    waitForBridgeIdleAndVerifyAsserts();\n  }\n\n  public void testMeasureLayoutCallsErrorCallbackWhenAncestorDoesNotExist() {\n    mTestJSModule.verifyMeasureLayoutNonExistentAncestor();\n    waitForBridgeIdleAndVerifyAsserts();\n  }\n\n  public void testMeasureLayoutRelativeToParentCallsErrorCallbackWhenViewDoesNotExist() {\n    mTestJSModule.verifyMeasureLayoutRelativeToParentNonExistentTag();\n    waitForBridgeIdleAndVerifyAsserts();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/CatalystMultitouchHandlingTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport java.util.List;\n\nimport android.view.MotionEvent;\n\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\nimport com.facebook.react.testing.StringRecordingModule;\n\n/**\n * Test case for verifying that multitouch events are directed to the React's view touch handlers\n * properly\n */\npublic class CatalystMultitouchHandlingTestCase extends ReactAppInstrumentationTestCase {\n\n  private final StringRecordingModule mRecordingModule = new StringRecordingModule();\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"MultitouchHandlingTestAppModule\";\n  }\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    return new ReactInstanceSpecForTest()\n        .addNativeModule(mRecordingModule);\n  }\n\n  /**\n   * In this test case we send pre-recorded stream of pinch out gesture and verify that we have\n   * recorded important touch events in JS module\n   */\n  public void testMultitouchEvents() throws InterruptedException {\n    generateRecordedPinchTouchEvents();\n    waitForBridgeAndUIIdle();\n\n    // Expect to receive at least 5 events (DOWN for each pointer, UP for each pointer and at least\n    // one MOVE event with both pointers down)\n    List<String> calls = mRecordingModule.getCalls();\n\n    int moveWithBothPointersEventIndex = -1;\n    int startEventIndex = -1;\n    int startExtraPointerEventIndex = -1;\n    int endEventIndex = -1;\n    int endExtraPointerEventIndex = -1;\n\n    for (int i = 0; i < calls.size(); i++) {\n      String call = calls.get(i);\n      if (call.equals(\"start;ExtraPointer\")) {\n        assertEquals(-1, startExtraPointerEventIndex);\n        startExtraPointerEventIndex = i;\n      } else if (call.equals(\"end;ExtraPointer\")) {\n        assertEquals(-1, endExtraPointerEventIndex);\n        endExtraPointerEventIndex = i;\n      } else if (call.equals(\"start;1\")) {\n        assertEquals(-1, startEventIndex);\n        startEventIndex = i;\n      } else if (call.equals(\"end;0\")) {\n        assertEquals(-1, endEventIndex);\n        endEventIndex = i;\n      } else if (call.equals(\"move;2\")) {\n        // this will happen more than once, let's just capture the last occurrence\n        moveWithBothPointersEventIndex = i;\n      }\n    }\n\n    assertEquals(0, startEventIndex);\n    assertTrue(-1 != startExtraPointerEventIndex);\n    assertTrue(-1 != moveWithBothPointersEventIndex);\n    assertTrue(-1 != endExtraPointerEventIndex);\n    assertTrue(startExtraPointerEventIndex < moveWithBothPointersEventIndex);\n    assertTrue(endExtraPointerEventIndex > moveWithBothPointersEventIndex);\n    assertEquals(calls.size() - 1, endEventIndex);\n  }\n\n  private MotionEvent.PointerProperties createPointerProps(int id, int toolType) {\n    MotionEvent.PointerProperties pointerProps = new MotionEvent.PointerProperties();\n    pointerProps.id = id;\n    pointerProps.toolType = toolType;\n    return pointerProps;\n  }\n\n  private MotionEvent.PointerCoords createPointerCoords(float x, float y) {\n    MotionEvent.PointerCoords pointerCoords = new MotionEvent.PointerCoords();\n    pointerCoords.x = x;\n    pointerCoords.y = y;\n    return pointerCoords;\n  }\n\n  private void dispatchEvent(\n      final int action,\n      final long start,\n      final long when,\n      final int pointerCount,\n      final MotionEvent.PointerProperties[] pointerProps,\n      final MotionEvent.PointerCoords[] pointerCoords) {\n    getRootView().post(\n        new Runnable() {\n          @Override\n          public void run() {\n            MotionEvent event =\n                MotionEvent.obtain(start, when, action, pointerCount, pointerProps, pointerCoords, 0, 0, 1.0f, 1.0f, 0, 0, 0, 0);\n            getRootView().dispatchTouchEvent(event);\n            event.recycle();\n          }\n        });\n    getInstrumentation().waitForIdleSync();\n  }\n\n  /**\n   * This method \"replay\" multi-touch gesture recorded with modified TouchesHelper class that\n   * generated this piece of code (see https://phabricator.fb.com/P19756940).\n   * This is not intended to be copied/reused and once we need to have more multitouch gestures\n   * in instrumentation tests we should either:\n   *  - implement nice generator similar to {@link SingleTouchGestureGenerator}\n   *  - implement gesture recorded that will record touch data using arbitrary format and then read\n   *  this recorded touch sequence during tests instead of generating code like this\n   */\n  private void generateRecordedPinchTouchEvents() {\n    // START OF GENERATED CODE\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[1];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[1];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(268.0f, 347.0f);\n      dispatchEvent(MotionEvent.ACTION_DOWN, 446560605, 446560605, 1, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[1];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[1];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(267.0f, 346.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560630, 1, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(267.0f, 346.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(225.0f, 542.0f);\n      dispatchEvent(MotionEvent.ACTION_POINTER_DOWN | (1 << MotionEvent.ACTION_POINTER_INDEX_SHIFT), 446560605, 446560630, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(266.0f, 345.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(225.0f, 542.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560647, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(265.0f, 344.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(224.0f, 541.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560664, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(264.0f, 342.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(223.0f, 540.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560681, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(263.0f, 340.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(222.0f, 539.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560698, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(262.0f, 337.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(221.0f, 538.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560714, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(262.0f, 333.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(220.0f, 537.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560731, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(261.0f, 328.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(219.0f, 536.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560748, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(260.0f, 321.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(218.0f, 536.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560765, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(260.0f, 313.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(216.0f, 536.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560781, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(260.0f, 304.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(214.0f, 537.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560798, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(260.0f, 295.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(211.0f, 539.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560815, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(261.0f, 285.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(208.0f, 542.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560832, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(264.0f, 274.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(203.0f, 547.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560849, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(266.0f, 264.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(199.0f, 551.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560865, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(269.0f, 254.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(194.0f, 556.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560882, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(273.0f, 245.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(190.0f, 561.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560899, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(276.0f, 236.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(186.0f, 567.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560916, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(280.0f, 227.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(183.0f, 573.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560933, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(283.0f, 219.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(181.0f, 579.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560949, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(287.0f, 211.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(179.0f, 584.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560966, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(291.0f, 202.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(177.0f, 589.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446560983, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(296.0f, 193.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(175.0f, 593.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561000, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(301.0f, 184.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(174.0f, 598.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561016, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(307.0f, 176.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(173.0f, 603.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561033, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(313.0f, 168.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(172.0f, 608.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561050, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(317.0f, 160.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(171.0f, 613.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561067, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(320.0f, 154.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(170.0f, 619.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561084, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(323.0f, 149.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(169.0f, 624.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561100, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(325.0f, 145.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(168.0f, 628.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561117, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(328.0f, 141.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(167.0f, 632.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561134, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(331.0f, 137.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(166.0f, 636.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561151, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(334.0f, 134.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(165.0f, 639.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561167, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(337.0f, 131.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(164.0f, 643.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561184, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(338.0f, 128.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(164.0f, 646.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561201, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(340.0f, 126.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(164.0f, 649.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561218, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(341.0f, 124.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(163.0f, 652.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561234, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(342.0f, 122.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(163.0f, 655.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561251, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(343.0f, 120.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(162.0f, 659.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561268, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(344.0f, 118.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(161.0f, 664.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561285, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(345.0f, 116.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(160.0f, 667.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561302, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(346.0f, 115.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(158.0f, 670.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561318, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(347.0f, 114.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(157.0f, 673.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561335, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(348.0f, 113.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(156.0f, 676.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561352, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(348.0f, 112.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(155.0f, 677.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561369, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(349.0f, 111.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(154.0f, 678.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561386, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(349.0f, 110.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(153.0f, 679.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561402, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(349.0f, 109.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(152.0f, 680.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561419, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(349.0f, 110.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(151.0f, 680.0f);\n      dispatchEvent(MotionEvent.ACTION_MOVE, 446560605, 446561435, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[2];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[2];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(349.0f, 110.0f);\n      pointerProps[1] = createPointerProps(1, 1);\n      pointerCoords[1] = createPointerCoords(151.0f, 680.0f);\n      dispatchEvent(MotionEvent.ACTION_POINTER_UP | (0 << MotionEvent.ACTION_POINTER_INDEX_SHIFT), 446560605, 446561443, 2, pointerProps, pointerCoords);\n    }\n\n    {\n      MotionEvent.PointerProperties[] pointerProps = new MotionEvent.PointerProperties[1];\n      MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[1];\n      pointerProps[0] = createPointerProps(0, 1);\n      pointerCoords[0] = createPointerCoords(151.0f, 680.0f);\n      dispatchEvent(MotionEvent.ACTION_UP, 446560605, 446561451, 1, pointerProps, pointerCoords);\n    }\n    // END OF GENERATED CODE\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/CatalystNativeJSToJavaParametersTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.Dynamic;\nimport com.facebook.react.bridge.InvalidIteratorException;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NoSuchKeyException;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.ReadableMapKeySetIterator;\nimport com.facebook.react.bridge.ReadableNativeMap;\nimport com.facebook.react.bridge.ReadableType;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.bridge.UnexpectedNativeTypeException;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.modules.appstate.AppStateModule;\nimport com.facebook.react.modules.deviceinfo.DeviceInfoModule;\nimport com.facebook.react.modules.systeminfo.AndroidInfoModule;\nimport com.facebook.react.testing.FakeWebSocketModule;\nimport com.facebook.react.testing.ReactIntegrationTestCase;\nimport com.facebook.react.testing.ReactTestHelper;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.views.view.ReactViewManager;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\nimport org.junit.Ignore;\n\n/**\n * Integration test to verify passing various types of parameters from JS to Java works\n *\n * TODO: we should run these tests with isBlockingSynchronousMethod = true as well,\n * since they currently use a completely different codepath\n */\n@Ignore(\"Fix prop types and view managers.\")\npublic class CatalystNativeJSToJavaParametersTestCase extends ReactIntegrationTestCase {\n\n  private interface TestJSToJavaParametersModule extends JavaScriptModule {\n    void returnBasicTypes();\n    void returnBoxedTypes();\n    void returnDynamicTypes();\n\n    void returnArrayWithBasicTypes();\n    void returnNestedArray();\n    void returnArrayWithMaps();\n\n    void returnMapWithBasicTypes();\n    void returnNestedMap();\n    void returnMapWithArrays();\n\n    void returnArrayWithStringDoubleIntMapArrayBooleanNull();\n    void returnMapWithStringDoubleIntMapArrayBooleanNull();\n\n    void returnMapForMerge1();\n    void returnMapForMerge2();\n\n    void returnMapWithMultibyteUTF8CharacterString();\n    void returnArrayWithMultibyteUTF8CharacterString();\n\n    void returnArrayWithLargeInts();\n    void returnMapWithLargeInts();\n  }\n\n  private RecordingTestModule mRecordingTestModule;\n  private CatalystInstance mCatalystInstance;\n\n  @Override\n  protected void setUp() throws Exception {\n    super.setUp();\n\n    List<ViewManager> viewManagers = Arrays.<ViewManager>asList(\n        new ReactViewManager());\n    final UIManagerModule mUIManager =\n        new UIManagerModule(getContext(), viewManagers, new UIImplementationProvider(), 0);\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            mUIManager.onHostResume();\n          }\n        });\n    waitForIdleSync();\n\n    mRecordingTestModule = new RecordingTestModule();\n    mCatalystInstance = ReactTestHelper.catalystInstanceBuilder(this)\n        .addNativeModule(mRecordingTestModule)\n        .addNativeModule(new AndroidInfoModule())\n        .addNativeModule(new DeviceInfoModule(getContext()))\n        .addNativeModule(new AppStateModule(getContext()))\n        .addNativeModule(new FakeWebSocketModule())\n        .addNativeModule(mUIManager)\n        .build();\n  }\n\n  public void testBasicTypes() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnBasicTypes();\n    waitForBridgeAndUIIdle();\n\n    List<Object[]> basicTypesCalls = mRecordingTestModule.getBasicTypesCalls();\n    assertEquals(1, basicTypesCalls.size());\n\n    Object[] args = basicTypesCalls.get(0);\n    assertEquals(\"foo\", args[0]);\n    assertEquals(3.14, args[1]);\n    assertEquals(true, args[2]);\n    assertNull(args[3]);\n  }\n\n  public void testBoxedTypes() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnBoxedTypes();\n    waitForBridgeAndUIIdle();\n\n    List<Object[]> boxedTypesCalls = mRecordingTestModule.getBoxedTypesCalls();\n    assertEquals(1, boxedTypesCalls.size());\n\n    Object[] args = boxedTypesCalls.get(0);\n    assertEquals(Integer.valueOf(42), args[0]);\n    assertEquals(Double.valueOf(3.14), args[1]);\n    assertEquals(Boolean.valueOf(true), args[2]);\n  }\n\n  public void testDynamicType() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnDynamicTypes();\n    waitForBridgeAndUIIdle();\n\n    List<Dynamic> dynamicCalls = mRecordingTestModule.getDynamicCalls();\n    assertEquals(2, dynamicCalls.size());\n\n    assertEquals(\"foo\", dynamicCalls.get(0).asString());\n    assertEquals(3.14, dynamicCalls.get(1).asDouble());\n  }\n\n  public void testArrayWithBasicTypes() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnArrayWithBasicTypes();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableArray> calls = mRecordingTestModule.getArrayCalls();\n    assertEquals(1, calls.size());\n    ReadableArray array = calls.get(0);\n    assertNotNull(array);\n    assertEquals(5, array.size());\n    assertFalse(array.isNull(0));\n    assertEquals(\"foo\", array.getString(0));\n    assertFalse(array.isNull(1));\n    assertEquals(3.14, array.getDouble(1));\n    assertFalse(array.isNull(2));\n    assertEquals(-111, array.getInt(2));\n    assertFalse(array.isNull(3));\n    assertTrue(array.getBoolean(3));\n    assertTrue(array.isNull(4));\n    assertEquals(null, array.getString(4));\n    assertEquals(null, array.getMap(4));\n    assertEquals(null, array.getArray(4));\n  }\n\n  public void testNestedArray() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnNestedArray();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableArray> calls = mRecordingTestModule.getArrayCalls();\n    assertEquals(1, calls.size());\n    ReadableArray array = calls.get(0);\n    assertNotNull(array);\n    assertEquals(2, array.size());\n    assertEquals(\"we\", array.getString(0));\n\n    assertFalse(array.isNull(1));\n    ReadableArray subArray = array.getArray(1);\n    assertEquals(2, subArray.size());\n    assertEquals(\"have\", subArray.getString(0));\n\n    subArray = subArray.getArray(1);\n    assertEquals(2, subArray.size());\n    assertEquals(\"to\", subArray.getString(0));\n\n    subArray = subArray.getArray(1);\n    assertEquals(2, subArray.size());\n    assertEquals(\"go\", subArray.getString(0));\n\n    subArray = subArray.getArray(1);\n    assertEquals(1, subArray.size());\n    assertEquals(\"deeper\", subArray.getString(0));\n  }\n\n  public void testArrayWithMaps() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnArrayWithMaps();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableArray> calls = mRecordingTestModule.getArrayCalls();\n    assertEquals(1, calls.size());\n    ReadableArray array = calls.get(0);\n    assertEquals(2, array.size());\n\n    assertFalse(array.isNull(0));\n    ReadableMap m1 = array.getMap(0);\n    ReadableMap m2 = array.getMap(1);\n\n    assertEquals(\"m1v1\", m1.getString(\"m1k1\"));\n    assertEquals(\"m1v2\", m1.getString(\"m1k2\"));\n    assertEquals(\"m2v1\", m2.getString(\"m2k1\"));\n  }\n\n  public void testMapWithBasicTypes() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapWithBasicTypes();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> calls = mRecordingTestModule.getMapCalls();\n    assertEquals(1, calls.size());\n    ReadableMap map = calls.get(0);\n    assertNotNull(map);\n\n    assertTrue(map.hasKey(\"stringKey\"));\n    assertFalse(map.isNull(\"stringKey\"));\n    assertEquals(\"stringValue\", map.getString(\"stringKey\"));\n\n    assertTrue(map.hasKey(\"doubleKey\"));\n    assertFalse(map.isNull(\"doubleKey\"));\n    assertTrue(Math.abs(3.14 - map.getDouble(\"doubleKey\")) < .0001);\n\n    assertTrue(map.hasKey(\"intKey\"));\n    assertFalse(map.isNull(\"intKey\"));\n    assertEquals(-11, map.getInt(\"intKey\"));\n\n    assertTrue(map.hasKey(\"booleanKey\"));\n    assertFalse(map.isNull(\"booleanKey\"));\n    assertTrue(map.getBoolean(\"booleanKey\"));\n\n    assertTrue(map.hasKey(\"nullKey\"));\n    assertTrue(map.isNull(\"nullKey\"));\n    assertNull(map.getString(\"nullKey\"));\n    assertNull(map.getMap(\"nullKey\"));\n    assertNull(map.getArray(\"nullKey\"));\n\n    assertFalse(map.hasKey(\"nonExistentKey\"));\n  }\n\n  public void testNestedMap() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnNestedMap();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> calls = mRecordingTestModule.getMapCalls();\n    assertEquals(1, calls.size());\n    ReadableMap map = calls.get(0);\n    assertNotNull(map);\n\n    assertTrue(map.hasKey(\"weHaveToGoDeeper\"));\n    assertFalse(map.isNull(\"weHaveToGoDeeper\"));\n    ReadableMap nestedMap = map.getMap(\"weHaveToGoDeeper\");\n    assertTrue(nestedMap.hasKey(\"inception\"));\n    assertTrue(nestedMap.getBoolean(\"inception\"));\n  }\n\n  public void testMapParameterWithArrays() throws InterruptedException {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapWithArrays();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> calls = mRecordingTestModule.getMapCalls();\n    assertEquals(1, calls.size());\n    ReadableMap map = calls.get(0);\n    assertNotNull(map);\n\n    ReadableArray arrayParameter;\n    assertTrue(map.hasKey(\"empty\"));\n    arrayParameter = map.getArray(\"empty\");\n    assertNotNull(arrayParameter);\n    assertEquals(0, arrayParameter.size());\n\n    assertTrue(map.hasKey(\"ints\"));\n    assertFalse(map.isNull(\"ints\"));\n    arrayParameter = map.getArray(\"ints\");\n    assertNotNull(arrayParameter);\n    assertEquals(2, arrayParameter.size());\n    assertEquals(43, arrayParameter.getInt(0));\n    assertEquals(44, arrayParameter.getInt(1));\n\n    assertTrue(map.hasKey(\"mixed\"));\n    arrayParameter = map.getArray(\"mixed\");\n    assertNotNull(arrayParameter);\n    assertEquals(3, arrayParameter.size());\n    assertEquals(77, arrayParameter.getInt(0));\n    assertEquals(\"string\", arrayParameter.getString(1));\n    ReadableArray nestedArray = arrayParameter.getArray(2);\n    assertEquals(2, nestedArray.size());\n  }\n\n  public void testMapParameterDump() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapWithBasicTypes();\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnNestedMap();\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapWithArrays();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> calls = mRecordingTestModule.getMapCalls();\n    assertEquals(3, calls.size());\n\n    // App should not crash while generating debug string representation of arguments\n    assertNotNull(calls.get(0).toString());\n    assertNotNull(calls.get(1).toString());\n    assertNotNull(calls.get(2).toString());\n  }\n\n  public void testGetTypeFromArray() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class)\n        .returnArrayWithStringDoubleIntMapArrayBooleanNull();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableArray> calls = mRecordingTestModule.getArrayCalls();\n    assertEquals(1, calls.size());\n    ReadableArray array = calls.get(0);\n\n    assertEquals(ReadableType.String, array.getType(0));\n    assertEquals(ReadableType.Number, array.getType(1));\n    assertEquals(ReadableType.Number, array.getType(2));\n    assertEquals(ReadableType.Map, array.getType(3));\n    assertEquals(ReadableType.Array, array.getType(4));\n    assertEquals(ReadableType.Boolean, array.getType(5));\n    assertEquals(ReadableType.Null, array.getType(6));\n  }\n\n  public void testGetTypeFromMap() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class)\n        .returnMapWithStringDoubleIntMapArrayBooleanNull();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> calls = mRecordingTestModule.getMapCalls();\n    assertEquals(1, calls.size());\n    ReadableMap map = calls.get(0);\n\n    assertEquals(ReadableType.String, map.getType(\"string\"));\n    assertEquals(ReadableType.Number, map.getType(\"double\"));\n    assertEquals(ReadableType.Number, map.getType(\"int\"));\n    assertEquals(ReadableType.Map, map.getType(\"map\"));\n    assertEquals(ReadableType.Array, map.getType(\"array\"));\n    assertEquals(ReadableType.Boolean, map.getType(\"boolean\"));\n    assertEquals(ReadableType.Null, map.getType(\"null\"));\n  }\n\n  public void testGetWrongTypeFromArray() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class)\n        .returnArrayWithStringDoubleIntMapArrayBooleanNull();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableArray> calls = mRecordingTestModule.getArrayCalls();\n    assertEquals(1, calls.size());\n    ReadableArray array = calls.get(0);\n\n    assertUnexpectedTypeExceptionThrown(array, 0, \"boolean\");\n    assertUnexpectedTypeExceptionThrown(array, 1, \"string\");\n    assertUnexpectedTypeExceptionThrown(array, 2, \"array\");\n    assertUnexpectedTypeExceptionThrown(array, 3, \"double\");\n    assertUnexpectedTypeExceptionThrown(array, 4, \"map\");\n    assertUnexpectedTypeExceptionThrown(array, 5, \"array\");\n  }\n\n  public void testGetWrongTypeFromMap() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class)\n        .returnMapWithStringDoubleIntMapArrayBooleanNull();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> calls = mRecordingTestModule.getMapCalls();\n    assertEquals(1, calls.size());\n    ReadableMap map = calls.get(0);\n\n    assertUnexpectedTypeExceptionThrown(map, \"string\", \"double\");\n    assertUnexpectedTypeExceptionThrown(map, \"double\", \"map\");\n    assertUnexpectedTypeExceptionThrown(map, \"int\", \"boolean\");\n    assertUnexpectedTypeExceptionThrown(map, \"map\", \"array\");\n    assertUnexpectedTypeExceptionThrown(map, \"array\", \"boolean\");\n    assertUnexpectedTypeExceptionThrown(map, \"boolean\", \"string\");\n  }\n\n  public void testArrayOutOfBoundsExceptionThrown() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnArrayWithBasicTypes();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableArray> calls = mRecordingTestModule.getArrayCalls();\n    assertEquals(1, calls.size());\n    ReadableArray array = calls.get(0);\n    assertNotNull(array);\n\n    assertArrayOutOfBoundsExceptionThrown(array, -1, \"boolean\");\n    assertArrayOutOfBoundsExceptionThrown(array, -1, \"string\");\n    assertArrayOutOfBoundsExceptionThrown(array, -1, \"double\");\n    assertArrayOutOfBoundsExceptionThrown(array, -1, \"int\");\n    assertArrayOutOfBoundsExceptionThrown(array, -1, \"map\");\n    assertArrayOutOfBoundsExceptionThrown(array, -1, \"array\");\n\n    assertArrayOutOfBoundsExceptionThrown(array, 10, \"boolean\");\n    assertArrayOutOfBoundsExceptionThrown(array, 10, \"string\");\n    assertArrayOutOfBoundsExceptionThrown(array, 10, \"double\");\n    assertArrayOutOfBoundsExceptionThrown(array, 10, \"int\");\n    assertArrayOutOfBoundsExceptionThrown(array, 10, \"map\");\n    assertArrayOutOfBoundsExceptionThrown(array, 10, \"array\");\n  }\n\n  public void testNoSuchKeyExceptionThrown() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapWithBasicTypes();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> calls = mRecordingTestModule.getMapCalls();\n    assertEquals(1, calls.size());\n    ReadableMap map = calls.get(0);\n    assertNotNull(map);\n\n    assertNoSuchKeyExceptionThrown(map, \"noSuchKey\", \"double\");\n    assertNoSuchKeyExceptionThrown(map, \"noSuchKey\", \"int\");\n    assertNoSuchKeyExceptionThrown(map, \"noSuchKey\", \"map\");\n    assertNoSuchKeyExceptionThrown(map, \"noSuchKey\", \"array\");\n    assertNoSuchKeyExceptionThrown(map, \"noSuchKey\", \"boolean\");\n    assertNoSuchKeyExceptionThrown(map, \"noSuchKey\", \"string\");\n  }\n\n  public void testIntOutOfRangeThrown() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnArrayWithLargeInts();\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapWithLargeInts();\n    waitForBridgeAndUIIdle();\n\n    assertEquals(1, mRecordingTestModule.getArrayCalls().size());\n    assertEquals(1, mRecordingTestModule.getMapCalls().size());\n\n    ReadableArray array = mRecordingTestModule.getArrayCalls().get(0);\n    assertNotNull(array);\n\n    ReadableMap map = mRecordingTestModule.getMapCalls().get(0);\n    assertNotNull(map);\n\n    assertEquals(ReadableType.Number, array.getType(0));\n    assertUnexpectedTypeExceptionThrown(array, 0, \"int\");\n    assertEquals(ReadableType.Number, array.getType(1));\n    assertUnexpectedTypeExceptionThrown(array, 1, \"int\");\n\n    assertEquals(ReadableType.Number, map.getType(\"first\"));\n    assertUnexpectedTypeExceptionThrown(map, \"first\", \"int\");\n    assertEquals(ReadableType.Number, map.getType(\"second\"));\n    assertUnexpectedTypeExceptionThrown(map, \"second\", \"int\");\n  }\n\n  public void testMapMerging() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapForMerge1();\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapForMerge2();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> maps = mRecordingTestModule.getMapCalls();\n    assertEquals(2, maps.size());\n\n    WritableMap dest = new WritableNativeMap();\n    dest.merge(maps.get(0));\n    dest.merge(maps.get(1));\n\n    assertTrue(dest.hasKey(\"a\"));\n    assertTrue(dest.hasKey(\"b\"));\n    assertTrue(dest.hasKey(\"c\"));\n    assertTrue(dest.hasKey(\"d\"));\n    assertTrue(dest.hasKey(\"e\"));\n    assertTrue(dest.hasKey(\"f\"));\n    assertTrue(dest.hasKey(\"newkey\"));\n\n    assertEquals(\"overwrite\", dest.getString(\"a\"));\n    assertEquals(41, dest.getInt(\"b\"));\n    assertEquals(\"string\", dest.getString(\"c\"));\n    assertEquals(77, dest.getInt(\"d\"));\n    assertTrue(dest.isNull(\"e\"));\n    assertEquals(3, dest.getArray(\"f\").size());\n    assertEquals(\"newvalue\", dest.getString(\"newkey\"));\n  }\n\n  public void testMapAccessibleAfterMerge() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapForMerge1();\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapForMerge2();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> maps = mRecordingTestModule.getMapCalls();\n    assertEquals(2, maps.size());\n\n    WritableMap dest = new WritableNativeMap();\n    dest.merge(maps.get(0));\n    dest.merge(maps.get(1));\n\n    ReadableMap source = maps.get(1);\n\n    assertTrue(source.hasKey(\"a\"));\n    assertTrue(source.hasKey(\"d\"));\n    assertTrue(source.hasKey(\"e\"));\n    assertTrue(source.hasKey(\"f\"));\n    assertTrue(source.hasKey(\"newkey\"));\n\n    assertFalse(source.hasKey(\"b\"));\n    assertFalse(source.hasKey(\"c\"));\n\n    assertEquals(\"overwrite\", source.getString(\"a\"));\n    assertEquals(77, source.getInt(\"d\"));\n    assertTrue(source.isNull(\"e\"));\n    assertEquals(3, source.getArray(\"f\").size());\n    assertEquals(\"newvalue\", source.getString(\"newkey\"));\n  }\n\n  public void testMapIterateOverMapWithBasicTypes() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapWithBasicTypes();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> calls = mRecordingTestModule.getMapCalls();\n    assertEquals(1, calls.size());\n    ReadableNativeMap map = (ReadableNativeMap) calls.get(0);\n    assertNotNull(map);\n\n    ReadableMapKeySetIterator mapIterator = map.keySetIterator();\n    Set<String> keys = new HashSet<String>();\n    while (mapIterator.hasNextKey()) {\n      keys.add(mapIterator.nextKey());\n    }\n\n    Set<String> expectedKeys = new HashSet<String>(\n        Arrays.asList(\"stringKey\", \"doubleKey\", \"intKey\", \"booleanKey\", \"nullKey\"));\n    assertEquals(keys, expectedKeys);\n  }\n\n  public void testMapIterateOverNestedMaps() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnNestedMap();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> calls = mRecordingTestModule.getMapCalls();\n    assertEquals(1, calls.size());\n    ReadableNativeMap map = (ReadableNativeMap) calls.get(0);\n    assertNotNull(map);\n\n    ReadableMapKeySetIterator firstLevelIterator = map.keySetIterator();\n    String firstLevelKey = firstLevelIterator.nextKey();\n    assertEquals(firstLevelKey, \"weHaveToGoDeeper\");\n\n    ReadableNativeMap secondMap = map.getMap(\"weHaveToGoDeeper\");\n    ReadableMapKeySetIterator secondLevelIterator = secondMap.keySetIterator();\n    String secondLevelKey = secondLevelIterator.nextKey();\n    assertEquals(secondLevelKey, \"inception\");\n    assertTrue(secondMap.getBoolean(secondLevelKey));\n  }\n\n  public void testInvalidIteratorExceptionThrown() {\n    mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnMapWithBasicTypes();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> calls = mRecordingTestModule.getMapCalls();\n    assertEquals(1, calls.size());\n    ReadableNativeMap map = (ReadableNativeMap) calls.get(0);\n    assertNotNull(map);\n\n    ReadableMapKeySetIterator mapIterator = map.keySetIterator();\n    while (mapIterator.hasNextKey()) {\n      mapIterator.nextKey();\n    }\n    assertInvalidIteratorExceptionThrown(mapIterator);\n  }\n\n  public void testStringWithMultibyteUTF8Characters() {\n    TestJSToJavaParametersModule jsModule =\n        mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class);\n    jsModule.returnMapWithMultibyteUTF8CharacterString();\n    jsModule.returnArrayWithMultibyteUTF8CharacterString();\n    waitForBridgeAndUIIdle();\n\n    List<ReadableMap> maps = mRecordingTestModule.getMapCalls();\n    assertEquals(1, maps.size());\n\n    ReadableMap map = maps.get(0);\n    assertEquals(\"a\", map.getString(\"one-byte\"));\n    assertEquals(\"\\u00A2\", map.getString(\"two-bytes\"));\n    assertEquals(\"\\u20AC\", map.getString(\"three-bytes\"));\n    assertEquals(\"\\uD83D\\uDE1C\", map.getString(\"four-bytes\"));\n    assertEquals(\n        \"\\u017C\\u00F3\\u0142\\u0107 g\\u0119\\u015Bl\\u0105 \\u6211 \\uD83D\\uDE0E ja\\u017A\\u0107\",\n        map.getString(\"mixed\"));\n\n    List<ReadableArray> arrays = mRecordingTestModule.getArrayCalls();\n    assertEquals(1, arrays.size());\n\n    ReadableArray array = arrays.get(0);\n    assertEquals(\"a\", array.getString(0));\n    assertEquals(\"\\u00A2\", array.getString(1));\n    assertEquals(\"\\u20AC\", array.getString(2));\n    assertEquals(\"\\uD83D\\uDE1C\", array.getString(3));\n    assertEquals(\n        \"\\u017C\\u00F3\\u0142\\u0107 g\\u0119\\u015Bl\\u0105 \\u6211 \\uD83D\\uDE0E ja\\u017A\\u0107\",\n        array.getString(4));\n  }\n\n  private void assertUnexpectedTypeExceptionThrown(\n      ReadableArray array,\n      int index,\n      String typeToAskFor) {\n    boolean gotException = false;\n    try {\n      arrayGetByType(array, index, typeToAskFor);\n    } catch (UnexpectedNativeTypeException expected) {\n      gotException = true;\n    }\n\n    assertTrue(gotException);\n  }\n\n  private void assertUnexpectedTypeExceptionThrown(\n      ReadableMap map,\n      String key,\n      String typeToAskFor) {\n    boolean gotException = false;\n    try {\n      mapGetByType(map, key, typeToAskFor);\n    } catch (UnexpectedNativeTypeException expected) {\n      gotException = true;\n    }\n\n    assertTrue(gotException);\n  }\n\n  private void assertArrayOutOfBoundsExceptionThrown(\n      ReadableArray array,\n      int index,\n      String typeToAskFor) {\n    boolean gotException = false;\n    try {\n      arrayGetByType(array, index, typeToAskFor);\n    } catch (ArrayIndexOutOfBoundsException expected) {\n      gotException = true;\n    }\n\n    assertTrue(gotException);\n  }\n\n  private void assertNoSuchKeyExceptionThrown(\n      ReadableMap map,\n      String key,\n      String typeToAskFor) {\n    boolean gotException = false;\n    try {\n      mapGetByType(map, key, typeToAskFor);\n    } catch (NoSuchKeyException expected) {\n      gotException = true;\n    }\n\n    assertTrue(gotException);\n  }\n\n  private static void assertInvalidIteratorExceptionThrown(\n      ReadableMapKeySetIterator iterator) {\n    boolean gotException = false;\n    try {\n      iterator.nextKey();\n    } catch (InvalidIteratorException expected) {\n      gotException = true;\n    }\n\n    assertTrue(gotException);\n  }\n\n  private void arrayGetByType(ReadableArray array, int index, String typeToAskFor) {\n    if (typeToAskFor.equals(\"double\")) {\n      array.getDouble(index);\n    } else if (typeToAskFor.equals(\"int\")) {\n      array.getInt(index);\n    } else if (typeToAskFor.equals(\"string\")) {\n      array.getString(index);\n    } else if (typeToAskFor.equals(\"array\")) {\n      array.getArray(index);\n    } else if (typeToAskFor.equals(\"map\")) {\n      array.getMap(index);\n    } else if (typeToAskFor.equals(\"boolean\")) {\n      array.getBoolean(index);\n    } else {\n      throw new RuntimeException(\"Unknown type: \" + typeToAskFor);\n    }\n  }\n\n  private void mapGetByType(ReadableMap map, String key, String typeToAskFor) {\n    if (typeToAskFor.equals(\"double\")) {\n      map.getDouble(key);\n    } else if (typeToAskFor.equals(\"int\")) {\n      map.getInt(key);\n    } else if (typeToAskFor.equals(\"string\")) {\n      map.getString(key);\n    } else if (typeToAskFor.equals(\"array\")) {\n      map.getArray(key);\n    } else if (typeToAskFor.equals(\"map\")) {\n      map.getMap(key);\n    } else if (typeToAskFor.equals(\"boolean\")) {\n      map.getBoolean(key);\n    } else {\n      throw new RuntimeException(\"Unknown type: \" + typeToAskFor);\n    }\n  }\n\n  private static class RecordingTestModule extends BaseJavaModule {\n\n    private final List<Object[]> mBasicTypesCalls = new ArrayList<Object[]>();\n    private final List<Object[]> mBoxedTypesCalls = new ArrayList<Object[]>();\n    private final List<ReadableArray> mArrayCalls = new ArrayList<ReadableArray>();\n    private final List<ReadableMap> mMapCalls = new ArrayList<ReadableMap>();\n    private final List<Dynamic> mDynamicCalls = new ArrayList<Dynamic>();\n\n    @Override\n    public String getName() {\n      return \"Recording\";\n    }\n\n    @ReactMethod\n    public void receiveBasicTypes(String s, double d, boolean b, String nullableString) {\n      mBasicTypesCalls.add(new Object[]{s, d, b, nullableString});\n    }\n\n    @ReactMethod\n    public void receiveBoxedTypes(Integer i, Double d, Boolean b) {\n      mBoxedTypesCalls.add(new Object[]{i, d, b});\n    }\n\n    @ReactMethod\n    public void receiveArray(ReadableArray array) {\n      mArrayCalls.add(array);\n    }\n\n    @ReactMethod\n    public void receiveMap(ReadableMap map) {\n      mMapCalls.add(map);\n    }\n\n    @ReactMethod\n    public void receiveDynamic(Dynamic dynamic) {\n      mDynamicCalls.add(dynamic);\n    }\n\n    public List<Object[]> getBasicTypesCalls() {\n      return mBasicTypesCalls;\n    }\n\n    public List<Object[]> getBoxedTypesCalls() {\n      return mBoxedTypesCalls;\n    }\n\n    public List<ReadableArray> getArrayCalls() {\n      return mArrayCalls;\n    }\n\n    public List<ReadableMap> getMapCalls() {\n      return mMapCalls;\n    }\n\n    public List<Dynamic> getDynamicCalls() {\n      return mDynamicCalls;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/CatalystNativeJavaToJSArgumentsTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.ObjectAlreadyConsumedException;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeArray;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.modules.appstate.AppStateModule;\nimport com.facebook.react.modules.deviceinfo.DeviceInfoModule;\nimport com.facebook.react.testing.AssertModule;\nimport com.facebook.react.testing.FakeWebSocketModule;\nimport com.facebook.react.testing.ReactIntegrationTestCase;\nimport com.facebook.react.testing.ReactTestHelper;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.views.view.ReactViewManager;\nimport java.util.Arrays;\nimport java.util.List;\nimport org.junit.Ignore;\n\n/**\n * Test marshalling arguments from Java to JS to appropriate native classes.\n */\n@Ignore(\"Fix prop types and view managers.\")\npublic class CatalystNativeJavaToJSArgumentsTestCase extends ReactIntegrationTestCase {\n\n  private interface TestJavaToJSArgumentsModule extends JavaScriptModule {\n    void receiveBasicTypes(String s, double d, boolean b, String nullString);\n\n    void receiveArrayWithBasicTypes(WritableArray array);\n    void receiveNestedArray(WritableArray nestedArray);\n    void receiveArrayWithMaps(WritableArray arrayWithMaps);\n\n    void receiveMapWithBasicTypes(WritableMap map);\n    void receiveNestedMap(WritableMap nestedMap);\n    void receiveMapWithArrays(WritableMap mapWithArrays);\n    void receiveMapAndArrayWithNullValues(\n        WritableMap map,\n        WritableArray array);\n    void receiveMapWithMultibyteUTF8CharacterString(WritableMap map);\n    void receiveArrayWithMultibyteUTF8CharacterString(WritableArray array);\n  }\n\n  private AssertModule mAssertModule;\n  private CatalystInstance mInstance;\n\n  @Override\n  protected void setUp() throws Exception {\n    super.setUp();\n\n    List<ViewManager> viewManagers = Arrays.<ViewManager>asList(\n        new ReactViewManager());\n    final UIManagerModule mUIManager =\n        new UIManagerModule(getContext(), viewManagers, new UIImplementationProvider(), 0);\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            mUIManager.onHostResume();\n          }\n        });\n    waitForIdleSync();\n\n    mAssertModule = new AssertModule();\n\n    mInstance = ReactTestHelper.catalystInstanceBuilder(this)\n        .addNativeModule(mAssertModule)\n        .addNativeModule(new DeviceInfoModule(getContext()))\n        .addNativeModule(new AppStateModule(getContext()))\n        .addNativeModule(new FakeWebSocketModule())\n        .addNativeModule(mUIManager)\n        .build();\n  }\n\n  public void testBasicTypes() {\n    mInstance.getJSModule(TestJavaToJSArgumentsModule.class)\n        .receiveBasicTypes(\"foo\", 3.14, true, null);\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testArrayWithBasicTypes() {\n    WritableNativeArray array = new WritableNativeArray();\n    array.pushString(\"red panda\");\n    array.pushDouble(1.19);\n    array.pushBoolean(true);\n    array.pushNull();\n\n    mInstance.getJSModule(TestJavaToJSArgumentsModule.class).receiveArrayWithBasicTypes(array);\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testNestedArray() {\n    WritableNativeArray level1 = new WritableNativeArray();\n    WritableNativeArray level2 = new WritableNativeArray();\n    WritableNativeArray level3 = new WritableNativeArray();\n    level3.pushString(\"level3\");\n    level2.pushString(\"level2\");\n    level2.pushArray(level3);\n    level1.pushString(\"level1\");\n    level1.pushArray(level2);\n\n    mInstance.getJSModule(TestJavaToJSArgumentsModule.class).receiveNestedArray(level1);\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testArrayWithMaps() {\n    WritableNativeMap m1 = new WritableNativeMap();\n    WritableNativeMap m2 = new WritableNativeMap();\n    m1.putString(\"m1k1\", \"m1v1\");\n    m1.putString(\"m1k2\", \"m1v2\");\n    m2.putString(\"m2k1\", \"m2v1\");\n\n    WritableNativeArray array = new WritableNativeArray();\n    array.pushMap(m1);\n    array.pushMap(m2);\n    mInstance.getJSModule(TestJavaToJSArgumentsModule.class).receiveArrayWithMaps(array);\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testMapWithBasicTypes() {\n    WritableNativeMap map = new WritableNativeMap();\n    map.putString(\"stringKey\", \"stringValue\");\n    map.putDouble(\"doubleKey\", 3.14);\n    map.putBoolean(\"booleanKey\", true);\n    map.putNull(\"nullKey\");\n\n    mInstance.getJSModule(TestJavaToJSArgumentsModule.class).receiveMapWithBasicTypes(map);\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testNestedMap() {\n    WritableNativeMap map = new WritableNativeMap();\n    WritableNativeMap nestedMap = new WritableNativeMap();\n    nestedMap.putString(\"animals\", \"foxes\");\n    map.putMap(\"nestedMap\", nestedMap);\n\n    mInstance.getJSModule(TestJavaToJSArgumentsModule.class).receiveNestedMap(map);\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testMapWithArrays() {\n    WritableNativeMap map = new WritableNativeMap();\n    WritableNativeArray a1 = new WritableNativeArray();\n    WritableNativeArray a2 = new WritableNativeArray();\n    a1.pushDouble(3);\n    a1.pushDouble(1);\n    a1.pushDouble(4);\n    a2.pushDouble(1);\n    a2.pushDouble(9);\n    map.putArray(\"array1\", a1);\n    map.putArray(\"array2\", a2);\n\n    mInstance.getJSModule(TestJavaToJSArgumentsModule.class).receiveMapWithArrays(map);\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testMapWithNullStringValue() {\n    WritableNativeMap map = new WritableNativeMap();\n    map.putString(\"string\", null);\n    map.putArray(\"array\", null);\n    map.putMap(\"map\", null);\n\n    WritableNativeArray array = new WritableNativeArray();\n    array.pushString(null);\n    array.pushArray(null);\n    array.pushMap(null);\n\n    mInstance.getJSModule(TestJavaToJSArgumentsModule.class)\n        .receiveMapAndArrayWithNullValues(map, array);\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testStringWithMultibyteUTF8Characters() {\n    TestJavaToJSArgumentsModule jsModule = mInstance.getJSModule(TestJavaToJSArgumentsModule.class);\n\n    WritableNativeMap map = new WritableNativeMap();\n    map.putString(\"two-bytes\", \"\\u00A2\");\n    map.putString(\"three-bytes\", \"\\u20AC\");\n    map.putString(\"four-bytes\", \"\\uD83D\\uDE1C\");\n    map.putString(\n        \"mixed\",\n        \"\\u017C\\u00F3\\u0142\\u0107 g\\u0119\\u015Bl\\u0105 \\u6211 \\uD83D\\uDE0E ja\\u017A\\u0107\");\n\n    jsModule.receiveMapWithMultibyteUTF8CharacterString(map);\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n\n    WritableArray array = new WritableNativeArray();\n    array.pushString(\"\\u00A2\");\n    array.pushString(\"\\u20AC\");\n    array.pushString(\"\\uD83D\\uDE1C\");\n    array.pushString(\n        \"\\u017C\\u00F3\\u0142\\u0107 g\\u0119\\u015Bl\\u0105 \\u6211 \\uD83D\\uDE0E ja\\u017A\\u0107\");\n\n    jsModule.receiveArrayWithMultibyteUTF8CharacterString(array);\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testThrowWhenArrayReusedInArray() {\n    boolean gotException = false;\n    try {\n      WritableNativeArray array1 = new WritableNativeArray();\n      WritableNativeArray array2 = new WritableNativeArray();\n      WritableNativeArray child = new WritableNativeArray();\n      array1.pushArray(child);\n      array2.pushArray(child);\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n  }\n\n  public void testThrowWhenArrayReusedInMap() {\n    boolean gotException = false;\n    try {\n      WritableNativeMap map1 = new WritableNativeMap();\n      WritableNativeMap map2 = new WritableNativeMap();\n      WritableNativeArray child = new WritableNativeArray();\n      map1.putArray(\"child\", child);\n      map2.putArray(\"child\", child);\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n  }\n\n  public void testThrowWhenMapReusedInArray() {\n    boolean gotException = false;\n    try {\n      WritableNativeArray array1 = new WritableNativeArray();\n      WritableNativeArray array2 = new WritableNativeArray();\n      WritableNativeMap child = new WritableNativeMap();\n      array1.pushMap(child);\n      array2.pushMap(child);\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n  }\n\n  public void testThrowWhenMapReusedInMap() {\n    boolean gotException = false;\n    try {\n      WritableNativeMap map1 = new WritableNativeMap();\n      WritableNativeMap map2 = new WritableNativeMap();\n      WritableNativeMap child = new WritableNativeMap();\n      map1.putMap(\"child\", child);\n      map2.putMap(\"child\", child);\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n  }\n\n  public void testThrowWhenAddToConsumedArray() {\n    WritableNativeArray array = new WritableNativeArray();\n    WritableNativeArray parent = new WritableNativeArray();\n    parent.pushArray(array);\n\n    boolean gotException = false;\n    try {\n      array.pushNull();\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n\n    gotException = false;\n    try {\n      array.pushBoolean(true);\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n\n    gotException = false;\n    try {\n      array.pushDouble(1);\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n\n    gotException = false;\n    try {\n      array.pushString(\"foo\");\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n\n    gotException = false;\n    try {\n      array.pushArray(new WritableNativeArray());\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n\n    gotException = false;\n    try {\n      array.pushMap(new WritableNativeMap());\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n  }\n\n  public void testThrowWhenAddToConsumedMap() {\n    WritableNativeMap map = new WritableNativeMap();\n    WritableNativeArray parent = new WritableNativeArray();\n    parent.pushMap(map);\n\n    boolean gotException = false;\n    try {\n      map.putNull(\"key\");\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n\n    gotException = false;\n    try {\n      map.putBoolean(\"key\", true);\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n\n    gotException = false;\n    try {\n      map.putDouble(\"key\", 1);\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n\n    gotException = false;\n    try {\n      map.putString(\"key\", \"foo\");\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n\n    gotException = false;\n    try {\n      map.putArray(\"key\", new WritableNativeArray());\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n\n    gotException = false;\n    try {\n      map.putMap(\"key\", new WritableNativeMap());\n    } catch (ObjectAlreadyConsumedException e) {\n      gotException = true;\n    }\n    assertTrue(gotException);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/CatalystNativeJavaToJSReturnValuesTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeArray;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.appstate.AppStateModule;\nimport com.facebook.react.modules.deviceinfo.DeviceInfoModule;\nimport com.facebook.react.testing.AssertModule;\nimport com.facebook.react.testing.FakeWebSocketModule;\nimport com.facebook.react.testing.ReactIntegrationTestCase;\nimport com.facebook.react.testing.ReactTestHelper;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport java.util.ArrayList;\nimport org.junit.Ignore;\n\n/**\n * Test marshalling return values from Java to JS\n */\n@Ignore(\"Fix prop types and view managers.\")\npublic class CatalystNativeJavaToJSReturnValuesTestCase extends ReactIntegrationTestCase {\n\n  private interface TestJavaToJSReturnValuesModule extends JavaScriptModule {\n    void callMethod(String methodName, String expectedReturnType, String expectedJSON);\n    void triggerException();\n  }\n\n  @ReactModule(name = \"TestModule\")\n  private static class TestModule extends BaseJavaModule {\n    @Override\n    public String getName() {\n      return \"TestModule\";\n    }\n\n    @ReactMethod(isBlockingSynchronousMethod = true)\n    boolean getBoolean() {\n      return true;\n    }\n\n    @ReactMethod(isBlockingSynchronousMethod = true)\n    Boolean getBoxedBoolean() {\n      return Boolean.valueOf(true);\n    }\n\n    @ReactMethod(isBlockingSynchronousMethod = true)\n    int getInt() {\n      return 42;\n    }\n\n    @ReactMethod(isBlockingSynchronousMethod = true)\n    Integer getBoxedInt() {\n      return Integer.valueOf(42);\n    }\n\n    @ReactMethod(isBlockingSynchronousMethod = true)\n    double getDouble() {\n      return 3.14159;\n    }\n\n    @ReactMethod(isBlockingSynchronousMethod = true)\n    Double getBoxedDouble() {\n      return Double.valueOf(3.14159);\n    }\n\n    @ReactMethod(isBlockingSynchronousMethod = true)\n    String getString() {\n      return \"Hello world!\";\n    }\n\n    @ReactMethod(isBlockingSynchronousMethod = true)\n    WritableArray getArray() {\n      WritableArray arr = new WritableNativeArray();\n      arr.pushString(\"a\");\n      arr.pushBoolean(true);\n      return arr;\n    }\n\n    @ReactMethod(isBlockingSynchronousMethod = true)\n    WritableMap getMap() {\n      WritableMap map = new WritableNativeMap();\n      map.putBoolean(\"a\", true);\n      map.putBoolean(\"b\", false);\n      return map;\n    }\n\n    @ReactMethod(isBlockingSynchronousMethod = true)\n    boolean triggerException() {\n      throw new RuntimeException(\"Exception triggered\");\n    }\n  }\n\n  private AssertModule mAssertModule;\n  private CatalystInstance mInstance;\n\n  @Override\n  protected void setUp() throws Exception {\n    super.setUp();\n\n    final UIManagerModule mUIManager =\n        new UIManagerModule(\n            getContext(), new ArrayList<ViewManager>(), new UIImplementationProvider(), 0);\n\n    mAssertModule = new AssertModule();\n\n    mInstance = ReactTestHelper.catalystInstanceBuilder(this)\n        .addNativeModule(mAssertModule)\n        .addNativeModule(new DeviceInfoModule(getContext()))\n        .addNativeModule(new AppStateModule(getContext()))\n        .addNativeModule(new FakeWebSocketModule())\n        .addNativeModule(mUIManager)\n        .addNativeModule(new TestModule())\n        .build();\n  }\n\n  public void testGetPrimitives() {\n    TestJavaToJSReturnValuesModule m = mInstance.getJSModule(TestJavaToJSReturnValuesModule.class);\n\n    // jboolean is actually an unsigned char, so we don't get JS booleans\n    m.callMethod(\"getBoolean\", \"number\", \"1\");\n    m.callMethod(\"getBoxedBoolean\", \"number\", \"1\");\n\n    m.callMethod(\"getInt\", \"number\", \"42\");\n    m.callMethod(\"getBoxedInt\", \"number\", \"42\");\n\n    m.callMethod(\"getDouble\", \"number\", \"3.14159\");\n    m.callMethod(\"getBoxedDouble\", \"number\", \"3.14159\");\n\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testObjectTypes() {\n    TestJavaToJSReturnValuesModule m = mInstance.getJSModule(TestJavaToJSReturnValuesModule.class);\n\n    m.callMethod(\"getString\", \"string\", \"\\\"Hello world!\\\"\");\n    m.callMethod(\"getArray\", \"object\", \"[\\\"a\\\",true]\");\n    m.callMethod(\"getMap\", \"object\", \"{\\\"b\\\":false,\\\"a\\\":true}\");\n\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n\n  public void testThrowsException() {\n    TestJavaToJSReturnValuesModule m = mInstance.getJSModule(TestJavaToJSReturnValuesModule.class);\n    m.triggerException();\n\n    waitForBridgeAndUIIdle();\n    mAssertModule.verifyAssertsAndReset();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/CatalystSubviewsClippingTestCase.java",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.tests;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport android.content.Context;\nimport javax.annotation.Nullable;\nimport android.widget.ScrollView;\n\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.views.view.ReactViewGroup;\nimport com.facebook.react.views.view.ReactViewManager;\n\nimport org.junit.Assert;\nimport org.junit.Ignore;\n\n/**\n * Integration test for {@code removeClippedSubviews} property that verify correct scrollview\n * behavior\n */\npublic class CatalystSubviewsClippingTestCase extends ReactAppInstrumentationTestCase {\n\n  private interface SubviewsClippingTestModule extends JavaScriptModule {\n    void renderClippingSample1();\n    void renderClippingSample2();\n    void renderScrollViewTest();\n    void renderUpdatingSample1(boolean update1, boolean update2);\n    void renderUpdatingSample2(boolean update);\n  }\n\n  private final List<String> mEvents = new ArrayList<>();\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"SubviewsClippingTestApp\";\n  }\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    return super.createReactInstanceSpecForTest()\n        .addViewManager(new ClippableViewManager(mEvents));\n  }\n\n  /**\n   * In this test view are layout in a following way:\n   * +-----------------------------+\n   * |                             |\n   * |   +---------------------+   |\n   * |   | inner1              |   |\n   * |   +---------------------+   |\n   * | +-------------------------+ |\n   * | | outer (clip=true)       | |\n   * | | +---------------------+ | |\n   * | | | inner2              | | |\n   * | | +---------------------+ | |\n   * | |                         | |\n   * | +-------------------------+ |\n   * |   +---------------------+   |\n   * |   | inner3              |   |\n   * |   +---------------------+   |\n   * |                             |\n   * +-----------------------------+\n   *\n   * We expect only outer and inner2 to be attached\n   */\n  public void XtestOneLevelClippingInView() throws Throwable {\n    mEvents.clear();\n    getReactContext().getJSModule(SubviewsClippingTestModule.class).renderClippingSample1();\n    waitForBridgeAndUIIdle();\n    Assert.assertArrayEquals(new String[]{\"Attach_outer\", \"Attach_inner2\"}, mEvents.toArray());\n  }\n\n  /**\n   * In this test view are layout in a following way:\n   * +-----------------------------+\n   * | outer (clip=true)           |\n   * |                             |\n   * |                             |\n   * |                             |\n   * |              +-----------------------------+\n   * |              | complexInner (clip=true)    |\n   * |              | +----------+ | +---------+  |\n   * |              | | inner1   | | | inner2  |  |\n   * |              | |          | | |         |  |\n   * |              | +----------+ | +---------+  |\n   * +--------------+--------------+              |\n   *                | +----------+   +---------+  |\n   *                | | inner3   |   | inner4  |  |\n   *                | |          |   |         |  |\n   *                | +----------+   +---------+  |\n   *                |                             |\n   *                +-----------------------------+\n   *\n   * We expect outer, complexInner & inner1 to be attached\n   */\n  public void XtestTwoLevelClippingInView() throws Throwable {\n    mEvents.clear();\n    getReactContext().getJSModule(SubviewsClippingTestModule.class).renderClippingSample2();\n    waitForBridgeAndUIIdle();\n    Assert.assertArrayEquals(\n        new String[]{\"Attach_outer\", \"Attach_complexInner\", \"Attach_inner1\"},\n        mEvents.toArray());\n  }\n\n  /**\n   * This test verifies that we update clipped subviews appropriately when some of them gets\n   * re-layouted.\n   *\n   * In this test scenario we render clipping view (\"outer\") with two subviews, one is outside and\n   * clipped and one is inside (absolutely positioned). By updating view props we first change the\n   * height of the first element so that it should intersect with clipping \"outer\" view. Then we\n   * update top position of the second view so that is should go off screen.\n   */\n  public void testClippingAfterLayoutInner() {\n    SubviewsClippingTestModule subviewsClippingTestModule =\n        getReactContext().getJSModule(SubviewsClippingTestModule.class);\n\n    mEvents.clear();\n    subviewsClippingTestModule.renderUpdatingSample1(false, false);\n    waitForBridgeAndUIIdle();\n    Assert.assertArrayEquals(new String[]{\"Attach_outer\", \"Attach_inner2\"}, mEvents.toArray());\n\n    mEvents.clear();\n    subviewsClippingTestModule.renderUpdatingSample1(true, false);\n    waitForBridgeAndUIIdle();\n    Assert.assertArrayEquals(new String[]{\"Attach_inner1\"}, mEvents.toArray());\n\n    mEvents.clear();\n    subviewsClippingTestModule.renderUpdatingSample1(true, true);\n    waitForBridgeAndUIIdle();\n    Assert.assertArrayEquals(new String[]{\"Detach_inner2\"}, mEvents.toArray());\n  }\n\n  /**\n   * This test verifies that we update clipping views appropriately when parent view layout changes\n   * in a way that affects clipping.\n   *\n   * In this test we render clipping view (\"outer\") set to be 100x100dp with inner view that is\n   * absolutely positioned out of the clipping area of the parent view. Then we resize parent view\n   * so that inner view should be visible.\n   */\n  public void testClippingAfterLayoutParent() {\n    SubviewsClippingTestModule subviewsClippingTestModule =\n        getReactContext().getJSModule(SubviewsClippingTestModule.class);\n\n    mEvents.clear();\n    subviewsClippingTestModule.renderUpdatingSample2(false);\n    waitForBridgeAndUIIdle();\n    Assert.assertArrayEquals(new String[]{\"Attach_outer\"}, mEvents.toArray());\n\n    mEvents.clear();\n    subviewsClippingTestModule.renderUpdatingSample2(true);\n    waitForBridgeAndUIIdle();\n    Assert.assertArrayEquals(new String[]{\"Attach_inner\"}, mEvents.toArray());\n  }\n\n  public void testOneLevelClippingInScrollView() throws Throwable {\n    getReactContext().getJSModule(SubviewsClippingTestModule.class).renderScrollViewTest();\n    waitForBridgeAndUIIdle();\n\n    // Only 3 first views should be attached at the beginning\n    Assert.assertArrayEquals(new String[]{\"Attach_0\", \"Attach_1\", \"Attach_2\"}, mEvents.toArray());\n    mEvents.clear();\n\n    // We scroll down such that first view get out of the bounds, we expect the first view to be\n    // detached and 4th view to get attached\n    scrollToDpInUIThread(120);\n    Assert.assertArrayEquals(new String[]{\"Detach_0\", \"Attach_3\"}, mEvents.toArray());\n  }\n\n  public void testTwoLevelClippingInScrollView() throws Throwable {\n    getReactContext().getJSModule(SubviewsClippingTestModule.class).renderScrollViewTest();\n    waitForBridgeAndUIIdle();\n\n    final int complexViewOffset = 4 * 120 - 300;\n\n    // Step 1\n    // We scroll down such that first \"complex\" view is clipped & just below the bottom of the\n    // scroll view\n    scrollToDpInUIThread(complexViewOffset);\n\n    mEvents.clear();\n\n    // Step 2\n    // Scroll a little bit so that \"complex\" view is visible, but it's inner views are not\n    scrollToDpInUIThread(complexViewOffset + 5);\n\n    Assert.assertArrayEquals(new String[]{\"Attach_C0\"}, mEvents.toArray());\n    mEvents.clear();\n\n    // Step 3\n    // Scroll even more so that first subview of \"complex\" view is visible, view 1 will get off\n    // screen\n    scrollToDpInUIThread(complexViewOffset + 100);\n    Assert.assertArrayEquals(new String[]{\"Detach_1\", \"Attach_C0.1\"}, mEvents.toArray());\n    mEvents.clear();\n\n    // Step 4\n    // Scroll even more to reveal second subview of \"complex\" view\n    scrollToDpInUIThread(complexViewOffset + 150);\n    Assert.assertArrayEquals(new String[]{\"Attach_C0.2\"}, mEvents.toArray());\n    mEvents.clear();\n\n    // Step 5\n    // Scroll back to previous position (Step 3), second view should get detached\n    scrollToDpInUIThread(complexViewOffset + 100);\n    Assert.assertArrayEquals(new String[]{\"Detach_C0.2\"}, mEvents.toArray());\n    mEvents.clear();\n\n    // Step 6\n    // Scroll back to Step 2, complex view should be visible but all subviews should be detached\n    scrollToDpInUIThread(complexViewOffset + 5);\n    Assert.assertArrayEquals(new String[]{\"Attach_1\", \"Detach_C0.1\"}, mEvents.toArray());\n    mEvents.clear();\n\n    // Step 7\n    // Scroll back to Step 1, complex view should be gone\n    scrollToDpInUIThread(complexViewOffset);\n    Assert.assertArrayEquals(new String[]{\"Detach_C0\"}, mEvents.toArray());\n  }\n\n  private void scrollToDpInUIThread(final int yPositionInDP) throws Throwable {\n    final ScrollView mainScrollView = getViewByTestId(\"scroll_view\");\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            mainScrollView.scrollTo(0, (int) PixelUtil.toPixelFromDIP(yPositionInDP));\n          }\n        });\n    waitForBridgeAndUIIdle();\n  }\n\n  private static class ClippableView extends ReactViewGroup {\n\n    private String mClippableViewID;\n    private final List<String> mEvents;\n\n    public ClippableView(Context context, List<String> events) {\n      super(context);\n      mEvents = events;\n    }\n\n    @Override\n    protected void onAttachedToWindow() {\n      super.onAttachedToWindow();\n      mEvents.add(\"Attach_\" + mClippableViewID);\n    }\n\n    @Override\n    protected void onDetachedFromWindow() {\n      super.onDetachedFromWindow();\n      mEvents.add(\"Detach_\" + mClippableViewID);\n    }\n\n    public void setClippableViewID(String clippableViewID) {\n      mClippableViewID = clippableViewID;\n    }\n  }\n\n  private static class ClippableViewManager extends ReactViewManager {\n\n    private final List<String> mEvents;\n\n    public ClippableViewManager(List<String> events) {\n      mEvents = events;\n    }\n\n    @Override\n    public String getName() {\n      return \"ClippableView\";\n    }\n\n    @Override\n    public ReactViewGroup createViewInstance(ThemedReactContext context) {\n      return new ClippableView(context, mEvents);\n    }\n\n    @ReactProp(name = \"clippableViewID\")\n    public void setClippableViewId(ReactViewGroup view, @Nullable String clippableViewId) {\n      ((ClippableView) view).setClippableViewID(clippableViewId);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/CatalystTouchBubblingTestCase.java",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.tests;\n\nimport android.view.View;\n\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\nimport com.facebook.react.testing.SingleTouchGestureGenerator;\nimport com.facebook.react.testing.StringRecordingModule;\n\n/**\n * This test is to verify that touch events bubbles up to the right handler. We emulate couple\n * of different gestures on top of the application reflecting following layout:\n *\n * +---------------------------------------------------------------------------------------+\n * |                                                                                       |\n * | +----------------------------------------------------------------------------------+  |\n * | | +-------------+                                              +----------------+  |  |\n * | | | +---+       |                                              |                |  |  |\n * | | | | A |       |                                              |                |  |  |\n * | | | +---+       |                                              |        C       |  |  |\n * | | |     {B}     |                                              |                |  |  |\n * | | |             |                      {D}                     |                |  |  |\n * | | +-------------+                                              +----------------+  |  |\n * | |                                                                                  |  |\n * | |                                                                                  |  |\n * | +----------------------------------------------------------------------------------+  |\n * |\n * | +----------------------------------------------------------------------------------+  |\n * | |                                                                                  |  |\n * | |                                                                                  |  |\n * | |                                                                                  |  |\n * | |                                      {E}                                         |  |\n * | |                                                                                  |  |\n * | |                                                                                  |  |\n * | +----------------------------------------------------------------------------------+  |\n * +---------------------------------------------------------------------------------------+\n *\n * Then in each test case we either tap the center of a particular view (from A to E) or we start\n * a gesture in one view and end it with another.\n * View with names in brackets (e.g. {D}) have touch handlers set whereas all other views are not\n * declared to handler touch events.\n */\npublic class CatalystTouchBubblingTestCase extends ReactAppInstrumentationTestCase {\n\n  private final StringRecordingModule mRecordingModule = new StringRecordingModule();\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"TouchBubblingTestAppModule\";\n  }\n\n  /**\n   * 1) Simulate touch event at view A, expect {B} touch handler to fire\n   * 2) Simulate touch event at view C, expect {D} touch handler to fire\n   */\n  public void testSimpleClickAtInnerElements() {\n    mRecordingModule.reset();\n    View innerButton = getViewByTestId(\"A\");\n    assertNotNull(innerButton);\n    createGestureGenerator().startGesture(innerButton).endGesture();\n    waitForBridgeAndUIIdle();\n    assertEquals(1, mRecordingModule.getCalls().size());\n    assertEquals(\"inner\", mRecordingModule.getCalls().get(0));\n\n    mRecordingModule.reset();\n    innerButton = getViewByTestId(\"C\");\n    assertNotNull(innerButton);\n    createGestureGenerator().startGesture(innerButton).endGesture();\n    waitForBridgeAndUIIdle();\n    assertEquals(1, mRecordingModule.getCalls().size());\n    assertEquals(\"outer\", mRecordingModule.getCalls().get(0));\n  }\n\n  /**\n   * 1) Start touch at view A, then drag and release on view {B} (but outside of A), expect {B}'s\n   * touch handler to fire\n   * 2) Do the same with view C and {D}\n   */\n  public void testDownOnInnerUpOnTouchableParent() {\n    View innerButton = getViewByTestId(\"A\");\n    View touchableParent = getViewByTestId(\"B\");\n\n    SingleTouchGestureGenerator gestureGenerator = createGestureGenerator();\n    gestureGenerator.startGesture(innerButton);\n    // wait for tapped view measurements\n    waitForBridgeAndUIIdle();\n\n    gestureGenerator.dragTo(touchableParent, 15).endGesture();\n    waitForBridgeAndUIIdle();\n    assertEquals(1, mRecordingModule.getCalls().size());\n    assertEquals(\"inner\", mRecordingModule.getCalls().get(0));\n\n    // Do same with second inner view\n    mRecordingModule.reset();\n\n    touchableParent = getViewByTestId(\"D\");\n    innerButton = getViewByTestId(\"C\");\n\n    gestureGenerator = createGestureGenerator();\n    gestureGenerator.startGesture(innerButton);\n    // wait for tapped view measurements\n    waitForBridgeAndUIIdle();\n\n    gestureGenerator.dragTo(touchableParent, 15).endGesture();\n    waitForBridgeAndUIIdle();\n    assertEquals(1, mRecordingModule.getCalls().size());\n    assertEquals(\"outer\", mRecordingModule.getCalls().get(0));\n  }\n\n  /**\n   * Start gesture at view A, then drag and release on view {E}. Expect no touch handlers to fire\n   */\n  public void testDragOutOfTouchable() {\n    View outsideView = getViewByTestId(\"E\");\n    View innerButton = getViewByTestId(\"A\");\n\n    SingleTouchGestureGenerator gestureGenerator = createGestureGenerator();\n    gestureGenerator.startGesture(innerButton);\n    // wait for tapped view measurements\n    waitForBridgeAndUIIdle();\n\n    gestureGenerator.dragTo(outsideView, 15).endGesture();\n    waitForBridgeAndUIIdle();\n    assertTrue(mRecordingModule.getCalls().isEmpty());\n  }\n\n  /**\n   * In this scenario we start gesture at view A (has two touchable parents {B} and {D}) then we\n   * drag and release gesture on view {D}, but outside of {B}. We expect no touch handler to fire\n   */\n  public void testNoEventWhenDragOutOfFirstTouchableParentToItsTouchableParent() {\n    View topLevelTouchable = getViewByTestId(\"C\");\n    View innerButton = getViewByTestId(\"A\");\n\n    SingleTouchGestureGenerator gestureGenerator = createGestureGenerator();\n    gestureGenerator.startGesture(innerButton);\n    // wait for tapped view measurements\n    waitForBridgeAndUIIdle();\n\n    gestureGenerator.dragTo(topLevelTouchable, 15).endGesture();\n    waitForBridgeAndUIIdle();\n    assertTrue(mRecordingModule.getCalls().isEmpty());\n  }\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    return new ReactInstanceSpecForTest()\n        .addNativeModule(mRecordingModule);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/CatalystUIManagerTestCase.java",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.tests;\n\nimport android.util.DisplayMetrics;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.FrameLayout;\nimport android.widget.TextView;\nimport com.facebook.react.ReactRootView;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.modules.appstate.AppStateModule;\nimport com.facebook.react.modules.deviceinfo.DeviceInfoModule;\nimport com.facebook.react.modules.systeminfo.AndroidInfoModule;\nimport com.facebook.react.testing.FakeWebSocketModule;\nimport com.facebook.react.testing.ReactIntegrationTestCase;\nimport com.facebook.react.testing.ReactTestHelper;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.views.text.ReactRawTextManager;\nimport com.facebook.react.views.text.ReactTextViewManager;\nimport com.facebook.react.views.view.ReactViewManager;\nimport java.util.Arrays;\nimport java.util.List;\n\n/**\n * Test case for basic {@link UIManagerModule} functionality.\n */\npublic class CatalystUIManagerTestCase extends ReactIntegrationTestCase {\n  private interface UIManagerTestModule extends JavaScriptModule {\n    void renderFlexTestApplication(int rootTag);\n    void renderFlexWithTextApplication(int rootTag);\n    void renderAbsolutePositionTestApplication(int rootTag);\n    void renderAbsolutePositionBottomRightTestApplication(int rootTag);\n    void renderCenteredTextViewTestApplication(int rootTag, String text);\n    void renderUpdatePositionInListTestApplication(int rootTag);\n    void flushUpdatePositionInList();\n  }\n\n  private UIManagerTestModule jsModule;\n  private UIManagerModule uiManager;\n\n  private int inPixelRounded(int val) {\n    return Math.round(PixelUtil.toPixelFromDIP(val));\n  }\n\n  private boolean isWithinRange(float value, float lower, float upper) {\n    return value >= lower && value <= upper;\n  }\n\n  private ReactRootView createRootView() {\n    ReactRootView rootView = new ReactRootView(getContext());\n    final DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();\n    rootView.setLayoutParams(\n        new FrameLayout.LayoutParams(metrics.widthPixels, metrics.heightPixels));\n    uiManager.addRootView(rootView);\n    // We add the root view by posting to the main thread so wait for that to complete so that the\n    // root view tag is added to the view\n    waitForIdleSync();\n    return rootView;\n  }\n\n  @Override\n  protected void setUp() throws Exception {\n    super.setUp();\n\n    List<ViewManager> viewManagers = Arrays.<ViewManager>asList(\n        new ReactViewManager(),\n        new ReactTextViewManager(),\n        new ReactRawTextManager());\n    uiManager =\n        new UIManagerModule(getContext(), viewManagers, new UIImplementationProvider(), 0);\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        uiManager.onHostResume();\n      }\n    });\n    waitForIdleSync();\n\n    jsModule = ReactTestHelper.catalystInstanceBuilder(this)\n        .addNativeModule(uiManager)\n        .addNativeModule(new AndroidInfoModule())\n        .addNativeModule(new DeviceInfoModule(getContext()))\n        .addNativeModule(new AppStateModule(getContext()))\n        .addNativeModule(new FakeWebSocketModule())\n        .build()\n        .getJSModule(UIManagerTestModule.class);\n  }\n\n  public void testFlexUIRendered() {\n    FrameLayout rootView = createRootView();\n    jsModule.renderFlexTestApplication(rootView.getId());\n    waitForBridgeAndUIIdle();\n\n    assertEquals(1, rootView.getChildCount());\n\n    ViewGroup container = getViewByTestId(rootView, \"container\");\n    assertEquals(inPixelRounded(200), container.getWidth());\n    assertEquals(inPixelRounded(200), container.getHeight());\n    assertEquals(2, container.getChildCount());\n\n    View child0 = container.getChildAt(0);\n    assertEquals(inPixelRounded(100), child0.getWidth());\n    assertEquals(inPixelRounded(200), child0.getHeight());\n\n    View child1 = container.getChildAt(1);\n    assertEquals(inPixelRounded(100), child1.getWidth());\n    assertEquals(inPixelRounded(200), child1.getHeight());\n  }\n\n  // TODO t13583009\n  // Breaks OSS CI but runs fine locally\n  // Find what could be different and make the test independent of env\n  // public void testFlexWithTextViews() {\n  //   FrameLayout rootView = createRootView();\n  //   jsModule.renderFlexWithTextApplication(rootView.getId());\n  //   waitForBridgeAndUIIdle();\n  //\n  //   assertEquals(1, rootView.getChildCount());\n  //\n  //   ViewGroup container = getViewByTestId(rootView, \"container\");\n  //   assertEquals(inPixelRounded(300), container.getHeight());\n  //   assertEquals(1, container.getChildCount());\n  //\n  //   ViewGroup row = (ViewGroup) container.getChildAt(0);\n  //   assertEquals(inPixelRounded(300), row.getHeight());\n  //   assertEquals(2, row.getChildCount());\n  //\n  //   // Text measurement adds padding that isn't completely dependent on density so we can't easily\n  //   // get an exact value here\n  //   float approximateExpectedTextHeight = inPixelRounded(19);\n  //   View leftText = row.getChildAt(0);\n  //   assertTrue(\n  //       isWithinRange(\n  //           leftText.getHeight(),\n  //           approximateExpectedTextHeight - PixelUtil.toPixelFromDIP(1),\n  //           approximateExpectedTextHeight + PixelUtil.toPixelFromDIP(1)));\n  //   assertEquals(row.getWidth() / 2 - inPixelRounded(20), leftText.getWidth());\n  //   assertEquals(inPixelRounded(290), (leftText.getTop() + leftText.getHeight()));\n  //\n  //   View rightText = row.getChildAt(1);\n  //   assertTrue(\n  //       isWithinRange(\n  //           rightText.getHeight(),\n  //           approximateExpectedTextHeight - PixelUtil.toPixelFromDIP(1),\n  //           approximateExpectedTextHeight + PixelUtil.toPixelFromDIP(1)));\n  //   assertEquals(leftText.getWidth(), rightText.getWidth());\n  //   assertEquals(leftText.getTop(), rightText.getTop());\n  //   assertEquals(leftText.getWidth() + inPixelRounded(30), rightText.getLeft());\n  // }\n\n  public void testAbsolutePositionUIRendered() {\n    FrameLayout rootView = createRootView();\n    jsModule.renderAbsolutePositionTestApplication(rootView.getId());\n    waitForBridgeAndUIIdle();\n\n    assertEquals(1, rootView.getChildCount());\n\n    View absoluteView = getViewByTestId(rootView, \"absolute\");\n    assertEquals(inPixelRounded(50), absoluteView.getWidth());\n    assertEquals(inPixelRounded(60), absoluteView.getHeight());\n    assertEquals(inPixelRounded(10), absoluteView.getLeft());\n    assertEquals(inPixelRounded(15), absoluteView.getTop());\n  }\n\n  public void testUpdatePositionInList() {\n    FrameLayout rootView = createRootView();\n    jsModule.renderUpdatePositionInListTestApplication(rootView.getId());\n    waitForBridgeAndUIIdle();\n\n    ViewGroup containerView = getViewByTestId(rootView, \"container\");\n    View c0 = containerView.getChildAt(0);\n    View c1 = containerView.getChildAt(1);\n    View c2 = containerView.getChildAt(2);\n\n    assertEquals(inPixelRounded(10), c0.getHeight());\n    assertEquals(inPixelRounded(0), c0.getTop());\n    assertEquals(inPixelRounded(10), c1.getHeight());\n    assertEquals(inPixelRounded(10), c1.getTop());\n    assertEquals(inPixelRounded(10), c2.getHeight());\n    assertEquals(inPixelRounded(20), c2.getTop());\n\n    // Let's make the second elements 50px height instead of 10px\n    jsModule.flushUpdatePositionInList();\n    waitForBridgeAndUIIdle();\n\n    assertEquals(inPixelRounded(10), c0.getHeight());\n    assertEquals(inPixelRounded(0), c0.getTop());\n    assertEquals(inPixelRounded(50), c1.getHeight());\n    assertEquals(inPixelRounded(10), c1.getTop());\n    assertEquals(inPixelRounded(10), c2.getHeight());\n    assertEquals(inPixelRounded(60), c2.getTop());\n  }\n\n  public void testAbsolutePositionBottomRightUIRendered() {\n    FrameLayout rootView = createRootView();\n    jsModule.renderAbsolutePositionBottomRightTestApplication(rootView.getId());\n    waitForBridgeAndUIIdle();\n\n    assertEquals(1, rootView.getChildCount());\n\n    ViewGroup containerView = getViewByTestId(rootView, \"container\");\n    View absoluteView = containerView.getChildAt(0);\n\n    assertEquals(inPixelRounded(50), absoluteView.getWidth());\n    assertEquals(inPixelRounded(60), absoluteView.getHeight());\n    assertEquals(inPixelRounded(100 - 50 - 10), Math.round(absoluteView.getLeft()));\n    assertEquals(inPixelRounded(100 - 60 - 15), Math.round(absoluteView.getTop()));\n  }\n\n  public void _testCenteredText(String text) {\n    ReactRootView rootView = new ReactRootView(getContext());\n    int rootTag = uiManager.addRootView(rootView);\n\n    jsModule.renderCenteredTextViewTestApplication(rootTag, text);\n    waitForBridgeAndUIIdle();\n\n    TextView textView = getViewByTestId(rootView, \"text\");\n\n    // text view should be centered\n    String msg = \"text `\" + text + \"` is not centered\";\n    assertTrue(msg, textView.getLeft() > 0.1);\n    assertTrue(msg, textView.getTop() > 0.1);\n    assertEquals(\n        msg,\n        (int) Math.ceil((inPixelRounded(200) - textView.getWidth()) * 0.5f),\n        textView.getLeft());\n    assertEquals(\n        msg,\n        (int) Math.ceil((inPixelRounded(100) - textView.getHeight()) * 0.5f),\n        textView.getTop());\n  }\n\n  public void testCenteredTextCases() {\n    String[] cases = new String[] {\n      \"test\",\n      \"with whitespace\",\n    };\n    for (String text : cases) {\n      _testCenteredText(text);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/DatePickerDialogTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport java.util.ArrayList;\nimport java.util.Calendar;\nimport java.util.List;\n\nimport android.app.DatePickerDialog;\nimport android.content.DialogInterface;\nimport android.support.v4.app.DialogFragment;\nimport android.support.v4.app.Fragment;\nimport android.widget.DatePicker;\n\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.modules.datepicker.DatePickerDialogModule;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\n\n/**\n * Test case for {@link DatePickerDialogModule} options and callbacks.\n */\npublic class DatePickerDialogTestCase extends ReactAppInstrumentationTestCase {\n\n  private static interface DatePickerDialogTestModule extends JavaScriptModule {\n    public void showDatePickerDialog(WritableMap options);\n  }\n\n  private static class DatePickerDialogRecordingModule extends BaseJavaModule {\n\n    private final List<Integer[]> mDates = new ArrayList<Integer[]>();\n    private int mDismissed = 0;\n    private int mErrors = 0;\n\n    @Override\n    public String getName() {\n      return \"DatePickerDialogRecordingModule\";\n    }\n\n    @ReactMethod\n    public void recordDate(int year, int month, int day) {\n      mDates.add(new Integer[] {year, month, day});\n    }\n\n    @ReactMethod\n    public void recordDismissed() {\n      mDismissed++;\n    }\n\n    @ReactMethod\n    public void recordError() {\n      mErrors++;\n    }\n\n    public List<Integer[]> getDates() {\n      return new ArrayList<Integer[]>(mDates);\n    }\n\n    public int getDismissed() {\n      return mDismissed;\n    }\n\n    public int getErrors() {\n      return mErrors;\n    }\n  }\n\n  final DatePickerDialogRecordingModule mRecordingModule = new DatePickerDialogRecordingModule();\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    return super.createReactInstanceSpecForTest()\n        .addNativeModule(mRecordingModule);\n  }\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"DatePickerDialogTestApp\";\n  }\n\n  private static long getDateInMillis(int year, int month, int date) {\n    final Calendar c = Calendar.getInstance();\n    c.set(Calendar.YEAR, year);\n    c.set(Calendar.MONTH, month);\n    c.set(Calendar.DATE, date);\n    return c.getTimeInMillis();\n  }\n\n  private DatePickerDialogTestModule getTestModule() {\n    return getReactContext().getCatalystInstance().getJSModule(DatePickerDialogTestModule.class);\n  }\n\n  private DialogFragment showDialog(WritableMap options) {\n    getTestModule().showDatePickerDialog(options);\n\n    waitForBridgeAndUIIdle();\n    getInstrumentation().waitForIdleSync();\n\n    return (DialogFragment) getActivity().getSupportFragmentManager()\n        .findFragmentByTag(DatePickerDialogModule.FRAGMENT_TAG);\n  }\n\n  public void testShowBasicDatePicker() {\n    final Fragment datePickerFragment = showDialog(null);\n\n    assertNotNull(datePickerFragment);\n  }\n\n  public void testPresetDate() {\n    final WritableMap options = new WritableNativeMap();\n    options.putDouble(\"date\", getDateInMillis(2020, 5, 6));\n\n    final DialogFragment datePickerFragment = showDialog(options);\n    final DatePicker datePicker =\n        ((DatePickerDialog) datePickerFragment.getDialog()).getDatePicker();\n\n    assertEquals(2020, datePicker.getYear());\n    assertEquals(5, datePicker.getMonth());\n    assertEquals(6, datePicker.getDayOfMonth());\n  }\n\n  public void testCallback() throws Throwable {\n    final WritableMap options = new WritableNativeMap();\n    options.putDouble(\"date\", getDateInMillis(2020, 5, 6));\n\n    final DialogFragment datePickerFragment = showDialog(options);\n\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            ((DatePickerDialog) datePickerFragment.getDialog())\n                .getButton(DialogInterface.BUTTON_POSITIVE).performClick();\n          }\n        });\n\n    getInstrumentation().waitForIdleSync();\n    waitForBridgeAndUIIdle();\n\n    assertEquals(0, mRecordingModule.getErrors());\n    assertEquals(1, mRecordingModule.getDates().size());\n    assertEquals(2020, (int) mRecordingModule.getDates().get(0)[0]);\n    assertEquals(5, (int) mRecordingModule.getDates().get(0)[1]);\n    assertEquals(6, (int) mRecordingModule.getDates().get(0)[2]);\n  }\n\n  public void testDismissCallback() throws Throwable {\n    final DialogFragment datePickerFragment = showDialog(null);\n\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            datePickerFragment.getDialog().dismiss();\n          }\n        });\n\n    getInstrumentation().waitForIdleSync();\n    waitForBridgeAndUIIdle();\n\n    assertEquals(0, mRecordingModule.getErrors());\n    assertEquals(0, mRecordingModule.getDates().size());\n    assertEquals(1, mRecordingModule.getDismissed());\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/InitialPropsTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport android.os.Bundle;\nimport android.test.ActivityInstrumentationTestCase2;\n\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.testing.FakeWebSocketModule;\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.testing.ReactAppTestActivity;\n\n/**\n * Simple test case for passing initial props to the root React application.\n */\npublic class InitialPropsTestCase extends\n    ActivityInstrumentationTestCase2<ReactAppTestActivity> {\n\n  public static final String DEFAULT_JS_BUNDLE = \"AndroidTestBundle.js\";\n\n  private static class RecordingModule extends BaseJavaModule {\n    private int mCount = 0;\n    private ReadableMap mProps;\n\n    @Override\n    public String getName() {\n      return \"InitialPropsRecordingModule\";\n    }\n\n    @ReactMethod\n    public void recordProps(ReadableMap props) {\n      mProps = props;\n      mCount++;\n    }\n\n    public int getCount() {\n      return mCount;\n    }\n\n    public ReadableMap getProps() {\n      return mProps;\n    }\n  }\n\n  private RecordingModule mRecordingModule;\n\n  public InitialPropsTestCase() {\n    super(ReactAppTestActivity.class);\n  }\n\n  @Override\n  protected void setUp() throws Exception {\n    super.setUp();\n\n    mRecordingModule = new RecordingModule();\n  }\n\n  public void testInitialProps() throws Throwable {\n    final ReactAppTestActivity activity = getActivity();\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            ReactInstanceSpecForTest catalystInstanceSpec = new ReactInstanceSpecForTest();\n            catalystInstanceSpec.addNativeModule(new FakeWebSocketModule());\n            catalystInstanceSpec.addNativeModule(mRecordingModule);\n            Bundle props = new Bundle();\n            props.putString(\"key1\", \"string\");\n            props.putInt(\"key2\", 5);\n            props.putDouble(\"key3\", 5.5);\n            props.putFloat(\"key4\", 5.6f);\n            props.putBoolean(\"key5\", true);\n            props.putStringArray(\"key6\", new String[]{\"one\", \"two\", \"three\"});\n            props.putIntArray(\"key7\", new int[]{1, 2, 3});\n            props.putDoubleArray(\"key8\", new double[]{1.5, 2.5, 3.5});\n            props.putFloatArray(\"key9\", new float[]{1.6f, 2.6f, 3.6f});\n            props.putBooleanArray(\"key10\", new boolean[]{true, false});\n            activity.loadApp(\n                \"InitialPropsTestApp\",\n                catalystInstanceSpec,\n                props,\n                DEFAULT_JS_BUNDLE,\n                false);\n          }\n        });\n    activity.waitForBridgeAndUIIdle();\n\n    assertEquals(1, mRecordingModule.getCount());\n    ReadableMap props = mRecordingModule.getProps();\n    assertEquals(\"string\", props.getString(\"key1\"));\n    assertEquals(5, props.getInt(\"key2\"));\n    assertEquals(5.5, props.getDouble(\"key3\"));\n    assertEquals(5.6f, (float) props.getDouble(\"key4\"));\n    assertEquals(true, props.getBoolean(\"key5\"));\n\n    ReadableArray stringArray = props.getArray(\"key6\");\n    assertEquals(\"one\", stringArray.getString(0));\n    assertEquals(\"two\", stringArray.getString(1));\n    assertEquals(\"three\", stringArray.getString(2));\n\n    ReadableArray intArray = props.getArray(\"key7\");\n    assertEquals(1, intArray.getInt(0));\n    assertEquals(2, intArray.getInt(1));\n    assertEquals(3, intArray.getInt(2));\n\n    ReadableArray doubleArray = props.getArray(\"key8\");\n    assertEquals(1.5, doubleArray.getDouble(0));\n    assertEquals(2.5, doubleArray.getDouble(1));\n    assertEquals(3.5, doubleArray.getDouble(2));\n\n    ReadableArray floatArray = props.getArray(\"key9\");\n    assertEquals(1.6f, (float) floatArray.getDouble(0));\n    assertEquals(2.6f, (float) floatArray.getDouble(1));\n    assertEquals(3.6f, (float) floatArray.getDouble(2));\n\n    ReadableArray booleanArray = props.getArray(\"key10\");\n    assertEquals(true, booleanArray.getBoolean(0));\n    assertEquals(false, booleanArray.getBoolean(1));\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/JSLocaleTest.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport com.facebook.react.testing.FakeWebSocketModule;\nimport com.facebook.react.testing.ReactIntegrationTestCase;\nimport com.facebook.react.testing.ReactTestHelper;\nimport com.facebook.react.testing.StringRecordingModule;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.modules.appstate.AppStateModule;\nimport com.facebook.react.modules.deviceinfo.DeviceInfoModule;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.views.view.ReactViewManager;\n\n/**\n * Test locale-based functionality of JS VM\n */\npublic class JSLocaleTest extends ReactIntegrationTestCase {\n\n  private interface TestJSLocaleModule extends JavaScriptModule {\n    void toUpper(String string);\n    void toLower(String string);\n  }\n\n  StringRecordingModule mStringRecordingModule;\n\n  private CatalystInstance mInstance;\n\n  @Override\n  protected void setUp() throws Exception {\n    super.setUp();\n\n    List<ViewManager> viewManagers = Arrays.<ViewManager>asList(\n        new ReactViewManager());\n    final UIManagerModule mUIManager = new UIManagerModule(\n        getContext(),\n        viewManagers,\n        new UIImplementationProvider(),\n        0);\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            mUIManager.onHostResume();\n          }\n        });\n    waitForIdleSync();\n\n    mStringRecordingModule = new StringRecordingModule();\n    mInstance = ReactTestHelper.catalystInstanceBuilder(this)\n        .addNativeModule(mStringRecordingModule)\n        .addNativeModule(mUIManager)\n        .addNativeModule(new DeviceInfoModule(getContext()))\n        .addNativeModule(new AppStateModule(getContext()))\n        .addNativeModule(new FakeWebSocketModule())\n        .build();\n  }\n\n  public void testToUpper() {\n    TestJSLocaleModule testModule = mInstance.getJSModule(TestJSLocaleModule.class);\n    waitForBridgeAndUIIdle();\n\n    testModule.toUpper(\"test\");\n    testModule.toUpper(\"W niżach mógł zjeść truflę koń bądź psy\");\n    testModule.toUpper(\"Шеф взъярён тчк щипцы с эхом гудбай Жюль\");\n    testModule.toUpper(\"Γαζίες καὶ μυρτιὲς δὲν θὰ βρῶ πιὰ στὸ χρυσαφὶ ξέφωτο\");\n    testModule.toUpper(\"chinese: 幓 厏吪吙 鈊釿閍 碞碠粻 曮禷\");\n    waitForBridgeAndUIIdle();\n\n    String[] answers = mStringRecordingModule.getCalls().toArray(new String[0]);\n    assertEquals(\"TEST\", answers[0]);\n    assertEquals(\"W NIŻACH MÓGŁ ZJEŚĆ TRUFLĘ KOŃ BĄDŹ PSY\", answers[1]);\n    assertEquals(\"ШЕФ ВЗЪЯРЁН ТЧК ЩИПЦЫ С ЭХОМ ГУДБАЙ ЖЮЛЬ\", answers[2]);\n    assertEquals(\"ΓΑΖΊΕΣ ΚΑῚ ΜΥΡΤΙῈΣ ΔῈΝ ΘᾺ ΒΡΩ͂ ΠΙᾺ ΣΤῸ ΧΡΥΣΑΦῚ ΞΈΦΩΤΟ\", answers[3]);\n    assertEquals(\"CHINESE: 幓 厏吪吙 鈊釿閍 碞碠粻 曮禷\", answers[4]);\n  }\n\n  public void testToLower() {\n    TestJSLocaleModule testModule = mInstance.getJSModule(TestJSLocaleModule.class);\n\n    testModule.toLower(\"TEST\");\n    testModule.toLower(\"W NIŻACH MÓGŁ ZJEŚĆ TRUFLĘ KOŃ BĄDŹ psy\");\n    testModule.toLower(\"ШЕФ ВЗЪЯРЁН ТЧК ЩИПЦЫ С ЭХОМ ГУДБАЙ ЖЮЛЬ\");\n    testModule.toLower(\"ΓΑΖΊΕΣ ΚΑῚ ΜΥΡΤΙῈΣ ΔῈΝ ΘᾺ ΒΡΩ͂ ΠΙᾺ ΣΤῸ ΧΡΥΣΑΦῚ ΞΈΦΩΤΟ\");\n    testModule.toLower(\"CHINESE: 幓 厏吪吙 鈊釿閍 碞碠粻 曮禷\");\n    waitForBridgeAndUIIdle();\n\n    String[] answers = mStringRecordingModule.getCalls().toArray(new String[0]);\n    assertEquals(\"test\", answers[0]);\n    assertEquals(\"w niżach mógł zjeść truflę koń bądź psy\", answers[1]);\n    assertEquals(\"шеф взъярён тчк щипцы с эхом гудбай жюль\", answers[2]);\n    assertEquals(\"γαζίες καὶ μυρτιὲς δὲν θὰ βρῶ πιὰ στὸ χρυσαφὶ ξέφωτο\", answers[3]);\n    assertEquals(\"chinese: 幓 厏吪吙 鈊釿閍 碞碠粻 曮禷\", answers[4]);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/JSResponderTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport android.widget.ScrollView;\n\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\nimport com.facebook.react.testing.SingleTouchGestureGenerator;\n\n/**\n * Test case to verify that JSResponder flow work correctly.\n *\n * In a single test case scenario we have a view with pan gesture recognizer containing a scrollview\n * We verify that by vertical drags affects a scrollview while horizontal drags are suppose to\n * be recognized by pan responder and setJSResponder should be triggered resulting in scrollview\n * events being intercepted.\n */\npublic class JSResponderTestCase extends ReactAppInstrumentationTestCase {\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"JSResponderTestApp\";\n  }\n\n  public void testResponderLocksScrollView() {\n    ScrollView scrollView = getViewByTestId(\"scroll_view\");\n    assertNotNull(scrollView);\n    assertEquals(0, scrollView.getScrollY());\n\n    float inpx40dp = PixelUtil.toPixelFromDIP(40f);\n    float inpx100dp = PixelUtil.toPixelFromDIP(100f);\n\n    SingleTouchGestureGenerator gestureGenerator = createGestureGenerator();\n\n    gestureGenerator\n        .startGesture(30, 30 + inpx100dp)\n        .dragTo(30 + inpx40dp, 30, 10, 1200)\n        .endGesture(180, 100);\n\n    waitForBridgeAndUIIdle();\n\n    assertTrue(\"Expected to scroll by at least 80 dp\", scrollView.getScrollY() >= inpx100dp * .8f);\n\n    int previousScroll = scrollView.getScrollY();\n\n    gestureGenerator\n        .startGesture(30, 30 + inpx100dp)\n        .dragTo(30 + inpx40dp, 30 + inpx100dp, 10, 1200);\n\n    waitForBridgeAndUIIdle();\n\n    gestureGenerator\n        .dragTo(30 + inpx40dp, 30, 10, 1200)\n        .endGesture();\n\n    waitForBridgeAndUIIdle();\n    assertEquals(\"Expected not to scroll\", scrollView.getScrollY(), previousScroll);\n\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/LayoutEventsTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.testing.StringRecordingModule;\n\n/**\n * Simple test to verify that layout events (onLayout) propagate to JS from native.\n */\npublic class LayoutEventsTestCase extends ReactAppInstrumentationTestCase {\n\n  private StringRecordingModule mStringRecordingModule;\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"LayoutEventsTestApp\";\n  }\n\n  /**\n   * Creates a UI in JS and verifies the onLayout handler is called.\n   */\n  public void testOnLayoutCalled() {\n    assertEquals(3, mStringRecordingModule.getCalls().size());\n    assertEquals(\"10,10-100x100\", mStringRecordingModule.getCalls().get(0));\n    assertEquals(\"10,10-50x50\", mStringRecordingModule.getCalls().get(1));\n    assertEquals(\"0,0-50x50\", mStringRecordingModule.getCalls().get(2));\n  }\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    mStringRecordingModule = new StringRecordingModule();\n    return super.createReactInstanceSpecForTest()\n        .addNativeModule(mStringRecordingModule);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/NativeIdTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport android.view.View;\n\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\nimport com.facebook.react.uimanager.util.ReactFindViewUtil;\n\n/**\n * Tests that the 'nativeID' property can be set on various views.\n * The 'nativeID' property is used to reference react managed views from native code.\n */\npublic class NativeIdTestCase extends ReactAppInstrumentationTestCase {\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"NativeIdTestApp\";\n  }\n\n  private final List<String> viewTags = Arrays.asList(\n    \"Image\",\n    \"Text\",\n    \"TouchableBounce\",\n    \"TouchableHighlight\",\n    \"TouchableOpacity\",\n    \"TouchableWithoutFeedback\",\n    \"TextInput\",\n    \"View\");\n\n  private boolean mViewFound;\n\n  @Override\n  protected void setUp() throws Exception {\n    mViewFound = false;\n    ReactFindViewUtil.addViewListener(new ReactFindViewUtil.OnViewFoundListener() {\n      @Override\n      public String getNativeId() {\n        return viewTags.get(0);\n      }\n\n      @Override\n      public void onViewFound(View view) {\n        mViewFound = true;\n      }\n    });\n    super.setUp();\n  }\n\n  public void testPropertyIsSetForViews() {\n    for (String nativeId : viewTags) {\n      View viewWithTag = ReactFindViewUtil.findView(\n        getActivity().getRootView(),\n        nativeId);\n      assertNotNull(\n        \"View with nativeID \" + nativeId + \" was not found. Check NativeIdTestModule.js.\",\n        viewWithTag);\n    }\n  }\n\n  public void testViewListener() {\n    assertTrue(\"OnViewFound callback was never invoked\", mViewFound);\n  }\n\n  public void testFindView() {\n    mViewFound = false;\n    ReactFindViewUtil.findView(\n      getActivity().getRootView(),\n      new ReactFindViewUtil.OnViewFoundListener() {\n        @Override\n        public String getNativeId() {\n          return viewTags.get(0);\n        }\n\n        @Override\n        public void onViewFound(View view) {\n          mViewFound = true;\n        }\n      });\n    assertTrue(\n      \"OnViewFound callback should have successfully been invoked synchronously\",\n      mViewFound);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/ProgressBarTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport android.content.res.Resources;\nimport android.util.DisplayMetrics;\nimport android.util.TypedValue;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.FrameLayout;\nimport android.widget.ProgressBar;\nimport com.facebook.react.ReactRootView;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.modules.appstate.AppStateModule;\nimport com.facebook.react.modules.deviceinfo.DeviceInfoModule;\nimport com.facebook.react.modules.systeminfo.AndroidInfoModule;\nimport com.facebook.react.testing.FakeWebSocketModule;\nimport com.facebook.react.testing.ReactIntegrationTestCase;\nimport com.facebook.react.testing.ReactTestHelper;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.views.progressbar.ReactProgressBarViewManager;\nimport com.facebook.react.views.view.ReactViewManager;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.List;\n\n/**\n * Test to verify that Progress bar renders as a view of the right size\n */\npublic class ProgressBarTestCase extends ReactIntegrationTestCase {\n\n  // Has same order of progressBars in ProgressBarTestModule\n  private static final String[] styleList =\n      new String[] {\"Horizontal\", \"Small\", \"Large\", \"Inverse\", \"SmallInverse\", \"LargeInverse\"};\n  private static final HashMap<String, Integer> styles = new HashMap<String, Integer>();\n\n  static {\n    styles.put(\"Horizontal\", android.R.attr.progressBarStyleHorizontal);\n    styles.put(\"Small\", android.R.attr.progressBarStyleSmall);\n    styles.put(\"Large\", android.R.attr.progressBarStyleLarge);\n    styles.put(\"Inverse\", android.R.attr.progressBarStyleInverse);\n    styles.put(\"SmallInverse\", android.R.attr.progressBarStyleSmallInverse);\n    styles.put(\"LargeInverse\", android.R.attr.progressBarStyleLargeInverse);\n}\n\n  private static interface ProgressBarTestModule extends JavaScriptModule {\n    public void renderProgressBarApplication(int rootTag);\n  }\n\n  private UIManagerModule mUIManager;\n  private CatalystInstance mInstance;\n  private ReactRootView mRootView;\n\n  @Override\n  protected void setUp() throws Exception {\n    super.setUp();\n\n    List<ViewManager> viewManagers = Arrays.<ViewManager>asList(\n        new ReactViewManager(),\n        new ReactProgressBarViewManager());\n    mUIManager =\n        new UIManagerModule(getContext(), viewManagers, new UIImplementationProvider(), 0);\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            mUIManager.onHostResume();\n          }\n        });\n    waitForIdleSync();\n\n    mInstance = ReactTestHelper.catalystInstanceBuilder(this)\n        .addNativeModule(mUIManager)\n        .addNativeModule(new AndroidInfoModule())\n        .addNativeModule(new DeviceInfoModule(getContext()))\n        .addNativeModule(new AppStateModule(getContext()))\n        .addNativeModule(new FakeWebSocketModule())\n        .build();\n\n    mRootView = new ReactRootView(getContext());\n    DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();\n    mRootView.setLayoutParams(\n        new FrameLayout.LayoutParams(metrics.widthPixels, metrics.heightPixels));\n    int rootTag = mUIManager.addRootView(mRootView);\n    mInstance.getJSModule(ProgressBarTestModule.class).renderProgressBarApplication(rootTag);\n    waitForBridgeAndUIIdle();\n  }\n\n  /**\n   * Test that the sizes of the progressBars are setup correctly\n   */\n  public void testProgressBarSizes() {\n    for (String style : styleList) {\n      ProgressBar newProgressBar =\n          new ProgressBar(getContext(), null, styles.get(style));\n      final int spec = View.MeasureSpec.makeMeasureSpec(\n          ViewGroup.LayoutParams.WRAP_CONTENT,\n          View.MeasureSpec.UNSPECIFIED);\n      newProgressBar.measure(spec, spec);\n      final int expectedHeight = newProgressBar.getMeasuredHeight();\n\n      // verify correct size of view containing ProgressBar\n      View viewContainingProgressBar = getViewByTestId(mRootView, style);\n      assertEquals(expectedHeight, viewContainingProgressBar.getHeight());\n\n      assertTrue(((ViewGroup) viewContainingProgressBar).getChildAt(0) instanceof ProgressBar);\n    }\n  }\n\n  public void testProgressBarWidth() {\n    View viewContainingProgressBar = getViewByTestId(mRootView, \"Horizontal200\");\n    assertEquals(viewContainingProgressBar.getWidth(), dpToPixels(200));\n    ProgressBar progressBar = (ProgressBar) ((ViewGroup) viewContainingProgressBar).getChildAt(0);\n    assertEquals(progressBar.getWidth(), dpToPixels(200));\n  }\n\n  private int dpToPixels(int dp) {\n    Resources r = getContext().getResources();\n    return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics());\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/ReactPickerTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport android.graphics.Color;\nimport android.widget.Spinner;\nimport android.widget.SpinnerAdapter;\nimport android.widget.TextView;\n\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.views.picker.ReactDialogPickerManager;\nimport com.facebook.react.views.picker.ReactDropdownPickerManager;\nimport com.facebook.react.views.picker.ReactPicker;\nimport com.facebook.react.views.picker.ReactPickerManager;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\n\n/**\n * Integration test for {@link ReactDialogPickerManager} and {@link ReactDropdownPickerManager}\n * (and, implicitly, {@link ReactPickerManager}). Tests basic properties, events and switching\n * between spinner modes (which changes the used manager).\n */\npublic class ReactPickerTestCase extends ReactAppInstrumentationTestCase {\n\n  private static interface PickerAndroidTestModule extends JavaScriptModule {\n    public void selectItem(int position);\n    public void setMode(String mode);\n    public void setPrimaryColor(String color);\n  }\n\n  public static class PickerAndroidRecordingModule extends BaseJavaModule {\n    private final List<Integer> mSelections = new ArrayList<Integer>();\n\n    @Override\n    public String getName() {\n      return \"PickerAndroidRecordingModule\";\n    }\n\n    @ReactMethod\n    public void recordSelection(int position) {\n      mSelections.add(position);\n    }\n\n    public List<Integer> getSelections() {\n      return new ArrayList<Integer>(mSelections);\n    }\n  }\n\n  private PickerAndroidRecordingModule mRecordingModule;\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"PickerAndroidTestApp\";\n  }\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    mRecordingModule = new PickerAndroidRecordingModule();\n    return super.createReactInstanceSpecForTest()\n      .addNativeModule(mRecordingModule);\n  }\n\n  public void testBasicProperties() {\n    ReactPicker spinner = getViewAtPath(0, 0);\n    SpinnerAdapter adapter = spinner.getAdapter();\n\n    assertEquals(Spinner.MODE_DIALOG, spinner.getMode());\n    assertEquals(\"prompt\", spinner.getPrompt());\n    assertNotNull(adapter);\n    assertEquals(3, adapter.getCount());\n    assertEquals(\"item1\", ((TextView) adapter.getView(0, null, null)).getText());\n    assertEquals(\"item2\", ((TextView) adapter.getView(1, null, null)).getText());\n    assertEquals(\"item3\", ((TextView) adapter.getView(2, null, null)).getText());\n    assertEquals(1, spinner.getSelectedItemPosition());\n\n    // test colors\n    assertEquals(Color.RED, ((TextView) adapter.getView(0, null, null)).getCurrentTextColor());\n    assertEquals(Color.GREEN, ((TextView) adapter.getView(1, null, null)).getCurrentTextColor());\n    assertEquals(Color.BLUE, ((TextView) adapter.getView(2, null, null)).getCurrentTextColor());\n    assertEquals(\n        Color.RED,\n        ((TextView) adapter.getDropDownView(0, null, null)).getCurrentTextColor());\n    assertEquals(\n        Color.GREEN,\n        ((TextView) adapter.getDropDownView(1, null, null)).getCurrentTextColor());\n    assertEquals(\n        Color.BLUE,\n        ((TextView) adapter.getDropDownView(2, null, null)).getCurrentTextColor());\n    getTestModule().setPrimaryColor(\"black\");\n    waitForBridgeAndUIIdle();\n    assertEquals(Color.BLACK, ((TextView) adapter.getView(0, null, null)).getCurrentTextColor());\n    assertEquals(Color.BLACK, ((TextView) adapter.getView(1, null, null)).getCurrentTextColor());\n    assertEquals(Color.BLACK, ((TextView) adapter.getView(2, null, null)).getCurrentTextColor());\n    assertEquals(\n        Color.RED,\n        ((TextView) adapter.getDropDownView(0, null, null)).getCurrentTextColor());\n    assertEquals(\n        Color.GREEN,\n        ((TextView) adapter.getDropDownView(1, null, null)).getCurrentTextColor());\n    assertEquals(\n        Color.BLUE,\n        ((TextView) adapter.getDropDownView(2, null, null)).getCurrentTextColor());\n\n  }\n\n  public void testDropdownPicker() {\n    ReactPicker spinner = getViewAtPath(0, 1);\n\n    assertEquals(Spinner.MODE_DROPDOWN, spinner.getMode());\n  }\n\n  public void testDisabledPicker() {\n    ReactPicker spinner = getViewAtPath(0, 2);\n\n    assertFalse(spinner.isEnabled());\n  }\n\n  public void testUpdateSelectedItem() {\n    ReactPicker spinner = getViewAtPath(0, 0);\n    assertEquals(1, spinner.getSelectedItemPosition());\n\n    getTestModule().selectItem(2);\n    waitForBridgeAndUIIdle();\n    getInstrumentation().waitForIdleSync();\n\n    assertEquals(2, spinner.getSelectedItemPosition());\n  }\n\n  public void testUpdateMode() {\n    ReactPicker spinner = getViewAtPath(0, 1);\n    assertEquals(Spinner.MODE_DROPDOWN, spinner.getMode());\n\n    getTestModule().setMode(\"dialog\");\n    waitForBridgeAndUIIdle();\n    getInstrumentation().waitForIdleSync();\n\n    // changing the spinner mode in JS actually creates a new component on the native side, as\n    // there's no way to change the mode once you have constructed a Spinner.\n    ReactPicker newPicker = getViewAtPath(0, 1);\n    assertTrue(spinner != newPicker);\n    assertEquals(Spinner.MODE_DIALOG, newPicker.getMode());\n  }\n\n  public void testOnSelect() throws Throwable {\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            ReactPicker spinner = getViewAtPath(0, 0);\n            spinner.setSelection(2);\n          }\n        });\n\n    getInstrumentation().waitForIdleSync();\n    waitForBridgeAndUIIdle();\n\n    List<Integer> selections = mRecordingModule.getSelections();\n    assertEquals(1, selections.size());\n    assertEquals(2, (int) selections.get(0));\n  }\n\n  public void testOnSelectSequence() throws Throwable {\n    updateFirstSpinnerAndCheckLastSpinnerMatches(0);\n    updateFirstSpinnerAndCheckLastSpinnerMatches(2);\n    updateFirstSpinnerAndCheckLastSpinnerMatches(0);\n    updateFirstSpinnerAndCheckLastSpinnerMatches(2);\n  }\n\n  private void updateFirstSpinnerAndCheckLastSpinnerMatches(\n    final int indexToSelect\n  ) throws Throwable {\n    // The last spinner has the same selected value as the first one.\n    // Test that user selection is propagated correctly to JS, to setState, and to Spinners.\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            ReactPicker spinner = getViewAtPath(0, 0);\n            spinner.setSelection(indexToSelect);\n          }\n        });\n    getInstrumentation().waitForIdleSync();\n    waitForBridgeAndUIIdle();\n\n    ReactPicker spinnerInSync = getViewAtPath(0, 3);\n    assertEquals(\n      \"Picker selection was not updated correctly via setState.\",\n      indexToSelect,\n      spinnerInSync.getSelectedItemPosition());\n  }\n\n  private PickerAndroidTestModule getTestModule() {\n    return getReactContext().getCatalystInstance().getJSModule(PickerAndroidTestModule.class);\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/ReactRootViewTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.FrameLayout;\n\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\nimport com.facebook.react.testing.StringRecordingModule;\nimport com.facebook.react.ReactRootView;\n\nimport org.junit.Ignore;\n\n/**\n * Integration test for {@link ReactRootView}.\n */\npublic class ReactRootViewTestCase extends ReactAppInstrumentationTestCase {\n\n  private StringRecordingModule mRecordingModule;\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"CatalystRootViewTestApp\";\n  }\n\n  @Ignore(\"t6596940: fix intermittently failing test\")\n  public void testResizeRootView() throws Throwable {\n    final ReactRootView rootView = (ReactRootView) getRootView();\n    final View childView = rootView.getChildAt(0);\n\n    assertEquals(rootView.getWidth(), childView.getWidth());\n\n    final int newWidth = rootView.getWidth() / 2;\n\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            rootView.setLayoutParams(new FrameLayout.LayoutParams(\n                    newWidth,\n                    ViewGroup.LayoutParams.MATCH_PARENT));\n          }\n        });\n\n    getInstrumentation().waitForIdleSync();\n    waitForBridgeAndUIIdle();\n\n    assertEquals(newWidth, childView.getWidth());\n  }\n\n  /**\n   * Verify that removing the root view from hierarchy will trigger subviews removal both on JS and\n   * native side\n   */\n  public void testRemoveRootView() throws Throwable {\n    final ReactRootView rootView = (ReactRootView) getRootView();\n\n    assertEquals(1, rootView.getChildCount());\n\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            ViewGroup parent = (ViewGroup) rootView.getParent();\n            parent.removeView(rootView);\n            // removing from parent should not remove child views, child views should be removed as\n            // an effect of native call to UIManager.removeRootView\n            assertEquals(1, rootView.getChildCount());\n          }\n        });\n\n    getInstrumentation().waitForIdleSync();\n    waitForBridgeAndUIIdle();\n\n    assertEquals(\"root component should not be automatically unmounted\", 0, mRecordingModule.getCalls().size());\n    assertEquals(1, rootView.getChildCount());\n\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            rootView.unmountReactApplication();\n          }\n        });\n    waitForBridgeAndUIIdle();\n\n    assertEquals(1, mRecordingModule.getCalls().size());\n    assertEquals(\"RootComponentWillUnmount\", mRecordingModule.getCalls().get(0));\n    assertEquals(0, rootView.getChildCount());\n  }\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    mRecordingModule = new StringRecordingModule();\n    return new ReactInstanceSpecForTest()\n        .addNativeModule(mRecordingModule);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/ReactSwipeRefreshLayoutTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport android.view.View;\n\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.views.swiperefresh.ReactSwipeRefreshLayout;\n\n/**\n * Test case for {@link ReactSwipeRefreshLayout}.\n */\npublic class ReactSwipeRefreshLayoutTestCase extends ReactAppInstrumentationTestCase {\n\n  private class SwipeRefreshLayoutRecordingModule extends BaseJavaModule {\n    private int mCount = 0;\n\n    @Override\n    public String getName() {\n      return \"SwipeRefreshLayoutRecordingModule\";\n    }\n\n    @ReactMethod\n    public void onRefresh() {\n      mCount++;\n    }\n\n    public int getCount() {\n      return mCount;\n    }\n  }\n\n  private interface SwipeRefreshLayoutTestModule extends JavaScriptModule {\n    void setRows(int rows);\n  }\n\n  private final SwipeRefreshLayoutRecordingModule mRecordingModule =\n      new SwipeRefreshLayoutRecordingModule();\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"SwipeRefreshLayoutTestApp\";\n  }\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    return super.createReactInstanceSpecForTest()\n      .addNativeModule(mRecordingModule);\n  }\n\n  public void testRefreshNoScroll() {\n    View refreshLayout = getViewAtPath(0);\n\n    createGestureGenerator()\n        .startGesture(refreshLayout.getWidth() / 2, 10)\n        .dragTo(refreshLayout.getWidth() / 2, refreshLayout.getHeight() / 2, 100, 1000)\n        .endGesture();\n    waitForBridgeAndUIIdle();\n    assertEquals(1, mRecordingModule.getCount());\n  }\n\n  public void testRefreshScroll() {\n    View refreshLayout = getViewAtPath(0);\n\n    getReactContext().getJSModule(SwipeRefreshLayoutTestModule.class).setRows(100);\n\n    createGestureGenerator()\n        .startGesture(refreshLayout.getWidth() / 2, 10)\n        .dragTo(refreshLayout.getWidth() / 2, refreshLayout.getHeight() / 2, 100, 1000)\n        .endGesture();\n    waitForBridgeAndUIIdle();\n    assertEquals(1, mRecordingModule.getCount());\n  }\n\n  public void testNoRefreshAfterScroll() {\n    View refreshLayout = getViewAtPath(0);\n\n    getReactContext().getJSModule(SwipeRefreshLayoutTestModule.class).setRows(100);\n\n    createGestureGenerator()\n        .startGesture(refreshLayout.getWidth() / 2, refreshLayout.getHeight() / 2)\n        .dragTo(refreshLayout.getWidth() / 2, 10, 100, 1000)\n        .endGesture();\n    waitForBridgeAndUIIdle();\n    createGestureGenerator()\n        .startGesture(refreshLayout.getWidth() / 2, 10)\n        .dragTo(refreshLayout.getWidth() / 2, refreshLayout.getHeight() / 2, 100, 1000)\n        .endGesture();\n    waitForBridgeAndUIIdle();\n    assertEquals(0, mRecordingModule.getCount());\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/ShareTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport android.app.Activity;\nimport android.app.AlertDialog;\nimport android.app.Instrumentation.ActivityMonitor;\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.content.IntentFilter;\nimport android.content.IntentFilter.MalformedMimeTypeException;\nimport android.support.v4.app.DialogFragment;\n\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.modules.share.ShareModule;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\n\n/**\n * Test case for {@link ShareModule}.\n */\npublic class ShareTestCase extends ReactAppInstrumentationTestCase {\n\n  private static interface ShareTestModule extends JavaScriptModule {\n    public void showShareDialog(WritableMap content, WritableMap options);\n  }\n\n  private static class ShareRecordingModule extends BaseJavaModule {\n\n    private int mOpened = 0;\n    private int mErrors = 0;\n\n    @Override\n    public String getName() {\n      return \"ShareRecordingModule\";\n    }\n\n    @ReactMethod\n    public void recordOpened() {\n      mOpened++;\n    }\n\n    @ReactMethod\n    public void recordError() {\n      mErrors++;\n    }\n\n    public int getOpened() {\n      return mOpened;\n    }\n\n    public int getErrors() {\n      return mErrors;\n    }\n\n  }\n\n  final ShareRecordingModule mRecordingModule = new ShareRecordingModule();\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    return super.createReactInstanceSpecForTest()\n        .addNativeModule(mRecordingModule);\n  }\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"ShareTestApp\";\n  }\n\n  private ShareTestModule getTestModule() {\n    return getReactContext().getCatalystInstance().getJSModule(ShareTestModule.class);\n  }\n\n  public void testShowBasicShareDialog() {\n    final WritableMap content = new WritableNativeMap();\n    content.putString(\"message\", \"Hello, ReactNative!\");\n    final WritableMap options = new WritableNativeMap();\n\n    IntentFilter intentFilter = new IntentFilter(Intent.ACTION_CHOOSER);\n    intentFilter.addCategory(Intent.CATEGORY_DEFAULT);\n    ActivityMonitor monitor = getInstrumentation().addMonitor(intentFilter, null, true);\n\n    getTestModule().showShareDialog(content, options);\n\n    waitForBridgeAndUIIdle();\n    getInstrumentation().waitForIdleSync();\n\n    assertEquals(1, monitor.getHits());\n    assertEquals(1, mRecordingModule.getOpened());\n    assertEquals(0, mRecordingModule.getErrors());\n\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/TestIdTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport android.view.View;\n\nimport com.facebook.react.views.picker.ReactDropdownPickerManager;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.testing.ReactTestHelper;\n\n/**\n * Tests that the 'testID' property can be set on various views.\n * The 'testID' property is used to locate views in UI tests.\n */\npublic class TestIdTestCase extends ReactAppInstrumentationTestCase {\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"TestIdTestApp\";\n  }\n\n  private final List<String> viewTags = Arrays.asList(\n      \"Image\",\n      \"Text\",\n      \"TouchableBounce\",\n      \"TouchableHighlight\",\n      \"TouchableOpacity\",\n      \"TouchableWithoutFeedback\",\n      \"TextInput\",\n      \"View\"\n      );\n\n  public void testPropertyIsSetForViews() {\n    for (String tag : viewTags) {\n      View viewWithTag = ReactTestHelper.getViewWithReactTestId(\n        getActivity().getRootView(),\n        tag);\n      assertNotNull(\n          \"View with testID tag \" + tag + \" was not found. Check TestIdTestModule.js.\",\n          viewWithTag);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/TextInputTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport android.graphics.Color;\nimport android.text.style.ForegroundColorSpan;\nimport android.util.TypedValue;\nimport android.view.KeyEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.inputmethod.EditorInfo;\nimport android.widget.EditText;\n\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.testing.StringRecordingModule;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.views.textinput.ReactEditText;\n\n/**\n * Test to verify that TextInput renders correctly\n */\npublic class TextInputTestCase extends ReactAppInstrumentationTestCase {\n\n  private final StringRecordingModule mRecordingModule = new StringRecordingModule();\n\n  private interface TextInputTestModule extends JavaScriptModule {\n    void setValueRef(String ref, String value);\n  }\n\n  /**\n   * Test that the actual height of the text input is not dependant on the font size of the text\n   * within.\n   */\n  public void testTextInputMeasurements() {\n    View textInputViewHeightSet = getViewByTestId(\"textInput1\");\n    EditText textInputViewNoHeight = getViewByTestId(\"textInput2\");\n\n    int expectedHeight = Math.round(PixelUtil.toPixelFromDIP(30));\n    assertEquals(expectedHeight, textInputViewHeightSet.getHeight());\n\n    EditText editText = new EditText(textInputViewNoHeight.getContext());\n    editText.setTextSize(\n        TypedValue.COMPLEX_UNIT_PX,\n        (float) Math.ceil(PixelUtil.toPixelFromSP(21.f)));\n    editText.setPadding(0, 0, 0, 0);\n    int measureSpec = View.MeasureSpec.makeMeasureSpec(\n        ViewGroup.LayoutParams.WRAP_CONTENT,\n        View.MeasureSpec.UNSPECIFIED);\n    editText.measure(measureSpec, measureSpec);\n\n    assertEquals(editText.getMeasuredHeight(), textInputViewNoHeight.getHeight());\n  }\n\n  /**\n   * Test that the cursor moves to the end of the word.\n   */\n  public void testTextInputCursorPosition() throws Throwable {\n    final EditText textInputWithText = getViewByTestId(\"textInput3\");\n\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            textInputWithText.setSelection(3);\n          }\n        });\n    getReactContext().getJSModule(TextInputTestModule.class)\n        .setValueRef(\"textInput3\", \"Some other value\");\n    waitForBridgeAndUIIdle();\n\n    assertEquals(4, textInputWithText.getSelectionStart());\n    assertEquals(4, textInputWithText.getSelectionEnd());\n  }\n\n  /**\n   * Test that the colors are applied to new text\n   */\n  public void testTextInputColors() throws Throwable {\n    String testIDs[] = new String[] {\"textInput4\", \"textInput5\", \"textInput6\"};\n\n    for (String testID : testIDs) {\n      getReactContext().getJSModule(TextInputTestModule.class).setValueRef(testID, \"NewText\");\n    }\n    waitForBridgeAndUIIdle();\n\n    for (String testID : testIDs) {\n      ReactEditText reactEditText = getViewByTestId(testID);\n      assertEquals(\n          Color.GREEN,\n          reactEditText.getText().getSpans(0, 1, ForegroundColorSpan.class)[0]\n              .getForegroundColor());\n    }\n  }\n\n  public void testOnSubmitEditing() throws Throwable {\n    String testId = \"onSubmitTextInput\";\n    ReactEditText reactEditText = getViewByTestId(testId);\n\n    fireEditorActionAndCheckRecording(reactEditText, EditorInfo.IME_ACTION_GO);\n    fireEditorActionAndCheckRecording(reactEditText, EditorInfo.IME_ACTION_DONE);\n    fireEditorActionAndCheckRecording(reactEditText, EditorInfo.IME_ACTION_NEXT);\n    fireEditorActionAndCheckRecording(reactEditText, EditorInfo.IME_ACTION_PREVIOUS);\n    fireEditorActionAndCheckRecording(reactEditText, EditorInfo.IME_ACTION_SEARCH);\n    fireEditorActionAndCheckRecording(reactEditText, EditorInfo.IME_ACTION_SEND);\n    fireEditorActionAndCheckRecording(reactEditText, EditorInfo.IME_ACTION_UNSPECIFIED);\n    fireEditorActionAndCheckRecording(reactEditText, EditorInfo.IME_ACTION_NONE);\n  }\n\n  private void fireEditorActionAndCheckRecording(final ReactEditText reactEditText,\n                                                 final int actionId) throws Throwable {\n    fireEditorActionAndCheckRecording(reactEditText, actionId, true);\n    fireEditorActionAndCheckRecording(reactEditText, actionId, false);\n  }\n\n  private void fireEditorActionAndCheckRecording(final ReactEditText reactEditText,\n                                                 final int actionId,\n                                                 final boolean blurOnSubmit) throws Throwable {\n    mRecordingModule.reset();\n\n    runTestOnUiThread(\n      new Runnable() {\n        @Override\n        public void run() {\n          reactEditText.requestFocusFromJS();\n          reactEditText.setBlurOnSubmit(blurOnSubmit);\n          reactEditText.onEditorAction(actionId);\n        }\n      });\n    waitForBridgeAndUIIdle();\n\n    assertEquals(1, mRecordingModule.getCalls().size());\n    assertEquals(!blurOnSubmit, reactEditText.isFocused());\n  }\n\n  /**\n   * Test that the mentions input has colors displayed correctly.\n   * Removed for being flaky in open source, December 2016\n  public void testMetionsInputColors() throws Throwable {\n    EventDispatcher eventDispatcher =\n        getReactContext().getNativeModule(UIManagerModule.class).getEventDispatcher();\n    ReactEditText reactEditText = getViewByTestId(\"tokenizedInput\");\n    String newText = \"#Things and more #things\";\n    int contentWidth = reactEditText.getWidth();\n    int contentHeight = reactEditText.getHeight();\n    int start = 0;\n    int count = newText.length();\n\n    eventDispatcher.dispatchEvent(\n        new ReactTextChangedEvent(\n            reactEditText.getId(),\n            newText.toString(),\n            (int) PixelUtil.toDIPFromPixel(contentWidth),\n            (int) PixelUtil.toDIPFromPixel(contentHeight),\n            reactEditText.incrementAndGetEventCounter()));\n\n    eventDispatcher.dispatchEvent(\n        new ReactTextInputEvent(\n            reactEditText.getId(),\n            newText.toString(),\n            \"\",\n            start,\n            start + count - 1));\n    waitForBridgeAndUIIdle();\n\n    ForegroundColorSpan[] spans = reactEditText\n        .getText().getSpans(0, reactEditText.getText().length(), ForegroundColorSpan.class);\n    assertEquals(2, spans.length);\n    assertEquals(spans[0].getForegroundColor(), spans[1].getForegroundColor());\n    assertEquals(0, reactEditText.getText().getSpanStart(spans[1]));\n    assertEquals(7, reactEditText.getText().getSpanEnd(spans[1]));\n    assertEquals(newText.length() - 7, reactEditText.getText().getSpanStart(spans[0]));\n    assertEquals(newText.length(), reactEditText.getText().getSpanEnd(spans[0]));\n\n    String moreText = \"andsuch \";\n    String previousText = newText;\n    newText += moreText;\n    count = moreText.length();\n    start = previousText.length();\n\n    eventDispatcher.dispatchEvent(\n        new ReactTextChangedEvent(\n            reactEditText.getId(),\n            newText.toString(),\n            (int) PixelUtil.toDIPFromPixel(contentWidth),\n            (int) PixelUtil.toDIPFromPixel(contentHeight),\n            reactEditText.incrementAndGetEventCounter()));\n\n    eventDispatcher.dispatchEvent(\n        new ReactTextInputEvent(\n            reactEditText.getId(),\n            moreText,\n            \"\",\n            start,\n            start + count - 1));\n    waitForBridgeAndUIIdle();\n\n    spans = reactEditText.getText()\n        .getSpans(0, reactEditText.getText().length(), ForegroundColorSpan.class);\n    assertEquals(2, spans.length);\n    assertEquals(spans[0].getForegroundColor(), spans[1].getForegroundColor());\n    assertEquals(0, reactEditText.getText().getSpanStart(spans[1]));\n    assertEquals(7, reactEditText.getText().getSpanEnd(spans[1]));\n    assertEquals(newText.length() - 15, reactEditText.getText().getSpanStart(spans[0]));\n    assertEquals(newText.length() - 1, reactEditText.getText().getSpanEnd(spans[0]));\n\n    moreText = \"morethings\";\n    previousText = newText;\n    newText += moreText;\n    count = moreText.length();\n    start = previousText.length();\n\n    eventDispatcher.dispatchEvent(\n        new ReactTextChangedEvent(\n            reactEditText.getId(),\n            newText.toString(),\n            (int) PixelUtil.toDIPFromPixel(contentWidth),\n            (int) PixelUtil.toDIPFromPixel(contentHeight),\n            reactEditText.incrementAndGetEventCounter()));\n\n    eventDispatcher.dispatchEvent(\n        new ReactTextInputEvent(\n            reactEditText.getId(),\n            moreText,\n            \"\",\n            start,\n            start + count - 1));\n    waitForBridgeAndUIIdle();\n\n    spans = reactEditText.getText()\n        .getSpans(0, reactEditText.getText().length(), ForegroundColorSpan.class);\n    assertEquals(spans[0].getForegroundColor(), spans[1].getForegroundColor());\n    assertEquals(2, spans.length);\n    assertEquals(0, reactEditText.getText().getSpanStart(spans[1]));\n    assertEquals(7, reactEditText.getText().getSpanEnd(spans[1]));\n    assertEquals(newText.length() - 25, reactEditText.getText().getSpanStart(spans[0]));\n    assertEquals(newText.length() - 11, reactEditText.getText().getSpanEnd(spans[0]));\n  }\n  */\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    return super.createReactInstanceSpecForTest()\n        .addNativeModule(mRecordingModule);\n  }\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"TextInputTestApp\";\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/TimePickerDialogTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport android.app.TimePickerDialog;\nimport android.content.DialogInterface;\nimport android.support.v4.app.DialogFragment;\n\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.testing.ReactInstanceSpecForTest;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.modules.timepicker.TimePickerDialogModule;\nimport com.facebook.react.testing.ReactAppInstrumentationTestCase;\n\n/**\n * Test case for {@link TimePickerDialogModule} options and callbacks.\n */\npublic class TimePickerDialogTestCase extends ReactAppInstrumentationTestCase {\n\n  private static interface TimePickerDialogTestModule extends JavaScriptModule {\n    public void showTimePickerDialog(WritableMap options);\n  }\n\n  private static class TimePickerDialogRecordingModule extends BaseJavaModule {\n\n    private final List<Integer[]> mTimes = new ArrayList<Integer[]>();\n    private int mDismissed = 0;\n    private int mErrors = 0;\n\n    @Override\n    public String getName() {\n      return \"TimePickerDialogRecordingModule\";\n    }\n\n    @ReactMethod\n    public void recordTime(int hour, int minute) {\n      mTimes.add(new Integer[] {hour, minute});\n    }\n\n    @ReactMethod\n    public void recordDismissed() {\n      mDismissed++;\n    }\n\n    @ReactMethod\n    public void recordError() {\n      mErrors++;\n    }\n\n    public List<Integer[]> getTimes() {\n      return new ArrayList<Integer[]>(mTimes);\n    }\n\n    public int getDismissed() {\n      return mDismissed;\n    }\n\n    public int getErrors() {\n      return mErrors;\n    }\n  }\n\n  final TimePickerDialogRecordingModule mRecordingModule = new TimePickerDialogRecordingModule();\n\n  @Override\n  protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {\n    return super.createReactInstanceSpecForTest()\n        .addNativeModule(mRecordingModule);\n  }\n\n  @Override\n  protected String getReactApplicationKeyUnderTest() {\n    return \"TimePickerDialogTestApp\";\n  }\n\n  private TimePickerDialogTestModule getTestModule() {\n    return getReactContext().getCatalystInstance().getJSModule(TimePickerDialogTestModule.class);\n  }\n\n  private DialogFragment showDialog(WritableMap options) {\n    getTestModule().showTimePickerDialog(options);\n\n    waitForBridgeAndUIIdle();\n    getInstrumentation().waitForIdleSync();\n\n    return (DialogFragment) getActivity().getSupportFragmentManager()\n        .findFragmentByTag(TimePickerDialogModule.FRAGMENT_TAG);\n  }\n\n  public void testShowBasicTimePicker() {\n    final DialogFragment fragment = showDialog(null);\n\n    assertNotNull(fragment);\n  }\n\n  public void testPresetTimeAndCallback() throws Throwable {\n    final WritableMap options = new WritableNativeMap();\n    options.putInt(\"hour\", 4);\n    options.putInt(\"minute\", 5);\n\n    final DialogFragment fragment = showDialog(options);\n\n    List<Integer[]> recordedTimes = mRecordingModule.getTimes();\n    assertEquals(0, recordedTimes.size());\n\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            ((TimePickerDialog) fragment.getDialog())\n                .getButton(DialogInterface.BUTTON_POSITIVE).performClick();\n          }\n        });\n\n    getInstrumentation().waitForIdleSync();\n    waitForBridgeAndUIIdle();\n\n    assertEquals(0, mRecordingModule.getErrors());\n    assertEquals(0, mRecordingModule.getDismissed());\n\n    recordedTimes = mRecordingModule.getTimes();\n    assertEquals(1, recordedTimes.size());\n    assertEquals(4, (int) recordedTimes.get(0)[0]);\n    assertEquals(5, (int) recordedTimes.get(0)[1]);\n  }\n\n  public void testDismissCallback() throws Throwable {\n    final DialogFragment fragment = showDialog(null);\n\n    assertEquals(0, mRecordingModule.getDismissed());\n\n    runTestOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            fragment.getDialog().dismiss();\n          }\n        });\n\n    getInstrumentation().waitForIdleSync();\n    waitForBridgeAndUIIdle();\n\n    assertEquals(0, mRecordingModule.getErrors());\n    assertEquals(0, mRecordingModule.getTimes().size());\n    assertEquals(1, mRecordingModule.getDismissed());\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/java/com/facebook/react/tests/ViewRenderingTestCase.java",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\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\npackage com.facebook.react.tests;\n\nimport android.graphics.Color;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport com.facebook.react.ReactRootView;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.modules.appstate.AppStateModule;\nimport com.facebook.react.modules.deviceinfo.DeviceInfoModule;\nimport com.facebook.react.modules.systeminfo.AndroidInfoModule;\nimport com.facebook.react.testing.FakeWebSocketModule;\nimport com.facebook.react.testing.ReactIntegrationTestCase;\nimport com.facebook.react.testing.ReactTestHelper;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.views.view.ReactViewGroup;\nimport com.facebook.react.views.view.ReactViewManager;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class ViewRenderingTestCase extends ReactIntegrationTestCase {\n\n  private interface ViewRenderingTestModule extends JavaScriptModule {\n    void renderViewApplication(int rootTag);\n    void renderMarginApplication(int rootTag);\n    void renderBorderApplication(int rootTag);\n    void updateMargins();\n    void renderTransformApplication(int rootTag);\n  }\n\n  private CatalystInstance mCatalystInstance;\n  private ReactRootView mRootView;\n  private int mRootTag;\n\n  @Override\n  protected void setUp() throws Exception {\n    super.setUp();\n\n    List<ViewManager> viewManagers = Arrays.<ViewManager>asList(new ReactViewManager());\n    final UIManagerModule uiManager =\n        new UIManagerModule(getContext(), viewManagers, new UIImplementationProvider(), 0);\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            uiManager.onHostResume();\n          }\n        });\n    waitForIdleSync();\n\n    mCatalystInstance = ReactTestHelper.catalystInstanceBuilder(this)\n        .addNativeModule(uiManager)\n        .addNativeModule(new AndroidInfoModule())\n        .addNativeModule(new DeviceInfoModule(getContext()))\n        .addNativeModule(new AppStateModule(getContext()))\n        .addNativeModule(new FakeWebSocketModule())\n        .build();\n\n    mRootView = new ReactRootView(getContext());\n    mRootTag = uiManager.addRootView(mRootView);\n  }\n\n  public void testViewRenderedWithCorrectProperties() {\n    float expectedOpacity = 0.75f;\n    int expectedBackgroundColor = Color.rgb(255, 0, 0);\n\n    mCatalystInstance.getJSModule(ViewRenderingTestModule.class).renderViewApplication(mRootTag);\n    waitForBridgeAndUIIdle();\n\n    ReactViewGroup view = getViewAtPath(mRootView);\n    assertEquals(\"Incorrect (or not applied) opacity\", expectedOpacity, view.getAlpha());\n    assertEquals(\n        \"Incorrect (or not applied) backgroundColor\",\n        expectedBackgroundColor,\n        view.getBackgroundColor());\n  }\n\n  public void testMarginsApplied() {\n    mCatalystInstance.getJSModule(ViewRenderingTestModule.class).renderMarginApplication(mRootTag);\n    waitForBridgeAndUIIdle();\n\n    View view = getViewAtPath(mRootView);\n\n    int expectedMargin = Math.round(PixelUtil.toPixelFromDIP(10));\n    int expectedMarginLeft = Math.round(PixelUtil.toPixelFromDIP(20));\n\n    assertEquals(expectedMarginLeft, (int) view.getX());\n    assertEquals(expectedMargin, (int) view.getY());\n  }\n\n  public void testMarginUpdateDoesntForgetPreviousValue() {\n    mCatalystInstance.getJSModule(ViewRenderingTestModule.class).renderMarginApplication(mRootTag);\n    waitForBridgeAndUIIdle();\n\n    View view = getViewAtPath(mRootView);\n\n    // before: margin: 10, marginLeft: 20\n    mCatalystInstance.getJSModule(ViewRenderingTestModule.class).updateMargins();\n    waitForBridgeAndUIIdle();\n    // after: margin: 15; it should not forget marginLeft was set to 20\n\n    int expectedMargin = Math.round(PixelUtil.toPixelFromDIP(15));\n    int expectedMarginLeft = Math.round(PixelUtil.toPixelFromDIP(20));\n\n    assertEquals(expectedMarginLeft, (int) view.getX());\n    assertEquals(expectedMargin, (int) view.getY());\n  }\n\n  public void testBordersApplied() {\n    mCatalystInstance.getJSModule(ViewRenderingTestModule.class).renderBorderApplication(mRootTag);\n    waitForBridgeAndUIIdle();\n\n    View view = getViewAtPath(mRootView);\n    View child = ((ViewGroup) view).getChildAt(0);\n\n    int expectedBorderX = Math.round(PixelUtil.toPixelFromDIP(20));\n    int expectedBorderY = Math.round(PixelUtil.toPixelFromDIP(5));\n\n    assertEquals(expectedBorderX, (int) child.getX());\n    assertEquals(expectedBorderY, (int) child.getY());\n  }\n\n  public void testTransformations() {\n    mCatalystInstance.getJSModule(ViewRenderingTestModule.class)\n        .renderTransformApplication(mRootTag);\n    waitForBridgeAndUIIdle();\n\n    View view = getViewAtPath(mRootView);\n\n    float expectedTranslateX = PixelUtil.toPixelFromDIP(20);\n    float expectedTranslateY = PixelUtil.toPixelFromDIP(25);\n\n    assertEquals(5f, view.getScaleX());\n    assertEquals(10f, view.getScaleY());\n    assertEquals(15f, view.getRotation());\n    assertEquals(expectedTranslateX, view.getTranslationX());\n    assertEquals(expectedTranslateY, view.getTranslationY());\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/Asserts.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Asserts\n */\n\n'use strict';\n\nvar Assert = require('NativeModules').Assert;\n\nvar Asserts = {\n  assertEquals: function(expected, actual, msg) {\n    if (expected !== actual) {\n      Assert.fail(\n        msg ||\n        'Expected: ' + expected + ', received: ' + actual + '\\n' +\n        'at ' + (new Error()).stack);\n    } else {\n      Assert.success();\n    }\n  },\n  assertTrue: function(expr, msg) {\n    Asserts.assertEquals(true, expr, msg);\n  },\n};\n\nmodule.exports = Asserts;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CatalystRootViewTestModule\n */\n\n'use strict';\n\nvar React = require('React');\nvar Recording = require('NativeModules').Recording;\nvar View = require('View');\n\nclass CatalystRootViewTestApp extends React.Component {\n  componentWillUnmount() {\n    Recording.record('RootComponentWillUnmount');\n  }\n\n  render() {\n    return <View collapsable={false} style={{alignSelf: 'stretch'}} />;\n  }\n}\n\nmodule.exports = {\n  CatalystRootViewTestApp: CatalystRootViewTestApp,\n};\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DatePickerDialogTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar DatePickerAndroid = require('DatePickerAndroid');\nvar React = require('React');\nvar RecordingModule = require('NativeModules').DatePickerDialogRecordingModule;\nvar View = require('View');\n\nclass DatePickerDialogTestApp extends React.Component {\n  render() {\n    return (<View />);\n  }\n}\n\nvar DatePickerDialogTestModule = {\n  DatePickerDialogTestApp: DatePickerDialogTestApp,\n  showDatePickerDialog: function(options) {\n    DatePickerAndroid.open(options).then(\n      ({action, year, month, day}) => {\n        if (action === DatePickerAndroid.dateSetAction) {\n          RecordingModule.recordDate(year, month, day);\n        } else if (action === DatePickerAndroid.dismissedAction) {\n          RecordingModule.recordDismissed();\n        }\n      },\n      ({code, message}) => RecordingModule.recordError()\n    );\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'DatePickerDialogTestModule',\n  DatePickerDialogTestModule\n);\n\nmodule.exports = DatePickerDialogTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/InitialPropsTestApp.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule InitialPropsTestApp\n */\n\n'use strict';\n\nvar React = require('React');\nvar RecordingModule = require('NativeModules').InitialPropsRecordingModule;\nvar Text = require('Text');\n\nclass InitialPropsTestApp extends React.Component {\n  componentDidMount() {\n    RecordingModule.recordProps(this.props);\n  }\n\n  render() {\n    return <Text>dummy</Text>;\n  }\n}\n\nmodule.exports = InitialPropsTestApp;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/JSResponderTestApp.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule JSResponderTestApp\n */\n'use strict';\n\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar View = require('View');\nvar Text = require('Text');\nvar PanResponder = require('PanResponder');\nvar ScrollView = require('ScrollView');\n\nclass JSResponderTestApp extends React.Component {\n  _handleMoveShouldSetPanResponder = (e, gestureState) => {\n    return Math.abs(gestureState.dx) > 30;\n  };\n\n  componentWillMount() {\n    this.panGesture = PanResponder.create({\n      onMoveShouldSetPanResponder: this._handleMoveShouldSetPanResponder,\n    });\n  }\n\n  render() {\n    var views = [];\n    for (var i = 0; i < 100; i++) {\n      views[i] = (\n        <View key={i} style={styles.row} collapsable={false}>\n          <Text>I am row {i}</Text>\n        </View>\n      );\n    }\n    return (\n      <View\n        style={styles.container}\n        {...this.panGesture.panHandlers}\n        collapsable={false}>\n        <ScrollView style={styles.scrollview} testID=\"scroll_view\">\n          {views}\n        </ScrollView>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  scrollview: {\n    flex: 1,\n  },\n  row: {\n    height: 30,\n  }\n});\n\nmodule.exports = JSResponderTestApp;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule LayoutEventsTestApp\n */\n\n'use strict';\n\nvar React = require('React');\nvar View = require('View');\n\nvar RecordingModule = require('NativeModules').Recording;\n\nconst LAYOUT_SPECS = [\n [10, 10, 100, 100],\n [10, 10, 50, 50],\n [0, 0, 50, 50],\n [0, 0, 50, 50],\n];\n\nclass LayoutEventsTestApp extends React.Component {\n\n  constructor() {\n    super();\n    this.state = {\n      specNumber: 0,\n    };\n    this.numParentLayouts = 0;\n  }\n\n  handleOnLayout = (e) => {\n    var layout = e.nativeEvent.layout;\n    RecordingModule.record(layout.x + ',' + layout.y + '-' + layout.width + 'x' + layout.height);\n\n    if (this.state.specNumber >= LAYOUT_SPECS.length) {\n      // This will cause the test to fail\n      RecordingModule.record('Got an extraneous layout call');\n    } else {\n      this.setState({\n        specNumber: this.state.specNumber + 1,\n      });\n    }\n  };\n\n  handleParentOnLayout = (e) => {\n    if (this.numParentLayouts > 0) {\n      // This will cause the test to fail - the parent's layout doesn't change\n      // so we should only get the event once.\n      RecordingModule.record('Got an extraneous layout call on the parent');\n    }\n    this.numParentLayouts++;\n  };\n\n  render() {\n    const layout = LAYOUT_SPECS[this.state.specNumber];\n    return (\n      <View\n          onLayout={this.handleParentOnLayout}\n          testID=\"parent\"\n          style={{left: 0, top: 0, width: 500, height: 500}}>\n        <View\n            onLayout={this.handleOnLayout}\n            testID=\"container\"\n            style={{left: layout[0], top: layout[1], width: layout[2], height: layout[3]}}/>\n      </View>\n    );\n  }\n}\n\nmodule.exports = LayoutEventsTestApp;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule MeasureLayoutTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar React = require('React');\nvar ReactNative = require('ReactNative');\nvar View = require('View');\nvar StyleSheet = require('StyleSheet');\nvar UIManager = require('UIManager');\n\nvar assertEquals = require('Asserts').assertEquals;\n\nvar styles = StyleSheet.create({\n  A: {\n    'width': 500,\n    'height': 500,\n  },\n  B: {\n    backgroundColor: 'rgb(255, 0, 0)',\n    'left': 50,\n    'top': 80,\n    'width': 200,\n    'height': 300,\n  },\n  C: {\n    backgroundColor: 'rgb(0, 255, 0)',\n    'left': 100,\n    'top': 70,\n    'width': 50,\n    'height': 150,\n  },\n  D: {\n    backgroundColor: 'rgb(0, 0, 255)',\n    'left': 400,\n    'top': 100,\n    'width': 50,\n    'height': 200,\n  },\n});\n\nvar A, B, C, D;\n\nclass MeasureLayoutTestApp extends React.Component {\n  componentDidMount() {\n    A = ReactNative.findNodeHandle(this.refs.A);\n    B = ReactNative.findNodeHandle(this.refs.B);\n    C = ReactNative.findNodeHandle(this.refs.C);\n    D = ReactNative.findNodeHandle(this.refs.D);\n  }\n\n  render() {\n    return (\n      <View ref=\"A\" style={styles.A} collapsable={false}>\n        <View ref=\"B\" style={styles.B} collapsable={false}>\n          <View ref=\"C\" style={styles.C} collapsable={false} />\n        </View>\n        <View ref=\"D\" style={styles.D} collapsable={false} />\n      </View>\n    );\n  }\n}\n\nfunction shouldNotCallThisCallback() {\n  assertEquals(false, true);\n}\n\nvar MeasureLayoutTestModule = {\n  MeasureLayoutTestApp: MeasureLayoutTestApp,\n  verifyMeasureOnViewA: function() {\n    UIManager.measure(A, function(a, b, width, height, x, y) {\n      assertEquals(500, width);\n      assertEquals(500, height);\n      assertEquals(0, x);\n      assertEquals(0, y);\n    });\n  },\n  verifyMeasureOnViewC: function() {\n    UIManager.measure(C, function(a, b, width, height, x, y) {\n      assertEquals(50, width);\n      assertEquals(150, height);\n      assertEquals(150, x);\n      assertEquals(150, y);\n    });\n  },\n  verifyMeasureLayoutCRelativeToA: function() {\n    UIManager.measureLayout(\n      C,\n      A,\n      shouldNotCallThisCallback,\n      function (x, y, width, height) {\n        assertEquals(50, width);\n        assertEquals(150, height);\n        assertEquals(150, x);\n        assertEquals(150, y);\n      });\n  },\n  verifyMeasureLayoutCRelativeToB: function() {\n    UIManager.measureLayout(\n      C,\n      B,\n      shouldNotCallThisCallback,\n      function (x, y, width, height) {\n        assertEquals(50, width);\n        assertEquals(150, height);\n        assertEquals(100, x);\n        assertEquals(70, y);\n      });\n  },\n  verifyMeasureLayoutCRelativeToSelf: function() {\n    UIManager.measureLayout(\n      C,\n      C,\n      shouldNotCallThisCallback,\n      function (x, y, width, height) {\n        assertEquals(50, width);\n        assertEquals(150, height);\n        assertEquals(0, x);\n        assertEquals(0, y);\n      });\n  },\n  verifyMeasureLayoutRelativeToParentOnViewA: function() {\n    UIManager.measureLayoutRelativeToParent(\n      A,\n      shouldNotCallThisCallback,\n      function (x, y, width, height) {\n        assertEquals(500, width);\n        assertEquals(500, height);\n        assertEquals(0, x);\n        assertEquals(0, y);\n      });\n  },\n  verifyMeasureLayoutRelativeToParentOnViewB: function() {\n    UIManager.measureLayoutRelativeToParent(\n      B,\n      shouldNotCallThisCallback,\n      function (x, y, width, height) {\n        assertEquals(200, width);\n        assertEquals(300, height);\n        assertEquals(50, x);\n        assertEquals(80, y);\n      });\n  },\n  verifyMeasureLayoutRelativeToParentOnViewC: function() {\n    UIManager.measureLayoutRelativeToParent(\n      C,\n      shouldNotCallThisCallback,\n      function (x, y, width, height) {\n        assertEquals(50, width);\n        assertEquals(150, height);\n        assertEquals(100, x);\n        assertEquals(70, y);\n      });\n  },\n  verifyMeasureLayoutDRelativeToB: function() {\n    UIManager.measureLayout(\n      D,\n      B,\n      function () {\n        assertEquals(true, true);\n      },\n      shouldNotCallThisCallback);\n  },\n  verifyMeasureLayoutNonExistentTag: function() {\n    UIManager.measureLayout(\n      192,\n      A,\n      function () {\n        assertEquals(true, true);\n      },\n      shouldNotCallThisCallback);\n  },\n  verifyMeasureLayoutNonExistentAncestor: function() {\n    UIManager.measureLayout(\n      B,\n      192,\n      function () {\n        assertEquals(true, true);\n      },\n      shouldNotCallThisCallback);\n  },\n  verifyMeasureLayoutRelativeToParentNonExistentTag: function() {\n    UIManager.measureLayoutRelativeToParent(\n      192,\n      function () {\n        assertEquals(true, true);\n      },\n      shouldNotCallThisCallback);\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'MeasureLayoutTestModule',\n  MeasureLayoutTestModule\n);\n\nmodule.exports = MeasureLayoutTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/MultitouchHandlingTestAppModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule MultitouchHandlingTestAppModule\n */\n\n'use strict';\n\nvar React = require('React');\nvar Recording = require('NativeModules').Recording;\nvar StyleSheet = require('StyleSheet');\nvar TouchEventUtils = require('fbjs/lib/TouchEventUtils');\nvar View = require('View');\n\nclass TouchTestApp extends React.Component {\n  handleStartShouldSetResponder = (e) => {\n    return true;\n  };\n\n  handleOnResponderMove = (e) => {\n    e = TouchEventUtils.extractSingleTouch(e.nativeEvent);\n    Recording.record('move;' + e.touches.length);\n  };\n\n  handleResponderStart = (e) => {\n    e = TouchEventUtils.extractSingleTouch(e.nativeEvent);\n    if (e.touches) {\n      Recording.record('start;' + e.touches.length);\n    } else {\n      Recording.record('start;ExtraPointer');\n    }\n  };\n\n  handleResponderEnd = (e) => {\n    e = TouchEventUtils.extractSingleTouch(e.nativeEvent);\n    if (e.touches) {\n      Recording.record('end;' + e.touches.length);\n    } else {\n      Recording.record('end;ExtraPointer');\n    }\n  };\n\n  render() {\n    return (\n      <View\n        style={styles.container}\n        onStartShouldSetResponder={this.handleStartShouldSetResponder}\n        onResponderMove={this.handleOnResponderMove}\n        onResponderStart={this.handleResponderStart}\n        onResponderEnd={this.handleResponderEnd}\n        collapsable={false}\n      />\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n});\n\nmodule.exports = TouchTestApp;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/NativeIdTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule NativeIdTestModule\n * @flow\n */\n\n'use strict';\n\nconst Image = require('Image');\nconst React = require('React');\nconst StyleSheet = require('StyleSheet');\nconst Text = require('Text');\nconst TextInput = require('TextInput');\nconst TouchableBounce = require('TouchableBounce');\nconst TouchableHighlight = require('TouchableHighlight');\nconst TouchableOpacity = require('TouchableOpacity');\nconst TouchableWithoutFeedback = require('TouchableWithoutFeedback');\nconst View = require('View');\n\n/**\n * All the views implemented on Android, each with the nativeID property set.\n * We test that:\n * - The app renders fine\n * - The nativeID property is passed to the native views\n */\nclass NativeIdTestApp extends React.Component<{}> {\n  render() {\n    const uri = 'data:image/gif;base64,' +\n        'R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapy' +\n        'uvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/' +\n        'TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5' +\n        'iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97V' +\n        'riy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7';\n    return (\n      <View>\n        <Image\n          nativeID=\"Image\"\n          source={{uri: uri}}\n          style={styles.base} />\n        <Text nativeID=\"Text\">text</Text>\n        <TextInput nativeID=\"TextInput\" value=\"Text input\" />\n        <TouchableBounce nativeID=\"TouchableBounce\">\n          <Text>TouchableBounce</Text>\n        </TouchableBounce>\n        <TouchableHighlight nativeID=\"TouchableHighlight\">\n          <Text>TouchableHighlight</Text>\n        </TouchableHighlight>\n        <TouchableOpacity nativeID=\"TouchableOpacity\">\n          <Text>TouchableOpacity</Text>\n        </TouchableOpacity>\n        <TouchableWithoutFeedback nativeID=\"TouchableWithoutFeedback\">\n          <View>\n            <Text>TouchableWithoutFeedback</Text>\n          </View>\n        </TouchableWithoutFeedback>\n        <View nativeID=\"View\" />\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  base: {\n    width: 150,\n    height: 50,\n  },\n});\n\nmodule.exports = {\n  NativeIdTestApp: NativeIdTestApp,\n};\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/PickerAndroidTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PickerAndroidTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar React = require('React');\nvar RecordingModule = require('NativeModules').PickerAndroidRecordingModule;\nvar Picker = require('Picker');\nvar View = require('View');\n\nvar Item = Picker.Item;\n\nvar appInstance;\n\nclass PickerAndroidTestApp extends React.Component {\n  state = {\n    selected: 1,\n    mode: 'dropdown',\n    style: {},\n  };\n\n  componentWillMount() {\n    appInstance = this;\n  }\n\n  render() {\n    return (\n      <View collapsable={false}>\n        <Picker\n          mode=\"dialog\"\n          prompt=\"prompt\"\n          style={this.state.style}\n          selectedValue={this.state.selected}\n          onValueChange={this.onValueChange}>\n          <Item label=\"item1\" color=\"#ff0000\" value={0} />\n          <Item label=\"item2\" color=\"#00ff00\" value={1} />\n          <Item label=\"item3\" color=\"#0000ff\" value={2} />\n        </Picker>\n        <Picker mode={this.state.mode}>\n          <Item label=\"item1\" />\n          <Item label=\"item2\" />\n        </Picker>\n        <Picker enabled={false}>\n          <Item label=\"item1\" />\n          <Item label=\"item2\" />\n        </Picker>\n        <Picker\n          mode=\"dropdown\"\n          selectedValue={this.state.selected}\n          onValueChange={this.onValueChange}>\n          <Item label=\"item in sync 1\" value={0} />\n          <Item label=\"item in sync 2\" value={1} />\n          <Item label=\"item in sync 3\" value={2} />\n        </Picker>\n      </View>\n    );\n  }\n\n  onValueChange = (value) => {\n    this.setState({selected: value});\n    RecordingModule.recordSelection(value);\n  };\n}\n\nvar PickerAndroidTestModule = {\n  PickerAndroidTestApp: PickerAndroidTestApp,\n  selectItem: function(value) {\n    appInstance.setState({selected: value});\n  },\n  setMode: function(mode) {\n    appInstance.setState({mode: mode});\n  },\n  setPrimaryColor: function(color) {\n    appInstance.setState({style: {color}});\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'PickerAndroidTestModule',\n  PickerAndroidTestModule\n);\n\nmodule.exports = PickerAndroidTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/ProgressBarTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ProgressBarTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar React = require('React');\nvar ProgressBar = require('ProgressBarAndroid');\nvar View = require('View');\n\nvar renderApplication = require('renderApplication');\n\nclass ProgressBarSampleApp extends React.Component {\n  state = {};\n\n  render() {\n    return (\n      <View>\n        <ProgressBar styleAttr=\"Horizontal\" testID=\"Horizontal\"/>\n        <ProgressBar styleAttr=\"Small\" testID=\"Small\"/>\n        <ProgressBar styleAttr=\"Large\" testID=\"Large\"/>\n        <ProgressBar styleAttr=\"Normal\" testID=\"Normal\"/>\n        <ProgressBar styleAttr=\"Inverse\" testID=\"Inverse\"/>\n        <ProgressBar styleAttr=\"SmallInverse\" testID=\"SmallInverse\"/>\n        <ProgressBar styleAttr=\"LargeInverse\" testID=\"LargeInverse\"/>\n        <View style={{width:200}}>\n          <ProgressBar styleAttr=\"Horizontal\" testID=\"Horizontal200\" />\n        </View>\n      </View>\n    );\n  }\n}\n\nvar ProgressBarTestModule = {\n  renderProgressBarApplication: function(rootTag) {\n    renderApplication(ProgressBarSampleApp, {}, rootTag);\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'ProgressBarTestModule',\n  ProgressBarTestModule\n);\n\nmodule.exports = ProgressBarTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/ScrollViewTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ScrollViewTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar React = require('React');\nvar createReactClass = require('create-react-class');\nvar View = require('View');\nvar ScrollView = require('ScrollView');\nvar Text = require('Text');\nvar StyleSheet = require('StyleSheet');\nvar TouchableWithoutFeedback = require('TouchableWithoutFeedback');\nvar ScrollListener = require('NativeModules').ScrollListener;\n\nvar NUM_ITEMS = 100;\n\n// Shared by integration tests for ScrollView and HorizontalScrollView\n\nvar scrollViewApp;\n\nclass Item extends React.Component {\n  render() {\n    return (\n      <TouchableWithoutFeedback onPress={this.props.onPress}>\n        <View style={styles.item_container}>\n          <Text style={styles.item_text}>{this.props.text}</Text>\n        </View>\n      </TouchableWithoutFeedback>\n    );\n  }\n}\n\nvar getInitialState = function() {\n  var data = [];\n  for (var i = 0; i < NUM_ITEMS; i++) {\n    data[i] = {text: 'Item ' + i + '!'};\n  }\n  return {\n    data: data,\n  };\n};\n\nvar onScroll = function(e) {\n  ScrollListener.onScroll(e.nativeEvent.contentOffset.x, e.nativeEvent.contentOffset.y);\n};\n\nvar onScrollBeginDrag = function(e) {\n  ScrollListener.onScrollBeginDrag(e.nativeEvent.contentOffset.x, e.nativeEvent.contentOffset.y);\n};\n\nvar onScrollEndDrag = function(e) {\n  ScrollListener.onScrollEndDrag(e.nativeEvent.contentOffset.x, e.nativeEvent.contentOffset.y);\n};\n\nvar onItemPress = function(itemNumber) {\n  ScrollListener.onItemPress(itemNumber);\n};\n\nvar ScrollViewTestApp = createReactClass({\n  displayName: 'ScrollViewTestApp',\n  getInitialState: getInitialState,\n  onScroll: onScroll,\n  onItemPress: onItemPress,\n  onScrollBeginDrag: onScrollBeginDrag,\n  onScrollEndDrag: onScrollEndDrag,\n\n  scrollTo: function(destX, destY) {\n    this.refs.scrollView.scrollTo(destY, destX);\n  },\n\n  render: function() {\n    scrollViewApp = this;\n    var children = this.state.data.map((item, index) => (\n      <Item\n        key={index} text={item.text}\n        onPress={this.onItemPress.bind(this, index)} />\n    ));\n    return (\n      <ScrollView onScroll={this.onScroll} onScrollBeginDrag={this.onScrollBeginDrag} onScrollEndDrag={this.onScrollEndDrag} ref=\"scrollView\">\n        {children}\n      </ScrollView>\n    );\n  },\n});\n\nvar HorizontalScrollViewTestApp = createReactClass({\n  displayName: 'HorizontalScrollViewTestApp',\n  getInitialState: getInitialState,\n  onScroll: onScroll,\n  onItemPress: onItemPress,\n\n  scrollTo: function(destX, destY) {\n    this.refs.scrollView.scrollTo(destY, destX);\n  },\n\n  render: function() {\n    scrollViewApp = this;\n    var children = this.state.data.map((item, index) => (\n      <Item\n        key={index} text={item.text}\n        onPress={this.onItemPress.bind(this, index)} />\n    ));\n    return (\n      <ScrollView horizontal={true} onScroll={this.onScroll} ref=\"scrollView\">\n        {children}\n      </ScrollView>\n    );\n  },\n});\n\nvar styles = StyleSheet.create({\n  item_container: {\n    padding: 30,\n    backgroundColor: '#ffffff',\n  },\n  item_text: {\n    flex: 1,\n    fontSize: 18,\n    alignSelf: 'center',\n  },\n});\n\nvar ScrollViewTestModule = {\n  ScrollViewTestApp: ScrollViewTestApp,\n  HorizontalScrollViewTestApp: HorizontalScrollViewTestApp,\n  scrollTo: function(destX, destY) {\n    scrollViewApp.scrollTo(destX, destY);\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'ScrollViewTestModule',\n  ScrollViewTestModule\n);\n\nmodule.exports = ScrollViewTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/ShareTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ShareTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar React = require('React');\nvar RecordingModule = require('NativeModules').ShareRecordingModule;\nvar Share = require('Share');\nvar View = require('View');\n\nclass ShareTestApp extends React.Component {\n  render() {\n    return (<View />);\n  }\n}\n\nvar ShareTestModule = {\n  ShareTestApp: ShareTestApp,\n  showShareDialog: function(content, options) {\n    Share.share(content, options).then(\n      () => RecordingModule.recordOpened(),\n      ({code, message}) => RecordingModule.recordError()\n    );\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'ShareTestModule',\n  ShareTestModule\n);\n\nmodule.exports = ShareTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SubviewsClippingTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar React = require('React');\nvar ReactNativeViewAttributes = require('ReactNativeViewAttributes');\nvar ScrollView = require('ScrollView');\nvar StyleSheet = require('StyleSheet');\nvar View = require('View');\n\nvar requireNativeComponent = require('requireNativeComponent');\n\nvar ClippableView = requireNativeComponent('ClippableView', null);\n\nclass ClippingSample1 extends React.Component {\n  render() {\n    var styles = sample1Styles;\n    return (\n      <View>\n        <ClippableView clippableViewID=\"outer\" style={styles.outer} removeClippedSubviews={true}>\n          <ClippableView clippableViewID=\"inner1\" style={[styles.inner, styles.inner1]}/>\n          <ClippableView clippableViewID=\"inner2\" style={[styles.inner, styles.inner2]}/>\n          <ClippableView clippableViewID=\"inner3\" style={[styles.inner, styles.inner3]}/>\n          <ClippableView clippableViewID=\"inner4\" style={[styles.inner, styles.inner4]}/>\n          <ClippableView clippableViewID=\"inner5\" style={[styles.inner, styles.inner5]}/>\n        </ClippableView>\n      </View>\n    );\n  }\n}\n\nvar sample1Styles = StyleSheet.create({\n  outer: {\n    width: 200,\n    height: 200,\n    backgroundColor: 'red',\n  },\n  inner: {\n    position: 'absolute',\n    width: 100,\n    height: 100,\n    backgroundColor: 'green',\n  },\n  inner1: {\n    top: -150,\n    left: 50,\n  },\n  inner2: {\n    top: 50,\n    left: 50,\n  },\n  inner3: {\n    top: 250,\n    left: 50,\n  },\n  inner4: {\n    left: -150,\n    top: 50,\n  },\n  inner5: {\n    left: 250,\n    top: 50,\n  },\n});\n\nclass ClippingSample2 extends React.Component {\n  render() {\n    var styles = sample2Styles;\n    return (\n      <View>\n        <ClippableView clippableViewID=\"outer\" style={styles.outer} removeClippedSubviews={true}>\n          <ClippableView\n              clippableViewID=\"complexInner\"\n              style={styles.complexInner}\n              removeClippedSubviews={true}>\n            <ClippableView clippableViewID=\"inner1\" style={[styles.inner, styles.inner1]}/>\n            <ClippableView clippableViewID=\"inner2\" style={[styles.inner, styles.inner2]}/>\n            <ClippableView clippableViewID=\"inner3\" style={[styles.inner, styles.inner3]}/>\n            <ClippableView clippableViewID=\"inner4\" style={[styles.inner, styles.inner4]}/>\n          </ClippableView>\n        </ClippableView>\n      </View>\n    );\n  }\n}\n\nvar sample2Styles = StyleSheet.create({\n  outer: {\n    width: 200,\n    height: 200,\n    backgroundColor: 'red',\n  },\n  complexInner: {\n    position: 'absolute',\n    width: 200,\n    height: 200,\n    left: 100,\n    top: 100,\n    backgroundColor: 'green',\n  },\n  inner: {\n    position: 'absolute',\n    width: 80,\n    height: 80,\n    backgroundColor: 'blue',\n  },\n  inner1: {\n    left: 10,\n    top: 10,\n  },\n  inner2: {\n    right: 10,\n    top: 10,\n  },\n  inner3: {\n    left: 10,\n    bottom: 10,\n  },\n  inner4: {\n    right: 10,\n    bottom: 10,\n  },\n});\n\nclass UpdatingSample1 extends React.Component {\n  render() {\n    var styles = updating1Styles;\n    var inner1Styles = [styles.inner1, {height: this.props.update1 ? 200 : 100}];\n    var inner2Styles = [styles.inner2, {top: this.props.update2 ? 200 : 50}];\n    return (\n      <View>\n        <ClippableView clippableViewID=\"outer\" style={styles.outer} removeClippedSubviews={true}>\n          <ClippableView clippableViewID=\"inner1\" style={inner1Styles}/>\n          <ClippableView clippableViewID=\"inner2\" style={inner2Styles}/>\n        </ClippableView>\n      </View>\n    );\n  }\n}\n\nvar updating1Styles = StyleSheet.create({\n  outer: {\n    width: 200,\n    height: 200,\n    backgroundColor: 'red',\n  },\n  inner1: {\n    position: 'absolute',\n    width: 100,\n    height: 100,\n    left: 50,\n    top: -100,\n    backgroundColor: 'green',\n  },\n  inner2: {\n    position: 'absolute',\n    width: 100,\n    height: 100,\n    left: 50,\n    top: 50,\n    backgroundColor: 'green',\n  }\n});\n\nclass UpdatingSample2 extends React.Component {\n  render() {\n    var styles = updating2Styles;\n    var outerStyles = [styles.outer, {height: this.props.update ? 200 : 100}];\n    return (\n      <View>\n        <ClippableView clippableViewID=\"outer\" style={outerStyles} removeClippedSubviews={true}>\n          <ClippableView clippableViewID=\"inner\" style={styles.inner}/>\n        </ClippableView>\n      </View>\n    );\n  }\n}\n\nvar updating2Styles = StyleSheet.create({\n  outer: {\n    width: 100,\n    height: 100,\n    backgroundColor: 'red',\n  },\n  inner: {\n    position: 'absolute',\n    width: 100,\n    height: 100,\n    top: 100,\n    backgroundColor: 'green',\n  },\n});\n\nclass ScrollViewTest extends React.Component {\n  render() {\n    var styles = scrollTestStyles;\n    var children = [];\n    for (var i = 0; i < 4; i++) {\n      children[i] = (\n        <ClippableView key={i} style={styles.row} clippableViewID={'' + i}/>\n      );\n    }\n    for (var i = 4; i < 6; i++) {\n      var viewID = 'C' + (i - 4);\n      children[i] = (\n        <ClippableView\n            key={i}\n            style={styles.complex}\n            clippableViewID={viewID}\n            removeClippedSubviews={true}>\n          <ClippableView style={styles.inner} clippableViewID={viewID + '.1'}/>\n          <ClippableView style={styles.inner} clippableViewID={viewID + '.2'}/>\n        </ClippableView>\n      );\n    }\n\n    return (\n      <ScrollView removeClippedSubviews={true} style={styles.scrollView} testID=\"scroll_view\">\n        {children}\n      </ScrollView>\n    );\n  }\n}\n\nvar scrollTestStyles = StyleSheet.create({\n  scrollView: {\n    width: 200,\n    height: 300,\n  },\n  row: {\n    flex: 1,\n    height: 120,\n    backgroundColor: 'red',\n    borderColor: 'blue',\n    borderBottomWidth: 1,\n  },\n  complex: {\n    flex: 1,\n    height: 240,\n    backgroundColor: 'yellow',\n    borderColor: 'blue',\n    borderBottomWidth: 1,\n  },\n  inner: {\n    flex: 1,\n    margin: 10,\n    height: 100,\n    backgroundColor: 'gray',\n    borderColor: 'green',\n    borderWidth: 1,\n  },\n});\n\n\nvar appInstance = null;\n\nclass SubviewsClippingTestApp extends React.Component {\n  state = {};\n\n  componentWillMount() {\n    appInstance = this;\n  }\n\n  setComponent = (component) => {\n    this.setState({component: component});\n  };\n\n  render() {\n    var component = this.state.component;\n    return (\n      <View>\n        {component}\n      </View>\n    );\n  }\n}\n\nvar SubviewsClippingTestModule = {\n  App: SubviewsClippingTestApp,\n  renderClippingSample1: function() {\n    appInstance.setComponent(<ClippingSample1/>);\n  },\n  renderClippingSample2: function() {\n    appInstance.setComponent(<ClippingSample2/>);\n  },\n  renderUpdatingSample1: function(update1, update2) {\n    appInstance.setComponent(<UpdatingSample1 update1={update1} update2={update2}/>);\n  },\n  renderUpdatingSample2: function(update) {\n    appInstance.setComponent(<UpdatingSample2 update={update}/>);\n  },\n  renderScrollViewTest: function() {\n    appInstance.setComponent(<ScrollViewTest/>);\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'SubviewsClippingTestModule',\n  SubviewsClippingTestModule\n);\n\nmodule.exports = SubviewsClippingTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SwipeRefreshLayoutTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar React = require('React');\nvar RecordingModule = require('NativeModules').SwipeRefreshLayoutRecordingModule;\nvar ScrollView = require('ScrollView');\nvar RefreshControl = require('RefreshControl');\nvar Text = require('Text');\nvar TouchableWithoutFeedback = require('TouchableWithoutFeedback');\nvar View = require('View');\n\nclass Row extends React.Component {\n  state = {\n    clicks: 0,\n  };\n\n  render() {\n    return (\n      <TouchableWithoutFeedback onPress={this._onPress}>\n        <View>\n          <Text>\n            {this.state.clicks + ' clicks'}\n          </Text>\n        </View>\n      </TouchableWithoutFeedback>\n    );\n  }\n\n  _onPress = () => {\n    this.setState({clicks: this.state.clicks + 1});\n  };\n}\n\nvar app = null;\n\nclass SwipeRefreshLayoutTestApp extends React.Component {\n  state = {\n    rows: 2,\n  };\n\n  componentDidMount() {\n    app = this;\n  }\n\n  render() {\n    var rows = [];\n    for (var i = 0; i < this.state.rows; i++) {\n      rows.push(<Row key={i} />);\n    }\n    return (\n      <ScrollView\n        style={{flex: 1}}\n        refreshControl={\n          <RefreshControl\n            style={{flex: 1}}\n            refreshing={false}\n            onRefresh={() => RecordingModule.onRefresh()}\n          />\n        }>\n        {rows}\n      </ScrollView>\n    );\n  }\n}\n\nvar SwipeRefreshLayoutTestModule = {\n  SwipeRefreshLayoutTestApp,\n  setRows: function(rows) {\n    if (app != null) {\n      app.setState({rows});\n    }\n  }\n};\n\nBatchedBridge.registerCallableModule(\n  'SwipeRefreshLayoutTestModule',\n  SwipeRefreshLayoutTestModule\n);\n\nmodule.exports = SwipeRefreshLayoutTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/TestBundle.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TestBundle\n */\n'use strict';\n\n// Disable YellowBox so we do not have to mock its dependencies\nconsole.disableYellowBox = true;\n\n// Include callable JS modules first, in case one of the other ones below throws\nrequire('ProgressBarTestModule');\nrequire('ViewRenderingTestModule');\nrequire('TestJavaToJSArgumentsModule');\nrequire('TestJSLocaleModule');\nrequire('TestJSToJavaParametersModule');\nrequire('TestJavaToJSReturnValuesModule');\nrequire('UIManagerTestModule');\n\nrequire('CatalystRootViewTestModule');\nrequire('DatePickerDialogTestModule');\nrequire('MeasureLayoutTestModule');\nrequire('PickerAndroidTestModule');\nrequire('ScrollViewTestModule');\nrequire('ShareTestModule');\nrequire('SwipeRefreshLayoutTestModule');\nrequire('TextInputTestModule');\nrequire('TimePickerDialogTestModule');\n\n\n// Define catalyst test apps used in integration tests\nvar AppRegistry = require('AppRegistry');\n\nvar apps = [\n{\n  appKey: 'CatalystRootViewTestApp',\n  component: () => require('CatalystRootViewTestModule').CatalystRootViewTestApp\n},\n{\n  appKey: 'DatePickerDialogTestApp',\n  component: () => require('DatePickerDialogTestModule').DatePickerDialogTestApp\n},\n{\n  appKey: 'JSResponderTestApp',\n  component: () => require('JSResponderTestApp'),\n},\n{\n  appKey: 'HorizontalScrollViewTestApp',\n  component: () => require('ScrollViewTestModule').HorizontalScrollViewTestApp,\n},\n{\n  appKey: 'InitialPropsTestApp',\n  component: () => require('InitialPropsTestApp'),\n},\n{\n  appKey: 'LayoutEventsTestApp',\n  component: () => require('LayoutEventsTestApp'),\n},\n{\n  appKey: 'MeasureLayoutTestApp',\n  component: () => require('MeasureLayoutTestModule').MeasureLayoutTestApp\n},\n{\n  appKey: 'MultitouchHandlingTestAppModule',\n  component: () => require('MultitouchHandlingTestAppModule')\n},\n{\n  appKey: 'NativeIdTestApp',\n  component: () => require('NativeIdTestModule').NativeIdTestApp\n},\n{\n  appKey: 'PickerAndroidTestApp',\n  component: () => require('PickerAndroidTestModule').PickerAndroidTestApp,\n},\n{\n  appKey: 'ScrollViewTestApp',\n  component: () => require('ScrollViewTestModule').ScrollViewTestApp,\n},\n{\n  appKey: 'ShareTestApp',\n  component: () => require('ShareTestModule').ShareTestApp,\n},\n{\n  appKey: 'SubviewsClippingTestApp',\n  component: () => require('SubviewsClippingTestModule').App,\n},\n{\n  appKey: 'SwipeRefreshLayoutTestApp',\n  component: () => require('SwipeRefreshLayoutTestModule').SwipeRefreshLayoutTestApp\n},\n{\n  appKey: 'TextInputTestApp',\n  component: () => require('TextInputTestModule').TextInputTestApp\n},\n{\n  appKey: 'TestIdTestApp',\n  component: () => require('TestIdTestModule').TestIdTestApp\n},\n{\n  appKey: 'TimePickerDialogTestApp',\n  component: () => require('TimePickerDialogTestModule').TimePickerDialogTestApp\n},\n{\n  appKey: 'TouchBubblingTestAppModule',\n  component: () => require('TouchBubblingTestAppModule')\n},\n\n];\n\n\nmodule.exports = apps;\nAppRegistry.registerConfig(apps);\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/TestIdTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TestIdTestModule\n */\n\n'use strict';\n\nvar Image = require('Image');\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar Switch = require('Switch');\nvar Text = require('Text');\nvar TextInput = require('TextInput');\nvar TouchableBounce = require('TouchableBounce');\nvar TouchableHighlight = require('TouchableHighlight');\nvar TouchableOpacity = require('TouchableOpacity');\nvar TouchableWithoutFeedback = require('TouchableWithoutFeedback');\nvar View = require('View');\n\n/**\n * All the views implemented on Android, each with the testID property set.\n * We test that:\n * - The app renders fine\n * - The testID property is passed to the native views\n */\nclass TestIdTestApp extends React.Component {\n  render() {\n    return (\n      <View>\n\n        <Image\n          testID=\"Image\"\n          source={{uri: 'data:image/gif;base64,' +\n              'R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapy' +\n              'uvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/' +\n              'TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5' +\n              'iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97V' +\n              'riy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7'}}\n          style={styles.base} />\n\n        <Text testID=\"Text\">text</Text>\n\n        <TextInput testID=\"TextInput\" value=\"Text input\" />\n\n        <TouchableBounce testID=\"TouchableBounce\">\n          <Text>TouchableBounce</Text>\n        </TouchableBounce>\n\n        <TouchableHighlight testID=\"TouchableHighlight\">\n          <Text>TouchableHighlight</Text>\n        </TouchableHighlight>\n\n        <TouchableOpacity testID=\"TouchableOpacity\">\n          <Text>TouchableOpacity</Text>\n        </TouchableOpacity>\n\n        <TouchableWithoutFeedback testID=\"TouchableWithoutFeedback\">\n          <View>\n            <Text>TouchableWithoutFeedback</Text>\n          </View>\n        </TouchableWithoutFeedback>\n\n        <View testID=\"View\" />\n\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  base: {\n    width: 150,\n    height: 50,\n  },\n});\n\nmodule.exports = {\n  TestIdTestApp: TestIdTestApp,\n};\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/TestJSLocaleModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TestJSLocaleModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar Recording = require('NativeModules').Recording;\n\nvar TestJSLocaleModule = {\n  toUpper: function(s) {\n    Recording.record(s.toUpperCase());\n  },\n  toLower: function(s) {\n    Recording.record(s.toLowerCase());\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'TestJSLocaleModule',\n  TestJSLocaleModule\n);\n\nmodule.exports = TestJSLocaleModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TestJSToJavaParametersModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar Recording = require('NativeModules').Recording;\n\nvar TestJSToJavaParametersModule = {\n  returnBasicTypes: function() {\n    Recording.receiveBasicTypes('foo', 3.14, true, null);\n  },\n  returnBoxedTypes: function() {\n    Recording.receiveBoxedTypes(42, 3.14, true);\n  },\n  returnDynamicTypes: function() {\n    Recording.receiveDynamic('foo');\n    Recording.receiveDynamic(3.14);\n  },\n  returnArrayWithBasicTypes: function() {\n    Recording.receiveArray(['foo', 3.14, -111, true, null]);\n  },\n  returnNestedArray: function() {\n    Recording.receiveArray(['we', ['have', ['to', ['go', ['deeper']]]]]);\n  },\n  returnArrayWithMaps: function() {\n    Recording.receiveArray([{m1k1: 'm1v1', m1k2: 'm1v2'}, {m2k1: 'm2v1'}]);\n  },\n  returnMapWithBasicTypes: function() {\n    Recording.receiveMap({\n      stringKey: 'stringValue',\n      doubleKey: 3.14,\n      intKey: -11,\n      booleanKey: true,\n      nullKey: null,\n    });\n  },\n  returnNestedMap: function() {\n    Recording.receiveMap({\n      weHaveToGoDeeper: {\n        inception: true,\n      },\n    });\n  },\n  returnMapWithArrays: function() {\n    Recording.receiveMap({\n      'empty': [],\n      'ints': [43, 44],\n      'mixed': [77, 'string', ['another', 'array']],\n    });\n  },\n  returnArrayWithStringDoubleIntMapArrayBooleanNull: function() {\n    Recording.receiveArray(['string', 3.14, 555, {}, [], true, null]);\n  },\n  returnMapWithStringDoubleIntMapArrayBooleanNull: function() {\n    Recording.receiveMap({\n      string: 'string',\n      double: 3,\n      map: {},\n      int: -55,\n      array: [],\n      boolean: true,\n      null: null\n    });\n  },\n  returnArrayWithLargeInts: function() {\n    Recording.receiveArray([2147483648, -5555555555]);\n  },\n  returnMapWithLargeInts: function() {\n    Recording.receiveMap({first: -2147483649, second: 5551231231});\n  },\n  returnMapForMerge1: function() {\n    Recording.receiveMap({\n      a: 1,\n      b: 41,\n      c: 'string',\n      d: 'other string',\n      e: [1,'foo','bar'],\n      f: null,\n    });\n  },\n  returnMapForMerge2: function() {\n    Recording.receiveMap({\n      a: 'overwrite',\n      d: 77,\n      e: null,\n      f: ['array', 'with', 'stuff'],\n      newkey: 'newvalue',\n    });\n  },\n  returnMapWithMultibyteUTF8CharacterString: function() {\n    Recording.receiveMap({\n      'one-byte': 'a',\n      'two-bytes': '\\u00A2',\n      'three-bytes': '\\u20AC',\n      'four-bytes': '\\uD83D\\uDE1C',\n      'mixed': '\\u017C\\u00F3\\u0142\\u0107 g\\u0119\\u015Bl\\u0105 \\u6211 \\uD83D\\uDE0E ja\\u017A\\u0107'\n    });\n  },\n  returnArrayWithMultibyteUTF8CharacterString: function() {\n    Recording.receiveArray([\n      'a',\n      '\\u00A2',\n      '\\u20AC',\n      '\\uD83D\\uDE1C',\n      '\\u017C\\u00F3\\u0142\\u0107 g\\u0119\\u015Bl\\u0105 \\u6211 \\uD83D\\uDE0E ja\\u017A\\u0107'\n    ]);\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'TestJSToJavaParametersModule',\n  TestJSToJavaParametersModule\n);\n\nmodule.exports = TestJSToJavaParametersModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TestJavaToJSArgumentsModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar {assertEquals, assertTrue} = require('Asserts');\n\nfunction strictStringCompare(a, b) {\n  if (typeof a !== 'string' || typeof b !== 'string' || a.length !== b.length) {\n    return false;\n  }\n  for (var i = 0; i < a.length; i++) {\n    if (a.charCodeAt(i) !== b.charCodeAt(i)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction assertStrictStringEquals(a, b) {\n  assertTrue(\n    strictStringCompare(a,b),\n    'Expected: ' + a + ', received: ' + b);\n}\n\nvar TestJavaToJSArgumentsModule = {\n  receiveBasicTypes: function(str, dbl, bool, null_arg) {\n    assertEquals('foo', str);\n    assertEquals(3.14, dbl);\n    assertEquals(true, bool);\n    assertEquals(null, null_arg);\n  },\n  receiveArrayWithBasicTypes: function(arr) {\n    assertEquals(4, arr.length);\n    assertEquals('red panda', arr[0]);\n    assertEquals(1.19, arr[1]);\n    assertEquals(true, arr[2]);\n    assertEquals(null, arr[3]);\n  },\n  receiveNestedArray: function(arr) {\n    assertEquals(2, arr.length);\n    assertEquals('level1', arr[0]);\n    var arr2 = arr[1];\n    assertEquals('level2', arr2[0]);\n    var arr3 = arr2[1];\n    assertEquals('level3', arr3[0]);\n  },\n  receiveArrayWithMaps: function(arr) {\n    assertEquals(2, arr.length);\n    var m1 = arr[0];\n    var m2 = arr[1];\n    assertEquals('m1v1', m1.m1k1);\n    assertEquals('m1v2', m1.m1k2);\n    assertEquals('m2v1', m2.m2k1);\n  },\n  receiveMapWithBasicTypes: function(map) {\n    assertEquals('stringValue', map.stringKey);\n    assertEquals(3.14, map.doubleKey);\n    assertEquals(true, map.booleanKey);\n    assertEquals(null, map.nullKey);\n  },\n  receiveNestedMap: function(map) {\n    var nestedMap = map.nestedMap;\n    assertEquals('foxes', nestedMap.animals);\n  },\n  receiveMapWithArrays: function(map) {\n    var a1 = map.array1;\n    var a2 = map.array2;\n    assertEquals(3, a1.length);\n    assertEquals(2, a2.length);\n    assertEquals(3, a1[0]);\n    assertEquals(9, a2[1]);\n  },\n  receiveMapAndArrayWithNullValues: function(map, array) {\n    assertEquals(null, map.string);\n    assertEquals(null, map.array);\n    assertEquals(null, map.map);\n\n    assertEquals(null, array[0]);\n    assertEquals(null, array[1]);\n    assertEquals(null, array[2]);\n  },\n  receiveMapWithMultibyteUTF8CharacterString: function(map) {\n    assertStrictStringEquals('\\u00A2', map['two-bytes']);\n    assertStrictStringEquals('\\u20AC', map['three-bytes']);\n    assertStrictStringEquals('\\uD83D\\uDE1C', map['four-bytes']);\n    assertStrictStringEquals(\n      '\\u017C\\u00F3\\u0142\\u0107 g\\u0119\\u015Bl\\u0105 \\u6211 \\uD83D\\uDE0E ja\\u017A\\u0107',\n      map.mixed);\n  },\n  receiveArrayWithMultibyteUTF8CharacterString: function(array) {\n    assertTrue(true);\n    assertStrictStringEquals('\\u00A2', array[0]);\n    assertStrictStringEquals('\\u20AC', array[1]);\n    assertStrictStringEquals('\\uD83D\\uDE1C', array[2]);\n    assertStrictStringEquals(\n      '\\u017C\\u00F3\\u0142\\u0107 g\\u0119\\u015Bl\\u0105 \\u6211 \\uD83D\\uDE0E ja\\u017A\\u0107',\n      array[3]);\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'TestJavaToJSArgumentsModule',\n  TestJavaToJSArgumentsModule\n);\n\nmodule.exports = TestJavaToJSArgumentsModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TestJavaToJSReturnValuesModule\n */\n\n'use strict';\n\nconst BatchedBridge = require('BatchedBridge');\n\nconst {assertEquals, assertTrue} = require('Asserts');\nconst {TestModule} = require('NativeModules');\n\nvar TestJavaToJSReturnValuesModule = {\n  callMethod: function(methodName, expectedType, expectedJSON) {\n    const result = TestModule[methodName]();\n    assertEquals(expectedType, typeof result);\n    assertEquals(expectedJSON, JSON.stringify(result));\n  },\n\n  triggerException: function() {\n    try {\n      TestModule.triggerException();\n    } catch (ex) {\n      assertTrue(ex.message.indexOf('Exception triggered') !== -1);\n    }\n  }\n};\n\nBatchedBridge.registerCallableModule(\n  'TestJavaToJSReturnValuesModule',\n  TestJavaToJSReturnValuesModule\n);\n\nmodule.exports = TestJavaToJSReturnValuesModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/TextInputTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TextInputTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar Text = require('Text');\nvar TextInput = require('TextInput');\nvar View = require('View');\n\nvar Recording = require('NativeModules').Recording;\n\nvar app;\n\nclass TokenizedTextExample extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {text: ''};\n  }\n  render() {\n\n    //define delimiter\n    let delimiter = /\\s+/;\n\n    //split string\n    let _text = this.state.text;\n    let token, index, parts = [];\n    while (_text) {\n      delimiter.lastIndex = 0;\n      token = delimiter.exec(_text);\n      if (token === null) {\n        break;\n      }\n      index = token.index;\n      if (token[0].length === 0) {\n        index = 1;\n      }\n      parts.push(_text.substr(0, index));\n      parts.push(token[0]);\n      index = index + token[0].length;\n      _text = _text.slice(index);\n    }\n    parts.push(_text);\n\n    //highlight hashtags\n    parts = parts.map((text) => {\n      if (/^#/.test(text)) {\n        return <Text key={text} style={styles.hashtag}>{text}</Text>;\n      } else {\n        return text;\n      }\n    });\n\n    return (\n      <View>\n        <TextInput\n          ref=\"tokenizedInput\"\n          testID=\"tokenizedInput\"\n          multiline={true}\n          style={styles.multiline}\n          onChangeText={(text) => {\n            this.setState({text});\n          }}>\n          <Text>{parts}</Text>\n        </TextInput>\n      </View>\n    );\n  }\n}\n\nclass TextInputTestApp extends React.Component {\n  componentDidMount() {\n    app = this;\n  }\n\n  handleOnSubmitEditing = (record) => {\n    Recording.record(record);\n  };\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <TextInput\n          style={styles.textInputHeight}\n          autoCorrect={true}\n          autoFocus={true}\n          keyboardType=\"numeric\"\n          multiline={true}\n          secureTextEntry={true}\n          defaultValue=\"This is text\"\n          testID=\"textInput1\"\n        />\n        <TextInput\n          style={styles.textInput}\n          autoCapitalize=\"sentences\"\n          autoCorrect={false}\n          autoFocus={false}\n          keyboardType=\"default\"\n          multiline={false}\n          secureTextEntry={false}\n          placeholder=\"1234\"\n          testID=\"textInput2\"\n        />\n        <TextInput\n          ref=\"textInput3\"\n          style={styles.textInput}\n          defaultValue=\"Hello, World\"\n          testID=\"textInput3\"\n        />\n        <TextInput\n          ref=\"textInput4\"\n          style={[styles.textInput, {color: '#00ff00'}]}\n          testID=\"textInput4\"\n        />\n        <TextInput\n          ref=\"textInput5\"\n          style={[styles.textInput, {color: '#00ff00'}]}\n          defaultValue=\"\"\n          testID=\"textInput5\"\n        />\n        <TextInput\n          ref=\"textInput6\"\n          style={[styles.textInput, {color: '#00ff00'}]}\n          defaultValue=\"Text\"\n          testID=\"textInput6\"\n        />\n        <TextInput\n          ref=\"onSubmitTextInput\"\n          onSubmitEditing={this.handleOnSubmitEditing.bind(this, 'onSubmit')}\n          defaultValue=\"\"\n          testID=\"onSubmitTextInput\"\n        />\n        <TokenizedTextExample />\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    padding: 5,\n    margin: 10,\n  },\n  textInputHeight: {\n    fontSize: 21,\n    height: 30,\n  },\n  textInput: {\n    fontSize: 21,\n    padding: 0,\n  },\n  hashtag: {\n    color: 'blue',\n    fontWeight: 'bold',\n  },\n});\n\nvar TextInputTestModule = {\n  TextInputTestApp,\n  setValueRef: function(ref, value) {\n    app.refs[ref].setNativeProps({\n      text: value,\n    });\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'TextInputTestModule',\n  TextInputTestModule\n);\n\nmodule.exports = TextInputTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/TimePickerDialogTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TimePickerDialogTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar TimePickerAndroid = require('TimePickerAndroid');\nvar React = require('React');\nvar RecordingModule = require('NativeModules').TimePickerDialogRecordingModule;\nvar View = require('View');\n\nclass TimePickerDialogTestApp extends React.Component {\n  render() {\n    return <View />;\n  }\n}\n\nvar TimePickerDialogTestModule = {\n  TimePickerDialogTestApp: TimePickerDialogTestApp,\n  showTimePickerDialog: function(options) {\n    TimePickerAndroid.open(options).then(\n      ({action, hour, minute}) => {\n        if (action === TimePickerAndroid.timeSetAction) {\n          RecordingModule.recordTime(hour, minute);\n        } else if (action === TimePickerAndroid.dismissedAction) {\n          RecordingModule.recordDismissed();\n        }\n      },\n      ({code, message}) => RecordingModule.recordError()\n    );\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'TimePickerDialogTestModule',\n  TimePickerDialogTestModule\n);\n\nmodule.exports = TimePickerDialogTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule TouchBubblingTestAppModule\n */\n\n'use strict';\n\nvar Recording = require('NativeModules').Recording;\n\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar View = require('View');\nvar TouchableWithoutFeedback = require('TouchableWithoutFeedback');\n\nclass TouchBubblingTestApp extends React.Component {\n  handlePress = (record) => {\n    Recording.record(record);\n  };\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <TouchableWithoutFeedback onPress={this.handlePress.bind(this, 'outer')} testID=\"D\">\n          <View style={styles.outer}>\n            <TouchableWithoutFeedback onPress={this.handlePress.bind(this, 'inner')} testID=\"B\">\n              <View style={styles.inner}>\n                <View style={styles.superinner} testID=\"A\" />\n              </View>\n            </TouchableWithoutFeedback>\n            <View style={styles.inner} testID=\"C\" />\n          </View>\n        </TouchableWithoutFeedback>\n        <TouchableWithoutFeedback onPress={this.handlePress.bind(this, 'outsider')} testID=\"E\">\n          <View style={styles.element} />\n        </TouchableWithoutFeedback>\n      </View>\n    );\n  }\n}\n\nvar styles = StyleSheet.create({\n  container: {\n    flexDirection: 'column',\n    backgroundColor: '#ccdd44',\n  },\n  element: {\n    backgroundColor: '#ff0000',\n    height: 100,\n    margin: 30,\n  },\n  outer: {\n    backgroundColor: '#00ff00',\n    height: 100,\n    margin: 30,\n    flexDirection: 'row',\n    justifyContent: 'space-between',\n  },\n  inner: {\n    backgroundColor: '#0000ff',\n    height: 50,\n    width: 50,\n    margin: 10,\n  },\n  superinner: {\n    backgroundColor: '#eeeeee',\n    height: 20,\n    width: 20,\n  }\n});\n\nmodule.exports = TouchBubblingTestApp;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/UIManagerTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule UIManagerTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar React = require('React');\nvar StyleSheet = require('StyleSheet');\nvar View = require('View');\nvar Text = require('Text');\n\nvar createReactClass = require('create-react-class');\nvar renderApplication = require('renderApplication');\n\nvar FlexTestApp = createReactClass({\n  displayName: 'FlexTestApp',\n  _styles: StyleSheet.create({\n    container: {\n      width: 200,\n      height: 200,\n      flexDirection: 'row',\n    },\n    child: {\n      flex: 1,\n    },\n    absolute: {\n      position: 'absolute',\n      top: 15,\n      left: 10,\n      width: 50,\n      height: 60,\n    }\n  }),\n  render: function() {\n    return (\n      <View style={this._styles.container} testID=\"container\" collapsable={false}>\n        <View style={[this._styles.child, {backgroundColor: '#ff0000'}]} collapsable={false}/>\n        <View style={[this._styles.child, {backgroundColor: '#0000ff'}]} collapsable={false}/>\n      </View>\n    );\n  }\n});\n\nvar FlexWithText = createReactClass({\n  displayName: 'FlexWithText',\n  _styles: StyleSheet.create({\n    container: {\n      flexDirection: 'column',\n      margin: 20,\n    },\n    row: {\n      flexDirection: 'row',\n      alignItems: 'flex-end',\n      height: 300,\n    },\n    inner: {\n      flex: 1,\n      margin: 10,\n    },\n  }),\n  render: function() {\n    return (\n      <View style={this._styles.container} testID=\"container\" collapsable={false}>\n        <View style={this._styles.row} collapsable={false}>\n          <Text style={this._styles.inner}>Hello</Text>\n          <Text style={this._styles.inner}>World</Text>\n        </View>\n      </View>\n    );\n  }\n});\n\nvar AbsolutePositionTestApp = createReactClass({\n  displayName: 'AbsolutePositionTestApp',\n  _styles: StyleSheet.create({\n    absolute: {\n      position: 'absolute',\n      top: 15,\n      left: 10,\n      width: 50,\n      height: 60,\n    }\n  }),\n  render: function() {\n    return <View style={this._styles.absolute} testID=\"absolute\" collapsable={false}/>;\n  }\n});\n\nvar AbsolutePositionBottomRightTestApp = createReactClass({\n  displayName: 'AbsolutePositionBottomRightTestApp',\n  _styles: StyleSheet.create({\n    container: {\n      width: 100,\n      height: 100,\n    },\n    absolute: {\n      position: 'absolute',\n      bottom: 15,\n      right: 10,\n      width: 50,\n      height: 60,\n    }\n  }),\n  render: function() {\n    return (\n      <View style={this._styles.container} testID=\"container\" collapsable={false}>\n        <View style={this._styles.absolute} collapsable={false}/>\n      </View>\n    );\n  }\n});\n\nvar CenteredTextView = createReactClass({\n  displayName: 'CenteredTextView',\n  _styles: StyleSheet.create({\n    parent: {\n      width: 200,\n      height: 100,\n      backgroundColor: '#aa3311',\n      justifyContent: 'center',\n      alignItems: 'center',\n    },\n    text: {\n      fontSize: 15,\n      color: '#672831',\n    },\n  }),\n  render: function() {\n    return (\n      <View collapsable={false}>\n        <View style={this._styles.parent} collapsable={false}>\n          <Text style={this._styles.text} testID=\"text\">{this.props.text}</Text>\n        </View>\n      </View>\n    );\n  }\n});\n\nvar flushUpdatePositionInList = null;\nvar UpdatePositionInListTestApp = createReactClass({\n  displayName: 'UpdatePositionInListTestApp',\n  _styles: StyleSheet.create({\n    element: {\n      height: 10,\n    },\n    active: {\n      height: 50,\n    }\n  }),\n  getInitialState: function() {\n    flushUpdatePositionInList = () => this.setState({ active: true });\n    return { active: false };\n  },\n  render: function() {\n    return (\n      <View collapsable={false} testID=\"container\">\n        <View style={this._styles.element} collapsable={false} />\n        <View\n          style={[\n            this._styles.element,\n            this.state.active && this._styles.active,\n          ]}\n          collapsable={false}\n        />\n        <View style={this._styles.element} collapsable={false}/>\n      </View>\n    );\n  }\n});\n\nvar UIManagerTestModule = {\n  renderFlexTestApplication: function(rootTag) {\n    renderApplication(FlexTestApp, {}, rootTag);\n  },\n  renderFlexWithTextApplication: function(rootTag) {\n    renderApplication(FlexWithText, {}, rootTag);\n  },\n  renderAbsolutePositionBottomRightTestApplication: function(rootTag) {\n    renderApplication(AbsolutePositionBottomRightTestApp, {}, rootTag);\n  },\n  renderAbsolutePositionTestApplication: function(rootTag) {\n    renderApplication(AbsolutePositionTestApp, {}, rootTag);\n  },\n  renderCenteredTextViewTestApplication: function(rootTag, text) {\n    renderApplication(CenteredTextView, {text: text}, rootTag);\n  },\n  renderUpdatePositionInListTestApplication: function(rootTag) {\n    renderApplication(UpdatePositionInListTestApp, {}, rootTag);\n  },\n  flushUpdatePositionInList: function() {\n    flushUpdatePositionInList();\n  }\n};\n\nBatchedBridge.registerCallableModule(\n  'UIManagerTestModule',\n  UIManagerTestModule\n);\n\nmodule.exports = UIManagerTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/androidTest/js/ViewRenderingTestModule.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ViewRenderingTestModule\n */\n\n'use strict';\n\nvar BatchedBridge = require('BatchedBridge');\nvar React = require('React');\nvar View = require('View');\nvar StyleSheet = require('StyleSheet');\n\nvar renderApplication = require('renderApplication');\n\nvar styles = StyleSheet.create({\n  view: {\n    opacity: 0.75,\n    backgroundColor: 'rgb(255, 0, 0)',\n  },\n});\n\nclass ViewSampleApp extends React.Component {\n  state = {};\n\n  render() {\n    return (\n      <View style={styles.view} collapsable={false}/>\n    );\n  }\n}\n\nvar updateMargins;\n\nclass MarginSampleApp extends React.Component {\n  state = {margin: 10};\n\n  render() {\n    updateMargins = this.setState.bind(this, {margin: 15});\n    return (\n      <View style={{margin: this.state.margin, marginLeft: 20}} collapsable={false}/>\n    );\n  }\n}\n\nclass BorderSampleApp extends React.Component {\n  render() {\n    return (\n      <View style={{borderLeftWidth: 20, borderWidth: 5, backgroundColor: 'blue'}} collapsable={false}>\n        <View style={{backgroundColor: 'red', width: 20, height: 20}} collapsable={false}/>\n      </View>\n    );\n  }\n}\n\nclass TransformSampleApp extends React.Component {\n  render() {\n    var style = {\n      transform: [\n        {translateX: 20},\n        {translateY: 25},\n        {rotate: '15deg'},\n        {scaleX: 5},\n        {scaleY: 10},\n      ]\n    };\n    return (\n      <View style={style} collapsable={false}/>\n    );\n  }\n}\n\nvar ViewRenderingTestModule = {\n  renderViewApplication: function(rootTag) {\n    renderApplication(ViewSampleApp, {}, rootTag);\n  },\n  renderMarginApplication: function(rootTag) {\n    renderApplication(MarginSampleApp, {}, rootTag);\n  },\n  renderBorderApplication: function(rootTag) {\n    renderApplication(BorderSampleApp, {}, rootTag);\n  },\n  renderTransformApplication: function(rootTag) {\n    renderApplication(TransformSampleApp, {}, rootTag);\n  },\n  updateMargins: function() {\n    updateMargins();\n  },\n};\n\nBatchedBridge.registerCallableModule(\n  'ViewRenderingTestModule',\n  ViewRenderingTestModule\n);\n\nmodule.exports = ViewRenderingTestModule;\n"
  },
  {
    "path": "ReactAndroid/src/main/android_res/com/facebook/catalyst/appcompat/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\n# used by ReactToolbarManager because of Gradle\n# TODO t10182713 will be replaced with appcompat-orig when we stop using Gradle\nandroid_resource(\n    name = \"appcompat\",\n    package = \"com.facebook.react\",\n    res = react_native_dep(\"third-party/android/support/v7/appcompat-orig:res-unpacker-cmd\"),\n    visibility = [\"//ReactAndroid/...\"],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"yoga\",\n    srcs = glob([\"yoga/*.java\"]),\n    visibility = [\"PUBLIC\"],\n    deps = [\n        react_native_dep(\"java/com/facebook/proguard/annotations:annotations\"),\n        react_native_dep(\"libraries/soloader/java/com/facebook/soloader:soloader\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/debug/debugoverlay/model/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"model\",\n    srcs = glob([\"*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/debug/debugoverlay/model/DebugOverlayTag.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.debug.debugoverlay.model;\n\nimport javax.annotation.concurrent.Immutable;\n\n/** Tag for a debug overlay log message. Name must be unique. */\n@Immutable\npublic class DebugOverlayTag {\n\n  /** Name of tag. */\n  public final String name;\n\n  /** Description to display in settings. */\n  public final String description;\n\n  /** Color for tag display. */\n  public final int color;\n\n  public DebugOverlayTag(String name, String description, int color) {\n    this.name = name;\n    this.description = description;\n    this.color = color;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/debug/holder/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"holder\",\n    srcs = glob([\"*.java\"]),\n    exported_deps = [\n        react_native_dep(\"java/com/facebook/debug/debugoverlay/model:model\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/debug/holder/NoopPrinter.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.debug.holder;\n\nimport com.facebook.debug.debugoverlay.model.DebugOverlayTag;\n\n/** No-op implementation of {@link Printer}. */\npublic class NoopPrinter implements Printer {\n\n  public static final NoopPrinter INSTANCE = new NoopPrinter();\n\n  private NoopPrinter() {}\n\n  @Override\n  public void logMessage(DebugOverlayTag tag, String message, Object... args) {}\n\n  @Override\n  public void logMessage(DebugOverlayTag tag, String message) {}\n\n  @Override\n  public boolean shouldDisplayLogMessage(final DebugOverlayTag tag) {\n    return false;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/debug/holder/Printer.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.debug.holder;\n\nimport com.facebook.debug.debugoverlay.model.DebugOverlayTag;\n\n/** Interface to debugging tool. */\npublic interface Printer {\n\n  void logMessage(final DebugOverlayTag tag, final String message, Object... args);\n  void logMessage(final DebugOverlayTag tag, final String message);\n  boolean shouldDisplayLogMessage(final DebugOverlayTag tag);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/debug/holder/PrinterHolder.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.debug.holder;\n\n/** Holder for debugging tool instance. */\npublic class PrinterHolder {\n\n  private static Printer sPrinter = NoopPrinter.INSTANCE;\n\n  public static void setPrinter(Printer printer) {\n    if (printer == null) {\n      sPrinter = NoopPrinter.INSTANCE;\n    } else {\n      sPrinter = printer;\n    }\n  }\n\n  public static Printer getPrinter() {\n    return sPrinter;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/debug/tags/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"tags\",\n    srcs = glob([\"*.java\"]),\n    exported_deps = [\n        react_native_dep(\"java/com/facebook/debug/debugoverlay/model:model\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/debug/tags/ReactDebugOverlayTags.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.debug.tags;\n\nimport android.graphics.Color;\nimport com.facebook.debug.debugoverlay.model.DebugOverlayTag;\n\n/** Category for debug overlays. */\npublic class ReactDebugOverlayTags {\n\n  public static final DebugOverlayTag PERFORMANCE =\n      new DebugOverlayTag(\"Performance\", \"Markers for Performance\", Color.GREEN);\n  public static final DebugOverlayTag NAVIGATION =\n      new DebugOverlayTag(\"Navigation\", \"Tag for navigation\", Color.rgb(0x9C, 0x27, 0xB0));\n  public static final DebugOverlayTag RN_CORE =\n      new DebugOverlayTag(\"RN Core\", \"Tag for React Native Core\", Color.BLACK);\n  public static final DebugOverlayTag BRIDGE_CALLS =\n      new DebugOverlayTag(\n          \"Bridge Calls\", \"JS to Java calls (warning: this is spammy)\", Color.MAGENTA);\n  public static final DebugOverlayTag NATIVE_MODULE =\n      new DebugOverlayTag(\"Native Module\", \"Native Module init\", Color.rgb(0x80, 0x00, 0x80));\n  public static final DebugOverlayTag UI_MANAGER =\n      new DebugOverlayTag(\n          \"UI Manager\",\n          \"UI Manager View Operations (requires restart\\nwarning: this is spammy)\",\n          Color.CYAN);\n  public static final DebugOverlayTag RELAY =\n      new DebugOverlayTag(\"Relay\", \"including prefetching\", Color.rgb(0xFF, 0x99, 0x00));\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"jni\",\n    srcs = glob([\"**/*.java\"]),\n    proguard_config = \"fbjni.pro\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"java/com/facebook/proguard/annotations:annotations\"),\n        react_native_dep(\"libraries/soloader/java/com/facebook/soloader:soloader\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/Countable.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.jni;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.soloader.SoLoader;\n\n/**\n * A Java Object that has native memory allocated corresponding to this instance.\n *\n * NB: THREAD SAFETY (this comment also exists at Countable.cpp)\n *\n * {@link #dispose} deletes the corresponding native object on whatever thread the method is called\n * on. In the common case when this is called by Countable#finalize(), this will be called on the\n * system finalizer thread. If you manually call dispose on the Java object, the native object\n * will be deleted synchronously on that thread.\n */\n@DoNotStrip\npublic class Countable {\n\n  static {\n    SoLoader.loadLibrary(\"fb\");\n  }\n\n  // Private C++ instance\n  @DoNotStrip\n  private long mInstance = 0;\n\n  public native void dispose();\n\n  protected void finalize() throws Throwable {\n    dispose();\n    super.finalize();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/CpuCapabilitiesJni.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.jni;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.soloader.SoLoader;\n\n/**\n * Utility class to determine CPU capabilities\n */\n@DoNotStrip\npublic class CpuCapabilitiesJni {\n\n  static {\n    SoLoader.loadLibrary(\"fb\");\n  }\n\n  @DoNotStrip\n  public static native boolean nativeDeviceSupportsNeon();\n\n  @DoNotStrip\n  public static native boolean nativeDeviceSupportsVFPFP16();\n\n  @DoNotStrip\n  public static native boolean nativeDeviceSupportsX86();\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/DestructorThread.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.jni;\n\nimport java.lang.ref.PhantomReference;\nimport java.lang.ref.ReferenceQueue;\nimport java.util.concurrent.atomic.AtomicReference;\n\n/**\n * A thread which invokes the \"destruct\" routine for objects after they have been garbage collected.\n *\n * An object which needs to be destructed should create a static subclass of {@link Destructor}.\n * Once the referent object is garbage collected, the DestructorThread will callback to the\n * {@link Destructor#destruct()} method.\n *\n * The underlying thread in DestructorThread starts when the first Destructor is constructed\n * and then runs indefinitely.\n */\npublic class DestructorThread {\n\n  /**\n   * N.B The Destructor <b>SHOULD NOT</b> refer back to its referent object either explicitly or\n   * implicitly (for example, as a non-static inner class). This will create a reference cycle where\n   * the referent object will never be garbage collected.\n   */\n  public abstract static class Destructor extends PhantomReference<Object> {\n\n    private Destructor next;\n    private Destructor previous;\n\n    Destructor(Object referent) {\n      super(referent, sReferenceQueue);\n      sDestructorStack.push(this);\n    }\n\n    private Destructor() {\n      super(null, sReferenceQueue);\n    }\n\n    /** Callback which is invoked when the original object has been garbage collected. */\n    abstract void destruct();\n  }\n\n  /** A list to keep all active Destructors in memory confined to the Destructor thread. */\n  private static DestructorList sDestructorList;\n  /** A thread safe stack where new Destructors are placed before being add to sDestructorList. */\n  private static DestructorStack sDestructorStack;\n  private static ReferenceQueue sReferenceQueue;\n  private static Thread sThread;\n\n  static {\n    sDestructorStack = new DestructorStack();\n    sReferenceQueue = new ReferenceQueue();\n    sDestructorList = new DestructorList();\n    sThread = new Thread(\"HybridData DestructorThread\") {\n      @Override\n      public void run() {\n        while (true) {\n          try {\n            Destructor current = (Destructor) sReferenceQueue.remove();\n            current.destruct();\n\n            // If current is in the sDestructorStack,\n            // transfer all the Destructors in the stack to the list.\n            if (current.previous == null) {\n              sDestructorStack.transferAllToList();\n            }\n\n            DestructorList.drop(current);\n          } catch (InterruptedException e) {\n            // Continue. This thread should never be terminated.\n          }\n        }\n      }\n    };\n\n    sThread.start();\n  }\n\n  private static class Terminus extends Destructor {\n    @Override\n    void destruct() {\n      throw new IllegalStateException(\"Cannot destroy Terminus Destructor.\");\n    }\n  }\n\n  /** This is a thread safe, lock-free Treiber-like Stack of Destructors. */\n  private static class DestructorStack {\n    private AtomicReference<Destructor> mHead = new AtomicReference<>();\n\n    public void push(Destructor newHead) {\n      Destructor oldHead;\n      do {\n        oldHead = mHead.get();\n        newHead.next = oldHead;\n      } while (!mHead.compareAndSet(oldHead, newHead));\n    }\n\n    public void transferAllToList() {\n      Destructor current = mHead.getAndSet(null);\n      while (current != null) {\n        Destructor next = current.next;\n        sDestructorList.enqueue(current);\n        current = next;\n      }\n    }\n  }\n\n  /** A doubly-linked list of Destructors. */\n  private static class DestructorList {\n    private Destructor mHead;\n\n    public DestructorList() {\n      mHead = new Terminus();\n      mHead.next = new Terminus();\n      mHead.next.previous = mHead;\n    }\n\n    public void enqueue(Destructor current) {\n      current.next = mHead.next;\n      mHead.next = current;\n\n      current.next.previous = current;\n      current.previous = mHead;\n    }\n\n    private static void drop(Destructor current) {\n      current.next.previous = current.previous;\n      current.previous.next = current.next;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/HybridClassBase.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.jni;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic abstract class HybridClassBase extends HybridData {\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/HybridData.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.jni;\n\nimport android.util.Log;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.soloader.SoLoader;\n\n/**\n * This object holds a native C++ member for hybrid Java/C++ objects.\n *\n * NB: THREAD SAFETY\n *\n * {@link #resetNative} deletes the corresponding native object synchronously on whatever thread\n * the method is called on. Otherwise, deletion will occur on the {@link DestructorThread}\n * thread.\n */\n@DoNotStrip\npublic class HybridData {\n\n  static {\n    SoLoader.loadLibrary(\"fb\");\n  }\n\n  @DoNotStrip\n  private Destructor mDestructor = new Destructor(this);\n\n  /**\n   * To explicitly delete the instance, call resetNative().  If the C++\n   * instance is referenced after this is called, a NullPointerException will\n   * be thrown.  resetNative() may be called multiple times safely.  Because\n   * the {@link DestructorThread} also calls resetNative, the instance will not leak if this is\n   * not called, but timing of deletion and the thread the C++ dtor is called\n   * on will be at the whim of the Java GC.  If you want to control the thread\n   * and timing of the destructor, you should call resetNative() explicitly.\n   */\n  public synchronized void resetNative() {\n    mDestructor.destruct();\n  }\n\n  /**\n   * N.B. Thread safety.\n   * If you call isValid from a different thread than {@link #resetNative()} then be sure to\n   * do so while synchronizing on the hybrid. For example:\n   * <pre><code>\n   * synchronized(hybrid) {\n   *   if (hybrid.isValid) {\n   *     // Do stuff.\n   *   }\n   * }\n   * </code></pre>\n   */\n  public boolean isValid() {\n    return mDestructor.mNativePointer != 0;\n  }\n\n  public static class Destructor extends DestructorThread.Destructor {\n\n    // Private C++ instance\n    @DoNotStrip\n    private long mNativePointer;\n\n    Destructor(Object referent) {\n      super(referent);\n    }\n\n    @Override\n    void destruct() {\n      // When invoked from the DestructorThread instead of resetNative,\n      // the DestructorThread has exclusive ownership of the HybridData\n      // so synchronization is not necessary.\n      deleteNative(mNativePointer);\n      mNativePointer = 0;\n    }\n\n    static native void deleteNative(long pointer);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/IteratorHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.jni;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Iterator;\n\n/**\n * To iterate over an Iterator from C++ requires two calls per entry: hasNext()\n * and next().  This helper reduces it to one call and one field get per entry.\n * It does not use a generic argument, since in C++, the types will be erased,\n * anyway.  This is *not* a {@link java.util.Iterator}.\n */\n@DoNotStrip\npublic class IteratorHelper {\n  private final Iterator mIterator;\n\n  // This is private, but accessed via JNI.\n  @DoNotStrip\n  private @Nullable Object mElement;\n\n  @DoNotStrip\n  public IteratorHelper(Iterator iterator) {\n    mIterator = iterator;\n  }\n\n  @DoNotStrip\n  public IteratorHelper(Iterable iterable) {\n    mIterator = iterable.iterator();\n  }\n\n  /**\n   * Moves the helper to the next entry in the map, if any.  Returns true iff\n   * there is an entry to read.\n   */\n  @DoNotStrip\n  boolean hasNext() {\n    if (mIterator.hasNext()) {\n      mElement = mIterator.next();\n      return true;\n    } else {\n      mElement = null;\n      return false;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/JniTerminateHandler.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.jni;\n\npublic class JniTerminateHandler {\n  public static void handleTerminate(Throwable t) throws Throwable {\n    Thread.UncaughtExceptionHandler h = Thread.getDefaultUncaughtExceptionHandler();\n    if (h == null) {\n      // Odd. Let the default std::terminate_handler deal with it.\n      return;\n    }\n    h.uncaughtException(Thread.currentThread(), t);\n    // That should exit. If it doesn't, let the default handler deal with it.\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/MapIteratorHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.jni;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Iterator;\nimport java.util.Map;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * To iterate over a Map from C++ requires four calls per entry: hasNext(),\n * next(), getKey(), getValue().  This helper reduces it to one call and two\n * field gets per entry.  It does not use a generic argument, since in C++, the\n * types will be erased, anyway.  This is *not* a {@link java.util.Iterator}.\n */\n@DoNotStrip\npublic class MapIteratorHelper {\n  @DoNotStrip private final Iterator<Map.Entry> mIterator;\n  @DoNotStrip private @Nullable Object mKey;\n  @DoNotStrip private @Nullable Object mValue;\n\n  @DoNotStrip\n  public MapIteratorHelper(Map map) {\n    mIterator = map.entrySet().iterator();\n  }\n\n  /**\n   * Moves the helper to the next entry in the map, if any.  Returns true iff\n   * there is an entry to read.\n   */\n  @DoNotStrip\n  boolean hasNext() {\n    if (mIterator.hasNext()) {\n      Map.Entry entry = mIterator.next();\n      mKey = entry.getKey();\n      mValue = entry.getValue();\n      return true;\n    } else {\n      mKey = null;\n      mValue = null;\n      return false;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/NativeRunnable.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.jni;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * A Runnable that has a native run implementation.\n */\n@DoNotStrip\npublic class NativeRunnable implements Runnable {\n\n  private final HybridData mHybridData;\n\n  private NativeRunnable(HybridData hybridData) {\n    mHybridData = hybridData;\n  }\n\n  public native void run();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/ThreadScopeSupport.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.jni;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.soloader.SoLoader;\n\n@DoNotStrip\npublic class ThreadScopeSupport {\n  static {\n    SoLoader.loadLibrary(\"fb\");\n  }\n\n  // This is just used for ThreadScope::withClassLoader to have a java function\n  // in the stack so that jni has access to the correct classloader.\n  @DoNotStrip\n  private static void runStdFunction(long ptr) {\n    runStdFunctionImpl(ptr);\n  }\n\n  private static native void runStdFunctionImpl(long ptr);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/jni/fbjni.pro",
    "content": "# For common use cases for the hybrid pattern, keep symbols which may\n# be referenced only from C++.\n\n-keepclassmembers class * {\n    com.facebook.jni.HybridData *;\n    <init>(com.facebook.jni.HybridData);\n}\n\n-keepclasseswithmembers class * {\n    com.facebook.jni.HybridData *;\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/perftest/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"perftest\",\n    srcs = glob([\"*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/proguard/annotations/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"annotations\",\n    srcs = glob([\"*.java\"]),\n    proguard_config = \"proguard_annotations.pro\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"react\",\n    srcs = glob([\"*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"java/com/facebook/systrace:systrace\"),\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"libraries/soloader/java/com/facebook/soloader:soloader\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/debug/holder:holder\"),\n        react_native_target(\"java/com/facebook/debug/tags:tags\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/devsupport:devsupport\"),\n        react_native_target(\"java/com/facebook/react/devsupport:interfaces\"),\n        react_native_target(\"java/com/facebook/react/jstasks:jstasks\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/module/model:model\"),\n        react_native_target(\"java/com/facebook/react/modules/appregistry:appregistry\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/modules/debug:debug\"),\n        react_native_target(\"java/com/facebook/react/modules/debug:interfaces\"),\n        react_native_target(\"java/com/facebook/react/modules/deviceinfo:deviceinfo\"),\n        react_native_target(\"java/com/facebook/react/modules/systeminfo:systeminfo\"),\n        react_native_target(\"java/com/facebook/react/modules/toast:toast\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/views/imagehelper:imagehelper\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/CompositeReactPackage.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.ListIterator;\nimport java.util.Map;\nimport java.util.Set;\nimport javax.annotation.Nullable;\n\n/**\n * {@code CompositeReactPackage} allows to create a single package composed of views and modules\n * from several other packages.\n */\npublic class CompositeReactPackage extends ReactInstancePackage\n    implements ViewManagerOnDemandReactPackage {\n\n  private final List<ReactPackage> mChildReactPackages = new ArrayList<>();\n\n  /**\n   * The order in which packages are passed matters. It may happen that a NativeModule or\n   * or a ViewManager exists in two or more ReactPackages. In that case the latter will win\n   * i.e. the latter will overwrite the former. This re-occurrence is detected by\n   * comparing a name of a module.\n   */\n  public CompositeReactPackage(ReactPackage arg1, ReactPackage arg2, ReactPackage... args) {\n    mChildReactPackages.add(arg1);\n    mChildReactPackages.add(arg2);\n\n    Collections.addAll(mChildReactPackages, args);\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {\n    // This is for backward compatibility.\n    final Map<String, NativeModule> moduleMap = new HashMap<>();\n    for (ReactPackage reactPackage: mChildReactPackages) {\n      for (NativeModule nativeModule: reactPackage.createNativeModules(reactContext)) {\n        moduleMap.put(nativeModule.getName(), nativeModule);\n      }\n    }\n    return new ArrayList<>(moduleMap.values());\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public List<NativeModule> createNativeModules(\n      ReactApplicationContext reactContext,\n      ReactInstanceManager reactInstanceManager) {\n    final Map<String, NativeModule> moduleMap = new HashMap<>();\n    for (ReactPackage reactPackage: mChildReactPackages) {\n      List<NativeModule> nativeModules;\n      if (reactPackage instanceof ReactInstancePackage) {\n        ReactInstancePackage reactInstancePackage = (ReactInstancePackage) reactPackage;\n        nativeModules = reactInstancePackage.createNativeModules(\n            reactContext,\n            reactInstanceManager);\n      } else {\n        nativeModules = reactPackage.createNativeModules(reactContext);\n      }\n      for (NativeModule nativeModule: nativeModules) {\n        moduleMap.put(nativeModule.getName(), nativeModule);\n      }\n    }\n    return new ArrayList<>(moduleMap.values());\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {\n    final Map<String, ViewManager> viewManagerMap = new HashMap<>();\n    for (ReactPackage reactPackage: mChildReactPackages) {\n      for (ViewManager viewManager: reactPackage.createViewManagers(reactContext)) {\n        viewManagerMap.put(viewManager.getName(), viewManager);\n      }\n    }\n    return new ArrayList<>(viewManagerMap.values());\n  }\n\n  /** {@inheritDoc} */\n  @Override\n  public List<String> getViewManagerNames(\n      ReactApplicationContext reactContext, boolean loadClasses) {\n    Set<String> uniqueNames = new HashSet<>();\n    for (ReactPackage reactPackage : mChildReactPackages) {\n      if (reactPackage instanceof ViewManagerOnDemandReactPackage) {\n        List<String> names =\n            ((ViewManagerOnDemandReactPackage) reactPackage)\n                .getViewManagerNames(reactContext, loadClasses);\n        if (names != null) {\n          uniqueNames.addAll(names);\n        }\n      }\n    }\n    return new ArrayList<>(uniqueNames);\n  }\n\n  /** {@inheritDoc} */\n  @Override\n  public @Nullable ViewManager createViewManager(\n      ReactApplicationContext reactContext, String viewManagerName, boolean loadClasses) {\n    ListIterator<ReactPackage> iterator = mChildReactPackages.listIterator(mChildReactPackages.size());\n    while (iterator.hasPrevious()) {\n      ReactPackage reactPackage = iterator.previous();\n      if (reactPackage instanceof ViewManagerOnDemandReactPackage) {\n        ViewManager viewManager =\n            ((ViewManagerOnDemandReactPackage) reactPackage)\n                .createViewManager(reactContext, viewManagerName, loadClasses);\n        if (viewManager != null) {\n          return viewManager;\n        }\n      }\n    }\n    return null;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport static com.facebook.react.bridge.ReactMarkerConstants.CREATE_UI_MANAGER_MODULE_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.CREATE_UI_MANAGER_MODULE_START;\nimport static com.facebook.react.bridge.ReactMarkerConstants.PROCESS_CORE_REACT_PACKAGE_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.PROCESS_CORE_REACT_PACKAGE_START;\n\nimport com.facebook.react.bridge.ModuleSpec;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactMarker;\nimport com.facebook.react.module.annotations.ReactModuleList;\nimport com.facebook.react.module.model.ReactModuleInfoProvider;\nimport com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;\nimport com.facebook.react.modules.core.DeviceEventManagerModule;\nimport com.facebook.react.modules.core.ExceptionsManagerModule;\nimport com.facebook.react.modules.core.HeadlessJsTaskSupportModule;\nimport com.facebook.react.modules.core.Timing;\nimport com.facebook.react.modules.debug.SourceCodeModule;\nimport com.facebook.react.modules.deviceinfo.DeviceInfoModule;\nimport com.facebook.react.modules.systeminfo.AndroidInfoModule;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.systrace.Systrace;\nimport java.util.Arrays;\nimport java.util.List;\nimport javax.annotation.Nullable;\nimport javax.inject.Provider;\n\n/**\n * This is the basic module to support React Native. The debug modules are now in DebugCorePackage.\n */\n@ReactModuleList(\n  nativeModules = {\n    AndroidInfoModule.class,\n    DeviceEventManagerModule.class,\n    DeviceInfoModule.class,\n    ExceptionsManagerModule.class,\n    HeadlessJsTaskSupportModule.class,\n    SourceCodeModule.class,\n    Timing.class,\n    UIManagerModule.class,\n  }\n)\n/* package */ class CoreModulesPackage extends LazyReactPackage implements ReactPackageLogger {\n\n  private final ReactInstanceManager mReactInstanceManager;\n  private final DefaultHardwareBackBtnHandler mHardwareBackBtnHandler;\n  private final UIImplementationProvider mUIImplementationProvider;\n  private final boolean mLazyViewManagersEnabled;\n  private final int mMinTimeLeftInFrameForNonBatchedOperationMs;\n\n  CoreModulesPackage(\n      ReactInstanceManager reactInstanceManager,\n      DefaultHardwareBackBtnHandler hardwareBackBtnHandler,\n      UIImplementationProvider uiImplementationProvider,\n      boolean lazyViewManagersEnabled,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    mReactInstanceManager = reactInstanceManager;\n    mHardwareBackBtnHandler = hardwareBackBtnHandler;\n    mUIImplementationProvider = uiImplementationProvider;\n    mLazyViewManagersEnabled = lazyViewManagersEnabled;\n    mMinTimeLeftInFrameForNonBatchedOperationMs = minTimeLeftInFrameForNonBatchedOperationMs;\n  }\n\n  @Override\n  public List<ModuleSpec> getNativeModules(final ReactApplicationContext reactContext) {\n    return Arrays.asList(\n        ModuleSpec.nativeModuleSpec(\n            AndroidInfoModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new AndroidInfoModule();\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            DeviceEventManagerModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new DeviceEventManagerModule(reactContext, mHardwareBackBtnHandler);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            ExceptionsManagerModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new ExceptionsManagerModule(mReactInstanceManager.getDevSupportManager());\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            HeadlessJsTaskSupportModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new HeadlessJsTaskSupportModule(reactContext);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            SourceCodeModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new SourceCodeModule(reactContext);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            Timing.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new Timing(reactContext, mReactInstanceManager.getDevSupportManager());\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            UIManagerModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return createUIManager(reactContext);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            DeviceInfoModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new DeviceInfoModule(reactContext);\n              }\n            }));\n  }\n\n  @Override\n  public ReactModuleInfoProvider getReactModuleInfoProvider() {\n    // This has to be done via reflection or we break open source.\n    return LazyReactPackage.getReactModuleInfoProviderViaReflection(this);\n  }\n\n  private UIManagerModule createUIManager(final ReactApplicationContext reactContext) {\n    ReactMarker.logMarker(CREATE_UI_MANAGER_MODULE_START);\n    Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"createUIManagerModule\");\n    try {\n      if (mLazyViewManagersEnabled) {\n        UIManagerModule.ViewManagerResolver resolver = new UIManagerModule.ViewManagerResolver() {\n          @Override\n          public @Nullable ViewManager getViewManager(String viewManagerName) {\n            return mReactInstanceManager.createViewManager(viewManagerName);\n          }\n          @Override\n          public List<String> getViewManagerNames() {\n            return mReactInstanceManager.getViewManagerNames();\n          }\n        };\n\n        return new UIManagerModule(\n            reactContext,\n            resolver,\n            mUIImplementationProvider,\n            mMinTimeLeftInFrameForNonBatchedOperationMs);\n      } else {\n        return new UIManagerModule(\n            reactContext,\n            mReactInstanceManager.createAllViewManagers(reactContext),\n            mUIImplementationProvider,\n            mMinTimeLeftInFrameForNonBatchedOperationMs);\n      }\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n      ReactMarker.logMarker(CREATE_UI_MANAGER_MODULE_END);\n    }\n  }\n\n  @Override\n  public void startProcessPackage() {\n    ReactMarker.logMarker(PROCESS_CORE_REACT_PACKAGE_START);\n  }\n\n  @Override\n  public void endProcessPackage() {\n    ReactMarker.logMarker(PROCESS_CORE_REACT_PACKAGE_END);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport com.facebook.react.bridge.ModuleSpec;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.devsupport.JSCHeapCapture;\nimport com.facebook.react.devsupport.JSCSamplingProfiler;\nimport com.facebook.react.module.annotations.ReactModuleList;\nimport com.facebook.react.module.model.ReactModuleInfoProvider;\nimport java.util.ArrayList;\nimport java.util.List;\nimport javax.inject.Provider;\n\n/**\n * Package defining core framework modules (e.g. UIManager). It should be used for modules that\n * require special integration with other framework parts (e.g. with the list of packages to load\n * view managers from).\n */\n@ReactModuleList(\n  nativeModules = {\n    JSCHeapCapture.class,\n    JSCSamplingProfiler.class,\n  }\n)\n/* package */ class DebugCorePackage extends LazyReactPackage {\n\n  DebugCorePackage() {\n  }\n\n  @Override\n  public List<ModuleSpec> getNativeModules(final ReactApplicationContext reactContext) {\n    List<ModuleSpec> moduleSpecList = new ArrayList<>();\n    moduleSpecList.add(\n        ModuleSpec.nativeModuleSpec(\n            JSCHeapCapture.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new JSCHeapCapture(reactContext);\n              }\n            }));\n    moduleSpecList.add(\n        ModuleSpec.nativeModuleSpec(\n            JSCSamplingProfiler.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new JSCSamplingProfiler(reactContext);\n              }\n            }));\n    return moduleSpecList;\n  }\n\n  @Override\n  public ReactModuleInfoProvider getReactModuleInfoProvider() {\n    return LazyReactPackage.getReactModuleInfoProviderViaReflection(this);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/EagerModuleProvider.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react;\n\nimport javax.inject.Provider;\n\nimport com.facebook.react.bridge.NativeModule;\n\n/**\n * Provider for an already initialized and non-lazy NativeModule.\n */\npublic class EagerModuleProvider implements Provider<NativeModule> {\n\n  private final NativeModule mModule;\n\n  public EagerModuleProvider(NativeModule module) {\n    mModule = module;\n  }\n\n  @Override\n  public NativeModule get() {\n    return mModule;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/HeadlessJsTaskService.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Set;\nimport java.util.concurrent.CopyOnWriteArraySet;\n\nimport android.app.Service;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.IBinder;\nimport android.os.PowerManager;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.jstasks.HeadlessJsTaskEventListener;\nimport com.facebook.react.jstasks.HeadlessJsTaskConfig;\nimport com.facebook.react.jstasks.HeadlessJsTaskContext;\n\n/**\n * Base class for running JS without a UI. Generally, you only need to override\n * {@link #getTaskConfig}, which is called for every {@link #onStartCommand}. The\n * result, if not {@code null}, is used to run a JS task.\n *\n * If you need more fine-grained control over how tasks are run, you can override\n * {@link #onStartCommand} and call {@link #startTask} depending on your custom logic.\n *\n * If you're starting a {@code HeadlessJsTaskService} from a {@code BroadcastReceiver} (e.g.\n * handling push notifications), make sure to call {@link #acquireWakeLockNow} before returning from\n * {@link BroadcastReceiver#onReceive}, to make sure the device doesn't go to sleep before the\n * service is started.\n */\npublic abstract class HeadlessJsTaskService extends Service implements HeadlessJsTaskEventListener {\n\n  private final Set<Integer> mActiveTasks = new CopyOnWriteArraySet<>();\n  private static @Nullable PowerManager.WakeLock sWakeLock;\n\n  @Override\n  public int onStartCommand(Intent intent, int flags, int startId) {\n    HeadlessJsTaskConfig taskConfig = getTaskConfig(intent);\n    if (taskConfig != null) {\n      startTask(taskConfig);\n      return START_REDELIVER_INTENT;\n    }\n    return START_NOT_STICKY;\n  }\n\n  /**\n   * Called from {@link #onStartCommand} to create a {@link HeadlessJsTaskConfig} for this intent.\n   * @param intent the {@link Intent} received in {@link #onStartCommand}.\n   * @return a {@link HeadlessJsTaskConfig} to be used with {@link #startTask}, or\n   *         {@code null} to ignore this command.\n   */\n  protected @Nullable HeadlessJsTaskConfig getTaskConfig(Intent intent) {\n    return null;\n  }\n\n  /**\n   * Acquire a wake lock to ensure the device doesn't go to sleep while processing background tasks.\n   */\n  public static void acquireWakeLockNow(Context context) {\n    if (sWakeLock == null || !sWakeLock.isHeld()) {\n      PowerManager powerManager =\n        Assertions.assertNotNull((PowerManager) context.getSystemService(POWER_SERVICE));\n      sWakeLock = powerManager.newWakeLock(\n        PowerManager.PARTIAL_WAKE_LOCK,\n        HeadlessJsTaskService.class.getSimpleName());\n      sWakeLock.setReferenceCounted(false);\n      sWakeLock.acquire();\n    }\n  }\n\n  @Override\n  public @Nullable IBinder onBind(Intent intent) {\n    return null;\n  }\n\n  /**\n   * Start a task. This method handles starting a new React instance if required.\n   *\n   * Has to be called on the UI thread.\n   *\n   * @param taskConfig describes what task to start and the parameters to pass to it\n   */\n  protected void startTask(final HeadlessJsTaskConfig taskConfig) {\n    UiThreadUtil.assertOnUiThread();\n    acquireWakeLockNow(this);\n    final ReactInstanceManager reactInstanceManager =\n      getReactNativeHost().getReactInstanceManager();\n    ReactContext reactContext = reactInstanceManager.getCurrentReactContext();\n    if (reactContext == null) {\n      reactInstanceManager\n        .addReactInstanceEventListener(new ReactInstanceManager.ReactInstanceEventListener() {\n          @Override\n          public void onReactContextInitialized(ReactContext reactContext) {\n            invokeStartTask(reactContext, taskConfig);\n            reactInstanceManager.removeReactInstanceEventListener(this);\n          }\n        });\n      if (!reactInstanceManager.hasStartedCreatingInitialContext()) {\n        reactInstanceManager.createReactContextInBackground();\n      }\n    } else {\n      invokeStartTask(reactContext, taskConfig);\n    }\n  }\n\n  private void invokeStartTask(ReactContext reactContext, final HeadlessJsTaskConfig taskConfig) {\n    final HeadlessJsTaskContext headlessJsTaskContext = HeadlessJsTaskContext.getInstance(reactContext);\n    headlessJsTaskContext.addTaskEventListener(this);\n\n    UiThreadUtil.runOnUiThread(\n      new Runnable() {\n        @Override\n        public void run() {\n          int taskId = headlessJsTaskContext.startTask(taskConfig);\n          mActiveTasks.add(taskId);\n        }\n      }\n    );\n  }\n\n  @Override\n  public void onDestroy() {\n    super.onDestroy();\n\n    if (getReactNativeHost().hasInstance()) {\n      ReactInstanceManager reactInstanceManager = getReactNativeHost().getReactInstanceManager();\n      ReactContext reactContext = reactInstanceManager.getCurrentReactContext();\n      if (reactContext != null) {\n        HeadlessJsTaskContext headlessJsTaskContext =\n          HeadlessJsTaskContext.getInstance(reactContext);\n        headlessJsTaskContext.removeTaskEventListener(this);\n      }\n    }\n    if (sWakeLock != null) {\n      sWakeLock.release();\n    }\n  }\n\n  @Override\n  public void onHeadlessJsTaskStart(int taskId) { }\n\n  @Override\n  public void onHeadlessJsTaskFinish(int taskId) {\n    mActiveTasks.remove(taskId);\n    if (mActiveTasks.size() == 0) {\n      stopSelf();\n    }\n  }\n\n  /**\n   * Get the {@link ReactNativeHost} used by this app. By default, assumes {@link #getApplication()}\n   * is an instance of {@link ReactApplication} and calls\n   * {@link ReactApplication#getReactNativeHost()}. Override this method if your application class\n   * does not implement {@code ReactApplication} or you simply have a different mechanism for\n   * storing a {@code ReactNativeHost}, e.g. as a static field somewhere.\n   */\n  protected ReactNativeHost getReactNativeHost() {\n    return ((ReactApplication) getApplication()).getReactNativeHost();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/LazyReactPackage.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport com.facebook.react.bridge.ModuleSpec;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactMarker;\nimport com.facebook.react.bridge.ReactMarkerConstants;\nimport com.facebook.react.module.model.ReactModuleInfoProvider;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.systrace.SystraceMessage;\n\nimport static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;\n\n/**\n * React package supporting lazy creation of native modules.\n *\n * TODO(t11394819): Make this default and deprecate ReactPackage\n */\npublic abstract class LazyReactPackage implements ReactPackage {\n\n  public static ReactModuleInfoProvider getReactModuleInfoProviderViaReflection(\n      LazyReactPackage lazyReactPackage) {\n    Class<?> reactModuleInfoProviderClass;\n    try {\n      reactModuleInfoProviderClass = Class.forName(\n          lazyReactPackage.getClass().getCanonicalName() + \"$$ReactModuleInfoProvider\");\n    } catch (ClassNotFoundException e) {\n      throw new RuntimeException(e);\n    }\n\n    if (reactModuleInfoProviderClass == null) {\n      throw new RuntimeException(\"ReactModuleInfoProvider class for \" +\n          lazyReactPackage.getClass().getCanonicalName() + \" not found.\");\n    }\n\n    try {\n      return (ReactModuleInfoProvider) reactModuleInfoProviderClass.newInstance();\n    } catch (InstantiationException e) {\n      throw new RuntimeException(\n          \"Unable to instantiate ReactModuleInfoProvider for \" + lazyReactPackage.getClass(),\n          e);\n    } catch (IllegalAccessException e) {\n      throw new RuntimeException(\n          \"Unable to instantiate ReactModuleInfoProvider for \" + lazyReactPackage.getClass(),\n          e);\n    }\n  }\n\n  /**\n   * @param reactContext react application context that can be used to create modules\n   * @return list of module specs that can create the native modules\n   */\n  public abstract List<ModuleSpec> getNativeModules(\n    ReactApplicationContext reactContext);\n\n  @Override\n  public final List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {\n    List<NativeModule> modules = new ArrayList<>();\n    for (ModuleSpec holder : getNativeModules(reactContext)) {\n      NativeModule nativeModule;\n      SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"createNativeModule\")\n        .arg(\"module\", holder.getType())\n        .flush();\n      ReactMarker.logMarker(\n        ReactMarkerConstants.CREATE_MODULE_START,\n        holder.getType().getSimpleName());\n      try {\n        nativeModule = holder.getProvider().get();\n      } finally {\n        ReactMarker.logMarker(ReactMarkerConstants.CREATE_MODULE_END);\n        SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();\n      }\n      modules.add(nativeModule);\n    }\n    return modules;\n  }\n\n  /**\n   * @param reactContext react application context that can be used to create View Managers.\n   * @return list of module specs that can create the View Managers.\n   */\n  public List<ModuleSpec> getViewManagers(ReactApplicationContext reactContext) {\n    return Collections.emptyList();\n  }\n\n  @Override\n  public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {\n    List<ModuleSpec> viewManagerModuleSpecs = getViewManagers(reactContext);\n    if (viewManagerModuleSpecs == null || viewManagerModuleSpecs.isEmpty()) {\n      return Collections.emptyList();\n    }\n\n    List<ViewManager> viewManagers = new ArrayList<>();\n    for (ModuleSpec moduleSpec : viewManagerModuleSpecs) {\n      viewManagers.add((ViewManager) moduleSpec.getProvider().get());\n    }\n    return viewManagers;\n  }\n\n  public abstract ReactModuleInfoProvider getReactModuleInfoProvider();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/MemoryPressureRouter.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react;\n\nimport android.content.ComponentCallbacks2;\nimport android.content.Context;\nimport android.content.res.Configuration;\nimport com.facebook.react.bridge.MemoryPressureListener;\nimport java.util.Collections;\nimport java.util.LinkedHashSet;\nimport java.util.Set;\n\n/**\n * Translates and routes memory pressure events to the current catalyst instance.\n */\npublic class MemoryPressureRouter implements ComponentCallbacks2 {\n  private final Set<MemoryPressureListener> mListeners =\n    Collections.synchronizedSet(new LinkedHashSet<MemoryPressureListener>());\n\n  MemoryPressureRouter(Context context) {\n    context.getApplicationContext().registerComponentCallbacks(this);\n  }\n\n  public void destroy(Context context) {\n    context.getApplicationContext().unregisterComponentCallbacks(this);\n  }\n\n  /**\n   * Add a listener to be notified of memory pressure events.\n   */\n  public void addMemoryPressureListener(MemoryPressureListener listener) {\n    mListeners.add(listener);\n  }\n\n  /**\n   * Remove a listener previously added with {@link #addMemoryPressureListener}.\n   */\n  public void removeMemoryPressureListener(MemoryPressureListener listener) {\n    mListeners.remove(listener);\n  }\n\n  @Override\n  public void onTrimMemory(int level) {\n    dispatchMemoryPressure(level);\n  }\n\n  @Override\n  public void onConfigurationChanged(Configuration newConfig) {\n  }\n\n  @Override\n  public void onLowMemory() {\n  }\n\n  private void dispatchMemoryPressure(int level) {\n    // copy listeners array to avoid ConcurrentModificationException if any of the listeners remove\n    // themselves in handleMemoryPressure()\n    MemoryPressureListener[] listeners =\n      mListeners.toArray(new MemoryPressureListener[mListeners.size()]);\n    for (MemoryPressureListener listener : listeners) {\n      listener.handleMemoryPressure(level);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.bridge.ModuleSpec;\nimport com.facebook.react.bridge.ModuleHolder;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.NativeModuleRegistry;\nimport com.facebook.react.bridge.OnBatchCompleteListener;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactMarker;\nimport com.facebook.react.bridge.ReactMarkerConstants;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.module.model.ReactModuleInfo;\n\n/**\n * Helper class to build NativeModuleRegistry.\n */\npublic class NativeModuleRegistryBuilder {\n\n  private final ReactApplicationContext mReactApplicationContext;\n  private final ReactInstanceManager mReactInstanceManager;\n  private final boolean mLazyNativeModulesEnabled;\n\n  private final Map<Class<? extends NativeModule>, ModuleHolder> mModules = new HashMap<>();\n  private final Map<String, Class<? extends NativeModule>> namesToType = new HashMap<>();\n\n  public NativeModuleRegistryBuilder(\n    ReactApplicationContext reactApplicationContext,\n    ReactInstanceManager reactInstanceManager,\n    boolean lazyNativeModulesEnabled) {\n    mReactApplicationContext = reactApplicationContext;\n    mReactInstanceManager = reactInstanceManager;\n    mLazyNativeModulesEnabled = lazyNativeModulesEnabled;\n  }\n\n  public void processPackage(ReactPackage reactPackage) {\n    if (mLazyNativeModulesEnabled) {\n      if (!(reactPackage instanceof LazyReactPackage)) {\n        throw new IllegalStateException(\"Lazy native modules requires all ReactPackage to \" +\n          \"inherit from LazyReactPackage\");\n      }\n\n      LazyReactPackage lazyReactPackage = (LazyReactPackage) reactPackage;\n      List<ModuleSpec> moduleSpecs = lazyReactPackage.getNativeModules(mReactApplicationContext);\n      Map<Class, ReactModuleInfo> reactModuleInfoMap = lazyReactPackage.getReactModuleInfoProvider()\n        .getReactModuleInfos();\n\n      for (ModuleSpec moduleSpec : moduleSpecs) {\n        Class<? extends NativeModule> type = moduleSpec.getType();\n        ReactModuleInfo reactModuleInfo = reactModuleInfoMap.get(type);\n        ModuleHolder moduleHolder;\n        if (reactModuleInfo == null) {\n          if (BaseJavaModule.class.isAssignableFrom(type)) {\n            throw new IllegalStateException(\"Native Java module \" + type.getSimpleName() +\n              \" should be annotated with @ReactModule and added to a @ReactModuleList.\");\n          }\n          NativeModule module;\n          ReactMarker.logMarker(\n            ReactMarkerConstants.CREATE_MODULE_START,\n            moduleSpec.getType().getName());\n          try {\n            module = moduleSpec.getProvider().get();\n          } finally {\n            ReactMarker.logMarker(ReactMarkerConstants.CREATE_MODULE_END);\n          }\n          moduleHolder = new ModuleHolder(module);\n        } else {\n          moduleHolder = new ModuleHolder(reactModuleInfo, moduleSpec.getProvider());\n        }\n\n        String name = moduleHolder.getName();\n        if (namesToType.containsKey(name)) {\n          Class<? extends NativeModule> existingNativeModule = namesToType.get(name);\n          if (!moduleHolder.getCanOverrideExistingModule()) {\n            throw new IllegalStateException(\"Native module \" + type.getSimpleName() +\n              \" tried to override \" + existingNativeModule.getSimpleName() + \" for module name \" +\n              name + \". If this was your intention, set canOverrideExistingModule=true\");\n          }\n\n          mModules.remove(existingNativeModule);\n        }\n\n        namesToType.put(name, type);\n        mModules.put(type, moduleHolder);\n      }\n    } else {\n      FLog.d(\n        ReactConstants.TAG,\n        reactPackage.getClass().getSimpleName() +\n          \" is not a LazyReactPackage, falling back to old version.\");\n      List<NativeModule> nativeModules;\n      if (reactPackage instanceof ReactInstancePackage) {\n        ReactInstancePackage reactInstancePackage = (ReactInstancePackage) reactPackage;\n        nativeModules = reactInstancePackage.createNativeModules(\n            mReactApplicationContext,\n            mReactInstanceManager);\n      } else {\n        nativeModules = reactPackage.createNativeModules(mReactApplicationContext);\n      }\n      for (NativeModule nativeModule : nativeModules) {\n        addNativeModule(nativeModule);\n      }\n    }\n  }\n\n  public void addNativeModule(NativeModule nativeModule) {\n    String name = nativeModule.getName();\n    Class<? extends NativeModule> type = nativeModule.getClass();\n    if (namesToType.containsKey(name)) {\n      Class<? extends NativeModule> existingModule = namesToType.get(name);\n      if (!nativeModule.canOverrideExistingModule()) {\n        throw new IllegalStateException(\"Native module \" + type.getSimpleName() +\n          \" tried to override \" + existingModule.getSimpleName() + \" for module name \" +\n          name + \". If this was your intention, set canOverrideExistingModule=true\");\n      }\n\n      mModules.remove(existingModule);\n    }\n\n    namesToType.put(name, type);\n    ModuleHolder moduleHolder = new ModuleHolder(nativeModule);\n    mModules.put(type, moduleHolder);\n  }\n\n  public NativeModuleRegistry build() {\n    ArrayList<ModuleHolder> batchCompleteListenerModules = new ArrayList<>();\n    for (Map.Entry<Class<? extends NativeModule>, ModuleHolder> entry : mModules.entrySet()) {\n      if (OnBatchCompleteListener.class.isAssignableFrom(entry.getKey())) {\n        batchCompleteListenerModules.add(entry.getValue());\n      }\n    }\n\n    return new NativeModuleRegistry(\n      mReactApplicationContext,\n      mModules,\n      batchCompleteListenerModules);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport javax.annotation.Nullable;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.view.KeyEvent;\n\nimport com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;\nimport com.facebook.react.modules.core.PermissionAwareActivity;\nimport com.facebook.react.modules.core.PermissionListener;\n\n/**\n * Base Activity for React Native applications.\n */\npublic abstract class ReactActivity extends Activity\n    implements DefaultHardwareBackBtnHandler, PermissionAwareActivity {\n\n  private final ReactActivityDelegate mDelegate;\n\n  protected ReactActivity() {\n    mDelegate = createReactActivityDelegate();\n  }\n\n  /**\n   * Returns the name of the main component registered from JavaScript.\n   * This is used to schedule rendering of the component.\n   * e.g. \"MoviesApp\"\n   */\n  protected @Nullable String getMainComponentName() {\n    return null;\n  }\n\n  /**\n   * Called at construction time, override if you have a custom delegate implementation.\n   */\n  protected ReactActivityDelegate createReactActivityDelegate() {\n    return new ReactActivityDelegate(this, getMainComponentName());\n  }\n\n  @Override\n  protected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    mDelegate.onCreate(savedInstanceState);\n  }\n\n  @Override\n  protected void onPause() {\n    super.onPause();\n    mDelegate.onPause();\n  }\n\n  @Override\n  protected void onResume() {\n    super.onResume();\n    mDelegate.onResume();\n  }\n\n  @Override\n  protected void onDestroy() {\n    super.onDestroy();\n    mDelegate.onDestroy();\n  }\n\n  @Override\n  public void onActivityResult(int requestCode, int resultCode, Intent data) {\n    mDelegate.onActivityResult(requestCode, resultCode, data);\n  }\n\n  @Override\n  public boolean onKeyUp(int keyCode, KeyEvent event) {\n    return mDelegate.onKeyUp(keyCode, event) || super.onKeyUp(keyCode, event);\n  }\n\n  @Override\n  public void onBackPressed() {\n    if (!mDelegate.onBackPressed()) {\n      super.onBackPressed();\n    }\n  }\n\n  @Override\n  public void invokeDefaultOnBackPressed() {\n    super.onBackPressed();\n  }\n\n  @Override\n  public void onNewIntent(Intent intent) {\n    if (!mDelegate.onNewIntent(intent)) {\n      super.onNewIntent(intent);\n    }\n  }\n\n  @Override\n  public void requestPermissions(\n    String[] permissions,\n    int requestCode,\n    PermissionListener listener) {\n    mDelegate.requestPermissions(permissions, requestCode, listener);\n  }\n\n  @Override\n  public void onRequestPermissionsResult(\n    int requestCode,\n    String[] permissions,\n    int[] grantResults) {\n    mDelegate.onRequestPermissionsResult(requestCode, permissions, grantResults);\n  }\n\n  protected final ReactNativeHost getReactNativeHost() {\n    return mDelegate.getReactNativeHost();\n  }\n\n  protected final ReactInstanceManager getReactInstanceManager() {\n    return mDelegate.getReactInstanceManager();\n  }\n\n  protected final void loadApp(String appKey) {\n    mDelegate.loadApp(appKey);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react;\n\nimport android.annotation.TargetApi;\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.support.v4.app.FragmentActivity;\nimport android.view.KeyEvent;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.devsupport.DoubleTapReloadRecognizer;\nimport com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;\nimport com.facebook.react.modules.core.PermissionListener;\n\nimport javax.annotation.Nullable;\n\n/**\n * Delegate class for {@link ReactActivity} and {@link ReactFragmentActivity}. You can subclass this\n * to provide custom implementations for e.g. {@link #getReactNativeHost()}, if your Application\n * class doesn't implement {@link ReactApplication}.\n */\npublic class ReactActivityDelegate {\n\n  private final @Nullable Activity mActivity;\n  private final @Nullable FragmentActivity mFragmentActivity;\n  private final @Nullable String mMainComponentName;\n\n  private @Nullable ReactRootView mReactRootView;\n  private @Nullable DoubleTapReloadRecognizer mDoubleTapReloadRecognizer;\n  private @Nullable PermissionListener mPermissionListener;\n  private @Nullable Callback mPermissionsCallback;\n\n  public ReactActivityDelegate(Activity activity, @Nullable String mainComponentName) {\n    mActivity = activity;\n    mMainComponentName = mainComponentName;\n    mFragmentActivity = null;\n  }\n\n  public ReactActivityDelegate(\n    FragmentActivity fragmentActivity,\n    @Nullable String mainComponentName) {\n    mFragmentActivity = fragmentActivity;\n    mMainComponentName = mainComponentName;\n    mActivity = null;\n  }\n\n  protected @Nullable Bundle getLaunchOptions() {\n    return null;\n  }\n\n  protected ReactRootView createRootView() {\n    return new ReactRootView(getContext());\n  }\n\n  /**\n   * Get the {@link ReactNativeHost} used by this app. By default, assumes\n   * {@link Activity#getApplication()} is an instance of {@link ReactApplication} and calls\n   * {@link ReactApplication#getReactNativeHost()}. Override this method if your application class\n   * does not implement {@code ReactApplication} or you simply have a different mechanism for\n   * storing a {@code ReactNativeHost}, e.g. as a static field somewhere.\n   */\n  protected ReactNativeHost getReactNativeHost() {\n    return ((ReactApplication) getPlainActivity().getApplication()).getReactNativeHost();\n  }\n\n  public ReactInstanceManager getReactInstanceManager() {\n    return getReactNativeHost().getReactInstanceManager();\n  }\n\n  protected void onCreate(Bundle savedInstanceState) {\n    if (mMainComponentName != null) {\n      loadApp(mMainComponentName);\n    }\n    mDoubleTapReloadRecognizer = new DoubleTapReloadRecognizer();\n  }\n\n  protected void loadApp(String appKey) {\n    if (mReactRootView != null) {\n      throw new IllegalStateException(\"Cannot loadApp while app is already running.\");\n    }\n    mReactRootView = createRootView();\n    mReactRootView.startReactApplication(\n      getReactNativeHost().getReactInstanceManager(),\n      appKey,\n      getLaunchOptions());\n    getPlainActivity().setContentView(mReactRootView);\n  }\n\n  protected void onPause() {\n    if (getReactNativeHost().hasInstance()) {\n      getReactNativeHost().getReactInstanceManager().onHostPause(getPlainActivity());\n    }\n  }\n\n  protected void onResume() {\n    if (getReactNativeHost().hasInstance()) {\n      getReactNativeHost().getReactInstanceManager().onHostResume(\n        getPlainActivity(),\n        (DefaultHardwareBackBtnHandler) getPlainActivity());\n    }\n\n    if (mPermissionsCallback != null) {\n      mPermissionsCallback.invoke();\n      mPermissionsCallback = null;\n    }\n  }\n\n  protected void onDestroy() {\n    if (mReactRootView != null) {\n      mReactRootView.unmountReactApplication();\n      mReactRootView = null;\n    }\n    if (getReactNativeHost().hasInstance()) {\n      getReactNativeHost().getReactInstanceManager().onHostDestroy(getPlainActivity());\n    }\n  }\n\n  public void onActivityResult(int requestCode, int resultCode, Intent data) {\n    if (getReactNativeHost().hasInstance()) {\n      getReactNativeHost().getReactInstanceManager()\n        .onActivityResult(getPlainActivity(), requestCode, resultCode, data);\n    }\n  }\n\n  public boolean onKeyUp(int keyCode, KeyEvent event) {\n    if (getReactNativeHost().hasInstance() && getReactNativeHost().getUseDeveloperSupport()) {\n      if (keyCode == KeyEvent.KEYCODE_MENU) {\n        getReactNativeHost().getReactInstanceManager().showDevOptionsDialog();\n        return true;\n      }\n      boolean didDoubleTapR = Assertions.assertNotNull(mDoubleTapReloadRecognizer)\n        .didDoubleTapR(keyCode, getPlainActivity().getCurrentFocus());\n      if (didDoubleTapR) {\n        getReactNativeHost().getReactInstanceManager().getDevSupportManager().handleReloadJS();\n        return true;\n      }\n    }\n    return false;\n  }\n\n  public boolean onBackPressed() {\n    if (getReactNativeHost().hasInstance()) {\n      getReactNativeHost().getReactInstanceManager().onBackPressed();\n      return true;\n    }\n    return false;\n  }\n\n  public boolean onNewIntent(Intent intent) {\n    if (getReactNativeHost().hasInstance()) {\n      getReactNativeHost().getReactInstanceManager().onNewIntent(intent);\n      return true;\n    }\n    return false;\n  }\n\n  @TargetApi(Build.VERSION_CODES.M)\n  public void requestPermissions(\n    String[] permissions,\n    int requestCode,\n    PermissionListener listener) {\n    mPermissionListener = listener;\n    getPlainActivity().requestPermissions(permissions, requestCode);\n  }\n\n  public void onRequestPermissionsResult(\n    final int requestCode,\n    final String[] permissions,\n    final int[] grantResults) {\n    mPermissionsCallback = new Callback() {\n      @Override\n      public void invoke(Object... args) {\n        if (mPermissionListener != null && mPermissionListener.onRequestPermissionsResult(requestCode, permissions, grantResults)) {\n          mPermissionListener = null;\n        }\n      }\n    };\n  }\n\n  private Context getContext() {\n    if (mActivity != null) {\n      return mActivity;\n    }\n    return Assertions.assertNotNull(mFragmentActivity);\n  }\n\n  private Activity getPlainActivity() {\n    return ((Activity) getContext());\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ReactApplication.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\npublic interface ReactApplication {\n\n  /**\n   * Get the default {@link ReactNativeHost} for this app.\n   */\n  ReactNativeHost getReactNativeHost();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ReactFragmentActivity.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport javax.annotation.Nullable;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.support.v4.app.FragmentActivity;\nimport android.view.KeyEvent;\n\nimport com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;\nimport com.facebook.react.modules.core.PermissionAwareActivity;\nimport com.facebook.react.modules.core.PermissionListener;\n\n/**\n * Base Activity for React Native applications. Like {@link ReactActivity} but extends\n * {@link FragmentActivity} instead of {@link android.app.Activity}.\n */\npublic abstract class ReactFragmentActivity extends FragmentActivity implements\n  DefaultHardwareBackBtnHandler, PermissionAwareActivity {\n\n  private final ReactActivityDelegate mDelegate;\n\n  protected ReactFragmentActivity() {\n    mDelegate = createReactActivityDelegate();\n  }\n\n  /**\n   * Returns the name of the main component registered from JavaScript.\n   * This is used to schedule rendering of the component.\n   * e.g. \"MoviesApp\"\n   */\n  protected @Nullable String getMainComponentName() {\n    return null;\n  }\n\n  /**\n   * Called at construction time, override if you have a custom delegate implementation.\n   */\n  protected ReactActivityDelegate createReactActivityDelegate() {\n    return new ReactActivityDelegate(this, getMainComponentName());\n  }\n\n  @Override\n  protected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    mDelegate.onCreate(savedInstanceState);\n  }\n\n  @Override\n  protected void onPause() {\n    super.onPause();\n    mDelegate.onPause();\n  }\n\n  @Override\n  protected void onResume() {\n    super.onResume();\n    mDelegate.onResume();\n  }\n\n  @Override\n  protected void onDestroy() {\n    super.onDestroy();\n    mDelegate.onDestroy();\n  }\n\n  @Override\n  public void onActivityResult(int requestCode, int resultCode, Intent data) {\n    mDelegate.onActivityResult(requestCode, resultCode, data);\n  }\n\n  @Override\n  public boolean onKeyUp(int keyCode, KeyEvent event) {\n    return mDelegate.onKeyUp(keyCode, event) || super.onKeyUp(keyCode, event);\n  }\n\n  @Override\n  public void onBackPressed() {\n    if (!mDelegate.onBackPressed()) {\n      super.onBackPressed();\n    }\n  }\n\n  @Override\n  public void invokeDefaultOnBackPressed() {\n    super.onBackPressed();\n  }\n\n  @Override\n  public void onNewIntent(Intent intent) {\n    if (!mDelegate.onNewIntent(intent)) {\n      super.onNewIntent(intent);\n    }\n  }\n\n  @Override\n  public void requestPermissions(\n    String[] permissions,\n    int requestCode,\n    PermissionListener listener) {\n    mDelegate.requestPermissions(permissions, requestCode, listener);\n  }\n\n  @Override\n  public void onRequestPermissionsResult(\n    int requestCode,\n    String[] permissions,\n    int[] grantResults) {\n    mDelegate.onRequestPermissionsResult(requestCode, permissions, grantResults);\n  }\n\n  protected final ReactNativeHost getReactNativeHost() {\n    return mDelegate.getReactNativeHost();\n  }\n\n  protected final ReactInstanceManager getReactInstanceManager() {\n    return mDelegate.getReactInstanceManager();\n  }\n\n  protected final void loadApp(String appKey) {\n    mDelegate.loadApp(appKey);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport static com.facebook.infer.annotation.ThreadConfined.UI;\nimport static com.facebook.react.bridge.ReactMarkerConstants.ATTACH_MEASURED_ROOT_VIEWS_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.ATTACH_MEASURED_ROOT_VIEWS_START;\nimport static com.facebook.react.bridge.ReactMarkerConstants.BUILD_NATIVE_MODULE_REGISTRY_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.BUILD_NATIVE_MODULE_REGISTRY_START;\nimport static com.facebook.react.bridge.ReactMarkerConstants.CREATE_CATALYST_INSTANCE_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.CREATE_CATALYST_INSTANCE_START;\nimport static com.facebook.react.bridge.ReactMarkerConstants.CREATE_REACT_CONTEXT_START;\nimport static com.facebook.react.bridge.ReactMarkerConstants.CREATE_VIEW_MANAGERS_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.CREATE_VIEW_MANAGERS_START;\nimport static com.facebook.react.bridge.ReactMarkerConstants.PRE_SETUP_REACT_CONTEXT_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.PRE_SETUP_REACT_CONTEXT_START;\nimport static com.facebook.react.bridge.ReactMarkerConstants.PROCESS_PACKAGES_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.PROCESS_PACKAGES_START;\nimport static com.facebook.react.bridge.ReactMarkerConstants.REACT_CONTEXT_THREAD_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.REACT_CONTEXT_THREAD_START;\nimport static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_START;\nimport static com.facebook.systrace.Systrace.TRACE_TAG_REACT_APPS;\nimport static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;\nimport static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JS_VM_CALLS;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.net.Uri;\nimport android.os.Process;\nimport android.support.v4.view.ViewCompat;\nimport android.util.Log;\nimport android.view.View;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.debug.holder.PrinterHolder;\nimport com.facebook.debug.tags.ReactDebugOverlayTags;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.infer.annotation.ThreadConfined;\nimport com.facebook.infer.annotation.ThreadSafe;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.CatalystInstanceImpl;\nimport com.facebook.react.bridge.JSBundleLoader;\nimport com.facebook.react.bridge.JavaJSExecutor;\nimport com.facebook.react.bridge.JavaScriptExecutor;\nimport com.facebook.react.bridge.JavaScriptExecutorFactory;\nimport com.facebook.react.bridge.NativeArray;\nimport com.facebook.react.bridge.NativeModuleCallExceptionHandler;\nimport com.facebook.react.bridge.NativeModuleRegistry;\nimport com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener;\nimport com.facebook.react.bridge.ProxyJavaScriptExecutor;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReactMarker;\nimport com.facebook.react.bridge.ReactMarkerConstants;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;\nimport com.facebook.react.common.LifecycleState;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.devsupport.DevSupportManagerFactory;\nimport com.facebook.react.devsupport.ReactInstanceManagerDevHelper;\nimport com.facebook.react.devsupport.RedBoxHandler;\nimport com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;\nimport com.facebook.react.devsupport.interfaces.DevSupportManager;\nimport com.facebook.react.devsupport.interfaces.PackagerStatusCallback;\nimport com.facebook.react.modules.appregistry.AppRegistry;\nimport com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;\nimport com.facebook.react.modules.core.DeviceEventManagerModule;\nimport com.facebook.react.modules.core.ReactChoreographer;\nimport com.facebook.react.modules.debug.interfaces.DeveloperSettings;\nimport com.facebook.react.uimanager.DisplayMetricsHolder;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;\nimport com.facebook.soloader.SoLoader;\nimport com.facebook.systrace.Systrace;\nimport com.facebook.systrace.SystraceMessage;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\nimport javax.annotation.Nullable;\n\n/**\n * This class is managing instances of {@link CatalystInstance}. It exposes a way to configure\n * catalyst instance using {@link ReactPackage} and keeps track of the lifecycle of that\n * instance. It also sets up connection between the instance and developers support functionality\n * of the framework.\n *\n * An instance of this manager is required to start JS application in {@link ReactRootView} (see\n * {@link ReactRootView#startReactApplication} for more info).\n *\n * The lifecycle of the instance of {@link ReactInstanceManager} should be bound to the\n * activity that owns the {@link ReactRootView} that is used to render react application using this\n * instance manager (see {@link ReactRootView#startReactApplication}). It's required to pass owning\n * activity's lifecycle events to the instance manager (see {@link #onHostPause}, {@link\n * #onHostDestroy} and {@link #onHostResume}).\n *\n * To instantiate an instance of this class use {@link #builder}.\n */\n@ThreadSafe\npublic class ReactInstanceManager {\n\n  private static final String TAG = ReactInstanceManager.class.getSimpleName();\n  /**\n   * Listener interface for react instance events.\n   */\n  public interface ReactInstanceEventListener {\n\n    /**\n     * Called when the react context is initialized (all modules registered). Always called on the\n     * UI thread.\n     */\n    void onReactContextInitialized(ReactContext context);\n  }\n  private final List<ReactRootView> mAttachedRootViews = Collections.synchronizedList(\n    new ArrayList<ReactRootView>());\n\n  private volatile LifecycleState mLifecycleState;\n\n  private @Nullable @ThreadConfined(UI) ReactContextInitParams mPendingReactContextInitParams;\n  private volatile @Nullable Thread mCreateReactContextThread;\n  /* accessed from any thread */\n  private final JavaScriptExecutorFactory mJavaScriptExecutorFactory;\n\n  private final @Nullable JSBundleLoader mBundleLoader;\n  private final @Nullable String mJSMainModulePath; /* path to JS bundle root on packager server */\n  private final List<ReactPackage> mPackages;\n  private final DevSupportManager mDevSupportManager;\n  private final boolean mUseDeveloperSupport;\n  private final @Nullable NotThreadSafeBridgeIdleDebugListener mBridgeIdleDebugListener;\n  private final Object mReactContextLock = new Object();\n  private @Nullable volatile ReactContext mCurrentReactContext;\n  private final Context mApplicationContext;\n  private @Nullable @ThreadConfined(UI) DefaultHardwareBackBtnHandler mDefaultBackButtonImpl;\n  private @Nullable Activity mCurrentActivity;\n  private final Collection<ReactInstanceEventListener> mReactInstanceEventListeners =\n      Collections.synchronizedSet(new HashSet<ReactInstanceEventListener>());\n  // Identifies whether the instance manager is or soon will be initialized (on background thread)\n  private volatile boolean mHasStartedCreatingInitialContext = false;\n  // Identifies whether the instance manager destroy function is in process,\n  // while true any spawned create thread should wait for proper clean up before initializing\n  private volatile Boolean mHasStartedDestroying = false;\n  private final MemoryPressureRouter mMemoryPressureRouter;\n  private final @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler;\n  private final boolean mLazyNativeModulesEnabled;\n  private final boolean mDelayViewManagerClassLoadsEnabled;\n\n  private class ReactContextInitParams {\n    private final JavaScriptExecutorFactory mJsExecutorFactory;\n    private final JSBundleLoader mJsBundleLoader;\n\n    public ReactContextInitParams(\n        JavaScriptExecutorFactory jsExecutorFactory,\n        JSBundleLoader jsBundleLoader) {\n      mJsExecutorFactory = Assertions.assertNotNull(jsExecutorFactory);\n      mJsBundleLoader = Assertions.assertNotNull(jsBundleLoader);\n    }\n\n    public JavaScriptExecutorFactory getJsExecutorFactory() {\n      return mJsExecutorFactory;\n    }\n\n    public JSBundleLoader getJsBundleLoader() {\n      return mJsBundleLoader;\n    }\n  }\n\n  /**\n   * Creates a builder that is capable of creating an instance of {@link ReactInstanceManager}.\n   */\n  public static ReactInstanceManagerBuilder builder() {\n    return new ReactInstanceManagerBuilder();\n  }\n\n  /* package */ ReactInstanceManager(\n      Context applicationContext,\n      @Nullable Activity currentActivity,\n      @Nullable DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler,\n      JavaScriptExecutorFactory javaScriptExecutorFactory,\n      @Nullable JSBundleLoader bundleLoader,\n      @Nullable String jsMainModulePath,\n      List<ReactPackage> packages,\n      boolean useDeveloperSupport,\n      @Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,\n      LifecycleState initialLifecycleState,\n      UIImplementationProvider uiImplementationProvider,\n      NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,\n      @Nullable RedBoxHandler redBoxHandler,\n      boolean lazyNativeModulesEnabled,\n      boolean lazyViewManagersEnabled,\n      boolean delayViewManagerClassLoadsEnabled,\n      @Nullable DevBundleDownloadListener devBundleDownloadListener,\n      int minNumShakes,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.ctor()\");\n    initializeSoLoaderIfNecessary(applicationContext);\n\n    DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(applicationContext);\n\n    mApplicationContext = applicationContext;\n    mCurrentActivity = currentActivity;\n    mDefaultBackButtonImpl = defaultHardwareBackBtnHandler;\n    mJavaScriptExecutorFactory = javaScriptExecutorFactory;\n    mBundleLoader = bundleLoader;\n    mJSMainModulePath = jsMainModulePath;\n    mPackages = new ArrayList<>();\n    mUseDeveloperSupport = useDeveloperSupport;\n    mDevSupportManager =\n        DevSupportManagerFactory.create(\n            applicationContext,\n            createDevHelperInterface(),\n            mJSMainModulePath,\n            useDeveloperSupport,\n            redBoxHandler,\n            devBundleDownloadListener,\n            minNumShakes);\n    mBridgeIdleDebugListener = bridgeIdleDebugListener;\n    mLifecycleState = initialLifecycleState;\n    mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);\n    mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;\n    mLazyNativeModulesEnabled = lazyNativeModulesEnabled;\n    mDelayViewManagerClassLoadsEnabled = delayViewManagerClassLoadsEnabled;\n    synchronized (mPackages) {\n      PrinterHolder.getPrinter()\n          .logMessage(ReactDebugOverlayTags.RN_CORE, \"RNCore: Use Split Packages\");\n      mPackages.add(\n          new CoreModulesPackage(\n              this,\n              new DefaultHardwareBackBtnHandler() {\n                @Override\n                public void invokeDefaultOnBackPressed() {\n                  ReactInstanceManager.this.invokeDefaultOnBackPressed();\n                }\n              },\n              uiImplementationProvider,\n              lazyViewManagersEnabled,\n              minTimeLeftInFrameForNonBatchedOperationMs));\n      if (mUseDeveloperSupport) {\n        mPackages.add(new DebugCorePackage());\n      }\n      mPackages.addAll(packages);\n    }\n\n    // Instantiate ReactChoreographer in UI thread.\n    ReactChoreographer.initialize();\n    if (mUseDeveloperSupport) {\n      mDevSupportManager.startInspector();\n    }\n  }\n\n  private ReactInstanceManagerDevHelper createDevHelperInterface() {\n    return new ReactInstanceManagerDevHelper() {\n      @Override\n      public void onReloadWithJSDebugger(JavaJSExecutor.Factory jsExecutorFactory) {\n        ReactInstanceManager.this.onReloadWithJSDebugger(jsExecutorFactory);\n      }\n\n      @Override\n      public void onJSBundleLoadedFromServer() {\n        ReactInstanceManager.this.onJSBundleLoadedFromServer();\n      }\n\n      @Override\n      public void toggleElementInspector() {\n        ReactInstanceManager.this.toggleElementInspector();\n      }\n\n      @Override\n      public @Nullable Activity getCurrentActivity() {\n        return ReactInstanceManager.this.mCurrentActivity;\n      }\n    };\n  }\n\n  public DevSupportManager getDevSupportManager() {\n    return mDevSupportManager;\n  }\n\n  public MemoryPressureRouter getMemoryPressureRouter() {\n    return mMemoryPressureRouter;\n  }\n\n  private static void initializeSoLoaderIfNecessary(Context applicationContext) {\n    // Call SoLoader.initialize here, this is required for apps that does not use exopackage and\n    // does not use SoLoader for loading other native code except from the one used by React Native\n    // This way we don't need to require others to have additional initialization code and to\n    // subclass android.app.Application.\n\n    // Method SoLoader.init is idempotent, so if you wish to use native exopackage, just call\n    // SoLoader.init with appropriate args before initializing ReactInstanceManager\n    SoLoader.init(applicationContext, /* native exopackage */ false);\n  }\n\n  /**\n   * Trigger react context initialization asynchronously in a background async task. This enables\n   * applications to pre-load the application JS, and execute global code before\n   * {@link ReactRootView} is available and measured. This should only be called the first time the\n   * application is set up, which is enforced to keep developers from accidentally creating their\n   * application multiple times without realizing it.\n   *\n   * Called from UI thread.\n   */\n  @ThreadConfined(UI)\n  public void createReactContextInBackground() {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.createReactContextInBackground()\");\n    Assertions.assertCondition(\n        !mHasStartedCreatingInitialContext,\n        \"createReactContextInBackground should only be called when creating the react \" +\n            \"application for the first time. When reloading JS, e.g. from a new file, explicitly\" +\n            \"use recreateReactContextInBackground\");\n\n    mHasStartedCreatingInitialContext = true;\n    recreateReactContextInBackgroundInner();\n  }\n\n  @ThreadConfined(UI)\n  public void registerAdditionalPackages(List<ReactPackage> packages) {\n    if (packages == null || packages.isEmpty()) {\n      return;\n    }\n\n    // CatalystInstance hasn't been created, so add packages for later evaluation\n    if (!hasStartedCreatingInitialContext()) {\n      synchronized (mPackages) {\n        for (ReactPackage p : packages) {\n          if (!mPackages.contains(p)) {\n            mPackages.add(p);\n          }\n        }\n      }\n      return;\n    }\n\n    ReactContext context = getCurrentReactContext();\n    CatalystInstance catalystInstance = context != null ? context.getCatalystInstance() : null;\n\n    Assertions.assertNotNull(catalystInstance, \"CatalystInstance null after hasStartedCreatingInitialContext true.\");\n\n    final ReactApplicationContext reactContext = new ReactApplicationContext(mApplicationContext);\n\n    NativeModuleRegistry nativeModuleRegistry = processPackages(reactContext, packages, true);\n    catalystInstance.extendNativeModules(nativeModuleRegistry);\n  }\n\n  /**\n   * Recreate the react application and context. This should be called if configuration has changed\n   * or the developer has requested the app to be reloaded. It should only be called after an\n   * initial call to createReactContextInBackground.\n   *\n   * <p>Called from UI thread.\n   */\n  @ThreadConfined(UI)\n  public void recreateReactContextInBackground() {\n    Assertions.assertCondition(\n        mHasStartedCreatingInitialContext,\n        \"recreateReactContextInBackground should only be called after the initial \" +\n            \"createReactContextInBackground call.\");\n    recreateReactContextInBackgroundInner();\n  }\n\n  @ThreadConfined(UI)\n  private void recreateReactContextInBackgroundInner() {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.recreateReactContextInBackgroundInner()\");\n    PrinterHolder.getPrinter()\n        .logMessage(ReactDebugOverlayTags.RN_CORE, \"RNCore: recreateReactContextInBackground\");\n    UiThreadUtil.assertOnUiThread();\n\n    if (mUseDeveloperSupport\n        && mJSMainModulePath != null\n        && !Systrace.isTracing(TRACE_TAG_REACT_APPS | TRACE_TAG_REACT_JS_VM_CALLS)) {\n      final DeveloperSettings devSettings = mDevSupportManager.getDevSettings();\n\n      // If remote JS debugging is enabled, load from dev server.\n      if (mDevSupportManager.hasUpToDateJSBundleInCache() &&\n          !devSettings.isRemoteJSDebugEnabled()) {\n        // If there is a up-to-date bundle downloaded from server,\n        // with remote JS debugging disabled, always use that.\n        onJSBundleLoadedFromServer();\n      } else if (mBundleLoader == null) {\n        mDevSupportManager.handleReloadJS();\n      } else {\n        mDevSupportManager.isPackagerRunning(\n            new PackagerStatusCallback() {\n              @Override\n              public void onPackagerStatusFetched(final boolean packagerIsRunning) {\n                UiThreadUtil.runOnUiThread(\n                    new Runnable() {\n                      @Override\n                      public void run() {\n                        if (packagerIsRunning) {\n                          mDevSupportManager.handleReloadJS();\n                        } else {\n                          // If dev server is down, disable the remote JS debugging.\n                          devSettings.setRemoteJSDebugEnabled(false);\n                          recreateReactContextInBackgroundFromBundleLoader();\n                        }\n                      }\n                    });\n              }\n            });\n      }\n      return;\n    }\n\n    recreateReactContextInBackgroundFromBundleLoader();\n  }\n\n  @ThreadConfined(UI)\n  private void recreateReactContextInBackgroundFromBundleLoader() {\n    Log.d(\n      ReactConstants.TAG,\n      \"ReactInstanceManager.recreateReactContextInBackgroundFromBundleLoader()\");\n    PrinterHolder.getPrinter()\n        .logMessage(ReactDebugOverlayTags.RN_CORE, \"RNCore: load from BundleLoader\");\n    recreateReactContextInBackground(mJavaScriptExecutorFactory, mBundleLoader);\n  }\n\n  /**\n   * @return whether createReactContextInBackground has been called. Will return false after\n   * onDestroy until a new initial context has been created.\n   */\n  public boolean hasStartedCreatingInitialContext() {\n    return mHasStartedCreatingInitialContext;\n  }\n\n  /**\n   * This method will give JS the opportunity to consume the back button event. If JS does not\n   * consume the event, mDefaultBackButtonImpl will be invoked at the end of the round trip to JS.\n   */\n  public void onBackPressed() {\n    UiThreadUtil.assertOnUiThread();\n    ReactContext reactContext = mCurrentReactContext;\n    if (reactContext == null) {\n      // Invoke without round trip to JS.\n      FLog.w(ReactConstants.TAG, \"Instance detached from instance manager\");\n      invokeDefaultOnBackPressed();\n    } else {\n      DeviceEventManagerModule deviceEventManagerModule =\n        reactContext.getNativeModule(DeviceEventManagerModule.class);\n      deviceEventManagerModule.emitHardwareBackPressed();\n    }\n  }\n\n  private void invokeDefaultOnBackPressed() {\n    UiThreadUtil.assertOnUiThread();\n    if (mDefaultBackButtonImpl != null) {\n      mDefaultBackButtonImpl.invokeDefaultOnBackPressed();\n    }\n  }\n\n  /**\n   * This method will give JS the opportunity to receive intents via Linking.\n   */\n  @ThreadConfined(UI)\n  public void onNewIntent(Intent intent) {\n    UiThreadUtil.assertOnUiThread();\n    ReactContext currentContext = getCurrentReactContext();\n    if (currentContext == null) {\n      FLog.w(ReactConstants.TAG, \"Instance detached from instance manager\");\n    } else {\n      String action = intent.getAction();\n      Uri uri = intent.getData();\n\n      if (Intent.ACTION_VIEW.equals(action) && uri != null) {\n        DeviceEventManagerModule deviceEventManagerModule =\n          currentContext.getNativeModule(DeviceEventManagerModule.class);\n        deviceEventManagerModule.emitNewIntentReceived(uri);\n      }\n\n      currentContext.onNewIntent(mCurrentActivity, intent);\n    }\n  }\n\n  private void toggleElementInspector() {\n    ReactContext currentContext = getCurrentReactContext();\n    if (currentContext != null) {\n      currentContext\n          .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)\n          .emit(\"toggleElementInspector\", null);\n    }\n  }\n\n  /**\n   * Call this from {@link Activity#onPause()}. This notifies any listening modules so they can do\n   * any necessary cleanup.\n   *\n   * @deprecated Use {@link #onHostPause(Activity)} instead.\n   */\n  @ThreadConfined(UI)\n  public void onHostPause() {\n    UiThreadUtil.assertOnUiThread();\n\n    mDefaultBackButtonImpl = null;\n    if (mUseDeveloperSupport) {\n      mDevSupportManager.setDevSupportEnabled(false);\n    }\n\n    moveToBeforeResumeLifecycleState();\n  }\n\n  /**\n   * Call this from {@link Activity#onPause()}. This notifies any listening modules so they can do\n   * any necessary cleanup. The passed Activity is the current Activity being paused. This will\n   * always be the foreground activity that would be returned by\n   * {@link ReactContext#getCurrentActivity()}.\n   *\n   * @param activity the activity being paused\n   */\n  @ThreadConfined(UI)\n  public void onHostPause(Activity activity) {\n    Assertions.assertNotNull(mCurrentActivity);\n    Assertions.assertCondition(\n      activity == mCurrentActivity,\n      \"Pausing an activity that is not the current activity, this is incorrect! \" +\n        \"Current activity: \" + mCurrentActivity.getClass().getSimpleName() + \" \" +\n        \"Paused activity: \" + activity.getClass().getSimpleName());\n    onHostPause();\n  }\n\n  /**\n   * Use this method when the activity resumes to enable invoking the back button directly from JS.\n   *\n   * This method retains an instance to provided mDefaultBackButtonImpl. Thus it's important to pass\n   * from the activity instance that owns this particular instance of {@link\n   * ReactInstanceManager}, so that once this instance receive {@link #onHostDestroy} event it\n   * will clear the reference to that defaultBackButtonImpl.\n   *\n   * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns\n   * this instance of {@link ReactInstanceManager}.\n   */\n  @ThreadConfined(UI)\n  public void onHostResume(Activity activity, DefaultHardwareBackBtnHandler defaultBackButtonImpl) {\n    UiThreadUtil.assertOnUiThread();\n\n    mDefaultBackButtonImpl = defaultBackButtonImpl;\n    mCurrentActivity = activity;\n\n    if (mUseDeveloperSupport) {\n      // Resume can be called from one of two different states:\n      // a) when activity was paused\n      // b) when activity has just been created\n      // In case of (a) the activity is attached to window and it is ok to add new views to it or\n      // open dialogs. In case of (b) there is often a slight delay before such a thing happens.\n      // As dev support manager can add views or open dialogs immediately after it gets enabled\n      // (e.g. in the case when JS bundle is being fetched in background) we only want to enable\n      // it once we know for sure the current activity is attached.\n\n      // We check if activity is attached to window by checking if decor view is attached\n      final View decorView = mCurrentActivity.getWindow().getDecorView();\n      if (!ViewCompat.isAttachedToWindow(decorView)) {\n        decorView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {\n          @Override\n          public void onViewAttachedToWindow(View v) {\n            // we can drop listener now that we know the view is attached\n            decorView.removeOnAttachStateChangeListener(this);\n            mDevSupportManager.setDevSupportEnabled(true);\n          }\n\n          @Override\n          public void onViewDetachedFromWindow(View v) {\n            // do nothing\n          }\n        });\n      } else {\n        // activity is attached to window, we can enable dev support immediately\n        mDevSupportManager.setDevSupportEnabled(true);\n      }\n    }\n\n    moveToResumedLifecycleState(false);\n  }\n\n  /**\n   * Call this from {@link Activity#onDestroy()}. This notifies any listening modules so they can do\n   * any necessary cleanup.\n   *\n   * @deprecated use {@link #onHostDestroy(Activity)} instead\n   */\n  @ThreadConfined(UI)\n  public void onHostDestroy() {\n    UiThreadUtil.assertOnUiThread();\n\n    if (mUseDeveloperSupport) {\n      mDevSupportManager.setDevSupportEnabled(false);\n    }\n\n    moveToBeforeCreateLifecycleState();\n    mCurrentActivity = null;\n  }\n\n  /**\n   * Call this from {@link Activity#onDestroy()}. This notifies any listening modules so they can do\n   * any necessary cleanup. If the activity being destroyed is not the current activity, no modules\n   * are notified.\n   *\n   * @param activity the activity being destroyed\n   */\n  @ThreadConfined(UI)\n  public void onHostDestroy(Activity activity) {\n    if (activity == mCurrentActivity) {\n      onHostDestroy();\n    }\n  }\n\n  /**\n   * Destroy this React instance and the attached JS context.\n   */\n  @ThreadConfined(UI)\n  public void destroy() {\n    UiThreadUtil.assertOnUiThread();\n    PrinterHolder.getPrinter().logMessage(ReactDebugOverlayTags.RN_CORE, \"RNCore: Destroy\");\n\n    mHasStartedDestroying = true;\n\n    if (mUseDeveloperSupport) {\n      mDevSupportManager.setDevSupportEnabled(false);\n      mDevSupportManager.stopInspector();\n    }\n\n    moveToBeforeCreateLifecycleState();\n\n    if (mCreateReactContextThread != null) {\n      mCreateReactContextThread = null;\n    }\n\n    mMemoryPressureRouter.destroy(mApplicationContext);\n\n    synchronized (mReactContextLock) {\n      if (mCurrentReactContext != null) {\n        mCurrentReactContext.destroy();\n        mCurrentReactContext = null;\n      }\n    }\n    mHasStartedCreatingInitialContext = false;\n    mCurrentActivity = null;\n\n    ResourceDrawableIdHelper.getInstance().clear();\n    mHasStartedDestroying = false;\n    synchronized (mHasStartedDestroying) {\n      mHasStartedDestroying.notifyAll();\n    }\n  }\n\n  private synchronized void moveToResumedLifecycleState(boolean force) {\n    ReactContext currentContext = getCurrentReactContext();\n    if (currentContext != null) {\n      // we currently don't have an onCreate callback so we call onResume for both transitions\n      if (force ||\n          mLifecycleState == LifecycleState.BEFORE_RESUME ||\n          mLifecycleState == LifecycleState.BEFORE_CREATE) {\n        currentContext.onHostResume(mCurrentActivity);\n      }\n    }\n    mLifecycleState = LifecycleState.RESUMED;\n  }\n\n  private synchronized void moveToBeforeResumeLifecycleState() {\n    ReactContext currentContext = getCurrentReactContext();\n    if (currentContext != null) {\n      if (mLifecycleState == LifecycleState.BEFORE_CREATE) {\n        currentContext.onHostResume(mCurrentActivity);\n        currentContext.onHostPause();\n      } else if (mLifecycleState == LifecycleState.RESUMED) {\n        currentContext.onHostPause();\n      }\n    }\n    mLifecycleState = LifecycleState.BEFORE_RESUME;\n  }\n\n  private synchronized void moveToBeforeCreateLifecycleState() {\n    ReactContext currentContext = getCurrentReactContext();\n    if (currentContext != null) {\n      if (mLifecycleState == LifecycleState.RESUMED) {\n        currentContext.onHostPause();\n        mLifecycleState = LifecycleState.BEFORE_RESUME;\n      }\n      if (mLifecycleState == LifecycleState.BEFORE_RESUME) {\n        currentContext.onHostDestroy();\n      }\n    }\n    mLifecycleState = LifecycleState.BEFORE_CREATE;\n  }\n\n  private synchronized void moveReactContextToCurrentLifecycleState() {\n    if (mLifecycleState == LifecycleState.RESUMED) {\n      moveToResumedLifecycleState(true);\n    }\n  }\n\n  @ThreadConfined(UI)\n  public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {\n    ReactContext currentContext = getCurrentReactContext();\n    if (currentContext != null) {\n      currentContext.onActivityResult(activity, requestCode, resultCode, data);\n    }\n  }\n\n  @ThreadConfined(UI)\n  public void showDevOptionsDialog() {\n    UiThreadUtil.assertOnUiThread();\n    mDevSupportManager.showDevOptionsDialog();\n  }\n\n  /**\n   * Attach given {@param rootView} to a catalyst instance manager and start JS application using\n   * JS module provided by {@link ReactRootView#getJSModuleName}. If the react context is currently\n   * being (re)-created, or if react context has not been created yet, the JS application associated\n   * with the provided root view will be started asynchronously, i.e this method won't block.\n   * This view will then be tracked by this manager and in case of catalyst instance restart it will\n   * be re-attached.\n   */\n  @ThreadConfined(UI)\n  public void attachRootView(ReactRootView rootView) {\n    UiThreadUtil.assertOnUiThread();\n    mAttachedRootViews.add(rootView);\n\n    // Reset view content as it's going to be populated by the application content from JS.\n    rootView.removeAllViews();\n    rootView.setId(View.NO_ID);\n\n    // If react context is being created in the background, JS application will be started\n    // automatically when creation completes, as root view is part of the attached root view list.\n    ReactContext currentContext = getCurrentReactContext();\n    if (mCreateReactContextThread == null && currentContext != null) {\n      attachRootViewToInstance(rootView, currentContext.getCatalystInstance());\n    }\n  }\n\n  /**\n   * Detach given {@param rootView} from current catalyst instance. It's safe to call this method\n   * multiple times on the same {@param rootView} - in that case view will be detached with the\n   * first call.\n   */\n  @ThreadConfined(UI)\n  public void detachRootView(ReactRootView rootView) {\n    UiThreadUtil.assertOnUiThread();\n    if (mAttachedRootViews.remove(rootView)) {\n      ReactContext currentContext = getCurrentReactContext();\n      if (currentContext != null && currentContext.hasActiveCatalystInstance()) {\n        detachViewFromInstance(rootView, currentContext.getCatalystInstance());\n      }\n    }\n  }\n\n  /**\n   * Uses configured {@link ReactPackage} instances to create all view managers.\n   */\n  public List<ViewManager> createAllViewManagers(\n      ReactApplicationContext catalystApplicationContext) {\n    ReactMarker.logMarker(CREATE_VIEW_MANAGERS_START);\n    Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"createAllViewManagers\");\n    try {\n      synchronized (mPackages) {\n        List<ViewManager> allViewManagers = new ArrayList<>();\n        for (ReactPackage reactPackage : mPackages) {\n          allViewManagers.addAll(reactPackage.createViewManagers(catalystApplicationContext));\n        }\n        return allViewManagers;\n      }\n    } finally {\n      Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n      ReactMarker.logMarker(CREATE_VIEW_MANAGERS_END);\n    }\n  }\n\n  public @Nullable ViewManager createViewManager(String viewManagerName) {\n    ReactApplicationContext context;\n    synchronized (mReactContextLock) {\n      context = (ReactApplicationContext) getCurrentReactContext();\n      if (context == null || !context.hasActiveCatalystInstance()) {\n        return null;\n      }\n    }\n\n    synchronized (mPackages) {\n      for (ReactPackage reactPackage : mPackages) {\n        if (reactPackage instanceof ViewManagerOnDemandReactPackage) {\n          ViewManager viewManager =\n              ((ViewManagerOnDemandReactPackage) reactPackage)\n                  .createViewManager(context, viewManagerName, !mDelayViewManagerClassLoadsEnabled);\n          if (viewManager != null) {\n            return viewManager;\n          }\n        }\n      }\n    }\n    return null;\n  }\n\n  public @Nullable List<String> getViewManagerNames() {\n    ReactApplicationContext context;\n    synchronized(mReactContextLock) {\n      context = (ReactApplicationContext) getCurrentReactContext();\n      if (context == null || !context.hasActiveCatalystInstance()) {\n        return null;\n      }\n    }\n\n    synchronized (mPackages) {\n      Set<String> uniqueNames = new HashSet<>();\n      for (ReactPackage reactPackage : mPackages) {\n        if (reactPackage instanceof ViewManagerOnDemandReactPackage) {\n          List<String> names =\n              ((ViewManagerOnDemandReactPackage) reactPackage)\n                  .getViewManagerNames(context, !mDelayViewManagerClassLoadsEnabled);\n          if (names != null) {\n            uniqueNames.addAll(names);\n          }\n        }\n      }\n      return new ArrayList<>(uniqueNames);\n    }\n  }\n\n  /**\n   * Add a listener to be notified of react instance events.\n   */\n  public void addReactInstanceEventListener(ReactInstanceEventListener listener) {\n    mReactInstanceEventListeners.add(listener);\n  }\n\n  /**\n   * Remove a listener previously added with {@link #addReactInstanceEventListener}.\n   */\n  public void removeReactInstanceEventListener(ReactInstanceEventListener listener) {\n    mReactInstanceEventListeners.remove(listener);\n  }\n\n  @VisibleForTesting\n  public @Nullable ReactContext getCurrentReactContext() {\n    synchronized (mReactContextLock) {\n      return mCurrentReactContext;\n    }\n  }\n\n  public LifecycleState getLifecycleState() {\n    return mLifecycleState;\n  }\n\n  @ThreadConfined(UI)\n  private void onReloadWithJSDebugger(JavaJSExecutor.Factory jsExecutorFactory) {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.onReloadWithJSDebugger()\");\n    recreateReactContextInBackground(\n        new ProxyJavaScriptExecutor.Factory(jsExecutorFactory),\n        JSBundleLoader.createRemoteDebuggerBundleLoader(\n            mDevSupportManager.getJSBundleURLForRemoteDebugging(),\n            mDevSupportManager.getSourceUrl()));\n  }\n\n  @ThreadConfined(UI)\n  private void onJSBundleLoadedFromServer() {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.onJSBundleLoadedFromServer()\");\n    recreateReactContextInBackground(\n        mJavaScriptExecutorFactory,\n        JSBundleLoader.createCachedBundleFromNetworkLoader(\n            mDevSupportManager.getSourceUrl(), mDevSupportManager.getDownloadedJSBundleFile()));\n  }\n\n  @ThreadConfined(UI)\n  private void recreateReactContextInBackground(\n    JavaScriptExecutorFactory jsExecutorFactory,\n    JSBundleLoader jsBundleLoader) {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.recreateReactContextInBackground()\");\n    UiThreadUtil.assertOnUiThread();\n\n    final ReactContextInitParams initParams = new ReactContextInitParams(\n      jsExecutorFactory,\n      jsBundleLoader);\n    if (mCreateReactContextThread == null) {\n      runCreateReactContextOnNewThread(initParams);\n    } else {\n      mPendingReactContextInitParams = initParams;\n    }\n  }\n\n  @ThreadConfined(UI)\n  private void runCreateReactContextOnNewThread(final ReactContextInitParams initParams) {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.runCreateReactContextOnNewThread()\");\n    UiThreadUtil.assertOnUiThread();\n    synchronized (mReactContextLock) {\n      if (mCurrentReactContext != null) {\n        tearDownReactContext(mCurrentReactContext);\n        mCurrentReactContext = null;\n      }\n    }\n\n    mCreateReactContextThread =\n        new Thread(\n            new Runnable() {\n              @Override\n              public void run() {\n                ReactMarker.logMarker(REACT_CONTEXT_THREAD_END);\n                synchronized (ReactInstanceManager.this.mHasStartedDestroying) {\n                  while (ReactInstanceManager.this.mHasStartedDestroying) {\n                    try {\n                      ReactInstanceManager.this.mHasStartedDestroying.wait();\n                    } catch (InterruptedException e) {\n                      continue;\n                    }\n                  }\n                }\n                // As destroy() may have run and set this to false, ensure that it is true before we create\n                mHasStartedCreatingInitialContext = true;\n\n                try {\n                  Process.setThreadPriority(Process.THREAD_PRIORITY_DISPLAY);\n                  final ReactApplicationContext reactApplicationContext =\n                      createReactContext(\n                          initParams.getJsExecutorFactory().create(),\n                          initParams.getJsBundleLoader());\n\n                  mCreateReactContextThread = null;\n                  ReactMarker.logMarker(PRE_SETUP_REACT_CONTEXT_START);\n                  final Runnable maybeRecreateReactContextRunnable =\n                      new Runnable() {\n                        @Override\n                        public void run() {\n                          if (mPendingReactContextInitParams != null) {\n                            runCreateReactContextOnNewThread(mPendingReactContextInitParams);\n                            mPendingReactContextInitParams = null;\n                          }\n                        }\n                      };\n                  Runnable setupReactContextRunnable =\n                      new Runnable() {\n                        @Override\n                        public void run() {\n                          try {\n                            setupReactContext(reactApplicationContext);\n                          } catch (Exception e) {\n                            mDevSupportManager.handleException(e);\n                          }\n                        }\n                      };\n\n                  reactApplicationContext.runOnNativeModulesQueueThread(setupReactContextRunnable);\n                  UiThreadUtil.runOnUiThread(maybeRecreateReactContextRunnable);\n                } catch (Exception e) {\n                  mDevSupportManager.handleException(e);\n                }\n              }\n            });\n    ReactMarker.logMarker(REACT_CONTEXT_THREAD_START);\n    mCreateReactContextThread.start();\n  }\n\n  private void setupReactContext(final ReactApplicationContext reactContext) {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.setupReactContext()\");\n    ReactMarker.logMarker(PRE_SETUP_REACT_CONTEXT_END);\n    ReactMarker.logMarker(SETUP_REACT_CONTEXT_START);\n    Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"setupReactContext\");\n    synchronized (mReactContextLock) {\n      mCurrentReactContext = Assertions.assertNotNull(reactContext);\n    }\n    CatalystInstance catalystInstance =\n      Assertions.assertNotNull(reactContext.getCatalystInstance());\n\n    catalystInstance.initialize();\n    mDevSupportManager.onNewReactContextCreated(reactContext);\n    mMemoryPressureRouter.addMemoryPressureListener(catalystInstance);\n    moveReactContextToCurrentLifecycleState();\n\n    ReactMarker.logMarker(ATTACH_MEASURED_ROOT_VIEWS_START);\n    synchronized (mAttachedRootViews) {\n      for (ReactRootView rootView : mAttachedRootViews) {\n        attachRootViewToInstance(rootView, catalystInstance);\n      }\n    }\n    ReactMarker.logMarker(ATTACH_MEASURED_ROOT_VIEWS_END);\n\n    ReactInstanceEventListener[] listeners =\n      new ReactInstanceEventListener[mReactInstanceEventListeners.size()];\n    final ReactInstanceEventListener[] finalListeners =\n        mReactInstanceEventListeners.toArray(listeners);\n\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            for (ReactInstanceEventListener listener : finalListeners) {\n              listener.onReactContextInitialized(reactContext);\n            }\n          }\n        });\n    Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n    ReactMarker.logMarker(SETUP_REACT_CONTEXT_END);\n    reactContext.runOnJSQueueThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);\n          }\n        });\n    reactContext.runOnNativeModulesQueueThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);\n          }\n        });\n  }\n\n  private void attachRootViewToInstance(\n      final ReactRootView rootView,\n      CatalystInstance catalystInstance) {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.attachRootViewToInstance()\");\n    Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"attachRootViewToInstance\");\n    UIManagerModule uiManagerModule = catalystInstance.getNativeModule(UIManagerModule.class);\n    final int rootTag = uiManagerModule.addRootView(rootView);\n    rootView.setRootViewTag(rootTag);\n    rootView.invokeJSEntryPoint();\n    Systrace.beginAsyncSection(\n      TRACE_TAG_REACT_JAVA_BRIDGE,\n      \"pre_rootView.onAttachedToReactInstance\",\n      rootTag);\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        Systrace.endAsyncSection(\n          TRACE_TAG_REACT_JAVA_BRIDGE,\n          \"pre_rootView.onAttachedToReactInstance\",\n          rootTag);\n        rootView.onAttachedToReactInstance();\n      }\n    });\n    Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n  }\n\n  private void detachViewFromInstance(\n      ReactRootView rootView,\n      CatalystInstance catalystInstance) {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.detachViewFromInstance()\");\n    UiThreadUtil.assertOnUiThread();\n    catalystInstance.getJSModule(AppRegistry.class)\n        .unmountApplicationComponentAtRootTag(rootView.getId());\n  }\n\n  private void tearDownReactContext(ReactContext reactContext) {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.tearDownReactContext()\");\n    UiThreadUtil.assertOnUiThread();\n    if (mLifecycleState == LifecycleState.RESUMED) {\n      reactContext.onHostPause();\n    }\n\n    synchronized (mAttachedRootViews) {\n      for (ReactRootView rootView : mAttachedRootViews) {\n        rootView.removeAllViews();\n        rootView.setId(View.NO_ID);\n      }\n    }\n\n    reactContext.destroy();\n    mDevSupportManager.onReactInstanceDestroyed(reactContext);\n    mMemoryPressureRouter.removeMemoryPressureListener(reactContext.getCatalystInstance());\n  }\n\n  /**\n   * @return instance of {@link ReactContext} configured a {@link CatalystInstance} set\n   */\n  private ReactApplicationContext createReactContext(\n      JavaScriptExecutor jsExecutor,\n      JSBundleLoader jsBundleLoader) {\n    Log.d(ReactConstants.TAG, \"ReactInstanceManager.createReactContext()\");\n    ReactMarker.logMarker(CREATE_REACT_CONTEXT_START);\n    final ReactApplicationContext reactContext = new ReactApplicationContext(mApplicationContext);\n\n    if (mUseDeveloperSupport) {\n      reactContext.setNativeModuleCallExceptionHandler(mDevSupportManager);\n    }\n\n    NativeModuleRegistry nativeModuleRegistry = processPackages(reactContext, mPackages, false);\n\n    NativeModuleCallExceptionHandler exceptionHandler = mNativeModuleCallExceptionHandler != null\n      ? mNativeModuleCallExceptionHandler\n      : mDevSupportManager;\n    CatalystInstanceImpl.Builder catalystInstanceBuilder = new CatalystInstanceImpl.Builder()\n      .setReactQueueConfigurationSpec(ReactQueueConfigurationSpec.createDefault())\n      .setJSExecutor(jsExecutor)\n      .setRegistry(nativeModuleRegistry)\n      .setJSBundleLoader(jsBundleLoader)\n      .setNativeModuleCallExceptionHandler(exceptionHandler);\n\n    ReactMarker.logMarker(CREATE_CATALYST_INSTANCE_START);\n    // CREATE_CATALYST_INSTANCE_END is in JSCExecutor.cpp\n    Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"createCatalystInstance\");\n    final CatalystInstance catalystInstance;\n    try {\n      catalystInstance = catalystInstanceBuilder.build();\n    } finally {\n      Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n      ReactMarker.logMarker(CREATE_CATALYST_INSTANCE_END);\n    }\n\n    if (mBridgeIdleDebugListener != null) {\n      catalystInstance.addBridgeIdleDebugListener(mBridgeIdleDebugListener);\n    }\n    if (Systrace.isTracing(TRACE_TAG_REACT_APPS | TRACE_TAG_REACT_JS_VM_CALLS)) {\n      catalystInstance.setGlobalVariable(\"__RCTProfileIsProfiling\", \"true\");\n    }\n    ReactMarker.logMarker(ReactMarkerConstants.PRE_RUN_JS_BUNDLE_START);\n    catalystInstance.runJSBundle();\n    reactContext.initializeWithInstance(catalystInstance);\n\n    return reactContext;\n  }\n\n  private NativeModuleRegistry processPackages(\n    ReactApplicationContext reactContext,\n    List<ReactPackage> packages,\n    boolean checkAndUpdatePackageMembership) {\n    NativeModuleRegistryBuilder nativeModuleRegistryBuilder = new NativeModuleRegistryBuilder(\n      reactContext,\n      this,\n      mLazyNativeModulesEnabled);\n\n    ReactMarker.logMarker(PROCESS_PACKAGES_START);\n\n    // TODO(6818138): Solve use-case of native modules overriding\n    synchronized (mPackages) {\n      for (ReactPackage reactPackage : packages) {\n        if (checkAndUpdatePackageMembership && mPackages.contains(reactPackage)) {\n          continue;\n        }\n        Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"createAndProcessCustomReactPackage\");\n        try {\n          if (checkAndUpdatePackageMembership) {\n            mPackages.add(reactPackage);\n          }\n          processPackage(reactPackage, nativeModuleRegistryBuilder);\n        } finally {\n          Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n        }\n      }\n    }\n    ReactMarker.logMarker(PROCESS_PACKAGES_END);\n\n    ReactMarker.logMarker(BUILD_NATIVE_MODULE_REGISTRY_START);\n    Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"buildNativeModuleRegistry\");\n    NativeModuleRegistry nativeModuleRegistry;\n    try {\n      nativeModuleRegistry = nativeModuleRegistryBuilder.build();\n    } finally {\n      Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n      ReactMarker.logMarker(BUILD_NATIVE_MODULE_REGISTRY_END);\n    }\n\n    return nativeModuleRegistry;\n  }\n\n  private void processPackage(\n    ReactPackage reactPackage,\n    NativeModuleRegistryBuilder nativeModuleRegistryBuilder) {\n    SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"processPackage\")\n      .arg(\"className\", reactPackage.getClass().getSimpleName())\n      .flush();\n    if (reactPackage instanceof ReactPackageLogger) {\n      ((ReactPackageLogger) reactPackage).startProcessPackage();\n    }\n    nativeModuleRegistryBuilder.processPackage(reactPackage);\n\n    if (reactPackage instanceof ReactPackageLogger) {\n      ((ReactPackageLogger) reactPackage).endProcessPackage();\n    }\n    SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react;\n\nimport static com.facebook.react.modules.systeminfo.AndroidInfoHelpers.getFriendlyDeviceName;\n\nimport android.app.Activity;\nimport android.app.Application;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.JSBundleLoader;\nimport com.facebook.react.bridge.JSCJavaScriptExecutorFactory;\nimport com.facebook.react.bridge.JavaScriptExecutorFactory;\nimport com.facebook.react.bridge.NativeModuleCallExceptionHandler;\nimport com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener;\nimport com.facebook.react.common.LifecycleState;\nimport com.facebook.react.devsupport.RedBoxHandler;\nimport com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;\nimport com.facebook.react.devsupport.interfaces.DevSupportManager;\nimport com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport java.util.ArrayList;\nimport java.util.List;\nimport javax.annotation.Nullable;\n\n/**\n * Builder class for {@link ReactInstanceManager}\n */\npublic class ReactInstanceManagerBuilder {\n\n  private final List<ReactPackage> mPackages = new ArrayList<>();\n\n  private @Nullable String mJSBundleAssetUrl;\n  private @Nullable JSBundleLoader mJSBundleLoader;\n  private @Nullable String mJSMainModulePath;\n  private @Nullable NotThreadSafeBridgeIdleDebugListener mBridgeIdleDebugListener;\n  private @Nullable Application mApplication;\n  private boolean mUseDeveloperSupport;\n  private @Nullable LifecycleState mInitialLifecycleState;\n  private @Nullable UIImplementationProvider mUIImplementationProvider;\n  private @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler;\n  private @Nullable Activity mCurrentActivity;\n  private @Nullable DefaultHardwareBackBtnHandler mDefaultHardwareBackBtnHandler;\n  private @Nullable RedBoxHandler mRedBoxHandler;\n  private boolean mLazyNativeModulesEnabled;\n  private boolean mLazyViewManagersEnabled;\n  private boolean mDelayViewManagerClassLoadsEnabled;\n  private @Nullable DevBundleDownloadListener mDevBundleDownloadListener;\n  private @Nullable JavaScriptExecutorFactory mJavaScriptExecutorFactory;\n  private int mMinNumShakes = 1;\n  private int mMinTimeLeftInFrameForNonBatchedOperationMs = -1;\n\n  /* package protected */ ReactInstanceManagerBuilder() {\n  }\n\n  /**\n   * Sets a provider of {@link UIImplementation}.\n   * Uses default provider if null is passed.\n   */\n  public ReactInstanceManagerBuilder setUIImplementationProvider(\n    @Nullable UIImplementationProvider uiImplementationProvider) {\n    mUIImplementationProvider = uiImplementationProvider;\n    return this;\n  }\n\n  /**\n   * Factory for desired implementation of JavaScriptExecutor.\n   */\n  public ReactInstanceManagerBuilder setJavaScriptExecutorFactory(\n    @Nullable JavaScriptExecutorFactory javaScriptExecutorFactory) {\n    mJavaScriptExecutorFactory = javaScriptExecutorFactory;\n    return this;\n  }\n\n  /**\n   * Name of the JS bundle file to be loaded from application's raw assets.\n   * Example: {@code \"index.android.js\"}\n   */\n  public ReactInstanceManagerBuilder setBundleAssetName(String bundleAssetName) {\n    mJSBundleAssetUrl = (bundleAssetName == null ? null : \"assets://\" + bundleAssetName);\n    mJSBundleLoader = null;\n    return this;\n  }\n\n  /**\n   * Path to the JS bundle file to be loaded from the file system.\n   *\n   * Example: {@code \"assets://index.android.js\" or \"/sdcard/main.jsbundle\"}\n   */\n  public ReactInstanceManagerBuilder setJSBundleFile(String jsBundleFile) {\n    if (jsBundleFile.startsWith(\"assets://\")) {\n      mJSBundleAssetUrl = jsBundleFile;\n      mJSBundleLoader = null;\n      return this;\n    }\n    return setJSBundleLoader(JSBundleLoader.createFileLoader(jsBundleFile));\n  }\n\n  /**\n   * Bundle loader to use when setting up JS environment. This supersedes\n   * prior invocations of {@link setJSBundleFile} and {@link setBundleAssetName}.\n   *\n   * Example: {@code JSBundleLoader.createFileLoader(application, bundleFile)}\n   */\n  public ReactInstanceManagerBuilder setJSBundleLoader(JSBundleLoader jsBundleLoader) {\n    mJSBundleLoader = jsBundleLoader;\n    mJSBundleAssetUrl = null;\n    return this;\n  }\n\n  /**\n   * Path to your app's main module on the packager server. This is used when\n   * reloading JS during development. All paths are relative to the root folder\n   * the packager is serving files from.\n   * Examples:\n   * {@code \"index.android\"} or\n   * {@code \"subdirectory/index.android\"}\n   */\n  public ReactInstanceManagerBuilder setJSMainModulePath(String jsMainModulePath) {\n    mJSMainModulePath = jsMainModulePath;\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder addPackage(ReactPackage reactPackage) {\n    mPackages.add(reactPackage);\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder addPackages(List<ReactPackage> reactPackages) {\n    mPackages.addAll(reactPackages);\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder setBridgeIdleDebugListener(\n    NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener) {\n    mBridgeIdleDebugListener = bridgeIdleDebugListener;\n    return this;\n  }\n\n  /**\n   * Required. This must be your {@code Application} instance.\n   */\n  public ReactInstanceManagerBuilder setApplication(Application application) {\n    mApplication = application;\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder setCurrentActivity(Activity activity) {\n    mCurrentActivity = activity;\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder setDefaultHardwareBackBtnHandler(\n    DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler) {\n    mDefaultHardwareBackBtnHandler = defaultHardwareBackBtnHandler;\n    return this;\n  }\n\n  /**\n   * When {@code true}, developer options such as JS reloading and debugging are enabled.\n   * Note you still have to call {@link #showDevOptionsDialog} to show the dev menu,\n   * e.g. when the device Menu button is pressed.\n   */\n  public ReactInstanceManagerBuilder setUseDeveloperSupport(boolean useDeveloperSupport) {\n    mUseDeveloperSupport = useDeveloperSupport;\n    return this;\n  }\n\n  /**\n   * Sets the initial lifecycle state of the host. For example, if the host is already resumed at\n   * creation time, we wouldn't expect an onResume call until we get an onPause call.\n   */\n  public ReactInstanceManagerBuilder setInitialLifecycleState(\n    LifecycleState initialLifecycleState) {\n    mInitialLifecycleState = initialLifecycleState;\n    return this;\n  }\n\n  /**\n   * Set the exception handler for all native module calls. If not set, the default\n   * {@link DevSupportManager} will be used, which shows a redbox in dev mode and rethrows\n   * (crashes the app) in prod mode.\n   */\n  public ReactInstanceManagerBuilder setNativeModuleCallExceptionHandler(\n    NativeModuleCallExceptionHandler handler) {\n    mNativeModuleCallExceptionHandler = handler;\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder setRedBoxHandler(@Nullable RedBoxHandler redBoxHandler) {\n    mRedBoxHandler = redBoxHandler;\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder setLazyNativeModulesEnabled(boolean lazyNativeModulesEnabled) {\n    mLazyNativeModulesEnabled = lazyNativeModulesEnabled;\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder setLazyViewManagersEnabled(boolean lazyViewManagersEnabled) {\n    mLazyViewManagersEnabled = lazyViewManagersEnabled;\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder setDelayViewManagerClassLoadsEnabled(\n      boolean delayViewManagerClassLoadsEnabled) {\n    mDelayViewManagerClassLoadsEnabled = delayViewManagerClassLoadsEnabled;\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder setDevBundleDownloadListener(\n    @Nullable DevBundleDownloadListener listener) {\n    mDevBundleDownloadListener = listener;\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder setMinNumShakes(int minNumShakes) {\n    mMinNumShakes = minNumShakes;\n    return this;\n  }\n\n  public ReactInstanceManagerBuilder setMinTimeLeftInFrameForNonBatchedOperationMs(\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    mMinTimeLeftInFrameForNonBatchedOperationMs = minTimeLeftInFrameForNonBatchedOperationMs;\n    return this;\n  }\n\n  /**\n   * Instantiates a new {@link ReactInstanceManager}.\n   * Before calling {@code build}, the following must be called:\n   * <ul>\n   * <li> {@link #setApplication}\n   * <li> {@link #setCurrentActivity} if the activity has already resumed\n   * <li> {@link #setDefaultHardwareBackBtnHandler} if the activity has already resumed\n   * <li> {@link #setJSBundleFile} or {@link #setJSMainModulePath}\n   * </ul>\n   */\n  public ReactInstanceManager build() {\n    Assertions.assertNotNull(\n      mApplication,\n      \"Application property has not been set with this builder\");\n\n    Assertions.assertCondition(\n      mUseDeveloperSupport || mJSBundleAssetUrl != null || mJSBundleLoader != null,\n      \"JS Bundle File or Asset URL has to be provided when dev support is disabled\");\n\n    Assertions.assertCondition(\n      mJSMainModulePath != null || mJSBundleAssetUrl != null || mJSBundleLoader != null,\n      \"Either MainModulePath or JS Bundle File needs to be provided\");\n\n    if (mUIImplementationProvider == null) {\n      // create default UIImplementationProvider if the provided one is null.\n      mUIImplementationProvider = new UIImplementationProvider();\n    }\n\n    // We use the name of the device and the app for debugging & metrics\n    String appName = mApplication.getPackageName();\n    String deviceName = getFriendlyDeviceName();\n\n    return new ReactInstanceManager(\n        mApplication,\n        mCurrentActivity,\n        mDefaultHardwareBackBtnHandler,\n        mJavaScriptExecutorFactory == null\n            ? new JSCJavaScriptExecutorFactory(appName, deviceName)\n            : mJavaScriptExecutorFactory,\n        (mJSBundleLoader == null && mJSBundleAssetUrl != null)\n            ? JSBundleLoader.createAssetLoader(\n                mApplication, mJSBundleAssetUrl, false /*Asynchronous*/)\n            : mJSBundleLoader,\n        mJSMainModulePath,\n        mPackages,\n        mUseDeveloperSupport,\n        mBridgeIdleDebugListener,\n        Assertions.assertNotNull(mInitialLifecycleState, \"Initial lifecycle state was not set\"),\n        mUIImplementationProvider,\n        mNativeModuleCallExceptionHandler,\n        mRedBoxHandler,\n        mLazyNativeModulesEnabled,\n        mLazyViewManagersEnabled,\n        mDelayViewManagerClassLoadsEnabled,\n        mDevBundleDownloadListener,\n        mMinNumShakes,\n        mMinTimeLeftInFrameForNonBatchedOperationMs);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ReactInstancePackage.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport java.util.List;\n\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\n\n/**\n * A simple wrapper for ReactPackage to make it aware of its {@link ReactInstanceManager}\n * when creating native modules. This is useful when the package needs to ask\n * the instance manager for more information, like {@link DevSupportManager}.\n *\n * TODO(t11394819): Consolidate this with LazyReactPackage\n */\npublic abstract class ReactInstancePackage implements ReactPackage {\n\n  public abstract List<NativeModule> createNativeModules(\n      ReactApplicationContext reactContext,\n      ReactInstanceManager reactInstanceManager);\n\n  @Override\n  public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {\n    throw new RuntimeException(\"ReactInstancePackage must be passed in the ReactInstanceManager.\");\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport javax.annotation.Nullable;\n\nimport java.util.List;\n\nimport android.app.Application;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.JavaScriptExecutorFactory;\nimport com.facebook.react.common.LifecycleState;\nimport com.facebook.react.devsupport.RedBoxHandler;\nimport com.facebook.react.uimanager.UIImplementationProvider;\n\n/**\n * Simple class that holds an instance of {@link ReactInstanceManager}. This can be used in your\n * {@link Application class} (see {@link ReactApplication}), or as a static field.\n */\npublic abstract class ReactNativeHost {\n\n  private final Application mApplication;\n  private @Nullable ReactInstanceManager mReactInstanceManager;\n\n  protected ReactNativeHost(Application application) {\n    mApplication = application;\n  }\n\n  /**\n   * Get the current {@link ReactInstanceManager} instance, or create one.\n   */\n  public ReactInstanceManager getReactInstanceManager() {\n    if (mReactInstanceManager == null) {\n      mReactInstanceManager = createReactInstanceManager();\n    }\n    return mReactInstanceManager;\n  }\n\n  /**\n   * Get whether this holder contains a {@link ReactInstanceManager} instance, or not. I.e. if\n   * {@link #getReactInstanceManager()} has been called at least once since this object was created\n   * or {@link #clear()} was called.\n   */\n  public boolean hasInstance() {\n    return mReactInstanceManager != null;\n  }\n\n  /**\n   * Destroy the current instance and release the internal reference to it, allowing it to be GCed.\n   */\n  public void clear() {\n    if (mReactInstanceManager != null) {\n      mReactInstanceManager.destroy();\n      mReactInstanceManager = null;\n    }\n  }\n\n  protected ReactInstanceManager createReactInstanceManager() {\n    ReactInstanceManagerBuilder builder = ReactInstanceManager.builder()\n      .setApplication(mApplication)\n      .setJSMainModulePath(getJSMainModuleName())\n      .setUseDeveloperSupport(getUseDeveloperSupport())\n      .setRedBoxHandler(getRedBoxHandler())\n      .setJavaScriptExecutorFactory(getJavaScriptExecutorFactory())\n      .setUIImplementationProvider(getUIImplementationProvider())\n      .setInitialLifecycleState(LifecycleState.BEFORE_CREATE);\n\n    for (ReactPackage reactPackage : getPackages()) {\n      builder.addPackage(reactPackage);\n    }\n\n    String jsBundleFile = getJSBundleFile();\n    if (jsBundleFile != null) {\n      builder.setJSBundleFile(jsBundleFile);\n    } else {\n      builder.setBundleAssetName(Assertions.assertNotNull(getBundleAssetName()));\n    }\n    return builder.build();\n  }\n\n  /**\n   * Get the {@link RedBoxHandler} to send RedBox-related callbacks to.\n   */\n  protected @Nullable RedBoxHandler getRedBoxHandler() {\n    return null;\n  }\n\n  /**\n   * Get the {@link JavaScriptExecutorFactory}.  Override this to use a custom\n   * Executor.\n   */\n  protected @Nullable JavaScriptExecutorFactory getJavaScriptExecutorFactory() {\n    return null;\n  }\n\n  protected final Application getApplication() {\n    return mApplication;\n  }\n\n  /**\n   * Get the {@link UIImplementationProvider} to use. Override this method if you want to use a\n   * custom UI implementation.\n   *\n   * Note: this is very advanced functionality, in 99% of cases you don't need to override this.\n   */\n  protected UIImplementationProvider getUIImplementationProvider() {\n    return new UIImplementationProvider();\n  }\n\n  /**\n   * Returns the name of the main module. Determines the URL used to fetch the JS bundle\n   * from the packager server. It is only used when dev support is enabled.\n   * This is the first file to be executed once the {@link ReactInstanceManager} is created.\n   * e.g. \"index.android\"\n   */\n  protected String getJSMainModuleName() {\n    return \"index.android\";\n  }\n\n  /**\n   * Returns a custom path of the bundle file. This is used in cases the bundle should be loaded\n   * from a custom path. By default it is loaded from Android assets, from a path specified\n   * by {@link getBundleAssetName}.\n   * e.g. \"file://sdcard/myapp_cache/index.android.bundle\"\n   */\n  protected @Nullable String getJSBundleFile() {\n    return null;\n  }\n\n  /**\n   * Returns the name of the bundle in assets. If this is null, and no file path is specified for\n   * the bundle, the app will only work with {@code getUseDeveloperSupport} enabled and will\n   * always try to load the JS bundle from the packager server.\n   * e.g. \"index.android.bundle\"\n   */\n  protected @Nullable String getBundleAssetName() {\n    return \"index.android.bundle\";\n  }\n\n  /**\n   * Returns whether dev mode should be enabled. This enables e.g. the dev menu.\n   */\n  public abstract boolean getUseDeveloperSupport();\n\n  /**\n   * Returns a list of {@link ReactPackage} used by the app.\n   * You'll most likely want to return at least the {@code MainReactPackage}.\n   * If your app uses additional views or modules besides the default ones,\n   * you'll want to include more packages here.\n   */\n  protected abstract List<ReactPackage> getPackages();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ReactPackage.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport java.util.List;\n\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\n\n/**\n * Main interface for providing additional capabilities to the catalyst framework by couple of\n * different means:\n * 1) Registering new native modules\n * 2) Registering new JS modules that may be accessed from native modules or from other parts of the\n * native code (requiring JS modules from the package doesn't mean it will automatically be included\n * as a part of the JS bundle, so there should be a corresponding piece of code on JS side that will\n * require implementation of that JS module so that it gets bundled)\n * 3) Registering custom native views (view managers) and custom event types\n * 4) Registering natively packaged assets/resources (e.g. images) exposed to JS\n *\n * TODO(6788500, 6788507): Implement support for adding custom views, events and resources\n */\npublic interface ReactPackage {\n\n  /**\n   * @param reactContext react application context that can be used to create modules\n   * @return list of native modules to register with the newly created catalyst instance\n   */\n  List<NativeModule> createNativeModules(ReactApplicationContext reactContext);\n\n  /**\n   * @return a list of view managers that should be registered with {@link UIManagerModule}\n   */\n  List<ViewManager> createViewManagers(ReactApplicationContext reactContext);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ReactPackageLogger.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react;\n\n/**\n * Interface for the bridge to call for TTI start and end markers.\n */\npublic interface ReactPackageLogger {\n\n  void startProcessPackage();\n  void endProcessPackage();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;\n\nimport android.content.Context;\nimport android.graphics.Rect;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.util.AttributeSet;\nimport android.util.DisplayMetrics;\nimport android.view.MotionEvent;\nimport android.view.Surface;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.ViewTreeObserver;\nimport android.view.WindowManager;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.GuardedRunnable;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReactMarker;\nimport com.facebook.react.bridge.ReactMarkerConstants;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.modules.appregistry.AppRegistry;\nimport com.facebook.react.modules.core.DeviceEventManagerModule;\nimport com.facebook.react.modules.deviceinfo.DeviceInfoModule;\nimport com.facebook.react.uimanager.DisplayMetricsHolder;\nimport com.facebook.react.uimanager.JSTouchDispatcher;\nimport com.facebook.react.uimanager.MeasureSpecProvider;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.RootView;\nimport com.facebook.react.uimanager.SizeMonitoringFrameLayout;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.systrace.Systrace;\nimport javax.annotation.Nullable;\n\n/**\n * Default root view for catalyst apps. Provides the ability to listen for size changes so that a UI\n * manager can re-layout its elements. It delegates handling touch events for itself and child views\n * and sending those events to JS by using JSTouchDispatcher. This view is overriding {@link\n * ViewGroup#onInterceptTouchEvent} method in order to be notified about the events for all of its\n * children and it's also overriding {@link ViewGroup#requestDisallowInterceptTouchEvent} to make\n * sure that {@link ViewGroup#onInterceptTouchEvent} will get events even when some child view start\n * intercepting it. In case when no child view is interested in handling some particular touch event\n * this view's {@link View#onTouchEvent} will still return true in order to be notified about all\n * subsequent touch events related to that gesture (in case when JS code want to handle that\n * gesture).\n */\npublic class ReactRootView extends SizeMonitoringFrameLayout\n    implements RootView, MeasureSpecProvider {\n\n  /**\n   * Listener interface for react root view events\n   */\n  public interface ReactRootViewEventListener {\n    /**\n     * Called when the react context is attached to a ReactRootView.\n     */\n    void onAttachedToReactInstance(ReactRootView rootView);\n  }\n\n  private @Nullable ReactInstanceManager mReactInstanceManager;\n  private @Nullable String mJSModuleName;\n  private @Nullable Bundle mAppProperties;\n  private @Nullable CustomGlobalLayoutListener mCustomGlobalLayoutListener;\n  private @Nullable ReactRootViewEventListener mRootViewEventListener;\n  private int mRootViewTag;\n  private boolean mIsAttachedToInstance;\n  private boolean mShouldLogContentAppeared;\n  private final JSTouchDispatcher mJSTouchDispatcher = new JSTouchDispatcher(this);\n  private boolean mWasMeasured = false;\n  private int mWidthMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);\n  private int mHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);\n  private @Nullable Runnable mJSEntryPoint;\n\n  public ReactRootView(Context context) {\n    super(context);\n  }\n\n  public ReactRootView(Context context, AttributeSet attrs) {\n    super(context, attrs);\n  }\n\n  public ReactRootView(Context context, AttributeSet attrs, int defStyle) {\n    super(context, attrs, defStyle);\n  }\n\n  @Override\n  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n    Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"ReactRootView.onMeasure\");\n    try {\n      mWidthMeasureSpec = widthMeasureSpec;\n      mHeightMeasureSpec = heightMeasureSpec;\n\n      int width = 0;\n      int height = 0;\n      int widthMode = MeasureSpec.getMode(widthMeasureSpec);\n      if (widthMode == MeasureSpec.AT_MOST || widthMode == MeasureSpec.UNSPECIFIED) {\n        for (int i = 0; i < getChildCount(); i++) {\n          View child = getChildAt(i);\n          int childSize =\n              child.getLeft()\n                  + child.getMeasuredWidth()\n                  + child.getPaddingLeft()\n                  + child.getPaddingRight();\n          width = Math.max(width, childSize);\n        }\n      } else {\n        width = MeasureSpec.getSize(widthMeasureSpec);\n      }\n      int heightMode = MeasureSpec.getMode(heightMeasureSpec);\n      if (heightMode == MeasureSpec.AT_MOST || heightMode == MeasureSpec.UNSPECIFIED) {\n        for (int i = 0; i < getChildCount(); i++) {\n          View child = getChildAt(i);\n          int childSize =\n              child.getTop()\n                  + child.getMeasuredHeight()\n                  + child.getPaddingTop()\n                  + child.getPaddingBottom();\n          height = Math.max(height, childSize);\n        }\n      } else {\n        height = MeasureSpec.getSize(heightMeasureSpec);\n      }\n      setMeasuredDimension(width, height);\n      mWasMeasured = true;\n\n      // Check if we were waiting for onMeasure to attach the root view.\n      if (mReactInstanceManager != null && !mIsAttachedToInstance) {\n        attachToReactInstanceManager();\n      } else {\n        updateRootLayoutSpecs(mWidthMeasureSpec, mHeightMeasureSpec);\n      }\n\n      enableLayoutCalculation();\n\n    } finally {\n      Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n    }\n  }\n\n  @Override\n  public int getWidthMeasureSpec() {\n    if (!mWasMeasured && getLayoutParams() != null && getLayoutParams().width > 0) {\n      return MeasureSpec.makeMeasureSpec(getLayoutParams().width, MeasureSpec.EXACTLY);\n    }\n    return mWidthMeasureSpec;\n  }\n\n  @Override\n  public int getHeightMeasureSpec() {\n    if (!mWasMeasured && getLayoutParams() != null && getLayoutParams().height > 0) {\n      return MeasureSpec.makeMeasureSpec(getLayoutParams().height, MeasureSpec.EXACTLY);\n    }\n    return mHeightMeasureSpec;\n  }\n\n  @Override\n  public void onChildStartedNativeGesture(MotionEvent androidEvent) {\n    if (mReactInstanceManager == null || !mIsAttachedToInstance ||\n      mReactInstanceManager.getCurrentReactContext() == null) {\n      FLog.w(\n        ReactConstants.TAG,\n        \"Unable to dispatch touch to JS as the catalyst instance has not been attached\");\n      return;\n    }\n    ReactContext reactContext = mReactInstanceManager.getCurrentReactContext();\n    EventDispatcher eventDispatcher = reactContext.getNativeModule(UIManagerModule.class)\n      .getEventDispatcher();\n    mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, eventDispatcher);\n  }\n\n  @Override\n  public boolean onInterceptTouchEvent(MotionEvent ev) {\n    dispatchJSTouchEvent(ev);\n    return super.onInterceptTouchEvent(ev);\n  }\n\n  @Override\n  public boolean onTouchEvent(MotionEvent ev) {\n    dispatchJSTouchEvent(ev);\n    super.onTouchEvent(ev);\n    // In case when there is no children interested in handling touch event, we return true from\n    // the root view in order to receive subsequent events related to that gesture\n    return true;\n  }\n\n  private void dispatchJSTouchEvent(MotionEvent event) {\n    if (mReactInstanceManager == null || !mIsAttachedToInstance ||\n      mReactInstanceManager.getCurrentReactContext() == null) {\n      FLog.w(\n        ReactConstants.TAG,\n        \"Unable to dispatch touch to JS as the catalyst instance has not been attached\");\n      return;\n    }\n    ReactContext reactContext = mReactInstanceManager.getCurrentReactContext();\n    EventDispatcher eventDispatcher = reactContext.getNativeModule(UIManagerModule.class)\n      .getEventDispatcher();\n    mJSTouchDispatcher.handleTouchEvent(event, eventDispatcher);\n  }\n\n  @Override\n  public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {\n    // Override in order to still receive events to onInterceptTouchEvent even when some other\n    // views disallow that, but propagate it up the tree if possible.\n    if (getParent() != null) {\n      getParent().requestDisallowInterceptTouchEvent(disallowIntercept);\n    }\n  }\n\n  @Override\n  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n    // No-op since UIManagerModule handles actually laying out children.\n  }\n\n  @Override\n  protected void onAttachedToWindow() {\n    super.onAttachedToWindow();\n    if (mIsAttachedToInstance) {\n      getViewTreeObserver().addOnGlobalLayoutListener(getCustomGlobalLayoutListener());\n    }\n  }\n\n  @Override\n  protected void onDetachedFromWindow() {\n    super.onDetachedFromWindow();\n    if (mIsAttachedToInstance) {\n      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n        getViewTreeObserver().removeOnGlobalLayoutListener(getCustomGlobalLayoutListener());\n      } else {\n        getViewTreeObserver().removeGlobalOnLayoutListener(getCustomGlobalLayoutListener());\n      }\n    }\n  }\n\n  @Override\n  public void onViewAdded(View child) {\n    super.onViewAdded(child);\n\n    if (mShouldLogContentAppeared) {\n      mShouldLogContentAppeared = false;\n\n      if (mJSModuleName != null) {\n        ReactMarker.logMarker(ReactMarkerConstants.CONTENT_APPEARED, mJSModuleName, mRootViewTag);\n      }\n    }\n  }\n\n  /**\n   * {@see #startReactApplication(ReactInstanceManager, String, android.os.Bundle)}\n   */\n  public void startReactApplication(ReactInstanceManager reactInstanceManager, String moduleName) {\n    startReactApplication(reactInstanceManager, moduleName, null);\n  }\n\n  /**\n   * Schedule rendering of the react component rendered by the JS application from the given JS\n   * module (@{param moduleName}) using provided {@param reactInstanceManager} to attach to the\n   * JS context of that manager. Extra parameter {@param launchOptions} can be used to pass initial\n   * properties for the react component.\n   */\n  public void startReactApplication(\n      ReactInstanceManager reactInstanceManager,\n      String moduleName,\n      @Nullable Bundle initialProperties) {\n    Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"startReactApplication\");\n    try {\n      UiThreadUtil.assertOnUiThread();\n\n      // TODO(6788889): Use POJO instead of bundle here, apparently we can't just use WritableMap\n      // here as it may be deallocated in native after passing via JNI bridge, but we want to reuse\n      // it in the case of re-creating the catalyst instance\n      Assertions.assertCondition(\n        mReactInstanceManager == null,\n        \"This root view has already been attached to a catalyst instance manager\");\n\n      mReactInstanceManager = reactInstanceManager;\n      mJSModuleName = moduleName;\n      mAppProperties = initialProperties;\n\n      if (!mReactInstanceManager.hasStartedCreatingInitialContext()) {\n        mReactInstanceManager.createReactContextInBackground();\n      }\n\n      attachToReactInstanceManager();\n\n    } finally {\n      Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n    }\n  }\n\n  private void enableLayoutCalculation() {\n    if (mReactInstanceManager == null) {\n      FLog.w(\n          ReactConstants.TAG,\n          \"Unable to enable layout calculation for uninitialized ReactInstanceManager\");\n      return;\n    }\n    final ReactContext reactApplicationContext = mReactInstanceManager.getCurrentReactContext();\n    if (reactApplicationContext != null) {\n      reactApplicationContext\n          .getCatalystInstance()\n          .getNativeModule(UIManagerModule.class)\n          .getUIImplementation()\n          .enableLayoutCalculationForRootNode(getRootViewTag());\n    }\n  }\n\n  private void updateRootLayoutSpecs(final int widthMeasureSpec, final int heightMeasureSpec) {\n    if (mReactInstanceManager == null) {\n      FLog.w(\n          ReactConstants.TAG,\n          \"Unable to update root layout specs for uninitialized ReactInstanceManager\");\n      return;\n    }\n    final ReactContext reactApplicationContext = mReactInstanceManager.getCurrentReactContext();\n    if (reactApplicationContext != null) {\n      reactApplicationContext.runOnNativeModulesQueueThread(\n          new GuardedRunnable(reactApplicationContext) {\n            @Override\n            public void runGuarded() {\n              reactApplicationContext\n                  .getCatalystInstance()\n                  .getNativeModule(UIManagerModule.class)\n                  .updateRootLayoutSpecs(getRootViewTag(), widthMeasureSpec, heightMeasureSpec);\n            }\n          });\n    }\n  }\n\n  /**\n   * Unmount the react application at this root view, reclaiming any JS memory associated with that\n   * application. If {@link #startReactApplication} is called, this method must be called before the\n   * ReactRootView is garbage collected (typically in your Activity's onDestroy, or in your\n   * Fragment's onDestroyView).\n   */\n  public void unmountReactApplication() {\n    if (mReactInstanceManager != null && mIsAttachedToInstance) {\n      mReactInstanceManager.detachRootView(this);\n      mIsAttachedToInstance = false;\n    }\n    mShouldLogContentAppeared = false;\n  }\n\n  public void onAttachedToReactInstance() {\n    if (mRootViewEventListener != null) {\n      mRootViewEventListener.onAttachedToReactInstance(this);\n    }\n  }\n\n  public void setEventListener(ReactRootViewEventListener eventListener) {\n    mRootViewEventListener = eventListener;\n  }\n\n  /* package */ String getJSModuleName() {\n    return Assertions.assertNotNull(mJSModuleName);\n  }\n\n  public @Nullable Bundle getAppProperties() {\n    return mAppProperties;\n  }\n\n  public void setAppProperties(@Nullable Bundle appProperties) {\n    UiThreadUtil.assertOnUiThread();\n    mAppProperties = appProperties;\n    if (getRootViewTag() != 0) {\n      invokeJSEntryPoint();\n    }\n  }\n\n  /**\n   * Calls into JS to start the React application. Can be called multiple times with the\n   * same rootTag, which will re-render the application from the root.\n   */\n  /*package */ void invokeJSEntryPoint() {\n    if (mJSEntryPoint == null) {\n      defaultJSEntryPoint();\n    } else {\n      mJSEntryPoint.run();\n    }\n  }\n\n  /**\n   * Set a custom entry point for invoking JS. By default, this is AppRegistry.runApplication\n   * @param jsEntryPoint\n   */\n  public void setJSEntryPoint(Runnable jsEntryPoint) {\n    mJSEntryPoint = jsEntryPoint;\n  }\n\n  public void invokeDefaultJSEntryPoint(@Nullable Bundle appProperties) {\n    UiThreadUtil.assertOnUiThread();\n    if (appProperties != null) {\n      mAppProperties = appProperties;\n    }\n    defaultJSEntryPoint();\n  }\n\n  /**\n   * Calls the default entry point into JS which is AppRegistry.runApplication()\n   */\n  private void defaultJSEntryPoint() {\n      Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"ReactRootView.runApplication\");\n      try {\n        if (mReactInstanceManager == null || !mIsAttachedToInstance) {\n          return;\n        }\n\n        ReactContext reactContext = mReactInstanceManager.getCurrentReactContext();\n        if (reactContext == null) {\n          return;\n        }\n\n        CatalystInstance catalystInstance = reactContext.getCatalystInstance();\n\n        WritableNativeMap appParams = new WritableNativeMap();\n        appParams.putDouble(\"rootTag\", getRootViewTag());\n        @Nullable Bundle appProperties = getAppProperties();\n        if (appProperties != null) {\n          appParams.putMap(\"initialProps\", Arguments.fromBundle(appProperties));\n        }\n\n        mShouldLogContentAppeared = true;\n\n        String jsAppModuleName = getJSModuleName();\n        catalystInstance.getJSModule(AppRegistry.class).runApplication(jsAppModuleName, appParams);\n      } finally {\n        Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n      }\n  }\n\n  /**\n   * Is used by unit test to setup mIsAttachedToWindow flags, that will let this\n   * view to be properly attached to catalyst instance by startReactApplication call\n   */\n  @VisibleForTesting\n  /* package */ void simulateAttachForTesting() {\n    mIsAttachedToInstance = true;\n  }\n\n  private CustomGlobalLayoutListener getCustomGlobalLayoutListener() {\n    if (mCustomGlobalLayoutListener == null) {\n      mCustomGlobalLayoutListener = new CustomGlobalLayoutListener();\n    }\n    return mCustomGlobalLayoutListener;\n  }\n\n  private void attachToReactInstanceManager() {\n    Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"attachToReactInstanceManager\");\n    try {\n      if (mIsAttachedToInstance) {\n        return;\n      }\n\n      mIsAttachedToInstance = true;\n      Assertions.assertNotNull(mReactInstanceManager).attachRootView(this);\n      getViewTreeObserver().addOnGlobalLayoutListener(getCustomGlobalLayoutListener());\n    } finally {\n      Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n    }\n  }\n\n  @Override\n  protected void finalize() throws Throwable {\n    super.finalize();\n    Assertions.assertCondition(\n      !mIsAttachedToInstance,\n      \"The application this ReactRootView was rendering was not unmounted before the \" +\n        \"ReactRootView was garbage collected. This usually means that your application is \" +\n        \"leaking large amounts of memory. To solve this, make sure to call \" +\n        \"ReactRootView#unmountReactApplication in the onDestroy() of your hosting Activity or in \" +\n        \"the onDestroyView() of your hosting Fragment.\");\n  }\n\n  public int getRootViewTag() {\n    return mRootViewTag;\n  }\n\n  public void setRootViewTag(int rootViewTag) {\n    mRootViewTag = rootViewTag;\n  }\n\n  @Nullable\n  public ReactInstanceManager getReactInstanceManager() {\n    return mReactInstanceManager;\n  }\n\n  private class CustomGlobalLayoutListener implements ViewTreeObserver.OnGlobalLayoutListener {\n    private final Rect mVisibleViewArea;\n    private final int mMinKeyboardHeightDetected;\n\n    private int mKeyboardHeight = 0;\n    private int mDeviceRotation = 0;\n    private DisplayMetrics mWindowMetrics = new DisplayMetrics();\n    private DisplayMetrics mScreenMetrics = new DisplayMetrics();\n\n    /* package */ CustomGlobalLayoutListener() {\n      DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(getContext().getApplicationContext());\n      mVisibleViewArea = new Rect();\n      mMinKeyboardHeightDetected = (int) PixelUtil.toPixelFromDIP(60);\n    }\n\n    @Override\n    public void onGlobalLayout() {\n      if (mReactInstanceManager == null || !mIsAttachedToInstance ||\n        mReactInstanceManager.getCurrentReactContext() == null) {\n        return;\n      }\n      checkForKeyboardEvents();\n      checkForDeviceOrientationChanges();\n      checkForDeviceDimensionsChanges();\n    }\n\n    private void checkForKeyboardEvents() {\n      getRootView().getWindowVisibleDisplayFrame(mVisibleViewArea);\n      final int heightDiff =\n        DisplayMetricsHolder.getWindowDisplayMetrics().heightPixels - mVisibleViewArea.bottom;\n      if (mKeyboardHeight != heightDiff && heightDiff > mMinKeyboardHeightDetected) {\n        // keyboard is now showing, or the keyboard height has changed\n        mKeyboardHeight = heightDiff;\n        WritableMap params = Arguments.createMap();\n        WritableMap coordinates = Arguments.createMap();\n        coordinates.putDouble(\"screenY\", PixelUtil.toDIPFromPixel(mVisibleViewArea.bottom));\n        coordinates.putDouble(\"screenX\", PixelUtil.toDIPFromPixel(mVisibleViewArea.left));\n        coordinates.putDouble(\"width\", PixelUtil.toDIPFromPixel(mVisibleViewArea.width()));\n        coordinates.putDouble(\"height\", PixelUtil.toDIPFromPixel(mKeyboardHeight));\n        params.putMap(\"endCoordinates\", coordinates);\n        sendEvent(\"keyboardDidShow\", params);\n      } else if (mKeyboardHeight != 0 && heightDiff <= mMinKeyboardHeightDetected) {\n        // keyboard is now hidden\n        mKeyboardHeight = 0;\n        sendEvent(\"keyboardDidHide\", null);\n      }\n    }\n\n    private void checkForDeviceOrientationChanges() {\n      final int rotation =\n        ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE))\n          .getDefaultDisplay().getRotation();\n      if (mDeviceRotation == rotation) {\n        return;\n      }\n      mDeviceRotation = rotation;\n      emitOrientationChanged(rotation);\n    }\n\n    private void checkForDeviceDimensionsChanges() {\n      // Get current display metrics.\n      DisplayMetricsHolder.initDisplayMetrics(getContext());\n      // Check changes to both window and screen display metrics since they may not update at the same time.\n      if (!areMetricsEqual(mWindowMetrics, DisplayMetricsHolder.getWindowDisplayMetrics()) ||\n        !areMetricsEqual(mScreenMetrics, DisplayMetricsHolder.getScreenDisplayMetrics())) {\n        mWindowMetrics.setTo(DisplayMetricsHolder.getWindowDisplayMetrics());\n        mScreenMetrics.setTo(DisplayMetricsHolder.getScreenDisplayMetrics());\n        emitUpdateDimensionsEvent();\n      }\n    }\n\n    private boolean areMetricsEqual(DisplayMetrics displayMetrics, DisplayMetrics otherMetrics) {\n      if (Build.VERSION.SDK_INT >= 17) {\n        return displayMetrics.equals(otherMetrics);\n      } else {\n        // DisplayMetrics didn't have an equals method before API 17.\n        // Check all public fields manually.\n        return displayMetrics.widthPixels == otherMetrics.widthPixels &&\n          displayMetrics.heightPixels == otherMetrics.heightPixels &&\n          displayMetrics.density == otherMetrics.density &&\n          displayMetrics.densityDpi == otherMetrics.densityDpi &&\n          displayMetrics.scaledDensity == otherMetrics.scaledDensity &&\n          displayMetrics.xdpi == otherMetrics.xdpi &&\n          displayMetrics.ydpi == otherMetrics.ydpi;\n      }\n    }\n\n    private void emitOrientationChanged(final int newRotation) {\n      String name;\n      double rotationDegrees;\n      boolean isLandscape = false;\n\n      switch (newRotation) {\n        case Surface.ROTATION_0:\n          name = \"portrait-primary\";\n          rotationDegrees = 0.0;\n          break;\n        case Surface.ROTATION_90:\n          name = \"landscape-primary\";\n          rotationDegrees = -90.0;\n          isLandscape = true;\n          break;\n        case Surface.ROTATION_180:\n          name = \"portrait-secondary\";\n          rotationDegrees = 180.0;\n          break;\n        case Surface.ROTATION_270:\n          name = \"landscape-secondary\";\n          rotationDegrees = 90.0;\n          isLandscape = true;\n          break;\n        default:\n          return;\n      }\n      WritableMap map = Arguments.createMap();\n      map.putString(\"name\", name);\n      map.putDouble(\"rotationDegrees\", rotationDegrees);\n      map.putBoolean(\"isLandscape\", isLandscape);\n\n      sendEvent(\"namedOrientationDidChange\", map);\n    }\n\n    private void emitUpdateDimensionsEvent() {\n      mReactInstanceManager\n          .getCurrentReactContext()\n          .getNativeModule(DeviceInfoModule.class)\n          .emitUpdateDimensionsEvent();\n    }\n\n    private void sendEvent(String eventName, @Nullable WritableMap params) {\n      if (mReactInstanceManager != null) {\n        mReactInstanceManager.getCurrentReactContext()\n            .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)\n            .emit(eventName, params);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\nimport java.util.List;\nimport javax.annotation.Nullable;\n\npublic interface ViewManagerOnDemandReactPackage {\n  /**\n   * Provides a list of names of ViewManagers with which these modules can be accessed from JS.\n   * Typically, this is ViewManager.getName().\n   *\n   * @param loadClasses defines if View Managers classes should be loaded or be avoided.\n   */\n  @Nullable List<String> getViewManagerNames(ReactApplicationContext reactContext, boolean loadClasses);\n  /**\n   * Creates and returns a ViewManager with a specific name {@param viewManagerName}. It's up to an\n   * implementing package how to interpret the name.\n   *\n   * @param loadClasses defines if View Managers classes should be loaded or be avoided.\n   */\n  @Nullable\n  ViewManager createViewManager(\n      ReactApplicationContext reactContext, String viewManagerName, boolean loadClasses);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/AdditionAnimatedNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.JSApplicationCausedNativeException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\n\n/**\n * Animated node that plays a role of value aggregator. It takes two or more value nodes as an input\n * and outputs a sum of values outputted by those nodes.\n */\n/*package*/ class AdditionAnimatedNode extends ValueAnimatedNode {\n\n  private final NativeAnimatedNodesManager mNativeAnimatedNodesManager;\n  private final int[] mInputNodes;\n\n  public AdditionAnimatedNode(\n      ReadableMap config,\n      NativeAnimatedNodesManager nativeAnimatedNodesManager) {\n    mNativeAnimatedNodesManager = nativeAnimatedNodesManager;\n    ReadableArray inputNodes = config.getArray(\"input\");\n    mInputNodes = new int[inputNodes.size()];\n    for (int i = 0; i < mInputNodes.length; i++) {\n      mInputNodes[i] = inputNodes.getInt(i);\n    }\n  }\n\n  @Override\n  public void update() {\n    mValue = 0;\n    for (int i = 0; i < mInputNodes.length; i++) {\n      AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);\n      if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {\n        mValue += ((ValueAnimatedNode) animatedNode).getValue();\n      } else {\n        throw new JSApplicationCausedNativeException(\"Illegal node ID set as an input for \" +\n          \"Animated.Add node\");\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.infer.annotation.Assertions;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport javax.annotation.Nullable;\n\n/**\n * Base class for all Animated.js library node types that can be created on the \"native\" side.\n */\n/*package*/ abstract class AnimatedNode {\n\n  public static final int INITIAL_BFS_COLOR = 0;\n\n  private static final int DEFAULT_ANIMATED_NODE_CHILD_COUNT = 1;\n\n  /*package*/ @Nullable List<AnimatedNode> mChildren; /* lazy-initialized when a child is added */\n  /*package*/ int mActiveIncomingNodes = 0;\n  /*package*/ int mBFSColor = INITIAL_BFS_COLOR;\n  /*package*/ int mTag = -1;\n\n  public final void addChild(AnimatedNode child) {\n    if (mChildren == null) {\n      mChildren = new ArrayList<>(DEFAULT_ANIMATED_NODE_CHILD_COUNT);\n    }\n    Assertions.assertNotNull(mChildren).add(child);\n    child.onAttachedToNode(this);\n  }\n\n  public final void removeChild(AnimatedNode child) {\n    if (mChildren == null) {\n      return;\n    }\n    child.onDetachedFromNode(this);\n    mChildren.remove(child);\n  }\n\n  /**\n   * Subclasses may want to override this method in order to store a reference to the parent of a\n   * given node that can then be used to calculate current node's value in {@link #update}.\n   * In that case it is important to also override {@link #onDetachedFromNode} to clear that\n   * reference once current node gets detached.\n   */\n  public void onAttachedToNode(AnimatedNode parent) {\n  }\n\n  /**\n   * See {@link #onAttachedToNode}\n   */\n  public void onDetachedFromNode(AnimatedNode parent) {\n  }\n\n  /**\n   * This method will be run on each node at most once every repetition of the animation loop. It\n   * will be executed on a node only when all the node's parent has already been updated. Therefore\n   * it can be used to calculate node's value.\n   */\n  public void update() {\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeValueListener.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\n/**\n * Interface used to listen to {@link ValueAnimatedNode} updates.\n */\npublic interface AnimatedNodeValueListener {\n  void onValueUpdate(double value);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/AnimationDriver.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.Callback;\n\n/**\n * Base class for different types of animation drivers. Can be used to implement simple time-based\n * animations as well as spring based animations.\n */\n/*package*/ abstract class AnimationDriver {\n\n  /*package*/ boolean mHasFinished = false;\n  /*package*/ ValueAnimatedNode mAnimatedValue;\n  /*package*/ Callback mEndCallback;\n  /*package*/ int mId;\n\n  /**\n   * This method gets called in the main animation loop with a frame time passed down from the\n   * android choreographer callback.\n   */\n  public abstract void runAnimationStep(long frameTimeNanos);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"animated\",\n    srcs = glob([\n        \"*.java\",\n    ]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/DecayAnimation.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.ReadableMap;\n\n/**\n * Implementation of {@link AnimationDriver} providing support for decay animations. The\n * implementation is copied from the JS version in {@code AnimatedImplementation.js}.\n */\npublic class DecayAnimation extends AnimationDriver {\n\n  private final double mVelocity;\n  private final double mDeceleration;\n\n  private long mStartFrameTimeMillis = -1;\n  private double mFromValue = 0d;\n  private double mLastValue = 0d;\n  private int mIterations;\n  private int mCurrentLoop;\n\n  public DecayAnimation(ReadableMap config) {\n    mVelocity = config.getDouble(\"velocity\");\n    mDeceleration = config.getDouble(\"deceleration\");\n    mIterations = config.hasKey(\"iterations\") ? config.getInt(\"iterations\") : 1;\n    mCurrentLoop = 1;\n    mHasFinished = mIterations == 0;\n  }\n\n  @Override\n  public void runAnimationStep(long frameTimeNanos) {\n    long frameTimeMillis = frameTimeNanos / 1000000;\n    if (mStartFrameTimeMillis == -1) {\n      // since this is the first animation step, consider the start to be on the previous frame\n      mStartFrameTimeMillis = frameTimeMillis - 16;\n      if (mFromValue == mLastValue) { // first iteration, assign mFromValue based on mAnimatedValue\n        mFromValue = mAnimatedValue.mValue;\n      } else { // not the first iteration, reset mAnimatedValue based on mFromValue\n        mAnimatedValue.mValue = mFromValue;\n      }\n      mLastValue = mAnimatedValue.mValue;\n    }\n\n    final double value = mFromValue +\n      (mVelocity / (1 - mDeceleration)) *\n        (1 - Math.exp(-(1 - mDeceleration) * (frameTimeMillis - mStartFrameTimeMillis)));\n\n    if (Math.abs(mLastValue - value) < 0.1) {\n\n      if (mIterations == -1 || mCurrentLoop < mIterations) { // looping animation, return to start\n        // set mStartFrameTimeMillis to -1 to reset instance variables on the next runAnimationStep\n        mStartFrameTimeMillis = -1;\n        mCurrentLoop++;\n      } else { // animation has completed\n        mHasFinished = true;\n        return;\n      }\n    }\n\n    mLastValue = value;\n    mAnimatedValue.mValue = value;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/DiffClampAnimatedNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.JSApplicationCausedNativeException;\nimport com.facebook.react.bridge.ReadableMap;\n\n/*package*/ class DiffClampAnimatedNode extends ValueAnimatedNode {\n  private final NativeAnimatedNodesManager mNativeAnimatedNodesManager;\n  private final int mInputNodeTag;\n  private final double mMin;\n  private final double mMax;\n\n  private double mLastValue;\n\n  public DiffClampAnimatedNode(\n    ReadableMap config,\n    NativeAnimatedNodesManager nativeAnimatedNodesManager) {\n    mNativeAnimatedNodesManager = nativeAnimatedNodesManager;\n    mInputNodeTag = config.getInt(\"input\");\n    mMin = config.getDouble(\"min\");\n    mMax = config.getDouble(\"max\");\n\n    mValue = mLastValue = 0;\n  }\n\n  @Override\n  public void update() {\n    double value = getInputNodeValue();\n\n    double diff = value - mLastValue;\n    mLastValue = value;\n    mValue = Math.min(Math.max(mValue + diff, mMin), mMax);\n  }\n\n  private double getInputNodeValue() {\n    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodeTag);\n    if (animatedNode == null || !(animatedNode instanceof ValueAnimatedNode)) {\n      throw new JSApplicationCausedNativeException(\"Illegal node ID set as an input for \" +\n        \"Animated.DiffClamp node\");\n\n    }\n\n    return ((ValueAnimatedNode) animatedNode).getValue();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/DivisionAnimatedNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.JSApplicationCausedNativeException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\n\n/**\n * Animated node which takes two or more value node as an input and outputs an in-order\n * division of their values.\n */\n/*package*/ class DivisionAnimatedNode extends ValueAnimatedNode {\n\n  private final NativeAnimatedNodesManager mNativeAnimatedNodesManager;\n  private final int[] mInputNodes;\n\n  public DivisionAnimatedNode(\n      ReadableMap config,\n      NativeAnimatedNodesManager nativeAnimatedNodesManager) {\n    mNativeAnimatedNodesManager = nativeAnimatedNodesManager;\n    ReadableArray inputNodes = config.getArray(\"input\");\n    mInputNodes = new int[inputNodes.size()];\n    for (int i = 0; i < mInputNodes.length; i++) {\n      mInputNodes[i] = inputNodes.getInt(i);\n    }\n  }\n\n  @Override\n  public void update() {\n    for (int i = 0; i < mInputNodes.length; i++) {\n      AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);\n      if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {\n        double value = ((ValueAnimatedNode) animatedNode).getValue();\n        if (i == 0) {\n          mValue = value;\n          continue;\n        }\n        if (value == 0) {\n          throw new JSApplicationCausedNativeException(\"Detected a division by zero in \" +\n            \"Animated.divide node\");\n        }\n        mValue /= value;\n      } else {\n        throw new JSApplicationCausedNativeException(\"Illegal node ID set as an input for \" +\n          \"Animated.divide node\");\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/EventAnimationDriver.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\nimport java.util.List;\n\nimport javax.annotation.Nullable;\n\n/**\n * Handles updating a {@link ValueAnimatedNode} when an event gets dispatched.\n */\n/* package */ class EventAnimationDriver implements RCTEventEmitter {\n  private List<String> mEventPath;\n  /* package */ ValueAnimatedNode mValueNode;\n\n  public EventAnimationDriver(List<String> eventPath, ValueAnimatedNode valueNode) {\n    mEventPath = eventPath;\n    mValueNode = valueNode;\n  }\n\n  @Override\n  public void receiveEvent(int targetTag, String eventName, @Nullable WritableMap event) {\n    if (event == null) {\n      throw new IllegalArgumentException(\"Native animated events must have event data.\");\n    }\n\n    // Get the new value for the node by looking into the event map using the provided event path.\n    ReadableMap curMap = event;\n    for (int i = 0; i < mEventPath.size() - 1; i++) {\n      curMap = curMap.getMap(mEventPath.get(i));\n    }\n\n    mValueNode.mValue = curMap.getDouble(mEventPath.get(mEventPath.size() - 1));\n  }\n\n  @Override\n  public void receiveTouches(String eventName, WritableArray touches, WritableArray changedIndices) {\n    throw new RuntimeException(\"receiveTouches is not support by native animated events\");\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/FrameBasedAnimationDriver.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\n\n/**\n * Implementation of {@link AnimationDriver} which provides a support for simple time-based\n * animations that are pre-calculate on the JS side. For each animation frame JS provides a value\n * from 0 to 1 that indicates a progress of the animation at that frame.\n */\nclass FrameBasedAnimationDriver extends AnimationDriver {\n\n  // 60FPS\n  private static final double FRAME_TIME_MILLIS = 1000d / 60d;\n\n  private long mStartFrameTimeNanos = -1;\n  private final double[] mFrames;\n  private final double mToValue;\n  private double mFromValue;\n  private int mIterations;\n  private int mCurrentLoop;\n\n  FrameBasedAnimationDriver(ReadableMap config) {\n    ReadableArray frames = config.getArray(\"frames\");\n    int numberOfFrames = frames.size();\n    mFrames = new double[numberOfFrames];\n    for (int i = 0; i < numberOfFrames; i++) {\n      mFrames[i] = frames.getDouble(i);\n    }\n    mToValue = config.getDouble(\"toValue\");\n    mIterations = config.hasKey(\"iterations\") ? config.getInt(\"iterations\") : 1;\n    mCurrentLoop = 1;\n    mHasFinished = mIterations == 0;\n  }\n\n  @Override\n  public void runAnimationStep(long frameTimeNanos) {\n    if (mStartFrameTimeNanos < 0) {\n      mStartFrameTimeNanos = frameTimeNanos;\n      mFromValue = mAnimatedValue.mValue;\n    }\n    long timeFromStartMillis = (frameTimeNanos - mStartFrameTimeNanos) / 1000000;\n    int frameIndex = (int) (timeFromStartMillis / FRAME_TIME_MILLIS);\n    if (frameIndex < 0) {\n      throw new IllegalStateException(\"Calculated frame index should never be lower than 0\");\n    } else if (mHasFinished) {\n      // nothing to do here\n      return;\n    }\n    double nextValue;\n    if (frameIndex >= mFrames.length - 1) {\n      nextValue = mToValue;\n      if (mIterations == -1 || mCurrentLoop < mIterations) { // looping animation, return to start\n        mStartFrameTimeNanos = frameTimeNanos;\n        mCurrentLoop++;\n      } else { // animation has completed, no more frames left\n        mHasFinished = true;\n      }\n    } else {\n      nextValue = mFromValue + mFrames[frameIndex] * (mToValue - mFromValue);\n    }\n    mAnimatedValue.mValue = nextValue;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/InterpolationAnimatedNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * <p>This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport javax.annotation.Nullable;\n\n/**\n * Animated node that corresponds to {@code AnimatedInterpolation} from AnimatedImplementation.js.\n *\n * Currently only a linear interpolation is supported on an input range of an arbitrary size.\n */\n/*package*/ class InterpolationAnimatedNode extends ValueAnimatedNode {\n\n  public static final String EXTRAPOLATE_TYPE_IDENTITY = \"identity\";\n  public static final String EXTRAPOLATE_TYPE_CLAMP = \"clamp\";\n  public static final String EXTRAPOLATE_TYPE_EXTEND = \"extend\";\n\n  private static double[] fromDoubleArray(ReadableArray ary) {\n    double[] res = new double[ary.size()];\n    for (int i = 0; i < res.length; i++) {\n      res[i] = ary.getDouble(i);\n    }\n    return res;\n  }\n\n  private static double interpolate(\n      double value,\n      double inputMin,\n      double inputMax,\n      double outputMin,\n      double outputMax,\n      String extrapolateLeft,\n      String extrapolateRight) {\n    double result = value;\n\n    // Extrapolate\n    if (result < inputMin) {\n      switch (extrapolateLeft) {\n        case EXTRAPOLATE_TYPE_IDENTITY:\n          return result;\n        case EXTRAPOLATE_TYPE_CLAMP:\n          result = inputMin;\n          break;\n        case EXTRAPOLATE_TYPE_EXTEND:\n          break;\n        default:\n          throw new JSApplicationIllegalArgumentException(\n            \"Invalid extrapolation type \" + extrapolateLeft + \"for left extrapolation\");\n      }\n    }\n\n    if (result > inputMax) {\n      switch (extrapolateRight) {\n        case EXTRAPOLATE_TYPE_IDENTITY:\n          return result;\n        case EXTRAPOLATE_TYPE_CLAMP:\n          result = inputMax;\n          break;\n        case EXTRAPOLATE_TYPE_EXTEND:\n          break;\n        default:\n          throw new JSApplicationIllegalArgumentException(\n            \"Invalid extrapolation type \" + extrapolateRight + \"for right extrapolation\");\n      }\n    }\n\n    return outputMin + (outputMax - outputMin) *\n      (result - inputMin) / (inputMax - inputMin);\n  }\n\n  /*package*/ static double interpolate(\n      double value,\n      double[] inputRange,\n      double[] outputRange,\n      String extrapolateLeft,\n      String extrapolateRight\n  ) {\n    int rangeIndex = findRangeIndex(value, inputRange);\n    return interpolate(\n      value,\n      inputRange[rangeIndex],\n      inputRange[rangeIndex + 1],\n      outputRange[rangeIndex],\n      outputRange[rangeIndex + 1],\n      extrapolateLeft,\n      extrapolateRight);\n  }\n\n  private static int findRangeIndex(double value, double[] ranges) {\n    int index;\n    for (index = 1; index < ranges.length - 1; index++) {\n      if (ranges[index] >= value) {\n        break;\n      }\n    }\n    return index - 1;\n  }\n\n  private final double mInputRange[];\n  private final double mOutputRange[];\n  private final String mExtrapolateLeft;\n  private final String mExtrapolateRight;\n  private @Nullable ValueAnimatedNode mParent;\n\n  public InterpolationAnimatedNode(ReadableMap config) {\n    mInputRange = fromDoubleArray(config.getArray(\"inputRange\"));\n    mOutputRange = fromDoubleArray(config.getArray(\"outputRange\"));\n    mExtrapolateLeft = config.getString(\"extrapolateLeft\");\n    mExtrapolateRight = config.getString(\"extrapolateRight\");\n  }\n\n  @Override\n  public void onAttachedToNode(AnimatedNode parent) {\n    if (mParent != null) {\n      throw new IllegalStateException(\"Parent already attached\");\n    }\n    if (!(parent instanceof ValueAnimatedNode)) {\n      throw new IllegalArgumentException(\"Parent is of an invalid type\");\n    }\n    mParent = (ValueAnimatedNode) parent;\n  }\n\n  @Override\n  public void onDetachedFromNode(AnimatedNode parent) {\n    if (parent != mParent) {\n      throw new IllegalArgumentException(\"Invalid parent node provided\");\n    }\n    mParent = null;\n  }\n\n  @Override\n  public void update() {\n    if (mParent == null) {\n      // The graph is in the middle of being created, just skip this\n      // unattached node.\n      return;\n    }\n    mValue = interpolate(mParent.getValue(), mInputRange, mOutputRange, mExtrapolateLeft, mExtrapolateRight);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/ModulusAnimatedNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.JSApplicationCausedNativeException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\n\n/*package*/ class ModulusAnimatedNode extends ValueAnimatedNode {\n\n  private final NativeAnimatedNodesManager mNativeAnimatedNodesManager;\n  private final int mInputNode;\n  private final int mModulus;\n\n  public ModulusAnimatedNode(\n      ReadableMap config,\n      NativeAnimatedNodesManager nativeAnimatedNodesManager) {\n    mNativeAnimatedNodesManager = nativeAnimatedNodesManager;\n    mInputNode = config.getInt(\"input\");\n    mModulus = config.getInt(\"modulus\");\n  }\n\n  @Override\n  public void update() {\n    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNode);\n    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {\n      mValue = ((ValueAnimatedNode) animatedNode).getValue() % mModulus;\n    } else {\n      throw new JSApplicationCausedNativeException(\"Illegal node ID set as an input for \" +\n        \"Animated.modulus node\");\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/MultiplicationAnimatedNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.JSApplicationCausedNativeException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\n\n/**\n * Animated node which takes two or more value node as an input and outputs a product of their\n * values\n */\n/*package*/ class MultiplicationAnimatedNode extends ValueAnimatedNode {\n\n  private final NativeAnimatedNodesManager mNativeAnimatedNodesManager;\n  private final int[] mInputNodes;\n\n  public MultiplicationAnimatedNode(\n      ReadableMap config,\n      NativeAnimatedNodesManager nativeAnimatedNodesManager) {\n    mNativeAnimatedNodesManager = nativeAnimatedNodesManager;\n    ReadableArray inputNodes = config.getArray(\"input\");\n    mInputNodes = new int[inputNodes.size()];\n    for (int i = 0; i < mInputNodes.length; i++) {\n      mInputNodes[i] = inputNodes.getInt(i);\n    }\n  }\n\n  @Override\n  public void update() {\n    mValue = 1;\n    for (int i = 0; i < mInputNodes.length; i++) {\n      AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);\n      if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {\n        mValue *= ((ValueAnimatedNode) animatedNode).getValue();\n      } else {\n        throw new JSApplicationCausedNativeException(\"Illegal node ID set as an input for \" +\n          \"Animated.multiply node\");\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport javax.annotation.Nullable;\n\nimport java.util.ArrayList;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.core.DeviceEventManagerModule;\nimport com.facebook.react.modules.core.ReactChoreographer;\nimport com.facebook.react.uimanager.GuardedFrameCallback;\nimport com.facebook.react.uimanager.NativeViewHierarchyManager;\nimport com.facebook.react.uimanager.UIBlock;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.UIManagerModuleListener;\n\n/**\n * Module that exposes interface for creating and managing animated nodes on the \"native\" side.\n *\n * Animated.js library is based on a concept of a graph where nodes are values or transform\n * operations (such as interpolation, addition, etc) and connection are used to describe how change\n * of the value in one node can affect other nodes.\n *\n * Few examples of the nodes that can be created on the JS side:\n *  - Animated.Value is a simplest type of node with a numeric value which can be driven by an\n *    animation engine (spring, decay, etc) or by calling setValue on it directly from JS\n *  - Animated.add is a type of node that may have two or more input nodes. It outputs the sum of\n *    all the input node values\n *  - interpolate - is actually a method you can call on any node and it creates a new node that\n *    takes the parent node as an input and outputs its interpolated value (e.g. if you have value\n *    that can animate from 0 to 1 you can create interpolated node and set output range to be 0 to\n *    100 and when the input node changes the output of interpolated node will multiply the values\n *    by 100)\n *\n * You can mix and chain nodes however you like and this way create nodes graph with connections\n * between them.\n *\n * To map animated node values to view properties there is a special type of a node: AnimatedProps.\n * It is created by AnimatedImplementation whenever you render Animated.View and stores a mapping\n * from the view properties to the corresponding animated values (so it's actually also a node with\n * connections to the value nodes).\n *\n * Last \"special\" elements of the the graph are \"animation drivers\". Those are objects (represented\n * as a graph nodes too) that based on some criteria updates attached values every frame (we have\n * few types of those, e.g., spring, timing, decay). Animation objects can be \"started\" and\n * \"stopped\". Those are like \"pulse generators\" for the rest of the nodes graph. Those pulses then\n * propagate along the graph to the children nodes up to the special node type: AnimatedProps which\n * then can be used to calculate property update map for a view.\n *\n * This class acts as a proxy between the \"native\" API that can be called from JS and the main class\n * that coordinates all the action: {@link NativeAnimatedNodesManager}. Since all the methods from\n * {@link NativeAnimatedNodesManager} need to be called from the UI thread, we we create a queue of\n * animated graph operations that is then enqueued to be executed in the UI Thread at the end of the\n * batch of JS->native calls (similarly to how it's handled in {@link UIManagerModule}). This\n * isolates us from the problems that may be caused by concurrent updates of animated graph while UI\n * thread is \"executing\" the animation loop.\n */\n@ReactModule(name = NativeAnimatedModule.NAME)\npublic class NativeAnimatedModule extends ReactContextBaseJavaModule implements\n    LifecycleEventListener, UIManagerModuleListener {\n\n  protected static final String NAME = \"NativeAnimatedModule\";\n\n  private interface UIThreadOperation {\n    void execute(NativeAnimatedNodesManager animatedNodesManager);\n  }\n\n  private final GuardedFrameCallback mAnimatedFrameCallback;\n  private final ReactChoreographer mReactChoreographer;\n  private ArrayList<UIThreadOperation> mOperations = new ArrayList<>();\n  private ArrayList<UIThreadOperation> mPreOperations = new ArrayList<>();\n\n  private @Nullable NativeAnimatedNodesManager mNodesManager;\n\n  public NativeAnimatedModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n\n    mReactChoreographer = ReactChoreographer.getInstance();\n    mAnimatedFrameCallback = new GuardedFrameCallback(reactContext) {\n      @Override\n      protected void doFrameGuarded(final long frameTimeNanos) {\n        NativeAnimatedNodesManager nodesManager = getNodesManager();\n        if (nodesManager.hasActiveAnimations()) {\n          nodesManager.runUpdates(frameTimeNanos);\n        }\n\n        // TODO: Would be great to avoid adding this callback in case there are no active animations\n        // and no outstanding tasks on the operations queue. Apparently frame callbacks can only\n        // be posted from the UI thread and therefore we cannot schedule them directly from\n        // @ReactMethod methods\n        Assertions.assertNotNull(mReactChoreographer).postFrameCallback(\n          ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE,\n          mAnimatedFrameCallback);\n      }\n    };\n  }\n\n  @Override\n  public void initialize() {\n    ReactApplicationContext reactCtx = getReactApplicationContext();\n    UIManagerModule uiManager = reactCtx.getNativeModule(UIManagerModule.class);\n    reactCtx.addLifecycleEventListener(this);\n    uiManager.addUIManagerListener(this);\n  }\n\n  @Override\n  public void onHostResume() {\n    enqueueFrameCallback();\n  }\n\n  @Override\n  public void willDispatchViewUpdates(final UIManagerModule uiManager) {\n    if (mOperations.isEmpty() && mPreOperations.isEmpty()) {\n      return;\n    }\n    final ArrayList<UIThreadOperation> preOperations = mPreOperations;\n    final ArrayList<UIThreadOperation> operations = mOperations;\n    mPreOperations = new ArrayList<>();\n    mOperations = new ArrayList<>();\n    uiManager.prependUIBlock(new UIBlock() {\n      @Override\n      public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {\n        NativeAnimatedNodesManager nodesManager = getNodesManager();\n        for (UIThreadOperation operation : preOperations) {\n          operation.execute(nodesManager);\n        }\n      }\n    });\n    uiManager.addUIBlock(new UIBlock() {\n      @Override\n      public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {\n        NativeAnimatedNodesManager nodesManager = getNodesManager();\n        for (UIThreadOperation operation : operations) {\n          operation.execute(nodesManager);\n        }\n      }\n    });\n  }\n\n  @Override\n  public void onHostPause() {\n    clearFrameCallback();\n  }\n\n  @Override\n  public void onHostDestroy() {\n    // do nothing\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  private NativeAnimatedNodesManager getNodesManager() {\n    if (mNodesManager == null) {\n      UIManagerModule uiManager = getReactApplicationContext().getNativeModule(UIManagerModule.class);\n      mNodesManager = new NativeAnimatedNodesManager(uiManager);\n    }\n\n    return mNodesManager;\n  }\n\n  private void clearFrameCallback() {\n    Assertions.assertNotNull(mReactChoreographer).removeFrameCallback(\n      ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE,\n      mAnimatedFrameCallback);\n  }\n\n  private void enqueueFrameCallback() {\n    Assertions.assertNotNull(mReactChoreographer).postFrameCallback(\n      ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE,\n      mAnimatedFrameCallback);\n  }\n\n  @VisibleForTesting\n  public void setNodesManager(NativeAnimatedNodesManager nodesManager) {\n    mNodesManager = nodesManager;\n  }\n\n  @ReactMethod\n  public void createAnimatedNode(final int tag, final ReadableMap config) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.createAnimatedNode(tag, config);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void startListeningToAnimatedNodeValue(final int tag) {\n    final AnimatedNodeValueListener listener = new AnimatedNodeValueListener() {\n      public void onValueUpdate(double value) {\n        WritableMap onAnimatedValueData = Arguments.createMap();\n        onAnimatedValueData.putInt(\"tag\", tag);\n        onAnimatedValueData.putDouble(\"value\", value);\n        getReactApplicationContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)\n            .emit(\"onAnimatedValueUpdate\", onAnimatedValueData);\n      }\n    };\n\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.startListeningToAnimatedNodeValue(tag, listener);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void stopListeningToAnimatedNodeValue(final int tag) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.stopListeningToAnimatedNodeValue(tag);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void dropAnimatedNode(final int tag) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.dropAnimatedNode(tag);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void setAnimatedNodeValue(final int tag, final double value) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.setAnimatedNodeValue(tag, value);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void setAnimatedNodeOffset(final int tag, final double value) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.setAnimatedNodeOffset(tag, value);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void flattenAnimatedNodeOffset(final int tag) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.flattenAnimatedNodeOffset(tag);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void extractAnimatedNodeOffset(final int tag) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.extractAnimatedNodeOffset(tag);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void startAnimatingNode(\n      final int animationId,\n      final int animatedNodeTag,\n      final ReadableMap animationConfig,\n      final Callback endCallback) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.startAnimatingNode(\n          animationId,\n          animatedNodeTag,\n          animationConfig,\n          endCallback);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void stopAnimation(final int animationId) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.stopAnimation(animationId);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void connectAnimatedNodes(final int parentNodeTag, final int childNodeTag) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.connectAnimatedNodes(parentNodeTag, childNodeTag);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void disconnectAnimatedNodes(final int parentNodeTag, final int childNodeTag) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.disconnectAnimatedNodes(parentNodeTag, childNodeTag);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void connectAnimatedNodeToView(final int animatedNodeTag, final int viewTag) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.connectAnimatedNodeToView(animatedNodeTag, viewTag);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void disconnectAnimatedNodeFromView(final int animatedNodeTag, final int viewTag) {\n    mPreOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.restoreDefaultValues(animatedNodeTag, viewTag);\n      }\n    });\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.disconnectAnimatedNodeFromView(animatedNodeTag, viewTag);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void addAnimatedEventToView(final int viewTag, final String eventName, final ReadableMap eventMapping) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.addAnimatedEventToView(viewTag, eventName, eventMapping);\n      }\n    });\n  }\n\n  @ReactMethod\n  public void removeAnimatedEventFromView(final int viewTag, final String eventName, final int animatedValueTag) {\n    mOperations.add(new UIThreadOperation() {\n      @Override\n      public void execute(NativeAnimatedNodesManager animatedNodesManager) {\n        animatedNodesManager.removeAnimatedEventFromView(viewTag, eventName, animatedValueTag);\n      }\n    });\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport android.util.SparseArray;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.uimanager.IllegalViewOperationException;\nimport com.facebook.react.uimanager.UIImplementation;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.EventDispatcherListener;\n\nimport java.util.ArrayDeque;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.ListIterator;\nimport java.util.Map;\nimport java.util.Queue;\n\nimport javax.annotation.Nullable;\n\n/**\n * This is the main class that coordinates how native animated JS implementation drives UI changes.\n *\n * It implements a management interface for animated nodes graph as well as implements a graph\n * traversal algorithm that is run for each animation frame.\n *\n * For each animation frame we visit animated nodes that might've been updated as well as their\n * children that may use parent's values to update themselves. At the end of the traversal algorithm\n * we expect to reach a special type of the node: PropsAnimatedNode that is then responsible for\n * calculating property map which can be sent to native view hierarchy to update the view.\n *\n * IMPORTANT: This class should be accessed only from the UI Thread\n */\n/*package*/ class NativeAnimatedNodesManager implements EventDispatcherListener {\n\n  private final SparseArray<AnimatedNode> mAnimatedNodes = new SparseArray<>();\n  private final SparseArray<AnimationDriver> mActiveAnimations = new SparseArray<>();\n  private final SparseArray<AnimatedNode> mUpdatedNodes = new SparseArray<>();\n  // Mapping of a view tag and an event name to a list of event animation drivers. 99% of the time\n  // there will be only one driver per mapping so all code code should be optimized around that.\n  private final Map<String, List<EventAnimationDriver>> mEventDrivers = new HashMap<>();\n  private final UIManagerModule.CustomEventNamesResolver mCustomEventNamesResolver;\n  private final UIImplementation mUIImplementation;\n  private int mAnimatedGraphBFSColor = 0;\n  // Used to avoid allocating a new array on every frame in `runUpdates` and `onEventDispatch`.\n  private final List<AnimatedNode> mRunUpdateNodeList = new LinkedList<>();\n\n  public NativeAnimatedNodesManager(UIManagerModule uiManager) {\n    mUIImplementation = uiManager.getUIImplementation();\n    uiManager.getEventDispatcher().addListener(this);\n    mCustomEventNamesResolver = uiManager.getDirectEventNamesResolver();\n  }\n\n  /*package*/ @Nullable AnimatedNode getNodeById(int id) {\n    return mAnimatedNodes.get(id);\n  }\n\n  public boolean hasActiveAnimations() {\n    return mActiveAnimations.size() > 0 || mUpdatedNodes.size() > 0;\n  }\n\n  public void createAnimatedNode(int tag, ReadableMap config) {\n    if (mAnimatedNodes.get(tag) != null) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + tag +\n        \" already exists\");\n    }\n    String type = config.getString(\"type\");\n    final AnimatedNode node;\n    if (\"style\".equals(type)) {\n      node = new StyleAnimatedNode(config, this);\n    } else if (\"value\".equals(type)) {\n      node = new ValueAnimatedNode(config);\n    } else if (\"props\".equals(type)) {\n      node = new PropsAnimatedNode(config, this, mUIImplementation);\n    } else if (\"interpolation\".equals(type)) {\n      node = new InterpolationAnimatedNode(config);\n    } else if (\"addition\".equals(type)) {\n      node = new AdditionAnimatedNode(config, this);\n    } else if (\"division\".equals(type)) {\n      node = new DivisionAnimatedNode(config, this);\n    } else if (\"multiplication\".equals(type)) {\n      node = new MultiplicationAnimatedNode(config, this);\n    } else if (\"modulus\".equals(type)) {\n      node = new ModulusAnimatedNode(config, this);\n    } else if (\"diffclamp\".equals(type)) {\n      node = new DiffClampAnimatedNode(config, this);\n    } else if (\"transform\".equals(type)) {\n      node = new TransformAnimatedNode(config, this);\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Unsupported node type: \" + type);\n    }\n    node.mTag = tag;\n    mAnimatedNodes.put(tag, node);\n    mUpdatedNodes.put(tag, node);\n  }\n\n  public void dropAnimatedNode(int tag) {\n    mAnimatedNodes.remove(tag);\n    mUpdatedNodes.remove(tag);\n  }\n\n  public void startListeningToAnimatedNodeValue(int tag, AnimatedNodeValueListener listener) {\n    AnimatedNode node = mAnimatedNodes.get(tag);\n    if (node == null || !(node instanceof ValueAnimatedNode)) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + tag +\n              \" does not exists or is not a 'value' node\");\n    }\n    ((ValueAnimatedNode) node).setValueListener(listener);\n  }\n\n  public void stopListeningToAnimatedNodeValue(int tag) {\n    AnimatedNode node = mAnimatedNodes.get(tag);\n    if (node == null || !(node instanceof ValueAnimatedNode)) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + tag +\n              \" does not exists or is not a 'value' node\");\n    }\n    ((ValueAnimatedNode) node).setValueListener(null);\n  }\n\n  public void setAnimatedNodeValue(int tag, double value) {\n    AnimatedNode node = mAnimatedNodes.get(tag);\n    if (node == null || !(node instanceof ValueAnimatedNode)) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + tag +\n        \" does not exists or is not a 'value' node\");\n    }\n    stopAnimationsForNode(node);\n    ((ValueAnimatedNode) node).mValue = value;\n    mUpdatedNodes.put(tag, node);\n  }\n\n  public void setAnimatedNodeOffset(int tag, double offset) {\n    AnimatedNode node = mAnimatedNodes.get(tag);\n    if (node == null || !(node instanceof ValueAnimatedNode)) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + tag +\n        \" does not exists or is not a 'value' node\");\n    }\n    ((ValueAnimatedNode) node).mOffset = offset;\n    mUpdatedNodes.put(tag, node);\n  }\n\n  public void flattenAnimatedNodeOffset(int tag) {\n    AnimatedNode node = mAnimatedNodes.get(tag);\n    if (node == null || !(node instanceof ValueAnimatedNode)) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + tag +\n        \" does not exists or is not a 'value' node\");\n    }\n    ((ValueAnimatedNode) node).flattenOffset();\n  }\n\n  public void extractAnimatedNodeOffset(int tag) {\n    AnimatedNode node = mAnimatedNodes.get(tag);\n    if (node == null || !(node instanceof ValueAnimatedNode)) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + tag +\n        \" does not exists or is not a 'value' node\");\n    }\n    ((ValueAnimatedNode) node).extractOffset();\n  }\n\n  public void startAnimatingNode(\n    int animationId,\n    int animatedNodeTag,\n    ReadableMap animationConfig,\n    Callback endCallback) {\n    AnimatedNode node = mAnimatedNodes.get(animatedNodeTag);\n    if (node == null) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + animatedNodeTag +\n        \" does not exists\");\n    }\n    if (!(node instanceof ValueAnimatedNode)) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node should be of type \" +\n        ValueAnimatedNode.class.getName());\n    }\n    String type = animationConfig.getString(\"type\");\n    final AnimationDriver animation;\n    if (\"frames\".equals(type)) {\n      animation = new FrameBasedAnimationDriver(animationConfig);\n    } else if (\"spring\".equals(type)) {\n      animation = new SpringAnimation(animationConfig);\n    } else if (\"decay\".equals(type)) {\n      animation = new DecayAnimation(animationConfig);\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Unsupported animation type: \" + type);\n    }\n    animation.mId = animationId;\n    animation.mEndCallback = endCallback;\n    animation.mAnimatedValue = (ValueAnimatedNode) node;\n    mActiveAnimations.put(animationId, animation);\n  }\n\n  private void stopAnimationsForNode(AnimatedNode animatedNode) {\n    // in most of the cases there should never be more than a few active animations running at the\n    // same time. Therefore it does not make much sense to create an animationId -> animation\n    // object map that would require additional memory just to support the use-case of stopping\n    // an animation\n    for (int i = 0; i < mActiveAnimations.size(); i++) {\n      AnimationDriver animation = mActiveAnimations.valueAt(i);\n      if (animatedNode.equals(animation.mAnimatedValue)) {\n        // Invoke animation end callback with {finished: false}\n        WritableMap endCallbackResponse = Arguments.createMap();\n        endCallbackResponse.putBoolean(\"finished\", false);\n        animation.mEndCallback.invoke(endCallbackResponse);\n        mActiveAnimations.removeAt(i);\n        i--;\n      }\n    }\n  }\n\n  public void stopAnimation(int animationId) {\n    // in most of the cases there should never be more than a few active animations running at the\n    // same time. Therefore it does not make much sense to create an animationId -> animation\n    // object map that would require additional memory just to support the use-case of stopping\n    // an animation\n    for (int i = 0; i < mActiveAnimations.size(); i++) {\n      AnimationDriver animation = mActiveAnimations.valueAt(i);\n      if (animation.mId == animationId) {\n        // Invoke animation end callback with {finished: false}\n        WritableMap endCallbackResponse = Arguments.createMap();\n        endCallbackResponse.putBoolean(\"finished\", false);\n        animation.mEndCallback.invoke(endCallbackResponse);\n        mActiveAnimations.removeAt(i);\n        return;\n      }\n    }\n    // Do not throw an error in the case animation could not be found. We only keep \"active\"\n    // animations in the registry and there is a chance that Animated.js will enqueue a\n    // stopAnimation call after the animation has ended or the call will reach native thread only\n    // when the animation is already over.\n  }\n\n  public void connectAnimatedNodes(int parentNodeTag, int childNodeTag) {\n    AnimatedNode parentNode = mAnimatedNodes.get(parentNodeTag);\n    if (parentNode == null) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + parentNodeTag +\n        \" does not exists\");\n    }\n    AnimatedNode childNode = mAnimatedNodes.get(childNodeTag);\n    if (childNode == null) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + childNodeTag +\n        \" does not exists\");\n    }\n    parentNode.addChild(childNode);\n    mUpdatedNodes.put(childNodeTag, childNode);\n  }\n\n  public void disconnectAnimatedNodes(int parentNodeTag, int childNodeTag) {\n    AnimatedNode parentNode = mAnimatedNodes.get(parentNodeTag);\n    if (parentNode == null) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + parentNodeTag +\n        \" does not exists\");\n    }\n    AnimatedNode childNode = mAnimatedNodes.get(childNodeTag);\n    if (childNode == null) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + childNodeTag +\n        \" does not exists\");\n    }\n    parentNode.removeChild(childNode);\n    mUpdatedNodes.put(childNodeTag, childNode);\n  }\n\n  public void connectAnimatedNodeToView(int animatedNodeTag, int viewTag) {\n    AnimatedNode node = mAnimatedNodes.get(animatedNodeTag);\n    if (node == null) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + animatedNodeTag +\n        \" does not exists\");\n    }\n    if (!(node instanceof PropsAnimatedNode)) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node connected to view should be\" +\n        \"of type \" + PropsAnimatedNode.class.getName());\n    }\n    PropsAnimatedNode propsAnimatedNode = (PropsAnimatedNode) node;\n    propsAnimatedNode.connectToView(viewTag);\n    mUpdatedNodes.put(animatedNodeTag, node);\n  }\n\n  public void disconnectAnimatedNodeFromView(int animatedNodeTag, int viewTag) {\n    AnimatedNode node = mAnimatedNodes.get(animatedNodeTag);\n    if (node == null) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + animatedNodeTag +\n        \" does not exists\");\n    }\n    if (!(node instanceof PropsAnimatedNode)) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node connected to view should be\" +\n        \"of type \" + PropsAnimatedNode.class.getName());\n    }\n    PropsAnimatedNode propsAnimatedNode = (PropsAnimatedNode) node;\n    propsAnimatedNode.disconnectFromView(viewTag);\n  }\n\n  public void restoreDefaultValues(int animatedNodeTag, int viewTag) {\n    AnimatedNode node = mAnimatedNodes.get(animatedNodeTag);\n    // Restoring default values needs to happen before UIManager operations so it is\n    // possible the node hasn't been created yet if it is being connected and\n    // disconnected in the same batch. In that case we don't need to restore\n    // default values since it will never actually update the view.\n    if (node == null) {\n      return;\n    }\n    if (!(node instanceof PropsAnimatedNode)) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node connected to view should be\" +\n        \"of type \" + PropsAnimatedNode.class.getName());\n    }\n    PropsAnimatedNode propsAnimatedNode = (PropsAnimatedNode) node;\n    propsAnimatedNode.restoreDefaultValues();\n  }\n\n  public void addAnimatedEventToView(int viewTag, String eventName, ReadableMap eventMapping) {\n    int nodeTag = eventMapping.getInt(\"animatedValueTag\");\n    AnimatedNode node = mAnimatedNodes.get(nodeTag);\n    if (node == null) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node with tag \" + nodeTag +\n        \" does not exists\");\n    }\n    if (!(node instanceof ValueAnimatedNode)) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node connected to event should be\" +\n        \"of type \" + ValueAnimatedNode.class.getName());\n    }\n\n    ReadableArray path = eventMapping.getArray(\"nativeEventPath\");\n    List<String> pathList = new ArrayList<>(path.size());\n    for (int i = 0; i < path.size(); i++) {\n      pathList.add(path.getString(i));\n    }\n\n    EventAnimationDriver event = new EventAnimationDriver(pathList, (ValueAnimatedNode) node);\n    String key = viewTag + eventName;\n    if (mEventDrivers.containsKey(key)) {\n      mEventDrivers.get(key).add(event);\n    } else {\n      List<EventAnimationDriver> drivers = new ArrayList<>(1);\n      drivers.add(event);\n      mEventDrivers.put(key, drivers);\n    }\n  }\n\n  public void removeAnimatedEventFromView(int viewTag, String eventName, int animatedValueTag) {\n    String key = viewTag + eventName;\n    if (mEventDrivers.containsKey(key)) {\n      List<EventAnimationDriver> driversForKey = mEventDrivers.get(key);\n      if (driversForKey.size() == 1) {\n        mEventDrivers.remove(viewTag + eventName);\n      } else {\n        ListIterator<EventAnimationDriver> it = driversForKey.listIterator();\n        while (it.hasNext()) {\n          if (it.next().mValueNode.mTag == animatedValueTag) {\n            it.remove();\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  @Override\n  public void onEventDispatch(final Event event) {\n    // Events can be dispatched from any thread so we have to make sure handleEvent is run from the\n    // UI thread.\n    if (UiThreadUtil.isOnUiThread()) {\n      handleEvent(event);\n    } else {\n      UiThreadUtil.runOnUiThread(new Runnable() {\n        @Override\n        public void run() {\n          handleEvent(event);\n        }\n      });\n    }\n  }\n\n  private void handleEvent(Event event) {\n    if (!mEventDrivers.isEmpty()) {\n      // If the event has a different name in native convert it to it's JS name.\n      String eventName = mCustomEventNamesResolver.resolveCustomEventName(event.getEventName());\n      List<EventAnimationDriver> driversForKey = mEventDrivers.get(event.getViewTag() + eventName);\n      if (driversForKey != null) {\n        for (EventAnimationDriver driver : driversForKey) {\n          stopAnimationsForNode(driver.mValueNode);\n          event.dispatch(driver);\n          mRunUpdateNodeList.add(driver.mValueNode);\n        }\n        updateNodes(mRunUpdateNodeList);\n        mRunUpdateNodeList.clear();\n      }\n    }\n  }\n\n  /**\n   * Animation loop performs two BFSes over the graph of animated nodes. We use incremented\n   * {@code mAnimatedGraphBFSColor} to mark nodes as visited in each of the BFSes which saves\n   * additional loops for clearing \"visited\" states.\n   *\n   * First BFS starts with nodes that are in {@code mUpdatedNodes} (that is, their value have been\n   * modified from JS in the last batch of JS operations) or directly attached to an active\n   * animation (hence linked to objects from {@code mActiveAnimations}). In that step we calculate\n   * an attribute {@code mActiveIncomingNodes}. The second BFS runs in topological order over the\n   * sub-graph of *active* nodes. This is done by adding node to the BFS queue only if all its\n   * \"predecessors\" have already been visited.\n   */\n  public void runUpdates(long frameTimeNanos) {\n    UiThreadUtil.assertOnUiThread();\n    boolean hasFinishedAnimations = false;\n\n    for (int i = 0; i < mUpdatedNodes.size(); i++) {\n      AnimatedNode node = mUpdatedNodes.valueAt(i);\n      mRunUpdateNodeList.add(node);\n    }\n\n    // Clean mUpdatedNodes queue\n    mUpdatedNodes.clear();\n\n    for (int i = 0; i < mActiveAnimations.size(); i++) {\n      AnimationDriver animation = mActiveAnimations.valueAt(i);\n      animation.runAnimationStep(frameTimeNanos);\n      AnimatedNode valueNode = animation.mAnimatedValue;\n      mRunUpdateNodeList.add(valueNode);\n      if (animation.mHasFinished) {\n        hasFinishedAnimations = true;\n      }\n    }\n\n    updateNodes(mRunUpdateNodeList);\n    mRunUpdateNodeList.clear();\n\n    // Cleanup finished animations. Iterate over the array of animations and override ones that has\n    // finished, then resize `mActiveAnimations`.\n    if (hasFinishedAnimations) {\n      for (int i = mActiveAnimations.size() - 1; i >= 0; i--) {\n        AnimationDriver animation = mActiveAnimations.valueAt(i);\n        if (animation.mHasFinished) {\n          WritableMap endCallbackResponse = Arguments.createMap();\n          endCallbackResponse.putBoolean(\"finished\", true);\n          animation.mEndCallback.invoke(endCallbackResponse);\n          mActiveAnimations.removeAt(i);\n        }\n      }\n    }\n  }\n\n  private void updateNodes(List<AnimatedNode> nodes) {\n    int activeNodesCount = 0;\n    int updatedNodesCount = 0;\n\n    // STEP 1.\n    // BFS over graph of nodes. Update `mIncomingNodes` attribute for each node during that BFS.\n    // Store number of visited nodes in `activeNodesCount`. We \"execute\" active animations as a part\n    // of this step.\n\n    mAnimatedGraphBFSColor++; /* use new color */\n    if (mAnimatedGraphBFSColor == AnimatedNode.INITIAL_BFS_COLOR) {\n      // value \"0\" is used as an initial color for a new node, using it in BFS may cause some nodes\n      // to be skipped.\n      mAnimatedGraphBFSColor++;\n    }\n\n    Queue<AnimatedNode> nodesQueue = new ArrayDeque<>();\n    for (AnimatedNode node : nodes) {\n      if (node.mBFSColor != mAnimatedGraphBFSColor) {\n        node.mBFSColor = mAnimatedGraphBFSColor;\n        activeNodesCount++;\n        nodesQueue.add(node);\n      }\n    }\n\n    while (!nodesQueue.isEmpty()) {\n      AnimatedNode nextNode = nodesQueue.poll();\n      if (nextNode.mChildren != null) {\n        for (int i = 0; i < nextNode.mChildren.size(); i++) {\n          AnimatedNode child = nextNode.mChildren.get(i);\n          child.mActiveIncomingNodes++;\n          if (child.mBFSColor != mAnimatedGraphBFSColor) {\n            child.mBFSColor = mAnimatedGraphBFSColor;\n            activeNodesCount++;\n            nodesQueue.add(child);\n          }\n        }\n      }\n    }\n\n    // STEP 2\n    // BFS over the graph of active nodes in topological order -> visit node only when all its\n    // \"predecessors\" in the graph have already been visited. It is important to visit nodes in that\n    // order as they may often use values of their predecessors in order to calculate \"next state\"\n    // of their own. We start by determining the starting set of nodes by looking for nodes with\n    // `mActiveIncomingNodes = 0` (those can only be the ones that we start BFS in the previous\n    // step). We store number of visited nodes in this step in `updatedNodesCount`\n\n    mAnimatedGraphBFSColor++;\n    if (mAnimatedGraphBFSColor == AnimatedNode.INITIAL_BFS_COLOR) {\n      // see reasoning for this check a few lines above\n      mAnimatedGraphBFSColor++;\n    }\n\n    // find nodes with zero \"incoming nodes\", those can be either nodes from `mUpdatedNodes` or\n    // ones connected to active animations\n    for (AnimatedNode node : nodes) {\n      if (node.mActiveIncomingNodes == 0 && node.mBFSColor != mAnimatedGraphBFSColor) {\n        node.mBFSColor = mAnimatedGraphBFSColor;\n        updatedNodesCount++;\n        nodesQueue.add(node);\n      }\n    }\n\n    // Run main \"update\" loop\n    while (!nodesQueue.isEmpty()) {\n      AnimatedNode nextNode = nodesQueue.poll();\n      nextNode.update();\n      if (nextNode instanceof PropsAnimatedNode) {\n        // Send property updates to native view manager\n        try {\n          ((PropsAnimatedNode) nextNode).updateView();\n        } catch (IllegalViewOperationException e) {\n            // An exception is thrown if the view hasn't been created yet. This can happen because views are\n            // created in batches. If this particular view didn't make it into a batch yet, the view won't\n            // exist and an exception will be thrown when attempting to start an animation on it.\n            //\n            // Eat the exception rather than crashing. The impact is that we may drop one or more frames of the\n            // animation.\n            FLog.e(ReactConstants.TAG, \"Native animation workaround, frame lost as result of race condition\", e);\n          }\n      }\n      if (nextNode instanceof ValueAnimatedNode) {\n        // Potentially send events to JS when the node's value is updated\n        ((ValueAnimatedNode) nextNode).onValueUpdate();\n      }\n      if (nextNode.mChildren != null) {\n        for (int i = 0; i < nextNode.mChildren.size(); i++) {\n          AnimatedNode child = nextNode.mChildren.get(i);\n          child.mActiveIncomingNodes--;\n          if (child.mBFSColor != mAnimatedGraphBFSColor && child.mActiveIncomingNodes == 0) {\n            child.mBFSColor = mAnimatedGraphBFSColor;\n            updatedNodesCount++;\n            nodesQueue.add(child);\n          }\n        }\n      }\n    }\n\n    // Verify that we've visited *all* active nodes. Throw otherwise as this would mean there is a\n    // cycle in animated node graph. We also take advantage of the fact that all active nodes are\n    // visited in the step above so that all the nodes properties `mActiveIncomingNodes` are set to\n    // zero\n    if (activeNodesCount != updatedNodesCount) {\n      throw new IllegalStateException(\"Looks like animated nodes graph has cycles, there are \"\n        + activeNodesCount + \" but toposort visited only \" + updatedNodesCount);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.ReadableMapKeySetIterator;\nimport com.facebook.react.uimanager.ReactStylesDiffMap;\nimport com.facebook.react.uimanager.UIImplementation;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport javax.annotation.Nullable;\n\n/**\n * Animated node that represents view properties. There is a special handling logic implemented for\n * the nodes of this type in {@link NativeAnimatedNodesManager} that is responsible for extracting\n * a map of updated properties, which can be then passed down to the view.\n */\n/*package*/ class PropsAnimatedNode extends AnimatedNode {\n\n  private int mConnectedViewTag = -1;\n  private final NativeAnimatedNodesManager mNativeAnimatedNodesManager;\n  private final UIImplementation mUIImplementation;\n  private final Map<String, Integer> mPropNodeMapping;\n  // This is the backing map for `mDiffMap` we can mutate this to update it instead of having to\n  // create a new one for each update.\n  private final JavaOnlyMap mPropMap;\n  private final ReactStylesDiffMap mDiffMap;\n\n  PropsAnimatedNode(ReadableMap config, NativeAnimatedNodesManager nativeAnimatedNodesManager, UIImplementation uiImplementation) {\n    ReadableMap props = config.getMap(\"props\");\n    ReadableMapKeySetIterator iter = props.keySetIterator();\n    mPropNodeMapping = new HashMap<>();\n    while (iter.hasNextKey()) {\n      String propKey = iter.nextKey();\n      int nodeIndex = props.getInt(propKey);\n      mPropNodeMapping.put(propKey, nodeIndex);\n    }\n    mPropMap = new JavaOnlyMap();\n    mDiffMap = new ReactStylesDiffMap(mPropMap);\n    mNativeAnimatedNodesManager = nativeAnimatedNodesManager;\n    mUIImplementation = uiImplementation;\n  }\n\n  public void connectToView(int viewTag) {\n    if (mConnectedViewTag != -1) {\n      throw new JSApplicationIllegalArgumentException(\"Animated node \" + mTag + \" is \" +\n        \"already attached to a view\");\n    }\n    mConnectedViewTag = viewTag;\n  }\n\n  public void disconnectFromView(int viewTag) {\n    if (mConnectedViewTag != viewTag) {\n      throw new JSApplicationIllegalArgumentException(\"Attempting to disconnect view that has \" +\n        \"not been connected with the given animated node\");\n    }\n\n    mConnectedViewTag = -1;\n  }\n\n  public void restoreDefaultValues() {\n    ReadableMapKeySetIterator it = mPropMap.keySetIterator();\n    while(it.hasNextKey()) {\n      mPropMap.putNull(it.nextKey());\n    }\n\n    mUIImplementation.synchronouslyUpdateViewOnUIThread(\n      mConnectedViewTag,\n      mDiffMap);\n  }\n\n  public final void updateView() {\n    if (mConnectedViewTag == -1) {\n      return;\n    }\n    for (Map.Entry<String, Integer> entry : mPropNodeMapping.entrySet()) {\n      @Nullable AnimatedNode node = mNativeAnimatedNodesManager.getNodeById(entry.getValue());\n      if (node == null) {\n        throw new IllegalArgumentException(\"Mapped property node does not exists\");\n      } else if (node instanceof StyleAnimatedNode) {\n        ((StyleAnimatedNode) node).collectViewUpdates(mPropMap);\n      } else if (node instanceof ValueAnimatedNode) {\n        mPropMap.putDouble(entry.getKey(), ((ValueAnimatedNode) node).getValue());\n      } else {\n        throw new IllegalArgumentException(\"Unsupported type of node used in property node \" +\n            node.getClass());\n      }\n    }\n\n    mUIImplementation.synchronouslyUpdateViewOnUIThread(\n      mConnectedViewTag,\n      mDiffMap);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.java",
    "content": "package com.facebook.react.animated;\n\nimport com.facebook.react.bridge.ReadableMap;\n\n/**\n * Implementation of {@link AnimationDriver} providing support for spring animations. The\n * implementation has been copied from android implementation of Rebound library (see\n * <a href=\"http://facebook.github.io/rebound/\">http://facebook.github.io/rebound/</a>)\n */\n/*package*/ class SpringAnimation extends AnimationDriver {\n\n  // maximum amount of time to simulate per physics iteration in seconds (4 frames at 60 FPS)\n  private static final double MAX_DELTA_TIME_SEC = 0.064;\n  // fixed timestep to use in the physics solver in seconds\n  private static final double SOLVER_TIMESTEP_SEC = 0.001;\n\n  // storage for the current and prior physics state while integration is occurring\n  private static class PhysicsState {\n    double position;\n    double velocity;\n  }\n\n  private long mLastTime;\n  private boolean mSpringStarted;\n\n  // configuration\n  private double mSpringStiffness;\n  private double mSpringDamping;\n  private double mSpringMass;\n  private double mInitialVelocity;\n  private boolean mOvershootClampingEnabled;\n\n  // all physics simulation objects are final and reused in each processing pass\n  private final PhysicsState mCurrentState = new PhysicsState();\n  private double mStartValue;\n  private double mEndValue;\n  // thresholds for determining when the spring is at rest\n  private double mRestSpeedThreshold;\n  private double mDisplacementFromRestThreshold;\n  private double mTimeAccumulator = 0;\n  // for controlling loop\n  private int mIterations;\n  private int mCurrentLoop = 0;\n  private double mOriginalValue;\n\n  SpringAnimation(ReadableMap config) {\n    mSpringStiffness = config.getDouble(\"stiffness\");\n    mSpringDamping = config.getDouble(\"damping\");\n    mSpringMass = config.getDouble(\"mass\");\n    mInitialVelocity = config.getDouble(\"initialVelocity\");\n    mCurrentState.velocity = mInitialVelocity;\n    mEndValue = config.getDouble(\"toValue\");\n    mRestSpeedThreshold = config.getDouble(\"restSpeedThreshold\");\n    mDisplacementFromRestThreshold = config.getDouble(\"restDisplacementThreshold\");\n    mOvershootClampingEnabled = config.getBoolean(\"overshootClamping\");\n    mIterations = config.hasKey(\"iterations\") ? config.getInt(\"iterations\") : 1;\n    mHasFinished = mIterations == 0;\n  }\n\n  @Override\n  public void runAnimationStep(long frameTimeNanos) {\n    long frameTimeMillis = frameTimeNanos / 1000000;\n    if (!mSpringStarted) {\n      if (mCurrentLoop == 0) {\n        mOriginalValue = mAnimatedValue.mValue;\n        mCurrentLoop = 1;\n      }\n      mStartValue = mCurrentState.position = mAnimatedValue.mValue;\n      mLastTime = frameTimeMillis;\n      mTimeAccumulator = 0.0;\n      mSpringStarted = true;\n    }\n    advance((frameTimeMillis - mLastTime) / 1000.0);\n    mLastTime = frameTimeMillis;\n    mAnimatedValue.mValue = mCurrentState.position;\n    if (isAtRest()) {\n      if (mIterations == -1 || mCurrentLoop < mIterations) { // looping animation, return to start\n        mSpringStarted = false;\n        mAnimatedValue.mValue = mOriginalValue;\n        mCurrentLoop++;\n      } else { // animation has completed\n        mHasFinished = true;\n      }\n    }\n  }\n\n  /**\n   * get the displacement from rest for a given physics state\n   * @param state the state to measure from\n   * @return the distance displaced by\n   */\n  private double getDisplacementDistanceForState(PhysicsState state) {\n    return Math.abs(mEndValue - state.position);\n  }\n\n  /**\n   * check if the current state is at rest\n   * @return is the spring at rest\n   */\n  private boolean isAtRest() {\n    return Math.abs(mCurrentState.velocity) <= mRestSpeedThreshold &&\n      (getDisplacementDistanceForState(mCurrentState) <= mDisplacementFromRestThreshold ||\n        mSpringStiffness == 0);\n  }\n\n  /**\n   * Check if the spring is overshooting beyond its target.\n   * @return true if the spring is overshooting its target\n   */\n  private boolean isOvershooting() {\n    return mSpringStiffness > 0 &&\n      ((mStartValue < mEndValue && mCurrentState.position > mEndValue) ||\n        (mStartValue > mEndValue && mCurrentState.position < mEndValue));\n  }\n\n  private void advance(double realDeltaTime) {\n    if (isAtRest()) {\n      return;\n    }\n\n    // clamp the amount of realTime to simulate to avoid stuttering in the UI. We should be able\n    // to catch up in a subsequent advance if necessary.\n    double adjustedDeltaTime = realDeltaTime;\n    if (realDeltaTime > MAX_DELTA_TIME_SEC) {\n      adjustedDeltaTime = MAX_DELTA_TIME_SEC;\n    }\n\n    mTimeAccumulator += adjustedDeltaTime;\n\n    double c = mSpringDamping;\n    double m = mSpringMass;\n    double k = mSpringStiffness;\n    double v0 = -mInitialVelocity;\n\n    double zeta = c / (2 * Math.sqrt(k * m ));\n    double omega0 = Math.sqrt(k / m);\n    double omega1 = omega0 * Math.sqrt(1.0 - (zeta * zeta));\n    double x0 = mEndValue - mStartValue;\n\n    double velocity;\n    double position;\n    double t = mTimeAccumulator;\n    if (zeta < 1) {\n      // Under damped\n      double envelope = Math.exp(-zeta * omega0 * t);\n      position =\n        mEndValue -\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 spring\n      double envelope = Math.exp(-omega0 * t);\n      position = mEndValue - envelope * (x0 + (v0 + omega0 * x0) * t);\n      velocity =\n        envelope * (v0 * (t * omega0 - 1) + t * x0 * (omega0 * omega0));\n    }\n\n    mCurrentState.position = position;\n    mCurrentState.velocity = velocity;\n\n    // End the spring immediately if it is overshooting and overshoot clamping is enabled.\n    // Also make sure that if the spring was considered within a resting threshold that it's now\n    // snapped to its end value.\n    if (isAtRest() || (mOvershootClampingEnabled && isOvershooting())) {\n      // Don't call setCurrentValue because that forces a call to onSpringUpdate\n      if (mSpringStiffness > 0) {\n        mStartValue = mEndValue;\n        mCurrentState.position = mEndValue;\n      } else {\n        mEndValue = mCurrentState.position;\n        mStartValue = mEndValue;\n      }\n      mCurrentState.velocity = 0;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/StyleAnimatedNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.ReadableMapKeySetIterator;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport javax.annotation.Nullable;\n\n/**\n * Native counterpart of style animated node (see AnimatedStyle class in AnimatedImplementation.js)\n */\n/*package*/ class StyleAnimatedNode extends AnimatedNode {\n\n  private final NativeAnimatedNodesManager mNativeAnimatedNodesManager;\n  private final Map<String, Integer> mPropMapping;\n\n  StyleAnimatedNode(ReadableMap config, NativeAnimatedNodesManager nativeAnimatedNodesManager) {\n    ReadableMap style = config.getMap(\"style\");\n    ReadableMapKeySetIterator iter = style.keySetIterator();\n    mPropMapping = new HashMap<>();\n    while (iter.hasNextKey()) {\n      String propKey = iter.nextKey();\n      int nodeIndex = style.getInt(propKey);\n      mPropMapping.put(propKey, nodeIndex);\n    }\n    mNativeAnimatedNodesManager = nativeAnimatedNodesManager;\n  }\n\n  public void collectViewUpdates(JavaOnlyMap propsMap) {\n    for (Map.Entry<String, Integer> entry : mPropMapping.entrySet()) {\n      @Nullable AnimatedNode node = mNativeAnimatedNodesManager.getNodeById(entry.getValue());\n      if (node == null) {\n        throw new IllegalArgumentException(\"Mapped style node does not exists\");\n      } else if (node instanceof TransformAnimatedNode) {\n        ((TransformAnimatedNode) node).collectViewUpdates(propsMap);\n      } else if (node instanceof ValueAnimatedNode) {\n        propsMap.putDouble(entry.getKey(), ((ValueAnimatedNode) node).getValue());\n      } else {\n        throw new IllegalArgumentException(\"Unsupported type of node used in property node \" +\n          node.getClass());\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/TransformAnimatedNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.JavaOnlyArray;\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Native counterpart of transform animated node (see AnimatedTransform class in AnimatedImplementation.js)\n */\n/* package */ class TransformAnimatedNode extends AnimatedNode {\n\n  private class TransformConfig {\n    public String mProperty;\n  }\n\n  private class AnimatedTransformConfig extends TransformConfig {\n    public int mNodeTag;\n  }\n\n  private class StaticTransformConfig extends TransformConfig {\n    public double mValue;\n  }\n\n  private final NativeAnimatedNodesManager mNativeAnimatedNodesManager;\n  private final List<TransformConfig> mTransformConfigs;\n\n  TransformAnimatedNode(ReadableMap config, NativeAnimatedNodesManager nativeAnimatedNodesManager) {\n    ReadableArray transforms = config.getArray(\"transforms\");\n    mTransformConfigs = new ArrayList<>(transforms.size());\n    for (int i = 0; i < transforms.size(); i++) {\n      ReadableMap transformConfigMap = transforms.getMap(i);\n      String property = transformConfigMap.getString(\"property\");\n      String type = transformConfigMap.getString(\"type\");\n      if (type.equals(\"animated\")) {\n        AnimatedTransformConfig transformConfig = new AnimatedTransformConfig();\n        transformConfig.mProperty = property;\n        transformConfig.mNodeTag = transformConfigMap.getInt(\"nodeTag\");\n        mTransformConfigs.add(transformConfig);\n      } else {\n        StaticTransformConfig transformConfig = new StaticTransformConfig();\n        transformConfig.mProperty = property;\n        transformConfig.mValue = transformConfigMap.getDouble(\"value\");\n        mTransformConfigs.add(transformConfig);\n      }\n    }\n    mNativeAnimatedNodesManager = nativeAnimatedNodesManager;\n  }\n\n  public void collectViewUpdates(JavaOnlyMap propsMap) {\n    List<JavaOnlyMap> transforms = new ArrayList<>(mTransformConfigs.size());\n\n    for (TransformConfig transformConfig : mTransformConfigs) {\n      double value;\n      if (transformConfig instanceof AnimatedTransformConfig) {\n        int nodeTag = ((AnimatedTransformConfig) transformConfig).mNodeTag;\n        AnimatedNode node = mNativeAnimatedNodesManager.getNodeById(nodeTag);\n        if (node == null) {\n          throw new IllegalArgumentException(\"Mapped style node does not exists\");\n        } else if (node instanceof ValueAnimatedNode) {\n          value = ((ValueAnimatedNode) node).getValue();\n        } else {\n          throw new IllegalArgumentException(\"Unsupported type of node used as a transform child \" +\n            \"node \" + node.getClass());\n        }\n      } else {\n        value = ((StaticTransformConfig) transformConfig).mValue;\n      }\n\n      transforms.add(JavaOnlyMap.of(transformConfig.mProperty, value));\n    }\n\n    propsMap.putArray(\"transform\", JavaOnlyArray.from(transforms));\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animated/ValueAnimatedNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.ReadableMap;\n\nimport javax.annotation.Nullable;\n\n/**\n * Basic type of animated node that maps directly from {@code Animated.Value(x)} of Animated.js\n * library.\n */\n/*package*/ class ValueAnimatedNode extends AnimatedNode {\n  /*package*/ double mValue = Double.NaN;\n  /*package*/ double mOffset = 0;\n  private @Nullable AnimatedNodeValueListener mValueListener;\n\n  public ValueAnimatedNode() {\n    // empty constructor that can be used by subclasses\n  }\n\n  public ValueAnimatedNode(ReadableMap config) {\n    mValue = config.getDouble(\"value\");\n    mOffset = config.getDouble(\"offset\");\n  }\n\n  public double getValue() {\n    return mOffset + mValue;\n  }\n\n  public void flattenOffset() {\n    mValue += mOffset;\n    mOffset = 0;\n  }\n\n  public void extractOffset() {\n    mOffset += mValue;\n    mValue = 0;\n  }\n\n  public void onValueUpdate() {\n    if (mValueListener == null) {\n      return;\n    }\n    mValueListener.onValueUpdate(getValue());\n  }\n\n  public void setValueListener(@Nullable AnimatedNodeValueListener listener) {\n    mValueListener = listener;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animation/AbstractFloatPairPropertyUpdater.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animation;\n\nimport android.view.View;\n\n/**\n * Base class for {@link AnimationPropertyUpdater} subclasses that updates a pair of float property\n * values. It helps to handle conversion from animation progress to the actual values as\n * well as the quite common case when no starting value is provided.\n */\npublic abstract class AbstractFloatPairPropertyUpdater implements AnimationPropertyUpdater {\n\n  private final float[] mFromValues = new float[2];\n  private final float[] mToValues = new float[2];\n  private final float[] mUpdateValues = new float[2];\n  private boolean mFromSource;\n\n  protected AbstractFloatPairPropertyUpdater(float toFirst, float toSecond) {\n    mToValues[0] = toFirst;\n    mToValues[1] = toSecond;\n    mFromSource = true;\n  }\n\n  protected AbstractFloatPairPropertyUpdater(\n      float fromFirst,\n      float fromSecond,\n      float toFirst,\n      float toSecond) {\n    this(toFirst, toSecond);\n    mFromValues[0] = fromFirst;\n    mFromValues[1] = fromSecond;\n    mFromSource = false;\n  }\n\n  protected abstract void getProperty(View view, float[] returnValues);\n  protected abstract void setProperty(View view, float[] propertyValues);\n\n  @Override\n  public void prepare(View view) {\n    if (mFromSource) {\n      getProperty(view, mFromValues);\n    }\n  }\n\n  @Override\n  public void onUpdate(View view, float progress) {\n    mUpdateValues[0] = mFromValues[0] + (mToValues[0] - mFromValues[0]) * progress;\n    mUpdateValues[1] = mFromValues[1] + (mToValues[1] - mFromValues[1]) * progress;\n    setProperty(view, mUpdateValues);\n  }\n\n  @Override\n  public void onFinish(View view) {\n    setProperty(view, mToValues);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animation/AbstractSingleFloatProperyUpdater.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animation;\n\nimport android.view.View;\n\n/**\n * Base class for {@link AnimationPropertyUpdater} subclasses that updates a single float property\n * value. It helps to handle conversion from animation progress to the actual value as well as the\n * quite common case when no starting value is provided.\n */\npublic abstract class AbstractSingleFloatProperyUpdater implements AnimationPropertyUpdater {\n\n  private float mFromValue, mToValue;\n  private boolean mFromSource;\n\n  protected AbstractSingleFloatProperyUpdater(float toValue) {\n    mToValue = toValue;\n    mFromSource = true;\n  }\n\n  protected AbstractSingleFloatProperyUpdater(float fromValue, float toValue) {\n    this(toValue);\n    mFromValue = fromValue;\n    mFromSource = false;\n  }\n\n  protected abstract float getProperty(View view);\n  protected abstract void setProperty(View view, float propertyValue);\n\n  @Override\n  public final void prepare(View view) {\n    if (mFromSource) {\n      mFromValue = getProperty(view);\n    }\n  }\n\n  @Override\n  public final void onUpdate(View view, float progress) {\n    setProperty(view, mFromValue + (mToValue - mFromValue) * progress);\n  }\n\n  @Override\n  public void onFinish(View view) {\n    setProperty(view, mToValue);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animation/AnimationPropertyUpdater.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animation;\n\nimport android.view.View;\n\n/**\n * Interface used to update particular property types during animation. While animation is in\n * progress {@link Animation} instance will call {@link #onUpdate} several times with a value\n * representing animation progress. Normally value will be from 0..1 range, but for spring animation\n * it can slightly exceed that limit due to bounce effect at the start/end of animation.\n */\npublic interface AnimationPropertyUpdater {\n\n  /**\n   * This method will be called before animation starts.\n   *\n   * @param view view that will be animated\n   */\n  public void prepare(View view);\n\n  /**\n   * This method will be called for each animation frame\n   *\n   * @param view view to update property\n   * @param progress animation progress from 0..1 range (may slightly exceed that limit in case of\n   * spring engine) retrieved from {@link Animation} engine.\n   */\n  public void onUpdate(View view, float progress);\n\n  /**\n   * This method will be called at the end of animation. It should be used to set the final values\n   * for animated properties in order to avoid floating point inaccuracy calculated in\n   * {@link #onUpdate} by passing value close to 1.0 or in a case some frames got dropped.\n   *\n   * @param view view to update property\n   */\n  public void onFinish(View view);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/animation/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"animation\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ActivityEventListener.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\nimport android.app.Activity;\nimport android.content.Intent;\n\n/**\n * Listener for receiving activity events. Consider using {@link BaseActivityEventListener} if\n * you're not interested in all the events sent to this interface.\n */\npublic interface ActivityEventListener {\n\n  /**\n   * Called when host (activity/service) receives an {@link Activity#onActivityResult} call.\n   */\n  void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data);\n\n  /**\n   * Called when a new intent is passed to the activity\n   */\n  void onNewIntent(Intent intent);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\npackage com.facebook.react.bridge;\n\nimport java.lang.reflect.Array;\n\nimport java.util.AbstractList;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\nimport javax.annotation.Nullable;\n\nimport android.os.Bundle;\n\npublic class Arguments {\n  private static Object makeNativeObject(Object object) {\n    if (object == null) {\n      return null;\n    } else if (object instanceof Float ||\n      object instanceof Long ||\n      object instanceof Byte ||\n      object instanceof Short) {\n      return new Double(((Number) object).doubleValue());\n    } else if (object.getClass().isArray()) {\n      return makeNativeArray(object);\n    } else if (object instanceof List) {\n      return makeNativeArray((List) object);\n    } else if (object instanceof Map) {\n      return makeNativeMap((Map<String, Object>) object);\n    } else if (object instanceof Bundle) {\n      return makeNativeMap((Bundle) object);\n    } else {\n      // Boolean, Integer, Double, String, WritableNativeArray, WritableNativeMap\n      return object;\n    }\n  }\n\n  /**\n   * This method converts a List into a NativeArray.  The data types supported\n   * are boolean, int, float, double, and String.  List, Map, and Bundle\n   * objects, as well as arrays, containing values of the above types and/or\n   * null, or any recursive arrangement of these, are also supported.  The best\n   * way to think of this is a way to generate a Java representation of a json\n   * list, from Java types which have a natural representation in json.\n   */\n  public static WritableNativeArray makeNativeArray(List objects) {\n    WritableNativeArray nativeArray = new WritableNativeArray();\n    if (objects == null) {\n      return nativeArray;\n    }\n    for (Object elem : objects) {\n      elem = makeNativeObject(elem);\n      if (elem == null) {\n        nativeArray.pushNull();\n      } else if (elem instanceof Boolean) {\n        nativeArray.pushBoolean((Boolean) elem);\n      } else if (elem instanceof Integer) {\n        nativeArray.pushInt((Integer) elem);\n      } else if (elem instanceof Double) {\n        nativeArray.pushDouble((Double) elem);\n      } else if (elem instanceof String) {\n        nativeArray.pushString((String) elem);\n      } else if (elem instanceof WritableNativeArray) {\n        nativeArray.pushArray((WritableNativeArray) elem);\n      } else if (elem instanceof WritableNativeMap) {\n        nativeArray.pushMap((WritableNativeMap) elem);\n      } else {\n        throw new IllegalArgumentException(\"Could not convert \" + elem.getClass());\n      }\n    }\n    return nativeArray;\n  }\n\n  /**\n   * This overload is like the above, but uses reflection to operate on any\n   * primitive or object type.\n   */\n  public static <T> WritableNativeArray makeNativeArray(final Object objects) {\n    if (objects == null) {\n      return new WritableNativeArray();\n    }\n    // No explicit check for objects's type here.  If it's not an array, the\n    // Array methods will throw IllegalArgumentException.\n    return makeNativeArray(new AbstractList() {\n      public int size() {\n        return Array.getLength(objects);\n      }\n\n      public Object get(int index) {\n        return Array.get(objects, index);\n      }\n    });\n  }\n\n  private static void addEntry(WritableNativeMap nativeMap, String key, Object value) {\n    value = makeNativeObject(value);\n    if (value == null) {\n      nativeMap.putNull(key);\n    } else if (value instanceof Boolean) {\n      nativeMap.putBoolean(key, (Boolean) value);\n    } else if (value instanceof Integer) {\n      nativeMap.putInt(key, (Integer) value);\n    } else if (value instanceof Number) {\n      nativeMap.putDouble(key, ((Number) value).doubleValue());\n    } else if (value instanceof String) {\n      nativeMap.putString(key, (String) value);\n    } else if (value instanceof WritableNativeArray) {\n      nativeMap.putArray(key, (WritableNativeArray) value);\n    } else if (value instanceof WritableNativeMap) {\n      nativeMap.putMap(key, (WritableNativeMap) value);\n    } else {\n      throw new IllegalArgumentException(\"Could not convert \" + value.getClass());\n    }\n  }\n\n  /**\n   * This method converts a Map into a NativeMap.  Value types are supported as\n   * with makeNativeArray.  The best way to think of this is a way to generate\n   * a Java representation of a json object, from Java types which have a\n   * natural representation in json.\n   */\n  public static WritableNativeMap makeNativeMap(Map<String, Object> objects) {\n    WritableNativeMap nativeMap = new WritableNativeMap();\n    if (objects == null) {\n      return nativeMap;\n    }\n    for (Map.Entry<String, Object> entry : objects.entrySet()) {\n      addEntry(nativeMap, entry.getKey(), entry.getValue());\n    }\n    return nativeMap;\n  }\n\n  /**\n   * Like the above, but takes a Bundle instead of a Map.\n   */\n  public static WritableNativeMap makeNativeMap(Bundle bundle) {\n    WritableNativeMap nativeMap = new WritableNativeMap();\n    if (bundle == null) {\n      return nativeMap;\n    }\n    for (String key : bundle.keySet()) {\n      addEntry(nativeMap, key, bundle.get(key));\n    }\n    return nativeMap;\n  }\n\n  /**\n   * This method should be used when you need to stub out creating NativeArrays in unit tests.\n   */\n  public static WritableArray createArray() {\n    return new WritableNativeArray();\n  }\n\n  /**\n   * This method should be used when you need to stub out creating NativeMaps in unit tests.\n   */\n  public static WritableMap createMap() {\n    return new WritableNativeMap();\n  }\n\n  public static WritableNativeArray fromJavaArgs(Object[] args) {\n    WritableNativeArray arguments = new WritableNativeArray();\n    for (int i = 0; i < args.length; i++) {\n      Object argument = args[i];\n      if (argument == null) {\n        arguments.pushNull();\n        continue;\n      }\n\n      Class argumentClass = argument.getClass();\n      if (argumentClass == Boolean.class) {\n        arguments.pushBoolean(((Boolean) argument).booleanValue());\n      } else if (argumentClass == Integer.class) {\n        arguments.pushDouble(((Integer) argument).doubleValue());\n      } else if (argumentClass == Double.class) {\n        arguments.pushDouble(((Double) argument).doubleValue());\n      } else if (argumentClass == Float.class) {\n        arguments.pushDouble(((Float) argument).doubleValue());\n      } else if (argumentClass == String.class) {\n        arguments.pushString(argument.toString());\n      } else if (argumentClass == WritableNativeMap.class) {\n        arguments.pushMap((WritableNativeMap) argument);\n      } else if (argumentClass == WritableNativeArray.class) {\n        arguments.pushArray((WritableNativeArray) argument);\n      } else {\n        throw new RuntimeException(\"Cannot convert argument of type \" + argumentClass);\n      }\n    }\n    return arguments;\n  }\n\n  /**\n   * Convert an array to a {@link WritableArray}.\n   *\n   * @param array the array to convert. Supported types are: {@code String[]}, {@code Bundle[]},\n   *              {@code int[]}, {@code float[]}, {@code double[]}, {@code boolean[]}.\n   * @return the converted {@link WritableArray}\n   * @throws IllegalArgumentException if the passed object is none of the above types\n   */\n  public static WritableArray fromArray(Object array) {\n    WritableArray catalystArray = createArray();\n    if (array instanceof String[]) {\n      for (String v : (String[]) array) {\n        catalystArray.pushString(v);\n      }\n    } else if (array instanceof Bundle[]) {\n      for (Bundle v : (Bundle[]) array) {\n        catalystArray.pushMap(fromBundle(v));\n      }\n    } else if (array instanceof int[]) {\n      for (int v : (int[]) array) {\n        catalystArray.pushInt(v);\n      }\n    } else if (array instanceof float[]) {\n      for (float v : (float[]) array) {\n        catalystArray.pushDouble(v);\n      }\n    } else if (array instanceof double[]) {\n      for (double v : (double[]) array) {\n        catalystArray.pushDouble(v);\n      }\n    } else if (array instanceof boolean[]) {\n      for (boolean v : (boolean[]) array) {\n        catalystArray.pushBoolean(v);\n      }\n    } else {\n      throw new IllegalArgumentException(\"Unknown array type \" + array.getClass());\n    }\n    return catalystArray;\n  }\n\n  /**\n   * Convert a {@link List} to a {@link WritableArray}.\n   *\n   * @param list the list to convert. Supported value types are: {@code null}, {@code String}, {@code Bundle},\n   *              {@code List}, {@code Number}, {@code Boolean}, and all array types supported in {@link #fromArray(Object)}.\n   * @return the converted {@link WritableArray}\n   * @throws IllegalArgumentException if one of the values from the passed list is none of the above types\n   */\n  public static WritableArray fromList(List list) {\n    WritableArray catalystArray = createArray();\n    for (Object obj : list) {\n      if (obj == null) {\n        catalystArray.pushNull();\n      } else if (obj.getClass().isArray()) {\n        catalystArray.pushArray(fromArray(obj));\n      } else if (obj instanceof Bundle) {\n        catalystArray.pushMap(fromBundle((Bundle) obj));\n      } else if (obj instanceof List) {\n        catalystArray.pushArray(fromList((List) obj));\n      } else if (obj instanceof String) {\n        catalystArray.pushString((String) obj);\n      } else if (obj instanceof Integer) {\n        catalystArray.pushInt((Integer) obj);\n      } else if (obj instanceof Number) {\n        catalystArray.pushDouble(((Number) obj).doubleValue());\n      } else if (obj instanceof Boolean) {\n        catalystArray.pushBoolean((Boolean) obj);\n      } else {\n        throw new IllegalArgumentException(\"Unknown value type \" + obj.getClass());\n      }\n    }\n    return catalystArray;\n  }\n\n  /**\n   * Convert a {@link Bundle} to a {@link WritableMap}. Supported key types in the bundle\n   * are:\n   * <p>\n   * <ul>\n   * <li>primitive types: int, float, double, boolean</li>\n   * <li>arrays supported by {@link #fromArray(Object)}</li>\n   * <li>lists supported by {@link #fromList(List)}</li>\n   * <li>{@link Bundle} objects that are recursively converted to maps</li>\n   * </ul>\n   *\n   * @param bundle the {@link Bundle} to convert\n   * @return the converted {@link WritableMap}\n   * @throws IllegalArgumentException if there are keys of unsupported types\n   */\n  public static WritableMap fromBundle(Bundle bundle) {\n    WritableMap map = createMap();\n    for (String key : bundle.keySet()) {\n      Object value = bundle.get(key);\n      if (value == null) {\n        map.putNull(key);\n      } else if (value.getClass().isArray()) {\n        map.putArray(key, fromArray(value));\n      } else if (value instanceof String) {\n        map.putString(key, (String) value);\n      } else if (value instanceof Number) {\n        if (value instanceof Integer) {\n          map.putInt(key, (Integer) value);\n        } else {\n          map.putDouble(key, ((Number) value).doubleValue());\n        }\n      } else if (value instanceof Boolean) {\n        map.putBoolean(key, (Boolean) value);\n      } else if (value instanceof Bundle) {\n        map.putMap(key, fromBundle((Bundle) value));\n      } else if (value instanceof List) {\n        map.putArray(key, fromList((List) value));\n      } else {\n        throw new IllegalArgumentException(\"Could not convert \" + value.getClass());\n      }\n    }\n    return map;\n  }\n\n  /**\n   * Convert a {@link WritableArray} to a {@link ArrayList}.\n   *\n   * @param readableArray the {@link WritableArray} to convert.\n   * @return the converted {@link ArrayList}.\n   */\n  @Nullable\n  public static ArrayList toList(@Nullable ReadableArray readableArray) {\n    if (readableArray == null) {\n      return null;\n    }\n\n    ArrayList list = new ArrayList();\n\n    for (int i = 0; i < readableArray.size(); i++) {\n      switch (readableArray.getType(i)) {\n        case Null:\n          list.add(null);\n          break;\n        case Boolean:\n          list.add(readableArray.getBoolean(i));\n          break;\n        case Number:\n          double number = readableArray.getDouble(i);\n          if (number == Math.rint(number)) {\n            // Add as an integer\n            list.add((int) number);\n          } else {\n            // Add as a double\n            list.add(number);\n          }\n          break;\n        case String:\n          list.add(readableArray.getString(i));\n          break;\n        case Map:\n          list.add(toBundle(readableArray.getMap(i)));\n          break;\n        case Array:\n          list.add(toList(readableArray.getArray(i)));\n          break;\n        default:\n          throw new IllegalArgumentException(\"Could not convert object in array.\");\n      }\n    }\n\n    return list;\n  }\n\n  /**\n   * Convert a {@link WritableMap} to a {@link Bundle}.\n   * Note: Each array is converted to an {@link ArrayList}.\n   *\n   * @param readableMap the {@link WritableMap} to convert.\n   * @return the converted {@link Bundle}.\n   */\n  @Nullable\n  public static Bundle toBundle(@Nullable ReadableMap readableMap) {\n    if (readableMap == null) {\n      return null;\n    }\n\n    ReadableMapKeySetIterator iterator = readableMap.keySetIterator();\n\n    Bundle bundle = new Bundle();\n    while (iterator.hasNextKey()) {\n      String key = iterator.nextKey();\n      ReadableType readableType = readableMap.getType(key);\n      switch (readableType) {\n        case Null:\n          bundle.putString(key, null);\n          break;\n        case Boolean:\n          bundle.putBoolean(key, readableMap.getBoolean(key));\n          break;\n        case Number:\n          // Can be int or double.\n          bundle.putDouble(key, readableMap.getDouble(key));\n          break;\n        case String:\n          bundle.putString(key, readableMap.getString(key));\n          break;\n        case Map:\n          bundle.putBundle(key, toBundle(readableMap.getMap(key)));\n          break;\n        case Array:\n          bundle.putSerializable(key, toList(readableMap.getArray(key)));\n          break;\n        default:\n          throw new IllegalArgumentException(\"Could not convert object with key: \" + key + \".\");\n      }\n    }\n\n    return bundle;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"bridge\",\n    srcs = glob([\"**/*.java\"]),\n    exported_deps = [\n        react_native_dep(\"java/com/facebook/jni:jni\"),\n        react_native_dep(\"java/com/facebook/proguard/annotations:annotations\"),\n        react_native_dep(\"third-party/java/jsr-330:jsr-330\"),\n    ],\n    proguard_config = \"reactnative.pro\",\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    required_for_source_only_abi = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"java/com/facebook/debug/debugoverlay/model:model\"),\n        react_native_dep(\"java/com/facebook/systrace:systrace\"),\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"libraries/soloader/java/com/facebook/soloader:soloader\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/debug/tags:tags\"),\n        react_native_target(\"java/com/facebook/debug/holder:holder\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/model:model\"),\n    ] + ([react_native_target(\"jni/react/jni:jni\")] if not IS_OSS_BUILD else []),\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/BaseActivityEventListener.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\nimport android.app.Activity;\nimport android.content.Intent;\n\n/**\n * An empty implementation of {@link ActivityEventListener}\n */\npublic class BaseActivityEventListener implements ActivityEventListener {\n\n  /**\n   * @deprecated use {@link #onActivityResult(Activity, int, int, Intent)} instead.\n   */\n  @Deprecated\n  public void onActivityResult(int requestCode, int resultCode, Intent data) { }\n\n  @Override\n  public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) { }\n\n  @Override\n  public void onNewIntent(Intent intent) { }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/BaseJavaModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Map;\n\n/**\n * Base class for Catalyst native modules whose implementations are written in Java. Default\n * implementations for {@link #initialize} and {@link #onCatalystInstanceDestroy} are provided for\n * convenience.  Subclasses which override these don't need to call {@code super} in case of\n * overriding those methods as implementation of those methods is empty.\n *\n * BaseJavaModules can be linked to Fragments' lifecycle events, {@link CatalystInstance} creation\n * and destruction, by being called on the appropriate method when a life cycle event occurs.\n *\n * Native methods can be exposed to JS with {@link ReactMethod} annotation. Those methods may\n * only use limited number of types for their arguments:\n * 1/ primitives (boolean, int, float, double\n * 2/ {@link String} mapped from JS string\n * 3/ {@link ReadableArray} mapped from JS Array\n * 4/ {@link ReadableMap} mapped from JS Object\n * 5/ {@link Callback} mapped from js function and can be used only as a last parameter or in the\n * case when it express success & error callback pair as two last arguments respectively.\n *\n * All methods exposed as native to JS with {@link ReactMethod} annotation must return\n * {@code void}.\n *\n * Please note that it is not allowed to have multiple methods annotated with {@link ReactMethod}\n * with the same name.\n */\npublic abstract class BaseJavaModule implements NativeModule {\n  // taken from Libraries/Utilities/MessageQueue.js\n  static final public String METHOD_TYPE_ASYNC = \"async\";\n  static final public String METHOD_TYPE_PROMISE= \"promise\";\n  static final public String METHOD_TYPE_SYNC = \"sync\";\n\n  /**\n   * @return a map of constants this module exports to JS. Supports JSON types.\n   */\n  public @Nullable Map<String, Object> getConstants() {\n    return null;\n  }\n\n  @Override\n  public void initialize() {\n    // do nothing\n  }\n\n  @Override\n  public boolean canOverrideExistingModule() {\n    // TODO(t11394819): Make this final and use annotation\n    return false;\n  }\n\n  @Override\n  public void onCatalystInstanceDestroy() {\n    // do nothing\n  }\n\n  public boolean hasConstants() {\n    return false;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/CallbackImpl.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\n/**\n * Implementation of javascript callback function that use Bridge to schedule method execution\n */\npublic final class CallbackImpl implements Callback {\n\n  private final JSInstance mJSInstance;\n  private final int mCallbackId;\n  private boolean mInvoked;\n\n  public CallbackImpl(JSInstance jsInstance, int callbackId) {\n    mJSInstance = jsInstance;\n    mCallbackId = callbackId;\n    mInvoked = false;\n  }\n\n  @Override\n  public void invoke(Object... args) {\n    if (mInvoked) {\n      throw new RuntimeException(\"Illegal callback invocation from native \"+\n        \"module. This callback type only permits a single invocation from \"+\n        \"native code.\");\n    }\n    mJSInstance.invokeCallback(mCallbackId, Arguments.fromJavaArgs(args));\n    mInvoked = true;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.react.bridge.queue.ReactQueueConfiguration;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport java.util.Collection;\nimport javax.annotation.Nullable;\n\n/**\n * A higher level API on top of the asynchronous JSC bridge. This provides an\n * environment allowing the invocation of JavaScript methods and lets a set of\n * Java APIs be invokable from JavaScript as well.\n */\n@DoNotStrip\npublic interface CatalystInstance\n    extends MemoryPressureListener, JSInstance {\n  void runJSBundle();\n\n  // Returns the status of running the JS bundle; waits for an answer if runJSBundle is running\n  boolean hasRunJSBundle();\n\n  /**\n   * Return the source URL of the JS Bundle that was run, or {@code null} if no JS\n   * bundle has been run yet.\n   */\n  @Nullable String getSourceURL();\n\n  // This is called from java code, so it won't be stripped anyway, but proguard will rename it,\n  // which this prevents.\n  @Override @DoNotStrip\n  void invokeCallback(\n      int callbackID,\n      NativeArray arguments);\n  @DoNotStrip\n  void callFunction(\n      String module,\n      String method,\n      NativeArray arguments);\n  /**\n   * Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration\n   * (besides the UI thread) to finish running. Must be called from the UI thread so that we can\n   * fully shut down other threads.\n   */\n  void destroy();\n  boolean isDestroyed();\n\n  /**\n   * Initialize all the native modules\n   */\n  @VisibleForTesting\n  void initialize();\n\n  ReactQueueConfiguration getReactQueueConfiguration();\n\n  <T extends JavaScriptModule> T getJSModule(Class<T> jsInterface);\n  <T extends NativeModule> boolean hasNativeModule(Class<T> nativeModuleInterface);\n  <T extends NativeModule> T getNativeModule(Class<T> nativeModuleInterface);\n  Collection<NativeModule> getNativeModules();\n\n  /**\n   * This method permits a CatalystInstance to extend the known\n   * Native modules. This provided registry contains only the new modules to load.\n   */\n  void extendNativeModules(NativeModuleRegistry modules);\n\n  /**\n   * Adds a idle listener for this Catalyst instance. The listener will receive notifications\n   * whenever the bridge transitions from idle to busy and vice-versa, where the busy state is\n   * defined as there being some non-zero number of calls to JS that haven't resolved via a\n   * onBatchCompleted call. The listener should be purely passive and not affect application logic.\n   */\n  void addBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener);\n\n  /**\n   * Removes a NotThreadSafeBridgeIdleDebugListener previously added with\n   * {@link #addBridgeIdleDebugListener}\n   */\n  void removeBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener);\n\n  /** This method registers the file path of an additional JS segment by its ID. */\n  void registerSegment(int segmentId, String path);\n\n  @VisibleForTesting\n  void setGlobalVariable(String propName, String jsonValue);\n\n  /**\n   * Get the C pointer (as a long) to the JavaScriptCore context associated with this instance.\n   *\n   * <p>Use the following pattern to ensure that the JS context is not cleared while you are using\n   * it: JavaScriptContextHolder jsContext = reactContext.getJavaScriptContextHolder()\n   * synchronized(jsContext) { nativeThingNeedingJsContext(jsContext.get()); }\n   */\n  JavaScriptContextHolder getJavaScriptContextHolder();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport android.content.res.AssetManager;\nimport android.os.AsyncTask;\nimport android.util.Log;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.react.bridge.queue.MessageQueueThread;\nimport com.facebook.react.bridge.queue.QueueThreadExceptionHandler;\nimport com.facebook.react.bridge.queue.ReactQueueConfiguration;\nimport com.facebook.react.bridge.queue.ReactQueueConfigurationImpl;\nimport com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.systrace.Systrace;\nimport com.facebook.systrace.TraceListener;\nimport java.lang.ref.WeakReference;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.concurrent.CopyOnWriteArrayList;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport javax.annotation.Nullable;\n\n/**\n * This provides an implementation of the public CatalystInstance instance.  It is public because\n * it is built by XReactInstanceManager which is in a different package.\n */\n@DoNotStrip\npublic class CatalystInstanceImpl implements CatalystInstance {\n  static {\n    ReactBridge.staticInit();\n  }\n\n  private static final AtomicInteger sNextInstanceIdForTrace = new AtomicInteger(1);\n\n  public static class PendingJSCall {\n\n    public String mModule;\n    public String mMethod;\n    public @Nullable NativeArray mArguments;\n\n    public PendingJSCall(String module, String method, @Nullable NativeArray arguments) {\n      mModule = module;\n      mMethod = method;\n      mArguments = arguments;\n    }\n\n    void call(CatalystInstanceImpl catalystInstance) {\n      NativeArray arguments = mArguments != null ? mArguments : new WritableNativeArray();\n      catalystInstance.jniCallJSFunction(mModule, mMethod, arguments);\n    }\n\n    public String toString() {\n      return mModule + \".\" + mMethod + \"(\"\n        + (mArguments == null ? \"\" : mArguments.toString()) + \")\";\n    }\n  }\n\n  // Access from any thread\n  private final ReactQueueConfigurationImpl mReactQueueConfiguration;\n  private final CopyOnWriteArrayList<NotThreadSafeBridgeIdleDebugListener> mBridgeIdleListeners;\n  private final AtomicInteger mPendingJSCalls = new AtomicInteger(0);\n  private final String mJsPendingCallsTitleForTrace =\n      \"pending_js_calls_instance\" + sNextInstanceIdForTrace.getAndIncrement();\n  private volatile boolean mDestroyed = false;\n  private final TraceListener mTraceListener;\n  private final JavaScriptModuleRegistry mJSModuleRegistry;\n  private final JSBundleLoader mJSBundleLoader;\n  private final ArrayList<PendingJSCall> mJSCallsPendingInit = new ArrayList<PendingJSCall>();\n  private final Object mJSCallsPendingInitLock = new Object();\n\n  private final NativeModuleRegistry mNativeModuleRegistry;\n  private final NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler;\n  private final MessageQueueThread mNativeModulesQueueThread;\n  private boolean mInitialized = false;\n  private volatile boolean mAcceptCalls = false;\n\n  private boolean mJSBundleHasLoaded;\n  private @Nullable String mSourceURL;\n\n  private JavaScriptContextHolder mJavaScriptContextHolder;\n\n  // C++ parts\n  private final HybridData mHybridData;\n  private native static HybridData initHybrid();\n\n  private CatalystInstanceImpl(\n      final ReactQueueConfigurationSpec reactQueueConfigurationSpec,\n      final JavaScriptExecutor jsExecutor,\n      final NativeModuleRegistry nativeModuleRegistry,\n      final JSBundleLoader jsBundleLoader,\n      NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) {\n    Log.d(ReactConstants.TAG, \"Initializing React Xplat Bridge.\");\n    mHybridData = initHybrid();\n\n    mReactQueueConfiguration = ReactQueueConfigurationImpl.create(\n        reactQueueConfigurationSpec,\n        new NativeExceptionHandler());\n    mBridgeIdleListeners = new CopyOnWriteArrayList<>();\n    mNativeModuleRegistry = nativeModuleRegistry;\n    mJSModuleRegistry = new JavaScriptModuleRegistry();\n    mJSBundleLoader = jsBundleLoader;\n    mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;\n    mNativeModulesQueueThread = mReactQueueConfiguration.getNativeModulesQueueThread();\n    mTraceListener = new JSProfilerTraceListener(this);\n\n    Log.d(ReactConstants.TAG, \"Initializing React Xplat Bridge before initializeBridge\");\n    initializeBridge(\n      new BridgeCallback(this),\n      jsExecutor,\n      mReactQueueConfiguration.getJSQueueThread(),\n      mNativeModulesQueueThread,\n      mNativeModuleRegistry.getJavaModules(this),\n      mNativeModuleRegistry.getCxxModules());\n    Log.d(ReactConstants.TAG, \"Initializing React Xplat Bridge after initializeBridge\");\n\n    mJavaScriptContextHolder = new JavaScriptContextHolder(getJavaScriptContext());\n  }\n\n  private static class BridgeCallback implements ReactCallback {\n    // We do this so the callback doesn't keep the CatalystInstanceImpl alive.\n    // In this case, the callback is held in C++ code, so the GC can't see it\n    // and determine there's an inaccessible cycle.\n    private final WeakReference<CatalystInstanceImpl> mOuter;\n\n    public BridgeCallback(CatalystInstanceImpl outer) {\n      mOuter = new WeakReference<CatalystInstanceImpl>(outer);\n    }\n\n    @Override\n    public void onBatchComplete() {\n      CatalystInstanceImpl impl = mOuter.get();\n      if (impl != null) {\n        impl.mNativeModuleRegistry.onBatchComplete();\n      }\n    }\n\n    @Override\n    public void incrementPendingJSCalls() {\n      CatalystInstanceImpl impl = mOuter.get();\n      if (impl != null) {\n        impl.incrementPendingJSCalls();\n      }\n    }\n\n    @Override\n    public void decrementPendingJSCalls() {\n      CatalystInstanceImpl impl = mOuter.get();\n      if (impl != null) {\n        impl.decrementPendingJSCalls();\n      }\n    }\n  }\n\n  /**\n   * This method and the native below permits a CatalystInstance to extend the known\n   * Native modules. This registry contains only the new modules to load. The\n   * registry {@code mNativeModuleRegistry} updates internally to contain all the new modules, and generates\n   * the new registry for extracting just the new collections.\n   */\n  @Override\n  public void extendNativeModules(NativeModuleRegistry modules) {\n    //Extend the Java-visible registry of modules\n    mNativeModuleRegistry.registerModules(modules);\n    Collection<JavaModuleWrapper> javaModules = modules.getJavaModules(this);\n    Collection<ModuleHolder> cxxModules = modules.getCxxModules();\n    //Extend the Cxx-visible registry of modules wrapped in appropriate interfaces\n    jniExtendNativeModules(javaModules, cxxModules);\n  }\n\n  private native void jniExtendNativeModules(\n    Collection<JavaModuleWrapper> javaModules,\n    Collection<ModuleHolder> cxxModules);\n\n  private native void initializeBridge(\n      ReactCallback callback,\n      JavaScriptExecutor jsExecutor,\n      MessageQueueThread jsQueue,\n      MessageQueueThread moduleQueue,\n      Collection<JavaModuleWrapper> javaModules,\n      Collection<ModuleHolder> cxxModules);\n\n  /**\n   * This API is used in situations where the JS bundle is being executed not on\n   * the device, but on a host machine. In that case, we must provide two source\n   * URLs for the JS bundle: One to be used on the device, and one to be used on\n   * the remote debugging machine.\n   *\n   * @param deviceURL A source URL that is accessible from this device.\n   * @param remoteURL A source URL that is accessible from the remote machine\n   * executing the JS.\n   */\n  /* package */ void setSourceURLs(String deviceURL, String remoteURL) {\n    mSourceURL = deviceURL;\n    jniSetSourceURL(remoteURL);\n  }\n\n  @Override\n  public void registerSegment(int segmentId, String path) {\n    jniRegisterSegment(segmentId, path);\n  }\n\n  /* package */ void loadScriptFromAssets(AssetManager assetManager, String assetURL, boolean loadSynchronously) {\n    mSourceURL = assetURL;\n    jniLoadScriptFromAssets(assetManager, assetURL, loadSynchronously);\n  }\n\n  /* package */ void loadScriptFromFile(String fileName, String sourceURL, boolean loadSynchronously) {\n    mSourceURL = sourceURL;\n    jniLoadScriptFromFile(fileName, sourceURL, loadSynchronously);\n  }\n\n  private native void jniSetSourceURL(String sourceURL);\n  private native void jniRegisterSegment(int segmentId, String path);\n  private native void jniLoadScriptFromAssets(AssetManager assetManager, String assetURL, boolean loadSynchronously);\n  private native void jniLoadScriptFromFile(String fileName, String sourceURL, boolean loadSynchronously);\n\n  @Override\n  public void runJSBundle() {\n    Log.d(ReactConstants.TAG, \"CatalystInstanceImpl.runJSBundle()\");\n    Assertions.assertCondition(!mJSBundleHasLoaded, \"JS bundle was already loaded!\");\n    // incrementPendingJSCalls();\n    mJSBundleLoader.loadScript(CatalystInstanceImpl.this);\n\n    synchronized (mJSCallsPendingInitLock) {\n\n      // Loading the bundle is queued on the JS thread, but may not have\n      // run yet.  It's safe to set this here, though, since any work it\n      // gates will be queued on the JS thread behind the load.\n      mAcceptCalls = true;\n\n      for (PendingJSCall function : mJSCallsPendingInit) {\n        function.call(this);\n      }\n      mJSCallsPendingInit.clear();\n      mJSBundleHasLoaded = true;\n    }\n\n    // This is registered after JS starts since it makes a JS call\n    Systrace.registerListener(mTraceListener);\n  }\n\n  @Override\n  public boolean hasRunJSBundle() {\n    synchronized (mJSCallsPendingInitLock) {\n      return mJSBundleHasLoaded && mAcceptCalls;\n    }\n  }\n\n  @Override\n  public @Nullable String getSourceURL() {\n    return mSourceURL;\n  }\n\n  private native void jniCallJSFunction(\n    String module,\n    String method,\n    NativeArray arguments);\n\n  @Override\n  public void callFunction(\n      final String module,\n      final String method,\n      final NativeArray arguments) {\n    callFunction(new PendingJSCall(module, method, arguments));\n  }\n\n  public void callFunction(PendingJSCall function) {\n    if (mDestroyed) {\n      final String call = function.toString();\n      FLog.w(ReactConstants.TAG, \"Calling JS function after bridge has been destroyed: \" + call);\n      return;\n    }\n    if (!mAcceptCalls) {\n      // Most of the time the instance is initialized and we don't need to acquire the lock\n      synchronized (mJSCallsPendingInitLock) {\n        if (!mAcceptCalls) {\n          mJSCallsPendingInit.add(function);\n          return;\n        }\n      }\n    }\n    function.call(this);\n  }\n\n  private native void jniCallJSCallback(int callbackID, NativeArray arguments);\n\n  @Override\n  public void invokeCallback(final int callbackID, final NativeArray arguments) {\n    if (mDestroyed) {\n      FLog.w(ReactConstants.TAG, \"Invoking JS callback after bridge has been destroyed.\");\n      return;\n    }\n\n    jniCallJSCallback(callbackID, arguments);\n  }\n\n  /**\n   * Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration\n   * (besides the UI thread) to finish running. Must be called from the UI thread so that we can\n   * fully shut down other threads.\n   */\n  @Override\n  public void destroy() {\n    Log.d(ReactConstants.TAG, \"CatalystInstanceImpl.destroy() start\");\n    UiThreadUtil.assertOnUiThread();\n\n    if (mDestroyed) {\n      return;\n    }\n\n    // TODO: tell all APIs to shut down\n    ReactMarker.logMarker(ReactMarkerConstants.DESTROY_CATALYST_INSTANCE_START);\n    mDestroyed = true;\n\n    mNativeModulesQueueThread.runOnQueue(\n        new Runnable() {\n          @Override\n          public void run() {\n            mNativeModuleRegistry.notifyJSInstanceDestroy();\n            boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0);\n            if (!wasIdle && !mBridgeIdleListeners.isEmpty()) {\n              for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {\n                listener.onTransitionToBridgeIdle();\n              }\n            }\n            AsyncTask.execute(\n                new Runnable() {\n                  @Override\n                  public void run() {\n                    // Kill non-UI threads from neutral third party\n                    // potentially expensive, so don't run on UI thread\n\n                    // contextHolder is used as a lock to guard against other users of the JS VM having\n                    // the VM destroyed underneath them, so notify them before we resetNative\n                    mJavaScriptContextHolder.clear();\n\n                    mHybridData.resetNative();\n                    getReactQueueConfiguration().destroy();\n                    Log.d(ReactConstants.TAG, \"CatalystInstanceImpl.destroy() end\");\n                    ReactMarker.logMarker(ReactMarkerConstants.DESTROY_CATALYST_INSTANCE_END);\n                  }\n                });\n          }\n        });\n\n    // This is a noop if the listener was not yet registered.\n    Systrace.unregisterListener(mTraceListener);\n  }\n\n  @Override\n  public boolean isDestroyed() {\n    return mDestroyed;\n  }\n\n  /**\n   * Initialize all the native modules\n   */\n  @VisibleForTesting\n  @Override\n  public void initialize() {\n    Log.d(ReactConstants.TAG, \"CatalystInstanceImpl.initialize()\");\n    Assertions.assertCondition(\n        !mInitialized,\n        \"This catalyst instance has already been initialized\");\n    // We assume that the instance manager blocks on running the JS bundle. If\n    // that changes, then we need to set mAcceptCalls just after posting the\n    // task that will run the js bundle.\n    Assertions.assertCondition(\n        mAcceptCalls,\n        \"RunJSBundle hasn't completed.\");\n    mInitialized = true;\n    mNativeModulesQueueThread.runOnQueue(new Runnable() {\n      @Override\n      public void run() {\n        mNativeModuleRegistry.notifyJSInstanceInitialized();\n      }\n    });\n  }\n\n  @Override\n  public ReactQueueConfiguration getReactQueueConfiguration() {\n    return mReactQueueConfiguration;\n  }\n\n  @Override\n  public <T extends JavaScriptModule> T getJSModule(Class<T> jsInterface) {\n    return mJSModuleRegistry.getJavaScriptModule(this, jsInterface);\n  }\n\n  @Override\n  public <T extends NativeModule> boolean hasNativeModule(Class<T> nativeModuleInterface) {\n    return mNativeModuleRegistry.hasModule(nativeModuleInterface);\n  }\n\n  // This is only ever called with UIManagerModule or CurrentViewerModule.\n  @Override\n  public <T extends NativeModule> T getNativeModule(Class<T> nativeModuleInterface) {\n    return mNativeModuleRegistry.getModule(nativeModuleInterface);\n  }\n\n  // This is only used by com.facebook.react.modules.common.ModuleDataCleaner\n  @Override\n  public Collection<NativeModule> getNativeModules() {\n    return mNativeModuleRegistry.getAllModules();\n  }\n\n  private native void jniHandleMemoryPressure(int level);\n\n  @Override\n  public void handleMemoryPressure(int level) {\n    if (mDestroyed) {\n      return;\n    }\n    jniHandleMemoryPressure(level);\n  }\n\n  /**\n   * Adds a idle listener for this Catalyst instance. The listener will receive notifications\n   * whenever the bridge transitions from idle to busy and vice-versa, where the busy state is\n   * defined as there being some non-zero number of calls to JS that haven't resolved via a\n   * onBatchComplete call. The listener should be purely passive and not affect application logic.\n   */\n  @Override\n  public void addBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener) {\n    mBridgeIdleListeners.add(listener);\n  }\n\n  /**\n   * Removes a NotThreadSafeBridgeIdleDebugListener previously added with\n   * {@link #addBridgeIdleDebugListener}\n   */\n  @Override\n  public void removeBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener) {\n    mBridgeIdleListeners.remove(listener);\n  }\n\n  @Override\n  public native void setGlobalVariable(String propName, String jsonValue);\n\n  @Override\n  public JavaScriptContextHolder getJavaScriptContextHolder() {\n    return mJavaScriptContextHolder;\n  }\n\n  private native long getJavaScriptContext();\n\n  private void incrementPendingJSCalls() {\n    int oldPendingCalls = mPendingJSCalls.getAndIncrement();\n    boolean wasIdle = oldPendingCalls == 0;\n    Systrace.traceCounter(\n        Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n        mJsPendingCallsTitleForTrace,\n        oldPendingCalls + 1);\n    if (wasIdle && !mBridgeIdleListeners.isEmpty()) {\n      mNativeModulesQueueThread.runOnQueue(new Runnable() {\n        @Override\n        public void run() {\n          for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {\n            listener.onTransitionToBridgeBusy();\n          }\n        }\n      });\n    }\n  }\n\n  private void decrementPendingJSCalls() {\n    int newPendingCalls = mPendingJSCalls.decrementAndGet();\n    // TODO(9604406): handle case of web workers injecting messages to main thread\n    //Assertions.assertCondition(newPendingCalls >= 0);\n    boolean isNowIdle = newPendingCalls == 0;\n    Systrace.traceCounter(\n        Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n        mJsPendingCallsTitleForTrace,\n        newPendingCalls);\n\n    if (isNowIdle && !mBridgeIdleListeners.isEmpty()) {\n      mNativeModulesQueueThread.runOnQueue(new Runnable() {\n        @Override\n        public void run() {\n          for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {\n            listener.onTransitionToBridgeIdle();\n          }\n        }\n      });\n    }\n  }\n\n  private void onNativeException(Exception e) {\n    mNativeModuleCallExceptionHandler.handleException(e);\n    mReactQueueConfiguration.getUIQueueThread().runOnQueue(\n      new Runnable() {\n        @Override\n        public void run() {\n          destroy();\n        }\n      });\n  }\n\n  private class NativeExceptionHandler implements QueueThreadExceptionHandler {\n    @Override\n    public void handleException(Exception e) {\n      // Any Exception caught here is because of something in JS. Even if it's a bug in the\n      // framework/native code, it was triggered by JS and theoretically since we were able\n      // to set up the bridge, JS could change its logic, reload, and not trigger that crash.\n      onNativeException(e);\n    }\n  }\n\n  private static class JSProfilerTraceListener implements TraceListener {\n    // We do this so the callback doesn't keep the CatalystInstanceImpl alive.\n    // In this case, Systrace will keep the registered listener around forever\n    // if the CatalystInstanceImpl is not explicitly destroyed. These instances\n    // can still leak, but they are at least small.\n    private final WeakReference<CatalystInstanceImpl> mOuter;\n\n    public JSProfilerTraceListener(CatalystInstanceImpl outer) {\n      mOuter = new WeakReference<CatalystInstanceImpl>(outer);\n    }\n\n    @Override\n    public void onTraceStarted() {\n      CatalystInstanceImpl impl = mOuter.get();\n      if (impl != null) {\n        impl.getJSModule(com.facebook.react.bridge.Systrace.class).setEnabled(true);\n      }\n    }\n\n    @Override\n    public void onTraceStopped() {\n      CatalystInstanceImpl impl = mOuter.get();\n      if (impl != null) {\n        impl.getJSModule(com.facebook.react.bridge.Systrace.class).setEnabled(false);\n      }\n    }\n  }\n\n  public static class Builder {\n\n    private @Nullable ReactQueueConfigurationSpec mReactQueueConfigurationSpec;\n    private @Nullable JSBundleLoader mJSBundleLoader;\n    private @Nullable NativeModuleRegistry mRegistry;\n    private @Nullable JavaScriptExecutor mJSExecutor;\n    private @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler;\n\n    public Builder setReactQueueConfigurationSpec(\n        ReactQueueConfigurationSpec ReactQueueConfigurationSpec) {\n      mReactQueueConfigurationSpec = ReactQueueConfigurationSpec;\n      return this;\n    }\n\n    public Builder setRegistry(NativeModuleRegistry registry) {\n      mRegistry = registry;\n      return this;\n    }\n\n    public Builder setJSBundleLoader(JSBundleLoader jsBundleLoader) {\n      mJSBundleLoader = jsBundleLoader;\n      return this;\n    }\n\n    public Builder setJSExecutor(JavaScriptExecutor jsExecutor) {\n      mJSExecutor = jsExecutor;\n      return this;\n    }\n\n    public Builder setNativeModuleCallExceptionHandler(\n        NativeModuleCallExceptionHandler handler) {\n      mNativeModuleCallExceptionHandler = handler;\n      return this;\n    }\n\n    public CatalystInstanceImpl build() {\n      return new CatalystInstanceImpl(\n          Assertions.assertNotNull(mReactQueueConfigurationSpec),\n          Assertions.assertNotNull(mJSExecutor),\n          Assertions.assertNotNull(mRegistry),\n          Assertions.assertNotNull(mJSBundleLoader),\n          Assertions.assertNotNull(mNativeModuleCallExceptionHandler));\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ContextBaseJavaModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport android.content.Context;\n\n/**\n * Base class for React native modules that require access to an Android\n * {@link Context} instance.\n */\npublic abstract class ContextBaseJavaModule extends BaseJavaModule {\n\n  private final Context mContext;\n\n  public ContextBaseJavaModule(Context context) {\n    mContext = context;\n  }\n\n  /**\n   * Subclasses can use this method to access Android context passed as a constructor\n   */\n  protected final Context getContext() {\n    return mContext;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/CxxCallbackImpl.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.NativeArray;\n\nimport static com.facebook.react.bridge.Arguments.*;\n\n/**\n * Callback impl that calls directly into the cxx bridge. Created from C++.\n */\n@DoNotStrip\npublic class CxxCallbackImpl implements Callback {\n  @DoNotStrip\n  private final HybridData mHybridData;\n\n  @DoNotStrip\n  private CxxCallbackImpl(HybridData hybridData) {\n    mHybridData = hybridData;\n  }\n\n  @Override\n  public void invoke(Object... args) {\n    nativeInvoke(fromJavaArgs(args));\n  }\n\n  private native void nativeInvoke(NativeArray arguments);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/CxxModuleWrapper.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.soloader.SoLoader;\n\n/**\n * This does nothing interesting, except avoid breaking existing code.\n */\n@DoNotStrip\npublic class CxxModuleWrapper extends CxxModuleWrapperBase\n{\n  protected CxxModuleWrapper(HybridData hd) {\n    super(hd);\n  }\n\n  private static native CxxModuleWrapper makeDsoNative(String soPath, String factory);\n\n  public static CxxModuleWrapper makeDso(String library, String factory) {\n    SoLoader.loadLibrary(library);\n    String soPath = SoLoader.unpackLibraryAndDependencies(library).getAbsolutePath();\n    return makeDsoNative(soPath, factory);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/CxxModuleWrapperBase.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * A Java Object which represents a cross-platform C++ module\n *\n * This module implements the NativeModule interface but will never be invoked from Java,\n * instead the underlying Cxx module will be extracted by the bridge and called directly.\n */\n@DoNotStrip\npublic class CxxModuleWrapperBase implements NativeModule\n{\n  static {\n    ReactBridge.staticInit();\n  }\n\n  @DoNotStrip\n  private HybridData mHybridData;\n\n  @Override\n  public native String getName();\n\n  @Override\n  public void initialize() {\n    // do nothing\n  }\n\n  @Override\n  public boolean canOverrideExistingModule() {\n    return false;\n  }\n\n  @Override\n  public void onCatalystInstanceDestroy() {\n    mHybridData.resetNative();\n  }\n\n  // For creating a wrapper from C++, or from a derived class.\n  protected CxxModuleWrapperBase(HybridData hd) {\n    mHybridData = hd;\n  }\n\n  // Replace the current native module held by this wrapper by a new instance\n  protected void resetModule(HybridData hd) {\n    if (hd != mHybridData) {\n      mHybridData.resetNative();\n      mHybridData = hd;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/Dynamic.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\n/**\n * Type representing a piece of data with unknown runtime type. Useful for allowing javascript to\n * pass one of multiple types down to the native layer.\n */\npublic interface Dynamic {\n  boolean isNull();\n  boolean asBoolean();\n  double asDouble();\n  int asInt();\n  String asString();\n  ReadableArray asArray();\n  ReadableMap asMap();\n  ReadableType getType();\n  void recycle();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/DynamicFromArray.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport javax.annotation.Nullable;\n\nimport android.support.v4.util.Pools;\n\n/**\n * Implementation of Dynamic wrapping a ReadableArray.\n */\npublic class DynamicFromArray implements Dynamic {\n  private static final Pools.SimplePool<DynamicFromArray> sPool = new Pools.SimplePool<>(10);\n\n  private @Nullable ReadableArray mArray;\n  private int mIndex = -1;\n\n  // This is a pools object. Hide the constructor.\n  private DynamicFromArray() {}\n\n  public static DynamicFromArray create(ReadableArray array, int index) {\n    DynamicFromArray dynamic = sPool.acquire();\n    if (dynamic == null) {\n      dynamic = new DynamicFromArray();\n    }\n    dynamic.mArray = array;\n    dynamic.mIndex = index;\n    return dynamic;\n  }\n\n  @Override\n  public void recycle() {\n    mArray = null;\n    mIndex = -1;\n    sPool.release(this);\n  }\n\n  @Override\n  public boolean isNull() {\n    if (mArray == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mArray.isNull(mIndex);\n  }\n\n  @Override\n  public boolean asBoolean() {\n    if (mArray == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mArray.getBoolean(mIndex);\n  }\n\n  @Override\n  public double asDouble() {\n    if (mArray == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mArray.getDouble(mIndex);\n  }\n\n  @Override\n  public int asInt() {\n    if (mArray == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mArray.getInt(mIndex);\n  }\n\n  @Override\n  public String asString() {\n    if (mArray == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mArray.getString(mIndex);\n  }\n\n  @Override\n  public ReadableArray asArray() {\n    if (mArray == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mArray.getArray(mIndex);\n  }\n\n  @Override\n  public ReadableMap asMap() {\n    if (mArray == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mArray.getMap(mIndex);\n  }\n\n  @Override\n  public ReadableType getType() {\n    if (mArray == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mArray.getType(mIndex);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/DynamicFromMap.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport javax.annotation.Nullable;\n\nimport android.support.v4.util.Pools;\n\n/**\n * Implementation of Dynamic wrapping a ReadableMap.\n */\npublic class DynamicFromMap implements Dynamic {\n  private static final Pools.SimplePool<DynamicFromMap> sPool = new Pools.SimplePool<>(10);\n\n  private @Nullable ReadableMap mMap;\n  private @Nullable String mName;\n\n  // This is a pools object. Hide the constructor.\n  private DynamicFromMap() {}\n\n  public static DynamicFromMap create(ReadableMap map, String name) {\n    DynamicFromMap dynamic = sPool.acquire();\n    if (dynamic == null) {\n      dynamic = new DynamicFromMap();\n    }\n    dynamic.mMap = map;\n    dynamic.mName = name;\n    return dynamic;\n  }\n\n  @Override\n  public void recycle() {\n    mMap = null;\n    mName = null;\n    sPool.release(this);\n  }\n\n  @Override\n  public boolean isNull() {\n    if (mMap == null || mName == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mMap.isNull(mName);\n  }\n\n  @Override\n  public boolean asBoolean() {\n    if (mMap == null || mName == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mMap.getBoolean(mName);\n  }\n\n  @Override\n  public double asDouble() {\n    if (mMap == null || mName == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mMap.getDouble(mName);\n  }\n\n  @Override\n  public int asInt() {\n    if (mMap == null || mName == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mMap.getInt(mName);\n  }\n\n  @Override\n  public String asString() {\n    if (mMap == null || mName == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mMap.getString(mName);\n  }\n\n  @Override\n  public ReadableArray asArray() {\n    if (mMap == null || mName == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mMap.getArray(mName);\n  }\n\n  @Override\n  public ReadableMap asMap() {\n    if (mMap == null || mName == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mMap.getMap(mName);\n  }\n\n  @Override\n  public ReadableType getType() {\n    if (mMap == null || mName == null) {\n      throw new IllegalStateException(\"This dynamic value has been recycled\");\n    }\n    return mMap.getType(mName);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/FallbackJSBundleLoader.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.ListIterator;\nimport java.util.Stack;\n\nimport com.facebook.common.logging.FLog;\n\n/**\n * FallbackJSBundleLoader\n *\n * An implementation of {@link JSBundleLoader} that will try to load from\n * multiple sources, falling back from one source to the next at load time\n * when an exception is thrown for a recoverable error.\n */\npublic final class FallbackJSBundleLoader extends JSBundleLoader {\n\n  /* package */ static final String RECOVERABLE = \"facebook::react::Recoverable\";\n  /* package */ static final String TAG = \"FallbackJSBundleLoader\";\n\n  // Loaders to delegate to, with the preferred one at the top.\n  private Stack<JSBundleLoader> mLoaders;\n\n  // Reasons why we fell-back on previous loaders, in order of occurrence.\n  private final ArrayList<Exception> mRecoveredErrors = new ArrayList<>();\n\n  /**\n   * @param loaders Loaders for the sources to try, in descending order of\n   *                preference.\n   */\n  public FallbackJSBundleLoader(List<JSBundleLoader> loaders) {\n    mLoaders = new Stack();\n    ListIterator<JSBundleLoader> it = loaders.listIterator(loaders.size());\n    while (it.hasPrevious()) {\n      mLoaders.push(it.previous());\n    }\n  }\n\n  /**\n   * This loader delegates to (and so behaves like) the currently preferred\n   * loader. If that loader fails in a recoverable way and we fall back from it,\n   * it is replaced by the next most preferred loader.\n   */\n  @Override\n  public String loadScript(CatalystInstanceImpl instance) {\n    while (true) {\n      try {\n        return getDelegateLoader().loadScript(instance);\n      } catch (Exception e) {\n        if (!e.getMessage().startsWith(RECOVERABLE)) {\n          throw e;\n        }\n\n        mLoaders.pop();\n        mRecoveredErrors.add(e);\n        FLog.wtf(TAG, \"Falling back from recoverable error\", e);\n      }\n    }\n  }\n\n  private JSBundleLoader getDelegateLoader() {\n    if (!mLoaders.empty()) {\n      return mLoaders.peek();\n    }\n\n    RuntimeException fallbackException =\n      new RuntimeException(\"No fallback options available\");\n\n    // Invariant: tail.getCause() == null\n    Throwable tail = fallbackException;\n    for (Exception e : mRecoveredErrors) {\n      tail.initCause(e);\n      while (tail.getCause() != null) {\n        tail = tail.getCause();\n      }\n    }\n\n    throw fallbackException;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/GuardedRunnable.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\n/**\n * Abstract base for a Runnable that should have any RuntimeExceptions it throws\n * handled by the {@link com.facebook.react.bridge.NativeModuleCallExceptionHandler} registered if\n * the app is in dev mode.\n */\npublic abstract class GuardedRunnable implements Runnable {\n\n  private final ReactContext mReactContext;\n\n  public GuardedRunnable(ReactContext reactContext) {\n    mReactContext = reactContext;\n  }\n\n  @Override\n  public final void run() {\n    try {\n      runGuarded();\n    } catch (RuntimeException e) {\n      mReactContext.handleException(e);\n    }\n  }\n\n  public abstract void runGuarded();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/Inspector.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.react.common.ReactConstants;\n\n@DoNotStrip\npublic class Inspector {\n  static {\n    ReactBridge.staticInit();\n  }\n\n  private final HybridData mHybridData;\n\n  public static List<Page> getPages() {\n    try {\n      return Arrays.asList(instance().getPagesNative());\n    } catch (UnsatisfiedLinkError e) {\n      FLog.e(ReactConstants.TAG, \"Inspector doesn't work in open source yet\", e);\n      return Collections.emptyList();\n    }\n  }\n\n  public static LocalConnection connect(int pageId, RemoteConnection remote) {\n    try {\n      return instance().connectNative(pageId, remote);\n    } catch (UnsatisfiedLinkError e) {\n      FLog.e(ReactConstants.TAG, \"Inspector doesn't work in open source yet\", e);\n      throw new RuntimeException(e);\n    }\n  }\n\n  private static native Inspector instance();\n\n  private native Page[] getPagesNative();\n\n  private native LocalConnection connectNative(int pageId, RemoteConnection remote);\n\n  private Inspector(HybridData hybridData) {\n    mHybridData = hybridData;\n  }\n\n  @DoNotStrip\n  public static class Page {\n    private final int mId;\n    private final String mTitle;\n\n    public int getId() {\n      return mId;\n    }\n\n    public String getTitle() {\n      return mTitle;\n    }\n\n    @Override\n    public String toString() {\n      return \"Page{\" +\n          \"mId=\" + mId +\n          \", mTitle='\" + mTitle + '\\'' +\n          '}';\n    }\n\n    @DoNotStrip\n    private Page(int id, String title) {\n      mId = id;\n      mTitle = title;\n    }\n  }\n\n  @DoNotStrip\n  public interface RemoteConnection {\n    void onMessage(String message);\n    void onDisconnect();\n  }\n\n  @DoNotStrip\n  public static class LocalConnection {\n    private final HybridData mHybridData;\n\n    public native void sendMessage(String message);\n    public native void disconnect();\n\n    private LocalConnection(HybridData hybridData) {\n      mHybridData = hybridData;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JSBundleLoader.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport android.content.Context;\nimport com.facebook.react.common.DebugServerException;\n\n/**\n * A class that stores JS bundle information and allows {@link CatalystInstance} to load a correct\n * bundle through {@link ReactBridge}.\n */\npublic abstract class JSBundleLoader {\n\n  /**\n   * This loader is recommended one for release version of your app. In that case local JS executor\n   * should be used. JS bundle will be read from assets in native code to save on passing large\n   * strings from java to native memory.\n   */\n  public static JSBundleLoader createAssetLoader(\n      final Context context,\n      final String assetUrl,\n      final boolean loadSynchronously) {\n    return new JSBundleLoader() {\n      @Override\n      public String loadScript(CatalystInstanceImpl instance) {\n        instance.loadScriptFromAssets(context.getAssets(), assetUrl, loadSynchronously);\n        return assetUrl;\n      }\n    };\n  }\n\n  /**\n   * This loader loads bundle from file system. The bundle will be read in native code to save on\n   * passing large strings from java to native memory.\n   */\n  public static JSBundleLoader createFileLoader(final String fileName) {\n    return createFileLoader(fileName, fileName, false);\n  }\n\n  public static JSBundleLoader createFileLoader(\n      final String fileName,\n      final String assetUrl,\n      final boolean loadSynchronously) {\n    return new JSBundleLoader() {\n      @Override\n      public String loadScript(CatalystInstanceImpl instance) {\n        instance.loadScriptFromFile(fileName, assetUrl, loadSynchronously);\n        return fileName;\n      }\n    };\n  }\n\n  /**\n   * This loader is used when bundle gets reloaded from dev server. In that case loader expect JS\n   * bundle to be prefetched and stored in local file. We do that to avoid passing large strings\n   * between java and native code and avoid allocating memory in java to fit whole JS bundle in it.\n   * Providing correct {@param sourceURL} of downloaded bundle is required for JS stacktraces to\n   * work correctly and allows for source maps to correctly symbolize those.\n   */\n  public static JSBundleLoader createCachedBundleFromNetworkLoader(\n      final String sourceURL,\n      final String cachedFileLocation) {\n    return new JSBundleLoader() {\n      @Override\n      public String loadScript(CatalystInstanceImpl instance) {\n        try {\n          instance.loadScriptFromFile(cachedFileLocation, sourceURL, false);\n          return sourceURL;\n        } catch (Exception e) {\n          throw DebugServerException.makeGeneric(e.getMessage(), e);\n        }\n      }\n    };\n  }\n\n  /**\n   * This loader is used when proxy debugging is enabled. In that case there is no point in fetching\n   * the bundle from device as remote executor will have to do it anyway.\n   */\n  public static JSBundleLoader createRemoteDebuggerBundleLoader(\n      final String proxySourceURL,\n      final String realSourceURL) {\n    return new JSBundleLoader() {\n      @Override\n      public String loadScript(CatalystInstanceImpl instance) {\n        instance.setSourceURLs(realSourceURL, proxySourceURL);\n        return realSourceURL;\n      }\n    };\n  }\n\n  /** Loads the script, returning the URL of the source it loaded. */\n  public abstract String loadScript(CatalystInstanceImpl instance);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JSCJavaScriptExecutor.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\n/* package */ class JSCJavaScriptExecutor extends JavaScriptExecutor {\n  static {\n    ReactBridge.staticInit();\n  }\n\n  /* package */ JSCJavaScriptExecutor(ReadableNativeMap jscConfig) {\n    super(initHybrid(jscConfig));\n  }\n\n  private native static HybridData initHybrid(ReadableNativeMap jscConfig);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JSCJavaScriptExecutorFactory.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\npublic class JSCJavaScriptExecutorFactory implements JavaScriptExecutorFactory {\n  private final String mAppName;\n  private final String mDeviceName;\n\n  public JSCJavaScriptExecutorFactory(String appName, String deviceName) {\n    this.mAppName = appName;\n    this.mDeviceName = deviceName;\n  }\n\n  @Override\n  public JavaScriptExecutor create() throws Exception {\n    WritableNativeMap jscConfig = new WritableNativeMap();\n    jscConfig.putString(\"OwnerIdentity\", \"ReactNative\");\n    jscConfig.putString(\"AppIdentity\", mAppName);\n    jscConfig.putString(\"DeviceIdentity\", mDeviceName);\n    return new JSCJavaScriptExecutor(jscConfig);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JSInstance.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\n/**\n * This interface includes the methods needed to use a running JS\n * instance, without specifying any of the bridge-specific\n * initialization or lifecycle management.\n */\npublic interface JSInstance {\n  void invokeCallback(\n      int callbackID,\n      NativeArray arguments);\n  // TODO if this interface survives refactoring, think about adding\n  // callFunction.\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JavaJSExecutor.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * This is class represents java version of native js executor interface. When set through\n * {@link ProxyJavaScriptExecutor} as a {@link CatalystInstance} executor, native code will\n * delegate js calls to the given implementation of this interface.\n */\n@DoNotStrip\npublic interface JavaJSExecutor {\n  interface Factory {\n    JavaJSExecutor create() throws Exception;\n  }\n\n  class ProxyExecutorException extends Exception {\n    public ProxyExecutorException(Throwable cause) {\n      super(cause);\n    }\n  }\n\n  /**\n   * Close this executor and cleanup any resources that it was using. No further calls are\n   * expected after this.\n   */\n  void close();\n\n  /**\n   * Load javascript into the js context\n   * @param sourceURL url or file location from which script content was loaded\n   */\n  @DoNotStrip\n  void loadApplicationScript(String sourceURL) throws ProxyExecutorException;\n\n  /**\n   * Execute javascript method within js context\n   * @param methodName name of the method to be executed\n   * @param jsonArgsArray json encoded array of arguments provided for the method call\n   * @return json encoded value returned from the method call\n   */\n  @DoNotStrip\n  String executeJSCall(String methodName, String jsonArgsArray)\n      throws ProxyExecutorException;\n\n  @DoNotStrip\n  void setGlobalVariable(String propertyName, String jsonEncodedValue);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JavaMethodWrapper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport static com.facebook.infer.annotation.Assertions.assertNotNull;\nimport static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;\n\nimport com.facebook.debug.holder.PrinterHolder;\nimport com.facebook.debug.tags.ReactDebugOverlayTags;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.systrace.SystraceMessage;\nimport java.lang.reflect.InvocationTargetException;\nimport java.lang.reflect.Method;\nimport javax.annotation.Nullable;\n\npublic class JavaMethodWrapper implements NativeModule.NativeMethod {\n\n  private static abstract class ArgumentExtractor<T> {\n    public int getJSArgumentsNeeded() {\n      return 1;\n    }\n\n    public abstract @Nullable T extractArgument(\n      JSInstance jsInstance, ReadableNativeArray jsArguments, int atIndex);\n  }\n\n  static final private ArgumentExtractor<Boolean> ARGUMENT_EXTRACTOR_BOOLEAN =\n    new ArgumentExtractor<Boolean>() {\n      @Override\n      public Boolean extractArgument(\n        JSInstance jsInstance, ReadableNativeArray jsArguments, int atIndex) {\n        return jsArguments.getBoolean(atIndex);\n      }\n    };\n\n  static final private ArgumentExtractor<Double> ARGUMENT_EXTRACTOR_DOUBLE =\n    new ArgumentExtractor<Double>() {\n      @Override\n      public Double extractArgument(\n        JSInstance jsInstance, ReadableNativeArray jsArguments, int atIndex) {\n        return jsArguments.getDouble(atIndex);\n      }\n    };\n\n  static final private ArgumentExtractor<Float> ARGUMENT_EXTRACTOR_FLOAT =\n    new ArgumentExtractor<Float>() {\n      @Override\n      public Float extractArgument(\n        JSInstance jsInstance, ReadableNativeArray jsArguments, int atIndex) {\n        return (float) jsArguments.getDouble(atIndex);\n      }\n    };\n\n  static final private ArgumentExtractor<Integer> ARGUMENT_EXTRACTOR_INTEGER =\n    new ArgumentExtractor<Integer>() {\n      @Override\n      public Integer extractArgument(\n        JSInstance jsInstance, ReadableNativeArray jsArguments, int atIndex) {\n        return (int) jsArguments.getDouble(atIndex);\n      }\n    };\n\n  static final private ArgumentExtractor<String> ARGUMENT_EXTRACTOR_STRING =\n    new ArgumentExtractor<String>() {\n      @Override\n      public String extractArgument(\n        JSInstance jsInstance, ReadableNativeArray jsArguments, int atIndex) {\n        return jsArguments.getString(atIndex);\n      }\n    };\n\n  static final private ArgumentExtractor<ReadableNativeArray> ARGUMENT_EXTRACTOR_ARRAY =\n    new ArgumentExtractor<ReadableNativeArray>() {\n      @Override\n      public ReadableNativeArray extractArgument(\n        JSInstance jsInstance, ReadableNativeArray jsArguments, int atIndex) {\n        return jsArguments.getArray(atIndex);\n      }\n    };\n\n  static final private ArgumentExtractor<Dynamic> ARGUMENT_EXTRACTOR_DYNAMIC =\n    new ArgumentExtractor<Dynamic>() {\n      @Override\n      public Dynamic extractArgument(\n        JSInstance jsInstance, ReadableNativeArray jsArguments, int atIndex) {\n        return DynamicFromArray.create(jsArguments, atIndex);\n      }\n    };\n\n  static final private ArgumentExtractor<ReadableMap> ARGUMENT_EXTRACTOR_MAP =\n    new ArgumentExtractor<ReadableMap>() {\n      @Override\n      public ReadableMap extractArgument(\n        JSInstance jsInstance, ReadableNativeArray jsArguments, int atIndex) {\n        return jsArguments.getMap(atIndex);\n      }\n    };\n\n  static final private ArgumentExtractor<Callback> ARGUMENT_EXTRACTOR_CALLBACK =\n    new ArgumentExtractor<Callback>() {\n      @Override\n      public @Nullable Callback extractArgument(\n        JSInstance jsInstance, ReadableNativeArray jsArguments, int atIndex) {\n        if (jsArguments.isNull(atIndex)) {\n          return null;\n        } else {\n          int id = (int) jsArguments.getDouble(atIndex);\n          return new com.facebook.react.bridge.CallbackImpl(jsInstance, id);\n        }\n      }\n    };\n\n  static final private ArgumentExtractor<Promise> ARGUMENT_EXTRACTOR_PROMISE =\n    new ArgumentExtractor<Promise>() {\n      @Override\n      public int getJSArgumentsNeeded() {\n        return 2;\n      }\n\n      @Override\n      public Promise extractArgument(\n        JSInstance jsInstance, ReadableNativeArray jsArguments, int atIndex) {\n        Callback resolve = ARGUMENT_EXTRACTOR_CALLBACK\n          .extractArgument(jsInstance, jsArguments, atIndex);\n        Callback reject = ARGUMENT_EXTRACTOR_CALLBACK\n          .extractArgument(jsInstance, jsArguments, atIndex + 1);\n        return new PromiseImpl(resolve, reject);\n      }\n    };\n\n  private static final boolean DEBUG =\n      PrinterHolder.getPrinter().shouldDisplayLogMessage(ReactDebugOverlayTags.BRIDGE_CALLS);\n\n  private static char paramTypeToChar(Class paramClass) {\n    char tryCommon = commonTypeToChar(paramClass);\n    if (tryCommon != '\\0') {\n      return tryCommon;\n    }\n    if (paramClass == Callback.class) {\n      return 'X';\n    } else if (paramClass == Promise.class) {\n      return 'P';\n    } else if (paramClass == ReadableMap.class) {\n      return 'M';\n    } else if (paramClass == ReadableArray.class) {\n      return 'A';\n    } else if (paramClass == Dynamic.class) {\n      return 'Y';\n    } else {\n      throw new RuntimeException(\n        \"Got unknown param class: \" + paramClass.getSimpleName());\n    }\n  }\n\n  private static char returnTypeToChar(Class returnClass) {\n    // Keep this in sync with MethodInvoker\n    char tryCommon = commonTypeToChar(returnClass);\n    if (tryCommon != '\\0') {\n      return tryCommon;\n    }\n    if (returnClass == void.class) {\n      return 'v';\n    } else if (returnClass == WritableMap.class) {\n      return 'M';\n    } else if (returnClass == WritableArray.class) {\n      return 'A';\n    } else {\n      throw new RuntimeException(\n        \"Got unknown return class: \" + returnClass.getSimpleName());\n    }\n  }\n\n  private static char commonTypeToChar(Class typeClass) {\n    if (typeClass == boolean.class) {\n      return 'z';\n    } else if (typeClass == Boolean.class) {\n      return 'Z';\n    } else if (typeClass == int.class) {\n      return 'i';\n    } else if (typeClass == Integer.class) {\n      return 'I';\n    } else if (typeClass == double.class) {\n      return 'd';\n    } else if (typeClass == Double.class) {\n      return 'D';\n    } else if (typeClass == float.class) {\n      return 'f';\n    } else if (typeClass == Float.class) {\n      return 'F';\n    } else if (typeClass == String.class) {\n      return 'S';\n    } else {\n      return '\\0';\n    }\n  }\n\n  private final Method mMethod;\n  private final Class[] mParameterTypes;\n  private final int mParamLength;\n  private final JavaModuleWrapper mModuleWrapper;\n  private String mType = BaseJavaModule.METHOD_TYPE_ASYNC;\n  private boolean mArgumentsProcessed = false;\n  private @Nullable ArgumentExtractor[] mArgumentExtractors;\n  private @Nullable String mSignature;\n  private @Nullable Object[] mArguments;\n  private @Nullable int mJSArgumentsNeeded;\n\n  public JavaMethodWrapper(JavaModuleWrapper module, Method method, boolean isSync) {\n    mModuleWrapper = module;\n    mMethod = method;\n    mMethod.setAccessible(true);\n    mParameterTypes = mMethod.getParameterTypes();\n    mParamLength = mParameterTypes.length;\n\n    if (isSync) {\n      mType = BaseJavaModule.METHOD_TYPE_SYNC;\n    } else if (mParamLength > 0 && (mParameterTypes[mParamLength - 1] == Promise.class)) {\n      mType = BaseJavaModule.METHOD_TYPE_PROMISE;\n    }\n  }\n\n  private void processArguments() {\n    if (mArgumentsProcessed) {\n      return;\n    }\n    SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"processArguments\")\n      .arg(\"method\", mModuleWrapper.getName() + \".\" + mMethod.getName())\n      .flush();\n    try {\n      mArgumentsProcessed = true;\n      mArgumentExtractors = buildArgumentExtractors(mParameterTypes);\n      mSignature = buildSignature(\n          mMethod,\n          mParameterTypes,\n          (mType.equals(BaseJavaModule.METHOD_TYPE_SYNC)));\n      // Since native methods are invoked from a message queue executed on a single thread, it is\n      // safe to allocate only one arguments object per method that can be reused across calls\n      mArguments = new Object[mParameterTypes.length];\n      mJSArgumentsNeeded = calculateJSArgumentsNeeded();\n    } finally {\n      SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();\n    }\n  }\n\n  public Method getMethod() {\n    return mMethod;\n  }\n\n  public String getSignature() {\n    if (!mArgumentsProcessed) {\n      processArguments();\n    }\n    return assertNotNull(mSignature);\n  }\n\n  private String buildSignature(Method method, Class[] paramTypes, boolean isSync) {\n    StringBuilder builder = new StringBuilder(paramTypes.length + 2);\n\n    if (isSync) {\n      builder.append(returnTypeToChar(method.getReturnType()));\n      builder.append('.');\n    } else {\n      builder.append(\"v.\");\n    }\n\n    for (int i = 0; i < paramTypes.length; i++) {\n      Class paramClass = paramTypes[i];\n      if (paramClass == Promise.class) {\n        Assertions.assertCondition(\n          i == paramTypes.length - 1, \"Promise must be used as last parameter only\");\n      }\n      builder.append(paramTypeToChar(paramClass));\n    }\n\n    return builder.toString();\n  }\n\n  private ArgumentExtractor[] buildArgumentExtractors(Class[] paramTypes) {\n    ArgumentExtractor[] argumentExtractors = new ArgumentExtractor[paramTypes.length];\n    for (int i = 0; i < paramTypes.length; i += argumentExtractors[i].getJSArgumentsNeeded()) {\n      Class argumentClass = paramTypes[i];\n      if (argumentClass == Boolean.class || argumentClass == boolean.class) {\n        argumentExtractors[i] = ARGUMENT_EXTRACTOR_BOOLEAN;\n      } else if (argumentClass == Integer.class || argumentClass == int.class) {\n        argumentExtractors[i] = ARGUMENT_EXTRACTOR_INTEGER;\n      } else if (argumentClass == Double.class || argumentClass == double.class) {\n        argumentExtractors[i] = ARGUMENT_EXTRACTOR_DOUBLE;\n      } else if (argumentClass == Float.class || argumentClass == float.class) {\n        argumentExtractors[i] = ARGUMENT_EXTRACTOR_FLOAT;\n      } else if (argumentClass == String.class) {\n        argumentExtractors[i] = ARGUMENT_EXTRACTOR_STRING;\n      } else if (argumentClass == Callback.class) {\n        argumentExtractors[i] = ARGUMENT_EXTRACTOR_CALLBACK;\n      } else if (argumentClass == Promise.class) {\n        argumentExtractors[i] = ARGUMENT_EXTRACTOR_PROMISE;\n        Assertions.assertCondition(\n          i == paramTypes.length - 1, \"Promise must be used as last parameter only\");\n      } else if (argumentClass == ReadableMap.class) {\n        argumentExtractors[i] = ARGUMENT_EXTRACTOR_MAP;\n      } else if (argumentClass == ReadableArray.class) {\n        argumentExtractors[i] = ARGUMENT_EXTRACTOR_ARRAY;\n      } else if (argumentClass == Dynamic.class) {\n        argumentExtractors[i] = ARGUMENT_EXTRACTOR_DYNAMIC;\n      } else {\n        throw new RuntimeException(\n          \"Got unknown argument class: \" + argumentClass.getSimpleName());\n      }\n    }\n    return argumentExtractors;\n  }\n\n  private int calculateJSArgumentsNeeded() {\n    int n = 0;\n    for (ArgumentExtractor extractor : assertNotNull(mArgumentExtractors)) {\n      n += extractor.getJSArgumentsNeeded();\n    }\n    return n;\n  }\n\n  private String getAffectedRange(int startIndex, int jsArgumentsNeeded) {\n    return jsArgumentsNeeded > 1 ?\n      \"\" + startIndex + \"-\" + (startIndex + jsArgumentsNeeded - 1) : \"\" + startIndex;\n  }\n\n  @Override\n  public void invoke(JSInstance jsInstance, ReadableNativeArray parameters) {\n    String traceName = mModuleWrapper.getName() + \".\" + mMethod.getName();\n    SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"callJavaModuleMethod\")\n      .arg(\"method\", traceName)\n      .flush();\n    if (DEBUG) {\n      PrinterHolder.getPrinter()\n          .logMessage(\n              ReactDebugOverlayTags.BRIDGE_CALLS,\n              \"JS->Java: %s.%s()\",\n              mModuleWrapper.getName(),\n              mMethod.getName());\n    }\n    try {\n      if (!mArgumentsProcessed) {\n        processArguments();\n      }\n      if (mArguments == null || mArgumentExtractors == null) {\n        throw new Error(\"processArguments failed\");\n      }\n      if (mJSArgumentsNeeded != parameters.size()) {\n        throw new NativeArgumentsParseException(\n          traceName + \" got \" + parameters.size() + \" arguments, expected \" + mJSArgumentsNeeded);\n      }\n\n      int i = 0, jsArgumentsConsumed = 0;\n      try {\n        for (; i < mArgumentExtractors.length; i++) {\n          mArguments[i] = mArgumentExtractors[i].extractArgument(\n            jsInstance, parameters, jsArgumentsConsumed);\n          jsArgumentsConsumed += mArgumentExtractors[i].getJSArgumentsNeeded();\n        }\n      } catch (UnexpectedNativeTypeException e) {\n        throw new NativeArgumentsParseException(\n          e.getMessage() + \" (constructing arguments for \" + traceName + \" at argument index \" +\n            getAffectedRange(jsArgumentsConsumed, mArgumentExtractors[i].getJSArgumentsNeeded()) +\n            \")\",\n          e);\n      }\n\n      try {\n        mMethod.invoke(mModuleWrapper.getModule(), mArguments);\n      } catch (IllegalArgumentException ie) {\n        throw new RuntimeException(\"Could not invoke \" + traceName, ie);\n      } catch (IllegalAccessException iae) {\n        throw new RuntimeException(\"Could not invoke \" + traceName, iae);\n      } catch (InvocationTargetException ite) {\n        // Exceptions thrown from native module calls end up wrapped in InvocationTargetException\n        // which just make traces harder to read and bump out useful information\n        if (ite.getCause() instanceof RuntimeException) {\n          throw (RuntimeException) ite.getCause();\n        }\n        throw new RuntimeException(\"Could not invoke \" + traceName, ite);\n      }\n    } finally {\n      SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();\n    }\n  }\n\n  /**\n   * Determines how the method is exported in JavaScript:\n   * METHOD_TYPE_ASYNC for regular methods\n   * METHOD_TYPE_PROMISE for methods that return a promise object to the caller.\n   * METHOD_TYPE_SYNC for sync methods\n   */\n  @Override\n  public String getType() {\n    return mType;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport javax.annotation.Nullable;\n\nimport java.lang.reflect.Method;\nimport java.util.ArrayList;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.systrace.Systrace;\nimport com.facebook.systrace.SystraceMessage;\n\nimport static com.facebook.react.bridge.ReactMarkerConstants.CONVERT_CONSTANTS_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.CONVERT_CONSTANTS_START;\nimport static com.facebook.react.bridge.ReactMarkerConstants.GET_CONSTANTS_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.GET_CONSTANTS_START;\nimport static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;\n\n/**\n * This is part of the glue which wraps a java BaseJavaModule in a C++\n * NativeModule.  This could all be in C++, but it's android-specific\n * initialization code, and writing it this way is easier to read and means\n * fewer JNI calls.\n */\n\n@DoNotStrip\npublic class JavaModuleWrapper {\n  @DoNotStrip\n  public class MethodDescriptor {\n    @DoNotStrip\n    Method method;\n    @DoNotStrip\n    String signature;\n    @DoNotStrip\n    String name;\n    @DoNotStrip\n    String type;\n  }\n\n  private final JSInstance mJSInstance;\n  private final ModuleHolder mModuleHolder;\n  private final Class<? extends NativeModule> mModuleClass;\n  private final ArrayList<NativeModule.NativeMethod> mMethods;\n  private final ArrayList<MethodDescriptor> mDescs;\n\n  public JavaModuleWrapper(JSInstance jsInstance, Class<? extends NativeModule> moduleClass, ModuleHolder moduleHolder) {\n    mJSInstance = jsInstance;\n    mModuleHolder = moduleHolder;\n    mModuleClass = moduleClass;\n    mMethods = new ArrayList<>();\n    mDescs = new ArrayList();\n  }\n\n  @DoNotStrip\n  public BaseJavaModule getModule() {\n    return (BaseJavaModule) mModuleHolder.getModule();\n  }\n\n  @DoNotStrip\n  public String getName() {\n    return mModuleHolder.getName();\n  }\n\n  @DoNotStrip\n  private void findMethods() {\n    Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"findMethods\");\n    Set<String> methodNames = new HashSet<>();\n\n    Class<? extends NativeModule> classForMethods = mModuleClass;\n    Class<? extends NativeModule> superClass =\n        (Class<? extends NativeModule>) mModuleClass.getSuperclass();\n    if (ReactModuleWithSpec.class.isAssignableFrom(superClass)) {\n      // For java module that is based on generated flow-type spec, inspect the\n      // spec abstract class instead, which is the super class of the given java\n      // module.\n      classForMethods = superClass;\n    }\n    Method[] targetMethods = classForMethods.getDeclaredMethods();\n\n    for (Method targetMethod : targetMethods) {\n      ReactMethod annotation = targetMethod.getAnnotation(ReactMethod.class);\n      if (annotation != null) {\n        String methodName = targetMethod.getName();\n        if (methodNames.contains(methodName)) {\n          // We do not support method overloading since js sees a function as an object regardless\n          // of number of params.\n          throw new IllegalArgumentException(\n            \"Java Module \" + getName() + \" method name already registered: \" + methodName);\n        }\n        MethodDescriptor md = new MethodDescriptor();\n        JavaMethodWrapper method = new JavaMethodWrapper(this, targetMethod, annotation.isBlockingSynchronousMethod());\n        md.name = methodName;\n        md.type = method.getType();\n        if (md.type == BaseJavaModule.METHOD_TYPE_SYNC) {\n          md.signature = method.getSignature();\n          md.method = targetMethod;\n        }\n        mMethods.add(method);\n        mDescs.add(md);\n      }\n    }\n    Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n  }\n\n  @DoNotStrip\n  public List<MethodDescriptor> getMethodDescriptors() {\n    if (mDescs.isEmpty()) {\n      findMethods();\n    }\n    return mDescs;\n  }\n\n  @DoNotStrip\n  public @Nullable NativeMap getConstants() {\n    if (!mModuleHolder.getHasConstants()) {\n      return null;\n    }\n\n    final String moduleName = getName();\n    SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"JavaModuleWrapper.getConstants\")\n      .arg(\"moduleName\", moduleName)\n      .flush();\n    ReactMarker.logMarker(GET_CONSTANTS_START, moduleName);\n\n    BaseJavaModule baseJavaModule = getModule();\n\n    Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"module.getConstants\");\n    Map<String, Object> map = baseJavaModule.getConstants();\n    Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n\n    Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"create WritableNativeMap\");\n    ReactMarker.logMarker(CONVERT_CONSTANTS_START, moduleName);\n    try {\n      return Arguments.makeNativeMap(map);\n    } finally {\n      ReactMarker.logMarker(CONVERT_CONSTANTS_END);\n      Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n\n      ReactMarker.logMarker(GET_CONSTANTS_END);\n      SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();\n    }\n  }\n\n  @DoNotStrip\n  public void invoke(int methodId, ReadableNativeArray parameters) {\n    if (mMethods == null || methodId >= mMethods.size()) {\n      return;\n    }\n\n    mMethods.get(methodId).invoke(mJSInstance, parameters);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JavaOnlyArray.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\n/**\n * Java {@link ArrayList} backed implementation of {@link ReadableArray} and {@link WritableArray}\n * Instances of this class SHOULD NOT be used for communication between java and JS, use instances\n * of {@link WritableNativeArray} created via {@link Arguments#createArray} or just\n * {@link ReadableArray} interface if you want your \"native\" module method to take an array from JS\n * as an argument.\n *\n * Main purpose for this class is to be used in java-only unit tests, but could also be used outside\n * of tests in the code that operates only in java and needs to communicate with RN modules via\n * their JS-exposed API.\n */\npublic class JavaOnlyArray implements ReadableArray, WritableArray {\n\n  private final List mBackingList;\n\n  public static JavaOnlyArray from(List list) {\n    return new JavaOnlyArray(list);\n  }\n\n  public static JavaOnlyArray of(Object... values) {\n    return new JavaOnlyArray(values);\n  }\n\n  private JavaOnlyArray(Object... values) {\n    mBackingList = Arrays.asList(values);\n  }\n\n  private JavaOnlyArray(List list) {\n    mBackingList = new ArrayList(list);\n  }\n\n  public JavaOnlyArray() {\n    mBackingList = new ArrayList();\n  }\n\n  @Override\n  public int size() {\n    return mBackingList.size();\n  }\n\n  @Override\n  public boolean isNull(int index) {\n    return mBackingList.get(index) == null;\n  }\n\n  @Override\n  public double getDouble(int index) {\n    return (Double) mBackingList.get(index);\n  }\n\n  @Override\n  public int getInt(int index) {\n    return (Integer) mBackingList.get(index);\n  }\n\n  @Override\n  public String getString(int index) {\n    return (String) mBackingList.get(index);\n  }\n\n  @Override\n  public JavaOnlyArray getArray(int index) {\n    return (JavaOnlyArray) mBackingList.get(index);\n  }\n\n  @Override\n  public boolean getBoolean(int index) {\n    return (Boolean) mBackingList.get(index);\n  }\n\n  @Override\n  public JavaOnlyMap getMap(int index) {\n    return (JavaOnlyMap) mBackingList.get(index);\n  }\n\n  @Override\n  public Dynamic getDynamic(int index) {\n    return DynamicFromArray.create(this, index);\n  }\n\n  @Override\n  public ReadableType getType(int index) {\n    Object object = mBackingList.get(index);\n\n    if (object == null) {\n      return ReadableType.Null;\n    } else if (object instanceof Boolean) {\n      return ReadableType.Boolean;\n    } else if (object instanceof Double ||\n        object instanceof Float ||\n        object instanceof Integer) {\n      return ReadableType.Number;\n    } else if (object instanceof String) {\n      return ReadableType.String;\n    } else if (object instanceof ReadableArray) {\n      return ReadableType.Array;\n    } else if (object instanceof ReadableMap) {\n      return ReadableType.Map;\n    }\n    return null;\n  }\n\n  @Override\n  public void pushBoolean(boolean value) {\n    mBackingList.add(value);\n  }\n\n  @Override\n  public void pushDouble(double value) {\n    mBackingList.add(value);\n  }\n\n  @Override\n  public void pushInt(int value) {\n    mBackingList.add(value);\n  }\n\n  @Override\n  public void pushString(String value) {\n    mBackingList.add(value);\n  }\n\n  @Override\n  public void pushArray(WritableArray array) {\n    mBackingList.add(array);\n  }\n\n  @Override\n  public void pushMap(WritableMap map) {\n    mBackingList.add(map);\n  }\n\n  @Override\n  public void pushNull() {\n    mBackingList.add(null);\n  }\n\n  @Override\n  public ArrayList<Object> toArrayList() {\n    return new ArrayList<Object>(mBackingList);\n  }\n\n  @Override\n  public String toString() {\n    return mBackingList.toString();\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    JavaOnlyArray that = (JavaOnlyArray) o;\n\n    if (mBackingList != null ? !mBackingList.equals(that.mBackingList) : that.mBackingList != null)\n      return false;\n\n    return true;\n  }\n\n  @Override\n  public int hashCode() {\n    return mBackingList != null ? mBackingList.hashCode() : 0;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JavaOnlyMap.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.Map;\n\n/**\n * Java {@link HashMap} backed implementation of {@link ReadableMap} and {@link WritableMap}\n * Instances of this class SHOULD NOT be used for communication between java and JS, use instances\n * of {@link WritableNativeMap} created via {@link Arguments#createMap} or just {@link ReadableMap}\n * interface if you want your \"native\" module method to take a map from JS as an argument.\n *\n * Main purpose for this class is to be used in java-only unit tests, but could also be used outside\n * of tests in the code that operates only in java and needs to communicate with RN modules via\n * their JS-exposed API.\n */\npublic class JavaOnlyMap implements ReadableMap, WritableMap {\n\n  private final Map mBackingMap;\n\n  public static JavaOnlyMap of(Object... keysAndValues) {\n    return new JavaOnlyMap(keysAndValues);\n  }\n\n  /**\n   * @param keysAndValues keys and values, interleaved\n   */\n  private JavaOnlyMap(Object... keysAndValues) {\n    if (keysAndValues.length % 2 != 0) {\n      throw new IllegalArgumentException(\"You must provide the same number of keys and values\");\n    }\n    mBackingMap = new HashMap();\n    for (int i = 0; i < keysAndValues.length; i += 2) {\n      mBackingMap.put(keysAndValues[i], keysAndValues[i + 1]);\n    }\n  }\n\n  public JavaOnlyMap() {\n    mBackingMap = new HashMap();\n  }\n\n  @Override\n  public boolean hasKey(String name) {\n    return mBackingMap.containsKey(name);\n  }\n\n  @Override\n  public boolean isNull(String name) {\n    return mBackingMap.get(name) == null;\n  }\n\n  @Override\n  public boolean getBoolean(String name) {\n    return (Boolean) mBackingMap.get(name);\n  }\n\n  @Override\n  public double getDouble(String name) {\n    return (Double) mBackingMap.get(name);\n  }\n\n  @Override\n  public int getInt(String name) {\n    return (Integer) mBackingMap.get(name);\n  }\n\n  @Override\n  public String getString(String name) {\n    return (String) mBackingMap.get(name);\n  }\n\n  @Override\n  public JavaOnlyMap getMap(String name) {\n    return (JavaOnlyMap) mBackingMap.get(name);\n  }\n\n  @Override\n  public JavaOnlyArray getArray(String name) {\n    return (JavaOnlyArray) mBackingMap.get(name);\n  }\n\n  @Override\n  public Dynamic getDynamic(String name) {\n    return DynamicFromMap.create(this, name);\n  }\n\n  @Override\n  public ReadableType getType(String name) {\n    Object value = mBackingMap.get(name);\n    if (value == null) {\n      return ReadableType.Null;\n    } else if (value instanceof Number) {\n      return ReadableType.Number;\n    } else if (value instanceof String) {\n      return ReadableType.String;\n    } else if (value instanceof Boolean) {\n      return ReadableType.Boolean;\n    } else if (value instanceof ReadableMap) {\n      return ReadableType.Map;\n    } else if (value instanceof ReadableArray) {\n      return ReadableType.Array;\n    } else if (value instanceof Dynamic) {\n      return ((Dynamic) value).getType();\n    } else {\n      throw new IllegalArgumentException(\"Invalid value \" + value.toString() + \" for key \" + name +\n        \"contained in JavaOnlyMap\");\n    }\n  }\n\n  @Override\n  public ReadableMapKeySetIterator keySetIterator() {\n    return new ReadableMapKeySetIterator() {\n      Iterator<String> mIterator = mBackingMap.keySet().iterator();\n\n      @Override\n      public boolean hasNextKey() {\n        return mIterator.hasNext();\n      }\n\n      @Override\n      public String nextKey() {\n        return mIterator.next();\n      }\n    };\n  }\n\n  @Override\n  public void putBoolean(String key, boolean value) {\n    mBackingMap.put(key, value);\n  }\n\n  @Override\n  public void putDouble(String key, double value) {\n    mBackingMap.put(key, value);\n  }\n\n  @Override\n  public void putInt(String key, int value) {\n    mBackingMap.put(key, value);\n  }\n\n  @Override\n  public void putString(String key, String value) {\n    mBackingMap.put(key, value);\n  }\n\n  @Override\n  public void putNull(String key) {\n    mBackingMap.put(key, null);\n  }\n\n  @Override\n  public void putMap(String key, WritableMap value) {\n    mBackingMap.put(key, value);\n  }\n\n  @Override\n  public void merge(ReadableMap source) {\n    mBackingMap.putAll(((JavaOnlyMap) source).mBackingMap);\n  }\n\n  @Override\n  public void putArray(String key, WritableArray value) {\n    mBackingMap.put(key, value);\n  }\n\n  @Override\n  public HashMap<String, Object> toHashMap() {\n    return new HashMap<String, Object>(mBackingMap);\n  }\n\n  @Override\n  public String toString() {\n    return mBackingMap.toString();\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    JavaOnlyMap that = (JavaOnlyMap) o;\n\n    if (mBackingMap != null ? !mBackingMap.equals(that.mBackingMap) : that.mBackingMap != null)\n      return false;\n\n    return true;\n  }\n\n  @Override\n  public int hashCode() {\n    return mBackingMap != null ? mBackingMap.hashCode() : 0;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptContextHolder.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\nimport javax.annotation.concurrent.GuardedBy;\n\n/**\n * Wrapper for JavaScriptContext native pointer. CatalystInstanceImpl creates this on demand, and\n * will call clear() before destroying the VM. People who need the raw JavaScriptContext pointer\n * can synchronize on this wrapper object to guarantee that it will not be destroyed.\n */\npublic class JavaScriptContextHolder {\n  @GuardedBy(\"this\")\n  private long mContext;\n\n  public JavaScriptContextHolder(long context) {\n    mContext = context;\n  }\n\n  @GuardedBy(\"this\")\n  public long get() {\n    return mContext;\n  }\n\n  public synchronized void clear() {\n    mContext = 0;\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptExecutor.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic abstract class JavaScriptExecutor {\n  private final HybridData mHybridData;\n\n  protected JavaScriptExecutor(HybridData hybridData) {\n    mHybridData = hybridData;\n  }\n\n  /**\n   * Close this executor and cleanup any resources that it was using. No further calls are\n   * expected after this.\n   * TODO mhorowitz: This may no longer be used; check and delete if possible.\n   */\n  public void close() {\n    mHybridData.resetNative();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptExecutorFactory.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\npublic interface JavaScriptExecutorFactory {\n  JavaScriptExecutor create() throws Exception;\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptModuleRegistry.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport javax.annotation.Nullable;\n\nimport java.lang.reflect.InvocationHandler;\nimport java.lang.reflect.Method;\nimport java.lang.reflect.Proxy;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.Set;\n\nimport com.facebook.react.common.build.ReactBuildConfig;\n\n/**\n * Class responsible for holding all the {@link JavaScriptModule}s.  Uses Java proxy objects\n * to dispatch method calls on JavaScriptModules to the bridge using the corresponding\n * module and method ids so the proper function is executed in JavaScript.\n */\npublic final class JavaScriptModuleRegistry {\n  private final HashMap<Class<? extends JavaScriptModule>, JavaScriptModule> mModuleInstances;\n\n  public JavaScriptModuleRegistry() {\n    mModuleInstances = new HashMap<>();\n  }\n\n  public synchronized <T extends JavaScriptModule> T getJavaScriptModule(\n      CatalystInstance instance,\n      Class<T> moduleInterface) {\n    JavaScriptModule module = mModuleInstances.get(moduleInterface);\n    if (module != null) {\n      return (T) module;\n    }\n\n    JavaScriptModule interfaceProxy = (JavaScriptModule) Proxy.newProxyInstance(\n        moduleInterface.getClassLoader(),\n        new Class[]{moduleInterface},\n        new JavaScriptModuleInvocationHandler(instance, moduleInterface));\n    mModuleInstances.put(moduleInterface, interfaceProxy);\n    return (T) interfaceProxy;\n  }\n\n  private static class JavaScriptModuleInvocationHandler implements InvocationHandler {\n    private final CatalystInstance mCatalystInstance;\n    private final Class<? extends JavaScriptModule> mModuleInterface;\n    private @Nullable String mName;\n\n    public JavaScriptModuleInvocationHandler(\n        CatalystInstance catalystInstance,\n        Class<? extends JavaScriptModule> moduleInterface) {\n      mCatalystInstance = catalystInstance;\n      mModuleInterface = moduleInterface;\n\n      if (ReactBuildConfig.DEBUG) {\n        Set<String> methodNames = new HashSet<>();\n        for (Method method : mModuleInterface.getDeclaredMethods()) {\n          if (!methodNames.add(method.getName())) {\n            throw new AssertionError(\n              \"Method overloading is unsupported: \" + mModuleInterface.getName() +\n                \"#\" + method.getName());\n          }\n        }\n      }\n    }\n\n    private String getJSModuleName() {\n      if (mName == null) {\n        // With proguard obfuscation turned on, proguard apparently (poorly) emulates inner\n        // classes or something because Class#getSimpleName() no longer strips the outer\n        // class name. We manually strip it here if necessary.\n        String name = mModuleInterface.getSimpleName();\n        int dollarSignIndex = name.lastIndexOf('$');\n        if (dollarSignIndex != -1) {\n          name = name.substring(dollarSignIndex + 1);\n        }\n\n        // getting the class name every call is expensive, so cache it\n        mName = name;\n      }\n      return mName;\n    }\n\n    @Override\n    public @Nullable Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable {\n      NativeArray jsArgs = args != null\n        ? Arguments.fromJavaArgs(args)\n        : new WritableNativeArray();\n      mCatalystInstance.callFunction(getJSModuleName(), method.getName(), jsArgs);\n      return null;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JsonWriter.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport java.io.Closeable;\nimport java.io.IOException;\nimport java.io.Writer;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\n\n/**\n * Simple Json generator that does no validation.\n */\npublic class JsonWriter implements Closeable {\n  private final Writer mWriter;\n  private final Deque<Scope> mScopes;\n\n  public JsonWriter(Writer writer) {\n    mWriter = writer;\n    mScopes = new ArrayDeque<>();\n  }\n\n  public JsonWriter beginArray() throws IOException {\n    open(Scope.EMPTY_ARRAY, '[');\n    return this;\n  }\n\n  public JsonWriter endArray() throws IOException {\n    close(']');\n    return this;\n  }\n\n  public JsonWriter beginObject() throws IOException {\n    open(Scope.EMPTY_OBJECT, '{');\n    return this;\n  }\n\n  public JsonWriter endObject() throws IOException {\n    close('}');\n    return this;\n  }\n\n  public JsonWriter name(String name) throws IOException {\n    if (name == null) {\n      throw new NullPointerException(\"name can not be null\");\n    }\n    beforeName();\n    string(name);\n    mWriter.write(':');\n    return this;\n  }\n\n  public JsonWriter value(String value) throws IOException {\n    if (value == null) {\n      return nullValue();\n    }\n    beforeValue();\n    string(value);\n    return this;\n  }\n\n  public JsonWriter nullValue() throws IOException {\n    beforeValue();\n    mWriter.write(\"null\");\n    return this;\n  }\n\n  public JsonWriter rawValue(String json) throws IOException {\n    beforeValue();\n    mWriter.write(json);\n    return this;\n  }\n\n  public JsonWriter value(boolean value) throws IOException {\n    beforeValue();\n    mWriter.write(value ? \"true\" : \"false\");\n    return this;\n  }\n\n  public JsonWriter value(double value) throws IOException {\n    beforeValue();\n    mWriter.append(Double.toString(value));\n    return this;\n  }\n\n  public JsonWriter value(long value) throws IOException {\n    beforeValue();\n    mWriter.write(Long.toString(value));\n    return this;\n  }\n\n  public JsonWriter value(Number value) throws IOException {\n    if (value == null) {\n      return nullValue();\n    }\n    beforeValue();\n    mWriter.append(value.toString());\n    return this;\n  }\n\n  @Override\n  public void close() throws IOException {\n    mWriter.close();\n  }\n\n  private void beforeValue() throws IOException {\n    Scope scope = mScopes.peek();\n    switch (scope) {\n      case EMPTY_ARRAY:\n        replace(Scope.ARRAY);\n        break;\n      case EMPTY_OBJECT:\n        throw new IllegalArgumentException(Scope.EMPTY_OBJECT.name());\n      case ARRAY:\n        mWriter.write(',');\n        break;\n      case OBJECT:\n        break;\n      default:\n        throw new IllegalStateException(\"Unknown scope: \" + scope);\n    }\n  }\n\n  private void beforeName() throws IOException {\n    Scope scope = mScopes.peek();\n    switch (scope) {\n      case EMPTY_ARRAY:\n      case ARRAY:\n        throw new IllegalStateException(\"name not allowed in array\");\n      case EMPTY_OBJECT:\n        replace(Scope.OBJECT);\n        break;\n      case OBJECT:\n        mWriter.write(',');\n        break;\n      default:\n        throw new IllegalStateException(\"Unknown scope: \" + scope);\n    }\n  }\n\n  private void open(Scope scope, char bracket) throws IOException {\n    mScopes.push(scope);\n    mWriter.write(bracket);\n  }\n\n  private void close(char bracket) throws IOException {\n    mScopes.pop();\n    mWriter.write(bracket);\n  }\n\n  private void string(String string) throws IOException {\n    mWriter.write('\"');\n    for (int i = 0, length = string.length(); i < length; i++) {\n      char c = string.charAt(i);\n      switch (c) {\n        case '\\t':\n          mWriter.write(\"\\\\t\");\n          break;\n\n        case '\\b':\n          mWriter.write(\"\\\\b\");\n          break;\n\n        case '\\n':\n          mWriter.write(\"\\\\n\");\n          break;\n\n        case '\\r':\n          mWriter.write(\"\\\\r\");\n          break;\n\n        case '\\f':\n          mWriter.write(\"\\\\f\");\n          break;\n\n        case '\"':\n        case '\\\\':\n          mWriter.write('\\\\');\n          mWriter.write(c);\n          break;\n\n        case '\\u2028':\n        case '\\u2029':\n          mWriter.write(String.format(\"\\\\u%04x\", (int) c));\n          break;\n\n        default:\n          if (c <= 0x1F) {\n            mWriter.write(String.format(\"\\\\u%04x\", (int) c));\n          } else {\n            mWriter.write(c);\n          }\n          break;\n      }\n\n    }\n    mWriter.write('\"');\n  }\n\n  private void replace(Scope scope) {\n    mScopes.pop();\n    mScopes.push(scope);\n  }\n\n  private enum Scope {\n    EMPTY_OBJECT,\n    OBJECT,\n    EMPTY_ARRAY,\n    ARRAY\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/JsonWriterHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport java.io.IOException;\nimport java.util.List;\nimport java.util.Map;\n\n/**\n * Helper for generating JSON for lists and maps.\n */\nclass JsonWriterHelper {\n  public static void value(JsonWriter writer, Object value) throws IOException {\n    if (value instanceof Map) {\n      mapValue(writer, (Map) value);\n    } else if (value instanceof List) {\n      listValue(writer, (List) value);\n    } else {\n      objectValue(writer, value);\n    }\n  }\n\n  private static void mapValue(JsonWriter writer, Map<?, ?> map) throws IOException {\n    writer.beginObject();\n    for (Map.Entry entry : map.entrySet()) {\n      writer.name(entry.getKey().toString());\n      value(writer, entry.getValue());\n    }\n    writer.endObject();\n  }\n\n  private static void listValue(JsonWriter writer, List<?> list) throws IOException {\n    writer.beginArray();\n    for (Object item : list) {\n      objectValue(writer, item);\n    }\n    writer.endArray();\n  }\n\n  private static void objectValue(JsonWriter writer, Object value) throws IOException {\n    if (value == null) {\n      writer.nullValue();\n    } else if (value instanceof String) {\n      writer.value((String) value);\n    } else if (value instanceof Number) {\n      writer.value((Number) value);\n    } else if (value instanceof Boolean) {\n      writer.value((Boolean) value);\n    } else {\n      throw new IllegalArgumentException(\"Unknown value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/LifecycleEventListener.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\n/**\n * Listener for receiving activity lifecycle events.\n *\n * When multiple activities share a react instance, only the most recent one's lifecycle events get\n * forwarded to listeners. Consider the following scenarios:\n *\n * 1. Navigating from Activity A to B will trigger two events: A#onHostPause and B#onHostResume. Any\n *    subsequent lifecycle events coming from Activity A, such as onHostDestroy, will be ignored.\n * 2. Navigating back from Activity B to Activity A will trigger the same events: B#onHostPause and\n *    A#onHostResume. Any subsequent events coming from Activity B, such as onHostDestroy, are\n *    ignored.\n * 3. Navigating back from Activity A to a non-React Activity or to the home screen will trigger two\n *    events: onHostPause and onHostDestroy.\n * 4. Navigating from Activity A to a non-React Activity B will trigger one event: onHostPause.\n *    Later, if Activity A is destroyed (e.g. because of resource contention), onHostDestroy is\n *    triggered.\n */\npublic interface LifecycleEventListener {\n\n  /**\n   * Called either when the host activity receives a resume event (e.g. {@link Activity#onResume} or\n   * if the native module that implements this is initialized while the host activity is already\n   * resumed. Always called for the most current activity.\n   */\n  void onHostResume();\n\n  /**\n   * Called when host activity receives pause event (e.g. {@link Activity#onPause}. Always called\n   * for the most current activity.\n   */\n  void onHostPause();\n\n  /**\n   * Called when host activity receives destroy event (e.g. {@link Activity#onDestroy}. Only called\n   * for the last React activity to be destroyed.\n   */\n  void onHostDestroy();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/MemoryPressure.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\npublic enum MemoryPressure {\n  UI_HIDDEN,\n  MODERATE,\n  CRITICAL\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/MemoryPressureListener.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\n/**\n * Listener interface for memory pressure events.\n */\npublic interface MemoryPressureListener {\n\n  /**\n   * Called when the system generates a memory warning.\n   */\n  void handleMemoryPressure(int level);\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\nimport static com.facebook.infer.annotation.Assertions.assertNotNull;\nimport static com.facebook.react.bridge.ReactMarkerConstants.CREATE_MODULE_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.CREATE_MODULE_START;\nimport static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;\n\nimport com.facebook.debug.holder.PrinterHolder;\nimport com.facebook.debug.tags.ReactDebugOverlayTags;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.react.module.model.ReactModuleInfo;\nimport com.facebook.systrace.SystraceMessage;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport javax.annotation.Nullable;\nimport javax.annotation.concurrent.GuardedBy;\nimport javax.inject.Provider;\n\n/**\n * Holder to enable us to lazy create native modules.\n *\n * This works by taking a provider instead of an instance, when it is first required we'll create\n * and initialize it. Initialization currently always happens on the UI thread but this is due to\n * change for performance reasons.\n *\n * Lifecycle events via a {@link LifecycleEventListener} will still always happen on the UI thread.\n */\n@DoNotStrip\npublic class ModuleHolder {\n\n  private static final AtomicInteger sInstanceKeyCounter = new AtomicInteger(1);\n\n  private final int mInstanceKey = sInstanceKeyCounter.getAndIncrement();\n\n  private final String mName;\n  private final boolean mCanOverrideExistingModule;\n  private final boolean mHasConstants;\n\n  private @Nullable Provider<? extends NativeModule> mProvider;\n  // Outside of the constructur, these should only be checked or set when synchronized on this\n  private @Nullable @GuardedBy(\"this\") NativeModule mModule;\n\n  // These are used to communicate phases of creation and initialization across threads\n  private @GuardedBy(\"this\") boolean mInitializable;\n  private @GuardedBy(\"this\") boolean mIsCreating;\n  private @GuardedBy(\"this\") boolean mIsInitializing;\n\n  public ModuleHolder(ReactModuleInfo moduleInfo, Provider<? extends NativeModule> provider) {\n    mName = moduleInfo.name();\n    mCanOverrideExistingModule = moduleInfo.canOverrideExistingModule();\n    mHasConstants = moduleInfo.hasConstants();\n    mProvider = provider;\n    if (moduleInfo.needsEagerInit()) {\n      mModule = create();\n    }\n  }\n\n  public ModuleHolder(NativeModule nativeModule) {\n    mName = nativeModule.getName();\n    mCanOverrideExistingModule = nativeModule.canOverrideExistingModule();\n    mHasConstants = true;\n    mModule = nativeModule;\n    PrinterHolder.getPrinter()\n        .logMessage(ReactDebugOverlayTags.NATIVE_MODULE, \"NativeModule init: %s\", mName);\n  }\n\n  /*\n  * Checks if mModule has been created, and if so tries to initialize the module unless another\n  * thread is already doing the initialization.\n  * If mModule has not been created, records that initialization is needed\n  */\n  /* package */ void markInitializable() {\n    boolean shouldInitializeNow = false;\n    NativeModule module = null;\n    synchronized (this) {\n      mInitializable = true;\n      if (mModule != null) {\n        Assertions.assertCondition(!mIsInitializing);\n        shouldInitializeNow = true;\n        module = mModule;\n      }\n    }\n    if (shouldInitializeNow) {\n      doInitialize(module);\n    }\n  }\n\n  /* pacakge */ synchronized boolean hasInstance() {\n    return mModule != null;\n  }\n\n  public synchronized void destroy() {\n    if (mModule != null) {\n      mModule.onCatalystInstanceDestroy();\n    }\n  }\n\n  @DoNotStrip\n  public String getName() {\n    return mName;\n  }\n\n  public boolean getCanOverrideExistingModule() {\n    return mCanOverrideExistingModule;\n  }\n\n  public boolean getHasConstants() {\n    return mHasConstants;\n  }\n\n  @DoNotStrip\n  public NativeModule getModule() {\n    NativeModule module;\n    boolean shouldCreate = false;\n    synchronized (this) {\n      if (mModule != null) {\n        return mModule;\n      // if mModule has not been set, and no one is creating it. Then this thread should call create\n      } else if (!mIsCreating) {\n        shouldCreate = true;\n        mIsCreating = true;\n      } else  {\n        // Wait for mModule to be created by another thread\n      }\n    }\n    if (shouldCreate) {\n      module = create();\n      // Once module is built (and initialized if markInitializable has been called), modify mModule\n      // And signal any waiting threads that it is acceptable to read the field now\n      synchronized (this) {\n        mIsCreating = false;\n        this.notifyAll();\n      }\n      return module;\n    } else {\n      synchronized (this) {\n        // Block waiting for another thread to build mModule instance\n        // Since mIsCreating is true until after creation and instantiation (if needed), we wait\n        // until the module is ready to use.\n        while (mModule == null && mIsCreating) {\n          try {\n            this.wait();\n          } catch (InterruptedException e) {\n            continue;\n          }\n        }\n        return Assertions.assertNotNull(mModule);\n      }\n    }\n  }\n\n  private NativeModule create() {\n    SoftAssertions.assertCondition(mModule == null, \"Creating an already created module.\");\n    ReactMarker.logMarker(CREATE_MODULE_START, mName, mInstanceKey);\n    SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"ModuleHolder.createModule\")\n      .arg(\"name\", mName)\n      .flush();\n    PrinterHolder.getPrinter()\n        .logMessage(ReactDebugOverlayTags.NATIVE_MODULE, \"NativeModule init: %s\", mName);\n    NativeModule module;\n    try {\n      module = assertNotNull(mProvider).get();\n      mProvider = null;\n      boolean shouldInitializeNow = false;\n      synchronized(this) {\n        mModule = module;\n        if (mInitializable && !mIsInitializing) {\n          shouldInitializeNow = true;\n        }\n      }\n      if (shouldInitializeNow) {\n        doInitialize(module);\n      }\n    } finally {\n      ReactMarker.logMarker(CREATE_MODULE_END, mInstanceKey);\n      SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();\n    }\n    return module;\n  }\n\n  private void doInitialize(NativeModule module) {\n    SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, \"ModuleHolder.initialize\")\n      .arg(\"name\", mName)\n      .flush();\n    ReactMarker.logMarker(ReactMarkerConstants.INITIALIZE_MODULE_START, mName, mInstanceKey);\n    try {\n      boolean shouldInitialize = false;\n      // Check to see if another thread is initializing the object, if not claim the responsibility\n      synchronized (this) {\n        if (mInitializable && !mIsInitializing) {\n          shouldInitialize = true;\n          mIsInitializing = true;\n        }\n      }\n      if (shouldInitialize) {\n        module.initialize();\n        // Once finished, set flags accordingly, but we don't expect anyone to wait for this to finish\n        // So no need to notify other threads\n        synchronized (this) {\n          mIsInitializing = false;\n        }\n      }\n    } finally {\n      ReactMarker.logMarker(ReactMarkerConstants.INITIALIZE_MODULE_END, mInstanceKey);\n      SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleSpec.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.react.common.build.ReactBuildConfig;\nimport java.lang.reflect.Constructor;\nimport javax.annotation.Nullable;\nimport javax.inject.Provider;\n\n/**\n * A specification for a native module. This exists so that we don't have to pay the cost\n * for creation until/if the module is used.\n *\n * If your module either has a default constructor or one taking ReactApplicationContext you can use\n * {@link #simple(Class)} or {@link #simple(Class, ReactApplicationContext)}} methods.\n */\npublic class ModuleSpec {\n  private static final Class[] EMPTY_SIGNATURE = {};\n  private static final Class[] CONTEXT_SIGNATURE = { ReactApplicationContext.class };\n\n  private final @Nullable Class<? extends NativeModule> mType;\n  private final Provider<? extends NativeModule> mProvider;\n\n  /**\n   * Simple spec for modules with a default constructor.\n   */\n  public static ModuleSpec simple(final Class<? extends NativeModule> type) {\n    return new ModuleSpec(type, new ConstructorProvider(type, EMPTY_SIGNATURE) {\n      @Override\n      public NativeModule get() {\n        try {\n          return getConstructor(type, EMPTY_SIGNATURE).newInstance();\n        } catch (Exception e) {\n          throw new RuntimeException(\"ModuleSpec with class: \" + type.getName(), e);\n        }\n      }\n    });\n  }\n\n  /**\n   * Simple spec for modules with a constructor taking ReactApplicationContext.\n   */\n  public static ModuleSpec simple(\n      final Class<? extends NativeModule> type,\n      final ReactApplicationContext context) {\n    return new ModuleSpec(type, new ConstructorProvider(type, CONTEXT_SIGNATURE) {\n      @Override\n      public NativeModule get() {\n        try {\n          return getConstructor(type, CONTEXT_SIGNATURE).newInstance(context);\n        } catch (Exception e) {\n          throw new RuntimeException(\"ModuleSpec with class: \" + type.getName(), e);\n        }\n      }\n    });\n  }\n\n  public static ModuleSpec viewManagerSpec(Provider<? extends NativeModule> provider) {\n    return new ModuleSpec(null, provider);\n  }\n\n  public static ModuleSpec nativeModuleSpec(\n      Class<? extends NativeModule> type, Provider<? extends NativeModule> provider) {\n    return new ModuleSpec(type, provider);\n  }\n\n  private ModuleSpec(\n      @Nullable Class<? extends NativeModule> type, Provider<? extends NativeModule> provider) {\n    mType = type;\n    mProvider = provider;\n  }\n\n  public @Nullable Class<? extends NativeModule> getType() {\n    return mType;\n  }\n\n  public Provider<? extends NativeModule> getProvider() {\n    return mProvider;\n  }\n\n  private static abstract class ConstructorProvider implements Provider<NativeModule> {\n    protected @Nullable Constructor<? extends NativeModule> mConstructor;\n\n    public ConstructorProvider(Class<? extends NativeModule> type, Class[] signature) {\n      if (ReactBuildConfig.DEBUG) {\n        try {\n          mConstructor = getConstructor(type, signature);\n        } catch (NoSuchMethodException e) {\n          throw new IllegalArgumentException(\"No such constructor\", e);\n        }\n      }\n    }\n\n    protected Constructor<? extends NativeModule> getConstructor(\n        Class<? extends NativeModule> mType,\n        Class[] signature) throws NoSuchMethodException {\n      if (mConstructor != null) {\n        return mConstructor;\n      } else {\n        return mType.getConstructor(signature);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/NativeArray.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * Base class for an array whose members are stored in native code (C++).\n */\n@DoNotStrip\npublic abstract class NativeArray {\n  static {\n    ReactBridge.staticInit();\n  }\n\n  protected NativeArray(HybridData hybridData) {\n    mHybridData = hybridData;\n  }\n\n  @Override\n  public native String toString();\n\n  @DoNotStrip\n  private HybridData mHybridData;\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/NativeMap.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * Base class for a Map whose keys and values are stored in native code (C++).\n */\n@DoNotStrip\npublic abstract class NativeMap {\n  static {\n    ReactBridge.staticInit();\n  }\n\n  public NativeMap(HybridData hybridData) {\n    mHybridData = hybridData;\n  }\n\n  @Override\n  public native String toString();\n\n  @DoNotStrip\n  private HybridData mHybridData;\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n\n/**\n * A native module whose API can be provided to JS catalyst instances.  {@link NativeModule}s whose\n * implementation is written in Java should extend {@link BaseJavaModule} or {@link\n * ReactContextBaseJavaModule}.  {@link NativeModule}s whose implementation is written in C++\n * must not provide any Java code (so they can be reused on other platforms), and instead should\n * register themselves using {@link CxxModuleWrapper}.\n */\n@DoNotStrip\npublic interface NativeModule {\n  interface NativeMethod {\n    void invoke(JSInstance jsInstance, ReadableNativeArray parameters);\n    String getType();\n  }\n\n  /**\n   * @return the name of this module. This will be the name used to {@code require()} this module\n   * from javascript.\n   */\n  String getName();\n\n  /**\n   * This is called at the end of {@link CatalystApplicationFragment#createCatalystInstance()}\n   * after the CatalystInstance has been created, in order to initialize NativeModules that require\n   * the CatalystInstance or JS modules.\n   */\n  void initialize();\n\n  /**\n   * Return true if you intend to override some other native module that was registered e.g. as part\n   * of a different package (such as the core one). Trying to override without returning true from\n   * this method is considered an error and will throw an exception during initialization. By\n   * default all modules return false.\n   */\n  boolean canOverrideExistingModule();\n\n  /**\n   * Called before {CatalystInstance#onHostDestroy}\n   */\n  void onCatalystInstanceDestroy();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.HashMap;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.systrace.Systrace;\n\n/**\n  * A set of Java APIs to expose to a particular JavaScript instance.\n  */\npublic class NativeModuleRegistry {\n\n  private final ReactApplicationContext mReactApplicationContext;\n  private final Map<Class<? extends NativeModule>, ModuleHolder> mModules;\n  private final ArrayList<ModuleHolder> mBatchCompleteListenerModules;\n\n  public NativeModuleRegistry(\n    ReactApplicationContext reactApplicationContext,\n    Map<Class<? extends NativeModule>, ModuleHolder> modules,\n    ArrayList<ModuleHolder> batchCompleteListenerModules) {\n    mReactApplicationContext = reactApplicationContext;\n    mModules = modules;\n    mBatchCompleteListenerModules = batchCompleteListenerModules;\n  }\n\n  /**\n   * Private getters for combining NativeModuleRegistrys\n   */\n  private Map<Class<? extends NativeModule>, ModuleHolder> getModuleMap() {\n    return mModules;\n  }\n\n  private ReactApplicationContext getReactApplicationContext() {\n    return mReactApplicationContext;\n  }\n\n  private ArrayList<ModuleHolder> getBatchCompleteListenerModules() {\n    return mBatchCompleteListenerModules;\n  }\n\n  /* package */ Collection<JavaModuleWrapper> getJavaModules(\n      JSInstance jsInstance) {\n    ArrayList<JavaModuleWrapper> javaModules = new ArrayList<>();\n    for (Map.Entry<Class<? extends NativeModule>, ModuleHolder> entry : mModules.entrySet()) {\n      Class<? extends NativeModule> type = entry.getKey();\n      if (!CxxModuleWrapperBase.class.isAssignableFrom(type)) {\n        javaModules.add(new JavaModuleWrapper(jsInstance, type, entry.getValue()));\n      }\n    }\n    return javaModules;\n  }\n\n  /* package */ Collection<ModuleHolder> getCxxModules() {\n    ArrayList<ModuleHolder> cxxModules = new ArrayList<>();\n    for (Map.Entry<Class<? extends NativeModule>, ModuleHolder> entry : mModules.entrySet()) {\n      Class<?> type = entry.getKey();\n      if (CxxModuleWrapperBase.class.isAssignableFrom(type)) {\n        cxxModules.add(entry.getValue());\n      }\n    }\n    return cxxModules;\n  }\n\n  /*\n  * Adds any new modules to the current module registry\n  */\n  /* package */ void registerModules(NativeModuleRegistry newRegister) {\n\n    Assertions.assertCondition(mReactApplicationContext.equals(newRegister.getReactApplicationContext()),\n      \"Extending native modules with non-matching application contexts.\");\n\n    Map<Class<? extends NativeModule>, ModuleHolder> newModules = newRegister.getModuleMap();\n    ArrayList<ModuleHolder> batchCompleteListeners = newRegister.getBatchCompleteListenerModules();\n\n    for (Map.Entry<Class<? extends NativeModule>, ModuleHolder> entry : newModules.entrySet()) {\n      Class<? extends NativeModule> key = entry.getKey();\n      if (!mModules.containsKey(key)) {\n        ModuleHolder value = entry.getValue();\n        if (batchCompleteListeners.contains(value)) {\n          mBatchCompleteListenerModules.add(value);\n        }\n        mModules.put(key, value);\n      }\n    }\n  }\n\n  /* package */ void notifyJSInstanceDestroy() {\n    mReactApplicationContext.assertOnNativeModulesQueueThread();\n    Systrace.beginSection(\n        Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n        \"NativeModuleRegistry_notifyJSInstanceDestroy\");\n    try {\n      for (ModuleHolder module : mModules.values()) {\n        module.destroy();\n      }\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n    }\n  }\n\n  /* package */ void notifyJSInstanceInitialized() {\n    mReactApplicationContext.assertOnNativeModulesQueueThread(\"From version React Native v0.44, \" +\n      \"native modules are explicitly not initialized on the UI thread. See \" +\n      \"https://github.com/facebook/react-native/wiki/Breaking-Changes#d4611211-reactnativeandroidbreaking-move-nativemodule-initialization-off-ui-thread---aaachiuuu \" +\n      \" for more details.\");\n    ReactMarker.logMarker(ReactMarkerConstants.NATIVE_MODULE_INITIALIZE_START);\n    Systrace.beginSection(\n        Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n        \"NativeModuleRegistry_notifyJSInstanceInitialized\");\n    try {\n      for (ModuleHolder module : mModules.values()) {\n        module.markInitializable();\n      }\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n      ReactMarker.logMarker(ReactMarkerConstants.NATIVE_MODULE_INITIALIZE_END);\n    }\n  }\n\n  public void onBatchComplete() {\n    for (ModuleHolder moduleHolder : mBatchCompleteListenerModules) {\n      if (moduleHolder.hasInstance()) {\n        ((OnBatchCompleteListener) moduleHolder.getModule()).onBatchComplete();\n      }\n    }\n  }\n\n  public <T extends NativeModule> boolean hasModule(Class<T> moduleInterface) {\n    return mModules.containsKey(moduleInterface);\n  }\n\n  public <T extends NativeModule> T getModule(Class<T> moduleInterface) {\n    return (T) Assertions.assertNotNull(mModules.get(moduleInterface)).getModule();\n  }\n\n  public List<NativeModule> getAllModules() {\n    List<NativeModule> modules = new ArrayList<>();\n    for (ModuleHolder module : mModules.values()) {\n      modules.add(module.getModule());\n    }\n    return modules;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/PerformanceCounter.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\npackage com.facebook.react.bridge;\n\nimport java.util.Map;\n\npublic interface PerformanceCounter {\n  public Map<String, Long> getPerformanceCounters();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/Promise.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport javax.annotation.Nullable;\n\n/**\n * Interface that represents a JavaScript Promise which can be passed to the native module as a\n * method parameter.\n *\n * Methods annotated with {@link ReactMethod} that use {@link Promise} as type of the last parameter\n * will be marked as \"promise\" and will return a promise when invoked from JavaScript.\n */\npublic interface Promise {\n\n  /**\n   * Successfully resolve the Promise.\n   */\n  void resolve(@Nullable Object value);\n\n  /**\n   * Report an error which wasn't caused by an exception.\n   */\n  void reject(String code, String message);\n\n  /**\n   * Report an exception.\n   */\n  void reject(String code, Throwable e);\n\n  /**\n   * Report an exception with a custom error message.\n   */\n  void reject(String code, String message, Throwable e);\n\n  /**\n   * Report an error which wasn't caused by an exception.\n   * @deprecated Prefer passing a module-specific error code to JS.\n   *             Using this method will pass the error code \"EUNSPECIFIED\".\n   */\n  @Deprecated\n  void reject(String message);\n\n  /**\n   * Report an exception, with default error code.\n   * Useful in catch-all scenarios where it's unclear why the error occurred.\n   */\n  void reject(Throwable reason);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ProxyJavaScriptExecutor.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport javax.annotation.Nullable;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * JavaScript executor that delegates JS calls processed by native code back to a java version\n * of the native executor interface.\n *\n * When set as a executor with {@link CatalystInstance.Builder}, catalyst native code will delegate\n * low level javascript calls to the implementation of {@link JavaJSExecutor} interface provided\n * with the constructor of this class.\n */\n@DoNotStrip\npublic class ProxyJavaScriptExecutor extends JavaScriptExecutor {\n  public static class Factory implements JavaScriptExecutorFactory {\n    private final JavaJSExecutor.Factory mJavaJSExecutorFactory;\n\n    public Factory(JavaJSExecutor.Factory javaJSExecutorFactory) {\n      mJavaJSExecutorFactory = javaJSExecutorFactory;\n    }\n\n    @Override\n    public JavaScriptExecutor create() throws Exception {\n      return new ProxyJavaScriptExecutor(mJavaJSExecutorFactory.create());\n    }\n  }\n\n  static {\n    ReactBridge.staticInit();\n  }\n\n  private @Nullable JavaJSExecutor mJavaJSExecutor;\n\n  /**\n   * Create {@link ProxyJavaScriptExecutor} instance\n   * @param executor implementation of {@link JavaJSExecutor} which will be responsible for handling\n   * javascript calls\n   */\n  public ProxyJavaScriptExecutor(JavaJSExecutor executor) {\n    super(initHybrid(executor));\n    mJavaJSExecutor = executor;\n  }\n\n  @Override\n  public void close() {\n    if (mJavaJSExecutor != null) {\n      mJavaJSExecutor.close();\n      mJavaJSExecutor = null;\n    }\n  }\n\n  private native static HybridData initHybrid(JavaJSExecutor executor);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.soloader.SoLoader;\n\npublic class ReactBridge {\n  private static boolean sDidInit = false;\n  public static void staticInit() {\n    // No locking required here, worst case we'll call into SoLoader twice\n    // which will do its own locking internally\n    if (!sDidInit) {\n      SoLoader.loadLibrary(\"reactnativejni\");\n      sDidInit = true;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ReactCallback.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\n/* package */ interface ReactCallback {\n  @DoNotStrip\n  void onBatchComplete();\n\n  @DoNotStrip\n  void incrementPendingJSCalls();\n\n  @DoNotStrip\n  void decrementPendingJSCalls();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.ContextWrapper;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.queue.MessageQueueThread;\nimport com.facebook.react.bridge.queue.ReactQueueConfiguration;\nimport com.facebook.react.common.LifecycleState;\nimport java.lang.ref.WeakReference;\nimport java.util.concurrent.CopyOnWriteArraySet;\nimport javax.annotation.Nullable;\n\n/**\n * Abstract ContextWrapper for Android application or activity {@link Context} and\n * {@link CatalystInstance}\n */\npublic class ReactContext extends ContextWrapper {\n\n  private static final String EARLY_JS_ACCESS_EXCEPTION_MESSAGE =\n    \"Tried to access a JS module before the React instance was fully set up. Calls to \" +\n      \"ReactContext#getJSModule should only happen once initialize() has been called on your \" +\n      \"native module.\";\n\n  private final CopyOnWriteArraySet<LifecycleEventListener> mLifecycleEventListeners =\n      new CopyOnWriteArraySet<>();\n  private final CopyOnWriteArraySet<ActivityEventListener> mActivityEventListeners =\n      new CopyOnWriteArraySet<>();\n\n  private LifecycleState mLifecycleState = LifecycleState.BEFORE_CREATE;\n\n  private @Nullable CatalystInstance mCatalystInstance;\n  private @Nullable LayoutInflater mInflater;\n  private @Nullable MessageQueueThread mUiMessageQueueThread;\n  private @Nullable MessageQueueThread mNativeModulesMessageQueueThread;\n  private @Nullable MessageQueueThread mJSMessageQueueThread;\n  private @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler;\n  private @Nullable WeakReference<Activity> mCurrentActivity;\n\n  public ReactContext(Context base) {\n    super(base);\n  }\n\n  /**\n   * Set and initialize CatalystInstance for this Context. This should be called exactly once.\n   */\n  public void initializeWithInstance(CatalystInstance catalystInstance) {\n    if (catalystInstance == null) {\n      throw new IllegalArgumentException(\"CatalystInstance cannot be null.\");\n    }\n    if (mCatalystInstance != null) {\n      throw new IllegalStateException(\"ReactContext has been already initialized\");\n    }\n\n    mCatalystInstance = catalystInstance;\n\n    ReactQueueConfiguration queueConfig = catalystInstance.getReactQueueConfiguration();\n    mUiMessageQueueThread = queueConfig.getUIQueueThread();\n    mNativeModulesMessageQueueThread = queueConfig.getNativeModulesQueueThread();\n    mJSMessageQueueThread = queueConfig.getJSQueueThread();\n  }\n\n  public void setNativeModuleCallExceptionHandler(\n      @Nullable NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) {\n    mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;\n  }\n\n  // We override the following method so that views inflated with the inflater obtained from this\n  // context return the ReactContext in #getContext(). The default implementation uses the base\n  // context instead, so it couldn't be cast to ReactContext.\n  // TODO: T7538796 Check requirement for Override of getSystemService ReactContext\n  @Override\n  public Object getSystemService(String name) {\n    if (LAYOUT_INFLATER_SERVICE.equals(name)) {\n      if (mInflater == null) {\n        mInflater = LayoutInflater.from(getBaseContext()).cloneInContext(this);\n      }\n      return mInflater;\n    }\n    return getBaseContext().getSystemService(name);\n  }\n\n  /**\n   * @return handle to the specified JS module for the CatalystInstance associated with this Context\n   */\n  public <T extends JavaScriptModule> T getJSModule(Class<T> jsInterface) {\n    if (mCatalystInstance == null) {\n      throw new RuntimeException(EARLY_JS_ACCESS_EXCEPTION_MESSAGE);\n    }\n    return mCatalystInstance.getJSModule(jsInterface);\n  }\n\n  public <T extends NativeModule> boolean hasNativeModule(Class<T> nativeModuleInterface) {\n    if (mCatalystInstance == null) {\n      throw new RuntimeException(\n        \"Trying to call native module before CatalystInstance has been set!\");\n    }\n    return mCatalystInstance.hasNativeModule(nativeModuleInterface);\n  }\n\n  /**\n   * @return the instance of the specified module interface associated with this ReactContext.\n   */\n  public <T extends NativeModule> T getNativeModule(Class<T> nativeModuleInterface) {\n    if (mCatalystInstance == null) {\n      throw new RuntimeException(\n        \"Trying to call native module before CatalystInstance has been set!\");\n    }\n    return mCatalystInstance.getNativeModule(nativeModuleInterface);\n  }\n\n  public CatalystInstance getCatalystInstance() {\n    return Assertions.assertNotNull(mCatalystInstance);\n  }\n\n  public boolean hasActiveCatalystInstance() {\n    return mCatalystInstance != null && !mCatalystInstance.isDestroyed();\n  }\n\n  public LifecycleState getLifecycleState() {\n    return mLifecycleState;\n  }\n\n  public void addLifecycleEventListener(final LifecycleEventListener listener) {\n    mLifecycleEventListeners.add(listener);\n    if (hasActiveCatalystInstance()) {\n      switch (mLifecycleState) {\n        case BEFORE_CREATE:\n        case BEFORE_RESUME:\n          break;\n        case RESUMED:\n          runOnUiQueueThread(\n              new Runnable() {\n                @Override\n                public void run() {\n                  if (!mLifecycleEventListeners.contains(listener)) {\n                    return;\n                  }\n                  try {\n                    listener.onHostResume();\n                  } catch (RuntimeException e) {\n                    handleException(e);\n                  }\n                }\n              });\n          break;\n        default:\n          throw new RuntimeException(\"Unhandled lifecycle state.\");\n      }\n    }\n  }\n\n  public void removeLifecycleEventListener(LifecycleEventListener listener) {\n    mLifecycleEventListeners.remove(listener);\n  }\n\n  public void addActivityEventListener(ActivityEventListener listener) {\n    mActivityEventListeners.add(listener);\n  }\n\n  public void removeActivityEventListener(ActivityEventListener listener) {\n    mActivityEventListeners.remove(listener);\n  }\n\n  /**\n   * Should be called by the hosting Fragment in {@link Fragment#onResume}\n   */\n  public void onHostResume(@Nullable Activity activity) {\n    mLifecycleState = LifecycleState.RESUMED;\n    mCurrentActivity = new WeakReference(activity);\n    ReactMarker.logMarker(ReactMarkerConstants.ON_HOST_RESUME_START);\n    for (LifecycleEventListener listener : mLifecycleEventListeners) {\n      try {\n        listener.onHostResume();\n      } catch (RuntimeException e) {\n        handleException(e);\n      }\n    }\n    ReactMarker.logMarker(ReactMarkerConstants.ON_HOST_RESUME_END);\n  }\n\n  public void onNewIntent(@Nullable Activity activity, Intent intent) {\n    UiThreadUtil.assertOnUiThread();\n    mCurrentActivity = new WeakReference(activity);\n    for (ActivityEventListener listener : mActivityEventListeners) {\n      try {\n        listener.onNewIntent(intent);\n      } catch (RuntimeException e) {\n        handleException(e);\n      }\n    }\n  }\n\n  /**\n   * Should be called by the hosting Fragment in {@link Fragment#onPause}\n   */\n  public void onHostPause() {\n    mLifecycleState = LifecycleState.BEFORE_RESUME;\n    ReactMarker.logMarker(ReactMarkerConstants.ON_HOST_PAUSE_START);\n    for (LifecycleEventListener listener : mLifecycleEventListeners) {\n      try {\n        listener.onHostPause();\n      } catch (RuntimeException e) {\n        handleException(e);\n      }\n    }\n    ReactMarker.logMarker(ReactMarkerConstants.ON_HOST_PAUSE_END);\n  }\n\n  /**\n   * Should be called by the hosting Fragment in {@link Fragment#onDestroy}\n   */\n  public void onHostDestroy() {\n    UiThreadUtil.assertOnUiThread();\n    mLifecycleState = LifecycleState.BEFORE_CREATE;\n    for (LifecycleEventListener listener : mLifecycleEventListeners) {\n      try {\n        listener.onHostDestroy();\n      } catch (RuntimeException e) {\n        handleException(e);\n      }\n    }\n    mCurrentActivity = null;\n  }\n\n  /**\n   * Destroy this instance, making it unusable.\n   */\n  public void destroy() {\n    UiThreadUtil.assertOnUiThread();\n\n    if (mCatalystInstance != null) {\n      mCatalystInstance.destroy();\n    }\n  }\n\n  /**\n   * Should be called by the hosting Fragment in {@link Fragment#onActivityResult}\n   */\n  public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {\n    for (ActivityEventListener listener : mActivityEventListeners) {\n      try {\n        listener.onActivityResult(activity, requestCode, resultCode, data);\n      } catch (RuntimeException e) {\n        handleException(e);\n      }\n    }\n  }\n\n  public void assertOnUiQueueThread() {\n    Assertions.assertNotNull(mUiMessageQueueThread).assertIsOnThread();\n  }\n\n  public boolean isOnUiQueueThread() {\n    return Assertions.assertNotNull(mUiMessageQueueThread).isOnThread();\n  }\n\n  public void runOnUiQueueThread(Runnable runnable) {\n    Assertions.assertNotNull(mUiMessageQueueThread).runOnQueue(runnable);\n  }\n\n  public void assertOnNativeModulesQueueThread() {\n    Assertions.assertNotNull(mNativeModulesMessageQueueThread).assertIsOnThread();\n  }\n\n  public void assertOnNativeModulesQueueThread(String message) {\n    Assertions.assertNotNull(mNativeModulesMessageQueueThread).assertIsOnThread(message);\n  }\n\n  public boolean isOnNativeModulesQueueThread() {\n    return Assertions.assertNotNull(mNativeModulesMessageQueueThread).isOnThread();\n  }\n\n  public void runOnNativeModulesQueueThread(Runnable runnable) {\n    Assertions.assertNotNull(mNativeModulesMessageQueueThread).runOnQueue(runnable);\n  }\n\n  public void assertOnJSQueueThread() {\n    Assertions.assertNotNull(mJSMessageQueueThread).assertIsOnThread();\n  }\n\n  public boolean isOnJSQueueThread() {\n    return Assertions.assertNotNull(mJSMessageQueueThread).isOnThread();\n  }\n\n  public void runOnJSQueueThread(Runnable runnable) {\n    Assertions.assertNotNull(mJSMessageQueueThread).runOnQueue(runnable);\n  }\n\n  /**\n   * Passes the given exception to the current\n   * {@link com.facebook.react.bridge.NativeModuleCallExceptionHandler} if one exists, rethrowing\n   * otherwise.\n   */\n  public void handleException(RuntimeException e) {\n    if (mCatalystInstance != null &&\n        !mCatalystInstance.isDestroyed() &&\n        mNativeModuleCallExceptionHandler != null) {\n      mNativeModuleCallExceptionHandler.handleException(e);\n    } else {\n      throw e;\n    }\n  }\n\n  public boolean hasCurrentActivity() {\n    return mCurrentActivity != null && mCurrentActivity.get() != null;\n  }\n\n  /**\n   * Same as {@link Activity#startActivityForResult(Intent, int)}, this just redirects the call to\n   * the current activity. Returns whether the activity was started, as this might fail if this\n   * was called before the context is in the right state.\n   */\n  public boolean startActivityForResult(Intent intent, int code, Bundle bundle) {\n    Activity activity = getCurrentActivity();\n    Assertions.assertNotNull(activity);\n    activity.startActivityForResult(intent, code, bundle);\n    return true;\n  }\n\n  /**\n   * Get the activity to which this context is currently attached, or {@code null} if not attached.\n   * DO NOT HOLD LONG-LIVED REFERENCES TO THE OBJECT RETURNED BY THIS METHOD, AS THIS WILL CAUSE\n   * MEMORY LEAKS.\n   */\n  public @Nullable Activity getCurrentActivity() {\n    if (mCurrentActivity == null) {\n      return null;\n    }\n    return mCurrentActivity.get();\n  }\n\n  /**\n   * Get the C pointer (as a long) to the JavaScriptCore context associated with this instance. Use\n   * the following pattern to ensure that the JS context is not cleared while you are using it:\n   * JavaScriptContextHolder jsContext = reactContext.getJavaScriptContextHolder()\n   * synchronized(jsContext) { nativeThingNeedingJsContext(jsContext.get()); }\n   */\n  public JavaScriptContextHolder getJavaScriptContextHolder() {\n    return mCatalystInstance.getJavaScriptContextHolder();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\nimport java.util.List;\nimport java.util.ArrayList;\n\nimport javax.annotation.Nullable;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * Static class that allows markers to be placed in React code and responded to in a\n * configurable way\n */\n@DoNotStrip\npublic class ReactMarker {\n\n  public interface MarkerListener {\n    void logMarker(ReactMarkerConstants name, @Nullable String tag, int instanceKey);\n  };\n\n  // Use a list instead of a set here because we expect the number of listeners\n  // to be very small, and we want listeners to be called in a deterministic\n  // order.\n  private static final List<MarkerListener> sListeners = new ArrayList<>();\n\n  @DoNotStrip\n  public static void addListener(MarkerListener listener) {\n    synchronized(sListeners) {\n      if (!sListeners.contains(listener)) {\n        sListeners.add(listener);\n      }\n    }\n  }\n\n  @DoNotStrip\n  public static void removeListener(MarkerListener listener) {\n    synchronized(sListeners) {\n      sListeners.remove(listener);\n    }\n  }\n\n  @DoNotStrip\n  public static void clearMarkerListeners() {\n    synchronized(sListeners) {\n      sListeners.clear();\n    }\n  }\n\n  @DoNotStrip\n  public static void logMarker(String name) {\n    logMarker(name, null);\n  }\n\n  @DoNotStrip\n  public static void logMarker(String name, int instanceKey) {\n    logMarker(name, null, instanceKey);\n  }\n\n  @DoNotStrip\n  public static void logMarker(String name, @Nullable String tag) {\n    logMarker(name, tag, 0);\n  }\n\n  @DoNotStrip\n  public static void logMarker(String name, @Nullable String tag, int instanceKey) {\n    ReactMarkerConstants marker = ReactMarkerConstants.valueOf(name);\n    logMarker(marker, tag, instanceKey);\n  }\n\n  @DoNotStrip\n  public static void logMarker(ReactMarkerConstants name) {\n    logMarker(name, null, 0);\n  }\n\n  @DoNotStrip\n  public static void logMarker(ReactMarkerConstants name, int instanceKey) {\n    logMarker(name, null, instanceKey);\n  }\n\n  @DoNotStrip\n  public static void logMarker(ReactMarkerConstants name, @Nullable String tag) {\n    logMarker(name, tag, 0);\n  }\n\n  @DoNotStrip\n  public static void logMarker(ReactMarkerConstants name, @Nullable String tag, int instanceKey) {\n    synchronized(sListeners) {\n      for (MarkerListener listener : sListeners) {\n        listener.logMarker(name, tag, instanceKey);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.bridge;\n\n/**\n * Constants used by ReactMarker.\n */\npublic enum ReactMarkerConstants {\n  CREATE_REACT_CONTEXT_START,\n  CREATE_REACT_CONTEXT_END,\n  PROCESS_PACKAGES_START,\n  PROCESS_PACKAGES_END,\n  BUILD_NATIVE_MODULE_REGISTRY_START,\n  BUILD_NATIVE_MODULE_REGISTRY_END,\n  CREATE_CATALYST_INSTANCE_START,\n  CREATE_CATALYST_INSTANCE_END,\n  DESTROY_CATALYST_INSTANCE_START,\n  DESTROY_CATALYST_INSTANCE_END,\n  RUN_JS_BUNDLE_START,\n  RUN_JS_BUNDLE_END,\n  NATIVE_MODULE_INITIALIZE_START,\n  NATIVE_MODULE_INITIALIZE_END,\n  SETUP_REACT_CONTEXT_START,\n  SETUP_REACT_CONTEXT_END,\n  CREATE_UI_MANAGER_MODULE_START,\n  CREATE_UI_MANAGER_MODULE_END,\n  CREATE_VIEW_MANAGERS_START,\n  CREATE_VIEW_MANAGERS_END,\n  CREATE_UI_MANAGER_MODULE_CONSTANTS_START,\n  CREATE_UI_MANAGER_MODULE_CONSTANTS_END,\n  NATIVE_MODULE_SETUP_START,\n  NATIVE_MODULE_SETUP_END,\n  CREATE_MODULE_START,\n  CREATE_MODULE_END,\n  PROCESS_CORE_REACT_PACKAGE_START,\n  PROCESS_CORE_REACT_PACKAGE_END,\n  CREATE_I18N_MODULE_CONSTANTS_START,\n  CREATE_I18N_MODULE_CONSTANTS_END,\n  I18N_MODULE_CONSTANTS_CONVERT_START,\n  I18N_MODULE_CONSTANTS_CONVERT_END,\n  CREATE_I18N_ASSETS_MODULE_START,\n  CREATE_I18N_ASSETS_MODULE_END,\n  GET_CONSTANTS_START,\n  GET_CONSTANTS_END,\n  INITIALIZE_MODULE_START,\n  INITIALIZE_MODULE_END,\n  ON_HOST_RESUME_START,\n  ON_HOST_RESUME_END,\n  ON_HOST_PAUSE_START,\n  ON_HOST_PAUSE_END,\n  CONVERT_CONSTANTS_START,\n  CONVERT_CONSTANTS_END,\n  PRE_REACT_CONTEXT_END,\n  UNPACKING_JS_BUNDLE_LOADER_CHECK_START,\n  UNPACKING_JS_BUNDLE_LOADER_CHECK_END,\n  UNPACKING_JS_BUNDLE_LOADER_EXTRACTED,\n  UNPACKING_JS_BUNDLE_LOADER_BLOCKED,\n  loadApplicationScript_startStringConvert,\n  loadApplicationScript_endStringConvert,\n  PRE_SETUP_REACT_CONTEXT_START,\n  PRE_SETUP_REACT_CONTEXT_END,\n  PRE_RUN_JS_BUNDLE_START,\n  ATTACH_MEASURED_ROOT_VIEWS_START,\n  ATTACH_MEASURED_ROOT_VIEWS_END,\n  CONTENT_APPEARED,\n  RELOAD,\n  DOWNLOAD_START,\n  DOWNLOAD_END,\n  REACT_CONTEXT_THREAD_START,\n  REACT_CONTEXT_THREAD_END,\n  GET_REACT_INSTANCE_MANAGER_START,\n  GET_REACT_INSTANCE_MANAGER_END,\n  GET_REACT_INSTANCE_HOLDER_SPEC_START,\n  GET_REACT_INSTANCE_HOLDER_SPEC_END,\n  BUILD_REACT_INSTANCE_MANAGER_START,\n  BUILD_REACT_INSTANCE_MANAGER_END,\n  PROCESS_INFRA_PACKAGE_START,\n  PROCESS_INFRA_PACKAGE_END,\n  PROCESS_PRODUCT_PACKAGE_START,\n  PROCESS_PRODUCT_PACKAGE_END,\n  CREATE_MC_MODULE_START,\n  CREATE_MC_MODULE_END,\n  CREATE_MC_MODULE_GET_METADATA_START,\n  CREATE_MC_MODULE_GET_METADATA_END,\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMethod.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport java.lang.annotation.Retention;\n\nimport static java.lang.annotation.RetentionPolicy.RUNTIME;\n\n/**\n * Annotation which is used to mark methods that are exposed to React Native.\n *\n * This applies to derived classes of {@link BaseJavaModule}, which will generate a list\n * of exported methods by searching for those which are annotated with this annotation\n * and adding a JS callback for each.\n */\n@Retention(RUNTIME)\npublic @interface ReactMethod {\n  /**\n   * Whether the method can be called from JS synchronously **on the JS thread**,\n   * possibly returning a result.\n   *\n   * WARNING: in the vast majority of cases, you should leave this to false which allows\n   * your native module methods to be called asynchronously: calling methods\n   * synchronously can have strong performance penalties and introduce threading-related\n   * bugs to your native modules.\n   *\n   * In order to support remote debugging, both the method args and return type must be\n   * serializable to JSON: this means that we only support the same args as\n   * {@link ReactMethod}, and the hook can only be void or return JSON values (e.g. bool,\n   * number, String, {@link WritableMap}, or {@link WritableArray}). Calling these\n   * methods when running under the websocket executor is currently not supported.\n   */\n  boolean isBlockingSynchronousMethod() default false;\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ReactModuleWithSpec.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * An interface to be implemented by react modules that extends from the\n * generated spec class.\n * This is experimental.\n */\n@DoNotStrip\npublic interface ReactModuleWithSpec {\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableArray.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport java.util.ArrayList;\n\n/**\n * Interface for an array that allows typed access to its members. Used to pass parameters from JS\n * to Java.\n */\npublic interface ReadableArray {\n\n  int size();\n  boolean isNull(int index);\n  boolean getBoolean(int index);\n  double getDouble(int index);\n  int getInt(int index);\n  String getString(int index);\n  ReadableArray getArray(int index);\n  ReadableMap getMap(int index);\n  Dynamic getDynamic(int index);\n  ReadableType getType(int index);\n  ArrayList<Object> toArrayList();\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMap.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport java.util.HashMap;\n\n/**\n * Interface for a map that allows typed access to its members. Used to pass parameters from JS to\n * Java.\n */\npublic interface ReadableMap {\n\n  boolean hasKey(String name);\n  boolean isNull(String name);\n  boolean getBoolean(String name);\n  double getDouble(String name);\n  int getInt(String name);\n  String getString(String name);\n  ReadableArray getArray(String name);\n  ReadableMap getMap(String name);\n  Dynamic getDynamic(String name);\n  ReadableType getType(String name);\n  ReadableMapKeySetIterator keySetIterator();\n  HashMap<String, Object> toHashMap();\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeArray.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\nimport java.util.ArrayList;\n\n/**\n * Implementation of a NativeArray that allows read-only access to its members. This will generally\n * be constructed and filled in native code so you shouldn't construct one yourself.\n */\n@DoNotStrip\npublic class ReadableNativeArray extends NativeArray implements ReadableArray {\n  static {\n    ReactBridge.staticInit();\n  }\n\n  protected ReadableNativeArray(HybridData hybridData) {\n    super(hybridData);\n  }\n\n  @Override\n  public native int size();\n  @Override\n  public native boolean isNull(int index);\n  @Override\n  public native boolean getBoolean(int index);\n  @Override\n  public native double getDouble(int index);\n  @Override\n  public native int getInt(int index);\n  @Override\n  public native String getString(int index);\n  @Override\n  public native ReadableNativeArray getArray(int index);\n  @Override\n  public native ReadableNativeMap getMap(int index);\n  @Override\n  public native ReadableType getType(int index);\n\n  @Override\n  public Dynamic getDynamic(int index) {\n    return DynamicFromArray.create(this, index);\n  }\n\n  @Override\n  public ArrayList<Object> toArrayList() {\n    ArrayList<Object> arrayList = new ArrayList<>();\n\n    for (int i = 0; i < this.size(); i++) {\n      switch (getType(i)) {\n        case Null:\n          arrayList.add(null);\n          break;\n        case Boolean:\n          arrayList.add(getBoolean(i));\n          break;\n        case Number:\n          arrayList.add(getDouble(i));\n          break;\n        case String:\n          arrayList.add(getString(i));\n          break;\n        case Map:\n          arrayList.add(getMap(i).toHashMap());\n          break;\n        case Array:\n          arrayList.add(getArray(i).toArrayList());\n          break;\n        default:\n          throw new IllegalArgumentException(\"Could not convert object at index: \" + i + \".\");\n      }\n    }\n    return arrayList;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeMap.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\nimport java.util.HashMap;\n\n/**\n * Implementation of a read-only map in native memory. This will generally be constructed and filled\n * in native code so you shouldn't construct one yourself.\n */\n@DoNotStrip\npublic class ReadableNativeMap extends NativeMap implements ReadableMap {\n  static {\n    ReactBridge.staticInit();\n  }\n\n  protected ReadableNativeMap(HybridData hybridData) {\n    super(hybridData);\n  }\n\n  @Override\n  public native boolean hasKey(String name);\n  @Override\n  public native boolean isNull(String name);\n  @Override\n  public native boolean getBoolean(String name);\n  @Override\n  public native double getDouble(String name);\n  @Override\n  public native int getInt(String name);\n  @Override\n  public native String getString(String name);\n  @Override\n  public native ReadableNativeArray getArray(String name);\n  @Override\n  public native ReadableNativeMap getMap(String name);\n  @Override\n  public native ReadableType getType(String name);\n\n  @Override\n  public Dynamic getDynamic(String name) {\n    return DynamicFromMap.create(this, name);\n  }\n\n  @Override\n  public ReadableMapKeySetIterator keySetIterator() {\n    return new ReadableNativeMapKeySetIterator(this);\n  }\n\n  @Override\n  public HashMap<String, Object> toHashMap() {\n    ReadableMapKeySetIterator iterator = keySetIterator();\n    HashMap<String, Object> hashMap = new HashMap<>();\n\n    while (iterator.hasNextKey()) {\n      String key = iterator.nextKey();\n      switch (getType(key)) {\n        case Null:\n          hashMap.put(key, null);\n          break;\n        case Boolean:\n          hashMap.put(key, getBoolean(key));\n          break;\n        case Number:\n          hashMap.put(key, getDouble(key));\n          break;\n        case String:\n          hashMap.put(key, getString(key));\n          break;\n        case Map:\n          hashMap.put(key, getMap(key).toHashMap());\n          break;\n        case Array:\n          hashMap.put(key, getArray(key).toArrayList());\n          break;\n        default:\n          throw new IllegalArgumentException(\"Could not convert object with key: \" + key + \".\");\n      }\n    }\n    return hashMap;\n  }\n\n  /**\n   * Implementation of a {@link ReadableNativeMap} iterator in native memory.\n   */\n  @DoNotStrip\n  private static class ReadableNativeMapKeySetIterator implements ReadableMapKeySetIterator {\n    @DoNotStrip\n    private final HybridData mHybridData;\n\n    // Need to hold a strong ref to the map so that our native references remain valid.\n    @DoNotStrip\n    private final ReadableNativeMap mMap;\n\n    public ReadableNativeMapKeySetIterator(ReadableNativeMap readableNativeMap) {\n      mMap = readableNativeMap;\n      mHybridData = initHybrid(readableNativeMap);\n    }\n\n    @Override\n    public native boolean hasNextKey();\n    @Override\n    public native String nextKey();\n\n    private static native HybridData initHybrid(ReadableNativeMap readableNativeMap);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/WritableNativeArray.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * Implementation of a write-only array stored in native memory. Use\n * {@link Arguments#createArray()} if you need to stub out creating this class in a test.\n * TODO(5815532): Check if consumed on read\n */\n@DoNotStrip\npublic class WritableNativeArray extends ReadableNativeArray implements WritableArray {\n  static {\n    ReactBridge.staticInit();\n  }\n\n  public WritableNativeArray() {\n    super(initHybrid());\n  }\n\n  @Override\n  public native void pushNull();\n  @Override\n  public native void pushBoolean(boolean value);\n  @Override\n  public native void pushDouble(double value);\n  @Override\n  public native void pushInt(int value);\n  @Override\n  public native void pushString(String value);\n\n  // Note: this consumes the map so do not reuse it.\n  @Override\n  public void pushArray(WritableArray array) {\n    Assertions.assertCondition(\n        array == null || array instanceof WritableNativeArray, \"Illegal type provided\");\n    pushNativeArray((WritableNativeArray) array);\n  }\n\n  // Note: this consumes the map so do not reuse it.\n  @Override\n  public void pushMap(WritableMap map) {\n    Assertions.assertCondition(\n        map == null || map instanceof WritableNativeMap, \"Illegal type provided\");\n    pushNativeMap((WritableNativeMap) map);\n  }\n\n  private static native HybridData initHybrid();\n  private native void pushNativeArray(WritableNativeArray array);\n  private native void pushNativeMap(WritableNativeMap map);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/WritableNativeMap.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * Implementation of a write-only map stored in native memory. Use\n * {@link Arguments#createMap()} if you need to stub out creating this class in a test.\n * TODO(5815532): Check if consumed on read\n */\n@DoNotStrip\npublic class WritableNativeMap extends ReadableNativeMap implements WritableMap {\n  static {\n    ReactBridge.staticInit();\n  }\n\n  @Override\n  public native void putBoolean(String key, boolean value);\n  @Override\n  public native void putDouble(String key, double value);\n  @Override\n  public native void putInt(String key, int value);\n  @Override\n  public native void putString(String key, String value);\n  @Override\n  public native void putNull(String key);\n\n  // Note: this consumes the map so do not reuse it.\n  @Override\n  public void putMap(String key, WritableMap value) {\n    Assertions.assertCondition(\n        value == null || value instanceof WritableNativeMap, \"Illegal type provided\");\n    putNativeMap(key, (WritableNativeMap) value);\n  }\n\n  // Note: this consumes the map so do not reuse it.\n  @Override\n  public void putArray(String key, WritableArray value) {\n    Assertions.assertCondition(\n        value == null || value instanceof WritableNativeArray, \"Illegal type provided\");\n    putNativeArray(key, (WritableNativeArray) value);\n  }\n\n  // Note: this **DOES NOT** consume the source map\n  @Override\n  public void merge(ReadableMap source) {\n    Assertions.assertCondition(source instanceof ReadableNativeMap, \"Illegal type provided\");\n    mergeNativeMap((ReadableNativeMap) source);\n  }\n\n  public WritableNativeMap() {\n    super(initHybrid());\n  }\n\n  private static native HybridData initHybrid();\n\n  private native void putNativeMap(String key, WritableNativeMap value);\n  private native void putNativeArray(String key, WritableNativeArray value);\n  private native void mergeNativeMap(ReadableNativeMap source);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/bridge.pro",
    "content": "## Putting this here is kind of a hack.  I don't want to modify the OSS bridge.\n## TODO mhorowitz: add @DoNotStrip to the interface directly.\n\n-keepclassmembers class com.facebook.react.bridge.queue.MessageQueueThread {\n  public boolean isOnThread();\n  public void assertIsOnThread();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThread.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge.queue;\n\nimport java.util.concurrent.Callable;\nimport java.util.concurrent.Future;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * Encapsulates a Thread that can accept Runnables.\n */\n@DoNotStrip\npublic interface MessageQueueThread {\n  /**\n   * Runs the given Runnable on this Thread. It will be submitted to the end of the event queue even\n   * if it is being submitted from the same queue Thread.\n   */\n  @DoNotStrip\n  void runOnQueue(Runnable runnable);\n\n  /**\n   * Runs the given Callable on this Thread. It will be submitted to the end of the event queue even\n   * if it is being submitted from the same queue Thread.\n   */\n  @DoNotStrip\n  <T> Future<T> callOnQueue(final Callable<T> callable);\n\n  /**\n   * @return whether the current Thread is also the Thread associated with this MessageQueueThread.\n   */\n  @DoNotStrip\n  boolean isOnThread();\n\n  /**\n   * Asserts {@link #isOnThread()}, throwing a {@link AssertionException} (NOT an\n   * {@link AssertionError}) if the assertion fails.\n   */\n  @DoNotStrip\n  void assertIsOnThread();\n\n  /**\n   * Asserts {@link #isOnThread()}, throwing a {@link AssertionException} (NOT an\n   * {@link AssertionError}) if the assertion fails. The given message is appended to the error.\n   */\n  @DoNotStrip\n  void assertIsOnThread(String message);\n\n  /**\n   * Quits this MessageQueueThread. If called from this MessageQueueThread, this will be the last\n   * thing the thread runs. If called from a separate thread, this will block until the thread can\n   * be quit and joined.\n   */\n  @DoNotStrip\n  void quitSynchronous();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadImpl.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge.queue;\n\nimport java.util.concurrent.Callable;\nimport java.util.concurrent.Future;\n\nimport android.os.Looper;\nimport android.os.Process;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.react.bridge.AssertionException;\nimport com.facebook.react.bridge.SoftAssertions;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.common.futures.SimpleSettableFuture;\n\n/**\n * Encapsulates a Thread that has a {@link Looper} running on it that can accept Runnables.\n */\n@DoNotStrip\npublic class MessageQueueThreadImpl implements MessageQueueThread {\n\n  private final String mName;\n  private final Looper mLooper;\n  private final MessageQueueThreadHandler mHandler;\n  private final String mAssertionErrorMessage;\n  private volatile boolean mIsFinished = false;\n\n  private MessageQueueThreadImpl(\n      String name,\n      Looper looper,\n      QueueThreadExceptionHandler exceptionHandler) {\n    mName = name;\n    mLooper = looper;\n    mHandler = new MessageQueueThreadHandler(looper, exceptionHandler);\n    mAssertionErrorMessage = \"Expected to be called from the '\" + getName() + \"' thread!\";\n  }\n\n  /**\n   * Runs the given Runnable on this Thread. It will be submitted to the end of the event queue even\n   * if it is being submitted from the same queue Thread.\n   */\n  @DoNotStrip\n  @Override\n  public void runOnQueue(Runnable runnable) {\n    if (mIsFinished) {\n      FLog.w(\n          ReactConstants.TAG,\n          \"Tried to enqueue runnable on already finished thread: '\" + getName() +\n              \"... dropping Runnable.\");\n    }\n    mHandler.post(runnable);\n  }\n\n  @DoNotStrip\n  @Override\n  public <T> Future<T> callOnQueue(final Callable<T> callable) {\n    final SimpleSettableFuture<T> future = new SimpleSettableFuture<>();\n    runOnQueue(\n        new Runnable() {\n          @Override\n          public void run() {\n            try {\n              future.set(callable.call());\n            } catch (Exception e) {\n              future.setException(e);\n            }\n          }\n        });\n    return future;\n  }\n\n  /**\n   * @return whether the current Thread is also the Thread associated with this MessageQueueThread.\n   */\n  @DoNotStrip\n  @Override\n  public boolean isOnThread() {\n    return mLooper.getThread() == Thread.currentThread();\n  }\n\n  /**\n   * Asserts {@link #isOnThread()}, throwing a {@link AssertionException} (NOT an\n   * {@link AssertionError}) if the assertion fails.\n   */\n  @DoNotStrip\n  @Override\n  public void assertIsOnThread() {\n    SoftAssertions.assertCondition(isOnThread(), mAssertionErrorMessage);\n  }\n\n  /**\n   * Asserts {@link #isOnThread()}, throwing a {@link AssertionException} (NOT an\n   * {@link AssertionError}) if the assertion fails.\n   */\n  @DoNotStrip\n  @Override\n  public void assertIsOnThread(String message) {\n    SoftAssertions.assertCondition(\n      isOnThread(),\n      new StringBuilder().append(mAssertionErrorMessage).append(\" \").append(message).toString());\n  }\n\n  /**\n   * Quits this queue's Looper. If that Looper was running on a different Thread than the current\n   * Thread, also waits for the last message being processed to finish and the Thread to die.\n   */\n  @DoNotStrip\n  @Override\n  public void quitSynchronous() {\n    mIsFinished = true;\n    mLooper.quit();\n    if (mLooper.getThread() != Thread.currentThread()) {\n      try {\n        mLooper.getThread().join();\n      } catch (InterruptedException e) {\n        throw new RuntimeException(\"Got interrupted waiting to join thread \" + mName);\n      }\n    }\n  }\n\n  public Looper getLooper() {\n    return mLooper;\n  }\n\n  public String getName() {\n    return mName;\n  }\n\n  public static MessageQueueThreadImpl create(\n      MessageQueueThreadSpec spec,\n      QueueThreadExceptionHandler exceptionHandler) {\n    switch (spec.getThreadType()) {\n      case MAIN_UI:\n        return createForMainThread(spec.getName(), exceptionHandler);\n      case NEW_BACKGROUND:\n        return startNewBackgroundThread(spec.getName(), spec.getStackSize(), exceptionHandler);\n      default:\n        throw new RuntimeException(\"Unknown thread type: \" + spec.getThreadType());\n    }\n  }\n\n  /**\n   * @return a MessageQueueThreadImpl corresponding to Android's main UI thread.\n   */\n  private static MessageQueueThreadImpl createForMainThread(\n      String name,\n      QueueThreadExceptionHandler exceptionHandler) {\n    Looper mainLooper = Looper.getMainLooper();\n    final MessageQueueThreadImpl mqt =\n        new MessageQueueThreadImpl(name, mainLooper, exceptionHandler);\n\n    if (UiThreadUtil.isOnUiThread()) {\n      Process.setThreadPriority(Process.THREAD_PRIORITY_DISPLAY);\n    } else {\n      UiThreadUtil.runOnUiThread(\n          new Runnable() {\n            @Override\n            public void run() {\n              Process.setThreadPriority(Process.THREAD_PRIORITY_DISPLAY);\n            }\n          });\n    }\n    return mqt;\n  }\n\n  /**\n   * Creates and starts a new MessageQueueThreadImpl encapsulating a new Thread with a new Looper\n   * running on it. Give it a name for easier debugging and optionally a suggested stack size.\n   * When this method exits, the new MessageQueueThreadImpl is ready to receive events.\n   */\n  private static MessageQueueThreadImpl startNewBackgroundThread(\n      final String name,\n      long stackSize,\n      QueueThreadExceptionHandler exceptionHandler) {\n    final SimpleSettableFuture<Looper> looperFuture = new SimpleSettableFuture<>();\n    Thread bgThread = new Thread(null,\n        new Runnable() {\n          @Override\n          public void run() {\n            Process.setThreadPriority(Process.THREAD_PRIORITY_DISPLAY);\n            Looper.prepare();\n\n            looperFuture.set(Looper.myLooper());\n            Looper.loop();\n          }\n        }, \"mqt_\" + name, stackSize);\n    bgThread.start();\n\n    Looper myLooper = looperFuture.getOrThrow();\n    return new MessageQueueThreadImpl(name, myLooper, exceptionHandler);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadSpec.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge.queue;\n\n/**\n * Spec for creating a MessageQueueThread.\n */\npublic class MessageQueueThreadSpec {\n\n  private static final MessageQueueThreadSpec MAIN_UI_SPEC =\n      new MessageQueueThreadSpec(ThreadType.MAIN_UI, \"main_ui\");\n\n  // The Thread constructor interprets zero the same as not specifying a stack size\n  public static final long DEFAULT_STACK_SIZE_BYTES = 0;\n\n  protected static enum ThreadType {\n    MAIN_UI,\n    NEW_BACKGROUND,\n  }\n\n  public static MessageQueueThreadSpec newUIBackgroundTreadSpec(String name) {\n    return new MessageQueueThreadSpec(ThreadType.NEW_BACKGROUND, name);\n  }\n\n  public static MessageQueueThreadSpec newBackgroundThreadSpec(String name) {\n    return new MessageQueueThreadSpec(ThreadType.NEW_BACKGROUND, name);\n  }\n\n  public static MessageQueueThreadSpec newBackgroundThreadSpec(String name, long stackSize) {\n    return new MessageQueueThreadSpec(ThreadType.NEW_BACKGROUND, name, stackSize);\n  }\n\n  public static MessageQueueThreadSpec mainThreadSpec() {\n    return MAIN_UI_SPEC;\n  }\n\n  private final ThreadType mThreadType;\n  private final String mName;\n  private final long mStackSize;\n\n  private MessageQueueThreadSpec(ThreadType threadType, String name) {\n    this(threadType, name, DEFAULT_STACK_SIZE_BYTES);\n  }\n\n  private MessageQueueThreadSpec(ThreadType threadType, String name, long stackSize) {\n    mThreadType = threadType;\n    mName = name;\n    mStackSize = stackSize;\n  }\n\n  public ThreadType getThreadType() {\n    return mThreadType;\n  }\n\n  public String getName() {\n    return mName;\n  }\n\n  public long getStackSize() {\n    return mStackSize;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/queue/NativeRunnable.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge.queue;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * A Runnable that has a native run implementation.\n */\n@DoNotStrip\npublic class NativeRunnable implements Runnable {\n\n  private final HybridData mHybridData;\n\n  @DoNotStrip\n  private NativeRunnable(HybridData hybridData) {\n    mHybridData = hybridData;\n  }\n\n  public native void run();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfiguration.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge.queue;\n\n\n/**\n * Specifies which {@link MessageQueueThread}s must be used to run the various contexts of\n * execution within catalyst (Main UI thread, native modules, and JS). Some of these queues *may* be\n * the same but should be coded against as if they are different.\n *\n * UI Queue Thread: The standard Android main UI thread and Looper. Not configurable.\n * Native Modules Queue Thread: The thread and Looper that native modules are invoked on.\n * JS Queue Thread: The thread and Looper that JS is executed on.\n */\npublic interface ReactQueueConfiguration {\n  MessageQueueThread getUIQueueThread();\n  MessageQueueThread getNativeModulesQueueThread();\n  MessageQueueThread getJSQueueThread();\n  void destroy();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationImpl.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge.queue;\n\nimport java.util.Map;\n\nimport android.os.Looper;\n\nimport com.facebook.react.common.MapBuilder;\n\npublic class ReactQueueConfigurationImpl implements ReactQueueConfiguration {\n\n  private final MessageQueueThreadImpl mUIQueueThread;\n  private final MessageQueueThreadImpl mNativeModulesQueueThread;\n  private final MessageQueueThreadImpl mJSQueueThread;\n\n  private ReactQueueConfigurationImpl(\n      MessageQueueThreadImpl uiQueueThread,\n      MessageQueueThreadImpl nativeModulesQueueThread,\n      MessageQueueThreadImpl jsQueueThread) {\n    mUIQueueThread = uiQueueThread;\n    mNativeModulesQueueThread = nativeModulesQueueThread;\n    mJSQueueThread = jsQueueThread;\n  }\n\n  @Override\n  public MessageQueueThread getUIQueueThread() {\n    return mUIQueueThread;\n  }\n\n  @Override\n  public MessageQueueThread getNativeModulesQueueThread() {\n    return mNativeModulesQueueThread;\n  }\n\n  @Override\n  public MessageQueueThread getJSQueueThread() {\n    return mJSQueueThread;\n  }\n\n  /**\n   * Should be called when the corresponding {@link com.facebook.react.bridge.CatalystInstance}\n   * is destroyed so that we shut down the proper queue threads.\n   */\n  public void destroy() {\n    if (mNativeModulesQueueThread.getLooper() != Looper.getMainLooper()) {\n      mNativeModulesQueueThread.quitSynchronous();\n    }\n    if (mJSQueueThread.getLooper() != Looper.getMainLooper()) {\n      mJSQueueThread.quitSynchronous();\n    }\n  }\n\n  public static ReactQueueConfigurationImpl create(\n      ReactQueueConfigurationSpec spec,\n      QueueThreadExceptionHandler exceptionHandler) {\n    Map<MessageQueueThreadSpec, MessageQueueThreadImpl> specsToThreads = MapBuilder.newHashMap();\n\n    MessageQueueThreadSpec uiThreadSpec = MessageQueueThreadSpec.mainThreadSpec();\n    MessageQueueThreadImpl uiThread =\n      MessageQueueThreadImpl.create(uiThreadSpec, exceptionHandler);\n    specsToThreads.put(uiThreadSpec, uiThread);\n\n    MessageQueueThreadImpl jsThread = specsToThreads.get(spec.getJSQueueThreadSpec());\n    if (jsThread == null) {\n      jsThread = MessageQueueThreadImpl.create(spec.getJSQueueThreadSpec(), exceptionHandler);\n    }\n\n    MessageQueueThreadImpl nativeModulesThread =\n        specsToThreads.get(spec.getNativeModulesQueueThreadSpec());\n    if (nativeModulesThread == null) {\n      nativeModulesThread =\n          MessageQueueThreadImpl.create(spec.getNativeModulesQueueThreadSpec(), exceptionHandler);\n    }\n\n    return new ReactQueueConfigurationImpl(\n      uiThread,\n      nativeModulesThread,\n      jsThread);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationSpec.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge.queue;\n\nimport android.os.Build;\n\nimport javax.annotation.Nullable;\n\nimport com.facebook.infer.annotation.Assertions;\n\n/**\n * Spec for creating a ReactQueueConfiguration. This exists so that CatalystInstance is able to\n * set Exception handlers on the MessageQueueThreads it uses and it would not be super clean if the\n * threads were configured, then passed to CatalystInstance where they are configured more. These\n * specs allows the Threads to be created fully configured.\n */\npublic class ReactQueueConfigurationSpec {\n\n  private static final long LEGACY_STACK_SIZE_BYTES = 2000000;\n\n  private final MessageQueueThreadSpec mNativeModulesQueueThreadSpec;\n  private final MessageQueueThreadSpec mJSQueueThreadSpec;\n\n  private ReactQueueConfigurationSpec(\n    MessageQueueThreadSpec nativeModulesQueueThreadSpec,\n    MessageQueueThreadSpec jsQueueThreadSpec) {\n    mNativeModulesQueueThreadSpec = nativeModulesQueueThreadSpec;\n    mJSQueueThreadSpec = jsQueueThreadSpec;\n  }\n\n  public MessageQueueThreadSpec getNativeModulesQueueThreadSpec() {\n    return mNativeModulesQueueThreadSpec;\n  }\n\n  public MessageQueueThreadSpec getJSQueueThreadSpec() {\n    return mJSQueueThreadSpec;\n  }\n\n  public static Builder builder() {\n    return new Builder();\n  }\n\n  public static ReactQueueConfigurationSpec createDefault() {\n    MessageQueueThreadSpec spec = Build.VERSION.SDK_INT < 21 ?\n        MessageQueueThreadSpec.newBackgroundThreadSpec(\"native_modules\", LEGACY_STACK_SIZE_BYTES) :\n        MessageQueueThreadSpec.newBackgroundThreadSpec(\"native_modules\");\n    return builder()\n        .setJSQueueThreadSpec(MessageQueueThreadSpec.newBackgroundThreadSpec(\"js\"))\n        .setNativeModulesQueueThreadSpec(spec)\n        .build();\n  }\n\n  public static class Builder {\n\n    private @Nullable MessageQueueThreadSpec mNativeModulesQueueSpec;\n    private @Nullable MessageQueueThreadSpec mJSQueueSpec;\n\n    public Builder setNativeModulesQueueThreadSpec(MessageQueueThreadSpec spec) {\n      Assertions.assertCondition(\n        mNativeModulesQueueSpec == null,\n        \"Setting native modules queue spec multiple times!\");\n      mNativeModulesQueueSpec = spec;\n      return this;\n    }\n\n    public Builder setJSQueueThreadSpec(MessageQueueThreadSpec spec) {\n      Assertions.assertCondition(mJSQueueSpec == null, \"Setting JS queue multiple times!\");\n      mJSQueueSpec = spec;\n      return this;\n    }\n\n    public ReactQueueConfigurationSpec build() {\n      return new ReactQueueConfigurationSpec(\n        Assertions.assertNotNull(mNativeModulesQueueSpec),\n        Assertions.assertNotNull(mJSQueueSpec));\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/reactnative.pro",
    "content": "-keepnames class * extends com.facebook.react.bridge.JavaScriptModule { *; }\n-keepnames class * extends com.facebook.react.bridge.CxxModuleWrapper {*; }\n-keepclassmembers class * extends com.facebook.react.bridge.NativeModule {\n    @com.facebook.react.bridge.ReactMethod *;\n    public <init>(...);\n}\n\n-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }\n-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }\n-keepnames class * extends com.facebook.react.uimanager.ViewManager\n-keepnames class * extends com.facebook.react.uimanager.ReactShadowNode\n-keep class **$$PropsSetter\n-keep class **$$ReactModuleInfoProvider\n-keep class com.facebook.react.bridge.ReadableType { *; }\n\n-keepnames class com.facebook.quicklog.QuickPerformanceLogger {\n  void markerAnnotate(int,int,java.lang.String,java.lang.String);\n  void markerTag(int,int,java.lang.String);\n}\n\n## Putting this here is kind of a hack.  I don't want to modify the OSS bridge.\n## TODO mhorowitz: add @DoNotStrip to the interface directly.\n\n-keepclassmembers class com.facebook.react.bridge.queue.MessageQueueThread {\n  public boolean isOnThread();\n  public void assertIsOnThread();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/common/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nSUB_PROJECTS = [\n    \"network/**/*\",\n]\n\nandroid_library(\n    name = \"common\",\n    srcs = glob(\n        [\"**/*.java\"],\n        excludes = SUB_PROJECTS,\n    ),\n    exported_deps = [\n        react_native_dep(\"java/com/facebook/proguard/annotations:annotations\"),\n    ],\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    required_for_source_only_abi = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        \":build_config\",\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n\nandroid_build_config(\n    name = \"build_config\",\n    package = \"com.facebook.react\",\n    values = [\n        \"boolean IS_INTERNAL_BUILD = true\",\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/common/ClearableSynchronizedPool.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.common;\n\nimport android.support.v4.util.Pools;\n\n/**\n * Like {@link android.support.v4.util.Pools.SynchronizedPool} with the option to clear the pool\n * (e.g. on memory pressure).\n */\npublic class ClearableSynchronizedPool<T> implements Pools.Pool<T> {\n\n  private final Object[] mPool;\n  private int mSize = 0;\n\n  public ClearableSynchronizedPool(int maxSize) {\n    mPool = new Object[maxSize];\n  }\n\n  @Override\n  public synchronized T acquire() {\n    if (mSize == 0) {\n      return null;\n    }\n    mSize--;\n    final int lastIndex = mSize;\n    T toReturn = (T) mPool[lastIndex];\n    mPool[lastIndex] = null;\n    return toReturn;\n  }\n\n  @Override\n  public synchronized boolean release(T obj) {\n    if (mSize == mPool.length) {\n      return false;\n    }\n    mPool[mSize] = obj;\n    mSize++;\n    return true;\n  }\n\n  public synchronized void clear() {\n    for (int i = 0; i < mSize; i++) {\n      mPool[i] = null;\n    }\n    mSize = 0;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.common;\n\nimport javax.annotation.Nullable;\n\nimport java.io.IOException;\n\nimport android.text.TextUtils;\n\nimport com.facebook.common.logging.FLog;\n\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\n/**\n * Tracks errors connecting to or received from the debug server.\n * The debug server returns errors as json objects. This exception represents that error.\n */\npublic class DebugServerException extends RuntimeException {\n  private static final String GENERIC_ERROR_MESSAGE =\n      \"\\n\\nTry the following to fix the issue:\\n\" +\n      \"\\u2022 Ensure that the packager server is running\\n\" +\n      \"\\u2022 Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices\\n\" +\n      \"\\u2022 Ensure Airplane Mode is disabled\\n\" +\n      \"\\u2022 If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device\\n\" +\n      \"\\u2022 If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server - e.g. 10.0.1.1:8081\\n\\n\";\n\n  public static DebugServerException makeGeneric(String reason, Throwable t) {\n    return makeGeneric(reason, \"\", t);\n  }\n\n  public static DebugServerException makeGeneric(String reason, String extra, Throwable t) {\n    return new DebugServerException(reason + GENERIC_ERROR_MESSAGE + extra, t);\n  }\n\n  private DebugServerException(String description, String fileName, int lineNumber, int column) {\n    super(description + \"\\n  at \" + fileName + \":\" + lineNumber + \":\" + column);\n  }\n\n  public DebugServerException(String description) {\n    super(description);\n  }\n\n  public DebugServerException(String detailMessage, Throwable throwable) {\n    super(detailMessage, throwable);\n  }\n\n  /**\n   * Parse a DebugServerException from the server json string.\n   * @param str json string returned by the debug server\n   * @return A DebugServerException or null if the string is not of proper form.\n   */\n  @Nullable public static DebugServerException parse(String str) {\n    if (TextUtils.isEmpty(str)) {\n      return null;\n    }\n    try {\n      JSONObject jsonObject = new JSONObject(str);\n      String fullFileName = jsonObject.getString(\"filename\");\n      return new DebugServerException(\n          jsonObject.getString(\"description\"),\n          shortenFileName(fullFileName),\n          jsonObject.getInt(\"lineNumber\"),\n          jsonObject.getInt(\"column\"));\n    } catch (JSONException e) {\n      // I'm not sure how strict this format is for returned errors, or what other errors there can\n      // be, so this may end up being spammy. Can remove it later if necessary.\n      FLog.w(ReactConstants.TAG, \"Could not parse DebugServerException from: \" + str, e);\n      return null;\n    }\n  }\n\n  private static String shortenFileName(String fullFileName) {\n    String[] parts = fullFileName.split(\"/\");\n    return parts[parts.length - 1];\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/common/JavascriptException.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.common;\n\n/**\n * A JS exception that was propagated to native. In debug mode, these exceptions are normally shown\n * to developers in a redbox.\n */\npublic class JavascriptException extends RuntimeException {\n\n  public JavascriptException(String jsStackTrace) {\n    super(jsStackTrace);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/common/LifecycleState.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.common;\n\n/**\n * Lifecycle state for an Activity. The state right after pause and right before resume are the\n * basically the same so this enum is in terms of the forward lifecycle progression (onResume, etc).\n * Eventually, if necessary, it could contain something like:\n *\n * BEFORE_CREATE,\n * CREATED,\n * VIEW_CREATED,\n * STARTED,\n * RESUMED\n */\npublic enum LifecycleState {\n  BEFORE_CREATE,\n  BEFORE_RESUME,\n  RESUMED,\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/common/ShakeDetector.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.common;\n\nimport javax.annotation.Nullable;\n\nimport java.util.concurrent.TimeUnit;\n\nimport android.hardware.Sensor;\nimport android.hardware.SensorEvent;\nimport android.hardware.SensorEventListener;\nimport android.hardware.SensorManager;\n\nimport com.facebook.infer.annotation.Assertions;\n\n/**\n * Listens for the user shaking their phone. Allocation-less once it starts listening.\n */\npublic class ShakeDetector implements SensorEventListener {\n  // Collect sensor data in this interval (nanoseconds)\n  private static final long MIN_TIME_BETWEEN_SAMPLES_NS =\n    TimeUnit.NANOSECONDS.convert(20, TimeUnit.MILLISECONDS);\n  // Number of nanoseconds to listen for and count shakes (nanoseconds)\n  private static final float SHAKING_WINDOW_NS =\n    TimeUnit.NANOSECONDS.convert(3, TimeUnit.SECONDS);\n  // Required force to constitute a rage shake. Need to multiply gravity by 1.33 because a rage\n  // shake in one direction should have more force than just the magnitude of free fall.\n  private static final float REQUIRED_FORCE = SensorManager.GRAVITY_EARTH * 1.33f;\n\n  private float mAccelerationX, mAccelerationY, mAccelerationZ;\n\n  public static interface ShakeListener {\n    void onShake();\n  }\n\n  private final ShakeListener mShakeListener;\n\n  @Nullable private SensorManager mSensorManager;\n  private long mLastTimestamp;\n  private int mNumShakes;\n  private long mLastShakeTimestamp;\n  //number of shakes required to trigger onShake()\n  private int mMinNumShakes;\n\n  public ShakeDetector(ShakeListener listener) {\n    this(listener, 1);\n  }\n\n  public ShakeDetector(ShakeListener listener, int minNumShakes) {\n    mShakeListener = listener;\n    mMinNumShakes = minNumShakes;\n  }\n\n  /**\n   * Start listening for shakes.\n   */\n  public void start(SensorManager manager) {\n    Assertions.assertNotNull(manager);\n    Sensor accelerometer = manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);\n    if (accelerometer != null) {\n      mSensorManager = manager;\n      mLastTimestamp = -1;\n      mSensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_UI);\n      mLastShakeTimestamp = 0;\n      reset();\n    }\n  }\n\n  /**\n   * Stop listening for shakes.\n   */\n  public void stop() {\n    if (mSensorManager != null) {\n      mSensorManager.unregisterListener(this);\n      mSensorManager = null;\n    }\n  }\n\n  /**\n   * Reset all variables used to keep track of number of shakes recorded.\n   */\n  private void reset() {\n    mNumShakes = 0;\n    mAccelerationX = 0;\n    mAccelerationY = 0;\n    mAccelerationZ = 0;\n  }\n\n  /**\n   * Determine if acceleration applied to sensor is large enough to count as a rage shake.\n   *\n   * @param a acceleration in x, y, or z applied to the sensor\n   * @return true if the magnitude of the force exceeds the minimum required amount of force.\n   * false otherwise.\n   */\n  private boolean atLeastRequiredForce(float a) {\n    return Math.abs(a) > REQUIRED_FORCE;\n  }\n\n  /**\n   * Save data about last shake\n   * @param timestamp (ns) of last sensor event\n   */\n  private void recordShake(long timestamp) {\n    mLastShakeTimestamp = timestamp;\n    mNumShakes++;\n  }\n\n  @Override\n  public void onSensorChanged(SensorEvent sensorEvent) {\n    if (sensorEvent.timestamp - mLastTimestamp < MIN_TIME_BETWEEN_SAMPLES_NS) {\n      return;\n    }\n\n    float ax = sensorEvent.values[0];\n    float ay = sensorEvent.values[1];\n    float az = sensorEvent.values[2] - SensorManager.GRAVITY_EARTH;\n\n    mLastTimestamp = sensorEvent.timestamp;\n\n    if (atLeastRequiredForce(ax) && ax * mAccelerationX <= 0) {\n      recordShake(sensorEvent.timestamp);\n      mAccelerationX = ax;\n    } else if (atLeastRequiredForce(ay) && ay * mAccelerationY <= 0) {\n      recordShake(sensorEvent.timestamp);\n      mAccelerationY = ay;\n    } else if (atLeastRequiredForce(az) && az * mAccelerationZ <= 0) {\n      recordShake(sensorEvent.timestamp);\n      mAccelerationZ = az;\n    }\n\n    maybeDispatchShake(sensorEvent.timestamp);\n  }\n\n  @Override\n  public void onAccuracyChanged(Sensor sensor, int i) {\n  }\n\n  private void maybeDispatchShake(long currentTimestamp) {\n    if (mNumShakes >= 8 * mMinNumShakes) {\n      reset();\n      mShakeListener.onShake();\n    }\n\n    if (currentTimestamp - mLastShakeTimestamp > SHAKING_WINDOW_NS) {\n      reset();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/common/SingleThreadAsserter.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.common;\n\nimport javax.annotation.Nullable;\n\nimport com.facebook.infer.annotation.Assertions;\n\n/**\n * Simple class for asserting that operations only run on a single thread.\n */\npublic class SingleThreadAsserter {\n  private @Nullable Thread mThread = null;\n\n  public void assertNow() {\n    Thread current = Thread.currentThread();\n    if (mThread == null) {\n      mThread = current;\n    }\n    Assertions.assertCondition(mThread == current);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/common/SystemClock.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.common;\n\n/**\n * Detour for System.currentTimeMillis and System.nanoTime calls so that they can be mocked out in\n * tests.\n */\npublic class SystemClock {\n\n  public static long currentTimeMillis() {\n    return System.currentTimeMillis();\n  }\n\n  public static long nanoTime() {\n    return System.nanoTime();\n  }\n\n  public static long uptimeMillis() {\n    return android.os.SystemClock.uptimeMillis();\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/common/build/ReactBuildConfig.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.common.build;\n\nimport com.facebook.react.BuildConfig;\n\n/**\n * Convenience class for accessing auto-generated BuildConfig so that a) other modules can just\n * depend on this module instead of having to manually depend on generating their own build config\n * and b) we don't have to deal with IntelliJ getting confused about the autogenerated BuildConfig\n * class all over the place.\n */\npublic class ReactBuildConfig {\n\n  public static final boolean DEBUG = BuildConfig.DEBUG;\n  public static final boolean IS_INTERNAL_BUILD = BuildConfig.IS_INTERNAL_BUILD;\n  public static final int EXOPACKAGE_FLAGS = BuildConfig.EXOPACKAGE_FLAGS;\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/common/network/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"network\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/common/network/OkHttpCallUtil.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n * <p/>\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\npackage com.facebook.react.common.network;\n\nimport okhttp3.Call;\nimport okhttp3.OkHttpClient;\n\n/**\n * Helper class that provides the necessary methods for canceling queued and running OkHttp calls\n */\npublic class OkHttpCallUtil {\n\n  private OkHttpCallUtil() {\n  }\n\n  public static void cancelTag(OkHttpClient client, Object tag) {\n    for (Call call : client.dispatcher().queuedCalls()) {\n      if (tag.equals(call.request().tag())) {\n        call.cancel();\n        return;\n      }\n    }\n    for (Call call : client.dispatcher().runningCalls()) {\n      if (tag.equals(call.request().tag())) {\n        call.cancel();\n        return;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"devsupport\",\n    srcs = glob([\"*.java\"]),\n    manifest = \"AndroidManifest.xml\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_target(\"java/com/facebook/debug/holder:holder\"),\n        react_native_target(\"java/com/facebook/debug/tags:tags\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/common/network:network\"),\n        react_native_target(\"java/com/facebook/react/devsupport:interfaces\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/modules/debug:debug\"),\n        react_native_target(\"java/com/facebook/react/modules/debug:interfaces\"),\n        react_native_target(\"java/com/facebook/react/modules/systeminfo:systeminfo\"),\n        react_native_target(\"java/com/facebook/react/packagerconnection:packagerconnection\"),\n        react_native_target(\"res:devsupport\"),\n    ],\n)\n\nandroid_library(\n    name = \"interfaces\",\n    srcs = glob([\"interfaces/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/modules/debug:interfaces\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.util.JsonReader;\nimport android.util.JsonToken;\nimport android.util.Log;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.common.DebugServerException;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport javax.annotation.Nullable;\nimport okhttp3.Call;\nimport okhttp3.Callback;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\nimport okio.Buffer;\nimport okio.BufferedSource;\nimport okio.Okio;\nimport okio.Sink;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\npublic class BundleDownloader {\n  private static final String TAG = \"BundleDownloader\";\n\n  // Should be kept in sync with constants in RCTJavaScriptLoader.h\n  private static final int FILES_CHANGED_COUNT_NOT_BUILT_BY_BUNDLER = -2;\n\n  private final OkHttpClient mClient;\n\n  private final LinkedHashMap<Number, byte[]> mPreModules = new LinkedHashMap<>();\n  private final LinkedHashMap<Number, byte[]> mDeltaModules = new LinkedHashMap<>();\n  private final LinkedHashMap<Number, byte[]> mPostModules = new LinkedHashMap<>();\n\n  private @Nullable String mDeltaId;\n  private @Nullable Call mDownloadBundleFromURLCall;\n\n  public static class BundleInfo {\n    private @Nullable String mUrl;\n    private int mFilesChangedCount;\n\n    public static @Nullable BundleInfo fromJSONString(String jsonStr) {\n      if (jsonStr == null) {\n        return null;\n      }\n\n      BundleInfo info = new BundleInfo();\n\n      try {\n        JSONObject obj = new JSONObject(jsonStr);\n        info.mUrl = obj.getString(\"url\");\n        info.mFilesChangedCount = obj.getInt(\"filesChangedCount\");\n      } catch (JSONException e) {\n        Log.e(TAG, \"Invalid bundle info: \", e);\n        return null;\n      }\n\n      return info;\n    }\n\n    public @Nullable String toJSONString() {\n      JSONObject obj = new JSONObject();\n\n      try {\n        obj.put(\"url\", mUrl);\n        obj.put(\"filesChangedCount\", mFilesChangedCount);\n      } catch (JSONException e) {\n        Log.e(TAG, \"Can't serialize bundle info: \", e);\n        return null;\n      }\n\n      return obj.toString();\n    }\n\n    public String getUrl() {\n      return mUrl != null ? mUrl : \"unknown\";\n    }\n\n    public int getFilesChangedCount() {\n      return mFilesChangedCount;\n    }\n  }\n\n  public BundleDownloader(OkHttpClient client) {\n    mClient = client;\n  }\n\n  public void downloadBundleFromURL(\n      final DevBundleDownloadListener callback,\n      final File outputFile,\n      final String bundleURL,\n      final @Nullable BundleInfo bundleInfo) {\n\n    String finalUrl = bundleURL;\n\n    if (isDeltaUrl(bundleURL) && mDeltaId != null) {\n      finalUrl += \"&deltaBundleId=\" + mDeltaId;\n    }\n\n    final Request request =\n        new Request.Builder()\n            .url(finalUrl)\n            // FIXME: there is a bug that makes MultipartStreamReader to never find the end of the\n            // multipart message. This temporarily disables the multipart mode to work around it,\n            // but\n            // it means there is no progress bar displayed in the React Native overlay anymore.\n            // .addHeader(\"Accept\", \"multipart/mixed\")\n            .build();\n    mDownloadBundleFromURLCall = Assertions.assertNotNull(mClient.newCall(request));\n    mDownloadBundleFromURLCall.enqueue(new Callback() {\n      @Override\n      public void onFailure(Call call, IOException e) {\n        // ignore callback if call was cancelled\n        if (mDownloadBundleFromURLCall == null || mDownloadBundleFromURLCall.isCanceled()) {\n          mDownloadBundleFromURLCall = null;\n          return;\n        }\n        mDownloadBundleFromURLCall = null;\n\n        callback.onFailure(DebugServerException.makeGeneric(\n            \"Could not connect to development server.\",\n            \"URL: \" + call.request().url().toString(),\n            e));\n      }\n\n      @Override\n      public void onResponse(Call call, final Response response) throws IOException {\n        // ignore callback if call was cancelled\n        if (mDownloadBundleFromURLCall == null || mDownloadBundleFromURLCall.isCanceled()) {\n          mDownloadBundleFromURLCall = null;\n          return;\n        }\n        mDownloadBundleFromURLCall = null;\n\n        final String url = response.request().url().toString();\n\n        // Make sure the result is a multipart response and parse the boundary.\n        String contentType = response.header(\"content-type\");\n        Pattern regex = Pattern.compile(\"multipart/mixed;.*boundary=\\\"([^\\\"]+)\\\"\");\n        Matcher match = regex.matcher(contentType);\n        if (match.find()) {\n          String boundary = match.group(1);\n          MultipartStreamReader bodyReader = new MultipartStreamReader(response.body().source(), boundary);\n          boolean completed = bodyReader.readAllParts(new MultipartStreamReader.ChunkCallback() {\n            @Override\n            public void execute(Map<String, String> headers, Buffer body, boolean finished) throws IOException {\n              // This will get executed for every chunk of the multipart response. The last chunk\n              // (finished = true) will be the JS bundle, the other ones will be progress events\n              // encoded as JSON.\n              if (finished) {\n                // The http status code for each separate chunk is in the X-Http-Status header.\n                int status = response.code();\n                if (headers.containsKey(\"X-Http-Status\")) {\n                  status = Integer.parseInt(headers.get(\"X-Http-Status\"));\n                }\n                processBundleResult(url, status, okhttp3.Headers.of(headers), body, outputFile, bundleInfo, callback);\n              } else {\n                if (!headers.containsKey(\"Content-Type\") || !headers.get(\"Content-Type\").equals(\"application/json\")) {\n                  return;\n                }\n\n                try {\n                  JSONObject progress = new JSONObject(body.readUtf8());\n                  String status = null;\n                  if (progress.has(\"status\")) {\n                    status = progress.getString(\"status\");\n                  }\n                  Integer done = null;\n                  if (progress.has(\"done\")) {\n                    done = progress.getInt(\"done\");\n                  }\n                  Integer total = null;\n                  if (progress.has(\"total\")) {\n                    total = progress.getInt(\"total\");\n                  }\n                  callback.onProgress(status, done, total);\n                } catch (JSONException e) {\n                  FLog.e(ReactConstants.TAG, \"Error parsing progress JSON. \" + e.toString());\n                }\n              }\n            }\n          });\n          if (!completed) {\n            callback.onFailure(new DebugServerException(\n                \"Error while reading multipart response.\\n\\nResponse code: \" + response.code() + \"\\n\\n\" +\n                \"URL: \" + call.request().url().toString() + \"\\n\\n\"));\n          }\n        } else {\n          // In case the server doesn't support multipart/mixed responses, fallback to normal download.\n          processBundleResult(url, response.code(), response.headers(), Okio.buffer(response.body().source()), outputFile, bundleInfo, callback);\n        }\n      }\n    });\n  }\n\n  public void cancelDownloadBundleFromURL() {\n    if (mDownloadBundleFromURLCall != null) {\n      mDownloadBundleFromURLCall.cancel();\n      mDownloadBundleFromURLCall = null;\n    }\n  }\n\n  private void processBundleResult(\n      String url,\n      int statusCode,\n      okhttp3.Headers headers,\n      BufferedSource body,\n      File outputFile,\n      BundleInfo bundleInfo,\n      DevBundleDownloadListener callback)\n      throws IOException {\n    // Check for server errors. If the server error has the expected form, fail with more info.\n    if (statusCode != 200) {\n      String bodyString = body.readUtf8();\n      DebugServerException debugServerException = DebugServerException.parse(bodyString);\n      if (debugServerException != null) {\n        callback.onFailure(debugServerException);\n      } else {\n        StringBuilder sb = new StringBuilder();\n        sb.append(\"The development server returned response error code: \").append(statusCode).append(\"\\n\\n\")\n          .append(\"URL: \").append(url).append(\"\\n\\n\")\n          .append(\"Body:\\n\")\n          .append(bodyString);\n        callback.onFailure(new DebugServerException(sb.toString()));\n      }\n      return;\n    }\n\n    if (bundleInfo != null) {\n      populateBundleInfo(url, headers, bundleInfo);\n    }\n\n    File tmpFile = new File(outputFile.getPath() + \".tmp\");\n\n    boolean bundleUpdated;\n\n    if (isDeltaUrl(url)) {\n      // If the bundle URL has the delta extension, we need to use the delta patching logic.\n      bundleUpdated = storeDeltaInFile(body, tmpFile);\n    } else {\n      resetDeltaCache();\n      bundleUpdated = storePlainJSInFile(body, tmpFile);\n    }\n\n    if (bundleUpdated) {\n      // If we have received a new bundle from the server, move it to its final destination.\n      if (!tmpFile.renameTo(outputFile)) {\n        throw new IOException(\"Couldn't rename \" + tmpFile + \" to \" + outputFile);\n      }\n    }\n\n    callback.onSuccess();\n  }\n\n  private static boolean storePlainJSInFile(BufferedSource body, File outputFile)\n      throws IOException {\n    Sink output = null;\n    try {\n      output = Okio.sink(outputFile);\n      body.readAll(output);\n    } finally {\n      if (output != null) {\n        output.close();\n      }\n    }\n\n    return true;\n  }\n\n  private boolean storeDeltaInFile(BufferedSource body, File outputFile) throws IOException {\n\n    JsonReader jsonReader = new JsonReader(new InputStreamReader(body.inputStream()));\n\n    jsonReader.beginObject();\n\n    int numChangedModules = 0;\n\n    while (jsonReader.hasNext()) {\n      String name = jsonReader.nextName();\n      if (name.equals(\"id\")) {\n        mDeltaId = jsonReader.nextString();\n      } else if (name.equals(\"pre\")) {\n        numChangedModules += patchDelta(jsonReader, mPreModules);\n      } else if (name.equals(\"post\")) {\n        numChangedModules += patchDelta(jsonReader, mPostModules);\n      } else if (name.equals(\"delta\")) {\n        numChangedModules += patchDelta(jsonReader, mDeltaModules);\n      } else {\n        jsonReader.skipValue();\n      }\n    }\n\n    jsonReader.endObject();\n    jsonReader.close();\n\n    if (numChangedModules == 0) {\n      // If we receive an empty delta, we don't need to save the file again (it'll have the\n      // same content).\n      return false;\n    }\n\n    FileOutputStream fileOutputStream = new FileOutputStream(outputFile);\n\n    try {\n      for (byte[] code : mPreModules.values()) {\n        fileOutputStream.write(code);\n        fileOutputStream.write('\\n');\n      }\n\n      for (byte[] code : mDeltaModules.values()) {\n        fileOutputStream.write(code);\n        fileOutputStream.write('\\n');\n      }\n\n      for (byte[] code : mPostModules.values()) {\n        fileOutputStream.write(code);\n        fileOutputStream.write('\\n');\n      }\n    } finally {\n      fileOutputStream.flush();\n      fileOutputStream.close();\n    }\n\n    return true;\n  }\n\n  private static int patchDelta(JsonReader jsonReader, LinkedHashMap<Number, byte[]> map)\n      throws IOException {\n    jsonReader.beginArray();\n\n    int numModules = 0;\n    while (jsonReader.hasNext()) {\n      jsonReader.beginArray();\n\n      int moduleId = jsonReader.nextInt();\n\n      if (jsonReader.peek() == JsonToken.NULL) {\n        jsonReader.skipValue();\n        map.remove(moduleId);\n      } else {\n        map.put(moduleId, jsonReader.nextString().getBytes());\n      }\n\n      jsonReader.endArray();\n      numModules++;\n    }\n\n    jsonReader.endArray();\n\n    return numModules;\n  }\n\n  private void resetDeltaCache() {\n    mDeltaId = null;\n\n    mDeltaModules.clear();\n    mPreModules.clear();\n    mPostModules.clear();\n  }\n\n  private static boolean isDeltaUrl(String bundleUrl) {\n    return bundleUrl.indexOf(\".delta?\") != -1;\n  }\n\n  private static void populateBundleInfo(String url, okhttp3.Headers headers, BundleInfo bundleInfo) {\n    bundleInfo.mUrl = url;\n\n    String filesChangedCountStr = headers.get(\"X-Metro-Files-Changed-Count\");\n    if (filesChangedCountStr != null) {\n      try {\n        bundleInfo.mFilesChangedCount = Integer.parseInt(filesChangedCountStr);\n      } catch (NumberFormatException e) {\n        bundleInfo.mFilesChangedCount = FILES_CHANGED_COUNT_NOT_BUILT_BY_BUNDLER;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/DebugOverlayController.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.Manifest;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.pm.PackageInfo;\nimport android.content.pm.PackageManager;\nimport android.graphics.PixelFormat;\nimport android.net.Uri;\nimport android.os.Build;\nimport android.provider.Settings;\nimport android.view.WindowManager;\nimport android.widget.FrameLayout;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.common.ReactConstants;\n\nimport javax.annotation.Nullable;\n\n/**\n * Helper class for controlling overlay view with FPS and JS FPS info\n * that gets added directly to @{link WindowManager} instance.\n */\n/* package */ class DebugOverlayController {\n\n  public static void requestPermission(Context context) {\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n      // Get permission to show debug overlay in dev builds.\n      if (!Settings.canDrawOverlays(context)) {\n        Intent intent = new Intent(\n                Settings.ACTION_MANAGE_OVERLAY_PERMISSION,\n                Uri.parse(\"package:\" + context.getPackageName()));\n        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n        FLog.w(ReactConstants.TAG, \"Overlay permissions needs to be granted in order for react native apps to run in dev mode\");\n        if (canHandleIntent(context, intent)) {\n          context.startActivity(intent);\n        }\n      }\n    }\n  }\n\n  private static boolean permissionCheck(Context context) {\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n      // Get permission to show debug overlay in dev builds.\n      if (!Settings.canDrawOverlays(context)) {\n        // overlay permission not yet granted\n        return false;\n      } else {\n        return true;\n      }\n    }\n    // on pre-M devices permission needs to be specified in manifest\n    return hasPermission(context, Manifest.permission.SYSTEM_ALERT_WINDOW);\n  }\n\n  private static boolean hasPermission(Context context, String permission) {\n    try {\n      PackageInfo info = context.getPackageManager().getPackageInfo(\n              context.getPackageName(),\n              PackageManager.GET_PERMISSIONS);\n      if (info.requestedPermissions != null) {\n        for (String p : info.requestedPermissions) {\n          if (p.equals(permission)) {\n            return true;\n          }\n        }\n      }\n    } catch (PackageManager.NameNotFoundException e) {\n      FLog.e(ReactConstants.TAG, \"Error while retrieving package info\", e);\n    }\n    return false;\n  }\n\n  private static boolean canHandleIntent(Context context, Intent intent) {\n    PackageManager packageManager = context.getPackageManager();\n    return intent.resolveActivity(packageManager) != null;\n  }\n\n  private final WindowManager mWindowManager;\n  private final ReactContext mReactContext;\n\n  private @Nullable FrameLayout mFPSDebugViewContainer;\n\n  public DebugOverlayController(ReactContext reactContext) {\n    mReactContext = reactContext;\n    mWindowManager = (WindowManager) reactContext.getSystemService(Context.WINDOW_SERVICE);\n  }\n\n  public void setFpsDebugViewVisible(boolean fpsDebugViewVisible) {\n    if (fpsDebugViewVisible && mFPSDebugViewContainer == null) {\n      if (!permissionCheck(mReactContext)) {\n        FLog.d(ReactConstants.TAG, \"Wait for overlay permission to be set\");\n        return;\n      }\n      mFPSDebugViewContainer = new FpsView(mReactContext);\n      WindowManager.LayoutParams params = new WindowManager.LayoutParams(\n          WindowManager.LayoutParams.MATCH_PARENT,\n          WindowManager.LayoutParams.MATCH_PARENT,\n          WindowOverlayCompat.TYPE_SYSTEM_OVERLAY,\n          WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE\n              | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,\n          PixelFormat.TRANSLUCENT);\n      mWindowManager.addView(mFPSDebugViewContainer, params);\n    } else if (!fpsDebugViewVisible && mFPSDebugViewContainer != null) {\n      mFPSDebugViewContainer.removeAllViews();\n      mWindowManager.removeView(mFPSDebugViewContainer);\n      mFPSDebugViewContainer = null;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/DevInternalSettings.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.annotation.SuppressLint;\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.preference.PreferenceManager;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.common.build.ReactBuildConfig;\nimport com.facebook.react.modules.debug.interfaces.DeveloperSettings;\nimport com.facebook.react.packagerconnection.PackagerConnectionSettings;\n\n/**\n * Helper class for accessing developers settings that should not be accessed outside of the package\n * {@link com.facebook.react.devsupport}. For accessing some of the settings by external modules\n * this class implements an external interface {@link DeveloperSettings}.\n */\n@VisibleForTesting\npublic class DevInternalSettings implements\n    DeveloperSettings,\n    SharedPreferences.OnSharedPreferenceChangeListener {\n\n  private static final String PREFS_FPS_DEBUG_KEY = \"fps_debug\";\n  private static final String PREFS_JS_DEV_MODE_DEBUG_KEY = \"js_dev_mode_debug\";\n  private static final String PREFS_JS_MINIFY_DEBUG_KEY = \"js_minify_debug\";\n  private static final String PREFS_JS_BUNDLE_DELTAS_KEY = \"js_bundle_deltas\";\n  private static final String PREFS_ANIMATIONS_DEBUG_KEY = \"animations_debug\";\n  private static final String PREFS_RELOAD_ON_JS_CHANGE_KEY = \"reload_on_js_change\";\n  private static final String PREFS_INSPECTOR_DEBUG_KEY = \"inspector_debug\";\n  private static final String PREFS_HOT_MODULE_REPLACEMENT_KEY = \"hot_module_replacement\";\n  private static final String PREFS_REMOTE_JS_DEBUG_KEY = \"remote_js_debug\";\n\n  private final SharedPreferences mPreferences;\n  private final Listener mListener;\n  private final PackagerConnectionSettings mPackagerConnectionSettings;\n\n  public DevInternalSettings(\n      Context applicationContext,\n      Listener listener) {\n    mListener = listener;\n    mPreferences = PreferenceManager.getDefaultSharedPreferences(applicationContext);\n    mPreferences.registerOnSharedPreferenceChangeListener(this);\n    mPackagerConnectionSettings = new PackagerConnectionSettings(applicationContext);\n  }\n\n  public PackagerConnectionSettings getPackagerConnectionSettings() {\n    return mPackagerConnectionSettings;\n  }\n\n  @Override\n  public boolean isFpsDebugEnabled() {\n    return mPreferences.getBoolean(PREFS_FPS_DEBUG_KEY, false);\n  }\n\n  public void setFpsDebugEnabled(boolean enabled) {\n    mPreferences.edit().putBoolean(PREFS_FPS_DEBUG_KEY, enabled).apply();\n  }\n\n  @Override\n  public boolean isAnimationFpsDebugEnabled() {\n    return mPreferences.getBoolean(PREFS_ANIMATIONS_DEBUG_KEY, false);\n  }\n\n  @Override\n  public boolean isJSDevModeEnabled() {\n    return mPreferences.getBoolean(PREFS_JS_DEV_MODE_DEBUG_KEY, true);\n  }\n\n  @Override\n  public boolean isJSMinifyEnabled() {\n    return mPreferences.getBoolean(PREFS_JS_MINIFY_DEBUG_KEY, false);\n  }\n\n  public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {\n    if (mListener != null) {\n      if (PREFS_FPS_DEBUG_KEY.equals(key)\n          || PREFS_RELOAD_ON_JS_CHANGE_KEY.equals(key)\n          || PREFS_JS_DEV_MODE_DEBUG_KEY.equals(key)\n          || PREFS_JS_BUNDLE_DELTAS_KEY.equals(key)\n          || PREFS_JS_MINIFY_DEBUG_KEY.equals(key)) {\n        mListener.onInternalSettingsChanged();\n      }\n    }\n  }\n\n  public boolean isHotModuleReplacementEnabled() {\n    return mPreferences.getBoolean(PREFS_HOT_MODULE_REPLACEMENT_KEY, false);\n  }\n\n  public void setHotModuleReplacementEnabled(boolean enabled) {\n    mPreferences.edit().putBoolean(PREFS_HOT_MODULE_REPLACEMENT_KEY, enabled).apply();\n  }\n\n  public boolean isReloadOnJSChangeEnabled() {\n    return mPreferences.getBoolean(PREFS_RELOAD_ON_JS_CHANGE_KEY, false);\n  }\n\n  public void setReloadOnJSChangeEnabled(boolean enabled) {\n    mPreferences.edit().putBoolean(PREFS_RELOAD_ON_JS_CHANGE_KEY, enabled).apply();\n  }\n\n  public boolean isElementInspectorEnabled() {\n    return mPreferences.getBoolean(PREFS_INSPECTOR_DEBUG_KEY, false);\n  }\n\n  public void setElementInspectorEnabled(boolean enabled) {\n    mPreferences.edit().putBoolean(PREFS_INSPECTOR_DEBUG_KEY, enabled).apply();\n  }\n\n  @SuppressLint(\"SharedPreferencesUse\")\n  public boolean isBundleDeltasEnabled() {\n    return mPreferences.getBoolean(PREFS_JS_BUNDLE_DELTAS_KEY, true);\n  }\n\n  @SuppressLint(\"SharedPreferencesUse\")\n  public void setBundleDeltasEnabled(boolean enabled) {\n    mPreferences.edit().putBoolean(PREFS_JS_BUNDLE_DELTAS_KEY, enabled).apply();\n  }\n\n  @Override\n  public boolean isNuclideJSDebugEnabled() {\n    return ReactBuildConfig.IS_INTERNAL_BUILD && ReactBuildConfig.DEBUG;\n  }\n\n  @Override\n  public boolean isRemoteJSDebugEnabled() {\n    return mPreferences.getBoolean(PREFS_REMOTE_JS_DEBUG_KEY, false);\n  }\n\n  @Override\n  public void setRemoteJSDebugEnabled(boolean remoteJSDebugEnabled) {\n    mPreferences.edit().putBoolean(PREFS_REMOTE_JS_DEBUG_KEY, remoteJSDebugEnabled).apply();\n  }\n\n  public interface Listener {\n    void onInternalSettingsChanged();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/DevLoadingViewController.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.graphics.Color;\nimport android.graphics.Rect;\nimport android.os.Build;\nimport android.view.Gravity;\nimport android.view.LayoutInflater;\nimport android.view.ViewGroup;\nimport android.view.Window;\nimport android.widget.PopupWindow;\nimport android.widget.TextView;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.R;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.common.ReactConstants;\n\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport java.util.Locale;\n\nimport javax.annotation.Nullable;\n\n/**\n * Controller to display loading messages on top of the screen. All methods are thread safe.\n */\npublic class DevLoadingViewController {\n  private static final int COLOR_DARK_GREEN = Color.parseColor(\"#035900\");\n\n  private static boolean sEnabled = true;\n  private final Context mContext;\n  private final ReactInstanceManagerDevHelper mReactInstanceManagerHelper;\n  private final TextView mDevLoadingView;\n  private @Nullable PopupWindow mDevLoadingPopup;\n\n  public static void setDevLoadingEnabled(boolean enabled) {\n    sEnabled = enabled;\n  }\n\n  public DevLoadingViewController(Context context, ReactInstanceManagerDevHelper reactInstanceManagerHelper) {\n    mContext = context;\n    mReactInstanceManagerHelper = reactInstanceManagerHelper;\n    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n    mDevLoadingView = (TextView) inflater.inflate(R.layout.dev_loading_view, null);\n  }\n\n  public void showMessage(final String message, final int color, final int backgroundColor) {\n    if (!sEnabled) {\n      return;\n    }\n\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        mDevLoadingView.setBackgroundColor(backgroundColor);\n        mDevLoadingView.setText(message);\n        mDevLoadingView.setTextColor(color);\n\n        showInternal();\n      }\n    });\n  }\n\n  public void showForUrl(String url) {\n    URL parsedURL;\n    try {\n      parsedURL = new URL(url);\n    } catch (MalformedURLException e) {\n      FLog.e(ReactConstants.TAG, \"Bundle url format is invalid. \\n\\n\" + e.toString());\n      return;\n    }\n\n    showMessage(\n      mContext.getString(R.string.catalyst_loading_from_url, parsedURL.getHost() + \":\" + parsedURL.getPort()),\n      Color.WHITE,\n      COLOR_DARK_GREEN);\n  }\n\n  public void showForRemoteJSEnabled() {\n    showMessage(mContext.getString(R.string.catalyst_remotedbg_message), Color.WHITE, COLOR_DARK_GREEN);\n  }\n\n  public void updateProgress(final @Nullable String status, final @Nullable Integer done, final @Nullable Integer total) {\n    if (!sEnabled) {\n      return;\n    }\n\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        StringBuilder message = new StringBuilder();\n        message.append(status != null ? status : \"Loading\");\n        if (done != null && total != null && total > 0) {\n          message.append(String.format(Locale.getDefault(), \" %.1f%% (%d/%d)\", (float) done / total * 100, done, total));\n        }\n        message.append(\"\\u2026\"); // `...` character\n\n        mDevLoadingView.setText(message);\n      }\n    });\n  }\n\n  public void show() {\n    if (!sEnabled) {\n      return;\n    }\n\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        showInternal();\n      }\n    });\n  }\n\n  public void hide() {\n    if (!sEnabled) {\n      return;\n    }\n\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        hideInternal();\n      }\n    });\n  }\n\n  private void showInternal() {\n    if (mDevLoadingPopup != null && mDevLoadingPopup.isShowing()) {\n      // already showing\n      return;\n    }\n\n    Activity currentActivity = mReactInstanceManagerHelper.getCurrentActivity();\n    if (currentActivity == null) {\n      FLog.e(ReactConstants.TAG, \"Unable to display loading message because react \" +\n              \"activity isn't available\");\n      return;\n    }\n\n    int topOffset = 0;\n    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {\n      // On Android SDK <= 19 PopupWindow#showAtLocation uses absolute screen position. In order for\n      // loading view to be placed below status bar (if the status bar is present) we need to pass\n      // an appropriate Y offset.\n      Rect rectangle = new Rect();\n      currentActivity.getWindow().getDecorView().getWindowVisibleDisplayFrame(rectangle);\n      topOffset = rectangle.top;\n    }\n\n    mDevLoadingPopup = new PopupWindow(\n            mDevLoadingView,\n            ViewGroup.LayoutParams.MATCH_PARENT,\n            ViewGroup.LayoutParams.WRAP_CONTENT);\n    mDevLoadingPopup.setTouchable(false);\n\n    mDevLoadingPopup.showAtLocation(\n            currentActivity.getWindow().getDecorView(),\n            Gravity.NO_GRAVITY,\n\n            0,\n            topOffset);\n  }\n\n  private void hideInternal() {\n    if (mDevLoadingPopup != null && mDevLoadingPopup.isShowing()) {\n      mDevLoadingPopup.dismiss();\n      mDevLoadingPopup = null;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.content.Context;\nimport android.os.AsyncTask;\nimport android.os.Handler;\nimport android.widget.Toast;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.R;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.common.network.OkHttpCallUtil;\nimport com.facebook.react.devsupport.interfaces.PackagerStatusCallback;\nimport com.facebook.react.devsupport.interfaces.StackFrame;\nimport com.facebook.react.modules.systeminfo.AndroidInfoHelpers;\nimport com.facebook.react.packagerconnection.FileIoHandler;\nimport com.facebook.react.packagerconnection.JSPackagerClient;\nimport com.facebook.react.packagerconnection.NotificationOnlyHandler;\nimport com.facebook.react.packagerconnection.ReconnectingWebSocket.ConnectionCallback;\nimport com.facebook.react.packagerconnection.RequestHandler;\nimport com.facebook.react.packagerconnection.RequestOnlyHandler;\nimport com.facebook.react.packagerconnection.Responder;\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.Locale;\nimport java.util.Map;\nimport java.util.concurrent.TimeUnit;\nimport javax.annotation.Nullable;\nimport okhttp3.Call;\nimport okhttp3.Callback;\nimport okhttp3.ConnectionPool;\nimport okhttp3.MediaType;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\nimport okhttp3.ResponseBody;\nimport okio.Okio;\nimport okio.Sink;\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\n/**\n * Helper class for all things about the debug server running in the engineer's host machine.\n *\n * One can use 'debug_http_host' shared preferences key to provide a host name for the debug server.\n * If the setting is empty we support and detect two basic configuration that works well for android\n * emulators connection to debug server running on emulator's host:\n *  - Android stock emulator with standard non-configurable local loopback alias: 10.0.2.2,\n *  - Genymotion emulator with default settings: 10.0.3.2\n */\npublic class DevServerHelper {\n  public static final String RELOAD_APP_EXTRA_JS_PROXY = \"jsproxy\";\n  private static final String RELOAD_APP_ACTION_SUFFIX = \".RELOAD_APP_ACTION\";\n\n  private static final String BUNDLE_URL_FORMAT =\n      \"http://%s/%s.%s?platform=android&dev=%s&minify=%s\";\n  private static final String RESOURCE_URL_FORMAT = \"http://%s/%s\";\n  private static final String LAUNCH_JS_DEVTOOLS_COMMAND_URL_FORMAT =\n      \"http://%s/launch-js-devtools\";\n  private static final String ONCHANGE_ENDPOINT_URL_FORMAT =\n      \"http://%s/onchange\";\n  private static final String WEBSOCKET_PROXY_URL_FORMAT = \"ws://%s/debugger-proxy?role=client\";\n  private static final String PACKAGER_STATUS_URL_FORMAT = \"http://%s/status\";\n  private static final String HEAP_CAPTURE_UPLOAD_URL_FORMAT = \"http://%s/jscheapcaptureupload\";\n  private static final String INSPECTOR_DEVICE_URL_FORMAT = \"http://%s/inspector/device?name=%s&app=%s\";\n  private static final String INSPECTOR_ATTACH_URL_FORMAT = \"http://%s/nuclide/attach-debugger-nuclide?title=%s&app=%s&device=%s\";\n  private static final String SYMBOLICATE_URL_FORMAT = \"http://%s/symbolicate\";\n  private static final String OPEN_STACK_FRAME_URL_FORMAT = \"http://%s/open-stack-frame\";\n\n  private static final String PACKAGER_OK_STATUS = \"packager-status:running\";\n\n  private static final int LONG_POLL_KEEP_ALIVE_DURATION_MS = 2 * 60 * 1000; // 2 mins\n  private static final int LONG_POLL_FAILURE_DELAY_MS = 5000;\n  private static final int HTTP_CONNECT_TIMEOUT_MS = 5000;\n\n  private static final String DEBUGGER_MSG_DISABLE = \"{ \\\"id\\\":1,\\\"method\\\":\\\"Debugger.disable\\\" }\";\n\n  public interface OnServerContentChangeListener {\n    void onServerContentChanged();\n  }\n\n  public interface PackagerCommandListener {\n    void onPackagerConnected();\n    void onPackagerDisconnected();\n    void onPackagerReloadCommand();\n    void onPackagerDevMenuCommand();\n    void onCaptureHeapCommand(final Responder responder);\n    void onPokeSamplingProfilerCommand(final Responder responder);\n  }\n\n  public interface SymbolicationListener {\n    void onSymbolicationComplete(@Nullable Iterable<StackFrame> stackFrames);\n  }\n\n  private final DevInternalSettings mSettings;\n  private final OkHttpClient mClient;\n  private final Handler mRestartOnChangePollingHandler;\n  private final BundleDownloader mBundleDownloader;\n  private final String mPackageName;\n\n  private boolean mOnChangePollingEnabled;\n  private @Nullable JSPackagerClient mPackagerClient;\n  private @Nullable InspectorPackagerConnection mInspectorPackagerConnection;\n  private @Nullable OkHttpClient mOnChangePollingClient;\n  private @Nullable OnServerContentChangeListener mOnServerContentChangeListener;\n\n  public DevServerHelper(DevInternalSettings settings, String packageName) {\n    mSettings = settings;\n    mClient = new OkHttpClient.Builder()\n      .connectTimeout(HTTP_CONNECT_TIMEOUT_MS, TimeUnit.MILLISECONDS)\n      .readTimeout(0, TimeUnit.MILLISECONDS)\n      .writeTimeout(0, TimeUnit.MILLISECONDS)\n      .build();\n    mBundleDownloader = new BundleDownloader(mClient);\n\n    mRestartOnChangePollingHandler = new Handler();\n    mPackageName = packageName;\n  }\n\n  public void openPackagerConnection(\n      final String clientId, final PackagerCommandListener commandListener) {\n    if (mPackagerClient != null) {\n      FLog.w(ReactConstants.TAG, \"Packager connection already open, nooping.\");\n      return;\n    }\n    new AsyncTask<Void, Void, Void>() {\n      @Override\n      protected Void doInBackground(Void... backgroundParams) {\n        Map<String, RequestHandler> handlers = new HashMap<>();\n        handlers.put(\"reload\", new NotificationOnlyHandler() {\n          @Override\n          public void onNotification(@Nullable Object params) {\n            commandListener.onPackagerReloadCommand();\n          }\n        });\n        handlers.put(\"devMenu\", new NotificationOnlyHandler() {\n          @Override\n          public void onNotification(@Nullable Object params) {\n            commandListener.onPackagerDevMenuCommand();\n          }\n        });\n        handlers.put(\"captureHeap\", new RequestOnlyHandler() {\n          @Override\n          public void onRequest(@Nullable Object params, Responder responder) {\n            commandListener.onCaptureHeapCommand(responder);\n          }\n        });\n        handlers.put(\"pokeSamplingProfiler\", new RequestOnlyHandler() {\n          @Override\n          public void onRequest(@Nullable Object params, Responder responder) {\n            commandListener.onPokeSamplingProfilerCommand(responder);\n          }\n        });\n        handlers.putAll(new FileIoHandler().handlers());\n\n        ConnectionCallback onPackagerConnectedCallback =\n          new ConnectionCallback() {\n              @Override\n              public void onConnected() {\n                commandListener.onPackagerConnected();\n              }\n\n              @Override\n              public void onDisconnected() {\n                commandListener.onPackagerDisconnected();\n              }\n            };\n\n        mPackagerClient = new JSPackagerClient(\n            clientId,\n            mSettings.getPackagerConnectionSettings(),\n            handlers,\n            onPackagerConnectedCallback);\n        mPackagerClient.init();\n\n        return null;\n      }\n    }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  public void closePackagerConnection() {\n    new AsyncTask<Void, Void, Void>() {\n      @Override\n      protected Void doInBackground(Void... params) {\n        if (mPackagerClient != null) {\n          mPackagerClient.close();\n          mPackagerClient = null;\n        }\n        return null;\n      }\n    }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  public void openInspectorConnection() {\n    if (mInspectorPackagerConnection != null) {\n      FLog.w(ReactConstants.TAG, \"Inspector connection already open, nooping.\");\n      return;\n    }\n    new AsyncTask<Void, Void, Void>() {\n      @Override\n      protected Void doInBackground(Void... params) {\n        mInspectorPackagerConnection = new InspectorPackagerConnection(getInspectorDeviceUrl(), mPackageName);\n        mInspectorPackagerConnection.connect();\n        return null;\n      }\n    }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  public void sendEventToAllConnections(String event) {\n    if (mInspectorPackagerConnection != null) {\n      mInspectorPackagerConnection.sendEventToAllConnections(event);\n    }\n  }\n\n  public void disableDebugger() {\n    if (mInspectorPackagerConnection != null) {\n      mInspectorPackagerConnection.sendEventToAllConnections(DEBUGGER_MSG_DISABLE);\n    }\n  }\n\n  public void closeInspectorConnection() {\n    new AsyncTask<Void, Void, Void>() {\n      @Override\n      protected Void doInBackground(Void... params) {\n        if (mInspectorPackagerConnection != null) {\n          mInspectorPackagerConnection.closeQuietly();\n          mInspectorPackagerConnection = null;\n        }\n        return null;\n      }\n    }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  public void attachDebugger(final Context context, final String title) {\n    new AsyncTask<Void, String, Boolean>() {\n      @Override\n      protected Boolean doInBackground(Void... ignore) {\n        return doSync();\n      }\n\n      public boolean doSync() {\n        try {\n          String attachToNuclideUrl = getInspectorAttachUrl(title);\n          OkHttpClient client = new OkHttpClient();\n          Request request = new Request.Builder().url(attachToNuclideUrl).build();\n          client.newCall(request).execute();\n          return true;\n        } catch (IOException e) {\n          FLog.e(ReactConstants.TAG, \"Failed to send attach request to Inspector\", e);\n          return false;\n        }\n      }\n\n      @Override\n      protected void onPostExecute(Boolean result) {\n        if (!result) {\n          String message = context.getString(R.string.catalyst_debugjs_nuclide_failure);\n          Toast.makeText(context, message, Toast.LENGTH_LONG).show();\n        }\n      }\n    }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  public void symbolicateStackTrace(\n      Iterable<StackFrame> stackFrames,\n      final SymbolicationListener listener) {\n    try {\n      final String symbolicateURL = createSymbolicateURL(\n          mSettings.getPackagerConnectionSettings().getDebugServerHost());\n      final JSONArray jsonStackFrames = new JSONArray();\n      for (final StackFrame stackFrame : stackFrames) {\n        jsonStackFrames.put(stackFrame.toJSON());\n      }\n      final Request request = new Request.Builder()\n          .url(symbolicateURL)\n          .post(RequestBody.create(\n              MediaType.parse(\"application/json\"),\n              new JSONObject().put(\"stack\", jsonStackFrames).toString()))\n          .build();\n      Call symbolicateCall = Assertions.assertNotNull(mClient.newCall(request));\n      symbolicateCall.enqueue(new Callback() {\n        @Override\n        public void onFailure(Call call, IOException e) {\n          FLog.w(\n              ReactConstants.TAG,\n              \"Got IOException when attempting symbolicate stack trace: \" + e.getMessage());\n          listener.onSymbolicationComplete(null);\n        }\n\n        @Override\n        public void onResponse(Call call, final Response response) throws IOException {\n          try {\n            listener.onSymbolicationComplete(Arrays.asList(\n                StackTraceHelper.convertJsStackTrace(new JSONObject(\n                    response.body().string()).getJSONArray(\"stack\"))));\n          } catch (JSONException exception) {\n            listener.onSymbolicationComplete(null);\n          }\n        }\n      });\n    } catch (JSONException e) {\n      FLog.w(\n          ReactConstants.TAG,\n          \"Got JSONException when attempting symbolicate stack trace: \" + e.getMessage());\n    }\n  }\n\n  public void openStackFrameCall(StackFrame stackFrame) {\n    final String openStackFrameURL = createOpenStackFrameURL(\n        mSettings.getPackagerConnectionSettings().getDebugServerHost());\n    final Request request = new Request.Builder()\n        .url(openStackFrameURL)\n        .post(RequestBody.create(\n            MediaType.parse(\"application/json\"),\n            stackFrame.toJSON().toString()))\n        .build();\n    Call symbolicateCall = Assertions.assertNotNull(mClient.newCall(request));\n    symbolicateCall.enqueue(new Callback() {\n      @Override\n      public void onFailure(Call call, IOException e) {\n        FLog.w(\n            ReactConstants.TAG,\n            \"Got IOException when attempting to open stack frame: \" + e.getMessage());\n      }\n\n      @Override\n      public void onResponse(Call call, final Response response) throws IOException {\n        // We don't have a listener for this.\n      }\n    });\n  }\n\n    /** Intent action for reloading the JS */\n  public static String getReloadAppAction(Context context) {\n    return context.getPackageName() + RELOAD_APP_ACTION_SUFFIX;\n  }\n\n  public String getWebsocketProxyURL() {\n    return String.format(\n        Locale.US,\n        WEBSOCKET_PROXY_URL_FORMAT,\n        mSettings.getPackagerConnectionSettings().getDebugServerHost());\n  }\n\n  public String getHeapCaptureUploadUrl() {\n    return String.format(\n        Locale.US,\n        HEAP_CAPTURE_UPLOAD_URL_FORMAT,\n        mSettings.getPackagerConnectionSettings().getDebugServerHost());\n  }\n\n  public String getInspectorDeviceUrl() {\n    return String.format(\n        Locale.US,\n        INSPECTOR_DEVICE_URL_FORMAT,\n        mSettings.getPackagerConnectionSettings().getInspectorServerHost(),\n        AndroidInfoHelpers.getFriendlyDeviceName(),\n        mPackageName);\n  }\n\n  public String getInspectorAttachUrl(String title) {\n    return String.format(\n        Locale.US,\n        INSPECTOR_ATTACH_URL_FORMAT,\n        AndroidInfoHelpers.getServerHost(),\n        title,\n        mPackageName,\n        AndroidInfoHelpers.getFriendlyDeviceName());\n  }\n\n  public BundleDownloader getBundleDownloader() {\n    return mBundleDownloader;\n  }\n\n  /**\n   * @return the host to use when connecting to the bundle server from the host itself.\n   */\n  private String getHostForJSProxy() {\n    // Use custom port if configured. Note that host stays \"localhost\".\n    String host = Assertions.assertNotNull(\n      mSettings.getPackagerConnectionSettings().getDebugServerHost());\n    int portOffset = host.lastIndexOf(':');\n    if (portOffset > -1) {\n      return \"localhost\" + host.substring(portOffset);\n    } else {\n      return AndroidInfoHelpers.DEVICE_LOCALHOST;\n    }\n  }\n\n  /**\n   * @return whether we should enable dev mode when requesting JS bundles.\n   */\n  private boolean getDevMode() {\n    return mSettings.isJSDevModeEnabled();\n  }\n\n  /**\n   * @return whether we should request minified JS bundles.\n   */\n  private boolean getJSMinifyMode() {\n    return mSettings.isJSMinifyEnabled();\n  }\n\n  private static String createBundleURL(\n      String host, String jsModulePath, boolean devMode, boolean jsMinify, boolean useDeltas) {\n    return String.format(\n        Locale.US,\n        BUNDLE_URL_FORMAT,\n        host,\n        jsModulePath,\n        useDeltas ? \"delta\" : \"bundle\",\n        devMode,\n        jsMinify);\n  }\n\n  private static String createResourceURL(String host, String resourcePath) {\n    return String.format(Locale.US, RESOURCE_URL_FORMAT, host, resourcePath);\n  }\n\n  private static String createSymbolicateURL(String host) {\n    return String.format(Locale.US, SYMBOLICATE_URL_FORMAT, host);\n  }\n\n  private static String createOpenStackFrameURL(String host) {\n    return String.format(Locale.US, OPEN_STACK_FRAME_URL_FORMAT, host);\n  }\n\n  public String getDevServerBundleURL(final String jsModulePath) {\n    return createBundleURL(\n        mSettings.getPackagerConnectionSettings().getDebugServerHost(),\n        jsModulePath,\n        getDevMode(),\n        getJSMinifyMode(),\n        mSettings.isBundleDeltasEnabled());\n  }\n\n  public void isPackagerRunning(final PackagerStatusCallback callback) {\n    String statusURL = createPackagerStatusURL(\n        mSettings.getPackagerConnectionSettings().getDebugServerHost());\n    Request request = new Request.Builder()\n        .url(statusURL)\n        .build();\n\n    mClient.newCall(request).enqueue(\n        new Callback() {\n          @Override\n          public void onFailure(Call call, IOException e) {\n            FLog.w(\n                ReactConstants.TAG,\n                \"The packager does not seem to be running as we got an IOException requesting \" +\n                    \"its status: \" + e.getMessage());\n            callback.onPackagerStatusFetched(false);\n          }\n\n          @Override\n          public void onResponse(Call call, Response response) throws IOException {\n            if (!response.isSuccessful()) {\n              FLog.e(\n                  ReactConstants.TAG,\n                  \"Got non-success http code from packager when requesting status: \" +\n                      response.code());\n              callback.onPackagerStatusFetched(false);\n              return;\n            }\n            ResponseBody body = response.body();\n            if (body == null) {\n              FLog.e(\n                  ReactConstants.TAG,\n                  \"Got null body response from packager when requesting status\");\n              callback.onPackagerStatusFetched(false);\n              return;\n            }\n            if (!PACKAGER_OK_STATUS.equals(body.string())) {\n              FLog.e(\n                  ReactConstants.TAG,\n                  \"Got unexpected response from packager when requesting status: \" + body.string());\n              callback.onPackagerStatusFetched(false);\n              return;\n            }\n            callback.onPackagerStatusFetched(true);\n          }\n        });\n  }\n\n  private static String createPackagerStatusURL(String host) {\n    return String.format(Locale.US, PACKAGER_STATUS_URL_FORMAT, host);\n  }\n\n  public void stopPollingOnChangeEndpoint() {\n    mOnChangePollingEnabled = false;\n    mRestartOnChangePollingHandler.removeCallbacksAndMessages(null);\n    if (mOnChangePollingClient != null) {\n      OkHttpCallUtil.cancelTag(mOnChangePollingClient, this);\n      mOnChangePollingClient = null;\n    }\n    mOnServerContentChangeListener = null;\n  }\n\n  public void startPollingOnChangeEndpoint(\n      OnServerContentChangeListener onServerContentChangeListener) {\n    if (mOnChangePollingEnabled) {\n      // polling already enabled\n      return;\n    }\n    mOnChangePollingEnabled = true;\n    mOnServerContentChangeListener = onServerContentChangeListener;\n    mOnChangePollingClient = new OkHttpClient.Builder()\n        .connectionPool(new ConnectionPool(1, LONG_POLL_KEEP_ALIVE_DURATION_MS, TimeUnit.MINUTES))\n        .connectTimeout(HTTP_CONNECT_TIMEOUT_MS, TimeUnit.MILLISECONDS)\n        .build();\n    enqueueOnChangeEndpointLongPolling();\n  }\n\n  private void handleOnChangePollingResponse(boolean didServerContentChanged) {\n    if (mOnChangePollingEnabled) {\n      if (didServerContentChanged) {\n        UiThreadUtil.runOnUiThread(new Runnable() {\n          @Override\n          public void run() {\n            if (mOnServerContentChangeListener != null) {\n              mOnServerContentChangeListener.onServerContentChanged();\n            }\n          }\n        });\n      }\n      enqueueOnChangeEndpointLongPolling();\n    }\n  }\n\n  private void enqueueOnChangeEndpointLongPolling() {\n    Request request = new Request.Builder().url(createOnChangeEndpointUrl()).tag(this).build();\n    Assertions.assertNotNull(mOnChangePollingClient).newCall(request).enqueue(new Callback() {\n      @Override\n      public void onFailure(Call call, IOException e) {\n        if (mOnChangePollingEnabled) {\n          // this runnable is used by onchange endpoint poller to delay subsequent requests in case\n          // of a failure, so that we don't flood network queue with frequent requests in case when\n          // dev server is down\n          FLog.d(ReactConstants.TAG, \"Error while requesting /onchange endpoint\", e);\n          mRestartOnChangePollingHandler.postDelayed(\n              new Runnable() {\n            @Override\n            public void run() {\n              handleOnChangePollingResponse(false);\n            }\n          },\n              LONG_POLL_FAILURE_DELAY_MS);\n        }\n      }\n\n      @Override\n      public void onResponse(Call call, Response response) throws IOException {\n        handleOnChangePollingResponse(response.code() == 205);\n      }\n    });\n  }\n\n  private String createOnChangeEndpointUrl() {\n    return String.format(\n        Locale.US,\n        ONCHANGE_ENDPOINT_URL_FORMAT,\n        mSettings.getPackagerConnectionSettings().getDebugServerHost());\n  }\n\n  private String createLaunchJSDevtoolsCommandUrl() {\n    return String.format(\n        Locale.US,\n        LAUNCH_JS_DEVTOOLS_COMMAND_URL_FORMAT,\n        mSettings.getPackagerConnectionSettings().getDebugServerHost());\n  }\n\n  public void launchJSDevtools() {\n    Request request = new Request.Builder()\n        .url(createLaunchJSDevtoolsCommandUrl())\n        .build();\n    mClient.newCall(request).enqueue(new Callback() {\n      @Override\n      public void onFailure(Call call, IOException e) {\n        // ignore HTTP call response, this is just to open a debugger page and there is no reason\n        // to report failures from here\n      }\n\n      @Override\n      public void onResponse(Call call, Response response) throws IOException {\n        // ignore HTTP call response - see above\n      }\n    });\n  }\n\n  public String getSourceMapUrl(String mainModuleName) {\n    return String.format(\n        Locale.US,\n        BUNDLE_URL_FORMAT,\n        mSettings.getPackagerConnectionSettings().getDebugServerHost(),\n        mainModuleName,\n        \"map\",\n        getDevMode(),\n        getJSMinifyMode());\n  }\n\n  public String getSourceUrl(String mainModuleName) {\n    return String.format(\n        Locale.US,\n        BUNDLE_URL_FORMAT,\n        mSettings.getPackagerConnectionSettings().getDebugServerHost(),\n        mainModuleName,\n        mSettings.isBundleDeltasEnabled() ? \"delta\" : \"bundle\",\n        getDevMode(),\n        getJSMinifyMode());\n  }\n\n  public String getJSBundleURLForRemoteDebugging(String mainModuleName) {\n    // The host we use when connecting to the JS bundle server from the emulator is not the\n    // same as the one needed to connect to the same server from the JavaScript proxy running on the\n    // host itself.\n    return createBundleURL(\n        getHostForJSProxy(), mainModuleName, getDevMode(), getJSMinifyMode(), false);\n  }\n\n  /**\n   * This is a debug-only utility to allow fetching a file via packager.\n   * It's made synchronous for simplicity, but should only be used if it's absolutely\n   * necessary.\n   * @return the file with the fetched content, or null if there's any failure.\n   */\n  public @Nullable File downloadBundleResourceFromUrlSync(\n      final String resourcePath,\n      final File outputFile) {\n    final String resourceURL = createResourceURL(\n        mSettings.getPackagerConnectionSettings().getDebugServerHost(),\n        resourcePath);\n    final Request request = new Request.Builder()\n        .url(resourceURL)\n        .build();\n\n    try {\n      Response response = mClient.newCall(request).execute();\n      if (!response.isSuccessful()) {\n        return null;\n      }\n      Sink output = null;\n\n      try {\n        output = Okio.sink(outputFile);\n        Okio.buffer(response.body().source()).readAll(output);\n      } finally {\n        if (output != null) {\n          output.close();\n        }\n      }\n\n      return outputFile;\n    } catch (Exception ex) {\n      FLog.e(\n          ReactConstants.TAG,\n          \"Failed to fetch resource synchronously - resourcePath: \\\"%s\\\", outputFile: \\\"%s\\\"\",\n          resourcePath,\n          outputFile.getAbsolutePath(),\n          ex);\n      return null;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSettingsActivity.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.os.Bundle;\nimport android.preference.PreferenceActivity;\n\nimport com.facebook.react.R;\nimport com.facebook.react.common.DebugServerException;\n\n/**\n * Activity that display developers settings. Should be added to the debug manifest of the app. Can\n * be triggered through the developers option menu displayed by {@link DevSupportManager}.\n */\npublic class DevSettingsActivity extends PreferenceActivity {\n\n  @Override\n  public void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    setTitle(R.string.catalyst_settings_title);\n    addPreferencesFromResource(R.xml.preferences);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerFactory.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.content.Context;\n\nimport com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;\nimport com.facebook.react.devsupport.interfaces.DevSupportManager;\n\nimport java.lang.reflect.Constructor;\n\nimport javax.annotation.Nullable;\n\n/**\n * A simple factory that creates instances of {@link DevSupportManager} implementations. Uses\n * reflection to create DevSupportManagerImpl if it exists. This allows ProGuard to strip that class\n * and its dependencies in release builds. If the class isn't found,\n * {@link DisabledDevSupportManager} is returned instead.\n */\npublic class DevSupportManagerFactory {\n\n  private static final String DEVSUPPORT_IMPL_PACKAGE = \"com.facebook.react.devsupport\";\n  private static final String DEVSUPPORT_IMPL_CLASS = \"DevSupportManagerImpl\";\n\n  public static DevSupportManager create(\n      Context applicationContext,\n      ReactInstanceManagerDevHelper reactInstanceManagerHelper,\n      @Nullable String packagerPathForJSBundleName,\n      boolean enableOnCreate,\n      int minNumShakes) {\n\n    return create(\n      applicationContext,\n      reactInstanceManagerHelper,\n      packagerPathForJSBundleName,\n      enableOnCreate,\n      null,\n      null,\n      minNumShakes);\n  }\n\n  public static DevSupportManager create(\n    Context applicationContext,\n    ReactInstanceManagerDevHelper reactInstanceManagerHelper,\n    @Nullable String packagerPathForJSBundleName,\n    boolean enableOnCreate,\n    @Nullable RedBoxHandler redBoxHandler,\n    @Nullable DevBundleDownloadListener devBundleDownloadListener,\n    int minNumShakes) {\n    if (!enableOnCreate) {\n      return new DisabledDevSupportManager();\n    }\n    try {\n      // ProGuard is surprisingly smart in this case and will keep a class if it detects a call to\n      // Class.forName() with a static string. So instead we generate a quasi-dynamic string to\n      // confuse it.\n      String className =\n        new StringBuilder(DEVSUPPORT_IMPL_PACKAGE)\n          .append(\".\")\n          .append(DEVSUPPORT_IMPL_CLASS)\n          .toString();\n      Class<?> devSupportManagerClass =\n        Class.forName(className);\n      Constructor constructor =\n        devSupportManagerClass.getConstructor(\n          Context.class,\n          ReactInstanceManagerDevHelper.class,\n          String.class,\n          boolean.class,\n          RedBoxHandler.class,\n          DevBundleDownloadListener.class,\n          int.class);\n      return (DevSupportManager) constructor.newInstance(\n        applicationContext,\n        reactInstanceManagerHelper,\n        packagerPathForJSBundleName,\n        true,\n        redBoxHandler,\n        devBundleDownloadListener,\n        minNumShakes);\n    } catch (Exception e) {\n      throw new RuntimeException(\n        \"Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found\" +\n          \" or could not be created\",\n        e);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerImpl.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.app.Activity;\nimport android.app.ActivityManager;\nimport android.app.AlertDialog;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.content.IntentFilter;\nimport android.content.pm.PackageInfo;\nimport android.content.pm.PackageManager;\nimport android.hardware.SensorManager;\nimport android.net.Uri;\nimport android.os.AsyncTask;\nimport android.util.Pair;\nimport android.widget.Toast;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.debug.holder.PrinterHolder;\nimport com.facebook.debug.tags.ReactDebugOverlayTags;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.R;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.DefaultNativeModuleCallExceptionHandler;\nimport com.facebook.react.bridge.JavaJSExecutor;\nimport com.facebook.react.bridge.JavaScriptContextHolder;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReactMarker;\nimport com.facebook.react.bridge.ReactMarkerConstants;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.common.DebugServerException;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.common.ShakeDetector;\nimport com.facebook.react.common.futures.SimpleSettableFuture;\nimport com.facebook.react.devsupport.DevServerHelper.PackagerCommandListener;\nimport com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;\nimport com.facebook.react.devsupport.interfaces.DevOptionHandler;\nimport com.facebook.react.devsupport.interfaces.DevSupportManager;\nimport com.facebook.react.devsupport.interfaces.ErrorCustomizer;\nimport com.facebook.react.devsupport.interfaces.PackagerStatusCallback;\nimport com.facebook.react.devsupport.interfaces.StackFrame;\nimport com.facebook.react.modules.debug.interfaces.DeveloperSettings;\nimport com.facebook.react.packagerconnection.RequestHandler;\nimport com.facebook.react.packagerconnection.Responder;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport java.util.ArrayList;\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.concurrent.ExecutionException;\nimport java.util.concurrent.TimeUnit;\nimport java.util.concurrent.TimeoutException;\n\nimport javax.annotation.Nullable;\n\nimport okhttp3.MediaType;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\n\n/**\n * Interface for accessing and interacting with development features. Following features\n * are supported through this manager class:\n * 1) Displaying JS errors (aka RedBox)\n * 2) Displaying developers menu (Reload JS, Debug JS)\n * 3) Communication with developer server in order to download updated JS bundle\n * 4) Starting/stopping broadcast receiver for js reload signals\n * 5) Starting/stopping motion sensor listener that recognize shake gestures which in turn may\n *    trigger developers menu.\n * 6) Launching developers settings view\n *\n * This class automatically monitors the state of registered views and activities to which they are\n * bound to make sure that we don't display overlay or that we we don't listen for sensor events\n * when app is backgrounded.\n *\n * {@link ReactInstanceManager} implementation is responsible for instantiating this class\n * as well as for populating with a referece to {@link CatalystInstance} whenever instance\n * manager recreates it (through {@link #onNewReactContextCreated). Also, instance manager is\n * responsible for enabling/disabling dev support in case when app is backgrounded or when all the\n * views has been detached from the instance (through {@link #setDevSupportEnabled} method).\n *\n * IMPORTANT: In order for developer support to work correctly it is required that the\n * manifest of your application contain the following entries:\n * {@code <activity android:name=\"com.facebook.react.devsupport.DevSettingsActivity\"/>}\n * {@code <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>}\n */\npublic class DevSupportManagerImpl implements\n    DevSupportManager,\n    PackagerCommandListener,\n    DevInternalSettings.Listener {\n\n  private static final int JAVA_ERROR_COOKIE = -1;\n  private static final int JSEXCEPTION_ERROR_COOKIE = -1;\n  private static final String JS_BUNDLE_FILE_NAME = \"ReactNativeDevBundle.js\";\n  private static enum ErrorType {\n    JS,\n    NATIVE\n  }\n\n  private static final String EXOPACKAGE_LOCATION_FORMAT\n      = \"/data/local/tmp/exopackage/%s//secondary-dex\";\n\n  public static final String EMOJI_HUNDRED_POINTS_SYMBOL = \" \\uD83D\\uDCAF\";\n  public static final String EMOJI_FACE_WITH_NO_GOOD_GESTURE = \" \\uD83D\\uDE45\";\n\n  private final Context mApplicationContext;\n  private final ShakeDetector mShakeDetector;\n  private final BroadcastReceiver mReloadAppBroadcastReceiver;\n  private final DevServerHelper mDevServerHelper;\n  private final LinkedHashMap<String, DevOptionHandler> mCustomDevOptions =\n      new LinkedHashMap<>();\n  private final ReactInstanceManagerDevHelper mReactInstanceManagerHelper;\n  private final @Nullable String mJSAppBundleName;\n  private final File mJSBundleTempFile;\n  private final DefaultNativeModuleCallExceptionHandler mDefaultNativeModuleCallExceptionHandler;\n  private final DevLoadingViewController mDevLoadingViewController;\n\n  private @Nullable RedBoxDialog mRedBoxDialog;\n  private @Nullable AlertDialog mDevOptionsDialog;\n  private @Nullable DebugOverlayController mDebugOverlayController;\n  private boolean mDevLoadingViewVisible = false;\n  private @Nullable ReactContext mCurrentContext;\n  private DevInternalSettings mDevSettings;\n  private boolean mIsReceiverRegistered = false;\n  private boolean mIsShakeDetectorStarted = false;\n  private boolean mIsDevSupportEnabled = false;\n  private @Nullable RedBoxHandler mRedBoxHandler;\n  private @Nullable String mLastErrorTitle;\n  private @Nullable StackFrame[] mLastErrorStack;\n  private int mLastErrorCookie = 0;\n  private @Nullable ErrorType mLastErrorType;\n  private @Nullable DevBundleDownloadListener mBundleDownloadListener;\n  private @Nullable List<ErrorCustomizer> mErrorCustomizers;\n\n  private static class JscProfileTask extends AsyncTask<String, Void, Void> {\n    private static final MediaType JSON =\n      MediaType.parse(\"application/json; charset=utf-8\");\n\n    private final String mSourceUrl;\n\n    private JscProfileTask(String sourceUrl) {\n      mSourceUrl = sourceUrl;\n    }\n\n    @Override\n    protected Void doInBackground(String... jsonData) {\n      try {\n        String jscProfileUrl =\n            Uri.parse(mSourceUrl).buildUpon()\n                .path(\"/jsc-profile\")\n                .query(null)\n                .build()\n                .toString();\n        OkHttpClient client = new OkHttpClient();\n        for (String json: jsonData) {\n          RequestBody body = RequestBody.create(JSON, json);\n          Request request =\n            new Request.Builder().url(jscProfileUrl).post(body).build();\n          client.newCall(request).execute();\n        }\n      } catch (IOException e) {\n        FLog.e(ReactConstants.TAG, \"Failed not talk to server\", e);\n      }\n      return null;\n    }\n  }\n\n  public DevSupportManagerImpl(\n    Context applicationContext,\n    ReactInstanceManagerDevHelper reactInstanceManagerHelper,\n    @Nullable String packagerPathForJSBundleName,\n    boolean enableOnCreate,\n    int minNumShakes) {\n\n    this(applicationContext,\n      reactInstanceManagerHelper,\n      packagerPathForJSBundleName,\n      enableOnCreate,\n      null,\n      null,\n      minNumShakes);\n  }\n\n  public DevSupportManagerImpl(\n      Context applicationContext,\n      ReactInstanceManagerDevHelper reactInstanceManagerHelper,\n      @Nullable String packagerPathForJSBundleName,\n      boolean enableOnCreate,\n      @Nullable RedBoxHandler redBoxHandler,\n      @Nullable DevBundleDownloadListener devBundleDownloadListener,\n      int minNumShakes) {\n    mReactInstanceManagerHelper = reactInstanceManagerHelper;\n    mApplicationContext = applicationContext;\n    mJSAppBundleName = packagerPathForJSBundleName;\n    mDevSettings = new DevInternalSettings(applicationContext, this);\n    mDevServerHelper = new DevServerHelper(mDevSettings, mApplicationContext.getPackageName());\n    mBundleDownloadListener = devBundleDownloadListener;\n\n    // Prepare shake gesture detector (will be started/stopped from #reload)\n    mShakeDetector = new ShakeDetector(new ShakeDetector.ShakeListener() {\n      @Override\n      public void onShake() {\n        showDevOptionsDialog();\n      }\n    }, minNumShakes);\n\n    // Prepare reload APP broadcast receiver (will be registered/unregistered from #reload)\n    mReloadAppBroadcastReceiver = new BroadcastReceiver() {\n      @Override\n      public void onReceive(Context context, Intent intent) {\n        String action = intent.getAction();\n        if (DevServerHelper.getReloadAppAction(context).equals(action)) {\n          if (intent.getBooleanExtra(DevServerHelper.RELOAD_APP_EXTRA_JS_PROXY, false)) {\n            mDevSettings.setRemoteJSDebugEnabled(true);\n            mDevServerHelper.launchJSDevtools();\n          } else {\n            mDevSettings.setRemoteJSDebugEnabled(false);\n          }\n          handleReloadJS();\n        }\n      }\n    };\n\n    // We store JS bundle loaded from dev server in a single destination in app's data dir.\n    // In case when someone schedule 2 subsequent reloads it may happen that JS thread will\n    // start reading first reload output while the second reload starts writing to the same\n    // file. As this should only be the case in dev mode we leave it as it is.\n    // TODO(6418010): Fix readers-writers problem in debug reload from HTTP server\n    mJSBundleTempFile = new File(applicationContext.getFilesDir(), JS_BUNDLE_FILE_NAME);\n\n    mDefaultNativeModuleCallExceptionHandler = new DefaultNativeModuleCallExceptionHandler();\n\n    setDevSupportEnabled(enableOnCreate);\n\n    mRedBoxHandler = redBoxHandler;\n    mDevLoadingViewController =\n            new DevLoadingViewController(applicationContext, reactInstanceManagerHelper);\n  }\n\n  @Override\n  public void handleException(Exception e) {\n    if (mIsDevSupportEnabled) {\n      String message = e.getMessage();\n      Throwable cause = e.getCause();\n      while (cause != null) {\n        message += \"\\n\\n\" + cause.getMessage();\n        cause = cause.getCause();\n      }\n\n      if (e instanceof JSException) {\n        FLog.e(ReactConstants.TAG, \"Exception in native call from JS\", e);\n        message += \"\\n\\n\" + ((JSException) e).getStack();\n\n        // TODO #11638796: convert the stack into something useful\n        showNewError(message, new StackFrame[] {}, JSEXCEPTION_ERROR_COOKIE, ErrorType.JS);\n      } else {\n        showNewJavaError(message, e);\n      }\n    } else {\n      mDefaultNativeModuleCallExceptionHandler.handleException(e);\n    }\n  }\n\n  @Override\n  public void showNewJavaError(String message, Throwable e) {\n    FLog.e(ReactConstants.TAG, \"Exception in native call\", e);\n    showNewError(message, StackTraceHelper.convertJavaStackTrace(e), JAVA_ERROR_COOKIE, ErrorType.NATIVE);\n  }\n\n  /**\n   * Add option item to dev settings dialog displayed by this manager. In the case user select given\n   * option from that dialog, the appropriate handler passed as {@param optionHandler} will be\n   * called.\n   */\n  @Override\n  public void addCustomDevOption(\n      String optionName,\n      DevOptionHandler optionHandler) {\n    mCustomDevOptions.put(optionName, optionHandler);\n  }\n\n  @Override\n  public void showNewJSError(String message, ReadableArray details, int errorCookie) {\n    showNewError(message, StackTraceHelper.convertJsStackTrace(details), errorCookie, ErrorType.JS);\n  }\n\n  @Override\n  public void registerErrorCustomizer(ErrorCustomizer errorCustomizer){\n    if (mErrorCustomizers == null){\n      mErrorCustomizers = new ArrayList<>();\n    }\n    mErrorCustomizers.add(errorCustomizer);\n  }\n\n  private Pair<String, StackFrame[]> processErrorCustomizers(\n      Pair<String, StackFrame[]> errorInfo) {\n    if (mErrorCustomizers == null) {\n      return errorInfo;\n    } else {\n      for (ErrorCustomizer errorCustomizer : mErrorCustomizers) {\n        Pair<String, StackFrame[]> result = errorCustomizer.customizeErrorInfo(errorInfo);\n        if (result != null) {\n          errorInfo = result;\n        }\n      }\n      return errorInfo;\n    }\n  }\n\n  @Override\n  public void updateJSError(\n      final String message,\n      final ReadableArray details,\n      final int errorCookie) {\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            // Since we only show the first JS error in a succession of JS errors, make sure we only\n            // update the error message for that error message. This assumes that updateJSError\n            // belongs to the most recent showNewJSError\n            if (mRedBoxDialog == null ||\n                !mRedBoxDialog.isShowing() ||\n                errorCookie != mLastErrorCookie) {\n              return;\n            }\n            StackFrame[] stack = StackTraceHelper.convertJsStackTrace(details);\n            Pair<String, StackFrame[]> errorInfo =\n                processErrorCustomizers(Pair.create(message, stack));\n            mRedBoxDialog.setExceptionDetails(errorInfo.first, errorInfo.second);\n            updateLastErrorInfo(message, stack, errorCookie, ErrorType.JS);\n            // JS errors are reported here after source mapping.\n            if (mRedBoxHandler != null) {\n              mRedBoxHandler.handleRedbox(message, stack, RedBoxHandler.ErrorType.JS);\n              mRedBoxDialog.resetReporting(true);\n            }\n            mRedBoxDialog.show();\n          }\n        });\n  }\n\n  @Override\n  public void hideRedboxDialog() {\n    // dismiss redbox if exists\n    if (mRedBoxDialog != null) {\n      mRedBoxDialog.dismiss();\n    }\n  }\n\n  private void showNewError(\n      final String message,\n      final StackFrame[] stack,\n      final int errorCookie,\n      final ErrorType errorType) {\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            if (mRedBoxDialog == null) {\n              Activity context = mReactInstanceManagerHelper.getCurrentActivity();\n              if (context == null || context.isFinishing()) {\n                FLog.e(ReactConstants.TAG, \"Unable to launch redbox because react activity \" +\n                        \"is not available, here is the error that redbox would've displayed: \" + message);\n                return;\n              }\n              mRedBoxDialog = new RedBoxDialog(context, DevSupportManagerImpl.this, mRedBoxHandler);\n            }\n            if (mRedBoxDialog.isShowing()) {\n              // Sometimes errors cause multiple errors to be thrown in JS in quick succession. Only\n              // show the first and most actionable one.\n              return;\n            }\n            Pair<String, StackFrame[]> errorInfo = processErrorCustomizers(Pair.create(message, stack));\n            mRedBoxDialog.setExceptionDetails(errorInfo.first, errorInfo.second);\n            updateLastErrorInfo(message, stack, errorCookie, errorType);\n            // Only report native errors here. JS errors are reported\n            // inside {@link #updateJSError} after source mapping.\n            if (mRedBoxHandler != null && errorType == ErrorType.NATIVE) {\n              mRedBoxHandler.handleRedbox(message, stack, RedBoxHandler.ErrorType.NATIVE);\n              mRedBoxDialog.resetReporting(true);\n            } else {\n              mRedBoxDialog.resetReporting(false);\n            }\n            mRedBoxDialog.show();\n          }\n        });\n  }\n\n  @Override\n  public void showDevOptionsDialog() {\n    if (mDevOptionsDialog != null || !mIsDevSupportEnabled || ActivityManager.isUserAMonkey()) {\n      return;\n    }\n    LinkedHashMap<String, DevOptionHandler> options = new LinkedHashMap<>();\n    /* register standard options */\n    options.put(\n        mApplicationContext.getString(R.string.catalyst_reloadjs),\n        new DevOptionHandler() {\n          @Override\n          public void onOptionSelected() {\n            handleReloadJS();\n          }\n        });\n    if (mDevSettings.isNuclideJSDebugEnabled()) {\n      // The concatenation is applied directly here because XML isn't emoji-friendly\n      String nuclideJsDebugMenuItemTitle =\n          mApplicationContext.getString(R.string.catalyst_debugjs_nuclide)\n              + EMOJI_HUNDRED_POINTS_SYMBOL;\n      options.put(\n          nuclideJsDebugMenuItemTitle,\n          new DevOptionHandler() {\n            @Override\n            public void onOptionSelected() {\n              mDevServerHelper.attachDebugger(mApplicationContext, \"ReactNative\");\n            }\n          });\n    }\n    String remoteJsDebugMenuItemTitle =\n        mDevSettings.isRemoteJSDebugEnabled()\n            ? mApplicationContext.getString(R.string.catalyst_debugjs_off)\n            : mApplicationContext.getString(R.string.catalyst_debugjs);\n    if (mDevSettings.isNuclideJSDebugEnabled()) {\n      remoteJsDebugMenuItemTitle += EMOJI_FACE_WITH_NO_GOOD_GESTURE;\n    }\n    options.put(\n        remoteJsDebugMenuItemTitle,\n        new DevOptionHandler() {\n          @Override\n          public void onOptionSelected() {\n            mDevSettings.setRemoteJSDebugEnabled(!mDevSettings.isRemoteJSDebugEnabled());\n            handleReloadJS();\n          }\n        });\n    options.put(\n      mDevSettings.isReloadOnJSChangeEnabled()\n        ? mApplicationContext.getString(R.string.catalyst_live_reload_off)\n        : mApplicationContext.getString(R.string.catalyst_live_reload),\n      new DevOptionHandler() {\n        @Override\n        public void onOptionSelected() {\n          mDevSettings.setReloadOnJSChangeEnabled(!mDevSettings.isReloadOnJSChangeEnabled());\n        }\n      });\n    options.put(\n            mDevSettings.isHotModuleReplacementEnabled()\n                    ? mApplicationContext.getString(R.string.catalyst_hot_module_replacement_off)\n                    : mApplicationContext.getString(R.string.catalyst_hot_module_replacement),\n            new DevOptionHandler() {\n              @Override\n              public void onOptionSelected() {\n                mDevSettings.setHotModuleReplacementEnabled(!mDevSettings.isHotModuleReplacementEnabled());\n                handleReloadJS();\n              }\n            });\n    options.put(\n        mApplicationContext.getString(R.string.catalyst_element_inspector),\n        new DevOptionHandler() {\n          @Override\n          public void onOptionSelected() {\n            mDevSettings.setElementInspectorEnabled(!mDevSettings.isElementInspectorEnabled());\n            mReactInstanceManagerHelper.toggleElementInspector();\n          }\n        });\n    options.put(\n      mDevSettings.isFpsDebugEnabled()\n        ? mApplicationContext.getString(R.string.catalyst_perf_monitor_off)\n        : mApplicationContext.getString(R.string.catalyst_perf_monitor),\n      new DevOptionHandler() {\n        @Override\n        public void onOptionSelected() {\n          if (!mDevSettings.isFpsDebugEnabled()) {\n            // Request overlay permission if needed when \"Show Perf Monitor\" option is selected\n            Context context = mReactInstanceManagerHelper.getCurrentActivity();\n            if (context == null) {\n              FLog.e(ReactConstants.TAG, \"Unable to get reference to react activity\");\n            } else {\n              DebugOverlayController.requestPermission(context);\n            }\n          }\n          mDevSettings.setFpsDebugEnabled(!mDevSettings.isFpsDebugEnabled());\n        }\n      });\n    options.put(\n        mApplicationContext.getString(R.string.catalyst_poke_sampling_profiler),\n        new DevOptionHandler() {\n          @Override\n          public void onOptionSelected() {\n            handlePokeSamplingProfiler();\n          }\n        });\n    options.put(\n        mApplicationContext.getString(R.string.catalyst_settings), new DevOptionHandler() {\n          @Override\n          public void onOptionSelected() {\n            Intent intent = new Intent(mApplicationContext, DevSettingsActivity.class);\n            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n            mApplicationContext.startActivity(intent);\n          }\n        });\n\n    if (mCustomDevOptions.size() > 0) {\n      options.putAll(mCustomDevOptions);\n    }\n\n    final DevOptionHandler[] optionHandlers = options.values().toArray(new DevOptionHandler[0]);\n\n    Activity context = mReactInstanceManagerHelper.getCurrentActivity();\n    if (context == null || context.isFinishing()) {\n      FLog.e(ReactConstants.TAG, \"Unable to launch dev options menu because react activity \" +\n              \"isn't available\");\n      return;\n    }\n    mDevOptionsDialog =\n        new AlertDialog.Builder(context)\n            .setItems(\n                options.keySet().toArray(new String[0]),\n                new DialogInterface.OnClickListener() {\n                  @Override\n                  public void onClick(DialogInterface dialog, int which) {\n                    optionHandlers[which].onOptionSelected();\n                    mDevOptionsDialog = null;\n                  }\n                })\n            .setOnCancelListener(new DialogInterface.OnCancelListener() {\n              @Override\n              public void onCancel(DialogInterface dialog) {\n                mDevOptionsDialog = null;\n              }\n            })\n            .create();\n    mDevOptionsDialog.show();\n  }\n\n  /**\n   * {@link ReactInstanceDevCommandsHandler} is responsible for\n   * enabling/disabling dev support when a React view is attached/detached\n   * or when application state changes (e.g. the application is backgrounded).\n   */\n  @Override\n  public void setDevSupportEnabled(boolean isDevSupportEnabled) {\n    mIsDevSupportEnabled = isDevSupportEnabled;\n    reloadSettings();\n  }\n\n  @Override\n  public boolean getDevSupportEnabled() {\n    return mIsDevSupportEnabled;\n  }\n\n  @Override\n  public DeveloperSettings getDevSettings() {\n    return mDevSettings;\n  }\n\n  @Override\n  public void onNewReactContextCreated(ReactContext reactContext) {\n    resetCurrentContext(reactContext);\n  }\n\n  @Override\n  public void onReactInstanceDestroyed(ReactContext reactContext) {\n    if (reactContext == mCurrentContext) {\n      // only call reset context when the destroyed context matches the one that is currently set\n      // for this manager\n      resetCurrentContext(null);\n    }\n  }\n\n  @Override\n  public String getSourceMapUrl() {\n    if (mJSAppBundleName == null) {\n      return \"\";\n    }\n\n    return mDevServerHelper.getSourceMapUrl(Assertions.assertNotNull(mJSAppBundleName));\n  }\n\n  @Override\n  public String getSourceUrl() {\n    if (mJSAppBundleName == null) {\n      return \"\";\n    }\n\n    return mDevServerHelper.getSourceUrl(Assertions.assertNotNull(mJSAppBundleName));\n  }\n\n  @Override\n  public String getJSBundleURLForRemoteDebugging() {\n    return mDevServerHelper.getJSBundleURLForRemoteDebugging(\n        Assertions.assertNotNull(mJSAppBundleName));\n  }\n\n  @Override\n  public String getDownloadedJSBundleFile() {\n    return mJSBundleTempFile.getAbsolutePath();\n  }\n\n  /**\n   * @return {@code true} if {@link com.facebook.react.ReactInstanceManager} should use downloaded JS bundle file\n   * instead of using JS file from assets. This may happen when app has not been updated since\n   * the last time we fetched the bundle.\n   */\n  @Override\n  public boolean hasUpToDateJSBundleInCache() {\n    if (mIsDevSupportEnabled && mJSBundleTempFile.exists()) {\n      try {\n        String packageName = mApplicationContext.getPackageName();\n        PackageInfo thisPackage = mApplicationContext.getPackageManager()\n            .getPackageInfo(packageName, 0);\n        if (mJSBundleTempFile.lastModified() > thisPackage.lastUpdateTime) {\n          // Base APK has not been updated since we downloaded JS, but if app is using exopackage\n          // it may only be a single dex that has been updated. We check for exopackage dir update\n          // time in that case.\n          File exopackageDir = new File(\n              String.format(Locale.US, EXOPACKAGE_LOCATION_FORMAT, packageName));\n          if (exopackageDir.exists()) {\n            return mJSBundleTempFile.lastModified() > exopackageDir.lastModified();\n          }\n          return true;\n        }\n      } catch (PackageManager.NameNotFoundException e) {\n        // Ignore this error and just fallback to loading JS from assets\n        FLog.e(ReactConstants.TAG, \"DevSupport is unable to get current app info\");\n      }\n    }\n    return false;\n  }\n\n  /**\n   * @return {@code true} if JS bundle {@param bundleAssetName} exists, in that case\n   * {@link ReactInstanceManager} should use that file from assets instead of downloading bundle\n   * from dev server\n   */\n  public boolean hasBundleInAssets(String bundleAssetName) {\n    try {\n      String[] assets = mApplicationContext.getAssets().list(\"\");\n      for (int i = 0; i < assets.length; i++) {\n        if (assets[i].equals(bundleAssetName)) {\n          return true;\n        }\n      }\n    } catch (IOException e) {\n      // Ignore this error and just fallback to downloading JS from devserver\n      FLog.e(ReactConstants.TAG, \"Error while loading assets list\");\n    }\n    return false;\n  }\n\n  private void resetCurrentContext(@Nullable ReactContext reactContext) {\n    if (mCurrentContext == reactContext) {\n      // new context is the same as the old one - do nothing\n      return;\n    }\n\n    mCurrentContext = reactContext;\n\n    // Recreate debug overlay controller with new CatalystInstance object\n    if (mDebugOverlayController != null) {\n      mDebugOverlayController.setFpsDebugViewVisible(false);\n    }\n    if (reactContext != null) {\n      mDebugOverlayController = new DebugOverlayController(reactContext);\n    }\n\n    if (mDevSettings.isHotModuleReplacementEnabled() && mCurrentContext != null) {\n      try {\n        URL sourceUrl = new URL(getSourceUrl());\n        String path = sourceUrl.getPath().substring(1); // strip initial slash in path\n        String host = sourceUrl.getHost();\n        int port = sourceUrl.getPort();\n        mCurrentContext.getJSModule(HMRClient.class).enable(\"android\", path, host, port);\n      } catch (MalformedURLException e) {\n        showNewJavaError(e.getMessage(), e);\n      }\n    }\n\n    reloadSettings();\n  }\n\n  @Override\n  public void reloadSettings() {\n    if (UiThreadUtil.isOnUiThread()) {\n      reload();\n    } else {\n      UiThreadUtil.runOnUiThread(new Runnable() {\n        @Override\n        public void run() {\n          reload();\n        }\n      });\n    }\n  }\n\n  public void onInternalSettingsChanged() { reloadSettings(); }\n\n  @Override\n  public void handleReloadJS() {\n\n    UiThreadUtil.assertOnUiThread();\n\n    ReactMarker.logMarker(ReactMarkerConstants.RELOAD);\n\n    // dismiss redbox if exists\n    if (mRedBoxDialog != null) {\n      mRedBoxDialog.dismiss();\n    }\n\n    if (mDevSettings.isRemoteJSDebugEnabled()) {\n      PrinterHolder.getPrinter()\n          .logMessage(ReactDebugOverlayTags.RN_CORE, \"RNCore: load from Proxy\");\n      mDevLoadingViewController.showForRemoteJSEnabled();\n      mDevLoadingViewVisible = true;\n      reloadJSInProxyMode();\n    } else {\n      PrinterHolder.getPrinter()\n          .logMessage(ReactDebugOverlayTags.RN_CORE, \"RNCore: load from Server\");\n      String bundleURL =\n        mDevServerHelper.getDevServerBundleURL(Assertions.assertNotNull(mJSAppBundleName));\n      reloadJSFromServer(bundleURL);\n    }\n  }\n\n  @Override\n  public void isPackagerRunning(PackagerStatusCallback callback) {\n    mDevServerHelper.isPackagerRunning(callback);\n  }\n\n  @Override\n  public @Nullable File downloadBundleResourceFromUrlSync(\n      final String resourceURL,\n      final File outputFile) {\n    return mDevServerHelper.downloadBundleResourceFromUrlSync(resourceURL, outputFile);\n  }\n\n  @Override\n  public @Nullable String getLastErrorTitle() {\n    return mLastErrorTitle;\n  }\n\n  @Override\n  public @Nullable StackFrame[] getLastErrorStack() {\n    return mLastErrorStack;\n  }\n\n  @Override\n  public void onPackagerConnected() {\n    // No-op\n  }\n\n  @Override\n  public void onPackagerDisconnected() {\n    // No-op\n  }\n\n  @Override\n  public void onPackagerReloadCommand() {\n    // Disable debugger to resume the JsVM & avoid thread locks while reloading\n    mDevServerHelper.disableDebugger();\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        handleReloadJS();\n      }\n    });\n  }\n\n  @Override\n  public void onPackagerDevMenuCommand() {\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        showDevOptionsDialog();\n      }\n    });\n  }\n\n  @Override\n  public void onCaptureHeapCommand(final Responder responder) {\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        handleCaptureHeap(responder);\n      }\n    });\n  }\n\n  @Override\n  public void onPokeSamplingProfilerCommand(final Responder responder) {\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        if (mCurrentContext == null) {\n          responder.error(\"JSCContext is missing, unable to profile\");\n          return;\n        }\n        try {\n          JavaScriptContextHolder jsContext = mCurrentContext.getJavaScriptContextHolder();\n          synchronized (jsContext) {\n            Class clazz = Class.forName(\"com.facebook.react.packagerconnection.SamplingProfilerPackagerMethod\");\n            RequestHandler handler = (RequestHandler)clazz.getConstructor(long.class).newInstance(jsContext.get());\n            handler.onRequest(null, responder);\n          }\n        } catch (Exception e) {\n          // Module not present\n        }\n      }\n    });\n  }\n\n  private void handleCaptureHeap(final Responder responder) {\n    if (mCurrentContext == null) {\n      return;\n    }\n    JSCHeapCapture heapCapture = mCurrentContext.getNativeModule(JSCHeapCapture.class);\n    heapCapture.captureHeap(\n      mApplicationContext.getCacheDir().getPath(),\n      new JSCHeapCapture.CaptureCallback() {\n        @Override\n        public void onSuccess(File capture) {\n          responder.respond(capture.toString());\n        }\n\n        @Override\n        public void onFailure(JSCHeapCapture.CaptureException error) {\n          responder.error(error.toString());\n        }\n      });\n  }\n\n  private void handlePokeSamplingProfiler() {\n    try {\n      List<String> pokeResults = JSCSamplingProfiler.poke(60000);\n      for (String result : pokeResults) {\n        Toast.makeText(\n          mCurrentContext,\n          result == null\n            ? \"Started JSC Sampling Profiler\"\n            : \"Stopped JSC Sampling Profiler\",\n          Toast.LENGTH_LONG).show();\n        new JscProfileTask(getSourceUrl()).executeOnExecutor(\n            AsyncTask.THREAD_POOL_EXECUTOR,\n            result);\n      }\n    } catch (JSCSamplingProfiler.ProfilerException e) {\n      showNewJavaError(e.getMessage(), e);\n    }\n  }\n\n  private void updateLastErrorInfo(\n      final String message,\n      final StackFrame[] stack,\n      final int errorCookie,\n      final ErrorType errorType) {\n    mLastErrorTitle = message;\n    mLastErrorStack = stack;\n    mLastErrorCookie = errorCookie;\n    mLastErrorType = errorType;\n  }\n\n  private void reloadJSInProxyMode() {\n    // When using js proxy, there is no need to fetch JS bundle as proxy executor will do that\n    // anyway\n    mDevServerHelper.launchJSDevtools();\n\n    JavaJSExecutor.Factory factory = new JavaJSExecutor.Factory() {\n      @Override\n      public JavaJSExecutor create() throws Exception {\n        WebsocketJavaScriptExecutor executor = new WebsocketJavaScriptExecutor();\n        SimpleSettableFuture<Boolean> future = new SimpleSettableFuture<>();\n        executor.connect(\n            mDevServerHelper.getWebsocketProxyURL(),\n            getExecutorConnectCallback(future));\n        // TODO(t9349129) Don't use timeout\n        try {\n          future.get(90, TimeUnit.SECONDS);\n          return executor;\n        } catch (ExecutionException e) {\n          throw (Exception) e.getCause();\n        } catch (InterruptedException | TimeoutException e) {\n          throw new RuntimeException(e);\n        }\n      }\n    };\n    mReactInstanceManagerHelper.onReloadWithJSDebugger(factory);\n  }\n\n  private WebsocketJavaScriptExecutor.JSExecutorConnectCallback getExecutorConnectCallback(\n      final SimpleSettableFuture<Boolean> future) {\n    return new WebsocketJavaScriptExecutor.JSExecutorConnectCallback() {\n      @Override\n      public void onSuccess() {\n        future.set(true);\n        mDevLoadingViewController.hide();\n        mDevLoadingViewVisible = false;\n      }\n\n      @Override\n      public void onFailure(final Throwable cause) {\n        mDevLoadingViewController.hide();\n        mDevLoadingViewVisible = false;\n        FLog.e(ReactConstants.TAG, \"Unable to connect to remote debugger\", cause);\n        future.setException(\n            new IOException(\n                mApplicationContext.getString(R.string.catalyst_remotedbg_error), cause));\n      }\n    };\n  }\n\n  public void reloadJSFromServer(final String bundleURL) {\n    ReactMarker.logMarker(ReactMarkerConstants.DOWNLOAD_START);\n\n    mDevLoadingViewController.showForUrl(bundleURL);\n    mDevLoadingViewVisible = true;\n\n    final BundleDownloader.BundleInfo bundleInfo = new BundleDownloader.BundleInfo();\n\n    mDevServerHelper.getBundleDownloader().downloadBundleFromURL(\n        new DevBundleDownloadListener() {\n          @Override\n          public void onSuccess() {\n            mDevLoadingViewController.hide();\n            mDevLoadingViewVisible = false;\n            if (mBundleDownloadListener != null) {\n              mBundleDownloadListener.onSuccess();\n            }\n            UiThreadUtil.runOnUiThread(\n                new Runnable() {\n                  @Override\n                  public void run() {\n                    ReactMarker.logMarker(ReactMarkerConstants.DOWNLOAD_END, bundleInfo.toJSONString());\n                    mReactInstanceManagerHelper.onJSBundleLoadedFromServer();\n                  }\n                });\n          }\n\n          @Override\n          public void onProgress(@Nullable final String status, @Nullable final Integer done, @Nullable final Integer total) {\n            mDevLoadingViewController.updateProgress(status, done, total);\n            if (mBundleDownloadListener != null) {\n              mBundleDownloadListener.onProgress(status, done, total);\n            }\n          }\n\n          @Override\n          public void onFailure(final Exception cause) {\n            mDevLoadingViewController.hide();\n            mDevLoadingViewVisible = false;\n            if (mBundleDownloadListener != null) {\n              mBundleDownloadListener.onFailure(cause);\n            }\n            FLog.e(ReactConstants.TAG, \"Unable to download JS bundle\", cause);\n            UiThreadUtil.runOnUiThread(\n                new Runnable() {\n                  @Override\n                  public void run() {\n                    if (cause instanceof DebugServerException) {\n                      DebugServerException debugServerException = (DebugServerException) cause;\n                      showNewJavaError(debugServerException.getMessage(), cause);\n                    } else {\n                      showNewJavaError(\n                          mApplicationContext.getString(R.string.catalyst_jsload_error),\n                          cause);\n                    }\n                  }\n                });\n          }\n        },\n        mJSBundleTempFile,\n        bundleURL,\n        bundleInfo);\n  }\n\n  @Override\n  public void startInspector() {\n    if (mIsDevSupportEnabled) {\n      mDevServerHelper.openInspectorConnection();\n    }\n  }\n\n  @Override\n  public void stopInspector() {\n    mDevServerHelper.closeInspectorConnection();\n  }\n\n  private void reload() {\n    UiThreadUtil.assertOnUiThread();\n\n    // reload settings, show/hide debug overlay if required & start/stop shake detector\n    if (mIsDevSupportEnabled) {\n      // update visibility of FPS debug overlay depending on the settings\n      if (mDebugOverlayController != null) {\n        mDebugOverlayController.setFpsDebugViewVisible(mDevSettings.isFpsDebugEnabled());\n      }\n\n      // start shake gesture detector\n      if (!mIsShakeDetectorStarted) {\n        mShakeDetector.start(\n            (SensorManager) mApplicationContext.getSystemService(Context.SENSOR_SERVICE));\n        mIsShakeDetectorStarted = true;\n      }\n\n      // register reload app broadcast receiver\n      if (!mIsReceiverRegistered) {\n        IntentFilter filter = new IntentFilter();\n        filter.addAction(DevServerHelper.getReloadAppAction(mApplicationContext));\n        mApplicationContext.registerReceiver(mReloadAppBroadcastReceiver, filter);\n        mIsReceiverRegistered = true;\n      }\n\n      // show the dev loading if it should be\n      if (mDevLoadingViewVisible) {\n        mDevLoadingViewController.show();\n      }\n\n      mDevServerHelper.openPackagerConnection(this.getClass().getSimpleName(), this);\n      if (mDevSettings.isReloadOnJSChangeEnabled()) {\n        mDevServerHelper.startPollingOnChangeEndpoint(\n            new DevServerHelper.OnServerContentChangeListener() {\n          @Override\n          public void onServerContentChanged() {\n            handleReloadJS();\n          }\n        });\n      } else {\n        mDevServerHelper.stopPollingOnChangeEndpoint();\n      }\n    } else {\n      // hide FPS debug overlay\n      if (mDebugOverlayController != null) {\n        mDebugOverlayController.setFpsDebugViewVisible(false);\n      }\n\n      // stop shake gesture detector\n      if (mIsShakeDetectorStarted) {\n        mShakeDetector.stop();\n        mIsShakeDetectorStarted = false;\n      }\n\n      // unregister app reload broadcast receiver\n      if (mIsReceiverRegistered) {\n        mApplicationContext.unregisterReceiver(mReloadAppBroadcastReceiver);\n        mIsReceiverRegistered = false;\n      }\n\n      // hide redbox dialog\n      if (mRedBoxDialog != null) {\n        mRedBoxDialog.dismiss();\n      }\n\n      // hide dev options dialog\n      if (mDevOptionsDialog != null) {\n        mDevOptionsDialog.dismiss();\n      }\n\n      // hide loading view\n      mDevLoadingViewController.hide();\n      mDevServerHelper.closePackagerConnection();\n      mDevServerHelper.stopPollingOnChangeEndpoint();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/DisabledDevSupportManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport com.facebook.react.devsupport.interfaces.ErrorCustomizer;\nimport javax.annotation.Nullable;\n\nimport java.io.File;\n\nimport com.facebook.react.bridge.DefaultNativeModuleCallExceptionHandler;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.devsupport.interfaces.DevOptionHandler;\nimport com.facebook.react.devsupport.interfaces.DevSupportManager;\nimport com.facebook.react.devsupport.interfaces.PackagerStatusCallback;\nimport com.facebook.react.devsupport.interfaces.StackFrame;\nimport com.facebook.react.modules.debug.interfaces.DeveloperSettings;\n\n/**\n * A dummy implementation of {@link DevSupportManager} to be used in production mode where\n * development features aren't needed.\n */\npublic class DisabledDevSupportManager implements DevSupportManager {\n\n  private final DefaultNativeModuleCallExceptionHandler mDefaultNativeModuleCallExceptionHandler;\n\n  public DisabledDevSupportManager() {\n    mDefaultNativeModuleCallExceptionHandler = new DefaultNativeModuleCallExceptionHandler();\n  }\n\n  @Override\n  public void showNewJavaError(String message, Throwable e) {\n\n  }\n\n  @Override\n  public void addCustomDevOption(String optionName, DevOptionHandler optionHandler) {\n\n  }\n\n  @Override\n  public void showNewJSError(String message, ReadableArray details, int errorCookie) {\n\n  }\n\n  @Override\n  public void updateJSError(String message, ReadableArray details, int errorCookie) {\n\n  }\n\n  @Override\n  public void hideRedboxDialog() {\n\n  }\n\n  @Override\n  public void showDevOptionsDialog() {\n\n  }\n\n  @Override\n  public void setDevSupportEnabled(boolean isDevSupportEnabled) {\n\n  }\n\n  @Override\n  public void startInspector() {\n\n  }\n\n  @Override\n  public void stopInspector() {\n\n  }\n\n  @Override\n  public boolean getDevSupportEnabled() {\n    return false;\n  }\n\n  @Override\n  public DeveloperSettings getDevSettings() {\n    return null;\n  }\n\n  @Override\n  public void onNewReactContextCreated(ReactContext reactContext) {\n\n  }\n\n  @Override\n  public void onReactInstanceDestroyed(ReactContext reactContext) {\n\n  }\n\n  @Override\n  public String getSourceMapUrl() {\n    return null;\n  }\n\n  @Override\n  public String getSourceUrl() {\n    return null;\n  }\n\n  @Override\n  public String getJSBundleURLForRemoteDebugging() {\n    return null;\n  }\n\n  @Override\n  public String getDownloadedJSBundleFile() {\n    return null;\n  }\n\n  @Override\n  public boolean hasUpToDateJSBundleInCache() {\n    return false;\n  }\n\n  @Override\n  public void reloadSettings() {\n\n  }\n\n  @Override\n  public void handleReloadJS() {\n\n  }\n\n  @Override\n  public void reloadJSFromServer(String bundleURL) {\n\n  }\n\n  @Override\n  public void isPackagerRunning(PackagerStatusCallback callback) {\n\n  }\n\n  @Override\n  public @Nullable File downloadBundleResourceFromUrlSync(\n      final String resourceURL,\n      final File outputFile) {\n    return null;\n  }\n\n  @Override\n  public @Nullable String getLastErrorTitle() {\n    return null;\n  }\n\n  @Override\n  public @Nullable StackFrame[] getLastErrorStack() {\n    return null;\n  }\n\n  @Override\n  public void registerErrorCustomizer(ErrorCustomizer errorCustomizer) {\n    \n  }\n\n  @Override\n  public void handleException(Exception e) {\n    mDefaultNativeModuleCallExceptionHandler.handleException(e);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/DoubleTapReloadRecognizer.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.os.Handler;\nimport android.view.KeyEvent;\nimport android.view.View;\nimport android.widget.EditText;\n\n/**\n * A class allows recognizing double key tap of \"R\", used to reload JS in\n * {@link AbstractReactActivity}, {@link RedBoxDialog} and {@link ReactActivity}.\n */\npublic class DoubleTapReloadRecognizer {\n  private boolean mDoRefresh = false;\n  private static final long DOUBLE_TAP_DELAY = 200;\n\n  public boolean didDoubleTapR(int keyCode, View view) {\n    if (keyCode == KeyEvent.KEYCODE_R && !(view instanceof EditText)) {\n      if (mDoRefresh) {\n        mDoRefresh = false;\n        return true;\n      } else {\n        mDoRefresh = true;\n        new Handler().postDelayed(\n          new Runnable() {\n            @Override\n            public void run() {\n              mDoRefresh = false;\n            }\n          },\n          DOUBLE_TAP_DELAY);\n      }\n    }\n    return false;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/FpsView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport java.util.Locale;\n\nimport android.annotation.TargetApi;\nimport android.widget.FrameLayout;\nimport android.widget.TextView;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.R;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.modules.core.ChoreographerCompat;\nimport com.facebook.react.modules.debug.FpsDebugFrameCallback;\n\n/**\n * View that automatically monitors and displays the current app frame rate. Also logs the current\n * FPS to logcat while active.\n *\n * NB: Requires API 16 for use of FpsDebugFrameCallback.\n */\n@TargetApi(16)\npublic class FpsView extends FrameLayout {\n\n  private static final int UPDATE_INTERVAL_MS = 500;\n\n  private final TextView mTextView;\n  private final FpsDebugFrameCallback mFrameCallback;\n  private final FPSMonitorRunnable mFPSMonitorRunnable;\n\n  public FpsView(ReactContext reactContext) {\n    super(reactContext);\n    inflate(reactContext, R.layout.fps_view, this);\n    mTextView = (TextView) findViewById(R.id.fps_text);\n    mFrameCallback = new FpsDebugFrameCallback(ChoreographerCompat.getInstance(), reactContext);\n    mFPSMonitorRunnable = new FPSMonitorRunnable();\n    setCurrentFPS(0, 0, 0, 0);\n  }\n\n  @Override\n  protected void onAttachedToWindow() {\n    super.onAttachedToWindow();\n    mFrameCallback.reset();\n    mFrameCallback.start();\n    mFPSMonitorRunnable.start();\n  }\n\n  @Override\n  protected void onDetachedFromWindow() {\n    super.onDetachedFromWindow();\n    mFrameCallback.stop();\n    mFPSMonitorRunnable.stop();\n  }\n\n  private void setCurrentFPS(double currentFPS, double currentJSFPS, int droppedUIFrames, int total4PlusFrameStutters) {\n    String fpsString = String.format(\n        Locale.US,\n        \"UI: %.1f fps\\n%d dropped so far\\n%d stutters (4+) so far\\nJS: %.1f fps\",\n        currentFPS,\n        droppedUIFrames,\n        total4PlusFrameStutters,\n        currentJSFPS);\n    mTextView.setText(fpsString);\n    FLog.d(ReactConstants.TAG, fpsString);\n  }\n\n  /**\n   * Timer that runs every UPDATE_INTERVAL_MS ms and updates the currently displayed FPS.\n   */\n  private class FPSMonitorRunnable implements Runnable {\n\n    private boolean mShouldStop = false;\n    private int mTotalFramesDropped = 0;\n    private int mTotal4PlusFrameStutters = 0;\n\n    @Override\n    public void run() {\n      if (mShouldStop) {\n        return;\n      }\n      mTotalFramesDropped += mFrameCallback.getExpectedNumFrames() - mFrameCallback.getNumFrames();\n      mTotal4PlusFrameStutters += mFrameCallback.get4PlusFrameStutters();\n      setCurrentFPS(mFrameCallback.getFPS(), mFrameCallback.getJSFPS(), mTotalFramesDropped, mTotal4PlusFrameStutters);\n      mFrameCallback.reset();\n\n      postDelayed(this, UPDATE_INTERVAL_MS);\n    }\n\n    public void start() {\n      mShouldStop = false;\n      post(this);\n    }\n\n    public void stop() {\n      mShouldStop = true;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorPackagerConnection.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.devsupport;\n\nimport javax.annotation.Nullable;\n\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.concurrent.TimeUnit;\n\nimport android.os.AsyncTask;\nimport android.os.Handler;\nimport android.os.Looper;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.Inspector;\n\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\nimport okhttp3.WebSocket;\nimport okhttp3.WebSocketListener;\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\npublic class InspectorPackagerConnection {\n  private static final String TAG = \"InspectorPackagerConnection\";\n\n  private final Connection mConnection;\n  private final Map<String, Inspector.LocalConnection> mInspectorConnections;\n  private final String mPackageName;\n\n  public InspectorPackagerConnection(String url, String packageName) {\n    mConnection = new Connection(url);\n    mInspectorConnections = new HashMap<>();\n    mPackageName = packageName;\n  }\n\n  public void connect() {\n    mConnection.connect();\n  }\n\n  public void closeQuietly() {\n    mConnection.close();\n  }\n\n  public void sendEventToAllConnections(String event) {\n    for (Map.Entry<String, Inspector.LocalConnection> inspectorConnectionEntry :\n        mInspectorConnections.entrySet()) {\n      Inspector.LocalConnection inspectorConnection = inspectorConnectionEntry.getValue();\n      inspectorConnection.sendMessage(event);\n    }\n  }\n\n  void handleProxyMessage(JSONObject message)\n      throws JSONException, IOException {\n    String event = message.getString(\"event\");\n    switch (event) {\n      case \"getPages\":\n        sendEvent(\"getPages\", getPages());\n        break;\n      case \"wrappedEvent\":\n        handleWrappedEvent(message.getJSONObject(\"payload\"));\n        break;\n      case \"connect\":\n        handleConnect(message.getJSONObject(\"payload\"));\n        break;\n      case \"disconnect\":\n        handleDisconnect(message.getJSONObject(\"payload\"));\n        break;\n      default:\n        throw new IllegalArgumentException(\"Unknown event: \" + event);\n    }\n  }\n\n  void closeAllConnections() {\n    for (Map.Entry<String, Inspector.LocalConnection> entry : mInspectorConnections.entrySet()) {\n      entry.getValue().disconnect();\n    }\n    mInspectorConnections.clear();\n  }\n\n  private void handleConnect(JSONObject payload) throws JSONException {\n    final String pageId = payload.getString(\"pageId\");\n    Inspector.LocalConnection inspectorConnection = mInspectorConnections.remove(pageId);\n    if (inspectorConnection != null) {\n      throw new IllegalStateException(\"Already connected: \" + pageId);\n    }\n\n    try {\n      // TODO: Use strings for id's too\n      inspectorConnection = Inspector.connect(Integer.parseInt(pageId), new Inspector.RemoteConnection() {\n        @Override\n        public void onMessage(String message) {\n          try {\n            sendWrappedEvent(pageId, message);\n          } catch (JSONException e) {\n            FLog.w(TAG, \"Couldn't send event to packager\", e);\n          }\n        }\n\n        @Override\n        public void onDisconnect() {\n          try {\n            mInspectorConnections.remove(pageId);\n            sendEvent(\"disconnect\", makePageIdPayload(pageId));\n          } catch (JSONException e) {\n            FLog.w(TAG, \"Couldn't send event to packager\", e);\n          }\n        }\n      });\n      mInspectorConnections.put(pageId, inspectorConnection);\n    } catch (Exception e) {\n      FLog.w(TAG, \"Failed to open page: \" + pageId, e);\n      sendEvent(\"disconnect\", makePageIdPayload(pageId));\n    }\n  }\n\n  private void handleDisconnect(JSONObject payload) throws JSONException {\n    final String pageId = payload.getString(\"pageId\");\n    Inspector.LocalConnection inspectorConnection = mInspectorConnections.remove(pageId);\n    if (inspectorConnection == null) {\n      return;\n    }\n\n    inspectorConnection.disconnect();\n  }\n\n  private void handleWrappedEvent(JSONObject payload) throws JSONException {\n    final String pageId = payload.getString(\"pageId\");\n    String wrappedEvent = payload.getString(\"wrappedEvent\");\n    Inspector.LocalConnection inspectorConnection = mInspectorConnections.get(pageId);\n    if (inspectorConnection == null) {\n      throw new IllegalStateException(\"Not connected: \" + pageId);\n    }\n    inspectorConnection.sendMessage(wrappedEvent);\n  }\n\n  private JSONArray getPages() throws JSONException {\n    List<Inspector.Page> pages = Inspector.getPages();\n    JSONArray array = new JSONArray();\n    for (Inspector.Page page : pages) {\n      JSONObject jsonPage = new JSONObject();\n      jsonPage.put(\"id\", String.valueOf(page.getId()));\n      jsonPage.put(\"title\", page.getTitle());\n      jsonPage.put(\"app\", mPackageName);\n      array.put(jsonPage);\n    }\n    return array;\n  }\n\n  private void sendWrappedEvent(String pageId, String message) throws JSONException {\n    JSONObject payload = new JSONObject();\n    payload.put(\"pageId\", pageId);\n    payload.put(\"wrappedEvent\", message);\n    sendEvent(\"wrappedEvent\", payload);\n  }\n\n  private void sendEvent(String name, Object payload)\n      throws JSONException {\n    JSONObject jsonMessage = new JSONObject();\n    jsonMessage.put(\"event\", name);\n    jsonMessage.put(\"payload\", payload);\n    mConnection.send(jsonMessage);\n  }\n\n  private JSONObject makePageIdPayload(String pageId) throws JSONException {\n    JSONObject payload = new JSONObject();\n    payload.put(\"pageId\", pageId);\n    return payload;\n  }\n\n  private class Connection extends WebSocketListener {\n    private static final int RECONNECT_DELAY_MS = 2000;\n\n    private final String mUrl;\n\n    private OkHttpClient mHttpClient;\n    private @Nullable WebSocket mWebSocket;\n    private final Handler mHandler;\n    private boolean mClosed;\n    private boolean mSuppressConnectionErrors;\n\n    public Connection(String url) {\n      mUrl = url;\n      mHandler = new Handler(Looper.getMainLooper());\n    }\n\n    @Override\n    public void onOpen(WebSocket webSocket, Response response) {\n      mWebSocket = webSocket;\n    }\n\n    @Override\n    public void onFailure(WebSocket webSocket, Throwable t, Response response) {\n      if (mWebSocket != null) {\n        abort(\"Websocket exception\", t);\n      }\n      if (!mClosed) {\n        reconnect();\n      }\n    }\n\n    @Override\n    public void onMessage(WebSocket webSocket, String text) {\n      try {\n        handleProxyMessage(new JSONObject(text));\n      } catch (Exception e) {\n        throw new RuntimeException(e);\n      }\n    }\n\n    @Override\n    public void onClosed(WebSocket webSocket, int code, String reason) {\n      mWebSocket = null;\n      closeAllConnections();\n      if (!mClosed) {\n        reconnect();\n      }\n    }\n\n    public void connect() {\n      if (mClosed) {\n        throw new IllegalStateException(\"Can't connect closed client\");\n      }\n      if (mHttpClient == null) {\n        mHttpClient = new OkHttpClient.Builder()\n            .connectTimeout(10, TimeUnit.SECONDS)\n            .writeTimeout(10, TimeUnit.SECONDS)\n            .readTimeout(0, TimeUnit.MINUTES) // Disable timeouts for read\n            .build();\n      }\n\n      Request request = new Request.Builder().url(mUrl).build();\n      mHttpClient.newWebSocket(request, this);\n    }\n\n    private void reconnect() {\n      if (mClosed) {\n        throw new IllegalStateException(\"Can't reconnect closed client\");\n      }\n      if (!mSuppressConnectionErrors) {\n        FLog.w(TAG, \"Couldn't connect to packager, will silently retry\");\n        mSuppressConnectionErrors = true;\n      }\n      mHandler.postDelayed(\n          new Runnable() {\n            @Override\n            public void run() {\n              // check that we haven't been closed in the meantime\n              if (!mClosed) {\n                connect();\n              }\n            }\n          },\n          RECONNECT_DELAY_MS);\n    }\n\n    public void close() {\n      mClosed = true;\n      if (mWebSocket != null) {\n        try {\n          mWebSocket.close(1000, \"End of session\");\n        } catch (Exception e) {\n          // swallow, no need to handle it here\n        }\n        mWebSocket = null;\n      }\n    }\n\n    public void send(final JSONObject object) {\n      new AsyncTask<WebSocket, Void, Void>() {\n        @Override\n        protected Void doInBackground(WebSocket... sockets) {\n          if (sockets == null || sockets.length == 0) {\n            return null;\n          }\n          try {\n            sockets[0].send(object.toString());\n          } catch (Exception e) {\n            FLog.w(TAG, \"Couldn't send event to packager\", e);\n          }\n          return null;\n        }\n      }.execute(mWebSocket);\n    }\n\n    private void abort(String message, Throwable cause) {\n      FLog.e(TAG, \"Error occurred, shutting down websocket connection: \" + message, cause);\n      closeAllConnections();\n      closeWebSocketQuietly();\n    }\n\n    private void closeWebSocketQuietly() {\n      if (mWebSocket != null) {\n        try {\n          mWebSocket.close(1000, \"End of session\");\n        } catch (Exception e) {\n          // swallow, no need to handle it here\n        }\n        mWebSocket = null;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/JSCHeapCapture.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport javax.annotation.Nullable;\n\nimport java.io.File;\n\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.module.annotations.ReactModule;\n\n// This module is being called only by Java via the static method \"captureHeap\" that\n// requires it to alreay be initialized, thus we eagerly initialize this module\n@ReactModule(name = \"JSCHeapCapture\", needsEagerInit = true)\npublic class JSCHeapCapture extends ReactContextBaseJavaModule {\n  public interface HeapCapture extends JavaScriptModule {\n    void captureHeap(String path);\n  }\n\n  public static class CaptureException extends Exception {\n    CaptureException(String message) {\n      super(message);\n    }\n    CaptureException(String message, Throwable cause) {\n      super(message, cause);\n    }\n  }\n\n  public interface CaptureCallback {\n    void onSuccess(File capture);\n    void onFailure(CaptureException error);\n  }\n\n  private @Nullable CaptureCallback mCaptureInProgress;\n\n  public JSCHeapCapture(ReactApplicationContext reactContext) {\n    super(reactContext);\n    mCaptureInProgress = null;\n  }\n\n  public synchronized void captureHeap(String path, final CaptureCallback callback) {\n    if (mCaptureInProgress != null) {\n      callback.onFailure(new CaptureException(\"Heap capture already in progress.\"));\n      return;\n    }\n    File f = new File(path + \"/capture.json\");\n    f.delete();\n\n    HeapCapture heapCapture = getReactApplicationContext().getJSModule(HeapCapture.class);\n    if (heapCapture == null) {\n      callback.onFailure(new CaptureException(\"Heap capture js module not registered.\"));\n      return;\n    }\n    mCaptureInProgress = callback;\n    heapCapture.captureHeap(f.getPath());\n  }\n\n  @ReactMethod\n  public synchronized void captureComplete(String path, String error) {\n    if (mCaptureInProgress != null) {\n      if (error == null) {\n        mCaptureInProgress.onSuccess(new File(path));\n      } else {\n        mCaptureInProgress.onFailure(new CaptureException(error));\n      }\n      mCaptureInProgress = null;\n    }\n  }\n\n  @Override\n  public String getName() {\n    return \"JSCHeapCapture\";\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/JSCSamplingProfiler.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport javax.annotation.Nullable;\n\nimport java.util.HashSet;\nimport java.util.LinkedList;\nimport java.util.List;\n\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.module.annotations.ReactModule;\n\n// This module is being called only by Java via the static method \"poke\" that\n// requires it to alreay be initialized, thus we eagerly initialize this module\n@ReactModule(name = \"JSCSamplingProfiler\", needsEagerInit = true)\npublic class JSCSamplingProfiler extends ReactContextBaseJavaModule {\n  public interface SamplingProfiler extends JavaScriptModule {\n    void poke(int token);\n  }\n\n  public static class ProfilerException extends Exception {\n    ProfilerException(String message) {\n      super(message);\n    }\n  }\n\n  private @Nullable SamplingProfiler mSamplingProfiler;\n  private boolean mOperationInProgress;\n  private int mOperationToken;\n  private @Nullable String mOperationError;\n  private @Nullable String mSamplingProfilerResult;\n\n  private static final HashSet<JSCSamplingProfiler> sRegisteredDumpers =\n    new HashSet<>();\n\n  private static synchronized void registerSamplingProfiler(\n      JSCSamplingProfiler dumper) {\n    if (sRegisteredDumpers.contains(dumper)) {\n      throw new RuntimeException(\n        \"a JSCSamplingProfiler registered more than once\");\n    }\n    sRegisteredDumpers.add(dumper);\n  }\n\n  private static synchronized void unregisterSamplingProfiler(\n      JSCSamplingProfiler dumper) {\n    sRegisteredDumpers.remove(dumper);\n  }\n\n  public static synchronized List<String> poke(long timeout)\n      throws ProfilerException {\n    LinkedList<String> results = new LinkedList<>();\n    if (sRegisteredDumpers.isEmpty()) {\n      throw new ProfilerException(\"No JSC registered\");\n    }\n\n    for (JSCSamplingProfiler dumper : sRegisteredDumpers) {\n      dumper.pokeHelper(timeout);\n      results.add(dumper.mSamplingProfilerResult);\n    }\n    return results;\n  }\n\n  public JSCSamplingProfiler(ReactApplicationContext reactContext) {\n    super(reactContext);\n    mSamplingProfiler = null;\n    mOperationInProgress = false;\n    mOperationToken = 0;\n    mOperationError = null;\n    mSamplingProfilerResult = null;\n  }\n\n  private synchronized void pokeHelper(long timeout) throws ProfilerException {\n    if (mSamplingProfiler == null) {\n      throw new ProfilerException(\"SamplingProfiler.js module not connected\");\n    }\n    mSamplingProfiler.poke(getOperationToken());\n    waitForOperation(timeout);\n  }\n\n  private int getOperationToken() throws ProfilerException {\n    if (mOperationInProgress) {\n      throw new ProfilerException(\"Another operation already in progress.\");\n    }\n    mOperationInProgress = true;\n    return ++mOperationToken;\n  }\n\n  private void waitForOperation(long timeout) throws ProfilerException {\n    try {\n      wait(timeout);\n    } catch (InterruptedException e) {\n      throw new ProfilerException(\n          \"Waiting for heap capture failed: \" + e.getMessage());\n    }\n\n    if (mOperationInProgress) {\n      mOperationInProgress = false;\n      throw new ProfilerException(\"heap capture timed out.\");\n    }\n\n    if (mOperationError != null) {\n      throw new ProfilerException(mOperationError);\n    }\n  }\n\n  @ReactMethod\n  public synchronized void operationComplete(\n      int token, String result, String error) {\n    if (token == mOperationToken) {\n      mOperationInProgress = false;\n      mSamplingProfilerResult = result;\n      mOperationError = error;\n      this.notify();\n    } else {\n      throw new RuntimeException(\"Completed operation is not in progress.\");\n    }\n  }\n\n  @Override\n  public String getName() {\n    return \"JSCSamplingProfiler\";\n  }\n\n  @Override\n  public void initialize() {\n    super.initialize();\n    mSamplingProfiler =\n      getReactApplicationContext().getJSModule(SamplingProfiler.class);\n    registerSamplingProfiler(this);\n  }\n\n  @Override\n  public void onCatalystInstanceDestroy() {\n    super.onCatalystInstanceDestroy();\n    unregisterSamplingProfiler(this);\n    mSamplingProfiler = null;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/JSDebuggerWebSocketClient.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.util.JsonReader;\nimport android.util.JsonToken;\nimport android.util.JsonWriter;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.common.JavascriptException;\n\nimport java.io.IOException;\nimport java.io.StringReader;\nimport java.io.StringWriter;\nimport java.util.HashMap;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.TimeUnit;\nimport java.util.concurrent.atomic.AtomicInteger;\n\nimport javax.annotation.Nullable;\n\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\nimport okhttp3.WebSocket;\nimport okhttp3.WebSocketListener;\n\n/**\n * A wrapper around WebSocketClient that recognizes RN debugging message format.\n */\npublic class JSDebuggerWebSocketClient extends WebSocketListener {\n\n  private static final String TAG = \"JSDebuggerWebSocketClient\";\n\n  public interface JSDebuggerCallback {\n    void onSuccess(@Nullable String response);\n    void onFailure(Throwable cause);\n  }\n\n  private @Nullable WebSocket mWebSocket;\n  private @Nullable OkHttpClient mHttpClient;\n  private @Nullable JSDebuggerCallback mConnectCallback;\n  private final AtomicInteger mRequestID = new AtomicInteger();\n  private final ConcurrentHashMap<Integer, JSDebuggerCallback> mCallbacks =\n      new ConcurrentHashMap<>();\n\n  public void connect(String url, JSDebuggerCallback callback) {\n    if (mHttpClient != null) {\n      throw new IllegalStateException(\"JSDebuggerWebSocketClient is already initialized.\");\n    }\n    mConnectCallback = callback;\n    mHttpClient = new OkHttpClient.Builder()\n      .connectTimeout(10, TimeUnit.SECONDS)\n      .writeTimeout(10, TimeUnit.SECONDS)\n      .readTimeout(0, TimeUnit.MINUTES) // Disable timeouts for read\n      .build();\n\n    Request request = new Request.Builder().url(url).build();\n    mHttpClient.newWebSocket(request, this);\n  }\n\n  public void prepareJSRuntime(JSDebuggerCallback callback) {\n    int requestID = mRequestID.getAndIncrement();\n    mCallbacks.put(requestID, callback);\n\n    try {\n      StringWriter sw = new StringWriter();\n      JsonWriter js = new JsonWriter(sw);\n      js.beginObject()\n        .name(\"id\").value(requestID)\n        .name(\"method\").value(\"prepareJSRuntime\")\n        .endObject()\n        .close();\n      sendMessage(requestID, sw.toString());\n    } catch (IOException e) {\n      triggerRequestFailure(requestID, e);\n    }\n  }\n\n  public void loadApplicationScript(\n      String sourceURL,\n      HashMap<String, String> injectedObjects,\n      JSDebuggerCallback callback) {\n    int requestID = mRequestID.getAndIncrement();\n    mCallbacks.put(requestID, callback);\n\n    try {\n      StringWriter sw = new StringWriter();\n      JsonWriter js = new JsonWriter(sw)\n         .beginObject()\n         .name(\"id\").value(requestID)\n         .name(\"method\").value(\"executeApplicationScript\")\n         .name(\"url\").value(sourceURL)\n         .name(\"inject\").beginObject();\n      for (String key : injectedObjects.keySet()) {\n        js.name(key).value(injectedObjects.get(key));\n      }\n      js.endObject().endObject().close();\n      sendMessage(requestID, sw.toString());\n    } catch (IOException e) {\n      triggerRequestFailure(requestID, e);\n    }\n  }\n\n  public void executeJSCall(\n      String methodName,\n      String jsonArgsArray,\n      JSDebuggerCallback callback) {\n    int requestID = mRequestID.getAndIncrement();\n    mCallbacks.put(requestID, callback);\n\n    try {\n      StringWriter sw = new StringWriter();\n      JsonWriter js = new JsonWriter(sw);\n\n      js.beginObject()\n        .name(\"id\").value(requestID)\n        .name(\"method\").value(methodName);\n      /* JsonWriter does not offer writing raw string (without quotes), that's why\n         here we directly write to output string using the the underlying StringWriter */\n      sw.append(\",\\\"arguments\\\":\").append(jsonArgsArray);\n      js.endObject().close();\n      sendMessage(requestID, sw.toString());\n    } catch (IOException e) {\n      triggerRequestFailure(requestID, e);\n    }\n  }\n\n  public void closeQuietly() {\n    if (mWebSocket != null) {\n      try {\n        mWebSocket.close(1000, \"End of session\");\n      } catch (Exception e) {\n        // swallow, no need to handle it here\n      }\n      mWebSocket = null;\n    }\n  }\n\n  private void sendMessage(int requestID, String message) {\n    if (mWebSocket == null) {\n      triggerRequestFailure(\n          requestID,\n          new IllegalStateException(\"WebSocket connection no longer valid\"));\n      return;\n    }\n    try {\n      mWebSocket.send(message);\n    } catch (Exception e) {\n      triggerRequestFailure(requestID, e);\n    }\n  }\n\n  private void triggerRequestFailure(int requestID, Throwable cause) {\n    JSDebuggerCallback callback = mCallbacks.get(requestID);\n    if (callback != null) {\n      mCallbacks.remove(requestID);\n      callback.onFailure(cause);\n    }\n  }\n\n  private void triggerRequestSuccess(int requestID, @Nullable String response) {\n    JSDebuggerCallback callback = mCallbacks.get(requestID);\n    if (callback != null) {\n      mCallbacks.remove(requestID);\n      callback.onSuccess(response);\n    }\n  }\n\n  @Override\n  public void onMessage(WebSocket webSocket, String text) {\n    Integer replyID = null;\n\n    try {\n      JsonReader reader = new JsonReader(new StringReader(text));\n      String result = null;\n      reader.beginObject();\n      while (reader.hasNext()) {\n        String field = reader.nextName();\n\n        if (JsonToken.NULL == reader.peek()) {\n          reader.skipValue();\n          continue;\n        }\n\n        if (\"replyID\".equals(field)) {\n          replyID = reader.nextInt();\n        } else if (\"result\".equals(field)) {\n          result = reader.nextString();\n        } else if (\"error\".equals(field)) {\n          String error = reader.nextString();\n          abort(error, new JavascriptException(error));\n        }\n      }\n      if (replyID != null) {\n        triggerRequestSuccess(replyID, result);\n      }\n    } catch (IOException e) {\n      if (replyID != null) {\n        triggerRequestFailure(replyID, e);\n      } else {\n        abort(\"Parsing response message from websocket failed\", e);\n      }\n    }\n  }\n\n  @Override\n  public void onFailure(WebSocket webSocket, Throwable t, Response response) {\n    abort(\"Websocket exception\", t);\n  }\n\n  @Override\n  public void onOpen(WebSocket webSocket, Response response) {\n    mWebSocket = webSocket;\n    Assertions.assertNotNull(mConnectCallback).onSuccess(null);\n    mConnectCallback = null;\n  }\n\n  @Override\n  public void onClosed(WebSocket webSocket, int code, String reason) {\n    mWebSocket = null;\n  }\n\n  private void abort(String message, Throwable cause) {\n    FLog.e(TAG, \"Error occurred, shutting down websocket connection: \" + message, cause);\n    closeQuietly();\n\n    // Trigger failure callbacks\n    if (mConnectCallback != null) {\n      mConnectCallback.onFailure(cause);\n      mConnectCallback = null;\n    }\n    for (JSDebuggerCallback callback : mCallbacks.values()) {\n      callback.onFailure(cause);\n    }\n    mCallbacks.clear();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/JSException.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * This represents an error evaluating JavaScript.  It includes the usual\n * message, and the raw JS stack where the error occurred (which may be empty).\n */\n\n@DoNotStrip\npublic class JSException extends Exception {\n  private final String mStack;\n\n  @DoNotStrip\n  public JSException(String message, String stack, Throwable cause) {\n    super(message, cause);\n    mStack = stack;\n  }\n\n  public JSException(String message, String stack) {\n    super(message);\n    mStack = stack;\n  }\n\n  public String getStack() {\n    return mStack;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/MultipartStreamReader.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport okio.Buffer;\nimport okio.BufferedSource;\nimport okio.ByteString;\n\n/**\n * Utility class to parse the body of a response of type multipart/mixed.\n */\npublic class MultipartStreamReader {\n  // Standard line separator for HTTP.\n  private static final String CRLF = \"\\r\\n\";\n\n  private final BufferedSource mSource;\n  private final String mBoundary;\n\n  public interface ChunkCallback {\n    void execute(Map<String, String> headers, Buffer body, boolean done) throws IOException;\n  }\n\n  public MultipartStreamReader(BufferedSource source, String boundary) {\n    mSource = source;\n    mBoundary = boundary;\n  }\n\n  private Map<String, String> parseHeaders(Buffer data) {\n    Map<String, String> headers = new HashMap<>();\n\n    String text = data.readUtf8();\n    String[] lines = text.split(CRLF);\n    for (String line : lines) {\n      int indexOfSeparator = line.indexOf(\":\");\n      if (indexOfSeparator == -1) {\n        continue;\n      }\n\n      String key = line.substring(0, indexOfSeparator).trim();\n      String value = line.substring(indexOfSeparator + 1).trim();\n      headers.put(key, value);\n    }\n\n    return headers;\n  }\n\n  private void emitChunk(Buffer chunk, boolean done, ChunkCallback callback) throws IOException {\n    ByteString marker = ByteString.encodeUtf8(CRLF + CRLF);\n    long indexOfMarker = chunk.indexOf(marker);\n    if (indexOfMarker == -1) {\n      callback.execute(null, chunk, done);\n    } else {\n      Buffer headers = new Buffer();\n      Buffer body = new Buffer();\n      chunk.read(headers, indexOfMarker);\n      chunk.skip(marker.size());\n      chunk.readAll(body);\n      callback.execute(parseHeaders(headers), body, done);\n    }\n  }\n\n  /**\n   * Reads all parts of the multipart response and execute the callback for each chunk received.\n   * @param callback Callback executed when a chunk is received\n   * @return If the read was successful\n   */\n  public boolean readAllParts(ChunkCallback callback) throws IOException {\n    ByteString delimiter = ByteString.encodeUtf8(CRLF + \"--\" + mBoundary + CRLF);\n    ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + \"--\" + mBoundary + \"--\" + CRLF);\n\n    int bufferLen = 4 * 1024;\n    long chunkStart = 0;\n    long bytesSeen = 0;\n    Buffer content = new Buffer();\n\n    while (true) {\n      boolean isCloseDelimiter = false;\n\n      // Search only a subset of chunk that we haven't seen before + few bytes\n      // to allow for the edge case when the delimiter is cut by read call.\n      long searchStart = Math.max(bytesSeen - closeDelimiter.size(), chunkStart);\n      long indexOfDelimiter = content.indexOf(delimiter, searchStart);\n      if (indexOfDelimiter == -1) {\n        isCloseDelimiter = true;\n        indexOfDelimiter = content.indexOf(closeDelimiter, searchStart);\n      }\n\n      if (indexOfDelimiter == -1) {\n        bytesSeen = content.size();\n        long bytesRead = mSource.read(content, bufferLen);\n        if (bytesRead <= 0) {\n          return false;\n        }\n        continue;\n      }\n\n      long chunkEnd = indexOfDelimiter;\n      long length = chunkEnd - chunkStart;\n\n      // Ignore preamble\n      if (chunkStart > 0) {\n        Buffer chunk = new Buffer();\n        content.skip(chunkStart);\n        content.read(chunk, length);\n        emitChunk(chunk, isCloseDelimiter, callback);\n      } else {\n        content.skip(chunkEnd);\n      }\n\n      if (isCloseDelimiter) {\n        return true;\n      }\n\n      bytesSeen = chunkStart = delimiter.size();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/ReactInstanceManagerDevHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.app.Activity;\n\nimport com.facebook.react.bridge.JavaJSExecutor;\n\nimport javax.annotation.Nullable;\n\n/**\n * Interface used by {@link DevSupportManager} for accessing some fields and methods of\n * {@link ReactInstanceManager} for the purpose of displaying and handling developer menu options.\n */\npublic interface ReactInstanceManagerDevHelper {\n\n  /**\n   * Request react instance recreation with JS debugging enabled.\n   */\n  void onReloadWithJSDebugger(JavaJSExecutor.Factory proxyExecutorFactory);\n\n  /**\n   * Notify react instance manager about new JS bundle version downloaded from the server.\n   */\n  void onJSBundleLoadedFromServer();\n\n  /**\n   * Request to toggle the react element inspector.\n   */\n  void toggleElementInspector();\n\n  /**\n   * Get reference to top level #{link Activity} attached to react context\n   */\n  @Nullable Activity getCurrentActivity();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxDialog.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport javax.annotation.Nullable;\n\nimport android.app.Dialog;\nimport android.content.Context;\nimport android.graphics.Color;\nimport android.net.Uri;\nimport android.os.AsyncTask;\nimport android.text.SpannedString;\nimport android.text.method.LinkMovementMethod;\nimport android.view.KeyEvent;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.Window;\nimport android.widget.AdapterView;\nimport android.widget.BaseAdapter;\nimport android.widget.Button;\nimport android.widget.ListView;\nimport android.widget.ProgressBar;\nimport android.widget.TextView;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.R;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.devsupport.interfaces.DevSupportManager;\nimport com.facebook.react.devsupport.interfaces.StackFrame;\nimport com.facebook.react.devsupport.RedBoxHandler.ReportCompletedListener;\n\nimport okhttp3.MediaType;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport org.json.JSONObject;\n\n/**\n * Dialog for displaying JS errors in an eye-catching form (red box).\n */\n/* package */ class RedBoxDialog extends Dialog implements AdapterView.OnItemClickListener {\n\n  private final DevSupportManager mDevSupportManager;\n  private final DoubleTapReloadRecognizer mDoubleTapReloadRecognizer;\n  private final @Nullable RedBoxHandler mRedBoxHandler;\n\n  private ListView mStackView;\n  private Button mReloadJsButton;\n  private Button mDismissButton;\n  private Button mCopyToClipboardButton;\n  private @Nullable Button mReportButton;\n  private @Nullable TextView mReportTextView;\n  private @Nullable ProgressBar mLoadingIndicator;\n  private @Nullable View mLineSeparator;\n  private boolean isReporting = false;\n\n  private ReportCompletedListener mReportCompletedListener = new ReportCompletedListener() {\n    @Override\n    public void onReportSuccess(final SpannedString spannedString) {\n      isReporting = false;\n      Assertions.assertNotNull(mReportButton).setEnabled(true);\n      Assertions.assertNotNull(mLoadingIndicator).setVisibility(View.GONE);\n      Assertions.assertNotNull(mReportTextView).setText(spannedString);\n    }\n    @Override\n    public void onReportError(final SpannedString spannedString) {\n      isReporting = false;\n      Assertions.assertNotNull(mReportButton).setEnabled(true);\n      Assertions.assertNotNull(mLoadingIndicator).setVisibility(View.GONE);\n      Assertions.assertNotNull(mReportTextView).setText(spannedString);\n    }\n  };\n\n  private View.OnClickListener mReportButtonOnClickListener = new View.OnClickListener() {\n    @Override\n    public void onClick(View view) {\n      if (mRedBoxHandler == null || !mRedBoxHandler.isReportEnabled() || isReporting) {\n        return;\n      }\n      isReporting = true;\n      Assertions.assertNotNull(mReportTextView).setText(\"Reporting...\");\n      Assertions.assertNotNull(mReportTextView).setVisibility(View.VISIBLE);\n      Assertions.assertNotNull(mLoadingIndicator).setVisibility(View.VISIBLE);\n      Assertions.assertNotNull(mLineSeparator).setVisibility(View.VISIBLE);\n      Assertions.assertNotNull(mReportButton).setEnabled(false);\n\n      String title = Assertions.assertNotNull(mDevSupportManager.getLastErrorTitle());\n      StackFrame[] stack = Assertions.assertNotNull(mDevSupportManager.getLastErrorStack());\n      String sourceUrl = mDevSupportManager.getSourceUrl();\n\n      mRedBoxHandler.reportRedbox(\n        title,\n        stack,\n        sourceUrl,\n        Assertions.assertNotNull(mReportCompletedListener));\n    }\n  };\n\n  private static class StackAdapter extends BaseAdapter {\n    private static final int VIEW_TYPE_COUNT = 2;\n    private static final int VIEW_TYPE_TITLE = 0;\n    private static final int VIEW_TYPE_STACKFRAME = 1;\n\n    private final String mTitle;\n    private final StackFrame[] mStack;\n\n    private static class FrameViewHolder {\n      private final TextView mMethodView;\n      private final TextView mFileView;\n\n      private FrameViewHolder(View v) {\n        mMethodView = (TextView) v.findViewById(R.id.rn_frame_method);\n        mFileView = (TextView) v.findViewById(R.id.rn_frame_file);\n      }\n    }\n\n    public StackAdapter(String title, StackFrame[] stack) {\n      mTitle = title;\n      mStack = stack;\n    }\n\n    @Override\n    public boolean areAllItemsEnabled() {\n      return false;\n    }\n\n    @Override\n    public boolean isEnabled(int position) {\n      return position > 0;\n    }\n\n    @Override\n    public int getCount() {\n      return mStack.length + 1;\n    }\n\n    @Override\n    public Object getItem(int position) {\n      return position == 0 ? mTitle : mStack[position - 1];\n    }\n\n    @Override\n    public long getItemId(int position) {\n      return position;\n    }\n\n    @Override\n    public int getViewTypeCount() {\n      return VIEW_TYPE_COUNT;\n    }\n\n    @Override\n    public int getItemViewType(int position) {\n      return position == 0 ? VIEW_TYPE_TITLE : VIEW_TYPE_STACKFRAME;\n    }\n\n    @Override\n    public View getView(int position, View convertView, ViewGroup parent) {\n      if (position == 0) {\n        TextView title = convertView != null\n            ? (TextView) convertView\n            : (TextView) LayoutInflater.from(parent.getContext())\n                .inflate(R.layout.redbox_item_title, parent, false);\n        title.setText(mTitle);\n        return title;\n      } else {\n        if (convertView == null) {\n          convertView = LayoutInflater.from(parent.getContext())\n              .inflate(R.layout.redbox_item_frame, parent, false);\n          convertView.setTag(new FrameViewHolder(convertView));\n        }\n        StackFrame frame = mStack[position - 1];\n        FrameViewHolder holder = (FrameViewHolder) convertView.getTag();\n        holder.mMethodView.setText(frame.getMethod());\n        holder.mFileView.setText(StackTraceHelper.formatFrameSource(frame));\n        return convertView;\n      }\n    }\n  }\n\n  private static class OpenStackFrameTask extends AsyncTask<StackFrame, Void, Void> {\n    private static final MediaType JSON = MediaType.parse(\"application/json; charset=utf-8\");\n\n    private final DevSupportManager mDevSupportManager;\n\n    private OpenStackFrameTask(DevSupportManager devSupportManager) {\n      mDevSupportManager = devSupportManager;\n    }\n\n    @Override\n    protected Void doInBackground(StackFrame... stackFrames) {\n      try {\n        String openStackFrameUrl =\n            Uri.parse(mDevSupportManager.getSourceUrl()).buildUpon()\n                .path(\"/open-stack-frame\")\n                .query(null)\n                .build()\n                .toString();\n        OkHttpClient client = new OkHttpClient();\n        for (StackFrame frame: stackFrames) {\n          String payload = stackFrameToJson(frame).toString();\n          RequestBody body = RequestBody.create(JSON, payload);\n          Request request = new Request.Builder().url(openStackFrameUrl).post(body).build();\n          client.newCall(request).execute();\n        }\n      } catch (Exception e) {\n        FLog.e(ReactConstants.TAG, \"Could not open stack frame\", e);\n      }\n      return null;\n    }\n\n    private static JSONObject stackFrameToJson(StackFrame frame) {\n      return new JSONObject(\n          MapBuilder.of(\n              \"file\", frame.getFile(),\n              \"methodName\", frame.getMethod(),\n              \"lineNumber\", frame.getLine(),\n              \"column\", frame.getColumn()\n          ));\n    }\n  }\n\n  private static class CopyToHostClipBoardTask extends AsyncTask<String, Void, Void> {\n    private final DevSupportManager mDevSupportManager;\n\n    private CopyToHostClipBoardTask(DevSupportManager devSupportManager) {\n      mDevSupportManager = devSupportManager;\n    }\n\n    @Override\n    protected Void doInBackground(String... clipBoardString) {\n      try {\n        String sendClipBoardUrl =\n            Uri.parse(mDevSupportManager.getSourceUrl()).buildUpon()\n                .path(\"/copy-to-clipboard\")\n                .query(null)\n                .build()\n                .toString();\n        for (String string: clipBoardString) {\n          OkHttpClient client = new OkHttpClient();\n          RequestBody body = RequestBody.create(null, string);\n          Request request = new Request.Builder().url(sendClipBoardUrl).post(body).build();\n          client.newCall(request).execute();\n        }\n      } catch (Exception e) {\n        FLog.e(ReactConstants.TAG, \"Could not copy to the host clipboard\", e);\n      }\n      return null;\n    }\n  }\n\n  protected RedBoxDialog(\n    Context context,\n    DevSupportManager devSupportManager,\n    @Nullable RedBoxHandler redBoxHandler) {\n    super(context, R.style.Theme_Catalyst_RedBox);\n\n    requestWindowFeature(Window.FEATURE_NO_TITLE);\n\n    setContentView(R.layout.redbox_view);\n\n    mDevSupportManager = devSupportManager;\n    mDoubleTapReloadRecognizer = new DoubleTapReloadRecognizer();\n    mRedBoxHandler = redBoxHandler;\n\n    mStackView = (ListView) findViewById(R.id.rn_redbox_stack);\n    mStackView.setOnItemClickListener(this);\n\n    mReloadJsButton = (Button) findViewById(R.id.rn_redbox_reload_button);\n    mReloadJsButton.setOnClickListener(new View.OnClickListener() {\n      @Override\n      public void onClick(View v) {\n        mDevSupportManager.handleReloadJS();\n      }\n    });\n    mDismissButton = (Button) findViewById(R.id.rn_redbox_dismiss_button);\n    mDismissButton.setOnClickListener(new View.OnClickListener() {\n      @Override\n      public void onClick(View v) {\n        dismiss();\n      }\n    });\n    mCopyToClipboardButton = (Button) findViewById(R.id.rn_redbox_copy_button);\n    mCopyToClipboardButton.setOnClickListener(new View.OnClickListener() {\n      @Override\n      public void onClick(View v) {\n        String title = mDevSupportManager.getLastErrorTitle();\n        StackFrame[] stack = mDevSupportManager.getLastErrorStack();\n        Assertions.assertNotNull(title);\n        Assertions.assertNotNull(stack);\n        new CopyToHostClipBoardTask(mDevSupportManager).executeOnExecutor(\n            AsyncTask.THREAD_POOL_EXECUTOR,\n            StackTraceHelper.formatStackTrace(title, stack));\n      }\n    });\n\n    if (mRedBoxHandler != null && mRedBoxHandler.isReportEnabled()) {\n      mLoadingIndicator = (ProgressBar) findViewById(R.id.rn_redbox_loading_indicator);\n      mLineSeparator = (View) findViewById(R.id.rn_redbox_line_separator);\n      mReportTextView = (TextView) findViewById(R.id.rn_redbox_report_label);\n      mReportTextView.setMovementMethod(LinkMovementMethod.getInstance());\n      mReportTextView.setHighlightColor(Color.TRANSPARENT);\n      mReportButton = (Button) findViewById(R.id.rn_redbox_report_button);\n      mReportButton.setOnClickListener(mReportButtonOnClickListener);\n    }\n  }\n\n  public void setExceptionDetails(String title, StackFrame[] stack) {\n    mStackView.setAdapter(new StackAdapter(title, stack));\n  }\n\n  /**\n   * Show the report button, hide the report textview and the loading indicator.\n   */\n  public void resetReporting(boolean enabled) {\n    if (mRedBoxHandler == null || !mRedBoxHandler.isReportEnabled()) {\n      return;\n    }\n    isReporting = false;\n    Assertions.assertNotNull(mReportTextView).setVisibility(View.GONE);\n    Assertions.assertNotNull(mLoadingIndicator).setVisibility(View.GONE);\n    Assertions.assertNotNull(mLineSeparator).setVisibility(View.GONE);\n    Assertions.assertNotNull(mReportButton).setVisibility(\n      enabled ? View.VISIBLE : View.GONE);\n    Assertions.assertNotNull(mReportButton).setEnabled(true);\n  }\n\n  @Override\n  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n    new OpenStackFrameTask(mDevSupportManager).executeOnExecutor(\n        AsyncTask.THREAD_POOL_EXECUTOR,\n        (StackFrame) mStackView.getAdapter().getItem(position));\n  }\n\n  @Override\n  public boolean onKeyUp(int keyCode, KeyEvent event) {\n    if (keyCode == KeyEvent.KEYCODE_MENU) {\n      mDevSupportManager.showDevOptionsDialog();\n      return true;\n    }\n    if (mDoubleTapReloadRecognizer.didDoubleTapR(keyCode, getCurrentFocus())) {\n      mDevSupportManager.handleReloadJS();\n    }\n    return super.onKeyUp(keyCode, event);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxHandler.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.text.SpannedString;\n\nimport com.facebook.react.devsupport.interfaces.StackFrame;\n\n/**\n * Interface used by {@link DevSupportManagerImpl} to allow interception on any redboxes\n * during development and handling the information from the redbox.\n * The implementation should be passed by setRedBoxHandler in ReactInstanceManager.\n */\npublic interface RedBoxHandler {\n  enum ErrorType {\n    JS(\"JS\"),\n    NATIVE(\"Native\");\n\n    private final String name;\n    ErrorType(String name) {\n      this.name = name;\n    }\n    public String getName() {\n      return name;\n    }\n  }\n\n  /**\n   * Callback interface for {@link #reportRedbox}.\n   */\n  interface ReportCompletedListener {\n    void onReportSuccess(SpannedString spannedString);\n    void onReportError(SpannedString spannedString);\n  }\n\n  /**\n   * Handle the information from the redbox.\n   */\n  void handleRedbox(String title, StackFrame[] stack, ErrorType errorType);\n\n  /**\n   * Whether the report feature is enabled.\n   */\n  boolean isReportEnabled();\n\n  /**\n   * Report the information from the redbox and set up a callback listener.\n   */\n  void reportRedbox(\n    String title,\n    StackFrame[] stack,\n    String sourceUrl,\n    ReportCompletedListener reportCompletedListener);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/StackTraceHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.ReadableType;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.devsupport.interfaces.StackFrame;\nimport java.io.File;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport javax.annotation.Nullable;\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\n/**\n * Helper class converting JS and Java stack traces into arrays of {@link StackFrame} objects.\n */\npublic class StackTraceHelper {\n\n  public static final java.lang.String COLUMN_KEY = \"column\";\n  public static final java.lang.String LINE_NUMBER_KEY = \"lineNumber\";\n\n  private static final Pattern STACK_FRAME_PATTERN = Pattern.compile(\n      \"^(?:(.*?)@)?(.*?)\\\\:([0-9]+)\\\\:([0-9]+)$\");\n\n  /**\n   * Represents a generic entry in a stack trace, be it originally from JS or Java.\n   */\n  public static class StackFrameImpl implements StackFrame {\n    private final String mFile;\n    private final String mMethod;\n    private final int mLine;\n    private final int mColumn;\n    private final String mFileName;\n\n    private StackFrameImpl(String file, String method, int line, int column) {\n      mFile = file;\n      mMethod = method;\n      mLine = line;\n      mColumn = column;\n      mFileName = file != null ? new File(file).getName() : \"\";\n    }\n\n    private StackFrameImpl(String file, String fileName, String method, int line, int column) {\n      mFile = file;\n      mFileName = fileName;\n      mMethod = method;\n      mLine = line;\n      mColumn = column;\n    }\n\n    /**\n     * Get the file this stack frame points to.\n     *\n     * JS traces return the full path to the file here, while Java traces only return the file name\n     * (the path is not known).\n     */\n    public String getFile() {\n      return mFile;\n    }\n\n    /**\n     * Get the name of the method this frame points to.\n     */\n    public String getMethod() {\n      return mMethod;\n    }\n\n    /**\n     * Get the line number this frame points to in the file returned by {@link #getFile()}.\n     */\n    public int getLine() {\n      return mLine;\n    }\n\n    /**\n     * Get the column this frame points to in the file returned by {@link #getFile()}.\n     */\n    public int getColumn() {\n      return mColumn;\n    }\n\n    /**\n     * Get just the name of the file this frame points to.\n     *\n     * For JS traces this is different from {@link #getFile()} in that it only returns the file\n     * name, not the full path. For Java traces there is no difference.\n     */\n    public String getFileName() {\n      return mFileName;\n    }\n\n    /**\n     * Convert the stack frame to a JSON representation.\n     */\n    public JSONObject toJSON() {\n      return new JSONObject(\n          MapBuilder.of(\n              \"file\", getFile(),\n              \"methodName\", getMethod(),\n              \"lineNumber\", getLine(),\n              \"column\", getColumn()));\n    }\n  }\n\n  /**\n   * Convert a JavaScript stack trace (see {@code parseErrorStack} JS module) to an array of\n   * {@link StackFrame}s.\n   */\n  public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) {\n    int size = stack != null ? stack.size() : 0;\n    StackFrame[] result = new StackFrame[size];\n    for (int i = 0; i < size; i++) {\n      ReadableType type = stack.getType(i);\n      if (type == ReadableType.Map) {\n        ReadableMap frame = stack.getMap(i);\n        String methodName = frame.getString(\"methodName\");\n        String fileName = frame.getString(\"file\");\n        int lineNumber = -1;\n        if (frame.hasKey(LINE_NUMBER_KEY) && !frame.isNull(LINE_NUMBER_KEY)) {\n          lineNumber = frame.getInt(LINE_NUMBER_KEY);\n        }\n        int columnNumber = -1;\n        if (frame.hasKey(COLUMN_KEY) && !frame.isNull(COLUMN_KEY)) {\n          columnNumber = frame.getInt(COLUMN_KEY);\n        }\n        result[i] = new StackFrameImpl(fileName, methodName, lineNumber, columnNumber);\n      } else if (type == ReadableType.String) {\n        result[i] = new StackFrameImpl(null, stack.getString(i), -1, -1);\n      }\n    }\n    return result;\n  }\n\n  /**\n   * Convert a JavaScript stack trace (see {@code parseErrorStack} JS module) to an array of\n   * {@link StackFrame}s.\n   */\n  public static StackFrame[] convertJsStackTrace(JSONArray stack) {\n    int size = stack != null ? stack.length() : 0;\n    StackFrame[] result = new StackFrame[size];\n    try {\n      for (int i = 0; i < size; i++) {\n        JSONObject frame = stack.getJSONObject(i);\n        String methodName = frame.getString(\"methodName\");\n        String fileName = frame.getString(\"file\");\n        int lineNumber = -1;\n        if (frame.has(LINE_NUMBER_KEY) && !frame.isNull(LINE_NUMBER_KEY)) {\n          lineNumber = frame.getInt(LINE_NUMBER_KEY);\n        }\n        int columnNumber = -1;\n        if (frame.has(COLUMN_KEY) && !frame.isNull(COLUMN_KEY)) {\n          columnNumber = frame.getInt(COLUMN_KEY);\n        }\n        result[i] = new StackFrameImpl(fileName, methodName, lineNumber, columnNumber);\n      }\n    } catch (JSONException exception) {\n      throw new RuntimeException(exception);\n    }\n    return result;\n  }\n\n  /**\n   * Convert a JavaScript stack trace to an array of {@link StackFrame}s.\n   */\n  public static StackFrame[] convertJsStackTrace(String stack) {\n    String[] stackTrace = stack.split(\"\\n\");\n    StackFrame[] result = new StackFrame[stackTrace.length];\n    for (int i = 0; i < stackTrace.length; ++i) {\n      Matcher matcher = STACK_FRAME_PATTERN.matcher(stackTrace[i]);\n      if (matcher.find()) {\n        result[i] = new StackFrameImpl(\n          matcher.group(2),\n          matcher.group(1) == null ? \"(unknown)\" : matcher.group(1),\n          Integer.parseInt(matcher.group(3)),\n          Integer.parseInt(matcher.group(4)));\n      } else {\n        result[i] = new StackFrameImpl(null, stackTrace[i], -1, -1);\n      }\n    }\n    return result;\n  }\n\n  /**\n   * Convert a {@link Throwable} to an array of {@link StackFrame}s.\n   */\n  public static StackFrame[] convertJavaStackTrace(Throwable exception) {\n    StackTraceElement[] stackTrace = exception.getStackTrace();\n    StackFrame[] result = new StackFrame[stackTrace.length];\n    for (int i = 0; i < stackTrace.length; i++) {\n      result[i] = new StackFrameImpl(\n          stackTrace[i].getClassName(),\n          stackTrace[i].getFileName(),\n          stackTrace[i].getMethodName(),\n          stackTrace[i].getLineNumber(),\n          -1);\n    }\n    return result;\n  }\n\n  /**\n   * Format a {@link StackFrame} to a String (method name is not included).\n   */\n  public static String formatFrameSource(StackFrame frame) {\n    StringBuilder lineInfo = new StringBuilder();\n    lineInfo.append(frame.getFileName());\n    final int line = frame.getLine();\n    if (line > 0) {\n      lineInfo.append(\":\").append(line);\n      final int column = frame.getColumn();\n      if (column > 0) {\n        lineInfo.append(\":\").append(column);\n      }\n    }\n    return lineInfo.toString();\n  }\n\n  /**\n   * Format an array of {@link StackFrame}s with the error title to a String.\n   */\n  public static String formatStackTrace(String title, StackFrame[] stack) {\n    StringBuilder stackTrace = new StringBuilder();\n    stackTrace.append(title).append(\"\\n\");\n    for (StackFrame frame: stack) {\n      stackTrace.append(frame.getMethod())\n          .append(\"\\n\")\n          .append(\"    \")\n          .append(formatFrameSource(frame))\n          .append(\"\\n\");\n    }\n\n    return stackTrace.toString();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/WebsocketJavaScriptExecutor.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport android.os.Handler;\nimport android.os.Looper;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.JavaJSExecutor;\nimport java.util.HashMap;\nimport java.util.concurrent.Semaphore;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport javax.annotation.Nullable;\n\n/**\n * Executes JS remotely via the react nodejs server as a proxy to a browser on the host machine.\n */\npublic class WebsocketJavaScriptExecutor implements JavaJSExecutor {\n\n  private static final long CONNECT_TIMEOUT_MS = 5000;\n  private static final int CONNECT_RETRY_COUNT = 3;\n\n  public interface JSExecutorConnectCallback {\n    void onSuccess();\n    void onFailure(Throwable cause);\n  }\n\n  public static class WebsocketExecutorTimeoutException extends Exception {\n    public WebsocketExecutorTimeoutException(String message) {\n      super(message);\n    }\n  }\n\n  private static class JSExecutorCallbackFuture implements\n    JSDebuggerWebSocketClient.JSDebuggerCallback {\n\n    private final Semaphore mSemaphore = new Semaphore(0);\n    private @Nullable Throwable mCause;\n    private @Nullable String mResponse;\n\n    @Override\n    public void onSuccess(@Nullable String response) {\n      mResponse = response;\n      mSemaphore.release();\n    }\n\n    @Override\n    public void onFailure(Throwable cause) {\n      mCause = cause;\n      mSemaphore.release();\n    }\n\n    /**\n     * Call only once per object instance!\n     */\n    public @Nullable String get() throws Throwable {\n      mSemaphore.acquire();\n      if (mCause != null) {\n        throw mCause;\n      }\n      return mResponse;\n    }\n  }\n\n  final private HashMap<String, String> mInjectedObjects = new HashMap<>();\n  private @Nullable JSDebuggerWebSocketClient mWebSocketClient;\n\n  public void connect(final String webSocketServerUrl, final JSExecutorConnectCallback callback) {\n    final AtomicInteger retryCount = new AtomicInteger(CONNECT_RETRY_COUNT);\n    final JSExecutorConnectCallback retryProxyCallback = new JSExecutorConnectCallback() {\n      @Override\n      public void onSuccess() {\n        callback.onSuccess();\n      }\n\n      @Override\n      public void onFailure(Throwable cause) {\n        if (retryCount.decrementAndGet() <= 0) {\n          callback.onFailure(cause);\n        } else {\n          connectInternal(webSocketServerUrl, this);\n        }\n      }\n    };\n    connectInternal(webSocketServerUrl, retryProxyCallback);\n  }\n\n  private void connectInternal(\n      String webSocketServerUrl,\n      final JSExecutorConnectCallback callback) {\n    final JSDebuggerWebSocketClient client = new JSDebuggerWebSocketClient();\n    final Handler timeoutHandler = new Handler(Looper.getMainLooper());\n    client.connect(\n        webSocketServerUrl, new JSDebuggerWebSocketClient.JSDebuggerCallback() {\n          // It's possible that both callbacks can fire on an error so make sure we only\n          // dispatch results once to our callback.\n          private boolean didSendResult = false;\n\n          @Override\n          public void onSuccess(@Nullable String response) {\n            client.prepareJSRuntime(\n                new JSDebuggerWebSocketClient.JSDebuggerCallback() {\n                  @Override\n                  public void onSuccess(@Nullable String response) {\n                    timeoutHandler.removeCallbacksAndMessages(null);\n                    mWebSocketClient = client;\n                    if (!didSendResult) {\n                      callback.onSuccess();\n                      didSendResult = true;\n                    }\n                  }\n\n                  @Override\n                  public void onFailure(Throwable cause) {\n                    timeoutHandler.removeCallbacksAndMessages(null);\n                    if (!didSendResult) {\n                      callback.onFailure(cause);\n                      didSendResult = true;\n                    }\n                  }\n                });\n          }\n\n          @Override\n          public void onFailure(Throwable cause) {\n            timeoutHandler.removeCallbacksAndMessages(null);\n            if (!didSendResult) {\n              callback.onFailure(cause);\n              didSendResult = true;\n            }\n          }\n        });\n    timeoutHandler.postDelayed(\n        new Runnable() {\n          @Override\n          public void run() {\n            client.closeQuietly();\n            callback.onFailure(\n                new WebsocketExecutorTimeoutException(\n                    \"Timeout while connecting to remote debugger\"));\n          }\n        },\n        CONNECT_TIMEOUT_MS);\n  }\n\n  @Override\n  public void close() {\n    if (mWebSocketClient != null) {\n      mWebSocketClient.closeQuietly();\n    }\n  }\n\n  @Override\n  public void loadApplicationScript(String sourceURL) throws JavaJSExecutor.ProxyExecutorException {\n    JSExecutorCallbackFuture callback = new JSExecutorCallbackFuture();\n    Assertions.assertNotNull(mWebSocketClient).loadApplicationScript(\n        sourceURL,\n        mInjectedObjects,\n        callback);\n    try {\n      callback.get();\n    } catch (Throwable cause) {\n      throw new ProxyExecutorException(cause);\n    }\n  }\n\n  @Override\n  public @Nullable String executeJSCall(String methodName, String jsonArgsArray)\n      throws JavaJSExecutor.ProxyExecutorException {\n    JSExecutorCallbackFuture callback = new JSExecutorCallbackFuture();\n    Assertions.assertNotNull(mWebSocketClient).executeJSCall(\n        methodName,\n        jsonArgsArray,\n        callback);\n    try {\n      return callback.get();\n    } catch (Throwable cause) {\n      throw new ProxyExecutorException(cause);\n    }\n  }\n\n  @Override\n  public void setGlobalVariable(String propertyName, String jsonEncodedValue) {\n    // Store and use in the next loadApplicationScript() call.\n    mInjectedObjects.put(propertyName, jsonEncodedValue);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/WindowOverlayCompat.java",
    "content": "package com.facebook.react.devsupport;\n\nimport android.os.Build;\nimport android.view.WindowManager;\n\n/**\n * Compatibility wrapper for apps targeting API level 26 or later.\n * See https://developer.android.com/about/versions/oreo/android-8.0-changes.html#cwt\n */\n/* package */ class WindowOverlayCompat {\n\n  private static final int ANDROID_OREO = 26;\n  private static final int TYPE_APPLICATION_OVERLAY = 2038;\n\n  static final int TYPE_SYSTEM_ALERT = Build.VERSION.SDK_INT < ANDROID_OREO ? WindowManager.LayoutParams.TYPE_SYSTEM_ALERT : TYPE_APPLICATION_OVERLAY;\n  static final int TYPE_SYSTEM_OVERLAY = Build.VERSION.SDK_INT < ANDROID_OREO ? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY : TYPE_APPLICATION_OVERLAY;\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevBundleDownloadListener.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport.interfaces;\n\nimport javax.annotation.Nullable;\n\npublic interface DevBundleDownloadListener {\n  void onSuccess();\n  void onProgress(@Nullable String status, @Nullable Integer done, @Nullable Integer total);\n  void onFailure(Exception cause);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevOptionHandler.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport.interfaces;\n\n/**\n * Callback class for custom options that may appear in {@link DevSupportManager} developer\n * options menu. In case when option registered for this handler is selected from the menu, the\n * instance method {@link #onOptionSelected} will be triggered.\n */\npublic interface DevOptionHandler {\n\n  /**\n   * Triggered in case when user select custom developer option from the developers options menu\n   * displayed with {@link DevSupportManager}.\n   */\n  public void onOptionSelected();\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport.interfaces;\n\nimport javax.annotation.Nullable;\n\nimport java.io.File;\n\nimport com.facebook.react.bridge.NativeModuleCallExceptionHandler;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.modules.debug.interfaces.DeveloperSettings;\n\n/**\n * Interface for accessing and interacting with development features.\n * In dev mode, use the implementation {@link DevSupportManagerImpl}.\n * In production mode, use the dummy implementation {@link DisabledDevSupportManager}.\n */\npublic interface DevSupportManager extends NativeModuleCallExceptionHandler {\n\n  void showNewJavaError(String message, Throwable e);\n  void addCustomDevOption(String optionName, DevOptionHandler optionHandler);\n  void showNewJSError(String message, ReadableArray details, int errorCookie);\n  void updateJSError(final String message, final ReadableArray details, final int errorCookie);\n  void hideRedboxDialog();\n  void showDevOptionsDialog();\n  void setDevSupportEnabled(boolean isDevSupportEnabled);\n  void startInspector();\n  void stopInspector();\n  boolean getDevSupportEnabled();\n  DeveloperSettings getDevSettings();\n  void onNewReactContextCreated(ReactContext reactContext);\n  void onReactInstanceDestroyed(ReactContext reactContext);\n  String getSourceMapUrl();\n  String getSourceUrl();\n  String getJSBundleURLForRemoteDebugging();\n  String getDownloadedJSBundleFile();\n  boolean hasUpToDateJSBundleInCache();\n  void reloadSettings();\n  void handleReloadJS();\n  void reloadJSFromServer(final String bundleURL);\n  void isPackagerRunning(PackagerStatusCallback callback);\n  @Nullable File downloadBundleResourceFromUrlSync(\n      final String resourceURL,\n      final File outputFile);\n  @Nullable String getLastErrorTitle();\n  @Nullable StackFrame[] getLastErrorStack();\n  void registerErrorCustomizer(ErrorCustomizer errorCustomizer);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/ErrorCustomizer.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\npackage com.facebook.react.devsupport.interfaces;\n\nimport android.util.Pair;\n\n/**\n * Interface that lets parts of the app process the errors before showing the redbox\n */\npublic interface ErrorCustomizer {\n\n  /**\n   * The function that need to be registered using {@link DevSupportManager}.registerErrorCustomizer\n   * and is called before passing the error to the RedBox.\n   */\n  Pair<String, StackFrame[]> customizeErrorInfo(Pair<String, StackFrame[]> errorInfo);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/PackagerStatusCallback.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport.interfaces;\n\npublic interface PackagerStatusCallback {\n  void onPackagerStatusFetched(boolean packagerIsRunning);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/StackFrame.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport.interfaces;\n\nimport org.json.JSONObject;\n\n/**\n  * Represents a generic entry in a stack trace, be it originally from JS or Java.\n  */\npublic interface StackFrame {\n  /**\n    * Get the file this stack frame points to.\n    *\n    * JS traces return the full path to the file here, while Java traces only return the file name\n    * (the path is not known).\n    */\n  public String getFile();\n\n  /**\n    * Get the name of the method this frame points to.\n    */\n  public String getMethod();\n\n  /**\n    * Get the line number this frame points to in the file returned by {@link #getFile()}.\n    */\n  public int getLine();\n\n  /**\n    * Get the column this frame points to in the file returned by {@link #getFile()}.\n    */\n  public int getColumn();\n\n  /**\n    * Get just the name of the file this frame points to.\n    *\n    * For JS traces this is different from {@link #getFile()} in that it only returns the file\n    * name, not the full path. For Java traces there is no difference.\n    */\n  public String getFileName();\n\n  /**\n   * Convert the stack frame to a JSON representation.\n   */\n  public JSONObject toJSON();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/AbstractDrawBorder.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.Path;\nimport android.graphics.PathEffect;\nimport android.graphics.RectF;\n\n/**\n * Base class for border drawing operations (used by DrawImage and DrawBorder). Draws rectangular or\n * rounded border along the rectangle, defined by the bounding box of the AbstractDrawCommand.\n */\n/* package */ abstract class AbstractDrawBorder extends AbstractDrawCommand {\n\n  private static final Paint PAINT = new Paint(Paint.ANTI_ALIAS_FLAG);\n  private static final RectF TMP_RECT = new RectF();\n  private static final int BORDER_PATH_DIRTY = 1 << 0;\n\n  static {\n    PAINT.setStyle(Paint.Style.STROKE);\n  }\n\n  private int mSetPropertiesFlag;\n  private int mBorderColor = Color.BLACK;\n  private float mBorderWidth;\n  private float mBorderRadius;\n  private @Nullable Path mPathForBorderRadius;\n\n  public final void setBorderWidth(float borderWidth) {\n    mBorderWidth = borderWidth;\n    setFlag(BORDER_PATH_DIRTY);\n  }\n\n  public final float getBorderWidth() {\n    return mBorderWidth;\n  }\n\n  public void setBorderRadius(float borderRadius) {\n    mBorderRadius = borderRadius;\n    setFlag(BORDER_PATH_DIRTY);\n  }\n\n  public final float getBorderRadius() {\n    return mBorderRadius;\n  }\n\n  public final void setBorderColor(int borderColor) {\n    mBorderColor = borderColor;\n  }\n\n  public final int getBorderColor() {\n    return mBorderColor;\n  }\n\n  @Override\n  protected void onBoundsChanged() {\n    setFlag(BORDER_PATH_DIRTY);\n  }\n\n  protected final void drawBorders(Canvas canvas) {\n    if (mBorderWidth < 0.5f) {\n      return;\n    }\n\n    if (mBorderColor == 0) {\n      return;\n    }\n\n    PAINT.setColor(mBorderColor);\n    PAINT.setStrokeWidth(mBorderWidth);\n    PAINT.setPathEffect(getPathEffectForBorderStyle());\n    canvas.drawPath(getPathForBorderRadius(), PAINT);\n  }\n\n  protected final void updatePath(Path path, float correction) {\n    path.reset();\n\n    TMP_RECT.set(\n        getLeft() + correction,\n        getTop() + correction,\n        getRight() - correction,\n        getBottom() - correction);\n\n    path.addRoundRect(\n        TMP_RECT,\n        mBorderRadius,\n        mBorderRadius,\n        Path.Direction.CW);\n  }\n\n  protected @Nullable PathEffect getPathEffectForBorderStyle() {\n    return null;\n  }\n\n  protected final boolean isFlagSet(int mask) {\n    return (mSetPropertiesFlag & mask) == mask;\n  }\n\n  protected final void setFlag(int mask) {\n    mSetPropertiesFlag |= mask;\n  }\n\n  protected final void resetFlag(int mask) {\n    mSetPropertiesFlag &= ~mask;\n  }\n\n  protected final Path getPathForBorderRadius() {\n    if (isFlagSet(BORDER_PATH_DIRTY)) {\n      if (mPathForBorderRadius == null) {\n        mPathForBorderRadius = new Path();\n      }\n\n      updatePath(mPathForBorderRadius, mBorderWidth * 0.5f);\n\n      resetFlag(BORDER_PATH_DIRTY);\n    }\n\n    return mPathForBorderRadius;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/AbstractDrawCommand.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.Typeface;\n\n/**\n * Base class for all DrawCommands. Becomes immutable once it has its bounds set. Until then, a\n * subclass is able to mutate any of its properties (e.g. updating Layout in DrawTextLayout).\n *\n * The idea is to be able to reuse unmodified objects when we build up DrawCommands before we ship\n * them to UI thread, but we can only do that if DrawCommands are immutable.\n */\n/* package */ abstract class AbstractDrawCommand extends DrawCommand implements Cloneable {\n\n  private float mLeft;\n  private float mTop;\n  private float mRight;\n  private float mBottom;\n  private boolean mFrozen;\n\n  protected boolean mNeedsClipping;\n  private float mClipLeft;\n  private float mClipTop;\n  private float mClipRight;\n  private float mClipBottom;\n\n  // Used to draw highlights in debug draw.\n  private static Paint sDebugHighlightRed;\n  private static Paint sDebugHighlightYellow;\n  private static Paint sDebugHighlightOverlayText;\n\n  public final boolean clipBoundsMatch(\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom) {\n    return mClipLeft == clipLeft && mClipTop == clipTop\n        && mClipRight == clipRight && mClipBottom == clipBottom;\n  }\n\n  protected final void setClipBounds(\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom) {\n    mClipLeft = clipLeft;\n    mClipTop = clipTop;\n    mClipRight = clipRight;\n    mClipBottom = clipBottom;\n    // We put this check here to not clip when we have the default [-infinity, infinity] bounds,\n    // since clipRect in those cases is essentially no-op anyway. This is needed to fix a bug that\n    // shows up during screenshot testing. Note that checking one side is enough, since if one side\n    // is infinite, all sides will be infinite, since we only set infinite for all sides at the\n    // same time - conversely, if one side is finite, all sides will be finite.\n    mNeedsClipping = mClipLeft != Float.NEGATIVE_INFINITY;\n  }\n\n  public final float getClipLeft() {\n    return mClipLeft;\n  }\n\n  public final float getClipTop() {\n    return mClipTop;\n  }\n\n  public final float getClipRight() {\n    return mClipRight;\n  }\n\n  public final float getClipBottom() {\n    return mClipBottom;\n  }\n\n  protected void applyClipping(Canvas canvas) {\n    canvas.clipRect(mClipLeft, mClipTop, mClipRight, mClipBottom);\n  }\n\n  /**\n   * Don't override this unless you need to do custom clipping in a draw command.  Otherwise just\n   * override onPreDraw and onDraw.\n   */\n  @Override\n  public void draw(FlatViewGroup parent, Canvas canvas) {\n    onPreDraw(parent, canvas);\n    if (mNeedsClipping && shouldClip()) {\n      canvas.save(Canvas.CLIP_SAVE_FLAG);\n      applyClipping(canvas);\n      onDraw(canvas);\n      canvas.restore();\n    } else {\n      onDraw(canvas);\n    }\n  }\n\n  protected static int getDebugBorderColor() {\n    return Color.CYAN;\n  }\n\n  protected String getDebugName() {\n    return getClass().getSimpleName().substring(4);\n  }\n\n  private void initDebugHighlightResources(FlatViewGroup parent) {\n    if (sDebugHighlightRed == null) {\n      sDebugHighlightRed = new Paint();\n      sDebugHighlightRed.setARGB(75, 255, 0, 0);\n    }\n    if (sDebugHighlightYellow == null) {\n      sDebugHighlightYellow = new Paint();\n      sDebugHighlightYellow.setARGB(100, 255, 204, 0);\n    }\n    if (sDebugHighlightOverlayText == null) {\n      sDebugHighlightOverlayText = new Paint();\n      sDebugHighlightOverlayText.setAntiAlias(true);\n      sDebugHighlightOverlayText.setARGB(200, 50, 50, 50);\n      sDebugHighlightOverlayText.setTextAlign(Paint.Align.RIGHT);\n      sDebugHighlightOverlayText.setTypeface(Typeface.MONOSPACE);\n      sDebugHighlightOverlayText.setTextSize(parent.dipsToPixels(9));\n    }\n  }\n\n  private void debugDrawHighlightRect(Canvas canvas, Paint paint, String text) {\n    canvas.drawRect(getLeft(), getTop(), getRight(), getBottom(), paint);\n    canvas.drawText(text, getRight() - 5, getBottom() - 5, sDebugHighlightOverlayText);\n  }\n\n  protected void debugDrawWarningHighlight(Canvas canvas, String text) {\n    debugDrawHighlightRect(canvas, sDebugHighlightRed, text);\n  }\n\n  protected void debugDrawCautionHighlight(Canvas canvas, String text) {\n    debugDrawHighlightRect(canvas, sDebugHighlightYellow, text);\n  }\n\n  @Override\n  public final void debugDraw(FlatViewGroup parent, Canvas canvas) {\n    onDebugDraw(parent, canvas);\n    if (FlatViewGroup.DEBUG_HIGHLIGHT_PERFORMANCE_ISSUES) {\n      initDebugHighlightResources(parent);\n      onDebugDrawHighlight(canvas);\n    }\n  }\n\n  protected void onDebugDraw(FlatViewGroup parent, Canvas canvas) {\n    parent.debugDrawNamedRect(\n        canvas,\n        getDebugBorderColor(),\n        getDebugName(),\n        mLeft,\n        mTop,\n        mRight,\n        mBottom);\n  }\n\n  protected void onDebugDrawHighlight(Canvas canvas) {\n  }\n\n  protected void onPreDraw(FlatViewGroup parent, Canvas canvas) {\n  }\n\n  /**\n   * Updates boundaries of the AbstractDrawCommand and freezes it.\n   * Will return a frozen copy if the current AbstractDrawCommand cannot be mutated.\n   *\n   * This should not be called on a DrawView, as the DrawView is modified on UI thread.  Use\n   * DrawView.collectDrawView instead to avoid race conditions.\n   */\n  public AbstractDrawCommand updateBoundsAndFreeze(\n      float left,\n      float top,\n      float right,\n      float bottom,\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom) {\n    if (mFrozen) {\n      // see if we can reuse it\n      boolean boundsMatch = boundsMatch(left, top, right, bottom);\n      boolean clipBoundsMatch = clipBoundsMatch(clipLeft, clipTop, clipRight, clipBottom);\n      if (boundsMatch && clipBoundsMatch) {\n        return this;\n      }\n\n      try {\n        AbstractDrawCommand copy = (AbstractDrawCommand) clone();\n        if (!boundsMatch) {\n          copy.setBounds(left, top, right, bottom);\n        }\n        if (!clipBoundsMatch) {\n          copy.setClipBounds(clipLeft, clipTop, clipRight, clipBottom);\n        }\n        return copy;\n      } catch (CloneNotSupportedException e) {\n        // This should not happen since AbstractDrawCommand implements Cloneable\n        throw new RuntimeException(e);\n      }\n    }\n\n    setBounds(left, top, right, bottom);\n    setClipBounds(clipLeft, clipTop, clipRight, clipBottom);\n    mFrozen = true;\n    return this;\n  }\n\n  /**\n   * Returns a non-frozen shallow copy of AbstractDrawCommand as defined by {@link Object#clone()}.\n   */\n  public final AbstractDrawCommand mutableCopy() {\n    try {\n      AbstractDrawCommand copy = (AbstractDrawCommand) super.clone();\n      copy.mFrozen = false;\n      return copy;\n    } catch (CloneNotSupportedException e) {\n      // should not happen since we implement Cloneable\n      throw new RuntimeException(e);\n    }\n  }\n\n  /**\n   * Returns whether this object was frozen and thus cannot be mutated.\n   */\n  public final boolean isFrozen() {\n    return mFrozen;\n  }\n\n  /**\n   * Mark this object as frozen, indicating that it should not be mutated.\n   */\n  public final void freeze() {\n    mFrozen = true;\n  }\n\n  /**\n   * Left position of this DrawCommand relative to the hosting View.\n   */\n  public final float getLeft() {\n    return mLeft;\n  }\n\n  /**\n   * Top position of this DrawCommand relative to the hosting View.\n   */\n  public final float getTop() {\n    return mTop;\n  }\n\n  /**\n   * Right position of this DrawCommand relative to the hosting View.\n   */\n  public final float getRight() {\n    return mRight;\n  }\n\n  /**\n   * Bottom position of this DrawCommand relative to the hosting View.\n   */\n  public final float getBottom() {\n    return mBottom;\n  }\n\n  protected abstract void onDraw(Canvas canvas);\n\n  protected boolean shouldClip() {\n    return mLeft < getClipLeft() || mTop < getClipTop() ||\n        mRight > getClipRight() || mBottom > getClipBottom();\n  }\n\n  protected void onBoundsChanged() {\n  }\n\n  /**\n   * Updates boundaries of this DrawCommand.\n   */\n  protected final void setBounds(float left, float top, float right, float bottom) {\n    mLeft = left;\n    mTop = top;\n    mRight = right;\n    mBottom = bottom;\n\n    onBoundsChanged();\n  }\n\n  /**\n   * Returns true if boundaries match and don't need to be updated. False otherwise.\n   */\n  protected final boolean boundsMatch(float left, float top, float right, float bottom) {\n    return mLeft == left && mTop == top && mRight == right && mBottom == bottom;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/AndroidView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\ninterface AndroidView {\n\n  /**\n   * Whether or not custom layout is needed for the children\n   * @return a boolean representing whether custom layout is needed\n   */\n  boolean needsCustomLayoutForChildren();\n\n  /**\n   * Did the padding change\n   * @return a boolean representing whether the padding changed\n   */\n  boolean isPaddingChanged();\n\n  /**\n   * Reset the padding changed internal state\n   */\n  void resetPaddingChanged();\n\n  /**\n   * Get the padding for a certain spacingType defined in com.facebook.yoga.Spacing\n   */\n  float getPadding(int spacingType);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/AttachDetachListener.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\n/**\n * An interface that DrawCommands need to implement into order to receive\n * {@link android.view.View#onAttachedToWindow()} and\n * {@link android.view.View#onDetachedFromWindow()} events.\n */\n/* package */ interface AttachDetachListener {\n  public static final AttachDetachListener[] EMPTY_ARRAY = new AttachDetachListener[0];\n\n  /**\n   * Called when a DrawCommand is being attached to a visible View hierarchy.\n   * @param callback a WeakReference to a View that provides invalidate() helper method.\n   */\n  public void onAttached(FlatViewGroup.InvalidateCallback callback);\n\n  /**\n   * Called when a DrawCommand is being detached from a visible View hierarchy.\n   */\n  public void onDetached();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"flat\",\n    srcs = glob([\"*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fbcore\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-drawee\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-react-native\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:imagepipeline\"),\n        react_native_dep(\"libraries/textlayoutbuilder:textlayoutbuilder\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/modules/fresco:fresco\"),\n        react_native_target(\"java/com/facebook/react/modules/i18nmanager:i18nmanager\"),\n        react_native_target(\"java/com/facebook/react/touch:touch\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/art:art\"),\n        react_native_target(\"java/com/facebook/react/views/image:image\"),\n        react_native_target(\"java/com/facebook/react/views/imagehelper:withmultisource\"),\n        react_native_target(\"java/com/facebook/react/views/modal:modal\"),\n        react_native_target(\"java/com/facebook/react/views/text:text\"),\n        react_native_target(\"java/com/facebook/react/views/textinput:textinput\"),\n        react_native_target(\"java/com/facebook/react/views/view:view\"),\n        react_native_target(\"java/com/facebook/react/views/viewpager:viewpager\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/BitmapUpdateListener.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.graphics.Bitmap;\n\n/* package */ interface BitmapUpdateListener {\n  public void onSecondaryAttach(Bitmap bitmap);\n  public void onBitmapReady(Bitmap bitmap);\n  public void onImageLoadEvent(int imageLoadEvent);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/ClippingDrawCommandManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\n\nimport android.graphics.Canvas;\nimport android.graphics.Rect;\nimport android.util.SparseArray;\nimport android.util.SparseIntArray;\nimport android.view.View;\nimport android.view.animation.Animation;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.uimanager.ReactClippingViewGroup;\nimport com.facebook.react.uimanager.ReactClippingViewGroupHelper;\n\n/**\n * Abstract class for a {@link DrawCommandManager} with directional clipping.  Allows support for\n * vertical and horizontal clipping by implementing abstract methods.\n *\n * Uses two dynamic programming arrays to efficiently update which views and commands are onscreen,\n * while not having to sort the incoming draw commands.  The draw commands are loosely sorted, as\n * they represent a flattening of the normal view hierarchy, and we use that information to quickly\n * find children that should be considered onscreen.  One array keeps track of, for each index, the\n * maximum bottom position that occurs at or before that index; the other keeps track of the\n * minimum top position that occurs at or after that index. Given the following children:\n *\n *       +---------------------------------+    0 (Y coordinate)\n *       | 0                               |\n *       |  +-----------+                  |   10\n *       |  | 1         |                  |\n *       |  |           | +--------------+ |   20\n *       |  |           | | 3            | |\n *       |  +-----------+ |              | |   30\n *       |                |              | |\n *       |  +-----------+ |              | |   40\n *       |  | 2         | |              | |\n *       |  |           | +--------------+ |   50\n *       |  |           |                  |\n *       |  +-----------+                  |   60\n *       |                                 |\n *       +---------------------------------+   70\n *\n *          +-----------+                      80\n *          | 4         |\n *          |           | +--------------+     90\n *          |           | | 6            |\n *          +-----------+ |              |    100\n *                        |              |\n *          +-----------+ |              |    110\n *          | 5         | |              |\n *          |           | +--------------+    120\n *          |           |\n *          +-----------+                     130\n *\n * The two arrays are:\n *                 0   1   2   3    4    5    6\n *   Max Bottom: [70, 70, 70, 70, 100, 130, 130]\n *   Min Top:    [ 0,  0,  0,  0,  80,  90,  90]\n *\n * We can then binary search for the first max bottom that is above our rect, and the first min top\n * that is below our rect.\n *\n * If the top and bottom of the rect are 55 and 85, respectively, we will start drawing at index 0\n * and stop at index 4.\n *\n *       +---------------------------------+    0 (Y coordinate)\n *       | 0                               |\n *       |  +-----------+                  |   10\n *       |  | 1         |                  |\n *       |  |           | +--------------+ |   20\n *       |  |           | | 3            | |\n *       |  +-----------+ |              | |   30\n *       |                |              | |\n *       |  +-----------+ |              | |   40\n *       |  | 2         | |              | |\n *       |  |           | +--------------+ |   50\n *   -  -| -| -  -  -  -| -  -  -  -  -  - |-  -  -\n *       |  +-----------+                  |   60\n *       |                                 |\n *       +---------------------------------+   70\n *\n *          +-----------+                      80\n *   -  -  -| 4 -  -  - | -  -  -  -  -  -  -  -  -\n *          |           | +--------------+     90\n *          |           | | 6            |\n *          +-----------+ |              |    100\n *                        |              |\n *          +-----------+ |              |    110\n *          | 5         | |              |\n *          |           | +--------------+    120\n *          |           |\n *          +-----------+                     130\n *\n * If the top and bottom are 75 and 105 respectively, we will start drawing at index 4 and stop at\n * index 6.\n *\n *       +---------------------------------+    0 (Y coordinate)\n *       | 0                               |\n *       |  +-----------+                  |   10\n *       |  | 1         |                  |\n *       |  |           | +--------------+ |   20\n *       |  |           | | 3            | |\n *       |  +-----------+ |              | |   30\n *       |                |              | |\n *       |  +-----------+ |              | |   40\n *       |  | 2         | |              | |\n *       |  |           | +--------------+ |   50\n *       |  |           |                  |\n *       |  +-----------+                  |   60\n *       |                                 |\n *       +---------------------------------+   70\n *   -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -\n *          +-----------+                      80\n *          | 4         |\n *          |           | +--------------+     90\n *          |           | | 6            |\n *          +-----------+ |              |    100\n *   -  -  -  -  -  -  -  |-  -  -  -  - |  -  -  -\n *          +-----------+ |              |    110\n *          | 5         | |              |\n *          |           | +--------------+    120\n *          |           |\n *          +-----------+                     130\n *\n * While this doesn't map exactly to all of the commands that could be clipped, it means that\n * children which contain other children (a pretty common case when flattening views) are clipped\n * or unclipped as one logical unit.  This has the side effect of minimizing the amount of\n * invalidates coming from minor clipping rect adjustments.  The underlying dynamic programming\n * arrays can be calculated off the UI thread in O(n) time, requiring just two passes through the\n * command array.\n *\n * We do a similar optimization when searching for matching node regions, as node regions are\n * loosely sorted as well when clipping.\n */\n/* package */ abstract class ClippingDrawCommandManager extends DrawCommandManager {\n\n  private static final String TAG = ClippingDrawCommandManager.class.getSimpleName();\n\n  private final FlatViewGroup mFlatViewGroup;\n  private DrawCommand[] mDrawCommands = DrawCommand.EMPTY_ARRAY;\n  protected float[] mCommandMaxBottom = StateBuilder.EMPTY_FLOAT_ARRAY;\n  protected float[] mCommandMinTop = StateBuilder.EMPTY_FLOAT_ARRAY;\n\n  private NodeRegion[] mNodeRegions = NodeRegion.EMPTY_ARRAY;\n  protected float[] mRegionMaxBottom = StateBuilder.EMPTY_FLOAT_ARRAY;\n  protected float[] mRegionMinTop = StateBuilder.EMPTY_FLOAT_ARRAY;\n\n  // Onscreen bounds of draw command array.\n  private int mStart;\n  private int mStop;\n\n  // Mapping of ids to index position within the draw command array.  O(log n) lookups should be\n  // less in our case because of the large constant overhead and auto boxing of the map.\n  private SparseIntArray mDrawViewIndexMap = StateBuilder.EMPTY_SPARSE_INT;\n  // Map of views that are currently clipped.\n  private final SparseArray<View> mClippedSubviews = new SparseArray<>();\n\n  protected final Rect mClippingRect = new Rect();\n\n  // Used in updating the clipping rect, as sometimes we want to detach all views, which means we\n  // need to temporarily store the views we are detaching and removing.  These are always of size\n  // 0, except when used in update clipping rect.\n  private final SparseArray<View> mViewsToRemove = new SparseArray<>();\n  private final ArrayList<View> mViewsToKeep = new ArrayList<>();\n\n  // Currently clipping ViewGroups\n  private final ArrayList<ReactClippingViewGroup> mClippingViewGroups = new ArrayList<>();\n\n  ClippingDrawCommandManager(FlatViewGroup flatViewGroup, DrawCommand[] drawCommands) {\n    mFlatViewGroup = flatViewGroup;\n    initialSetup(drawCommands);\n  }\n\n  /**\n   * Initially setup this instance.  Makes sure the draw commands are mounted, and that our\n   * clipping rect reflects our current bounds.\n   *\n   * @param drawCommands The list of current draw commands.  In current implementations, this will\n   *   always be DrawCommand.EMPTY_ARRAY\n   */\n  private void initialSetup(DrawCommand[] drawCommands) {\n    mountDrawCommands(\n        drawCommands,\n        mDrawViewIndexMap,\n        mCommandMaxBottom,\n        mCommandMinTop,\n        true);\n    updateClippingRect();\n  }\n\n  /**\n   * @return index of the first command that could be on the screen.\n   */\n  abstract int commandStartIndex();\n\n  /**\n   * @return index of the first command that is guaranteed to be off the screen, starting from the\n   *   given start.\n   */\n  abstract int commandStopIndex(int start);\n\n  /**\n   * @return index of the first region that is guaranteed to be outside of the bounds for touch.\n   */\n  abstract int regionStopIndex(float touchX, float touchY);\n\n  /**\n   * Whether an index and all indices before it are guaranteed to be out of bounds for the current\n   * touch.\n   *\n   * @param index The region index to check.\n   * @param touchX X coordinate.\n   * @param touchY Y coordinate.\n   * @return true if the index and all before it are out of bounds.\n   */\n  abstract boolean regionAboveTouch(int index, float touchX, float touchY);\n\n  @Override\n  public void mountDrawCommands(\n      DrawCommand[] drawCommands,\n      SparseIntArray drawViewIndexMap,\n      float[] maxBottom,\n      float[] minTop,\n      boolean willMountViews) {\n    mDrawCommands = drawCommands;\n    mCommandMaxBottom = maxBottom;\n    mCommandMinTop = minTop;\n    mDrawViewIndexMap = drawViewIndexMap;\n    if (mClippingRect.bottom != mClippingRect.top) {\n      mStart = commandStartIndex();\n      mStop = commandStopIndex(mStart);\n      if (!willMountViews) {\n        // If we are not mounting views, we still need to update view indices and positions.  It is\n        // possible that a child changed size and we still need new clipping even though we are not\n        // mounting views.\n        updateClippingToCurrentRect();\n      }\n    }\n  }\n\n  @Override\n  public void mountNodeRegions(NodeRegion[] nodeRegions, float[] maxBottom, float[] minTop) {\n    mNodeRegions = nodeRegions;\n    mRegionMaxBottom = maxBottom;\n    mRegionMinTop = minTop;\n  }\n\n  @Override\n  public @Nullable NodeRegion virtualNodeRegionWithinBounds(float touchX, float touchY) {\n    int i = regionStopIndex(touchX, touchY);\n    while (i-- > 0) {\n      NodeRegion nodeRegion = mNodeRegions[i];\n      if (!nodeRegion.mIsVirtual) {\n        // only interested in virtual nodes\n        continue;\n      }\n      if (regionAboveTouch(i, touchX, touchY)) {\n        break;\n      }\n      if (nodeRegion.withinBounds(touchX, touchY)) {\n        return nodeRegion;\n      }\n    }\n\n    return null;\n  }\n\n  @Override\n  public @Nullable NodeRegion anyNodeRegionWithinBounds(float touchX, float touchY) {\n    int i = regionStopIndex(touchX, touchY);\n    while (i-- > 0) {\n      NodeRegion nodeRegion = mNodeRegions[i];\n      if (regionAboveTouch(i, touchX, touchY)) {\n        break;\n      }\n      if (nodeRegion.withinBounds(touchX, touchY)) {\n        return nodeRegion;\n      }\n    }\n\n    return null;\n  }\n\n  private void clip(int id, View view) {\n    mClippedSubviews.put(id, view);\n  }\n\n  private void unclip(int id) {\n    mClippedSubviews.remove(id);\n  }\n\n  private boolean isClipped(int id) {\n    return mClippedSubviews.get(id) != null;\n  }\n\n  private boolean isNotClipped(int id) {\n    return mClippedSubviews.get(id) == null;\n  }\n\n  @Override\n  void onClippedViewDropped(View view) {\n    unclip(view.getId());\n    mFlatViewGroup.removeDetachedView(view);\n  }\n\n  @Override\n  public void mountViews(ViewResolver viewResolver, int[] viewsToAdd, int[] viewsToDetach) {\n    mClippingViewGroups.clear();\n    for (int viewToAdd : viewsToAdd) {\n      // Views that are just temporarily detached are marked with a negative value.\n      boolean newView = viewToAdd > 0;\n      if (!newView) {\n        viewToAdd = -viewToAdd;\n      }\n\n      int commandArrayIndex = mDrawViewIndexMap.get(viewToAdd);\n      DrawView drawView = (DrawView) mDrawCommands[commandArrayIndex];\n      View view = viewResolver.getView(drawView.reactTag);\n      ensureViewHasNoParent(view);\n\n      // these views need to support recursive clipping of subviews\n      if (view instanceof ReactClippingViewGroup &&\n          ((ReactClippingViewGroup) view).getRemoveClippedSubviews()) {\n        mClippingViewGroups.add((ReactClippingViewGroup) view);\n      }\n\n      if (newView) {\n        // This view was not previously attached to this parent.\n        drawView.mWasMounted = true;\n        if (animating(view) || withinBounds(commandArrayIndex)) {\n          // View should be drawn.  This view can't currently be clipped because it wasn't\n          // previously attached to this parent.\n          mFlatViewGroup.addViewInLayout(view);\n        } else {\n          clip(drawView.reactTag, view);\n        }\n      } else {\n        // This view was previously attached, and just temporarily detached.\n        if (drawView.mWasMounted) {\n          // The DrawView has been mounted before.\n          if (isNotClipped(drawView.reactTag)) {\n            // The DrawView is not clipped.  Attach it.\n            mFlatViewGroup.attachViewToParent(view);\n          }\n          // else The DrawView has been previously mounted and is clipped, so don't attach it.\n        } else {\n          // We are mounting it, so lets get this part out of the way.\n          drawView.mWasMounted = true;\n          // The DrawView has not been mounted before, which means the bounds changed and triggered\n          // a new DrawView when it was collected from the shadow node.  We have a view with the\n          // same id temporarily detached, but its bounds have changed.\n          if (animating(view) || withinBounds(commandArrayIndex)) {\n            // View should be drawn.\n            if (isClipped(drawView.reactTag)) {\n              // View was clipped, so add it.\n              mFlatViewGroup.addViewInLayout(view);\n              unclip(drawView.reactTag);\n            } else {\n              // View was just temporarily removed, so attach it.  We already know it isn't clipped,\n              // so no need to unclip it.\n              mFlatViewGroup.attachViewToParent(view);\n            }\n          } else {\n            // View should be clipped.\n            if (isNotClipped(drawView.reactTag)) {\n              // View was onscreen.\n              mFlatViewGroup.removeDetachedView(view);\n              clip(drawView.reactTag, view);\n            }\n            // else view is already clipped and not within bounds.\n          }\n        }\n      }\n    }\n\n    for (int viewToDetach : viewsToDetach) {\n      View view = viewResolver.getView(viewToDetach);\n      if (view.getParent() != null) {\n        throw new RuntimeException(\"Trying to remove view not owned by FlatViewGroup\");\n      } else {\n        mFlatViewGroup.removeDetachedView(view);\n      }\n      // The view isn't clipped anymore, but gone entirely.\n      unclip(viewToDetach);\n    }\n  }\n\n  /**\n   * Returns true if a view is currently animating.\n   */\n  private static boolean animating(View view) {\n    Animation animation = view.getAnimation();\n    return animation != null && !animation.hasEnded();\n  }\n\n  /**\n   * Returns true if a command index is currently onscreen.\n   */\n  private boolean withinBounds(int i) {\n    return mStart <= i && i < mStop;\n  }\n\n  @Override\n  public boolean updateClippingRect() {\n    ReactClippingViewGroupHelper.calculateClippingRect(mFlatViewGroup, mClippingRect);\n    if (mFlatViewGroup.getParent() == null || mClippingRect.top == mClippingRect.bottom) {\n      // If we are unparented or are clipping to an empty rect, no op.  Return false so we don't\n      // invalidate.\n      return false;\n    }\n\n    int start = commandStartIndex();\n    int stop = commandStopIndex(start);\n    if (mStart <= start && stop <= mStop) {\n      // We would only be removing children, don't invalidate and don't bother changing the\n      // attached children.\n      updateClippingRecursively();\n      return false;\n    }\n\n    mStart = start;\n    mStop = stop;\n\n    updateClippingToCurrentRect();\n    updateClippingRecursively();\n    return true;\n  }\n\n  private void updateClippingRecursively() {\n    for (int i = 0, children = mClippingViewGroups.size(); i < children; i++) {\n      ReactClippingViewGroup view = mClippingViewGroups.get(i);\n      if (isNotClipped(((View) view).getId())) {\n        view.updateClippingRect();\n      }\n    }\n  }\n\n  /**\n   * Used either after we have updated the current rect, or when we have mounted new commands and\n   * the rect hasn't changed.  Updates the clipping after mStart and mStop have been set to the\n   * correct values.  For draw commands, this is all it takes to update the command mounting, as\n   * draw commands are only attached in a conceptual sense, and don't rely on the android view\n   * hierarchy.\n   *\n   * For native children, we have to walk through our current views and remove any that are no\n   * longer on screen, and add those that are newly on screen.  As an optimization for fling, if we\n   * are removing two or more native views we instead detachAllViews from the {@link FlatViewGroup}\n   * and re-attach or add as needed.\n   *\n   * This approximation is roughly correct, as we tend to add and remove the same amount of views,\n   * and each add and remove pair is O(n); detachAllViews and re-attach requires two passes, so\n   * using this once we are removing more than two native views is a good breakpoint.\n   */\n  private void updateClippingToCurrentRect() {\n    for (int i = 0, size = mFlatViewGroup.getChildCount(); i < size; i++) {\n      View view = mFlatViewGroup.getChildAt(i);\n      int index = mDrawViewIndexMap.get(view.getId());\n      if (withinBounds(index) || animating(view)) {\n        mViewsToKeep.add(view);\n      } else {\n        mViewsToRemove.append(i, view);\n        clip(view.getId(), view);\n      }\n    }\n\n    int removeSize = mViewsToRemove.size();\n    boolean removeAll = removeSize > 2;\n\n    if (removeAll) {\n      // Detach all, as we are changing quite a few views, whether flinging or otherwise.\n      mFlatViewGroup.detachAllViewsFromParent();\n\n      for (int i = 0; i < removeSize; i++) {\n        mFlatViewGroup.removeDetachedView(mViewsToRemove.valueAt(i));\n      }\n    } else {\n      // Simple clipping sweep, as we are changing relatively few views.\n      while (removeSize-- > 0) {\n        mFlatViewGroup.removeViewsInLayout(mViewsToRemove.keyAt(removeSize), 1);\n      }\n    }\n    mViewsToRemove.clear();\n\n    int current = mStart;\n    int childIndex = 0;\n\n    for (int i = 0, size = mViewsToKeep.size(); i < size; i++) {\n      View view = mViewsToKeep.get(i);\n      int commandIndex = mDrawViewIndexMap.get(view.getId());\n      if (current <= commandIndex) {\n        while (current != commandIndex) {\n          if (mDrawCommands[current] instanceof DrawView) {\n            DrawView drawView = (DrawView) mDrawCommands[current];\n            mFlatViewGroup.addViewInLayout(\n                Assertions.assumeNotNull(mClippedSubviews.get(drawView.reactTag)),\n                childIndex++);\n            unclip(drawView.reactTag);\n          }\n          current++;\n        }\n        // We are currently at the command index, but we want to increment beyond it.\n        current++;\n      }\n      if (removeAll) {\n        mFlatViewGroup.attachViewToParent(view, childIndex);\n      }\n      // We want to make sure we increment the child index even if we didn't detach it to maintain\n      // order.\n      childIndex++;\n    }\n    mViewsToKeep.clear();\n\n    while (current < mStop) {\n      if (mDrawCommands[current] instanceof DrawView) {\n        DrawView drawView = (DrawView) mDrawCommands[current];\n        mFlatViewGroup.addViewInLayout(\n            Assertions.assumeNotNull(mClippedSubviews.get(drawView.reactTag)),\n            childIndex++);\n        unclip(drawView.reactTag);\n      }\n      current++;\n    }\n  }\n\n  @Override\n  public void getClippingRect(Rect outClippingRect) {\n    outClippingRect.set(mClippingRect);\n  }\n\n  @Override\n  public SparseArray<View> getDetachedViews() {\n    return mClippedSubviews;\n  }\n\n  /**\n   * Draws the unclipped commands on the given canvas.  This would be much simpler if we didn't\n   * have to worry about animating views, as we could simply:\n   *\n   *   for (int i = start; i < stop; i++) {\n   *     drawCommands[i].draw(...);\n   *   }\n   *\n   * This is complicated however by animating views, which may occur before or after the current\n   * clipping rect.  Consider the following array:\n   *\n   *   +--------------+\n   *   |  DrawView    | 0\n   *   | *animating*  |\n   *   +--------------+\n   *   | DrawCommmand | 1\n   *   |  *clipped*   |\n   *   +--------------+\n   *   | DrawCommand  | 2 start\n   *   |              |\n   *   +--------------+\n   *   | DrawCommand  | 3\n   *   |              |\n   *   +--------------+\n   *   |  DrawView    | 4\n   *   |              |\n   *   +--------------+\n   *   |  DrawView    | 5 stop\n   *   |  *clipped*   |\n   *   +--------------+\n   *   |  DrawView    | 6\n   *   | *animating*  |\n   *   +--------------+\n   *\n   * 2, 3, and 4 are onscreen according to bounds, while 0 and 6 are onscreen according to\n   * animation.  We have to walk through the attached children making sure to draw any draw\n   * commands that should be drawn before that draw view, as well as making sure not to draw any\n   * draw commands that are out of bounds.\n   *\n   * @param canvas The canvas to draw on.\n   */\n  @Override\n  public void draw(Canvas canvas) {\n    int commandIndex = mStart;\n    int size = mFlatViewGroup.getChildCount();\n\n    // Iterate through the children, making sure that we draw any draw commands we haven't drawn\n    // that should happen before the next draw view.\n    for (int i = 0; i < size; i++) {\n      // This is the command index of the next view that we need to draw.  Since a view might be\n      // animating, this view is either before all the commands onscreen, onscreen, or after the\n      // onscreen commands.\n      int viewIndex = mDrawViewIndexMap.get(mFlatViewGroup.getChildAt(i).getId());\n      if (mStop < viewIndex) {\n        // The current view is outside of the viewport bounds.  We want to draw all the commands\n        // up to the stop, then draw all the views outside the viewport bounds.\n        while (commandIndex < mStop) {\n          mDrawCommands[commandIndex++].draw(mFlatViewGroup, canvas);\n        }\n        // We are now out of commands to draw, so we could just draw the remaining attached\n        // children, but the for loop logic will draw the rest anyway.\n      } else if (commandIndex <= viewIndex) {\n        // The viewIndex is within our onscreen bounds (or == stop).  We want to draw all the\n        // commands from the current position to the current view, inclusive.\n        while (commandIndex < viewIndex) {\n          mDrawCommands[commandIndex++].draw(mFlatViewGroup, canvas);\n        }\n        // Command index now == viewIndex, so increment beyond it.\n        commandIndex++;\n      }\n      mDrawCommands[viewIndex].draw(mFlatViewGroup, canvas);\n    }\n\n    // If we get here, it means we have drawn all the views, now just draw the remaining draw\n    // commands.\n    while (commandIndex < mStop) {\n      DrawCommand command = mDrawCommands[commandIndex++];\n      if (command instanceof DrawView) {\n        // We should never have more DrawView commands at this point. But in case we do, fail safely\n        // by ignoring the DrawView command\n        FLog.w(\n            TAG,\n            \"Unexpected DrawView command at index \" + (commandIndex-1) + \" with mStop=\" +\n              mStop + \". \" + Arrays.toString(mDrawCommands));\n        continue;\n      }\n      command.draw(mFlatViewGroup, canvas);\n    }\n  }\n\n  @Override\n  void debugDraw(Canvas canvas) {\n    // Draws clipped draw commands, but does not draw clipped views.\n    for (DrawCommand drawCommand : mDrawCommands) {\n      if (drawCommand instanceof DrawView) {\n        if (isNotClipped(((DrawView) drawCommand).reactTag)) {\n          drawCommand.debugDraw(mFlatViewGroup, canvas);\n        }\n        // else, don't draw, and don't increment index\n      } else {\n        drawCommand.debugDraw(mFlatViewGroup, canvas);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/DrawBackgroundColor.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\n\n/**\n * Draws background for a FlatShadowNode as a solid rectangle.\n */\n/* package */ final class DrawBackgroundColor extends AbstractDrawCommand {\n\n  private static final Paint PAINT = new Paint();\n\n  private final int mBackgroundColor;\n\n  /* package */ DrawBackgroundColor(int backgroundColor) {\n    mBackgroundColor = backgroundColor;\n  }\n\n  @Override\n  public void onDraw(Canvas canvas) {\n    PAINT.setColor(mBackgroundColor);\n    canvas.drawRect(getLeft(), getTop(), getRight(), getBottom(), PAINT);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.DashPathEffect;\nimport android.graphics.Paint;\nimport android.graphics.Path;\n\nimport com.facebook.react.uimanager.Spacing;\n\n/* package */ final class DrawBorder extends AbstractDrawBorder {\n\n  private static final Paint PAINT = new Paint(Paint.ANTI_ALIAS_FLAG);\n  private static final float[] TMP_FLOAT_ARRAY = new float[4];\n\n  private static final int BORDER_STYLE_SOLID = 0;\n  private static final int BORDER_STYLE_DOTTED = 1;\n  private static final int BORDER_STYLE_DASHED = 2;\n\n  private static final int BORDER_LEFT_COLOR_SET = 1 << 1;\n  private static final int BORDER_TOP_COLOR_SET = 1 << 2;\n  private static final int BORDER_RIGHT_COLOR_SET = 1 << 3;\n  private static final int BORDER_BOTTOM_COLOR_SET = 1 << 4;\n  private static final int BORDER_PATH_EFFECT_DIRTY = 1 << 5;\n\n  // ~0 == 0xFFFFFFFF, all bits set to 1.\n  private static final int ALL_BITS_SET = ~0;\n  // 0 == 0x00000000, all bits set to 0.\n  private static final int ALL_BITS_UNSET = 0;\n\n  private float mBorderLeftWidth;\n  private float mBorderTopWidth;\n  private float mBorderRightWidth;\n  private float mBorderBottomWidth;\n\n  private int mBorderLeftColor;\n  private int mBorderTopColor;\n  private int mBorderRightColor;\n  private int mBorderBottomColor;\n\n  private int mBorderStyle = BORDER_STYLE_SOLID;\n\n  private int mBackgroundColor;\n\n  private @Nullable DashPathEffect mPathEffectForBorderStyle;\n  private @Nullable Path mPathForBorder;\n\n  public void setBorderWidth(int position, float borderWidth) {\n    switch (position) {\n      case Spacing.LEFT:\n        mBorderLeftWidth = borderWidth;\n        break;\n      case Spacing.TOP:\n        mBorderTopWidth = borderWidth;\n        break;\n      case Spacing.RIGHT:\n        mBorderRightWidth = borderWidth;\n        break;\n      case Spacing.BOTTOM:\n        mBorderBottomWidth = borderWidth;\n        break;\n      case Spacing.ALL:\n        setBorderWidth(borderWidth);\n        break;\n    }\n  }\n\n  public float getBorderWidth(int position) {\n    switch (position) {\n      case Spacing.LEFT:\n        return mBorderLeftWidth;\n      case Spacing.TOP:\n        return mBorderTopWidth;\n      case Spacing.RIGHT:\n        return mBorderRightWidth;\n      case Spacing.BOTTOM:\n        return mBorderBottomWidth;\n      case Spacing.ALL:\n        return getBorderWidth();\n    }\n\n    return 0.0f;\n  }\n\n  public void setBorderStyle(@Nullable String style) {\n    if (\"dotted\".equals(style)) {\n      mBorderStyle = BORDER_STYLE_DOTTED;\n    } else if (\"dashed\".equals(style)) {\n      mBorderStyle = BORDER_STYLE_DASHED;\n    } else {\n      mBorderStyle = BORDER_STYLE_SOLID;\n    }\n\n    setFlag(BORDER_PATH_EFFECT_DIRTY);\n  }\n\n  public void resetBorderColor(int position) {\n    switch (position) {\n      case Spacing.LEFT:\n        resetFlag(BORDER_LEFT_COLOR_SET);\n        break;\n      case Spacing.TOP:\n        resetFlag(BORDER_TOP_COLOR_SET);\n        break;\n      case Spacing.RIGHT:\n        resetFlag(BORDER_RIGHT_COLOR_SET);\n        break;\n      case Spacing.BOTTOM:\n        resetFlag(BORDER_BOTTOM_COLOR_SET);\n        break;\n      case Spacing.ALL:\n        setBorderColor(Color.BLACK);\n        break;\n    }\n  }\n\n  public void setBorderColor(int position, int borderColor) {\n    switch (position) {\n      case Spacing.LEFT:\n        mBorderLeftColor = borderColor;\n        setFlag(BORDER_LEFT_COLOR_SET);\n        break;\n      case Spacing.TOP:\n        mBorderTopColor = borderColor;\n        setFlag(BORDER_TOP_COLOR_SET);\n        break;\n      case Spacing.RIGHT:\n        mBorderRightColor = borderColor;\n        setFlag(BORDER_RIGHT_COLOR_SET);\n        break;\n      case Spacing.BOTTOM:\n        mBorderBottomColor = borderColor;\n        setFlag(BORDER_BOTTOM_COLOR_SET);\n        break;\n      case Spacing.ALL:\n        setBorderColor(borderColor);\n        break;\n    }\n  }\n\n  public int getBorderColor(int position) {\n    int defaultColor = getBorderColor();\n    switch (position) {\n      case Spacing.LEFT:\n        return resolveBorderColor(BORDER_LEFT_COLOR_SET, mBorderLeftColor, defaultColor);\n      case Spacing.TOP:\n        return resolveBorderColor(BORDER_TOP_COLOR_SET, mBorderTopColor, defaultColor);\n      case Spacing.RIGHT:\n        return resolveBorderColor(BORDER_RIGHT_COLOR_SET, mBorderRightColor, defaultColor);\n      case Spacing.BOTTOM:\n        return resolveBorderColor(BORDER_BOTTOM_COLOR_SET, mBorderBottomColor, defaultColor);\n      case Spacing.ALL:\n        return defaultColor;\n    }\n\n    return defaultColor;\n  }\n\n  public void setBackgroundColor(int backgroundColor) {\n    mBackgroundColor = backgroundColor;\n  }\n\n  public int getBackgroundColor() {\n    return mBackgroundColor;\n  }\n\n  @Override\n  protected void onDraw(Canvas canvas) {\n    if (getBorderRadius() >= 0.5f || getPathEffectForBorderStyle() != null) {\n      drawRoundedBorders(canvas);\n    } else {\n      drawRectangularBorders(canvas);\n    }\n  }\n\n  @Override\n  protected @Nullable DashPathEffect getPathEffectForBorderStyle() {\n    if (isFlagSet(BORDER_PATH_EFFECT_DIRTY)) {\n      switch (mBorderStyle) {\n        case BORDER_STYLE_DOTTED:\n          mPathEffectForBorderStyle = createDashPathEffect(getBorderWidth());\n          break;\n\n        case BORDER_STYLE_DASHED:\n          mPathEffectForBorderStyle = createDashPathEffect(getBorderWidth() * 3);\n          break;\n\n        default:\n          mPathEffectForBorderStyle = null;\n          break;\n      }\n\n      resetFlag(BORDER_PATH_EFFECT_DIRTY);\n    }\n\n    return mPathEffectForBorderStyle;\n  }\n\n  private void drawRoundedBorders(Canvas canvas) {\n    if (mBackgroundColor != 0) {\n      PAINT.setColor(mBackgroundColor);\n      canvas.drawPath(getPathForBorderRadius(), PAINT);\n    }\n\n    drawBorders(canvas);\n  }\n\n  /**\n   * Quickly determine if all the set border colors are equal.  Bitwise AND all the set colors\n   * together, then OR them all together.  If the AND and the OR are the same, then the colors\n   * are compatible, so return this color.\n   *\n   * Used to avoid expensive path creation and expensive calls to canvas.drawPath\n   *\n   * @return A compatible border color, or zero if the border colors are not compatible.\n   */\n  private static int fastBorderCompatibleColorOrZero(\n      float borderLeft,\n      float borderTop,\n      float borderRight,\n      float borderBottom,\n      int colorLeft,\n      int colorTop,\n      int colorRight,\n      int colorBottom) {\n    int andSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_SET) &\n        (borderTop > 0 ? colorTop : ALL_BITS_SET) &\n        (borderRight > 0 ? colorRight : ALL_BITS_SET) &\n        (borderBottom > 0 ? colorBottom : ALL_BITS_SET);\n    int orSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_UNSET) |\n        (borderTop > 0 ? colorTop : ALL_BITS_UNSET) |\n        (borderRight > 0 ? colorRight : ALL_BITS_UNSET) |\n        (borderBottom > 0 ? colorBottom : ALL_BITS_UNSET);\n    return andSmear == orSmear ? andSmear : 0;\n  }\n\n  private void drawRectangularBorders(Canvas canvas) {\n    int defaultColor = getBorderColor();\n    float defaultWidth = getBorderWidth();\n\n    float top = getTop();\n    float borderTop = resolveWidth(mBorderTopWidth, defaultWidth);\n    float topInset = top + borderTop;\n    int topColor = resolveBorderColor(BORDER_TOP_COLOR_SET, mBorderTopColor, defaultColor);\n\n    float bottom = getBottom();\n    float borderBottom = resolveWidth(mBorderBottomWidth, defaultWidth);\n    float bottomInset = bottom - borderBottom;\n    int bottomColor = resolveBorderColor(BORDER_BOTTOM_COLOR_SET, mBorderBottomColor, defaultColor);\n\n    float left = getLeft();\n    float borderLeft = resolveWidth(mBorderLeftWidth, defaultWidth);\n    float leftInset = left + borderLeft;\n    int leftColor = resolveBorderColor(BORDER_LEFT_COLOR_SET, mBorderLeftColor, defaultColor);\n\n    float right = getRight();\n    float borderRight = resolveWidth(mBorderRightWidth, defaultWidth);\n    float rightInset = right - borderRight;\n    int rightColor = resolveBorderColor(BORDER_RIGHT_COLOR_SET, mBorderRightColor, defaultColor);\n\n    // Check for fast path to border drawing.\n    int fastBorderColor = fastBorderCompatibleColorOrZero(\n        borderLeft,\n        borderTop,\n        borderRight,\n        borderBottom,\n        leftColor,\n        topColor,\n        rightColor,\n        bottomColor);\n    if (fastBorderColor != 0) {\n      // Fast border color draw.\n      if (Color.alpha(fastBorderColor) != 0) {\n        // Border color is not transparent.\n\n        // Draw center.\n        if (Color.alpha(mBackgroundColor) != 0) {\n          PAINT.setColor(mBackgroundColor);\n          if (Color.alpha(fastBorderColor) == 255) {\n            // The border will draw over the edges, so only draw the inset background.\n            canvas.drawRect(leftInset, topInset, rightInset, bottomInset, PAINT);\n          } else {\n            // The border is opaque, so we have to draw the entire background color.\n            canvas.drawRect(left, top, right, bottom, PAINT);\n          }\n        }\n\n        PAINT.setColor(fastBorderColor);\n        if (borderLeft > 0) {\n          canvas.drawRect(left, top, leftInset, bottom - borderBottom, PAINT);\n        }\n        if (borderTop > 0) {\n          canvas.drawRect(left + borderLeft, top, right, topInset, PAINT);\n        }\n        if (borderRight > 0) {\n          canvas.drawRect(rightInset, top + borderTop, right, bottom, PAINT);\n        }\n        if (borderBottom > 0) {\n          canvas.drawRect(left, bottomInset, right - borderRight, bottom, PAINT);\n        }\n      }\n    } else {\n      if (mPathForBorder == null) {\n        mPathForBorder = new Path();\n      }\n\n      // Draw center.  Any of the borders might be opaque or transparent, so we need to draw this.\n      if (Color.alpha(mBackgroundColor) != 0) {\n        PAINT.setColor(mBackgroundColor);\n        canvas.drawRect(left, top, right, bottom, PAINT);\n      }\n\n      // Draw top.\n      if (borderTop != 0 && Color.alpha(topColor) != 0) {\n        PAINT.setColor(topColor);\n        updatePathForTopBorder(\n            mPathForBorder,\n            top,\n            topInset,\n            left,\n            leftInset,\n            right,\n            rightInset);\n        canvas.drawPath(mPathForBorder, PAINT);\n      }\n\n      // Draw bottom.\n      if (borderBottom != 0 && Color.alpha(bottomColor) != 0) {\n        PAINT.setColor(bottomColor);\n        updatePathForBottomBorder(\n            mPathForBorder,\n            bottom,\n            bottomInset,\n            left,\n            leftInset,\n            right,\n            rightInset);\n        canvas.drawPath(mPathForBorder, PAINT);\n      }\n\n      // Draw left.\n      if (borderLeft != 0 && Color.alpha(leftColor) != 0) {\n        PAINT.setColor(leftColor);\n        updatePathForLeftBorder(\n            mPathForBorder,\n            top,\n            topInset,\n            bottom,\n            bottomInset,\n            left,\n            leftInset);\n        canvas.drawPath(mPathForBorder, PAINT);\n      }\n\n      // Draw right.\n      if (borderRight != 0 && Color.alpha(rightColor) != 0) {\n        PAINT.setColor(rightColor);\n        updatePathForRightBorder(\n            mPathForBorder,\n            top,\n            topInset,\n            bottom,\n            bottomInset,\n            right,\n            rightInset);\n        canvas.drawPath(mPathForBorder, PAINT);\n      }\n    }\n  }\n\n  private static void updatePathForTopBorder(\n      Path path,\n      float top,\n      float topInset,\n      float left,\n      float leftInset,\n      float right,\n      float rightInset) {\n    path.reset();\n    path.moveTo(left, top);\n    path.lineTo(leftInset, topInset);\n    path.lineTo(rightInset, topInset);\n    path.lineTo(right, top);\n    path.lineTo(left, top);\n  }\n\n  private static void updatePathForBottomBorder(\n      Path path,\n      float bottom,\n      float bottomInset,\n      float left,\n      float leftInset,\n      float right,\n      float rightInset) {\n    path.reset();\n    path.moveTo(left, bottom);\n    path.lineTo(right, bottom);\n    path.lineTo(rightInset, bottomInset);\n    path.lineTo(leftInset, bottomInset);\n    path.lineTo(left, bottom);\n  }\n\n  private static void updatePathForLeftBorder(\n      Path path,\n      float top,\n      float topInset,\n      float bottom,\n      float bottomInset,\n      float left,\n      float leftInset) {\n    path.reset();\n    path.moveTo(left, top);\n    path.lineTo(leftInset, topInset);\n    path.lineTo(leftInset, bottomInset);\n    path.lineTo(left, bottom);\n    path.lineTo(left, top);\n  }\n\n  private static void updatePathForRightBorder(\n      Path path,\n      float top,\n      float topInset,\n      float bottom,\n      float bottomInset,\n      float right,\n      float rightInset) {\n    path.reset();\n    path.moveTo(right, top);\n    path.lineTo(right, bottom);\n    path.lineTo(rightInset, bottomInset);\n    path.lineTo(rightInset, topInset);\n    path.lineTo(right, top);\n  }\n\n  private int resolveBorderColor(int flag, int color, int defaultColor) {\n    return isFlagSet(flag) ? color : defaultColor;\n  }\n\n  private static float resolveWidth(float width, float defaultWidth) {\n    return (width == 0 || /* check for NaN */ width != width) ? defaultWidth : width;\n  }\n\n  private static DashPathEffect createDashPathEffect(float borderWidth) {\n    for (int i = 0; i < 4; ++i) {\n      TMP_FLOAT_ARRAY[i] = borderWidth;\n    }\n    return new DashPathEffect(TMP_FLOAT_ARRAY, 0);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/DrawCommand.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.graphics.Canvas;\n\n/**\n * DrawCommand is an interface that shadow nodes need to implement to do the drawing.\n * Instances of DrawCommand are created in background thread and passed to UI thread.\n * Once a DrawCommand is shared with UI thread, it can no longer be mutated in background thread.\n */\npublic abstract class DrawCommand {\n  // used by StateBuilder, FlatViewGroup and FlatShadowNode\n  /* package */ static final DrawCommand[] EMPTY_ARRAY = new DrawCommand[0];\n\n  /**\n   * Performs drawing into the given canvas.\n   *\n   * @param parent The parent to get child information from, if needed\n   * @param canvas The canvas to draw into\n   */\n  abstract void draw(FlatViewGroup parent, Canvas canvas);\n\n  /**\n   * Performs debug bounds drawing into the given canvas.\n   *\n   * @param parent The parent to get child information from, if needed\n   * @param canvas The canvas to draw into\n   */\n  abstract void debugDraw(FlatViewGroup parent, Canvas canvas);\n\n  abstract float getLeft();\n\n  abstract float getTop();\n\n  abstract float getRight();\n\n  abstract float getBottom();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/DrawCommandManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Canvas;\nimport android.graphics.Rect;\nimport android.util.SparseArray;\nimport android.util.SparseIntArray;\nimport android.view.View;\nimport android.view.ViewParent;\n\n/**\n * Underlying logic which handles draw commands, views and node regions when clipping in a\n * {@link FlatViewGroup}.\n */\n/* package */ abstract class DrawCommandManager {\n\n  /**\n   * Mount a set of draw commands to this manager.  The order the commands are given is the order in\n   * which they should be drawn.  If any of the commands are new DrawViews, then mountViews will be\n   * called after by the UIManager.\n   *\n   * @param drawCommands The draw commands to mount.\n   * @param drawViewIndexMap Mapping of ids to index position within the draw command array.\n   * @param maxBottom At each index i, the maximum bottom value (or right value in the case of\n   *   horizontal clipping) value of all draw commands at or below i.\n   * @param minTop At each index i, the minimum top value (or left value in the case of horizontal\n   *   clipping) value of all draw commands at or below i.\n   * @param willMountViews Whether we are going to also receive a mountViews command in this state\n   *   cycle.\n   */\n  abstract void mountDrawCommands(\n      DrawCommand[] drawCommands,\n      SparseIntArray drawViewIndexMap,\n      float[] maxBottom,\n      float[] minTop,\n      boolean willMountViews);\n\n  /**\n   * Add and detach a set of views.  The views added here will already have a DrawView passed in\n   * mountDrawCommands.\n   *\n   * @param viewResolver\n   * @param viewsToAdd The views to add, by tag.  If this is a new view, this will be reactTag,\n   *     otherwise it will be -reactTag.  This allows to optimize when we have already attached\n   *     views.\n   * @param viewsToDetach The views to detach, by tag.  These will all be positive.\n   */\n  abstract void mountViews(ViewResolver viewResolver, int[] viewsToAdd, int[] viewsToDetach);\n\n  /**\n   * Get the current clipping rect and adjust clipping so that when draw is dispatched we do as\n   * little work as possible.\n   *\n   * @return true if the FlatViewGroup should invalidate.\n   */\n  abstract boolean updateClippingRect();\n\n  /**\n   * Sets an input rect to match the bounds of our current clipping rect.\n   *\n   * @param outClippingRect Set the out\n   */\n  abstract void getClippingRect(Rect outClippingRect);\n\n  /**\n   * Return the views that are currently detached, so they can be cleaned up when we are.\n   *\n   * @return A collection of the currently detached views.\n   */\n  abstract SparseArray<View> getDetachedViews();\n\n  /**\n   * Draw the relevant items.  This should do as little work as possible.\n   *\n   * @param canvas The canvas to draw on.\n   */\n  abstract void draw(Canvas canvas);\n\n  /**\n   * Draws layout bounds for debug.\n   *\n   * @param canvas The canvas to draw on.\n   */\n  abstract void debugDraw(Canvas canvas);\n\n  /**\n   * Mount node regions, which are the hit boxes of the shadow node children of this FlatViewGroup,\n   * though some may not have a corresponding draw command.\n   *\n   * @param nodeRegions Array of node regions to mount.\n   * @param maxBottom At each index i, the maximum bottom value (or right value in the case of\n   *   horizontal clipping) value of all node regions at or below i.\n   * @param minTop At each index i, the minimum top value (or left value in the case of horizontal\n   *   clipping) value of all draw commands at or below i.\n   */\n  abstract void mountNodeRegions(NodeRegion[] nodeRegions, float[] maxBottom, float[] minTop);\n\n  /**\n   * Find a matching node region for a touch.\n   *\n   * @param touchX X coordinate of touch.\n   * @param touchY Y coordinate of touch.\n   * @return Matching node region, or null if none are found.\n   */\n  abstract @Nullable NodeRegion anyNodeRegionWithinBounds(float touchX, float touchY);\n\n  /**\n   * Find a matching virtual node region for a touch.\n   *\n   * @param touchX X coordinate of touch.\n   * @param touchY Y coordinate of touch.\n   * @return Matching node region, or null if none are found.\n   */\n  abstract @Nullable NodeRegion virtualNodeRegionWithinBounds(float touchX, float touchY);\n\n  /**\n   * Event that is fired when a clipped view is dropped.\n   *\n   * @param view the view that is dropped\n   */\n  abstract void onClippedViewDropped(View view);\n\n  /**\n   * Throw a runtime exception if a view we are trying to attach is already parented.\n   *\n   * @param view The view to check.\n   */\n  protected static void ensureViewHasNoParent(View view) {\n    ViewParent oldParent = view.getParent();\n    if (oldParent != null) {\n      throw new RuntimeException(\n          \"Cannot add view \" + view + \" to DrawCommandManager while it has a parent \" + oldParent);\n    }\n  }\n\n  /**\n   * Get a draw command manager that will clip vertically (The view scrolls up and down).\n   *\n   * @param flatViewGroup FlatViewGroup to use for drawing.\n   * @param drawCommands List of commands to mount.\n   * @return Vertically clipping draw command manager.\n   */\n  static DrawCommandManager getVerticalClippingInstance(\n      FlatViewGroup flatViewGroup,\n      DrawCommand[] drawCommands) {\n    return new VerticalDrawCommandManager(flatViewGroup, drawCommands);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/DrawImage.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.content.Context;\n\nimport com.facebook.drawee.drawable.ScalingUtils.ScaleType;\nimport com.facebook.react.bridge.ReadableArray;\n\n/**\n * Common interface for DrawImageWithDrawee.\n */\n/* package */ interface DrawImage extends AttachDetachListener {\n  /**\n   * Returns true if an image source was assigned to the DrawImage.\n   * A DrawImage with no source will not draw anything.\n   */\n  boolean hasImageRequest();\n\n  /**\n   * Assigns a new image source to the DrawImage, or null to clear the image request.\n   */\n  void setSource(Context context, @Nullable ReadableArray sources);\n\n  /**\n   * Assigns a tint color to apply to the image drawn.\n   */\n  void setTintColor(int tintColor);\n\n  /**\n   * Assigns a scale type to draw to the image with.\n   */\n  void setScaleType(ScaleType scaleType);\n\n  /**\n   * Returns a scale type to draw to the image with.\n   */\n  ScaleType getScaleType();\n\n  /**\n   * React tag used for dispatching ImageLoadEvents, or 0 to ignore events.\n   */\n  void setReactTag(int reactTag);\n\n  void setBorderWidth(float borderWidth);\n\n  float getBorderWidth();\n\n  void setBorderRadius(float borderRadius);\n\n  float getBorderRadius();\n\n  void setBorderColor(int borderColor);\n\n  int getBorderColor();\n\n  void setFadeDuration(int fadeDuration);\n\n  void setProgressiveRenderingEnabled(boolean enabled);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/DrawImageWithDrawee.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.PorterDuff;\nimport android.graphics.PorterDuffColorFilter;\nimport android.graphics.drawable.Animatable;\nimport android.net.Uri;\nimport com.facebook.drawee.controller.ControllerListener;\nimport com.facebook.drawee.drawable.ScalingUtils.ScaleType;\nimport com.facebook.drawee.generic.GenericDraweeHierarchy;\nimport com.facebook.drawee.generic.RoundingParams;\nimport com.facebook.imagepipeline.common.ResizeOptions;\nimport com.facebook.imagepipeline.request.ImageRequest;\nimport com.facebook.imagepipeline.request.ImageRequestBuilder;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.views.image.GlobalImageLoadListener;\nimport com.facebook.react.views.image.ImageLoadEvent;\nimport com.facebook.react.views.image.ImageResizeMode;\nimport com.facebook.react.views.image.ReactImageView;\nimport com.facebook.react.views.imagehelper.ImageSource;\nimport com.facebook.react.views.imagehelper.MultiSourceHelper;\nimport com.facebook.react.views.imagehelper.MultiSourceHelper.MultiSourceResult;\nimport java.util.LinkedList;\nimport java.util.List;\nimport javax.annotation.Nullable;\n\n/**\n * DrawImageWithDrawee is a DrawCommand that can draw a local or remote image.\n * It uses DraweeRequestHelper internally to fetch and cache the images.\n */\n/* package */ final class DrawImageWithDrawee extends AbstractDrawCommand\n    implements DrawImage, ControllerListener {\n  private static final String LOCAL_FILE_SCHEME = \"file\";\n  private static final String LOCAL_CONTENT_SCHEME = \"content\";\n\n  private final List<ImageSource> mSources = new LinkedList<>();\n  private final @Nullable GlobalImageLoadListener mGlobalImageLoadListener;\n  private @Nullable DraweeRequestHelper mRequestHelper;\n  private @Nullable PorterDuffColorFilter mColorFilter;\n  private ScaleType mScaleType = ImageResizeMode.defaultValue();\n  private float mBorderWidth;\n  private float mBorderRadius;\n  private int mBorderColor;\n  private int mReactTag;\n  private boolean mProgressiveRenderingEnabled;\n  private int mFadeDuration = ReactImageView.REMOTE_IMAGE_FADE_DURATION_MS;\n  private @Nullable FlatViewGroup.InvalidateCallback mCallback;\n\n  public DrawImageWithDrawee(@Nullable GlobalImageLoadListener globalImageLoadListener) {\n    mGlobalImageLoadListener = globalImageLoadListener;\n  }\n\n  @Override\n  public boolean hasImageRequest() {\n    return !mSources.isEmpty();\n  }\n\n  @Override\n  public void setSource(Context context, @Nullable ReadableArray sources) {\n    mSources.clear();\n    if (sources != null && sources.size() != 0) {\n      // Optimize for the case where we have just one uri, case in which we don't need the sizes\n      if (sources.size() == 1) {\n        ReadableMap source = sources.getMap(0);\n        mSources.add(new ImageSource(context, source.getString(\"uri\")));\n      } else {\n        for (int idx = 0; idx < sources.size(); idx++) {\n          ReadableMap source = sources.getMap(idx);\n          mSources.add(new ImageSource(\n              context,\n              source.getString(\"uri\"),\n              source.getDouble(\"width\"),\n              source.getDouble(\"height\")));\n        }\n      }\n    }\n  }\n\n  @Override\n  public void setTintColor(int tintColor) {\n    if (tintColor == 0) {\n      mColorFilter = null;\n    } else {\n      mColorFilter = new PorterDuffColorFilter(tintColor, PorterDuff.Mode.SRC_ATOP);\n    }\n  }\n\n  @Override\n  public void setScaleType(ScaleType scaleType) {\n    mScaleType = scaleType;\n  }\n\n  @Override\n  public ScaleType getScaleType() {\n    return mScaleType;\n  }\n\n  @Override\n  public void setBorderWidth(float borderWidth) {\n    mBorderWidth = borderWidth;\n  }\n\n  @Override\n  public float getBorderWidth() {\n    return mBorderWidth;\n  }\n\n  @Override\n  public void setBorderRadius(float borderRadius) {\n    mBorderRadius = borderRadius;\n  }\n\n  @Override\n  public float getBorderRadius() {\n    return mBorderRadius;\n  }\n\n  @Override\n  public void setBorderColor(int borderColor) {\n    mBorderColor = borderColor;\n  }\n\n  @Override\n  public int getBorderColor() {\n    return mBorderColor;\n  }\n\n  @Override\n  public void setFadeDuration(int fadeDuration) {\n    mFadeDuration = fadeDuration;\n  }\n\n  @Override\n  public void setProgressiveRenderingEnabled(boolean enabled) {\n    mProgressiveRenderingEnabled = enabled;\n  }\n\n  @Override\n  public void setReactTag(int reactTag) {\n    mReactTag = reactTag;\n  }\n\n  @Override\n  public void onDraw(Canvas canvas) {\n    if (mRequestHelper != null) {\n      mRequestHelper.getDrawable().draw(canvas);\n    }\n  }\n\n  @Override\n  public void onAttached(FlatViewGroup.InvalidateCallback callback) {\n    mCallback = callback;\n\n    if (mRequestHelper == null) {\n      // this is here to help us debug t12048319, in which we have a null request helper on attach\n      throw new RuntimeException(\n          \"No DraweeRequestHelper - width: \" +\n              (getRight() - getLeft()) +\n              \" - height: \" + (getBottom() - getTop() +\n              \" - number of sources: \" + mSources.size()));\n    }\n\n    GenericDraweeHierarchy hierarchy = mRequestHelper.getHierarchy();\n\n    RoundingParams roundingParams = hierarchy.getRoundingParams();\n    if (shouldDisplayBorder()) {\n      if (roundingParams == null) {\n        roundingParams = new RoundingParams();\n      }\n\n      roundingParams.setBorder(mBorderColor, mBorderWidth);\n      roundingParams.setCornersRadius(mBorderRadius);\n\n      // changes won't take effect until we re-apply rounding params, so do it now.\n      hierarchy.setRoundingParams(roundingParams);\n    } else if (roundingParams != null) {\n      // clear rounding params\n      hierarchy.setRoundingParams(null);\n    }\n\n    hierarchy.setActualImageScaleType(mScaleType);\n    hierarchy.setActualImageColorFilter(mColorFilter);\n    hierarchy.setFadeDuration(mFadeDuration);\n\n    hierarchy.getTopLevelDrawable().setBounds(\n        Math.round(getLeft()),\n        Math.round(getTop()),\n        Math.round(getRight()),\n        Math.round(getBottom()));\n\n    mRequestHelper.attach(callback);\n  }\n\n  @Override\n  public void onDetached() {\n    if (mRequestHelper != null) {\n      mRequestHelper.detach();\n    }\n  }\n\n  @Override\n  public void onSubmit(String id, Object callerContext) {\n    if (mCallback != null && mReactTag != 0) {\n      mCallback.dispatchImageLoadEvent(mReactTag, ImageLoadEvent.ON_LOAD_START);\n    }\n  }\n\n  @Override\n  public void onFinalImageSet(\n      String id,\n      @Nullable Object imageInfo,\n      @Nullable Animatable animatable) {\n    if (mCallback != null && mReactTag != 0) {\n      mCallback.dispatchImageLoadEvent(mReactTag, ImageLoadEvent.ON_LOAD);\n      mCallback.dispatchImageLoadEvent(mReactTag, ImageLoadEvent.ON_LOAD_END);\n    }\n  }\n\n  @Override\n  public void onIntermediateImageSet(String id, @Nullable Object imageInfo) {\n  }\n\n  @Override\n  public void onIntermediateImageFailed(String id, Throwable throwable) {\n  }\n\n  @Override\n  public void onFailure(String id, Throwable throwable) {\n    if (mCallback != null && mReactTag != 0) {\n      mCallback.dispatchImageLoadEvent(mReactTag, ImageLoadEvent.ON_ERROR);\n      mCallback.dispatchImageLoadEvent(mReactTag, ImageLoadEvent.ON_LOAD_END);\n    }\n  }\n\n  @Override\n  public void onRelease(String id) {\n  }\n\n  @Override\n  protected void onBoundsChanged() {\n    super.onBoundsChanged();\n    computeRequestHelper();\n  }\n\n  private void computeRequestHelper() {\n    MultiSourceResult multiSource = MultiSourceHelper.getBestSourceForSize(\n        Math.round(getRight() - getLeft()),\n        Math.round(getBottom() - getTop()),\n        mSources);\n    ImageSource source = multiSource.getBestResult();\n    ImageSource cachedSource = multiSource.getBestResultInCache();\n    if (source == null) {\n      mRequestHelper = null;\n      return;\n    }\n\n    ResizeOptions resizeOptions = null;\n    if (shouldResize(source)) {\n      final int width = (int) (getRight() - getLeft());\n      final int height = (int) (getBottom() - getTop());\n      resizeOptions = new ResizeOptions(width, height);\n    }\n\n    ImageRequest imageRequest = ImageRequestBuilder.newBuilderWithSource(source.getUri())\n        .setResizeOptions(resizeOptions)\n        .setProgressiveRenderingEnabled(mProgressiveRenderingEnabled)\n        .build();\n    if (mGlobalImageLoadListener != null) {\n      mGlobalImageLoadListener.onLoadAttempt(source.getUri());\n    }\n\n    ImageRequest cachedImageRequest = null;\n    if (cachedSource != null) {\n      cachedImageRequest = ImageRequestBuilder.newBuilderWithSource(cachedSource.getUri())\n          .setResizeOptions(resizeOptions)\n          .setProgressiveRenderingEnabled(mProgressiveRenderingEnabled)\n          .build();\n    }\n    mRequestHelper = new\n      DraweeRequestHelper(Assertions.assertNotNull(imageRequest), cachedImageRequest, this);\n  }\n\n  private boolean shouldDisplayBorder() {\n    return mBorderColor != 0 || mBorderRadius >= 0.5f;\n  }\n\n  private static boolean shouldResize(ImageSource imageSource) {\n    // Resizing is inferior to scaling. See http://frescolib.org/docs/resizing-rotating.html\n    // We resize here only for images likely to be from the device's camera, where the app developer\n    // has no control over the original size\n    Uri uri = imageSource.getUri();\n    String type = uri == null ? null : uri.getScheme();\n    // one day, we can replace this with what non-Nodes does, which is:\n    // UriUtil.isLocalContentUri || UriUtil.isLocalFileUri\n    // not doing this just to save including eyt another BUCK dependency\n    return LOCAL_FILE_SCHEME.equals(type) || LOCAL_CONTENT_SCHEME.equals(type);\n  }\n\n  @Override\n  protected void onDebugDrawHighlight(Canvas canvas) {\n    if (mCallback != null) {\n      debugDrawCautionHighlight(canvas, \"Invalidate Drawee\");\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/DrawTextLayout.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.graphics.Canvas;\nimport android.text.Layout;\n\nimport com.facebook.fbui.textlayoutbuilder.util.LayoutMeasureUtil;\n\n/**\n * DrawTextLayout is a DrawCommand that draw {@link Layout}.\n */\n/* package */ final class DrawTextLayout extends AbstractDrawCommand {\n\n  private Layout mLayout;\n  private float mLayoutWidth;\n  private float mLayoutHeight;\n\n  /* package */ DrawTextLayout(Layout layout) {\n    setLayout(layout);\n  }\n\n  /**\n   * Assigns a new {@link Layout} to draw.\n   */\n  public void setLayout(Layout layout) {\n    mLayout = layout;\n    mLayoutWidth = layout.getWidth();\n    mLayoutHeight = LayoutMeasureUtil.getHeight(layout);\n  }\n\n  public Layout getLayout() {\n    return mLayout;\n  }\n\n  public float getLayoutWidth() {\n    // mLayout.getWidth() doesn't return correct width of the text Layout\n    return mLayoutWidth;\n  }\n\n  public float getLayoutHeight() {\n    return mLayoutHeight;\n  }\n\n  @Override\n  protected void onDraw(Canvas canvas) {\n    float left = getLeft();\n    float top = getTop();\n\n    canvas.translate(left, top);\n    mLayout.draw(canvas);\n    canvas.translate(-left, -top);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/DrawView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Canvas;\nimport android.graphics.Path;\nimport android.graphics.RectF;\n\n/* package */ final class DrawView extends AbstractDrawCommand {\n  public static final DrawView[] EMPTY_ARRAY = new DrawView[0];\n  // the minimum rounded clipping value before we actually do rounded clipping\n  /* package */ static final float MINIMUM_ROUNDED_CLIPPING_VALUE = 0.5f;\n  private final RectF TMP_RECT = new RectF();\n\n  /* package */ final int reactTag;\n  // Indicates whether this DrawView has been previously mounted to a clipping FlatViewGroup.  This\n  // lets us know that the bounds haven't changed, as a bounds change would trigger a new DrawView,\n  // which will set this to false for the new DrawView.  This is safe, despite the dual access with\n  // FlatViewGroup, because the FlatViewGroup copy is only ever modified by the FlatViewGroup.\n  // Changing how this boolean is used should be handled with caution, as race conditions are the\n  // quickest way to create unreproducible super bugs.\n  /* package */ boolean mWasMounted;\n\n  // the clipping radius - if this is greater than MINIMUM_ROUNDED_CLIPPING_VALUE, we clip using\n  // a rounded path, otherwise we clip in a rectangular fashion.\n  private float mClipRadius;\n\n  // the path to clip against if we're doing path clipping for rounded borders.\n  @Nullable private Path mPath;\n\n  // These should only ever be set from within the DrawView, they serve to provide clipping bounds\n  // for FlatViewGroups, which have strange clipping when it comes to overflow: visible.  They are\n  // left package protected to speed up direct access.  For overflow visible, these are the adjusted\n  // bounds while taking overflowing elements into account, other wise they are just the regular\n  // bounds of the view.\n  /* package */ float mLogicalLeft;\n  /* package */ float mLogicalTop;\n  /* package */ float mLogicalRight;\n  /* package */ float mLogicalBottom;\n\n  public DrawView(int reactTag) {\n    this.reactTag = reactTag;\n  }\n\n  /**\n   * Similar to updateBoundsAndFreeze, but thread safe as the mounting flag is modified on the UI\n   * thread.\n   *\n   * @return A DrawView with the passed bounds and clipping bounds.  If we can use the same\n   *     DrawView, it will just be this, otherwise it will be a frozen copy.\n   */\n  public DrawView collectDrawView(\n      float left,\n      float top,\n      float right,\n      float bottom,\n      float logicalLeft,\n      float logicalTop,\n      float logicalRight,\n      float logicalBottom,\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom,\n      float clipRadius) {\n    if (!isFrozen()) {\n      // We haven't collected this draw view yet, so we can just set everything.\n      setBounds(left, top, right, bottom);\n      setClipBounds(clipLeft, clipTop, clipRight, clipBottom);\n      setClipRadius(clipRadius);\n      setLogicalBounds(logicalLeft, logicalTop, logicalRight, logicalBottom);\n      freeze();\n      return this;\n    }\n\n    boolean boundsMatch = boundsMatch(left, top, right, bottom);\n    boolean clipBoundsMatch = clipBoundsMatch(clipLeft, clipTop, clipRight, clipBottom);\n    boolean clipRadiusMatch = mClipRadius == clipRadius;\n    boolean logicalBoundsMatch =\n        logicalBoundsMatch(logicalLeft, logicalTop, logicalRight, logicalBottom);\n\n    // See if we can reuse the draw view.\n    if (boundsMatch && clipBoundsMatch && clipRadiusMatch && logicalBoundsMatch) {\n      return this;\n    }\n\n    DrawView drawView = (DrawView) mutableCopy();\n\n    if (!boundsMatch) {\n      drawView.setBounds(left, top, right, bottom);\n    }\n\n    if (!clipBoundsMatch) {\n      drawView.setClipBounds(clipLeft, clipTop, clipRight, clipBottom);\n    }\n\n    if (!logicalBoundsMatch) {\n      drawView.setLogicalBounds(logicalLeft, logicalTop, logicalRight, logicalBottom);\n    }\n\n    if (!clipRadiusMatch || !boundsMatch) {\n      // If the bounds change, we need to update the clip path.\n      drawView.setClipRadius(clipRadius);\n    }\n\n    // It is very important that we unset this, as our spec is that newly created DrawViews\n    // are handled differently by the FlatViewGroup.  This is needed because clone() maintains\n    // the previous state.\n    drawView.mWasMounted = false;\n\n    drawView.freeze();\n\n    return drawView;\n  }\n\n  private boolean logicalBoundsMatch(float left, float top, float right, float bottom) {\n    return left == mLogicalLeft && top == mLogicalTop &&\n        right == mLogicalRight && bottom == mLogicalBottom;\n  }\n\n  private void setLogicalBounds(float left, float top, float right, float bottom) {\n    // Do rounding up front and off of the UI thread.\n    mLogicalLeft = left;\n    mLogicalTop = top;\n    mLogicalRight = right;\n    mLogicalBottom = bottom;\n  }\n\n  @Override\n  public void draw(FlatViewGroup parent, Canvas canvas) {\n    onPreDraw(parent, canvas);\n    if (mNeedsClipping || mClipRadius > MINIMUM_ROUNDED_CLIPPING_VALUE) {\n      canvas.save(Canvas.CLIP_SAVE_FLAG);\n      applyClipping(canvas);\n      parent.drawNextChild(canvas);\n      canvas.restore();\n    } else {\n      parent.drawNextChild(canvas);\n    }\n  }\n\n  /**\n   * Set the clip radius.  Should only be called when the clip radius is first set or when it\n   * changes, in order to avoid extra work.\n   *\n   * @param clipRadius The new clip radius.\n   */\n  void setClipRadius(float clipRadius) {\n    mClipRadius = clipRadius;\n    if (clipRadius > MINIMUM_ROUNDED_CLIPPING_VALUE) {\n      // update the path that we'll clip based on\n      updateClipPath();\n    } else {\n      mPath = null;\n    }\n  }\n\n  /**\n   * Update the path with which we'll clip this view\n   */\n  private void updateClipPath() {\n    mPath = new Path();\n\n    TMP_RECT.set(\n        getLeft(),\n        getTop(),\n        getRight(),\n        getBottom());\n\n    // set the path\n    mPath.addRoundRect(\n        TMP_RECT,\n        mClipRadius,\n        mClipRadius,\n        Path.Direction.CW);\n  }\n\n  @Override\n  protected void applyClipping(Canvas canvas) {\n    // only clip using a path if our radius is greater than some minimum threshold, because\n    // clipPath is more expensive than clipRect.\n    if (mClipRadius > MINIMUM_ROUNDED_CLIPPING_VALUE) {\n      canvas.clipPath(mPath);\n    } else {\n      super.applyClipping(canvas);\n    }\n  }\n\n  @Override\n  protected void onDraw(Canvas canvas) {\n    // no op as we override draw.\n  }\n\n  @Override\n  protected void onDebugDraw(FlatViewGroup parent, Canvas canvas) {\n    parent.debugDrawNextChild(canvas);\n  }\n\n  @Override\n  protected void onDebugDrawHighlight(Canvas canvas) {\n    if (mPath != null) {\n      debugDrawWarningHighlight(canvas, \"borderRadius: \" + mClipRadius);\n    } else if (!boundsMatch(mLogicalLeft, mLogicalTop, mLogicalRight, mLogicalBottom)) {\n      StringBuilder warn = new StringBuilder(\"Overflow: { \");\n      String[] names = { \"left: \", \"top: \", \"right: \", \"bottom: \"};\n      int i = 0;\n      float[] offsets = new float[4];\n      offsets[i++] = getLeft() - mLogicalLeft;\n      offsets[i++] = getTop() - mLogicalTop;\n      offsets[i++] = mLogicalRight - getRight();\n      offsets[i++] = mLogicalBottom - getBottom();\n\n      for (i = 0; i < 4; i++) {\n        if (offsets[i] != 0f) {\n          warn.append(names[i]);\n          warn.append(offsets[i]);\n          warn.append(\", \");\n        }\n      }\n\n      warn.append(\"}\");\n\n      debugDrawCautionHighlight(canvas, warn.toString());\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/DraweeRequestHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.content.res.Resources;\nimport android.graphics.drawable.Drawable;\n\nimport com.facebook.drawee.controller.AbstractDraweeControllerBuilder;\nimport com.facebook.drawee.controller.ControllerListener;\nimport com.facebook.drawee.generic.GenericDraweeHierarchy;\nimport com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;\nimport com.facebook.drawee.interfaces.DraweeController;\nimport com.facebook.imagepipeline.request.ImageRequest;\nimport com.facebook.infer.annotation.Assertions;\n\n/* package */ final class DraweeRequestHelper {\n\n  private static GenericDraweeHierarchyBuilder sHierarchyBuilder;\n  private static AbstractDraweeControllerBuilder sControllerBuilder;\n\n  /* package */ static void setResources(Resources resources) {\n    sHierarchyBuilder = new GenericDraweeHierarchyBuilder(resources);\n  }\n\n  /* package */ static void setDraweeControllerBuilder(AbstractDraweeControllerBuilder builder) {\n    sControllerBuilder = builder;\n  }\n\n  private final DraweeController mDraweeController;\n  private int mAttachCounter;\n\n  /* package */ DraweeRequestHelper(\n      ImageRequest imageRequest,\n      @Nullable ImageRequest cachedImageRequest,\n      ControllerListener listener) {\n    AbstractDraweeControllerBuilder controllerBuilder = sControllerBuilder\n        .setImageRequest(imageRequest)\n        .setCallerContext(RCTImageView.getCallerContext())\n        .setControllerListener(listener);\n\n    if (cachedImageRequest != null) {\n      controllerBuilder.setLowResImageRequest(cachedImageRequest);\n    }\n    DraweeController controller = controllerBuilder.build();\n\n    controller.setHierarchy(sHierarchyBuilder.build());\n\n    mDraweeController = controller;\n  }\n\n  /* package */ void attach(FlatViewGroup.InvalidateCallback callback) {\n    ++mAttachCounter;\n    if (mAttachCounter == 1) {\n      getDrawable().setCallback(callback.get());\n      mDraweeController.onAttach();\n    }\n  }\n\n  /* package */ void detach() {\n    --mAttachCounter;\n    if (mAttachCounter == 0) {\n      mDraweeController.onDetach();\n    }\n  }\n\n  /* package */ GenericDraweeHierarchy getHierarchy() {\n    return (GenericDraweeHierarchy) Assertions.assumeNotNull(mDraweeController.getHierarchy());\n  }\n\n  /* package */ Drawable getDrawable() {\n    return getHierarchy().getTopLevelDrawable();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/ElementsList.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport java.util.ArrayDeque;\nimport java.util.ArrayList;\nimport java.lang.reflect.Array;\n\n/**\n * Diffing scope stack class that supports 3 main operations: start(), add() an element and\n * finish().\n *\n * When started, it takes a baseline array to compare to. When adding a new element, it checks\n * whether a corresponding element in baseline array is the same. On finish(), it will return null\n * if baseline array contains exactly the same elements that were added with a sequence of add()\n * calls, or a new array of the recorded elements:\n *\n * Example 1:\n * -----\n *   start([A])\n *   add(A)\n *   finish() -> null (because [A] == [A])\n *\n * Example 2:\n * ----\n *   start([A])\n *   add(B)\n *   finish() -> [B] (because [A] != [B])\n *\n * Example 3:\n * ----\n *   start([A])\n *   add(B)\n *   add(A)\n *   finish() -> [B, A] (because [B, A] != [A])\n *\n * Example 4:\n * ----\n *   start([A, B])\n *   add(B)\n *   add(A)\n *   finish() -> [B, A] (because [B, A] != [A, B])\n *\n * It is important that start/finish can be nested:\n * ----\n *   start([A])\n *   add(A)\n *     start([B])\n *     add(B)\n *     finish() -> null\n *   add(C)\n *   finish() -> [A, C]\n *\n * StateBuilder is using this class to check if e.g. a DrawCommand list for a given View needs to be\n * updated.\n */\n/* package */ final class ElementsList<E> {\n\n  private static final class Scope {\n    Object[] elements;\n    int index;\n    int size;\n  }\n\n  // List of scopes.  These are never cleared, but instead recycled when a new scope is needed at\n  // a given depth.\n  private final ArrayList<Scope> mScopesStack = new ArrayList<>();\n  // Working list of all new elements we are gathering across scopes.  Whenever we get a call to\n  // finish() we pop the new elements off the collection, either discarding them if there was no\n  // change from the base or accumulating and returning them as a list of new elements.\n  private final ArrayDeque<E> mElements = new ArrayDeque<>();\n  private final E[] mEmptyArray;\n  private Scope mCurrentScope = null;\n  private int mScopeIndex = 0;\n\n  public ElementsList(E[] emptyArray) {\n    mEmptyArray = emptyArray;\n    mScopesStack.add(mCurrentScope);\n  }\n\n  /**\n   * Starts a new scope.\n   */\n  public void start(Object[] elements) {\n    pushScope();\n\n    Scope scope = getCurrentScope();\n    scope.elements = elements;\n    scope.index = 0;\n    scope.size = mElements.size();\n  }\n\n  /**\n   * Finish current scope, returning null if there were no changes recorded, or a new array\n   * containing all the newly recorded elements otherwise.\n   */\n  public E[] finish() {\n    Scope scope = getCurrentScope();\n    popScope();\n\n    E[] result = null;\n    int size = mElements.size() - scope.size;\n    if (scope.index != scope.elements.length) {\n      result = extractElements(size);\n    } else {\n      // downsize\n      for (int i = 0; i < size; ++i) {\n        mElements.pollLast();\n      }\n    }\n\n    // To prevent resource leaks.\n    scope.elements = null;\n\n    return result;\n  }\n\n  /**\n   * Adds a new element to the list.  This method can be optimized to avoid inserts on same\n   * elements, but would involve copying from scope.elements when we extract elements.\n   */\n  public void add(E element) {\n    Scope scope = getCurrentScope();\n\n    if (scope.index < scope.elements.length &&\n        scope.elements[scope.index] == element) {\n      ++scope.index;\n    } else {\n      scope.index = Integer.MAX_VALUE;\n    }\n\n    mElements.add(element);\n  }\n\n  /**\n   * Resets all references to elements in our new stack to null to avoid memory leaks.\n   */\n  public void clear() {\n    if (getCurrentScope() != null) {\n      throw new RuntimeException(\"Must call finish() for every start() call being made.\");\n    }\n    mElements.clear();\n  }\n\n  /**\n   * Extracts last size elements into an array.  Used to extract our new array of items from our\n   * stack when the new items != old items.\n   */\n  private E[] extractElements(int size) {\n    if (size == 0) {\n      // avoid allocating empty array\n      return mEmptyArray;\n    }\n\n    E[] elements = (E[]) Array.newInstance(mEmptyArray.getClass().getComponentType(), size);\n    for (int i = size - 1; i >= 0; --i) {\n      elements[i] = mElements.pollLast();\n    }\n\n    return elements;\n  }\n\n  /**\n   * Saves current scope in a stack.\n   */\n  private void pushScope() {\n    ++mScopeIndex;\n    if (mScopeIndex == mScopesStack.size()) {\n      // We reached a new deepest scope, we need to create a scope for this depth.\n      mCurrentScope = new Scope();\n      mScopesStack.add(mCurrentScope);\n    } else {\n      // We have had a scope at this depth before, lets recycle it.\n      mCurrentScope = mScopesStack.get(mScopeIndex);\n    }\n  }\n\n  /**\n   * Restores last saved current scope.  Doesn't actually remove the scope, as scopes are\n   * recycled.\n   */\n  private void popScope() {\n    --mScopeIndex;\n    mCurrentScope = mScopesStack.get(mScopeIndex);\n  }\n\n  /**\n   * Returns current scope.\n   */\n  private Scope getCurrentScope() {\n    return mCurrentScope;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatARTSurfaceViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport com.facebook.react.uimanager.BaseViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.views.art.ARTSurfaceView;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaMeasureMode;\nimport com.facebook.yoga.YogaNode;\n\npublic class FlatARTSurfaceViewManager extends\n  BaseViewManager<ARTSurfaceView, FlatARTSurfaceViewShadowNode> {\n\n  /* package */ static final String REACT_CLASS = \"ARTSurfaceView\";\n\n  private static final YogaMeasureFunction MEASURE_FUNCTION = new YogaMeasureFunction() {\n    @Override\n    public long measure(\n      YogaNode node,\n      float width,\n      YogaMeasureMode widthMode,\n      float height,\n      YogaMeasureMode heightMode) {\n      throw new IllegalStateException(\"SurfaceView should have explicit width and height set\");\n    }\n  };\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public FlatARTSurfaceViewShadowNode createShadowNodeInstance() {\n    FlatARTSurfaceViewShadowNode node = new FlatARTSurfaceViewShadowNode();\n    node.setMeasureFunction(MEASURE_FUNCTION);\n    return node;\n  }\n\n  @Override\n  public Class<FlatARTSurfaceViewShadowNode> getShadowNodeClass() {\n    return FlatARTSurfaceViewShadowNode.class;\n  }\n\n  @Override\n  protected ARTSurfaceView createViewInstance(ThemedReactContext reactContext) {\n    return new ARTSurfaceView(reactContext);\n  }\n\n  @Override\n  public void updateExtraData(ARTSurfaceView root, Object extraData) {\n    root.setSurfaceTextureListener((FlatARTSurfaceViewShadowNode) extraData);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatARTSurfaceViewShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.PorterDuff;\nimport android.graphics.SurfaceTexture;\nimport android.util.Log;\nimport android.view.Surface;\nimport android.view.TextureView;\n\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.uimanager.ReactShadowNode;\nimport com.facebook.react.uimanager.UIViewOperationQueue;\nimport com.facebook.react.views.art.ARTVirtualNode;\nimport com.facebook.yoga.YogaValue;\nimport com.facebook.yoga.YogaUnit;\n\n/* package */ class FlatARTSurfaceViewShadowNode extends FlatShadowNode\n    implements AndroidView, TextureView.SurfaceTextureListener {\n  private boolean mPaddingChanged = false;\n  private @Nullable Surface mSurface;\n\n  /* package */ FlatARTSurfaceViewShadowNode() {\n    forceMountToView();\n    forceMountChildrenToView();\n  }\n\n  @Override\n  public boolean isVirtual() {\n    return false;\n  }\n\n  @Override\n  public boolean isVirtualAnchor() {\n    return true;\n  }\n\n  @Override\n  public void onCollectExtraUpdates(UIViewOperationQueue uiUpdater) {\n    super.onCollectExtraUpdates(uiUpdater);\n    drawOutput();\n    uiUpdater.enqueueUpdateExtraData(getReactTag(), this);\n  }\n\n  private void drawOutput() {\n    if (mSurface == null || !mSurface.isValid()) {\n      markChildrenUpdatesSeen(this);\n      return;\n    }\n\n    try {\n      Canvas canvas = mSurface.lockCanvas(null);\n      canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);\n\n      Paint paint = new Paint();\n      for (int i = 0; i < getChildCount(); i++) {\n        ARTVirtualNode child = (ARTVirtualNode) getChildAt(i);\n        child.draw(canvas, paint, 1f);\n        child.markUpdateSeen();\n      }\n\n      if (mSurface == null) {\n        return;\n      }\n\n      mSurface.unlockCanvasAndPost(canvas);\n    } catch (IllegalArgumentException | IllegalStateException e) {\n      Log.e(ReactConstants.TAG, e.getClass().getSimpleName() + \" in Surface.unlockCanvasAndPost\");\n    }\n  }\n\n  private void markChildrenUpdatesSeen(ReactShadowNode shadowNode) {\n    for (int i = 0; i < shadowNode.getChildCount(); i++) {\n      ReactShadowNode child = shadowNode.getChildAt(i);\n      child.markUpdateSeen();\n      markChildrenUpdatesSeen(child);\n    }\n  }\n\n  @Override\n  public boolean needsCustomLayoutForChildren() {\n    return false;\n  }\n\n  @Override\n  public boolean isPaddingChanged() {\n    return mPaddingChanged;\n  }\n\n  @Override\n  public void resetPaddingChanged() {\n    mPaddingChanged = false;\n  }\n\n  @Override\n  public void setPadding(int spacingType, float padding) {\n    YogaValue current = getStylePadding(spacingType);\n    if (current.unit != YogaUnit.POINT || current.value != padding) {\n      super.setPadding(spacingType, padding);\n      mPaddingChanged = true;\n      markUpdated();\n    }\n  }\n\n  @Override\n  public void setPaddingPercent(int spacingType, float percent) {\n    YogaValue current = getStylePadding(spacingType);\n    if (current.unit != YogaUnit.PERCENT || current.value != percent) {\n      super.setPadding(spacingType, percent);\n      mPaddingChanged = true;\n      markUpdated();\n    }\n  }\n\n  @Override\n  public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {\n    mSurface = new Surface(surface);\n    drawOutput();\n  }\n\n  @Override\n  public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {\n    surface.release();\n    mSurface = null;\n    return true;\n  }\n\n  @Override\n  public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {}\n\n  @Override\n  public void onSurfaceTextureUpdated(SurfaceTexture surface) {}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatMeasuredViewGroup.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.graphics.Rect;\n\n/**\n * Helper interface to provide measuring of FlatViewGroup when needed.  We don't override onMeasure\n * for FlatViewGroup, which means that draw commands don't contributed to the measured width and\n * height.  This allows us to expose our calculated dimensions taking into account draw commands,\n * without changing the visibility of the FlatViewGroup.\n */\npublic interface FlatMeasuredViewGroup {\n  /**\n   * @return A rect consisting of the left, top, right, and bottommost edge among all children,\n   *   including draw commands.\n   */\n  Rect measureWithCommands();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatNativeViewHierarchyManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport android.util.SparseArray;\nimport android.util.SparseIntArray;\nimport android.view.View;\nimport android.view.View.MeasureSpec;\nimport android.view.ViewGroup;\n\nimport com.facebook.react.uimanager.NativeViewHierarchyManager;\nimport com.facebook.react.uimanager.SizeMonitoringFrameLayout;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewGroupManager;\nimport com.facebook.react.uimanager.ViewManagerRegistry;\n\n/**\n * FlatNativeViewHierarchyManager is the only class that performs View manipulations. All of this\n * class methods can only be called from UI thread by {@link FlatUIViewOperationQueue}.\n */\n/* package */ final class FlatNativeViewHierarchyManager extends NativeViewHierarchyManager\n    implements ViewResolver {\n\n  /* package */ FlatNativeViewHierarchyManager(ViewManagerRegistry viewManagers) {\n    super(viewManagers, new FlatRootViewManager());\n  }\n\n  @Override\n  public View getView(int reactTag) {\n    return super.resolveView(reactTag);\n  }\n\n  @Override\n  public void addRootView(\n      int tag,\n      SizeMonitoringFrameLayout view,\n      ThemedReactContext themedContext) {\n    FlatViewGroup root = new FlatViewGroup(themedContext);\n    view.addView(root);\n\n    // When unmounting, ReactInstanceManager.detachViewFromInstance() will check id of the\n    // top-level View (SizeMonitoringFrameLayout) and pass it back to JS. We want that View's id to\n    // be set, otherwise NativeViewHierarchyManager will not be able to cleanup properly.\n    view.setId(tag);\n\n    addRootViewGroup(tag, root, themedContext);\n  }\n\n  /**\n   * Updates DrawCommands and AttachDetachListeners of a FlatViewGroup specified by a reactTag.\n   *\n   * @param reactTag reactTag to lookup FlatViewGroup by\n   * @param drawCommands if non-null, new draw commands to execute during the drawing.\n   * @param listeners if non-null, new attach-detach listeners.\n   */\n  /* package */ void updateMountState(\n      int reactTag,\n      @Nullable DrawCommand[] drawCommands,\n      @Nullable AttachDetachListener[] listeners,\n      @Nullable NodeRegion[] nodeRegions) {\n    FlatViewGroup view = (FlatViewGroup) resolveView(reactTag);\n    if (drawCommands != null) {\n      view.mountDrawCommands(drawCommands);\n    }\n    if (listeners != null) {\n      view.mountAttachDetachListeners(listeners);\n    }\n    if (nodeRegions != null) {\n      view.mountNodeRegions(nodeRegions);\n    }\n  }\n\n  /**\n   * Updates DrawCommands and AttachDetachListeners of a clipping FlatViewGroup specified by a\n   * reactTag.\n   *\n   * @param reactTag The react tag to lookup FlatViewGroup by.\n   * @param drawCommands If non-null, new draw commands to execute during the drawing.\n   * @param drawViewIndexMap Mapping of react tags to the index of the corresponding DrawView\n   *   command in the draw command array.\n   * @param commandMaxBot At each index i, the maximum bottom value (or right value in the case of\n   *   horizontal clipping) value of all draw commands at or below i.\n   * @param commandMinTop At each index i, the minimum top value (or left value in the case of\n   *   horizontal clipping) value of all draw commands at or below i.\n   * @param listeners If non-null, new attach-detach listeners.\n   * @param nodeRegions Node regions to mount.\n   * @param regionMaxBot At each index i, the maximum bottom value (or right value in the case of\n   *   horizontal clipping) value of all node regions at or below i.\n   * @param regionMinTop At each index i, the minimum top value (or left value in the case of\n   *   horizontal clipping) value of all draw commands at or below i.\n   * @param willMountViews Whether we are going to also send a mountViews command in this state\n   *   cycle.\n   */\n  /* package */ void updateClippingMountState(\n      int reactTag,\n      @Nullable DrawCommand[] drawCommands,\n      SparseIntArray drawViewIndexMap,\n      float[] commandMaxBot,\n      float[] commandMinTop,\n      @Nullable AttachDetachListener[] listeners,\n      @Nullable NodeRegion[] nodeRegions,\n      float[] regionMaxBot,\n      float[] regionMinTop,\n      boolean willMountViews) {\n    FlatViewGroup view = (FlatViewGroup) resolveView(reactTag);\n    if (drawCommands != null) {\n      view.mountClippingDrawCommands(\n          drawCommands,\n          drawViewIndexMap,\n          commandMaxBot,\n          commandMinTop,\n          willMountViews);\n    }\n    if (listeners != null) {\n      view.mountAttachDetachListeners(listeners);\n    }\n    if (nodeRegions != null) {\n      view.mountClippingNodeRegions(nodeRegions, regionMaxBot, regionMinTop);\n    }\n  }\n\n  /* package */ void updateViewGroup(int reactTag, int[] viewsToAdd, int[] viewsToDetach) {\n    View view = resolveView(reactTag);\n    if (view instanceof FlatViewGroup) {\n      ((FlatViewGroup) view).mountViews(this, viewsToAdd, viewsToDetach);\n      return;\n    }\n\n    ViewGroup viewGroup = (ViewGroup) view;\n    ViewGroupManager viewManager = (ViewGroupManager) resolveViewManager(reactTag);\n    List<View> listOfViews = new ArrayList<>(viewsToAdd.length);\n\n    // batch the set of additions - some view managers can take advantage of the batching to\n    // decrease operations, etc.\n    for (int viewIdToAdd : viewsToAdd) {\n      int tag = Math.abs(viewIdToAdd);\n      listOfViews.add(resolveView(tag));\n    }\n    viewManager.addViews(viewGroup, listOfViews);\n  }\n\n  /**\n   * Updates View bounds, possibly re-measuring and re-layouting it if the size changed.\n   *\n   * @param reactTag reactTag to lookup a View by\n   * @param left left coordinate relative to parent\n   * @param top top coordinate relative to parent\n   * @param right right coordinate relative to parent\n   * @param bottom bottom coordinate relative to parent\n   */\n  /* package */ void updateViewBounds(int reactTag, int left, int top, int right, int bottom) {\n    View view = resolveView(reactTag);\n    int width = right - left;\n    int height = bottom - top;\n    if (view.getWidth() != width || view.getHeight() != height) {\n      // size changed, we need to measure and layout the View\n      view.measure(\n          MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),\n          MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));\n      view.layout(left, top, right, bottom);\n    } else {\n      // same size, only location changed, there is a faster route.\n      view.offsetLeftAndRight(left - view.getLeft());\n      view.offsetTopAndBottom(top - view.getTop());\n    }\n  }\n\n  /* package */ void setPadding(\n      int reactTag,\n      int paddingLeft,\n      int paddingTop,\n      int paddingRight,\n      int paddingBottom) {\n    resolveView(reactTag).setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);\n  }\n\n  /* package */ void dropViews(SparseIntArray viewsToDrop) {\n    for (int i = 0, count = viewsToDrop.size(); i < count; i++) {\n      int viewToDrop = viewsToDrop.keyAt(i);\n      View view = null;\n      if (viewToDrop > 0) {\n        try {\n          view = resolveView(viewToDrop);\n          dropView(view);\n        } catch (Exception e) {\n          // the view is already dropped, nothing we can do\n        }\n      } else {\n        // Root views are noted with a negative tag from StateBuilder.\n        removeRootView(-viewToDrop);\n      }\n\n      int parentTag = viewsToDrop.valueAt(i);\n      // this only happens for clipped, non-root views - clipped because there is no parent, and\n      // not a root view (because we explicitly pass -1 for root views).\n      if (parentTag > 0 && view != null && view.getParent() == null) {\n        // this can only happen if the parent exists (if the parent were removed first, it'd also\n        // remove the child, so trying to explicitly remove the child afterwards would crash at\n        // the resolveView call above) - we also explicitly check for a null parent, implying that\n        // we are either clipped (or that we already removed the child from its parent, in which\n        // case this will essentially be a no-op).\n        View parent = resolveView(parentTag);\n        if (parent instanceof FlatViewGroup) {\n          ((FlatViewGroup) parent).onViewDropped(view);\n        }\n      }\n    }\n  }\n\n  @Override\n  protected void dropView(View view) {\n    super.dropView(view);\n\n    // As a result of removeClippedSubviews, some views have strong references but are not attached\n    // to a parent. consequently, when the parent gets removed, these Views don't get cleaned up,\n    // because they aren't children (they also aren't removed from mTagsToViews, thus causing a\n    // leak). To solve this, we ask for said detached views and explicitly drop them.\n    if (view instanceof FlatViewGroup) {\n      FlatViewGroup flatViewGroup = (FlatViewGroup) view;\n      if (flatViewGroup.getRemoveClippedSubviews()) {\n        SparseArray<View> detachedViews = flatViewGroup.getDetachedViews();\n        for (int i = 0, size = detachedViews.size(); i < size; i++) {\n          View detachedChild = detachedViews.valueAt(i);\n          try {\n             dropView(detachedChild);\n          } catch (Exception e) {\n             // if the view is already dropped, ignore any exceptions\n             // in reality, we should find out the edge cases that cause\n             // this to happen and properly fix them.\n          }\n          // trigger onDetachedFromWindow and clean up this detached/clipped view\n          flatViewGroup.removeDetachedView(detachedChild);\n        }\n      }\n    }\n  }\n\n  /* package */ void detachAllChildrenFromViews(int[] viewsToDetachAllChildrenFrom) {\n    for (int viewTag : viewsToDetachAllChildrenFrom) {\n      View view = resolveView(viewTag);\n      if (view instanceof FlatViewGroup) {\n        ((FlatViewGroup) view).detachAllViewsFromParent();\n        continue;\n      }\n\n      ViewGroup viewGroup = (ViewGroup) view;\n      ViewGroupManager viewManager = (ViewGroupManager) resolveViewManager(viewTag);\n      viewManager.removeAllViews(viewGroup);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatReactModalShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.graphics.Point;\nimport android.view.Display;\nimport android.view.Surface;\nimport android.view.WindowManager;\nimport com.facebook.react.uimanager.ReactShadowNodeImpl;\nimport com.facebook.yoga.YogaUnit;\nimport com.facebook.yoga.YogaValue;\n\n/**\n * FlatReactModalShadowNode\n *\n * This is a Nodes specific shadow node for modals. This is required because we wrap any\n * non-FlatShadowNode node in a NativeViewWrapper. In the case of a modal shadow node, we need\n * to treat it as its own node so that we can add the custom measurement behavior that is there\n * in the non-Nodes version when we add a child.\n *\n * {@see {@link com.facebook.react.views.modal.ModalHostShadowNode}}\n */\nclass FlatReactModalShadowNode extends FlatShadowNode implements AndroidView {\n\n  private final Point mMinPoint = new Point();\n  private final Point mMaxPoint = new Point();\n  private boolean mPaddingChanged;\n\n  FlatReactModalShadowNode() {\n    forceMountToView();\n    forceMountChildrenToView();\n  }\n\n  /**\n   * We need to set the styleWidth and styleHeight of the one child (represented by the <View/>\n   * within the <RCTModalHostView/> in Modal.js. This needs to fill the entire window.\n   */\n  @Override\n  @TargetApi(16)\n  public void addChildAt(ReactShadowNodeImpl child, int i) {\n    super.addChildAt(child, i);\n\n    Context context = getThemedContext();\n    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);\n    Display display = wm.getDefaultDisplay();\n    // getCurrentSizeRange will return the min and max width and height that the window can be\n    display.getCurrentSizeRange(mMinPoint, mMaxPoint);\n\n    int width, height;\n    int rotation = display.getRotation();\n    if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) {\n      // If we are vertical the width value comes from min width and height comes from max height\n      width = mMinPoint.x;\n      height = mMaxPoint.y;\n    } else {\n      // If we are horizontal the width value comes from max width and height comes from min height\n      width = mMaxPoint.x;\n      height = mMinPoint.y;\n    }\n    child.setStyleWidth(width);\n    child.setStyleHeight(height);\n  }\n\n  @Override\n  public boolean needsCustomLayoutForChildren() {\n    return false;\n  }\n\n  @Override\n  public boolean isPaddingChanged() {\n    return mPaddingChanged;\n  }\n\n  @Override\n  public void resetPaddingChanged() {\n    mPaddingChanged = false;\n  }\n\n  @Override\n  public void setPadding(int spacingType, float padding) {\n    YogaValue current = getStylePadding(spacingType);\n    if (current.unit != YogaUnit.POINT || current.value != padding) {\n      super.setPadding(spacingType, padding);\n      mPaddingChanged = true;\n      markUpdated();\n    }\n  }\n\n  @Override\n  public void setPaddingPercent(int spacingType, float percent) {\n    YogaValue current = getStylePadding(spacingType);\n    if (current.unit != YogaUnit.PERCENT || current.value != percent) {\n      super.setPadding(spacingType, percent);\n      mPaddingChanged = true;\n      markUpdated();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatRootShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\n/**\n * Root node of the shadow node hierarchy. Currently, the only node that can actually map to a View.\n */\n/* package */ final class FlatRootShadowNode extends FlatShadowNode {\n\n  /* package */ FlatRootShadowNode() {\n    forceMountToView();\n    signalBackingViewIsCreated();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatRootViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.view.ViewGroup;\n\nimport com.facebook.react.uimanager.RootViewManager;\n\n/* package */ class FlatRootViewManager extends RootViewManager {\n\n  @Override\n  public void removeAllViews(ViewGroup parent) {\n    parent.removeAllViewsInLayout();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.graphics.Rect;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.uimanager.LayoutShadowNode;\nimport com.facebook.react.uimanager.OnLayoutEvent;\nimport com.facebook.react.uimanager.ReactClippingViewGroupHelper;\nimport com.facebook.react.uimanager.ReactShadowNode;\nimport com.facebook.react.uimanager.ReactShadowNodeImpl;\nimport com.facebook.react.uimanager.ReactStylesDiffMap;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport javax.annotation.Nullable;\n\n/**\n * FlatShadowNode is a base class for all shadow node used in FlatUIImplementation. It extends\n * {@link LayoutShadowNode} by adding an ability to prepare DrawCommands off the UI thread.\n */\n/* package */ class FlatShadowNode extends LayoutShadowNode {\n\n  /* package */ static final FlatShadowNode[] EMPTY_ARRAY = new FlatShadowNode[0];\n\n  private static final String PROP_OPACITY = \"opacity\";\n  private static final String PROP_RENDER_TO_HARDWARE_TEXTURE = \"renderToHardwareTextureAndroid\";\n  private static final String PROP_ACCESSIBILITY_LABEL = \"accessibilityLabel\";\n  private static final String PROP_ACCESSIBILITY_COMPONENT_TYPE = \"accessibilityComponentType\";\n  private static final String PROP_ACCESSIBILITY_LIVE_REGION = \"accessibilityLiveRegion\";\n  private static final String PROP_IMPORTANT_FOR_ACCESSIBILITY = \"importantForAccessibility\";\n  private static final String PROP_TEST_ID = \"testID\";\n  private static final String PROP_TRANSFORM = \"transform\";\n  protected static final String PROP_REMOVE_CLIPPED_SUBVIEWS =\n      ReactClippingViewGroupHelper.PROP_REMOVE_CLIPPED_SUBVIEWS;\n  protected static final String PROP_HORIZONTAL = \"horizontal\";\n  private static final Rect LOGICAL_OFFSET_EMPTY = new Rect();\n  // When we first initialize a backing view, we create a view we are going to throw away anyway,\n  // so instead initialize with a shared view.\n  private static final DrawView EMPTY_DRAW_VIEW = new DrawView(0);\n\n  private DrawCommand[] mDrawCommands = DrawCommand.EMPTY_ARRAY;\n  private AttachDetachListener[] mAttachDetachListeners = AttachDetachListener.EMPTY_ARRAY;\n  private NodeRegion[] mNodeRegions = NodeRegion.EMPTY_ARRAY;\n  private FlatShadowNode[] mNativeChildren = FlatShadowNode.EMPTY_ARRAY;\n  private NodeRegion mNodeRegion = NodeRegion.EMPTY;\n  private int mNativeParentTag;\n  private int mViewLeft;\n  private int mViewTop;\n  private int mViewRight;\n  private int mViewBottom;\n  private boolean mBackingViewIsCreated;\n  private @Nullable DrawView mDrawView;\n  private @Nullable DrawBackgroundColor mDrawBackground;\n  private boolean mIsUpdated = true;\n  private boolean mForceMountChildrenToView;\n  private float mClipLeft;\n  private float mClipTop;\n  private float mClipRight;\n  private float mClipBottom;\n\n  // Used to track whether any of the NodeRegions overflow this Node. This is used to determine\n  // whether or not we can detach this Node in the context of a container with\n  // setRemoveClippedSubviews enabled.\n  private boolean mOverflowsContainer;\n  // this Rect contains the offset to get the \"logical bounds\" (i.e. bounds that include taking\n  // into account overflow visible).\n  private Rect mLogicalOffset = LOGICAL_OFFSET_EMPTY;\n\n  // last OnLayoutEvent info, only used when shouldNotifyOnLayout() is true.\n  private int mLayoutX;\n  private int mLayoutY;\n  private int mLayoutWidth;\n  private int mLayoutHeight;\n\n  // clip radius\n  float mClipRadius;\n  boolean mClipToBounds = false;\n\n  /* package */ void handleUpdateProperties(ReactStylesDiffMap styles) {\n    if (!mountsToView()) {\n      // Make sure we mount this FlatShadowNode to a View if any of these properties are present.\n      if (styles.hasKey(PROP_OPACITY) ||\n          styles.hasKey(PROP_RENDER_TO_HARDWARE_TEXTURE) ||\n          styles.hasKey(PROP_TEST_ID) ||\n          styles.hasKey(PROP_ACCESSIBILITY_LABEL) ||\n          styles.hasKey(PROP_ACCESSIBILITY_COMPONENT_TYPE) ||\n          styles.hasKey(PROP_ACCESSIBILITY_LIVE_REGION) ||\n          styles.hasKey(PROP_TRANSFORM) ||\n          styles.hasKey(PROP_IMPORTANT_FOR_ACCESSIBILITY) ||\n          styles.hasKey(PROP_REMOVE_CLIPPED_SUBVIEWS)) {\n        forceMountToView();\n      }\n    }\n  }\n\n  /* package */ final void forceMountChildrenToView() {\n    if (mForceMountChildrenToView) {\n      return;\n    }\n\n    mForceMountChildrenToView = true;\n    for (int i = 0, childCount = getChildCount(); i != childCount; ++i) {\n      ReactShadowNode child = getChildAt(i);\n      if (child instanceof FlatShadowNode) {\n        ((FlatShadowNode) child).forceMountToView();\n      }\n    }\n  }\n\n  /**\n   * Collects DrawCommands produced by this FlatShadowNode.\n   */\n  protected void collectState(\n      StateBuilder stateBuilder,\n      float left,\n      float top,\n      float right,\n      float bottom,\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom) {\n    if (mDrawBackground != null) {\n      mDrawBackground = (DrawBackgroundColor) mDrawBackground.updateBoundsAndFreeze(\n          left,\n          top,\n          right,\n          bottom,\n          clipLeft,\n          clipTop,\n          clipRight,\n          clipBottom);\n      stateBuilder.addDrawCommand(mDrawBackground);\n    }\n  }\n\n  /**\n   * Return whether or not this node draws anything\n   *\n   * This is used to decide whether or not to collect the NodeRegion for this node. This ensures\n   * that any FlatShadowNode that does not emit any DrawCommands should not bother handling touch\n   * (i.e. if it draws absolutely nothing, it is, for all intents and purposes, a layout only node).\n   *\n   * @return whether or not this is node draws anything\n   */\n  boolean doesDraw() {\n    // if it mounts to view or draws a background, we can collect it - otherwise, no, unless a\n    // child suggests some alternative behavior\n    return mDrawView != null || mDrawBackground != null;\n  }\n\n  @ReactProp(name = ViewProps.BACKGROUND_COLOR)\n  public void setBackgroundColor(int backgroundColor) {\n    mDrawBackground = (backgroundColor == 0) ? null : new DrawBackgroundColor(backgroundColor);\n    invalidate();\n  }\n\n  @Override\n  public void setOverflow(String overflow) {\n    super.setOverflow(overflow);\n    mClipToBounds = \"hidden\".equals(overflow);\n    if (mClipToBounds) {\n      mOverflowsContainer = false;\n      if (mClipRadius > DrawView.MINIMUM_ROUNDED_CLIPPING_VALUE) {\n        // mount to a view if we are overflow: hidden and are clipping, so that we can do one\n        // clipPath to clip all the children of this node (both DrawCommands and Views).\n        forceMountToView();\n      }\n    } else {\n      updateOverflowsContainer();\n    }\n    invalidate();\n  }\n\n  public final boolean clipToBounds() {\n    return mClipToBounds;\n  }\n\n  @Override\n  public final int getScreenX() {\n    return mViewLeft;\n  }\n\n  @Override\n  public final int getScreenY() {\n    return mViewTop;\n  }\n\n  @Override\n  public final int getScreenWidth() {\n    if (mountsToView()) {\n      return mViewRight - mViewLeft;\n    } else {\n      return Math.round(mNodeRegion.getRight() - mNodeRegion.getLeft());\n    }\n  }\n\n  @Override\n  public final int getScreenHeight() {\n    if (mountsToView()) {\n      return mViewBottom - mViewTop;\n    } else {\n      return Math.round(mNodeRegion.getBottom() - mNodeRegion.getTop());\n    }\n  }\n\n  @Override\n  public void addChildAt(ReactShadowNodeImpl child, int i) {\n    super.addChildAt(child, i);\n    if (mForceMountChildrenToView && child instanceof FlatShadowNode) {\n      ((FlatShadowNode) child).forceMountToView();\n    }\n  }\n\n  /**\n   * Marks root node as updated to trigger a StateBuilder pass to collect DrawCommands for the node\n   * tree. Use it when FlatShadowNode is updated but doesn't require a layout pass (e.g. background\n   * color is changed).\n   */\n  protected final void invalidate() {\n    FlatShadowNode node = this;\n\n    while (true) {\n      if (node.mountsToView()) {\n        if (node.mIsUpdated) {\n          // already updated\n          return;\n        }\n\n        node.mIsUpdated = true;\n      }\n\n      ReactShadowNode parent = node.getParent();\n      if (parent == null) {\n        // not attached to a hierarchy yet\n        return;\n      }\n\n      node = (FlatShadowNode) parent;\n    }\n  }\n\n  @Override\n  public void markUpdated() {\n    super.markUpdated();\n    mIsUpdated = true;\n    invalidate();\n  }\n\n  /* package */ final boolean isUpdated() {\n    return mIsUpdated;\n  }\n\n  /* package */ final void resetUpdated() {\n    mIsUpdated = false;\n  }\n\n  /* package */ final boolean clipBoundsChanged(\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom) {\n    return mClipLeft != clipLeft || mClipTop != clipTop ||\n        mClipRight != clipRight || mClipBottom != clipBottom;\n  }\n\n  /* package */ final void setClipBounds(\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom) {\n    mClipLeft = clipLeft;\n    mClipTop = clipTop;\n    mClipRight = clipRight;\n    mClipBottom = clipBottom;\n  }\n\n  /**\n   * Returns an array of DrawCommands to perform during the View's draw pass.\n   */\n  /* package */ final DrawCommand[] getDrawCommands() {\n    return mDrawCommands;\n  }\n\n  /**\n   * Sets an array of DrawCommands to perform during the View's draw pass. StateBuilder uses old\n   * draw commands to compare to new draw commands and see if the View needs to be redrawn.\n   */\n  /* package */ final void setDrawCommands(DrawCommand[] drawCommands) {\n    mDrawCommands = drawCommands;\n  }\n\n  /**\n   * Sets an array of AttachDetachListeners to call onAttach/onDetach when they are attached to or\n   * detached from a View that this shadow node maps to.\n   */\n  /* package */ final void setAttachDetachListeners(AttachDetachListener[] listeners) {\n    mAttachDetachListeners = listeners;\n  }\n\n  /**\n   * Returns an array of AttachDetachListeners associated with this shadow node.\n   */\n  /* package */ final AttachDetachListener[] getAttachDetachListeners() {\n    return mAttachDetachListeners;\n  }\n\n  /* package */ final FlatShadowNode[] getNativeChildren() {\n    return mNativeChildren;\n  }\n\n  /* package */ final void setNativeChildren(FlatShadowNode[] nativeChildren) {\n    mNativeChildren = nativeChildren;\n  }\n\n  /* package */ final int getNativeParentTag() {\n    return mNativeParentTag;\n  }\n\n  /* package */ final void setNativeParentTag(int nativeParentTag) {\n    mNativeParentTag = nativeParentTag;\n  }\n\n  /* package */ final NodeRegion[] getNodeRegions() {\n    return mNodeRegions;\n  }\n\n  /* package */ final void setNodeRegions(NodeRegion[] nodeRegion) {\n    mNodeRegions = nodeRegion;\n    updateOverflowsContainer();\n  }\n\n  /* package */ final void updateOverflowsContainer() {\n    boolean overflowsContainer = false;\n    int width = (int) (mNodeRegion.getRight() - mNodeRegion.getLeft());\n    int height = (int) (mNodeRegion.getBottom() - mNodeRegion.getTop());\n\n    float leftBound = 0;\n    float rightBound = width;\n    float topBound = 0;\n    float bottomBound = height;\n    Rect logicalOffset = null;\n\n    // when we are overflow:visible, we try to figure out if any of the children are outside\n    // of the bounds of this view. since NodeRegion bounds are relative to their parent (i.e.\n    // 0, 0 is always the start), we see how much outside of the bounds we are (negative left\n    // or top, or bottom that's more than height or right that's more than width). we set these\n    // offsets in mLogicalOffset for being able to more intelligently determine whether or not\n    // to clip certain subviews.\n    if (!mClipToBounds && height > 0 && width > 0) {\n      for (NodeRegion region : mNodeRegions) {\n        if (region.getLeft() < leftBound) {\n          leftBound = region.getLeft();\n          overflowsContainer = true;\n        }\n\n        if (region.getRight() > rightBound) {\n          rightBound = region.getRight();\n          overflowsContainer = true;\n        }\n\n        if (region.getTop() < topBound) {\n          topBound = region.getTop();\n          overflowsContainer = true;\n        }\n\n        if (region.getBottom() > bottomBound) {\n          bottomBound = region.getBottom();\n          overflowsContainer = true;\n        }\n      }\n\n      if (overflowsContainer) {\n        logicalOffset = new Rect(\n            (int) leftBound,\n            (int) topBound,\n            (int) (rightBound - width),\n            (int) (bottomBound - height));\n      }\n    }\n\n    // if we don't overflow, let's check if any of the immediate children overflow.\n    // this is \"indirectly recursive,\" since this method is called when setNodeRegions is called,\n    // and the children call setNodeRegions before their parent. consequently, when a node deep\n    // inside the tree overflows, its immediate parent has mOverflowsContainer set to true, and,\n    // by extension, so do all of its ancestors, sufficing here to only check the immediate\n    // child's mOverflowsContainer value instead of recursively asking if each child overflows its\n    // container.\n    if (!overflowsContainer && mNodeRegion != NodeRegion.EMPTY) {\n      int children = getChildCount();\n      for (int i = 0; i < children; i++) {\n        ReactShadowNode node = getChildAt(i);\n        if (node instanceof FlatShadowNode && ((FlatShadowNode) node).mOverflowsContainer) {\n          Rect childLogicalOffset = ((FlatShadowNode) node).mLogicalOffset;\n          if (logicalOffset == null) {\n            logicalOffset = new Rect();\n          }\n          // TODO: t11674025 - improve this - a grandparent may end up having smaller logical\n          // bounds than its children (because the grandparent's size may be larger than that of\n          // its child, so the grandchild overflows its parent but not its grandparent). currently,\n          // if a 100x100 view has a 5x5 view, and inside it has a 10x10 view, the inner most view\n          // overflows its parent but not its grandparent - the logical bounds on the grandparent\n          // will still be 5x5 (because they're inherited from the child's logical bounds). this\n          // has the effect of causing us to clip 5px later than we really have to.\n          logicalOffset.union(childLogicalOffset);\n          overflowsContainer = true;\n        }\n      }\n    }\n\n    // if things changed, notify the parent(s) about said changes - while in many cases, this will\n    // be extra work (since we process this for the parents after the children), in some cases,\n    // we may have no new node regions in the parent, but have a new node region in the child, and,\n    // as a result, the parent may not get the correct value for overflows container.\n    if (mOverflowsContainer != overflowsContainer) {\n      mOverflowsContainer = overflowsContainer;\n      mLogicalOffset = logicalOffset == null ? LOGICAL_OFFSET_EMPTY : logicalOffset;\n    }\n  }\n\n  /* package */ void updateNodeRegion(\n      float left,\n      float top,\n      float right,\n      float bottom,\n      boolean isVirtual) {\n    if (!mNodeRegion.matches(left, top, right, bottom, isVirtual)) {\n      setNodeRegion(new NodeRegion(left, top, right, bottom, getReactTag(), isVirtual));\n    }\n  }\n\n  protected final void setNodeRegion(NodeRegion nodeRegion) {\n    mNodeRegion = nodeRegion;\n    updateOverflowsContainer();\n  }\n\n  /* package */ final NodeRegion getNodeRegion() {\n    return mNodeRegion;\n  }\n\n  /**\n   * Sets boundaries of the View that this node maps to relative to the parent left/top coordinate.\n   */\n  /* package */ final void setViewBounds(int left, int top, int right, int bottom) {\n    mViewLeft = left;\n    mViewTop = top;\n    mViewRight = right;\n    mViewBottom = bottom;\n  }\n\n  /**\n   * Left position of the View this node maps to relative to the parent View.\n   */\n  /* package */ final int getViewLeft() {\n    return mViewLeft;\n  }\n\n  /**\n   * Top position of the View this node maps to relative to the parent View.\n   */\n  /* package */ final int getViewTop() {\n    return mViewTop;\n  }\n\n  /**\n   * Right position of the View this node maps to relative to the parent View.\n   */\n  /* package */ final int getViewRight() {\n    return mViewRight;\n  }\n\n  /**\n   * Bottom position of the View this node maps to relative to the parent View.\n   */\n  /* package */ final int getViewBottom() {\n    return mViewBottom;\n  }\n\n  /* package */ final void forceMountToView() {\n    if (isVirtual()) {\n      return;\n    }\n\n    if (mDrawView == null) {\n      // Create a new DrawView, but we might not know our react tag yet, so set it to 0 in the\n      // meantime.\n      mDrawView = EMPTY_DRAW_VIEW;\n      invalidate();\n\n      // reset NodeRegion to allow it getting garbage-collected\n      mNodeRegion = NodeRegion.EMPTY;\n    }\n  }\n\n  /* package */ final DrawView collectDrawView(\n      float left,\n      float top,\n      float right,\n      float bottom,\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom) {\n    Assertions.assumeNotNull(mDrawView);\n    if (mDrawView == EMPTY_DRAW_VIEW) {\n      // This is the first time we have collected this DrawView, but we have to create a new\n      // DrawView anyway, as reactTag is final, and our DrawView instance is the static copy.\n      mDrawView = new DrawView(getReactTag());\n    }\n\n    // avoid path clipping if overflow: visible\n    float clipRadius = mClipToBounds ? mClipRadius : 0.0f;\n    // We have the correct react tag, but we may need a new copy with updated bounds.  If the bounds\n    // match or were never set, the same view is returned.\n    mDrawView = mDrawView.collectDrawView(\n        left,\n        top,\n        right,\n        bottom,\n        left + mLogicalOffset.left,\n        top + mLogicalOffset.top,\n        right + mLogicalOffset.right,\n        bottom + mLogicalOffset.bottom,\n        clipLeft,\n        clipTop,\n        clipRight,\n        clipBottom,\n        clipRadius);\n    return mDrawView;\n  }\n\n  @Nullable\n  /* package */ final OnLayoutEvent obtainLayoutEvent(int x, int y, int width, int height) {\n    if (mLayoutX == x && mLayoutY == y && mLayoutWidth == width && mLayoutHeight == height) {\n      return null;\n    }\n\n    mLayoutX = x;\n    mLayoutY = y;\n    mLayoutWidth = width;\n    mLayoutHeight = height;\n\n    return OnLayoutEvent.obtain(getReactTag(), x, y, width, height);\n  }\n\n  /* package */ final boolean mountsToView() {\n    return mDrawView != null;\n  }\n\n  /* package */ final boolean isBackingViewCreated() {\n    return mBackingViewIsCreated;\n  }\n\n  /* package */ final void signalBackingViewIsCreated() {\n    mBackingViewIsCreated = true;\n  }\n\n  public boolean clipsSubviews() {\n    return false;\n  }\n\n  public boolean isHorizontal() {\n    return false;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatTextShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.text.SpannableStringBuilder;\n\nimport com.facebook.react.uimanager.ReactShadowNode;\n\n/**\n * Base class for RCTVirtualText and RCTRawText.\n */\n/* package */ abstract class FlatTextShadowNode extends FlatShadowNode {\n\n  // these 2 are only used between collectText() and applySpans() calls.\n  private int mTextBegin;\n  private int mTextEnd;\n\n  /**\n   * Propagates changes up to RCTText without dirtying current node.\n   */\n  protected void notifyChanged(boolean shouldRemeasure) {\n    ReactShadowNode parent = getParent();\n    if (parent instanceof FlatTextShadowNode) {\n      ((FlatTextShadowNode) parent).notifyChanged(shouldRemeasure);\n    }\n  }\n\n  @Override\n  public boolean isVirtual() {\n    return true;\n  }\n\n  /**\n   * Recursively visits FlatTextShadowNode and its children,\n   * appending text to SpannableStringBuilder.\n   */\n  /* package */ final void collectText(SpannableStringBuilder builder) {\n    mTextBegin = builder.length();\n    performCollectText(builder);\n    mTextEnd = builder.length();\n  }\n\n  /**\n   * Whether or not to allow empty spans to be set\n   * This is used to bypass an optimization in {@code applySpans} that skips applying spans if\n   * there is no text (since, for TextInput, for example, we want to apply the span even if there\n   * is no text so that newly typed text gets styled properly).\n   *\n   * @return a boolean representing whether or not we should allow empty spans\n   */\n  /* package */ boolean shouldAllowEmptySpans() {\n    return false;\n  }\n\n  /* package */ boolean isEditable() {\n    return false;\n  }\n\n  /**\n   * Recursively visits FlatTextShadowNode and its children,\n   * applying spans to SpannableStringBuilder.\n   */\n  /* package */ final void applySpans(SpannableStringBuilder builder, boolean isEditable) {\n    if (mTextBegin != mTextEnd || shouldAllowEmptySpans()) {\n      performApplySpans(builder, mTextBegin, mTextEnd, isEditable);\n    }\n  }\n\n  protected abstract void performCollectText(SpannableStringBuilder builder);\n  protected abstract void performApplySpans(\n      SpannableStringBuilder builder,\n      int begin,\n      int end,\n      boolean isEditable);\n  protected abstract void performCollectAttachDetachListeners(StateBuilder stateBuilder);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatUIImplementation.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.modules.fresco.FrescoModule;\nimport com.facebook.react.modules.i18nmanager.I18nUtil;\nimport com.facebook.react.uimanager.ReactShadowNode;\nimport com.facebook.react.uimanager.ReactStylesDiffMap;\nimport com.facebook.react.uimanager.UIImplementation;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.uimanager.ViewManagerRegistry;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.yoga.YogaDirection;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * FlatUIImplementation builds on top of UIImplementation and allows pre-creating everything\n * required for drawing (DrawCommands) and touching (NodeRegions) views in background thread\n * for faster drawing and interactions.\n */\npublic class FlatUIImplementation extends UIImplementation {\n\n  private static final Map<String, Class<? extends ViewManager>> flatManagerClassMap;\n\n  static {\n    flatManagerClassMap = new HashMap<>();\n    flatManagerClassMap.put(RCTViewManager.REACT_CLASS, RCTViewManager.class);\n    flatManagerClassMap.put(RCTTextManager.REACT_CLASS, RCTTextManager.class);\n    flatManagerClassMap.put(RCTRawTextManager.REACT_CLASS, RCTRawTextManager.class);\n    flatManagerClassMap.put(RCTVirtualTextManager.REACT_CLASS, RCTVirtualTextManager.class);\n    flatManagerClassMap.put(RCTTextInlineImageManager.REACT_CLASS, RCTTextInlineImageManager.class);\n    flatManagerClassMap.put(RCTImageViewManager.REACT_CLASS, RCTImageViewManager.class);\n    flatManagerClassMap.put(RCTTextInputManager.REACT_CLASS, RCTTextInputManager.class);\n    flatManagerClassMap.put(RCTViewPagerManager.REACT_CLASS, RCTViewPagerManager.class);\n    flatManagerClassMap.put(FlatARTSurfaceViewManager.REACT_CLASS, FlatARTSurfaceViewManager.class);\n    flatManagerClassMap.put(RCTModalHostManager.REACT_CLASS, RCTModalHostManager.class);\n  }\n\n  /**\n   * Build the map of view managers, checking that the managers FlatUI requires are correctly\n   * overridden.\n   */\n  private static Map<String, ViewManager> buildViewManagerMap(List<ViewManager> viewManagers) {\n    Map<String, ViewManager> viewManagerMap = new HashMap<>();\n    for (ViewManager viewManager : viewManagers) {\n      viewManagerMap.put(viewManager.getName(), viewManager);\n    }\n    for (Map.Entry<String, Class<? extends ViewManager>> entry : flatManagerClassMap.entrySet()) {\n      String name = entry.getKey();\n      ViewManager maybeFlatViewManager = viewManagerMap.get(name);\n      if (maybeFlatViewManager == null) {\n        // We don't have a view manager for this name in the package, no need to add one.\n        continue;\n      }\n\n      Class<? extends ViewManager> flatClazz = entry.getValue();\n      if (maybeFlatViewManager.getClass() != flatClazz) {\n        // If we have instances that have flat equivalents, override them.\n        try {\n          viewManagerMap.put(name, flatClazz.newInstance());\n        } catch (IllegalAccessException e) {\n          throw new RuntimeException(\"Unable to access flat class for \" + name, e);\n        } catch (InstantiationException e) {\n          throw new RuntimeException(\"Unable to instantiate flat class for \" + name, e);\n        }\n      }\n    }\n    return viewManagerMap;\n  }\n\n  public static FlatUIImplementation createInstance(\n      ReactApplicationContext reactContext,\n      List<ViewManager> viewManagers,\n      EventDispatcher eventDispatcher,\n      boolean memoryImprovementEnabled,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n\n    Map<String, ViewManager> viewManagerMap = buildViewManagerMap(viewManagers);\n\n    RCTImageViewManager imageViewManager =\n      (RCTImageViewManager) viewManagerMap.get(RCTImageViewManager.REACT_CLASS);\n    if (imageViewManager != null) {\n      Object callerContext = imageViewManager.getCallerContext();\n      if (callerContext != null) {\n        RCTImageView.setCallerContext(callerContext);\n      }\n    }\n    DraweeRequestHelper.setResources(reactContext.getResources());\n\n    TypefaceCache.setAssetManager(reactContext.getAssets());\n\n    ViewManagerRegistry viewManagerRegistry = new ViewManagerRegistry(viewManagerMap);\n    FlatNativeViewHierarchyManager nativeViewHierarchyManager = new FlatNativeViewHierarchyManager(\n      viewManagerRegistry);\n    FlatUIViewOperationQueue operationsQueue =\n        new FlatUIViewOperationQueue(\n            reactContext, nativeViewHierarchyManager, minTimeLeftInFrameForNonBatchedOperationMs);\n    return new FlatUIImplementation(\n      reactContext,\n      imageViewManager,\n      viewManagerRegistry,\n      operationsQueue,\n      eventDispatcher,\n      memoryImprovementEnabled\n    );\n  }\n\n  /**\n   * Helper class that sorts moveTo/moveFrom arrays passed to #manageChildren().\n   * Not used outside of the said method.\n   */\n  private final MoveProxy mMoveProxy = new MoveProxy();\n  private final ReactApplicationContext mReactContext;\n  private @Nullable RCTImageViewManager mRCTImageViewManager;\n  private final StateBuilder mStateBuilder;\n  private final boolean mMemoryImprovementEnabled;\n\n  private FlatUIImplementation(\n      ReactApplicationContext reactContext,\n      @Nullable RCTImageViewManager rctImageViewManager,\n      ViewManagerRegistry viewManagers,\n      FlatUIViewOperationQueue operationsQueue,\n      EventDispatcher eventDispatcher,\n      boolean memoryImprovementEnabled) {\n    super(reactContext, viewManagers, operationsQueue, eventDispatcher);\n    mReactContext = reactContext;\n    mRCTImageViewManager = rctImageViewManager;\n    mStateBuilder = new StateBuilder(operationsQueue);\n    mMemoryImprovementEnabled = memoryImprovementEnabled;\n  }\n\n  @Override\n  protected ReactShadowNode createRootShadowNode() {\n    if (mRCTImageViewManager != null) {\n      // This is not the best place to initialize DraweeRequestHelper, but order of module\n      // initialization is undefined, and this is pretty much the earliest when we are guarantied\n      // that Fresco is initialized and DraweeControllerBuilder can be queried. This also happens\n      // relatively rarely to have any performance considerations.\n      mReactContext.getNativeModule(FrescoModule.class); // initialize Fresco\n      DraweeRequestHelper.setDraweeControllerBuilder(\n        mRCTImageViewManager.getDraweeControllerBuilder());\n      mRCTImageViewManager = null;\n    }\n\n    ReactShadowNode node = new FlatRootShadowNode();\n    I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();\n    if (sharedI18nUtilInstance.isRTL(mReactContext)) {\n      node.setLayoutDirection(YogaDirection.RTL);\n    }\n    return node;\n  }\n\n  @Override\n  protected ReactShadowNode createShadowNode(String className) {\n    ReactShadowNode cssNode = super.createShadowNode(className);\n    if (cssNode instanceof FlatShadowNode || cssNode.isVirtual()) {\n      return cssNode;\n    }\n\n    ViewManager viewManager = resolveViewManager(className);\n    return new NativeViewWrapper(viewManager);\n  }\n\n  @Override\n  protected void handleCreateView(\n    ReactShadowNode cssNode,\n    int rootViewTag,\n    @Nullable ReactStylesDiffMap styles) {\n    if (cssNode instanceof FlatShadowNode) {\n      FlatShadowNode node = (FlatShadowNode) cssNode;\n\n      if (styles != null) {\n        node.handleUpdateProperties(styles);\n      }\n\n      if (node.mountsToView()) {\n        mStateBuilder.enqueueCreateOrUpdateView(node, styles);\n      }\n    } else {\n      super.handleCreateView(cssNode, rootViewTag, styles);\n    }\n  }\n\n  @Override\n  protected void handleUpdateView(\n    ReactShadowNode cssNode,\n    String className,\n    ReactStylesDiffMap styles) {\n    if (cssNode instanceof FlatShadowNode) {\n      FlatShadowNode node = (FlatShadowNode) cssNode;\n\n      node.handleUpdateProperties(styles);\n\n      if (node.mountsToView()) {\n        mStateBuilder.enqueueCreateOrUpdateView(node, styles);\n      }\n    } else {\n      super.handleUpdateView(cssNode, className, styles);\n    }\n  }\n\n  @Override\n  public void manageChildren(\n    int viewTag,\n    @Nullable ReadableArray moveFrom,\n    @Nullable ReadableArray moveTo,\n    @Nullable ReadableArray addChildTags,\n    @Nullable ReadableArray addAtIndices,\n    @Nullable ReadableArray removeFrom) {\n\n    ReactShadowNode parentNode = resolveShadowNode(viewTag);\n\n    // moveFrom and removeFrom are defined in original order before any mutations.\n    removeChildren(parentNode, moveFrom, moveTo, removeFrom);\n\n    // moveTo and addAtIndices are defined in final order after all the mutations applied.\n    addChildren(parentNode, addChildTags, addAtIndices);\n  }\n\n  @Override\n  public void setChildren(\n    int viewTag,\n    ReadableArray children) {\n\n    ReactShadowNode parentNode = resolveShadowNode(viewTag);\n\n    for (int i = 0; i < children.size(); i++) {\n      ReactShadowNode addToChild = resolveShadowNode(children.getInt(i));\n      addChildAt(parentNode, addToChild, i, i - 1);\n    }\n  }\n\n  @Override\n  public void measure(int reactTag, Callback callback) {\n    measureHelper(reactTag, false, callback);\n  }\n\n  private void measureHelper(int reactTag, boolean relativeToWindow, Callback callback) {\n    FlatShadowNode node = (FlatShadowNode) resolveShadowNode(reactTag);\n    if (node.mountsToView()) {\n      mStateBuilder.ensureBackingViewIsCreated(node);\n      if (relativeToWindow) {\n        super.measureInWindow(reactTag, callback);\n      } else {\n        super.measure(reactTag, callback);\n      }\n      return;\n    }\n\n    // virtual nodes do not have values for width and height, so get these values\n    // from the first non-virtual parent node\n    while (node != null && node.isVirtual()) {\n      node = (FlatShadowNode) node.getParent();\n    }\n\n    if (node == null) {\n      // everything is virtual, this shouldn't happen so just silently return\n      return;\n    }\n\n    float width = node.getLayoutWidth();\n    float height = node.getLayoutHeight();\n\n    boolean nodeMountsToView = node.mountsToView();\n    // this is to avoid double-counting xInParent and yInParent when we visit\n    // the while loop, below.\n    float xInParent = nodeMountsToView ? node.getLayoutX() : 0;\n    float yInParent = nodeMountsToView ? node.getLayoutY() : 0;\n\n    while (!node.mountsToView()) {\n      if (!node.isVirtual()) {\n        xInParent += node.getLayoutX();\n        yInParent += node.getLayoutY();\n      }\n\n      node = Assertions.assumeNotNull((FlatShadowNode) node.getParent());\n    }\n\n    float parentWidth = node.getLayoutWidth();\n    float parentHeight = node.getLayoutHeight();\n\n    FlatUIViewOperationQueue operationsQueue = mStateBuilder.getOperationsQueue();\n    operationsQueue.enqueueMeasureVirtualView(\n      node.getReactTag(),\n      xInParent / parentWidth,\n      yInParent / parentHeight,\n      width / parentWidth,\n      height / parentHeight,\n      relativeToWindow,\n      callback);\n  }\n\n  private void ensureMountsToViewAndBackingViewIsCreated(int reactTag) {\n    FlatShadowNode node = (FlatShadowNode) resolveShadowNode(reactTag);\n    if (node.isBackingViewCreated()) {\n      return;\n    }\n    node.forceMountToView();\n    mStateBuilder.ensureBackingViewIsCreated(node);\n  }\n\n  @Override\n  public void findSubviewIn(int reactTag, float targetX, float targetY, Callback callback) {\n    ensureMountsToViewAndBackingViewIsCreated(reactTag);\n    super.findSubviewIn(reactTag, targetX, targetY, callback);\n  }\n\n  @Override\n  public void measureInWindow(int reactTag, Callback callback) {\n    measureHelper(reactTag, true, callback);\n  }\n\n  @Override\n  public void addAnimation(int reactTag, int animationID, Callback onSuccess) {\n    ensureMountsToViewAndBackingViewIsCreated(reactTag);\n    super.addAnimation(reactTag, animationID, onSuccess);\n  }\n\n  @Override\n  public void dispatchViewManagerCommand(int reactTag, int commandId, ReadableArray commandArgs) {\n    // Make sure that our target view is actually a view, then delay command dispatch until after\n    // we have updated the view hierarchy.\n    ensureMountsToViewAndBackingViewIsCreated(reactTag);\n    mStateBuilder.enqueueViewManagerCommand(reactTag, commandId, commandArgs);\n  }\n\n  @Override\n  public void showPopupMenu(int reactTag, ReadableArray items, Callback error, Callback success) {\n    ensureMountsToViewAndBackingViewIsCreated(reactTag);\n    super.showPopupMenu(reactTag, items, error, success);\n  }\n\n  @Override\n  public void sendAccessibilityEvent(int reactTag, int eventType) {\n    ensureMountsToViewAndBackingViewIsCreated(reactTag);\n    super.sendAccessibilityEvent(reactTag, eventType);\n  }\n\n  /**\n   * Removes all children defined by moveFrom and removeFrom from a given parent,\n   * preparing elements in moveFrom to be re-added at proper index.\n   */\n  private void removeChildren(\n    ReactShadowNode parentNode,\n    @Nullable ReadableArray moveFrom,\n    @Nullable ReadableArray moveTo,\n    @Nullable ReadableArray removeFrom) {\n\n    int prevIndex = Integer.MAX_VALUE;\n\n    mMoveProxy.setup(moveFrom, moveTo);\n\n    int moveFromIndex = mMoveProxy.size() - 1;\n    int moveFromChildIndex = (moveFromIndex == -1) ? -1 : mMoveProxy.getMoveFrom(moveFromIndex);\n\n    int numToRemove = removeFrom == null ? 0 : removeFrom.size();\n    int[] indicesToRemove = new int[numToRemove];\n    if (numToRemove > 0) {\n      Assertions.assertNotNull(removeFrom);\n      for (int i = 0; i < numToRemove; i++) {\n        int indexToRemove = removeFrom.getInt(i);\n        indicesToRemove[i] = indexToRemove;\n      }\n    }\n\n    // this isn't guaranteed to be sorted actually\n    Arrays.sort(indicesToRemove);\n\n    int removeFromIndex;\n    int removeFromChildIndex;\n    if (removeFrom == null) {\n      removeFromIndex = -1;\n      removeFromChildIndex = -1;\n    } else {\n      removeFromIndex = indicesToRemove.length - 1;\n      removeFromChildIndex = indicesToRemove[removeFromIndex];\n    }\n\n    // both moveFrom and removeFrom are already sorted, but combined order is not sorted. Use\n    // a merge step from mergesort to walk over both arrays and extract elements in sorted order.\n\n    while (true) {\n      if (moveFromChildIndex > removeFromChildIndex) {\n        moveChild(removeChildAt(parentNode, moveFromChildIndex, prevIndex), moveFromIndex);\n        prevIndex = moveFromChildIndex;\n\n        --moveFromIndex;\n        moveFromChildIndex = (moveFromIndex == -1) ? -1 : mMoveProxy.getMoveFrom(moveFromIndex);\n      } else if (removeFromChildIndex > moveFromChildIndex) {\n        removeChild(removeChildAt(parentNode, removeFromChildIndex, prevIndex), parentNode);\n        prevIndex = removeFromChildIndex;\n\n        --removeFromIndex;\n        removeFromChildIndex = (removeFromIndex == -1) ? -1 : indicesToRemove[removeFromIndex];\n      } else {\n        // moveFromChildIndex == removeFromChildIndex can only be if both are equal to -1\n        // which means that we exhausted both arrays, and all children are removed.\n        break;\n      }\n    }\n  }\n\n  /**\n   * Unregisters given element and all of its children from ShadowNodeRegistry,\n   * and drops all Views used by it and its children.\n   */\n  private void removeChild(ReactShadowNode child, ReactShadowNode parentNode) {\n    dropNativeViews(child, parentNode);\n    removeShadowNode(child);\n  }\n\n  private void dropNativeViews(ReactShadowNode child, ReactShadowNode parentNode) {\n    if (child instanceof FlatShadowNode) {\n      FlatShadowNode node = (FlatShadowNode) child;\n      if (node.mountsToView() && node.isBackingViewCreated()) {\n        int tag = -1;\n\n        // this tag is used to remove the reference to this dropping view if it it's clipped.\n        // we need to figure out the correct \"view parent\" tag to do this. note that this is\n        // not necessarily getParent().getReactTag(), since getParent() may represent something\n        // that's not a View - we need to find the first View (what would represent\n        // view.getParent() on the ui thread), which is what this code is finding.\n        ReactShadowNode tmpNode = parentNode;\n        while (tmpNode != null) {\n          if (tmpNode instanceof FlatShadowNode) {\n            FlatShadowNode flatTmpNode = (FlatShadowNode) tmpNode;\n            if (flatTmpNode.mountsToView() && flatTmpNode.isBackingViewCreated() &&\n              flatTmpNode.getParent() != null) {\n              tag = flatTmpNode.getReactTag();\n              break;\n            }\n          }\n          tmpNode = tmpNode.getParent();\n        }\n\n        // this will recursively drop all subviews\n        mStateBuilder.dropView(node, tag);\n        return;\n      }\n    }\n\n    for (int i = 0, childCount = child.getChildCount(); i != childCount; ++i) {\n      dropNativeViews(child.getChildAt(i), child);\n    }\n  }\n\n  /**\n   * Prepares a given element to be moved to a new position.\n   */\n  private void moveChild(ReactShadowNode child, int moveFromIndex) {\n    mMoveProxy.setChildMoveFrom(moveFromIndex, child);\n  }\n\n  /**\n   * Adds all children from addChildTags and moveFrom/moveTo.\n   */\n  private void addChildren(\n    ReactShadowNode parentNode,\n    @Nullable ReadableArray addChildTags,\n    @Nullable ReadableArray addAtIndices) {\n\n    int prevIndex = -1;\n\n    int moveToIndex;\n    int moveToChildIndex;\n    if (mMoveProxy.size() == 0) {\n      moveToIndex = Integer.MAX_VALUE;\n      moveToChildIndex = Integer.MAX_VALUE;\n    } else {\n      moveToIndex = 0;\n      moveToChildIndex = mMoveProxy.getMoveTo(0);\n    }\n\n    int numNodesToAdd;\n    int addToIndex;\n    int addToChildIndex;\n    if (addAtIndices == null) {\n      numNodesToAdd = 0;\n      addToIndex = Integer.MAX_VALUE;\n      addToChildIndex = Integer.MAX_VALUE;\n    } else {\n      numNodesToAdd = addAtIndices.size();\n      addToIndex = 0;\n      addToChildIndex = addAtIndices.getInt(0);\n    }\n\n    // both mMoveProxy and addChildTags are already sorted, but combined order is not sorted. Use\n    // a merge step from mergesort to walk over both arrays and extract elements in sorted order.\n\n    while (true) {\n      if (addToChildIndex < moveToChildIndex) {\n        ReactShadowNode addToChild = resolveShadowNode(addChildTags.getInt(addToIndex));\n        addChildAt(parentNode, addToChild, addToChildIndex, prevIndex);\n        prevIndex = addToChildIndex;\n\n        ++addToIndex;\n        if (addToIndex == numNodesToAdd) {\n          addToChildIndex = Integer.MAX_VALUE;\n        } else {\n          addToChildIndex = addAtIndices.getInt(addToIndex);\n        }\n      } else if (moveToChildIndex < addToChildIndex) {\n        ReactShadowNode moveToChild = mMoveProxy.getChildMoveTo(moveToIndex);\n        addChildAt(parentNode, moveToChild, moveToChildIndex, prevIndex);\n        prevIndex = moveToChildIndex;\n\n        ++moveToIndex;\n        if (moveToIndex == mMoveProxy.size()) {\n          moveToChildIndex = Integer.MAX_VALUE;\n        } else {\n          moveToChildIndex = mMoveProxy.getMoveTo(moveToIndex);\n        }\n      } else {\n        // moveToChildIndex == addToChildIndex can only be if both are equal to Integer.MAX_VALUE\n        // which means that we exhausted both arrays, and all children are added.\n        break;\n      }\n    }\n  }\n\n  /**\n   * Removes a child from parent, verifying that we are removing in descending order.\n   */\n  private static ReactShadowNode removeChildAt(\n    ReactShadowNode parentNode,\n    int index,\n    int prevIndex) {\n    if (index >= prevIndex) {\n      throw new RuntimeException(\n        \"Invariant failure, needs sorting! \" + index + \" >= \" + prevIndex);\n    }\n\n    return parentNode.removeChildAt(index);\n  }\n\n  /**\n   * Adds a child to parent, verifying that we are adding in ascending order.\n   */\n  private static void addChildAt(\n    ReactShadowNode parentNode,\n    ReactShadowNode childNode,\n    int index,\n    int prevIndex) {\n    if (index <= prevIndex) {\n      throw new RuntimeException(\n        \"Invariant failure, needs sorting! \" + index + \" <= \" + prevIndex);\n    }\n\n    parentNode.addChildAt(childNode, index);\n  }\n\n  @Override\n  protected void updateViewHierarchy() {\n    super.updateViewHierarchy();\n    mStateBuilder.afterUpdateViewHierarchy(mEventDispatcher);\n  }\n\n  @Override\n  protected void applyUpdatesRecursive(\n    ReactShadowNode cssNode,\n    float absoluteX,\n    float absoluteY) {\n    mStateBuilder.applyUpdates((FlatRootShadowNode) cssNode);\n  }\n\n  @Override\n  public void removeRootView(int rootViewTag) {\n    if (mMemoryImprovementEnabled) {\n      removeRootShadowNode(rootViewTag);\n    }\n    mStateBuilder.removeRootView(rootViewTag);\n  }\n\n  @Override\n  public void setJSResponder(int possiblyVirtualReactTag, boolean blockNativeResponder) {\n    ReactShadowNode node = resolveShadowNode(possiblyVirtualReactTag);\n    while (node.isVirtual()) {\n      node = node.getParent();\n    }\n    int tag = node.getReactTag();\n\n    // if the node in question doesn't mount to a View, find the first parent that does mount to\n    // a View. without this, we'll crash when we try to set the JSResponder, since part of that\n    // is to find the parent view and ask it to not intercept touch events.\n    while (node instanceof FlatShadowNode && !((FlatShadowNode) node).mountsToView()) {\n      node = node.getParent();\n    }\n\n    FlatUIViewOperationQueue operationsQueue = mStateBuilder.getOperationsQueue();\n    operationsQueue.enqueueSetJSResponder(\n      node == null ? tag : node.getReactTag(),\n      possiblyVirtualReactTag,\n      blockNativeResponder);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatUIViewOperationQueue.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport com.facebook.react.uimanager.UIViewOperationQueue;\nimport android.util.SparseIntArray;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.uimanager.IllegalViewOperationException;\nimport com.facebook.react.uimanager.NoSuchNativeViewException;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.TouchTargetHelper;\nimport com.facebook.react.uimanager.UIViewOperationQueue;\nimport java.util.ArrayList;\nimport javax.annotation.Nullable;\n\n/**\n * FlatUIViewOperationQueue extends {@link UIViewOperationQueue} to add\n * FlatUIImplementation-specific methods that need to run in UI thread.\n */\n/* package */ final class FlatUIViewOperationQueue extends UIViewOperationQueue {\n\n  private static final int[] MEASURE_BUFFER = new int[4];\n\n  private final FlatNativeViewHierarchyManager mNativeViewHierarchyManager;\n  private final ProcessLayoutRequests mProcessLayoutRequests = new ProcessLayoutRequests();\n\n  private final class ProcessLayoutRequests implements UIViewOperationQueue.UIOperation {\n    @Override\n    public void execute() {\n      FlatViewGroup.processLayoutRequests();\n    }\n  }\n\n  /**\n   * UIOperation that updates DrawCommands for a View defined by reactTag.\n   */\n  private final class UpdateMountState implements UIViewOperationQueue.UIOperation {\n\n    private final int mReactTag;\n    private final @Nullable DrawCommand[] mDrawCommands;\n    private final @Nullable AttachDetachListener[] mAttachDetachListeners;\n    private final @Nullable NodeRegion[] mNodeRegions;\n\n    private UpdateMountState(\n        int reactTag,\n        @Nullable DrawCommand[] drawCommands,\n        @Nullable AttachDetachListener[] listeners,\n        @Nullable NodeRegion[] nodeRegions) {\n      mReactTag = reactTag;\n      mDrawCommands = drawCommands;\n      mAttachDetachListeners = listeners;\n      mNodeRegions = nodeRegions;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.updateMountState(\n          mReactTag,\n          mDrawCommands,\n          mAttachDetachListeners,\n          mNodeRegions);\n    }\n  }\n\n  /**\n   * UIOperation that updates DrawCommands for a View defined by reactTag.\n   */\n  private final class UpdateClippingMountState implements UIViewOperationQueue.UIOperation {\n\n    private final int mReactTag;\n    private final @Nullable DrawCommand[] mDrawCommands;\n    private final SparseIntArray mDrawViewIndexMap;\n    private final float[] mCommandMaxBot;\n    private final float[] mCommandMinTop;\n    private final @Nullable AttachDetachListener[] mAttachDetachListeners;\n    private final @Nullable NodeRegion[] mNodeRegions;\n    private final float[] mRegionMaxBot;\n    private final float[] mRegionMinTop;\n    private final boolean mWillMountViews;\n\n    private UpdateClippingMountState(\n        int reactTag,\n        @Nullable DrawCommand[] drawCommands,\n        SparseIntArray drawViewIndexMap,\n        float[] commandMaxBot,\n        float[] commandMinTop,\n        @Nullable AttachDetachListener[] listeners,\n        @Nullable NodeRegion[] nodeRegions,\n        float[] regionMaxBot,\n        float[] regionMinTop,\n        boolean willMountViews) {\n      mReactTag = reactTag;\n      mDrawCommands = drawCommands;\n      mDrawViewIndexMap = drawViewIndexMap;\n      mCommandMaxBot = commandMaxBot;\n      mCommandMinTop = commandMinTop;\n      mAttachDetachListeners = listeners;\n      mNodeRegions = nodeRegions;\n      mRegionMaxBot = regionMaxBot;\n      mRegionMinTop = regionMinTop;\n      mWillMountViews = willMountViews;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.updateClippingMountState(\n          mReactTag,\n          mDrawCommands,\n          mDrawViewIndexMap,\n          mCommandMaxBot,\n          mCommandMinTop,\n          mAttachDetachListeners,\n          mNodeRegions,\n          mRegionMaxBot,\n          mRegionMinTop,\n          mWillMountViews);\n    }\n  }\n\n  private final class UpdateViewGroup implements UIViewOperationQueue.UIOperation {\n\n    private final int mReactTag;\n    private final int[] mViewsToAdd;\n    private final int[] mViewsToDetach;\n\n    private UpdateViewGroup(int reactTag, int[] viewsToAdd, int[] viewsToDetach) {\n      mReactTag = reactTag;\n      mViewsToAdd = viewsToAdd;\n      mViewsToDetach = viewsToDetach;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.updateViewGroup(mReactTag, mViewsToAdd, mViewsToDetach);\n    }\n  }\n\n  /**\n   * UIOperation that updates View bounds for a View defined by reactTag.\n   */\n  public final class UpdateViewBounds implements UIViewOperationQueue.UIOperation {\n\n    private final int mReactTag;\n    private final int mLeft;\n    private final int mTop;\n    private final int mRight;\n    private final int mBottom;\n\n    private UpdateViewBounds(int reactTag, int left, int top, int right, int bottom) {\n      mReactTag = reactTag;\n      mLeft = left;\n      mTop = top;\n      mRight = right;\n      mBottom = bottom;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.updateViewBounds(mReactTag, mLeft, mTop, mRight, mBottom);\n    }\n  }\n\n  private final class SetPadding implements UIViewOperationQueue.UIOperation {\n\n    private final int mReactTag;\n    private final int mPaddingLeft;\n    private final int mPaddingTop;\n    private final int mPaddingRight;\n    private final int mPaddingBottom;\n\n    private SetPadding(\n        int reactTag,\n        int paddingLeft,\n        int paddingTop,\n        int paddingRight,\n        int paddingBottom) {\n      mReactTag = reactTag;\n      mPaddingLeft = paddingLeft;\n      mPaddingTop = paddingTop;\n      mPaddingRight = paddingRight;\n      mPaddingBottom = paddingBottom;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.setPadding(\n          mReactTag,\n          mPaddingLeft,\n          mPaddingTop,\n          mPaddingRight,\n          mPaddingBottom);\n    }\n  }\n\n  private final class DropViews implements UIViewOperationQueue.UIOperation {\n\n    private final SparseIntArray mViewsToDrop;\n\n    private DropViews(ArrayList<Integer> viewsToDrop, ArrayList<Integer> parentsForViewsToDrop) {\n      SparseIntArray sparseIntArray = new SparseIntArray();\n      for (int i = 0, count = viewsToDrop.size(); i < count; i++) {\n        sparseIntArray.put(viewsToDrop.get(i), parentsForViewsToDrop.get(i));\n      }\n      mViewsToDrop = sparseIntArray;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.dropViews(mViewsToDrop);\n    }\n  }\n\n  private final class MeasureVirtualView implements UIViewOperationQueue.UIOperation {\n\n    private final int mReactTag;\n    private final float mScaledX;\n    private final float mScaledY;\n    private final float mScaledWidth;\n    private final float mScaledHeight;\n    private final Callback mCallback;\n    private final boolean mRelativeToWindow;\n\n    private MeasureVirtualView(\n        int reactTag,\n        float scaledX,\n        float scaledY,\n        float scaledWidth,\n        float scaledHeight,\n        boolean relativeToWindow,\n        Callback callback) {\n      mReactTag = reactTag;\n      mScaledX = scaledX;\n      mScaledY = scaledY;\n      mScaledWidth = scaledWidth;\n      mScaledHeight = scaledHeight;\n      mCallback = callback;\n      mRelativeToWindow = relativeToWindow;\n    }\n\n    @Override\n    public void execute() {\n      try {\n        // Measure native View\n        if (mRelativeToWindow) {\n          // relative to the window\n          mNativeViewHierarchyManager.measureInWindow(mReactTag, MEASURE_BUFFER);\n        } else {\n          // relative to the root view\n          mNativeViewHierarchyManager.measure(mReactTag, MEASURE_BUFFER);\n        }\n      } catch (NoSuchNativeViewException noSuchNativeViewException) {\n        // Invoke with no args to signal failure and to allow JS to clean up the callback\n        // handle.\n        mCallback.invoke();\n        return;\n      }\n\n      float nativeViewX = MEASURE_BUFFER[0];\n      float nativeViewY = MEASURE_BUFFER[1];\n      float nativeViewWidth = MEASURE_BUFFER[2];\n      float nativeViewHeight = MEASURE_BUFFER[3];\n\n      // Calculate size of the virtual child inside native View.\n      float x = PixelUtil.toDIPFromPixel(mScaledX * nativeViewWidth + nativeViewX);\n      float y = PixelUtil.toDIPFromPixel(mScaledY * nativeViewHeight + nativeViewY);\n      float width = PixelUtil.toDIPFromPixel(mScaledWidth * nativeViewWidth);\n      float height = PixelUtil.toDIPFromPixel(mScaledHeight * nativeViewHeight);\n\n      if (mRelativeToWindow) {\n        mCallback.invoke(x, y, width, height);\n      } else {\n        mCallback.invoke(0, 0, width, height, x, y);\n      }\n    }\n  }\n\n  public final class DetachAllChildrenFromViews implements UIViewOperationQueue.UIOperation {\n    private @Nullable int[] mViewsToDetachAllChildrenFrom;\n\n    public void setViewsToDetachAllChildrenFrom(int[] viewsToDetachAllChildrenFrom) {\n      mViewsToDetachAllChildrenFrom = viewsToDetachAllChildrenFrom;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.detachAllChildrenFromViews(mViewsToDetachAllChildrenFrom);\n    }\n  }\n\n  private final class FindTargetForTouchOperation implements UIViewOperationQueue.UIOperation {\n\n    private final int mReactTag;\n    private final float mTargetX;\n    private final float mTargetY;\n    private final Callback mCallback;\n    private final int[] NATIVE_VIEW_BUFFER = new int[1];\n\n    private FindTargetForTouchOperation(\n        final int reactTag,\n        final float targetX,\n        final float targetY,\n        final Callback callback) {\n      super();\n      mReactTag = reactTag;\n      mTargetX = targetX;\n      mTargetY = targetY;\n      mCallback = callback;\n    }\n\n    @Override\n    public void execute() {\n      try {\n        mNativeViewHierarchyManager.measure(mReactTag, MEASURE_BUFFER);\n      } catch (IllegalViewOperationException e) {\n        mCallback.invoke();\n        return;\n      }\n\n      // Because React coordinates are relative to root container, and measure() operates\n      // on screen coordinates, we need to offset values using root container location.\n      final float containerX = (float) MEASURE_BUFFER[0];\n      final float containerY = (float) MEASURE_BUFFER[1];\n\n      View view = mNativeViewHierarchyManager.getView(mReactTag);\n      final int touchTargetReactTag = TouchTargetHelper.findTargetTagForTouch(\n          mTargetX,\n          mTargetY,\n          (ViewGroup) view,\n          NATIVE_VIEW_BUFFER);\n\n      try {\n        mNativeViewHierarchyManager.measure(\n            NATIVE_VIEW_BUFFER[0],\n            MEASURE_BUFFER);\n      } catch (IllegalViewOperationException e) {\n        mCallback.invoke();\n        return;\n      }\n\n      NodeRegion region = NodeRegion.EMPTY;\n      boolean isNativeView = NATIVE_VIEW_BUFFER[0] == touchTargetReactTag;\n      if (!isNativeView) {\n        // NATIVE_VIEW_BUFFER[0] is a FlatViewGroup, touchTargetReactTag is the touch target and\n        // isn't an Android View - try to get its NodeRegion\n        view = mNativeViewHierarchyManager.getView(NATIVE_VIEW_BUFFER[0]);\n        if (view instanceof FlatViewGroup) {\n          region = ((FlatViewGroup) view).getNodeRegionForTag(mReactTag);\n        }\n      }\n\n      int resultTag = region == NodeRegion.EMPTY ? touchTargetReactTag : region.mTag;\n      float x = PixelUtil.toDIPFromPixel(region.getLeft() + MEASURE_BUFFER[0] - containerX);\n      float y = PixelUtil.toDIPFromPixel(region.getTop() + MEASURE_BUFFER[1] - containerY);\n      float width = PixelUtil.toDIPFromPixel(isNativeView ?\n          MEASURE_BUFFER[2] : region.getRight() - region.getLeft());\n      float height = PixelUtil.toDIPFromPixel(isNativeView ?\n          MEASURE_BUFFER[3] : region.getBottom() - region.getTop());\n      mCallback.invoke(resultTag, x, y, width, height);\n    }\n  }\n\n  /**\n   * Used to delay view manager command dispatch until after the view hierarchy is updated.\n   * Mirrors command operation dispatch, but is only used in Nodes for view manager commands.\n   */\n  public final class ViewManagerCommand implements UIViewOperationQueue.UIOperation {\n\n    private final int mReactTag;\n    private final int mCommand;\n    private final @Nullable ReadableArray mArgs;\n\n    public ViewManagerCommand(\n        int reactTag,\n        int command,\n        @Nullable ReadableArray args) {\n      mReactTag = reactTag;\n      mCommand = command;\n      mArgs = args;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.dispatchCommand(mReactTag, mCommand, mArgs);\n    }\n  }\n\n  public FlatUIViewOperationQueue(\n      ReactApplicationContext reactContext,\n      FlatNativeViewHierarchyManager nativeViewHierarchyManager,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    super(reactContext, nativeViewHierarchyManager, minTimeLeftInFrameForNonBatchedOperationMs);\n\n    mNativeViewHierarchyManager = nativeViewHierarchyManager;\n  }\n\n  /**\n   * Enqueues a new UIOperation that will update DrawCommands for a View defined by reactTag.\n   */\n  public void enqueueUpdateMountState(\n      int reactTag,\n      @Nullable DrawCommand[] drawCommands,\n      @Nullable AttachDetachListener[] listeners,\n      @Nullable NodeRegion[] nodeRegions) {\n    enqueueUIOperation(new UpdateMountState(\n        reactTag,\n        drawCommands,\n        listeners,\n        nodeRegions));\n  }\n\n  /**\n   * Enqueues a new UIOperation that will update DrawCommands for a View defined by reactTag.\n   */\n  public void enqueueUpdateClippingMountState(\n      int reactTag,\n      @Nullable DrawCommand[] drawCommands,\n      SparseIntArray drawViewIndexMap,\n      float[] commandMaxBot,\n      float[] commandMinTop,\n      @Nullable AttachDetachListener[] listeners,\n      @Nullable NodeRegion[] nodeRegions,\n      float[] regionMaxBot,\n      float[] regionMinTop,\n      boolean willMountViews) {\n    enqueueUIOperation(new UpdateClippingMountState(\n        reactTag,\n        drawCommands,\n        drawViewIndexMap,\n        commandMaxBot,\n        commandMinTop,\n        listeners,\n        nodeRegions,\n        regionMaxBot,\n        regionMinTop,\n        willMountViews));\n  }\n\n  public void enqueueUpdateViewGroup(int reactTag, int[] viewsToAdd, int[] viewsToDetach) {\n    enqueueUIOperation(new UpdateViewGroup(reactTag, viewsToAdd, viewsToDetach));\n  }\n\n  /**\n   * Creates a new UIOperation that will update View bounds for a View defined by reactTag.\n   */\n  public UpdateViewBounds createUpdateViewBounds(\n      int reactTag,\n      int left,\n      int top,\n      int right,\n      int bottom) {\n    return new UpdateViewBounds(reactTag, left, top, right, bottom);\n  }\n\n  public ViewManagerCommand createViewManagerCommand(\n      int reactTag,\n      int command,\n      @Nullable ReadableArray args) {\n    return new ViewManagerCommand(reactTag, command, args);\n  }\n\n  /* package */ void enqueueFlatUIOperation(UIViewOperationQueue.UIOperation operation) {\n    enqueueUIOperation(operation);\n  }\n\n  public void enqueueSetPadding(\n      int reactTag,\n      int paddingLeft,\n      int paddingTop,\n      int paddingRight,\n      int paddingBottom) {\n    enqueueUIOperation(\n        new SetPadding(reactTag, paddingLeft, paddingTop, paddingRight, paddingBottom));\n  }\n\n  public void enqueueDropViews(\n      ArrayList<Integer> viewsToDrop,\n      ArrayList<Integer> parentsOfViewsToDrop) {\n    enqueueUIOperation(new DropViews(viewsToDrop, parentsOfViewsToDrop));\n  }\n\n  public void enqueueMeasureVirtualView(\n      int reactTag,\n      float scaledX,\n      float scaledY,\n      float scaledWidth,\n      float scaledHeight,\n      boolean relativeToWindow,\n      Callback callback) {\n    enqueueUIOperation(new MeasureVirtualView(\n        reactTag,\n        scaledX,\n        scaledY,\n        scaledWidth,\n        scaledHeight,\n        relativeToWindow,\n        callback));\n  }\n\n  public void enqueueProcessLayoutRequests() {\n    enqueueUIOperation(mProcessLayoutRequests);\n  }\n\n  public DetachAllChildrenFromViews enqueueDetachAllChildrenFromViews() {\n    DetachAllChildrenFromViews op = new DetachAllChildrenFromViews();\n    enqueueUIOperation(op);\n    return op;\n  }\n\n  @Override\n  public void enqueueFindTargetForTouch(\n      final int reactTag,\n      final float targetX,\n      final float targetY,\n      final Callback callback) {\n    enqueueUIOperation(\n        new FindTargetForTouchOperation(reactTag, targetX, targetY, callback));\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatViewGroup.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport java.lang.ref.WeakReference;\nimport java.util.ArrayList;\n\nimport android.annotation.SuppressLint;\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.Rect;\nimport android.graphics.Typeface;\nimport android.graphics.drawable.Drawable;\nimport android.util.SparseArray;\nimport android.util.SparseIntArray;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.ViewParent;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.SoftAssertions;\nimport com.facebook.react.touch.OnInterceptTouchEventListener;\nimport com.facebook.react.touch.ReactHitSlopView;\nimport com.facebook.react.touch.ReactInterceptingViewGroup;\nimport com.facebook.react.uimanager.PointerEvents;\nimport com.facebook.react.uimanager.ReactCompoundViewGroup;\nimport com.facebook.react.uimanager.ReactPointerEventsView;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.views.image.ImageLoadEvent;\nimport com.facebook.react.uimanager.ReactClippingViewGroup;\n\n/**\n * A view that the {@link FlatShadowNode} hierarchy maps to.  Can mount and draw native views as\n * well as draw commands.  We reuse some of Android's ViewGroup logic, but in Nodes we try to\n * minimize the amount of shadow nodes that map to native children, so we have a lot of logic\n * specific to draw commands.\n *\n * In a very simple case with no Android children, the FlatViewGroup will receive:\n *\n *   flatViewGroup.mountDrawCommands(...);\n *   flatViewGroup.dispatchDraw(...);\n *\n * The draw commands are mounted, then draw iterates through and draws them one by one.\n *\n * In a simple case where there are native children:\n *\n *   flatViewGroup.mountDrawCommands(...);\n *   flatViewGroup.detachAllViewsFromParent(...);\n *   flatViewGroup.mountViews(...);\n *   flatViewGroup.dispatchDraw(...);\n *\n * Draw commands are mounted, with a draw view command for each mounted view.  As an optimization\n * we then detach all views from the FlatViewGroup, then allow mountViews to selectively reattach\n * and add views in order.  We do this as adding a single view is a O(n) operation (On average you\n * have to move all the views in the array to the right one position), as is dropping and re-adding\n * all views (One pass to clear the array and one pass to re-attach detached children and add new\n * children).\n *\n * FlatViewGroups also have arrays of node regions, which are little more than a rects that\n * represents a touch target.  Native views contain their own touch logic, but not all react tags\n * map to native views.  We use node regions to find touch targets among commands as well as nodes\n * which map to native views.\n *\n * In the case of clipping, much of the underlying logic for is handled by\n * {@link DrawCommandManager}.  This lets us separate logic, while also allowing us to save on\n * memory for data structures only used in clipping.  In a case of a clipping FlatViewGroup which\n * is scrolling:\n *\n *   flatViewGroup.setRemoveClippedSubviews(true);\n *   flatViewGroup.mountClippingDrawCommands(...);\n *   flatViewGroup.detachAllViewsFromParent(...);\n *   flatViewGroup.mountViews(...);\n *   flatViewGroup.updateClippingRect(...);\n *   flatViewGroup.dispatchDraw(...);\n *   flatViewGroup.updateClippingRect(...);\n *   flatViewGroup.dispatchDraw(...);\n *   flatViewGroup.updateClippingRect(...);\n *   flatViewGroup.dispatchDraw(...);\n *\n * Setting remove clipped subviews creates a {@link DrawCommandManager} to handle clipping, which\n * allows the rest of the methods to simply call in to draw command manager to handle the clipping\n * logic.\n */\n/* package */ final class FlatViewGroup extends ViewGroup\n    implements ReactInterceptingViewGroup, ReactClippingViewGroup,\n    ReactCompoundViewGroup, ReactHitSlopView, ReactPointerEventsView, FlatMeasuredViewGroup {\n  /**\n   * Helper class that allows our AttachDetachListeners to invalidate the hosting View.  When a\n   * listener gets an attach it is passed an invalidate callback for the FlatViewGroup it is being\n   * attached to.\n   */\n  static final class InvalidateCallback extends WeakReference<FlatViewGroup> {\n\n    private InvalidateCallback(FlatViewGroup view) {\n      super(view);\n    }\n\n    /**\n     * Propagates invalidate() call up to the hosting View (if it's still alive)\n     */\n    public void invalidate() {\n      FlatViewGroup view = get();\n      if (view != null) {\n        view.invalidate();\n      }\n    }\n\n    /**\n     * Propogates image load events to javascript if the hosting view is still alive.\n     *\n     * @param reactTag The view id.\n     * @param imageLoadEvent The event type.\n     */\n    public void dispatchImageLoadEvent(int reactTag, int imageLoadEvent) {\n      FlatViewGroup view = get();\n      if (view == null) {\n        return;\n      }\n\n      ReactContext reactContext = ((ReactContext) view.getContext());\n      UIManagerModule uiManagerModule = reactContext.getNativeModule(UIManagerModule.class);\n      uiManagerModule.getEventDispatcher().dispatchEvent(\n          new ImageLoadEvent(reactTag, imageLoadEvent));\n    }\n  }\n\n  // Draws the name of the draw commands at the bottom right corner of it's bounds.\n  private static final boolean DEBUG_DRAW_TEXT = false;\n  // Draws colored rectangles over known performance issues.\n  /* package */ static final boolean DEBUG_HIGHLIGHT_PERFORMANCE_ISSUES = false;\n  // Force layout bounds drawing.  This can also be enabled by turning on layout bounds in Android.\n  private static final boolean DEBUG_DRAW = DEBUG_DRAW_TEXT || DEBUG_HIGHLIGHT_PERFORMANCE_ISSUES;\n  // Resources for debug drawing.\n  private boolean mAndroidDebugDraw;\n  private static Paint sDebugTextPaint;\n  private static Paint sDebugTextBackgroundPaint;\n  private static Paint sDebugRectPaint;\n  private static Paint sDebugCornerPaint;\n  private static Rect sDebugRect;\n\n  private static final ArrayList<FlatViewGroup> LAYOUT_REQUESTS = new ArrayList<>();\n  private static final Rect VIEW_BOUNDS = new Rect();\n\n  // An invalidate callback singleton for this FlatViewGroup.\n  private @Nullable InvalidateCallback mInvalidateCallback;\n  private DrawCommand[] mDrawCommands = DrawCommand.EMPTY_ARRAY;\n  private AttachDetachListener[] mAttachDetachListeners = AttachDetachListener.EMPTY_ARRAY;\n  private NodeRegion[] mNodeRegions = NodeRegion.EMPTY_ARRAY;\n\n  // The index of the next native child to draw.  This is used in dispatchDraw to check that we are\n  // actually drawing all of our attached children, then is reset to 0.\n  private int mDrawChildIndex = 0;\n  private boolean mIsAttached = false;\n  private boolean mIsLayoutRequested = false;\n  private boolean mNeedsOffscreenAlphaCompositing = false;\n  private Drawable mHotspot;\n  private PointerEvents mPointerEvents = PointerEvents.AUTO;\n  private long mLastTouchDownTime;\n  private @Nullable OnInterceptTouchEventListener mOnInterceptTouchEventListener;\n\n  private static final SparseArray<View> EMPTY_DETACHED_VIEWS = new SparseArray<>(0);\n  // Provides clipping, drawing and node region finding logic if subview clipping is enabled.\n  private @Nullable DrawCommandManager mDrawCommandManager;\n\n  private @Nullable Rect mHitSlopRect;\n\n  /* package */ FlatViewGroup(Context context) {\n    super(context);\n    setClipChildren(false);\n  }\n\n  @Override\n  protected void detachAllViewsFromParent() {\n    super.detachAllViewsFromParent();\n  }\n\n  @Override\n  @SuppressLint(\"MissingSuperCall\")\n  public void requestLayout() {\n    if (mIsLayoutRequested) {\n      return;\n    }\n\n    mIsLayoutRequested = true;\n    LAYOUT_REQUESTS.add(this);\n  }\n\n  @Override\n  public int reactTagForTouch(float touchX, float touchY) {\n    /*\n     * Make sure we don't find any children if the pointer events are set to BOX_ONLY.\n     * There is no need to special-case any other modes, because if PointerEvents are set to:\n     * a) PointerEvents.AUTO - all children are included, nothing to exclude\n     * b) PointerEvents.NONE - this method will NOT be executed, because the View will be filtered\n     *    out by TouchTargetHelper.\n     * c) PointerEvents.BOX_NONE - TouchTargetHelper will make sure that {@link #reactTagForTouch()}\n     *     doesn't return getId().\n     */\n    SoftAssertions.assertCondition(\n        mPointerEvents != PointerEvents.NONE,\n        \"TouchTargetHelper should not allow calling this method when pointer events are NONE\");\n\n    if (mPointerEvents != PointerEvents.BOX_ONLY) {\n      NodeRegion nodeRegion = virtualNodeRegionWithinBounds(touchX, touchY);\n      if (nodeRegion != null) {\n        return nodeRegion.getReactTag(touchX, touchY);\n      }\n    }\n\n    // no children found\n    return getId();\n  }\n\n  @Override\n  public boolean interceptsTouchEvent(float touchX, float touchY) {\n    NodeRegion nodeRegion = anyNodeRegionWithinBounds(touchX, touchY);\n    return nodeRegion != null && nodeRegion.mIsVirtual;\n  }\n\n  /**\n   * Secretly Overrides the hidden ViewGroup.onDebugDraw method.  This is hidden in the Android\n   * ViewGroup, but still gets called in super.dispatchDraw.  Overriding here allows us to draw\n   * layout bounds for Nodes when android is drawing layout bounds.\n   */\n  protected void onDebugDraw(Canvas canvas) {\n    // Android is drawing layout bounds, so we should as well.\n    mAndroidDebugDraw = true;\n  }\n\n  /**\n   * Draw FlatViewGroup on a canvas.  Also checks that all children are drawn, as a draw view calls\n   * back to the FlatViewGroup to draw each child.\n   *\n   * @param canvas The canvas to draw on.\n   */\n  @Override\n  public void dispatchDraw(Canvas canvas) {\n    mAndroidDebugDraw = false;\n    super.dispatchDraw(canvas);\n\n    if (mDrawCommandManager != null) {\n      mDrawCommandManager.draw(canvas);\n    } else {\n      for (DrawCommand drawCommand : mDrawCommands) {\n        drawCommand.draw(this, canvas);\n      }\n    }\n\n    if (mDrawChildIndex != getChildCount()) {\n      throw new RuntimeException(\n          \"Did not draw all children: \" + mDrawChildIndex + \" / \" + getChildCount());\n    }\n    mDrawChildIndex = 0;\n\n    if (DEBUG_DRAW || mAndroidDebugDraw) {\n      initDebugDrawResources();\n      debugDraw(canvas);\n    }\n\n    if (mHotspot != null) {\n      mHotspot.draw(canvas);\n    }\n  }\n\n  /**\n   * Draws layout bounds for debug.  Optionally can draw the name of the DrawCommand so you can\n   * distinguish commands easier.\n   *\n   * @param canvas The canvas to draw on.\n   */\n  private void debugDraw(Canvas canvas) {\n    if (mDrawCommandManager != null) {\n      mDrawCommandManager.debugDraw(canvas);\n    } else {\n      for (DrawCommand drawCommand : mDrawCommands) {\n        drawCommand.debugDraw(this, canvas);\n      }\n    }\n    mDrawChildIndex = 0;\n  }\n\n  /**\n   * This override exists to suppress the default drawing behaviour of the ViewGroup.  dispatchDraw\n   * calls super.dispatchDraw, which lets Android perform some of our child management logic.\n   * super.dispatchDraw then calls our drawChild, which is suppressed.\n   *\n   * dispatchDraw within the FlatViewGroup then calls super.drawChild, which actually draws the\n   * child.\n   *\n   *   // Pseudocode example.\n   *   Class FlatViewGroup {\n   *     void dispatchDraw() {\n   *       super.dispatchDraw(); // Eventually calls our drawChild, which is a no op.\n   *       super.drawChild();    // Calls the actual drawChild.\n   *     }\n   *\n   *     boolean drawChild(...) {\n   *       // No op.\n   *     }\n   *   }\n   *\n   *   Class ViewGroup {\n   *     void dispatchDraw() {\n   *       drawChild(); // No op.\n   *     }\n   *\n   *     boolean drawChild(...) {\n   *       getChildAt(...).draw();\n   *     }\n   *   }\n   *\n   * @return false, as we are suppressing drawChild.\n   */\n  @Override\n  protected boolean drawChild(Canvas canvas, View child, long drawingTime) {\n    // suppress\n    // no drawing -> no invalidate -> return false\n    return false;\n  }\n\n  /**\n   * Draw layout bounds for the next child.\n   *\n   * @param canvas The canvas to draw on.\n   */\n  /* package */ void debugDrawNextChild(Canvas canvas) {\n    View child = getChildAt(mDrawChildIndex);\n    // Draw FlatViewGroups a different color than regular child views.\n    int color = child instanceof FlatViewGroup ? Color.DKGRAY : Color.RED;\n    debugDrawRect(\n        canvas,\n        color,\n        child.getLeft(),\n        child.getTop(),\n        child.getRight(),\n        child.getBottom());\n    ++mDrawChildIndex;\n  }\n\n  // Used in debug drawing.\n  /* package */ int dipsToPixels(int dips) {\n    float scale = getResources().getDisplayMetrics().density;\n    return (int) (dips * scale + 0.5f);\n  }\n\n  // Used in debug drawing.\n  private static void fillRect(Canvas canvas, Paint paint, float x1, float y1, float x2, float y2) {\n    if (x1 != x2 && y1 != y2) {\n      if (x1 > x2) {\n        float tmp = x1; x1 = x2; x2 = tmp;\n      }\n      if (y1 > y2) {\n        float tmp = y1; y1 = y2; y2 = tmp;\n      }\n      canvas.drawRect(x1, y1, x2, y2, paint);\n    }\n  }\n\n  // Used in debug drawing.\n  private static int sign(float x) {\n    return (x >= 0) ? 1 : -1;\n  }\n\n  // Used in debug drawing.\n  private static void drawCorner(\n      Canvas c,\n      Paint paint,\n      float x1,\n      float y1,\n      float dx,\n      float dy,\n      float lw) {\n    fillRect(c, paint, x1, y1, x1 + dx, y1 + lw * sign(dy));\n    fillRect(c, paint, x1, y1, x1 + lw * sign(dx), y1 + dy);\n  }\n\n  // Used in debug drawing.\n  private static void drawRectCorners(\n      Canvas canvas,\n      float x1,\n      float y1,\n      float x2,\n      float y2,\n      Paint paint,\n      int lineLength,\n      int lineWidth) {\n    drawCorner(canvas, paint, x1, y1, lineLength, lineLength, lineWidth);\n    drawCorner(canvas, paint, x1, y2, lineLength, -lineLength, lineWidth);\n    drawCorner(canvas, paint, x2, y1, -lineLength, lineLength, lineWidth);\n    drawCorner(canvas, paint, x2, y2, -lineLength, -lineLength, lineWidth);\n  }\n\n  /**\n   * Makes sure that we only initialize one instance of each of our layout bounds drawing\n   * resources.\n   */\n  private void initDebugDrawResources() {\n    if (sDebugTextPaint == null) {\n      sDebugTextPaint = new Paint();\n      sDebugTextPaint.setTextAlign(Paint.Align.RIGHT);\n      sDebugTextPaint.setTextSize(dipsToPixels(9));\n      sDebugTextPaint.setTypeface(Typeface.MONOSPACE);\n      sDebugTextPaint.setAntiAlias(true);\n      sDebugTextPaint.setColor(Color.RED);\n    }\n    if (sDebugTextBackgroundPaint == null) {\n      sDebugTextBackgroundPaint = new Paint();\n      sDebugTextBackgroundPaint.setColor(Color.WHITE);\n      sDebugTextBackgroundPaint.setAlpha(200);\n      sDebugTextBackgroundPaint.setStyle(Paint.Style.FILL);\n    }\n    if (sDebugRectPaint == null) {\n      sDebugRectPaint = new Paint();\n      sDebugRectPaint.setAlpha(100);\n      sDebugRectPaint.setStyle(Paint.Style.STROKE);\n    }\n    if (sDebugCornerPaint == null) {\n      sDebugCornerPaint = new Paint();\n      sDebugCornerPaint.setAlpha(200);\n      sDebugCornerPaint.setColor(Color.rgb(63, 127, 255));\n      sDebugCornerPaint.setStyle(Paint.Style.FILL);\n    }\n    if (sDebugRect == null) {\n      sDebugRect = new Rect();\n    }\n  }\n\n  /**\n   * Used in drawing layout bounds, draws a layout bounds rectangle similar to the Android default\n   * implementation, with a specifiable border color.\n   *\n   * @param canvas The canvas to draw on.\n   * @param color The border color of the layout bounds.\n   * @param left Left bound of the rectangle.\n   * @param top Top bound of the rectangle.\n   * @param right Right bound of the rectangle.\n   * @param bottom Bottom bound of the rectangle.\n   */\n  private void debugDrawRect(\n      Canvas canvas,\n      int color,\n      float left,\n      float top,\n      float right,\n      float bottom) {\n    debugDrawNamedRect(canvas, color, \"\", left, top, right, bottom);\n  }\n\n  /**\n   * Used in drawing layout bounds, draws a layout bounds rectangle similar to the Android default\n   * implementation, with a specifiable border color.  Also draws a name text in the bottom right\n   * corner of the rectangle if DEBUG_DRAW_TEXT is set.\n   *\n   * @param canvas The canvas to draw on.\n   * @param color The border color of the layout bounds.\n   * @param name Name to be drawn on top of the rectangle if DEBUG_DRAW_TEXT is set.\n   * @param left Left bound of the rectangle.\n   * @param top Top bound of the rectangle.\n   * @param right Right bound of the rectangle.\n   * @param bottom Bottom bound of the rectangle.\n   */\n  /* package */ void debugDrawNamedRect(\n      Canvas canvas,\n      int color,\n      String name,\n      float left,\n      float top,\n      float right,\n      float bottom) {\n    if (DEBUG_DRAW_TEXT && !name.isEmpty()) {\n      sDebugTextPaint.getTextBounds(name, 0, name.length(), sDebugRect);\n      int inset = dipsToPixels(2);\n      float textRight = right - inset - 1;\n      float textBottom = bottom - inset - 1;\n      canvas.drawRect(\n          textRight - sDebugRect.right - inset,\n          textBottom + sDebugRect.top - inset,\n          textRight + inset,\n          textBottom + inset,\n          sDebugTextBackgroundPaint);\n      canvas.drawText(name, textRight, textBottom, sDebugTextPaint);\n    }\n    // Retain the alpha component.\n    sDebugRectPaint.setColor((sDebugRectPaint.getColor() & 0xFF000000) | (color & 0x00FFFFFF));\n    sDebugRectPaint.setAlpha(100);\n    canvas.drawRect(\n        left,\n        top,\n        right - 1,\n        bottom - 1,\n        sDebugRectPaint);\n    drawRectCorners(\n        canvas,\n        left,\n        top,\n        right,\n        bottom,\n        sDebugCornerPaint,\n        dipsToPixels(8),\n        dipsToPixels(1));\n  }\n\n  @Override\n  protected void onLayout(boolean changed, int l, int t, int r, int b) {\n    // nothing to do here\n  }\n\n  @Override\n  @SuppressLint(\"MissingSuperCall\")\n  protected boolean verifyDrawable(Drawable who) {\n    return true;\n  }\n\n  @Override\n  protected void onAttachedToWindow() {\n    if (mIsAttached) {\n      // This is possible, unfortunately.\n      return;\n    }\n\n    mIsAttached = true;\n\n    super.onAttachedToWindow();\n    dispatchOnAttached(mAttachDetachListeners);\n\n    // This is a no op if we aren't clipping, so let updateClippingRect handle the check for us.\n    updateClippingRect();\n  }\n\n  @Override\n  protected void onDetachedFromWindow() {\n    if (!mIsAttached) {\n      throw new RuntimeException(\"Double detach\");\n    }\n\n    mIsAttached = false;\n\n    super.onDetachedFromWindow();\n    dispatchOnDetached(mAttachDetachListeners);\n  }\n\n  @Override\n  protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n    if (mHotspot != null) {\n      mHotspot.setBounds(0, 0, w, h);\n      invalidate();\n    }\n\n    // This is a no op if we aren't clipping, so let updateClippingRect handle the check for us.\n    updateClippingRect();\n  }\n\n  @Override\n  public void dispatchDrawableHotspotChanged(float x, float y) {\n    if (mHotspot != null) {\n      mHotspot.setHotspot(x, y);\n      invalidate();\n    }\n  }\n\n  @Override\n  protected void drawableStateChanged() {\n    super.drawableStateChanged();\n\n    if (mHotspot != null && mHotspot.isStateful()) {\n        mHotspot.setState(getDrawableState());\n    }\n  }\n\n  @Override\n  public void jumpDrawablesToCurrentState() {\n    super.jumpDrawablesToCurrentState();\n    if (mHotspot != null) {\n        mHotspot.jumpToCurrentState();\n    }\n  }\n\n  @Override\n  public void invalidate() {\n    // By default, invalidate() only invalidates the View's boundaries, which works great in most\n    // cases but may fail with overflow: visible (i.e. View clipping disabled) when View width or\n    // height is 0. This is because invalidate() has an optimization where it will not invalidate\n    // empty Views at all. A quick fix is to invalidate a slightly larger region to make sure we\n    // never hit that optimization.\n    //\n    // Another thing to note is that this may not work correctly with software rendering because\n    // in software, Android tracks dirty regions to redraw. We would need to collect information\n    // about all children boundaries (recursively) to track dirty region precisely.\n    invalidate(0, 0, getWidth() + 1, getHeight() + 1);\n  }\n\n  /**\n   * We override this to allow developers to determine whether they need offscreen alpha compositing\n   * or not. See the documentation of needsOffscreenAlphaCompositing in View.js.\n   */\n  @Override\n  public boolean hasOverlappingRendering() {\n    return mNeedsOffscreenAlphaCompositing;\n  }\n\n  @Override\n  public void setOnInterceptTouchEventListener(OnInterceptTouchEventListener listener) {\n    mOnInterceptTouchEventListener = listener;\n  }\n\n  @Override\n  public boolean onInterceptTouchEvent(MotionEvent ev) {\n    final long downTime = ev.getDownTime();\n    if (downTime != mLastTouchDownTime) {\n      mLastTouchDownTime = downTime;\n      if (interceptsTouchEvent(ev.getX(), ev.getY())) {\n        return true;\n      }\n    }\n\n    if (mOnInterceptTouchEventListener != null &&\n        mOnInterceptTouchEventListener.onInterceptTouchEvent(this, ev)) {\n      return true;\n    }\n    // We intercept the touch event if the children are not supposed to receive it.\n    if (mPointerEvents == PointerEvents.NONE || mPointerEvents == PointerEvents.BOX_ONLY) {\n      return true;\n    }\n    return super.onInterceptTouchEvent(ev);\n  }\n\n  @Override\n  public boolean onTouchEvent(MotionEvent ev) {\n    // We do not accept the touch event if this view is not supposed to receive it.\n    if (mPointerEvents == PointerEvents.NONE) {\n      return false;\n    }\n\n    if (mPointerEvents == PointerEvents.BOX_NONE) {\n      // We cannot always return false here because some child nodes could be flatten into this View\n      NodeRegion nodeRegion = virtualNodeRegionWithinBounds(ev.getX(), ev.getY());\n      if (nodeRegion == null) {\n        // no child to handle this touch event, bailing out.\n        return false;\n      }\n    }\n\n    // The root view always assumes any view that was tapped wants the touch\n    // and sends the event to JS as such.\n    // We don't need to do bubbling in native (it's already happening in JS).\n    // For an explanation of bubbling and capturing, see\n    // http://javascript.info/tutorial/bubbling-and-capturing#capturing\n    return true;\n  }\n\n  @Override\n  public PointerEvents getPointerEvents() {\n    return mPointerEvents;\n  }\n\n  /*package*/ void setPointerEvents(PointerEvents pointerEvents) {\n    mPointerEvents = pointerEvents;\n  }\n\n  /**\n   * See the documentation of needsOffscreenAlphaCompositing in View.js.\n   */\n  /* package */ void setNeedsOffscreenAlphaCompositing(boolean needsOffscreenAlphaCompositing) {\n    mNeedsOffscreenAlphaCompositing = needsOffscreenAlphaCompositing;\n  }\n\n  /* package */ void setHotspot(Drawable hotspot) {\n    if (mHotspot != null) {\n      mHotspot.setCallback(null);\n      unscheduleDrawable(mHotspot);\n    }\n\n    if (hotspot != null) {\n      hotspot.setCallback(this);\n      if (hotspot.isStateful()) {\n        hotspot.setState(getDrawableState());\n      }\n    }\n\n    mHotspot = hotspot;\n    invalidate();\n  }\n\n  /**\n   * Draws the next child of the FlatViewGroup.  Each draw view calls FlatViewGroup.drawNextChild,\n   * which keeps track of the current child index to draw.\n   *\n   * @param canvas The canvas to draw on.\n   */\n  /* package */ void drawNextChild(Canvas canvas) {\n    View child = getChildAt(mDrawChildIndex);\n    if (child instanceof FlatViewGroup) {\n      super.drawChild(canvas, child, getDrawingTime());\n    } else {\n      // Make sure non-React Views clip properly.\n      canvas.save(Canvas.CLIP_SAVE_FLAG);\n      child.getHitRect(VIEW_BOUNDS);\n      canvas.clipRect(VIEW_BOUNDS);\n      super.drawChild(canvas, child, getDrawingTime());\n      canvas.restore();\n    }\n\n    ++mDrawChildIndex;\n  }\n\n  /**\n   * Mount a list of draw commands to this FlatViewGroup.  Draw commands sometimes map to a view,\n   * as in the case of {@link DrawView}, and sometimes to a simple canvas operation.  We only\n   * receive a call to mount draw commands when our commands have changed, so we always invalidate.\n   *\n   * A call to mount draw commands will only be followed by a call to mount views if the draw view\n   * commands within the draw command array have changed since last mount.\n   *\n   * @param drawCommands The draw commands to mount.\n   */\n  /* package */ void mountDrawCommands(DrawCommand[] drawCommands) {\n    mDrawCommands = drawCommands;\n    invalidate();\n  }\n\n  /**\n   * Mount a list of draw commands to this FlatViewGroup, which is clipping subviews.  Clipping\n   * logic is handled by a {@link DrawCommandManager}, which provides a better explanation of\n   * these arguments and logic.\n   *\n   * A call to mount draw commands will only be followed by a call to mount views if the draw view\n   * commands within the draw command array have changed since last mount, which is indicated here\n   * by willMountViews.\n   *\n   * @param drawCommands The draw commands to mount.\n   * @param drawViewIndexMap See {@link DrawCommandManager}.\n   * @param maxBottom See {@link DrawCommandManager}.\n   * @param minTop See {@link DrawCommandManager}.\n   * @param willMountViews True if we will also receive a mountViews call.  If we are going to\n   *   receive a call to mount views, that will take care of updating the commands that are\n   *   currently onscreen, otherwise we need to update the onscreen commands.\n   */\n  /* package */ void mountClippingDrawCommands(\n      DrawCommand[] drawCommands,\n      SparseIntArray drawViewIndexMap,\n      float[] maxBottom,\n      float[] minTop,\n      boolean willMountViews) {\n    Assertions.assertNotNull(mDrawCommandManager).mountDrawCommands(\n        drawCommands,\n        drawViewIndexMap,\n        maxBottom,\n        minTop,\n        willMountViews);\n    invalidate();\n  }\n\n  /**\n   * Handle a subview being dropped\n   * In most cases, we are informed about a subview being dropped via mountViews, but in some\n   * cases (such as when both the child and parent get explicit removes in the same frame),\n   * we may not find out, so this is called when the child is dropped so the parent can clean up\n   * strong references to the child.\n   *\n   * @param view the view being dropped\n   */\n  void onViewDropped(View view) {\n    if (mDrawCommandManager != null) {\n      // for now, we only care about clearing clipped subview references\n      mDrawCommandManager.onClippedViewDropped(view);\n    }\n  }\n\n  /**\n   * Return the NodeRegion which matches a reactTag, or EMPTY if none match.\n   *\n   * @param reactTag The reactTag to look for\n   * @return The matching NodeRegion, or NodeRegion.EMPTY if none match.\n   */\n  /* package */ NodeRegion getNodeRegionForTag(int reactTag) {\n    for (NodeRegion region : mNodeRegions) {\n      if (region.matchesTag(reactTag)) {\n        return region;\n      }\n    }\n    return NodeRegion.EMPTY;\n  }\n\n  /**\n   * Return a list of FlatViewGroups that are detached (due to being clipped) but that we have a\n   * strong reference to. This is used by the FlatNativeViewHierarchyManager to explicitly clean up\n   * those views when removing this parent.\n   *\n   * @return A Collection of Views to clean up.\n   */\n  /* package */ SparseArray<View> getDetachedViews() {\n    if (mDrawCommandManager == null) {\n      return EMPTY_DETACHED_VIEWS;\n    }\n    return mDrawCommandManager.getDetachedViews();\n  }\n\n  /**\n   * Remove the detached view from the parent\n   * This is used in the DrawCommandManagers and during cleanup to trigger onDetachedFromWindow on\n   * any views that were in a temporary detached state due to them being clipped. This is called\n   * for cleanup of said views by FlatNativeViewHierarchyManager.\n   *\n   * @param view the detached View to remove\n   */\n  void removeDetachedView(View view) {\n    removeDetachedView(view, false);\n  }\n\n  @Override\n  public void removeAllViewsInLayout() {\n    // whenever we want to remove all views in a layout, we also want to remove all the\n    // DrawCommands, otherwise, we can have a mismatch between the DrawView DrawCommands\n    // and the Views to draw (note that because removeAllViewsInLayout doesn't call invalidate,\n    // we don't actually need to modify mDrawCommands, but we do it just in case).\n    mDrawCommands = DrawCommand.EMPTY_ARRAY;\n    super.removeAllViewsInLayout();\n  }\n\n  /**\n   * Mounts attach detach listeners to a FlatViewGroup.  The Nodes spec states that children and\n   * commands deal gracefully with multiple attaches and detaches, and as long as:\n   *\n   *   attachCount - detachCount > 0\n   *\n   * Then children still consider themselves as attached.\n   *\n   * @param listeners The listeners to mount.\n   */\n  /* package */ void mountAttachDetachListeners(AttachDetachListener[] listeners) {\n    if (mIsAttached) {\n      // Ordering of the following 2 statements is very important. While logically it makes sense to\n      // detach old listeners first, and only then attach new listeners, this is not very efficient,\n      // because a listener can be in both lists. In this case, it will be detached first and then\n      // re-attached immediately. This is undesirable for a couple of reasons:\n      // 1) performance. Detaching is slow because it may cancel an ongoing network request\n      // 2) it may cause flicker: an image that was already loaded may get unloaded.\n      //\n      // For this reason, we are attaching new listeners first. What this means is that listeners\n      // that are in both lists need to gracefully handle a secondary attach and detach events,\n      // (i.e. onAttach() being called when already attached, followed by a detach that should be\n      // ignored) turning them into no-ops. This will result in no performance loss and no flicker,\n      // because ongoing network requests don't get cancelled.\n      dispatchOnAttached(listeners);\n      dispatchOnDetached(mAttachDetachListeners);\n    }\n    mAttachDetachListeners = listeners;\n  }\n\n  /**\n   * Mount node regions to a FlatViewGroup.  A node region is a touch target for a react tag.  As\n   * not all react tags map to a view, we use node regions to determine whether a non-native region\n   * should receive a touch.\n   *\n   * @param nodeRegions The node regions to mount.\n   */\n  /* package */ void mountNodeRegions(NodeRegion[] nodeRegions) {\n    mNodeRegions = nodeRegions;\n  }\n\n  /**\n   * Mount node regions in clipping.  See {@link DrawCommandManager} for more complete\n   * documentation.\n   *\n   * @param nodeRegions The node regions to mount.\n   * @param maxBottom See {@link DrawCommandManager}.\n   * @param minTop See {@link DrawCommandManager}.\n   */\n  /* package */ void mountClippingNodeRegions(\n      NodeRegion[] nodeRegions,\n      float[] maxBottom,\n      float[] minTop) {\n    mNodeRegions = nodeRegions;\n    Assertions.assertNotNull(mDrawCommandManager).mountNodeRegions(nodeRegions, maxBottom, minTop);\n  }\n\n  /**\n   * Mount a list of views to add, and dismount a list of views to detach.  Ids will not appear in\n   * both lists, aka:\n   *   Set(viewsToAdd + viewsToDetach).size() == viewsToAdd.length + viewsToDetach.length\n   *\n   * Every time we get any change in the views in a FlatViewGroup, we detach all views first, then\n   * reattach / remove them as needed.  viewsToAdd is odd in that the ids also specify whether\n   * the view is new to us, or if we were already the parent.  If it is new to us, then the id has\n   * a positive value, otherwise we are already the parent, but it was previously detached, since\n   * we detach everything when anything changes.\n   *\n   * The reason we detach everything is that a single detach is on the order of O(n), as in the\n   * average case we have to move half of the views one position to the right, and a single add is\n   * the same.  Removing all views is also on the order of O(n), as you delete everything backward\n   * from the end, while adding a new set of views is also on the order of O(n), as you just add\n   * them all back in order.  ArrayLists are weird.\n   *\n   * @param viewResolver Resolves the views from their id.\n   * @param viewsToAdd id of views to add if they weren't just attached to us, or -id if they are\n   *     just being reattached.\n   * @param viewsToDetach id of views that we don't own anymore.  They either moved to a new parent,\n   *     or are being removed entirely.\n   */\n  /* package */ void mountViews(ViewResolver viewResolver, int[] viewsToAdd, int[] viewsToDetach) {\n    if (mDrawCommandManager != null) {\n      mDrawCommandManager.mountViews(viewResolver, viewsToAdd, viewsToDetach);\n    } else {\n      for (int viewToAdd : viewsToAdd) {\n        if (viewToAdd > 0) {\n          View view = viewResolver.getView(viewToAdd);\n          ensureViewHasNoParent(view);\n          addViewInLayout(view);\n        } else {\n          View view = viewResolver.getView(-viewToAdd);\n          ensureViewHasNoParent(view);\n          // We aren't clipping, so attach all the things, clipping is handled by the draw command\n          // manager, if we have one.\n          attachViewToParent(view);\n        }\n      }\n\n      for (int viewToDetach : viewsToDetach) {\n        View view = viewResolver.getView(viewToDetach);\n        if (view.getParent() != null) {\n          throw new RuntimeException(\"Trying to remove view not owned by FlatViewGroup\");\n        } else {\n          removeDetachedView(view, false);\n        }\n      }\n    }\n\n    invalidate();\n  }\n\n  /**\n   * Exposes the protected addViewInLayout call for the {@link DrawCommandManager}.\n   *\n   * @param view The view to add.\n   */\n  /* package */ void addViewInLayout(View view) {\n    addViewInLayout(view, -1, ensureLayoutParams(view.getLayoutParams()), true);\n  }\n\n  /**\n   * Exposes the protected addViewInLayout call for the {@link DrawCommandManager}.\n   *\n   * @param view The view to add.\n   * @param index The index position at which to add this child.\n   */\n  /* package */ void addViewInLayout(View view, int index) {\n    addViewInLayout(view, index, ensureLayoutParams(view.getLayoutParams()), true);\n  }\n\n  /**\n   * Exposes the protected attachViewToParent call for the {@link DrawCommandManager}.\n   *\n   * @param view The view to attach.\n   */\n  /* package */ void attachViewToParent(View view) {\n    attachViewToParent(view, -1, ensureLayoutParams(view.getLayoutParams()));\n  }\n\n  /**\n   * Exposes the protected attachViewToParent call for the {@link DrawCommandManager}.\n   *\n   * @param view The view to attach.\n   * @param index The index position at which to attach this child.\n   */\n  /* package */ void attachViewToParent(View view, int index) {\n    attachViewToParent(view, index, ensureLayoutParams(view.getLayoutParams()));\n  }\n\n  private void processLayoutRequest() {\n    mIsLayoutRequested = false;\n    for (int i = 0, childCount = getChildCount(); i != childCount; ++i) {\n      View child = getChildAt(i);\n      if (!child.isLayoutRequested()) {\n        continue;\n      }\n\n      child.measure(\n        MeasureSpec.makeMeasureSpec(child.getWidth(), MeasureSpec.EXACTLY),\n        MeasureSpec.makeMeasureSpec(child.getHeight(), MeasureSpec.EXACTLY));\n      child.layout(child.getLeft(), child.getTop(), child.getRight(), child.getBottom());\n    }\n  }\n\n  /**\n   * Called after the view hierarchy is updated in {@link StateBuilder}, to process all the\n   * FlatViewGroups that have requested layout.\n   */\n  /* package */ static void processLayoutRequests() {\n    for (int i = 0, numLayoutRequests = LAYOUT_REQUESTS.size(); i != numLayoutRequests; ++i) {\n      FlatViewGroup flatViewGroup = LAYOUT_REQUESTS.get(i);\n      flatViewGroup.processLayoutRequest();\n    }\n    LAYOUT_REQUESTS.clear();\n  }\n\n  // Helper method for measure functionality provided by MeasuredViewGroup.\n  @Override\n  public Rect measureWithCommands() {\n    int childCount = getChildCount();\n    if (childCount == 0 && mDrawCommands.length == 0) {\n      return new Rect(0, 0, 0, 0);\n    }\n    int left = Integer.MAX_VALUE;\n    int top = Integer.MAX_VALUE;\n    int right = Integer.MIN_VALUE;\n    int bottom = Integer.MIN_VALUE;\n    for (int i = 0; i < childCount; i++) {\n      // This is technically a dupe, since the DrawView has its bounds, but leaving in to handle if\n      // the View is animating or rebelling against the DrawView bounds for some reason.\n      View child = getChildAt(i);\n      left = Math.min(left, child.getLeft());\n      top = Math.min(top, child.getTop());\n      right = Math.max(right, child.getRight());\n      bottom = Math.max(bottom, child.getBottom());\n    }\n\n    for (DrawCommand mDrawCommand : mDrawCommands) {\n      if (!(mDrawCommand instanceof AbstractDrawCommand)) {\n        continue;\n      }\n      AbstractDrawCommand drawCommand = (AbstractDrawCommand) mDrawCommand;\n      left = Math.min(left, Math.round(drawCommand.getLeft()));\n      top = Math.min(top, Math.round(drawCommand.getTop()));\n      right = Math.max(right, Math.round(drawCommand.getRight()));\n      bottom = Math.max(bottom, Math.round(drawCommand.getBottom()));\n    }\n    return new Rect(left, top, right, bottom);\n  }\n\n  /**\n   * Searches for a virtual node region matching the specified x and y touch.  Virtual in this case\n   * means simply that the node region represents a command, rather than a native view.\n   *\n   * @param touchX The touch x coordinate.\n   * @param touchY The touch y coordinate.\n   * @return A virtual node region matching the specified touch, or null if no regions match.\n   */\n  private @Nullable NodeRegion virtualNodeRegionWithinBounds(float touchX, float touchY) {\n    if (mDrawCommandManager != null) {\n      return mDrawCommandManager.virtualNodeRegionWithinBounds(touchX, touchY);\n    }\n    for (int i = mNodeRegions.length - 1; i >= 0; --i) {\n      NodeRegion nodeRegion = mNodeRegions[i];\n      if (!nodeRegion.mIsVirtual) {\n        // only interested in virtual nodes\n        continue;\n      }\n      if (nodeRegion.withinBounds(touchX, touchY)) {\n        return nodeRegion;\n      }\n    }\n\n    return null;\n  }\n\n  /**\n   * Searches for a node region matching the specified x and y touch.  Will search regions which\n   * representing both commands and native views.\n   *\n   * @param touchX The touch x coordinate.\n   * @param touchY The touch y coordinate.\n   * @return A node region matching the specified touch, or null if no regions match.\n   */\n  private @Nullable NodeRegion anyNodeRegionWithinBounds(float touchX, float touchY) {\n    if (mDrawCommandManager != null) {\n      return mDrawCommandManager.anyNodeRegionWithinBounds(touchX, touchY);\n    }\n    for (int i = mNodeRegions.length - 1; i >= 0; --i) {\n      NodeRegion nodeRegion = mNodeRegions[i];\n      if (nodeRegion.withinBounds(touchX, touchY)) {\n        return nodeRegion;\n      }\n    }\n\n    return null;\n  }\n\n  private static void ensureViewHasNoParent(View view) {\n    ViewParent oldParent = view.getParent();\n    if (oldParent != null) {\n      throw new RuntimeException(\n          \"Cannot add view \" + view + \" to FlatViewGroup while it has a parent \" + oldParent);\n    }\n  }\n\n  /**\n   * Propagate attach to a list of listeners, passing a callback by which they can invalidate.\n   *\n   * @param listeners List of listeners to attach.\n   */\n  private void dispatchOnAttached(AttachDetachListener[] listeners) {\n    int numListeners = listeners.length;\n    if (numListeners == 0) {\n      return;\n    }\n\n    InvalidateCallback callback = getInvalidateCallback();\n    for (AttachDetachListener listener : listeners) {\n      listener.onAttached(callback);\n    }\n  }\n\n  /**\n   * Get an invalidate callback singleton for this view instance.\n   *\n   * @return Invalidate callback singleton.\n   */\n  private InvalidateCallback getInvalidateCallback() {\n    if (mInvalidateCallback == null) {\n      mInvalidateCallback = new InvalidateCallback(this);\n    }\n    return mInvalidateCallback;\n  }\n\n  /**\n   * Propagate detach to a list of listeners.\n   *\n   * @param listeners List of listeners to detach.\n   */\n  private static void dispatchOnDetached(AttachDetachListener[] listeners) {\n    for (AttachDetachListener listener : listeners) {\n      listener.onDetached();\n    }\n  }\n\n  private ViewGroup.LayoutParams ensureLayoutParams(ViewGroup.LayoutParams lp) {\n    if (checkLayoutParams(lp)) {\n      return lp;\n    }\n    return generateDefaultLayoutParams();\n  }\n\n  @Override\n  public void updateClippingRect() {\n    if (mDrawCommandManager == null) {\n      // Don't update the clipping rect if we aren't clipping.\n      return;\n    }\n    if (mDrawCommandManager.updateClippingRect()) {\n      // Manager says something changed.\n      invalidate();\n    }\n  }\n\n  @Override\n  public void getClippingRect(Rect outClippingRect) {\n    if (mDrawCommandManager == null) {\n      // We could call outClippingRect.set(null) here, but throw in case the underlying React Native\n      // behaviour changes without us knowing.\n      throw new RuntimeException(\n          \"Trying to get the clipping rect for a non-clipping FlatViewGroup\");\n    }\n     mDrawCommandManager.getClippingRect(outClippingRect);\n  }\n\n  @Override\n  public void setRemoveClippedSubviews(boolean removeClippedSubviews) {\n    boolean currentlyClipping = getRemoveClippedSubviews();\n    if (removeClippedSubviews == currentlyClipping) {\n      // We aren't changing state, so don't do anything.\n      return;\n    }\n    if (currentlyClipping) {\n      // Trying to go from a clipping to a non-clipping state, not currently supported by Nodes.\n      // If this is an issue, let us know, but currently there does not seem to be a good case for\n      // supporting this.\n      throw new RuntimeException(\n          \"Trying to transition FlatViewGroup from clipping to non-clipping state\");\n    }\n    mDrawCommandManager = DrawCommandManager.getVerticalClippingInstance(this, mDrawCommands);\n    mDrawCommands = DrawCommand.EMPTY_ARRAY;\n    // We don't need an invalidate here because this can't cause new views to come onscreen, since\n    // everything was unclipped.\n  }\n\n  @Override\n  public boolean getRemoveClippedSubviews() {\n    return mDrawCommandManager != null;\n  }\n\n  @Override\n  public @Nullable Rect getHitSlopRect() {\n    return mHitSlopRect;\n  }\n\n  /* package */ void setHitSlopRect(@Nullable Rect rect) {\n    mHitSlopRect = rect;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FlatViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewGroupManager;\n\nabstract class FlatViewManager extends ViewGroupManager<FlatViewGroup> {\n\n  @Override\n  protected FlatViewGroup createViewInstance(ThemedReactContext reactContext) {\n    return new FlatViewGroup(reactContext);\n  }\n\n  @Override\n  public void setBackgroundColor(FlatViewGroup view, int backgroundColor) {\n    // suppress\n  }\n\n  @Override\n  public void removeAllViews(FlatViewGroup parent) {\n    parent.removeAllViewsInLayout();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/FontStylingSpan.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Color;\nimport android.graphics.Typeface;\nimport android.text.TextPaint;\nimport android.text.style.MetricAffectingSpan;\n\n/* package */ final class FontStylingSpan extends MetricAffectingSpan {\n\n  /* package */ static final FontStylingSpan INSTANCE = new FontStylingSpan(\n      Color.BLACK /* mTextColor */,\n      0 /* mBackgroundColor */,\n      -1 /* mFontSize */,\n      -1 /* mFontStyle */,\n      -1 /* mFontWeight */,\n      false /* mHasUnderline */,\n      false /* mHasStrikeThrough */,\n      null /* mFontFamily */,\n      true /* mFrozen */);\n\n  // text property\n  private double mTextColor;\n  private int mBackgroundColor;\n  private boolean mHasUnderline;\n  private boolean mHasStrikeThrough;\n\n  // font properties\n  private int mFontSize;\n  private int mFontStyle;\n  private int mFontWeight;\n  private @Nullable String mFontFamily;\n\n  // whether or not mutation is allowed.\n  private boolean mFrozen;\n\n  FontStylingSpan() {\n  }\n\n  private FontStylingSpan(\n      double textColor,\n      int backgroundColor,\n      int fontSize,\n      int fontStyle,\n      int fontWeight,\n      boolean hasUnderline,\n      boolean hasStrikeThrough,\n      @Nullable String fontFamily,\n      boolean frozen) {\n    mTextColor = textColor;\n    mBackgroundColor = backgroundColor;\n    mFontSize = fontSize;\n    mFontStyle = fontStyle;\n    mFontWeight = fontWeight;\n    mHasUnderline = hasUnderline;\n    mHasStrikeThrough = hasStrikeThrough;\n    mFontFamily = fontFamily;\n    mFrozen = frozen;\n  }\n\n  /* package */ FontStylingSpan mutableCopy() {\n    return new FontStylingSpan(\n        mTextColor,\n        mBackgroundColor,\n        mFontSize,\n        mFontStyle,\n        mFontWeight,\n        mHasUnderline,\n        mHasStrikeThrough,\n        mFontFamily,\n        false);\n  }\n\n  /* package */ boolean isFrozen() {\n    return mFrozen;\n  }\n\n  /* package */ void freeze() {\n    mFrozen = true;\n  }\n\n  /* package */ double getTextColor() {\n    return mTextColor;\n  }\n\n  /* package */ void setTextColor(double textColor) {\n    mTextColor = textColor;\n  }\n\n  /* package */ int getBackgroundColor() {\n    return mBackgroundColor;\n  }\n\n  /* package */ void setBackgroundColor(int backgroundColor) {\n    mBackgroundColor = backgroundColor;\n  }\n\n  /* package */ int getFontSize() {\n    return mFontSize;\n  }\n\n  /* package */ void setFontSize(int fontSize) {\n    mFontSize = fontSize;\n  }\n\n  /* package */ int getFontStyle() {\n    return mFontStyle;\n  }\n\n  /* package */ void setFontStyle(int fontStyle) {\n    mFontStyle = fontStyle;\n  }\n\n  /* package */ int getFontWeight() {\n    return mFontWeight;\n  }\n\n  /* package */ void setFontWeight(int fontWeight) {\n    mFontWeight = fontWeight;\n  }\n\n  /* package */ @Nullable String getFontFamily() {\n    return mFontFamily;\n  }\n\n  /* package */ void setFontFamily(@Nullable String fontFamily) {\n    mFontFamily = fontFamily;\n  }\n\n  /* package */ boolean hasUnderline() {\n    return mHasUnderline;\n  }\n\n  /* package */ void setHasUnderline(boolean hasUnderline) {\n    mHasUnderline = hasUnderline;\n  }\n\n  /* package */ boolean hasStrikeThrough() {\n    return mHasStrikeThrough;\n  }\n\n  /* package */ void setHasStrikeThrough(boolean hasStrikeThrough) {\n    mHasStrikeThrough = hasStrikeThrough;\n  }\n\n  @Override\n  public void updateDrawState(TextPaint ds) {\n    if (!Double.isNaN(mTextColor)) {\n      ds.setColor((int) mTextColor);\n    }\n\n    ds.bgColor = mBackgroundColor;\n    ds.setUnderlineText(mHasUnderline);\n    ds.setStrikeThruText(mHasStrikeThrough);\n    updateMeasureState(ds);\n  }\n\n  @Override\n  public void updateMeasureState(TextPaint ds) {\n    if (mFontSize != -1) {\n      ds.setTextSize(mFontSize);\n    }\n\n    updateTypeface(ds);\n  }\n\n  private int getNewStyle(int oldStyle) {\n    int newStyle = oldStyle;\n    if (mFontStyle != -1) {\n      newStyle = (newStyle & ~Typeface.ITALIC) | mFontStyle;\n    }\n\n    if (mFontWeight != -1) {\n      newStyle = (newStyle & ~Typeface.BOLD) | mFontWeight;\n    }\n\n    return newStyle;\n  }\n\n  private void updateTypeface(TextPaint ds) {\n    Typeface typeface = ds.getTypeface();\n\n    int oldStyle = (typeface == null) ? 0 : typeface.getStyle();\n    int newStyle = getNewStyle(oldStyle);\n\n    if (oldStyle == newStyle && mFontFamily == null) {\n      // nothing to do\n      return;\n    }\n\n    if (mFontFamily != null) {\n      typeface = TypefaceCache.getTypeface(mFontFamily, newStyle);\n    } else {\n      typeface = TypefaceCache.getTypeface(typeface, newStyle);\n    }\n\n    ds.setTypeface(typeface);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/HitSlopNodeRegion.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.graphics.Rect;\n\n/**\n * NodeRegion that has a hit slop.\n */\n/* package */ final class HitSlopNodeRegion extends NodeRegion {\n\n  private final Rect mHitSlop;\n\n  HitSlopNodeRegion(\n      Rect hitSlop,\n      float left,\n      float top,\n      float right,\n      float bottom,\n      int tag,\n      boolean isVirtual) {\n    super(left, top, right, bottom, tag, isVirtual);\n    mHitSlop = hitSlop;\n  }\n\n  @Override\n  /* package */ float getTouchableLeft() {\n    return getLeft() - mHitSlop.left;\n  }\n\n  @Override\n  /* package */ float getTouchableTop() {\n    return getTop() - mHitSlop.top;\n  }\n\n  @Override\n  /* package */ float getTouchableRight() {\n    return getRight() + mHitSlop.right;\n  }\n\n  @Override\n  /* package */ float getTouchableBottom() {\n    return getBottom() + mHitSlop.bottom;\n  }\n\n  @Override\n  /* package */ boolean withinBounds(float touchX, float touchY) {\n    return getTouchableLeft() <= touchX && touchX < getTouchableRight() &&\n        getTouchableTop() <= touchY && touchY < getTouchableBottom();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/HorizontalDrawCommandManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport java.util.Arrays;\n\nimport android.util.SparseIntArray;\n\n/**\n * {@link DrawCommandManager} with horizontal clipping (The view scrolls left and right).\n */\n/* package */ final class HorizontalDrawCommandManager extends ClippingDrawCommandManager {\n\n  /* package */ HorizontalDrawCommandManager(\n      FlatViewGroup flatViewGroup,\n      DrawCommand[] drawCommands) {\n    super(flatViewGroup, drawCommands);\n  }\n\n  @Override\n  int commandStartIndex() {\n    int start = Arrays.binarySearch(mCommandMaxBottom, mClippingRect.left);\n    // We don't care whether we matched or not, but positive indices are helpful. The binary search\n    // returns ~index in the case that it isn't a match, so reverse that here.\n    return start < 0 ? ~start : start;\n  }\n\n  @Override\n  int commandStopIndex(int start) {\n    int stop = Arrays.binarySearch(\n        mCommandMinTop,\n        start,\n        mCommandMinTop.length,\n        mClippingRect.right);\n    // We don't care whether we matched or not, but positive indices are helpful. The binary search\n    // returns ~index in the case that it isn't a match, so reverse that here.\n    return stop < 0 ? ~stop : stop;\n  }\n\n  @Override\n  int regionStopIndex(float touchX, float touchY) {\n    int stop = Arrays.binarySearch(mRegionMinTop, touchX + 0.0001f);\n    // We don't care whether we matched or not, but positive indices are helpful. The binary search\n    // returns ~index in the case that it isn't a match, so reverse that here.\n    return stop < 0 ? ~stop : stop;\n  }\n\n  @Override\n  boolean regionAboveTouch(int index, float touchX, float touchY) {\n    return mRegionMaxBottom[index] < touchX;\n  }\n\n  /**\n   * Populates the max and min arrays for a given set of node regions.\n   *\n   * This should never be called from the UI thread, as the reason it exists is to do work off the\n   * UI thread.\n   *\n   * @param regions The regions that will eventually be mounted.\n   * @param maxRight  At each index i, the maximum right value of all regions at or below i.\n   * @param minLeft  At each index i, the minimum left value of all regions at or below i.\n   */\n  public static void fillMaxMinArrays(NodeRegion[] regions, float[] maxRight, float[] minLeft) {\n    float last = 0;\n    for (int i = 0; i < regions.length; i++) {\n      last = Math.max(last, regions[i].getTouchableRight());\n      maxRight[i] = last;\n    }\n    for (int i = regions.length - 1; i >= 0; i--) {\n      last = Math.min(last, regions[i].getTouchableLeft());\n      minLeft[i] = last;\n    }\n  }\n\n  /**\n   * Populates the max and min arrays for a given set of draw commands.  Also populates a mapping of\n   * react tags to their index position in the command array.\n   *\n   * This should never be called from the UI thread, as the reason it exists is to do work off the\n   * UI thread.\n   *\n   * @param commands The draw commands that will eventually be mounted.\n   * @param maxRight At each index i, the maximum right value of all draw commands at or below i.\n   * @param minLeft At each index i, the minimum left value of all draw commands at or below i.\n   * @param drawViewIndexMap Mapping of ids to index position within the draw command array.\n   */\n  public static void fillMaxMinArrays(\n      DrawCommand[] commands,\n      float[] maxRight,\n      float[] minLeft,\n      SparseIntArray drawViewIndexMap) {\n    float last = 0;\n    // Loop through the DrawCommands, keeping track of the maximum we've seen if we only iterated\n    // through items up to this position.\n    for (int i = 0; i < commands.length; i++) {\n      if (commands[i] instanceof DrawView) {\n        DrawView drawView = (DrawView) commands[i];\n        // These will generally be roughly sorted by id, so try to insert at the end if possible.\n        drawViewIndexMap.append(drawView.reactTag, i);\n        last = Math.max(last, drawView.mLogicalRight);\n      } else {\n        last = Math.max(last, commands[i].getRight());\n      }\n      maxRight[i] = last;\n    }\n    // Intentionally leave last as it was, since it's at the maximum bottom position we've seen so\n    // far, we can use it again.\n\n    // Loop through backwards, keeping track of the minimum we've seen at this position.\n    for (int i = commands.length - 1; i >= 0; i--) {\n      if (commands[i] instanceof DrawView) {\n        last = Math.min(last, ((DrawView) commands[i]).mLogicalLeft);\n      } else {\n        last = Math.min(last, commands[i].getLeft());\n      }\n      minLeft[i] = last;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/InlineImageSpanWithPipeline.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.RectF;\nimport android.text.style.ReplacementSpan;\n\nimport com.facebook.imagepipeline.request.ImageRequest;\nimport com.facebook.infer.annotation.Assertions;\n\n/* package */ final class InlineImageSpanWithPipeline extends ReplacementSpan\n    implements AttachDetachListener, BitmapUpdateListener {\n\n  private static final RectF TMP_RECT = new RectF();\n\n  private @Nullable PipelineRequestHelper mRequestHelper;\n  private @Nullable FlatViewGroup.InvalidateCallback mCallback;\n  private float mWidth;\n  private float mHeight;\n  private boolean mFrozen;\n\n  /* package */ InlineImageSpanWithPipeline() {\n    this(null, Float.NaN, Float.NaN);\n  }\n\n  private InlineImageSpanWithPipeline(\n      @Nullable PipelineRequestHelper requestHelper,\n      float width,\n      float height) {\n    mRequestHelper = requestHelper;\n    mWidth = width;\n    mHeight = height;\n  }\n\n  /* package */ InlineImageSpanWithPipeline mutableCopy() {\n    return new InlineImageSpanWithPipeline(mRequestHelper, mWidth, mHeight);\n  }\n\n  /* package */ boolean hasImageRequest() {\n    return mRequestHelper != null;\n  }\n\n  /**\n   * Assigns a new image request to the DrawImage, or null to clear the image request.\n   */\n  /* package */ void setImageRequest(@Nullable ImageRequest imageRequest) {\n    if (imageRequest == null) {\n      mRequestHelper = null;\n    } else {\n      mRequestHelper = new PipelineRequestHelper(imageRequest);\n    }\n  }\n\n  /* package */ float getWidth() {\n    return mWidth;\n  }\n\n  /* package */ void setWidth(float width) {\n    mWidth = width;\n  }\n\n  /* package */ float getHeight() {\n    return mHeight;\n  }\n\n  /* package */ void setHeight(float height) {\n    mHeight = height;\n  }\n\n  /* package */ void freeze() {\n    mFrozen = true;\n  }\n\n  /* package */ boolean isFrozen() {\n    return mFrozen;\n  }\n\n  @Override\n  public void onSecondaryAttach(Bitmap bitmap) {\n    // We don't know if width or height changed, so invalidate just in case.\n    Assertions.assumeNotNull(mCallback).invalidate();\n  }\n\n  @Override\n  public void onBitmapReady(Bitmap bitmap) {\n    // Bitmap is now ready, draw it.\n    Assertions.assumeNotNull(mCallback).invalidate();\n  }\n\n  @Override\n  public void onImageLoadEvent(int imageLoadEvent) {\n    // ignore\n  }\n\n  @Override\n  public void onAttached(FlatViewGroup.InvalidateCallback callback) {\n    mCallback = callback;\n\n    if (mRequestHelper != null) {\n      mRequestHelper.attach(this);\n    }\n  }\n\n  @Override\n  public void onDetached() {\n    if (mRequestHelper != null) {\n      mRequestHelper.detach();\n\n      if (mRequestHelper.isDetached()) {\n        // optional\n        mCallback = null;\n      }\n    }\n  }\n\n  @Override\n  public int getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm) {\n    if (fm != null) {\n      fm.ascent = -Math.round(mHeight);\n      fm.descent = 0;\n\n      fm.top = fm.ascent;\n      fm.bottom = 0;\n    }\n\n    return Math.round(mWidth);\n  }\n\n  @Override\n  public void draw(\n      Canvas canvas,\n      CharSequence text,\n      int start,\n      int end,\n      float x,\n      int top,\n      int y,\n      int bottom,\n      Paint paint) {\n    if (mRequestHelper == null) {\n      return;\n    }\n\n    Bitmap bitmap = mRequestHelper.getBitmap();\n    if (bitmap == null) {\n      return;\n    }\n\n    float bottomFloat = (float) bottom - paint.getFontMetricsInt().descent;\n    TMP_RECT.set(x, bottomFloat - mHeight, x + mWidth, bottomFloat);\n\n    canvas.drawBitmap(bitmap, null, TMP_RECT, paint);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/MoveProxy.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.uimanager.ReactShadowNode;\nimport com.facebook.react.uimanager.ReactShadowNodeImpl;\nimport javax.annotation.Nullable;\n\n/**\n * Helper class that sorts moveFrom/moveTo arrays in lockstep.\n */\n/* package */ final class MoveProxy {\n\n  private @Nullable ReadableArray mMoveTo;\n  private int mSize;\n  private int[] mMapping = new int[8];\n  private ReactShadowNode[] mChildren = new ReactShadowNodeImpl[4];\n\n  /**\n   * Returns size of underlying moveTo/moveFrom arrays\n   */\n  public int size() {\n    return mSize;\n  }\n\n  /**\n   * Assigns ith child that we want to move if moveFrom was sorted.\n   */\n  public void setChildMoveFrom(int moveFromIndex, ReactShadowNode node) {\n    mChildren[moveFromToIndex(moveFromIndex)] = node;\n  }\n\n  /**\n   * Returns ith child that we want to move if moveTo was sorted.\n   */\n  public ReactShadowNode getChildMoveTo(int moveToIndex) {\n    return mChildren[moveToToIndex(moveToIndex)];\n  }\n\n  /**\n   * Returns index of the ith child that we want to move if moveFrom was sorted\n   */\n  public int getMoveFrom(int moveFromIndex) {\n    return moveFromToValue(moveFromIndex);\n  }\n\n  /**\n   * Returns index of the ith child that we want to move to if moveTo was sorted\n   */\n  public int getMoveTo(int moveToIndex) {\n    return moveToToValue(moveToIndex);\n  }\n\n  /**\n   * Initialize MoveProxy with given moveFrom and moveTo arrays.\n   */\n  public void setup(ReadableArray moveFrom, ReadableArray moveTo) {\n    mMoveTo = moveTo;\n\n    if (moveFrom == null) {\n      setSize(0);\n      return;\n    }\n\n    int size = moveFrom.size();\n    int requiredSpace = size + size;\n    if (mMapping.length < requiredSpace) {\n      mMapping = new int[requiredSpace];\n      mChildren = new FlatShadowNode[size];\n    }\n\n    setSize(size);\n\n    // Array contains data in the following way:\n    // [ k0, v0, k1, v1, k2, v2, ... ]\n    //\n    // where vi = moveFrom.getInt(ki)\n\n    // We don't technically *need* to store vi, but they are accessed so often that it makes sense\n    // to cache it instead of calling ReadableArray.getInt() all the time.\n\n    // Sorting algorithm will reorder ki/vi pairs in such a way that vi < v(i+1)\n\n    // Code below is an insertion sort, adapted from DualPivotQuicksort.doSort()\n\n    // At each step i, we got the following data:\n\n    // [k0, v0, k1, v2, .. k(i-1), v(i-1), unused...]\n    // where v0 < v1 < v2 ... < v(i-1)\n    //\n    // This holds true for step i = 0 (array of size one is sorted)\n    // Again, k0 = 0, v0 = moveFrom.getInt(k0)\n    setKeyValue(0, 0, moveFrom.getInt(0));\n\n    // At each of the next steps, we grab a new key and walk back until we find first key that is\n    // less than current, shifting key/value pairs if they are larger than current key.\n    for (int i = 1; i < size; i++) {\n      // this is our next key\n      int current = moveFrom.getInt(i);\n\n      // this loop will find correct position for it\n      int j;\n\n      // At this point, array is like this: [ k0, v0, k1, v1, k2, v2, ..., k(i-1), v(i-1), ... ]\n      for (j = i - 1; j >= 0; j--) {\n        if (moveFromToValue(j) < current) {\n          break;\n        }\n\n        // value at index j is < current value, shift that value and its key\n        setKeyValue(j + 1, moveFromToIndex(j), moveFromToValue(j));\n      }\n\n      setKeyValue(j + 1, i, current);\n    }\n  }\n\n  /**\n   * Returns index of ith key in array.\n   */\n  private static int k(int i) {\n    return i * 2;\n  }\n\n  /**\n   * Returns index of ith value in array.\n   */\n  private static int v(int i) {\n    return i * 2 + 1;\n  }\n\n  private void setKeyValue(int index, int key, int value) {\n    mMapping[k(index)] = key;\n    mMapping[v(index)] = value;\n  }\n\n  private int moveFromToIndex(int index) {\n    return mMapping[k(index)];\n  }\n\n  private int moveFromToValue(int index) {\n    return mMapping[v(index)];\n  }\n\n  private static int moveToToIndex(int index) {\n    return index;\n  }\n\n  private int moveToToValue(int index) {\n    return Assertions.assumeNotNull(mMoveTo).getInt(index);\n  }\n\n  private void setSize(int newSize) {\n    // reset references to null when shrinking to avoid memory leaks\n    for (int i = newSize; i < mSize; ++i) {\n      mChildren[i] = null;\n    }\n\n    mSize = newSize;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/NativeViewWrapper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport com.facebook.react.uimanager.ReactShadowNode;\nimport com.facebook.react.uimanager.ReactShadowNodeImpl;\nimport com.facebook.react.uimanager.ReactStylesDiffMap;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIViewOperationQueue;\nimport com.facebook.react.uimanager.ViewGroupManager;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaUnit;\nimport com.facebook.yoga.YogaValue;\nimport javax.annotation.Nullable;\n\n/* package */ final class NativeViewWrapper extends FlatShadowNode implements AndroidView {\n\n  @Nullable\n  private final ReactShadowNode mReactShadowNode;\n  private final boolean mNeedsCustomLayoutForChildren;\n  private boolean mPaddingChanged = false;\n  private boolean mForceMountGrandChildrenToView;\n\n  /* package */ NativeViewWrapper(ViewManager viewManager) {\n    ReactShadowNode reactShadowNode = viewManager.createShadowNodeInstance();\n    if (reactShadowNode instanceof YogaMeasureFunction) {\n      mReactShadowNode = reactShadowNode;\n      setMeasureFunction((YogaMeasureFunction) reactShadowNode);\n    } else {\n      mReactShadowNode = null;\n    }\n\n    if (viewManager instanceof ViewGroupManager) {\n      ViewGroupManager viewGroupManager = (ViewGroupManager) viewManager;\n      mNeedsCustomLayoutForChildren = viewGroupManager.needsCustomLayoutForChildren();\n      mForceMountGrandChildrenToView = viewGroupManager.shouldPromoteGrandchildren();\n    } else {\n      mNeedsCustomLayoutForChildren = false;\n    }\n\n    forceMountToView();\n    forceMountChildrenToView();\n  }\n\n  @Override\n  public boolean needsCustomLayoutForChildren() {\n    return mNeedsCustomLayoutForChildren;\n  }\n\n  @Override\n  public boolean isPaddingChanged() {\n    return mPaddingChanged;\n  }\n\n  @Override\n  public void resetPaddingChanged() {\n    mPaddingChanged = false;\n  }\n\n  @Override\n  public void setBackgroundColor(int backgroundColor) {\n    // suppress, this is handled by a ViewManager\n  }\n\n  @Override\n  public void setReactTag(int reactTag) {\n    super.setReactTag(reactTag);\n    if (mReactShadowNode != null) {\n      mReactShadowNode.setReactTag(reactTag);\n    }\n  }\n\n  @Override\n  public void setThemedContext(ThemedReactContext themedContext) {\n    super.setThemedContext(themedContext);\n\n    if (mReactShadowNode != null) {\n      mReactShadowNode.setThemedContext(themedContext);\n    }\n  }\n\n  @Override\n  /* package*/ void handleUpdateProperties(ReactStylesDiffMap styles) {\n    if (mReactShadowNode != null) {\n      mReactShadowNode.updateProperties(styles);\n    }\n  }\n\n  @Override\n  public void addChildAt(ReactShadowNodeImpl child, int i) {\n    super.addChildAt(child, i);\n    if (mForceMountGrandChildrenToView && child instanceof FlatShadowNode) {\n      ((FlatShadowNode) child).forceMountChildrenToView();\n    }\n  }\n\n  @Override\n  public void setPadding(int spacingType, float padding) {\n    YogaValue current = getStylePadding(spacingType);\n    if (current.unit != YogaUnit.POINT || current.value != padding) {\n      super.setPadding(spacingType, padding);\n      mPaddingChanged = true;\n      markUpdated();\n    }\n  }\n\n  @Override\n  public void setPaddingPercent(int spacingType, float percent) {\n    YogaValue current = getStylePadding(spacingType);\n    if (current.unit != YogaUnit.PERCENT || current.value != percent) {\n      super.setPadding(spacingType, percent);\n      mPaddingChanged = true;\n      markUpdated();\n    }\n  }\n\n  @Override\n  public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {\n    if (mReactShadowNode != null && mReactShadowNode.hasUnseenUpdates()) {\n      mReactShadowNode.onCollectExtraUpdates(uiViewOperationQueue);\n      markUpdateSeen();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/NodeRegion.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\n/* package */ class NodeRegion {\n  /* package */ static final NodeRegion[] EMPTY_ARRAY = new NodeRegion[0];\n  /* package */ static final NodeRegion EMPTY = new NodeRegion(0, 0, 0, 0, -1, false);\n\n  private final float mLeft;\n  private final float mTop;\n  private final float mRight;\n  private final float mBottom;\n  /* package */ final int mTag;\n  /* package */ final boolean mIsVirtual;\n\n  /* package */ NodeRegion(\n      float left,\n      float top,\n      float right,\n      float bottom,\n      int tag,\n      boolean isVirtual) {\n    mLeft = left;\n    mTop = top;\n    mRight = right;\n    mBottom = bottom;\n    mTag = tag;\n    mIsVirtual = isVirtual;\n  }\n\n  /* package */ final boolean matches(\n      float left,\n      float top,\n      float right,\n      float bottom,\n      boolean isVirtual) {\n    return left == mLeft && top == mTop && right == mRight && bottom == mBottom &&\n        isVirtual == mIsVirtual;\n  }\n\n  /**\n   * The left bound of the underlying node.\n   *\n   * @return The node bound.\n   */\n  /* package */ final float getLeft() {\n    return mLeft;\n  }\n\n  /**\n   * The top bound of the underlying node.\n   *\n   * @return The node bound.\n   */\n  /* package */ final float getTop() {\n    return mTop;\n  }\n\n  /**\n   * The right bound of the underlying node.\n   *\n   * @return The node bound.\n   */\n  /* package */ final float getRight() {\n    return mRight;\n  }\n\n  /**\n   * The bottom bound of the underlying node.\n   *\n   * @return The node bound.\n   */\n  /* package */ final float getBottom() {\n    return mBottom;\n  }\n\n  /**\n   * The left bound of the region for the purpose of touch.  This is usually the bound of the\n   * underlying node, except in the case of hit slop.\n   *\n   * @return The touch bound.\n   */\n  /* package */ float getTouchableLeft() {\n    return getLeft();\n  }\n\n  /**\n   * The top bound of the region for the purpose of touch.  This is usually the bound of the\n   * underlying node, except in the case of hit slop.\n   *\n   * @return The touch bound.\n   */\n  /* package */ float getTouchableTop() {\n    return getTop();\n  }\n\n  /**\n   * The right bound of the region for the purpose of touch.  This is usually the bound of the\n   * underlying node, except in the case of hit slop.\n   *\n   * @return The touch bound.\n   */\n  /* package */ float getTouchableRight() {\n    return getRight();\n  }\n\n  /**\n   * The bottom bound of the region for the purpose of touch.  This is usually the bound of the\n   * underlying node, except in the case of hit slop.\n   *\n   * @return The touch bound.\n   */\n  /* package */ float getTouchableBottom() {\n    return getBottom();\n  }\n\n  /* package */ boolean withinBounds(float touchX, float touchY) {\n    return mLeft <= touchX && touchX < mRight && mTop <= touchY && touchY < mBottom;\n  }\n\n  /* package */ int getReactTag(float touchX, float touchY) {\n    return mTag;\n  }\n\n  /* package */ boolean matchesTag(int tag) {\n    return mTag == tag;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/PipelineRequestHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Bitmap;\n\nimport com.facebook.common.executors.UiThreadImmediateExecutorService;\nimport com.facebook.common.references.CloseableReference;\nimport com.facebook.datasource.DataSource;\nimport com.facebook.datasource.DataSubscriber;\nimport com.facebook.imagepipeline.core.ImagePipeline;\nimport com.facebook.imagepipeline.core.ImagePipelineFactory;\nimport com.facebook.imagepipeline.image.CloseableBitmap;\nimport com.facebook.imagepipeline.image.CloseableImage;\nimport com.facebook.imagepipeline.request.ImageRequest;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.views.image.ImageLoadEvent;\n\n/**\n * Helper class for DrawImage that helps manage fetch requests through ImagePipeline.\n *\n * Request states this class can be in:\n * 1) mDataSource == null, mImageRef == null : request has not be started, was canceled or failed.\n * 2) mDataSource != null, mImageRef == null : request is in progress.\n * 3) mDataSource == null, mImageRef != null : request successfully finished.\n * 4) mDataSource != null, mImageRef != null : invalid state (should never happen)\n */\n/* package */ final class PipelineRequestHelper\n    implements DataSubscriber<CloseableReference<CloseableImage>> {\n\n  private final ImageRequest mImageRequest;\n  private @Nullable BitmapUpdateListener mBitmapUpdateListener;\n  private @Nullable DataSource<CloseableReference<CloseableImage>> mDataSource;\n  private @Nullable CloseableReference<CloseableImage> mImageRef;\n  private int mAttachCounter;\n\n  /* package */ PipelineRequestHelper(ImageRequest imageRequest) {\n    mImageRequest = imageRequest;\n  }\n\n  /* package */ void attach(BitmapUpdateListener listener) {\n    mBitmapUpdateListener = listener;\n\n    mAttachCounter++;\n    if (mAttachCounter != 1) {\n      // this is a secondary attach, ignore it, only updating Bitmap boundaries if needed.\n      Bitmap bitmap = getBitmap();\n      if (bitmap != null) {\n        listener.onSecondaryAttach(bitmap);\n      }\n      return;\n    }\n\n    listener.onImageLoadEvent(ImageLoadEvent.ON_LOAD_START);\n\n    Assertions.assertCondition(mDataSource == null);\n    Assertions.assertCondition(mImageRef == null);\n\n    // Submit the request\n    ImagePipeline imagePipeline = ImagePipelineFactory.getInstance().getImagePipeline();\n    mDataSource = imagePipeline.fetchDecodedImage(mImageRequest, RCTImageView.getCallerContext());\n    mDataSource.subscribe(this, UiThreadImmediateExecutorService.getInstance());\n  }\n\n  /**\n   * Returns whether detach() was primary, false otherwise.\n   */\n  /* package */ void detach() {\n    --mAttachCounter;\n    if (mAttachCounter != 0) {\n      // this is a secondary detach, ignore it\n      return;\n    }\n\n    if (mDataSource != null) {\n      mDataSource.close();\n      mDataSource = null;\n    }\n\n    if (mImageRef != null) {\n      mImageRef.close();\n      mImageRef = null;\n    }\n\n    mBitmapUpdateListener = null;\n  }\n\n  /**\n   * Returns an unsafe bitmap reference. Do not assign the result of this method to anything other\n   * than a local variable, or it will no longer work with the reference count goes to zero.\n   */\n  /* package */ @Nullable Bitmap getBitmap() {\n    if (mImageRef == null) {\n      return null;\n    }\n\n    CloseableImage closeableImage = mImageRef.get();\n    if (!(closeableImage instanceof CloseableBitmap)) {\n      mImageRef.close();\n      mImageRef = null;\n      return null;\n    }\n\n    return ((CloseableBitmap) closeableImage).getUnderlyingBitmap();\n  }\n\n  /* package */ boolean isDetached() {\n    return mAttachCounter == 0;\n  }\n\n  @Override\n  public void onNewResult(DataSource<CloseableReference<CloseableImage>> dataSource) {\n    if (!dataSource.isFinished()) {\n      // only interested in final image, no need to close the dataSource\n      return;\n    }\n\n    try {\n      if (mDataSource != dataSource) {\n        // Shouldn't ever happen, but let's be safe (dataSource got closed by callback still fired?)\n        return;\n      }\n\n      mDataSource = null;\n\n      CloseableReference<CloseableImage> imageReference = dataSource.getResult();\n      if (imageReference == null) {\n        // Shouldn't ever happen, but let's be safe (dataSource got closed by callback still fired?)\n        return;\n      }\n\n      CloseableImage image = imageReference.get();\n      if (!(image instanceof CloseableBitmap)) {\n        // only bitmaps are supported\n        imageReference.close();\n        return;\n      }\n\n      mImageRef = imageReference;\n\n      Bitmap bitmap = getBitmap();\n      if (bitmap == null) {\n        // Shouldn't ever happen, but let's be safe.\n        return;\n      }\n\n      BitmapUpdateListener listener = Assertions.assumeNotNull(mBitmapUpdateListener);\n      listener.onBitmapReady(bitmap);\n      listener.onImageLoadEvent(ImageLoadEvent.ON_LOAD);\n      listener.onImageLoadEvent(ImageLoadEvent.ON_LOAD_END);\n    } finally {\n      dataSource.close();\n    }\n  }\n\n  @Override\n  public void onFailure(DataSource<CloseableReference<CloseableImage>> dataSource) {\n    if (mDataSource == dataSource) {\n      Assertions.assumeNotNull(mBitmapUpdateListener).onImageLoadEvent(ImageLoadEvent.ON_ERROR);\n      Assertions.assumeNotNull(mBitmapUpdateListener).onImageLoadEvent(ImageLoadEvent.ON_LOAD_END);\n      mDataSource = null;\n    }\n\n    dataSource.close();\n  }\n\n  @Override\n  public void onCancellation(DataSource<CloseableReference<CloseableImage>> dataSource) {\n    if (mDataSource == dataSource) {\n      mDataSource = null;\n    }\n\n    dataSource.close();\n  }\n\n  @Override\n  public void onProgressUpdate(DataSource<CloseableReference<CloseableImage>> dataSource) {\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTImageView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport com.facebook.drawee.drawable.ScalingUtils.ScaleType;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.views.image.ImageResizeMode;\n\n/**\n * RCTImageView is a top-level node for Image. It can display either a remote image\n * (source must start wtih http:// or https://) or a local resource (a BitmapDrawable).\n */\n/* package */ class RCTImageView<T extends AbstractDrawCommand & DrawImage> extends FlatShadowNode {\n\n  static Object sCallerContext = RCTImageView.class;\n\n  /**\n   * Assigns a CallerContext to execute network requests with.\n   */\n  /* package */ static void setCallerContext(Object callerContext) {\n    sCallerContext = callerContext;\n  }\n\n  /* package */ static Object getCallerContext() {\n    return sCallerContext;\n  }\n\n  private T mDrawImage;\n\n  /* package */ RCTImageView(T drawImage) {\n    mDrawImage = drawImage;\n  }\n\n  @Override\n  protected void collectState(\n      StateBuilder stateBuilder,\n      float left,\n      float top,\n      float right,\n      float bottom,\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom) {\n    super.collectState(\n        stateBuilder,\n        left,\n        top,\n        right,\n        bottom,\n        clipLeft,\n        clipTop,\n        clipRight,\n        clipBottom);\n\n    if (mDrawImage.hasImageRequest()) {\n      mDrawImage = (T) mDrawImage.updateBoundsAndFreeze(\n          left,\n          top,\n          right,\n          bottom,\n          clipLeft,\n          clipTop,\n          clipRight,\n          clipBottom);\n      stateBuilder.addDrawCommand(mDrawImage);\n      stateBuilder.addAttachDetachListener(mDrawImage);\n    }\n  }\n\n  @Override\n  boolean doesDraw() {\n    return mDrawImage.hasImageRequest() || super.doesDraw();\n  }\n\n  @ReactProp(name = \"shouldNotifyLoadEvents\")\n  public void setShouldNotifyLoadEvents(boolean shouldNotifyLoadEvents) {\n    getMutableDrawImage().setReactTag(shouldNotifyLoadEvents ? getReactTag() : 0);\n  }\n\n  @ReactProp(name = \"src\")\n  public void setSource(@Nullable ReadableArray sources) {\n    getMutableDrawImage().setSource(getThemedContext(), sources);\n  }\n\n  @ReactProp(name = \"tintColor\")\n  public void setTintColor(int tintColor) {\n    getMutableDrawImage().setTintColor(tintColor);\n  }\n\n  @ReactProp(name = ViewProps.RESIZE_MODE)\n  public void setResizeMode(@Nullable String resizeMode) {\n    ScaleType scaleType = ImageResizeMode.toScaleType(resizeMode);\n    if (mDrawImage.getScaleType() != scaleType) {\n      getMutableDrawImage().setScaleType(scaleType);\n    }\n  }\n\n  @ReactProp(name = \"borderColor\", customType = \"Color\")\n  public void setBorderColor(int borderColor) {\n    if (mDrawImage.getBorderColor() != borderColor) {\n      getMutableDrawImage().setBorderColor(borderColor);\n    }\n  }\n\n  @Override\n  public void setBorder(int spacingType, float borderWidth) {\n    super.setBorder(spacingType, borderWidth);\n\n    if (spacingType == Spacing.ALL && mDrawImage.getBorderWidth() != borderWidth) {\n      getMutableDrawImage().setBorderWidth(borderWidth);\n    }\n  }\n\n  @ReactProp(name = \"borderRadius\")\n  public void setBorderRadius(float borderRadius) {\n    if (mDrawImage.getBorderRadius() != borderRadius) {\n      getMutableDrawImage().setBorderRadius(PixelUtil.toPixelFromDIP(borderRadius));\n    }\n  }\n\n  @ReactProp(name = \"fadeDuration\")\n  public void setFadeDuration(int durationMs) {\n    getMutableDrawImage().setFadeDuration(durationMs);\n  }\n\n  @ReactProp(name = \"progressiveRenderingEnabled\")\n  public void setProgressiveRenderingEnabled(boolean enabled) {\n    getMutableDrawImage().setProgressiveRenderingEnabled(enabled);\n  }\n\n  private T getMutableDrawImage() {\n    if (mDrawImage.isFrozen()) {\n      mDrawImage = (T) mDrawImage.mutableCopy();\n      invalidate();\n    }\n\n    return mDrawImage;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTImageViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport com.facebook.drawee.backends.pipeline.Fresco;\nimport com.facebook.drawee.controller.AbstractDraweeControllerBuilder;\nimport com.facebook.react.views.image.GlobalImageLoadListener;\nimport javax.annotation.Nullable;\n\npublic final class RCTImageViewManager extends FlatViewManager {\n\n  /* package */ static final String REACT_CLASS = \"RCTImageView\";\n\n  private @Nullable AbstractDraweeControllerBuilder mDraweeControllerBuilder;\n  private @Nullable GlobalImageLoadListener mGlobalImageLoadListener;\n  private final @Nullable Object mCallerContext;\n\n  public RCTImageViewManager() {\n    this(null, null);\n  }\n\n  public RCTImageViewManager(\n    AbstractDraweeControllerBuilder draweeControllerBuilder,\n    Object callerContext) {\n    this(draweeControllerBuilder, null, callerContext);\n  }\n\n  public RCTImageViewManager(\n      AbstractDraweeControllerBuilder draweeControllerBuilder,\n      @Nullable GlobalImageLoadListener globalImageLoadListener,\n      Object callerContext) {\n    mDraweeControllerBuilder = draweeControllerBuilder;\n    mGlobalImageLoadListener = globalImageLoadListener;\n    mCallerContext = callerContext;\n  }\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public RCTImageView createShadowNodeInstance() {\n    return new RCTImageView(new DrawImageWithDrawee(mGlobalImageLoadListener));\n  }\n\n  @Override\n  public Class<RCTImageView> getShadowNodeClass() {\n    return RCTImageView.class;\n  }\n\n  public AbstractDraweeControllerBuilder getDraweeControllerBuilder() {\n    if (mDraweeControllerBuilder == null) {\n      mDraweeControllerBuilder = Fresco.newDraweeControllerBuilder();\n    }\n    return mDraweeControllerBuilder;\n  }\n\n  public Object getCallerContext() {\n    return mCallerContext;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTModalHostManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport com.facebook.react.uimanager.LayoutShadowNode;\nimport com.facebook.react.views.modal.ReactModalHostManager;\n\npublic class RCTModalHostManager extends ReactModalHostManager {\n\n  /* package */ static final String REACT_CLASS = ReactModalHostManager.REACT_CLASS;\n\n  @Override\n  public LayoutShadowNode createShadowNodeInstance() {\n    return new FlatReactModalShadowNode();\n  }\n\n  @Override\n  public Class<? extends LayoutShadowNode> getShadowNodeClass() {\n    return FlatReactModalShadowNode.class;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTRawText.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.text.Spannable;\nimport android.text.SpannableStringBuilder;\n\nimport com.facebook.react.uimanager.annotations.ReactProp;\n\n/**\n * RCTRawText is a FlatTextShadowNode that can only contain raw text (but not styling).\n */\n/* package */ final class RCTRawText extends FlatTextShadowNode {\n\n  private @Nullable String mText;\n\n  @Override\n  protected void performCollectText(SpannableStringBuilder builder) {\n    if (mText != null) {\n      builder.append(mText);\n    }\n  }\n\n  @Override\n  protected void performApplySpans(\n      SpannableStringBuilder builder,\n      int begin,\n      int end,\n      boolean isEditable) {\n    builder.setSpan(\n        this,\n        begin,\n        end,\n        Spannable.SPAN_INCLUSIVE_EXCLUSIVE);\n  }\n\n  @Override\n  protected void performCollectAttachDetachListeners(StateBuilder stateBuilder) {\n    // nothing to do\n  }\n\n  @ReactProp(name = \"text\")\n  public void setText(@Nullable String text) {\n    mText = text;\n    notifyChanged(true);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTRawTextManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\n/**\n * ViewManager that creates instances of RCTRawText.\n */\npublic final class RCTRawTextManager extends VirtualViewManager<RCTRawText> {\n\n  /* package */ static final String REACT_CLASS = \"RCTRawText\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public RCTRawText createShadowNodeInstance() {\n    return new RCTRawText();\n  }\n\n  @Override\n  public Class<RCTRawText> getShadowNodeClass() {\n    return RCTRawText.class;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTText.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.support.v4.text.TextDirectionHeuristicsCompat;\nimport android.text.Layout;\nimport android.text.TextUtils;\nimport android.view.Gravity;\n\nimport com.facebook.yoga.YogaDirection;\nimport com.facebook.yoga.YogaMeasureMode;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaNode;\nimport com.facebook.yoga.YogaMeasureOutput;\nimport com.facebook.fbui.textlayoutbuilder.TextLayoutBuilder;\nimport com.facebook.fbui.textlayoutbuilder.glyphwarmer.GlyphWarmerImpl;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.ViewDefaults;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\n\n/**\n * RCTText is a top-level node for text. It extends {@link RCTVirtualText} because it can contain\n * styling information, but has the following differences:\n *\n * a) RCTText is not a virtual node, and can be measured and laid out.\n * b) when no font size is specified, a font size of ViewDefaults#FONT_SIZE_SP is assumed.\n */\n/* package */ final class RCTText extends RCTVirtualText implements YogaMeasureFunction {\n\n  // index of left and right in the Layout.Alignment enum since the base values are @hide\n  private static final int ALIGNMENT_LEFT = 3;\n  private static final int ALIGNMENT_RIGHT = 4;\n\n  // We set every value we use every time we use the layout builder, so we can get away with only\n  // using a single instance.\n  private static final TextLayoutBuilder sTextLayoutBuilder =\n      new TextLayoutBuilder()\n          .setShouldCacheLayout(false)\n          .setShouldWarmText(true)\n          .setGlyphWarmer(new GlyphWarmerImpl());\n\n  private @Nullable CharSequence mText;\n  private @Nullable DrawTextLayout mDrawCommand;\n  private float mSpacingMult = 1.0f;\n  private float mSpacingAdd = 0.0f;\n  private int mNumberOfLines = Integer.MAX_VALUE;\n  private int mAlignment = Gravity.NO_GRAVITY;\n  private boolean mIncludeFontPadding = true;\n\n  public RCTText() {\n    setMeasureFunction(this);\n    getSpan().setFontSize(getDefaultFontSize());\n  }\n\n  @Override\n  public boolean isVirtual() {\n    return false;\n  }\n\n  @Override\n  public boolean isVirtualAnchor() {\n    return true;\n  }\n\n  @Override\n  public long measure(\n      YogaNode node,\n      float width,\n      YogaMeasureMode widthMode,\n      float height,\n      YogaMeasureMode heightMode) {\n\n    CharSequence text = getText();\n    if (TextUtils.isEmpty(text)) {\n      // to indicate that we don't have anything to display\n      mText = null;\n      return YogaMeasureOutput.make(0, 0);\n    } else {\n      mText = text;\n    }\n\n    Layout layout = createTextLayout(\n        (int) Math.ceil(width),\n        widthMode,\n        TextUtils.TruncateAt.END,\n        mIncludeFontPadding,\n        mNumberOfLines,\n        mNumberOfLines == 1,\n        text,\n        getFontSize(),\n        mSpacingAdd,\n        mSpacingMult,\n        getFontStyle(),\n        getAlignment());\n\n    if (mDrawCommand != null && !mDrawCommand.isFrozen()) {\n      mDrawCommand.setLayout(layout);\n    } else {\n      mDrawCommand = new DrawTextLayout(layout);\n    }\n\n    return YogaMeasureOutput.make(mDrawCommand.getLayoutWidth(), mDrawCommand.getLayoutHeight());\n  }\n\n  @Override\n  protected void collectState(\n      StateBuilder stateBuilder,\n      float left,\n      float top,\n      float right,\n      float bottom,\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom) {\n\n    super.collectState(\n        stateBuilder,\n        left,\n        top,\n        right,\n        bottom,\n        clipLeft,\n        clipTop,\n        clipRight,\n        clipBottom);\n\n    if (mText == null) {\n      // as an optimization, LayoutEngine may not call measure in certain cases, such as when the\n      // dimensions are already defined. in these cases, we should still draw the text.\n      if (bottom - top > 0 && right - left > 0) {\n        CharSequence text = getText();\n        if (!TextUtils.isEmpty(text)) {\n          mText = text;\n        }\n      }\n\n      if (mText == null) {\n        // nothing to draw (empty text).\n        return;\n      }\n    }\n\n    boolean updateNodeRegion = false;\n    if (mDrawCommand == null) {\n      mDrawCommand = new DrawTextLayout(createTextLayout(\n          (int) Math.ceil(right - left),\n          YogaMeasureMode.EXACTLY,\n          TextUtils.TruncateAt.END,\n          mIncludeFontPadding,\n          mNumberOfLines,\n          mNumberOfLines == 1,\n          mText,\n          getFontSize(),\n          mSpacingAdd,\n          mSpacingMult,\n          getFontStyle(),\n          getAlignment()));\n      updateNodeRegion = true;\n    }\n\n    left += getPadding(Spacing.LEFT);\n    top += getPadding(Spacing.TOP);\n\n    // these are actual right/bottom coordinates where this DrawCommand will draw.\n    right = left + mDrawCommand.getLayoutWidth();\n    bottom = top + mDrawCommand.getLayoutHeight();\n\n    mDrawCommand = (DrawTextLayout) mDrawCommand.updateBoundsAndFreeze(\n        left,\n        top,\n        right,\n        bottom,\n        clipLeft,\n        clipTop,\n        clipRight,\n        clipBottom);\n    stateBuilder.addDrawCommand(mDrawCommand);\n\n    if (updateNodeRegion) {\n      NodeRegion nodeRegion = getNodeRegion();\n      if (nodeRegion instanceof TextNodeRegion) {\n        ((TextNodeRegion) nodeRegion).setLayout(mDrawCommand.getLayout());\n      }\n    }\n\n    performCollectAttachDetachListeners(stateBuilder);\n  }\n\n  @Override\n  boolean doesDraw() {\n    // assume text always draws - this is a performance optimization to avoid having to\n    // getText() when layout was skipped and when collectState wasn't yet called\n    return true;\n  }\n\n  @ReactProp(name = ViewProps.LINE_HEIGHT, defaultDouble = Double.NaN)\n  public void setLineHeight(double lineHeight) {\n    if (Double.isNaN(lineHeight)) {\n      mSpacingMult = 1.0f;\n      mSpacingAdd = 0.0f;\n    } else {\n      mSpacingMult = 0.0f;\n      mSpacingAdd = PixelUtil.toPixelFromSP((float) lineHeight);\n    }\n    notifyChanged(true);\n  }\n\n  @ReactProp(name = ViewProps.NUMBER_OF_LINES, defaultInt = Integer.MAX_VALUE)\n  public void setNumberOfLines(int numberOfLines) {\n    mNumberOfLines = numberOfLines;\n    notifyChanged(true);\n  }\n\n  @ReactProp(name = ViewProps.INCLUDE_FONT_PADDING, defaultBoolean = true)\n  public void setIncludeFontPadding(boolean includepad) {\n    mIncludeFontPadding = includepad;\n  }\n\n  @Override\n  /* package */ void updateNodeRegion(\n      float left,\n      float top,\n      float right,\n      float bottom,\n      boolean isVirtual) {\n\n    NodeRegion nodeRegion = getNodeRegion();\n    if (mDrawCommand == null) {\n      if (!nodeRegion.matches(left, top, right, bottom, isVirtual)) {\n        setNodeRegion(new TextNodeRegion(left, top, right, bottom, getReactTag(), isVirtual, null));\n      }\n      return;\n    }\n\n    Layout layout = null;\n\n    if (nodeRegion instanceof TextNodeRegion) {\n      layout = ((TextNodeRegion) nodeRegion).getLayout();\n    }\n\n    Layout newLayout = mDrawCommand.getLayout();\n    if (!nodeRegion.matches(left, top, right, bottom, isVirtual) || layout != newLayout) {\n      setNodeRegion(\n          new TextNodeRegion(left, top, right, bottom, getReactTag(), isVirtual, newLayout));\n    }\n  }\n\n  @Override\n  protected int getDefaultFontSize() {\n    // top-level <Text /> should always specify font size.\n    return fontSizeFromSp(ViewDefaults.FONT_SIZE_SP);\n  }\n\n  @Override\n  protected void notifyChanged(boolean shouldRemeasure) {\n    // Future patch: should only recreate Layout if shouldRemeasure is false\n    dirty();\n  }\n\n  @ReactProp(name = ViewProps.TEXT_ALIGN)\n  public void setTextAlign(@Nullable String textAlign) {\n    if (textAlign == null || \"auto\".equals(textAlign)) {\n      mAlignment = Gravity.NO_GRAVITY;\n    } else if (\"left\".equals(textAlign)) {\n      // left and right may yield potentially different results (relative to non-nodes) in cases\n      // when supportsRTL=\"true\" in the manifest.\n      mAlignment = Gravity.LEFT;\n    } else if (\"right\".equals(textAlign)) {\n      mAlignment = Gravity.RIGHT;\n    } else if (\"center\".equals(textAlign)) {\n      mAlignment = Gravity.CENTER;\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Invalid textAlign: \" + textAlign);\n    }\n\n    notifyChanged(false);\n  }\n\n  public Layout.Alignment getAlignment() {\n    boolean isRtl = getLayoutDirection() == YogaDirection.RTL;\n    switch (mAlignment) {\n      // Layout.Alignment.RIGHT and Layout.Alignment.LEFT are @hide :(\n      case Gravity.LEFT:\n        int index = isRtl ? ALIGNMENT_RIGHT : ALIGNMENT_LEFT;\n        return Layout.Alignment.values()[index];\n      case Gravity.RIGHT:\n        index = isRtl ? ALIGNMENT_LEFT : ALIGNMENT_RIGHT;\n        return Layout.Alignment.values()[index];\n      case Gravity.CENTER:\n        return Layout.Alignment.ALIGN_CENTER;\n      case Gravity.NO_GRAVITY:\n      default:\n        return Layout.Alignment.ALIGN_NORMAL;\n    }\n  }\n\n  private static Layout createTextLayout(\n      int width,\n      YogaMeasureMode widthMode,\n      TextUtils.TruncateAt ellipsize,\n      boolean shouldIncludeFontPadding,\n      int maxLines,\n      boolean isSingleLine,\n      CharSequence text,\n      int textSize,\n      float extraSpacing,\n      float spacingMultiplier,\n      int textStyle,\n      Layout.Alignment textAlignment) {\n    Layout newLayout;\n\n    final @TextLayoutBuilder.MeasureMode int textMeasureMode;\n    switch (widthMode) {\n      case UNDEFINED:\n        textMeasureMode = TextLayoutBuilder.MEASURE_MODE_UNSPECIFIED;\n        break;\n      case EXACTLY:\n        textMeasureMode = TextLayoutBuilder.MEASURE_MODE_EXACTLY;\n        break;\n      case AT_MOST:\n        textMeasureMode = TextLayoutBuilder.MEASURE_MODE_AT_MOST;\n        break;\n      default:\n        throw new IllegalStateException(\"Unexpected size mode: \" + widthMode);\n    }\n\n    sTextLayoutBuilder\n        .setEllipsize(ellipsize)\n        .setMaxLines(maxLines)\n        .setSingleLine(isSingleLine)\n        .setText(text)\n        .setTextSize(textSize)\n        .setWidth(width, textMeasureMode);\n\n    sTextLayoutBuilder.setTextStyle(textStyle);\n\n    sTextLayoutBuilder.setTextDirection(TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR);\n    sTextLayoutBuilder.setIncludeFontPadding(shouldIncludeFontPadding);\n    sTextLayoutBuilder.setTextSpacingExtra(extraSpacing);\n    sTextLayoutBuilder.setTextSpacingMultiplier(spacingMultiplier);\n    sTextLayoutBuilder.setAlignment(textAlignment);\n\n    newLayout = sTextLayoutBuilder.build();\n\n    sTextLayoutBuilder.setText(null);\n\n    return newLayout;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextInlineImage.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.text.SpannableStringBuilder;\nimport android.text.Spanned;\n\nimport com.facebook.imagepipeline.request.ImageRequestBuilder;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.views.imagehelper.ImageSource;\n\n/**\n * RCTTextInlineImage\n */\n/* package */ class RCTTextInlineImage extends FlatTextShadowNode {\n\n  private InlineImageSpanWithPipeline mInlineImageSpan = new InlineImageSpanWithPipeline();\n\n  @Override\n  public void setStyleWidth(float width) {\n    super.setStyleWidth(width);\n\n    if (mInlineImageSpan.getWidth() != width) {\n      getMutableSpan().setWidth(width);\n      notifyChanged(true);\n    }\n  }\n\n  @Override\n  public void setStyleHeight(float height) {\n    super.setStyleHeight(height);\n\n    if (mInlineImageSpan.getHeight() != height) {\n      getMutableSpan().setHeight(height);\n      notifyChanged(true);\n    }\n  }\n\n  @Override\n  protected void performCollectText(SpannableStringBuilder builder) {\n    builder.append(\"I\");\n  }\n\n  @Override\n  protected void performApplySpans(\n      SpannableStringBuilder builder,\n      int begin,\n      int end,\n      boolean isEditable) {\n    mInlineImageSpan.freeze();\n    builder.setSpan(\n        mInlineImageSpan,\n        begin,\n        end,\n        Spanned.SPAN_INCLUSIVE_EXCLUSIVE);\n  }\n\n  @Override\n  protected void performCollectAttachDetachListeners(StateBuilder stateBuilder) {\n    // mInlineImageSpan should already be frozen so no need to freeze it again\n    stateBuilder.addAttachDetachListener(mInlineImageSpan);\n  }\n\n  @ReactProp(name = \"src\")\n  public void setSource(@Nullable ReadableArray sources) {\n    final String source =\n        (sources == null || sources.size() == 0) ? null : sources.getMap(0).getString(\"uri\");\n    final ImageSource imageSource = source == null ? null :\n        new ImageSource(getThemedContext(), source);\n    getMutableSpan().setImageRequest(imageSource == null ? null :\n        ImageRequestBuilder.newBuilderWithSource(imageSource.getUri()).build());\n  }\n\n  private InlineImageSpanWithPipeline getMutableSpan() {\n    if (mInlineImageSpan.isFrozen()) {\n      mInlineImageSpan = mInlineImageSpan.mutableCopy();\n    }\n    return mInlineImageSpan;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextInlineImageManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\n/**\n * ViewManager that creates instances of RCTTextInlineImage.\n */\npublic final class RCTTextInlineImageManager extends VirtualViewManager<RCTTextInlineImage> {\n\n  /* package */ static final String REACT_CLASS = \"RCTTextInlineImage\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public RCTTextInlineImage createShadowNodeInstance() {\n    return new RCTTextInlineImage();\n  }\n\n  @Override\n  public Class<RCTTextInlineImage> getShadowNodeClass() {\n    return RCTTextInlineImage.class;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextInput.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport static com.facebook.react.views.text.ReactRawTextShadowNode.PROP_TEXT;\nimport static com.facebook.react.views.text.ReactTextShadowNode.UNSET;\n\nimport android.annotation.TargetApi;\nimport android.os.Build;\nimport android.text.SpannableStringBuilder;\nimport android.util.TypedValue;\nimport android.view.ViewGroup;\nimport android.widget.EditText;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIViewOperationQueue;\nimport com.facebook.react.uimanager.ViewDefaults;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.views.text.ReactTextUpdate;\nimport com.facebook.react.views.view.MeasureUtil;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaMeasureMode;\nimport com.facebook.yoga.YogaMeasureOutput;\nimport com.facebook.yoga.YogaNode;\nimport javax.annotation.Nullable;\n\npublic class RCTTextInput extends RCTVirtualText implements AndroidView, YogaMeasureFunction {\n\n  @Nullable private String mText;\n  private int mJsEventCount = UNSET;\n  private boolean mPaddingChanged = false;\n  private int mNumberOfLines = UNSET;\n  private @Nullable EditText mEditText;\n\n  public RCTTextInput() {\n    forceMountToView();\n    setMeasureFunction(this);\n  }\n\n  @Override\n  protected void notifyChanged(boolean shouldRemeasure) {\n    super.notifyChanged(shouldRemeasure);\n    // needed to trigger onCollectExtraUpdates\n    markUpdated();\n  }\n\n  @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)\n  @Override\n  public void setThemedContext(ThemedReactContext themedContext) {\n    super.setThemedContext(themedContext);\n\n    mEditText = new EditText(themedContext);\n    // This is needed to fix an android bug since 4.4.3 which will throw an NPE in measure,\n    // setting the layoutParams fixes it: https://code.google.com/p/android/issues/detail?id=75877\n    mEditText.setLayoutParams(\n        new ViewGroup.LayoutParams(\n            ViewGroup.LayoutParams.WRAP_CONTENT,\n            ViewGroup.LayoutParams.WRAP_CONTENT));\n\n    setDefaultPadding(Spacing.START, mEditText.getPaddingStart());\n    setDefaultPadding(Spacing.TOP, mEditText.getPaddingTop());\n    setDefaultPadding(Spacing.END, mEditText.getPaddingEnd());\n    setDefaultPadding(Spacing.BOTTOM, mEditText.getPaddingBottom());\n    mEditText.setPadding(0, 0, 0, 0);\n  }\n\n  @Override\n  public long measure(\n      YogaNode node,\n      float width,\n      YogaMeasureMode widthMode,\n      float height,\n      YogaMeasureMode heightMode) {\n    // measure() should never be called before setThemedContext()\n    EditText editText = Assertions.assertNotNull(mEditText);\n\n    int fontSize = getFontSize();\n    editText.setTextSize(\n        TypedValue.COMPLEX_UNIT_PX,\n        fontSize == UNSET ?\n            (int) Math.ceil(PixelUtil.toPixelFromSP(ViewDefaults.FONT_SIZE_SP)) : fontSize);\n\n    if (mNumberOfLines != UNSET) {\n      editText.setLines(mNumberOfLines);\n    }\n\n    editText.measure(\n        MeasureUtil.getMeasureSpec(width, widthMode),\n        MeasureUtil.getMeasureSpec(height, heightMode));\n    return YogaMeasureOutput.make(editText.getMeasuredWidth(), editText.getMeasuredHeight());\n  }\n\n  @Override\n  public boolean isVirtual() {\n    return false;\n  }\n\n  @Override\n  public boolean isVirtualAnchor() {\n    return true;\n  }\n\n  @Override\n  public void setBackgroundColor(int backgroundColor) {\n    // suppress, this is handled by a ViewManager\n  }\n\n  @Override\n  public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {\n    super.onCollectExtraUpdates(uiViewOperationQueue);\n    if (mJsEventCount != UNSET) {\n      ReactTextUpdate reactTextUpdate =\n          new ReactTextUpdate(\n              getText(),\n              mJsEventCount,\n              false,\n              getPadding(Spacing.START),\n              getPadding(Spacing.TOP),\n              getPadding(Spacing.END),\n              getPadding(Spacing.BOTTOM),\n              UNSET);\n      // TODO: the Float.NaN should be replaced with the real line height see D3592781\n      uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), reactTextUpdate);\n    }\n  }\n\n  @ReactProp(name = \"mostRecentEventCount\")\n  public void setMostRecentEventCount(int mostRecentEventCount) {\n    mJsEventCount = mostRecentEventCount;\n  }\n\n  @ReactProp(name = ViewProps.NUMBER_OF_LINES, defaultInt = Integer.MAX_VALUE)\n  public void setNumberOfLines(int numberOfLines) {\n    mNumberOfLines = numberOfLines;\n    notifyChanged(true);\n  }\n\n  @ReactProp(name = PROP_TEXT)\n  public void setText(@Nullable String text) {\n    mText = text;\n    notifyChanged(true);\n  }\n\n  @Override\n  public void setPadding(int spacingType, float padding) {\n    super.setPadding(spacingType, padding);\n    mPaddingChanged = true;\n    dirty();\n  }\n\n  @Override\n  public boolean isPaddingChanged() {\n    return mPaddingChanged;\n  }\n\n  @Override\n  public void resetPaddingChanged() {\n    mPaddingChanged = false;\n  }\n\n  @Override\n  boolean shouldAllowEmptySpans() {\n    return true;\n  }\n\n  @Override\n  boolean isEditable() {\n    return true;\n  }\n\n  @Override\n  protected void performCollectText(SpannableStringBuilder builder) {\n    if (mText != null) {\n      builder.append(mText);\n    }\n    super.performCollectText(builder);\n  }\n\n  @Override\n  public boolean needsCustomLayoutForChildren() {\n    return false;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextInputManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport com.facebook.react.views.textinput.ReactTextInputManager;\n\npublic class RCTTextInputManager extends ReactTextInputManager {\n\n  /* package */ static final String REACT_CLASS = ReactTextInputManager.REACT_CLASS;\n\n  @Override\n  public RCTTextInput createShadowNodeInstance() {\n    return new RCTTextInput();\n  }\n\n  @Override\n  public Class<RCTTextInput> getShadowNodeClass() {\n    return RCTTextInput.class;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\n/**\n * ViewManager that creates instances of RCTText.\n */\npublic final class RCTTextManager extends FlatViewManager {\n\n  /* package */ static final String REACT_CLASS = \"RCTText\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public RCTText createShadowNodeInstance() {\n    return new RCTText();\n  }\n\n  @Override\n  public Class<RCTText> getShadowNodeClass() {\n    return RCTText.class;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Rect;\n\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.ReactStylesDiffMap;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\n\n/**\n * Node for a react View.\n */\n/* package */ final class RCTView extends FlatShadowNode {\n  private static final int[] SPACING_TYPES = {\n      Spacing.ALL, Spacing.LEFT, Spacing.RIGHT, Spacing.TOP, Spacing.BOTTOM,\n  };\n\n  private @Nullable DrawBorder mDrawBorder;\n\n  boolean mRemoveClippedSubviews;\n  boolean mHorizontal;\n\n  private @Nullable Rect mHitSlop;\n\n  @Override\n  /* package */ void handleUpdateProperties(ReactStylesDiffMap styles) {\n    mRemoveClippedSubviews = mRemoveClippedSubviews ||\n        (styles.hasKey(PROP_REMOVE_CLIPPED_SUBVIEWS) &&\n            styles.getBoolean(PROP_REMOVE_CLIPPED_SUBVIEWS, false));\n\n    if (mRemoveClippedSubviews) {\n      mHorizontal = mHorizontal ||\n          (styles.hasKey(PROP_HORIZONTAL) && styles.getBoolean(PROP_HORIZONTAL, false));\n    }\n\n    super.handleUpdateProperties(styles);\n  }\n\n  @Override\n  protected void collectState(\n      StateBuilder stateBuilder,\n      float left,\n      float top,\n      float right,\n      float bottom,\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom) {\n    super.collectState(\n        stateBuilder,\n        left,\n        top,\n        right,\n        bottom,\n        clipLeft,\n        clipTop,\n        clipRight,\n        clipBottom);\n\n    if (mDrawBorder != null) {\n      mDrawBorder = (DrawBorder) mDrawBorder.updateBoundsAndFreeze(\n          left,\n          top,\n          right,\n          bottom,\n          clipLeft,\n          clipTop,\n          clipRight,\n          clipBottom);\n      stateBuilder.addDrawCommand(mDrawBorder);\n    }\n  }\n\n  @Override\n  boolean doesDraw() {\n    return mDrawBorder != null || super.doesDraw();\n  }\n\n  @Override\n  public void setBackgroundColor(int backgroundColor) {\n    getMutableBorder().setBackgroundColor(backgroundColor);\n  }\n\n  @Override\n  public void setBorderWidths(int index, float borderWidth) {\n    super.setBorderWidths(index, borderWidth);\n\n    int type = SPACING_TYPES[index];\n    getMutableBorder().setBorderWidth(type, PixelUtil.toPixelFromDIP(borderWidth));\n  }\n\n  @ReactProp(name = \"nativeBackgroundAndroid\")\n  public void setHotspot(@Nullable ReadableMap bg) {\n    if (bg != null) {\n      forceMountToView();\n    }\n  }\n\n  @ReactPropGroup(names = {\n      \"borderColor\", \"borderLeftColor\", \"borderRightColor\", \"borderTopColor\", \"borderBottomColor\"\n  }, customType = \"Color\", defaultDouble = Double.NaN)\n  public void setBorderColor(int index, double color) {\n    int type = SPACING_TYPES[index];\n    if (Double.isNaN(color)) {\n      getMutableBorder().resetBorderColor(type);\n    } else {\n      getMutableBorder().setBorderColor(type, (int) color);\n    }\n  }\n\n  @ReactProp(name = \"borderRadius\")\n  public void setBorderRadius(float borderRadius) {\n    mClipRadius = borderRadius;\n    if (mClipToBounds && borderRadius > DrawView.MINIMUM_ROUNDED_CLIPPING_VALUE) {\n      // mount to a view if we are overflow: hidden and are clipping, so that we can do one\n      // clipPath to clip all the children of this node (both DrawCommands and Views).\n      forceMountToView();\n    }\n    getMutableBorder().setBorderRadius(PixelUtil.toPixelFromDIP(borderRadius));\n  }\n\n  @ReactProp(name = \"borderStyle\")\n  public void setBorderStyle(@Nullable String borderStyle) {\n    getMutableBorder().setBorderStyle(borderStyle);\n  }\n\n  @ReactProp(name = \"hitSlop\")\n  public void setHitSlop(@Nullable ReadableMap hitSlop) {\n    if (hitSlop == null) {\n      mHitSlop = null;\n    } else {\n      mHitSlop = new Rect(\n          (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"left\")),\n          (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"top\")),\n          (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"right\")),\n          (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"bottom\")));\n    }\n  }\n\n  @ReactProp(name = \"pointerEvents\")\n  public void setPointerEvents(@Nullable String pointerEventsStr) {\n    forceMountToView();\n  }\n\n  @Override\n  /* package */ void updateNodeRegion(\n      float left,\n      float top,\n      float right,\n      float bottom,\n      boolean isVirtual) {\n    if (!getNodeRegion().matches(left, top, right, bottom, isVirtual)) {\n      setNodeRegion(mHitSlop == null ?\n          new NodeRegion(left, top, right, bottom, getReactTag(), isVirtual) :\n          new HitSlopNodeRegion(mHitSlop, left, top, right, bottom, getReactTag(), isVirtual));\n    }\n  }\n\n  private DrawBorder getMutableBorder() {\n    if (mDrawBorder == null) {\n      mDrawBorder = new DrawBorder();\n    } else if (mDrawBorder.isFrozen()) {\n      mDrawBorder = (DrawBorder) mDrawBorder.mutableCopy();\n    }\n    invalidate();\n    return mDrawBorder;\n  }\n\n  @Override\n  public boolean clipsSubviews() {\n    return mRemoveClippedSubviews;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.graphics.Rect;\nimport android.os.Build;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.PointerEvents;\nimport com.facebook.react.uimanager.ReactClippingViewGroupHelper;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.views.view.ReactDrawableHelper;\n\nimport javax.annotation.Nullable;\nimport java.util.Map;\n\n/**\n * ViewManager that creates instances of RCTView.\n */\npublic final class RCTViewManager extends FlatViewManager {\n\n  /* package */ static final String REACT_CLASS = ViewProps.VIEW_CLASS_NAME;\n\n  private static final int[] TMP_INT_ARRAY = new int[2];\n\n  private static final int CMD_HOTSPOT_UPDATE = 1;\n  private static final int CMD_SET_PRESSED = 2;\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  public Map<String, Integer> getCommandsMap() {\n    return MapBuilder.of(\"hotspotUpdate\", CMD_HOTSPOT_UPDATE, \"setPressed\", CMD_SET_PRESSED);\n  }\n\n  @Override\n  public RCTView createShadowNodeInstance() {\n    return new RCTView();\n  }\n\n  @Override\n  public Class<RCTView> getShadowNodeClass() {\n    return RCTView.class;\n  }\n\n  @ReactProp(name = \"nativeBackgroundAndroid\")\n  public void setHotspot(FlatViewGroup view, @Nullable ReadableMap bg) {\n    view.setHotspot(bg == null ?\n      null : ReactDrawableHelper.createDrawableFromJSDescription(view.getContext(), bg));\n  }\n\n  @Override\n  public void receiveCommand(\n    FlatViewGroup view,\n    int commandId,\n    @Nullable ReadableArray args) {\n    switch (commandId) {\n      case CMD_HOTSPOT_UPDATE: {\n        if (args == null || args.size() != 2) {\n          throw new JSApplicationIllegalArgumentException(\n            \"Illegal number of arguments for 'updateHotspot' command\");\n        }\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n          view.getLocationOnScreen(TMP_INT_ARRAY);\n          float x = PixelUtil.toPixelFromDIP(args.getDouble(0)) - TMP_INT_ARRAY[0];\n          float y = PixelUtil.toPixelFromDIP(args.getDouble(1)) - TMP_INT_ARRAY[1];\n          view.drawableHotspotChanged(x, y);\n        }\n        break;\n      }\n      case CMD_SET_PRESSED: {\n        if (args == null || args.size() != 1) {\n          throw new JSApplicationIllegalArgumentException(\n            \"Illegal number of arguments for 'setPressed' command\");\n        }\n        view.setPressed(args.getBoolean(0));\n        break;\n      }\n    }\n  }\n\n  @ReactProp(name = ViewProps.NEEDS_OFFSCREEN_ALPHA_COMPOSITING)\n  public void setNeedsOffscreenAlphaCompositing(\n    FlatViewGroup view,\n    boolean needsOffscreenAlphaCompositing) {\n    view.setNeedsOffscreenAlphaCompositing(needsOffscreenAlphaCompositing);\n  }\n\n  @ReactProp(name = \"pointerEvents\")\n  public void setPointerEvents(FlatViewGroup view, @Nullable String pointerEventsStr) {\n    view.setPointerEvents(parsePointerEvents(pointerEventsStr));\n  }\n\n  @ReactProp(name = ReactClippingViewGroupHelper.PROP_REMOVE_CLIPPED_SUBVIEWS)\n  public void setRemoveClippedSubviews(FlatViewGroup view, boolean removeClippedSubviews) {\n    view.setRemoveClippedSubviews(removeClippedSubviews);\n  }\n\n  private static PointerEvents parsePointerEvents(@Nullable String pointerEventsStr) {\n    if (pointerEventsStr != null) {\n      switch (pointerEventsStr) {\n        case \"none\":\n          return PointerEvents.NONE;\n        case \"auto\":\n          return PointerEvents.AUTO;\n        case \"box-none\":\n          return PointerEvents.BOX_NONE;\n        case \"box-only\":\n          return PointerEvents.BOX_ONLY;\n      }\n    }\n    // default or invalid\n    return PointerEvents.AUTO;\n  }\n\n  @ReactProp(name = \"hitSlop\")\n  public void setHitSlop(FlatViewGroup view, @Nullable ReadableMap hitSlop) {\n    if (hitSlop == null) {\n      view.setHitSlopRect(null);\n    } else {\n      view.setHitSlopRect(new Rect(\n        (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"left\")),\n        (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"top\")),\n        (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"right\")),\n        (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"bottom\"))\n      ));\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTViewPagerManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.view.View;\nimport com.facebook.react.views.viewpager.ReactViewPager;\nimport com.facebook.react.views.viewpager.ReactViewPagerManager;\n\nimport java.util.List;\n\npublic class RCTViewPagerManager extends ReactViewPagerManager {\n\n  /* package */ static final String REACT_CLASS = ReactViewPagerManager.REACT_CLASS;\n\n  @Override\n  public void addViews(ReactViewPager parent, List<View> views) {\n    parent.setViews(views);\n  }\n\n  @Override\n  public void removeAllViews(ReactViewPager parent) {\n    parent.removeAllViewsFromAdapter();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTVirtualText.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.graphics.Typeface;\nimport android.text.Spannable;\nimport android.text.SpannableStringBuilder;\nimport android.text.TextUtils;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.ReactShadowNodeImpl;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport javax.annotation.Nullable;\n\n/**\n * RCTVirtualText is a {@link FlatTextShadowNode} that can contain font styling information.\n */\n/* package */ class RCTVirtualText extends FlatTextShadowNode {\n\n  private static final String BOLD = \"bold\";\n  private static final String ITALIC = \"italic\";\n  private static final String NORMAL = \"normal\";\n\n  private static final String PROP_SHADOW_OFFSET = \"textShadowOffset\";\n  private static final String PROP_SHADOW_RADIUS = \"textShadowRadius\";\n  private static final String PROP_SHADOW_COLOR = \"textShadowColor\";\n  private static final int DEFAULT_TEXT_SHADOW_COLOR = 0x55000000;\n\n  private FontStylingSpan mFontStylingSpan = FontStylingSpan.INSTANCE;\n  private ShadowStyleSpan mShadowStyleSpan = ShadowStyleSpan.INSTANCE;\n\n  @Override\n  public void addChildAt(ReactShadowNodeImpl child, int i) {\n    super.addChildAt(child, i);\n    notifyChanged(true);\n  }\n\n  @Override\n  protected void performCollectText(SpannableStringBuilder builder) {\n    for (int i = 0, childCount = getChildCount(); i < childCount; ++i) {\n      FlatTextShadowNode child = (FlatTextShadowNode) getChildAt(i);\n      child.collectText(builder);\n    }\n  }\n\n  @Override\n  protected void performApplySpans(SpannableStringBuilder builder, int begin, int end, boolean isEditable) {\n    mFontStylingSpan.freeze();\n\n    // All spans will automatically extend to the right of the text, but not the left - except\n    // for spans that start at the beginning of the text.\n    final int flag;\n    if (isEditable) {\n      flag = Spannable.SPAN_EXCLUSIVE_EXCLUSIVE;\n    } else {\n      flag = begin == 0 ?\n          Spannable.SPAN_INCLUSIVE_INCLUSIVE :\n          Spannable.SPAN_EXCLUSIVE_INCLUSIVE;\n    }\n\n    builder.setSpan(\n        mFontStylingSpan,\n        begin,\n        end,\n        flag);\n\n    if (mShadowStyleSpan.getColor() != 0 && mShadowStyleSpan.getRadius() != 0) {\n      mShadowStyleSpan.freeze();\n\n      builder.setSpan(\n          mShadowStyleSpan,\n          begin,\n          end,\n          flag);\n    }\n\n    for (int i = 0, childCount = getChildCount(); i < childCount; ++i) {\n      FlatTextShadowNode child = (FlatTextShadowNode) getChildAt(i);\n      child.applySpans(builder, isEditable);\n    }\n  }\n\n  @Override\n  protected void performCollectAttachDetachListeners(StateBuilder stateBuilder) {\n    for (int i = 0, childCount = getChildCount(); i < childCount; ++i) {\n      FlatTextShadowNode child = (FlatTextShadowNode) getChildAt(i);\n      child.performCollectAttachDetachListeners(stateBuilder);\n    }\n  }\n\n  @ReactProp(name = ViewProps.FONT_SIZE, defaultFloat = Float.NaN)\n  public void setFontSize(float fontSizeSp) {\n    final int fontSize;\n    if (Float.isNaN(fontSizeSp)) {\n      fontSize = getDefaultFontSize();\n    } else {\n      fontSize = fontSizeFromSp(fontSizeSp);\n    }\n\n    if (mFontStylingSpan.getFontSize() != fontSize) {\n      getSpan().setFontSize(fontSize);\n      notifyChanged(true);\n    }\n  }\n\n  @ReactProp(name = ViewProps.COLOR, defaultDouble = Double.NaN)\n  public void setColor(double textColor) {\n    if (mFontStylingSpan.getTextColor() != textColor) {\n      getSpan().setTextColor(textColor);\n      notifyChanged(false);\n    }\n  }\n\n  @Override\n  public void setBackgroundColor(int backgroundColor) {\n    if (isVirtual()) {\n      // for nested Text elements, we want to apply background color to the text only\n      // e.g. Hello <style backgroundColor=red>World</style>, \"World\" will have red background color\n      if (mFontStylingSpan.getBackgroundColor() != backgroundColor) {\n        getSpan().setBackgroundColor(backgroundColor);\n        notifyChanged(false);\n      }\n    } else {\n      // for top-level Text element, background needs to be applied for the entire shadow node\n      //\n      // For example: <Text style={flex:1}>Hello World</Text>\n      // \"Hello World\" may only occupy e.g. 200 pixels, but the node may be measured at e.g. 500px.\n      // In this case, we want background to be 500px wide as well, and this is exactly what\n      // FlatShadowNode does.\n      super.setBackgroundColor(backgroundColor);\n    }\n  }\n\n  @ReactProp(name = ViewProps.FONT_FAMILY)\n  public void setFontFamily(@Nullable String fontFamily) {\n    if (!TextUtils.equals(mFontStylingSpan.getFontFamily(), fontFamily)) {\n      getSpan().setFontFamily(fontFamily);\n      notifyChanged(true);\n    }\n  }\n\n  @ReactProp(name = ViewProps.FONT_WEIGHT)\n  public void setFontWeight(@Nullable String fontWeightString) {\n    final int fontWeight;\n    if (fontWeightString == null) {\n      fontWeight = -1;\n    } else if (BOLD.equals(fontWeightString)) {\n      fontWeight = Typeface.BOLD;\n    } else if (NORMAL.equals(fontWeightString)) {\n      fontWeight = Typeface.NORMAL;\n    } else {\n      int fontWeightNumeric = parseNumericFontWeight(fontWeightString);\n      if (fontWeightNumeric == -1) {\n        throw new RuntimeException(\"invalid font weight \" + fontWeightString);\n      }\n      fontWeight = fontWeightNumeric >= 500 ? Typeface.BOLD : Typeface.NORMAL;\n    }\n\n    if (mFontStylingSpan.getFontWeight() != fontWeight) {\n      getSpan().setFontWeight(fontWeight);\n      notifyChanged(true);\n    }\n  }\n\n  @ReactProp(name = ViewProps.TEXT_DECORATION_LINE)\n  public void setTextDecorationLine(@Nullable String textDecorationLineString) {\n    boolean isUnderlineTextDecorationSet = false;\n    boolean isLineThroughTextDecorationSet = false;\n    if (textDecorationLineString != null) {\n      for (String textDecorationLineSubString : textDecorationLineString.split(\" \")) {\n        if (\"underline\".equals(textDecorationLineSubString)) {\n          isUnderlineTextDecorationSet = true;\n        } else if (\"line-through\".equals(textDecorationLineSubString)) {\n          isLineThroughTextDecorationSet = true;\n        }\n      }\n    }\n\n    if (isUnderlineTextDecorationSet != mFontStylingSpan.hasUnderline() ||\n        isLineThroughTextDecorationSet != mFontStylingSpan.hasStrikeThrough()) {\n      FontStylingSpan span = getSpan();\n      span.setHasUnderline(isUnderlineTextDecorationSet);\n      span.setHasStrikeThrough(isLineThroughTextDecorationSet);\n      notifyChanged(true);\n    }\n  }\n\n  @ReactProp(name = ViewProps.FONT_STYLE)\n  public void setFontStyle(@Nullable String fontStyleString) {\n    final int fontStyle;\n    if (fontStyleString == null) {\n      fontStyle = -1;\n    } else if (ITALIC.equals(fontStyleString)) {\n      fontStyle = Typeface.ITALIC;\n    } else if (NORMAL.equals(fontStyleString)) {\n      fontStyle = Typeface.NORMAL;\n    } else {\n      throw new RuntimeException(\"invalid font style \" + fontStyleString);\n    }\n\n    if (mFontStylingSpan.getFontStyle() != fontStyle) {\n      getSpan().setFontStyle(fontStyle);\n      notifyChanged(true);\n    }\n  }\n\n  @ReactProp(name = PROP_SHADOW_OFFSET)\n  public void setTextShadowOffset(@Nullable ReadableMap offsetMap) {\n    float dx = 0;\n    float dy = 0;\n    if (offsetMap != null) {\n      if (offsetMap.hasKey(\"width\")) {\n        dx = PixelUtil.toPixelFromDIP(offsetMap.getDouble(\"width\"));\n      }\n      if (offsetMap.hasKey(\"height\")) {\n        dy = PixelUtil.toPixelFromDIP(offsetMap.getDouble(\"height\"));\n      }\n    }\n\n    if (!mShadowStyleSpan.offsetMatches(dx, dy)) {\n      getShadowSpan().setOffset(dx, dy);\n      notifyChanged(false);\n    }\n  }\n\n  @ReactProp(name = PROP_SHADOW_RADIUS)\n  public void setTextShadowRadius(float textShadowRadius) {\n    textShadowRadius = PixelUtil.toPixelFromDIP(textShadowRadius);\n    if (mShadowStyleSpan.getRadius() != textShadowRadius) {\n      getShadowSpan().setRadius(textShadowRadius);\n      notifyChanged(false);\n    }\n  }\n\n  @ReactProp(name = PROP_SHADOW_COLOR, defaultInt = DEFAULT_TEXT_SHADOW_COLOR, customType = \"Color\")\n  public void setTextShadowColor(int textShadowColor) {\n    if (mShadowStyleSpan.getColor() != textShadowColor) {\n      getShadowSpan().setColor(textShadowColor);\n      notifyChanged(false);\n    }\n  }\n\n  /**\n   * Returns font size for this node.\n   * When called on RCTText, this value is never -1 (unset).\n   */\n  protected final int getFontSize() {\n    return mFontStylingSpan.getFontSize();\n  }\n  /**\n   * Returns font style for this node.\n   */\n  protected final int getFontStyle() {\n    int style = mFontStylingSpan.getFontStyle();\n    return style >= 0 ? style : Typeface.NORMAL;\n  }\n\n  protected int getDefaultFontSize() {\n    return -1;\n  }\n\n  /* package */ static int fontSizeFromSp(float sp) {\n    return (int) Math.ceil(PixelUtil.toPixelFromSP(sp));\n  }\n\n  protected final FontStylingSpan getSpan() {\n    if (mFontStylingSpan.isFrozen()) {\n      mFontStylingSpan = mFontStylingSpan.mutableCopy();\n    }\n    return mFontStylingSpan;\n  }\n\n  /**\n   * Returns a new SpannableStringBuilder that includes all the text and styling information to\n   * create the Layout.\n   */\n  /* package */ final SpannableStringBuilder getText() {\n    SpannableStringBuilder sb = new SpannableStringBuilder();\n    collectText(sb);\n    applySpans(sb, isEditable());\n    return sb;\n  }\n\n  private final ShadowStyleSpan getShadowSpan() {\n    if (mShadowStyleSpan.isFrozen()) {\n      mShadowStyleSpan = mShadowStyleSpan.mutableCopy();\n    }\n    return mShadowStyleSpan;\n  }\n\n  /**\n   * Return -1 if the input string is not a valid numeric fontWeight (100, 200, ..., 900), otherwise\n   * return the weight.\n   */\n  private static int parseNumericFontWeight(String fontWeightString) {\n    // This should be much faster than using regex to verify input and Integer.parseInt\n    return fontWeightString.length() == 3 && fontWeightString.endsWith(\"00\")\n        && fontWeightString.charAt(0) <= '9' && fontWeightString.charAt(0) >= '1' ?\n        100 * (fontWeightString.charAt(0) - '0') : -1;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/RCTVirtualTextManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\n/**\n * ViewManager that creates instances of RCTVirtualText.\n */\npublic final class RCTVirtualTextManager extends VirtualViewManager<RCTVirtualText> {\n\n  /* package */ static final String REACT_CLASS = \"RCTVirtualText\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public RCTVirtualText createShadowNodeInstance() {\n    return new RCTVirtualText();\n  }\n\n  @Override\n  public Class<RCTVirtualText> getShadowNodeClass() {\n    return RCTVirtualText.class;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/README.md",
    "content": "# Nodes\n\nNodes is an experimental, alternate version of\n[UIImplementation](https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java) for ReactNative on Android. It has two main advantages over the existing `UIImplementation`:\n\n1. Support for `overflow:visible` on Android.\n2. More efficient generation of view hierarchies.\n\nThe intention is to ultimately replace the existing `UIImplementation` on\nAndroid with Nodes (after all the issues are ironed out).\n\n## How to test\n\nIn a subclass of `ReactNativeHost`, add this:\n\n```java\n@Override\nprotected UIImplementationProvider getUIImplementationProvider() {\n  return new FlatUIImplementationProvider();\n}\n```\n\n## How it Works\n\nThe existing\n[UIImplementation](https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java) maps all non-layout tags to `View`s (resulting in an almost 1:1 mapping of tags\nto Views, with the exception of some optimizations for layout only tags that\ndon't draw content). Nodes, on the other hand, maps react tags to a set of\n`DrawCommand`s. In other words, an `<image>` tag will often be mapped to a\n`Drawable` instead of an `ImageView` and a `<text>` tag will be mapped to a\n`Layout` instead of a `TextView`. This helps flatten the resulting `View`\nhierarchy.\n\nThere are situations where `DrawCommand`s are promoted to `View`s:\n\n1. Existing Android components that are wrapped by React Native (for example, \n`ViewPager`, `ScrollView`, etc).\n2. When using a `View` is more optimal (for example, `opacity`, to avoid\nunnecessary invalidations).\n3. To facilitate the implementation of certain features (accessibility,\ntransforms, etc).\n\nThis means that existing custom `ViewManager`s should continue to work as they\ndid with the existing `UIImplementation`.\n\n## Limitations and Known Issues\n\n- `LayoutAnimation`s are not yet supported\n- `zIndex` is not yet supported\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/ShadowStyleSpan.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.text.TextPaint;\nimport android.text.style.CharacterStyle;\n\n/* package */ final class ShadowStyleSpan extends CharacterStyle {\n\n  /* package */ static final ShadowStyleSpan INSTANCE = new ShadowStyleSpan(0, 0, 0, 0, true);\n\n  private float mDx;\n  private float mDy;\n  private float mRadius;\n  private int mColor;\n  private boolean mFrozen;\n\n  private ShadowStyleSpan(float dx, float dy, float radius, int color, boolean frozen) {\n    mDx = dx;\n    mDy = dy;\n    mRadius = radius;\n    mColor = color;\n    mFrozen = frozen;\n  }\n\n  public boolean offsetMatches(float dx, float dy) {\n    return mDx == dx && mDy == dy;\n  }\n\n  public void setOffset(float dx, float dy) {\n    mDx = dx;\n    mDy = dy;\n  }\n\n  public float getRadius() {\n    return mRadius;\n  }\n\n  public void setRadius(float radius) {\n    mRadius = radius;\n  }\n\n  public int getColor() {\n    return mColor;\n  }\n\n  public void setColor(int color) {\n    mColor = color;\n  }\n\n  /* package */ ShadowStyleSpan mutableCopy() {\n    return new ShadowStyleSpan(mDx, mDy, mRadius, mColor, false);\n  }\n\n  /* package */ boolean isFrozen() {\n    return mFrozen;\n  }\n\n  /* package */ void freeze() {\n    mFrozen = true;\n  }\n\n  @Override\n  public void updateDrawState(TextPaint textPaint) {\n    textPaint.setShadowLayer(mRadius, mDx, mDy, mColor);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/StateBuilder.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport java.util.ArrayList;\n\nimport android.util.SparseIntArray;\n\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.uimanager.OnLayoutEvent;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.ReactShadowNode;\nimport com.facebook.react.uimanager.ReactStylesDiffMap;\nimport com.facebook.react.uimanager.UIViewOperationQueue;\nimport com.facebook.react.uimanager.events.EventDispatcher;\n\n/**\n * Shadow node hierarchy by itself cannot display UI, it is only a representation of what UI should\n * be from JavaScript perspective. StateBuilder is a helper class that walks the shadow node tree\n * and collects information into an operation queue that is run on the UI thread and applied to the\n * non-shadow hierarchy of Views that Android can finally display.\n */\n/* package */ final class StateBuilder {\n  /* package */ static final float[] EMPTY_FLOAT_ARRAY = new float[0];\n  /* package */ static final SparseIntArray EMPTY_SPARSE_INT = new SparseIntArray();\n\n  private static final boolean SKIP_UP_TO_DATE_NODES = true;\n\n  // Optimization to avoid re-allocating zero length arrays.\n  private static final int[] EMPTY_INT_ARRAY = new int[0];\n\n  private final FlatUIViewOperationQueue mOperationsQueue;\n\n  private final ElementsList<DrawCommand> mDrawCommands =\n      new ElementsList<>(DrawCommand.EMPTY_ARRAY);\n  private final ElementsList<AttachDetachListener> mAttachDetachListeners =\n      new ElementsList<>(AttachDetachListener.EMPTY_ARRAY);\n  private final ElementsList<NodeRegion> mNodeRegions =\n      new ElementsList<>(NodeRegion.EMPTY_ARRAY);\n  private final ElementsList<FlatShadowNode> mNativeChildren =\n      new ElementsList<>(FlatShadowNode.EMPTY_ARRAY);\n\n  private final ArrayList<FlatShadowNode> mViewsToDetachAllChildrenFrom = new ArrayList<>();\n  private final ArrayList<FlatShadowNode> mViewsToDetach = new ArrayList<>();\n  private final ArrayList<Integer> mViewsToDrop = new ArrayList<>();\n  private final ArrayList<Integer> mParentsForViewsToDrop = new ArrayList<>();\n  private final ArrayList<OnLayoutEvent> mOnLayoutEvents = new ArrayList<>();\n  private final ArrayList<UIViewOperationQueue.UIOperation> mUpdateViewBoundsOperations =\n      new ArrayList<>();\n  private final ArrayList<UIViewOperationQueue.UIOperation> mViewManagerCommands =\n      new ArrayList<>();\n\n  private @Nullable FlatUIViewOperationQueue.DetachAllChildrenFromViews mDetachAllChildrenFromViews;\n\n  /* package */ StateBuilder(FlatUIViewOperationQueue operationsQueue) {\n    mOperationsQueue = operationsQueue;\n  }\n\n  /* package */ FlatUIViewOperationQueue getOperationsQueue() {\n    return mOperationsQueue;\n  }\n\n  /**\n   * Given a root of the laid-out shadow node hierarchy, walks the tree and generates arrays from\n   * element lists that are mounted in the UI thread to FlatViewGroups to handle drawing, touch,\n   * and other logic.\n   */\n  /* package */ void applyUpdates(FlatShadowNode node) {\n    float width = node.getLayoutWidth();\n    float height = node.getLayoutHeight();\n    float left = node.getLayoutX();\n    float top = node.getLayoutY();\n    float right = left + width;\n    float bottom = top + height;\n\n    collectStateForMountableNode(\n        node,\n        left,\n        top,\n        right,\n        bottom,\n        Float.NEGATIVE_INFINITY,\n        Float.NEGATIVE_INFINITY,\n        Float.POSITIVE_INFINITY,\n        Float.POSITIVE_INFINITY);\n\n    updateViewBounds(node, left, top, right, bottom);\n  }\n\n  /**\n   * Run after the shadow node hierarchy is updated.  Detaches all children from Views that are\n   * changing their native children, updates views, and dispatches commands before discarding any\n   * dropped views.\n   *\n   * @param eventDispatcher Dispatcher for onLayout events.\n   */\n  void afterUpdateViewHierarchy(EventDispatcher eventDispatcher) {\n    if (mDetachAllChildrenFromViews != null) {\n      int[] viewsToDetachAllChildrenFrom = collectViewTags(mViewsToDetachAllChildrenFrom);\n      mViewsToDetachAllChildrenFrom.clear();\n\n      mDetachAllChildrenFromViews.setViewsToDetachAllChildrenFrom(viewsToDetachAllChildrenFrom);\n      mDetachAllChildrenFromViews = null;\n    }\n\n    for (int i = 0, size = mUpdateViewBoundsOperations.size(); i != size; ++i) {\n      mOperationsQueue.enqueueFlatUIOperation(mUpdateViewBoundsOperations.get(i));\n    }\n    mUpdateViewBoundsOperations.clear();\n\n    // Process view manager commands after bounds operations, so that any UI operations have already\n    // happened before we actually dispatch the view manager command.  This prevents things like\n    // commands going to empty parents and views not yet being created.\n    for (int i = 0, size = mViewManagerCommands.size(); i != size; i++) {\n      mOperationsQueue.enqueueFlatUIOperation(mViewManagerCommands.get(i));\n    }\n    mViewManagerCommands.clear();\n\n    // This could be more efficient if EventDispatcher had a batch mode\n    // to avoid multiple synchronized calls.\n    for (int i = 0, size = mOnLayoutEvents.size(); i != size; ++i) {\n      eventDispatcher.dispatchEvent(mOnLayoutEvents.get(i));\n    }\n    mOnLayoutEvents.clear();\n\n    if (mViewsToDrop.size() > 0) {\n      mOperationsQueue.enqueueDropViews(mViewsToDrop, mParentsForViewsToDrop);\n      mViewsToDrop.clear();\n      mParentsForViewsToDrop.clear();\n    }\n\n    mOperationsQueue.enqueueProcessLayoutRequests();\n  }\n\n  /* package */ void removeRootView(int rootViewTag) {\n    // Note root view tags with a negative value.\n    mViewsToDrop.add(-rootViewTag);\n    mParentsForViewsToDrop.add(-1);\n  }\n\n  /**\n   * Adds a draw command to the element list for the current scope.  Allows collectState within the\n   * shadow node to add commands.\n   *\n   * @param drawCommand The draw command to add.\n   */\n  /* package */ void addDrawCommand(AbstractDrawCommand drawCommand) {\n    mDrawCommands.add(drawCommand);\n  }\n\n  /**\n   * Adds a listener to the element list for the current scope.  Allows collectState within the\n   * shadow node to add listeners.\n   *\n   * @param listener The listener to add\n   */\n  /* package */ void addAttachDetachListener(AttachDetachListener listener) {\n    mAttachDetachListeners.add(listener);\n  }\n\n  /**\n   * Adds a command for a view manager to the queue.  We have to delay adding it to the operations\n   * queue until we have added our view moves, creations and updates.\n   *\n   * @param reactTag The react tag of the command target.\n   * @param commandId ID of the command.\n   * @param commandArgs Arguments for the command.\n   */\n  /* package */ void enqueueViewManagerCommand(\n      int reactTag,\n      int commandId,\n      ReadableArray commandArgs) {\n    mViewManagerCommands.add(\n        mOperationsQueue.createViewManagerCommand(reactTag, commandId, commandArgs));\n  }\n\n  /**\n   * Create a backing view for a node, or update the backing view if it has already been created.\n   *\n   * @param node The node to create the backing view for.\n   * @param styles Styles for the view.\n   */\n  /* package */ void enqueueCreateOrUpdateView(\n      FlatShadowNode node,\n      @Nullable ReactStylesDiffMap styles) {\n    if (node.isBackingViewCreated()) {\n      // If the View is already created, make sure to propagate the new styles.\n      mOperationsQueue.enqueueUpdateProperties(\n          node.getReactTag(),\n          node.getViewClass(),\n          styles);\n    } else {\n      mOperationsQueue.enqueueCreateView(\n          node.getThemedContext(),\n          node.getReactTag(),\n          node.getViewClass(),\n          styles);\n\n      node.signalBackingViewIsCreated();\n    }\n  }\n\n  /**\n   * Create a backing view for a node if not already created.\n   *\n   * @param node The node to create the backing view for.\n   */\n  /* package */ void ensureBackingViewIsCreated(FlatShadowNode node) {\n    if (node.isBackingViewCreated()) {\n      return;\n    }\n\n    int tag = node.getReactTag();\n    mOperationsQueue.enqueueCreateView(node.getThemedContext(), tag, node.getViewClass(), null);\n\n    node.signalBackingViewIsCreated();\n  }\n\n  /**\n   * Enqueue dropping of the view for a node that has a backing view.  Used in conjunction with\n   * remove the node from the shadow hierarchy.\n   *\n   * @param node The node to drop the backing view for.\n   */\n  /* package */ void dropView(FlatShadowNode node, int parentReactTag) {\n    mViewsToDrop.add(node.getReactTag());\n    mParentsForViewsToDrop.add(parentReactTag);\n  }\n\n  /**\n   * Adds a node region to the element list for the current scope.  Allows collectState to add\n   * regions.\n   *\n   * @param node The node to add a region for.\n   * @param left Bound of the region.\n   * @param top Bound of the region.\n   * @param right Bound of the region.\n   * @param bottom Bound of the region.\n   * @param isVirtual True if the region does not map to a native view.  Used to determine touch\n   *   targets.\n   */\n  private void addNodeRegion(\n      FlatShadowNode node,\n      float left,\n      float top,\n      float right,\n      float bottom,\n      boolean isVirtual) {\n    if (left == right || top == bottom) {\n      // no point in adding an empty NodeRegion\n      return;\n    }\n\n    node.updateNodeRegion(left, top, right, bottom, isVirtual);\n    if (node.doesDraw()) {\n      mNodeRegions.add(node.getNodeRegion());\n    }\n  }\n\n  /**\n   * Adds a native child to the element list for the current scope.  Allows collectState to add\n   * native children.\n   *\n   * @param nativeChild The view-backed native child to add.\n   */\n  private void addNativeChild(FlatShadowNode nativeChild) {\n    mNativeChildren.add(nativeChild);\n  }\n\n  /**\n   * Updates boundaries of a View that a give nodes maps to.\n   */\n  private void updateViewBounds(\n      FlatShadowNode node,\n      float left,\n      float top,\n      float right,\n      float bottom) {\n    int viewLeft = Math.round(left);\n    int viewTop = Math.round(top);\n    int viewRight = Math.round(right);\n    int viewBottom = Math.round(bottom);\n    if (node.getViewLeft() == viewLeft && node.getViewTop() == viewTop &&\n        node.getViewRight() == viewRight && node.getViewBottom() == viewBottom) {\n      // nothing changed.\n      return;\n    }\n\n    // this will optionally measure and layout the View this node maps to.\n    node.setViewBounds(viewLeft, viewTop, viewRight, viewBottom);\n    int tag = node.getReactTag();\n\n    mUpdateViewBoundsOperations.add(\n        mOperationsQueue.createUpdateViewBounds(tag, viewLeft, viewTop, viewRight, viewBottom));\n  }\n\n  /**\n   * Collects state (Draw commands, listeners, regions, native children) for a given node that will\n   * mount to a View. Returns true if this node or any of its descendants that mount to View\n   * generated any updates.\n   */\n  private boolean collectStateForMountableNode(\n      FlatShadowNode node,\n      float left,\n      float top,\n      float right,\n      float bottom,\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom) {\n    boolean hasUpdates = node.hasNewLayout();\n\n    boolean expectingUpdate = hasUpdates || node.isUpdated() || node.hasUnseenUpdates() ||\n        node.clipBoundsChanged(clipLeft, clipTop, clipRight, clipBottom);\n    if (SKIP_UP_TO_DATE_NODES && !expectingUpdate) {\n      return false;\n    }\n\n    node.setClipBounds(clipLeft, clipTop, clipRight, clipBottom);\n\n    mDrawCommands.start(node.getDrawCommands());\n    mAttachDetachListeners.start(node.getAttachDetachListeners());\n    mNodeRegions.start(node.getNodeRegions());\n    mNativeChildren.start(node.getNativeChildren());\n\n    boolean isAndroidView = false;\n    boolean needsCustomLayoutForChildren = false;\n    if (node instanceof AndroidView) {\n      AndroidView androidView = (AndroidView) node;\n      updateViewPadding(androidView, node.getReactTag());\n\n      isAndroidView = true;\n      needsCustomLayoutForChildren = androidView.needsCustomLayoutForChildren();\n\n      // AndroidView might scroll (e.g. ScrollView) so we need to reset clip bounds here\n      // Otherwise, we might scroll clipped content. If AndroidView doesn't scroll, this is still\n      // harmless, because AndroidView will do its own clipping anyway.\n      clipLeft = Float.NEGATIVE_INFINITY;\n      clipTop = Float.NEGATIVE_INFINITY;\n      clipRight = Float.POSITIVE_INFINITY;\n      clipBottom = Float.POSITIVE_INFINITY;\n    }\n\n    if (!isAndroidView && node.isVirtualAnchor()) {\n      // If RCTText is mounted to View, virtual children will not receive any touch events\n      // because they don't get added to nodeRegions, so nodeRegions will be empty and\n      // FlatViewGroup.reactTagForTouch() will always return RCTText's id. To fix the issue,\n      // manually add nodeRegion so it will have exactly one NodeRegion, and virtual nodes will\n      // be able to receive touch events.\n      addNodeRegion(node, left, top, right, bottom, true);\n    }\n\n    boolean descendantUpdated = collectStateRecursively(\n        node,\n        left,\n        top,\n        right,\n        bottom,\n        clipLeft,\n        clipTop,\n        clipRight,\n        clipBottom,\n        isAndroidView,\n        needsCustomLayoutForChildren);\n\n    boolean shouldUpdateMountState = false;\n    final DrawCommand[] drawCommands = mDrawCommands.finish();\n    if (drawCommands != null) {\n      shouldUpdateMountState = true;\n      node.setDrawCommands(drawCommands);\n    }\n\n    final AttachDetachListener[] listeners = mAttachDetachListeners.finish();\n    if (listeners != null) {\n      shouldUpdateMountState = true;\n      node.setAttachDetachListeners(listeners);\n    }\n\n    final NodeRegion[] nodeRegions = mNodeRegions.finish();\n    if (nodeRegions != null) {\n      shouldUpdateMountState = true;\n      node.setNodeRegions(nodeRegions);\n    } else if (descendantUpdated) {\n      // one of the descendant's value for overflows container may have changed, so\n      // we still need to update ours.\n      node.updateOverflowsContainer();\n    }\n\n    // We need to finish the native children so that we can process clipping FlatViewGroup.\n    final FlatShadowNode[] nativeChildren = mNativeChildren.finish();\n    if (shouldUpdateMountState) {\n      if (node.clipsSubviews()) {\n        // Node is a clipping FlatViewGroup, so lets do some calculations off the UI thread.\n        // DrawCommandManager has a better explanation of the data incoming from these calculations,\n        // and is where they are actually used.\n        float[] commandMaxBottom = EMPTY_FLOAT_ARRAY;\n        float[] commandMinTop = EMPTY_FLOAT_ARRAY;\n        SparseIntArray drawViewIndexMap = EMPTY_SPARSE_INT;\n        if (drawCommands != null) {\n          drawViewIndexMap = new SparseIntArray();\n\n          commandMaxBottom = new float[drawCommands.length];\n          commandMinTop = new float[drawCommands.length];\n\n          if (node.isHorizontal()) {\n            HorizontalDrawCommandManager\n                .fillMaxMinArrays(drawCommands, commandMaxBottom, commandMinTop, drawViewIndexMap);\n          } else {\n            VerticalDrawCommandManager\n                .fillMaxMinArrays(drawCommands, commandMaxBottom, commandMinTop, drawViewIndexMap);\n          }\n        }\n        float[] regionMaxBottom = EMPTY_FLOAT_ARRAY;\n        float[] regionMinTop = EMPTY_FLOAT_ARRAY;\n        if (nodeRegions != null) {\n          regionMaxBottom = new float[nodeRegions.length];\n          regionMinTop = new float[nodeRegions.length];\n\n          if (node.isHorizontal()) {\n            HorizontalDrawCommandManager\n                .fillMaxMinArrays(nodeRegions, regionMaxBottom, regionMinTop);\n          } else {\n            VerticalDrawCommandManager\n                .fillMaxMinArrays(nodeRegions, regionMaxBottom, regionMinTop);\n          }\n        }\n\n        boolean willMountViews = nativeChildren != null;\n        mOperationsQueue.enqueueUpdateClippingMountState(\n            node.getReactTag(),\n            drawCommands,\n            drawViewIndexMap,\n            commandMaxBottom,\n            commandMinTop,\n            listeners,\n            nodeRegions,\n            regionMaxBottom,\n            regionMinTop,\n            willMountViews);\n      } else {\n        mOperationsQueue.enqueueUpdateMountState(\n            node.getReactTag(),\n            drawCommands,\n            listeners,\n            nodeRegions);\n      }\n    }\n\n    if (node.hasUnseenUpdates()) {\n      node.onCollectExtraUpdates(mOperationsQueue);\n      node.markUpdateSeen();\n    }\n\n    if (nativeChildren != null) {\n      updateNativeChildren(node, node.getNativeChildren(), nativeChildren);\n    }\n\n    boolean updated = shouldUpdateMountState || nativeChildren != null || descendantUpdated;\n\n    if (!expectingUpdate && updated) {\n      throw new RuntimeException(\"Node \" + node.getReactTag() + \" updated unexpectedly.\");\n    }\n\n    return updated;\n  }\n\n  /**\n   * Handles updating the children of a node when they change.  Updates the shadow node and\n   * enqueues state updates that will eventually be run on the UI thread.\n   *\n   * @param node The node to update native children for.\n   * @param oldNativeChildren The previously mounted native children.\n   * @param newNativeChildren The newly mounted native children.\n   */\n  private void updateNativeChildren(\n      FlatShadowNode node,\n      FlatShadowNode[] oldNativeChildren,\n      FlatShadowNode[] newNativeChildren) {\n\n    node.setNativeChildren(newNativeChildren);\n\n    if (mDetachAllChildrenFromViews == null) {\n      mDetachAllChildrenFromViews = mOperationsQueue.enqueueDetachAllChildrenFromViews();\n    }\n\n    if (oldNativeChildren.length != 0) {\n      mViewsToDetachAllChildrenFrom.add(node);\n    }\n\n    int tag = node.getReactTag();\n    int numViewsToAdd = newNativeChildren.length;\n    final int[] viewsToAdd;\n    if (numViewsToAdd == 0) {\n      viewsToAdd = EMPTY_INT_ARRAY;\n    } else {\n      viewsToAdd = new int[numViewsToAdd];\n      int i = 0;\n      for (FlatShadowNode child : newNativeChildren) {\n        if (child.getNativeParentTag() == tag) {\n          viewsToAdd[i] = -child.getReactTag();\n        } else {\n          viewsToAdd[i] = child.getReactTag();\n        }\n        // all views we add are first start detached\n        child.setNativeParentTag(-1);\n        ++i;\n      }\n    }\n\n    // Populate an array of views to detach.\n    // These views still have their native parent set as opposed to being reset to -1\n    for (FlatShadowNode child : oldNativeChildren) {\n      if (child.getNativeParentTag() == tag) {\n        // View is attached to old parent and needs to be removed.\n        mViewsToDetach.add(child);\n        child.setNativeParentTag(-1);\n      }\n    }\n\n    final int[] viewsToDetach = collectViewTags(mViewsToDetach);\n    mViewsToDetach.clear();\n\n    // restore correct parent tag\n    for (FlatShadowNode child : newNativeChildren) {\n      child.setNativeParentTag(tag);\n    }\n\n    mOperationsQueue.enqueueUpdateViewGroup(tag, viewsToAdd, viewsToDetach);\n  }\n\n  /**\n   * Recursively walks node tree from a given node and collects draw commands, listeners, node\n   * regions and native children.  Calls collect state on the node, then processNodeAndCollectState\n   * for the recursion.\n   */\n  private boolean collectStateRecursively(\n      FlatShadowNode node,\n      float left,\n      float top,\n      float right,\n      float bottom,\n      float clipLeft,\n      float clipTop,\n      float clipRight,\n      float clipBottom,\n      boolean isAndroidView,\n      boolean needsCustomLayoutForChildren) {\n    if (node.hasNewLayout()) {\n      node.markLayoutSeen();\n    }\n\n    float roundedLeft = roundToPixel(left);\n    float roundedTop = roundToPixel(top);\n    float roundedRight = roundToPixel(right);\n    float roundedBottom = roundToPixel(bottom);\n\n    // notify JS about layout event if requested\n    if (node.shouldNotifyOnLayout()) {\n      OnLayoutEvent layoutEvent = node.obtainLayoutEvent(\n          Math.round(node.getLayoutX()),\n          Math.round(node.getLayoutY()),\n          (int) (roundedRight - roundedLeft),\n          (int) (roundedBottom - roundedTop));\n      if (layoutEvent != null) {\n        mOnLayoutEvents.add(layoutEvent);\n      }\n    }\n\n    if (node.clipToBounds()) {\n      clipLeft = Math.max(left, clipLeft);\n      clipTop = Math.max(top, clipTop);\n      clipRight = Math.min(right, clipRight);\n      clipBottom = Math.min(bottom, clipBottom);\n    }\n\n    node.collectState(\n        this,\n        roundedLeft,\n        roundedTop,\n        roundedRight,\n        roundedBottom,\n        roundToPixel(clipLeft),\n        roundToPixel(clipTop),\n        roundToPixel(clipRight),\n        clipBottom);\n\n    boolean updated = false;\n    for (int i = 0, childCount = node.getChildCount(); i != childCount; ++i) {\n      ReactShadowNode child = node.getChildAt(i);\n      if (child.isVirtual()) {\n        continue;\n      }\n\n      updated |= processNodeAndCollectState(\n          (FlatShadowNode) child,\n          left,\n          top,\n          clipLeft,\n          clipTop,\n          clipRight,\n          clipBottom,\n          isAndroidView,\n          needsCustomLayoutForChildren);\n    }\n\n    node.resetUpdated();\n\n    return updated;\n  }\n\n  /**\n   * Collects state and enqueues View boundary updates for a given node tree.  Returns true if\n   * this node or any of its descendants that mount to View generated any updates.\n   */\n  private boolean processNodeAndCollectState(\n      FlatShadowNode node,\n      float parentLeft,\n      float parentTop,\n      float parentClipLeft,\n      float parentClipTop,\n      float parentClipRight,\n      float parentClipBottom,\n      boolean parentIsAndroidView,\n      boolean needsCustomLayout) {\n    float width = node.getLayoutWidth();\n    float height = node.getLayoutHeight();\n\n    float left = parentLeft + node.getLayoutX();\n    float top = parentTop + node.getLayoutY();\n    float right = left + width;\n    float bottom = top + height;\n\n    boolean mountsToView = node.mountsToView();\n\n    final boolean updated;\n\n    if (!parentIsAndroidView) {\n      addNodeRegion(node, left, top, right, bottom, !mountsToView);\n    }\n\n    if (mountsToView) {\n      ensureBackingViewIsCreated(node);\n\n      addNativeChild(node);\n      updated = collectStateForMountableNode(\n          node,\n          0, // left - left\n          0, // top - top\n          right - left,\n          bottom - top,\n          parentClipLeft - left,\n          parentClipTop - top,\n          parentClipRight - left,\n          parentClipBottom - top);\n\n      if (!parentIsAndroidView) {\n        mDrawCommands.add(node.collectDrawView(\n            left,\n            top,\n            right,\n            bottom,\n            parentClipLeft,\n            parentClipTop,\n            parentClipRight,\n            parentClipBottom));\n      }\n\n      if (!needsCustomLayout) {\n        updateViewBounds(node, left, top, right, bottom);\n      }\n    } else {\n      updated = collectStateRecursively(\n          node,\n          left,\n          top,\n          right,\n          bottom,\n          parentClipLeft,\n          parentClipTop,\n          parentClipRight,\n          parentClipBottom,\n          false,\n          false);\n    }\n\n    return updated;\n  }\n\n  private void updateViewPadding(AndroidView androidView, int reactTag) {\n    if (androidView.isPaddingChanged()) {\n      mOperationsQueue.enqueueSetPadding(\n          reactTag,\n          Math.round(androidView.getPadding(Spacing.LEFT)),\n          Math.round(androidView.getPadding(Spacing.TOP)),\n          Math.round(androidView.getPadding(Spacing.RIGHT)),\n          Math.round(androidView.getPadding(Spacing.BOTTOM)));\n      androidView.resetPaddingChanged();\n    }\n  }\n\n  private static int[] collectViewTags(ArrayList<FlatShadowNode> views) {\n    int numViews = views.size();\n    if (numViews == 0) {\n      return EMPTY_INT_ARRAY;\n    }\n\n    int[] viewTags = new int[numViews];\n    for (int i = 0; i < numViews; ++i) {\n      viewTags[i] = views.get(i).getReactTag();\n    }\n\n    return viewTags;\n  }\n\n  /**\n   * This is what Math.round() does, except it returns float.\n   */\n  private static float roundToPixel(float pos) {\n    return (float) Math.floor(pos + 0.5f);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/TextNodeRegion.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport android.text.Layout;\nimport android.text.Spanned;\n\n/* package */ final class TextNodeRegion extends NodeRegion {\n  private @Nullable Layout mLayout;\n\n  /* package */ TextNodeRegion(\n      float left,\n      float top,\n      float right,\n      float bottom,\n      int tag,\n      boolean isVirtual,\n      @Nullable Layout layout) {\n    super(left, top, right, bottom, tag, isVirtual);\n    mLayout = layout;\n  }\n\n  public void setLayout(Layout layout) {\n    mLayout = layout;\n  }\n\n  /* package */ @Nullable Layout getLayout() {\n    return mLayout;\n  }\n\n  /* package */ int getReactTag(float touchX, float touchY) {\n    if (mLayout != null) {\n      CharSequence text = mLayout.getText();\n      if (text instanceof Spanned) {\n        int y = Math.round(touchY - getTop());\n        if (y >= mLayout.getLineTop(0) && y < mLayout.getLineBottom(mLayout.getLineCount() - 1)) {\n          float x = Math.round(touchX - getLeft());\n          int line = mLayout.getLineForVertical(y);\n\n          if (mLayout.getLineLeft(line) <= x && x <= mLayout.getLineRight(line)) {\n            int off = mLayout.getOffsetForHorizontal(line, x);\n\n            Spanned spanned = (Spanned) text;\n            RCTRawText[] link = spanned.getSpans(off, off, RCTRawText.class);\n\n            if (link.length != 0) {\n              return link[0].getReactTag();\n            }\n          }\n        }\n      }\n    }\n\n    return super.getReactTag(touchX, touchY);\n  }\n\n  @Override\n  boolean matchesTag(int tag) {\n    if (super.matchesTag(tag)) {\n      return true;\n    }\n\n    if (mLayout != null) {\n      Spanned text = (Spanned) mLayout.getText();\n      RCTRawText[] spans = text.getSpans(0, text.length(), RCTRawText.class);\n      for (RCTRawText span : spans) {\n        if (span.getReactTag() == tag) {\n          return true;\n        }\n      }\n    }\n    return false;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/TypefaceCache.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport javax.annotation.Nullable;\n\nimport java.util.HashMap;\n\nimport android.content.res.AssetManager;\nimport android.graphics.Typeface;\n\nimport com.facebook.infer.annotation.Assertions;\n\n/**\n * TypefaceCache provides methods to resolve typeface from font family, or existing typeface\n * with a different style.\n */\n/* package */ final class TypefaceCache {\n\n  private static final int MAX_STYLES = 4; // NORMAL = 0, BOLD = 1, ITALIC = 2, BOLD_ITALIC = 3\n\n  private static final HashMap<String, Typeface[]> FONTFAMILY_CACHE = new HashMap<>();\n  private static final HashMap<Typeface, Typeface[]> TYPEFACE_CACHE = new HashMap<>();\n\n  private static final String[] EXTENSIONS = {\n      \"\",\n      \"_bold\",\n      \"_italic\",\n      \"_bold_italic\"};\n  private static final String[] FILE_EXTENSIONS = {\".ttf\", \".otf\"};\n  private static final String FONTS_ASSET_PATH = \"fonts/\";\n\n  @Nullable private static AssetManager sAssetManager = null;\n\n  public static void setAssetManager(AssetManager assetManager) {\n    sAssetManager = assetManager;\n  }\n\n  /**\n   * Returns a Typeface for a given a FontFamily and style.\n   */\n  public static Typeface getTypeface(String fontFamily, int style) {\n    Typeface[] cache = FONTFAMILY_CACHE.get(fontFamily);\n    if (cache == null) {\n      // cache is empty, create one.\n      cache = new Typeface[MAX_STYLES];\n      FONTFAMILY_CACHE.put(fontFamily, cache);\n    } else if (cache[style] != null) {\n      // return cached value.\n      return cache[style];\n    }\n\n    Typeface typeface = createTypeface(fontFamily, style);\n    cache[style] = typeface;\n    TYPEFACE_CACHE.put(typeface, cache);\n    return typeface;\n  }\n\n  private static Typeface createTypeface(String fontFamilyName, int style) {\n    String extension = EXTENSIONS[style];\n    StringBuilder fileNameBuffer = new StringBuilder(32)\n        .append(FONTS_ASSET_PATH)\n        .append(fontFamilyName)\n        .append(extension);\n    int length = fileNameBuffer.length();\n    for (String fileExtension : FILE_EXTENSIONS) {\n      String fileName = fileNameBuffer.append(fileExtension).toString();\n      try {\n        return Typeface.createFromAsset(sAssetManager, fileName);\n      } catch (RuntimeException e) {\n        // unfortunately Typeface.createFromAsset throws an exception instead of returning null\n        // if the typeface doesn't exist\n        fileNameBuffer.setLength(length);\n      }\n    }\n    return Assertions.assumeNotNull(Typeface.create(fontFamilyName, style));\n  }\n\n  /**\n   * Returns a derivative of a given Typeface with a different style.\n   */\n  public static Typeface getTypeface(Typeface typeface, int style) {\n    if (typeface == null) {\n      return Typeface.defaultFromStyle(style);\n    }\n\n    Typeface[] cache = TYPEFACE_CACHE.get(typeface);\n    if (cache == null) {\n      // This should not happen because all Typefaces are coming from TypefaceCache,\n      // and thus should be registered in TYPEFACE_CACHE.\n      // If we get here, it's a bug and one of the 2 scenarios happened:\n      // a) TypefaceCache created a Typeface and didn't put it into TYPEFACE_CACHE.\n      // b) someone else created a Typeface bypassing TypefaceCache so it's not registered here.\n      //\n      // If it's not registered, we can just register it manually for consistency, and so that\n      // next time someone requests a un unknown Typeface, it's already cached and we don't create\n      // extra copies.\n      cache = new Typeface[MAX_STYLES];\n      cache[typeface.getStyle()] = typeface;\n    } else if (cache[style] != null) {\n      // return cached value.\n      return cache[style];\n    }\n\n    typeface = Typeface.create(typeface, style);\n    cache[style] = typeface;\n    TYPEFACE_CACHE.put(typeface, cache);\n    return typeface;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/VerticalDrawCommandManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport java.util.Arrays;\n\nimport android.util.SparseIntArray;\n\n/**\n * {@link DrawCommandManager} with vertical clipping (The view scrolls up and down).\n */\n/* package */ final class VerticalDrawCommandManager extends ClippingDrawCommandManager {\n\n  /* package */ VerticalDrawCommandManager(\n      FlatViewGroup flatViewGroup,\n      DrawCommand[] drawCommands) {\n    super(flatViewGroup, drawCommands);\n  }\n\n  @Override\n  int commandStartIndex() {\n    int start = Arrays.binarySearch(mCommandMaxBottom, mClippingRect.top);\n    // We don't care whether we matched or not, but positive indices are helpful. The binary search\n    // returns ~index in the case that it isn't a match, so reverse that here.\n    return start < 0 ? ~start : start;\n  }\n\n  @Override\n  int commandStopIndex(int start) {\n    int stop = Arrays.binarySearch(\n        mCommandMinTop,\n        start,\n        mCommandMinTop.length,\n        mClippingRect.bottom);\n    // We don't care whether we matched or not, but positive indices are helpful. The binary search\n    // returns ~index in the case that it isn't a match, so reverse that here.\n    return stop < 0 ? ~stop : stop;\n  }\n\n  @Override\n  int regionStopIndex(float touchX, float touchY) {\n    int stop = Arrays.binarySearch(mRegionMinTop, touchY + 0.0001f);\n    // We don't care whether we matched or not, but positive indices are helpful. The binary search\n    // returns ~index in the case that it isn't a match, so reverse that here.\n    return stop < 0 ? ~stop : stop;\n  }\n\n  @Override\n  boolean regionAboveTouch(int index, float touchX, float touchY) {\n    return mRegionMaxBottom[index] < touchY;\n  }\n\n  /**\n   * Populates the max and min arrays for a given set of node regions.\n   *\n   * This should never be called from the UI thread, as the reason it exists is to do work off the\n   * UI thread.\n   *\n   * @param regions The regions that will eventually be mounted.\n   * @param maxBottom  At each index i, the maximum bottom value of all regions at or below i.\n   * @param minTop  At each index i, the minimum top value of all regions at or below i.\n   */\n  public static void fillMaxMinArrays(NodeRegion[] regions, float[] maxBottom, float[] minTop) {\n    float last = 0;\n    for (int i = 0; i < regions.length; i++) {\n      last = Math.max(last, regions[i].getTouchableBottom());\n      maxBottom[i] = last;\n    }\n    for (int i = regions.length - 1; i >= 0; i--) {\n      last = Math.min(last, regions[i].getTouchableTop());\n      minTop[i] = last;\n    }\n  }\n\n  /**\n   * Populates the max and min arrays for a given set of draw commands.  Also populates a mapping of\n   * react tags to their index position in the command array.\n   *\n   * This should never be called from the UI thread, as the reason it exists is to do work off the\n   * UI thread.\n   *\n   * @param commands The draw commands that will eventually be mounted.\n   * @param maxBottom At each index i, the maximum bottom value of all draw commands at or below i.\n   * @param minTop At each index i, the minimum top value of all draw commands at or below i.\n   * @param drawViewIndexMap Mapping of ids to index position within the draw command array.\n   */\n  public static void fillMaxMinArrays(\n      DrawCommand[] commands,\n      float[] maxBottom,\n      float[] minTop,\n      SparseIntArray drawViewIndexMap) {\n    float last = 0;\n    // Loop through the DrawCommands, keeping track of the maximum we've seen if we only iterated\n    // through items up to this position.\n    for (int i = 0; i < commands.length; i++) {\n      if (commands[i] instanceof DrawView) {\n        DrawView drawView = (DrawView) commands[i];\n        // These will generally be roughly sorted by id, so try to insert at the end if possible.\n        drawViewIndexMap.append(drawView.reactTag, i);\n        last = Math.max(last, drawView.mLogicalBottom);\n      } else {\n        last = Math.max(last, commands[i].getBottom());\n      }\n      maxBottom[i] = last;\n    }\n    // Intentionally leave last as it was, since it's at the maximum bottom position we've seen so\n    // far, we can use it again.\n\n    // Loop through backwards, keeping track of the minimum we've seen at this position.\n    for (int i = commands.length - 1; i >= 0; i--) {\n      if (commands[i] instanceof DrawView) {\n        last = Math.min(last, ((DrawView) commands[i]).mLogicalTop);\n      } else {\n        last = Math.min(last, commands[i].getTop());\n      }\n      minTop[i] = last;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/ViewResolver.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.view.View;\n\npublic interface ViewResolver {\n  public View getView(int tag);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/flat/VirtualViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.flat;\n\nimport android.view.View;\n\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewManager;\n\n/**\n * Base class to ViewManagers that don't map to a View.\n */\nabstract class VirtualViewManager<C extends FlatShadowNode> extends ViewManager<View, C> {\n  @Override\n  protected View createViewInstance(ThemedReactContext reactContext) {\n    throw new RuntimeException(getName() + \" doesn't map to a View\");\n  }\n\n  @Override\n  public void updateExtraData(View root, Object extraData) {\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/jstasks/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nDEPS = [\n    react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n    react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n    react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n    react_native_target(\"java/com/facebook/react/common:common\"),\n    react_native_target(\"java/com/facebook/react/modules/appregistry:appregistry\"),\n]\n\nandroid_library(\n    name = \"jstasks\",\n    srcs = glob([\"*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = DEPS,\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/jstasks/HeadlessJsTaskConfig.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.jstasks;\n\nimport com.facebook.react.bridge.WritableMap;\n\n/**\n * Class that holds the various parameters needed to start a JS task.\n */\npublic class HeadlessJsTaskConfig {\n  private final String mTaskKey;\n  private final WritableMap mData;\n  private final long mTimeout;\n  private final boolean mAllowedInForeground;\n\n  /**\n   * Create a HeadlessJsTaskConfig. Equivalent to calling\n   * {@link #HeadlessJsTaskConfig(String, WritableMap, long, boolean)} with no timeout (0) and\n   * {@code false} for {@code allowedInBackground}.\n   */\n  public HeadlessJsTaskConfig(String taskKey, WritableMap data) {\n    this(taskKey, data, 0, false);\n  }\n\n  /**\n   * Create a HeadlessJsTaskConfig. Equivalent to calling\n   * {@link #HeadlessJsTaskConfig(String, WritableMap, long, boolean)} with {@code false} for\n   * {@code allowedInBackground}.\n   */\n  public HeadlessJsTaskConfig(String taskKey, WritableMap data, long timeout) {\n    this(taskKey, data, timeout, false);\n  }\n\n  /**\n   * Create a HeadlessJsTaskConfig.\n   *\n   * @param taskKey the key for the JS task to execute. This is the same key that you call {@code\n   * AppRegistry.registerTask} with in JS.\n   * @param data a map of parameters passed to the JS task executor.\n   * @param timeout the amount of time (in ms) after which the React instance should be terminated\n   * regardless of whether the task has completed or not. This is meant as a safeguard against\n   * accidentally keeping the device awake for long periods of time because JS crashed or some\n   * request timed out. A value of 0 means no timeout (should only be used for long-running tasks\n   * such as music playback).\n   * @param allowedInForeground whether to allow this task to run while the app is in the foreground\n   * (i.e. there is a host in resumed mode for the current ReactContext). Only set this to true if\n   * you really need it. Note that tasks run in the same JS thread as UI code, so doing expensive\n   * operations would degrade user experience.\n   */\n  public HeadlessJsTaskConfig(\n    String taskKey,\n    WritableMap data,\n    long timeout,\n    boolean allowedInForeground) {\n    mTaskKey = taskKey;\n    mData = data;\n    mTimeout = timeout;\n    mAllowedInForeground = allowedInForeground;\n  }\n\n  /* package */ String getTaskKey() {\n    return mTaskKey;\n  }\n\n  /* package */ WritableMap getData() {\n    return mData;\n  }\n\n  /* package */ long getTimeout() {\n    return mTimeout;\n  }\n\n  /* package */ boolean isAllowedInForeground() {\n    return mAllowedInForeground;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/jstasks/HeadlessJsTaskContext.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.jstasks;\n\nimport java.lang.ref.WeakReference;\nimport java.util.Set;\nimport java.util.WeakHashMap;\nimport java.util.concurrent.CopyOnWriteArraySet;\nimport java.util.concurrent.atomic.AtomicInteger;\n\nimport android.os.Handler;\nimport android.util.SparseArray;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.common.LifecycleState;\nimport com.facebook.react.modules.appregistry.AppRegistry;\n\n/**\n * Helper class for dealing with JS tasks. Handles per-ReactContext active task tracking, starting /\n * stopping tasks and notifying listeners.\n */\npublic class HeadlessJsTaskContext {\n\n  private static final WeakHashMap<ReactContext, HeadlessJsTaskContext> INSTANCES =\n    new WeakHashMap<>();\n\n  /**\n   * Get the task helper instance for a particular {@link ReactContext}. There is only one instance\n   * per context.\n   * <p>\n   * <strong>Note:</strong> do not hold long-lived references to the object returned here, as that\n   * will cause memory leaks. Instead, just call this method on-demand.\n   */\n  public static HeadlessJsTaskContext getInstance(ReactContext context) {\n    HeadlessJsTaskContext helper = INSTANCES.get(context);\n    if (helper == null) {\n      helper = new HeadlessJsTaskContext(context);\n      INSTANCES.put(context, helper);\n    }\n    return helper;\n  }\n\n  private final WeakReference<ReactContext> mReactContext;\n  private final Set<HeadlessJsTaskEventListener> mHeadlessJsTaskEventListeners =\n    new CopyOnWriteArraySet<>();\n  private final AtomicInteger mLastTaskId = new AtomicInteger(0);\n  private final Handler mHandler = new Handler();\n  private final Set<Integer> mActiveTasks = new CopyOnWriteArraySet<>();\n  private final SparseArray<Runnable> mTaskTimeouts = new SparseArray<>();\n\n  private HeadlessJsTaskContext(ReactContext reactContext) {\n    mReactContext = new WeakReference<ReactContext>(reactContext);\n  }\n\n  /**\n   * Register a task lifecycle event listener.\n   */\n  public void addTaskEventListener(HeadlessJsTaskEventListener listener) {\n    mHeadlessJsTaskEventListeners.add(listener);\n  }\n\n  /**\n   * Unregister a task lifecycle event listener.\n   */\n  public void removeTaskEventListener(HeadlessJsTaskEventListener listener) {\n    mHeadlessJsTaskEventListeners.remove(listener);\n  }\n\n  /**\n   * Get whether there are any running JS tasks at the moment.\n   */\n  public boolean hasActiveTasks() {\n    return mActiveTasks.size() > 0;\n  }\n\n  /**\n   * Start a JS task. Handles invoking {@link AppRegistry#startHeadlessTask} and notifying\n   * listeners.\n   *\n   * @return a unique id representing this task instance.\n   */\n  public synchronized int startTask(final HeadlessJsTaskConfig taskConfig) {\n    UiThreadUtil.assertOnUiThread();\n    ReactContext reactContext = Assertions.assertNotNull(\n      mReactContext.get(),\n      \"Tried to start a task on a react context that has already been destroyed\");\n    if (reactContext.getLifecycleState() == LifecycleState.RESUMED &&\n      !taskConfig.isAllowedInForeground()) {\n      throw new IllegalStateException(\n        \"Tried to start task \" + taskConfig.getTaskKey() +\n          \" while in foreground, but this is not allowed.\");\n    }\n    final int taskId = mLastTaskId.incrementAndGet();\n    mActiveTasks.add(taskId);\n    reactContext.getJSModule(AppRegistry.class)\n      .startHeadlessTask(taskId, taskConfig.getTaskKey(), taskConfig.getData());\n    if (taskConfig.getTimeout() > 0) {\n      scheduleTaskTimeout(taskId, taskConfig.getTimeout());\n    }\n    for (HeadlessJsTaskEventListener listener : mHeadlessJsTaskEventListeners) {\n      listener.onHeadlessJsTaskStart(taskId);\n    }\n    return taskId;\n  }\n\n  /**\n   * Finish a JS task. Doesn't actually stop the task on the JS side, only removes it from the list\n   * of active tasks and notifies listeners. A task can only be finished once.\n   *\n   * @param taskId the unique id returned by {@link #startTask}.\n   */\n  public synchronized void finishTask(final int taskId) {\n    Assertions.assertCondition(\n      mActiveTasks.remove(taskId),\n      \"Tried to finish non-existent task with id \" + taskId + \".\");\n    Runnable timeout = mTaskTimeouts.get(taskId);\n    if (timeout != null) {\n      mHandler.removeCallbacks(timeout);\n      mTaskTimeouts.remove(taskId);\n    }\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        for (HeadlessJsTaskEventListener listener : mHeadlessJsTaskEventListeners) {\n          listener.onHeadlessJsTaskFinish(taskId);\n        }\n      }\n    });\n  }\n\n  /**\n   * Check if a given task is currently running. A task is stopped if either {@link #finishTask} is\n   * called or it times out.\n   */\n  public synchronized boolean isTaskRunning(final int taskId) {\n    return mActiveTasks.contains(taskId);\n  }\n\n  private void scheduleTaskTimeout(final int taskId, long timeout) {\n    Runnable runnable = new Runnable() {\n      @Override\n      public void run() {\n        finishTask(taskId);\n      }\n    };\n    mTaskTimeouts.append(taskId, runnable);\n    mHandler.postDelayed(runnable, timeout);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/jstasks/HeadlessJsTaskEventListener.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.jstasks;\n\n/**\n * Listener interface for task lifecycle events.\n */\npublic interface HeadlessJsTaskEventListener {\n\n  /**\n   * Called when a JS task is started, on the UI thread.\n   *\n   * @param taskId the unique identifier of this task instance\n   */\n  void onHeadlessJsTaskStart(int taskId);\n\n  /**\n   * Called when a JS task finishes (i.e. when\n   * {@link HeadlessJsTaskSupportModule#notifyTaskFinished} is called, or when it times out), on the\n   * UI thread.\n   */\n  void onHeadlessJsTaskFinish(int taskId);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/module/annotations/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"annotations\",\n    srcs = glob([\"**/*.java\"]),\n    required_for_source_only_abi = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/module/annotations/ReactModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.module.annotations;\n\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.Target;\n\nimport com.facebook.react.bridge.BaseJavaModule;\n\nimport static java.lang.annotation.ElementType.TYPE;\nimport static java.lang.annotation.RetentionPolicy.RUNTIME;\n\n/**\n * Annotation for use on {@link BaseJavaModule}s to describe properties for that module.\n */\n@Retention(RUNTIME)\n@Target(TYPE)\npublic @interface ReactModule {\n  /**\n   * Name used to {@code require()} this module from JavaScript.\n   */\n  String name();\n\n  /**\n   * True if you intend to override some other native module that was registered e.g. as part\n   * of a different package (such as the core one). Trying to override without returning true from\n   * this method is considered an error and will throw an exception during initialization. By\n   * default all modules return false.\n   */\n  boolean canOverrideExistingModule() default false;\n\n  /**\n   * Whether this module needs to be loaded immediately.\n   */\n  boolean needsEagerInit() default false;\n\n  /**\n   *  Whether this module has constants to add, defaults to true as that is safer for when a\n   *  correct annotation is not included\n   */\n  boolean hasConstants() default true;\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/module/annotations/ReactModuleList.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.module.annotations;\n\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.Target;\n\nimport com.facebook.react.bridge.NativeModule;\n\nimport static java.lang.annotation.ElementType.TYPE;\nimport static java.lang.annotation.RetentionPolicy.SOURCE;\n\n/**\n * Annotates a function that returns a list of ModuleSpecs from which we get a list of NativeModules\n * to create ReactModuleInfos from.\n */\n@Retention(SOURCE)\n@Target(TYPE)\npublic @interface ReactModuleList {\n\n  /**\n   * The Native modules in this list should be annotated with {@link ReactModule}.\n   * @return List of Native modules in the package.\n   */\n  Class<? extends NativeModule>[] nativeModules();\n\n  /**\n   * The View Managers in this list should be annotated with {@link ReactModule}.\n   * @return List of view manager in the package.\n   */\n  Class<? extends NativeModule>[] viewManagers() default {};\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/module/model/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"model\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.module.model;\n\n/**\n * Data holder class holding native module specifications. {@link ReactModuleSpecProcessor} creates\n * these so Java modules don't have to be instantiated at React Native start up.\n */\npublic class ReactModuleInfo {\n\n  private final String mName;\n  private final boolean mCanOverrideExistingModule;\n  private final boolean mNeedsEagerInit;\n  private final boolean mHasConstants;\n\n  public ReactModuleInfo(\n    String name,\n    boolean canOverrideExistingModule,\n    boolean needsEagerInit,\n    boolean hasConstants) {\n    mName = name;\n    mCanOverrideExistingModule = canOverrideExistingModule;\n    mNeedsEagerInit = needsEagerInit;\n    mHasConstants = hasConstants;\n  }\n\n  public String name() {\n    return mName;\n  }\n\n  public boolean canOverrideExistingModule() {\n    return mCanOverrideExistingModule;\n  }\n\n  public boolean needsEagerInit() {\n    return mNeedsEagerInit;\n  }\n\n  public boolean hasConstants() {\n    return mHasConstants;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfoProvider.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.module.model;\n\nimport java.util.Map;\n\n/**\n * Interface for auto-generated class by ReactModuleSpecProcessor.\n */\npublic interface ReactModuleInfoProvider {\n\n  Map<Class, ReactModuleInfo> getReactModuleInfos();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/module/processing/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\njava_annotation_processor(\n    name = \"processing\",\n    does_not_affect_abi = True,\n    processor_class = \"com.facebook.react.module.processing.ReactModuleSpecProcessor\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        \":processing-lib\",\n    ],\n)\n\njava_library(\n    name = \"processing-lib\",\n    srcs = glob([\"*.java\"]),\n    source = \"8\",\n    target = \"8\",\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/javapoet:javapoet\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/module/model:model\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.module.processing;\n\nimport javax.annotation.processing.AbstractProcessor;\nimport javax.annotation.processing.Filer;\nimport javax.annotation.processing.Messager;\nimport javax.annotation.processing.ProcessingEnvironment;\nimport javax.annotation.processing.RoundEnvironment;\nimport javax.annotation.processing.SupportedAnnotationTypes;\nimport javax.annotation.processing.SupportedSourceVersion;\nimport javax.lang.model.SourceVersion;\nimport javax.lang.model.element.AnnotationMirror;\nimport javax.lang.model.element.Element;\nimport javax.lang.model.element.ElementKind;\nimport javax.lang.model.element.Modifier;\nimport javax.lang.model.element.TypeElement;\nimport javax.lang.model.type.MirroredTypesException;\nimport javax.lang.model.type.TypeMirror;\nimport javax.lang.model.util.Elements;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.stream.Stream;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\n\nimport com.facebook.infer.annotation.SuppressFieldNotInitialized;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.module.annotations.ReactModuleList;\nimport com.facebook.react.module.model.ReactModuleInfo;\nimport com.facebook.react.module.model.ReactModuleInfoProvider;\n\nimport com.squareup.javapoet.ClassName;\nimport com.squareup.javapoet.CodeBlock;\nimport com.squareup.javapoet.JavaFile;\nimport com.squareup.javapoet.MethodSpec;\nimport com.squareup.javapoet.ParameterizedTypeName;\nimport com.squareup.javapoet.TypeName;\nimport com.squareup.javapoet.TypeSpec;\n\nimport static javax.lang.model.element.Modifier.PUBLIC;\nimport static javax.tools.Diagnostic.Kind.ERROR;\n\n/**\n * Generates a list of ReactModuleInfo for modules annotated with {@link ReactModule} in\n * {@link ReactPackage}s annotated with {@link ReactModuleList}.\n */\n@SupportedAnnotationTypes({\n  \"com.facebook.react.module.annotations.ReactModule\",\n  \"com.facebook.react.module.annotations.ReactModuleList\",\n})\n@SupportedSourceVersion(SourceVersion.RELEASE_7)\npublic class ReactModuleSpecProcessor extends AbstractProcessor {\n\n  private static final TypeName COLLECTIONS_TYPE = ParameterizedTypeName.get(Collections.class);\n  private static final TypeName MAP_TYPE = ParameterizedTypeName.get(\n    Map.class,\n    Class.class,\n    ReactModuleInfo.class);\n  private static final TypeName INSTANTIATED_MAP_TYPE = ParameterizedTypeName.get(HashMap.class);\n\n  @SuppressFieldNotInitialized\n  private Filer mFiler;\n  @SuppressFieldNotInitialized\n  private Elements mElements;\n  @SuppressFieldNotInitialized\n  private Messager mMessager;\n\n  @Override\n  public synchronized void init(ProcessingEnvironment processingEnv) {\n    super.init(processingEnv);\n\n    mFiler = processingEnv.getFiler();\n    mElements = processingEnv.getElementUtils();\n    mMessager = processingEnv.getMessager();\n  }\n\n  @Override\n  public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {\n    Set<? extends Element> reactModuleListElements = roundEnv.getElementsAnnotatedWith(\n      ReactModuleList.class);\n    for (Element reactModuleListElement : reactModuleListElements) {\n      if (!(reactModuleListElement instanceof TypeElement)) {\n        continue;\n      }\n\n      TypeElement typeElement = (TypeElement) reactModuleListElement;\n      ReactModuleList reactModuleList = typeElement.getAnnotation(ReactModuleList.class);\n\n      if (reactModuleList == null) {\n        continue;\n      }\n\n      ClassName className = ClassName.get(typeElement);\n      String packageName = ClassName.get(typeElement).packageName();\n      String fileName = className.simpleName();\n\n      List<String> nativeModules = new ArrayList<>();\n      try {\n        reactModuleList.nativeModules(); // throws MirroredTypesException\n      } catch (MirroredTypesException mirroredTypesException) {\n        List<? extends TypeMirror> typeMirrors = mirroredTypesException.getTypeMirrors();\n        for (TypeMirror typeMirror : typeMirrors) {\n          nativeModules.add(typeMirror.toString());\n        }\n      }\n\n      MethodSpec getReactModuleInfosMethod;\n      try {\n        getReactModuleInfosMethod = MethodSpec.methodBuilder(\"getReactModuleInfos\")\n          .addAnnotation(Override.class)\n          .addModifiers(PUBLIC)\n          .addCode(getCodeBlockForReactModuleInfos(nativeModules))\n          .returns(MAP_TYPE)\n          .build();\n      } catch (ReactModuleSpecException reactModuleSpecException) {\n        mMessager.printMessage(ERROR, reactModuleSpecException.mMessage);\n        return false;\n      }\n\n      TypeSpec reactModulesInfosTypeSpec = TypeSpec.classBuilder(\n        fileName + \"$$ReactModuleInfoProvider\")\n        .addModifiers(Modifier.PUBLIC)\n        .addMethod(getReactModuleInfosMethod)\n        .addSuperinterface(ReactModuleInfoProvider.class)\n        .build();\n\n        JavaFile javaFile = JavaFile.builder(packageName, reactModulesInfosTypeSpec)\n          .addFileComment(\"Generated by \" + getClass().getName())\n          .build();\n\n      try {\n        javaFile.writeTo(mFiler);\n      } catch (IOException e) {\n        e.printStackTrace();\n      }\n    }\n\n    return true;\n  }\n\n  private CodeBlock getCodeBlockForReactModuleInfos(List<String> nativeModules)\n    throws ReactModuleSpecException {\n    CodeBlock.Builder builder = CodeBlock.builder();\n    if (nativeModules == null || nativeModules.isEmpty()) {\n      builder.addStatement(\"return $T.emptyMap()\", COLLECTIONS_TYPE);\n    } else {\n      builder.addStatement(\"$T map = new $T()\", MAP_TYPE, INSTANTIATED_MAP_TYPE);\n\n      for (String nativeModule : nativeModules) {\n        String keyString = nativeModule + \".class\";\n\n        TypeElement typeElement = mElements.getTypeElement(nativeModule);\n        if (typeElement == null) {\n          throw new ReactModuleSpecException(\n            keyString + \" not found by ReactModuleSpecProcessor. \" +\n            \"Did you misspell the module?\");\n        }\n        ReactModule reactModule = typeElement.getAnnotation(ReactModule.class);\n        if (reactModule == null) {\n          throw new ReactModuleSpecException(\n            keyString + \" not found by ReactModuleSpecProcessor. \" +\n            \"Did you forget to add the @ReactModule annotation to the native module?\");\n        }\n\n        List<? extends Element> elements = typeElement.getEnclosedElements();\n        boolean hasConstants = false;\n        if (elements != null) {\n          hasConstants =\n              elements\n                  .stream()\n                  .filter(element -> element.getKind() == ElementKind.METHOD)\n                  .map(Element::getSimpleName)\n                  .anyMatch(\n                      name -> name.contentEquals(\"getConstants\") || name.contentEquals(\"getTypedExportedConstants\"));\n        }\n\n        String valueString = new StringBuilder()\n          .append(\"new ReactModuleInfo(\")\n          .append(\"\\\"\").append(reactModule.name()).append(\"\\\"\").append(\", \")\n          .append(reactModule.canOverrideExistingModule()).append(\", \")\n          .append(reactModule.needsEagerInit()).append(\", \")\n          .append(hasConstants)\n          .append(\")\")\n          .toString();\n\n        builder.addStatement(\"map.put(\" + keyString + \", \" + valueString + \")\");\n      }\n      builder.addStatement(\"return map\");\n    }\n    return builder.build();\n  }\n\n  private static class ReactModuleSpecException extends Exception {\n\n    public final String mMessage;\n\n    public ReactModuleSpecException(String message) {\n      mMessage = message;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/AccessibilityInfoModule.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.modules.accessibilityinfo;\n\nimport javax.annotation.Nullable;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.os.Build;\nimport android.view.accessibility.AccessibilityManager;\n\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.core.DeviceEventManagerModule;\n\n/**\n * Module that monitors and provides information about the state of Touch Exploration service\n * on the device. For API >= 19.\n */\n@ReactModule(name = \"AccessibilityInfo\")\npublic class AccessibilityInfoModule extends ReactContextBaseJavaModule\n        implements LifecycleEventListener {\n\n    @TargetApi(19)\n    private class ReactTouchExplorationStateChangeListener\n            implements AccessibilityManager.TouchExplorationStateChangeListener {\n\n        @Override\n        public void onTouchExplorationStateChanged(boolean enabled) {\n            updateAndSendChangeEvent(enabled);\n        }\n    }\n\n    private @Nullable AccessibilityManager mAccessibilityManager;\n    private @Nullable ReactTouchExplorationStateChangeListener mTouchExplorationStateChangeListener;\n    private boolean mEnabled = false;\n\n    private static final String EVENT_NAME = \"touchExplorationDidChange\";\n\n    public AccessibilityInfoModule(ReactApplicationContext context) {\n        super(context);\n        Context appContext = context.getApplicationContext();\n        mAccessibilityManager = (AccessibilityManager) appContext.getSystemService(Context.ACCESSIBILITY_SERVICE);\n        mEnabled = mAccessibilityManager.isTouchExplorationEnabled();\n        if (Build.VERSION.SDK_INT >= 19) {\n            mTouchExplorationStateChangeListener = new ReactTouchExplorationStateChangeListener();\n        }\n    }\n\n    @Override\n    public String getName() {\n        return \"AccessibilityInfo\";\n    }\n\n    @ReactMethod\n    public void isTouchExplorationEnabled(Callback successCallback) {\n        successCallback.invoke(mEnabled);\n    }\n\n    private void updateAndSendChangeEvent(boolean enabled) {\n        if (mEnabled != enabled) {\n            mEnabled = enabled;\n            getReactApplicationContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)\n                    .emit(EVENT_NAME, mEnabled);\n        }\n    }\n\n    @Override\n    public void onHostResume() {\n        if (Build.VERSION.SDK_INT >= 19) {\n            mAccessibilityManager.addTouchExplorationStateChangeListener(\n                    mTouchExplorationStateChangeListener);\n        }\n        updateAndSendChangeEvent(mAccessibilityManager.isTouchExplorationEnabled());\n    }\n\n    @Override\n    public void onHostPause() {\n        if (Build.VERSION.SDK_INT >= 19) {\n            mAccessibilityManager.removeTouchExplorationStateChangeListener(\n                    mTouchExplorationStateChangeListener);\n        }\n    }\n\n    @Override\n    public void initialize() {\n        getReactApplicationContext().addLifecycleEventListener(this);\n        updateAndSendChangeEvent(mAccessibilityManager.isTouchExplorationEnabled());\n    }\n\n    @Override\n    public void onCatalystInstanceDestroy() {\n        super.onCatalystInstanceDestroy();\n        getReactApplicationContext().removeLifecycleEventListener(this);\n    }\n\n    @Override\n    public void onHostDestroy() {\n    }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"accessibilityinfo\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/appregistry/AppRegistry.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.appregistry;\n\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.WritableMap;\n\n/**\n * JS module interface - main entry point for launching React application for a given key.\n */\npublic interface AppRegistry extends JavaScriptModule {\n\n  void runApplication(String appKey, WritableMap appParameters);\n  void unmountApplicationComponentAtRootTag(int rootNodeTag);\n  void startHeadlessTask(int taskId, String taskKey, WritableMap data);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/appregistry/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"appregistry\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/appstate/AppStateModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.appstate;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;\n\n@ReactModule(name = AppStateModule.NAME)\npublic class AppStateModule extends ReactContextBaseJavaModule\n        implements LifecycleEventListener {\n\n  protected static final String NAME = \"AppState\";\n\n  public static final String APP_STATE_ACTIVE = \"active\";\n  public static final String APP_STATE_BACKGROUND = \"background\";\n\n  private String mAppState = \"uninitialized\";\n\n  public AppStateModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @Override\n  public void initialize() {\n    getReactApplicationContext().addLifecycleEventListener(this);\n  }\n\n  @ReactMethod\n  public void getCurrentAppState(Callback success, Callback error) {\n    success.invoke(createAppStateEventMap());\n  }\n\n  @Override\n  public void onHostResume() {\n    mAppState = APP_STATE_ACTIVE;\n    sendAppStateChangeEvent();\n  }\n\n  @Override\n  public void onHostPause() {\n    mAppState = APP_STATE_BACKGROUND;\n    sendAppStateChangeEvent();\n  }\n\n  @Override\n  public void onHostDestroy() {\n    // do not set state to destroyed, do not send an event. By the current implementation, the\n    // catalyst instance is going to be immediately dropped, and all JS calls with it.\n  }\n\n  private WritableMap createAppStateEventMap() {\n    WritableMap appState = Arguments.createMap();\n    appState.putString(\"app_state\", mAppState);\n    return appState;\n  }\n\n  private void sendAppStateChangeEvent() {\n    getReactApplicationContext().getJSModule(RCTDeviceEventEmitter.class)\n            .emit(\"appStateDidChange\", createAppStateEventMap());\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/appstate/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"appstate\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/blob/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"blob\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support-annotations:android-support-annotations\"),\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_target(\"java/com/facebook/react:react\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/websocket:websocket\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * <p>This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\npackage com.facebook.react.modules.blob;\n\nimport android.content.res.Resources;\nimport android.net.Uri;\nimport android.support.annotation.Nullable;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.websocket.WebSocketModule;\nimport java.nio.ByteBuffer;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport okio.ByteString;\n\n@ReactModule(name = BlobModule.NAME)\npublic class BlobModule extends ReactContextBaseJavaModule {\n\n  protected static final String NAME = \"BlobModule\";\n\n  private final Map<String, byte[]> mBlobs = new HashMap<>();\n\n  protected final WebSocketModule.ContentHandler mContentHandler =\n      new WebSocketModule.ContentHandler() {\n        @Override\n        public void onMessage(String text, WritableMap params) {\n          params.putString(\"data\", text);\n        }\n\n        @Override\n        public void onMessage(ByteString bytes, WritableMap params) {\n          byte[] data = bytes.toByteArray();\n\n          WritableMap blob = Arguments.createMap();\n\n          blob.putString(\"blobId\", store(data));\n          blob.putInt(\"offset\", 0);\n          blob.putInt(\"size\", data.length);\n\n          params.putMap(\"data\", blob);\n          params.putString(\"type\", \"blob\");\n        }\n      };\n\n  public BlobModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @Override\n  @Nullable\n  public Map getConstants() {\n    // The application can register BlobProvider as a ContentProvider so that blobs are resolvable.\n    // If it does, it needs to tell us what authority was used via this string resource.\n    Resources resources = getReactApplicationContext().getResources();\n    String packageName = getReactApplicationContext().getPackageName();\n    int resourceId = resources.getIdentifier(\"blob_provider_authority\", \"string\", packageName);\n    if (resourceId == 0) {\n      return null;\n    }\n\n    return MapBuilder.of(\n        \"BLOB_URI_SCHEME\", \"content\", \"BLOB_URI_HOST\", resources.getString(resourceId));\n  }\n\n  public String store(byte[] data) {\n    String blobId = UUID.randomUUID().toString();\n    store(data, blobId);\n    return blobId;\n  }\n\n  public void store(byte[] data, String blobId) {\n    mBlobs.put(blobId, data);\n  }\n\n  public void remove(String blobId) {\n    mBlobs.remove(blobId);\n  }\n\n  @Nullable\n  public byte[] resolve(Uri uri) {\n    String blobId = uri.getLastPathSegment();\n    int offset = 0;\n    int size = -1;\n    String offsetParam = uri.getQueryParameter(\"offset\");\n    if (offsetParam != null) {\n      offset = Integer.parseInt(offsetParam, 10);\n    }\n    String sizeParam = uri.getQueryParameter(\"size\");\n    if (sizeParam != null) {\n      size = Integer.parseInt(sizeParam, 10);\n    }\n    return resolve(blobId, offset, size);\n  }\n\n  @Nullable\n  public byte[] resolve(String blobId, int offset, int size) {\n    byte[] data = mBlobs.get(blobId);\n    if (data == null) {\n      return null;\n    }\n    if (size == -1) {\n      size = data.length - offset;\n    }\n    if (offset > 0) {\n      data = Arrays.copyOfRange(data, offset, offset + size);\n    }\n    return data;\n  }\n\n  @Nullable\n  public byte[] resolve(ReadableMap blob) {\n    return resolve(blob.getString(\"blobId\"), blob.getInt(\"offset\"), blob.getInt(\"size\"));\n  }\n\n  private WebSocketModule getWebSocketModule() {\n    return getReactApplicationContext().getNativeModule(WebSocketModule.class);\n  }\n\n  @ReactMethod\n  public void enableBlobSupport(final int id) {\n    getWebSocketModule().setContentHandler(id, mContentHandler);\n  }\n\n  @ReactMethod\n  public void disableBlobSupport(final int id) {\n    getWebSocketModule().setContentHandler(id, null);\n  }\n\n  @ReactMethod\n  public void sendBlob(ReadableMap blob, int id) {\n    byte[] data = resolve(blob.getString(\"blobId\"), blob.getInt(\"offset\"), blob.getInt(\"size\"));\n\n    if (data != null) {\n      getWebSocketModule().sendBinary(ByteString.of(data), id);\n    } else {\n      getWebSocketModule().sendBinary((ByteString) null, id);\n    }\n  }\n\n  @ReactMethod\n  public void createFromParts(ReadableArray parts, String blobId) {\n    int totalBlobSize = 0;\n    ArrayList<ReadableMap> partList = new ArrayList<>(parts.size());\n    for (int i = 0; i < parts.size(); i++) {\n      ReadableMap part = parts.getMap(i);\n      totalBlobSize += part.getInt(\"size\");\n      partList.add(i, part);\n    }\n    ByteBuffer buffer = ByteBuffer.allocate(totalBlobSize);\n    for (ReadableMap part : partList) {\n      buffer.put(resolve(part));\n    }\n    store(buffer.array(), blobId);\n  }\n\n  @ReactMethod\n  public void release(String blobId) {\n    remove(blobId);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobProvider.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * <p>This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\npackage com.facebook.react.modules.blob;\n\nimport android.content.ContentProvider;\nimport android.content.ContentValues;\nimport android.content.Context;\nimport android.database.Cursor;\nimport android.net.Uri;\nimport android.os.ParcelFileDescriptor;\nimport android.support.annotation.Nullable;\nimport com.facebook.react.ReactApplication;\nimport com.facebook.react.ReactNativeHost;\nimport com.facebook.react.bridge.ReactContext;\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.OutputStream;\n\npublic final class BlobProvider extends ContentProvider {\n\n  @Override\n  public boolean onCreate() {\n    return true;\n  }\n\n  @Override\n  public @Nullable Cursor query(\n      Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {\n    return null;\n  }\n\n  @Override\n  public @Nullable String getType(Uri uri) {\n    return null;\n  }\n\n  @Override\n  public @Nullable Uri insert(Uri uri, ContentValues values) {\n    return null;\n  }\n\n  @Override\n  public int delete(Uri uri, String selection, String[] selectionArgs) {\n    return 0;\n  }\n\n  @Override\n  public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {\n    return 0;\n  }\n\n  @Override\n  public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {\n    if (!mode.equals(\"r\")) {\n      throw new FileNotFoundException(\"Cannot open \" + uri.toString() + \" in mode '\" + mode + \"'\");\n    }\n\n    BlobModule blobModule = null;\n    Context context = getContext().getApplicationContext();\n    if (context instanceof ReactApplication) {\n      ReactNativeHost host = ((ReactApplication) context).getReactNativeHost();\n      ReactContext reactContext = host.getReactInstanceManager().getCurrentReactContext();\n      blobModule = reactContext.getNativeModule(BlobModule.class);\n    }\n\n    if (blobModule == null) {\n      throw new RuntimeException(\"No blob module associated with BlobProvider\");\n    }\n\n    byte[] data = blobModule.resolve(uri);\n    if (data == null) {\n      throw new FileNotFoundException(\"Cannot open \" + uri.toString() + \", blob not found.\");\n    }\n\n    ParcelFileDescriptor[] pipe;\n    try {\n      pipe = ParcelFileDescriptor.createPipe();\n    } catch (IOException exception) {\n      return null;\n    }\n    ParcelFileDescriptor readSide = pipe[0];\n    ParcelFileDescriptor writeSide = pipe[1];\n\n    OutputStream outputStream = new ParcelFileDescriptor.AutoCloseOutputStream(writeSide);\n    try {\n      outputStream.write(data);\n      outputStream.close();\n    } catch (IOException exception) {\n      return null;\n    }\n\n    return readSide;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/camera/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"camera\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/camera/CameraRollManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.camera;\n\nimport android.content.ContentResolver;\nimport android.content.Context;\nimport android.content.res.AssetFileDescriptor;\nimport android.database.Cursor;\nimport android.graphics.BitmapFactory;\nimport android.media.MediaMetadataRetriever;\nimport android.media.MediaScannerConnection;\nimport android.net.Uri;\nimport android.os.AsyncTask;\nimport android.os.Build;\nimport android.os.Environment;\nimport android.provider.MediaStore;\nimport android.provider.MediaStore.Images;\nimport android.provider.MediaStore.Video;\nimport android.text.TextUtils;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.GuardedAsyncTask;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.Promise;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeArray;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.module.annotations.ReactModule;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.nio.channels.FileChannel;\nimport java.util.ArrayList;\nimport java.util.List;\nimport javax.annotation.Nullable;\n\n// TODO #6015104: rename to something less iOSish\n/**\n * {@link NativeModule} that allows JS to interact with the photos on the device (i.e.\n * {@link MediaStore.Images}).\n */\n@ReactModule(name = CameraRollManager.NAME)\npublic class CameraRollManager extends ReactContextBaseJavaModule {\n\n  protected static final String NAME = \"CameraRollManager\";\n\n  private static final String ERROR_UNABLE_TO_LOAD = \"E_UNABLE_TO_LOAD\";\n  private static final String ERROR_UNABLE_TO_LOAD_PERMISSION = \"E_UNABLE_TO_LOAD_PERMISSION\";\n  private static final String ERROR_UNABLE_TO_SAVE = \"E_UNABLE_TO_SAVE\";\n\n  public static final boolean IS_JELLY_BEAN_OR_LATER =\n      Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;\n\n  private static final String[] PROJECTION;\n  static {\n    if (IS_JELLY_BEAN_OR_LATER) {\n      PROJECTION = new String[] {\n          Images.Media._ID,\n          Images.Media.MIME_TYPE,\n          Images.Media.BUCKET_DISPLAY_NAME,\n          Images.Media.DATE_TAKEN,\n          Images.Media.WIDTH,\n          Images.Media.HEIGHT,\n          Images.Media.LONGITUDE,\n          Images.Media.LATITUDE\n      };\n    } else {\n      PROJECTION = new String[] {\n          Images.Media._ID,\n          Images.Media.MIME_TYPE,\n          Images.Media.BUCKET_DISPLAY_NAME,\n          Images.Media.DATE_TAKEN,\n          Images.Media.LONGITUDE,\n          Images.Media.LATITUDE\n      };\n    }\n  }\n\n  private static final String SELECTION_BUCKET = Images.Media.BUCKET_DISPLAY_NAME + \" = ?\";\n  private static final String SELECTION_DATE_TAKEN = Images.Media.DATE_TAKEN + \" < ?\";\n\n  public CameraRollManager(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  /**\n   * Save an image to the gallery (i.e. {@link MediaStore.Images}). This copies the original file\n   * from wherever it may be to the external storage pictures directory, so that it can be scanned\n   * by the MediaScanner.\n   *\n   * @param uri the file:// URI of the image to save\n   * @param promise to be resolved or rejected\n   */\n  @ReactMethod\n  public void saveToCameraRoll(String uri, String type, Promise promise) {\n    new SaveToCameraRoll(getReactApplicationContext(), Uri.parse(uri), promise)\n        .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  private static class SaveToCameraRoll extends GuardedAsyncTask<Void, Void> {\n\n    private final Context mContext;\n    private final Uri mUri;\n    private final Promise mPromise;\n\n    public SaveToCameraRoll(ReactContext context, Uri uri, Promise promise) {\n      super(context);\n      mContext = context;\n      mUri = uri;\n      mPromise = promise;\n    }\n\n    @Override\n    protected void doInBackgroundGuarded(Void... params) {\n      File source = new File(mUri.getPath());\n      FileChannel input = null, output = null;\n      try {\n        File exportDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);\n        exportDir.mkdirs();\n        if (!exportDir.isDirectory()) {\n          mPromise.reject(ERROR_UNABLE_TO_LOAD, \"External media storage directory not available\");\n          return;\n        }\n        File dest = new File(exportDir, source.getName());\n        int n = 0;\n        String fullSourceName = source.getName();\n        String sourceName, sourceExt;\n        if (fullSourceName.indexOf('.') >= 0) {\n          sourceName = fullSourceName.substring(0, fullSourceName.lastIndexOf('.'));\n          sourceExt = fullSourceName.substring(fullSourceName.lastIndexOf('.'));\n        } else {\n          sourceName = fullSourceName;\n          sourceExt = \"\";\n        }\n        while (!dest.createNewFile()) {\n          dest = new File(exportDir, sourceName + \"_\" + (n++) + sourceExt);\n        }\n        input = new FileInputStream(source).getChannel();\n        output = new FileOutputStream(dest).getChannel();\n        output.transferFrom(input, 0, input.size());\n        input.close();\n        output.close();\n\n        MediaScannerConnection.scanFile(\n            mContext,\n            new String[]{dest.getAbsolutePath()},\n            null,\n            new MediaScannerConnection.OnScanCompletedListener() {\n              @Override\n              public void onScanCompleted(String path, Uri uri) {\n                if (uri != null) {\n                  mPromise.resolve(uri.toString());\n                } else {\n                  mPromise.reject(ERROR_UNABLE_TO_SAVE, \"Could not add image to gallery\");\n                }\n              }\n            });\n      } catch (IOException e) {\n        mPromise.reject(e);\n      } finally {\n        if (input != null && input.isOpen()) {\n          try {\n            input.close();\n          } catch (IOException e) {\n            FLog.e(ReactConstants.TAG, \"Could not close input channel\", e);\n          }\n        }\n        if (output != null && output.isOpen()) {\n          try {\n            output.close();\n          } catch (IOException e) {\n            FLog.e(ReactConstants.TAG, \"Could not close output channel\", e);\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * Get photos from {@link MediaStore.Images}, most recent first.\n   *\n   * @param params a map containing the following keys:\n   *        <ul>\n   *          <li>first (mandatory): a number representing the number of photos to fetch</li>\n   *          <li>\n   *            after (optional): a cursor that matches page_info[end_cursor] returned by a\n   *            previous call to {@link #getPhotos}\n   *          </li>\n   *          <li>groupName (optional): an album name</li>\n   *          <li>\n   *            mimeType (optional): restrict returned images to a specific mimetype (e.g.\n   *            image/jpeg)\n   *          </li>\n   *          <li>\n   *            assetType (optional): chooses between either photos or videos from the camera roll.\n   *            Valid values are \"Photos\" or \"Videos\". Defaults to photos.\n   *          </li>\n   *        </ul>\n   * @param promise the Promise to be resolved when the photos are loaded; for a format of the\n   *        parameters passed to this callback, see {@code getPhotosReturnChecker} in CameraRoll.js\n   */\n  @ReactMethod\n  public void getPhotos(final ReadableMap params, final Promise promise) {\n    int first = params.getInt(\"first\");\n    String after = params.hasKey(\"after\") ? params.getString(\"after\") : null;\n    String groupName = params.hasKey(\"groupName\") ? params.getString(\"groupName\") : null;\n    String assetType = params.hasKey(\"assetType\") ? params.getString(\"assetType\") : null;\n    ReadableArray mimeTypes = params.hasKey(\"mimeTypes\")\n        ? params.getArray(\"mimeTypes\")\n        : null;\n    if (params.hasKey(\"groupTypes\")) {\n      throw new JSApplicationIllegalArgumentException(\"groupTypes is not supported on Android\");\n    }\n\n    new GetPhotosTask(\n          getReactApplicationContext(),\n          first,\n          after,\n          groupName,\n          mimeTypes,\n          assetType,\n          promise)\n          .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  private static class GetPhotosTask extends GuardedAsyncTask<Void, Void> {\n    private final Context mContext;\n    private final int mFirst;\n    private final @Nullable String mAfter;\n    private final @Nullable String mGroupName;\n    private final @Nullable ReadableArray mMimeTypes;\n    private final Promise mPromise;\n    private final @Nullable String mAssetType;\n\n    private GetPhotosTask(\n        ReactContext context,\n        int first,\n        @Nullable String after,\n        @Nullable String groupName,\n        @Nullable ReadableArray mimeTypes,\n        @Nullable String assetType,\n        Promise promise) {\n      super(context);\n      mContext = context;\n      mFirst = first;\n      mAfter = after;\n      mGroupName = groupName;\n      mMimeTypes = mimeTypes;\n      mPromise = promise;\n      mAssetType = assetType;\n    }\n\n    @Override\n    protected void doInBackgroundGuarded(Void... params) {\n      StringBuilder selection = new StringBuilder(\"1\");\n      List<String> selectionArgs = new ArrayList<>();\n      if (!TextUtils.isEmpty(mAfter)) {\n        selection.append(\" AND \" + SELECTION_DATE_TAKEN);\n        selectionArgs.add(mAfter);\n      }\n      if (!TextUtils.isEmpty(mGroupName)) {\n        selection.append(\" AND \" + SELECTION_BUCKET);\n        selectionArgs.add(mGroupName);\n      }\n      if (mMimeTypes != null && mMimeTypes.size() > 0) {\n        selection.append(\" AND \" + Images.Media.MIME_TYPE + \" IN (\");\n        for (int i = 0; i < mMimeTypes.size(); i++) {\n          selection.append(\"?,\");\n          selectionArgs.add(mMimeTypes.getString(i));\n        }\n        selection.replace(selection.length() - 1, selection.length(), \")\");\n      }\n      WritableMap response = new WritableNativeMap();\n      ContentResolver resolver = mContext.getContentResolver();\n      // using LIMIT in the sortOrder is not explicitly supported by the SDK (which does not support\n      // setting a limit at all), but it works because this specific ContentProvider is backed by\n      // an SQLite DB and forwards parameters to it without doing any parsing / validation.\n      try {\n        Uri assetURI =\n            mAssetType != null && mAssetType.equals(\"Videos\") ? Video.Media.EXTERNAL_CONTENT_URI :\n                Images.Media.EXTERNAL_CONTENT_URI;\n\n        Cursor photos = resolver.query(\n            assetURI,\n            PROJECTION,\n            selection.toString(),\n            selectionArgs.toArray(new String[selectionArgs.size()]),\n            Images.Media.DATE_TAKEN + \" DESC, \" + Images.Media.DATE_MODIFIED + \" DESC LIMIT \" +\n                (mFirst + 1)); // set LIMIT to first + 1 so that we know how to populate page_info\n        if (photos == null) {\n          mPromise.reject(ERROR_UNABLE_TO_LOAD, \"Could not get photos\");\n        } else {\n          try {\n            putEdges(resolver, photos, response, mFirst, mAssetType);\n            putPageInfo(photos, response, mFirst);\n          } finally {\n            photos.close();\n            mPromise.resolve(response);\n          }\n        }\n      } catch (SecurityException e) {\n        mPromise.reject(\n            ERROR_UNABLE_TO_LOAD_PERMISSION,\n            \"Could not get photos: need READ_EXTERNAL_STORAGE permission\",\n            e);\n      }\n    }\n  }\n\n  private static void putPageInfo(Cursor photos, WritableMap response, int limit) {\n    WritableMap pageInfo = new WritableNativeMap();\n    pageInfo.putBoolean(\"has_next_page\", limit < photos.getCount());\n    if (limit < photos.getCount()) {\n      photos.moveToPosition(limit - 1);\n      pageInfo.putString(\n          \"end_cursor\",\n          photos.getString(photos.getColumnIndex(Images.Media.DATE_TAKEN)));\n    }\n    response.putMap(\"page_info\", pageInfo);\n  }\n\n  private static void putEdges(\n      ContentResolver resolver,\n      Cursor photos,\n      WritableMap response,\n      int limit,\n      @Nullable String assetType) {\n    WritableArray edges = new WritableNativeArray();\n    photos.moveToFirst();\n    int idIndex = photos.getColumnIndex(Images.Media._ID);\n    int mimeTypeIndex = photos.getColumnIndex(Images.Media.MIME_TYPE);\n    int groupNameIndex = photos.getColumnIndex(Images.Media.BUCKET_DISPLAY_NAME);\n    int dateTakenIndex = photos.getColumnIndex(Images.Media.DATE_TAKEN);\n    int widthIndex = IS_JELLY_BEAN_OR_LATER ? photos.getColumnIndex(Images.Media.WIDTH) : -1;\n    int heightIndex = IS_JELLY_BEAN_OR_LATER ? photos.getColumnIndex(Images.Media.HEIGHT) : -1;\n    int longitudeIndex = photos.getColumnIndex(Images.Media.LONGITUDE);\n    int latitudeIndex = photos.getColumnIndex(Images.Media.LATITUDE);\n\n    for (int i = 0; i < limit && !photos.isAfterLast(); i++) {\n      WritableMap edge = new WritableNativeMap();\n      WritableMap node = new WritableNativeMap();\n      boolean imageInfoSuccess =\n          putImageInfo(resolver, photos, node, idIndex, widthIndex, heightIndex, assetType);\n      if (imageInfoSuccess) {\n        putBasicNodeInfo(photos, node, mimeTypeIndex, groupNameIndex, dateTakenIndex);\n        putLocationInfo(photos, node, longitudeIndex, latitudeIndex);\n\n        edge.putMap(\"node\", node);\n        edges.pushMap(edge);\n      } else {\n        // we skipped an image because we couldn't get its details (e.g. width/height), so we\n        // decrement i in order to correctly reach the limit, if the cursor has enough rows\n        i--;\n      }\n      photos.moveToNext();\n    }\n    response.putArray(\"edges\", edges);\n  }\n\n  private static void putBasicNodeInfo(\n      Cursor photos,\n      WritableMap node,\n      int mimeTypeIndex,\n      int groupNameIndex,\n      int dateTakenIndex) {\n    node.putString(\"type\", photos.getString(mimeTypeIndex));\n    node.putString(\"group_name\", photos.getString(groupNameIndex));\n    node.putDouble(\"timestamp\", photos.getLong(dateTakenIndex) / 1000d);\n  }\n\n  private static boolean putImageInfo(\n      ContentResolver resolver,\n      Cursor photos,\n      WritableMap node,\n      int idIndex,\n      int widthIndex,\n      int heightIndex,\n      @Nullable String assetType) {\n    WritableMap image = new WritableNativeMap();\n    Uri photoUri;\n    if (assetType != null && assetType.equals(\"Videos\")) {\n      photoUri = Uri.withAppendedPath(Video.Media.EXTERNAL_CONTENT_URI, photos.getString(idIndex));\n    } else {\n      photoUri = Uri.withAppendedPath(Images.Media.EXTERNAL_CONTENT_URI, photos.getString(idIndex));\n    }\n    image.putString(\"uri\", photoUri.toString());\n    float width = -1;\n    float height = -1;\n    if (IS_JELLY_BEAN_OR_LATER) {\n      width = photos.getInt(widthIndex);\n      height = photos.getInt(heightIndex);\n    }\n\n    if (assetType != null\n        && assetType.equals(\"Videos\")\n        && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {\n      try {\n        AssetFileDescriptor photoDescriptor = resolver.openAssetFileDescriptor(photoUri, \"r\");\n        MediaMetadataRetriever retriever = new MediaMetadataRetriever();\n        retriever.setDataSource(photoDescriptor.getFileDescriptor());\n\n        try {\n          if (width <= 0 || height <= 0) {\n            width =\n                Integer.parseInt(\n                    retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH));\n            height =\n                Integer.parseInt(\n                    retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));\n          }\n          int timeInMillisec =\n              Integer.parseInt(\n                  retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION));\n          int playableDuration = timeInMillisec / 1000;\n          image.putInt(\"playableDuration\", playableDuration);\n        } catch (NumberFormatException e) {\n          FLog.e(\n              ReactConstants.TAG,\n              \"Number format exception occurred while trying to fetch video metadata for \"\n                  + photoUri.toString(),\n              e);\n          return false;\n        } finally {\n          retriever.release();\n          photoDescriptor.close();\n        }\n      } catch (IOException e) {\n        FLog.e(ReactConstants.TAG, \"Could not get video metadata for \" + photoUri.toString(), e);\n        return false;\n      }\n    }\n\n    if (width <= 0 || height <= 0) {\n      try {\n        AssetFileDescriptor photoDescriptor = resolver.openAssetFileDescriptor(photoUri, \"r\");\n        BitmapFactory.Options options = new BitmapFactory.Options();\n        // Set inJustDecodeBounds to true so we don't actually load the Bitmap, but only get its\n        // dimensions instead.\n        options.inJustDecodeBounds = true;\n        BitmapFactory.decodeFileDescriptor(photoDescriptor.getFileDescriptor(), null, options);\n        width = options.outWidth;\n        height = options.outHeight;\n        photoDescriptor.close();\n      } catch (IOException e) {\n        FLog.e(ReactConstants.TAG, \"Could not get width/height for \" + photoUri.toString(), e);\n        return false;\n      }\n    }\n    image.putDouble(\"width\", width);\n    image.putDouble(\"height\", height);\n    node.putMap(\"image\", image);\n    return true;\n  }\n\n  private static void putLocationInfo(\n      Cursor photos,\n      WritableMap node,\n      int longitudeIndex,\n      int latitudeIndex) {\n    double longitude = photos.getDouble(longitudeIndex);\n    double latitude = photos.getDouble(latitudeIndex);\n    if (longitude > 0 || latitude > 0) {\n      WritableMap location = new WritableNativeMap();\n      location.putDouble(\"longitude\", longitude);\n      location.putDouble(\"latitude\", latitude);\n      node.putMap(\"location\", location);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/camera/ImageEditingManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.camera;\n\nimport javax.annotation.Nullable;\n\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.FilenameFilter;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.net.URL;\nimport java.net.URLConnection;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\n\nimport android.annotation.SuppressLint;\nimport android.content.Context;\nimport android.database.Cursor;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapRegionDecoder;\nimport android.graphics.BitmapFactory;\nimport android.graphics.Matrix;\nimport android.graphics.Rect;\nimport android.media.ExifInterface;\nimport android.net.Uri;\nimport android.os.AsyncTask;\nimport android.provider.MediaStore;\nimport android.text.TextUtils;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.GuardedAsyncTask;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * Native module that provides image cropping functionality.\n */\n@ReactModule(name = ImageEditingManager.NAME)\npublic class ImageEditingManager extends ReactContextBaseJavaModule {\n\n  protected static final String NAME = \"ImageEditingManager\";\n\n  private static final List<String> LOCAL_URI_PREFIXES = Arrays.asList(\n      \"file://\", \"content://\");\n\n  private static final String TEMP_FILE_PREFIX = \"ReactNative_cropped_image_\";\n\n  /** Compress quality of the output file. */\n  private static final int COMPRESS_QUALITY = 90;\n\n  @SuppressLint(\"InlinedApi\") private static final String[] EXIF_ATTRIBUTES = new String[] {\n    ExifInterface.TAG_APERTURE,\n    ExifInterface.TAG_DATETIME,\n    ExifInterface.TAG_DATETIME_DIGITIZED,\n    ExifInterface.TAG_EXPOSURE_TIME,\n    ExifInterface.TAG_FLASH,\n    ExifInterface.TAG_FOCAL_LENGTH,\n    ExifInterface.TAG_GPS_ALTITUDE,\n    ExifInterface.TAG_GPS_ALTITUDE_REF,\n    ExifInterface.TAG_GPS_DATESTAMP,\n    ExifInterface.TAG_GPS_LATITUDE,\n    ExifInterface.TAG_GPS_LATITUDE_REF,\n    ExifInterface.TAG_GPS_LONGITUDE,\n    ExifInterface.TAG_GPS_LONGITUDE_REF,\n    ExifInterface.TAG_GPS_PROCESSING_METHOD,\n    ExifInterface.TAG_GPS_TIMESTAMP,\n    ExifInterface.TAG_IMAGE_LENGTH,\n    ExifInterface.TAG_IMAGE_WIDTH,\n    ExifInterface.TAG_ISO,\n    ExifInterface.TAG_MAKE,\n    ExifInterface.TAG_MODEL,\n    ExifInterface.TAG_ORIENTATION,\n    ExifInterface.TAG_SUBSEC_TIME,\n    ExifInterface.TAG_SUBSEC_TIME_DIG,\n    ExifInterface.TAG_SUBSEC_TIME_ORIG,\n    ExifInterface.TAG_WHITE_BALANCE\n  };\n\n  public ImageEditingManager(ReactApplicationContext reactContext) {\n    super(reactContext);\n    new CleanTask(getReactApplicationContext()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @Override\n  public Map<String, Object> getConstants() {\n    return Collections.emptyMap();\n  }\n\n  @Override\n  public void onCatalystInstanceDestroy() {\n    new CleanTask(getReactApplicationContext()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  /**\n   * Asynchronous task that cleans up cache dirs (internal and, if available, external) of cropped\n   * image files. This is run when the catalyst instance is being destroyed (i.e. app is shutting\n   * down) and when the module is instantiated, to handle the case where the app crashed.\n   */\n  private static class CleanTask extends GuardedAsyncTask<Void, Void> {\n    private final Context mContext;\n\n    private CleanTask(ReactContext context) {\n      super(context);\n      mContext = context;\n    }\n\n    @Override\n    protected void doInBackgroundGuarded(Void... params) {\n      cleanDirectory(mContext.getCacheDir());\n      File externalCacheDir = mContext.getExternalCacheDir();\n      if (externalCacheDir != null) {\n        cleanDirectory(externalCacheDir);\n      }\n    }\n\n    private void cleanDirectory(File directory) {\n      File[] toDelete = directory.listFiles(\n          new FilenameFilter() {\n            @Override\n            public boolean accept(File dir, String filename) {\n              return filename.startsWith(TEMP_FILE_PREFIX);\n            }\n          });\n      if (toDelete != null) {\n        for (File file: toDelete) {\n          file.delete();\n        }\n      }\n    }\n  }\n\n  /**\n   * Crop an image. If all goes well, the success callback will be called with the file:// URI of\n   * the new image as the only argument. This is a temporary file - consider using\n   * CameraRollManager.saveImageWithTag to save it in the gallery.\n   *\n   * @param uri the MediaStore URI of the image to crop\n   * @param options crop parameters specified as {@code {offset: {x, y}, size: {width, height}}}.\n   *        Optionally this also contains  {@code {targetSize: {width, height}}}. If this is\n   *        specified, the cropped image will be resized to that size.\n   *        All units are in pixels (not DPs).\n   * @param success callback to be invoked when the image has been cropped; the only argument that\n   *        is passed to this callback is the file:// URI of the new image\n   * @param error callback to be invoked when an error occurs (e.g. can't create file etc.)\n   */\n  @ReactMethod\n  public void cropImage(\n      String uri,\n      ReadableMap options,\n      final Callback success,\n      final Callback error) {\n    ReadableMap offset = options.hasKey(\"offset\") ? options.getMap(\"offset\") : null;\n    ReadableMap size = options.hasKey(\"size\") ? options.getMap(\"size\") : null;\n    if (offset == null || size == null ||\n        !offset.hasKey(\"x\") || !offset.hasKey(\"y\") ||\n        !size.hasKey(\"width\") || !size.hasKey(\"height\")) {\n      throw new JSApplicationIllegalArgumentException(\"Please specify offset and size\");\n    }\n    if (uri == null || uri.isEmpty()) {\n      throw new JSApplicationIllegalArgumentException(\"Please specify a URI\");\n    }\n\n    CropTask cropTask = new CropTask(\n        getReactApplicationContext(),\n        uri,\n        (int) offset.getDouble(\"x\"),\n        (int) offset.getDouble(\"y\"),\n        (int) size.getDouble(\"width\"),\n        (int) size.getDouble(\"height\"),\n        success,\n        error);\n    if (options.hasKey(\"displaySize\")) {\n      ReadableMap targetSize = options.getMap(\"displaySize\");\n      cropTask.setTargetSize(\n        (int) targetSize.getDouble(\"width\"),\n        (int) targetSize.getDouble(\"height\"));\n    }\n    cropTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  private static class CropTask extends GuardedAsyncTask<Void, Void> {\n    final Context mContext;\n    final String mUri;\n    final int mX;\n    final int mY;\n    final int mWidth;\n    final int mHeight;\n    int mTargetWidth = 0;\n    int mTargetHeight = 0;\n    final Callback mSuccess;\n    final Callback mError;\n\n    private CropTask(\n        ReactContext context,\n        String uri,\n        int x,\n        int y,\n        int width,\n        int height,\n        Callback success,\n        Callback error) {\n      super(context);\n      if (x < 0 || y < 0 || width <= 0 || height <= 0) {\n        throw new JSApplicationIllegalArgumentException(String.format(\n            \"Invalid crop rectangle: [%d, %d, %d, %d]\", x, y, width, height));\n      }\n      mContext = context;\n      mUri = uri;\n      mX = x;\n      mY = y;\n      mWidth = width;\n      mHeight = height;\n      mSuccess = success;\n      mError = error;\n    }\n\n    public void setTargetSize(int width, int height) {\n      if (width <= 0 || height <= 0) {\n        throw new JSApplicationIllegalArgumentException(String.format(\n            \"Invalid target size: [%d, %d]\", width, height));\n      }\n      mTargetWidth = width;\n      mTargetHeight = height;\n    }\n\n    private InputStream openBitmapInputStream() throws IOException {\n      InputStream stream;\n      if (isLocalUri(mUri)) {\n        stream = mContext.getContentResolver().openInputStream(Uri.parse(mUri));\n      } else {\n        URLConnection connection = new URL(mUri).openConnection();\n        stream = connection.getInputStream();\n      }\n      if (stream == null) {\n        throw new IOException(\"Cannot open bitmap: \" + mUri);\n      }\n      return stream;\n    }\n\n    @Override\n    protected void doInBackgroundGuarded(Void... params) {\n      try {\n        BitmapFactory.Options outOptions = new BitmapFactory.Options();\n\n        // If we're downscaling, we can decode the bitmap more efficiently, using less memory\n        boolean hasTargetSize = (mTargetWidth > 0) && (mTargetHeight > 0);\n\n        Bitmap cropped;\n        if (hasTargetSize) {\n          cropped = cropAndResize(mTargetWidth, mTargetHeight, outOptions);\n        } else {\n          cropped = crop(outOptions);\n        }\n\n        String mimeType = outOptions.outMimeType;\n        if (mimeType == null || mimeType.isEmpty()) {\n          throw new IOException(\"Could not determine MIME type\");\n        }\n\n        File tempFile = createTempFile(mContext, mimeType);\n        writeCompressedBitmapToFile(cropped, mimeType, tempFile);\n\n        if (mimeType.equals(\"image/jpeg\")) {\n          copyExif(mContext, Uri.parse(mUri), tempFile);\n        }\n\n        mSuccess.invoke(Uri.fromFile(tempFile).toString());\n      } catch (Exception e) {\n        mError.invoke(e.getMessage());\n      }\n    }\n\n    /**\n     * Reads and crops the bitmap.\n     * @param outOptions Bitmap options, useful to determine {@code outMimeType}.\n     */\n    private Bitmap crop(BitmapFactory.Options outOptions) throws IOException {\n      InputStream inputStream = openBitmapInputStream();\n      // Effeciently crops image without loading full resolution into memory\n      // https://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html\n      BitmapRegionDecoder decoder = BitmapRegionDecoder.newInstance(inputStream, false);\n      try {\n        Rect rect = new Rect(mX, mY, mX + mWidth, mY + mHeight);\n        return decoder.decodeRegion(rect, outOptions);\n      } finally {\n        if (inputStream != null) {\n          inputStream.close();\n        }\n        decoder.recycle();\n      }\n    }\n\n    /**\n     * Crop the rectangle given by {@code mX, mY, mWidth, mHeight} within the source bitmap\n     * and scale the result to {@code targetWidth, targetHeight}.\n     * @param outOptions Bitmap options, useful to determine {@code outMimeType}.\n     */\n    private Bitmap cropAndResize(\n        int targetWidth,\n        int targetHeight,\n        BitmapFactory.Options outOptions)\n        throws IOException {\n      Assertions.assertNotNull(outOptions);\n\n      // Loading large bitmaps efficiently:\n      // http://developer.android.com/training/displaying-bitmaps/load-bitmap.html\n\n      // Just decode the dimensions\n      BitmapFactory.Options options = new BitmapFactory.Options();\n      options.inJustDecodeBounds = true;\n      InputStream inputStream = openBitmapInputStream();\n      try {\n        BitmapFactory.decodeStream(inputStream, null, options);\n      } finally {\n        if (inputStream != null) {\n          inputStream.close();\n        }\n      }\n\n      // This uses scaling mode COVER\n\n      // Where would the crop rect end up within the scaled bitmap?\n      float newWidth, newHeight, newX, newY, scale;\n      float cropRectRatio = mWidth / (float) mHeight;\n      float targetRatio = targetWidth / (float) targetHeight;\n      if (cropRectRatio > targetRatio) {\n        // e.g. source is landscape, target is portrait\n        newWidth = mHeight * targetRatio;\n        newHeight = mHeight;\n        newX = mX + (mWidth - newWidth) / 2;\n        newY = mY;\n        scale = targetHeight / (float) mHeight;\n      } else {\n        // e.g. source is landscape, target is portrait\n        newWidth = mWidth;\n        newHeight = mWidth / targetRatio;\n        newX = mX;\n        newY = mY + (mHeight - newHeight) / 2;\n        scale = targetWidth / (float) mWidth;\n      }\n\n      // Decode the bitmap. We have to open the stream again, like in the example linked above.\n      // Is there a way to just continue reading from the stream?\n      outOptions.inSampleSize = getDecodeSampleSize(mWidth, mHeight, targetWidth, targetHeight);\n      options.inJustDecodeBounds = false;\n      inputStream = openBitmapInputStream();\n\n      Bitmap bitmap;\n      try {\n        // This can use significantly less memory than decoding the full-resolution bitmap\n        bitmap = BitmapFactory.decodeStream(inputStream, null, outOptions);\n        if (bitmap == null) {\n          throw new IOException(\"Cannot decode bitmap: \" + mUri);\n        }\n      } finally {\n        if (inputStream != null) {\n          inputStream.close();\n        }\n      }\n\n      int cropX = (int) Math.floor(newX / (float) outOptions.inSampleSize);\n      int cropY = (int) Math.floor(newY / (float) outOptions.inSampleSize);\n      int cropWidth = (int) Math.floor(newWidth / (float) outOptions.inSampleSize);\n      int cropHeight = (int) Math.floor(newHeight / (float) outOptions.inSampleSize);\n      float cropScale = scale * outOptions.inSampleSize;\n\n      Matrix scaleMatrix = new Matrix();\n      scaleMatrix.setScale(cropScale, cropScale);\n      boolean filter = true;\n\n      return Bitmap.createBitmap(bitmap, cropX, cropY, cropWidth, cropHeight, scaleMatrix, filter);\n    }\n  }\n\n  // Utils\n\n  private static void copyExif(Context context, Uri oldImage, File newFile) throws IOException {\n    File oldFile = getFileFromUri(context, oldImage);\n    if (oldFile == null) {\n      FLog.w(ReactConstants.TAG, \"Couldn't get real path for uri: \" + oldImage);\n      return;\n    }\n\n    ExifInterface oldExif = new ExifInterface(oldFile.getAbsolutePath());\n    ExifInterface newExif = new ExifInterface(newFile.getAbsolutePath());\n    for (String attribute : EXIF_ATTRIBUTES) {\n      String value = oldExif.getAttribute(attribute);\n      if (value != null) {\n        newExif.setAttribute(attribute, value);\n      }\n    }\n    newExif.saveAttributes();\n  }\n\n  private static @Nullable File getFileFromUri(Context context, Uri uri) {\n    if (uri.getScheme().equals(\"file\")) {\n      return new File(uri.getPath());\n    } else if (uri.getScheme().equals(\"content\")) {\n      Cursor cursor = context.getContentResolver()\n        .query(uri, new String[] { MediaStore.MediaColumns.DATA }, null, null, null);\n      if (cursor != null) {\n        try {\n          if (cursor.moveToFirst()) {\n            String path = cursor.getString(0);\n            if (!TextUtils.isEmpty(path)) {\n              return new File(path);\n            }\n          }\n        } finally {\n          cursor.close();\n        }\n      }\n    }\n\n    return null;\n  }\n\n  private static boolean isLocalUri(String uri) {\n    for (String localPrefix : LOCAL_URI_PREFIXES) {\n      if (uri.startsWith(localPrefix)) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  private static String getFileExtensionForType(@Nullable String mimeType) {\n    if (\"image/png\".equals(mimeType)) {\n      return \".png\";\n    }\n    if (\"image/webp\".equals(mimeType)) {\n      return \".webp\";\n    }\n    return \".jpg\";\n  }\n\n  private static Bitmap.CompressFormat getCompressFormatForType(String type) {\n    if (\"image/png\".equals(type)) {\n      return Bitmap.CompressFormat.PNG;\n    }\n    if (\"image/webp\".equals(type)) {\n      return Bitmap.CompressFormat.WEBP;\n    }\n    return Bitmap.CompressFormat.JPEG;\n  }\n\n  private static void writeCompressedBitmapToFile(Bitmap cropped, String mimeType, File tempFile)\n      throws IOException {\n    OutputStream out = new FileOutputStream(tempFile);\n    try {\n      cropped.compress(getCompressFormatForType(mimeType), COMPRESS_QUALITY, out);\n    } finally {\n      if (out != null) {\n        out.close();\n      }\n    }\n  }\n\n  /**\n   * Create a temporary file in the cache directory on either internal or external storage,\n   * whichever is available and has more free space.\n   *\n   * @param mimeType the MIME type of the file to create (image/*)\n   */\n  private static File createTempFile(Context context, @Nullable String mimeType)\n      throws IOException {\n    File externalCacheDir = context.getExternalCacheDir();\n    File internalCacheDir = context.getCacheDir();\n    File cacheDir;\n    if (externalCacheDir == null && internalCacheDir == null) {\n      throw new IOException(\"No cache directory available\");\n    }\n    if (externalCacheDir == null) {\n      cacheDir = internalCacheDir;\n    }\n    else if (internalCacheDir == null) {\n      cacheDir = externalCacheDir;\n    } else {\n      cacheDir = externalCacheDir.getFreeSpace() > internalCacheDir.getFreeSpace() ?\n          externalCacheDir : internalCacheDir;\n    }\n    return File.createTempFile(TEMP_FILE_PREFIX, getFileExtensionForType(mimeType), cacheDir);\n  }\n\n  /**\n   * When scaling down the bitmap, decode only every n-th pixel in each dimension.\n   * Calculate the largest {@code inSampleSize} value that is a power of 2 and keeps both\n   * {@code width, height} larger or equal to {@code targetWidth, targetHeight}.\n   * This can significantly reduce memory usage.\n   */\n  private static int getDecodeSampleSize(int width, int height, int targetWidth, int targetHeight) {\n    int inSampleSize = 1;\n    if (height > targetWidth || width > targetHeight) {\n      int halfHeight = height / 2;\n      int halfWidth = width / 2;\n      while ((halfWidth / inSampleSize) >= targetWidth\n          && (halfHeight / inSampleSize) >= targetHeight) {\n        inSampleSize *= 2;\n      }\n    }\n    return inSampleSize;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/camera/ImageStoreManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.camera;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.Closeable;\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.InputStream;\n\nimport android.content.ContentResolver;\nimport android.net.Uri;\nimport android.os.AsyncTask;\nimport android.util.Base64;\nimport android.util.Base64OutputStream;\n\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.GuardedAsyncTask;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.module.annotations.ReactModule;\n\n@ReactModule(name = \"ImageStoreManager\")\npublic class ImageStoreManager extends ReactContextBaseJavaModule {\n\n  private static final int BUFFER_SIZE = 8192;\n\n  public ImageStoreManager(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return \"ImageStoreManager\";\n  }\n\n  /**\n   * Calculate the base64 representation for an image. The \"tag\" comes from iOS naming.\n   *\n   * @param uri the URI of the image, file:// or content://\n   * @param success callback to be invoked with the base64 string as the only argument\n   * @param error callback to be invoked on error (e.g. file not found, not readable etc.)\n   */\n  @ReactMethod\n  public void getBase64ForTag(String uri, Callback success, Callback error) {\n    new GetBase64Task(getReactApplicationContext(), uri, success, error)\n        .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  private class GetBase64Task extends GuardedAsyncTask<Void, Void> {\n    private final String mUri;\n    private final Callback mSuccess;\n    private final Callback mError;\n\n    private GetBase64Task(\n        ReactContext reactContext,\n        String uri,\n        Callback success,\n        Callback error) {\n      super(reactContext);\n      mUri = uri;\n      mSuccess = success;\n      mError = error;\n    }\n\n    @Override\n    protected void doInBackgroundGuarded(Void... params) {\n      try {\n        ContentResolver contentResolver = getReactApplicationContext().getContentResolver();\n        Uri uri = Uri.parse(mUri);\n        InputStream is = contentResolver.openInputStream(uri);\n        try {\n          mSuccess.invoke(convertInputStreamToBase64OutputStream(is));\n        } catch (IOException e) {\n          mError.invoke(e.getMessage());\n        } finally {\n          closeQuietly(is);\n        }\n      } catch (FileNotFoundException e) {\n        mError.invoke(e.getMessage());\n      }\n    }\n  }\n\n  String convertInputStreamToBase64OutputStream(InputStream is) throws IOException {\n    ByteArrayOutputStream baos = new ByteArrayOutputStream();\n    Base64OutputStream b64os = new Base64OutputStream(baos, Base64.NO_WRAP);\n    byte[] buffer = new byte[BUFFER_SIZE];\n    int bytesRead;\n    try {\n      while ((bytesRead = is.read(buffer)) > -1) {\n        b64os.write(buffer, 0, bytesRead);\n      }\n    } finally {\n      closeQuietly(b64os); // this also closes baos and flushes the final content to it\n    }\n    return baos.toString();\n  }\n\n  private static void closeQuietly(Closeable closeable) {\n    try {\n      closeable.close();\n    } catch (IOException e) {\n      // shhh\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"clipboard\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/ClipboardModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.clipboard;\n\nimport android.annotation.SuppressLint;\nimport android.content.ClipboardManager;\nimport android.content.ClipData;\nimport android.content.Context;\nimport android.os.Build;\n\nimport com.facebook.react.bridge.ContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.Promise;\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * A module that allows JS to get/set clipboard contents.\n */\n@ReactModule(name = \"Clipboard\")\npublic class ClipboardModule extends ContextBaseJavaModule {\n\n  public ClipboardModule(Context context) {\n    super(context);\n  }\n\n  @Override\n  public String getName() {\n    return \"Clipboard\";\n  }\n\n  private ClipboardManager getClipboardService() {\n    return (ClipboardManager) getContext().getSystemService(getContext().CLIPBOARD_SERVICE);\n  }\n\n  @ReactMethod\n  public void getString(Promise promise) {\n    try {\n      ClipboardManager clipboard = getClipboardService();\n      ClipData clipData = clipboard.getPrimaryClip();\n      if (clipData == null) {\n        promise.resolve(\"\");\n      } else if (clipData.getItemCount() >= 1) {\n        ClipData.Item firstItem = clipboard.getPrimaryClip().getItemAt(0);\n        promise.resolve(\"\" + firstItem.getText());\n      } else {\n        promise.resolve(\"\");\n      }\n    } catch (Exception e) {\n      promise.reject(e);\n    }\n  }\n\n  @SuppressLint(\"DeprecatedMethod\")\n  @ReactMethod\n  public void setString(String text) {\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n      ClipData clipdata = ClipData.newPlainText(null, text);\n      ClipboardManager clipboard = getClipboardService();\n      clipboard.setPrimaryClip(clipdata);\n    } else {\n      ClipboardManager clipboard = getClipboardService();\n      clipboard.setText(text);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/common/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"common\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/core/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"core\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/devsupport:interfaces\"),\n        react_native_target(\"java/com/facebook/react/jstasks:jstasks\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/util:util\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/core/ChoreographerCompat.java",
    "content": "/*\n *  Copyright (c) 2013, Facebook, Inc.\n *  All rights reserved.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n *  This file was pulled from the facebook/rebound repository.\n */\npackage com.facebook.react.modules.core;\n\nimport android.annotation.TargetApi;\nimport android.os.Build;\nimport android.os.Handler;\nimport android.os.Looper;\nimport android.view.Choreographer;\n\n/**\n * Wrapper class for abstracting away availability of the JellyBean Choreographer. If Choreographer\n * is unavailable we fallback to using a normal Handler.\n */\npublic class ChoreographerCompat {\n\n  private static final long ONE_FRAME_MILLIS = 17;\n  private static final boolean IS_JELLYBEAN_OR_HIGHER =\n    Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;\n  private static final ChoreographerCompat INSTANCE = new ChoreographerCompat();\n\n  private Handler mHandler;\n  private Choreographer mChoreographer;\n\n  public static ChoreographerCompat getInstance() {\n    return INSTANCE;\n  }\n\n  private ChoreographerCompat() {\n    if (IS_JELLYBEAN_OR_HIGHER) {\n      mChoreographer = getChoreographer();\n    } else {\n      mHandler = new Handler(Looper.getMainLooper());\n    }\n  }\n\n  public void postFrameCallback(FrameCallback callbackWrapper) {\n    if (IS_JELLYBEAN_OR_HIGHER) {\n      choreographerPostFrameCallback(callbackWrapper.getFrameCallback());\n    } else {\n      mHandler.postDelayed(callbackWrapper.getRunnable(), 0);\n    }\n  }\n\n  public void postFrameCallbackDelayed(FrameCallback callbackWrapper, long delayMillis) {\n    if (IS_JELLYBEAN_OR_HIGHER) {\n      choreographerPostFrameCallbackDelayed(callbackWrapper.getFrameCallback(), delayMillis);\n    } else {\n      mHandler.postDelayed(callbackWrapper.getRunnable(), delayMillis + ONE_FRAME_MILLIS);\n    }\n  }\n\n  public void removeFrameCallback(FrameCallback callbackWrapper) {\n    if (IS_JELLYBEAN_OR_HIGHER) {\n      choreographerRemoveFrameCallback(callbackWrapper.getFrameCallback());\n    } else {\n      mHandler.removeCallbacks(callbackWrapper.getRunnable());\n    }\n  }\n\n  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)\n  private Choreographer getChoreographer() {\n    return Choreographer.getInstance();\n  }\n\n  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)\n  private void choreographerPostFrameCallback(Choreographer.FrameCallback frameCallback) {\n    mChoreographer.postFrameCallback(frameCallback);\n  }\n\n  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)\n  private void choreographerPostFrameCallbackDelayed(\n    Choreographer.FrameCallback frameCallback,\n    long delayMillis) {\n    mChoreographer.postFrameCallbackDelayed(frameCallback, delayMillis);\n  }\n\n  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)\n  private void choreographerRemoveFrameCallback(Choreographer.FrameCallback frameCallback) {\n    mChoreographer.removeFrameCallback(frameCallback);\n  }\n\n  /**\n   * This class provides a compatibility wrapper around the JellyBean FrameCallback with methods\n   * to access cached wrappers for submitting a real FrameCallback to a Choreographer or a Runnable\n   * to a Handler.\n   */\n  public static abstract class FrameCallback {\n\n    private Runnable mRunnable;\n    private Choreographer.FrameCallback mFrameCallback;\n\n    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)\n    Choreographer.FrameCallback getFrameCallback() {\n      if (mFrameCallback == null) {\n        mFrameCallback = new Choreographer.FrameCallback() {\n          @Override\n          public void doFrame(long frameTimeNanos) {\n            FrameCallback.this.doFrame(frameTimeNanos);\n          }\n        };\n      }\n      return mFrameCallback;\n    }\n\n    Runnable getRunnable() {\n      if (mRunnable == null) {\n        mRunnable = new Runnable() {\n          @Override\n          public void run() {\n            doFrame(System.nanoTime());\n          }\n        };\n      }\n      return mRunnable;\n    }\n\n    /**\n     * Just a wrapper for frame callback, see {@link android.view.Choreographer.FrameCallback#doFrame(long)}.\n     */\n    public abstract void doFrame(long frameTimeNanos);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/core/DeviceEventManagerModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.core;\n\nimport javax.annotation.Nullable;\n\nimport android.net.Uri;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * Native module that handles device hardware events like hardware back presses.\n */\n@ReactModule(name = \"DeviceEventManager\")\npublic class DeviceEventManagerModule extends ReactContextBaseJavaModule {\n\n  public interface RCTDeviceEventEmitter extends JavaScriptModule {\n    void emit(String eventName, @Nullable Object data);\n  }\n\n  private final Runnable mInvokeDefaultBackPressRunnable;\n\n  public DeviceEventManagerModule(\n      ReactApplicationContext reactContext,\n      final DefaultHardwareBackBtnHandler backBtnHandler) {\n    super(reactContext);\n    mInvokeDefaultBackPressRunnable = new Runnable() {\n      @Override\n      public void run() {\n        UiThreadUtil.assertOnUiThread();\n        backBtnHandler.invokeDefaultOnBackPressed();\n      }\n    };\n  }\n\n  /**\n   * Sends an event to the JS instance that the hardware back has been pressed.\n   */\n  public void emitHardwareBackPressed() {\n    getReactApplicationContext()\n        .getJSModule(RCTDeviceEventEmitter.class)\n        .emit(\"hardwareBackPress\", null);\n  }\n\n  /**\n   * Sends an event to the JS instance that a new intent was received.\n   */\n  public void emitNewIntentReceived(Uri uri) {\n    WritableMap map = Arguments.createMap();\n    map.putString(\"url\", uri.toString());\n    getReactApplicationContext()\n        .getJSModule(RCTDeviceEventEmitter.class)\n        .emit(\"url\", map);\n  }\n\n  /**\n   * Invokes the default back handler for the host of this catalyst instance. This should be invoked\n   * if JS does not want to handle the back press itself.\n   */\n  @ReactMethod\n  public void invokeDefaultBackPressHandler() {\n    getReactApplicationContext().runOnUiQueueThread(mInvokeDefaultBackPressRunnable);\n  }\n\n  @Override\n  public String getName() {\n    return \"DeviceEventManager\";\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.core;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.common.JavascriptException;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.devsupport.interfaces.DevSupportManager;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.util.JSStackTrace;\n\n@ReactModule(name = ExceptionsManagerModule.NAME)\npublic class ExceptionsManagerModule extends BaseJavaModule {\n\n  protected static final String NAME = \"ExceptionsManager\";\n\n  private final DevSupportManager mDevSupportManager;\n\n  public ExceptionsManagerModule(DevSupportManager devSupportManager) {\n    mDevSupportManager = devSupportManager;\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @ReactMethod\n  public void reportFatalException(String title, ReadableArray details, int exceptionId) {\n    showOrThrowError(title, details, exceptionId);\n  }\n\n  @ReactMethod\n  public void reportSoftException(String title, ReadableArray details, int exceptionId) {\n    if (mDevSupportManager.getDevSupportEnabled()) {\n      mDevSupportManager.showNewJSError(title, details, exceptionId);\n    } else {\n      FLog.e(ReactConstants.TAG, JSStackTrace.format(title, details));\n    }\n  }\n\n  private void showOrThrowError(String title, ReadableArray details, int exceptionId) {\n    if (mDevSupportManager.getDevSupportEnabled()) {\n      mDevSupportManager.showNewJSError(title, details, exceptionId);\n    } else {\n      throw new JavascriptException(JSStackTrace.format(title, details));\n    }\n  }\n\n  @ReactMethod\n  public void updateExceptionMessage(String title, ReadableArray details, int exceptionId) {\n    if (mDevSupportManager.getDevSupportEnabled()) {\n      mDevSupportManager.updateJSError(title, details, exceptionId);\n    }\n  }\n\n  @ReactMethod\n  public void dismissRedbox() {\n    if (mDevSupportManager.getDevSupportEnabled()) {\n      mDevSupportManager.hideRedboxDialog();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/core/HeadlessJsTaskSupportModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.core;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.jstasks.HeadlessJsTaskContext;\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * Simple native module that allows JS to notify native of having completed some task work, so that\n * it can e.g. release any resources, stop timers etc.\n */\n@ReactModule(name = HeadlessJsTaskSupportModule.MODULE_NAME)\npublic class HeadlessJsTaskSupportModule extends ReactContextBaseJavaModule {\n\n  protected static final String MODULE_NAME = \"HeadlessJsTaskSupport\";\n\n  public HeadlessJsTaskSupportModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return MODULE_NAME;\n  }\n\n  @ReactMethod\n  public void notifyTaskFinished(int taskId) {\n    HeadlessJsTaskContext headlessJsTaskContext =\n      HeadlessJsTaskContext.getInstance(getReactApplicationContext());\n    if (headlessJsTaskContext.isTaskRunning(taskId)) {\n      headlessJsTaskContext.finishTask(taskId);\n    } else {\n      FLog.w(\n        HeadlessJsTaskSupportModule.class,\n        \"Tried to finish non-active task with id %d. Did it time out?\",\n        taskId);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/core/JSTimers.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.core;\n\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.WritableArray;\n\npublic interface JSTimers extends JavaScriptModule {\n  void callTimers(WritableArray timerIDs);\n  void callIdleCallbacks(double frameTime);\n  void emitTimeDriftWarning(String warningMessage);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/core/PermissionAwareActivity.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.core;\n\nimport android.app.Activity;\n\n/**\n * Interface used to denote activities that can forward permission requests and call\n * {@link PermissionListener}s with the permission request results.\n */\npublic interface PermissionAwareActivity {\n\n  /**\n   * See {@link Activity#checkPermission}.\n   */\n  int checkPermission(String permission, int pid, int uid);\n\n  /**\n   * See {@link Activity#checkSelfPermission}.\n   */\n  int checkSelfPermission(String permission);\n\n  /**\n   * See {@link Activity#shouldShowRequestPermissionRationale}.\n   */\n  boolean shouldShowRequestPermissionRationale(String permission);\n\n  /**\n   * See {@link Activity#requestPermissions}.\n   */\n  void requestPermissions(String[] permissions, int requestCode, PermissionListener listener);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/core/PermissionListener.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.core;\n\nimport android.app.Activity;\n\n/**\n * Interface used by activities to delegate permission request results. Classes implementing this\n * class will be notified whenever there's a result for a permission request.\n */\npublic interface PermissionListener {\n\n  /**\n   * Method called whenever there's a result to a permission request. It is forwarded from\n   * {@link Activity#onRequestPermissionsResult}.\n   *\n   * @return boolean Whether the PermissionListener can be removed.\n   */\n  boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactChoreographer.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.core;\n\nimport java.util.ArrayDeque;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.common.ReactConstants;\n\n/**\n * A simple wrapper around Choreographer that allows us to control the order certain callbacks\n * are executed within a given frame. The main difference is that we enforce this is accessed from\n * the UI thread: this is because this ordering cannot be guaranteed across multiple threads.\n */\npublic class ReactChoreographer {\n\n  public enum CallbackType {\n\n    /**\n     * For use by perf markers that need to happen immediately after draw\n     */\n    PERF_MARKERS(0),\n\n    /**\n     * For use by {@link com.facebook.react.uimanager.UIManagerModule}\n     */\n    DISPATCH_UI(1),\n\n    /**\n     * For use by {@link com.facebook.react.animated.NativeAnimatedModule}\n     */\n    NATIVE_ANIMATED_MODULE(2),\n\n    /**\n     * Events that make JS do things.\n     */\n    TIMERS_EVENTS(3),\n\n    /**\n     * Event used to trigger the idle callback. Called after all UI work has been\n     * dispatched to JS.\n     */\n    IDLE_EVENT(4),\n    ;\n\n    private final int mOrder;\n\n    private CallbackType(int order) {\n      mOrder = order;\n    }\n\n    /*package*/ int getOrder() {\n      return mOrder;\n    }\n  }\n\n  private static ReactChoreographer sInstance;\n\n  public static void initialize() {\n    if (sInstance == null) {\n      UiThreadUtil.assertOnUiThread();\n      sInstance = new ReactChoreographer();\n    }\n  }\n\n  public static ReactChoreographer getInstance() {\n    Assertions.assertNotNull(sInstance, \"ReactChoreographer needs to be initialized.\");\n    return sInstance;\n  }\n\n  private final ChoreographerCompat mChoreographer;\n  private final ReactChoreographerDispatcher mReactChoreographerDispatcher;\n  private final ArrayDeque<ChoreographerCompat.FrameCallback>[] mCallbackQueues;\n\n  private int mTotalCallbacks = 0;\n  private boolean mHasPostedCallback = false;\n\n  private ReactChoreographer() {\n    mChoreographer = ChoreographerCompat.getInstance();\n    mReactChoreographerDispatcher = new ReactChoreographerDispatcher();\n    mCallbackQueues = new ArrayDeque[CallbackType.values().length];\n    for (int i = 0; i < mCallbackQueues.length; i++) {\n      mCallbackQueues[i] = new ArrayDeque<>();\n    }\n  }\n\n  public synchronized void postFrameCallback(\n    CallbackType type,\n    ChoreographerCompat.FrameCallback frameCallback) {\n    mCallbackQueues[type.getOrder()].addLast(frameCallback);\n    mTotalCallbacks++;\n    Assertions.assertCondition(mTotalCallbacks > 0);\n    if (!mHasPostedCallback) {\n      mChoreographer.postFrameCallback(mReactChoreographerDispatcher);\n      mHasPostedCallback = true;\n    }\n  }\n\n  public synchronized void removeFrameCallback(\n    CallbackType type,\n    ChoreographerCompat.FrameCallback frameCallback) {\n    if (mCallbackQueues[type.getOrder()].removeFirstOccurrence(frameCallback)) {\n      mTotalCallbacks--;\n      maybeRemoveFrameCallback();\n    } else {\n      FLog.e(ReactConstants.TAG, \"Tried to remove non-existent frame callback\");\n    }\n  }\n\n  private void maybeRemoveFrameCallback() {\n    Assertions.assertCondition(mTotalCallbacks >= 0);\n    if (mTotalCallbacks == 0 && mHasPostedCallback) {\n      mChoreographer.removeFrameCallback(mReactChoreographerDispatcher);\n      mHasPostedCallback = false;\n    }\n  }\n\n  private class ReactChoreographerDispatcher extends ChoreographerCompat.FrameCallback {\n\n    @Override\n    public void doFrame(long frameTimeNanos) {\n      synchronized (ReactChoreographer.this) {\n        mHasPostedCallback = false;\n        for (int i = 0; i < mCallbackQueues.length; i++) {\n          int initialLength = mCallbackQueues[i].size();\n          for (int callback = 0; callback < initialLength; callback++) {\n            mCallbackQueues[i].removeFirst().doFrame(frameTimeNanos);\n            mTotalCallbacks--;\n          }\n        }\n        maybeRemoveFrameCallback();\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/core/Timing.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.core;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Comparator;\nimport java.util.PriorityQueue;\nimport java.util.concurrent.atomic.AtomicBoolean;\n\nimport android.util.SparseArray;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.common.SystemClock;\nimport com.facebook.react.devsupport.interfaces.DevSupportManager;\nimport com.facebook.react.jstasks.HeadlessJsTaskContext;\nimport com.facebook.react.jstasks.HeadlessJsTaskEventListener;\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * Native module for JS timer execution. Timers fire on frame boundaries.\n */\n@ReactModule(name = Timing.NAME)\npublic final class Timing extends ReactContextBaseJavaModule implements LifecycleEventListener,\n  HeadlessJsTaskEventListener {\n\n  protected static final String NAME = \"Timing\";\n\n  // These timing contants should be kept in sync with the ones in `JSTimers.js`.\n  // The minimum time in milliseconds left in the frame to call idle callbacks.\n  private static final float IDLE_CALLBACK_FRAME_DEADLINE_MS = 1.f;\n  // The total duration of a frame in milliseconds, this assumes that devices run at 60 fps.\n  // TODO: Lower frame duration on devices that are too slow to run consistently\n  // at 60 fps.\n  private static final float FRAME_DURATION_MS = 1000.f / 60.f;\n\n  private final DevSupportManager mDevSupportManager;\n\n  private static class Timer {\n    private final int mCallbackID;\n    private final boolean mRepeat;\n    private final int mInterval;\n    private long mTargetTime;\n\n    private Timer(\n        int callbackID,\n        long initialTargetTime,\n        int duration,\n        boolean repeat) {\n      mCallbackID = callbackID;\n      mTargetTime = initialTargetTime;\n      mInterval = duration;\n      mRepeat = repeat;\n    }\n  }\n\n  private class TimerFrameCallback extends ChoreographerCompat.FrameCallback {\n\n    // Temporary map for constructing the individual arrays of timers to call\n    private @Nullable WritableArray mTimersToCall = null;\n\n    /**\n     * Calls all timers that have expired since the last time this frame callback was called.\n     */\n    @Override\n    public void doFrame(long frameTimeNanos) {\n      if (isPaused.get() && !isRunningTasks.get()) {\n        return;\n      }\n\n      long frameTimeMillis = frameTimeNanos / 1000000;\n      synchronized (mTimerGuard) {\n        while (!mTimers.isEmpty() && mTimers.peek().mTargetTime < frameTimeMillis) {\n          Timer timer = mTimers.poll();\n          if (mTimersToCall == null) {\n            mTimersToCall = Arguments.createArray();\n          }\n          mTimersToCall.pushInt(timer.mCallbackID);\n          if (timer.mRepeat) {\n            timer.mTargetTime = frameTimeMillis + timer.mInterval;\n            mTimers.add(timer);\n          } else {\n            mTimerIdsToTimers.remove(timer.mCallbackID);\n          }\n        }\n      }\n\n      if (mTimersToCall != null) {\n        getReactApplicationContext().getJSModule(JSTimers.class).callTimers(mTimersToCall);\n        mTimersToCall = null;\n      }\n\n      mReactChoreographer.postFrameCallback(ReactChoreographer.CallbackType.TIMERS_EVENTS, this);\n    }\n  }\n\n  private class IdleFrameCallback extends ChoreographerCompat.FrameCallback {\n\n    @Override\n    public void doFrame(long frameTimeNanos) {\n      if (isPaused.get() && !isRunningTasks.get()) {\n        return;\n      }\n\n      // If the JS thread is busy for multiple frames we cancel any other pending runnable.\n      if (mCurrentIdleCallbackRunnable != null) {\n        mCurrentIdleCallbackRunnable.cancel();\n      }\n\n      mCurrentIdleCallbackRunnable = new IdleCallbackRunnable(frameTimeNanos);\n      getReactApplicationContext().runOnJSQueueThread(mCurrentIdleCallbackRunnable);\n\n      mReactChoreographer.postFrameCallback(ReactChoreographer.CallbackType.IDLE_EVENT, this);\n    }\n  }\n\n  private class IdleCallbackRunnable implements Runnable {\n    private volatile boolean mCancelled = false;\n    private final long mFrameStartTime;\n\n    public IdleCallbackRunnable(long frameStartTime) {\n      mFrameStartTime = frameStartTime;\n    }\n\n    @Override\n    public void run() {\n      if (mCancelled) {\n        return;\n      }\n\n      long frameTimeMillis = mFrameStartTime / 1000000;\n      long timeSinceBoot = SystemClock.uptimeMillis();\n      long frameTimeElapsed = timeSinceBoot - frameTimeMillis;\n      long time = SystemClock.currentTimeMillis();\n      long absoluteFrameStartTime = time - frameTimeElapsed;\n\n      if (FRAME_DURATION_MS - (float) frameTimeElapsed < IDLE_CALLBACK_FRAME_DEADLINE_MS) {\n        return;\n      }\n\n      boolean sendIdleEvents;\n      synchronized (mIdleCallbackGuard) {\n        sendIdleEvents = mSendIdleEvents;\n      }\n\n      if (sendIdleEvents) {\n        getReactApplicationContext().getJSModule(JSTimers.class)\n            .callIdleCallbacks(absoluteFrameStartTime);\n      }\n\n      mCurrentIdleCallbackRunnable = null;\n    }\n\n    public void cancel() {\n      mCancelled = true;\n    }\n  }\n\n  private final Object mTimerGuard = new Object();\n  private final Object mIdleCallbackGuard = new Object();\n  private final PriorityQueue<Timer> mTimers;\n  private final SparseArray<Timer> mTimerIdsToTimers;\n  private final AtomicBoolean isPaused = new AtomicBoolean(true);\n  private final AtomicBoolean isRunningTasks = new AtomicBoolean(false);\n  private final TimerFrameCallback mTimerFrameCallback = new TimerFrameCallback();\n  private final IdleFrameCallback mIdleFrameCallback = new IdleFrameCallback();\n  private final ReactChoreographer mReactChoreographer;\n  private @Nullable IdleCallbackRunnable mCurrentIdleCallbackRunnable;\n  private boolean mFrameCallbackPosted = false;\n  private boolean mFrameIdleCallbackPosted = false;\n  private boolean mSendIdleEvents = false;\n\n  public Timing(ReactApplicationContext reactContext, DevSupportManager devSupportManager) {\n    super(reactContext);\n    mDevSupportManager = devSupportManager;\n    // We store timers sorted by finish time.\n    mTimers = new PriorityQueue<Timer>(\n        11, // Default capacity: for some reason they don't expose a (Comparator) constructor\n        new Comparator<Timer>() {\n          @Override\n          public int compare(Timer lhs, Timer rhs) {\n            long diff = lhs.mTargetTime - rhs.mTargetTime;\n            if (diff == 0) {\n              return 0;\n            } else if (diff < 0) {\n              return -1;\n            } else {\n              return 1;\n            }\n          }\n        });\n    mTimerIdsToTimers = new SparseArray<>();\n    mReactChoreographer = ReactChoreographer.getInstance();\n  }\n\n  @Override\n  public void initialize() {\n    getReactApplicationContext().addLifecycleEventListener(this);\n    HeadlessJsTaskContext headlessJsTaskContext =\n      HeadlessJsTaskContext.getInstance(getReactApplicationContext());\n    headlessJsTaskContext.addTaskEventListener(this);\n  }\n\n  @Override\n  public void onHostPause() {\n    isPaused.set(true);\n    clearFrameCallback();\n    maybeIdleCallback();\n  }\n\n  @Override\n  public void onHostDestroy() {\n    clearFrameCallback();\n    maybeIdleCallback();\n  }\n\n  @Override\n  public void onHostResume() {\n    isPaused.set(false);\n    // TODO(5195192) Investigate possible problems related to restarting all tasks at the same\n    // moment\n    setChoreographerCallback();\n    maybeSetChoreographerIdleCallback();\n  }\n\n  @Override\n  public void onHeadlessJsTaskStart(int taskId) {\n    if (!isRunningTasks.getAndSet(true)) {\n      setChoreographerCallback();\n      maybeSetChoreographerIdleCallback();\n    }\n  }\n\n  @Override\n  public void onHeadlessJsTaskFinish(int taskId) {\n    HeadlessJsTaskContext headlessJsTaskContext =\n      HeadlessJsTaskContext.getInstance(getReactApplicationContext());\n    if (!headlessJsTaskContext.hasActiveTasks()) {\n      isRunningTasks.set(false);\n      clearFrameCallback();\n      maybeIdleCallback();\n    }\n  }\n\n  @Override\n  public void onCatalystInstanceDestroy() {\n    clearFrameCallback();\n    clearChoreographerIdleCallback();\n    HeadlessJsTaskContext headlessJsTaskContext =\n      HeadlessJsTaskContext.getInstance(getReactApplicationContext());\n    headlessJsTaskContext.removeTaskEventListener(this);\n  }\n\n  private void maybeSetChoreographerIdleCallback() {\n    synchronized (mIdleCallbackGuard) {\n      if (mSendIdleEvents) {\n        setChoreographerIdleCallback();\n      }\n    }\n  }\n\n  private void maybeIdleCallback() {\n    if (isPaused.get() && !isRunningTasks.get()) {\n      clearFrameCallback();\n    }\n  }\n\n  private void setChoreographerCallback() {\n    if (!mFrameCallbackPosted) {\n      mReactChoreographer.postFrameCallback(\n          ReactChoreographer.CallbackType.TIMERS_EVENTS,\n          mTimerFrameCallback);\n      mFrameCallbackPosted = true;\n    }\n  }\n\n  private void clearFrameCallback() {\n    HeadlessJsTaskContext headlessJsTaskContext =\n      HeadlessJsTaskContext.getInstance(getReactApplicationContext());\n    if (mFrameCallbackPosted && isPaused.get() &&\n      !headlessJsTaskContext.hasActiveTasks()) {\n      mReactChoreographer.removeFrameCallback(\n          ReactChoreographer.CallbackType.TIMERS_EVENTS,\n          mTimerFrameCallback);\n      mFrameCallbackPosted = false;\n    }\n  }\n\n  private void setChoreographerIdleCallback() {\n    if (!mFrameIdleCallbackPosted) {\n      mReactChoreographer.postFrameCallback(\n          ReactChoreographer.CallbackType.IDLE_EVENT,\n          mIdleFrameCallback);\n      mFrameIdleCallbackPosted = true;\n    }\n  }\n\n  private void clearChoreographerIdleCallback() {\n    if (mFrameIdleCallbackPosted) {\n      mReactChoreographer.removeFrameCallback(\n          ReactChoreographer.CallbackType.IDLE_EVENT,\n          mIdleFrameCallback);\n      mFrameIdleCallbackPosted = false;\n    }\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @ReactMethod\n  public void createTimer(\n      final int callbackID,\n      final int duration,\n      final double jsSchedulingTime,\n      final boolean repeat) {\n    long deviceTime = SystemClock.currentTimeMillis();\n    long remoteTime = (long) jsSchedulingTime;\n\n    // If the times on the server and device have drifted throw an exception to warn the developer\n    // that things might not work or results may not be accurate. This is required only for\n    // developer builds.\n    if (mDevSupportManager.getDevSupportEnabled()) {\n      long driftTime = Math.abs(remoteTime - deviceTime);\n      if (driftTime > 60000) {\n        getReactApplicationContext().getJSModule(JSTimers.class)\n          .emitTimeDriftWarning(\n            \"Debugger and device times have drifted by more than 60s. Please correct this by \" +\n            \"running adb shell \\\"date `date +%m%d%H%M%Y.%S`\\\" on your debugger machine.\");\n      }\n    }\n\n    // Adjust for the amount of time it took for native to receive the timer registration call\n    long adjustedDuration = Math.max(0, remoteTime - deviceTime + duration);\n    if (duration == 0 && !repeat) {\n      WritableArray timerToCall = Arguments.createArray();\n      timerToCall.pushInt(callbackID);\n      getReactApplicationContext().getJSModule(JSTimers.class)\n        .callTimers(timerToCall);\n      return;\n    }\n\n    long initialTargetTime = SystemClock.nanoTime() / 1000000 + adjustedDuration;\n    Timer timer = new Timer(callbackID, initialTargetTime, duration, repeat);\n    synchronized (mTimerGuard) {\n      mTimers.add(timer);\n      mTimerIdsToTimers.put(callbackID, timer);\n    }\n  }\n\n  @ReactMethod\n  public void deleteTimer(int timerId) {\n    synchronized (mTimerGuard) {\n      Timer timer = mTimerIdsToTimers.get(timerId);\n      if (timer == null) {\n        return;\n      }\n      mTimerIdsToTimers.remove(timerId);\n      mTimers.remove(timer);\n    }\n  }\n\n  @ReactMethod\n  public void setSendIdleEvents(final boolean sendIdleEvents) {\n    synchronized (mIdleCallbackGuard) {\n      mSendIdleEvents = sendIdleEvents;\n    }\n\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        synchronized (mIdleCallbackGuard) {\n          if (sendIdleEvents) {\n            setChoreographerIdleCallback();\n          } else {\n            clearChoreographerIdleCallback();\n          }\n        }\n      }\n    });\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"datepicker\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.datepicker;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Calendar;\nimport java.util.Locale;\n\nimport android.annotation.SuppressLint;\nimport android.app.DatePickerDialog;\nimport android.app.DatePickerDialog.OnDateSetListener;\nimport android.app.Dialog;\nimport android.app.DialogFragment;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.content.DialogInterface.OnDismissListener;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.widget.DatePicker;\n\n@SuppressLint(\"ValidFragment\")\npublic class DatePickerDialogFragment extends DialogFragment {\n\n  /**\n   * Minimum date supported by {@link DatePicker}, 01 Jan 1900\n   */\n  private static final long DEFAULT_MIN_DATE = -2208988800001l;\n\n  @Nullable\n  private OnDateSetListener mOnDateSetListener;\n  @Nullable\n  private OnDismissListener mOnDismissListener;\n\n  @Override\n  public Dialog onCreateDialog(Bundle savedInstanceState) {\n    Bundle args = getArguments();\n    return createDialog(args, getActivity(), mOnDateSetListener);\n  }\n\n  /*package*/ static Dialog createDialog(\n      Bundle args, Context activityContext, @Nullable OnDateSetListener onDateSetListener) {\n    final Calendar c = Calendar.getInstance();\n    if (args != null && args.containsKey(DatePickerDialogModule.ARG_DATE)) {\n      c.setTimeInMillis(args.getLong(DatePickerDialogModule.ARG_DATE));\n    }\n    final int year = c.get(Calendar.YEAR);\n    final int month = c.get(Calendar.MONTH);\n    final int day = c.get(Calendar.DAY_OF_MONTH);\n\n    DatePickerMode mode = DatePickerMode.DEFAULT;\n    if (args != null && args.getString(DatePickerDialogModule.ARG_MODE, null) != null) {\n      mode = DatePickerMode.valueOf(args.getString(DatePickerDialogModule.ARG_MODE).toUpperCase(Locale.US));\n    }\n\n    DatePickerDialog dialog = null;\n\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n      switch (mode) {\n        case CALENDAR:\n          dialog = new DismissableDatePickerDialog(activityContext,\n            activityContext.getResources().getIdentifier(\"CalendarDatePickerDialog\", \"style\", activityContext.getPackageName()),\n            onDateSetListener, year, month, day);\n          break;\n        case SPINNER:\n          dialog = new DismissableDatePickerDialog(activityContext,\n            activityContext.getResources().getIdentifier(\"SpinnerDatePickerDialog\", \"style\", activityContext.getPackageName()),\n            onDateSetListener, year, month, day);\n          break;\n        case DEFAULT:\n          dialog = new DismissableDatePickerDialog(activityContext, onDateSetListener, year, month, day);\n          break;\n      }\n    } else {\n      dialog = new DismissableDatePickerDialog(activityContext, onDateSetListener, year, month, day);\n\n      switch (mode) {\n        case CALENDAR:\n          dialog.getDatePicker().setCalendarViewShown(true);\n          dialog.getDatePicker().setSpinnersShown(false);\n          break;\n        case SPINNER:\n          dialog.getDatePicker().setCalendarViewShown(false);\n          break;\n      }\n    }\n\n    final DatePicker datePicker = dialog.getDatePicker();\n\n    if (args != null && args.containsKey(DatePickerDialogModule.ARG_MINDATE)) {\n      // Set minDate to the beginning of the day. We need this because of clowniness in datepicker\n      // that causes it to throw an exception if minDate is greater than the internal timestamp\n      // that it generates from the y/m/d passed in the constructor.\n      c.setTimeInMillis(args.getLong(DatePickerDialogModule.ARG_MINDATE));\n      c.set(Calendar.HOUR_OF_DAY, 0);\n      c.set(Calendar.MINUTE, 0);\n      c.set(Calendar.SECOND, 0);\n      c.set(Calendar.MILLISECOND, 0);\n      datePicker.setMinDate(c.getTimeInMillis());\n    } else {\n      // This is to work around a bug in DatePickerDialog where it doesn't display a title showing\n      // the date under certain conditions.\n      datePicker.setMinDate(DEFAULT_MIN_DATE);\n    }\n    if (args != null && args.containsKey(DatePickerDialogModule.ARG_MAXDATE)) {\n      // Set maxDate to the end of the day, same reason as for minDate.\n      c.setTimeInMillis(args.getLong(DatePickerDialogModule.ARG_MAXDATE));\n      c.set(Calendar.HOUR_OF_DAY, 23);\n      c.set(Calendar.MINUTE, 59);\n      c.set(Calendar.SECOND, 59);\n      c.set(Calendar.MILLISECOND, 999);\n      datePicker.setMaxDate(c.getTimeInMillis());\n    }\n\n    return dialog;\n  }\n\n  @Override\n  public void onDismiss(DialogInterface dialog) {\n    super.onDismiss(dialog);\n    if (mOnDismissListener != null) {\n      mOnDismissListener.onDismiss(dialog);\n    }\n  }\n\n  /*package*/ void setOnDateSetListener(@Nullable OnDateSetListener onDateSetListener) {\n    mOnDateSetListener = onDateSetListener;\n  }\n\n  /*package*/ void setOnDismissListener(@Nullable OnDismissListener onDismissListener) {\n    mOnDismissListener = onDismissListener;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.datepicker;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Map;\n\nimport android.app.Activity;\nimport android.app.DatePickerDialog.OnDateSetListener;\nimport android.app.DialogFragment;\nimport android.app.FragmentManager;\nimport android.content.DialogInterface;\nimport android.content.DialogInterface.OnDismissListener;\nimport android.os.Bundle;\nimport android.widget.DatePicker;\n\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.Promise;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * {@link NativeModule} that allows JS to show a native date picker dialog and get called back when\n * the user selects a date.\n */\n@ReactModule(name = \"DatePickerAndroid\")\npublic class DatePickerDialogModule extends ReactContextBaseJavaModule {\n\n  @VisibleForTesting\n  public static final String FRAGMENT_TAG = \"DatePickerAndroid\";\n\n  private static final String ERROR_NO_ACTIVITY = \"E_NO_ACTIVITY\";\n\n  /* package */ static final String ARG_DATE = \"date\";\n  /* package */ static final String ARG_MINDATE = \"minDate\";\n  /* package */ static final String ARG_MAXDATE = \"maxDate\";\n  /* package */ static final String ARG_MODE = \"mode\";\n\n  /* package */ static final String ACTION_DATE_SET = \"dateSetAction\";\n  /* package */ static final String ACTION_DISMISSED = \"dismissedAction\";\n\n  public DatePickerDialogModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return \"DatePickerAndroid\";\n  }\n\n  private class DatePickerDialogListener implements OnDateSetListener, OnDismissListener {\n\n    private final Promise mPromise;\n    private boolean mPromiseResolved = false;\n\n    public DatePickerDialogListener(final Promise promise) {\n      mPromise = promise;\n    }\n\n    @Override\n    public void onDateSet(DatePicker view, int year, int month, int day) {\n      if (!mPromiseResolved && getReactApplicationContext().hasActiveCatalystInstance()) {\n        WritableMap result = new WritableNativeMap();\n        result.putString(\"action\", ACTION_DATE_SET);\n        result.putInt(\"year\", year);\n        result.putInt(\"month\", month);\n        result.putInt(\"day\", day);\n        mPromise.resolve(result);\n        mPromiseResolved = true;\n      }\n    }\n\n    @Override\n    public void onDismiss(DialogInterface dialog) {\n      if (!mPromiseResolved && getReactApplicationContext().hasActiveCatalystInstance()) {\n        WritableMap result = new WritableNativeMap();\n        result.putString(\"action\", ACTION_DISMISSED);\n        mPromise.resolve(result);\n        mPromiseResolved = true;\n      }\n    }\n  }\n\n  /**\n   * Show a date picker dialog.\n   *\n   * @param options a map containing options. Available keys are:\n   *\n   * <ul>\n   *   <li>{@code date} (timestamp in milliseconds) the date to show by default</li>\n   *   <li>\n   *     {@code minDate} (timestamp in milliseconds) the minimum date the user should be allowed\n   *     to select\n   *   </li>\n   *   <li>\n   *     {@code maxDate} (timestamp in milliseconds) the maximum date the user should be allowed\n   *     to select\n   *    </li>\n   *   <li>\n   *      {@code mode} To set the date picker mode to 'calendar/spinner/default'\n   *   </li>\n   * </ul>\n   *\n   * @param promise This will be invoked with parameters action, year,\n   *                month (0-11), day, where action is {@code dateSetAction} or\n   *                {@code dismissedAction}, depending on what the user did. If the action is\n   *                dismiss, year, month and date are undefined.\n   */\n  @ReactMethod\n  public void open(@Nullable final ReadableMap options, Promise promise) {\n    Activity activity = getCurrentActivity();\n    if (activity == null) {\n      promise.reject(\n          ERROR_NO_ACTIVITY,\n          \"Tried to open a DatePicker dialog while not attached to an Activity\");\n      return;\n    }\n    // We want to support both android.app.Activity and the pre-Honeycomb FragmentActivity\n    // (for apps that use it for legacy reasons). This unfortunately leads to some code duplication.\n    if (activity instanceof android.support.v4.app.FragmentActivity) {\n      android.support.v4.app.FragmentManager fragmentManager =\n          ((android.support.v4.app.FragmentActivity) activity).getSupportFragmentManager();\n      android.support.v4.app.DialogFragment oldFragment =\n          (android.support.v4.app.DialogFragment) fragmentManager.findFragmentByTag(FRAGMENT_TAG);\n      if (oldFragment != null) {\n        oldFragment.dismiss();\n      }\n      SupportDatePickerDialogFragment fragment = new SupportDatePickerDialogFragment();\n      if (options != null) {\n        final Bundle args = createFragmentArguments(options);\n        fragment.setArguments(args);\n      }\n      final DatePickerDialogListener listener = new DatePickerDialogListener(promise);\n      fragment.setOnDismissListener(listener);\n      fragment.setOnDateSetListener(listener);\n      fragment.show(fragmentManager, FRAGMENT_TAG);\n    } else {\n      FragmentManager fragmentManager = activity.getFragmentManager();\n      DialogFragment oldFragment = (DialogFragment) fragmentManager.findFragmentByTag(FRAGMENT_TAG);\n      if (oldFragment != null) {\n        oldFragment.dismiss();\n      }\n      DatePickerDialogFragment fragment = new DatePickerDialogFragment();\n      if (options != null) {\n        final Bundle args = createFragmentArguments(options);\n        fragment.setArguments(args);\n      }\n      final DatePickerDialogListener listener = new DatePickerDialogListener(promise);\n      fragment.setOnDismissListener(listener);\n      fragment.setOnDateSetListener(listener);\n      fragment.show(fragmentManager, FRAGMENT_TAG);\n    }\n  }\n\n  private Bundle createFragmentArguments(ReadableMap options) {\n    final Bundle args = new Bundle();\n    if (options.hasKey(ARG_DATE) && !options.isNull(ARG_DATE)) {\n      args.putLong(ARG_DATE, (long) options.getDouble(ARG_DATE));\n    }\n    if (options.hasKey(ARG_MINDATE) && !options.isNull(ARG_MINDATE)) {\n      args.putLong(ARG_MINDATE, (long) options.getDouble(ARG_MINDATE));\n    }\n    if (options.hasKey(ARG_MAXDATE) && !options.isNull(ARG_MAXDATE)) {\n      args.putLong(ARG_MAXDATE, (long) options.getDouble(ARG_MAXDATE));\n    }\n    if (options.hasKey(ARG_MODE) && !options.isNull(ARG_MODE)) {\n      args.putString(ARG_MODE, options.getString(ARG_MODE));\n    }\n    return args;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerMode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.datepicker;\n\n/**\n * Date picker modes\n */\npublic enum DatePickerMode {\n  CALENDAR,\n  SPINNER,\n  DEFAULT\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DismissableDatePickerDialog.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.datepicker;\n\nimport android.app.DatePickerDialog;\nimport javax.annotation.Nullable;\n\nimport android.app.DatePickerDialog;\nimport android.content.Context;\nimport android.os.Build;\n\n/**\n * <p>\n *   Certain versions of Android (Jellybean-KitKat) have a bug where when dismissed, the\n *   {@link DatePickerDialog} still calls the OnDateSetListener. This class works around that issue.\n * </p>\n *\n * <p>\n *   See: <a href=\"https://code.google.com/p/android/issues/detail?id=34833\">Issue 34833</a>\n * </p>\n */\npublic class DismissableDatePickerDialog extends DatePickerDialog {\n\n  public DismissableDatePickerDialog(\n      Context context,\n      @Nullable DatePickerDialog.OnDateSetListener callback,\n      int year,\n      int monthOfYear,\n      int dayOfMonth) {\n    super(context, callback, year, monthOfYear, dayOfMonth);\n  }\n\n  public DismissableDatePickerDialog(\n      Context context,\n      int theme,\n      @Nullable DatePickerDialog.OnDateSetListener callback,\n      int year,\n      int monthOfYear,\n      int dayOfMonth) {\n    super(context, theme, callback, year, monthOfYear, dayOfMonth);\n  }\n\n  @Override\n  protected void onStop() {\n    // do *not* call super.onStop() on KitKat on lower, as that would erroneously call the\n    // OnDateSetListener when the dialog is dismissed, or call it twice when \"OK\" is pressed.\n    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {\n      super.onStop();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/debug/AnimationsDebugModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.debug;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Locale;\n\nimport android.widget.Toast;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.JSApplicationCausedNativeException;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.core.ChoreographerCompat;\nimport com.facebook.react.modules.debug.interfaces.DeveloperSettings;\n\n/**\n * Module that records debug information during transitions (animated navigation events such as\n * going from one screen to another).\n */\n@ReactModule(name = AnimationsDebugModule.NAME)\npublic class AnimationsDebugModule extends ReactContextBaseJavaModule {\n\n  protected static final String NAME = \"AnimationsDebugModule\";\n\n  private @Nullable FpsDebugFrameCallback mFrameCallback;\n  private @Nullable final DeveloperSettings mCatalystSettings;\n\n  public AnimationsDebugModule(\n      ReactApplicationContext reactContext,\n      DeveloperSettings catalystSettings) {\n    super(reactContext);\n    mCatalystSettings = catalystSettings;\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @ReactMethod\n  public void startRecordingFps() {\n    if (mCatalystSettings == null ||\n        !mCatalystSettings.isAnimationFpsDebugEnabled()) {\n      return;\n    }\n\n    if (mFrameCallback != null) {\n      throw new JSApplicationCausedNativeException(\"Already recording FPS!\");\n    }\n\n    mFrameCallback = new FpsDebugFrameCallback(\n                          ChoreographerCompat.getInstance(),\n                          getReactApplicationContext());\n    mFrameCallback.startAndRecordFpsAtEachFrame();\n  }\n\n  /**\n   * Called when an animation finishes. The caller should include the animation stop time in ms\n   * (unix time) so that we know when the animation stopped from the JS perspective and we don't\n   * count time after as being part of the animation.\n   */\n  @ReactMethod\n  public void stopRecordingFps(double animationStopTimeMs) {\n    if (mFrameCallback == null) {\n      return;\n    }\n\n    mFrameCallback.stop();\n\n    // Casting to long is safe here since animationStopTimeMs is unix time and thus relatively small\n    FpsDebugFrameCallback.FpsInfo fpsInfo = mFrameCallback.getFpsInfo((long) animationStopTimeMs);\n\n    if (fpsInfo == null) {\n      Toast.makeText(getReactApplicationContext(), \"Unable to get FPS info\", Toast.LENGTH_LONG);\n    } else {\n      String fpsString = String.format(\n          Locale.US,\n          \"FPS: %.2f, %d frames (%d expected)\",\n          fpsInfo.fps,\n          fpsInfo.totalFrames,\n          fpsInfo.totalExpectedFrames);\n      String jsFpsString = String.format(\n          Locale.US,\n          \"JS FPS: %.2f, %d frames (%d expected)\",\n          fpsInfo.jsFps,\n          fpsInfo.totalJsFrames,\n          fpsInfo.totalExpectedFrames);\n      String debugString = fpsString + \"\\n\" + jsFpsString + \"\\n\" +\n          \"Total Time MS: \" + String.format(Locale.US, \"%d\", fpsInfo.totalTimeMs);\n      FLog.d(ReactConstants.TAG, debugString);\n      Toast.makeText(getReactApplicationContext(), debugString, Toast.LENGTH_LONG).show();\n    }\n\n    mFrameCallback = null;\n  }\n\n  @Override\n  public void onCatalystInstanceDestroy() {\n    if (mFrameCallback != null) {\n      mFrameCallback.stop();\n      mFrameCallback = null;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/debug/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"debug\",\n    srcs = glob([\"*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/modules/debug:interfaces\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n    ],\n)\n\nandroid_library(\n    name = \"interfaces\",\n    srcs = glob([\"interfaces/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/debug/DidJSUpdateUiDuringFrameDetector.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.debug;\n\nimport com.facebook.react.bridge.ReactBridge;\nimport com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener;\nimport com.facebook.react.common.LongArray;\nimport com.facebook.react.modules.core.ChoreographerCompat;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener;\n\n/**\n * Debug object that listens to bridge busy/idle events and UiManagerModule dispatches and uses it\n * to calculate whether JS was able to update the UI during a given frame. After being installed\n * on a {@link ReactBridge} and a {@link UIManagerModule},\n * {@link #getDidJSHitFrameAndCleanup} should be called once per frame via a\n * {@link ChoreographerCompat.FrameCallback}.\n */\npublic class DidJSUpdateUiDuringFrameDetector implements NotThreadSafeBridgeIdleDebugListener,\n    NotThreadSafeViewHierarchyUpdateDebugListener {\n\n  private final LongArray mTransitionToIdleEvents = LongArray.createWithInitialCapacity(20);\n  private final LongArray mTransitionToBusyEvents = LongArray.createWithInitialCapacity(20);\n  private final LongArray mViewHierarchyUpdateEnqueuedEvents =\n      LongArray.createWithInitialCapacity(20);\n  private final LongArray mViewHierarchyUpdateFinishedEvents =\n      LongArray.createWithInitialCapacity(20);\n  private volatile boolean mWasIdleAtEndOfLastFrame = true;\n\n  @Override\n  public synchronized void onTransitionToBridgeIdle() {\n    mTransitionToIdleEvents.add(System.nanoTime());\n  }\n\n  @Override\n  public synchronized void onTransitionToBridgeBusy() {\n    mTransitionToBusyEvents.add(System.nanoTime());\n  }\n\n  @Override\n  public synchronized void onViewHierarchyUpdateEnqueued() {\n    mViewHierarchyUpdateEnqueuedEvents.add(System.nanoTime());\n  }\n\n  @Override\n  public synchronized void onViewHierarchyUpdateFinished() {\n    mViewHierarchyUpdateFinishedEvents.add(System.nanoTime());\n  }\n\n  /**\n   * Designed to be called from a {@link ChoreographerCompat.FrameCallback#doFrame} call.\n   *\n   * There are two 'success' cases that will cause {@link #getDidJSHitFrameAndCleanup} to\n   * return true for a given frame:\n   *\n   * 1) UIManagerModule finished dispatching a batched UI update on the UI thread during the frame.\n   *    This means that during the next hierarchy traversal, new UI will be drawn if needed (good).\n   * 2) The bridge ended the frame idle (meaning there were no JS nor native module calls still in\n   *    flight) AND there was no UiManagerModule update enqueued that didn't also finish. NB: if\n   *    there was one enqueued that actually finished, we'd have case 1), so effectively we just\n   *    look for whether one was enqueued.\n   *\n   * NB: This call can only be called once for a given frame time range because it cleans up\n   * events it recorded for that frame.\n   *\n   * NB2: This makes the assumption that onViewHierarchyUpdateEnqueued is called from the\n   * {@link UIManagerModule#onBatchComplete()}, e.g. while the bridge is still considered busy,\n   * which means there is no race condition where the bridge has gone idle but a hierarchy update is\n   * waiting to be enqueued.\n   *\n   * @param frameStartTimeNanos the time in nanos that the last frame started\n   * @param frameEndTimeNanos the time in nanos that the last frame ended\n   */\n  public synchronized boolean getDidJSHitFrameAndCleanup(\n      long frameStartTimeNanos,\n      long frameEndTimeNanos) {\n    // Case 1: We dispatched a UI update\n    boolean finishedUiUpdate = hasEventBetweenTimestamps(\n        mViewHierarchyUpdateFinishedEvents,\n        frameStartTimeNanos,\n        frameEndTimeNanos);\n    boolean didEndFrameIdle = didEndFrameIdle(frameStartTimeNanos, frameEndTimeNanos);\n\n    boolean hitFrame;\n    if (finishedUiUpdate) {\n      hitFrame = true;\n    } else {\n      // Case 2: Ended idle but no UI was enqueued during that frame\n      hitFrame = didEndFrameIdle && !hasEventBetweenTimestamps(\n          mViewHierarchyUpdateEnqueuedEvents,\n          frameStartTimeNanos,\n          frameEndTimeNanos);\n    }\n\n    cleanUp(mTransitionToIdleEvents, frameEndTimeNanos);\n    cleanUp(mTransitionToBusyEvents, frameEndTimeNanos);\n    cleanUp(mViewHierarchyUpdateEnqueuedEvents, frameEndTimeNanos);\n    cleanUp(mViewHierarchyUpdateFinishedEvents, frameEndTimeNanos);\n\n    mWasIdleAtEndOfLastFrame = didEndFrameIdle;\n\n    return hitFrame;\n  }\n\n  private static boolean hasEventBetweenTimestamps(\n      LongArray eventArray,\n      long startTime,\n      long endTime) {\n    for (int i = 0; i < eventArray.size(); i++) {\n      long time = eventArray.get(i);\n      if (time >= startTime && time < endTime) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  private static long getLastEventBetweenTimestamps(\n      LongArray eventArray,\n      long startTime,\n      long endTime) {\n    long lastEvent = -1;\n    for (int i = 0; i < eventArray.size(); i++) {\n      long time = eventArray.get(i);\n      if (time >= startTime && time < endTime) {\n        lastEvent = time;\n      } else if (time >= endTime) {\n        break;\n      }\n    }\n    return lastEvent;\n  }\n\n  private boolean didEndFrameIdle(long startTime, long endTime) {\n    long lastIdleTransition = getLastEventBetweenTimestamps(\n        mTransitionToIdleEvents,\n        startTime,\n        endTime);\n    long lastBusyTransition = getLastEventBetweenTimestamps(\n        mTransitionToBusyEvents,\n        startTime,\n        endTime);\n\n    if (lastIdleTransition == -1 && lastBusyTransition == -1) {\n      return mWasIdleAtEndOfLastFrame;\n    }\n\n    return lastIdleTransition > lastBusyTransition;\n  }\n\n  private static void cleanUp(LongArray eventArray, long endTime) {\n    int size = eventArray.size();\n    int indicesToRemove = 0;\n    for (int i = 0; i < size; i++) {\n      if (eventArray.get(i) < endTime) {\n        indicesToRemove++;\n      }\n    }\n\n    if (indicesToRemove > 0) {\n      for (int i = 0; i < size - indicesToRemove; i++) {\n        eventArray.set(i, eventArray.get(i + indicesToRemove));\n      }\n      eventArray.dropTail(indicesToRemove);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/debug/FpsDebugFrameCallback.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.debug;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Map;\nimport java.util.TreeMap;\n\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.modules.core.ChoreographerCompat;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.infer.annotation.Assertions;\n\n/**\n * Each time a frame is drawn, records whether it should have expected any more callbacks since\n * the last time a frame was drawn (i.e. was a frame skipped?). Uses this plus total elapsed time\n * to determine FPS. Can also record total and expected frame counts, though NB, since the expected\n * frame rate is estimated, the expected frame count will lose accuracy over time.\n *\n * Also records the JS FPS, i.e. the frames per second with which either JS updated the UI or was\n * idle and not trying to update the UI. This is different from the FPS above since JS rendering is\n * async.\n */\npublic class FpsDebugFrameCallback extends ChoreographerCompat.FrameCallback {\n\n  public static class FpsInfo {\n\n    public final int totalFrames;\n    public final int totalJsFrames;\n    public final int totalExpectedFrames;\n    public final int total4PlusFrameStutters;\n    public final double fps;\n    public final double jsFps;\n    public final int totalTimeMs;\n\n    public FpsInfo(\n        int totalFrames,\n        int totalJsFrames,\n        int totalExpectedFrames,\n        int total4PlusFrameStutters,\n        double fps,\n        double jsFps,\n        int totalTimeMs) {\n      this.totalFrames = totalFrames;\n      this.totalJsFrames = totalJsFrames;\n      this.totalExpectedFrames = totalExpectedFrames;\n      this.total4PlusFrameStutters = total4PlusFrameStutters;\n      this.fps = fps;\n      this.jsFps = jsFps;\n      this.totalTimeMs = totalTimeMs;\n    }\n  }\n\n  private static final double EXPECTED_FRAME_TIME = 16.9;\n\n  private final ChoreographerCompat mChoreographer;\n  private final ReactContext mReactContext;\n  private final UIManagerModule mUIManagerModule;\n  private final DidJSUpdateUiDuringFrameDetector mDidJSUpdateUiDuringFrameDetector;\n\n  private boolean mShouldStop = false;\n  private long mFirstFrameTime = -1;\n  private long mLastFrameTime = -1;\n  private int mNumFrameCallbacks = 0;\n  private int mExpectedNumFramesPrev = 0;\n  private int m4PlusFrameStutters = 0;\n  private int mNumFrameCallbacksWithBatchDispatches = 0;\n  private boolean mIsRecordingFpsInfoAtEachFrame = false;\n  private @Nullable TreeMap<Long, FpsInfo> mTimeToFps;\n\n  public FpsDebugFrameCallback(ChoreographerCompat choreographer, ReactContext reactContext) {\n    mChoreographer = choreographer;\n    mReactContext = reactContext;\n    mUIManagerModule = reactContext.getNativeModule(UIManagerModule.class);\n    mDidJSUpdateUiDuringFrameDetector = new DidJSUpdateUiDuringFrameDetector();\n  }\n\n  @Override\n  public void doFrame(long l) {\n    if (mShouldStop) {\n      return;\n    }\n\n    if (mFirstFrameTime == -1) {\n      mFirstFrameTime = l;\n    }\n\n    long lastFrameStartTime = mLastFrameTime;\n    mLastFrameTime = l;\n\n    if (mDidJSUpdateUiDuringFrameDetector.getDidJSHitFrameAndCleanup(\n        lastFrameStartTime,\n        l)) {\n      mNumFrameCallbacksWithBatchDispatches++;\n    }\n\n    mNumFrameCallbacks++;\n    int expectedNumFrames = getExpectedNumFrames();\n    int framesDropped = expectedNumFrames - mExpectedNumFramesPrev - 1;\n    if (framesDropped >= 4) {\n      m4PlusFrameStutters++;\n    }\n\n    if (mIsRecordingFpsInfoAtEachFrame) {\n      Assertions.assertNotNull(mTimeToFps);\n      FpsInfo info = new FpsInfo(\n          getNumFrames(),\n          getNumJSFrames(),\n          expectedNumFrames,\n          m4PlusFrameStutters,\n          getFPS(),\n          getJSFPS(),\n          getTotalTimeMS());\n      mTimeToFps.put(System.currentTimeMillis(), info);\n    }\n    mExpectedNumFramesPrev = expectedNumFrames;\n\n    mChoreographer.postFrameCallback(this);\n  }\n\n  public void start() {\n    mShouldStop = false;\n    mReactContext.getCatalystInstance().addBridgeIdleDebugListener(\n        mDidJSUpdateUiDuringFrameDetector);\n    mUIManagerModule.setViewHierarchyUpdateDebugListener(mDidJSUpdateUiDuringFrameDetector);\n    mChoreographer.postFrameCallback(this);\n  }\n\n  public void startAndRecordFpsAtEachFrame() {\n    mTimeToFps = new TreeMap<Long, FpsInfo>();\n    mIsRecordingFpsInfoAtEachFrame = true;\n    start();\n  }\n\n  public void stop() {\n    mShouldStop = true;\n    mReactContext.getCatalystInstance().removeBridgeIdleDebugListener(\n        mDidJSUpdateUiDuringFrameDetector);\n    mUIManagerModule.setViewHierarchyUpdateDebugListener(null);\n  }\n\n  public double getFPS() {\n    if (mLastFrameTime == mFirstFrameTime) {\n      return 0;\n    }\n    return ((double) (getNumFrames()) * 1e9) / (mLastFrameTime - mFirstFrameTime);\n  }\n\n  public double getJSFPS() {\n    if (mLastFrameTime == mFirstFrameTime) {\n      return 0;\n    }\n    return ((double) (getNumJSFrames()) * 1e9) / (mLastFrameTime - mFirstFrameTime);\n  }\n\n  public int getNumFrames() {\n    return mNumFrameCallbacks - 1;\n  }\n\n  public int getNumJSFrames() {\n    return mNumFrameCallbacksWithBatchDispatches - 1;\n  }\n\n  public int getExpectedNumFrames() {\n    double totalTimeMS = getTotalTimeMS();\n    int expectedFrames = (int) (totalTimeMS / EXPECTED_FRAME_TIME + 1);\n    return expectedFrames;\n  }\n\n  public int get4PlusFrameStutters() {\n    return m4PlusFrameStutters;\n  }\n\n  public int getTotalTimeMS() {\n    return (int) ((double) mLastFrameTime - mFirstFrameTime) / 1000000;\n  }\n\n  /**\n   * Returns the FpsInfo as if stop had been called at the given upToTimeMs. Only valid if\n   * monitoring was started with {@link #startAndRecordFpsAtEachFrame()}.\n   */\n  public @Nullable FpsInfo getFpsInfo(long upToTimeMs) {\n    Assertions.assertNotNull(mTimeToFps, \"FPS was not recorded at each frame!\");\n    Map.Entry<Long, FpsInfo> bestEntry = mTimeToFps.floorEntry(upToTimeMs);\n    if (bestEntry == null) {\n      return null;\n    }\n    return bestEntry.getValue();\n  }\n\n  public void reset() {\n    mFirstFrameTime = -1;\n    mLastFrameTime = -1;\n    mNumFrameCallbacks = 0;\n    m4PlusFrameStutters = 0;\n    mNumFrameCallbacksWithBatchDispatches = 0;\n    mIsRecordingFpsInfoAtEachFrame = false;\n    mTimeToFps = null;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/debug/SourceCodeModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.debug;\n\nimport javax.annotation.Nullable;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * Module that exposes the URL to the source code map (used for exception stack trace parsing) to JS\n */\n@ReactModule(name = SourceCodeModule.NAME)\npublic class SourceCodeModule extends BaseJavaModule {\n\n  public static final String NAME = \"SourceCode\";\n\n  private final ReactContext mReactContext;\n\n  public SourceCodeModule(ReactContext reactContext) {\n    mReactContext = reactContext;\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @Override\n  public @Nullable Map<String, Object> getConstants() {\n    HashMap<String, Object> constants = new HashMap<>();\n\n    String sourceURL =\n      Assertions.assertNotNull(\n        mReactContext.getCatalystInstance().getSourceURL(),\n        \"No source URL loaded, have you initialised the instance?\");\n\n    constants.put(\"scriptURL\", sourceURL);\n    return constants;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/debug/interfaces/DeveloperSettings.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.debug.interfaces;\n\n/**\n * Provides access to React Native developers settings.\n */\npublic interface DeveloperSettings {\n\n  /**\n   * @return whether an overlay showing current FPS should be shown.\n   */\n  boolean isFpsDebugEnabled();\n\n  /**\n   * @return Whether debug information about transitions should be displayed.\n   */\n  boolean isAnimationFpsDebugEnabled();\n\n  /**\n   * @return Whether dev mode should be enabled in JS bundles.\n   */\n  boolean isJSDevModeEnabled();\n\n  /**\n   * @return Whether JS bundle should be minified.\n   */\n  boolean isJSMinifyEnabled();\n\n  /**\n   * @return Whether element inspector is enabled.\n   */\n  boolean isElementInspectorEnabled();\n\n  /**\n   * @return Whether Nuclide JS debugging is enabled.\n   */\n  boolean isNuclideJSDebugEnabled();\n\n  /**\n   * @return Whether remote JS debugging is enabled.\n   */\n  boolean isRemoteJSDebugEnabled();\n\n  /**\n   * Enable/Disable remote JS debugging.\n   */\n  void setRemoteJSDebugEnabled(boolean remoteJSDebugEnabled);\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"deviceinfo\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/DeviceInfoModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.deviceinfo;\n\nimport javax.annotation.Nullable;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport android.content.Context;\nimport android.util.DisplayMetrics;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.core.DeviceEventManagerModule;\nimport com.facebook.react.uimanager.DisplayMetricsHolder;\n\n/**\n * Module that exposes Android Constants to JS.\n */\n@ReactModule(name = \"DeviceInfo\")\npublic class DeviceInfoModule extends BaseJavaModule implements\n    LifecycleEventListener {\n\n  private @Nullable ReactApplicationContext mReactApplicationContext;\n  private float mFontScale;\n\n  public DeviceInfoModule(ReactApplicationContext reactContext) {\n    this((Context) reactContext);\n    mReactApplicationContext = reactContext;\n  }\n\n  public DeviceInfoModule(Context context) {\n    mReactApplicationContext = null;\n    DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(context);\n    mFontScale = context.getResources().getConfiguration().fontScale;\n  }\n\n  @Override\n  public String getName() {\n    return \"DeviceInfo\";\n  }\n\n  @Override\n  public @Nullable Map<String, Object> getConstants() {\n    HashMap<String, Object> constants = new HashMap<>();\n    constants.put(\n        \"Dimensions\",\n        getDimensionsConstants());\n    return constants;\n  }\n\n  @Override\n  public void onHostResume() {\n    if (mReactApplicationContext == null) {\n      return;\n    }\n\n    float fontScale = mReactApplicationContext.getResources().getConfiguration().fontScale;\n    if (mFontScale != fontScale) {\n      mFontScale = fontScale;\n      emitUpdateDimensionsEvent();\n    }\n  }\n\n  @Override\n  public void onHostPause() {\n  }\n\n  @Override\n  public void onHostDestroy() {\n  }\n\n  public void emitUpdateDimensionsEvent() {\n    if (mReactApplicationContext == null) {\n      return;\n    }\n\n    mReactApplicationContext\n        .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)\n        .emit(\"didUpdateDimensions\", getDimensionsConstants());\n  }\n\n  private WritableMap getDimensionsConstants() {\n    DisplayMetrics windowDisplayMetrics = DisplayMetricsHolder.getWindowDisplayMetrics();\n    DisplayMetrics screenDisplayMetrics = DisplayMetricsHolder.getScreenDisplayMetrics();\n\n    WritableMap windowDisplayMetricsMap = Arguments.createMap();\n    windowDisplayMetricsMap.putInt(\"width\", windowDisplayMetrics.widthPixels);\n    windowDisplayMetricsMap.putInt(\"height\", windowDisplayMetrics.heightPixels);\n    windowDisplayMetricsMap.putDouble(\"scale\", windowDisplayMetrics.density);\n    windowDisplayMetricsMap.putDouble(\"fontScale\", mFontScale);\n    windowDisplayMetricsMap.putDouble(\"densityDpi\", windowDisplayMetrics.densityDpi);\n\n    WritableMap screenDisplayMetricsMap = Arguments.createMap();\n    screenDisplayMetricsMap.putInt(\"width\", screenDisplayMetrics.widthPixels);\n    screenDisplayMetricsMap.putInt(\"height\", screenDisplayMetrics.heightPixels);\n    screenDisplayMetricsMap.putDouble(\"scale\", screenDisplayMetrics.density);\n    screenDisplayMetricsMap.putDouble(\"fontScale\", mFontScale);\n    screenDisplayMetricsMap.putDouble(\"densityDpi\", screenDisplayMetrics.densityDpi);\n\n    WritableMap dimensionsMap = Arguments.createMap();\n    dimensionsMap.putMap(\"windowPhysicalPixels\", windowDisplayMetricsMap);\n    dimensionsMap.putMap(\"screenPhysicalPixels\", screenDisplayMetricsMap);\n\n    return dimensionsMap;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/dialog/AlertFragment.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.dialog;\n\nimport javax.annotation.Nullable;\n\nimport android.app.AlertDialog;\nimport android.app.Dialog;\nimport android.app.DialogFragment;\nimport android.content.DialogInterface;\nimport android.content.Context;\nimport android.os.Bundle;\n\n/**\n * A fragment used to display the dialog.\n */\npublic class AlertFragment extends DialogFragment implements DialogInterface.OnClickListener {\n\n  /* package */ static final String ARG_TITLE = \"title\";\n  /* package */ static final String ARG_MESSAGE = \"message\";\n  /* package */ static final String ARG_BUTTON_POSITIVE = \"button_positive\";\n  /* package */ static final String ARG_BUTTON_NEGATIVE = \"button_negative\";\n  /* package */ static final String ARG_BUTTON_NEUTRAL = \"button_neutral\";\n  /* package */ static final String ARG_ITEMS = \"items\";\n\n  private final @Nullable DialogModule.AlertFragmentListener mListener;\n\n  public AlertFragment() {\n      mListener = null;\n  }\n\n  public AlertFragment(@Nullable DialogModule.AlertFragmentListener listener, Bundle arguments) {\n    mListener = listener;\n    setArguments(arguments);\n  }\n\n  public static Dialog createDialog(\n      Context activityContext, Bundle arguments, DialogInterface.OnClickListener fragment) {\n    AlertDialog.Builder builder = new AlertDialog.Builder(activityContext)\n        .setTitle(arguments.getString(ARG_TITLE));\n\n    if (arguments.containsKey(ARG_BUTTON_POSITIVE)) {\n      builder.setPositiveButton(arguments.getString(ARG_BUTTON_POSITIVE), fragment);\n    }\n    if (arguments.containsKey(ARG_BUTTON_NEGATIVE)) {\n      builder.setNegativeButton(arguments.getString(ARG_BUTTON_NEGATIVE), fragment);\n    }\n    if (arguments.containsKey(ARG_BUTTON_NEUTRAL)) {\n      builder.setNeutralButton(arguments.getString(ARG_BUTTON_NEUTRAL), fragment);\n    }\n    // if both message and items are set, Android will only show the message\n    // and ignore the items argument entirely\n    if (arguments.containsKey(ARG_MESSAGE)) {\n      builder.setMessage(arguments.getString(ARG_MESSAGE));\n    }\n    if (arguments.containsKey(ARG_ITEMS)) {\n      builder.setItems(arguments.getCharSequenceArray(ARG_ITEMS), fragment);\n    }\n\n    return builder.create();\n  }\n\n  @Override\n  public Dialog onCreateDialog(Bundle savedInstanceState) {\n    return createDialog(getActivity(), getArguments(), this);\n  }\n\n  @Override\n  public void onClick(DialogInterface dialog, int which) {\n    if (mListener != null) {\n      mListener.onClick(dialog, which);\n    }\n  }\n\n  @Override\n  public void onDismiss(DialogInterface dialog) {\n    super.onDismiss(dialog);\n    if (mListener != null) {\n      mListener.onDismiss(dialog);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/dialog/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"dialog\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/dialog/DialogModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.dialog;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Map;\n\nimport android.app.Activity;\nimport android.content.DialogInterface;\nimport android.content.DialogInterface.OnClickListener;\nimport android.content.DialogInterface.OnDismissListener;\nimport android.os.Bundle;\nimport android.support.v4.app.FragmentActivity;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.module.annotations.ReactModule;\n\n@ReactModule(name = DialogModule.NAME)\npublic class DialogModule extends ReactContextBaseJavaModule implements LifecycleEventListener {\n\n  /* package */ static final String FRAGMENT_TAG =\n      \"com.facebook.catalyst.react.dialog.DialogModule\";\n\n  /* package */ static final String NAME = \"DialogManagerAndroid\";\n\n  /* package */ static final String ACTION_BUTTON_CLICKED = \"buttonClicked\";\n  /* package */ static final String ACTION_DISMISSED = \"dismissed\";\n  /* package */ static final String KEY_TITLE = \"title\";\n  /* package */ static final String KEY_MESSAGE = \"message\";\n  /* package */ static final String KEY_BUTTON_POSITIVE = \"buttonPositive\";\n  /* package */ static final String KEY_BUTTON_NEGATIVE = \"buttonNegative\";\n  /* package */ static final String KEY_BUTTON_NEUTRAL = \"buttonNeutral\";\n  /* package */ static final String KEY_ITEMS = \"items\";\n  /* package */ static final String KEY_CANCELABLE = \"cancelable\";\n\n  /* package */ static final Map<String, Object> CONSTANTS = MapBuilder.<String, Object>of(\n      ACTION_BUTTON_CLICKED, ACTION_BUTTON_CLICKED,\n      ACTION_DISMISSED, ACTION_DISMISSED,\n      KEY_BUTTON_POSITIVE, DialogInterface.BUTTON_POSITIVE,\n      KEY_BUTTON_NEGATIVE, DialogInterface.BUTTON_NEGATIVE,\n      KEY_BUTTON_NEUTRAL, DialogInterface.BUTTON_NEUTRAL);\n\n  private boolean mIsInForeground;\n\n  public DialogModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  /**\n   * Helper to allow this module to work with both the standard FragmentManager\n   * and the Support FragmentManager (for apps that need to use it for legacy reasons).\n   * Since the two APIs don't share a common interface there's unfortunately some\n   * code duplication.\n   */\n  private class FragmentManagerHelper {\n\n    // Exactly one of the two is null\n    private final @Nullable android.app.FragmentManager mFragmentManager;\n    private final @Nullable android.support.v4.app.FragmentManager mSupportFragmentManager;\n\n    private @Nullable Object mFragmentToShow;\n\n    private boolean isUsingSupportLibrary() {\n      return mSupportFragmentManager != null;\n    }\n\n    public FragmentManagerHelper(android.support.v4.app.FragmentManager supportFragmentManager) {\n      mFragmentManager = null;\n      mSupportFragmentManager = supportFragmentManager;\n    }\n    public FragmentManagerHelper(android.app.FragmentManager fragmentManager) {\n      mFragmentManager = fragmentManager;\n      mSupportFragmentManager = null;\n    }\n\n    public void showPendingAlert() {\n      if (mFragmentToShow == null) {\n        return;\n      }\n      if (isUsingSupportLibrary()) {\n        ((SupportAlertFragment) mFragmentToShow).show(mSupportFragmentManager, FRAGMENT_TAG);\n      } else {\n        ((AlertFragment) mFragmentToShow).show(mFragmentManager, FRAGMENT_TAG);\n      }\n      mFragmentToShow = null;\n    }\n\n    private void dismissExisting() {\n      if (isUsingSupportLibrary()) {\n        SupportAlertFragment oldFragment =\n            (SupportAlertFragment) mSupportFragmentManager.findFragmentByTag(FRAGMENT_TAG);\n        if (oldFragment != null) {\n          oldFragment.dismiss();\n        }\n      } else {\n        AlertFragment oldFragment =\n            (AlertFragment) mFragmentManager.findFragmentByTag(FRAGMENT_TAG);\n        if (oldFragment != null) {\n          oldFragment.dismiss();\n        }\n      }\n    }\n\n    public void showNewAlert(boolean isInForeground, Bundle arguments, Callback actionCallback) {\n      dismissExisting();\n\n      AlertFragmentListener actionListener =\n          actionCallback != null ? new AlertFragmentListener(actionCallback) : null;\n\n      if (isUsingSupportLibrary()) {\n        SupportAlertFragment alertFragment = new SupportAlertFragment(actionListener, arguments);\n        if (isInForeground) {\n          if (arguments.containsKey(KEY_CANCELABLE)) {\n            alertFragment.setCancelable(arguments.getBoolean(KEY_CANCELABLE));\n          }\n          alertFragment.show(mSupportFragmentManager, FRAGMENT_TAG);\n        } else {\n          mFragmentToShow = alertFragment;\n        }\n      } else {\n        AlertFragment alertFragment = new AlertFragment(actionListener, arguments);\n        if (isInForeground) {\n          if (arguments.containsKey(KEY_CANCELABLE)) {\n            alertFragment.setCancelable(arguments.getBoolean(KEY_CANCELABLE));\n          }\n          alertFragment.show(mFragmentManager, FRAGMENT_TAG);\n        } else {\n          mFragmentToShow = alertFragment;\n        }\n      }\n    }\n  }\n\n  /* package */ class AlertFragmentListener implements OnClickListener, OnDismissListener {\n\n    private final Callback mCallback;\n    private boolean mCallbackConsumed = false;\n\n    public AlertFragmentListener(Callback callback) {\n      mCallback = callback;\n    }\n\n    @Override\n    public void onClick(DialogInterface dialog, int which) {\n      if (!mCallbackConsumed) {\n        if (getReactApplicationContext().hasActiveCatalystInstance()) {\n          mCallback.invoke(ACTION_BUTTON_CLICKED, which);\n          mCallbackConsumed = true;\n        }\n      }\n    }\n\n    @Override\n    public void onDismiss(DialogInterface dialog) {\n      if (!mCallbackConsumed) {\n        if (getReactApplicationContext().hasActiveCatalystInstance()) {\n          mCallback.invoke(ACTION_DISMISSED);\n          mCallbackConsumed = true;\n        }\n      }\n    }\n  }\n\n  @Override\n  public Map<String, Object> getConstants() {\n    return CONSTANTS;\n  }\n\n  @Override\n  public void initialize() {\n    getReactApplicationContext().addLifecycleEventListener(this);\n  }\n\n  @Override\n  public void onHostPause() {\n    // Don't show the dialog if the host is paused.\n    mIsInForeground = false;\n  }\n\n  @Override\n  public void onHostDestroy() {\n  }\n\n  @Override\n  public void onHostResume() {\n    mIsInForeground = true;\n    // Check if a dialog has been created while the host was paused, so that we can show it now.\n    FragmentManagerHelper fragmentManagerHelper = getFragmentManagerHelper();\n    if (fragmentManagerHelper != null) {\n      fragmentManagerHelper.showPendingAlert();\n    } else {\n      FLog.w(DialogModule.class, \"onHostResume called but no FragmentManager found\");\n    }\n  }\n\n  @ReactMethod\n  public void showAlert(\n      ReadableMap options,\n      Callback errorCallback,\n      Callback actionCallback) {\n    FragmentManagerHelper fragmentManagerHelper = getFragmentManagerHelper();\n    if (fragmentManagerHelper == null) {\n      errorCallback.invoke(\"Tried to show an alert while not attached to an Activity\");\n      return;\n    }\n\n    final Bundle args = new Bundle();\n    if (options.hasKey(KEY_TITLE)) {\n      args.putString(AlertFragment.ARG_TITLE, options.getString(KEY_TITLE));\n    }\n    if (options.hasKey(KEY_MESSAGE)) {\n      args.putString(AlertFragment.ARG_MESSAGE, options.getString(KEY_MESSAGE));\n    }\n    if (options.hasKey(KEY_BUTTON_POSITIVE)) {\n      args.putString(AlertFragment.ARG_BUTTON_POSITIVE, options.getString(KEY_BUTTON_POSITIVE));\n    }\n    if (options.hasKey(KEY_BUTTON_NEGATIVE)) {\n      args.putString(AlertFragment.ARG_BUTTON_NEGATIVE, options.getString(KEY_BUTTON_NEGATIVE));\n    }\n    if (options.hasKey(KEY_BUTTON_NEUTRAL)) {\n      args.putString(AlertFragment.ARG_BUTTON_NEUTRAL, options.getString(KEY_BUTTON_NEUTRAL));\n    }\n    if (options.hasKey(KEY_ITEMS)) {\n      ReadableArray items = options.getArray(KEY_ITEMS);\n      CharSequence[] itemsArray = new CharSequence[items.size()];\n      for (int i = 0; i < items.size(); i ++) {\n        itemsArray[i] = items.getString(i);\n      }\n      args.putCharSequenceArray(AlertFragment.ARG_ITEMS, itemsArray);\n    }\n    if (options.hasKey(KEY_CANCELABLE)) {\n      args.putBoolean(KEY_CANCELABLE, options.getBoolean(KEY_CANCELABLE));\n    }\n\n    fragmentManagerHelper.showNewAlert(mIsInForeground, args, actionCallback);\n  }\n\n  /**\n   * Creates a new helper to work with either the FragmentManager or the legacy support\n   * FragmentManager transparently. Returns null if we're not attached to an Activity.\n   *\n   * DO NOT HOLD LONG-LIVED REFERENCES TO THE OBJECT RETURNED BY THIS METHOD, AS THIS WILL CAUSE\n   * MEMORY LEAKS.\n   */\n  private @Nullable FragmentManagerHelper getFragmentManagerHelper() {\n    Activity activity = getCurrentActivity();\n    if (activity == null) {\n      return null;\n    }\n    if (activity instanceof FragmentActivity) {\n      return new FragmentManagerHelper(((FragmentActivity) activity).getSupportFragmentManager());\n    } else {\n      return new FragmentManagerHelper(activity.getFragmentManager());\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/dialog/SupportAlertFragment.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.dialog;\n\nimport javax.annotation.Nullable;\n\nimport android.app.Dialog;\nimport android.content.DialogInterface;\nimport android.os.Bundle;\n\nimport android.support.v4.app.DialogFragment;\n\n/**\n * {@link AlertFragment} for apps that use the Support FragmentActivity and FragmentManager\n * for legacy reasons.\n */\npublic class SupportAlertFragment extends DialogFragment implements DialogInterface.OnClickListener {\n\n  private final @Nullable DialogModule.AlertFragmentListener mListener;\n\n  public SupportAlertFragment() {\n      mListener = null;\n  }\n\n  public SupportAlertFragment(@Nullable DialogModule.AlertFragmentListener listener, Bundle arguments) {\n    mListener = listener;\n    setArguments(arguments);\n  }\n\n  @Override\n  public Dialog onCreateDialog(Bundle savedInstanceState) {\n    return AlertFragment.createDialog(getActivity(), getArguments(), this);\n  }\n\n  @Override\n  public void onClick(DialogInterface dialog, int which) {\n    if (mListener != null) {\n      mListener.onClick(dialog, which);\n    }\n  }\n\n  @Override\n  public void onDismiss(DialogInterface dialog) {\n    super.onDismiss(dialog);\n    if (mListener != null) {\n      mListener.onDismiss(dialog);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/fresco/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"fresco\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support-annotations:android-support-annotations\"),\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"java/com/facebook/systrace:systrace\"),\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fbcore\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-drawee\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-react-native\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:imagepipeline\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:imagepipeline-okhttp3\"),\n        react_native_dep(\"libraries/soloader/java/com/facebook/soloader:soloader\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3-urlconnection\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/common:common\"),\n        react_native_target(\"java/com/facebook/react/modules/network:network\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.fresco;\n\nimport java.util.HashSet;\n\nimport android.content.Context;\nimport android.support.annotation.Nullable;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.common.soloader.SoLoaderShim;\nimport com.facebook.drawee.backends.pipeline.Fresco;\nimport com.facebook.imagepipeline.backends.okhttp3.OkHttpImagePipelineConfigFactory;\nimport com.facebook.imagepipeline.core.ImagePipelineConfig;\nimport com.facebook.imagepipeline.listener.RequestListener;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.common.ModuleDataCleaner;\nimport com.facebook.react.modules.network.CookieJarContainer;\nimport com.facebook.react.modules.network.ForwardingCookieHandler;\nimport com.facebook.react.modules.network.OkHttpClientProvider;\nimport com.facebook.soloader.SoLoader;\n\nimport okhttp3.JavaNetCookieJar;\nimport okhttp3.OkHttpClient;\n\n/**\n * Module to initialize the Fresco library.\n *\n * <p>Does not expose any methods to JavaScript code. For initialization and cleanup only.\n */\n@ReactModule(name = \"FrescoModule\")\npublic class FrescoModule extends ReactContextBaseJavaModule implements\n    ModuleDataCleaner.Cleanable, LifecycleEventListener {\n\n  private final boolean mClearOnDestroy;\n  private @Nullable ImagePipelineConfig mConfig;\n\n  private static boolean sHasBeenInitialized = false;\n\n  /**\n   * Create a new Fresco module with a default configuration (or the previously given\n   * configuration via {@link #FrescoModule(ReactApplicationContext, boolean, ImagePipelineConfig)}.\n   *\n   * @param reactContext the context to use\n   */\n  public FrescoModule(ReactApplicationContext reactContext) {\n    this(reactContext, true, null);\n  }\n\n  /**\n   * Create a new Fresco module with a default configuration (or the previously given\n   * configuration via {@link #FrescoModule(ReactApplicationContext, boolean, ImagePipelineConfig)}.\n   *\n   * @param clearOnDestroy whether to clear the memory cache in onHostDestroy: this should be\n   *        {@code true} for pure RN apps and {@code false} for apps that use Fresco outside of RN\n   *        as well\n   * @param reactContext the context to use\n   *\n   */\n  public FrescoModule(ReactApplicationContext reactContext, boolean clearOnDestroy) {\n    this(reactContext, clearOnDestroy, null);\n  }\n\n  /**\n   * Create a new Fresco module with a given ImagePipelineConfig.\n   * This should only be called when the module has not been initialized yet.\n   * You can use {@link #hasBeenInitialized()} to check this and call\n   * {@link #FrescoModule(ReactApplicationContext)} if it is already initialized.\n   * Otherwise, the given Fresco configuration will be ignored.\n   *\n   * @param reactContext the context to use\n   * @param clearOnDestroy whether to clear the memory cache in onHostDestroy: this should be\n   *        {@code true} for pure RN apps and {@code false} for apps that use Fresco outside of RN\n   *        as well\n   * @param config the Fresco configuration, which will only be used for the first initialization\n   */\n  public FrescoModule(\n    ReactApplicationContext reactContext,\n    boolean clearOnDestroy,\n    @Nullable ImagePipelineConfig config) {\n    super(reactContext);\n    mClearOnDestroy = clearOnDestroy;\n    mConfig = config;\n  }\n\n  @Override\n  public void initialize() {\n    super.initialize();\n    getReactApplicationContext().addLifecycleEventListener(this);\n    if (!hasBeenInitialized()) {\n      // Make sure the SoLoaderShim is configured to use our loader for native libraries.\n      // This code can be removed if using Fresco from Maven rather than from source\n      SoLoaderShim.setHandler(new FrescoHandler());\n      if (mConfig == null) {\n        mConfig = getDefaultConfig(getReactApplicationContext());\n      }\n      Context context = getReactApplicationContext().getApplicationContext();\n      Fresco.initialize(context, mConfig);\n      sHasBeenInitialized = true;\n    } else if (mConfig != null) {\n      FLog.w(\n          ReactConstants.TAG,\n          \"Fresco has already been initialized with a different config. \"\n          + \"The new Fresco configuration will be ignored!\");\n    }\n    mConfig = null;\n  }\n\n  @Override\n  public String getName() {\n    return \"FrescoModule\";\n  }\n\n  @Override\n  public void clearSensitiveData() {\n    // Clear image cache.\n    Fresco.getImagePipeline().clearCaches();\n  }\n\n  /**\n   * Check whether the FrescoModule has already been initialized. If this is the case,\n   * Calls to {@link #FrescoModule(ReactApplicationContext, ImagePipelineConfig)} will\n   * ignore the given configuration.\n   *\n   * @return true if this module has already been initialized\n   */\n  public static boolean hasBeenInitialized() {\n    return sHasBeenInitialized;\n  }\n\n  private static ImagePipelineConfig getDefaultConfig(ReactContext context) {\n    return getDefaultConfigBuilder(context).build();\n  }\n\n  /**\n   * Get the default Fresco configuration builder.\n   * Allows adding of configuration options in addition to the default values.\n   *\n   * @return {@link ImagePipelineConfig.Builder} that has been initialized with default values\n   */\n  public static ImagePipelineConfig.Builder getDefaultConfigBuilder(ReactContext context) {\n    HashSet<RequestListener> requestListeners = new HashSet<>();\n    requestListeners.add(new SystraceRequestListener());\n\n    OkHttpClient client = OkHttpClientProvider.createClient();\n\n    // make sure to forward cookies for any requests via the okHttpClient\n    // so that image requests to endpoints that use cookies still work\n    CookieJarContainer container = (CookieJarContainer) client.cookieJar();\n    ForwardingCookieHandler handler = new ForwardingCookieHandler(context);\n    container.setCookieJar(new JavaNetCookieJar(handler));\n\n    return OkHttpImagePipelineConfigFactory\n      .newBuilder(context.getApplicationContext(), client)\n      .setNetworkFetcher(new ReactOkHttpNetworkFetcher(client))\n      .setDownsampleEnabled(false)\n      .setRequestListeners(requestListeners);\n  }\n\n  @Override\n  public void onHostResume() {\n  }\n\n  @Override\n  public void onHostPause() {\n  }\n\n  @Override\n  public void onHostDestroy() {\n    // According to the javadoc for LifecycleEventListener#onHostDestroy, this is only called when\n    // the 'last' ReactActivity is being destroyed, which effectively means the app is being\n    // backgrounded.\n    if (hasBeenInitialized() && mClearOnDestroy) {\n      Fresco.getImagePipeline().clearMemoryCaches();\n    }\n  }\n\n  private static class FrescoHandler implements SoLoaderShim.Handler {\n    @Override\n    public void loadLibrary(String libraryName) {\n      SoLoader.loadLibrary(libraryName);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/fresco/ReactNetworkImageRequest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n * <p/>\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\npackage com.facebook.react.modules.fresco;\n\nimport com.facebook.imagepipeline.request.ImageRequest;\nimport com.facebook.imagepipeline.request.ImageRequestBuilder;\nimport com.facebook.react.bridge.ReadableMap;\n\n/** Extended ImageRequest with request headers */\npublic class ReactNetworkImageRequest extends ImageRequest {\n\n  /** Headers for the request */\n  private final ReadableMap mHeaders;\n\n  public static ReactNetworkImageRequest fromBuilderWithHeaders(ImageRequestBuilder builder,\n                                                                ReadableMap headers) {\n    return new ReactNetworkImageRequest(builder, headers);\n  }\n\n  protected ReactNetworkImageRequest(ImageRequestBuilder builder, ReadableMap headers) {\n    super(builder);\n    this.mHeaders = headers;\n  }\n\n  public ReadableMap getHeaders() {\n    return mHeaders;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/fresco/ReactOkHttpNetworkFetcher.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n * <p/>\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\npackage com.facebook.react.modules.fresco;\n\nimport com.facebook.imagepipeline.producers.NetworkFetcher;\nimport com.facebook.imagepipeline.backends.okhttp3.OkHttpNetworkFetcher;\nimport android.net.Uri;\nimport android.os.SystemClock;\n\nimport com.facebook.imagepipeline.backends.okhttp3.OkHttpNetworkFetcher;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.ReadableMapKeySetIterator;\n\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.concurrent.Executor;\n\nimport okhttp3.CacheControl;\nimport okhttp3.Headers;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\n\nclass ReactOkHttpNetworkFetcher extends OkHttpNetworkFetcher {\n\n  private static final String TAG = \"ReactOkHttpNetworkFetcher\";\n\n  private final OkHttpClient mOkHttpClient;\n  private final Executor mCancellationExecutor;\n\n  /**\n   * @param okHttpClient client to use\n   */\n  public ReactOkHttpNetworkFetcher(OkHttpClient okHttpClient) {\n    super(okHttpClient);\n    mOkHttpClient = okHttpClient;\n    mCancellationExecutor = okHttpClient.dispatcher().executorService();\n  }\n\n  private Map<String, String> getHeaders(ReadableMap readableMap) {\n    if (readableMap == null) {\n        return null;\n    }\n    ReadableMapKeySetIterator iterator = readableMap.keySetIterator();\n    Map<String, String> map = new HashMap<>();\n    while (iterator.hasNextKey()) {\n      String key = iterator.nextKey();\n      String value = readableMap.getString(key);\n      map.put(key, value);\n    }\n    return map;\n  }\n\n  @Override\n  public void fetch(final OkHttpNetworkFetcher.OkHttpNetworkFetchState fetchState, final NetworkFetcher.Callback callback) {\n    fetchState.submitTime = SystemClock.elapsedRealtime();\n    final Uri uri = fetchState.getUri();\n    Map<String, String> requestHeaders = null;\n    if (fetchState.getContext().getImageRequest() instanceof ReactNetworkImageRequest) {\n      ReactNetworkImageRequest networkImageRequest = (ReactNetworkImageRequest)\n        fetchState.getContext().getImageRequest();\n      requestHeaders = getHeaders(networkImageRequest.getHeaders());\n    }\n    if (requestHeaders == null) {\n      requestHeaders = Collections.emptyMap();\n    }\n    final Request request = new Request.Builder()\n      .cacheControl(new CacheControl.Builder().noStore().build())\n      .url(uri.toString())\n      .headers(Headers.of(requestHeaders))\n      .get()\n      .build();\n\n    fetchWithRequest(fetchState, callback, request);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/fresco/SystraceRequestListener.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.modules.fresco;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport android.util.Pair;\n\nimport com.facebook.imagepipeline.listener.BaseRequestListener;\nimport com.facebook.imagepipeline.request.ImageRequest;\nimport com.facebook.systrace.Systrace;\n\n/**\n * Logs requests to Systrace\n */\npublic class SystraceRequestListener extends BaseRequestListener {\n\n  int mCurrentID = 0;\n  Map<String, Pair<Integer,String>> mProducerID = new HashMap<>();\n  Map<String, Pair<Integer,String>> mRequestsID = new HashMap<>();\n\n  @Override\n  public void onProducerStart(String requestId, String producerName) {\n    if (!Systrace.isTracing(Systrace.TRACE_TAG_REACT_FRESCO)) {\n      return;\n    }\n\n    StringBuilder entryName = new StringBuilder();\n    entryName.append(\"FRESCO_PRODUCER_\");\n    entryName.append(producerName.replace(':', '_'));\n\n    Pair<Integer,String> requestPair = Pair.create(mCurrentID, entryName.toString());\n    Systrace.beginAsyncSection(\n        Systrace.TRACE_TAG_REACT_FRESCO,\n        requestPair.second,\n        mCurrentID);\n    mProducerID.put(requestId, requestPair);\n    mCurrentID++;\n  }\n\n  @Override\n  public void onProducerFinishWithSuccess(\n      String requestId,\n      String producerName,\n      Map<String, String> extraMap) {\n    if (!Systrace.isTracing(Systrace.TRACE_TAG_REACT_FRESCO)) {\n      return;\n    }\n\n    if (mProducerID.containsKey(requestId)) {\n      Pair<Integer, String> entry = mProducerID.get(requestId);\n      Systrace.endAsyncSection(\n          Systrace.TRACE_TAG_REACT_FRESCO,\n          entry.second,\n          entry.first);\n      mProducerID.remove(requestId);\n    }\n  }\n\n  @Override\n  public void onProducerFinishWithFailure(\n      String requestId,\n      String producerName,\n      Throwable throwable,\n      Map<String, String> extraMap) {\n    if (!Systrace.isTracing(Systrace.TRACE_TAG_REACT_FRESCO)) {\n      return;\n    }\n\n    if (mProducerID.containsKey(requestId)) {\n      Pair<Integer, String> entry = mProducerID.get(requestId);\n      Systrace.endAsyncSection(\n          Systrace.TRACE_TAG_REACT_FRESCO,\n          entry.second,\n          entry.first);\n      mProducerID.remove(requestId);\n    }\n  }\n\n  @Override\n  public void onProducerFinishWithCancellation(\n      String requestId, String producerName, Map<String, String> extraMap) {\n    if (!Systrace.isTracing(Systrace.TRACE_TAG_REACT_FRESCO)) {\n      return;\n    }\n\n    if (mProducerID.containsKey(requestId)) {\n      Pair<Integer, String> entry = mProducerID.get(requestId);\n      Systrace.endAsyncSection(\n          Systrace.TRACE_TAG_REACT_FRESCO,\n          entry.second,\n          entry.first);\n      mProducerID.remove(requestId);\n    }\n  }\n\n  @Override\n  public void onProducerEvent(String requestId, String producerName, String producerEventName) {\n    if (!Systrace.isTracing(Systrace.TRACE_TAG_REACT_FRESCO)) {\n      return;\n    }\n\n    StringBuilder entryName = new StringBuilder();\n    entryName.append(\"FRESCO_PRODUCER_EVENT_\");\n    entryName.append(requestId.replace(':', '_'));\n    entryName.append(\"_\");\n    entryName.append(producerName.replace(':', '_'));\n    entryName.append(\"_\");\n    entryName.append(producerEventName.replace(':', '_'));\n    Systrace.traceInstant(\n        Systrace.TRACE_TAG_REACT_FRESCO,\n        entryName.toString(),\n        Systrace.EventScope.THREAD);\n  }\n\n  @Override\n  public void onRequestStart(\n      ImageRequest request,\n      Object callerContext,\n      String requestId,\n      boolean isPrefetch) {\n    if (!Systrace.isTracing(Systrace.TRACE_TAG_REACT_FRESCO)) {\n      return;\n    }\n\n    StringBuilder entryName = new StringBuilder();\n    entryName.append(\"FRESCO_REQUEST_\");\n    entryName.append(request.getSourceUri().toString().replace(':', '_'));\n\n    Pair<Integer,String> requestPair = Pair.create(mCurrentID, entryName.toString());\n    Systrace.beginAsyncSection(\n        Systrace.TRACE_TAG_REACT_FRESCO,\n        requestPair.second,\n        mCurrentID);\n    mRequestsID.put(requestId, requestPair);\n    mCurrentID++;\n  }\n\n  @Override\n  public void onRequestSuccess(ImageRequest request, String requestId, boolean isPrefetch) {\n    if (!Systrace.isTracing(Systrace.TRACE_TAG_REACT_FRESCO)) {\n      return;\n    }\n\n    if (mRequestsID.containsKey(requestId)) {\n      Pair<Integer, String> entry = mRequestsID.get(requestId);\n      Systrace.endAsyncSection(\n          Systrace.TRACE_TAG_REACT_FRESCO,\n          entry.second,\n          entry.first);\n      mRequestsID.remove(requestId);\n    }\n  }\n\n  @Override\n  public void onRequestFailure(\n      ImageRequest request,\n      String requestId,\n      Throwable throwable,\n      boolean isPrefetch) {\n    if (!Systrace.isTracing(Systrace.TRACE_TAG_REACT_FRESCO)) {\n      return;\n    }\n\n    if (mRequestsID.containsKey(requestId)) {\n      Pair<Integer, String> entry = mRequestsID.get(requestId);\n      Systrace.endAsyncSection(\n          Systrace.TRACE_TAG_REACT_FRESCO,\n          entry.second,\n          entry.first);\n      mRequestsID.remove(requestId);\n    }\n  }\n\n  @Override\n  public void onRequestCancellation(String requestId) {\n    if (!Systrace.isTracing(Systrace.TRACE_TAG_REACT_FRESCO)) {\n      return;\n    }\n\n    if (mRequestsID.containsKey(requestId)) {\n      Pair<Integer, String> entry = mRequestsID.get(requestId);\n      Systrace.endAsyncSection(\n          Systrace.TRACE_TAG_REACT_FRESCO,\n          entry.second,\n          entry.first);\n      mRequestsID.remove(requestId);\n    }\n  }\n\n  @Override\n  public boolean requiresExtraMap(String id) {\n    return false;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"i18nmanager\",\n    srcs = glob([\"*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.i18nmanager;\n\nimport android.content.Context;\nimport com.facebook.react.bridge.ContextBaseJavaModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.module.annotations.ReactModule;\nimport java.util.Locale;\nimport java.util.Map;\n\n/**\n * {@link NativeModule} that allows JS to set allowRTL and get isRTL status.\n */\n@ReactModule(name = \"I18nManager\")\npublic class I18nManagerModule extends ContextBaseJavaModule {\n\n  private final I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();\n\n  public I18nManagerModule(Context context) {\n    super(context);\n  }\n\n  @Override\n  public String getName() {\n    return \"I18nManager\";\n  }\n\n  @Override\n  public Map<String, Object> getConstants() {\n    final Context context = getContext();\n    final Locale locale = context.getResources().getConfiguration().locale;\n\n    final Map<String, Object> constants = MapBuilder.newHashMap();\n    constants.put(\"isRTL\", sharedI18nUtilInstance.isRTL(context));\n    constants.put(\n        \"doLeftAndRightSwapInRTL\", sharedI18nUtilInstance.doLeftAndRightSwapInRTL(context));\n    constants.put(\"localeIdentifier\", locale.toString());\n    return constants;\n  }\n\n  @ReactMethod\n  public void allowRTL(boolean value) {\n    sharedI18nUtilInstance.allowRTL(getContext(), value);\n  }\n\n  @ReactMethod\n  public void forceRTL(boolean value) {\n    sharedI18nUtilInstance.forceRTL(getContext(), value);\n  }\n\n  @ReactMethod\n  public void swapLeftAndRightInRTL(boolean value) {\n    sharedI18nUtilInstance.swapLeftAndRightInRTL(getContext(), value);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nUtil.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.i18nmanager;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.support.v4.text.TextUtilsCompat;\nimport android.support.v4.view.ViewCompat;\nimport java.util.Locale;\n\npublic class I18nUtil {\n  private static I18nUtil sharedI18nUtilInstance = null;\n\n  private static final String SHARED_PREFS_NAME =\n    \"com.facebook.react.modules.i18nmanager.I18nUtil\";\n  private static final String KEY_FOR_PREFS_ALLOWRTL =\n    \"RCTI18nUtil_allowRTL\";\n  private static final String KEY_FOR_PREFS_FORCERTL =\n    \"RCTI18nUtil_forceRTL\";\n  private static final String KEY_FOR_PERFS_MAKE_RTL_FLIP_LEFT_AND_RIGHT_STYLES =\n    \"RCTI18nUtil_makeRTLFlipLeftAndRightStyles\";\n\n  private I18nUtil() {\n     // Exists only to defeat instantiation.\n  }\n\n  public static I18nUtil getInstance() {\n    if (sharedI18nUtilInstance == null) {\n      sharedI18nUtilInstance = new I18nUtil();\n    }\n    return sharedI18nUtilInstance;\n  }\n\n  /**\n   * Check if the device is currently running on an RTL locale.\n   * This only happens when the app:\n   * - is forcing RTL layout, regardless of the active language (for development purpose)\n   * - allows RTL layout when using RTL locale\n   */\n  public boolean isRTL(Context context) {\n    if (isRTLForced(context)) {\n      return true;\n    }\n    return isRTLAllowed(context) &&\n      isDevicePreferredLanguageRTL();\n  }\n\n  /**\n   * Should be used very early during app start up\n   * Before the bridge is initialized\n   * @return whether the app allows RTL layout, default is true\n   */\n  private boolean isRTLAllowed(Context context) {\n    return isPrefSet(context, KEY_FOR_PREFS_ALLOWRTL, true);\n  }\n\n  public void allowRTL(Context context, boolean allowRTL) {\n    setPref(context, KEY_FOR_PREFS_ALLOWRTL, allowRTL);\n  }\n\n  public boolean doLeftAndRightSwapInRTL(Context context) {\n    return isPrefSet(context, KEY_FOR_PERFS_MAKE_RTL_FLIP_LEFT_AND_RIGHT_STYLES, true);\n  }\n\n  public void swapLeftAndRightInRTL(Context context, boolean flip) {\n    setPref(context, KEY_FOR_PERFS_MAKE_RTL_FLIP_LEFT_AND_RIGHT_STYLES, flip);\n  }\n\n  /**\n   * Could be used to test RTL layout with English\n   * Used for development and testing purpose\n   */\n  private boolean isRTLForced(Context context) {\n    return isPrefSet(context, KEY_FOR_PREFS_FORCERTL, false);\n  }\n\n  public void forceRTL(Context context, boolean forceRTL) {\n    setPref(context, KEY_FOR_PREFS_FORCERTL, forceRTL);\n  }\n\n  // Check if the current device language is RTL\n  private boolean isDevicePreferredLanguageRTL() {\n    final int directionality =\n      TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault());\n    return directionality == ViewCompat.LAYOUT_DIRECTION_RTL;\n   }\n\n  private boolean isPrefSet(Context context, String key, boolean defaultValue) {\n    SharedPreferences prefs =\n      context.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE);\n    return prefs.getBoolean(key, defaultValue);\n  }\n\n  private void setPref(Context context, String key, boolean value) {\n    SharedPreferences.Editor editor =\n      context.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE).edit();\n    editor.putBoolean(key, value);\n    editor.apply();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/image/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"image\",\n    srcs = glob([\"*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fresco/fresco-react-native:fbcore\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-drawee\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-react-native\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:imagepipeline\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.image;\n\nimport javax.annotation.Nullable;\n\nimport android.net.Uri;\nimport android.util.SparseArray;\n\nimport com.facebook.common.executors.CallerThreadExecutor;\nimport com.facebook.common.references.CloseableReference;\nimport com.facebook.datasource.BaseDataSubscriber;\nimport com.facebook.datasource.DataSource;\nimport com.facebook.datasource.DataSubscriber;\nimport com.facebook.drawee.backends.pipeline.Fresco;\nimport com.facebook.imagepipeline.core.ImagePipeline;\nimport com.facebook.imagepipeline.image.CloseableImage;\nimport com.facebook.imagepipeline.request.ImageRequest;\nimport com.facebook.imagepipeline.request.ImageRequestBuilder;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.GuardedAsyncTask;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.Promise;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.module.annotations.ReactModule;\n\n@ReactModule(name = \"ImageLoader\")\npublic class ImageLoaderModule extends ReactContextBaseJavaModule implements\n  LifecycleEventListener {\n\n  private static final String ERROR_INVALID_URI = \"E_INVALID_URI\";\n  private static final String ERROR_PREFETCH_FAILURE = \"E_PREFETCH_FAILURE\";\n  private static final String ERROR_GET_SIZE_FAILURE = \"E_GET_SIZE_FAILURE\";\n\n  private final Object mCallerContext;\n  private final Object mEnqueuedRequestMonitor = new Object();\n  private final SparseArray<DataSource<Void>> mEnqueuedRequests = new SparseArray<>();\n\n  public ImageLoaderModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n    mCallerContext = this;\n  }\n\n  public ImageLoaderModule(ReactApplicationContext reactContext, Object callerContext) {\n    super(reactContext);\n    mCallerContext = callerContext;\n  }\n\n  @Override\n  public String getName() {\n    return \"ImageLoader\";\n  }\n\n  /**\n   * Fetch the width and height of the given image.\n   *\n   * @param uriString the URI of the remote image to prefetch\n   * @param promise the promise that is fulfilled when the image is successfully prefetched\n   *                or rejected when there is an error\n   */\n  @ReactMethod\n  public void getSize(\n      final String uriString,\n      final Promise promise) {\n    if (uriString == null || uriString.isEmpty()) {\n      promise.reject(ERROR_INVALID_URI, \"Cannot get the size of an image for an empty URI\");\n      return;\n    }\n\n    Uri uri = Uri.parse(uriString);\n    ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri).build();\n\n    DataSource<CloseableReference<CloseableImage>> dataSource =\n      Fresco.getImagePipeline().fetchDecodedImage(request, mCallerContext);\n\n    DataSubscriber<CloseableReference<CloseableImage>> dataSubscriber =\n      new BaseDataSubscriber<CloseableReference<CloseableImage>>() {\n        @Override\n        protected void onNewResultImpl(\n            DataSource<CloseableReference<CloseableImage>> dataSource) {\n          if (!dataSource.isFinished()) {\n            return;\n          }\n          CloseableReference<CloseableImage> ref = dataSource.getResult();\n          if (ref != null) {\n            try {\n              CloseableImage image = ref.get();\n\n              WritableMap sizes = Arguments.createMap();\n              sizes.putInt(\"width\", image.getWidth());\n              sizes.putInt(\"height\", image.getHeight());\n\n              promise.resolve(sizes);\n            } catch (Exception e) {\n              promise.reject(ERROR_GET_SIZE_FAILURE, e);\n            } finally {\n              CloseableReference.closeSafely(ref);\n            }\n          } else {\n            promise.reject(ERROR_GET_SIZE_FAILURE);\n          }\n        }\n\n        @Override\n        protected void onFailureImpl(DataSource<CloseableReference<CloseableImage>> dataSource) {\n          promise.reject(ERROR_GET_SIZE_FAILURE, dataSource.getFailureCause());\n        }\n      };\n    dataSource.subscribe(dataSubscriber, CallerThreadExecutor.getInstance());\n  }\n\n  /**\n   * Prefetches the given image to the Fresco image disk cache.\n   *\n   * @param uriString the URI of the remote image to prefetch\n   * @param requestId the client-supplied request ID used to identify this request\n   * @param promise the promise that is fulfilled when the image is successfully prefetched\n   *                or rejected when there is an error\n   */\n  @ReactMethod\n  public void prefetchImage(\n    final String uriString,\n    final int requestId,\n    final Promise promise)\n  {\n    if (uriString == null || uriString.isEmpty()) {\n      promise.reject(ERROR_INVALID_URI, \"Cannot prefetch an image for an empty URI\");\n      return;\n    }\n\n    Uri uri = Uri.parse(uriString);\n    ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri).build();\n\n    DataSource<Void> prefetchSource =\n      Fresco.getImagePipeline().prefetchToDiskCache(request, mCallerContext);\n    DataSubscriber<Void> prefetchSubscriber = new BaseDataSubscriber<Void>() {\n      @Override\n      protected void onNewResultImpl(DataSource<Void> dataSource) {\n        if (!dataSource.isFinished()) {\n          return;\n        }\n        try {\n          removeRequest(requestId);\n          promise.resolve(true);\n        } finally {\n          dataSource.close();\n        }\n      }\n\n      @Override\n      protected void onFailureImpl(DataSource<Void> dataSource) {\n        try {\n          removeRequest(requestId);\n          promise.reject(ERROR_PREFETCH_FAILURE, dataSource.getFailureCause());\n        } finally {\n          dataSource.close();\n        }\n      }\n    };\n    registerRequest(requestId, prefetchSource);\n    prefetchSource.subscribe(prefetchSubscriber, CallerThreadExecutor.getInstance());\n  }\n\n  @ReactMethod\n  public void abortRequest(final int requestId) {\n    DataSource<Void> request = removeRequest(requestId);\n    if (request != null) {\n      request.close();\n    }\n  }\n\n  @ReactMethod\n  public void queryCache(final ReadableArray uris, final Promise promise) {\n    // perform cache interrogation in async task as disk cache checks are expensive\n    new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {\n      @Override\n      protected void doInBackgroundGuarded(Void... params) {\n        WritableMap result = Arguments.createMap();\n        ImagePipeline imagePipeline = Fresco.getImagePipeline();\n        for (int i = 0; i < uris.size(); i++) {\n          String uriString = uris.getString(i);\n          final Uri uri = Uri.parse(uriString);\n          if (imagePipeline.isInBitmapMemoryCache(uri)) {\n            result.putString(uriString, \"memory\");\n          } else if (imagePipeline.isInDiskCacheSync(uri)) {\n            result.putString(uriString, \"disk\");\n          }\n        }\n        promise.resolve(result);\n      }\n    }.executeOnExecutor(GuardedAsyncTask.THREAD_POOL_EXECUTOR);\n  }\n\n  private void registerRequest(int requestId, DataSource<Void> request) {\n    synchronized (mEnqueuedRequestMonitor) {\n      mEnqueuedRequests.put(requestId, request);\n    }\n  }\n\n  private @Nullable DataSource<Void> removeRequest(int requestId) {\n    synchronized (mEnqueuedRequestMonitor) {\n      DataSource<Void> request = mEnqueuedRequests.get(requestId);\n      mEnqueuedRequests.remove(requestId);\n      return request;\n    }\n  }\n\n  @Override\n  public void onHostResume() {\n  }\n\n  @Override\n  public void onHostPause() {\n  }\n\n  @Override\n  public void onHostDestroy() {\n    // cancel all requests\n    synchronized (mEnqueuedRequestMonitor) {\n      for (int i = 0, size = mEnqueuedRequests.size(); i < size; i++) {\n        @Nullable DataSource<Void> enqueuedRequest = mEnqueuedRequests.valueAt(i);\n        if (enqueuedRequest != null) {\n          enqueuedRequest.close();\n        }\n      }\n      mEnqueuedRequests.clear();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/intent/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"intent\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.intent;\n\nimport android.app.Activity;\nimport android.content.ComponentName;\nimport android.content.Intent;\nimport android.net.Uri;\n\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.Promise;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * Intent module. Launch other activities or open URLs.\n */\n@ReactModule(name = \"IntentAndroid\")\npublic class IntentModule extends ReactContextBaseJavaModule {\n\n  public IntentModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return \"IntentAndroid\";\n  }\n\n  /**\n   * Return the URL the activity was started with\n   *\n   * @param promise a promise which is resolved with the initial URL\n   */\n  @ReactMethod\n  public void getInitialURL(Promise promise) {\n    try {\n      Activity currentActivity = getCurrentActivity();\n      String initialURL = null;\n\n      if (currentActivity != null) {\n        Intent intent = currentActivity.getIntent();\n        String action = intent.getAction();\n        Uri uri = intent.getData();\n\n        if (Intent.ACTION_VIEW.equals(action) && uri != null) {\n          initialURL = uri.toString();\n        }\n      }\n\n      promise.resolve(initialURL);\n    } catch (Exception e) {\n      promise.reject(new JSApplicationIllegalArgumentException(\n          \"Could not get the initial URL : \" + e.getMessage()));\n    }\n  }\n\n  /**\n   * Starts a corresponding external activity for the given URL.\n   *\n   * For example, if the URL is \"https://www.facebook.com\", the system browser will be opened,\n   * or the \"choose application\" dialog will be shown.\n   *\n   * @param url the URL to open\n   */\n  @ReactMethod\n  public void openURL(String url, Promise promise) {\n    if (url == null || url.isEmpty()) {\n      promise.reject(new JSApplicationIllegalArgumentException(\"Invalid URL: \" + url));\n      return;\n    }\n\n    try {\n      Activity currentActivity = getCurrentActivity();\n      Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));\n\n      String selfPackageName = getReactApplicationContext().getPackageName();\n      ComponentName componentName = intent.resolveActivity(\n        getReactApplicationContext().getPackageManager());\n      String otherPackageName = (componentName != null ? componentName.getPackageName() : \"\");\n\n      // If there is no currentActivity or we are launching to a different package we need to set\n      // the FLAG_ACTIVITY_NEW_TASK flag\n      if (currentActivity == null || !selfPackageName.equals(otherPackageName)) {\n        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n      }\n\n      if (currentActivity != null) {\n        currentActivity.startActivity(intent);\n      } else {\n        getReactApplicationContext().startActivity(intent);\n      }\n\n      promise.resolve(true);\n    } catch (Exception e) {\n      promise.reject(new JSApplicationIllegalArgumentException(\n          \"Could not open URL '\" + url + \"': \" + e.getMessage()));\n    }\n  }\n\n  /**\n   * Determine whether or not an installed app can handle a given URL.\n   *\n   * @param url the URL to open\n   * @param promise a promise that is always resolved with a boolean argument\n   */\n  @ReactMethod\n  public void canOpenURL(String url, Promise promise) {\n    if (url == null || url.isEmpty()) {\n      promise.reject(new JSApplicationIllegalArgumentException(\"Invalid URL: \" + url));\n      return;\n    }\n\n    try {\n      Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));\n      // We need Intent.FLAG_ACTIVITY_NEW_TASK since getReactApplicationContext() returns\n      // the ApplicationContext instead of the Activity context.\n      intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n      boolean canOpen =\n          intent.resolveActivity(getReactApplicationContext().getPackageManager()) != null;\n      promise.resolve(canOpen);\n    } catch (Exception e) {\n      promise.reject(new JSApplicationIllegalArgumentException(\n          \"Could not check if URL '\" + url + \"' can be opened: \" + e.getMessage()));\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/location/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"location\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/location/LocationModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.location;\n\nimport android.content.Context;\nimport android.location.Location;\nimport android.location.LocationListener;\nimport android.location.LocationManager;\nimport android.location.LocationProvider;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.common.SystemClock;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;\nimport javax.annotation.Nullable;\n\n/**\n * Native module that exposes Geolocation to JS.\n */\n@ReactModule(name = \"LocationObserver\")\npublic class LocationModule extends ReactContextBaseJavaModule {\n\n  private @Nullable String mWatchedProvider;\n  private static final float RCT_DEFAULT_LOCATION_ACCURACY = 100;\n\n  private final LocationListener mLocationListener = new LocationListener() {\n    @Override\n    public void onLocationChanged(Location location) {\n      getReactApplicationContext().getJSModule(RCTDeviceEventEmitter.class)\n          .emit(\"geolocationDidChange\", locationToMap(location));\n    }\n\n    @Override\n    public void onStatusChanged(String provider, int status, Bundle extras) {\n      if (status == LocationProvider.OUT_OF_SERVICE) {\n        emitError(PositionError.POSITION_UNAVAILABLE, \"Provider \" + provider + \" is out of service.\");\n      } else if (status == LocationProvider.TEMPORARILY_UNAVAILABLE) {\n        emitError(PositionError.TIMEOUT, \"Provider \" + provider + \" is temporarily unavailable.\");\n      }\n    }\n\n    @Override\n    public void onProviderEnabled(String provider) { }\n\n    @Override\n    public void onProviderDisabled(String provider) { }\n  };\n\n  public LocationModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return \"LocationObserver\";\n  }\n\n  private static class LocationOptions {\n    private final long timeout;\n    private final double maximumAge;\n    private final boolean highAccuracy;\n    private final float distanceFilter;\n\n    private LocationOptions(\n      long timeout,\n      double maximumAge,\n      boolean highAccuracy,\n      float distanceFilter) {\n      this.timeout = timeout;\n      this.maximumAge = maximumAge;\n      this.highAccuracy = highAccuracy;\n      this.distanceFilter = distanceFilter;\n    }\n\n    private static LocationOptions fromReactMap(ReadableMap map) {\n      // precision might be dropped on timeout (double -> int conversion), but that's OK\n      long timeout =\n          map.hasKey(\"timeout\") ? (long) map.getDouble(\"timeout\") : Long.MAX_VALUE;\n      double maximumAge =\n          map.hasKey(\"maximumAge\") ? map.getDouble(\"maximumAge\") : Double.POSITIVE_INFINITY;\n      boolean highAccuracy =\n          map.hasKey(\"enableHighAccuracy\") && map.getBoolean(\"enableHighAccuracy\");\n      float distanceFilter = map.hasKey(\"distanceFilter\") ?\n        (float) map.getDouble(\"distanceFilter\") :\n        RCT_DEFAULT_LOCATION_ACCURACY;\n\n      return new LocationOptions(timeout, maximumAge, highAccuracy, distanceFilter);\n    }\n  }\n\n  /**\n   * Get the current position. This can return almost immediately if the location is cached or\n   * request an update, which might take a while.\n   *\n   * @param options map containing optional arguments: timeout (millis), maximumAge (millis) and\n   *        highAccuracy (boolean)\n   */\n  @ReactMethod\n  public void getCurrentPosition(\n      ReadableMap options,\n      final Callback success,\n      Callback error) {\n    LocationOptions locationOptions = LocationOptions.fromReactMap(options);\n\n    try {\n      LocationManager locationManager =\n          (LocationManager) getReactApplicationContext().getSystemService(Context.LOCATION_SERVICE);\n      String provider = getValidProvider(locationManager, locationOptions.highAccuracy);\n      if (provider == null) {\n        error.invoke(\n            PositionError.buildError(\n                PositionError.POSITION_UNAVAILABLE, \"No location provider available.\"));\n        return;\n      }\n      Location location = locationManager.getLastKnownLocation(provider);\n      if (location != null && (SystemClock.currentTimeMillis() - location.getTime()) < locationOptions.maximumAge) {\n        success.invoke(locationToMap(location));\n        return;\n      }\n\n      new SingleUpdateRequest(locationManager, provider, locationOptions.timeout, success, error)\n          .invoke(location);\n    } catch (SecurityException e) {\n      throwLocationPermissionMissing(e);\n    }\n  }\n\n  /**\n   * Start listening for location updates. These will be emitted via the\n   * {@link RCTDeviceEventEmitter} as {@code geolocationDidChange} events.\n   *\n   * @param options map containing optional arguments: highAccuracy (boolean)\n   */\n  @ReactMethod\n  public void startObserving(ReadableMap options) {\n    if (LocationManager.GPS_PROVIDER.equals(mWatchedProvider)) {\n      return;\n    }\n    LocationOptions locationOptions = LocationOptions.fromReactMap(options);\n\n    try {\n      LocationManager locationManager =\n          (LocationManager) getReactApplicationContext().getSystemService(Context.LOCATION_SERVICE);\n      String provider = getValidProvider(locationManager, locationOptions.highAccuracy);\n      if (provider == null) {\n        emitError(PositionError.POSITION_UNAVAILABLE, \"No location provider available.\");\n        return;\n      }\n      if (!provider.equals(mWatchedProvider)) {\n        locationManager.removeUpdates(mLocationListener);\n        locationManager.requestLocationUpdates(\n          provider,\n          1000,\n          locationOptions.distanceFilter,\n          mLocationListener);\n      }\n      mWatchedProvider = provider;\n    } catch (SecurityException e) {\n      throwLocationPermissionMissing(e);\n    }\n  }\n\n  /**\n   * Stop listening for location updates.\n   *\n   * NB: this is not balanced with {@link #startObserving}: any number of calls to that method will\n   * be canceled by just one call to this one.\n   */\n  @ReactMethod\n  public void stopObserving() {\n    LocationManager locationManager =\n        (LocationManager) getReactApplicationContext().getSystemService(Context.LOCATION_SERVICE);\n    locationManager.removeUpdates(mLocationListener);\n    mWatchedProvider = null;\n  }\n\n  @Nullable\n  private static String getValidProvider(LocationManager locationManager, boolean highAccuracy) {\n    String provider =\n        highAccuracy ? LocationManager.GPS_PROVIDER : LocationManager.NETWORK_PROVIDER;\n    if (!locationManager.isProviderEnabled(provider)) {\n      provider = provider.equals(LocationManager.GPS_PROVIDER)\n          ? LocationManager.NETWORK_PROVIDER\n          : LocationManager.GPS_PROVIDER;\n      if (!locationManager.isProviderEnabled(provider)) {\n        return null;\n      }\n    }\n    return provider;\n  }\n\n  private static WritableMap locationToMap(Location location) {\n    WritableMap map = Arguments.createMap();\n    WritableMap coords = Arguments.createMap();\n    coords.putDouble(\"latitude\", location.getLatitude());\n    coords.putDouble(\"longitude\", location.getLongitude());\n    coords.putDouble(\"altitude\", location.getAltitude());\n    coords.putDouble(\"accuracy\", location.getAccuracy());\n    coords.putDouble(\"heading\", location.getBearing());\n    coords.putDouble(\"speed\", location.getSpeed());\n    map.putMap(\"coords\", coords);\n    map.putDouble(\"timestamp\", location.getTime());\n\n    if (android.os.Build.VERSION.SDK_INT >= 18) {\n      map.putBoolean(\"mocked\", location.isFromMockProvider());\n    }\n\n    return map;\n  }\n\n  private void emitError(int code, String message) {\n    getReactApplicationContext().getJSModule(RCTDeviceEventEmitter.class)\n        .emit(\"geolocationError\", PositionError.buildError(code, message));\n  }\n\n  /**\n   * Provides a clearer exception message than the default one.\n   */\n  private static void throwLocationPermissionMissing(SecurityException e) {\n    throw new SecurityException(\n      \"Looks like the app doesn't have the permission to access location.\\n\" +\n      \"Add the following line to your app's AndroidManifest.xml:\\n\" +\n      \"<uses-permission android:name=\\\"android.permission.ACCESS_FINE_LOCATION\\\" />\", e);\n  }\n\n  private static class SingleUpdateRequest {\n\n    private final Callback mSuccess;\n    private final Callback mError;\n    private final LocationManager mLocationManager;\n    private final String mProvider;\n    private final long mTimeout;\n    private Location mOldLocation;\n    private final Handler mHandler = new Handler();\n    private final Runnable mTimeoutRunnable = new Runnable() {\n      @Override\n      public void run() {\n        synchronized (SingleUpdateRequest.this) {\n          if (!mTriggered) {\n            mError.invoke(PositionError.buildError(PositionError.TIMEOUT, \"Location request timed out\"));\n            mLocationManager.removeUpdates(mLocationListener);\n            FLog.i(ReactConstants.TAG, \"LocationModule: Location request timed out\");\n            mTriggered = true;\n          }\n        }\n      }\n    };\n    private final LocationListener mLocationListener = new LocationListener() {\n      @Override\n      public void onLocationChanged(Location location) {\n        synchronized (SingleUpdateRequest.this) {\n          if (!mTriggered && isBetterLocation(location, mOldLocation)) {\n            mSuccess.invoke(locationToMap(location));\n            mHandler.removeCallbacks(mTimeoutRunnable);\n            mTriggered = true;\n            mLocationManager.removeUpdates(mLocationListener);\n          }\n\n          mOldLocation = location;\n        }\n      }\n\n      @Override\n      public void onStatusChanged(String provider, int status, Bundle extras) {}\n\n      @Override\n      public void onProviderEnabled(String provider) {}\n\n      @Override\n      public void onProviderDisabled(String provider) {}\n    };\n    private boolean mTriggered;\n\n    private SingleUpdateRequest(\n        LocationManager locationManager,\n        String provider,\n        long timeout,\n        Callback success,\n        Callback error) {\n      mLocationManager = locationManager;\n      mProvider = provider;\n      mTimeout = timeout;\n      mSuccess = success;\n      mError = error;\n    }\n\n    public void invoke(Location location) {\n      mOldLocation = location;\n      mLocationManager.requestLocationUpdates(mProvider, 100, 1, mLocationListener);\n      mHandler.postDelayed(mTimeoutRunnable, mTimeout);\n    }\n\n    private static final int TWO_MINUTES = 1000 * 60 * 2;\n\n    /** Determines whether one Location reading is better than the current Location fix\n    * taken from Android Examples https://developer.android.com/guide/topics/location/strategies.html\n    *\n    * @param location  The new Location that you want to evaluate\n    * @param currentBestLocation  The current Location fix, to which you want to compare the new one\n    */\n    private boolean isBetterLocation(Location location, Location currentBestLocation) {\n      if (currentBestLocation == null) {\n        // A new location is always better than no location\n        return true;\n      }\n\n      // Check whether the new location fix is newer or older\n      long timeDelta = location.getTime() - currentBestLocation.getTime();\n      boolean isSignificantlyNewer = timeDelta > TWO_MINUTES;\n      boolean isSignificantlyOlder = timeDelta < -TWO_MINUTES;\n      boolean isNewer = timeDelta > 0;\n\n      // If it's been more than two minutes since the current location, use the new location\n      // because the user has likely moved\n      if (isSignificantlyNewer) {\n        return true;\n      // If the new location is more than two minutes older, it must be worse\n      } else if (isSignificantlyOlder) {\n        return false;\n      }\n\n      // Check whether the new location fix is more or less accurate\n      int accuracyDelta = (int) (location.getAccuracy() - currentBestLocation.getAccuracy());\n      boolean isLessAccurate = accuracyDelta > 0;\n      boolean isMoreAccurate = accuracyDelta < 0;\n      boolean isSignificantlyLessAccurate = accuracyDelta > 200;\n\n      // Check if the old and new location are from the same provider\n      boolean isFromSameProvider = isSameProvider(location.getProvider(),\n      currentBestLocation.getProvider());\n\n      // Determine location quality using a combination of timeliness and accuracy\n      if (isMoreAccurate) {\n        return true;\n      } else if (isNewer && !isLessAccurate) {\n        return true;\n      } else if (isNewer && !isSignificantlyLessAccurate && isFromSameProvider) {\n        return true;\n      }\n\n      return false;\n  }\n\n  /** Checks whether two providers are the same */\n  private boolean isSameProvider(String provider1, String provider2) {\n    if (provider1 == null) {\n        return provider2 == null;\n      }\n    return provider1.equals(provider2);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/location/PositionError.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.location;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\n\n/**\n * @see {https://developer.mozilla.org/en-US/docs/Web/API/PositionError}\n */\npublic class PositionError {\n  /**\n   * The acquisition of the geolocation information failed because\n   * the page didn't have the permission to do it.\n   */\n  public static int PERMISSION_DENIED = 1;\n\n  /**\n   * The acquisition of the geolocation failed because at least one\n   * internal source of position returned an internal error.\n   */\n  public static int POSITION_UNAVAILABLE = 2;\n\n  /**\n   * The time allowed to acquire the geolocation, defined by\n   * PositionOptions.timeout information was reached before the information was obtained.\n   */\n  public static int TIMEOUT = 3;\n\n  public static WritableMap buildError(int code, String message) {\n    WritableMap error = Arguments.createMap();\n    error.putInt(\"code\", code);\n    if (message != null) {\n      error.putString(\"message\", message);\n    }\n    return error;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/netinfo/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"netinfo\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/netinfo/NetInfoModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.netinfo;\n\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.IntentFilter;\nimport android.net.ConnectivityManager;\nimport android.net.NetworkInfo;\nimport android.support.v4.net.ConnectivityManagerCompat;\nimport android.telephony.TelephonyManager;\n\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.Promise;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.module.annotations.ReactModule;\n\nimport static com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;\n\n/**\n * Module that monitors and provides information about the connectivity state of the device.\n */\n@ReactModule(name = \"NetInfo\")\npublic class NetInfoModule extends ReactContextBaseJavaModule\n    implements LifecycleEventListener {\n\n  // Based on the ConnectionType enum described in the W3C Network Information API spec\n  // (https://wicg.github.io/netinfo/).\n  private static final String CONNECTION_TYPE_BLUETOOTH = \"bluetooth\";\n  private static final String CONNECTION_TYPE_CELLULAR = \"cellular\";\n  private static final String CONNECTION_TYPE_ETHERNET = \"ethernet\";\n  private static final String CONNECTION_TYPE_NONE = \"none\";\n  private static final String CONNECTION_TYPE_UNKNOWN = \"unknown\";\n  private static final String CONNECTION_TYPE_WIFI = \"wifi\";\n  private static final String CONNECTION_TYPE_WIMAX = \"wimax\";\n\n  // Based on the EffectiveConnectionType enum described in the W3C Network Information API spec\n  // (https://wicg.github.io/netinfo/).\n  private static final String EFFECTIVE_CONNECTION_TYPE_UNKNOWN = \"unknown\";\n  private static final String EFFECTIVE_CONNECTION_TYPE_2G = \"2g\";\n  private static final String EFFECTIVE_CONNECTION_TYPE_3G = \"3g\";\n  private static final String EFFECTIVE_CONNECTION_TYPE_4G = \"4g\";\n\n  private static final String CONNECTION_TYPE_NONE_DEPRECATED = \"NONE\";\n  private static final String CONNECTION_TYPE_UNKNOWN_DEPRECATED = \"UNKNOWN\";\n\n  private static final String MISSING_PERMISSION_MESSAGE =\n      \"To use NetInfo on Android, add the following to your AndroidManifest.xml:\\n\" +\n      \"<uses-permission android:name=\\\"android.permission.ACCESS_NETWORK_STATE\\\" />\";\n\n  private static final String ERROR_MISSING_PERMISSION = \"E_MISSING_PERMISSION\";\n\n  private final ConnectivityManager mConnectivityManager;\n  private final ConnectivityBroadcastReceiver mConnectivityBroadcastReceiver;\n  private boolean mNoNetworkPermission = false;\n\n  private String mConnectivityDeprecated = CONNECTION_TYPE_UNKNOWN_DEPRECATED;\n  private String mConnectionType = CONNECTION_TYPE_UNKNOWN;\n  private String mEffectiveConnectionType = EFFECTIVE_CONNECTION_TYPE_UNKNOWN;\n\n  public NetInfoModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n    mConnectivityManager =\n        (ConnectivityManager) reactContext.getSystemService(Context.CONNECTIVITY_SERVICE);\n    mConnectivityBroadcastReceiver = new ConnectivityBroadcastReceiver();\n  }\n\n  @Override\n  public void onHostResume() {\n    registerReceiver();\n  }\n\n  @Override\n  public void onHostPause() {\n    unregisterReceiver();\n  }\n\n  @Override\n  public void onHostDestroy() {\n  }\n\n  @Override\n  public void initialize() {\n    getReactApplicationContext().addLifecycleEventListener(this);\n  }\n\n  @Override\n  public String getName() {\n    return \"NetInfo\";\n  }\n\n  @ReactMethod\n  public void getCurrentConnectivity(Promise promise) {\n    if (mNoNetworkPermission) {\n      promise.reject(ERROR_MISSING_PERMISSION, MISSING_PERMISSION_MESSAGE, null);\n      return;\n    }\n    promise.resolve(createConnectivityEventMap());\n  }\n\n  @ReactMethod\n  public void isConnectionMetered(Promise promise) {\n    if (mNoNetworkPermission) {\n      promise.reject(ERROR_MISSING_PERMISSION, MISSING_PERMISSION_MESSAGE, null);\n      return;\n    }\n    promise.resolve(ConnectivityManagerCompat.isActiveNetworkMetered(mConnectivityManager));\n  }\n\n  private void registerReceiver() {\n    IntentFilter filter = new IntentFilter();\n    filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);\n    getReactApplicationContext().registerReceiver(mConnectivityBroadcastReceiver, filter);\n    mConnectivityBroadcastReceiver.setRegistered(true);\n    updateAndSendConnectionType();\n  }\n\n  private void unregisterReceiver() {\n    if (mConnectivityBroadcastReceiver.isRegistered()) {\n      getReactApplicationContext().unregisterReceiver(mConnectivityBroadcastReceiver);\n      mConnectivityBroadcastReceiver.setRegistered(false);\n    }\n  }\n\n  private void updateAndSendConnectionType() {\n    String connectionType = CONNECTION_TYPE_UNKNOWN;\n    String effectiveConnectionType = EFFECTIVE_CONNECTION_TYPE_UNKNOWN;\n\n    try {\n      NetworkInfo networkInfo = mConnectivityManager.getActiveNetworkInfo();\n      if (networkInfo == null || !networkInfo.isConnected()) {\n        connectionType = CONNECTION_TYPE_NONE;\n      } else {\n        int networkType = networkInfo.getType();\n        switch (networkType) {\n          case ConnectivityManager.TYPE_BLUETOOTH:\n            connectionType = CONNECTION_TYPE_BLUETOOTH;\n            break;\n          case ConnectivityManager.TYPE_ETHERNET:\n            connectionType = CONNECTION_TYPE_ETHERNET;\n            break;\n          case ConnectivityManager.TYPE_MOBILE:\n          case ConnectivityManager.TYPE_MOBILE_DUN:\n            connectionType = CONNECTION_TYPE_CELLULAR;\n            effectiveConnectionType = getEffectiveConnectionType(networkInfo);\n            break;\n          case ConnectivityManager.TYPE_WIFI:\n            connectionType = CONNECTION_TYPE_WIFI;\n            break;\n          case ConnectivityManager.TYPE_WIMAX:\n            connectionType = CONNECTION_TYPE_WIMAX;\n            break;\n          default:\n            connectionType = CONNECTION_TYPE_UNKNOWN;\n            break;\n        }\n      }\n    } catch (SecurityException e) {\n      mNoNetworkPermission = true;\n      connectionType = CONNECTION_TYPE_UNKNOWN;\n    }\n\n    String currentConnectivity = getCurrentConnectionType();\n    // It is possible to get multiple broadcasts for the same connectivity change, so we only\n    // update and send an event when the connectivity has indeed changed.\n    if (!connectionType.equalsIgnoreCase(mConnectionType) ||\n        !effectiveConnectionType.equalsIgnoreCase(mEffectiveConnectionType) ||\n        !currentConnectivity.equalsIgnoreCase(mConnectivityDeprecated)) {\n      mConnectionType = connectionType;\n      mEffectiveConnectionType = effectiveConnectionType;\n      mConnectivityDeprecated = currentConnectivity;\n      sendConnectivityChangedEvent();\n    }\n  }\n\n  private String getCurrentConnectionType() {\n    try {\n      NetworkInfo networkInfo = mConnectivityManager.getActiveNetworkInfo();\n      if (networkInfo == null || !networkInfo.isConnected()) {\n        return CONNECTION_TYPE_NONE_DEPRECATED;\n      } else if (ConnectivityManager.isNetworkTypeValid(networkInfo.getType())) {\n        return networkInfo.getTypeName().toUpperCase();\n      } else {\n        return CONNECTION_TYPE_UNKNOWN_DEPRECATED;\n      }\n    } catch (SecurityException e) {\n      mNoNetworkPermission = true;\n      return CONNECTION_TYPE_UNKNOWN_DEPRECATED;\n    }\n  }\n\n  private String getEffectiveConnectionType(NetworkInfo networkInfo) {\n    switch (networkInfo.getSubtype()) {\n      case TelephonyManager.NETWORK_TYPE_1xRTT:\n      case TelephonyManager.NETWORK_TYPE_CDMA:\n      case TelephonyManager.NETWORK_TYPE_EDGE:\n      case TelephonyManager.NETWORK_TYPE_GPRS:\n      case TelephonyManager.NETWORK_TYPE_IDEN:\n        return EFFECTIVE_CONNECTION_TYPE_2G;\n      case TelephonyManager.NETWORK_TYPE_EHRPD:\n      case TelephonyManager.NETWORK_TYPE_EVDO_0:\n      case TelephonyManager.NETWORK_TYPE_EVDO_A:\n      case TelephonyManager.NETWORK_TYPE_EVDO_B:\n      case TelephonyManager.NETWORK_TYPE_HSDPA:\n      case TelephonyManager.NETWORK_TYPE_HSPA:\n      case TelephonyManager.NETWORK_TYPE_HSUPA:\n      case TelephonyManager.NETWORK_TYPE_UMTS:\n        return EFFECTIVE_CONNECTION_TYPE_3G;\n      case TelephonyManager.NETWORK_TYPE_HSPAP:\n      case TelephonyManager.NETWORK_TYPE_LTE:\n        return EFFECTIVE_CONNECTION_TYPE_4G;\n      case TelephonyManager.NETWORK_TYPE_UNKNOWN:\n      default:\n        return EFFECTIVE_CONNECTION_TYPE_UNKNOWN;\n    }\n  }\n\n  private void sendConnectivityChangedEvent() {\n    getReactApplicationContext().getJSModule(RCTDeviceEventEmitter.class)\n        .emit(\"networkStatusDidChange\", createConnectivityEventMap());\n  }\n\n  private WritableMap createConnectivityEventMap() {\n    WritableMap event = new WritableNativeMap();\n    event.putString(\"network_info\", mConnectivityDeprecated);\n    event.putString(\"connectionType\", mConnectionType);\n    event.putString(\"effectiveConnectionType\", mEffectiveConnectionType);\n    return event;\n  }\n\n  /**\n   * Class that receives intents whenever the connection type changes.\n   * NB: It is possible on some devices to receive certain connection type changes multiple times.\n   */\n  private class ConnectivityBroadcastReceiver extends BroadcastReceiver {\n\n    //TODO: Remove registered check when source of crash is found. t9846865\n    private boolean isRegistered = false;\n\n    public void setRegistered(boolean registered) {\n      isRegistered = registered;\n    }\n\n    public boolean isRegistered() {\n      return isRegistered;\n    }\n\n    @Override\n    public void onReceive(Context context, Intent intent) {\n      if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {\n        updateAndSendConnectionType();\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"network\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3-urlconnection\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/common/network:network\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/CookieJarContainer.java",
    "content": "package com.facebook.react.modules.network;\n\nimport okhttp3.CookieJar;\n\npublic interface CookieJarContainer extends CookieJar {\n\n  void setCookieJar(CookieJar cookieJar);\n\n  void removeCookieJar();\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkInterceptorCreator.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.network;\n\nimport okhttp3.Interceptor;\n\n/**\n * Classes implementing this interface return a new {@link Interceptor} when the {@link #create}\n * method is called.\n */\npublic interface NetworkInterceptorCreator {\n  Interceptor create();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.network;\n\nimport javax.annotation.Nullable;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.Reader;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\nimport java.util.concurrent.TimeUnit;\n\nimport android.util.Base64;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.GuardedAsyncTask;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.common.network.OkHttpCallUtil;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;\n\nimport okhttp3.Call;\nimport okhttp3.Callback;\nimport okhttp3.CookieJar;\nimport okhttp3.Headers;\nimport okhttp3.Interceptor;\nimport okhttp3.JavaNetCookieJar;\nimport okhttp3.MediaType;\nimport okhttp3.MultipartBody;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\nimport okhttp3.ResponseBody;\nimport okio.ByteString;\n\n/**\n * Implements the XMLHttpRequest JavaScript interface.\n */\n@ReactModule(name = NetworkingModule.NAME)\npublic final class NetworkingModule extends ReactContextBaseJavaModule {\n\n  protected static final String NAME = \"Networking\";\n\n  private static final String CONTENT_ENCODING_HEADER_NAME = \"content-encoding\";\n  private static final String CONTENT_TYPE_HEADER_NAME = \"content-type\";\n  private static final String REQUEST_BODY_KEY_STRING = \"string\";\n  private static final String REQUEST_BODY_KEY_URI = \"uri\";\n  private static final String REQUEST_BODY_KEY_FORMDATA = \"formData\";\n  private static final String REQUEST_BODY_KEY_BASE64 = \"base64\";\n  private static final String USER_AGENT_HEADER_NAME = \"user-agent\";\n  private static final int CHUNK_TIMEOUT_NS = 100 * 1000000; // 100ms\n  private static final int MAX_CHUNK_SIZE_BETWEEN_FLUSHES = 8 * 1024; // 8K\n\n  private final OkHttpClient mClient;\n  private final ForwardingCookieHandler mCookieHandler;\n  private final @Nullable String mDefaultUserAgent;\n  private final CookieJarContainer mCookieJarContainer;\n  private final Set<Integer> mRequestIds;\n  private boolean mShuttingDown;\n\n  /* package */ NetworkingModule(\n      ReactApplicationContext reactContext,\n      @Nullable String defaultUserAgent,\n      OkHttpClient client,\n      @Nullable List<NetworkInterceptorCreator> networkInterceptorCreators) {\n    super(reactContext);\n\n    if (networkInterceptorCreators != null) {\n      OkHttpClient.Builder clientBuilder = client.newBuilder();\n      for (NetworkInterceptorCreator networkInterceptorCreator : networkInterceptorCreators) {\n        clientBuilder.addNetworkInterceptor(networkInterceptorCreator.create());\n      }\n      client = clientBuilder.build();\n    }\n    mClient = client;\n    mCookieHandler = new ForwardingCookieHandler(reactContext);\n    mCookieJarContainer = (CookieJarContainer) mClient.cookieJar();\n    mShuttingDown = false;\n    mDefaultUserAgent = defaultUserAgent;\n    mRequestIds = new HashSet<>();\n  }\n\n  /**\n   * @param context the ReactContext of the application\n   * @param defaultUserAgent the User-Agent header that will be set for all requests where the\n   * caller does not provide one explicitly\n   * @param client the {@link OkHttpClient} to be used for networking\n   */\n  /* package */ NetworkingModule(\n    ReactApplicationContext context,\n    @Nullable String defaultUserAgent,\n    OkHttpClient client) {\n    this(context, defaultUserAgent, client, null);\n  }\n\n  /**\n   * @param context the ReactContext of the application\n   */\n  public NetworkingModule(final ReactApplicationContext context) {\n    this(context, null, OkHttpClientProvider.createClient(), null);\n  }\n\n  /**\n   * @param context the ReactContext of the application\n   * @param networkInterceptorCreators list of {@link NetworkInterceptorCreator}'s whose create()\n   * methods would be called to attach the interceptors to the client.\n   */\n  public NetworkingModule(\n    ReactApplicationContext context,\n    List<NetworkInterceptorCreator> networkInterceptorCreators) {\n    this(context, null, OkHttpClientProvider.createClient(), networkInterceptorCreators);\n  }\n\n  /**\n   * @param context the ReactContext of the application\n   * @param defaultUserAgent the User-Agent header that will be set for all requests where the\n   * caller does not provide one explicitly\n   */\n  public NetworkingModule(ReactApplicationContext context, String defaultUserAgent) {\n    this(context, defaultUserAgent, OkHttpClientProvider.createClient(), null);\n  }\n\n  @Override\n  public void initialize() {\n    mCookieJarContainer.setCookieJar(new JavaNetCookieJar(mCookieHandler));\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @Override\n  public void onCatalystInstanceDestroy() {\n    mShuttingDown = true;\n    cancelAllRequests();\n\n    mCookieHandler.destroy();\n    mCookieJarContainer.removeCookieJar();\n  }\n\n  @ReactMethod\n  /**\n   * @param timeout value of 0 results in no timeout\n   */\n  public void sendRequest(\n      String method,\n      String url,\n      final int requestId,\n      ReadableArray headers,\n      ReadableMap data,\n      final String responseType,\n      final boolean useIncrementalUpdates,\n      int timeout,\n      boolean withCredentials) {\n    Request.Builder requestBuilder = new Request.Builder().url(url);\n\n    if (requestId != 0) {\n      requestBuilder.tag(requestId);\n    }\n\n    final RCTDeviceEventEmitter eventEmitter = getEventEmitter();\n    OkHttpClient.Builder clientBuilder = mClient.newBuilder();\n\n    if (!withCredentials) {\n      clientBuilder.cookieJar(CookieJar.NO_COOKIES);\n    }\n\n    // If JS is listening for progress updates, install a ProgressResponseBody that intercepts the\n    // response and counts bytes received.\n    if (useIncrementalUpdates) {\n      clientBuilder.addNetworkInterceptor(new Interceptor() {\n        @Override\n        public Response intercept(Interceptor.Chain chain) throws IOException {\n          Response originalResponse = chain.proceed(chain.request());\n          ProgressResponseBody responseBody = new ProgressResponseBody(\n            originalResponse.body(),\n            new ProgressListener() {\n              long last = System.nanoTime();\n\n              @Override\n              public void onProgress(long bytesWritten, long contentLength, boolean done) {\n                long now = System.nanoTime();\n                if (!done && !shouldDispatch(now, last)) {\n                  return;\n                }\n                if (responseType.equals(\"text\")) {\n                  // For 'text' responses we continuously send response data with progress info to\n                  // JS below, so no need to do anything here.\n                  return;\n                }\n                ResponseUtil.onDataReceivedProgress(\n                  eventEmitter,\n                  requestId,\n                  bytesWritten,\n                  contentLength);\n                last = now;\n              }\n            });\n          return originalResponse.newBuilder().body(responseBody).build();\n        }\n      });\n    }\n\n    // If the current timeout does not equal the passed in timeout, we need to clone the existing\n    // client and set the timeout explicitly on the clone.  This is cheap as everything else is\n    // shared under the hood.\n    // See https://github.com/square/okhttp/wiki/Recipes#per-call-configuration for more information\n    if (timeout != mClient.connectTimeoutMillis()) {\n      clientBuilder.readTimeout(timeout, TimeUnit.MILLISECONDS);\n    }\n    OkHttpClient client = clientBuilder.build();\n\n    Headers requestHeaders = extractHeaders(headers, data);\n    if (requestHeaders == null) {\n      ResponseUtil.onRequestError(eventEmitter, requestId, \"Unrecognized headers format\", null);\n      return;\n    }\n    String contentType = requestHeaders.get(CONTENT_TYPE_HEADER_NAME);\n    String contentEncoding = requestHeaders.get(CONTENT_ENCODING_HEADER_NAME);\n    requestBuilder.headers(requestHeaders);\n\n    if (data == null) {\n      requestBuilder.method(method, RequestBodyUtil.getEmptyBody(method));\n    } else if (data.hasKey(REQUEST_BODY_KEY_STRING)) {\n      if (contentType == null) {\n        ResponseUtil.onRequestError(\n          eventEmitter,\n          requestId,\n          \"Payload is set but no content-type header specified\",\n          null);\n        return;\n      }\n      String body = data.getString(REQUEST_BODY_KEY_STRING);\n      MediaType contentMediaType = MediaType.parse(contentType);\n      if (RequestBodyUtil.isGzipEncoding(contentEncoding)) {\n        RequestBody requestBody = RequestBodyUtil.createGzip(contentMediaType, body);\n        if (requestBody == null) {\n          ResponseUtil.onRequestError(eventEmitter, requestId, \"Failed to gzip request body\", null);\n          return;\n        }\n        requestBuilder.method(method, requestBody);\n      } else {\n        requestBuilder.method(method, RequestBody.create(contentMediaType, body));\n      }\n    } else if (data.hasKey(REQUEST_BODY_KEY_BASE64)) {\n      if (contentType == null) {\n        ResponseUtil.onRequestError(\n          eventEmitter,\n          requestId,\n          \"Payload is set but no content-type header specified\",\n          null);\n        return;\n      }\n      String base64String = data.getString(REQUEST_BODY_KEY_BASE64);\n      MediaType contentMediaType = MediaType.parse(contentType);\n      requestBuilder.method(\n        method,\n        RequestBody.create(contentMediaType, ByteString.decodeBase64(base64String)));\n    } else if (data.hasKey(REQUEST_BODY_KEY_URI)) {\n      if (contentType == null) {\n        ResponseUtil.onRequestError(\n          eventEmitter,\n          requestId,\n          \"Payload is set but no content-type header specified\",\n          null);\n        return;\n      }\n      String uri = data.getString(REQUEST_BODY_KEY_URI);\n      InputStream fileInputStream =\n          RequestBodyUtil.getFileInputStream(getReactApplicationContext(), uri);\n      if (fileInputStream == null) {\n        ResponseUtil.onRequestError(\n          eventEmitter,\n          requestId,\n          \"Could not retrieve file for uri \" + uri,\n          null);\n        return;\n      }\n      requestBuilder.method(\n          method,\n          RequestBodyUtil.create(MediaType.parse(contentType), fileInputStream));\n    } else if (data.hasKey(REQUEST_BODY_KEY_FORMDATA)) {\n      if (contentType == null) {\n        contentType = \"multipart/form-data\";\n      }\n      ReadableArray parts = data.getArray(REQUEST_BODY_KEY_FORMDATA);\n      MultipartBody.Builder multipartBuilder =\n          constructMultipartBody(parts, contentType, requestId);\n      if (multipartBuilder == null) {\n        return;\n      }\n\n      requestBuilder.method(\n        method,\n        RequestBodyUtil.createProgressRequest(\n          multipartBuilder.build(),\n          new ProgressListener() {\n        long last = System.nanoTime();\n\n        @Override\n        public void onProgress(long bytesWritten, long contentLength, boolean done) {\n          long now = System.nanoTime();\n          if (done || shouldDispatch(now, last)) {\n            ResponseUtil.onDataSend(eventEmitter, requestId, bytesWritten, contentLength);\n            last = now;\n          }\n        }\n      }));\n    } else {\n      // Nothing in data payload, at least nothing we could understand anyway.\n      requestBuilder.method(method, RequestBodyUtil.getEmptyBody(method));\n    }\n\n    addRequest(requestId);\n    client.newCall(requestBuilder.build()).enqueue(\n        new Callback() {\n          @Override\n          public void onFailure(Call call, IOException e) {\n            if (mShuttingDown) {\n              return;\n            }\n            removeRequest(requestId);\n            String errorMessage = e.getMessage() != null\n                    ? e.getMessage()\n                    : \"Error while executing request: \" + e.getClass().getSimpleName();\n            ResponseUtil.onRequestError(eventEmitter, requestId, errorMessage, e);\n          }\n\n          @Override\n          public void onResponse(Call call, Response response) throws IOException {\n            if (mShuttingDown) {\n              return;\n            }\n            removeRequest(requestId);\n            // Before we touch the body send headers to JS\n            ResponseUtil.onResponseReceived(\n              eventEmitter,\n              requestId,\n              response.code(),\n              translateHeaders(response.headers()),\n              response.request().url().toString());\n\n            ResponseBody responseBody = response.body();\n            try {\n              // If JS wants progress updates during the download, and it requested a text response,\n              // periodically send response data updates to JS.\n              if (useIncrementalUpdates && responseType.equals(\"text\")) {\n                readWithProgress(eventEmitter, requestId, responseBody);\n                ResponseUtil.onRequestSuccess(eventEmitter, requestId);\n                return;\n              }\n\n              // Otherwise send the data in one big chunk, in the format that JS requested.\n              String responseString = \"\";\n              if (responseType.equals(\"text\")) {\n                try {\n                  responseString = responseBody.string();\n                } catch (IOException e) {\n                  if (response.request().method().equalsIgnoreCase(\"HEAD\")) {\n                    // The request is an `HEAD` and the body is empty,\n                    // the OkHttp will produce an exception.\n                    // Ignore the exception to not invalidate the request in the\n                    // Javascript layer.\n                    // Introduced to fix issue #7463.\n                  } else {\n                    ResponseUtil.onRequestError(eventEmitter, requestId, e.getMessage(), e);\n                  }\n                }\n              } else if (responseType.equals(\"base64\")) {\n                responseString = Base64.encodeToString(responseBody.bytes(), Base64.NO_WRAP);\n              }\n              ResponseUtil.onDataReceived(eventEmitter, requestId, responseString);\n              ResponseUtil.onRequestSuccess(eventEmitter, requestId);\n            } catch (IOException e) {\n              ResponseUtil.onRequestError(eventEmitter, requestId, e.getMessage(), e);\n            }\n          }\n        });\n  }\n\n  private void readWithProgress(\n      RCTDeviceEventEmitter eventEmitter,\n      int requestId,\n      ResponseBody responseBody) throws IOException {\n    long totalBytesRead = -1;\n    long contentLength = -1;\n    try {\n      ProgressResponseBody progressResponseBody = (ProgressResponseBody) responseBody;\n      totalBytesRead = progressResponseBody.totalBytesRead();\n      contentLength = progressResponseBody.contentLength();\n    } catch (ClassCastException e) {\n      // Ignore\n    }\n\n    Reader reader = responseBody.charStream();\n    try {\n      char[] buffer = new char[MAX_CHUNK_SIZE_BETWEEN_FLUSHES];\n      int read;\n      while ((read = reader.read(buffer)) != -1) {\n        ResponseUtil.onIncrementalDataReceived(\n          eventEmitter,\n          requestId,\n          new String(buffer, 0, read),\n          totalBytesRead,\n          contentLength);\n      }\n    } finally {\n      reader.close();\n    }\n  }\n\n  private static boolean shouldDispatch(long now, long last) {\n    return last + CHUNK_TIMEOUT_NS < now;\n  }\n\n  private synchronized void addRequest(int requestId) {\n    mRequestIds.add(requestId);\n  }\n\n  private synchronized void removeRequest(int requestId) {\n    mRequestIds.remove(requestId);\n  }\n\n  private synchronized void cancelAllRequests() {\n    for (Integer requestId : mRequestIds) {\n      cancelRequest(requestId);\n    }\n    mRequestIds.clear();\n  }\n\n  private static WritableMap translateHeaders(Headers headers) {\n    WritableMap responseHeaders = Arguments.createMap();\n    for (int i = 0; i < headers.size(); i++) {\n      String headerName = headers.name(i);\n      // multiple values for the same header\n      if (responseHeaders.hasKey(headerName)) {\n        responseHeaders.putString(\n            headerName,\n            responseHeaders.getString(headerName) + \", \" + headers.value(i));\n      } else {\n        responseHeaders.putString(headerName, headers.value(i));\n      }\n    }\n    return responseHeaders;\n  }\n\n  @ReactMethod\n  public void abortRequest(final int requestId) {\n    cancelRequest(requestId);\n    removeRequest(requestId);\n  }\n\n  private void cancelRequest(final int requestId) {\n    // We have to use AsyncTask since this might trigger a NetworkOnMainThreadException, this is an\n    // open issue on OkHttp: https://github.com/square/okhttp/issues/869\n    new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {\n      @Override\n      protected void doInBackgroundGuarded(Void... params) {\n        OkHttpCallUtil.cancelTag(mClient, Integer.valueOf(requestId));\n      }\n    }.execute();\n  }\n\n  @ReactMethod\n  public void clearCookies(com.facebook.react.bridge.Callback callback) {\n    mCookieHandler.clearCookies(callback);\n  }\n\n  private @Nullable MultipartBody.Builder constructMultipartBody(\n      ReadableArray body,\n      String contentType,\n      int requestId) {\n    RCTDeviceEventEmitter eventEmitter = getEventEmitter();\n    MultipartBody.Builder multipartBuilder = new MultipartBody.Builder();\n    multipartBuilder.setType(MediaType.parse(contentType));\n\n    for (int i = 0, size = body.size(); i < size; i++) {\n      ReadableMap bodyPart = body.getMap(i);\n\n      // Determine part's content type.\n      ReadableArray headersArray = bodyPart.getArray(\"headers\");\n      Headers headers = extractHeaders(headersArray, null);\n      if (headers == null) {\n        ResponseUtil.onRequestError(\n          eventEmitter,\n          requestId,\n          \"Missing or invalid header format for FormData part.\",\n          null);\n        return null;\n      }\n      MediaType partContentType = null;\n      String partContentTypeStr = headers.get(CONTENT_TYPE_HEADER_NAME);\n      if (partContentTypeStr != null) {\n        partContentType = MediaType.parse(partContentTypeStr);\n        // Remove the content-type header because MultipartBuilder gets it explicitly as an\n        // argument and doesn't expect it in the headers array.\n        headers = headers.newBuilder().removeAll(CONTENT_TYPE_HEADER_NAME).build();\n      }\n\n      if (bodyPart.hasKey(REQUEST_BODY_KEY_STRING)) {\n        String bodyValue = bodyPart.getString(REQUEST_BODY_KEY_STRING);\n        multipartBuilder.addPart(headers, RequestBody.create(partContentType, bodyValue));\n      } else if (bodyPart.hasKey(REQUEST_BODY_KEY_URI)) {\n        if (partContentType == null) {\n          ResponseUtil.onRequestError(\n            eventEmitter,\n            requestId,\n            \"Binary FormData part needs a content-type header.\",\n            null);\n          return null;\n        }\n        String fileContentUriStr = bodyPart.getString(REQUEST_BODY_KEY_URI);\n        InputStream fileInputStream =\n            RequestBodyUtil.getFileInputStream(getReactApplicationContext(), fileContentUriStr);\n        if (fileInputStream == null) {\n          ResponseUtil.onRequestError(\n            eventEmitter,\n            requestId,\n            \"Could not retrieve file for uri \" + fileContentUriStr,\n            null);\n          return null;\n        }\n        multipartBuilder.addPart(headers, RequestBodyUtil.create(partContentType, fileInputStream));\n      } else {\n        ResponseUtil.onRequestError(eventEmitter, requestId, \"Unrecognized FormData part.\", null);\n      }\n    }\n    return multipartBuilder;\n  }\n\n  /**\n   * Extracts the headers from the Array. If the format is invalid, this method will return null.\n   */\n  private @Nullable Headers extractHeaders(\n      @Nullable ReadableArray headersArray,\n      @Nullable ReadableMap requestData) {\n    if (headersArray == null) {\n      return null;\n    }\n    Headers.Builder headersBuilder = new Headers.Builder();\n    for (int headersIdx = 0, size = headersArray.size(); headersIdx < size; headersIdx++) {\n      ReadableArray header = headersArray.getArray(headersIdx);\n      if (header == null || header.size() != 2) {\n        return null;\n      }\n      String headerName = header.getString(0);\n      String headerValue = header.getString(1);\n      if (headerName == null || headerValue == null) {\n        return null;\n      }\n      headersBuilder.add(headerName, headerValue);\n    }\n    if (headersBuilder.get(USER_AGENT_HEADER_NAME) == null && mDefaultUserAgent != null) {\n      headersBuilder.add(USER_AGENT_HEADER_NAME, mDefaultUserAgent);\n    }\n\n    // Sanitize content encoding header, supported only when request specify payload as string\n    boolean isGzipSupported = requestData != null && requestData.hasKey(REQUEST_BODY_KEY_STRING);\n    if (!isGzipSupported) {\n      headersBuilder.removeAll(CONTENT_ENCODING_HEADER_NAME);\n    }\n\n    return headersBuilder.build();\n  }\n\n  private RCTDeviceEventEmitter getEventEmitter() {\n    return getReactApplicationContext().getJSModule(RCTDeviceEventEmitter.class);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpClientProvider.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.network;\n\nimport android.os.Build;\n\nimport com.facebook.common.logging.FLog;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.TimeUnit;\n\nimport javax.annotation.Nullable;\n\nimport okhttp3.ConnectionSpec;\nimport okhttp3.OkHttpClient;\nimport okhttp3.TlsVersion;\n\n/**\n * Helper class that provides the same OkHttpClient instance that will be used for all networking\n * requests.\n */\npublic class OkHttpClientProvider {\n\n  // Centralized OkHttpClient for all networking requests.\n  private static @Nullable OkHttpClient sClient;\n\n  public static OkHttpClient getOkHttpClient() {\n    if (sClient == null) {\n      sClient = createClient();\n    }\n    return sClient;\n  }\n  \n  // okhttp3 OkHttpClient is immutable\n  // This allows app to init an OkHttpClient with custom settings.\n  public static void replaceOkHttpClient(OkHttpClient client) {\n    sClient = client;\n  }\n\n  public static OkHttpClient createClient() {\n    // No timeouts by default\n    OkHttpClient.Builder client = new OkHttpClient.Builder()\n      .connectTimeout(0, TimeUnit.MILLISECONDS)\n      .readTimeout(0, TimeUnit.MILLISECONDS)\n      .writeTimeout(0, TimeUnit.MILLISECONDS)\n      .cookieJar(new ReactCookieJarContainer());\n\n    return enableTls12OnPreLollipop(client).build();\n  }\n\n  /*\n    On Android 4.1-4.4 (API level 16 to 19) TLS 1.1 and 1.2 are\n    available but not enabled by default. The following method\n    enables it.\n   */\n  public static OkHttpClient.Builder enableTls12OnPreLollipop(OkHttpClient.Builder client) {\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {\n      try {\n        client.sslSocketFactory(new TLSSocketFactory());\n\n        ConnectionSpec cs = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)\n                .tlsVersions(TlsVersion.TLS_1_2)\n                .build();\n\n        List<ConnectionSpec> specs = new ArrayList<>();\n        specs.add(cs);\n        specs.add(ConnectionSpec.COMPATIBLE_TLS);\n        specs.add(ConnectionSpec.CLEARTEXT);\n\n        client.connectionSpecs(specs);\n      } catch (Exception exc) {\n        FLog.e(\"OkHttpClientProvider\", \"Error while enabling TLS 1.2\", exc);\n      }\n    }\n\n    return client;\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressListener.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.network;\n\npublic interface ProgressListener {\n    void onProgress(long bytesWritten, long contentLength, boolean done);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressRequestBody.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.network;\n\nimport java.io.IOException;\nimport okhttp3.MediaType;\nimport okhttp3.RequestBody;\nimport okio.BufferedSink;\nimport okio.Buffer;\nimport okio.Sink;\nimport okio.ForwardingSink;\nimport okio.Okio;\n\npublic class ProgressRequestBody extends RequestBody {\n\n  private final RequestBody mRequestBody;\n  private final ProgressListener mProgressListener;\n  private BufferedSink mBufferedSink;\n\n  public ProgressRequestBody(RequestBody requestBody, ProgressListener progressListener) {\n      mRequestBody = requestBody;\n      mProgressListener = progressListener;\n  }\n\n  @Override\n  public MediaType contentType() {\n      return mRequestBody.contentType();\n  }\n\n  @Override\n  public long contentLength() throws IOException {\n      return mRequestBody.contentLength();\n  }\n\n  @Override\n  public void writeTo(BufferedSink sink) throws IOException {\n      if (mBufferedSink == null) {\n          mBufferedSink = Okio.buffer(sink(sink));\n      }\n      mRequestBody.writeTo(mBufferedSink);\n      mBufferedSink.flush();\n  }\n\n  private Sink sink(Sink sink) {\n      return new ForwardingSink(sink) {\n          long bytesWritten = 0L;\n          long contentLength = 0L;\n\n          @Override\n          public void write(Buffer source, long byteCount) throws IOException {\n              super.write(source, byteCount);\n              if (contentLength == 0) {\n                  contentLength = contentLength();\n              }\n              bytesWritten += byteCount;\n              mProgressListener.onProgress(\n                bytesWritten, contentLength, bytesWritten == contentLength);\n          }\n      };\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressResponseBody.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.modules.network;\n\nimport java.io.IOException;\nimport javax.annotation.Nullable;\n\nimport okhttp3.MediaType;\nimport okhttp3.ResponseBody;\nimport okio.Buffer;\nimport okio.BufferedSource;\nimport okio.ForwardingSource;\nimport okio.Okio;\nimport okio.Source;\n\npublic class ProgressResponseBody extends ResponseBody {\n\n    private final ResponseBody mResponseBody;\n    private final ProgressListener mProgressListener;\n    private @Nullable BufferedSource mBufferedSource;\n    private long mTotalBytesRead;\n\n    public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) {\n        this.mResponseBody = responseBody;\n        this.mProgressListener = progressListener;\n        mTotalBytesRead = 0L;\n    }\n\n    @Override\n    public MediaType contentType() {\n        return mResponseBody.contentType();\n    }\n\n    @Override\n    public long contentLength() {\n        return mResponseBody.contentLength();\n    }\n\n    public long totalBytesRead() {\n        return mTotalBytesRead;\n    }\n\n    @Override public BufferedSource source() {\n        if (mBufferedSource == null) {\n            mBufferedSource = Okio.buffer(source(mResponseBody.source()));\n        }\n        return mBufferedSource;\n    }\n\n    private Source source(Source source) {\n        return new ForwardingSource(source) {\n            @Override public long read(Buffer sink, long byteCount) throws IOException {\n                long bytesRead = super.read(sink, byteCount);\n                // read() returns the number of bytes read, or -1 if this source is exhausted.\n                mTotalBytesRead += bytesRead != -1 ? bytesRead : 0;\n                mProgressListener.onProgress(\n                    mTotalBytesRead, mResponseBody.contentLength(), bytesRead == -1);\n                return bytesRead;\n            }\n        };\n    }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/ReactCookieJarContainer.java",
    "content": "package com.facebook.react.modules.network;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport javax.annotation.Nullable;\n\nimport okhttp3.Cookie;\nimport okhttp3.CookieJar;\nimport okhttp3.HttpUrl;\n\n/**\n * Basic okhttp3 CookieJar container \n */ \npublic class ReactCookieJarContainer implements CookieJarContainer {\n\n  @Nullable\n  private CookieJar cookieJar = null;\n\n  @Override\n  public void setCookieJar(CookieJar cookieJar) {\n    this.cookieJar = cookieJar;\n  }\n\n  @Override\n  public void removeCookieJar() {\n    this.cookieJar = null;\n  }\n\n  @Override\n  public void saveFromResponse(HttpUrl url, List<Cookie> cookies) {\n    if (cookieJar != null) {\n      cookieJar.saveFromResponse(url, cookies);\n    }\n  }\n\n  @Override\n  public List<Cookie> loadForRequest(HttpUrl url) {\n    if (cookieJar != null) {\n      return cookieJar.loadForRequest(url);\n    }\n    return Collections.emptyList();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/RequestBodyUtil.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.network;\n\nimport android.content.Context;\nimport android.net.Uri;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.common.ReactConstants;\nimport java.io.ByteArrayOutputStream;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.net.URL;\nimport java.nio.channels.Channels;\nimport java.nio.channels.ReadableByteChannel;\nimport java.util.zip.GZIPOutputStream;\nimport javax.annotation.Nullable;\nimport okhttp3.MediaType;\nimport okhttp3.RequestBody;\nimport okhttp3.internal.Util;\nimport okio.BufferedSink;\nimport okio.ByteString;\nimport okio.Okio;\nimport okio.Source;\n\n/**\n * Helper class that provides the necessary methods for creating the RequestBody from a file\n * specification, such as a contentUri.\n */\n/*package*/ class RequestBodyUtil {\n\n  private static final String CONTENT_ENCODING_GZIP = \"gzip\";\n  private static final String NAME = \"RequestBodyUtil\";\n  private static final String TEMP_FILE_SUFFIX = \"temp\";\n\n  /**\n   * Returns whether encode type indicates the body needs to be gzip-ed.\n   */\n  public static boolean isGzipEncoding(@Nullable final String encodingType) {\n    return CONTENT_ENCODING_GZIP.equalsIgnoreCase(encodingType);\n  }\n\n  /**\n   * Returns the input stream for a file given by its contentUri. Returns null if the file has not\n   * been found or if an error as occurred.\n   */\n  public static @Nullable InputStream getFileInputStream(\n      Context context,\n      String fileContentUriStr) {\n    try {\n      Uri fileContentUri = Uri.parse(fileContentUriStr);\n\n      if (fileContentUri.getScheme().startsWith(\"http\")) {\n        return getDownloadFileInputStream(context, fileContentUri);\n      }\n      return context.getContentResolver().openInputStream(fileContentUri);\n    } catch (Exception e) {\n      FLog.e(\n          ReactConstants.TAG,\n          \"Could not retrieve file for contentUri \" + fileContentUriStr,\n          e);\n      return null;\n    }\n  }\n\n  /**\n   * Download and cache a file locally. This should be used when document picker returns a URI that\n   * points to a file on the network. Returns input stream for the downloaded file.\n   */\n  private static InputStream getDownloadFileInputStream(Context context, Uri uri)\n      throws IOException {\n    final File outputDir = context.getApplicationContext().getCacheDir();\n    final File file = File.createTempFile(NAME, TEMP_FILE_SUFFIX, outputDir);\n    file.deleteOnExit();\n\n    final URL url = new URL(uri.toString());\n    final InputStream is = url.openStream();\n    try {\n      final ReadableByteChannel channel = Channels.newChannel(is);\n      try {\n        final FileOutputStream stream = new FileOutputStream(file);\n        try {\n          stream.getChannel().transferFrom(channel, 0, Long.MAX_VALUE);\n          return new FileInputStream(file);\n        } finally {\n          stream.close();\n        }\n      } finally {\n        channel.close();\n      }\n    } finally {\n      is.close();\n    }\n  }\n\n  /** Creates a RequestBody from a mediaType and gzip-ed body string */\n  public static @Nullable RequestBody createGzip(final MediaType mediaType, final String body) {\n    ByteArrayOutputStream gzipByteArrayOutputStream = new ByteArrayOutputStream();\n    try {\n      OutputStream gzipOutputStream = new GZIPOutputStream(gzipByteArrayOutputStream);\n      gzipOutputStream.write(body.getBytes());\n      gzipOutputStream.close();\n    } catch (IOException e) {\n      return null;\n    }\n    return RequestBody.create(mediaType, gzipByteArrayOutputStream.toByteArray());\n  }\n\n  /**\n   * Creates a RequestBody from a mediaType and inputStream given.\n   */\n  public static RequestBody create(final MediaType mediaType, final InputStream inputStream) {\n    return new RequestBody() {\n      @Override\n      public MediaType contentType() {\n        return mediaType;\n      }\n\n      @Override\n      public long contentLength() {\n        try {\n          return inputStream.available();\n        } catch (IOException e) {\n          return 0;\n        }\n      }\n\n      @Override\n      public void writeTo(BufferedSink sink) throws IOException {\n        Source source = null;\n        try {\n          source = Okio.source(inputStream);\n          sink.writeAll(source);\n        } finally {\n          Util.closeQuietly(source);\n        }\n      }\n    };\n  }\n\n  /**\n   * Creates a ProgressRequestBody that can be used for showing uploading progress\n   */\n  public static ProgressRequestBody createProgressRequest(\n      RequestBody requestBody,\n      ProgressListener listener) {\n    return new ProgressRequestBody(requestBody, listener);\n  }\n\n  /**\n   * Creates a empty RequestBody if required by the http method spec, otherwise use null\n   */\n  public static RequestBody getEmptyBody(String method) {\n    if (method.equals(\"POST\") || method.equals(\"PUT\") || method.equals(\"PATCH\")) {\n      return RequestBody.create(null, ByteString.EMPTY);\n    } else {\n      return null;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/ResponseUtil.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.network;\n\nimport java.io.IOException;\nimport java.net.SocketTimeoutException;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;\n\n/**\n * Util methods to send network responses to JS.\n */\npublic class ResponseUtil {\n  public static void onDataSend(\n    RCTDeviceEventEmitter eventEmitter,\n    int requestId,\n    long progress,\n    long total) {\n    WritableArray args = Arguments.createArray();\n    args.pushInt(requestId);\n    args.pushInt((int) progress);\n    args.pushInt((int) total);\n    eventEmitter.emit(\"didSendNetworkData\", args);\n  }\n\n  public static void onIncrementalDataReceived(\n    RCTDeviceEventEmitter eventEmitter,\n    int requestId,\n    String data,\n    long progress,\n    long total) {\n    WritableArray args = Arguments.createArray();\n    args.pushInt(requestId);\n    args.pushString(data);\n    args.pushInt((int) progress);\n    args.pushInt((int) total);\n\n    eventEmitter.emit(\"didReceiveNetworkIncrementalData\", args);\n  }\n\n  public static void onDataReceivedProgress(\n    RCTDeviceEventEmitter eventEmitter,\n    int requestId,\n    long progress,\n    long total) {\n    WritableArray args = Arguments.createArray();\n    args.pushInt(requestId);\n    args.pushInt((int) progress);\n    args.pushInt((int) total);\n\n    eventEmitter.emit(\"didReceiveNetworkDataProgress\", args);\n  }\n\n  public static void onDataReceived(\n    RCTDeviceEventEmitter eventEmitter,\n    int requestId,\n    String data) {\n    WritableArray args = Arguments.createArray();\n    args.pushInt(requestId);\n    args.pushString(data);\n\n    eventEmitter.emit(\"didReceiveNetworkData\", args);\n  }\n\n  public static void onRequestError(\n    RCTDeviceEventEmitter eventEmitter,\n    int requestId,\n    String error,\n    IOException e) {\n    WritableArray args = Arguments.createArray();\n    args.pushInt(requestId);\n    args.pushString(error);\n\n    if ((e != null) && (e.getClass() == SocketTimeoutException.class)) {\n      args.pushBoolean(true); // last argument is a time out boolean\n    }\n\n    eventEmitter.emit(\"didCompleteNetworkResponse\", args);\n  }\n\n  public static void onRequestSuccess(RCTDeviceEventEmitter eventEmitter, int requestId) {\n    WritableArray args = Arguments.createArray();\n    args.pushInt(requestId);\n    args.pushNull();\n\n    eventEmitter.emit(\"didCompleteNetworkResponse\", args);\n  }\n\n  public static void onResponseReceived(\n    RCTDeviceEventEmitter eventEmitter,\n    int requestId,\n    int statusCode,\n    WritableMap headers,\n    String url) {\n    WritableArray args = Arguments.createArray();\n    args.pushInt(requestId);\n    args.pushInt(statusCode);\n    args.pushMap(headers);\n    args.pushString(url);\n\n    eventEmitter.emit(\"didReceiveNetworkResponse\", args);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/network/TLSSocketFactory.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\npackage com.facebook.react.modules.network;\n\nimport java.io.IOException;\nimport java.net.InetAddress;\nimport java.net.Socket;\nimport java.net.UnknownHostException;\nimport java.security.KeyManagementException;\nimport java.security.NoSuchAlgorithmException;\n\nimport javax.net.ssl.SSLContext;\nimport javax.net.ssl.SSLSocket;\nimport javax.net.ssl.SSLSocketFactory;\n\n/**\n *\n * This class is needed for TLS 1.2 support on Android 4.x\n *\n * Source: http://blog.dev-area.net/2015/08/13/android-4-1-enable-tls-1-1-and-tls-1-2/\n */\npublic class TLSSocketFactory extends SSLSocketFactory {\n    private SSLSocketFactory delegate;\n\n    public TLSSocketFactory() throws KeyManagementException, NoSuchAlgorithmException {\n        SSLContext context = SSLContext.getInstance(\"TLS\");\n        context.init(null, null, null);\n        delegate = context.getSocketFactory();\n    }\n\n    @Override\n    public String[] getDefaultCipherSuites() {\n        return delegate.getDefaultCipherSuites();\n    }\n\n    @Override\n    public String[] getSupportedCipherSuites() {\n        return delegate.getSupportedCipherSuites();\n    }\n\n    @Override\n    public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException {\n        return enableTLSOnSocket(delegate.createSocket(s, host, port, autoClose));\n    }\n\n    @Override\n    public Socket createSocket(String host, int port) throws IOException, UnknownHostException {\n        return enableTLSOnSocket(delegate.createSocket(host, port));\n    }\n\n    @Override\n    public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException {\n        return enableTLSOnSocket(delegate.createSocket(host, port, localHost, localPort));\n    }\n\n    @Override\n    public Socket createSocket(InetAddress host, int port) throws IOException {\n        return enableTLSOnSocket(delegate.createSocket(host, port));\n    }\n\n    @Override\n    public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {\n        return enableTLSOnSocket(delegate.createSocket(address, port, localAddress, localPort));\n    }\n\n    private Socket enableTLSOnSocket(Socket socket) {\n        if(socket != null && (socket instanceof SSLSocket)) {\n            ((SSLSocket)socket).setEnabledProtocols(new String[] {\"TLSv1\", \"TLSv1.1\", \"TLSv1.2\"});\n        }\n        return socket;\n    }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/permissions/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"permissions\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.permissions;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.pm.PackageManager;\nimport android.os.Build;\nimport android.os.Process;\nimport android.util.SparseArray;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.Promise;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.core.PermissionAwareActivity;\nimport com.facebook.react.modules.core.PermissionListener;\nimport java.util.ArrayList;\n\n/**\n * Module that exposes the Android M Permission system to JS.\n */\n@ReactModule(name = \"PermissionsAndroid\")\npublic class PermissionsModule extends ReactContextBaseJavaModule implements PermissionListener {\n\n  private static final String ERROR_INVALID_ACTIVITY = \"E_INVALID_ACTIVITY\";\n  private final SparseArray<Callback> mCallbacks;\n  private int mRequestCode = 0;\n  private final String GRANTED = \"granted\";\n  private final String DENIED = \"denied\";\n  private final String NEVER_ASK_AGAIN = \"never_ask_again\";\n\n  public PermissionsModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n    mCallbacks = new SparseArray<Callback>();\n  }\n\n  @Override\n  public String getName() {\n    return \"PermissionsAndroid\";\n  }\n\n  /**\n   * Check if the app has the permission given. successCallback is called with true if the\n   * permission had been granted, false otherwise. See {@link Activity#checkSelfPermission}.\n   */\n  @ReactMethod\n  public void checkPermission(final String permission, final Promise promise) {\n    Context context = getReactApplicationContext().getBaseContext();\n    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n      promise.resolve(context.checkPermission(permission, Process.myPid(), Process.myUid()) ==\n        PackageManager.PERMISSION_GRANTED);\n      return;\n    }\n    promise.resolve(context.checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED);\n  }\n\n  /**\n   * Check whether the app should display a message explaining why a certain permission is needed.\n   * successCallback is called with true if the app should display a message, false otherwise.\n   * This message is only displayed if the user has revoked this permission once before, and if the\n   * permission dialog will be shown to the user (the user can choose to not be shown that dialog\n   * again). For devices before Android M, this always returns false.\n   * See {@link Activity#shouldShowRequestPermissionRationale}.\n   */\n  @ReactMethod\n  public void shouldShowRequestPermissionRationale(final String permission, final Promise promise) {\n    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n      promise.resolve(false);\n      return;\n    }\n    try {\n      promise.resolve(getPermissionAwareActivity().shouldShowRequestPermissionRationale(permission));\n    } catch (IllegalStateException e) {\n      promise.reject(ERROR_INVALID_ACTIVITY, e);\n    }\n  }\n\n  /**\n   * Request the given permission. successCallback is called with true if the permission had been\n   * granted, false otherwise. For devices before Android M, this instead checks if the user has\n   * the permission given or not.\n   * See {@link Activity#checkSelfPermission}.\n   */\n  @ReactMethod\n  public void requestPermission(final String permission, final Promise promise) {\n    Context context = getReactApplicationContext().getBaseContext();\n    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n      promise.resolve(context.checkPermission(permission, Process.myPid(), Process.myUid()) ==\n              PackageManager.PERMISSION_GRANTED);\n      return;\n    }\n    if (context.checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED) {\n      promise.resolve(GRANTED);\n      return;\n    }\n\n    try {\n      PermissionAwareActivity activity = getPermissionAwareActivity();\n\n      mCallbacks.put(\n        mRequestCode, new Callback() {\n          @Override\n          public void invoke(Object... args) {\n            int[] results = (int[]) args[0];\n            if (results.length > 0 && results[0] == PackageManager.PERMISSION_GRANTED) {\n              promise.resolve(GRANTED);\n            } else {\n              PermissionAwareActivity activity = (PermissionAwareActivity) args[1];\n              if (activity.shouldShowRequestPermissionRationale(permission)) {\n                promise.resolve(DENIED);\n              } else {\n                promise.resolve(NEVER_ASK_AGAIN);\n              }\n            }\n          }\n        }\n      );\n\n      activity.requestPermissions(new String[]{permission}, mRequestCode, this);\n      mRequestCode++;\n    } catch (IllegalStateException e) {\n      promise.reject(ERROR_INVALID_ACTIVITY, e);\n    }\n  }\n\n  @ReactMethod\n  public void requestMultiplePermissions(final ReadableArray permissions, final Promise promise) {\n    final WritableMap grantedPermissions = new WritableNativeMap();\n    final ArrayList<String> permissionsToCheck = new ArrayList<String>();\n    int checkedPermissionsCount = 0;\n\n    Context context = getReactApplicationContext().getBaseContext();\n\n    for (int i = 0; i < permissions.size(); i++) {\n      String perm = permissions.getString(i);\n\n      if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n        grantedPermissions.putString(perm, context.checkPermission(perm, Process.myPid(), Process.myUid()) ==\n        PackageManager.PERMISSION_GRANTED ? GRANTED : DENIED);\n        checkedPermissionsCount++;\n      } else if (context.checkSelfPermission(perm) == PackageManager.PERMISSION_GRANTED) {\n        grantedPermissions.putString(perm, GRANTED);\n        checkedPermissionsCount++;\n      } else {\n        permissionsToCheck.add(perm);\n      }\n    }\n    if (permissions.size() == checkedPermissionsCount) {\n      promise.resolve(grantedPermissions);\n      return;\n    }\n    try {\n\n      PermissionAwareActivity activity = getPermissionAwareActivity();\n\n      mCallbacks.put(\n      mRequestCode, new Callback() {\n        @Override\n        public void invoke(Object... args) {\n          int[] results = (int[]) args[0];\n          PermissionAwareActivity activity = (PermissionAwareActivity) args[1];\n          for (int j = 0; j < permissionsToCheck.size(); j++) {\n            String permission = permissionsToCheck.get(j);\n            if (results.length > 0 && results[j] == PackageManager.PERMISSION_GRANTED) {\n              grantedPermissions.putString(permission, GRANTED);\n            } else {\n              if (activity.shouldShowRequestPermissionRationale(permission)) {\n                grantedPermissions.putString(permission, DENIED);\n              } else {\n                grantedPermissions.putString(permission, NEVER_ASK_AGAIN);\n              }\n            }\n          }\n          promise.resolve(grantedPermissions);\n        }\n      });\n\n      activity.requestPermissions(permissionsToCheck.toArray(new String[0]), mRequestCode, this);\n      mRequestCode++;\n    } catch (IllegalStateException e) {\n      promise.reject(ERROR_INVALID_ACTIVITY, e);\n    }\n  }\n\n  /**\n   * Method called by the activity with the result of the permission request.\n   */\n  @Override\n  public boolean onRequestPermissionsResult(\n    int requestCode,\n    String[] permissions,\n    int[] grantResults) {\n      mCallbacks.get(requestCode).invoke(grantResults, getPermissionAwareActivity());\n      mCallbacks.remove(requestCode);\n      return mCallbacks.size() == 0;\n  }\n\n  private PermissionAwareActivity getPermissionAwareActivity() {\n    Activity activity = getCurrentActivity();\n    if (activity == null) {\n      throw new IllegalStateException(\"Tried to use permissions API while not attached to an \" +\n          \"Activity.\");\n    } else if (!(activity instanceof PermissionAwareActivity)) {\n      throw new IllegalStateException(\"Tried to use permissions API but the host Activity doesn't\" +\n          \" implement PermissionAwareActivity.\");\n    }\n    return (PermissionAwareActivity) activity;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/share/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"share\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/share/ShareModule.java",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.share;\n\nimport android.app.Activity;\nimport android.content.Intent;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Promise;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * Intent module. Launch other activities or open URLs.\n */\n@ReactModule(name = \"ShareModule\")\npublic class ShareModule extends ReactContextBaseJavaModule {\n\n  /* package */ static final String ACTION_SHARED = \"sharedAction\";\n  /* package */ static final String ERROR_INVALID_CONTENT = \"E_INVALID_CONTENT\";\n  /* package */ static final String ERROR_UNABLE_TO_OPEN_DIALOG = \"E_UNABLE_TO_OPEN_DIALOG\";\n\n  public ShareModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return \"ShareModule\";\n  }\n\n  /**\n   * Open a chooser dialog to send text content to other apps.\n   *\n   * Refer http://developer.android.com/intl/ko/training/sharing/send.html\n   *\n   * @param content the data to send\n   * @param dialogTitle the title of the chooser dialog\n   */\n  @ReactMethod\n  public void share(ReadableMap content, String dialogTitle, Promise promise) {\n    if (content == null) {\n      promise.reject(ERROR_INVALID_CONTENT, \"Content cannot be null\");\n      return;\n    }\n\n    try {\n      Intent intent = new Intent(Intent.ACTION_SEND);\n      intent.setTypeAndNormalize(\"text/plain\");\n\n      if (content.hasKey(\"title\")) {\n        intent.putExtra(Intent.EXTRA_SUBJECT, content.getString(\"title\"));\n      }\n\n      if (content.hasKey(\"message\")) {\n        intent.putExtra(Intent.EXTRA_TEXT, content.getString(\"message\"));\n      }\n\n      Intent chooser = Intent.createChooser(intent, dialogTitle);\n      chooser.addCategory(Intent.CATEGORY_DEFAULT);\n\n      Activity currentActivity = getCurrentActivity();\n      if (currentActivity != null) {\n        currentActivity.startActivity(chooser);\n      } else {\n        getReactApplicationContext().startActivity(chooser);\n      }\n      WritableMap result = Arguments.createMap();\n      result.putString(\"action\", ACTION_SHARED);\n      promise.resolve(result);\n    } catch (Exception e) {\n      promise.reject(ERROR_UNABLE_TO_OPEN_DIALOG, \"Failed to open share dialog\");\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"statusbar\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n * <p/>\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\npackage com.facebook.react.modules.statusbar;\n\nimport android.animation.ArgbEvaluator;\nimport android.animation.ValueAnimator;\nimport android.annotation.TargetApi;\nimport android.app.Activity;\nimport android.content.Context;\nimport android.os.Build;\nimport android.support.v4.view.ViewCompat;\nimport android.view.View;\nimport android.view.WindowInsets;\nimport android.view.WindowManager;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.GuardedRunnable;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.PixelUtil;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * {@link NativeModule} that allows changing the appearance of the status bar.\n */\n@ReactModule(name = \"StatusBarManager\")\npublic class StatusBarModule extends ReactContextBaseJavaModule {\n\n  private static final String HEIGHT_KEY = \"HEIGHT\";\n\n  public StatusBarModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return \"StatusBarManager\";\n  }\n\n  @Override\n  public @Nullable Map<String, Object> getConstants() {\n    final Context context = getReactApplicationContext();\n    final int heightResId = context.getResources()\n      .getIdentifier(\"status_bar_height\", \"dimen\", \"android\");\n    final float height = heightResId > 0 ?\n      PixelUtil.toDIPFromPixel(context.getResources().getDimensionPixelSize(heightResId)) :\n      0;\n\n    return MapBuilder.<String, Object>of(\n      HEIGHT_KEY, height);\n  }\n\n  @ReactMethod\n  public void setColor(final int color, final boolean animated) {\n    final Activity activity = getCurrentActivity();\n    if (activity == null) {\n      FLog.w(ReactConstants.TAG, \"StatusBarModule: Ignored status bar change, current activity is null.\");\n      return;\n    }\n\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n\n      UiThreadUtil.runOnUiThread(\n          new GuardedRunnable(getReactApplicationContext()) {\n            @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n            @Override\n            public void runGuarded() {\n              activity\n                  .getWindow()\n                  .addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n              if (animated) {\n                int curColor = activity.getWindow().getStatusBarColor();\n                ValueAnimator colorAnimation =\n                    ValueAnimator.ofObject(new ArgbEvaluator(), curColor, color);\n\n                colorAnimation.addUpdateListener(\n                    new ValueAnimator.AnimatorUpdateListener() {\n                      @Override\n                      public void onAnimationUpdate(ValueAnimator animator) {\n                        activity\n                            .getWindow()\n                            .setStatusBarColor((Integer) animator.getAnimatedValue());\n                      }\n                    });\n                colorAnimation.setDuration(300).setStartDelay(0);\n                colorAnimation.start();\n              } else {\n                activity.getWindow().setStatusBarColor(color);\n              }\n            }\n          });\n    }\n  }\n\n  @ReactMethod\n  public void setTranslucent(final boolean translucent) {\n    final Activity activity = getCurrentActivity();\n    if (activity == null) {\n      FLog.w(ReactConstants.TAG, \"StatusBarModule: Ignored status bar change, current activity is null.\");\n      return;\n    }\n\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n      UiThreadUtil.runOnUiThread(\n        new GuardedRunnable(getReactApplicationContext()) {\n          @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n          @Override\n          public void runGuarded() {\n            // If the status bar is translucent hook into the window insets calculations\n            // and consume all the top insets so no padding will be added under the status bar.\n            View decorView = activity.getWindow().getDecorView();\n            if (translucent) {\n              decorView.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {\n                @Override\n                public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {\n                  WindowInsets defaultInsets = v.onApplyWindowInsets(insets);\n                  return defaultInsets.replaceSystemWindowInsets(\n                    defaultInsets.getSystemWindowInsetLeft(),\n                    0,\n                    defaultInsets.getSystemWindowInsetRight(),\n                    defaultInsets.getSystemWindowInsetBottom());\n                }\n              });\n            } else {\n              decorView.setOnApplyWindowInsetsListener(null);\n            }\n\n            ViewCompat.requestApplyInsets(decorView);\n          }\n        });\n    }\n  }\n\n  @ReactMethod\n  public void setHidden(final boolean hidden) {\n    final Activity activity = getCurrentActivity();\n    if (activity == null) {\n      FLog.w(ReactConstants.TAG, \"StatusBarModule: Ignored status bar change, current activity is null.\");\n      return;\n    }\n    UiThreadUtil.runOnUiThread(\n      new Runnable() {\n        @Override\n        public void run() {\n          if (hidden) {\n            activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);\n            activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);\n          } else {\n            activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);\n            activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);\n          }\n        }\n      });\n  }\n\n  @ReactMethod\n  public void setStyle(final String style) {\n    final Activity activity = getCurrentActivity();\n    if (activity == null) {\n      FLog.w(ReactConstants.TAG, \"StatusBarModule: Ignored status bar change, current activity is null.\");\n      return;\n    }\n\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n      UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @TargetApi(Build.VERSION_CODES.M)\n          @Override\n          public void run() {\n            View decorView = activity.getWindow().getDecorView();\n            decorView.setSystemUiVisibility(\n              style.equals(\"dark-content\") ? View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR : 0);\n          }\n        }\n      );\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/storage/AsyncLocalStorageUtil.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.storage;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Arrays;\nimport java.util.Iterator;\n\nimport android.content.ContentValues;\nimport android.database.Cursor;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.text.TextUtils;\n\nimport com.facebook.react.bridge.ReadableArray;\n\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport static com.facebook.react.modules.storage.ReactDatabaseSupplier.KEY_COLUMN;\nimport static com.facebook.react.modules.storage.ReactDatabaseSupplier.TABLE_CATALYST;\nimport static com.facebook.react.modules.storage.ReactDatabaseSupplier.VALUE_COLUMN;\n\n/**\n * Helper for database operations.\n */\npublic class AsyncLocalStorageUtil {\n\n  /**\n   * Build the String required for an SQL select statement:\n   *  WHERE key IN (?, ?, ..., ?)\n   * without 'WHERE' and with selectionCount '?'\n   */\n  /* package */ static String buildKeySelection(int selectionCount) {\n    String[] list = new String[selectionCount];\n    Arrays.fill(list, \"?\");\n    return KEY_COLUMN + \" IN (\" + TextUtils.join(\", \", list) + \")\";\n  }\n\n  /**\n   * Build the String[] arguments needed for an SQL selection, i.e.:\n   *  {a, b, c}\n   * to be used in the SQL select statement: WHERE key in (?, ?, ?)\n   */\n  /* package */ static String[] buildKeySelectionArgs(ReadableArray keys, int start, int count) {\n    String[] selectionArgs = new String[count];\n    for (int keyIndex = 0; keyIndex < count; keyIndex++) {\n      selectionArgs[keyIndex] = keys.getString(start + keyIndex);\n    }\n    return selectionArgs;\n  }\n\n  /**\n   * Returns the value of the given key, or null if not found.\n   */\n  public static @Nullable String getItemImpl(SQLiteDatabase db, String key) {\n    String[] columns = {VALUE_COLUMN};\n    String[] selectionArgs = {key};\n\n    Cursor cursor = db.query(\n        TABLE_CATALYST,\n        columns,\n        KEY_COLUMN + \"=?\",\n        selectionArgs,\n        null,\n        null,\n        null);\n\n    try {\n      if (!cursor.moveToFirst()) {\n        return null;\n      } else {\n        return cursor.getString(0);\n      }\n    } finally {\n      cursor.close();\n    }\n  }\n\n  /**\n   * Sets the value for the key given, returns true if successful, false otherwise.\n   */\n  /* package */ static boolean setItemImpl(SQLiteDatabase db, String key, String value) {\n    ContentValues contentValues = new ContentValues();\n    contentValues.put(KEY_COLUMN, key);\n    contentValues.put(VALUE_COLUMN, value);\n\n    long inserted = db.insertWithOnConflict(\n        TABLE_CATALYST,\n        null,\n        contentValues,\n        SQLiteDatabase.CONFLICT_REPLACE);\n\n    return (-1 != inserted);\n  }\n\n  /**\n   * Does the actual merge of the (key, value) pair with the value stored in the database.\n   * NB: This assumes that a database lock is already in effect!\n   * @return the errorCode of the operation\n   */\n  /* package */ static boolean mergeImpl(SQLiteDatabase db, String key, String value)\n      throws JSONException {\n    String oldValue = getItemImpl(db, key);\n    String newValue;\n\n    if (oldValue == null) {\n      newValue = value;\n    } else {\n      JSONObject oldJSON = new JSONObject(oldValue);\n      JSONObject newJSON = new JSONObject(value);\n      deepMergeInto(oldJSON, newJSON);\n      newValue = oldJSON.toString();\n    }\n\n    return setItemImpl(db, key, newValue);\n  }\n\n  /**\n   * Merges two {@link JSONObject}s. The newJSON object will be merged with the oldJSON object by\n   * either overriding its values, or merging them (if the values of the same key in both objects\n   * are of type {@link JSONObject}). oldJSON will contain the result of this merge.\n   */\n  private static void deepMergeInto(JSONObject oldJSON, JSONObject newJSON)\n      throws JSONException {\n    Iterator<?> keys = newJSON.keys();\n    while (keys.hasNext()) {\n      String key = (String) keys.next();\n\n      JSONObject newJSONObject = newJSON.optJSONObject(key);\n      JSONObject oldJSONObject = oldJSON.optJSONObject(key);\n      if (newJSONObject != null && oldJSONObject != null) {\n        deepMergeInto(oldJSONObject, newJSONObject);\n        oldJSON.put(key, oldJSONObject);\n      } else {\n        oldJSON.put(key, newJSON.get(key));\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/storage/AsyncStorageModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.storage;\n\nimport java.util.HashSet;\n\nimport android.database.Cursor;\nimport android.database.sqlite.SQLiteStatement;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.GuardedAsyncTask;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.common.ModuleDataCleaner;\n\nimport static com.facebook.react.modules.storage.ReactDatabaseSupplier.KEY_COLUMN;\nimport static com.facebook.react.modules.storage.ReactDatabaseSupplier.TABLE_CATALYST;\nimport static com.facebook.react.modules.storage.ReactDatabaseSupplier.VALUE_COLUMN;\n\n@ReactModule(name = AsyncStorageModule.NAME)\npublic final class AsyncStorageModule\n    extends ReactContextBaseJavaModule implements ModuleDataCleaner.Cleanable {\n\n  protected static final String NAME = \"AsyncSQLiteDBStorage\";\n\n  // SQL variable number limit, defined by SQLITE_LIMIT_VARIABLE_NUMBER:\n  // https://raw.githubusercontent.com/android/platform_external_sqlite/master/dist/sqlite3.c\n  private static final int MAX_SQL_KEYS = 999;\n\n  private ReactDatabaseSupplier mReactDatabaseSupplier;\n  private boolean mShuttingDown = false;\n\n  public AsyncStorageModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n    mReactDatabaseSupplier = ReactDatabaseSupplier.getInstance(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @Override\n  public void initialize() {\n    super.initialize();\n    mShuttingDown = false;\n  }\n\n  @Override\n  public void onCatalystInstanceDestroy() {\n    mShuttingDown = true;\n  }\n\n  @Override\n  public void clearSensitiveData() {\n    // Clear local storage. If fails, crash, since the app is potentially in a bad state and could\n    // cause a privacy violation. We're still not recovering from this well, but at least the error\n    // will be reported to the server.\n    mReactDatabaseSupplier.clearAndCloseDatabase();\n  }\n\n  /**\n   * Given an array of keys, this returns a map of (key, value) pairs for the keys found, and\n   * (key, null) for the keys that haven't been found.\n   */\n  @ReactMethod\n  public void multiGet(final ReadableArray keys, final Callback callback) {\n    if (keys == null) {\n      callback.invoke(AsyncStorageErrorUtil.getInvalidKeyError(null), null);\n      return;\n    }\n\n    new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {\n      @Override\n      protected void doInBackgroundGuarded(Void... params) {\n        if (!ensureDatabase()) {\n          callback.invoke(AsyncStorageErrorUtil.getDBError(null), null);\n          return;\n        }\n\n        String[] columns = {KEY_COLUMN, VALUE_COLUMN};\n        HashSet<String> keysRemaining = new HashSet<>();\n        WritableArray data = Arguments.createArray();\n        for (int keyStart = 0; keyStart < keys.size(); keyStart += MAX_SQL_KEYS) {\n          int keyCount = Math.min(keys.size() - keyStart, MAX_SQL_KEYS);\n          Cursor cursor = mReactDatabaseSupplier.get().query(\n              TABLE_CATALYST,\n              columns,\n              AsyncLocalStorageUtil.buildKeySelection(keyCount),\n              AsyncLocalStorageUtil.buildKeySelectionArgs(keys, keyStart, keyCount),\n              null,\n              null,\n              null);\n          keysRemaining.clear();\n          try {\n            if (cursor.getCount() != keys.size()) {\n              // some keys have not been found - insert them with null into the final array\n              for (int keyIndex = keyStart; keyIndex < keyStart + keyCount; keyIndex++) {\n                keysRemaining.add(keys.getString(keyIndex));\n              }\n            }\n\n            if (cursor.moveToFirst()) {\n              do {\n                WritableArray row = Arguments.createArray();\n                row.pushString(cursor.getString(0));\n                row.pushString(cursor.getString(1));\n                data.pushArray(row);\n                keysRemaining.remove(cursor.getString(0));\n              } while (cursor.moveToNext());\n            }\n          } catch (Exception e) {\n            FLog.w(ReactConstants.TAG, e.getMessage(), e);\n            callback.invoke(AsyncStorageErrorUtil.getError(null, e.getMessage()), null);\n            return;\n          } finally {\n            cursor.close();\n          }\n\n          for (String key : keysRemaining) {\n            WritableArray row = Arguments.createArray();\n            row.pushString(key);\n            row.pushNull();\n            data.pushArray(row);\n          }\n          keysRemaining.clear();\n        }\n\n        callback.invoke(null, data);\n      }\n    }.execute();\n  }\n\n  /**\n   * Inserts multiple (key, value) pairs. If one or more of the pairs cannot be inserted, this will\n   * return AsyncLocalStorageFailure, but all other pairs will have been inserted.\n   * The insertion will replace conflicting (key, value) pairs.\n   */\n  @ReactMethod\n  public void multiSet(final ReadableArray keyValueArray, final Callback callback) {\n    if (keyValueArray.size() == 0) {\n      callback.invoke(AsyncStorageErrorUtil.getInvalidKeyError(null));\n      return;\n    }\n\n    new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {\n      @Override\n      protected void doInBackgroundGuarded(Void... params) {\n        if (!ensureDatabase()) {\n          callback.invoke(AsyncStorageErrorUtil.getDBError(null));\n          return;\n        }\n\n        String sql = \"INSERT OR REPLACE INTO \" + TABLE_CATALYST + \" VALUES (?, ?);\";\n        SQLiteStatement statement = mReactDatabaseSupplier.get().compileStatement(sql);\n        WritableMap error = null;\n        try {\n          mReactDatabaseSupplier.get().beginTransaction();\n          for (int idx=0; idx < keyValueArray.size(); idx++) {\n            if (keyValueArray.getArray(idx).size() != 2) {\n              error = AsyncStorageErrorUtil.getInvalidValueError(null);\n              return;\n            }\n            if (keyValueArray.getArray(idx).getString(0) == null) {\n              error = AsyncStorageErrorUtil.getInvalidKeyError(null);\n              return;\n            }\n            if (keyValueArray.getArray(idx).getString(1) == null) {\n              error = AsyncStorageErrorUtil.getInvalidValueError(null);\n              return;\n            }\n\n            statement.clearBindings();\n            statement.bindString(1, keyValueArray.getArray(idx).getString(0));\n            statement.bindString(2, keyValueArray.getArray(idx).getString(1));\n            statement.execute();\n          }\n          mReactDatabaseSupplier.get().setTransactionSuccessful();\n        } catch (Exception e) {\n          FLog.w(ReactConstants.TAG, e.getMessage(), e);\n          error = AsyncStorageErrorUtil.getError(null, e.getMessage());\n        } finally {\n          try {\n            mReactDatabaseSupplier.get().endTransaction();\n          } catch (Exception e) {\n            FLog.w(ReactConstants.TAG, e.getMessage(), e);\n            if (error == null) {\n              error = AsyncStorageErrorUtil.getError(null, e.getMessage());\n            }\n          }\n        }\n        if (error != null) {\n          callback.invoke(error);\n        } else {\n          callback.invoke();\n        }\n      }\n    }.execute();\n  }\n\n  /**\n   * Removes all rows of the keys given.\n   */\n  @ReactMethod\n  public void multiRemove(final ReadableArray keys, final Callback callback) {\n    if (keys.size() == 0) {\n      callback.invoke(AsyncStorageErrorUtil.getInvalidKeyError(null));\n      return;\n    }\n\n    new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {\n      @Override\n      protected void doInBackgroundGuarded(Void... params) {\n        if (!ensureDatabase()) {\n          callback.invoke(AsyncStorageErrorUtil.getDBError(null));\n          return;\n        }\n\n        WritableMap error = null;\n        try {\n          mReactDatabaseSupplier.get().beginTransaction();\n          for (int keyStart = 0; keyStart < keys.size(); keyStart += MAX_SQL_KEYS) {\n            int keyCount = Math.min(keys.size() - keyStart, MAX_SQL_KEYS);\n            mReactDatabaseSupplier.get().delete(\n                TABLE_CATALYST,\n                AsyncLocalStorageUtil.buildKeySelection(keyCount),\n                AsyncLocalStorageUtil.buildKeySelectionArgs(keys, keyStart, keyCount));\n          }\n          mReactDatabaseSupplier.get().setTransactionSuccessful();\n        } catch (Exception e) {\n          FLog.w(ReactConstants.TAG, e.getMessage(), e);\n          error = AsyncStorageErrorUtil.getError(null, e.getMessage());\n        } finally {\n          try {\n          mReactDatabaseSupplier.get().endTransaction();\n          } catch (Exception e) {\n            FLog.w(ReactConstants.TAG, e.getMessage(), e);\n            if (error == null) {\n              error = AsyncStorageErrorUtil.getError(null, e.getMessage());\n            }\n          }\n        }\n        if (error != null) {\n          callback.invoke(error);\n        } else {\n          callback.invoke();\n        }\n      }\n    }.execute();\n  }\n\n  /**\n   * Given an array of (key, value) pairs, this will merge the given values with the stored values\n   * of the given keys, if they exist.\n   */\n  @ReactMethod\n  public void multiMerge(final ReadableArray keyValueArray, final Callback callback) {\n    new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {\n      @Override\n      protected void doInBackgroundGuarded(Void... params) {\n        if (!ensureDatabase()) {\n          callback.invoke(AsyncStorageErrorUtil.getDBError(null));\n          return;\n        }\n        WritableMap error = null;\n        try {\n          mReactDatabaseSupplier.get().beginTransaction();\n          for (int idx = 0; idx < keyValueArray.size(); idx++) {\n            if (keyValueArray.getArray(idx).size() != 2) {\n              error = AsyncStorageErrorUtil.getInvalidValueError(null);\n              return;\n            }\n\n            if (keyValueArray.getArray(idx).getString(0) == null) {\n              error = AsyncStorageErrorUtil.getInvalidKeyError(null);\n              return;\n            }\n\n            if (keyValueArray.getArray(idx).getString(1) == null) {\n              error = AsyncStorageErrorUtil.getInvalidValueError(null);\n              return;\n            }\n\n            if (!AsyncLocalStorageUtil.mergeImpl(\n                mReactDatabaseSupplier.get(),\n                keyValueArray.getArray(idx).getString(0),\n                keyValueArray.getArray(idx).getString(1))) {\n              error = AsyncStorageErrorUtil.getDBError(null);\n              return;\n            }\n          }\n          mReactDatabaseSupplier.get().setTransactionSuccessful();\n        } catch (Exception e) {\n          FLog.w(ReactConstants.TAG, e.getMessage(), e);\n          error = AsyncStorageErrorUtil.getError(null, e.getMessage());\n        } finally {\n          try {\n            mReactDatabaseSupplier.get().endTransaction();\n          } catch (Exception e) {\n            FLog.w(ReactConstants.TAG, e.getMessage(), e);\n            if (error == null) {\n              error = AsyncStorageErrorUtil.getError(null, e.getMessage());\n            }\n          }\n        }\n        if (error != null) {\n          callback.invoke(error);\n        } else {\n          callback.invoke();\n        }\n      }\n    }.execute();\n  }\n\n  /**\n   * Clears the database.\n   */\n  @ReactMethod\n  public void clear(final Callback callback) {\n    new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {\n      @Override\n      protected void doInBackgroundGuarded(Void... params) {\n        if (!mReactDatabaseSupplier.ensureDatabase()) {\n          callback.invoke(AsyncStorageErrorUtil.getDBError(null));\n          return;\n        }\n        try {\n          mReactDatabaseSupplier.clear();\n          callback.invoke();\n        } catch (Exception e) {\n          FLog.w(ReactConstants.TAG, e.getMessage(), e);\n          callback.invoke(AsyncStorageErrorUtil.getError(null, e.getMessage()));\n        }\n      }\n    }.execute();\n  }\n\n  /**\n   * Returns an array with all keys from the database.\n   */\n  @ReactMethod\n  public void getAllKeys(final Callback callback) {\n    new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {\n      @Override\n      protected void doInBackgroundGuarded(Void... params) {\n        if (!ensureDatabase()) {\n          callback.invoke(AsyncStorageErrorUtil.getDBError(null), null);\n          return;\n        }\n        WritableArray data = Arguments.createArray();\n        String[] columns = {KEY_COLUMN};\n        Cursor cursor = mReactDatabaseSupplier.get()\n            .query(TABLE_CATALYST, columns, null, null, null, null, null);\n        try {\n          if (cursor.moveToFirst()) {\n            do {\n              data.pushString(cursor.getString(0));\n            } while (cursor.moveToNext());\n          }\n        } catch (Exception e) {\n          FLog.w(ReactConstants.TAG, e.getMessage(), e);\n          callback.invoke(AsyncStorageErrorUtil.getError(null, e.getMessage()), null);\n          return;\n        } finally {\n          cursor.close();\n        }\n        callback.invoke(null, data);\n      }\n    }.execute();\n  }\n\n  /**\n   * Verify the database is open for reads and writes.\n   */\n  private boolean ensureDatabase() {\n    return !mShuttingDown && mReactDatabaseSupplier.ensureDatabase();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/storage/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"storage\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/common:common\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/storage/ReactDatabaseSupplier.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.storage;\n\nimport javax.annotation.Nullable;\n\nimport android.content.Context;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.database.sqlite.SQLiteException;\nimport android.database.sqlite.SQLiteOpenHelper;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.common.ReactConstants;\n\n/**\n * Database supplier of the database used by react native. This creates, opens and deletes the\n * database as necessary.\n */\npublic class ReactDatabaseSupplier extends SQLiteOpenHelper {\n\n  // VisibleForTesting\n  public static final String DATABASE_NAME = \"RKStorage\";\n\n  private static final int DATABASE_VERSION = 1;\n  private static final int SLEEP_TIME_MS = 30;\n\n  static final String TABLE_CATALYST = \"catalystLocalStorage\";\n  static final String KEY_COLUMN = \"key\";\n  static final String VALUE_COLUMN = \"value\";\n\n  static final String VERSION_TABLE_CREATE =\n      \"CREATE TABLE \" + TABLE_CATALYST + \" (\" +\n          KEY_COLUMN + \" TEXT PRIMARY KEY, \" +\n          VALUE_COLUMN + \" TEXT NOT NULL\" +\n          \")\";\n\n  private static @Nullable ReactDatabaseSupplier sReactDatabaseSupplierInstance;\n\n  private Context mContext;\n  private @Nullable SQLiteDatabase mDb;\n  private long mMaximumDatabaseSize =  6L * 1024L * 1024L; // 6 MB in bytes\n\n  private ReactDatabaseSupplier(Context context) {\n    super(context, DATABASE_NAME, null, DATABASE_VERSION);\n    mContext = context;\n  }\n\n  public static ReactDatabaseSupplier getInstance(Context context) {\n    if (sReactDatabaseSupplierInstance == null) {\n      sReactDatabaseSupplierInstance = new ReactDatabaseSupplier(context.getApplicationContext());\n    }\n    return sReactDatabaseSupplierInstance;\n  }\n\n  @Override\n  public void onCreate(SQLiteDatabase db) {\n    db.execSQL(VERSION_TABLE_CREATE);\n  }\n\n  @Override\n  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n    if (oldVersion != newVersion) {\n      deleteDatabase();\n      onCreate(db);\n    }\n  }\n\n  /**\n   * Verify the database exists and is open.\n   */\n  /* package */ synchronized boolean ensureDatabase() {\n    if (mDb != null && mDb.isOpen()) {\n      return true;\n    }\n    // Sometimes retrieving the database fails. We do 2 retries: first without database deletion\n    // and then with deletion.\n    SQLiteException lastSQLiteException = null;\n    for (int tries = 0; tries < 2; tries++) {\n      try {\n        if (tries > 0) {\n          deleteDatabase();\n        }\n        mDb = getWritableDatabase();\n        break;\n      } catch (SQLiteException e) {\n        lastSQLiteException = e;\n      }\n      // Wait before retrying.\n      try {\n        Thread.sleep(SLEEP_TIME_MS);\n      } catch (InterruptedException ie) {\n        Thread.currentThread().interrupt();\n      }\n    }\n    if (mDb == null) {\n      throw lastSQLiteException;\n    }\n    // This is a sane limit to protect the user from the app storing too much data in the database.\n    // This also protects the database from filling up the disk cache and becoming malformed\n    // (endTransaction() calls will throw an exception, not rollback, and leave the db malformed).\n    mDb.setMaximumSize(mMaximumDatabaseSize);\n    return true;\n  }\n\n  /**\n   * Create and/or open the database.\n   */\n  public synchronized SQLiteDatabase get() {\n    ensureDatabase();\n    return mDb;\n  }\n\n  public synchronized void clearAndCloseDatabase() throws RuntimeException {\n    try {\n      clear();\n      closeDatabase();\n      FLog.d(ReactConstants.TAG, \"Cleaned \" + DATABASE_NAME);\n    } catch (Exception e) {\n      // Clearing the database has failed, delete it instead.\n      if (deleteDatabase()) {\n        FLog.d(ReactConstants.TAG, \"Deleted Local Database \" + DATABASE_NAME);\n        return;\n      }\n      // Everything failed, throw\n      throw new RuntimeException(\"Clearing and deleting database \" + DATABASE_NAME + \" failed\");\n    }\n  }\n\n  /* package */ synchronized void clear() {\n    get().delete(TABLE_CATALYST, null, null);\n  }\n\n  /**\n   * Sets the maximum size the database will grow to. The maximum size cannot\n   * be set below the current size.\n   */\n  public synchronized void setMaximumSize(long size) {\n    mMaximumDatabaseSize = size;\n    if (mDb != null) {\n      mDb.setMaximumSize(mMaximumDatabaseSize);\n    }\n  }\n\n  private synchronized boolean deleteDatabase() {\n    closeDatabase();\n    return mContext.deleteDatabase(DATABASE_NAME);\n  }\n\n  private synchronized void closeDatabase() {\n    if (mDb != null && mDb.isOpen()) {\n      mDb.close();\n      mDb = null;\n    }\n  }\n\n  // For testing purposes only!\n  public static void deleteInstance() {\n    sReactDatabaseSupplierInstance = null;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoHelpers.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.modules.systeminfo;\n\nimport java.util.Locale;\n\nimport android.os.Build;\n\npublic class AndroidInfoHelpers {\n\n  public static final String EMULATOR_LOCALHOST = \"10.0.2.2\";\n  public static final String GENYMOTION_LOCALHOST = \"10.0.3.2\";\n  public static final String DEVICE_LOCALHOST = \"localhost\";\n\n  private static final int DEBUG_SERVER_HOST_PORT = 8081;\n  private static final int INSPECTOR_PROXY_PORT = 8082;\n\n  private static boolean isRunningOnGenymotion() {\n    return Build.FINGERPRINT.contains(\"vbox\");\n  }\n\n  private static boolean isRunningOnStockEmulator() {\n    return Build.FINGERPRINT.contains(\"generic\");\n  }\n\n  public static String getServerHost() {\n    return getServerIpAddress(DEBUG_SERVER_HOST_PORT);\n  }\n\n  public static String getInspectorProxyHost() {\n    return getServerIpAddress(INSPECTOR_PROXY_PORT);\n  }\n\n  // WARNING(festevezga): This RN helper method has been copied to another FB-only target. Any changes should be applied to both.\n  public static String getFriendlyDeviceName() {\n    if (isRunningOnGenymotion()) {\n      // Genymotion already has a friendly name by default\n      return Build.MODEL;\n    } else {\n      return Build.MODEL + \" - \" + Build.VERSION.RELEASE + \" - API \" + Build.VERSION.SDK_INT;\n    }\n  }\n\n  private static String getServerIpAddress(int port) {\n    // Since genymotion runs in vbox it use different hostname to refer to adb host.\n    // We detect whether app runs on genymotion and replace js bundle server hostname accordingly\n\n    String ipAddress;\n    if (isRunningOnGenymotion()) {\n      ipAddress = GENYMOTION_LOCALHOST;\n    } else if (isRunningOnStockEmulator()) {\n      ipAddress = EMULATOR_LOCALHOST;\n    } else {\n      ipAddress = DEVICE_LOCALHOST;\n    }\n\n    return String.format(Locale.US, \"%s:%d\", ipAddress, port);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.systeminfo;\n\nimport android.os.Build;\n\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.module.annotations.ReactModule;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport javax.annotation.Nullable;\n\n/**\n * Module that exposes Android Constants to JS.\n */\n@ReactModule(name = \"PlatformConstants\")\npublic class AndroidInfoModule extends BaseJavaModule {\n\n  private static final String IS_TESTING = \"IS_TESTING\";\n\n  @Override\n  public String getName() {\n    return \"PlatformConstants\";\n  }\n\n  @Override\n  public @Nullable Map<String, Object> getConstants() {\n    HashMap<String, Object> constants = new HashMap<>();\n    constants.put(\"Version\", Build.VERSION.SDK_INT);\n    constants.put(\"ServerHost\", AndroidInfoHelpers.getServerHost());\n    constants.put(\"isTesting\", \"true\".equals(System.getProperty(IS_TESTING)));\n    constants.put(\"reactNativeVersion\", ReactNativeVersion.VERSION);\n    return constants;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"systeminfo\",\n    srcs = [\n        \"AndroidInfoModule.java\",\n        \"ReactNativeVersion.java\",\n    ],\n    exported_deps = [\n        \":systeminfo-moduleless\",\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    ],\n)\n\nandroid_library(\n    name = \"systeminfo-moduleless\",\n    srcs = [\n        \"AndroidInfoHelpers.java\",\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java",
    "content": "/**\n * @generated by scripts/bump-oss-version.js\n *\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.systeminfo;\n\nimport com.facebook.react.common.MapBuilder;\n\nimport java.util.Map;\n\npublic class ReactNativeVersion {\n  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(\n      \"major\", 0,\n      \"minor\", 0,\n      \"patch\", 0,\n      \"prerelease\", null);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/timepicker/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"timepicker\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/timepicker/DismissableTimePickerDialog.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.timepicker;\n\nimport android.app.TimePickerDialog;\nimport javax.annotation.Nullable;\n\nimport android.app.TimePickerDialog;\nimport android.content.Context;\nimport android.os.Build;\n\n/**\n * <p>\n *   Certain versions of Android (Jellybean-KitKat) have a bug where when dismissed, the\n *   {@link TimePickerDialog} still calls the OnTimeSetListener. This class works around that issue\n *   by *not* calling super.onStop on KitKat on lower, as that would erroneously call the\n *   OnTimeSetListener when the dialog is dismissed, or call it twice when \"OK\" is pressed.\n * </p>\n *\n * <p>\n *   See: <a href=\"https://code.google.com/p/android/issues/detail?id=34833\">Issue 34833</a>\n * </p>\n */\npublic class DismissableTimePickerDialog extends TimePickerDialog {\n\n  public DismissableTimePickerDialog(\n      Context context,\n      @Nullable TimePickerDialog.OnTimeSetListener callback,\n      int hourOfDay,\n      int minute,\n      boolean is24HourView) {\n    super(context, callback, hourOfDay, minute, is24HourView);\n  }\n\n  public DismissableTimePickerDialog(\n      Context context,\n      int theme,\n      @Nullable TimePickerDialog.OnTimeSetListener callback,\n      int hourOfDay,\n      int minute,\n      boolean is24HourView) {\n    super(context, theme, callback, hourOfDay, minute, is24HourView);\n  }\n\n  @Override\n  protected void onStop() {\n    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {\n      super.onStop();\n    }\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/timepicker/TimePickerDialogFragment.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.timepicker;\n\nimport android.app.Dialog;\nimport android.app.DialogFragment;\nimport android.app.TimePickerDialog;\nimport android.app.TimePickerDialog.OnTimeSetListener;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.content.DialogInterface.OnDismissListener;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.text.format.DateFormat;\n\nimport java.util.Calendar;\nimport java.util.Locale;\n\nimport javax.annotation.Nullable;\n\n@SuppressWarnings(\"ValidFragment\")\npublic class TimePickerDialogFragment extends DialogFragment {\n\n  @Nullable\n  private OnTimeSetListener mOnTimeSetListener;\n  @Nullable\n  private OnDismissListener mOnDismissListener;\n\n  @Override\n  public Dialog onCreateDialog(Bundle savedInstanceState) {\n    final Bundle args = getArguments();\n    return createDialog(args, getActivity(), mOnTimeSetListener);\n  }\n\n  /*package*/ static Dialog createDialog(\n      Bundle args, Context activityContext, @Nullable OnTimeSetListener onTimeSetListener\n  ) {\n    final Calendar now = Calendar.getInstance();\n    int hour = now.get(Calendar.HOUR_OF_DAY);\n    int minute = now.get(Calendar.MINUTE);\n    boolean is24hour = DateFormat.is24HourFormat(activityContext);\n\n    TimePickerMode mode = TimePickerMode.DEFAULT;\n    if (args != null && args.getString(TimePickerDialogModule.ARG_MODE, null) != null) {\n      mode = TimePickerMode.valueOf(args.getString(TimePickerDialogModule.ARG_MODE).toUpperCase(Locale.US));\n    }\n\n    if (args != null) {\n      hour = args.getInt(TimePickerDialogModule.ARG_HOUR, now.get(Calendar.HOUR_OF_DAY));\n      minute = args.getInt(TimePickerDialogModule.ARG_MINUTE, now.get(Calendar.MINUTE));\n      is24hour = args.getBoolean(\n          TimePickerDialogModule.ARG_IS24HOUR,\n          DateFormat.is24HourFormat(activityContext));\n    }\n\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n      if (mode == TimePickerMode.CLOCK) {\n        return new DismissableTimePickerDialog(\n          activityContext,\n          activityContext.getResources().getIdentifier(\n            \"ClockTimePickerDialog\",\n            \"style\",\n            activityContext.getPackageName()\n          ),\n          onTimeSetListener,\n          hour,\n          minute,\n          is24hour\n        );\n      } else if (mode == TimePickerMode.SPINNER) {\n        return new DismissableTimePickerDialog(\n          activityContext,\n          activityContext.getResources().getIdentifier(\n            \"SpinnerTimePickerDialog\",\n            \"style\",\n            activityContext.getPackageName()\n          ),\n          onTimeSetListener,\n          hour,\n          minute,\n          is24hour\n        );\n      }\n    }\n    return new DismissableTimePickerDialog(\n            activityContext,\n            onTimeSetListener,\n            hour,\n            minute,\n            is24hour\n    );\n  }\n\n  @Override\n  public void onDismiss(DialogInterface dialog) {\n    super.onDismiss(dialog);\n    if (mOnDismissListener != null) {\n      mOnDismissListener.onDismiss(dialog);\n    }\n  }\n\n  public void setOnDismissListener(@Nullable OnDismissListener onDismissListener) {\n    mOnDismissListener = onDismissListener;\n  }\n\n  public void setOnTimeSetListener(@Nullable OnTimeSetListener onTimeSetListener) {\n    mOnTimeSetListener = onTimeSetListener;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/timepicker/TimePickerDialogModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.timepicker;\n\nimport android.app.Activity;\nimport android.app.DialogFragment;\nimport android.app.FragmentManager;\nimport android.app.TimePickerDialog.OnTimeSetListener;\nimport android.content.DialogInterface;\nimport android.content.DialogInterface.OnDismissListener;\nimport android.os.Bundle;\nimport android.widget.TimePicker;\n\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.Promise;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.module.annotations.ReactModule;\n\nimport javax.annotation.Nullable;\n\n/**\n * {@link NativeModule} that allows JS to show a native time picker dialog and get called back when\n * the user selects a time.\n */\n@ReactModule(name = \"TimePickerAndroid\")\npublic class TimePickerDialogModule extends ReactContextBaseJavaModule {\n\n  @VisibleForTesting\n  public static final String FRAGMENT_TAG = \"TimePickerAndroid\";\n\n  private static final String ERROR_NO_ACTIVITY = \"E_NO_ACTIVITY\";\n\n  /* package */ static final String ARG_HOUR = \"hour\";\n  /* package */ static final String ARG_MINUTE = \"minute\";\n  /* package */ static final String ARG_IS24HOUR = \"is24Hour\";\n  /* package */ static final String ARG_MODE = \"mode\";\n  /* package */ static final String ACTION_TIME_SET = \"timeSetAction\";\n  /* package */ static final String ACTION_DISMISSED = \"dismissedAction\";\n\n  public TimePickerDialogModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return \"TimePickerAndroid\";\n  }\n\n  private class TimePickerDialogListener implements OnTimeSetListener, OnDismissListener {\n\n    private final Promise mPromise;\n    private boolean mPromiseResolved = false;\n\n    public TimePickerDialogListener(Promise promise) {\n      mPromise = promise;\n    }\n\n    @Override\n    public void onTimeSet(TimePicker view, int hour, int minute) {\n      if (!mPromiseResolved && getReactApplicationContext().hasActiveCatalystInstance()) {\n        WritableMap result = new WritableNativeMap();\n        result.putString(\"action\", ACTION_TIME_SET);\n        result.putInt(\"hour\", hour);\n        result.putInt(\"minute\", minute);\n        mPromise.resolve(result);\n        mPromiseResolved = true;\n      }\n    }\n\n    @Override\n    public void onDismiss(DialogInterface dialog) {\n      if (!mPromiseResolved && getReactApplicationContext().hasActiveCatalystInstance()) {\n        WritableMap result = new WritableNativeMap();\n        result.putString(\"action\", ACTION_DISMISSED);\n        mPromise.resolve(result);\n        mPromiseResolved = true;\n      }\n    }\n  }\n\n  @ReactMethod\n  public void open(@Nullable final ReadableMap options, Promise promise) {\n\n    Activity activity = getCurrentActivity();\n    if (activity == null) {\n      promise.reject(\n          ERROR_NO_ACTIVITY,\n          \"Tried to open a TimePicker dialog while not attached to an Activity\");\n      return;\n    }\n    // We want to support both android.app.Activity and the pre-Honeycomb FragmentActivity\n    // (for apps that use it for legacy reasons). This unfortunately leads to some code duplication.\n    if (activity instanceof android.support.v4.app.FragmentActivity) {\n      android.support.v4.app.FragmentManager fragmentManager =\n          ((android.support.v4.app.FragmentActivity) activity).getSupportFragmentManager();\n      android.support.v4.app.DialogFragment oldFragment =\n          (android.support.v4.app.DialogFragment) fragmentManager.findFragmentByTag(FRAGMENT_TAG);\n      if (oldFragment != null) {\n        oldFragment.dismiss();\n      }\n      SupportTimePickerDialogFragment fragment = new SupportTimePickerDialogFragment();\n      if (options != null) {\n        Bundle args = createFragmentArguments(options);\n        fragment.setArguments(args);\n      }\n      TimePickerDialogListener listener = new TimePickerDialogListener(promise);\n      fragment.setOnDismissListener(listener);\n      fragment.setOnTimeSetListener(listener);\n      fragment.show(fragmentManager, FRAGMENT_TAG);\n    } else {\n      FragmentManager fragmentManager = activity.getFragmentManager();\n      DialogFragment oldFragment = (DialogFragment) fragmentManager.findFragmentByTag(FRAGMENT_TAG);\n      if (oldFragment != null) {\n        oldFragment.dismiss();\n      }\n      TimePickerDialogFragment fragment = new TimePickerDialogFragment();\n      if (options != null) {\n        final Bundle args = createFragmentArguments(options);\n        fragment.setArguments(args);\n      }\n      TimePickerDialogListener listener = new TimePickerDialogListener(promise);\n      fragment.setOnDismissListener(listener);\n      fragment.setOnTimeSetListener(listener);\n      fragment.show(fragmentManager, FRAGMENT_TAG);\n    }\n  }\n\n  private Bundle createFragmentArguments(ReadableMap options) {\n    final Bundle args = new Bundle();\n    if (options.hasKey(ARG_HOUR) && !options.isNull(ARG_HOUR)) {\n      args.putInt(ARG_HOUR, options.getInt(ARG_HOUR));\n    }\n    if (options.hasKey(ARG_MINUTE) && !options.isNull(ARG_MINUTE)) {\n      args.putInt(ARG_MINUTE, options.getInt(ARG_MINUTE));\n    }\n    if (options.hasKey(ARG_IS24HOUR) && !options.isNull(ARG_IS24HOUR)) {\n      args.putBoolean(ARG_IS24HOUR, options.getBoolean(ARG_IS24HOUR));\n    }\n    if (options.hasKey(ARG_MODE) && !options.isNull(ARG_MODE)) {\n      args.putString(ARG_MODE, options.getString(ARG_MODE));\n    }\n    return args;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/timepicker/TimePickerMode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.timepicker;\n\n\npublic enum TimePickerMode {\n  CLOCK,\n  SPINNER,\n  DEFAULT\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/toast/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"toast\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.toast;\n\nimport android.view.Gravity;\nimport android.widget.Toast;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.module.annotations.ReactModule;\nimport java.util.Map;\n\n/**\n * {@link NativeModule} that allows JS to show an Android Toast.\n */\n@ReactModule(name = \"ToastAndroid\")\npublic class ToastModule extends ReactContextBaseJavaModule {\n\n  private static final String DURATION_SHORT_KEY = \"SHORT\";\n  private static final String DURATION_LONG_KEY = \"LONG\";\n\n  private static final String GRAVITY_TOP_KEY = \"TOP\";\n  private static final String GRAVITY_BOTTOM_KEY = \"BOTTOM\";\n  private static final String GRAVITY_CENTER = \"CENTER\";\n\n  public ToastModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return \"ToastAndroid\";\n  }\n\n  @Override\n  public Map<String, Object> getConstants() {\n    final Map<String, Object> constants = MapBuilder.newHashMap();\n    constants.put(DURATION_SHORT_KEY, Toast.LENGTH_SHORT);\n    constants.put(DURATION_LONG_KEY, Toast.LENGTH_LONG);\n    constants.put(GRAVITY_TOP_KEY, Gravity.TOP | Gravity.CENTER_HORIZONTAL);\n    constants.put(GRAVITY_BOTTOM_KEY, Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL);\n    constants.put(GRAVITY_CENTER, Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);\n    return constants;\n  }\n\n  @ReactMethod\n  public void show(final String message, final int duration) {\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        Toast.makeText(getReactApplicationContext(), message, duration).show();\n      }\n    });\n  }\n\n  @ReactMethod\n  public void showWithGravity(final String message, final int duration, final int gravity) {\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        Toast toast = Toast.makeText(getReactApplicationContext(), message, duration);\n        toast.setGravity(gravity, 0, 0);\n        toast.show();\n      }\n    });\n  }\n\n  @ReactMethod\n  public void showWithGravityAndOffset(\n      final String message,\n      final int duration,\n      final int gravity,\n      final int xOffset,\n      final int yOffset) {\n    UiThreadUtil.runOnUiThread(\n        new Runnable() {\n          @Override\n          public void run() {\n            Toast toast = Toast.makeText(getReactApplicationContext(), message, duration);\n            toast.setGravity(gravity, xOffset, yOffset);\n            toast.show();\n          }\n        });\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/vibration/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"vibration\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/vibration/VibrationModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.vibration;\n\nimport android.content.Context;\nimport android.os.Vibrator;\n\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.module.annotations.ReactModule;\n\n@ReactModule(name = \"Vibration\")\npublic class VibrationModule extends ReactContextBaseJavaModule {\n\n  public VibrationModule(ReactApplicationContext reactContext) {\n    super(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return \"Vibration\";\n  }\n\n  @ReactMethod\n  public void vibrate(int duration) {\n    Vibrator v = (Vibrator) getReactApplicationContext().getSystemService(Context.VIBRATOR_SERVICE);\n    if (v != null) {\n      v.vibrate(duration);\n    }\n  }\n\n  @ReactMethod\n  public void vibrateByPattern(ReadableArray pattern, int repeat) {\n    long[] patternLong = new long[pattern.size()];\n    for (int i = 0; i < pattern.size(); i++) {\n      patternLong[i] = pattern.getInt(i);\n    }\n\n    Vibrator v = (Vibrator) getReactApplicationContext().getSystemService(Context.VIBRATOR_SERVICE);\n    if (v != null) {\n      v.vibrate(patternLong, repeat);\n    }\n  }\n\n  @ReactMethod\n  public void cancel() {\n    Vibrator v = (Vibrator) getReactApplicationContext().getSystemService(Context.VIBRATOR_SERVICE);\n    if (v != null) {\n      v.cancel();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"websocket\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/modules/network:network\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.websocket;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.ReadableMapKeySetIterator;\nimport com.facebook.react.bridge.ReadableType;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.modules.core.DeviceEventManagerModule;\nimport com.facebook.react.modules.network.ForwardingCookieHandler;\nimport java.io.IOException;\nimport java.net.URI;\nimport java.net.URISyntaxException;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.TimeUnit;\nimport javax.annotation.Nullable;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\nimport okhttp3.WebSocket;\nimport okhttp3.WebSocketListener;\nimport okio.ByteString;\n\n@ReactModule(name = \"WebSocketModule\", hasConstants = false)\npublic final class WebSocketModule extends ReactContextBaseJavaModule {\n\n  public interface ContentHandler {\n    void onMessage(String text, WritableMap params);\n\n    void onMessage(ByteString byteString, WritableMap params);\n  }\n\n  private final Map<Integer, WebSocket> mWebSocketConnections = new HashMap<>();\n  private final Map<Integer, ContentHandler> mContentHandlers = new HashMap<>();\n\n  private ReactContext mReactContext;\n  private ForwardingCookieHandler mCookieHandler;\n\n  public WebSocketModule(ReactApplicationContext context) {\n    super(context);\n    mReactContext = context;\n    mCookieHandler = new ForwardingCookieHandler(context);\n  }\n\n  private void sendEvent(String eventName, WritableMap params) {\n    mReactContext\n      .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)\n      .emit(eventName, params);\n  }\n\n  @Override\n  public String getName() {\n    return \"WebSocketModule\";\n  }\n\n  public void setContentHandler(final int id, final ContentHandler contentHandler) {\n    if (contentHandler != null) {\n      mContentHandlers.put(id, contentHandler);\n    } else {\n      mContentHandlers.remove(id);\n    }\n  }\n\n  @ReactMethod\n  public void connect(\n    final String url,\n    @Nullable final ReadableArray protocols,\n    @Nullable final ReadableMap options,\n    final int id) {\n    OkHttpClient client = new OkHttpClient.Builder()\n      .connectTimeout(10, TimeUnit.SECONDS)\n      .writeTimeout(10, TimeUnit.SECONDS)\n      .readTimeout(0, TimeUnit.MINUTES) // Disable timeouts for read\n      .build();\n\n    Request.Builder builder = new Request.Builder().tag(id).url(url);\n\n    String cookie = getCookie(url);\n    if (cookie != null) {\n      builder.addHeader(\"Cookie\", cookie);\n    }\n\n    if (options != null && options.hasKey(\"headers\") && options.getType(\"headers\").equals(ReadableType.Map)) {\n\n      ReadableMap headers = options.getMap(\"headers\");\n      ReadableMapKeySetIterator iterator = headers.keySetIterator();\n\n      if (!headers.hasKey(\"origin\")) {\n        builder.addHeader(\"origin\", getDefaultOrigin(url));\n      }\n\n      while (iterator.hasNextKey()) {\n        String key = iterator.nextKey();\n        if (ReadableType.String.equals(headers.getType(key))) {\n          builder.addHeader(key, headers.getString(key));\n        } else {\n          FLog.w(\n            ReactConstants.TAG,\n            \"Ignoring: requested \" + key + \", value not a string\");\n        }\n      }\n    } else {\n      builder.addHeader(\"origin\", getDefaultOrigin(url));\n    }\n\n    if (protocols != null && protocols.size() > 0) {\n      StringBuilder protocolsValue = new StringBuilder(\"\");\n      for (int i = 0; i < protocols.size(); i++) {\n        String v = protocols.getString(i).trim();\n        if (!v.isEmpty() && !v.contains(\",\")) {\n          protocolsValue.append(v);\n          protocolsValue.append(\",\");\n        }\n      }\n      if (protocolsValue.length() > 0) {\n        protocolsValue.replace(protocolsValue.length() - 1, protocolsValue.length(), \"\");\n        builder.addHeader(\"Sec-WebSocket-Protocol\", protocolsValue.toString());\n      }\n    }\n\n    client.newWebSocket(\n        builder.build(),\n        new WebSocketListener() {\n\n          @Override\n          public void onOpen(WebSocket webSocket, Response response) {\n            mWebSocketConnections.put(id, webSocket);\n            WritableMap params = Arguments.createMap();\n            params.putInt(\"id\", id);\n            sendEvent(\"websocketOpen\", params);\n          }\n\n          @Override\n          public void onClosed(WebSocket webSocket, int code, String reason) {\n            WritableMap params = Arguments.createMap();\n            params.putInt(\"id\", id);\n            params.putInt(\"code\", code);\n            params.putString(\"reason\", reason);\n            sendEvent(\"websocketClosed\", params);\n          }\n\n          @Override\n          public void onFailure(WebSocket webSocket, Throwable t, Response response) {\n            notifyWebSocketFailed(id, t.getMessage());\n          }\n\n          @Override\n          public void onMessage(WebSocket webSocket, String text) {\n            WritableMap params = Arguments.createMap();\n            params.putInt(\"id\", id);\n            params.putString(\"type\", \"text\");\n\n            ContentHandler contentHandler = mContentHandlers.get(id);\n            if (contentHandler != null) {\n              contentHandler.onMessage(text, params);\n            } else {\n              params.putString(\"data\", text);\n            }\n            sendEvent(\"websocketMessage\", params);\n          }\n\n          @Override\n          public void onMessage(WebSocket webSocket, ByteString bytes) {\n            WritableMap params = Arguments.createMap();\n            params.putInt(\"id\", id);\n            params.putString(\"type\", \"binary\");\n\n            ContentHandler contentHandler = mContentHandlers.get(id);\n            if (contentHandler != null) {\n              contentHandler.onMessage(bytes, params);\n            } else {\n              String text = bytes.base64();\n\n              params.putString(\"data\", text);\n            }\n\n            sendEvent(\"websocketMessage\", params);\n          }\n        });\n\n    // Trigger shutdown of the dispatcher's executor so this process can exit cleanly\n    client.dispatcher().executorService().shutdown();\n  }\n\n  @ReactMethod\n  public void close(int code, String reason, int id) {\n    WebSocket client = mWebSocketConnections.get(id);\n    if (client == null) {\n      // WebSocket is already closed\n      // Don't do anything, mirror the behaviour on web\n      return;\n    }\n    try {\n      client.close(code, reason);\n      mWebSocketConnections.remove(id);\n      mContentHandlers.remove(id);\n    } catch (Exception e) {\n      FLog.e(\n        ReactConstants.TAG,\n        \"Could not close WebSocket connection for id \" + id,\n        e);\n    }\n  }\n\n  @ReactMethod\n  public void send(String message, int id) {\n    WebSocket client = mWebSocketConnections.get(id);\n    if (client == null) {\n      // This is a programmer error\n      throw new RuntimeException(\"Cannot send a message. Unknown WebSocket id \" + id);\n    }\n    try {\n      client.send(message);\n    } catch (Exception e) {\n      notifyWebSocketFailed(id, e.getMessage());\n    }\n  }\n\n  @ReactMethod\n  public void sendBinary(String base64String, int id) {\n    WebSocket client = mWebSocketConnections.get(id);\n    if (client == null) {\n      // This is a programmer error\n      throw new RuntimeException(\"Cannot send a message. Unknown WebSocket id \" + id);\n    }\n    try {\n      client.send(ByteString.decodeBase64(base64String));\n    } catch (Exception e) {\n      notifyWebSocketFailed(id, e.getMessage());\n    }\n  }\n\n  public void sendBinary(ByteString byteString, int id) {\n    WebSocket client = mWebSocketConnections.get(id);\n    if (client == null) {\n      // This is a programmer error\n      throw new RuntimeException(\"Cannot send a message. Unknown WebSocket id \" + id);\n    }\n    try {\n      client.send(byteString);\n    } catch (Exception e) {\n      notifyWebSocketFailed(id, e.getMessage());\n    }\n  }\n\n  @ReactMethod\n  public void ping(int id) {\n    WebSocket client = mWebSocketConnections.get(id);\n    if (client == null) {\n      // This is a programmer error\n      throw new RuntimeException(\"Cannot send a message. Unknown WebSocket id \" + id);\n    }\n    try {\n      client.send(ByteString.EMPTY);\n    } catch (Exception e) {\n      notifyWebSocketFailed(id, e.getMessage());\n    }\n  }\n\n  private void notifyWebSocketFailed(int id, String message) {\n    WritableMap params = Arguments.createMap();\n    params.putInt(\"id\", id);\n    params.putString(\"message\", message);\n    sendEvent(\"websocketFailed\", params);\n  }\n\n  /**\n   * Get the default HTTP(S) origin for a specific WebSocket URI\n   *\n   * @param uri\n   * @return A string of the endpoint converted to HTTP protocol (http[s]://host[:port])\n   */\n  private static String getDefaultOrigin(String uri) {\n    try {\n      String defaultOrigin;\n      String scheme = \"\";\n\n      URI requestURI = new URI(uri);\n      if (requestURI.getScheme().equals(\"wss\")) {\n        scheme += \"https\";\n      } else if (requestURI.getScheme().equals(\"ws\")) {\n        scheme += \"http\";\n      } else if (requestURI.getScheme().equals(\"http\") || requestURI.getScheme().equals(\"https\")) {\n        scheme += requestURI.getScheme();\n      }\n\n      if (requestURI.getPort() != -1) {\n        defaultOrigin = String.format(\n          \"%s://%s:%s\",\n          scheme,\n          requestURI.getHost(),\n          requestURI.getPort());\n      } else {\n        defaultOrigin = String.format(\"%s://%s/\", scheme, requestURI.getHost());\n      }\n\n      return defaultOrigin;\n    } catch (URISyntaxException e) {\n      throw new IllegalArgumentException(\"Unable to set \" + uri + \" as default origin header\");\n    }\n  }\n\n  /**\n   * Get the cookie for a specific domain\n   *\n   * @param uri\n   * @return The cookie header or null if none is set\n   */\n  private String getCookie(String uri) {\n    try {\n      URI origin = new URI(getDefaultOrigin(uri));\n      Map<String, List<String>> cookieMap = mCookieHandler.get(origin, new HashMap());\n      List<String> cookieList = cookieMap.get(\"Cookie\");\n\n      if (cookieList == null || cookieList.isEmpty()) {\n        return null;\n      }\n\n      return cookieList.get(0);\n    } catch (URISyntaxException | IOException e) {\n      throw new IllegalArgumentException(\"Unable to get cookie from \" + uri);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/packagerconnection/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"packagerconnection\",\n    srcs = glob(\n        [\"**/*.java\"],\n        excludes = [\"SamplingProfilerPackagerMethod.java\"] if IS_OSS_BUILD else [],\n    ),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"java/com/facebook/jni:jni\"),\n        react_native_dep(\"java/com/facebook/proguard/annotations:annotations\"),\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"libraries/soloader/java/com/facebook/soloader:soloader\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_target(\"java/com/facebook/react/modules/systeminfo:systeminfo-moduleless\"),\n    ] + ([react_native_target(\"jni/packagerconnection:jni\")] if not IS_OSS_BUILD else []),\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/packagerconnection/FileIoHandler.java",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.packagerconnection;\n\nimport javax.annotation.Nullable;\n\nimport java.io.FileInputStream;\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.Map;\n\nimport android.os.Handler;\nimport android.os.Looper;\nimport android.util.Base64;\n\nimport com.facebook.common.logging.FLog;\n\nimport org.json.JSONObject;\n\npublic class FileIoHandler implements Runnable {\n  private static final String TAG = JSPackagerClient.class.getSimpleName();\n  private static final long FILE_TTL = 30 * 1000;\n\n  private static class TtlFileInputStream {\n    private final FileInputStream mStream;\n    private long mTtl;\n\n    public TtlFileInputStream(String path) throws FileNotFoundException {\n      mStream = new FileInputStream(path);\n      mTtl = System.currentTimeMillis() + FILE_TTL;\n    }\n\n    private void extendTtl() {\n      mTtl = System.currentTimeMillis() + FILE_TTL;\n    }\n\n    public boolean expiredTtl() {\n      return System.currentTimeMillis() >= mTtl;\n    }\n\n    public String read(int size) throws IOException {\n      extendTtl();\n      byte[] buffer = new byte[size];\n      int bytesRead = mStream.read(buffer);\n      return Base64.encodeToString(buffer, 0, bytesRead, Base64.DEFAULT);\n    }\n\n    public void close() throws IOException {\n      mStream.close();\n    }\n  };\n\n  private int mNextHandle;\n  private final Handler mHandler;\n  private final Map<Integer, TtlFileInputStream> mOpenFiles;\n  private final Map<String, RequestHandler> mRequestHandlers;\n\n  public FileIoHandler() {\n    mNextHandle = 1;\n    mHandler = new Handler(Looper.getMainLooper());\n    mOpenFiles = new HashMap<>();\n    mRequestHandlers = new HashMap<>();\n    mRequestHandlers.put(\"fopen\", new RequestOnlyHandler() {\n      @Override\n      public void onRequest(\n          @Nullable Object params, Responder responder) {\n        synchronized (mOpenFiles) {\n          try {\n            JSONObject paramsObj = (JSONObject)params;\n            if (paramsObj == null) {\n              throw new Exception(\"params must be an object { mode: string, filename: string }\");\n            }\n            String mode = paramsObj.optString(\"mode\");\n            if (mode == null) {\n              throw new Exception(\"missing params.mode\");\n            }\n            String filename = paramsObj.optString(\"filename\");\n            if (filename == null) {\n              throw new Exception(\"missing params.filename\");\n            }\n            if (!mode.equals(\"r\")) {\n              throw new IllegalArgumentException(\"unsupported mode: \" + mode);\n            }\n\n            responder.respond(addOpenFile(filename));\n          } catch (Exception e) {\n            responder.error(e.toString());\n          }\n        }\n      }\n    });\n    mRequestHandlers.put(\"fclose\", new RequestOnlyHandler() {\n      @Override\n      public void onRequest(\n          @Nullable Object params, Responder responder) {\n        synchronized (mOpenFiles) {\n          try {\n            if (!(params instanceof Number)) {\n              throw new Exception(\"params must be a file handle\");\n            }\n            TtlFileInputStream stream = mOpenFiles.get((int)params);\n            if (stream == null) {\n              throw new Exception(\"invalid file handle, it might have timed out\");\n            }\n\n            mOpenFiles.remove((int)params);\n            stream.close();\n            responder.respond(\"\");\n          } catch (Exception e) {\n            responder.error(e.toString());\n          }\n        }\n      }\n    });\n    mRequestHandlers.put(\"fread\", new RequestOnlyHandler() {\n      @Override\n      public void onRequest(\n          @Nullable Object params, Responder responder) {\n        synchronized (mOpenFiles) {\n          try {\n            JSONObject paramsObj = (JSONObject)params;\n            if (paramsObj == null) {\n              throw new Exception(\"params must be an object { file: handle, size: number }\");\n            }\n            int file = paramsObj.optInt(\"file\");\n            if (file == 0) {\n              throw new Exception(\"invalid or missing file handle\");\n            }\n            int size = paramsObj.optInt(\"size\");\n            if (size == 0) {\n              throw new Exception(\"invalid or missing read size\");\n            }\n            TtlFileInputStream stream = mOpenFiles.get(file);\n            if (stream == null) {\n              throw new Exception(\"invalid file handle, it might have timed out\");\n            }\n\n            responder.respond(stream.read(size));\n          } catch (Exception e) {\n            responder.error(e.toString());\n          }\n        }\n      }\n    });\n  }\n\n  public Map<String, RequestHandler> handlers() {\n    return mRequestHandlers;\n  }\n\n  private int addOpenFile(String filename) throws FileNotFoundException {\n    int handle = mNextHandle++;\n    mOpenFiles.put(handle, new TtlFileInputStream(filename));\n    if (mOpenFiles.size() == 1) {\n      mHandler.postDelayed(FileIoHandler.this, FILE_TTL);\n    }\n    return handle;\n  }\n\n  @Override\n  public void run() {\n    // clean up files that are past their expiry date\n    synchronized (mOpenFiles) {\n      Iterator<TtlFileInputStream> i = mOpenFiles.values().iterator();\n      while (i.hasNext()) {\n        TtlFileInputStream stream = i.next();\n        if (stream.expiredTtl()) {\n          i.remove();\n          try {\n            stream.close();\n          } catch (IOException e) {\n            FLog.e(\n              TAG,\n              \"closing expired file failed: \" + e.toString());\n          }\n        }\n      }\n      if (!mOpenFiles.isEmpty()) {\n        mHandler.postDelayed(this, FILE_TTL);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/packagerconnection/JSPackagerClient.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\n\npackage com.facebook.react.packagerconnection;\n\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\nimport android.net.Uri;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.modules.systeminfo.AndroidInfoHelpers;\n\nimport okio.ByteString;\n\nimport org.json.JSONObject;\n\n/**\n * A client for packager that uses WebSocket connection.\n */\nfinal public class JSPackagerClient implements ReconnectingWebSocket.MessageCallback {\n  private static final String TAG = JSPackagerClient.class.getSimpleName();\n  private static final String PACKAGER_CONNECTION_URL_FORMAT = \"ws://%s/message?device=%s&app=%s&context=%s\";\n  private static final int PROTOCOL_VERSION = 2;\n\n  private class ResponderImpl implements Responder {\n    private Object mId;\n\n    public ResponderImpl(Object id) {\n      mId = id;\n    }\n\n    public void respond(Object result) {\n      try {\n        JSONObject message = new JSONObject();\n        message.put(\"version\", PROTOCOL_VERSION);\n        message.put(\"id\", mId);\n        message.put(\"result\", result);\n        mWebSocket.sendMessage(message.toString());\n      } catch (Exception e) {\n        FLog.e(TAG, \"Responding failed\", e);\n      }\n    }\n\n    public void error(Object error) {\n      try {\n        JSONObject message = new JSONObject();\n        message.put(\"version\", PROTOCOL_VERSION);\n        message.put(\"id\", mId);\n        message.put(\"error\", error);\n        mWebSocket.sendMessage(message.toString());\n      } catch (Exception e) {\n        FLog.e(TAG, \"Responding with error failed\", e);\n      }\n    }\n  }\n\n  private ReconnectingWebSocket mWebSocket;\n  private Map<String, RequestHandler> mRequestHandlers;\n\n  public JSPackagerClient(String clientId, PackagerConnectionSettings settings, Map<String, RequestHandler> requestHandlers) {\n    this(clientId, settings, requestHandlers, null);\n  }\n\n  public JSPackagerClient(\n      String clientId, PackagerConnectionSettings settings,\n      Map<String, RequestHandler> requestHandlers,\n      @Nullable ReconnectingWebSocket.ConnectionCallback connectionCallback) {\n    super();\n\n    Uri.Builder builder = new Uri.Builder();\n    builder.scheme(\"ws\")\n      .encodedAuthority(settings.getDebugServerHost())\n      .appendPath(\"message\")\n      .appendQueryParameter(\"device\", AndroidInfoHelpers.getFriendlyDeviceName())\n      .appendQueryParameter(\"app\", settings.getPackageName())\n      .appendQueryParameter(\"clientid\", clientId);\n    String url = builder.build().toString();\n\n    mWebSocket = new ReconnectingWebSocket(url, this, connectionCallback);\n    mRequestHandlers = requestHandlers;\n  }\n\n  public void init() {\n    mWebSocket.connect();\n  }\n\n  public void close() {\n    mWebSocket.closeQuietly();\n  }\n\n  @Override\n  public void onMessage(String text) {\n    try {\n      JSONObject message = new JSONObject(text);\n\n      int version = message.optInt(\"version\");\n      String method = message.optString(\"method\");\n      Object id = message.opt(\"id\");\n      Object params = message.opt(\"params\");\n\n      if (version != PROTOCOL_VERSION) {\n        FLog.e(\n          TAG,\n          \"Message with incompatible or missing version of protocol received: \" + version);\n        return;\n      }\n\n      if (method == null) {\n        abortOnMessage(id, \"No method provided\");\n        return;\n      }\n\n      RequestHandler handler = mRequestHandlers.get(method);\n      if (handler == null) {\n        abortOnMessage(id, \"No request handler for method: \" + method);\n        return;\n      }\n\n      if (id == null) {\n        handler.onNotification(params);\n      } else {\n        handler.onRequest(params, new ResponderImpl(id));\n      }\n    } catch (Exception e) {\n      FLog.e(TAG, \"Handling the message failed\", e);\n    }\n  }\n\n  @Override\n  public void onMessage(ByteString bytes) {\n    FLog.w(TAG, \"Websocket received message with payload of unexpected type binary\");\n  }\n\n  private void abortOnMessage(Object id, String reason) {\n    if (id != null) {\n      (new ResponderImpl(id)).error(reason);\n    }\n\n    FLog.e(TAG, \"Handling the message failed with reason: \" + reason);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/packagerconnection/NotificationOnlyHandler.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\n\npackage com.facebook.react.packagerconnection;\n\nimport javax.annotation.Nullable;\n\nimport com.facebook.common.logging.FLog;\n\npublic abstract class NotificationOnlyHandler implements RequestHandler {\n  private static final String TAG = JSPackagerClient.class.getSimpleName();\n\n  final public void onRequest(@Nullable Object params, Responder responder) {\n    responder.error(\"Request is not supported\");\n    FLog.e(TAG, \"Request is not supported\");\n  }\n  abstract public void onNotification(@Nullable Object params);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/packagerconnection/PackagerConnectionSettings.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.packagerconnection;\n\nimport javax.annotation.Nullable;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.preference.PreferenceManager;\nimport android.text.TextUtils;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.modules.systeminfo.AndroidInfoHelpers;\n\npublic class PackagerConnectionSettings {\n  private static final String TAG = PackagerConnectionSettings.class.getSimpleName();\n  private static final String PREFS_DEBUG_SERVER_HOST_KEY = \"debug_http_host\";\n\n  private final SharedPreferences mPreferences;\n  private final String mPackageName;\n\n  public PackagerConnectionSettings(Context applicationContext) {\n    mPreferences = PreferenceManager.getDefaultSharedPreferences(applicationContext);\n    mPackageName = applicationContext.getPackageName();\n  }\n\n  public String getDebugServerHost() {\n    // Check host setting first. If empty try to detect emulator type and use default\n    // hostname for those\n    String hostFromSettings = mPreferences.getString(PREFS_DEBUG_SERVER_HOST_KEY, null);\n\n    if (!TextUtils.isEmpty(hostFromSettings)) {\n      return Assertions.assertNotNull(hostFromSettings);\n    }\n\n    String host = AndroidInfoHelpers.getServerHost();\n\n    if (host.equals(AndroidInfoHelpers.DEVICE_LOCALHOST)) {\n      FLog.w(\n        TAG,\n        \"You seem to be running on device. Run 'adb reverse tcp:8081 tcp:8081' \" +\n          \"to forward the debug server's port to the device.\");\n    }\n\n    return host;\n  }\n\n  public String getInspectorServerHost() {\n    return AndroidInfoHelpers.getInspectorProxyHost();\n  }\n\n  public @Nullable String getPackageName() {\n    return mPackageName;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\n\npackage com.facebook.react.packagerconnection;\n\nimport javax.annotation.Nullable;\n\nimport java.io.IOException;\nimport java.nio.channels.ClosedChannelException;\nimport java.util.concurrent.TimeUnit;\n\nimport android.os.Handler;\nimport android.os.Looper;\n\nimport com.facebook.common.logging.FLog;\n\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\nimport okhttp3.WebSocket;\nimport okhttp3.WebSocketListener;\nimport okio.ByteString;\n\n/**\n * A wrapper around WebSocketClient that reconnects automatically\n */\nfinal public class ReconnectingWebSocket extends WebSocketListener {\n  private static final String TAG = ReconnectingWebSocket.class.getSimpleName();\n\n  private static final int RECONNECT_DELAY_MS = 2000;\n\n  public interface MessageCallback {\n    void onMessage(String text);\n    void onMessage(ByteString bytes);\n  }\n\n  public interface ConnectionCallback {\n    void onConnected();\n    void onDisconnected();\n  }\n\n  private final String mUrl;\n  private final Handler mHandler;\n  private boolean mClosed = false;\n  private boolean mSuppressConnectionErrors;\n  private @Nullable WebSocket mWebSocket;\n  private @Nullable MessageCallback mMessageCallback;\n  private @Nullable ConnectionCallback mConnectionCallback;\n\n  public ReconnectingWebSocket(\n      String url,\n      MessageCallback messageCallback,\n      ConnectionCallback connectionCallback) {\n    super();\n    mUrl = url;\n    mMessageCallback = messageCallback;\n    mConnectionCallback = connectionCallback;\n    mHandler = new Handler(Looper.getMainLooper());\n  }\n\n  public void connect() {\n    if (mClosed) {\n      throw new IllegalStateException(\"Can't connect closed client\");\n    }\n\n    OkHttpClient httpClient = new OkHttpClient.Builder()\n      .connectTimeout(10, TimeUnit.SECONDS)\n      .writeTimeout(10, TimeUnit.SECONDS)\n      .readTimeout(0, TimeUnit.MINUTES) // Disable timeouts for read\n      .build();\n\n    Request request = new Request.Builder().url(mUrl).build();\n    httpClient.newWebSocket(request, this);\n  }\n\n  private synchronized void delayedReconnect() {\n    // check that we haven't been closed in the meantime\n    if (!mClosed) {\n      connect();\n    }\n  }\n\n  private void reconnect() {\n    if (mClosed) {\n      throw new IllegalStateException(\"Can't reconnect closed client\");\n    }\n\n    if (!mSuppressConnectionErrors) {\n      FLog.w(TAG, \"Couldn't connect to \\\"\" + mUrl + \"\\\", will silently retry\");\n      mSuppressConnectionErrors = true;\n    }\n\n    mHandler.postDelayed(\n      new Runnable() {\n        @Override\n        public void run() {\n          delayedReconnect();\n        }\n      },\n      RECONNECT_DELAY_MS);\n  }\n\n  public void closeQuietly() {\n    mClosed = true;\n    closeWebSocketQuietly();\n    mMessageCallback = null;\n\n    if (mConnectionCallback != null) {\n      mConnectionCallback.onDisconnected();\n    }\n  }\n\n  private void closeWebSocketQuietly() {\n    if (mWebSocket != null) {\n      try {\n        mWebSocket.close(1000, \"End of session\");\n      } catch (Exception e) {\n        // swallow, no need to handle it here\n      }\n      mWebSocket = null;\n    }\n  }\n\n  private void abort(String message, Throwable cause) {\n    FLog.e(TAG, \"Error occurred, shutting down websocket connection: \" + message, cause);\n    closeWebSocketQuietly();\n  }\n\n  @Override\n  public synchronized void onOpen(WebSocket webSocket, Response response) {\n    mWebSocket = webSocket;\n    mSuppressConnectionErrors = false;\n\n    if (mConnectionCallback != null) {\n      mConnectionCallback.onConnected();\n    }\n  }\n\n  @Override\n  public synchronized void onFailure(WebSocket webSocket, Throwable t, Response response) {\n    if (mWebSocket != null) {\n      abort(\"Websocket exception\", t);\n    }\n    if (!mClosed) {\n      if (mConnectionCallback != null) {\n        mConnectionCallback.onDisconnected();\n      }\n      reconnect();\n    }\n  }\n\n  @Override\n  public synchronized void onMessage(WebSocket webSocket, String text) {\n    if (mMessageCallback != null) {\n      mMessageCallback.onMessage(text);\n    }\n  }\n\n  @Override\n  public synchronized void onMessage(WebSocket webSocket, ByteString bytes) {\n    if (mMessageCallback != null) {\n      mMessageCallback.onMessage(bytes);\n    }\n  }\n\n  @Override\n  public synchronized void onClosed(WebSocket webSocket, int code, String reason) {\n    mWebSocket = null;\n    if (!mClosed) {\n      if (mConnectionCallback != null) {\n        mConnectionCallback.onDisconnected();\n      }\n      reconnect();\n    }\n  }\n\n  public synchronized void sendMessage(String message) throws IOException {\n    if (mWebSocket != null) {\n      mWebSocket.send(message);\n    } else {\n      throw new ClosedChannelException();\n    }\n  }\n\n  public synchronized void sendMessage(ByteString message) throws IOException {\n    if (mWebSocket != null) {\n      mWebSocket.send(message);\n    } else {\n      throw new ClosedChannelException();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/packagerconnection/RequestHandler.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\n\npackage com.facebook.react.packagerconnection;\n\nimport javax.annotation.Nullable;\n\npublic interface RequestHandler {\n  void onRequest(@Nullable Object params, Responder responder);\n  void onNotification(@Nullable Object params);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/packagerconnection/RequestOnlyHandler.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\n\npackage com.facebook.react.packagerconnection;\n\nimport javax.annotation.Nullable;\n\nimport com.facebook.common.logging.FLog;\n\npublic abstract class RequestOnlyHandler implements RequestHandler {\n  private static final String TAG = JSPackagerClient.class.getSimpleName();\n\n  abstract public void onRequest(@Nullable Object params, Responder responder);\n  final public void onNotification(@Nullable Object params) {\n    FLog.e(TAG, \"Notification is not supported\");\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/packagerconnection/Responder.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\n\npackage com.facebook.react.packagerconnection;\n\npublic interface Responder {\n  void respond(Object result);\n  void error(Object error);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/packagerconnection/SamplingProfilerPackagerMethod.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.packagerconnection;\n\nimport javax.annotation.Nullable;\n\nimport android.os.Looper;\n\nimport com.facebook.jni.HybridData;\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.soloader.SoLoader;\n\npublic class SamplingProfilerPackagerMethod extends RequestOnlyHandler {\n  static {\n    SoLoader.loadLibrary(\"packagerconnectionjnifb\");\n  }\n\n  final private static class SamplingProfilerJniMethod {\n\n    @DoNotStrip\n    private final HybridData mHybridData;\n\n    public SamplingProfilerJniMethod(long javaScriptContext) {\n      if (Looper.myLooper() == null) {\n        Looper.prepare();\n      }\n\n      mHybridData = initHybrid(javaScriptContext);\n    }\n\n    @DoNotStrip\n    private native void poke(Responder responder);\n\n    @DoNotStrip\n    private static native HybridData initHybrid(long javaScriptContext);\n  }\n\n  private SamplingProfilerJniMethod mJniMethod;\n\n  public SamplingProfilerPackagerMethod(long javaScriptContext) {\n    mJniMethod = new SamplingProfilerJniMethod(javaScriptContext);\n  }\n\n  @Override\n  public void onRequest(@Nullable Object params, Responder responder) {\n    mJniMethod.poke(responder);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/processing/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\njava_annotation_processor(\n    name = \"processing\",\n    does_not_affect_abi = True,\n    processor_class = \"com.facebook.react.processing.ReactPropertyProcessor\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        \":processing-lib\",\n    ],\n)\n\njava_library(\n    name = \"processing-lib\",\n    srcs = glob([\"*.java\"]),\n    source = \"7\",\n    target = \"7\",\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/javapoet:javapoet\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/processing/ReactPropertyProcessor.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.processing;\n\nimport static javax.lang.model.element.Modifier.ABSTRACT;\nimport static javax.lang.model.element.Modifier.PRIVATE;\nimport static javax.lang.model.element.Modifier.PUBLIC;\nimport static javax.tools.Diagnostic.Kind.ERROR;\nimport static javax.tools.Diagnostic.Kind.WARNING;\n\nimport com.facebook.infer.annotation.SuppressFieldNotInitialized;\nimport com.facebook.react.bridge.Dynamic;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport com.facebook.react.uimanager.annotations.ReactPropertyHolder;\nimport com.squareup.javapoet.ClassName;\nimport com.squareup.javapoet.CodeBlock;\nimport com.squareup.javapoet.JavaFile;\nimport com.squareup.javapoet.MethodSpec;\nimport com.squareup.javapoet.ParameterizedTypeName;\nimport com.squareup.javapoet.TypeName;\nimport com.squareup.javapoet.TypeSpec;\nimport com.squareup.javapoet.TypeVariableName;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport javax.annotation.Nullable;\nimport javax.annotation.processing.AbstractProcessor;\nimport javax.annotation.processing.Filer;\nimport javax.annotation.processing.Messager;\nimport javax.annotation.processing.ProcessingEnvironment;\nimport javax.annotation.processing.RoundEnvironment;\nimport javax.annotation.processing.SupportedAnnotationTypes;\nimport javax.annotation.processing.SupportedSourceVersion;\nimport javax.lang.model.SourceVersion;\nimport javax.lang.model.element.Element;\nimport javax.lang.model.element.ElementKind;\nimport javax.lang.model.element.ExecutableElement;\nimport javax.lang.model.element.TypeElement;\nimport javax.lang.model.element.VariableElement;\nimport javax.lang.model.type.TypeMirror;\nimport javax.lang.model.util.Elements;\nimport javax.lang.model.util.Types;\n\n/**\n * This annotation processor crawls subclasses of ReactShadowNode and ViewManager and finds their\n * exported properties with the @ReactProp or @ReactGroupProp annotation. It generates a class\n * per shadow node/view manager that is named {@code <classname>$$PropSetter}. This class contains methods\n * to retrieve the name and type of all methods and a way to set these properties without\n * reflection.\n */\n@SupportedAnnotationTypes(\"com.facebook.react.uimanager.annotations.ReactPropertyHolder\")\n@SupportedSourceVersion(SourceVersion.RELEASE_7)\npublic class ReactPropertyProcessor extends AbstractProcessor {\n  private static final Map<TypeName, String> DEFAULT_TYPES;\n  private static final Set<TypeName> BOXED_PRIMITIVES;\n\n  private static final TypeName PROPS_TYPE =\n      ClassName.get(\"com.facebook.react.uimanager\", \"ReactStylesDiffMap\");\n  private static final TypeName STRING_TYPE = TypeName.get(String.class);\n  private static final TypeName READABLE_MAP_TYPE = TypeName.get(ReadableMap.class);\n  private static final TypeName READABLE_ARRAY_TYPE = TypeName.get(ReadableArray.class);\n  private static final TypeName DYNAMIC_TYPE = TypeName.get(Dynamic.class);\n\n  private static final TypeName VIEW_MANAGER_TYPE =\n      ClassName.get(\"com.facebook.react.uimanager\", \"ViewManager\");\n  private static final TypeName SHADOW_NODE_IMPL_TYPE =\n      ClassName.get(\"com.facebook.react.uimanager\", \"ReactShadowNodeImpl\");\n\n  private static final ClassName VIEW_MANAGER_SETTER_TYPE =\n      ClassName.get(\n          \"com.facebook.react.uimanager\",\n          \"ViewManagerPropertyUpdater\",\n          \"ViewManagerSetter\");\n  private static final ClassName SHADOW_NODE_SETTER_TYPE =\n      ClassName.get(\n          \"com.facebook.react.uimanager\",\n          \"ViewManagerPropertyUpdater\",\n          \"ShadowNodeSetter\");\n\n  private static final TypeName PROPERTY_MAP_TYPE =\n      ParameterizedTypeName.get(Map.class, String.class, String.class);\n  private static final TypeName CONCRETE_PROPERTY_MAP_TYPE =\n      ParameterizedTypeName.get(HashMap.class, String.class, String.class);\n\n  private final Map<ClassName, ClassInfo> mClasses;\n\n  @SuppressFieldNotInitialized\n  private Filer mFiler;\n  @SuppressFieldNotInitialized\n  private Messager mMessager;\n  @SuppressFieldNotInitialized\n  private Elements mElements;\n  @SuppressFieldNotInitialized\n  private Types mTypes;\n\n  static {\n    DEFAULT_TYPES = new HashMap<>();\n\n    // Primitives\n    DEFAULT_TYPES.put(TypeName.BOOLEAN, \"boolean\");\n    DEFAULT_TYPES.put(TypeName.DOUBLE, \"number\");\n    DEFAULT_TYPES.put(TypeName.FLOAT, \"number\");\n    DEFAULT_TYPES.put(TypeName.INT, \"number\");\n\n    // Boxed primitives\n    DEFAULT_TYPES.put(TypeName.BOOLEAN.box(), \"boolean\");\n    DEFAULT_TYPES.put(TypeName.INT.box(), \"number\");\n\n    // Class types\n    DEFAULT_TYPES.put(STRING_TYPE, \"String\");\n    DEFAULT_TYPES.put(READABLE_ARRAY_TYPE, \"Array\");\n    DEFAULT_TYPES.put(READABLE_MAP_TYPE, \"Map\");\n    DEFAULT_TYPES.put(DYNAMIC_TYPE, \"Dynamic\");\n\n    BOXED_PRIMITIVES = new HashSet<>();\n    BOXED_PRIMITIVES.add(TypeName.BOOLEAN.box());\n    BOXED_PRIMITIVES.add(TypeName.FLOAT.box());\n    BOXED_PRIMITIVES.add(TypeName.INT.box());\n  }\n\n  public ReactPropertyProcessor() {\n    mClasses = new HashMap<>();\n  }\n\n  @Override\n  public synchronized void init(ProcessingEnvironment processingEnv) {\n    super.init(processingEnv);\n\n    mFiler = processingEnv.getFiler();\n    mMessager = processingEnv.getMessager();\n    mElements = processingEnv.getElementUtils();\n    mTypes = processingEnv.getTypeUtils();\n  }\n\n  @Override\n  public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {\n    // Clear properties from previous rounds\n    mClasses.clear();\n\n    Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith(ReactPropertyHolder.class);\n    for (Element element : elements) {\n      try {\n        TypeElement classType = (TypeElement) element;\n        ClassName className = ClassName.get(classType);\n        mClasses.put(className, parseClass(className, classType));\n      } catch (Exception e) {\n        error(element, e.getMessage());\n      }\n    }\n\n    for (ClassInfo classInfo : mClasses.values()) {\n      try {\n        if (!shouldIgnoreClass(classInfo)) {\n          // Sort by name\n          Collections.sort(\n              classInfo.mProperties, new Comparator<PropertyInfo>() {\n                @Override\n                public int compare(PropertyInfo a, PropertyInfo b) {\n                  return a.mProperty.name().compareTo(b.mProperty.name());\n                }\n              });\n          generateCode(classInfo, classInfo.mProperties);\n        } else if (shouldWarnClass(classInfo)) {\n          warning(classInfo.mElement, \"Class was skipped. Classes need to be non-private.\");\n        }\n      } catch (IOException e) {\n        error(e.getMessage());\n      } catch (ReactPropertyException e) {\n        error(e.element, e.getMessage());\n      } catch (Exception e) {\n        error(classInfo.mElement, e.getMessage());\n      }\n    }\n\n    return true;\n  }\n\n  private boolean isShadowNodeType(TypeName typeName) {\n    return typeName.equals(SHADOW_NODE_IMPL_TYPE);\n  }\n\n  private ClassInfo parseClass(ClassName className, TypeElement typeElement) {\n    TypeName targetType = getTargetType(typeElement.asType());\n    TypeName viewType = isShadowNodeType(targetType) ? null : targetType;\n\n    ClassInfo classInfo = new ClassInfo(className, typeElement, viewType);\n    findProperties(classInfo, typeElement);\n\n    return classInfo;\n  }\n\n  private void findProperties(ClassInfo classInfo, TypeElement typeElement) {\n    PropertyInfo.Builder propertyBuilder = new PropertyInfo.Builder(mTypes, mElements, classInfo);\n\n    // Recursively search class hierarchy\n    while (typeElement != null) {\n      for (Element element : typeElement.getEnclosedElements()) {\n        ReactProp prop = element.getAnnotation(ReactProp.class);\n        ReactPropGroup propGroup = element.getAnnotation(ReactPropGroup.class);\n\n        try {\n          if (prop != null || propGroup != null) {\n            checkElement(element);\n          }\n\n          if (prop != null) {\n            classInfo.addProperty(propertyBuilder.build(element, new RegularProperty(prop)));\n          } else if (propGroup != null) {\n            for (int i = 0, size = propGroup.names().length; i < size; i++) {\n              classInfo\n                  .addProperty(propertyBuilder.build(element, new GroupProperty(propGroup, i)));\n            }\n          }\n        } catch (ReactPropertyException e) {\n          error(e.element, e.getMessage());\n        }\n      }\n\n      typeElement = (TypeElement) mTypes.asElement(typeElement.getSuperclass());\n    }\n  }\n\n  private TypeName getTargetType(TypeMirror mirror) {\n    TypeName typeName = TypeName.get(mirror);\n    if (typeName instanceof ParameterizedTypeName) {\n      ParameterizedTypeName parameterizedTypeName = (ParameterizedTypeName) typeName;\n      if (parameterizedTypeName.rawType.equals(VIEW_MANAGER_TYPE)) {\n        return parameterizedTypeName.typeArguments.get(0);\n      }\n    } else if (isShadowNodeType(typeName)) {\n      return SHADOW_NODE_IMPL_TYPE;\n    } else if (typeName.equals(TypeName.OBJECT)) {\n      throw new IllegalArgumentException(\"Could not find target type \" + typeName);\n    }\n\n    List<? extends TypeMirror> types = mTypes.directSupertypes(mirror);\n    return getTargetType(types.get(0));\n  }\n\n  private void generateCode(ClassInfo classInfo, List<PropertyInfo> properties)\n      throws IOException, ReactPropertyException {\n    MethodSpec getMethods = MethodSpec.methodBuilder(\"getProperties\")\n        .addModifiers(PUBLIC)\n        .addAnnotation(Override.class)\n        .addParameter(PROPERTY_MAP_TYPE, \"props\")\n        .returns(TypeName.VOID)\n        .addCode(generateGetProperties(properties))\n        .build();\n\n    TypeName superType = getSuperType(classInfo);\n    ClassName className = classInfo.mClassName;\n\n    String holderClassName =\n        getClassName((TypeElement) classInfo.mElement, className.packageName()) + \"$$PropsSetter\";\n    TypeSpec holderClass = TypeSpec.classBuilder(holderClassName)\n        .addSuperinterface(superType)\n        .addModifiers(PUBLIC)\n        .addMethod(generateSetPropertySpec(classInfo, properties))\n        .addMethod(getMethods)\n        .build();\n\n    JavaFile javaFile = JavaFile.builder(className.packageName(), holderClass)\n        .addFileComment(\"Generated by \" + getClass().getName())\n        .build();\n\n    javaFile.writeTo(mFiler);\n  }\n\n  private String getClassName(TypeElement type, String packageName) {\n    int packageLen = packageName.length() + 1;\n    return type.getQualifiedName().toString().substring(packageLen).replace('.', '$');\n  }\n\n  private static TypeName getSuperType(ClassInfo classInfo) {\n    switch (classInfo.getType()) {\n      case VIEW_MANAGER:\n        return ParameterizedTypeName.get(\n            VIEW_MANAGER_SETTER_TYPE,\n            classInfo.mClassName,\n            classInfo.mViewType);\n      case SHADOW_NODE:\n        return ParameterizedTypeName.get(SHADOW_NODE_SETTER_TYPE, classInfo.mClassName);\n      default:\n        throw new IllegalArgumentException();\n    }\n  }\n\n  private static MethodSpec generateSetPropertySpec(\n      ClassInfo classInfo,\n      List<PropertyInfo> properties) {\n    MethodSpec.Builder builder = MethodSpec.methodBuilder(\"setProperty\")\n        .addModifiers(PUBLIC)\n        .addAnnotation(Override.class)\n        .returns(TypeName.VOID);\n\n    switch (classInfo.getType()) {\n      case VIEW_MANAGER:\n        builder\n            .addParameter(classInfo.mClassName, \"manager\")\n            .addParameter(classInfo.mViewType, \"view\");\n        break;\n      case SHADOW_NODE:\n        builder\n            .addParameter(classInfo.mClassName, \"node\");\n        break;\n    }\n\n    return builder\n        .addParameter(STRING_TYPE, \"name\")\n        .addParameter(PROPS_TYPE, \"props\")\n        .addCode(generateSetProperty(classInfo, properties))\n        .build();\n  }\n\n  private static CodeBlock generateSetProperty(ClassInfo info, List<PropertyInfo> properties) {\n    if (properties.isEmpty()) {\n      return CodeBlock.builder().build();\n    }\n\n    CodeBlock.Builder builder = CodeBlock.builder();\n\n    builder.add(\"switch (name) {\\n\").indent();\n    for (int i = 0, size = properties.size(); i < size; i++) {\n      PropertyInfo propertyInfo = properties.get(i);\n      builder\n          .add(\"case \\\"$L\\\":\\n\", propertyInfo.mProperty.name())\n          .indent();\n\n      switch (info.getType()) {\n        case VIEW_MANAGER:\n          builder.add(\"manager.$L(view, \", propertyInfo.methodName);\n          break;\n        case SHADOW_NODE:\n          builder.add(\"node.$L(\", propertyInfo.methodName);\n          break;\n      }\n      if (propertyInfo.mProperty instanceof GroupProperty) {\n        builder.add(\"$L, \", ((GroupProperty) propertyInfo.mProperty).mGroupIndex);\n      }\n      if (BOXED_PRIMITIVES.contains(propertyInfo.propertyType)) {\n        builder.add(\"props.isNull(name) ? null : \");\n      }\n      getPropertyExtractor(propertyInfo, builder);\n      builder.addStatement(\")\");\n\n      builder\n          .addStatement(\"break\")\n          .unindent();\n    }\n    builder.unindent().add(\"}\\n\");\n\n    return builder.build();\n  }\n\n  private static CodeBlock.Builder getPropertyExtractor(\n      PropertyInfo info,\n      CodeBlock.Builder builder) {\n    TypeName propertyType = info.propertyType;\n    if (propertyType.equals(STRING_TYPE)) {\n      return builder.add(\"props.getString(name)\");\n    } else if (propertyType.equals(READABLE_ARRAY_TYPE)) {\n      return builder.add(\"props.getArray(name)\");\n    } else if (propertyType.equals(READABLE_MAP_TYPE)) {\n      return builder.add(\"props.getMap(name)\");\n    } else if (propertyType.equals(DYNAMIC_TYPE)) {\n      return builder.add(\"props.getDynamic(name)\");\n    }\n\n    if (BOXED_PRIMITIVES.contains(propertyType)) {\n      propertyType = propertyType.unbox();\n    }\n\n    if (propertyType.equals(TypeName.BOOLEAN)) {\n      return builder.add(\"props.getBoolean(name, $L)\", info.mProperty.defaultBoolean());\n    } if (propertyType.equals(TypeName.DOUBLE)) {\n      double defaultDouble = info.mProperty.defaultDouble();\n      if (Double.isNaN(defaultDouble)) {\n        return builder.add(\"props.getDouble(name, $T.NaN)\", Double.class);\n      } else {\n        return builder.add(\"props.getDouble(name, $Lf)\", defaultDouble);\n      }\n    }\n    if (propertyType.equals(TypeName.FLOAT)) {\n      float defaultFloat = info.mProperty.defaultFloat();\n      if (Float.isNaN(defaultFloat)) {\n        return builder.add(\"props.getFloat(name, $T.NaN)\", Float.class);\n      } else {\n        return builder.add(\"props.getFloat(name, $Lf)\", defaultFloat);\n      }\n    }\n    if (propertyType.equals(TypeName.INT)) {\n      return builder.add(\"props.getInt(name, $L)\", info.mProperty.defaultInt());\n    }\n\n    throw new IllegalArgumentException();\n  }\n\n  private static CodeBlock generateGetProperties(List<PropertyInfo> properties)\n      throws ReactPropertyException {\n    CodeBlock.Builder builder = CodeBlock.builder();\n    for (PropertyInfo propertyInfo : properties) {\n      try {\n        String typeName = getPropertypTypeName(propertyInfo.mProperty, propertyInfo.propertyType);\n        builder.addStatement(\"props.put($S, $S)\", propertyInfo.mProperty.name(), typeName);\n      } catch (IllegalArgumentException e) {\n        throw new ReactPropertyException(e.getMessage(), propertyInfo);\n      }\n    }\n\n    return builder.build();\n  }\n\n  private static String getPropertypTypeName(Property property, TypeName propertyType) {\n    String defaultType = DEFAULT_TYPES.get(propertyType);\n    String useDefaultType = property instanceof RegularProperty ?\n        ReactProp.USE_DEFAULT_TYPE : ReactPropGroup.USE_DEFAULT_TYPE;\n    return useDefaultType.equals(property.customType()) ? defaultType : property.customType();\n  }\n\n  private static void checkElement(Element element) throws ReactPropertyException {\n    if (element.getKind() == ElementKind.METHOD\n        && element.getModifiers().contains(PUBLIC)) {\n      return;\n    }\n\n    throw new ReactPropertyException(\n        \"@ReactProp and @ReachPropGroup annotation must be on a public method\",\n        element);\n  }\n\n  private static boolean shouldIgnoreClass(ClassInfo classInfo) {\n    return classInfo.mElement.getModifiers().contains(PRIVATE)\n        || classInfo.mElement.getModifiers().contains(ABSTRACT)\n        || classInfo.mViewType instanceof TypeVariableName;\n  }\n\n  private static boolean shouldWarnClass(ClassInfo classInfo) {\n    return classInfo.mElement.getModifiers().contains(PRIVATE);\n  }\n\n  private void error(Element element, String message) {\n    mMessager.printMessage(ERROR, message, element);\n  }\n\n  private void error(String message) {\n    mMessager.printMessage(ERROR, message);\n  }\n\n  private void warning(Element element, String message) {\n    mMessager.printMessage(WARNING, message, element);\n  }\n\n  private interface Property {\n    String name();\n    String customType();\n    double defaultDouble();\n    float defaultFloat();\n    int defaultInt();\n    boolean defaultBoolean();\n  }\n\n  private static class RegularProperty implements Property {\n    private final ReactProp mProp;\n\n    public RegularProperty(ReactProp prop) {\n      mProp = prop;\n    }\n\n    @Override\n    public String name() {\n      return mProp.name();\n    }\n\n    @Override\n    public String customType() {\n      return mProp.customType();\n    }\n\n    @Override\n    public double defaultDouble() {\n      return mProp.defaultDouble();\n    }\n\n    @Override\n    public float defaultFloat() {\n      return mProp.defaultFloat();\n    }\n\n    @Override\n    public int defaultInt() {\n      return mProp.defaultInt();\n    }\n\n    @Override\n    public boolean defaultBoolean() {\n      return mProp.defaultBoolean();\n    }\n  }\n\n  private static class GroupProperty implements Property {\n    private final ReactPropGroup mProp;\n    private final int mGroupIndex;\n\n    public GroupProperty(ReactPropGroup prop, int groupIndex) {\n      mProp = prop;\n      mGroupIndex = groupIndex;\n    }\n\n    @Override\n    public String name() {\n      return mProp.names()[mGroupIndex];\n    }\n\n    @Override\n    public String customType() {\n      return mProp.customType();\n    }\n\n    @Override\n    public double defaultDouble() {\n      return mProp.defaultDouble();\n    }\n\n    @Override\n    public float defaultFloat() {\n      return mProp.defaultFloat();\n    }\n\n    @Override\n    public int defaultInt() {\n      return mProp.defaultInt();\n    }\n\n    @Override\n    public boolean defaultBoolean() {\n      throw new UnsupportedOperationException();\n    }\n  }\n\n  private enum SettableType {\n    VIEW_MANAGER,\n    SHADOW_NODE\n  }\n\n  private static class ClassInfo {\n    public final ClassName mClassName;\n    public final Element mElement;\n    public final @Nullable TypeName mViewType;\n    public final List<PropertyInfo> mProperties;\n\n    public ClassInfo(ClassName className, TypeElement element, @Nullable TypeName viewType) {\n      mClassName = className;\n      mElement = element;\n      mViewType = viewType;\n      mProperties = new ArrayList<>();\n    }\n\n    public SettableType getType() {\n      return mViewType == null ? SettableType.SHADOW_NODE : SettableType.VIEW_MANAGER;\n    }\n\n    public void addProperty(PropertyInfo propertyInfo) throws ReactPropertyException {\n      String name = propertyInfo.mProperty.name();\n      if (checkPropertyExists(name)) {\n        throw new ReactPropertyException(\n            \"Module \" + mClassName + \" has already registered a property named \\\"\" +\n                name + \"\\\". If you want to override a property, don't add\" +\n                \"the @ReactProp annotation to the property in the subclass\", propertyInfo);\n      }\n\n      mProperties.add(propertyInfo);\n    }\n\n    private boolean checkPropertyExists(String name) {\n      for (PropertyInfo propertyInfo : mProperties) {\n        if (propertyInfo.mProperty.name().equals(name)) {\n          return true;\n        }\n      }\n\n      return false;\n    }\n  }\n\n  private static class PropertyInfo {\n    public final String methodName;\n    public final TypeName propertyType;\n    public final Element element;\n    public final Property mProperty;\n\n    private PropertyInfo(\n        String methodName,\n        TypeName propertyType,\n        Element element,\n        Property property) {\n      this.methodName = methodName;\n      this.propertyType = propertyType;\n      this.element = element;\n      mProperty = property;\n    }\n\n    public static class Builder {\n      private final Types mTypes;\n      private final Elements mElements;\n      private final ClassInfo mClassInfo;\n\n      public Builder(Types types, Elements elements, ClassInfo classInfo) {\n        mTypes = types;\n        mElements = elements;\n        mClassInfo = classInfo;\n      }\n\n      public PropertyInfo build(Element element, Property property)\n          throws ReactPropertyException {\n        String methodName = element.getSimpleName().toString();\n\n        ExecutableElement method = (ExecutableElement) element;\n        List<? extends VariableElement> parameters = method.getParameters();\n\n        if (parameters.size() != getArgCount(mClassInfo.getType(), property)) {\n          throw new ReactPropertyException(\"Wrong number of args\", element);\n        }\n\n        int index = 0;\n        if (mClassInfo.getType() == SettableType.VIEW_MANAGER) {\n          TypeMirror mirror = parameters.get(index++).asType();\n          if (!mTypes.isSubtype(mirror, mElements.getTypeElement(\"android.view.View\").asType())) {\n            throw new ReactPropertyException(\"First argument must be a subclass of View\", element);\n          }\n        }\n\n        if (property instanceof GroupProperty) {\n          TypeName indexType = TypeName.get(parameters.get(index++).asType());\n          if (!indexType.equals(TypeName.INT)) {\n            throw new ReactPropertyException(\n                \"Argument \" + index + \" must be an int for @ReactPropGroup\",\n                element);\n          }\n        }\n\n        TypeName propertyType = TypeName.get(parameters.get(index++).asType());\n        if (!DEFAULT_TYPES.containsKey(propertyType)) {\n          throw new ReactPropertyException(\n              \"Argument \" + index + \" must be of a supported type\",\n              element);\n        }\n\n        return new PropertyInfo(methodName, propertyType, element, property);\n      }\n\n      private static int getArgCount(SettableType type, Property property) {\n        int baseCount = type == SettableType.SHADOW_NODE ? 1 : 2;\n        return property instanceof GroupProperty ? baseCount + 1 : baseCount;\n      }\n    }\n  }\n\n  private static class ReactPropertyException extends Exception {\n    public final Element element;\n\n    public ReactPropertyException(String message, PropertyInfo propertyInfo) {\n      super(message);\n      this.element = propertyInfo.element;\n    }\n\n    public ReactPropertyException(String message, Element element) {\n      super(message);\n      this.element = element;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/shell/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"shell\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fresco/fresco-react-native:imagepipeline\"),\n        react_native_dep(\"libraries/soloader/java/com/facebook/soloader:soloader\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react:react\"),\n        react_native_target(\"java/com/facebook/react/animated:animated\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/devsupport:devsupport\"),\n        react_native_target(\"java/com/facebook/react/flat:flat\"),\n        react_native_target(\"java/com/facebook/react/module/model:model\"),\n        react_native_target(\"java/com/facebook/react/modules/accessibilityinfo:accessibilityinfo\"),\n        react_native_target(\"java/com/facebook/react/modules/appstate:appstate\"),\n        react_native_target(\"java/com/facebook/react/modules/blob:blob\"),\n        react_native_target(\"java/com/facebook/react/modules/camera:camera\"),\n        react_native_target(\"java/com/facebook/react/modules/clipboard:clipboard\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/modules/datepicker:datepicker\"),\n        react_native_target(\"java/com/facebook/react/modules/debug:debug\"),\n        react_native_target(\"java/com/facebook/react/modules/dialog:dialog\"),\n        react_native_target(\"java/com/facebook/react/modules/fresco:fresco\"),\n        react_native_target(\"java/com/facebook/react/modules/i18nmanager:i18nmanager\"),\n        react_native_target(\"java/com/facebook/react/modules/image:image\"),\n        react_native_target(\"java/com/facebook/react/modules/intent:intent\"),\n        react_native_target(\"java/com/facebook/react/modules/location:location\"),\n        react_native_target(\"java/com/facebook/react/modules/netinfo:netinfo\"),\n        react_native_target(\"java/com/facebook/react/modules/network:network\"),\n        react_native_target(\"java/com/facebook/react/modules/permissions:permissions\"),\n        react_native_target(\"java/com/facebook/react/modules/share:share\"),\n        react_native_target(\"java/com/facebook/react/modules/statusbar:statusbar\"),\n        react_native_target(\"java/com/facebook/react/modules/storage:storage\"),\n        react_native_target(\"java/com/facebook/react/modules/timepicker:timepicker\"),\n        react_native_target(\"java/com/facebook/react/modules/toast:toast\"),\n        react_native_target(\"java/com/facebook/react/modules/vibration:vibration\"),\n        react_native_target(\"java/com/facebook/react/modules/websocket:websocket\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/views/art:art\"),\n        react_native_target(\"java/com/facebook/react/views/checkbox:checkbox\"),\n        react_native_target(\"java/com/facebook/react/views/drawer:drawer\"),\n        react_native_target(\"java/com/facebook/react/views/image:image\"),\n        react_native_target(\"java/com/facebook/react/views/modal:modal\"),\n        react_native_target(\"java/com/facebook/react/views/picker:picker\"),\n        react_native_target(\"java/com/facebook/react/views/progressbar:progressbar\"),\n        react_native_target(\"java/com/facebook/react/views/scroll:scroll\"),\n        react_native_target(\"java/com/facebook/react/views/slider:slider\"),\n        react_native_target(\"java/com/facebook/react/views/swiperefresh:swiperefresh\"),\n        react_native_target(\"java/com/facebook/react/views/switchview:switchview\"),\n        react_native_target(\"java/com/facebook/react/views/text:text\"),\n        react_native_target(\"java/com/facebook/react/views/text/frescosupport:frescosupport\"),\n        react_native_target(\"java/com/facebook/react/views/textinput:textinput\"),\n        react_native_target(\"java/com/facebook/react/views/toolbar:toolbar\"),\n        react_native_target(\"java/com/facebook/react/views/view:view\"),\n        react_native_target(\"java/com/facebook/react/views/viewpager:viewpager\"),\n        react_native_target(\"java/com/facebook/react/views/webview:webview\"),\n        react_native_target(\"res:shell\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/shell/MainPackageConfig.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.shell;\n\nimport com.facebook.imagepipeline.core.ImagePipelineConfig;\n\n/**\n * Configuration for {@link MainReactPackage}\n */\npublic class MainPackageConfig {\n\n  private ImagePipelineConfig mFrescoConfig;\n\n  private MainPackageConfig(Builder builder) {\n    mFrescoConfig = builder.mFrescoConfig;\n  }\n\n  public ImagePipelineConfig getFrescoConfig() {\n    return mFrescoConfig;\n  }\n\n  public static class Builder {\n\n    private ImagePipelineConfig mFrescoConfig;\n\n    public Builder setFrescoConfig(ImagePipelineConfig frescoConfig) {\n      mFrescoConfig = frescoConfig;\n      return this;\n    }\n\n    public MainPackageConfig build() {\n      return new MainPackageConfig(this);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.shell;\n\nimport android.content.SharedPreferences;\nimport android.preference.PreferenceManager;\nimport com.facebook.react.LazyReactPackage;\nimport com.facebook.react.animated.NativeAnimatedModule;\nimport com.facebook.react.bridge.ModuleSpec;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.flat.FlatARTSurfaceViewManager;\nimport com.facebook.react.flat.RCTImageViewManager;\nimport com.facebook.react.flat.RCTModalHostManager;\nimport com.facebook.react.flat.RCTRawTextManager;\nimport com.facebook.react.flat.RCTTextInlineImageManager;\nimport com.facebook.react.flat.RCTTextInputManager;\nimport com.facebook.react.flat.RCTTextManager;\nimport com.facebook.react.flat.RCTViewManager;\nimport com.facebook.react.flat.RCTViewPagerManager;\nimport com.facebook.react.flat.RCTVirtualTextManager;\nimport com.facebook.react.module.model.ReactModuleInfoProvider;\nimport com.facebook.react.modules.accessibilityinfo.AccessibilityInfoModule;\nimport com.facebook.react.modules.appstate.AppStateModule;\nimport com.facebook.react.modules.blob.BlobModule;\nimport com.facebook.react.modules.camera.CameraRollManager;\nimport com.facebook.react.modules.camera.ImageEditingManager;\nimport com.facebook.react.modules.camera.ImageStoreManager;\nimport com.facebook.react.modules.clipboard.ClipboardModule;\nimport com.facebook.react.modules.datepicker.DatePickerDialogModule;\nimport com.facebook.react.modules.dialog.DialogModule;\nimport com.facebook.react.modules.fresco.FrescoModule;\nimport com.facebook.react.modules.i18nmanager.I18nManagerModule;\nimport com.facebook.react.modules.image.ImageLoaderModule;\nimport com.facebook.react.modules.intent.IntentModule;\nimport com.facebook.react.modules.location.LocationModule;\nimport com.facebook.react.modules.netinfo.NetInfoModule;\nimport com.facebook.react.modules.network.NetworkingModule;\nimport com.facebook.react.modules.permissions.PermissionsModule;\nimport com.facebook.react.modules.share.ShareModule;\nimport com.facebook.react.modules.statusbar.StatusBarModule;\nimport com.facebook.react.modules.storage.AsyncStorageModule;\nimport com.facebook.react.modules.timepicker.TimePickerDialogModule;\nimport com.facebook.react.modules.toast.ToastModule;\nimport com.facebook.react.modules.vibration.VibrationModule;\nimport com.facebook.react.modules.websocket.WebSocketModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.views.art.ARTRenderableViewManager;\nimport com.facebook.react.views.art.ARTSurfaceViewManager;\nimport com.facebook.react.views.checkbox.ReactCheckBoxManager;\nimport com.facebook.react.views.drawer.ReactDrawerLayoutManager;\nimport com.facebook.react.views.image.ReactImageManager;\nimport com.facebook.react.views.modal.ReactModalHostManager;\nimport com.facebook.react.views.picker.ReactDialogPickerManager;\nimport com.facebook.react.views.picker.ReactDropdownPickerManager;\nimport com.facebook.react.views.progressbar.ReactProgressBarViewManager;\nimport com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager;\nimport com.facebook.react.views.scroll.ReactHorizontalScrollViewManager;\nimport com.facebook.react.views.scroll.ReactScrollViewManager;\nimport com.facebook.react.views.slider.ReactSliderManager;\nimport com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager;\nimport com.facebook.react.views.switchview.ReactSwitchManager;\nimport com.facebook.react.views.text.ReactRawTextManager;\nimport com.facebook.react.views.text.ReactTextViewManager;\nimport com.facebook.react.views.text.ReactVirtualTextViewManager;\nimport com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager;\nimport com.facebook.react.views.textinput.ReactTextInputManager;\nimport com.facebook.react.views.toolbar.ReactToolbarManager;\nimport com.facebook.react.views.view.ReactViewManager;\nimport com.facebook.react.views.viewpager.ReactViewPagerManager;\nimport com.facebook.react.views.webview.ReactWebViewManager;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\nimport javax.inject.Provider;\n\n/**\n * Package defining basic modules and view managers.\n */\npublic class MainReactPackage extends LazyReactPackage {\n\n  private MainPackageConfig mConfig;\n\n  public MainReactPackage() {\n  }\n\n  /**\n   * Create a new package with configuration\n   */\n  public MainReactPackage(MainPackageConfig config) {\n    mConfig = config;\n  }\n\n  @Override\n  public List<ModuleSpec> getNativeModules(final ReactApplicationContext context) {\n    return Arrays.asList(\n        ModuleSpec.nativeModuleSpec(\n            AccessibilityInfoModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new AccessibilityInfoModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            AppStateModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new AppStateModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            BlobModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new BlobModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            AsyncStorageModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new AsyncStorageModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            CameraRollManager.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new CameraRollManager(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            ClipboardModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new ClipboardModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            DatePickerDialogModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new DatePickerDialogModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            DialogModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new DialogModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            FrescoModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new FrescoModule(\n                    context, true, mConfig != null ? mConfig.getFrescoConfig() : null);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            I18nManagerModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new I18nManagerModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            ImageEditingManager.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new ImageEditingManager(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            ImageLoaderModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new ImageLoaderModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            ImageStoreManager.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new ImageStoreManager(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            IntentModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new IntentModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            LocationModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new LocationModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            NativeAnimatedModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new NativeAnimatedModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            NetworkingModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new NetworkingModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            NetInfoModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new NetInfoModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            PermissionsModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new PermissionsModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            ShareModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new ShareModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            StatusBarModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new StatusBarModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            TimePickerDialogModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new TimePickerDialogModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            ToastModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new ToastModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            VibrationModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new VibrationModule(context);\n              }\n            }),\n        ModuleSpec.nativeModuleSpec(\n            WebSocketModule.class,\n            new Provider<NativeModule>() {\n              @Override\n              public NativeModule get() {\n                return new WebSocketModule(context);\n              }\n            }));\n  }\n\n  @Override\n  public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {\n    List<ViewManager> viewManagers = new ArrayList<>();\n\n    viewManagers.add(ARTRenderableViewManager.createARTGroupViewManager());\n    viewManagers.add(ARTRenderableViewManager.createARTShapeViewManager());\n    viewManagers.add(ARTRenderableViewManager.createARTTextViewManager());\n    viewManagers.add(new ReactCheckBoxManager());\n    viewManagers.add(new ReactDialogPickerManager());\n    viewManagers.add(new ReactDrawerLayoutManager());\n    viewManagers.add(new ReactDropdownPickerManager());\n    viewManagers.add(new ReactHorizontalScrollViewManager());\n    viewManagers.add(new ReactHorizontalScrollContainerViewManager());\n    viewManagers.add(new ReactProgressBarViewManager());\n    viewManagers.add(new ReactScrollViewManager());\n    viewManagers.add(new ReactSliderManager());\n    viewManagers.add(new ReactSwitchManager());\n    viewManagers.add(new ReactToolbarManager());\n    viewManagers.add(new ReactWebViewManager());\n    viewManagers.add(new SwipeRefreshLayoutManager());\n\n    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(reactContext);\n    boolean useFlatUi = preferences.getBoolean(\"flat_uiimplementation\", false);\n    if (useFlatUi) {\n      // Flat managers\n      viewManagers.add(new FlatARTSurfaceViewManager());\n      viewManagers.add(new RCTTextInlineImageManager());\n      viewManagers.add(new RCTImageViewManager());\n      viewManagers.add(new RCTModalHostManager());\n      viewManagers.add(new RCTRawTextManager());\n      viewManagers.add(new RCTTextInputManager());\n      viewManagers.add(new RCTTextManager());\n      viewManagers.add(new RCTViewManager());\n      viewManagers.add(new RCTViewPagerManager());\n      viewManagers.add(new RCTVirtualTextManager());\n    } else {\n      // Native equivalents\n      viewManagers.add(new ARTSurfaceViewManager());\n      viewManagers.add(new FrescoBasedReactTextInlineImageViewManager());\n      viewManagers.add(new ReactImageManager());\n      viewManagers.add(new ReactModalHostManager());\n      viewManagers.add(new ReactRawTextManager());\n      viewManagers.add(new ReactTextInputManager());\n      viewManagers.add(new ReactTextViewManager());\n      viewManagers.add(new ReactViewManager());\n      viewManagers.add(new ReactViewPagerManager());\n      viewManagers.add(new ReactVirtualTextViewManager());\n    }\n\n    return viewManagers;\n  }\n\n  @Override\n  public ReactModuleInfoProvider getReactModuleInfoProvider() {\n    // This has to be done via reflection or we break open source.\n    return LazyReactPackage.getReactModuleInfoProviderViaReflection(this);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/touch/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"touch\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"uimanager\",\n    srcs = glob([\n        \"*.java\",\n        \"debug/*.java\",\n        \"events/*.java\",\n        \"layoutanimation/*.java\",\n    ]),\n    exported_deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    required_for_source_only_abi = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"java/com/facebook/systrace:systrace\"),\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_target(\"java/com/facebook/debug/tags:tags\"),\n        react_native_target(\"java/com/facebook/debug/holder:holder\"),\n        react_native_target(\"java/com/facebook/react/animation:animation\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/modules/i18nmanager:i18nmanager\"),\n        react_native_target(\"java/com/facebook/react/touch:touch\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/uimanager/util:util\"),\n        react_native_target(\"res:uimanager\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager;\n\nimport android.graphics.Color;\nimport android.os.Build;\nimport android.view.View;\nimport android.view.ViewParent;\nimport com.facebook.react.R;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.util.ReactFindViewUtil;\n\n/**\n * Base class that should be suitable for the majority of subclasses of {@link ViewManager}.\n * It provides support for base view properties such as backgroundColor, opacity, etc.\n */\npublic abstract class BaseViewManager<T extends View, C extends LayoutShadowNode>\n    extends ViewManager<T, C> {\n\n  private static final String PROP_BACKGROUND_COLOR = ViewProps.BACKGROUND_COLOR;\n  private static final String PROP_TRANSFORM = \"transform\";\n  private static final String PROP_ELEVATION = \"elevation\";\n  private static final String PROP_Z_INDEX = \"zIndex\";\n  private static final String PROP_RENDER_TO_HARDWARE_TEXTURE = \"renderToHardwareTextureAndroid\";\n  private static final String PROP_ACCESSIBILITY_LABEL = \"accessibilityLabel\";\n  private static final String PROP_ACCESSIBILITY_COMPONENT_TYPE = \"accessibilityComponentType\";\n  private static final String PROP_ACCESSIBILITY_LIVE_REGION = \"accessibilityLiveRegion\";\n  private static final String PROP_IMPORTANT_FOR_ACCESSIBILITY = \"importantForAccessibility\";\n\n  // DEPRECATED\n  private static final String PROP_ROTATION = \"rotation\";\n  private static final String PROP_SCALE_X = \"scaleX\";\n  private static final String PROP_SCALE_Y = \"scaleY\";\n  private static final String PROP_TRANSLATE_X = \"translateX\";\n  private static final String PROP_TRANSLATE_Y = \"translateY\";\n\n  private static final int PERSPECTIVE_ARRAY_INVERTED_CAMERA_DISTANCE_INDEX = 2;\n  private static final float CAMERA_DISTANCE_NORMALIZATION_MULTIPLIER = 5;\n\n  /**\n   * Used to locate views in end-to-end (UI) tests.\n   */\n  public static final String PROP_TEST_ID = \"testID\";\n  public static final String PROP_NATIVE_ID = \"nativeID\";\n\n  private static MatrixMathHelper.MatrixDecompositionContext sMatrixDecompositionContext =\n      new MatrixMathHelper.MatrixDecompositionContext();\n  private static double[] sTransformDecompositionArray = new double[16];\n\n  @ReactProp(name = PROP_BACKGROUND_COLOR, defaultInt = Color.TRANSPARENT, customType = \"Color\")\n  public void setBackgroundColor(T view, int backgroundColor) {\n    view.setBackgroundColor(backgroundColor);\n  }\n\n  @ReactProp(name = PROP_TRANSFORM)\n  public void setTransform(T view, ReadableArray matrix) {\n    if (matrix == null) {\n      resetTransformProperty(view);\n    } else {\n      setTransformProperty(view, matrix);\n    }\n  }\n\n  @ReactProp(name = ViewProps.OPACITY, defaultFloat = 1.f)\n  public void setOpacity(T view, float opacity) {\n    view.setAlpha(opacity);\n  }\n\n  @ReactProp(name = PROP_ELEVATION)\n  public void setElevation(T view, float elevation) {\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n      view.setElevation(PixelUtil.toPixelFromDIP(elevation));\n    }\n    // Do nothing on API < 21\n  }\n\n  @ReactProp(name = PROP_Z_INDEX)\n  public void setZIndex(T view, float zIndex) {\n    int integerZIndex = Math.round(zIndex);\n    ViewGroupManager.setViewZIndex(view, integerZIndex);\n    ViewParent parent = view.getParent();\n    if (parent != null && parent instanceof ReactZIndexedViewGroup) {\n      ((ReactZIndexedViewGroup) parent).updateDrawingOrder();\n    }\n  }\n\n  @ReactProp(name = PROP_RENDER_TO_HARDWARE_TEXTURE)\n  public void setRenderToHardwareTexture(T view, boolean useHWTexture) {\n    view.setLayerType(useHWTexture ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE, null);\n  }\n\n  @ReactProp(name = PROP_TEST_ID)\n  public void setTestId(T view, String testId) {\n    view.setTag(R.id.react_test_id, testId);\n\n    // temporarily set the tag and keyed tags to avoid end to end test regressions\n    view.setTag(testId);\n  }\n\n  @ReactProp(name = PROP_NATIVE_ID)\n  public void setNativeId(T view, String nativeId) {\n    view.setTag(R.id.view_tag_native_id, nativeId);\n    ReactFindViewUtil.notifyViewRendered(view);\n  }\n\n  @ReactProp(name = PROP_ACCESSIBILITY_LABEL)\n  public void setAccessibilityLabel(T view, String accessibilityLabel) {\n    view.setContentDescription(accessibilityLabel);\n  }\n\n  @ReactProp(name = PROP_ACCESSIBILITY_COMPONENT_TYPE)\n  public void setAccessibilityComponentType(T view, String accessibilityComponentType) {\n    AccessibilityHelper.updateAccessibilityComponentType(view, accessibilityComponentType);\n  }\n\n  @ReactProp(name = PROP_IMPORTANT_FOR_ACCESSIBILITY)\n  public void setImportantForAccessibility(T view, String importantForAccessibility) {\n    if (importantForAccessibility == null || importantForAccessibility.equals(\"auto\")) {\n      view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);\n    } else if (importantForAccessibility.equals(\"yes\")) {\n      view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);\n    } else if (importantForAccessibility.equals(\"no\")) {\n      view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);\n    } else if (importantForAccessibility.equals(\"no-hide-descendants\")) {\n      view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);\n    }\n  }\n\n  @Deprecated\n  @ReactProp(name = PROP_ROTATION)\n  public void setRotation(T view, float rotation) {\n    view.setRotation(rotation);\n  }\n\n  @Deprecated\n  @ReactProp(name = PROP_SCALE_X, defaultFloat = 1f)\n  public void setScaleX(T view, float scaleX) {\n    view.setScaleX(scaleX);\n  }\n\n  @Deprecated\n  @ReactProp(name = PROP_SCALE_Y, defaultFloat = 1f)\n  public void setScaleY(T view, float scaleY) {\n    view.setScaleY(scaleY);\n  }\n\n  @Deprecated\n  @ReactProp(name = PROP_TRANSLATE_X, defaultFloat = 0f)\n  public void setTranslateX(T view, float translateX) {\n    view.setTranslationX(PixelUtil.toPixelFromDIP(translateX));\n  }\n\n  @Deprecated\n  @ReactProp(name = PROP_TRANSLATE_Y, defaultFloat = 0f)\n  public void setTranslateY(T view, float translateY) {\n    view.setTranslationY(PixelUtil.toPixelFromDIP(translateY));\n  }\n\n  @ReactProp(name = PROP_ACCESSIBILITY_LIVE_REGION)\n  public void setAccessibilityLiveRegion(T view, String liveRegion) {\n    if (Build.VERSION.SDK_INT >= 19) {\n      if (liveRegion == null || liveRegion.equals(\"none\")) {\n        view.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_NONE);\n      } else if (liveRegion.equals(\"polite\")) {\n        view.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_POLITE);\n      } else if (liveRegion.equals(\"assertive\")) {\n        view.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_ASSERTIVE);\n      }\n    }\n  }\n\n  private static void setTransformProperty(View view, ReadableArray transforms) {\n    TransformHelper.processTransform(transforms, sTransformDecompositionArray);\n    MatrixMathHelper.decomposeMatrix(sTransformDecompositionArray, sMatrixDecompositionContext);\n    view.setTranslationX(\n        PixelUtil.toPixelFromDIP((float) sMatrixDecompositionContext.translation[0]));\n    view.setTranslationY(\n        PixelUtil.toPixelFromDIP((float) sMatrixDecompositionContext.translation[1]));\n    view.setRotation((float) sMatrixDecompositionContext.rotationDegrees[2]);\n    view.setRotationX((float) sMatrixDecompositionContext.rotationDegrees[0]);\n    view.setRotationY((float) sMatrixDecompositionContext.rotationDegrees[1]);\n    view.setScaleX((float) sMatrixDecompositionContext.scale[0]);\n    view.setScaleY((float) sMatrixDecompositionContext.scale[1]);\n\n    double[] perspectiveArray = sMatrixDecompositionContext.perspective;\n\n    if (perspectiveArray.length > PERSPECTIVE_ARRAY_INVERTED_CAMERA_DISTANCE_INDEX) {\n      float invertedCameraDistance = (float) perspectiveArray[PERSPECTIVE_ARRAY_INVERTED_CAMERA_DISTANCE_INDEX];\n      if (invertedCameraDistance == 0) {\n        // Default camera distance, before scale multiplier (1280)\n        invertedCameraDistance = 0.00078125f;\n      }\n      float cameraDistance = -1 / invertedCameraDistance;\n      float scale = DisplayMetricsHolder.getScreenDisplayMetrics().density;\n\n      // The following converts the matrix's perspective to a camera distance\n      // such that the camera perspective looks the same on Android and iOS\n      float normalizedCameraDistance = scale * cameraDistance * CAMERA_DISTANCE_NORMALIZATION_MULTIPLIER;\n      view.setCameraDistance(normalizedCameraDistance);\n\n    }\n  }\n\n  private static void resetTransformProperty(View view) {\n    view.setTranslationX(PixelUtil.toPixelFromDIP(0));\n    view.setTranslationY(PixelUtil.toPixelFromDIP(0));\n    view.setRotation(0);\n    view.setRotationX(0);\n    view.setRotationY(0);\n    view.setScaleX(1);\n    view.setScaleY(1);\n    view.setCameraDistance(0);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport javax.annotation.Nullable;\n\nimport java.lang.reflect.InvocationTargetException;\nimport java.lang.reflect.Method;\n\nimport android.content.Context;\nimport android.os.Build;\nimport android.util.DisplayMetrics;\nimport android.view.Display;\nimport android.view.WindowManager;\n\nimport com.facebook.infer.annotation.Assertions;\n\n/**\n * Holds an instance of the current DisplayMetrics so we don't have to thread it through all the\n * classes that need it.\n * Note: windowDisplayMetrics are deprecated in favor of ScreenDisplayMetrics: window metrics\n * are supposed to return the drawable area but there's no guarantee that they correspond to the\n * actual size of the {@link ReactRootView}. Moreover, they are not consistent with what iOS\n * returns. Screen metrics returns the metrics of the entire screen, is consistent with iOS and\n * should be used instead.\n */\npublic class DisplayMetricsHolder {\n\n  private static @Nullable DisplayMetrics sWindowDisplayMetrics;\n  private static @Nullable DisplayMetrics sScreenDisplayMetrics;\n\n  /**\n   * @deprecated Use {@link #setScreenDisplayMetrics(DisplayMetrics)} instead. See comment above as\n   *    to why this is not correct to use.\n   */\n  public static void setWindowDisplayMetrics(DisplayMetrics displayMetrics) {\n    sWindowDisplayMetrics = displayMetrics;\n  }\n\n  public static void initDisplayMetricsIfNotInitialized(Context context) {\n    if (DisplayMetricsHolder.getScreenDisplayMetrics() != null) {\n      return;\n    }\n    initDisplayMetrics(context);\n  }\n\n  public static void initDisplayMetrics(Context context) {\n    DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();\n    DisplayMetricsHolder.setWindowDisplayMetrics(displayMetrics);\n\n    DisplayMetrics screenDisplayMetrics = new DisplayMetrics();\n    screenDisplayMetrics.setTo(displayMetrics);\n    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);\n    Assertions.assertNotNull(\n        wm,\n        \"WindowManager is null!\");\n    Display display = wm.getDefaultDisplay();\n\n    // Get the real display metrics if we are using API level 17 or higher.\n    // The real metrics include system decor elements (e.g. soft menu bar).\n    //\n    // See: http://developer.android.com/reference/android/view/Display.html#getRealMetrics(android.util.DisplayMetrics)\n    if (Build.VERSION.SDK_INT >= 17) {\n      display.getRealMetrics(screenDisplayMetrics);\n    } else {\n      // For 14 <= API level <= 16, we need to invoke getRawHeight and getRawWidth to get the real dimensions.\n      // Since react-native only supports API level 16+ we don't have to worry about other cases.\n      //\n      // Reflection exceptions are rethrown at runtime.\n      //\n      // See: http://stackoverflow.com/questions/14341041/how-to-get-real-screen-height-and-width/23861333#23861333\n      try {\n        Method mGetRawH = Display.class.getMethod(\"getRawHeight\");\n        Method mGetRawW = Display.class.getMethod(\"getRawWidth\");\n        screenDisplayMetrics.widthPixels = (Integer) mGetRawW.invoke(display);\n        screenDisplayMetrics.heightPixels = (Integer) mGetRawH.invoke(display);\n      } catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException e) {\n        throw new RuntimeException(\"Error getting real dimensions for API level < 17\", e);\n      }\n    }\n    DisplayMetricsHolder.setScreenDisplayMetrics(screenDisplayMetrics);\n  }\n\n  /**\n   * @deprecated Use {@link #getScreenDisplayMetrics()} instead. See comment above as to why this\n   *    is not correct to use.\n   */\n  @Deprecated\n  public static DisplayMetrics getWindowDisplayMetrics() {\n    return sWindowDisplayMetrics;\n  }\n\n  public static void setScreenDisplayMetrics(DisplayMetrics screenDisplayMetrics) {\n    sScreenDisplayMetrics = screenDisplayMetrics;\n  }\n\n  public static DisplayMetrics getScreenDisplayMetrics() {\n    return sScreenDisplayMetrics;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/FloatUtil.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\npublic class FloatUtil {\n\n  private static final float EPSILON = .00001f;\n\n  public static boolean floatsEqual(float f1, float f2) {\n    if (Float.isNaN(f1) || Float.isNaN(f2)) {\n      return Float.isNaN(f1) && Float.isNaN(f2);\n    }\n    return Math.abs(f2 - f1) < EPSILON;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/GuardedFrameCallback.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.modules.core.ChoreographerCompat;\n\n/**\n * Abstract base for a Choreographer FrameCallback that should have any RuntimeExceptions it throws\n * handled by the {@link com.facebook.react.bridge.NativeModuleCallExceptionHandler} registered if\n * the app is in dev mode.\n */\npublic abstract class GuardedFrameCallback extends ChoreographerCompat.FrameCallback {\n\n  private final ReactContext mReactContext;\n\n  protected GuardedFrameCallback(ReactContext reactContext) {\n    mReactContext = reactContext;\n  }\n\n  @Override\n  public final void doFrame(long frameTimeNanos) {\n    try {\n      doFrameGuarded(frameTimeNanos);\n    } catch (RuntimeException e) {\n      mReactContext.handleException(e);\n    }\n  }\n\n  /**\n   * Like the standard doFrame but RuntimeExceptions will be caught and passed to\n   * {@link com.facebook.react.bridge.ReactContext#handleException(RuntimeException)}.\n   */\n  protected abstract void doFrameGuarded(long frameTimeNanos);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.view.MotionEvent;\nimport android.view.ViewGroup;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.uimanager.events.TouchEvent;\nimport com.facebook.react.uimanager.events.TouchEventCoalescingKeyHelper;\nimport com.facebook.react.uimanager.events.TouchEventType;\n\n/**\n * JSTouchDispatcher handles dispatching touches to JS from RootViews.  If you implement RootView\n * you need to call handleTouchEvent from onTouchEvent and onInterceptTouchEvent.  It will correctly\n * find the right view to handle the touch and also dispatch the appropriate event to JS\n */\npublic class JSTouchDispatcher {\n\n  private int mTargetTag = -1;\n  private final float[] mTargetCoordinates = new float[2];\n  private boolean mChildIsHandlingNativeGesture = false;\n  private long mGestureStartTime = TouchEvent.UNSET;\n  private final ViewGroup mRootViewGroup;\n  private final TouchEventCoalescingKeyHelper mTouchEventCoalescingKeyHelper =\n    new TouchEventCoalescingKeyHelper();\n\n  public JSTouchDispatcher(ViewGroup viewGroup) {\n    mRootViewGroup = viewGroup;\n  }\n\n  public void onChildStartedNativeGesture(MotionEvent androidEvent, EventDispatcher eventDispatcher) {\n    if (mChildIsHandlingNativeGesture) {\n      // This means we previously had another child start handling this native gesture and now a\n      // different native parent of that child has decided to intercept the touch stream and handle\n      // the gesture itself. Example where this can happen: HorizontalScrollView in a ScrollView.\n      return;\n    }\n\n    dispatchCancelEvent(androidEvent, eventDispatcher);\n    mChildIsHandlingNativeGesture = true;\n    mTargetTag = -1;\n  }\n\n  /**\n   * Main catalyst view is responsible for collecting and sending touch events to JS. This method\n   * reacts for an incoming android native touch events ({@link MotionEvent}) and calls into\n   * {@link com.facebook.react.uimanager.events.EventDispatcher} when appropriate.\n   * It uses {@link com.facebook.react.uimanager.TouchTargetHelper#findTouchTargetView}\n   * helper method for figuring out a react view ID in the case of ACTION_DOWN\n   * event (when the gesture starts).\n   */\n  public void handleTouchEvent(MotionEvent ev, EventDispatcher eventDispatcher) {\n    int action = ev.getAction() & MotionEvent.ACTION_MASK;\n    if (action == MotionEvent.ACTION_DOWN) {\n      if (mTargetTag != -1) {\n        FLog.e(\n          ReactConstants.TAG,\n          \"Got DOWN touch before receiving UP or CANCEL from last gesture\");\n      }\n\n      // First event for this gesture. We expect tag to be set to -1, and we use helper method\n      // {@link #findTargetTagForTouch} to find react view ID that will be responsible for handling\n      // this gesture\n      mChildIsHandlingNativeGesture = false;\n      mGestureStartTime = ev.getEventTime();\n      mTargetTag = findTargetTagAndSetCoordinates(ev);\n      eventDispatcher.dispatchEvent(\n        TouchEvent.obtain(\n          mTargetTag,\n          TouchEventType.START,\n          ev,\n          mGestureStartTime,\n          mTargetCoordinates[0],\n          mTargetCoordinates[1],\n          mTouchEventCoalescingKeyHelper));\n    } else if (mChildIsHandlingNativeGesture) {\n      // If the touch was intercepted by a child, we've already sent a cancel event to JS for this\n      // gesture, so we shouldn't send any more touches related to it.\n      return;\n    } else if (mTargetTag == -1) {\n      // All the subsequent action types are expected to be called after ACTION_DOWN thus target\n      // is supposed to be set for them.\n      FLog.e(\n        ReactConstants.TAG,\n        \"Unexpected state: received touch event but didn't get starting ACTION_DOWN for this \" +\n          \"gesture before\");\n    } else if (action == MotionEvent.ACTION_UP) {\n      // End of the gesture. We reset target tag to -1 and expect no further event associated with\n      // this gesture.\n      findTargetTagAndSetCoordinates(ev);\n      eventDispatcher.dispatchEvent(\n        TouchEvent.obtain(\n          mTargetTag,\n          TouchEventType.END,\n          ev,\n          mGestureStartTime,\n          mTargetCoordinates[0],\n          mTargetCoordinates[1],\n          mTouchEventCoalescingKeyHelper));\n      mTargetTag = -1;\n      mGestureStartTime = TouchEvent.UNSET;\n    } else if (action == MotionEvent.ACTION_MOVE) {\n      // Update pointer position for current gesture\n      findTargetTagAndSetCoordinates(ev);\n      eventDispatcher.dispatchEvent(\n        TouchEvent.obtain(\n          mTargetTag,\n          TouchEventType.MOVE,\n          ev,\n          mGestureStartTime,\n          mTargetCoordinates[0],\n          mTargetCoordinates[1],\n          mTouchEventCoalescingKeyHelper));\n    } else if (action == MotionEvent.ACTION_POINTER_DOWN) {\n      // New pointer goes down, this can only happen after ACTION_DOWN is sent for the first pointer\n      eventDispatcher.dispatchEvent(\n        TouchEvent.obtain(\n          mTargetTag,\n          TouchEventType.START,\n          ev,\n          mGestureStartTime,\n          mTargetCoordinates[0],\n          mTargetCoordinates[1],\n          mTouchEventCoalescingKeyHelper));\n    } else if (action == MotionEvent.ACTION_POINTER_UP) {\n      // Exactly onw of the pointers goes up\n      eventDispatcher.dispatchEvent(\n        TouchEvent.obtain(\n          mTargetTag,\n          TouchEventType.END,\n          ev,\n          mGestureStartTime,\n          mTargetCoordinates[0],\n          mTargetCoordinates[1],\n          mTouchEventCoalescingKeyHelper));\n    } else if (action == MotionEvent.ACTION_CANCEL) {\n      if (mTouchEventCoalescingKeyHelper.hasCoalescingKey(ev.getDownTime())) {\n        dispatchCancelEvent(ev, eventDispatcher);\n      } else {\n        FLog.e(\n          ReactConstants.TAG,\n          \"Received an ACTION_CANCEL touch event for which we have no corresponding ACTION_DOWN\"\n        );\n      }\n      mTargetTag = -1;\n      mGestureStartTime = TouchEvent.UNSET;\n    } else {\n      FLog.w(\n        ReactConstants.TAG,\n        \"Warning : touch event was ignored. Action=\" + action + \" Target=\" + mTargetTag);\n    }\n  }\n\n  private int findTargetTagAndSetCoordinates(MotionEvent ev) {\n    // This method updates `mTargetCoordinates` with coordinates for the motion event.\n    return TouchTargetHelper.findTargetTagAndCoordinatesForTouch(\n        ev.getX(), ev.getY(), mRootViewGroup, mTargetCoordinates, null);\n  }\n\n  private void dispatchCancelEvent(MotionEvent androidEvent, EventDispatcher eventDispatcher) {\n    // This means the gesture has already ended, via some other CANCEL or UP event. This is not\n    // expected to happen very often as it would mean some child View has decided to intercept the\n    // touch stream and start a native gesture only upon receiving the UP/CANCEL event.\n    if (mTargetTag == -1) {\n      FLog.w(\n        ReactConstants.TAG,\n        \"Can't cancel already finished gesture. Is a child View trying to start a gesture from \" +\n          \"an UP/CANCEL event?\");\n      return;\n    }\n\n    Assertions.assertCondition(\n      !mChildIsHandlingNativeGesture,\n      \"Expected to not have already sent a cancel for this gesture\");\n    Assertions.assertNotNull(eventDispatcher).dispatchEvent(\n      TouchEvent.obtain(\n        mTargetTag,\n        TouchEventType.CANCEL,\n        androidEvent,\n        mGestureStartTime,\n        mTargetCoordinates[0],\n        mTargetCoordinates[1],\n        mTouchEventCoalescingKeyHelper));\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager;\n\nimport com.facebook.react.bridge.Dynamic;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableType;\nimport com.facebook.react.modules.i18nmanager.I18nUtil;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport com.facebook.yoga.YogaAlign;\nimport com.facebook.yoga.YogaConstants;\nimport com.facebook.yoga.YogaDisplay;\nimport com.facebook.yoga.YogaFlexDirection;\nimport com.facebook.yoga.YogaJustify;\nimport com.facebook.yoga.YogaOverflow;\nimport com.facebook.yoga.YogaPositionType;\nimport com.facebook.yoga.YogaUnit;\nimport com.facebook.yoga.YogaWrap;\nimport javax.annotation.Nullable;\n\n/**\n * Supply setters for base view layout properties such as width, height, flex properties, borders,\n * etc.\n *\n * <p>Checking for isVirtual everywhere is a hack to get around the fact that some virtual nodes\n * still have layout properties set on them in JS: for example, a component that returns a <Text>\n * may or may not be embedded in a parent text. There are better solutions that should probably be\n * explored, namely using the VirtualText class in JS and setting the correct set of validAttributes\n */\npublic class LayoutShadowNode extends ReactShadowNodeImpl {\n\n  /**\n   * A Mutable version of com.facebook.yoga.YogaValue\n   */\n  private static class MutableYogaValue {\n    float value;\n    YogaUnit unit;\n\n    void setFromDynamic(Dynamic dynamic) {\n      if (dynamic.isNull()) {\n        unit = YogaUnit.UNDEFINED;\n        value = YogaConstants.UNDEFINED;\n      } else if (dynamic.getType() == ReadableType.String) {\n        final String s = dynamic.asString();\n        if (s.equals(\"auto\")) {\n          unit = YogaUnit.AUTO;\n          value = YogaConstants.UNDEFINED;\n        } else if (s.endsWith(\"%\")) {\n          unit = YogaUnit.PERCENT;\n          value = Float.parseFloat(s.substring(0, s.length() - 1));\n        } else {\n          throw new IllegalArgumentException(\"Unknown value: \" + s);\n        }\n      } else {\n        unit = YogaUnit.POINT;\n        value = PixelUtil.toPixelFromDIP(dynamic.asDouble());\n      }\n    }\n  }\n\n  private final MutableYogaValue mTempYogaValue = new MutableYogaValue();\n\n  @ReactProp(name = ViewProps.WIDTH)\n  public void setWidth(Dynamic width) {\n    if (isVirtual()) {\n      return;\n    }\n\n    mTempYogaValue.setFromDynamic(width);\n    switch (mTempYogaValue.unit) {\n      case POINT:\n      case UNDEFINED:\n        setStyleWidth(mTempYogaValue.value);\n        break;\n      case AUTO:\n        setStyleWidthAuto();\n        break;\n      case PERCENT:\n        setStyleWidthPercent(mTempYogaValue.value);\n        break;\n    }\n\n    width.recycle();\n  }\n\n  @ReactProp(name = ViewProps.MIN_WIDTH)\n  public void setMinWidth(Dynamic minWidth) {\n    if (isVirtual()) {\n      return;\n    }\n\n    mTempYogaValue.setFromDynamic(minWidth);\n    switch (mTempYogaValue.unit) {\n      case POINT:\n      case UNDEFINED:\n        setStyleMinWidth(mTempYogaValue.value);\n        break;\n      case PERCENT:\n        setStyleMinWidthPercent(mTempYogaValue.value);\n        break;\n    }\n\n    minWidth.recycle();\n  }\n\n  @ReactProp(name = ViewProps.MAX_WIDTH)\n  public void setMaxWidth(Dynamic maxWidth) {\n    if (isVirtual()) {\n      return;\n    }\n\n    mTempYogaValue.setFromDynamic(maxWidth);\n    switch (mTempYogaValue.unit) {\n      case POINT:\n      case UNDEFINED:\n        setStyleMaxWidth(mTempYogaValue.value);\n        break;\n      case PERCENT:\n        setStyleMaxWidthPercent(mTempYogaValue.value);\n        break;\n    }\n\n    maxWidth.recycle();\n  }\n\n  @ReactProp(name = ViewProps.HEIGHT)\n  public void setHeight(Dynamic height) {\n    if (isVirtual()) {\n      return;\n    }\n\n    mTempYogaValue.setFromDynamic(height);\n    switch (mTempYogaValue.unit) {\n      case POINT:\n      case UNDEFINED:\n        setStyleHeight(mTempYogaValue.value);\n        break;\n      case AUTO:\n        setStyleHeightAuto();\n        break;\n      case PERCENT:\n        setStyleHeightPercent(mTempYogaValue.value);\n        break;\n    }\n\n    height.recycle();\n  }\n\n  @ReactProp(name = ViewProps.MIN_HEIGHT)\n  public void setMinHeight(Dynamic minHeight) {\n    if (isVirtual()) {\n      return;\n    }\n\n    mTempYogaValue.setFromDynamic(minHeight);\n    switch (mTempYogaValue.unit) {\n      case POINT:\n      case UNDEFINED:\n        setStyleMinHeight(mTempYogaValue.value);\n        break;\n      case PERCENT:\n        setStyleMinHeightPercent(mTempYogaValue.value);\n        break;\n    }\n\n    minHeight.recycle();\n  }\n\n  @ReactProp(name = ViewProps.MAX_HEIGHT)\n  public void setMaxHeight(Dynamic maxHeight) {\n    if (isVirtual()) {\n      return;\n    }\n\n    mTempYogaValue.setFromDynamic(maxHeight);\n    switch (mTempYogaValue.unit) {\n      case POINT:\n      case UNDEFINED:\n        setStyleMaxHeight(mTempYogaValue.value);\n        break;\n      case PERCENT:\n        setStyleMaxHeightPercent(mTempYogaValue.value);\n        break;\n    }\n\n    maxHeight.recycle();\n  }\n\n  @ReactProp(name = ViewProps.FLEX, defaultFloat = 0f)\n  public void setFlex(float flex) {\n    if (isVirtual()) {\n      return;\n    }\n    super.setFlex(flex);\n  }\n\n  @ReactProp(name = ViewProps.FLEX_GROW, defaultFloat = 0f)\n  public void setFlexGrow(float flexGrow) {\n    if (isVirtual()) {\n      return;\n    }\n    super.setFlexGrow(flexGrow);\n  }\n\n  @ReactProp(name = ViewProps.FLEX_SHRINK, defaultFloat = 0f)\n  public void setFlexShrink(float flexShrink) {\n    if (isVirtual()) {\n      return;\n    }\n    super.setFlexShrink(flexShrink);\n  }\n\n  @ReactProp(name = ViewProps.FLEX_BASIS)\n  public void setFlexBasis(Dynamic flexBasis) {\n    if (isVirtual()) {\n      return;\n    }\n\n    mTempYogaValue.setFromDynamic(flexBasis);\n    switch (mTempYogaValue.unit) {\n      case POINT:\n      case UNDEFINED:\n        setFlexBasis(mTempYogaValue.value);\n        break;\n      case AUTO:\n        setFlexBasisAuto();\n        break;\n      case PERCENT:\n        setFlexBasisPercent(mTempYogaValue.value);\n        break;\n    }\n\n    flexBasis.recycle();\n  }\n\n  @ReactProp(name = ViewProps.ASPECT_RATIO, defaultFloat = YogaConstants.UNDEFINED)\n  public void setAspectRatio(float aspectRatio) {\n    setStyleAspectRatio(aspectRatio);\n  }\n\n  @ReactProp(name = ViewProps.FLEX_DIRECTION)\n  public void setFlexDirection(@Nullable String flexDirection) {\n    if (isVirtual()) {\n      return;\n    }\n\n    if (flexDirection == null) {\n      setFlexDirection(YogaFlexDirection.COLUMN);\n      return;\n    }\n\n    switch (flexDirection) {\n      case \"column\": {\n        setFlexDirection(YogaFlexDirection.COLUMN);\n        break;\n      }\n      case \"column-reverse\": {\n        setFlexDirection(YogaFlexDirection.COLUMN_REVERSE);\n        break;\n      }\n      case \"row\": {\n        setFlexDirection(YogaFlexDirection.ROW);\n        break;\n      }\n      case \"row-reverse\": {\n        setFlexDirection(YogaFlexDirection.ROW_REVERSE);\n        break;\n      }\n      default: {\n        throw new JSApplicationIllegalArgumentException(\n            \"invalid value for flexDirection: \" + flexDirection);\n      }\n    }\n  }\n\n  @ReactProp(name = ViewProps.FLEX_WRAP)\n  public void setFlexWrap(@Nullable String flexWrap) {\n    if (isVirtual()) {\n      return;\n    }\n\n    if (flexWrap == null) {\n      setFlexWrap(YogaWrap.NO_WRAP);\n      return;\n    }\n\n    switch (flexWrap) {\n      case \"nowrap\": {\n        setFlexWrap(YogaWrap.NO_WRAP);\n        break;\n      }\n      case \"wrap\": {\n        setFlexWrap(YogaWrap.WRAP);\n        break;\n      }\n      default: {\n        throw new JSApplicationIllegalArgumentException(\n            \"invalid value for flexWrap: \" + flexWrap);\n      }\n    }\n  }\n\n  @ReactProp(name = ViewProps.ALIGN_SELF)\n  public void setAlignSelf(@Nullable String alignSelf) {\n    if (isVirtual()) {\n      return;\n    }\n\n    if (alignSelf == null) {\n      setAlignSelf(YogaAlign.AUTO);\n      return;\n    }\n\n    switch (alignSelf) {\n      case \"auto\": {\n        setAlignSelf(YogaAlign.AUTO);\n        return;\n      }\n      case \"flex-start\": {\n        setAlignSelf(YogaAlign.FLEX_START);\n        return;\n      }\n      case \"center\": {\n        setAlignSelf(YogaAlign.CENTER);\n        return;\n      }\n      case \"flex-end\": {\n        setAlignSelf(YogaAlign.FLEX_END);\n        return;\n      }\n      case \"stretch\": {\n        setAlignSelf(YogaAlign.STRETCH);\n        return;\n      }\n      case \"baseline\": {\n        setAlignSelf(YogaAlign.BASELINE);\n        return;\n      }\n      case \"space-between\": {\n        setAlignSelf(YogaAlign.SPACE_BETWEEN);\n        return;\n      }\n      case \"space-around\": {\n        setAlignSelf(YogaAlign.SPACE_AROUND);\n        return;\n      }\n      default: {\n        throw new JSApplicationIllegalArgumentException(\n            \"invalid value for alignSelf: \" + alignSelf);\n      }\n    }\n  }\n\n  @ReactProp(name = ViewProps.ALIGN_ITEMS)\n  public void setAlignItems(@Nullable String alignItems) {\n    if (isVirtual()) {\n      return;\n    }\n\n    if (alignItems == null) {\n      setAlignItems(YogaAlign.STRETCH);\n      return;\n    }\n\n    switch (alignItems) {\n      case \"auto\": {\n        setAlignItems(YogaAlign.AUTO);\n        return;\n      }\n      case \"flex-start\": {\n        setAlignItems(YogaAlign.FLEX_START);\n        return;\n      }\n      case \"center\": {\n        setAlignItems(YogaAlign.CENTER);\n        return;\n      }\n      case \"flex-end\": {\n        setAlignItems(YogaAlign.FLEX_END);\n        return;\n      }\n      case \"stretch\": {\n        setAlignItems(YogaAlign.STRETCH);\n        return;\n      }\n      case \"baseline\": {\n        setAlignItems(YogaAlign.BASELINE);\n        return;\n      }\n      case \"space-between\": {\n        setAlignItems(YogaAlign.SPACE_BETWEEN);\n        return;\n      }\n      case \"space-around\": {\n        setAlignItems(YogaAlign.SPACE_AROUND);\n        return;\n      }\n      default: {\n        throw new JSApplicationIllegalArgumentException(\n            \"invalid value for alignItems: \" + alignItems);\n      }\n    }\n  }\n\n  @ReactProp(name = ViewProps.ALIGN_CONTENT)\n  public void setAlignContent(@Nullable String alignContent) {\n    if (isVirtual()) {\n      return;\n    }\n\n    if (alignContent == null) {\n      setAlignContent(YogaAlign.FLEX_START);\n      return;\n    }\n\n    switch (alignContent) {\n      case \"auto\": {\n        setAlignContent(YogaAlign.AUTO);\n        return;\n      }\n      case \"flex-start\": {\n        setAlignContent(YogaAlign.FLEX_START);\n        return;\n      }\n      case \"center\": {\n        setAlignContent(YogaAlign.CENTER);\n        return;\n      }\n      case \"flex-end\": {\n        setAlignContent(YogaAlign.FLEX_END);\n        return;\n      }\n      case \"stretch\": {\n        setAlignContent(YogaAlign.STRETCH);\n        return;\n      }\n      case \"baseline\": {\n        setAlignContent(YogaAlign.BASELINE);\n        return;\n      }\n      case \"space-between\": {\n        setAlignContent(YogaAlign.SPACE_BETWEEN);\n        return;\n      }\n      case \"space-around\": {\n        setAlignContent(YogaAlign.SPACE_AROUND);\n        return;\n      }\n      default: {\n        throw new JSApplicationIllegalArgumentException(\n            \"invalid value for alignContent: \" + alignContent);\n      }\n    }\n  }\n\n  @ReactProp(name = ViewProps.JUSTIFY_CONTENT)\n  public void setJustifyContent(@Nullable String justifyContent) {\n    if (isVirtual()) {\n      return;\n    }\n\n    if (justifyContent == null) {\n      setJustifyContent(YogaJustify.FLEX_START);\n      return;\n    }\n\n    switch (justifyContent) {\n      case \"flex-start\": {\n        setJustifyContent(YogaJustify.FLEX_START);\n        break;\n      }\n      case \"center\": {\n        setJustifyContent(YogaJustify.CENTER);\n        break;\n      }\n      case \"flex-end\": {\n        setJustifyContent(YogaJustify.FLEX_END);\n        break;\n      }\n      case \"space-between\": {\n        setJustifyContent(YogaJustify.SPACE_BETWEEN);\n        break;\n      }\n      case \"space-around\": {\n        setJustifyContent(YogaJustify.SPACE_AROUND);\n        break;\n      }\n      case \"space-evenly\": {\n        setJustifyContent(YogaJustify.SPACE_EVENLY);\n        break;\n      }\n      default: {\n        throw new JSApplicationIllegalArgumentException(\n            \"invalid value for justifyContent: \" + justifyContent);\n      }\n    }\n  }\n\n  @ReactProp(name = ViewProps.OVERFLOW)\n  public void setOverflow(@Nullable String overflow) {\n    if (isVirtual()) {\n      return;\n    }\n\n    if (overflow == null) {\n      setOverflow(YogaOverflow.VISIBLE);\n      return;\n    }\n\n    switch (overflow) {\n      case \"visible\": {\n        setOverflow(YogaOverflow.VISIBLE);\n        break;\n      }\n      case \"hidden\": {\n        setOverflow(YogaOverflow.HIDDEN);\n        break;\n      }\n      case \"scroll\": {\n        setOverflow(YogaOverflow.SCROLL);\n        break;\n      }\n      default: {\n        throw new JSApplicationIllegalArgumentException(\n            \"invalid value for overflow: \" + overflow);\n      }\n    }\n  }\n\n  @ReactProp(name = ViewProps.DISPLAY)\n  public void setDisplay(@Nullable String display) {\n    if (isVirtual()) {\n      return;\n    }\n\n    if (display == null) {\n      setDisplay(YogaDisplay.FLEX);\n      return;\n    }\n\n    switch (display) {\n      case \"flex\": {\n        setDisplay(YogaDisplay.FLEX);\n        break;\n      }\n      case \"none\": {\n        setDisplay(YogaDisplay.NONE);\n        break;\n      }\n      default: {\n        throw new JSApplicationIllegalArgumentException(\n            \"invalid value for display: \" + display);\n      }\n    }\n  }\n\n  @ReactPropGroup(\n    names = {\n      ViewProps.MARGIN,\n      ViewProps.MARGIN_VERTICAL,\n      ViewProps.MARGIN_HORIZONTAL,\n      ViewProps.MARGIN_START,\n      ViewProps.MARGIN_END,\n      ViewProps.MARGIN_TOP,\n      ViewProps.MARGIN_BOTTOM,\n      ViewProps.MARGIN_LEFT,\n      ViewProps.MARGIN_RIGHT,\n    }\n  )\n  public void setMargins(int index, Dynamic margin) {\n    if (isVirtual()) {\n      return;\n    }\n\n    int spacingType =\n        maybeTransformLeftRightToStartEnd(ViewProps.PADDING_MARGIN_SPACING_TYPES[index]);\n\n    mTempYogaValue.setFromDynamic(margin);\n    switch (mTempYogaValue.unit) {\n      case POINT:\n      case UNDEFINED:\n        setMargin(spacingType, mTempYogaValue.value);\n        break;\n      case AUTO:\n        setMarginAuto(spacingType);\n        break;\n      case PERCENT:\n        setMarginPercent(spacingType, mTempYogaValue.value);\n        break;\n    }\n\n    margin.recycle();\n  }\n\n  @ReactPropGroup(\n    names = {\n      ViewProps.PADDING,\n      ViewProps.PADDING_VERTICAL,\n      ViewProps.PADDING_HORIZONTAL,\n      ViewProps.PADDING_START,\n      ViewProps.PADDING_END,\n      ViewProps.PADDING_TOP,\n      ViewProps.PADDING_BOTTOM,\n      ViewProps.PADDING_LEFT,\n      ViewProps.PADDING_RIGHT,\n    }\n  )\n  public void setPaddings(int index, Dynamic padding) {\n    if (isVirtual()) {\n      return;\n    }\n\n    int spacingType =\n        maybeTransformLeftRightToStartEnd(ViewProps.PADDING_MARGIN_SPACING_TYPES[index]);\n\n    mTempYogaValue.setFromDynamic(padding);\n    switch (mTempYogaValue.unit) {\n      case POINT:\n      case UNDEFINED:\n        setPadding(spacingType, mTempYogaValue.value);\n        break;\n      case PERCENT:\n        setPaddingPercent(spacingType, mTempYogaValue.value);\n        break;\n    }\n\n    padding.recycle();\n  }\n\n  @ReactPropGroup(\n    names = {\n      ViewProps.BORDER_WIDTH,\n      ViewProps.BORDER_START_WIDTH,\n      ViewProps.BORDER_END_WIDTH,\n      ViewProps.BORDER_TOP_WIDTH,\n      ViewProps.BORDER_BOTTOM_WIDTH,\n      ViewProps.BORDER_LEFT_WIDTH,\n      ViewProps.BORDER_RIGHT_WIDTH,\n    },\n    defaultFloat = YogaConstants.UNDEFINED\n  )\n  public void setBorderWidths(int index, float borderWidth) {\n    if (isVirtual()) {\n      return;\n    }\n    int spacingType = maybeTransformLeftRightToStartEnd(ViewProps.BORDER_SPACING_TYPES[index]);\n    setBorder(spacingType, PixelUtil.toPixelFromDIP(borderWidth));\n  }\n\n  @ReactPropGroup(\n    names = {\n      ViewProps.START,\n      ViewProps.END,\n      ViewProps.LEFT,\n      ViewProps.RIGHT,\n      ViewProps.TOP,\n      ViewProps.BOTTOM,\n    }\n  )\n  public void setPositionValues(int index, Dynamic position) {\n    if (isVirtual()) {\n      return;\n    }\n\n    final int[] POSITION_SPACING_TYPES = {\n      Spacing.START, Spacing.END, Spacing.LEFT, Spacing.RIGHT, Spacing.TOP, Spacing.BOTTOM\n    };\n\n    int spacingType = maybeTransformLeftRightToStartEnd(POSITION_SPACING_TYPES[index]);\n\n    mTempYogaValue.setFromDynamic(position);\n    switch (mTempYogaValue.unit) {\n      case POINT:\n      case UNDEFINED:\n        setPosition(spacingType, mTempYogaValue.value);\n        break;\n      case PERCENT:\n        setPositionPercent(spacingType, mTempYogaValue.value);\n        break;\n    }\n\n    position.recycle();\n  }\n\n  private int maybeTransformLeftRightToStartEnd(int spacingType) {\n    if (!I18nUtil.getInstance().doLeftAndRightSwapInRTL(getThemedContext())) {\n      return spacingType;\n    }\n\n    switch (spacingType) {\n      case Spacing.LEFT:\n        return Spacing.START;\n      case Spacing.RIGHT:\n        return Spacing.END;\n      default:\n        return spacingType;\n    }\n  }\n\n  @ReactProp(name = ViewProps.POSITION)\n  public void setPosition(@Nullable String position) {\n    if (isVirtual()) {\n      return;\n    }\n\n    if (position == null) {\n      setPositionType(YogaPositionType.RELATIVE);\n      return;\n    }\n\n    switch (position) {\n      case \"relative\": {\n        setPositionType(YogaPositionType.RELATIVE);\n        break;\n      }\n      case \"absolute\": {\n        setPositionType(YogaPositionType.ABSOLUTE);\n        break;\n      }\n      default: {\n        throw new JSApplicationIllegalArgumentException(\n            \"invalid value for position: \" + position);\n      }\n    }\n  }\n\n  @Override\n  @ReactProp(name = \"onLayout\")\n  public void setShouldNotifyOnLayout(boolean shouldNotifyOnLayout) {\n    super.setShouldNotifyOnLayout(shouldNotifyOnLayout);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/MatrixMathHelper.java",
    "content": "package com.facebook.react.uimanager;\n\nimport com.facebook.infer.annotation.Assertions;\n\n/**\n * Provides helper methods for converting transform operations into a matrix and then into a list\n * of translate, scale and rotate commands.\n */\npublic class MatrixMathHelper {\n\n  private static final double EPSILON = .00001d;\n\n  public static class MatrixDecompositionContext {\n    double[] perspective = new double[4];\n    double[] scale = new double[3];\n    double[] skew = new double[3];\n    double[] translation = new double[3];\n    double[] rotationDegrees = new double[3];\n  }\n\n  private static boolean isZero(double d) {\n    if (Double.isNaN(d)) {\n      return false;\n    }\n    return Math.abs(d) < EPSILON;\n  }\n\n  public static void multiplyInto(double[] out, double[] a, double[] b) {\n    double a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n      a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n      a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n      a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\n    double b0  = b[0], b1 = b[1], b2 = b[2], b3 = b[3];\n    out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n    out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n    out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n    out[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n    b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7];\n    out[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n    out[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n    out[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n    out[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n    b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11];\n    out[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n    out[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n    out[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n    out[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n    b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15];\n    out[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n    out[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n    out[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n    out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n  }\n\n  /**\n   * @param transformMatrix 16-element array of numbers representing 4x4 transform matrix\n   */\n  public static void decomposeMatrix(double[] transformMatrix, MatrixDecompositionContext ctx) {\n    Assertions.assertCondition(transformMatrix.length == 16);\n\n    // output values\n    final double[] perspective = ctx.perspective;\n    final double[] scale = ctx.scale;\n    final double[] skew = ctx.skew;\n    final double[] translation = ctx.translation;\n    final double[] rotationDegrees = ctx.rotationDegrees;\n\n    // create normalized, 2d array matrix\n    // and normalized 1d array perspectiveMatrix with redefined 4th column\n    if (isZero(transformMatrix[15])) {\n      return;\n    }\n    double[][] matrix = new double[4][4];\n    double[] perspectiveMatrix = new double[16];\n    for (int i = 0; i < 4; i++) {\n      for (int j = 0; j < 4; j++) {\n        double value = transformMatrix[(i * 4) + j] / transformMatrix[15];\n        matrix[i][j] = value;\n        perspectiveMatrix[(i * 4) + j] = j == 3 ? 0 : value;\n      }\n    }\n    perspectiveMatrix[15] = 1;\n\n    // test for singularity of upper 3x3 part of the perspective matrix\n    if (isZero(determinant(perspectiveMatrix))) {\n      return;\n    }\n\n    // isolate perspective\n    if (!isZero(matrix[0][3]) || !isZero(matrix[1][3]) || !isZero(matrix[2][3])) {\n      // rightHandSide is the right hand side of the equation.\n      // rightHandSide is a vector, or point in 3d space relative to the origin.\n      double[] rightHandSide = { matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3] };\n\n      // Solve the equation by inverting perspectiveMatrix and multiplying\n      // rightHandSide by the inverse.\n      double[] inversePerspectiveMatrix = inverse(\n        perspectiveMatrix\n      );\n      double[] transposedInversePerspectiveMatrix = transpose(\n        inversePerspectiveMatrix\n      );\n      multiplyVectorByMatrix(rightHandSide, transposedInversePerspectiveMatrix, perspective);\n    } else {\n      // no perspective\n      perspective[0] = perspective[1] = perspective[2] = 0d;\n      perspective[3] = 1d;\n    }\n\n    // translation is simple\n    for (int i = 0; i < 3; i++) {\n      translation[i] = matrix[3][i];\n    }\n\n    // Now get scale and shear.\n    // 'row' is a 3 element array of 3 component vectors\n    double[][] row = new double[3][3];\n    for (int i = 0; i < 3; i++) {\n      row[i][0] = matrix[i][0];\n      row[i][1] = matrix[i][1];\n      row[i][2] = matrix[i][2];\n    }\n\n    // Compute X scale factor and normalize first row.\n    scale[0] = v3Length(row[0]);\n    row[0] = v3Normalize(row[0], scale[0]);\n\n    // Compute XY shear factor and make 2nd row orthogonal to 1st.\n    skew[0] = v3Dot(row[0], row[1]);\n    row[1] = v3Combine(row[1], row[0], 1.0, -skew[0]);\n\n    // Compute XY shear factor and make 2nd row orthogonal to 1st.\n    skew[0] = v3Dot(row[0], row[1]);\n    row[1] = v3Combine(row[1], row[0], 1.0, -skew[0]);\n\n    // Now, compute Y scale and normalize 2nd row.\n    scale[1] = v3Length(row[1]);\n    row[1] = v3Normalize(row[1], scale[1]);\n    skew[0] /= scale[1];\n\n    // Compute XZ and YZ shears, orthogonalize 3rd row\n    skew[1] = v3Dot(row[0], row[2]);\n    row[2] = v3Combine(row[2], row[0], 1.0, -skew[1]);\n    skew[2] = v3Dot(row[1], row[2]);\n    row[2] = v3Combine(row[2], row[1], 1.0, -skew[2]);\n\n    // Next, get Z scale and normalize 3rd row.\n    scale[2] = v3Length(row[2]);\n    row[2] = v3Normalize(row[2], scale[2]);\n    skew[1] /= scale[2];\n    skew[2] /= scale[2];\n\n    // At this point, the matrix (in rows) is orthonormal.\n    // Check for a coordinate system flip.  If the determinant\n    // is -1, then negate the matrix and the scaling factors.\n    double[] pdum3 = v3Cross(row[1], row[2]);\n    if (v3Dot(row[0], pdum3) < 0) {\n      for (int i = 0; i < 3; i++) {\n        scale[i] *= -1;\n        row[i][0] *= -1;\n        row[i][1] *= -1;\n        row[i][2] *= -1;\n      }\n    }\n\n    // Now, get the rotations out\n    // Based on: http://nghiaho.com/?page_id=846\n    double conv = 180 / Math.PI;\n    rotationDegrees[0] = roundTo3Places(-Math.atan2(row[2][1], row[2][2]) * conv);\n    rotationDegrees[1] = roundTo3Places(-Math.atan2(-row[2][0], Math.sqrt(row[2][1] * row[2][1] + row[2][2] * row[2][2])) * conv);\n    rotationDegrees[2] = roundTo3Places(-Math.atan2(row[1][0], row[0][0]) * conv);\n  }\n\n  public static double determinant(double[] matrix) {\n    double m00 = matrix[0], m01 = matrix[1], m02 = matrix[2], m03 = matrix[3], m10 = matrix[4],\n      m11 = matrix[5], m12 = matrix[6], m13 = matrix[7], m20 = matrix[8], m21 = matrix[9],\n      m22 = matrix[10], m23 = matrix[11], m30 = matrix[12], m31 = matrix[13], m32 = matrix[14],\n      m33 = matrix[15];\n    return (\n      m03 * m12 * m21 * m30 - m02 * m13 * m21 * m30 -\n        m03 * m11 * m22 * m30 + m01 * m13 * m22 * m30 +\n        m02 * m11 * m23 * m30 - m01 * m12 * m23 * m30 -\n        m03 * m12 * m20 * m31 + m02 * m13 * m20 * m31 +\n        m03 * m10 * m22 * m31 - m00 * m13 * m22 * m31 -\n        m02 * m10 * m23 * m31 + m00 * m12 * m23 * m31 +\n        m03 * m11 * m20 * m32 - m01 * m13 * m20 * m32 -\n        m03 * m10 * m21 * m32 + m00 * m13 * m21 * m32 +\n        m01 * m10 * m23 * m32 - m00 * m11 * m23 * m32 -\n        m02 * m11 * m20 * m33 + m01 * m12 * m20 * m33 +\n        m02 * m10 * m21 * m33 - m00 * m12 * m21 * m33 -\n        m01 * m10 * m22 * m33 + m00 * m11 * m22 * m33\n    );\n  }\n\n  /**\n   * Inverse of a matrix. Multiplying by the inverse is used in matrix math\n   * instead of division.\n   *\n   * Formula from:\n   * http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n   */\n  public static double[] inverse(double[] matrix) {\n    double det = determinant(matrix);\n    if (isZero(det)) {\n      return matrix;\n    }\n    double m00 = matrix[0], m01 = matrix[1], m02 = matrix[2], m03 = matrix[3], m10 = matrix[4],\n      m11 = matrix[5], m12 = matrix[6], m13 = matrix[7], m20 = matrix[8], m21 = matrix[9],\n      m22 = matrix[10], m23 = matrix[11], m30 = matrix[12], m31 = matrix[13], m32 = matrix[14],\n      m33 = matrix[15];\n    return new double[] {\n      (m12 * m23 * m31 - m13 * m22 * m31 + m13 * m21 * m32 - m11 * m23 * m32 - m12 * m21 * m33 + m11 * m22 * m33) / det,\n      (m03 * m22 * m31 - m02 * m23 * m31 - m03 * m21 * m32 + m01 * m23 * m32 + m02 * m21 * m33 - m01 * m22 * m33) / det,\n      (m02 * m13 * m31 - m03 * m12 * m31 + m03 * m11 * m32 - m01 * m13 * m32 - m02 * m11 * m33 + m01 * m12 * m33) / det,\n      (m03 * m12 * m21 - m02 * m13 * m21 - m03 * m11 * m22 + m01 * m13 * m22 + m02 * m11 * m23 - m01 * m12 * m23) / det,\n      (m13 * m22 * m30 - m12 * m23 * m30 - m13 * m20 * m32 + m10 * m23 * m32 + m12 * m20 * m33 - m10 * m22 * m33) / det,\n      (m02 * m23 * m30 - m03 * m22 * m30 + m03 * m20 * m32 - m00 * m23 * m32 - m02 * m20 * m33 + m00 * m22 * m33) / det,\n      (m03 * m12 * m30 - m02 * m13 * m30 - m03 * m10 * m32 + m00 * m13 * m32 + m02 * m10 * m33 - m00 * m12 * m33) / det,\n      (m02 * m13 * m20 - m03 * m12 * m20 + m03 * m10 * m22 - m00 * m13 * m22 - m02 * m10 * m23 + m00 * m12 * m23) / det,\n      (m11 * m23 * m30 - m13 * m21 * m30 + m13 * m20 * m31 - m10 * m23 * m31 - m11 * m20 * m33 + m10 * m21 * m33) / det,\n      (m03 * m21 * m30 - m01 * m23 * m30 - m03 * m20 * m31 + m00 * m23 * m31 + m01 * m20 * m33 - m00 * m21 * m33) / det,\n      (m01 * m13 * m30 - m03 * m11 * m30 + m03 * m10 * m31 - m00 * m13 * m31 - m01 * m10 * m33 + m00 * m11 * m33) / det,\n      (m03 * m11 * m20 - m01 * m13 * m20 - m03 * m10 * m21 + m00 * m13 * m21 + m01 * m10 * m23 - m00 * m11 * m23) / det,\n      (m12 * m21 * m30 - m11 * m22 * m30 - m12 * m20 * m31 + m10 * m22 * m31 + m11 * m20 * m32 - m10 * m21 * m32) / det,\n      (m01 * m22 * m30 - m02 * m21 * m30 + m02 * m20 * m31 - m00 * m22 * m31 - m01 * m20 * m32 + m00 * m21 * m32) / det,\n      (m02 * m11 * m30 - m01 * m12 * m30 - m02 * m10 * m31 + m00 * m12 * m31 + m01 * m10 * m32 - m00 * m11 * m32) / det,\n      (m01 * m12 * m20 - m02 * m11 * m20 + m02 * m10 * m21 - m00 * m12 * m21 - m01 * m10 * m22 + m00 * m11 * m22) / det\n    };\n  }\n\n  /**\n   * Turns columns into rows and rows into columns.\n   */\n  public static double[] transpose(double[] m) {\n    return new double[] {\n      m[0], m[4], m[8], m[12],\n      m[1], m[5], m[9], m[13],\n      m[2], m[6], m[10], m[14],\n      m[3], m[7], m[11], m[15]\n    };\n  }\n\n  /**\n   * Based on: http://tog.acm.org/resources/GraphicsGems/gemsii/unmatrix.c\n   */\n  public static void multiplyVectorByMatrix(double[] v, double[] m, double[] result) {\n    double vx = v[0], vy = v[1], vz = v[2], vw = v[3];\n    result[0] = vx * m[0] + vy * m[4] + vz * m[8] + vw * m[12];\n    result[1] = vx * m[1] + vy * m[5] + vz * m[9] + vw * m[13];\n    result[2] = vx * m[2] + vy * m[6] + vz * m[10] + vw * m[14];\n    result[3] = vx * m[3] + vy * m[7] + vz * m[11] + vw * m[15];\n  }\n\n  /**\n   * From: https://code.google.com/p/webgl-mjs/source/browse/mjs.js\n   */\n  public static double v3Length(double[] a) {\n    return Math.sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]);\n  }\n\n  /**\n   * Based on: https://code.google.com/p/webgl-mjs/source/browse/mjs.js\n   */\n  public static double[] v3Normalize(double[] vector, double norm) {\n    double im = 1 / (isZero(norm) ? v3Length(vector) : norm);\n    return new double[] {\n      vector[0] * im,\n      vector[1] * im,\n      vector[2] * im\n    };\n  }\n\n  /**\n   * The dot product of a and b, two 3-element vectors.\n   * From: https://code.google.com/p/webgl-mjs/source/browse/mjs.js\n   */\n  public static double v3Dot(double[] a, double[] b) {\n    return a[0] * b[0] +\n      a[1] * b[1] +\n      a[2] * b[2];\n  }\n\n  /**\n   * From:\n   * http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp\n   */\n  public static double[] v3Combine(double[] a, double[] b, double aScale, double bScale) {\n    return new double[]{\n      aScale * a[0] + bScale * b[0],\n      aScale * a[1] + bScale * b[1],\n      aScale * a[2] + bScale * b[2]\n    };\n  }\n\n  /**\n   * From:\n   * http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp\n   */\n  public static double[] v3Cross(double[] a, double[] b) {\n    return new double[]{\n      a[1] * b[2] - a[2] * b[1],\n      a[2] * b[0] - a[0] * b[2],\n      a[0] * b[1] - a[1] * b[0]\n    };\n  }\n\n  public static double roundTo3Places(double n) {\n    return Math.round(n * 1000d) * 0.001;\n  }\n\n  public static double[] createIdentityMatrix() {\n    double[] res = new double[16];\n    resetIdentityMatrix(res);\n    return res;\n  }\n\n  public static double degreesToRadians(double degrees) {\n    return degrees * Math.PI / 180;\n  }\n\n  public static void resetIdentityMatrix(double[] matrix) {\n    matrix[1] = matrix[2] = matrix[3] = matrix[4] = matrix[6] = matrix[7] = matrix[8] = matrix[9] =\n      matrix[11] = matrix[12] = matrix[13] = matrix[14] = 0;\n    matrix[0] = matrix[5] = matrix[10] = matrix[15] = 1;\n  }\n\n  public static void applyPerspective(double[] m, double perspective) {\n    m[11] = -1 / perspective;\n  }\n\n  public static void applyScaleX(double[] m, double factor) {\n    m[0] = factor;\n  }\n\n  public static void applyScaleY(double[] m, double factor) {\n    m[5] = factor;\n  }\n\n  public static void applyScaleZ(double[] m, double factor) {\n    m[10] = factor;\n  }\n\n  public static void applyTranslate2D(double[] m, double x, double y) {\n    m[12] = x;\n    m[13] = y;\n  }\n\n  public static void applyTranslate3D(double[] m, double x, double y, double z) {\n    m[12] = x;\n    m[13] = y;\n    m[14] = z;\n  }\n\n  public static void applySkewX(double[] m, double radians) {\n    m[4] = Math.tan(radians);\n  }\n\n  public static void applySkewY(double[] m, double radians) {\n    m[1] = Math.tan(radians);\n  }\n\n  public static void applyRotateX(double[] m, double radians) {\n    m[5] = Math.cos(radians);\n    m[6] = Math.sin(radians);\n    m[9] = -Math.sin(radians);\n    m[10] = Math.cos(radians);\n  }\n\n  public static void applyRotateY(double[] m, double radians) {\n    m[0] = Math.cos(radians);\n    m[2] = -Math.sin(radians);\n    m[8] = Math.sin(radians);\n    m[10] = Math.cos(radians);\n  }\n\n  // http://www.w3.org/TR/css3-transforms/#recomposing-to-a-2d-matrix\n  public static void applyRotateZ(double[] m, double radians) {\n    m[0] = Math.cos(radians);\n    m[1] = Math.sin(radians);\n    m[4] = -Math.sin(radians);\n    m[5] = Math.cos(radians);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/MeasureSpecProvider.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager;\n\nimport android.view.View;\n\n/**\n * Interface for a {@link View} subclass that provides the width and height measure specs from its\n * measure pass. This is currently used to re-measure the root view by reusing the specs for yoga\n * layout calculations.\n */\npublic interface MeasureSpecProvider {\n\n  int getWidthMeasureSpec();\n\n  int getHeightMeasureSpec();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.content.res.Resources;\nimport android.util.Log;\nimport android.util.SparseArray;\nimport android.util.SparseBooleanArray;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.ViewParent;\nimport android.widget.PopupMenu;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.animation.Animation;\nimport com.facebook.react.animation.AnimationListener;\nimport com.facebook.react.animation.AnimationRegistry;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.SoftAssertions;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.touch.JSResponderHandler;\nimport com.facebook.react.uimanager.layoutanimation.LayoutAnimationController;\nimport com.facebook.react.uimanager.layoutanimation.LayoutAnimationListener;\nimport com.facebook.systrace.Systrace;\nimport com.facebook.systrace.SystraceMessage;\nimport javax.annotation.Nullable;\nimport javax.annotation.concurrent.NotThreadSafe;\n\n/**\n * Delegate of {@link UIManagerModule} that owns the native view hierarchy and mapping between\n * native view names used in JS and corresponding instances of {@link ViewManager}. The\n * {@link UIManagerModule} communicates with this class by it's public interface methods:\n *  - {@link #updateProperties}\n *  - {@link #updateLayout}\n *  - {@link #createView}\n *  - {@link #manageChildren}\n * executing all the scheduled UI operations at the end of JS batch.\n *\n * NB: All native view management methods listed above must be called from the UI thread.\n *\n * The {@link ReactContext} instance that is passed to views that this manager creates differs\n * from the one that we pass as a constructor. Instead we wrap the provided instance of\n * {@link ReactContext} in an instance of {@link ThemedReactContext} that additionally provide\n * a correct theme based on the root view for a view tree that we attach newly created view to.\n * Therefore this view manager will create a copy of {@link ThemedReactContext} that wraps\n * the instance of {@link ReactContext} for each root view added to the manager (see\n * {@link #addRootView}).\n *\n * TODO(5483031): Only dispatch updates when shadow views have changed\n */\n@NotThreadSafe\npublic class NativeViewHierarchyManager {\n\n  private static final String TAG = NativeViewHierarchyManager.class.getSimpleName();\n\n  private final AnimationRegistry mAnimationRegistry;\n  private final SparseArray<View> mTagsToViews;\n  private final SparseArray<ViewManager> mTagsToViewManagers;\n  private final SparseBooleanArray mRootTags;\n  private final ViewManagerRegistry mViewManagers;\n  private final JSResponderHandler mJSResponderHandler = new JSResponderHandler();\n  private final RootViewManager mRootViewManager;\n  private final LayoutAnimationController mLayoutAnimator = new LayoutAnimationController();\n\n  private boolean mLayoutAnimationEnabled;\n\n  public NativeViewHierarchyManager(ViewManagerRegistry viewManagers) {\n    this(viewManagers, new RootViewManager());\n  }\n\n  public NativeViewHierarchyManager(ViewManagerRegistry viewManagers, RootViewManager manager) {\n    mAnimationRegistry = new AnimationRegistry();\n    mViewManagers = viewManagers;\n    mTagsToViews = new SparseArray<>();\n    mTagsToViewManagers = new SparseArray<>();\n    mRootTags = new SparseBooleanArray();\n    mRootViewManager = manager;\n  }\n\n  public synchronized final View resolveView(int tag) {\n    View view = mTagsToViews.get(tag);\n    if (view == null) {\n      throw new IllegalViewOperationException(\"Trying to resolve view with tag \" + tag\n          + \" which doesn't exist\");\n    }\n    return view;\n  }\n\n  public synchronized final ViewManager resolveViewManager(int tag) {\n    ViewManager viewManager = mTagsToViewManagers.get(tag);\n    if (viewManager == null) {\n      throw new IllegalViewOperationException(\"ViewManager for tag \" + tag + \" could not be found\");\n    }\n    return viewManager;\n  }\n\n  public AnimationRegistry getAnimationRegistry() {\n    return mAnimationRegistry;\n  }\n\n  public void setLayoutAnimationEnabled(boolean enabled) {\n    mLayoutAnimationEnabled = enabled;\n  }\n\n  public synchronized void updateProperties(int tag, ReactStylesDiffMap props) {\n    UiThreadUtil.assertOnUiThread();\n\n    try {\n      ViewManager viewManager = resolveViewManager(tag);\n      View viewToUpdate = resolveView(tag);\n      viewManager.updateProperties(viewToUpdate, props);\n    } catch (IllegalViewOperationException e) {\n      Log.e(TAG, \"Unable to update properties for view tag \" + tag, e);\n    }\n  }\n\n  public synchronized void updateViewExtraData(int tag, Object extraData) {\n    UiThreadUtil.assertOnUiThread();\n\n    ViewManager viewManager = resolveViewManager(tag);\n    View viewToUpdate = resolveView(tag);\n    viewManager.updateExtraData(viewToUpdate, extraData);\n  }\n\n  public synchronized void updateLayout(\n      int parentTag, int tag, int x, int y, int width, int height) {\n    UiThreadUtil.assertOnUiThread();\n    SystraceMessage.beginSection(\n        Systrace.TRACE_TAG_REACT_VIEW,\n        \"NativeViewHierarchyManager_updateLayout\")\n        .arg(\"parentTag\", parentTag)\n        .arg(\"tag\", tag)\n        .flush();\n    try {\n      View viewToUpdate = resolveView(tag);\n\n      // Even though we have exact dimensions, we still call measure because some platform views (e.g.\n      // Switch) assume that method will always be called before onLayout and onDraw. They use it to\n      // calculate and cache information used in the draw pass. For most views, onMeasure can be\n      // stubbed out to only call setMeasuredDimensions. For ViewGroups, onLayout should be stubbed\n      // out to not recursively call layout on its children: React Native already handles doing that.\n      //\n      // Also, note measure and layout need to be called *after* all View properties have been updated\n      // because of caching and calculation that may occur in onMeasure and onLayout. Layout\n      // operations should also follow the native view hierarchy and go top to bottom for consistency\n      // with standard layout passes (some views may depend on this).\n\n      viewToUpdate.measure(\n          View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY),\n          View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY));\n\n      // We update the layout of the ReactRootView when there is a change in the layout of its child.\n      // This is required to re-measure the size of the native View container (usually a\n      // FrameLayout) that is configured with layout_height = WRAP_CONTENT or layout_width =\n      // WRAP_CONTENT\n      //\n      // This code is going to be executed ONLY when there is a change in the size of the Root\n      // View defined in the js side. Changes in the layout of inner views will not trigger an update\n      // on the layour of the Root View.\n      ViewParent parent = viewToUpdate.getParent();\n      if (parent instanceof RootView) {\n        parent.requestLayout();\n      }\n\n      // Check if the parent of the view has to layout the view, or the child has to lay itself out.\n      if (!mRootTags.get(parentTag)) {\n        ViewManager parentViewManager = mTagsToViewManagers.get(parentTag);\n        ViewGroupManager parentViewGroupManager;\n        if (parentViewManager instanceof ViewGroupManager) {\n          parentViewGroupManager = (ViewGroupManager) parentViewManager;\n        } else {\n          throw new IllegalViewOperationException(\n              \"Trying to use view with tag \" + tag +\n                  \" as a parent, but its Manager doesn't extends ViewGroupManager\");\n        }\n        if (parentViewGroupManager != null\n            && !parentViewGroupManager.needsCustomLayoutForChildren()) {\n          updateLayout(viewToUpdate, x, y, width, height);\n        }\n      } else {\n        updateLayout(viewToUpdate, x, y, width, height);\n      }\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_VIEW);\n    }\n  }\n\n  private void updateLayout(View viewToUpdate, int x, int y, int width, int height) {\n    if (mLayoutAnimationEnabled &&\n        mLayoutAnimator.shouldAnimateLayout(viewToUpdate)) {\n      mLayoutAnimator.applyLayoutUpdate(viewToUpdate, x, y, width, height);\n    } else {\n      viewToUpdate.layout(x, y, x + width, y + height);\n    }\n  }\n\n  public synchronized void createView(\n      ThemedReactContext themedContext,\n      int tag,\n      String className,\n      @Nullable ReactStylesDiffMap initialProps) {\n    UiThreadUtil.assertOnUiThread();\n    SystraceMessage.beginSection(\n        Systrace.TRACE_TAG_REACT_VIEW,\n        \"NativeViewHierarchyManager_createView\")\n        .arg(\"tag\", tag)\n        .arg(\"className\", className)\n        .flush();\n    try {\n      ViewManager viewManager = mViewManagers.get(className);\n\n      View view = viewManager.createView(themedContext, mJSResponderHandler);\n      mTagsToViews.put(tag, view);\n      mTagsToViewManagers.put(tag, viewManager);\n\n      // Use android View id field to store React tag. This is possible since we don't inflate\n      // React views from layout xmls. Thus it is easier to just reuse that field instead of\n      // creating another (potentially much more expensive) mapping from view to React tag\n      view.setId(tag);\n      if (initialProps != null) {\n        viewManager.updateProperties(view, initialProps);\n      }\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_VIEW);\n    }\n  }\n\n  private static String constructManageChildrenErrorMessage(\n      ViewGroup viewToManage,\n      ViewGroupManager viewManager,\n      @Nullable int[] indicesToRemove,\n      @Nullable ViewAtIndex[] viewsToAdd,\n      @Nullable int[] tagsToDelete) {\n    StringBuilder stringBuilder = new StringBuilder();\n\n    if (null != viewToManage) {\n      stringBuilder.append(\"View tag:\" + viewToManage.getId() + \"\\n\");\n      stringBuilder.append(\"  children(\" + viewManager.getChildCount(viewToManage) + \"): [\\n\");\n      for (int index=0; index<viewManager.getChildCount(viewToManage); index+=16) {\n        for (int innerOffset=0;\n             ((index+innerOffset) < viewManager.getChildCount(viewToManage)) && innerOffset < 16;\n             innerOffset++) {\n          stringBuilder.append(viewManager.getChildAt(viewToManage, index+innerOffset).getId() + \",\");\n        }\n        stringBuilder.append(\"\\n\");\n      }\n      stringBuilder.append(\" ],\\n\");\n    }\n\n    if (indicesToRemove != null) {\n      stringBuilder.append(\"  indicesToRemove(\" + indicesToRemove.length + \"): [\\n\");\n      for (int index = 0; index < indicesToRemove.length; index += 16) {\n        for (\n            int innerOffset = 0;\n            ((index + innerOffset) < indicesToRemove.length) && innerOffset < 16;\n            innerOffset++) {\n          stringBuilder.append(indicesToRemove[index + innerOffset] + \",\");\n        }\n        stringBuilder.append(\"\\n\");\n      }\n      stringBuilder.append(\" ],\\n\");\n    }\n    if (viewsToAdd != null) {\n      stringBuilder.append(\"  viewsToAdd(\" + viewsToAdd.length + \"): [\\n\");\n      for (int index = 0; index < viewsToAdd.length; index += 16) {\n        for (\n            int innerOffset = 0;\n            ((index + innerOffset) < viewsToAdd.length) && innerOffset < 16;\n            innerOffset++) {\n          stringBuilder.append(\n              \"[\" + viewsToAdd[index + innerOffset].mIndex + \",\" +\n                  viewsToAdd[index + innerOffset].mTag + \"],\");\n        }\n        stringBuilder.append(\"\\n\");\n      }\n      stringBuilder.append(\" ],\\n\");\n    }\n    if (tagsToDelete != null) {\n      stringBuilder.append(\"  tagsToDelete(\" + tagsToDelete.length + \"): [\\n\");\n      for (int index = 0; index < tagsToDelete.length; index += 16) {\n        for (\n            int innerOffset = 0;\n            ((index + innerOffset) < tagsToDelete.length) && innerOffset < 16;\n            innerOffset++) {\n          stringBuilder.append(tagsToDelete[index + innerOffset] + \",\");\n        }\n        stringBuilder.append(\"\\n\");\n      }\n      stringBuilder.append(\" ]\\n\");\n    }\n\n    return stringBuilder.toString();\n  }\n\n  /**\n   * @param tag react tag of the node we want to manage\n   * @param indicesToRemove ordered (asc) list of indicies at which view should be removed\n   * @param viewsToAdd ordered (asc based on mIndex property) list of tag-index pairs that represent\n   * a view which should be added at the specified index\n   * @param tagsToDelete list of tags corresponding to views that should be removed\n   */\n  public synchronized void manageChildren(\n      int tag,\n      @Nullable int[] indicesToRemove,\n      @Nullable ViewAtIndex[] viewsToAdd,\n      @Nullable int[] tagsToDelete) {\n    UiThreadUtil.assertOnUiThread();\n    final ViewGroup viewToManage = (ViewGroup) mTagsToViews.get(tag);\n    final ViewGroupManager viewManager = (ViewGroupManager) resolveViewManager(tag);\n    if (viewToManage == null) {\n      throw new IllegalViewOperationException(\"Trying to manageChildren view with tag \" + tag +\n        \" which doesn't exist\\n detail: \" +\n            constructManageChildrenErrorMessage(\n                viewToManage,\n                viewManager,\n                indicesToRemove,\n                viewsToAdd,\n                tagsToDelete));\n    }\n\n    int lastIndexToRemove = viewManager.getChildCount(viewToManage);\n    if (indicesToRemove != null) {\n      for (int i = indicesToRemove.length - 1; i >= 0; i--) {\n        int indexToRemove = indicesToRemove[i];\n        if (indexToRemove < 0) {\n          throw new IllegalViewOperationException(\n              \"Trying to remove a negative view index:\"\n                  + indexToRemove + \" view tag: \" + tag + \"\\n detail: \" +\n                  constructManageChildrenErrorMessage(\n                      viewToManage,\n                      viewManager,\n                      indicesToRemove,\n                      viewsToAdd,\n                      tagsToDelete));\n        }\n        if (indexToRemove >= viewManager.getChildCount(viewToManage)) {\n          throw new IllegalViewOperationException(\n              \"Trying to remove a view index above child \" +\n                  \"count \" + indexToRemove + \" view tag: \" + tag + \"\\n detail: \" +\n                  constructManageChildrenErrorMessage(\n                      viewToManage,\n                      viewManager,\n                      indicesToRemove,\n                      viewsToAdd,\n                      tagsToDelete));\n        }\n        if (indexToRemove >= lastIndexToRemove) {\n          throw new IllegalViewOperationException(\n              \"Trying to remove an out of order view index:\"\n                  + indexToRemove + \" view tag: \" + tag + \"\\n detail: \" +\n                  constructManageChildrenErrorMessage(\n                      viewToManage,\n                      viewManager,\n                      indicesToRemove,\n                      viewsToAdd,\n                      tagsToDelete));\n        }\n\n        View viewToRemove = viewManager.getChildAt(viewToManage, indexToRemove);\n\n        if (mLayoutAnimationEnabled &&\n            mLayoutAnimator.shouldAnimateLayout(viewToRemove) &&\n            arrayContains(tagsToDelete, viewToRemove.getId())) {\n          // The view will be removed and dropped by the 'delete' layout animation\n          // instead, so do nothing\n        } else {\n          viewManager.removeViewAt(viewToManage, indexToRemove);\n        }\n\n        lastIndexToRemove = indexToRemove;\n      }\n    }\n\n    if (viewsToAdd != null) {\n      for (int i = 0; i < viewsToAdd.length; i++) {\n        ViewAtIndex viewAtIndex = viewsToAdd[i];\n        View viewToAdd = mTagsToViews.get(viewAtIndex.mTag);\n        if (viewToAdd == null) {\n          throw new IllegalViewOperationException(\n              \"Trying to add unknown view tag: \"\n                  + viewAtIndex.mTag + \"\\n detail: \" +\n                  constructManageChildrenErrorMessage(\n                      viewToManage,\n                      viewManager,\n                      indicesToRemove,\n                      viewsToAdd,\n                      tagsToDelete));\n        }\n        viewManager.addView(viewToManage, viewToAdd, viewAtIndex.mIndex);\n      }\n    }\n\n    if (tagsToDelete != null) {\n      for (int i = 0; i < tagsToDelete.length; i++) {\n        int tagToDelete = tagsToDelete[i];\n        final View viewToDestroy = mTagsToViews.get(tagToDelete);\n        if (viewToDestroy == null) {\n          throw new IllegalViewOperationException(\n              \"Trying to destroy unknown view tag: \"\n                  + tagToDelete + \"\\n detail: \" +\n                  constructManageChildrenErrorMessage(\n                      viewToManage,\n                      viewManager,\n                      indicesToRemove,\n                      viewsToAdd,\n                      tagsToDelete));\n        }\n\n        if (mLayoutAnimationEnabled &&\n            mLayoutAnimator.shouldAnimateLayout(viewToDestroy)) {\n          mLayoutAnimator.deleteView(viewToDestroy, new LayoutAnimationListener() {\n            @Override\n            public void onAnimationEnd() {\n              viewManager.removeView(viewToManage, viewToDestroy);\n              dropView(viewToDestroy);\n            }\n          });\n        } else {\n          dropView(viewToDestroy);\n        }\n      }\n    }\n  }\n\n  private boolean arrayContains(@Nullable int[] array, int ele) {\n    if (array == null) {\n      return false;\n    }\n    for (int curEle : array) {\n      if (curEle == ele) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  /**\n   * Simplified version of constructManageChildrenErrorMessage that only deals with adding children\n   * views\n   */\n  private static String constructSetChildrenErrorMessage(\n    ViewGroup viewToManage,\n    ViewGroupManager viewManager,\n    ReadableArray childrenTags) {\n    ViewAtIndex[] viewsToAdd = new ViewAtIndex[childrenTags.size()];\n    for (int i = 0; i < childrenTags.size(); i++) {\n      viewsToAdd[i] = new ViewAtIndex(childrenTags.getInt(i), i);\n    }\n    return constructManageChildrenErrorMessage(\n      viewToManage,\n      viewManager,\n      null,\n      viewsToAdd,\n      null\n    );\n  }\n\n  /**\n   * Simplified version of manageChildren that only deals with adding children views\n   */\n  public synchronized void setChildren(\n    int tag,\n    ReadableArray childrenTags) {\n    UiThreadUtil.assertOnUiThread();\n    ViewGroup viewToManage = (ViewGroup) mTagsToViews.get(tag);\n    ViewGroupManager viewManager = (ViewGroupManager) resolveViewManager(tag);\n\n    for (int i = 0; i < childrenTags.size(); i++) {\n      View viewToAdd = mTagsToViews.get(childrenTags.getInt(i));\n      if (viewToAdd == null) {\n        throw new IllegalViewOperationException(\n          \"Trying to add unknown view tag: \"\n            + childrenTags.getInt(i) + \"\\n detail: \" +\n            constructSetChildrenErrorMessage(\n              viewToManage,\n              viewManager,\n              childrenTags));\n      }\n      viewManager.addView(viewToManage, viewToAdd, i);\n    }\n  }\n\n  /**\n   * See {@link UIManagerModule#addRootView}.\n   */\n  public synchronized void addRootView(\n      int tag,\n      SizeMonitoringFrameLayout view,\n      ThemedReactContext themedContext) {\n    addRootViewGroup(tag, view, themedContext);\n  }\n\n  protected synchronized final void addRootViewGroup(\n      int tag,\n      ViewGroup view,\n      ThemedReactContext themedContext) {\n    if (view.getId() != View.NO_ID) {\n      throw new IllegalViewOperationException(\n          \"Trying to add a root view with an explicit id already set. React Native uses \" +\n          \"the id field to track react tags and will overwrite this field. If that is fine, \" +\n          \"explicitly overwrite the id field to View.NO_ID before calling addRootView.\");\n    }\n\n    mTagsToViews.put(tag, view);\n    mTagsToViewManagers.put(tag, mRootViewManager);\n    mRootTags.put(tag, true);\n    view.setId(tag);\n  }\n\n  /**\n   * Releases all references to given native View.\n   */\n  protected synchronized void dropView(View view) {\n    UiThreadUtil.assertOnUiThread();\n    if (!mRootTags.get(view.getId())) {\n      // For non-root views we notify viewmanager with {@link ViewManager#onDropInstance}\n      resolveViewManager(view.getId()).onDropViewInstance(view);\n    }\n    ViewManager viewManager = mTagsToViewManagers.get(view.getId());\n    if (view instanceof ViewGroup && viewManager instanceof ViewGroupManager) {\n      ViewGroup viewGroup = (ViewGroup) view;\n      ViewGroupManager viewGroupManager = (ViewGroupManager) viewManager;\n      for (int i = viewGroupManager.getChildCount(viewGroup) - 1; i >= 0; i--) {\n        View child = viewGroupManager.getChildAt(viewGroup, i);\n        if (mTagsToViews.get(child.getId()) != null) {\n          dropView(child);\n        }\n      }\n      viewGroupManager.removeAllViews(viewGroup);\n    }\n    mTagsToViews.remove(view.getId());\n    mTagsToViewManagers.remove(view.getId());\n  }\n\n  public synchronized void removeRootView(int rootViewTag) {\n    UiThreadUtil.assertOnUiThread();\n    if (!mRootTags.get(rootViewTag)) {\n        SoftAssertions.assertUnreachable(\n            \"View with tag \" + rootViewTag + \" is not registered as a root view\");\n    }\n    View rootView = mTagsToViews.get(rootViewTag);\n    dropView(rootView);\n    mRootTags.delete(rootViewTag);\n  }\n\n  /**\n   * Returns true on success, false on failure. If successful, after calling, output buffer will be\n   * {x, y, width, height}.\n   */\n  public synchronized void measure(int tag, int[] outputBuffer) {\n    UiThreadUtil.assertOnUiThread();\n    View v = mTagsToViews.get(tag);\n    if (v == null) {\n      throw new NoSuchNativeViewException(\"No native view for \" + tag + \" currently exists\");\n    }\n\n    View rootView = (View) RootViewUtil.getRootView(v);\n    // It is possible that the RootView can't be found because this view is no longer on the screen\n    // and has been removed by clipping\n    if (rootView == null) {\n      throw new NoSuchNativeViewException(\"Native view \" + tag + \" is no longer on screen\");\n    }\n    rootView.getLocationInWindow(outputBuffer);\n    int rootX = outputBuffer[0];\n    int rootY = outputBuffer[1];\n\n    v.getLocationInWindow(outputBuffer);\n\n    outputBuffer[0] = outputBuffer[0] - rootX;\n    outputBuffer[1] = outputBuffer[1] - rootY;\n    outputBuffer[2] = v.getWidth();\n    outputBuffer[3] = v.getHeight();\n  }\n\n  /**\n   * Returns the coordinates of a view relative to the window (not just the RootView\n   * which is what measure will return)\n   *\n   * @param tag - the tag for the view\n   * @param outputBuffer - output buffer that contains [x,y,width,height] of the view in coordinates\n   *  relative to the device window\n   */\n  public synchronized void measureInWindow(int tag, int[] outputBuffer) {\n    UiThreadUtil.assertOnUiThread();\n    View v = mTagsToViews.get(tag);\n    if (v == null) {\n      throw new NoSuchNativeViewException(\"No native view for \" + tag + \" currently exists\");\n    }\n\n    v.getLocationOnScreen(outputBuffer);\n\n    // We need to remove the status bar from the height.  getLocationOnScreen will include the\n    // status bar.\n    Resources resources = v.getContext().getResources();\n    int statusBarId = resources.getIdentifier(\"status_bar_height\", \"dimen\", \"android\");\n    if (statusBarId > 0) {\n      int height = (int) resources.getDimension(statusBarId);\n      outputBuffer[1] -= height;\n    }\n\n    // outputBuffer[0,1] already contain what we want\n    outputBuffer[2] = v.getWidth();\n    outputBuffer[3] = v.getHeight();\n  }\n\n  public synchronized int findTargetTagForTouch(int reactTag, float touchX, float touchY) {\n    UiThreadUtil.assertOnUiThread();\n    View view = mTagsToViews.get(reactTag);\n    if (view == null) {\n      throw new JSApplicationIllegalArgumentException(\"Could not find view with tag \" + reactTag);\n    }\n    return TouchTargetHelper.findTargetTagForTouch(touchX, touchY, (ViewGroup) view);\n  }\n\n  public synchronized void setJSResponder(\n    int reactTag,\n    int initialReactTag,\n    boolean blockNativeResponder) {\n    if (!blockNativeResponder) {\n      mJSResponderHandler.setJSResponder(initialReactTag, null);\n      return;\n    }\n\n    View view = mTagsToViews.get(reactTag);\n    if (initialReactTag != reactTag && view instanceof ViewParent) {\n      // In this case, initialReactTag corresponds to a virtual/layout-only View, and we already\n      // have a parent of that View in reactTag, so we can use it.\n      mJSResponderHandler.setJSResponder(initialReactTag, (ViewParent) view);\n      return;\n    }\n\n    if (mRootTags.get(reactTag)) {\n      SoftAssertions.assertUnreachable(\n          \"Cannot block native responder on \" + reactTag + \" that is a root view\");\n    }\n    mJSResponderHandler\n        .setJSResponder(initialReactTag, view.getParent());\n  }\n\n  public void clearJSResponder() {\n    mJSResponderHandler.clearJSResponder();\n  }\n\n  void configureLayoutAnimation(final ReadableMap config) {\n    mLayoutAnimator.initializeFromConfig(config);\n  }\n\n  void clearLayoutAnimation() {\n    mLayoutAnimator.reset();\n  }\n\n  /* package */ synchronized void startAnimationForNativeView(\n      int reactTag,\n      Animation animation,\n      @Nullable final Callback animationCallback) {\n    UiThreadUtil.assertOnUiThread();\n    View view = mTagsToViews.get(reactTag);\n    final int animationId = animation.getAnimationID();\n    if (view != null) {\n      animation.setAnimationListener(new AnimationListener() {\n        @Override\n        public void onFinished() {\n          Animation removedAnimation = mAnimationRegistry.removeAnimation(animationId);\n\n          // There's a chance that there was already a removeAnimation call enqueued on the main\n          // thread when this callback got enqueued on the main thread, but the Animation class\n          // should handle only calling one of onFinished and onCancel exactly once.\n          Assertions.assertNotNull(removedAnimation, \"Animation was already removed somehow!\");\n          if (animationCallback != null) {\n            animationCallback.invoke(true);\n          }\n        }\n\n        @Override\n        public void onCancel() {\n          Animation removedAnimation = mAnimationRegistry.removeAnimation(animationId);\n\n          Assertions.assertNotNull(removedAnimation, \"Animation was already removed somehow!\");\n          if (animationCallback != null) {\n            animationCallback.invoke(false);\n          }\n        }\n      });\n      animation.start(view);\n    } else {\n      // TODO(5712813): cleanup callback in JS callbacks table in case of an error\n      throw new IllegalViewOperationException(\"View with tag \" + reactTag + \" not found\");\n    }\n  }\n\n  public synchronized void dispatchCommand(\n    int reactTag,\n    int commandId,\n    @Nullable ReadableArray args) {\n    UiThreadUtil.assertOnUiThread();\n    View view = mTagsToViews.get(reactTag);\n    if (view == null) {\n      throw new IllegalViewOperationException(\"Trying to send command to a non-existing view \" +\n          \"with tag \" + reactTag);\n    }\n\n    ViewManager viewManager = resolveViewManager(reactTag);\n    viewManager.receiveCommand(view, commandId, args);\n  }\n\n  /**\n   * Show a {@link PopupMenu}.\n   *\n   * @param reactTag the tag of the anchor view (the PopupMenu is displayed next to this view); this\n   *        needs to be the tag of a native view (shadow views can not be anchors)\n   * @param items the menu items as an array of strings\n   * @param success will be called with the position of the selected item as the first argument, or\n   *        no arguments if the menu is dismissed\n   */\n  public synchronized void showPopupMenu(int reactTag, ReadableArray items, Callback success) {\n    UiThreadUtil.assertOnUiThread();\n    View anchor = mTagsToViews.get(reactTag);\n    if (anchor == null) {\n      throw new JSApplicationIllegalArgumentException(\"Could not find view with tag \" + reactTag);\n    }\n    PopupMenu popupMenu = new PopupMenu(getReactContextForView(reactTag), anchor);\n\n    Menu menu = popupMenu.getMenu();\n    for (int i = 0; i < items.size(); i++) {\n      menu.add(Menu.NONE, Menu.NONE, i, items.getString(i));\n    }\n\n    PopupMenuCallbackHandler handler = new PopupMenuCallbackHandler(success);\n    popupMenu.setOnMenuItemClickListener(handler);\n    popupMenu.setOnDismissListener(handler);\n\n    popupMenu.show();\n  }\n\n  private static class PopupMenuCallbackHandler implements PopupMenu.OnMenuItemClickListener,\n      PopupMenu.OnDismissListener {\n\n    final Callback mSuccess;\n    boolean mConsumed = false;\n\n    private PopupMenuCallbackHandler(Callback success) {\n      mSuccess = success;\n    }\n\n    @Override\n    public void onDismiss(PopupMenu menu) {\n      if (!mConsumed) {\n        mSuccess.invoke(UIManagerModuleConstants.ACTION_DISMISSED);\n        mConsumed = true;\n      }\n    }\n\n    @Override\n    public boolean onMenuItemClick(MenuItem item) {\n      if (!mConsumed) {\n        mSuccess.invoke(UIManagerModuleConstants.ACTION_ITEM_SELECTED, item.getOrder());\n        mConsumed = true;\n        return true;\n      }\n      return false;\n    }\n  }\n\n  /**\n   * @return Themed React context for view with a given {@param reactTag} -  it gets the\n   * context directly from the view using {@link View#getContext}.\n   */\n  private ThemedReactContext getReactContextForView(int reactTag) {\n    View view = mTagsToViews.get(reactTag);\n    if (view == null) {\n      throw new JSApplicationIllegalArgumentException(\"Could not find view with tag \" + reactTag);\n    }\n    return (ThemedReactContext) view.getContext();\n  }\n\n  public void sendAccessibilityEvent(int tag, int eventType) {\n    View view = mTagsToViews.get(tag);\n    if (view == null) {\n      throw new JSApplicationIllegalArgumentException(\"Could not find view with tag \" + tag);\n    }\n    AccessibilityHelper.sendAccessibilityEvent(view, eventType);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.util.SparseBooleanArray;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMapKeySetIterator;\nimport javax.annotation.Nullable;\n\n/**\n * Class responsible for optimizing the native view hierarchy while still respecting the final UI\n * product specified by JS. Basically, JS sends us a hierarchy of nodes that, while easy to reason\n * about in JS, are very inefficient to translate directly to native views. This class sits in\n * between {@link UIManagerModule}, which directly receives view commands from JS, and\n * {@link UIViewOperationQueue}, which enqueues actual operations on the native view hierarchy. It\n * is able to take instructions from UIManagerModule and output instructions to the native view\n * hierarchy that achieve the same displayed UI but with fewer views.\n *\n * Currently this class is only used to remove layout-only views, that is to say views that only\n * affect the positions of their children but do not draw anything themselves. These views are\n * fairly common because 1) containers are used to do layouting via flexbox and 2) the return of\n * each Component#render() call in JS must be exactly one view, which means views are often wrapped\n * in a unnecessary layer of hierarchy.\n *\n * This optimization is implemented by keeping track of both the unoptimized JS hierarchy and the\n * optimized native hierarchy in {@link ReactShadowNode}.\n *\n * This optimization is important for view hierarchy depth (which can cause stack overflows during\n * view traversal for complex apps), memory usage, amount of time spent during GCs,\n * and time-to-display.\n *\n * Some examples of the optimizations this class will do based on commands from JS:\n * - Create a view with only layout props: a description of that view is created as a\n *   {@link ReactShadowNode} in UIManagerModule, but this class will not output any commands to\n *   create the view in the native view hierarchy.\n * - Update a layout-only view to have non-layout props: before issuing the updateShadowNode call\n *   to the native view hierarchy, issue commands to create the view we optimized away move it into\n *   the view hierarchy\n * - Manage the children of a view: multiple manageChildren calls for various parent views may be\n *   issued to the native view hierarchy depending on where the views being added/removed are\n *   attached in the optimized hierarchy\n */\npublic class NativeViewHierarchyOptimizer {\n\n  private static class NodeIndexPair {\n    public final ReactShadowNode node;\n    public final int index;\n\n    NodeIndexPair(ReactShadowNode node, int index) {\n      this.node = node;\n      this.index = index;\n    }\n  }\n\n  private static final boolean ENABLED = true;\n\n  private final UIViewOperationQueue mUIViewOperationQueue;\n  private final ShadowNodeRegistry mShadowNodeRegistry;\n  private final SparseBooleanArray mTagsWithLayoutVisited = new SparseBooleanArray();\n\n  public NativeViewHierarchyOptimizer(\n      UIViewOperationQueue uiViewOperationQueue,\n      ShadowNodeRegistry shadowNodeRegistry) {\n    mUIViewOperationQueue = uiViewOperationQueue;\n    mShadowNodeRegistry = shadowNodeRegistry;\n  }\n\n  /**\n   * Handles a createView call. May or may not actually create a native view.\n   */\n  public void handleCreateView(\n      ReactShadowNode node,\n      ThemedReactContext themedContext,\n      @Nullable ReactStylesDiffMap initialProps) {\n    if (!ENABLED) {\n      int tag = node.getReactTag();\n      mUIViewOperationQueue.enqueueCreateView(\n          themedContext,\n          tag,\n          node.getViewClass(),\n          initialProps);\n      return;\n    }\n\n    boolean isLayoutOnly = node.getViewClass().equals(ViewProps.VIEW_CLASS_NAME) &&\n        isLayoutOnlyAndCollapsable(initialProps);\n    node.setIsLayoutOnly(isLayoutOnly);\n\n    if (!isLayoutOnly) {\n      mUIViewOperationQueue.enqueueCreateView(\n          themedContext,\n          node.getReactTag(),\n          node.getViewClass(),\n          initialProps);\n    }\n  }\n\n  /**\n   * Handles native children cleanup when css node is removed from hierarchy\n   */\n  public static void handleRemoveNode(ReactShadowNode node) {\n    node.removeAllNativeChildren();\n  }\n\n  /**\n   * Handles an updateView call. If a view transitions from being layout-only to not (or vice-versa)\n   * this could result in some number of additional createView and manageChildren calls. If the\n   * view is layout only, no updateView call will be dispatched to the native hierarchy.\n   */\n  public void handleUpdateView(\n      ReactShadowNode node,\n      String className,\n      ReactStylesDiffMap props) {\n    if (!ENABLED) {\n      mUIViewOperationQueue.enqueueUpdateProperties(node.getReactTag(), className, props);\n      return;\n    }\n\n    boolean needsToLeaveLayoutOnly = node.isLayoutOnly() && !isLayoutOnlyAndCollapsable(props);\n    if (needsToLeaveLayoutOnly) {\n      transitionLayoutOnlyViewToNativeView(node, props);\n    } else if (!node.isLayoutOnly()) {\n      mUIViewOperationQueue.enqueueUpdateProperties(node.getReactTag(), className, props);\n    }\n  }\n\n  /**\n   * Handles a manageChildren call. This may translate into multiple manageChildren calls for\n   * multiple other views.\n   *\n   * NB: the assumption for calling this method is that all corresponding ReactShadowNodes have\n   * been updated **but tagsToDelete have NOT been deleted yet**. This is because we need to use\n   * the metadata from those nodes to figure out the correct commands to dispatch. This is unlike\n   * all other calls on this class where we assume all operations on the shadow hierarchy have\n   * already completed by the time a corresponding method here is called.\n   */\n  public void handleManageChildren(\n      ReactShadowNode nodeToManage,\n      int[] indicesToRemove,\n      int[] tagsToRemove,\n      ViewAtIndex[] viewsToAdd,\n      int[] tagsToDelete) {\n    if (!ENABLED) {\n      mUIViewOperationQueue.enqueueManageChildren(\n          nodeToManage.getReactTag(),\n          indicesToRemove,\n          viewsToAdd,\n          tagsToDelete);\n      return;\n    }\n\n    // We operate on tagsToRemove instead of indicesToRemove because by the time this method is\n    // called, these views have already been removed from the shadow hierarchy and the indices are\n    // no longer useful to operate on\n    for (int i = 0; i < tagsToRemove.length; i++) {\n      int tagToRemove = tagsToRemove[i];\n      boolean delete = false;\n      for (int j = 0; j < tagsToDelete.length; j++) {\n        if (tagsToDelete[j] == tagToRemove) {\n          delete = true;\n          break;\n        }\n      }\n      ReactShadowNode nodeToRemove = mShadowNodeRegistry.getNode(tagToRemove);\n      removeNodeFromParent(nodeToRemove, delete);\n    }\n\n    for (int i = 0; i < viewsToAdd.length; i++) {\n      ViewAtIndex toAdd = viewsToAdd[i];\n      ReactShadowNode nodeToAdd = mShadowNodeRegistry.getNode(toAdd.mTag);\n      addNodeToNode(nodeToManage, nodeToAdd, toAdd.mIndex);\n    }\n  }\n\n  /**\n   * Handles a setChildren call.  This is a simplification of handleManagerChildren that only adds\n   * children in index order of the childrenTags array\n   */\n  public void handleSetChildren(\n    ReactShadowNode nodeToManage,\n    ReadableArray childrenTags\n  ) {\n    if (!ENABLED) {\n      mUIViewOperationQueue.enqueueSetChildren(\n        nodeToManage.getReactTag(),\n        childrenTags);\n      return;\n    }\n\n    for (int i = 0; i < childrenTags.size(); i++) {\n      ReactShadowNode nodeToAdd = mShadowNodeRegistry.getNode(childrenTags.getInt(i));\n      addNodeToNode(nodeToManage, nodeToAdd, i);\n    }\n  }\n\n  /**\n   * Handles an updateLayout call. All updateLayout calls are collected and dispatched at the end\n   * of a batch because updateLayout calls to layout-only nodes can necessitate multiple\n   * updateLayout calls for all its children.\n   */\n  public void handleUpdateLayout(ReactShadowNode node) {\n    if (!ENABLED) {\n      mUIViewOperationQueue.enqueueUpdateLayout(\n          Assertions.assertNotNull(node.getParent()).getReactTag(),\n          node.getReactTag(),\n          node.getScreenX(),\n          node.getScreenY(),\n          node.getScreenWidth(),\n          node.getScreenHeight());\n      return;\n    }\n\n    applyLayoutBase(node);\n  }\n\n  /**\n   * Processes the shadow hierarchy to dispatch all necessary updateLayout calls to the native\n   * hierarchy. Should be called after all updateLayout calls for a batch have been handled.\n   */\n  public void onBatchComplete() {\n    mTagsWithLayoutVisited.clear();\n  }\n\n  private NodeIndexPair walkUpUntilNonLayoutOnly(\n      ReactShadowNode node,\n      int indexInNativeChildren) {\n    while (node.isLayoutOnly()) {\n      ReactShadowNode parent = node.getParent();\n      if (parent == null) {\n        return null;\n      }\n\n      indexInNativeChildren = indexInNativeChildren + parent.getNativeOffsetForChild(node);\n      node = parent;\n    }\n\n    return new NodeIndexPair(node, indexInNativeChildren);\n  }\n\n  private void addNodeToNode(ReactShadowNode parent, ReactShadowNode child, int index) {\n    int indexInNativeChildren = parent.getNativeOffsetForChild(parent.getChildAt(index));\n    if (parent.isLayoutOnly()) {\n      NodeIndexPair result = walkUpUntilNonLayoutOnly(parent, indexInNativeChildren);\n      if (result == null) {\n        // If the parent hasn't been attached to its native parent yet, don't issue commands to the\n        // native hierarchy. We'll do that when the parent node actually gets attached somewhere.\n        return;\n      }\n      parent = result.node;\n      indexInNativeChildren = result.index;\n    }\n\n    if (!child.isLayoutOnly()) {\n      addNonLayoutNode(parent, child, indexInNativeChildren);\n    } else {\n      addLayoutOnlyNode(parent, child, indexInNativeChildren);\n    }\n  }\n\n  /**\n   * For handling node removal from manageChildren. In the case of removing a layout-only node, we\n   * need to instead recursively remove all its children from their native parents.\n   */\n  private void removeNodeFromParent(ReactShadowNode nodeToRemove, boolean shouldDelete) {\n    ReactShadowNode nativeNodeToRemoveFrom = nodeToRemove.getNativeParent();\n\n    if (nativeNodeToRemoveFrom != null) {\n      int index = nativeNodeToRemoveFrom.indexOfNativeChild(nodeToRemove);\n      nativeNodeToRemoveFrom.removeNativeChildAt(index);\n\n      mUIViewOperationQueue.enqueueManageChildren(\n          nativeNodeToRemoveFrom.getReactTag(),\n          new int[]{index},\n          null,\n          shouldDelete ? new int[]{nodeToRemove.getReactTag()} : null);\n    } else {\n      for (int i = nodeToRemove.getChildCount() - 1; i >= 0; i--) {\n        removeNodeFromParent(nodeToRemove.getChildAt(i), shouldDelete);\n      }\n    }\n  }\n\n  private void addLayoutOnlyNode(\n      ReactShadowNode nonLayoutOnlyNode,\n      ReactShadowNode layoutOnlyNode,\n      int index) {\n    addGrandchildren(nonLayoutOnlyNode, layoutOnlyNode, index);\n  }\n\n  private void addNonLayoutNode(\n      ReactShadowNode parent,\n      ReactShadowNode child,\n      int index) {\n    parent.addNativeChildAt(child, index);\n    mUIViewOperationQueue.enqueueManageChildren(\n        parent.getReactTag(),\n        null,\n        new ViewAtIndex[]{new ViewAtIndex(child.getReactTag(), index)},\n        null);\n  }\n\n  private void addGrandchildren(\n      ReactShadowNode nativeParent,\n      ReactShadowNode child,\n      int index) {\n    Assertions.assertCondition(!nativeParent.isLayoutOnly());\n\n    // `child` can't hold native children. Add all of `child`'s children to `parent`.\n    int currentIndex = index;\n    for (int i = 0; i < child.getChildCount(); i++) {\n      ReactShadowNode grandchild = child.getChildAt(i);\n      Assertions.assertCondition(grandchild.getNativeParent() == null);\n\n      if (grandchild.isLayoutOnly()) {\n        // Adding this child could result in adding multiple native views\n        int grandchildCountBefore = nativeParent.getNativeChildCount();\n        addLayoutOnlyNode(nativeParent, grandchild, currentIndex);\n        int grandchildCountAfter = nativeParent.getNativeChildCount();\n        currentIndex += grandchildCountAfter - grandchildCountBefore;\n      } else {\n        addNonLayoutNode(nativeParent, grandchild, currentIndex);\n        currentIndex++;\n      }\n    }\n  }\n\n  private void applyLayoutBase(ReactShadowNode node) {\n    int tag = node.getReactTag();\n    if (mTagsWithLayoutVisited.get(tag)) {\n      return;\n    }\n    mTagsWithLayoutVisited.put(tag, true);\n\n    ReactShadowNode parent = node.getParent();\n\n    // We use screenX/screenY (which round to integer pixels) at each node in the hierarchy to\n    // emulate what the layout would look like if it were actually built with native views which\n    // have to have integral top/left/bottom/right values\n    int x = node.getScreenX();\n    int y = node.getScreenY();\n\n    while (parent != null && parent.isLayoutOnly()) {\n      // TODO(7854667): handle and test proper clipping\n      x += Math.round(parent.getLayoutX());\n      y += Math.round(parent.getLayoutY());\n\n      parent = parent.getParent();\n    }\n\n    applyLayoutRecursive(node, x, y);\n  }\n\n  private void applyLayoutRecursive(ReactShadowNode toUpdate, int x, int y) {\n    if (!toUpdate.isLayoutOnly() && toUpdate.getNativeParent() != null) {\n      int tag = toUpdate.getReactTag();\n      mUIViewOperationQueue.enqueueUpdateLayout(\n          toUpdate.getNativeParent().getReactTag(),\n          tag,\n          x,\n          y,\n          toUpdate.getScreenWidth(),\n          toUpdate.getScreenHeight());\n      return;\n    }\n\n    for (int i = 0; i < toUpdate.getChildCount(); i++) {\n      ReactShadowNode child = toUpdate.getChildAt(i);\n      int childTag = child.getReactTag();\n      if (mTagsWithLayoutVisited.get(childTag)) {\n        continue;\n      }\n      mTagsWithLayoutVisited.put(childTag, true);\n\n      int childX = child.getScreenX();\n      int childY = child.getScreenY();\n\n      childX += x;\n      childY += y;\n\n      applyLayoutRecursive(child, childX, childY);\n    }\n  }\n\n  private void transitionLayoutOnlyViewToNativeView(\n      ReactShadowNode node,\n      @Nullable ReactStylesDiffMap props) {\n    ReactShadowNode parent = node.getParent();\n    if (parent == null) {\n      node.setIsLayoutOnly(false);\n      return;\n    }\n\n    // First, remove the node from its parent. This causes the parent to update its native children\n    // count. The removeNodeFromParent call will cause all the view's children to be detached from\n    // their native parent.\n    int childIndex = parent.indexOf(node);\n    parent.removeChildAt(childIndex);\n    removeNodeFromParent(node, false);\n\n    node.setIsLayoutOnly(false);\n\n    // Create the view since it doesn't exist in the native hierarchy yet\n    mUIViewOperationQueue.enqueueCreateView(\n        node.getRootNode().getThemedContext(),\n        node.getReactTag(),\n        node.getViewClass(),\n        props);\n\n    // Add the node and all its children as if we are adding a new nodes\n    parent.addChildAt(node, childIndex);\n    addNodeToNode(parent, node, childIndex);\n    for (int i = 0; i < node.getChildCount(); i++) {\n      addNodeToNode(node, node.getChildAt(i), i);\n    }\n\n    // Update layouts since the children of the node were offset by its x/y position previously.\n    // Bit of a hack: we need to update the layout of this node's children now that it's no longer\n    // layout-only, but we may still receive more layout updates at the end of this batch that we\n    // don't want to ignore.\n    Assertions.assertCondition(mTagsWithLayoutVisited.size() == 0);\n    applyLayoutBase(node);\n    for (int i = 0; i < node.getChildCount(); i++) {\n      applyLayoutBase(node.getChildAt(i));\n    }\n    mTagsWithLayoutVisited.clear();\n  }\n\n  private static boolean isLayoutOnlyAndCollapsable(@Nullable ReactStylesDiffMap props) {\n    if (props == null) {\n      return true;\n    }\n\n    if (props.hasKey(ViewProps.COLLAPSABLE) && !props.getBoolean(ViewProps.COLLAPSABLE, true)) {\n      return false;\n    }\n\n    ReadableMapKeySetIterator keyIterator = props.mBackingMap.keySetIterator();\n    while (keyIterator.hasNextKey()) {\n      if (!ViewProps.isLayoutOnly(props.mBackingMap, keyIterator.nextKey())) {\n        return false;\n      }\n    }\n    return true;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/OnLayoutEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.support.v4.util.Pools;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event used to notify JS component about changes of its position or dimensions\n */\npublic class OnLayoutEvent extends Event<OnLayoutEvent> {\n\n  private static final Pools.SynchronizedPool<OnLayoutEvent> EVENTS_POOL =\n      new Pools.SynchronizedPool<>(20);\n\n  private int mX, mY, mWidth, mHeight;\n\n  public static OnLayoutEvent obtain(int viewTag, int x, int y, int width, int height) {\n    OnLayoutEvent event = EVENTS_POOL.acquire();\n    if (event == null) {\n      event = new OnLayoutEvent();\n    }\n    event.init(viewTag, x, y, width, height);\n    return event;\n  }\n\n  @Override\n  public void onDispose() {\n    EVENTS_POOL.release(this);\n  }\n\n  private OnLayoutEvent() {\n  }\n\n  protected void init(int viewTag, int x, int y, int width, int height) {\n    super.init(viewTag);\n    mX = x;\n    mY = y;\n    mWidth = width;\n    mHeight = height;\n  }\n\n  @Override\n  public String getEventName() {\n    return \"topLayout\";\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    WritableMap layout = Arguments.createMap();\n    layout.putDouble(\"x\", PixelUtil.toDIPFromPixel(mX));\n    layout.putDouble(\"y\", PixelUtil.toDIPFromPixel(mY));\n    layout.putDouble(\"width\", PixelUtil.toDIPFromPixel(mWidth));\n    layout.putDouble(\"height\", PixelUtil.toDIPFromPixel(mHeight));\n\n    WritableMap event = Arguments.createMap();\n    event.putMap(\"layout\", layout);\n    event.putInt(\"target\", getViewTag());\n\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), event);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactClippingViewGroup.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.graphics.Rect;\nimport android.view.View;\n\n/**\n * Interface that should be implemented by {@link View} subclasses that support\n * {@code removeClippedSubviews} property. When this property is set for the {@link ViewGroup}\n * subclass it's responsible for detaching it's child views that are clipped by the view boundaries.\n * Those view boundaries should be determined based on it's parent clipping area and current view's\n * offset in parent and doesn't necessarily reflect the view visible area (in a sense of a value\n * that {@link View#getGlobalVisibleRect} may return). In order to determine the clipping rect for\n * current view helper method {@link ReactClippingViewGroupHelper#calculateClippingRect} can be used\n * that takes into account parent view settings.\n */\npublic interface ReactClippingViewGroup {\n\n  /**\n   * Notify view that clipping area may have changed and it should recalculate the list of children\n   * that should be attached/detached. This method should be called only when property\n   * {@code removeClippedSubviews} is set to {@code true} on a view.\n   *\n   * CAUTION: Views are responsible for calling {@link #updateClippingRect} on it's children. This\n   * should happen if child implement {@link ReactClippingViewGroup}, return true from\n   * {@link #getRemoveClippedSubviews} and clipping rect change of the current view may affect\n   * clipping rect of this child.\n   */\n  void updateClippingRect();\n\n  /**\n   * Get rectangular bounds to which view is currently clipped to. Called only on views that has set\n   * {@code removeCLippedSubviews} property value to {@code true}.\n   *\n   * @param outClippingRect output clipping rect should be written to this object.\n   */\n  void getClippingRect(Rect outClippingRect);\n\n  /**\n   * Sets property {@code removeClippedSubviews} as a result of property update in JS. Should be\n   * called only from @{link ViewManager#updateView} method.\n   *\n   * Helper method {@link ReactClippingViewGroupHelper#applyRemoveClippedSubviewsProperty} may be\n   * used by {@link ViewManager} subclass to apply this property based on property update map\n   * {@link ReactStylesDiffMap}.\n   */\n  void setRemoveClippedSubviews(boolean removeClippedSubviews);\n\n  /**\n   * Get the current value of {@code removeClippedSubviews} property.\n   */\n  boolean getRemoveClippedSubviews();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactClippingViewGroupHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport javax.annotation.concurrent.NotThreadSafe;\n\nimport android.graphics.Rect;\nimport android.view.View;\nimport android.view.ViewParent;\n\n/**\n * Provides implementation of common tasks for view and it's view manager supporting property\n * {@code removeClippedSubviews}.\n */\n@NotThreadSafe\npublic class ReactClippingViewGroupHelper {\n\n  public static final String PROP_REMOVE_CLIPPED_SUBVIEWS = \"removeClippedSubviews\";\n\n  private static final Rect sHelperRect = new Rect();\n\n  /**\n   * Can be used by view that support {@code removeClippedSubviews} property to calculate area that\n   * given {@param view} should be clipped to based on the clipping rectangle of it's parent in\n   * case when parent is also set to clip it's children.\n   *\n   * @param view view that we want to calculate clipping rect for\n   * @param outputRect where the calculated rectangle will be written\n   */\n  public static void calculateClippingRect(View view, Rect outputRect) {\n    ViewParent parent = view.getParent();\n    if (parent == null) {\n      outputRect.setEmpty();\n      return;\n    } else if (parent instanceof ReactClippingViewGroup) {\n      ReactClippingViewGroup clippingViewGroup = (ReactClippingViewGroup) parent;\n      if (clippingViewGroup.getRemoveClippedSubviews()) {\n        clippingViewGroup.getClippingRect(sHelperRect);\n        // Intersect the view with the parent's rectangle\n        // This will result in the overlap with coordinates in the parent space\n        if (!sHelperRect.intersect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom())) {\n          outputRect.setEmpty();\n          return;\n        }\n        // Now we move the coordinates to the View's coordinate space\n        sHelperRect.offset(-view.getLeft(), -view.getTop());\n        sHelperRect.offset(view.getScrollX(), view.getScrollY());\n        outputRect.set(sHelperRect);\n        return;\n      }\n    }\n    view.getDrawingRect(outputRect);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactCompoundView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.view.View;\n\n/**\n * This interface should be implemented be native {@link View} subclasses that can represent more\n * than a single react node (e.g. TextView). It is use by touch event emitter for determining the\n * react tag of the inner-view element that was touched.\n */\npublic interface ReactCompoundView {\n\n  /**\n   * Return react tag for touched element. Event coordinates are relative to the view\n   * @param touchX the X touch coordinate relative to the view\n   * @param touchY the Y touch coordinate relative to the view\n   */\n  int reactTagForTouch(float touchX, float touchY);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRootViewTagGenerator.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager;\n\n/** Incremental counter for React Root View tag. */\npublic class ReactRootViewTagGenerator {\n\n  // Keep in sync with ReactIOSTagHandles JS module - see that file for an explanation on why the\n  // increment here is 10.\n  private static final int ROOT_VIEW_TAG_INCREMENT = 10;\n\n  private static int sNextRootViewTag = 1;\n\n  public static synchronized int getNextRootViewTag() {\n    final int tag = sNextRootViewTag;\n    sNextRootViewTag += ROOT_VIEW_TAG_INCREMENT;\n    return tag;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * <p>This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\npackage com.facebook.react.uimanager;\n\nimport com.facebook.yoga.YogaAlign;\nimport com.facebook.yoga.YogaBaselineFunction;\nimport com.facebook.yoga.YogaDirection;\nimport com.facebook.yoga.YogaDisplay;\nimport com.facebook.yoga.YogaFlexDirection;\nimport com.facebook.yoga.YogaJustify;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaNode;\nimport com.facebook.yoga.YogaOverflow;\nimport com.facebook.yoga.YogaPositionType;\nimport com.facebook.yoga.YogaValue;\nimport com.facebook.yoga.YogaWrap;\nimport javax.annotation.Nullable;\n\n/**\n * Base node class for representing virtual tree of React nodes. Shadow nodes are used primarily for\n * layouting therefore it extends {@link YogaNode} to allow that. They also help with handling\n * Common base subclass of {@link YogaNode} for all layout nodes for react-based view. It extends\n * {@link YogaNode} by adding additional capabilities.\n *\n * <p>Instances of this class receive property updates from JS via @{link UIManagerModule}.\n * Subclasses may use {@link #updateShadowNode} to persist some of the updated fields in the node\n * instance that corresponds to a particular view type.\n *\n * <p>Subclasses of {@link ReactShadowNode} should be created only from {@link ViewManager} that\n * corresponds to a certain type of native view. They will be updated and accessed only from JS\n * thread. Subclasses of {@link ViewManager} may choose to use base class {@link ReactShadowNode} or\n * custom subclass of it if necessary.\n *\n * <p>The primary use-case for {@link ReactShadowNode} nodes is to calculate layouting. Although\n * this might be extended. For some examples please refer to ARTGroupYogaNode or ReactTextYogaNode.\n *\n * <p>This class allows for the native view hierarchy to not be an exact copy of the hierarchy\n * received from JS by keeping track of both JS children (e.g. {@link #getChildCount()} and\n * separately native children (e.g. {@link #getNativeChildCount()}). See {@link\n * NativeViewHierarchyOptimizer} for more information.\n */\npublic interface ReactShadowNode<T extends ReactShadowNode> {\n\n  /**\n   * Nodes that return {@code true} will be treated as \"virtual\" nodes. That is, nodes that are not\n   * mapped into native views (e.g. nested text node). By default this method returns {@code false}.\n   */\n  boolean isVirtual();\n\n  /**\n   * Nodes that return {@code true} will be treated as a root view for the virtual nodes tree. It\n   * means that {@link NativeViewHierarchyManager} will not try to perform {@code manageChildren}\n   * operation on such views. Good example is {@code InputText} view that may have children {@code\n   * Text} nodes but this whole hierarchy will be mapped to a single android {@link EditText} view.\n   */\n  boolean isVirtualAnchor();\n\n  /**\n   * Nodes that return {@code true} will not manage (and and remove) child Yoga nodes. For example\n   * {@link ReactTextInputShadowNode} or {@link ReactTextShadowNode} have child nodes, which do not\n   * want Yoga to lay out, so in the eyes of Yoga it is a leaf node. Override this method in\n   * subclass to enforce this requirement.\n   */\n  boolean isYogaLeafNode();\n\n  String getViewClass();\n\n  boolean hasUpdates();\n\n  void markUpdateSeen();\n\n  void markUpdated();\n\n  boolean hasUnseenUpdates();\n\n  void dirty();\n\n  boolean isDirty();\n\n  void addChildAt(T child, int i);\n\n  T removeChildAt(int i);\n\n  int getChildCount();\n\n  T getChildAt(int i);\n\n  int indexOf(T child);\n\n  void removeAndDisposeAllChildren();\n\n  /**\n   * This method will be called by {@link UIManagerModule} once per batch, before calculating\n   * layout. Will be only called for nodes that are marked as updated with {@link #markUpdated()} or\n   * require layouting (marked with {@link #dirty()}).\n   */\n  void onBeforeLayout();\n\n  void updateProperties(ReactStylesDiffMap props);\n\n  void onAfterUpdateTransaction();\n\n  /**\n   * Called after layout step at the end of the UI batch from {@link UIManagerModule}. May be used\n   * to enqueue additional ui operations for the native view. Will only be called on nodes marked as\n   * updated either with {@link #dirty()} or {@link #markUpdated()}.\n   *\n   * @param uiViewOperationQueue interface for enqueueing UI operations\n   */\n  void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue);\n\n  /** @return true if layout (position or dimensions) changed, false otherwise. */\n\n  /* package */ boolean dispatchUpdates(\n      float absoluteX,\n      float absoluteY,\n      UIViewOperationQueue uiViewOperationQueue,\n      NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer);\n\n  int getReactTag();\n\n  void setReactTag(int reactTag);\n\n  T getRootNode();\n\n  void setRootNode(T rootNode);\n\n  void setViewClassName(String viewClassName);\n\n  @Nullable\n  T getParent();\n\n  /**\n   * Get the {@link ThemedReactContext} associated with this {@link ReactShadowNode}. This will\n   * never change during the lifetime of a {@link ReactShadowNode} instance, but different instances\n   * can have different contexts; don't cache any calculations based on theme values globally.\n   */\n  ThemedReactContext getThemedContext();\n\n  void setThemedContext(ThemedReactContext themedContext);\n\n  boolean shouldNotifyOnLayout();\n\n  void calculateLayout();\n\n  boolean hasNewLayout();\n\n  void markLayoutSeen();\n\n  /**\n   * Adds a child that the native view hierarchy will have at this index in the native view\n   * corresponding to this node.\n   */\n  void addNativeChildAt(T child, int nativeIndex);\n\n  T removeNativeChildAt(int i);\n\n  void removeAllNativeChildren();\n\n  int getNativeChildCount();\n\n  int indexOfNativeChild(T nativeChild);\n\n  @Nullable\n  T getNativeParent();\n\n  /**\n   * Sets whether this node only contributes to the layout of its children without doing any drawing\n   * or functionality itself.\n   */\n  void setIsLayoutOnly(boolean isLayoutOnly);\n\n  boolean isLayoutOnly();\n\n  int getTotalNativeChildren();\n\n  boolean isDescendantOf(T ancestorNode);\n\n  /*\n   * In some cases we need a way to specify some environmental data to shadow node\n   * to improve layout (or do something similar), so {@code localData} serves these needs.\n   * For example, any stateful embedded native views may benefit from this.\n   * Have in mind that this data is not supposed to interfere with the state of\n   * the shadow node.\n   * Please respect one-directional data flow of React.\n   * Use  {@link UIManagerModule#setViewLocalData} to set this property\n   * (to provide local/environmental data for a shadow node) from the main thread.\n   */\n  public void setLocalData(Object data);\n\n  /**\n   * Returns the offset within the native children owned by all layout-only nodes in the subtree\n   * rooted at this node for the given child. Put another way, this returns the number of native\n   * nodes (nodes not optimized out of the native tree) that are a) to the left (visited before by a\n   * DFS) of the given child in the subtree rooted at this node and b) do not have a native parent\n   * in this subtree (which means that the given child will be a sibling of theirs in the final\n   * native hierarchy since they'll get attached to the same native parent).\n   *\n   * <p>Basically, a view might have children that have been optimized away by {@link\n   * NativeViewHierarchyOptimizer}. Since those children will then add their native children to this\n   * view, we now have ranges of native children that correspond to single unoptimized children. The\n   * purpose of this method is to return the index within the native children that corresponds to\n   * the **start** of the native children that belong to the given child. Also, note that all of the\n   * children of a view might be optimized away, so this could return the same value for multiple\n   * different children.\n   *\n   * <p>Example. Native children are represented by (N) where N is the no-opt child they came from.\n   * If no children are optimized away it'd look like this: (0) (1) (2) (3) ... (n)\n   *\n   * <p>In case some children are optimized away, it might look like this: (0) (1) (1) (1) (3) (3)\n   * (4)\n   *\n   * <p>In that case: getNativeOffsetForChild(Node 0) => 0 getNativeOffsetForChild(Node 1) => 1\n   * getNativeOffsetForChild(Node 2) => 4 getNativeOffsetForChild(Node 3) => 4\n   *\n   * <p>getNativeOffsetForChild(Node 4) => 6\n   */\n  int getNativeOffsetForChild(T child);\n\n  float getLayoutX();\n\n  float getLayoutY();\n\n  float getLayoutWidth();\n\n  float getLayoutHeight();\n\n  /** @return the x position of the corresponding view on the screen, rounded to pixels */\n  int getScreenX();\n\n  /** @return the y position of the corresponding view on the screen, rounded to pixels */\n  int getScreenY();\n\n  /** @return width corrected for rounding to pixels. */\n  int getScreenWidth();\n\n  /** @return height corrected for rounding to pixels. */\n  int getScreenHeight();\n\n  YogaDirection getLayoutDirection();\n\n  void setLayoutDirection(YogaDirection direction);\n\n  YogaValue getStyleWidth();\n\n  void setStyleWidth(float widthPx);\n\n  void setStyleWidthPercent(float percent);\n\n  void setStyleWidthAuto();\n\n  void setStyleMinWidth(float widthPx);\n\n  void setStyleMinWidthPercent(float percent);\n\n  void setStyleMaxWidth(float widthPx);\n\n  void setStyleMaxWidthPercent(float percent);\n\n  YogaValue getStyleHeight();\n\n  void setStyleHeight(float heightPx);\n\n  void setStyleHeightPercent(float percent);\n\n  void setStyleHeightAuto();\n\n  void setStyleMinHeight(float widthPx);\n\n  void setStyleMinHeightPercent(float percent);\n\n  void setStyleMaxHeight(float widthPx);\n\n  void setStyleMaxHeightPercent(float percent);\n\n  void setFlex(float flex);\n\n  void setFlexGrow(float flexGrow);\n\n  void setFlexShrink(float flexShrink);\n\n  void setFlexBasis(float flexBasis);\n\n  void setFlexBasisAuto();\n\n  void setFlexBasisPercent(float percent);\n\n  void setStyleAspectRatio(float aspectRatio);\n\n  void setFlexDirection(YogaFlexDirection flexDirection);\n\n  void setFlexWrap(YogaWrap wrap);\n\n  void setAlignSelf(YogaAlign alignSelf);\n\n  void setAlignItems(YogaAlign alignItems);\n\n  void setAlignContent(YogaAlign alignContent);\n\n  void setJustifyContent(YogaJustify justifyContent);\n\n  void setOverflow(YogaOverflow overflow);\n\n  void setDisplay(YogaDisplay display);\n\n  void setMargin(int spacingType, float margin);\n\n  void setMarginPercent(int spacingType, float percent);\n\n  void setMarginAuto(int spacingType);\n\n  float getPadding(int spacingType);\n\n  YogaValue getStylePadding(int spacingType);\n\n  void setDefaultPadding(int spacingType, float padding);\n\n  void setPadding(int spacingType, float padding);\n\n  void setPaddingPercent(int spacingType, float percent);\n\n  void setBorder(int spacingType, float borderWidth);\n\n  void setPosition(int spacingType, float position);\n\n  void setPositionPercent(int spacingType, float percent);\n\n  void setPositionType(YogaPositionType positionType);\n\n  void setShouldNotifyOnLayout(boolean shouldNotifyOnLayout);\n\n  void setBaselineFunction(YogaBaselineFunction baselineFunction);\n\n  void setMeasureFunction(YogaMeasureFunction measureFunction);\n\n  boolean isMeasureDefined();\n\n  void dispose();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * <p>This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\npackage com.facebook.react.uimanager;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.uimanager.annotations.ReactPropertyHolder;\nimport com.facebook.yoga.YogaAlign;\nimport com.facebook.yoga.YogaBaselineFunction;\nimport com.facebook.yoga.YogaConfig;\nimport com.facebook.yoga.YogaConstants;\nimport com.facebook.yoga.YogaDirection;\nimport com.facebook.yoga.YogaDisplay;\nimport com.facebook.yoga.YogaEdge;\nimport com.facebook.yoga.YogaFlexDirection;\nimport com.facebook.yoga.YogaJustify;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaNode;\nimport com.facebook.yoga.YogaOverflow;\nimport com.facebook.yoga.YogaPositionType;\nimport com.facebook.yoga.YogaValue;\nimport com.facebook.yoga.YogaWrap;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport javax.annotation.Nullable;\n\n/**\n * Base node class for representing virtual tree of React nodes. Shadow nodes are used primarily for\n * layouting therefore it extends {@link YogaNode} to allow that. They also help with handling\n * Common base subclass of {@link YogaNode} for all layout nodes for react-based view. It extends\n * {@link YogaNode} by adding additional capabilities.\n *\n * <p>Instances of this class receive property updates from JS via @{link UIManagerModule}.\n * Subclasses may use {@link #updateShadowNode} to persist some of the updated fields in the node\n * instance that corresponds to a particular view type.\n *\n * <p>Subclasses of {@link ReactShadowNodeImpl} should be created only from {@link ViewManager} that\n * corresponds to a certain type of native view. They will be updated and accessed only from JS\n * thread. Subclasses of {@link ViewManager} may choose to use base class {@link\n * ReactShadowNodeImpl} or custom subclass of it if necessary.\n *\n * <p>The primary use-case for {@link ReactShadowNodeImpl} nodes is to calculate layouting. Although\n * this might be extended. For some examples please refer to ARTGroupYogaNode or ReactTextYogaNode.\n *\n * <p>This class allows for the native view hierarchy to not be an exact copy of the hierarchy\n * received from JS by keeping track of both JS children (e.g. {@link #getChildCount()} and\n * separately native children (e.g. {@link #getNativeChildCount()}). See {@link\n * NativeViewHierarchyOptimizer} for more information.\n */\n@ReactPropertyHolder\npublic class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl> {\n\n  private int mReactTag;\n  private @Nullable String mViewClassName;\n  private @Nullable ReactShadowNodeImpl mRootNode;\n  private @Nullable ThemedReactContext mThemedContext;\n  private boolean mShouldNotifyOnLayout;\n  private boolean mNodeUpdated = true;\n  private @Nullable ArrayList<ReactShadowNodeImpl> mChildren;\n  private @Nullable ReactShadowNodeImpl mParent;\n\n  // layout-only nodes\n  private boolean mIsLayoutOnly;\n  private int mTotalNativeChildren = 0;\n  private @Nullable ReactShadowNodeImpl mNativeParent;\n  private @Nullable ArrayList<ReactShadowNodeImpl> mNativeChildren;\n  private int mScreenX;\n  private int mScreenY;\n  private int mScreenWidth;\n  private int mScreenHeight;\n  private final Spacing mDefaultPadding = new Spacing(0);\n  private final float[] mPadding = new float[Spacing.ALL + 1];\n  private final boolean[] mPaddingIsPercent = new boolean[Spacing.ALL + 1];\n  private final YogaNode mYogaNode;\n  private static YogaConfig sYogaConfig;\n\n  public ReactShadowNodeImpl() {\n    if (!isVirtual()) {\n      YogaNode node = YogaNodePool.get().acquire();\n      if (sYogaConfig == null) {\n        sYogaConfig = new YogaConfig();\n        sYogaConfig.setPointScaleFactor(0f);\n        sYogaConfig.setUseLegacyStretchBehaviour(true);\n      }\n      if (node == null) {\n        node = new YogaNode(sYogaConfig);\n      }\n      mYogaNode = node;\n      Arrays.fill(mPadding, YogaConstants.UNDEFINED);\n    } else {\n      mYogaNode = null;\n    }\n  }\n\n  /**\n   * Nodes that return {@code true} will be treated as \"virtual\" nodes. That is, nodes that are not\n   * mapped into native views (e.g. nested text node). By default this method returns {@code false}.\n   */\n  @Override\n  public boolean isVirtual() {\n    return false;\n  }\n\n  /**\n   * Nodes that return {@code true} will be treated as a root view for the virtual nodes tree. It\n   * means that {@link NativeViewHierarchyManager} will not try to perform {@code manageChildren}\n   * operation on such views. Good example is {@code InputText} view that may have children {@code\n   * Text} nodes but this whole hierarchy will be mapped to a single android {@link EditText} view.\n   */\n  @Override\n  public boolean isVirtualAnchor() {\n    return false;\n  }\n\n  /**\n   * Nodes that return {@code true} will not manage (and and remove) child Yoga nodes. For example\n   * {@link ReactTextInputShadowNode} or {@link ReactTextShadowNode} have child nodes, which do not\n   * want Yoga to lay out, so in the eyes of Yoga it is a leaf node. Override this method in\n   * subclass to enforce this requirement.\n   */\n  @Override\n  public boolean isYogaLeafNode() {\n    return isMeasureDefined();\n  }\n\n  @Override\n  public final String getViewClass() {\n    return Assertions.assertNotNull(mViewClassName);\n  }\n\n  @Override\n  public final boolean hasUpdates() {\n    return mNodeUpdated || hasNewLayout() || isDirty();\n  }\n\n  @Override\n  public final void markUpdateSeen() {\n    mNodeUpdated = false;\n    if (hasNewLayout()) {\n      markLayoutSeen();\n    }\n  }\n\n  @Override\n  public void markUpdated() {\n    if (mNodeUpdated) {\n      return;\n    }\n    mNodeUpdated = true;\n    ReactShadowNodeImpl parent = getParent();\n    if (parent != null) {\n      parent.markUpdated();\n    }\n  }\n\n  @Override\n  public final boolean hasUnseenUpdates() {\n    return mNodeUpdated;\n  }\n\n  @Override\n  public void dirty() {\n    if (!isVirtual()) {\n      mYogaNode.dirty();\n    }\n  }\n\n  @Override\n  public final boolean isDirty() {\n    return mYogaNode != null && mYogaNode.isDirty();\n  }\n\n  @Override\n  public void addChildAt(ReactShadowNodeImpl child, int i) {\n    if (child.getParent() != null) {\n      throw new IllegalViewOperationException(\n        \"Tried to add child that already has a parent! Remove it from its parent first.\");\n    }\n    if (mChildren == null) {\n      mChildren = new ArrayList<ReactShadowNodeImpl>(4);\n    }\n    mChildren.add(i, child);\n    child.mParent = this;\n\n    // If a CSS node has measure defined, the layout algorithm will not visit its children. Even\n    // more, it asserts that you don't add children to nodes with measure functions.\n    if (mYogaNode != null && !isYogaLeafNode()) {\n      YogaNode childYogaNode = child.mYogaNode;\n      if (childYogaNode == null) {\n        throw new RuntimeException(\n            \"Cannot add a child that doesn't have a YogaNode to a parent without a measure \"\n                + \"function! (Trying to add a '\"\n                + child.getClass().getSimpleName()\n                + \"' to a '\"\n                + getClass().getSimpleName()\n                + \"')\");\n      }\n      mYogaNode.addChildAt(childYogaNode, i);\n    }\n    markUpdated();\n\n    int increase = child.isLayoutOnly() ? child.getTotalNativeChildren() : 1;\n    mTotalNativeChildren += increase;\n\n    updateNativeChildrenCountInParent(increase);\n  }\n\n  @Override\n  public ReactShadowNodeImpl removeChildAt(int i) {\n    if (mChildren == null) {\n      throw new ArrayIndexOutOfBoundsException(\n        \"Index \" + i + \" out of bounds: node has no children\");\n    }\n    ReactShadowNodeImpl removed = mChildren.remove(i);\n    removed.mParent = null;\n\n    if (mYogaNode != null && !isYogaLeafNode()) {\n      mYogaNode.removeChildAt(i);\n    }\n    markUpdated();\n\n    int decrease = removed.isLayoutOnly() ? removed.getTotalNativeChildren() : 1;\n    mTotalNativeChildren -= decrease;\n    updateNativeChildrenCountInParent(-decrease);\n    return removed;\n  }\n\n  @Override\n  public final int getChildCount() {\n    return mChildren == null ? 0 : mChildren.size();\n  }\n\n  @Override\n  public final ReactShadowNodeImpl getChildAt(int i) {\n    if (mChildren == null) {\n      throw new ArrayIndexOutOfBoundsException(\n        \"Index \" + i + \" out of bounds: node has no children\");\n    }\n    return mChildren.get(i);\n  }\n\n  @Override\n  public final int indexOf(ReactShadowNodeImpl child) {\n    return mChildren == null ? -1 : mChildren.indexOf(child);\n  }\n\n  @Override\n  public void removeAndDisposeAllChildren() {\n    if (getChildCount() == 0) {\n      return;\n    }\n\n    int decrease = 0;\n    for (int i = getChildCount() - 1; i >= 0; i--) {\n      if (mYogaNode != null && !isYogaLeafNode()) {\n        mYogaNode.removeChildAt(i);\n      }\n      ReactShadowNodeImpl toRemove = getChildAt(i);\n      toRemove.mParent = null;\n      toRemove.dispose();\n\n      decrease += toRemove.isLayoutOnly() ? toRemove.getTotalNativeChildren() : 1;\n    }\n    Assertions.assertNotNull(mChildren).clear();\n    markUpdated();\n\n    mTotalNativeChildren -= decrease;\n    updateNativeChildrenCountInParent(-decrease);\n  }\n\n  private void updateNativeChildrenCountInParent(int delta) {\n    if (mIsLayoutOnly) {\n      ReactShadowNodeImpl parent = getParent();\n      while (parent != null) {\n        parent.mTotalNativeChildren += delta;\n        if (!parent.isLayoutOnly()) {\n          break;\n        }\n        parent = parent.getParent();\n      }\n    }\n  }\n\n  /**\n   * This method will be called by {@link UIManagerModule} once per batch, before calculating\n   * layout. Will be only called for nodes that are marked as updated with {@link #markUpdated()} or\n   * require layouting (marked with {@link #dirty()}).\n   */\n  @Override\n  public void onBeforeLayout() {}\n\n  @Override\n  public final void updateProperties(ReactStylesDiffMap props) {\n    ViewManagerPropertyUpdater.updateProps(this, props);\n    onAfterUpdateTransaction();\n  }\n\n  @Override\n  public void onAfterUpdateTransaction() {\n    // no-op\n  }\n\n  /**\n   * Called after layout step at the end of the UI batch from {@link UIManagerModule}. May be used\n   * to enqueue additional ui operations for the native view. Will only be called on nodes marked as\n   * updated either with {@link #dirty()} or {@link #markUpdated()}.\n   *\n   * @param uiViewOperationQueue interface for enqueueing UI operations\n   */\n  @Override\n  public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {}\n\n  /** @return true if layout (position or dimensions) changed, false otherwise. */\n  @Override\n  public boolean dispatchUpdates(\n      float absoluteX,\n      float absoluteY,\n      UIViewOperationQueue uiViewOperationQueue,\n      NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer) {\n    if (mNodeUpdated) {\n      onCollectExtraUpdates(uiViewOperationQueue);\n    }\n\n    if (hasNewLayout()) {\n      float layoutX = getLayoutX();\n      float layoutY = getLayoutY();\n      int newAbsoluteLeft = Math.round(absoluteX + layoutX);\n      int newAbsoluteTop = Math.round(absoluteY + layoutY);\n      int newAbsoluteRight = Math.round(absoluteX + layoutX + getLayoutWidth());\n      int newAbsoluteBottom = Math.round(absoluteY + layoutY + getLayoutHeight());\n\n      int newScreenX = Math.round(layoutX);\n      int newScreenY = Math.round(layoutY);\n      int newScreenWidth = newAbsoluteRight - newAbsoluteLeft;\n      int newScreenHeight = newAbsoluteBottom - newAbsoluteTop;\n\n      boolean layoutHasChanged =\n          newScreenX != mScreenX\n              || newScreenY != mScreenY\n              || newScreenWidth != mScreenWidth\n              || newScreenHeight != mScreenHeight;\n\n      mScreenX = newScreenX;\n      mScreenY = newScreenY;\n      mScreenWidth = newScreenWidth;\n      mScreenHeight = newScreenHeight;\n\n      if (layoutHasChanged) {\n        nativeViewHierarchyOptimizer.handleUpdateLayout(this);\n      }\n\n      return layoutHasChanged;\n    } else {\n      return false;\n    }\n  }\n\n  @Override\n  public final int getReactTag() {\n    return mReactTag;\n  }\n\n  @Override\n  public void setReactTag(int reactTag) {\n    mReactTag = reactTag;\n  }\n\n  @Override\n  public final ReactShadowNodeImpl getRootNode() {\n    return Assertions.assertNotNull(mRootNode);\n  }\n\n  @Override\n  public final void setRootNode(ReactShadowNodeImpl rootNode) {\n    mRootNode = rootNode;\n  }\n\n  @Override\n  public final void setViewClassName(String viewClassName) {\n    mViewClassName = viewClassName;\n  }\n\n  @Override\n  public final @Nullable ReactShadowNodeImpl getParent() {\n    return mParent;\n  }\n\n  /**\n   * Get the {@link ThemedReactContext} associated with this {@link ReactShadowNodeImpl}. This will\n   * never change during the lifetime of a {@link ReactShadowNodeImpl} instance, but different\n   * instances can have different contexts; don't cache any calculations based on theme values\n   * globally.\n   */\n  @Override\n  public final ThemedReactContext getThemedContext() {\n    return Assertions.assertNotNull(mThemedContext);\n  }\n\n  @Override\n  public void setThemedContext(ThemedReactContext themedContext) {\n    mThemedContext = themedContext;\n  }\n\n  @Override\n  public final boolean shouldNotifyOnLayout() {\n    return mShouldNotifyOnLayout;\n  }\n\n  @Override\n  public void calculateLayout() {\n    mYogaNode.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);\n  }\n\n  @Override\n  public final boolean hasNewLayout() {\n    return mYogaNode != null && mYogaNode.hasNewLayout();\n  }\n\n  @Override\n  public final void markLayoutSeen() {\n    if (mYogaNode != null) {\n      mYogaNode.markLayoutSeen();\n    }\n  }\n\n  /**\n   * Adds a child that the native view hierarchy will have at this index in the native view\n   * corresponding to this node.\n   */\n  @Override\n  public final void addNativeChildAt(ReactShadowNodeImpl child, int nativeIndex) {\n    Assertions.assertCondition(!mIsLayoutOnly);\n    Assertions.assertCondition(!child.mIsLayoutOnly);\n\n    if (mNativeChildren == null) {\n      mNativeChildren = new ArrayList<>(4);\n    }\n\n    mNativeChildren.add(nativeIndex, child);\n    child.mNativeParent = this;\n  }\n\n  @Override\n  public final ReactShadowNodeImpl removeNativeChildAt(int i) {\n    Assertions.assertNotNull(mNativeChildren);\n    ReactShadowNodeImpl removed = mNativeChildren.remove(i);\n    removed.mNativeParent = null;\n    return removed;\n  }\n\n  @Override\n  public final void removeAllNativeChildren() {\n    if (mNativeChildren != null) {\n      for (int i = mNativeChildren.size() - 1; i >= 0; i--) {\n        mNativeChildren.get(i).mNativeParent = null;\n      }\n      mNativeChildren.clear();\n    }\n  }\n\n  @Override\n  public final int getNativeChildCount() {\n    return mNativeChildren == null ? 0 : mNativeChildren.size();\n  }\n\n  @Override\n  public final int indexOfNativeChild(ReactShadowNodeImpl nativeChild) {\n    Assertions.assertNotNull(mNativeChildren);\n    return mNativeChildren.indexOf(nativeChild);\n  }\n\n  @Override\n  public final @Nullable ReactShadowNodeImpl getNativeParent() {\n    return mNativeParent;\n  }\n\n  /**\n   * Sets whether this node only contributes to the layout of its children without doing any drawing\n   * or functionality itself.\n   */\n  @Override\n  public final void setIsLayoutOnly(boolean isLayoutOnly) {\n    Assertions.assertCondition(getParent() == null, \"Must remove from no opt parent first\");\n    Assertions.assertCondition(mNativeParent == null, \"Must remove from native parent first\");\n    Assertions.assertCondition(getNativeChildCount() == 0, \"Must remove all native children first\");\n    mIsLayoutOnly = isLayoutOnly;\n  }\n\n  @Override\n  public final boolean isLayoutOnly() {\n    return mIsLayoutOnly;\n  }\n\n  @Override\n  public final int getTotalNativeChildren() {\n    return mTotalNativeChildren;\n  }\n\n  @Override\n  public boolean isDescendantOf(ReactShadowNodeImpl ancestorNode) {\n    ReactShadowNodeImpl parentNode = getParent();\n\n    boolean isDescendant = false;\n\n    while (parentNode != null) {\n      if (parentNode == ancestorNode) {\n        isDescendant = true;\n        break;\n      } else {\n        parentNode = parentNode.getParent();\n      }\n    }\n\n    return isDescendant;\n  }\n\n  /*\n   * In some cases we need a way to specify some environmental data to shadow node\n   * to improve layout (or do something similar), so {@code localData} serves these needs.\n   * For example, any stateful embedded native views may benefit from this.\n   * Have in mind that this data is not supposed to interfere with the state of\n   * the shadow node.\n   * Please respect one-directional data flow of React.\n   * Use  {@link ReactUIManagerModule#setViewLocalData} to set this property\n   * (to provide local/environmental data for a shadow node) from the main thread.\n   */\n  public void setLocalData(Object data) {}\n\n  /**\n   * Returns the offset within the native children owned by all layout-only nodes in the subtree\n   * rooted at this node for the given child. Put another way, this returns the number of native\n   * nodes (nodes not optimized out of the native tree) that are a) to the left (visited before by a\n   * DFS) of the given child in the subtree rooted at this node and b) do not have a native parent\n   * in this subtree (which means that the given child will be a sibling of theirs in the final\n   * native hierarchy since they'll get attached to the same native parent).\n   *\n   * <p>Basically, a view might have children that have been optimized away by {@link\n   * NativeViewHierarchyOptimizer}. Since those children will then add their native children to this\n   * view, we now have ranges of native children that correspond to single unoptimized children. The\n   * purpose of this method is to return the index within the native children that corresponds to\n   * the **start** of the native children that belong to the given child. Also, note that all of the\n   * children of a view might be optimized away, so this could return the same value for multiple\n   * different children.\n   *\n   * <p>Example. Native children are represented by (N) where N is the no-opt child they came from.\n   * If no children are optimized away it'd look like this: (0) (1) (2) (3) ... (n)\n   *\n   * <p>In case some children are optimized away, it might look like this: (0) (1) (1) (1) (3) (3)\n   * (4)\n   *\n   * <p>In that case: getNativeOffsetForChild(Node 0) => 0 getNativeOffsetForChild(Node 1) => 1\n   * getNativeOffsetForChild(Node 2) => 4 getNativeOffsetForChild(Node 3) => 4\n   *\n   * <p>getNativeOffsetForChild(Node 4) => 6\n   */\n  @Override\n  public final int getNativeOffsetForChild(ReactShadowNodeImpl child) {\n    int index = 0;\n    boolean found = false;\n    for (int i = 0; i < getChildCount(); i++) {\n      ReactShadowNodeImpl current = getChildAt(i);\n      if (child == current) {\n        found = true;\n        break;\n      }\n      index += (current.isLayoutOnly() ? current.getTotalNativeChildren() : 1);\n    }\n    if (!found) {\n      throw new RuntimeException(\n          \"Child \" + child.getReactTag() + \" was not a child of \" + mReactTag);\n    }\n    return index;\n  }\n\n  @Override\n  public final float getLayoutX() {\n    return mYogaNode.getLayoutX();\n  }\n\n  @Override\n  public final float getLayoutY() {\n    return mYogaNode.getLayoutY();\n  }\n\n  @Override\n  public final float getLayoutWidth() {\n    return mYogaNode.getLayoutWidth();\n  }\n\n  @Override\n  public final float getLayoutHeight() {\n    return mYogaNode.getLayoutHeight();\n  }\n\n  /** @return the x position of the corresponding view on the screen, rounded to pixels */\n  @Override\n  public int getScreenX() {\n    return mScreenX;\n  }\n\n  /** @return the y position of the corresponding view on the screen, rounded to pixels */\n  @Override\n  public int getScreenY() {\n    return mScreenY;\n  }\n\n  /** @return width corrected for rounding to pixels. */\n  @Override\n  public int getScreenWidth() {\n    return mScreenWidth;\n  }\n\n  /** @return height corrected for rounding to pixels. */\n  @Override\n  public int getScreenHeight() {\n    return mScreenHeight;\n  }\n\n  @Override\n  public final YogaDirection getLayoutDirection() {\n    return mYogaNode.getLayoutDirection();\n  }\n\n  @Override\n  public void setLayoutDirection(YogaDirection direction) {\n    mYogaNode.setDirection(direction);\n  }\n\n  @Override\n  public final YogaValue getStyleWidth() {\n    return mYogaNode.getWidth();\n  }\n\n  @Override\n  public void setStyleWidth(float widthPx) {\n    mYogaNode.setWidth(widthPx);\n  }\n\n  @Override\n  public void setStyleWidthPercent(float percent) {\n    mYogaNode.setWidthPercent(percent);\n  }\n\n  @Override\n  public void setStyleWidthAuto() {\n    mYogaNode.setWidthAuto();\n  }\n\n  @Override\n  public void setStyleMinWidth(float widthPx) {\n    mYogaNode.setMinWidth(widthPx);\n  }\n\n  @Override\n  public void setStyleMinWidthPercent(float percent) {\n    mYogaNode.setMinWidthPercent(percent);\n  }\n\n  @Override\n  public void setStyleMaxWidth(float widthPx) {\n    mYogaNode.setMaxWidth(widthPx);\n  }\n\n  @Override\n  public void setStyleMaxWidthPercent(float percent) {\n    mYogaNode.setMaxWidthPercent(percent);\n  }\n\n  @Override\n  public final YogaValue getStyleHeight() {\n    return mYogaNode.getHeight();\n  }\n\n  @Override\n  public void setStyleHeight(float heightPx) {\n    mYogaNode.setHeight(heightPx);\n  }\n\n  @Override\n  public void setStyleHeightPercent(float percent) {\n    mYogaNode.setHeightPercent(percent);\n  }\n\n  @Override\n  public void setStyleHeightAuto() {\n    mYogaNode.setHeightAuto();\n  }\n\n  @Override\n  public void setStyleMinHeight(float widthPx) {\n    mYogaNode.setMinHeight(widthPx);\n  }\n\n  @Override\n  public void setStyleMinHeightPercent(float percent) {\n    mYogaNode.setMinHeightPercent(percent);\n  }\n\n  @Override\n  public void setStyleMaxHeight(float widthPx) {\n    mYogaNode.setMaxHeight(widthPx);\n  }\n\n  @Override\n  public void setStyleMaxHeightPercent(float percent) {\n    mYogaNode.setMaxHeightPercent(percent);\n  }\n\n  @Override\n  public void setFlex(float flex) {\n    mYogaNode.setFlex(flex);\n  }\n\n  @Override\n  public void setFlexGrow(float flexGrow) {\n    mYogaNode.setFlexGrow(flexGrow);\n  }\n\n  @Override\n  public void setFlexShrink(float flexShrink) {\n    mYogaNode.setFlexShrink(flexShrink);\n  }\n\n  @Override\n  public void setFlexBasis(float flexBasis) {\n    mYogaNode.setFlexBasis(flexBasis);\n  }\n\n  @Override\n  public void setFlexBasisAuto() {\n    mYogaNode.setFlexBasisAuto();\n  }\n\n  @Override\n  public void setFlexBasisPercent(float percent) {\n    mYogaNode.setFlexBasisPercent(percent);\n  }\n\n  @Override\n  public void setStyleAspectRatio(float aspectRatio) {\n    mYogaNode.setAspectRatio(aspectRatio);\n  }\n\n  @Override\n  public void setFlexDirection(YogaFlexDirection flexDirection) {\n    mYogaNode.setFlexDirection(flexDirection);\n  }\n\n  @Override\n  public void setFlexWrap(YogaWrap wrap) {\n    mYogaNode.setWrap(wrap);\n  }\n\n  @Override\n  public void setAlignSelf(YogaAlign alignSelf) {\n    mYogaNode.setAlignSelf(alignSelf);\n  }\n\n  @Override\n  public void setAlignItems(YogaAlign alignItems) {\n    mYogaNode.setAlignItems(alignItems);\n  }\n\n  @Override\n  public void setAlignContent(YogaAlign alignContent) {\n    mYogaNode.setAlignContent(alignContent);\n  }\n\n  @Override\n  public void setJustifyContent(YogaJustify justifyContent) {\n    mYogaNode.setJustifyContent(justifyContent);\n  }\n\n  @Override\n  public void setOverflow(YogaOverflow overflow) {\n    mYogaNode.setOverflow(overflow);\n  }\n\n  @Override\n  public void setDisplay(YogaDisplay display) {\n    mYogaNode.setDisplay(display);\n  }\n\n  @Override\n  public void setMargin(int spacingType, float margin) {\n    mYogaNode.setMargin(YogaEdge.fromInt(spacingType), margin);\n  }\n\n  @Override\n  public void setMarginPercent(int spacingType, float percent) {\n    mYogaNode.setMarginPercent(YogaEdge.fromInt(spacingType), percent);\n  }\n\n  @Override\n  public void setMarginAuto(int spacingType) {\n    mYogaNode.setMarginAuto(YogaEdge.fromInt(spacingType));\n  }\n\n  @Override\n  public final float getPadding(int spacingType) {\n    return mYogaNode.getLayoutPadding(YogaEdge.fromInt(spacingType));\n  }\n\n  @Override\n  public final YogaValue getStylePadding(int spacingType) {\n    return mYogaNode.getPadding(YogaEdge.fromInt(spacingType));\n  }\n\n  @Override\n  public void setDefaultPadding(int spacingType, float padding) {\n    mDefaultPadding.set(spacingType, padding);\n    updatePadding();\n  }\n\n  @Override\n  public void setPadding(int spacingType, float padding) {\n    mPadding[spacingType] = padding;\n    mPaddingIsPercent[spacingType] = false;\n    updatePadding();\n  }\n\n  @Override\n  public void setPaddingPercent(int spacingType, float percent) {\n    mPadding[spacingType] = percent;\n    mPaddingIsPercent[spacingType] = !YogaConstants.isUndefined(percent);\n    updatePadding();\n  }\n\n  private void updatePadding() {\n    for (int spacingType = Spacing.LEFT; spacingType <= Spacing.ALL; spacingType++) {\n      if (spacingType == Spacing.LEFT\n          || spacingType == Spacing.RIGHT\n          || spacingType == Spacing.START\n          || spacingType == Spacing.END) {\n        if (YogaConstants.isUndefined(mPadding[spacingType])\n            && YogaConstants.isUndefined(mPadding[Spacing.HORIZONTAL])\n            && YogaConstants.isUndefined(mPadding[Spacing.ALL])) {\n          mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mDefaultPadding.getRaw(spacingType));\n          continue;\n        }\n      } else if (spacingType == Spacing.TOP || spacingType == Spacing.BOTTOM) {\n        if (YogaConstants.isUndefined(mPadding[spacingType])\n            && YogaConstants.isUndefined(mPadding[Spacing.VERTICAL])\n            && YogaConstants.isUndefined(mPadding[Spacing.ALL])) {\n          mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mDefaultPadding.getRaw(spacingType));\n          continue;\n        }\n      } else {\n        if (YogaConstants.isUndefined(mPadding[spacingType])) {\n          mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mDefaultPadding.getRaw(spacingType));\n          continue;\n        }\n      }\n\n      if (mPaddingIsPercent[spacingType]) {\n        mYogaNode.setPaddingPercent(YogaEdge.fromInt(spacingType), mPadding[spacingType]);\n      } else {\n        mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mPadding[spacingType]);\n      }\n    }\n  }\n\n  @Override\n  public void setBorder(int spacingType, float borderWidth) {\n    mYogaNode.setBorder(YogaEdge.fromInt(spacingType), borderWidth);\n  }\n\n  @Override\n  public void setPosition(int spacingType, float position) {\n    mYogaNode.setPosition(YogaEdge.fromInt(spacingType), position);\n  }\n\n  @Override\n  public void setPositionPercent(int spacingType, float percent) {\n    mYogaNode.setPositionPercent(YogaEdge.fromInt(spacingType), percent);\n  }\n\n  @Override\n  public void setPositionType(YogaPositionType positionType) {\n    mYogaNode.setPositionType(positionType);\n  }\n\n  @Override\n  public void setShouldNotifyOnLayout(boolean shouldNotifyOnLayout) {\n    mShouldNotifyOnLayout = shouldNotifyOnLayout;\n  }\n\n  @Override\n  public void setBaselineFunction(YogaBaselineFunction baselineFunction) {\n    mYogaNode.setBaselineFunction(baselineFunction);\n  }\n\n  @Override\n  public void setMeasureFunction(YogaMeasureFunction measureFunction) {\n    if ((measureFunction == null ^ mYogaNode.isMeasureDefined()) && getChildCount() != 0) {\n      throw new RuntimeException(\n          \"Since a node with a measure function does not add any native yoga children, it's \"\n              + \"not safe to transition to/from having a measure function unless a node has no children\");\n    }\n    mYogaNode.setMeasureFunction(measureFunction);\n  }\n\n  @Override\n  public boolean isMeasureDefined() {\n    return mYogaNode.isMeasureDefined();\n  }\n\n  @Override\n  public String toString() {\n    StringBuilder sb = new StringBuilder();\n    toStringWithIndentation(sb, 0);\n    return sb.toString();\n  }\n\n  private void toStringWithIndentation(StringBuilder result, int level) {\n    // Spaces and tabs are dropped by IntelliJ logcat integration, so rely on __ instead.\n    for (int i = 0; i < level; ++i) {\n      result.append(\"__\");\n    }\n\n    result.append(getClass().getSimpleName()).append(\" \");\n    if (mYogaNode != null) {\n      result.append(getLayoutWidth()).append(\",\").append(getLayoutHeight());\n    } else {\n      result.append(\"(virtual node)\");\n    }\n    result.append(\"\\n\");\n\n    if (getChildCount() == 0) {\n      return;\n    }\n\n    for (int i = 0; i < getChildCount(); i++) {\n      getChildAt(i).toStringWithIndentation(result, level + 1);\n    }\n  }\n\n  @Override\n  public void dispose() {\n    if (mYogaNode != null) {\n      mYogaNode.reset();\n      YogaNodePool.get().release(mYogaNode);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStylesDiffMap.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport javax.annotation.Nullable;\n\nimport android.view.View;\n\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.Dynamic;\n\n/**\n * Wrapper for {@link ReadableMap} which should be used for styles property map. It extends\n * some of the accessor methods of {@link ReadableMap} by adding a default value property\n * such that caller is enforced to provide a default value for a style property.\n *\n * Instances of this class are used to update {@link View} or {@link CSSNode} style properties.\n * Since properties are generated by React framework based on what has been updated each value\n * in this map should either be interpreted as a new value set for a style property or as a \"reset\n * this property to default\" command in case when value is null (this is a way React communicates\n * change in which the style key that was previously present in a map has been removed).\n *\n * NOTE: Accessor method with default value will throw an exception when the key is not present in\n * the map. Style applicator logic should verify whether the key exists in the map using\n * {@link #hasKey} before fetching the value. The motivation behind this is that in case when the\n * updated style diff map doesn't contain a certain style key it means that the corresponding view\n * property shouldn't be updated (whereas in all other cases it should be updated to the new value\n * or the property should be reset).\n */\npublic class ReactStylesDiffMap {\n\n  /* package */ final ReadableMap mBackingMap;\n\n  public ReactStylesDiffMap(ReadableMap props) {\n    mBackingMap = props;\n  }\n\n  public boolean hasKey(String name) {\n    return mBackingMap.hasKey(name);\n  }\n\n  public boolean isNull(String name) {\n    return mBackingMap.isNull(name);\n  }\n\n  public boolean getBoolean(String name, boolean restoreNullToDefaultValue) {\n    return mBackingMap.isNull(name) ? restoreNullToDefaultValue : mBackingMap.getBoolean(name);\n  }\n\n  public double getDouble(String name, double restoreNullToDefaultValue) {\n    return mBackingMap.isNull(name) ? restoreNullToDefaultValue : mBackingMap.getDouble(name);\n  }\n\n  public float getFloat(String name, float restoreNullToDefaultValue) {\n    return mBackingMap.isNull(name) ?\n        restoreNullToDefaultValue : (float) mBackingMap.getDouble(name);\n  }\n\n  public int getInt(String name, int restoreNullToDefaultValue) {\n    return mBackingMap.isNull(name) ? restoreNullToDefaultValue : mBackingMap.getInt(name);\n  }\n\n  @Nullable\n  public String getString(String name) {\n    return mBackingMap.getString(name);\n  }\n\n  @Nullable\n  public ReadableArray getArray(String key) {\n    return mBackingMap.getArray(key);\n  }\n\n  @Nullable\n  public ReadableMap getMap(String key) {\n    return mBackingMap.getMap(key);\n  }\n\n  @Nullable\n  public Dynamic getDynamic(String key) {\n    return mBackingMap.getDynamic(key);\n  }\n\n  @Override\n  public String toString() {\n    return \"{ \" + getClass().getSimpleName() + \": \" + mBackingMap.toString() + \" }\";\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactZIndexedViewGroup.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager;\n\n/**\n * ViewGroup that supports z-index.\n */\npublic interface ReactZIndexedViewGroup {\n  /**\n   * Determine the index of a child view at {@param index} considering z-index.\n   * @param index The child view index\n   * @return The child view index considering z-index\n   */\n  int getZIndexMappedChildIndex(int index);\n\n  /**\n   * Redraw the view based on updated child z-index. This should be called after updating one of its child\n   * z-index.\n   */\n  void updateDrawingOrder();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.util.SparseArray;\nimport android.util.SparseBooleanArray;\nimport com.facebook.react.common.SingleThreadAsserter;\n\n/**\n * Simple container class to keep track of {@link ReactShadowNode}s associated with a particular\n * UIManagerModule instance.\n */\npublic class ShadowNodeRegistry {\n\n  private final SparseArray<ReactShadowNode> mTagsToCSSNodes;\n  private final SparseBooleanArray mRootTags;\n  private final SingleThreadAsserter mThreadAsserter;\n\n  public ShadowNodeRegistry() {\n    mTagsToCSSNodes = new SparseArray<>();\n    mRootTags = new SparseBooleanArray();\n    mThreadAsserter = new SingleThreadAsserter();\n  }\n\n  public void addRootNode(ReactShadowNode node) {\n    // TODO(6242243): This should be asserted... but UIManagerModule is\n    // thread-unsafe and calls this on the wrong thread.\n    //mThreadAsserter.assertNow();\n    int tag = node.getReactTag();\n    mTagsToCSSNodes.put(tag, node);\n    mRootTags.put(tag, true);\n  }\n\n  public void removeRootNode(int tag) {\n    mThreadAsserter.assertNow();\n    if (!mRootTags.get(tag)) {\n      throw new IllegalViewOperationException(\n          \"View with tag \" + tag + \" is not registered as a root view\");\n    }\n\n    mTagsToCSSNodes.remove(tag);\n    mRootTags.delete(tag);\n  }\n\n  public void addNode(ReactShadowNode node) {\n    mThreadAsserter.assertNow();\n    mTagsToCSSNodes.put(node.getReactTag(), node);\n  }\n\n  public void removeNode(int tag) {\n    mThreadAsserter.assertNow();\n    if (mRootTags.get(tag)) {\n      throw new IllegalViewOperationException(\n          \"Trying to remove root node \" + tag + \" without using removeRootNode!\");\n    }\n    mTagsToCSSNodes.remove(tag);\n  }\n\n  public ReactShadowNode getNode(int tag) {\n    mThreadAsserter.assertNow();\n    return mTagsToCSSNodes.get(tag);\n  }\n\n  public boolean isRootNode(int tag) {\n    mThreadAsserter.assertNow();\n    return mRootTags.get(tag);\n  }\n\n  public int getRootNodeCount() {\n    mThreadAsserter.assertNow();\n    return mRootTags.size();\n  }\n\n  public int getRootTag(int index) {\n    mThreadAsserter.assertNow();\n    return mRootTags.keyAt(index);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/SizeMonitoringFrameLayout.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport javax.annotation.Nullable;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.widget.FrameLayout;\n\n/**\n * Subclass of {@link FrameLayout} that allows registering for size change events. The main purpose\n * for this class is to hide complexity of {@link ReactRootView} from the code under\n * {@link com.facebook.react.uimanager} package.\n */\npublic class SizeMonitoringFrameLayout extends FrameLayout {\n\n  public static interface OnSizeChangedListener {\n    void onSizeChanged(int width, int height, int oldWidth, int oldHeight);\n  }\n\n  private @Nullable OnSizeChangedListener mOnSizeChangedListener;\n\n  public SizeMonitoringFrameLayout(Context context) {\n    super(context);\n  }\n\n  public SizeMonitoringFrameLayout(Context context, AttributeSet attrs) {\n    super(context, attrs);\n  }\n\n  public SizeMonitoringFrameLayout(Context context, AttributeSet attrs, int defStyle) {\n    super(context, attrs, defStyle);\n  }\n\n  public void setOnSizeChangedListener(OnSizeChangedListener onSizeChangedListener) {\n    mOnSizeChangedListener = onSizeChangedListener;\n  }\n\n  @Override\n  protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n    super.onSizeChanged(w, h, oldw, oldh);\n\n    if (mOnSizeChangedListener != null) {\n      mOnSizeChangedListener.onSizeChanged(w, h, oldw, oldh);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/Spacing.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport com.facebook.yoga.YogaConstants;\n\nimport java.util.Arrays;\n\n/**\n * Class representing CSS spacing (padding, margin, and borders). This is mostly necessary to\n * properly implement interactions and updates for properties like margin, marginLeft, and\n * marginHorizontal.\n */\npublic class Spacing {\n\n  /**\n   * Spacing type that represents the left direction. E.g. {@code marginLeft}.\n   */\n  public static final int LEFT = 0;\n  /**\n   * Spacing type that represents the top direction. E.g. {@code marginTop}.\n   */\n  public static final int TOP = 1;\n  /**\n   * Spacing type that represents the right direction. E.g. {@code marginRight}.\n   */\n  public static final int RIGHT = 2;\n  /**\n   * Spacing type that represents the bottom direction. E.g. {@code marginBottom}.\n   */\n  public static final int BOTTOM = 3;\n  /**\n   * Spacing type that represents start direction e.g. left in left-to-right, right in right-to-left.\n   */\n  public static final int START = 4;\n  /**\n   * Spacing type that represents end direction e.g. right in left-to-right, left in right-to-left.\n   */\n  public static final int END = 5;\n  /**\n   * Spacing type that represents horizontal direction (left and right). E.g.\n   * {@code marginHorizontal}.\n   */\n  public static final int HORIZONTAL = 6;\n  /**\n   * Spacing type that represents vertical direction (top and bottom). E.g. {@code marginVertical}.\n   */\n  public static final int VERTICAL = 7;\n  /**\n   * Spacing type that represents all directions (left, top, right, bottom). E.g. {@code margin}.\n   */\n  public static final int ALL = 8;\n\n  private static final int[] sFlagsMap = {\n    1, /*LEFT*/\n    2, /*TOP*/\n    4, /*RIGHT*/\n    8, /*BOTTOM*/\n    16, /*START*/\n    32, /*END*/\n    64, /*HORIZONTAL*/\n    128, /*VERTICAL*/\n    256, /*ALL*/\n  };\n\n  private final float[] mSpacing = newFullSpacingArray();\n  private int mValueFlags = 0;\n  private float mDefaultValue;\n  private boolean mHasAliasesSet;\n\n  public Spacing() {\n    this(0);\n  }\n\n  public Spacing(float defaultValue) {\n    mDefaultValue = defaultValue;\n  }\n\n  /**\n   * Set a spacing value.\n   *\n   * @param spacingType one of {@link #LEFT}, {@link #TOP}, {@link #RIGHT}, {@link #BOTTOM},\n   *        {@link #VERTICAL}, {@link #HORIZONTAL}, {@link #ALL}\n   * @param value the value for this direction\n   * @return {@code true} if the spacing has changed, or {@code false} if the same value was already\n   *         set\n   */\n  public boolean set(int spacingType, float value) {\n    if (!FloatUtil.floatsEqual(mSpacing[spacingType], value)) {\n      mSpacing[spacingType] = value;\n\n      if (YogaConstants.isUndefined(value)) {\n        mValueFlags &= ~sFlagsMap[spacingType];\n      } else {\n        mValueFlags |= sFlagsMap[spacingType];\n      }\n\n      mHasAliasesSet =\n          (mValueFlags & sFlagsMap[ALL]) != 0 ||\n          (mValueFlags & sFlagsMap[VERTICAL]) != 0 ||\n          (mValueFlags & sFlagsMap[HORIZONTAL]) != 0;\n\n      return true;\n    }\n\n    return false;\n  }\n\n  /**\n   * Get the spacing for a direction. This takes into account any default values that have been set.\n   *\n   * @param spacingType one of {@link #LEFT}, {@link #TOP}, {@link #RIGHT}, {@link #BOTTOM}\n   */\n  public float get(int spacingType) {\n    float defaultValue = (spacingType == START || spacingType == END\n        ? YogaConstants.UNDEFINED\n        : mDefaultValue);\n\n    if (mValueFlags == 0) {\n      return defaultValue;\n    }\n\n    if ((mValueFlags & sFlagsMap[spacingType]) != 0) {\n      return mSpacing[spacingType];\n    }\n\n    if (mHasAliasesSet) {\n      int secondType = spacingType == TOP || spacingType == BOTTOM ? VERTICAL : HORIZONTAL;\n      if ((mValueFlags & sFlagsMap[secondType]) != 0) {\n        return mSpacing[secondType];\n      } else if ((mValueFlags & sFlagsMap[ALL]) != 0) {\n        return mSpacing[ALL];\n      }\n    }\n\n    return defaultValue;\n  }\n\n  /**\n   * Get the raw value (that was set using {@link #set(int, float)}), without taking into account\n   * any default values.\n   *\n   * @param spacingType one of {@link #LEFT}, {@link #TOP}, {@link #RIGHT}, {@link #BOTTOM},\n   *        {@link #VERTICAL}, {@link #HORIZONTAL}, {@link #ALL}\n   */\n  public float getRaw(int spacingType) {\n    return mSpacing[spacingType];\n  }\n\n  /**\n   * Resets the spacing instance to its default state. This method is meant to be used when\n   * recycling {@link Spacing} instances.\n   */\n  public void reset() {\n    Arrays.fill(mSpacing, YogaConstants.UNDEFINED);\n    mHasAliasesSet = false;\n    mValueFlags = 0;\n  }\n\n  /**\n   * Try to get start value and fallback to given type if not defined. This is used privately\n   * by the layout engine as a more efficient way to fetch direction-aware values by\n   * avoid extra method invocations.\n   */\n  float getWithFallback(int spacingType, int fallbackType) {\n    return\n        (mValueFlags & sFlagsMap[spacingType]) != 0\n            ? mSpacing[spacingType]\n            : get(fallbackType);\n  }\n\n  private static float[] newFullSpacingArray() {\n    return new float[] {\n        YogaConstants.UNDEFINED,\n        YogaConstants.UNDEFINED,\n        YogaConstants.UNDEFINED,\n        YogaConstants.UNDEFINED,\n        YogaConstants.UNDEFINED,\n        YogaConstants.UNDEFINED,\n        YogaConstants.UNDEFINED,\n        YogaConstants.UNDEFINED,\n        YogaConstants.UNDEFINED,\n    };\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport javax.annotation.Nullable;\n\nimport android.app.Activity;\nimport android.content.Context;\n\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.LifecycleEventListener;\n\n//\n\n/**\n * Wraps {@link ReactContext} with the base {@link Context} passed into the constructor.\n * It provides also a way to start activities using the viewContext to which RN native views belong.\n * It delegates lifecycle listener registration to the original instance of {@link ReactContext}\n * which is supposed to receive the lifecycle events. At the same time we disallow receiving\n * lifecycle events for this wrapper instances.\n * TODO: T7538544 Rename ThemedReactContext to be in alignment with name of ReactApplicationContext\n */\npublic class ThemedReactContext extends ReactContext {\n\n  private final ReactApplicationContext mReactApplicationContext;\n\n  public ThemedReactContext(ReactApplicationContext reactApplicationContext, Context base) {\n    super(base);\n    initializeWithInstance(reactApplicationContext.getCatalystInstance());\n    mReactApplicationContext = reactApplicationContext;\n  }\n\n  @Override\n  public void addLifecycleEventListener(LifecycleEventListener listener) {\n    mReactApplicationContext.addLifecycleEventListener(listener);\n  }\n\n  @Override\n  public void removeLifecycleEventListener(LifecycleEventListener listener) {\n    mReactApplicationContext.removeLifecycleEventListener(listener);\n  }\n\n  @Override\n  public boolean hasCurrentActivity() {\n    return mReactApplicationContext.hasCurrentActivity();\n  }\n\n  @Override\n  public @Nullable Activity getCurrentActivity() {\n    return mReactApplicationContext.getCurrentActivity();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Matrix;\nimport android.graphics.PointF;\nimport android.graphics.Rect;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.touch.ReactHitSlopView;\n\n/**\n * Class responsible for identifying which react view should handle a given {@link MotionEvent}.\n * It uses the event coordinates to traverse the view hierarchy and return a suitable view.\n */\npublic class TouchTargetHelper {\n\n  private static final float[] mEventCoords = new float[2];\n  private static final PointF mTempPoint = new PointF();\n  private static final float[] mMatrixTransformCoords = new float[2];\n  private static final Matrix mInverseMatrix = new Matrix();\n\n  /**\n   * Find touch event target view within the provided container given the coordinates provided\n   * via {@link MotionEvent}.\n   *\n   * @param eventX the X screen coordinate of the touch location\n   * @param eventY the Y screen coordinate of the touch location\n   * @param viewGroup the container view to traverse\n   * @return the react tag ID of the child view that should handle the event\n   */\n  public static int findTargetTagForTouch(\n      float eventX,\n      float eventY,\n      ViewGroup viewGroup) {\n    return findTargetTagAndCoordinatesForTouch(\n        eventX, eventY, viewGroup, mEventCoords, null);\n  }\n\n  /**\n   * Find touch event target view within the provided container given the coordinates provided\n   * via {@link MotionEvent}.\n   *\n   * @param eventX the X screen coordinate of the touch location\n   * @param eventY the Y screen coordinate of the touch location\n   * @param viewGroup the container view to traverse\n   * @param nativeViewId the native react view containing this touch target\n   * @return the react tag ID of the child view that should handle the event\n   */\n  public static int findTargetTagForTouch(\n      float eventX,\n      float eventY,\n      ViewGroup viewGroup,\n      @Nullable int[] nativeViewId) {\n    return findTargetTagAndCoordinatesForTouch(\n        eventX, eventY, viewGroup, mEventCoords, nativeViewId);\n  }\n\n  /**\n   * Find touch event target view within the provided container given the coordinates provided\n   * via {@link MotionEvent}.\n   *\n   * @param eventX the X screen coordinate of the touch location\n   * @param eventY the Y screen coordinate of the touch location\n   * @param viewGroup the container view to traverse\n   * @param viewCoords an out parameter that will return the X,Y value in the target view\n   * @param nativeViewTag an out parameter that will return the native view id\n   * @return the react tag ID of the child view that should handle the event\n   */\n  public static int findTargetTagAndCoordinatesForTouch(\n      float eventX,\n      float eventY,\n      ViewGroup viewGroup,\n      float[] viewCoords,\n      @Nullable int[] nativeViewTag) {\n    UiThreadUtil.assertOnUiThread();\n    int targetTag = viewGroup.getId();\n    // Store eventCoords in array so that they are modified to be relative to the targetView found.\n    viewCoords[0] = eventX;\n    viewCoords[1] = eventY;\n    View nativeTargetView = findTouchTargetView(viewCoords, viewGroup);\n    if (nativeTargetView != null) {\n      View reactTargetView = findClosestReactAncestor(nativeTargetView);\n      if (reactTargetView != null) {\n        if (nativeViewTag != null) {\n          nativeViewTag[0] = reactTargetView.getId();\n        }\n        targetTag = getTouchTargetForView(reactTargetView, viewCoords[0], viewCoords[1]);\n      }\n    }\n    return targetTag;\n  }\n\n  private static View findClosestReactAncestor(View view) {\n    while (view != null && view.getId() <= 0) {\n      view = (View) view.getParent();\n    }\n    return view;\n  }\n\n  /**\n   * Returns the touch target View that is either viewGroup or one if its descendants.\n   * This is a recursive DFS since view the entire tree must be parsed until the target is found.\n   * If the search does not backtrack, it is possible to follow a branch that cannot be a target\n   * (because of pointerEvents). For example, if both C and E can be the target of an event:\n   * A (pointerEvents: auto) - B (pointerEvents: box-none) - C (pointerEvents: none)\n   *  \\ D (pointerEvents: auto)  - E (pointerEvents: auto)\n   * If the search goes down the first branch, it would return A as the target, which is incorrect.\n   * NB: This modifies the eventCoords to always be relative to the current viewGroup. When the\n   * method returns, it will contain the eventCoords relative to the targetView found.\n   */\n  private static View findTouchTargetView(float[] eventCoords, ViewGroup viewGroup) {\n    int childrenCount = viewGroup.getChildCount();\n    // Consider z-index when determining the touch target.\n    ReactZIndexedViewGroup zIndexedViewGroup = viewGroup instanceof ReactZIndexedViewGroup ?\n      (ReactZIndexedViewGroup) viewGroup :\n      null;\n    for (int i = childrenCount - 1; i >= 0; i--) {\n      int childIndex = zIndexedViewGroup != null ? zIndexedViewGroup.getZIndexMappedChildIndex(i) : i;\n      View child = viewGroup.getChildAt(childIndex);\n      PointF childPoint = mTempPoint;\n      if (isTransformedTouchPointInView(eventCoords[0], eventCoords[1], viewGroup, child, childPoint)) {\n        // If it is contained within the child View, the childPoint value will contain the view\n        // coordinates relative to the child\n        // We need to store the existing X,Y for the viewGroup away as it is possible this child\n        // will not actually be the target and so we restore them if not\n        float restoreX = eventCoords[0];\n        float restoreY = eventCoords[1];\n        eventCoords[0] = childPoint.x;\n        eventCoords[1] = childPoint.y;\n        View targetView = findTouchTargetViewWithPointerEvents(eventCoords, child);\n        if (targetView != null) {\n          return targetView;\n        }\n        eventCoords[0] = restoreX;\n        eventCoords[1] = restoreY;\n      }\n    }\n    return viewGroup;\n  }\n\n  /**\n   * Returns whether the touch point is within the child View\n   * It is transform aware and will invert the transform Matrix to find the true local points\n   * This code is taken from {@link ViewGroup#isTransformedTouchPointInView()}\n   */\n  private static boolean isTransformedTouchPointInView(\n      float x,\n      float y,\n      ViewGroup parent,\n      View child,\n      PointF outLocalPoint) {\n    float localX = x + parent.getScrollX() - child.getLeft();\n    float localY = y + parent.getScrollY() - child.getTop();\n    Matrix matrix = child.getMatrix();\n    if (!matrix.isIdentity()) {\n      float[] localXY = mMatrixTransformCoords;\n      localXY[0] = localX;\n      localXY[1] = localY;\n      Matrix inverseMatrix = mInverseMatrix;\n      matrix.invert(inverseMatrix);\n      inverseMatrix.mapPoints(localXY);\n      localX = localXY[0];\n      localY = localXY[1];\n    }\n    if (child instanceof ReactHitSlopView && ((ReactHitSlopView) child).getHitSlopRect() != null) {\n      Rect hitSlopRect = ((ReactHitSlopView) child).getHitSlopRect();\n      if ((localX >= -hitSlopRect.left && localX < (child.getRight() - child.getLeft()) + hitSlopRect.right)\n          && (localY >= -hitSlopRect.top && localY < (child.getBottom() - child.getTop()) + hitSlopRect.bottom)) {\n        outLocalPoint.set(localX, localY);\n        return true;\n      }\n\n      return false;\n    } else {\n      if ((localX >= 0 && localX < (child.getRight() - child.getLeft()))\n          && (localY >= 0 && localY < (child.getBottom() - child.getTop()))) {\n        outLocalPoint.set(localX, localY);\n        return true;\n      }\n\n      return false;\n    }\n  }\n\n\n  /**\n   * Returns the touch target View of the event given, or null if neither the given View nor any of\n   * its descendants are the touch target.\n   */\n  private static @Nullable View findTouchTargetViewWithPointerEvents(\n      float eventCoords[], View view) {\n    PointerEvents pointerEvents = view instanceof ReactPointerEventsView ?\n        ((ReactPointerEventsView) view).getPointerEvents() : PointerEvents.AUTO;\n\n    // Views that are disabled should never be the target of pointer events. However, their children\n    // can be because some views (SwipeRefreshLayout) use enabled but still have children that can\n    // be valid targets.\n    if (!view.isEnabled()) {\n      if (pointerEvents == PointerEvents.AUTO) {\n        pointerEvents = PointerEvents.BOX_NONE;\n      } else if (pointerEvents == PointerEvents.BOX_ONLY) {\n        pointerEvents = PointerEvents.NONE;\n      }\n    }\n\n    if (pointerEvents == PointerEvents.NONE) {\n      // This view and its children can't be the target\n      return null;\n\n    } else if (pointerEvents == PointerEvents.BOX_ONLY) {\n      // This view is the target, its children don't matter\n      return view;\n\n    } else if (pointerEvents == PointerEvents.BOX_NONE) {\n      // This view can't be the target, but its children might.\n      if (view instanceof ViewGroup) {\n        View targetView = findTouchTargetView(eventCoords, (ViewGroup) view);\n        if (targetView != view) {\n          return targetView;\n        }\n\n        // PointerEvents.BOX_NONE means that this react element cannot receive pointer events.\n        // However, there might be virtual children that can receive pointer events, in which case\n        // we still want to return this View and dispatch a pointer event to the virtual element.\n        // Note that this currently only applies to Nodes/FlatViewGroup as it's the only class that\n        // is both a ViewGroup and ReactCompoundView (ReactTextView is a ReactCompoundView but not a\n        // ViewGroup).\n        if (view instanceof ReactCompoundView) {\n          int reactTag = ((ReactCompoundView)view).reactTagForTouch(eventCoords[0], eventCoords[1]);\n          if (reactTag != view.getId()) {\n            // make sure we exclude the View itself because of the PointerEvents.BOX_NONE\n            return view;\n          }\n        }\n      }\n      return null;\n\n    } else if (pointerEvents == PointerEvents.AUTO) {\n      // Either this view or one of its children is the target\n      if (view instanceof ReactCompoundViewGroup) {\n        if (((ReactCompoundViewGroup) view).interceptsTouchEvent(eventCoords[0], eventCoords[1])) {\n          return view;\n        }\n      }\n      if (view instanceof ViewGroup) {\n        return findTouchTargetView(eventCoords, (ViewGroup) view);\n      }\n      return view;\n\n    } else {\n      throw new JSApplicationIllegalArgumentException(\n          \"Unknown pointer event type: \" + pointerEvents.toString());\n    }\n  }\n\n  private static int getTouchTargetForView(View targetView, float eventX, float eventY) {\n    if (targetView instanceof ReactCompoundView) {\n      // Use coordinates relative to the view, which have been already computed by\n      // {@link #findTouchTargetView()}.\n      return ((ReactCompoundView) targetView).reactTagForTouch(eventX, eventY);\n    }\n    return targetView.getId();\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.java",
    "content": "package com.facebook.react.uimanager;\n\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.ReadableType;\n\n/**\n * Class providing helper methods for converting transformation list (as accepted by 'transform'\n * view property) into a transformation matrix.\n */\npublic class TransformHelper {\n\n  private static ThreadLocal<double[]> sHelperMatrix = new ThreadLocal<double[]>() {\n    @Override\n    protected double[] initialValue() {\n      return new double[16];\n    }\n  };\n\n  private static double convertToRadians(ReadableMap transformMap, String key) {\n    double value;\n    boolean inRadians = true;\n    if (transformMap.getType(key) == ReadableType.String) {\n      String stringValue = transformMap.getString(key);\n      if (stringValue.endsWith(\"rad\")) {\n        stringValue = stringValue.substring(0, stringValue.length() - 3);\n      } else if (stringValue.endsWith(\"deg\")) {\n        inRadians = false;\n        stringValue = stringValue.substring(0, stringValue.length() - 3);\n      }\n      value = Float.parseFloat(stringValue);\n    } else {\n      value = transformMap.getDouble(key);\n    }\n    return inRadians ? value : MatrixMathHelper.degreesToRadians(value);\n  }\n\n  public static void processTransform(ReadableArray transforms, double[] result) {\n    double[] helperMatrix = sHelperMatrix.get();\n    MatrixMathHelper.resetIdentityMatrix(result);\n\n    for (int transformIdx = 0, size = transforms.size(); transformIdx < size; transformIdx++) {\n      ReadableMap transform = transforms.getMap(transformIdx);\n      String transformType = transform.keySetIterator().nextKey();\n\n      MatrixMathHelper.resetIdentityMatrix(helperMatrix);\n      if (\"matrix\".equals(transformType)) {\n        ReadableArray matrix = transform.getArray(transformType);\n        for (int i = 0; i < 16; i++) {\n          helperMatrix[i] = matrix.getDouble(i);\n        }\n      } else if (\"perspective\".equals(transformType)) {\n        MatrixMathHelper.applyPerspective(helperMatrix, transform.getDouble(transformType));\n      } else if (\"rotateX\".equals(transformType)) {\n        MatrixMathHelper.applyRotateX(\n          helperMatrix,\n          convertToRadians(transform, transformType));\n      } else if (\"rotateY\".equals(transformType)) {\n        MatrixMathHelper.applyRotateY(\n          helperMatrix,\n          convertToRadians(transform, transformType));\n      } else if (\"rotate\".equals(transformType) || \"rotateZ\".equals(transformType)) {\n        MatrixMathHelper.applyRotateZ(\n          helperMatrix,\n          convertToRadians(transform, transformType));\n      } else if (\"scale\".equals(transformType)) {\n        double scale = transform.getDouble(transformType);\n        MatrixMathHelper.applyScaleX(helperMatrix, scale);\n        MatrixMathHelper.applyScaleY(helperMatrix, scale);\n      } else if (\"scaleX\".equals(transformType)) {\n        MatrixMathHelper.applyScaleX(helperMatrix, transform.getDouble(transformType));\n      } else if (\"scaleY\".equals(transformType)) {\n        MatrixMathHelper.applyScaleY(helperMatrix, transform.getDouble(transformType));\n      } else if (\"translate\".equals(transformType)) {\n        ReadableArray value = transform.getArray(transformType);\n        double x = value.getDouble(0);\n        double y = value.getDouble(1);\n        double z = value.size() > 2 ? value.getDouble(2) : 0d;\n        MatrixMathHelper.applyTranslate3D(helperMatrix, x, y, z);\n      } else if (\"translateX\".equals(transformType)) {\n        MatrixMathHelper.applyTranslate2D(helperMatrix, transform.getDouble(transformType), 0d);\n      } else if (\"translateY\".equals(transformType)) {\n        MatrixMathHelper.applyTranslate2D(helperMatrix, 0d, transform.getDouble(transformType));\n      } else if (\"skewX\".equals(transformType)) {\n        MatrixMathHelper.applySkewX(\n          helperMatrix,\n          convertToRadians(transform, transformType));\n      } else if (\"skewY\".equals(transformType)) {\n        MatrixMathHelper.applySkewY(\n          helperMatrix,\n          convertToRadians(transform, transformType));\n      } else {\n        throw new JSApplicationIllegalArgumentException(\"Unsupported transform type: \"\n          + transformType);\n      }\n\n      MatrixMathHelper.multiplyInto(result, result, helperMatrix);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.java",
    "content": "package com.facebook.react.uimanager;\n\nimport android.view.View;\n\n/**\n * A task to execute on the UI View for third party libraries.\n */\npublic interface UIBlock {\n  public void execute(NativeViewHierarchyManager nativeViewHierarchyManager);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\npackage com.facebook.react.uimanager;\n\nimport static android.view.View.MeasureSpec.AT_MOST;\nimport static android.view.View.MeasureSpec.EXACTLY;\nimport static android.view.View.MeasureSpec.UNSPECIFIED;\n\nimport android.os.SystemClock;\nimport android.view.View.MeasureSpec;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.animation.Animation;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.modules.i18nmanager.I18nUtil;\nimport com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.systrace.Systrace;\nimport com.facebook.systrace.SystraceMessage;\nimport com.facebook.yoga.YogaDirection;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport javax.annotation.Nullable;\n\n/**\n * An class that is used to receive React commands from JS and translate them into a\n * shadow node hierarchy that is then mapped to a native view hierarchy.\n */\npublic class UIImplementation {\n\n  protected final EventDispatcher mEventDispatcher;\n  protected final ReactApplicationContext mReactContext;\n  protected final ShadowNodeRegistry mShadowNodeRegistry = new ShadowNodeRegistry();\n  private final Set<Integer> mMeasuredRootNodes = new HashSet<>();\n  private final ViewManagerRegistry mViewManagers;\n  private final UIViewOperationQueue mOperationsQueue;\n  private final NativeViewHierarchyOptimizer mNativeViewHierarchyOptimizer;\n  private final int[] mMeasureBuffer = new int[4];\n\n  private long mLastCalculateLayoutTime = 0;\n  protected @Nullable LayoutUpdateListener mLayoutUpdateListener;\n\n  /** Interface definition for a callback to be invoked when the layout has been updated */\n  public interface LayoutUpdateListener {\n\n    /** Called when the layout has been updated */\n    void onLayoutUpdated(ReactShadowNode root);\n  }\n\n  public UIImplementation(\n      ReactApplicationContext reactContext,\n      UIManagerModule.ViewManagerResolver viewManagerResolver,\n      EventDispatcher eventDispatcher,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    this(\n        reactContext,\n        new ViewManagerRegistry(viewManagerResolver),\n        eventDispatcher,\n        minTimeLeftInFrameForNonBatchedOperationMs);\n  }\n\n  public UIImplementation(\n      ReactApplicationContext reactContext,\n      List<ViewManager> viewManagers,\n      EventDispatcher eventDispatcher,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    this(\n        reactContext,\n        new ViewManagerRegistry(viewManagers),\n        eventDispatcher,\n        minTimeLeftInFrameForNonBatchedOperationMs);\n  }\n\n  private UIImplementation(\n      ReactApplicationContext reactContext,\n      ViewManagerRegistry viewManagers,\n      EventDispatcher eventDispatcher,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    this(\n        reactContext,\n        viewManagers,\n        new UIViewOperationQueue(\n            reactContext,\n            new NativeViewHierarchyManager(viewManagers),\n            minTimeLeftInFrameForNonBatchedOperationMs),\n        eventDispatcher);\n  }\n\n  protected UIImplementation(\n      ReactApplicationContext reactContext,\n      ViewManagerRegistry viewManagers,\n      UIViewOperationQueue operationsQueue,\n      EventDispatcher eventDispatcher) {\n    mReactContext = reactContext;\n    mViewManagers = viewManagers;\n    mOperationsQueue = operationsQueue;\n    mNativeViewHierarchyOptimizer = new NativeViewHierarchyOptimizer(\n        mOperationsQueue,\n        mShadowNodeRegistry);\n    mEventDispatcher = eventDispatcher;\n  }\n\n  protected ReactShadowNode createRootShadowNode() {\n    ReactShadowNode rootCSSNode = new ReactShadowNodeImpl();\n    I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();\n    if (sharedI18nUtilInstance.isRTL(mReactContext)) {\n      rootCSSNode.setLayoutDirection(YogaDirection.RTL);\n    }\n    rootCSSNode.setViewClassName(\"Root\");\n    return rootCSSNode;\n  }\n\n  protected ReactShadowNode createShadowNode(String className) {\n    ViewManager viewManager = mViewManagers.get(className);\n    return viewManager.createShadowNodeInstance(mReactContext);\n  }\n\n  public final ReactShadowNode resolveShadowNode(int reactTag) {\n    return mShadowNodeRegistry.getNode(reactTag);\n  }\n\n  protected final ViewManager resolveViewManager(String className) {\n    return mViewManagers.get(className);\n  }\n\n  /*package*/ UIViewOperationQueue getUIViewOperationQueue() {\n    return mOperationsQueue;\n  }\n\n  /**\n   * Updates the styles of the {@link ReactShadowNode} based on the Measure specs received by\n   * parameters.\n   */\n  public void updateRootView(int tag, int widthMeasureSpec, int heightMeasureSpec) {\n    ReactShadowNode rootCSSNode = mShadowNodeRegistry.getNode(tag);\n    if (rootCSSNode == null) {\n      FLog.w(ReactConstants.TAG, \"Tried to update non-existent root tag: \" + tag);\n      return;\n    }\n    updateRootView(rootCSSNode, widthMeasureSpec, heightMeasureSpec);\n  }\n\n  /**\n   * Updates the styles of the {@link ReactShadowNode} based on the Measure specs received by\n   * parameters.\n   */\n  public void updateRootView(\n      ReactShadowNode rootCSSNode, int widthMeasureSpec, int heightMeasureSpec) {\n    int widthMode = MeasureSpec.getMode(widthMeasureSpec);\n    int widthSize = MeasureSpec.getSize(widthMeasureSpec);\n    switch (widthMode) {\n      case EXACTLY:\n        rootCSSNode.setStyleWidth(widthSize);\n        break;\n      case AT_MOST:\n        rootCSSNode.setStyleMaxWidth(widthSize);\n        break;\n      case UNSPECIFIED:\n        rootCSSNode.setStyleWidthAuto();\n        break;\n    }\n\n    int heightMode = MeasureSpec.getMode(heightMeasureSpec);\n    int heightSize = MeasureSpec.getSize(heightMeasureSpec);\n    switch (heightMode) {\n      case EXACTLY:\n        rootCSSNode.setStyleHeight(heightSize);\n        break;\n      case AT_MOST:\n        rootCSSNode.setStyleMaxHeight(heightSize);\n        break;\n      case UNSPECIFIED:\n        rootCSSNode.setStyleHeightAuto();\n        break;\n    }\n  }\n\n  /**\n   * Registers a root node with a given tag, size and ThemedReactContext and adds it to a node\n   * registry.\n   */\n  public <T extends SizeMonitoringFrameLayout & MeasureSpecProvider> void registerRootView(\n      T rootView, int tag, ThemedReactContext context) {\n    final ReactShadowNode rootCSSNode = createRootShadowNode();\n    rootCSSNode.setReactTag(tag);\n    rootCSSNode.setThemedContext(context);\n\n    int widthMeasureSpec = rootView.getWidthMeasureSpec();\n    int heightMeasureSpec = rootView.getHeightMeasureSpec();\n    updateRootView(rootCSSNode, widthMeasureSpec, heightMeasureSpec);\n\n    mShadowNodeRegistry.addRootNode(rootCSSNode);\n\n    // register it within NativeViewHierarchyManager\n    mOperationsQueue.addRootView(tag, rootView, context);\n  }\n\n  /**\n   * Unregisters a root node with a given tag.\n   */\n  public void removeRootView(int rootViewTag) {\n    removeRootShadowNode(rootViewTag);\n    mOperationsQueue.enqueueRemoveRootView(rootViewTag);\n  }\n\n  /**\n   * Unregisters a root node with a given tag from the shadow node registry\n   */\n  public void removeRootShadowNode(int rootViewTag) {\n    mShadowNodeRegistry.removeRootNode(rootViewTag);\n  }\n\n  /**\n   * Invoked when native view that corresponds to a root node, or acts as a root view (ie. Modals)\n   * has its size changed.\n   */\n  public void updateNodeSize(\n      int nodeViewTag,\n      int newWidth,\n      int newHeight) {\n    ReactShadowNode cssNode = mShadowNodeRegistry.getNode(nodeViewTag);\n    if (cssNode == null) {\n      FLog.w(\n        ReactConstants.TAG,\n        \"Tried to update size of non-existent tag: \" + nodeViewTag);\n      return;\n    }\n    cssNode.setStyleWidth(newWidth);\n    cssNode.setStyleHeight(newHeight);\n\n    dispatchViewUpdatesIfNeeded();\n  }\n\n  public void setViewLocalData(int tag, Object data) {\n    ReactShadowNode shadowNode = mShadowNodeRegistry.getNode(tag);\n\n    if (shadowNode == null) {\n      FLog.w(\n        ReactConstants.TAG,\n        \"Attempt to set local data for view with unknown tag: \" + tag);\n      return;\n    }\n\n    shadowNode.setLocalData(data);\n\n    dispatchViewUpdatesIfNeeded();\n  }\n\n  public void profileNextBatch() {\n    mOperationsQueue.profileNextBatch();\n  }\n\n  public Map<String, Long> getProfiledBatchPerfCounters() {\n    return mOperationsQueue.getProfiledBatchPerfCounters();\n  }\n\n  /**\n   * Invoked by React to create a new node with a given tag, class name and properties.\n   */\n  public void createView(int tag, String className, int rootViewTag, ReadableMap props) {\n    ReactShadowNode cssNode = createShadowNode(className);\n    ReactShadowNode rootNode = mShadowNodeRegistry.getNode(rootViewTag);\n    cssNode.setReactTag(tag);\n    cssNode.setViewClassName(className);\n    cssNode.setRootNode(rootNode);\n    cssNode.setThemedContext(rootNode.getThemedContext());\n\n    mShadowNodeRegistry.addNode(cssNode);\n\n    ReactStylesDiffMap styles = null;\n    if (props != null) {\n      styles = new ReactStylesDiffMap(props);\n      cssNode.updateProperties(styles);\n    }\n\n    handleCreateView(cssNode, rootViewTag, styles);\n  }\n\n  protected void handleCreateView(\n      ReactShadowNode cssNode,\n      int rootViewTag,\n      @Nullable ReactStylesDiffMap styles) {\n    if (!cssNode.isVirtual()) {\n      mNativeViewHierarchyOptimizer.handleCreateView(cssNode, cssNode.getThemedContext(), styles);\n    }\n  }\n\n  /**\n   * Invoked by React to create a new node with a given tag has its properties changed.\n   */\n  public void updateView(int tag, String className, ReadableMap props) {\n    ViewManager viewManager = mViewManagers.get(className);\n    if (viewManager == null) {\n      throw new IllegalViewOperationException(\"Got unknown view type: \" + className);\n    }\n    ReactShadowNode cssNode = mShadowNodeRegistry.getNode(tag);\n    if (cssNode == null) {\n      throw new IllegalViewOperationException(\"Trying to update non-existent view with tag \" + tag);\n    }\n\n    if (props != null) {\n      ReactStylesDiffMap styles = new ReactStylesDiffMap(props);\n      cssNode.updateProperties(styles);\n      handleUpdateView(cssNode, className, styles);\n    }\n  }\n\n  /**\n   * Used by native animated module to bypass the process of updating the values through the shadow\n   * view hierarchy. This method will directly update native views, which means that updates for\n   * layout-related propertied won't be handled properly.\n   * Make sure you know what you're doing before calling this method :)\n   */\n  public void synchronouslyUpdateViewOnUIThread(int tag, ReactStylesDiffMap props) {\n    UiThreadUtil.assertOnUiThread();\n    mOperationsQueue.getNativeViewHierarchyManager().updateProperties(tag, props);\n  }\n\n  protected void handleUpdateView(\n      ReactShadowNode cssNode,\n      String className,\n      ReactStylesDiffMap styles) {\n    if (!cssNode.isVirtual()) {\n      mNativeViewHierarchyOptimizer.handleUpdateView(cssNode, className, styles);\n    }\n  }\n\n  /**\n   * Invoked when there is a mutation in a node tree.\n   *\n   * @param tag react tag of the node we want to manage\n   * @param indicesToRemove ordered (asc) list of indicies at which view should be removed\n   * @param viewsToAdd ordered (asc based on mIndex property) list of tag-index pairs that represent\n   * a view which should be added at the specified index\n   * @param tagsToDelete list of tags corresponding to views that should be removed\n   */\n  public void manageChildren(\n      int viewTag,\n      @Nullable ReadableArray moveFrom,\n      @Nullable ReadableArray moveTo,\n      @Nullable ReadableArray addChildTags,\n      @Nullable ReadableArray addAtIndices,\n      @Nullable ReadableArray removeFrom) {\n    ReactShadowNode cssNodeToManage = mShadowNodeRegistry.getNode(viewTag);\n\n    int numToMove = moveFrom == null ? 0 : moveFrom.size();\n    int numToAdd = addChildTags == null ? 0 : addChildTags.size();\n    int numToRemove = removeFrom == null ? 0 : removeFrom.size();\n\n    if (numToMove != 0 && (moveTo == null || numToMove != moveTo.size())) {\n      throw new IllegalViewOperationException(\"Size of moveFrom != size of moveTo!\");\n    }\n\n    if (numToAdd != 0 && (addAtIndices == null || numToAdd != addAtIndices.size())) {\n      throw new IllegalViewOperationException(\"Size of addChildTags != size of addAtIndices!\");\n    }\n\n    // We treat moves as an add and a delete\n    ViewAtIndex[] viewsToAdd = new ViewAtIndex[numToMove + numToAdd];\n    int[] indicesToRemove = new int[numToMove + numToRemove];\n    int[] tagsToRemove = new int[indicesToRemove.length];\n    int[] tagsToDelete = new int[numToRemove];\n\n    if (numToMove > 0) {\n      Assertions.assertNotNull(moveFrom);\n      Assertions.assertNotNull(moveTo);\n      for (int i = 0; i < numToMove; i++) {\n        int moveFromIndex = moveFrom.getInt(i);\n        int tagToMove = cssNodeToManage.getChildAt(moveFromIndex).getReactTag();\n        viewsToAdd[i] = new ViewAtIndex(\n            tagToMove,\n            moveTo.getInt(i));\n        indicesToRemove[i] = moveFromIndex;\n        tagsToRemove[i] = tagToMove;\n      }\n    }\n\n    if (numToAdd > 0) {\n      Assertions.assertNotNull(addChildTags);\n      Assertions.assertNotNull(addAtIndices);\n      for (int i = 0; i < numToAdd; i++) {\n        int viewTagToAdd = addChildTags.getInt(i);\n        int indexToAddAt = addAtIndices.getInt(i);\n        viewsToAdd[numToMove + i] = new ViewAtIndex(viewTagToAdd, indexToAddAt);\n      }\n    }\n\n    if (numToRemove > 0) {\n      Assertions.assertNotNull(removeFrom);\n      for (int i = 0; i < numToRemove; i++) {\n        int indexToRemove = removeFrom.getInt(i);\n        int tagToRemove = cssNodeToManage.getChildAt(indexToRemove).getReactTag();\n        indicesToRemove[numToMove + i] = indexToRemove;\n        tagsToRemove[numToMove + i] = tagToRemove;\n        tagsToDelete[i] = tagToRemove;\n      }\n    }\n\n    // NB: moveFrom and removeFrom are both relative to the starting state of the View's children.\n    // moveTo and addAt are both relative to the final state of the View's children.\n    //\n    // 1) Sort the views to add and indices to remove by index\n    // 2) Iterate the indices being removed from high to low and remove them. Going high to low\n    //    makes sure we remove the correct index when there are multiple to remove.\n    // 3) Iterate the views being added by index low to high and add them. Like the view removal,\n    //    iteration direction is important to preserve the correct index.\n\n    Arrays.sort(viewsToAdd, ViewAtIndex.COMPARATOR);\n    Arrays.sort(indicesToRemove);\n\n    // Apply changes to CSSNodeDEPRECATED hierarchy\n    int lastIndexRemoved = -1;\n    for (int i = indicesToRemove.length - 1; i >= 0; i--) {\n      int indexToRemove = indicesToRemove[i];\n      if (indexToRemove == lastIndexRemoved) {\n        throw new IllegalViewOperationException(\"Repeated indices in Removal list for view tag: \"\n            + viewTag);\n      }\n      cssNodeToManage.removeChildAt(indicesToRemove[i]);\n      lastIndexRemoved = indicesToRemove[i];\n    }\n\n    for (int i = 0; i < viewsToAdd.length; i++) {\n      ViewAtIndex viewAtIndex = viewsToAdd[i];\n      ReactShadowNode cssNodeToAdd = mShadowNodeRegistry.getNode(viewAtIndex.mTag);\n      if (cssNodeToAdd == null) {\n        throw new IllegalViewOperationException(\"Trying to add unknown view tag: \"\n            + viewAtIndex.mTag);\n      }\n      cssNodeToManage.addChildAt(cssNodeToAdd, viewAtIndex.mIndex);\n    }\n\n    if (!cssNodeToManage.isVirtual() && !cssNodeToManage.isVirtualAnchor()) {\n      mNativeViewHierarchyOptimizer.handleManageChildren(\n          cssNodeToManage,\n          indicesToRemove,\n          tagsToRemove,\n          viewsToAdd,\n          tagsToDelete);\n    }\n\n    for (int i = 0; i < tagsToDelete.length; i++) {\n      removeShadowNode(mShadowNodeRegistry.getNode(tagsToDelete[i]));\n    }\n  }\n\n  /**\n   * An optimized version of manageChildren that is used for initial setting of child views.\n   * The children are assumed to be in index order\n   *\n   * @param viewTag tag of the parent\n   * @param childrenTags tags of the children\n   */\n  public void setChildren(\n    int viewTag,\n    ReadableArray childrenTags) {\n\n    ReactShadowNode cssNodeToManage = mShadowNodeRegistry.getNode(viewTag);\n\n    for (int i = 0; i < childrenTags.size(); i++) {\n      ReactShadowNode cssNodeToAdd = mShadowNodeRegistry.getNode(childrenTags.getInt(i));\n      if (cssNodeToAdd == null) {\n        throw new IllegalViewOperationException(\"Trying to add unknown view tag: \"\n          + childrenTags.getInt(i));\n      }\n      cssNodeToManage.addChildAt(cssNodeToAdd, i);\n    }\n\n    if (!cssNodeToManage.isVirtual() && !cssNodeToManage.isVirtualAnchor()) {\n      mNativeViewHierarchyOptimizer.handleSetChildren(\n        cssNodeToManage,\n        childrenTags);\n    }\n  }\n\n  /**\n   * Replaces the View specified by oldTag with the View specified by newTag within oldTag's parent.\n   */\n  public void replaceExistingNonRootView(int oldTag, int newTag) {\n    if (mShadowNodeRegistry.isRootNode(oldTag) || mShadowNodeRegistry.isRootNode(newTag)) {\n      throw new IllegalViewOperationException(\"Trying to add or replace a root tag!\");\n    }\n\n    ReactShadowNode oldNode = mShadowNodeRegistry.getNode(oldTag);\n    if (oldNode == null) {\n      throw new IllegalViewOperationException(\"Trying to replace unknown view tag: \" + oldTag);\n    }\n\n    ReactShadowNode parent = oldNode.getParent();\n    if (parent == null) {\n      throw new IllegalViewOperationException(\"Node is not attached to a parent: \" + oldTag);\n    }\n\n    int oldIndex = parent.indexOf(oldNode);\n    if (oldIndex < 0) {\n      throw new IllegalStateException(\"Didn't find child tag in parent\");\n    }\n\n    WritableArray tagsToAdd = Arguments.createArray();\n    tagsToAdd.pushInt(newTag);\n\n    WritableArray addAtIndices = Arguments.createArray();\n    addAtIndices.pushInt(oldIndex);\n\n    WritableArray indicesToRemove = Arguments.createArray();\n    indicesToRemove.pushInt(oldIndex);\n\n    manageChildren(parent.getReactTag(), null, null, tagsToAdd, addAtIndices, indicesToRemove);\n  }\n\n  /**\n   * Method which takes a container tag and then releases all subviews for that container upon\n   * receipt.\n   * TODO: The method name is incorrect and will be renamed, #6033872\n   * @param containerTag the tag of the container for which the subviews must be removed\n   */\n  public void removeSubviewsFromContainerWithID(int containerTag) {\n    ReactShadowNode containerNode = mShadowNodeRegistry.getNode(containerTag);\n    if (containerNode == null) {\n      throw new IllegalViewOperationException(\n          \"Trying to remove subviews of an unknown view tag: \" + containerTag);\n    }\n\n    WritableArray indicesToRemove = Arguments.createArray();\n    for (int childIndex = 0; childIndex < containerNode.getChildCount(); childIndex++) {\n      indicesToRemove.pushInt(childIndex);\n    }\n\n    manageChildren(containerTag, null, null, null, null, indicesToRemove);\n  }\n\n  /**\n   * Find the touch target child native view in  the supplied root view hierarchy, given a react\n   * target location.\n   *\n   * This method is currently used only by Element Inspector DevTool.\n   *\n   * @param reactTag the tag of the root view to traverse\n   * @param targetX target X location\n   * @param targetY target Y location\n   * @param callback will be called if with the identified child view react ID, and measurement\n   *        info. If no view was found, callback will be invoked with no data.\n   */\n  public void findSubviewIn(int reactTag, float targetX, float targetY, Callback callback) {\n    mOperationsQueue.enqueueFindTargetForTouch(reactTag, targetX, targetY, callback);\n  }\n\n  /**\n   *  Check if the first shadow node is the descendant of the second shadow node\n   */\n  public void viewIsDescendantOf(\n      final int reactTag,\n      final int ancestorReactTag,\n      final Callback callback) {\n    ReactShadowNode node = mShadowNodeRegistry.getNode(reactTag);\n    ReactShadowNode ancestorNode = mShadowNodeRegistry.getNode(ancestorReactTag);\n    if (node == null || ancestorNode == null) {\n      callback.invoke(false);\n      return;\n    }\n    callback.invoke(node.isDescendantOf(ancestorNode));\n  }\n\n  /**\n   * Determines the location on screen, width, and height of the given view relative to the root\n   * view and returns the values via an async callback.\n   */\n  public void measure(int reactTag, Callback callback) {\n    // This method is called by the implementation of JS touchable interface (see Touchable.js for\n    // more details) at the moment of touch activation. That is after user starts the gesture from\n    // a touchable view with a given reactTag, or when user drag finger back into the press\n    // activation area of a touchable view that have been activated before.\n    mOperationsQueue.enqueueMeasure(reactTag, callback);\n  }\n\n  /**\n   * Determines the location on screen, width, and height of the given view relative to the device\n   * screen and returns the values via an async callback.  This is the absolute position including\n   * things like the status bar\n   */\n  public void measureInWindow(int reactTag, Callback callback) {\n    mOperationsQueue.enqueueMeasureInWindow(reactTag, callback);\n  }\n\n  /**\n   * Measures the view specified by tag relative to the given ancestorTag. This means that the\n   * returned x, y are relative to the origin x, y of the ancestor view. Results are stored in the\n   * given outputBuffer. We allow ancestor view and measured view to be the same, in which case\n   * the position always will be (0, 0) and method will only measure the view dimensions.\n   */\n  public void measureLayout(\n      int tag,\n      int ancestorTag,\n      Callback errorCallback,\n      Callback successCallback) {\n    try {\n      measureLayout(tag, ancestorTag, mMeasureBuffer);\n      float relativeX = PixelUtil.toDIPFromPixel(mMeasureBuffer[0]);\n      float relativeY = PixelUtil.toDIPFromPixel(mMeasureBuffer[1]);\n      float width = PixelUtil.toDIPFromPixel(mMeasureBuffer[2]);\n      float height = PixelUtil.toDIPFromPixel(mMeasureBuffer[3]);\n      successCallback.invoke(relativeX, relativeY, width, height);\n    } catch (IllegalViewOperationException e) {\n      errorCallback.invoke(e.getMessage());\n    }\n  }\n\n  /**\n   * Like {@link #measure} and {@link #measureLayout} but measures relative to the immediate parent.\n   */\n  public void measureLayoutRelativeToParent(\n      int tag,\n      Callback errorCallback,\n      Callback successCallback) {\n    try {\n      measureLayoutRelativeToParent(tag, mMeasureBuffer);\n      float relativeX = PixelUtil.toDIPFromPixel(mMeasureBuffer[0]);\n      float relativeY = PixelUtil.toDIPFromPixel(mMeasureBuffer[1]);\n      float width = PixelUtil.toDIPFromPixel(mMeasureBuffer[2]);\n      float height = PixelUtil.toDIPFromPixel(mMeasureBuffer[3]);\n      successCallback.invoke(relativeX, relativeY, width, height);\n    } catch (IllegalViewOperationException e) {\n      errorCallback.invoke(e.getMessage());\n    }\n  }\n\n  /**\n   * Invoked at the end of the transaction to commit any updates to the node hierarchy.\n   */\n  public void dispatchViewUpdates(int batchId) {\n    SystraceMessage.beginSection(\n      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n      \"UIImplementation.dispatchViewUpdates\")\n      .arg(\"batchId\", batchId)\n      .flush();\n    final long commitStartTime = SystemClock.uptimeMillis();\n    try {\n      updateViewHierarchy();\n      mNativeViewHierarchyOptimizer.onBatchComplete();\n      mOperationsQueue.dispatchViewUpdates(batchId, commitStartTime, mLastCalculateLayoutTime);\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n    }\n  }\n\n  private void dispatchViewUpdatesIfNeeded() {\n    // If we are in the middle of a batch update, any additional changes\n    // will automatically be dispatched at the end of the batch.\n    // If we are not, we have to initiate new batch update.\n    // As all batches are executed as a single runnable on the event queue\n    // this should always be empty, but that calling architecture is an implementation detail.\n    if (mOperationsQueue.isEmpty()) {\n      dispatchViewUpdates(-1); // \"-1\" means \"no associated batch id\"\n    }\n  }\n\n  protected void updateViewHierarchy() {\n    Systrace.beginSection(\n      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n      \"UIImplementation.updateViewHierarchy\");\n    try {\n      for (int i = 0; i < mShadowNodeRegistry.getRootNodeCount(); i++) {\n        int tag = mShadowNodeRegistry.getRootTag(i);\n        ReactShadowNode cssRoot = mShadowNodeRegistry.getNode(tag);\n\n        if (mMeasuredRootNodes.contains(tag)) {\n          SystraceMessage.beginSection(\n                  Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n                  \"UIImplementation.notifyOnBeforeLayoutRecursive\")\n              .arg(\"rootTag\", cssRoot.getReactTag())\n              .flush();\n          try {\n            notifyOnBeforeLayoutRecursive(cssRoot);\n          } finally {\n            Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n          }\n\n          calculateRootLayout(cssRoot);\n          SystraceMessage.beginSection(\n                  Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"UIImplementation.applyUpdatesRecursive\")\n              .arg(\"rootTag\", cssRoot.getReactTag())\n              .flush();\n          try {\n            applyUpdatesRecursive(cssRoot, 0f, 0f);\n          } finally {\n            Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n          }\n\n          if (mLayoutUpdateListener != null) {\n            mLayoutUpdateListener.onLayoutUpdated(cssRoot);\n          }\n        }\n      }\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n    }\n  }\n\n  /**\n   * Registers a new Animation that can then be added to a View using {@link #addAnimation}.\n   */\n  public void registerAnimation(Animation animation) {\n    mOperationsQueue.enqueueRegisterAnimation(animation);\n  }\n\n  /**\n   * Adds an Animation previously registered with {@link #registerAnimation} to a View and starts it\n   */\n  public void addAnimation(int reactTag, int animationID, Callback onSuccess) {\n    assertViewExists(reactTag, \"addAnimation\");\n    mOperationsQueue.enqueueAddAnimation(reactTag, animationID, onSuccess);\n  }\n\n  /**\n   * Removes an existing Animation, canceling it if it was in progress.\n   */\n  public void removeAnimation(int reactTag, int animationID) {\n    assertViewExists(reactTag, \"removeAnimation\");\n    mOperationsQueue.enqueueRemoveAnimation(animationID);\n  }\n\n  /**\n   * LayoutAnimation API on Android is currently experimental. Therefore, it needs to be enabled\n   * explicitly in order to avoid regression in existing application written for iOS using this API.\n   *\n   * Warning : This method will be removed in future version of React Native, and layout animation\n   * will be enabled by default, so always check for its existence before invoking it.\n   *\n   * TODO(9139831) : remove this method once layout animation is fully stable.\n   *\n   * @param enabled whether layout animation is enabled or not\n   */\n  public void setLayoutAnimationEnabledExperimental(boolean enabled) {\n    mOperationsQueue.enqueueSetLayoutAnimationEnabled(enabled);\n  }\n\n  /**\n   * Configure an animation to be used for the native layout changes, and native views\n   * creation. The animation will only apply during the current batch operations.\n   *\n   * TODO(7728153) : animating view deletion is currently not supported.\n   * TODO(7613721) : callbacks are not supported, this feature will likely be killed.\n   *\n   * @param config the configuration of the animation for view addition/removal/update.\n   * @param success will be called when the animation completes, or when the animation get\n   *        interrupted. In this case, callback parameter will be false.\n   * @param error will be called if there was an error processing the animation\n   */\n  public void configureNextLayoutAnimation(\n      ReadableMap config,\n      Callback success,\n      Callback error) {\n    mOperationsQueue.enqueueConfigureLayoutAnimation(config, success, error);\n  }\n\n  public void setJSResponder(int reactTag, boolean blockNativeResponder) {\n    assertViewExists(reactTag, \"setJSResponder\");\n    ReactShadowNode node = mShadowNodeRegistry.getNode(reactTag);\n    while (node.isVirtual() || node.isLayoutOnly()) {\n      node = node.getParent();\n    }\n    mOperationsQueue.enqueueSetJSResponder(node.getReactTag(), reactTag, blockNativeResponder);\n  }\n\n  public void clearJSResponder() {\n    mOperationsQueue.enqueueClearJSResponder();\n  }\n\n  public void dispatchViewManagerCommand(int reactTag, int commandId, ReadableArray commandArgs) {\n    assertViewExists(reactTag, \"dispatchViewManagerCommand\");\n    mOperationsQueue.enqueueDispatchCommand(reactTag, commandId, commandArgs);\n  }\n\n  /**\n   * Show a PopupMenu.\n   *\n   * @param reactTag the tag of the anchor view (the PopupMenu is displayed next to this view); this\n   *        needs to be the tag of a native view (shadow views can not be anchors)\n   * @param items the menu items as an array of strings\n   * @param error will be called if there is an error displaying the menu\n   * @param success will be called with the position of the selected item as the first argument, or\n   *        no arguments if the menu is dismissed\n   */\n  public void showPopupMenu(int reactTag, ReadableArray items, Callback error, Callback success) {\n    assertViewExists(reactTag, \"showPopupMenu\");\n    mOperationsQueue.enqueueShowPopupMenu(reactTag, items, error, success);\n  }\n\n  public void sendAccessibilityEvent(int tag, int eventType) {\n    mOperationsQueue.enqueueSendAccessibilityEvent(tag, eventType);\n  }\n\n  public void onHostResume() {\n    mOperationsQueue.resumeFrameCallback();\n  }\n\n  public void onHostPause() {\n    mOperationsQueue.pauseFrameCallback();\n  }\n\n  public void onHostDestroy() {\n  }\n\n  public void setViewHierarchyUpdateDebugListener(\n      @Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {\n    mOperationsQueue.setViewHierarchyUpdateDebugListener(listener);\n  }\n\n  protected final void removeShadowNode(ReactShadowNode nodeToRemove) {\n    removeShadowNodeRecursive(nodeToRemove);\n    nodeToRemove.dispose();\n  }\n\n  private void removeShadowNodeRecursive(ReactShadowNode nodeToRemove) {\n    NativeViewHierarchyOptimizer.handleRemoveNode(nodeToRemove);\n    mShadowNodeRegistry.removeNode(nodeToRemove.getReactTag());\n    mMeasuredRootNodes.remove(nodeToRemove.getReactTag());\n    for (int i = nodeToRemove.getChildCount() - 1; i >= 0; i--) {\n      removeShadowNodeRecursive(nodeToRemove.getChildAt(i));\n    }\n    nodeToRemove.removeAndDisposeAllChildren();\n  }\n\n  private void measureLayout(int tag, int ancestorTag, int[] outputBuffer) {\n    ReactShadowNode node = mShadowNodeRegistry.getNode(tag);\n    ReactShadowNode ancestor = mShadowNodeRegistry.getNode(ancestorTag);\n    if (node == null || ancestor == null) {\n      throw new IllegalViewOperationException(\n          \"Tag \" + (node == null ? tag : ancestorTag) + \" does not exist\");\n    }\n\n    if (node != ancestor) {\n      ReactShadowNode currentParent = node.getParent();\n      while (currentParent != ancestor) {\n        if (currentParent == null) {\n          throw new IllegalViewOperationException(\n              \"Tag \" + ancestorTag + \" is not an ancestor of tag \" + tag);\n        }\n        currentParent = currentParent.getParent();\n      }\n    }\n\n    measureLayoutRelativeToVerifiedAncestor(node, ancestor, outputBuffer);\n  }\n\n  private void measureLayoutRelativeToParent(int tag, int[] outputBuffer) {\n    ReactShadowNode node = mShadowNodeRegistry.getNode(tag);\n    if (node == null) {\n      throw new IllegalViewOperationException(\"No native view for tag \" + tag + \" exists!\");\n    }\n    ReactShadowNode parent = node.getParent();\n    if (parent == null) {\n      throw new IllegalViewOperationException(\"View with tag \" + tag + \" doesn't have a parent!\");\n    }\n\n    measureLayoutRelativeToVerifiedAncestor(node, parent, outputBuffer);\n  }\n\n  private void measureLayoutRelativeToVerifiedAncestor(\n      ReactShadowNode node,\n      ReactShadowNode ancestor,\n      int[] outputBuffer) {\n    int offsetX = 0;\n    int offsetY = 0;\n    if (node != ancestor) {\n      offsetX = Math.round(node.getLayoutX());\n      offsetY = Math.round(node.getLayoutY());\n      ReactShadowNode current = node.getParent();\n      while (current != ancestor) {\n        Assertions.assertNotNull(current);\n        assertNodeDoesNotNeedCustomLayoutForChildren(current);\n        offsetX += Math.round(current.getLayoutX());\n        offsetY += Math.round(current.getLayoutY());\n        current = current.getParent();\n      }\n      assertNodeDoesNotNeedCustomLayoutForChildren(ancestor);\n    }\n\n    outputBuffer[0] = offsetX;\n    outputBuffer[1] = offsetY;\n    outputBuffer[2] = node.getScreenWidth();\n    outputBuffer[3] = node.getScreenHeight();\n  }\n\n  private void assertViewExists(int reactTag, String operationNameForExceptionMessage) {\n    if (mShadowNodeRegistry.getNode(reactTag) == null) {\n      throw new IllegalViewOperationException(\n          \"Unable to execute operation \" + operationNameForExceptionMessage + \" on view with \" +\n              \"tag: \" + reactTag + \", since the view does not exists\");\n    }\n  }\n\n  private void assertNodeDoesNotNeedCustomLayoutForChildren(ReactShadowNode node) {\n    ViewManager viewManager = Assertions.assertNotNull(mViewManagers.get(node.getViewClass()));\n    ViewGroupManager viewGroupManager;\n    if (viewManager instanceof ViewGroupManager) {\n      viewGroupManager = (ViewGroupManager) viewManager;\n    } else {\n      throw new IllegalViewOperationException(\"Trying to use view \" + node.getViewClass() +\n          \" as a parent, but its Manager doesn't extends ViewGroupManager\");\n    }\n    if (viewGroupManager != null && viewGroupManager.needsCustomLayoutForChildren()) {\n      throw new IllegalViewOperationException(\n          \"Trying to measure a view using measureLayout/measureLayoutRelativeToParent relative to\" +\n              \" an ancestor that requires custom layout for it's children (\" + node.getViewClass() +\n              \"). Use measure instead.\");\n    }\n  }\n\n  private void notifyOnBeforeLayoutRecursive(ReactShadowNode cssNode) {\n    if (!cssNode.hasUpdates()) {\n      return;\n    }\n    for (int i = 0; i < cssNode.getChildCount(); i++) {\n      notifyOnBeforeLayoutRecursive(cssNode.getChildAt(i));\n    }\n    cssNode.onBeforeLayout();\n  }\n\n  protected void calculateRootLayout(ReactShadowNode cssRoot) {\n    SystraceMessage.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"cssRoot.calculateLayout\")\n        .arg(\"rootTag\", cssRoot.getReactTag())\n        .flush();\n    long startTime = SystemClock.uptimeMillis();\n    try {\n      cssRoot.calculateLayout();\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n      mLastCalculateLayoutTime = SystemClock.uptimeMillis() - startTime;\n    }\n  }\n\n  protected void applyUpdatesRecursive(\n      ReactShadowNode cssNode,\n      float absoluteX,\n      float absoluteY) {\n    if (!cssNode.hasUpdates()) {\n      return;\n    }\n\n    if (!cssNode.isVirtualAnchor()) {\n      for (int i = 0; i < cssNode.getChildCount(); i++) {\n        applyUpdatesRecursive(\n            cssNode.getChildAt(i),\n            absoluteX + cssNode.getLayoutX(),\n            absoluteY + cssNode.getLayoutY());\n      }\n    }\n\n    int tag = cssNode.getReactTag();\n    if (!mShadowNodeRegistry.isRootNode(tag)) {\n      boolean frameDidChange = cssNode.dispatchUpdates(\n          absoluteX,\n          absoluteY,\n          mOperationsQueue,\n          mNativeViewHierarchyOptimizer);\n\n      // Notify JS about layout event if requested\n      // and if the position or dimensions actually changed\n      // (consistent with iOS).\n      if (frameDidChange && cssNode.shouldNotifyOnLayout()) {\n        mEventDispatcher.dispatchEvent(\n            OnLayoutEvent.obtain(\n                tag,\n                cssNode.getScreenX(),\n                cssNode.getScreenY(),\n                cssNode.getScreenWidth(),\n                cssNode.getScreenHeight()));\n      }\n    }\n    cssNode.markUpdateSeen();\n  }\n\n  public void addUIBlock(UIBlock block) {\n    mOperationsQueue.enqueueUIBlock(block);\n  }\n\n  public void prependUIBlock(UIBlock block) {\n    mOperationsQueue.prependUIBlock(block);\n  }\n\n  public int resolveRootTagFromReactTag(int reactTag) {\n    if (mShadowNodeRegistry.isRootNode(reactTag)) {\n      return reactTag;\n    }\n\n    ReactShadowNode node = resolveShadowNode(reactTag);\n    int rootTag = 0;\n    if (node != null) {\n      rootTag = node.getRootNode().getReactTag();\n    } else {\n      FLog.w(\n        ReactConstants.TAG,\n        \"Warning : attempted to resolve a non-existent react shadow node. reactTag=\" + reactTag);\n    }\n\n    return rootTag;\n  }\n\n  /**\n   * Enables Layout calculation for a Root node that has been measured.\n   *\n   * @param rootViewTag {@link int} Tag of the root node\n   */\n  public void enableLayoutCalculationForRootNode(int rootViewTag) {\n    this.mMeasuredRootNodes.add(rootViewTag);\n  }\n\n  public void setLayoutUpdateListener(LayoutUpdateListener listener) {\n    mLayoutUpdateListener = listener;\n  }\n\n  public void removeLayoutUpdateListener() {\n    mLayoutUpdateListener = null;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementationProvider.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\npackage com.facebook.react.uimanager;\n\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport java.util.List;\n\n/**\n * Provides UIImplementation to use in {@link UIManagerModule}.\n */\npublic class UIImplementationProvider {\n  public UIImplementation createUIImplementation(\n      ReactApplicationContext reactContext,\n      UIManagerModule.ViewManagerResolver viewManagerResolver,\n      EventDispatcher eventDispatcher,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    return new UIImplementation(\n        reactContext,\n        viewManagerResolver,\n        eventDispatcher,\n        minTimeLeftInFrameForNonBatchedOperationMs);\n  }\n  \n  public UIImplementation createUIImplementation(\n      ReactApplicationContext reactContext,\n      List<ViewManager> viewManagerList,\n      EventDispatcher eventDispatcher,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    return new UIImplementation(\n        reactContext,\n        viewManagerList,\n        eventDispatcher,\n        minTimeLeftInFrameForNonBatchedOperationMs);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport static com.facebook.react.bridge.ReactMarkerConstants.CREATE_UI_MANAGER_MODULE_CONSTANTS_END;\nimport static com.facebook.react.bridge.ReactMarkerConstants.CREATE_UI_MANAGER_MODULE_CONSTANTS_START;\n\nimport android.content.ComponentCallbacks2;\nimport android.content.res.Configuration;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.debug.holder.PrinterHolder;\nimport com.facebook.debug.tags.ReactDebugOverlayTags;\nimport com.facebook.react.animation.Animation;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.GuardedRunnable;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.OnBatchCompleteListener;\nimport com.facebook.react.bridge.PerformanceCounter;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMarker;\nimport com.facebook.react.bridge.ReactMethod;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.systrace.Systrace;\nimport com.facebook.systrace.SystraceMessage;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * <p>Native module to allow JS to create and update native Views.</p>\n *\n * <p>\n * <h2>== Transactional Requirement ==</h2>\n * A requirement of this class is to make sure that transactional UI updates occur all at once,\n * meaning that no intermediate state is ever rendered to the screen. For example, if a JS\n * application update changes the background of View A to blue and the width of View B to 100, both\n * need to appear at once. Practically, this means that all UI update code related to a single\n * transaction must be executed as a single code block on the UI thread. Executing as multiple code\n * blocks could allow the platform UI system to interrupt and render a partial UI state.\n * </p>\n *\n * <p>To facilitate this, this module enqueues operations that are then applied to native view\n * hierarchy through {@link NativeViewHierarchyManager} at the end of each transaction.\n *\n * <p>\n * <h2>== CSSNodes ==</h2>\n * In order to allow layout and measurement to occur on a non-UI thread, this module also\n * operates on intermediate CSSNodeDEPRECATED objects that correspond to a native view. These CSSNodeDEPRECATED are able\n * to calculate layout according to their styling rules, and then the resulting x/y/width/height of\n * that layout is scheduled as an operation that will be applied to native view hierarchy at the end\n * of current batch.\n * </p>\n *\n * TODO(5241856): Investigate memory usage of creating many small objects in UIManageModule and\n *                consider implementing a pool\n * TODO(5483063): Don't dispatch the view hierarchy at the end of a batch if no UI changes occurred\n */\n@ReactModule(name = UIManagerModule.NAME)\npublic class UIManagerModule extends ReactContextBaseJavaModule implements\n    OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter {\n\n  /**\n   * Enables lazy discovery of a specific {@link ViewManager} by its name.\n   */\n  public interface ViewManagerResolver {\n    /**\n     * {@class UIManagerModule} class uses this method to get a ViewManager by its name.\n     * This is the same name that comes from JS by {@code UIManager.ViewManagerName} call.\n     */\n    @Nullable ViewManager getViewManager(String viewManagerName);\n\n    /**\n     * Provides a list of view manager names to register in JS as {@code UIManager.ViewManagerName}\n     */\n    List<String> getViewManagerNames();\n  }\n\n  /**\n   * Resolves a name coming from native side to a name of the event that is exposed to JS.\n   */\n  public interface CustomEventNamesResolver {\n    /**\n     * Returns custom event name by the provided event name.\n     */\n    @Nullable String resolveCustomEventName(String eventName);\n  }\n\n  protected static final String NAME = \"UIManager\";\n\n  private static final boolean DEBUG =\n      PrinterHolder.getPrinter().shouldDisplayLogMessage(ReactDebugOverlayTags.UI_MANAGER);\n\n  private final EventDispatcher mEventDispatcher;\n  private final Map<String, Object> mModuleConstants;\n  private final Map<String, Object> mCustomDirectEvents;\n  private final UIImplementation mUIImplementation;\n  private final MemoryTrimCallback mMemoryTrimCallback = new MemoryTrimCallback();\n  private final List<UIManagerModuleListener> mListeners = new ArrayList<>();\n\n  private int mBatchId = 0;\n\n  public UIManagerModule(\n      ReactApplicationContext reactContext,\n      ViewManagerResolver viewManagerResolver,\n      UIImplementationProvider uiImplementationProvider,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    super(reactContext);\n    DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(reactContext);\n    mEventDispatcher = new EventDispatcher(reactContext);\n    mModuleConstants = createConstants(viewManagerResolver);\n    mCustomDirectEvents = UIManagerModuleConstants.getDirectEventTypeConstants();\n    mUIImplementation =\n        uiImplementationProvider.createUIImplementation(\n            reactContext,\n            viewManagerResolver,\n            mEventDispatcher,\n            minTimeLeftInFrameForNonBatchedOperationMs);\n\n    reactContext.addLifecycleEventListener(this);\n  }\n\n  public UIManagerModule(\n      ReactApplicationContext reactContext,\n      List<ViewManager> viewManagersList,\n      UIImplementationProvider uiImplementationProvider,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    super(reactContext);\n    DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(reactContext);\n    mEventDispatcher = new EventDispatcher(reactContext);\n    mCustomDirectEvents = MapBuilder.newHashMap();\n    mModuleConstants = createConstants(viewManagersList, null, mCustomDirectEvents);\n    mUIImplementation =\n        uiImplementationProvider.createUIImplementation(\n            reactContext,\n            viewManagersList,\n            mEventDispatcher,\n            minTimeLeftInFrameForNonBatchedOperationMs);\n\n    reactContext.addLifecycleEventListener(this);\n  }\n  /**\n   * This method gives an access to the {@link UIImplementation} object that can be used to execute\n   * operations on the view hierarchy.\n   */\n  public UIImplementation getUIImplementation() {\n    return mUIImplementation;\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @Override\n  public Map<String, Object> getConstants() {\n    return mModuleConstants;\n  }\n\n  @Override\n  public void initialize() {\n    getReactApplicationContext().registerComponentCallbacks(mMemoryTrimCallback);\n  }\n\n  @Override\n  public void onHostResume() {\n    mUIImplementation.onHostResume();\n  }\n\n  @Override\n  public void onHostPause() {\n    mUIImplementation.onHostPause();\n  }\n\n  @Override\n  public void onHostDestroy() {\n    mUIImplementation.onHostDestroy();\n  }\n\n  @Override\n  public void onCatalystInstanceDestroy() {\n    super.onCatalystInstanceDestroy();\n    mEventDispatcher.onCatalystInstanceDestroyed();\n\n    getReactApplicationContext().unregisterComponentCallbacks(mMemoryTrimCallback);\n    YogaNodePool.get().clear();\n    ViewManagerPropertyUpdater.clear();\n  }\n\n  private static Map<String, Object> createConstants(ViewManagerResolver viewManagerResolver) {\n    ReactMarker.logMarker(CREATE_UI_MANAGER_MODULE_CONSTANTS_START);\n    Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"CreateUIManagerConstants\");\n    try {\n      return UIManagerModuleConstantsHelper.createConstants(viewManagerResolver);\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n      ReactMarker.logMarker(CREATE_UI_MANAGER_MODULE_CONSTANTS_END);\n    }\n  }\n\n  private static Map<String, Object> createConstants(\n      List<ViewManager> viewManagers,\n      @Nullable Map<String, Object> customBubblingEvents,\n      @Nullable Map<String, Object> customDirectEvents) {\n    ReactMarker.logMarker(CREATE_UI_MANAGER_MODULE_CONSTANTS_START);\n    Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"CreateUIManagerConstants\");\n    try {\n      return UIManagerModuleConstantsHelper.createConstants(\n          viewManagers, customBubblingEvents, customDirectEvents);\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n      ReactMarker.logMarker(CREATE_UI_MANAGER_MODULE_CONSTANTS_END);\n    }\n  }\n\n  @ReactMethod(isBlockingSynchronousMethod = true)\n  public @Nullable WritableMap getConstantsForViewManager(final String viewManagerName) {\n    ViewManager targetView =\n        viewManagerName != null ? mUIImplementation.resolveViewManager(viewManagerName) : null;\n    if (targetView == null) {\n      return null;\n    }\n\n    SystraceMessage.beginSection(\n            Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"UIManagerModule.getConstantsForViewManager\")\n        .arg(\"ViewManager\", targetView.getName())\n        .arg(\"Lazy\", true)\n        .flush();\n    try {\n      Map<String, Object> viewManagerConstants =\n          UIManagerModuleConstantsHelper.createConstantsForViewManager(\n              targetView, null, null, null, mCustomDirectEvents);\n      if (viewManagerConstants != null) {\n        return Arguments.makeNativeMap(viewManagerConstants);\n      }\n      return null;\n    } finally {\n      SystraceMessage.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE).flush();\n    }\n  }\n\n  @ReactMethod(isBlockingSynchronousMethod = true)\n  public WritableMap getDefaultEventTypes() {\n    return Arguments.makeNativeMap(UIManagerModuleConstantsHelper.getDefaultExportableEventTypes());\n  }\n\n  /** Resolves Direct Event name exposed to JS from the one known to the Native side. */\n  public CustomEventNamesResolver getDirectEventNamesResolver() {\n    return new CustomEventNamesResolver() {\n      @Override\n      public @Nullable String resolveCustomEventName(String eventName) {\n        Map<String, String> customEventType =\n            (Map<String, String>) mCustomDirectEvents.get(eventName);\n        if (customEventType != null) {\n          return customEventType.get(\"registrationName\");\n        }\n        return eventName;\n      }\n    };\n  }\n\n  @Override\n  public Map<String, Long> getPerformanceCounters() {\n    return mUIImplementation.getProfiledBatchPerfCounters();\n  }\n\n  /**\n   * Registers a new root view. JS can use the returned tag with manageChildren to add/remove\n   * children to this view.\n   *\n   * <p>Note that this must be called after getWidth()/getHeight() actually return something. See\n   * CatalystApplicationFragment as an example.\n   *\n   * <p>TODO(6242243): Make addRootView thread safe NB: this method is horribly not-thread-safe.\n   */\n  public <T extends SizeMonitoringFrameLayout & MeasureSpecProvider> int addRootView(\n      final T rootView) {\n    Systrace.beginSection(\n      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n      \"UIManagerModule.addRootView\");\n    final int tag = ReactRootViewTagGenerator.getNextRootViewTag();\n    final ReactApplicationContext reactApplicationContext = getReactApplicationContext();\n    final ThemedReactContext themedRootContext =\n      new ThemedReactContext(reactApplicationContext, rootView.getContext());\n\n    mUIImplementation.registerRootView(rootView, tag, themedRootContext);\n\n    rootView.setOnSizeChangedListener(\n      new SizeMonitoringFrameLayout.OnSizeChangedListener() {\n        @Override\n        public void onSizeChanged(final int width, final int height, int oldW, int oldH) {\n          reactApplicationContext.runOnNativeModulesQueueThread(\n            new GuardedRunnable(reactApplicationContext) {\n              @Override\n              public void runGuarded() {\n                updateNodeSize(tag, width, height);\n              }\n            });\n        }\n      });\n\n    Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n    return tag;\n  }\n\n  @ReactMethod\n  public void removeRootView(int rootViewTag) {\n    mUIImplementation.removeRootView(rootViewTag);\n  }\n\n  public void updateNodeSize(int nodeViewTag, int newWidth, int newHeight) {\n    getReactApplicationContext().assertOnNativeModulesQueueThread();\n\n    mUIImplementation.updateNodeSize(nodeViewTag, newWidth, newHeight);\n  }\n\n  /**\n   * Sets local data for a shadow node corresponded with given tag.\n   * In some cases we need a way to specify some environmental data to shadow node\n   * to improve layout (or do something similar), so {@code localData} serves these needs.\n   * For example, any stateful embedded native views may benefit from this.\n   * Have in mind that this data is not supposed to interfere with the state of\n   * the shadow view.\n   * Please respect one-directional data flow of React.\n   */\n  public void setViewLocalData(final int tag, final Object data) {\n    final ReactApplicationContext reactApplicationContext = getReactApplicationContext();\n\n    reactApplicationContext.assertOnUiQueueThread();\n\n    reactApplicationContext.runOnNativeModulesQueueThread(\n        new GuardedRunnable(reactApplicationContext) {\n          @Override\n          public void runGuarded() {\n            mUIImplementation.setViewLocalData(tag, data);\n          }\n        });\n  }\n\n  @ReactMethod\n  public void createView(int tag, String className, int rootViewTag, ReadableMap props) {\n    if (DEBUG) {\n      String message =\n          \"(UIManager.createView) tag: \" + tag + \", class: \" + className + \", props: \" + props;\n      FLog.d(ReactConstants.TAG, message);\n      PrinterHolder.getPrinter().logMessage(ReactDebugOverlayTags.UI_MANAGER, message);\n    }\n    mUIImplementation.createView(tag, className, rootViewTag, props);\n  }\n\n  @ReactMethod\n  public void updateView(int tag, String className, ReadableMap props) {\n    if (DEBUG) {\n      String message =\n          \"(UIManager.updateView) tag: \" + tag + \", class: \" + className + \", props: \" + props;\n      FLog.d(ReactConstants.TAG, message);\n      PrinterHolder.getPrinter().logMessage(ReactDebugOverlayTags.UI_MANAGER, message);\n    }\n    mUIImplementation.updateView(tag, className, props);\n  }\n\n  /**\n   * Interface for adding/removing/moving views within a parent view from JS.\n   *\n   * @param viewTag the view tag of the parent view\n   * @param moveFrom a list of indices in the parent view to move views from\n   * @param moveTo parallel to moveFrom, a list of indices in the parent view to move views to\n   * @param addChildTags a list of tags of views to add to the parent\n   * @param addAtIndices parallel to addChildTags, a list of indices to insert those children at\n   * @param removeFrom a list of indices of views to permanently remove. The memory for the\n   *        corresponding views and data structures should be reclaimed.\n   */\n  @ReactMethod\n  public void manageChildren(\n      int viewTag,\n      @Nullable ReadableArray moveFrom,\n      @Nullable ReadableArray moveTo,\n      @Nullable ReadableArray addChildTags,\n      @Nullable ReadableArray addAtIndices,\n      @Nullable ReadableArray removeFrom) {\n    if (DEBUG) {\n      String message =\n          \"(UIManager.manageChildren) tag: \"\n              + viewTag\n              + \", moveFrom: \"\n              + moveFrom\n              + \", moveTo: \"\n              + moveTo\n              + \", addTags: \"\n              + addChildTags\n              + \", atIndices: \"\n              + addAtIndices\n              + \", removeFrom: \"\n              + removeFrom;\n      FLog.d(ReactConstants.TAG, message);\n      PrinterHolder.getPrinter().logMessage(ReactDebugOverlayTags.UI_MANAGER, message);\n    }\n    mUIImplementation.manageChildren(\n        viewTag,\n        moveFrom,\n        moveTo,\n        addChildTags,\n        addAtIndices,\n        removeFrom);\n  }\n\n  /**\n   * Interface for fast tracking the initial adding of views.  Children view tags are assumed to be\n   * in order\n   *\n   * @param viewTag the view tag of the parent view\n   * @param childrenTags An array of tags to add to the parent in order\n   */\n  @ReactMethod\n  public void setChildren(\n    int viewTag,\n    ReadableArray childrenTags) {\n    if (DEBUG) {\n      String message = \"(UIManager.setChildren) tag: \" + viewTag + \", children: \" + childrenTags;\n      FLog.d(ReactConstants.TAG, message);\n      PrinterHolder.getPrinter().logMessage(ReactDebugOverlayTags.UI_MANAGER, message);\n    }\n    mUIImplementation.setChildren(viewTag, childrenTags);\n  }\n\n  /**\n   * Replaces the View specified by oldTag with the View specified by newTag within oldTag's parent.\n   * This resolves to a simple {@link #manageChildren} call, but React doesn't have enough info in\n   * JS to formulate it itself.\n   */\n  @ReactMethod\n  public void replaceExistingNonRootView(int oldTag, int newTag) {\n    mUIImplementation.replaceExistingNonRootView(oldTag, newTag);\n  }\n\n  /**\n   * Method which takes a container tag and then releases all subviews for that container upon\n   * receipt.\n   * TODO: The method name is incorrect and will be renamed, #6033872\n   * @param containerTag the tag of the container for which the subviews must be removed\n   */\n  @ReactMethod\n  public void removeSubviewsFromContainerWithID(int containerTag) {\n    mUIImplementation.removeSubviewsFromContainerWithID(containerTag);\n  }\n\n  /**\n   * Determines the location on screen, width, and height of the given view and returns the values\n   * via an async callback.\n   */\n  @ReactMethod\n  public void measure(int reactTag, Callback callback) {\n    mUIImplementation.measure(reactTag, callback);\n  }\n\n  /**\n   * Determines the location on screen, width, and height of the given view relative to the device\n   * screen and returns the values via an async callback.  This is the absolute position including\n   * things like the status bar\n   */\n  @ReactMethod\n  public void measureInWindow(int reactTag, Callback callback) {\n    mUIImplementation.measureInWindow(reactTag, callback);\n  }\n\n  /**\n   * Measures the view specified by tag relative to the given ancestorTag. This means that the\n   * returned x, y are relative to the origin x, y of the ancestor view. Results are stored in the\n   * given outputBuffer. We allow ancestor view and measured view to be the same, in which case\n   * the position always will be (0, 0) and method will only measure the view dimensions.\n   *\n   * NB: Unlike {@link #measure}, this will measure relative to the view layout, not the visible\n   * window which can cause unexpected results when measuring relative to things like ScrollViews\n   * that can have offset content on the screen.\n   */\n  @ReactMethod\n  public void measureLayout(\n      int tag,\n      int ancestorTag,\n      Callback errorCallback,\n      Callback successCallback) {\n    mUIImplementation.measureLayout(tag, ancestorTag, errorCallback, successCallback);\n  }\n\n  /**\n   * Like {@link #measure} and {@link #measureLayout} but measures relative to the immediate parent.\n   *\n   * NB: Unlike {@link #measure}, this will measure relative to the view layout, not the visible\n   * window which can cause unexpected results when measuring relative to things like ScrollViews\n   * that can have offset content on the screen.\n   */\n  @ReactMethod\n  public void measureLayoutRelativeToParent(\n      int tag,\n      Callback errorCallback,\n      Callback successCallback) {\n    mUIImplementation.measureLayoutRelativeToParent(tag, errorCallback, successCallback);\n  }\n\n  /**\n   * Find the touch target child native view in  the supplied root view hierarchy, given a react\n   * target location.\n   *\n   * This method is currently used only by Element Inspector DevTool.\n   *\n   * @param reactTag the tag of the root view to traverse\n   * @param point an array containing both X and Y target location\n   * @param callback will be called if with the identified child view react ID, and measurement\n   *        info. If no view was found, callback will be invoked with no data.\n   */\n  @ReactMethod\n  public void findSubviewIn(\n      final int reactTag,\n      final ReadableArray point,\n      final Callback callback) {\n    mUIImplementation.findSubviewIn(\n      reactTag,\n      Math.round(PixelUtil.toPixelFromDIP(point.getDouble(0))),\n      Math.round(PixelUtil.toPixelFromDIP(point.getDouble(1))),\n      callback);\n  }\n\n  /**\n   *  Check if the first shadow node is the descendant of the second shadow node\n   */\n  @ReactMethod\n  public void viewIsDescendantOf(\n      final int reactTag,\n      final int ancestorReactTag,\n      final Callback callback) {\n    mUIImplementation.viewIsDescendantOf(reactTag, ancestorReactTag, callback);\n  }\n\n  /**\n   * Registers a new Animation that can then be added to a View using {@link #addAnimation}.\n   */\n  public void registerAnimation(Animation animation) {\n    mUIImplementation.registerAnimation(animation);\n  }\n\n  /**\n   * Adds an Animation previously registered with {@link #registerAnimation} to a View and starts it\n   */\n  public void addAnimation(int reactTag, int animationID, Callback onSuccess) {\n    mUIImplementation.addAnimation(reactTag, animationID, onSuccess);\n  }\n\n  /**\n   * Removes an existing Animation, canceling it if it was in progress.\n   */\n  public void removeAnimation(int reactTag, int animationID) {\n    mUIImplementation.removeAnimation(reactTag, animationID);\n  }\n\n  @ReactMethod\n  public void setJSResponder(int reactTag, boolean blockNativeResponder) {\n    mUIImplementation.setJSResponder(reactTag, blockNativeResponder);\n  }\n\n  @ReactMethod\n  public void clearJSResponder() {\n    mUIImplementation.clearJSResponder();\n  }\n\n  @ReactMethod\n  public void dispatchViewManagerCommand(int reactTag, int commandId, ReadableArray commandArgs) {\n    mUIImplementation.dispatchViewManagerCommand(reactTag, commandId, commandArgs);\n  }\n\n  /**\n   * Show a PopupMenu.\n   *\n   * @param reactTag the tag of the anchor view (the PopupMenu is displayed next to this view); this\n   *        needs to be the tag of a native view (shadow views can not be anchors)\n   * @param items the menu items as an array of strings\n   * @param error will be called if there is an error displaying the menu\n   * @param success will be called with the position of the selected item as the first argument, or\n   *        no arguments if the menu is dismissed\n   */\n  @ReactMethod\n  public void showPopupMenu(int reactTag, ReadableArray items, Callback error, Callback success) {\n    mUIImplementation.showPopupMenu(reactTag, items, error, success);\n  }\n\n  /**\n   * LayoutAnimation API on Android is currently experimental. Therefore, it needs to be enabled\n   * explicitly in order to avoid regression in existing application written for iOS using this API.\n   *\n   * Warning : This method will be removed in future version of React Native, and layout animation\n   * will be enabled by default, so always check for its existence before invoking it.\n   *\n   * TODO(9139831) : remove this method once layout animation is fully stable.\n   *\n   * @param enabled whether layout animation is enabled or not\n   */\n  @ReactMethod\n  public void setLayoutAnimationEnabledExperimental(boolean enabled) {\n    mUIImplementation.setLayoutAnimationEnabledExperimental(enabled);\n  }\n\n  /**\n   * Configure an animation to be used for the native layout changes, and native views\n   * creation. The animation will only apply during the current batch operations.\n   *\n   * TODO(7728153) : animating view deletion is currently not supported.\n   * TODO(7613721) : callbacks are not supported, this feature will likely be killed.\n   *\n   * @param config the configuration of the animation for view addition/removal/update.\n   * @param success will be called when the animation completes, or when the animation get\n   *        interrupted. In this case, callback parameter will be false.\n   * @param error will be called if there was an error processing the animation\n   */\n  @ReactMethod\n  public void configureNextLayoutAnimation(\n      ReadableMap config,\n      Callback success,\n      Callback error) {\n    mUIImplementation.configureNextLayoutAnimation(config, success, error);\n  }\n\n  /**\n   * To implement the transactional requirement mentioned in the class javadoc, we only commit\n   * UI changes to the actual view hierarchy once a batch of JS->Java calls have been completed.\n   * We know this is safe because all JS->Java calls that are triggered by a Java->JS call (e.g.\n   * the delivery of a touch event or execution of 'renderApplication') end up in a single\n   * JS->Java transaction.\n   *\n   * A better way to do this would be to have JS explicitly signal to this module when a UI\n   * transaction is done. Right now, though, this is how iOS does it, and we should probably\n   * update the JS and native code and make this change at the same time.\n   *\n   * TODO(5279396): Make JS UI library explicitly notify the native UI module of the end of a UI\n   *                transaction using a standard native call\n   */\n  @Override\n  public void onBatchComplete() {\n    int batchId = mBatchId;\n    mBatchId++;\n\n    SystraceMessage.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"onBatchCompleteUI\")\n          .arg(\"BatchId\", batchId)\n          .flush();\n    for (UIManagerModuleListener listener : mListeners) {\n      listener.willDispatchViewUpdates(this);\n    }\n    try {\n      mUIImplementation.dispatchViewUpdates(batchId);\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n    }\n  }\n\n  public void setViewHierarchyUpdateDebugListener(\n      @Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {\n    mUIImplementation.setViewHierarchyUpdateDebugListener(listener);\n  }\n\n  public EventDispatcher getEventDispatcher() {\n    return mEventDispatcher;\n  }\n\n  @ReactMethod\n  public void sendAccessibilityEvent(int tag, int eventType) {\n    mUIImplementation.sendAccessibilityEvent(tag, eventType);\n  }\n\n  /**\n   * Schedule a block to be executed on the UI thread. Useful if you need to execute\n   * view logic after all currently queued view updates have completed.\n   *\n   * @param block that contains UI logic you want to execute.\n   *\n   * Usage Example:\n\n   UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class);\n   uiManager.addUIBlock(new UIBlock() {\n     public void execute (NativeViewHierarchyManager nvhm) {\n       View view = nvhm.resolveView(tag);\n       // ...execute your code on View (e.g. snapshot the view)\n     }\n   });\n     */\n  public void addUIBlock(UIBlock block) {\n    mUIImplementation.addUIBlock(block);\n  }\n\n  /**\n   * Schedule a block to be executed on the UI thread. Useful if you need to execute\n   * view logic before all currently queued view updates have completed.\n   *\n   * @param block that contains UI logic you want to execute.\n   */\n  public void prependUIBlock(UIBlock block) {\n    mUIImplementation.prependUIBlock(block);\n  }\n\n  public void addUIManagerListener(UIManagerModuleListener listener) {\n    mListeners.add(listener);\n  }\n\n  public void removeUIManagerListener(UIManagerModuleListener listener) {\n    mListeners.remove(listener);\n  }\n\n  /**\n   * Given a reactTag from a component, find its root node tag, if possible.\n   * Otherwise, this will return 0. If the reactTag belongs to a root node, this\n   * will return the same reactTag.\n   *\n   * @param reactTag the component tag\n   *\n   * @return the rootTag\n   */\n  public int resolveRootTagFromReactTag(int reactTag) {\n    return mUIImplementation.resolveRootTagFromReactTag(reactTag);\n  }\n\n  /** Dirties the node associated with the given react tag */\n  public void invalidateNodeLayout(int tag) {\n    ReactShadowNode node = mUIImplementation.resolveShadowNode(tag);\n    if (node == null) {\n      FLog.w(\n          ReactConstants.TAG,\n          \"Warning : attempted to dirty a non-existent react shadow node. reactTag=\" + tag);\n      return;\n    }\n    node.dirty();\n  }\n\n  /**\n   * Updates the styles of the {@link ReactShadowNode} based on the Measure specs received by\n   * parameters.\n   */\n  public void updateRootLayoutSpecs(int rootViewTag, int widthMeasureSpec, int heightMeasureSpec) {\n    mUIImplementation.updateRootView(rootViewTag, widthMeasureSpec, heightMeasureSpec);\n    mUIImplementation.dispatchViewUpdates(-1);\n  }\n\n  /** Listener that drops the CSSNode pool on low memory when the app is backgrounded. */\n  private class MemoryTrimCallback implements ComponentCallbacks2 {\n\n    @Override\n    public void onTrimMemory(int level) {\n      if (level >= TRIM_MEMORY_MODERATE) {\n        YogaNodePool.get().clear();\n      }\n    }\n\n    @Override\n    public void onConfigurationChanged(Configuration newConfig) {\n    }\n\n    @Override\n    public void onLowMemory() {\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstants.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.view.accessibility.AccessibilityEvent;\nimport android.widget.ImageView;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.uimanager.events.TouchEventType;\nimport java.util.Map;\n\n\n/**\n * Constants exposed to JS from {@link UIManagerModule}.\n */\n/* package */ class UIManagerModuleConstants {\n\n  public static final String ACTION_DISMISSED = \"dismissed\";\n  public static final String ACTION_ITEM_SELECTED = \"itemSelected\";\n\n  /* package */ static Map getBubblingEventTypeConstants() {\n    return MapBuilder.builder()\n        .put(\n            \"topChange\",\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\"bubbled\", \"onChange\", \"captured\", \"onChangeCapture\")))\n        .put(\n            \"topSelect\",\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\"bubbled\", \"onSelect\", \"captured\", \"onSelectCapture\")))\n        .put(\n            TouchEventType.START.getJSEventName(),\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\n                    \"bubbled\",\n                    \"onTouchStart\",\n                    \"captured\",\n                    \"onTouchStartCapture\")))\n        .put(\n            TouchEventType.MOVE.getJSEventName(),\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\n                    \"bubbled\",\n                    \"onTouchMove\",\n                    \"captured\",\n                    \"onTouchMoveCapture\")))\n        .put(\n            TouchEventType.END.getJSEventName(),\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\n                    \"bubbled\",\n                    \"onTouchEnd\",\n                    \"captured\",\n                    \"onTouchEndCapture\")))\n        .put(\n            TouchEventType.CANCEL.getJSEventName(),\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\n                    \"bubbled\",\n                    \"onTouchCancel\",\n                    \"captured\",\n                    \"onTouchCancelCapture\")))\n        .build();\n  }\n\n  /* package */ static Map getDirectEventTypeConstants() {\n    final String rn = \"registrationName\";\n    return MapBuilder.builder()\n        .put(\"topContentSizeChange\", MapBuilder.of(rn, \"onContentSizeChange\"))\n        .put(\"topLayout\", MapBuilder.of(rn, \"onLayout\"))\n        .put(\"topLoadingError\", MapBuilder.of(rn, \"onLoadingError\"))\n        .put(\"topLoadingFinish\", MapBuilder.of(rn, \"onLoadingFinish\"))\n        .put(\"topLoadingStart\", MapBuilder.of(rn, \"onLoadingStart\"))\n        .put(\"topSelectionChange\", MapBuilder.of(rn, \"onSelectionChange\"))\n        .put(\"topMessage\", MapBuilder.of(rn, \"onMessage\"))\n        // Scroll events are added as per task T22348735.\n        // Subject for further improvement.\n        .put(\"topScrollBeginDrag\", MapBuilder.of(rn, \"onScrollBeginDrag\"))\n        .put(\"topScrollEndDrag\", MapBuilder.of(rn, \"onScrollEndDrag\"))\n        .put(\"topScroll\", MapBuilder.of(rn, \"onScroll\"))\n        .put(\"topMomentumScrollBegin\", MapBuilder.of(rn, \"onMomentumScrollBegin\"))\n        .put(\"topMomentumScrollEnd\", MapBuilder.of(rn, \"onMomentumScrollEnd\"))\n        .build();\n  }\n\n  public static Map<String, Object> getConstants() {\n    Map<String, Object> constants = MapBuilder.newHashMap();\n    constants.put(\n        \"UIView\",\n        MapBuilder.of(\n            \"ContentMode\",\n            MapBuilder.of(\n                \"ScaleAspectFit\",\n                ImageView.ScaleType.FIT_CENTER.ordinal(),\n                \"ScaleAspectFill\",\n                ImageView.ScaleType.CENTER_CROP.ordinal(),\n                \"ScaleAspectCenter\",\n                ImageView.ScaleType.CENTER_INSIDE.ordinal())));\n\n    constants.put(\n        \"StyleConstants\",\n        MapBuilder.of(\n            \"PointerEventsValues\",\n            MapBuilder.of(\n                \"none\",\n                PointerEvents.NONE.ordinal(),\n                \"boxNone\",\n                PointerEvents.BOX_NONE.ordinal(),\n                \"boxOnly\",\n                PointerEvents.BOX_ONLY.ordinal(),\n                \"unspecified\",\n                PointerEvents.AUTO.ordinal())));\n\n    constants.put(\n        \"PopupMenu\",\n        MapBuilder.of(\n            ACTION_DISMISSED,\n            ACTION_DISMISSED,\n            ACTION_ITEM_SELECTED,\n            ACTION_ITEM_SELECTED));\n\n    constants.put(\n      \"AccessibilityEventTypes\",\n      MapBuilder.of(\n          \"typeWindowStateChanged\",\n          AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED,\n          \"typeViewClicked\",\n          AccessibilityEvent.TYPE_VIEW_CLICKED));\n\n    return constants;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;\n\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.systrace.Systrace;\nimport com.facebook.systrace.SystraceMessage;\nimport java.util.List;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * Helps generate constants map for {@link UIManagerModule} by collecting and merging constants from\n * registered view managers.\n */\n/* package */ class UIManagerModuleConstantsHelper {\n\n  private static final String BUBBLING_EVENTS_KEY = \"bubblingEventTypes\";\n  private static final String DIRECT_EVENTS_KEY = \"directEventTypes\";\n\n  /**\n   * Generates a lazy discovery enabled version of {@link UIManagerModule} constants. It only\n   * contains a list of view manager names, so that JS side is aware of the managers there are.\n   * Actual ViewManager instantiation happens when {@code UIManager.SpecificViewManager} call happens.\n   * The View Manager is then registered on the JS side with the help of\n   * {@code UIManagerModule.getConstantsForViewManager}.\n   */\n  /* package */ static Map<String, Object> createConstants(\n      UIManagerModule.ViewManagerResolver resolver) {\n    Map<String, Object> constants = UIManagerModuleConstants.getConstants();\n    constants.put(\"ViewManagerNames\", resolver.getViewManagerNames());\n    return constants;\n  }\n\n  /* package */ static Map<String, Object> getDefaultExportableEventTypes() {\n    return MapBuilder.<String, Object>of(\n        BUBBLING_EVENTS_KEY, UIManagerModuleConstants.getBubblingEventTypeConstants(),\n        DIRECT_EVENTS_KEY, UIManagerModuleConstants.getDirectEventTypeConstants());\n  }\n\n  /**\n   * Generates map of constants that is then exposed by {@link UIManagerModule}.\n   * Provided list of {@param viewManagers} is then used to populate content of\n   * those predefined fields using\n   * {@link ViewManager#getExportedCustomBubblingEventTypeConstants} and\n   * {@link ViewManager#getExportedCustomDirectEventTypeConstants} respectively. Each view manager\n   * is in addition allowed to expose viewmanager-specific constants that are placed under the key\n   * that corresponds to the view manager's name (see {@link ViewManager#getName}). Constants are\n   * merged into the map of {@link UIManagerModule} base constants that is stored in\n   * {@link UIManagerModuleConstants}.\n   * TODO(6845124): Create a test for this\n   */\n  /* package */ static Map<String, Object> createConstants(\n        List<ViewManager> viewManagers,\n        @Nullable Map<String, Object> allBubblingEventTypes,\n        @Nullable Map<String, Object> allDirectEventTypes) {\n    Map<String, Object> constants = UIManagerModuleConstants.getConstants();\n\n    // Generic/default event types:\n    // All view managers are capable of dispatching these events.\n    // They will be automatically registered with React Fiber.\n    Map genericBubblingEventTypes = UIManagerModuleConstants.getBubblingEventTypeConstants();\n    Map genericDirectEventTypes = UIManagerModuleConstants.getDirectEventTypeConstants();\n\n    // Cumulative event types:\n    // View manager specific event types are collected as views are loaded.\n    // This information is used later when events are dispatched.\n    if (allBubblingEventTypes != null) {\n      allBubblingEventTypes.putAll(genericBubblingEventTypes);\n    }\n    if (allDirectEventTypes != null) {\n      allDirectEventTypes.putAll(genericDirectEventTypes);\n    }\n\n    for (ViewManager viewManager : viewManagers) {\n      final String viewManagerName = viewManager.getName();\n\n      SystraceMessage.beginSection(\n              TRACE_TAG_REACT_JAVA_BRIDGE, \"UIManagerModuleConstantsHelper.createConstants\")\n          .arg(\"ViewManager\", viewManagerName)\n          .arg(\"Lazy\", false)\n          .flush();\n\n      try {\n        Map viewManagerConstants = createConstantsForViewManager(\n            viewManager,\n            null,\n            null,\n            allBubblingEventTypes,\n            allDirectEventTypes);\n        if (!viewManagerConstants.isEmpty()) {\n          constants.put(viewManagerName, viewManagerConstants);\n        }\n      } finally {\n        Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);\n      }\n    }\n\n    constants.put(\"genericBubblingEventTypes\", genericBubblingEventTypes);\n    constants.put(\"genericDirectEventTypes\", genericDirectEventTypes);\n    return constants;\n  }\n\n  /* package */ static Map<String, Object> createConstantsForViewManager(\n      ViewManager viewManager,\n      @Nullable Map defaultBubblingEvents,\n      @Nullable Map defaultDirectEvents,\n      @Nullable Map cumulativeBubblingEventTypes,\n      @Nullable Map cumulativeDirectEventTypes) {\n    Map<String, Object> viewManagerConstants = MapBuilder.newHashMap();\n\n    Map viewManagerBubblingEvents = viewManager.getExportedCustomBubblingEventTypeConstants();\n    if (viewManagerBubblingEvents != null) {\n      recursiveMerge(cumulativeBubblingEventTypes, viewManagerBubblingEvents);\n      recursiveMerge(viewManagerBubblingEvents, defaultBubblingEvents);\n      viewManagerConstants.put(BUBBLING_EVENTS_KEY, viewManagerBubblingEvents);\n    } else if (defaultBubblingEvents != null) {\n      viewManagerConstants.put(BUBBLING_EVENTS_KEY, defaultBubblingEvents);\n    }\n\n    Map viewManagerDirectEvents = viewManager.getExportedCustomDirectEventTypeConstants();\n    if (viewManagerDirectEvents != null) {\n      recursiveMerge(cumulativeDirectEventTypes, viewManagerDirectEvents);\n      recursiveMerge(viewManagerDirectEvents, defaultDirectEvents);\n      viewManagerConstants.put(DIRECT_EVENTS_KEY, viewManagerDirectEvents);\n    } else if (defaultDirectEvents != null) {\n      viewManagerConstants.put(DIRECT_EVENTS_KEY, defaultDirectEvents);\n    }\n\n    Map customViewConstants = viewManager.getExportedViewConstants();\n    if (customViewConstants != null) {\n      viewManagerConstants.put(\"Constants\", customViewConstants);\n    }\n    Map viewManagerCommands = viewManager.getCommandsMap();\n    if (viewManagerCommands != null) {\n      viewManagerConstants.put(\"Commands\", viewManagerCommands);\n    }\n    Map<String, String> viewManagerNativeProps = viewManager.getNativeProps();\n    if (!viewManagerNativeProps.isEmpty()) {\n      viewManagerConstants.put(\"NativeProps\", viewManagerNativeProps);\n    }\n\n    return viewManagerConstants;\n  }\n\n  /**\n   * Merges {@param source} map into {@param dest} map recursively\n   */\n  private static void recursiveMerge(@Nullable Map dest, @Nullable Map source) {\n    if (dest == null || source == null || source.isEmpty()) {\n      return;\n    }\n\n    for (Object key : source.keySet()) {\n      Object sourceValue = source.get(key);\n      Object destValue = dest.get(key);\n      if (destValue != null && (sourceValue instanceof Map) && (destValue instanceof Map)) {\n        recursiveMerge((Map) destValue, (Map) sourceValue);\n      } else {\n        dest.put(key, sourceValue);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleListener.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\n/**\n * Listener used to hook into the UIManager update process.\n */\npublic interface UIManagerModuleListener {\n  /**\n   * Called right before view updates are dispatched at the end of a batch. This is useful if a\n   * module needs to add UIBlocks to the queue before it is flushed.\n   */\n  void willDispatchViewUpdates(UIManagerModule uiManager);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.os.SystemClock;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.animation.Animation;\nimport com.facebook.react.animation.AnimationRegistry;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.GuardedRunnable;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.SoftAssertions;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.modules.core.ReactChoreographer;\nimport com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener;\nimport com.facebook.systrace.Systrace;\nimport com.facebook.systrace.SystraceMessage;\nimport java.util.ArrayDeque;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Map;\nimport javax.annotation.Nullable;\nimport javax.annotation.concurrent.GuardedBy;\n\n/**\n * This class acts as a buffer for command executed on {@link NativeViewHierarchyManager} or on\n * {@link AnimationRegistry}. It expose similar methods as mentioned classes but instead of\n * executing commands immediately it enqueues those operations in a queue that is then flushed from\n * {@link UIManagerModule} once JS batch of ui operations is finished. This is to make sure that we\n * execute all the JS operation coming from a single batch a single loop of the main (UI) android\n * looper.\n *\n * TODO(7135923): Pooling of operation objects\n * TODO(5694019): Consider a better data structure for operations queue to save on allocations\n */\npublic class UIViewOperationQueue {\n\n  public static final int DEFAULT_MIN_TIME_LEFT_IN_FRAME_FOR_NONBATCHED_OPERATION_MS = 8;\n\n  private final int[] mMeasureBuffer = new int[4];\n\n  /**\n   * A mutation or animation operation on the view hierarchy.\n   */\n  public interface UIOperation {\n\n    void execute();\n  }\n\n  /**\n   * A spec for an operation on the native View hierarchy.\n   */\n  private abstract class ViewOperation implements UIOperation {\n\n    public int mTag;\n\n    public ViewOperation(int tag) {\n      mTag = tag;\n    }\n  }\n\n  private final class RemoveRootViewOperation extends ViewOperation {\n\n    public RemoveRootViewOperation(int tag) {\n      super(tag);\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.removeRootView(mTag);\n    }\n  }\n\n  private final class UpdatePropertiesOperation extends ViewOperation {\n\n    private final ReactStylesDiffMap mProps;\n\n    private UpdatePropertiesOperation(int tag, ReactStylesDiffMap props) {\n      super(tag);\n      mProps = props;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.updateProperties(mTag, mProps);\n    }\n  }\n\n  /**\n   * Operation for updating native view's position and size. The operation is not created directly\n   * by a {@link UIManagerModule} call from JS. Instead it gets inflated using computed position\n   * and size values by CSSNodeDEPRECATED hierarchy.\n   */\n  private final class UpdateLayoutOperation extends ViewOperation {\n\n    private final int mParentTag, mX, mY, mWidth, mHeight;\n\n    public UpdateLayoutOperation(\n        int parentTag,\n        int tag,\n        int x,\n        int y,\n        int width,\n        int height) {\n      super(tag);\n      mParentTag = parentTag;\n      mX = x;\n      mY = y;\n      mWidth = width;\n      mHeight = height;\n      Systrace.startAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, \"updateLayout\", mTag);\n    }\n\n    @Override\n    public void execute() {\n      Systrace.endAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, \"updateLayout\", mTag);\n      mNativeViewHierarchyManager.updateLayout(mParentTag, mTag, mX, mY, mWidth, mHeight);\n    }\n  }\n\n  private final class CreateViewOperation extends ViewOperation {\n\n    private final ThemedReactContext mThemedContext;\n    private final String mClassName;\n    private final @Nullable ReactStylesDiffMap mInitialProps;\n\n    public CreateViewOperation(\n        ThemedReactContext themedContext,\n        int tag,\n        String className,\n        @Nullable ReactStylesDiffMap initialProps) {\n      super(tag);\n      mThemedContext = themedContext;\n      mClassName = className;\n      mInitialProps = initialProps;\n      Systrace.startAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, \"createView\", mTag);\n    }\n\n    @Override\n    public void execute() {\n      Systrace.endAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, \"createView\", mTag);\n      mNativeViewHierarchyManager.createView(\n          mThemedContext,\n          mTag,\n          mClassName,\n          mInitialProps);\n    }\n  }\n\n  private final class ManageChildrenOperation extends ViewOperation {\n\n    private final @Nullable int[] mIndicesToRemove;\n    private final @Nullable ViewAtIndex[] mViewsToAdd;\n    private final @Nullable int[] mTagsToDelete;\n\n    public ManageChildrenOperation(\n        int tag,\n        @Nullable int[] indicesToRemove,\n        @Nullable ViewAtIndex[] viewsToAdd,\n        @Nullable int[] tagsToDelete) {\n      super(tag);\n      mIndicesToRemove = indicesToRemove;\n      mViewsToAdd = viewsToAdd;\n      mTagsToDelete = tagsToDelete;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.manageChildren(\n          mTag,\n          mIndicesToRemove,\n          mViewsToAdd,\n          mTagsToDelete);\n    }\n  }\n\n  private final class SetChildrenOperation extends ViewOperation {\n\n    private final ReadableArray mChildrenTags;\n\n    public SetChildrenOperation(\n      int tag,\n      ReadableArray childrenTags) {\n      super(tag);\n      mChildrenTags = childrenTags;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.setChildren(\n        mTag,\n        mChildrenTags);\n    }\n  }\n\n  private final class UpdateViewExtraData extends ViewOperation {\n\n    private final Object mExtraData;\n\n    public UpdateViewExtraData(int tag, Object extraData) {\n      super(tag);\n      mExtraData = extraData;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.updateViewExtraData(mTag, mExtraData);\n    }\n  }\n\n  private final class ChangeJSResponderOperation extends ViewOperation {\n\n    private final int mInitialTag;\n    private final boolean mBlockNativeResponder;\n    private final boolean mClearResponder;\n\n    public ChangeJSResponderOperation(\n        int tag,\n        int initialTag,\n        boolean clearResponder,\n        boolean blockNativeResponder) {\n      super(tag);\n      mInitialTag = initialTag;\n      mClearResponder = clearResponder;\n      mBlockNativeResponder = blockNativeResponder;\n    }\n\n    @Override\n    public void execute() {\n      if (!mClearResponder) {\n        mNativeViewHierarchyManager.setJSResponder(mTag, mInitialTag, mBlockNativeResponder);\n      } else {\n        mNativeViewHierarchyManager.clearJSResponder();\n      }\n    }\n  }\n\n  private final class DispatchCommandOperation extends ViewOperation {\n\n    private final int mCommand;\n    private final @Nullable ReadableArray mArgs;\n\n    public DispatchCommandOperation(int tag, int command, @Nullable ReadableArray args) {\n      super(tag);\n      mCommand = command;\n      mArgs = args;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.dispatchCommand(mTag, mCommand, mArgs);\n    }\n  }\n\n  private final class ShowPopupMenuOperation extends ViewOperation {\n\n    private final ReadableArray mItems;\n    private final Callback mSuccess;\n\n    public ShowPopupMenuOperation(\n        int tag,\n        ReadableArray items,\n        Callback success) {\n      super(tag);\n      mItems = items;\n      mSuccess = success;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.showPopupMenu(mTag, mItems, mSuccess);\n    }\n  }\n\n  /**\n   * A spec for animation operations (add/remove)\n   */\n  private static abstract class AnimationOperation implements UIViewOperationQueue.UIOperation {\n\n    protected final int mAnimationID;\n\n    public AnimationOperation(int animationID) {\n      mAnimationID = animationID;\n    }\n  }\n\n  private class RegisterAnimationOperation extends AnimationOperation {\n\n    private final Animation mAnimation;\n\n    private RegisterAnimationOperation(Animation animation) {\n      super(animation.getAnimationID());\n      mAnimation = animation;\n    }\n\n    @Override\n    public void execute() {\n      mAnimationRegistry.registerAnimation(mAnimation);\n    }\n  }\n\n  private class AddAnimationOperation extends AnimationOperation {\n    private final int mReactTag;\n    private final Callback mSuccessCallback;\n\n    private AddAnimationOperation(int reactTag, int animationID, Callback successCallback) {\n      super(animationID);\n      mReactTag = reactTag;\n      mSuccessCallback = successCallback;\n    }\n\n    @Override\n    public void execute() {\n      Animation animation = mAnimationRegistry.getAnimation(mAnimationID);\n      if (animation != null) {\n        mNativeViewHierarchyManager.startAnimationForNativeView(\n            mReactTag,\n            animation,\n            mSuccessCallback);\n      } else {\n        // node or animation not found\n        // TODO(5712813): cleanup callback in JS callbacks table in case of an error\n        throw new IllegalViewOperationException(\"Animation with id \" + mAnimationID\n            + \" was not found\");\n      }\n    }\n  }\n\n  private final class RemoveAnimationOperation extends AnimationOperation {\n\n    private RemoveAnimationOperation(int animationID) {\n      super(animationID);\n    }\n\n    @Override\n    public void execute() {\n      Animation animation = mAnimationRegistry.getAnimation(mAnimationID);\n      if (animation != null) {\n        animation.cancel();\n      }\n    }\n  }\n\n  private class SetLayoutAnimationEnabledOperation implements UIOperation {\n    private final boolean mEnabled;\n\n    private SetLayoutAnimationEnabledOperation(final boolean enabled) {\n      mEnabled = enabled;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.setLayoutAnimationEnabled(mEnabled);\n    }\n  }\n\n  private class ConfigureLayoutAnimationOperation implements UIOperation {\n    private final ReadableMap mConfig;\n\n    private ConfigureLayoutAnimationOperation(final ReadableMap config) {\n      mConfig = config;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.configureLayoutAnimation(mConfig);\n    }\n  }\n\n  private final class MeasureOperation implements UIOperation {\n\n    private final int mReactTag;\n    private final Callback mCallback;\n\n    private MeasureOperation(\n        final int reactTag,\n        final Callback callback) {\n      super();\n      mReactTag = reactTag;\n      mCallback = callback;\n    }\n\n    @Override\n    public void execute() {\n      try {\n        mNativeViewHierarchyManager.measure(mReactTag, mMeasureBuffer);\n      } catch (NoSuchNativeViewException e) {\n        // Invoke with no args to signal failure and to allow JS to clean up the callback\n        // handle.\n        mCallback.invoke();\n        return;\n      }\n\n      float x = PixelUtil.toDIPFromPixel(mMeasureBuffer[0]);\n      float y = PixelUtil.toDIPFromPixel(mMeasureBuffer[1]);\n      float width = PixelUtil.toDIPFromPixel(mMeasureBuffer[2]);\n      float height = PixelUtil.toDIPFromPixel(mMeasureBuffer[3]);\n      mCallback.invoke(0, 0, width, height, x, y);\n    }\n  }\n\n  private final class MeasureInWindowOperation implements UIOperation {\n\n    private final int mReactTag;\n    private final Callback mCallback;\n\n    private MeasureInWindowOperation(\n        final int reactTag,\n        final Callback callback) {\n      super();\n      mReactTag = reactTag;\n      mCallback = callback;\n    }\n\n    @Override\n    public void execute() {\n      try {\n        mNativeViewHierarchyManager.measureInWindow(mReactTag, mMeasureBuffer);\n      } catch (NoSuchNativeViewException e) {\n        // Invoke with no args to signal failure and to allow JS to clean up the callback\n        // handle.\n        mCallback.invoke();\n        return;\n      }\n\n      float x = PixelUtil.toDIPFromPixel(mMeasureBuffer[0]);\n      float y = PixelUtil.toDIPFromPixel(mMeasureBuffer[1]);\n      float width = PixelUtil.toDIPFromPixel(mMeasureBuffer[2]);\n      float height = PixelUtil.toDIPFromPixel(mMeasureBuffer[3]);\n      mCallback.invoke(x, y, width, height);\n    }\n  }\n\n  private final class FindTargetForTouchOperation implements UIOperation {\n\n    private final int mReactTag;\n    private final float mTargetX;\n    private final float mTargetY;\n    private final Callback mCallback;\n\n    private FindTargetForTouchOperation(\n        final int reactTag,\n        final float targetX,\n        final float targetY,\n        final Callback callback) {\n      super();\n      mReactTag = reactTag;\n      mTargetX = targetX;\n      mTargetY = targetY;\n      mCallback = callback;\n    }\n\n    @Override\n    public void execute() {\n      try {\n        mNativeViewHierarchyManager.measure(\n            mReactTag,\n            mMeasureBuffer);\n      } catch (IllegalViewOperationException e) {\n        mCallback.invoke();\n        return;\n      }\n\n      // Because React coordinates are relative to root container, and measure() operates\n      // on screen coordinates, we need to offset values using root container location.\n      final float containerX = (float) mMeasureBuffer[0];\n      final float containerY = (float) mMeasureBuffer[1];\n\n      final int touchTargetReactTag = mNativeViewHierarchyManager.findTargetTagForTouch(\n          mReactTag,\n          mTargetX,\n          mTargetY);\n\n      try {\n        mNativeViewHierarchyManager.measure(\n            touchTargetReactTag,\n            mMeasureBuffer);\n      } catch (IllegalViewOperationException e) {\n        mCallback.invoke();\n        return;\n      }\n\n      float x = PixelUtil.toDIPFromPixel(mMeasureBuffer[0] - containerX);\n      float y = PixelUtil.toDIPFromPixel(mMeasureBuffer[1] - containerY);\n      float width = PixelUtil.toDIPFromPixel(mMeasureBuffer[2]);\n      float height = PixelUtil.toDIPFromPixel(mMeasureBuffer[3]);\n      mCallback.invoke(touchTargetReactTag, x, y, width, height);\n    }\n  }\n\n  private class UIBlockOperation implements UIOperation {\n    private final UIBlock mBlock;\n    public UIBlockOperation (UIBlock block) {\n      mBlock = block;\n    }\n\n    @Override\n    public void execute() {\n      mBlock.execute(mNativeViewHierarchyManager);\n    }\n  }\n\n  private final class SendAccessibilityEvent extends ViewOperation {\n\n    private final int mEventType;\n\n    private SendAccessibilityEvent(int tag, int eventType) {\n      super(tag);\n      mEventType = eventType;\n    }\n\n    @Override\n    public void execute() {\n      mNativeViewHierarchyManager.sendAccessibilityEvent(mTag, mEventType);\n    }\n  }\n\n  private final NativeViewHierarchyManager mNativeViewHierarchyManager;\n  private final AnimationRegistry mAnimationRegistry;\n  private final Object mDispatchRunnablesLock = new Object();\n  private final Object mNonBatchedOperationsLock = new Object();\n  private final DispatchUIFrameCallback mDispatchUIFrameCallback;\n  private final ReactApplicationContext mReactApplicationContext;\n\n  // Only called from the UIManager queue?\n  private ArrayList<UIOperation> mOperations = new ArrayList<>();\n\n  @GuardedBy(\"mDispatchRunnablesLock\")\n  private ArrayList<Runnable> mDispatchUIRunnables = new ArrayList<>();\n\n  @GuardedBy(\"mNonBatchedOperationsLock\")\n  private ArrayDeque<UIOperation> mNonBatchedOperations = new ArrayDeque<>();\n\n  private @Nullable NotThreadSafeViewHierarchyUpdateDebugListener mViewHierarchyUpdateDebugListener;\n  private boolean mIsDispatchUIFrameCallbackEnqueued = false;\n  private boolean mIsInIllegalUIState = false;\n  private boolean mIsProfilingNextBatch = false;\n  private long mNonBatchedExecutionTotalTime;\n  private long mProfiledBatchCommitStartTime;\n  private long mProfiledBatchLayoutTime;\n  private long mProfiledBatchDispatchViewUpdatesTime;\n  private long mProfiledBatchRunStartTime;\n  private long mProfiledBatchBatchedExecutionTime;\n  private long mProfiledBatchNonBatchedExecutionTime;\n\n  public UIViewOperationQueue(\n      ReactApplicationContext reactContext,\n      NativeViewHierarchyManager nativeViewHierarchyManager,\n      int minTimeLeftInFrameForNonBatchedOperationMs) {\n    mNativeViewHierarchyManager = nativeViewHierarchyManager;\n    mAnimationRegistry = nativeViewHierarchyManager.getAnimationRegistry();\n    mDispatchUIFrameCallback =\n        new DispatchUIFrameCallback(\n            reactContext,\n            minTimeLeftInFrameForNonBatchedOperationMs == -1\n                ? DEFAULT_MIN_TIME_LEFT_IN_FRAME_FOR_NONBATCHED_OPERATION_MS\n                : minTimeLeftInFrameForNonBatchedOperationMs);\n    mReactApplicationContext = reactContext;\n  }\n\n  /*package*/ NativeViewHierarchyManager getNativeViewHierarchyManager() {\n    return mNativeViewHierarchyManager;\n  }\n\n  public void setViewHierarchyUpdateDebugListener(\n      @Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {\n    mViewHierarchyUpdateDebugListener = listener;\n  }\n\n  public void profileNextBatch() {\n    mIsProfilingNextBatch = true;\n    mProfiledBatchCommitStartTime = 0;\n  }\n\n  public Map<String, Long> getProfiledBatchPerfCounters() {\n    Map<String, Long> perfMap = new HashMap<>();\n    perfMap.put(\"CommitStartTime\", mProfiledBatchCommitStartTime);\n    perfMap.put(\"LayoutTime\", mProfiledBatchLayoutTime);\n    perfMap.put(\"DispatchViewUpdatesTime\", mProfiledBatchDispatchViewUpdatesTime);\n    perfMap.put(\"RunStartTime\", mProfiledBatchRunStartTime);\n    perfMap.put(\"BatchedExecutionTime\", mProfiledBatchBatchedExecutionTime);\n    perfMap.put(\"NonBatchedExecutionTime\", mProfiledBatchNonBatchedExecutionTime);\n    return perfMap;\n  }\n\n  public boolean isEmpty() {\n    return mOperations.isEmpty();\n  }\n\n  public void addRootView(\n    final int tag,\n    final SizeMonitoringFrameLayout rootView,\n    final ThemedReactContext themedRootContext) {\n    mNativeViewHierarchyManager.addRootView(tag, rootView, themedRootContext);\n  }\n\n  /**\n   * Enqueues a UIOperation to be executed in UI thread. This method should only be used by a\n   * subclass to support UIOperations not provided by UIViewOperationQueue.\n   */\n  protected void enqueueUIOperation(UIOperation operation) {\n    SoftAssertions.assertNotNull(operation);\n    mOperations.add(operation);\n  }\n\n  public void enqueueRemoveRootView(int rootViewTag) {\n    mOperations.add(new RemoveRootViewOperation(rootViewTag));\n  }\n\n  public void enqueueSetJSResponder(\n      int tag,\n      int initialTag,\n      boolean blockNativeResponder) {\n    mOperations.add(\n        new ChangeJSResponderOperation(\n            tag,\n            initialTag,\n            false /*clearResponder*/,\n            blockNativeResponder));\n  }\n\n  public void enqueueClearJSResponder() {\n    // Tag is 0 because JSResponderHandler doesn't need one in order to clear the responder.\n    mOperations.add(new ChangeJSResponderOperation(0, 0, true /*clearResponder*/, false));\n  }\n\n  public void enqueueDispatchCommand(\n      int reactTag,\n      int commandId,\n      ReadableArray commandArgs) {\n    mOperations.add(new DispatchCommandOperation(reactTag, commandId, commandArgs));\n  }\n\n  public void enqueueUpdateExtraData(int reactTag, Object extraData) {\n    mOperations.add(new UpdateViewExtraData(reactTag, extraData));\n  }\n\n  public void enqueueShowPopupMenu(\n      int reactTag,\n      ReadableArray items,\n      Callback error,\n      Callback success) {\n    mOperations.add(new ShowPopupMenuOperation(reactTag, items, success));\n  }\n\n  public void enqueueCreateView(\n      ThemedReactContext themedContext,\n      int viewReactTag,\n      String viewClassName,\n      @Nullable ReactStylesDiffMap initialProps) {\n    synchronized (mNonBatchedOperationsLock) {\n      mNonBatchedOperations.addLast(\n        new CreateViewOperation(\n          themedContext,\n          viewReactTag,\n          viewClassName,\n          initialProps));\n    }\n  }\n\n  public void enqueueUpdateProperties(int reactTag, String className, ReactStylesDiffMap props) {\n    mOperations.add(new UpdatePropertiesOperation(reactTag, props));\n  }\n\n  public void enqueueUpdateLayout(\n      int parentTag,\n      int reactTag,\n      int x,\n      int y,\n      int width,\n      int height) {\n    mOperations.add(\n        new UpdateLayoutOperation(parentTag, reactTag, x, y, width, height));\n  }\n\n  public void enqueueManageChildren(\n      int reactTag,\n      @Nullable int[] indicesToRemove,\n      @Nullable ViewAtIndex[] viewsToAdd,\n      @Nullable int[] tagsToDelete) {\n    mOperations.add(\n        new ManageChildrenOperation(reactTag, indicesToRemove, viewsToAdd, tagsToDelete));\n  }\n\n  public void enqueueSetChildren(\n    int reactTag,\n    ReadableArray childrenTags) {\n    mOperations.add(\n      new SetChildrenOperation(reactTag, childrenTags));\n  }\n\n  public void enqueueRegisterAnimation(Animation animation) {\n    mOperations.add(new RegisterAnimationOperation(animation));\n  }\n\n  public void enqueueAddAnimation(\n      final int reactTag,\n      final int animationID,\n      final Callback onSuccess) {\n    mOperations.add(new AddAnimationOperation(reactTag, animationID, onSuccess));\n  }\n\n  public void enqueueRemoveAnimation(int animationID) {\n    mOperations.add(new RemoveAnimationOperation(animationID));\n  }\n\n  public void enqueueSetLayoutAnimationEnabled(\n      final boolean enabled) {\n    mOperations.add(new SetLayoutAnimationEnabledOperation(enabled));\n  }\n\n  public void enqueueConfigureLayoutAnimation(\n      final ReadableMap config,\n      final Callback onSuccess,\n      final Callback onError) {\n    mOperations.add(new ConfigureLayoutAnimationOperation(config));\n  }\n\n  public void enqueueMeasure(\n      final int reactTag,\n      final Callback callback) {\n    mOperations.add(\n        new MeasureOperation(reactTag, callback));\n  }\n\n  public void enqueueMeasureInWindow(\n      final int reactTag,\n      final Callback callback) {\n    mOperations.add(\n        new MeasureInWindowOperation(reactTag, callback));\n  }\n\n  public void enqueueFindTargetForTouch(\n      final int reactTag,\n      final float targetX,\n      final float targetY,\n      final Callback callback) {\n    mOperations.add(\n        new FindTargetForTouchOperation(reactTag, targetX, targetY, callback));\n  }\n\n  public void enqueueSendAccessibilityEvent(int tag, int eventType) {\n    mOperations.add(new SendAccessibilityEvent(tag, eventType));\n  }\n\n  public void enqueueUIBlock(UIBlock block) {\n    mOperations.add(new UIBlockOperation(block));\n  }\n\n  public void prependUIBlock(UIBlock block) {\n    mOperations.add(0, new UIBlockOperation(block));\n  }\n\n  /* package */ void dispatchViewUpdates(\n      final int batchId, final long commitStartTime, final long layoutTime) {\n    SystraceMessage.beginSection(\n      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n      \"UIViewOperationQueue.dispatchViewUpdates\")\n      .arg(\"batchId\", batchId)\n      .flush();\n    try {\n      final long dispatchViewUpdatesTime = SystemClock.uptimeMillis();\n\n      // Store the current operation queues to dispatch and create new empty ones to continue\n      // receiving new operations\n      final ArrayList<UIOperation> batchedOperations;\n      if (!mOperations.isEmpty()) {\n        batchedOperations = mOperations;\n        mOperations = new ArrayList<>();\n      } else {\n        batchedOperations = null;\n      }\n\n      final ArrayDeque<UIOperation> nonBatchedOperations;\n      synchronized (mNonBatchedOperationsLock) {\n        if (!mNonBatchedOperations.isEmpty()) {\n          nonBatchedOperations = mNonBatchedOperations;\n          mNonBatchedOperations = new ArrayDeque<>();\n        } else {\n          nonBatchedOperations = null;\n        }\n      }\n\n      if (mViewHierarchyUpdateDebugListener != null) {\n        mViewHierarchyUpdateDebugListener.onViewHierarchyUpdateEnqueued();\n      }\n\n      Runnable runOperations =\n          new Runnable() {\n            @Override\n            public void run() {\n              SystraceMessage.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"DispatchUI\")\n                  .arg(\"BatchId\", batchId)\n                  .flush();\n              try {\n                long runStartTime = SystemClock.uptimeMillis();\n\n                // All nonBatchedOperations should be executed before regular operations as\n                // regular operations may depend on them\n                if (nonBatchedOperations != null) {\n                  for (UIOperation op : nonBatchedOperations) {\n                    op.execute();\n                  }\n                }\n\n                if (batchedOperations != null) {\n                  for (UIOperation op : batchedOperations) {\n                    op.execute();\n                  }\n                }\n\n                if (mIsProfilingNextBatch && mProfiledBatchCommitStartTime == 0) {\n                  mProfiledBatchCommitStartTime = commitStartTime;\n                  mProfiledBatchLayoutTime = layoutTime;\n                  mProfiledBatchDispatchViewUpdatesTime = dispatchViewUpdatesTime;\n                  mProfiledBatchRunStartTime = runStartTime;\n\n                  Systrace.beginAsyncSection(\n                      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n                      \"delayBeforeDispatchViewUpdates\",\n                      0,\n                      mProfiledBatchCommitStartTime * 1000000);\n                  Systrace.endAsyncSection(\n                      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n                      \"delayBeforeDispatchViewUpdates\",\n                      0,\n                      mProfiledBatchDispatchViewUpdatesTime * 1000000);\n                  Systrace.beginAsyncSection(\n                      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n                      \"delayBeforeBatchRunStart\",\n                      0,\n                      mProfiledBatchDispatchViewUpdatesTime * 1000000);\n                  Systrace.endAsyncSection(\n                      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n                      \"delayBeforeBatchRunStart\",\n                      0,\n                      mProfiledBatchRunStartTime * 1000000);\n                }\n\n                // Clear layout animation, as animation only apply to current UI operations batch.\n                mNativeViewHierarchyManager.clearLayoutAnimation();\n\n                if (mViewHierarchyUpdateDebugListener != null) {\n                  mViewHierarchyUpdateDebugListener.onViewHierarchyUpdateFinished();\n                }\n              } catch (Exception e) {\n                mIsInIllegalUIState = true;\n                throw e;\n              } finally {\n                Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n              }\n            }\n          };\n\n      SystraceMessage.beginSection(\n        Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n        \"acquiring mDispatchRunnablesLock\")\n        .arg(\"batchId\", batchId)\n        .flush();\n      synchronized (mDispatchRunnablesLock) {\n        Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n        mDispatchUIRunnables.add(runOperations);\n      }\n\n      // In the case where the frame callback isn't enqueued, the UI isn't being displayed or is being\n      // destroyed. In this case it's no longer important to align to frames, but it is important to make\n      // sure any late-arriving UI commands are executed.\n      if (!mIsDispatchUIFrameCallbackEnqueued) {\n        UiThreadUtil.runOnUiThread(\n          new GuardedRunnable(mReactApplicationContext) {\n            @Override\n            public void runGuarded() {\n              flushPendingBatches();\n            }\n          });\n      }\n    } finally {\n      Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n    }\n  }\n\n  /* package */ void resumeFrameCallback() {\n    mIsDispatchUIFrameCallbackEnqueued = true;\n    ReactChoreographer.getInstance()\n        .postFrameCallback(ReactChoreographer.CallbackType.DISPATCH_UI, mDispatchUIFrameCallback);\n  }\n\n  /* package */ void pauseFrameCallback() {\n    mIsDispatchUIFrameCallbackEnqueued = false;\n    ReactChoreographer.getInstance()\n        .removeFrameCallback(ReactChoreographer.CallbackType.DISPATCH_UI, mDispatchUIFrameCallback);\n    flushPendingBatches();\n  }\n\n  private void flushPendingBatches() {\n    if (mIsInIllegalUIState) {\n      FLog.w(\n        ReactConstants.TAG,\n        \"Not flushing pending UI operations because of previously thrown Exception\");\n      return;\n    }\n\n    final ArrayList<Runnable> runnables;\n    synchronized (mDispatchRunnablesLock) {\n      if (!mDispatchUIRunnables.isEmpty()) {\n        runnables = mDispatchUIRunnables;\n        mDispatchUIRunnables = new ArrayList<>();\n      } else {\n        return;\n      }\n    }\n\n    final long batchedExecutionStartTime = SystemClock.uptimeMillis();\n    for (Runnable runnable : runnables) {\n      runnable.run();\n    }\n\n    if (mIsProfilingNextBatch) {\n      mProfiledBatchBatchedExecutionTime = SystemClock.uptimeMillis() - batchedExecutionStartTime;\n      mProfiledBatchNonBatchedExecutionTime = mNonBatchedExecutionTotalTime;\n      mIsProfilingNextBatch = false;\n\n      Systrace.beginAsyncSection(\n          Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n          \"batchedExecutionTime\",\n          0,\n          batchedExecutionStartTime * 1000000);\n      Systrace.endAsyncSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"batchedExecutionTime\", 0);\n    }\n    mNonBatchedExecutionTotalTime = 0;\n  }\n\n  /**\n   * Choreographer FrameCallback responsible for actually dispatching view updates on the UI thread\n   * that were enqueued via {@link #dispatchViewUpdates(int)}. The reason we don't just enqueue\n   * directly to the UI thread from that method is to make sure our Runnables actually run before\n   * the next traversals happen:\n   *\n   * ViewRootImpl#scheduleTraversals (which is called from invalidate, requestLayout, etc) calls\n   * Looper#postSyncBarrier which keeps any UI thread looper messages from being processed until\n   * that barrier is removed during the next traversal. That means, depending on when we get updates\n   * from JS and what else is happening on the UI thread, we can sometimes try to post this runnable\n   * after ViewRootImpl has posted a barrier.\n   *\n   * Using a Choreographer callback (which runs immediately before traversals), we guarantee we run\n   * before the next traversal.\n   */\n  private class DispatchUIFrameCallback extends GuardedFrameCallback {\n\n    private static final int FRAME_TIME_MS = 16;\n    private final int mMinTimeLeftInFrameForNonBatchedOperationMs;\n\n    private DispatchUIFrameCallback(\n        ReactContext reactContext, int minTimeLeftInFrameForNonBatchedOperationMs) {\n      super(reactContext);\n      mMinTimeLeftInFrameForNonBatchedOperationMs = minTimeLeftInFrameForNonBatchedOperationMs;\n    }\n\n    @Override\n    public void doFrameGuarded(long frameTimeNanos) {\n      if (mIsInIllegalUIState) {\n        FLog.w(\n          ReactConstants.TAG,\n          \"Not flushing pending UI operations because of previously thrown Exception\");\n        return;\n      }\n\n      Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"dispatchNonBatchedUIOperations\");\n      try {\n        dispatchPendingNonBatchedOperations(frameTimeNanos);\n      } finally {\n        Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n      }\n\n      flushPendingBatches();\n\n      ReactChoreographer.getInstance().postFrameCallback(\n        ReactChoreographer.CallbackType.DISPATCH_UI, this);\n    }\n\n    private void dispatchPendingNonBatchedOperations(long frameTimeNanos) {\n      while (true) {\n        long timeLeftInFrame = FRAME_TIME_MS - ((System.nanoTime() - frameTimeNanos) / 1000000);\n        if (timeLeftInFrame < mMinTimeLeftInFrameForNonBatchedOperationMs) {\n          break;\n        }\n\n        UIOperation nextOperation;\n        synchronized (mNonBatchedOperationsLock) {\n          if (mNonBatchedOperations.isEmpty()) {\n            break;\n          }\n\n          nextOperation = mNonBatchedOperations.pollFirst();\n        }\n\n        try {\n          long nonBatchedExecutionStartTime = SystemClock.uptimeMillis();\n          nextOperation.execute();\n          mNonBatchedExecutionTotalTime +=\n              SystemClock.uptimeMillis() - nonBatchedExecutionStartTime;\n        } catch (Exception e) {\n          mIsInIllegalUIState = true;\n          throw e;\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupDrawingOrderHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Comparator;\n\nimport javax.annotation.Nullable;\n\n/**\n * Helper to handle implementing ViewGroups with custom drawing order based on z-index.\n */\npublic class ViewGroupDrawingOrderHelper {\n  private final ViewGroup mViewGroup;\n  private int mNumberOfChildrenWithZIndex = 0;\n  private @Nullable int[] mDrawingOrderIndices;\n\n  public ViewGroupDrawingOrderHelper(ViewGroup viewGroup) {\n    mViewGroup = viewGroup;\n  }\n\n  /**\n   * This should be called every time a view is added to the ViewGroup in {@link ViewGroup#addView}.\n   * @param view The view that is being added\n   */\n  public void handleAddView(View view) {\n    if (ViewGroupManager.getViewZIndex(view) != null) {\n      mNumberOfChildrenWithZIndex++;\n    }\n\n    mDrawingOrderIndices = null;\n  }\n\n  /**\n   * This should be called every time a view is removed from the ViewGroup in {@link ViewGroup#removeView}\n   * and {@link ViewGroup#removeViewAt}.\n   * @param view The view that is being removed.\n   */\n  public void handleRemoveView(View view) {\n    if (ViewGroupManager.getViewZIndex(view) != null) {\n      mNumberOfChildrenWithZIndex--;\n    }\n\n    mDrawingOrderIndices = null;\n  }\n\n  /**\n   * If the ViewGroup should enable drawing order. ViewGroups should call\n   * {@link ViewGroup#setChildrenDrawingOrderEnabled} with the value returned from this method when\n   * a view is added or removed.\n   */\n  public boolean shouldEnableCustomDrawingOrder() {\n    return mNumberOfChildrenWithZIndex > 0;\n  }\n\n  /**\n   * The index of the child view that should be drawn. This should be used in\n   * {@link ViewGroup#getChildDrawingOrder}.\n   */\n  public int getChildDrawingOrder(int childCount, int index) {\n    if (mDrawingOrderIndices == null) {\n      ArrayList<View> viewsToSort = new ArrayList<>();\n      for (int i = 0; i < childCount; i++) {\n        viewsToSort.add(mViewGroup.getChildAt(i));\n      }\n      // Sort the views by zIndex\n      Collections.sort(viewsToSort, new Comparator<View>() {\n        @Override\n        public int compare(View view1, View view2) {\n          Integer view1ZIndex = ViewGroupManager.getViewZIndex(view1);\n          if (view1ZIndex == null) {\n            view1ZIndex = 0;\n          }\n\n          Integer view2ZIndex = ViewGroupManager.getViewZIndex(view2);\n          if (view2ZIndex == null) {\n            view2ZIndex = 0;\n          }\n\n          return view1ZIndex - view2ZIndex;\n        }\n      });\n\n      mDrawingOrderIndices = new int[childCount];\n      for (int i = 0; i < childCount; i++) {\n        View child = viewsToSort.get(i);\n        mDrawingOrderIndices[i] = mViewGroup.indexOfChild(child);\n      }\n    }\n    return mDrawingOrderIndices[index];\n  }\n\n  /**\n   * Recheck all children for z-index changes.\n   */\n  public void update() {\n    mNumberOfChildrenWithZIndex = 0;\n    for (int i = 0; i < mViewGroup.getChildCount(); i++) {\n      if (ViewGroupManager.getViewZIndex(mViewGroup.getChildAt(i)) != null) {\n        mNumberOfChildrenWithZIndex++;\n      }\n    }\n    mDrawingOrderIndices = null;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.WeakHashMap;\n\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport javax.annotation.Nullable;\n\n/**\n * Class providing children management API for view managers of classes extending ViewGroup.\n */\npublic abstract class ViewGroupManager <T extends ViewGroup>\n    extends BaseViewManager<T, LayoutShadowNode> {\n\n  private static WeakHashMap<View, Integer> mZIndexHash = new WeakHashMap<>();\n\n  @Override\n  public LayoutShadowNode createShadowNodeInstance() {\n    return new LayoutShadowNode();\n  }\n\n  @Override\n  public Class<? extends LayoutShadowNode> getShadowNodeClass() {\n    return LayoutShadowNode.class;\n  }\n\n  @Override\n  public void updateExtraData(T root, Object extraData) {\n  }\n\n  public void addView(T parent, View child, int index) {\n    parent.addView(child, index);\n  }\n\n  /**\n   * Convenience method for batching a set of addView calls\n   * Note that this adds the views to the beginning of the ViewGroup\n   *\n   * @param parent the parent ViewGroup\n   * @param views the set of views to add\n   */\n  public void addViews(T parent, List<View> views) {\n    for (int i = 0, size = views.size(); i < size; i++) {\n      addView(parent, views.get(i), i);\n    }\n  }\n\n  public static void setViewZIndex(View view, int zIndex) {\n    mZIndexHash.put(view, zIndex);\n  }\n\n  public static @Nullable Integer getViewZIndex(View view) {\n    return mZIndexHash.get(view);\n  }\n\n  public int getChildCount(T parent) {\n    return parent.getChildCount();\n  }\n\n  public View getChildAt(T parent, int index) {\n    return parent.getChildAt(index);\n  }\n\n  public void removeViewAt(T parent, int index) {\n    parent.removeViewAt(index);\n  }\n\n  public void removeView(T parent, View view) {\n    for (int i = 0; i < getChildCount(parent); i++) {\n      if (getChildAt(parent, i) == view) {\n        removeViewAt(parent, i);\n        break;\n      }\n    }\n  }\n\n  public void removeAllViews(T parent) {\n    for (int i = getChildCount(parent) - 1; i >= 0; i--) {\n      removeViewAt(parent, i);\n    }\n  }\n\n  /**\n   * Returns whether this View type needs to handle laying out its own children instead of\n   * deferring to the standard css-layout algorithm.\n   * Returns true for the layout to *not* be automatically invoked. Instead onLayout will be\n   * invoked as normal and it is the View instance's responsibility to properly call layout on its\n   * children.\n   * Returns false for the default behavior of automatically laying out children without going\n   * through the ViewGroup's onLayout method. In that case, onLayout for this View type must *not*\n   * call layout on its children.\n   */\n  public boolean needsCustomLayoutForChildren() {\n    return false;\n  }\n\n  /**\n   * Returns whether or not this View type should promote its grandchildren as Views. This is an\n   * optimization for Scrollable containers when using Nodes, where instead of having one ViewGroup\n   * containing a large number of draw commands (and thus being more expensive in the case of\n   * an invalidate or re-draw), we split them up into several draw commands.\n   */\n  public boolean shouldPromoteGrandchildren() {\n    return false;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewHierarchyDumper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.facebook.react.bridge.UiThreadUtil;\n\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\npublic class ViewHierarchyDumper {\n\n  public static JSONObject toJSON(View view) throws JSONException {\n    UiThreadUtil.assertOnUiThread();\n\n    JSONObject result = new JSONObject();\n    result.put(\"n\", view.getClass().getName());\n    result.put(\"i\", System.identityHashCode(view));\n    Object tag = view.getTag();\n    if (tag != null && tag instanceof String) {\n      result.put(\"t\", tag);\n    }\n\n    if (view instanceof ViewGroup) {\n      ViewGroup viewGroup = (ViewGroup) view;\n      if (viewGroup.getChildCount() > 0) {\n        JSONArray children = new JSONArray();\n        for (int i = 0; i < viewGroup.getChildCount(); i++) {\n          children.put(i, toJSON(viewGroup.getChildAt(i)));\n        }\n        result.put(\"c\", children);\n      }\n    }\n\n    return result;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.view.View;\nimport com.facebook.react.bridge.BaseJavaModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.touch.JSResponderHandler;\nimport com.facebook.react.touch.ReactInterceptingViewGroup;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport com.facebook.react.uimanager.annotations.ReactPropertyHolder;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * Class responsible for knowing how to create and update catalyst Views of a given type. It is also\n * responsible for creating and updating CSSNodeDEPRECATED subclasses used for calculating position and size\n * for the corresponding native view.\n */\n@ReactPropertyHolder\npublic abstract class ViewManager<T extends View, C extends ReactShadowNode>\n  extends BaseJavaModule {\n\n  public final void updateProperties(T viewToUpdate, ReactStylesDiffMap props) {\n    ViewManagerPropertyUpdater.updateProps(this, viewToUpdate, props);\n    onAfterUpdateTransaction(viewToUpdate);\n  }\n\n  /**\n   * Creates a view and installs event emitters on it.\n   */\n  public final T createView(\n      ThemedReactContext reactContext,\n      JSResponderHandler jsResponderHandler) {\n    T view = createViewInstance(reactContext);\n    addEventEmitters(reactContext, view);\n    if (view instanceof ReactInterceptingViewGroup) {\n      ((ReactInterceptingViewGroup) view).setOnInterceptTouchEventListener(jsResponderHandler);\n    }\n    return view;\n  }\n\n  /**\n   * @return the name of this view manager. This will be the name used to reference this view\n   * manager from JavaScript in createReactNativeComponentClass.\n   */\n  public abstract String getName();\n\n  /**\n   * This method should return a subclass of {@link ReactShadowNode} which will be then used for\n   * measuring position and size of the view. In most of the cases this should just return an\n   * instance of {@link ReactShadowNode}\n   */\n  public C createShadowNodeInstance() {\n    throw new RuntimeException(\"ViewManager subclasses must implement createShadowNodeInstance()\");\n  }\n\n  public C createShadowNodeInstance(ReactApplicationContext context) {\n    return createShadowNodeInstance();\n  }\n\n  /**\n   * This method should return {@link Class} instance that represent type of shadow node that this\n   * manager will return from {@link #createShadowNodeInstance}.\n   *\n   * This method will be used in the bridge initialization phase to collect properties exposed using\n   * {@link ReactProp} (or {@link ReactPropGroup}) annotation from the {@link ReactShadowNode}\n   * subclass specific for native view this manager provides.\n   *\n   * @return {@link Class} object that represents type of shadow node used by this view manager.\n   */\n  public abstract Class<? extends C> getShadowNodeClass();\n\n  /**\n   * Subclasses should return a new View instance of the proper type.\n   * @param reactContext\n   */\n  protected abstract T createViewInstance(ThemedReactContext reactContext);\n\n  /**\n   * Called when view is detached from view hierarchy and allows for some additional cleanup by\n   * the {@link ViewManager} subclass.\n   */\n  public void onDropViewInstance(T view) {\n  }\n\n  /**\n   * Subclasses can override this method to install custom event emitters on the given View. You\n   * might want to override this method if your view needs to emit events besides basic touch events\n   * to JS (e.g. scroll events).\n   */\n  protected void addEventEmitters(ThemedReactContext reactContext, T view) {\n  }\n\n  /**\n   * Callback that will be triggered after all properties are updated in current update transaction\n   * (all @ReactProp handlers for properties updated in current transaction have been called). If\n   * you want to override this method you should call super.onAfterUpdateTransaction from it as\n   * the parent class of the ViewManager may rely on callback being executed.\n   */\n  protected void onAfterUpdateTransaction(T view) {\n  }\n\n  /**\n   * Subclasses can implement this method to receive an optional extra data enqueued from the\n   * corresponding instance of {@link ReactShadowNode} in\n   * {@link ReactShadowNode#onCollectExtraUpdates}.\n   *\n   * Since css layout step and ui updates can be executed in separate thread apart of setting\n   * x/y/width/height this is the recommended and thread-safe way of passing extra data from css\n   * node to the native view counterpart.\n   *\n   * TODO(7247021): Replace updateExtraData with generic update props mechanism after D2086999\n   */\n  public abstract void updateExtraData(T root, Object extraData);\n\n  /**\n   * Subclasses may use this method to receive events/commands directly from JS through the\n   * {@link UIManager}. Good example of such a command would be {@code scrollTo} request with\n   * coordinates for a {@link ScrollView} or {@code goBack} request for a {@link WebView} instance.\n   *\n   * @param root View instance that should receive the command\n   * @param commandId code of the command\n   * @param args optional arguments for the command\n   */\n  public void receiveCommand(T root, int commandId, @Nullable ReadableArray args) {\n  }\n\n  /**\n   * Subclasses of {@link ViewManager} that expect to receive commands through\n   * {@link UIManagerModule#dispatchViewManagerCommand} should override this method returning the\n   * map between names of the commands and IDs that are then used in {@link #receiveCommand} method\n   * whenever the command is dispatched for this particular {@link ViewManager}.\n   *\n   * As an example we may consider {@link ReactWebViewManager} that expose the following commands:\n   * goBack, goForward, reload. In this case the map returned from {@link #getCommandsMap} from\n   * {@link ReactWebViewManager} will look as follows:\n   * {\n   *   \"goBack\": 1,\n   *   \"goForward\": 2,\n   *   \"reload\": 3,\n   * }\n   *\n   * Now assuming that \"reload\" command is dispatched through {@link UIManagerModule} we trigger\n   * {@link ReactWebViewManager#receiveCommand} passing \"3\" as {@code commandId} argument.\n   *\n   * @return map of string to int mapping of the expected commands\n   */\n  public @Nullable Map<String, Integer> getCommandsMap() {\n    return null;\n  }\n\n  /**\n   * Returns a map of config data passed to JS that defines eligible events that can be placed on\n   * native views. This should return bubbling directly-dispatched event types and specify what\n   * names should be used to subscribe to either form (bubbling/capturing).\n   *\n   * Returned map should be of the form:\n   * {\n   *   \"onTwirl\": {\n   *     \"phasedRegistrationNames\": {\n   *       \"bubbled\": \"onTwirl\",\n   *       \"captured\": \"onTwirlCaptured\"\n   *     }\n   *   }\n   * }\n   */\n  public @Nullable Map<String, Object> getExportedCustomBubblingEventTypeConstants() {\n    return null;\n  }\n\n  /**\n   * Returns a map of config data passed to JS that defines eligible events that can be placed on\n   * native views. This should return non-bubbling directly-dispatched event types.\n   *\n   * Returned map should be of the form:\n   * {\n   *   \"onTwirl\": {\n   *     \"registrationName\": \"onTwirl\"\n   *   }\n   * }\n   */\n  public @Nullable Map<String, Object> getExportedCustomDirectEventTypeConstants() {\n    return null;\n  }\n\n  /**\n   * Returns a map of view-specific constants that are injected to JavaScript. These constants are\n   * made accessible via UIManager.<ViewName>.Constants.\n   */\n  public @Nullable Map<String, Object> getExportedViewConstants() {\n    return null;\n  }\n\n  public Map<String, String> getNativeProps() {\n    return ViewManagerPropertyUpdater.getNativeProps(getClass(), getShadowNodeClass());\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerPropertyUpdater.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport android.view.View;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.ReadableMapKeySetIterator;\n\npublic class ViewManagerPropertyUpdater {\n  public interface Settable {\n     void getProperties(Map<String, String> props);\n  }\n\n  public interface ViewManagerSetter<T extends ViewManager, V extends View> extends Settable {\n    void setProperty(T manager, V view, String name, ReactStylesDiffMap props);\n  }\n\n  public interface ShadowNodeSetter<T extends ReactShadowNode> extends Settable {\n    void setProperty(T node, String name, ReactStylesDiffMap props);\n  }\n\n  private static final String TAG = \"ViewManagerPropertyUpdater\";\n\n  private static final Map<Class<?>, ViewManagerSetter<?, ?>> VIEW_MANAGER_SETTER_MAP =\n      new HashMap<>();\n  private static final Map<Class<?>, ShadowNodeSetter<?>> SHADOW_NODE_SETTER_MAP = new HashMap<>();\n\n  public static void clear() {\n    ViewManagersPropertyCache.clear();\n    VIEW_MANAGER_SETTER_MAP.clear();\n    SHADOW_NODE_SETTER_MAP.clear();\n  }\n\n  public static <T extends ViewManager, V extends View> void updateProps(\n      T manager,\n      V v,\n      ReactStylesDiffMap props) {\n    ViewManagerSetter<T, V> setter = findManagerSetter(manager.getClass());\n    ReadableMap propMap = props.mBackingMap;\n    ReadableMapKeySetIterator iterator = propMap.keySetIterator();\n    while (iterator.hasNextKey()) {\n      String key = iterator.nextKey();\n      setter.setProperty(manager, v, key, props);\n    }\n  }\n\n  public static <T extends ReactShadowNode> void updateProps(T node, ReactStylesDiffMap props) {\n    ShadowNodeSetter<T> setter = findNodeSetter(node.getClass());\n    ReadableMap propMap = props.mBackingMap;\n    ReadableMapKeySetIterator iterator = propMap.keySetIterator();\n    while (iterator.hasNextKey()) {\n      String key = iterator.nextKey();\n      setter.setProperty(node, key, props);\n    }\n  }\n\n  public static Map<String, String> getNativeProps(\n      Class<? extends ViewManager> viewManagerTopClass,\n      Class<? extends ReactShadowNode> shadowNodeTopClass) {\n    Map<String, String> props = new HashMap<>();\n    findManagerSetter(viewManagerTopClass).getProperties(props);\n    findNodeSetter(shadowNodeTopClass).getProperties(props);\n    return props;\n  }\n\n  private static <T extends ViewManager, V extends View> ViewManagerSetter<T, V> findManagerSetter(\n      Class<? extends ViewManager> managerClass) {\n    @SuppressWarnings(\"unchecked\")\n    ViewManagerSetter<T, V> setter =\n        (ViewManagerSetter<T, V>) VIEW_MANAGER_SETTER_MAP.get(managerClass);\n    if (setter == null) {\n      setter = findGeneratedSetter(managerClass);\n      if (setter == null) {\n        setter = new FallbackViewManagerSetter<>(managerClass);\n      }\n      VIEW_MANAGER_SETTER_MAP.put(managerClass, setter);\n    }\n\n    return setter;\n  }\n\n  private static <T extends ReactShadowNode> ShadowNodeSetter<T> findNodeSetter(\n      Class<? extends ReactShadowNode> nodeClass) {\n    @SuppressWarnings(\"unchecked\")\n    ShadowNodeSetter<T> setter = (ShadowNodeSetter<T>) SHADOW_NODE_SETTER_MAP.get(nodeClass);\n    if (setter == null) {\n      setter = findGeneratedSetter(nodeClass);\n      if (setter == null) {\n        setter = new FallbackShadowNodeSetter<>(nodeClass);\n      }\n      SHADOW_NODE_SETTER_MAP.put(nodeClass, setter);\n    }\n\n    return setter;\n  }\n\n  private static <T> T findGeneratedSetter(Class<?> cls) {\n    String clsName = cls.getName();\n    try {\n      Class<?> setterClass = Class.forName(clsName + \"$$PropsSetter\");\n      //noinspection unchecked\n      return (T) setterClass.newInstance();\n    } catch (ClassNotFoundException e) {\n      FLog.w(TAG, \"Could not find generated setter for \" + cls);\n      return null;\n    } catch (InstantiationException | IllegalAccessException e) {\n      throw new RuntimeException(\"Unable to instantiate methods getter for \" + clsName, e);\n    }\n  }\n\n  private static class FallbackViewManagerSetter<T extends ViewManager, V extends View>\n      implements ViewManagerSetter<T, V> {\n    private final Map<String, ViewManagersPropertyCache.PropSetter> mPropSetters;\n\n    private FallbackViewManagerSetter(Class<? extends ViewManager> viewManagerClass) {\n      mPropSetters =\n          ViewManagersPropertyCache.getNativePropSettersForViewManagerClass(viewManagerClass);\n    }\n\n    @Override\n    public void setProperty(T manager, V v, String name, ReactStylesDiffMap props) {\n      ViewManagersPropertyCache.PropSetter setter = mPropSetters.get(name);\n      if (setter != null) {\n        setter.updateViewProp(manager, v, props);\n      }\n    }\n\n    @Override\n    public void getProperties(Map<String, String> props) {\n      for (ViewManagersPropertyCache.PropSetter setter : mPropSetters.values()) {\n        props.put(setter.getPropName(), setter.getPropType());\n      }\n    }\n  }\n\n  private static class FallbackShadowNodeSetter<T extends ReactShadowNode>\n      implements ShadowNodeSetter<T> {\n    private final Map<String, ViewManagersPropertyCache.PropSetter> mPropSetters;\n\n    private FallbackShadowNodeSetter(Class<? extends ReactShadowNode> shadowNodeClass) {\n      mPropSetters =\n          ViewManagersPropertyCache.getNativePropSettersForShadowNodeClass(shadowNodeClass);\n    }\n\n    @Override\n    public void setProperty(ReactShadowNode node, String name, ReactStylesDiffMap props) {\n      ViewManagersPropertyCache.PropSetter setter = mPropSetters.get(name);\n      if (setter != null) {\n        setter.updateShadowNodeProp(node, props);\n      }\n    }\n\n    @Override\n    public void getProperties(Map<String, String> props) {\n      for (ViewManagersPropertyCache.PropSetter setter : mPropSetters.values()) {\n        props.put(setter.getPropName(), setter.getPropType());\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerRegistry.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport com.facebook.react.common.MapBuilder;\nimport java.util.List;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * Class that stores the mapping between native view name used in JS and the corresponding instance\n * of {@link ViewManager}.\n */\npublic final class ViewManagerRegistry {\n\n  private final Map<String, ViewManager> mViewManagers;\n  private final @Nullable UIManagerModule.ViewManagerResolver mViewManagerResolver;\n\n  public ViewManagerRegistry(UIManagerModule.ViewManagerResolver viewManagerResolver) {\n    mViewManagers = MapBuilder.newHashMap();\n    mViewManagerResolver = viewManagerResolver;\n  }\n\n  public ViewManagerRegistry(List<ViewManager> viewManagerList) {\n    Map<String, ViewManager> viewManagerMap = MapBuilder.newHashMap();\n    for (ViewManager viewManager : viewManagerList) {\n      viewManagerMap.put(viewManager.getName(), viewManager);\n    }\n\n    mViewManagers = viewManagerMap;\n    mViewManagerResolver = null;\n  }\n\n  public ViewManagerRegistry(Map<String, ViewManager> viewManagerMap) {\n    mViewManagers =\n        viewManagerMap != null ? viewManagerMap : MapBuilder.<String, ViewManager>newHashMap();\n    mViewManagerResolver = null;\n  }\n\n  public ViewManager get(String className) {\n    ViewManager viewManager = mViewManagers.get(className);\n    if (viewManager != null) {\n      return viewManager;\n    }\n    if (mViewManagerResolver != null) {\n      viewManager = mViewManagerResolver.getViewManager(className);\n      if (viewManager != null) {\n        mViewManagers.put(className, viewManager);\n        return viewManager;\n      }\n    }\n    throw new IllegalViewOperationException(\"No ViewManager defined for class \" + className);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager;\n\nimport android.view.View;\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.Dynamic;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport java.lang.reflect.Method;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * This class is responsible for holding view manager property setters and is used in a process of\n * updating views with the new properties set in JS.\n */\n/*package*/ class ViewManagersPropertyCache {\n\n  private static final Map<Class, Map<String, PropSetter>> CLASS_PROPS_CACHE = new HashMap<>();\n  private static final Map<String, PropSetter> EMPTY_PROPS_MAP = new HashMap<>();\n\n  public static void clear() {\n    CLASS_PROPS_CACHE.clear();\n    EMPTY_PROPS_MAP.clear();\n  }\n\n  /*package*/ static abstract class PropSetter {\n\n    protected final String mPropName;\n    protected final String mPropType;\n    protected final Method mSetter;\n    protected final @Nullable Integer mIndex; /* non-null only for group setters */\n\n    // The following Object arrays are used to prevent extra allocations from varargs when we call\n    // Method.invoke. It's safe for those objects to be static as we update properties in a single\n    // thread sequentially\n    private static final Object[] VIEW_MGR_ARGS = new Object[2];\n    private static final Object[] VIEW_MGR_GROUP_ARGS = new Object[3];\n    private static final Object[] SHADOW_ARGS = new Object[1];\n    private static final Object[] SHADOW_GROUP_ARGS = new Object[2];\n\n    private PropSetter(ReactProp prop, String defaultType, Method setter) {\n      mPropName = prop.name();\n      mPropType = ReactProp.USE_DEFAULT_TYPE.equals(prop.customType()) ?\n          defaultType : prop.customType();\n      mSetter = setter;\n      mIndex = null;\n    }\n\n    private PropSetter(ReactPropGroup prop, String defaultType, Method setter, int index) {\n      mPropName = prop.names()[index];\n      mPropType = ReactPropGroup.USE_DEFAULT_TYPE.equals(prop.customType()) ?\n          defaultType : prop.customType();\n      mSetter = setter;\n      mIndex = index;\n    }\n\n    public String getPropName() {\n      return mPropName;\n    }\n\n    public String getPropType() {\n      return mPropType;\n    }\n\n    public void updateViewProp(\n        ViewManager viewManager,\n        View viewToUpdate,\n        ReactStylesDiffMap props) {\n      try {\n        if (mIndex == null) {\n          VIEW_MGR_ARGS[0] = viewToUpdate;\n          VIEW_MGR_ARGS[1] = extractProperty(props);\n          mSetter.invoke(viewManager, VIEW_MGR_ARGS);\n          Arrays.fill(VIEW_MGR_ARGS, null);\n        } else {\n          VIEW_MGR_GROUP_ARGS[0] = viewToUpdate;\n          VIEW_MGR_GROUP_ARGS[1] = mIndex;\n          VIEW_MGR_GROUP_ARGS[2] = extractProperty(props);\n          mSetter.invoke(viewManager, VIEW_MGR_GROUP_ARGS);\n          Arrays.fill(VIEW_MGR_GROUP_ARGS, null);\n        }\n      } catch (Throwable t) {\n        FLog.e(ViewManager.class, \"Error while updating prop \" + mPropName, t);\n        throw new JSApplicationIllegalArgumentException(\"Error while updating property '\" +\n            mPropName + \"' of a view managed by: \" + viewManager.getName(), t);\n      }\n    }\n\n    public void updateShadowNodeProp(\n        ReactShadowNode nodeToUpdate,\n        ReactStylesDiffMap props) {\n      try {\n        if (mIndex == null) {\n          SHADOW_ARGS[0] = extractProperty(props);\n          mSetter.invoke(nodeToUpdate, SHADOW_ARGS);\n          Arrays.fill(SHADOW_ARGS, null);\n        } else {\n          SHADOW_GROUP_ARGS[0] = mIndex;\n          SHADOW_GROUP_ARGS[1] = extractProperty(props);\n          mSetter.invoke(nodeToUpdate, SHADOW_GROUP_ARGS);\n          Arrays.fill(SHADOW_GROUP_ARGS, null);\n        }\n      } catch (Throwable t) {\n        FLog.e(ViewManager.class, \"Error while updating prop \" + mPropName, t);\n        throw new JSApplicationIllegalArgumentException(\"Error while updating property '\" +\n            mPropName + \"' in shadow node of type: \" + nodeToUpdate.getViewClass(), t);\n      }\n    }\n\n    protected abstract @Nullable Object extractProperty(ReactStylesDiffMap props);\n  }\n\n  private static class DynamicPropSetter extends PropSetter {\n\n    public DynamicPropSetter(ReactProp prop, Method setter) {\n      super(prop, \"mixed\", setter);\n    }\n\n    public DynamicPropSetter(ReactPropGroup prop, Method setter, int index) {\n      super(prop, \"mixed\", setter, index);\n    }\n\n    @Override\n    protected Object extractProperty(ReactStylesDiffMap props) {\n      return props.getDynamic(mPropName);\n    }\n  }\n\n  private static class IntPropSetter extends PropSetter {\n\n    private final int mDefaultValue;\n\n    public IntPropSetter(ReactProp prop, Method setter, int defaultValue) {\n      super(prop, \"number\", setter);\n      mDefaultValue = defaultValue;\n    }\n\n    public IntPropSetter(ReactPropGroup prop, Method setter, int index, int defaultValue) {\n      super(prop, \"number\", setter, index);\n      mDefaultValue = defaultValue;\n    }\n\n    @Override\n    protected Object extractProperty(ReactStylesDiffMap props) {\n      return props.getInt(mPropName, mDefaultValue);\n    }\n  }\n\n  private static class DoublePropSetter extends PropSetter {\n\n    private final double mDefaultValue;\n\n    public DoublePropSetter(ReactProp prop, Method setter, double defaultValue) {\n      super(prop, \"number\", setter);\n      mDefaultValue = defaultValue;\n    }\n\n    public DoublePropSetter(ReactPropGroup prop, Method setter, int index, double defaultValue) {\n      super(prop, \"number\", setter, index);\n      mDefaultValue = defaultValue;\n    }\n\n    @Override\n    protected Object extractProperty(ReactStylesDiffMap props) {\n      return props.getDouble(mPropName, mDefaultValue);\n    }\n  }\n\n  private static class BooleanPropSetter extends PropSetter {\n\n    private final boolean mDefaultValue;\n\n    public BooleanPropSetter(ReactProp prop, Method setter, boolean defaultValue) {\n      super(prop, \"boolean\", setter);\n      mDefaultValue = defaultValue;\n    }\n\n    @Override\n    protected Object extractProperty(ReactStylesDiffMap props) {\n      return props.getBoolean(mPropName, mDefaultValue) ? Boolean.TRUE : Boolean.FALSE;\n    }\n  }\n\n  private static class FloatPropSetter extends PropSetter {\n\n    private final float mDefaultValue;\n\n    public FloatPropSetter(ReactProp prop, Method setter, float defaultValue) {\n      super(prop, \"number\", setter);\n      mDefaultValue = defaultValue;\n    }\n\n    public FloatPropSetter(ReactPropGroup prop, Method setter, int index, float defaultValue) {\n      super(prop, \"number\", setter, index);\n      mDefaultValue = defaultValue;\n    }\n\n    @Override\n    protected Object extractProperty(ReactStylesDiffMap props) {\n      return props.getFloat(mPropName, mDefaultValue);\n    }\n  }\n\n  private static class ArrayPropSetter extends PropSetter {\n\n    public ArrayPropSetter(ReactProp prop, Method setter) {\n      super(prop, \"Array\", setter);\n    }\n\n    @Override\n    protected @Nullable Object extractProperty(ReactStylesDiffMap props) {\n      return props.getArray(mPropName);\n    }\n  }\n\n  private static class MapPropSetter extends PropSetter {\n\n    public MapPropSetter(ReactProp prop, Method setter) {\n      super(prop, \"Map\", setter);\n    }\n\n    @Override\n    protected @Nullable Object extractProperty(ReactStylesDiffMap props) {\n      return props.getMap(mPropName);\n    }\n  }\n\n  private static class StringPropSetter extends PropSetter {\n\n    public StringPropSetter(ReactProp prop, Method setter) {\n      super(prop, \"String\", setter);\n    }\n\n    @Override\n    protected @Nullable Object extractProperty(ReactStylesDiffMap props) {\n      return props.getString(mPropName);\n    }\n  }\n\n  private static class BoxedBooleanPropSetter extends PropSetter {\n\n    public BoxedBooleanPropSetter(ReactProp prop, Method setter) {\n      super(prop, \"boolean\", setter);\n    }\n\n    @Override\n    protected @Nullable Object extractProperty(ReactStylesDiffMap props) {\n      if (!props.isNull(mPropName)) {\n        return props.getBoolean(mPropName, /* ignored */ false) ? Boolean.TRUE : Boolean.FALSE;\n      }\n      return null;\n    }\n  }\n\n  private static class BoxedIntPropSetter extends PropSetter {\n\n    public BoxedIntPropSetter(ReactProp prop, Method setter) {\n      super(prop, \"number\", setter);\n    }\n\n    public BoxedIntPropSetter(ReactPropGroup prop, Method setter, int index) {\n      super(prop, \"number\", setter, index);\n    }\n\n    @Override\n    protected @Nullable Object extractProperty(ReactStylesDiffMap props) {\n      if (!props.isNull(mPropName)) {\n        return props.getInt(mPropName, /* ignored */ 0);\n      }\n      return null;\n    }\n  }\n\n  /*package*/ static Map<String, String> getNativePropsForView(\n      Class<? extends ViewManager> viewManagerTopClass,\n      Class<? extends ReactShadowNode> shadowNodeTopClass) {\n    Map<String, String> nativeProps = new HashMap<>();\n\n    Map<String, PropSetter> viewManagerProps =\n        getNativePropSettersForViewManagerClass(viewManagerTopClass);\n    for (PropSetter setter : viewManagerProps.values()) {\n      nativeProps.put(setter.getPropName(), setter.getPropType());\n    }\n\n    Map<String, PropSetter> shadowNodeProps =\n        getNativePropSettersForShadowNodeClass(shadowNodeTopClass);\n    for (PropSetter setter : shadowNodeProps.values()) {\n      nativeProps.put(setter.getPropName(), setter.getPropType());\n    }\n\n    return nativeProps;\n  }\n\n  /**\n   * Returns map from property name to setter instances for all the property setters annotated with\n   * {@link ReactProp} in the given {@link ViewManager} class plus all the setter declared by its\n   * parent classes.\n   */\n  /*package*/ static Map<String, PropSetter> getNativePropSettersForViewManagerClass(\n      Class<? extends ViewManager> cls) {\n    if (cls == ViewManager.class) {\n      return EMPTY_PROPS_MAP;\n    }\n    Map<String, PropSetter> props = CLASS_PROPS_CACHE.get(cls);\n    if (props != null) {\n      return props;\n    }\n    // This is to include all the setters from parent classes. Once calculated the result will be\n    // stored in CLASS_PROPS_CACHE so that we only scan for @ReactProp annotations once per class.\n    props = new HashMap<>(\n        getNativePropSettersForViewManagerClass(\n            (Class<? extends ViewManager>) cls.getSuperclass()));\n    extractPropSettersFromViewManagerClassDefinition(cls, props);\n    CLASS_PROPS_CACHE.put(cls, props);\n    return props;\n  }\n\n  /**\n   * Returns map from property name to setter instances for all the property setters annotated with\n   * {@link ReactProp} (or {@link ReactPropGroup} in the given {@link ReactShadowNode} subclass plus\n   * all the setters declared by its parent classes up to {@link ReactShadowNode} which is treated\n   * as a base class.\n   */\n  /*package*/ static Map<String, PropSetter> getNativePropSettersForShadowNodeClass(\n      Class<? extends ReactShadowNode> cls) {\n    for (Class iface : cls.getInterfaces()) {\n      if (iface == ReactShadowNode.class) {\n        return EMPTY_PROPS_MAP;\n      }\n    }\n    Map<String, PropSetter> props = CLASS_PROPS_CACHE.get(cls);\n    if (props != null) {\n      return props;\n    }\n    // This is to include all the setters from parent classes up to ReactShadowNode class\n    props = new HashMap<>(\n        getNativePropSettersForShadowNodeClass(\n            (Class<? extends ReactShadowNode>) cls.getSuperclass()));\n    extractPropSettersFromShadowNodeClassDefinition(cls, props);\n    CLASS_PROPS_CACHE.put(cls, props);\n    return props;\n  }\n\n  private static PropSetter createPropSetter(\n      ReactProp annotation,\n      Method method,\n      Class<?> propTypeClass) {\n    if (propTypeClass == Dynamic.class) {\n      return new DynamicPropSetter(annotation, method);\n    } else if (propTypeClass == boolean.class) {\n      return new BooleanPropSetter(annotation, method, annotation.defaultBoolean());\n    } else if (propTypeClass == int.class) {\n      return new IntPropSetter(annotation, method, annotation.defaultInt());\n    } else if (propTypeClass == float.class) {\n      return new FloatPropSetter(annotation, method, annotation.defaultFloat());\n    } else if (propTypeClass == double.class) {\n      return new DoublePropSetter(annotation, method, annotation.defaultDouble());\n    } else if (propTypeClass == String.class) {\n      return new StringPropSetter(annotation, method);\n    } else if (propTypeClass == Boolean.class) {\n      return new BoxedBooleanPropSetter(annotation, method);\n    } else if (propTypeClass == Integer.class) {\n      return new BoxedIntPropSetter(annotation, method);\n    } else if (propTypeClass == ReadableArray.class) {\n      return new ArrayPropSetter(annotation, method);\n    } else if (propTypeClass == ReadableMap.class) {\n      return new MapPropSetter(annotation, method);\n    } else {\n      throw new RuntimeException(\"Unrecognized type: \" + propTypeClass + \" for method: \" +\n          method.getDeclaringClass().getName() + \"#\" + method.getName());\n    }\n  }\n\n  private static void createPropSetters(\n      ReactPropGroup annotation,\n      Method method,\n      Class<?> propTypeClass,\n      Map<String, PropSetter> props) {\n    String[] names = annotation.names();\n    if (propTypeClass == Dynamic.class) {\n      for (int i = 0; i < names.length; i++) {\n        props.put(\n            names[i],\n            new DynamicPropSetter(annotation, method, i));\n      }\n    } else if (propTypeClass == int.class) {\n      for (int i = 0; i < names.length; i++) {\n        props.put(\n            names[i],\n            new IntPropSetter(annotation, method, i, annotation.defaultInt()));\n      }\n    } else if (propTypeClass == float.class) {\n      for (int i = 0; i < names.length; i++) {\n        props.put(\n            names[i],\n            new FloatPropSetter(annotation, method, i, annotation.defaultFloat()));\n      }\n    } else if (propTypeClass == double.class) {\n      for (int i = 0; i < names.length; i++) {\n        props.put(\n            names[i],\n            new DoublePropSetter(annotation, method, i, annotation.defaultDouble()));\n      }\n    } else if (propTypeClass == Integer.class) {\n      for (int i = 0; i < names.length; i++) {\n        props.put(\n            names[i],\n            new BoxedIntPropSetter(annotation, method, i));\n      }\n    } else {\n      throw new RuntimeException(\"Unrecognized type: \" + propTypeClass + \" for method: \" +\n          method.getDeclaringClass().getName() + \"#\" + method.getName());\n    }\n  }\n\n  private static void extractPropSettersFromViewManagerClassDefinition(\n      Class<? extends ViewManager> cls,\n      Map<String, PropSetter> props) {\n    Method[] declaredMethods = cls.getDeclaredMethods();\n    for (int i = 0; i < declaredMethods.length; i++) {\n      Method method = declaredMethods[i];\n      ReactProp annotation = method.getAnnotation(ReactProp.class);\n      if (annotation != null) {\n        Class<?>[] paramTypes = method.getParameterTypes();\n        if (paramTypes.length != 2) {\n          throw new RuntimeException(\"Wrong number of args for prop setter: \" +\n              cls.getName() + \"#\" + method.getName());\n        }\n        if (!View.class.isAssignableFrom(paramTypes[0])) {\n          throw new RuntimeException(\"First param should be a view subclass to be updated: \" +\n              cls.getName() + \"#\" + method.getName());\n        }\n        props.put(annotation.name(), createPropSetter(annotation, method, paramTypes[1]));\n      }\n\n      ReactPropGroup groupAnnotation = method.getAnnotation(ReactPropGroup.class);\n      if (groupAnnotation != null) {\n        Class<?> [] paramTypes = method.getParameterTypes();\n        if (paramTypes.length != 3) {\n          throw new RuntimeException(\"Wrong number of args for group prop setter: \" +\n              cls.getName() + \"#\" + method.getName());\n        }\n        if (!View.class.isAssignableFrom(paramTypes[0])) {\n          throw new RuntimeException(\"First param should be a view subclass to be updated: \" +\n              cls.getName() + \"#\" + method.getName());\n        }\n        if (paramTypes[1] != int.class) {\n          throw new RuntimeException(\"Second argument should be property index: \" +\n              cls.getName() + \"#\" + method.getName());\n        }\n        createPropSetters(groupAnnotation, method, paramTypes[2], props);\n      }\n    }\n  }\n\n  private static void extractPropSettersFromShadowNodeClassDefinition(\n      Class<? extends ReactShadowNode> cls,\n      Map<String, PropSetter> props) {\n    for (Method method : cls.getDeclaredMethods()) {\n      ReactProp annotation = method.getAnnotation(ReactProp.class);\n      if (annotation != null) {\n        Class<?>[] paramTypes = method.getParameterTypes();\n        if (paramTypes.length != 1) {\n          throw new RuntimeException(\"Wrong number of args for prop setter: \" +\n              cls.getName() + \"#\" + method.getName());\n        }\n        props.put(annotation.name(), createPropSetter(annotation, method, paramTypes[0]));\n      }\n\n      ReactPropGroup groupAnnotation = method.getAnnotation(ReactPropGroup.class);\n      if (groupAnnotation != null) {\n        Class<?> [] paramTypes = method.getParameterTypes();\n        if (paramTypes.length != 2) {\n          throw new RuntimeException(\"Wrong number of args for group prop setter: \" +\n              cls.getName() + \"#\" + method.getName());\n        }\n        if (paramTypes[0] != int.class) {\n          throw new RuntimeException(\"Second argument should be property index: \" +\n              cls.getName() + \"#\" + method.getName());\n        }\n        createPropSetters(groupAnnotation, method, paramTypes[1], props);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.graphics.Color;\nimport com.facebook.react.bridge.ReadableMap;\nimport java.util.Arrays;\nimport java.util.HashSet;\n\n/**\n * Keys for props that need to be shared across multiple classes.\n */\npublic class ViewProps {\n\n  public static final String VIEW_CLASS_NAME = \"RCTView\";\n\n  // Layout only (only affect positions of children, causes no drawing)\n  // !!! Keep in sync with LAYOUT_ONLY_PROPS below\n  public static final String ALIGN_ITEMS = \"alignItems\";\n  public static final String ALIGN_SELF = \"alignSelf\";\n  public static final String ALIGN_CONTENT = \"alignContent\";\n  public static final String OVERFLOW = \"overflow\";\n  public static final String DISPLAY = \"display\";\n  public static final String BOTTOM = \"bottom\";\n  public static final String COLLAPSABLE = \"collapsable\";\n  public static final String FLEX = \"flex\";\n  public static final String FLEX_GROW = \"flexGrow\";\n  public static final String FLEX_SHRINK = \"flexShrink\";\n  public static final String FLEX_BASIS = \"flexBasis\";\n  public static final String FLEX_DIRECTION = \"flexDirection\";\n  public static final String FLEX_WRAP = \"flexWrap\";\n  public static final String HEIGHT = \"height\";\n  public static final String JUSTIFY_CONTENT = \"justifyContent\";\n  public static final String LEFT = \"left\";\n\n  public static final String MARGIN = \"margin\";\n  public static final String MARGIN_VERTICAL = \"marginVertical\";\n  public static final String MARGIN_HORIZONTAL = \"marginHorizontal\";\n  public static final String MARGIN_LEFT = \"marginLeft\";\n  public static final String MARGIN_RIGHT = \"marginRight\";\n  public static final String MARGIN_TOP = \"marginTop\";\n  public static final String MARGIN_BOTTOM = \"marginBottom\";\n  public static final String MARGIN_START = \"marginStart\";\n  public static final String MARGIN_END = \"marginEnd\";\n\n  public static final String PADDING = \"padding\";\n  public static final String PADDING_VERTICAL = \"paddingVertical\";\n  public static final String PADDING_HORIZONTAL = \"paddingHorizontal\";\n  public static final String PADDING_LEFT = \"paddingLeft\";\n  public static final String PADDING_RIGHT = \"paddingRight\";\n  public static final String PADDING_TOP = \"paddingTop\";\n  public static final String PADDING_BOTTOM = \"paddingBottom\";\n  public static final String PADDING_START = \"paddingStart\";\n  public static final String PADDING_END = \"paddingEnd\";\n\n  public static final String POSITION = \"position\";\n  public static final String RIGHT = \"right\";\n  public static final String TOP = \"top\";\n  public static final String WIDTH = \"width\";\n  public static final String START = \"start\";\n  public static final String END = \"end\";\n\n  public static final String MIN_WIDTH = \"minWidth\";\n  public static final String MAX_WIDTH = \"maxWidth\";\n  public static final String MIN_HEIGHT = \"minHeight\";\n  public static final String MAX_HEIGHT = \"maxHeight\";\n\n  public static final String ASPECT_RATIO = \"aspectRatio\";\n\n  // Props that sometimes may prevent us from collapsing views\n  public static final String POINTER_EVENTS = \"pointerEvents\";\n\n  // Props that affect more than just layout\n  public static final String ENABLED = \"enabled\";\n  public static final String BACKGROUND_COLOR = \"backgroundColor\";\n  public static final String COLOR = \"color\";\n  public static final String FONT_SIZE = \"fontSize\";\n  public static final String FONT_WEIGHT = \"fontWeight\";\n  public static final String FONT_STYLE = \"fontStyle\";\n  public static final String FONT_FAMILY = \"fontFamily\";\n  public static final String LINE_HEIGHT = \"lineHeight\";\n  public static final String NEEDS_OFFSCREEN_ALPHA_COMPOSITING = \"needsOffscreenAlphaCompositing\";\n  public static final String NUMBER_OF_LINES = \"numberOfLines\";\n  public static final String ELLIPSIZE_MODE = \"ellipsizeMode\";\n  public static final String ON = \"on\";\n  public static final String RESIZE_MODE = \"resizeMode\";\n  public static final String RESIZE_METHOD = \"resizeMethod\";\n  public static final String TEXT_ALIGN = \"textAlign\";\n  public static final String TEXT_ALIGN_VERTICAL = \"textAlignVertical\";\n  public static final String TEXT_DECORATION_LINE = \"textDecorationLine\";\n  public static final String TEXT_BREAK_STRATEGY = \"textBreakStrategy\";\n  public static final String OPACITY = \"opacity\";\n\n  public static final String ALLOW_FONT_SCALING = \"allowFontScaling\";\n  public static final String INCLUDE_FONT_PADDING = \"includeFontPadding\";\n\n  public static final String BORDER_WIDTH = \"borderWidth\";\n  public static final String BORDER_LEFT_WIDTH = \"borderLeftWidth\";\n  public static final String BORDER_START_WIDTH = \"borderStartWidth\";\n  public static final String BORDER_END_WIDTH = \"borderEndWidth\";\n  public static final String BORDER_TOP_WIDTH = \"borderTopWidth\";\n  public static final String BORDER_RIGHT_WIDTH = \"borderRightWidth\";\n  public static final String BORDER_BOTTOM_WIDTH = \"borderBottomWidth\";\n  public static final String BORDER_RADIUS = \"borderRadius\";\n  public static final String BORDER_TOP_LEFT_RADIUS = \"borderTopLeftRadius\";\n  public static final String BORDER_TOP_RIGHT_RADIUS = \"borderTopRightRadius\";\n  public static final String BORDER_BOTTOM_LEFT_RADIUS = \"borderBottomLeftRadius\";\n  public static final String BORDER_BOTTOM_RIGHT_RADIUS = \"borderBottomRightRadius\";\n  public static final String BORDER_COLOR = \"borderColor\";\n  public static final String BORDER_LEFT_COLOR = \"borderLeftColor\";\n  public static final String BORDER_RIGHT_COLOR = \"borderRightColor\";\n  public static final String BORDER_TOP_COLOR = \"borderTopColor\";\n  public static final String BORDER_BOTTOM_COLOR = \"borderBottomColor\";\n  public static final String BORDER_TOP_START_RADIUS = \"borderTopStartRadius\";\n  public static final String BORDER_TOP_END_RADIUS = \"borderTopEndRadius\";\n  public static final String BORDER_BOTTOM_START_RADIUS = \"borderBottomStartRadius\";\n  public static final String BORDER_BOTTOM_END_RADIUS = \"borderBottomEndRadius\";\n  public static final String BORDER_START_COLOR = \"borderStartColor\";\n  public static final String BORDER_END_COLOR = \"borderEndColor\";\n\n  public static final int[] BORDER_SPACING_TYPES = {\n    Spacing.ALL,\n    Spacing.START,\n    Spacing.END,\n    Spacing.TOP,\n    Spacing.BOTTOM,\n    Spacing.LEFT,\n    Spacing.RIGHT\n  };\n  public static final int[] PADDING_MARGIN_SPACING_TYPES = {\n    Spacing.ALL,\n    Spacing.VERTICAL,\n    Spacing.HORIZONTAL,\n    Spacing.START,\n    Spacing.END,\n    Spacing.TOP,\n    Spacing.BOTTOM,\n    Spacing.LEFT,\n    Spacing.RIGHT,\n  };\n  public static final int[] POSITION_SPACING_TYPES = {\n    Spacing.START, Spacing.END, Spacing.TOP, Spacing.BOTTOM\n  };\n\n  private static final HashSet<String> LAYOUT_ONLY_PROPS =\n      new HashSet<>(\n          Arrays.asList(\n              ALIGN_SELF,\n              ALIGN_ITEMS,\n              COLLAPSABLE,\n              FLEX,\n              FLEX_BASIS,\n              FLEX_DIRECTION,\n              FLEX_GROW,\n              FLEX_SHRINK,\n              FLEX_WRAP,\n              JUSTIFY_CONTENT,\n              OVERFLOW,\n              ALIGN_CONTENT,\n              DISPLAY,\n\n              /* position */\n              POSITION,\n              RIGHT,\n              TOP,\n              BOTTOM,\n              LEFT,\n              START,\n              END,\n\n              /* dimensions */\n              WIDTH,\n              HEIGHT,\n              MIN_WIDTH,\n              MAX_WIDTH,\n              MIN_HEIGHT,\n              MAX_HEIGHT,\n\n              /* margins */\n              MARGIN,\n              MARGIN_VERTICAL,\n              MARGIN_HORIZONTAL,\n              MARGIN_LEFT,\n              MARGIN_RIGHT,\n              MARGIN_TOP,\n              MARGIN_BOTTOM,\n              MARGIN_START,\n              MARGIN_END,\n\n              /* paddings */\n              PADDING,\n              PADDING_VERTICAL,\n              PADDING_HORIZONTAL,\n              PADDING_LEFT,\n              PADDING_RIGHT,\n              PADDING_TOP,\n              PADDING_BOTTOM,\n              PADDING_START,\n              PADDING_END));\n\n\n  public static boolean sIsOptimizationsEnabled;\n\n  public static boolean isLayoutOnly(ReadableMap map, String prop) {\n    if (LAYOUT_ONLY_PROPS.contains(prop)) {\n      return true;\n    } else if (POINTER_EVENTS.equals(prop)) {\n      String value = map.getString(prop);\n      return \"auto\".equals(value) || \"box-none\".equals(value);\n    }\n\n    if (sIsOptimizationsEnabled) {\n      switch (prop) {\n        case OPACITY:\n          return map.getDouble(OPACITY) == 1d; // Ignore if explicitly set to default opacity.\n        case BACKGROUND_COLOR:\n          return map.getInt(BACKGROUND_COLOR) == Color.TRANSPARENT;\n        case BORDER_RADIUS: // Without a background color or border width set, a border won't show.\n          if (map.hasKey(BACKGROUND_COLOR) && map.getInt(BACKGROUND_COLOR) != Color.TRANSPARENT) {\n            return false;\n          }\n          if (map.hasKey(BORDER_WIDTH) && map.getDouble(BORDER_WIDTH) != 0d) {\n            return false;\n          }\n          return true;\n        case BORDER_COLOR:\n          return map.getInt(BORDER_COLOR) == Color.TRANSPARENT;\n        case BORDER_LEFT_COLOR:\n          return map.getInt(BORDER_LEFT_COLOR) == Color.TRANSPARENT;\n        case BORDER_RIGHT_COLOR:\n          return map.getInt(BORDER_RIGHT_COLOR) == Color.TRANSPARENT;\n        case BORDER_TOP_COLOR:\n          return map.getInt(BORDER_TOP_COLOR) == Color.TRANSPARENT;\n        case BORDER_BOTTOM_COLOR:\n          return map.getInt(BORDER_BOTTOM_COLOR) == Color.TRANSPARENT;\n        case BORDER_WIDTH:\n          return map.getDouble(BORDER_WIDTH) == 0d;\n        case BORDER_LEFT_WIDTH:\n          return map.getDouble(BORDER_LEFT_WIDTH) == 0d;\n        case BORDER_TOP_WIDTH:\n          return map.getDouble(BORDER_TOP_WIDTH) == 0d;\n        case BORDER_RIGHT_WIDTH:\n          return map.getDouble(BORDER_RIGHT_WIDTH) == 0d;\n        case BORDER_BOTTOM_WIDTH:\n          return map.getDouble(BORDER_BOTTOM_WIDTH) == 0d;\n        case \"onLayout\":\n          return true;\n        case \"overflow\": // We do nothing with this right now.\n          return true;\n        default:\n          return false;\n      }\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/YogaNodePool.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager;\n\nimport com.facebook.yoga.YogaNode;\nimport com.facebook.react.common.ClearableSynchronizedPool;\n\n/**\n * Static holder for a recycling pool of YogaNodes.\n */\npublic class YogaNodePool {\n\n  private static final Object sInitLock = new Object();\n  private static ClearableSynchronizedPool<YogaNode> sPool;\n\n  public static ClearableSynchronizedPool<YogaNode> get() {\n    if (sPool != null) {\n      return sPool;\n    }\n\n    synchronized (sInitLock) {\n      if (sPool == null) {\n        sPool = new ClearableSynchronizedPool<YogaNode>(1024);\n      }\n      return sPool;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/annotations/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"annotations\",\n    srcs = glob([\"*.java\"]),\n    required_for_source_only_abi = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/annotations/ReactProp.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.annotations;\n\nimport javax.annotation.Nullable;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.Target;\n\nimport static java.lang.annotation.RetentionPolicy.RUNTIME;\n\n/**\n * Use this annotation to annotate properties of native views that should be exposed to JS. This\n * annotation should only be used for setter methods of subclasses of\n * {@link com.facebook.react.uimanager.ViewManager}.\n *\n * Each annotated method should return {@code void} and take exactly two arguments: first being\n * a view instance to be updated and second a value that should be set.\n *\n * Allowed types of values are:\n *  - primitives (int, boolean, double, float)\n *  - {@link String}\n *  - {@link Boolean}\n *  - {@link com.facebook.react.bridge.ReadableArray}\n *  - {@link com.facebook.react.bridge.ReadableMap}\n *\n * When property gets removed from the corresponding component in React, annotated setter will be\n * called with {@code null} in case of non-primitive value type or with a default value in case when\n * the value type is a primitive (use appropriate default field of this annotation to customize\n * default value that is going to be used: {@link #defaultBoolean}, {@link #defaultDouble}, etc.)\n *\n * Since in case of property removal for non-primitive value type setter will be called with value\n * set to {@code null} it's required that value type is annotated with {@link Nullable}.\n *\n * Note: Since boolean property type can be represented both as primitive and wrapped default value\n * set through {@link #defaultBoolean} is only respected for primitive type and for the wrapped type\n * {@code null} will be used as a default.\n */\n@Retention(RUNTIME)\n@Target(ElementType.METHOD)\npublic @interface ReactProp {\n\n  // Used as a default value for \"customType\" property as \"null\" is not allowed. Moreover, when this\n  // const is used in annotation declaration compiler will actually create a copy of it, so\n  // comparing it using \"==\" with this filed doesn't work either. We need to compare using \"equals\"\n  // which means that this value needs to be unique.\n  String USE_DEFAULT_TYPE = \"__default_type__\";\n\n  /**\n   * Name of the property exposed to JS that will be updated using setter method annotated with\n   * the given instance of {@code ReactProp} annotation\n   */\n  String name();\n\n  /**\n   * Type of property that will be send to JS. In most of the cases {@code customType} should not be\n   * set in which case default type will be send to JS based on the type of value argument from the\n   * setter method (e.g. for {@code int}, {@code double} default is \"number\", for\n   * {@code ReadableArray} it's \"Array\"). Custom type may be used when additional processing of the\n   * value needs to be done in JS before sending it over the bridge. A good example of that would be\n   * backgroundColor property, which is expressed as a {@code String} in JS, but we use\n   * {@code processColor} JS module to convert it to {@code int} before sending over the bridge.\n   */\n  @Nullable String customType() default USE_DEFAULT_TYPE;\n\n  /**\n   * Default value for property of type {@code double}. This value will be provided to property\n   * setter method annotated with {@link ReactProp} if property with a given name gets removed\n   * from the component description in JS\n   */\n  double defaultDouble() default 0.0;\n\n  /**\n   * Default value for property of type {@code float}. This value will be provided to property\n   * setter method annotated with {@link ReactProp} if property with a given name gets removed\n   * from the component description in JS\n   */\n  float defaultFloat() default 0.0f;\n\n  /**\n   * Default value for property of type {@code int}. This value will be provided to property\n   * setter method annotated with {@link ReactProp} if property with a given name gets removed\n   * from the component description in JS\n   */\n  int defaultInt() default 0;\n\n  /**\n   * Default value for property of type {@code boolean}. This value will be provided to property\n   * setter method annotated with {@link ReactProp} if property with a given name gets removed\n   * from the component description in JS\n   */\n  boolean defaultBoolean() default false;\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/events/ContentSizeChangeEvent.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.events;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.PixelUtil;\n\n/**\n * Event dispatched when total width or height of a view's children changes\n */\npublic class ContentSizeChangeEvent extends Event<ContentSizeChangeEvent> {\n\n  public static final String EVENT_NAME = \"topContentSizeChange\";\n\n  private final int mWidth;\n  private final int mHeight;\n\n  public ContentSizeChangeEvent(int viewTag, int width, int height) {\n    super(viewTag);\n    mWidth = width;\n    mHeight = height;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    WritableMap data = Arguments.createMap();\n    data.putDouble(\"width\", PixelUtil.toDIPFromPixel(mWidth));\n    data.putDouble(\"height\", PixelUtil.toDIPFromPixel(mHeight));\n    rctEventEmitter.receiveEvent(getViewTag(), EVENT_NAME, data);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager.events;\n\nimport com.facebook.react.common.SystemClock;\n\n/**\n * A UI event that can be dispatched to JS.\n *\n * For dispatching events {@link EventDispatcher#dispatchEvent} should be used. Once event object\n * is passed to the EventDispatched it should no longer be used as EventDispatcher may decide\n * to recycle that object (by calling {@link #dispose}).\n */\npublic abstract class Event<T extends Event> {\n\n  private static int sUniqueID = 0;\n\n  private boolean mInitialized;\n  private int mViewTag;\n  private long mTimestampMs;\n  private int mUniqueID = sUniqueID++;\n\n  protected Event() {\n  }\n\n  protected Event(int viewTag) {\n    init(viewTag);\n  }\n\n  /**\n   * This method needs to be called before event is sent to event dispatcher.\n   */\n  protected void init(int viewTag) {\n    mViewTag = viewTag;\n    mTimestampMs = SystemClock.uptimeMillis();\n    mInitialized = true;\n  }\n\n  /**\n   * @return the view id for the view that generated this event\n   */\n  public final int getViewTag() {\n    return mViewTag;\n  }\n\n  /**\n   * @return the time at which the event happened in the {@link android.os.SystemClock#uptimeMillis}\n   * base.\n   */\n  public final long getTimestampMs() {\n    return mTimestampMs;\n  }\n\n  /**\n   * @return false if this Event can *never* be coalesced\n   */\n  public boolean canCoalesce() {\n    return true;\n  }\n\n  /**\n   * Given two events, coalesce them into a single event that will be sent to JS instead of two\n   * separate events. By default, just chooses the one the is more recent, or {@code this} if timestamps are the same.\n   *\n   * Two events will only ever try to be coalesced if they have the same event name, view id, and\n   * coalescing key.\n   */\n  public T coalesce(T otherEvent) {\n    return (T) (getTimestampMs() >= otherEvent.getTimestampMs() ? this : otherEvent);\n  }\n\n  /**\n   * @return a key used to determine which other events of this type this event can be coalesced\n   * with. For example, touch move events should only be coalesced within a single gesture so a\n   * coalescing key there would be the unique gesture id.\n   */\n  public short getCoalescingKey() {\n    return 0;\n  }\n\n  /**\n   * @return The unique id of this event.\n   */\n  public int getUniqueID() {\n    return mUniqueID;\n  }\n\n  /**\n   * Called when the EventDispatcher is done with an event, either because it was dispatched or\n   * because it was coalesced with another Event.\n   */\n  public void onDispose() {\n  }\n\n  /*package*/ boolean isInitialized() {\n    return mInitialized;\n  }\n\n  /*package*/ final void dispose() {\n    mInitialized = false;\n    onDispose();\n  }\n\n  /**\n   * @return the name of this event as registered in JS\n   */\n  public abstract String getEventName();\n\n  /**\n   * Dispatch this event to JS using the given event emitter.\n   */\n  public abstract void dispatch(RCTEventEmitter rctEventEmitter);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcher.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager.events;\n\nimport javax.annotation.Nullable;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Comparator;\nimport java.util.Map;\nimport java.util.concurrent.atomic.AtomicInteger;\n\nimport android.util.LongSparseArray;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.UiThreadUtil;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.modules.core.ChoreographerCompat;\nimport com.facebook.react.modules.core.ReactChoreographer;\nimport com.facebook.systrace.Systrace;\n\n/**\n * Class responsible for dispatching UI events to JS. The main purpose of this class is to act as an\n * intermediary between UI code generating events and JS, making sure we don't send more events than\n * JS can process.\n *\n * To use it, create a subclass of {@link Event} and call {@link #dispatchEvent(Event)} whenever\n * there's a UI event to dispatch.\n *\n * This class works by installing a Choreographer frame callback on the main thread. This callback\n * then enqueues a runnable on the JS thread (if one is not already pending) that is responsible for\n * actually dispatch events to JS. This implementation depends on the properties that\n *   1) FrameCallbacks run after UI events have been processed in Choreographer.java\n *   2) when we enqueue a runnable on the JS queue thread, it won't be called until after any\n *      previously enqueued JS jobs have finished processing\n *\n * If JS is taking a long time processing events, then the UI events generated on the  UI thread can\n * be coalesced into fewer events so that when the runnable runs, we don't overload JS with a ton\n * of events and make it get even farther behind.\n *\n * Ideally, we don't need this and JS is fast enough to process all the events each frame, but bad\n * things happen, including load on CPUs from the system, and we should handle this case well.\n *\n * == Event Cookies ==\n *\n * An event cookie is made up of the event type id, view tag, and a custom coalescing key. Only\n * Events that have the same cookie can be coalesced.\n *\n * Event Cookie Composition:\n * VIEW_TAG_MASK =       0x00000000ffffffff\n * EVENT_TYPE_ID_MASK =  0x0000ffff00000000\n * COALESCING_KEY_MASK = 0xffff000000000000\n */\npublic class EventDispatcher implements LifecycleEventListener {\n\n  private static final Comparator<Event> EVENT_COMPARATOR = new Comparator<Event>() {\n    @Override\n    public int compare(Event lhs, Event rhs) {\n      if (lhs == null && rhs == null) {\n        return 0;\n      }\n      if (lhs == null) {\n        return -1;\n      }\n      if (rhs == null) {\n        return 1;\n      }\n\n      long diff = lhs.getTimestampMs() - rhs.getTimestampMs();\n      if (diff == 0) {\n        return 0;\n      } else if (diff < 0) {\n        return -1;\n      } else {\n        return 1;\n      }\n    }\n  };\n\n  private final Object mEventsStagingLock = new Object();\n  private final Object mEventsToDispatchLock = new Object();\n  private final ReactApplicationContext mReactContext;\n  private final LongSparseArray<Integer> mEventCookieToLastEventIdx = new LongSparseArray<>();\n  private final Map<String, Short> mEventNameToEventId = MapBuilder.newHashMap();\n  private final DispatchEventsRunnable mDispatchEventsRunnable = new DispatchEventsRunnable();\n  private final ArrayList<Event> mEventStaging = new ArrayList<>();\n  private final ArrayList<EventDispatcherListener> mListeners = new ArrayList<>();\n  private final ScheduleDispatchFrameCallback mCurrentFrameCallback =\n    new ScheduleDispatchFrameCallback();\n  private final AtomicInteger mHasDispatchScheduledCount = new AtomicInteger();\n\n  private Event[] mEventsToDispatch = new Event[16];\n  private int mEventsToDispatchSize = 0;\n  private volatile @Nullable RCTEventEmitter mRCTEventEmitter;\n  private short mNextEventTypeId = 0;\n  private volatile boolean mHasDispatchScheduled = false;\n\n  public EventDispatcher(ReactApplicationContext reactContext) {\n    mReactContext = reactContext;\n    mReactContext.addLifecycleEventListener(this);\n  }\n\n  /**\n   * Sends the given Event to JS, coalescing eligible events if JS is backed up.\n   */\n  public void dispatchEvent(Event event) {\n    Assertions.assertCondition(event.isInitialized(), \"Dispatched event hasn't been initialized\");\n\n    for (EventDispatcherListener listener : mListeners) {\n      listener.onEventDispatch(event);\n    }\n\n    synchronized (mEventsStagingLock) {\n      mEventStaging.add(event);\n      Systrace.startAsyncFlow(\n          Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n          event.getEventName(),\n          event.getUniqueID());\n    }\n    if (mRCTEventEmitter != null) {\n      // If the host activity is paused, the frame callback may not be currently\n      // posted. Ensure that it is so that this event gets delivered promptly.\n      mCurrentFrameCallback.maybePostFromNonUI();\n    } else {\n      // No JS application has started yet, or resumed. This can happen when a ReactRootView is\n      // added to view hierarchy, but ReactContext creation has not completed yet. In this case, any\n      // touch event dispatch will hit this codepath, and we simply queue them so that they\n      // are dispatched once ReactContext creation completes and JS app is running.\n    }\n  }\n\n  /**\n   * Add a listener to this EventDispatcher.\n   */\n  public void addListener(EventDispatcherListener listener) {\n    mListeners.add(listener);\n  }\n\n  /**\n   * Remove a listener from this EventDispatcher.\n   */\n  public void removeListener(EventDispatcherListener listener) {\n    mListeners.remove(listener);\n  }\n\n  @Override\n  public void onHostResume() {\n    if (mRCTEventEmitter == null) {\n      mRCTEventEmitter = mReactContext.getJSModule(RCTEventEmitter.class);\n    }\n    mCurrentFrameCallback.maybePostFromNonUI();\n  }\n\n  @Override\n  public void onHostPause() {\n    stopFrameCallback();\n  }\n\n  @Override\n  public void onHostDestroy() {\n    stopFrameCallback();\n  }\n\n  public void onCatalystInstanceDestroyed() {\n    UiThreadUtil.runOnUiThread(new Runnable() {\n      @Override\n      public void run() {\n        stopFrameCallback();\n      }\n    });\n  }\n\n  private void stopFrameCallback() {\n    UiThreadUtil.assertOnUiThread();\n    mCurrentFrameCallback.stop();\n  }\n\n  /**\n   * We use a staging data structure so that all UI events generated in a single frame are\n   * dispatched at once. Otherwise, a JS runnable enqueued in a previous frame could run while the\n   * UI thread is in the process of adding UI events and we might incorrectly send one event this\n   * frame and another from this frame during the next.\n   */\n  private void moveStagedEventsToDispatchQueue() {\n    synchronized (mEventsStagingLock) {\n      synchronized (mEventsToDispatchLock) {\n        for (int i = 0; i < mEventStaging.size(); i++) {\n          Event event = mEventStaging.get(i);\n\n          if (!event.canCoalesce()) {\n            addEventToEventsToDispatch(event);\n            continue;\n          }\n\n          long eventCookie = getEventCookie(\n              event.getViewTag(),\n              event.getEventName(),\n              event.getCoalescingKey());\n\n          Event eventToAdd = null;\n          Event eventToDispose = null;\n          Integer lastEventIdx = mEventCookieToLastEventIdx.get(eventCookie);\n\n          if (lastEventIdx == null) {\n            eventToAdd = event;\n            mEventCookieToLastEventIdx.put(eventCookie, mEventsToDispatchSize);\n          } else {\n            Event lastEvent = mEventsToDispatch[lastEventIdx];\n            Event coalescedEvent = event.coalesce(lastEvent);\n            if (coalescedEvent != lastEvent) {\n              eventToAdd = coalescedEvent;\n              mEventCookieToLastEventIdx.put(eventCookie, mEventsToDispatchSize);\n              eventToDispose = lastEvent;\n              mEventsToDispatch[lastEventIdx] = null;\n            } else {\n              eventToDispose = event;\n            }\n          }\n\n          if (eventToAdd != null) {\n            addEventToEventsToDispatch(eventToAdd);\n          }\n          if (eventToDispose != null) {\n            eventToDispose.dispose();\n          }\n        }\n      }\n      mEventStaging.clear();\n    }\n  }\n\n  private long getEventCookie(int viewTag, String eventName, short coalescingKey) {\n    short eventTypeId;\n    Short eventIdObj = mEventNameToEventId.get(eventName);\n    if (eventIdObj != null) {\n      eventTypeId = eventIdObj;\n    } else {\n      eventTypeId = mNextEventTypeId++;\n      mEventNameToEventId.put(eventName, eventTypeId);\n    }\n    return getEventCookie(viewTag, eventTypeId, coalescingKey);\n  }\n\n  private static long getEventCookie(int viewTag, short eventTypeId, short coalescingKey) {\n    return viewTag |\n        (((long) eventTypeId) & 0xffff) << 32 |\n        (((long) coalescingKey) & 0xffff) << 48;\n  }\n\n  private class ScheduleDispatchFrameCallback extends ChoreographerCompat.FrameCallback {\n    private volatile boolean mIsPosted = false;\n    private boolean mShouldStop = false;\n\n    @Override\n    public void doFrame(long frameTimeNanos) {\n      UiThreadUtil.assertOnUiThread();\n\n      if (mShouldStop) {\n        mIsPosted = false;\n      } else {\n        post();\n      }\n\n      Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"ScheduleDispatchFrameCallback\");\n      try {\n        moveStagedEventsToDispatchQueue();\n\n        if (mEventsToDispatchSize > 0 && !mHasDispatchScheduled) {\n          mHasDispatchScheduled = true;\n          Systrace.startAsyncFlow(\n              Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n              \"ScheduleDispatchFrameCallback\",\n              mHasDispatchScheduledCount.get());\n          mReactContext.runOnJSQueueThread(mDispatchEventsRunnable);\n        }\n      } finally {\n        Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n      }\n    }\n\n    public void stop() {\n      mShouldStop = true;\n    }\n\n    public void maybePost() {\n      if (!mIsPosted) {\n        mIsPosted = true;\n        post();\n      }\n    }\n\n    private void post() {\n      ReactChoreographer.getInstance()\n          .postFrameCallback(ReactChoreographer.CallbackType.TIMERS_EVENTS, mCurrentFrameCallback);\n    }\n\n    public void maybePostFromNonUI() {\n      if (mIsPosted) {\n        return;\n      }\n\n      // We should only hit this slow path when we receive events while the host activity is paused.\n      if (mReactContext.isOnUiQueueThread()) {\n        maybePost();\n      } else {\n        mReactContext.runOnUiQueueThread(new Runnable() {\n          @Override\n          public void run() {\n            maybePost();\n          }\n        });\n      }\n    }\n  }\n\n  private class DispatchEventsRunnable implements Runnable {\n\n    @Override\n    public void run() {\n      Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, \"DispatchEventsRunnable\");\n      try {\n        Systrace.endAsyncFlow(\n            Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n            \"ScheduleDispatchFrameCallback\",\n            mHasDispatchScheduledCount.getAndIncrement());\n        mHasDispatchScheduled = false;\n        Assertions.assertNotNull(mRCTEventEmitter);\n        synchronized (mEventsToDispatchLock) {\n          // We avoid allocating an array and iterator, and \"sorting\" if we don't need to.\n          // This occurs when the size of mEventsToDispatch is zero or one.\n          if (mEventsToDispatchSize > 1) {\n            Arrays.sort(mEventsToDispatch, 0, mEventsToDispatchSize, EVENT_COMPARATOR);\n          }\n          for (int eventIdx = 0; eventIdx < mEventsToDispatchSize; eventIdx++) {\n            Event event = mEventsToDispatch[eventIdx];\n            // Event can be null if it has been coalesced into another event.\n            if (event == null) {\n              continue;\n            }\n            Systrace.endAsyncFlow(\n                Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,\n                event.getEventName(),\n                event.getUniqueID());\n            event.dispatch(mRCTEventEmitter);\n            event.dispose();\n          }\n          clearEventsToDispatch();\n          mEventCookieToLastEventIdx.clear();\n        }\n      } finally {\n        Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);\n      }\n    }\n  }\n\n  private void addEventToEventsToDispatch(Event event) {\n    if (mEventsToDispatchSize == mEventsToDispatch.length) {\n      mEventsToDispatch = Arrays.copyOf(mEventsToDispatch, 2 * mEventsToDispatch.length);\n    }\n    mEventsToDispatch[mEventsToDispatchSize++] = event;\n  }\n\n  private void clearEventsToDispatch() {\n    Arrays.fill(mEventsToDispatch, 0, mEventsToDispatchSize, null);\n    mEventsToDispatchSize = 0;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcherListener.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.events;\n\n/**\n * Interface used to intercept events dispatched by {#link EventDispatcher}\n */\npublic interface EventDispatcherListener {\n  /**\n   * Called on every time an event is dispatched using {#link EventDispatcher#dispatchEvent}. Will be\n   * called from the same thread that the event is being dispatched from.\n   * @param event Event that was dispatched\n   */\n  void onEventDispatch(Event event);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager.events;\n\nimport javax.annotation.Nullable;\n\nimport android.support.v4.util.Pools;\nimport android.view.MotionEvent;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.SoftAssertions;\n\n/**\n * An event representing the start, end or movement of a touch. Corresponds to a single\n * {@link android.view.MotionEvent}.\n *\n * TouchEvent coalescing can happen for move events if two move events have the same target view and\n * coalescing key. See {@link TouchEventCoalescingKeyHelper} for more information about how these\n * coalescing keys are determined.\n */\npublic class TouchEvent extends Event<TouchEvent> {\n\n  private static final int TOUCH_EVENTS_POOL_SIZE = 3;\n\n  private static final Pools.SynchronizedPool<TouchEvent> EVENTS_POOL =\n      new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);\n\n  public static final long UNSET = Long.MIN_VALUE;\n\n  public static TouchEvent obtain(\n      int viewTag,\n      TouchEventType touchEventType,\n      MotionEvent motionEventToCopy,\n      long gestureStartTime,\n      float viewX,\n      float viewY,\n      TouchEventCoalescingKeyHelper touchEventCoalescingKeyHelper) {\n    TouchEvent event = EVENTS_POOL.acquire();\n    if (event == null) {\n      event = new TouchEvent();\n    }\n    event.init(\n      viewTag,\n      touchEventType,\n      motionEventToCopy,\n      gestureStartTime,\n      viewX,\n      viewY,\n      touchEventCoalescingKeyHelper);\n    return event;\n  }\n\n  private @Nullable MotionEvent mMotionEvent;\n  private @Nullable TouchEventType mTouchEventType;\n  private short mCoalescingKey;\n\n  // Coordinates in the ViewTag coordinate space\n  private float mViewX;\n  private float mViewY;\n\n  private TouchEvent() {\n  }\n\n  private void init(\n      int viewTag,\n      TouchEventType touchEventType,\n      MotionEvent motionEventToCopy,\n      long gestureStartTime,\n      float viewX,\n      float viewY,\n      TouchEventCoalescingKeyHelper touchEventCoalescingKeyHelper) {\n    super.init(viewTag);\n\n    SoftAssertions.assertCondition(gestureStartTime != UNSET,\n        \"Gesture start time must be initialized\");\n    short coalescingKey = 0;\n    int action = (motionEventToCopy.getAction() & MotionEvent.ACTION_MASK);\n    switch (action) {\n      case MotionEvent.ACTION_DOWN:\n        touchEventCoalescingKeyHelper.addCoalescingKey(gestureStartTime);\n        break;\n      case MotionEvent.ACTION_UP:\n        touchEventCoalescingKeyHelper.removeCoalescingKey(gestureStartTime);\n        break;\n      case MotionEvent.ACTION_POINTER_DOWN:\n      case MotionEvent.ACTION_POINTER_UP:\n        touchEventCoalescingKeyHelper.incrementCoalescingKey(gestureStartTime);\n        break;\n      case MotionEvent.ACTION_MOVE:\n        coalescingKey =\n          touchEventCoalescingKeyHelper.getCoalescingKey(gestureStartTime);\n        break;\n      case MotionEvent.ACTION_CANCEL:\n        touchEventCoalescingKeyHelper.removeCoalescingKey(gestureStartTime);\n        break;\n      default:\n        throw new RuntimeException(\"Unhandled MotionEvent action: \" + action);\n    }\n    mTouchEventType = touchEventType;\n    mMotionEvent = MotionEvent.obtain(motionEventToCopy);\n    mCoalescingKey = coalescingKey;\n    mViewX = viewX;\n    mViewY = viewY;\n  }\n\n  @Override\n  public void onDispose() {\n    Assertions.assertNotNull(mMotionEvent).recycle();\n    mMotionEvent = null;\n    EVENTS_POOL.release(this);\n  }\n\n  @Override\n  public String getEventName() {\n    return Assertions.assertNotNull(mTouchEventType).getJSEventName();\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    // We can coalesce move events but not start/end events. Coalescing move events should probably\n    // append historical move data like MotionEvent batching does. This is left as an exercise for\n    // the reader.\n    switch (Assertions.assertNotNull(mTouchEventType)) {\n      case START:\n      case END:\n      case CANCEL:\n        return false;\n      case MOVE:\n        return true;\n      default:\n        throw new RuntimeException(\"Unknown touch event type: \" + mTouchEventType);\n    }\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    return mCoalescingKey;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    TouchesHelper.sendTouchEvent(\n        rctEventEmitter,\n        Assertions.assertNotNull(mTouchEventType),\n        getViewTag(),\n        this);\n  }\n\n  public MotionEvent getMotionEvent() {\n    Assertions.assertNotNull(mMotionEvent);\n    return mMotionEvent;\n  }\n\n  public float getViewX() {\n    return mViewX;\n  }\n\n  public float getViewY() {\n    return mViewY;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEventCoalescingKeyHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager.events;\n\nimport android.util.SparseIntArray;\n\n/**\n * Utility for determining coalescing keys for TouchEvents. To preserve proper ordering of events,\n * move events should only be coalesced if there has been no up/down event between them (this\n * basically only applies to multitouch since for single touches an up would signal the end of the\n * gesture). To illustrate to kind of coalescing we want, imagine we are coalescing the following\n * touch stream:\n *\n * (U = finger up, D = finger down, M = move)\n * D MMMMM D MMMMMMMMMMMMMM U MMMMM D MMMMMM U U\n *\n * We want to make sure to coalesce this as\n *\n * D M D M U M D U U\n *\n * and *not*\n *\n * D D U M D U U\n *\n * To accomplish this, this class provides a way to initialize a coalescing key for a gesture and\n * then increment it for every pointer up/down that occurs during that single gesture.\n *\n * We identify a single gesture based on {@link android.view.MotionEvent#getDownTime()} which will\n * stay constant for a given set of related touches on a single view.\n *\n * NB: even though down time is a long, we cast as an int using the least significant bits as the\n * identifier. In practice, we will not be coalescing over a time range where the most significant\n * bits of that time range matter. This would require a gesture that lasts Integer.MAX_VALUE * 2 ms,\n * or ~48 days.\n *\n * NB: we assume two gestures cannot begin at the same time.\n *\n * NB: this class should only be used from the UI thread.\n */\npublic class TouchEventCoalescingKeyHelper {\n\n  private final SparseIntArray mDownTimeToCoalescingKey = new SparseIntArray();\n\n  /**\n   * Starts tracking a new coalescing key corresponding to the gesture with this down time.\n   */\n  public void addCoalescingKey(long downTime) {\n    mDownTimeToCoalescingKey.put((int) downTime, 0);\n  }\n\n  /**\n   * Increments the coalescing key corresponding to the gesture with this down time.\n   */\n  public void incrementCoalescingKey(long downTime) {\n    int currentValue = mDownTimeToCoalescingKey.get((int) downTime, -1);\n    if (currentValue == -1) {\n      throw new RuntimeException(\"Tried to increment non-existent cookie\");\n    }\n    mDownTimeToCoalescingKey.put((int) downTime, currentValue + 1);\n  }\n\n  /**\n   * Gets the coalescing key corresponding to the gesture with this down time.\n   */\n  public short getCoalescingKey(long downTime) {\n    int currentValue = mDownTimeToCoalescingKey.get((int) downTime, -1);\n    if (currentValue == -1) {\n      throw new RuntimeException(\"Tried to get non-existent cookie\");\n    }\n    return ((short) (0xffff & currentValue));\n  }\n\n  /**\n   * Stops tracking a new coalescing key corresponding to the gesture with this down time.\n   */\n  public void removeCoalescingKey(long downTime) {\n    mDownTimeToCoalescingKey.delete((int) downTime);\n  }\n\n  public boolean hasCoalescingKey(long downTime) {\n    int currentValue = mDownTimeToCoalescingKey.get((int) downTime, -1);\n    if (currentValue == -1) {\n      return false;\n    }\n    return true;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager.events;\n\nimport android.view.MotionEvent;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.PixelUtil;\n\n/**\n * Class responsible for generating catalyst touch events based on android {@link MotionEvent}.\n */\n/*package*/ class TouchesHelper {\n\n  private static final String PAGE_X_KEY = \"pageX\";\n  private static final String PAGE_Y_KEY = \"pageY\";\n  private static final String TARGET_KEY = \"target\";\n  private static final String TIMESTAMP_KEY = \"timestamp\";\n  private static final String POINTER_IDENTIFIER_KEY = \"identifier\";\n\n  private static final String LOCATION_X_KEY = \"locationX\";\n  private static final String LOCATION_Y_KEY = \"locationY\";\n\n  /**\n   * Creates catalyst pointers array in format that is expected by RCTEventEmitter JS module from\n   * given {@param event} instance. This method use {@param reactTarget} parameter to set as a\n   * target view id associated with current gesture.\n   */\n  private static WritableArray createsPointersArray(int reactTarget, TouchEvent event) {\n    WritableArray touches = Arguments.createArray();\n    MotionEvent motionEvent = event.getMotionEvent();\n\n    // Calculate the coordinates for the target view.\n    // The MotionEvent contains the X,Y of the touch in the coordinate space of the root view\n    // The TouchEvent contains the X,Y of the touch in the coordinate space of the target view\n    // Subtracting them allows us to get the coordinates of the target view's top left corner\n    // We then use this when computing the view specific touches below\n    // Since only one view is actually handling even multiple touches, the values are all relative\n    // to this one target view.\n    float targetViewCoordinateX = motionEvent.getX() - event.getViewX();\n    float targetViewCoordinateY = motionEvent.getY() - event.getViewY();\n\n    for (int index = 0; index < motionEvent.getPointerCount(); index++) {\n      WritableMap touch = Arguments.createMap();\n      // pageX,Y values are relative to the RootReactView\n      // the motionEvent already contains coordinates in that view\n      touch.putDouble(PAGE_X_KEY, PixelUtil.toDIPFromPixel(motionEvent.getX(index)));\n      touch.putDouble(PAGE_Y_KEY, PixelUtil.toDIPFromPixel(motionEvent.getY(index)));\n      // locationX,Y values are relative to the target view\n      // To compute the values for the view, we subtract that views location from the event X,Y\n      float locationX = motionEvent.getX(index) - targetViewCoordinateX;\n      float locationY = motionEvent.getY(index) - targetViewCoordinateY;\n      touch.putDouble(LOCATION_X_KEY, PixelUtil.toDIPFromPixel(locationX));\n      touch.putDouble(LOCATION_Y_KEY, PixelUtil.toDIPFromPixel(locationY));\n      touch.putInt(TARGET_KEY, reactTarget);\n      touch.putDouble(TIMESTAMP_KEY, event.getTimestampMs());\n      touch.putDouble(POINTER_IDENTIFIER_KEY, motionEvent.getPointerId(index));\n      touches.pushMap(touch);\n    }\n\n    return touches;\n  }\n\n  /**\n   * Generate and send touch event to RCTEventEmitter JS module associated with the given\n   * {@param context}. Touch event can encode multiple concurrent touches (pointers).\n   *\n   * @param rctEventEmitter Event emitter used to execute JS module call\n   * @param type type of the touch event (see {@link TouchEventType})\n   * @param reactTarget target view react id associated with this gesture\n   * @param touchEvent native touch event to read pointers count and coordinates from\n   */\n  public static void sendTouchEvent(\n      RCTEventEmitter rctEventEmitter,\n      TouchEventType type,\n      int reactTarget,\n      TouchEvent touchEvent) {\n\n    WritableArray pointers = createsPointersArray(reactTarget, touchEvent);\n    MotionEvent motionEvent = touchEvent.getMotionEvent();\n\n    // For START and END events send only index of the pointer that is associated with that event\n    // For MOVE and CANCEL events 'changedIndices' array should contain all the pointers indices\n    WritableArray changedIndices = Arguments.createArray();\n    if (type == TouchEventType.MOVE || type == TouchEventType.CANCEL) {\n      for (int i = 0; i < motionEvent.getPointerCount(); i++) {\n        changedIndices.pushInt(i);\n      }\n    } else if (type == TouchEventType.START || type == TouchEventType.END) {\n      changedIndices.pushInt(motionEvent.getActionIndex());\n    } else {\n      throw new RuntimeException(\"Unknown touch type: \" + type);\n    }\n\n    rctEventEmitter.receiveTouches(\n        type.getJSEventName(),\n        pointers,\n        changedIndices);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/AbstractLayoutAnimation.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.layoutanimation;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Map;\n\nimport android.view.View;\nimport android.view.animation.AccelerateDecelerateInterpolator;\nimport android.view.animation.AccelerateInterpolator;\nimport android.view.animation.Animation;\nimport android.view.animation.DecelerateInterpolator;\nimport android.view.animation.Interpolator;\nimport android.view.animation.LinearInterpolator;\n\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.uimanager.IllegalViewOperationException;\n\n/**\n * Class responsible for parsing and converting layout animation data into native {@link Animation}\n * in order to animate layout when a valid configuration has been supplied by the application.\n */\n/* package */ abstract class AbstractLayoutAnimation {\n\n  // Forces animation to be playing 10x slower, used for debug purposes.\n  private static final boolean SLOWDOWN_ANIMATION_MODE = false;\n\n  abstract boolean isValid();\n\n  /**\n   * Create an animation object for the current animation type, based on the view and final screen\n   * coordinates. If the application-supplied configuration does not specify an animation definition\n   * for this types, or if the animation definition is invalid, returns null.\n   */\n  abstract @Nullable Animation createAnimationImpl(View view, int x, int y, int width, int height);\n\n  private static final Map<InterpolatorType, Interpolator> INTERPOLATOR = MapBuilder.of(\n      InterpolatorType.LINEAR, new LinearInterpolator(),\n      InterpolatorType.EASE_IN, new AccelerateInterpolator(),\n      InterpolatorType.EASE_OUT, new DecelerateInterpolator(),\n      InterpolatorType.EASE_IN_EASE_OUT, new AccelerateDecelerateInterpolator(),\n      InterpolatorType.SPRING, new SimpleSpringInterpolator());\n\n  private @Nullable Interpolator mInterpolator;\n  private int mDelayMs;\n\n  protected @Nullable AnimatedPropertyType mAnimatedProperty;\n  protected int mDurationMs;\n\n  public void reset() {\n    mAnimatedProperty = null;\n    mDurationMs = 0;\n    mDelayMs = 0;\n    mInterpolator = null;\n  }\n\n  public void initializeFromConfig(ReadableMap data, int globalDuration) {\n    mAnimatedProperty = data.hasKey(\"property\") ?\n        AnimatedPropertyType.fromString(data.getString(\"property\")) : null;\n    mDurationMs = data.hasKey(\"duration\") ? data.getInt(\"duration\") : globalDuration;\n    mDelayMs = data.hasKey(\"delay\") ? data.getInt(\"delay\") : 0;\n    if (!data.hasKey(\"type\")) {\n      throw new IllegalArgumentException(\"Missing interpolation type.\");\n    }\n    mInterpolator = getInterpolator(InterpolatorType.fromString(data.getString(\"type\")));\n\n    if (!isValid()) {\n      throw new IllegalViewOperationException(\"Invalid layout animation : \" + data);\n    }\n  }\n\n  /**\n   * Create an animation object to be used to animate the view, based on the animation config\n   * supplied at initialization time and the new view position and size.\n   *\n   * @param view the view to create the animation for\n   * @param x the new X position for the view\n   * @param y the new Y position for the view\n   * @param width the new width value for the view\n   * @param height the new height value for the view\n   */\n   public final @Nullable Animation createAnimation(\n       View view,\n       int x,\n       int y,\n       int width,\n       int height) {\n    if (!isValid()) {\n      return null;\n    }\n    Animation animation = createAnimationImpl(view, x, y, width, height);\n    if (animation != null) {\n      int slowdownFactor = SLOWDOWN_ANIMATION_MODE ? 10 : 1;\n      animation.setDuration(mDurationMs * slowdownFactor);\n      animation.setStartOffset(mDelayMs * slowdownFactor);\n      animation.setInterpolator(mInterpolator);\n    }\n    return animation;\n  }\n\n  private static Interpolator getInterpolator(InterpolatorType type) {\n    Interpolator interpolator = INTERPOLATOR.get(type);\n    if (interpolator == null) {\n      throw new IllegalArgumentException(\"Missing interpolator for type : \" + type);\n    }\n    return interpolator;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/BaseLayoutAnimation.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.layoutanimation;\n\nimport android.view.View;\nimport android.view.animation.Animation;\nimport android.view.animation.ScaleAnimation;\n\nimport com.facebook.react.uimanager.IllegalViewOperationException;\n\n/**\n * Class responsible for default layout animation, i.e animation of view creation and deletion.\n */\n/* package */ abstract class BaseLayoutAnimation extends AbstractLayoutAnimation {\n\n  abstract boolean isReverse();\n\n  @Override\n  boolean isValid() {\n    return mDurationMs > 0 && mAnimatedProperty != null;\n  }\n\n  @Override\n  Animation createAnimationImpl(View view, int x, int y, int width, int height) {\n    if (mAnimatedProperty != null) {\n      switch (mAnimatedProperty) {\n        case OPACITY: {\n          float fromValue = isReverse() ? view.getAlpha() : 0.0f;\n          float toValue = isReverse() ? 0.0f : view.getAlpha();\n          return new OpacityAnimation(view, fromValue, toValue);\n        }\n        case SCALE_XY: {\n          float fromValue = isReverse() ? 1.0f : 0.0f;\n          float toValue = isReverse() ? 0.0f : 1.0f;\n          return new ScaleAnimation(\n              fromValue,\n              toValue,\n              fromValue,\n              toValue,\n              Animation.RELATIVE_TO_SELF,\n              .5f,\n              Animation.RELATIVE_TO_SELF,\n              .5f);\n        }\n        default:\n          throw new IllegalViewOperationException(\n              \"Missing animation for property : \" + mAnimatedProperty);\n      }\n    }\n    throw new IllegalViewOperationException(\"Missing animated property from animation config\");\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationController.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.layoutanimation;\n\nimport javax.annotation.Nullable;\nimport javax.annotation.concurrent.NotThreadSafe;\n\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.animation.Animation;\n\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.UiThreadUtil;\n\n/**\n * Class responsible for animation layout changes, if a valid layout animation config has been\n * supplied. If not animation is available, layout change is applied immediately instead of\n * performing an animation.\n *\n * TODO(7613721): Invoke success callback at the end of animation and when animation gets cancelled.\n */\n@NotThreadSafe\npublic class LayoutAnimationController {\n\n  private static final boolean ENABLED = true;\n\n  private final AbstractLayoutAnimation mLayoutCreateAnimation = new LayoutCreateAnimation();\n  private final AbstractLayoutAnimation mLayoutUpdateAnimation = new LayoutUpdateAnimation();\n  private final AbstractLayoutAnimation mLayoutDeleteAnimation = new LayoutDeleteAnimation();\n  private boolean mShouldAnimateLayout;\n\n  public void initializeFromConfig(final @Nullable ReadableMap config) {\n    if (!ENABLED) {\n      return;\n    }\n\n    if (config == null) {\n      reset();\n      return;\n    }\n\n    mShouldAnimateLayout = false;\n    int globalDuration = config.hasKey(\"duration\") ? config.getInt(\"duration\") : 0;\n    if (config.hasKey(LayoutAnimationType.CREATE.toString())) {\n      mLayoutCreateAnimation.initializeFromConfig(\n          config.getMap(LayoutAnimationType.CREATE.toString()), globalDuration);\n      mShouldAnimateLayout = true;\n    }\n    if (config.hasKey(LayoutAnimationType.UPDATE.toString())) {\n      mLayoutUpdateAnimation.initializeFromConfig(\n          config.getMap(LayoutAnimationType.UPDATE.toString()), globalDuration);\n      mShouldAnimateLayout = true;\n    }\n    if (config.hasKey(LayoutAnimationType.DELETE.toString())) {\n      mLayoutDeleteAnimation.initializeFromConfig(\n          config.getMap(LayoutAnimationType.DELETE.toString()), globalDuration);\n      mShouldAnimateLayout = true;\n    }\n  }\n\n  public void reset() {\n    mLayoutCreateAnimation.reset();\n    mLayoutUpdateAnimation.reset();\n    mLayoutDeleteAnimation.reset();\n    mShouldAnimateLayout = false;\n  }\n\n  public boolean shouldAnimateLayout(View viewToAnimate) {\n    // if view parent is null, skip animation: view have been clipped, we don't want animation to\n    // resume when view is re-attached to parent, which is the standard android animation behavior.\n    return mShouldAnimateLayout && viewToAnimate.getParent() != null;\n  }\n\n  /**\n   * Update layout of given view, via immediate update or animation depending on the current batch\n   * layout animation configuration supplied during initialization. Handles create and update\n   * animations.\n   *\n   * @param view the view to update layout of\n   * @param x the new X position for the view\n   * @param y the new Y position for the view\n   * @param width the new width value for the view\n   * @param height the new height value for the view\n   */\n  public void applyLayoutUpdate(View view, int x, int y, int width, int height) {\n    UiThreadUtil.assertOnUiThread();\n\n    // Determine which animation to use : if view is initially invisible, use create animation,\n    // otherwise use update animation. This approach is easier than maintaining a list of tags\n    // for recently created views.\n    AbstractLayoutAnimation layoutAnimation = (view.getWidth() == 0 || view.getHeight() == 0) ?\n        mLayoutCreateAnimation :\n        mLayoutUpdateAnimation;\n\n    Animation animation = layoutAnimation.createAnimation(view, x, y, width, height);\n    if (animation == null || !(animation instanceof HandleLayout)) {\n      view.layout(x, y, x + width, y + height);\n    }\n    if (animation != null) {\n      view.startAnimation(animation);\n    }\n  }\n\n  /**\n   * Animate a view deletion using the layout animation configuration supplied during initialization.\n   *\n   * @param view     The view to animate.\n   * @param listener Called once the animation is finished, should be used to\n   *                 completely remove the view.\n   */\n  public void deleteView(final View view, final LayoutAnimationListener listener) {\n    UiThreadUtil.assertOnUiThread();\n\n    AbstractLayoutAnimation layoutAnimation = mLayoutDeleteAnimation;\n\n    Animation animation = layoutAnimation.createAnimation(\n        view, view.getLeft(), view.getTop(), view.getWidth(), view.getHeight());\n\n    if (animation != null) {\n      disableUserInteractions(view);\n\n      animation.setAnimationListener(new Animation.AnimationListener() {\n        @Override\n        public void onAnimationStart(Animation anim) {}\n\n        @Override\n        public void onAnimationRepeat(Animation anim) {}\n\n        @Override\n        public void onAnimationEnd(Animation anim) {\n          listener.onAnimationEnd();\n        }\n      });\n\n      view.startAnimation(animation);\n    } else {\n      listener.onAnimationEnd();\n    }\n  }\n\n  /**\n   * Disables user interactions for a view and all it's subviews.\n   */\n  private void disableUserInteractions(View view) {\n    view.setClickable(false);\n    if (view instanceof ViewGroup) {\n      ViewGroup viewGroup = (ViewGroup)view;\n      for (int i = 0; i < viewGroup.getChildCount(); i++) {\n        disableUserInteractions(viewGroup.getChildAt(i));\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationListener.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.layoutanimation;\n\n/**\n * Listener invoked when a layout animation has completed.\n */\npublic interface LayoutAnimationListener {\n  void onAnimationEnd();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationType.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.layoutanimation;\n\n/**\n * Enum representing the different animation type that can be specified in layout animation config.\n */\n/* package */ enum LayoutAnimationType {\n  CREATE(\"create\"),\n  UPDATE(\"update\"),\n  DELETE(\"delete\");\n\n  private final String mName;\n\n  private LayoutAnimationType(String name) {\n    mName = name;\n  }\n\n  @Override\n  public String toString() {\n    return mName;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutDeleteAnimation.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.layoutanimation;\n\n/**\n * Class responsible for handling layout view deletion animation, applied to view whenever a\n * valid config was supplied for the layout animation of DELETE type.\n */\n/* package */ class LayoutDeleteAnimation extends BaseLayoutAnimation {\n\n  @Override\n  boolean isReverse() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/OpacityAnimation.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.layoutanimation;\n\nimport android.view.View;\nimport android.view.animation.Animation;\nimport android.view.animation.Transformation;\n\n/**\n * Animation responsible for updating opacity of a view. It should ideally use hardware texture\n * to optimize rendering performances.\n */\n/* package */ class OpacityAnimation extends Animation {\n\n  static class OpacityAnimationListener implements Animation.AnimationListener {\n\n    private final View mView;\n    private boolean mLayerTypeChanged = false;\n\n    public OpacityAnimationListener(View view) {\n      mView = view;\n    }\n\n    @Override\n    public void onAnimationStart(Animation animation) {\n      if (mView.hasOverlappingRendering() &&\n          mView.getLayerType() == View.LAYER_TYPE_NONE) {\n        mLayerTypeChanged = true;\n        mView.setLayerType(View.LAYER_TYPE_HARDWARE, null);\n      }\n    }\n\n    @Override\n    public void onAnimationEnd(Animation animation) {\n      if (mLayerTypeChanged) {\n        mView.setLayerType(View.LAYER_TYPE_NONE, null);\n      }\n    }\n\n    @Override\n    public void onAnimationRepeat(Animation animation) {\n      // do nothing\n    }\n  }\n\n  private final View mView;\n  private final float mStartOpacity, mDeltaOpacity;\n\n  public OpacityAnimation(View view, float startOpacity, float endOpacity) {\n    mView = view;\n    mStartOpacity = startOpacity;\n    mDeltaOpacity = endOpacity - startOpacity;\n\n    setAnimationListener(new OpacityAnimationListener(view));\n  }\n\n  @Override\n  protected void applyTransformation(float interpolatedTime, Transformation t) {\n    mView.setAlpha(mStartOpacity + mDeltaOpacity * interpolatedTime);\n  }\n\n  @Override\n  public boolean willChangeBounds() {\n    return false;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/PositionAndSizeAnimation.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.layoutanimation;\n\nimport android.view.View;\nimport android.view.animation.Animation;\nimport android.view.animation.Transformation;\n\n/**\n * Animation responsible for updating size and position of a view. We can't use scaling as view\n * content may not necessarily stretch. As a result, this approach is inefficient because of\n * layout passes occurring on every frame.\n * What we might want to try to do instead is use a combined ScaleAnimation and TranslateAnimation.\n */\n/* package */ class PositionAndSizeAnimation extends Animation implements HandleLayout {\n\n  private final View mView;\n  private final float mStartX, mStartY, mDeltaX, mDeltaY;\n  private final int mStartWidth, mStartHeight, mDeltaWidth, mDeltaHeight;\n\n  public PositionAndSizeAnimation(View view, int x, int y, int width, int height) {\n    mView = view;\n\n    mStartX = view.getX() - view.getTranslationX();\n    mStartY = view.getY() - view.getTranslationY();\n    mStartWidth = view.getWidth();\n    mStartHeight = view.getHeight();\n\n    mDeltaX = x - mStartX;\n    mDeltaY = y - mStartY;\n    mDeltaWidth = width - mStartWidth;\n    mDeltaHeight = height - mStartHeight;\n  }\n\n  @Override\n  protected void applyTransformation(float interpolatedTime, Transformation t) {\n    float newX = mStartX + mDeltaX * interpolatedTime;\n    float newY = mStartY + mDeltaY * interpolatedTime;\n    float newWidth = mStartWidth + mDeltaWidth * interpolatedTime;\n    float newHeight = mStartHeight + mDeltaHeight * interpolatedTime;\n    mView.layout(\n        Math.round(newX),\n        Math.round(newY),\n        Math.round(newX + newWidth),\n        Math.round(newY + newHeight));\n  }\n\n  @Override\n  public boolean willChangeBounds() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/util/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"util\",\n    srcs = glob([\"*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"res:uimanager\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/util/ReactFindViewUtil.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.uimanager.util;\n\nimport javax.annotation.Nullable;\n\nimport java.util.ArrayList;\nimport java.util.Iterator;\nimport java.util.List;\n\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.facebook.react.R;\n\n/**\n * Finds views in React Native view hierarchies\n */\npublic class ReactFindViewUtil {\n\n  private static final List<OnViewFoundListener> mOnViewFoundListeners = new ArrayList<>();\n\n  /**\n   * Callback to be invoked when a react native view has been found\n   */\n  public interface OnViewFoundListener {\n\n    /**\n     * Returns the native id of the view of interest\n     */\n    String getNativeId();\n\n    /**\n     * Called when the view has been found\n     * @param view\n     */\n    void onViewFound(View view);\n  }\n\n  /**\n   * Finds a view that is tagged with {@param nativeId} as its nativeID prop\n   * under the {@param root} view hierarchy. Returns the view if found, null otherwise.\n   * @param root root of the view hierarchy from which to find the view\n   */\n  public static @Nullable View findView(View root, String nativeId) {\n    String tag = getNativeId(root);\n    if (tag != null && tag.equals(nativeId)) {\n      return root;\n    }\n\n    if (root instanceof ViewGroup) {\n      ViewGroup viewGroup = (ViewGroup) root;\n      for (int i = 0; i < viewGroup.getChildCount(); i++) {\n        View view = findView(viewGroup.getChildAt(i), nativeId);\n        if (view != null) {\n          return view;\n        }\n      }\n    }\n\n    return null;\n  }\n\n  /**\n   * Finds a view tagged with {@param onViewFoundListener}'s nativeID in the given {@param root}\n   * view hierarchy. If the view does not exist yet due to React Native's async layout, a listener\n   * will be added. When the view is found, the {@param onViewFoundListener} will be invoked.\n   * @param root root of the view hierarchy from which to find the view\n   */\n  public static void findView(View root, OnViewFoundListener onViewFoundListener) {\n    View view = findView(root, onViewFoundListener.getNativeId());\n    if (view != null) {\n      onViewFoundListener.onViewFound(view);\n    }\n    addViewListener(onViewFoundListener);\n  }\n\n  /**\n   * Registers an OnViewFoundListener to be invoked when a view with a matching nativeID is found.\n   * Remove this listener using removeViewListener() if it's no longer needed.\n   */\n  public static void addViewListener(OnViewFoundListener onViewFoundListener) {\n    mOnViewFoundListeners.add(onViewFoundListener);\n  }\n\n  /**\n   * Removes an OnViewFoundListener previously registered with addViewListener().\n   */\n  public static void removeViewListener(OnViewFoundListener onViewFoundListener) {\n    mOnViewFoundListeners.remove(onViewFoundListener);\n  }\n\n  /**\n   * Invokes any listeners that are listening on this {@param view}'s native id\n   */\n  public static void notifyViewRendered(View view) {\n    String nativeId = getNativeId(view);\n    if (nativeId == null) {\n      return;\n    }\n    Iterator<OnViewFoundListener> iterator = mOnViewFoundListeners.iterator();\n    while (iterator.hasNext()) {\n      OnViewFoundListener listener = iterator.next();\n      if (nativeId != null && nativeId.equals(listener.getNativeId())) {\n        listener.onViewFound(view);\n        iterator.remove();\n      }\n    }\n  }\n\n  private static @Nullable String getNativeId(View view) {\n    Object tag = view.getTag(R.id.view_tag_native_id);\n    return tag instanceof String ? (String) tag : null;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/util/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"util\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/util/JSStackTrace.java",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\npackage com.facebook.react.util;\n\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.ReadableType;\n\npublic class JSStackTrace {\n\n  final private static Pattern mJsModuleIdPattern = Pattern.compile(\"(?:^|[/\\\\\\\\])(\\\\d+\\\\.js)$\");\n\n  public static String format(String message, ReadableArray stack) {\n    StringBuilder stringBuilder = new StringBuilder(message).append(\", stack:\\n\");\n    for (int i = 0; i < stack.size(); i++) {\n      ReadableMap frame = stack.getMap(i);\n      stringBuilder\n        .append(frame.getString(\"methodName\"))\n        .append(\"@\")\n        .append(stackFrameToModuleId(frame))\n        .append(frame.getInt(\"lineNumber\"));\n      if (frame.hasKey(\"column\") &&\n        !frame.isNull(\"column\") &&\n        frame.getType(\"column\") == ReadableType.Number) {\n        stringBuilder\n          .append(\":\")\n          .append(frame.getInt(\"column\"));\n      }\n      stringBuilder.append(\"\\n\");\n    }\n    return stringBuilder.toString();\n  }\n\n  // If the file name of a stack frame is numeric (+ \".js\"), we assume it's a lazily injected module\n  // coming from a \"random access bundle\". We are using special source maps for these bundles, so\n  // that we can symbolicate stack traces for multiple injected files with a single source map.\n  // We have to include the module id in the stack for that, though. The \".js\" suffix is kept to\n  // avoid ambiguities between \"module-id:line\" and \"line:column\".\n  private static String stackFrameToModuleId(ReadableMap frame) {\n    if (frame.hasKey(\"file\") &&\n        !frame.isNull(\"file\") &&\n        frame.getType(\"file\") == ReadableType.String) {\n      final Matcher matcher = mJsModuleIdPattern.matcher(frame.getString(\"file\"));\n      if (matcher.find()) {\n        return matcher.group(1) + \":\";\n      }\n    }\n    return \"\";\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/art/ARTGroupShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.art;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.RectF;\nimport android.graphics.Region;\n\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.uimanager.annotations.ReactProp;\n\n/**\n * Shadow node for virtual ARTGroup view\n */\npublic class ARTGroupShadowNode extends ARTVirtualNode {\n\n  protected @Nullable RectF mClipping;\n\n  @ReactProp(name = \"clipping\")\n  public void setClipping(@Nullable ReadableArray clippingDims) {\n    float[] clippingData = PropHelper.toFloatArray(clippingDims);\n    if (clippingData != null) {\n      mClipping = createClipping(clippingData);\n      markUpdated();\n    }\n  }\n\n  @Override\n  public boolean isVirtual() {\n    return true;\n  }\n\n  public void draw(Canvas canvas, Paint paint, float opacity) {\n    opacity *= mOpacity;\n    if (opacity > MIN_OPACITY_FOR_DRAW) {\n      saveAndSetupCanvas(canvas);\n\n      if (mClipping != null) {\n        canvas.clipRect(\n          mClipping.left * mScale,\n          mClipping.top * mScale,\n          mClipping.right * mScale,\n          mClipping.bottom * mScale,\n          Region.Op.REPLACE);\n      }\n\n      for (int i = 0; i < getChildCount(); i++) {\n        ARTVirtualNode child = (ARTVirtualNode) getChildAt(i);\n        child.draw(canvas, paint, opacity);\n        child.markUpdateSeen();\n      }\n\n      restoreCanvas(canvas);\n    }\n  }\n\n  /**\n   * Creates a {@link RectF} from an array of dimensions\n   * (e.g. [x, y, width, height])\n   *\n   * @param data the array of dimensions\n   * @return the {@link RectF} that can used to clip the canvas\n   */\n  private static RectF createClipping(float[] data) {\n    if (data.length != 4) {\n      throw new JSApplicationIllegalArgumentException(\n          \"Clipping should be array of length 4 (e.g. [x, y, width, height])\");\n    }\n    RectF clippingRect = new RectF(\n      data[0], data[1], data[0] + data[2], data[1] + data[3]);\n    return clippingRect;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/art/ARTGroupViewManager.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.art;\n\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * ViewManager for shadowed ART group views.\n */\n@ReactModule(name = ARTRenderableViewManager.CLASS_GROUP)\npublic class ARTGroupViewManager extends ARTRenderableViewManager {\n\n  /* package */ ARTGroupViewManager() {\n    super(CLASS_GROUP);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/art/ARTRenderableViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.art;\n\nimport android.view.View;\n\nimport com.facebook.react.uimanager.ReactShadowNode;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewManager;\n\n/**\n * ViewManager for all shadowed ART views: Group, Shape and Text. Since these never get rendered\n * into native views and don't need any logic (all the logic is in {@link ARTSurfaceView}), this\n * \"stubbed\" ViewManager is used for all of them.\n */\npublic class ARTRenderableViewManager extends ViewManager<View, ReactShadowNode> {\n\n  /* package */ static final String CLASS_GROUP = \"ARTGroup\";\n  /* package */ static final String CLASS_SHAPE = \"ARTShape\";\n  /* package */ static final String CLASS_TEXT = \"ARTText\";\n\n  private final String mClassName;\n\n  public static ARTRenderableViewManager createARTGroupViewManager() {\n    return new ARTGroupViewManager();\n  }\n\n  public static ARTRenderableViewManager createARTShapeViewManager() {\n    return new ARTShapeViewManager();\n  }\n\n  public static ARTRenderableViewManager createARTTextViewManager() {\n    return new ARTTextViewManager();\n  }\n\n  /* package */ ARTRenderableViewManager(String className) {\n    mClassName = className;\n  }\n\n  @Override\n  public String getName() {\n    return mClassName;\n  }\n\n  @Override\n  public ReactShadowNode createShadowNodeInstance() {\n    if (CLASS_GROUP.equals(mClassName)) {\n      return new ARTGroupShadowNode();\n    } else if (CLASS_SHAPE.equals(mClassName)) {\n      return new ARTShapeShadowNode();\n    } else if (CLASS_TEXT.equals(mClassName)) {\n      return new ARTTextShadowNode();\n    } else {\n      throw new IllegalStateException(\"Unexpected type \" + mClassName);\n    }\n  }\n\n  @Override\n  public Class<? extends ReactShadowNode> getShadowNodeClass() {\n    if (CLASS_GROUP.equals(mClassName)) {\n      return ARTGroupShadowNode.class;\n    } else if (CLASS_SHAPE.equals(mClassName)) {\n      return ARTShapeShadowNode.class;\n    } else if (CLASS_TEXT.equals(mClassName)) {\n      return ARTTextShadowNode.class;\n    } else {\n      throw new IllegalStateException(\"Unexpected type \" + mClassName);\n    }\n  }\n\n  @Override\n  protected View createViewInstance(ThemedReactContext reactContext) {\n    throw new IllegalStateException(\"ARTShape does not map into a native view\");\n  }\n\n  @Override\n  public void updateExtraData(View root, Object extraData) {\n    throw new IllegalStateException(\"ARTShape does not map into a native view\");\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.art;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.Path;\nimport android.graphics.RectF;\nimport android.graphics.DashPathEffect;\nimport android.graphics.LinearGradient;\nimport android.graphics.Shader;\nimport android.graphics.Color;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.uimanager.annotations.ReactProp;\n\n/**\n * Shadow node for virtual ARTShape view\n */\npublic class ARTShapeShadowNode extends ARTVirtualNode {\n\n  private static final int CAP_BUTT = 0;\n  private static final int CAP_ROUND = 1;\n  private static final int CAP_SQUARE = 2;\n\n  private static final int JOIN_BEVEL = 2;\n  private static final int JOIN_MITER = 0;\n  private static final int JOIN_ROUND = 1;\n\n  private static final int PATH_TYPE_ARC = 4;\n  private static final int PATH_TYPE_CLOSE = 1;\n  private static final int PATH_TYPE_CURVETO = 3;\n  private static final int PATH_TYPE_LINETO = 2;\n  private static final int PATH_TYPE_MOVETO = 0;\n\n  // For color type JS and ObjectiveC definitions counterparts\n  // refer to ReactNativeART.js and RCTConvert+ART.m\n  private static final int COLOR_TYPE_SOLID_COLOR = 0;\n  private static final int COLOR_TYPE_LINEAR_GRADIENT = 1;\n  private static final int COLOR_TYPE_RADIAL_GRADIENT = 2;\n  private static final int COLOR_TYPE_PATTERN = 3;\n\n  protected @Nullable Path mPath;\n  private @Nullable float[] mStrokeColor;\n  private @Nullable float[] mBrushData;\n  private @Nullable float[] mStrokeDash;\n  private float mStrokeWidth = 1;\n  private int mStrokeCap = CAP_ROUND;\n  private int mStrokeJoin = JOIN_ROUND;\n\n  @ReactProp(name = \"d\")\n  public void setShapePath(@Nullable ReadableArray shapePath) {\n    float[] pathData = PropHelper.toFloatArray(shapePath);\n    mPath = createPath(pathData);\n    markUpdated();\n  }\n\n  @ReactProp(name = \"stroke\")\n  public void setStroke(@Nullable ReadableArray strokeColors) {\n    mStrokeColor = PropHelper.toFloatArray(strokeColors);\n    markUpdated();\n  }\n\n  @ReactProp(name = \"strokeDash\")\n  public void setStrokeDash(@Nullable ReadableArray strokeDash) {\n    mStrokeDash = PropHelper.toFloatArray(strokeDash);\n    markUpdated();\n  }\n\n  @ReactProp(name = \"fill\")\n  public void setFill(@Nullable ReadableArray fillColors) {\n    mBrushData = PropHelper.toFloatArray(fillColors);\n    markUpdated();\n  }\n\n  @ReactProp(name = \"strokeWidth\", defaultFloat = 1f)\n  public void setStrokeWidth(float strokeWidth) {\n    mStrokeWidth = strokeWidth;\n    markUpdated();\n  }\n\n  @ReactProp(name = \"strokeCap\", defaultInt = CAP_ROUND)\n  public void setStrokeCap(int strokeCap) {\n    mStrokeCap = strokeCap;\n    markUpdated();\n  }\n\n  @ReactProp(name = \"strokeJoin\", defaultInt = JOIN_ROUND)\n  public void setStrokeJoin(int strokeJoin) {\n    mStrokeJoin = strokeJoin;\n    markUpdated();\n  }\n\n  @Override\n  public void draw(Canvas canvas, Paint paint, float opacity) {\n    opacity *= mOpacity;\n    if (opacity > MIN_OPACITY_FOR_DRAW) {\n      saveAndSetupCanvas(canvas);\n      if (mPath == null) {\n        throw new JSApplicationIllegalArgumentException(\n            \"Shapes should have a valid path (d) prop\");\n      }\n      if (setupFillPaint(paint, opacity)) {\n        canvas.drawPath(mPath, paint);\n      }\n      if (setupStrokePaint(paint, opacity)) {\n        canvas.drawPath(mPath, paint);\n      }\n      restoreCanvas(canvas);\n    }\n    markUpdateSeen();\n  }\n\n  /**\n   * Sets up {@link #mPaint} according to the props set on a shadow view. Returns {@code true}\n   * if the stroke should be drawn, {@code false} if not.\n   */\n  protected boolean setupStrokePaint(Paint paint, float opacity) {\n    if (mStrokeWidth == 0 || mStrokeColor == null || mStrokeColor.length == 0) {\n      return false;\n    }\n    paint.reset();\n    paint.setFlags(Paint.ANTI_ALIAS_FLAG);\n    paint.setStyle(Paint.Style.STROKE);\n    switch (mStrokeCap) {\n      case CAP_BUTT:\n        paint.setStrokeCap(Paint.Cap.BUTT);\n        break;\n      case CAP_SQUARE:\n        paint.setStrokeCap(Paint.Cap.SQUARE);\n        break;\n      case CAP_ROUND:\n        paint.setStrokeCap(Paint.Cap.ROUND);\n        break;\n      default:\n        throw new JSApplicationIllegalArgumentException(\n            \"strokeCap \" + mStrokeCap + \" unrecognized\");\n    }\n    switch (mStrokeJoin) {\n      case JOIN_MITER:\n        paint.setStrokeJoin(Paint.Join.MITER);\n        break;\n      case JOIN_BEVEL:\n        paint.setStrokeJoin(Paint.Join.BEVEL);\n        break;\n      case JOIN_ROUND:\n        paint.setStrokeJoin(Paint.Join.ROUND);\n        break;\n      default:\n        throw new JSApplicationIllegalArgumentException(\n            \"strokeJoin \" + mStrokeJoin + \" unrecognized\");\n    }\n    paint.setStrokeWidth(mStrokeWidth * mScale);\n    paint.setARGB(\n        (int) (mStrokeColor.length > 3 ? mStrokeColor[3] * opacity * 255 : opacity * 255),\n        (int) (mStrokeColor[0] * 255),\n        (int) (mStrokeColor[1] * 255),\n        (int) (mStrokeColor[2] * 255));\n    if (mStrokeDash != null && mStrokeDash.length > 0) {\n      paint.setPathEffect(new DashPathEffect(mStrokeDash, 0));\n    }\n    return true;\n  }\n\n  /**\n   * Sets up {@link #mPaint} according to the props set on a shadow view. Returns {@code true}\n   * if the fill should be drawn, {@code false} if not.\n   */\n  protected boolean setupFillPaint(Paint paint, float opacity) {\n    if (mBrushData != null && mBrushData.length > 0) {\n      paint.reset();\n      paint.setFlags(Paint.ANTI_ALIAS_FLAG);\n      paint.setStyle(Paint.Style.FILL);\n      int colorType = (int) mBrushData[0];\n      switch (colorType) {\n        case COLOR_TYPE_SOLID_COLOR:\n          paint.setARGB(\n              (int) (mBrushData.length > 4 ? mBrushData[4] * opacity * 255 : opacity * 255),\n              (int) (mBrushData[1] * 255),\n              (int) (mBrushData[2] * 255),\n              (int) (mBrushData[3] * 255));\n          break;\n        case COLOR_TYPE_LINEAR_GRADIENT:\n          // For mBrushData format refer to LinearGradient and insertColorStopsIntoArray functions in ReactNativeART.js\n          if (mBrushData.length < 5) {\n            FLog.w(ReactConstants.TAG,\n              \"[ARTShapeShadowNode setupFillPaint] expects 5 elements, received \"\n              + mBrushData.length);\n            return false;\n          }\n          float gradientStartX = mBrushData[1] * mScale;\n          float gradientStartY = mBrushData[2] * mScale;\n          float gradientEndX = mBrushData[3] * mScale;\n          float gradientEndY = mBrushData[4] * mScale;\n          int stops = (mBrushData.length - 5) / 5;\n          int[] colors = null;\n          float[] positions = null;\n          if (stops > 0) {\n            colors = new int[stops];\n            positions = new float[stops];\n            for (int i=0; i<stops; i++) {\n              positions[i] = mBrushData[5 + 4*stops + i];\n              int r = (int) (255 * mBrushData[5 + 4*i + 0]);\n              int g = (int) (255 * mBrushData[5 + 4*i + 1]);\n              int b = (int) (255 * mBrushData[5 + 4*i + 2]);\n              int a = (int) (255 * mBrushData[5 + 4*i + 3]);\n              colors[i] = Color.argb(a, r, g, b);\n            }\n          }\n          paint.setShader(\n            new LinearGradient(\n              gradientStartX, gradientStartY,\n              gradientEndX, gradientEndY,\n              colors, positions,\n              Shader.TileMode.CLAMP\n            )\n          );\n          break;\n        case COLOR_TYPE_RADIAL_GRADIENT:\n          // TODO(6352048): Support radial gradient etc.\n        case COLOR_TYPE_PATTERN:\n          // TODO(6352048): Support patterns etc.\n        default:\n          FLog.w(ReactConstants.TAG, \"ART: Color type \" + colorType + \" not supported!\");\n      }\n      return true;\n    }\n    return false;\n  }\n\n  /**\n   * Returns the floor modulus of the float arguments. Java modulus will return a negative remainder\n   * when the divisor is negative. Modulus should always be positive. This mimics the behavior of\n   * Math.floorMod, introduced in Java 8.\n   */\n  private float modulus(float x, float y) {\n    float remainder = x % y;\n    float modulus = remainder;\n    if (remainder < 0) {\n      modulus += y;\n    }\n    return modulus;\n  }\n\n  /**\n   * Creates a {@link Path} from an array of instructions constructed by JS\n   * (see ARTSerializablePath.js). Each instruction starts with a type (see PATH_TYPE_*) followed\n   * by arguments for that instruction. For example, to create a line the instruction will be\n   * 2 (PATH_LINE_TO), x, y. This will draw a line from the last draw point (or 0,0) to x,y.\n   *\n   * @param data the array of instructions\n   * @return the {@link Path} that can be drawn to a canvas\n   */\n  private Path createPath(float[] data) {\n    Path path = new Path();\n    path.moveTo(0, 0);\n    int i = 0;\n    while (i < data.length) {\n      int type = (int) data[i++];\n      switch (type) {\n        case PATH_TYPE_MOVETO:\n          path.moveTo(data[i++] * mScale, data[i++] * mScale);\n          break;\n        case PATH_TYPE_CLOSE:\n          path.close();\n          break;\n        case PATH_TYPE_LINETO:\n          path.lineTo(data[i++] * mScale, data[i++] * mScale);\n          break;\n        case PATH_TYPE_CURVETO:\n          path.cubicTo(\n              data[i++] * mScale,\n              data[i++] * mScale,\n              data[i++] * mScale,\n              data[i++] * mScale,\n              data[i++] * mScale,\n              data[i++] * mScale);\n          break;\n        case PATH_TYPE_ARC:\n        {\n          float x = data[i++] * mScale;\n          float y = data[i++] * mScale;\n          float r = data[i++] * mScale;\n          float start = (float) Math.toDegrees(data[i++]);\n          float end = (float) Math.toDegrees(data[i++]);\n\n          boolean counterClockwise = !(data[i++] == 1f);\n          float sweep = end - start;\n          if (Math.abs(sweep) >= 360) {\n            path.addCircle(x, y, r, counterClockwise ? Path.Direction.CCW : Path.Direction.CW);\n          } else {\n            sweep = modulus(sweep, 360);\n            if (counterClockwise && sweep < 360) {\n              // Counter-clockwise sweeps are negative\n              sweep = -1 * (360 - sweep);\n            }\n\n            RectF oval = new RectF(x - r, y - r, x + r, y + r);\n            path.arcTo(oval, start, sweep);\n          }\n          break;\n        }\n        default:\n          throw new JSApplicationIllegalArgumentException(\n              \"Unrecognized drawing instruction \" + type);\n      }\n    }\n    return path;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeViewManager.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.art;\n\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * ViewManager for shadowed ART shape views.\n */\n@ReactModule(name = ARTRenderableViewManager.CLASS_SHAPE)\npublic class ARTShapeViewManager extends ARTRenderableViewManager {\n\n  /* package */ ARTShapeViewManager() {\n    super(CLASS_SHAPE);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.art;\n\nimport android.content.Context;\nimport android.view.TextureView;\n\n/**\n * Custom {@link View} implementation that draws an ARTSurface React view and its children.\n */\npublic class ARTSurfaceView extends TextureView {\n  public ARTSurfaceView(Context context) {\n    super(context);\n    setOpaque(false);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.art;\n\nimport com.facebook.yoga.YogaMeasureMode;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaNode;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.BaseViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\n\n/**\n * ViewManager for ARTSurfaceView React views. Renders as a {@link ARTSurfaceView} and handles\n * invalidating the native view on shadow view updates happening in the underlying tree.\n */\n@ReactModule(name = ARTSurfaceViewManager.REACT_CLASS)\npublic class ARTSurfaceViewManager extends\n    BaseViewManager<ARTSurfaceView, ARTSurfaceViewShadowNode> {\n\n  protected static final String REACT_CLASS = \"ARTSurfaceView\";\n\n  private static final YogaMeasureFunction MEASURE_FUNCTION = new YogaMeasureFunction() {\n    @Override\n    public long measure(\n        YogaNode node,\n        float width,\n        YogaMeasureMode widthMode,\n        float height,\n        YogaMeasureMode heightMode) {\n      throw new IllegalStateException(\"SurfaceView should have explicit width and height set\");\n    }\n  };\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public ARTSurfaceViewShadowNode createShadowNodeInstance() {\n    ARTSurfaceViewShadowNode node = new ARTSurfaceViewShadowNode();\n    node.setMeasureFunction(MEASURE_FUNCTION);\n    return node;\n  }\n\n  @Override\n  public Class<ARTSurfaceViewShadowNode> getShadowNodeClass() {\n    return ARTSurfaceViewShadowNode.class;\n  }\n\n  @Override\n  protected ARTSurfaceView createViewInstance(ThemedReactContext reactContext) {\n    return new ARTSurfaceView(reactContext);\n  }\n\n  @Override\n  public void updateExtraData(ARTSurfaceView root, Object extraData) {\n    root.setSurfaceTextureListener((ARTSurfaceViewShadowNode) extraData);\n  }\n\n  @Override\n  public void setBackgroundColor(ARTSurfaceView view, int backgroundColor) {\n    // As of Android N TextureView does not support calling setBackground on it.\n    // It will also throw an exception when target SDK is set to N or higher.\n\n    // Setting the background color for this view is handled in the shadow node.\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.art;\n\nimport javax.annotation.Nullable;\n\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.Color;\nimport android.view.Surface;\nimport android.graphics.PorterDuff;\nimport android.graphics.SurfaceTexture;\nimport android.view.TextureView;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.uimanager.LayoutShadowNode;\nimport com.facebook.react.uimanager.UIViewOperationQueue;\nimport com.facebook.react.uimanager.ReactShadowNode;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\n\n/**\n * Shadow node for ART virtual tree root - ARTSurfaceView\n */\npublic class ARTSurfaceViewShadowNode extends LayoutShadowNode\n  implements TextureView.SurfaceTextureListener {\n\n  private @Nullable Surface mSurface;\n\n  private @Nullable Integer mBackgroundColor;\n\n  @ReactProp(name = ViewProps.BACKGROUND_COLOR, customType = \"Color\")\n  public void setBackgroundColor(Integer color) {\n    mBackgroundColor = color;\n    markUpdated();\n  }\n\n  @Override\n  public boolean isVirtual() {\n    return false;\n  }\n\n  @Override\n  public boolean isVirtualAnchor() {\n    return true;\n  }\n\n  @Override\n  public void onCollectExtraUpdates(UIViewOperationQueue uiUpdater) {\n    super.onCollectExtraUpdates(uiUpdater);\n    drawOutput();\n    uiUpdater.enqueueUpdateExtraData(getReactTag(), this);\n  }\n\n  private void drawOutput() {\n    if (mSurface == null || !mSurface.isValid()) {\n      markChildrenUpdatesSeen(this);\n      return;\n    }\n\n    try {\n      Canvas canvas = mSurface.lockCanvas(null);\n      canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);\n      if (mBackgroundColor != null) {\n        canvas.drawColor(mBackgroundColor);\n      }\n\n      Paint paint = new Paint();\n      for (int i = 0; i < getChildCount(); i++) {\n        ARTVirtualNode child = (ARTVirtualNode) getChildAt(i);\n        child.draw(canvas, paint, 1f);\n        child.markUpdateSeen();\n      }\n\n      if (mSurface == null) {\n        return;\n      }\n\n      mSurface.unlockCanvasAndPost(canvas);\n    } catch (IllegalArgumentException | IllegalStateException e) {\n      FLog.e(ReactConstants.TAG, e.getClass().getSimpleName() + \" in Surface.unlockCanvasAndPost\");\n    }\n  }\n\n  private void markChildrenUpdatesSeen(ReactShadowNode shadowNode) {\n    for (int i = 0; i < shadowNode.getChildCount(); i++) {\n      ReactShadowNode child = shadowNode.getChildAt(i);\n      child.markUpdateSeen();\n      markChildrenUpdatesSeen(child);\n    }\n  }\n\n  @Override\n  public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {\n    mSurface = new Surface(surface);\n    drawOutput();\n  }\n\n  @Override\n  public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {\n    surface.release();\n    mSurface = null;\n    return true;\n  }\n\n  @Override\n  public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {}\n\n  @Override\n  public void onSurfaceTextureUpdated(SurfaceTexture surface) {}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/art/ARTTextViewManager.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.art;\n\nimport com.facebook.react.module.annotations.ReactModule;\n\n/**\n * ViewManager for shadowed ART text views.\n */\n@ReactModule(name = ARTRenderableViewManager.CLASS_TEXT)\npublic class ARTTextViewManager extends ARTRenderableViewManager {\n\n  /* package */ ARTTextViewManager() {\n    super(CLASS_TEXT);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/art/ARTVirtualNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.art;\n\nimport android.graphics.Canvas;\nimport android.graphics.Matrix;\nimport android.graphics.Paint;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.uimanager.DisplayMetricsHolder;\nimport com.facebook.react.uimanager.ReactShadowNodeImpl;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport javax.annotation.Nullable;\n\n/**\n * Base class for ARTView virtual nodes: {@link ARTGroupShadowNode}, {@link ARTShapeShadowNode} and\n * indirectly for {@link ARTTextShadowNode}.\n */\npublic abstract class ARTVirtualNode extends ReactShadowNodeImpl {\n\n  protected static final float MIN_OPACITY_FOR_DRAW = 0.01f;\n\n  private static final float[] sMatrixData = new float[9];\n  private static final float[] sRawMatrix = new float[9];\n\n  protected float mOpacity = 1f;\n  private @Nullable Matrix mMatrix = new Matrix();\n\n  protected final float mScale;\n\n  public ARTVirtualNode() {\n    mScale = DisplayMetricsHolder.getWindowDisplayMetrics().density;\n  }\n\n  @Override\n  public boolean isVirtual() {\n    return true;\n  }\n\n  public abstract void draw(Canvas canvas, Paint paint, float opacity);\n\n  /**\n   * Sets up the transform matrix on the canvas before an element is drawn.\n   *\n   * NB: for perf reasons this does not apply opacity, as that would mean creating a new canvas\n   * layer (which allocates an offscreen bitmap) and having it composited afterwards. Instead, the\n   * drawing code should apply opacity recursively.\n   *\n   * @param canvas the canvas to set up\n   */\n  protected final void saveAndSetupCanvas(Canvas canvas) {\n    canvas.save();\n    if (mMatrix != null) {\n      canvas.concat(mMatrix);\n    }\n  }\n\n  /**\n   * Restore the canvas after an element was drawn. This is always called in mirror with\n   * {@link #saveAndSetupCanvas}.\n   *\n   * @param canvas the canvas to restore\n   */\n  protected void restoreCanvas(Canvas canvas) {\n    canvas.restore();\n  }\n\n  @ReactProp(name = \"opacity\", defaultFloat = 1f)\n  public void setOpacity(float opacity) {\n    mOpacity = opacity;\n    markUpdated();\n  }\n\n  @ReactProp(name = \"transform\")\n  public void setTransform(@Nullable ReadableArray transformArray) {\n    if (transformArray != null) {\n      int matrixSize = PropHelper.toFloatArray(transformArray, sMatrixData);\n      if (matrixSize == 6) {\n        setupMatrix();\n      } else if (matrixSize != -1) {\n        throw new JSApplicationIllegalArgumentException(\"Transform matrices must be of size 6\");\n      }\n    } else {\n      mMatrix = null;\n    }\n    markUpdated();\n  }\n\n  protected void setupMatrix() {\n    sRawMatrix[0] = sMatrixData[0];\n    sRawMatrix[1] = sMatrixData[2];\n    sRawMatrix[2] = sMatrixData[4] * mScale;\n    sRawMatrix[3] = sMatrixData[1];\n    sRawMatrix[4] = sMatrixData[3];\n    sRawMatrix[5] = sMatrixData[5] * mScale;\n    sRawMatrix[6] = 0;\n    sRawMatrix[7] = 0;\n    sRawMatrix[8] = 1;\n    if (mMatrix == null) {\n      mMatrix = new Matrix();\n    }\n    mMatrix.setValues(sRawMatrix);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/art/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"art\",\n    srcs = glob([\"*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/checkbox/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"checkbox\",\n    srcs = glob([\"*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBox.java",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc. All rights reserved.\n *\n * <p>This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\npackage com.facebook.react.views.checkbox;\n\nimport android.content.Context;\nimport android.widget.CheckBox;\n\n/** CheckBox that has its value controlled by JS. */\n/*package*/ class ReactCheckBox extends CheckBox {\n\n  private boolean mAllowChange;\n\n  public ReactCheckBox(Context context) {\n    super(context);\n    mAllowChange = true;\n  }\n\n  @Override\n  public void setChecked(boolean checked) {\n    if (mAllowChange) {\n      mAllowChange = false;\n      super.setChecked(checked);\n    }\n  }\n\n  /*package*/ void setOn(boolean on) {\n    // If the checkbox has a different value than the value sent by JS, we must change it.\n    if (isChecked() != on) {\n      super.setChecked(on);\n    }\n    mAllowChange = true;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBoxEvent.java",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc. All rights reserved.\n *\n * <p>This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\npackage com.facebook.react.views.checkbox;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/** Event emitted by a ReactCheckBoxManager once a checkbox is manipulated. */\n/*package*/ class ReactCheckBoxEvent extends Event<ReactCheckBoxEvent> {\n\n  public static final String EVENT_NAME = \"topChange\";\n\n  private final boolean mIsChecked;\n\n  public ReactCheckBoxEvent(int viewId, boolean isChecked) {\n    super(viewId);\n    mIsChecked = isChecked;\n  }\n\n  public boolean getIsChecked() {\n    return mIsChecked;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    // All checkbox events for a given view can be coalesced.\n    return 0;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putInt(\"target\", getViewTag());\n    eventData.putBoolean(\"value\", getIsChecked());\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBoxManager.java",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc. All rights reserved.\n *\n * <p>This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\npackage com.facebook.react.views.checkbox;\n\nimport android.widget.CompoundButton;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.uimanager.SimpleViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\n\n/** View manager for {@link ReactCheckBox} components. */\npublic class ReactCheckBoxManager extends SimpleViewManager<ReactCheckBox> {\n\n  private static final String REACT_CLASS = \"AndroidCheckBox\";\n\n  private static final CompoundButton.OnCheckedChangeListener ON_CHECKED_CHANGE_LISTENER =\n      new CompoundButton.OnCheckedChangeListener() {\n        @Override\n        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n          ReactContext reactContext = (ReactContext) buttonView.getContext();\n          reactContext\n              .getNativeModule(UIManagerModule.class)\n              .getEventDispatcher()\n              .dispatchEvent(new ReactCheckBoxEvent(buttonView.getId(), isChecked));\n        }\n      };\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  protected void addEventEmitters(final ThemedReactContext reactContext, final ReactCheckBox view) {\n    view.setOnCheckedChangeListener(ON_CHECKED_CHANGE_LISTENER);\n  }\n\n  @Override\n  protected ReactCheckBox createViewInstance(ThemedReactContext context) {\n    ReactCheckBox view = new ReactCheckBox(context);\n    return view;\n  }\n\n  @ReactProp(name = ViewProps.ENABLED, defaultBoolean = true)\n  public void setEnabled(ReactCheckBox view, boolean enabled) {\n    view.setEnabled(enabled);\n  }\n\n  @ReactProp(name = ViewProps.ON)\n  public void setOn(ReactCheckBox view, boolean on) {\n    // we set the checked change listener to null and then restore it so that we don't fire an\n    // onChange event to JS when JS itself is updating the value of the checkbox\n    view.setOnCheckedChangeListener(null);\n    view.setOn(on);\n    view.setOnCheckedChangeListener(ON_CHECKED_CHANGE_LISTENER);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/common/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"common\",\n    srcs = glob([\"*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/common/ViewHelper.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.common;\n\nimport android.graphics.drawable.Drawable;\nimport android.os.Build;\nimport android.view.View;\n\n/** Helper class for Views */\npublic class ViewHelper {\n\n  /**\n   * Set the background to a given Drawable, or remove the background. It calls {@link\n   * View#setBackground(Drawable)} or {@link View#setBackgroundDrawable(Drawable)} based on the sdk\n   * version.\n   *\n   * @param view {@link View} to apply the background.\n   * @param drawable {@link Drawable} The Drawable to use as the background, or null to remove the\n   *     background\n   */\n  public static void setBackground(View view, Drawable drawable) {\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n      view.setBackground(drawable);\n    } else {\n      view.setBackgroundDrawable(drawable);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/drawer/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"drawer\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/scroll:scroll\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.drawer;\n\nimport javax.annotation.Nullable;\n\nimport java.lang.reflect.Method;\nimport java.util.Map;\n\nimport android.os.Build;\nimport android.support.v4.widget.DrawerLayout;\nimport android.view.Gravity;\nimport android.view.View;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewGroupManager;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.views.drawer.events.DrawerClosedEvent;\nimport com.facebook.react.views.drawer.events.DrawerOpenedEvent;\nimport com.facebook.react.views.drawer.events.DrawerSlideEvent;\nimport com.facebook.react.views.drawer.events.DrawerStateChangedEvent;\n\n/**\n * View Manager for {@link ReactDrawerLayout} components.\n */\n@ReactModule(name = ReactDrawerLayoutManager.REACT_CLASS)\npublic class ReactDrawerLayoutManager extends ViewGroupManager<ReactDrawerLayout> {\n\n  protected static final String REACT_CLASS = \"AndroidDrawerLayout\";\n\n  public static final int OPEN_DRAWER = 1;\n  public static final int CLOSE_DRAWER = 2;\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  protected void addEventEmitters(ThemedReactContext reactContext, ReactDrawerLayout view) {\n    view.setDrawerListener(\n        new DrawerEventEmitter(\n            view,\n            reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()));\n  }\n\n  @Override\n  protected ReactDrawerLayout createViewInstance(ThemedReactContext context) {\n    return new ReactDrawerLayout(context);\n  }\n\n  @ReactProp(name = \"drawerPosition\", defaultInt = Gravity.START)\n  public void setDrawerPosition(ReactDrawerLayout view, int drawerPosition) {\n    if (Gravity.START == drawerPosition || Gravity.END == drawerPosition) {\n      view.setDrawerPosition(drawerPosition);\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Unknown drawerPosition \" + drawerPosition);\n    }\n  }\n\n  @ReactProp(name = \"drawerWidth\", defaultFloat = Float.NaN)\n  public void getDrawerWidth(ReactDrawerLayout view, float width) {\n    int widthInPx = Float.isNaN(width) ?\n        ReactDrawerLayout.DEFAULT_DRAWER_WIDTH : Math.round(PixelUtil.toPixelFromDIP(width));\n    view.setDrawerWidth(widthInPx);\n  }\n\n  @ReactProp(name = \"drawerLockMode\")\n  public void setDrawerLockMode(ReactDrawerLayout view, @Nullable String drawerLockMode) {\n    if (drawerLockMode == null || \"unlocked\".equals(drawerLockMode)) {\n      view.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);\n    } else if (\"locked-closed\".equals(drawerLockMode)) {\n      view.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n    } else if (\"locked-open\".equals(drawerLockMode)) {\n      view.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN);\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Unknown drawerLockMode \" + drawerLockMode);\n    }\n  }\n\n  @Override\n  public void setElevation(ReactDrawerLayout view, float elevation) {\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n      // Facebook is using an older version of the support lib internally that doesn't support\n      // setDrawerElevation so we invoke it using reflection.\n      // TODO: Call the method directly when this is no longer needed.\n      try {\n        Method method = ReactDrawerLayout.class.getMethod(\"setDrawerElevation\", float.class);\n        method.invoke(view, PixelUtil.toPixelFromDIP(elevation));\n      } catch (Exception ex) {\n        FLog.w(\n            ReactConstants.TAG,\n            \"setDrawerElevation is not available in this version of the support lib.\",\n            ex);\n      }\n    }\n  }\n\n  @Override\n  public boolean needsCustomLayoutForChildren() {\n    // Return true, since DrawerLayout will lay out it's own children.\n    return true;\n  }\n\n  @Override\n  public @Nullable Map<String, Integer> getCommandsMap() {\n    return MapBuilder.of(\"openDrawer\", OPEN_DRAWER, \"closeDrawer\", CLOSE_DRAWER);\n  }\n\n  @Override\n  public void receiveCommand(\n      ReactDrawerLayout root,\n      int commandId,\n      @Nullable ReadableArray args) {\n    switch (commandId) {\n      case OPEN_DRAWER:\n        root.openDrawer();\n        break;\n      case CLOSE_DRAWER:\n        root.closeDrawer();\n        break;\n    }\n  }\n\n  @Override\n  public @Nullable Map getExportedViewConstants() {\n    return MapBuilder.of(\n        \"DrawerPosition\",\n        MapBuilder.of(\"Left\", Gravity.START, \"Right\", Gravity.END));\n  }\n\n  @Override\n  public @Nullable Map getExportedCustomDirectEventTypeConstants() {\n    return MapBuilder.of(\n        DrawerSlideEvent.EVENT_NAME, MapBuilder.of(\"registrationName\", \"onDrawerSlide\"),\n        DrawerOpenedEvent.EVENT_NAME, MapBuilder.of(\"registrationName\", \"onDrawerOpen\"),\n        DrawerClosedEvent.EVENT_NAME, MapBuilder.of(\"registrationName\", \"onDrawerClose\"),\n        DrawerStateChangedEvent.EVENT_NAME, MapBuilder.of(\n            \"registrationName\", \"onDrawerStateChanged\"));\n  }\n\n  /**\n   * This method is overridden because of two reasons:\n   * 1. A drawer must have exactly two children\n   * 2. The second child that is added, is the navigationView, which gets panned from the side.\n   */\n  @Override\n  public void addView(ReactDrawerLayout parent, View child, int index) {\n    if (getChildCount(parent) >= 2) {\n      throw new\n          JSApplicationIllegalArgumentException(\"The Drawer cannot have more than two children\");\n    }\n    if (index != 0 && index != 1) {\n      throw new JSApplicationIllegalArgumentException(\n          \"The only valid indices for drawer's child are 0 or 1. Got \" + index + \" instead.\");\n    }\n    parent.addView(child, index);\n    parent.setDrawerProperties();\n  }\n\n  public static class DrawerEventEmitter implements DrawerLayout.DrawerListener {\n\n    private final DrawerLayout mDrawerLayout;\n    private final EventDispatcher mEventDispatcher;\n\n    public DrawerEventEmitter(DrawerLayout drawerLayout, EventDispatcher eventDispatcher) {\n      mDrawerLayout = drawerLayout;\n      mEventDispatcher = eventDispatcher;\n    }\n\n    @Override\n    public void onDrawerSlide(View view, float v) {\n      mEventDispatcher.dispatchEvent(\n          new DrawerSlideEvent(mDrawerLayout.getId(), v));\n    }\n\n    @Override\n    public void onDrawerOpened(View view) {\n      mEventDispatcher.dispatchEvent(\n        new DrawerOpenedEvent(mDrawerLayout.getId()));\n    }\n\n    @Override\n    public void onDrawerClosed(View view) {\n      mEventDispatcher.dispatchEvent(\n          new DrawerClosedEvent(mDrawerLayout.getId()));\n    }\n\n    @Override\n    public void onDrawerStateChanged(int i) {\n      mEventDispatcher.dispatchEvent(\n          new DrawerStateChangedEvent(mDrawerLayout.getId(), i));\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerClosedEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.drawer.events;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\npublic class DrawerClosedEvent extends Event<DrawerClosedEvent> {\n\n  public static final String EVENT_NAME = \"topDrawerClosed\";\n\n  public DrawerClosedEvent(int viewId) {\n    super(viewId);\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    // All events for a given view can be coalesced.\n    return 0;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), Arguments.createMap());\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerOpenedEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.drawer.events;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\npublic class DrawerOpenedEvent extends Event<DrawerOpenedEvent> {\n\n  public static final String EVENT_NAME = \"topDrawerOpened\";\n\n  public DrawerOpenedEvent(int viewId) {\n    super(viewId);\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    // All events for a given view can be coalesced.\n    return 0;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), Arguments.createMap());\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerSlideEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.drawer.events;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by a DrawerLayout as it is being moved open/closed.\n */\npublic class DrawerSlideEvent extends Event<DrawerSlideEvent> {\n\n  public static final String EVENT_NAME = \"topDrawerSlide\";\n\n  private final float mOffset;\n\n  public DrawerSlideEvent(int viewId, float offset) {\n    super(viewId);\n    mOffset = offset;\n  }\n\n  public float getOffset() {\n    return mOffset;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    // All slide events for a given view can be coalesced.\n    return 0;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putDouble(\"offset\", getOffset());\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerStateChangedEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.drawer.events;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\npublic class DrawerStateChangedEvent extends Event<DrawerStateChangedEvent> {\n\n  public static final String EVENT_NAME = \"topDrawerStateChanged\";\n\n  private final int mDrawerState;\n\n  public DrawerStateChangedEvent(int viewId, int drawerState) {\n    super(viewId);\n    mDrawerState = drawerState;\n  }\n\n  public int getDrawerState() {\n    return mDrawerState;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    // All events for a given view can be coalesced.\n    return 0;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putDouble(\"drawerState\", getDrawerState());\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/image/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nIMAGE_EVENT_FILES = [\n    \"ImageLoadEvent.java\",\n]\n\nandroid_library(\n    name = \"imageevents\",\n    srcs = IMAGE_EVENT_FILES,\n    provided_deps = [\n        react_native_dep(\"third-party/android/support-annotations:android-support-annotations\"),\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    required_for_source_only_abi = True,\n    visibility = [\"PUBLIC\"],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n    ],\n)\n\nandroid_library(\n    name = \"image\",\n    srcs = glob(\n        [\"*.java\"],\n        excludes = IMAGE_EVENT_FILES,\n    ),\n    exported_deps = [\n        \":imageevents\",\n    ],\n    provided_deps = [\n        react_native_dep(\"third-party/android/support-annotations:android-support-annotations\"),\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"libraries/fresco/fresco-react-native:fbcore\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-drawee\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-react-native\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:imagepipeline\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/modules/fresco:fresco\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/imagehelper:withmultisource\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/image/GlobalImageLoadListener.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.image;\n\nimport android.net.Uri;\n\n/** Listener interface for global image loading events. */\npublic interface GlobalImageLoadListener {\n\n  /** Called when a source has been set on an ImageView, but before it is actually loaded. */\n  void onLoadAttempt(Uri uri);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/image/ImageLoadEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.image;\n\nimport javax.annotation.Nullable;\n\nimport android.support.annotation.IntDef;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\n\npublic class ImageLoadEvent extends Event<ImageLoadEvent> {\n  @IntDef({ON_ERROR, ON_LOAD, ON_LOAD_END, ON_LOAD_START, ON_PROGRESS})\n  @Retention(RetentionPolicy.SOURCE)\n  @interface ImageEventType {}\n\n  // Currently ON_PROGRESS is not implemented, these can be added\n  // easily once support exists in fresco.\n  public static final int ON_ERROR = 1;\n  public static final int ON_LOAD = 2;\n  public static final int ON_LOAD_END = 3;\n  public static final int ON_LOAD_START = 4;\n  public static final int ON_PROGRESS = 5;\n\n  private final int mEventType;\n  private final @Nullable String mImageUri;\n  private final int mWidth;\n  private final int mHeight;\n\n  public ImageLoadEvent(int viewId, @ImageEventType int eventType) {\n    this(viewId, eventType, null);\n  }\n\n  public ImageLoadEvent(int viewId, @ImageEventType int eventType, String imageUri) {\n    this(viewId, eventType, imageUri, 0, 0);\n  }\n\n  public ImageLoadEvent(\n    int viewId,\n    @ImageEventType int eventType,\n    @Nullable String imageUri,\n    int width,\n    int height) {\n    super(viewId);\n    mEventType = eventType;\n    mImageUri = imageUri;\n    mWidth = width;\n    mHeight = height;\n  }\n\n  public static String eventNameForType(@ImageEventType int eventType) {\n    switch (eventType) {\n      case ON_ERROR:\n        return \"topError\";\n      case ON_LOAD:\n        return \"topLoad\";\n      case ON_LOAD_END:\n        return \"topLoadEnd\";\n      case ON_LOAD_START:\n        return \"topLoadStart\";\n      case ON_PROGRESS:\n        return \"topProgress\";\n      default:\n        throw new IllegalStateException(\"Invalid image event: \" + Integer.toString(eventType));\n    }\n  }\n\n  @Override\n  public String getEventName() {\n    return ImageLoadEvent.eventNameForType(mEventType);\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    // Intentionally casting mEventType because it is guaranteed to be small\n    // enough to fit into short.\n    return (short) mEventType;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    WritableMap eventData = null;\n\n    if (mImageUri != null || mEventType == ON_LOAD) {\n      eventData = Arguments.createMap();\n\n      if (mImageUri != null) {\n        eventData.putString(\"uri\", mImageUri);\n      }\n\n      if (mEventType == ON_LOAD) {\n        WritableMap source = Arguments.createMap();\n        source.putDouble(\"width\", mWidth);\n        source.putDouble(\"height\", mHeight);\n        if (mImageUri != null) {\n          source.putString(\"url\", mImageUri);\n        }\n        eventData.putMap(\"source\", source);\n      }\n    }\n\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), eventData);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/image/ImageResizeMethod.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.image;\n\npublic enum ImageResizeMethod {\n  AUTO,\n  RESIZE,\n  SCALE\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/image/ImageResizeMode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.image;\n\nimport javax.annotation.Nullable;\n\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.drawee.drawable.ScalingUtils;\n\n/**\n * Converts JS resize modes into Android-specific scale type.\n */\npublic class ImageResizeMode {\n\n  /**\n   * Converts JS resize modes into {@code ScalingUtils.ScaleType}.\n   * See {@code ImageResizeMode.js}.\n   */\n  public static ScalingUtils.ScaleType toScaleType(@Nullable String resizeModeValue) {\n    if (\"contain\".equals(resizeModeValue)) {\n      return ScalingUtils.ScaleType.FIT_CENTER;\n    }\n    if (\"cover\".equals(resizeModeValue)) {\n      return ScalingUtils.ScaleType.CENTER_CROP;\n    }\n    if (\"stretch\".equals(resizeModeValue)) {\n      return ScalingUtils.ScaleType.FIT_XY;\n    }\n    if (\"center\".equals(resizeModeValue)) {\n      return ScalingUtils.ScaleType.CENTER_INSIDE;\n    }\n    if (resizeModeValue == null) {\n      // Use the default. Never use null.\n      return defaultValue();\n    }\n    throw new JSApplicationIllegalArgumentException(\n        \"Invalid resize mode: '\" + resizeModeValue + \"'\");\n  }\n\n  /**\n   * This is the default as per web and iOS.\n   * We want to be consistent across platforms.\n   */\n  public static ScalingUtils.ScaleType defaultValue() {\n    return ScalingUtils.ScaleType.CENTER_CROP;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.image;\n\nimport android.graphics.Color;\nimport android.graphics.PorterDuff.Mode;\nimport com.facebook.drawee.backends.pipeline.Fresco;\nimport com.facebook.drawee.controller.AbstractDraweeControllerBuilder;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.SimpleViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport com.facebook.yoga.YogaConstants;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n@ReactModule(name = ReactImageManager.REACT_CLASS)\npublic class ReactImageManager extends SimpleViewManager<ReactImageView> {\n\n  protected static final String REACT_CLASS = \"RCTImageView\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  private @Nullable AbstractDraweeControllerBuilder mDraweeControllerBuilder;\n  private @Nullable GlobalImageLoadListener mGlobalImageLoadListener;\n  private final @Nullable Object mCallerContext;\n\n  public ReactImageManager(\n      AbstractDraweeControllerBuilder draweeControllerBuilder, Object callerContext) {\n    this(draweeControllerBuilder, null, callerContext);\n  }\n\n  public ReactImageManager(\n      AbstractDraweeControllerBuilder draweeControllerBuilder,\n      @Nullable GlobalImageLoadListener globalImageLoadListener,\n      Object callerContext) {\n    mDraweeControllerBuilder = draweeControllerBuilder;\n    mGlobalImageLoadListener = globalImageLoadListener;\n    mCallerContext = callerContext;\n  }\n\n  public ReactImageManager() {\n    // Lazily initialize as FrescoModule have not been initialized yet\n    mDraweeControllerBuilder = null;\n    mCallerContext = null;\n  }\n\n  public AbstractDraweeControllerBuilder getDraweeControllerBuilder() {\n    if (mDraweeControllerBuilder == null) {\n      mDraweeControllerBuilder = Fresco.newDraweeControllerBuilder();\n    }\n    return mDraweeControllerBuilder;\n  }\n\n  public Object getCallerContext() {\n    return mCallerContext;\n  }\n\n  @Override\n  public ReactImageView createViewInstance(ThemedReactContext context) {\n    return new ReactImageView(\n        context, getDraweeControllerBuilder(), mGlobalImageLoadListener, getCallerContext());\n  }\n\n  // In JS this is Image.props.source\n  @ReactProp(name = \"src\")\n  public void setSource(ReactImageView view, @Nullable ReadableArray sources) {\n    view.setSource(sources);\n  }\n\n  @ReactProp(name = \"blurRadius\")\n  public void setBlurRadius(ReactImageView view, float blurRadius) {\n    view.setBlurRadius(blurRadius);\n  }\n\n  // In JS this is Image.props.loadingIndicatorSource.uri\n  @ReactProp(name = \"loadingIndicatorSrc\")\n  public void setLoadingIndicatorSource(ReactImageView view, @Nullable String source) {\n    view.setLoadingIndicatorSource(source);\n  }\n\n  @ReactProp(name = \"borderColor\", customType = \"Color\")\n  public void setBorderColor(ReactImageView view, @Nullable Integer borderColor) {\n    if (borderColor == null) {\n      view.setBorderColor(Color.TRANSPARENT);\n    } else {\n      view.setBorderColor(borderColor);\n    }\n  }\n\n  @ReactProp(name = \"overlayColor\")\n  public void setOverlayColor(ReactImageView view, @Nullable Integer overlayColor) {\n    if (overlayColor == null) {\n      view.setOverlayColor(Color.TRANSPARENT);\n    } else {\n      view.setOverlayColor(overlayColor);\n    }\n  }\n\n  @ReactProp(name = \"borderWidth\")\n  public void setBorderWidth(ReactImageView view, float borderWidth) {\n    view.setBorderWidth(borderWidth);\n  }\n\n  @ReactPropGroup(names = {\n      ViewProps.BORDER_RADIUS,\n      ViewProps.BORDER_TOP_LEFT_RADIUS,\n      ViewProps.BORDER_TOP_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_LEFT_RADIUS\n  }, defaultFloat = YogaConstants.UNDEFINED)\n  public void setBorderRadius(ReactImageView view, int index, float borderRadius) {\n    if (!YogaConstants.isUndefined(borderRadius)) {\n      borderRadius = PixelUtil.toPixelFromDIP(borderRadius);\n    }\n\n    if (index == 0) {\n      view.setBorderRadius(borderRadius);\n    } else {\n      view.setBorderRadius(borderRadius, index - 1);\n    }\n  }\n\n  @ReactProp(name = ViewProps.RESIZE_MODE)\n  public void setResizeMode(ReactImageView view, @Nullable String resizeMode) {\n    view.setScaleType(ImageResizeMode.toScaleType(resizeMode));\n  }\n\n  @ReactProp(name = ViewProps.RESIZE_METHOD)\n  public void setResizeMethod(ReactImageView view, @Nullable String resizeMethod) {\n    if (resizeMethod == null || \"auto\".equals(resizeMethod)) {\n      view.setResizeMethod(ImageResizeMethod.AUTO);\n    } else if (\"resize\".equals(resizeMethod)) {\n      view.setResizeMethod(ImageResizeMethod.RESIZE);\n    } else if (\"scale\".equals(resizeMethod)) {\n      view.setResizeMethod(ImageResizeMethod.SCALE);\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Invalid resize method: '\" + resizeMethod+ \"'\");\n    }\n  }\n\n  @ReactProp(name = \"tintColor\", customType = \"Color\")\n  public void setTintColor(ReactImageView view, @Nullable Integer tintColor) {\n    if (tintColor == null) {\n      view.clearColorFilter();\n    } else {\n      view.setColorFilter(tintColor, Mode.SRC_IN);\n    }\n  }\n\n  @ReactProp(name = \"progressiveRenderingEnabled\")\n  public void setProgressiveRenderingEnabled(ReactImageView view, boolean enabled) {\n    view.setProgressiveRenderingEnabled(enabled);\n  }\n\n  @ReactProp(name = \"fadeDuration\")\n  public void setFadeDuration(ReactImageView view, int durationMs) {\n    view.setFadeDuration(durationMs);\n  }\n\n  @ReactProp(name = \"shouldNotifyLoadEvents\")\n  public void setLoadHandlersRegistered(ReactImageView view, boolean shouldNotifyLoadEvents) {\n    view.setShouldNotifyLoadEvents(shouldNotifyLoadEvents);\n  }\n\n  @ReactProp(name = \"headers\")\n  public void setHeaders(ReactImageView view, ReadableMap headers) {\n    view.setHeaders(headers);\n  }\n\n  @Override\n  public @Nullable Map getExportedCustomDirectEventTypeConstants() {\n    return MapBuilder.of(\n      ImageLoadEvent.eventNameForType(ImageLoadEvent.ON_LOAD_START),\n        MapBuilder.of(\"registrationName\", \"onLoadStart\"),\n      ImageLoadEvent.eventNameForType(ImageLoadEvent.ON_LOAD),\n        MapBuilder.of(\"registrationName\", \"onLoad\"),\n      ImageLoadEvent.eventNameForType(ImageLoadEvent.ON_ERROR),\n        MapBuilder.of(\"registrationName\", \"onError\"),\n      ImageLoadEvent.eventNameForType(ImageLoadEvent.ON_LOAD_END),\n        MapBuilder.of(\"registrationName\", \"onLoadEnd\"));\n  }\n\n  @Override\n  protected void onAfterUpdateTransaction(ReactImageView view) {\n    super.onAfterUpdateTransaction(view);\n    view.maybeUpdateView();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.image;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapShader;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Matrix;\nimport android.graphics.Paint;\nimport android.graphics.Path;\nimport android.graphics.Rect;\nimport android.graphics.RectF;\nimport android.graphics.Shader;\nimport android.graphics.drawable.Animatable;\nimport android.graphics.drawable.Drawable;\nimport android.net.Uri;\nimport android.widget.Toast;\nimport com.facebook.common.util.UriUtil;\nimport com.facebook.drawee.controller.AbstractDraweeControllerBuilder;\nimport com.facebook.drawee.controller.BaseControllerListener;\nimport com.facebook.drawee.controller.ControllerListener;\nimport com.facebook.drawee.controller.ForwardingControllerListener;\nimport com.facebook.drawee.drawable.AutoRotateDrawable;\nimport com.facebook.drawee.drawable.ScalingUtils;\nimport com.facebook.drawee.generic.GenericDraweeHierarchy;\nimport com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;\nimport com.facebook.drawee.generic.RoundingParams;\nimport com.facebook.drawee.view.GenericDraweeView;\nimport com.facebook.imagepipeline.common.ResizeOptions;\nimport com.facebook.imagepipeline.image.ImageInfo;\nimport com.facebook.imagepipeline.postprocessors.IterativeBoxBlurPostProcessor;\nimport com.facebook.imagepipeline.request.BasePostprocessor;\nimport com.facebook.imagepipeline.request.ImageRequest;\nimport com.facebook.imagepipeline.request.ImageRequestBuilder;\nimport com.facebook.imagepipeline.request.Postprocessor;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.common.build.ReactBuildConfig;\nimport com.facebook.react.modules.fresco.ReactNetworkImageRequest;\nimport com.facebook.react.uimanager.FloatUtil;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.views.imagehelper.ImageSource;\nimport com.facebook.react.views.imagehelper.MultiSourceHelper;\nimport com.facebook.react.views.imagehelper.MultiSourceHelper.MultiSourceResult;\nimport com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;\nimport com.facebook.yoga.YogaConstants;\nimport java.util.Arrays;\nimport java.util.LinkedList;\nimport java.util.List;\nimport javax.annotation.Nullable;\n\n/**\n * Wrapper class around Fresco's GenericDraweeView, enabling persisting props across multiple view\n * update and consistent processing of both static and network images.\n */\npublic class ReactImageView extends GenericDraweeView {\n\n  public static final int REMOTE_IMAGE_FADE_DURATION_MS = 300;\n\n  private static float[] sComputedCornerRadii = new float[4];\n\n  /*\n   * Implementation note re rounded corners:\n   *\n   * Fresco's built-in rounded corners only work for 'cover' resize mode -\n   * this is a limitation in Android itself. Fresco has a workaround for this, but\n   * it requires knowing the background color.\n   *\n   * So for the other modes, we use a postprocessor.\n   * Because the postprocessor uses a modified bitmap, that would just get cropped in\n   * 'cover' mode, so we fall back to Fresco's normal implementation.\n   */\n  private static final Matrix sMatrix = new Matrix();\n  private static final Matrix sInverse = new Matrix();\n  private ImageResizeMethod mResizeMethod = ImageResizeMethod.AUTO;\n\n  private class RoundedCornerPostprocessor extends BasePostprocessor {\n\n    void getRadii(Bitmap source, float[] computedCornerRadii, float[] mappedRadii) {\n      mScaleType.getTransform(\n            sMatrix,\n            new Rect(0, 0, source.getWidth(), source.getHeight()),\n            source.getWidth(),\n            source.getHeight(),\n            0.0f,\n            0.0f);\n        sMatrix.invert(sInverse);\n\n        mappedRadii[0] = sInverse.mapRadius(computedCornerRadii[0]);\n        mappedRadii[1] = mappedRadii[0];\n\n        mappedRadii[2] = sInverse.mapRadius(computedCornerRadii[1]);\n        mappedRadii[3] = mappedRadii[2];\n\n        mappedRadii[4] = sInverse.mapRadius(computedCornerRadii[2]);\n        mappedRadii[5] = mappedRadii[4];\n\n        mappedRadii[6] = sInverse.mapRadius(computedCornerRadii[3]);\n        mappedRadii[7] = mappedRadii[6];\n    }\n\n    @Override\n    public void process(Bitmap output, Bitmap source) {\n      cornerRadii(sComputedCornerRadii);\n\n      output.setHasAlpha(true);\n      if (FloatUtil.floatsEqual(sComputedCornerRadii[0], 0f) &&\n          FloatUtil.floatsEqual(sComputedCornerRadii[1], 0f) &&\n          FloatUtil.floatsEqual(sComputedCornerRadii[2], 0f) &&\n          FloatUtil.floatsEqual(sComputedCornerRadii[3], 0f)) {\n        super.process(output, source);\n        return;\n      }\n      Paint paint = new Paint();\n      paint.setAntiAlias(true);\n      paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));\n      Canvas canvas = new Canvas(output);\n\n      float[] radii = new float[8];\n\n      getRadii(source, sComputedCornerRadii, radii);\n\n      Path pathForBorderRadius = new Path();\n\n      pathForBorderRadius.addRoundRect(\n          new RectF(0, 0, source.getWidth(), source.getHeight()),\n          radii,\n          Path.Direction.CW);\n\n      canvas.drawPath(pathForBorderRadius, paint);\n    }\n  }\n\n  private final List<ImageSource> mSources;\n\n  private @Nullable ImageSource mImageSource;\n  private @Nullable ImageSource mCachedImageSource;\n  private @Nullable Drawable mLoadingImageDrawable;\n  private int mBorderColor;\n  private int mOverlayColor;\n  private float mBorderWidth;\n  private float mBorderRadius = YogaConstants.UNDEFINED;\n  private @Nullable float[] mBorderCornerRadii;\n  private ScalingUtils.ScaleType mScaleType;\n  private boolean mIsDirty;\n  private final AbstractDraweeControllerBuilder mDraweeControllerBuilder;\n  private final RoundedCornerPostprocessor mRoundedCornerPostprocessor;\n  private @Nullable IterativeBoxBlurPostProcessor mIterativeBoxBlurPostProcessor;\n  private @Nullable ControllerListener mControllerListener;\n  private @Nullable ControllerListener mControllerForTesting;\n  private @Nullable GlobalImageLoadListener mGlobalImageLoadListener;\n  private final @Nullable Object mCallerContext;\n  private int mFadeDurationMs = -1;\n  private boolean mProgressiveRenderingEnabled;\n  private ReadableMap mHeaders;\n\n  // We can't specify rounding in XML, so have to do so here\n  private static GenericDraweeHierarchy buildHierarchy(Context context) {\n    return new GenericDraweeHierarchyBuilder(context.getResources())\n        .setRoundingParams(RoundingParams.fromCornersRadius(0))\n        .build();\n  }\n\n  public ReactImageView(\n      Context context,\n      AbstractDraweeControllerBuilder draweeControllerBuilder,\n      @Nullable GlobalImageLoadListener globalImageLoadListener,\n      @Nullable Object callerContext) {\n    super(context, buildHierarchy(context));\n    mScaleType = ImageResizeMode.defaultValue();\n    mDraweeControllerBuilder = draweeControllerBuilder;\n    mRoundedCornerPostprocessor = new RoundedCornerPostprocessor();\n    mGlobalImageLoadListener = globalImageLoadListener;\n    mCallerContext = callerContext;\n    mSources = new LinkedList<>();\n  }\n\n  public void setShouldNotifyLoadEvents(boolean shouldNotify) {\n    if (!shouldNotify) {\n      mControllerListener = null;\n    } else {\n      final EventDispatcher mEventDispatcher = ((ReactContext) getContext()).\n          getNativeModule(UIManagerModule.class).getEventDispatcher();\n\n      mControllerListener = new BaseControllerListener<ImageInfo>() {\n        @Override\n        public void onSubmit(String id, Object callerContext) {\n          mEventDispatcher.dispatchEvent(\n              new ImageLoadEvent(getId(), ImageLoadEvent.ON_LOAD_START));\n        }\n\n        @Override\n        public void onFinalImageSet(\n            String id,\n            @Nullable final ImageInfo imageInfo,\n            @Nullable Animatable animatable) {\n          if (imageInfo != null) {\n            mEventDispatcher.dispatchEvent(\n              new ImageLoadEvent(getId(), ImageLoadEvent.ON_LOAD,\n                mImageSource.getSource(), imageInfo.getWidth(), imageInfo.getHeight()));\n            mEventDispatcher.dispatchEvent(\n              new ImageLoadEvent(getId(), ImageLoadEvent.ON_LOAD_END));\n          }\n        }\n\n        @Override\n        public void onFailure(String id, Throwable throwable) {\n          mEventDispatcher.dispatchEvent(\n            new ImageLoadEvent(getId(), ImageLoadEvent.ON_ERROR));\n          mEventDispatcher.dispatchEvent(\n            new ImageLoadEvent(getId(), ImageLoadEvent.ON_LOAD_END));\n        }\n      };\n    }\n\n    mIsDirty = true;\n  }\n\n  public void setBlurRadius(float blurRadius) {\n    int pixelBlurRadius = (int) PixelUtil.toPixelFromDIP(blurRadius);\n    if (pixelBlurRadius == 0) {\n      mIterativeBoxBlurPostProcessor = null;\n    } else {\n      mIterativeBoxBlurPostProcessor = new IterativeBoxBlurPostProcessor(pixelBlurRadius);\n    }\n    mIsDirty = true;\n  }\n\n  public void setBorderColor(int borderColor) {\n    mBorderColor = borderColor;\n    mIsDirty = true;\n  }\n\n  public void setOverlayColor(int overlayColor) {\n    mOverlayColor = overlayColor;\n    mIsDirty = true;\n  }\n\n  public void setBorderWidth(float borderWidth) {\n    mBorderWidth = PixelUtil.toPixelFromDIP(borderWidth);\n    mIsDirty = true;\n  }\n\n  public void setBorderRadius(float borderRadius) {\n    if (!FloatUtil.floatsEqual(mBorderRadius, borderRadius)) {\n      mBorderRadius = borderRadius;\n      mIsDirty = true;\n    }\n  }\n\n  public void setBorderRadius(float borderRadius, int position) {\n    if (mBorderCornerRadii == null) {\n      mBorderCornerRadii = new float[4];\n      Arrays.fill(mBorderCornerRadii, YogaConstants.UNDEFINED);\n    }\n\n    if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], borderRadius)) {\n      mBorderCornerRadii[position] = borderRadius;\n      mIsDirty = true;\n    }\n  }\n\n  public void setScaleType(ScalingUtils.ScaleType scaleType) {\n    mScaleType = scaleType;\n    mIsDirty = true;\n  }\n\n  public void setResizeMethod(ImageResizeMethod resizeMethod) {\n    mResizeMethod = resizeMethod;\n    mIsDirty = true;\n  }\n\n  public void setSource(@Nullable ReadableArray sources) {\n    mSources.clear();\n    if (sources != null && sources.size() != 0) {\n      // Optimize for the case where we have just one uri, case in which we don't need the sizes\n      if (sources.size() == 1) {\n        ReadableMap source = sources.getMap(0);\n        String uri = source.getString(\"uri\");\n        ImageSource imageSource = new ImageSource(getContext(), uri);\n        mSources.add(imageSource);\n        if (Uri.EMPTY.equals(imageSource.getUri())) {\n          warnImageSource(uri);\n        }\n      } else {\n        for (int idx = 0; idx < sources.size(); idx++) {\n          ReadableMap source = sources.getMap(idx);\n          String uri = source.getString(\"uri\");\n          ImageSource imageSource = new ImageSource(\n              getContext(),\n              uri,\n              source.getDouble(\"width\"),\n              source.getDouble(\"height\"));\n          mSources.add(imageSource);\n          if (Uri.EMPTY.equals(imageSource.getUri())) {\n            warnImageSource(uri);\n          }\n        }\n      }\n    }\n    mIsDirty = true;\n  }\n\n  public void setLoadingIndicatorSource(@Nullable String name) {\n    Drawable drawable = ResourceDrawableIdHelper.getInstance().getResourceDrawable(getContext(), name);\n    mLoadingImageDrawable =\n        drawable != null ? (Drawable) new AutoRotateDrawable(drawable, 1000) : null;\n    mIsDirty = true;\n  }\n\n  public void setProgressiveRenderingEnabled(boolean enabled) {\n    mProgressiveRenderingEnabled = enabled;\n    // no worth marking as dirty if it already rendered..\n  }\n\n  public void setFadeDuration(int durationMs) {\n    mFadeDurationMs = durationMs;\n    // no worth marking as dirty if it already rendered..\n  }\n\n  private void cornerRadii(float[] computedCorners) {\n    float defaultBorderRadius = !YogaConstants.isUndefined(mBorderRadius) ? mBorderRadius : 0;\n\n    computedCorners[0] = mBorderCornerRadii != null && !YogaConstants.isUndefined(mBorderCornerRadii[0]) ? mBorderCornerRadii[0] : defaultBorderRadius;\n    computedCorners[1] = mBorderCornerRadii != null && !YogaConstants.isUndefined(mBorderCornerRadii[1]) ? mBorderCornerRadii[1] : defaultBorderRadius;\n    computedCorners[2] = mBorderCornerRadii != null && !YogaConstants.isUndefined(mBorderCornerRadii[2]) ? mBorderCornerRadii[2] : defaultBorderRadius;\n    computedCorners[3] = mBorderCornerRadii != null && !YogaConstants.isUndefined(mBorderCornerRadii[3]) ? mBorderCornerRadii[3] : defaultBorderRadius;\n  }\n\n  public void setHeaders(ReadableMap headers) {\n    mHeaders = headers;\n  }\n\n  public void maybeUpdateView() {\n    if (!mIsDirty) {\n      return;\n    }\n\n    if (hasMultipleSources() && (getWidth() <= 0 || getHeight() <= 0)) {\n      // If we need to choose from multiple uris but the size is not yet set, wait for layout pass\n      return;\n    }\n\n    setSourceImage();\n    if (mImageSource == null) {\n      return;\n    }\n\n    boolean doResize = shouldResize(mImageSource);\n    if (doResize && (getWidth() <= 0 || getHeight() <= 0)) {\n      // If need a resize and the size is not yet set, wait until the layout pass provides one\n      return;\n    }\n\n    GenericDraweeHierarchy hierarchy = getHierarchy();\n    hierarchy.setActualImageScaleType(mScaleType);\n\n    if (mLoadingImageDrawable != null) {\n      hierarchy.setPlaceholderImage(mLoadingImageDrawable, ScalingUtils.ScaleType.CENTER);\n    }\n\n    boolean usePostprocessorScaling =\n        mScaleType != ScalingUtils.ScaleType.CENTER_CROP &&\n        mScaleType != ScalingUtils.ScaleType.FOCUS_CROP;\n\n    RoundingParams roundingParams = hierarchy.getRoundingParams();\n\n    if (usePostprocessorScaling) {\n      roundingParams.setCornersRadius(0);\n    } else {\n      cornerRadii(sComputedCornerRadii);\n\n      roundingParams.setCornersRadii(sComputedCornerRadii[0], sComputedCornerRadii[1], sComputedCornerRadii[2], sComputedCornerRadii[3]);\n    }\n\n    roundingParams.setBorder(mBorderColor, mBorderWidth);\n    if (mOverlayColor != Color.TRANSPARENT) {\n        roundingParams.setOverlayColor(mOverlayColor);\n    } else {\n        // make sure the default rounding method is used.\n        roundingParams.setRoundingMethod(RoundingParams.RoundingMethod.BITMAP_ONLY);\n    }\n    hierarchy.setRoundingParams(roundingParams);\n    hierarchy.setFadeDuration(\n        mFadeDurationMs >= 0\n            ? mFadeDurationMs\n            : mImageSource.isResource() ? 0 : REMOTE_IMAGE_FADE_DURATION_MS);\n\n    // TODO: t13601664 Support multiple PostProcessors\n    Postprocessor postprocessor = null;\n    if (usePostprocessorScaling) {\n      postprocessor = mRoundedCornerPostprocessor;\n    } else if (mIterativeBoxBlurPostProcessor != null) {\n      postprocessor = mIterativeBoxBlurPostProcessor;\n    }\n\n    ResizeOptions resizeOptions = doResize ? new ResizeOptions(getWidth(), getHeight()) : null;\n\n    ImageRequestBuilder imageRequestBuilder = ImageRequestBuilder.newBuilderWithSource(mImageSource.getUri())\n        .setPostprocessor(postprocessor)\n        .setResizeOptions(resizeOptions)\n        .setAutoRotateEnabled(true)\n        .setProgressiveRenderingEnabled(mProgressiveRenderingEnabled);\n\n    ImageRequest imageRequest = ReactNetworkImageRequest.fromBuilderWithHeaders(imageRequestBuilder, mHeaders);\n\n    if (mGlobalImageLoadListener != null) {\n      mGlobalImageLoadListener.onLoadAttempt(mImageSource.getUri());\n    }\n\n    // This builder is reused\n    mDraweeControllerBuilder.reset();\n\n    mDraweeControllerBuilder\n        .setAutoPlayAnimations(true)\n        .setCallerContext(mCallerContext)\n        .setOldController(getController())\n        .setImageRequest(imageRequest);\n\n    if (mCachedImageSource != null) {\n      ImageRequest cachedImageRequest =\n        ImageRequestBuilder.newBuilderWithSource(mCachedImageSource.getUri())\n          .setPostprocessor(postprocessor)\n          .setResizeOptions(resizeOptions)\n          .setAutoRotateEnabled(true)\n          .setProgressiveRenderingEnabled(mProgressiveRenderingEnabled)\n          .build();\n      mDraweeControllerBuilder.setLowResImageRequest(cachedImageRequest);\n    }\n\n    if (mControllerListener != null && mControllerForTesting != null) {\n      ForwardingControllerListener combinedListener = new ForwardingControllerListener();\n      combinedListener.addListener(mControllerListener);\n      combinedListener.addListener(mControllerForTesting);\n      mDraweeControllerBuilder.setControllerListener(combinedListener);\n    } else if (mControllerForTesting != null) {\n      mDraweeControllerBuilder.setControllerListener(mControllerForTesting);\n    } else if (mControllerListener != null) {\n      mDraweeControllerBuilder.setControllerListener(mControllerListener);\n    }\n\n    setController(mDraweeControllerBuilder.build());\n    mIsDirty = false;\n\n    // Reset again so the DraweeControllerBuilder clears all it's references. Otherwise, this causes\n    // a memory leak.\n    mDraweeControllerBuilder.reset();\n  }\n\n  // VisibleForTesting\n  public void setControllerListener(ControllerListener controllerListener) {\n    mControllerForTesting = controllerListener;\n    mIsDirty = true;\n    maybeUpdateView();\n  }\n\n  @Override\n  protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n    super.onSizeChanged(w, h, oldw, oldh);\n    if (w > 0 && h > 0) {\n      mIsDirty = mIsDirty || hasMultipleSources();\n      maybeUpdateView();\n    }\n  }\n\n  /**\n   * ReactImageViews only render a single image.\n   */\n  @Override\n  public boolean hasOverlappingRendering() {\n    return false;\n  }\n\n  private boolean hasMultipleSources() {\n    return mSources.size() > 1;\n  }\n\n  private void setSourceImage() {\n    mImageSource = null;\n    if (mSources.isEmpty()) {\n      return;\n    }\n    if (hasMultipleSources()) {\n      MultiSourceResult multiSource =\n        MultiSourceHelper.getBestSourceForSize(getWidth(), getHeight(), mSources);\n      mImageSource = multiSource.getBestResult();\n      mCachedImageSource = multiSource.getBestResultInCache();\n      return;\n    }\n\n    mImageSource = mSources.get(0);\n  }\n\n  private boolean shouldResize(ImageSource imageSource) {\n    // Resizing is inferior to scaling. See http://frescolib.org/docs/resizing-rotating.html#_\n    // We resize here only for images likely to be from the device's camera, where the app developer\n    // has no control over the original size\n    if (mResizeMethod == ImageResizeMethod.AUTO) {\n      return\n        UriUtil.isLocalContentUri(imageSource.getUri()) ||\n        UriUtil.isLocalFileUri(imageSource.getUri());\n    } else if (mResizeMethod == ImageResizeMethod.RESIZE) {\n      return true;\n    } else {\n      return false;\n    }\n  }\n\n  private void warnImageSource(String uri) {\n    if (ReactBuildConfig.DEBUG) {\n      Toast.makeText(\n        getContext(),\n        \"Warning: Image source \\\"\" + uri + \"\\\" doesn't exist\",\n        Toast.LENGTH_SHORT).show();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"imagehelper\",\n    srcs = glob(\n        [\"*.java\"],\n        excludes = [\"MultiSourceHelper.java\"],\n    ),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n\nandroid_library(\n    name = \"withmultisource\",\n    srcs = [\"MultiSourceHelper.java\"],\n    exported_deps = [\n        \":imagehelper\",\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fresco/fresco-react-native:imagepipeline\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/ImageSource.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.imagehelper;\n\nimport javax.annotation.Nullable;\n\nimport android.content.Context;\nimport android.net.Uri;\n\nimport com.facebook.infer.annotation.Assertions;\n\n/**\n * Class describing an image source (network URI or resource) and size.\n */\npublic class ImageSource {\n\n  private @Nullable Uri mUri;\n  private String mSource;\n  private double mSize;\n  private boolean isResource;\n\n  public ImageSource(Context context, String source, double width, double height) {\n    mSource = source;\n    mSize = width * height;\n\n    // Important: we compute the URI here so that we don't need to hold a reference to the context,\n    // potentially causing leaks.\n    mUri = computeUri(context);\n  }\n\n  public ImageSource(Context context, String source) {\n    this(context, source, 0.0d, 0.0d);\n  }\n\n  /**\n   * Get the source of this image, as it was passed to the constructor.\n   */\n  public String getSource() {\n    return mSource;\n  }\n\n  /**\n   * Get the URI for this image - can be either a parsed network URI or a resource URI.\n   */\n  public Uri getUri() {\n    return Assertions.assertNotNull(mUri);\n  }\n\n  /**\n   * Get the area of this image.\n   */\n  public double getSize() {\n    return mSize;\n  }\n\n  /**\n   * Get whether this image source represents an Android resource or a network URI.\n   */\n  public boolean isResource() {\n    return isResource;\n  }\n\n  private Uri computeUri(Context context) {\n    try {\n      Uri uri = Uri.parse(mSource);\n      // Verify scheme is set, so that relative uri (used by static resources) are not handled.\n      return uri.getScheme() == null ? computeLocalUri(context) : uri;\n    } catch (Exception e) {\n      return computeLocalUri(context);\n    }\n  }\n\n  private Uri computeLocalUri(Context context) {\n    isResource = true;\n    return ResourceDrawableIdHelper.getInstance().getResourceDrawableUri(context, mSource);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/MultiSourceHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.imagehelper;\n\nimport javax.annotation.Nullable;\n\nimport java.util.List;\n\nimport com.facebook.imagepipeline.core.ImagePipeline;\nimport com.facebook.imagepipeline.core.ImagePipelineFactory;\nimport com.facebook.react.views.imagehelper.ImageSource;\n\n/**\n * Helper class for dealing with multisource images.\n */\npublic class MultiSourceHelper {\n\n  public static class MultiSourceResult {\n    private final @Nullable ImageSource bestResult;\n    private final @Nullable ImageSource bestResultInCache;\n\n    private MultiSourceResult(\n      @Nullable ImageSource bestResult,\n      @Nullable ImageSource bestResultInCache) {\n      this.bestResult = bestResult;\n      this.bestResultInCache = bestResultInCache;\n    }\n\n    /**\n     * Get the best result overall (closest in size to the view's size). Can be null if there were\n     * no sources to choose from, or if there were more than 1 sources but width/height were 0.\n     */\n    public @Nullable ImageSource getBestResult() {\n      return bestResult;\n    }\n\n    /**\n     * Get the best result (closest in size to the view's size) that is also in cache. If this would\n     * be the same as the source from {@link #getBestResult()}, this will return {@code null}\n     * instead.\n     */\n    public @Nullable ImageSource getBestResultInCache() {\n      return bestResultInCache;\n    }\n  }\n\n  public static MultiSourceResult getBestSourceForSize(\n    int width,\n    int height,\n    List<ImageSource> sources) {\n    return getBestSourceForSize(width, height, sources, 1.0d);\n  }\n\n  /**\n   * Chooses the image source with the size closest to the target image size.\n   *\n   * @param width the width of the view that will be used to display this image\n   * @param height the height of the view that will be used to display this image\n   * @param sources the list of potential image sources to choose from\n   * @param multiplier the area of the view will be multiplied by this number before calculating the\n   *        best source; this is useful if the image will be displayed bigger than the view\n   *        (e.g. zoomed)\n   */\n  public static MultiSourceResult getBestSourceForSize(\n    int width,\n    int height,\n    List<ImageSource> sources,\n    double multiplier) {\n    // no sources\n    if (sources.isEmpty()) {\n      return new MultiSourceResult(null, null);\n    }\n\n    // single source\n    if (sources.size() == 1) {\n      return new MultiSourceResult(sources.get(0), null);\n    }\n\n    // For multiple sources, we first need the view's size in order to determine the best source to\n    // load. If we haven't been measured yet, return null and wait for onSizeChanged.\n    if (width <= 0 || height <= 0) {\n      return new MultiSourceResult(null, null);\n    }\n\n    ImagePipeline imagePipeline = ImagePipelineFactory.getInstance().getImagePipeline();\n    ImageSource best = null;\n    ImageSource bestCached = null;\n    final double viewArea = width * height * multiplier;\n    double bestPrecision = Double.MAX_VALUE;\n    double bestCachePrecision = Double.MAX_VALUE;\n    for (ImageSource source : sources) {\n      double precision = Math.abs(1.0 - source.getSize() / viewArea);\n      if (precision < bestPrecision) {\n        bestPrecision = precision;\n        best = source;\n      }\n      if (precision < bestCachePrecision &&\n        (imagePipeline.isInBitmapMemoryCache(source.getUri()) ||\n          imagePipeline.isInDiskCacheSync(source.getUri()))) {\n        bestCachePrecision = precision;\n        bestCached = source;\n      }\n    }\n    if (bestCached != null && best != null && bestCached.getSource().equals(best.getSource())) {\n      bestCached = null;\n    }\n    return new MultiSourceResult(best, bestCached);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/ResourceDrawableIdHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.imagehelper;\n\nimport javax.annotation.Nullable;\nimport javax.annotation.concurrent.ThreadSafe;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport android.content.Context;\nimport android.graphics.drawable.Drawable;\nimport android.net.Uri;\n\n/**\n * Helper class for obtaining information about local images.\n */\n@ThreadSafe\npublic class ResourceDrawableIdHelper {\n\n  private Map<String, Integer> mResourceDrawableIdMap;\n\n  private static final String LOCAL_RESOURCE_SCHEME = \"res\";\n  private static volatile ResourceDrawableIdHelper sResourceDrawableIdHelper;\n\n  private ResourceDrawableIdHelper() {\n    mResourceDrawableIdMap = new HashMap<String, Integer>();\n  }\n\n  public static ResourceDrawableIdHelper getInstance() {\n    if (sResourceDrawableIdHelper == null) {\n      synchronized (ResourceDrawableIdHelper.class) {\n        if (sResourceDrawableIdHelper == null) {\n          sResourceDrawableIdHelper = new ResourceDrawableIdHelper();\n        }\n      }\n    }\n    return sResourceDrawableIdHelper;\n  }\n\n  public synchronized void clear() {\n    mResourceDrawableIdMap.clear();\n  }\n\n  public int getResourceDrawableId(Context context, @Nullable String name) {\n    if (name == null || name.isEmpty()) {\n      return 0;\n    }\n    name = name.toLowerCase().replace(\"-\", \"_\");\n\n    // name could be a resource id.\n    try {\n      return Integer.parseInt(name);\n    } catch (NumberFormatException e) {\n      // Do nothing.\n    }\n\n    synchronized (this) {\n      if (mResourceDrawableIdMap.containsKey(name)) {\n        return mResourceDrawableIdMap.get(name);\n      }\n      int id = context.getResources().getIdentifier(\n        name,\n        \"drawable\",\n        context.getPackageName());\n      mResourceDrawableIdMap.put(name, id);\n      return id;\n    }\n  }\n\n  public @Nullable Drawable getResourceDrawable(Context context, @Nullable String name) {\n    int resId = getResourceDrawableId(context, name);\n    return resId > 0 ? context.getResources().getDrawable(resId) : null;\n  }\n\n  public Uri getResourceDrawableUri(Context context, @Nullable String name) {\n    int resId = getResourceDrawableId(context, name);\n    return resId > 0 ? new Uri.Builder()\n        .scheme(LOCAL_RESOURCE_SCHEME)\n        .path(String.valueOf(resId))\n        .build() : Uri.EMPTY;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/modal/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"modal\",\n    srcs = glob([\"*.java\"]),\n    required_for_source_only_abi = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/touch:touch\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/view:view\"),\n        react_native_target(\"res:modal\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/modal/ModalHostHelper.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.modal;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.content.res.TypedArray;\nimport android.graphics.Point;\nimport android.view.Display;\nimport android.view.WindowManager;\n\nimport com.facebook.infer.annotation.Assertions;\n\n/**\n * Helper class for Modals.\n */\n/*package*/ class ModalHostHelper {\n\n  private static final Point MIN_POINT = new Point();\n  private static final Point MAX_POINT = new Point();\n  private static final Point SIZE_POINT = new Point();\n\n  /**\n   * To get the size of the screen, we use information from the WindowManager and\n   * default Display. We don't use DisplayMetricsHolder, or Display#getSize() because\n   * they return values that include the status bar. We only want the values of what\n   * will actually be shown on screen.\n   * We use Display#getSize() to determine if the screen is in portrait or landscape.\n   * We don't use getRotation because the 'natural' rotation will be portrait on phones\n   * and landscape on tablets.\n   * This should only be called on the native modules/shadow nodes thread.\n   */\n  @TargetApi(16)\n  public static Point getModalHostSize(Context context) {\n    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);\n    Display display = Assertions.assertNotNull(wm).getDefaultDisplay();\n    // getCurrentSizeRange will return the min and max width and height that the window can be\n    display.getCurrentSizeRange(MIN_POINT, MAX_POINT);\n    // getSize will return the dimensions of the screen in its current orientation\n    display.getSize(SIZE_POINT);\n\n    int[] attrs = {android.R.attr.windowFullscreen};\n    Resources.Theme theme = context.getTheme();\n    TypedArray ta = theme.obtainStyledAttributes(attrs);\n    boolean windowFullscreen = ta.getBoolean(0, false);\n\n    // We need to add the status bar height to the height if we have a fullscreen window,\n    // because Display.getCurrentSizeRange doesn't include it.\n    Resources resources = context.getResources();\n    int statusBarId = resources.getIdentifier(\"status_bar_height\", \"dimen\", \"android\");\n    int statusBarHeight = 0;\n    if (windowFullscreen && statusBarId > 0) {\n        statusBarHeight = (int) resources.getDimension(statusBarId);\n    }\n\n    if (SIZE_POINT.x < SIZE_POINT.y) {\n      // If we are vertical the width value comes from min width and height comes from max height\n      return new Point(MIN_POINT.x, MAX_POINT.y + statusBarHeight);\n    } else {\n      // If we are horizontal the width value comes from max width and height comes from min height\n      return new Point(MAX_POINT.x, MIN_POINT.y + statusBarHeight);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/modal/ModalHostShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.modal;\n\nimport android.graphics.Point;\nimport com.facebook.react.uimanager.LayoutShadowNode;\nimport com.facebook.react.uimanager.ReactShadowNodeImpl;\n\n/**\n * We implement the Modal by using an Android Dialog. That will fill the entire window of the\n * application.  To get layout to work properly, we need to layout all the elements within the\n * Modal's inner content view as if they can fill the entire window.  To do that, we need to\n * explicitly set the styleWidth and styleHeight on the LayoutShadowNode of the child of this node\n * to be the window size.  This will then cause the children of the Modal to layout as if they can\n * fill the window.\n */\nclass ModalHostShadowNode extends LayoutShadowNode {\n\n  /**\n   * We need to set the styleWidth and styleHeight of the one child (represented by the <View/>\n   * within the <RCTModalHostView/> in Modal.js. This needs to fill the entire window.\n   */\n  @Override\n  public void addChildAt(ReactShadowNodeImpl child, int i) {\n    super.addChildAt(child, i);\n    Point modalSize = ModalHostHelper.getModalHostSize(getThemedContext());\n    child.setStyleWidth(modalSize.x);\n    child.setStyleHeight(modalSize.y);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.modal;\n\nimport java.util.Map;\n\nimport android.content.DialogInterface;\n\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.LayoutShadowNode;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewGroupManager;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.events.EventDispatcher;\n\n/**\n * View manager for {@link ReactModalHostView} components.\n */\n@ReactModule(name = ReactModalHostManager.REACT_CLASS)\npublic class ReactModalHostManager extends ViewGroupManager<ReactModalHostView> {\n\n  protected static final String REACT_CLASS = \"RCTModalHostView\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  protected ReactModalHostView createViewInstance(ThemedReactContext reactContext) {\n    return new ReactModalHostView(reactContext);\n  }\n\n  @Override\n  public LayoutShadowNode createShadowNodeInstance() {\n    return new ModalHostShadowNode();\n  }\n\n  @Override\n  public Class<? extends LayoutShadowNode> getShadowNodeClass() {\n    return ModalHostShadowNode.class;\n  }\n\n  @Override\n  public void onDropViewInstance(ReactModalHostView view) {\n    super.onDropViewInstance(view);\n    view.onDropInstance();\n  }\n\n  @ReactProp(name = \"animationType\")\n  public void setAnimationType(ReactModalHostView view, String animationType) {\n    view.setAnimationType(animationType);\n  }\n\n  @ReactProp(name = \"transparent\")\n  public void setTransparent(ReactModalHostView view, boolean transparent) {\n    view.setTransparent(transparent);\n  }\n\n  @ReactProp(name = \"hardwareAccelerated\")\n  public void setHardwareAccelerated(ReactModalHostView view, boolean hardwareAccelerated) {\n    view.setHardwareAccelerated(hardwareAccelerated);\n  }\n\n  @Override\n  protected void addEventEmitters(\n      ThemedReactContext reactContext,\n      final ReactModalHostView view) {\n    final EventDispatcher dispatcher =\n      reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n    view.setOnRequestCloseListener(\n      new ReactModalHostView.OnRequestCloseListener() {\n        @Override\n        public void onRequestClose(DialogInterface dialog) {\n          dispatcher.dispatchEvent(new RequestCloseEvent(view.getId()));\n        }\n      });\n    view.setOnShowListener(\n      new DialogInterface.OnShowListener() {\n        @Override\n        public void onShow(DialogInterface dialog) {\n          dispatcher.dispatchEvent(new ShowEvent(view.getId()));\n        }\n      });\n  }\n\n  @Override\n  public Map<String, Object> getExportedCustomDirectEventTypeConstants() {\n    return MapBuilder.<String, Object>builder()\n      .put(RequestCloseEvent.EVENT_NAME, MapBuilder.of(\"registrationName\", \"onRequestClose\"))\n      .put(ShowEvent.EVENT_NAME, MapBuilder.of(\"registrationName\", \"onShow\"))\n      .build();\n  }\n\n  @Override\n  protected void onAfterUpdateTransaction(ReactModalHostView view) {\n    super.onAfterUpdateTransaction(view);\n    view.showOrUpdate();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.modal;\n\nimport javax.annotation.Nullable;\n\nimport java.util.ArrayList;\n\nimport android.app.Activity;\nimport android.app.Dialog;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.view.KeyEvent;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.WindowManager;\nimport android.view.accessibility.AccessibilityEvent;\nimport android.widget.FrameLayout;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.R;\nimport com.facebook.react.bridge.GuardedRunnable;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.uimanager.JSTouchDispatcher;\nimport com.facebook.react.uimanager.RootView;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.views.view.ReactViewGroup;\n\n/**\n * ReactModalHostView is a view that sits in the view hierarchy representing a Modal view.\n *\n * It does a number of things:\n *  1. It creates a Dialog.  We use this Dialog to actually display the Modal in the window.\n *  2. It creates a DialogRootViewGroup.  This view is the view that is displayed by the Dialog. To\n *     display a view within a Dialog, that view must have its parent set to the window the Dialog\n *     creates.  Because of this, we can not use the ReactModalHostView since it sits in the\n *     normal React view hierarchy.  We do however want all of the layout magic to happen as if the\n *     DialogRootViewGroup were part of the hierarchy.  Therefore, we forward all view changes\n *     around addition and removal of views to the DialogRootViewGroup.\n */\npublic class ReactModalHostView extends ViewGroup implements LifecycleEventListener {\n\n  // This listener is called when the user presses KeyEvent.KEYCODE_BACK\n  // An event is then passed to JS which can either close or not close the Modal by setting the\n  // visible property\n  public interface OnRequestCloseListener {\n    void onRequestClose(DialogInterface dialog);\n  }\n\n  private DialogRootViewGroup mHostView;\n  private @Nullable Dialog mDialog;\n  private boolean mTransparent;\n  private String mAnimationType;\n  private boolean mHardwareAccelerated;\n  // Set this flag to true if changing a particular property on the view requires a new Dialog to\n  // be created.  For instance, animation does since it affects Dialog creation through the theme\n  // but transparency does not since we can access the window to update the property.\n  private boolean mPropertyRequiresNewDialog;\n  private @Nullable DialogInterface.OnShowListener mOnShowListener;\n  private @Nullable OnRequestCloseListener mOnRequestCloseListener;\n\n  public ReactModalHostView(Context context) {\n    super(context);\n    ((ReactContext) context).addLifecycleEventListener(this);\n\n    mHostView = new DialogRootViewGroup(context);\n  }\n\n  @Override\n  protected void onLayout(boolean changed, int l, int t, int r, int b) {\n    // Do nothing as we are laid out by UIManager\n  }\n\n  @Override\n  public void addView(View child, int index) {\n    mHostView.addView(child, index);\n  }\n\n  @Override\n  public int getChildCount() {\n    return mHostView.getChildCount();\n  }\n\n  @Override\n  public View getChildAt(int index) {\n    return mHostView.getChildAt(index);\n  }\n\n  @Override\n  public void removeView(View child) {\n    mHostView.removeView(child);\n  }\n\n  @Override\n  public void removeViewAt(int index) {\n    View child = getChildAt(index);\n    mHostView.removeView(child);\n  }\n\n  @Override\n  public void addChildrenForAccessibility(ArrayList<View> outChildren) {\n    // Explicitly override this to prevent accessibility events being passed down to children\n    // Those will be handled by the mHostView which lives in the dialog\n  }\n\n  @Override\n  public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {\n    // Explicitly override this to prevent accessibility events being passed down to children\n    // Those will be handled by the mHostView which lives in the dialog\n    return false;\n  }\n\n  public void onDropInstance() {\n    ((ReactContext) getContext()).removeLifecycleEventListener(this);\n    dismiss();\n  }\n\n  private void dismiss() {\n    if (mDialog != null) {\n      Activity currentActivity = getCurrentActivity();\n      if (mDialog.isShowing() && (currentActivity == null || !currentActivity.isFinishing())) {\n        mDialog.dismiss();\n      }\n      mDialog = null;\n\n      // We need to remove the mHostView from the parent\n      // It is possible we are dismissing this dialog and reattaching the hostView to another\n      ViewGroup parent = (ViewGroup) mHostView.getParent();\n      parent.removeViewAt(0);\n    }\n  }\n\n  protected void setOnRequestCloseListener(OnRequestCloseListener listener) {\n    mOnRequestCloseListener = listener;\n  }\n\n  protected void setOnShowListener(DialogInterface.OnShowListener listener) {\n    mOnShowListener = listener;\n  }\n\n  protected void setTransparent(boolean transparent) {\n    mTransparent = transparent;\n  }\n\n  protected void setAnimationType(String animationType) {\n    mAnimationType = animationType;\n    mPropertyRequiresNewDialog = true;\n  }\n\n  protected void setHardwareAccelerated(boolean hardwareAccelerated) {\n    mHardwareAccelerated = hardwareAccelerated;\n    mPropertyRequiresNewDialog = true;\n  }\n\n  @Override\n  public void onHostResume() {\n    // We show the dialog again when the host resumes\n    showOrUpdate();\n  }\n\n  @Override\n  public void onHostPause() {\n    // do nothing\n  }\n\n  @Override\n  public void onHostDestroy() {\n    // Drop the instance if the host is destroyed which will dismiss the dialog\n    onDropInstance();\n  }\n\n  @VisibleForTesting\n  public @Nullable Dialog getDialog() {\n    return mDialog;\n  }\n\n  private @Nullable Activity getCurrentActivity() {\n    return ((ReactContext) getContext()).getCurrentActivity();\n  }\n\n  /**\n   * showOrUpdate will display the Dialog.  It is called by the manager once all properties are set\n   * because we need to know all of them before creating the Dialog.  It is also smart during\n   * updates if the changed properties can be applied directly to the Dialog or require the\n   * recreation of a new Dialog.\n   */\n  protected void showOrUpdate() {\n    // If the existing Dialog is currently up, we may need to redraw it or we may be able to update\n    // the property without having to recreate the dialog\n    if (mDialog != null) {\n      if (mPropertyRequiresNewDialog) {\n        dismiss();\n      } else {\n        updateProperties();\n        return;\n      }\n    }\n\n    // Reset the flag since we are going to create a new dialog\n    mPropertyRequiresNewDialog = false;\n    int theme = R.style.Theme_FullScreenDialog;\n    if (mAnimationType.equals(\"fade\")) {\n      theme = R.style.Theme_FullScreenDialogAnimatedFade;\n    } else if (mAnimationType.equals(\"slide\")) {\n      theme = R.style.Theme_FullScreenDialogAnimatedSlide;\n    }\n    Activity currentActivity = getCurrentActivity();\n    Context context = currentActivity == null ? getContext() : currentActivity;\n    mDialog = new Dialog(context, theme);\n\n    mDialog.setContentView(getContentView());\n    updateProperties();\n\n    mDialog.setOnShowListener(mOnShowListener);\n    mDialog.setOnKeyListener(\n      new DialogInterface.OnKeyListener() {\n        @Override\n        public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {\n          if (event.getAction() == KeyEvent.ACTION_UP) {\n            // We need to stop the BACK button from closing the dialog by default so we capture that\n            // event and instead inform JS so that it can make the decision as to whether or not to\n            // allow the back button to close the dialog.  If it chooses to, it can just set visible\n            // to false on the Modal and the Modal will go away\n            if (keyCode == KeyEvent.KEYCODE_BACK) {\n              Assertions.assertNotNull(\n                mOnRequestCloseListener,\n                \"setOnRequestCloseListener must be called by the manager\");\n              mOnRequestCloseListener.onRequestClose(dialog);\n              return true;\n            } else {\n              // We redirect the rest of the key events to the current activity, since the activity\n              // expects to receive those events and react to them, ie. in the case of the dev menu\n              Activity currentActivity = ((ReactContext) getContext()).getCurrentActivity();\n              if (currentActivity != null) {\n                return currentActivity.onKeyUp(keyCode, event);\n              }\n            }\n          }\n          return false;\n        }\n      });\n\n    mDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);\n    if (mHardwareAccelerated) {\n      mDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);\n    }\n    if (currentActivity == null || !currentActivity.isFinishing()) {\n      mDialog.show();\n    }\n  }\n\n  /**\n   * Returns the view that will be the root view of the dialog. We are wrapping this in a\n   * FrameLayout because this is the system's way of notifying us that the dialog size has changed.\n   * This has the pleasant side-effect of us not having to preface all Modals with\n   * \"top: statusBarHeight\", since that margin will be included in the FrameLayout.\n   */\n  private View getContentView() {\n    FrameLayout frameLayout = new FrameLayout(getContext());\n    frameLayout.addView(mHostView);\n    frameLayout.setFitsSystemWindows(true);\n    return frameLayout;\n  }\n\n  /**\n   * updateProperties will update the properties that do not require us to recreate the dialog\n   * Properties that do require us to recreate the dialog should set mPropertyRequiresNewDialog to\n   * true when the property changes\n   */\n  private void updateProperties() {\n    Assertions.assertNotNull(mDialog, \"mDialog must exist when we call updateProperties\");\n\n    if (mTransparent) {\n      mDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);\n    } else {\n      mDialog.getWindow().setDimAmount(0.5f);\n      mDialog.getWindow().setFlags(\n          WindowManager.LayoutParams.FLAG_DIM_BEHIND,\n          WindowManager.LayoutParams.FLAG_DIM_BEHIND);\n    }\n  }\n\n  /**\n   * DialogRootViewGroup is the ViewGroup which contains all the children of a Modal.  It gets all\n   * child information forwarded from ReactModalHostView and uses that to create children.  It is\n   * also responsible for acting as a RootView and handling touch events.  It does this the same\n   * way as ReactRootView.\n   *\n   * To get layout to work properly, we need to layout all the elements within the Modal as if they\n   * can fill the entire window.  To do that, we need to explicitly set the styleWidth and\n   * styleHeight on the LayoutShadowNode to be the window size. This is done through the\n   * UIManagerModule, and will then cause the children to layout as if they can fill the window.\n   */\n  static class DialogRootViewGroup extends ReactViewGroup implements RootView {\n\n    private final JSTouchDispatcher mJSTouchDispatcher = new JSTouchDispatcher(this);\n\n    public DialogRootViewGroup(Context context) {\n      super(context);\n    }\n\n    @Override\n    protected void onSizeChanged(final int w, final int h, int oldw, int oldh) {\n      super.onSizeChanged(w, h, oldw, oldh);\n      if (getChildCount() > 0) {\n        final int viewTag = getChildAt(0).getId();\n        ReactContext reactContext = (ReactContext) getContext();\n        reactContext.runOnNativeModulesQueueThread(\n          new GuardedRunnable(reactContext) {\n            @Override\n            public void runGuarded() {\n              ((ReactContext) getContext()).getNativeModule(UIManagerModule.class)\n                .updateNodeSize(viewTag, w, h);\n            }\n          });\n      }\n    }\n\n    @Override\n    public boolean onInterceptTouchEvent(MotionEvent event) {\n      mJSTouchDispatcher.handleTouchEvent(event, getEventDispatcher());\n      return super.onInterceptTouchEvent(event);\n    }\n\n    @Override\n    public boolean onTouchEvent(MotionEvent event) {\n      mJSTouchDispatcher.handleTouchEvent(event, getEventDispatcher());\n      super.onTouchEvent(event);\n      // In case when there is no children interested in handling touch event, we return true from\n      // the root view in order to receive subsequent events related to that gesture\n      return true;\n    }\n\n    @Override\n    public void onChildStartedNativeGesture(MotionEvent androidEvent) {\n      mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, getEventDispatcher());\n    }\n\n    @Override\n    public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {\n      // No-op - override in order to still receive events to onInterceptTouchEvent\n      // even when some other view disallow that\n    }\n\n    private EventDispatcher getEventDispatcher() {\n      ReactContext reactContext = (ReactContext) getContext();\n      return reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/modal/RequestCloseEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.modal;\n\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * {@link Event} for dismissing a Dialog.\n */\n/* package */ class RequestCloseEvent extends Event<RequestCloseEvent> {\n\n  public static final String EVENT_NAME = \"topRequestClose\";\n\n  protected RequestCloseEvent(int viewTag) {\n    super(viewTag);\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), null);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/modal/ShowEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.modal;\n\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * {@link Event} for showing a Dialog.\n */\n/* package */ class ShowEvent extends Event<ShowEvent> {\n\n  public static final String EVENT_NAME = \"topShow\";\n\n  protected ShowEvent(int viewTag) {\n    super(viewTag);\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), null);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/picker/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"picker\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactDialogPickerManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.picker;\n\nimport android.widget.Spinner;\n\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.ThemedReactContext;\n\n/**\n * {@link ReactPickerManager} for {@link ReactPicker} with {@link Spinner#MODE_DIALOG}.\n */\n@ReactModule(name = ReactDialogPickerManager.REACT_CLASS)\npublic class ReactDialogPickerManager extends ReactPickerManager {\n\n  protected static final String REACT_CLASS = \"AndroidDialogPicker\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  protected ReactPicker createViewInstance(ThemedReactContext reactContext) {\n    return new ReactPicker(reactContext, Spinner.MODE_DIALOG);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactDropdownPickerManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.picker;\n\nimport android.widget.Spinner;\n\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.ThemedReactContext;\n\n/**\n * {@link ReactPickerManager} for {@link ReactPicker} with {@link Spinner#MODE_DROPDOWN}.\n */\n@ReactModule(name = ReactDropdownPickerManager.REACT_CLASS)\npublic class ReactDropdownPickerManager extends ReactPickerManager {\n\n  protected static final String REACT_CLASS = \"AndroidDropdownPicker\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  protected ReactPicker createViewInstance(ThemedReactContext reactContext) {\n    return new ReactPicker(reactContext, Spinner.MODE_DROPDOWN);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPicker.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.picker;\n\nimport javax.annotation.Nullable;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.view.View;\nimport android.widget.AdapterView;\nimport android.widget.Spinner;\n\nimport com.facebook.react.common.annotations.VisibleForTesting;\n\npublic class ReactPicker extends Spinner {\n\n  private int mMode = MODE_DIALOG;\n  private @Nullable Integer mPrimaryColor;\n  private boolean mSuppressNextEvent;\n  private @Nullable OnSelectListener mOnSelectListener;\n  private @Nullable Integer mStagedSelection;\n\n  /**\n   * Listener interface for ReactPicker events.\n   */\n  public interface OnSelectListener {\n    void onItemSelected(int position);\n  }\n\n  public ReactPicker(Context context) {\n    super(context);\n  }\n\n  public ReactPicker(Context context, int mode) {\n    super(context, mode);\n    mMode = mode;\n  }\n\n  public ReactPicker(Context context, AttributeSet attrs) {\n    super(context, attrs);\n  }\n\n  public ReactPicker(Context context, AttributeSet attrs, int defStyle) {\n    super(context, attrs, defStyle);\n  }\n\n  public ReactPicker(Context context, AttributeSet attrs, int defStyle, int mode) {\n    super(context, attrs, defStyle, mode);\n    mMode = mode;\n  }\n\n  private final Runnable measureAndLayout = new Runnable() {\n    @Override\n    public void run() {\n      measure(\n          MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.EXACTLY),\n          MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.EXACTLY));\n      layout(getLeft(), getTop(), getRight(), getBottom());\n    }\n  };\n\n  @Override\n  public void requestLayout() {\n    super.requestLayout();\n\n    // The spinner relies on a measure + layout pass happening after it calls requestLayout().\n    // Without this, the widget never actually changes the selection and doesn't call the\n    // appropriate listeners. Since we override onLayout in our ViewGroups, a layout pass never\n    // happens after a call to requestLayout, so we simulate one here.\n    post(measureAndLayout);\n  }\n\n  public void setOnSelectListener(@Nullable OnSelectListener onSelectListener) {\n    if (getOnItemSelectedListener() == null) {\n      // onItemSelected gets fired immediately after layout because checkSelectionChanged() in\n      // AdapterView updates the selection position from the default INVALID_POSITION. To match iOS\n      // behavior, we don't want the event emitter for onItemSelected to fire right after layout.\n      mSuppressNextEvent = true;\n      setOnItemSelectedListener(\n          new OnItemSelectedListener() {\n            @Override\n            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n              if (!mSuppressNextEvent && mOnSelectListener != null) {\n                mOnSelectListener.onItemSelected(position);\n              }\n              mSuppressNextEvent = false;\n            }\n\n            @Override\n            public void onNothingSelected(AdapterView<?> parent) {\n              if (!mSuppressNextEvent && mOnSelectListener != null) {\n                mOnSelectListener.onItemSelected(-1);\n              }\n              mSuppressNextEvent = false;\n            }\n          });\n    }\n    mOnSelectListener = onSelectListener;\n  }\n\n  @Nullable public OnSelectListener getOnSelectListener() {\n    return mOnSelectListener;\n  }\n\n  /**\n   * Will cache \"selection\" value locally and set it only once {@link #updateStagedSelection} is\n   * called\n   */\n  public void setStagedSelection(int selection) {\n    mStagedSelection = selection;\n  }\n\n  public void updateStagedSelection() {\n    if (mStagedSelection != null) {\n      setSelectionWithSuppressEvent(mStagedSelection);\n      mStagedSelection = null;\n    }\n  }\n\n  /**\n   * Set the selection while suppressing the follow-up {@link OnSelectListener#onItemSelected(int)}\n   * event. This is used so we don't get an event when changing the selection ourselves.\n   *\n   * @param position the position of the selected item\n   */\n  private void setSelectionWithSuppressEvent(int position) {\n    if (position != getSelectedItemPosition()) {\n      mSuppressNextEvent = true;\n      setSelection(position);\n    }\n  }\n\n  public @Nullable Integer getPrimaryColor() {\n    return mPrimaryColor;\n  }\n\n  public void setPrimaryColor(@Nullable Integer primaryColor) {\n    mPrimaryColor = primaryColor;\n  }\n\n  @VisibleForTesting\n  public int getMode() {\n    return mMode;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPickerManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.picker;\n\nimport javax.annotation.Nullable;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ArrayAdapter;\nimport android.widget.Spinner;\nimport android.widget.TextView;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.uimanager.SimpleViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.views.picker.events.PickerItemSelectEvent;\n\n/**\n * {@link ViewManager} for the {@link ReactPicker} view. This is abstract because the\n * {@link Spinner} doesn't support setting the mode (dropdown/dialog) outside the constructor, so\n * that is delegated to the separate {@link ReactDropdownPickerManager} and\n * {@link ReactDialogPickerManager} components. These are merged back on the JS side into one\n * React component.\n */\npublic abstract class ReactPickerManager extends SimpleViewManager<ReactPicker> {\n\n  @ReactProp(name = \"items\")\n  public void setItems(ReactPicker view, @Nullable ReadableArray items) {\n    if (items != null) {\n      ReadableMap[] data = new ReadableMap[items.size()];\n      for (int i = 0; i < items.size(); i++) {\n        data[i] = items.getMap(i);\n      }\n      ReactPickerAdapter adapter = new ReactPickerAdapter(view.getContext(), data);\n      adapter.setPrimaryTextColor(view.getPrimaryColor());\n      view.setAdapter(adapter);\n    } else {\n      view.setAdapter(null);\n    }\n  }\n\n  @ReactProp(name = ViewProps.COLOR, customType = \"Color\")\n  public void setColor(ReactPicker view, @Nullable Integer color) {\n    view.setPrimaryColor(color);\n    ReactPickerAdapter adapter = (ReactPickerAdapter) view.getAdapter();\n    if (adapter != null) {\n      adapter.setPrimaryTextColor(color);\n    }\n  }\n\n  @ReactProp(name = \"prompt\")\n  public void setPrompt(ReactPicker view, @Nullable String prompt) {\n    view.setPrompt(prompt);\n  }\n\n  @ReactProp(name = ViewProps.ENABLED, defaultBoolean = true)\n  public void setEnabled(ReactPicker view, boolean enabled) {\n    view.setEnabled(enabled);\n  }\n\n  @ReactProp(name = \"selected\")\n  public void setSelected(ReactPicker view, int selected) {\n    view.setStagedSelection(selected);\n  }\n\n  @Override\n  protected void onAfterUpdateTransaction(ReactPicker view) {\n    super.onAfterUpdateTransaction(view);\n    view.updateStagedSelection();\n  }\n\n  @Override\n  protected void addEventEmitters(\n      final ThemedReactContext reactContext,\n      final ReactPicker picker) {\n    picker.setOnSelectListener(\n            new PickerEventEmitter(\n                    picker,\n                    reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()));\n  }\n\n  private static class ReactPickerAdapter extends ArrayAdapter<ReadableMap> {\n\n    private final LayoutInflater mInflater;\n    private @Nullable Integer mPrimaryTextColor;\n\n    public ReactPickerAdapter(Context context, ReadableMap[] data) {\n      super(context, 0, data);\n\n      mInflater = (LayoutInflater) Assertions.assertNotNull(\n          context.getSystemService(Context.LAYOUT_INFLATER_SERVICE));\n    }\n\n    @Override\n    public View getView(int position, View convertView, ViewGroup parent) {\n      return getView(position, convertView, parent, false);\n    }\n\n    @Override\n    public View getDropDownView(int position, View convertView, ViewGroup parent) {\n      return getView(position, convertView, parent, true);\n    }\n\n    private View getView(int position, View convertView, ViewGroup parent, boolean isDropdown) {\n      ReadableMap item = getItem(position);\n\n      if (convertView == null) {\n        int layoutResId = isDropdown\n            ? android.R.layout.simple_spinner_dropdown_item\n            : android.R.layout.simple_spinner_item;\n        convertView = mInflater.inflate(layoutResId, parent, false);\n      }\n\n      TextView textView = (TextView) convertView;\n      textView.setText(item.getString(\"label\"));\n      if (!isDropdown && mPrimaryTextColor != null) {\n        textView.setTextColor(mPrimaryTextColor);\n      } else if (item.hasKey(\"color\") && !item.isNull(\"color\")) {\n        textView.setTextColor(item.getInt(\"color\"));\n      }\n\n      return convertView;\n    }\n\n    public void setPrimaryTextColor(@Nullable Integer primaryTextColor) {\n      mPrimaryTextColor = primaryTextColor;\n      notifyDataSetChanged();\n    }\n  }\n\n  private static class PickerEventEmitter implements ReactPicker.OnSelectListener {\n\n    private final ReactPicker mReactPicker;\n    private final EventDispatcher mEventDispatcher;\n\n    public PickerEventEmitter(ReactPicker reactPicker, EventDispatcher eventDispatcher) {\n      mReactPicker = reactPicker;\n      mEventDispatcher = eventDispatcher;\n    }\n\n    @Override\n    public void onItemSelected(int position) {\n      mEventDispatcher.dispatchEvent( new PickerItemSelectEvent(\n              mReactPicker.getId(), position));\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/picker/events/PickerItemSelectEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.picker.events;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\npublic class PickerItemSelectEvent extends Event<PickerItemSelectEvent> {\n  public static final String EVENT_NAME = \"topSelect\";\n\n  private final int mPosition;\n\n  public PickerItemSelectEvent(int id, int position) {\n    super(id);\n    mPosition = position;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putInt(\"position\", mPosition);\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/progressbar/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"progressbar\",\n    srcs = glob([\"*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarContainerView.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.progressbar;\n\nimport javax.annotation.Nullable;\n\nimport android.content.Context;\nimport android.graphics.PorterDuff;\nimport android.graphics.drawable.Drawable;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.FrameLayout;\nimport android.widget.ProgressBar;\n\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\n\n/**\n * Controls an enclosing ProgressBar. Exists so that the ProgressBar can be recreated if\n * the style would change.\n */\n/* package */ class ProgressBarContainerView extends FrameLayout {\n  private static final int MAX_PROGRESS = 1000;\n\n  private @Nullable Integer mColor;\n  private boolean mIndeterminate = true;\n  private boolean mAnimating = true;\n  private double mProgress;\n  private @Nullable ProgressBar mProgressBar;\n\n  public ProgressBarContainerView(Context context) {\n    super(context);\n  }\n\n  public void setStyle(@Nullable String styleName) {\n    int style = ReactProgressBarViewManager.getStyleFromString(styleName);\n    mProgressBar = ReactProgressBarViewManager.createProgressBar(getContext(), style);\n    mProgressBar.setMax(MAX_PROGRESS);\n    removeAllViews();\n    addView(\n        mProgressBar,\n        new ViewGroup.LayoutParams(\n            ViewGroup.LayoutParams.MATCH_PARENT,\n            ViewGroup.LayoutParams.MATCH_PARENT));\n  }\n\n  public void setColor(@Nullable Integer color) {\n    this.mColor = color;\n  }\n\n  public void setIndeterminate(boolean indeterminate) {\n    mIndeterminate = indeterminate;\n  }\n\n  public void setProgress(double progress) {\n    mProgress = progress;\n  }\n\n  public void setAnimating(boolean animating) {\n    mAnimating = animating;\n  }\n\n  public void apply() {\n    if (mProgressBar == null) {\n      throw new JSApplicationIllegalArgumentException(\"setStyle() not called\");\n    }\n\n    mProgressBar.setIndeterminate(mIndeterminate);\n    setColor(mProgressBar);\n    mProgressBar.setProgress((int) (mProgress * MAX_PROGRESS));\n    if (mAnimating) {\n      mProgressBar.setVisibility(View.VISIBLE);\n    } else {\n      mProgressBar.setVisibility(View.GONE);\n    }\n  }\n\n  private void setColor(ProgressBar progressBar) {\n    Drawable drawable;\n    if (progressBar.isIndeterminate()) {\n      drawable = progressBar.getIndeterminateDrawable();\n    } else {\n      drawable = progressBar.getProgressDrawable();\n    }\n\n    if (drawable == null) {\n      return;\n    }\n\n    if (mColor != null) {\n      drawable.setColorFilter(mColor, PorterDuff.Mode.SRC_IN);\n    } else {\n      drawable.clearColorFilter();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.progressbar;\n\nimport javax.annotation.Nullable;\n\nimport java.util.HashSet;\nimport java.util.Set;\n\nimport android.util.SparseIntArray;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ProgressBar;\n\nimport com.facebook.yoga.YogaMeasureMode;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaNode;\nimport com.facebook.yoga.YogaMeasureOutput;\nimport com.facebook.react.uimanager.LayoutShadowNode;\nimport com.facebook.react.uimanager.annotations.ReactProp;\n\n/**\n * Node responsible for holding the style of the ProgressBar, see under\n * {@link android.R.attr.progressBarStyle} for possible styles. ReactProgressBarViewManager\n * manages how this style is applied to the ProgressBar.\n */\npublic class ProgressBarShadowNode extends LayoutShadowNode implements YogaMeasureFunction {\n\n  private String mStyle = ReactProgressBarViewManager.DEFAULT_STYLE;\n\n  private final SparseIntArray mHeight = new SparseIntArray();\n  private final SparseIntArray mWidth = new SparseIntArray();\n  private final Set<Integer> mMeasured = new HashSet<>();\n\n  public ProgressBarShadowNode() {\n    setMeasureFunction(this);\n  }\n\n  public @Nullable String getStyle() {\n    return mStyle;\n  }\n\n  @ReactProp(name = ReactProgressBarViewManager.PROP_STYLE)\n  public void setStyle(@Nullable String style) {\n    mStyle = style == null ? ReactProgressBarViewManager.DEFAULT_STYLE : style;\n  }\n\n  @Override\n  public long measure(\n      YogaNode node,\n      float width,\n      YogaMeasureMode widthMode,\n      float height,\n      YogaMeasureMode heightMode) {\n    final int style = ReactProgressBarViewManager.getStyleFromString(getStyle());\n    if (!mMeasured.contains(style)) {\n      ProgressBar progressBar = ReactProgressBarViewManager.createProgressBar(getThemedContext(), style);\n      final int spec = View.MeasureSpec.makeMeasureSpec(\n          ViewGroup.LayoutParams.WRAP_CONTENT,\n          View.MeasureSpec.UNSPECIFIED);\n      progressBar.measure(spec, spec);\n      mHeight.put(style, progressBar.getMeasuredHeight());\n      mWidth.put(style, progressBar.getMeasuredWidth());\n      mMeasured.add(style);\n    }\n\n    return YogaMeasureOutput.make(mWidth.get(style), mHeight.get(style));\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.progressbar;\n\nimport javax.annotation.Nullable;\n\nimport android.content.Context;\nimport android.widget.ProgressBar;\n\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.BaseViewManager;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewProps;\n\n/**\n * Manages instances of ProgressBar. ProgressBar is wrapped in a ProgressBarContainerView because\n * the style of the ProgressBar can only be set in the constructor; whenever the style of a\n * ProgressBar changes, we have to drop the existing ProgressBar (if there is one) and create a new\n * one with the style given.\n */\n@ReactModule(name = ReactProgressBarViewManager.REACT_CLASS)\npublic class ReactProgressBarViewManager extends\n    BaseViewManager<ProgressBarContainerView, ProgressBarShadowNode> {\n\n  protected static final String REACT_CLASS = \"AndroidProgressBar\";\n\n  /* package */ static final String PROP_STYLE = \"styleAttr\";\n  /* package */ static final String PROP_INDETERMINATE = \"indeterminate\";\n  /* package */ static final String PROP_PROGRESS = \"progress\";\n  /* package */ static final String PROP_ANIMATING = \"animating\";\n\n  /* package */ static final String DEFAULT_STYLE = \"Normal\";\n\n  private static Object sProgressBarCtorLock = new Object();\n\n  /**\n   * We create ProgressBars on both the UI and shadow threads. There is a race condition in the\n   * ProgressBar constructor that may cause crashes when two ProgressBars are constructed at the\n   * same time on two different threads. This static ctor wrapper protects against that.\n   */\n  public static ProgressBar createProgressBar(Context context, int style) {\n    synchronized (sProgressBarCtorLock) {\n      return new ProgressBar(context, null, style);\n    }\n  }\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  protected ProgressBarContainerView createViewInstance(ThemedReactContext context) {\n    return new ProgressBarContainerView(context);\n  }\n\n  @ReactProp(name = PROP_STYLE)\n  public void setStyle(ProgressBarContainerView view, @Nullable String styleName) {\n    view.setStyle(styleName);\n  }\n\n  @ReactProp(name = ViewProps.COLOR, customType = \"Color\")\n  public void setColor(ProgressBarContainerView view, @Nullable Integer color) {\n    view.setColor(color);\n  }\n\n  @ReactProp(name = PROP_INDETERMINATE)\n  public void setIndeterminate(ProgressBarContainerView view, boolean indeterminate) {\n    view.setIndeterminate(indeterminate);\n  }\n\n  @ReactProp(name = PROP_PROGRESS)\n  public void setProgress(ProgressBarContainerView view, double progress) {\n    view.setProgress(progress);\n  }\n\n  @ReactProp(name = PROP_ANIMATING)\n  public void setAnimating(ProgressBarContainerView view, boolean animating) {\n    view.setAnimating(animating);\n  }\n\n  @Override\n  public ProgressBarShadowNode createShadowNodeInstance() {\n    return new ProgressBarShadowNode();\n  }\n\n  @Override\n  public Class<ProgressBarShadowNode> getShadowNodeClass() {\n    return ProgressBarShadowNode.class;\n  }\n\n  @Override\n  public void updateExtraData(ProgressBarContainerView root, Object extraData) {\n    // do nothing\n  }\n\n  @Override\n  protected void onAfterUpdateTransaction(ProgressBarContainerView view) {\n    view.apply();\n  }\n\n  /* package */ static int getStyleFromString(@Nullable String styleStr) {\n    if (styleStr == null) {\n      throw new JSApplicationIllegalArgumentException(\n          \"ProgressBar needs to have a style, null received\");\n    } else if (styleStr.equals(\"Horizontal\")) {\n      return android.R.attr.progressBarStyleHorizontal;\n    }  else if (styleStr.equals(\"Small\")) {\n      return android.R.attr.progressBarStyleSmall;\n    } else if (styleStr.equals(\"Large\")) {\n      return android.R.attr.progressBarStyleLarge;\n    } else if (styleStr.equals(\"Inverse\")) {\n      return android.R.attr.progressBarStyleInverse;\n    } else if (styleStr.equals(\"SmallInverse\")) {\n      return android.R.attr.progressBarStyleSmallInverse;\n    } else if (styleStr.equals(\"LargeInverse\")) {\n      return android.R.attr.progressBarStyleLargeInverse;\n    } else if (styleStr.equals(\"Normal\")) {\n      return android.R.attr.progressBarStyle;\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Unknown ProgressBar style: \" + styleStr);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"scroll\",\n    srcs = glob([\"*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/i18nmanager:i18nmanager\"),\n        react_native_target(\"java/com/facebook/react/touch:touch\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/view:view\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/FpsListener.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.scroll;\n\npublic interface FpsListener {\n\n  /**\n   * Clients should call this method when they want the listener to begin recording data.\n   *\n   * @param tag\n   */\n  void enable(String tag);\n\n  /**\n   * Clients should call this method when they want the listener to stop recording data.\n   * The listener will then report the data it collected.\n   *\n   * Calling disable on a listener that has already been disabled is a no-op.\n   *\n   * @param tag\n   */\n  void disable(String tag);\n\n  /**\n   * Reports whether this listener is recording data.\n   */\n  boolean isEnabled();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/OnScrollDispatchHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.scroll;\n\nimport android.os.SystemClock;\n\n/**\n * Android has a bug where onScrollChanged is called twice per frame with the same params during\n * flings. We hack around that here by trying to detect that duplicate call and not dispatch it. See\n * https://code.google.com/p/android/issues/detail?id=39473\n */\npublic class OnScrollDispatchHelper {\n\n  private static final int MIN_EVENT_SEPARATION_MS = 10;\n\n  private int mPrevX = Integer.MIN_VALUE;\n  private int mPrevY = Integer.MIN_VALUE;\n  private float mXFlingVelocity = 0;\n  private float mYFlingVelocity = 0;\n\n  private long mLastScrollEventTimeMs = -(MIN_EVENT_SEPARATION_MS + 1);\n\n  /**\n   * Call from a ScrollView in onScrollChanged, returns true if this onScrollChanged is legit (not a\n   * duplicate) and should be dispatched.\n   */\n  public boolean onScrollChanged(int x, int y) {\n    long eventTime = SystemClock.uptimeMillis();\n    boolean shouldDispatch =\n        eventTime - mLastScrollEventTimeMs > MIN_EVENT_SEPARATION_MS ||\n            mPrevX != x ||\n            mPrevY != y;\n\n    if (eventTime - mLastScrollEventTimeMs != 0) {\n      mXFlingVelocity = (float) (x - mPrevX) / (eventTime - mLastScrollEventTimeMs);\n      mYFlingVelocity = (float) (y - mPrevY) / (eventTime - mLastScrollEventTimeMs);\n    }\n\n    mLastScrollEventTimeMs = eventTime;\n    mPrevX = x;\n    mPrevY = y;\n\n    return shouldDispatch;\n  }\n\n  public float getXFlingVelocity() {\n    return this.mXFlingVelocity;\n  }\n\n  public float getYFlingVelocity() {\n    return this.mYFlingVelocity;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollContainerView.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.scroll;\n\nimport android.content.Context;\nimport android.view.ViewGroup;\nimport android.widget.HorizontalScrollView;\nimport com.facebook.react.modules.i18nmanager.I18nUtil;\n\n/** Container of Horizontal scrollViews that supports RTL scrolling. */\npublic class ReactHorizontalScrollContainerView extends ViewGroup {\n\n  private int mLayoutDirection;\n\n  public ReactHorizontalScrollContainerView(Context context) {\n    super(context);\n    mLayoutDirection =\n        I18nUtil.getInstance().isRTL(context) ? LAYOUT_DIRECTION_RTL : LAYOUT_DIRECTION_LTR;\n  }\n\n  @Override\n  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n    if (mLayoutDirection == LAYOUT_DIRECTION_RTL) {\n      // When the layout direction is RTL, we expect Yoga to give us a layout\n      // that extends off the screen to the left so we re-center it with left=0\n      int newLeft = 0;\n      int width = right - left;\n      int newRight = newLeft + width;\n      setLeft(newLeft);\n      setRight(newRight);\n\n      // Fix the ScrollX position when using RTL language\n      int offsetX = computeHorizontalScrollRange() - getScrollX();\n\n      // Call with the present values in order to re-layout if necessary\n      HorizontalScrollView parent = (HorizontalScrollView) getParent();\n      parent.scrollTo(offsetX, parent.getScrollY());\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.scroll;\n\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewGroupManager;\n\n/** View manager for {@link ReactHorizontalScrollContainerView} components. */\n@ReactModule(name = ReactHorizontalScrollContainerViewManager.REACT_CLASS)\npublic class ReactHorizontalScrollContainerViewManager\n    extends ViewGroupManager<ReactHorizontalScrollContainerView> {\n\n  protected static final String REACT_CLASS = \"AndroidHorizontalScrollContentView\";\n\n  public ReactHorizontalScrollContainerViewManager() {}\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public ReactHorizontalScrollContainerView createViewInstance(ThemedReactContext context) {\n    return new ReactHorizontalScrollContainerView(context);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.scroll;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Rect;\nimport android.graphics.drawable.ColorDrawable;\nimport android.graphics.drawable.Drawable;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.widget.HorizontalScrollView;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.uimanager.MeasureSpecAssertions;\nimport com.facebook.react.uimanager.ReactClippingViewGroup;\nimport com.facebook.react.uimanager.ReactClippingViewGroupHelper;\nimport com.facebook.react.uimanager.events.NativeGestureUtil;\nimport com.facebook.react.views.view.ReactViewBackgroundManager;\nimport javax.annotation.Nullable;\n\n/**\n * Similar to {@link ReactScrollView} but only supports horizontal scrolling.\n */\npublic class ReactHorizontalScrollView extends HorizontalScrollView implements\n    ReactClippingViewGroup {\n\n  private final OnScrollDispatchHelper mOnScrollDispatchHelper = new OnScrollDispatchHelper();\n  private final VelocityHelper mVelocityHelper = new VelocityHelper();\n\n  private boolean mActivelyScrolling;\n  private @Nullable Rect mClippingRect;\n  private boolean mDragging;\n  private boolean mPagingEnabled = false;\n  private @Nullable Runnable mPostTouchRunnable;\n  private boolean mRemoveClippedSubviews;\n  private boolean mScrollEnabled = true;\n  private boolean mSendMomentumEvents;\n  private @Nullable FpsListener mFpsListener = null;\n  private @Nullable String mScrollPerfTag;\n  private @Nullable Drawable mEndBackground;\n  private int mEndFillColor = Color.TRANSPARENT;\n  private int mSnapInterval = 0;\n  private ReactViewBackgroundManager mReactBackgroundManager;\n\n  public ReactHorizontalScrollView(Context context) {\n    this(context, null);\n  }\n\n  public ReactHorizontalScrollView(Context context, @Nullable FpsListener fpsListener) {\n    super(context);\n    mReactBackgroundManager = new ReactViewBackgroundManager(this);\n    mFpsListener = fpsListener;\n  }\n\n  public void setScrollPerfTag(@Nullable String scrollPerfTag) {\n    mScrollPerfTag = scrollPerfTag;\n  }\n\n  @Override\n  public void setRemoveClippedSubviews(boolean removeClippedSubviews) {\n    if (removeClippedSubviews && mClippingRect == null) {\n      mClippingRect = new Rect();\n    }\n    mRemoveClippedSubviews = removeClippedSubviews;\n    updateClippingRect();\n  }\n\n  @Override\n  public boolean getRemoveClippedSubviews() {\n    return mRemoveClippedSubviews;\n  }\n\n  public void setSendMomentumEvents(boolean sendMomentumEvents) {\n    mSendMomentumEvents = sendMomentumEvents;\n  }\n\n  public void setScrollEnabled(boolean scrollEnabled) {\n    mScrollEnabled = scrollEnabled;\n  }\n\n  public void setPagingEnabled(boolean pagingEnabled) {\n    mPagingEnabled = pagingEnabled;\n  }\n\n  public void setSnapInterval(int snapInterval) {\n    mSnapInterval = snapInterval;\n  }\n\n  public void flashScrollIndicators() {\n    awakenScrollBars();\n  }\n\n  @Override\n  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n    MeasureSpecAssertions.assertExplicitMeasureSpec(widthMeasureSpec, heightMeasureSpec);\n\n    setMeasuredDimension(\n        MeasureSpec.getSize(widthMeasureSpec),\n        MeasureSpec.getSize(heightMeasureSpec));\n  }\n\n  @Override\n  protected void onLayout(boolean changed, int l, int t, int r, int b) {\n    // Call with the present values in order to re-layout if necessary\n    scrollTo(getScrollX(), getScrollY());\n  }\n\n  @Override\n  protected void onScrollChanged(int x, int y, int oldX, int oldY) {\n    super.onScrollChanged(x, y, oldX, oldY);\n\n    mActivelyScrolling = true;\n\n    if (mOnScrollDispatchHelper.onScrollChanged(x, y)) {\n      if (mRemoveClippedSubviews) {\n        updateClippingRect();\n      }\n\n      ReactScrollViewHelper.emitScrollEvent(\n        this,\n        mOnScrollDispatchHelper.getXFlingVelocity(),\n        mOnScrollDispatchHelper.getYFlingVelocity());\n    }\n  }\n\n  @Override\n  public boolean onInterceptTouchEvent(MotionEvent ev) {\n    if (!mScrollEnabled) {\n      return false;\n    }\n\n    if (super.onInterceptTouchEvent(ev)) {\n      NativeGestureUtil.notifyNativeGestureStarted(this, ev);\n      ReactScrollViewHelper.emitScrollBeginDragEvent(this);\n      mDragging = true;\n      enableFpsListener();\n      return true;\n    }\n\n    return false;\n  }\n\n  @Override\n  public boolean onTouchEvent(MotionEvent ev) {\n    if (!mScrollEnabled) {\n      return false;\n    }\n\n    mVelocityHelper.calculateVelocity(ev);\n    int action = ev.getAction() & MotionEvent.ACTION_MASK;\n    if (action == MotionEvent.ACTION_UP && mDragging) {\n      float velocityX = mVelocityHelper.getXVelocity();\n      float velocityY = mVelocityHelper.getYVelocity();\n      ReactScrollViewHelper.emitScrollEndDragEvent(\n        this,\n        velocityX,\n        velocityY);\n      mDragging = false;\n      // After the touch finishes, we may need to do some scrolling afterwards either as a result\n      // of a fling or because we need to page align the content\n      handlePostTouchScrolling(Math.round(velocityX), Math.round(velocityY));\n    }\n\n    return super.onTouchEvent(ev);\n  }\n\n  @Override\n  public void fling(int velocityX) {\n    if (mPagingEnabled) {\n      smoothScrollToPage(velocityX);\n    } else {\n      super.fling(velocityX);\n    }\n    handlePostTouchScrolling(velocityX, 0);\n  }\n\n  @Override\n  protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n    super.onSizeChanged(w, h, oldw, oldh);\n    if (mRemoveClippedSubviews) {\n      updateClippingRect();\n    }\n  }\n\n  @Override\n  protected void onAttachedToWindow() {\n    super.onAttachedToWindow();\n    if (mRemoveClippedSubviews) {\n      updateClippingRect();\n    }\n  }\n\n  @Override\n  public void updateClippingRect() {\n    if (!mRemoveClippedSubviews) {\n      return;\n    }\n\n    Assertions.assertNotNull(mClippingRect);\n\n    ReactClippingViewGroupHelper.calculateClippingRect(this, mClippingRect);\n    View contentView = getChildAt(0);\n    if (contentView instanceof ReactClippingViewGroup) {\n      ((ReactClippingViewGroup) contentView).updateClippingRect();\n    }\n  }\n\n  @Override\n  public void getClippingRect(Rect outClippingRect) {\n    outClippingRect.set(Assertions.assertNotNull(mClippingRect));\n  }\n\n  private int getSnapInterval() {\n    if (mSnapInterval != 0) {\n      return mSnapInterval;\n    }\n    return getWidth();\n  }\n\n  public void setEndFillColor(int color) {\n    if (color != mEndFillColor) {\n      mEndFillColor = color;\n      mEndBackground = new ColorDrawable(mEndFillColor);\n    }\n  }\n\n  private void enableFpsListener() {\n    if (isScrollPerfLoggingEnabled()) {\n      Assertions.assertNotNull(mFpsListener);\n      Assertions.assertNotNull(mScrollPerfTag);\n      mFpsListener.enable(mScrollPerfTag);\n    }\n  }\n\n  private void disableFpsListener() {\n    if (isScrollPerfLoggingEnabled()) {\n      Assertions.assertNotNull(mFpsListener);\n      Assertions.assertNotNull(mScrollPerfTag);\n      mFpsListener.disable(mScrollPerfTag);\n    }\n  }\n\n  private boolean isScrollPerfLoggingEnabled() {\n    return mFpsListener != null && mScrollPerfTag != null && !mScrollPerfTag.isEmpty();\n  }\n\n  @Override\n  public void draw(Canvas canvas) {\n    if (mEndFillColor != Color.TRANSPARENT) {\n      final View content = getChildAt(0);\n      if (mEndBackground != null && content != null && content.getRight() < getWidth()) {\n        mEndBackground.setBounds(content.getRight(), 0, getWidth(), getHeight());\n        mEndBackground.draw(canvas);\n      }\n    }\n    super.draw(canvas);\n  }\n\n  /**\n   * This handles any sort of scrolling that may occur after a touch is finished.  This may be\n   * momentum scrolling (fling) or because you have pagingEnabled on the scroll view.  Because we\n   * don't get any events from Android about this lifecycle, we do all our detection by creating a\n   * runnable that checks if we scrolled in the last frame and if so assumes we are still scrolling.\n   */\n  @TargetApi(16)\n  private void handlePostTouchScrolling(int velocityX, int velocityY) {\n    // If we aren't going to do anything (send events or snap to page), we can early out.\n    if (!mSendMomentumEvents && !mPagingEnabled && !isScrollPerfLoggingEnabled()) {\n      return;\n    }\n\n    // Check if we are already handling this which may occur if this is called by both the touch up\n    // and a fling call\n    if (mPostTouchRunnable != null) {\n      return;\n    }\n\n    if (mSendMomentumEvents) {\n      ReactScrollViewHelper.emitScrollMomentumBeginEvent(this, velocityX, velocityY);\n    }\n\n    mActivelyScrolling = false;\n    mPostTouchRunnable = new Runnable() {\n\n      private boolean mSnappingToPage = false;\n\n      @Override\n      public void run() {\n        if (mActivelyScrolling) {\n          // We are still scrolling so we just post to check again a frame later\n          mActivelyScrolling = false;\n          ReactHorizontalScrollView.this.postOnAnimationDelayed(this, ReactScrollViewHelper.MOMENTUM_DELAY);\n        } else {\n          if (mPagingEnabled && !mSnappingToPage) {\n            // Only if we have pagingEnabled and we have not snapped to the page do we\n            // need to continue checking for the scroll.  And we cause that scroll by asking for it\n            mSnappingToPage = true;\n            smoothScrollToPage(0);\n            ReactHorizontalScrollView.this.postOnAnimationDelayed(this, ReactScrollViewHelper.MOMENTUM_DELAY);\n          } else {\n            if (mSendMomentumEvents) {\n              ReactScrollViewHelper.emitScrollMomentumEndEvent(ReactHorizontalScrollView.this);\n            }\n            ReactHorizontalScrollView.this.mPostTouchRunnable = null;\n            disableFpsListener();\n          }\n        }\n      }\n    };\n    postOnAnimationDelayed(mPostTouchRunnable, ReactScrollViewHelper.MOMENTUM_DELAY);\n  }\n\n  /**\n   * This will smooth scroll us to the nearest page boundary\n   * It currently just looks at where the content is relative to the page and slides to the nearest\n   * page.  It is intended to be run after we are done scrolling, and handling any momentum\n   * scrolling.\n   */\n  private void smoothScrollToPage(int velocity) {\n    int width = getSnapInterval();\n    int currentX = getScrollX();\n    // TODO (t11123799) - Should we do anything beyond linear accounting of the velocity\n    int predictedX = currentX + velocity;\n    int page = currentX / width;\n    if (predictedX > page * width + width / 2) {\n      page = page + 1;\n    }\n    smoothScrollTo(page * width, getScrollY());\n  }\n\n  @Override\n  public void setBackgroundColor(int color) {\n    mReactBackgroundManager.setBackgroundColor(color);\n  }\n\n  public void setBorderWidth(int position, float width) {\n    mReactBackgroundManager.setBorderWidth(position, width);\n  }\n\n  public void setBorderColor(int position, float color, float alpha) {\n    mReactBackgroundManager.setBorderColor(position, color, alpha);\n  }\n\n  public void setBorderRadius(float borderRadius) {\n    mReactBackgroundManager.setBorderRadius(borderRadius);\n  }\n\n  public void setBorderRadius(float borderRadius, int position) {\n    mReactBackgroundManager.setBorderRadius(borderRadius, position);\n  }\n\n  public void setBorderStyle(@Nullable String style) {\n    mReactBackgroundManager.setBorderStyle(style);\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.scroll;\n\nimport android.graphics.Color;\nimport android.util.DisplayMetrics;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.DisplayMetricsHolder;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.ReactClippingViewGroupHelper;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewGroupManager;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport com.facebook.yoga.YogaConstants;\nimport javax.annotation.Nullable;\n\n/**\n * View manager for {@link ReactHorizontalScrollView} components.\n *\n * <p>Note that {@link ReactScrollView} and {@link ReactHorizontalScrollView} are exposed to JS\n * as a single ScrollView component, configured via the {@code horizontal} boolean property.\n */\n@ReactModule(name = ReactHorizontalScrollViewManager.REACT_CLASS)\npublic class ReactHorizontalScrollViewManager\n    extends ViewGroupManager<ReactHorizontalScrollView>\n    implements ReactScrollViewCommandHelper.ScrollCommandHandler<ReactHorizontalScrollView> {\n\n  protected static final String REACT_CLASS = \"AndroidHorizontalScrollView\";\n\n  private static final int[] SPACING_TYPES = {\n      Spacing.ALL, Spacing.LEFT, Spacing.RIGHT, Spacing.TOP, Spacing.BOTTOM,\n  };\n\n  private @Nullable FpsListener mFpsListener = null;\n\n  public ReactHorizontalScrollViewManager() {\n    this(null);\n  }\n\n  public ReactHorizontalScrollViewManager(@Nullable FpsListener fpsListener) {\n    mFpsListener = fpsListener;\n  }\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public ReactHorizontalScrollView createViewInstance(ThemedReactContext context) {\n    return new ReactHorizontalScrollView(context, mFpsListener);\n  }\n\n  @ReactProp(name = \"scrollEnabled\", defaultBoolean = true)\n  public void setScrollEnabled(ReactHorizontalScrollView view, boolean value) {\n    view.setScrollEnabled(value);\n  }\n\n  @ReactProp(name = \"showsHorizontalScrollIndicator\")\n  public void setShowsHorizontalScrollIndicator(ReactHorizontalScrollView view, boolean value) {\n    view.setHorizontalScrollBarEnabled(value);\n  }\n\n  @ReactProp(name = \"snapToInterval\")\n  public void setSnapToInterval(ReactHorizontalScrollView view, int snapToInterval) {\n    DisplayMetrics screenDisplayMetrics = DisplayMetricsHolder.getScreenDisplayMetrics();\n    view.setSnapInterval((int)(snapToInterval * screenDisplayMetrics.density));\n  }\n\n  @ReactProp(name = ReactClippingViewGroupHelper.PROP_REMOVE_CLIPPED_SUBVIEWS)\n  public void setRemoveClippedSubviews(ReactHorizontalScrollView view, boolean removeClippedSubviews) {\n    view.setRemoveClippedSubviews(removeClippedSubviews);\n  }\n\n  /**\n   * Computing momentum events is potentially expensive since we post a runnable on the UI thread\n   * to see when it is done.  We only do that if {@param sendMomentumEvents} is set to true.  This\n   * is handled automatically in js by checking if there is a listener on the momentum events.\n   *\n   * @param view\n   * @param sendMomentumEvents\n   */\n  @ReactProp(name = \"sendMomentumEvents\")\n  public void setSendMomentumEvents(ReactHorizontalScrollView view, boolean sendMomentumEvents) {\n    view.setSendMomentumEvents(sendMomentumEvents);\n  }\n\n  /**\n   * Tag used for logging scroll performance on this scroll view. Will force momentum events to be\n   * turned on (see setSendMomentumEvents).\n   *\n   * @param view\n   * @param scrollPerfTag\n   */\n  @ReactProp(name = \"scrollPerfTag\")\n  public void setScrollPerfTag(ReactHorizontalScrollView view, String scrollPerfTag) {\n    view.setScrollPerfTag(scrollPerfTag);\n  }\n\n  @ReactProp(name = \"pagingEnabled\")\n  public void setPagingEnabled(ReactHorizontalScrollView view, boolean pagingEnabled) {\n    view.setPagingEnabled(pagingEnabled);\n  }\n\n  /**\n   * Controls overScroll behaviour\n   */\n  @ReactProp(name = \"overScrollMode\")\n  public void setOverScrollMode(ReactHorizontalScrollView view, String value) {\n    view.setOverScrollMode(ReactScrollViewHelper.parseOverScrollMode(value));\n  }\n\n  @Override\n  public void receiveCommand(\n      ReactHorizontalScrollView scrollView,\n      int commandId,\n      @Nullable ReadableArray args) {\n    ReactScrollViewCommandHelper.receiveCommand(this, scrollView, commandId, args);\n  }\n\n  @Override\n  public void flashScrollIndicators(ReactHorizontalScrollView scrollView) {\n    scrollView.flashScrollIndicators();\n  }\n\n  @Override\n  public void scrollTo(\n      ReactHorizontalScrollView scrollView, ReactScrollViewCommandHelper.ScrollToCommandData data) {\n    if (data.mAnimated) {\n      scrollView.smoothScrollTo(data.mDestX, data.mDestY);\n    } else {\n      scrollView.scrollTo(data.mDestX, data.mDestY);\n    }\n  }\n\n  @Override\n  public void scrollToEnd(\n      ReactHorizontalScrollView scrollView,\n      ReactScrollViewCommandHelper.ScrollToEndCommandData data) {\n    // ScrollView always has one child - the scrollable area\n    int right =\n      scrollView.getChildAt(0).getWidth() + scrollView.getPaddingRight();\n    if (data.mAnimated) {\n      scrollView.smoothScrollTo(right, scrollView.getScrollY());\n    } else {\n      scrollView.scrollTo(right, scrollView.getScrollY());\n    }\n  }\n\n  /**\n   * When set, fills the rest of the scrollview with a color to avoid setting a background and\n   * creating unnecessary overdraw.\n   * @param view\n   * @param color\n   */\n  @ReactProp(name = \"endFillColor\", defaultInt = Color.TRANSPARENT, customType = \"Color\")\n  public void setBottomFillColor(ReactHorizontalScrollView view, int color) {\n    view.setEndFillColor(color);\n  }\n\n  @ReactPropGroup(names = {\n      ViewProps.BORDER_RADIUS,\n      ViewProps.BORDER_TOP_LEFT_RADIUS,\n      ViewProps.BORDER_TOP_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_LEFT_RADIUS\n  }, defaultFloat = YogaConstants.UNDEFINED)\n  public void setBorderRadius(ReactHorizontalScrollView view, int index, float borderRadius) {\n    if (!YogaConstants.isUndefined(borderRadius)) {\n      borderRadius = PixelUtil.toPixelFromDIP(borderRadius);\n    }\n\n    if (index == 0) {\n      view.setBorderRadius(borderRadius);\n    } else {\n      view.setBorderRadius(borderRadius, index - 1);\n    }\n  }\n\n  @ReactProp(name = \"borderStyle\")\n  public void setBorderStyle(ReactHorizontalScrollView view, @Nullable String borderStyle) {\n    view.setBorderStyle(borderStyle);\n  }\n\n  @ReactPropGroup(names = {\n      ViewProps.BORDER_WIDTH,\n      ViewProps.BORDER_LEFT_WIDTH,\n      ViewProps.BORDER_RIGHT_WIDTH,\n      ViewProps.BORDER_TOP_WIDTH,\n      ViewProps.BORDER_BOTTOM_WIDTH,\n  }, defaultFloat = YogaConstants.UNDEFINED)\n  public void setBorderWidth(ReactHorizontalScrollView view, int index, float width) {\n    if (!YogaConstants.isUndefined(width)) {\n      width = PixelUtil.toPixelFromDIP(width);\n    }\n    view.setBorderWidth(SPACING_TYPES[index], width);\n  }\n\n  @ReactPropGroup(names = {\n      \"borderColor\", \"borderLeftColor\", \"borderRightColor\", \"borderTopColor\", \"borderBottomColor\"\n  }, customType = \"Color\")\n  public void setBorderColor(ReactHorizontalScrollView view, int index, Integer color) {\n    float rgbComponent =\n        color == null ? YogaConstants.UNDEFINED : (float) ((int)color & 0x00FFFFFF);\n    float alphaComponent = color == null ? YogaConstants.UNDEFINED : (float) ((int)color >>> 24);\n    view.setBorderColor(SPACING_TYPES[index], rgbComponent, alphaComponent);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.scroll;\n\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Rect;\nimport android.graphics.drawable.ColorDrawable;\nimport android.graphics.drawable.Drawable;\nimport android.util.Log;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.OverScroller;\nimport android.widget.ScrollView;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.uimanager.MeasureSpecAssertions;\nimport com.facebook.react.uimanager.ReactClippingViewGroup;\nimport com.facebook.react.uimanager.ReactClippingViewGroupHelper;\nimport com.facebook.react.uimanager.events.NativeGestureUtil;\nimport com.facebook.react.views.view.ReactViewBackgroundManager;\nimport java.lang.reflect.Field;\nimport javax.annotation.Nullable;\n\n/**\n * A simple subclass of ScrollView that doesn't dispatch measure and layout to its children and has\n * a scroll listener to send scroll events to JS.\n *\n * <p>ReactScrollView only supports vertical scrolling. For horizontal scrolling,\n * use {@link ReactHorizontalScrollView}.\n */\npublic class ReactScrollView extends ScrollView implements ReactClippingViewGroup, ViewGroup.OnHierarchyChangeListener, View.OnLayoutChangeListener {\n\n  private static Field sScrollerField;\n  private static boolean sTriedToGetScrollerField = false;\n\n  private final OnScrollDispatchHelper mOnScrollDispatchHelper = new OnScrollDispatchHelper();\n  private final OverScroller mScroller;\n  private final VelocityHelper mVelocityHelper = new VelocityHelper();\n\n  private @Nullable Rect mClippingRect;\n  private boolean mDoneFlinging;\n  private boolean mDragging;\n  private boolean mFlinging;\n  private boolean mRemoveClippedSubviews;\n  private boolean mScrollEnabled = true;\n  private boolean mSendMomentumEvents;\n  private @Nullable FpsListener mFpsListener = null;\n  private @Nullable String mScrollPerfTag;\n  private @Nullable Drawable mEndBackground;\n  private int mEndFillColor = Color.TRANSPARENT;\n  private View mContentView;\n  private ReactViewBackgroundManager mReactBackgroundManager;\n\n  public ReactScrollView(ReactContext context) {\n    this(context, null);\n  }\n\n  public ReactScrollView(ReactContext context, @Nullable FpsListener fpsListener) {\n    super(context);\n    mFpsListener = fpsListener;\n    mReactBackgroundManager = new ReactViewBackgroundManager(this);\n\n    if (!sTriedToGetScrollerField) {\n      sTriedToGetScrollerField = true;\n      try {\n        sScrollerField = ScrollView.class.getDeclaredField(\"mScroller\");\n        sScrollerField.setAccessible(true);\n      } catch (NoSuchFieldException e) {\n        Log.w(\n          ReactConstants.TAG,\n          \"Failed to get mScroller field for ScrollView! \" +\n            \"This app will exhibit the bounce-back scrolling bug :(\");\n      }\n    }\n\n    if (sScrollerField != null) {\n      try {\n        Object scroller = sScrollerField.get(this);\n        if (scroller instanceof OverScroller) {\n          mScroller = (OverScroller) scroller;\n        } else {\n          Log.w(\n            ReactConstants.TAG,\n            \"Failed to cast mScroller field in ScrollView (probably due to OEM changes to AOSP)! \" +\n              \"This app will exhibit the bounce-back scrolling bug :(\");\n          mScroller = null;\n        }\n      } catch (IllegalAccessException e) {\n        throw new RuntimeException(\"Failed to get mScroller from ScrollView!\", e);\n      }\n    } else {\n      mScroller = null;\n    }\n\n    setOnHierarchyChangeListener(this);\n    setScrollBarStyle(SCROLLBARS_OUTSIDE_OVERLAY);\n  }\n\n  public void setSendMomentumEvents(boolean sendMomentumEvents) {\n    mSendMomentumEvents = sendMomentumEvents;\n  }\n\n  public void setScrollPerfTag(String scrollPerfTag) {\n    mScrollPerfTag = scrollPerfTag;\n  }\n\n  public void setScrollEnabled(boolean scrollEnabled) {\n    mScrollEnabled = scrollEnabled;\n  }\n\n  public void flashScrollIndicators() {\n    awakenScrollBars();\n  }\n\n  @Override\n  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n    MeasureSpecAssertions.assertExplicitMeasureSpec(widthMeasureSpec, heightMeasureSpec);\n\n    setMeasuredDimension(\n        MeasureSpec.getSize(widthMeasureSpec),\n        MeasureSpec.getSize(heightMeasureSpec));\n  }\n\n  @Override\n  protected void onLayout(boolean changed, int l, int t, int r, int b) {\n    // Call with the present values in order to re-layout if necessary\n    scrollTo(getScrollX(), getScrollY());\n  }\n\n  @Override\n  protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n    super.onSizeChanged(w, h, oldw, oldh);\n    if (mRemoveClippedSubviews) {\n      updateClippingRect();\n    }\n  }\n\n  @Override\n  protected void onAttachedToWindow() {\n    super.onAttachedToWindow();\n    if (mRemoveClippedSubviews) {\n      updateClippingRect();\n    }\n  }\n\n  @Override\n  protected void onScrollChanged(int x, int y, int oldX, int oldY) {\n    super.onScrollChanged(x, y, oldX, oldY);\n\n    if (mOnScrollDispatchHelper.onScrollChanged(x, y)) {\n      if (mRemoveClippedSubviews) {\n        updateClippingRect();\n      }\n\n      if (mFlinging) {\n        mDoneFlinging = false;\n      }\n\n      ReactScrollViewHelper.emitScrollEvent(\n        this,\n        mOnScrollDispatchHelper.getXFlingVelocity(),\n        mOnScrollDispatchHelper.getYFlingVelocity());\n    }\n  }\n\n  @Override\n  public boolean onInterceptTouchEvent(MotionEvent ev) {\n    if (!mScrollEnabled) {\n      return false;\n    }\n\n    if (super.onInterceptTouchEvent(ev)) {\n      NativeGestureUtil.notifyNativeGestureStarted(this, ev);\n      ReactScrollViewHelper.emitScrollBeginDragEvent(this);\n      mDragging = true;\n      enableFpsListener();\n      return true;\n    }\n\n    return false;\n  }\n\n  @Override\n  public boolean onTouchEvent(MotionEvent ev) {\n    if (!mScrollEnabled) {\n      return false;\n    }\n\n    mVelocityHelper.calculateVelocity(ev);\n    int action = ev.getAction() & MotionEvent.ACTION_MASK;\n    if (action == MotionEvent.ACTION_UP && mDragging) {\n      ReactScrollViewHelper.emitScrollEndDragEvent(\n        this,\n        mVelocityHelper.getXVelocity(),\n        mVelocityHelper.getYVelocity());\n      mDragging = false;\n      disableFpsListener();\n    }\n\n    return super.onTouchEvent(ev);\n  }\n\n  @Override\n  public void setRemoveClippedSubviews(boolean removeClippedSubviews) {\n    if (removeClippedSubviews && mClippingRect == null) {\n      mClippingRect = new Rect();\n    }\n    mRemoveClippedSubviews = removeClippedSubviews;\n    updateClippingRect();\n  }\n\n  @Override\n  public boolean getRemoveClippedSubviews() {\n    return mRemoveClippedSubviews;\n  }\n\n  @Override\n  public void updateClippingRect() {\n    if (!mRemoveClippedSubviews) {\n      return;\n    }\n\n    Assertions.assertNotNull(mClippingRect);\n\n    ReactClippingViewGroupHelper.calculateClippingRect(this, mClippingRect);\n    View contentView = getChildAt(0);\n    if (contentView instanceof ReactClippingViewGroup) {\n      ((ReactClippingViewGroup) contentView).updateClippingRect();\n    }\n  }\n\n  @Override\n  public void getClippingRect(Rect outClippingRect) {\n    outClippingRect.set(Assertions.assertNotNull(mClippingRect));\n  }\n\n  @Override\n  public void fling(int velocityY) {\n    if (mScroller != null) {\n      // FB SCROLLVIEW CHANGE\n\n      // We provide our own version of fling that uses a different call to the standard OverScroller\n      // which takes into account the possibility of adding new content while the ScrollView is\n      // animating. Because we give essentially no max Y for the fling, the fling will continue as long\n      // as there is content. See #onOverScrolled() to see the second part of this change which properly\n      // aborts the scroller animation when we get to the bottom of the ScrollView content.\n\n      int scrollWindowHeight = getHeight() - getPaddingBottom() - getPaddingTop();\n\n      mScroller.fling(\n        getScrollX(),\n        getScrollY(),\n        0,\n        velocityY,\n        0,\n        0,\n        0,\n        Integer.MAX_VALUE,\n        0,\n        scrollWindowHeight / 2);\n\n      postInvalidateOnAnimation();\n\n      // END FB SCROLLVIEW CHANGE\n    } else {\n      super.fling(velocityY);\n    }\n\n    if (mSendMomentumEvents || isScrollPerfLoggingEnabled()) {\n      mFlinging = true;\n      enableFpsListener();\n      ReactScrollViewHelper.emitScrollMomentumBeginEvent(this, 0, velocityY);\n      Runnable r = new Runnable() {\n        @Override\n        public void run() {\n          if (mDoneFlinging) {\n            mFlinging = false;\n            disableFpsListener();\n            ReactScrollViewHelper.emitScrollMomentumEndEvent(ReactScrollView.this);\n          } else {\n            mDoneFlinging = true;\n            ReactScrollView.this.postOnAnimationDelayed(this, ReactScrollViewHelper.MOMENTUM_DELAY);\n          }\n        }\n      };\n      postOnAnimationDelayed(r, ReactScrollViewHelper.MOMENTUM_DELAY);\n    }\n  }\n\n  private void enableFpsListener() {\n    if (isScrollPerfLoggingEnabled()) {\n      Assertions.assertNotNull(mFpsListener);\n      Assertions.assertNotNull(mScrollPerfTag);\n      mFpsListener.enable(mScrollPerfTag);\n    }\n  }\n\n  private void disableFpsListener() {\n    if (isScrollPerfLoggingEnabled()) {\n      Assertions.assertNotNull(mFpsListener);\n      Assertions.assertNotNull(mScrollPerfTag);\n      mFpsListener.disable(mScrollPerfTag);\n    }\n  }\n\n  private boolean isScrollPerfLoggingEnabled() {\n    return mFpsListener != null && mScrollPerfTag != null && !mScrollPerfTag.isEmpty();\n  }\n\n  private int getMaxScrollY() {\n    int contentHeight = mContentView.getHeight();\n    int viewportHeight = getHeight() - getPaddingBottom() - getPaddingTop();\n    return Math.max(0, contentHeight - viewportHeight);\n  }\n\n  @Override\n  public void draw(Canvas canvas) {\n    if (mEndFillColor != Color.TRANSPARENT) {\n      final View content = getChildAt(0);\n      if (mEndBackground != null && content != null && content.getBottom() < getHeight()) {\n        mEndBackground.setBounds(0, content.getBottom(), getWidth(), getHeight());\n        mEndBackground.draw(canvas);\n      }\n    }\n    super.draw(canvas);\n  }\n\n  public void setEndFillColor(int color) {\n    if (color != mEndFillColor) {\n      mEndFillColor = color;\n      mEndBackground = new ColorDrawable(mEndFillColor);\n    }\n  }\n\n  @Override\n  protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY) {\n    if (mScroller != null) {\n      // FB SCROLLVIEW CHANGE\n\n      // This is part two of the reimplementation of fling to fix the bounce-back bug. See #fling() for\n      // more information.\n\n      if (!mScroller.isFinished() && mScroller.getCurrY() != mScroller.getFinalY()) {\n        int scrollRange = getMaxScrollY();\n        if (scrollY >= scrollRange) {\n          mScroller.abortAnimation();\n          scrollY = scrollRange;\n        }\n      }\n\n      // END FB SCROLLVIEW CHANGE\n    }\n\n    super.onOverScrolled(scrollX, scrollY, clampedX, clampedY);\n  }\n\n  @Override\n  public void onChildViewAdded(View parent, View child) {\n    mContentView = child;\n    mContentView.addOnLayoutChangeListener(this);\n  }\n\n  @Override\n  public void onChildViewRemoved(View parent, View child) {\n    mContentView.removeOnLayoutChangeListener(this);\n    mContentView = null;\n  }\n\n  /**\n   * Called when a mContentView's layout has changed. Fixes the scroll position if it's too large\n   * after the content resizes. Without this, the user would see a blank ScrollView when the scroll\n   * position is larger than the ScrollView's max scroll position after the content shrinks.\n   */\n  @Override\n  public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {\n    if (mContentView == null) {\n      return;\n    }\n\n    int currentScrollY = getScrollY();\n    int maxScrollY = getMaxScrollY();\n    if (currentScrollY > maxScrollY) {\n      scrollTo(getScrollX(), maxScrollY);\n    }\n  }\n\n  @Override\n  public void setBackgroundColor(int color) {\n    mReactBackgroundManager.setBackgroundColor(color);\n  }\n\n  public void setBorderWidth(int position, float width) {\n    mReactBackgroundManager.setBorderWidth(position, width);\n  }\n\n  public void setBorderColor(int position, float color, float alpha) {\n    mReactBackgroundManager.setBorderColor(position, color, alpha);\n  }\n\n  public void setBorderRadius(float borderRadius) {\n    mReactBackgroundManager.setBorderRadius(borderRadius);\n  }\n\n  public void setBorderRadius(float borderRadius, int position) {\n    mReactBackgroundManager.setBorderRadius(borderRadius, position);\n  }\n\n  public void setBorderStyle(@Nullable String style) {\n    mReactBackgroundManager.setBorderStyle(style);\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewCommandHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.scroll;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.uimanager.PixelUtil;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * Helper for view managers to handle commands like 'scrollTo'.\n * Shared by {@link ReactScrollViewManager} and {@link ReactHorizontalScrollViewManager}.\n */\npublic class ReactScrollViewCommandHelper {\n\n  public static final int COMMAND_SCROLL_TO = 1;\n  public static final int COMMAND_SCROLL_TO_END = 2;\n  public static final int COMMAND_FLASH_SCROLL_INDICATORS = 3;\n\n  public interface ScrollCommandHandler<T> {\n    void scrollTo(T scrollView, ScrollToCommandData data);\n    void scrollToEnd(T scrollView, ScrollToEndCommandData data);\n    void flashScrollIndicators(T scrollView);\n  }\n\n  public static class ScrollToCommandData {\n\n    public final int mDestX, mDestY;\n    public final boolean mAnimated;\n\n    ScrollToCommandData(int destX, int destY, boolean animated) {\n      mDestX = destX;\n      mDestY = destY;\n      mAnimated = animated;\n    }\n  }\n\n  public static class ScrollToEndCommandData {\n\n    public final boolean mAnimated;\n\n    ScrollToEndCommandData(boolean animated) {\n      mAnimated = animated;\n    }\n  }\n\n  public static Map<String,Integer> getCommandsMap() {\n    return MapBuilder.of(\n        \"scrollTo\",\n        COMMAND_SCROLL_TO,\n        \"scrollToEnd\",\n        COMMAND_SCROLL_TO_END,\n        \"flashScrollIndicators\",\n        COMMAND_FLASH_SCROLL_INDICATORS);\n  }\n\n  public static <T> void receiveCommand(\n      ScrollCommandHandler<T> viewManager,\n      T scrollView,\n      int commandType,\n      @Nullable ReadableArray args) {\n    Assertions.assertNotNull(viewManager);\n    Assertions.assertNotNull(scrollView);\n    Assertions.assertNotNull(args);\n    switch (commandType) {\n      case COMMAND_SCROLL_TO: {\n        int destX = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(0)));\n        int destY = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(1)));\n        boolean animated = args.getBoolean(2);\n        viewManager.scrollTo(scrollView, new ScrollToCommandData(destX, destY, animated));\n        return;\n      }\n      case COMMAND_SCROLL_TO_END: {\n        boolean animated = args.getBoolean(0);\n        viewManager.scrollToEnd(scrollView, new ScrollToEndCommandData(animated));\n        return;\n      }\n      case COMMAND_FLASH_SCROLL_INDICATORS:\n        viewManager.flashScrollIndicators(scrollView);\n        return;\n\n      default:\n        throw new IllegalArgumentException(String.format(\n            \"Unsupported command %d received by %s.\",\n            commandType,\n            viewManager.getClass().getSimpleName()));\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.scroll;\n\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\n\n/**\n * Helper class that deals with emitting Scroll Events.\n */\npublic class ReactScrollViewHelper {\n\n  public static final long MOMENTUM_DELAY = 20;\n  public static final String OVER_SCROLL_ALWAYS = \"always\";\n  public static final String AUTO = \"auto\";\n  public static final String OVER_SCROLL_NEVER = \"never\";\n\n  /**\n   * Shared by {@link ReactScrollView} and {@link ReactHorizontalScrollView}.\n   */\n  public static void emitScrollEvent(ViewGroup scrollView, float xVelocity, float yVelocity) {\n    emitScrollEvent(scrollView, ScrollEventType.SCROLL, xVelocity, yVelocity);\n  }\n\n  public static void emitScrollBeginDragEvent(ViewGroup scrollView) {\n    emitScrollEvent(scrollView, ScrollEventType.BEGIN_DRAG);\n  }\n\n  public static void emitScrollEndDragEvent(\n      ViewGroup scrollView,\n      float xVelocity,\n      float yVelocity) {\n    emitScrollEvent(scrollView, ScrollEventType.END_DRAG, xVelocity, yVelocity);\n  }\n\n  public static void emitScrollMomentumBeginEvent(\n      ViewGroup scrollView,\n      int xVelocity,\n      int yVelocity) {\n    emitScrollEvent(scrollView, ScrollEventType.MOMENTUM_BEGIN, xVelocity, yVelocity);\n  }\n\n  public static void emitScrollMomentumEndEvent(ViewGroup scrollView) {\n    emitScrollEvent(scrollView, ScrollEventType.MOMENTUM_END);\n  }\n\n  private static void emitScrollEvent(ViewGroup scrollView, ScrollEventType scrollEventType) {\n    emitScrollEvent(scrollView, scrollEventType, 0, 0);\n  }\n\n  private static void emitScrollEvent(\n      ViewGroup scrollView,\n      ScrollEventType scrollEventType,\n      float xVelocity,\n      float yVelocity) {\n    View contentView = scrollView.getChildAt(0);\n\n    if (contentView == null) {\n      return;\n    }\n\n    ReactContext reactContext = (ReactContext) scrollView.getContext();\n    reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher().dispatchEvent(\n        ScrollEvent.obtain(\n            scrollView.getId(),\n            scrollEventType,\n            scrollView.getScrollX(),\n            scrollView.getScrollY(),\n            xVelocity,\n            yVelocity,\n            contentView.getWidth(),\n            contentView.getHeight(),\n            scrollView.getWidth(),\n            scrollView.getHeight()));\n  }\n\n  public static int parseOverScrollMode(String jsOverScrollMode) {\n    if (jsOverScrollMode == null || jsOverScrollMode.equals(AUTO)) {\n      return View.OVER_SCROLL_IF_CONTENT_SCROLLS;\n    } else if (jsOverScrollMode.equals(OVER_SCROLL_ALWAYS)) {\n      return View.OVER_SCROLL_ALWAYS;\n    } else if (jsOverScrollMode.equals(OVER_SCROLL_NEVER)) {\n      return View.OVER_SCROLL_NEVER;\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"wrong overScrollMode: \" + jsOverScrollMode);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.scroll;\n\nimport android.graphics.Color;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.ReactClippingViewGroupHelper;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewGroupManager;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport com.facebook.yoga.YogaConstants;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * View manager for {@link ReactScrollView} components.\n *\n * <p>Note that {@link ReactScrollView} and {@link ReactHorizontalScrollView} are exposed to JS\n * as a single ScrollView component, configured via the {@code horizontal} boolean property.\n */\n@ReactModule(name = ReactScrollViewManager.REACT_CLASS)\npublic class ReactScrollViewManager\n    extends ViewGroupManager<ReactScrollView>\n    implements ReactScrollViewCommandHelper.ScrollCommandHandler<ReactScrollView> {\n\n  protected static final String REACT_CLASS = \"RCTScrollView\";\n\n  private static final int[] SPACING_TYPES = {\n      Spacing.ALL, Spacing.LEFT, Spacing.RIGHT, Spacing.TOP, Spacing.BOTTOM,\n  };\n\n  private @Nullable FpsListener mFpsListener = null;\n\n  public ReactScrollViewManager() {\n    this(null);\n  }\n\n  public ReactScrollViewManager(@Nullable FpsListener fpsListener) {\n    mFpsListener = fpsListener;\n  }\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public ReactScrollView createViewInstance(ThemedReactContext context) {\n    return new ReactScrollView(context, mFpsListener);\n  }\n\n  @ReactProp(name = \"scrollEnabled\", defaultBoolean = true)\n  public void setScrollEnabled(ReactScrollView view, boolean value) {\n    view.setScrollEnabled(value);\n  }\n\n  @ReactProp(name = \"showsVerticalScrollIndicator\")\n  public void setShowsVerticalScrollIndicator(ReactScrollView view, boolean value) {\n    view.setVerticalScrollBarEnabled(value);\n  }\n\n  @ReactProp(name = ReactClippingViewGroupHelper.PROP_REMOVE_CLIPPED_SUBVIEWS)\n  public void setRemoveClippedSubviews(ReactScrollView view, boolean removeClippedSubviews) {\n    view.setRemoveClippedSubviews(removeClippedSubviews);\n  }\n\n  /**\n   * Computing momentum events is potentially expensive since we post a runnable on the UI thread\n   * to see when it is done.  We only do that if {@param sendMomentumEvents} is set to true.  This\n   * is handled automatically in js by checking if there is a listener on the momentum events.\n   *\n   * @param view\n   * @param sendMomentumEvents\n   */\n  @ReactProp(name = \"sendMomentumEvents\")\n  public void setSendMomentumEvents(ReactScrollView view, boolean sendMomentumEvents) {\n    view.setSendMomentumEvents(sendMomentumEvents);\n  }\n\n  /**\n   * Tag used for logging scroll performance on this scroll view. Will force momentum events to be\n   * turned on (see setSendMomentumEvents).\n   *\n   * @param view\n   * @param scrollPerfTag\n   */\n  @ReactProp(name = \"scrollPerfTag\")\n  public void setScrollPerfTag(ReactScrollView view, String scrollPerfTag) {\n    view.setScrollPerfTag(scrollPerfTag);\n  }\n\n  /**\n   * When set, fills the rest of the scrollview with a color to avoid setting a background and\n   * creating unnecessary overdraw.\n   * @param view\n   * @param color\n   */\n  @ReactProp(name = \"endFillColor\", defaultInt = Color.TRANSPARENT, customType = \"Color\")\n  public void setBottomFillColor(ReactScrollView view, int color) {\n    view.setEndFillColor(color);\n  }\n\n  /**\n   * Controls overScroll behaviour\n   */\n  @ReactProp(name = \"overScrollMode\")\n  public void setOverScrollMode(ReactScrollView view, String value) {\n    view.setOverScrollMode(ReactScrollViewHelper.parseOverScrollMode(value));\n  }\n\n  @Override\n  public @Nullable Map<String, Integer> getCommandsMap() {\n    return ReactScrollViewCommandHelper.getCommandsMap();\n  }\n\n  @Override\n  public void receiveCommand(\n      ReactScrollView scrollView,\n      int commandId,\n      @Nullable ReadableArray args) {\n    ReactScrollViewCommandHelper.receiveCommand(this, scrollView, commandId, args);\n  }\n\n  @Override\n  public void flashScrollIndicators(ReactScrollView scrollView) {\n    scrollView.flashScrollIndicators();\n  }\n\n  @Override\n  public void scrollTo(\n      ReactScrollView scrollView, ReactScrollViewCommandHelper.ScrollToCommandData data) {\n    if (data.mAnimated) {\n      scrollView.smoothScrollTo(data.mDestX, data.mDestY);\n    } else {\n      scrollView.scrollTo(data.mDestX, data.mDestY);\n    }\n  }\n  @ReactPropGroup(names = {\n      ViewProps.BORDER_RADIUS,\n      ViewProps.BORDER_TOP_LEFT_RADIUS,\n      ViewProps.BORDER_TOP_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_LEFT_RADIUS\n  }, defaultFloat = YogaConstants.UNDEFINED)\n  public void setBorderRadius(ReactScrollView view, int index, float borderRadius) {\n    if (!YogaConstants.isUndefined(borderRadius)) {\n      borderRadius = PixelUtil.toPixelFromDIP(borderRadius);\n    }\n\n    if (index == 0) {\n      view.setBorderRadius(borderRadius);\n    } else {\n      view.setBorderRadius(borderRadius, index - 1);\n    }\n  }\n\n  @ReactProp(name = \"borderStyle\")\n  public void setBorderStyle(ReactScrollView view, @Nullable String borderStyle) {\n    view.setBorderStyle(borderStyle);\n  }\n\n  @ReactPropGroup(names = {\n      ViewProps.BORDER_WIDTH,\n      ViewProps.BORDER_LEFT_WIDTH,\n      ViewProps.BORDER_RIGHT_WIDTH,\n      ViewProps.BORDER_TOP_WIDTH,\n      ViewProps.BORDER_BOTTOM_WIDTH,\n  }, defaultFloat = YogaConstants.UNDEFINED)\n  public void setBorderWidth(ReactScrollView view, int index, float width) {\n    if (!YogaConstants.isUndefined(width)) {\n      width = PixelUtil.toPixelFromDIP(width);\n    }\n    view.setBorderWidth(SPACING_TYPES[index], width);\n  }\n\n  @ReactPropGroup(names = {\n      \"borderColor\", \"borderLeftColor\", \"borderRightColor\", \"borderTopColor\", \"borderBottomColor\"\n  }, customType = \"Color\")\n  public void setBorderColor(ReactScrollView view, int index, Integer color) {\n    float rgbComponent =\n        color == null ? YogaConstants.UNDEFINED : (float) ((int)color & 0x00FFFFFF);\n    float alphaComponent = color == null ? YogaConstants.UNDEFINED : (float) ((int)color >>> 24);\n    view.setBorderColor(SPACING_TYPES[index], rgbComponent, alphaComponent);\n  }\n\n  @Override\n  public void scrollToEnd(\n      ReactScrollView scrollView,\n      ReactScrollViewCommandHelper.ScrollToEndCommandData data) {\n    // ScrollView always has one child - the scrollable area\n    int bottom =\n      scrollView.getChildAt(0).getHeight() + scrollView.getPaddingBottom();\n    if (data.mAnimated) {\n      scrollView.smoothScrollTo(scrollView.getScrollX(), bottom);\n    } else {\n      scrollView.scrollTo(scrollView.getScrollX(), bottom);\n    }\n  }\n\n  @Override\n  public @Nullable Map getExportedCustomDirectEventTypeConstants() {\n    return createExportedCustomDirectEventTypeConstants();\n  }\n\n  public static Map createExportedCustomDirectEventTypeConstants() {\n    return MapBuilder.builder()\n        .put(ScrollEventType.SCROLL.getJSEventName(), MapBuilder.of(\"registrationName\", \"onScroll\"))\n        .put(ScrollEventType.BEGIN_DRAG.getJSEventName(), MapBuilder.of(\"registrationName\", \"onScrollBeginDrag\"))\n        .put(ScrollEventType.END_DRAG.getJSEventName(), MapBuilder.of(\"registrationName\", \"onScrollEndDrag\"))\n        .put(ScrollEventType.MOMENTUM_BEGIN.getJSEventName(), MapBuilder.of(\"registrationName\", \"onMomentumScrollBegin\"))\n        .put(ScrollEventType.MOMENTUM_END.getJSEventName(), MapBuilder.of(\"registrationName\", \"onMomentumScrollEnd\"))\n        .build();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.scroll;\n\nimport javax.annotation.Nullable;\n\nimport java.lang.Override;\n\nimport android.support.v4.util.Pools;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * A event dispatched from a ScrollView scrolling.\n */\npublic class ScrollEvent extends Event<ScrollEvent> {\n\n  private static final Pools.SynchronizedPool<ScrollEvent> EVENTS_POOL =\n      new Pools.SynchronizedPool<>(3);\n\n  private int mScrollX;\n  private int mScrollY;\n  private double mXVelocity;\n  private double mYVelocity;\n  private int mContentWidth;\n  private int mContentHeight;\n  private int mScrollViewWidth;\n  private int mScrollViewHeight;\n  private @Nullable ScrollEventType mScrollEventType;\n\n  public static ScrollEvent obtain(\n      int viewTag,\n      ScrollEventType scrollEventType,\n      int scrollX,\n      int scrollY,\n      float xVelocity,\n      float yVelocity,\n      int contentWidth,\n      int contentHeight,\n      int scrollViewWidth,\n      int scrollViewHeight) {\n    ScrollEvent event = EVENTS_POOL.acquire();\n    if (event == null) {\n      event = new ScrollEvent();\n    }\n    event.init(\n        viewTag,\n        scrollEventType,\n        scrollX,\n        scrollY,\n        xVelocity,\n        yVelocity,\n        contentWidth,\n        contentHeight,\n        scrollViewWidth,\n        scrollViewHeight);\n    return event;\n  }\n\n  @Override\n  public void onDispose() {\n    EVENTS_POOL.release(this);\n  }\n\n  private ScrollEvent() {\n  }\n\n  private void init(\n      int viewTag,\n      ScrollEventType scrollEventType,\n      int scrollX,\n      int scrollY,\n      float xVelocity,\n      float yVelocity,\n      int contentWidth,\n      int contentHeight,\n      int scrollViewWidth,\n      int scrollViewHeight) {\n    super.init(viewTag);\n    mScrollEventType = scrollEventType;\n    mScrollX = scrollX;\n    mScrollY = scrollY;\n    mXVelocity = xVelocity;\n    mYVelocity = yVelocity;\n    mContentWidth = contentWidth;\n    mContentHeight = contentHeight;\n    mScrollViewWidth = scrollViewWidth;\n    mScrollViewHeight = scrollViewHeight;\n  }\n\n  @Override\n  public String getEventName() {\n    return Assertions.assertNotNull(mScrollEventType).getJSEventName();\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    // All scroll events for a given view can be coalesced\n    return 0;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    // Only SCROLL events can be coalesced, all others can not be\n    if (mScrollEventType == ScrollEventType.SCROLL) {\n      return true;\n    }\n    return false;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap contentInset = Arguments.createMap();\n    contentInset.putDouble(\"top\", 0);\n    contentInset.putDouble(\"bottom\", 0);\n    contentInset.putDouble(\"left\", 0);\n    contentInset.putDouble(\"right\", 0);\n\n    WritableMap contentOffset = Arguments.createMap();\n    contentOffset.putDouble(\"x\", PixelUtil.toDIPFromPixel(mScrollX));\n    contentOffset.putDouble(\"y\", PixelUtil.toDIPFromPixel(mScrollY));\n\n    WritableMap contentSize = Arguments.createMap();\n    contentSize.putDouble(\"width\", PixelUtil.toDIPFromPixel(mContentWidth));\n    contentSize.putDouble(\"height\", PixelUtil.toDIPFromPixel(mContentHeight));\n\n    WritableMap layoutMeasurement = Arguments.createMap();\n    layoutMeasurement.putDouble(\"width\", PixelUtil.toDIPFromPixel(mScrollViewWidth));\n    layoutMeasurement.putDouble(\"height\", PixelUtil.toDIPFromPixel(mScrollViewHeight));\n\n    WritableMap velocity = Arguments.createMap();\n    velocity.putDouble(\"x\", mXVelocity);\n    velocity.putDouble(\"y\", mYVelocity);\n\n    WritableMap event = Arguments.createMap();\n    event.putMap(\"contentInset\", contentInset);\n    event.putMap(\"contentOffset\", contentOffset);\n    event.putMap(\"contentSize\", contentSize);\n    event.putMap(\"layoutMeasurement\", layoutMeasurement);\n    event.putMap(\"velocity\", velocity);\n\n    event.putInt(\"target\", getViewTag());\n    event.putBoolean(\"responderIgnoreScroll\", true);\n    return event;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEventType.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.scroll;\n\n/**\n * Scroll event types that JS module RCTEventEmitter can understand\n */\npublic enum ScrollEventType {\n  BEGIN_DRAG(\"topScrollBeginDrag\"),\n  END_DRAG(\"topScrollEndDrag\"),\n  SCROLL(\"topScroll\"),\n  MOMENTUM_BEGIN(\"topMomentumScrollBegin\"),\n  MOMENTUM_END(\"topMomentumScrollEnd\");\n\n  private final String mJSEventName;\n\n  ScrollEventType(String jsEventName) {\n    mJSEventName = jsEventName;\n  }\n\n  public String getJSEventName() {\n    return mJSEventName;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/scroll/VelocityHelper.java",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.scroll;\n\nimport javax.annotation.Nullable;\n\nimport android.view.MotionEvent;\nimport android.view.VelocityTracker;\n\n/**\n * This Class helps to calculate the velocity for all ScrollView. The x and y velocity\n * will later on send to ReactScrollViewHelper for further use.\n *\n */\npublic class VelocityHelper {\n\n  private @Nullable VelocityTracker mVelocityTracker;\n  private float mXVelocity;\n  private float mYVelocity;\n\n  /**\n   * Call from a ScrollView in onTouchEvent.\n   * Calculating the velocity for END_DRAG movement and send them back to react ScrollResponder.js\n   * */\n  public void calculateVelocity(MotionEvent ev) {\n    int action = ev.getAction() & MotionEvent.ACTION_MASK;\n    if (mVelocityTracker == null) {\n      mVelocityTracker = VelocityTracker.obtain();\n    }\n    mVelocityTracker.addMovement(ev);\n\n    switch (action) {\n      case MotionEvent.ACTION_UP:\n      case MotionEvent.ACTION_CANCEL: {\n        // Calculate velocity on END_DRAG\n        mVelocityTracker.computeCurrentVelocity(1); // points/millisecond\n        mXVelocity = mVelocityTracker.getXVelocity();\n        mYVelocity = mVelocityTracker.getYVelocity();\n\n        if (mVelocityTracker != null) {\n          mVelocityTracker.recycle();\n          mVelocityTracker = null;\n        }\n        break;\n      }\n    }\n  }\n\n  /* Needs to call ACTION_UP/CANCEL to update the mXVelocity */\n  public float getXVelocity() {\n    return mXVelocity;\n  }\n\n  /* Needs to call ACTION_UP/CANCEL to update the mYVelocity */\n  public float getYVelocity() {\n    return mYVelocity;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/slider/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"slider\",\n    srcs = glob([\"*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v7/appcompat-orig:appcompat\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSlider.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.slider;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.widget.SeekBar;\n\nimport javax.annotation.Nullable;\n\n/**\n * Slider that behaves more like the iOS one, for consistency.\n *\n * On iOS, the value is 0..1. Android SeekBar only supports integer values.\n * For consistency, we pretend in JS that the value is 0..1 but set the\n * SeekBar value to 0..100.\n *\n * Note that the slider is _not_ a controlled component (setValue isn't called\n * during dragging).\n */\npublic class ReactSlider extends SeekBar {\n\n  /**\n   * If step is 0 (unset) we default to this total number of steps.\n   * Don't use 100 which leads to rounding errors (0.200000000001).\n   */\n  private static int DEFAULT_TOTAL_STEPS = 128;\n\n  /**\n   * We want custom min..max range.\n   * Android only supports 0..max range so we implement this ourselves.\n   */\n  private double mMinValue = 0;\n  private double mMaxValue = 0;\n\n  /**\n   * Value sent from JS (setState).\n   * Doesn't get updated during drag (slider is not a controlled component).\n   */\n  private double mValue = 0;\n\n  /**\n   * If zero it's determined automatically.\n   */\n  private double mStep = 0;\n  private double mStepCalculated = 0;\n\n  public ReactSlider(Context context, @Nullable AttributeSet attrs, int style) {\n    super(context, attrs, style);\n  }\n\n  /* package */ void setMaxValue(double max) {\n    mMaxValue = max;\n    updateAll();\n  }\n\n  /* package */ void setMinValue(double min) {\n    mMinValue = min;\n    updateAll();\n  }\n\n  /* package */ void setValue(double value) {\n    mValue = value;\n    updateValue();\n  }\n\n  /* package */ void setStep(double step) {\n    mStep = step;\n    updateAll();\n  }\n\n  /**\n   * Convert SeekBar's native progress value (e.g. 0..100) to a value\n   * passed to JS (e.g. -1.0..2.5).\n   */\n  public double toRealProgress(int seekBarProgress) {\n    if (seekBarProgress == getMax()) {\n      return mMaxValue;\n    }\n    return seekBarProgress * getStepValue() + mMinValue;\n  }\n\n  /**\n   * Update underlying native SeekBar's values.\n   */\n  private void updateAll() {\n    if (mStep == 0) {\n      mStepCalculated = (mMaxValue - mMinValue) / (double) DEFAULT_TOTAL_STEPS;\n    }\n    setMax(getTotalSteps());\n    updateValue();\n  }\n\n  /**\n   * Update value only (optimization in case only value is set).\n   */\n  private void updateValue() {\n    setProgress((int) Math.round(\n      (mValue - mMinValue) / (mMaxValue - mMinValue) * getTotalSteps()));\n  }\n\n  private int getTotalSteps() {\n    return (int) Math.ceil((mMaxValue - mMinValue) / getStepValue());\n  }\n\n  private double getStepValue() {\n    return mStep > 0 ? mStep : mStepCalculated;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.slider;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by a ReactSliderManager when user changes slider position.\n */\npublic class ReactSliderEvent extends Event<ReactSliderEvent> {\n\n  public static final String EVENT_NAME = \"topChange\";\n\n  private final double mValue;\n  private final boolean mFromUser;\n\n  public ReactSliderEvent(int viewId, double value, boolean fromUser) {\n    super(viewId);\n    mValue = value;\n    mFromUser = fromUser;\n  }\n\n  public double getValue() {\n    return mValue;\n  }\n\n  public boolean isFromUser() {\n    return mFromUser;\n  }\n\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    return 0;\n  }\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putInt(\"target\", getViewTag());\n    eventData.putDouble(\"value\", getValue());\n    eventData.putBoolean(\"fromUser\", isFromUser());\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.slider;\n\nimport android.graphics.PorterDuff;\nimport android.graphics.drawable.Drawable;\nimport android.graphics.drawable.LayerDrawable;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.SeekBar;\n\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.uimanager.LayoutShadowNode;\nimport com.facebook.react.uimanager.SimpleViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaMeasureMode;\nimport com.facebook.yoga.YogaMeasureOutput;\nimport com.facebook.yoga.YogaNode;\n\nimport java.util.Map;\n\n/**\n * Manages instances of {@code ReactSlider}.\n *\n * Note that the slider is _not_ a controlled component.\n */\npublic class ReactSliderManager extends SimpleViewManager<ReactSlider> {\n\n  private static final int STYLE = android.R.attr.seekBarStyle;\n\n  private static final String REACT_CLASS = \"RCTSlider\";\n\n  static class ReactSliderShadowNode extends LayoutShadowNode implements\n      YogaMeasureFunction {\n\n    private int mWidth;\n    private int mHeight;\n    private boolean mMeasured;\n\n    private ReactSliderShadowNode() {\n      setMeasureFunction(this);\n    }\n\n    @Override\n    public long measure(\n        YogaNode node,\n        float width,\n        YogaMeasureMode widthMode,\n        float height,\n        YogaMeasureMode heightMode) {\n      if (!mMeasured) {\n        SeekBar reactSlider = new ReactSlider(getThemedContext(), null, STYLE);\n        final int spec = View.MeasureSpec.makeMeasureSpec(\n            ViewGroup.LayoutParams.WRAP_CONTENT,\n            View.MeasureSpec.UNSPECIFIED);\n        reactSlider.measure(spec, spec);\n        mWidth = reactSlider.getMeasuredWidth();\n        mHeight = reactSlider.getMeasuredHeight();\n        mMeasured = true;\n      }\n\n      return YogaMeasureOutput.make(mWidth, mHeight);\n    }\n  }\n\n  private static final SeekBar.OnSeekBarChangeListener ON_CHANGE_LISTENER =\n      new SeekBar.OnSeekBarChangeListener() {\n        @Override\n        public void onProgressChanged(SeekBar seekbar, int progress, boolean fromUser) {\n          ReactContext reactContext = (ReactContext) seekbar.getContext();\n          reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher().dispatchEvent(\n              new ReactSliderEvent(\n                  seekbar.getId(),\n                  ((ReactSlider) seekbar).toRealProgress(progress),\n                  fromUser));\n        }\n\n        @Override\n        public void onStartTrackingTouch(SeekBar seekbar) {\n        }\n\n        @Override\n        public void onStopTrackingTouch(SeekBar seekbar) {\n          ReactContext reactContext = (ReactContext) seekbar.getContext();\n          reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher().dispatchEvent(\n              new ReactSlidingCompleteEvent(\n                  seekbar.getId(),\n                  ((ReactSlider) seekbar).toRealProgress(seekbar.getProgress())));\n        }\n      };\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public LayoutShadowNode createShadowNodeInstance() {\n    return new ReactSliderShadowNode();\n  }\n\n  @Override\n  public Class getShadowNodeClass() {\n    return ReactSliderShadowNode.class;\n  }\n\n  @Override\n  protected ReactSlider createViewInstance(ThemedReactContext context) {\n    return new ReactSlider(context, null, STYLE);\n  }\n\n  @ReactProp(name = ViewProps.ENABLED, defaultBoolean = true)\n  public void setEnabled(ReactSlider view, boolean enabled) {\n    view.setEnabled(enabled);\n  }\n\n  @ReactProp(name = \"value\", defaultDouble = 0d)\n  public void setValue(ReactSlider view, double value) {\n    view.setOnSeekBarChangeListener(null);\n    view.setValue(value);\n    view.setOnSeekBarChangeListener(ON_CHANGE_LISTENER);\n  }\n\n  @ReactProp(name = \"minimumValue\", defaultDouble = 0d)\n  public void setMinimumValue(ReactSlider view, double value) {\n    view.setMinValue(value);\n  }\n\n  @ReactProp(name = \"maximumValue\", defaultDouble = 1d)\n  public void setMaximumValue(ReactSlider view, double value) {\n    view.setMaxValue(value);\n  }\n\n  @ReactProp(name = \"step\", defaultDouble = 0d)\n  public void setStep(ReactSlider view, double value) {\n    view.setStep(value);\n  }\n\n  @ReactProp(name = \"thumbTintColor\", customType = \"Color\")\n  public void setThumbTintColor(ReactSlider view, Integer color) {\n    if (color == null) {\n      view.getThumb().clearColorFilter();\n    } else {\n      view.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);\n    }\n  }\n\n  @ReactProp(name = \"minimumTrackTintColor\", customType = \"Color\")\n  public void setMinimumTrackTintColor(ReactSlider view, Integer color) {\n    LayerDrawable drawable = (LayerDrawable) view.getProgressDrawable().getCurrent();\n    Drawable progress = drawable.findDrawableByLayerId(android.R.id.progress);\n    if (color == null) {\n      progress.clearColorFilter();\n    } else {\n      progress.setColorFilter(color, PorterDuff.Mode.SRC_IN);\n    }\n  }\n\n  @ReactProp(name = \"maximumTrackTintColor\", customType = \"Color\")\n  public void setMaximumTrackTintColor(ReactSlider view, Integer color) {\n    LayerDrawable drawable = (LayerDrawable) view.getProgressDrawable().getCurrent();\n    Drawable background = drawable.findDrawableByLayerId(android.R.id.background);\n    if (color == null) {\n      background.clearColorFilter();\n    } else {\n      background.setColorFilter(color, PorterDuff.Mode.SRC_IN);\n    }\n  }\n\n  @Override\n  protected void addEventEmitters(final ThemedReactContext reactContext, final ReactSlider view) {\n    view.setOnSeekBarChangeListener(ON_CHANGE_LISTENER);\n  }\n\n  @Override\n  public Map getExportedCustomDirectEventTypeConstants() {\n    return MapBuilder.of(\n        ReactSlidingCompleteEvent.EVENT_NAME,\n        MapBuilder.of(\"registrationName\", \"onSlidingComplete\"));\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSlidingCompleteEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.slider;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted when the user finishes dragging the slider.\n */\npublic class ReactSlidingCompleteEvent extends Event<ReactSlidingCompleteEvent> {\n\n  public static final String EVENT_NAME = \"topSlidingComplete\";\n\n  private final double mValue;\n\n  public ReactSlidingCompleteEvent(int viewId, double value) {\n    super(viewId);\n    mValue = value;\n  }\n\n  public double getValue() {\n    return mValue;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    return 0;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    return false;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putInt(\"target\", getViewTag());\n    eventData.putDouble(\"value\", getValue());\n    return eventData;\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"swiperefresh\",\n    srcs = glob([\"*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/scroll:scroll\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.swiperefresh;\n\nimport android.support.v4.widget.SwipeRefreshLayout;\nimport android.view.MotionEvent;\nimport android.view.ViewConfiguration;\n\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.events.NativeGestureUtil;\n\n/**\n * Basic extension of {@link SwipeRefreshLayout} with ReactNative-specific functionality.\n */\npublic class ReactSwipeRefreshLayout extends SwipeRefreshLayout {\n\n  private static final float DEFAULT_CIRCLE_TARGET = 64;\n\n  private boolean mDidLayout = false;\n  private boolean mRefreshing = false;\n  private float mProgressViewOffset = 0;\n  private int mTouchSlop;\n  private float mPrevTouchX;\n  private boolean mIntercepted;\n\n  public ReactSwipeRefreshLayout(ReactContext reactContext) {\n    super(reactContext);\n    mTouchSlop = ViewConfiguration.get(reactContext).getScaledTouchSlop();\n  }\n\n  @Override\n  public void setRefreshing(boolean refreshing) {\n    mRefreshing = refreshing;\n\n    // `setRefreshing` must be called after the initial layout otherwise it\n    // doesn't work when mounting the component with `refreshing = true`.\n    // Known Android issue: https://code.google.com/p/android/issues/detail?id=77712\n    if (mDidLayout) {\n      super.setRefreshing(refreshing);\n    }\n  }\n\n  public void setProgressViewOffset(float offset) {\n    mProgressViewOffset = offset;\n\n    // The view must be measured before calling `getProgressCircleDiameter` so\n    // don't do it before the initial layout.\n    if (mDidLayout) {\n      int diameter = getProgressCircleDiameter();\n      int start = Math.round(PixelUtil.toPixelFromDIP(offset)) - diameter;\n      int end = Math.round(PixelUtil.toPixelFromDIP(offset + DEFAULT_CIRCLE_TARGET) - diameter);\n      setProgressViewOffset(false, start, end);\n    }\n  }\n\n  @Override\n  public void onLayout(boolean changed, int left, int top, int right, int bottom) {\n    super.onLayout(changed, left, top, right, bottom);\n\n    if (!mDidLayout) {\n      mDidLayout = true;\n\n      // Update values that must be set after initial layout.\n      setProgressViewOffset(mProgressViewOffset);\n      setRefreshing(mRefreshing);\n    }\n  }\n\n  /**\n   * {@link SwipeRefreshLayout} overrides {@link ViewGroup#requestDisallowInterceptTouchEvent} and\n   * swallows it. This means that any component underneath SwipeRefreshLayout will now interact\n   * incorrectly with Views that are above SwipeRefreshLayout. We fix that by transmitting the call\n   * to this View's parents.\n   */\n  @Override\n  public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {\n    if (getParent() != null) {\n      getParent().requestDisallowInterceptTouchEvent(disallowIntercept);\n    }\n  }\n\n  @Override\n  public boolean onInterceptTouchEvent(MotionEvent ev) {\n    if (shouldInterceptTouchEvent(ev) && super.onInterceptTouchEvent(ev)) {\n      NativeGestureUtil.notifyNativeGestureStarted(this, ev);\n      return true;\n    }\n    return false;\n  }\n\n  /**\n   * {@link SwipeRefreshLayout} completely bypasses ViewGroup's \"disallowIntercept\" by overriding\n   * {@link ViewGroup#onInterceptTouchEvent} and never calling super.onInterceptTouchEvent().\n   * This means that horizontal scrolls will always be intercepted, even though they shouldn't, so\n   * we have to check for that manually here.\n   */\n  private boolean shouldInterceptTouchEvent(MotionEvent ev) {\n    switch (ev.getAction()) {\n      case MotionEvent.ACTION_DOWN:\n        mPrevTouchX = ev.getX();\n        mIntercepted = false;\n        break;\n\n      case MotionEvent.ACTION_MOVE:\n        final float eventX = ev.getX();\n        final float xDiff = Math.abs(eventX - mPrevTouchX);\n\n        if (mIntercepted || xDiff > mTouchSlop) {\n          mIntercepted = true;\n          return false;\n        }\n    }\n    return true;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/RefreshEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.swiperefresh;\n\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\npublic class RefreshEvent extends Event<RefreshEvent> {\n\n    protected RefreshEvent(int viewTag) {\n        super(viewTag);\n    }\n\n    @Override\n    public String getEventName() {\n        return \"topRefresh\";\n    }\n\n    @Override\n    public void dispatch(RCTEventEmitter rctEventEmitter) {\n        rctEventEmitter.receiveEvent(getViewTag(), getEventName(), null);\n    }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.swiperefresh;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Map;\n\nimport android.graphics.Color;\nimport android.support.v4.widget.SwipeRefreshLayout;\nimport android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener;\n\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewGroupManager;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\n\nimport static com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager.REACT_CLASS;\n\n/**\n * ViewManager for {@link ReactSwipeRefreshLayout} which allows the user to \"pull to refresh\" a\n * child view. Emits an {@code onRefresh} event when this happens.\n */\n@ReactModule(name = REACT_CLASS)\npublic class SwipeRefreshLayoutManager extends ViewGroupManager<ReactSwipeRefreshLayout> {\n\n  protected static final String REACT_CLASS = \"AndroidSwipeRefreshLayout\";\n\n  @Override\n  protected ReactSwipeRefreshLayout createViewInstance(ThemedReactContext reactContext) {\n    return new ReactSwipeRefreshLayout(reactContext);\n  }\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @ReactProp(name = ViewProps.ENABLED, defaultBoolean = true)\n  public void setEnabled(ReactSwipeRefreshLayout view, boolean enabled) {\n    view.setEnabled(enabled);\n  }\n\n  @ReactProp(name = \"colors\", customType = \"ColorArray\")\n  public void setColors(ReactSwipeRefreshLayout view, @Nullable ReadableArray colors) {\n    if (colors != null) {\n      int[] colorValues = new int[colors.size()];\n      for (int i = 0; i < colors.size(); i++) {\n        colorValues[i] = colors.getInt(i);\n      }\n      view.setColorSchemeColors(colorValues);\n    } else {\n      view.setColorSchemeColors();\n    }\n  }\n\n  @ReactProp(name = \"progressBackgroundColor\", defaultInt = Color.TRANSPARENT, customType = \"Color\")\n  public void setProgressBackgroundColor(ReactSwipeRefreshLayout view, int color) {\n    view.setProgressBackgroundColorSchemeColor(color);\n  }\n\n  @ReactProp(name = \"size\", defaultInt = SwipeRefreshLayout.DEFAULT)\n  public void setSize(ReactSwipeRefreshLayout view, int size) {\n    view.setSize(size);\n  }\n\n  @ReactProp(name = \"refreshing\")\n  public void setRefreshing(ReactSwipeRefreshLayout view, boolean refreshing) {\n    view.setRefreshing(refreshing);\n  }\n\n  @ReactProp(name = \"progressViewOffset\", defaultFloat = 0)\n  public void setProgressViewOffset(final ReactSwipeRefreshLayout view, final float offset) {\n    view.setProgressViewOffset(offset);\n  }\n\n  @Override\n  protected void addEventEmitters(\n      final ThemedReactContext reactContext,\n      final ReactSwipeRefreshLayout view) {\n    view.setOnRefreshListener(\n        new OnRefreshListener() {\n          @Override\n          public void onRefresh() {\n            reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()\n                .dispatchEvent(new RefreshEvent(view.getId()));\n          }\n        });\n  }\n\n  @Nullable\n  @Override\n  public Map<String, Object> getExportedViewConstants() {\n    return MapBuilder.<String, Object>of(\n        \"SIZE\",\n        MapBuilder.of(\"DEFAULT\", SwipeRefreshLayout.DEFAULT, \"LARGE\", SwipeRefreshLayout.LARGE));\n  }\n\n  @Override\n  public Map<String, Object> getExportedCustomDirectEventTypeConstants() {\n    return MapBuilder.<String, Object>builder()\n        .put(\"topRefresh\", MapBuilder.of(\"registrationName\", \"onRefresh\"))\n        .build();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/switchview/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"switchview\",\n    srcs = glob([\"*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v7/appcompat-orig:appcompat\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitch.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.switchview;\n\nimport android.content.Context;\nimport android.support.v7.widget.SwitchCompat;\n\n/**\n * Switch that has its value controlled by JS. Whenever the value of the switch changes, we do not\n * allow any other changes to that switch until JS sets a value explicitly. This stops the Switch\n * from changing its value multiple times, when those changes have not been processed by JS first.\n */\n/*package*/ class ReactSwitch extends SwitchCompat {\n\n  private boolean mAllowChange;\n\n  public ReactSwitch(Context context) {\n    super(context);\n    mAllowChange = true;\n  }\n\n  @Override\n  public void setChecked(boolean checked) {\n    if (mAllowChange && isChecked() != checked) {\n      mAllowChange = false;\n      super.setChecked(checked);\n    }\n  }\n\n  /*package*/ void setOn(boolean on) {\n    // If the switch has a different value than the value sent by JS, we must change it.\n    if (isChecked() != on) {\n      super.setChecked(on);\n    }\n    mAllowChange = true;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.switchview;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by a ReactSwitchManager once a switch is fully switched on/off\n */\n/*package*/ class ReactSwitchEvent extends Event<ReactSwitchEvent> {\n\n    public static final String EVENT_NAME = \"topChange\";\n\n    private final boolean mIsChecked;\n\n    public ReactSwitchEvent(int viewId, boolean isChecked) {\n        super(viewId);\n        mIsChecked = isChecked;\n    }\n\n    public boolean getIsChecked() {\n        return mIsChecked;\n    }\n\n    @Override\n    public String getEventName() {\n        return EVENT_NAME;\n    }\n\n    @Override\n    public short getCoalescingKey() {\n        // All switch events for a given view can be coalesced.\n        return 0;\n    }\n\n    @Override\n    public void dispatch(RCTEventEmitter rctEventEmitter) {\n        rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n    }\n\n    private WritableMap serializeEventData() {\n        WritableMap eventData = Arguments.createMap();\n        eventData.putInt(\"target\", getViewTag());\n        eventData.putBoolean(\"value\", getIsChecked());\n        return eventData;\n    }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n// switchview because switch is a keyword\npackage com.facebook.react.views.switchview;\n\nimport android.graphics.PorterDuff;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.CompoundButton;\n\nimport com.facebook.yoga.YogaMeasureMode;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaNode;\nimport com.facebook.yoga.YogaMeasureOutput;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.uimanager.LayoutShadowNode;\nimport com.facebook.react.uimanager.SimpleViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\n\n/**\n * View manager for {@link ReactSwitch} components.\n */\npublic class ReactSwitchManager extends SimpleViewManager<ReactSwitch> {\n\n  private static final String REACT_CLASS = \"AndroidSwitch\";\n\n  static class ReactSwitchShadowNode extends LayoutShadowNode implements\n      YogaMeasureFunction {\n\n    private int mWidth;\n    private int mHeight;\n    private boolean mMeasured;\n\n    private ReactSwitchShadowNode() {\n      setMeasureFunction(this);\n    }\n\n    @Override\n    public long measure(\n        YogaNode node,\n        float width,\n        YogaMeasureMode widthMode,\n        float height,\n        YogaMeasureMode heightMode) {\n      if (!mMeasured) {\n        // Create a switch with the default config and measure it; since we don't (currently)\n        // support setting custom switch text, this is fine, as all switches will measure the same\n        // on a specific device/theme/locale combination.\n        ReactSwitch reactSwitch = new ReactSwitch(getThemedContext());\n        final int spec = View.MeasureSpec.makeMeasureSpec(\n            ViewGroup.LayoutParams.WRAP_CONTENT,\n            View.MeasureSpec.UNSPECIFIED);\n        reactSwitch.measure(spec, spec);\n        mWidth = reactSwitch.getMeasuredWidth();\n        mHeight = reactSwitch.getMeasuredHeight();\n        mMeasured = true;\n      }\n\n      return YogaMeasureOutput.make(mWidth, mHeight);\n    }\n  }\n\n  private static final CompoundButton.OnCheckedChangeListener ON_CHECKED_CHANGE_LISTENER =\n      new CompoundButton.OnCheckedChangeListener() {\n        @Override\n        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n          ReactContext reactContext = (ReactContext) buttonView.getContext();\n          reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher().dispatchEvent(\n              new ReactSwitchEvent(\n                  buttonView.getId(),\n                  isChecked));\n        }\n      };\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public LayoutShadowNode createShadowNodeInstance() {\n    return new ReactSwitchShadowNode();\n  }\n\n  @Override\n  public Class getShadowNodeClass() {\n    return ReactSwitchShadowNode.class;\n  }\n\n  @Override\n  protected ReactSwitch createViewInstance(ThemedReactContext context) {\n    ReactSwitch view = new ReactSwitch(context);\n    view.setShowText(false);\n    return view;\n  }\n\n  @ReactProp(name = ViewProps.ENABLED, defaultBoolean = true)\n  public void setEnabled(ReactSwitch view, boolean enabled) {\n    view.setEnabled(enabled);\n  }\n\n  @ReactProp(name = ViewProps.ON)\n  public void setOn(ReactSwitch view, boolean on) {\n    // we set the checked change listener to null and then restore it so that we don't fire an\n    // onChange event to JS when JS itself is updating the value of the switch\n    view.setOnCheckedChangeListener(null);\n    view.setOn(on);\n    view.setOnCheckedChangeListener(ON_CHECKED_CHANGE_LISTENER);\n  }\n\n  @ReactProp(name = \"thumbTintColor\", customType = \"Color\")\n  public void setThumbTintColor(ReactSwitch view, Integer color) {\n    if (color == null) {\n      view.getThumbDrawable().clearColorFilter();\n    } else {\n      view.getThumbDrawable().setColorFilter(color, PorterDuff.Mode.MULTIPLY);\n    }\n  }\n\n  @ReactProp(name = \"trackTintColor\", customType = \"Color\")\n  public void setTrackTintColor(ReactSwitch view, Integer color) {\n    if (color == null) {\n      view.getTrackDrawable().clearColorFilter();\n    } else {\n      view.getTrackDrawable().setColorFilter(color, PorterDuff.Mode.MULTIPLY);\n    }\n  }\n\n  @Override\n  protected void addEventEmitters(final ThemedReactContext reactContext, final ReactSwitch view) {\n    view.setOnCheckedChangeListener(ON_CHECKED_CHANGE_LISTENER);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"text\",\n    srcs = glob([\"*.java\"]),\n    required_for_source_only_abi = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/view:view\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLineHeightSpan.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text;\n\nimport android.graphics.Paint;\nimport android.text.style.LineHeightSpan;\n\n/**\n * We use a custom {@link LineHeightSpan}, because `lineSpacingExtra` is broken. Details here:\n * https://github.com/facebook/react-native/issues/7546\n */\npublic class CustomLineHeightSpan implements LineHeightSpan {\n  private final int mHeight;\n\n  CustomLineHeightSpan(float height) {\n    this.mHeight = (int) Math.ceil(height);\n  }\n\n  @Override\n  public void chooseHeight(\n      CharSequence text,\n      int start,\n      int end,\n      int spanstartv,\n      int v,\n      Paint.FontMetricsInt fm) {\n    // This is more complicated that I wanted it to be. You can find a good explanation of what the\n    // FontMetrics mean here: http://stackoverflow.com/questions/27631736.\n    // The general solution is that if there's not enough height to show the full line height, we\n    // will prioritize in this order: descent, ascent, bottom, top\n\n    if (fm.descent > mHeight) {\n      // Show as much descent as possible\n      fm.bottom = fm.descent = Math.min(mHeight, fm.descent);\n      fm.top = fm.ascent = 0;\n    } else if (-fm.ascent + fm.descent > mHeight) {\n      // Show all descent, and as much ascent as possible\n      fm.bottom = fm.descent;\n      fm.top = fm.ascent = -mHeight + fm.descent;\n    } else if (-fm.ascent + fm.bottom > mHeight) {\n      // Show all ascent, descent, as much bottom as possible\n      fm.top = fm.ascent;\n      fm.bottom = fm.ascent + mHeight;\n    } else if (-fm.top + fm.bottom > mHeight) {\n      // Show all ascent, descent, bottom, as much top as possible\n      fm.top = fm.bottom - mHeight;\n    } else {\n      // Show proportionally additional ascent / top & descent / bottom\n      final int additional = mHeight - (-fm.top + fm.bottom);\n\n      fm.top -= additional / 2;\n      fm.ascent -= additional / 2;\n      fm.descent += additional / 2;\n      fm.bottom += additional / 2;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\npackage com.facebook.react.views.text;\n\nimport android.graphics.Typeface;\nimport android.os.Build;\nimport android.text.Layout;\nimport android.text.Spannable;\nimport android.text.SpannableStringBuilder;\nimport android.text.style.AbsoluteSizeSpan;\nimport android.text.style.BackgroundColorSpan;\nimport android.text.style.ForegroundColorSpan;\nimport android.text.style.StrikethroughSpan;\nimport android.text.style.UnderlineSpan;\nimport android.view.Gravity;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.uimanager.IllegalViewOperationException;\nimport com.facebook.react.uimanager.LayoutShadowNode;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.ReactShadowNode;\nimport com.facebook.react.uimanager.ViewDefaults;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.yoga.YogaDirection;\nimport java.util.ArrayList;\nimport java.util.List;\nimport javax.annotation.Nullable;\n\n/**\n * {@link ReactShadowNode} abstract class for spannable text nodes.\n *\n * <p>This class handles all text attributes assosiated with {@code <Text>}-ish node. A concrete\n * node can be an anchor {@code <Text>} node, an anchor {@code <TextInput>} node or virtual {@code\n * <Text>} node inside {@code <Text>} or {@code <TextInput>} node. Or even something else.\n *\n * <p>This also node calculates {@link Spannable} object based on subnodes of the same type, which\n * can be used in concrete classes to feed native views and compute layout.\n */\npublic abstract class ReactBaseTextShadowNode extends LayoutShadowNode {\n\n  private static final String INLINE_IMAGE_PLACEHOLDER = \"I\";\n  public static final int UNSET = -1;\n\n  public static final String PROP_SHADOW_OFFSET = \"textShadowOffset\";\n  public static final String PROP_SHADOW_OFFSET_WIDTH = \"width\";\n  public static final String PROP_SHADOW_OFFSET_HEIGHT = \"height\";\n  public static final String PROP_SHADOW_RADIUS = \"textShadowRadius\";\n  public static final String PROP_SHADOW_COLOR = \"textShadowColor\";\n\n  public static final int DEFAULT_TEXT_SHADOW_COLOR = 0x55000000;\n\n  private static class SetSpanOperation {\n    protected int start, end;\n    protected Object what;\n\n    SetSpanOperation(int start, int end, Object what) {\n      this.start = start;\n      this.end = end;\n      this.what = what;\n    }\n\n    public void execute(SpannableStringBuilder sb, int priority) {\n      // All spans will automatically extend to the right of the text, but not the left - except\n      // for spans that start at the beginning of the text.\n      int spanFlags = Spannable.SPAN_EXCLUSIVE_INCLUSIVE;\n      if (start == 0) {\n        spanFlags = Spannable.SPAN_INCLUSIVE_INCLUSIVE;\n      }\n\n      spanFlags &= ~Spannable.SPAN_PRIORITY;\n      spanFlags |= (priority << Spannable.SPAN_PRIORITY_SHIFT) & Spannable.SPAN_PRIORITY;\n\n      sb.setSpan(what, start, end, spanFlags);\n    }\n  }\n\n  private static void buildSpannedFromShadowNode(\n      ReactBaseTextShadowNode textShadowNode,\n      SpannableStringBuilder sb,\n      List<SetSpanOperation> ops) {\n\n    int start = sb.length();\n\n    for (int i = 0, length = textShadowNode.getChildCount(); i < length; i++) {\n      ReactShadowNode child = textShadowNode.getChildAt(i);\n\n      if (child instanceof ReactRawTextShadowNode) {\n        sb.append(((ReactRawTextShadowNode) child).getText());\n      } else if (child instanceof ReactBaseTextShadowNode) {\n        buildSpannedFromShadowNode((ReactBaseTextShadowNode) child, sb, ops);\n      } else if (child instanceof ReactTextInlineImageShadowNode) {\n        // We make the image take up 1 character in the span and put a corresponding character into\n        // the text so that the image doesn't run over any following text.\n        sb.append(INLINE_IMAGE_PLACEHOLDER);\n        ops.add(\n            new SetSpanOperation(\n                sb.length() - INLINE_IMAGE_PLACEHOLDER.length(),\n                sb.length(),\n                ((ReactTextInlineImageShadowNode) child).buildInlineImageSpan()));\n      } else {\n        throw new IllegalViewOperationException(\n            \"Unexpected view type nested under text node: \" + child.getClass());\n      }\n      child.markUpdateSeen();\n    }\n    int end = sb.length();\n    if (end >= start) {\n      if (textShadowNode.mIsColorSet) {\n        ops.add(new SetSpanOperation(start, end, new ForegroundColorSpan(textShadowNode.mColor)));\n      }\n      if (textShadowNode.mIsBackgroundColorSet) {\n        ops.add(\n            new SetSpanOperation(\n                start, end, new BackgroundColorSpan(textShadowNode.mBackgroundColor)));\n      }\n      if (textShadowNode.mFontSize != UNSET) {\n        ops.add(new SetSpanOperation(start, end, new AbsoluteSizeSpan(textShadowNode.mFontSize)));\n      }\n      if (textShadowNode.mFontStyle != UNSET\n          || textShadowNode.mFontWeight != UNSET\n          || textShadowNode.mFontFamily != null) {\n        ops.add(\n            new SetSpanOperation(\n                start,\n                end,\n                new CustomStyleSpan(\n                    textShadowNode.mFontStyle,\n                    textShadowNode.mFontWeight,\n                    textShadowNode.mFontFamily,\n                    textShadowNode.getThemedContext().getAssets())));\n      }\n      if (textShadowNode.mIsUnderlineTextDecorationSet) {\n        ops.add(new SetSpanOperation(start, end, new UnderlineSpan()));\n      }\n      if (textShadowNode.mIsLineThroughTextDecorationSet) {\n        ops.add(new SetSpanOperation(start, end, new StrikethroughSpan()));\n      }\n      if (textShadowNode.mTextShadowOffsetDx != 0 || textShadowNode.mTextShadowOffsetDy != 0) {\n        ops.add(\n            new SetSpanOperation(\n                start,\n                end,\n                new ShadowStyleSpan(\n                    textShadowNode.mTextShadowOffsetDx,\n                    textShadowNode.mTextShadowOffsetDy,\n                    textShadowNode.mTextShadowRadius,\n                    textShadowNode.mTextShadowColor)));\n      }\n      if (!Float.isNaN(textShadowNode.getEffectiveLineHeight())) {\n        ops.add(\n            new SetSpanOperation(\n                start, end, new CustomLineHeightSpan(textShadowNode.getEffectiveLineHeight())));\n      }\n      ops.add(new SetSpanOperation(start, end, new ReactTagSpan(textShadowNode.getReactTag())));\n    }\n  }\n\n  protected static Spannable spannedFromShadowNode(\n      ReactBaseTextShadowNode textShadowNode, String text) {\n    SpannableStringBuilder sb = new SpannableStringBuilder();\n\n    // TODO(5837930): Investigate whether it's worth optimizing this part and do it if so\n\n    // The {@link SpannableStringBuilder} implementation require setSpan operation to be called\n    // up-to-bottom, otherwise all the spannables that are withing the region for which one may set\n    // a new spannable will be wiped out\n    List<SetSpanOperation> ops = new ArrayList<>();\n\n    buildSpannedFromShadowNode(textShadowNode, sb, ops);\n\n    if (text != null) {\n      sb.append(text);\n    }\n\n    if (textShadowNode.mFontSize == UNSET) {\n      int defaultFontSize =\n          textShadowNode.mAllowFontScaling\n              ? (int) Math.ceil(PixelUtil.toPixelFromSP(ViewDefaults.FONT_SIZE_SP))\n              : (int) Math.ceil(PixelUtil.toPixelFromDIP(ViewDefaults.FONT_SIZE_SP));\n\n      ops.add(new SetSpanOperation(0, sb.length(), new AbsoluteSizeSpan(defaultFontSize)));\n    }\n\n    textShadowNode.mContainsImages = false;\n    textShadowNode.mHeightOfTallestInlineImage = Float.NaN;\n\n    // While setting the Spans on the final text, we also check whether any of them are images.\n    int priority = 0;\n    for (SetSpanOperation op : ops) {\n      if (op.what instanceof TextInlineImageSpan) {\n        int height = ((TextInlineImageSpan) op.what).getHeight();\n        textShadowNode.mContainsImages = true;\n        if (Float.isNaN(textShadowNode.mHeightOfTallestInlineImage)\n            || height > textShadowNode.mHeightOfTallestInlineImage) {\n          textShadowNode.mHeightOfTallestInlineImage = height;\n        }\n      }\n\n      // Actual order of calling {@code execute} does NOT matter,\n      // but the {@code priority} DOES matter.\n      op.execute(sb, priority);\n      priority++;\n    }\n\n    return sb;\n  }\n\n  /**\n   * Return -1 if the input string is not a valid numeric fontWeight (100, 200, ..., 900), otherwise\n   * return the weight.\n   *\n   * This code is duplicated in ReactTextInputManager\n   * TODO: Factor into a common place they can both use\n   */\n  private static int parseNumericFontWeight(String fontWeightString) {\n    // This should be much faster than using regex to verify input and Integer.parseInt\n    return fontWeightString.length() == 3\n            && fontWeightString.endsWith(\"00\")\n            && fontWeightString.charAt(0) <= '9'\n            && fontWeightString.charAt(0) >= '1'\n        ? 100 * (fontWeightString.charAt(0) - '0')\n        : -1;\n  }\n\n  protected float mLineHeight = Float.NaN;\n  protected boolean mIsColorSet = false;\n  protected boolean mAllowFontScaling = true;\n  protected int mColor;\n  protected boolean mIsBackgroundColorSet = false;\n  protected int mBackgroundColor;\n\n  protected int mNumberOfLines = UNSET;\n  protected int mFontSize = UNSET;\n  protected float mFontSizeInput = UNSET;\n  protected float mLineHeightInput = UNSET;\n  protected int mTextAlign = Gravity.NO_GRAVITY;\n  protected int mTextBreakStrategy =\n      (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) ? 0 : Layout.BREAK_STRATEGY_HIGH_QUALITY;\n\n  protected float mTextShadowOffsetDx = 0;\n  protected float mTextShadowOffsetDy = 0;\n  protected float mTextShadowRadius = 1;\n  protected int mTextShadowColor = DEFAULT_TEXT_SHADOW_COLOR;\n\n  protected boolean mIsUnderlineTextDecorationSet = false;\n  protected boolean mIsLineThroughTextDecorationSet = false;\n  protected boolean mIncludeFontPadding = true;\n\n  /**\n   * mFontStyle can be {@link Typeface#NORMAL} or {@link Typeface#ITALIC}.\n   * mFontWeight can be {@link Typeface#NORMAL} or {@link Typeface#BOLD}.\n   */\n  protected int mFontStyle = UNSET;\n\n  protected int mFontWeight = UNSET;\n  /**\n   * NB: If a font family is used that does not have a style in a certain Android version (ie.\n   * monospace bold pre Android 5.0), that style (ie. bold) will not be inherited by nested Text\n   * nodes. To retain that style, you have to add it to those nodes explicitly.\n   * Example, Android 4.4:\n   * <Text style={{fontFamily=\"serif\" fontWeight=\"bold\"}}>Bold Text</Text>\n   *   <Text style={{fontFamily=\"sans-serif\"}}>Bold Text</Text>\n   *     <Text style={{fontFamily=\"serif}}>Bold Text</Text>\n   *\n   * <Text style={{fontFamily=\"monospace\" fontWeight=\"bold\"}}>Not Bold Text</Text>\n   *   <Text style={{fontFamily=\"sans-serif\"}}>Not Bold Text</Text>\n   *     <Text style={{fontFamily=\"serif}}>Not Bold Text</Text>\n   *\n   * <Text style={{fontFamily=\"monospace\" fontWeight=\"bold\"}}>Not Bold Text</Text>\n   *   <Text style={{fontFamily=\"sans-serif\" fontWeight=\"bold\"}}>Bold Text</Text>\n   *     <Text style={{fontFamily=\"serif}}>Bold Text</Text>\n   */\n  protected @Nullable String mFontFamily = null;\n\n  protected boolean mContainsImages = false;\n  protected float mHeightOfTallestInlineImage = Float.NaN;\n\n  // Returns a line height which takes into account the requested line height\n  // and the height of the inline images.\n  public float getEffectiveLineHeight() {\n    boolean useInlineViewHeight =\n        !Float.isNaN(mLineHeight)\n            && !Float.isNaN(mHeightOfTallestInlineImage)\n            && mHeightOfTallestInlineImage > mLineHeight;\n    return useInlineViewHeight ? mHeightOfTallestInlineImage : mLineHeight;\n  }\n\n  // Return text alignment according to LTR or RTL style\n  private int getTextAlign() {\n    int textAlign = mTextAlign;\n    if (getLayoutDirection() == YogaDirection.RTL) {\n      if (textAlign == Gravity.RIGHT) {\n        textAlign = Gravity.LEFT;\n      } else if (textAlign == Gravity.LEFT) {\n        textAlign = Gravity.RIGHT;\n      }\n    }\n    return textAlign;\n  }\n\n  @ReactProp(name = ViewProps.NUMBER_OF_LINES, defaultInt = UNSET)\n  public void setNumberOfLines(int numberOfLines) {\n    mNumberOfLines = numberOfLines == 0 ? UNSET : numberOfLines;\n    markUpdated();\n  }\n\n  @ReactProp(name = ViewProps.LINE_HEIGHT, defaultFloat = UNSET)\n  public void setLineHeight(float lineHeight) {\n    mLineHeightInput = lineHeight;\n    if (lineHeight == UNSET) {\n      mLineHeight = Float.NaN;\n    } else {\n      mLineHeight =\n          mAllowFontScaling\n              ? PixelUtil.toPixelFromSP(lineHeight)\n              : PixelUtil.toPixelFromDIP(lineHeight);\n    }\n    markUpdated();\n  }\n\n  @ReactProp(name = ViewProps.ALLOW_FONT_SCALING, defaultBoolean = true)\n  public void setAllowFontScaling(boolean allowFontScaling) {\n    if (allowFontScaling != mAllowFontScaling) {\n      mAllowFontScaling = allowFontScaling;\n      setFontSize(mFontSizeInput);\n      setLineHeight(mLineHeightInput);\n      markUpdated();\n    }\n  }\n\n  @ReactProp(name = ViewProps.TEXT_ALIGN)\n  public void setTextAlign(@Nullable String textAlign) {\n    if (textAlign == null || \"auto\".equals(textAlign)) {\n      mTextAlign = Gravity.NO_GRAVITY;\n    } else if (\"left\".equals(textAlign)) {\n      mTextAlign = Gravity.LEFT;\n    } else if (\"right\".equals(textAlign)) {\n      mTextAlign = Gravity.RIGHT;\n    } else if (\"center\".equals(textAlign)) {\n      mTextAlign = Gravity.CENTER_HORIZONTAL;\n    } else if (\"justify\".equals(textAlign)) {\n      // Fallback gracefully for cross-platform compat instead of error\n      mTextAlign = Gravity.LEFT;\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Invalid textAlign: \" + textAlign);\n    }\n    markUpdated();\n  }\n\n  @ReactProp(name = ViewProps.FONT_SIZE, defaultFloat = UNSET)\n  public void setFontSize(float fontSize) {\n    mFontSizeInput = fontSize;\n    if (fontSize != UNSET) {\n      fontSize =\n          mAllowFontScaling\n              ? (float) Math.ceil(PixelUtil.toPixelFromSP(fontSize))\n              : (float) Math.ceil(PixelUtil.toPixelFromDIP(fontSize));\n    }\n    mFontSize = (int) fontSize;\n    markUpdated();\n  }\n\n  @ReactProp(name = ViewProps.COLOR)\n  public void setColor(@Nullable Integer color) {\n    mIsColorSet = (color != null);\n    if (mIsColorSet) {\n      mColor = color;\n    }\n    markUpdated();\n  }\n\n  @ReactProp(name = ViewProps.BACKGROUND_COLOR)\n  public void setBackgroundColor(Integer color) {\n    // Don't apply background color to anchor TextView since it will be applied on the View directly\n    if (!isVirtualAnchor()) {\n      mIsBackgroundColorSet = (color != null);\n      if (mIsBackgroundColorSet) {\n        mBackgroundColor = color;\n      }\n      markUpdated();\n    }\n  }\n\n  @ReactProp(name = ViewProps.FONT_FAMILY)\n  public void setFontFamily(@Nullable String fontFamily) {\n    mFontFamily = fontFamily;\n    markUpdated();\n  }\n\n  /**\n  /* This code is duplicated in ReactTextInputManager\n  /* TODO: Factor into a common place they can both use\n  */\n  @ReactProp(name = ViewProps.FONT_WEIGHT)\n  public void setFontWeight(@Nullable String fontWeightString) {\n    int fontWeightNumeric =\n        fontWeightString != null ? parseNumericFontWeight(fontWeightString) : -1;\n    int fontWeight = UNSET;\n    if (fontWeightNumeric >= 500 || \"bold\".equals(fontWeightString)) {\n      fontWeight = Typeface.BOLD;\n    } else if (\"normal\".equals(fontWeightString)\n        || (fontWeightNumeric != -1 && fontWeightNumeric < 500)) {\n      fontWeight = Typeface.NORMAL;\n    }\n    if (fontWeight != mFontWeight) {\n      mFontWeight = fontWeight;\n      markUpdated();\n    }\n  }\n\n  /**\n  /* This code is duplicated in ReactTextInputManager\n  /* TODO: Factor into a common place they can both use\n  */\n  @ReactProp(name = ViewProps.FONT_STYLE)\n  public void setFontStyle(@Nullable String fontStyleString) {\n    int fontStyle = UNSET;\n    if (\"italic\".equals(fontStyleString)) {\n      fontStyle = Typeface.ITALIC;\n    } else if (\"normal\".equals(fontStyleString)) {\n      fontStyle = Typeface.NORMAL;\n    }\n    if (fontStyle != mFontStyle) {\n      mFontStyle = fontStyle;\n      markUpdated();\n    }\n  }\n\n  @ReactProp(name = ViewProps.INCLUDE_FONT_PADDING, defaultBoolean = true)\n  public void setIncludeFontPadding(boolean includepad) {\n    mIncludeFontPadding = includepad;\n  }\n\n  @ReactProp(name = ViewProps.TEXT_DECORATION_LINE)\n  public void setTextDecorationLine(@Nullable String textDecorationLineString) {\n    mIsUnderlineTextDecorationSet = false;\n    mIsLineThroughTextDecorationSet = false;\n    if (textDecorationLineString != null) {\n      for (String textDecorationLineSubString : textDecorationLineString.split(\" \")) {\n        if (\"underline\".equals(textDecorationLineSubString)) {\n          mIsUnderlineTextDecorationSet = true;\n        } else if (\"line-through\".equals(textDecorationLineSubString)) {\n          mIsLineThroughTextDecorationSet = true;\n        }\n      }\n    }\n    markUpdated();\n  }\n\n  @ReactProp(name = ViewProps.TEXT_BREAK_STRATEGY)\n  public void setTextBreakStrategy(@Nullable String textBreakStrategy) {\n    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n      return;\n    }\n\n    if (textBreakStrategy == null || \"highQuality\".equals(textBreakStrategy)) {\n      mTextBreakStrategy = Layout.BREAK_STRATEGY_HIGH_QUALITY;\n    } else if (\"simple\".equals(textBreakStrategy)) {\n      mTextBreakStrategy = Layout.BREAK_STRATEGY_SIMPLE;\n    } else if (\"balanced\".equals(textBreakStrategy)) {\n      mTextBreakStrategy = Layout.BREAK_STRATEGY_BALANCED;\n    } else {\n      throw new JSApplicationIllegalArgumentException(\n          \"Invalid textBreakStrategy: \" + textBreakStrategy);\n    }\n\n    markUpdated();\n  }\n\n  @ReactProp(name = PROP_SHADOW_OFFSET)\n  public void setTextShadowOffset(ReadableMap offsetMap) {\n    mTextShadowOffsetDx = 0;\n    mTextShadowOffsetDy = 0;\n\n    if (offsetMap != null) {\n      if (offsetMap.hasKey(PROP_SHADOW_OFFSET_WIDTH)\n          && !offsetMap.isNull(PROP_SHADOW_OFFSET_WIDTH)) {\n        mTextShadowOffsetDx =\n            PixelUtil.toPixelFromDIP(offsetMap.getDouble(PROP_SHADOW_OFFSET_WIDTH));\n      }\n      if (offsetMap.hasKey(PROP_SHADOW_OFFSET_HEIGHT)\n          && !offsetMap.isNull(PROP_SHADOW_OFFSET_HEIGHT)) {\n        mTextShadowOffsetDy =\n            PixelUtil.toPixelFromDIP(offsetMap.getDouble(PROP_SHADOW_OFFSET_HEIGHT));\n      }\n    }\n\n    markUpdated();\n  }\n\n  @ReactProp(name = PROP_SHADOW_RADIUS, defaultInt = 1)\n  public void setTextShadowRadius(float textShadowRadius) {\n    if (textShadowRadius != mTextShadowRadius) {\n      mTextShadowRadius = textShadowRadius;\n      markUpdated();\n    }\n  }\n\n  @ReactProp(name = PROP_SHADOW_COLOR, defaultInt = DEFAULT_TEXT_SHADOW_COLOR, customType = \"Color\")\n  public void setTextShadowColor(int textShadowColor) {\n    if (textShadowColor != mTextShadowColor) {\n      mTextShadowColor = textShadowColor;\n      markUpdated();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/ReactRawTextManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text;\n\nimport android.view.View;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewManager;\n\n/**\n * Manages raw text nodes (aka {@code textContent} in terms of DOM).\n * Since they are used only as a virtual nodes, any type of native view\n * operation will throw an {@link IllegalStateException}.\n */\n@ReactModule(name = ReactRawTextManager.REACT_CLASS)\npublic class ReactRawTextManager extends ViewManager<View, ReactRawTextShadowNode> {\n\n  @VisibleForTesting\n  public static final String REACT_CLASS = \"RCTRawText\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public ReactTextView createViewInstance(ThemedReactContext context) {\n    throw new IllegalStateException(\"Attempt to create a native view for RCTRawText\");\n  }\n\n  @Override\n  public void updateExtraData(View view, Object extraData) {}\n\n  @Override\n  public Class<ReactRawTextShadowNode> getShadowNodeClass() {\n    return ReactRawTextShadowNode.class;\n  }\n\n  @Override\n  public ReactRawTextShadowNode createShadowNodeInstance() {\n    return new ReactRawTextShadowNode();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/ReactRawTextShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * <p>This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\npackage com.facebook.react.views.text;\n\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.uimanager.ReactShadowNode;\nimport com.facebook.react.uimanager.ReactShadowNodeImpl;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport javax.annotation.Nullable;\n\n/**\n * {@link ReactShadowNode} class for pure raw text node (aka {@code textContent} in terms of DOM).\n * Raw text node can only have simple string value without any attributes, properties or state.\n */\npublic class ReactRawTextShadowNode extends ReactShadowNodeImpl {\n\n  @VisibleForTesting public static final String PROP_TEXT = \"text\";\n\n  private @Nullable String mText = null;\n\n  @ReactProp(name = PROP_TEXT)\n  public void setText(@Nullable String text) {\n    mText = text;\n    markUpdated();\n  }\n\n  public @Nullable String getText() {\n    return mText;\n  }\n\n  @Override\n  public boolean isVirtual() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * <p>This source code is licensed under the BSD-style license found in the LICENSE file in the root\n * directory of this source tree. An additional grant of patent rights can be found in the PATENTS\n * file in the same directory.\n */\n\npackage com.facebook.react.views.text;\n\nimport android.text.Spannable;\nimport android.text.TextUtils;\nimport android.view.Gravity;\nimport android.view.View;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.uimanager.BaseViewManager;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.ViewDefaults;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport com.facebook.yoga.YogaConstants;\nimport javax.annotation.Nullable;\n\n/**\n * Abstract class for anchor {@code <Text>}-ish spannable views, such as {@link TextView} or {@link\n * TextEdit}.\n *\n * <p>This is a \"shadowing\" view manager, which means that the {@link NativeViewHierarchyManager}\n * will NOT manage children of native {@link TextView} instances instantiated by this manager.\n * Instead we use @{link ReactBaseTextShadowNode} hierarchy to calculate a {@link Spannable} text\n * represented the whole text subtree.\n */\npublic abstract class ReactTextAnchorViewManager<T extends View, C extends ReactBaseTextShadowNode>\n    extends BaseViewManager<T, C> {\n\n  private static final int[] SPACING_TYPES = {\n    Spacing.ALL, Spacing.LEFT, Spacing.RIGHT, Spacing.TOP, Spacing.BOTTOM,\n  };\n\n  // maxLines can only be set in master view (block), doesn't really make sense to set in a span\n  @ReactProp(name = ViewProps.NUMBER_OF_LINES, defaultInt = ViewDefaults.NUMBER_OF_LINES)\n  public void setNumberOfLines(ReactTextView view, int numberOfLines) {\n    view.setNumberOfLines(numberOfLines);\n  }\n\n  @ReactProp(name = ViewProps.ELLIPSIZE_MODE)\n  public void setEllipsizeMode(ReactTextView view, @Nullable String ellipsizeMode) {\n    if (ellipsizeMode == null || ellipsizeMode.equals(\"tail\")) {\n      view.setEllipsizeLocation(TextUtils.TruncateAt.END);\n    } else if (ellipsizeMode.equals(\"head\")) {\n      view.setEllipsizeLocation(TextUtils.TruncateAt.START);\n    } else if (ellipsizeMode.equals(\"middle\")) {\n      view.setEllipsizeLocation(TextUtils.TruncateAt.MIDDLE);\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Invalid ellipsizeMode: \" + ellipsizeMode);\n    }\n  }\n\n  @ReactProp(name = ViewProps.TEXT_ALIGN_VERTICAL)\n  public void setTextAlignVertical(ReactTextView view, @Nullable String textAlignVertical) {\n    if (textAlignVertical == null || \"auto\".equals(textAlignVertical)) {\n      view.setGravityVertical(Gravity.NO_GRAVITY);\n    } else if (\"top\".equals(textAlignVertical)) {\n      view.setGravityVertical(Gravity.TOP);\n    } else if (\"bottom\".equals(textAlignVertical)) {\n      view.setGravityVertical(Gravity.BOTTOM);\n    } else if (\"center\".equals(textAlignVertical)) {\n      view.setGravityVertical(Gravity.CENTER_VERTICAL);\n    } else {\n      throw new JSApplicationIllegalArgumentException(\n          \"Invalid textAlignVertical: \" + textAlignVertical);\n    }\n  }\n\n  @ReactProp(name = \"selectable\")\n  public void setSelectable(ReactTextView view, boolean isSelectable) {\n    view.setTextIsSelectable(isSelectable);\n  }\n\n  @ReactProp(name = \"selectionColor\", customType = \"Color\")\n  public void setSelectionColor(ReactTextView view, @Nullable Integer color) {\n    if (color == null) {\n      view.setHighlightColor(\n          DefaultStyleValuesUtil.getDefaultTextColorHighlight(view.getContext()));\n    } else {\n      view.setHighlightColor(color);\n    }\n  }\n\n  @ReactPropGroup(\n    names = {\n      ViewProps.BORDER_RADIUS,\n      ViewProps.BORDER_TOP_LEFT_RADIUS,\n      ViewProps.BORDER_TOP_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_LEFT_RADIUS\n    },\n    defaultFloat = YogaConstants.UNDEFINED\n  )\n  public void setBorderRadius(ReactTextView view, int index, float borderRadius) {\n    if (!YogaConstants.isUndefined(borderRadius)) {\n      borderRadius = PixelUtil.toPixelFromDIP(borderRadius);\n    }\n\n    if (index == 0) {\n      view.setBorderRadius(borderRadius);\n    } else {\n      view.setBorderRadius(borderRadius, index - 1);\n    }\n  }\n\n  @ReactProp(name = \"borderStyle\")\n  public void setBorderStyle(ReactTextView view, @Nullable String borderStyle) {\n    view.setBorderStyle(borderStyle);\n  }\n\n  @ReactPropGroup(\n    names = {\n      ViewProps.BORDER_WIDTH,\n      ViewProps.BORDER_LEFT_WIDTH,\n      ViewProps.BORDER_RIGHT_WIDTH,\n      ViewProps.BORDER_TOP_WIDTH,\n      ViewProps.BORDER_BOTTOM_WIDTH,\n    },\n    defaultFloat = YogaConstants.UNDEFINED\n  )\n  public void setBorderWidth(ReactTextView view, int index, float width) {\n    if (!YogaConstants.isUndefined(width)) {\n      width = PixelUtil.toPixelFromDIP(width);\n    }\n    view.setBorderWidth(SPACING_TYPES[index], width);\n  }\n\n  @ReactPropGroup(\n    names = {\n      \"borderColor\",\n      \"borderLeftColor\",\n      \"borderRightColor\",\n      \"borderTopColor\",\n      \"borderBottomColor\"\n    },\n    customType = \"Color\"\n  )\n  public void setBorderColor(ReactTextView view, int index, Integer color) {\n    float rgbComponent =\n        color == null ? YogaConstants.UNDEFINED : (float) ((int) color & 0x00FFFFFF);\n    float alphaComponent = color == null ? YogaConstants.UNDEFINED : (float) ((int) color >>> 24);\n    view.setBorderColor(SPACING_TYPES[index], rgbComponent, alphaComponent);\n  }\n\n  @ReactProp(name = ViewProps.INCLUDE_FONT_PADDING, defaultBoolean = true)\n  public void setIncludeFontPadding(ReactTextView view, boolean includepad) {\n    view.setIncludeFontPadding(includepad);\n  }\n\n  @ReactProp(name = \"disabled\", defaultBoolean = false)\n  public void setDisabled(ReactTextView view, boolean disabled) {\n    view.setEnabled(!disabled);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextInlineImageShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text;\n\nimport com.facebook.yoga.YogaNode;\nimport com.facebook.react.uimanager.LayoutShadowNode;\n\n/**\n * Base class for {@link YogaNode}s that represent inline images.\n */\npublic abstract class ReactTextInlineImageShadowNode extends LayoutShadowNode {\n\n  /**\n   * Build a {@link TextInlineImageSpan} from this node. This will be added to the TextView in\n   * place of this node.\n   */\n  public abstract TextInlineImageSpan buildInlineImageSpan();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text;\n\nimport android.os.Build;\nimport android.text.BoringLayout;\nimport android.text.Layout;\nimport android.text.Spannable;\nimport android.text.Spanned;\nimport android.text.StaticLayout;\nimport android.text.TextPaint;\nimport android.view.Gravity;\nimport android.widget.TextView;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.UIViewOperationQueue;\nimport com.facebook.yoga.YogaConstants;\nimport com.facebook.yoga.YogaDirection;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaMeasureMode;\nimport com.facebook.yoga.YogaMeasureOutput;\nimport com.facebook.yoga.YogaNode;\nimport javax.annotation.Nullable;\n\n/**\n * {@link ReactBaseTextShadowNode} concrete class for anchor {@code Text} node.\n *\n * <p>The class measures text in {@code <Text>} view and feeds native {@link TextView} using {@code\n * Spannable} object constructed in superclass.\n */\npublic class ReactTextShadowNode extends ReactBaseTextShadowNode {\n\n  // It's important to pass the ANTI_ALIAS_FLAG flag to the constructor rather than setting it\n  // later by calling setFlags. This is because the latter approach triggers a bug on Android 4.4.2.\n  // The bug is that unicode emoticons aren't measured properly which causes text to be clipped.\n  private static final TextPaint sTextPaintInstance = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);\n\n  private @Nullable Spannable mPreparedSpannableText;\n\n  private final YogaMeasureFunction mTextMeasureFunction =\n      new YogaMeasureFunction() {\n        @Override\n        public long measure(\n            YogaNode node,\n            float width,\n            YogaMeasureMode widthMode,\n            float height,\n            YogaMeasureMode heightMode) {\n          // TODO(5578671): Handle text direction (see View#getTextDirectionHeuristic)\n          TextPaint textPaint = sTextPaintInstance;\n          Layout layout;\n          Spanned text = Assertions.assertNotNull(\n              mPreparedSpannableText,\n              \"Spannable element has not been prepared in onBeforeLayout\");\n          BoringLayout.Metrics boring = BoringLayout.isBoring(text, textPaint);\n          float desiredWidth = boring == null ?\n              Layout.getDesiredWidth(text, textPaint) : Float.NaN;\n\n          // technically, width should never be negative, but there is currently a bug in\n          boolean unconstrainedWidth = widthMode == YogaMeasureMode.UNDEFINED || width < 0;\n\n          if (boring == null &&\n              (unconstrainedWidth ||\n                  (!YogaConstants.isUndefined(desiredWidth) && desiredWidth <= width))) {\n            // Is used when the width is not known and the text is not boring, ie. if it contains\n            // unicode characters.\n\n            int hintWidth = (int) Math.ceil(desiredWidth);\n            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n              layout = new StaticLayout(\n                text,\n                textPaint,\n                hintWidth,\n                Layout.Alignment.ALIGN_NORMAL,\n                1.f,\n                0.f,\n                mIncludeFontPadding);\n            } else {\n              layout = StaticLayout.Builder.obtain(text, 0, text.length(), textPaint, hintWidth)\n                .setAlignment(Layout.Alignment.ALIGN_NORMAL)\n                .setLineSpacing(0.f, 1.f)\n                .setIncludePad(mIncludeFontPadding)\n                .setBreakStrategy(mTextBreakStrategy)\n                .setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NORMAL)\n                .build();\n            }\n\n          } else if (boring != null && (unconstrainedWidth || boring.width <= width)) {\n            // Is used for single-line, boring text when the width is either unknown or bigger\n            // than the width of the text.\n            layout = BoringLayout.make(\n                text,\n                textPaint,\n                boring.width,\n                Layout.Alignment.ALIGN_NORMAL,\n                1.f,\n                0.f,\n                boring,\n                mIncludeFontPadding);\n          } else {\n            // Is used for multiline, boring text and the width is known.\n\n            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n              layout = new StaticLayout(\n                  text,\n                  textPaint,\n                  (int) width,\n                  Layout.Alignment.ALIGN_NORMAL,\n                  1.f,\n                  0.f,\n                  mIncludeFontPadding);\n            } else {\n              layout = StaticLayout.Builder.obtain(text, 0, text.length(), textPaint, (int) width)\n                .setAlignment(Layout.Alignment.ALIGN_NORMAL)\n                .setLineSpacing(0.f, 1.f)\n                .setIncludePad(mIncludeFontPadding)\n                .setBreakStrategy(mTextBreakStrategy)\n                .setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NORMAL)\n                .build();\n            }\n          }\n\n          if (mNumberOfLines != UNSET &&\n              mNumberOfLines < layout.getLineCount()) {\n            return YogaMeasureOutput.make(\n                layout.getWidth(),\n                layout.getLineBottom(mNumberOfLines - 1));\n          } else {\n            return YogaMeasureOutput.make(layout.getWidth(), layout.getHeight());\n          }\n        }\n      };\n\n  public ReactTextShadowNode() {\n    if (!isVirtual()) {\n      setMeasureFunction(mTextMeasureFunction);\n    }\n  }\n\n  // Return text alignment according to LTR or RTL style\n  private int getTextAlign() {\n    int textAlign = mTextAlign;\n    if (getLayoutDirection() == YogaDirection.RTL) {\n      if (textAlign == Gravity.RIGHT) {\n        textAlign = Gravity.LEFT;\n      } else if (textAlign == Gravity.LEFT) {\n        textAlign = Gravity.RIGHT;\n      }\n    }\n    return textAlign;\n  }\n\n  @Override\n  public void onBeforeLayout() {\n    mPreparedSpannableText = spannedFromShadowNode(this, null);\n    markUpdated();\n  }\n\n  @Override\n  public boolean isVirtualAnchor() {\n    return true;\n  }\n\n  @Override\n  public void markUpdated() {\n    super.markUpdated();\n    // Telling to Yoga that the node should be remeasured on next layout pass.\n    super.dirty();\n  }\n\n  @Override\n  public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {\n    super.onCollectExtraUpdates(uiViewOperationQueue);\n\n    if (mPreparedSpannableText != null) {\n      ReactTextUpdate reactTextUpdate =\n        new ReactTextUpdate(\n          mPreparedSpannableText,\n          UNSET,\n          mContainsImages,\n          getPadding(Spacing.START),\n          getPadding(Spacing.TOP),\n          getPadding(Spacing.END),\n          getPadding(Spacing.BOTTOM),\n          getTextAlign(),\n          mTextBreakStrategy\n        );\n      uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), reactTextUpdate);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextUpdate.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text;\n\nimport android.text.Layout;\nimport android.text.Spannable;\n\n/**\n * Class that contains the data needed for a text update.\n * Used by both <Text/> and <TextInput/>\n * VisibleForTesting from {@link TextInputEventsTestCase}.\n */\npublic class ReactTextUpdate {\n\n  private final Spannable mText;\n  private final int mJsEventCounter;\n  private final boolean mContainsImages;\n  private final float mPaddingLeft;\n  private final float mPaddingTop;\n  private final float mPaddingRight;\n  private final float mPaddingBottom;\n  private final int mTextAlign;\n  private final int mTextBreakStrategy;\n\n  /**\n   * @deprecated Use a non-deprecated constructor for ReactTextUpdate instead. This one remains\n   * because it's being used by a unit test that isn't currently open source.\n   */\n  @Deprecated\n  public ReactTextUpdate(\n      Spannable text,\n      int jsEventCounter,\n      boolean containsImages,\n      float paddingStart,\n      float paddingTop,\n      float paddingEnd,\n      float paddingBottom,\n      int textAlign) {\n    this(text,\n        jsEventCounter,\n        containsImages,\n        paddingStart,\n        paddingTop,\n        paddingEnd,\n        paddingBottom,\n        textAlign,\n        Layout.BREAK_STRATEGY_HIGH_QUALITY);\n  }\n\n  public ReactTextUpdate(\n    Spannable text,\n    int jsEventCounter,\n    boolean containsImages,\n    float paddingStart,\n    float paddingTop,\n    float paddingEnd,\n    float paddingBottom,\n    int textAlign,\n    int textBreakStrategy) {\n    mText = text;\n    mJsEventCounter = jsEventCounter;\n    mContainsImages = containsImages;\n    mPaddingLeft = paddingStart;\n    mPaddingTop = paddingTop;\n    mPaddingRight = paddingEnd;\n    mPaddingBottom = paddingBottom;\n    mTextAlign = textAlign;\n    mTextBreakStrategy = textBreakStrategy;\n  }\n\n  public Spannable getText() {\n    return mText;\n  }\n\n  public int getJsEventCounter() {\n    return mJsEventCounter;\n  }\n\n  public boolean containsImages() {\n    return mContainsImages;\n  }\n\n  public float getPaddingLeft() {\n    return mPaddingLeft;\n  }\n\n  public float getPaddingTop() {\n    return mPaddingTop;\n  }\n\n  public float getPaddingRight() {\n    return mPaddingRight;\n  }\n\n  public float getPaddingBottom() {\n    return mPaddingBottom;\n  }\n\n  public int getTextAlign() {\n    return mTextAlign;\n  }\n\n  public int getTextBreakStrategy() {\n    return mTextBreakStrategy;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text;\n\nimport android.content.Context;\nimport android.graphics.drawable.Drawable;\nimport android.os.Build;\nimport android.text.Layout;\nimport android.text.Spanned;\nimport android.text.TextUtils;\nimport android.view.Gravity;\nimport android.view.ViewGroup;\nimport android.widget.TextView;\nimport com.facebook.react.uimanager.ReactCompoundView;\nimport com.facebook.react.uimanager.ViewDefaults;\nimport com.facebook.react.views.view.ReactViewBackgroundManager;\nimport javax.annotation.Nullable;\n\npublic class ReactTextView extends TextView implements ReactCompoundView {\n\n  private static final ViewGroup.LayoutParams EMPTY_LAYOUT_PARAMS =\n    new ViewGroup.LayoutParams(0, 0);\n\n  private boolean mContainsImages;\n  private int mDefaultGravityHorizontal;\n  private int mDefaultGravityVertical;\n  private boolean mTextIsSelectable;\n  private float mLineHeight = Float.NaN;\n  private int mTextAlign = Gravity.NO_GRAVITY;\n  private int mNumberOfLines = ViewDefaults.NUMBER_OF_LINES;\n  private TextUtils.TruncateAt mEllipsizeLocation = TextUtils.TruncateAt.END;\n\n  private ReactViewBackgroundManager mReactBackgroundManager;\n\n  public ReactTextView(Context context) {\n    super(context);\n    mReactBackgroundManager = new ReactViewBackgroundManager(this);\n    mDefaultGravityHorizontal =\n      getGravity() & (Gravity.HORIZONTAL_GRAVITY_MASK | Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK);\n    mDefaultGravityVertical = getGravity() & Gravity.VERTICAL_GRAVITY_MASK;\n  }\n\n  public void setText(ReactTextUpdate update) {\n    mContainsImages = update.containsImages();\n    // Android's TextView crashes when it tries to relayout if LayoutParams are\n    // null; explicitly set the LayoutParams to prevent this crash. See:\n    // https://github.com/facebook/react-native/pull/7011\n    if (getLayoutParams() == null) {\n      setLayoutParams(EMPTY_LAYOUT_PARAMS);\n    }\n    setText(update.getText());\n    setPadding(\n      (int) Math.floor(update.getPaddingLeft()),\n      (int) Math.floor(update.getPaddingTop()),\n      (int) Math.floor(update.getPaddingRight()),\n      (int) Math.floor(update.getPaddingBottom()));\n\n    int nextTextAlign = update.getTextAlign();\n    if (mTextAlign != nextTextAlign) {\n      mTextAlign = nextTextAlign;\n    }\n    setGravityHorizontal(mTextAlign);\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n      if (getBreakStrategy() != update.getTextBreakStrategy()) {\n        setBreakStrategy(update.getTextBreakStrategy());\n      }\n    }\n  }\n\n  @Override\n  public int reactTagForTouch(float touchX, float touchY) {\n    Spanned text = (Spanned) getText();\n    int target = getId();\n\n    int x = (int) touchX;\n    int y = (int) touchY;\n\n    Layout layout = getLayout();\n    if (layout == null) {\n      // If the layout is null, the view hasn't been properly laid out yet. Therefore, we can't find\n      // the exact text tag that has been touched, and the correct tag to return is the default one.\n      return target;\n    }\n    int line = layout.getLineForVertical(y);\n\n    int lineStartX = (int) layout.getLineLeft(line);\n    int lineEndX = (int) layout.getLineRight(line);\n\n    // TODO(5966918): Consider extending touchable area for text spans by some DP constant\n    if (x >= lineStartX && x <= lineEndX) {\n      int index = layout.getOffsetForHorizontal(line, x);\n\n      // We choose the most inner span (shortest) containing character at the given index\n      // if no such span can be found we will send the textview's react id as a touch handler\n      // In case when there are more than one spans with same length we choose the last one\n      // from the spans[] array, since it correspond to the most inner react element\n      ReactTagSpan[] spans = text.getSpans(index, index, ReactTagSpan.class);\n\n      if (spans != null) {\n        int targetSpanTextLength = text.length();\n        for (int i = 0; i < spans.length; i++) {\n          int spanStart = text.getSpanStart(spans[i]);\n          int spanEnd = text.getSpanEnd(spans[i]);\n          if (spanEnd > index && (spanEnd - spanStart) <= targetSpanTextLength) {\n            target = spans[i].getReactTag();\n            targetSpanTextLength = (spanEnd - spanStart);\n          }\n        }\n      }\n    }\n\n    return target;\n  }\n\n  @Override\n  public void setTextIsSelectable(boolean selectable) {\n    mTextIsSelectable = selectable;\n    super.setTextIsSelectable(selectable);\n  }\n\n  @Override\n  protected boolean verifyDrawable(Drawable drawable) {\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        if (span.getDrawable() == drawable) {\n          return true;\n        }\n      }\n    }\n    return super.verifyDrawable(drawable);\n  }\n\n  @Override\n  public void invalidateDrawable(Drawable drawable) {\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        if (span.getDrawable() == drawable) {\n          invalidate();\n        }\n      }\n    }\n    super.invalidateDrawable(drawable);\n  }\n\n  @Override\n  public void onDetachedFromWindow() {\n    super.onDetachedFromWindow();\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        span.onDetachedFromWindow();\n      }\n    }\n  }\n\n  @Override\n  public void onStartTemporaryDetach() {\n    super.onStartTemporaryDetach();\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        span.onStartTemporaryDetach();\n      }\n    }\n  }\n\n  @Override\n  public void onAttachedToWindow() {\n    super.onAttachedToWindow();\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        span.onAttachedToWindow();\n      }\n    }\n  }\n\n  @Override\n  public void onFinishTemporaryDetach() {\n    super.onFinishTemporaryDetach();\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        span.onFinishTemporaryDetach();\n      }\n    }\n  }\n\n  /* package */ void setGravityHorizontal(int gravityHorizontal) {\n    if (gravityHorizontal == 0) {\n      gravityHorizontal = mDefaultGravityHorizontal;\n    }\n    setGravity(\n      (getGravity() & ~Gravity.HORIZONTAL_GRAVITY_MASK &\n        ~Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) | gravityHorizontal);\n  }\n\n  /* package */ void setGravityVertical(int gravityVertical) {\n    if (gravityVertical == 0) {\n      gravityVertical = mDefaultGravityVertical;\n    }\n    setGravity((getGravity() & ~Gravity.VERTICAL_GRAVITY_MASK) | gravityVertical);\n  }\n\n  public void setNumberOfLines(int numberOfLines) {\n    mNumberOfLines = numberOfLines == 0 ? ViewDefaults.NUMBER_OF_LINES : numberOfLines;\n    setSingleLine(mNumberOfLines == 1);\n    setMaxLines(mNumberOfLines);\n  }\n\n  public void setEllipsizeLocation(TextUtils.TruncateAt ellipsizeLocation) {\n    mEllipsizeLocation = ellipsizeLocation;\n  }\n\n  public void updateView() {\n    @Nullable TextUtils.TruncateAt ellipsizeLocation = mNumberOfLines == ViewDefaults.NUMBER_OF_LINES ? null : mEllipsizeLocation;\n    setEllipsize(ellipsizeLocation);\n  }\n\n  @Override\n  public void setBackgroundColor(int color) {\n    mReactBackgroundManager.setBackgroundColor(color);\n  }\n\n  public void setBorderWidth(int position, float width) {\n    mReactBackgroundManager.setBorderWidth(position, width);\n  }\n\n  public void setBorderColor(int position, float color, float alpha) {\n    mReactBackgroundManager.setBorderColor(position, color, alpha);\n  }\n\n  public void setBorderRadius(float borderRadius) {\n    mReactBackgroundManager.setBorderRadius(borderRadius);\n  }\n\n  public void setBorderRadius(float borderRadius, int position) {\n    mReactBackgroundManager.setBorderRadius(borderRadius, position);\n  }\n\n  public void setBorderStyle(@Nullable String style) {\n    mReactBackgroundManager.setBorderStyle(style);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text;\n\nimport android.text.Spannable;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.ThemedReactContext;\n\n/**\n * Concrete class for {@link ReactTextAnchorViewManager} which represents view managers of anchor\n * {@code <Text>} nodes.\n */\n@ReactModule(name = ReactTextViewManager.REACT_CLASS)\npublic class ReactTextViewManager\n    extends ReactTextAnchorViewManager<ReactTextView, ReactTextShadowNode> {\n\n  @VisibleForTesting\n  public static final String REACT_CLASS = \"RCTText\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public ReactTextView createViewInstance(ThemedReactContext context) {\n    return new ReactTextView(context);\n  }\n\n  @Override\n  public void updateExtraData(ReactTextView view, Object extraData) {\n    ReactTextUpdate update = (ReactTextUpdate) extraData;\n    if (update.containsImages()) {\n      Spannable spannable = update.getText();\n      TextInlineImageSpan.possiblyUpdateInlineImageSpans(spannable, view);\n    }\n    view.setText(update);\n  }\n\n  @Override\n  public ReactTextShadowNode createShadowNodeInstance() {\n    return new ReactTextShadowNode();\n  }\n\n  @Override\n  public Class<ReactTextShadowNode> getShadowNodeClass() {\n    return ReactTextShadowNode.class;\n  }\n\n  @Override\n  protected void onAfterUpdateTransaction(ReactTextView view) {\n    super.onAfterUpdateTransaction(view);\n    view.updateView();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/ReactVirtualTextShadowNode.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.text;\n\n/**\n * A virtual text node.\n */\npublic class ReactVirtualTextShadowNode extends ReactBaseTextShadowNode {\n\n  @Override\n  public boolean isVirtual() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/ReactVirtualTextViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text;\n\nimport android.view.View;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.BaseViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\n\n/**\n * Manages raw text nodes. Since they are used only as a virtual nodes any type of native view\n * operation will throw an {@link IllegalStateException}\n */\n@ReactModule(name = ReactVirtualTextViewManager.REACT_CLASS)\npublic class ReactVirtualTextViewManager extends BaseViewManager<View, ReactVirtualTextShadowNode> {\n\n  @VisibleForTesting\n  public static final String REACT_CLASS = \"RCTVirtualText\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public View createViewInstance(ThemedReactContext context) {\n    throw new IllegalStateException(\"Attempt to create a native view for RCTVirtualText\");\n  }\n\n  @Override\n  public void updateExtraData(View view, Object extraData) {}\n\n  @Override\n  public Class<ReactVirtualTextShadowNode> getShadowNodeClass() {\n    return ReactVirtualTextShadowNode.class;\n  }\n\n  @Override\n  public ReactVirtualTextShadowNode createShadowNodeInstance() {\n    return new ReactVirtualTextShadowNode();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/TextInlineImageSpan.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n package com.facebook.react.views.text;\n\n import javax.annotation.Nullable;\n\n import android.graphics.drawable.Drawable;\n import android.text.Spannable;\n import android.text.style.ReplacementSpan;\n import android.view.View;\n import android.widget.TextView;\n\n /**\n  * Base class for inline image spans.\n  */\n public abstract class TextInlineImageSpan extends ReplacementSpan {\n\n   /**\n    * For TextInlineImageSpan we need to update the Span to know that the window is attached and\n    * the TextView that we will set as the callback on the Drawable.\n    *\n    * @param spannable The spannable that may contain TextInlineImageSpans\n    * @param view The view which will be set as the callback for the Drawable\n    */\n   public static void possiblyUpdateInlineImageSpans(Spannable spannable, TextView view) {\n     TextInlineImageSpan[] spans =\n       spannable.getSpans(0, spannable.length(), TextInlineImageSpan.class);\n     for (TextInlineImageSpan span : spans) {\n       span.onAttachedToWindow();\n       span.setTextView(view);\n     }\n   }\n\n   /**\n    * Get the drawable that is span represents.\n    */\n   public abstract @Nullable Drawable getDrawable();\n\n   /**\n    * Called by the text view from {@link View#onDetachedFromWindow()},\n    */\n   public abstract void onDetachedFromWindow();\n\n   /**\n    * Called by the text view from {@link View#onStartTemporaryDetach()}.\n    */\n   public abstract void onStartTemporaryDetach();\n\n   /**\n    * Called by the text view from {@link View#onAttachedToWindow()}.\n    */\n   public abstract void onAttachedToWindow();\n\n   /**\n    * Called by the text view from {@link View#onFinishTemporaryDetach()}.\n    */\n   public abstract void onFinishTemporaryDetach();\n\n   /**\n    * Set the textview that will contain this span.\n    */\n   public abstract void setTextView(TextView textView);\n\n   /**\n    * Get the width of the span.\n    */\n   public abstract int getWidth();\n\n   /**\n    * Get the height of the span.\n    */\n   public abstract int getHeight();\n }\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"frescosupport\",\n    srcs = glob([\"*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"libraries/fresco/fresco-react-native:fbcore\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-drawee\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-react-native\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:imagepipeline\"),\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/fresco:fresco\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/text:text\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text.frescosupport;\n\nimport javax.annotation.Nullable;\n\nimport java.util.Locale;\n\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.net.Uri;\n\nimport com.facebook.common.util.UriUtil;\nimport com.facebook.yoga.YogaConstants;\nimport com.facebook.drawee.controller.AbstractDraweeControllerBuilder;\nimport com.facebook.react.bridge.Dynamic;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableType;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.views.text.ReactTextInlineImageShadowNode;\nimport com.facebook.react.views.text.TextInlineImageSpan;\n\n/**\n * Shadow node that represents an inline image. Loading is done using Fresco.\n *\n */\npublic class FrescoBasedReactTextInlineImageShadowNode extends ReactTextInlineImageShadowNode {\n\n  private @Nullable Uri mUri;\n  private ReadableMap mHeaders;\n  private final AbstractDraweeControllerBuilder mDraweeControllerBuilder;\n  private final @Nullable Object mCallerContext;\n  private float mWidth = YogaConstants.UNDEFINED;\n  private float mHeight = YogaConstants.UNDEFINED;\n\n  public FrescoBasedReactTextInlineImageShadowNode(\n    AbstractDraweeControllerBuilder draweeControllerBuilder,\n    @Nullable Object callerContext) {\n    mDraweeControllerBuilder = draweeControllerBuilder;\n    mCallerContext = callerContext;\n  }\n\n  @ReactProp(name = \"src\")\n  public void setSource(@Nullable ReadableArray sources) {\n    final String source =\n      (sources == null || sources.size() == 0) ? null : sources.getMap(0).getString(\"uri\");\n    Uri uri = null;\n    if (source != null) {\n      try {\n        uri = Uri.parse(source);\n        // Verify scheme is set, so that relative uri (used by static resources) are not handled.\n        if (uri.getScheme() == null) {\n          uri = null;\n        }\n      } catch (Exception e) {\n        // ignore malformed uri, then attempt to extract resource ID.\n      }\n      if (uri == null) {\n        uri = getResourceDrawableUri(getThemedContext(), source);\n      }\n    }\n    if (uri != mUri) {\n      markUpdated();\n    }\n    mUri = uri;\n  }\n\n  @ReactProp(name = \"headers\")\n  public void setHeaders(ReadableMap headers) {\n    mHeaders = headers;\n  }\n\n  /**\n   * Besides width/height, all other layout props on inline images are ignored\n   */\n  @Override\n  public void setWidth(Dynamic width) {\n    if (width.getType() == ReadableType.Number) {\n      mWidth = (float) width.asDouble();\n    } else {\n      throw new JSApplicationIllegalArgumentException(\n          \"Inline images must not have percentage based width\");\n    }\n  }\n\n  @Override\n  public void setHeight(Dynamic height) {\n    if (height.getType() == ReadableType.Number) {\n      mHeight = (float) height.asDouble();\n    } else {\n      throw new JSApplicationIllegalArgumentException(\n          \"Inline images must not have percentage based height\");\n    }\n  }\n\n  public @Nullable Uri getUri() {\n    return mUri;\n  }\n\n  public ReadableMap getHeaders() {\n    return mHeaders;\n  }\n\n  // TODO: t9053573 is tracking that this code should be shared\n  private static @Nullable Uri getResourceDrawableUri(Context context, @Nullable String name) {\n    if (name == null || name.isEmpty()) {\n      return null;\n    }\n    name = name.toLowerCase(Locale.getDefault()).replace(\"-\", \"_\");\n    int resId = context.getResources().getIdentifier(\n      name,\n      \"drawable\",\n      context.getPackageName());\n    return new Uri.Builder()\n      .scheme(UriUtil.LOCAL_RESOURCE_SCHEME)\n      .path(String.valueOf(resId))\n      .build();\n  }\n\n  @Override\n  public boolean isVirtual() {\n    return true;\n  }\n\n  @Override\n  public TextInlineImageSpan buildInlineImageSpan() {\n    Resources resources = getThemedContext().getResources();\n    int width = (int) Math.ceil(mWidth);\n    int height = (int) Math.ceil(mHeight);\n    return new FrescoBasedReactTextInlineImageSpan(\n      resources,\n      height,\n      width,\n      getUri(),\n      getHeaders(),\n      getDraweeControllerBuilder(),\n      getCallerContext());\n  }\n\n  public AbstractDraweeControllerBuilder getDraweeControllerBuilder() {\n    return mDraweeControllerBuilder;\n  }\n\n  public @Nullable Object getCallerContext() {\n    return mCallerContext;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageSpan.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text.frescosupport;\n\nimport javax.annotation.Nullable;\n\nimport android.content.res.Resources;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.drawable.Drawable;\nimport android.net.Uri;\nimport android.widget.TextView;\n\nimport com.facebook.drawee.controller.AbstractDraweeControllerBuilder;\nimport com.facebook.drawee.generic.GenericDraweeHierarchy;\nimport com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;\nimport com.facebook.drawee.interfaces.DraweeController;\nimport com.facebook.drawee.view.DraweeHolder;\nimport com.facebook.imagepipeline.request.ImageRequest;\nimport com.facebook.imagepipeline.request.ImageRequestBuilder;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.views.text.TextInlineImageSpan;\nimport com.facebook.react.modules.fresco.ReactNetworkImageRequest;\n\n/**\n * FrescoBasedTextInlineImageSpan is a span for Images that are inside <Text/>. It computes\n * its size based on the input size. When it is time to draw, it will use the Fresco framework to\n * get the right Drawable and let that draw.\n *\n * Since Fresco needs to callback to the TextView that contains this, in the ViewManager, you must\n * tell the Span about the TextView\n *\n * Note: It borrows code from DynamicDrawableSpan and if that code updates how it computes size or\n * draws, we need to update this as well.\n */\npublic class FrescoBasedReactTextInlineImageSpan extends TextInlineImageSpan {\n\n  private @Nullable Drawable mDrawable;\n  private final AbstractDraweeControllerBuilder mDraweeControllerBuilder;\n  private final DraweeHolder<GenericDraweeHierarchy> mDraweeHolder;\n  private final @Nullable Object mCallerContext;\n\n  private int mHeight;\n  private Uri mUri;\n  private int mWidth;\n  private ReadableMap mHeaders;\n\n  private @Nullable TextView mTextView;\n\n  public FrescoBasedReactTextInlineImageSpan(\n      Resources resources,\n      int height,\n      int width,\n      @Nullable Uri uri,\n      ReadableMap headers,\n      AbstractDraweeControllerBuilder draweeControllerBuilder,\n      @Nullable Object callerContext) {\n    mDraweeHolder = new DraweeHolder(\n        GenericDraweeHierarchyBuilder.newInstance(resources)\n            .build()\n    );\n    mDraweeControllerBuilder = draweeControllerBuilder;\n    mCallerContext = callerContext;\n\n    mHeight = height;\n    mWidth = width;\n    mUri = (uri != null) ? uri : Uri.EMPTY;\n    mHeaders = headers;\n  }\n\n  /**\n   * The ReactTextView that holds this ImageSpan is responsible for passing these methods on so\n   * that we can do proper lifetime management for Fresco\n   */\n  public void onDetachedFromWindow() {\n    mDraweeHolder.onDetach();\n  }\n\n  public void onStartTemporaryDetach() {\n    mDraweeHolder.onDetach();\n  }\n\n  public void onAttachedToWindow() {\n    mDraweeHolder.onAttach();\n  }\n\n  public void onFinishTemporaryDetach() {\n    mDraweeHolder.onAttach();\n  }\n\n  public @Nullable Drawable getDrawable() {\n    return mDrawable;\n  }\n\n  @Override\n  public int getSize(\n      Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm) {\n    // NOTE: This getSize code is copied from DynamicDrawableSpan and modified to not use a Drawable\n\n    if (fm != null) {\n      fm.ascent = -mHeight;\n      fm.descent = 0;\n\n      fm.top = fm.ascent;\n      fm.bottom = 0;\n    }\n\n    return mWidth;\n  }\n\n  public void setTextView(TextView textView) {\n    mTextView = textView;\n  }\n\n  @Override\n  public void draw(\n      Canvas canvas,\n      CharSequence text,\n      int start,\n      int end,\n      float x,\n      int top,\n      int y,\n      int bottom,\n      Paint paint) {\n    if (mDrawable == null) {\n      ImageRequestBuilder imageRequestBuilder = ImageRequestBuilder.newBuilderWithSource(mUri);\n      ImageRequest imageRequest = ReactNetworkImageRequest.fromBuilderWithHeaders(imageRequestBuilder, mHeaders);\n\n      DraweeController draweeController = mDraweeControllerBuilder\n          .reset()\n          .setOldController(mDraweeHolder.getController())\n          .setCallerContext(mCallerContext)\n          .setImageRequest(imageRequest)\n          .build();\n      mDraweeHolder.setController(draweeController);\n      mDraweeControllerBuilder.reset();\n\n      mDrawable = mDraweeHolder.getTopLevelDrawable();\n      mDrawable.setBounds(0, 0, mWidth, mHeight);\n      mDrawable.setCallback(mTextView);\n    }\n\n    // NOTE: This drawing code is copied from DynamicDrawableSpan\n\n    canvas.save();\n\n    // Align to baseline by default\n    int transY = y - mDrawable.getBounds().bottom;\n\n    canvas.translate(x, transY);\n    mDrawable.draw(canvas);\n    canvas.restore();\n  }\n\n  @Override\n  public int getWidth() {\n    return mWidth;\n  }\n\n  @Override\n  public int getHeight() {\n    return mHeight;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text.frescosupport;\n\nimport javax.annotation.Nullable;\n\nimport android.view.View;\n\nimport com.facebook.drawee.backends.pipeline.Fresco;\nimport com.facebook.drawee.controller.AbstractDraweeControllerBuilder;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewManager;\n\n/**\n * Manages Images embedded in Text nodes using Fresco. Since they are used only as a virtual nodes\n * any type of native view operation will throw an {@link IllegalStateException}.\n */\n@ReactModule(name = FrescoBasedReactTextInlineImageViewManager.REACT_CLASS)\npublic class FrescoBasedReactTextInlineImageViewManager\n  extends ViewManager<View, FrescoBasedReactTextInlineImageShadowNode> {\n\n  protected static final String REACT_CLASS = \"RCTTextInlineImage\";\n\n  private final @Nullable AbstractDraweeControllerBuilder mDraweeControllerBuilder;\n  private final @Nullable Object mCallerContext;\n\n  public FrescoBasedReactTextInlineImageViewManager() {\n    this(null, null);\n  }\n\n  public FrescoBasedReactTextInlineImageViewManager(\n    @Nullable AbstractDraweeControllerBuilder draweeControllerBuilder,\n    @Nullable Object callerContext) {\n    mDraweeControllerBuilder = draweeControllerBuilder;\n    mCallerContext = callerContext;\n  }\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public View createViewInstance(ThemedReactContext context) {\n    throw new IllegalStateException(\"RCTTextInlineImage doesn't map into a native view\");\n  }\n\n  @Override\n  public FrescoBasedReactTextInlineImageShadowNode createShadowNodeInstance() {\n    return new FrescoBasedReactTextInlineImageShadowNode(\n      (mDraweeControllerBuilder != null) ?\n        mDraweeControllerBuilder :\n        Fresco.newDraweeControllerBuilder(),\n      mCallerContext\n    );\n  }\n\n  @Override\n  public Class<FrescoBasedReactTextInlineImageShadowNode> getShadowNodeClass() {\n    return FrescoBasedReactTextInlineImageShadowNode.class;\n  }\n\n  @Override\n  public void updateExtraData(View root, Object extraData) {\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"textinput\",\n    srcs = glob([\"*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    required_for_source_only_abi = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/imagehelper:imagehelper\"),\n        react_native_target(\"java/com/facebook/react/views/scroll:scroll\"),\n        react_native_target(\"java/com/facebook/react/views/text:text\"),\n        react_native_target(\"java/com/facebook/react/views/view:view\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ContentSizeWatcher.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\npublic interface ContentSizeWatcher {\n  public void onLayout();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactContentSizeChangedEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by EditText native view when content size changes.\n */\npublic class ReactContentSizeChangedEvent extends Event<ReactTextChangedEvent> {\n\n  public static final String EVENT_NAME = \"topContentSizeChange\";\n\n  private float mContentWidth;\n  private float mContentHeight;\n\n  public ReactContentSizeChangedEvent(\n    int viewId,\n    float contentSizeWidth,\n    float contentSizeHeight) {\n    super(viewId);\n    mContentWidth = contentSizeWidth;\n    mContentHeight = contentSizeHeight;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n\n    WritableMap contentSize = Arguments.createMap();\n    contentSize.putDouble(\"width\", mContentWidth);\n    contentSize.putDouble(\"height\", mContentHeight);\n    eventData.putMap(\"contentSize\", contentSize);\n\n    eventData.putInt(\"target\", getViewTag());\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport android.content.Context;\nimport android.graphics.Rect;\nimport android.graphics.Typeface;\nimport android.graphics.drawable.Drawable;\nimport android.os.Build;\nimport android.text.Editable;\nimport android.text.InputType;\nimport android.text.SpannableStringBuilder;\nimport android.text.Spanned;\nimport android.text.TextWatcher;\nimport android.text.TextUtils;\nimport android.text.method.KeyListener;\nimport android.text.method.QwertyKeyListener;\nimport android.text.style.AbsoluteSizeSpan;\nimport android.text.style.BackgroundColorSpan;\nimport android.text.style.ForegroundColorSpan;\nimport android.view.Gravity;\nimport android.view.KeyEvent;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.inputmethod.EditorInfo;\nimport android.view.inputmethod.InputConnection;\nimport android.view.inputmethod.InputMethodManager;\nimport android.widget.EditText;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.views.text.CustomStyleSpan;\nimport com.facebook.react.views.text.ReactTagSpan;\nimport com.facebook.react.views.text.ReactTextUpdate;\nimport com.facebook.react.views.text.TextInlineImageSpan;\nimport com.facebook.react.views.view.ReactViewBackgroundManager;\nimport java.util.ArrayList;\nimport javax.annotation.Nullable;\n\n/**\n * A wrapper around the EditText that lets us better control what happens when an EditText gets\n * focused or blurred, and when to display the soft keyboard and when not to.\n *\n * ReactEditTexts have setFocusableInTouchMode set to false automatically because touches on the\n * EditText are managed on the JS side. This also removes the nasty side effect that EditTexts\n * have, which is that focus is always maintained on one of the EditTexts.\n *\n * The wrapper stops the EditText from triggering *TextChanged events, in the case where JS\n * has called this explicitly. This is the default behavior on other platforms as well.\n * VisibleForTesting from {@link TextInputEventsTestCase}.\n */\npublic class ReactEditText extends EditText {\n\n  private final InputMethodManager mInputMethodManager;\n  // This flag is set to true when we set the text of the EditText explicitly. In that case, no\n  // *TextChanged events should be triggered. This is less expensive than removing the text\n  // listeners and adding them back again after the text change is completed.\n  private boolean mIsSettingTextFromJS;\n  // This component is controlled, so we want it to get focused only when JS ask it to do so.\n  // Whenever android requests focus (which it does for random reasons), it will be ignored.\n  private boolean mIsJSSettingFocus;\n  private int mDefaultGravityHorizontal;\n  private int mDefaultGravityVertical;\n  private int mNativeEventCount;\n  private int mMostRecentEventCount;\n  private @Nullable ArrayList<TextWatcher> mListeners;\n  private @Nullable TextWatcherDelegator mTextWatcherDelegator;\n  private int mStagedInputType;\n  private boolean mContainsImages;\n  private @Nullable Boolean mBlurOnSubmit;\n  private boolean mDisableFullscreen;\n  private @Nullable String mReturnKeyType;\n  private @Nullable SelectionWatcher mSelectionWatcher;\n  private @Nullable ContentSizeWatcher mContentSizeWatcher;\n  private @Nullable ScrollWatcher mScrollWatcher;\n  private final InternalKeyListener mKeyListener;\n  private boolean mDetectScrollMovement = false;\n\n  private ReactViewBackgroundManager mReactBackgroundManager;\n\n  private static final KeyListener sKeyListener = QwertyKeyListener.getInstanceForFullKeyboard();\n\n  public ReactEditText(Context context) {\n    super(context);\n    setFocusableInTouchMode(false);\n\n    mReactBackgroundManager = new ReactViewBackgroundManager(this);\n    mInputMethodManager = (InputMethodManager)\n        Assertions.assertNotNull(getContext().getSystemService(Context.INPUT_METHOD_SERVICE));\n    mDefaultGravityHorizontal =\n        getGravity() & (Gravity.HORIZONTAL_GRAVITY_MASK | Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK);\n    mDefaultGravityVertical = getGravity() & Gravity.VERTICAL_GRAVITY_MASK;\n    mNativeEventCount = 0;\n    mMostRecentEventCount = 0;\n    mIsSettingTextFromJS = false;\n    mIsJSSettingFocus = false;\n    mBlurOnSubmit = null;\n    mDisableFullscreen = false;\n    mListeners = null;\n    mTextWatcherDelegator = null;\n    mStagedInputType = getInputType();\n    mKeyListener = new InternalKeyListener();\n    mScrollWatcher = null;\n  }\n\n  // After the text changes inside an EditText, TextView checks if a layout() has been requested.\n  // If it has, it will not scroll the text to the end of the new text inserted, but wait for the\n  // next layout() to be called. However, we do not perform a layout() after a requestLayout(), so\n  // we need to override isLayoutRequested to force EditText to scroll to the end of the new text\n  // immediately.\n  // TODO: t6408636 verify if we should schedule a layout after a View does a requestLayout()\n  @Override\n  public boolean isLayoutRequested() {\n    return false;\n  }\n\n  @Override\n  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n    onContentSizeChange();\n  }\n\n  @Override\n  public boolean onTouchEvent(MotionEvent ev) {\n    switch (ev.getAction()) {\n      case MotionEvent.ACTION_DOWN:\n        mDetectScrollMovement = true;\n        // Disallow parent views to intercept touch events, until we can detect if we should be\n        // capturing these touches or not.\n        this.getParent().requestDisallowInterceptTouchEvent(true);\n        break;\n      case MotionEvent.ACTION_MOVE:\n        if (mDetectScrollMovement) {\n          if (!canScrollVertically(-1) &&\n              !canScrollVertically(1) &&\n              !canScrollHorizontally(-1) &&\n              !canScrollHorizontally(1)) {\n            // We cannot scroll, let parent views take care of these touches.\n            this.getParent().requestDisallowInterceptTouchEvent(false);\n          }\n          mDetectScrollMovement = false;\n        }\n        break;\n    }\n    return super.onTouchEvent(ev);\n  }\n\n  // Consume 'Enter' key events: TextView tries to give focus to the next TextInput, but it can't\n  // since we only allow JS to change focus, which in turn causes TextView to crash.\n  @Override\n  public boolean onKeyUp(int keyCode, KeyEvent event) {\n    if (keyCode == KeyEvent.KEYCODE_ENTER && !isMultiline()) {\n      hideSoftKeyboard();\n      return true;\n    }\n    return super.onKeyUp(keyCode, event);\n  }\n\n  @Override\n  protected void onScrollChanged(int horiz, int vert, int oldHoriz, int oldVert) {\n    super.onScrollChanged(horiz, vert, oldHoriz, oldVert);\n\n    if (mScrollWatcher != null) {\n      mScrollWatcher.onScrollChanged(horiz, vert, oldHoriz, oldVert);\n    }\n  }\n\n  @Override\n  public InputConnection onCreateInputConnection(EditorInfo outAttrs) {\n    ReactContext reactContext = (ReactContext) getContext();\n    ReactEditTextInputConnectionWrapper inputConnectionWrapper =\n        new ReactEditTextInputConnectionWrapper(super.onCreateInputConnection(outAttrs), reactContext, this);\n\n    if (isMultiline() && getBlurOnSubmit()) {\n      // Remove IME_FLAG_NO_ENTER_ACTION to keep the original IME_OPTION\n      outAttrs.imeOptions &= ~EditorInfo.IME_FLAG_NO_ENTER_ACTION;\n    }\n    return inputConnectionWrapper;\n  }\n\n  @Override\n  public void clearFocus() {\n    setFocusableInTouchMode(false);\n    super.clearFocus();\n    hideSoftKeyboard();\n  }\n\n  @Override\n  public boolean requestFocus(int direction, Rect previouslyFocusedRect) {\n    // Always return true if we are already focused. This is used by android in certain places,\n    // such as text selection.\n    if (isFocused()) {\n      return true;\n    }\n    if (!mIsJSSettingFocus) {\n      return false;\n    }\n    setFocusableInTouchMode(true);\n    boolean focused = super.requestFocus(direction, previouslyFocusedRect);\n    showSoftKeyboard();\n    return focused;\n  }\n\n  @Override\n  public void addTextChangedListener(TextWatcher watcher) {\n    if (mListeners == null) {\n      mListeners = new ArrayList<>();\n      super.addTextChangedListener(getTextWatcherDelegator());\n    }\n\n    mListeners.add(watcher);\n  }\n\n  @Override\n  public void removeTextChangedListener(TextWatcher watcher) {\n    if (mListeners != null) {\n      mListeners.remove(watcher);\n\n      if (mListeners.isEmpty()) {\n        mListeners = null;\n        super.removeTextChangedListener(getTextWatcherDelegator());\n      }\n    }\n  }\n\n  public void setContentSizeWatcher(ContentSizeWatcher contentSizeWatcher) {\n    mContentSizeWatcher = contentSizeWatcher;\n  }\n\n  public void setScrollWatcher(ScrollWatcher scrollWatcher) {\n    mScrollWatcher = scrollWatcher;\n  }\n\n  @Override\n  public void setSelection(int start, int end) {\n    // Skip setting the selection if the text wasn't set because of an out of date value.\n    if (mMostRecentEventCount < mNativeEventCount) {\n      return;\n    }\n\n    super.setSelection(start, end);\n  }\n\n  @Override\n  protected void onSelectionChanged(int selStart, int selEnd) {\n    super.onSelectionChanged(selStart, selEnd);\n    if (mSelectionWatcher != null && hasFocus()) {\n      mSelectionWatcher.onSelectionChanged(selStart, selEnd);\n    }\n  }\n\n  @Override\n  protected void onFocusChanged(\n      boolean focused, int direction, Rect previouslyFocusedRect) {\n    super.onFocusChanged(focused, direction, previouslyFocusedRect);\n    if (focused && mSelectionWatcher != null) {\n      mSelectionWatcher.onSelectionChanged(getSelectionStart(), getSelectionEnd());\n    }\n  }\n\n  public void setSelectionWatcher(SelectionWatcher selectionWatcher) {\n    mSelectionWatcher = selectionWatcher;\n  }\n\n  public void setBlurOnSubmit(@Nullable Boolean blurOnSubmit) {\n    mBlurOnSubmit = blurOnSubmit;\n  }\n\n  public boolean getBlurOnSubmit() {\n    if (mBlurOnSubmit == null) {\n      // Default blurOnSubmit\n      return isMultiline() ? false : true;\n    }\n\n    return mBlurOnSubmit;\n  }\n\n  public void setDisableFullscreenUI(boolean disableFullscreenUI) {\n    mDisableFullscreen = disableFullscreenUI;\n    updateImeOptions();\n  }\n\n  public boolean getDisableFullscreenUI() {\n    return mDisableFullscreen;\n  }\n\n  public void setReturnKeyType(String returnKeyType) {\n    mReturnKeyType = returnKeyType;\n    updateImeOptions();\n  }\n\n  public String getReturnKeyType() {\n    return mReturnKeyType;\n  }\n\n  /*protected*/ int getStagedInputType() {\n    return mStagedInputType;\n  }\n\n  /*package*/ void setStagedInputType(int stagedInputType) {\n    mStagedInputType = stagedInputType;\n  }\n\n  /*package*/ void commitStagedInputType() {\n    if (getInputType() != mStagedInputType) {\n      setInputType(mStagedInputType);\n    }\n  }\n\n  @Override\n  public void setInputType(int type) {\n    Typeface tf = super.getTypeface();\n    super.setInputType(type);\n    mStagedInputType = type;\n    // Input type password defaults to monospace font, so we need to re-apply the font\n    super.setTypeface(tf);\n\n    // We override the KeyListener so that all keys on the soft input keyboard as well as hardware\n    // keyboards work. Some KeyListeners like DigitsKeyListener will display the keyboard but not\n    // accept all input from it\n    mKeyListener.setInputType(type);\n    setKeyListener(mKeyListener);\n  }\n\n  // VisibleForTesting from {@link TextInputEventsTestCase}.\n  public void requestFocusFromJS() {\n    mIsJSSettingFocus = true;\n    requestFocus();\n    mIsJSSettingFocus = false;\n  }\n\n  /* package */ void clearFocusFromJS() {\n    clearFocus();\n  }\n\n  // VisibleForTesting from {@link TextInputEventsTestCase}.\n  public int incrementAndGetEventCounter() {\n    return ++mNativeEventCount;\n  }\n\n  // VisibleForTesting from {@link TextInputEventsTestCase}.\n  public void maybeSetText(ReactTextUpdate reactTextUpdate) {\n    if( isSecureText() &&\n        TextUtils.equals(getText(), reactTextUpdate.getText())) {\n      return;\n    }\n\n    // Only set the text if it is up to date.\n    mMostRecentEventCount = reactTextUpdate.getJsEventCounter();\n    if (mMostRecentEventCount < mNativeEventCount) {\n      return;\n    }\n\n    // The current text gets replaced with the text received from JS. However, the spans on the\n    // current text need to be adapted to the new text. Since TextView#setText() will remove or\n    // reset some of these spans even if they are set directly, SpannableStringBuilder#replace() is\n    // used instead (this is also used by the the keyboard implementation underneath the covers).\n    SpannableStringBuilder spannableStringBuilder =\n        new SpannableStringBuilder(reactTextUpdate.getText());\n    manageSpans(spannableStringBuilder);\n    mContainsImages = reactTextUpdate.containsImages();\n    mIsSettingTextFromJS = true;\n\n    getText().replace(0, length(), spannableStringBuilder);\n\n    mIsSettingTextFromJS = false;\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n      if (getBreakStrategy() != reactTextUpdate.getTextBreakStrategy()) {\n        setBreakStrategy(reactTextUpdate.getTextBreakStrategy());\n      }\n    }\n  }\n\n  /**\n   * Remove and/or add {@link Spanned.SPAN_EXCLUSIVE_EXCLUSIVE} spans, since they should only exist\n   * as long as the text they cover is the same. All other spans will remain the same, since they\n   * will adapt to the new text, hence why {@link SpannableStringBuilder#replace} never removes\n   * them.\n   */\n  private void manageSpans(SpannableStringBuilder spannableStringBuilder) {\n    Object[] spans = getText().getSpans(0, length(), Object.class);\n    for (int spanIdx = 0; spanIdx < spans.length; spanIdx++) {\n      // Remove all styling spans we might have previously set\n      if (ForegroundColorSpan.class.isInstance(spans[spanIdx]) ||\n          BackgroundColorSpan.class.isInstance(spans[spanIdx]) ||\n          AbsoluteSizeSpan.class.isInstance(spans[spanIdx]) ||\n          CustomStyleSpan.class.isInstance(spans[spanIdx]) ||\n          ReactTagSpan.class.isInstance(spans[spanIdx])) {\n        getText().removeSpan(spans[spanIdx]);\n      }\n\n      if ((getText().getSpanFlags(spans[spanIdx]) & Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) !=\n          Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) {\n        continue;\n      }\n      Object span = spans[spanIdx];\n      final int spanStart = getText().getSpanStart(spans[spanIdx]);\n      final int spanEnd = getText().getSpanEnd(spans[spanIdx]);\n      final int spanFlags = getText().getSpanFlags(spans[spanIdx]);\n\n      // Make sure the span is removed from existing text, otherwise the spans we set will be\n      // ignored or it will cover text that has changed.\n      getText().removeSpan(spans[spanIdx]);\n      if (sameTextForSpan(getText(), spannableStringBuilder, spanStart, spanEnd)) {\n        spannableStringBuilder.setSpan(span, spanStart, spanEnd, spanFlags);\n      }\n    }\n  }\n\n  private static boolean sameTextForSpan(\n      final Editable oldText,\n      final SpannableStringBuilder newText,\n      final int start,\n      final int end) {\n    if (start > newText.length() || end > newText.length()) {\n      return false;\n    }\n    for (int charIdx = start; charIdx < end; charIdx++) {\n      if (oldText.charAt(charIdx) != newText.charAt(charIdx)) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  private boolean showSoftKeyboard() {\n    return mInputMethodManager.showSoftInput(this, 0);\n  }\n\n  private void hideSoftKeyboard() {\n    mInputMethodManager.hideSoftInputFromWindow(getWindowToken(), 0);\n  }\n\n  private TextWatcherDelegator getTextWatcherDelegator() {\n    if (mTextWatcherDelegator == null) {\n      mTextWatcherDelegator = new TextWatcherDelegator();\n    }\n    return mTextWatcherDelegator;\n  }\n\n  private boolean isMultiline() {\n    return (getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE) != 0;\n  }\n\n  private boolean isSecureText() {\n    return\n      (getInputType() &\n        (InputType.TYPE_NUMBER_VARIATION_PASSWORD |\n          InputType.TYPE_TEXT_VARIATION_PASSWORD))\n      != 0;\n  }\n\n  private void onContentSizeChange() {\n    if (mContentSizeWatcher != null) {\n      mContentSizeWatcher.onLayout();\n    }\n\n    setIntrinsicContentSize();\n  }\n\n  private void setIntrinsicContentSize() {\n    ReactContext reactContext = (ReactContext) getContext();\n    UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class);\n    final ReactTextInputLocalData localData = new ReactTextInputLocalData(this);\n    uiManager.setViewLocalData(getId(), localData);\n  }\n\n  /* package */ void setGravityHorizontal(int gravityHorizontal) {\n    if (gravityHorizontal == 0) {\n      gravityHorizontal = mDefaultGravityHorizontal;\n    }\n    setGravity(\n        (getGravity() & ~Gravity.HORIZONTAL_GRAVITY_MASK &\n            ~Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) | gravityHorizontal);\n  }\n\n  /* package */ void setGravityVertical(int gravityVertical) {\n    if (gravityVertical == 0) {\n      gravityVertical = mDefaultGravityVertical;\n    }\n    setGravity((getGravity() & ~Gravity.VERTICAL_GRAVITY_MASK) | gravityVertical);\n  }\n\n  private void updateImeOptions() {\n    // Default to IME_ACTION_DONE\n    int returnKeyFlag = EditorInfo.IME_ACTION_DONE;\n    if (mReturnKeyType != null) {\n      switch (mReturnKeyType) {\n        case \"go\":\n          returnKeyFlag = EditorInfo.IME_ACTION_GO;\n          break;\n        case \"next\":\n          returnKeyFlag = EditorInfo.IME_ACTION_NEXT;\n          break;\n        case \"none\":\n          returnKeyFlag = EditorInfo.IME_ACTION_NONE;\n          break;\n        case \"previous\":\n          returnKeyFlag = EditorInfo.IME_ACTION_PREVIOUS;\n          break;\n        case \"search\":\n          returnKeyFlag = EditorInfo.IME_ACTION_SEARCH;\n          break;\n        case \"send\":\n          returnKeyFlag = EditorInfo.IME_ACTION_SEND;\n          break;\n        case \"done\":\n          returnKeyFlag = EditorInfo.IME_ACTION_DONE;\n          break;\n      }\n    }\n\n    if (mDisableFullscreen) {\n      setImeOptions(returnKeyFlag | EditorInfo.IME_FLAG_NO_FULLSCREEN);\n    } else {\n      setImeOptions(returnKeyFlag);\n    }\n  }\n\n  @Override\n  protected boolean verifyDrawable(Drawable drawable) {\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        if (span.getDrawable() == drawable) {\n          return true;\n        }\n      }\n    }\n    return super.verifyDrawable(drawable);\n  }\n\n  @Override\n  public void invalidateDrawable(Drawable drawable) {\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        if (span.getDrawable() == drawable) {\n          invalidate();\n        }\n      }\n    }\n    super.invalidateDrawable(drawable);\n  }\n\n  @Override\n  public void onDetachedFromWindow() {\n    super.onDetachedFromWindow();\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        span.onDetachedFromWindow();\n      }\n    }\n  }\n\n  @Override\n  public void onStartTemporaryDetach() {\n    super.onStartTemporaryDetach();\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        span.onStartTemporaryDetach();\n      }\n    }\n  }\n\n  @Override\n  public void onAttachedToWindow() {\n    super.onAttachedToWindow();\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        span.onAttachedToWindow();\n      }\n    }\n  }\n\n  @Override\n  public void onFinishTemporaryDetach() {\n    super.onFinishTemporaryDetach();\n    if (mContainsImages && getText() instanceof Spanned) {\n      Spanned text = (Spanned) getText();\n      TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);\n      for (TextInlineImageSpan span : spans) {\n        span.onFinishTemporaryDetach();\n      }\n    }\n  }\n\n  @Override\n  public void setBackgroundColor(int color) {\n    mReactBackgroundManager.setBackgroundColor(color);\n  }\n\n  public void setBorderWidth(int position, float width) {\n    mReactBackgroundManager.setBorderWidth(position, width);\n  }\n\n  public void setBorderColor(int position, float color, float alpha) {\n    mReactBackgroundManager.setBorderColor(position, color, alpha);\n  }\n\n  public void setBorderRadius(float borderRadius) {\n    mReactBackgroundManager.setBorderRadius(borderRadius);\n  }\n\n  public void setBorderRadius(float borderRadius, int position) {\n    mReactBackgroundManager.setBorderRadius(borderRadius, position);\n  }\n\n  public void setBorderStyle(@Nullable String style) {\n    mReactBackgroundManager.setBorderStyle(style);\n  }\n\n  /**\n   * This class will redirect *TextChanged calls to the listeners only in the case where the text\n   * is changed by the user, and not explicitly set by JS.\n   */\n  private class TextWatcherDelegator implements TextWatcher {\n    @Override\n    public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n      if (!mIsSettingTextFromJS && mListeners != null) {\n        for (TextWatcher listener : mListeners) {\n          listener.beforeTextChanged(s, start, count, after);\n        }\n      }\n    }\n\n    @Override\n    public void onTextChanged(CharSequence s, int start, int before, int count) {\n      if (!mIsSettingTextFromJS && mListeners != null) {\n        for (TextWatcher listener : mListeners) {\n          listener.onTextChanged(s, start, before, count);\n        }\n      }\n\n      onContentSizeChange();\n    }\n\n    @Override\n    public void afterTextChanged(Editable s) {\n      if (!mIsSettingTextFromJS && mListeners != null) {\n        for (TextWatcher listener : mListeners) {\n          listener.afterTextChanged(s);\n        }\n      }\n    }\n  }\n\n  /*\n   * This class is set as the KeyListener for the underlying TextView\n   * It does two things\n   *  1) Provides the same answer to getInputType() as the real KeyListener would have which allows\n   *     the proper keyboard to pop up on screen\n   *  2) Permits all keyboard input through\n   */\n  private static class InternalKeyListener implements KeyListener {\n\n    private int mInputType = 0;\n\n    public InternalKeyListener() {\n    }\n\n    public void setInputType(int inputType) {\n      mInputType = inputType;\n    }\n\n    /*\n     * getInputType will return whatever value is passed in.  This will allow the proper keyboard\n     * to be shown on screen but without the actual filtering done by other KeyListeners\n     */\n    @Override\n    public int getInputType() {\n      return mInputType;\n    }\n\n    /*\n     * All overrides of key handling defer to the underlying KeyListener which is shared by all\n     * ReactEditText instances.  It will basically allow any/all keyboard input whether from\n     * physical keyboard or from soft input.\n     */\n    @Override\n    public boolean onKeyDown(View view, Editable text, int keyCode, KeyEvent event) {\n      return sKeyListener.onKeyDown(view, text, keyCode, event);\n    }\n\n    @Override\n    public boolean onKeyUp(View view, Editable text, int keyCode, KeyEvent event) {\n      return sKeyListener.onKeyUp(view, text, keyCode, event);\n    }\n\n    @Override\n    public boolean onKeyOther(View view, Editable text, KeyEvent event) {\n      return sKeyListener.onKeyOther(view, text, event);\n    }\n\n    @Override\n    public void clearMetaKeyState(View view, Editable content, int states) {\n      sKeyListener.clearMetaKeyState(view, content, states);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport javax.annotation.Nullable;\n\nimport android.view.KeyEvent;\nimport android.view.inputmethod.EditorInfo;\nimport android.view.inputmethod.InputConnection;\nimport android.view.inputmethod.InputConnectionWrapper;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.events.EventDispatcher;\n\n/**\n * A class to implement the TextInput 'onKeyPress' API on android for soft keyboards.\n * It is instantiated in {@link ReactEditText#onCreateInputConnection(EditorInfo)}.\n *\n * Android IMEs interface with EditText views through the {@link InputConnection} interface,\n * so any observable change in state of the EditText via the soft-keyboard, should be a side effect of\n * one or more of the methods in {@link InputConnectionWrapper}.\n *\n * {@link InputConnection#setComposingText(CharSequence, int)} is used to set the composing region\n * (the underlined text) in the {@link android.widget.EditText} view, i.e. when React Native's\n * TextInput has the property 'autoCorrect' set to true. When text is being composed in the composing\n * state within the EditText, each key press will result in a call to\n * {@link InputConnection#setComposingText(CharSequence, int)} with a CharSequence argument equal to\n * that of the entire composing region, rather than a single character diff.\n * We can reason about the keyPress based on the resultant cursor position changes of the EditText after\n * applying this change. For example if the cursor moved backwards by one character when composing,\n * it's likely it was a delete; if it moves forward by a character, likely to be a key press of that character.\n *\n * IMEs can also call {@link InputConnection#beginBatchEdit()} to signify a batch of operations. One\n * such example is committing a word currently in composing state with the press of the space key.\n * It is IME dependent but the stock Android keyboard behavior seems to be to commit the currently composing\n * text with {@link InputConnection#setComposingText(CharSequence, int)} and commits a space character\n * with a separate call to {@link InputConnection#setComposingText(CharSequence, int)}.\n * Here we chose to emit the last input of a batch edit as that tends to be the user input, but\n * it's completely arbitrary.\n *\n * Another function of this class is to detect backspaces when the cursor at the beginning of the\n * {@link android.widget.EditText}, i.e no text is deleted.\n *\n * N.B. this class is only applicable for soft keyboards behavior. For hardware keyboards\n * {@link android.view.View#onKeyDown(int, KeyEvent)} can be overridden to obtain the keycode of the\n * key pressed.\n */\nclass ReactEditTextInputConnectionWrapper extends InputConnectionWrapper {\n  public static final String NEWLINE_RAW_VALUE = \"\\n\";\n  public static final String BACKSPACE_KEY_VALUE = \"Backspace\";\n  public static final String ENTER_KEY_VALUE = \"Enter\";\n\n  private ReactEditText mEditText;\n  private EventDispatcher mEventDispatcher;\n  private boolean mIsBatchEdit;\n  private @Nullable String mKey = null;\n\n  public ReactEditTextInputConnectionWrapper(\n      InputConnection target,\n      final ReactContext reactContext,\n      final ReactEditText editText\n  ) {\n    super(target, false);\n    mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n    mEditText = editText;\n  }\n\n  @Override\n  public boolean beginBatchEdit() {\n    mIsBatchEdit = true;\n    return super.beginBatchEdit();\n  }\n\n  @Override\n  public boolean endBatchEdit() {\n    mIsBatchEdit = false;\n    if (mKey != null) {\n      dispatchKeyEvent(mKey);\n      mKey = null;\n    }\n    return super.endBatchEdit();\n  }\n\n  @Override\n  public boolean setComposingText(CharSequence text, int newCursorPosition) {\n    int previousSelectionStart = mEditText.getSelectionStart();\n    int previousSelectionEnd = mEditText.getSelectionEnd();\n    String key;\n    boolean consumed = super.setComposingText(text, newCursorPosition);\n    boolean noPreviousSelection = previousSelectionStart == previousSelectionEnd;\n    boolean cursorDidNotMove = mEditText.getSelectionStart() == previousSelectionStart;\n    boolean cursorMovedBackwards = mEditText.getSelectionStart() < previousSelectionStart;\n    if ((noPreviousSelection && cursorMovedBackwards)\n            || !noPreviousSelection && cursorDidNotMove) {\n      key = BACKSPACE_KEY_VALUE;\n    } else {\n      key = String.valueOf(mEditText.getText().charAt(mEditText.getSelectionStart() - 1));\n    }\n    dispatchKeyEventOrEnqueue(key);\n    return consumed;\n  }\n\n  @Override\n  public boolean commitText(CharSequence text, int newCursorPosition) {\n    String key = text.toString();\n    // Assume not a keyPress if length > 1\n    if (key.length() <= 1) {\n      if (key.equals(\"\")) {\n        key = BACKSPACE_KEY_VALUE;\n      }\n      dispatchKeyEventOrEnqueue(key);\n    }\n\n    return super.commitText(text, newCursorPosition);\n  }\n\n  @Override\n  public boolean deleteSurroundingText(int beforeLength, int afterLength) {\n    dispatchKeyEvent(BACKSPACE_KEY_VALUE);\n    return super.deleteSurroundingText(beforeLength, afterLength);\n  }\n\n  // Called by SwiftKey when cursor at beginning of input when there is a delete\n  // or when enter is pressed anywhere in the text. Whereas stock Android Keyboard calls\n  // {@link InputConnection#deleteSurroundingText} & {@link InputConnection#commitText}\n  // in each case, respectively.\n  @Override\n  public boolean sendKeyEvent(KeyEvent event) {\n    if(event.getAction() == KeyEvent.ACTION_DOWN) {\n      if (event.getKeyCode() == KeyEvent.KEYCODE_DEL) {\n        dispatchKeyEvent(BACKSPACE_KEY_VALUE);\n      } else if(event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {\n        dispatchKeyEvent(ENTER_KEY_VALUE);\n      }\n    }\n    return super.sendKeyEvent(event);\n  }\n\n  private void dispatchKeyEventOrEnqueue(String key) {\n    if (mIsBatchEdit) {\n      mKey = key;\n    } else {\n      dispatchKeyEvent(key);\n    }\n  }\n\n  private void dispatchKeyEvent(String key) {\n    if (key.equals(NEWLINE_RAW_VALUE)) {\n      key = ENTER_KEY_VALUE;\n    }\n    mEventDispatcher.dispatchEvent(\n        new ReactTextInputKeyPressEvent(\n            mEditText.getId(),\n            key));\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by EditText native view when text changes.\n * VisibleForTesting from {@link TextInputEventsTestCase}.\n */\npublic class ReactTextChangedEvent extends Event<ReactTextChangedEvent> {\n\n  public static final String EVENT_NAME = \"topChange\";\n\n  private String mText;\n  private int mEventCount;\n\n  public ReactTextChangedEvent(\n      int viewId,\n      String text,\n      int eventCount) {\n    super(viewId);\n    mText = text;\n    mEventCount = eventCount;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putString(\"text\", mText);\n    eventData.putInt(\"eventCount\", mEventCount);\n    eventData.putInt(\"target\", getViewTag());\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputBlurEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by EditText native view when it loses focus.\n */\n/* package */ class ReactTextInputBlurEvent extends Event<ReactTextInputBlurEvent> {\n\n  private static final String EVENT_NAME = \"topBlur\";\n\n  public ReactTextInputBlurEvent(int viewId) {\n    super(viewId);\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    return false;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putInt(\"target\", getViewTag());\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputEndEditingEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by EditText native view when text editing ends,\n * because of the user leaving the text input.\n */\nclass ReactTextInputEndEditingEvent extends Event<ReactTextInputEndEditingEvent> {\n\n  private static final String EVENT_NAME = \"topEndEditing\";\n\n  private String mText;\n\n  public ReactTextInputEndEditingEvent(\n      int viewId,\n      String text) {\n    super(viewId);\n    mText = text;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    return false;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putInt(\"target\", getViewTag());\n    eventData.putString(\"text\", mText);\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by EditText native view when text changes.\n * VisibleForTesting from {@link TextInputEventsTestCase}.\n */\npublic class ReactTextInputEvent extends Event<ReactTextInputEvent> {\n\n  public static final String EVENT_NAME = \"topTextInput\";\n\n  private String mText;\n  private String mPreviousText;\n  private int mRangeStart;\n  private int mRangeEnd;\n\n  public ReactTextInputEvent(\n      int viewId,\n      String text,\n      String previousText,\n      int rangeStart,\n      int rangeEnd) {\n    super(viewId);\n    mText = text;\n    mPreviousText = previousText;\n    mRangeStart = rangeStart;\n    mRangeEnd = rangeEnd;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    // We don't want to miss any textinput event, as event data is incremental.\n    return false;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    WritableMap range = Arguments.createMap();\n    range.putDouble(\"start\", mRangeStart);\n    range.putDouble(\"end\", mRangeEnd);\n\n    eventData.putString(\"text\", mText);\n    eventData.putString(\"previousText\", mPreviousText);\n    eventData.putMap(\"range\", range);\n\n    eventData.putInt(\"target\", getViewTag());\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputFocusEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by EditText native view when it receives focus.\n */\n/* package */ class ReactTextInputFocusEvent extends Event<ReactTextInputFocusEvent> {\n\n  private static final String EVENT_NAME = \"topFocus\";\n\n  public ReactTextInputFocusEvent(int viewId) {\n    super(viewId);\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    return false;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putInt(\"target\", getViewTag());\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputKeyPressEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by EditText native view when key pressed\n */\npublic class ReactTextInputKeyPressEvent extends Event<ReactTextInputEvent> {\n\n  public static final String EVENT_NAME = \"topKeyPress\";\n\n  private String mKey;\n\n  ReactTextInputKeyPressEvent(int viewId, final String key) {\n    super(viewId);\n    mKey = key;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    // We don't want to miss any textinput event, as event data is incremental.\n    return false;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putString(\"key\", mKey);\n\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputLocalData.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport android.os.Build;\nimport android.text.SpannableStringBuilder;\nimport android.util.TypedValue;\nimport android.widget.EditText;\n\n/** Local state bearer for EditText instance. */\npublic final class ReactTextInputLocalData {\n\n  private final SpannableStringBuilder mText;\n  private final float mTextSize;\n  private final int mMinLines;\n  private final int mMaxLines;\n  private final int mInputType;\n  private final int mBreakStrategy;\n\n  public ReactTextInputLocalData(EditText editText) {\n    mText = new SpannableStringBuilder(editText.getText());\n    mTextSize = editText.getTextSize();\n    mMinLines = editText.getMinLines();\n    mMaxLines = editText.getMaxLines();\n    mInputType = editText.getInputType();\n\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n      mBreakStrategy = editText.getBreakStrategy();\n    } else {\n      mBreakStrategy = 0;\n    }\n  }\n\n  public void apply(EditText editText) {\n    editText.setText(mText);\n    editText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);\n    editText.setMinLines(mMinLines);\n    editText.setMaxLines(mMaxLines);\n    editText.setInputType(mInputType);\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n      editText.setBreakStrategy(mBreakStrategy);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport android.graphics.PorterDuff;\nimport android.graphics.Typeface;\nimport android.graphics.drawable.Drawable;\nimport android.support.v4.content.ContextCompat;\nimport android.text.Editable;\nimport android.text.InputFilter;\nimport android.text.InputType;\nimport android.text.Spannable;\nimport android.text.TextWatcher;\nimport android.util.TypedValue;\nimport android.view.Gravity;\nimport android.view.KeyEvent;\nimport android.view.View;\nimport android.view.inputmethod.EditorInfo;\nimport android.widget.TextView;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.BaseViewManager;\nimport com.facebook.react.uimanager.LayoutShadowNode;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewDefaults;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;\nimport com.facebook.react.views.scroll.ScrollEvent;\nimport com.facebook.react.views.scroll.ScrollEventType;\nimport com.facebook.react.views.text.DefaultStyleValuesUtil;\nimport com.facebook.react.views.text.ReactFontManager;\nimport com.facebook.react.views.text.ReactTextUpdate;\nimport com.facebook.react.views.text.TextInlineImageSpan;\nimport com.facebook.yoga.YogaConstants;\nimport java.lang.reflect.Field;\nimport java.util.LinkedList;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * Manages instances of TextInput.\n */\n@ReactModule(name = ReactTextInputManager.REACT_CLASS)\npublic class ReactTextInputManager extends BaseViewManager<ReactEditText, LayoutShadowNode> {\n\n  protected static final String REACT_CLASS = \"AndroidTextInput\";\n\n  private static final int[] SPACING_TYPES = {\n      Spacing.ALL, Spacing.LEFT, Spacing.RIGHT, Spacing.TOP, Spacing.BOTTOM,\n  };\n\n  private static final int FOCUS_TEXT_INPUT = 1;\n  private static final int BLUR_TEXT_INPUT = 2;\n\n  private static final int INPUT_TYPE_KEYBOARD_NUMBERED =\n      InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL |\n          InputType.TYPE_NUMBER_FLAG_SIGNED;\n\n  private static final String KEYBOARD_TYPE_EMAIL_ADDRESS = \"email-address\";\n  private static final String KEYBOARD_TYPE_NUMERIC = \"numeric\";\n  private static final String KEYBOARD_TYPE_PHONE_PAD = \"phone-pad\";\n  private static final String KEYBOARD_TYPE_VISIBLE_PASSWORD = \"visible-password\";\n  private static final InputFilter[] EMPTY_FILTERS = new InputFilter[0];\n  private static final int UNSET = -1;\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public ReactEditText createViewInstance(ThemedReactContext context) {\n    ReactEditText editText = new ReactEditText(context);\n    int inputType = editText.getInputType();\n    editText.setInputType(inputType & (~InputType.TYPE_TEXT_FLAG_MULTI_LINE));\n    editText.setReturnKeyType(\"done\");\n    editText.setTextSize(\n        TypedValue.COMPLEX_UNIT_PX,\n        (int) Math.ceil(PixelUtil.toPixelFromSP(ViewDefaults.FONT_SIZE_SP)));\n    return editText;\n  }\n\n  @Override\n  public LayoutShadowNode createShadowNodeInstance() {\n    return new ReactTextInputShadowNode();\n  }\n\n  @Override\n  public Class<? extends LayoutShadowNode> getShadowNodeClass() {\n    return ReactTextInputShadowNode.class;\n  }\n\n  @Nullable\n  @Override\n  public Map<String, Object> getExportedCustomBubblingEventTypeConstants() {\n    return MapBuilder.<String, Object>builder()\n        .put(\n            \"topSubmitEditing\",\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\n                    \"bubbled\", \"onSubmitEditing\", \"captured\", \"onSubmitEditingCapture\")))\n        .put(\n            \"topEndEditing\",\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\"bubbled\", \"onEndEditing\", \"captured\", \"onEndEditingCapture\")))\n        .put(\n            \"topTextInput\",\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\"bubbled\", \"onTextInput\", \"captured\", \"onTextInputCapture\")))\n        .put(\n            \"topFocus\",\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\"bubbled\", \"onFocus\", \"captured\", \"onFocusCapture\")))\n        .put(\n            \"topBlur\",\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\"bubbled\", \"onBlur\", \"captured\", \"onBlurCapture\")))\n        .put(\n            \"topKeyPress\",\n            MapBuilder.of(\n                \"phasedRegistrationNames\",\n                MapBuilder.of(\"bubbled\", \"onKeyPress\", \"captured\", \"onKeyPressCapture\")))\n        .build();\n  }\n\n  @Nullable\n  @Override\n  public Map<String, Object> getExportedCustomDirectEventTypeConstants() {\n    return MapBuilder.<String, Object>builder()\n        .put(ScrollEventType.SCROLL.getJSEventName(), MapBuilder.of(\"registrationName\", \"onScroll\"))\n        .build();\n  }\n\n  @Override\n  public @Nullable Map<String, Integer> getCommandsMap() {\n    return MapBuilder.of(\"focusTextInput\", FOCUS_TEXT_INPUT, \"blurTextInput\", BLUR_TEXT_INPUT);\n  }\n\n  @Override\n  public void receiveCommand(\n      ReactEditText reactEditText,\n      int commandId,\n      @Nullable ReadableArray args) {\n    switch (commandId) {\n      case FOCUS_TEXT_INPUT:\n        reactEditText.requestFocusFromJS();\n        break;\n      case BLUR_TEXT_INPUT:\n        reactEditText.clearFocusFromJS();\n        break;\n    }\n  }\n\n  @Override\n  public void updateExtraData(ReactEditText view, Object extraData) {\n    if (extraData instanceof ReactTextUpdate) {\n      ReactTextUpdate update = (ReactTextUpdate) extraData;\n\n      view.setPadding(\n          (int) update.getPaddingLeft(),\n          (int) update.getPaddingTop(),\n          (int) update.getPaddingRight(),\n          (int) update.getPaddingBottom());\n\n      if (update.containsImages()) {\n        Spannable spannable = update.getText();\n        TextInlineImageSpan.possiblyUpdateInlineImageSpans(spannable, view);\n      }\n      view.maybeSetText(update);\n    }\n  }\n\n  @ReactProp(name = ViewProps.FONT_SIZE, defaultFloat = ViewDefaults.FONT_SIZE_SP)\n  public void setFontSize(ReactEditText view, float fontSize) {\n    view.setTextSize(\n        TypedValue.COMPLEX_UNIT_PX,\n        (int) Math.ceil(PixelUtil.toPixelFromSP(fontSize)));\n  }\n\n  @ReactProp(name = ViewProps.FONT_FAMILY)\n  public void setFontFamily(ReactEditText view, String fontFamily) {\n    int style = Typeface.NORMAL;\n    if (view.getTypeface() != null) {\n      style = view.getTypeface().getStyle();\n    }\n    Typeface newTypeface = ReactFontManager.getInstance().getTypeface(\n        fontFamily,\n        style,\n        view.getContext().getAssets());\n    view.setTypeface(newTypeface);\n  }\n\n  /**\n  /* This code was taken from the method setFontWeight of the class ReactTextShadowNode\n  /* TODO: Factor into a common place they can both use\n  */\n  @ReactProp(name = ViewProps.FONT_WEIGHT)\n  public void setFontWeight(ReactEditText view, @Nullable String fontWeightString) {\n    int fontWeightNumeric = fontWeightString != null ?\n            parseNumericFontWeight(fontWeightString) : -1;\n    int fontWeight = UNSET;\n    if (fontWeightNumeric >= 500 || \"bold\".equals(fontWeightString)) {\n      fontWeight = Typeface.BOLD;\n    } else if (\"normal\".equals(fontWeightString) ||\n            (fontWeightNumeric != -1 && fontWeightNumeric < 500)) {\n      fontWeight = Typeface.NORMAL;\n    }\n    Typeface currentTypeface = view.getTypeface();\n    if (currentTypeface == null) {\n      currentTypeface = Typeface.DEFAULT;\n    }\n    if (fontWeight != currentTypeface.getStyle()) {\n      view.setTypeface(currentTypeface, fontWeight);\n    }\n  }\n\n  /**\n  /* This code was taken from the method setFontStyle of the class ReactTextShadowNode\n  /* TODO: Factor into a common place they can both use\n  */\n  @ReactProp(name = ViewProps.FONT_STYLE)\n  public void setFontStyle(ReactEditText view, @Nullable String fontStyleString) {\n    int fontStyle = UNSET;\n    if (\"italic\".equals(fontStyleString)) {\n      fontStyle = Typeface.ITALIC;\n    } else if (\"normal\".equals(fontStyleString)) {\n      fontStyle = Typeface.NORMAL;\n    }\n\n    Typeface currentTypeface = view.getTypeface();\n    if (currentTypeface == null) {\n      currentTypeface = Typeface.DEFAULT;\n    }\n    if (fontStyle != currentTypeface.getStyle()) {\n      view.setTypeface(currentTypeface, fontStyle);\n    }\n  }\n\n  @ReactProp(name = \"selection\")\n  public void setSelection(ReactEditText view, @Nullable ReadableMap selection) {\n    if (selection == null) {\n      return;\n    }\n\n    if (selection.hasKey(\"start\") && selection.hasKey(\"end\")) {\n      view.setSelection(selection.getInt(\"start\"), selection.getInt(\"end\"));\n    }\n  }\n\n  @ReactProp(name = \"onSelectionChange\", defaultBoolean = false)\n  public void setOnSelectionChange(final ReactEditText view, boolean onSelectionChange) {\n    if (onSelectionChange) {\n      view.setSelectionWatcher(new ReactSelectionWatcher(view));\n    } else {\n      view.setSelectionWatcher(null);\n    }\n  }\n\n  @ReactProp(name = \"blurOnSubmit\")\n  public void setBlurOnSubmit(ReactEditText view, @Nullable Boolean blurOnSubmit) {\n    view.setBlurOnSubmit(blurOnSubmit);\n  }\n\n  @ReactProp(name = \"onContentSizeChange\", defaultBoolean = false)\n  public void setOnContentSizeChange(final ReactEditText view, boolean onContentSizeChange) {\n    if (onContentSizeChange) {\n      view.setContentSizeWatcher(new ReactContentSizeWatcher(view));\n    } else {\n      view.setContentSizeWatcher(null);\n    }\n  }\n\n  @ReactProp(name = \"onScroll\", defaultBoolean = false)\n  public void setOnScroll(final ReactEditText view, boolean onScroll) {\n    if (onScroll) {\n      view.setScrollWatcher(new ReactScrollWatcher(view));\n    } else {\n      view.setScrollWatcher(null);\n    }\n  }\n\n  @ReactProp(name = \"placeholder\")\n  public void setPlaceholder(ReactEditText view, @Nullable String placeholder) {\n    view.setHint(placeholder);\n  }\n\n  @ReactProp(name = \"placeholderTextColor\", customType = \"Color\")\n  public void setPlaceholderTextColor(ReactEditText view, @Nullable Integer color) {\n    if (color == null) {\n      view.setHintTextColor(DefaultStyleValuesUtil.getDefaultTextColorHint(view.getContext()));\n    } else {\n      view.setHintTextColor(color);\n    }\n  }\n\n  @ReactProp(name = \"selectionColor\", customType = \"Color\")\n  public void setSelectionColor(ReactEditText view, @Nullable Integer color) {\n    if (color == null) {\n      view.setHighlightColor(DefaultStyleValuesUtil.getDefaultTextColorHighlight(view.getContext()));\n    } else {\n      view.setHighlightColor(color);\n    }\n\n    setCursorColor(view, color);\n  }\n\n  private void setCursorColor(ReactEditText view, @Nullable Integer color) {\n    // Evil method that uses reflection because there is no public API to changes\n    // the cursor color programmatically.\n    // Based on http://stackoverflow.com/questions/25996032/how-to-change-programatically-edittext-cursor-color-in-android.\n    try {\n      // Get the original cursor drawable resource.\n      Field cursorDrawableResField = TextView.class.getDeclaredField(\"mCursorDrawableRes\");\n      cursorDrawableResField.setAccessible(true);\n      int drawableResId = cursorDrawableResField.getInt(view);\n\n      // The view has no cursor drawable.\n      if (drawableResId == 0) {\n        return;\n      }\n\n      Drawable drawable = ContextCompat.getDrawable(view.getContext(), drawableResId);\n      if (color != null) {\n        drawable.setColorFilter(color, PorterDuff.Mode.SRC_IN);\n      }\n      Drawable[] drawables = {drawable, drawable};\n\n      // Update the current cursor drawable with the new one.\n      Field editorField = TextView.class.getDeclaredField(\"mEditor\");\n      editorField.setAccessible(true);\n      Object editor = editorField.get(view);\n      Field cursorDrawableField = editor.getClass().getDeclaredField(\"mCursorDrawable\");\n      cursorDrawableField.setAccessible(true);\n      cursorDrawableField.set(editor, drawables);\n    } catch (NoSuchFieldException ex) {\n      // Ignore errors to avoid crashing if these private fields don't exist on modified\n      // or future android versions.\n    } catch (IllegalAccessException ex) {}\n  }\n\n  @ReactProp(name = \"caretHidden\", defaultBoolean = false)\n  public void setCaretHidden(ReactEditText view, boolean caretHidden) {\n    view.setCursorVisible(!caretHidden);\n  }\n\n  @ReactProp(name = \"selectTextOnFocus\", defaultBoolean = false)\n  public void setSelectTextOnFocus(ReactEditText view, boolean selectTextOnFocus) {\n    view.setSelectAllOnFocus(selectTextOnFocus);\n  }\n\n  @ReactProp(name = ViewProps.COLOR, customType = \"Color\")\n  public void setColor(ReactEditText view, @Nullable Integer color) {\n    if (color == null) {\n      view.setTextColor(DefaultStyleValuesUtil.getDefaultTextColor(view.getContext()));\n    } else {\n      view.setTextColor(color);\n    }\n  }\n\n  @ReactProp(name = \"underlineColorAndroid\", customType = \"Color\")\n  public void setUnderlineColor(ReactEditText view, @Nullable Integer underlineColor) {\n    // Drawable.mutate() can sometimes crash due to an AOSP bug:\n    // See https://code.google.com/p/android/issues/detail?id=191754 for more info\n    Drawable background = view.getBackground();\n    Drawable drawableToMutate = background.getConstantState() != null ?\n      background.mutate() :\n      background;\n\n    if (underlineColor == null) {\n      drawableToMutate.clearColorFilter();\n    } else {\n      drawableToMutate.setColorFilter(underlineColor, PorterDuff.Mode.SRC_IN);\n    }\n  }\n\n  @ReactProp(name = ViewProps.TEXT_ALIGN)\n  public void setTextAlign(ReactEditText view, @Nullable String textAlign) {\n    if (textAlign == null || \"auto\".equals(textAlign)) {\n      view.setGravityHorizontal(Gravity.NO_GRAVITY);\n    } else if (\"left\".equals(textAlign)) {\n      view.setGravityHorizontal(Gravity.LEFT);\n    } else if (\"right\".equals(textAlign)) {\n      view.setGravityHorizontal(Gravity.RIGHT);\n    } else if (\"center\".equals(textAlign)) {\n      view.setGravityHorizontal(Gravity.CENTER_HORIZONTAL);\n    } else if (\"justify\".equals(textAlign)) {\n      // Fallback gracefully for cross-platform compat instead of error\n      view.setGravityHorizontal(Gravity.LEFT);\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Invalid textAlign: \" + textAlign);\n    }\n  }\n\n  @ReactProp(name = ViewProps.TEXT_ALIGN_VERTICAL)\n  public void setTextAlignVertical(ReactEditText view, @Nullable String textAlignVertical) {\n    if (textAlignVertical == null || \"auto\".equals(textAlignVertical)) {\n      view.setGravityVertical(Gravity.NO_GRAVITY);\n    } else if (\"top\".equals(textAlignVertical)) {\n      view.setGravityVertical(Gravity.TOP);\n    } else if (\"bottom\".equals(textAlignVertical)) {\n      view.setGravityVertical(Gravity.BOTTOM);\n    } else if (\"center\".equals(textAlignVertical)) {\n      view.setGravityVertical(Gravity.CENTER_VERTICAL);\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Invalid textAlignVertical: \" + textAlignVertical);\n    }\n  }\n\n  @ReactProp(name = \"inlineImageLeft\")\n  public void setInlineImageLeft(ReactEditText view, @Nullable String resource) {\n    int id = ResourceDrawableIdHelper.getInstance().getResourceDrawableId(view.getContext(), resource);\n    view.setCompoundDrawablesWithIntrinsicBounds(id, 0, 0, 0);\n  }\n\n  @ReactProp(name = \"inlineImagePadding\")\n  public void setInlineImagePadding(ReactEditText view, int padding) {\n    view.setCompoundDrawablePadding(padding);\n  }\n\n  @ReactProp(name = \"editable\", defaultBoolean = true)\n  public void setEditable(ReactEditText view, boolean editable) {\n    view.setEnabled(editable);\n  }\n\n  @ReactProp(name = ViewProps.NUMBER_OF_LINES, defaultInt = 1)\n  public void setNumLines(ReactEditText view, int numLines) {\n    view.setLines(numLines);\n  }\n\n  @ReactProp(name = \"maxLength\")\n  public void setMaxLength(ReactEditText view, @Nullable Integer maxLength) {\n    InputFilter [] currentFilters = view.getFilters();\n    InputFilter[] newFilters = EMPTY_FILTERS;\n\n    if (maxLength == null) {\n      if (currentFilters.length > 0) {\n        LinkedList<InputFilter> list = new LinkedList<>();\n        for (int i = 0; i < currentFilters.length; i++) {\n          if (!(currentFilters[i] instanceof InputFilter.LengthFilter)) {\n            list.add(currentFilters[i]);\n          }\n        }\n        if (!list.isEmpty()) {\n          newFilters = (InputFilter[]) list.toArray(new InputFilter[list.size()]);\n        }\n      }\n    } else {\n      if (currentFilters.length > 0) {\n        newFilters = currentFilters;\n        boolean replaced = false;\n        for (int i = 0; i < currentFilters.length; i++) {\n          if (currentFilters[i] instanceof InputFilter.LengthFilter) {\n            currentFilters[i] = new InputFilter.LengthFilter(maxLength);\n            replaced = true;\n          }\n        }\n        if (!replaced) {\n          newFilters = new InputFilter[currentFilters.length + 1];\n          System.arraycopy(currentFilters, 0, newFilters, 0, currentFilters.length);\n          currentFilters[currentFilters.length] = new InputFilter.LengthFilter(maxLength);\n        }\n      } else {\n        newFilters = new InputFilter[1];\n        newFilters[0] = new InputFilter.LengthFilter(maxLength);\n      }\n    }\n\n    view.setFilters(newFilters);\n  }\n\n  @ReactProp(name = \"autoCorrect\")\n  public void setAutoCorrect(ReactEditText view, @Nullable Boolean autoCorrect) {\n    // clear auto correct flags, set SUGGESTIONS or NO_SUGGESTIONS depending on value\n    updateStagedInputTypeFlag(\n        view,\n        InputType.TYPE_TEXT_FLAG_AUTO_CORRECT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS,\n        autoCorrect != null ?\n            (autoCorrect.booleanValue() ?\n                InputType.TYPE_TEXT_FLAG_AUTO_CORRECT : InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS)\n            : 0);\n  }\n\n  @ReactProp(name = \"multiline\", defaultBoolean = false)\n  public void setMultiline(ReactEditText view, boolean multiline) {\n    updateStagedInputTypeFlag(\n        view,\n        multiline ? 0 : InputType.TYPE_TEXT_FLAG_MULTI_LINE,\n        multiline ? InputType.TYPE_TEXT_FLAG_MULTI_LINE : 0);\n  }\n\n  @ReactProp(name = \"secureTextEntry\", defaultBoolean = false)\n  public void setSecureTextEntry(ReactEditText view, boolean password) {\n    updateStagedInputTypeFlag(\n        view,\n        password ? 0 :\n            InputType.TYPE_NUMBER_VARIATION_PASSWORD | InputType.TYPE_TEXT_VARIATION_PASSWORD,\n        password ? InputType.TYPE_TEXT_VARIATION_PASSWORD : 0);\n    checkPasswordType(view);\n  }\n\n  @ReactProp(name = \"autoCapitalize\")\n  public void setAutoCapitalize(ReactEditText view, int autoCapitalize) {\n    updateStagedInputTypeFlag(\n        view,\n        InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | InputType.TYPE_TEXT_FLAG_CAP_WORDS |\n            InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS,\n        autoCapitalize);\n  }\n\n  @ReactProp(name = \"keyboardType\")\n  public void setKeyboardType(ReactEditText view, @Nullable String keyboardType) {\n    int flagsToSet = InputType.TYPE_CLASS_TEXT;\n    if (KEYBOARD_TYPE_NUMERIC.equalsIgnoreCase(keyboardType)) {\n      flagsToSet = INPUT_TYPE_KEYBOARD_NUMBERED;\n    } else if (KEYBOARD_TYPE_EMAIL_ADDRESS.equalsIgnoreCase(keyboardType)) {\n      flagsToSet = InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS | InputType.TYPE_CLASS_TEXT;\n    } else if (KEYBOARD_TYPE_PHONE_PAD.equalsIgnoreCase(keyboardType)) {\n      flagsToSet = InputType.TYPE_CLASS_PHONE;\n    } else if (KEYBOARD_TYPE_VISIBLE_PASSWORD.equalsIgnoreCase(keyboardType)) {\n      flagsToSet = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;\n    }\n    updateStagedInputTypeFlag(\n        view,\n        INPUT_TYPE_KEYBOARD_NUMBERED | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS |\n            InputType.TYPE_CLASS_TEXT,\n        flagsToSet);\n    checkPasswordType(view);\n  }\n\n  @ReactProp(name = \"returnKeyType\")\n  public void setReturnKeyType(ReactEditText view, String returnKeyType) {\n    view.setReturnKeyType(returnKeyType);\n  }\n\n  @ReactProp(name = \"disableFullscreenUI\", defaultBoolean = false)\n  public void setDisableFullscreenUI(ReactEditText view, boolean disableFullscreenUI) {\n    view.setDisableFullscreenUI(disableFullscreenUI);\n  }\n\n  private static final int IME_ACTION_ID = 0x670;\n\n  @ReactProp(name = \"returnKeyLabel\")\n  public void setReturnKeyLabel(ReactEditText view, String returnKeyLabel) {\n    view.setImeActionLabel(returnKeyLabel, IME_ACTION_ID);\n  }\n\n  @ReactPropGroup(names = {\n      ViewProps.BORDER_RADIUS,\n      ViewProps.BORDER_TOP_LEFT_RADIUS,\n      ViewProps.BORDER_TOP_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_LEFT_RADIUS\n  }, defaultFloat = YogaConstants.UNDEFINED)\n  public void setBorderRadius(ReactEditText view, int index, float borderRadius) {\n    if (!YogaConstants.isUndefined(borderRadius)) {\n      borderRadius = PixelUtil.toPixelFromDIP(borderRadius);\n    }\n\n    if (index == 0) {\n      view.setBorderRadius(borderRadius);\n    } else {\n      view.setBorderRadius(borderRadius, index - 1);\n    }\n  }\n\n  @ReactProp(name = \"borderStyle\")\n  public void setBorderStyle(ReactEditText view, @Nullable String borderStyle) {\n    view.setBorderStyle(borderStyle);\n  }\n\n  @ReactPropGroup(names = {\n      ViewProps.BORDER_WIDTH,\n      ViewProps.BORDER_LEFT_WIDTH,\n      ViewProps.BORDER_RIGHT_WIDTH,\n      ViewProps.BORDER_TOP_WIDTH,\n      ViewProps.BORDER_BOTTOM_WIDTH,\n  }, defaultFloat = YogaConstants.UNDEFINED)\n  public void setBorderWidth(ReactEditText view, int index, float width) {\n    if (!YogaConstants.isUndefined(width)) {\n      width = PixelUtil.toPixelFromDIP(width);\n    }\n    view.setBorderWidth(SPACING_TYPES[index], width);\n  }\n\n  @ReactPropGroup(names = {\n      \"borderColor\", \"borderLeftColor\", \"borderRightColor\", \"borderTopColor\", \"borderBottomColor\"\n  }, customType = \"Color\")\n  public void setBorderColor(ReactEditText view, int index, Integer color) {\n    float rgbComponent = color == null ? YogaConstants.UNDEFINED : (float) ((int)color & 0x00FFFFFF);\n    float alphaComponent = color == null ? YogaConstants.UNDEFINED : (float) ((int)color >>> 24);\n    view.setBorderColor(SPACING_TYPES[index], rgbComponent, alphaComponent);\n  }\n\n  @Override\n  protected void onAfterUpdateTransaction(ReactEditText view) {\n    super.onAfterUpdateTransaction(view);\n    view.commitStagedInputType();\n  }\n\n  // Sets the correct password type, since numeric and text passwords have different types\n  private static void checkPasswordType(ReactEditText view) {\n    if ((view.getStagedInputType() & INPUT_TYPE_KEYBOARD_NUMBERED) != 0 &&\n        (view.getStagedInputType() & InputType.TYPE_TEXT_VARIATION_PASSWORD) != 0) {\n      // Text input type is numbered password, remove text password variation, add numeric one\n      updateStagedInputTypeFlag(\n          view,\n          InputType.TYPE_TEXT_VARIATION_PASSWORD,\n          InputType.TYPE_NUMBER_VARIATION_PASSWORD);\n    }\n  }\n\n  /**\n   * This code was taken from the method parseNumericFontWeight of the class ReactTextShadowNode\n   * TODO: Factor into a common place they can both use\n   *\n   * Return -1 if the input string is not a valid numeric fontWeight (100, 200, ..., 900), otherwise\n   * return the weight.\n   */\n  private static int parseNumericFontWeight(String fontWeightString) {\n    // This should be much faster than using regex to verify input and Integer.parseInt\n    return fontWeightString.length() == 3 && fontWeightString.endsWith(\"00\")\n            && fontWeightString.charAt(0) <= '9' && fontWeightString.charAt(0) >= '1' ?\n            100 * (fontWeightString.charAt(0) - '0') : -1;\n  }\n\n  private static void updateStagedInputTypeFlag(\n      ReactEditText view,\n      int flagsToUnset,\n      int flagsToSet) {\n    view.setStagedInputType((view.getStagedInputType() & ~flagsToUnset) | flagsToSet);\n  }\n\n  private class ReactTextInputTextWatcher implements TextWatcher {\n\n    private EventDispatcher mEventDispatcher;\n    private ReactEditText mEditText;\n    private String mPreviousText;\n\n    public ReactTextInputTextWatcher(\n        final ReactContext reactContext,\n        final ReactEditText editText) {\n      mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n      mEditText = editText;\n      mPreviousText = null;\n    }\n\n    @Override\n    public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n      // Incoming charSequence gets mutated before onTextChanged() is invoked\n      mPreviousText = s.toString();\n    }\n\n    @Override\n    public void onTextChanged(CharSequence s, int start, int before, int count) {\n      // Rearranging the text (i.e. changing between singleline and multiline attributes) can\n      // also trigger onTextChanged, call the event in JS only when the text actually changed\n      if (count == 0 && before == 0) {\n        return;\n      }\n\n      Assertions.assertNotNull(mPreviousText);\n      String newText = s.toString().substring(start, start + count);\n      String oldText = mPreviousText.substring(start, start + before);\n      // Don't send same text changes\n      if (count == before && newText.equals(oldText)) {\n        return;\n      }\n\n      // The event that contains the event counter and updates it must be sent first.\n      // TODO: t7936714 merge these events\n      mEventDispatcher.dispatchEvent(\n          new ReactTextChangedEvent(\n              mEditText.getId(),\n              s.toString(),\n              mEditText.incrementAndGetEventCounter()));\n\n      mEventDispatcher.dispatchEvent(\n          new ReactTextInputEvent(\n              mEditText.getId(),\n              newText,\n              oldText,\n              start,\n              start + before));\n    }\n\n    @Override\n    public void afterTextChanged(Editable s) {\n    }\n  }\n\n  @Override\n  protected void addEventEmitters(\n      final ThemedReactContext reactContext,\n      final ReactEditText editText) {\n    editText.addTextChangedListener(new ReactTextInputTextWatcher(reactContext, editText));\n    editText.setOnFocusChangeListener(\n        new View.OnFocusChangeListener() {\n          public void onFocusChange(View v, boolean hasFocus) {\n            EventDispatcher eventDispatcher =\n                reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n            if (hasFocus) {\n              eventDispatcher.dispatchEvent(\n                  new ReactTextInputFocusEvent(\n                      editText.getId()));\n            } else {\n              eventDispatcher.dispatchEvent(\n                  new ReactTextInputBlurEvent(\n                      editText.getId()));\n\n              eventDispatcher.dispatchEvent(\n                  new ReactTextInputEndEditingEvent(\n                      editText.getId(),\n                      editText.getText().toString()));\n            }\n          }\n        });\n\n    editText.setOnEditorActionListener(\n        new TextView.OnEditorActionListener() {\n          @Override\n          public boolean onEditorAction(TextView v, int actionId, KeyEvent keyEvent) {\n            // Any 'Enter' action will do\n            if ((actionId & EditorInfo.IME_MASK_ACTION) > 0 ||\n                actionId == EditorInfo.IME_NULL) {\n              boolean blurOnSubmit = editText.getBlurOnSubmit();\n              boolean isMultiline = ((editText.getInputType() &\n                InputType.TYPE_TEXT_FLAG_MULTI_LINE) != 0);\n\n              // Motivation:\n              // * blurOnSubmit && isMultiline => Clear focus; prevent default behaviour (return true);\n              // * blurOnSubmit && !isMultiline => Clear focus; prevent default behaviour (return true);\n              // * !blurOnSubmit && isMultiline => Perform default behaviour (return false);\n              // * !blurOnSubmit && !isMultiline => Prevent default behaviour (return true).\n              // Additionally we always generate a `submit` event.\n\n              EventDispatcher eventDispatcher =\n                  reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n\n              eventDispatcher.dispatchEvent(\n                  new ReactTextInputSubmitEditingEvent(\n                      editText.getId(),\n                      editText.getText().toString()));\n\n              if (blurOnSubmit) {\n                editText.clearFocus();\n              }\n\n              // Prevent default behavior except when we want it to insert a newline.\n              return blurOnSubmit || !isMultiline;\n            }\n\n            return true;\n          }\n        });\n  }\n\n  private class ReactContentSizeWatcher implements ContentSizeWatcher {\n    private ReactEditText mEditText;\n    private EventDispatcher mEventDispatcher;\n    private int mPreviousContentWidth = 0;\n    private int mPreviousContentHeight = 0;\n\n    public ReactContentSizeWatcher(ReactEditText editText) {\n      mEditText = editText;\n      ReactContext reactContext = (ReactContext) editText.getContext();\n      mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n    }\n\n    @Override\n    public void onLayout() {\n      int contentWidth = mEditText.getWidth();\n      int contentHeight = mEditText.getHeight();\n\n      // Use instead size of text content within EditText when available\n      if (mEditText.getLayout() != null) {\n        contentWidth = mEditText.getCompoundPaddingLeft() + mEditText.getLayout().getWidth() +\n          mEditText.getCompoundPaddingRight();\n        contentHeight = mEditText.getCompoundPaddingTop() + mEditText.getLayout().getHeight() +\n          mEditText.getCompoundPaddingBottom();\n      }\n\n      if (contentWidth != mPreviousContentWidth || contentHeight != mPreviousContentHeight) {\n        mPreviousContentHeight = contentHeight;\n        mPreviousContentWidth = contentWidth;\n\n        mEventDispatcher.dispatchEvent(\n          new ReactContentSizeChangedEvent(\n            mEditText.getId(),\n            PixelUtil.toDIPFromPixel(contentWidth),\n            PixelUtil.toDIPFromPixel(contentHeight)));\n      }\n    }\n  }\n\n  private class ReactSelectionWatcher implements SelectionWatcher {\n\n    private ReactEditText mReactEditText;\n    private EventDispatcher mEventDispatcher;\n    private int mPreviousSelectionStart;\n    private int mPreviousSelectionEnd;\n\n    public ReactSelectionWatcher(ReactEditText editText) {\n      mReactEditText = editText;\n      ReactContext reactContext = (ReactContext) editText.getContext();\n      mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n    }\n\n    @Override\n    public void onSelectionChanged(int start, int end) {\n      // Android will call us back for both the SELECTION_START span and SELECTION_END span in text\n      // To prevent double calling back into js we cache the result of the previous call and only\n      // forward it on if we have new values\n      if (mPreviousSelectionStart != start || mPreviousSelectionEnd != end) {\n        mEventDispatcher.dispatchEvent(\n            new ReactTextInputSelectionEvent(\n                mReactEditText.getId(),\n                start,\n                end\n            ));\n\n        mPreviousSelectionStart = start;\n        mPreviousSelectionEnd = end;\n      }\n    }\n  }\n\n  private class ReactScrollWatcher implements ScrollWatcher {\n\n    private ReactEditText mReactEditText;\n    private EventDispatcher mEventDispatcher;\n    private int mPreviousHoriz;\n    private int mPreviousVert;\n\n    public ReactScrollWatcher(ReactEditText editText) {\n      mReactEditText = editText;\n      ReactContext reactContext = (ReactContext) editText.getContext();\n      mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n    }\n\n    @Override\n    public void onScrollChanged(int horiz, int vert, int oldHoriz, int oldVert) {\n      if (mPreviousHoriz != horiz || mPreviousVert != vert) {\n        ScrollEvent event = ScrollEvent.obtain(\n          mReactEditText.getId(),\n          ScrollEventType.SCROLL,\n          horiz,\n          vert,\n          0f, // can't get x velocity\n          0f, // can't get y velocity\n          0, // can't get content width\n          0, // can't get content height\n          mReactEditText.getWidth(),\n          mReactEditText.getHeight());\n\n        mEventDispatcher.dispatchEvent(event);\n\n        mPreviousHoriz = horiz;\n        mPreviousVert = vert;\n      }\n    }\n  }\n\n  @Override\n  public @Nullable Map getExportedViewConstants() {\n    return MapBuilder.of(\n        \"AutoCapitalizationType\",\n        MapBuilder.of(\n            \"none\",\n            0,\n            \"characters\",\n            InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS,\n            \"words\",\n            InputType.TYPE_TEXT_FLAG_CAP_WORDS,\n            \"sentences\",\n            InputType.TYPE_TEXT_FLAG_CAP_SENTENCES));\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputSelectionEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by EditText native view when the text selection changes.\n */\n/* package */ class ReactTextInputSelectionEvent\n    extends Event<ReactTextInputSelectionEvent> {\n\n  private static final String EVENT_NAME = \"topSelectionChange\";\n\n  private int mSelectionStart;\n  private int mSelectionEnd;\n\n  public ReactTextInputSelectionEvent(\n      int viewId,\n      int selectionStart,\n      int selectionEnd) {\n    super(viewId);\n    mSelectionStart = selectionStart;\n    mSelectionEnd = selectionEnd;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n\n    WritableMap selectionData = Arguments.createMap();\n    selectionData.putInt(\"end\", mSelectionEnd);\n    selectionData.putInt(\"start\", mSelectionStart);\n\n    eventData.putMap(\"selection\", selectionData);\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport android.os.Build;\nimport android.text.Layout;\nimport android.view.ViewGroup;\nimport android.widget.EditText;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIViewOperationQueue;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.views.text.ReactBaseTextShadowNode;\nimport com.facebook.react.views.text.ReactTextUpdate;\nimport com.facebook.react.views.view.MeasureUtil;\nimport com.facebook.yoga.YogaMeasureFunction;\nimport com.facebook.yoga.YogaMeasureMode;\nimport com.facebook.yoga.YogaMeasureOutput;\nimport com.facebook.yoga.YogaNode;\nimport javax.annotation.Nullable;\n\n@VisibleForTesting\npublic class ReactTextInputShadowNode extends ReactBaseTextShadowNode\n    implements YogaMeasureFunction {\n\n  private int mMostRecentEventCount = UNSET;\n  private @Nullable EditText mDummyEditText;\n  private @Nullable ReactTextInputLocalData mLocalData;\n\n  @VisibleForTesting public static final String PROP_TEXT = \"text\";\n\n  // Represents the {@code text} property only, not possible nested content.\n  private @Nullable String mText = null;\n\n  public ReactTextInputShadowNode() {\n    mTextBreakStrategy = (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) ?\n        0 : Layout.BREAK_STRATEGY_SIMPLE;\n\n    setMeasureFunction(this);\n  }\n\n  @Override\n  public void setThemedContext(ThemedReactContext themedContext) {\n    super.setThemedContext(themedContext);\n\n    // {@code EditText} has by default a border at the bottom of its view\n    // called \"underline\". To have a native look and feel of the TextEdit\n    // we have to preserve it at least by default.\n    // The border (underline) has its padding set by the background image\n    // provided by the system (which vary a lot among versions and vendors\n    // of Android), and it cannot be changed.\n    // So, we have to enforce it as a default padding.\n    // TODO #7120264: Cache this stuff better.\n    EditText editText = new EditText(getThemedContext());\n    setDefaultPadding(Spacing.START, editText.getPaddingStart());\n    setDefaultPadding(Spacing.TOP, editText.getPaddingTop());\n    setDefaultPadding(Spacing.END, editText.getPaddingEnd());\n    setDefaultPadding(Spacing.BOTTOM, editText.getPaddingBottom());\n\n    mDummyEditText = editText;\n\n    // We must measure the EditText without paddings, so we have to reset them.\n    mDummyEditText.setPadding(0, 0, 0, 0);\n\n    // This is needed to fix an android bug since 4.4.3 which will throw an NPE in measure,\n    // setting the layoutParams fixes it: https://code.google.com/p/android/issues/detail?id=75877\n    mDummyEditText.setLayoutParams(\n        new ViewGroup.LayoutParams(\n            ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));\n  }\n\n  @Override\n  public long measure(\n      YogaNode node,\n      float width,\n      YogaMeasureMode widthMode,\n      float height,\n      YogaMeasureMode heightMode) {\n    // measure() should never be called before setThemedContext()\n    EditText editText = Assertions.assertNotNull(mDummyEditText);\n\n    if (mLocalData == null) {\n      // No local data, no intrinsic size.\n      return YogaMeasureOutput.make(0, 0);\n    }\n\n    mLocalData.apply(editText);\n\n    editText.measure(\n        MeasureUtil.getMeasureSpec(width, widthMode),\n        MeasureUtil.getMeasureSpec(height, heightMode));\n\n    return YogaMeasureOutput.make(editText.getMeasuredWidth(), editText.getMeasuredHeight());\n  }\n\n  @Override\n  public boolean isVirtualAnchor() {\n    return true;\n  }\n\n  @Override\n  public boolean isYogaLeafNode() {\n    return true;\n  }\n\n  @Override\n  public void setLocalData(Object data) {\n    Assertions.assertCondition(data instanceof ReactTextInputLocalData);\n    mLocalData = (ReactTextInputLocalData) data;\n\n    // Telling to Yoga that the node should be remeasured on next layout pass.\n    dirty();\n\n    // Note: We should NOT mark the node updated (by calling {@code markUpdated}) here\n    // because the state remains the same.\n  }\n\n  @ReactProp(name = \"mostRecentEventCount\")\n  public void setMostRecentEventCount(int mostRecentEventCount) {\n    mMostRecentEventCount = mostRecentEventCount;\n  }\n\n  @ReactProp(name = PROP_TEXT)\n  public void setText(@Nullable String text) {\n    mText = text;\n    markUpdated();\n  }\n\n  public @Nullable String getText() {\n    return mText;\n  }\n\n  @Override\n  public void setTextBreakStrategy(@Nullable String textBreakStrategy) {\n    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n      return;\n    }\n\n    if (textBreakStrategy == null || \"simple\".equals(textBreakStrategy)) {\n      mTextBreakStrategy = Layout.BREAK_STRATEGY_SIMPLE;\n    } else if (\"highQuality\".equals(textBreakStrategy)) {\n      mTextBreakStrategy = Layout.BREAK_STRATEGY_HIGH_QUALITY;\n    } else if (\"balanced\".equals(textBreakStrategy)) {\n      mTextBreakStrategy = Layout.BREAK_STRATEGY_BALANCED;\n    } else {\n      throw new JSApplicationIllegalArgumentException(\"Invalid textBreakStrategy: \" + textBreakStrategy);\n    }\n  }\n\n  @Override\n  public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {\n    super.onCollectExtraUpdates(uiViewOperationQueue);\n\n    if (mMostRecentEventCount != UNSET) {\n      ReactTextUpdate reactTextUpdate =\n          new ReactTextUpdate(\n              spannedFromShadowNode(this, getText()),\n              mMostRecentEventCount,\n              mContainsImages,\n              getPadding(Spacing.LEFT),\n              getPadding(Spacing.TOP),\n              getPadding(Spacing.RIGHT),\n              getPadding(Spacing.BOTTOM),\n              mTextAlign,\n              mTextBreakStrategy);\n      uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), reactTextUpdate);\n    }\n  }\n\n  @Override\n  public void setPadding(int spacingType, float padding) {\n    super.setPadding(spacingType, padding);\n    markUpdated();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputSubmitEditingEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by EditText native view when the user submits the text.\n */\n/* package */ class ReactTextInputSubmitEditingEvent\n    extends Event<ReactTextInputSubmitEditingEvent> {\n\n  private static final String EVENT_NAME = \"topSubmitEditing\";\n\n  private String mText;\n\n  public ReactTextInputSubmitEditingEvent(\n      int viewId,\n      String text) {\n    super(viewId);\n    mText = text;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    return false;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putInt(\"target\", getViewTag());\n    eventData.putString(\"text\", mText);\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/textinput/ScrollWatcher.java",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\npublic interface ScrollWatcher {\n  public void onScrollChanged(int horiz, int vert, int oldHoriz, int oldVert);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/toolbar/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"toolbar\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n        react_native_dep(\"third-party/android/support/v7/appcompat-orig:appcompat\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"libraries/fresco/fresco-react-native:fbcore\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-drawee\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-react-native\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:imagepipeline\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/toolbar/ReactToolbar.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.toolbar;\n\nimport android.content.Context;\nimport android.graphics.drawable.Animatable;\nimport android.graphics.drawable.Drawable;\nimport android.net.Uri;\nimport android.support.v7.widget.Toolbar;\nimport android.view.Menu;\nimport android.view.MenuItem;\n\nimport com.facebook.drawee.backends.pipeline.Fresco;\nimport com.facebook.drawee.controller.BaseControllerListener;\nimport com.facebook.drawee.drawable.ScalingUtils;\nimport com.facebook.drawee.generic.GenericDraweeHierarchy;\nimport com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;\nimport com.facebook.drawee.interfaces.DraweeController;\nimport com.facebook.drawee.view.DraweeHolder;\nimport com.facebook.drawee.view.MultiDraweeHolder;\nimport com.facebook.imagepipeline.image.ImageInfo;\nimport com.facebook.imagepipeline.image.QualityInfo;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.uimanager.PixelUtil;\n\nimport javax.annotation.Nullable;\n\n/**\n * Custom implementation of the {@link Toolbar} widget that adds support for remote images in logo\n * and navigationIcon using fresco.\n */\npublic class ReactToolbar extends Toolbar {\n\n  private static final String PROP_ACTION_ICON = \"icon\";\n  private static final String PROP_ACTION_SHOW = \"show\";\n  private static final String PROP_ACTION_SHOW_WITH_TEXT = \"showWithText\";\n  private static final String PROP_ACTION_TITLE = \"title\";\n\n  private static final String PROP_ICON_URI = \"uri\";\n  private static final String PROP_ICON_WIDTH = \"width\";\n  private static final String PROP_ICON_HEIGHT = \"height\";\n\n  private final DraweeHolder mLogoHolder;\n  private final DraweeHolder mNavIconHolder;\n  private final DraweeHolder mOverflowIconHolder;\n  private final MultiDraweeHolder<GenericDraweeHierarchy> mActionsHolder =\n          new MultiDraweeHolder<>();\n\n  private IconControllerListener mLogoControllerListener;\n  private IconControllerListener mNavIconControllerListener;\n  private IconControllerListener mOverflowIconControllerListener;\n\n  /**\n   * Attaches specific icon width & height to a BaseControllerListener which will be used to\n   * create the Drawable\n   */\n  private abstract class IconControllerListener extends BaseControllerListener<ImageInfo> {\n\n    private final DraweeHolder mHolder;\n\n    private IconImageInfo mIconImageInfo;\n\n    public IconControllerListener(DraweeHolder holder) {\n      mHolder = holder;\n    }\n\n    public void setIconImageInfo(IconImageInfo iconImageInfo) {\n      mIconImageInfo = iconImageInfo;\n    }\n\n    @Override\n    public void onFinalImageSet(String id, @Nullable ImageInfo imageInfo, @Nullable Animatable animatable) {\n      super.onFinalImageSet(id, imageInfo, animatable);\n\n      final ImageInfo info = mIconImageInfo != null ? mIconImageInfo : imageInfo;\n      setDrawable(new DrawableWithIntrinsicSize(mHolder.getTopLevelDrawable(), info));\n    }\n\n    protected abstract void setDrawable(Drawable d);\n\n  }\n\n  private class ActionIconControllerListener extends IconControllerListener {\n    private final MenuItem mItem;\n\n    ActionIconControllerListener(MenuItem item, DraweeHolder holder) {\n      super(holder);\n      mItem = item;\n    }\n\n    @Override\n    protected void setDrawable(Drawable d) {\n      mItem.setIcon(d);\n      ReactToolbar.this.requestLayout();\n    }\n  }\n\n  /**\n   * Simple implementation of ImageInfo, only providing width & height\n   */\n  private static class IconImageInfo implements ImageInfo {\n\n    private int mWidth;\n    private int mHeight;\n\n    public IconImageInfo(int width, int height) {\n      mWidth = width;\n      mHeight = height;\n    }\n\n    @Override\n    public int getWidth() {\n      return mWidth;\n    }\n\n    @Override\n    public int getHeight() {\n      return mHeight;\n    }\n\n    @Override\n    public QualityInfo getQualityInfo() {\n      return null;\n    }\n\n  }\n\n  public ReactToolbar(Context context) {\n    super(context);\n\n    mLogoHolder = DraweeHolder.create(createDraweeHierarchy(), context);\n    mNavIconHolder = DraweeHolder.create(createDraweeHierarchy(), context);\n    mOverflowIconHolder = DraweeHolder.create(createDraweeHierarchy(), context);\n\n    mLogoControllerListener = new IconControllerListener(mLogoHolder) {\n      @Override\n      protected void setDrawable(Drawable d) {\n        setLogo(d);\n      }\n    };\n\n    mNavIconControllerListener = new IconControllerListener(mNavIconHolder) {\n      @Override\n      protected void setDrawable(Drawable d) {\n        setNavigationIcon(d);\n      }\n    };\n\n    mOverflowIconControllerListener = new IconControllerListener(mOverflowIconHolder) {\n      @Override\n      protected void setDrawable(Drawable d) {\n        setOverflowIcon(d);\n      }\n    };\n\n  }\n\n  private final Runnable mLayoutRunnable = new Runnable() {\n    @Override\n    public void run() {\n      measure(\n          MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.EXACTLY),\n          MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.EXACTLY));\n      layout(getLeft(), getTop(), getRight(), getBottom());\n    }\n  };\n\n  @Override\n  public void requestLayout() {\n    super.requestLayout();\n\n    // The toolbar relies on a measure + layout pass happening after it calls requestLayout().\n    // Without this, certain calls (e.g. setLogo) only take effect after a second invalidation.\n    post(mLayoutRunnable);\n  }\n\n  @Override\n  public void onDetachedFromWindow() {\n    super.onDetachedFromWindow();\n    detachDraweeHolders();\n  }\n\n  @Override\n  public void onStartTemporaryDetach() {\n    super.onStartTemporaryDetach();\n    detachDraweeHolders();\n  }\n\n  @Override\n  public void onAttachedToWindow() {\n    super.onAttachedToWindow();\n    attachDraweeHolders();\n  }\n\n  @Override\n  public void onFinishTemporaryDetach() {\n    super.onFinishTemporaryDetach();\n    attachDraweeHolders();\n  }\n\n  private void detachDraweeHolders() {\n    mLogoHolder.onDetach();\n    mNavIconHolder.onDetach();\n    mOverflowIconHolder.onDetach();\n    mActionsHolder.onDetach();\n  }\n\n  private void attachDraweeHolders() {\n    mLogoHolder.onAttach();\n    mNavIconHolder.onAttach();\n    mOverflowIconHolder.onAttach();\n    mActionsHolder.onAttach();\n  }\n\n  /* package */ void setLogoSource(@Nullable ReadableMap source) {\n    setIconSource(source, mLogoControllerListener, mLogoHolder);\n  }\n\n  /* package */ void setNavIconSource(@Nullable ReadableMap source) {\n    setIconSource(source, mNavIconControllerListener, mNavIconHolder);\n  }\n\n  /* package */ void setOverflowIconSource(@Nullable ReadableMap source) {\n    setIconSource(source, mOverflowIconControllerListener, mOverflowIconHolder);\n  }\n\n  /* package */ void setActions(@Nullable ReadableArray actions) {\n    Menu menu = getMenu();\n    menu.clear();\n    mActionsHolder.clear();\n    if (actions != null) {\n      for (int i = 0; i < actions.size(); i++) {\n        ReadableMap action = actions.getMap(i);\n\n        MenuItem item = menu.add(Menu.NONE, Menu.NONE, i, action.getString(PROP_ACTION_TITLE));\n\n        if (action.hasKey(PROP_ACTION_ICON)) {\n          setMenuItemIcon(item, action.getMap(PROP_ACTION_ICON));\n        }\n\n        int showAsAction = action.hasKey(PROP_ACTION_SHOW)\n            ? action.getInt(PROP_ACTION_SHOW)\n            : MenuItem.SHOW_AS_ACTION_NEVER;\n        if (action.hasKey(PROP_ACTION_SHOW_WITH_TEXT) &&\n            action.getBoolean(PROP_ACTION_SHOW_WITH_TEXT)) {\n          showAsAction = showAsAction | MenuItem.SHOW_AS_ACTION_WITH_TEXT;\n        }\n        item.setShowAsAction(showAsAction);\n      }\n    }\n  }\n\n  private void setMenuItemIcon(final MenuItem item, ReadableMap iconSource) {\n\n    DraweeHolder<GenericDraweeHierarchy> holder =\n            DraweeHolder.create(createDraweeHierarchy(), getContext());\n    ActionIconControllerListener controllerListener = new ActionIconControllerListener(item, holder);\n    controllerListener.setIconImageInfo(getIconImageInfo(iconSource));\n\n    setIconSource(iconSource, controllerListener, holder);\n\n    mActionsHolder.add(holder);\n\n  }\n\n  /**\n   * Sets an icon for a specific icon source. If the uri indicates an icon\n   * to be somewhere remote (http/https) or on the local filesystem, it uses fresco to load it.\n   * Otherwise it loads the Drawable from the Resources and directly returns it via a callback\n   */\n  private void setIconSource(ReadableMap source, IconControllerListener controllerListener, DraweeHolder holder) {\n\n    String uri = source != null ? source.getString(PROP_ICON_URI) : null;\n\n    if (uri == null) {\n      controllerListener.setIconImageInfo(null);\n      controllerListener.setDrawable(null);\n    } else if (uri.startsWith(\"http://\") || uri.startsWith(\"https://\") || uri.startsWith(\"file://\")) {\n      controllerListener.setIconImageInfo(getIconImageInfo(source));\n      DraweeController controller = Fresco.newDraweeControllerBuilder()\n              .setUri(Uri.parse(uri))\n              .setControllerListener(controllerListener)\n              .setOldController(holder.getController())\n              .build();\n      holder.setController(controller);\n      holder.getTopLevelDrawable().setVisible(true, true);\n    } else {\n      controllerListener.setDrawable(getDrawableByName(uri));\n    }\n\n  }\n\n  private GenericDraweeHierarchy createDraweeHierarchy() {\n    return new GenericDraweeHierarchyBuilder(getResources())\n        .setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER)\n        .setFadeDuration(0)\n        .build();\n  }\n\n  private int getDrawableResourceByName(String name) {\n    return getResources().getIdentifier(\n        name,\n        \"drawable\",\n        getContext().getPackageName());\n  }\n\n  private Drawable getDrawableByName(String name) {\n    int drawableResId = getDrawableResourceByName(name);\n    if (drawableResId != 0) {\n      return getResources().getDrawable(getDrawableResourceByName(name));\n    } else {\n      return null;\n    }\n  }\n\n  private IconImageInfo getIconImageInfo(ReadableMap source) {\n    if (source.hasKey(PROP_ICON_WIDTH) && source.hasKey(PROP_ICON_HEIGHT)) {\n      final int width = Math.round(PixelUtil.toPixelFromDIP(source.getInt(PROP_ICON_WIDTH)));\n      final int height = Math.round(PixelUtil.toPixelFromDIP(source.getInt(PROP_ICON_HEIGHT)));\n      return new IconImageInfo(width, height);\n    } else {\n      return null;\n    }\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/toolbar/ReactToolbarManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.toolbar;\n\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.content.res.TypedArray;\nimport android.graphics.Color;\nimport android.util.LayoutDirection;\nimport android.view.MenuItem;\nimport android.view.View;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewGroupManager;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.views.toolbar.events.ToolbarClickEvent;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * Manages instances of ReactToolbar.\n */\npublic class ReactToolbarManager extends ViewGroupManager<ReactToolbar> {\n\n  private static final String REACT_CLASS = \"ToolbarAndroid\";\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  protected ReactToolbar createViewInstance(ThemedReactContext reactContext) {\n    return new ReactToolbar(reactContext);\n  }\n\n  @ReactProp(name = \"logo\")\n  public void setLogo(ReactToolbar view, @Nullable ReadableMap logo) {\n    view.setLogoSource(logo);\n  }\n\n  @ReactProp(name = \"navIcon\")\n  public void setNavIcon(ReactToolbar view, @Nullable ReadableMap navIcon) {\n    view.setNavIconSource(navIcon);\n  }\n\n  @ReactProp(name = \"overflowIcon\")\n  public void setOverflowIcon(ReactToolbar view, @Nullable ReadableMap overflowIcon) {\n    view.setOverflowIconSource(overflowIcon);\n  }\n\n  @ReactProp(name = \"rtl\")\n  public void setRtl(ReactToolbar view, boolean rtl) {\n    view.setLayoutDirection(rtl ? LayoutDirection.RTL : LayoutDirection.LTR);\n  }\n\n  @ReactProp(name = \"subtitle\")\n  public void setSubtitle(ReactToolbar view, @Nullable String subtitle) {\n    view.setSubtitle(subtitle);\n  }\n\n  @ReactProp(name = \"subtitleColor\", customType = \"Color\")\n  public void setSubtitleColor(ReactToolbar view, @Nullable Integer subtitleColor) {\n    int[] defaultColors = getDefaultColors(view.getContext());\n    if (subtitleColor != null) {\n      view.setSubtitleTextColor(subtitleColor);\n    } else {\n      view.setSubtitleTextColor(defaultColors[1]);\n    }\n  }\n\n  @ReactProp(name = \"title\")\n  public void setTitle(ReactToolbar view, @Nullable String title) {\n    view.setTitle(title);\n  }\n\n  @ReactProp(name = \"titleColor\", customType = \"Color\")\n  public void setTitleColor(ReactToolbar view, @Nullable Integer titleColor) {\n    int[] defaultColors = getDefaultColors(view.getContext());\n    if (titleColor != null) {\n      view.setTitleTextColor(titleColor);\n    } else {\n      view.setTitleTextColor(defaultColors[0]);\n    }\n  }\n\n  @ReactProp(name = \"contentInsetStart\", defaultFloat = Float.NaN)\n  public void setContentInsetStart(ReactToolbar view, float insetStart) {\n    int inset = Float.isNaN(insetStart) ?\n        getDefaultContentInsets(view.getContext())[0] :\n        Math.round(PixelUtil.toPixelFromDIP(insetStart));\n    view.setContentInsetsRelative(inset, view.getContentInsetEnd());\n  }\n\n  @ReactProp(name = \"contentInsetEnd\", defaultFloat = Float.NaN)\n  public void setContentInsetEnd(ReactToolbar view, float insetEnd) {\n    int inset = Float.isNaN(insetEnd) ?\n        getDefaultContentInsets(view.getContext())[1] :\n        Math.round(PixelUtil.toPixelFromDIP(insetEnd));\n    view.setContentInsetsRelative(view.getContentInsetStart(), inset);\n  }\n\n  @ReactProp(name = \"nativeActions\")\n  public void setActions(ReactToolbar view, @Nullable ReadableArray actions) {\n    view.setActions(actions);\n  }\n\n  @Override\n  protected void addEventEmitters(final ThemedReactContext reactContext, final ReactToolbar view) {\n    final EventDispatcher mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class)\n        .getEventDispatcher();\n    view.setNavigationOnClickListener(\n        new View.OnClickListener() {\n          @Override\n          public void onClick(View v) {\n            mEventDispatcher.dispatchEvent(\n                new ToolbarClickEvent(view.getId(), -1));\n          }\n        });\n\n    view.setOnMenuItemClickListener(\n        new ReactToolbar.OnMenuItemClickListener() {\n          @Override\n          public boolean onMenuItemClick(MenuItem menuItem) {\n            mEventDispatcher.dispatchEvent(\n                new ToolbarClickEvent(\n                    view.getId(),\n                    menuItem.getOrder()));\n            return true;\n          }\n        });\n  }\n\n  @Nullable\n  @Override\n  public Map<String, Object> getExportedViewConstants() {\n    return MapBuilder.<String, Object>of(\n        \"ShowAsAction\",\n        MapBuilder.of(\n            \"never\", MenuItem.SHOW_AS_ACTION_NEVER,\n            \"always\", MenuItem.SHOW_AS_ACTION_ALWAYS,\n            \"ifRoom\", MenuItem.SHOW_AS_ACTION_IF_ROOM));\n  }\n\n  @Override\n  public boolean needsCustomLayoutForChildren() {\n    return true;\n  }\n\n  private int[] getDefaultContentInsets(Context context) {\n    Resources.Theme theme = context.getTheme();\n    TypedArray toolbarStyle = null;\n    TypedArray contentInsets = null;\n\n    try {\n      toolbarStyle =\n          theme.obtainStyledAttributes(new int[] {getIdentifier(context, \"toolbarStyle\")});\n\n      int toolbarStyleResId = toolbarStyle.getResourceId(0, 0);\n\n      contentInsets =\n          theme.obtainStyledAttributes(\n              toolbarStyleResId,\n              new int[] {\n                getIdentifier(context, \"contentInsetStart\"),\n                getIdentifier(context, \"contentInsetEnd\"),\n              });\n\n      int contentInsetStart = contentInsets.getDimensionPixelSize(0, 0);\n      int contentInsetEnd = contentInsets.getDimensionPixelSize(1, 0);\n\n      return new int[] {contentInsetStart, contentInsetEnd};\n    } finally {\n      recycleQuietly(toolbarStyle);\n      recycleQuietly(contentInsets);\n    }\n\n  }\n\n  private static int[] getDefaultColors(Context context) {\n    Resources.Theme theme = context.getTheme();\n    TypedArray toolbarStyle = null;\n    TypedArray textAppearances = null;\n    TypedArray titleTextAppearance = null;\n    TypedArray subtitleTextAppearance = null;\n\n    try {\n      toolbarStyle =\n          theme.obtainStyledAttributes(new int[] {getIdentifier(context, \"toolbarStyle\")});\n\n      int toolbarStyleResId = toolbarStyle.getResourceId(0, 0);\n      textAppearances =\n          theme.obtainStyledAttributes(\n              toolbarStyleResId,\n              new int[] {\n                getIdentifier(context, \"titleTextAppearance\"),\n                getIdentifier(context, \"subtitleTextAppearance\"),\n              });\n\n      int titleTextAppearanceResId = textAppearances.getResourceId(0, 0);\n      int subtitleTextAppearanceResId = textAppearances.getResourceId(1, 0);\n\n      titleTextAppearance = theme\n          .obtainStyledAttributes(titleTextAppearanceResId, new int[]{android.R.attr.textColor});\n      subtitleTextAppearance = theme\n          .obtainStyledAttributes(subtitleTextAppearanceResId, new int[]{android.R.attr.textColor});\n\n      int titleTextColor = titleTextAppearance.getColor(0, Color.BLACK);\n      int subtitleTextColor = subtitleTextAppearance.getColor(0, Color.BLACK);\n\n      return new int[] {titleTextColor, subtitleTextColor};\n    } finally {\n      recycleQuietly(toolbarStyle);\n      recycleQuietly(textAppearances);\n      recycleQuietly(titleTextAppearance);\n      recycleQuietly(subtitleTextAppearance);\n    }\n  }\n\n  private static void recycleQuietly(@Nullable TypedArray style) {\n    if (style != null) {\n      style.recycle();\n    }\n  }\n\n  /**\n   * The appcompat-v7 BUCK dep is listed as a provided_dep, which complains that\n   * com.facebook.react.R doesn't exist. Since the attributes provided from a parent, we can access\n   * those attributes dynamically.\n   */\n  private static int getIdentifier(Context context, String name) {\n    return context.getResources().getIdentifier(name, \"attr\", context.getPackageName());\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/toolbar/events/ToolbarClickEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\npackage com.facebook.react.views.toolbar.events;\n\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.WritableNativeMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Represents a click on the toolbar.\n * Position is meaningful when the click happened on a menu\n */\npublic class ToolbarClickEvent extends Event<ToolbarClickEvent> {\n\n  private static final String EVENT_NAME = \"topSelect\";\n  private final int position;\n\n  public ToolbarClickEvent(int viewId, int position) {\n    super(viewId);\n    this.position = position;\n  }\n\n  public int getPosition() {\n    return position;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    return false;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    WritableMap event = new WritableNativeMap();\n    event.putInt(\"position\", getPosition());\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), event);\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/view/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"view\",\n    srcs = glob([\"*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/touch:touch\"),\n        react_native_target(\"java/com/facebook/react/views/common:common\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/modules/i18nmanager:i18nmanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/view/MeasureUtil.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.view;\n\nimport android.view.View;\n\nimport com.facebook.yoga.YogaMeasureMode;\n\npublic class MeasureUtil {\n\n  public static int getMeasureSpec(float size, YogaMeasureMode mode) {\n    if (mode == YogaMeasureMode.EXACTLY) {\n      return View.MeasureSpec.makeMeasureSpec((int) size, View.MeasureSpec.EXACTLY);\n    } else if (mode == YogaMeasureMode.AT_MOST) {\n      return View.MeasureSpec.makeMeasureSpec((int) size, View.MeasureSpec.AT_MOST);\n    } else {\n      return View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.view;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.ColorFilter;\nimport android.graphics.DashPathEffect;\nimport android.graphics.Outline;\nimport android.graphics.Paint;\nimport android.graphics.Path;\nimport android.graphics.PathEffect;\nimport android.graphics.PointF;\nimport android.graphics.Rect;\nimport android.graphics.RectF;\nimport android.graphics.Region;\nimport android.graphics.drawable.Drawable;\nimport android.os.Build;\nimport android.view.View;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.modules.i18nmanager.I18nUtil;\nimport com.facebook.react.uimanager.FloatUtil;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.yoga.YogaConstants;\nimport java.util.Arrays;\nimport java.util.Locale;\nimport javax.annotation.Nullable;\n\n/**\n * A subclass of {@link Drawable} used for background of {@link ReactViewGroup}. It supports drawing\n * background color and borders (including rounded borders) by providing a react friendly API\n * (setter for each of those properties).\n *\n * <p>The implementation tries to allocate as few objects as possible depending on which properties\n * are set. E.g. for views with rounded background/borders we allocate {@code\n * mInnerClipPathForBorderRadius} and {@code mInnerClipTempRectForBorderRadius}. In case when view\n * have a rectangular borders we allocate {@code mBorderWidthResult} and similar. When only\n * background color is set we won't allocate any extra/unnecessary objects.\n */\npublic class ReactViewBackgroundDrawable extends Drawable {\n\n  private static final int DEFAULT_BORDER_COLOR = Color.BLACK;\n  private static final int DEFAULT_BORDER_RGB = 0x00FFFFFF & DEFAULT_BORDER_COLOR;\n  private static final int DEFAULT_BORDER_ALPHA = (0xFF000000 & DEFAULT_BORDER_COLOR) >>> 24;\n  // ~0 == 0xFFFFFFFF, all bits set to 1.\n  private static final int ALL_BITS_SET = ~0;\n  // 0 == 0x00000000, all bits set to 0.\n  private static final int ALL_BITS_UNSET = 0;\n\n\n  private static enum BorderStyle {\n    SOLID,\n    DASHED,\n    DOTTED;\n\n    public @Nullable PathEffect getPathEffect(float borderWidth) {\n      switch (this) {\n        case SOLID:\n          return null;\n\n        case DASHED:\n          return new DashPathEffect(\n              new float[] {borderWidth*3, borderWidth*3, borderWidth*3, borderWidth*3}, 0);\n\n        case DOTTED:\n          return new DashPathEffect(\n              new float[] {borderWidth, borderWidth, borderWidth, borderWidth}, 0);\n\n        default:\n          return null;\n      }\n    }\n  };\n\n  /* Value at Spacing.ALL index used for rounded borders, whole array used by rectangular borders */\n  private @Nullable Spacing mBorderWidth;\n  private @Nullable Spacing mBorderRGB;\n  private @Nullable Spacing mBorderAlpha;\n  private @Nullable BorderStyle mBorderStyle;\n\n  /* Used for rounded border and rounded background */\n  private @Nullable PathEffect mPathEffectForBorderStyle;\n  private @Nullable Path mInnerClipPathForBorderRadius;\n  private @Nullable Path mOuterClipPathForBorderRadius;\n  private @Nullable Path mPathForBorderRadiusOutline;\n  private @Nullable Path mPathForBorder;\n  private @Nullable RectF mInnerClipTempRectForBorderRadius;\n  private @Nullable RectF mOuterClipTempRectForBorderRadius;\n  private @Nullable RectF mTempRectForBorderRadiusOutline;\n  private @Nullable PointF mInnerTopLeftCorner;\n  private @Nullable PointF mInnerTopRightCorner;\n  private @Nullable PointF mInnerBottomRightCorner;\n  private @Nullable PointF mInnerBottomLeftCorner;\n  private boolean mNeedUpdatePathForBorderRadius = false;\n  private float mBorderRadius = YogaConstants.UNDEFINED;\n\n  /* Used by all types of background and for drawing borders */\n  private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n  private int mColor = Color.TRANSPARENT;\n  private int mAlpha = 255;\n\n  private @Nullable float[] mBorderCornerRadii;\n  private final Context mContext;\n  private int mLayoutDirection;\n\n  public enum BorderRadiusLocation {\n    TOP_LEFT,\n    TOP_RIGHT,\n    BOTTOM_RIGHT,\n    BOTTOM_LEFT,\n    TOP_START,\n    TOP_END,\n    BOTTOM_START,\n    BOTTOM_END\n  }\n\n  public ReactViewBackgroundDrawable(Context context) {\n    mContext = context;\n  }\n\n  @Override\n  public void draw(Canvas canvas) {\n    updatePathEffect();\n    if (!hasRoundedBorders()) {\n      drawRectangularBackgroundWithBorders(canvas);\n    } else {\n      drawRoundedBackgroundWithBorders(canvas);\n    }\n  }\n\n  public boolean hasRoundedBorders() {\n    if (!YogaConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) {\n      return true;\n    }\n\n    if (mBorderCornerRadii != null) {\n      for (final float borderRadii : mBorderCornerRadii) {\n        if (!YogaConstants.isUndefined(borderRadii) && borderRadii > 0) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n\n  @Override\n  protected void onBoundsChange(Rect bounds) {\n    super.onBoundsChange(bounds);\n    mNeedUpdatePathForBorderRadius = true;\n  }\n\n  @Override\n  public void setAlpha(int alpha) {\n    if (alpha != mAlpha) {\n      mAlpha = alpha;\n      invalidateSelf();\n    }\n  }\n\n  @Override\n  public int getAlpha() {\n    return mAlpha;\n  }\n\n  @Override\n  public void setColorFilter(ColorFilter cf) {\n    // do nothing\n  }\n\n  @Override\n  public int getOpacity() {\n    return ColorUtil.getOpacityFromColor(ColorUtil.multiplyColorAlpha(mColor, mAlpha));\n  }\n\n  /* Android's elevation implementation requires this to be implemented to know where to draw the shadow. */\n  @Override\n  public void getOutline(Outline outline) {\n    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {\n      super.getOutline(outline);\n      return;\n    }\n    if ((!YogaConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {\n      updatePath();\n\n      outline.setConvexPath(mPathForBorderRadiusOutline);\n    } else {\n      outline.setRect(getBounds());\n    }\n  }\n\n  public void setBorderWidth(int position, float width) {\n    if (mBorderWidth == null) {\n      mBorderWidth = new Spacing();\n    }\n    if (!FloatUtil.floatsEqual(mBorderWidth.getRaw(position), width)) {\n      mBorderWidth.set(position, width);\n      switch (position) {\n        case Spacing.ALL:\n        case Spacing.LEFT:\n        case Spacing.BOTTOM:\n        case Spacing.RIGHT:\n        case Spacing.TOP:\n        case Spacing.START:\n        case Spacing.END:\n          mNeedUpdatePathForBorderRadius = true;\n      }\n      invalidateSelf();\n    }\n  }\n\n  public void setBorderColor(int position, float rgb, float alpha) {\n    this.setBorderRGB(position, rgb);\n    this.setBorderAlpha(position, alpha);\n  }\n\n  private void setBorderRGB(int position, float rgb) {\n    // set RGB component\n    if (mBorderRGB == null) {\n      mBorderRGB = new Spacing(DEFAULT_BORDER_RGB);\n    }\n    if (!FloatUtil.floatsEqual(mBorderRGB.getRaw(position), rgb)) {\n      mBorderRGB.set(position, rgb);\n      invalidateSelf();\n    }\n  }\n\n  private void setBorderAlpha(int position, float alpha) {\n    // set Alpha component\n    if (mBorderAlpha == null) {\n      mBorderAlpha = new Spacing(DEFAULT_BORDER_ALPHA);\n    }\n    if (!FloatUtil.floatsEqual(mBorderAlpha.getRaw(position), alpha)) {\n      mBorderAlpha.set(position, alpha);\n      invalidateSelf();\n    }\n  }\n\n  public void setBorderStyle(@Nullable String style) {\n    BorderStyle borderStyle = style == null\n        ? null\n        : BorderStyle.valueOf(style.toUpperCase(Locale.US));\n    if (mBorderStyle != borderStyle) {\n      mBorderStyle = borderStyle;\n      mNeedUpdatePathForBorderRadius = true;\n      invalidateSelf();\n    }\n  }\n\n  public void setRadius(float radius) {\n    if (!FloatUtil.floatsEqual(mBorderRadius,radius)) {\n      mBorderRadius = radius;\n      mNeedUpdatePathForBorderRadius = true;\n      invalidateSelf();\n    }\n  }\n\n  public void setRadius(float radius, int position) {\n    if (mBorderCornerRadii == null) {\n      mBorderCornerRadii = new float[8];\n      Arrays.fill(mBorderCornerRadii, YogaConstants.UNDEFINED);\n    }\n\n    if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], radius)) {\n      mBorderCornerRadii[position] = radius;\n      mNeedUpdatePathForBorderRadius = true;\n      invalidateSelf();\n    }\n  }\n\n  public float getFullBorderRadius() {\n    return YogaConstants.isUndefined(mBorderRadius) ? 0 : mBorderRadius;\n  }\n\n  public float getBorderRadius(final BorderRadiusLocation location) {\n    return getBorderRadiusOrDefaultTo(YogaConstants.UNDEFINED, location);\n  }\n\n  public float getBorderRadiusOrDefaultTo(\n      final float defaultValue, final BorderRadiusLocation location) {\n    if (mBorderCornerRadii == null) {\n      return defaultValue;\n    }\n\n    final float radius = mBorderCornerRadii[location.ordinal()];\n\n    if (YogaConstants.isUndefined(radius)) {\n      return defaultValue;\n    }\n\n    return radius;\n  }\n\n  public void setColor(int color) {\n    mColor = color;\n    invalidateSelf();\n  }\n\n  /** Similar to Drawable.getLayoutDirection, but available in APIs < 23. */\n  public int getResolvedLayoutDirection() {\n    return mLayoutDirection;\n  }\n\n  /** Similar to Drawable.setLayoutDirection, but available in APIs < 23. */\n  public boolean setResolvedLayoutDirection(int layoutDirection) {\n    if (mLayoutDirection != layoutDirection) {\n      mLayoutDirection = layoutDirection;\n      return onResolvedLayoutDirectionChanged(layoutDirection);\n    }\n    return false;\n  }\n\n  /** Similar to Drawable.onLayoutDirectionChanged, but available in APIs < 23. */\n  public boolean onResolvedLayoutDirectionChanged(int layoutDirection) {\n    return false;\n  }\n\n  @VisibleForTesting\n  public int getColor() {\n    return mColor;\n  }\n\n  private void drawRoundedBackgroundWithBorders(Canvas canvas) {\n    updatePath();\n    canvas.save();\n\n    int useColor = ColorUtil.multiplyColorAlpha(mColor, mAlpha);\n    if (Color.alpha(useColor) != 0) { // color is not transparent\n      mPaint.setColor(useColor);\n      mPaint.setStyle(Paint.Style.FILL);\n      canvas.drawPath(mInnerClipPathForBorderRadius, mPaint);\n    }\n\n    final RectF borderWidth = getDirectionAwareBorderInsets();\n\n    if (borderWidth.top > 0\n        || borderWidth.bottom > 0\n        || borderWidth.left > 0\n        || borderWidth.right > 0) {\n      mPaint.setStyle(Paint.Style.FILL);\n\n      // Draw border\n      canvas.clipPath(mOuterClipPathForBorderRadius, Region.Op.INTERSECT);\n      canvas.clipPath(mInnerClipPathForBorderRadius, Region.Op.DIFFERENCE);\n\n      int colorLeft = getBorderColor(Spacing.LEFT);\n      int colorTop = getBorderColor(Spacing.TOP);\n      int colorRight = getBorderColor(Spacing.RIGHT);\n      int colorBottom = getBorderColor(Spacing.BOTTOM);\n\n      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {\n        final boolean isRTL = getResolvedLayoutDirection() == View.LAYOUT_DIRECTION_RTL;\n        int colorStart = getBorderColor(Spacing.START);\n        int colorEnd = getBorderColor(Spacing.END);\n\n        if (I18nUtil.getInstance().doLeftAndRightSwapInRTL(mContext)) {\n          if (!isBorderColorDefined(Spacing.START)) {\n            colorStart = colorLeft;\n          }\n\n          if (!isBorderColorDefined(Spacing.END)) {\n            colorEnd = colorRight;\n          }\n\n          final int directionAwareColorLeft = isRTL ? colorEnd : colorStart;\n          final int directionAwareColorRight = isRTL ? colorStart : colorEnd;\n\n          colorLeft = directionAwareColorLeft;\n          colorRight = directionAwareColorRight;\n        } else {\n          final int directionAwareColorLeft = isRTL ? colorEnd : colorStart;\n          final int directionAwareColorRight = isRTL ? colorStart : colorEnd;\n\n          final boolean isColorStartDefined = isBorderColorDefined(Spacing.START);\n          final boolean isColorEndDefined = isBorderColorDefined(Spacing.END);\n          final boolean isDirectionAwareColorLeftDefined = isRTL ? isColorEndDefined : isColorStartDefined;\n          final boolean isDirectionAwareColorRightDefined = isRTL ? isColorStartDefined : isColorEndDefined;\n\n          if (isDirectionAwareColorLeftDefined) {\n            colorLeft = directionAwareColorLeft;\n          }\n\n          if (isDirectionAwareColorRightDefined) {\n            colorRight = directionAwareColorRight;\n          }\n        }\n      }\n\n      final float left = mOuterClipTempRectForBorderRadius.left;\n      final float right = mOuterClipTempRectForBorderRadius.right;\n      final float top = mOuterClipTempRectForBorderRadius.top;\n      final float bottom = mOuterClipTempRectForBorderRadius.bottom;\n\n      if (borderWidth.left > 0) {\n        final float x1 = left;\n        final float y1 = top;\n        final float x2 = mInnerTopLeftCorner.x;\n        final float y2 = mInnerTopLeftCorner.y;\n        final float x3 = mInnerBottomLeftCorner.x;\n        final float y3 = mInnerBottomLeftCorner.y;\n        final float x4 = left;\n        final float y4 = bottom;\n\n        drawQuadrilateral(canvas, colorLeft, x1, y1, x2, y2, x3, y3, x4, y4);\n      }\n\n      if (borderWidth.top > 0) {\n        final float x1 = left;\n        final float y1 = top;\n        final float x2 = mInnerTopLeftCorner.x;\n        final float y2 = mInnerTopLeftCorner.y;\n        final float x3 = mInnerTopRightCorner.x;\n        final float y3 = mInnerTopRightCorner.y;\n        final float x4 = right;\n        final float y4 = top;\n\n        drawQuadrilateral(canvas, colorTop, x1, y1, x2, y2, x3, y3, x4, y4);\n      }\n\n      if (borderWidth.right > 0) {\n        final float x1 = right;\n        final float y1 = top;\n        final float x2 = mInnerTopRightCorner.x;\n        final float y2 = mInnerTopRightCorner.y;\n        final float x3 = mInnerBottomRightCorner.x;\n        final float y3 = mInnerBottomRightCorner.y;\n        final float x4 = right;\n        final float y4 = bottom;\n\n        drawQuadrilateral(canvas, colorRight, x1, y1, x2, y2, x3, y3, x4, y4);\n      }\n\n      if (borderWidth.bottom > 0) {\n        final float x1 = left;\n        final float y1 = bottom;\n        final float x2 = mInnerBottomLeftCorner.x;\n        final float y2 = mInnerBottomLeftCorner.y;\n        final float x3 = mInnerBottomRightCorner.x;\n        final float y3 = mInnerBottomRightCorner.y;\n        final float x4 = right;\n        final float y4 = bottom;\n\n        drawQuadrilateral(canvas, colorBottom, x1, y1, x2, y2, x3, y3, x4, y4);\n      }\n    }\n\n    canvas.restore();\n  }\n\n  private void updatePath() {\n    if (!mNeedUpdatePathForBorderRadius) {\n      return;\n    }\n\n    mNeedUpdatePathForBorderRadius = false;\n\n    if (mInnerClipPathForBorderRadius == null) {\n      mInnerClipPathForBorderRadius = new Path();\n    }\n\n    if (mOuterClipPathForBorderRadius == null) {\n      mOuterClipPathForBorderRadius = new Path();\n    }\n\n    if (mPathForBorderRadiusOutline == null) {\n      mPathForBorderRadiusOutline = new Path();\n    }\n\n    if (mInnerClipTempRectForBorderRadius == null) {\n      mInnerClipTempRectForBorderRadius = new RectF();\n    }\n\n    if (mOuterClipTempRectForBorderRadius == null) {\n      mOuterClipTempRectForBorderRadius = new RectF();\n    }\n\n    if (mTempRectForBorderRadiusOutline == null) {\n      mTempRectForBorderRadiusOutline = new RectF();\n    }\n\n    mInnerClipPathForBorderRadius.reset();\n    mOuterClipPathForBorderRadius.reset();\n    mPathForBorderRadiusOutline.reset();\n\n    mInnerClipTempRectForBorderRadius.set(getBounds());\n    mOuterClipTempRectForBorderRadius.set(getBounds());\n    mTempRectForBorderRadiusOutline.set(getBounds());\n\n    final RectF borderWidth = getDirectionAwareBorderInsets();\n\n    mInnerClipTempRectForBorderRadius.top += borderWidth.top;\n    mInnerClipTempRectForBorderRadius.bottom -= borderWidth.bottom;\n    mInnerClipTempRectForBorderRadius.left += borderWidth.left;\n    mInnerClipTempRectForBorderRadius.right -= borderWidth.right;\n\n    final float borderRadius = getFullBorderRadius();\n    float topLeftRadius =\n        getBorderRadiusOrDefaultTo(borderRadius, BorderRadiusLocation.TOP_LEFT);\n    float topRightRadius =\n        getBorderRadiusOrDefaultTo(borderRadius, BorderRadiusLocation.TOP_RIGHT);\n    float bottomLeftRadius =\n        getBorderRadiusOrDefaultTo(borderRadius, BorderRadiusLocation.BOTTOM_LEFT);\n    float bottomRightRadius =\n        getBorderRadiusOrDefaultTo(borderRadius, BorderRadiusLocation.BOTTOM_RIGHT);\n\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {\n      final boolean isRTL = getResolvedLayoutDirection() == View.LAYOUT_DIRECTION_RTL;\n      float topStartRadius = getBorderRadius(BorderRadiusLocation.TOP_START);\n      float topEndRadius = getBorderRadius(BorderRadiusLocation.TOP_END);\n      float bottomStartRadius = getBorderRadius(BorderRadiusLocation.BOTTOM_START);\n      float bottomEndRadius = getBorderRadius(BorderRadiusLocation.BOTTOM_END);\n\n      if (I18nUtil.getInstance().doLeftAndRightSwapInRTL(mContext)) {\n        if (YogaConstants.isUndefined(topStartRadius)) {\n          topStartRadius = topLeftRadius;\n        }\n\n        if (YogaConstants.isUndefined(topEndRadius)) {\n          topEndRadius = topRightRadius;\n        }\n\n        if (YogaConstants.isUndefined(bottomStartRadius)) {\n          bottomStartRadius = bottomLeftRadius;\n        }\n\n        if (YogaConstants.isUndefined(bottomEndRadius)) {\n          bottomEndRadius = bottomRightRadius;\n        }\n\n        final float directionAwareTopLeftRadius = isRTL ? topEndRadius : topStartRadius;\n        final float directionAwareTopRightRadius = isRTL ? topStartRadius : topEndRadius;\n        final float directionAwareBottomLeftRadius = isRTL ? bottomEndRadius : bottomStartRadius;\n        final float directionAwareBottomRightRadius = isRTL ? bottomStartRadius : bottomEndRadius;\n\n        topLeftRadius = directionAwareTopLeftRadius;\n        topRightRadius = directionAwareTopRightRadius;\n        bottomLeftRadius = directionAwareBottomLeftRadius;\n        bottomRightRadius = directionAwareBottomRightRadius;\n      } else {\n        final float directionAwareTopLeftRadius = isRTL ? topEndRadius : topStartRadius;\n        final float directionAwareTopRightRadius = isRTL ? topStartRadius : topEndRadius;\n        final float directionAwareBottomLeftRadius = isRTL ? bottomEndRadius : bottomStartRadius;\n        final float directionAwareBottomRightRadius = isRTL ? bottomStartRadius : bottomEndRadius;\n\n        if (!YogaConstants.isUndefined(directionAwareTopLeftRadius)) {\n          topLeftRadius = directionAwareTopLeftRadius;\n        }\n\n        if (!YogaConstants.isUndefined(directionAwareTopRightRadius)) {\n          topRightRadius = directionAwareTopRightRadius;\n        }\n\n        if (!YogaConstants.isUndefined(directionAwareBottomLeftRadius)) {\n          bottomLeftRadius = directionAwareBottomLeftRadius;\n        }\n\n        if (!YogaConstants.isUndefined(directionAwareBottomRightRadius)) {\n          bottomRightRadius = directionAwareBottomRightRadius;\n        }\n      }\n    }\n\n    final float innerTopLeftRadiusX = Math.max(topLeftRadius - borderWidth.left, 0);\n    final float innerTopLeftRadiusY = Math.max(topLeftRadius - borderWidth.top, 0);\n    final float innerTopRightRadiusX = Math.max(topRightRadius - borderWidth.right, 0);\n    final float innerTopRightRadiusY = Math.max(topRightRadius - borderWidth.top, 0);\n    final float innerBottomRightRadiusX = Math.max(bottomRightRadius - borderWidth.right, 0);\n    final float innerBottomRightRadiusY = Math.max(bottomRightRadius - borderWidth.bottom, 0);\n    final float innerBottomLeftRadiusX = Math.max(bottomLeftRadius - borderWidth.left, 0);\n    final float innerBottomLeftRadiusY = Math.max(bottomLeftRadius - borderWidth.bottom, 0);\n\n    mInnerClipPathForBorderRadius.addRoundRect(\n        mInnerClipTempRectForBorderRadius,\n        new float[] {\n          innerTopLeftRadiusX,\n          innerTopLeftRadiusY,\n          innerTopRightRadiusX,\n          innerTopRightRadiusY,\n          innerBottomRightRadiusX,\n          innerBottomRightRadiusY,\n          innerBottomLeftRadiusX,\n          innerBottomLeftRadiusY,\n        },\n        Path.Direction.CW);\n\n    mOuterClipPathForBorderRadius.addRoundRect(\n        mOuterClipTempRectForBorderRadius,\n        new float[] {\n          topLeftRadius,\n          topLeftRadius,\n          topRightRadius,\n          topRightRadius,\n          bottomRightRadius,\n          bottomRightRadius,\n          bottomLeftRadius,\n          bottomLeftRadius\n        },\n        Path.Direction.CW);\n\n    float extraRadiusForOutline = 0;\n\n    if (mBorderWidth != null) {\n      extraRadiusForOutline = mBorderWidth.get(Spacing.ALL) / 2f;\n    }\n\n    mPathForBorderRadiusOutline.addRoundRect(\n      mTempRectForBorderRadiusOutline,\n      new float[] {\n        topLeftRadius + extraRadiusForOutline,\n        topLeftRadius + extraRadiusForOutline,\n        topRightRadius + extraRadiusForOutline,\n        topRightRadius + extraRadiusForOutline,\n        bottomRightRadius + extraRadiusForOutline,\n        bottomRightRadius + extraRadiusForOutline,\n        bottomLeftRadius + extraRadiusForOutline,\n        bottomLeftRadius + extraRadiusForOutline\n      },\n      Path.Direction.CW);\n\n    /**\n     * Rounded Multi-Colored Border Algorithm:\n     *\n     * <p>Let O (for outer) = (top, left, bottom, right) be the rectangle that represents the size\n     * and position of a view V. Since the box-sizing of all React Native views is border-box, any\n     * border of V will render inside O.\n     *\n     * <p>Let BorderWidth = (borderTop, borderLeft, borderBottom, borderRight).\n     *\n     * <p>Let I (for inner) = O - BorderWidth.\n     *\n     * <p>Then, remembering that O and I are rectangles and that I is inside O, O - I gives us the\n     * border of V. Therefore, we can use canvas.clipPath to draw V's border.\n     *\n     * <p>canvas.clipPath(O, Region.OP.INTERSECT);\n     *\n     * <p>canvas.clipPath(I, Region.OP.DIFFERENCE);\n     *\n     * <p>canvas.drawRect(O, paint);\n     *\n     * <p>This lets us draw non-rounded single-color borders.\n     *\n     * <p>To extend this algorithm to rounded single-color borders, we:\n     *\n     * <p>1. Curve the corners of O by the (border radii of V) using Path#addRoundRect.\n     *\n     * <p>2. Curve the corners of I by (border radii of V - border widths of V) using\n     * Path#addRoundRect.\n     *\n     * <p>Let O' = curve(O, border radii of V).\n     *\n     * <p>Let I' = curve(I, border radii of V - border widths of V)\n     *\n     * <p>The rationale behind this decision is the (first sentence of the) following section in the\n     * CSS Backgrounds and Borders Module Level 3:\n     * https://www.w3.org/TR/css3-background/#the-border-radius.\n     *\n     * <p>After both O and I have been curved, we can execute the following lines once again to\n     * render curved single-color borders:\n     *\n     * <p>canvas.clipPath(O, Region.OP.INTERSECT);\n     *\n     * <p>canvas.clipPath(I, Region.OP.DIFFERENCE);\n     *\n     * <p>canvas.drawRect(O, paint);\n     *\n     * <p>To extend this algorithm to rendering multi-colored rounded borders, we render each side\n     * of the border as its own quadrilateral. Suppose that we were handling the case where all the\n     * border radii are 0. Then, the four quadrilaterals would be:\n     *\n     * <p>Left: (O.left, O.top), (I.left, I.top), (I.left, I.bottom), (O.left, O.bottom)\n     *\n     * <p>Top: (O.left, O.top), (I.left, I.top), (I.right, I.top), (O.right, O.top)\n     *\n     * <p>Right: (O.right, O.top), (I.right, I.top), (I.right, I.bottom), (O.right, O.bottom)\n     *\n     * <p>Bottom: (O.right, O.bottom), (I.right, I.bottom), (I.left, I.bottom), (O.left, O.bottom)\n     *\n     * <p>Now, lets consider what happens when we render a rounded border (radii != 0). For the sake\n     * of simplicity, let's focus on the top edge of the Left border:\n     *\n     * <p>Let borderTopLeftRadius = 5. Let borderLeftWidth = 1. Let borderTopWidth = 2.\n     *\n     * <p>We know that O is curved by the ellipse E_O (a = 5, b = 5). We know that I is curved by\n     * the ellipse E_I (a = 5 - 1, b = 5 - 2).\n     *\n     * <p>Since we have clipping, it should be safe to set the top-left point of the Left\n     * quadrilateral's top edge to (O.left, O.top).\n     *\n     * <p>But, what should the top-right point be?\n     *\n     * <p>The fact that the border is curved shouldn't change the slope (nor the position) of the\n     * line connecting the top-left and top-right points of the Left quadrilateral's top edge.\n     * Therefore, The top-right point should lie somewhere on the line L = (1 - a) * (O.left, O.top)\n     * + a * (I.left, I.top).\n     *\n     * <p>a != 0, because then the top-left and top-right points would be the same and\n     * borderLeftWidth = 1. a != 1, because then the top-right point would not touch an edge of the\n     * ellipse E_I. We want the top-right point to touch an edge of the inner ellipse because the\n     * border curves with E_I on the top-left corner of V.\n     *\n     * <p>Therefore, it must be the case that a > 1. Two natural locations of the top-right point\n     * exist: 1. The first intersection of L with E_I. 2. The second intersection of L with E_I.\n     *\n     * <p>We choose the top-right point of the top edge of the Left quadrilateral to be an arbitrary\n     * intersection of L with E_I.\n     */\n    if (mInnerTopLeftCorner == null) {\n      mInnerTopLeftCorner = new PointF();\n    }\n\n    /** Compute mInnerTopLeftCorner */\n    mInnerTopLeftCorner.x = mInnerClipTempRectForBorderRadius.left;\n    mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top;\n\n    getEllipseIntersectionWithLine(\n        // Ellipse Bounds\n        mInnerClipTempRectForBorderRadius.left,\n        mInnerClipTempRectForBorderRadius.top,\n        mInnerClipTempRectForBorderRadius.left + 2 * innerTopLeftRadiusX,\n        mInnerClipTempRectForBorderRadius.top + 2 * innerTopLeftRadiusY,\n\n        // Line Start\n        mOuterClipTempRectForBorderRadius.left,\n        mOuterClipTempRectForBorderRadius.top,\n\n        // Line End\n        mInnerClipTempRectForBorderRadius.left,\n        mInnerClipTempRectForBorderRadius.top,\n\n        // Result\n        mInnerTopLeftCorner);\n\n    /** Compute mInnerBottomLeftCorner */\n    if (mInnerBottomLeftCorner == null) {\n      mInnerBottomLeftCorner = new PointF();\n    }\n\n    mInnerBottomLeftCorner.x = mInnerClipTempRectForBorderRadius.left;\n    mInnerBottomLeftCorner.y = mInnerClipTempRectForBorderRadius.bottom;\n\n    getEllipseIntersectionWithLine(\n        // Ellipse Bounds\n        mInnerClipTempRectForBorderRadius.left,\n        mInnerClipTempRectForBorderRadius.bottom - 2 * innerBottomLeftRadiusY,\n        mInnerClipTempRectForBorderRadius.left + 2 * innerBottomLeftRadiusX,\n        mInnerClipTempRectForBorderRadius.bottom,\n\n        // Line Start\n        mOuterClipTempRectForBorderRadius.left,\n        mOuterClipTempRectForBorderRadius.bottom,\n\n        // Line End\n        mInnerClipTempRectForBorderRadius.left,\n        mInnerClipTempRectForBorderRadius.bottom,\n\n        // Result\n        mInnerBottomLeftCorner);\n\n    /** Compute mInnerTopRightCorner */\n    if (mInnerTopRightCorner == null) {\n      mInnerTopRightCorner = new PointF();\n    }\n\n    mInnerTopRightCorner.x = mInnerClipTempRectForBorderRadius.right;\n    mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top;\n\n    getEllipseIntersectionWithLine(\n        // Ellipse Bounds\n        mInnerClipTempRectForBorderRadius.right - 2 * innerTopRightRadiusX,\n        mInnerClipTempRectForBorderRadius.top,\n        mInnerClipTempRectForBorderRadius.right,\n        mInnerClipTempRectForBorderRadius.top + 2 * innerTopRightRadiusY,\n\n        // Line Start\n        mOuterClipTempRectForBorderRadius.right,\n        mOuterClipTempRectForBorderRadius.top,\n\n        // Line End\n        mInnerClipTempRectForBorderRadius.right,\n        mInnerClipTempRectForBorderRadius.top,\n\n        // Result\n        mInnerTopRightCorner);\n\n    /** Compute mInnerBottomRightCorner */\n    if (mInnerBottomRightCorner == null) {\n      mInnerBottomRightCorner = new PointF();\n    }\n\n    mInnerBottomRightCorner.x = mInnerClipTempRectForBorderRadius.right;\n    mInnerBottomRightCorner.y = mInnerClipTempRectForBorderRadius.bottom;\n\n    getEllipseIntersectionWithLine(\n        // Ellipse Bounds\n        mInnerClipTempRectForBorderRadius.right - 2 * innerBottomRightRadiusX,\n        mInnerClipTempRectForBorderRadius.bottom - 2 * innerBottomRightRadiusY,\n        mInnerClipTempRectForBorderRadius.right,\n        mInnerClipTempRectForBorderRadius.bottom,\n\n        // Line Start\n        mOuterClipTempRectForBorderRadius.right,\n        mOuterClipTempRectForBorderRadius.bottom,\n\n        // Line End\n        mInnerClipTempRectForBorderRadius.right,\n        mInnerClipTempRectForBorderRadius.bottom,\n\n        // Result\n        mInnerBottomRightCorner);\n  }\n\n  private static void getEllipseIntersectionWithLine(\n      double ellipseBoundsLeft,\n      double ellipseBoundsTop,\n      double ellipseBoundsRight,\n      double ellipseBoundsBottom,\n      double lineStartX,\n      double lineStartY,\n      double lineEndX,\n      double lineEndY,\n      PointF result) {\n    final double ellipseCenterX = (ellipseBoundsLeft + ellipseBoundsRight) / 2;\n    final double ellipseCenterY = (ellipseBoundsTop + ellipseBoundsBottom) / 2;\n\n    /**\n     * Step 1:\n     *\n     * Translate the line so that the ellipse is at the origin.\n     *\n     * Why? It makes the math easier by changing the ellipse equation from\n     * ((x - ellipseCenterX)/a)^2 + ((y - ellipseCenterY)/b)^2 = 1 to\n     * (x/a)^2 + (y/b)^2 = 1.\n     */\n    lineStartX -= ellipseCenterX;\n    lineStartY -= ellipseCenterY;\n    lineEndX -= ellipseCenterX;\n    lineEndY -= ellipseCenterY;\n\n    /**\n     * Step 2:\n     *\n     * Ellipse equation: (x/a)^2 + (y/b)^2 = 1\n     * Line equation: y = mx + c\n     */\n    final double a = Math.abs(ellipseBoundsRight - ellipseBoundsLeft) / 2;\n    final double b = Math.abs(ellipseBoundsBottom - ellipseBoundsTop) / 2;\n    final double m = (lineEndY - lineStartY) / (lineEndX - lineStartX);\n    final double c = lineStartY - m * lineStartX; // Just a point on the line\n\n    /**\n     * Step 3:\n     *\n     * Substitute the Line equation into the Ellipse equation. Solve for x.\n     * Eventually, you'll have to use the quadratic formula.\n     *\n     * Quadratic formula: Ax^2 + Bx + C = 0\n     */\n    final double A = (b * b + a * a * m * m);\n    final double B = 2 * a * a * c * m;\n    final double C = (a * a * (c * c - b * b));\n\n    /**\n     * Step 4:\n     *\n     * Apply Quadratic formula. D = determinant / 2A\n     */\n    final double D = Math.sqrt(-C / A + Math.pow(B / (2 * A), 2));\n    final double x2 = -B / (2 * A) - D;\n    final double y2 = m * x2 + c;\n\n    /**\n     * Step 5:\n     *\n     * Undo the space transformation in Step 5.\n     */\n    final double x = x2 + ellipseCenterX;\n    final double y = y2 + ellipseCenterY;\n\n    if (!Double.isNaN(x) && !Double.isNaN(y)) {\n      result.x = (float) x;\n      result.y = (float) y;\n    }\n  }\n\n  public float getBorderWidthOrDefaultTo(final float defaultValue, final int spacingType) {\n    if (mBorderWidth == null) {\n      return defaultValue;\n    }\n\n    final float width = mBorderWidth.getRaw(spacingType);\n\n    if (YogaConstants.isUndefined(width)) {\n      return defaultValue;\n    }\n\n    return width;\n  }\n\n  /**\n   * Set type of border\n   */\n  private void updatePathEffect() {\n    mPathEffectForBorderStyle = mBorderStyle != null\n        ? mBorderStyle.getPathEffect(getFullBorderWidth())\n        : null;\n\n    mPaint.setPathEffect(mPathEffectForBorderStyle);\n  }\n\n  /** For rounded borders we use default \"borderWidth\" property. */\n  public float getFullBorderWidth() {\n    return (mBorderWidth != null && !YogaConstants.isUndefined(mBorderWidth.getRaw(Spacing.ALL))) ?\n        mBorderWidth.getRaw(Spacing.ALL) : 0f;\n  }\n\n  /**\n   * Quickly determine if all the set border colors are equal.  Bitwise AND all the set colors\n   * together, then OR them all together.  If the AND and the OR are the same, then the colors\n   * are compatible, so return this color.\n   *\n   * Used to avoid expensive path creation and expensive calls to canvas.drawPath\n   *\n   * @return A compatible border color, or zero if the border colors are not compatible.\n   */\n  private static int fastBorderCompatibleColorOrZero(\n      int borderLeft,\n      int borderTop,\n      int borderRight,\n      int borderBottom,\n      int colorLeft,\n      int colorTop,\n      int colorRight,\n      int colorBottom) {\n    int andSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_SET) &\n        (borderTop > 0 ? colorTop : ALL_BITS_SET) &\n        (borderRight > 0 ? colorRight : ALL_BITS_SET) &\n        (borderBottom > 0 ? colorBottom : ALL_BITS_SET);\n    int orSmear = (borderLeft > 0 ? colorLeft : ALL_BITS_UNSET) |\n        (borderTop > 0 ? colorTop : ALL_BITS_UNSET) |\n        (borderRight > 0 ? colorRight : ALL_BITS_UNSET) |\n        (borderBottom > 0 ? colorBottom : ALL_BITS_UNSET);\n    return andSmear == orSmear ? andSmear : 0;\n  }\n\n  private void drawRectangularBackgroundWithBorders(Canvas canvas) {\n    int useColor = ColorUtil.multiplyColorAlpha(mColor, mAlpha);\n    if (Color.alpha(useColor) != 0) { // color is not transparent\n      mPaint.setColor(useColor);\n      mPaint.setStyle(Paint.Style.FILL);\n      canvas.drawRect(getBounds(), mPaint);\n    }\n\n    final RectF borderWidth = getDirectionAwareBorderInsets();\n\n    final int borderLeft = Math.round(borderWidth.left);\n    final int borderTop = Math.round(borderWidth.top);\n    final int borderRight = Math.round(borderWidth.right);\n    final int borderBottom = Math.round(borderWidth.bottom);\n\n    // maybe draw borders?\n    if (borderLeft > 0 || borderRight > 0 || borderTop > 0 || borderBottom > 0) {\n      Rect bounds = getBounds();\n\n      int colorLeft = getBorderColor(Spacing.LEFT);\n      int colorTop = getBorderColor(Spacing.TOP);\n      int colorRight = getBorderColor(Spacing.RIGHT);\n      int colorBottom = getBorderColor(Spacing.BOTTOM);\n\n      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {\n        final boolean isRTL = getResolvedLayoutDirection() == View.LAYOUT_DIRECTION_RTL;\n        int colorStart = getBorderColor(Spacing.START);\n        int colorEnd = getBorderColor(Spacing.END);\n\n        if (I18nUtil.getInstance().doLeftAndRightSwapInRTL(mContext)) {\n          if (!isBorderColorDefined(Spacing.START)) {\n            colorStart = colorLeft;\n          }\n\n          if (!isBorderColorDefined(Spacing.END)) {\n            colorEnd = colorRight;\n          }\n\n          final int directionAwareColorLeft = isRTL ? colorEnd : colorStart;\n          final int directionAwareColorRight = isRTL ? colorStart : colorEnd;\n\n          colorLeft = directionAwareColorLeft;\n          colorRight = directionAwareColorRight;\n        } else {\n          final int directionAwareColorLeft = isRTL ? colorEnd : colorStart;\n          final int directionAwareColorRight = isRTL ? colorStart : colorEnd;\n\n          final boolean isColorStartDefined = isBorderColorDefined(Spacing.START);\n          final boolean isColorEndDefined = isBorderColorDefined(Spacing.END);\n          final boolean isDirectionAwareColorLeftDefined = isRTL ? isColorEndDefined : isColorStartDefined;\n          final boolean isDirectionAwareColorRightDefined = isRTL ? isColorStartDefined : isColorEndDefined;\n\n          if (isDirectionAwareColorLeftDefined) {\n            colorLeft = directionAwareColorLeft;\n          }\n\n          if (isDirectionAwareColorRightDefined) {\n            colorRight = directionAwareColorRight;\n          }\n        }\n      }\n\n      int left = bounds.left;\n      int top = bounds.top;\n\n      // Check for fast path to border drawing.\n      int fastBorderColor = fastBorderCompatibleColorOrZero(\n          borderLeft,\n          borderTop,\n          borderRight,\n          borderBottom,\n          colorLeft,\n          colorTop,\n          colorRight,\n          colorBottom);\n      if (fastBorderColor != 0) {\n        if (Color.alpha(fastBorderColor) != 0) {\n          // Border color is not transparent.\n          int right = bounds.right;\n          int bottom = bounds.bottom;\n\n          mPaint.setColor(fastBorderColor);\n          if (borderLeft > 0) {\n            int leftInset = left + borderLeft;\n            canvas.drawRect(left, top, leftInset, bottom - borderBottom, mPaint);\n          }\n          if (borderTop > 0) {\n            int topInset = top + borderTop;\n            canvas.drawRect(left + borderLeft, top, right, topInset, mPaint);\n          }\n          if (borderRight > 0) {\n            int rightInset = right - borderRight;\n            canvas.drawRect(rightInset, top + borderTop, right, bottom, mPaint);\n          }\n          if (borderBottom > 0) {\n            int bottomInset = bottom - borderBottom;\n            canvas.drawRect(left, bottomInset, right - borderRight, bottom, mPaint);\n          }\n        }\n      } else {\n        // If the path drawn previously is of the same color,\n        // there would be a slight white space between borders\n        // with anti-alias set to true.\n        // Therefore we need to disable anti-alias, and\n        // after drawing is done, we will re-enable it.\n\n        mPaint.setAntiAlias(false);\n\n        int width = bounds.width();\n        int height = bounds.height();\n\n        if (borderLeft > 0) {\n          final float x1 = left;\n          final float y1 = top;\n          final float x2 = left + borderLeft;\n          final float y2 = top + borderTop;\n          final float x3 = left + borderLeft;\n          final float y3 = top + height - borderBottom;\n          final float x4 = left;\n          final float y4 = top + height;\n\n          drawQuadrilateral(canvas, colorLeft, x1, y1, x2, y2, x3, y3, x4, y4);\n        }\n\n        if (borderTop > 0) {\n          final float x1 = left;\n          final float y1 = top;\n          final float x2 = left + borderLeft;\n          final float y2 = top + borderTop;\n          final float x3 = left + width - borderRight;\n          final float y3 = top + borderTop;\n          final float x4 = left + width;\n          final float y4 = top;\n\n          drawQuadrilateral(canvas, colorTop, x1, y1, x2, y2, x3, y3, x4, y4);\n        }\n\n        if (borderRight > 0) {\n          final float x1 = left + width;\n          final float y1 = top;\n          final float x2 = left + width;\n          final float y2 = top + height;\n          final float x3 = left + width - borderRight;\n          final float y3 = top + height - borderBottom;\n          final float x4 = left + width - borderRight;\n          final float y4 = top + borderTop;\n\n          drawQuadrilateral(canvas, colorRight, x1, y1, x2, y2, x3, y3, x4, y4);\n        }\n\n        if (borderBottom > 0) {\n          final float x1 = left;\n          final float y1 = top + height;\n          final float x2 = left + width;\n          final float y2 = top + height;\n          final float x3 = left + width - borderRight;\n          final float y3 = top + height - borderBottom;\n          final float x4 = left + borderLeft;\n          final float y4 = top + height - borderBottom;\n\n          drawQuadrilateral(canvas, colorBottom, x1, y1, x2, y2, x3, y3, x4, y4);\n        }\n\n        // re-enable anti alias\n        mPaint.setAntiAlias(true);\n      }\n    }\n  }\n\n  private void drawQuadrilateral(\n      Canvas canvas,\n      int fillColor,\n      float x1,\n      float y1,\n      float x2,\n      float y2,\n      float x3,\n      float y3,\n      float x4,\n      float y4) {\n    if (fillColor == Color.TRANSPARENT) {\n      return;\n    }\n\n    if (mPathForBorder == null) {\n      mPathForBorder = new Path();\n    }\n\n    mPaint.setColor(fillColor);\n    mPathForBorder.reset();\n    mPathForBorder.moveTo(x1, y1);\n    mPathForBorder.lineTo(x2, y2);\n    mPathForBorder.lineTo(x3, y3);\n    mPathForBorder.lineTo(x4, y4);\n    mPathForBorder.lineTo(x1, y1);\n    canvas.drawPath(mPathForBorder, mPaint);\n  }\n\n  private int getBorderWidth(int position) {\n    if (mBorderWidth == null) {\n      return 0;\n    }\n\n    final float width = mBorderWidth.get(position);\n    return YogaConstants.isUndefined(width) ? -1 : Math.round(width);\n  }\n\n  private static int colorFromAlphaAndRGBComponents(float alpha, float rgb) {\n    int rgbComponent = 0x00FFFFFF & (int)rgb;\n    int alphaComponent = 0xFF000000 & ((int)alpha) << 24;\n\n    return rgbComponent | alphaComponent;\n  }\n\n  private boolean isBorderColorDefined(int position) {\n    final float rgb = mBorderRGB != null ? mBorderRGB.get(position) : YogaConstants.UNDEFINED;\n    final float alpha = mBorderAlpha != null ? mBorderAlpha.get(position) : YogaConstants.UNDEFINED;\n    return !YogaConstants.isUndefined(rgb) && !YogaConstants.isUndefined(alpha);\n  }\n\n  private int getBorderColor(int position) {\n    float rgb = mBorderRGB != null ? mBorderRGB.get(position) : DEFAULT_BORDER_RGB;\n    float alpha = mBorderAlpha != null ? mBorderAlpha.get(position) : DEFAULT_BORDER_ALPHA;\n\n    return ReactViewBackgroundDrawable.colorFromAlphaAndRGBComponents(alpha, rgb);\n  }\n\n  public RectF getDirectionAwareBorderInsets() {\n    final float borderWidth = getBorderWidthOrDefaultTo(0, Spacing.ALL);\n    final float borderTopWidth = getBorderWidthOrDefaultTo(borderWidth, Spacing.TOP);\n    final float borderBottomWidth = getBorderWidthOrDefaultTo(borderWidth, Spacing.BOTTOM);\n    float borderLeftWidth = getBorderWidthOrDefaultTo(borderWidth, Spacing.LEFT);\n    float borderRightWidth = getBorderWidthOrDefaultTo(borderWidth, Spacing.RIGHT);\n\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && mBorderWidth != null) {\n      final boolean isRTL = getResolvedLayoutDirection() == View.LAYOUT_DIRECTION_RTL;\n      float borderStartWidth = mBorderWidth.getRaw(Spacing.START);\n      float borderEndWidth = mBorderWidth.getRaw(Spacing.END);\n\n      if (I18nUtil.getInstance().doLeftAndRightSwapInRTL(mContext)) {\n        if (YogaConstants.isUndefined(borderStartWidth)) {\n          borderStartWidth = borderLeftWidth;\n        }\n\n        if (YogaConstants.isUndefined(borderEndWidth)) {\n          borderEndWidth = borderRightWidth;\n        }\n\n        final float directionAwareBorderLeftWidth = isRTL ? borderEndWidth : borderStartWidth;\n        final float directionAwareBorderRightWidth = isRTL ? borderStartWidth : borderEndWidth;\n\n        borderLeftWidth = directionAwareBorderLeftWidth;\n        borderRightWidth = directionAwareBorderRightWidth;\n      } else {\n        final float directionAwareBorderLeftWidth = isRTL ? borderEndWidth : borderStartWidth;\n        final float directionAwareBorderRightWidth = isRTL ? borderStartWidth : borderEndWidth;\n\n        if (!YogaConstants.isUndefined(directionAwareBorderLeftWidth)) {\n          borderLeftWidth = directionAwareBorderLeftWidth;\n        }\n\n        if (!YogaConstants.isUndefined(directionAwareBorderRightWidth)) {\n          borderRightWidth = directionAwareBorderRightWidth;\n        }\n      }\n    }\n\n    return new RectF(\n      borderLeftWidth,\n      borderTopWidth,\n      borderRightWidth,\n      borderBottomWidth\n    );\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundManager.java",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\npackage com.facebook.react.views.view;\n\nimport android.graphics.Color;\nimport android.graphics.drawable.Drawable;\nimport android.graphics.drawable.LayerDrawable;\nimport android.view.View;\nimport com.facebook.react.views.common.ViewHelper;\nimport javax.annotation.Nullable;\n\n/** Class that manages the background for views and borders. */\npublic class ReactViewBackgroundManager {\n\n  private @Nullable ReactViewBackgroundDrawable mReactBackgroundDrawable;\n  private View mView;\n\n  public ReactViewBackgroundManager(View view) {\n    this.mView = view;\n  }\n\n  private ReactViewBackgroundDrawable getOrCreateReactViewBackground() {\n    if (mReactBackgroundDrawable == null) {\n      mReactBackgroundDrawable = new ReactViewBackgroundDrawable(mView.getContext());\n      Drawable backgroundDrawable = mView.getBackground();\n      ViewHelper.setBackground(\n          mView, null); // required so that drawable callback is cleared before we add the\n      // drawable back as a part of LayerDrawable\n      if (backgroundDrawable == null) {\n        ViewHelper.setBackground(mView, mReactBackgroundDrawable);\n      } else {\n        LayerDrawable layerDrawable =\n            new LayerDrawable(new Drawable[] {mReactBackgroundDrawable, backgroundDrawable});\n        ViewHelper.setBackground(mView, layerDrawable);\n      }\n    }\n    return mReactBackgroundDrawable;\n  }\n\n  public void setBackgroundColor(int color) {\n    if (color == Color.TRANSPARENT && mReactBackgroundDrawable == null) {\n      // don't do anything, no need to allocate ReactBackgroundDrawable for transparent background\n    } else {\n      getOrCreateReactViewBackground().setColor(color);\n    }\n  }\n\n  public void setBorderWidth(int position, float width) {\n    getOrCreateReactViewBackground().setBorderWidth(position, width);\n  }\n\n  public void setBorderColor(int position, float color, float alpha) {\n    getOrCreateReactViewBackground().setBorderColor(position, color, alpha);\n  }\n\n  public void setBorderRadius(float borderRadius) {\n    getOrCreateReactViewBackground().setRadius(borderRadius);\n  }\n\n  public void setBorderRadius(float borderRadius, int position) {\n    getOrCreateReactViewBackground().setRadius(borderRadius, position);\n  }\n\n  public void setBorderStyle(@Nullable String style) {\n    getOrCreateReactViewBackground().setBorderStyle(style);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.view;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Path;\nimport android.graphics.Rect;\nimport android.graphics.RectF;\nimport android.graphics.drawable.Drawable;\nimport android.graphics.drawable.LayerDrawable;\nimport android.os.Build;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.animation.Animation;\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.modules.i18nmanager.I18nUtil;\nimport com.facebook.react.touch.OnInterceptTouchEventListener;\nimport com.facebook.react.touch.ReactHitSlopView;\nimport com.facebook.react.touch.ReactInterceptingViewGroup;\nimport com.facebook.react.uimanager.MeasureSpecAssertions;\nimport com.facebook.react.uimanager.PointerEvents;\nimport com.facebook.react.uimanager.ReactClippingViewGroup;\nimport com.facebook.react.uimanager.ReactClippingViewGroupHelper;\nimport com.facebook.react.uimanager.ReactPointerEventsView;\nimport com.facebook.react.uimanager.ReactZIndexedViewGroup;\nimport com.facebook.react.uimanager.ViewGroupDrawingOrderHelper;\nimport com.facebook.yoga.YogaConstants;\nimport javax.annotation.Nullable;\n\n/**\n * Backing for a React View. Has support for borders, but since borders aren't common, lazy\n * initializes most of the storage needed for them.\n */\npublic class ReactViewGroup extends ViewGroup implements\n    ReactInterceptingViewGroup, ReactClippingViewGroup, ReactPointerEventsView, ReactHitSlopView,\n    ReactZIndexedViewGroup {\n\n  private static final int ARRAY_CAPACITY_INCREMENT = 12;\n  private static final int DEFAULT_BACKGROUND_COLOR = Color.TRANSPARENT;\n  private static final LayoutParams sDefaultLayoutParam = new ViewGroup.LayoutParams(0, 0);\n  /* should only be used in {@link #updateClippingToRect} */\n  private static final Rect sHelperRect = new Rect();\n\n  /**\n   * This listener will be set for child views when removeClippedSubview property is enabled. When\n   * children layout is updated, it will call {@link #updateSubviewClipStatus} to notify parent view\n   * about that fact so that view can be attached/detached if necessary.\n   *\n   * <p>TODO(7728005): Attach/detach views in batch - once per frame in case when multiple children\n   * update their layout.\n   */\n  private static final class ChildrenLayoutChangeListener implements View.OnLayoutChangeListener {\n\n    private final ReactViewGroup mParent;\n\n    private ChildrenLayoutChangeListener(ReactViewGroup parent) {\n      mParent = parent;\n    }\n\n    @Override\n    public void onLayoutChange(\n        View v,\n        int left,\n        int top,\n        int right,\n        int bottom,\n        int oldLeft,\n        int oldTop,\n        int oldRight,\n        int oldBottom) {\n      if (mParent.getRemoveClippedSubviews()) {\n        mParent.updateSubviewClipStatus(v);\n      }\n    }\n  }\n\n  // Following properties are here to support the option {@code removeClippedSubviews}. This is a\n  // temporary optimization/hack that is mainly applicable to the large list of images. The way\n  // it's implemented is that we store an additional array of children in view node. We selectively\n  // remove some of the views (detach) from it while still storing them in that additional array.\n  // We override all possible add methods for {@link ViewGroup} so that we can control this process\n  // whenever the option is set. We also override {@link ViewGroup#getChildAt} and\n  // {@link ViewGroup#getChildCount} so those methods may return views that are not attached.\n  // This is risky but allows us to perform a correct cleanup in {@link NativeViewHierarchyManager}.\n  private boolean mRemoveClippedSubviews = false;\n  private @Nullable View[] mAllChildren = null;\n  private int mAllChildrenCount;\n  private @Nullable Rect mClippingRect;\n  private @Nullable Rect mHitSlopRect;\n  private @Nullable String mOverflow;\n  private PointerEvents mPointerEvents = PointerEvents.AUTO;\n  private @Nullable ChildrenLayoutChangeListener mChildrenLayoutChangeListener;\n  private @Nullable ReactViewBackgroundDrawable mReactBackgroundDrawable;\n  private @Nullable OnInterceptTouchEventListener mOnInterceptTouchEventListener;\n  private boolean mNeedsOffscreenAlphaCompositing = false;\n  private final ViewGroupDrawingOrderHelper mDrawingOrderHelper;\n  private @Nullable Path mPath;\n  private int mLayoutDirection;\n\n  public ReactViewGroup(Context context) {\n    super(context);\n    mDrawingOrderHelper = new ViewGroupDrawingOrderHelper(this);\n  }\n\n  @Override\n  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n    MeasureSpecAssertions.assertExplicitMeasureSpec(widthMeasureSpec, heightMeasureSpec);\n\n    setMeasuredDimension(\n        MeasureSpec.getSize(widthMeasureSpec),\n        MeasureSpec.getSize(heightMeasureSpec));\n  }\n\n  @Override\n  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n    // No-op since UIManagerModule handles actually laying out children.\n  }\n\n  @Override\n  public void onRtlPropertiesChanged(int layoutDirection) {\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {\n      if (mReactBackgroundDrawable != null) {\n        mReactBackgroundDrawable.setResolvedLayoutDirection(mLayoutDirection);\n      }\n    }\n  }\n\n  @Override\n  public void requestLayout() {\n    // No-op, terminate `requestLayout` here, UIManagerModule handles laying out children and\n    // `layout` is called on all RN-managed views by `NativeViewHierarchyManager`\n  }\n\n  @Override\n  public void setBackgroundColor(int color) {\n    if (color == Color.TRANSPARENT && mReactBackgroundDrawable == null) {\n      // don't do anything, no need to allocate ReactBackgroundDrawable for transparent background\n    } else {\n      getOrCreateReactViewBackground().setColor(color);\n    }\n  }\n\n  @Override\n  public void setBackground(Drawable drawable) {\n    throw new UnsupportedOperationException(\n        \"This method is not supported for ReactViewGroup instances\");\n  }\n\n  public void setTranslucentBackgroundDrawable(@Nullable Drawable background) {\n    // it's required to call setBackground to null, as in some of the cases we may set new\n    // background to be a layer drawable that contains a drawable that has been previously setup\n    // as a background previously. This will not work correctly as the drawable callback logic is\n    // messed up in AOSP\n    updateBackgroundDrawable(null);\n    if (mReactBackgroundDrawable != null && background != null) {\n      LayerDrawable layerDrawable =\n          new LayerDrawable(new Drawable[] {mReactBackgroundDrawable, background});\n      updateBackgroundDrawable(layerDrawable);\n    } else if (background != null) {\n      updateBackgroundDrawable(background);\n    }\n  }\n\n  @Override\n  public void setOnInterceptTouchEventListener(OnInterceptTouchEventListener listener) {\n    mOnInterceptTouchEventListener = listener;\n  }\n\n  @Override\n  public boolean onInterceptTouchEvent(MotionEvent ev) {\n    if (mOnInterceptTouchEventListener != null &&\n        mOnInterceptTouchEventListener.onInterceptTouchEvent(this, ev)) {\n      return true;\n    }\n    // We intercept the touch event if the children are not supposed to receive it.\n    if (mPointerEvents == PointerEvents.NONE || mPointerEvents == PointerEvents.BOX_ONLY) {\n      return true;\n    }\n    return super.onInterceptTouchEvent(ev);\n  }\n\n  @Override\n  public boolean onTouchEvent(MotionEvent ev) {\n    // We do not accept the touch event if this view is not supposed to receive it.\n    if (mPointerEvents == PointerEvents.NONE || mPointerEvents == PointerEvents.BOX_NONE) {\n      return false;\n    }\n    // The root view always assumes any view that was tapped wants the touch\n    // and sends the event to JS as such.\n    // We don't need to do bubbling in native (it's already happening in JS).\n    // For an explanation of bubbling and capturing, see\n    // http://javascript.info/tutorial/bubbling-and-capturing#capturing\n    return true;\n  }\n\n  /**\n   * We override this to allow developers to determine whether they need offscreen alpha compositing\n   * or not. See the documentation of needsOffscreenAlphaCompositing in View.js.\n   */\n  @Override\n  public boolean hasOverlappingRendering() {\n    return mNeedsOffscreenAlphaCompositing;\n  }\n\n  /**\n   * See the documentation of needsOffscreenAlphaCompositing in View.js.\n   */\n  public void setNeedsOffscreenAlphaCompositing(boolean needsOffscreenAlphaCompositing) {\n    mNeedsOffscreenAlphaCompositing = needsOffscreenAlphaCompositing;\n  }\n\n  public void setBorderWidth(int position, float width) {\n    getOrCreateReactViewBackground().setBorderWidth(position, width);\n  }\n\n  public void setBorderColor(int position, float rgb, float alpha) {\n    getOrCreateReactViewBackground().setBorderColor(position, rgb, alpha);\n  }\n\n  public void setBorderRadius(float borderRadius) {\n    ReactViewBackgroundDrawable backgroundDrawable = getOrCreateReactViewBackground();\n    backgroundDrawable.setRadius(borderRadius);\n\n    if (Build.VERSION_CODES.HONEYCOMB < Build.VERSION.SDK_INT\n      && Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {\n      final int UPDATED_LAYER_TYPE =\n        backgroundDrawable.hasRoundedBorders()\n          ? View.LAYER_TYPE_SOFTWARE\n          : View.LAYER_TYPE_HARDWARE;\n\n      if (UPDATED_LAYER_TYPE != getLayerType()) {\n        setLayerType(UPDATED_LAYER_TYPE, null);\n      }\n    }\n  }\n\n  public void setBorderRadius(float borderRadius, int position) {\n    ReactViewBackgroundDrawable backgroundDrawable = getOrCreateReactViewBackground();\n    backgroundDrawable.setRadius(borderRadius, position);\n\n    if (Build.VERSION_CODES.HONEYCOMB < Build.VERSION.SDK_INT\n        && Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {\n      final int UPDATED_LAYER_TYPE =\n          backgroundDrawable.hasRoundedBorders()\n              ? View.LAYER_TYPE_SOFTWARE\n              : View.LAYER_TYPE_HARDWARE;\n\n      if (UPDATED_LAYER_TYPE != getLayerType()) {\n        setLayerType(UPDATED_LAYER_TYPE, null);\n      }\n    }\n  }\n\n  public void setBorderStyle(@Nullable String style) {\n    getOrCreateReactViewBackground().setBorderStyle(style);\n  }\n\n  @Override\n  public void setRemoveClippedSubviews(boolean removeClippedSubviews) {\n    if (removeClippedSubviews == mRemoveClippedSubviews) {\n      return;\n    }\n    mRemoveClippedSubviews = removeClippedSubviews;\n    if (removeClippedSubviews) {\n      mClippingRect = new Rect();\n      ReactClippingViewGroupHelper.calculateClippingRect(this, mClippingRect);\n      mAllChildrenCount = getChildCount();\n      int initialSize = Math.max(12, mAllChildrenCount);\n      mAllChildren = new View[initialSize];\n      mChildrenLayoutChangeListener = new ChildrenLayoutChangeListener(this);\n      for (int i = 0; i < mAllChildrenCount; i++) {\n        View child = getChildAt(i);\n        mAllChildren[i] = child;\n        child.addOnLayoutChangeListener(mChildrenLayoutChangeListener);\n      }\n      updateClippingRect();\n    } else {\n      // Add all clipped views back, deallocate additional arrays, remove layoutChangeListener\n      Assertions.assertNotNull(mClippingRect);\n      Assertions.assertNotNull(mAllChildren);\n      Assertions.assertNotNull(mChildrenLayoutChangeListener);\n      for (int i = 0; i < mAllChildrenCount; i++) {\n        mAllChildren[i].removeOnLayoutChangeListener(mChildrenLayoutChangeListener);\n      }\n      getDrawingRect(mClippingRect);\n      updateClippingToRect(mClippingRect);\n      mAllChildren = null;\n      mClippingRect = null;\n      mAllChildrenCount = 0;\n      mChildrenLayoutChangeListener = null;\n    }\n  }\n\n  @Override\n  public boolean getRemoveClippedSubviews() {\n    return mRemoveClippedSubviews;\n  }\n\n  @Override\n  public void getClippingRect(Rect outClippingRect) {\n    outClippingRect.set(mClippingRect);\n  }\n\n  @Override\n  public void updateClippingRect() {\n    if (!mRemoveClippedSubviews) {\n      return;\n    }\n\n    Assertions.assertNotNull(mClippingRect);\n    Assertions.assertNotNull(mAllChildren);\n\n    ReactClippingViewGroupHelper.calculateClippingRect(this, mClippingRect);\n    updateClippingToRect(mClippingRect);\n  }\n\n  private void updateClippingToRect(Rect clippingRect) {\n    Assertions.assertNotNull(mAllChildren);\n    int clippedSoFar = 0;\n    for (int i = 0; i < mAllChildrenCount; i++) {\n      updateSubviewClipStatus(clippingRect, i, clippedSoFar);\n      if (mAllChildren[i].getParent() == null) {\n        clippedSoFar++;\n      }\n    }\n  }\n\n  private void updateSubviewClipStatus(Rect clippingRect, int idx, int clippedSoFar) {\n    View child = Assertions.assertNotNull(mAllChildren)[idx];\n    sHelperRect.set(child.getLeft(), child.getTop(), child.getRight(), child.getBottom());\n    boolean intersects = clippingRect\n        .intersects(sHelperRect.left, sHelperRect.top, sHelperRect.right, sHelperRect.bottom);\n    boolean needUpdateClippingRecursive = false;\n    // We never want to clip children that are being animated, as this can easily break layout :\n    // when layout animation changes size and/or position of views contained inside a listview that\n    // clips offscreen children, we need to ensure that, when view exits the viewport, final size\n    // and position is set prior to removing the view from its listview parent.\n    // Otherwise, when view gets re-attached again, i.e when it re-enters the viewport after scroll,\n    // it won't be size and located properly.\n    Animation animation = child.getAnimation();\n    boolean isAnimating = animation != null && !animation.hasEnded();\n    if (!intersects && child.getParent() != null && !isAnimating) {\n      // We can try saving on invalidate call here as the view that we remove is out of visible area\n      // therefore invalidation is not necessary.\n      super.removeViewsInLayout(idx - clippedSoFar, 1);\n      needUpdateClippingRecursive = true;\n    } else if (intersects && child.getParent() == null) {\n      super.addViewInLayout(child, idx - clippedSoFar, sDefaultLayoutParam, true);\n      invalidate();\n      needUpdateClippingRecursive = true;\n    } else if (intersects) {\n      // If there is any intersection we need to inform the child to update its clipping rect\n      needUpdateClippingRecursive = true;\n    }\n    if (needUpdateClippingRecursive) {\n      if (child instanceof ReactClippingViewGroup) {\n        // we don't use {@link sHelperRect} until the end of this loop, therefore it's safe\n        // to call this method that may write to the same {@link sHelperRect} object.\n        ReactClippingViewGroup clippingChild = (ReactClippingViewGroup) child;\n        if (clippingChild.getRemoveClippedSubviews()) {\n          clippingChild.updateClippingRect();\n        }\n      }\n    }\n  }\n\n  private void updateSubviewClipStatus(View subview) {\n    if (!mRemoveClippedSubviews || getParent() == null) {\n      return;\n    }\n\n    Assertions.assertNotNull(mClippingRect);\n    Assertions.assertNotNull(mAllChildren);\n\n    // do fast check whether intersect state changed\n    sHelperRect.set(subview.getLeft(), subview.getTop(), subview.getRight(), subview.getBottom());\n    boolean intersects = mClippingRect\n        .intersects(sHelperRect.left, sHelperRect.top, sHelperRect.right, sHelperRect.bottom);\n\n    // If it was intersecting before, should be attached to the parent\n    boolean oldIntersects = (subview.getParent() != null);\n\n    if (intersects != oldIntersects) {\n      int clippedSoFar = 0;\n      for (int i = 0; i < mAllChildrenCount; i++) {\n        if (mAllChildren[i] == subview) {\n          updateSubviewClipStatus(mClippingRect, i, clippedSoFar);\n          break;\n        }\n        if (mAllChildren[i].getParent() == null) {\n          clippedSoFar++;\n        }\n      }\n    }\n  }\n\n  @Override\n  protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n    super.onSizeChanged(w, h, oldw, oldh);\n    if (mRemoveClippedSubviews) {\n      updateClippingRect();\n    }\n  }\n\n  @Override\n  protected void onAttachedToWindow() {\n    super.onAttachedToWindow();\n    if (mRemoveClippedSubviews) {\n      updateClippingRect();\n    }\n  }\n\n  @Override\n  public void addView(View child, int index, ViewGroup.LayoutParams params) {\n    // This will get called for every overload of addView so there is not need to override every method.\n    mDrawingOrderHelper.handleAddView(child);\n    setChildrenDrawingOrderEnabled(mDrawingOrderHelper.shouldEnableCustomDrawingOrder());\n\n    super.addView(child, index, params);\n  }\n\n  @Override\n  public void removeView(View view) {\n    mDrawingOrderHelper.handleRemoveView(view);\n    setChildrenDrawingOrderEnabled(mDrawingOrderHelper.shouldEnableCustomDrawingOrder());\n\n    super.removeView(view);\n  }\n\n  @Override\n  public void removeViewAt(int index) {\n    mDrawingOrderHelper.handleRemoveView(getChildAt(index));\n    setChildrenDrawingOrderEnabled(mDrawingOrderHelper.shouldEnableCustomDrawingOrder());\n\n    super.removeViewAt(index);\n  }\n\n  @Override\n  protected int getChildDrawingOrder(int childCount, int index) {\n    return mDrawingOrderHelper.getChildDrawingOrder(childCount, index);\n  }\n\n  @Override\n  public int getZIndexMappedChildIndex(int index) {\n    if (mDrawingOrderHelper.shouldEnableCustomDrawingOrder()) {\n      return mDrawingOrderHelper.getChildDrawingOrder(getChildCount(), index);\n    } else {\n      return index;\n    }\n  }\n\n  @Override\n  public void updateDrawingOrder() {\n    mDrawingOrderHelper.update();\n    setChildrenDrawingOrderEnabled(mDrawingOrderHelper.shouldEnableCustomDrawingOrder());\n    invalidate();\n  }\n\n  @Override\n  public PointerEvents getPointerEvents() {\n    return mPointerEvents;\n  }\n\n  @Override\n  protected void dispatchSetPressed(boolean pressed) {\n    // Prevents the ViewGroup from dispatching the pressed state\n    // to it's children.\n  }\n\n  /*package*/ void setPointerEvents(PointerEvents pointerEvents) {\n    mPointerEvents = pointerEvents;\n  }\n\n  /*package*/ int getAllChildrenCount() {\n    return mAllChildrenCount;\n  }\n\n  /*package*/ View getChildAtWithSubviewClippingEnabled(int index) {\n    return Assertions.assertNotNull(mAllChildren)[index];\n  }\n\n  /*package*/ void addViewWithSubviewClippingEnabled(View child, int index) {\n    addViewWithSubviewClippingEnabled(child, index, sDefaultLayoutParam);\n  }\n\n  /*package*/ void addViewWithSubviewClippingEnabled(\n      View child, int index, ViewGroup.LayoutParams params) {\n    Assertions.assertCondition(mRemoveClippedSubviews);\n    Assertions.assertNotNull(mClippingRect);\n    Assertions.assertNotNull(mAllChildren);\n    addInArray(child, index);\n    // we add view as \"clipped\" and then run {@link #updateSubviewClipStatus} to conditionally\n    // attach it\n    int clippedSoFar = 0;\n    for (int i = 0; i < index; i++) {\n      if (mAllChildren[i].getParent() == null) {\n        clippedSoFar++;\n      }\n    }\n    updateSubviewClipStatus(mClippingRect, index, clippedSoFar);\n    child.addOnLayoutChangeListener(mChildrenLayoutChangeListener);\n  }\n\n  /*package*/ void removeViewWithSubviewClippingEnabled(View view) {\n    Assertions.assertCondition(mRemoveClippedSubviews);\n    Assertions.assertNotNull(mClippingRect);\n    Assertions.assertNotNull(mAllChildren);\n    view.removeOnLayoutChangeListener(mChildrenLayoutChangeListener);\n    int index = indexOfChildInAllChildren(view);\n    if (mAllChildren[index].getParent() != null) {\n      int clippedSoFar = 0;\n      for (int i = 0; i < index; i++) {\n        if (mAllChildren[i].getParent() == null) {\n          clippedSoFar++;\n        }\n      }\n      super.removeViewsInLayout(index - clippedSoFar, 1);\n    }\n    removeFromArray(index);\n  }\n\n  /*package*/ void removeAllViewsWithSubviewClippingEnabled() {\n    Assertions.assertCondition(mRemoveClippedSubviews);\n    Assertions.assertNotNull(mAllChildren);\n    for (int i = 0; i < mAllChildrenCount; i++) {\n      mAllChildren[i].removeOnLayoutChangeListener(mChildrenLayoutChangeListener);\n    }\n    removeAllViewsInLayout();\n    mAllChildrenCount = 0;\n  }\n\n  private int indexOfChildInAllChildren(View child) {\n    final int count = mAllChildrenCount;\n    final View[] children = Assertions.assertNotNull(mAllChildren);\n    for (int i = 0; i < count; i++) {\n      if (children[i] == child) {\n        return i;\n      }\n    }\n    return -1;\n  }\n\n  private void addInArray(View child, int index) {\n    View[] children = Assertions.assertNotNull(mAllChildren);\n    final int count = mAllChildrenCount;\n    final int size = children.length;\n    if (index == count) {\n      if (size == count) {\n        mAllChildren = new View[size + ARRAY_CAPACITY_INCREMENT];\n        System.arraycopy(children, 0, mAllChildren, 0, size);\n        children = mAllChildren;\n      }\n      children[mAllChildrenCount++] = child;\n    } else if (index < count) {\n      if (size == count) {\n        mAllChildren = new View[size + ARRAY_CAPACITY_INCREMENT];\n        System.arraycopy(children, 0, mAllChildren, 0, index);\n        System.arraycopy(children, index, mAllChildren, index + 1, count - index);\n        children = mAllChildren;\n      } else {\n        System.arraycopy(children, index, children, index + 1, count - index);\n      }\n      children[index] = child;\n      mAllChildrenCount++;\n    } else {\n      throw new IndexOutOfBoundsException(\"index=\" + index + \" count=\" + count);\n    }\n  }\n\n  // This method also sets the child's mParent to null\n  private void removeFromArray(int index) {\n    final View[] children = Assertions.assertNotNull(mAllChildren);\n    final int count = mAllChildrenCount;\n    if (index == count - 1) {\n      children[--mAllChildrenCount] = null;\n    } else if (index >= 0 && index < count) {\n      System.arraycopy(children, index + 1, children, index, count - index - 1);\n      children[--mAllChildrenCount] = null;\n    } else {\n      throw new IndexOutOfBoundsException();\n    }\n  }\n\n  @VisibleForTesting\n  public int getBackgroundColor() {\n    if (getBackground() != null) {\n      return ((ReactViewBackgroundDrawable) getBackground()).getColor();\n    }\n    return DEFAULT_BACKGROUND_COLOR;\n  }\n\n  private ReactViewBackgroundDrawable getOrCreateReactViewBackground() {\n    if (mReactBackgroundDrawable == null) {\n      mReactBackgroundDrawable = new ReactViewBackgroundDrawable(getContext());\n      Drawable backgroundDrawable = getBackground();\n      updateBackgroundDrawable(\n          null); // required so that drawable callback is cleared before we add the\n                                  // drawable back as a part of LayerDrawable\n      if (backgroundDrawable == null) {\n        updateBackgroundDrawable(mReactBackgroundDrawable);\n      } else {\n        LayerDrawable layerDrawable =\n            new LayerDrawable(new Drawable[] {mReactBackgroundDrawable, backgroundDrawable});\n        updateBackgroundDrawable(layerDrawable);\n      }\n\n      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {\n        mLayoutDirection =\n            I18nUtil.getInstance().isRTL(getContext())\n                ? LAYOUT_DIRECTION_RTL\n                : LAYOUT_DIRECTION_LTR;\n        mReactBackgroundDrawable.setResolvedLayoutDirection(mLayoutDirection);\n      }\n    }\n    return mReactBackgroundDrawable;\n  }\n\n  @Override\n  public @Nullable Rect getHitSlopRect() {\n    return mHitSlopRect;\n  }\n\n  public void setHitSlopRect(@Nullable Rect rect) {\n    mHitSlopRect = rect;\n  }\n\n  public void setOverflow(String overflow) {\n    mOverflow = overflow;\n    invalidate();\n  }\n\n  /**\n   * Set the background for the view or remove the background. It calls {@link\n   * #setBackground(Drawable)} or {@link #setBackgroundDrawable(Drawable)} based on the sdk version.\n   *\n   * @param drawable {@link Drawable} The Drawable to use as the background, or null to remove the\n   *     background\n   */\n  private void updateBackgroundDrawable(Drawable drawable) {\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n      super.setBackground(drawable);\n    } else {\n      super.setBackgroundDrawable(drawable);\n    }\n  }\n\n  @Override\n  protected void dispatchDraw(Canvas canvas) {\n    if (mOverflow != null) {\n      switch (mOverflow) {\n        case \"visible\":\n          if (mPath != null) {\n            mPath.rewind();\n          }\n          break;\n        case \"hidden\":\n          if (mReactBackgroundDrawable != null) {\n            float left = 0f;\n            float top = 0f;\n            float right = getWidth();\n            float bottom = getHeight();\n\n            final RectF borderWidth = mReactBackgroundDrawable.getDirectionAwareBorderInsets();\n\n            if (borderWidth.top > 0\n                || borderWidth.left > 0\n                || borderWidth.bottom > 0\n                || borderWidth.right > 0) {\n              left += borderWidth.left;\n              top += borderWidth.top;\n              right -= borderWidth.right;\n              bottom -= borderWidth.bottom;\n            }\n\n            final float borderRadius = mReactBackgroundDrawable.getFullBorderRadius();\n            float topLeftBorderRadius =\n                mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(\n                    borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_LEFT);\n            float topRightBorderRadius =\n                mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(\n                    borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_RIGHT);\n            float bottomLeftBorderRadius =\n                mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(\n                    borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_LEFT);\n            float bottomRightBorderRadius =\n                mReactBackgroundDrawable.getBorderRadiusOrDefaultTo(\n                    borderRadius, ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_RIGHT);\n\n            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {\n              final boolean isRTL = mLayoutDirection == View.LAYOUT_DIRECTION_RTL;\n              float topStartBorderRadius =\n                  mReactBackgroundDrawable.getBorderRadius(\n                      ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_START);\n              float topEndBorderRadius =\n                  mReactBackgroundDrawable.getBorderRadius(\n                      ReactViewBackgroundDrawable.BorderRadiusLocation.TOP_END);\n              float bottomStartBorderRadius =\n                  mReactBackgroundDrawable.getBorderRadius(\n                      ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_START);\n              float bottomEndBorderRadius =\n                  mReactBackgroundDrawable.getBorderRadius(\n                      ReactViewBackgroundDrawable.BorderRadiusLocation.BOTTOM_END);\n\n              if (I18nUtil.getInstance().doLeftAndRightSwapInRTL(getContext())) {\n                if (YogaConstants.isUndefined(topStartBorderRadius)) {\n                  topStartBorderRadius = topLeftBorderRadius;\n                }\n\n                if (YogaConstants.isUndefined(topEndBorderRadius)) {\n                  topEndBorderRadius = topRightBorderRadius;\n                }\n\n                if (YogaConstants.isUndefined(bottomStartBorderRadius)) {\n                  bottomStartBorderRadius = bottomLeftBorderRadius;\n                }\n\n                if (YogaConstants.isUndefined(bottomEndBorderRadius)) {\n                  bottomEndBorderRadius = bottomRightBorderRadius;\n                }\n\n                final float directionAwareTopLeftRadius =\n                    isRTL ? topEndBorderRadius : topStartBorderRadius;\n                final float directionAwareTopRightRadius =\n                    isRTL ? topStartBorderRadius : topEndBorderRadius;\n                final float directionAwareBottomLeftRadius =\n                    isRTL ? bottomEndBorderRadius : bottomStartBorderRadius;\n                final float directionAwareBottomRightRadius =\n                    isRTL ? bottomStartBorderRadius : bottomEndBorderRadius;\n\n                topLeftBorderRadius = directionAwareTopLeftRadius;\n                topRightBorderRadius = directionAwareTopRightRadius;\n                bottomLeftBorderRadius = directionAwareBottomLeftRadius;\n                bottomRightBorderRadius = directionAwareBottomRightRadius;\n              } else {\n                final float directionAwareTopLeftRadius =\n                    isRTL ? topEndBorderRadius : topStartBorderRadius;\n                final float directionAwareTopRightRadius =\n                    isRTL ? topStartBorderRadius : topEndBorderRadius;\n                final float directionAwareBottomLeftRadius =\n                    isRTL ? bottomEndBorderRadius : bottomStartBorderRadius;\n                final float directionAwareBottomRightRadius =\n                    isRTL ? bottomStartBorderRadius : bottomEndBorderRadius;\n\n                if (!YogaConstants.isUndefined(directionAwareTopLeftRadius)) {\n                  topLeftBorderRadius = directionAwareTopLeftRadius;\n                }\n\n                if (!YogaConstants.isUndefined(directionAwareTopRightRadius)) {\n                  topRightBorderRadius = directionAwareTopRightRadius;\n                }\n\n                if (!YogaConstants.isUndefined(directionAwareBottomLeftRadius)) {\n                  bottomLeftBorderRadius = directionAwareBottomLeftRadius;\n                }\n\n                if (!YogaConstants.isUndefined(directionAwareBottomRightRadius)) {\n                  bottomRightBorderRadius = directionAwareBottomRightRadius;\n                }\n              }\n            }\n\n            if (topLeftBorderRadius > 0\n                || topRightBorderRadius > 0\n                || bottomRightBorderRadius > 0\n                || bottomLeftBorderRadius > 0) {\n              if (mPath == null) {\n                mPath = new Path();\n              }\n\n              mPath.rewind();\n              mPath.addRoundRect(\n                  new RectF(left, top, right, bottom),\n                  new float[] {\n                    Math.max(topLeftBorderRadius - borderWidth.left, 0),\n                    Math.max(topLeftBorderRadius - borderWidth.top, 0),\n                    Math.max(topRightBorderRadius - borderWidth.right, 0),\n                    Math.max(topRightBorderRadius - borderWidth.top, 0),\n                    Math.max(bottomRightBorderRadius - borderWidth.right, 0),\n                    Math.max(bottomRightBorderRadius - borderWidth.bottom, 0),\n                    Math.max(bottomLeftBorderRadius - borderWidth.left, 0),\n                    Math.max(bottomLeftBorderRadius - borderWidth.bottom, 0),\n                  },\n                  Path.Direction.CW);\n              canvas.clipPath(mPath);\n            } else {\n              canvas.clipRect(new RectF(left, top, right, bottom));\n            }\n          }\n          break;\n        default:\n          break;\n      }\n    }\n    super.dispatchDraw(canvas);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.view;\n\nimport android.annotation.TargetApi;\nimport android.graphics.Rect;\nimport android.os.Build;\nimport android.view.View;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.common.annotations.VisibleForTesting;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.PointerEvents;\nimport com.facebook.react.uimanager.Spacing;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewGroupManager;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport com.facebook.yoga.YogaConstants;\nimport java.util.Locale;\nimport java.util.Map;\nimport javax.annotation.Nullable;\n\n/**\n * View manager for AndroidViews (plain React Views).\n */\n@ReactModule(name = ReactViewManager.REACT_CLASS)\npublic class ReactViewManager extends ViewGroupManager<ReactViewGroup> {\n\n  @VisibleForTesting\n  public static final String REACT_CLASS = ViewProps.VIEW_CLASS_NAME;\n\n  private static final int[] SPACING_TYPES = {\n    Spacing.ALL,\n    Spacing.LEFT,\n    Spacing.RIGHT,\n    Spacing.TOP,\n    Spacing.BOTTOM,\n    Spacing.START,\n    Spacing.END,\n  };\n  private static final int CMD_HOTSPOT_UPDATE = 1;\n  private static final int CMD_SET_PRESSED = 2;\n\n  @ReactProp(name = \"accessible\")\n  public void setAccessible(ReactViewGroup view, boolean accessible) {\n    view.setFocusable(accessible);\n  }\n\n  @ReactPropGroup(\n    names = {\n      ViewProps.BORDER_RADIUS,\n      ViewProps.BORDER_TOP_LEFT_RADIUS,\n      ViewProps.BORDER_TOP_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,\n      ViewProps.BORDER_BOTTOM_LEFT_RADIUS,\n      ViewProps.BORDER_TOP_START_RADIUS,\n      ViewProps.BORDER_TOP_END_RADIUS,\n      ViewProps.BORDER_BOTTOM_START_RADIUS,\n      ViewProps.BORDER_BOTTOM_END_RADIUS,\n    },\n    defaultFloat = YogaConstants.UNDEFINED\n  )\n  public void setBorderRadius(ReactViewGroup view, int index, float borderRadius) {\n    if (!YogaConstants.isUndefined(borderRadius) && borderRadius < 0) {\n      borderRadius = YogaConstants.UNDEFINED;\n    }\n\n    if (!YogaConstants.isUndefined(borderRadius)) {\n      borderRadius = PixelUtil.toPixelFromDIP(borderRadius);\n    }\n\n    if (index == 0) {\n      view.setBorderRadius(borderRadius);\n    } else {\n      view.setBorderRadius(borderRadius, index - 1);\n    }\n  }\n\n  @ReactProp(name = \"borderStyle\")\n  public void setBorderStyle(ReactViewGroup view, @Nullable String borderStyle) {\n    view.setBorderStyle(borderStyle);\n  }\n\n  @ReactProp(name = \"hitSlop\")\n  public void setHitSlop(final ReactViewGroup view, @Nullable ReadableMap hitSlop) {\n    if (hitSlop == null) {\n      view.setHitSlopRect(null);\n    } else {\n      view.setHitSlopRect(new Rect(\n          hitSlop.hasKey(\"left\") ? (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"left\")) : 0,\n          hitSlop.hasKey(\"top\") ? (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"top\")) : 0,\n          hitSlop.hasKey(\"right\") ? (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"right\")) : 0,\n          hitSlop.hasKey(\"bottom\") ? (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble(\"bottom\")) : 0\n      ));\n    }\n  }\n\n  @ReactProp(name = ViewProps.POINTER_EVENTS)\n  public void setPointerEvents(ReactViewGroup view, @Nullable String pointerEventsStr) {\n    if (pointerEventsStr == null) {\n      view.setPointerEvents(PointerEvents.AUTO);\n    } else {\n      PointerEvents pointerEvents =\n          PointerEvents.valueOf(pointerEventsStr.toUpperCase(Locale.US).replace(\"-\", \"_\"));\n      view.setPointerEvents(pointerEvents);\n    }\n  }\n\n  @ReactProp(name = \"nativeBackgroundAndroid\")\n  public void setNativeBackground(ReactViewGroup view, @Nullable ReadableMap bg) {\n    view.setTranslucentBackgroundDrawable(bg == null ?\n            null : ReactDrawableHelper.createDrawableFromJSDescription(view.getContext(), bg));\n  }\n\n  @TargetApi(Build.VERSION_CODES.M)\n  @ReactProp(name = \"nativeForegroundAndroid\")\n  public void setNativeForeground(ReactViewGroup view, @Nullable ReadableMap fg) {\n    view.setForeground(fg == null\n        ? null\n        : ReactDrawableHelper.createDrawableFromJSDescription(view.getContext(), fg));\n  }\n\n  @ReactProp(name = com.facebook.react.uimanager.ReactClippingViewGroupHelper.PROP_REMOVE_CLIPPED_SUBVIEWS)\n  public void setRemoveClippedSubviews(ReactViewGroup view, boolean removeClippedSubviews) {\n    view.setRemoveClippedSubviews(removeClippedSubviews);\n  }\n\n  @ReactProp(name = ViewProps.NEEDS_OFFSCREEN_ALPHA_COMPOSITING)\n  public void setNeedsOffscreenAlphaCompositing(\n      ReactViewGroup view,\n      boolean needsOffscreenAlphaCompositing) {\n    view.setNeedsOffscreenAlphaCompositing(needsOffscreenAlphaCompositing);\n  }\n\n  @ReactPropGroup(\n    names = {\n      ViewProps.BORDER_WIDTH,\n      ViewProps.BORDER_LEFT_WIDTH,\n      ViewProps.BORDER_RIGHT_WIDTH,\n      ViewProps.BORDER_TOP_WIDTH,\n      ViewProps.BORDER_BOTTOM_WIDTH,\n      ViewProps.BORDER_START_WIDTH,\n      ViewProps.BORDER_END_WIDTH,\n    },\n    defaultFloat = YogaConstants.UNDEFINED\n  )\n  public void setBorderWidth(ReactViewGroup view, int index, float width) {\n    if (!YogaConstants.isUndefined(width) && width < 0) {\n      width = YogaConstants.UNDEFINED;\n    }\n\n    if (!YogaConstants.isUndefined(width)) {\n      width = PixelUtil.toPixelFromDIP(width);\n    }\n\n    view.setBorderWidth(SPACING_TYPES[index], width);\n  }\n\n  @ReactPropGroup(\n    names = {\n      ViewProps.BORDER_COLOR,\n      ViewProps.BORDER_LEFT_COLOR,\n      ViewProps.BORDER_RIGHT_COLOR,\n      ViewProps.BORDER_TOP_COLOR,\n      ViewProps.BORDER_BOTTOM_COLOR,\n      ViewProps.BORDER_START_COLOR,\n      ViewProps.BORDER_END_COLOR\n    },\n    customType = \"Color\"\n  )\n  public void setBorderColor(ReactViewGroup view, int index, Integer color) {\n    float rgbComponent = color == null ? YogaConstants.UNDEFINED : (float) ((int)color & 0x00FFFFFF);\n    float alphaComponent = color == null ? YogaConstants.UNDEFINED : (float) ((int)color >>> 24);\n    view.setBorderColor(SPACING_TYPES[index], rgbComponent, alphaComponent);\n  }\n\n  @ReactProp(name = ViewProps.COLLAPSABLE)\n  public void setCollapsable(ReactViewGroup view, boolean collapsable) {\n    // no-op: it's here only so that \"collapsable\" property is exported to JS. The value is actually\n    // handled in NativeViewHierarchyOptimizer\n  }\n\n  @ReactProp(name = ViewProps.OVERFLOW)\n  public void setOverflow(ReactViewGroup view, String overflow) {\n    view.setOverflow(overflow);\n  }\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  public ReactViewGroup createViewInstance(ThemedReactContext context) {\n    return new ReactViewGroup(context);\n  }\n\n  @Override\n  public Map<String, Integer> getCommandsMap() {\n    return MapBuilder.of(\"hotspotUpdate\", CMD_HOTSPOT_UPDATE, \"setPressed\", CMD_SET_PRESSED);\n  }\n\n  @Override\n  public void receiveCommand(ReactViewGroup root, int commandId, @Nullable ReadableArray args) {\n    switch (commandId) {\n      case CMD_HOTSPOT_UPDATE: {\n        if (args == null || args.size() != 2) {\n          throw new JSApplicationIllegalArgumentException(\n              \"Illegal number of arguments for 'updateHotspot' command\");\n        }\n        if (Build.VERSION.SDK_INT >= 21) {\n          float x = PixelUtil.toPixelFromDIP(args.getDouble(0));\n          float y = PixelUtil.toPixelFromDIP(args.getDouble(1));\n          root.drawableHotspotChanged(x, y);\n        }\n        break;\n      }\n      case CMD_SET_PRESSED: {\n        if (args == null || args.size() != 1) {\n          throw new JSApplicationIllegalArgumentException(\n              \"Illegal number of arguments for 'setPressed' command\");\n        }\n        root.setPressed(args.getBoolean(0));\n        break;\n      }\n    }\n  }\n\n  @Override\n  public void addView(ReactViewGroup parent, View child, int index) {\n    boolean removeClippedSubviews = parent.getRemoveClippedSubviews();\n    if (removeClippedSubviews) {\n      parent.addViewWithSubviewClippingEnabled(child, index);\n    } else {\n      parent.addView(child, index);\n    }\n  }\n\n  @Override\n  public int getChildCount(ReactViewGroup parent) {\n    boolean removeClippedSubviews = parent.getRemoveClippedSubviews();\n    if (removeClippedSubviews) {\n      return parent.getAllChildrenCount();\n    } else {\n      return parent.getChildCount();\n    }\n  }\n\n  @Override\n  public View getChildAt(ReactViewGroup parent, int index) {\n    boolean removeClippedSubviews = parent.getRemoveClippedSubviews();\n    if (removeClippedSubviews) {\n      return parent.getChildAtWithSubviewClippingEnabled(index);\n    } else {\n      return parent.getChildAt(index);\n    }\n  }\n\n  @Override\n  public void removeViewAt(ReactViewGroup parent, int index) {\n    boolean removeClippedSubviews = parent.getRemoveClippedSubviews();\n    if (removeClippedSubviews) {\n      View child = getChildAt(parent, index);\n      if (child.getParent() != null) {\n        parent.removeView(child);\n      }\n      parent.removeViewWithSubviewClippingEnabled(child);\n    } else {\n      parent.removeViewAt(index);\n    }\n  }\n\n  @Override\n  public void removeAllViews(ReactViewGroup parent) {\n    boolean removeClippedSubviews = parent.getRemoveClippedSubviews();\n    if (removeClippedSubviews) {\n      parent.removeAllViewsWithSubviewClippingEnabled();\n    } else {\n      parent.removeAllViews();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/viewpager/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"viewpager\",\n    srcs = glob([\"**/*.java\"]),\n    provided_deps = [\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n    ],\n    required_for_source_only_abi = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/infer-annotations:infer-annotations\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/scroll:scroll\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/viewpager/PageScrollEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.viewpager;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by {@link ReactViewPager} when user scrolls between pages (or when animating\n * between pages).\n *\n * Additional data provided by this event:\n *  - position - index of first page from the left that is currently visible\n *  - offset - value from range [0,1) describing stage between page transitions. Value x means that\n *    (1 - x) fraction of the page at \"position\" index is visible, and x fraction of the next page\n *    is visible.\n */\n/* package */ class PageScrollEvent extends Event<PageScrollEvent> {\n\n  public static final String EVENT_NAME = \"topPageScroll\";\n\n  private final int mPosition;\n  private final float mOffset;\n\n  protected PageScrollEvent(int viewTag, int position, float offset) {\n    super(viewTag);\n    mPosition = position;\n\n    // folly::toJson default options don't support serialize NaN or Infinite value\n    mOffset = (Float.isInfinite(offset) || Float.isNaN(offset))\n      ? 0.0f : offset;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putInt(\"position\", mPosition);\n    eventData.putDouble(\"offset\", mOffset);\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/viewpager/PageScrollStateChangedEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.viewpager;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by {@link ReactViewPager} when user scrolling state changed.\n *\n * Additional data provided by this event:\n *  - pageScrollState - {Idle,Dragging,Settling}\n */\nclass PageScrollStateChangedEvent extends Event<PageScrollStateChangedEvent> {\n\n  public static final String EVENT_NAME = \"topPageScrollStateChanged\";\n\n  private final String mPageScrollState;\n\n  protected PageScrollStateChangedEvent(int viewTag, String pageScrollState) {\n    super(viewTag);\n    mPageScrollState = pageScrollState;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putString(\"pageScrollState\", mPageScrollState);\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/viewpager/PageSelectedEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.viewpager;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted by {@link ReactViewPager} when selected page changes.\n *\n * Additional data provided by this event:\n *  - position - index of page that has been selected\n */\n/* package */ class PageSelectedEvent extends Event<PageSelectedEvent> {\n\n  public static final String EVENT_NAME = \"topPageSelected\";\n\n  private final int mPosition;\n\n  protected PageSelectedEvent(int viewTag, int position) {\n    super(viewTag);\n    mPosition = position;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());\n  }\n\n  private WritableMap serializeEventData() {\n    WritableMap eventData = Arguments.createMap();\n    eventData.putInt(\"position\", mPosition);\n    return eventData;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/viewpager/ReactViewPager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.viewpager;\n\nimport android.support.v4.view.PagerAdapter;\nimport android.support.v4.view.ViewPager;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.uimanager.events.NativeGestureUtil;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Wrapper view for {@link ViewPager}. It's forwarding calls to {@link ViewGroup#addView} to add\n * views to custom {@link PagerAdapter} instance which is used by {@link NativeViewHierarchyManager}\n * to add children nodes according to react views hierarchy.\n */\npublic class ReactViewPager extends ViewPager {\n\n  private class Adapter extends PagerAdapter {\n\n    private final List<View> mViews = new ArrayList<>();\n    private boolean mIsViewPagerInIntentionallyInconsistentState = false;\n\n    void addView(View child, int index) {\n      mViews.add(index, child);\n      notifyDataSetChanged();\n      // This will prevent view pager from detaching views for pages that are not currently selected\n      // We need to do that since {@link ViewPager} relies on layout passes to position those views\n      // in a right way (also thanks to {@link ReactViewPagerManager#needsCustomLayoutForChildren}\n      // returning {@code true}). Currently we only call {@link View#measure} and\n      // {@link View#layout} after yoga step.\n\n      // TODO(7323049): Remove this workaround once we figure out a way to re-layout some views on\n      // request\n      setOffscreenPageLimit(mViews.size());\n    }\n\n    void removeViewAt(int index) {\n      mViews.remove(index);\n      notifyDataSetChanged();\n\n      // TODO(7323049): Remove this workaround once we figure out a way to re-layout some views on\n      // request\n      setOffscreenPageLimit(mViews.size());\n    }\n\n    /**\n     * Replace a set of views to the ViewPager adapter and update the ViewPager\n     */\n    void setViews(List<View> views) {\n      mViews.clear();\n      mViews.addAll(views);\n      notifyDataSetChanged();\n\n      // we want to make sure we return POSITION_NONE for every view here, since this is only\n      // called after a removeAllViewsFromAdapter\n      mIsViewPagerInIntentionallyInconsistentState = false;\n    }\n\n    /**\n     * Remove all the views from the adapter and de-parents them from the ViewPager\n     * After calling this, it is expected that notifyDataSetChanged should be called soon\n     * afterwards.\n     */\n    void removeAllViewsFromAdapter(ViewPager pager) {\n      mViews.clear();\n      pager.removeAllViews();\n      // set this, so that when the next addViews is called, we return POSITION_NONE for every\n      // entry so we can remove whichever views we need to and add the ones that we need to.\n      mIsViewPagerInIntentionallyInconsistentState = true;\n    }\n\n    View getViewAt(int index) {\n      return mViews.get(index);\n    }\n\n    @Override\n    public int getCount() {\n      return mViews.size();\n    }\n\n    @Override\n    public int getItemPosition(Object object) {\n      // if we've removed all views, we want to return POSITION_NONE intentionally\n      return mIsViewPagerInIntentionallyInconsistentState || !mViews.contains(object) ?\n        POSITION_NONE : mViews.indexOf(object);\n    }\n\n    @Override\n    public Object instantiateItem(ViewGroup container, int position) {\n      View view = mViews.get(position);\n      container.addView(view, 0, generateDefaultLayoutParams());\n      return view;\n    }\n\n    @Override\n    public void destroyItem(ViewGroup container, int position, Object object) {\n      container.removeView((View) object);\n    }\n\n    @Override\n    public boolean isViewFromObject(View view, Object object) {\n      return view == object;\n    }\n  }\n\n  private class PageChangeListener implements ViewPager.OnPageChangeListener {\n\n    @Override\n    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n      mEventDispatcher.dispatchEvent(\n          new PageScrollEvent(getId(), position, positionOffset));\n    }\n\n    @Override\n    public void onPageSelected(int position) {\n      if (!mIsCurrentItemFromJs) {\n        mEventDispatcher.dispatchEvent(\n            new PageSelectedEvent(getId(), position));\n      }\n    }\n\n    @Override\n    public void onPageScrollStateChanged(int state) {\n      String pageScrollState;\n      switch (state) {\n        case SCROLL_STATE_IDLE:\n          pageScrollState = \"idle\";\n          break;\n        case SCROLL_STATE_DRAGGING:\n          pageScrollState = \"dragging\";\n          break;\n        case SCROLL_STATE_SETTLING:\n          pageScrollState = \"settling\";\n          break;\n        default:\n          throw new IllegalStateException(\"Unsupported pageScrollState\");\n      }\n      mEventDispatcher.dispatchEvent(\n        new PageScrollStateChangedEvent(getId(), pageScrollState));\n    }\n  }\n\n  private final EventDispatcher mEventDispatcher;\n  private boolean mIsCurrentItemFromJs;\n  private boolean mScrollEnabled = true;\n\n  public ReactViewPager(ReactContext reactContext) {\n    super(reactContext);\n    mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n    mIsCurrentItemFromJs = false;\n    setOnPageChangeListener(new PageChangeListener());\n    setAdapter(new Adapter());\n  }\n\n  @Override\n  public Adapter getAdapter() {\n    return (Adapter) super.getAdapter();\n  }\n\n  @Override\n  public boolean onInterceptTouchEvent(MotionEvent ev) {\n    if (!mScrollEnabled) {\n      return false;\n    }\n\n    if (super.onInterceptTouchEvent(ev)) {\n      NativeGestureUtil.notifyNativeGestureStarted(this, ev);\n      return true;\n    }\n    return false;\n  }\n\n  @Override\n  public boolean onTouchEvent(MotionEvent ev) {\n    if (!mScrollEnabled) {\n      return false;\n    }\n\n    return super.onTouchEvent(ev);\n  }\n\n  public void setCurrentItemFromJs(int item, boolean animated) {\n    mIsCurrentItemFromJs = true;\n    setCurrentItem(item, animated);\n    mIsCurrentItemFromJs = false;\n  }\n\n  public void setScrollEnabled(boolean scrollEnabled) {\n    mScrollEnabled = scrollEnabled;\n  }\n\n  /*package*/ void addViewToAdapter(View child, int index) {\n    getAdapter().addView(child, index);\n  }\n\n  /*package*/ void removeViewFromAdapter(int index) {\n    getAdapter().removeViewAt(index);\n  }\n\n  /*package*/ int getViewCountInAdapter() {\n    return getAdapter().getCount();\n  }\n\n  /*package*/ View getViewFromAdapter(int index) {\n    return getAdapter().getViewAt(index);\n  }\n\n  public void setViews(List<View> views) {\n    getAdapter().setViews(views);\n  }\n\n  public void removeAllViewsFromAdapter() {\n    getAdapter().removeAllViewsFromAdapter(this);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/viewpager/ReactViewPagerManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.viewpager;\n\nimport java.util.Map;\n\nimport android.view.View;\n\nimport com.facebook.infer.annotation.Assertions;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.PixelUtil;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.ViewGroupManager;\nimport com.facebook.react.uimanager.annotations.ReactProp;\n\nimport javax.annotation.Nullable;\n\n/**\n * Instance of {@link ViewManager} that provides native {@link ViewPager} view.\n */\n@ReactModule(name = ReactViewPagerManager.REACT_CLASS)\npublic class ReactViewPagerManager extends ViewGroupManager<ReactViewPager> {\n\n  protected static final String REACT_CLASS = \"AndroidViewPager\";\n\n  public static final int COMMAND_SET_PAGE = 1;\n  public static final int COMMAND_SET_PAGE_WITHOUT_ANIMATION = 2;\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  @Override\n  protected ReactViewPager createViewInstance(ThemedReactContext reactContext) {\n    return new ReactViewPager(reactContext);\n  }\n\n  @ReactProp(name = \"scrollEnabled\", defaultBoolean = true)\n  public void setScrollEnabled(ReactViewPager viewPager, boolean value) {\n    viewPager.setScrollEnabled(value);\n  }\n\n  @Override\n  public boolean needsCustomLayoutForChildren() {\n    return true;\n  }\n\n  @Override\n  public Map getExportedCustomDirectEventTypeConstants() {\n    return MapBuilder.of(\n        PageScrollEvent.EVENT_NAME, MapBuilder.of(\"registrationName\", \"onPageScroll\"),\n        PageScrollStateChangedEvent.EVENT_NAME, MapBuilder.of(\"registrationName\", \"onPageScrollStateChanged\"),\n        PageSelectedEvent.EVENT_NAME, MapBuilder.of(\"registrationName\", \"onPageSelected\"));\n  }\n\n  @Override\n  public Map<String,Integer> getCommandsMap() {\n    return MapBuilder.of(\n        \"setPage\",\n        COMMAND_SET_PAGE,\n        \"setPageWithoutAnimation\",\n        COMMAND_SET_PAGE_WITHOUT_ANIMATION);\n  }\n\n  @Override\n  public void receiveCommand(\n      ReactViewPager viewPager,\n      int commandType,\n      @Nullable ReadableArray args) {\n    Assertions.assertNotNull(viewPager);\n    Assertions.assertNotNull(args);\n    switch (commandType) {\n      case COMMAND_SET_PAGE: {\n        viewPager.setCurrentItemFromJs(args.getInt(0), true);\n        return;\n      }\n      case COMMAND_SET_PAGE_WITHOUT_ANIMATION: {\n        viewPager.setCurrentItemFromJs(args.getInt(0), false);\n        return;\n      }\n      default:\n        throw new IllegalArgumentException(String.format(\n            \"Unsupported command %d received by %s.\",\n            commandType,\n            getClass().getSimpleName()));\n    }\n  }\n\n  @Override\n  public void addView(ReactViewPager parent, View child, int index) {\n    parent.addViewToAdapter(child, index);\n  }\n\n  @Override\n  public int getChildCount(ReactViewPager parent) {\n    return parent.getViewCountInAdapter();\n  }\n\n  @Override\n  public View getChildAt(ReactViewPager parent, int index) {\n    return parent.getViewFromAdapter(index);\n  }\n\n  @Override\n  public void removeViewAt(ReactViewPager parent, int index) {\n    parent.removeViewFromAdapter(index);\n  }\n\n  @ReactProp(name = \"pageMargin\", defaultFloat = 0)\n  public void setPageMargin(ReactViewPager pager, float margin) {\n    pager.setPageMargin((int) PixelUtil.toPixelFromDIP(margin));\n  }\n\n  @ReactProp(name = \"peekEnabled\", defaultBoolean = false)\n  public void setPeekEnabled(ReactViewPager pager, boolean peekEnabled) {\n    pager.setClipToPadding(!peekEnabled);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/webview/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"webview\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/module/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.webview;\n\nimport javax.annotation.Nullable;\n\nimport java.io.UnsupportedEncodingException;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Locale;\nimport java.util.Map;\n\nimport android.content.ActivityNotFoundException;\nimport android.content.Intent;\nimport android.graphics.Bitmap;\nimport android.graphics.Picture;\nimport android.net.Uri;\nimport android.os.Build;\nimport android.text.TextUtils;\nimport android.view.ViewGroup.LayoutParams;\nimport android.webkit.ConsoleMessage;\nimport android.webkit.GeolocationPermissions;\nimport android.webkit.WebChromeClient;\nimport android.webkit.WebView;\nimport android.webkit.WebViewClient;\nimport android.webkit.JavascriptInterface;\nimport android.webkit.ValueCallback;\nimport android.webkit.WebSettings;\nimport android.webkit.CookieManager;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.react.common.ReactConstants;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.LifecycleEventListener;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.bridge.ReadableMapKeySetIterator;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.common.build.ReactBuildConfig;\nimport com.facebook.react.module.annotations.ReactModule;\nimport com.facebook.react.uimanager.SimpleViewManager;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.events.ContentSizeChangeEvent;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.views.webview.events.TopLoadingErrorEvent;\nimport com.facebook.react.views.webview.events.TopLoadingFinishEvent;\nimport com.facebook.react.views.webview.events.TopLoadingStartEvent;\nimport com.facebook.react.views.webview.events.TopMessageEvent;\n\nimport org.json.JSONObject;\nimport org.json.JSONException;\n\n/**\n * Manages instances of {@link WebView}\n *\n * Can accept following commands:\n *  - GO_BACK\n *  - GO_FORWARD\n *  - RELOAD\n *\n * {@link WebView} instances could emit following direct events:\n *  - topLoadingFinish\n *  - topLoadingStart\n *  - topLoadingError\n *\n * Each event will carry the following properties:\n *  - target - view's react tag\n *  - url - url set for the webview\n *  - loading - whether webview is in a loading state\n *  - title - title of the current page\n *  - canGoBack - boolean, whether there is anything on a history stack to go back\n *  - canGoForward - boolean, whether it is possible to request GO_FORWARD command\n */\n@ReactModule(name = ReactWebViewManager.REACT_CLASS)\npublic class ReactWebViewManager extends SimpleViewManager<WebView> {\n\n  protected static final String REACT_CLASS = \"RCTWebView\";\n\n  protected static final String HTML_ENCODING = \"UTF-8\";\n  protected static final String HTML_MIME_TYPE = \"text/html\";\n  protected static final String BRIDGE_NAME = \"__REACT_WEB_VIEW_BRIDGE\";\n\n  protected static final String HTTP_METHOD_POST = \"POST\";\n\n  public static final int COMMAND_GO_BACK = 1;\n  public static final int COMMAND_GO_FORWARD = 2;\n  public static final int COMMAND_RELOAD = 3;\n  public static final int COMMAND_STOP_LOADING = 4;\n  public static final int COMMAND_POST_MESSAGE = 5;\n  public static final int COMMAND_INJECT_JAVASCRIPT = 6;\n\n  // Use `webView.loadUrl(\"about:blank\")` to reliably reset the view\n  // state and release page resources (including any running JavaScript).\n  protected static final String BLANK_URL = \"about:blank\";\n\n  protected WebViewConfig mWebViewConfig;\n  protected @Nullable WebView.PictureListener mPictureListener;\n\n  protected static class ReactWebViewClient extends WebViewClient {\n\n    protected boolean mLastLoadFailed = false;\n    protected @Nullable ReadableArray mUrlPrefixesForDefaultIntent;\n\n    @Override\n    public void onPageFinished(WebView webView, String url) {\n      super.onPageFinished(webView, url);\n\n      if (!mLastLoadFailed) {\n        ReactWebView reactWebView = (ReactWebView) webView;\n        reactWebView.callInjectedJavaScript();\n        reactWebView.linkBridge();\n        emitFinishEvent(webView, url);\n      }\n    }\n\n    @Override\n    public void onPageStarted(WebView webView, String url, Bitmap favicon) {\n      super.onPageStarted(webView, url, favicon);\n      mLastLoadFailed = false;\n\n      dispatchEvent(\n          webView,\n          new TopLoadingStartEvent(\n              webView.getId(),\n              createWebViewEvent(webView, url)));\n    }\n\n    @Override\n    public boolean shouldOverrideUrlLoading(WebView view, String url) {\n        boolean useDefaultIntent = false;\n        if (mUrlPrefixesForDefaultIntent != null && mUrlPrefixesForDefaultIntent.size() > 0) {\n          ArrayList<Object> urlPrefixesForDefaultIntent =\n              mUrlPrefixesForDefaultIntent.toArrayList();\n          for (Object urlPrefix : urlPrefixesForDefaultIntent) {\n            if (url.startsWith((String) urlPrefix)) {\n              useDefaultIntent = true;\n              break;\n            }\n          }\n        }\n\n        if (!useDefaultIntent &&\n            (url.startsWith(\"http://\") || url.startsWith(\"https://\") ||\n            url.startsWith(\"file://\") || url.equals(\"about:blank\"))) {\n          return false;\n        } else {\n          try {\n            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));\n            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n            view.getContext().startActivity(intent);\n          } catch (ActivityNotFoundException e) {\n            FLog.w(ReactConstants.TAG, \"activity not found to handle uri scheme for: \" + url, e);\n          }\n          return true;\n        }\n    }\n\n    @Override\n    public void onReceivedError(\n        WebView webView,\n        int errorCode,\n        String description,\n        String failingUrl) {\n      super.onReceivedError(webView, errorCode, description, failingUrl);\n      mLastLoadFailed = true;\n\n      // In case of an error JS side expect to get a finish event first, and then get an error event\n      // Android WebView does it in the opposite way, so we need to simulate that behavior\n      emitFinishEvent(webView, failingUrl);\n\n      WritableMap eventData = createWebViewEvent(webView, failingUrl);\n      eventData.putDouble(\"code\", errorCode);\n      eventData.putString(\"description\", description);\n\n      dispatchEvent(\n          webView,\n          new TopLoadingErrorEvent(webView.getId(), eventData));\n    }\n\n    protected void emitFinishEvent(WebView webView, String url) {\n      dispatchEvent(\n          webView,\n          new TopLoadingFinishEvent(\n              webView.getId(),\n              createWebViewEvent(webView, url)));\n    }\n\n    protected WritableMap createWebViewEvent(WebView webView, String url) {\n      WritableMap event = Arguments.createMap();\n      event.putDouble(\"target\", webView.getId());\n      // Don't use webView.getUrl() here, the URL isn't updated to the new value yet in callbacks\n      // like onPageFinished\n      event.putString(\"url\", url);\n      event.putBoolean(\"loading\", !mLastLoadFailed && webView.getProgress() != 100);\n      event.putString(\"title\", webView.getTitle());\n      event.putBoolean(\"canGoBack\", webView.canGoBack());\n      event.putBoolean(\"canGoForward\", webView.canGoForward());\n      return event;\n    }\n\n    public void setUrlPrefixesForDefaultIntent(ReadableArray specialUrls) {\n      mUrlPrefixesForDefaultIntent = specialUrls;\n    }\n  }\n\n  /**\n   * Subclass of {@link WebView} that implements {@link LifecycleEventListener} interface in order\n   * to call {@link WebView#destroy} on activity destroy event and also to clear the client\n   */\n  protected static class ReactWebView extends WebView implements LifecycleEventListener {\n    protected @Nullable String injectedJS;\n    protected boolean messagingEnabled = false;\n    protected @Nullable ReactWebViewClient mReactWebViewClient;\n\n    protected class ReactWebViewBridge {\n      ReactWebView mContext;\n\n      ReactWebViewBridge(ReactWebView c) {\n        mContext = c;\n      }\n\n      @JavascriptInterface\n      public void postMessage(String message) {\n        mContext.onMessage(message);\n      }\n    }\n\n    /**\n     * WebView must be created with an context of the current activity\n     *\n     * Activity Context is required for creation of dialogs internally by WebView\n     * Reactive Native needed for access to ReactNative internal system functionality\n     *\n     */\n    public ReactWebView(ThemedReactContext reactContext) {\n      super(reactContext);\n    }\n\n    @Override\n    public void onHostResume() {\n      // do nothing\n    }\n\n    @Override\n    public void onHostPause() {\n      // do nothing\n    }\n\n    @Override\n    public void onHostDestroy() {\n      cleanupCallbacksAndDestroy();\n    }\n\n    @Override\n    public void setWebViewClient(WebViewClient client) {\n      super.setWebViewClient(client);\n      mReactWebViewClient = (ReactWebViewClient)client;\n    }\n\n    public @Nullable ReactWebViewClient getReactWebViewClient() {\n      return mReactWebViewClient;\n    }\n\n    public void setInjectedJavaScript(@Nullable String js) {\n      injectedJS = js;\n    }\n\n    protected ReactWebViewBridge createReactWebViewBridge(ReactWebView webView) {\n      return new ReactWebViewBridge(webView);\n    }\n\n    public void setMessagingEnabled(boolean enabled) {\n      if (messagingEnabled == enabled) {\n        return;\n      }\n\n      messagingEnabled = enabled;\n      if (enabled) {\n        addJavascriptInterface(createReactWebViewBridge(this), BRIDGE_NAME);\n        linkBridge();\n      } else {\n        removeJavascriptInterface(BRIDGE_NAME);\n      }\n    }\n\n    public void callInjectedJavaScript() {\n      if (getSettings().getJavaScriptEnabled() &&\n          injectedJS != null &&\n          !TextUtils.isEmpty(injectedJS)) {\n        loadUrl(\"javascript:(function() {\\n\" + injectedJS + \";\\n})();\");\n      }\n    }\n\n    public void linkBridge() {\n      if (messagingEnabled) {\n        if (ReactBuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n          // See isNative in lodash\n          String testPostMessageNative = \"String(window.postMessage) === String(Object.hasOwnProperty).replace('hasOwnProperty', 'postMessage')\";\n          evaluateJavascript(testPostMessageNative, new ValueCallback<String>() {\n            @Override\n            public void onReceiveValue(String value) {\n              if (value.equals(\"true\")) {\n                FLog.w(ReactConstants.TAG, \"Setting onMessage on a WebView overrides existing values of window.postMessage, but a previous value was defined\");\n              }\n            }\n          });\n        }\n\n        loadUrl(\"javascript:(\" +\n          \"window.originalPostMessage = window.postMessage,\" +\n          \"window.postMessage = function(data) {\" +\n            BRIDGE_NAME + \".postMessage(String(data));\" +\n          \"}\" +\n        \")\");\n      }\n    }\n\n    public void onMessage(String message) {\n      dispatchEvent(this, new TopMessageEvent(this.getId(), message));\n    }\n\n    protected void cleanupCallbacksAndDestroy() {\n      setWebViewClient(null);\n      destroy();\n    }\n  }\n\n  public ReactWebViewManager() {\n    mWebViewConfig = new WebViewConfig() {\n      public void configWebView(WebView webView) {\n      }\n    };\n  }\n\n  public ReactWebViewManager(WebViewConfig webViewConfig) {\n    mWebViewConfig = webViewConfig;\n  }\n\n  @Override\n  public String getName() {\n    return REACT_CLASS;\n  }\n\n  protected ReactWebView createReactWebViewInstance(ThemedReactContext reactContext) {\n    return new ReactWebView(reactContext);\n  }\n\n  @Override\n  protected WebView createViewInstance(ThemedReactContext reactContext) {\n    ReactWebView webView = createReactWebViewInstance(reactContext);\n    webView.setWebChromeClient(new WebChromeClient() {\n      @Override\n      public boolean onConsoleMessage(ConsoleMessage message) {\n        if (ReactBuildConfig.DEBUG) {\n          return super.onConsoleMessage(message);\n        }\n        // Ignore console logs in non debug builds.\n        return true;\n      }\n\n      @Override\n      public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {\n        callback.invoke(origin, true, false);\n      }\n    });\n    reactContext.addLifecycleEventListener(webView);\n    mWebViewConfig.configWebView(webView);\n    webView.getSettings().setBuiltInZoomControls(true);\n    webView.getSettings().setDisplayZoomControls(false);\n    webView.getSettings().setDomStorageEnabled(true);\n\n    // Fixes broken full-screen modals/galleries due to body height being 0.\n    webView.setLayoutParams(\n            new LayoutParams(LayoutParams.MATCH_PARENT,\n                LayoutParams.MATCH_PARENT));\n\n    if (ReactBuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n      WebView.setWebContentsDebuggingEnabled(true);\n    }\n\n    return webView;\n  }\n\n  @ReactProp(name = \"javaScriptEnabled\")\n  public void setJavaScriptEnabled(WebView view, boolean enabled) {\n    view.getSettings().setJavaScriptEnabled(enabled);\n  }\n\n  @ReactProp(name = \"thirdPartyCookiesEnabled\")\n  public void setThirdPartyCookiesEnabled(WebView view, boolean enabled) {\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n      CookieManager.getInstance().setAcceptThirdPartyCookies(view, enabled);\n    }\n  }\n\n  @ReactProp(name = \"scalesPageToFit\")\n  public void setScalesPageToFit(WebView view, boolean enabled) {\n    view.getSettings().setUseWideViewPort(!enabled);\n  }\n\n  @ReactProp(name = \"domStorageEnabled\")\n  public void setDomStorageEnabled(WebView view, boolean enabled) {\n    view.getSettings().setDomStorageEnabled(enabled);\n  }\n\n  @ReactProp(name = \"userAgent\")\n  public void setUserAgent(WebView view, @Nullable String userAgent) {\n    if (userAgent != null) {\n      // TODO(8496850): Fix incorrect behavior when property is unset (uA == null)\n      view.getSettings().setUserAgentString(userAgent);\n    }\n  }\n\n  @ReactProp(name = \"mediaPlaybackRequiresUserAction\")\n  public void setMediaPlaybackRequiresUserAction(WebView view, boolean requires) {\n    view.getSettings().setMediaPlaybackRequiresUserGesture(requires);\n  }\n\n  @ReactProp(name = \"allowUniversalAccessFromFileURLs\")\n  public void setAllowUniversalAccessFromFileURLs(WebView view, boolean allow) {\n    view.getSettings().setAllowUniversalAccessFromFileURLs(allow);\n  }\n\n  @ReactProp(name = \"saveFormDataDisabled\")\n  public void setSaveFormDataDisabled(WebView view, boolean disable) {\n    view.getSettings().setSaveFormData(!disable);\n  }\n\n  @ReactProp(name = \"injectedJavaScript\")\n  public void setInjectedJavaScript(WebView view, @Nullable String injectedJavaScript) {\n    ((ReactWebView) view).setInjectedJavaScript(injectedJavaScript);\n  }\n\n  @ReactProp(name = \"messagingEnabled\")\n  public void setMessagingEnabled(WebView view, boolean enabled) {\n    ((ReactWebView) view).setMessagingEnabled(enabled);\n  }\n\n  @ReactProp(name = \"source\")\n  public void setSource(WebView view, @Nullable ReadableMap source) {\n    if (source != null) {\n      if (source.hasKey(\"html\")) {\n        String html = source.getString(\"html\");\n        if (source.hasKey(\"baseUrl\")) {\n          view.loadDataWithBaseURL(\n              source.getString(\"baseUrl\"), html, HTML_MIME_TYPE, HTML_ENCODING, null);\n        } else {\n          view.loadData(html, HTML_MIME_TYPE, HTML_ENCODING);\n        }\n        return;\n      }\n      if (source.hasKey(\"uri\")) {\n        String url = source.getString(\"uri\");\n        String previousUrl = view.getUrl();\n        if (previousUrl != null && previousUrl.equals(url)) {\n          return;\n        }\n        if (source.hasKey(\"method\")) {\n          String method = source.getString(\"method\");\n          if (method.equals(HTTP_METHOD_POST)) {\n            byte[] postData = null;\n            if (source.hasKey(\"body\")) {\n              String body = source.getString(\"body\");\n              try {\n                postData = body.getBytes(\"UTF-8\");\n              } catch (UnsupportedEncodingException e) {\n                postData = body.getBytes();\n              }\n            }\n            if (postData == null) {\n              postData = new byte[0];\n            }\n            view.postUrl(url, postData);\n            return;\n          }\n        }\n        HashMap<String, String> headerMap = new HashMap<>();\n        if (source.hasKey(\"headers\")) {\n          ReadableMap headers = source.getMap(\"headers\");\n          ReadableMapKeySetIterator iter = headers.keySetIterator();\n          while (iter.hasNextKey()) {\n            String key = iter.nextKey();\n            if (\"user-agent\".equals(key.toLowerCase(Locale.ENGLISH))) {\n              if (view.getSettings() != null) {\n                view.getSettings().setUserAgentString(headers.getString(key));\n              }\n            } else {\n              headerMap.put(key, headers.getString(key));\n            }\n          }\n        }\n        view.loadUrl(url, headerMap);\n        return;\n      }\n    }\n    view.loadUrl(BLANK_URL);\n  }\n\n  @ReactProp(name = \"onContentSizeChange\")\n  public void setOnContentSizeChange(WebView view, boolean sendContentSizeChangeEvents) {\n    if (sendContentSizeChangeEvents) {\n      view.setPictureListener(getPictureListener());\n    } else {\n      view.setPictureListener(null);\n    }\n  }\n\n  @ReactProp(name = \"mixedContentMode\")\n  public void setMixedContentMode(WebView view, @Nullable String mixedContentMode) {\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n      if (mixedContentMode == null || \"never\".equals(mixedContentMode)) {\n        view.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_NEVER_ALLOW);\n      } else if (\"always\".equals(mixedContentMode)) {\n        view.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);\n      } else if (\"compatibility\".equals(mixedContentMode)) {\n        view.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);\n      }\n    }\n  }\n\n  @ReactProp(name = \"urlPrefixesForDefaultIntent\")\n  public void setUrlPrefixesForDefaultIntent(\n      WebView view,\n      @Nullable ReadableArray urlPrefixesForDefaultIntent) {\n    ReactWebViewClient client = ((ReactWebView) view).getReactWebViewClient();\n    if (client != null && urlPrefixesForDefaultIntent != null) {\n      client.setUrlPrefixesForDefaultIntent(urlPrefixesForDefaultIntent);\n    }\n  }\n\n  @Override\n  protected void addEventEmitters(ThemedReactContext reactContext, WebView view) {\n    // Do not register default touch emitter and let WebView implementation handle touches\n    view.setWebViewClient(new ReactWebViewClient());\n  }\n\n  @Override\n  public @Nullable Map<String, Integer> getCommandsMap() {\n    return MapBuilder.of(\n        \"goBack\", COMMAND_GO_BACK,\n        \"goForward\", COMMAND_GO_FORWARD,\n        \"reload\", COMMAND_RELOAD,\n        \"stopLoading\", COMMAND_STOP_LOADING,\n        \"postMessage\", COMMAND_POST_MESSAGE,\n        \"injectJavaScript\", COMMAND_INJECT_JAVASCRIPT\n      );\n  }\n\n  @Override\n  public void receiveCommand(WebView root, int commandId, @Nullable ReadableArray args) {\n    switch (commandId) {\n      case COMMAND_GO_BACK:\n        root.goBack();\n        break;\n      case COMMAND_GO_FORWARD:\n        root.goForward();\n        break;\n      case COMMAND_RELOAD:\n        root.reload();\n        break;\n      case COMMAND_STOP_LOADING:\n        root.stopLoading();\n        break;\n      case COMMAND_POST_MESSAGE:\n        try {\n          JSONObject eventInitDict = new JSONObject();\n          eventInitDict.put(\"data\", args.getString(0));\n          root.loadUrl(\"javascript:(function () {\" +\n            \"var event;\" +\n            \"var data = \" + eventInitDict.toString() + \";\" +\n            \"try {\" +\n              \"event = new MessageEvent('message', data);\" +\n            \"} catch (e) {\" +\n              \"event = document.createEvent('MessageEvent');\" +\n              \"event.initMessageEvent('message', true, true, data.data, data.origin, data.lastEventId, data.source);\" +\n            \"}\" +\n            \"document.dispatchEvent(event);\" +\n          \"})();\");\n        } catch (JSONException e) {\n          throw new RuntimeException(e);\n        }\n        break;\n      case COMMAND_INJECT_JAVASCRIPT:\n        root.loadUrl(\"javascript:\" + args.getString(0));\n        break;\n    }\n  }\n\n  @Override\n  public void onDropViewInstance(WebView webView) {\n    super.onDropViewInstance(webView);\n    ((ThemedReactContext) webView.getContext()).removeLifecycleEventListener((ReactWebView) webView);\n    ((ReactWebView) webView).cleanupCallbacksAndDestroy();\n  }\n\n  protected WebView.PictureListener getPictureListener() {\n    if (mPictureListener == null) {\n      mPictureListener = new WebView.PictureListener() {\n        @Override\n        public void onNewPicture(WebView webView, Picture picture) {\n          dispatchEvent(\n            webView,\n            new ContentSizeChangeEvent(\n              webView.getId(),\n              webView.getWidth(),\n              webView.getContentHeight()));\n        }\n      };\n    }\n    return mPictureListener;\n  }\n\n  protected static void dispatchEvent(WebView webView, Event event) {\n    ReactContext reactContext = (ReactContext) webView.getContext();\n    EventDispatcher eventDispatcher =\n      reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();\n    eventDispatcher.dispatchEvent(event);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/webview/events/TopLoadingErrorEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.webview.events;\n\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted when there is an error in loading.\n */\npublic class TopLoadingErrorEvent extends Event<TopLoadingErrorEvent> {\n\n  public static final String EVENT_NAME = \"topLoadingError\";\n  private WritableMap mEventData;\n\n  public TopLoadingErrorEvent(int viewId, WritableMap eventData) {\n    super(viewId);\n    mEventData = eventData;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    return false;\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    // All events for a given view can be coalesced.\n    return 0;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), mEventData);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/webview/events/TopLoadingFinishEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.webview.events;\n\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted when loading is completed.\n */\npublic class TopLoadingFinishEvent extends Event<TopLoadingFinishEvent> {\n\n  public static final String EVENT_NAME = \"topLoadingFinish\";\n  private WritableMap mEventData;\n\n  public TopLoadingFinishEvent(int viewId, WritableMap eventData) {\n    super(viewId);\n    mEventData = eventData;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    return false;\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    // All events for a given view can be coalesced.\n    return 0;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), mEventData);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/webview/events/TopLoadingStartEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.webview.events;\n\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted when loading has started\n */\npublic class TopLoadingStartEvent extends Event<TopLoadingStartEvent> {\n\n  public static final String EVENT_NAME = \"topLoadingStart\";\n  private WritableMap mEventData;\n\n  public TopLoadingStartEvent(int viewId, WritableMap eventData) {\n    super(viewId);\n    mEventData = eventData;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    return false;\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    // All events for a given view can be coalesced.\n    return 0;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    rctEventEmitter.receiveEvent(getViewTag(), getEventName(), mEventData);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/react/views/webview/events/TopMessageEvent.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.webview.events;\n\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\n/**\n * Event emitted when there is an error in loading.\n */\npublic class TopMessageEvent extends Event<TopMessageEvent> {\n\n  public static final String EVENT_NAME = \"topMessage\";\n  private final String mData;\n\n  public TopMessageEvent(int viewId, String data) {\n    super(viewId);\n    mData = data;\n  }\n\n  @Override\n  public String getEventName() {\n    return EVENT_NAME;\n  }\n\n  @Override\n  public boolean canCoalesce() {\n    return false;\n  }\n\n  @Override\n  public short getCoalescingKey() {\n    // All events for a given view can be coalesced.\n    return 0;\n  }\n\n  @Override\n  public void dispatch(RCTEventEmitter rctEventEmitter) {\n    WritableMap data = Arguments.createMap();\n    data.putString(\"data\", mData);\n    rctEventEmitter.receiveEvent(getViewTag(), EVENT_NAME, data);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/systrace/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"systrace\",\n    srcs = glob([\"*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/systrace/Systrace.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.systrace;\n\nimport android.os.Build;\nimport android.os.Trace;\n\n/**\n * Systrace stub that mostly does nothing but delegates to Trace for beginning/ending sections.\n * The internal version of this file has not been opensourced yet.\n */\npublic class Systrace {\n\n  public static final long TRACE_TAG_REACT_JAVA_BRIDGE = 0L;\n  public static final long TRACE_TAG_REACT_APPS = 0L;\n  public static final long TRACE_TAG_REACT_FRESCO = 0L;\n  public static final long TRACE_TAG_REACT_VIEW = 0L;\n  public static final long TRACE_TAG_REACT_JS_VM_CALLS = 0L;\n\n  public enum EventScope {\n    THREAD('t'),\n    PROCESS('p'),\n    GLOBAL('g');\n\n    private final char mCode;\n\n    private EventScope(char code) {\n      mCode = code;\n    }\n\n    public char getCode() {\n      return mCode;\n    }\n  }\n\n  public static void registerListener(TraceListener listener) {\n  }\n\n  public static void unregisterListener(TraceListener listener) {\n  }\n\n  public static boolean isTracing(long tag) {\n    return false;\n  }\n\n  public static void traceInstant(\n      long tag,\n      final String title,\n      EventScope scope) {\n  }\n\n  public static void beginSection(long tag, final String sectionName) {\n    if (Build.VERSION.SDK_INT >= 18) {\n      Trace.beginSection(sectionName);\n    }\n  }\n\n  public static void endSection(long tag) {\n    if (Build.VERSION.SDK_INT >= 18) {\n      Trace.endSection();\n    }\n  }\n\n  public static void beginAsyncSection(\n      long tag,\n      final String sectionName,\n      final int cookie) {\n  }\n\n  public static void beginAsyncSection(\n      long tag, final String sectionName, final int cookie, final long startNanos) {}\n  \n  public static void endAsyncSection(\n      long tag,\n      final String sectionName,\n      final int cookie) {\n  }\n\n  public static void endAsyncSection(\n      long tag, final String sectionName, final int cookie, final long endNanos) {}\n  \n  public static void traceCounter(\n      long tag,\n      final String counterName,\n      final int counterValue) {\n  }\n\n  public static void startAsyncFlow(\n      long tag,\n      final String sectionName,\n      final int cookie) {\n  }\n\n  public static void stepAsyncFlow(\n      long tag,\n      final String sectionName,\n      final int cookie) {\n  }\n\n  public static void endAsyncFlow(\n      long tag,\n      final String sectionName,\n      final int cookie) {\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaAlign {\n  AUTO(0),\n  FLEX_START(1),\n  CENTER(2),\n  FLEX_END(3),\n  STRETCH(4),\n  BASELINE(5),\n  SPACE_BETWEEN(6),\n  SPACE_AROUND(7);\n\n  private int mIntValue;\n\n  YogaAlign(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaAlign fromInt(int value) {\n    switch (value) {\n      case 0: return AUTO;\n      case 1: return FLEX_START;\n      case 2: return CENTER;\n      case 3: return FLEX_END;\n      case 4: return STRETCH;\n      case 5: return BASELINE;\n      case 6: return SPACE_BETWEEN;\n      case 7: return SPACE_AROUND;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaBaselineFunction.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic interface YogaBaselineFunction {\n  /**\n   * Return the baseline of the node in points. When no baseline function is set the baseline\n   * default to the computed height of the node.\n   */\n  @DoNotStrip\n  float baseline(YogaNode node, float width, float height);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.soloader.SoLoader;\n\n@DoNotStrip\npublic class YogaConfig {\n\n  static {\n    SoLoader.loadLibrary(\"yoga\");\n  }\n\n  long mNativePointer;\n  private YogaLogger mLogger;\n\n  private native long jni_YGConfigNew();\n  public YogaConfig() {\n    mNativePointer = jni_YGConfigNew();\n    if (mNativePointer == 0) {\n      throw new IllegalStateException(\"Failed to allocate native memory\");\n    }\n  }\n\n  private native void jni_YGConfigFree(long nativePointer);\n  @Override\n  protected void finalize() throws Throwable {\n    try {\n      jni_YGConfigFree(mNativePointer);\n    } finally {\n      super.finalize();\n    }\n  }\n\n  private native void jni_YGConfigSetExperimentalFeatureEnabled(\n      long nativePointer,\n      int feature,\n      boolean enabled);\n  public void setExperimentalFeatureEnabled(YogaExperimentalFeature feature, boolean enabled) {\n    jni_YGConfigSetExperimentalFeatureEnabled(mNativePointer, feature.intValue(), enabled);\n  }\n\n  private native void jni_YGConfigSetUseWebDefaults(long nativePointer, boolean useWebDefaults);\n  public void setUseWebDefaults(boolean useWebDefaults) {\n    jni_YGConfigSetUseWebDefaults(mNativePointer, useWebDefaults);\n  }\n\n  private native void jni_YGConfigSetPointScaleFactor(long nativePointer, float pixelsInPoint);\n  public void setPointScaleFactor(float pixelsInPoint) {\n    jni_YGConfigSetPointScaleFactor(mNativePointer, pixelsInPoint);\n  }\n\n  private native void jni_YGConfigSetUseLegacyStretchBehaviour(long nativePointer, boolean useLegacyStretchBehaviour);\n\n  /**\n   * Yoga previously had an error where containers would take the maximum space possible instead of the minimum\n   * like they are supposed to. In practice this resulted in implicit behaviour similar to align-self: stretch;\n   * Because this was such a long-standing bug we must allow legacy users to switch back to this behaviour.\n   */\n  public void setUseLegacyStretchBehaviour(boolean useLegacyStretchBehaviour) {\n    jni_YGConfigSetUseLegacyStretchBehaviour(mNativePointer, useLegacyStretchBehaviour);\n  }\n\n  private native void jni_YGConfigSetLogger(long nativePointer, Object logger);\n  public void setLogger(YogaLogger logger) {\n    mLogger = logger;\n    jni_YGConfigSetLogger(mNativePointer, logger);\n  }\n\n  public YogaLogger getLogger() {\n    return mLogger;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaConstants.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\npublic class YogaConstants {\n\n  public static final float UNDEFINED = Float.NaN;\n\n  public static boolean isUndefined(float value) {\n    return Float.compare(value, UNDEFINED) == 0;\n  }\n\n  public static boolean isUndefined(YogaValue value) {\n    return value.unit == YogaUnit.UNDEFINED;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaDimension {\n  WIDTH(0),\n  HEIGHT(1);\n\n  private int mIntValue;\n\n  YogaDimension(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaDimension fromInt(int value) {\n    switch (value) {\n      case 0: return WIDTH;\n      case 1: return HEIGHT;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaDirection.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaDirection {\n  INHERIT(0),\n  LTR(1),\n  RTL(2);\n\n  private int mIntValue;\n\n  YogaDirection(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaDirection fromInt(int value) {\n    switch (value) {\n      case 0: return INHERIT;\n      case 1: return LTR;\n      case 2: return RTL;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaDisplay {\n  FLEX(0),\n  NONE(1);\n\n  private int mIntValue;\n\n  YogaDisplay(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaDisplay fromInt(int value) {\n    switch (value) {\n      case 0: return FLEX;\n      case 1: return NONE;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaEdge {\n  LEFT(0),\n  TOP(1),\n  RIGHT(2),\n  BOTTOM(3),\n  START(4),\n  END(5),\n  HORIZONTAL(6),\n  VERTICAL(7),\n  ALL(8);\n\n  private int mIntValue;\n\n  YogaEdge(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaEdge fromInt(int value) {\n    switch (value) {\n      case 0: return LEFT;\n      case 1: return TOP;\n      case 2: return RIGHT;\n      case 3: return BOTTOM;\n      case 4: return START;\n      case 5: return END;\n      case 6: return HORIZONTAL;\n      case 7: return VERTICAL;\n      case 8: return ALL;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaExperimentalFeature {\n  WEB_FLEX_BASIS(0);\n\n  private int mIntValue;\n\n  YogaExperimentalFeature(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaExperimentalFeature fromInt(int value) {\n    switch (value) {\n      case 0: return WEB_FLEX_BASIS;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaFlexDirection {\n  COLUMN(0),\n  COLUMN_REVERSE(1),\n  ROW(2),\n  ROW_REVERSE(3);\n\n  private int mIntValue;\n\n  YogaFlexDirection(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaFlexDirection fromInt(int value) {\n    switch (value) {\n      case 0: return COLUMN;\n      case 1: return COLUMN_REVERSE;\n      case 2: return ROW;\n      case 3: return ROW_REVERSE;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaJustify {\n  FLEX_START(0),\n  CENTER(1),\n  FLEX_END(2),\n  SPACE_BETWEEN(3),\n  SPACE_AROUND(4),\n  SPACE_EVENLY(5);\n\n  private int mIntValue;\n\n  YogaJustify(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaJustify fromInt(int value) {\n    switch (value) {\n      case 0: return FLEX_START;\n      case 1: return CENTER;\n      case 2: return FLEX_END;\n      case 3: return SPACE_BETWEEN;\n      case 4: return SPACE_AROUND;\n      case 5:\n        return SPACE_EVENLY;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaLogLevel {\n  ERROR(0),\n  WARN(1),\n  INFO(2),\n  DEBUG(3),\n  VERBOSE(4),\n  FATAL(5);\n\n  private int mIntValue;\n\n  YogaLogLevel(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaLogLevel fromInt(int value) {\n    switch (value) {\n      case 0: return ERROR;\n      case 1: return WARN;\n      case 2: return INFO;\n      case 3: return DEBUG;\n      case 4: return VERBOSE;\n      case 5: return FATAL;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaLogger.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n/**\n * Interface for receiving logs from native layer. Use by setting YogaNode.setLogger(myLogger);\n * See YogaLogLevel for the different log levels.\n */\n@DoNotStrip\npublic interface YogaLogger {\n  @DoNotStrip\n  void log(YogaNode node, YogaLogLevel level, String message);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureFunction.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic interface YogaMeasureFunction {\n  /**\n   * Return a value created by YogaMeasureOutput.make(width, height);\n   */\n  @DoNotStrip\n  long measure(\n      YogaNode node,\n      float width,\n      YogaMeasureMode widthMode,\n      float height,\n      YogaMeasureMode heightMode);\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaMeasureMode {\n  UNDEFINED(0),\n  EXACTLY(1),\n  AT_MOST(2);\n\n  private int mIntValue;\n\n  YogaMeasureMode(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaMeasureMode fromInt(int value) {\n    switch (value) {\n      case 0: return UNDEFINED;\n      case 1: return EXACTLY;\n      case 2: return AT_MOST;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureOutput.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\n/**\n * Helpers for building measure output value.\n */\npublic class YogaMeasureOutput {\n\n  public static long make(float width, float height) {\n    final int wBits = Float.floatToRawIntBits(width);\n    final int hBits = Float.floatToRawIntBits(height);\n    return ((long) wBits) << 32 | ((long) hBits);\n  }\n\n  public static long make(int width, int height) {\n    return make((float) width, (float) height);\n  }\n\n  public static float getWidth(long measureOutput) {\n    return Float.intBitsToFloat((int) (0xFFFFFFFF & (measureOutput >> 32)));\n  }\n\n  public static float getHeight(long measureOutput) {\n    return Float.intBitsToFloat((int) (0xFFFFFFFF & measureOutput));\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport javax.annotation.Nullable;\n\nimport java.util.List;\nimport java.util.ArrayList;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\nimport com.facebook.soloader.SoLoader;\n\n@DoNotStrip\npublic class YogaNode {\n\n  static {\n    SoLoader.loadLibrary(\"yoga\");\n  }\n\n  /**\n   * Get native instance count. Useful for testing only.\n   */\n  static native int jni_YGNodeGetInstanceCount();\n\n  private YogaNode mParent;\n  private List<YogaNode> mChildren;\n  private YogaMeasureFunction mMeasureFunction;\n  private YogaBaselineFunction mBaselineFunction;\n  private long mNativePointer;\n  private Object mData;\n\n  /* Those flags needs be in sync with YGJNI.cpp */\n  private final static int MARGIN = 1;\n  private final static int PADDING = 2;\n  private final static int BORDER = 4;\n\n  @DoNotStrip\n  private int mEdgeSetFlag = 0;\n\n  private boolean mHasSetPosition = false;\n\n  @DoNotStrip\n  private float mWidth = YogaConstants.UNDEFINED;\n  @DoNotStrip\n  private float mHeight = YogaConstants.UNDEFINED;\n  @DoNotStrip\n  private float mTop = YogaConstants.UNDEFINED;\n  @DoNotStrip\n  private float mLeft = YogaConstants.UNDEFINED;\n  @DoNotStrip\n  private float mMarginLeft = 0;\n  @DoNotStrip\n  private float mMarginTop = 0;\n  @DoNotStrip\n  private float mMarginRight = 0;\n  @DoNotStrip\n  private float mMarginBottom = 0;\n  @DoNotStrip\n  private float mPaddingLeft = 0;\n  @DoNotStrip\n  private float mPaddingTop = 0;\n  @DoNotStrip\n  private float mPaddingRight = 0;\n  @DoNotStrip\n  private float mPaddingBottom = 0;\n  @DoNotStrip\n  private float mBorderLeft = 0;\n  @DoNotStrip\n  private float mBorderTop = 0;\n  @DoNotStrip\n  private float mBorderRight = 0;\n  @DoNotStrip\n  private float mBorderBottom = 0;\n  @DoNotStrip\n  private int mLayoutDirection = 0;\n  @DoNotStrip\n  private boolean mHasNewLayout = true;\n\n  private native long jni_YGNodeNew();\n  public YogaNode() {\n    mNativePointer = jni_YGNodeNew();\n    if (mNativePointer == 0) {\n      throw new IllegalStateException(\"Failed to allocate native memory\");\n    }\n  }\n\n  private native long jni_YGNodeNewWithConfig(long configPointer);\n  public YogaNode(YogaConfig config) {\n    mNativePointer = jni_YGNodeNewWithConfig(config.mNativePointer);\n    if (mNativePointer == 0) {\n      throw new IllegalStateException(\"Failed to allocate native memory\");\n    }\n  }\n\n  private native void jni_YGNodeFree(long nativePointer);\n  protected void finalize() throws Throwable {\n    try {\n      jni_YGNodeFree(mNativePointer);\n    } finally {\n      super.finalize();\n    }\n  }\n\n  private native void jni_YGNodeReset(long nativePointer);\n  public void reset() {\n    mEdgeSetFlag = 0;\n    mHasSetPosition = false;\n    mHasNewLayout = true;\n\n    mWidth = YogaConstants.UNDEFINED;\n    mHeight = YogaConstants.UNDEFINED;\n    mTop = YogaConstants.UNDEFINED;\n    mLeft = YogaConstants.UNDEFINED;\n    mMarginLeft = 0;\n    mMarginTop = 0;\n    mMarginRight = 0;\n    mMarginBottom = 0;\n    mPaddingLeft = 0;\n    mPaddingTop = 0;\n    mPaddingRight = 0;\n    mPaddingBottom = 0;\n    mBorderLeft = 0;\n    mBorderTop = 0;\n    mBorderRight = 0;\n    mBorderBottom = 0;\n    mLayoutDirection = 0;\n\n    mMeasureFunction = null;\n    mBaselineFunction = null;\n    mData = null;\n\n    jni_YGNodeReset(mNativePointer);\n  }\n\n  public int getChildCount() {\n    return mChildren == null ? 0 : mChildren.size();\n  }\n\n  public YogaNode getChildAt(int i) {\n    return mChildren.get(i);\n  }\n\n  private native void jni_YGNodeInsertChild(long nativePointer, long childPointer, int index);\n  public void addChildAt(YogaNode child, int i) {\n    if (child.mParent != null) {\n      throw new IllegalStateException(\"Child already has a parent, it must be removed first.\");\n    }\n\n    if (mChildren == null) {\n      mChildren = new ArrayList<>(4);\n    }\n    mChildren.add(i, child);\n    child.mParent = this;\n    jni_YGNodeInsertChild(mNativePointer, child.mNativePointer, i);\n  }\n\n  private native void jni_YGNodeRemoveChild(long nativePointer, long childPointer);\n  public YogaNode removeChildAt(int i) {\n\n    final YogaNode child = mChildren.remove(i);\n    child.mParent = null;\n    jni_YGNodeRemoveChild(mNativePointer, child.mNativePointer);\n    return child;\n  }\n\n  public @Nullable\n  YogaNode getParent() {\n    return mParent;\n  }\n\n  public int indexOf(YogaNode child) {\n    return mChildren == null ? -1 : mChildren.indexOf(child);\n  }\n\n  private native void jni_YGNodeCalculateLayout(long nativePointer, float width, float height);\n  public void calculateLayout(float width, float height) {\n    jni_YGNodeCalculateLayout(mNativePointer, width, height);\n  }\n\n  public boolean hasNewLayout() {\n    return mHasNewLayout;\n  }\n\n  private native void jni_YGNodeMarkDirty(long nativePointer);\n  public void dirty() {\n    jni_YGNodeMarkDirty(mNativePointer);\n  }\n\n  private native boolean jni_YGNodeIsDirty(long nativePointer);\n  public boolean isDirty() {\n    return jni_YGNodeIsDirty(mNativePointer);\n  }\n\n  private native void jni_YGNodeCopyStyle(long dstNativePointer, long srcNativePointer);\n  public void copyStyle(YogaNode srcNode) {\n    jni_YGNodeCopyStyle(mNativePointer, srcNode.mNativePointer);\n  }\n\n  public void markLayoutSeen() {\n    mHasNewLayout = false;\n  }\n\n  private native int jni_YGNodeStyleGetDirection(long nativePointer);\n  public YogaDirection getStyleDirection() {\n    return YogaDirection.fromInt(jni_YGNodeStyleGetDirection(mNativePointer));\n  }\n\n  private native void jni_YGNodeStyleSetDirection(long nativePointer, int direction);\n  public void setDirection(YogaDirection direction) {\n    jni_YGNodeStyleSetDirection(mNativePointer, direction.intValue());\n  }\n\n  private native int jni_YGNodeStyleGetFlexDirection(long nativePointer);\n  public YogaFlexDirection getFlexDirection() {\n    return YogaFlexDirection.fromInt(jni_YGNodeStyleGetFlexDirection(mNativePointer));\n  }\n\n  private native void jni_YGNodeStyleSetFlexDirection(long nativePointer, int flexDirection);\n  public void setFlexDirection(YogaFlexDirection flexDirection) {\n    jni_YGNodeStyleSetFlexDirection(mNativePointer, flexDirection.intValue());\n  }\n\n  private native int jni_YGNodeStyleGetJustifyContent(long nativePointer);\n  public YogaJustify getJustifyContent() {\n    return YogaJustify.fromInt(jni_YGNodeStyleGetJustifyContent(mNativePointer));\n  }\n\n  private native void jni_YGNodeStyleSetJustifyContent(long nativePointer, int justifyContent);\n  public void setJustifyContent(YogaJustify justifyContent) {\n    jni_YGNodeStyleSetJustifyContent(mNativePointer, justifyContent.intValue());\n  }\n\n  private native int jni_YGNodeStyleGetAlignItems(long nativePointer);\n  public YogaAlign getAlignItems() {\n    return YogaAlign.fromInt(jni_YGNodeStyleGetAlignItems(mNativePointer));\n  }\n\n  private native void jni_YGNodeStyleSetAlignItems(long nativePointer, int alignItems);\n  public void setAlignItems(YogaAlign alignItems) {\n    jni_YGNodeStyleSetAlignItems(mNativePointer, alignItems.intValue());\n  }\n\n  private native int jni_YGNodeStyleGetAlignSelf(long nativePointer);\n  public YogaAlign getAlignSelf() {\n    return YogaAlign.fromInt(jni_YGNodeStyleGetAlignSelf(mNativePointer));\n  }\n\n  private native void jni_YGNodeStyleSetAlignSelf(long nativePointer, int alignSelf);\n  public void setAlignSelf(YogaAlign alignSelf) {\n    jni_YGNodeStyleSetAlignSelf(mNativePointer, alignSelf.intValue());\n  }\n\n  private native int jni_YGNodeStyleGetAlignContent(long nativePointer);\n  public YogaAlign getAlignContent() {\n    return YogaAlign.fromInt(jni_YGNodeStyleGetAlignContent(mNativePointer));\n  }\n\n  private native void jni_YGNodeStyleSetAlignContent(long nativePointer, int alignContent);\n  public void setAlignContent(YogaAlign alignContent) {\n    jni_YGNodeStyleSetAlignContent(mNativePointer, alignContent.intValue());\n  }\n\n  private native int jni_YGNodeStyleGetPositionType(long nativePointer);\n  public YogaPositionType getPositionType() {\n    return YogaPositionType.fromInt(jni_YGNodeStyleGetPositionType(mNativePointer));\n  }\n\n  private native void jni_YGNodeStyleSetPositionType(long nativePointer, int positionType);\n  public void setPositionType(YogaPositionType positionType) {\n    jni_YGNodeStyleSetPositionType(mNativePointer, positionType.intValue());\n  }\n\n  private native void jni_YGNodeStyleSetFlexWrap(long nativePointer, int wrapType);\n  public void setWrap(YogaWrap flexWrap) {\n    jni_YGNodeStyleSetFlexWrap(mNativePointer, flexWrap.intValue());\n  }\n\n  private native int jni_YGNodeStyleGetOverflow(long nativePointer);\n  public YogaOverflow getOverflow() {\n    return YogaOverflow.fromInt(jni_YGNodeStyleGetOverflow(mNativePointer));\n  }\n\n  private native void jni_YGNodeStyleSetOverflow(long nativePointer, int overflow);\n  public void setOverflow(YogaOverflow overflow) {\n    jni_YGNodeStyleSetOverflow(mNativePointer, overflow.intValue());\n  }\n\n  private native int jni_YGNodeStyleGetDisplay(long nativePointer);\n  public YogaDisplay getDisplay() {\n    return YogaDisplay.fromInt(jni_YGNodeStyleGetDisplay(mNativePointer));\n  }\n\n  private native void jni_YGNodeStyleSetDisplay(long nativePointer, int display);\n  public void setDisplay(YogaDisplay display) {\n    jni_YGNodeStyleSetDisplay(mNativePointer, display.intValue());\n  }\n\n  private native void jni_YGNodeStyleSetFlex(long nativePointer, float flex);\n  public void setFlex(float flex) {\n    jni_YGNodeStyleSetFlex(mNativePointer, flex);\n  }\n\n  private native float jni_YGNodeStyleGetFlexGrow(long nativePointer);\n  public float getFlexGrow() {\n    return jni_YGNodeStyleGetFlexGrow(mNativePointer);\n  }\n\n  private native void jni_YGNodeStyleSetFlexGrow(long nativePointer, float flexGrow);\n  public void setFlexGrow(float flexGrow) {\n    jni_YGNodeStyleSetFlexGrow(mNativePointer, flexGrow);\n  }\n\n  private native float jni_YGNodeStyleGetFlexShrink(long nativePointer);\n  public float getFlexShrink() {\n    return jni_YGNodeStyleGetFlexShrink(mNativePointer);\n  }\n\n  private native void jni_YGNodeStyleSetFlexShrink(long nativePointer, float flexShrink);\n  public void setFlexShrink(float flexShrink) {\n    jni_YGNodeStyleSetFlexShrink(mNativePointer, flexShrink);\n  }\n\n  private native Object jni_YGNodeStyleGetFlexBasis(long nativePointer);\n  public YogaValue getFlexBasis() {\n    return (YogaValue) jni_YGNodeStyleGetFlexBasis(mNativePointer);\n  }\n\n  private native void jni_YGNodeStyleSetFlexBasis(long nativePointer, float flexBasis);\n  public void setFlexBasis(float flexBasis) {\n    jni_YGNodeStyleSetFlexBasis(mNativePointer, flexBasis);\n  }\n\n  private native void jni_YGNodeStyleSetFlexBasisPercent(long nativePointer, float percent);\n  public void setFlexBasisPercent(float percent) {\n    jni_YGNodeStyleSetFlexBasisPercent(mNativePointer, percent);\n  }\n\n  private native void jni_YGNodeStyleSetFlexBasisAuto(long nativePointer);\n  public void setFlexBasisAuto() {\n    jni_YGNodeStyleSetFlexBasisAuto(mNativePointer);\n  }\n\n  private native Object jni_YGNodeStyleGetMargin(long nativePointer, int edge);\n  public YogaValue getMargin(YogaEdge edge) {\n    if (!((mEdgeSetFlag & MARGIN) == MARGIN)) {\n      return YogaValue.UNDEFINED;\n    }\n    return (YogaValue) jni_YGNodeStyleGetMargin(mNativePointer, edge.intValue());\n  }\n\n  private native void jni_YGNodeStyleSetMargin(long nativePointer, int edge, float margin);\n  public void setMargin(YogaEdge edge, float margin) {\n    mEdgeSetFlag |= MARGIN;\n    jni_YGNodeStyleSetMargin(mNativePointer, edge.intValue(), margin);\n  }\n\n  private native void jni_YGNodeStyleSetMarginPercent(long nativePointer, int edge, float percent);\n  public void setMarginPercent(YogaEdge edge, float percent) {\n    mEdgeSetFlag |= MARGIN;\n    jni_YGNodeStyleSetMarginPercent(mNativePointer, edge.intValue(), percent);\n  }\n\n  private native void jni_YGNodeStyleSetMarginAuto(long nativePointer, int edge);\n  public void setMarginAuto(YogaEdge edge) {\n    mEdgeSetFlag |= MARGIN;\n    jni_YGNodeStyleSetMarginAuto(mNativePointer, edge.intValue());\n  }\n\n  private native Object jni_YGNodeStyleGetPadding(long nativePointer, int edge);\n  public YogaValue getPadding(YogaEdge edge) {\n    if (!((mEdgeSetFlag & PADDING) == PADDING)) {\n      return YogaValue.UNDEFINED;\n    }\n    return (YogaValue) jni_YGNodeStyleGetPadding(mNativePointer, edge.intValue());\n  }\n\n  private native void jni_YGNodeStyleSetPadding(long nativePointer, int edge, float padding);\n  public void setPadding(YogaEdge edge, float padding) {\n    mEdgeSetFlag |= PADDING;\n    jni_YGNodeStyleSetPadding(mNativePointer, edge.intValue(), padding);\n  }\n\n  private native void jni_YGNodeStyleSetPaddingPercent(long nativePointer, int edge, float percent);\n  public void setPaddingPercent(YogaEdge edge, float percent) {\n    mEdgeSetFlag |= PADDING;\n    jni_YGNodeStyleSetPaddingPercent(mNativePointer, edge.intValue(), percent);\n  }\n\n  private native float jni_YGNodeStyleGetBorder(long nativePointer, int edge);\n  public float getBorder(YogaEdge edge) {\n    if (!((mEdgeSetFlag & BORDER) == BORDER)) {\n      return YogaConstants.UNDEFINED;\n    }\n    return jni_YGNodeStyleGetBorder(mNativePointer, edge.intValue());\n  }\n\n  private native void jni_YGNodeStyleSetBorder(long nativePointer, int edge, float border);\n  public void setBorder(YogaEdge edge, float border) {\n    mEdgeSetFlag |= BORDER;\n    jni_YGNodeStyleSetBorder(mNativePointer, edge.intValue(), border);\n  }\n\n  private native Object jni_YGNodeStyleGetPosition(long nativePointer, int edge);\n  public YogaValue getPosition(YogaEdge edge) {\n    if (!mHasSetPosition) {\n      return YogaValue.UNDEFINED;\n    }\n    return (YogaValue) jni_YGNodeStyleGetPosition(mNativePointer, edge.intValue());\n  }\n\n  private native void jni_YGNodeStyleSetPosition(long nativePointer, int edge, float position);\n  public void setPosition(YogaEdge edge, float position) {\n    mHasSetPosition = true;\n    jni_YGNodeStyleSetPosition(mNativePointer, edge.intValue(), position);\n  }\n\n  private native void jni_YGNodeStyleSetPositionPercent(long nativePointer, int edge, float percent);\n  public void setPositionPercent(YogaEdge edge, float percent) {\n    mHasSetPosition = true;\n    jni_YGNodeStyleSetPositionPercent(mNativePointer, edge.intValue(), percent);\n  }\n\n  private native Object jni_YGNodeStyleGetWidth(long nativePointer);\n  public YogaValue getWidth() {\n    return (YogaValue) jni_YGNodeStyleGetWidth(mNativePointer);\n  }\n\n  private native void jni_YGNodeStyleSetWidth(long nativePointer, float width);\n  public void setWidth(float width) {\n    jni_YGNodeStyleSetWidth(mNativePointer, width);\n  }\n\n  private native void jni_YGNodeStyleSetWidthPercent(long nativePointer, float percent);\n  public void setWidthPercent(float percent) {\n    jni_YGNodeStyleSetWidthPercent(mNativePointer, percent);\n  }\n\n  private native void jni_YGNodeStyleSetWidthAuto(long nativePointer);\n  public void setWidthAuto() {\n    jni_YGNodeStyleSetWidthAuto(mNativePointer);\n  }\n\n  private native Object jni_YGNodeStyleGetHeight(long nativePointer);\n  public YogaValue getHeight() {\n    return (YogaValue) jni_YGNodeStyleGetHeight(mNativePointer);\n  }\n\n  private native void jni_YGNodeStyleSetHeight(long nativePointer, float height);\n  public void setHeight(float height) {\n    jni_YGNodeStyleSetHeight(mNativePointer, height);\n  }\n\n  private native void jni_YGNodeStyleSetHeightPercent(long nativePointer, float percent);\n  public void setHeightPercent(float percent) {\n    jni_YGNodeStyleSetHeightPercent(mNativePointer, percent);\n  }\n\n  private native void jni_YGNodeStyleSetHeightAuto(long nativePointer);\n  public void setHeightAuto() {\n    jni_YGNodeStyleSetHeightAuto(mNativePointer);\n  }\n\n  private native Object jni_YGNodeStyleGetMinWidth(long nativePointer);\n  public YogaValue getMinWidth() {\n    return (YogaValue) jni_YGNodeStyleGetMinWidth(mNativePointer);\n  }\n\n  private native void jni_YGNodeStyleSetMinWidth(long nativePointer, float minWidth);\n  public void setMinWidth(float minWidth) {\n    jni_YGNodeStyleSetMinWidth(mNativePointer, minWidth);\n  }\n\n  private native void jni_YGNodeStyleSetMinWidthPercent(long nativePointer, float percent);\n  public void setMinWidthPercent(float percent) {\n    jni_YGNodeStyleSetMinWidthPercent(mNativePointer, percent);\n  }\n\n  private native Object jni_YGNodeStyleGetMinHeight(long nativePointer);\n  public YogaValue getMinHeight() {\n    return (YogaValue) jni_YGNodeStyleGetMinHeight(mNativePointer);\n  }\n\n  private native void jni_YGNodeStyleSetMinHeight(long nativePointer, float minHeight);\n  public void setMinHeight(float minHeight) {\n    jni_YGNodeStyleSetMinHeight(mNativePointer, minHeight);\n  }\n\n  private native void jni_YGNodeStyleSetMinHeightPercent(long nativePointer, float percent);\n  public void setMinHeightPercent(float percent) {\n    jni_YGNodeStyleSetMinHeightPercent(mNativePointer, percent);\n  }\n\n  private native Object jni_YGNodeStyleGetMaxWidth(long nativePointer);\n  public YogaValue getMaxWidth() {\n    return (YogaValue) jni_YGNodeStyleGetMaxWidth(mNativePointer);\n  }\n\n  private native void jni_YGNodeStyleSetMaxWidth(long nativePointer, float maxWidth);\n  public void setMaxWidth(float maxWidth) {\n    jni_YGNodeStyleSetMaxWidth(mNativePointer, maxWidth);\n  }\n\n  private native void jni_YGNodeStyleSetMaxWidthPercent(long nativePointer, float percent);\n  public void setMaxWidthPercent(float percent) {\n    jni_YGNodeStyleSetMaxWidthPercent(mNativePointer, percent);\n  }\n\n  private native Object jni_YGNodeStyleGetMaxHeight(long nativePointer);\n  public YogaValue getMaxHeight() {\n    return (YogaValue) jni_YGNodeStyleGetMaxHeight(mNativePointer);\n  }\n\n  private native void jni_YGNodeStyleSetMaxHeight(long nativePointer, float maxheight);\n  public void setMaxHeight(float maxheight) {\n    jni_YGNodeStyleSetMaxHeight(mNativePointer, maxheight);\n  }\n\n  private native void jni_YGNodeStyleSetMaxHeightPercent(long nativePointer, float percent);\n  public void setMaxHeightPercent(float percent) {\n    jni_YGNodeStyleSetMaxHeightPercent(mNativePointer, percent);\n  }\n\n  private native float jni_YGNodeStyleGetAspectRatio(long nativePointer);\n  public float getAspectRatio() {\n    return jni_YGNodeStyleGetAspectRatio(mNativePointer);\n  }\n\n  private native void jni_YGNodeStyleSetAspectRatio(long nativePointer, float aspectRatio);\n  public void setAspectRatio(float aspectRatio) {\n    jni_YGNodeStyleSetAspectRatio(mNativePointer, aspectRatio);\n  }\n\n  public float getLayoutX() {\n    return mLeft;\n  }\n\n  public float getLayoutY() {\n    return mTop;\n  }\n\n  public float getLayoutWidth() {\n    return mWidth;\n  }\n\n  public float getLayoutHeight() {\n    return mHeight;\n  }\n\n  public float getLayoutMargin(YogaEdge edge) {\n    switch (edge) {\n      case LEFT:\n        return mMarginLeft;\n      case TOP:\n        return mMarginTop;\n      case RIGHT:\n        return mMarginRight;\n      case BOTTOM:\n        return mMarginBottom;\n      case START:\n        return getLayoutDirection() == YogaDirection.RTL ? mMarginRight : mMarginLeft;\n      case END:\n        return getLayoutDirection() == YogaDirection.RTL ? mMarginLeft : mMarginRight;\n      default:\n        throw new IllegalArgumentException(\"Cannot get layout margins of multi-edge shorthands\");\n    }\n  }\n\n  public float getLayoutPadding(YogaEdge edge) {\n    switch (edge) {\n      case LEFT:\n        return mPaddingLeft;\n      case TOP:\n        return mPaddingTop;\n      case RIGHT:\n        return mPaddingRight;\n      case BOTTOM:\n        return mPaddingBottom;\n      case START:\n        return getLayoutDirection() == YogaDirection.RTL ? mPaddingRight : mPaddingLeft;\n      case END:\n        return getLayoutDirection() == YogaDirection.RTL ? mPaddingLeft : mPaddingRight;\n      default:\n        throw new IllegalArgumentException(\"Cannot get layout paddings of multi-edge shorthands\");\n    }\n  }\n\n  public float getLayoutBorder(YogaEdge edge) {\n    switch (edge) {\n      case LEFT:\n        return mBorderLeft;\n      case TOP:\n        return mBorderTop;\n      case RIGHT:\n        return mBorderRight;\n      case BOTTOM:\n        return mBorderBottom;\n      case START:\n        return getLayoutDirection() == YogaDirection.RTL ? mBorderRight : mBorderLeft;\n      case END:\n        return getLayoutDirection() == YogaDirection.RTL ? mBorderLeft : mBorderRight;\n      default:\n        throw new IllegalArgumentException(\"Cannot get layout border of multi-edge shorthands\");\n    }\n  }\n\n  public YogaDirection getLayoutDirection() {\n    return YogaDirection.fromInt(mLayoutDirection);\n  }\n\n  private native void jni_YGNodeSetHasMeasureFunc(long nativePointer, boolean hasMeasureFunc);\n  public void setMeasureFunction(YogaMeasureFunction measureFunction) {\n    mMeasureFunction = measureFunction;\n    jni_YGNodeSetHasMeasureFunc(mNativePointer, measureFunction != null);\n  }\n\n  // Implementation Note: Why this method needs to stay final\n  //\n  // We cache the jmethodid for this method in Yoga code. This means that even if a subclass\n  // were to override measure, we'd still call this implementation from layout code since the\n  // overriding method will have a different jmethodid. This is final to prevent that mistake.\n  @DoNotStrip\n  public final long measure(float width, int widthMode, float height, int heightMode) {\n    if (!isMeasureDefined()) {\n      throw new RuntimeException(\"Measure function isn't defined!\");\n    }\n\n    return mMeasureFunction.measure(\n          this,\n          width,\n          YogaMeasureMode.fromInt(widthMode),\n          height,\n          YogaMeasureMode.fromInt(heightMode));\n  }\n\n  private native void jni_YGNodeSetHasBaselineFunc(long nativePointer, boolean hasMeasureFunc);\n  public void setBaselineFunction(YogaBaselineFunction baselineFunction) {\n    mBaselineFunction = baselineFunction;\n    jni_YGNodeSetHasBaselineFunc(mNativePointer, baselineFunction != null);\n  }\n\n  @DoNotStrip\n  public final float baseline(float width, float height) {\n    return mBaselineFunction.baseline(this, width, height);\n  }\n\n  public boolean isMeasureDefined() {\n    return mMeasureFunction != null;\n  }\n\n  public void setData(Object data) {\n    mData = data;\n  }\n\n  public Object getData() {\n    return mData;\n  }\n\n  private native void jni_YGNodePrint(long nativePointer);\n\n  /**\n   * Use the set logger (defaults to adb log) to print out the styles, children, and computed\n   * layout of the tree rooted at this node.\n   */\n  public void print() {\n    jni_YGNodePrint(mNativePointer);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaNodeType {\n  DEFAULT(0),\n  TEXT(1);\n\n  private int mIntValue;\n\n  YogaNodeType(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaNodeType fromInt(int value) {\n    switch (value) {\n      case 0: return DEFAULT;\n      case 1: return TEXT;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaOverflow {\n  VISIBLE(0),\n  HIDDEN(1),\n  SCROLL(2);\n\n  private int mIntValue;\n\n  YogaOverflow(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaOverflow fromInt(int value) {\n    switch (value) {\n      case 0: return VISIBLE;\n      case 1: return HIDDEN;\n      case 2: return SCROLL;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaPositionType {\n  RELATIVE(0),\n  ABSOLUTE(1);\n\n  private int mIntValue;\n\n  YogaPositionType(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaPositionType fromInt(int value) {\n    switch (value) {\n      case 0: return RELATIVE;\n      case 1: return ABSOLUTE;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaPrintOptions.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaPrintOptions {\n  LAYOUT(1),\n  STYLE(2),\n  CHILDREN(4);\n\n  private int mIntValue;\n\n  YogaPrintOptions(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaPrintOptions fromInt(int value) {\n    switch (value) {\n      case 1: return LAYOUT;\n      case 2: return STYLE;\n      case 4: return CHILDREN;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaUnit {\n  UNDEFINED(0),\n  POINT(1),\n  PERCENT(2),\n  AUTO(3);\n\n  private int mIntValue;\n\n  YogaUnit(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaUnit fromInt(int value) {\n    switch (value) {\n      case 0: return UNDEFINED;\n      case 1: return POINT;\n      case 2: return PERCENT;\n      case 3: return AUTO;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaValue.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic class YogaValue {\n  static final YogaValue UNDEFINED = new YogaValue(YogaConstants.UNDEFINED, YogaUnit.UNDEFINED);\n  static final YogaValue ZERO = new YogaValue(0, YogaUnit.POINT);\n  static final YogaValue AUTO = new YogaValue(YogaConstants.UNDEFINED, YogaUnit.AUTO);\n\n  public final float value;\n  public final YogaUnit unit;\n\n  public YogaValue(float value, YogaUnit unit) {\n    this.value = value;\n    this.unit = unit;\n  }\n\n  @DoNotStrip\n  YogaValue(float value, int unit) {\n    this(value, YogaUnit.fromInt(unit));\n  }\n\n  @Override\n  public boolean equals(Object other) {\n    if (other instanceof YogaValue) {\n      final YogaValue otherValue = (YogaValue) other;\n      if (unit == otherValue.unit) {\n        return unit == YogaUnit.UNDEFINED || Float.compare(value, otherValue.value) == 0;\n      }\n    }\n    return false;\n  }\n\n  @Override\n  public int hashCode() {\n    return Float.floatToIntBits(value) + unit.intValue();\n  }\n\n  @Override\n  public String toString() {\n    switch (unit) {\n      case UNDEFINED:\n        return \"undefined\";\n      case POINT:\n        return Float.toString(value);\n      case PERCENT:\n        return value + \"%\";\n      case AUTO:\n        return \"auto\";\n      default:\n        throw new IllegalStateException();\n    }\n  }\n\n  public static YogaValue parse(String s) {\n    if (s == null) {\n      return null;\n    }\n\n    if (\"undefined\".equals(s)) {\n      return UNDEFINED;\n    }\n\n    if (\"auto\".equals(s)) {\n      return AUTO;\n    }\n\n    if (s.endsWith(\"%\")) {\n      return new YogaValue(Float.parseFloat(s.substring(0, s.length() - 1)), YogaUnit.PERCENT);\n    }\n\n    return new YogaValue(Float.parseFloat(s), YogaUnit.POINT);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.java",
    "content": "/*\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.yoga;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic enum YogaWrap {\n  NO_WRAP(0),\n  WRAP(1),\n  WRAP_REVERSE(2);\n\n  private int mIntValue;\n\n  YogaWrap(int intValue) {\n    mIntValue = intValue;\n  }\n\n  public int intValue() {\n    return mIntValue;\n  }\n\n  public static YogaWrap fromInt(int value) {\n    switch (value) {\n      case 0: return NO_WRAP;\n      case 1: return WRAP;\n      case 2: return WRAP_REVERSE;\n      default: throw new IllegalArgumentException(\"Unknown enum value: \" + value);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/Application.mk",
    "content": "APP_BUILD_SCRIPT := Android.mk\n\nAPP_ABI := armeabi-v7a x86\nAPP_PLATFORM := android-9\n\nAPP_MK_DIR := $(dir $(lastword $(MAKEFILE_LIST)))\n\nNDK_MODULE_PATH := $(APP_MK_DIR)$(HOST_DIRSEP)$(THIRD_PARTY_NDK_DIR)$(HOST_DIRSEP)$(REACT_COMMON_DIR)$(HOST_DIRSEP)$(APP_MK_DIR)first-party\n\nAPP_STL := gnustl_shared\n\n# Make sure every shared lib includes a .note.gnu.build-id header\nAPP_LDFLAGS := -Wl,--build-id\n\nNDK_TOOLCHAIN_VERSION := 4.8\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES:= \\\n       assert.cpp \\\n       jni/ByteBuffer.cpp \\\n       jni/Countable.cpp \\\n       jni/Environment.cpp \\\n       jni/Exceptions.cpp \\\n       jni/fbjni.cpp \\\n       jni/Hybrid.cpp \\\n       jni/jni_helpers.cpp \\\n       jni/LocalString.cpp \\\n       jni/OnLoad.cpp \\\n       jni/References.cpp \\\n       jni/WeakReference.cpp \\\n       log.cpp \\\n       lyra/lyra.cpp \\\n       onload.cpp \\\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/include\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include\n\nLOCAL_CFLAGS := -DLOG_TAG=\\\"libfb\\\" -DDISABLE_CPUCAP -DDISABLE_XPLAT -fexceptions -frtti\nLOCAL_CFLAGS += -Wall -Werror\n# include/utils/threads.h has unused parameters\nLOCAL_CFLAGS += -Wno-unused-parameter\nifeq ($(TOOLCHAIN_PERMISSIVE),true)\n  LOCAL_CFLAGS += -Wno-error=unused-but-set-variable\nendif\nLOCAL_CFLAGS += -DHAVE_POSIX_CLOCKS\n\nCXX11_FLAGS := -std=gnu++11\nLOCAL_CFLAGS += $(CXX11_FLAGS)\n\nLOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)\n\nLOCAL_LDLIBS := -llog -ldl -landroid\nLOCAL_EXPORT_LDLIBS := -llog\n\nLOCAL_MODULE := libfb\n\ninclude $(BUILD_SHARED_LIBRARY)\n\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\n# This target is only used in open source\nif IS_OSS_BUILD:\n  fb_xplat_cxx_library(\n    name = 'jni',\n    soname = 'libfb.$(ext)',\n    srcs = glob(['*.cpp', 'jni/*.cpp', 'lyra/*.cpp']),\n    header_namespace = '',\n    compiler_flags = [\n      '-fno-omit-frame-pointer',\n      '-fexceptions',\n      '-Wall',\n      '-Werror',\n      '-std=c++11',\n      '-DDISABLE_CPUCAP',\n      '-DDISABLE_XPLAT',\n    ],\n    exported_headers = subdir_glob([\n      ('include', 'fb/**/*.h'),\n      ('include', 'jni/*.h'),\n    ]),\n    deps = [\n      JNI_TARGET,\n    ],\n    visibility = ['PUBLIC'],\n  )\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/Doxyfile",
    "content": "PROJECT_NAME           = \"Facebook Android Support\"\nJAVADOC_AUTOBRIEF      = YES\nEXTRACT_ALL            = YES\nRECURSIVE              = YES\nEXCLUDE                = tests\nEXCLUDE_PATTERNS       = *.cpp\nGENERATE_HTML          = YES\nGENERATE_LATEX         = NO\nENABLE_PREPROCESSING   = YES\nHIDE_UNDOC_MEMBERS     = YES\nHIDE_SCOPE_NAMES       = YES\nHIDE_FRIEND_COMPOUNDS  = YES\nHIDE_UNDOC_CLASSES     = YES\nSHOW_INCLUDE_FILES     = NO\n#ENABLED_SECTIONS       = INTERNAL\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/ALog.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/** @file ALog.h\n *\n *  Very simple android only logging. Define LOG_TAG to enable the macros.\n */\n\n#pragma once\n\n#ifdef __ANDROID__\n\n#include <android/log.h>\n\nnamespace facebook {\nnamespace alog {\n\ntemplate<typename... ARGS>\ninline void log(int level, const char* tag, const char* msg, ARGS... args) noexcept {\n  __android_log_print(level, tag, msg, args...);\n}\n\ntemplate<typename... ARGS>\ninline void log(int level, const char* tag, const char* msg) noexcept {\n  __android_log_write(level, tag, msg);\n}\n\ntemplate<typename... ARGS>\ninline void logv(const char* tag, const char* msg, ARGS... args) noexcept {\n  log(ANDROID_LOG_VERBOSE, tag, msg, args...);\n}\n\ntemplate<typename... ARGS>\ninline void logd(const char* tag, const char* msg, ARGS... args) noexcept {\n  log(ANDROID_LOG_DEBUG, tag, msg, args...);\n}\n\ntemplate<typename... ARGS>\ninline void logi(const char* tag, const char* msg, ARGS... args) noexcept {\n  log(ANDROID_LOG_INFO, tag, msg, args...);\n}\n\ntemplate<typename... ARGS>\ninline void logw(const char* tag, const char* msg, ARGS... args) noexcept {\n  log(ANDROID_LOG_WARN, tag, msg, args...);\n}\n\ntemplate<typename... ARGS>\ninline void loge(const char* tag, const char* msg, ARGS... args) noexcept {\n  log(ANDROID_LOG_ERROR, tag, msg, args...);\n}\n\ntemplate<typename... ARGS>\ninline void logf(const char* tag, const char* msg, ARGS... args) noexcept {\n  log(ANDROID_LOG_FATAL, tag, msg, args...);\n}\n\n\n#ifdef LOG_TAG\n# define ALOGV(...) ::facebook::alog::logv(LOG_TAG, __VA_ARGS__)\n# define ALOGD(...) ::facebook::alog::logd(LOG_TAG, __VA_ARGS__)\n# define ALOGI(...) ::facebook::alog::logi(LOG_TAG, __VA_ARGS__)\n# define ALOGW(...) ::facebook::alog::logw(LOG_TAG, __VA_ARGS__)\n# define ALOGE(...) ::facebook::alog::loge(LOG_TAG, __VA_ARGS__)\n# define ALOGF(...) ::facebook::alog::logf(LOG_TAG, __VA_ARGS__)\n#endif\n\n}}\n\n#else\n# define ALOGV(...) ((void)0)\n# define ALOGD(...) ((void)0)\n# define ALOGI(...) ((void)0)\n# define ALOGW(...) ((void)0)\n# define ALOGE(...) ((void)0)\n# define ALOGF(...) ((void)0)\n#endif\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/Build.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <stdlib.h>\n\n#if defined(__ANDROID__)\n#  include <sys/system_properties.h>\n#endif\n\nnamespace facebook {\nnamespace build {\n\nstruct Build {\n  static int getAndroidSdk() {\n    static auto android_sdk = ([] {\n       char sdk_version_str[PROP_VALUE_MAX];\n       __system_property_get(\"ro.build.version.sdk\", sdk_version_str);\n       return atoi(sdk_version_str);\n    })();\n    return android_sdk;\n  }\n};\n\n} // build\n} // facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/Countable.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n#include <atomic>\n#include <fb/assert.h>\n#include <fb/noncopyable.h>\n#include <fb/nonmovable.h>\n#include <fb/RefPtr.h>\n\nnamespace facebook {\n\nclass Countable : public noncopyable, public nonmovable {\npublic:\n  // RefPtr expects refcount to start at 0\n  Countable() : m_refcount(0) {}\n  virtual ~Countable()\n  {\n    FBASSERT(m_refcount == 0);\n  }\n\nprivate:\n  void ref() {\n    ++m_refcount;\n  }\n\n  void unref() {\n    if (0 == --m_refcount) {\n      delete this;\n    }\n  }\n\n  bool hasOnlyOneRef() const {\n    return m_refcount == 1;\n  }\n\n  template <typename T> friend class RefPtr;\n  std::atomic<int> m_refcount;\n};\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/Doxyfile",
    "content": "PROJECT_NAME           = \"Facebook JNI\"\nPROJECT_BRIEF          = \"Helper library to provide safe and convenient access to JNI with very low overhead\"\nJAVADOC_AUTOBRIEF      = YES\nEXTRACT_ALL            = YES\nRECURSIVE              = YES\nEXCLUDE                = tests Asserts.h Countable.h GlobalReference.h LocalReference.h LocalString.h Registration.h WeakReference.h jni_helpers.h Environment.h\nEXCLUDE_PATTERNS       = *-inl.h *.cpp\nGENERATE_HTML          = YES\nGENERATE_LATEX         = NO\nENABLE_PREPROCESSING   = YES\nHIDE_UNDOC_MEMBERS     = YES\nHIDE_SCOPE_NAMES       = YES\nHIDE_FRIEND_COMPOUNDS  = YES\nHIDE_UNDOC_CLASSES     = YES\nSHOW_INCLUDE_FILES     = NO\nPREDEFINED             = LOG_TAG=fbjni\nEXAMPLE_PATH           = samples\n#ENABLED_SECTIONS       = INTERNAL\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/Environment.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n#include <functional>\n#include <string>\n#include <jni.h>\n\n#include <fb/visibility.h>\n\nnamespace facebook {\nnamespace jni {\n\nnamespace internal {\n  struct CacheEnvTag {};\n}\n\n// Keeps a thread-local reference to the current thread's JNIEnv.\nstruct Environment {\n  // May be null if this thread isn't attached to the JVM\n  FBEXPORT static JNIEnv* current();\n  static void initialize(JavaVM* vm);\n\n  // There are subtle issues with calling the next functions directly. It is\n  // much better to always use a ThreadScope to manage attaching/detaching for\n  // you.\n  FBEXPORT static JNIEnv* ensureCurrentThreadIsAttached();\n  FBEXPORT static void detachCurrentThread();\n};\n\n/**\n * RAII Object that attaches a thread to the JVM. Failing to detach from a thread before it\n * exits will cause a crash, as will calling Detach an extra time, and this guard class helps\n * keep that straight. In addition, it remembers whether it performed the attach or not, so it\n * is safe to nest it with itself or with non-fbjni code that manages the attachment correctly.\n *\n * Potential concerns:\n *  - Attaching to the JVM is fast (~100us on MotoG), but ideally you would attach while the\n *    app is not busy.\n *  - Having a thread detach at arbitrary points is not safe in Dalvik; you need to be sure that\n *    there is no Java code on the current stack or you run the risk of a crash like:\n *      ERROR: detaching thread with interp frames (count=18)\n *    (More detail at https://groups.google.com/forum/#!topic/android-ndk/2H8z5grNqjo)\n *    ThreadScope won't do a detach if the thread was already attached before the guard is\n *    instantiated, but there's probably some usage that could trip this up.\n *  - Newly attached C++ threads only get the bootstrap class loader -- i.e. java language\n *    classes, not any of our application's classes. This will be different behavior than threads\n *    that were initiated on the Java side. A workaround is to pass a global reference for a\n *    class or instance to the new thread; this bypasses the need for the class loader.\n *    (See http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/invocation.html#attach_current_thread)\n *    If you need access to the application's classes, you can use ThreadScope::WithClassLoader.\n */\nclass FBEXPORT ThreadScope {\n public:\n  ThreadScope();\n  ThreadScope(ThreadScope&) = delete;\n  ThreadScope(ThreadScope&&) = default;\n  ThreadScope& operator=(ThreadScope&) = delete;\n  ThreadScope& operator=(ThreadScope&&) = delete;\n  ~ThreadScope();\n\n  /**\n   * This runs the closure in a scope with fbjni's classloader. This should be\n   * the same classloader as the rest of the application and thus anything\n   * running in the closure will have access to the same classes as in a normal\n   * java-create thread.\n   */\n  static void WithClassLoader(std::function<void()>&& runnable);\n\n  static void OnLoad();\n\n  // This constructor is only used internally by fbjni.\n  ThreadScope(JNIEnv*, internal::CacheEnvTag);\n private:\n  friend struct Environment;\n  ThreadScope* previous_;\n  // If the JNIEnv* is set, it is guaranteed to be valid at least through the\n  // lifetime of this ThreadScope. The only case where that guarantee can be\n  // made is when there is a java frame in the stack below this.\n  JNIEnv* env_;\n  bool attachedWithThisScope_;\n};\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/ProgramLocation.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n#include <cstring>\n#include <string>\n#include <sstream>\n\nnamespace facebook {\n\n#define FROM_HERE facebook::ProgramLocation(__FUNCTION__, __FILE__, __LINE__)\n\nclass ProgramLocation {\npublic:\n  ProgramLocation() : m_functionName(\"Unspecified\"), m_fileName(\"Unspecified\"), m_lineNumber(0) {}\n\n  ProgramLocation(const char* functionName, const char* fileName, int line) :\n      m_functionName(functionName),\n      m_fileName(fileName),\n      m_lineNumber(line)\n    {}\n\n  const char* functionName() const { return m_functionName; }\n  const char* fileName() const { return m_fileName; }\n  int lineNumber() const { return m_lineNumber; }\n\n  std::string asFormattedString() const {\n    std::stringstream str;\n    str << \"Function \" << m_functionName << \" in file \" << m_fileName << \":\" << m_lineNumber;\n    return str.str();\n  }\n\n  bool operator==(const ProgramLocation& other) const {\n    // Assumes that the strings are static\n    return (m_functionName == other.m_functionName) && (m_fileName == other.m_fileName) && m_lineNumber == other.m_lineNumber;\n  }\n\nprivate:\n  const char* m_functionName;\n  const char* m_fileName;\n  int m_lineNumber;\n};\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/RefPtr.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n#include <utility>\n#include <fb/assert.h>\n\nnamespace facebook {\n\n// Reference counting smart pointer. This is designed to work with the\n// Countable class or other implementations in the future. It is designed in a\n// way to be both efficient and difficult to misuse. Typical usage is very\n// simple once you learn the patterns (and the compiler will help!):\n//\n// By default, the internal pointer is null.\n//   RefPtr<Foo> ref;\n//\n// Object creation requires explicit construction:\n//   RefPtr<Foo> ref = createNew<Foo>(...);\n//\n// Or if the constructor is not public:\n//   RefPtr<Foo> ref = adoptRef(new Foo(...));\n//\n// But you can implicitly create from nullptr:\n//   RefPtr<Foo> maybeRef = cond ? ref : nullptr;\n//\n// Move/Copy Construction/Assignment are straightforward:\n//   RefPtr<Foo> ref2 = ref;\n//   ref = std::move(ref2);\n//\n// Destruction automatically drops the RefPtr's reference as expected.\n//\n// Upcasting is implicit but downcasting requires an explicit cast:\n//   struct Bar : public Foo {};\n//   RefPtr<Bar> barRef = static_cast<RefPtr<Bar>>(ref);\n//   ref = barRef;\n//\ntemplate <class T>\nclass RefPtr {\npublic:\n  constexpr RefPtr() :\n    m_ptr(nullptr)\n  {}\n\n  // Allow implicit construction from a pointer only from nullptr\n  constexpr RefPtr(std::nullptr_t ptr) :\n    m_ptr(nullptr)\n  {}\n\n  RefPtr(const RefPtr<T>& ref) :\n    m_ptr(ref.m_ptr)\n  {\n    refIfNecessary(m_ptr);\n  }\n\n  // Only allow implicit upcasts. A downcast will result in a compile error\n  // unless you use static_cast (which will end up invoking the explicit\n  // operator below).\n  template <typename U>\n  RefPtr(const RefPtr<U>& ref, typename std::enable_if<std::is_base_of<T,U>::value, U>::type* = nullptr) :\n    m_ptr(ref.get())\n  {\n    refIfNecessary(m_ptr);\n  }\n\n  RefPtr(RefPtr<T>&& ref) :\n    m_ptr(nullptr)\n  {\n    *this = std::move(ref);\n  }\n\n  // Only allow implicit upcasts. A downcast will result in a compile error\n  // unless you use static_cast (which will end up invoking the explicit\n  // operator below).\n  template <typename U>\n  RefPtr(RefPtr<U>&& ref, typename std::enable_if<std::is_base_of<T,U>::value, U>::type* = nullptr) :\n    m_ptr(nullptr)\n  {\n    *this = std::move(ref);\n  }\n\n  ~RefPtr() {\n    unrefIfNecessary(m_ptr);\n    m_ptr = nullptr;\n  }\n\n  RefPtr<T>& operator=(const RefPtr<T>& ref) {\n    if (m_ptr != ref.m_ptr) {\n      unrefIfNecessary(m_ptr);\n      m_ptr = ref.m_ptr;\n      refIfNecessary(m_ptr);\n    }\n    return *this;\n  }\n\n  // The STL assumes rvalue references are unique and for simplicity's sake, we\n  // make the same assumption here, that &ref != this.\n  RefPtr<T>& operator=(RefPtr<T>&& ref) {\n    unrefIfNecessary(m_ptr);\n    m_ptr = ref.m_ptr;\n    ref.m_ptr = nullptr;\n    return *this;\n  }\n\n  template <typename U>\n  RefPtr<T>& operator=(RefPtr<U>&& ref) {\n    unrefIfNecessary(m_ptr);\n    m_ptr = ref.m_ptr;\n    ref.m_ptr = nullptr;\n    return *this;\n  }\n\n  void reset() {\n    unrefIfNecessary(m_ptr);\n    m_ptr = nullptr;\n  }\n\n  T* get() const {\n    return m_ptr;\n  }\n\n  T* operator->() const {\n    return m_ptr;\n  }\n\n  T& operator*() const {\n    return *m_ptr;\n  }\n\n  template <typename U>\n  explicit operator RefPtr<U> () const;\n\n  explicit operator bool() const {\n    return m_ptr ? true : false;\n  }\n\n  bool isTheLastRef() const {\n    FBASSERT(m_ptr);\n    return m_ptr->hasOnlyOneRef();\n  }\n\n  // Creates a strong reference from a raw pointer, assuming that is already\n  // referenced from some other RefPtr. This should be used sparingly.\n  static inline RefPtr<T> assumeAlreadyReffed(T* ptr) {\n    return RefPtr<T>(ptr, ConstructionMode::External);\n  }\n\n  // Creates a strong reference from a raw pointer, assuming that it points to a\n  // freshly-created object. See the documentation for RefPtr for usage.\n  static inline RefPtr<T> adoptRef(T* ptr) {\n    return RefPtr<T>(ptr, ConstructionMode::Adopted);\n  }\n\nprivate:\n  enum class ConstructionMode {\n    Adopted,\n    External\n  };\n\n  RefPtr(T* ptr, ConstructionMode mode) :\n    m_ptr(ptr)\n  {\n    FBASSERTMSGF(ptr, \"Got null pointer in %s construction mode\", mode == ConstructionMode::Adopted ? \"adopted\" : \"external\");\n    ptr->ref();\n    if (mode == ConstructionMode::Adopted) {\n      FBASSERT(ptr->hasOnlyOneRef());\n    }\n  }\n\n  static inline void refIfNecessary(T* ptr) {\n    if (ptr) {\n      ptr->ref();\n    }\n  }\n  static inline void unrefIfNecessary(T* ptr) {\n    if (ptr) {\n      ptr->unref();\n    }\n  }\n\n  template <typename U> friend class RefPtr;\n\n  T* m_ptr;\n};\n\n// Creates a strong reference from a raw pointer, assuming that is already\n// referenced from some other RefPtr and that it is non-null. This should be\n// used sparingly.\ntemplate <typename T>\nstatic inline RefPtr<T> assumeAlreadyReffed(T* ptr) {\n  return RefPtr<T>::assumeAlreadyReffed(ptr);\n}\n\n// As above, but tolerant of nullptr.\ntemplate <typename T>\nstatic inline RefPtr<T> assumeAlreadyReffedOrNull(T* ptr) {\n  return ptr ? RefPtr<T>::assumeAlreadyReffed(ptr) : nullptr;\n}\n\n// Creates a strong reference from a raw pointer, assuming that it points to a\n// freshly-created object. See the documentation for RefPtr for usage.\ntemplate <typename T>\nstatic inline RefPtr<T> adoptRef(T* ptr) {\n  return RefPtr<T>::adoptRef(ptr);\n}\n\ntemplate <typename T, typename ...Args>\nstatic inline RefPtr<T> createNew(Args&&... arguments) {\n  return RefPtr<T>::adoptRef(new T(std::forward<Args>(arguments)...));\n}\n\ntemplate <typename T> template <typename U>\nRefPtr<T>::operator RefPtr<U>() const {\n  static_assert(std::is_base_of<T, U>::value, \"Invalid static cast\");\n  return assumeAlreadyReffedOrNull<U>(static_cast<U*>(m_ptr));\n}\n\ntemplate <typename T, typename U>\ninline bool operator==(const RefPtr<T>& a, const RefPtr<U>& b) {\n  return a.get() == b.get();\n}\n\ntemplate <typename T, typename U>\ninline bool operator!=(const RefPtr<T>& a, const RefPtr<U>& b) {\n  return a.get() != b.get();\n}\n\ntemplate <typename T, typename U>\ninline bool operator==(const RefPtr<T>& ref, U* ptr) {\n  return ref.get() == ptr;\n}\n\ntemplate <typename T, typename U>\ninline bool operator!=(const RefPtr<T>& ref, U* ptr) {\n  return ref.get() != ptr;\n}\n\ntemplate <typename T, typename U>\ninline bool operator==(U* ptr, const RefPtr<T>& ref) {\n  return ref.get() == ptr;\n}\n\ntemplate <typename T, typename U>\ninline bool operator!=(U* ptr, const RefPtr<T>& ref) {\n  return ref.get() != ptr;\n}\n\ntemplate <typename T>\ninline bool operator==(const RefPtr<T>& ref, std::nullptr_t ptr) {\n  return ref.get() == ptr;\n}\n\ntemplate <typename T>\ninline bool operator!=(const RefPtr<T>& ref, std::nullptr_t ptr) {\n  return ref.get() != ptr;\n}\n\ntemplate <typename T>\ninline bool operator==(std::nullptr_t ptr, const RefPtr<T>& ref) {\n  return ref.get() == ptr;\n}\n\ntemplate <typename T>\ninline bool operator!=(std::nullptr_t ptr, const RefPtr<T>& ref) {\n  return ref.get() != ptr;\n}\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/StaticInitialized.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n#include <fb/assert.h>\n#include <utility>\n\nnamespace facebook {\n\n// Class that lets you declare a global but does not add a static constructor\n// to the binary. Eventually I'd like to have this auto-initialize in a\n// multithreaded environment but for now it's easiest just to use manual\n// initialization.\ntemplate <typename T>\nclass StaticInitialized {\npublic:\n  constexpr StaticInitialized() :\n    m_instance(nullptr)\n  {}\n\n  template <typename ...Args>\n  void initialize(Args&&... arguments) {\n    FBASSERT(!m_instance);\n    m_instance = new T(std::forward<Args>(arguments)...);\n  }\n\n  T* operator->() const {\n    return m_instance;\n  }\nprivate:\n  T* m_instance;\n};\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/ThreadLocal.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <pthread.h>\n#include <errno.h>\n\n#include <fb/assert.h>\n\nnamespace facebook {\n\n///////////////////////////////////////////////////////////////////////////////\n\n/**\n * A thread-local object is a \"global\" object within a thread. This is useful\n * for writing apartment-threaded code, where nothing is actullay shared\n * between different threads (hence no locking) but those variables are not\n * on stack in local scope. To use it, just do something like this,\n *\n *   ThreadLocal<MyClass> static_object;\n *     static_object->data_ = ...;\n *     static_object->doSomething();\n *\n *   ThreadLocal<int> static_number;\n *     int value = *static_number;\n *\n * So, syntax-wise it's similar to pointers. T can be primitive types, and if\n * it's a class, there has to be a default constructor.\n */\ntemplate<typename T>\nclass ThreadLocal {\npublic:\n  /**\n   * Constructor that has to be called from a thread-neutral place.\n   */\n  ThreadLocal() :\n    m_key(0),\n    m_cleanup(OnThreadExit) {\n    initialize();\n  }\n\n  /**\n   * As above but with a custom cleanup function\n   */\n  typedef void (*CleanupFunction)(void* obj);\n  explicit ThreadLocal(CleanupFunction cleanup) :\n    m_key(0),\n    m_cleanup(cleanup) {\n    FBASSERT(cleanup);\n    initialize();\n  }\n\n  /**\n   * Access object's member or method through this operator overload.\n   */\n  T *operator->() const {\n    return get();\n  }\n\n  T &operator*() const {\n    return *get();\n  }\n\n  T *get() const {\n    return (T*)pthread_getspecific(m_key);\n  }\n\n  T* release() {\n    T* obj = get();\n    pthread_setspecific(m_key, NULL);\n    return obj;\n  }\n\n  void reset(T* other = NULL) {\n    T* old = (T*)pthread_getspecific(m_key);\n    if (old != other) {\n      FBASSERT(m_cleanup);\n      m_cleanup(old);\n      pthread_setspecific(m_key, other);\n    }\n  }\n\nprivate:\n  void initialize() {\n    int ret = pthread_key_create(&m_key, m_cleanup);\n    if (ret != 0) {\n      const char *msg = \"(unknown error)\";\n      switch (ret) {\n      case EAGAIN:\n        msg = \"PTHREAD_KEYS_MAX (1024) is exceeded\";\n        break;\n      case ENOMEM:\n        msg = \"Out-of-memory\";\n        break;\n      }\n      (void) msg;\n      FBASSERTMSGF(0, \"pthread_key_create failed: %d %s\", ret, msg);\n    }\n  }\n\n  static void OnThreadExit(void *obj) {\n    if (NULL != obj) {\n      delete (T*)obj;\n    }\n  }\n\n  pthread_key_t m_key;\n  CleanupFunction m_cleanup;\n};\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/assert.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#ifndef FBASSERT_H\n#define FBASSERT_H\n\n#include <fb/visibility.h>\n\nnamespace facebook {\n#define ENABLE_FBASSERT 1\n\n#if ENABLE_FBASSERT\n#define FBASSERTMSGF(expr, msg, ...) !(expr) ? facebook::assertInternal(\"Assert (%s:%d): \" msg, __FILE__, __LINE__, ##__VA_ARGS__) : (void) 0\n#else\n#define FBASSERTMSGF(expr, msg, ...)\n#endif // ENABLE_FBASSERT\n\n#define FBASSERT(expr) FBASSERTMSGF(expr, \"%s\", #expr)\n\n#define FBCRASH(msg, ...) facebook::assertInternal(\"Fatal error (%s:%d): \" msg, __FILE__, __LINE__, ##__VA_ARGS__)\n#define FBUNREACHABLE() facebook::assertInternal(\"This code should be unreachable (%s:%d)\", __FILE__, __LINE__)\n\nFBEXPORT void assertInternal(const char* formatstr, ...) __attribute__((noreturn));\n\n// This allows storing the assert message before the current process terminates due to a crash\ntypedef void (*AssertHandler)(const char* message);\nvoid setAssertHandler(AssertHandler assertHandler);\n\n} // namespace facebook\n#endif // FBASSERT_H\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Boxed.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include \"CoreClasses.h\"\n\nnamespace facebook {\nnamespace jni {\n\nnamespace detail {\ntemplate <typename T, typename jprim>\nstruct JPrimitive : JavaClass<T> {\n  using typename JavaClass<T>::javaobject;\n  using JavaClass<T>::javaClassStatic;\n  static local_ref<javaobject> valueOf(jprim val) {\n    static auto cls = javaClassStatic();\n    static auto method =\n      cls->template getStaticMethod<javaobject(jprim)>(\"valueOf\");\n    return method(cls, val);\n  }\n  jprim value() const {\n    static auto method =\n      javaClassStatic()->template getMethod<jprim()>(T::kValueMethod);\n    return method(this->self());\n  }\n};\n\n} // namespace detail\n\n\n#define DEFINE_BOXED_PRIMITIVE(LITTLE, BIG)                          \\\n  struct J ## BIG : detail::JPrimitive<J ## BIG, j ## LITTLE> {      \\\n    static auto constexpr kJavaDescriptor = \"Ljava/lang/\" #BIG \";\";  \\\n    static auto constexpr kValueMethod = #LITTLE \"Value\";            \\\n    j ## LITTLE LITTLE ## Value() const {                            \\\n      return value();                                                \\\n    }                                                                \\\n  };                                                                 \\\n  inline local_ref<jobject> autobox(j ## LITTLE val) {               \\\n    return J ## BIG::valueOf(val);                                   \\\n  }\n\nDEFINE_BOXED_PRIMITIVE(boolean, Boolean)\nDEFINE_BOXED_PRIMITIVE(byte, Byte)\nDEFINE_BOXED_PRIMITIVE(char, Character)\nDEFINE_BOXED_PRIMITIVE(short, Short)\nDEFINE_BOXED_PRIMITIVE(int, Integer)\nDEFINE_BOXED_PRIMITIVE(long, Long)\nDEFINE_BOXED_PRIMITIVE(float, Float)\nDEFINE_BOXED_PRIMITIVE(double, Double)\n\n#undef DEFINE_BOXED_PRIMITIVE\n\nstruct JVoid : public jni::JavaClass<JVoid> {\n  static auto constexpr kJavaDescriptor = \"Ljava/lang/Void;\";\n};\n\ninline local_ref<jobject> autobox(alias_ref<jobject> val) {\n  return make_local(val);\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/ByteBuffer.h",
    "content": "/*\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <fb/visibility.h>\n\n#include \"CoreClasses.h\"\n#include \"References-forward.h\"\n\nnamespace facebook {\nnamespace jni {\n\n// JNI's NIO support has some awkward preconditions and error reporting. This\n// class provides much more user-friendly access.\nclass FBEXPORT JByteBuffer : public JavaClass<JByteBuffer> {\n public:\n  static constexpr const char* kJavaDescriptor = \"Ljava/nio/ByteBuffer;\";\n\n  static local_ref<JByteBuffer> wrapBytes(uint8_t* data, size_t size);\n\n  bool isDirect() const;\n\n  uint8_t* getDirectBytes() const;\n  size_t getDirectSize() const;\n};\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Common.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/** @file Common.h\n *\n * Defining the stuff that don't deserve headers of their own...\n */\n\n#pragma once\n\n#include <functional>\n\n#include <jni.h>\n\n#include <fb/visibility.h>\n#include <fb/Environment.h>\n\n#ifdef FBJNI_DEBUG_REFS\n# ifdef __ANDROID__\n#  include <android/log.h>\n# else\n#  include <cstdio>\n# endif\n#endif\n\n// If a pending JNI Java exception is found, wraps it in a JniException object and throws it as\n// a C++ exception.\n#define FACEBOOK_JNI_THROW_PENDING_EXCEPTION() \\\n  ::facebook::jni::throwPendingJniExceptionAsCppException()\n\n// If the condition is true, throws a JniException object, which wraps the pending JNI Java\n// exception if any. If no pending exception is found, throws a JniException object that wraps a\n// RuntimeException throwable. \n#define FACEBOOK_JNI_THROW_EXCEPTION_IF(CONDITION) \\\n  ::facebook::jni::throwCppExceptionIf(CONDITION)\n\n/// @cond INTERNAL\n\nnamespace facebook {\nnamespace jni {\n\nFBEXPORT void throwPendingJniExceptionAsCppException();\nFBEXPORT void throwCppExceptionIf(bool condition);\n\n[[noreturn]] FBEXPORT void throwNewJavaException(jthrowable);\n[[noreturn]] FBEXPORT void throwNewJavaException(const char* throwableName, const char* msg);\ntemplate<typename... Args>\n[[noreturn]] void throwNewJavaException(const char* throwableName, const char* fmt, Args... args);\n\n\n/**\n * This needs to be called at library load time, typically in your JNI_OnLoad method.\n *\n * The intended use is to return the result of initialize() directly\n * from JNI_OnLoad and to do nothing else there. Library specific\n * initialization code should go in the function passed to initialize\n * (which can be, and probably should be, a C++ lambda). This approach\n * provides correct error handling and translation errors during\n * initialization into Java exceptions when appropriate.\n *\n * Failure to call this will cause your code to crash in a remarkably\n * unhelpful way (typically a segfault) while trying to handle an exception\n * which occurs later.\n */\nFBEXPORT jint initialize(JavaVM*, std::function<void()>&&) noexcept;\n\nnamespace internal {\n\n/**\n * Retrieve a pointer the JNI environment of the current thread.\n *\n * @pre The current thread must be attached to the VM\n */\ninline JNIEnv* getEnv() noexcept {\n  // TODO(T6594868) Benchmark against raw JNI access\n  return Environment::current();\n}\n\n// Define to get extremely verbose logging of references and to enable reference stats\n#ifdef FBJNI_DEBUG_REFS\ntemplate<typename... Args>\ninline void dbglog(const char* msg, Args... args) {\n# ifdef __ANDROID__\n  __android_log_print(ANDROID_LOG_VERBOSE, \"fbjni_dbg\", msg, args...);\n# else\n  std::fprintf(stderr, msg, args...);\n# endif\n}\n\n#else\n\ntemplate<typename... Args>\ninline void dbglog(const char*, Args...) {\n}\n\n#endif\n\n}}}\n\n/// @endcond\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Context.h",
    "content": "/*\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include \"CoreClasses.h\"\n#include \"File.h\"\n\nnamespace facebook {\nnamespace jni {\n\nclass AContext : public JavaClass<AContext> {\n public:\n  static constexpr const char* kJavaDescriptor = \"Landroid/content/Context;\";\n\n  // Define a method that calls into the represented Java class\n  local_ref<JFile::javaobject> getCacheDir() {\n    static auto method = getClass()->getMethod<JFile::javaobject()>(\"getCacheDir\");\n    return method(self());\n  }\n\n  local_ref<JFile::javaobject> getFilesDir() {\n    static auto method = getClass()->getMethod<JFile::javaobject()>(\"getFilesDir\");\n    return method(self());\n  }\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/CoreClasses-inl.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <string.h>\n#include <type_traits>\n#include <stdlib.h>\n\n#include \"Common.h\"\n#include \"Exceptions.h\"\n#include \"Meta.h\"\n#include \"MetaConvert.h\"\n\nnamespace facebook {\nnamespace jni {\n\n// jobject /////////////////////////////////////////////////////////////////////////////////////////\n\ninline bool isSameObject(alias_ref<JObject> lhs, alias_ref<JObject> rhs) noexcept {\n  return internal::getEnv()->IsSameObject(lhs.get(), rhs.get()) != JNI_FALSE;\n}\n\ninline local_ref<JClass> JObject::getClass() const noexcept {\n  return adopt_local(internal::getEnv()->GetObjectClass(self()));\n}\n\ninline bool JObject::isInstanceOf(alias_ref<JClass> cls) const noexcept {\n  return internal::getEnv()->IsInstanceOf(self(), cls.get()) != JNI_FALSE;\n}\n\ntemplate<typename T>\ninline T JObject::getFieldValue(JField<T> field) const noexcept {\n  return field.get(self());\n}\n\ntemplate<typename T>\ninline local_ref<T*> JObject::getFieldValue(JField<T*> field) const noexcept {\n  return adopt_local(field.get(self()));\n}\n\ntemplate<typename T>\ninline void JObject::setFieldValue(JField<T> field, T value) noexcept {\n  field.set(self(), value);\n}\n\ninline std::string JObject::toString() const {\n  static auto method = findClassLocal(\"java/lang/Object\")->getMethod<jstring()>(\"toString\");\n\n  return method(self())->toStdString();\n}\n\n\n// Class is here instead of CoreClasses.h because we need\n// alias_ref to be complete.\nclass MonitorLock {\n public:\n  inline MonitorLock() noexcept;\n  inline MonitorLock(alias_ref<JObject> object) noexcept;\n  inline ~MonitorLock() noexcept;\n\n  inline MonitorLock(MonitorLock&& other) noexcept;\n  inline MonitorLock& operator=(MonitorLock&& other) noexcept;\n\n  inline MonitorLock(const MonitorLock&) = delete;\n  inline MonitorLock& operator=(const MonitorLock&) = delete;\n\n private:\n  inline void reset() noexcept;\n  alias_ref<JObject> owned_;\n};\n\nMonitorLock::MonitorLock() noexcept : owned_(nullptr) {}\n\nMonitorLock::MonitorLock(alias_ref<JObject> object) noexcept\n    : owned_(object) {\n  internal::getEnv()->MonitorEnter(object.get());\n}\n\nvoid MonitorLock::reset() noexcept {\n  if (owned_) {\n    internal::getEnv()->MonitorExit(owned_.get());\n    if (internal::getEnv()->ExceptionCheck()) {\n      abort(); // Lock mismatch\n    }\n    owned_ = nullptr;\n  }\n}\n\nMonitorLock::~MonitorLock() noexcept {\n  reset();\n}\n\nMonitorLock::MonitorLock(MonitorLock&& other) noexcept\n    : owned_(other.owned_)\n{\n  other.owned_ = nullptr;\n}\n\nMonitorLock& MonitorLock::operator=(MonitorLock&& other) noexcept {\n  reset();\n  owned_ = other.owned_;\n  other.owned_ = nullptr;\n  return *this;\n}\n\ninline MonitorLock JObject::lock() const noexcept {\n  return MonitorLock(this_);\n}\n\ninline jobject JObject::self() const noexcept {\n  return this_;\n}\n\ninline void swap(JObject& a, JObject& b) noexcept {\n  using std::swap;\n  swap(a.this_, b.this_);\n}\n\n// JavaClass ///////////////////////////////////////////////////////////////////////////////////////\n\nnamespace detail {\ntemplate<typename JC, typename... Args>\nstatic local_ref<JC> newInstance(Args... args) {\n  static auto cls = JC::javaClassStatic();\n  static auto constructor = cls->template getConstructor<typename JC::javaobject(Args...)>();\n  return cls->newObject(constructor, args...);\n}\n}\n\n\ntemplate <typename T, typename B, typename J>\nauto JavaClass<T, B, J>::self() const noexcept -> javaobject {\n  return static_cast<javaobject>(JObject::self());\n}\n\n// jclass //////////////////////////////////////////////////////////////////////////////////////////\n\nnamespace detail {\n\n// This is not a real type.  It is used so people won't accidentally\n// use a void* to initialize a NativeMethod.\nstruct NativeMethodWrapper;\n\n}\n\nstruct NativeMethod {\n  const char* name;\n  std::string descriptor;\n  detail::NativeMethodWrapper* wrapper;\n};\n\ninline local_ref<JClass> JClass::getSuperclass() const noexcept {\n  return adopt_local(internal::getEnv()->GetSuperclass(self()));\n}\n\ninline void JClass::registerNatives(std::initializer_list<NativeMethod> methods) {\n  const auto env = internal::getEnv();\n\n  JNINativeMethod jnimethods[methods.size()];\n  size_t i = 0;\n  for (auto it = methods.begin(); it < methods.end(); ++it, ++i) {\n    jnimethods[i].name = it->name;\n    jnimethods[i].signature = it->descriptor.c_str();\n    jnimethods[i].fnPtr = reinterpret_cast<void*>(it->wrapper);\n  }\n\n  auto result = env->RegisterNatives(self(), jnimethods, methods.size());\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(result != JNI_OK);\n}\n\ninline bool JClass::isAssignableFrom(alias_ref<JClass> other) const noexcept {\n  const auto env = internal::getEnv();\n  // Ths method has behavior compatible with the\n  // java.lang.Class#isAssignableFrom method.  The order of the\n  // arguments to the JNI IsAssignableFrom C function is \"opposite\"\n  // from what some might expect, which makes this code look a little\n  // odd, but it is correct.\n  const auto result = env->IsAssignableFrom(other.get(), self());\n  return result;\n}\n\ntemplate<typename F>\ninline JConstructor<F> JClass::getConstructor() const {\n  return getConstructor<F>(jmethod_traits_from_cxx<F>::constructor_descriptor().c_str());\n}\n\ntemplate<typename F>\ninline JConstructor<F> JClass::getConstructor(const char* descriptor) const {\n  constexpr auto constructor_method_name = \"<init>\";\n  return getMethod<F>(constructor_method_name, descriptor);\n}\n\ntemplate<typename F>\ninline JMethod<F> JClass::getMethod(const char* name) const {\n  return getMethod<F>(name, jmethod_traits_from_cxx<F>::descriptor().c_str());\n}\n\ntemplate<typename F>\ninline JMethod<F> JClass::getMethod(\n    const char* name,\n    const char* descriptor) const {\n  const auto env = internal::getEnv();\n  const auto method = env->GetMethodID(self(), name, descriptor);\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(!method);\n  return JMethod<F>{method};\n}\n\ntemplate<typename F>\ninline JStaticMethod<F> JClass::getStaticMethod(const char* name) const {\n  return getStaticMethod<F>(name, jmethod_traits_from_cxx<F>::descriptor().c_str());\n}\n\ntemplate<typename F>\ninline JStaticMethod<F> JClass::getStaticMethod(\n    const char* name,\n    const char* descriptor) const {\n  const auto env = internal::getEnv();\n  const auto method = env->GetStaticMethodID(self(), name, descriptor);\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(!method);\n  return JStaticMethod<F>{method};\n}\n\ntemplate<typename F>\ninline JNonvirtualMethod<F> JClass::getNonvirtualMethod(const char* name) const {\n  return getNonvirtualMethod<F>(name, jmethod_traits_from_cxx<F>::descriptor().c_str());\n}\n\ntemplate<typename F>\ninline JNonvirtualMethod<F> JClass::getNonvirtualMethod(\n    const char* name,\n    const char* descriptor) const {\n  const auto env = internal::getEnv();\n  const auto method = env->GetMethodID(self(), name, descriptor);\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(!method);\n  return JNonvirtualMethod<F>{method};\n}\n\ntemplate<typename T>\ninline JField<enable_if_t<IsJniScalar<T>(), T>>\nJClass::getField(const char* name) const {\n  return getField<T>(name, jtype_traits<T>::descriptor().c_str());\n}\n\ntemplate<typename T>\ninline JField<enable_if_t<IsJniScalar<T>(), T>> JClass::getField(\n    const char* name,\n    const char* descriptor) const {\n  const auto env = internal::getEnv();\n  auto field = env->GetFieldID(self(), name, descriptor);\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(!field);\n  return JField<T>{field};\n}\n\ntemplate<typename T>\ninline JStaticField<enable_if_t<IsJniScalar<T>(), T>> JClass::getStaticField(\n    const char* name) const {\n  return getStaticField<T>(name, jtype_traits<T>::descriptor().c_str());\n}\n\ntemplate<typename T>\ninline JStaticField<enable_if_t<IsJniScalar<T>(), T>> JClass::getStaticField(\n    const char* name,\n    const char* descriptor) const {\n  const auto env = internal::getEnv();\n  auto field = env->GetStaticFieldID(self(), name, descriptor);\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(!field);\n  return JStaticField<T>{field};\n}\n\ntemplate<typename T>\ninline T JClass::getStaticFieldValue(JStaticField<T> field) const noexcept {\n  return field.get(self());\n}\n\ntemplate<typename T>\ninline local_ref<T*> JClass::getStaticFieldValue(JStaticField<T*> field) noexcept {\n  return adopt_local(field.get(self()));\n}\n\ntemplate<typename T>\ninline void JClass::setStaticFieldValue(JStaticField<T> field, T value) noexcept {\n  field.set(self(), value);\n}\n\ntemplate<typename R, typename... Args>\ninline local_ref<R> JClass::newObject(\n    JConstructor<R(Args...)> constructor,\n    Args... args) const {\n  const auto env = internal::getEnv();\n  auto object = env->NewObject(self(), constructor.getId(),\n      detail::callToJni(\n        detail::Convert<typename std::decay<Args>::type>::toCall(args))...);\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(!object);\n  return adopt_local(static_cast<R>(object));\n}\n\ninline jclass JClass::self() const noexcept {\n  return static_cast<jclass>(JObject::self());\n}\n\ninline void registerNatives(const char* name, std::initializer_list<NativeMethod> methods) {\n  findClassLocal(name)->registerNatives(methods);\n}\n\n\n// jstring /////////////////////////////////////////////////////////////////////////////////////////\n\ninline local_ref<JString> make_jstring(const std::string& modifiedUtf8) {\n  return make_jstring(modifiedUtf8.c_str());\n}\n\nnamespace detail {\n// convert to std::string from jstring\ntemplate <>\nstruct Convert<std::string> {\n  typedef jstring jniType;\n  static std::string fromJni(jniType t) {\n    return wrap_alias(t)->toStdString();\n  }\n  static jniType toJniRet(const std::string& t) {\n    return make_jstring(t).release();\n  }\n  static local_ref<JString> toCall(const std::string& t) {\n    return make_jstring(t);\n  }\n};\n\n// convert return from const char*\ntemplate <>\nstruct Convert<const char*> {\n  typedef jstring jniType;\n  // no automatic synthesis of const char*.  (It can't be freed.)\n  static jniType toJniRet(const char* t) {\n    return make_jstring(t).release();\n  }\n  static local_ref<JString> toCall(const char* t) {\n    return make_jstring(t);\n  }\n};\n}\n\n// jtypeArray //////////////////////////////////////////////////////////////////////////////////////\n\nnamespace detail {\ninline size_t JArray::size() const noexcept {\n  const auto env = internal::getEnv();\n  return env->GetArrayLength(self());\n}\n}\n\nnamespace detail {\ntemplate<typename Target>\ninline ElementProxy<Target>::ElementProxy(\n    Target* target,\n    size_t idx)\n    : target_{target}, idx_{idx} {}\n\ntemplate<typename Target>\ninline ElementProxy<Target>& ElementProxy<Target>::operator=(const T& o) {\n  target_->setElement(idx_, o);\n  return *this;\n}\n\ntemplate<typename Target>\ninline ElementProxy<Target>& ElementProxy<Target>::operator=(alias_ref<T>& o) {\n  target_->setElement(idx_, o.get());\n  return *this;\n}\n\ntemplate<typename Target>\ninline ElementProxy<Target>& ElementProxy<Target>::operator=(alias_ref<T>&& o) {\n  target_->setElement(idx_, o.get());\n  return *this;\n}\n\ntemplate<typename Target>\ninline ElementProxy<Target>& ElementProxy<Target>::operator=(const ElementProxy<Target>& o) {\n  auto src = o.target_->getElement(o.idx_);\n  target_->setElement(idx_, src.get());\n  return *this;\n}\n\ntemplate<typename Target>\ninline ElementProxy<Target>::ElementProxy::operator const local_ref<T> () const {\n  return target_->getElement(idx_);\n}\n\ntemplate<typename Target>\ninline ElementProxy<Target>::ElementProxy::operator local_ref<T> () {\n  return target_->getElement(idx_);\n}\n}\n\ntemplate <typename T>\nstd::string JArrayClass<T>::get_instantiated_java_descriptor() {\n  return \"[\" + jtype_traits<T>::descriptor();\n};\n\ntemplate <typename T>\nstd::string JArrayClass<T>::get_instantiated_base_name() {\n  return get_instantiated_java_descriptor();\n};\n\ntemplate<typename T>\nauto JArrayClass<T>::newArray(size_t size) -> local_ref<javaobject> {\n  static auto elementClass = findClassStatic(jtype_traits<T>::base_name().c_str());\n  const auto env = internal::getEnv();\n  auto rawArray = env->NewObjectArray(size, elementClass.get(), nullptr);\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(!rawArray);\n  return adopt_local(static_cast<javaobject>(rawArray));\n}\n\ntemplate<typename T>\ninline void JArrayClass<T>::setElement(size_t idx, const T& value) {\n  const auto env = internal::getEnv();\n  env->SetObjectArrayElement(this->self(), idx, value);\n}\n\ntemplate<typename T>\ninline local_ref<T> JArrayClass<T>::getElement(size_t idx) {\n  const auto env = internal::getEnv();\n  auto rawElement = env->GetObjectArrayElement(this->self(), idx);\n  return adopt_local(static_cast<T>(rawElement));\n}\n\ntemplate<typename T>\ninline detail::ElementProxy<JArrayClass<T>> JArrayClass<T>::operator[](size_t index) {\n  return detail::ElementProxy<JArrayClass<T>>(this, index);\n}\n\n// jarray /////////////////////////////////////////////////////////////////////////////////////////\n\ntemplate <typename JArrayType>\nauto JPrimitiveArray<JArrayType>::getRegion(jsize start, jsize length)\n    -> std::unique_ptr<T[]> {\n  using T = typename jtype_traits<JArrayType>::entry_type;\n  auto buf = std::unique_ptr<T[]>{new T[length]};\n  getRegion(start, length, buf.get());\n  return buf;\n}\n\ntemplate <typename JArrayType>\nstd::string JPrimitiveArray<JArrayType>::get_instantiated_java_descriptor() {\n  return jtype_traits<JArrayType>::descriptor();\n}\ntemplate <typename JArrayType>\nstd::string JPrimitiveArray<JArrayType>::get_instantiated_base_name() {\n  return JPrimitiveArray::get_instantiated_java_descriptor();\n}\n\ntemplate <typename JArrayType>\nauto JPrimitiveArray<JArrayType>::pin() -> PinnedPrimitiveArray<T, PinnedArrayAlloc<T>> {\n  return PinnedPrimitiveArray<T, PinnedArrayAlloc<T>>{this->self(), 0, 0};\n}\n\ntemplate <typename JArrayType>\nauto JPrimitiveArray<JArrayType>::pinRegion(jsize start, jsize length)\n    -> PinnedPrimitiveArray<T, PinnedRegionAlloc<T>> {\n  return PinnedPrimitiveArray<T, PinnedRegionAlloc<T>>{this->self(), start, length};\n}\n\ntemplate <typename JArrayType>\nauto JPrimitiveArray<JArrayType>::pinCritical()\n    -> PinnedPrimitiveArray<T, PinnedCriticalAlloc<T>> {\n  return PinnedPrimitiveArray<T, PinnedCriticalAlloc<T>>{this->self(), 0, 0};\n}\n\ntemplate <typename T>\nclass PinnedArrayAlloc {\n public:\n  static void allocate(\n      alias_ref<typename jtype_traits<T>::array_type> array,\n      jsize start,\n      jsize length,\n      T** elements,\n      size_t* size,\n      jboolean* isCopy) {\n    (void) start;\n    (void) length;\n    *elements = array->getElements(isCopy);\n    *size = array->size();\n  }\n  static void release(\n      alias_ref<typename jtype_traits<T>::array_type> array,\n      T* elements,\n      jint start,\n      jint size,\n      jint mode) {\n    (void) start;\n    (void) size;\n    array->releaseElements(elements, mode);\n  }\n};\n\ntemplate <typename T>\nclass PinnedCriticalAlloc {\n public:\n  static void allocate(\n      alias_ref<typename jtype_traits<T>::array_type> array,\n      jsize start,\n      jsize length,\n      T** elements,\n      size_t* size,\n      jboolean* isCopy) {\n    const auto env = internal::getEnv();\n    *elements = static_cast<T*>(env->GetPrimitiveArrayCritical(array.get(), isCopy));\n    FACEBOOK_JNI_THROW_EXCEPTION_IF(!elements);\n    *size = array->size();\n  }\n  static void release(\n      alias_ref<typename jtype_traits<T>::array_type> array,\n      T* elements,\n      jint start,\n      jint size,\n      jint mode) {\n    const auto env = internal::getEnv();\n    env->ReleasePrimitiveArrayCritical(array.get(), elements, mode);\n  }\n};\n\ntemplate <typename T>\nclass PinnedRegionAlloc {\n public:\n  static void allocate(\n      alias_ref<typename jtype_traits<T>::array_type> array,\n      jsize start,\n      jsize length,\n      T** elements,\n      size_t* size,\n      jboolean* isCopy) {\n    auto buf = array->getRegion(start, length);\n    FACEBOOK_JNI_THROW_EXCEPTION_IF(!buf);\n    *elements = buf.release();\n    *size = length;\n    *isCopy = true;\n  }\n  static void release(\n      alias_ref<typename jtype_traits<T>::array_type> array,\n      T* elements,\n      jint start,\n      jint size,\n      jint mode) {\n    std::unique_ptr<T[]> holder;\n    if (mode == 0 || mode == JNI_ABORT) {\n      holder.reset(elements);\n    }\n    if (mode == 0 || mode == JNI_COMMIT) {\n      array->setRegion(start, size, elements);\n    }\n  }\n};\n\n// PinnedPrimitiveArray ///////////////////////////////////////////////////////////////////////////\n\ntemplate<typename T, typename Alloc>\nPinnedPrimitiveArray<T, Alloc>::PinnedPrimitiveArray(PinnedPrimitiveArray&& o) {\n  *this = std::move(o);\n}\n\ntemplate<typename T, typename Alloc>\nPinnedPrimitiveArray<T, Alloc>&\nPinnedPrimitiveArray<T, Alloc>::operator=(PinnedPrimitiveArray&& o) {\n  if (array_) {\n    release();\n  }\n  array_ = std::move(o.array_);\n  elements_ = o.elements_;\n  isCopy_ = o.isCopy_;\n  size_ = o.size_;\n  start_ = o.start_;\n  o.clear();\n  return *this;\n}\n\ntemplate<typename T, typename Alloc>\nT* PinnedPrimitiveArray<T, Alloc>::get() {\n  return elements_;\n}\n\ntemplate<typename T, typename Alloc>\ninline void PinnedPrimitiveArray<T, Alloc>::release() {\n  releaseImpl(0);\n  clear();\n}\n\ntemplate<typename T, typename Alloc>\ninline void PinnedPrimitiveArray<T, Alloc>::commit() {\n  releaseImpl(JNI_COMMIT);\n}\n\ntemplate<typename T, typename Alloc>\ninline void PinnedPrimitiveArray<T, Alloc>::abort() {\n  releaseImpl(JNI_ABORT);\n  clear();\n}\n\ntemplate <typename T, typename Alloc>\ninline void PinnedPrimitiveArray<T, Alloc>::releaseImpl(jint mode) {\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(array_.get() == nullptr);\n  Alloc::release(array_, elements_, start_, size_, mode);\n}\n\ntemplate<typename T, typename Alloc>\ninline void PinnedPrimitiveArray<T, Alloc>::clear() noexcept {\n  array_ = nullptr;\n  elements_ = nullptr;\n  isCopy_ = false;\n  start_ = 0;\n  size_ = 0;\n}\n\ntemplate<typename T, typename Alloc>\ninline T& PinnedPrimitiveArray<T, Alloc>::operator[](size_t index) {\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(elements_ == nullptr);\n  return elements_[index];\n}\n\ntemplate<typename T, typename Alloc>\ninline bool PinnedPrimitiveArray<T, Alloc>::isCopy() const noexcept {\n  return isCopy_ == JNI_TRUE;\n}\n\ntemplate<typename T, typename Alloc>\ninline size_t PinnedPrimitiveArray<T, Alloc>::size() const noexcept {\n  return size_;\n}\n\ntemplate<typename T, typename Alloc>\ninline PinnedPrimitiveArray<T, Alloc>::~PinnedPrimitiveArray() noexcept {\n  if (elements_) {\n    release();\n  }\n}\n\ntemplate<typename T, typename Alloc>\ninline PinnedPrimitiveArray<T, Alloc>::PinnedPrimitiveArray(alias_ref<typename jtype_traits<T>::array_type> array, jint start, jint length) {\n  array_ = array;\n  start_ = start;\n  Alloc::allocate(array, start, length, &elements_, &size_, &isCopy_);\n}\n\ntemplate<typename T, typename Base, typename JType>\ninline alias_ref<JClass> JavaClass<T, Base, JType>::javaClassStatic() {\n  static auto cls = findClassStatic(jtype_traits<typename T::javaobject>::base_name().c_str());\n  return cls;\n}\n\ntemplate<typename T, typename Base, typename JType>\ninline local_ref<JClass> JavaClass<T, Base, JType>::javaClassLocal() {\n  std::string className(jtype_traits<typename T::javaobject>::base_name().c_str());\n  return findClassLocal(className.c_str());\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/CoreClasses.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n/** @file CoreClasses.h\n *\n * In CoreClasses.h wrappers for the core classes (jobject, jclass, and jstring) is defined\n * to provide access to corresponding JNI functions + some conveniance.\n */\n\n#include \"References-forward.h\"\n#include \"Meta-forward.h\"\n#include \"TypeTraits.h\"\n\n#include <memory>\n\n#include <jni.h>\n\n#include <fb/visibility.h>\n\nnamespace facebook {\nnamespace jni {\n\nclass JClass;\nclass JObject;\n\n/// Lookup a class by name. Note this functions returns an alias_ref that\n/// points to a leaked global reference.  This is appropriate for classes\n/// that are never unloaded (which is any class in an Android app and most\n/// Java programs).\n///\n/// The most common use case for this is storing the result\n/// in a \"static auto\" variable, or a static global.\n///\n/// @return Returns a leaked global reference to the class\nFBEXPORT alias_ref<JClass> findClassStatic(const char* name);\n\n/// Lookup a class by name. Note this functions returns a local reference,\n/// which means that it must not be stored in a static variable.\n///\n/// The most common use case for this is one-time initialization\n/// (like caching method ids).\n///\n/// @return Returns a global reference to the class\nFBEXPORT local_ref<JClass> findClassLocal(const char* name);\n\n/// Check to see if two references refer to the same object. Comparison with nullptr\n/// returns true if and only if compared to another nullptr. A weak reference that\n/// refers to a reclaimed object count as nullptr.\nFBEXPORT bool isSameObject(alias_ref<JObject> lhs, alias_ref<JObject> rhs) noexcept;\n\n// Together, these classes allow convenient use of any class with the fbjni\n// helpers.  To use:\n//\n// struct MyClass : public JavaClass<MyClass> {\n//   constexpr static auto kJavaDescriptor = \"Lcom/example/package/MyClass;\";\n// };\n//\n// Then, an alias_ref<MyClass::javaobject> will be backed by an instance of\n// MyClass. JavaClass provides a convenient way to add functionality to these\n// smart references.\n//\n// For example:\n//\n// struct MyClass : public JavaClass<MyClass> {\n//   constexpr static auto kJavaDescriptor = \"Lcom/example/package/MyClass;\";\n//\n//   void foo() {\n//     static auto method = javaClassStatic()->getMethod<void()>(\"foo\");\n//     method(self());\n//   }\n//\n//   static local_ref<javaobject> create(int i) {\n//     return newInstance(i);\n//   }\n// };\n//\n// auto obj = MyClass::create(10);\n// obj->foo();\n//\n// While users of a JavaClass-type can lookup methods and fields through the\n// underlying JClass, those calls can only be checked at runtime. It is recommended\n// that the JavaClass-type instead explicitly expose it's methods as in the example\n// above.\n\nnamespace detail {\ntemplate<typename JC, typename... Args>\nstatic local_ref<JC> newInstance(Args... args);\n}\n\nclass MonitorLock;\n\nclass FBEXPORT JObject : detail::JObjectBase {\npublic:\n  static constexpr auto kJavaDescriptor = \"Ljava/lang/Object;\";\n\n  static constexpr const char* get_instantiated_java_descriptor() { return nullptr; }\n  static constexpr const char* get_instantiated_base_name() { return nullptr; }\n\n  /// Get a @ref local_ref of the object's class\n  local_ref<JClass> getClass() const noexcept;\n\n  /// Checks if the object is an instance of a class\n  bool isInstanceOf(alias_ref<JClass> cls) const noexcept;\n\n  /// Get the primitive value of a field\n  template<typename T>\n  T getFieldValue(JField<T> field) const noexcept;\n\n  /// Get and wrap the value of a field in a @ref local_ref\n  template<typename T>\n  local_ref<T*> getFieldValue(JField<T*> field) const noexcept;\n\n  /// Set the value of field. Any Java type is accepted, including the primitive types\n  /// and raw reference types.\n  template<typename T>\n  void setFieldValue(JField<T> field, T value) noexcept;\n\n  /// Convenience method to create a std::string representing the object\n  std::string toString() const;\n\n  // Take this object's monitor lock\n  MonitorLock lock() const noexcept;\n\n  typedef _jobject _javaobject;\n  typedef _javaobject* javaobject;\n\nprotected:\n  jobject self() const noexcept;\nprivate:\n  friend void swap(JObject& a, JObject& b) noexcept;\n  template<typename>\n  friend struct detail::ReprAccess;\n  template<typename, typename, typename>\n  friend class JavaClass;\n\n  template <typename, typename>\n  friend class JObjectWrapper;\n};\n\n// This is only to maintain backwards compatibility with things that are\n// already providing a specialization of JObjectWrapper. Any such instances\n// should be updated to use a JavaClass.\ntemplate<>\nclass JObjectWrapper<jobject> : public JObject {\n};\n\n\nnamespace detail {\ntemplate <typename, typename Base, typename JType>\nstruct JTypeFor {\n  static_assert(\n      std::is_base_of<\n        std::remove_pointer<jobject>::type,\n        typename std::remove_pointer<JType>::type\n      >::value, \"\");\n  using _javaobject = typename std::remove_pointer<JType>::type;\n  using javaobject = JType;\n};\n\ntemplate <typename T, typename Base>\nstruct JTypeFor<T, Base, void> {\n  // JNI pattern for jobject assignable pointer\n  struct _javaobject :  Base::_javaobject {\n    // This allows us to map back to the defining type (in ReprType, for\n    // example).\n    typedef T JniRefRepr;\n  };\n  using javaobject = _javaobject*;\n};\n}\n\n// JavaClass provides a method to inform fbjni about user-defined Java types.\n// Given a class:\n// struct Foo : JavaClass<Foo> {\n//   static constexpr auto kJavaDescriptor = \"Lcom/example/package/Foo;\";\n// };\n// fbjni can determine the java type/method signatures for Foo::javaobject and\n// smart refs (like alias_ref<Foo::javaobject>) will hold an instance of Foo\n// and provide access to it through the -> and * operators.\n//\n// The \"Base\" template argument can be used to specify the JavaClass superclass\n// of this type (for instance, JString's Base is JObject).\n//\n// The \"JType\" template argument is used to provide a jni type (like jstring,\n// jthrowable) to be used as javaobject. This should only be necessary for\n// built-in jni types and not user-defined ones.\ntemplate <typename T, typename Base = JObject, typename JType = void>\nclass FBEXPORT JavaClass : public Base {\n  using JObjType = typename detail::JTypeFor<T, Base, JType>;\npublic:\n  using _javaobject = typename JObjType::_javaobject;\n  using javaobject = typename JObjType::javaobject;\n\n  using JavaBase = JavaClass;\n\n  static alias_ref<JClass> javaClassStatic();\n  static local_ref<JClass> javaClassLocal();\nprotected:\n  /// Allocates a new object and invokes the specified constructor\n  /// Like JClass's getConstructor, this function can only check at runtime if\n  /// the class actually has a constructor that accepts the corresponding types.\n  /// While a JavaClass-type can expose this function directly, it is recommended\n  /// to instead to use this to explicitly only expose those constructors that\n  /// the Java class actually has (i.e. with static create() functions).\n  template<typename... Args>\n  static local_ref<T> newInstance(Args... args) {\n    return detail::newInstance<T>(args...);\n  }\n\n  javaobject self() const noexcept;\n};\n\n/// Wrapper to provide functionality to jclass references\nstruct NativeMethod;\n\nclass FBEXPORT JClass : public JavaClass<JClass, JObject, jclass> {\n public:\n  /// Java type descriptor\n  static constexpr const char* kJavaDescriptor = \"Ljava/lang/Class;\";\n\n  /// Get a @local_ref to the super class of this class\n  local_ref<JClass> getSuperclass() const noexcept;\n\n  /// Register native methods for the class.  Usage looks like this:\n  ///\n  /// classRef->registerNatives({\n  ///     makeNativeMethod(\"nativeMethodWithAutomaticDescriptor\",\n  ///                      methodWithAutomaticDescriptor),\n  ///     makeNativeMethod(\"nativeMethodWithExplicitDescriptor\",\n  ///                      \"(Lcom/facebook/example/MyClass;)V\",\n  ///                      methodWithExplicitDescriptor),\n  ///  });\n  ///\n  /// By default, C++ exceptions raised will be converted to Java exceptions.\n  /// To avoid this and get the \"standard\" JNI behavior of a crash when a C++\n  /// exception is crashing out of the JNI method, declare the method noexcept.\n  void registerNatives(std::initializer_list<NativeMethod> methods);\n\n  /// Check to see if the class is assignable from another class\n  /// @pre cls != nullptr\n  bool isAssignableFrom(alias_ref<JClass> cls) const noexcept;\n\n  /// Convenience method to lookup the constructor with descriptor as specified by the\n  /// type arguments\n  template<typename F>\n  JConstructor<F> getConstructor() const;\n\n  /// Convenience method to lookup the constructor with specified descriptor\n  template<typename F>\n  JConstructor<F> getConstructor(const char* descriptor) const;\n\n  /// Look up the method with given name and descriptor as specified with the type arguments\n  template<typename F>\n  JMethod<F> getMethod(const char* name) const;\n\n  /// Look up the method with given name and descriptor\n  template<typename F>\n  JMethod<F> getMethod(const char* name, const char* descriptor) const;\n\n  /// Lookup the field with the given name and deduced descriptor\n  template<typename T>\n  JField<enable_if_t<IsJniScalar<T>(), T>> getField(const char* name) const;\n\n  /// Lookup the field with the given name and descriptor\n  template<typename T>\n  JField<enable_if_t<IsJniScalar<T>(), T>> getField(const char* name, const char* descriptor) const;\n\n  /// Lookup the static field with the given name and deduced descriptor\n  template<typename T>\n  JStaticField<enable_if_t<IsJniScalar<T>(), T>> getStaticField(const char* name) const;\n\n  /// Lookup the static field with the given name and descriptor\n  template<typename T>\n  JStaticField<enable_if_t<IsJniScalar<T>(), T>> getStaticField(\n      const char* name,\n      const char* descriptor) const;\n\n  /// Get the primitive value of a static field\n  template<typename T>\n  T getStaticFieldValue(JStaticField<T> field) const noexcept;\n\n  /// Get and wrap the value of a field in a @ref local_ref\n  template<typename T>\n  local_ref<T*> getStaticFieldValue(JStaticField<T*> field) noexcept;\n\n  /// Set the value of field. Any Java type is accepted, including the primitive types\n  /// and raw reference types.\n  template<typename T>\n  void setStaticFieldValue(JStaticField<T> field, T value) noexcept;\n\n  /// Allocates a new object and invokes the specified constructor\n  template<typename R, typename... Args>\n  local_ref<R> newObject(JConstructor<R(Args...)> constructor, Args... args) const;\n\n  /// Look up the static method with given name and descriptor as specified with the type arguments\n  template<typename F>\n  JStaticMethod<F> getStaticMethod(const char* name) const;\n\n  /// Look up the static method with given name and descriptor\n  template<typename F>\n  JStaticMethod<F> getStaticMethod(const char* name, const char* descriptor) const;\n\n  /// Look up the non virtual method with given name and descriptor as specified with the\n  /// type arguments\n  template<typename F>\n  JNonvirtualMethod<F> getNonvirtualMethod(const char* name) const;\n\n  /// Look up the non virtual method with given name and descriptor\n  template<typename F>\n  JNonvirtualMethod<F> getNonvirtualMethod(const char* name, const char* descriptor) const;\n\nprivate:\n  jclass self() const noexcept;\n};\n\n// Convenience method to register methods on a class without holding\n// onto the class object.\nvoid registerNatives(const char* name, std::initializer_list<NativeMethod> methods);\n\n/// Wrapper to provide functionality to jstring references\nclass FBEXPORT JString : public JavaClass<JString, JObject, jstring> {\n public:\n  /// Java type descriptor\n  static constexpr const char* kJavaDescriptor = \"Ljava/lang/String;\";\n\n  /// Convenience method to convert a jstring object to a std::string\n  std::string toStdString() const;\n};\n\n/// Convenience functions to convert a std::string or const char* into a @ref local_ref to a\n/// jstring\nFBEXPORT local_ref<JString> make_jstring(const char* modifiedUtf8);\nFBEXPORT local_ref<JString> make_jstring(const std::string& modifiedUtf8);\n\nnamespace detail {\ntemplate<typename Target>\nclass ElementProxy {\n private:\n  Target* target_;\n  size_t idx_;\n\n public:\n  using T = typename Target::javaentry;\n  ElementProxy(Target* target, size_t idx);\n\n  ElementProxy& operator=(const T& o);\n\n  ElementProxy& operator=(alias_ref<T>& o);\n\n  ElementProxy& operator=(alias_ref<T>&& o);\n\n  ElementProxy& operator=(const ElementProxy& o);\n\n  operator const local_ref<T> () const;\n\n  operator local_ref<T> ();\n};\n}\n\nnamespace detail {\nclass FBEXPORT JArray : public JavaClass<JArray, JObject, jarray> {\n public:\n  // This cannot be used in a scope that derives a descriptor (like in a method\n  // signature). Use a more derived type instead (like JArrayInt or\n  // JArrayClass<T>).\n  static constexpr const char* kJavaDescriptor = nullptr;\n  size_t size() const noexcept;\n};\n\n// This is used so that the JArrayClass<T> javaobject extends jni's\n// jobjectArray. This class should not be used directly. A general Object[]\n// should use JArrayClass<jobject>.\nclass FBEXPORT JTypeArray : public JavaClass<JTypeArray, JArray, jobjectArray> {\n  // This cannot be used in a scope that derives a descriptor (like in a method\n  // signature).\n  static constexpr const char* kJavaDescriptor = nullptr;\n};\n}\n\ntemplate<typename T>\nclass JArrayClass : public JavaClass<JArrayClass<T>, detail::JTypeArray> {\n public:\n  static_assert(is_plain_jni_reference<T>(), \"\");\n  // javaentry is the jni type of an entry in the array (i.e. jint).\n  using javaentry = T;\n  // javaobject is the jni type of the array.\n  using javaobject = typename JavaClass<JArrayClass<T>, detail::JTypeArray>::javaobject;\n  static constexpr const char* kJavaDescriptor = nullptr;\n  static std::string get_instantiated_java_descriptor();\n  static std::string get_instantiated_base_name();\n\n  /// Allocate a new array from Java heap, for passing as a JNI parameter or return value.\n  /// NOTE: if using as a return value, you want to call release() instead of get() on the\n  /// smart pointer.\n  static local_ref<javaobject> newArray(size_t count);\n\n  /// Assign an object to the array.\n  /// Typically you will use the shorthand (*ref)[idx]=value;\n  void setElement(size_t idx, const T& value);\n\n  /// Read an object from the array.\n  /// Typically you will use the shorthand\n  ///   T value = (*ref)[idx];\n  /// If you use auto, you'll get an ElementProxy, which may need to be cast.\n  local_ref<T> getElement(size_t idx);\n\n  /// EXPERIMENTAL SUBSCRIPT SUPPORT\n  /// This implementation of [] returns a proxy object which then has a bunch of specializations\n  /// (adopt_local free function, operator= and casting overloads on the ElementProxy) that can\n  /// make code look like it is dealing with a T rather than an obvious proxy. In particular, the\n  /// proxy in this iteration does not read a value and therefore does not create a LocalRef\n  /// until one of these other operators is used. There are certainly holes that you may find\n  /// by using idioms that haven't been tried yet. Consider yourself warned. On the other hand,\n  /// it does make for some idiomatic assignment code; see TestBuildStringArray in fbjni_tests\n  /// for some examples.\n  detail::ElementProxy<JArrayClass> operator[](size_t idx);\n};\n\ntemplate <typename T>\nusing jtypeArray = typename JArrayClass<T>::javaobject;\n\ntemplate<typename T>\nlocal_ref<typename JArrayClass<T>::javaobject> adopt_local_array(jobjectArray ref) {\n  return adopt_local(static_cast<typename JArrayClass<T>::javaobject>(ref));\n}\n\ntemplate<typename Target>\nlocal_ref<typename Target::javaentry> adopt_local(detail::ElementProxy<Target> elementProxy) {\n  return static_cast<local_ref<typename Target::javaentry>>(elementProxy);\n}\n\ntemplate <typename T, typename PinAlloc>\nclass PinnedPrimitiveArray;\n\ntemplate <typename T> class PinnedArrayAlloc;\ntemplate <typename T> class PinnedRegionAlloc;\ntemplate <typename T> class PinnedCriticalAlloc;\n\n/// Wrapper to provide functionality to jarray references.\n/// This is an empty holder by itself. Construct a PinnedPrimitiveArray to actually interact with\n/// the elements of the array.\ntemplate <typename JArrayType>\nclass FBEXPORT JPrimitiveArray :\n    public JavaClass<JPrimitiveArray<JArrayType>, detail::JArray, JArrayType> {\n  static_assert(is_jni_primitive_array<JArrayType>(), \"\");\n public:\n  static constexpr const char* kJavaDescriptor = nullptr;\n  static std::string get_instantiated_java_descriptor();\n  static std::string get_instantiated_base_name();\n\n  using T = typename jtype_traits<JArrayType>::entry_type;\n\n  static local_ref<JArrayType> newArray(size_t count);\n\n  void getRegion(jsize start, jsize length, T* buf);\n  std::unique_ptr<T[]> getRegion(jsize start, jsize length);\n  void setRegion(jsize start, jsize length, const T* buf);\n\n  /// Returns a view of the underlying array. This will either be a \"pinned\"\n  /// version of the array (in which case changes to one immediately affect the\n  /// other) or a copy of the array (in which cases changes to the view will take\n  /// affect when destroyed or on calls to release()/commit()).\n  PinnedPrimitiveArray<T, PinnedArrayAlloc<T>> pin();\n\n  /// Returns a view of part of the underlying array. A pinned region is always\n  /// backed by a copy of the region.\n  PinnedPrimitiveArray<T, PinnedRegionAlloc<T>> pinRegion(jsize start, jsize length);\n\n  /// Returns a view of the underlying array like pin(). However, while the pin\n  /// is held, the code is considered within a \"critical region\". In a critical\n  /// region, native code must not call JNI functions or make any calls that may\n  /// block on other Java threads. These restrictions make it more likely that\n  /// the view will be \"pinned\" rather than copied (for example, the VM may\n  /// suspend garbage collection within a critical region).\n  PinnedPrimitiveArray<T, PinnedCriticalAlloc<T>> pinCritical();\n\nprivate:\n  friend class PinnedArrayAlloc<T>;\n  T* getElements(jboolean* isCopy);\n  void releaseElements(T* elements, jint mode);\n};\n\nFBEXPORT local_ref<jbooleanArray> make_boolean_array(jsize size);\nFBEXPORT local_ref<jbyteArray> make_byte_array(jsize size);\nFBEXPORT local_ref<jcharArray> make_char_array(jsize size);\nFBEXPORT local_ref<jshortArray> make_short_array(jsize size);\nFBEXPORT local_ref<jintArray> make_int_array(jsize size);\nFBEXPORT local_ref<jlongArray> make_long_array(jsize size);\nFBEXPORT local_ref<jfloatArray> make_float_array(jsize size);\nFBEXPORT local_ref<jdoubleArray> make_double_array(jsize size);\n\nusing JArrayBoolean = JPrimitiveArray<jbooleanArray>;\nusing JArrayByte = JPrimitiveArray<jbyteArray>;\nusing JArrayChar = JPrimitiveArray<jcharArray>;\nusing JArrayShort = JPrimitiveArray<jshortArray>;\nusing JArrayInt = JPrimitiveArray<jintArray>;\nusing JArrayLong = JPrimitiveArray<jlongArray>;\nusing JArrayFloat = JPrimitiveArray<jfloatArray>;\nusing JArrayDouble = JPrimitiveArray<jdoubleArray>;\n\n/// RAII class for pinned primitive arrays\n/// This currently only supports read/write access to existing java arrays. You can't create a\n/// primitive array this way yet. This class also pins the entire array into memory during the\n/// lifetime of the PinnedPrimitiveArray. If you need to unpin the array manually, call the\n/// release() or abort() functions. During a long-running block of code, you\n/// should unpin the array as soon as you're done with it, to avoid holding up\n/// the Java garbage collector.\ntemplate <typename T, typename PinAlloc>\nclass PinnedPrimitiveArray {\n  public:\n   static_assert(is_jni_primitive<T>::value,\n       \"PinnedPrimitiveArray requires primitive jni type.\");\n\n   using ArrayType = typename jtype_traits<T>::array_type;\n\n   PinnedPrimitiveArray(PinnedPrimitiveArray&&);\n   PinnedPrimitiveArray(const PinnedPrimitiveArray&) = delete;\n   ~PinnedPrimitiveArray() noexcept;\n\n   PinnedPrimitiveArray& operator=(PinnedPrimitiveArray&&);\n   PinnedPrimitiveArray& operator=(const PinnedPrimitiveArray&) = delete;\n\n   T* get();\n   void release();\n   /// Unpins the array. If the array is a copy, pending changes are discarded.\n   void abort();\n   /// If the array is a copy, copies pending changes to the underlying java array.\n   void commit();\n\n   bool isCopy() const noexcept;\n\n   const T& operator[](size_t index) const;\n   T& operator[](size_t index);\n   size_t size() const noexcept;\n\n  private:\n   alias_ref<ArrayType> array_;\n   size_t start_;\n   T* elements_;\n   jboolean isCopy_;\n   size_t size_;\n\n   void allocate(alias_ref<ArrayType>, jint start, jint length);\n   void releaseImpl(jint mode);\n   void clear() noexcept;\n\n   PinnedPrimitiveArray(alias_ref<ArrayType>, jint start, jint length);\n\n   friend class JPrimitiveArray<typename jtype_traits<T>::array_type>;\n};\n\nstruct FBEXPORT JStackTraceElement : JavaClass<JStackTraceElement> {\n  static auto constexpr kJavaDescriptor = \"Ljava/lang/StackTraceElement;\";\n\n  static local_ref<javaobject> create(const std::string& declaringClass, const std::string& methodName, const std::string& file, int line);\n\n  std::string getClassName() const;\n  std::string getMethodName() const;\n  std::string getFileName() const;\n  int getLineNumber() const;\n};\n\n/// Wrapper to provide functionality to jthrowable references\nclass FBEXPORT JThrowable : public JavaClass<JThrowable, JObject, jthrowable> {\n public:\n  static constexpr const char* kJavaDescriptor = \"Ljava/lang/Throwable;\";\n\n  using JStackTrace = JArrayClass<JStackTraceElement::javaobject>;\n\n  local_ref<JThrowable> initCause(alias_ref<JThrowable> cause);\n  local_ref<JStackTrace> getStackTrace();\n  void setStackTrace(alias_ref<JArrayClass<JStackTraceElement::javaobject>>);\n};\n\n#pragma push_macro(\"PlainJniRefMap\")\n#undef PlainJniRefMap\n#define PlainJniRefMap(rtype, jtype) \\\nnamespace detail { \\\ntemplate<> \\\nstruct RefReprType<jtype> { \\\n  using type = rtype; \\\n}; \\\n}\n\nPlainJniRefMap(JArrayBoolean, jbooleanArray);\nPlainJniRefMap(JArrayByte, jbyteArray);\nPlainJniRefMap(JArrayChar, jcharArray);\nPlainJniRefMap(JArrayShort, jshortArray);\nPlainJniRefMap(JArrayInt, jintArray);\nPlainJniRefMap(JArrayLong, jlongArray);\nPlainJniRefMap(JArrayFloat, jfloatArray);\nPlainJniRefMap(JArrayDouble, jdoubleArray);\nPlainJniRefMap(JObject, jobject);\nPlainJniRefMap(JClass, jclass);\nPlainJniRefMap(JString, jstring);\nPlainJniRefMap(JThrowable, jthrowable);\n\n#pragma pop_macro(\"PlainJniRefMap\")\n\n}}\n\n#include \"CoreClasses-inl.h\"\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Exceptions.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/**\n * @file Exceptions.h\n *\n * After invoking a JNI function that can throw a Java exception, the macro\n * @ref FACEBOOK_JNI_THROW_PENDING_EXCEPTION() or @ref FACEBOOK_JNI_THROW_EXCEPTION_IF()\n * should be invoked.\n *\n * IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!\n * To use these methods you MUST call initExceptionHelpers() when your library is loaded.\n */\n\n#pragma once\n\n#include <alloca.h>\n#include <stdexcept>\n#include <string>\n\n#include <jni.h>\n\n#include <fb/visibility.h>\n\n#include \"Common.h\"\n#include \"References.h\"\n#include \"CoreClasses.h\"\n\n#if defined(__ANDROID__) && defined(__ARM_ARCH_5TE__) && !defined(FBJNI_NO_EXCEPTION_PTR)\n// ARMv5 NDK does not support exception_ptr so we cannot use that when building for it.\n#define FBJNI_NO_EXCEPTION_PTR\n#endif\n\nnamespace facebook {\nnamespace jni {\n\nclass JThrowable;\n\nclass JCppException : public JavaClass<JCppException, JThrowable> {\n public:\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/jni/CppException;\";\n\n  static local_ref<JCppException> create(const char* str) {\n    return newInstance(make_jstring(str));\n  }\n\n  static local_ref<JCppException> create(const std::exception& ex) {\n    return newInstance(make_jstring(ex.what()));\n  }\n};\n\n// JniException ////////////////////////////////////////////////////////////////////////////////////\n\n/**\n * This class wraps a Java exception into a C++ exception; if the exception is routed back\n * to the Java side, it can be unwrapped and just look like a pure Java interaction. The class\n * is resilient to errors while creating the exception, falling back to some pre-allocated\n * exceptions if a new one cannot be allocated or populated.\n *\n * Note: the what() method of this class is not thread-safe (t6900503).\n */\nclass FBEXPORT JniException : public std::exception {\n public:\n  JniException();\n  ~JniException();\n\n  explicit JniException(alias_ref<jthrowable> throwable);\n\n  JniException(JniException &&rhs);\n\n  JniException(const JniException &other);\n\n  local_ref<JThrowable> getThrowable() const noexcept;\n\n  virtual const char* what() const noexcept;\n\n  void setJavaException() const noexcept;\n\n private:\n  global_ref<JThrowable> throwable_;\n  mutable std::string what_;\n  mutable bool isMessageExtracted_;\n  const static std::string kExceptionMessageFailure_;\n\n  void populateWhat() const noexcept;\n};\n\n// Exception throwing & translating functions //////////////////////////////////////////////////////\n\n// Functions that throw C++ exceptions\n\nstatic const int kMaxExceptionMessageBufferSize = 512;\n\n// These methods are the preferred way to throw a Java exception from\n// a C++ function.  They create and throw a C++ exception which wraps\n// a Java exception, so the C++ flow is interrupted. Then, when\n// translatePendingCppExceptionToJavaException is called at the\n// topmost level of the native stack, the wrapped Java exception is\n// thrown to the java caller.\ntemplate<typename... Args>\n[[noreturn]] void throwNewJavaException(const char* throwableName, const char* fmt, Args... args) {\n  int msgSize = snprintf(nullptr, 0, fmt, args...);\n\n  char *msg = (char*) alloca(msgSize + 1);\n  snprintf(msg, kMaxExceptionMessageBufferSize, fmt, args...);\n  throwNewJavaException(throwableName, msg);\n}\n\n// Identifies any pending C++ exception and throws it as a Java exception. If the exception can't\n// be thrown, it aborts the program.\nFBEXPORT void translatePendingCppExceptionToJavaException();\n\n#ifndef FBJNI_NO_EXCEPTION_PTR\nFBEXPORT local_ref<JThrowable> getJavaExceptionForCppException(std::exception_ptr ptr);\n#endif\n\nFBEXPORT local_ref<JThrowable> getJavaExceptionForCppBackTrace();\n\nFBEXPORT local_ref<JThrowable> getJavaExceptionForCppBackTrace(const char* msg);\n// For convenience, some exception names in java.lang are available here.\n\nconst char* const gJavaLangIllegalArgumentException = \"java/lang/IllegalArgumentException\";\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/File.h",
    "content": "/*\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include \"CoreClasses.h\"\n\nnamespace facebook {\nnamespace jni {\n\nclass JFile : public JavaClass<JFile> {\n public:\n  static constexpr const char* kJavaDescriptor = \"Ljava/io/File;\";\n\n  // Define a method that calls into the represented Java class\n  std::string getAbsolutePath() {\n    static auto method = getClass()->getMethod<jstring()>(\"getAbsolutePath\");\n    return method(self())->toStdString();\n  }\n\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Hybrid.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <memory>\n#include <type_traits>\n\n#include <fb/assert.h>\n#include <fb/visibility.h>\n\n#include \"CoreClasses.h\"\n\nnamespace facebook {\nnamespace jni {\n\nnamespace detail {\n\nclass BaseHybridClass {\npublic:\n  virtual ~BaseHybridClass() {}\n};\n\nstruct FBEXPORT HybridData : public JavaClass<HybridData> {\n  constexpr static auto kJavaDescriptor = \"Lcom/facebook/jni/HybridData;\";\n  static local_ref<HybridData> create();\n};\n\nclass HybridDestructor : public JavaClass<HybridDestructor> {\n  public:\n    static auto constexpr kJavaDescriptor = \"Lcom/facebook/jni/HybridData$Destructor;\";\n\n  template <typename T=detail::BaseHybridClass>\n  T* getNativePointer() {\n    static auto pointerField = javaClassStatic()->getField<jlong>(\"mNativePointer\");\n    auto* value = reinterpret_cast<detail::BaseHybridClass*>(getFieldValue(pointerField));\n    if (!value) {\n      throwNewJavaException(\"java/lang/NullPointerException\", \"java.lang.NullPointerException\");\n    }\n    return value;\n  }\n\n  template <typename T=detail::BaseHybridClass>\n  void setNativePointer(std::unique_ptr<T> new_value) {\n    static auto pointerField = javaClassStatic()->getField<jlong>(\"mNativePointer\");\n    auto old_value = std::unique_ptr<T>(reinterpret_cast<T*>(getFieldValue(pointerField)));\n    if (new_value && old_value) {\n        FBCRASH(\"Attempt to set C++ native pointer twice\");\n    }\n    setFieldValue(pointerField, reinterpret_cast<jlong>(new_value.release()));\n  }\n};\n\ntemplate<typename T>\ndetail::BaseHybridClass* getNativePointer(T t) {\n  return getHolder(t)->getNativePointer();\n}\n\ntemplate<typename T>\nvoid setNativePointer(T t, std::unique_ptr<detail::BaseHybridClass> new_value) {\n  getHolder(t)->setNativePointer(std::move(new_value));\n}\n\ntemplate<typename T>\nlocal_ref<HybridDestructor> getHolder(T t) {\n  static auto holderField = t->getClass()->template getField<HybridDestructor::javaobject>(\"mDestructor\");\n  return t->getFieldValue(holderField);\n}\n\n// JavaClass for HybridClassBase\nstruct FBEXPORT HybridClassBase : public JavaClass<HybridClassBase> {\n  constexpr static auto kJavaDescriptor = \"Lcom/facebook/jni/HybridClassBase;\";\n\n  static bool isHybridClassBase(alias_ref<jclass> jclass) {\n    return HybridClassBase::javaClassStatic()->isAssignableFrom(jclass);\n  }\n};\n\ntemplate <typename Base, typename Enabled = void>\nstruct HybridTraits {\n  // This static assert should actually always fail if we don't use one of the\n  // specializations below.\n  static_assert(\n      std::is_base_of<JObject, Base>::value ||\n      std::is_base_of<BaseHybridClass, Base>::value,\n      \"The base of a HybridClass must be either another HybridClass or derived from JObject.\");\n};\n\ntemplate <>\nstruct HybridTraits<BaseHybridClass> {\n using CxxBase = BaseHybridClass;\n using JavaBase = JObject;\n};\n\ntemplate <typename Base>\nstruct HybridTraits<\n    Base,\n    typename std::enable_if<std::is_base_of<BaseHybridClass, Base>::value>::type> {\n using CxxBase = Base;\n using JavaBase = typename Base::JavaPart;\n};\n\ntemplate <typename Base>\nstruct HybridTraits<\n    Base,\n    typename std::enable_if<std::is_base_of<JObject, Base>::value>::type> {\n using CxxBase = BaseHybridClass;\n using JavaBase = Base;\n};\n\n// convert to HybridClass* from jhybridobject\ntemplate <typename T>\nstruct FBEXPORT Convert<\n  T, typename std::enable_if<\n    std::is_base_of<BaseHybridClass, typename std::remove_pointer<T>::type>::value>::type> {\n  typedef typename std::remove_pointer<T>::type::jhybridobject jniType;\n  static T fromJni(jniType t) {\n    if (t == nullptr) {\n      return nullptr;\n    }\n    return wrap_alias(t)->cthis();\n  }\n  // There is no automatic return conversion for objects.\n};\n\ntemplate<typename T>\nstruct RefReprType<T, typename std::enable_if<std::is_base_of<BaseHybridClass, T>::value, void>::type> {\n  static_assert(std::is_same<T, void>::value,\n      \"HybridFoo (where HybridFoo derives from HybridClass<HybridFoo>) is not supported in this context. \"\n      \"For an xxx_ref<HybridFoo>, you may want: xxx_ref<HybridFoo::javaobject> or HybridFoo*.\");\n  using Repr = T;\n};\n\n\n}\n\ntemplate <typename T, typename Base = detail::BaseHybridClass>\nclass FBEXPORT HybridClass : public detail::HybridTraits<Base>::CxxBase {\npublic:\n  struct JavaPart : JavaClass<JavaPart, typename detail::HybridTraits<Base>::JavaBase> {\n    // At this point, T is incomplete, and so we cannot access\n    // T::kJavaDescriptor directly. jtype_traits support this escape hatch for\n    // such a case.\n    static constexpr const char* kJavaDescriptor = nullptr;\n    static std::string get_instantiated_java_descriptor();\n    static std::string get_instantiated_base_name();\n\n    using HybridType = T;\n\n    // This will reach into the java object and extract the C++ instance from\n    // the mHybridData and return it.\n    T* cthis();\n\n    friend class HybridClass;\n  };\n\n  using jhybridobject = typename JavaPart::javaobject;\n  using javaobject = typename JavaPart::javaobject;\n  typedef detail::HybridData::javaobject jhybriddata;\n\n  static alias_ref<JClass> javaClassStatic() {\n    return JavaPart::javaClassStatic();\n  }\n\n  static local_ref<JClass> javaClassLocal() {\n    std::string className(T::kJavaDescriptor + 1, strlen(T::kJavaDescriptor) - 2);\n    return findClassLocal(className.c_str());\n  }\n\nprotected:\n  typedef HybridClass HybridBase;\n\n  // This ensures that a C++ hybrid part cannot be created on its own\n  // by default.  If a hybrid wants to enable this, it can provide its\n  // own public ctor, or change the accessibility of this to public.\n  using detail::HybridTraits<Base>::CxxBase::CxxBase;\n\n  static void registerHybrid(std::initializer_list<NativeMethod> methods) {\n    javaClassStatic()->registerNatives(methods);\n  }\n\n  static local_ref<detail::HybridData> makeHybridData(std::unique_ptr<T> cxxPart) {\n    auto hybridData = detail::HybridData::create();\n    setNativePointer(hybridData, std::move(cxxPart));\n    return hybridData;\n  }\n\n  template <typename... Args>\n  static local_ref<detail::HybridData> makeCxxInstance(Args&&... args) {\n    return makeHybridData(std::unique_ptr<T>(new T(std::forward<Args>(args)...)));\n  }\n\n  template <typename... Args>\n  static void setCxxInstance(alias_ref<jhybridobject> o, Args&&... args) {\n    setNativePointer(o, std::unique_ptr<T>(new T(std::forward<Args>(args)...)));\n  }\n\npublic:\n  // Factory method for creating a hybrid object where the arguments\n  // are used to initialize the C++ part directly without passing them\n  // through java.  This method requires the Java part to have a ctor\n  // which takes a HybridData, and for the C++ part to have a ctor\n  // compatible with the arguments passed here.  For safety, the ctor\n  // can be private, and the hybrid declared a friend of its base, so\n  // the hybrid can only be created from here.\n  //\n  // Exception behavior: This can throw an exception if creating the\n  // C++ object fails, or any JNI methods throw.\n  template <typename... Args>\n  static local_ref<JavaPart> newObjectCxxArgs(Args&&... args) {\n    static bool isHybrid = detail::HybridClassBase::isHybridClassBase(javaClassStatic());\n    auto cxxPart = std::unique_ptr<T>(new T(std::forward<Args>(args)...));\n\n    local_ref<JavaPart> result;\n    if (isHybrid) {\n      result = JavaPart::newInstance();\n      setNativePointer(result, std::move(cxxPart));\n    }\n    else {\n      auto hybridData = makeHybridData(std::move(cxxPart));\n      result = JavaPart::newInstance(hybridData);\n    }\n\n    return result;\n  }\n\n // TODO? Create reusable interface for Allocatable classes and use it to\n  // strengthen type-checking (and possibly provide a default\n  // implementation of allocate().)\n  template <typename... Args>\n  static local_ref<jhybridobject> allocateWithCxxArgs(Args&&... args) {\n    auto hybridData = makeCxxInstance(std::forward<Args>(args)...);\n    static auto allocateMethod =\n        javaClassStatic()->template getStaticMethod<jhybridobject(jhybriddata)>(\"allocate\");\n    return allocateMethod(javaClassStatic(), hybridData.get());\n  }\n\n  // Factory method for creating a hybrid object where the arguments\n  // are passed to the java ctor.\n  template <typename... Args>\n  static local_ref<JavaPart> newObjectJavaArgs(Args&&... args) {\n    return JavaPart::newInstance(std::move(args)...);\n  }\n\n  // If a hybrid class throws an exception which derives from\n  // std::exception, it will be passed to mapException on the hybrid\n  // class, or nearest ancestor.  This allows boilerplate exception\n  // translation code (for example, calling throwNewJavaException on a\n  // particular java class) to be hoisted to a common function.  If\n  // mapException returns, then the std::exception will be translated\n  // to Java.\n  static void mapException(const std::exception& ex) {}\n};\n\ntemplate <typename T, typename B>\ninline T* HybridClass<T, B>::JavaPart::cthis() {\n  detail::BaseHybridClass* result = 0;\n  static bool isHybrid = detail::HybridClassBase::isHybridClassBase(this->getClass());\n  if (isHybrid) {\n    result = getNativePointer(this);\n  } else {\n    static auto field =\n      HybridClass<T, B>::JavaPart::javaClassStatic()->template getField<detail::HybridData::javaobject>(\"mHybridData\");\n    auto hybridData = this->getFieldValue(field);\n    if (!hybridData) {\n      throwNewJavaException(\"java/lang/NullPointerException\", \"java.lang.NullPointerException\");\n    }\n\n    result = getNativePointer(hybridData);\n  }\n\n  // This would require some serious programmer error.\n  FBASSERTMSGF(result != 0, \"Incorrect C++ type in hybrid field\");\n  // I'd like to use dynamic_cast here, but -fno-rtti is the default.\n  return static_cast<T*>(result);\n};\n\ntemplate <typename T, typename B>\n/* static */ inline std::string HybridClass<T, B>::JavaPart::get_instantiated_java_descriptor() {\n  return T::kJavaDescriptor;\n}\n\ntemplate <typename T, typename B>\n/* static */ inline std::string HybridClass<T, B>::JavaPart::get_instantiated_base_name() {\n  auto name = get_instantiated_java_descriptor();\n  return name.substr(1, name.size() - 2);\n}\n\n// Given a *_ref object which refers to a hybrid class, this will reach inside\n// of it, find the mHybridData, extract the C++ instance pointer, cast it to\n// the appropriate type, and return it.\ntemplate <typename T>\ninline auto cthis(T jthis) -> decltype(jthis->cthis()) {\n  return jthis->cthis();\n}\n\nvoid HybridDataOnLoad();\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Iterator-inl.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\nnamespace facebook {\nnamespace jni {\n\nnamespace detail {\n\ntemplate <typename E>\nstruct IteratorHelper : public JavaClass<IteratorHelper<E>> {\n  constexpr static auto kJavaDescriptor = \"Lcom/facebook/jni/IteratorHelper;\";\n\n  typedef local_ref<E> value_type;\n  typedef ptrdiff_t difference_type;\n  typedef value_type* pointer;\n  typedef value_type& reference;\n  typedef std::forward_iterator_tag iterator_category;\n\n  typedef JavaClass<IteratorHelper<E>> JavaBase_;\n\n  bool hasNext() const {\n    static auto hasNextMethod =\n      JavaBase_::javaClassStatic()->template getMethod<jboolean()>(\"hasNext\");\n    return hasNextMethod(JavaBase_::self());\n  }\n\n  value_type next() {\n    static auto elementField =\n      JavaBase_::javaClassStatic()->template getField<jobject>(\"mElement\");\n    return dynamic_ref_cast<E>(JavaBase_::getFieldValue(elementField));\n  }\n\n  static void reset(value_type& v) {\n    v.reset();\n  }\n};\n\ntemplate <typename K, typename V>\nstruct MapIteratorHelper : public JavaClass<MapIteratorHelper<K,V>> {\n  constexpr static auto kJavaDescriptor = \"Lcom/facebook/jni/MapIteratorHelper;\";\n\n  typedef std::pair<local_ref<K>, local_ref<V>> value_type;\n\n  typedef JavaClass<MapIteratorHelper<K,V>> JavaBase_;\n\n  bool hasNext() const {\n    static auto hasNextMethod =\n      JavaBase_::javaClassStatic()->template getMethod<jboolean()>(\"hasNext\");\n    return hasNextMethod(JavaBase_::self());\n  }\n\n  value_type next() {\n    static auto keyField = JavaBase_::javaClassStatic()->template getField<jobject>(\"mKey\");\n    static auto valueField = JavaBase_::javaClassStatic()->template getField<jobject>(\"mValue\");\n    return std::make_pair(dynamic_ref_cast<K>(JavaBase_::getFieldValue(keyField)),\n                          dynamic_ref_cast<V>(JavaBase_::getFieldValue(valueField)));\n  }\n\n  static void reset(value_type& v) {\n    v.first.reset();\n    v.second.reset();\n  }\n};\n\ntemplate <typename T>\nclass Iterator {\n public:\n  typedef typename T::value_type value_type;\n  typedef ptrdiff_t difference_type;\n  typedef value_type* pointer;\n  typedef value_type& reference;\n  typedef std::input_iterator_tag iterator_category;\n\n  // begin ctor\n  Iterator(global_ref<typename T::javaobject>&& helper)\n      : helper_(std::move(helper))\n      , i_(-1) {\n    ++(*this);\n  }\n\n  // end ctor\n  Iterator()\n      : i_(-1) {}\n\n  bool operator==(const Iterator& it) const { return i_ == it.i_; }\n  bool operator!=(const Iterator& it) const { return !(*this == it); }\n  const value_type& operator*() const { assert(i_ != -1); return entry_; }\n  const value_type* operator->() const { assert(i_ != -1); return &entry_; }\n  Iterator& operator++() {  // preincrement\n    bool hasNext = helper_->hasNext();\n    if (hasNext) {\n      ++i_;\n      entry_ = helper_->next();\n    } else {\n      i_ = -1;\n      helper_->reset(entry_);\n    }\n    return *this;\n  }\n  Iterator operator++(int) {  // postincrement\n    Iterator ret;\n    ret.i_ = i_;\n    ret.entry_ = std::move(entry_);\n    ++(*this);\n    return ret;\n  }\n\n  global_ref<typename T::javaobject> helper_;\n  // set to -1 at end\n  std::ptrdiff_t i_;\n  value_type entry_;\n};\n\n}\n\ntemplate <typename E>\nstruct JIterator<E>::Iterator : public detail::Iterator<detail::IteratorHelper<E>> {\n  using detail::Iterator<detail::IteratorHelper<E>>::Iterator;\n};\n\ntemplate <typename E>\ntypename JIterator<E>::Iterator JIterator<E>::begin() const {\n  static auto ctor = detail::IteratorHelper<E>::javaClassStatic()->\n    template getConstructor<typename detail::IteratorHelper<E>::javaobject(\n                              typename JIterator<E>::javaobject)>();\n  return Iterator(\n    make_global(\n      detail::IteratorHelper<E>::javaClassStatic()->newObject(ctor, this->self())));\n}\n\ntemplate <typename E>\ntypename JIterator<E>::Iterator JIterator<E>::end() const {\n  return Iterator();\n}\n\ntemplate <typename E>\nstruct JIterable<E>::Iterator : public detail::Iterator<detail::IteratorHelper<E>> {\n  using detail::Iterator<detail::IteratorHelper<E>>::Iterator;\n};\n\ntemplate <typename E>\ntypename JIterable<E>::Iterator JIterable<E>::begin() const {\n  static auto ctor = detail::IteratorHelper<E>::javaClassStatic()->\n    template getConstructor<typename detail::IteratorHelper<E>::javaobject(\n                              typename JIterable<E>::javaobject)>();\n  return Iterator(\n    make_global(\n      detail::IteratorHelper<E>::javaClassStatic()->newObject(ctor, this->self())));\n}\n\ntemplate <typename E>\ntypename JIterable<E>::Iterator JIterable<E>::end() const {\n  return Iterator();\n}\n\ntemplate <typename E>\nsize_t JCollection<E>::size() const {\n  static auto sizeMethod =\n    JCollection<E>::javaClassStatic()->template getMethod<jint()>(\"size\");\n  return sizeMethod(this->self());\n}\n\ntemplate <typename K, typename V>\nstruct JMap<K,V>::Iterator : public detail::Iterator<detail::MapIteratorHelper<K,V>> {\n  using detail::Iterator<detail::MapIteratorHelper<K,V>>::Iterator;\n};\n\ntemplate <typename K, typename V>\nsize_t JMap<K,V>::size() const {\n  static auto sizeMethod =\n    JMap<K,V>::javaClassStatic()->template getMethod<jint()>(\"size\");\n  return sizeMethod(this->self());\n}\n\ntemplate <typename K, typename V>\ntypename JMap<K,V>::Iterator JMap<K,V>::begin() const {\n  static auto ctor = detail::MapIteratorHelper<K,V>::javaClassStatic()->\n    template getConstructor<typename detail::MapIteratorHelper<K,V>::javaobject(\n                              typename JMap<K,V>::javaobject)>();\n  return Iterator(\n    make_global(\n      detail::MapIteratorHelper<K,V>::javaClassStatic()->newObject(ctor, this->self())));\n}\n\ntemplate <typename K, typename V>\ntypename JMap<K,V>::Iterator JMap<K,V>::end() const {\n  return Iterator();\n}\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Iterator.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include \"CoreClasses.h\"\n\nnamespace facebook {\nnamespace jni {\n\n/**\n * JavaClass which represents a reference to a java.util.Iterator instance.  It\n * provides begin()/end() methods to provide C++-style iteration over the\n * underlying collection.  The class has a template parameter for the element\n * type, which defaults to jobject.  For example:\n *\n * alias_ref<JIterator<jstring>::javaobject> my_iter = ...;\n *\n * In the simplest case, it can be used just as alias_ref<JIterator<>::javaobject>,\n * for example in a method declaration.\n */\ntemplate <typename E = jobject>\nstruct JIterator : JavaClass<JIterator<E>> {\n  constexpr static auto kJavaDescriptor = \"Ljava/util/Iterator;\";\n\n  struct Iterator;\n\n  /**\n   * To iterate:\n   *\n   * for (const auto& element : *jiter) { ... }\n   *\n   * The JIterator iterator value_type is local_ref<E>, containing a reference\n   * to an element instance.\n   *\n   * If the Iterator returns objects whch are not convertible to the given\n   * element type, iteration will throw a java ClassCastException.\n   *\n   * For example, to convert an iterator over a collection of java strings to\n   * an std::vector of std::strings:\n   *\n   * std::vector<std::string> vs;\n   * for (const auto& elem : *jiter) {\n   *    vs.push_back(elem->toStdString());\n   * }\n   *\n   * Or if you prefer using std algorithms:\n   *\n   * std::vector<std::string> vs;\n   * std::transform(jiter->begin(), jiter->end(), std::back_inserter(vs),\n   *                [](const local_ref<jstring>& elem) { return elem->toStdString(); });\n   *\n   * The iterator is a InputIterator.\n   */\n  Iterator begin() const;\n  Iterator end() const;\n};\n\n/**\n * Similar to JIterator, except this represents any object which implements the\n * java.lang.Iterable interface. It will create the Java Iterator as a part of\n * begin().\n */\ntemplate <typename E = jobject>\nstruct JIterable : JavaClass<JIterable<E>> {\n  constexpr static auto kJavaDescriptor = \"Ljava/lang/Iterable;\";\n\n  struct Iterator;\n\n  Iterator begin() const;\n  Iterator end() const;\n};\n\n/**\n * JavaClass types which represent Collection, List, and Set are also provided.\n * These preserve the Java class heirarchy.\n */\ntemplate <typename E = jobject>\nstruct JCollection : JavaClass<JCollection<E>, JIterable<E>> {\n  constexpr static auto kJavaDescriptor = \"Ljava/util/Collection;\";\n\n  /**\n   * Returns the number of elements in the collection.\n   */\n  size_t size() const;\n};\n\ntemplate <typename E = jobject>\nstruct JList : JavaClass<JList<E>, JCollection<E>> {\n  constexpr static auto kJavaDescriptor = \"Ljava/util/List;\";\n};\n\ntemplate <typename E = jobject>\nstruct JSet : JavaClass<JSet<E>, JCollection<E>> {\n  constexpr static auto kJavaDescriptor = \"Ljava/util/Set;\";\n};\n\n/**\n * JavaClass which represents a reference to a java.util.Map instance.  It adds\n * wrappers around Java methods, including begin()/end() methods to provide\n * C++-style iteration over the Java Map.  The class has template parameters\n * for the key and value types, which default to jobject.  For example:\n *\n * alias_ref<JMap<jstring, MyJClass::javaobject>::javaobject> my_map = ...;\n *\n * In the simplest case, it can be used just as alias_ref<JMap<>::javaobject>,\n * for example in a method declaration.\n */\ntemplate <typename K = jobject, typename V = jobject>\nstruct JMap : JavaClass<JMap<K,V>> {\n  constexpr static auto kJavaDescriptor = \"Ljava/util/Map;\";\n\n  struct Iterator;\n\n  /**\n   * Returns the number of pairs in the map.\n   */\n  size_t size() const;\n\n  /**\n   * To iterate over the Map:\n   *\n   * for (const auto& entry : *jmap) { ... }\n   *\n   * The JMap iterator value_type is std::pair<local_ref<K>, local_ref<V>>\n   * containing references to key and value instances.\n   *\n   * If the Map contains objects whch are not convertible to the given key and\n   * value types, iteration will throw a java ClassCastException.\n   *\n   * The iterator is a InputIterator.\n   */\n  Iterator begin() const;\n  Iterator end() const;\n};\n\n}\n}\n\n#include \"Iterator-inl.h\"\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/JThread.h",
    "content": "/*\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include \"CoreClasses.h\"\n#include \"NativeRunnable.h\"\n\nnamespace facebook {\nnamespace jni {\n\nclass JThread : public JavaClass<JThread> {\n public:\n  static constexpr const char* kJavaDescriptor = \"Ljava/lang/Thread;\";\n\n  void start() {\n    static auto method = javaClassStatic()->getMethod<void()>(\"start\");\n    method(self());\n  }\n\n  void join() {\n    static auto method = javaClassStatic()->getMethod<void()>(\"join\");\n    method(self());\n  }\n\n  static local_ref<JThread> create(std::function<void()>&& runnable) {\n    auto jrunnable = JNativeRunnable::newObjectCxxArgs(std::move(runnable));\n    return newInstance(static_ref_cast<JRunnable::javaobject>(jrunnable));\n  }\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/JWeakReference.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <fb/visibility.h>\n\n#include \"CoreClasses.h\"\n\nnamespace facebook {\nnamespace jni {\n\n/**\n * Wrap Java's WeakReference instead of using JNI WeakGlobalRefs.\n * A WeakGlobalRef can yield a strong reference even after the object has been\n  * finalized. See comment in the djinni library.\n * https://github.com/dropbox/djinni/blob/master/support-lib/jni/djinni_support.hpp\n */\ntemplate<typename T = jobject>\nclass JWeakReference : public JavaClass<JWeakReference<T>> {\n\n typedef JavaClass<JWeakReference<T>> JavaBase_;\n\n public:\n  static constexpr const char* kJavaDescriptor = \"Ljava/lang/ref/WeakReference;\";\n\n  static local_ref<JWeakReference<T>> newInstance(alias_ref<T> object) {\n    return JavaBase_::newInstance(static_ref_cast<jobject>(object));\n  }\n\n  local_ref<T> get() const {\n    static auto method = JavaBase_::javaClassStatic()->template getMethod<jobject()>(\"get\");\n    return static_ref_cast<T>(method(JavaBase_::self()));\n  }\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Meta-forward.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\nnamespace facebook {\nnamespace jni {\n\ntemplate<typename F>\nclass JMethod;\ntemplate<typename F>\nclass JStaticMethod;\ntemplate<typename F>\nclass JNonvirtualMethod;\ntemplate<typename F>\nstruct JConstructor;\ntemplate<typename F>\nclass JField;\ntemplate<typename F>\nclass JStaticField;\n\n/// Type traits for Java types (currently providing Java type descriptors)\ntemplate<typename T>\nstruct jtype_traits;\n\n/// Type traits for Java methods (currently providing Java type descriptors)\ntemplate<typename F>\nstruct jmethod_traits;\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Meta-inl.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <jni.h>\n\n#include \"Common.h\"\n#include \"Exceptions.h\"\n#include \"MetaConvert.h\"\n#include \"References.h\"\n#include \"Boxed.h\"\n\n#if defined(__ANDROID__)\n#  include <fb/Build.h>\n#endif\n\nnamespace facebook {\nnamespace jni {\n\n// JMethod /////////////////////////////////////////////////////////////////////////////////////////\n\ninline JMethodBase::JMethodBase(jmethodID method_id) noexcept\n  : method_id_{method_id}\n{}\n\ninline JMethodBase::operator bool() const noexcept {\n  return method_id_ != nullptr;\n}\n\ninline jmethodID JMethodBase::getId() const noexcept {\n  return method_id_;\n}\n\nnamespace {\n\ntemplate <int idx, typename... Args>\nstruct ArgsArraySetter;\n\ntemplate <int idx, typename Arg, typename... Args>\nstruct ArgsArraySetter<idx, Arg, Args...> {\n  static void set(alias_ref<JArrayClass<jobject>::javaobject> array, Arg arg0, Args... args) {\n    // TODO(xxxxxxxx): Use Convert<Args>... to do conversions like the fast path.\n    (*array)[idx] = autobox(arg0);\n    ArgsArraySetter<idx + 1, Args...>::set(array, args...);\n  }\n};\n\ntemplate <int idx>\nstruct ArgsArraySetter<idx> {\n  static void set(alias_ref<JArrayClass<jobject>::javaobject> array) {\n  }\n};\n\ntemplate <typename... Args>\nlocal_ref<JArrayClass<jobject>::javaobject> makeArgsArray(Args... args) {\n  auto arr = JArrayClass<jobject>::newArray(sizeof...(args));\n  ArgsArraySetter<0, Args...>::set(arr, args...);\n  return arr;\n}\n\n\ninline bool needsSlowPath(alias_ref<jobject> obj) {\n#if defined(__ANDROID__)\n  // On Android 6.0, art crashes when attempting to call a function on a Proxy.\n  // So, when we detect that case we must use the safe, slow workaround. That is,\n  // we resolve the method id to the corresponding java.lang.reflect.Method object\n  // and make the call via it's invoke() method.\n  static auto is_bad_android = build::Build::getAndroidSdk() == 23;\n\n  if (!is_bad_android) return false;\n  static auto proxy_class = findClassStatic(\"java/lang/reflect/Proxy\");\n  return obj->isInstanceOf(proxy_class);\n#else\n  return false;\n#endif\n}\n\n}\n\ntemplate<typename... Args>\ninline void JMethod<void(Args...)>::operator()(alias_ref<jobject> self, Args... args) {\n  const auto env = Environment::current();\n  env->CallVoidMethod(\n        self.get(),\n        getId(),\n        detail::callToJni(detail::Convert<typename std::decay<Args>::type>::toCall(args))...);\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n}\n\n#pragma push_macro(\"DEFINE_PRIMITIVE_CALL\")\n#undef DEFINE_PRIMITIVE_CALL\n#define DEFINE_PRIMITIVE_CALL(TYPE, METHOD)                                                    \\\ntemplate<typename... Args>                                                                     \\\ninline TYPE JMethod<TYPE(Args...)>::operator()(alias_ref<jobject> self, Args... args) {        \\\n  const auto env = internal::getEnv();                                                         \\\n  auto result = env->Call ## METHOD ## Method(                                                 \\\n        self.get(),                                                                            \\\n        getId(),                                                                               \\\n        detail::callToJni(detail::Convert<typename std::decay<Args>::type>::toCall(args))...); \\\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();                                                      \\\n  return result;                                                                               \\\n}\n\nDEFINE_PRIMITIVE_CALL(jboolean, Boolean)\nDEFINE_PRIMITIVE_CALL(jbyte, Byte)\nDEFINE_PRIMITIVE_CALL(jchar, Char)\nDEFINE_PRIMITIVE_CALL(jshort, Short)\nDEFINE_PRIMITIVE_CALL(jint, Int)\nDEFINE_PRIMITIVE_CALL(jlong, Long)\nDEFINE_PRIMITIVE_CALL(jfloat, Float)\nDEFINE_PRIMITIVE_CALL(jdouble, Double)\n#pragma pop_macro(\"DEFINE_PRIMITIVE_CALL\")\n\n/// JMethod specialization for references that wraps the return value in a @ref local_ref\ntemplate<typename R, typename... Args>\nclass JMethod<R(Args...)> : public JMethodBase {\n public:\n   // TODO: static_assert is jobject-derived or local_ref jobject\n  using JniRet = typename detail::Convert<typename std::decay<R>::type>::jniType;\n  static_assert(IsPlainJniReference<JniRet>(), \"JniRet must be a JNI reference\");\n  using JMethodBase::JMethodBase;\n  JMethod() noexcept {};\n  JMethod(const JMethod& other) noexcept = default;\n\n  /// Invoke a method and return a local reference wrapping the result\n  local_ref<JniRet> operator()(alias_ref<jobject> self, Args... args);\n\n  friend class JClass;\n};\n\ntemplate<typename R, typename... Args>\ninline auto JMethod<R(Args...)>::operator()(alias_ref<jobject> self, Args... args) -> local_ref<JniRet> {\n  const auto env = Environment::current();\n  auto result = env->CallObjectMethod(\n      self.get(),\n      getId(),\n      detail::callToJni(detail::Convert<typename std::decay<Args>::type>::toCall(args))...);\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n  return adopt_local(static_cast<JniRet>(result));\n}\n\ntemplate<typename... Args>\ninline void JStaticMethod<void(Args...)>::operator()(alias_ref<jclass> cls, Args... args) {\n  const auto env = internal::getEnv();\n  env->CallStaticVoidMethod(\n        cls.get(),\n        getId(),\n        detail::callToJni(detail::Convert<typename std::decay<Args>::type>::toCall(args))...);\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n}\n\n#pragma push_macro(\"DEFINE_PRIMITIVE_STATIC_CALL\")\n#undef DEFINE_PRIMITIVE_STATIC_CALL\n#define DEFINE_PRIMITIVE_STATIC_CALL(TYPE, METHOD)                                             \\\ntemplate<typename... Args>                                                                     \\\ninline TYPE JStaticMethod<TYPE(Args...)>::operator()(alias_ref<jclass> cls, Args... args) {    \\\n  const auto env = internal::getEnv();                                                         \\\n  auto result = env->CallStatic ## METHOD ## Method(                                           \\\n        cls.get(),                                                                             \\\n        getId(),                                                                               \\\n        detail::callToJni(detail::Convert<typename std::decay<Args>::type>::toCall(args))...); \\\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();                                                      \\\n        return result;                                                                         \\\n}\n\nDEFINE_PRIMITIVE_STATIC_CALL(jboolean, Boolean)\nDEFINE_PRIMITIVE_STATIC_CALL(jbyte, Byte)\nDEFINE_PRIMITIVE_STATIC_CALL(jchar, Char)\nDEFINE_PRIMITIVE_STATIC_CALL(jshort, Short)\nDEFINE_PRIMITIVE_STATIC_CALL(jint, Int)\nDEFINE_PRIMITIVE_STATIC_CALL(jlong, Long)\nDEFINE_PRIMITIVE_STATIC_CALL(jfloat, Float)\nDEFINE_PRIMITIVE_STATIC_CALL(jdouble, Double)\n#pragma pop_macro(\"DEFINE_PRIMITIVE_STATIC_CALL\")\n\n/// JStaticMethod specialization for references that wraps the return value in a @ref local_ref\ntemplate<typename R, typename... Args>\nclass JStaticMethod<R(Args...)> : public JMethodBase {\n\n public:\n  using JniRet = typename detail::Convert<typename std::decay<R>::type>::jniType;\n  static_assert(IsPlainJniReference<JniRet>(), \"T* must be a JNI reference\");\n  using JMethodBase::JMethodBase;\n  JStaticMethod() noexcept {};\n  JStaticMethod(const JStaticMethod& other) noexcept = default;\n\n  /// Invoke a method and return a local reference wrapping the result\n  local_ref<JniRet> operator()(alias_ref<jclass> cls, Args... args) {\n    const auto env = internal::getEnv();\n    auto result = env->CallStaticObjectMethod(\n          cls.get(),\n          getId(),\n          detail::callToJni(detail::Convert<typename std::decay<Args>::type>::toCall(args))...);\n    FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n    return adopt_local(static_cast<JniRet>(result));\n  }\n\n  friend class JClass;\n};\n\ntemplate<typename... Args>\ninline void\nJNonvirtualMethod<void(Args...)>::operator()(alias_ref<jobject> self, alias_ref<jclass> cls, Args... args) {\n  const auto env = internal::getEnv();\n  env->CallNonvirtualVoidMethod(\n        self.get(),\n        cls.get(),\n        getId(),\n        detail::callToJni(detail::Convert<typename std::decay<Args>::type>::toCall(args))...);\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n}\n\n#pragma push_macro(\"DEFINE_PRIMITIVE_NON_VIRTUAL_CALL\")\n#undef DEFINE_PRIMITIVE_NON_VIRTUAL_CALL\n#define DEFINE_PRIMITIVE_NON_VIRTUAL_CALL(TYPE, METHOD)                                                      \\\ntemplate<typename... Args>                                                                                   \\\ninline TYPE                                                                                                  \\\nJNonvirtualMethod<TYPE(Args...)>::operator()(alias_ref<jobject> self, alias_ref<jclass> cls, Args... args) { \\\n  const auto env = internal::getEnv();                                                                       \\\n  auto result = env->CallNonvirtual ## METHOD ## Method(                                                     \\\n        self.get(),                                                                                          \\\n        cls.get(),                                                                                           \\\n        getId(),                                                                                             \\\n        detail::callToJni(detail::Convert<typename std::decay<Args>::type>::toCall(args))...);               \\\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();                                                                    \\\n  return result;                                                                                             \\\n}\n\nDEFINE_PRIMITIVE_NON_VIRTUAL_CALL(jboolean, Boolean)\nDEFINE_PRIMITIVE_NON_VIRTUAL_CALL(jbyte, Byte)\nDEFINE_PRIMITIVE_NON_VIRTUAL_CALL(jchar, Char)\nDEFINE_PRIMITIVE_NON_VIRTUAL_CALL(jshort, Short)\nDEFINE_PRIMITIVE_NON_VIRTUAL_CALL(jint, Int)\nDEFINE_PRIMITIVE_NON_VIRTUAL_CALL(jlong, Long)\nDEFINE_PRIMITIVE_NON_VIRTUAL_CALL(jfloat, Float)\nDEFINE_PRIMITIVE_NON_VIRTUAL_CALL(jdouble, Double)\n#pragma pop_macro(\"DEFINE_PRIMITIVE_NON_VIRTUAL_CALL\")\n\n/// JNonvirtualMethod specialization for references that wraps the return value in a @ref local_ref\ntemplate<typename R, typename... Args>\nclass JNonvirtualMethod<R(Args...)> : public JMethodBase {\n public:\n  using JniRet = typename detail::Convert<typename std::decay<R>::type>::jniType;\n  static_assert(IsPlainJniReference<JniRet>(), \"T* must be a JNI reference\");\n  using JMethodBase::JMethodBase;\n  JNonvirtualMethod() noexcept {};\n  JNonvirtualMethod(const JNonvirtualMethod& other) noexcept = default;\n\n  /// Invoke a method and return a local reference wrapping the result\n  local_ref<JniRet> operator()(alias_ref<jobject> self, alias_ref<jclass> cls, Args... args){\n    const auto env = internal::getEnv();\n    auto result = env->CallNonvirtualObjectMethod(\n          self.get(),\n          cls.get(),\n          getId(),\n          detail::callToJni(detail::Convert<typename std::decay<Args>::type>::toCall(args))...);\n    FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n    return adopt_local(static_cast<JniRet>(result));\n  }\n\n  friend class JClass;\n};\n\ntemplate <typename... Args>\nlocal_ref<jobject> slowCall(jmethodID method_id, alias_ref<jobject> self, Args... args) {\n    static auto invoke = findClassStatic(\"java/lang/reflect/Method\")\n      ->getMethod<jobject(jobject, JArrayClass<jobject>::javaobject)>(\"invoke\");\n    // TODO(xxxxxxx): Provide fbjni interface to ToReflectedMethod.\n    auto reflected = adopt_local(Environment::current()->ToReflectedMethod(self->getClass().get(), method_id, JNI_FALSE));\n    FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n    if (!reflected) throw std::runtime_error(\"Unable to get reflected java.lang.reflect.Method\");\n    auto argsArray = makeArgsArray(args...);\n    // No need to check for exceptions since invoke is itself a JMethod that will do that for us.\n    return invoke(reflected, self.get(), argsArray.get());\n}\n\n\n// JField<T> ///////////////////////////////////////////////////////////////////////////////////////\n\ntemplate<typename T>\ninline JField<T>::JField(jfieldID field) noexcept\n  : field_id_{field}\n{}\n\ntemplate<typename T>\ninline JField<T>::operator bool() const noexcept {\n  return field_id_ != nullptr;\n}\n\ntemplate<typename T>\ninline jfieldID JField<T>::getId() const noexcept {\n  return field_id_;\n}\n\n#pragma push_macro(\"DEFINE_FIELD_PRIMITIVE_GET_SET\")\n#undef DEFINE_FIELD_PRIMITIVE_GET_SET\n#define DEFINE_FIELD_PRIMITIVE_GET_SET(TYPE, METHOD)                 \\\ntemplate<>                                                           \\\ninline TYPE JField<TYPE>::get(jobject object) const noexcept {       \\\n  const auto env = internal::getEnv();                               \\\n  return env->Get ## METHOD ## Field(object, field_id_);             \\\n}                                                                    \\\n                                                                     \\\ntemplate<>                                                           \\\ninline void JField<TYPE>::set(jobject object, TYPE value) noexcept { \\\n  const auto env = internal::getEnv();                               \\\n  env->Set ## METHOD ## Field(object, field_id_, value);             \\\n}\n\nDEFINE_FIELD_PRIMITIVE_GET_SET(jboolean, Boolean)\nDEFINE_FIELD_PRIMITIVE_GET_SET(jbyte, Byte)\nDEFINE_FIELD_PRIMITIVE_GET_SET(jchar, Char)\nDEFINE_FIELD_PRIMITIVE_GET_SET(jshort, Short)\nDEFINE_FIELD_PRIMITIVE_GET_SET(jint, Int)\nDEFINE_FIELD_PRIMITIVE_GET_SET(jlong, Long)\nDEFINE_FIELD_PRIMITIVE_GET_SET(jfloat, Float)\nDEFINE_FIELD_PRIMITIVE_GET_SET(jdouble, Double)\n#pragma pop_macro(\"DEFINE_FIELD_PRIMITIVE_GET_SET\")\n\ntemplate<typename T>\ninline T JField<T>::get(jobject object) const noexcept {\n  return static_cast<T>(internal::getEnv()->GetObjectField(object, field_id_));\n}\n\ntemplate<typename T>\ninline void JField<T>::set(jobject object, T value) noexcept {\n  internal::getEnv()->SetObjectField(object, field_id_, static_cast<jobject>(value));\n}\n\n// JStaticField<T> /////////////////////////////////////////////////////////////////////////////////\n\ntemplate<typename T>\ninline JStaticField<T>::JStaticField(jfieldID field) noexcept\n  : field_id_{field}\n{}\n\ntemplate<typename T>\ninline JStaticField<T>::operator bool() const noexcept {\n  return field_id_ != nullptr;\n}\n\ntemplate<typename T>\ninline jfieldID JStaticField<T>::getId() const noexcept {\n  return field_id_;\n}\n\n#pragma push_macro(\"DEFINE_STATIC_FIELD_PRIMITIVE_GET_SET\")\n#undef DEFINE_STATIC_FIELD_PRIMITIVE_GET_SET\n#define DEFINE_STATIC_FIELD_PRIMITIVE_GET_SET(TYPE, METHOD)                \\\ntemplate<>                                                                 \\\ninline TYPE JStaticField<TYPE>::get(jclass jcls) const noexcept {          \\\n  const auto env = internal::getEnv();                                     \\\n  return env->GetStatic ## METHOD ## Field(jcls, field_id_);               \\\n}                                                                          \\\n                                                                           \\\ntemplate<>                                                                 \\\ninline void JStaticField<TYPE>::set(jclass jcls, TYPE value) noexcept {    \\\n  const auto env = internal::getEnv();                                     \\\n  env->SetStatic ## METHOD ## Field(jcls, field_id_, value);               \\\n}\n\nDEFINE_STATIC_FIELD_PRIMITIVE_GET_SET(jboolean, Boolean)\nDEFINE_STATIC_FIELD_PRIMITIVE_GET_SET(jbyte, Byte)\nDEFINE_STATIC_FIELD_PRIMITIVE_GET_SET(jchar, Char)\nDEFINE_STATIC_FIELD_PRIMITIVE_GET_SET(jshort, Short)\nDEFINE_STATIC_FIELD_PRIMITIVE_GET_SET(jint, Int)\nDEFINE_STATIC_FIELD_PRIMITIVE_GET_SET(jlong, Long)\nDEFINE_STATIC_FIELD_PRIMITIVE_GET_SET(jfloat, Float)\nDEFINE_STATIC_FIELD_PRIMITIVE_GET_SET(jdouble, Double)\n#pragma pop_macro(\"DEFINE_STATIC_FIELD_PRIMITIVE_GET_SET\")\n\ntemplate<typename T>\ninline T JStaticField<T>::get(jclass jcls) const noexcept {\n  const auto env = internal::getEnv();\n  return static_cast<T>(env->GetStaticObjectField(jcls, field_id_));\n}\n\ntemplate<typename T>\ninline void JStaticField<T>::set(jclass jcls, T value) noexcept {\n  internal::getEnv()->SetStaticObjectField(jcls, field_id_, value);\n}\n\n\n// jmethod_traits //////////////////////////////////////////////////////////////////////////////////\n\n// TODO(T6608405) Adapt this to implement a register natives method that requires no descriptor\nnamespace internal {\n\ntemplate<typename Head>\ninline std::string JavaDescriptor() {\n  return jtype_traits<Head>::descriptor();\n}\n\ntemplate<typename Head, typename Elem, typename... Tail>\ninline std::string JavaDescriptor() {\n  return JavaDescriptor<Head>() + JavaDescriptor<Elem, Tail...>();\n}\n\ntemplate<typename R, typename Arg1, typename... Args>\ninline std::string JMethodDescriptor() {\n  return \"(\" + JavaDescriptor<Arg1, Args...>() + \")\" + JavaDescriptor<R>();\n}\n\ntemplate<typename R>\ninline std::string JMethodDescriptor() {\n  return \"()\" + JavaDescriptor<R>();\n}\n\n} // internal\n\ntemplate<typename R, typename... Args>\ninline std::string jmethod_traits<R(Args...)>::descriptor() {\n  return internal::JMethodDescriptor<R, Args...>();\n}\n\ntemplate<typename R, typename... Args>\ninline std::string jmethod_traits<R(Args...)>::constructor_descriptor() {\n  return internal::JMethodDescriptor<void, Args...>();\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Meta.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/** @file meta.h\n *\n * Provides wrappers for meta data such as methods and fields.\n */\n\n#pragma once\n\n#include <type_traits>\n#include <string>\n\n#include <jni.h>\n\n#include \"References-forward.h\"\n\n#ifdef __ANDROID__\n# include <android/log.h>\n# define XLOG_TAG \"fb-jni\"\n# define XLOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, XLOG_TAG, __VA_ARGS__)\n# define XLOGD(...) __android_log_print(ANDROID_LOG_DEBUG, XLOG_TAG, __VA_ARGS__)\n# define XLOGI(...) __android_log_print(ANDROID_LOG_INFO, XLOG_TAG, __VA_ARGS__)\n# define XLOGW(...) __android_log_print(ANDROID_LOG_WARN, XLOG_TAG, __VA_ARGS__)\n# define XLOGE(...) __android_log_print(ANDROID_LOG_ERROR, XLOG_TAG, __VA_ARGS__)\n# define XLOGWTF(...) __android_log_print(ANDROID_LOG_FATAL, XLOG_TAG, __VA_ARGS__)\n#endif\n\nnamespace facebook {\nnamespace jni {\n\n// This will get the reflected Java Method from the method_id, get it's invoke\n// method, and call the method via that. This shouldn't ever be needed, but\n// Android 6.0 crashes when calling a method on a java.lang.Proxy via jni.\ntemplate <typename... Args>\nlocal_ref<jobject> slowCall(jmethodID method_id, alias_ref<jobject> self, Args... args);\n\nclass JObject;\n\n\n/// Wrapper of a jmethodID. Provides a common base for JMethod specializations\nclass JMethodBase {\n public:\n  /// Verify that the method is valid\n  explicit operator bool() const noexcept;\n\n  /// Access the wrapped id\n  jmethodID getId() const noexcept;\n\n protected:\n  /// Create a wrapper of a method id\n  explicit JMethodBase(jmethodID method_id = nullptr) noexcept;\n\n private:\n  jmethodID method_id_;\n};\n\n\n/// Representation of a jmethodID\ntemplate<typename F>\nclass JMethod;\n\n/// @cond INTERNAL\n#pragma push_macro(\"DEFINE_PRIMITIVE_METHOD_CLASS\")\n\n#undef DEFINE_PRIMITIVE_METHOD_CLASS\n\n// Defining JMethod specializations based on return value\n#define DEFINE_PRIMITIVE_METHOD_CLASS(TYPE)                                      \\\ntemplate<typename... Args>                                                       \\\nclass JMethod<TYPE(Args...)> : public JMethodBase {                              \\\n public:                                                                         \\\n  static_assert(std::is_void<TYPE>::value || IsJniPrimitive<TYPE>(),             \\\n      \"TYPE must be primitive or void\");                                         \\\n                                                                                 \\\n  using JMethodBase::JMethodBase;                                                \\\n  JMethod() noexcept {};                                                         \\\n  JMethod(const JMethod& other) noexcept = default;                              \\\n                                                                                 \\\n  TYPE operator()(alias_ref<jobject> self, Args... args);                        \\\n                                                                                 \\\n  friend class JClass;                                                           \\\n}\n\nDEFINE_PRIMITIVE_METHOD_CLASS(void);\nDEFINE_PRIMITIVE_METHOD_CLASS(jboolean);\nDEFINE_PRIMITIVE_METHOD_CLASS(jbyte);\nDEFINE_PRIMITIVE_METHOD_CLASS(jchar);\nDEFINE_PRIMITIVE_METHOD_CLASS(jshort);\nDEFINE_PRIMITIVE_METHOD_CLASS(jint);\nDEFINE_PRIMITIVE_METHOD_CLASS(jlong);\nDEFINE_PRIMITIVE_METHOD_CLASS(jfloat);\nDEFINE_PRIMITIVE_METHOD_CLASS(jdouble);\n\n#pragma pop_macro(\"DEFINE_PRIMITIVE_METHOD_CLASS\")\n/// @endcond\n\n\n/// Convenience type representing constructors\n/// These should only be used with JClass::getConstructor and JClass::newObject.\ntemplate<typename F>\nstruct JConstructor : private JMethod<F> {\n  using JMethod<F>::JMethod;\n private:\n  JConstructor(const JMethod<F>& other) : JMethod<F>(other.getId()) {}\n  friend class JClass;\n};\n\n/// Representation of a jStaticMethodID\ntemplate<typename F>\nclass JStaticMethod;\n\n/// @cond INTERNAL\n#pragma push_macro(\"DEFINE_PRIMITIVE_STATIC_METHOD_CLASS\")\n\n#undef DEFINE_PRIMITIVE_STATIC_METHOD_CLASS\n\n// Defining JStaticMethod specializations based on return value\n#define DEFINE_PRIMITIVE_STATIC_METHOD_CLASS(TYPE)                          \\\ntemplate<typename... Args>                                                  \\\nclass JStaticMethod<TYPE(Args...)> : public JMethodBase {                   \\\n  static_assert(std::is_void<TYPE>::value || IsJniPrimitive<TYPE>(),        \\\n      \"T must be a JNI primitive or void\");                                 \\\n                                                                            \\\n public:                                                                    \\\n  using JMethodBase::JMethodBase;                                           \\\n  JStaticMethod() noexcept {};                                              \\\n  JStaticMethod(const JStaticMethod& other) noexcept = default;             \\\n                                                                            \\\n  TYPE operator()(alias_ref<jclass> cls, Args... args);                     \\\n                                                                            \\\n  friend class JClass;                                                      \\\n}\n\nDEFINE_PRIMITIVE_STATIC_METHOD_CLASS(void);\nDEFINE_PRIMITIVE_STATIC_METHOD_CLASS(jboolean);\nDEFINE_PRIMITIVE_STATIC_METHOD_CLASS(jbyte);\nDEFINE_PRIMITIVE_STATIC_METHOD_CLASS(jchar);\nDEFINE_PRIMITIVE_STATIC_METHOD_CLASS(jshort);\nDEFINE_PRIMITIVE_STATIC_METHOD_CLASS(jint);\nDEFINE_PRIMITIVE_STATIC_METHOD_CLASS(jlong);\nDEFINE_PRIMITIVE_STATIC_METHOD_CLASS(jfloat);\nDEFINE_PRIMITIVE_STATIC_METHOD_CLASS(jdouble);\n\n#pragma pop_macro(\"DEFINE_PRIMITIVE_STATIC_METHOD_CLASS\")\n/// @endcond\n\n\n/// Representation of a jNonvirtualMethodID\ntemplate<typename F>\nclass JNonvirtualMethod;\n\n/// @cond INTERNAL\n#pragma push_macro(\"DEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS\")\n\n#undef DEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS\n\n// Defining JNonvirtualMethod specializations based on return value\n#define DEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS(TYPE)                     \\\ntemplate<typename... Args>                                                  \\\nclass JNonvirtualMethod<TYPE(Args...)> : public JMethodBase {               \\\n  static_assert(std::is_void<TYPE>::value || IsJniPrimitive<TYPE>(),        \\\n      \"T must be a JNI primitive or void\");                                 \\\n                                                                            \\\n public:                                                                    \\\n  using JMethodBase::JMethodBase;                                           \\\n  JNonvirtualMethod() noexcept {};                                          \\\n  JNonvirtualMethod(const JNonvirtualMethod& other) noexcept = default;     \\\n                                                                            \\\n  TYPE operator()(alias_ref<jobject> self, alias_ref<jclass> cls, Args... args);       \\\n                                                                            \\\n  friend class JClass;                                                      \\\n}\n\nDEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS(void);\nDEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS(jboolean);\nDEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS(jbyte);\nDEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS(jchar);\nDEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS(jshort);\nDEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS(jint);\nDEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS(jlong);\nDEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS(jfloat);\nDEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS(jdouble);\n\n#pragma pop_macro(\"DEFINE_PRIMITIVE_NON_VIRTUAL_METHOD_CLASS\")\n/// @endcond\n\n\n/**\n * JField represents typed fields and simplifies their access. Note that object types return\n * raw pointers which generally should promptly get a wrap_local treatment.\n */\ntemplate<typename T>\nclass JField {\n  static_assert(IsJniScalar<T>(), \"T must be a JNI scalar\");\n\n public:\n  /// Wraps an existing field id\n  explicit JField(jfieldID field = nullptr) noexcept;\n\n  /// Verify that the id is valid\n  explicit operator bool() const noexcept;\n\n  /// Access the wrapped id\n  jfieldID getId() const noexcept;\n\n private:\n  jfieldID field_id_;\n\n  /// Get field value\n  /// @pre object != nullptr\n  T get(jobject object) const noexcept;\n\n  /// Set field value\n  /// @pre object != nullptr\n  void set(jobject object, T value) noexcept;\n\n  friend class JObject;\n};\n\n\n/**\n * JStaticField represents typed fields and simplifies their access. Note that object types\n * return raw pointers which generally should promptly get a wrap_local treatment.\n */\ntemplate<typename T>\nclass JStaticField {\n  static_assert(IsJniScalar<T>(), \"T must be a JNI scalar\");\n\n public:\n  /// Wraps an existing field id\n  explicit JStaticField(jfieldID field = nullptr) noexcept;\n\n  /// Verify that the id is valid\n  explicit operator bool() const noexcept;\n\n  /// Access the wrapped id\n  jfieldID getId() const noexcept;\n\n private:\n  jfieldID field_id_;\n\n  /// Get field value\n  /// @pre object != nullptr\n  T get(jclass jcls) const noexcept;\n\n  /// Set field value\n  /// @pre object != nullptr\n  void set(jclass jcls, T value) noexcept;\n\n  friend class JClass;\n  friend class JObject;\n};\n\n\n/// Template magic to provide @ref jmethod_traits\ntemplate<typename R, typename... Args>\nstruct jmethod_traits<R(Args...)> {\n  static std::string descriptor();\n  static std::string constructor_descriptor();\n};\n\n\n// jtype_traits ////////////////////////////////////////////////////////////////////////////////////\n\ntemplate<typename T>\nstruct jtype_traits {\nprivate:\n  using Repr = ReprType<T>;\npublic:\n  // The jni type signature (described at\n  // http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/types.html).\n  static std::string descriptor() {\n    std::string descriptor;\n    if (Repr::kJavaDescriptor == nullptr) {\n      descriptor = Repr::get_instantiated_java_descriptor();\n    } else {\n      descriptor = Repr::kJavaDescriptor;\n    }\n    return descriptor;\n  }\n\n  // The signature used for class lookups. See\n  // http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html#getName().\n  static std::string base_name() {\n    if (Repr::kJavaDescriptor != nullptr) {\n      std::string base_name = Repr::kJavaDescriptor;\n      return base_name.substr(1, base_name.size() - 2);\n    }\n    return Repr::get_instantiated_base_name();\n  }\n};\n\n#pragma push_macro(\"DEFINE_FIELD_AND_ARRAY_TRAIT\")\n#undef DEFINE_FIELD_AND_ARRAY_TRAIT\n\n#define DEFINE_FIELD_AND_ARRAY_TRAIT(TYPE, DSC)                     \\\ntemplate<>                                                          \\\nstruct jtype_traits<TYPE> {                                         \\\n  static std::string descriptor() { return std::string{#DSC}; }     \\\n  static std::string base_name() { return descriptor(); }           \\\n  using array_type = TYPE ## Array;                                 \\\n};                                                                  \\\ntemplate<>                                                          \\\nstruct jtype_traits<TYPE ## Array> {                                \\\n  static std::string descriptor() { return std::string{\"[\" #DSC}; } \\\n  static std::string base_name() { return descriptor(); }           \\\n  using entry_type = TYPE;                                          \\\n};\n\n// There is no voidArray, handle that without the macro.\ntemplate<>\nstruct jtype_traits<void> {\n  static std::string descriptor() { return std::string{\"V\"}; };\n};\n\nDEFINE_FIELD_AND_ARRAY_TRAIT(jboolean, Z)\nDEFINE_FIELD_AND_ARRAY_TRAIT(jbyte,    B)\nDEFINE_FIELD_AND_ARRAY_TRAIT(jchar,    C)\nDEFINE_FIELD_AND_ARRAY_TRAIT(jshort,   S)\nDEFINE_FIELD_AND_ARRAY_TRAIT(jint,     I)\nDEFINE_FIELD_AND_ARRAY_TRAIT(jlong,    J)\nDEFINE_FIELD_AND_ARRAY_TRAIT(jfloat,   F)\nDEFINE_FIELD_AND_ARRAY_TRAIT(jdouble,  D)\n\n#pragma pop_macro(\"DEFINE_FIELD_AND_ARRAY_TRAIT\")\n\n\ntemplate <typename T>\nstruct jmethod_traits_from_cxx;\n\n}}\n\n#include \"Meta-inl.h\"\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/MetaConvert.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <jni.h>\n\n#include \"Common.h\"\n#include \"References.h\"\n\nnamespace facebook {\nnamespace jni {\n\nnamespace detail {\n\n// In order to avoid potentially filling the jni locals table,\n// temporary objects (right now, this is just jstrings) need to be\n// released. This is done by returning a holder which autoconverts to\n// jstring.\ntemplate <typename T>\ninline T callToJni(T&& t) {\n  return t;\n}\n\ntemplate <typename T>\ninline JniType<T> callToJni(local_ref<T>&& sref) {\n  return sref.get();\n}\n\n// Normally, pass through types unmolested.\ntemplate <typename T, typename Enabled = void>\nstruct Convert {\n  typedef T jniType;\n  static jniType fromJni(jniType t) {\n    return t;\n  }\n  static jniType toJniRet(jniType t) {\n    return t;\n  }\n  static jniType toCall(jniType t) {\n    return t;\n  }\n};\n\n// This is needed for return conversion\ntemplate <>\nstruct Convert<void> {\n  typedef void jniType;\n};\n\n// jboolean is an unsigned char, not a bool. Allow it to work either way.\ntemplate<>\nstruct Convert<bool> {\n  typedef jboolean jniType;\n  static bool fromJni(jniType t) {\n    return t;\n  }\n  static jniType toJniRet(bool t) {\n    return t;\n  }\n  static jniType toCall(bool t) {\n    return t;\n  }\n};\n\n// convert to alias_ref<T> from T\ntemplate <typename T>\nstruct Convert<alias_ref<T>> {\n  typedef JniType<T> jniType;\n  static alias_ref<jniType> fromJni(jniType t) {\n    return wrap_alias(t);\n  }\n  static jniType toJniRet(alias_ref<jniType> t) {\n    return t.get();\n  }\n  static jniType toCall(alias_ref<jniType> t) {\n    return t.get();\n  }\n};\n\n// convert return from local_ref<T>\ntemplate <typename T>\nstruct Convert<local_ref<T>> {\n  typedef JniType<T> jniType;\n  // No automatic synthesis of local_ref\n  static jniType toJniRet(local_ref<jniType> t) {\n    return t.release();\n  }\n  static jniType toCall(local_ref<jniType> t) {\n    return t.get();\n  }\n};\n\n// convert return from global_ref<T>\ntemplate <typename T>\nstruct Convert<global_ref<T>> {\n  typedef JniType<T> jniType;\n  // No automatic synthesis of global_ref\n  static jniType toJniRet(global_ref<jniType>&& t) {\n    // If this gets called, ownership the global_ref was passed in here.  (It's\n    // probably a copy of a persistent global_ref made when a function was\n    // declared to return a global_ref, but it could moved out or otherwise not\n    // referenced elsewhere.  Doesn't matter.)  Either way, the only safe way\n    // to return it is to make a local_ref, release it, and return the\n    // underlying local jobject.\n    auto ret = make_local(t);\n    return ret.release();\n  }\n  static jniType toJniRet(const global_ref<jniType>& t) {\n    // If this gets called, the function was declared to return const&.  We\n    // have a ref to a global_ref whose lifetime will exceed this call, so we\n    // can just get the underlying jobject and return it to java without\n    // needing to make a local_ref.\n    return t.get();\n  }\n  static jniType toCall(global_ref<jniType> t) {\n    return t.get();\n  }\n};\n\ntemplate <typename T> struct jni_sig_from_cxx_t;\ntemplate <typename R, typename... Args>\nstruct jni_sig_from_cxx_t<R(Args...)> {\n  using JniRet = typename Convert<typename std::decay<R>::type>::jniType;\n  using JniSig = JniRet(typename Convert<typename std::decay<Args>::type>::jniType...);\n};\n\ntemplate <typename T>\nusing jni_sig_from_cxx = typename jni_sig_from_cxx_t<T>::JniSig;\n\n} // namespace detail\n\ntemplate <typename R, typename... Args>\nstruct jmethod_traits_from_cxx<R(Args...)> : jmethod_traits<detail::jni_sig_from_cxx<R(Args...)>> {\n};\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/NativeRunnable.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include \"CoreClasses.h\"\n#include \"Hybrid.h\"\n#include \"Registration.h\"\n\n#include <functional>\n\nnamespace facebook {\nnamespace jni {\n\nstruct JRunnable : public JavaClass<JRunnable> {\n  static auto constexpr kJavaDescriptor = \"Ljava/lang/Runnable;\";\n};\n\nstruct JNativeRunnable : public HybridClass<JNativeRunnable, JRunnable> {\n public:\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/jni/NativeRunnable;\";\n\n  JNativeRunnable(std::function<void()>&& runnable) : runnable_(std::move(runnable)) {}\n\n  static void OnLoad() {\n    registerHybrid({\n        makeNativeMethod(\"run\", JNativeRunnable::run),\n      });\n  }\n\n  void run() {\n    runnable_();\n  }\n\n private:\n  std::function<void()> runnable_;\n};\n\n\n} // namespace jni\n} // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/ReferenceAllocators-inl.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <cassert>\n#include <new>\n#include <atomic>\n\nnamespace facebook {\nnamespace jni {\n\n/// @cond INTERNAL\nnamespace internal {\n\n// Statistics mostly provided for test (only updated if FBJNI_DEBUG_REFS is defined)\nstruct ReferenceStats {\n  std::atomic_uint locals_created, globals_created, weaks_created,\n                   locals_deleted, globals_deleted, weaks_deleted;\n\n  void reset() noexcept;\n};\n\nextern ReferenceStats g_reference_stats;\n}\n/// @endcond\n\n\n// LocalReferenceAllocator /////////////////////////////////////////////////////////////////////////\n\ninline jobject LocalReferenceAllocator::newReference(jobject original) const {\n  internal::dbglog(\"Local new: %p\", original);\n  #ifdef FBJNI_DEBUG_REFS\n    ++internal::g_reference_stats.locals_created;\n  #endif\n  auto ref = internal::getEnv()->NewLocalRef(original);\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n  return ref;\n}\n\ninline void LocalReferenceAllocator::deleteReference(jobject reference) const noexcept {\n  internal::dbglog(\"Local release: %p\", reference);\n\n  if (reference) {\n    #ifdef FBJNI_DEBUG_REFS\n      ++internal::g_reference_stats.locals_deleted;\n    #endif\n    assert(verifyReference(reference));\n    internal::getEnv()->DeleteLocalRef(reference);\n  }\n}\n\ninline bool LocalReferenceAllocator::verifyReference(jobject reference) const noexcept {\n  if (!reference || !internal::doesGetObjectRefTypeWork()) {\n    return true;\n  }\n  return internal::getEnv()->GetObjectRefType(reference) == JNILocalRefType;\n}\n\n\n// GlobalReferenceAllocator ////////////////////////////////////////////////////////////////////////\n\ninline jobject GlobalReferenceAllocator::newReference(jobject original) const {\n  internal::dbglog(\"Global new: %p\", original);\n  #ifdef FBJNI_DEBUG_REFS\n    ++internal::g_reference_stats.globals_created;\n  #endif\n  auto ref = internal::getEnv()->NewGlobalRef(original);\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n  return ref;\n}\n\ninline void GlobalReferenceAllocator::deleteReference(jobject reference) const noexcept {\n  internal::dbglog(\"Global release: %p\", reference);\n\n  if (reference) {\n    #ifdef FBJNI_DEBUG_REFS\n      ++internal::g_reference_stats.globals_deleted;\n    #endif\n    assert(verifyReference(reference));\n    internal::getEnv()->DeleteGlobalRef(reference);\n  }\n}\n\ninline bool GlobalReferenceAllocator::verifyReference(jobject reference) const noexcept {\n  if (!reference || !internal::doesGetObjectRefTypeWork()) {\n    return true;\n  }\n  return internal::getEnv()->GetObjectRefType(reference) == JNIGlobalRefType;\n}\n\n\n// WeakGlobalReferenceAllocator ////////////////////////////////////////////////////////////////////\n\ninline jobject WeakGlobalReferenceAllocator::newReference(jobject original) const {\n  internal::dbglog(\"Weak global new: %p\", original);\n  #ifdef FBJNI_DEBUG_REFS\n    ++internal::g_reference_stats.weaks_created;\n  #endif\n  auto ref = internal::getEnv()->NewWeakGlobalRef(original);\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n  return ref;\n}\n\ninline void WeakGlobalReferenceAllocator::deleteReference(jobject reference) const noexcept {\n  internal::dbglog(\"Weak Global release: %p\", reference);\n\n  if (reference) {\n    #ifdef FBJNI_DEBUG_REFS\n      ++internal::g_reference_stats.weaks_deleted;\n    #endif\n    assert(verifyReference(reference));\n    internal::getEnv()->DeleteWeakGlobalRef(reference);\n  }\n}\n\ninline bool WeakGlobalReferenceAllocator::verifyReference(jobject reference) const noexcept {\n  if (!reference || !internal::doesGetObjectRefTypeWork()) {\n    return true;\n  }\n  return internal::getEnv()->GetObjectRefType(reference) == JNIWeakGlobalRefType;\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/ReferenceAllocators.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/**\n * @file ReferenceAllocators.h\n *\n * Reference allocators are used to create and delete various classes of JNI references (local,\n * global, and weak global).\n */\n\n#pragma once\n\n#include <fb/visibility.h>\n\n#include \"Common.h\"\n\nnamespace facebook { namespace jni {\n\n/// Allocator that handles local references\nclass FBEXPORT LocalReferenceAllocator {\n public:\n  jobject newReference(jobject original) const;\n  void deleteReference(jobject reference) const noexcept;\n  bool verifyReference(jobject reference) const noexcept;\n};\n\n/// Allocator that handles global references\nclass FBEXPORT GlobalReferenceAllocator {\n public:\n  jobject newReference(jobject original) const;\n  void deleteReference(jobject reference) const noexcept;\n  bool verifyReference(jobject reference) const noexcept;\n};\n\n/// Allocator that handles weak global references\nclass FBEXPORT WeakGlobalReferenceAllocator {\n public:\n  jobject newReference(jobject original) const;\n  void deleteReference(jobject reference) const noexcept;\n  bool verifyReference(jobject reference) const noexcept;\n};\n\n/// @cond INTERNAL\nnamespace internal {\n\n/**\n * @return true iff env->GetObjectRefType is expected to work properly.\n */\nFBEXPORT bool doesGetObjectRefTypeWork();\n\n}\n/// @endcond\n\n}}\n\n#include \"ReferenceAllocators-inl.h\"\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/References-forward.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include \"ReferenceAllocators.h\"\n\nnamespace facebook {\nnamespace jni {\n\ntemplate<typename T, typename Enable = void>\nclass JObjectWrapper;\n\nnamespace detail {\nstruct JObjectBase {\n  jobject get() const noexcept;\n  void set(jobject reference) noexcept;\n  jobject this_;\n};\n\n// RefReprType maps a type to the representation used by fbjni smart references.\ntemplate <typename T, typename Enable = void>\nstruct RefReprType;\n\ntemplate <typename T>\nstruct JavaObjectType;\n\ntemplate <typename T>\nstruct ReprAccess;\n}\n\n// Given T, either a jobject-like type or a JavaClass-derived type, ReprType<T>\n// is the corresponding JavaClass-derived type and JniType<T> is the\n// jobject-like type.\ntemplate <typename T>\nusing ReprType = typename detail::RefReprType<T>::type;\n\ntemplate <typename T>\nusing JniType = typename detail::JavaObjectType<T>::type;\n\ntemplate<typename T, typename Alloc>\nclass base_owned_ref;\n\ntemplate<typename T, typename Alloc>\nclass basic_strong_ref;\n\ntemplate<typename T>\nclass weak_ref;\n\ntemplate<typename T>\nclass alias_ref;\n\n/// A smart unique reference owning a local JNI reference\ntemplate<typename T>\nusing local_ref = basic_strong_ref<T, LocalReferenceAllocator>;\n\n/// A smart unique reference owning a global JNI reference\ntemplate<typename T>\nusing global_ref = basic_strong_ref<T, GlobalReferenceAllocator>;\n\n}} // namespace facebook::jni\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/References-inl.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <new>\n#include \"CoreClasses.h\"\n\nnamespace facebook {\nnamespace jni {\n\ntemplate<typename T>\ninline enable_if_t<IsPlainJniReference<T>(), T> getPlainJniReference(T ref) {\n  return ref;\n}\n\ntemplate<typename T>\ninline JniType<T> getPlainJniReference(alias_ref<T> ref) {\n  return ref.get();\n}\n\ntemplate<typename T, typename A>\ninline JniType<T> getPlainJniReference(const base_owned_ref<T, A>& ref) {\n  return ref.get();\n}\n\n\nnamespace detail {\ntemplate <typename Repr>\nstruct ReprAccess {\n  using javaobject = JniType<Repr>;\n  static void set(Repr& repr, javaobject obj) noexcept {\n    repr.JObjectBase::set(obj);\n  }\n  static javaobject get(const Repr& repr) {\n    return static_cast<javaobject>(repr.JObject::get());\n  }\n};\n\nnamespace {\ntemplate <typename Repr>\nvoid StaticAssertValidRepr() noexcept {\n  static_assert(std::is_base_of<JObject, Repr>::value,\n      \"A smart ref representation must be derived from JObject.\");\n  static_assert(IsPlainJniReference<JniType<Repr>>(), \"T must be a JNI reference\");\n  static_assert(sizeof(Repr) == sizeof(JObjectBase), \"\");\n  static_assert(alignof(Repr) == alignof(JObjectBase), \"\");\n}\n}\n\ntemplate <typename Repr>\nReprStorage<Repr>::ReprStorage(JniType<Repr> obj) noexcept {\n  StaticAssertValidRepr<Repr>();\n  set(obj);\n}\n\ntemplate <typename Repr>\nvoid ReprStorage<Repr>::set(JniType<Repr> obj) noexcept {\n  new (&storage_) Repr;\n  ReprAccess<Repr>::set(get(), obj);\n}\n\ntemplate <typename Repr>\nRepr& ReprStorage<Repr>::get() noexcept {\n  return *reinterpret_cast<Repr*>(&storage_);\n}\n\ntemplate <typename Repr>\nconst Repr& ReprStorage<Repr>::get() const noexcept {\n  return *reinterpret_cast<const Repr*>(&storage_);\n}\n\ntemplate <typename Repr>\nJniType<Repr> ReprStorage<Repr>::jobj() const noexcept {\n  ReprAccess<Repr>::get(get());\n  return ReprAccess<Repr>::get(get());\n}\n\ntemplate <typename Repr>\nvoid ReprStorage<Repr>::swap(ReprStorage& other) noexcept {\n  StaticAssertValidRepr<Repr>();\n  using std::swap;\n  swap(get(), other.get());\n}\n\ninline void JObjectBase::set(jobject reference) noexcept {\n  this_ = reference;\n}\n\ninline jobject JObjectBase::get() const noexcept {\n  return this_;\n}\n\ntemplate<typename T, typename Alloc>\nenable_if_t<IsNonWeakReference<T>(), plain_jni_reference_t<T>> make_ref(const T& reference) {\n  auto old_reference = getPlainJniReference(reference);\n  if (!old_reference) {\n    return nullptr;\n  }\n\n  auto ref = Alloc{}.newReference(old_reference);\n  if (!ref) {\n    // Note that we end up here if we pass a weak ref that refers to a collected object.\n    // Thus, it's hard to come up with a reason why this function should be used with\n    // weak references.\n    throw std::bad_alloc{};\n  }\n\n  return static_cast<plain_jni_reference_t<T>>(ref);\n}\n\n} // namespace detail\n\ntemplate<typename T>\ninline local_ref<T> adopt_local(T ref) noexcept {\n  static_assert(IsPlainJniReference<T>(), \"T must be a plain jni reference\");\n  return local_ref<T>{ref};\n}\n\ntemplate<typename T>\ninline global_ref<T> adopt_global(T ref) noexcept {\n  static_assert(IsPlainJniReference<T>(), \"T must be a plain jni reference\");\n  return global_ref<T>{ref};\n}\n\ntemplate<typename T>\ninline weak_ref<T> adopt_weak_global(T ref) noexcept {\n  static_assert(IsPlainJniReference<T>(), \"T must be a plain jni reference\");\n  return weak_ref<T>{ref};\n}\n\n\ntemplate<typename T>\ninline enable_if_t<IsPlainJniReference<T>(), alias_ref<T>> wrap_alias(T ref) noexcept {\n  return alias_ref<T>(ref);\n}\n\n\ntemplate<typename T>\nenable_if_t<IsPlainJniReference<T>(), alias_ref<T>> wrap_alias(T ref) noexcept;\n\n\ntemplate<typename T>\nenable_if_t<IsNonWeakReference<T>(), local_ref<plain_jni_reference_t<T>>>\nmake_local(const T& ref) {\n  return adopt_local(detail::make_ref<T, LocalReferenceAllocator>(ref));\n}\n\ntemplate<typename T>\nenable_if_t<IsNonWeakReference<T>(), global_ref<plain_jni_reference_t<T>>>\nmake_global(const T& ref) {\n  return adopt_global(detail::make_ref<T, GlobalReferenceAllocator>(ref));\n}\n\ntemplate<typename T>\nenable_if_t<IsNonWeakReference<T>(), weak_ref<plain_jni_reference_t<T>>>\nmake_weak(const T& ref) {\n  return adopt_weak_global(detail::make_ref<T, WeakGlobalReferenceAllocator>(ref));\n}\n\ntemplate<typename T1, typename T2>\ninline enable_if_t<IsNonWeakReference<T1>() && IsNonWeakReference<T2>(), bool>\noperator==(const T1& a, const T2& b) {\n  return isSameObject(getPlainJniReference(a), getPlainJniReference(b));\n}\n\ntemplate<typename T1, typename T2>\ninline enable_if_t<IsNonWeakReference<T1>() && IsNonWeakReference<T2>(), bool>\noperator!=(const T1& a, const T2& b) {\n  return !(a == b);\n}\n\n\n// base_owned_ref ///////////////////////////////////////////////////////////////////////\n\ntemplate<typename T, typename Alloc>\ninline base_owned_ref<T, Alloc>::base_owned_ref() noexcept\n  : base_owned_ref(nullptr)\n{}\n\ntemplate<typename T, typename Alloc>\ninline base_owned_ref<T, Alloc>::base_owned_ref(std::nullptr_t t) noexcept\n  : base_owned_ref(static_cast<javaobject>(nullptr))\n{}\n\ntemplate<typename T, typename Alloc>\ninline base_owned_ref<T, Alloc>::base_owned_ref(const base_owned_ref& other)\n  : storage_{static_cast<javaobject>(Alloc{}.newReference(other.get()))}\n{}\n\ntemplate<typename T, typename Alloc>\ntemplate<typename U>\ninline base_owned_ref<T, Alloc>::base_owned_ref(const base_owned_ref<U, Alloc>& other)\n  : storage_{static_cast<javaobject>(Alloc{}.newReference(other.get()))}\n{\n  static_assert(std::is_convertible<JniType<U>, javaobject>::value, \"\");\n}\n\ntemplate<typename T, typename Alloc>\ninline facebook::jni::base_owned_ref<T, Alloc>::base_owned_ref(\n    javaobject reference) noexcept\n  : storage_(reference) {\n  assert(Alloc{}.verifyReference(reference));\n  internal::dbglog(\"New wrapped ref=%p this=%p\", get(), this);\n}\n\ntemplate<typename T, typename Alloc>\ninline base_owned_ref<T, Alloc>::base_owned_ref(\n    base_owned_ref<T, Alloc>&& other) noexcept\n  : storage_(other.get()) {\n  internal::dbglog(\"New move from ref=%p other=%p\", other.get(), &other);\n  internal::dbglog(\"New move to ref=%p this=%p\", get(), this);\n  // JObject is a simple type and does not support move semantics so we explicitly\n  // clear other\n  other.set(nullptr);\n}\n\ntemplate<typename T, typename Alloc>\ntemplate<typename U>\nbase_owned_ref<T, Alloc>::base_owned_ref(base_owned_ref<U, Alloc>&& other) noexcept\n  : storage_(other.get()) {\n  internal::dbglog(\"New move from ref=%p other=%p\", other.get(), &other);\n  internal::dbglog(\"New move to ref=%p this=%p\", get(), this);\n  // JObject is a simple type and does not support move semantics so we explicitly\n  // clear other\n  other.set(nullptr);\n}\n\ntemplate<typename T, typename Alloc>\ninline base_owned_ref<T, Alloc>::~base_owned_ref() noexcept {\n  reset();\n  internal::dbglog(\"Ref destruct ref=%p this=%p\", get(), this);\n}\n\ntemplate<typename T, typename Alloc>\ninline auto base_owned_ref<T, Alloc>::release() noexcept -> javaobject {\n  auto value = get();\n  internal::dbglog(\"Ref release ref=%p this=%p\", value, this);\n  set(nullptr);\n  return value;\n}\n\ntemplate<typename T, typename Alloc>\ninline void base_owned_ref<T,Alloc>::reset() noexcept {\n  reset(nullptr);\n}\n\ntemplate<typename T, typename Alloc>\ninline void base_owned_ref<T,Alloc>::reset(javaobject reference) noexcept {\n  if (get()) {\n    assert(Alloc{}.verifyReference(reference));\n    Alloc{}.deleteReference(get());\n  }\n  set(reference);\n}\n\ntemplate<typename T, typename Alloc>\ninline auto base_owned_ref<T, Alloc>::get() const noexcept -> javaobject {\n  return storage_.jobj();\n}\n\ntemplate<typename T, typename Alloc>\ninline void base_owned_ref<T, Alloc>::set(javaobject ref) noexcept {\n  storage_.set(ref);\n}\n\n\n// weak_ref ///////////////////////////////////////////////////////////////////////\n\ntemplate<typename T>\ninline weak_ref<T>& weak_ref<T>::operator=(\n    const weak_ref& other) {\n  auto otherCopy = other;\n  swap(*this, otherCopy);\n  return *this;\n}\n\ntemplate<typename T>\ninline weak_ref<T>& weak_ref<T>::operator=(\n    weak_ref<T>&& other) noexcept {\n  internal::dbglog(\"Op= move ref=%p this=%p oref=%p other=%p\",\n      get(), this, other.get(), &other);\n  reset(other.release());\n  return *this;\n}\n\ntemplate<typename T>\nlocal_ref<T> weak_ref<T>::lockLocal() const {\n  return adopt_local(\n      static_cast<javaobject>(LocalReferenceAllocator{}.newReference(get())));\n}\n\ntemplate<typename T>\nglobal_ref<T> weak_ref<T>::lockGlobal() const {\n  return adopt_global(\n      static_cast<javaobject>(GlobalReferenceAllocator{}.newReference(get())));\n}\n\ntemplate<typename T>\ninline void swap(\n    weak_ref<T>& a,\n    weak_ref<T>& b) noexcept {\n  internal::dbglog(\"Ref swap a.ref=%p a=%p b.ref=%p b=%p\",\n      a.get(), &a, b.get(), &b);\n  a.storage_.swap(b.storage_);\n}\n\n\n// basic_strong_ref ////////////////////////////////////////////////////////////////////////////\n\ntemplate<typename T, typename Alloc>\ninline basic_strong_ref<T, Alloc>& basic_strong_ref<T, Alloc>::operator=(\n    const basic_strong_ref& other) {\n  auto otherCopy = other;\n  swap(*this, otherCopy);\n  return *this;\n}\n\ntemplate<typename T, typename Alloc>\ninline basic_strong_ref<T, Alloc>& basic_strong_ref<T, Alloc>::operator=(\n    basic_strong_ref<T, Alloc>&& other) noexcept {\n  internal::dbglog(\"Op= move ref=%p this=%p oref=%p other=%p\",\n      get(), this, other.get(), &other);\n  reset(other.release());\n  return *this;\n}\n\ntemplate<typename T, typename Alloc>\ninline alias_ref<T> basic_strong_ref<T, Alloc>::releaseAlias() noexcept {\n  return wrap_alias(release());\n}\n\ntemplate<typename T, typename Alloc>\ninline basic_strong_ref<T, Alloc>::operator bool() const noexcept {\n  return get() != nullptr;\n}\n\ntemplate<typename T, typename Alloc>\ninline auto basic_strong_ref<T, Alloc>::operator->() noexcept -> Repr* {\n  return &storage_.get();\n}\n\ntemplate<typename T, typename Alloc>\ninline auto basic_strong_ref<T, Alloc>::operator->() const noexcept -> const Repr* {\n  return &storage_.get();\n}\n\ntemplate<typename T, typename Alloc>\ninline auto basic_strong_ref<T, Alloc>::operator*() noexcept -> Repr& {\n  return storage_.get();\n}\n\ntemplate<typename T, typename Alloc>\ninline auto basic_strong_ref<T, Alloc>::operator*() const noexcept -> const Repr& {\n  return storage_.get();\n}\n\ntemplate<typename T, typename Alloc>\ninline void swap(\n    basic_strong_ref<T, Alloc>& a,\n    basic_strong_ref<T, Alloc>& b) noexcept {\n  internal::dbglog(\"Ref swap a.ref=%p a=%p b.ref=%p b=%p\",\n      a.get(), &a, b.get(), &b);\n  using std::swap;\n  a.storage_.swap(b.storage_);\n}\n\n\n// alias_ref //////////////////////////////////////////////////////////////////////////////\n\ntemplate<typename T>\ninline alias_ref<T>::alias_ref() noexcept\n  : storage_{nullptr}\n{}\n\ntemplate<typename T>\ninline alias_ref<T>::alias_ref(std::nullptr_t) noexcept\n  : storage_{nullptr}\n{}\n\ntemplate<typename T>\ninline alias_ref<T>::alias_ref(const alias_ref& other) noexcept\n  : storage_{other.get()}\n{}\n\ntemplate<typename T>\ninline alias_ref<T>::alias_ref(javaobject ref) noexcept\n  : storage_(ref) {\n  assert(\n      LocalReferenceAllocator{}.verifyReference(ref) ||\n      GlobalReferenceAllocator{}.verifyReference(ref));\n}\n\ntemplate<typename T>\ntemplate<typename TOther, typename /* for SFINAE */>\ninline alias_ref<T>::alias_ref(alias_ref<TOther> other) noexcept\n  : storage_{other.get()}\n{}\n\ntemplate<typename T>\ntemplate<typename TOther, typename AOther, typename /* for SFINAE */>\ninline alias_ref<T>::alias_ref(const basic_strong_ref<TOther, AOther>& other) noexcept\n  : storage_{other.get()}\n{}\n\ntemplate<typename T>\ninline alias_ref<T>& alias_ref<T>::operator=(alias_ref other) noexcept {\n  swap(*this, other);\n  return *this;\n}\n\ntemplate<typename T>\ninline alias_ref<T>::operator bool() const noexcept {\n  return get() != nullptr;\n}\n\ntemplate<typename T>\ninline auto facebook::jni::alias_ref<T>::get() const noexcept -> javaobject {\n  return storage_.jobj();\n}\n\ntemplate<typename T>\ninline auto alias_ref<T>::operator->() noexcept -> Repr* {\n  return &(**this);\n}\n\ntemplate<typename T>\ninline auto alias_ref<T>::operator->() const noexcept -> const Repr* {\n  return &(**this);\n}\n\ntemplate<typename T>\ninline auto alias_ref<T>::operator*() noexcept -> Repr& {\n  return storage_.get();\n}\n\ntemplate<typename T>\ninline auto alias_ref<T>::operator*() const noexcept -> const Repr& {\n  return storage_.get();\n}\n\ntemplate<typename T>\ninline void alias_ref<T>::set(javaobject ref) noexcept {\n  storage_.set(ref);\n}\n\ntemplate<typename T>\ninline void swap(alias_ref<T>& a, alias_ref<T>& b) noexcept {\n  a.storage_.swap(b.storage_);\n}\n\n// Could reduce code duplication by using a pointer-to-function\n// template argument.  I'm not sure whether that would make the code\n// more maintainable (DRY), or less (too clever/confusing.).\ntemplate<typename T, typename U>\nenable_if_t<IsPlainJniReference<T>(), local_ref<T>>\nstatic_ref_cast(const local_ref<U>& ref) noexcept\n{\n  T p = static_cast<T>(ref.get());\n  return make_local(p);\n}\n\ntemplate<typename T, typename U>\nenable_if_t<IsPlainJniReference<T>(), global_ref<T>>\nstatic_ref_cast(const global_ref<U>& ref) noexcept\n{\n  T p = static_cast<T>(ref.get());\n  return make_global(p);\n}\n\ntemplate<typename T, typename U>\nenable_if_t<IsPlainJniReference<T>(), alias_ref<T>>\nstatic_ref_cast(const alias_ref<U>& ref) noexcept\n{\n  T p = static_cast<T>(ref.get());\n  return wrap_alias(p);\n}\n\ntemplate<typename T, typename RefType>\nauto dynamic_ref_cast(const RefType& ref) ->\nenable_if_t<IsPlainJniReference<T>(), decltype(static_ref_cast<T>(ref))>\n{\n  if (!ref) {\n    return decltype(static_ref_cast<T>(ref))();\n  }\n\n  static alias_ref<jclass> target_class = findClassStatic(jtype_traits<T>::base_name().c_str());\n  if (!target_class) {\n    throwNewJavaException(\"java/lang/ClassCastException\",\n                          \"Could not find class %s.\",\n                          jtype_traits<T>::base_name().c_str());\n\n  }\n\n  local_ref<jclass> source_class = ref->getClass();\n\n  if (!target_class->isAssignableFrom(source_class)) {\n    throwNewJavaException(\"java/lang/ClassCastException\",\n                          \"Tried to cast from %s to %s.\",\n                          source_class->toString().c_str(),\n                          jtype_traits<T>::base_name().c_str());\n  }\n\n  return static_ref_cast<T>(ref);\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/References.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n\n/** @file References.h\n *\n * Functionality similar to smart pointers, but for references into the VM. Four main reference\n * types are provided: local_ref, global_ref, weak_ref, and alias_ref. All are generic\n * templates that and refer to objects in the jobject hierarchy. The type of the referred objects\n * are specified using the template parameter. All reference types except alias_ref own their\n * underlying reference, just as a std smart pointer owns the underlying raw pointer. In the context\n * of std smart pointers, these references behave like unique_ptr, and have basically the same\n * interface. Thus, when the reference is destructed, the plain JNI reference, i.e. the underlying\n * JNI reference (like the parameters passed directly to JNI functions), is released. The alias\n * references provides no ownership and is a simple wrapper for plain JNI references.\n *\n * All but the weak references provides access to the underlying object using dereferencing, and a\n * get() method. It is also possible to convert these references to booleans to test for nullity.\n * To access the underlying object of a weak reference, the reference must either be released, or\n * the weak reference can be used to create a local or global reference.\n *\n * An owning reference is created either by moving the reference from an existing owned reference,\n * by copying an existing owned reference (which creates a new underlying reference), by using the\n * default constructor which initialize the reference to nullptr, or by using a helper function. The\n * helper function exist in two flavors: make_XXX or adopt_XXX.\n *\n * Adopting takes a plain JNI reference and wrap it in an owned reference. It takes ownership of the\n * plain JNI reference so be sure that no one else owns the reference when you adopt it, and make\n * sure that you know what kind of reference it is.\n *\n * New owned references can be created from existing plain JNI references, alias references, local\n * references, and global references (i.e. non-weak references) using the make_local, make_global,\n * and make_weak functions.\n *\n * Alias references can be implicitly initialized using global, local and plain JNI references using\n * the wrap_alias function. Here, we don't assume ownership of the passed-in reference, but rather\n * create a separate reference that we do own, leaving the passed-in reference to its fate.\n *\n * Similar rules apply for assignment. An owned reference can be copy or move assigned using a smart\n * reference of the same type. In the case of copy assignment a new reference is created. Alias\n * reference can also be assigned new values, but since they are simple wrappers of plain JNI\n * references there is no move semantics involved.\n *\n * Alias references are special in that they do not own the object and can therefore safely be\n * converted to and from its corresponding plain JNI reference. They are useful as parameters of\n * functions that do not affect the lifetime of a reference. Usage can be compared with using plain\n * JNI pointers as parameters where a function does not take ownership of the underlying object.\n *\n * The local, global, and alias references makes it possible to access methods in the underlying\n * objects. A core set of classes are implemented in CoreClasses.h, and user defined wrappers are\n * supported (see example below). The wrappers also supports inheritance so a wrapper can inherit\n * from another wrapper to gain access to its functionality. As an example the jstring wrapper\n * inherits from the jobject wrapper, so does the jclass wrapper. That means that you can for\n * example call the toString() method using the jclass wrapper, or any other class that inherits\n * from the jobject wrapper.\n *\n * Note that the wrappers are parameterized on the static type of your (jobject) pointer, thus if\n * you have a jobject that refers to a Java String you will need to cast it to jstring to get the\n * jstring wrapper. This also mean that if you make a down cast that is invalid there will be no one\n * stopping you and the wrappers currently does not detect this which can cause crashes. Thus, cast\n * wisely.\n *\n * @include WrapperSample.cpp\n */\n\n#pragma once\n\n#include <cassert>\n#include <cstddef>\n#include <type_traits>\n\n#include <jni.h>\n\n#include <fb/visibility.h>\n\n#include \"ReferenceAllocators.h\"\n#include \"TypeTraits.h\"\n#include \"References-forward.h\"\n\nnamespace facebook {\nnamespace jni {\n\n/// Convenience function to wrap an existing local reference\ntemplate<typename T>\nlocal_ref<T> adopt_local(T ref) noexcept;\n\n/// Convenience function to wrap an existing global reference\ntemplate<typename T>\nglobal_ref<T> adopt_global(T ref) noexcept;\n\n/// Convenience function to wrap an existing weak reference\ntemplate<typename T>\nweak_ref<T> adopt_weak_global(T ref) noexcept;\n\n\n/// Swaps two owning references of the same type\ntemplate<typename T>\nvoid swap(weak_ref<T>& a, weak_ref<T>& b) noexcept;\n\n/// Swaps two owning references of the same type\ntemplate<typename T, typename Alloc>\nvoid swap(basic_strong_ref<T, Alloc>& a, basic_strong_ref<T, Alloc>& b) noexcept;\n\n/**\n * Retrieve the plain reference from a plain reference.\n */\ntemplate<typename T>\nenable_if_t<IsPlainJniReference<T>(), T> getPlainJniReference(T ref);\n\n/**\n * Retrieve the plain reference from an alias reference.\n */\ntemplate<typename T>\nJniType<T> getPlainJniReference(alias_ref<T> ref);\n\n/**\n * Retrieve the plain JNI reference from any reference owned reference.\n */\ntemplate<typename T, typename Alloc>\nJniType<T> getPlainJniReference(const base_owned_ref<T, Alloc>& ref);\n\nclass JObject;\nclass JClass;\n\nnamespace detail {\n\ntemplate <typename T, typename Enable = void>\nstruct HasJniRefRepr : std::false_type {};\n\ntemplate <typename T>\nstruct HasJniRefRepr<T, typename std::enable_if<!std::is_same<typename T::JniRefRepr, void>::value, void>::type> : std::true_type {\n  using type = typename T::JniRefRepr;\n};\n\ntemplate <typename T>\nstruct RefReprType<T*> {\n  using type = typename std::conditional<HasJniRefRepr<T>::value, typename HasJniRefRepr<T>::type, JObjectWrapper<T*>>::type;\n  static_assert(std::is_base_of<JObject, type>::value,\n      \"Repr type missing JObject base.\");\n  static_assert(std::is_same<type, typename RefReprType<type>::type>::value,\n      \"RefReprType<T> not idempotent\");\n};\n\ntemplate <typename T>\nstruct RefReprType<T, typename std::enable_if<std::is_base_of<JObject, T>::value, void>::type> {\n  using type = T;\n  static_assert(std::is_base_of<JObject, type>::value,\n      \"Repr type missing JObject base.\");\n  static_assert(std::is_same<type, typename RefReprType<type>::type>::value,\n      \"RefReprType<T> not idempotent\");\n};\n\ntemplate <typename T>\nstruct JavaObjectType {\n  using type = typename RefReprType<T>::type::javaobject;\n  static_assert(IsPlainJniReference<type>(),\n      \"JavaObjectType<T> not a plain jni reference\");\n  static_assert(std::is_same<type, typename JavaObjectType<type>::type>::value,\n      \"JavaObjectType<T> not idempotent\");\n};\n\ntemplate <typename T>\nstruct JavaObjectType<JObjectWrapper<T>> {\n  using type = T;\n  static_assert(IsPlainJniReference<type>(),\n      \"JavaObjectType<T> not a plain jni reference\");\n  static_assert(std::is_same<type, typename JavaObjectType<type>::type>::value,\n      \"JavaObjectType<T> not idempotent\");\n};\n\ntemplate <typename T>\nstruct JavaObjectType<T*> {\n  using type = T*;\n  static_assert(IsPlainJniReference<type>(),\n      \"JavaObjectType<T> not a plain jni reference\");\n  static_assert(std::is_same<type, typename JavaObjectType<type>::type>::value,\n      \"JavaObjectType<T> not idempotent\");\n};\n\ntemplate <typename Repr>\nstruct ReprStorage {\n  explicit ReprStorage(JniType<Repr> obj) noexcept;\n\n  void set(JniType<Repr> obj) noexcept;\n\n  Repr& get() noexcept;\n  const Repr& get() const noexcept;\n  JniType<Repr> jobj() const noexcept;\n\n  void swap(ReprStorage& other) noexcept;\n private:\n  ReprStorage() = delete;\n  ReprStorage(const ReprStorage&) = delete;\n  ReprStorage(ReprStorage&&) = delete;\n  ReprStorage& operator=(const ReprStorage&) = delete;\n  ReprStorage& operator=(ReprStorage&&) = delete;\n\n  using Storage = typename std::aligned_storage<sizeof(JObjectBase), alignof(JObjectBase)>::type;\n  Storage storage_;\n};\n\n} // namespace detail\n\n/**\n * Create a new local reference from an existing reference\n *\n * @param ref a plain JNI, alias, or strong reference\n * @return an owned local reference (referring to null if the input does)\n * @throws std::bad_alloc if the JNI reference could not be created\n */\ntemplate<typename T>\nenable_if_t<IsNonWeakReference<T>(), local_ref<plain_jni_reference_t<T>>>\nmake_local(const T& r);\n\n/**\n * Create a new global reference from an existing reference\n *\n * @param ref a plain JNI, alias, or strong reference\n * @return an owned global reference (referring to null if the input does)\n * @throws std::bad_alloc if the JNI reference could not be created\n */\ntemplate<typename T>\nenable_if_t<IsNonWeakReference<T>(), global_ref<plain_jni_reference_t<T>>>\nmake_global(const T& r);\n\n/**\n * Create a new weak global reference from an existing reference\n *\n * @param ref a plain JNI, alias, or strong reference\n * @return an owned weak global reference (referring to null if the input does)\n * @throws std::bad_alloc if the returned reference is null\n */\ntemplate<typename T>\nenable_if_t<IsNonWeakReference<T>(), weak_ref<plain_jni_reference_t<T>>>\nmake_weak(const T& r);\n\n/**\n * Compare two references to see if they refer to the same object\n */\ntemplate<typename T1, typename T2>\nenable_if_t<IsNonWeakReference<T1>() && IsNonWeakReference<T2>(), bool>\noperator==(const T1& a, const T2& b);\n\n/**\n * Compare two references to see if they don't refer to the same object\n */\ntemplate<typename T1, typename T2>\nenable_if_t<IsNonWeakReference<T1>() && IsNonWeakReference<T2>(), bool>\noperator!=(const T1& a, const T2& b);\n\ntemplate<typename T, typename Alloc>\nclass base_owned_ref {\n public:\n  using javaobject = JniType<T>;\n\n  /**\n   * Release the ownership and set the reference to null. Thus no deleter is invoked.\n   * @return Returns the reference\n   */\n  javaobject release() noexcept;\n\n  /**\n   * Reset the reference to refer to nullptr.\n   */\n  void reset() noexcept;\n\n protected:\n  using Repr = ReprType<T>;\n  detail::ReprStorage<Repr> storage_;\n\n  javaobject get() const noexcept;\n  void set(javaobject ref) noexcept;\n\n  /*\n   * Wrap an existing reference and transfers its ownership to the newly created unique reference.\n   * NB! Does not create a new reference\n   */\n  explicit base_owned_ref(javaobject reference) noexcept;\n\n  /// Create a null reference\n  base_owned_ref() noexcept;\n\n  /// Create a null reference\n  explicit base_owned_ref(std::nullptr_t) noexcept;\n\n  /// Copy constructor (note creates a new reference)\n  base_owned_ref(const base_owned_ref& other);\n  template<typename U>\n  base_owned_ref(const base_owned_ref<U, Alloc>& other);\n\n  /// Transfers ownership of an underlying reference from one unique reference to another\n  base_owned_ref(base_owned_ref&& other) noexcept;\n  template<typename U>\n  base_owned_ref(base_owned_ref<U, Alloc>&& other) noexcept;\n\n  /// The delete the underlying reference if applicable\n  ~base_owned_ref() noexcept;\n\n\n  /// Assignment operator (note creates a new reference)\n  base_owned_ref& operator=(const base_owned_ref& other);\n\n  /// Assignment by moving a reference thus not creating a new reference\n  base_owned_ref& operator=(base_owned_ref&& rhs) noexcept;\n\n  void reset(javaobject reference) noexcept;\n\n  friend javaobject jni::getPlainJniReference<>(const base_owned_ref& ref);\n\n  template<typename U, typename UAlloc>\n  friend class base_owned_ref;\n};\n\n\n/**\n * A smart reference that owns its underlying JNI reference. The class provides basic\n * functionality to handle a reference but gives no access to it unless the reference is\n * released, thus no longer owned. The API is stolen with pride from unique_ptr and the\n * semantics should be basically the same. This class should not be used directly, instead use\n * @ref weak_ref\n */\ntemplate<typename T>\nclass weak_ref : public base_owned_ref<T, WeakGlobalReferenceAllocator> {\n public:\n  using javaobject = JniType<T>;\n\n  using Allocator = WeakGlobalReferenceAllocator;\n\n  // This inherits non-default, non-copy, non-move ctors.\n  using base_owned_ref<T, Allocator>::base_owned_ref;\n\n  /// Create a null reference\n  weak_ref() noexcept\n    : base_owned_ref<T, Allocator>{} {}\n\n  /// Create a null reference\n  /* implicit */ weak_ref(std::nullptr_t) noexcept\n    : base_owned_ref<T, Allocator>{nullptr} {}\n\n  /// Copy constructor (note creates a new reference)\n  weak_ref(const weak_ref& other)\n    : base_owned_ref<T, Allocator>{other} {}\n\n  // This needs to be explicit to change its visibility.\n  template<typename U>\n  weak_ref(const weak_ref<U>& other)\n    : base_owned_ref<T, Allocator>{other} {}\n\n  /// Transfers ownership of an underlying reference from one unique reference to another\n  weak_ref(weak_ref&& other) noexcept\n    : base_owned_ref<T, Allocator>{std::move(other)} {}\n\n\n  /// Assignment operator (note creates a new reference)\n  weak_ref& operator=(const weak_ref& other);\n\n  /// Assignment by moving a reference thus not creating a new reference\n  weak_ref& operator=(weak_ref&& rhs) noexcept;\n\n  // Creates an owned local reference to the referred object or to null if the object is reclaimed\n  local_ref<T> lockLocal() const;\n\n  // Creates an owned global reference to the referred object or to null if the object is reclaimed\n  global_ref<T> lockGlobal() const;\n\n private:\n  // get/release/reset on weak_ref are not exposed to users.\n  using base_owned_ref<T, Allocator>::get;\n  using base_owned_ref<T, Allocator>::release;\n  using base_owned_ref<T, Allocator>::reset;\n  /*\n   * Wrap an existing reference and transfers its ownership to the newly created unique reference.\n   * NB! Does not create a new reference\n   */\n  explicit weak_ref(javaobject reference) noexcept\n    : base_owned_ref<T, Allocator>{reference} {}\n\n  template<typename T2> friend class weak_ref;\n  friend weak_ref<javaobject> adopt_weak_global<javaobject>(javaobject ref) noexcept;\n  friend void swap<T>(weak_ref& a, weak_ref& b) noexcept;\n};\n\n\n/**\n * A class representing owned strong references to Java objects. This class\n * should not be used directly, instead use @ref local_ref, or @ref global_ref.\n */\ntemplate<typename T, typename Alloc>\nclass basic_strong_ref : public base_owned_ref<T, Alloc> {\n  using typename base_owned_ref<T, Alloc>::Repr;\n public:\n  using javaobject = JniType<T>;\n\n  using Allocator = Alloc;\n\n  // This inherits non-default, non-copy, non-move ctors.\n  using base_owned_ref<T, Alloc>::base_owned_ref;\n  using base_owned_ref<T, Alloc>::release;\n  using base_owned_ref<T, Alloc>::reset;\n\n  /// Create a null reference\n  basic_strong_ref() noexcept\n    : base_owned_ref<T, Alloc>{} {}\n\n  /// Create a null reference\n  /* implicit */ basic_strong_ref(std::nullptr_t) noexcept\n    : base_owned_ref<T, Alloc>{nullptr} {}\n\n  /// Copy constructor (note creates a new reference)\n  basic_strong_ref(const basic_strong_ref& other)\n    : base_owned_ref<T, Alloc>{other} {}\n\n  // This needs to be explicit to change its visibility.\n  template<typename U>\n  basic_strong_ref(const basic_strong_ref<U, Alloc>& other)\n    : base_owned_ref<T, Alloc>{other} {}\n\n  /// Transfers ownership of an underlying reference from one unique reference to another\n  basic_strong_ref(basic_strong_ref&& other) noexcept\n    : base_owned_ref<T, Alloc>{std::move(other)} {}\n\n  /// Assignment operator (note creates a new reference)\n  basic_strong_ref& operator=(const basic_strong_ref& other);\n\n  /// Assignment by moving a reference thus not creating a new reference\n  basic_strong_ref& operator=(basic_strong_ref&& rhs) noexcept;\n\n  /// Get the plain JNI reference\n  using base_owned_ref<T, Allocator>::get;\n\n  /// Release the ownership of the reference and return the wrapped reference in an alias\n  alias_ref<T> releaseAlias() noexcept;\n\n  /// Checks if the reference points to a non-null object\n  explicit operator bool() const noexcept;\n\n  /// Access the functionality provided by the object wrappers\n  Repr* operator->() noexcept;\n\n  /// Access the functionality provided by the object wrappers\n  const Repr* operator->() const noexcept;\n\n  /// Provide a reference to the underlying wrapper (be sure that it is non-null before invoking)\n  Repr& operator*() noexcept;\n\n  /// Provide a const reference to the underlying wrapper (be sure that it is non-null\n  /// before invoking)\n  const Repr& operator*() const noexcept;\n\n private:\n\n  using base_owned_ref<T, Alloc>::storage_;\n\n  /*\n   * Wrap an existing reference and transfers its ownership to the newly created unique reference.\n   * NB! Does not create a new reference\n   */\n  explicit basic_strong_ref(javaobject reference) noexcept\n    : base_owned_ref<T, Alloc>{reference} {}\n\n\n  friend local_ref<T> adopt_local<T>(T ref) noexcept;\n  friend global_ref<T> adopt_global<T>(T ref) noexcept;\n  friend void swap<T, Alloc>(basic_strong_ref& a, basic_strong_ref& b) noexcept;\n};\n\n\ntemplate<typename T>\nenable_if_t<IsPlainJniReference<T>(), alias_ref<T>> wrap_alias(T ref) noexcept;\n\n/// Swaps to alias reference of the same type\ntemplate<typename T>\nvoid swap(alias_ref<T>& a, alias_ref<T>& b) noexcept;\n\n/**\n * A non-owning variant of the smart references (a dumb reference). These references still provide\n * access to the functionality of the @ref JObjectWrapper specializations including exception\n * handling and ease of use. Use this representation when you don't want to claim ownership of the\n * underlying reference (compare to using raw pointers instead of smart pointers.) For symmetry use\n * @ref alias_ref instead of this class.\n */\ntemplate<typename T>\nclass alias_ref {\n  using Repr = ReprType<T>;\n\n public:\n  using javaobject = JniType<T>;\n\n  /// Create a null reference\n  alias_ref() noexcept;\n\n  /// Create a null reference\n  /* implicit */ alias_ref(std::nullptr_t) noexcept;\n\n  /// Copy constructor\n  alias_ref(const alias_ref& other) noexcept;\n\n  /// Wrap an existing plain JNI reference\n  /* implicit */ alias_ref(javaobject ref) noexcept;\n\n  /// Wrap an existing smart reference of any type convertible to T\n  template<\n    typename TOther,\n    typename = enable_if_t<\n      IsConvertible<JniType<TOther>, javaobject>(), T>\n    >\n  alias_ref(alias_ref<TOther> other) noexcept;\n\n  /// Wrap an existing alias reference of a type convertible to T\n  template<\n    typename TOther,\n    typename AOther,\n    typename = enable_if_t<\n      IsConvertible<JniType<TOther>, javaobject>(), T>\n    >\n  alias_ref(const basic_strong_ref<TOther, AOther>& other) noexcept;\n\n  /// Assignment operator\n  alias_ref& operator=(alias_ref other) noexcept;\n\n  /// Checks if the reference points to a non-null object\n  explicit operator bool() const noexcept;\n\n  /// Converts back to a plain JNI reference\n  javaobject get() const noexcept;\n\n  /// Access the functionality provided by the object wrappers\n  Repr* operator->() noexcept;\n\n  /// Access the functionality provided by the object wrappers\n  const Repr* operator->() const noexcept;\n\n  /// Provide a guaranteed non-null reference (be sure that it is non-null before invoking)\n  Repr& operator*() noexcept;\n\n  /// Provide a guaranteed non-null reference (be sure that it is non-null before invoking)\n  const Repr& operator*() const noexcept;\n\n private:\n  void set(javaobject ref) noexcept;\n\n  detail::ReprStorage<Repr> storage_;\n\n  friend void swap<T>(alias_ref& a, alias_ref& b) noexcept;\n};\n\n\n/**\n * RAII object to create a local JNI frame, using PushLocalFrame/PopLocalFrame.\n *\n * This is useful when you have a call which is initiated from C++-land, and therefore\n * doesn't automatically get a local JNI frame managed for you by the JNI framework.\n */\nclass FBEXPORT JniLocalScope {\npublic:\n  JniLocalScope(JNIEnv* p_env, jint capacity);\n  ~JniLocalScope();\n\nprivate:\n  JNIEnv* env_;\n  bool hasFrame_;\n};\n\ntemplate<typename T, typename U>\nenable_if_t<IsPlainJniReference<T>(), local_ref<T>>\nstatic_ref_cast(const local_ref<U>& ref) noexcept;\n\ntemplate<typename T, typename U>\nenable_if_t<IsPlainJniReference<T>(), global_ref<T>>\nstatic_ref_cast(const global_ref<U>& ref) noexcept;\n\ntemplate<typename T, typename U>\nenable_if_t<IsPlainJniReference<T>(), alias_ref<T>>\nstatic_ref_cast(const alias_ref<U>& ref) noexcept;\n\ntemplate<typename T, typename RefType>\nauto dynamic_ref_cast(const RefType& ref) ->\nenable_if_t<IsPlainJniReference<T>(), decltype(static_ref_cast<T>(ref))> ;\n\n}}\n\n#include \"References-inl.h\"\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Registration-inl.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include \"Exceptions.h\"\n#include \"Hybrid.h\"\n\nnamespace facebook {\nnamespace jni {\n\nnamespace detail {\n\n#ifdef __i386__\n// X86 ABI forces 16 byte stack allignment on calls. Unfortunately\n// sometimes Dalvik chooses not to obey the ABI:\n// - https://code.google.com/p/android/issues/detail?id=61012\n// - https://android.googlesource.com/platform/ndk/+/81696d2%5E!/\n// Therefore, we tell the compiler to re-align the stack on entry\n// to our JNI functions.\n#define JNI_ENTRY_POINT __attribute__((force_align_arg_pointer))\n#else\n#define JNI_ENTRY_POINT\n#endif\n\ntemplate <typename R>\nstruct CreateDefault {\n  static R create() {\n    return R{};\n  }\n};\n\ntemplate <>\nstruct CreateDefault<void> {\n  static void create() {}\n};\n\ntemplate <typename R>\nusing Converter = Convert<typename std::decay<R>::type>;\n\ntemplate <typename F, F func, typename R, typename... Args>\nstruct WrapForVoidReturn {\n  static typename Converter<R>::jniType call(Args&&... args) {\n    return Converter<R>::toJniRet(func(std::forward<Args>(args)...));\n  }\n};\n\ntemplate <typename F, F func, typename... Args>\nstruct WrapForVoidReturn<F, func, void, Args...> {\n  static void call(Args&&... args) {\n    func(std::forward<Args>(args)...);\n  }\n};\n\n// registration wrapper for legacy JNI-style functions\ntemplate<typename F, F func, typename C, typename R, typename... Args>\nstruct BareJniWrapper {\n  JNI_ENTRY_POINT static R call(JNIEnv* env, jobject obj, Args... args) {\n    ThreadScope ts(env, internal::CacheEnvTag{});\n    try {\n      return (*func)(env, static_cast<JniType<C>>(obj), args...);\n    } catch (...) {\n      translatePendingCppExceptionToJavaException();\n      return CreateDefault<R>::create();\n    }\n  }\n};\n\n// registration wrappers for functions, with autoconversion of arguments.\ntemplate<typename F, F func, typename C, typename R, typename... Args>\nstruct FunctionWrapper {\n  using jniRet = typename Converter<R>::jniType;\n  JNI_ENTRY_POINT static jniRet call(JNIEnv* env, jobject obj, typename Converter<Args>::jniType... args) {\n    ThreadScope ts(env, internal::CacheEnvTag{});\n    try {\n      return WrapForVoidReturn<F, func, R, JniType<C>, Args...>::call(\n          static_cast<JniType<C>>(obj), Converter<Args>::fromJni(args)...);\n    } catch (...) {\n      translatePendingCppExceptionToJavaException();\n      return CreateDefault<jniRet>::create();\n    }\n  }\n};\n\n// registration wrappers for non-static methods, with autoconversion of arguments.\ntemplate<typename M, M method, typename C, typename R, typename... Args>\nstruct MethodWrapper {\n  using jhybrid = typename C::jhybridobject;\n  static R dispatch(alias_ref<jhybrid> ref, Args&&... args) {\n    try {\n      // This is usually a noop, but if the hybrid object is a\n      // base class of other classes which register JNI methods,\n      // this will get the right type for the registered method.\n      auto cobj = static_cast<C*>(ref->cthis());\n      return (cobj->*method)(std::forward<Args>(args)...);\n    } catch (const std::exception& ex) {\n      C::mapException(ex);\n      throw;\n    }\n  }\n\n  JNI_ENTRY_POINT static typename Converter<R>::jniType call(\n      JNIEnv* env, jobject obj, typename Converter<Args>::jniType... args) {\n    return FunctionWrapper<R(*)(alias_ref<jhybrid>, Args&&...), dispatch, jhybrid, R, Args...>::call(env, obj, args...);\n  }\n};\n\ntemplate<typename F, F func, typename C, typename R, typename... Args>\ninline NativeMethodWrapper* exceptionWrapJNIMethod(R (*)(JNIEnv*, C, Args... args)) {\n  // This intentionally erases the real type; JNI will do it anyway\n  return reinterpret_cast<NativeMethodWrapper*>(&(BareJniWrapper<F, func, C, R, Args...>::call));\n}\n\ntemplate<typename F, F func, typename C, typename R, typename... Args>\ninline NativeMethodWrapper* exceptionWrapJNIMethod(R (*)(alias_ref<C>, Args... args)) {\n  // This intentionally erases the real type; JNI will do it anyway\n  return reinterpret_cast<NativeMethodWrapper*>(&(FunctionWrapper<F, func, C, R, Args...>::call));\n}\n\ntemplate<typename M, M method, typename C, typename R, typename... Args>\ninline NativeMethodWrapper* exceptionWrapJNIMethod(R (C::*method0)(Args... args)) {\n  // This intentionally erases the real type; JNI will do it anyway\n  return reinterpret_cast<NativeMethodWrapper*>(&(MethodWrapper<M, method, C, R, Args...>::call));\n}\n\ntemplate<typename R, typename C, typename... Args>\ninline std::string makeDescriptor(R (*)(JNIEnv*, C, Args... args)) {\n  return jmethod_traits<R(Args...)>::descriptor();\n}\n\ntemplate<typename R, typename C, typename... Args>\ninline std::string makeDescriptor(R (*)(alias_ref<C>, Args... args)) {\n  return jmethod_traits_from_cxx<R(Args...)>::descriptor();\n}\n\ntemplate<typename R, typename C, typename... Args>\ninline std::string makeDescriptor(R (C::*)(Args... args)) {\n  return jmethod_traits_from_cxx<R(Args...)>::descriptor();\n}\n\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/Registration.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <jni.h>\n#include \"References.h\"\n\nnamespace facebook {\nnamespace jni {\n\nnamespace detail {\n\n// This uses the real JNI function as a non-type template parameter to\n// cause a (static member) function to exist with the same signature,\n// but with try/catch exception translation.\ntemplate<typename F, F func, typename C, typename R, typename... Args>\nNativeMethodWrapper* exceptionWrapJNIMethod(R (*func0)(JNIEnv*, jobject, Args... args));\n\n// Automatically wrap object argument, and don't take env explicitly.\ntemplate<typename F, F func, typename C, typename R, typename... Args>\nNativeMethodWrapper* exceptionWrapJNIMethod(R (*func0)(alias_ref<C>, Args... args));\n\n// Extract C++ instance from object, and invoke given method on it,\ntemplate<typename M, M method, typename C, typename R, typename... Args>\nNativeMethodWrapper* exceptionWrapJNIMethod(R (C::*method0)(Args... args));\n\n// This uses deduction to figure out the descriptor name if the types\n// are primitive or have JObjectWrapper specializations.\ntemplate<typename R, typename C, typename... Args>\nstd::string makeDescriptor(R (*func)(JNIEnv*, C, Args... args));\n\n// This uses deduction to figure out the descriptor name if the types\n// are primitive or have JObjectWrapper specializations.\ntemplate<typename R, typename C, typename... Args>\nstd::string makeDescriptor(R (*func)(alias_ref<C>, Args... args));\n\n// This uses deduction to figure out the descriptor name if the types\n// are primitive or have JObjectWrapper specializations.\ntemplate<typename R, typename C, typename... Args>\nstd::string makeDescriptor(R (C::*method0)(Args... args));\n\n}\n\n// We have to use macros here, because the func needs to be used\n// as both a decltype expression argument and as a non-type template\n// parameter, since C++ provides no way for translateException\n// to deduce the type of its non-type template parameter.\n// The empty string in the macros below ensures that name\n// is always a string literal (because that syntax is only\n// valid when name is a string literal).\n#define makeNativeMethod2(name, func)                                   \\\n  { name \"\", ::facebook::jni::detail::makeDescriptor(&func),            \\\n      ::facebook::jni::detail::exceptionWrapJNIMethod<decltype(&func), &func>(&func) }\n\n#define makeNativeMethod3(name, desc, func)                             \\\n  { name \"\", desc,                                                      \\\n      ::facebook::jni::detail::exceptionWrapJNIMethod<decltype(&func), &func>(&func) }\n\n// Variadic template hacks to get macros with different numbers of\n// arguments. Usage instructions are in CoreClasses.h.\n#define makeNativeMethodN(a, b, c, count, ...) makeNativeMethod ## count\n#define makeNativeMethod(...) makeNativeMethodN(__VA_ARGS__, 3, 2)(__VA_ARGS__)\n\n}}\n\n#include \"Registration-inl.h\"\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni/TypeTraits.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <type_traits>\n\n#include \"References-forward.h\"\n\nnamespace facebook {\nnamespace jni {\n\n/// Generic std::enable_if helper\ntemplate<bool B, typename T>\nusing enable_if_t = typename std::enable_if<B, T>::type;\n\n/// Generic std::is_convertible helper\ntemplate<typename From, typename To>\nconstexpr bool IsConvertible() {\n  return std::is_convertible<From, To>::value;\n}\n\ntemplate<template<typename...> class TT, typename T>\nstruct is_instantiation_of : std::false_type {};\n\ntemplate<template<typename...> class TT, typename... Ts>\nstruct is_instantiation_of<TT, TT<Ts...>> : std::true_type {};\n\ntemplate<template<typename...> class TT, typename... Ts>\nconstexpr bool IsInstantiationOf() {\n  return is_instantiation_of<TT, Ts...>::value;\n}\n\n/// Metafunction to determine whether a type is a JNI reference or not\ntemplate<typename T>\nstruct is_plain_jni_reference :\n  std::integral_constant<bool,\n      std::is_pointer<T>::value &&\n      std::is_base_of<\n        typename std::remove_pointer<jobject>::type,\n        typename std::remove_pointer<T>::type>::value> {};\n\n/// Helper to simplify use of is_plain_jni_reference\ntemplate<typename T>\nconstexpr bool IsPlainJniReference() {\n  return is_plain_jni_reference<T>::value;\n}\n\n/// Metafunction to determine whether a type is a primitive JNI type or not\ntemplate<typename T>\nstruct is_jni_primitive :\n  std::integral_constant<bool,\n    std::is_same<jboolean, T>::value ||\n    std::is_same<jbyte, T>::value ||\n    std::is_same<jchar, T>::value ||\n    std::is_same<jshort, T>::value ||\n    std::is_same<jint, T>::value ||\n    std::is_same<jlong, T>::value ||\n    std::is_same<jfloat, T>::value ||\n    std::is_same<jdouble, T>::value> {};\n\n/// Helper to simplify use of is_jni_primitive\ntemplate<typename T>\nconstexpr bool IsJniPrimitive() {\n  return is_jni_primitive<T>::value;\n}\n\n/// Metafunction to determine whether a type is a JNI array of primitives or not\ntemplate <typename T>\nstruct is_jni_primitive_array :\n  std::integral_constant<bool,\n    std::is_same<jbooleanArray, T>::value ||\n    std::is_same<jbyteArray, T>::value ||\n    std::is_same<jcharArray, T>::value ||\n    std::is_same<jshortArray, T>::value ||\n    std::is_same<jintArray, T>::value ||\n    std::is_same<jlongArray, T>::value ||\n    std::is_same<jfloatArray, T>::value ||\n    std::is_same<jdoubleArray, T>::value> {};\n\n/// Helper to simplify use of is_jni_primitive_array\ntemplate <typename T>\nconstexpr bool IsJniPrimitiveArray() {\n  return is_jni_primitive_array<T>::value;\n}\n\n/// Metafunction to determine if a type is a scalar (primitive or reference) JNI type\ntemplate<typename T>\nstruct is_jni_scalar :\n  std::integral_constant<bool,\n    is_plain_jni_reference<T>::value ||\n    is_jni_primitive<T>::value> {};\n\n/// Helper to simplify use of is_jni_scalar\ntemplate<typename T>\nconstexpr bool IsJniScalar() {\n  return is_jni_scalar<T>::value;\n}\n\n// Metafunction to determine if a type is a JNI type\ntemplate<typename T>\nstruct is_jni_type :\n  std::integral_constant<bool,\n    is_jni_scalar<T>::value ||\n    std::is_void<T>::value> {};\n\n/// Helper to simplify use of is_jni_type\ntemplate<typename T>\nconstexpr bool IsJniType() {\n  return is_jni_type<T>::value;\n}\n\ntemplate<typename T>\nstruct is_non_weak_reference :\n  std::integral_constant<bool,\n    IsPlainJniReference<T>() ||\n    IsInstantiationOf<basic_strong_ref, T>() ||\n    IsInstantiationOf<alias_ref, T>()> {};\n\ntemplate<typename T>\nconstexpr bool IsNonWeakReference() {\n  return is_non_weak_reference<T>::value;\n}\n\ntemplate<typename T>\nstruct is_any_reference :\n  std::integral_constant<bool,\n    IsPlainJniReference<T>() ||\n    IsInstantiationOf<weak_ref, T>() ||\n    IsInstantiationOf<basic_strong_ref, T>() ||\n    IsInstantiationOf<alias_ref, T>()> {};\n\ntemplate<typename T>\nconstexpr bool IsAnyReference() {\n  return is_any_reference<T>::value;\n}\n\ntemplate<typename T>\nstruct reference_traits {\n  using plain_jni_reference_t = JniType<T>;\n  static_assert(IsPlainJniReference<plain_jni_reference_t>(), \"Need a plain JNI reference\");\n};\n\ntemplate<template <typename...> class R, typename T, typename... A>\nstruct reference_traits<R<T, A...>> {\n  using plain_jni_reference_t = JniType<T>;\n  static_assert(IsPlainJniReference<plain_jni_reference_t>(), \"Need a plain JNI reference\");\n};\n\ntemplate<typename T>\nusing plain_jni_reference_t = typename reference_traits<T>::plain_jni_reference_t;\n\n} // namespace jni\n} // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/fbjni.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <jni.h>\n\n#include <fb/Environment.h>\n#include <fb/ALog.h>\n#include <fb/fbjni/Common.h>\n#include <fb/fbjni/Exceptions.h>\n#include <fb/fbjni/ReferenceAllocators.h>\n#include <fb/fbjni/References.h>\n#include <fb/fbjni/Meta.h>\n#include <fb/fbjni/CoreClasses.h>\n#include <fb/fbjni/Iterator.h>\n#include <fb/fbjni/Hybrid.h>\n#include <fb/fbjni/Registration.h>\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/log.h",
    "content": "/*\n * Copyright (C) 2005 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * FB Wrapper for logging functions.\n *\n * The android logging API uses the macro \"LOG()\" for its logic, which means\n * that it conflicts with random other places that use LOG for their own\n * purposes and doesn't work right half the places you include it\n *\n * FBLOG uses exactly the same semantics (FBLOGD for debug etc) but because of\n * the FB prefix it's strictly better. FBLOGV also gets stripped out based on\n * whether NDEBUG is set, but can be overridden by FBLOG_NDEBUG\n *\n * Most of the rest is a copy of <cutils/log.h> with minor changes.\n */\n\n//\n// C/C++ logging functions.  See the logging documentation for API details.\n//\n// We'd like these to be available from C code (in case we import some from\n// somewhere), so this has a C interface.\n//\n// The output will be correct when the log file is shared between multiple\n// threads and/or multiple processes so long as the operating system\n// supports O_APPEND.  These calls have mutex-protected data structures\n// and so are NOT reentrant.  Do not use LOG in a signal handler.\n//\n#pragma once\n\n#include <fb/visibility.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifdef ANDROID\n#include <android/log.h>\n#else\n// These declarations are needed for our internal use even on non-Android\n// builds.\n// (they are borrowed from <android/log.h>)\n\n/*\n * Android log priority values, in ascending priority order.\n */\ntypedef enum android_LogPriority {\n  ANDROID_LOG_UNKNOWN = 0,\n  ANDROID_LOG_DEFAULT, /* only for SetMinPriority() */\n  ANDROID_LOG_VERBOSE,\n  ANDROID_LOG_DEBUG,\n  ANDROID_LOG_INFO,\n  ANDROID_LOG_WARN,\n  ANDROID_LOG_ERROR,\n  ANDROID_LOG_FATAL,\n  ANDROID_LOG_SILENT, /* only for SetMinPriority(); must be last */\n} android_LogPriority;\n\n/*\n * Send a simple string to the log.\n */\nint __android_log_write(int prio, const char *tag, const char *text);\n\n/*\n * Send a formatted string to the log, used like printf(fmt,...)\n */\nint __android_log_print(int prio, const char *tag, const char *fmt, ...)\n#if defined(__GNUC__)\n    __attribute__((format(printf, 3, 4)))\n#endif\n    ;\n\n#endif\n\n// ---------------------------------------------------------------------\n\n/*\n * Normally we strip FBLOGV (VERBOSE messages) from release builds.\n * You can modify this (for example with \"#define FBLOG_NDEBUG 0\"\n * at the top of your source file) to change that behavior.\n */\n#ifndef FBLOG_NDEBUG\n#ifdef NDEBUG\n#define FBLOG_NDEBUG 1\n#else\n#define FBLOG_NDEBUG 0\n#endif\n#endif\n\n/*\n * This is the local tag used for the following simplified\n * logging macros.  You can change this preprocessor definition\n * before using the other macros to change the tag.\n */\n#ifndef LOG_TAG\n#define LOG_TAG NULL\n#endif\n\n// ---------------------------------------------------------------------\n\n/*\n * Simplified macro to send a verbose log message using the current LOG_TAG.\n */\n#ifndef FBLOGV\n#if FBLOG_NDEBUG\n#define FBLOGV(...) ((void)0)\n#else\n#define FBLOGV(...) ((void)FBLOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))\n#endif\n#endif\n\n#define CONDITION(cond) (__builtin_expect((cond) != 0, 0))\n\n#ifndef FBLOGV_IF\n#if FBLOG_NDEBUG\n#define FBLOGV_IF(cond, ...) ((void)0)\n#else\n#define FBLOGV_IF(cond, ...)                                            \\\n  ((CONDITION(cond)) ? ((void)FBLOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \\\n                     : (void)0)\n#endif\n#endif\n\n/*\n * Simplified macro to send a debug log message using the current LOG_TAG.\n */\n#ifndef FBLOGD\n#define FBLOGD(...) ((void)FBLOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))\n#endif\n\n#ifndef FBLOGD_IF\n#define FBLOGD_IF(cond, ...) \\\n  ((CONDITION(cond)) ? ((void)FBLOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) : (void)0)\n#endif\n\n/*\n * Simplified macro to send an info log message using the current LOG_TAG.\n */\n#ifndef FBLOGI\n#define FBLOGI(...) ((void)FBLOG(LOG_INFO, LOG_TAG, __VA_ARGS__))\n#endif\n\n#ifndef FBLOGI_IF\n#define FBLOGI_IF(cond, ...) \\\n  ((CONDITION(cond)) ? ((void)FBLOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) : (void)0)\n#endif\n\n/*\n * Simplified macro to send a warning log message using the current LOG_TAG.\n */\n#ifndef FBLOGW\n#define FBLOGW(...) ((void)FBLOG(LOG_WARN, LOG_TAG, __VA_ARGS__))\n#endif\n\n#ifndef FBLOGW_IF\n#define FBLOGW_IF(cond, ...) \\\n  ((CONDITION(cond)) ? ((void)FBLOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) : (void)0)\n#endif\n\n/*\n * Simplified macro to send an error log message using the current LOG_TAG.\n */\n#ifndef FBLOGE\n#define FBLOGE(...) ((void)FBLOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))\n#endif\n\n#ifndef FBLOGE_IF\n#define FBLOGE_IF(cond, ...) \\\n  ((CONDITION(cond)) ? ((void)FBLOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) : (void)0)\n#endif\n\n// ---------------------------------------------------------------------\n\n/*\n * Conditional based on whether the current LOG_TAG is enabled at\n * verbose priority.\n */\n#ifndef IF_FBLOGV\n#if FBLOG_NDEBUG\n#define IF_FBLOGV() if (false)\n#else\n#define IF_FBLOGV() IF_FBLOG(LOG_VERBOSE, LOG_TAG)\n#endif\n#endif\n\n/*\n * Conditional based on whether the current LOG_TAG is enabled at\n * debug priority.\n */\n#ifndef IF_FBLOGD\n#define IF_FBLOGD() IF_FBLOG(LOG_DEBUG, LOG_TAG)\n#endif\n\n/*\n * Conditional based on whether the current LOG_TAG is enabled at\n * info priority.\n */\n#ifndef IF_FBLOGI\n#define IF_FBLOGI() IF_FBLOG(LOG_INFO, LOG_TAG)\n#endif\n\n/*\n * Conditional based on whether the current LOG_TAG is enabled at\n * warn priority.\n */\n#ifndef IF_FBLOGW\n#define IF_FBLOGW() IF_FBLOG(LOG_WARN, LOG_TAG)\n#endif\n\n/*\n * Conditional based on whether the current LOG_TAG is enabled at\n * error priority.\n */\n#ifndef IF_FBLOGE\n#define IF_FBLOGE() IF_FBLOG(LOG_ERROR, LOG_TAG)\n#endif\n\n// ---------------------------------------------------------------------\n\n/*\n * Log a fatal error.  If the given condition fails, this stops program\n * execution like a normal assertion, but also generating the given message.\n * It is NOT stripped from release builds.  Note that the condition test\n * is -inverted- from the normal assert() semantics.\n */\n#define FBLOG_ALWAYS_FATAL_IF(cond, ...)                                   \\\n  ((CONDITION(cond)) ? ((void)fb_printAssert(#cond, LOG_TAG, __VA_ARGS__)) \\\n                     : (void)0)\n\n#define FBLOG_ALWAYS_FATAL(...) \\\n  (((void)fb_printAssert(NULL, LOG_TAG, __VA_ARGS__)))\n\n/*\n * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that\n * are stripped out of release builds.\n */\n#if FBLOG_NDEBUG\n\n#define FBLOG_FATAL_IF(cond, ...) ((void)0)\n#define FBLOG_FATAL(...) ((void)0)\n\n#else\n\n#define FBLOG_FATAL_IF(cond, ...) FBLOG_ALWAYS_FATAL_IF(cond, __VA_ARGS__)\n#define FBLOG_FATAL(...) FBLOG_ALWAYS_FATAL(__VA_ARGS__)\n\n#endif\n\n/*\n * Assertion that generates a log message when the assertion fails.\n * Stripped out of release builds.  Uses the current LOG_TAG.\n */\n#define FBLOG_ASSERT(cond, ...) FBLOG_FATAL_IF(!(cond), __VA_ARGS__)\n//#define LOG_ASSERT(cond) LOG_FATAL_IF(!(cond), \"Assertion failed: \" #cond)\n\n// ---------------------------------------------------------------------\n\n/*\n * Basic log message macro.\n *\n * Example:\n *  FBLOG(LOG_WARN, NULL, \"Failed with error %d\", errno);\n *\n * The second argument may be NULL or \"\" to indicate the \"global\" tag.\n */\n#ifndef FBLOG\n#define FBLOG(priority, tag, ...) \\\n  FBLOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)\n#endif\n\n#ifndef FBLOG_BY_DELIMS\n#define FBLOG_BY_DELIMS(priority, tag, delims, msg, ...) \\\n  logPrintByDelims(ANDROID_##priority, tag, delims, msg, ##__VA_ARGS__)\n#endif\n\n/*\n * Log macro that allows you to specify a number for the priority.\n */\n#ifndef FBLOG_PRI\n#define FBLOG_PRI(priority, tag, ...) fb_printLog(priority, tag, __VA_ARGS__)\n#endif\n\n/*\n * Log macro that allows you to pass in a varargs (\"args\" is a va_list).\n */\n#ifndef FBLOG_PRI_VA\n#define FBLOG_PRI_VA(priority, tag, fmt, args) \\\n  fb_vprintLog(priority, NULL, tag, fmt, args)\n#endif\n\n/*\n * Conditional given a desired logging priority and tag.\n */\n#ifndef IF_FBLOG\n#define IF_FBLOG(priority, tag) if (fb_testLog(ANDROID_##priority, tag))\n#endif\n\ntypedef void (*LogHandler)(int priority, const char* tag, const char* message);\nFBEXPORT void setLogHandler(LogHandler logHandler);\n\n/*\n * ===========================================================================\n *\n * The stuff in the rest of this file should not be used directly.\n */\nFBEXPORT int fb_printLog(int prio, const char* tag, const char* fmt, ...)\n#if defined(__GNUC__)\n    __attribute__((format(printf, 3, 4)))\n#endif\n    ;\n\n#define fb_vprintLog(prio, cond, tag, fmt...) \\\n  __android_log_vprint(prio, tag, fmt)\n\n#define fb_printAssert(cond, tag, fmt...) __android_log_assert(cond, tag, fmt)\n\n#define fb_writeLog(prio, tag, text) __android_log_write(prio, tag, text)\n\n#define fb_bWriteLog(tag, payload, len) __android_log_bwrite(tag, payload, len)\n#define fb_btWriteLog(tag, type, payload, len) \\\n  __android_log_btwrite(tag, type, payload, len)\n\n#define fb_testLog(prio, tag) (1)\n\n/*\n * FB extensions\n */\nvoid logPrintByDelims(int priority, const char* tag, const char* delims,\n                      const char* msg, ...);\n\n#ifdef __cplusplus\n}\n#endif\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/lyra.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <iomanip>\n#include <iostream>\n#include <string>\n#include <vector>\n\n#include <fb/visibility.h>\n\nnamespace facebook {\nnamespace lyra {\n\nconstexpr size_t kDefaultLimit = 64;\n\nusing InstructionPointer = const void*;\n\nclass FBEXPORT StackTraceElement {\n public:\n  StackTraceElement(InstructionPointer absoluteProgramCounter,\n                    InstructionPointer libraryBase,\n                    InstructionPointer functionAddress, std::string libraryName,\n                    std::string functionName)\n      : absoluteProgramCounter_{absoluteProgramCounter},\n        libraryBase_{libraryBase},\n        functionAddress_{functionAddress},\n        libraryName_{std::move(libraryName)},\n        functionName_{std::move(functionName)} {}\n\n  InstructionPointer libraryBase() const noexcept { return libraryBase_; }\n\n  InstructionPointer functionAddress() const noexcept {\n    return functionAddress_;\n  }\n\n  InstructionPointer absoluteProgramCounter() const noexcept {\n    return absoluteProgramCounter_;\n  }\n\n  const std::string& libraryName() const noexcept { return libraryName_; }\n\n  const std::string& functionName() const noexcept { return functionName_; }\n\n  /**\n   * The offset of the program counter to the base of the library (i.e. the\n   * address that addr2line takes as input>\n   */\n  std::ptrdiff_t libraryOffset() const noexcept {\n    auto absoluteLibrary = static_cast<const char*>(libraryBase_);\n    auto absoluteabsoluteProgramCounter =\n        static_cast<const char*>(absoluteProgramCounter_);\n    return absoluteabsoluteProgramCounter - absoluteLibrary;\n  }\n\n  /**\n   * The offset within the current function\n   */\n  int functionOffset() const noexcept {\n    auto absoluteSymbol = static_cast<const char*>(functionAddress_);\n    auto absoluteabsoluteProgramCounter =\n        static_cast<const char*>(absoluteProgramCounter_);\n    return absoluteabsoluteProgramCounter - absoluteSymbol;\n  }\n\n private:\n  const InstructionPointer absoluteProgramCounter_;\n  const InstructionPointer libraryBase_;\n  const InstructionPointer functionAddress_;\n  const std::string libraryName_;\n  const std::string functionName_;\n};\n\n/**\n * Populate the vector with the current stack trace\n *\n * Note that this trace needs to be symbolicated to get the library offset even\n * if it is to be symbolicated off-line.\n *\n * Beware of a bug on some platforms, which makes the trace loop until the\n * buffer is full when it reaches a noexpr function. It seems to be fixed in\n * newer versions of gcc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56846\n *\n * @param stackTrace The vector that will receive the stack trace. Before\n * filling the vector it will be cleared. The vector will never grow so the\n * number of frames captured is limited by the capacity of it.\n *\n * @param skip The number of frames to skip before capturing the trace\n */\nFBEXPORT void getStackTrace(std::vector<InstructionPointer>& stackTrace,\n                            size_t skip = 0);\n\n/**\n * Creates a vector and populates it with the current stack trace\n *\n * Note that this trace needs to be symbolicated to get the library offset even\n * if it is to be symbolicated off-line.\n *\n * Beware of a bug on some platforms, which makes the trace loop until the\n * buffer is full when it reaches a noexpr function. It seems to be fixed in\n * newer versions of gcc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56846\n *\n * @param skip The number of frames to skip before capturing the trace\n *\n * @limit The maximum number of frames captured\n */\nFBEXPORT inline std::vector<InstructionPointer> getStackTrace(\n    size_t skip = 0,\n    size_t limit = kDefaultLimit) {\n  auto stackTrace = std::vector<InstructionPointer>{};\n  stackTrace.reserve(limit);\n  getStackTrace(stackTrace, skip + 1);\n  return stackTrace;\n}\n\n/**\n * Symbolicates a stack trace into a given vector\n *\n * @param symbols The vector to receive the output. The vector is cleared and\n * enough room to keep the frames are reserved.\n *\n * @param stackTrace The input stack trace\n */\nFBEXPORT void getStackTraceSymbols(std::vector<StackTraceElement>& symbols,\n                                   const std::vector<InstructionPointer>& trace);\n\n/**\n * Symbolicates a stack trace into a new vector\n *\n * @param stackTrace The input stack trace\n */\nFBEXPORT inline std::vector<StackTraceElement> getStackTraceSymbols(\n    const std::vector<InstructionPointer>& trace) {\n  auto symbols = std::vector<StackTraceElement>{};\n  getStackTraceSymbols(symbols, trace);\n  return symbols;\n}\n\n\n/**\n * Captures and symbolicates a stack trace\n *\n * Beware of a bug on some platforms, which makes the trace loop until the\n * buffer is full when it reaches a noexpr function. It seems to be fixed in\n * newer versions of gcc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56846\n *\n * @param skip The number of frames before capturing the trace\n *\n * @param limit The maximum number of frames captured\n */\nFBEXPORT inline std::vector<StackTraceElement> getStackTraceSymbols(\n    size_t skip = 0,\n    size_t limit = kDefaultLimit) {\n  return getStackTraceSymbols(getStackTrace(skip + 1, limit));\n}\n\n/**\n * Formatting a stack trace element\n */\nFBEXPORT std::ostream& operator<<(std::ostream& out, const StackTraceElement& elm);\n\n/**\n * Formatting a stack trace\n */\nFBEXPORT std::ostream& operator<<(std::ostream& out,\n                                  const std::vector<StackTraceElement>& trace);\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/noncopyable.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\nnamespace facebook {\n\nstruct noncopyable {\n  noncopyable(const noncopyable&) = delete;\n  noncopyable& operator=(const noncopyable&) = delete;\nprotected:\n  noncopyable() = default;\n};\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/nonmovable.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\nnamespace facebook {\n\nstruct nonmovable {\n  nonmovable(nonmovable&&) = delete;\n  nonmovable& operator=(nonmovable&&) = delete;\nprotected:\n  nonmovable() = default;\n};\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/fb/visibility.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#define FBEXPORT __attribute__((visibility(\"default\")))\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/jni/Countable.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <jni.h>\n\n#include <fb/Countable.h>\n#include <fb/RefPtr.h>\n#include <fb/visibility.h>\n\nnamespace facebook {\nnamespace jni {\n\nFBEXPORT const RefPtr<Countable>& countableFromJava(JNIEnv* env, jobject obj);\n\ntemplate <typename T> RefPtr<T> extractRefPtr(JNIEnv* env, jobject obj) {\n  return static_cast<RefPtr<T>>(countableFromJava(env, obj));\n}\n\ntemplate <typename T> RefPtr<T> extractPossiblyNullRefPtr(JNIEnv* env, jobject obj) {\n  return obj ? extractRefPtr<T>(env, obj) : nullptr;\n}\n\nFBEXPORT void setCountableForJava(JNIEnv* env, jobject obj, RefPtr<Countable>&& countable);\n\nvoid CountableOnLoad(JNIEnv* env);\n\n} }\n\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/jni/GlobalReference.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <memory>\n#include <type_traits>\n\n#include <jni.h>\n\n#include <fb/Environment.h>\n\nnamespace facebook { namespace jni {\n\ntemplate<typename T>\nclass GlobalReference {\n  static_assert(std::is_convertible<T, jobject>::value,\n                \"GlobalReference<T> instantiated with type that is not \"\n                \"convertible to jobject\");\n\n public:\n  explicit GlobalReference(T globalReference) :\n    reference_(globalReference? Environment::current()->NewGlobalRef(globalReference) : nullptr) {\n  }\n\n  ~GlobalReference() {\n    reset();\n  }\n\n  GlobalReference() :\n    reference_(nullptr) {\n  }\n\n  // enable move constructor and assignment\n  GlobalReference(GlobalReference&& rhs) :\n    reference_(std::move(rhs.reference_)) {\n    rhs.reference_ = nullptr;\n  }\n\n  GlobalReference& operator=(GlobalReference&& rhs) {\n    if (this != &rhs) {\n      reset();\n      reference_ = std::move(rhs.reference_);\n      rhs.reference_ = nullptr;\n    }\n    return *this;\n  }\n\n  GlobalReference(const GlobalReference<T>& rhs) :\n    reference_{} {\n    reset(rhs.get());\n  }\n\n  GlobalReference& operator=(const GlobalReference<T>& rhs) {\n    if (this == &rhs) {\n      return *this;\n    }\n    reset(rhs.get());\n    return *this;\n  }\n\n  explicit operator bool() const {\n    return (reference_ != nullptr);\n  }\n\n  T get() const {\n    return reinterpret_cast<T>(reference_);\n  }\n\n  void reset(T globalReference = nullptr) {\n    if (reference_) {\n      Environment::current()->DeleteGlobalRef(reference_);\n    }\n    if (globalReference) {\n      reference_ = Environment::current()->NewGlobalRef(globalReference);\n    } else {\n      reference_ = nullptr;\n    }\n  }\n\n private:\n  jobject reference_;\n};\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/jni/JniTerminateHandler.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <fb/visibility.h>\n\nnamespace facebook {\nnamespace jni {\n\nvoid FBEXPORT installTerminateHandler();\n}};\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/jni/LocalReference.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <memory>\n#include <type_traits>\n\n#include <jni.h>\n\n#include <fb/Environment.h>\n\nnamespace facebook {\nnamespace jni {\n\ntemplate<class T>\nstruct LocalReferenceDeleter {\n  static_assert(std::is_convertible<T, jobject>::value,\n    \"LocalReferenceDeleter<T> instantiated with type that is not convertible to jobject\");\n  void operator()(T localReference) {\n    if (localReference != nullptr) {\n      Environment::current()->DeleteLocalRef(localReference);\n    }\n  } \n };\n\ntemplate<class T>\nusing LocalReference =\n  std::unique_ptr<typename std::remove_pointer<T>::type, LocalReferenceDeleter<T>>;\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/jni/LocalString.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <string>\n\n#include <jni.h>\n\n#include <fb/visibility.h>\n\nnamespace facebook {\nnamespace jni {\n\nnamespace detail {\n\nvoid utf8ToModifiedUTF8(const uint8_t* bytes, size_t len, uint8_t* modified, size_t modifiedLength);\nsize_t modifiedLength(const std::string& str);\nsize_t modifiedLength(const uint8_t* str, size_t* length);\nstd::string modifiedUTF8ToUTF8(const uint8_t* modified, size_t len) noexcept;\nstd::string utf16toUTF8(const uint16_t* utf16Bytes, size_t len) noexcept;\n\n}\n\n// JNI represents strings encoded with modified version of UTF-8.  The difference between UTF-8 and\n// Modified UTF-8 is that the latter support only 1-byte, 2-byte, and 3-byte formats. Supplementary\n// character (4 bytes in unicode) needs to be represented in the form of surrogate pairs. To create\n// a Modified UTF-8 surrogate pair that Dalvik would understand we take 4-byte unicode character,\n// encode it with UTF-16 which gives us two 2 byte chars (surrogate pair) and then we encode each\n// pair as UTF-8. This result in 2 x 3 byte characters.  To convert modified UTF-8 to standard\n// UTF-8, this mus tbe reversed.\n//\n// The second difference is that Modified UTF-8 is encoding NUL byte in 2-byte format.\n//\n// In order to avoid complex error handling, only a minimum of validity checking is done to avoid\n// crashing.  If the input is invalid, the output may be invalid as well.\n//\n// Relevant links:\n//  - http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html\n//  - https://docs.oracle.com/javase/6/docs/api/java/io/DataInput.html#modified-utf-8\n\nclass FBEXPORT LocalString {\npublic:\n  // Assumes UTF8 encoding and make a required conversion to modified UTF-8 when the string\n  // contains unicode supplementary characters.\n  explicit LocalString(const std::string& str);\n  explicit LocalString(const char* str);\n  jstring string() const {\n    return m_string;\n  }\n  ~LocalString();\nprivate:\n  jstring m_string;\n};\n\n// JString to UTF16 extractor using RAII idiom\nclass JStringUtf16Extractor {\npublic:\n  JStringUtf16Extractor(JNIEnv* env, jstring javaString)\n  : env_(env)\n  , javaString_(javaString)\n  , length_(0)\n  , utf16String_(nullptr) {\n    if (env_ && javaString_) {\n      length_ = env_->GetStringLength(javaString_);\n      utf16String_ = env_->GetStringCritical(javaString_, nullptr);\n    }\n  }\n\n  ~JStringUtf16Extractor() {\n    if (utf16String_) {\n      env_->ReleaseStringCritical(javaString_, utf16String_);\n    }\n  }\n\n  const jsize length() const {\n    return length_;\n  }\n\n  const jchar* chars() const {\n    return utf16String_;\n  }\n\nprivate:\n  JNIEnv* env_;\n  jstring javaString_;\n  jsize length_;\n  const jchar* utf16String_;\n};\n\n// The string from JNI is converted to standard UTF-8 if the string contains supplementary\n// characters.\nFBEXPORT std::string fromJString(JNIEnv* env, jstring str);\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/jni/Registration.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n#include <jni.h>\n#include <initializer_list>\n#include <fb/assert.h>\n\nnamespace facebook {\nnamespace jni {\n\nstatic inline void registerNatives(JNIEnv* env, jclass cls, std::initializer_list<JNINativeMethod> methods) {\n  auto result = env->RegisterNatives(cls, methods.begin(), methods.size());\n  FBASSERT(result == 0);\n}\n\nstatic inline void registerNatives(JNIEnv* env, const char* cls, std::initializer_list<JNINativeMethod> list) {\n  registerNatives(env, env->FindClass(cls), list);\n}\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/jni/WeakReference.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n#include <string>\n#include <jni.h>\n#include <fb/noncopyable.h>\n#include <fb/Countable.h>\n#include <fb/visibility.h>\n\n\nnamespace facebook {\nnamespace jni {\n\nclass FBEXPORT WeakReference : public Countable {\npublic:\n  typedef RefPtr<WeakReference> Ptr;\n  WeakReference(jobject strongRef);\n  ~WeakReference();\n  jweak weakRef() {\n    return m_weakReference;\n  }\n\nprivate:\n  jweak m_weakReference;\n};\n\n// This class is intended to take a weak reference and turn it into a strong\n// local reference. Consequently, it should only be allocated on the stack.\nclass FBEXPORT ResolvedWeakReference : public noncopyable {\npublic:\n  ResolvedWeakReference(jobject weakRef);\n  ResolvedWeakReference(const RefPtr<WeakReference>& weakRef);\n  ~ResolvedWeakReference();\n\n  operator jobject () {\n    return m_strongReference;\n  }\n\n  explicit operator bool () {\n    return m_strongReference != nullptr;\n  }\n\nprivate:\n  jobject m_strongReference;\n};\n\n} }\n\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/include/jni/jni_helpers.h",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <jni.h>\n\n#include <fb/visibility.h>\n\nnamespace facebook {\n\n/**\n * Instructs the JNI environment to throw an exception.\n *\n * @param pEnv JNI environment\n * @param szClassName class name to throw\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\nFBEXPORT jint throwException(JNIEnv* pEnv, const char* szClassName, const char* szFmt, va_list va_args);\n\n/**\n * Instructs the JNI environment to throw a NoClassDefFoundError.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\nFBEXPORT jint throwNoClassDefError(JNIEnv* pEnv, const char* szFmt, ...);\n\n/**\n * Instructs the JNI environment to throw a RuntimeException.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\nFBEXPORT jint throwRuntimeException(JNIEnv* pEnv, const char* szFmt, ...);\n\n/**\n * Instructs the JNI environment to throw a IllegalArgumentException.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\nFBEXPORT jint throwIllegalArgumentException(JNIEnv* pEnv, const char* szFmt, ...);\n\n/**\n * Instructs the JNI environment to throw a IllegalStateException.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\nFBEXPORT jint throwIllegalStateException(JNIEnv* pEnv, const char* szFmt, ...);\n\n/**\n * Instructs the JNI environment to throw an IOException.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\nFBEXPORT jint throwIOException(JNIEnv* pEnv, const char* szFmt, ...);\n\n/**\n * Instructs the JNI environment to throw an AssertionError.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\nFBEXPORT jint throwAssertionError(JNIEnv* pEnv, const char* szFmt, ...);\n\n/**\n * Instructs the JNI environment to throw an OutOfMemoryError.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\nFBEXPORT jint throwOutOfMemoryError(JNIEnv* pEnv, const char* szFmt, ...);\n\n/**\n * Finds the specified class. If it's not found, instructs the JNI environment to throw an\n * exception.\n *\n * @param pEnv JNI environment\n * @param szClassName the classname to find in JNI format (e.g. \"java/lang/String\")\n * @return the class or NULL if not found (in which case a pending exception will be queued). This\n *     returns a global reference (JNIEnv::NewGlobalRef).\n */\nFBEXPORT jclass findClassOrThrow(JNIEnv *pEnv, const char* szClassName);\n\n/**\n * Finds the specified field of the specified class. If it's not found, instructs the JNI\n * environment to throw an exception.\n *\n * @param pEnv JNI environment\n * @param clazz the class to lookup the field in\n * @param szFieldName the name of the field to find\n * @param szSig the signature of the field\n * @return the field or NULL if not found (in which case a pending exception will be queued)\n */\nFBEXPORT jfieldID getFieldIdOrThrow(JNIEnv* pEnv, jclass clazz, const char* szFieldName, const char* szSig);\n\n/**\n * Finds the specified method of the specified class. If it's not found, instructs the JNI\n * environment to throw an exception.\n *\n * @param pEnv JNI environment\n * @param clazz the class to lookup the method in\n * @param szMethodName the name of the method to find\n * @param szSig the signature of the method\n * @return the method or NULL if not found (in which case a pending exception will be queued)\n */\nFBEXPORT jmethodID getMethodIdOrThrow(\n    JNIEnv* pEnv,\n    jclass clazz,\n    const char* szMethodName,\n    const char* szSig);\n\n} // namespace facebook\n\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/ByteBuffer.cpp",
    "content": "/*\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <fb/fbjni/ByteBuffer.h>\n\n#include <stdexcept>\n\n#include <fb/fbjni/References.h>\n\nnamespace facebook {\nnamespace jni {\n\nnamespace {\nlocal_ref<JByteBuffer> createEmpty() {\n  static auto cls = JByteBuffer::javaClassStatic();\n  static auto meth = cls->getStaticMethod<JByteBuffer::javaobject(int)>(\"allocateDirect\");\n  return meth(cls, 0);\n}\n}\n\nlocal_ref<JByteBuffer> JByteBuffer::wrapBytes(uint8_t* data, size_t size) {\n  // env->NewDirectByteBuffer requires that size is positive. Android's\n  // dalvik returns an invalid result and Android's art aborts if size == 0.\n  // Workaround this by using a slow path through Java in that case.\n  if (!size) {\n    return createEmpty();\n  }\n  auto res = adopt_local(static_cast<javaobject>(Environment::current()->NewDirectByteBuffer(data, size)));\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n  if (!res) {\n    throw std::runtime_error(\"Direct byte buffers are unsupported.\");\n  }\n  return res;\n}\n\nuint8_t* JByteBuffer::getDirectBytes() const {\n  if (!self()) {\n    throwNewJavaException(\"java/lang/NullPointerException\", \"java.lang.NullPointerException\");\n  }\n  void* bytes = Environment::current()->GetDirectBufferAddress(self());\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n  if (!bytes) {\n    throw std::runtime_error(\n        isDirect() ?\n          \"Attempt to get direct bytes of non-direct byte buffer.\" :\n          \"Error getting direct bytes of byte buffer.\");\n  }\n  return static_cast<uint8_t*>(bytes);\n}\n\nsize_t JByteBuffer::getDirectSize() const {\n  if (!self()) {\n    throwNewJavaException(\"java/lang/NullPointerException\", \"java.lang.NullPointerException\");\n  }\n  int size = Environment::current()->GetDirectBufferCapacity(self());\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n  if (size < 0) {\n    throw std::runtime_error(\n        isDirect() ?\n          \"Attempt to get direct size of non-direct byte buffer.\" :\n          \"Error getting direct size of byte buffer.\");\n  }\n  return static_cast<size_t>(size);\n}\n\nbool JByteBuffer::isDirect() const {\n  static auto meth = javaClassStatic()->getMethod<jboolean()>(\"isDirect\");\n  return meth(self());\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/Countable.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <cstdint>\n#include <jni/Countable.h>\n#include <fb/Environment.h>\n#include <jni/Registration.h>\n\nnamespace facebook {\nnamespace jni {\n\nstatic jfieldID gCountableNativePtr;\n\nstatic RefPtr<Countable>* rawCountableFromJava(JNIEnv* env, jobject obj) {\n  FBASSERT(obj);\n  return reinterpret_cast<RefPtr<Countable>*>(env->GetLongField(obj, gCountableNativePtr));\n}\n\nconst RefPtr<Countable>& countableFromJava(JNIEnv* env, jobject obj) {\n  FBASSERT(obj);\n  return *rawCountableFromJava(env, obj);\n}\n\nvoid setCountableForJava(JNIEnv* env, jobject obj, RefPtr<Countable>&& countable) {\n  int oldValue = env->GetLongField(obj, gCountableNativePtr);\n  FBASSERTMSGF(oldValue == 0, \"Cannot reinitialize object; expected nullptr, got %x\", oldValue);\n\n  FBASSERT(countable);\n  uintptr_t fieldValue = (uintptr_t) new RefPtr<Countable>(std::move(countable));\n  env->SetLongField(obj, gCountableNativePtr, fieldValue);\n}\n\n/**\n * NB: THREAD SAFETY (this comment also exists at Countable.java)\n *\n * This method deletes the corresponding native object on whatever thread the method is called\n * on. In the common case when this is called by Countable#finalize(), this will be called on the\n * system finalizer thread. If you manually call dispose on the Java object, the native object \n * will be deleted synchronously on that thread.\n */\nvoid dispose(JNIEnv* env, jobject obj) {\n  // Grab the pointer\n  RefPtr<Countable>* countable = rawCountableFromJava(env, obj);\n  if (!countable) {\n    // That was easy.\n    return;\n  }\n\n  // Clear out the old value to avoid double-frees\n  env->SetLongField(obj, gCountableNativePtr, 0);\n\n  delete countable;\n}\n\nvoid CountableOnLoad(JNIEnv* env) {\n  jclass countable = env->FindClass(\"com/facebook/jni/Countable\");\n  gCountableNativePtr = env->GetFieldID(countable, \"mInstance\", \"J\");\n  registerNatives(env, countable, {\n    { \"dispose\", \"()V\", (void*) dispose },\n  });\n}\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/Environment.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <fb/log.h>\n#include <fb/ThreadLocal.h>\n#include <fb/Environment.h>\n#include <fb/fbjni/CoreClasses.h>\n#include <fb/fbjni/NativeRunnable.h>\n\n#include <functional>\n\nnamespace facebook {\nnamespace jni {\n\nnamespace {\n\nThreadLocal<ThreadScope>& scopeStorage() {\n  // We don't want the ThreadLocal to delete the ThreadScopes.\n  static ThreadLocal<ThreadScope> scope([] (void*) {});\n  return scope;\n}\n\nThreadScope* currentScope() {\n  return scopeStorage().get();\n}\n\nJavaVM* g_vm = nullptr;\n\nstruct EnvironmentInitializer {\n  EnvironmentInitializer(JavaVM* vm) {\n      FBASSERT(!g_vm);\n      FBASSERT(vm);\n      g_vm = vm;\n  }\n};\n\nint getEnv(JNIEnv** env) {\n  FBASSERT(g_vm);\n  // g_vm->GetEnv() might not clear the env* in failure cases.\n  *env = nullptr;\n  return g_vm->GetEnv((void**)env, JNI_VERSION_1_6);\n}\n\nJNIEnv* attachCurrentThread() {\n  JavaVMAttachArgs args{JNI_VERSION_1_6, nullptr, nullptr};\n  JNIEnv* env = nullptr;\n  auto result = g_vm->AttachCurrentThread(&env, &args);\n  FBASSERT(result == JNI_OK);\n  return env;\n}\n}\n\n/* static */\nvoid Environment::initialize(JavaVM* vm) {\n  static EnvironmentInitializer init(vm);\n}\n\n/* static */\nJNIEnv* Environment::current() {\n  auto scope = currentScope();\n  if (scope && scope->env_) {\n    return scope->env_;\n  }\n\n  JNIEnv* env;\n  if (getEnv(&env) != JNI_OK) {\n    // If there's a ThreadScope in the stack, we should be attached and able to\n    // retrieve a JNIEnv*.\n    FBASSERT(!scope);\n\n    // TODO(cjhopman): this should probably be a hard failure, too.\n    FBLOGE(\"Unable to retrieve jni environment. Is the thread attached?\");\n  }\n  return env;\n}\n\n/* static */\nvoid Environment::detachCurrentThread() {\n  FBASSERT(g_vm);\n  // The thread shouldn't be detached while a ThreadScope is in the stack.\n  FBASSERT(!currentScope());\n  g_vm->DetachCurrentThread();\n}\n\n/* static */\nJNIEnv* Environment::ensureCurrentThreadIsAttached() {\n  auto scope = currentScope();\n  if (scope && scope->env_) {\n    return scope->env_;\n  }\n\n  JNIEnv* env;\n  // We should be able to just get the JNIEnv* by just calling\n  // AttachCurrentThread, but the spec is unclear (and using getEnv is probably\n  // generally more reliable).\n  auto result = getEnv(&env);\n  // We don't know how to deal with anything other than JNI_OK or JNI_DETACHED.\n  FBASSERT(result == JNI_OK || result == JNI_EDETACHED);\n  if (result == JNI_EDETACHED) {\n    // The thread should not be detached while a ThreadScope is in the stack.\n    FBASSERT(!scope);\n    env = attachCurrentThread();\n  }\n  FBASSERT(env);\n  return env;\n}\n\nThreadScope::ThreadScope() : ThreadScope(nullptr, internal::CacheEnvTag{}) {}\n\nThreadScope::ThreadScope(JNIEnv* env, internal::CacheEnvTag)\n    : previous_(nullptr), env_(nullptr), attachedWithThisScope_(false) {\n  auto& storage = scopeStorage();\n  previous_ = storage.get();\n  storage.reset(this);\n\n  if (previous_ && previous_->env_) {\n    FBASSERT(!env || env == previous_->env_);\n    env = previous_->env_;\n  }\n\n  env_ = env;\n  if (env_) {\n    return;\n  }\n\n  // Check if the thread is attached by someone else.\n  auto result = getEnv(&env);\n  if (result == JNI_OK) {\n    return;\n  }\n\n  // We don't know how to deal with anything other than JNI_OK or JNI_DETACHED.\n  FBASSERT(result == JNI_EDETACHED);\n\n  // If there's already a ThreadScope on the stack, then the thread should be attached.\n  FBASSERT(!previous_);\n  attachCurrentThread();\n  attachedWithThisScope_ = true;\n}\n\nThreadScope::~ThreadScope() {\n  auto& storage = scopeStorage();\n  // ThreadScopes should be destroyed in the reverse order they are created\n  // (that is, just put them on the stack).\n  FBASSERT(this == storage.get());\n  storage.reset(previous_);\n  if (attachedWithThisScope_) {\n    Environment::detachCurrentThread();\n  }\n}\n\nnamespace {\nstruct JThreadScopeSupport : JavaClass<JThreadScopeSupport> {\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/jni/ThreadScopeSupport;\";\n\n  // These reinterpret_casts are a totally dangerous pattern. Don't use them. Use HybridData instead.\n  static void runStdFunction(std::function<void()>&& func) {\n    static auto method = javaClassStatic()->getStaticMethod<void(jlong)>(\"runStdFunction\");\n    method(javaClassStatic(), reinterpret_cast<jlong>(&func));\n  }\n\n  static void runStdFunctionImpl(alias_ref<JClass>, jlong ptr) {\n    (*reinterpret_cast<std::function<void()>*>(ptr))();\n  }\n\n  static void OnLoad() {\n    // We need the javaClassStatic so that the class lookup is cached and that\n    // runStdFunction can be called from a ThreadScope-attached thread.\n    javaClassStatic()->registerNatives({\n        makeNativeMethod(\"runStdFunctionImpl\", runStdFunctionImpl),\n      });\n  }\n};\n}\n\n/* static */\nvoid ThreadScope::OnLoad() {\n  // These classes are required for ScopeWithClassLoader. Ensure they are looked up when loading.\n  JThreadScopeSupport::OnLoad();\n}\n\n/* static */\nvoid ThreadScope::WithClassLoader(std::function<void()>&& runnable) {\n  // TODO(cjhopman): If the classloader is already available in this scope, we\n  // shouldn't have to jump through java. It should be enough to check if the\n  // attach state env* is set.\n  ThreadScope ts;\n  JThreadScopeSupport::runStdFunction(std::move(runnable));\n}\n\n} }\n\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/Exceptions.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <fb/fbjni/CoreClasses.h>\n\n#include <fb/assert.h>\n#include <fb/log.h>\n\n#ifdef USE_LYRA\n#include <fb/lyra.h>\n#include <fb/lyra_exceptions.h>\n#endif\n\n#include <alloca.h>\n#include <cstdlib>\n#include <ios>\n#include <stdexcept>\n#include <stdio.h>\n#include <string>\n#include <system_error>\n\n#include <jni.h>\n\nnamespace facebook {\nnamespace jni {\n\nnamespace {\nclass JRuntimeException : public JavaClass<JRuntimeException, JThrowable> {\n public:\n  static auto constexpr kJavaDescriptor = \"Ljava/lang/RuntimeException;\";\n\n  static local_ref<JRuntimeException> create(const char* str) {\n    return newInstance(make_jstring(str));\n  }\n\n  static local_ref<JRuntimeException> create() {\n    return newInstance();\n  }\n};\n\nclass JIOException : public JavaClass<JIOException, JThrowable> {\n public:\n  static auto constexpr kJavaDescriptor = \"Ljava/io/IOException;\";\n\n  static local_ref<JIOException> create(const char* str) {\n    return newInstance(make_jstring(str));\n  }\n};\n\nclass JOutOfMemoryError : public JavaClass<JOutOfMemoryError, JThrowable> {\n public:\n  static auto constexpr kJavaDescriptor = \"Ljava/lang/OutOfMemoryError;\";\n\n  static local_ref<JOutOfMemoryError> create(const char* str) {\n    return newInstance(make_jstring(str));\n  }\n};\n\nclass JArrayIndexOutOfBoundsException : public JavaClass<JArrayIndexOutOfBoundsException, JThrowable> {\n public:\n  static auto constexpr kJavaDescriptor = \"Ljava/lang/ArrayIndexOutOfBoundsException;\";\n\n  static local_ref<JArrayIndexOutOfBoundsException> create(const char* str) {\n    return newInstance(make_jstring(str));\n  }\n};\n\nclass JUnknownCppException : public JavaClass<JUnknownCppException, JThrowable> {\n public:\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/jni/UnknownCppException;\";\n\n  static local_ref<JUnknownCppException> create() {\n    return newInstance();\n  }\n\n  static local_ref<JUnknownCppException> create(const char* str) {\n    return newInstance(make_jstring(str));\n  }\n};\n\nclass JCppSystemErrorException : public JavaClass<JCppSystemErrorException, JThrowable> {\n public:\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/jni/CppSystemErrorException;\";\n\n  static local_ref<JCppSystemErrorException> create(const std::system_error& e) {\n    return newInstance(make_jstring(e.what()), e.code().value());\n  }\n};\n\n// Exception throwing & translating functions //////////////////////////////////////////////////////\n\n// Functions that throw Java exceptions\n\nvoid setJavaExceptionAndAbortOnFailure(alias_ref<JThrowable> throwable) {\n  auto env = Environment::current();\n  if (throwable) {\n    env->Throw(throwable.get());\n  }\n  if (env->ExceptionCheck() != JNI_TRUE) {\n    std::abort();\n  }\n}\n\n}\n\n// Functions that throw C++ exceptions\n\n// TODO(T6618159) Inject the c++ stack into the exception's stack trace. One\n// issue: when a java exception is created, it captures the full java stack\n// across jni boundaries. lyra will only capture the c++ stack to the jni\n// boundary. So, as we pass the java exception up to c++, we need to capture\n// the c++ stack and then insert it into the correct place in the java stack\n// trace. Then, as the exception propagates across the boundaries, we will\n// slowly fill in the c++ parts of the trace.\nvoid throwPendingJniExceptionAsCppException() {\n  JNIEnv* env = Environment::current();\n  if (env->ExceptionCheck() == JNI_FALSE) {\n    return;\n  }\n\n  auto throwable = adopt_local(env->ExceptionOccurred());\n  if (!throwable) {\n    throw std::runtime_error(\"Unable to get pending JNI exception.\");\n  }\n  env->ExceptionClear();\n\n  throw JniException(throwable);\n}\n\nvoid throwCppExceptionIf(bool condition) {\n  if (!condition) {\n    return;\n  }\n\n  auto env = Environment::current();\n  if (env->ExceptionCheck() == JNI_TRUE) {\n    throwPendingJniExceptionAsCppException();\n    return;\n  }\n\n  throw JniException();\n}\n\nvoid throwNewJavaException(jthrowable throwable) {\n  throw JniException(wrap_alias(throwable));\n}\n\nvoid throwNewJavaException(const char* throwableName, const char* msg) {\n  // If anything of the fbjni calls fail, an exception of a suitable\n  // form will be thrown, which is what we want.\n  auto throwableClass = findClassLocal(throwableName);\n  auto throwable = throwableClass->newObject(\n    throwableClass->getConstructor<jthrowable(jstring)>(),\n    make_jstring(msg).release());\n  throwNewJavaException(throwable.get());\n}\n\n// jthrowable //////////////////////////////////////////////////////////////////////////////////////\n\nlocal_ref<JThrowable> JThrowable::initCause(alias_ref<JThrowable> cause) {\n  static auto meth = javaClassStatic()->getMethod<javaobject(alias_ref<javaobject>)>(\"initCause\");\n  return meth(self(), cause);\n}\n\nauto JThrowable::getStackTrace() -> local_ref<JStackTrace> {\n  static auto meth = javaClassStatic()->getMethod<JStackTrace::javaobject()>(\"getStackTrace\");\n  return meth(self());\n}\n\nvoid JThrowable::setStackTrace(alias_ref<JStackTrace> stack) {\n  static auto meth = javaClassStatic()->getMethod<void(alias_ref<JStackTrace>)>(\"setStackTrace\");\n  return meth(self(), stack);\n}\n\nauto JStackTraceElement::create(\n    const std::string& declaringClass, const std::string& methodName, const std::string& file, int line)\n    -> local_ref<javaobject> {\n  return newInstance(declaringClass, methodName, file, line);\n}\n\nstd::string JStackTraceElement::getClassName() const {\n  static auto meth = javaClassStatic()->getMethod<local_ref<JString>()>(\"getClassName\");\n  return meth(self())->toStdString();\n}\n\nstd::string JStackTraceElement::getMethodName() const {\n  static auto meth = javaClassStatic()->getMethod<local_ref<JString>()>(\"getMethodName\");\n  return meth(self())->toStdString();\n}\n\nstd::string JStackTraceElement::getFileName() const {\n  static auto meth = javaClassStatic()->getMethod<local_ref<JString>()>(\"getFileName\");\n  return meth(self())->toStdString();\n}\n\nint JStackTraceElement::getLineNumber() const {\n  static auto meth = javaClassStatic()->getMethod<jint()>(\"getLineNumber\");\n  return meth(self());\n}\n\n// Translate C++ to Java Exception\n\nnamespace {\n\n// For each exception in the chain of the exception_ptr argument, func\n// will be called with that exception (in reverse order, i.e. innermost first).\n#ifndef FBJNI_NO_EXCEPTION_PTR\nvoid denest(const std::function<void(std::exception_ptr)>& func, std::exception_ptr ptr) {\n  FBASSERT(ptr);\n  try {\n    std::rethrow_exception(ptr);\n  } catch (const std::nested_exception& e) {\n    denest(func, e.nested_ptr());\n  } catch (...) {\n    // ignored.\n  }\n  func(ptr);\n  }\n#endif\n\n} // namespace\n\n\n#ifdef USE_LYRA\nlocal_ref<JStackTraceElement> createJStackTraceElement(const lyra::StackTraceElement& cpp) {\n  return JStackTraceElement::create(\n      \"|lyra|{\" + cpp.libraryName() + \"}\", cpp.functionName(), cpp.buildId(), cpp.libraryOffset());\n}\n#endif\n\n#ifndef FBJNI_NO_EXCEPTION_PTR\nvoid addCppStacktraceToJavaException(alias_ref<JThrowable> java, std::exception_ptr cpp) {\n#ifdef USE_LYRA\n  auto cppStack = lyra::getStackTraceSymbols(\n                    (cpp == nullptr) ?\n                      lyra::getStackTrace()\n                      : lyra::getExceptionTrace(cpp));\n\n  auto javaStack = java->getStackTrace();\n  auto newStack = JThrowable::JStackTrace::newArray(javaStack->size() + cppStack.size());\n  size_t i = 0;\n  for (size_t j = 0; j < cppStack.size(); j++, i++) {\n    (*newStack)[i] = createJStackTraceElement(cppStack[j]);\n  }\n  for (size_t j = 0; j < javaStack->size(); j++, i++) {\n    (*newStack)[i] = (*javaStack)[j];\n  }\n  java->setStackTrace(newStack);\n#endif\n}\n\nlocal_ref<JThrowable> convertCppExceptionToJavaException(std::exception_ptr ptr) {\n  FBASSERT(ptr);\n  local_ref<JThrowable> current;\n  bool addCppStack = true;\n  try {\n    std::rethrow_exception(ptr);\n    addCppStack = false;\n  } catch (const JniException& ex) {\n    current = ex.getThrowable();\n  } catch (const std::ios_base::failure& ex) {\n    current = JIOException::create(ex.what());\n  } catch (const std::bad_alloc& ex) {\n    current = JOutOfMemoryError::create(ex.what());\n  } catch (const std::out_of_range& ex) {\n    current = JArrayIndexOutOfBoundsException::create(ex.what());\n  } catch (const std::system_error& ex) {\n    current = JCppSystemErrorException::create(ex);\n  } catch (const std::runtime_error& ex) {\n    current = JRuntimeException::create(ex.what());\n  } catch (const std::exception& ex) {\n    current = JCppException::create(ex.what());\n  } catch (const char* msg) {\n    current = JUnknownCppException::create(msg);\n  } catch (...) {\n    current = JUnknownCppException::create();\n  }\n\n  if (addCppStack) {\n    addCppStacktraceToJavaException(current, ptr);\n  }\n  return current;\n  }\n#endif\n\nlocal_ref<JThrowable> getJavaExceptionForCppBackTrace() {\n  return getJavaExceptionForCppBackTrace(nullptr);\n}\n\nlocal_ref<JThrowable> getJavaExceptionForCppBackTrace(const char* msg) {\n  local_ref<JThrowable> current =\n      msg ? JUnknownCppException::create(msg) : JUnknownCppException::create();\n#ifndef FBJNI_NO_EXCEPTION_PTR\n  addCppStacktraceToJavaException(current, nullptr);\n#endif\n  return current;\n}\n\n\n#ifndef FBJNI_NO_EXCEPTION_PTR\nlocal_ref<JThrowable> getJavaExceptionForCppException(std::exception_ptr ptr) {\n  FBASSERT(ptr);\n  local_ref<JThrowable> previous;\n  auto func = [&previous] (std::exception_ptr ptr) {\n    auto current = convertCppExceptionToJavaException(ptr);\n    if (previous) {\n      current->initCause(previous);\n    }\n    previous = current;\n  };\n  denest(func, ptr);\n  return previous;\n}\n#endif\n\nvoid translatePendingCppExceptionToJavaException() {\n  try {\n#ifndef FBJNI_NO_EXCEPTION_PTR\n    auto exc = getJavaExceptionForCppException(std::current_exception());\n#else\n    auto exc = JUnknownCppException::create();\n#endif\n    setJavaExceptionAndAbortOnFailure(exc);\n  } catch (...) {\n#ifdef USE_LYRA\n    FBLOGE(\"Unexpected error in translatePendingCppExceptionToJavaException(): %s\",\n        lyra::toString(std::current_exception()).c_str());\n#endif\n    std::terminate();\n  }\n}\n\n// JniException ////////////////////////////////////////////////////////////////////////////////////\n\nconst std::string JniException::kExceptionMessageFailure_ = \"Unable to get exception message.\";\n\nJniException::JniException() : JniException(JRuntimeException::create()) { }\n\nJniException::JniException(alias_ref<jthrowable> throwable) : isMessageExtracted_(false) {\n  throwable_ = make_global(throwable);\n}\n\nJniException::JniException(JniException &&rhs)\n    : throwable_(std::move(rhs.throwable_)),\n      what_(std::move(rhs.what_)),\n      isMessageExtracted_(rhs.isMessageExtracted_) {\n}\n\nJniException::JniException(const JniException &rhs)\n    : what_(rhs.what_), isMessageExtracted_(rhs.isMessageExtracted_) {\n  throwable_ = make_global(rhs.throwable_);\n}\n\nJniException::~JniException() {\n  try {\n    ThreadScope ts;\n    throwable_.reset();\n  } catch (...) {\n    FBLOGE(\"Exception in ~JniException()\");\n    std::terminate();\n  }\n}\n\nlocal_ref<JThrowable> JniException::getThrowable() const noexcept {\n  return make_local(throwable_);\n}\n\n// TODO 6900503: consider making this thread-safe.\nvoid JniException::populateWhat() const noexcept {\n  try {\n    ThreadScope ts;\n    what_ = throwable_->toString();\n    isMessageExtracted_ = true;\n  } catch(...) {\n    what_ = kExceptionMessageFailure_;\n  }\n}\n\nconst char* JniException::what() const noexcept {\n  if (!isMessageExtracted_) {\n    populateWhat();\n  }\n  return what_.c_str();\n}\n\nvoid JniException::setJavaException() const noexcept {\n  setJavaExceptionAndAbortOnFailure(throwable_);\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/Hybrid.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"fb/fbjni.h\"\n\n\nnamespace facebook {\nnamespace jni {\n\nnamespace detail {\n\nlocal_ref<HybridData> HybridData::create() {\n  return newInstance();\n}\n\n}\n\nnamespace {\nvoid deleteNative(alias_ref<jclass>, jlong ptr) {\n  delete reinterpret_cast<detail::BaseHybridClass*>(ptr);\n}\n}\n\nvoid HybridDataOnLoad() {\n  registerNatives(\"com/facebook/jni/HybridData$Destructor\", {\n      makeNativeMethod(\"deleteNative\", deleteNative),\n  });\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/LocalString.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <jni/LocalString.h>\n#include <fb/Environment.h>\n#include <fb/assert.h>\n\n#include <vector>\n\nnamespace facebook {\nnamespace jni {\n\nnamespace {\n\nconst uint16_t kUtf8OneByteBoundary       = 0x80;\nconst uint16_t kUtf8TwoBytesBoundary      = 0x800;\nconst uint16_t kUtf16HighSubLowBoundary   = 0xD800;\nconst uint16_t kUtf16HighSubHighBoundary  = 0xDC00;\nconst uint16_t kUtf16LowSubHighBoundary   = 0xE000;\n\ninline void encode3ByteUTF8(char32_t code, uint8_t* out) {\n  FBASSERTMSGF((code & 0xffff0000) == 0, \"3 byte utf-8 encodings only valid for up to 16 bits\");\n\n  out[0] = 0xE0 | (code >> 12);\n  out[1] = 0x80 | ((code >> 6) & 0x3F);\n  out[2] = 0x80 | (code & 0x3F);\n}\n\ninline char32_t decode3ByteUTF8(const uint8_t* in) {\n  return (((in[0] & 0x0f) << 12) |\n          ((in[1] & 0x3f) << 6) |\n          ( in[2] & 0x3f));\n}\n\ninline void encode4ByteUTF8(char32_t code, std::string& out, size_t offset) {\n  FBASSERTMSGF((code & 0xfff80000) == 0, \"4 byte utf-8 encodings only valid for up to 21 bits\");\n\n  out[offset] =     (char) (0xF0 | (code >> 18));\n  out[offset + 1] = (char) (0x80 | ((code >> 12) & 0x3F));\n  out[offset + 2] = (char) (0x80 | ((code >> 6) & 0x3F));\n  out[offset + 3] = (char) (0x80 | (code & 0x3F));\n}\n\ntemplate <typename T>\ninline bool isFourByteUTF8Encoding(const T* utf8) {\n  return ((*utf8 & 0xF8) == 0xF0);\n}\n\n}\n\nnamespace detail {\n\nsize_t modifiedLength(const std::string& str) {\n  // Scan for supplementary characters\n  size_t j = 0;\n  for (size_t i = 0; i < str.size(); ) {\n    if (str[i] == 0) {\n      i += 1;\n      j += 2;\n    } else if (i + 4 > str.size() ||\n               !isFourByteUTF8Encoding(&(str[i]))) {\n      // See the code in utf8ToModifiedUTF8 for what's happening here.\n      i += 1;\n      j += 1;\n    } else {\n      i += 4;\n      j += 6;\n    }\n  }\n\n  return j;\n}\n\n// returns modified utf8 length; *length is set to strlen(str)\nsize_t modifiedLength(const uint8_t* str, size_t* length) {\n  // NUL-terminated: Scan for length and supplementary characters\n  size_t i = 0;\n  size_t j = 0;\n  if (str != nullptr) {\n    while (str[i] != 0) {\n      if (str[i + 1] == 0 ||\n          str[i + 2] == 0 ||\n          str[i + 3] == 0 ||\n          !isFourByteUTF8Encoding(&(str[i]))) {\n        i += 1;\n        j += 1;\n      } else {\n        i += 4;\n        j += 6;\n      }\n    }\n  }\n\n  *length = i;\n  return j;\n}\n\nvoid utf8ToModifiedUTF8(const uint8_t* utf8, size_t len, uint8_t* modified, size_t modifiedBufLen)\n{\n  size_t j = 0;\n  for (size_t i = 0; i < len; ) {\n    FBASSERTMSGF(j < modifiedBufLen, \"output buffer is too short\");\n    if (utf8[i] == 0) {\n      FBASSERTMSGF(j + 1 < modifiedBufLen, \"output buffer is too short\");\n      modified[j] = 0xc0;\n      modified[j + 1] = 0x80;\n      i += 1;\n      j += 2;\n      continue;\n    }\n\n    if (i + 4 > len ||\n        !isFourByteUTF8Encoding(utf8 + i)) {\n      // If the input is too short for this to be a four-byte\n      // encoding, or it isn't one for real, just copy it on through.\n      modified[j] = utf8[i];\n      i++;\n      j++;\n      continue;\n    }\n\n    // Convert 4 bytes of input to 2 * 3 bytes of output\n    char32_t code = (((utf8[i]     & 0x07) << 18) |\n                     ((utf8[i + 1] & 0x3f) << 12) |\n                     ((utf8[i + 2] & 0x3f) << 6) |\n                     ( utf8[i + 3] & 0x3f));\n    char32_t first;\n    char32_t second;\n\n    if (code > 0x10ffff) {\n      // These could be valid utf-8, but cannot be represented as modified UTF-8, due to the 20-bit\n      // limit on that representation.  Encode two replacement characters, so the expected output\n      // length lines up.\n      const char32_t kUnicodeReplacementChar = 0xfffd;\n      first = kUnicodeReplacementChar;\n      second = kUnicodeReplacementChar;\n    } else {\n      // split into surrogate pair\n      first = ((code - 0x010000) >> 10) | 0xd800;\n      second = ((code - 0x010000) & 0x3ff) | 0xdc00;\n    }\n\n    // encode each as a 3 byte surrogate value\n    FBASSERTMSGF(j + 5 < modifiedBufLen, \"output buffer is too short\");\n    encode3ByteUTF8(first, modified + j);\n    encode3ByteUTF8(second, modified + j + 3);\n    i += 4;\n    j += 6;\n  }\n\n  FBASSERTMSGF(j < modifiedBufLen, \"output buffer is too short\");\n  modified[j++] = '\\0';\n}\n\nstd::string modifiedUTF8ToUTF8(const uint8_t* modified, size_t len) noexcept {\n  // Converting from modified utf8 to utf8 will always shrink, so this will always be sufficient\n  std::string utf8(len, 0);\n  size_t j = 0;\n  for (size_t i = 0; i < len; ) {\n    // surrogate pair: 1101 10xx  xxxx xxxx  1101 11xx  xxxx xxxx\n    // encoded pair: 1110 1101  1010 xxxx  10xx xxxx  1110 1101  1011 xxxx  10xx xxxx\n\n    if (len >= i + 6 &&\n        modified[i] == 0xed &&\n        (modified[i + 1] & 0xf0) == 0xa0 &&\n        modified[i + 3] == 0xed &&\n        (modified[i + 4] & 0xf0) == 0xb0) {\n      // Valid surrogate pair\n      char32_t pair1 = decode3ByteUTF8(modified + i);\n      char32_t pair2 = decode3ByteUTF8(modified + i + 3);\n      char32_t ch = 0x10000 + (((pair1 & 0x3ff) << 10) |\n                               ( pair2 & 0x3ff));\n      encode4ByteUTF8(ch, utf8, j);\n      i += 6;\n      j += 4;\n      continue;\n    } else if (len >= i + 2 &&\n               modified[i] == 0xc0 &&\n               modified[i + 1] == 0x80) {\n      utf8[j] = 0;\n      i += 2;\n      j += 1;\n      continue;\n    }\n\n    // copy one byte.  This might be a one, two, or three-byte encoding.  It might be an invalid\n    // encoding of some sort, but garbage in garbage out is ok.\n\n    utf8[j] = (char) modified[i];\n    i++;\n    j++;\n  }\n\n  utf8.resize(j);\n\n  return utf8;\n}\n\n// Calculate how many bytes are needed to convert an UTF16 string into UTF8\n// UTF16 string\nsize_t utf16toUTF8Length(const uint16_t* utf16String, size_t utf16StringLen) {\n  if (!utf16String || utf16StringLen == 0) {\n    return 0;\n  }\n\n  uint32_t utf8StringLen = 0;\n  auto utf16StringEnd = utf16String + utf16StringLen;\n  auto idx16 = utf16String;\n  while (idx16 < utf16StringEnd) {\n    auto ch = *idx16++;\n    if (ch < kUtf8OneByteBoundary) {\n      utf8StringLen++;\n    } else if (ch < kUtf8TwoBytesBoundary) {\n      utf8StringLen += 2;\n    } else if (\n        (ch >= kUtf16HighSubLowBoundary) && (ch < kUtf16HighSubHighBoundary) &&\n        (idx16 < utf16StringEnd) &&\n        (*idx16 >= kUtf16HighSubHighBoundary) && (*idx16 < kUtf16LowSubHighBoundary)) {\n      utf8StringLen += 4;\n      idx16++;\n    } else {\n      utf8StringLen += 3;\n    }\n  }\n\n  return utf8StringLen;\n}\n\nstd::string utf16toUTF8(const uint16_t* utf16String, size_t utf16StringLen) noexcept {\n  if (!utf16String || utf16StringLen <= 0) {\n    return \"\";\n  }\n\n  std::string utf8String(utf16toUTF8Length(utf16String, utf16StringLen), '\\0');\n  auto idx8 = utf8String.begin();\n  auto idx16 = utf16String;\n  auto utf16StringEnd = utf16String + utf16StringLen;\n  while (idx16 < utf16StringEnd) {\n    auto ch = *idx16++;\n    if (ch < kUtf8OneByteBoundary) {\n      *idx8++ = (ch & 0x7F);\n    } else if (ch < kUtf8TwoBytesBoundary) {\n      *idx8++ = 0b11000000 | (ch >> 6);\n      *idx8++ = 0b10000000 | (ch & 0x3F);\n    } else if (\n        (ch >= kUtf16HighSubLowBoundary) && (ch < kUtf16HighSubHighBoundary) &&\n        (idx16 < utf16StringEnd) &&\n        (*idx16 >= kUtf16HighSubHighBoundary) && (*idx16 < kUtf16LowSubHighBoundary)) {\n      auto ch2 = *idx16++;\n      uint8_t trunc_byte = (((ch >> 6) & 0x0F) + 1);\n      *idx8++ = 0b11110000 | (trunc_byte >> 2);\n      *idx8++ = 0b10000000 | ((trunc_byte & 0x03) << 4) | ((ch >> 2) & 0x0F);\n      *idx8++ = 0b10000000 | ((ch & 0x03) << 4) | ((ch2 >> 6) & 0x0F);\n      *idx8++ = 0b10000000 | (ch2 & 0x3F);\n    } else {\n      *idx8++ = 0b11100000 | (ch >> 12);\n      *idx8++ = 0b10000000 | ((ch >> 6) & 0x3F);\n      *idx8++ = 0b10000000 | (ch & 0x3F);\n    }\n  }\n\n  return utf8String;\n}\n\n}\n\nLocalString::LocalString(const std::string& str)\n{\n  size_t modlen = detail::modifiedLength(str);\n  if (modlen == str.size()) {\n    // no supplementary characters, build jstring from input buffer\n    m_string = Environment::current()->NewStringUTF(str.data());\n    return;\n  }\n  auto modified = std::vector<char>(modlen + 1); // allocate extra byte for \\0\n  detail::utf8ToModifiedUTF8(\n    reinterpret_cast<const uint8_t*>(str.data()), str.size(),\n    reinterpret_cast<uint8_t*>(modified.data()), modified.size());\n  m_string = Environment::current()->NewStringUTF(modified.data());\n}\n\nLocalString::LocalString(const char* str)\n{\n  size_t len;\n  size_t modlen = detail::modifiedLength(reinterpret_cast<const uint8_t*>(str), &len);\n  if (modlen == len) {\n    // no supplementary characters, build jstring from input buffer\n    m_string = Environment::current()->NewStringUTF(str);\n    return;\n  }\n  auto modified = std::vector<char>(modlen + 1); // allocate extra byte for \\0\n  detail::utf8ToModifiedUTF8(\n    reinterpret_cast<const uint8_t*>(str), len,\n    reinterpret_cast<uint8_t*>(modified.data()), modified.size());\n  m_string = Environment::current()->NewStringUTF(modified.data());\n}\n\nLocalString::~LocalString() {\n  Environment::current()->DeleteLocalRef(m_string);\n}\n\nstd::string fromJString(JNIEnv* env, jstring str) {\n  auto utf16String = JStringUtf16Extractor(env, str);\n  return detail::utf16toUTF8(utf16String.chars(), utf16String.length());\n}\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/OnLoad.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <jni/Countable.h>\n#include <fb/Environment.h>\n#include <fb/fbjni.h>\n#include <fb/fbjni/NativeRunnable.h>\n\nusing namespace facebook::jni;\n\nvoid initialize_fbjni() {\n  CountableOnLoad(Environment::current());\n  HybridDataOnLoad();\n  JNativeRunnable::OnLoad();\n  ThreadScope::OnLoad();\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/References.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <fb/fbjni/References.h>\n\nnamespace facebook {\nnamespace jni {\n\nJniLocalScope::JniLocalScope(JNIEnv* env, jint capacity)\n    : env_(env) {\n  hasFrame_ = false;\n  auto pushResult = env->PushLocalFrame(capacity);\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(pushResult < 0);\n  hasFrame_ = true;\n}\n\nJniLocalScope::~JniLocalScope() {\n  if (hasFrame_) {\n    env_->PopLocalFrame(nullptr);\n  }\n}\n\nnamespace internal {\n\n// Default implementation always returns true.\n// Platform-specific sources can override this.\nbool doesGetObjectRefTypeWork() __attribute__ ((weak));\nbool doesGetObjectRefTypeWork() {\n  return true;\n}\n\n}\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/WeakReference.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <fb/Environment.h>\n#include <jni/WeakReference.h>\n\nnamespace facebook {\nnamespace jni {\n\nWeakReference::WeakReference(jobject strongRef) :\n  m_weakReference(Environment::current()->NewWeakGlobalRef(strongRef))\n{\n}\n\nWeakReference::~WeakReference() {\n  auto env = Environment::current();\n  FBASSERTMSGF(env, \"Attempt to delete jni::WeakReference from non-JNI thread\");\n  env->DeleteWeakGlobalRef(m_weakReference);\n}\n\nResolvedWeakReference::ResolvedWeakReference(jobject weakRef) :\n  m_strongReference(Environment::current()->NewLocalRef(weakRef))\n{\n}\n\nResolvedWeakReference::ResolvedWeakReference(const RefPtr<WeakReference>& weakRef) :\n  m_strongReference(Environment::current()->NewLocalRef(weakRef->weakRef()))\n{\n}\n\nResolvedWeakReference::~ResolvedWeakReference() {\n  if (m_strongReference)\n    Environment::current()->DeleteLocalRef(m_strongReference);\n}\n\n} }\n\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/android/CpuCapabilities.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <fb/CpuCapabilities.h>\n#include <cpu-features.h>\n#include <fb/Environment.h>\n#include <glog/logging.h>\n#include <jni/Registration.h>\n\nnamespace facebook { namespace jni {\n\n// =========================================\n// returns true if this device supports NEON calls, false otherwise\njboolean nativeDeviceSupportsNeon(JNIEnv* env, jobject obj) {\n  if (android_getCpuFamily() != ANDROID_CPU_FAMILY_ARM) {\n    VLOG(2) << \"NEON disabled, not an ARM CPU\";\n    return false;\n  }\n  uint64_t cpufeatures = android_getCpuFeatures();\n  if ((cpufeatures & ANDROID_CPU_ARM_FEATURE_ARMv7) == 0) {\n    VLOG(2) << \"NEON disabled, not an ARMv7 CPU\";\n    return false;\n  }\n  if ((cpufeatures & ANDROID_CPU_ARM_FEATURE_NEON) == 0) {\n    VLOG(2) << \"NEON disabled, not supported\";\n    return false;\n  }\n\n  VLOG(2) << \"NEON supported and enabled\";\n  return true;\n}\n\n// =========================================\n// returns true if this device supports VFP_FP16, false otherwise.\njboolean nativeDeviceSupportsVFPFP16(JNIEnv *env, jobject obj) {\n  uint64_t cpufeatures = android_getCpuFeatures();\n  if ((cpufeatures & ANDROID_CPU_ARM_FEATURE_VFP_FP16) == 0) {\n    VLOG(2) << \"VPF_FP16 disabled, not supported\";\n    return false;\n  }\n  VLOG(2) << \"VFP_FP16 supported and enabled\";\n  return true;\n}\n\n// =========================================\n// returns true if this device is x86 based, false otherwise\njboolean nativeDeviceSupportsX86(JNIEnv* env, jobject obj) {\n  return (android_getCpuFamily() == ANDROID_CPU_FAMILY_X86);\n}\n\n// =========================================\n// register native methods\nvoid initialize_cpucapabilities() {\n  facebook::jni::registerNatives(\n      Environment::current(),\n      \"com/facebook/jni/CpuCapabilitiesJni\",\n      {\n        { \"nativeDeviceSupportsNeon\",\n          \"()Z\",\n          (void*) nativeDeviceSupportsNeon },\n        { \"nativeDeviceSupportsVFPFP16\",\n          \"()Z\",\n          (void*) nativeDeviceSupportsVFPFP16 },\n        { \"nativeDeviceSupportsX86\",\n          \"()Z\",\n          (void*) nativeDeviceSupportsX86 },\n      }\n  );\n}\n\n} } // namespace facebook::jni\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/android/ReferenceChecking.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#ifndef __ANDROID__\n#error \"This file should only be compiled for Android.\"\n#endif\n\n#include <fb/fbjni/References.h>\n#include <fb/fbjni/CoreClasses.h>\n\nnamespace facebook {\nnamespace jni {\nnamespace internal {\n\nstatic int32_t getApiLevel() {\n  auto cls = findClassLocal(\"android/os/Build$VERSION\");\n  auto fld = cls->getStaticField<int32_t>(\"SDK_INT\");\n  if (fld) {\n    return cls->getStaticFieldValue(fld);\n  }\n  return 0;\n}\n\nbool doesGetObjectRefTypeWork() {\n  static auto level = getApiLevel();\n  return level >= 14;\n}\n\n}\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/fbjni.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <fb/fbjni.h>\n\n#include <mutex>\n#include <vector>\n#include <jni/LocalString.h>\n#include <fb/log.h>\n\nnamespace facebook {\nnamespace jni {\n\njint initialize(JavaVM* vm, std::function<void()>&& init_fn) noexcept {\n  static std::once_flag flag{};\n  // TODO (t7832883): DTRT when we have exception pointers\n  static auto error_msg = std::string{\"Failed to initialize fbjni\"};\n  static auto error_occured = false;\n\n  std::call_once(flag, [vm] {\n    try {\n      Environment::initialize(vm);\n    } catch (std::exception& ex) {\n      error_occured = true;\n      try {\n        error_msg = std::string{\"Failed to initialize fbjni: \"} + ex.what();\n      } catch (...) {\n        // Ignore, we already have a fall back message\n      }\n    } catch (...) {\n      error_occured = true;\n    }\n  });\n\n  try {\n    if (error_occured) {\n      throw std::runtime_error(error_msg);\n    }\n\n    init_fn();\n  } catch (const std::exception& e) {\n    FBLOGE(\"error %s\", e.what());\n    translatePendingCppExceptionToJavaException();\n  } catch (...) {\n    translatePendingCppExceptionToJavaException();\n    // So Java will handle the translated exception, fall through and\n    // return a good version number.\n  }\n  return JNI_VERSION_1_6;\n}\n\nalias_ref<JClass> findClassStatic(const char* name) {\n  const auto env = internal::getEnv();\n  if (!env) {\n    throw std::runtime_error(\"Unable to retrieve JNIEnv*.\");\n  }\n  local_ref<jclass> cls = adopt_local(env->FindClass(name));\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(!cls);\n  auto leaking_ref = (jclass)env->NewGlobalRef(cls.get());\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(!leaking_ref);\n  return wrap_alias(leaking_ref);\n}\n\nlocal_ref<JClass> findClassLocal(const char* name) {\n  const auto env = internal::getEnv();\n  if (!env) {\n    throw std::runtime_error(\"Unable to retrieve JNIEnv*.\");\n  }\n  auto cls = env->FindClass(name);\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(!cls);\n  return adopt_local(cls);\n}\n\n\n// jstring /////////////////////////////////////////////////////////////////////////////////////////\n\nstd::string JString::toStdString() const {\n  const auto env = internal::getEnv();\n  auto utf16String = JStringUtf16Extractor(env, self());\n  return detail::utf16toUTF8(utf16String.chars(), utf16String.length());\n}\n\nlocal_ref<JString> make_jstring(const char* utf8) {\n  if (!utf8) {\n    return {};\n  }\n  const auto env = internal::getEnv();\n  size_t len;\n  size_t modlen = detail::modifiedLength(reinterpret_cast<const uint8_t*>(utf8), &len);\n  jstring result;\n  if (modlen == len) {\n    // The only difference between utf8 and modifiedUTF8 is in encoding 4-byte UTF8 chars\n    // and '\\0' that is encoded on 2 bytes.\n    //\n    // Since modifiedUTF8-encoded string can be no shorter than it's UTF8 conterpart we\n    // know that if those two strings are of the same length we don't need to do any\n    // conversion -> no 4-byte chars nor '\\0'.\n    result = env->NewStringUTF(utf8);\n  } else {\n    auto modified = std::vector<char>(modlen + 1); // allocate extra byte for \\0\n    detail::utf8ToModifiedUTF8(\n      reinterpret_cast<const uint8_t*>(utf8), len,\n      reinterpret_cast<uint8_t*>(modified.data()), modified.size());\n    result = env->NewStringUTF(modified.data());\n  }\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();\n  return adopt_local(result);\n}\n\n\n// JniPrimitiveArrayFunctions //////////////////////////////////////////////////////////////////////\n\n#pragma push_macro(\"DEFINE_PRIMITIVE_METHODS\")\n#undef DEFINE_PRIMITIVE_METHODS\n#define DEFINE_PRIMITIVE_METHODS(TYPE, NAME, SMALLNAME)                        \\\n                                                                               \\\ntemplate<>                                                                     \\\nFBEXPORT                                                                       \\\nTYPE* JPrimitiveArray<TYPE ## Array>::getElements(jboolean* isCopy) {          \\\n  auto env = internal::getEnv();                                               \\\n  TYPE* res =  env->Get ## NAME ## ArrayElements(self(), isCopy);              \\\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();                                      \\\n  return res;                                                                  \\\n}                                                                              \\\n                                                                               \\\ntemplate<>                                                                     \\\nFBEXPORT                                                                       \\\nvoid JPrimitiveArray<TYPE ## Array>::releaseElements(                          \\\n    TYPE* elements, jint mode) {                                               \\\n  auto env = internal::getEnv();                                               \\\n  env->Release ## NAME ## ArrayElements(self(), elements, mode);               \\\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();                                      \\\n}                                                                              \\\n                                                                               \\\ntemplate<>                                                                     \\\nFBEXPORT                                                                       \\\nvoid JPrimitiveArray<TYPE ## Array>::getRegion(                                \\\n    jsize start, jsize length, TYPE* buf) {                                    \\\n  auto env = internal::getEnv();                                               \\\n  env->Get ## NAME ## ArrayRegion(self(), start, length, buf);                 \\\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();                                      \\\n}                                                                              \\\n                                                                               \\\ntemplate<>                                                                     \\\nFBEXPORT                                                                       \\\nvoid JPrimitiveArray<TYPE ## Array>::setRegion(                                \\\n    jsize start, jsize length, const TYPE* elements) {                         \\\n  auto env = internal::getEnv();                                               \\\n  env->Set ## NAME ## ArrayRegion(self(), start, length, elements);            \\\n  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();                                      \\\n}                                                                              \\\n                                                                               \\\nFBEXPORT                                                                       \\\nlocal_ref<TYPE ## Array> make_ ## SMALLNAME ## _array(jsize size) {            \\\n  auto array = internal::getEnv()->New ## NAME ## Array(size);                 \\\n  FACEBOOK_JNI_THROW_EXCEPTION_IF(!array);                                     \\\n  return adopt_local(array);                                                   \\\n}                                                                              \\\n                                                                               \\\ntemplate<>                                                                     \\\nFBEXPORT                                                                       \\\nlocal_ref<TYPE ## Array> JArray ## NAME::newArray(size_t count) {              \\\n  return make_ ## SMALLNAME ## _array(count);                                  \\\n}                                                                              \\\n                                                                               \\\n\nDEFINE_PRIMITIVE_METHODS(jboolean, Boolean, boolean)\nDEFINE_PRIMITIVE_METHODS(jbyte, Byte, byte)\nDEFINE_PRIMITIVE_METHODS(jchar, Char, char)\nDEFINE_PRIMITIVE_METHODS(jshort, Short, short)\nDEFINE_PRIMITIVE_METHODS(jint, Int, int)\nDEFINE_PRIMITIVE_METHODS(jlong, Long, long)\nDEFINE_PRIMITIVE_METHODS(jfloat, Float, float)\nDEFINE_PRIMITIVE_METHODS(jdouble, Double, double)\n#pragma pop_macro(\"DEFINE_PRIMITIVE_METHODS\")\n\n// Internal debug /////////////////////////////////////////////////////////////////////////////////\n\nnamespace internal {\n\nFBEXPORT ReferenceStats g_reference_stats;\n\nFBEXPORT void facebook::jni::internal::ReferenceStats::reset() noexcept {\n  locals_deleted = globals_deleted = weaks_deleted = 0;\n}\n\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/java/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\njava_library(\n    name = \"java\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\"PUBLIC\"],\n    deps = [\n        \"//java/com/facebook/proguard/annotations:annotations\",\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/java/CppException.java",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.jni;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic class CppException extends RuntimeException {\n  @DoNotStrip\n  public CppException(String message) {\n    super(message);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/java/CppSystemErrorException.java",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.jni;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic class CppSystemErrorException extends CppException {\n  int errorCode;\n\n  @DoNotStrip\n  public CppSystemErrorException(String message, int errorCode) {\n    super(message);\n    this.errorCode = errorCode;\n  }\n\n  public int getErrorCode() {\n    return errorCode;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/java/UnknownCppException.java",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.jni;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\n@DoNotStrip\npublic class UnknownCppException extends CppException {\n  @DoNotStrip\n  public UnknownCppException() {\n    super(\"Unknown\");\n  }\n\n  @DoNotStrip\n  public UnknownCppException(String message) {\n    super(message);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/jni/jni_helpers.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <jni.h>\n#include <stddef.h>\n#include <cstdio>\n\n#include <jni/jni_helpers.h>\n\n#define MSG_SIZE 1024\n\nnamespace facebook {\n\n/**\n * Instructs the JNI environment to throw an exception.\n *\n * @param pEnv JNI environment\n * @param szClassName class name to throw\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\njint throwException(JNIEnv* pEnv, const char* szClassName, const char* szFmt, va_list va_args) {\n  char szMsg[MSG_SIZE];\n  vsnprintf(szMsg, MSG_SIZE, szFmt, va_args);\n  jclass exClass = pEnv->FindClass(szClassName);\n  return pEnv->ThrowNew(exClass, szMsg);\n}\n\n/**\n * Instructs the JNI environment to throw a NoClassDefFoundError.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\njint throwNoClassDefError(JNIEnv* pEnv, const char* szFmt, ...) {\n  va_list va_args;\n  va_start(va_args, szFmt);\n  jint ret = throwException(pEnv, \"java/lang/NoClassDefFoundError\", szFmt, va_args);\n  va_end(va_args);\n  return ret;\n}\n\n/**\n * Instructs the JNI environment to throw a RuntimeException.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\njint throwRuntimeException(JNIEnv* pEnv, const char* szFmt, ...) {\n  va_list va_args;\n  va_start(va_args, szFmt);\n  jint ret = throwException(pEnv, \"java/lang/RuntimeException\", szFmt, va_args);\n  va_end(va_args);\n  return ret;\n}\n\n/**\n * Instructs the JNI environment to throw an IllegalArgumentException.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\njint throwIllegalArgumentException(JNIEnv* pEnv, const char* szFmt, ...) {\n  va_list va_args;\n  va_start(va_args, szFmt);\n  jint ret = throwException(pEnv, \"java/lang/IllegalArgumentException\", szFmt, va_args);\n  va_end(va_args);\n  return ret;\n}\n\n/**\n * Instructs the JNI environment to throw an IllegalStateException.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\njint throwIllegalStateException(JNIEnv* pEnv, const char* szFmt, ...) {\n  va_list va_args;\n  va_start(va_args, szFmt);\n  jint ret = throwException(pEnv, \"java/lang/IllegalStateException\", szFmt, va_args);\n  va_end(va_args);\n  return ret;\n}\n\n/**\n * Instructs the JNI environment to throw an OutOfMemoryError.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\njint throwOutOfMemoryError(JNIEnv* pEnv, const char* szFmt, ...) {\n  va_list va_args;\n  va_start(va_args, szFmt);\n  jint ret = throwException(pEnv, \"java/lang/OutOfMemoryError\", szFmt, va_args);\n  va_end(va_args);\n  return ret;\n}\n\n/**\n * Instructs the JNI environment to throw an AssertionError.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\njint throwAssertionError(JNIEnv* pEnv, const char* szFmt, ...) {\n  va_list va_args;\n  va_start(va_args, szFmt);\n  jint ret = throwException(pEnv, \"java/lang/AssertionError\", szFmt, va_args);\n  va_end(va_args);\n  return ret;\n}\n\n/**\n * Instructs the JNI environment to throw an IOException.\n *\n * @param pEnv JNI environment\n * @param szFmt sprintf-style format string\n * @param ... sprintf-style args\n * @return 0 on success; a negative value on failure\n */\njint throwIOException(JNIEnv* pEnv, const char* szFmt, ...) {\n  va_list va_args;\n  va_start(va_args, szFmt);\n  jint ret = throwException(pEnv, \"java/io/IOException\", szFmt, va_args);\n  va_end(va_args);\n  return ret;\n}\n\n/**\n * Finds the specified class. If it's not found, instructs the JNI environment to throw an\n * exception.\n *\n * @param pEnv JNI environment\n * @param szClassName the classname to find in JNI format (e.g. \"java/lang/String\")\n * @return the class or NULL if not found (in which case a pending exception will be queued). This\n *     returns a global reference (JNIEnv::NewGlobalRef).\n */\njclass findClassOrThrow(JNIEnv* pEnv, const char* szClassName) {\n  jclass clazz = pEnv->FindClass(szClassName);\n  if (!clazz) {\n    return NULL;\n  }\n  return (jclass) pEnv->NewGlobalRef(clazz);\n}\n\n/**\n * Finds the specified field of the specified class. If it's not found, instructs the JNI\n * environment to throw an exception.\n *\n * @param pEnv JNI environment\n * @param clazz the class to lookup the field in\n * @param szFieldName the name of the field to find\n * @param szSig the signature of the field\n * @return the field or NULL if not found (in which case a pending exception will be queued)\n */\njfieldID getFieldIdOrThrow(JNIEnv* pEnv, jclass clazz, const char* szFieldName, const char* szSig) {\n  return pEnv->GetFieldID(clazz, szFieldName, szSig);\n}\n\n/**\n * Finds the specified method of the specified class. If it's not found, instructs the JNI\n * environment to throw an exception.\n *\n * @param pEnv JNI environment\n * @param clazz the class to lookup the method in\n * @param szMethodName the name of the method to find\n * @param szSig the signature of the method\n * @return the method or NULL if not found (in which case a pending exception will be queued)\n */\njmethodID getMethodIdOrThrow(\n    JNIEnv* pEnv,\n    jclass clazz,\n    const char* szMethodName,\n    const char* szSig) {\n  return pEnv->GetMethodID(clazz, szMethodName, szSig);\n}\n\n} // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/lyra/lyra.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <fb/lyra.h>\n\n#include <ios>\n#include <memory>\n#include <vector>\n\n#include <dlfcn.h>\n#include <unwind.h>\n\nusing namespace std;\n\nnamespace facebook {\nnamespace lyra {\n\nnamespace {\n\nclass IosFlagsSaver {\n  ios_base& ios_;\n  ios_base::fmtflags flags_;\n\n public:\n  IosFlagsSaver(ios_base& ios)\n  : ios_(ios),\n    flags_(ios.flags())\n  {}\n\n  ~IosFlagsSaver() {\n    ios_.flags(flags_);\n  }\n};\n\nstruct BacktraceState {\n  size_t skip;\n  vector<InstructionPointer>& stackTrace;\n};\n\n_Unwind_Reason_Code unwindCallback(struct _Unwind_Context* context, void* arg) {\n  BacktraceState* state = reinterpret_cast<BacktraceState*>(arg);\n  auto absoluteProgramCounter =\n      reinterpret_cast<InstructionPointer>(_Unwind_GetIP(context));\n\n  if (state->skip > 0) {\n    --state->skip;\n    return _URC_NO_REASON;\n  }\n\n  if (state->stackTrace.size() == state->stackTrace.capacity()) {\n    return _URC_END_OF_STACK;\n  }\n\n  state->stackTrace.push_back(absoluteProgramCounter);\n\n  return _URC_NO_REASON;\n}\n\nvoid captureBacktrace(size_t skip, vector<InstructionPointer>& stackTrace) {\n  // Beware of a bug on some platforms, which makes the trace loop until the\n  // buffer is full when it reaches a noexcept function. It seems to be fixed in\n  // newer versions of gcc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56846\n  // TODO(t10738439): Investigate workaround for the stack trace bug\n  BacktraceState state = {skip, stackTrace};\n  _Unwind_Backtrace(unwindCallback, &state);\n}\n}\n\nvoid getStackTrace(vector<InstructionPointer>& stackTrace, size_t skip) {\n  stackTrace.clear();\n  captureBacktrace(skip + 1, stackTrace);\n}\n\n// TODO(t10737622): Improve on-device symbolification\nvoid getStackTraceSymbols(vector<StackTraceElement>& symbols,\n                          const vector<InstructionPointer>& trace) {\n  symbols.clear();\n  symbols.reserve(trace.size());\n\n  for (size_t i = 0; i < trace.size(); ++i) {\n    Dl_info info;\n    if (dladdr(trace[i], &info)) {\n      symbols.emplace_back(trace[i], info.dli_fbase, info.dli_saddr,\n                           info.dli_fname ? info.dli_fname : \"\",\n                           info.dli_sname ? info.dli_sname : \"\");\n    }\n  }\n}\n\nostream& operator<<(ostream& out, const StackTraceElement& elm) {\n  IosFlagsSaver flags{out};\n\n  // TODO(t10748683): Add build id to the output\n  out << \"{dso=\" << elm.libraryName() << \" offset=\" << hex\n      << showbase << elm.libraryOffset();\n\n  if (!elm.functionName().empty()) {\n    out << \" func=\" << elm.functionName() << \"()+\" << elm.functionOffset();\n  }\n\n  out << \" build-id=\" << hex << setw(8) << 0\n      << \"}\";\n\n  return out;\n}\n\n// TODO(t10737667): The implement a tool that parse the stack trace and\n// symbolicate it\nostream& operator<<(ostream& out, const vector<StackTraceElement>& trace) {\n  IosFlagsSaver flags{out};\n\n  auto i = 0;\n  out << \"Backtrace:\\n\";\n  for (auto& elm : trace) {\n    out << \"    #\" << dec << setfill('0') << setw(2) << i++ << \" \" << elm << '\\n';\n  }\n\n  return out;\n}\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fb/onload.cpp",
    "content": "/*\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <jni.h>\n#ifndef DISABLE_CPUCAP\n#include <fb/CpuCapabilities.h>\n#endif\n#include <fb/fbjni.h>\n\nusing namespace facebook::jni;\n\nvoid initialize_xplatinit();\nvoid initialize_fbjni();\n\nJNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {\n  return facebook::jni::initialize(vm, [] {\n    initialize_fbjni();\n#ifndef DISABLE_XPLAT\n    initialize_xplatinit();\n#endif\n#ifndef DISABLE_CPUCAP\n    initialize_cpucapabilities();\n#endif\n  });\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fbgloginit/Android.mk",
    "content": "LOCAL_PATH:= $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES:= \\\n       glog_init.cpp\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n\nLOCAL_CFLAGS := -fexceptions -fno-omit-frame-pointer\nLOCAL_CFLAGS += -Wall -Werror\n\nCXX11_FLAGS := -std=gnu++11\nLOCAL_CFLAGS += $(CXX11_FLAGS)\n\nLOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)\n\nLOCAL_LDLIBS := -llog\n\nLOCAL_SHARED_LIBRARIES := libglog\n\nLOCAL_MODULE := libglog_init\n\ninclude $(BUILD_SHARED_LIBRARY)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fbgloginit/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\ninclude_defs(\"//ReactCommon/DEFS\")\n\nfb_xplat_cxx_library(\n    name = \"fbgloginit\",\n    srcs = [\n        \"glog_init.cpp\",\n    ],\n    exported_headers = [\"fb/glog_init.h\"],\n    compiler_flags = [\n        \"-fexceptions\",\n        \"-fno-omit-frame-pointer\",\n    ],\n    linker_flags = [\n        \"-llog\",\n    ],\n    visibility = [\"PUBLIC\"],\n    deps = [\n        GLOG_DEP,\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fbgloginit/fb/glog_init.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <string>\n\nnamespace facebook { namespace gloginit {\n\nvoid initialize(const char* tag = \"ReactNativeJNI\");\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/fbgloginit/glog_init.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"fb/glog_init.h\"\n\n#include <iostream>\n#include <mutex>\n#include <stdexcept>\n\n#include <glog/logging.h>\n\n#ifdef __ANDROID__\n\n#include <android/log.h>\n\nstatic int toAndroidLevel(google::LogSeverity severity) {\n  switch (severity) {\n  case google::GLOG_INFO:\n    return ANDROID_LOG_INFO;\n  case google::GLOG_WARNING:\n    return ANDROID_LOG_WARN;\n  case google::GLOG_ERROR:\n    return ANDROID_LOG_ERROR;\n  case google::GLOG_FATAL:\n    return ANDROID_LOG_FATAL;\n  default:\n    return ANDROID_LOG_FATAL;\n  }\n}\n\n/**\n * Sends GLog output to adb logcat.\n */\nclass LogcatSink : public google::LogSink {\n public:\n  void send(\n      google::LogSeverity severity,\n      const char* full_filename,\n      const char* base_filename,\n      int line,\n      const struct ::tm* tm_time,\n      const char* message,\n      size_t message_len) override {\n    auto level = toAndroidLevel(severity);\n    __android_log_print(\n        level,\n        base_filename,\n        \"%.*s\",\n        (int)message_len,\n        message);\n  }\n};\n\n/**\n * Sends GLog output to adb logcat.\n */\nclass TaggedLogcatSink : public google::LogSink {\n  const std::string tag_;\n\n public:\n  TaggedLogcatSink(const std::string &tag) : tag_{tag} {}\n\n  void send(\n      google::LogSeverity severity,\n      const char* full_filename,\n      const char* base_filename,\n      int line,\n      const struct ::tm* tm_time,\n      const char* message,\n      size_t message_len) override {\n    auto level = toAndroidLevel(severity);\n    __android_log_print(\n      level,\n      tag_.c_str(),\n      \"%.*s\",\n      (int)message_len,\n      message);\n  }\n};\n\nstatic google::LogSink* make_sink(const std::string& tag) {\n  if (tag.empty()) {\n    return new LogcatSink{};\n  } else {\n    return new TaggedLogcatSink{tag};\n  }\n}\n\nstatic void sendGlogOutputToLogcat(const char* tag) {\n  google::AddLogSink(make_sink(tag));\n\n  // Disable logging to files\n  for (auto i = 0; i < google::NUM_SEVERITIES; ++i) {\n    google::SetLogDestination(i, \"\");\n  }\n}\n\n#endif // __ANDROID__\n\nstatic void lastResort(const char* tag, const char* msg, const char* arg = nullptr) {\n#ifdef __ANDROID__\n  if (!arg) {\n    __android_log_write(ANDROID_LOG_ERROR, tag, msg);\n  } else {\n    __android_log_print(ANDROID_LOG_ERROR, tag, \"%s: %s\", msg, arg);\n  }\n#else\n  std::cerr << msg;\n  if (arg) {\n    std::cerr << \": \" << arg;\n  }\n  std::cerr << std::endl;\n#endif\n}\n\nnamespace facebook { namespace gloginit {\n\nvoid initialize(const char* tag) {\n  static std::once_flag flag{};\n  static auto failed = false;\n\n  std::call_once(flag, [tag] {\n    try {\n      google::InitGoogleLogging(tag);\n\n#ifdef __ANDROID__\n      sendGlogOutputToLogcat(tag);\n#endif\n    } catch (std::exception& ex) {\n      lastResort(tag, \"Failed to initialize glog\", ex.what());\n      failed = true;\n    } catch (...) {\n      lastResort(tag, \"Failed to initialize glog\");\n      failed = true;\n    }\n  });\n\n  if (failed) {\n    throw std::runtime_error{\"Failed to initialize glog\"};\n  }\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/jni-hack/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\n# Copyright (c) 2014-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\nfb_xplat_cxx_library(\n    name = \"jni-hack\",\n    header_namespace = \"\",\n    exported_headers = [\n        \"jni.h\",\n        \"real/jni.h\",\n    ],\n    force_static = True,\n    visibility = [\"PUBLIC\"],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/jni-hack/README.md",
    "content": "This buck module exists so that targets that need to be built against both 1) Android (where we can and should use the Android NDK jni headers) and 2) the host platform(generally for local unit tests) can depend on a single target and get the right jni header for whatever platform they're building against automatically.\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/jni-hack/jni.h",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#ifdef __ANDROID__\n#include_next <jni.h>\n#else\n#include \"real/jni.h\"\n#endif\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/jni-hack/real/jni.h",
    "content": "/*\n * Copyright (C) 2006 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * JNI specification, as defined by Sun:\n * http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/jniTOC.html\n *\n * Everything here is expected to be VM-neutral.\n */\n\n#ifndef JNI_H_\n#define JNI_H_\n\n#include <stdarg.h>\n#include <stdint.h>\n\n/* Primitive types that match up with Java equivalents. */\ntypedef uint8_t  jboolean; /* unsigned 8 bits */\ntypedef int8_t   jbyte;    /* signed 8 bits */\ntypedef uint16_t jchar;    /* unsigned 16 bits */\ntypedef int16_t  jshort;   /* signed 16 bits */\ntypedef int32_t  jint;     /* signed 32 bits */\ntypedef int64_t  jlong;    /* signed 64 bits */\ntypedef float    jfloat;   /* 32-bit IEEE 754 */\ntypedef double   jdouble;  /* 64-bit IEEE 754 */\n\n/* \"cardinal indices and sizes\" */\ntypedef jint     jsize;\n\n#ifdef __cplusplus\n/*\n * Reference types, in C++\n */\nclass _jobject {};\nclass _jclass : public _jobject {};\nclass _jstring : public _jobject {};\nclass _jarray : public _jobject {};\nclass _jobjectArray : public _jarray {};\nclass _jbooleanArray : public _jarray {};\nclass _jbyteArray : public _jarray {};\nclass _jcharArray : public _jarray {};\nclass _jshortArray : public _jarray {};\nclass _jintArray : public _jarray {};\nclass _jlongArray : public _jarray {};\nclass _jfloatArray : public _jarray {};\nclass _jdoubleArray : public _jarray {};\nclass _jthrowable : public _jobject {};\n\ntypedef _jobject*       jobject;\ntypedef _jclass*        jclass;\ntypedef _jstring*       jstring;\ntypedef _jarray*        jarray;\ntypedef _jobjectArray*  jobjectArray;\ntypedef _jbooleanArray* jbooleanArray;\ntypedef _jbyteArray*    jbyteArray;\ntypedef _jcharArray*    jcharArray;\ntypedef _jshortArray*   jshortArray;\ntypedef _jintArray*     jintArray;\ntypedef _jlongArray*    jlongArray;\ntypedef _jfloatArray*   jfloatArray;\ntypedef _jdoubleArray*  jdoubleArray;\ntypedef _jthrowable*    jthrowable;\ntypedef _jobject*       jweak;\n\n\n#else /* not __cplusplus */\n\n/*\n * Reference types, in C.\n */\ntypedef void*           jobject;\ntypedef jobject         jclass;\ntypedef jobject         jstring;\ntypedef jobject         jarray;\ntypedef jarray          jobjectArray;\ntypedef jarray          jbooleanArray;\ntypedef jarray          jbyteArray;\ntypedef jarray          jcharArray;\ntypedef jarray          jshortArray;\ntypedef jarray          jintArray;\ntypedef jarray          jlongArray;\ntypedef jarray          jfloatArray;\ntypedef jarray          jdoubleArray;\ntypedef jobject         jthrowable;\ntypedef jobject         jweak;\n\n#endif /* not __cplusplus */\n\nstruct _jfieldID;                       /* opaque structure */\ntypedef struct _jfieldID* jfieldID;     /* field IDs */\n\nstruct _jmethodID;                      /* opaque structure */\ntypedef struct _jmethodID* jmethodID;   /* method IDs */\n\nstruct JNIInvokeInterface;\n\ntypedef union jvalue {\n    jboolean    z;\n    jbyte       b;\n    jchar       c;\n    jshort      s;\n    jint        i;\n    jlong       j;\n    jfloat      f;\n    jdouble     d;\n    jobject     l;\n} jvalue;\n\ntypedef enum jobjectRefType {\n    JNIInvalidRefType = 0,\n    JNILocalRefType = 1,\n    JNIGlobalRefType = 2,\n    JNIWeakGlobalRefType = 3\n} jobjectRefType;\n\ntypedef struct {\n    const char* name;\n    const char* signature;\n    void*       fnPtr;\n} JNINativeMethod;\n\nstruct _JNIEnv;\nstruct _JavaVM;\ntypedef const struct JNINativeInterface* C_JNIEnv;\n\n#if defined(__cplusplus)\ntypedef _JNIEnv JNIEnv;\ntypedef _JavaVM JavaVM;\n#else\ntypedef const struct JNINativeInterface* JNIEnv;\ntypedef const struct JNIInvokeInterface* JavaVM;\n#endif\n\n/*\n * Table of interface function pointers.\n */\nstruct JNINativeInterface {\n    void*       reserved0;\n    void*       reserved1;\n    void*       reserved2;\n    void*       reserved3;\n\n    jint        (*GetVersion)(JNIEnv *);\n\n    jclass      (*DefineClass)(JNIEnv*, const char*, jobject, const jbyte*,\n                        jsize);\n    jclass      (*FindClass)(JNIEnv*, const char*);\n\n    jmethodID   (*FromReflectedMethod)(JNIEnv*, jobject);\n    jfieldID    (*FromReflectedField)(JNIEnv*, jobject);\n    /* spec doesn't show jboolean parameter */\n    jobject     (*ToReflectedMethod)(JNIEnv*, jclass, jmethodID, jboolean);\n\n    jclass      (*GetSuperclass)(JNIEnv*, jclass);\n    jboolean    (*IsAssignableFrom)(JNIEnv*, jclass, jclass);\n\n    /* spec doesn't show jboolean parameter */\n    jobject     (*ToReflectedField)(JNIEnv*, jclass, jfieldID, jboolean);\n\n    jint        (*Throw)(JNIEnv*, jthrowable);\n    jint        (*ThrowNew)(JNIEnv *, jclass, const char *);\n    jthrowable  (*ExceptionOccurred)(JNIEnv*);\n    void        (*ExceptionDescribe)(JNIEnv*);\n    void        (*ExceptionClear)(JNIEnv*);\n    void        (*FatalError)(JNIEnv*, const char*);\n\n    jint        (*PushLocalFrame)(JNIEnv*, jint);\n    jobject     (*PopLocalFrame)(JNIEnv*, jobject);\n\n    jobject     (*NewGlobalRef)(JNIEnv*, jobject);\n    void        (*DeleteGlobalRef)(JNIEnv*, jobject);\n    void        (*DeleteLocalRef)(JNIEnv*, jobject);\n    jboolean    (*IsSameObject)(JNIEnv*, jobject, jobject);\n\n    jobject     (*NewLocalRef)(JNIEnv*, jobject);\n    jint        (*EnsureLocalCapacity)(JNIEnv*, jint);\n\n    jobject     (*AllocObject)(JNIEnv*, jclass);\n    jobject     (*NewObject)(JNIEnv*, jclass, jmethodID, ...);\n    jobject     (*NewObjectV)(JNIEnv*, jclass, jmethodID, va_list);\n    jobject     (*NewObjectA)(JNIEnv*, jclass, jmethodID, jvalue*);\n\n    jclass      (*GetObjectClass)(JNIEnv*, jobject);\n    jboolean    (*IsInstanceOf)(JNIEnv*, jobject, jclass);\n    jmethodID   (*GetMethodID)(JNIEnv*, jclass, const char*, const char*);\n\n    jobject     (*CallObjectMethod)(JNIEnv*, jobject, jmethodID, ...);\n    jobject     (*CallObjectMethodV)(JNIEnv*, jobject, jmethodID, va_list);\n    jobject     (*CallObjectMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);\n    jboolean    (*CallBooleanMethod)(JNIEnv*, jobject, jmethodID, ...);\n    jboolean    (*CallBooleanMethodV)(JNIEnv*, jobject, jmethodID, va_list);\n    jboolean    (*CallBooleanMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);\n    jbyte       (*CallByteMethod)(JNIEnv*, jobject, jmethodID, ...);\n    jbyte       (*CallByteMethodV)(JNIEnv*, jobject, jmethodID, va_list);\n    jbyte       (*CallByteMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);\n    jchar       (*CallCharMethod)(JNIEnv*, jobject, jmethodID, ...);\n    jchar       (*CallCharMethodV)(JNIEnv*, jobject, jmethodID, va_list);\n    jchar       (*CallCharMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);\n    jshort      (*CallShortMethod)(JNIEnv*, jobject, jmethodID, ...);\n    jshort      (*CallShortMethodV)(JNIEnv*, jobject, jmethodID, va_list);\n    jshort      (*CallShortMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);\n    jint        (*CallIntMethod)(JNIEnv*, jobject, jmethodID, ...);\n    jint        (*CallIntMethodV)(JNIEnv*, jobject, jmethodID, va_list);\n    jint        (*CallIntMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);\n    jlong       (*CallLongMethod)(JNIEnv*, jobject, jmethodID, ...);\n    jlong       (*CallLongMethodV)(JNIEnv*, jobject, jmethodID, va_list);\n    jlong       (*CallLongMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);\n    jfloat      (*CallFloatMethod)(JNIEnv*, jobject, jmethodID, ...);\n    jfloat      (*CallFloatMethodV)(JNIEnv*, jobject, jmethodID, va_list);\n    jfloat      (*CallFloatMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);\n    jdouble     (*CallDoubleMethod)(JNIEnv*, jobject, jmethodID, ...);\n    jdouble     (*CallDoubleMethodV)(JNIEnv*, jobject, jmethodID, va_list);\n    jdouble     (*CallDoubleMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);\n    void        (*CallVoidMethod)(JNIEnv*, jobject, jmethodID, ...);\n    void        (*CallVoidMethodV)(JNIEnv*, jobject, jmethodID, va_list);\n    void        (*CallVoidMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);\n\n    jobject     (*CallNonvirtualObjectMethod)(JNIEnv*, jobject, jclass,\n                        jmethodID, ...);\n    jobject     (*CallNonvirtualObjectMethodV)(JNIEnv*, jobject, jclass,\n                        jmethodID, va_list);\n    jobject     (*CallNonvirtualObjectMethodA)(JNIEnv*, jobject, jclass,\n                        jmethodID, jvalue*);\n    jboolean    (*CallNonvirtualBooleanMethod)(JNIEnv*, jobject, jclass,\n                        jmethodID, ...);\n    jboolean    (*CallNonvirtualBooleanMethodV)(JNIEnv*, jobject, jclass,\n                         jmethodID, va_list);\n    jboolean    (*CallNonvirtualBooleanMethodA)(JNIEnv*, jobject, jclass,\n                         jmethodID, jvalue*);\n    jbyte       (*CallNonvirtualByteMethod)(JNIEnv*, jobject, jclass,\n                        jmethodID, ...);\n    jbyte       (*CallNonvirtualByteMethodV)(JNIEnv*, jobject, jclass,\n                        jmethodID, va_list);\n    jbyte       (*CallNonvirtualByteMethodA)(JNIEnv*, jobject, jclass,\n                        jmethodID, jvalue*);\n    jchar       (*CallNonvirtualCharMethod)(JNIEnv*, jobject, jclass,\n                        jmethodID, ...);\n    jchar       (*CallNonvirtualCharMethodV)(JNIEnv*, jobject, jclass,\n                        jmethodID, va_list);\n    jchar       (*CallNonvirtualCharMethodA)(JNIEnv*, jobject, jclass,\n                        jmethodID, jvalue*);\n    jshort      (*CallNonvirtualShortMethod)(JNIEnv*, jobject, jclass,\n                        jmethodID, ...);\n    jshort      (*CallNonvirtualShortMethodV)(JNIEnv*, jobject, jclass,\n                        jmethodID, va_list);\n    jshort      (*CallNonvirtualShortMethodA)(JNIEnv*, jobject, jclass,\n                        jmethodID, jvalue*);\n    jint        (*CallNonvirtualIntMethod)(JNIEnv*, jobject, jclass,\n                        jmethodID, ...);\n    jint        (*CallNonvirtualIntMethodV)(JNIEnv*, jobject, jclass,\n                        jmethodID, va_list);\n    jint        (*CallNonvirtualIntMethodA)(JNIEnv*, jobject, jclass,\n                        jmethodID, jvalue*);\n    jlong       (*CallNonvirtualLongMethod)(JNIEnv*, jobject, jclass,\n                        jmethodID, ...);\n    jlong       (*CallNonvirtualLongMethodV)(JNIEnv*, jobject, jclass,\n                        jmethodID, va_list);\n    jlong       (*CallNonvirtualLongMethodA)(JNIEnv*, jobject, jclass,\n                        jmethodID, jvalue*);\n    jfloat      (*CallNonvirtualFloatMethod)(JNIEnv*, jobject, jclass,\n                        jmethodID, ...);\n    jfloat      (*CallNonvirtualFloatMethodV)(JNIEnv*, jobject, jclass,\n                        jmethodID, va_list);\n    jfloat      (*CallNonvirtualFloatMethodA)(JNIEnv*, jobject, jclass,\n                        jmethodID, jvalue*);\n    jdouble     (*CallNonvirtualDoubleMethod)(JNIEnv*, jobject, jclass,\n                        jmethodID, ...);\n    jdouble     (*CallNonvirtualDoubleMethodV)(JNIEnv*, jobject, jclass,\n                        jmethodID, va_list);\n    jdouble     (*CallNonvirtualDoubleMethodA)(JNIEnv*, jobject, jclass,\n                        jmethodID, jvalue*);\n    void        (*CallNonvirtualVoidMethod)(JNIEnv*, jobject, jclass,\n                        jmethodID, ...);\n    void        (*CallNonvirtualVoidMethodV)(JNIEnv*, jobject, jclass,\n                        jmethodID, va_list);\n    void        (*CallNonvirtualVoidMethodA)(JNIEnv*, jobject, jclass,\n                        jmethodID, jvalue*);\n\n    jfieldID    (*GetFieldID)(JNIEnv*, jclass, const char*, const char*);\n\n    jobject     (*GetObjectField)(JNIEnv*, jobject, jfieldID);\n    jboolean    (*GetBooleanField)(JNIEnv*, jobject, jfieldID);\n    jbyte       (*GetByteField)(JNIEnv*, jobject, jfieldID);\n    jchar       (*GetCharField)(JNIEnv*, jobject, jfieldID);\n    jshort      (*GetShortField)(JNIEnv*, jobject, jfieldID);\n    jint        (*GetIntField)(JNIEnv*, jobject, jfieldID);\n    jlong       (*GetLongField)(JNIEnv*, jobject, jfieldID);\n    jfloat      (*GetFloatField)(JNIEnv*, jobject, jfieldID);\n    jdouble     (*GetDoubleField)(JNIEnv*, jobject, jfieldID);\n\n    void        (*SetObjectField)(JNIEnv*, jobject, jfieldID, jobject);\n    void        (*SetBooleanField)(JNIEnv*, jobject, jfieldID, jboolean);\n    void        (*SetByteField)(JNIEnv*, jobject, jfieldID, jbyte);\n    void        (*SetCharField)(JNIEnv*, jobject, jfieldID, jchar);\n    void        (*SetShortField)(JNIEnv*, jobject, jfieldID, jshort);\n    void        (*SetIntField)(JNIEnv*, jobject, jfieldID, jint);\n    void        (*SetLongField)(JNIEnv*, jobject, jfieldID, jlong);\n    void        (*SetFloatField)(JNIEnv*, jobject, jfieldID, jfloat);\n    void        (*SetDoubleField)(JNIEnv*, jobject, jfieldID, jdouble);\n\n    jmethodID   (*GetStaticMethodID)(JNIEnv*, jclass, const char*, const char*);\n\n    jobject     (*CallStaticObjectMethod)(JNIEnv*, jclass, jmethodID, ...);\n    jobject     (*CallStaticObjectMethodV)(JNIEnv*, jclass, jmethodID, va_list);\n    jobject     (*CallStaticObjectMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);\n    jboolean    (*CallStaticBooleanMethod)(JNIEnv*, jclass, jmethodID, ...);\n    jboolean    (*CallStaticBooleanMethodV)(JNIEnv*, jclass, jmethodID,\n                        va_list);\n    jboolean    (*CallStaticBooleanMethodA)(JNIEnv*, jclass, jmethodID,\n                        jvalue*);\n    jbyte       (*CallStaticByteMethod)(JNIEnv*, jclass, jmethodID, ...);\n    jbyte       (*CallStaticByteMethodV)(JNIEnv*, jclass, jmethodID, va_list);\n    jbyte       (*CallStaticByteMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);\n    jchar       (*CallStaticCharMethod)(JNIEnv*, jclass, jmethodID, ...);\n    jchar       (*CallStaticCharMethodV)(JNIEnv*, jclass, jmethodID, va_list);\n    jchar       (*CallStaticCharMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);\n    jshort      (*CallStaticShortMethod)(JNIEnv*, jclass, jmethodID, ...);\n    jshort      (*CallStaticShortMethodV)(JNIEnv*, jclass, jmethodID, va_list);\n    jshort      (*CallStaticShortMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);\n    jint        (*CallStaticIntMethod)(JNIEnv*, jclass, jmethodID, ...);\n    jint        (*CallStaticIntMethodV)(JNIEnv*, jclass, jmethodID, va_list);\n    jint        (*CallStaticIntMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);\n    jlong       (*CallStaticLongMethod)(JNIEnv*, jclass, jmethodID, ...);\n    jlong       (*CallStaticLongMethodV)(JNIEnv*, jclass, jmethodID, va_list);\n    jlong       (*CallStaticLongMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);\n    jfloat      (*CallStaticFloatMethod)(JNIEnv*, jclass, jmethodID, ...);\n    jfloat      (*CallStaticFloatMethodV)(JNIEnv*, jclass, jmethodID, va_list);\n    jfloat      (*CallStaticFloatMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);\n    jdouble     (*CallStaticDoubleMethod)(JNIEnv*, jclass, jmethodID, ...);\n    jdouble     (*CallStaticDoubleMethodV)(JNIEnv*, jclass, jmethodID, va_list);\n    jdouble     (*CallStaticDoubleMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);\n    void        (*CallStaticVoidMethod)(JNIEnv*, jclass, jmethodID, ...);\n    void        (*CallStaticVoidMethodV)(JNIEnv*, jclass, jmethodID, va_list);\n    void        (*CallStaticVoidMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);\n\n    jfieldID    (*GetStaticFieldID)(JNIEnv*, jclass, const char*,\n                        const char*);\n\n    jobject     (*GetStaticObjectField)(JNIEnv*, jclass, jfieldID);\n    jboolean    (*GetStaticBooleanField)(JNIEnv*, jclass, jfieldID);\n    jbyte       (*GetStaticByteField)(JNIEnv*, jclass, jfieldID);\n    jchar       (*GetStaticCharField)(JNIEnv*, jclass, jfieldID);\n    jshort      (*GetStaticShortField)(JNIEnv*, jclass, jfieldID);\n    jint        (*GetStaticIntField)(JNIEnv*, jclass, jfieldID);\n    jlong       (*GetStaticLongField)(JNIEnv*, jclass, jfieldID);\n    jfloat      (*GetStaticFloatField)(JNIEnv*, jclass, jfieldID);\n    jdouble     (*GetStaticDoubleField)(JNIEnv*, jclass, jfieldID);\n\n    void        (*SetStaticObjectField)(JNIEnv*, jclass, jfieldID, jobject);\n    void        (*SetStaticBooleanField)(JNIEnv*, jclass, jfieldID, jboolean);\n    void        (*SetStaticByteField)(JNIEnv*, jclass, jfieldID, jbyte);\n    void        (*SetStaticCharField)(JNIEnv*, jclass, jfieldID, jchar);\n    void        (*SetStaticShortField)(JNIEnv*, jclass, jfieldID, jshort);\n    void        (*SetStaticIntField)(JNIEnv*, jclass, jfieldID, jint);\n    void        (*SetStaticLongField)(JNIEnv*, jclass, jfieldID, jlong);\n    void        (*SetStaticFloatField)(JNIEnv*, jclass, jfieldID, jfloat);\n    void        (*SetStaticDoubleField)(JNIEnv*, jclass, jfieldID, jdouble);\n\n    jstring     (*NewString)(JNIEnv*, const jchar*, jsize);\n    jsize       (*GetStringLength)(JNIEnv*, jstring);\n    const jchar* (*GetStringChars)(JNIEnv*, jstring, jboolean*);\n    void        (*ReleaseStringChars)(JNIEnv*, jstring, const jchar*);\n    jstring     (*NewStringUTF)(JNIEnv*, const char*);\n    jsize       (*GetStringUTFLength)(JNIEnv*, jstring);\n    /* JNI spec says this returns const jbyte*, but that's inconsistent */\n    const char* (*GetStringUTFChars)(JNIEnv*, jstring, jboolean*);\n    void        (*ReleaseStringUTFChars)(JNIEnv*, jstring, const char*);\n    jsize       (*GetArrayLength)(JNIEnv*, jarray);\n    jobjectArray (*NewObjectArray)(JNIEnv*, jsize, jclass, jobject);\n    jobject     (*GetObjectArrayElement)(JNIEnv*, jobjectArray, jsize);\n    void        (*SetObjectArrayElement)(JNIEnv*, jobjectArray, jsize, jobject);\n\n    jbooleanArray (*NewBooleanArray)(JNIEnv*, jsize);\n    jbyteArray    (*NewByteArray)(JNIEnv*, jsize);\n    jcharArray    (*NewCharArray)(JNIEnv*, jsize);\n    jshortArray   (*NewShortArray)(JNIEnv*, jsize);\n    jintArray     (*NewIntArray)(JNIEnv*, jsize);\n    jlongArray    (*NewLongArray)(JNIEnv*, jsize);\n    jfloatArray   (*NewFloatArray)(JNIEnv*, jsize);\n    jdoubleArray  (*NewDoubleArray)(JNIEnv*, jsize);\n\n    jboolean*   (*GetBooleanArrayElements)(JNIEnv*, jbooleanArray, jboolean*);\n    jbyte*      (*GetByteArrayElements)(JNIEnv*, jbyteArray, jboolean*);\n    jchar*      (*GetCharArrayElements)(JNIEnv*, jcharArray, jboolean*);\n    jshort*     (*GetShortArrayElements)(JNIEnv*, jshortArray, jboolean*);\n    jint*       (*GetIntArrayElements)(JNIEnv*, jintArray, jboolean*);\n    jlong*      (*GetLongArrayElements)(JNIEnv*, jlongArray, jboolean*);\n    jfloat*     (*GetFloatArrayElements)(JNIEnv*, jfloatArray, jboolean*);\n    jdouble*    (*GetDoubleArrayElements)(JNIEnv*, jdoubleArray, jboolean*);\n\n    void        (*ReleaseBooleanArrayElements)(JNIEnv*, jbooleanArray,\n                        jboolean*, jint);\n    void        (*ReleaseByteArrayElements)(JNIEnv*, jbyteArray,\n                        jbyte*, jint);\n    void        (*ReleaseCharArrayElements)(JNIEnv*, jcharArray,\n                        jchar*, jint);\n    void        (*ReleaseShortArrayElements)(JNIEnv*, jshortArray,\n                        jshort*, jint);\n    void        (*ReleaseIntArrayElements)(JNIEnv*, jintArray,\n                        jint*, jint);\n    void        (*ReleaseLongArrayElements)(JNIEnv*, jlongArray,\n                        jlong*, jint);\n    void        (*ReleaseFloatArrayElements)(JNIEnv*, jfloatArray,\n                        jfloat*, jint);\n    void        (*ReleaseDoubleArrayElements)(JNIEnv*, jdoubleArray,\n                        jdouble*, jint);\n\n    void        (*GetBooleanArrayRegion)(JNIEnv*, jbooleanArray,\n                        jsize, jsize, jboolean*);\n    void        (*GetByteArrayRegion)(JNIEnv*, jbyteArray,\n                        jsize, jsize, jbyte*);\n    void        (*GetCharArrayRegion)(JNIEnv*, jcharArray,\n                        jsize, jsize, jchar*);\n    void        (*GetShortArrayRegion)(JNIEnv*, jshortArray,\n                        jsize, jsize, jshort*);\n    void        (*GetIntArrayRegion)(JNIEnv*, jintArray,\n                        jsize, jsize, jint*);\n    void        (*GetLongArrayRegion)(JNIEnv*, jlongArray,\n                        jsize, jsize, jlong*);\n    void        (*GetFloatArrayRegion)(JNIEnv*, jfloatArray,\n                        jsize, jsize, jfloat*);\n    void        (*GetDoubleArrayRegion)(JNIEnv*, jdoubleArray,\n                        jsize, jsize, jdouble*);\n\n    /* spec shows these without const; some jni.h do, some don't */\n    void        (*SetBooleanArrayRegion)(JNIEnv*, jbooleanArray,\n                        jsize, jsize, const jboolean*);\n    void        (*SetByteArrayRegion)(JNIEnv*, jbyteArray,\n                        jsize, jsize, const jbyte*);\n    void        (*SetCharArrayRegion)(JNIEnv*, jcharArray,\n                        jsize, jsize, const jchar*);\n    void        (*SetShortArrayRegion)(JNIEnv*, jshortArray,\n                        jsize, jsize, const jshort*);\n    void        (*SetIntArrayRegion)(JNIEnv*, jintArray,\n                        jsize, jsize, const jint*);\n    void        (*SetLongArrayRegion)(JNIEnv*, jlongArray,\n                        jsize, jsize, const jlong*);\n    void        (*SetFloatArrayRegion)(JNIEnv*, jfloatArray,\n                        jsize, jsize, const jfloat*);\n    void        (*SetDoubleArrayRegion)(JNIEnv*, jdoubleArray,\n                        jsize, jsize, const jdouble*);\n\n    jint        (*RegisterNatives)(JNIEnv*, jclass, const JNINativeMethod*,\n                        jint);\n    jint        (*UnregisterNatives)(JNIEnv*, jclass);\n    jint        (*MonitorEnter)(JNIEnv*, jobject);\n    jint        (*MonitorExit)(JNIEnv*, jobject);\n    jint        (*GetJavaVM)(JNIEnv*, JavaVM**);\n\n    void        (*GetStringRegion)(JNIEnv*, jstring, jsize, jsize, jchar*);\n    void        (*GetStringUTFRegion)(JNIEnv*, jstring, jsize, jsize, char*);\n\n    void*       (*GetPrimitiveArrayCritical)(JNIEnv*, jarray, jboolean*);\n    void        (*ReleasePrimitiveArrayCritical)(JNIEnv*, jarray, void*, jint);\n\n    const jchar* (*GetStringCritical)(JNIEnv*, jstring, jboolean*);\n    void        (*ReleaseStringCritical)(JNIEnv*, jstring, const jchar*);\n\n    jweak       (*NewWeakGlobalRef)(JNIEnv*, jobject);\n    void        (*DeleteWeakGlobalRef)(JNIEnv*, jweak);\n\n    jboolean    (*ExceptionCheck)(JNIEnv*);\n\n    jobject     (*NewDirectByteBuffer)(JNIEnv*, void*, jlong);\n    void*       (*GetDirectBufferAddress)(JNIEnv*, jobject);\n    jlong       (*GetDirectBufferCapacity)(JNIEnv*, jobject);\n\n    /* added in JNI 1.6 */\n    jobjectRefType (*GetObjectRefType)(JNIEnv*, jobject);\n};\n\n/*\n * C++ object wrapper.\n *\n * This is usually overlaid on a C struct whose first element is a\n * JNINativeInterface*.  We rely somewhat on compiler behavior.\n */\nstruct _JNIEnv {\n    /* do not rename this; it does not seem to be entirely opaque */\n    const struct JNINativeInterface* functions;\n\n#if defined(__cplusplus)\n\n    jint GetVersion()\n    { return functions->GetVersion(this); }\n\n    jclass DefineClass(const char *name, jobject loader, const jbyte* buf,\n        jsize bufLen)\n    { return functions->DefineClass(this, name, loader, buf, bufLen); }\n\n    jclass FindClass(const char* name)\n    { return functions->FindClass(this, name); }\n\n    jmethodID FromReflectedMethod(jobject method)\n    { return functions->FromReflectedMethod(this, method); }\n\n    jfieldID FromReflectedField(jobject field)\n    { return functions->FromReflectedField(this, field); }\n\n    jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic)\n    { return functions->ToReflectedMethod(this, cls, methodID, isStatic); }\n\n    jclass GetSuperclass(jclass clazz)\n    { return functions->GetSuperclass(this, clazz); }\n\n    jboolean IsAssignableFrom(jclass clazz1, jclass clazz2)\n    { return functions->IsAssignableFrom(this, clazz1, clazz2); }\n\n    jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic)\n    { return functions->ToReflectedField(this, cls, fieldID, isStatic); }\n\n    jint Throw(jthrowable obj)\n    { return functions->Throw(this, obj); }\n\n    jint ThrowNew(jclass clazz, const char* message)\n    { return functions->ThrowNew(this, clazz, message); }\n\n    jthrowable ExceptionOccurred()\n    { return functions->ExceptionOccurred(this); }\n\n    void ExceptionDescribe()\n    { functions->ExceptionDescribe(this); }\n\n    void ExceptionClear()\n    { functions->ExceptionClear(this); }\n\n    void FatalError(const char* msg)\n    { functions->FatalError(this, msg); }\n\n    jint PushLocalFrame(jint capacity)\n    { return functions->PushLocalFrame(this, capacity); }\n\n    jobject PopLocalFrame(jobject result)\n    { return functions->PopLocalFrame(this, result); }\n\n    jobject NewGlobalRef(jobject obj)\n    { return functions->NewGlobalRef(this, obj); }\n\n    void DeleteGlobalRef(jobject globalRef)\n    { functions->DeleteGlobalRef(this, globalRef); }\n\n    void DeleteLocalRef(jobject localRef)\n    { functions->DeleteLocalRef(this, localRef); }\n\n    jboolean IsSameObject(jobject ref1, jobject ref2)\n    { return functions->IsSameObject(this, ref1, ref2); }\n\n    jobject NewLocalRef(jobject ref)\n    { return functions->NewLocalRef(this, ref); }\n\n    jint EnsureLocalCapacity(jint capacity)\n    { return functions->EnsureLocalCapacity(this, capacity); }\n\n    jobject AllocObject(jclass clazz)\n    { return functions->AllocObject(this, clazz); }\n\n    jobject NewObject(jclass clazz, jmethodID methodID, ...)\n    {\n        va_list args;\n        va_start(args, methodID);\n        jobject result = functions->NewObjectV(this, clazz, methodID, args);\n        va_end(args);\n        return result;\n    }\n\n    jobject NewObjectV(jclass clazz, jmethodID methodID, va_list args)\n    { return functions->NewObjectV(this, clazz, methodID, args); }\n\n    jobject NewObjectA(jclass clazz, jmethodID methodID, jvalue* args)\n    { return functions->NewObjectA(this, clazz, methodID, args); }\n\n    jclass GetObjectClass(jobject obj)\n    { return functions->GetObjectClass(this, obj); }\n\n    jboolean IsInstanceOf(jobject obj, jclass clazz)\n    { return functions->IsInstanceOf(this, obj, clazz); }\n\n    jmethodID GetMethodID(jclass clazz, const char* name, const char* sig)\n    { return functions->GetMethodID(this, clazz, name, sig); }\n\n#define CALL_TYPE_METHOD(_jtype, _jname)                                    \\\n    _jtype Call##_jname##Method(jobject obj, jmethodID methodID, ...)       \\\n    {                                                                       \\\n        _jtype result;                                                      \\\n        va_list args;                                                       \\\n        va_start(args, methodID);                                           \\\n        result = functions->Call##_jname##MethodV(this, obj, methodID,      \\\n                    args);                                                  \\\n        va_end(args);                                                       \\\n        return result;                                                      \\\n    }\n#define CALL_TYPE_METHODV(_jtype, _jname)                                   \\\n    _jtype Call##_jname##MethodV(jobject obj, jmethodID methodID,           \\\n        va_list args)                                                       \\\n    { return functions->Call##_jname##MethodV(this, obj, methodID, args); }\n#define CALL_TYPE_METHODA(_jtype, _jname)                                   \\\n    _jtype Call##_jname##MethodA(jobject obj, jmethodID methodID,           \\\n        jvalue* args)                                                       \\\n    { return functions->Call##_jname##MethodA(this, obj, methodID, args); }\n\n#define CALL_TYPE(_jtype, _jname)                                           \\\n    CALL_TYPE_METHOD(_jtype, _jname)                                        \\\n    CALL_TYPE_METHODV(_jtype, _jname)                                       \\\n    CALL_TYPE_METHODA(_jtype, _jname)\n\n    CALL_TYPE(jobject, Object)\n    CALL_TYPE(jboolean, Boolean)\n    CALL_TYPE(jbyte, Byte)\n    CALL_TYPE(jchar, Char)\n    CALL_TYPE(jshort, Short)\n    CALL_TYPE(jint, Int)\n    CALL_TYPE(jlong, Long)\n    CALL_TYPE(jfloat, Float)\n    CALL_TYPE(jdouble, Double)\n\n    void CallVoidMethod(jobject obj, jmethodID methodID, ...)\n    {\n        va_list args;\n        va_start(args, methodID);\n        functions->CallVoidMethodV(this, obj, methodID, args);\n        va_end(args);\n    }\n    void CallVoidMethodV(jobject obj, jmethodID methodID, va_list args)\n    { functions->CallVoidMethodV(this, obj, methodID, args); }\n    void CallVoidMethodA(jobject obj, jmethodID methodID, jvalue* args)\n    { functions->CallVoidMethodA(this, obj, methodID, args); }\n\n#define CALL_NONVIRT_TYPE_METHOD(_jtype, _jname)                            \\\n    _jtype CallNonvirtual##_jname##Method(jobject obj, jclass clazz,        \\\n        jmethodID methodID, ...)                                            \\\n    {                                                                       \\\n        _jtype result;                                                      \\\n        va_list args;                                                       \\\n        va_start(args, methodID);                                           \\\n        result = functions->CallNonvirtual##_jname##MethodV(this, obj,      \\\n                    clazz, methodID, args);                                 \\\n        va_end(args);                                                       \\\n        return result;                                                      \\\n    }\n#define CALL_NONVIRT_TYPE_METHODV(_jtype, _jname)                           \\\n    _jtype CallNonvirtual##_jname##MethodV(jobject obj, jclass clazz,       \\\n        jmethodID methodID, va_list args)                                   \\\n    { return functions->CallNonvirtual##_jname##MethodV(this, obj, clazz,   \\\n        methodID, args); }\n#define CALL_NONVIRT_TYPE_METHODA(_jtype, _jname)                           \\\n    _jtype CallNonvirtual##_jname##MethodA(jobject obj, jclass clazz,       \\\n        jmethodID methodID, jvalue* args)                                   \\\n    { return functions->CallNonvirtual##_jname##MethodA(this, obj, clazz,   \\\n        methodID, args); }\n\n#define CALL_NONVIRT_TYPE(_jtype, _jname)                                   \\\n    CALL_NONVIRT_TYPE_METHOD(_jtype, _jname)                                \\\n    CALL_NONVIRT_TYPE_METHODV(_jtype, _jname)                               \\\n    CALL_NONVIRT_TYPE_METHODA(_jtype, _jname)\n\n    CALL_NONVIRT_TYPE(jobject, Object)\n    CALL_NONVIRT_TYPE(jboolean, Boolean)\n    CALL_NONVIRT_TYPE(jbyte, Byte)\n    CALL_NONVIRT_TYPE(jchar, Char)\n    CALL_NONVIRT_TYPE(jshort, Short)\n    CALL_NONVIRT_TYPE(jint, Int)\n    CALL_NONVIRT_TYPE(jlong, Long)\n    CALL_NONVIRT_TYPE(jfloat, Float)\n    CALL_NONVIRT_TYPE(jdouble, Double)\n\n    void CallNonvirtualVoidMethod(jobject obj, jclass clazz,\n        jmethodID methodID, ...)\n    {\n        va_list args;\n        va_start(args, methodID);\n        functions->CallNonvirtualVoidMethodV(this, obj, clazz, methodID, args);\n        va_end(args);\n    }\n    void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,\n        jmethodID methodID, va_list args)\n    { functions->CallNonvirtualVoidMethodV(this, obj, clazz, methodID, args); }\n    void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,\n        jmethodID methodID, jvalue* args)\n    { functions->CallNonvirtualVoidMethodA(this, obj, clazz, methodID, args); }\n\n    jfieldID GetFieldID(jclass clazz, const char* name, const char* sig)\n    { return functions->GetFieldID(this, clazz, name, sig); }\n\n    jobject GetObjectField(jobject obj, jfieldID fieldID)\n    { return functions->GetObjectField(this, obj, fieldID); }\n    jboolean GetBooleanField(jobject obj, jfieldID fieldID)\n    { return functions->GetBooleanField(this, obj, fieldID); }\n    jbyte GetByteField(jobject obj, jfieldID fieldID)\n    { return functions->GetByteField(this, obj, fieldID); }\n    jchar GetCharField(jobject obj, jfieldID fieldID)\n    { return functions->GetCharField(this, obj, fieldID); }\n    jshort GetShortField(jobject obj, jfieldID fieldID)\n    { return functions->GetShortField(this, obj, fieldID); }\n    jint GetIntField(jobject obj, jfieldID fieldID)\n    { return functions->GetIntField(this, obj, fieldID); }\n    jlong GetLongField(jobject obj, jfieldID fieldID)\n    { return functions->GetLongField(this, obj, fieldID); }\n    jfloat GetFloatField(jobject obj, jfieldID fieldID)\n    { return functions->GetFloatField(this, obj, fieldID); }\n    jdouble GetDoubleField(jobject obj, jfieldID fieldID)\n    { return functions->GetDoubleField(this, obj, fieldID); }\n\n    void SetObjectField(jobject obj, jfieldID fieldID, jobject value)\n    { functions->SetObjectField(this, obj, fieldID, value); }\n    void SetBooleanField(jobject obj, jfieldID fieldID, jboolean value)\n    { functions->SetBooleanField(this, obj, fieldID, value); }\n    void SetByteField(jobject obj, jfieldID fieldID, jbyte value)\n    { functions->SetByteField(this, obj, fieldID, value); }\n    void SetCharField(jobject obj, jfieldID fieldID, jchar value)\n    { functions->SetCharField(this, obj, fieldID, value); }\n    void SetShortField(jobject obj, jfieldID fieldID, jshort value)\n    { functions->SetShortField(this, obj, fieldID, value); }\n    void SetIntField(jobject obj, jfieldID fieldID, jint value)\n    { functions->SetIntField(this, obj, fieldID, value); }\n    void SetLongField(jobject obj, jfieldID fieldID, jlong value)\n    { functions->SetLongField(this, obj, fieldID, value); }\n    void SetFloatField(jobject obj, jfieldID fieldID, jfloat value)\n    { functions->SetFloatField(this, obj, fieldID, value); }\n    void SetDoubleField(jobject obj, jfieldID fieldID, jdouble value)\n    { functions->SetDoubleField(this, obj, fieldID, value); }\n\n    jmethodID GetStaticMethodID(jclass clazz, const char* name, const char* sig)\n    { return functions->GetStaticMethodID(this, clazz, name, sig); }\n\n#define CALL_STATIC_TYPE_METHOD(_jtype, _jname)                             \\\n    _jtype CallStatic##_jname##Method(jclass clazz, jmethodID methodID,     \\\n        ...)                                                                \\\n    {                                                                       \\\n        _jtype result;                                                      \\\n        va_list args;                                                       \\\n        va_start(args, methodID);                                           \\\n        result = functions->CallStatic##_jname##MethodV(this, clazz,        \\\n                    methodID, args);                                        \\\n        va_end(args);                                                       \\\n        return result;                                                      \\\n    }\n#define CALL_STATIC_TYPE_METHODV(_jtype, _jname)                            \\\n    _jtype CallStatic##_jname##MethodV(jclass clazz, jmethodID methodID,    \\\n        va_list args)                                                       \\\n    { return functions->CallStatic##_jname##MethodV(this, clazz, methodID,  \\\n        args); }\n#define CALL_STATIC_TYPE_METHODA(_jtype, _jname)                            \\\n    _jtype CallStatic##_jname##MethodA(jclass clazz, jmethodID methodID,    \\\n        jvalue* args)                                                       \\\n    { return functions->CallStatic##_jname##MethodA(this, clazz, methodID,  \\\n        args); }\n\n#define CALL_STATIC_TYPE(_jtype, _jname)                                    \\\n    CALL_STATIC_TYPE_METHOD(_jtype, _jname)                                 \\\n    CALL_STATIC_TYPE_METHODV(_jtype, _jname)                                \\\n    CALL_STATIC_TYPE_METHODA(_jtype, _jname)\n\n    CALL_STATIC_TYPE(jobject, Object)\n    CALL_STATIC_TYPE(jboolean, Boolean)\n    CALL_STATIC_TYPE(jbyte, Byte)\n    CALL_STATIC_TYPE(jchar, Char)\n    CALL_STATIC_TYPE(jshort, Short)\n    CALL_STATIC_TYPE(jint, Int)\n    CALL_STATIC_TYPE(jlong, Long)\n    CALL_STATIC_TYPE(jfloat, Float)\n    CALL_STATIC_TYPE(jdouble, Double)\n\n    void CallStaticVoidMethod(jclass clazz, jmethodID methodID, ...)\n    {\n        va_list args;\n        va_start(args, methodID);\n        functions->CallStaticVoidMethodV(this, clazz, methodID, args);\n        va_end(args);\n    }\n    void CallStaticVoidMethodV(jclass clazz, jmethodID methodID, va_list args)\n    { functions->CallStaticVoidMethodV(this, clazz, methodID, args); }\n    void CallStaticVoidMethodA(jclass clazz, jmethodID methodID, jvalue* args)\n    { functions->CallStaticVoidMethodA(this, clazz, methodID, args); }\n\n    jfieldID GetStaticFieldID(jclass clazz, const char* name, const char* sig)\n    { return functions->GetStaticFieldID(this, clazz, name, sig); }\n\n    jobject GetStaticObjectField(jclass clazz, jfieldID fieldID)\n    { return functions->GetStaticObjectField(this, clazz, fieldID); }\n    jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID)\n    { return functions->GetStaticBooleanField(this, clazz, fieldID); }\n    jbyte GetStaticByteField(jclass clazz, jfieldID fieldID)\n    { return functions->GetStaticByteField(this, clazz, fieldID); }\n    jchar GetStaticCharField(jclass clazz, jfieldID fieldID)\n    { return functions->GetStaticCharField(this, clazz, fieldID); }\n    jshort GetStaticShortField(jclass clazz, jfieldID fieldID)\n    { return functions->GetStaticShortField(this, clazz, fieldID); }\n    jint GetStaticIntField(jclass clazz, jfieldID fieldID)\n    { return functions->GetStaticIntField(this, clazz, fieldID); }\n    jlong GetStaticLongField(jclass clazz, jfieldID fieldID)\n    { return functions->GetStaticLongField(this, clazz, fieldID); }\n    jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID)\n    { return functions->GetStaticFloatField(this, clazz, fieldID); }\n    jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID)\n    { return functions->GetStaticDoubleField(this, clazz, fieldID); }\n\n    void SetStaticObjectField(jclass clazz, jfieldID fieldID, jobject value)\n    { functions->SetStaticObjectField(this, clazz, fieldID, value); }\n    void SetStaticBooleanField(jclass clazz, jfieldID fieldID, jboolean value)\n    { functions->SetStaticBooleanField(this, clazz, fieldID, value); }\n    void SetStaticByteField(jclass clazz, jfieldID fieldID, jbyte value)\n    { functions->SetStaticByteField(this, clazz, fieldID, value); }\n    void SetStaticCharField(jclass clazz, jfieldID fieldID, jchar value)\n    { functions->SetStaticCharField(this, clazz, fieldID, value); }\n    void SetStaticShortField(jclass clazz, jfieldID fieldID, jshort value)\n    { functions->SetStaticShortField(this, clazz, fieldID, value); }\n    void SetStaticIntField(jclass clazz, jfieldID fieldID, jint value)\n    { functions->SetStaticIntField(this, clazz, fieldID, value); }\n    void SetStaticLongField(jclass clazz, jfieldID fieldID, jlong value)\n    { functions->SetStaticLongField(this, clazz, fieldID, value); }\n    void SetStaticFloatField(jclass clazz, jfieldID fieldID, jfloat value)\n    { functions->SetStaticFloatField(this, clazz, fieldID, value); }\n    void SetStaticDoubleField(jclass clazz, jfieldID fieldID, jdouble value)\n    { functions->SetStaticDoubleField(this, clazz, fieldID, value); }\n\n    jstring NewString(const jchar* unicodeChars, jsize len)\n    { return functions->NewString(this, unicodeChars, len); }\n\n    jsize GetStringLength(jstring string)\n    { return functions->GetStringLength(this, string); }\n\n    const jchar* GetStringChars(jstring string, jboolean* isCopy)\n    { return functions->GetStringChars(this, string, isCopy); }\n\n    void ReleaseStringChars(jstring string, const jchar* chars)\n    { functions->ReleaseStringChars(this, string, chars); }\n\n    jstring NewStringUTF(const char* bytes)\n    { return functions->NewStringUTF(this, bytes); }\n\n    jsize GetStringUTFLength(jstring string)\n    { return functions->GetStringUTFLength(this, string); }\n\n    const char* GetStringUTFChars(jstring string, jboolean* isCopy)\n    { return functions->GetStringUTFChars(this, string, isCopy); }\n\n    void ReleaseStringUTFChars(jstring string, const char* utf)\n    { functions->ReleaseStringUTFChars(this, string, utf); }\n\n    jsize GetArrayLength(jarray array)\n    { return functions->GetArrayLength(this, array); }\n\n    jobjectArray NewObjectArray(jsize length, jclass elementClass,\n        jobject initialElement)\n    { return functions->NewObjectArray(this, length, elementClass,\n        initialElement); }\n\n    jobject GetObjectArrayElement(jobjectArray array, jsize index)\n    { return functions->GetObjectArrayElement(this, array, index); }\n\n    void SetObjectArrayElement(jobjectArray array, jsize index, jobject value)\n    { functions->SetObjectArrayElement(this, array, index, value); }\n\n    jbooleanArray NewBooleanArray(jsize length)\n    { return functions->NewBooleanArray(this, length); }\n    jbyteArray NewByteArray(jsize length)\n    { return functions->NewByteArray(this, length); }\n    jcharArray NewCharArray(jsize length)\n    { return functions->NewCharArray(this, length); }\n    jshortArray NewShortArray(jsize length)\n    { return functions->NewShortArray(this, length); }\n    jintArray NewIntArray(jsize length)\n    { return functions->NewIntArray(this, length); }\n    jlongArray NewLongArray(jsize length)\n    { return functions->NewLongArray(this, length); }\n    jfloatArray NewFloatArray(jsize length)\n    { return functions->NewFloatArray(this, length); }\n    jdoubleArray NewDoubleArray(jsize length)\n    { return functions->NewDoubleArray(this, length); }\n\n    jboolean* GetBooleanArrayElements(jbooleanArray array, jboolean* isCopy)\n    { return functions->GetBooleanArrayElements(this, array, isCopy); }\n    jbyte* GetByteArrayElements(jbyteArray array, jboolean* isCopy)\n    { return functions->GetByteArrayElements(this, array, isCopy); }\n    jchar* GetCharArrayElements(jcharArray array, jboolean* isCopy)\n    { return functions->GetCharArrayElements(this, array, isCopy); }\n    jshort* GetShortArrayElements(jshortArray array, jboolean* isCopy)\n    { return functions->GetShortArrayElements(this, array, isCopy); }\n    jint* GetIntArrayElements(jintArray array, jboolean* isCopy)\n    { return functions->GetIntArrayElements(this, array, isCopy); }\n    jlong* GetLongArrayElements(jlongArray array, jboolean* isCopy)\n    { return functions->GetLongArrayElements(this, array, isCopy); }\n    jfloat* GetFloatArrayElements(jfloatArray array, jboolean* isCopy)\n    { return functions->GetFloatArrayElements(this, array, isCopy); }\n    jdouble* GetDoubleArrayElements(jdoubleArray array, jboolean* isCopy)\n    { return functions->GetDoubleArrayElements(this, array, isCopy); }\n\n    void ReleaseBooleanArrayElements(jbooleanArray array, jboolean* elems,\n        jint mode)\n    { functions->ReleaseBooleanArrayElements(this, array, elems, mode); }\n    void ReleaseByteArrayElements(jbyteArray array, jbyte* elems,\n        jint mode)\n    { functions->ReleaseByteArrayElements(this, array, elems, mode); }\n    void ReleaseCharArrayElements(jcharArray array, jchar* elems,\n        jint mode)\n    { functions->ReleaseCharArrayElements(this, array, elems, mode); }\n    void ReleaseShortArrayElements(jshortArray array, jshort* elems,\n        jint mode)\n    { functions->ReleaseShortArrayElements(this, array, elems, mode); }\n    void ReleaseIntArrayElements(jintArray array, jint* elems,\n        jint mode)\n    { functions->ReleaseIntArrayElements(this, array, elems, mode); }\n    void ReleaseLongArrayElements(jlongArray array, jlong* elems,\n        jint mode)\n    { functions->ReleaseLongArrayElements(this, array, elems, mode); }\n    void ReleaseFloatArrayElements(jfloatArray array, jfloat* elems,\n        jint mode)\n    { functions->ReleaseFloatArrayElements(this, array, elems, mode); }\n    void ReleaseDoubleArrayElements(jdoubleArray array, jdouble* elems,\n        jint mode)\n    { functions->ReleaseDoubleArrayElements(this, array, elems, mode); }\n\n    void GetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,\n        jboolean* buf)\n    { functions->GetBooleanArrayRegion(this, array, start, len, buf); }\n    void GetByteArrayRegion(jbyteArray array, jsize start, jsize len,\n        jbyte* buf)\n    { functions->GetByteArrayRegion(this, array, start, len, buf); }\n    void GetCharArrayRegion(jcharArray array, jsize start, jsize len,\n        jchar* buf)\n    { functions->GetCharArrayRegion(this, array, start, len, buf); }\n    void GetShortArrayRegion(jshortArray array, jsize start, jsize len,\n        jshort* buf)\n    { functions->GetShortArrayRegion(this, array, start, len, buf); }\n    void GetIntArrayRegion(jintArray array, jsize start, jsize len,\n        jint* buf)\n    { functions->GetIntArrayRegion(this, array, start, len, buf); }\n    void GetLongArrayRegion(jlongArray array, jsize start, jsize len,\n        jlong* buf)\n    { functions->GetLongArrayRegion(this, array, start, len, buf); }\n    void GetFloatArrayRegion(jfloatArray array, jsize start, jsize len,\n        jfloat* buf)\n    { functions->GetFloatArrayRegion(this, array, start, len, buf); }\n    void GetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,\n        jdouble* buf)\n    { functions->GetDoubleArrayRegion(this, array, start, len, buf); }\n\n    void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,\n        const jboolean* buf)\n    { functions->SetBooleanArrayRegion(this, array, start, len, buf); }\n    void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,\n        const jbyte* buf)\n    { functions->SetByteArrayRegion(this, array, start, len, buf); }\n    void SetCharArrayRegion(jcharArray array, jsize start, jsize len,\n        const jchar* buf)\n    { functions->SetCharArrayRegion(this, array, start, len, buf); }\n    void SetShortArrayRegion(jshortArray array, jsize start, jsize len,\n        const jshort* buf)\n    { functions->SetShortArrayRegion(this, array, start, len, buf); }\n    void SetIntArrayRegion(jintArray array, jsize start, jsize len,\n        const jint* buf)\n    { functions->SetIntArrayRegion(this, array, start, len, buf); }\n    void SetLongArrayRegion(jlongArray array, jsize start, jsize len,\n        const jlong* buf)\n    { functions->SetLongArrayRegion(this, array, start, len, buf); }\n    void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,\n        const jfloat* buf)\n    { functions->SetFloatArrayRegion(this, array, start, len, buf); }\n    void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,\n        const jdouble* buf)\n    { functions->SetDoubleArrayRegion(this, array, start, len, buf); }\n\n    jint RegisterNatives(jclass clazz, const JNINativeMethod* methods,\n        jint nMethods)\n    { return functions->RegisterNatives(this, clazz, methods, nMethods); }\n\n    jint UnregisterNatives(jclass clazz)\n    { return functions->UnregisterNatives(this, clazz); }\n\n    jint MonitorEnter(jobject obj)\n    { return functions->MonitorEnter(this, obj); }\n\n    jint MonitorExit(jobject obj)\n    { return functions->MonitorExit(this, obj); }\n\n    jint GetJavaVM(JavaVM** vm)\n    { return functions->GetJavaVM(this, vm); }\n\n    void GetStringRegion(jstring str, jsize start, jsize len, jchar* buf)\n    { functions->GetStringRegion(this, str, start, len, buf); }\n\n    void GetStringUTFRegion(jstring str, jsize start, jsize len, char* buf)\n    { return functions->GetStringUTFRegion(this, str, start, len, buf); }\n\n    void* GetPrimitiveArrayCritical(jarray array, jboolean* isCopy)\n    { return functions->GetPrimitiveArrayCritical(this, array, isCopy); }\n\n    void ReleasePrimitiveArrayCritical(jarray array, void* carray, jint mode)\n    { functions->ReleasePrimitiveArrayCritical(this, array, carray, mode); }\n\n    const jchar* GetStringCritical(jstring string, jboolean* isCopy)\n    { return functions->GetStringCritical(this, string, isCopy); }\n\n    void ReleaseStringCritical(jstring string, const jchar* carray)\n    { functions->ReleaseStringCritical(this, string, carray); }\n\n    jweak NewWeakGlobalRef(jobject obj)\n    { return functions->NewWeakGlobalRef(this, obj); }\n\n    void DeleteWeakGlobalRef(jweak obj)\n    { functions->DeleteWeakGlobalRef(this, obj); }\n\n    jboolean ExceptionCheck()\n    { return functions->ExceptionCheck(this); }\n\n    jobject NewDirectByteBuffer(void* address, jlong capacity)\n    { return functions->NewDirectByteBuffer(this, address, capacity); }\n\n    void* GetDirectBufferAddress(jobject buf)\n    { return functions->GetDirectBufferAddress(this, buf); }\n\n    jlong GetDirectBufferCapacity(jobject buf)\n    { return functions->GetDirectBufferCapacity(this, buf); }\n\n    /* added in JNI 1.6 */\n    jobjectRefType GetObjectRefType(jobject obj)\n    { return functions->GetObjectRefType(this, obj); }\n#endif /*__cplusplus*/\n};\n\n\n/*\n * JNI invocation interface.\n */\nstruct JNIInvokeInterface {\n    void*       reserved0;\n    void*       reserved1;\n    void*       reserved2;\n\n    jint        (*DestroyJavaVM)(JavaVM*);\n    jint        (*AttachCurrentThread)(JavaVM*, JNIEnv**, void*);\n    jint        (*DetachCurrentThread)(JavaVM*);\n    jint        (*GetEnv)(JavaVM*, void**, jint);\n    jint        (*AttachCurrentThreadAsDaemon)(JavaVM*, JNIEnv**, void*);\n};\n\n/*\n * C++ version.\n */\nstruct _JavaVM {\n    const struct JNIInvokeInterface* functions;\n\n#if defined(__cplusplus)\n    jint DestroyJavaVM()\n    { return functions->DestroyJavaVM(this); }\n    jint AttachCurrentThread(JNIEnv** p_env, void* thr_args)\n    { return functions->AttachCurrentThread(this, p_env, thr_args); }\n    jint DetachCurrentThread()\n    { return functions->DetachCurrentThread(this); }\n    jint GetEnv(void** env, jint version)\n    { return functions->GetEnv(this, env, version); }\n    jint AttachCurrentThreadAsDaemon(JNIEnv** p_env, void* thr_args)\n    { return functions->AttachCurrentThreadAsDaemon(this, p_env, thr_args); }\n#endif /*__cplusplus*/\n};\n\nstruct JavaVMAttachArgs {\n    jint        version;    /* must be >= JNI_VERSION_1_2 */\n    const char* name;       /* NULL or name of thread as modified UTF-8 str */\n    jobject     group;      /* global ref of a ThreadGroup object, or NULL */\n};\ntypedef struct JavaVMAttachArgs JavaVMAttachArgs;\n\n/*\n * JNI 1.2+ initialization.  (As of 1.6, the pre-1.2 structures are no\n * longer supported.)\n */\ntypedef struct JavaVMOption {\n    const char* optionString;\n    void*       extraInfo;\n} JavaVMOption;\n\ntypedef struct JavaVMInitArgs {\n    jint        version;    /* use JNI_VERSION_1_2 or later */\n\n    jint        nOptions;\n    JavaVMOption* options;\n    jboolean    ignoreUnrecognized;\n} JavaVMInitArgs;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n/*\n * VM initialization functions.\n *\n * Note these are the only symbols exported for JNI by the VM.\n */\njint JNI_GetDefaultJavaVMInitArgs(void*);\njint JNI_CreateJavaVM(JavaVM**, JNIEnv**, void*);\njint JNI_GetCreatedJavaVMs(JavaVM**, jsize, jsize*);\n\n#define JNIIMPORT\n#define JNIEXPORT  __attribute__ ((visibility (\"default\")))\n#define JNICALL\n\n/*\n * Prototypes for functions exported by loadable shared libs.  These are\n * called by JNI, not provided by JNI.\n */\nJNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved);\nJNIEXPORT void JNI_OnUnload(JavaVM* vm, void* reserved);\n\n#ifdef __cplusplus\n}\n#endif\n\n\n/*\n * Manifest constants.\n */\n#define JNI_FALSE   0\n#define JNI_TRUE    1\n\n#define JNI_VERSION_1_1 0x00010001\n#define JNI_VERSION_1_2 0x00010002\n#define JNI_VERSION_1_4 0x00010004\n#define JNI_VERSION_1_6 0x00010006\n\n#define JNI_OK          (0)         /* no error */\n#define JNI_ERR         (-1)        /* generic error */\n#define JNI_EDETACHED   (-2)        /* thread detached from the VM */\n#define JNI_EVERSION    (-3)        /* JNI version error */\n\n#define JNI_COMMIT      1           /* copy content, do not free buffer */\n#define JNI_ABORT       2           /* free buffer w/o copying back */\n\n#endif  /* JNI_H_ */\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/yogajni/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := yoga\n\nLOCAL_SRC_FILES := \\\n  jni/YGJNI.cpp\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/jni\n\nLOCAL_CFLAGS += -Wall -Werror -fvisibility=hidden -fexceptions -frtti -O3\nCXX11_FLAGS := -std=c++11\nLOCAL_CFLAGS += $(CXX11_FLAGS)\nLOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)\n\nLOCAL_LDLIBS += -landroid -llog\nLOCAL_STATIC_LIBRARIES := libyogacore\nLOCAL_SHARED_LIBRARIES := libfb\n\ninclude $(BUILD_SHARED_LIBRARY)\n\n$(call import-module,yoga)\n$(call import-module,fb)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/yogajni/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\n# This target is only used in open source\nif IS_OSS_BUILD:\n  fb_xplat_cxx_library(\n    name = 'jni',\n    soname = 'libyoga.$(ext)',\n    srcs = glob(['jni/*.cpp']),\n    header_namespace = '',\n    compiler_flags = [\n      '-fno-omit-frame-pointer',\n      '-fexceptions',\n      '-Wall',\n      '-Werror',\n      '-O3',\n      '-std=c++11',\n    ],\n    deps = [\n      '//ReactCommon/yoga:yoga',\n      FBJNI_TARGET,\n    ],\n    visibility = ['PUBLIC'],\n  )\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNI.cpp",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <fb/fbjni.h>\n#include <yoga/YGNode.h>\n#include <yoga/Yoga.h>\n#include <iostream>\n\nusing namespace facebook::jni;\nusing namespace std;\n\nstruct JYogaNode : public JavaClass<JYogaNode> {\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/yoga/YogaNode;\";\n};\n\nstatic inline weak_ref<JYogaNode> *YGNodeJobject(YGNodeRef node) {\n  return reinterpret_cast<weak_ref<JYogaNode>*>(node->getContext());\n}\n\nstatic void YGTransferLayoutDirection(YGNodeRef node, alias_ref<jobject> javaNode) {\n  static auto layoutDirectionField = javaNode->getClass()->getField<jint>(\"mLayoutDirection\");\n  javaNode->setFieldValue(layoutDirectionField, static_cast<jint>(YGNodeLayoutGetDirection(node)));\n}\n\nstatic void YGTransferLayoutOutputsRecursive(YGNodeRef root) {\n  if (root->getHasNewLayout()) {\n    if (auto obj = YGNodeJobject(root)->lockLocal()) {\n      static auto widthField = obj->getClass()->getField<jfloat>(\"mWidth\");\n      static auto heightField = obj->getClass()->getField<jfloat>(\"mHeight\");\n      static auto leftField = obj->getClass()->getField<jfloat>(\"mLeft\");\n      static auto topField = obj->getClass()->getField<jfloat>(\"mTop\");\n\n      static auto marginLeftField = obj->getClass()->getField<jfloat>(\"mMarginLeft\");\n      static auto marginTopField = obj->getClass()->getField<jfloat>(\"mMarginTop\");\n      static auto marginRightField = obj->getClass()->getField<jfloat>(\"mMarginRight\");\n      static auto marginBottomField = obj->getClass()->getField<jfloat>(\"mMarginBottom\");\n\n      static auto paddingLeftField = obj->getClass()->getField<jfloat>(\"mPaddingLeft\");\n      static auto paddingTopField = obj->getClass()->getField<jfloat>(\"mPaddingTop\");\n      static auto paddingRightField = obj->getClass()->getField<jfloat>(\"mPaddingRight\");\n      static auto paddingBottomField = obj->getClass()->getField<jfloat>(\"mPaddingBottom\");\n\n      static auto borderLeftField = obj->getClass()->getField<jfloat>(\"mBorderLeft\");\n      static auto borderTopField = obj->getClass()->getField<jfloat>(\"mBorderTop\");\n      static auto borderRightField = obj->getClass()->getField<jfloat>(\"mBorderRight\");\n      static auto borderBottomField = obj->getClass()->getField<jfloat>(\"mBorderBottom\");\n\n      static auto edgeSetFlagField = obj->getClass()->getField<jint>(\"mEdgeSetFlag\");\n      static auto hasNewLayoutField = obj->getClass()->getField<jboolean>(\"mHasNewLayout\");\n\n      /* Those flags needs be in sync with YogaNode.java */\n      const int MARGIN = 1;\n      const int PADDING = 2;\n      const int BORDER = 4;\n\n      int hasEdgeSetFlag = (int) obj->getFieldValue(edgeSetFlagField);\n\n      obj->setFieldValue(widthField, YGNodeLayoutGetWidth(root));\n      obj->setFieldValue(heightField, YGNodeLayoutGetHeight(root));\n      obj->setFieldValue(leftField, YGNodeLayoutGetLeft(root));\n      obj->setFieldValue(topField, YGNodeLayoutGetTop(root));\n\n      if ((hasEdgeSetFlag & MARGIN) == MARGIN) {\n        obj->setFieldValue(marginLeftField, YGNodeLayoutGetMargin(root, YGEdgeLeft));\n        obj->setFieldValue(marginTopField, YGNodeLayoutGetMargin(root, YGEdgeTop));\n        obj->setFieldValue(marginRightField, YGNodeLayoutGetMargin(root, YGEdgeRight));\n        obj->setFieldValue(marginBottomField, YGNodeLayoutGetMargin(root, YGEdgeBottom));\n      }\n\n      if ((hasEdgeSetFlag & PADDING) == PADDING) {\n        obj->setFieldValue(paddingLeftField, YGNodeLayoutGetPadding(root, YGEdgeLeft));\n        obj->setFieldValue(paddingTopField, YGNodeLayoutGetPadding(root, YGEdgeTop));\n        obj->setFieldValue(paddingRightField, YGNodeLayoutGetPadding(root, YGEdgeRight));\n        obj->setFieldValue(paddingBottomField, YGNodeLayoutGetPadding(root, YGEdgeBottom));\n      }\n\n      if ((hasEdgeSetFlag & BORDER) == BORDER) {\n        obj->setFieldValue(borderLeftField, YGNodeLayoutGetBorder(root, YGEdgeLeft));\n        obj->setFieldValue(borderTopField, YGNodeLayoutGetBorder(root, YGEdgeTop));\n        obj->setFieldValue(borderRightField, YGNodeLayoutGetBorder(root, YGEdgeRight));\n        obj->setFieldValue(borderBottomField, YGNodeLayoutGetBorder(root, YGEdgeBottom));\n      }\n\n      obj->setFieldValue<jboolean>(hasNewLayoutField, true);\n      YGTransferLayoutDirection(root, obj);\n      root->setHasNewLayout(false);\n\n      for (uint32_t i = 0; i < YGNodeGetChildCount(root); i++) {\n        YGTransferLayoutOutputsRecursive(YGNodeGetChild(root, i));\n      }\n    } else {\n      YGLog(root, YGLogLevelError, \"Java YGNode was GCed during layout calculation\\n\");\n    }\n  }\n}\n\nstatic void YGPrint(YGNodeRef node) {\n  if (auto obj = YGNodeJobject(node)->lockLocal()) {\n    cout << obj->toString() << endl;\n  } else {\n    YGLog(node, YGLogLevelError, \"Java YGNode was GCed during layout calculation\\n\");\n  }\n}\n\nstatic float YGJNIBaselineFunc(YGNodeRef node, float width, float height) {\n  if (auto obj = YGNodeJobject(node)->lockLocal()) {\n    static auto baselineFunc = findClassStatic(\"com/facebook/yoga/YogaNode\")\n                                   ->getMethod<jfloat(jfloat, jfloat)>(\"baseline\");\n    return baselineFunc(obj, width, height);\n  } else {\n    return height;\n  }\n}\n\nstatic YGSize YGJNIMeasureFunc(YGNodeRef node,\n                               float width,\n                               YGMeasureMode widthMode,\n                               float height,\n                               YGMeasureMode heightMode) {\n  if (auto obj = YGNodeJobject(node)->lockLocal()) {\n    static auto measureFunc = findClassStatic(\"com/facebook/yoga/YogaNode\")\n                                  ->getMethod<jlong(jfloat, jint, jfloat, jint)>(\"measure\");\n\n    YGTransferLayoutDirection(node, obj);\n    const auto measureResult = measureFunc(obj, width, widthMode, height, heightMode);\n\n    static_assert(sizeof(measureResult) == 8,\n                  \"Expected measureResult to be 8 bytes, or two 32 bit ints\");\n\n    int32_t wBits = 0xFFFFFFFF & (measureResult >> 32);\n    int32_t hBits = 0xFFFFFFFF & measureResult;\n\n    const float *measuredWidth = reinterpret_cast<float *>(&wBits);\n    const float *measuredHeight = reinterpret_cast<float *>(&hBits);\n\n    return YGSize{*measuredWidth, *measuredHeight};\n  } else {\n    YGLog(node, YGLogLevelError, \"Java YGNode was GCed during layout calculation\\n\");\n    return YGSize{\n        widthMode == YGMeasureModeUndefined ? 0 : width,\n        heightMode == YGMeasureModeUndefined ? 0 : height,\n    };\n  }\n}\n\nstruct JYogaLogLevel : public JavaClass<JYogaLogLevel> {\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/yoga/YogaLogLevel;\";\n};\n\nstatic int YGJNILogFunc(const YGConfigRef config,\n                        const YGNodeRef node,\n                        YGLogLevel level,\n                        const char *format,\n                        va_list args) {\n  char buffer[256];\n  int result = vsnprintf(buffer, sizeof(buffer), format, args);\n\n  static auto logFunc =\n      findClassStatic(\"com/facebook/yoga/YogaLogger\")\n          ->getMethod<void(local_ref<JYogaNode>, local_ref<JYogaLogLevel>, jstring)>(\"log\");\n\n  static auto logLevelFromInt =\n      JYogaLogLevel::javaClassStatic()->getStaticMethod<JYogaLogLevel::javaobject(jint)>(\"fromInt\");\n\n  if (auto obj = YGNodeJobject(node)->lockLocal()) {\n    auto jlogger = reinterpret_cast<global_ref<jobject> *>(YGConfigGetContext(config));\n    logFunc(jlogger->get(),\n            obj,\n            logLevelFromInt(JYogaLogLevel::javaClassStatic(), static_cast<jint>(level)),\n            Environment::current()->NewStringUTF(buffer));\n  }\n\n  return result;\n}\n\nstatic inline YGNodeRef _jlong2YGNodeRef(jlong addr) {\n  return reinterpret_cast<YGNodeRef>(static_cast<intptr_t>(addr));\n}\n\nstatic inline YGConfigRef _jlong2YGConfigRef(jlong addr) {\n  return reinterpret_cast<YGConfigRef>(static_cast<intptr_t>(addr));\n}\n\njlong jni_YGNodeNew(alias_ref<jobject> thiz) {\n  const YGNodeRef node = YGNodeNew();\n  node->setContext(new weak_ref<jobject>(make_weak(thiz)));\n  // YGNodeSetContext(node, new weak_ref<jobject>(make_weak(thiz)));\n  node->setPrintFunc(YGPrint);\n  // YGNodeSetPrintFunc(node, YGPrint);\n  return reinterpret_cast<jlong>(node);\n}\n\njlong jni_YGNodeNewWithConfig(alias_ref<jobject> thiz, jlong configPointer) {\n  const YGNodeRef node = YGNodeNewWithConfig(_jlong2YGConfigRef(configPointer));\n  node->setContext(new weak_ref<jobject>(make_weak(thiz)));\n  node->setPrintFunc(YGPrint);\n  return reinterpret_cast<jlong>(node);\n}\n\nvoid jni_YGNodeFree(alias_ref<jobject> thiz, jlong nativePointer) {\n  const YGNodeRef node = _jlong2YGNodeRef(nativePointer);\n  delete YGNodeJobject(node);\n  YGNodeFree(node);\n}\n\nvoid jni_YGNodeReset(alias_ref<jobject> thiz, jlong nativePointer) {\n  const YGNodeRef node = _jlong2YGNodeRef(nativePointer);\n  void* context = node->getContext();\n  YGNodeReset(node);\n  node->setContext(context);\n  node->setPrintFunc(YGPrint);\n}\n\nvoid jni_YGNodePrint(alias_ref<jobject> thiz, jlong nativePointer) {\n  const YGNodeRef node = _jlong2YGNodeRef(nativePointer);\n  YGNodePrint(node,\n              (YGPrintOptions)(YGPrintOptionsStyle | YGPrintOptionsLayout |\n                               YGPrintOptionsChildren));\n}\n\nvoid jni_YGNodeInsertChild(alias_ref<jobject>, jlong nativePointer, jlong childPointer, jint index) {\n  YGNodeInsertChild(_jlong2YGNodeRef(nativePointer), _jlong2YGNodeRef(childPointer), index);\n}\n\nvoid jni_YGNodeRemoveChild(alias_ref<jobject>, jlong nativePointer, jlong childPointer) {\n  YGNodeRemoveChild(_jlong2YGNodeRef(nativePointer), _jlong2YGNodeRef(childPointer));\n}\n\nvoid jni_YGNodeCalculateLayout(alias_ref<jobject>,\n                               jlong nativePointer,\n                               jfloat width,\n                               jfloat height) {\n  const YGNodeRef root = _jlong2YGNodeRef(nativePointer);\n  YGNodeCalculateLayout(root,\n                        static_cast<float>(width),\n                        static_cast<float>(height),\n                        YGNodeStyleGetDirection(_jlong2YGNodeRef(nativePointer)));\n  YGTransferLayoutOutputsRecursive(root);\n}\n\nvoid jni_YGNodeMarkDirty(alias_ref<jobject>, jlong nativePointer) {\n  YGNodeMarkDirty(_jlong2YGNodeRef(nativePointer));\n}\n\njboolean jni_YGNodeIsDirty(alias_ref<jobject>, jlong nativePointer) {\n  return (jboolean)_jlong2YGNodeRef(nativePointer)->isDirty();\n}\n\nvoid jni_YGNodeSetHasMeasureFunc(alias_ref<jobject>, jlong nativePointer, jboolean hasMeasureFunc) {\n  _jlong2YGNodeRef(nativePointer)\n      ->setMeasureFunc(hasMeasureFunc ? YGJNIMeasureFunc : nullptr);\n}\n\nvoid jni_YGNodeSetHasBaselineFunc(alias_ref<jobject>,\n                                  jlong nativePointer,\n                                  jboolean hasBaselineFunc) {\n  _jlong2YGNodeRef(nativePointer)\n      ->setBaseLineFunc(hasBaselineFunc ? YGJNIBaselineFunc : nullptr);\n}\n\nvoid jni_YGNodeCopyStyle(alias_ref<jobject>, jlong dstNativePointer, jlong srcNativePointer) {\n  YGNodeCopyStyle(_jlong2YGNodeRef(dstNativePointer), _jlong2YGNodeRef(srcNativePointer));\n}\n\nstruct JYogaValue : public JavaClass<JYogaValue> {\n  constexpr static auto kJavaDescriptor = \"Lcom/facebook/yoga/YogaValue;\";\n\n  static local_ref<javaobject> create(YGValue value) {\n    return newInstance(value.value, static_cast<int>(value.unit));\n  }\n};\n\n#define YG_NODE_JNI_STYLE_PROP(javatype, type, name)                                       \\\n  javatype jni_YGNodeStyleGet##name(alias_ref<jobject>, jlong nativePointer) {             \\\n    return (javatype) YGNodeStyleGet##name(_jlong2YGNodeRef(nativePointer));               \\\n  }                                                                                        \\\n                                                                                           \\\n  void jni_YGNodeStyleSet##name(alias_ref<jobject>, jlong nativePointer, javatype value) { \\\n    YGNodeStyleSet##name(_jlong2YGNodeRef(nativePointer), static_cast<type>(value));       \\\n  }\n\n#define YG_NODE_JNI_STYLE_UNIT_PROP(name)                                                         \\\n  local_ref<jobject> jni_YGNodeStyleGet##name(alias_ref<jobject>, jlong nativePointer) {          \\\n    return JYogaValue::create(YGNodeStyleGet##name(_jlong2YGNodeRef(nativePointer)));             \\\n  }                                                                                               \\\n                                                                                                  \\\n  void jni_YGNodeStyleSet##name(alias_ref<jobject>, jlong nativePointer, jfloat value) {          \\\n    YGNodeStyleSet##name(_jlong2YGNodeRef(nativePointer), static_cast<float>(value));             \\\n  }                                                                                               \\\n                                                                                                  \\\n  void jni_YGNodeStyleSet##name##Percent(alias_ref<jobject>, jlong nativePointer, jfloat value) { \\\n    YGNodeStyleSet##name##Percent(_jlong2YGNodeRef(nativePointer), static_cast<float>(value));    \\\n  }\n\n#define YG_NODE_JNI_STYLE_UNIT_PROP_AUTO(name)                                   \\\n  YG_NODE_JNI_STYLE_UNIT_PROP(name)                                              \\\n  void jni_YGNodeStyleSet##name##Auto(alias_ref<jobject>, jlong nativePointer) { \\\n    YGNodeStyleSet##name##Auto(_jlong2YGNodeRef(nativePointer));                 \\\n  }\n\n#define YG_NODE_JNI_STYLE_EDGE_PROP(javatype, type, name)                                 \\\n  javatype jni_YGNodeStyleGet##name(alias_ref<jobject>, jlong nativePointer, jint edge) { \\\n    return (javatype) YGNodeStyleGet##name(_jlong2YGNodeRef(nativePointer),               \\\n                                           static_cast<YGEdge>(edge));                    \\\n  }                                                                                       \\\n                                                                                          \\\n  void jni_YGNodeStyleSet##name(alias_ref<jobject>,                                       \\\n                                jlong nativePointer,                                      \\\n                                jint edge,                                                \\\n                                javatype value) {                                         \\\n    YGNodeStyleSet##name(_jlong2YGNodeRef(nativePointer),                                 \\\n                         static_cast<YGEdge>(edge),                                       \\\n                         static_cast<type>(value));                                       \\\n  }\n\n#define YG_NODE_JNI_STYLE_EDGE_UNIT_PROP(name)                                                      \\\n  local_ref<jobject> jni_YGNodeStyleGet##name(alias_ref<jobject>,                                   \\\n                                              jlong nativePointer,                                  \\\n                                              jint edge) {                                          \\\n    return JYogaValue::create(                                                                      \\\n        YGNodeStyleGet##name(_jlong2YGNodeRef(nativePointer), static_cast<YGEdge>(edge)));          \\\n  }                                                                                                 \\\n                                                                                                    \\\n  void jni_YGNodeStyleSet##name(alias_ref<jobject>, jlong nativePointer, jint edge, jfloat value) { \\\n    YGNodeStyleSet##name(_jlong2YGNodeRef(nativePointer),                                           \\\n                         static_cast<YGEdge>(edge),                                                 \\\n                         static_cast<float>(value));                                                \\\n  }                                                                                                 \\\n                                                                                                    \\\n  void jni_YGNodeStyleSet##name##Percent(alias_ref<jobject>,                                        \\\n                                         jlong nativePointer,                                       \\\n                                         jint edge,                                                 \\\n                                         jfloat value) {                                            \\\n    YGNodeStyleSet##name##Percent(_jlong2YGNodeRef(nativePointer),                                  \\\n                                  static_cast<YGEdge>(edge),                                        \\\n                                  static_cast<float>(value));                                       \\\n  }\n\n#define YG_NODE_JNI_STYLE_EDGE_UNIT_PROP_AUTO(name)                                         \\\n  YG_NODE_JNI_STYLE_EDGE_UNIT_PROP(name)                                                    \\\n  void jni_YGNodeStyleSet##name##Auto(alias_ref<jobject>, jlong nativePointer, jint edge) { \\\n    YGNodeStyleSet##name##Auto(_jlong2YGNodeRef(nativePointer), static_cast<YGEdge>(edge)); \\\n  }\n\nYG_NODE_JNI_STYLE_PROP(jint, YGDirection, Direction);\nYG_NODE_JNI_STYLE_PROP(jint, YGFlexDirection, FlexDirection);\nYG_NODE_JNI_STYLE_PROP(jint, YGJustify, JustifyContent);\nYG_NODE_JNI_STYLE_PROP(jint, YGAlign, AlignItems);\nYG_NODE_JNI_STYLE_PROP(jint, YGAlign, AlignSelf);\nYG_NODE_JNI_STYLE_PROP(jint, YGAlign, AlignContent);\nYG_NODE_JNI_STYLE_PROP(jint, YGPositionType, PositionType);\nYG_NODE_JNI_STYLE_PROP(jint, YGWrap, FlexWrap);\nYG_NODE_JNI_STYLE_PROP(jint, YGOverflow, Overflow);\nYG_NODE_JNI_STYLE_PROP(jint, YGDisplay, Display);\n\nvoid jni_YGNodeStyleSetFlex(alias_ref<jobject>, jlong nativePointer, jfloat value) {\n  YGNodeStyleSetFlex(_jlong2YGNodeRef(nativePointer), static_cast<float>(value));\n}\nYG_NODE_JNI_STYLE_PROP(jfloat, float, FlexGrow);\nYG_NODE_JNI_STYLE_PROP(jfloat, float, FlexShrink);\nYG_NODE_JNI_STYLE_UNIT_PROP_AUTO(FlexBasis);\n\nYG_NODE_JNI_STYLE_EDGE_UNIT_PROP(Position);\nYG_NODE_JNI_STYLE_EDGE_UNIT_PROP_AUTO(Margin);\nYG_NODE_JNI_STYLE_EDGE_UNIT_PROP(Padding);\nYG_NODE_JNI_STYLE_EDGE_PROP(jfloat, float, Border);\n\nYG_NODE_JNI_STYLE_UNIT_PROP_AUTO(Width);\nYG_NODE_JNI_STYLE_UNIT_PROP(MinWidth);\nYG_NODE_JNI_STYLE_UNIT_PROP(MaxWidth);\nYG_NODE_JNI_STYLE_UNIT_PROP_AUTO(Height);\nYG_NODE_JNI_STYLE_UNIT_PROP(MinHeight);\nYG_NODE_JNI_STYLE_UNIT_PROP(MaxHeight);\n\n// Yoga specific properties, not compatible with flexbox specification\nYG_NODE_JNI_STYLE_PROP(jfloat, float, AspectRatio);\n\njlong jni_YGConfigNew(alias_ref<jobject>) {\n  return reinterpret_cast<jlong>(YGConfigNew());\n}\n\nvoid jni_YGConfigFree(alias_ref<jobject>, jlong nativePointer) {\n  const YGConfigRef config = _jlong2YGConfigRef(nativePointer);\n  YGConfigFree(config);\n}\n\nvoid jni_YGConfigSetExperimentalFeatureEnabled(alias_ref<jobject>,\n                                               jlong nativePointer,\n                                               jint feature,\n                                               jboolean enabled) {\n  const YGConfigRef config = _jlong2YGConfigRef(nativePointer);\n  YGConfigSetExperimentalFeatureEnabled(config,\n                                        static_cast<YGExperimentalFeature>(feature),\n                                        enabled);\n}\n\nvoid jni_YGConfigSetUseWebDefaults(alias_ref<jobject>,\n                                   jlong nativePointer,\n                                   jboolean useWebDefaults) {\n  const YGConfigRef config = _jlong2YGConfigRef(nativePointer);\n  YGConfigSetUseWebDefaults(config, useWebDefaults);\n}\n\nvoid jni_YGConfigSetPointScaleFactor(alias_ref<jobject>,\n                                     jlong nativePointer,\n                                     jfloat pixelsInPoint) {\n  const YGConfigRef config = _jlong2YGConfigRef(nativePointer);\n  YGConfigSetPointScaleFactor(config, pixelsInPoint);\n}\n\nvoid jni_YGConfigSetUseLegacyStretchBehaviour(alias_ref<jobject>,\n                                              jlong nativePointer,\n                                              jboolean useLegacyStretchBehaviour) {\n  const YGConfigRef config = _jlong2YGConfigRef(nativePointer);\n  YGConfigSetUseLegacyStretchBehaviour(config, useLegacyStretchBehaviour);\n}\n\nvoid jni_YGConfigSetLogger(alias_ref<jobject>, jlong nativePointer, alias_ref<jobject> logger) {\n  const YGConfigRef config = _jlong2YGConfigRef(nativePointer);\n\n  auto context = YGConfigGetContext(config);\n  if (context) {\n    delete reinterpret_cast<global_ref<jobject> *>(context);\n  }\n\n  if (logger) {\n    YGConfigSetContext(config, new global_ref<jobject>(make_global(logger)));\n    YGConfigSetLogger(config, YGJNILogFunc);\n  } else {\n    YGConfigSetContext(config, NULL);\n    YGConfigSetLogger(config, NULL);\n  }\n}\n\njint jni_YGNodeGetInstanceCount(alias_ref<jclass> clazz) {\n  return YGNodeGetInstanceCount();\n}\n\n#define YGMakeNativeMethod(name) makeNativeMethod(#name, name)\n\njint JNI_OnLoad(JavaVM *vm, void *) {\n  return initialize(vm, [] {\n    registerNatives(\"com/facebook/yoga/YogaNode\",\n                    {\n                        YGMakeNativeMethod(jni_YGNodeNew),\n                        YGMakeNativeMethod(jni_YGNodeNewWithConfig),\n                        YGMakeNativeMethod(jni_YGNodeFree),\n                        YGMakeNativeMethod(jni_YGNodeReset),\n                        YGMakeNativeMethod(jni_YGNodeInsertChild),\n                        YGMakeNativeMethod(jni_YGNodeRemoveChild),\n                        YGMakeNativeMethod(jni_YGNodeCalculateLayout),\n                        YGMakeNativeMethod(jni_YGNodeMarkDirty),\n                        YGMakeNativeMethod(jni_YGNodeIsDirty),\n                        YGMakeNativeMethod(jni_YGNodeSetHasMeasureFunc),\n                        YGMakeNativeMethod(jni_YGNodeSetHasBaselineFunc),\n                        YGMakeNativeMethod(jni_YGNodeCopyStyle),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetDirection),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetDirection),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetFlexDirection),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetFlexDirection),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetJustifyContent),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetJustifyContent),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetAlignItems),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetAlignItems),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetAlignSelf),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetAlignSelf),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetAlignContent),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetAlignContent),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetPositionType),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetPositionType),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetFlexWrap),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetOverflow),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetOverflow),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetDisplay),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetDisplay),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetFlex),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetFlexGrow),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetFlexGrow),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetFlexShrink),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetFlexShrink),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetFlexBasis),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetFlexBasis),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetFlexBasisPercent),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetFlexBasisAuto),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetMargin),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetMargin),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetMarginPercent),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetMarginAuto),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetPadding),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetPadding),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetPaddingPercent),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetBorder),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetBorder),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetPosition),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetPosition),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetPositionPercent),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetWidth),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetWidth),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetWidthPercent),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetWidthAuto),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetHeight),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetHeight),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetHeightPercent),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetHeightAuto),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetMinWidth),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetMinWidth),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetMinWidthPercent),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetMinHeight),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetMinHeight),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetMinHeightPercent),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetMaxWidth),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetMaxWidth),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetMaxWidthPercent),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetMaxHeight),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetMaxHeight),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetMaxHeightPercent),\n                        YGMakeNativeMethod(jni_YGNodeStyleGetAspectRatio),\n                        YGMakeNativeMethod(jni_YGNodeStyleSetAspectRatio),\n                        YGMakeNativeMethod(jni_YGNodeGetInstanceCount),\n                        YGMakeNativeMethod(jni_YGNodePrint),\n                    });\n    registerNatives(\"com/facebook/yoga/YogaConfig\",\n                    {\n                        YGMakeNativeMethod(jni_YGConfigNew),\n                        YGMakeNativeMethod(jni_YGConfigFree),\n                        YGMakeNativeMethod(jni_YGConfigSetExperimentalFeatureEnabled),\n                        YGMakeNativeMethod(jni_YGConfigSetUseWebDefaults),\n                        YGMakeNativeMethod(jni_YGConfigSetPointScaleFactor),\n                        YGMakeNativeMethod(jni_YGConfigSetUseLegacyStretchBehaviour),\n                        YGMakeNativeMethod(jni_YGConfigSetLogger),\n                    });\n  });\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/packagerconnection/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := packagerconnectionjnifb\n\nLOCAL_SRC_FILES := \\\n  JSPackagerClientResponder.h \\\n  SamplingProfilerPackagerMethod.cpp \\\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../\n\nLOCAL_CFLAGS += -Wall -Werror -fvisibility=hidden -fexceptions -frtti\nCXX11_FLAGS := -std=c++11\nLOCAL_CFLAGS += $(CXX11_FLAGS)\nLOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)\n\nLOCAL_LDLIBS += -landroid\nLOCAL_SHARED_LIBRARIES := libfolly_json libfbjni libjsc libglog_init\n\ninclude $(BUILD_SHARED_LIBRARY)\n\n$(call import-module,fb)\n$(call import-module,jsc)\n$(call import-module,folly)\n$(call import-module,fbgloginit)\n$(call import-module,jni)\n$(call import-module,jscwrapper)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/packagerconnection/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nfb_xplat_cxx_library(\n    name = \"jni\",\n    srcs = glob([\"*.cpp\"]),\n    headers = glob(\n        [\"*.h\"],\n    ),\n    header_namespace = \"\",\n    compiler_flags = [\n        \"-Wall\",\n        \"-Werror\",\n        \"-fexceptions\",\n        \"-std=c++1y\",\n        \"-frtti\",\n    ],\n    preprocessor_flags = [\n        \"-DLOG_TAG=\\\"PackagerConnectionJNI\\\"\",\n        \"-DWITH_FBSYSTRACE=1\",\n        \"-DWITH_INSPECTOR=1\",\n    ],\n    soname = \"libpackagerconnectionjnifb.$(ext)\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = ([\n        FBJNI_TARGET,\n        \"xplat//folly:molly\",\n        react_native_xplat_target(\"jschelpers:jschelpers\"),\n        react_native_xplat_target(\"jsinspector:jsinspector\"),\n    ] + JSC_DEPS) if not IS_OSS_BUILD else [],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/packagerconnection/JSPackagerClientResponder.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSPackagerClientResponder.h\"\n\n#include <jni/LocalString.h>\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nvoid JSPackagerClientResponder::respond(alias_ref<jobject> result) {\n  static auto method =\n      javaClassStatic()->getMethod<void(alias_ref<jobject>)>(\"respond\");\n  method(self(), result);\n}\n\nvoid JSPackagerClientResponder::respond(const std::string &result) {\n  respond(LocalString(result).string());\n}\n\nvoid JSPackagerClientResponder::error(alias_ref<jobject> result) {\n  static auto method =\n      javaClassStatic()->getMethod<void(alias_ref<jobject>)>(\"error\");\n  method(self(), result);\n}\n\nvoid JSPackagerClientResponder::error(const std::string &result) {\n  error(LocalString(result).string());\n}\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/packagerconnection/JSPackagerClientResponder.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <fb/fbjni.h>\n\nnamespace facebook {\nnamespace react {\n\nclass JSPackagerClientResponder\n    : public jni::JavaClass<JSPackagerClientResponder> {\npublic:\n  static constexpr auto kJavaDescriptor =\n    \"Lcom/facebook/react/packagerconnection/Responder;\";\n\n  void respond(jni::alias_ref<jobject> result);\n  void respond(const std::string& result);\n\n  void error(jni::alias_ref<jobject> result);\n  void error(const std::string& result);\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/packagerconnection/OnLoad.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <fb/fbjni.h>\n#include <jni.h>\n\n#include \"SamplingProfilerJniMethod.h\"\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nextern \"C\" JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) {\n  return initialize(vm, [] { SamplingProfilerJniMethod::registerNatives(); });\n}\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/packagerconnection/SamplingProfilerJniMethod.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"SamplingProfilerJniMethod.h\"\n\n#include <JavaScriptCore/JSProfilerPrivate.h>\n\n#include <jschelpers/JSCHelpers.h>\n#include <jni.h>\n#include <string>\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\n/* static */ jni::local_ref<SamplingProfilerJniMethod::jhybriddata>\nSamplingProfilerJniMethod::initHybrid(jni::alias_ref<jclass>,\n                                      jlong javaScriptContext) {\n  return makeCxxInstance(javaScriptContext);\n}\n\n/* static */ void SamplingProfilerJniMethod::registerNatives() {\n  registerHybrid(\n      {makeNativeMethod(\"initHybrid\", SamplingProfilerJniMethod::initHybrid),\n       makeNativeMethod(\"poke\", SamplingProfilerJniMethod::poke)});\n}\n\nSamplingProfilerJniMethod::SamplingProfilerJniMethod(jlong javaScriptContext) {\n  context_ = reinterpret_cast<JSGlobalContextRef>(javaScriptContext);\n}\n\nvoid SamplingProfilerJniMethod::poke(\n    jni::alias_ref<JSPackagerClientResponder::javaobject> responder) {\n  if (!JSC_JSSamplingProfilerEnabled(context_)) {\n    responder->error(\"The JSSamplingProfiler is disabled. See this \"\n                     \"https://fburl.com/u4lw7xeq for some help\");\n    return;\n  }\n\n  JSValueRef jsResult = JSC_JSPokeSamplingProfiler(context_);\n  if (JSC_JSValueGetType(context_, jsResult) == kJSTypeNull) {\n    responder->respond(\"started\");\n  } else {\n    JSStringRef resultStrRef = JSValueToStringCopy(context_, jsResult, nullptr);\n    size_t length = JSStringGetLength(resultStrRef);\n    char buffer[length + 1];\n    JSStringGetUTF8CString(resultStrRef, buffer, length + 1);\n    JSStringRelease(resultStrRef);\n    responder->respond(buffer);\n  }\n}\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/packagerconnection/SamplingProfilerJniMethod.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <fb/fbjni.h>\n#include <JavaScriptCore/JSValueRef.h>\n\n#include \"JSPackagerClientResponder.h\"\n\nnamespace facebook {\nnamespace react {\n\nclass SamplingProfilerJniMethod\n    : public jni::HybridClass<SamplingProfilerJniMethod> {\npublic:\n  static constexpr auto kJavaDescriptor =\n      \"Lcom/facebook/react/packagerconnection/\"\n      \"SamplingProfilerPackagerMethod$SamplingProfilerJniMethod;\";\n\n  static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass> jthis,\n                                                jlong javaScriptContext);\n\n  static void registerNatives();\n\nprivate:\n  friend HybridBase;\n\n  explicit SamplingProfilerJniMethod(jlong javaScriptContext);\n\n  void poke(jni::alias_ref<JSPackagerClientResponder::javaobject> responder);\n\n  JSGlobalContextRef context_;\n};\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/prebuilt/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\n# Temp workaround to get the build working e2e, Gradle builds them for us\n\nprebuilt_native_library(\n    name = \"reactnative-libs\",\n    native_libs = \"lib\",\n    visibility = [\"PUBLIC\"],\n)\n\nandroid_prebuilt_aar(\n    name = \"android-jsc\",\n    aar = \":android-jsc-aar\",\n    visibility = [\"PUBLIC\"],\n)\n\nremote_file(\n    name = \"android-jsc-aar\",\n    sha1 = \"880cedd93f43e0fc841f01f2fa185a63d9230f85\",\n    url = \"mvn:org.webkit:android-jsc:aar:r174650\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := reactnativejni\n\nLOCAL_SRC_FILES := \\\n  AndroidJSCFactory.cpp \\\n  CatalystInstanceImpl.cpp \\\n  CxxModuleWrapper.cpp \\\n  JavaModuleWrapper.cpp \\\n  JMessageQueueThread.cpp \\\n  JSCPerfLogging.cpp \\\n  JSLoader.cpp \\\n  JSLogging.cpp \\\n  JniJSModulesUnbundle.cpp \\\n  MethodInvoker.cpp \\\n  ModuleRegistryBuilder.cpp \\\n  NativeArray.cpp \\\n  NativeCommon.cpp \\\n  NativeMap.cpp \\\n  OnLoad.cpp \\\n  ProxyExecutor.cpp \\\n  ReactMarker.cpp \\\n  ReadableNativeArray.cpp \\\n  ReadableNativeMap.cpp \\\n  WritableNativeArray.cpp \\\n  WritableNativeMap.cpp \\\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../..\n\nLOCAL_CFLAGS += -Wall -Werror -fvisibility=hidden -fexceptions -frtti\nCXX11_FLAGS := -std=c++11\nLOCAL_CFLAGS += $(CXX11_FLAGS)\nLOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)\n\nLOCAL_LDLIBS += -landroid\nLOCAL_SHARED_LIBRARIES := libfolly_json libfbjni libjsc libglog_init libyoga libprivatedata\nLOCAL_STATIC_LIBRARIES := libreactnative\n\ninclude $(BUILD_SHARED_LIBRARY)\n\n$(call import-module,cxxreact)\n$(call import-module,privatedata)\n$(call import-module,fb)\n$(call import-module,fbgloginit)\n$(call import-module,folly)\n$(call import-module,jsc)\n$(call import-module,yogajni)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/AndroidJSCFactory.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <cxxreact/JSCExecutor.h>\n\n#include <string>\n\n#include <cxxreact/Platform.h>\n#include <fb/fbjni.h>\n#include <folly/Conv.h>\n#include <folly/dynamic.h>\n#include <folly/Memory.h>\n#include <jschelpers/JSCHelpers.h>\n\n#include \"JSCPerfLogging.h\"\n#include \"JSLogging.h\"\n#include \"ReactMarker.h\"\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nnamespace {\n\nExceptionHandling::ExtractedEror extractJniError(const std::exception& ex, const char *context) {\n  auto jniEx = dynamic_cast<const jni::JniException *>(&ex);\n  if (!jniEx) {\n    return {};\n  }\n\n  auto stackTrace = jniEx->getThrowable()->getStackTrace();\n  std::ostringstream stackStr;\n  for (int i = 0, count = stackTrace->size(); i < count; ++i) {\n    auto frame = stackTrace->getElement(i);\n\n    auto methodName = folly::to<std::string>(frame->getClassName(), \".\",\n      frame->getMethodName());\n\n    // Cut off stack traces at the Android looper, to keep them simple\n    if (methodName == \"android.os.Looper.loop\") {\n      break;\n    }\n\n    stackStr << std::move(methodName) << '@' << frame->getFileName();\n    if (frame->getLineNumber() > 0) {\n      stackStr << ':' << frame->getLineNumber();\n    }\n    stackStr << std::endl;\n  }\n\n  auto msg = folly::to<std::string>(\"Java exception in '\", context, \"'\\n\\n\", jniEx->what());\n  return {.message = msg, .stack = stackStr.str()};\n}\n\nJSValueRef nativePerformanceNow(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[], JSValueRef *exception) {\n  static const int64_t NANOSECONDS_IN_SECOND = 1000000000LL;\n  static const int64_t NANOSECONDS_IN_MILLISECOND = 1000000LL;\n\n  // Since SystemClock.uptimeMillis() is commonly used for performance measurement in Java\n  // and uptimeMillis() internally uses clock_gettime(CLOCK_MONOTONIC),\n  // we use the same API here.\n  // We need that to make sure we use the same time system on both JS and Java sides.\n  // Links to the source code:\n  // https://android.googlesource.com/platform/frameworks/native/+/jb-mr1-release/libs/utils/SystemClock.cpp\n  // https://android.googlesource.com/platform/system/core/+/master/libutils/Timers.cpp\n  struct timespec now;\n  clock_gettime(CLOCK_MONOTONIC, &now);\n  int64_t nano = now.tv_sec * NANOSECONDS_IN_SECOND + now.tv_nsec;\n  return Value::makeNumber(ctx, (nano / (double)NANOSECONDS_IN_MILLISECOND));\n}\n\n}\n\nnamespace detail {\n\nvoid injectJSCExecutorAndroidPlatform() {\n  // Inject some behavior into react/\n  JReactMarker::setLogPerfMarkerIfNeeded();\n  ExceptionHandling::platformErrorExtractor = extractJniError;\n  JSCNativeHooks::loggingHook = nativeLoggingHook;\n  JSCNativeHooks::nowHook = nativePerformanceNow;\n  JSCNativeHooks::installPerfHooks = addNativePerfLoggingHooks;\n}\n\n}\n\nstd::unique_ptr<JSExecutorFactory> makeAndroidJSCExecutorFactory(\n    const folly::dynamic& jscConfig) {\n  detail::injectJSCExecutorAndroidPlatform();\n  return folly::make_unique<JSCExecutorFactory>(std::move(jscConfig));\n}\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/AndroidJSCFactory.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <memory>\n\nnamespace folly {\n\nclass dynamic;\n\n}\n\nnamespace facebook {\nnamespace react {\n\nclass JSExecutorFactory;\n\nnamespace detail {\n\n// This is only exposed so instrumentation tests can call it.\nvoid injectJSCExecutorAndroidPlatform();\n\n}\n\nstd::unique_ptr<JSExecutorFactory> makeAndroidJSCExecutorFactory(\n    const folly::dynamic& jscConfig);\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nEXPORTED_HEADERS = [\n    \"AndroidJSCFactory.h\",\n    \"CxxModuleWrapper.h\",\n    \"CxxModuleWrapperBase.h\",\n    \"CxxSharedModuleWrapper.h\",\n    \"JavaModuleWrapper.h\",\n    \"JavaScriptExecutorHolder.h\",\n    \"JSLoader.h\",\n    \"MethodInvoker.h\",\n    \"ModuleRegistryBuilder.h\",\n    \"NativeArray.h\",\n    \"NativeCommon.h\",\n    \"NativeMap.h\",\n    \"ReactMarker.h\",\n    \"ReadableNativeArray.h\",\n    \"ReadableNativeMap.h\",\n    \"WritableNativeArray.h\",\n    \"WritableNativeMap.h\",\n]\n\nfb_xplat_cxx_library(\n    name = \"jni\",\n    srcs = glob([\"*.cpp\"]),\n    headers = glob(\n        [\"*.h\"],\n        excludes = EXPORTED_HEADERS,\n    ),\n    header_namespace = \"react/jni\",\n    exported_headers = EXPORTED_HEADERS,\n    allow_jni_merging = True,\n    compiler_flags = [\n        \"-Wall\",\n        \"-Werror\",\n        \"-fexceptions\",\n        \"-std=c++1y\",\n        \"-frtti\",\n        \"-Wno-pessimizing-move\",\n        \"-Wno-inconsistent-missing-override\",\n    ],\n    preprocessor_flags = [\n        \"-DLOG_TAG=\\\"ReactNativeJNI\\\"\",\n        \"-DWITH_FBSYSTRACE=1\",\n        \"-DWITH_INSPECTOR=1\",\n        \"-DWITH_JSC_MEMORY_PRESSURE=1\",\n    ],\n    soname = \"libreactnativejni.$(ext)\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = ([\n        \"//native/third-party/android-ndk:android\",\n        \"xplat//folly:molly\",\n        \"//xplat/fbgloginit:fbgloginit\",\n        \"xplat//fbsystrace:fbsystrace\",\n        react_native_xplat_target(\"cxxreact:bridge\"),\n        react_native_xplat_target(\"cxxreact:module\"),\n        FBJNI_TARGET,\n    ] + JSC_DEPS) if not IS_OSS_BUILD else [],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"CatalystInstanceImpl.h\"\n\n#include <mutex>\n#include <condition_variable>\n\n#include <cxxreact/CxxNativeModule.h>\n#include <cxxreact/Instance.h>\n#include <cxxreact/JSBigString.h>\n#include <cxxreact/JSBundleType.h>\n#include <cxxreact/JSIndexedRAMBundle.h>\n#include <cxxreact/MethodCall.h>\n#include <cxxreact/ModuleRegistry.h>\n#include <cxxreact/RecoverableError.h>\n#include <cxxreact/RAMBundleRegistry.h>\n#include <fb/log.h>\n#include <folly/dynamic.h>\n#include <folly/Memory.h>\n#include <jni/Countable.h>\n#include <jni/LocalReference.h>\n\n#include \"CxxModuleWrapper.h\"\n#include \"JavaScriptExecutorHolder.h\"\n#include \"JNativeRunnable.h\"\n#include \"JniJSModulesUnbundle.h\"\n#include \"NativeArray.h\"\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nnamespace {\n\nclass Exception : public jni::JavaClass<Exception> {\n public:\n  static auto constexpr kJavaDescriptor = \"Ljava/lang/Exception;\";\n};\n\nclass JInstanceCallback : public InstanceCallback {\n public:\n  explicit JInstanceCallback(\n    alias_ref<ReactCallback::javaobject> jobj,\n    std::shared_ptr<JMessageQueueThread> messageQueueThread)\n  : jobj_(make_global(jobj)), messageQueueThread_(std::move(messageQueueThread)) {}\n\n  void onBatchComplete() override {\n    messageQueueThread_->runOnQueue([this] {\n      static auto method =\n        ReactCallback::javaClassStatic()->getMethod<void()>(\"onBatchComplete\");\n      method(jobj_);\n    });\n  }\n\n  void incrementPendingJSCalls() override {\n    // For C++ modules, this can be called from an arbitrary thread\n    // managed by the module, via callJSCallback or callJSFunction.  So,\n    // we ensure that it is registered with the JVM.\n    jni::ThreadScope guard;\n    static auto method =\n      ReactCallback::javaClassStatic()->getMethod<void()>(\"incrementPendingJSCalls\");\n    method(jobj_);\n  }\n\n  void decrementPendingJSCalls() override {\n    jni::ThreadScope guard;\n    static auto method =\n      ReactCallback::javaClassStatic()->getMethod<void()>(\"decrementPendingJSCalls\");\n    method(jobj_);\n  }\n\n private:\n  global_ref<ReactCallback::javaobject> jobj_;\n  std::shared_ptr<JMessageQueueThread> messageQueueThread_;\n};\n\n}\n\njni::local_ref<CatalystInstanceImpl::jhybriddata> CatalystInstanceImpl::initHybrid(\n    jni::alias_ref<jclass>) {\n  return makeCxxInstance();\n}\n\nCatalystInstanceImpl::CatalystInstanceImpl()\n  : instance_(folly::make_unique<Instance>()) {}\n\nCatalystInstanceImpl::~CatalystInstanceImpl() {\n  if (moduleMessageQueue_ != NULL) {\n    moduleMessageQueue_->quitSynchronous();\n  }\n}\n\nvoid CatalystInstanceImpl::registerNatives() {\n  registerHybrid({\n    makeNativeMethod(\"initHybrid\", CatalystInstanceImpl::initHybrid),\n    makeNativeMethod(\"initializeBridge\", CatalystInstanceImpl::initializeBridge),\n    makeNativeMethod(\"jniExtendNativeModules\", CatalystInstanceImpl::extendNativeModules),\n    makeNativeMethod(\"jniSetSourceURL\", CatalystInstanceImpl::jniSetSourceURL),\n    makeNativeMethod(\"jniRegisterSegment\", CatalystInstanceImpl::jniRegisterSegment),\n    makeNativeMethod(\"jniLoadScriptFromAssets\", CatalystInstanceImpl::jniLoadScriptFromAssets),\n    makeNativeMethod(\"jniLoadScriptFromFile\", CatalystInstanceImpl::jniLoadScriptFromFile),\n    makeNativeMethod(\"jniCallJSFunction\", CatalystInstanceImpl::jniCallJSFunction),\n    makeNativeMethod(\"jniCallJSCallback\", CatalystInstanceImpl::jniCallJSCallback),\n    makeNativeMethod(\"setGlobalVariable\", CatalystInstanceImpl::setGlobalVariable),\n    makeNativeMethod(\"getJavaScriptContext\", CatalystInstanceImpl::getJavaScriptContext),\n    makeNativeMethod(\"jniHandleMemoryPressure\", CatalystInstanceImpl::handleMemoryPressure),\n  });\n\n  JNativeRunnable::registerNatives();\n}\n\nvoid CatalystInstanceImpl::initializeBridge(\n    jni::alias_ref<ReactCallback::javaobject> callback,\n    // This executor is actually a factory holder.\n    JavaScriptExecutorHolder* jseh,\n    jni::alias_ref<JavaMessageQueueThread::javaobject> jsQueue,\n    jni::alias_ref<JavaMessageQueueThread::javaobject> nativeModulesQueue,\n    jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject> javaModules,\n    jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject> cxxModules) {\n  // TODO mhorowitz: how to assert here?\n  // Assertions.assertCondition(mBridge == null, \"initializeBridge should be called once\");\n  moduleMessageQueue_ = std::make_shared<JMessageQueueThread>(nativeModulesQueue);\n\n  // This used to be:\n  //\n  // Java CatalystInstanceImpl -> C++ CatalystInstanceImpl -> Bridge -> Bridge::Callback\n  // --weak--> ReactCallback -> Java CatalystInstanceImpl\n  //\n  // Now the weak ref is a global ref.  So breaking the loop depends on\n  // CatalystInstanceImpl#destroy() calling mHybridData.resetNative(), which\n  // should cause all the C++ pointers to be cleaned up (except C++\n  // CatalystInstanceImpl might be kept alive for a short time by running\n  // callbacks). This also means that all native calls need to be pre-checked\n  // to avoid NPE.\n\n  // See the comment in callJSFunction.  Once js calls switch to strings, we\n  // don't need jsModuleDescriptions any more, all the way up and down the\n  // stack.\n\n  moduleRegistry_ = std::make_shared<ModuleRegistry>(\n    buildNativeModuleList(\n       std::weak_ptr<Instance>(instance_),\n       javaModules,\n       cxxModules,\n       moduleMessageQueue_));\n\n  instance_->initializeBridge(\n    folly::make_unique<JInstanceCallback>(\n    callback,\n    moduleMessageQueue_),\n    jseh->getExecutorFactory(),\n    folly::make_unique<JMessageQueueThread>(jsQueue),\n    moduleRegistry_);\n}\n\nvoid CatalystInstanceImpl::extendNativeModules(\n    jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject> javaModules,\n    jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject> cxxModules) {\n  moduleRegistry_->registerModules(buildNativeModuleList(\n    std::weak_ptr<Instance>(instance_),\n    javaModules,\n    cxxModules,\n    moduleMessageQueue_));\n}\n\nvoid CatalystInstanceImpl::jniSetSourceURL(const std::string& sourceURL) {\n  instance_->setSourceURL(sourceURL);\n}\n\nvoid CatalystInstanceImpl::jniRegisterSegment(int segmentId, const std::string& path) {\n  instance_->registerBundle((uint32_t)segmentId, path);\n}\n\nvoid CatalystInstanceImpl::jniLoadScriptFromAssets(\n    jni::alias_ref<JAssetManager::javaobject> assetManager,\n    const std::string& assetURL,\n    bool loadSynchronously) {\n  const int kAssetsLength = 9;  // strlen(\"assets://\");\n  auto sourceURL = assetURL.substr(kAssetsLength);\n\n  auto manager = extractAssetManager(assetManager);\n  auto script = loadScriptFromAssets(manager, sourceURL);\n  if (JniJSModulesUnbundle::isUnbundle(manager, sourceURL)) {\n    auto bundle = JniJSModulesUnbundle::fromEntryFile(manager, sourceURL);\n    auto registry = RAMBundleRegistry::singleBundleRegistry(std::move(bundle));\n    instance_->loadRAMBundle(\n      std::move(registry),\n      std::move(script),\n      sourceURL,\n      loadSynchronously);\n    return;\n  } else {\n    instance_->loadScriptFromString(std::move(script), sourceURL, loadSynchronously);\n  }\n}\n\nvoid CatalystInstanceImpl::jniLoadScriptFromFile(const std::string& fileName,\n                                                 const std::string& sourceURL,\n                                                 bool loadSynchronously) {\n  if (Instance::isIndexedRAMBundle(fileName.c_str())) {\n    instance_->loadRAMBundleFromFile(fileName, sourceURL, loadSynchronously);\n  } else {\n    std::unique_ptr<const JSBigFileString> script;\n    RecoverableError::runRethrowingAsRecoverable<std::system_error>(\n      [&fileName, &script]() {\n        script = JSBigFileString::fromPath(fileName);\n      });\n    instance_->loadScriptFromString(std::move(script), sourceURL, loadSynchronously);\n  }\n}\n\nvoid CatalystInstanceImpl::jniCallJSFunction(std::string module, std::string method, NativeArray* arguments) {\n  // We want to share the C++ code, and on iOS, modules pass module/method\n  // names as strings all the way through to JS, and there's no way to do\n  // string -> id mapping on the objc side.  So on Android, we convert the\n  // number to a string, here which gets passed as-is to JS.  There, they they\n  // used as ids if isFinite(), which handles this case, and looked up as\n  // strings otherwise.  Eventually, we'll probably want to modify the stack\n  // from the JS proxy through here to use strings, too.\n  instance_->callJSFunction(std::move(module),\n                            std::move(method),\n                            arguments->consume());\n}\n\nvoid CatalystInstanceImpl::jniCallJSCallback(jint callbackId, NativeArray* arguments) {\n  instance_->callJSCallback(callbackId, arguments->consume());\n}\n\nvoid CatalystInstanceImpl::setGlobalVariable(std::string propName,\n                                             std::string&& jsonValue) {\n  // This is only ever called from Java with short strings, and only\n  // for testing, so no need to try hard for zero-copy here.\n\n  instance_->setGlobalVariable(std::move(propName),\n                               folly::make_unique<JSBigStdString>(std::move(jsonValue)));\n}\n\njlong CatalystInstanceImpl::getJavaScriptContext() {\n  return (jlong) (intptr_t) instance_->getJavaScriptContext();\n}\n\nvoid CatalystInstanceImpl::handleMemoryPressure(int pressureLevel) {\n  #ifdef WITH_JSC_MEMORY_PRESSURE\n  instance_->handleMemoryPressure(pressureLevel);\n  #endif\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <string>\n\n#include <fb/fbjni.h>\n#include <folly/Memory.h>\n\n#include \"CxxModuleWrapper.h\"\n#include \"JavaModuleWrapper.h\"\n#include \"JMessageQueueThread.h\"\n#include \"JSLoader.h\"\n#include \"ModuleRegistryBuilder.h\"\n\nnamespace facebook {\nnamespace react {\n\nclass Instance;\nclass JavaScriptExecutorHolder;\nclass NativeArray;\n\nstruct ReactCallback : public jni::JavaClass<ReactCallback> {\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/ReactCallback;\";\n};\n\nclass CatalystInstanceImpl : public jni::HybridClass<CatalystInstanceImpl> {\n public:\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/CatalystInstanceImpl;\";\n\n  static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);\n  ~CatalystInstanceImpl() override;\n\n  static void registerNatives();\n\n  std::shared_ptr<Instance> getInstance() {\n    return instance_;\n  }\n\n private:\n  friend HybridBase;\n\n  CatalystInstanceImpl();\n\n  void initializeBridge(\n      jni::alias_ref<ReactCallback::javaobject> callback,\n      // This executor is actually a factory holder.\n      JavaScriptExecutorHolder* jseh,\n      jni::alias_ref<JavaMessageQueueThread::javaobject> jsQueue,\n      jni::alias_ref<JavaMessageQueueThread::javaobject> moduleQueue,\n      jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject> javaModules,\n      jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject> cxxModules);\n\n  void extendNativeModules(\n    jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject> javaModules,\n    jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject> cxxModules);\n\n  /**\n   * Sets the source URL of the underlying bridge without loading any JS code.\n   */\n  void jniSetSourceURL(const std::string& sourceURL);\n\n  /**\n   * Registers the file path of an additional JS segment by its ID.\n   *\n   */\n  void jniRegisterSegment(int segmentId, const std::string& path);\n\n  void jniLoadScriptFromAssets(jni::alias_ref<JAssetManager::javaobject> assetManager, const std::string& assetURL, bool loadSynchronously);\n  void jniLoadScriptFromFile(const std::string& fileName, const std::string& sourceURL, bool loadSynchronously);\n  void jniCallJSFunction(std::string module, std::string method, NativeArray* arguments);\n  void jniCallJSCallback(jint callbackId, NativeArray* arguments);\n  void setGlobalVariable(std::string propName,\n                         std::string&& jsonValue);\n  jlong getJavaScriptContext();\n  void handleMemoryPressure(int pressureLevel);\n\n  // This should be the only long-lived strong reference, but every C++ class\n  // will have a weak reference.\n  std::shared_ptr<Instance> instance_;\n  std::shared_ptr<ModuleRegistry> moduleRegistry_;\n  std::shared_ptr<JMessageQueueThread> moduleMessageQueue_;\n};\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/CxxModuleWrapper.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"CxxModuleWrapper.h\"\n\n#include <folly/ScopeGuard.h>\n\n#include <dlfcn.h>\n\nusing namespace facebook::jni;\nusing namespace facebook::xplat::module;\n\nnamespace facebook {\nnamespace react {\n\njni::local_ref<CxxModuleWrapper::javaobject> CxxModuleWrapper::makeDsoNative(\n    jni::alias_ref<jclass>, const std::string& soPath, const std::string& fname) {\n  // soPath is the path of a library which has already been loaded by\n  // java SoLoader.loadLibrary().  So this returns the same handle,\n  // and increments the reference counter.  We can't just use\n  // dlsym(RTLD_DEFAULT, ...), because that crashes on 4.4.2 and\n  // earlier: https://code.google.com/p/android/issues/detail?id=61799\n  void* handle = dlopen(soPath.c_str(), RTLD_NOW);\n  if (!handle) {\n    throwNewJavaException(gJavaLangIllegalArgumentException,\n                          \"module shared library %s is not found\", soPath.c_str());\n  }\n   // Now, arrange to close the handle so the counter is decremented.\n   // The handle will remain valid until java closes it.  There's no\n   // way to do this on Android, but that's no reason to be sloppy\n   // here.\n  auto guard = folly::makeGuard([&] { CHECK(dlclose(handle) == 0); });\n\n  void* sym = dlsym(handle, fname.c_str());\n  if (!sym) {\n    throwNewJavaException(gJavaLangIllegalArgumentException,\n                          \"module function %s in shared library %s is not found\",\n                          fname.c_str(), soPath.c_str());\n  }\n  auto factory = reinterpret_cast<CxxModule* (*)()>(sym);\n\n  return CxxModuleWrapper::newObjectCxxArgs(std::unique_ptr<CxxModule>((*factory)()));\n}\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/CxxModuleWrapper.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include \"CxxModuleWrapperBase.h\"\n\nnamespace facebook {\nnamespace react {\n\nclass CxxModuleWrapper : public jni::HybridClass<CxxModuleWrapper, CxxModuleWrapperBase> {\npublic:\n  constexpr static const char *const kJavaDescriptor =\n    \"Lcom/facebook/react/bridge/CxxModuleWrapper;\";\n\n  static void registerNatives() {\n    registerHybrid({\n      makeNativeMethod(\"makeDsoNative\", CxxModuleWrapper::makeDsoNative)\n    });\n  }\n\n  static jni::local_ref<CxxModuleWrapper::javaobject> makeDsoNative(\n    jni::alias_ref<jclass>, const std::string& soPath, const std::string& fname);\n\n  std::string getName() override {\n    return module_->getName();\n  }\n\n  // This steals ownership of the underlying module for use by the C++ bridge\n  std::unique_ptr<xplat::module::CxxModule> getModule() override {\n    return std::move(module_);\n  }\n\nprotected:\n  friend HybridBase;\n\n  explicit CxxModuleWrapper(std::unique_ptr<xplat::module::CxxModule> module)\n    : module_(std::move(module)) {}\n\n  std::unique_ptr<xplat::module::CxxModule> module_;\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/CxxModuleWrapperBase.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <memory>\n#include <string>\n\n#include <cxxreact/CxxModule.h>\n#include <fb/fbjni.h>\n\nnamespace facebook {\nnamespace react {\n\nstruct JNativeModule : jni::JavaClass<JNativeModule> {\n  constexpr static const char *const kJavaDescriptor =\n    \"Lcom/facebook/react/bridge/NativeModule;\";\n};\n\n/**\n * The C++ part of a CxxModuleWrapper is not a unique class, but it\n * must extend this base class.\n */\nclass CxxModuleWrapperBase\n  : public jni::HybridClass<CxxModuleWrapperBase, JNativeModule> {\npublic:\n  constexpr static const char *const kJavaDescriptor =\n    \"Lcom/facebook/react/bridge/CxxModuleWrapperBase;\";\n\n  static void registerNatives() {\n    registerHybrid({\n      makeNativeMethod(\"getName\", CxxModuleWrapperBase::getName)\n    });\n  }\n\n  // JNI method\n  virtual std::string getName() = 0;\n\n  // Called by ModuleRegistryBuilder\n  virtual std::unique_ptr<xplat::module::CxxModule> getModule() = 0;\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/CxxSharedModuleWrapper.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <cxxreact/SharedProxyCxxModule.h>\n\n#include \"CxxModuleWrapperBase.h\"\n\nnamespace facebook {\nnamespace react {\n\nclass CxxSharedModuleWrapper: public CxxModuleWrapperBase {\n public:\n  std::string getName() override {\n    return shared_->getName();\n  }\n\n  std::unique_ptr<xplat::module::CxxModule> getModule() override {\n    // Instead of just moving out the stored CxxModule, this creates a\n    // proxy which passes calls to the shared stored CxxModule.\n\n    return std::make_unique<xplat::module::SharedProxyCxxModule>(shared_);\n  }\n\nprotected:\n  explicit CxxSharedModuleWrapper(std::unique_ptr<xplat::module::CxxModule> module)\n    : shared_(std::move(module)) {}\n\n  std::shared_ptr<xplat::module::CxxModule> shared_;\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JCallback.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <memory>\n\n#include <fb/fbjni.h>\n#include <folly/dynamic.h>\n\n#include \"NativeArray.h\"\n\nnamespace facebook {\nnamespace react {\n\nclass Instance;\n\nstruct JCallback : public jni::JavaClass<JCallback> {\n  constexpr static auto kJavaDescriptor = \"Lcom/facebook/react/bridge/Callback;\";\n};\n\nclass JCxxCallbackImpl : public jni::HybridClass<JCxxCallbackImpl, JCallback> {\npublic:\n  constexpr static auto kJavaDescriptor = \"Lcom/facebook/react/bridge/CxxCallbackImpl;\";\n\n  static void registerNatives() {\n    javaClassStatic()->registerNatives({\n        makeNativeMethod(\"nativeInvoke\", JCxxCallbackImpl::invoke),\n    });\n  }\nprivate:\n  friend HybridBase;\n\n  using Callback = std::function<void(folly::dynamic)>;\n  JCxxCallbackImpl(Callback callback) : callback_(std::move(callback)) {}\n\n  void invoke(NativeArray* arguments) {\n    callback_(arguments->consume());\n  }\n\n  Callback callback_;\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JInspector.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JInspector.h\"\n#include <jschelpers/JavaScriptCore.h>\n\n#ifdef WITH_INSPECTOR\n\nnamespace facebook {\nnamespace react {\n\nnamespace {\n\nclass RemoteConnection : public IRemoteConnection {\npublic:\n  RemoteConnection(jni::alias_ref<JRemoteConnection::javaobject> connection)\n      : connection_(jni::make_global(connection)) {}\n\n  virtual void onMessage(std::string message) override {\n    connection_->onMessage(message);\n  }\n\n  virtual void onDisconnect() override {\n    connection_->onDisconnect();\n  }\nprivate:\n  jni::global_ref<JRemoteConnection::javaobject> connection_;\n};\n\n}\n\njni::local_ref<JPage::javaobject> JPage::create(int id, const std::string& title) {\n  static auto constructor = javaClassStatic()->getConstructor<JPage::javaobject(jint, jni::local_ref<jni::JString>)>();\n  return javaClassStatic()->newObject(constructor, id, jni::make_jstring(title));\n}\n\nvoid JRemoteConnection::onMessage(const std::string& message) const {\n  static auto method = javaClassStatic()->getMethod<void(jni::local_ref<jstring>)>(\"onMessage\");\n  method(self(), jni::make_jstring(message));\n}\n\nvoid JRemoteConnection::onDisconnect() const {\n  static auto method = javaClassStatic()->getMethod<void()>(\"onDisconnect\");\n  method(self());\n}\n\nJLocalConnection::JLocalConnection(std::unique_ptr<ILocalConnection> connection)\n  : connection_(std::move(connection)) {}\n\nvoid JLocalConnection::sendMessage(std::string message) {\n  connection_->sendMessage(std::move(message));\n}\n\nvoid JLocalConnection::disconnect() {\n  connection_->disconnect();\n}\n\nvoid JLocalConnection::registerNatives() {\n  javaClassStatic()->registerNatives({\n      makeNativeMethod(\"sendMessage\", JLocalConnection::sendMessage),\n      makeNativeMethod(\"disconnect\", JLocalConnection::disconnect),\n  });\n}\n\njni::global_ref<JInspector::javaobject> JInspector::instance(jni::alias_ref<jclass>) {\n  static auto instance = jni::make_global(newObjectCxxArgs(&getInspectorInstance()));\n  return instance;\n}\n\njni::local_ref<jni::JArrayClass<JPage::javaobject>> JInspector::getPages() {\n  std::vector<InspectorPage> pages = inspector_->getPages();\n  auto array = jni::JArrayClass<JPage::javaobject>::newArray(pages.size());\n  for (size_t i = 0; i < pages.size(); i++) {\n    (*array)[i] = JPage::create(pages[i].id, pages[i].title);\n  }\n  return array;\n}\n\njni::local_ref<JLocalConnection::javaobject> JInspector::connect(int pageId, jni::alias_ref<JRemoteConnection::javaobject> remote) {\n  auto localConnection = inspector_->connect(pageId, folly::make_unique<RemoteConnection>(std::move(remote)));\n  return JLocalConnection::newObjectCxxArgs(std::move(localConnection));\n}\n\nvoid JInspector::registerNatives() {\n  JLocalConnection::registerNatives();\n  javaClassStatic()->registerNatives({\n      makeNativeMethod(\"instance\", JInspector::instance),\n      makeNativeMethod(\"getPagesNative\", JInspector::getPages),\n      makeNativeMethod(\"connectNative\", JInspector::connect),\n  });\n}\n\n}\n}\n\n#endif\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JInspector.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#ifdef WITH_INSPECTOR\n\n#include <jsinspector/InspectorInterfaces.h>\n\n#include <fb/fbjni.h>\n#include <folly/Memory.h>\n\nnamespace facebook {\nnamespace react {\n\nclass JPage : public jni::JavaClass<JPage> {\npublic:\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/Inspector$Page;\";\n\n  static jni::local_ref<JPage::javaobject> create(int id, const std::string& title);\n};\n\nclass JRemoteConnection : public jni::JavaClass<JRemoteConnection> {\npublic:\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/Inspector$RemoteConnection;\";\n\n  void onMessage(const std::string& message) const;\n  void onDisconnect() const;\n};\n\nclass JLocalConnection : public jni::HybridClass<JLocalConnection> {\npublic:\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/Inspector$LocalConnection;\";\n\n  JLocalConnection(std::unique_ptr<ILocalConnection> connection);\n\n  void sendMessage(std::string message);\n  void disconnect();\n\n  static void registerNatives();\nprivate:\n  std::unique_ptr<ILocalConnection> connection_;\n};\n\nclass JInspector : public jni::HybridClass<JInspector> {\npublic:\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/Inspector;\";\n\n  static jni::global_ref<JInspector::javaobject> instance(jni::alias_ref<jclass>);\n\n  jni::local_ref<jni::JArrayClass<JPage::javaobject>> getPages();\n  jni::local_ref<JLocalConnection::javaobject> connect(int pageId, jni::alias_ref<JRemoteConnection::javaobject> remote);\n\n  static void registerNatives();\nprivate:\n  friend HybridBase;\n\n  JInspector(IInspector* inspector) : inspector_(inspector) {}\n\n  IInspector* inspector_;\n};\n\n}\n}\n\n#endif\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JMessageQueueThread.h\"\n\n#include <condition_variable>\n#include <mutex>\n\n#include <fb/log.h>\n#include <folly/Memory.h>\n#include <fb/fbjni.h>\n\n#include <jschelpers/JSCHelpers.h>\n\n#include \"JNativeRunnable.h\"\n\nnamespace facebook {\nnamespace react {\n\nnamespace {\n\nstruct JavaJSException : jni::JavaClass<JavaJSException, JThrowable> {\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/devsupport/JSException;\";\n\n  static local_ref<JavaJSException> create(const char* message, const char* stack,\n                                           const std::exception& ex) {\n    local_ref<jthrowable> cause = jni::JCppException::create(ex);\n    return newInstance(make_jstring(message), make_jstring(stack), cause.get());\n  }\n};\n\nstd::function<void()> wrapRunnable(std::function<void()>&& runnable) {\n  return [runnable=std::move(runnable)] {\n    try {\n      runnable();\n    } catch (const JSException& ex) {\n      throwNewJavaException(JavaJSException::create(ex.what(), ex.getStack().c_str(), ex).get());\n    }\n  };\n}\n\n}\n\nJMessageQueueThread::JMessageQueueThread(alias_ref<JavaMessageQueueThread::javaobject> jobj) :\n    m_jobj(make_global(jobj)) {\n}\n\nvoid JMessageQueueThread::runOnQueue(std::function<void()>&& runnable) {\n  // For C++ modules, this can be called from an arbitrary thread\n  // managed by the module, via callJSCallback or callJSFunction.  So,\n  // we ensure that it is registered with the JVM.\n  jni::ThreadScope guard;\n  static auto method = JavaMessageQueueThread::javaClassStatic()->\n    getMethod<void(Runnable::javaobject)>(\"runOnQueue\");\n  method(m_jobj, JNativeRunnable::newObjectCxxArgs(wrapRunnable(std::move(runnable))).get());\n}\n\nvoid JMessageQueueThread::runOnQueueSync(std::function<void()>&& runnable) {\n  static auto jIsOnThread = JavaMessageQueueThread::javaClassStatic()->\n    getMethod<jboolean()>(\"isOnThread\");\n\n  if (jIsOnThread(m_jobj)) {\n    wrapRunnable(std::move(runnable))();\n  } else {\n    std::mutex signalMutex;\n    std::condition_variable signalCv;\n    bool runnableComplete = false;\n\n    runOnQueue([&] () mutable {\n      std::lock_guard<std::mutex> lock(signalMutex);\n\n      runnable();\n      runnableComplete = true;\n\n      signalCv.notify_one();\n    });\n\n    std::unique_lock<std::mutex> lock(signalMutex);\n    signalCv.wait(lock, [&runnableComplete] { return runnableComplete; });\n  }\n}\n\nvoid JMessageQueueThread::quitSynchronous() {\n  static auto method = JavaMessageQueueThread::javaClassStatic()->\n    getMethod<void()>(\"quitSynchronous\");\n  method(m_jobj);\n}\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <functional>\n\n#include <cxxreact/MessageQueueThread.h>\n#include <fb/fbjni.h>\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nclass JavaMessageQueueThread : public jni::JavaClass<JavaMessageQueueThread> {\npublic:\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/queue/MessageQueueThread;\";\n};\n\nclass JMessageQueueThread : public MessageQueueThread {\npublic:\n  JMessageQueueThread(alias_ref<JavaMessageQueueThread::javaobject> jobj);\n\n  /**\n   * Enqueues the given function to run on this MessageQueueThread.\n   */\n  void runOnQueue(std::function<void()>&& runnable) override;\n\n  /**\n   * Synchronously executes the given function to run on this\n   * MessageQueueThread, waiting until it completes.  Can be called from any\n   * thread, but will block if not called on this MessageQueueThread.\n   */\n  void runOnQueueSync(std::function<void()>&& runnable) override;\n\n  /**\n   * Synchronously quits the current MessageQueueThread. Can be called from any thread, but will\n   * block if not called on this MessageQueueThread.\n   */\n  void quitSynchronous() override;\n\n  JavaMessageQueueThread::javaobject jobj() {\n    return m_jobj.get();\n  }\n\nprivate:\n  global_ref<JavaMessageQueueThread::javaobject> m_jobj;\n};\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JNativeRunnable.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <functional>\n\n#include <jni.h>\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nclass Runnable : public JavaClass<Runnable> {\npublic:\n  static constexpr auto kJavaDescriptor = \"Ljava/lang/Runnable;\";\n};\n\n/**\n * The c++ interface for the Java NativeRunnable class\n */\nclass JNativeRunnable : public HybridClass<JNativeRunnable, Runnable> {\npublic:\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/react/bridge/queue/NativeRunnable;\";\n\n  void run() {\n    m_runnable();\n  }\n\n  static void registerNatives() {\n    javaClassStatic()->registerNatives({\n        makeNativeMethod(\"run\", JNativeRunnable::run),\n    });\n  }\nprivate:\n  friend HybridBase;\n\n  JNativeRunnable(std::function<void()> runnable)\n      : m_runnable(std::move(runnable)) {}\n\n  std::function<void()> m_runnable;\n};\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JSCPerfLogging.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSCPerfLogging.h\"\n\n#include <jschelpers/JSCHelpers.h>\n\n#include <fb/log.h>\n#include <fb/fbjni.h>\n\nusing namespace facebook::jni;\n\nnamespace facebook { namespace react {\n\nstruct JQuickPerformanceLogger : JavaClass<JQuickPerformanceLogger> {\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/quicklog/QuickPerformanceLogger;\";\n\n  void markerStart(int markerId, int instanceKey, long timestamp) {\n    static auto markerStartMethod =\n      javaClassStatic()->getMethod<void(jint, jint, jlong)>(\"markerStart\");\n    markerStartMethod(self(), markerId, instanceKey, timestamp);\n  }\n\n  void markerEnd(int markerId, int instanceKey, short actionId, long timestamp) {\n    static auto markerEndMethod =\n      javaClassStatic()->getMethod<void(jint, jint, jshort, jlong)>(\"markerEnd\");\n    markerEndMethod(self(), markerId, instanceKey, actionId, timestamp);\n  }\n\n  void markerTag(int markerId, int instanceKey, alias_ref<jstring> tag) {\n    static auto markerTagMethod =\n      javaClassStatic()->getMethod<void(jint, jint, alias_ref<jstring>)>(\"markerTag\");\n    markerTagMethod(self(), markerId, instanceKey, tag);\n  }\n\n  void markerAnnotate(\n      int markerId,\n      int instanceKey,\n      alias_ref<jstring> key,\n      alias_ref<jstring> value) {\n    static auto markerAnnotateMethod = javaClassStatic()->\n      getMethod<void(jint, jint, alias_ref<jstring>, alias_ref<jstring>)>(\"markerAnnotate\");\n    markerAnnotateMethod(self(), markerId, instanceKey, key, value);\n  }\n\n  void markerNote(int markerId, int instanceKey, short actionId, long timestamp) {\n    static auto markerNoteMethod =\n      javaClassStatic()->getMethod<void(jint, jint, jshort, jlong)>(\"markerNote\");\n    markerNoteMethod(self(), markerId, instanceKey, actionId, timestamp);\n  }\n\n  void markerCancel(int markerId, int instanceKey) {\n    static auto markerCancelMethod =\n      javaClassStatic()->getMethod<void(jint, jint)>(\"markerCancel\");\n    markerCancelMethod(self(), markerId, instanceKey);\n  }\n\n  int64_t currentMonotonicTimestamp() {\n    static auto currentTimestampMethod =\n      javaClassStatic()->getMethod<jlong()>(\"currentMonotonicTimestamp\");\n    return currentTimestampMethod(self());\n  }\n};\n\nstruct JQuickPerformanceLoggerProvider : JavaClass<JQuickPerformanceLoggerProvider> {\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/quicklog/QuickPerformanceLoggerProvider;\";\n\n  static alias_ref<JQuickPerformanceLogger::javaobject> get() {\n    static auto getQPLInstMethod =\n      javaClassStatic()->getStaticMethod<JQuickPerformanceLogger::javaobject()>(\"getQPLInstance\");\n    static auto logger = make_global(getQPLInstMethod(javaClassStatic()));\n    return logger;\n  }\n};\n\nstatic bool isReady() {\n  static bool ready = false;\n  if (!ready) {\n    try {\n      // TODO: findClassStatic only does the lookup once. If we can't find\n      // QuickPerformanceLoggerProvider the first time we call this, we will always fail here.\n      findClassStatic(\"com/facebook/quicklog/QuickPerformanceLoggerProvider\");\n    } catch(...) {\n      // Swallow this exception - we don't want to crash the app, an error is enough.\n      FBLOGE(\"Calling QPL from JS before class has been loaded in Java. Ignored.\");\n      return false;\n    }\n    if (JQuickPerformanceLoggerProvider::get()) {\n      ready = true;\n    } else {\n      FBLOGE(\"Calling QPL from JS before it has been initialized in Java. Ignored.\");\n      return false;\n    }\n  }\n  return ready;\n}\n\n// After having read the implementation of PNaN that is returned from JSValueToNumber, and some\n// more material on how NaNs are constructed, I think this is the most consistent way to verify\n// NaN with how we generate it.\n// Once the integration completes, I'll play around with it some more and potentially change this\n// implementation to use std::isnan() if it is exactly commensurate with our usage.\nstatic bool isNan(double value) {\n  return (value != value);\n}\n\n// Safely translates JSValues to an array of doubles.\nstatic bool grabDoubles(\n    size_t targetsCount,\n    double targets[],\n    JSContextRef ctx,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  if (argumentCount < targetsCount) {\n    return false;\n  }\n  for (size_t i = 0 ; i < targetsCount ; i++) {\n    targets[i] = JSValueToNumber(ctx, arguments[i], exception);\n    if (isNan(targets[i])) {\n      return false;\n    }\n  }\n  return true;\n}\n\nstatic local_ref<jstring> getJStringFromJSValueRef(JSContextRef ctx, JSValueRef ref) {\n    JSStringRef jsStringRef = JSValueToStringCopy(ctx, ref, nullptr);\n    const JSChar* chars = JSStringGetCharactersPtr(jsStringRef);\n    const size_t length = JSStringGetLength(jsStringRef);\n    local_ref<jstring> returnStr = adopt_local(Environment::current()->NewString(chars, length));\n    JSStringRelease(jsStringRef);\n    return returnStr;\n}\n\nstatic JSValueRef nativeQPLMarkerStart(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  double targets[3];\n  if (isReady() && grabDoubles(3, targets, ctx, argumentCount, arguments, exception)) {\n    int32_t markerId = (int32_t) targets[0];\n    int32_t instanceKey = (int32_t) targets[1];\n    int64_t timestamp = (int64_t) targets[2];\n    JQuickPerformanceLoggerProvider::get()->markerStart(markerId, instanceKey, timestamp);\n  }\n  return JSValueMakeUndefined(ctx);\n}\n\nstatic JSValueRef nativeQPLMarkerEnd(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  double targets[4];\n  if (isReady() && grabDoubles(4, targets, ctx, argumentCount, arguments, exception)) {\n    int32_t markerId = (int32_t) targets[0];\n    int32_t instanceKey = (int32_t) targets[1];\n    int16_t actionId = (int16_t) targets[2];\n    int64_t timestamp = (int64_t) targets[3];\n    JQuickPerformanceLoggerProvider::get()->markerEnd(markerId, instanceKey, actionId, timestamp);\n  }\n  return JSValueMakeUndefined(ctx);\n}\n\nstatic JSValueRef nativeQPLMarkerTag(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  double targets[2];\n  if (isReady() && grabDoubles(2, targets, ctx, argumentCount, arguments, exception)) {\n    int32_t markerId = (int32_t) targets[0];\n    int32_t instanceKey = (int32_t) targets[1];\n    local_ref<jstring> tag = getJStringFromJSValueRef(ctx, arguments[2]);\n    JQuickPerformanceLoggerProvider::get()->markerTag(markerId, instanceKey, tag);\n  }\n  return JSValueMakeUndefined(ctx);\n}\n\nstatic JSValueRef nativeQPLMarkerAnnotate(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  double targets[2];\n  if (isReady() && grabDoubles(2, targets, ctx, argumentCount, arguments, exception)) {\n    int32_t markerId = (int32_t) targets[0];\n    int32_t instanceKey = (int32_t) targets[1];\n    local_ref<jstring> key = getJStringFromJSValueRef(ctx, arguments[2]);\n    local_ref<jstring> value = getJStringFromJSValueRef(ctx, arguments[3]);\n    JQuickPerformanceLoggerProvider::get()->markerAnnotate(markerId, instanceKey, key, value);\n  }\n  return JSValueMakeUndefined(ctx);\n}\n\nstatic JSValueRef nativeQPLMarkerNote(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  double targets[4];\n  if (isReady() && grabDoubles(4, targets, ctx, argumentCount, arguments, exception)) {\n    int32_t markerId = (int32_t) targets[0];\n    int32_t instanceKey = (int32_t) targets[1];\n    int16_t actionId = (int16_t) targets[2];\n    int64_t timestamp = (int64_t) targets[3];\n    JQuickPerformanceLoggerProvider::get()->markerNote(markerId, instanceKey, actionId, timestamp);\n  }\n  return JSValueMakeUndefined(ctx);\n}\n\nstatic JSValueRef nativeQPLMarkerCancel(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  double targets[2];\n  if (isReady() && grabDoubles(2, targets, ctx, argumentCount, arguments, exception)) {\n    int32_t markerId = (int32_t) targets[0];\n    int32_t instanceKey = (int32_t) targets[1];\n    JQuickPerformanceLoggerProvider::get()->markerCancel(markerId, instanceKey);\n  }\n  return JSValueMakeUndefined(ctx);\n}\n\nstatic JSValueRef nativeQPLTimestamp(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  if (!isReady()) {\n    return JSValueMakeNumber(ctx, 0);\n  }\n  int64_t timestamp = JQuickPerformanceLoggerProvider::get()->currentMonotonicTimestamp();\n  // Since this is monotonic time, I assume the 52 bits of mantissa are enough in the double value.\n  return JSValueMakeNumber(ctx, timestamp);\n}\n\nvoid addNativePerfLoggingHooks(JSGlobalContextRef ctx) {\n  installGlobalFunction(ctx, \"nativeQPLMarkerStart\", nativeQPLMarkerStart);\n  installGlobalFunction(ctx, \"nativeQPLMarkerEnd\", nativeQPLMarkerEnd);\n  installGlobalFunction(ctx, \"nativeQPLMarkerTag\", nativeQPLMarkerTag);\n  installGlobalFunction(ctx, \"nativeQPLMarkerAnnotate\", nativeQPLMarkerAnnotate);\n  installGlobalFunction(ctx, \"nativeQPLMarkerNote\", nativeQPLMarkerNote);\n  installGlobalFunction(ctx, \"nativeQPLMarkerCancel\", nativeQPLMarkerCancel);\n  installGlobalFunction(ctx, \"nativeQPLTimestamp\", nativeQPLTimestamp);\n}\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JSCPerfLogging.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <JavaScriptCore/JSContextRef.h>\n\nnamespace facebook {\nnamespace react {\n\nvoid addNativePerfLoggingHooks(JSGlobalContextRef ctx);\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JSLoader.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSLoader.h\"\n\n#include <android/asset_manager_jni.h>\n#include <cxxreact/JSBigString.h>\n#include <fb/fbjni.h>\n#include <fb/log.h>\n#include <folly/Conv.h>\n#include <folly/Memory.h>\n#include <fstream>\n#include <sstream>\n#include <streambuf>\n#include <string>\n\n#ifdef WITH_FBSYSTRACE\n#include <fbsystrace.h>\nusing fbsystrace::FbSystraceSection;\n#endif\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\n__attribute__((visibility(\"default\")))\nAAssetManager *extractAssetManager(alias_ref<JAssetManager::javaobject> assetManager) {\n  auto env = Environment::current();\n  return AAssetManager_fromJava(env, assetManager.get());\n}\n\n__attribute__((visibility(\"default\")))\nstd::unique_ptr<const JSBigString> loadScriptFromAssets(\n    AAssetManager *manager,\n    const std::string& assetName) {\n  #ifdef WITH_FBSYSTRACE\n  FbSystraceSection s(TRACE_TAG_REACT_CXX_BRIDGE, \"reactbridge_jni_loadScriptFromAssets\",\n    \"assetName\", assetName);\n  #endif\n  if (manager) {\n    auto asset = AAssetManager_open(\n      manager,\n      assetName.c_str(),\n      AASSET_MODE_STREAMING); // Optimized for sequential read: see AssetManager.java for docs\n    if (asset) {\n      auto buf = folly::make_unique<JSBigBufferString>(AAsset_getLength(asset));\n      size_t offset = 0;\n      int readbytes;\n      while ((readbytes = AAsset_read(asset, buf->data() + offset, buf->size() - offset)) > 0) {\n        offset += readbytes;\n      }\n      AAsset_close(asset);\n      if (offset == buf->size()) {\n        return std::move(buf);\n      }\n    }\n  }\n\n  throw std::runtime_error(folly::to<std::string>(\"Unable to load script from assets '\", assetName,\n    \"'. Make sure your bundle is packaged correctly or you're running a packager server.\"));\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JSLoader.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <string>\n\n#include <android/asset_manager.h>\n#include <cxxreact/JSExecutor.h>\n#include <fb/fbjni.h>\n\nnamespace facebook {\nnamespace react {\n\nstruct JAssetManager : jni::JavaClass<JAssetManager> {\n  static constexpr auto kJavaDescriptor = \"Landroid/content/res/AssetManager;\";\n};\n\n/**\n * Helper method for loading JS script from android asset\n */\nAAssetManager *extractAssetManager(jni::alias_ref<JAssetManager::javaobject> assetManager);\n\nstd::unique_ptr<const JSBigString> loadScriptFromAssets(AAssetManager *assetManager, const std::string& assetName);\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JSLogging.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSLogging.h\"\n\n#include <android/log.h>\n#include <algorithm>\n#include <fb/log.h>\n\n#include <jschelpers/Value.h>\n\nnamespace facebook {\nnamespace react {\n\nJSValueRef nativeLoggingHook(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[], JSValueRef *exception) {\n  android_LogPriority logLevel = ANDROID_LOG_DEBUG;\n  if (argumentCount > 1) {\n    int level = (int)Value(ctx, arguments[1]).asNumber();\n    // The lowest log level we get from JS is 0. We shift and cap it to be\n    // in the range the Android logging method expects.\n    logLevel = std::min(\n        static_cast<android_LogPriority>(level + ANDROID_LOG_DEBUG),\n        ANDROID_LOG_FATAL);\n  }\n  if (argumentCount > 0) {\n    String message = Value(ctx, arguments[0]).toString();\n    FBLOG_PRI(logLevel, \"ReactNativeJS\", \"%s\", message.str().c_str());\n  }\n  return Value::makeUndefined(ctx);\n}\n\n}};\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JSLogging.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <JavaScriptCore/JSContextRef.h>\n\nnamespace facebook {\nnamespace react {\n\nJSValueRef nativeLoggingHook(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[], JSValueRef *exception);\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JavaModuleWrapper.h\"\n\n#include <fb/fbjni.h>\n#include <folly/json.h>\n#include <cxxreact/CxxModule.h>\n#include <cxxreact/CxxNativeModule.h>\n#include <cxxreact/Instance.h>\n#include <cxxreact/JsArgumentHelpers.h>\n#include <cxxreact/NativeModule.h>\n\n#ifdef WITH_FBSYSTRACE\n#include <fbsystrace.h>\n#endif\n\n#include \"CatalystInstanceImpl.h\"\n#include \"ReadableNativeArray.h\"\n\nusing facebook::xplat::module::CxxModule;\n\nnamespace facebook {\nnamespace react {\n\nstd::string JMethodDescriptor::getSignature() const {\n  static auto signature = javaClassStatic()->getField<jstring>(\"signature\");\n  return getFieldValue(signature)->toStdString();\n}\n\nstd::string JMethodDescriptor::getName() const {\n  static auto name = javaClassStatic()->getField<jstring>(\"name\");\n  return getFieldValue(name)->toStdString();\n}\n\nstd::string JMethodDescriptor::getType() const {\n  static auto type = javaClassStatic()->getField<jstring>(\"type\");\n  return getFieldValue(type)->toStdString();\n}\n\nstd::string JavaNativeModule::getName() {\n  static auto getNameMethod = wrapper_->getClass()->getMethod<jstring()>(\"getName\");\n  return getNameMethod(wrapper_)->toStdString();\n}\n\nstd::vector<MethodDescriptor> JavaNativeModule::getMethods() {\n  std::vector<MethodDescriptor> ret;\n  syncMethods_.clear();\n  auto descs = wrapper_->getMethodDescriptors();\n  for (const auto& desc : *descs) {\n    auto methodName = desc->getName();\n    auto methodType = desc->getType();\n\n    if (methodType == \"sync\") {\n      // allow for the sync methods vector to have empty values, resize on demand\n      size_t methodIndex = ret.size();\n      if (methodIndex >= syncMethods_.size()) {\n        syncMethods_.resize(methodIndex + 1);\n      }\n      syncMethods_.insert(syncMethods_.begin() + methodIndex, MethodInvoker(\n        desc->getMethod(),\n        desc->getSignature(),\n        getName() + \".\" + methodName,\n        true\n      ));\n    }\n\n    ret.emplace_back(\n      std::move(methodName),\n      std::move(methodType)\n    );\n  }\n  return ret;\n}\n\nfolly::dynamic JavaNativeModule::getConstants() {\n  static auto constantsMethod =\n    wrapper_->getClass()->getMethod<NativeMap::javaobject()>(\"getConstants\");\n  auto constants = constantsMethod(wrapper_);\n  if (!constants) {\n    return nullptr;\n  } else {\n    return cthis(constants)->consume();\n  }\n}\n\nvoid JavaNativeModule::invoke(unsigned int reactMethodId, folly::dynamic&& params, int callId) {\n  messageQueueThread_->runOnQueue([this, reactMethodId, params=std::move(params), callId] {\n    static auto invokeMethod = wrapper_->getClass()->getMethod<void(jint, ReadableNativeArray::javaobject)>(\"invoke\");\n    #ifdef WITH_FBSYSTRACE\n    if (callId != -1) {\n      fbsystrace_end_async_flow(TRACE_TAG_REACT_APPS, \"native\", callId);\n    }\n    #endif\n    invokeMethod(\n      wrapper_,\n      static_cast<jint>(reactMethodId),\n      ReadableNativeArray::newObjectCxxArgs(std::move(params)).get());\n  });\n}\n\nMethodCallResult JavaNativeModule::callSerializableNativeHook(unsigned int reactMethodId, folly::dynamic&& params) {\n  // TODO: evaluate whether calling through invoke is potentially faster\n  if (reactMethodId >= syncMethods_.size()) {\n    throw std::invalid_argument(\n      folly::to<std::string>(\"methodId \", reactMethodId, \" out of range [0..\", syncMethods_.size(), \"]\"));\n  }\n\n  auto& method = syncMethods_[reactMethodId];\n  CHECK(method.hasValue() && method->isSyncHook()) << \"Trying to invoke a asynchronous method as synchronous hook\";\n  return method->invoke(instance_, wrapper_->getModule(), params);\n}\n\nNewJavaNativeModule::NewJavaNativeModule(\n  std::weak_ptr<Instance> instance,\n  jni::alias_ref<JavaModuleWrapper::javaobject> wrapper,\n  std::shared_ptr<MessageQueueThread> messageQueueThread)\n: instance_(std::move(instance))\n, wrapper_(make_global(wrapper))\n, module_(make_global(wrapper->getModule()))\n, messageQueueThread_(std::move(messageQueueThread)) {\n  auto descs = wrapper_->getMethodDescriptors();\n  std::string moduleName = getName();\n  methods_.reserve(descs->size());\n\n  for (const auto& desc : *descs) {\n    auto type = desc->getType();\n    auto name = desc->getName();\n    methods_.emplace_back(\n        desc->getMethod(),\n        desc->getSignature(),\n        moduleName + \".\" + name,\n        type == \"syncHook\");\n\n    methodDescriptors_.emplace_back(name, type);\n  }\n}\n\nstd::string NewJavaNativeModule::getName() {\n  static auto getNameMethod = wrapper_->getClass()->getMethod<jstring()>(\"getName\");\n  return getNameMethod(wrapper_)->toStdString();\n}\n\nstd::vector<MethodDescriptor> NewJavaNativeModule::getMethods() {\n  return methodDescriptors_;\n}\n\nfolly::dynamic NewJavaNativeModule::getConstants() {\n  static auto constantsMethod =\n    wrapper_->getClass()->getMethod<NativeMap::javaobject()>(\"getConstants\");\n  auto constants = constantsMethod(wrapper_);\n  if (!constants) {\n    return nullptr;\n  } else {\n    return cthis(constants)->consume();\n  }\n}\n\nvoid NewJavaNativeModule::invoke(unsigned int reactMethodId, folly::dynamic&& params, int callId) {\n  if (reactMethodId >= methods_.size()) {\n    throw std::invalid_argument(\n      folly::to<std::string>(\"methodId \", reactMethodId, \" out of range [0..\", methods_.size(), \"]\"));\n  }\n  CHECK(!methods_[reactMethodId].isSyncHook()) << \"Trying to invoke a synchronous hook asynchronously\";\n  messageQueueThread_->runOnQueue([this, reactMethodId, params=std::move(params), callId] () mutable {\n    #ifdef WITH_FBSYSTRACE\n    if (callId != -1) {\n      fbsystrace_end_async_flow(TRACE_TAG_REACT_APPS, \"native\", callId);\n    }\n    #endif\n    invokeInner(reactMethodId, std::move(params));\n  });\n}\n\nMethodCallResult NewJavaNativeModule::callSerializableNativeHook(unsigned int reactMethodId, folly::dynamic&& params) {\n  if (reactMethodId >= methods_.size()) {\n    throw std::invalid_argument(\n      folly::to<std::string>(\"methodId \", reactMethodId, \" out of range [0..\", methods_.size(), \"]\"));\n  }\n  CHECK(methods_[reactMethodId].isSyncHook()) << \"Trying to invoke a asynchronous method as synchronous hook\";\n  return invokeInner(reactMethodId, std::move(params));\n}\n\nMethodCallResult NewJavaNativeModule::invokeInner(unsigned int reactMethodId, folly::dynamic&& params) {\n  return methods_[reactMethodId].invoke(instance_, module_.get(), params);\n}\n\njni::local_ref<JReflectMethod::javaobject> JMethodDescriptor::getMethod() const {\n  static auto method = javaClassStatic()->getField<JReflectMethod::javaobject>(\"method\");\n  return getFieldValue(method);\n}\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <cxxreact/NativeModule.h>\n#include <fb/fbjni.h>\n#include <folly/Optional.h>\n\n#include \"MethodInvoker.h\"\n\nnamespace facebook {\nnamespace react {\n\nclass Instance;\nclass MessageQueueThread;\n\nstruct JMethodDescriptor : public jni::JavaClass<JMethodDescriptor> {\n  static constexpr auto kJavaDescriptor =\n    \"Lcom/facebook/react/bridge/JavaModuleWrapper$MethodDescriptor;\";\n\n  jni::local_ref<JReflectMethod::javaobject> getMethod() const;\n  std::string getSignature() const;\n  std::string getName() const;\n  std::string getType() const;\n};\n\nstruct JavaModuleWrapper : jni::JavaClass<JavaModuleWrapper> {\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/JavaModuleWrapper;\";\n\n  jni::local_ref<JBaseJavaModule::javaobject> getModule() {\n    // This is the call which causes a lazy Java module to actually be\n    // created.\n    static auto getModule = javaClassStatic()->getMethod<JBaseJavaModule::javaobject()>(\"getModule\");\n    return getModule(self());\n  }\n\n  std::string getName() const {\n    static auto getName = javaClassStatic()->getMethod<jstring()>(\"getName\");\n    return getName(self())->toStdString();\n  }\n\n  jni::local_ref<jni::JList<JMethodDescriptor::javaobject>::javaobject> getMethodDescriptors() {\n    static auto getMethods = getClass()\n      ->getMethod<jni::JList<JMethodDescriptor::javaobject>::javaobject()>(\"getMethodDescriptors\");\n    return getMethods(self());\n  }\n};\n\nclass JavaNativeModule : public NativeModule {\n public:\n  JavaNativeModule(\n    std::weak_ptr<Instance> instance,\n    jni::alias_ref<JavaModuleWrapper::javaobject> wrapper,\n    std::shared_ptr<MessageQueueThread> messageQueueThread)\n  : instance_(std::move(instance))\n  , wrapper_(make_global(wrapper))\n  , messageQueueThread_(std::move(messageQueueThread)) {}\n\n  std::string getName() override;\n  folly::dynamic getConstants() override;\n  std::vector<MethodDescriptor> getMethods() override;\n  void invoke(unsigned int reactMethodId, folly::dynamic&& params, int callId) override;\n  MethodCallResult callSerializableNativeHook(unsigned int reactMethodId, folly::dynamic&& params) override;\n\n private:\n  std::weak_ptr<Instance> instance_;\n  jni::global_ref<JavaModuleWrapper::javaobject> wrapper_;\n  std::shared_ptr<MessageQueueThread> messageQueueThread_;\n  std::vector<folly::Optional<MethodInvoker>> syncMethods_;\n};\n\n// Experimental new implementation that uses direct method invocation\nclass NewJavaNativeModule : public NativeModule {\n public:\n  NewJavaNativeModule(\n    std::weak_ptr<Instance> instance,\n    jni::alias_ref<JavaModuleWrapper::javaobject> wrapper,\n    std::shared_ptr<MessageQueueThread> messageQueueThread);\n\n  std::string getName() override;\n  std::vector<MethodDescriptor> getMethods() override;\n  folly::dynamic getConstants() override;\n  void invoke(unsigned int reactMethodId, folly::dynamic&& params, int callId) override;\n  MethodCallResult callSerializableNativeHook(unsigned int reactMethodId, folly::dynamic&& params) override;\n\n private:\n  std::weak_ptr<Instance> instance_;\n  jni::global_ref<JavaModuleWrapper::javaobject> wrapper_;\n  jni::global_ref<JBaseJavaModule::javaobject> module_;\n  std::shared_ptr<MessageQueueThread> messageQueueThread_;\n  std::vector<MethodInvoker> methods_;\n  std::vector<MethodDescriptor> methodDescriptors_;\n\n  MethodCallResult invokeInner(unsigned int reactMethodId, folly::dynamic&& params);\n};\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JavaScriptExecutorHolder.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <memory>\n\n#include <cxxreact/JSExecutor.h>\n#include <fb/fbjni.h>\n\nnamespace facebook {\nnamespace react {\n\nclass JavaScriptExecutorHolder : public jni::HybridClass<JavaScriptExecutorHolder> {\n public:\n  static constexpr auto kJavaDescriptor =\n    \"Lcom/facebook/react/bridge/JavaScriptExecutor;\";\n\n  std::shared_ptr<JSExecutorFactory> getExecutorFactory() {\n    return mExecutorFactory;\n  }\n\n protected:\n  JavaScriptExecutorHolder(std::shared_ptr<JSExecutorFactory> factory)\n      : mExecutorFactory(factory) {}\n\n private:\n  std::shared_ptr<JSExecutorFactory> mExecutorFactory;\n};\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JniJSModulesUnbundle.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JniJSModulesUnbundle.h\"\n\n#include <cstdint>\n#include <fb/assert.h>\n#include <libgen.h>\n#include <memory>\n#include <sstream>\n#include <sys/endian.h>\n#include <utility>\n\n#include <folly/Memory.h>\n\nusing magic_number_t = uint32_t;\nconst magic_number_t MAGIC_FILE_HEADER = 0xFB0BD1E5;\nconst char* MAGIC_FILE_NAME = \"UNBUNDLE\";\n\nnamespace facebook {\nnamespace react {\n\nusing asset_ptr =\n  std::unique_ptr<AAsset, std::function<decltype(AAsset_close)>>;\n\nstatic std::string jsModulesDir(const std::string& entryFile) {\n  std::string dir = dirname(entryFile.c_str());\n\n  // android's asset manager does not work with paths that start with a dot\n  return dir == \".\" ? \"js-modules/\" : dir + \"/js-modules/\";\n}\n\nstatic asset_ptr openAsset(\n    AAssetManager *manager,\n    const std::string& fileName,\n    int mode = AASSET_MODE_STREAMING) {\n  return asset_ptr(\n    AAssetManager_open(manager, fileName.c_str(), mode),\n    AAsset_close);\n}\n\nstd::unique_ptr<JniJSModulesUnbundle> JniJSModulesUnbundle::fromEntryFile(\n  AAssetManager *assetManager,\n  const std::string& entryFile) {\n    return folly::make_unique<JniJSModulesUnbundle>(assetManager, jsModulesDir(entryFile));\n  }\n\nJniJSModulesUnbundle::JniJSModulesUnbundle(AAssetManager *assetManager, const std::string& moduleDirectory) :\n  m_assetManager(assetManager),\n  m_moduleDirectory(moduleDirectory) {}\n\nbool JniJSModulesUnbundle::isUnbundle(\n    AAssetManager *assetManager,\n    const std::string& assetName) {\n  if (!assetManager) {\n    return false;\n  }\n\n  auto magicFileName = jsModulesDir(assetName) + MAGIC_FILE_NAME;\n  auto asset = openAsset(assetManager, magicFileName.c_str());\n  if (asset == nullptr) {\n    return false;\n  }\n\n  magic_number_t fileHeader = 0;\n  AAsset_read(asset.get(), &fileHeader, sizeof(fileHeader));\n  return fileHeader == htole32(MAGIC_FILE_HEADER);\n}\n\nJSModulesUnbundle::Module JniJSModulesUnbundle::getModule(uint32_t moduleId) const {\n  // can be nullptr for default constructor.\n  FBASSERTMSGF(m_assetManager != nullptr, \"Unbundle has not been initialized with an asset manager\");\n\n  std::ostringstream sourceUrlBuilder;\n  sourceUrlBuilder << moduleId << \".js\";\n  auto sourceUrl = sourceUrlBuilder.str();\n\n  auto fileName = m_moduleDirectory + sourceUrl;\n  auto asset = openAsset(m_assetManager, fileName, AASSET_MODE_BUFFER);\n\n  const char *buffer = nullptr;\n  if (asset != nullptr) {\n    buffer = static_cast<const char *>(AAsset_getBuffer(asset.get()));\n  }\n  if (buffer == nullptr) {\n    throw ModuleNotFound(\"Module not found: \" + sourceUrl);\n  }\n  return {sourceUrl, std::string(buffer, AAsset_getLength(asset.get()))};\n}\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/JniJSModulesUnbundle.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <memory>\n\n#include <android/asset_manager.h>\n#include <cxxreact/JSModulesUnbundle.h>\n\nnamespace facebook {\nnamespace react {\n\nclass JniJSModulesUnbundle : public JSModulesUnbundle {\n  /**\n   * This implementation reads modules as single file from the assets of an apk.\n   */\npublic:\n  JniJSModulesUnbundle() = default;\n  JniJSModulesUnbundle(AAssetManager *assetManager, const std::string& moduleDirectory);\n  JniJSModulesUnbundle(JniJSModulesUnbundle&& other) = delete;\n  JniJSModulesUnbundle& operator= (JSModulesUnbundle&& other) = delete;\n\n  static std::unique_ptr<JniJSModulesUnbundle> fromEntryFile(AAssetManager *assetManager, const std::string& entryFile);\n\n  static bool isUnbundle(\n    AAssetManager *assetManager,\n    const std::string& assetName);\n  virtual Module getModule(uint32_t moduleId) const override;\nprivate:\n  AAssetManager *m_assetManager = nullptr;\n  std::string m_moduleDirectory;\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/MethodInvoker.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"MethodInvoker.h\"\n\n#ifdef WITH_FBSYSTRACE\n#include <fbsystrace.h>\n#endif\n\n#include <cxxreact/CxxNativeModule.h>\n#include <fb/fbjni.h>\n\n#include \"JCallback.h\"\n#include \"ReadableNativeArray.h\"\n#include \"ReadableNativeMap.h\"\n#include \"WritableNativeArray.h\"\n#include \"WritableNativeMap.h\"\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nnamespace {\n\nusing dynamic_iterator = folly::dynamic::const_iterator;\n\nstruct JPromiseImpl : public JavaClass<JPromiseImpl> {\n  constexpr static auto kJavaDescriptor = \"Lcom/facebook/react/bridge/PromiseImpl;\";\n\n  static local_ref<javaobject> create(local_ref<JCallback::javaobject> resolve, local_ref<JCallback::javaobject> reject) {\n    return newInstance(resolve, reject);\n  }\n};\n\n// HACK: Exposes constructor\nstruct ExposedReadableNativeArray : public ReadableNativeArray {\n  explicit ExposedReadableNativeArray(folly::dynamic array)\n    : ReadableNativeArray(std::move(array)) {}\n};\n\njdouble extractDouble(const folly::dynamic& value) {\n  if (value.isInt()) {\n    return static_cast<jdouble>(value.getInt());\n  } else {\n    return static_cast<jdouble>(value.getDouble());\n  }\n}\n\nlocal_ref<JCxxCallbackImpl::jhybridobject> extractCallback(std::weak_ptr<Instance>& instance, const folly::dynamic& value) {\n  if (value.isNull()) {\n    return local_ref<JCxxCallbackImpl::jhybridobject>(nullptr);\n  } else {\n    return JCxxCallbackImpl::newObjectCxxArgs(makeCallback(instance, value));\n  }\n}\n\nlocal_ref<JPromiseImpl::javaobject> extractPromise(std::weak_ptr<Instance>& instance, dynamic_iterator& it, dynamic_iterator& end) {\n  auto resolve = extractCallback(instance, *it++);\n  CHECK(it != end);\n  auto reject = extractCallback(instance, *it++);\n  return JPromiseImpl::create(resolve, reject);\n}\n\nbool isNullable(char type) {\n  switch (type) {\n    case 'Z':\n    case 'I':\n    case 'F':\n    case 'S':\n    case 'A':\n    case 'M':\n    case 'X':\n      return true;\n    default:\n      return false;;\n  }\n}\n\njvalue extract(std::weak_ptr<Instance>& instance, char type, dynamic_iterator& it, dynamic_iterator& end) {\n  CHECK(it != end);\n  jvalue value;\n  if (type == 'P') {\n    value.l = extractPromise(instance, it, end).release();\n    return value;\n  }\n\n  const auto& arg = *it++;\n  if (isNullable(type) && arg.isNull()) {\n    value.l = nullptr;\n    return value;\n  }\n\n  switch (type) {\n    case 'z':\n      value.z = static_cast<jboolean>(arg.getBool());\n      break;\n    case 'Z':\n      value.l = JBoolean::valueOf(static_cast<jboolean>(arg.getBool())).release();\n      break;\n    case 'i':\n      value.i = static_cast<jint>(arg.getInt());\n      break;\n    case 'I':\n      value.l = JInteger::valueOf(static_cast<jint>(arg.getInt())).release();\n      break;\n    case 'f':\n      value.f = static_cast<jfloat>(extractDouble(arg));\n      break;\n    case 'F':\n      value.l = JFloat::valueOf(static_cast<jfloat>(extractDouble(arg))).release();\n      break;\n    case 'd':\n      value.d = extractDouble(arg);\n      break;\n    case 'D':\n      value.l = JDouble::valueOf(extractDouble(arg)).release();\n      break;\n    case 'S':\n      value.l = make_jstring(arg.getString().c_str()).release();\n      break;\n    case 'A':\n      value.l = ReadableNativeArray::newObjectCxxArgs(arg).release();\n      break;\n    case 'M':\n      value.l = ReadableNativeMap::newObjectCxxArgs(arg).release();\n      break;\n    case 'X':\n      value.l = extractCallback(instance, arg).release();\n      break;\n    default:\n      LOG(FATAL) << \"Unknown param type: \" << type;\n  }\n  return value;\n}\n\nstd::size_t countJsArgs(const std::string& signature) {\n  std::size_t count = 0;\n  for (char c : signature) {\n    switch (c) {\n      case 'P':\n        count += 2;\n        break;\n      default:\n        count += 1;\n        break;\n    }\n  }\n  return count;\n}\n\n}\n\nMethodInvoker::MethodInvoker(alias_ref<JReflectMethod::javaobject> method, std::string signature, std::string traceName, bool isSync)\n : method_(method->getMethodID()),\n signature_(signature),\n jsArgCount_(countJsArgs(signature) -2),\n traceName_(std::move(traceName)),\n isSync_(isSync) {\n     CHECK(signature_.at(1) == '.') << \"Improper module method signature\";\n     CHECK(isSync_ || signature_.at(0) == 'v') << \"Non-sync hooks cannot have a non-void return type\";\n}\n\nMethodCallResult MethodInvoker::invoke(std::weak_ptr<Instance>& instance, alias_ref<JBaseJavaModule::javaobject> module, const folly::dynamic& params) {\n  #ifdef WITH_FBSYSTRACE\n  fbsystrace::FbSystraceSection s(\n      TRACE_TAG_REACT_CXX_BRIDGE,\n      isSync_ ? \"callJavaSyncHook\" : \"callJavaModuleMethod\",\n      \"method\",\n      traceName_);\n  #endif\n\n  if (params.size() != jsArgCount_) {\n    throw std::invalid_argument(folly::to<std::string>(\"expected \", jsArgCount_, \" arguments, got \", params.size()));\n  }\n\n  auto env = Environment::current();\n  auto argCount = signature_.size() - 2;\n  JniLocalScope scope(env, argCount);\n  jvalue args[argCount];\n  std::transform(\n    signature_.begin() + 2,\n    signature_.end(),\n    args,\n    [&instance, it = params.begin(), end = params.end()] (char type) mutable {\n      return extract(instance, type, it, end);\n  });\n\n#define PRIMITIVE_CASE(METHOD) {                                             \\\n  auto result = env->Call ## METHOD ## MethodA(module.get(), method_, args); \\\n  throwPendingJniExceptionAsCppException();                                  \\\n  return folly::dynamic(result);                                             \\\n}\n\n#define PRIMITIVE_CASE_CASTING(METHOD, RESULT_TYPE) {                        \\\n  auto result = env->Call ## METHOD ## MethodA(module.get(), method_, args); \\\n  throwPendingJniExceptionAsCppException();                                  \\\n  return folly::dynamic(static_cast<RESULT_TYPE>(result));                   \\\n}\n\n#define OBJECT_CASE(JNI_CLASS, ACTIONS) {                                 \\\n  auto jobject = env->CallObjectMethodA(module.get(), method_, args);     \\\n  throwPendingJniExceptionAsCppException();                               \\\n  auto result = adopt_local(static_cast<JNI_CLASS::javaobject>(jobject)); \\\n  return folly::dynamic(result->ACTIONS());                               \\\n}\n\n#define OBJECT_CASE_CASTING(JNI_CLASS, ACTIONS, RESULT_TYPE) {            \\\n  auto jobject = env->CallObjectMethodA(module.get(), method_, args);     \\\n  throwPendingJniExceptionAsCppException();                               \\\n  auto result = adopt_local(static_cast<JNI_CLASS::javaobject>(jobject)); \\\n  return folly::dynamic(static_cast<RESULT_TYPE>(result->ACTIONS()));     \\\n}\n\n  char returnType = signature_.at(0);\n  switch (returnType) {\n    case 'v':\n      env->CallVoidMethodA(module.get(), method_, args);\n      throwPendingJniExceptionAsCppException();\n      return folly::none;\n\n    case 'z':\n      PRIMITIVE_CASE_CASTING(Boolean, bool)\n    case 'Z':\n      OBJECT_CASE_CASTING(JBoolean, value, bool)\n    case 'i':\n      PRIMITIVE_CASE(Int)\n    case 'I':\n      OBJECT_CASE(JInteger, value)\n    case 'd':\n      PRIMITIVE_CASE(Double)\n    case 'D':\n      OBJECT_CASE(JDouble, value)\n    case 'f':\n      PRIMITIVE_CASE(Float)\n    case 'F':\n      OBJECT_CASE(JFloat, value)\n\n    case 'S':\n      OBJECT_CASE(JString, toStdString)\n    case 'M':\n      OBJECT_CASE(WritableNativeMap, cthis()->consume)\n    case 'A':\n      OBJECT_CASE(WritableNativeArray, cthis()->consume)\n\n    default:\n      LOG(FATAL) << \"Unknown return type: \" << returnType;\n      return folly::none;\n  }\n}\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/MethodInvoker.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <vector>\n\n#include <cxxreact/JSExecutor.h>\n#include <fb/fbjni.h>\n#include <folly/dynamic.h>\n\nnamespace facebook {\nnamespace react {\n\nclass Instance;\n\nstruct JReflectMethod : public jni::JavaClass<JReflectMethod> {\n  static constexpr auto kJavaDescriptor = \"Ljava/lang/reflect/Method;\";\n\n  jmethodID getMethodID() {\n    auto id = jni::Environment::current()->FromReflectedMethod(self());\n    jni::throwPendingJniExceptionAsCppException();\n    return id;\n  }\n};\n\nstruct JBaseJavaModule : public jni::JavaClass<JBaseJavaModule> {\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/BaseJavaModule;\";\n};\n\nclass MethodInvoker {\npublic:\n  MethodInvoker(jni::alias_ref<JReflectMethod::javaobject> method, std::string signature, std::string traceName, bool isSync);\n\n  MethodCallResult invoke(std::weak_ptr<Instance>& instance, jni::alias_ref<JBaseJavaModule::javaobject> module, const folly::dynamic& params);\n\n  bool isSyncHook() const {\n    return isSync_;\n  }\nprivate:\n  jmethodID method_;\n  std::string signature_;\n  std::size_t jsArgCount_;\n  std::string traceName_;\n  bool isSync_;\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"ModuleRegistryBuilder.h\"\n\n#include <cxxreact/CxxNativeModule.h>\n#include <folly/Memory.h>\n\nnamespace facebook {\nnamespace react {\n\nstd::string ModuleHolder::getName() const {\n  static auto method = getClass()->getMethod<jstring()>(\"getName\");\n  return method(self())->toStdString();\n}\n\nxplat::module::CxxModule::Provider ModuleHolder::getProvider() const {\n  return [self=jni::make_global(self())] {\n    static auto method =\n      ModuleHolder::javaClassStatic()->getMethod<JNativeModule::javaobject()>(\n        \"getModule\");\n    // This is the call which uses the lazy Java Provider to instantiate the\n    // Java CxxModuleWrapper which contains the CxxModule.\n    auto module = method(self);\n    CHECK(module->isInstanceOf(CxxModuleWrapperBase::javaClassStatic()))\n      << \"module isn't a C++ module\";\n    auto cxxModule = jni::static_ref_cast<CxxModuleWrapperBase::javaobject>(module);\n    // Then, we grab the CxxModule from the wrapper, which is no longer needed.\n    return cxxModule->cthis()->getModule();\n  };\n}\n\nstd::vector<std::unique_ptr<NativeModule>> buildNativeModuleList(\n    std::weak_ptr<Instance> winstance,\n    jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject> javaModules,\n    jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject> cxxModules,\n    std::shared_ptr<MessageQueueThread> moduleMessageQueue) {\n  std::vector<std::unique_ptr<NativeModule>> modules;\n  if (javaModules) {\n    for (const auto& jm : *javaModules) {\n      modules.emplace_back(folly::make_unique<JavaNativeModule>(\n                     winstance, jm, moduleMessageQueue));\n    }\n  }\n  if (cxxModules) {\n    for (const auto& cm : *cxxModules) {\n      modules.emplace_back(folly::make_unique<CxxNativeModule>(\n                             winstance, cm->getName(), cm->getProvider(), moduleMessageQueue));\n    }\n  }\n  return modules;\n}\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <string>\n\n#include <cxxreact/CxxModule.h>\n#include <cxxreact/ModuleRegistry.h>\n#include <fb/fbjni.h>\n\n#include \"CxxModuleWrapper.h\"\n#include \"JavaModuleWrapper.h\"\n\nnamespace facebook {\nnamespace react {\n\nclass MessageQueueThread;\n\nclass ModuleHolder : public jni::JavaClass<ModuleHolder> {\n public:\n  static auto constexpr kJavaDescriptor =\n    \"Lcom/facebook/react/bridge/ModuleHolder;\";\n\n  std::string getName() const;\n  xplat::module::CxxModule::Provider getProvider() const;\n};\n\nstd::vector<std::unique_ptr<NativeModule>> buildNativeModuleList(\n  std::weak_ptr<Instance> winstance,\n  jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject> javaModules,\n  jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject> cxxModules,\n  std::shared_ptr<MessageQueueThread> moduleMessageQueue);\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/NativeArray.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"NativeArray.h\"\n\n#include <fb/fbjni.h>\n#include <folly/json.h>\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nNativeArray::NativeArray(folly::dynamic array)\n    : isConsumed(false), array_(std::move(array)) {\n  if (!array_.isArray()) {\n    throwNewJavaException(exceptions::gUnexpectedNativeTypeExceptionClass,\n                               \"expected Array, got a %s\", array_.typeName());\n  }\n}\n\nlocal_ref<jstring> NativeArray::toString() {\n  throwIfConsumed();\n  return make_jstring(folly::toJson(array_).c_str());\n}\n\nvoid NativeArray::registerNatives() {\n  registerHybrid({\n    makeNativeMethod(\"toString\", NativeArray::toString),\n  });\n}\n\nfolly::dynamic NativeArray::consume() {\n  throwIfConsumed();\n  isConsumed = true;\n  return std::move(array_);\n}\n\nvoid NativeArray::throwIfConsumed() {\n  exceptions::throwIfObjectAlreadyConsumed(this, \"Array already consumed\");\n}\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/NativeArray.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <fb/fbjni.h>\n#include <folly/dynamic.h>\n\n#include \"NativeCommon.h\"\n\nnamespace facebook {\nnamespace react {\n\nclass NativeArray : public jni::HybridClass<NativeArray> {\n public:\n  static constexpr const char* kJavaDescriptor = \"Lcom/facebook/react/bridge/NativeArray;\";\n\n  jni::local_ref<jstring> toString();\n\n  RN_EXPORT folly::dynamic consume();\n\n  // Whether this array has been added to another array or map and no longer\n  // has a valid array value.\n  bool isConsumed;\n  void throwIfConsumed();\n\n  static void registerNatives();\n\n protected:\n  folly::dynamic array_;\n\n  friend HybridBase;\n  explicit NativeArray(folly::dynamic array);\n};\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/NativeCommon.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"NativeCommon.h\"\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nnamespace exceptions {\nconst char *gUnexpectedNativeTypeExceptionClass =\n  \"com/facebook/react/bridge/UnexpectedNativeTypeException\";\n}\n\nnamespace {\n\n// Returns a leaked global_ref.\nalias_ref<ReadableType> getTypeField(const char* fieldName) {\n  static auto cls = ReadableType::javaClassStatic();\n  auto field = cls->getStaticField<ReadableType::javaobject>(fieldName);\n  return make_global(cls->getStaticFieldValue(field)).release();\n}\n\n} // namespace\n\nlocal_ref<ReadableType> ReadableType::getType(folly::dynamic::Type type) {\n  switch (type) {\n    case folly::dynamic::Type::NULLT: {\n      static alias_ref<ReadableType> val = getTypeField(\"Null\");\n      return make_local(val);\n    }\n    case folly::dynamic::Type::BOOL: {\n      static alias_ref<ReadableType> val = getTypeField(\"Boolean\");\n      return make_local(val);\n    }\n    case folly::dynamic::Type::DOUBLE:\n    case folly::dynamic::Type::INT64: {\n      static alias_ref<ReadableType> val = getTypeField(\"Number\");\n      return make_local(val);\n    }\n    case folly::dynamic::Type::STRING: {\n      static alias_ref<ReadableType> val = getTypeField(\"String\");\n      return make_local(val);\n    }\n    case folly::dynamic::Type::OBJECT: {\n      static alias_ref<ReadableType> val = getTypeField(\"Map\");\n      return make_local(val);\n    }\n    case folly::dynamic::Type::ARRAY: {\n      static alias_ref<ReadableType> val = getTypeField(\"Array\");\n      return make_local(val);\n    }\n    default:\n      throwNewJavaException(exceptions::gUnexpectedNativeTypeExceptionClass, \"Unknown type\");\n  }\n}\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/NativeCommon.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <fb/fbjni.h>\n#include <folly/dynamic.h>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\nstruct ReadableType : public jni::JavaClass<ReadableType> {\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/react/bridge/ReadableType;\";\n\n  static jni::local_ref<ReadableType> getType(folly::dynamic::Type type);\n};\n\nnamespace exceptions {\n\nextern const char *gUnexpectedNativeTypeExceptionClass;\n\ntemplate <typename T>\nvoid throwIfObjectAlreadyConsumed(const T& t, const char* msg) {\n  if (t->isConsumed) {\n    jni::throwNewJavaException(\"com/facebook/react/bridge/ObjectAlreadyConsumedException\", msg);\n  }\n}\n\n} // namespace exceptions\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/NativeMap.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"NativeMap.h\"\n\n#include <folly/json.h>\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nstd::string NativeMap::toString() {\n  throwIfConsumed();\n  return (\"{ NativeMap: \" + folly::toJson(map_) + \" }\").c_str();\n}\n\nvoid NativeMap::registerNatives() {\n  registerHybrid({\n    makeNativeMethod(\"toString\", NativeMap::toString),\n  });\n}\n\nfolly::dynamic NativeMap::consume() {\n  throwIfConsumed();\n  isConsumed = true;\n  return std::move(map_);\n}\n\nvoid NativeMap::throwIfConsumed() {\n  exceptions::throwIfObjectAlreadyConsumed(this, \"Map already consumed\");\n}\n\n}  // namespace react\n}  // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/NativeMap.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <fb/fbjni.h>\n#include <folly/dynamic.h>\n\n#include \"NativeCommon.h\"\n\nnamespace facebook {\nnamespace react {\n\nclass NativeMap : public jni::HybridClass<NativeMap> {\n public:\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/react/bridge/NativeMap;\";\n\n  std::string toString();\n\n  RN_EXPORT folly::dynamic consume();\n\n  // Whether this map has been added to another array or map and no longer\n  // has a valid map value.\n  bool isConsumed;\n  void throwIfConsumed();\n\n  static void registerNatives();\n\n protected:\n  folly::dynamic map_;\n\n  friend HybridBase;\n  friend struct ReadableNativeMapKeySetIterator;\n  explicit NativeMap(folly::dynamic s) : isConsumed(false), map_(s) {}\n};\n\n}  // namespace react\n}  // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/OnLoad.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <string>\n\n#include <jschelpers/JSCHelpers.h>\n#include <cxxreact/JSCExecutor.h>\n#include <cxxreact/Platform.h>\n#include <fb/fbjni.h>\n#include <fb/glog_init.h>\n#include <fb/log.h>\n#include <folly/dynamic.h>\n#include <jschelpers/Value.h>\n\n#include \"AndroidJSCFactory.h\"\n#include \"CatalystInstanceImpl.h\"\n#include \"CxxModuleWrapper.h\"\n#include \"JavaScriptExecutorHolder.h\"\n#include \"JCallback.h\"\n#include \"ProxyExecutor.h\"\n#include \"WritableNativeArray.h\"\n#include \"WritableNativeMap.h\"\n\n#ifdef WITH_INSPECTOR\n#include \"JInspector.h\"\n#endif\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nnamespace {\n\n// TODO: can we avoid these wrapper classes, and instead specialize the logic in CatalystInstanceImpl\nclass JSCJavaScriptExecutorHolder : public HybridClass<JSCJavaScriptExecutorHolder,\n                                                       JavaScriptExecutorHolder> {\n public:\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/JSCJavaScriptExecutor;\";\n\n  static local_ref<jhybriddata> initHybrid(alias_ref<jclass>, ReadableNativeMap* jscConfig) {\n    return makeCxxInstance(makeAndroidJSCExecutorFactory(jscConfig->consume()));\n  }\n\n  static void registerNatives() {\n    registerHybrid({\n      makeNativeMethod(\"initHybrid\", JSCJavaScriptExecutorHolder::initHybrid),\n    });\n  }\n\n private:\n  friend HybridBase;\n  using HybridBase::HybridBase;\n};\n\nstruct JavaJSExecutor : public JavaClass<JavaJSExecutor> {\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/JavaJSExecutor;\";\n};\n\nclass ProxyJavaScriptExecutorHolder : public HybridClass<ProxyJavaScriptExecutorHolder,\n                                                         JavaScriptExecutorHolder> {\n public:\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/ProxyJavaScriptExecutor;\";\n\n  static local_ref<jhybriddata> initHybrid(\n    alias_ref<jclass>, alias_ref<JavaJSExecutor::javaobject> executorInstance) {\n    return makeCxxInstance(\n      std::make_shared<ProxyExecutorOneTimeFactory>(\n        make_global(executorInstance)));\n  }\n\n  static void registerNatives() {\n    registerHybrid({\n      makeNativeMethod(\"initHybrid\", ProxyJavaScriptExecutorHolder::initHybrid),\n    });\n  }\n\n private:\n  friend HybridBase;\n  using HybridBase::HybridBase;\n};\n\n}\n\nextern \"C\" JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {\n  return initialize(vm, [] {\n    gloginit::initialize();\n    JSCJavaScriptExecutorHolder::registerNatives();\n    ProxyJavaScriptExecutorHolder::registerNatives();\n    CatalystInstanceImpl::registerNatives();\n    CxxModuleWrapperBase::registerNatives();\n    CxxModuleWrapper::registerNatives();\n    JCxxCallbackImpl::registerNatives();\n    NativeArray::registerNatives();\n    ReadableNativeArray::registerNatives();\n    WritableNativeArray::registerNatives();\n    NativeMap::registerNatives();\n    ReadableNativeMap::registerNatives();\n    WritableNativeMap::registerNatives();\n    ReadableNativeMapKeySetIterator::registerNatives();\n\n    #ifdef WITH_INSPECTOR\n    JInspector::registerNatives();\n    #endif\n  });\n}\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/OnLoad.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <jni.h>\n\nnamespace facebook {\nnamespace react {\n\njmethodID getLogMarkerMethod();\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/ProxyExecutor.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"ProxyExecutor.h\"\n\n#include <cxxreact/JSBigString.h>\n#include <cxxreact/ModuleRegistry.h>\n#include <cxxreact/SystraceSection.h>\n#include <fb/assert.h>\n#include <fb/Environment.h>\n#include <folly/json.h>\n#include <folly/Memory.h>\n#include <jni/LocalReference.h>\n#include <jni/LocalString.h>\n\nnamespace facebook {\nnamespace react {\n\nconst auto EXECUTOR_BASECLASS = \"com/facebook/react/bridge/JavaJSExecutor\";\n\nstatic std::string executeJSCallWithProxy(\n    jobject executor,\n    const std::string& methodName,\n    const folly::dynamic& arguments) {\n  static auto executeJSCall =\n    jni::findClassStatic(EXECUTOR_BASECLASS)->getMethod<jstring(jstring, jstring)>(\"executeJSCall\");\n\n  auto result = executeJSCall(\n    executor,\n    jni::make_jstring(methodName).get(),\n    jni::make_jstring(folly::toJson(arguments).c_str()).get());\n  return result->toString();\n}\n\nstd::unique_ptr<JSExecutor> ProxyExecutorOneTimeFactory::createJSExecutor(\n    std::shared_ptr<ExecutorDelegate> delegate, std::shared_ptr<MessageQueueThread>) {\n  return folly::make_unique<ProxyExecutor>(std::move(m_executor), delegate);\n}\n\nProxyExecutor::ProxyExecutor(jni::global_ref<jobject>&& executorInstance,\n                             std::shared_ptr<ExecutorDelegate> delegate)\n    : m_executor(std::move(executorInstance))\n    , m_delegate(delegate)\n{}\n\nProxyExecutor::~ProxyExecutor() {\n  m_executor.reset();\n}\n\nvoid ProxyExecutor::loadApplicationScript(\n    std::unique_ptr<const JSBigString>,\n    std::string sourceURL) {\n\n  folly::dynamic nativeModuleConfig = folly::dynamic::array;\n\n  {\n    SystraceSection s(\"collectNativeModuleDescriptions\");\n    auto moduleRegistry = m_delegate->getModuleRegistry();\n    for (const auto& name : moduleRegistry->moduleNames()) {\n      auto config = moduleRegistry->getConfig(name);\n      nativeModuleConfig.push_back(config ? config->config : nullptr);\n    }\n  }\n\n  folly::dynamic config =\n    folly::dynamic::object\n    (\"remoteModuleConfig\", std::move(nativeModuleConfig));\n\n  {\n    SystraceSection t(\"setGlobalVariable\");\n    setGlobalVariable(\n      \"__fbBatchedBridgeConfig\",\n      folly::make_unique<JSBigStdString>(folly::toJson(config)));\n  }\n\n  static auto loadApplicationScript =\n    jni::findClassStatic(EXECUTOR_BASECLASS)->getMethod<void(jstring)>(\"loadApplicationScript\");\n\n  // The proxy ignores the script data passed in.\n\n  loadApplicationScript(\n    m_executor.get(),\n    jni::make_jstring(sourceURL).get());\n  // We can get pending calls here to native but the queue will be drained when\n  // we launch the application.\n}\n\nvoid ProxyExecutor::setBundleRegistry(std::unique_ptr<RAMBundleRegistry>) {\n  jni::throwNewJavaException(\n    \"java/lang/UnsupportedOperationException\",\n    \"Loading application RAM bundles is not supported for proxy executors\");\n}\n\nvoid ProxyExecutor::registerBundle(uint32_t bundleId, const std::string& bundlePath) {\n  jni::throwNewJavaException(\n    \"java/lang/UnsupportedOperationException\",\n    \"Loading application RAM bundles is not supported for proxy executors\");\n}\n\nvoid ProxyExecutor::callFunction(const std::string& moduleId, const std::string& methodId, const folly::dynamic& arguments) {\n  auto call = folly::dynamic::array(moduleId, methodId, std::move(arguments));\n\n  std::string result = executeJSCallWithProxy(m_executor.get(), \"callFunctionReturnFlushedQueue\", std::move(call));\n  m_delegate->callNativeModules(*this, folly::parseJson(result), true);\n}\n\nvoid ProxyExecutor::invokeCallback(const double callbackId, const folly::dynamic& arguments) {\n  auto call = folly::dynamic::array(callbackId, std::move(arguments));\n  std::string result = executeJSCallWithProxy(m_executor.get(), \"invokeCallbackAndReturnFlushedQueue\", std::move(call));\n  m_delegate->callNativeModules(*this, folly::parseJson(result), true);\n}\n\nvoid ProxyExecutor::setGlobalVariable(std::string propName,\n                                      std::unique_ptr<const JSBigString> jsonValue) {\n  static auto setGlobalVariable =\n    jni::findClassStatic(EXECUTOR_BASECLASS)->getMethod<void(jstring, jstring)>(\"setGlobalVariable\");\n\n  setGlobalVariable(\n    m_executor.get(),\n    jni::make_jstring(propName).get(),\n    jni::make_jstring(jsonValue->c_str()).get());\n}\n\nstd::string ProxyExecutor::getDescription() {\n  return \"Chrome\";\n}\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/ProxyExecutor.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <cxxreact/JSExecutor.h>\n#include <fb/fbjni.h>\n#include <jni.h>\n#include <jni/GlobalReference.h>\n#include \"OnLoad.h\"\n\nnamespace facebook {\nnamespace react {\n\n/**\n * This executor factory can only create a single executor instance because it moves\n * executorInstance global reference to the executor instance it creates.\n */\nclass ProxyExecutorOneTimeFactory : public JSExecutorFactory {\npublic:\n  ProxyExecutorOneTimeFactory(jni::global_ref<jobject>&& executorInstance) :\n    m_executor(std::move(executorInstance)) {}\n  virtual std::unique_ptr<JSExecutor> createJSExecutor(\n    std::shared_ptr<ExecutorDelegate> delegate,\n    std::shared_ptr<MessageQueueThread> queue) override;\n\nprivate:\n  jni::global_ref<jobject> m_executor;\n};\n\nclass ProxyExecutor : public JSExecutor {\npublic:\n  ProxyExecutor(jni::global_ref<jobject>&& executorInstance,\n                std::shared_ptr<ExecutorDelegate> delegate);\n  virtual ~ProxyExecutor() override;\n  virtual void loadApplicationScript(\n    std::unique_ptr<const JSBigString> script,\n    std::string sourceURL) override;\n  virtual void setBundleRegistry(\n    std::unique_ptr<RAMBundleRegistry> bundle) override;\n  virtual void registerBundle(\n    uint32_t bundleId, const std::string& bundlePath) override;\n  virtual void callFunction(\n    const std::string& moduleId,\n    const std::string& methodId,\n    const folly::dynamic& arguments) override;\n  virtual void invokeCallback(\n    const double callbackId,\n    const folly::dynamic& arguments) override;\n  virtual void setGlobalVariable(\n    std::string propName,\n    std::unique_ptr<const JSBigString> jsonValue) override;\n  virtual std::string getDescription() override;\n\nprivate:\n  jni::global_ref<jobject> m_executor;\n  std::shared_ptr<ExecutorDelegate> m_delegate;\n};\n\n} }\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/ReactMarker.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"ReactMarker.h\"\n#include <mutex>\n#include <cxxreact/Platform.h>\n#include <jschelpers/JSCHelpers.h>\n#include <fb/fbjni.h>\n\nnamespace facebook {\nnamespace react {\n\nvoid JReactMarker::setLogPerfMarkerIfNeeded() {\n  static std::once_flag flag {};\n  std::call_once(flag, [](){\n    ReactMarker::logTaggedMarker = JReactMarker::logPerfMarker;\n  });\n}\n\nvoid JReactMarker::logMarker(const std::string& marker) {\n  static auto cls = javaClassStatic();\n  static auto meth = cls->getStaticMethod<void(std::string)>(\"logMarker\");\n  meth(cls, marker);\n}\n\nvoid JReactMarker::logMarker(const std::string& marker, const std::string& tag) {\n  static auto cls = javaClassStatic();\n  static auto meth = cls->getStaticMethod<void(std::string, std::string)>(\"logMarker\");\n  meth(cls, marker, tag);\n}\n\nvoid JReactMarker::logPerfMarker(const ReactMarker::ReactMarkerId markerId, const char* tag) {\n  switch (markerId) {\n    case ReactMarker::RUN_JS_BUNDLE_START:\n      JReactMarker::logMarker(\"RUN_JS_BUNDLE_START\", tag);\n      break;\n    case ReactMarker::RUN_JS_BUNDLE_STOP:\n      JReactMarker::logMarker(\"RUN_JS_BUNDLE_END\", tag);\n      break;\n    case ReactMarker::CREATE_REACT_CONTEXT_STOP:\n      JReactMarker::logMarker(\"CREATE_REACT_CONTEXT_END\");\n      break;\n    case ReactMarker::JS_BUNDLE_STRING_CONVERT_START:\n      JReactMarker::logMarker(\"loadApplicationScript_startStringConvert\");\n      break;\n    case ReactMarker::JS_BUNDLE_STRING_CONVERT_STOP:\n      JReactMarker::logMarker(\"loadApplicationScript_endStringConvert\");\n      break;\n    case ReactMarker::NATIVE_MODULE_SETUP_START:\n      JReactMarker::logMarker(\"NATIVE_MODULE_SETUP_START\", tag);\n      break;\n    case ReactMarker::NATIVE_MODULE_SETUP_STOP:\n      JReactMarker::logMarker(\"NATIVE_MODULE_SETUP_END\", tag);\n      break;\n    case ReactMarker::NATIVE_REQUIRE_START:\n    case ReactMarker::NATIVE_REQUIRE_STOP:\n      // These are not used on Android.\n      break;\n  }\n}\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/ReactMarker.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <string>\n#include <fb/fbjni.h>\n#include <cxxreact/Platform.h>\n\nnamespace facebook {\nnamespace react {\n\nclass JReactMarker : public facebook::jni::JavaClass<JReactMarker> {\npublic:\n  static constexpr auto kJavaDescriptor = \"Lcom/facebook/react/bridge/ReactMarker;\";\n  static void setLogPerfMarkerIfNeeded();\n\nprivate:\n  static void logMarker(const std::string& marker);\n  static void logMarker(const std::string& marker, const std::string& tag);\n  static void logPerfMarker(const ReactMarker::ReactMarkerId markerId, const char* tag);\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/ReadableNativeArray.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"ReadableNativeArray.h\"\n\n#include \"ReadableNativeMap.h\"\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\n\n// This attribute exports the ctor symbol, so ReadableNativeArray to be\n// constructed from other DSOs.\n__attribute__((visibility(\"default\")))\nReadableNativeArray::ReadableNativeArray(folly::dynamic array)\n    : HybridBase(std::move(array)) {}\n\nvoid ReadableNativeArray::mapException(const std::exception& ex) {\n  if (dynamic_cast<const folly::TypeError*>(&ex) != nullptr) {\n    throwNewJavaException(exceptions::gUnexpectedNativeTypeExceptionClass, ex.what());\n  }\n}\n\njint ReadableNativeArray::getSize() {\n  return array_.size();\n}\n\njboolean ReadableNativeArray::isNull(jint index) {\n  return array_.at(index).isNull() ? JNI_TRUE : JNI_FALSE;\n}\n\njboolean ReadableNativeArray::getBoolean(jint index) {\n  return array_.at(index).getBool() ? JNI_TRUE : JNI_FALSE;\n}\n\njdouble ReadableNativeArray::getDouble(jint index) {\n  const folly::dynamic& val = array_.at(index);\n  if (val.isInt()) {\n    return val.getInt();\n  }\n  return val.getDouble();\n}\n\njint ReadableNativeArray::getInt(jint index) {\n  const folly::dynamic& val = array_.at(index);\n  int64_t integer = convertDynamicIfIntegral(val);\n  return makeJIntOrThrow(integer);\n}\n\nconst char* ReadableNativeArray::getString(jint index) {\n  const folly::dynamic& dyn = array_.at(index);\n  if (dyn.isNull()) {\n    return nullptr;\n  }\n  return dyn.getString().c_str();\n}\n\nlocal_ref<ReadableNativeArray::jhybridobject> ReadableNativeArray::getArray(jint index) {\n  auto& elem = array_.at(index);\n  if (elem.isNull()) {\n    return local_ref<ReadableNativeArray::jhybridobject>(nullptr);\n  } else {\n    return ReadableNativeArray::newObjectCxxArgs(elem);\n  }\n}\n\nlocal_ref<ReadableType> ReadableNativeArray::getType(jint index) {\n  return ReadableType::getType(array_.at(index).type());\n}\n\nlocal_ref<NativeMap::jhybridobject> ReadableNativeArray::getMap(jint index) {\n  auto& elem = array_.at(index);\n  return ReadableNativeMap::createWithContents(folly::dynamic(elem));\n}\n\nnamespace {\n// This is just to allow signature deduction below.\nlocal_ref<ReadableNativeMap::jhybridobject> getMapFixed(alias_ref<ReadableNativeArray::jhybridobject> array, jint index) {\n  return static_ref_cast<ReadableNativeMap::jhybridobject>(array->cthis()->getMap(index));\n}\n}\n\nvoid ReadableNativeArray::registerNatives() {\n  registerHybrid({\n    makeNativeMethod(\"size\", ReadableNativeArray::getSize),\n    makeNativeMethod(\"isNull\", ReadableNativeArray::isNull),\n    makeNativeMethod(\"getBoolean\", ReadableNativeArray::getBoolean),\n    makeNativeMethod(\"getDouble\", ReadableNativeArray::getDouble),\n    makeNativeMethod(\"getInt\", ReadableNativeArray::getInt),\n    makeNativeMethod(\"getString\", ReadableNativeArray::getString),\n    makeNativeMethod(\"getArray\", ReadableNativeArray::getArray),\n    makeNativeMethod(\"getMap\", getMapFixed),\n    makeNativeMethod(\"getType\", ReadableNativeArray::getType),\n  });\n}\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/ReadableNativeArray.h",
    "content": " // Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include \"NativeArray.h\"\n\n#include \"NativeCommon.h\"\n#include \"NativeMap.h\"\n\nnamespace facebook {\nnamespace react {\n\nclass ReadableNativeArray : public jni::HybridClass<ReadableNativeArray, NativeArray> {\n protected:\n  friend HybridBase;\n  explicit ReadableNativeArray(folly::dynamic array);\n\n public:\n  static constexpr const char* kJavaDescriptor = \"Lcom/facebook/react/bridge/ReadableNativeArray;\";\n\n  static void mapException(const std::exception& ex);\n  jint getSize();\n  jboolean isNull(jint index);\n  jboolean getBoolean(jint index);\n  jint getInt(jint index);\n  jdouble getDouble(jint index);\n  // The lifetime of the const char* is the same as the underlying dynamic\n  // array.  This is fine for converting back to Java, but other uses should be\n  // careful.\n  const char* getString(jint index);\n  jni::local_ref<jhybridobject> getArray(jint index);\n  // This actually returns a ReadableNativeMap::JavaPart, but due to\n  // limitations of fbjni, we can't specify that here.\n  jni::local_ref<NativeMap::jhybridobject> getMap(jint index);\n  jni::local_ref<ReadableType> getType(jint index);\n\n  static void registerNatives();\n};\n\n}}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/ReadableNativeMap.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"ReadableNativeMap.h\"\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nnamespace {\nconst char *gNoSuchKeyExceptionClass = \"com/facebook/react/bridge/NoSuchKeyException\";\n} // namespace\n\nvoid ReadableNativeMap::mapException(const std::exception& ex) {\n  if (dynamic_cast<const folly::TypeError*>(&ex) != nullptr) {\n    throwNewJavaException(exceptions::gUnexpectedNativeTypeExceptionClass, ex.what());\n  }\n}\n\nbool ReadableNativeMap::hasKey(const std::string& key) {\n  return map_.find(key) != map_.items().end();\n}\n\nconst folly::dynamic& ReadableNativeMap::getMapValue(const std::string& key) {\n  try {\n    return map_.at(key);\n  } catch (const std::out_of_range& ex) {\n    throwNewJavaException(gNoSuchKeyExceptionClass, ex.what());\n  }\n}\n\nbool ReadableNativeMap::isNull(const std::string& key) {\n  return getMapValue(key).isNull();\n}\n\nbool ReadableNativeMap::getBooleanKey(const std::string& key) {\n  return getMapValue(key).getBool();\n}\n\ndouble ReadableNativeMap::getDoubleKey(const std::string& key) {\n  const folly::dynamic& val = getMapValue(key);\n  if (val.isInt()) {\n    return val.getInt();\n  }\n  return val.getDouble();\n}\n\njint ReadableNativeMap::getIntKey(const std::string& key) {\n  const folly::dynamic& val = getMapValue(key);\n  int64_t integer = convertDynamicIfIntegral(val);\n  return makeJIntOrThrow(integer);\n}\n\nlocal_ref<jstring> ReadableNativeMap::getStringKey(const std::string& key) {\n  const folly::dynamic& val = getMapValue(key);\n  if (val.isNull()) {\n    return local_ref<jstring>(nullptr);\n  }\n  return make_jstring(val.getString().c_str());\n}\n\nlocal_ref<ReadableNativeArray::jhybridobject> ReadableNativeMap::getArrayKey(const std::string& key) {\n  auto& value = getMapValue(key);\n  if (value.isNull()) {\n    return local_ref<ReadableNativeArray::jhybridobject>(nullptr);\n  } else {\n    return ReadableNativeArray::newObjectCxxArgs(value);\n  }\n}\n\nlocal_ref<ReadableNativeMap::jhybridobject> ReadableNativeMap::getMapKey(const std::string& key) {\n  auto& value = getMapValue(key);\n  if (value.isNull()) {\n    return local_ref<ReadableNativeMap::jhybridobject>(nullptr);\n  } else if (!value.isObject()) {\n    throwNewJavaException(exceptions::gUnexpectedNativeTypeExceptionClass,\n                          \"expected Map, got a %s\", value.typeName());\n  } else {\n    return ReadableNativeMap::newObjectCxxArgs(value);\n  }\n}\n\nlocal_ref<ReadableType> ReadableNativeMap::getValueType(const std::string& key) {\n  return ReadableType::getType(getMapValue(key).type());\n}\n\nlocal_ref<ReadableNativeMap::jhybridobject> ReadableNativeMap::createWithContents(folly::dynamic&& map) {\n  if (map.isNull()) {\n    return local_ref<jhybridobject>(nullptr);\n  }\n\n  if (!map.isObject()) {\n    throwNewJavaException(exceptions::gUnexpectedNativeTypeExceptionClass,\n                          \"expected Map, got a %s\", map.typeName());\n  }\n\n  return newObjectCxxArgs(std::move(map));\n}\n\nvoid ReadableNativeMap::registerNatives() {\n  registerHybrid({\n      makeNativeMethod(\"hasKey\", ReadableNativeMap::hasKey),\n      makeNativeMethod(\"isNull\", ReadableNativeMap::isNull),\n      makeNativeMethod(\"getBoolean\", ReadableNativeMap::getBooleanKey),\n      makeNativeMethod(\"getDouble\", ReadableNativeMap::getDoubleKey),\n      makeNativeMethod(\"getInt\", ReadableNativeMap::getIntKey),\n      makeNativeMethod(\"getString\", ReadableNativeMap::getStringKey),\n      makeNativeMethod(\"getArray\", ReadableNativeMap::getArrayKey),\n      makeNativeMethod(\"getMap\", ReadableNativeMap::getMapKey),\n      makeNativeMethod(\"getType\", ReadableNativeMap::getValueType),\n  });\n}\n\nReadableNativeMapKeySetIterator::ReadableNativeMapKeySetIterator(const folly::dynamic& map)\n  : iter_(map.items().begin())\n  , map_(map) {}\n\nlocal_ref<ReadableNativeMapKeySetIterator::jhybriddata> ReadableNativeMapKeySetIterator::initHybrid(alias_ref<jclass>, ReadableNativeMap* nativeMap) {\n  return makeCxxInstance(nativeMap->map_);\n}\n\nbool ReadableNativeMapKeySetIterator::hasNextKey() {\n  return iter_ != map_.items().end();\n}\n\nlocal_ref<jstring> ReadableNativeMapKeySetIterator::nextKey() {\n  if (!hasNextKey()) {\n    throwNewJavaException(\"com/facebook/react/bridge/InvalidIteratorException\",\n                          \"No such element exists\");\n  }\n  auto ret = make_jstring(iter_->first.c_str());\n  ++iter_;\n  return ret;\n}\n\nvoid ReadableNativeMapKeySetIterator::registerNatives() {\n  registerHybrid({\n      makeNativeMethod(\"hasNextKey\", ReadableNativeMapKeySetIterator::hasNextKey),\n      makeNativeMethod(\"nextKey\", ReadableNativeMapKeySetIterator::nextKey),\n      makeNativeMethod(\"initHybrid\", ReadableNativeMapKeySetIterator::initHybrid),\n    });\n}\n\njint makeJIntOrThrow(int64_t integer) {\n  jint javaint = static_cast<jint>(integer);\n  if (integer != javaint) {\n    throwNewJavaException(\n      exceptions::gUnexpectedNativeTypeExceptionClass,\n      \"Value '%lld' doesn't fit into a 32 bit signed int\", integer);\n  }\n  return javaint;\n}\n\nint64_t convertDynamicIfIntegral(const folly::dynamic& val) {\n  if (val.isInt()) {\n    return val.getInt();\n  }\n  double dbl = val.getDouble();\n  int64_t result = static_cast<int64_t>(dbl);\n  if (dbl != result) {\n    throwNewJavaException(\n      exceptions::gUnexpectedNativeTypeExceptionClass,\n      \"Tried to read an int, but got a non-integral double: %f\", dbl);\n  }\n  return result;\n}\n\n}  // namespace react\n}  // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/ReadableNativeMap.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <fb/fbjni.h>\n#include <folly/dynamic.h>\n#include <folly/json.h>\n\n#include \"NativeCommon.h\"\n#include \"NativeMap.h\"\n#include \"ReadableNativeArray.h\"\n\nnamespace facebook {\nnamespace react {\n\nstruct WritableNativeMap;\n\nstruct ReadableNativeMap : jni::HybridClass<ReadableNativeMap, NativeMap> {\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/react/bridge/ReadableNativeMap;\";\n\n  bool hasKey(const std::string& key);\n  const folly::dynamic& getMapValue(const std::string& key);\n  bool isNull(const std::string& key);\n  bool getBooleanKey(const std::string& key);\n  double getDoubleKey(const std::string& key);\n  jint getIntKey(const std::string& key);\n  jni::local_ref<jstring> getStringKey(const std::string& key);\n  jni::local_ref<ReadableNativeArray::jhybridobject> getArrayKey(const std::string& key);\n  jni::local_ref<jhybridobject> getMapKey(const std::string& key);\n  jni::local_ref<ReadableType> getValueType(const std::string& key);\n  static jni::local_ref<jhybridobject> createWithContents(folly::dynamic&& map);\n\n  static void mapException(const std::exception& ex);\n\n  static void registerNatives();\n\n  using HybridBase::HybridBase;\n  friend HybridBase;\n  friend struct WritableNativeMap;\n};\n\nstruct ReadableNativeMapKeySetIterator : jni::HybridClass<ReadableNativeMapKeySetIterator> {\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/react/bridge/ReadableNativeMap$ReadableNativeMapKeySetIterator;\";\n\n  ReadableNativeMapKeySetIterator(const folly::dynamic& map);\n\n  bool hasNextKey();\n  jni::local_ref<jstring> nextKey();\n\n  static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>, ReadableNativeMap* nativeMap);\n  static void registerNatives();\n\n  folly::dynamic::const_item_iterator iter_;\n  // The Java side holds a strong ref to the Java ReadableNativeMap.\n  const folly::dynamic& map_;\n};\n\njint makeJIntOrThrow(int64_t integer);\nint64_t convertDynamicIfIntegral(const folly::dynamic&);\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/WritableNativeArray.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"WritableNativeArray.h\"\n\n#include \"WritableNativeMap.h\"\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nWritableNativeArray::WritableNativeArray()\n    : HybridBase(folly::dynamic::array()) {}\n\nlocal_ref<WritableNativeArray::jhybriddata> WritableNativeArray::initHybrid(alias_ref<jclass>) {\n  return makeCxxInstance();\n}\n\nvoid WritableNativeArray::pushNull() {\n  throwIfConsumed();\n  array_.push_back(nullptr);\n}\n\nvoid WritableNativeArray::pushBoolean(jboolean value) {\n  throwIfConsumed();\n  array_.push_back(value == JNI_TRUE);\n}\n\nvoid WritableNativeArray::pushDouble(jdouble value) {\n  throwIfConsumed();\n  array_.push_back(value);\n}\n\nvoid WritableNativeArray::pushInt(jint value) {\n  throwIfConsumed();\n  array_.push_back(value);\n}\n\nvoid WritableNativeArray::pushString(jstring value) {\n  if (value == NULL) {\n    pushNull();\n    return;\n  }\n  throwIfConsumed();\n  array_.push_back(wrap_alias(value)->toStdString());\n}\n\nvoid WritableNativeArray::pushNativeArray(WritableNativeArray* otherArray) {\n  if (otherArray == NULL) {\n    pushNull();\n    return;\n  }\n  throwIfConsumed();\n  array_.push_back(otherArray->consume());\n}\n\nvoid WritableNativeArray::pushNativeMap(WritableNativeMap* map) {\n  if (map == NULL) {\n    pushNull();\n    return;\n  }\n  throwIfConsumed();\n  array_.push_back(map->consume());\n}\n\nvoid WritableNativeArray::registerNatives() {\n  registerHybrid({\n      makeNativeMethod(\"initHybrid\", WritableNativeArray::initHybrid),\n      makeNativeMethod(\"pushNull\", WritableNativeArray::pushNull),\n      makeNativeMethod(\"pushBoolean\", WritableNativeArray::pushBoolean),\n      makeNativeMethod(\"pushDouble\", WritableNativeArray::pushDouble),\n      makeNativeMethod(\"pushInt\", WritableNativeArray::pushInt),\n      makeNativeMethod(\"pushString\", WritableNativeArray::pushString),\n      makeNativeMethod(\"pushNativeArray\", WritableNativeArray::pushNativeArray),\n      makeNativeMethod(\"pushNativeMap\", WritableNativeArray::pushNativeMap),\n  });\n}\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/WritableNativeArray.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <fb/fbjni.h>\n#include <folly/dynamic.h>\n#include <folly/json.h>\n\n#include \"ReadableNativeArray.h\"\n\nnamespace facebook {\nnamespace react {\n\nstruct WritableNativeMap;\n\nstruct WritableNativeArray\n    : public jni::HybridClass<WritableNativeArray, ReadableNativeArray> {\n  static constexpr const char* kJavaDescriptor = \"Lcom/facebook/react/bridge/WritableNativeArray;\";\n\n  WritableNativeArray();\n  static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);\n\n  void pushNull();\n  void pushBoolean(jboolean value);\n  void pushDouble(jdouble value);\n  void pushInt(jint value);\n  void pushString(jstring value);\n  void pushNativeArray(WritableNativeArray* otherArray);\n  void pushNativeMap(WritableNativeMap* map);\n\n  static void registerNatives();\n};\n\n}\n}\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/WritableNativeMap.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"WritableNativeMap.h\"\n\nusing namespace facebook::jni;\n\nnamespace facebook {\nnamespace react {\n\nWritableNativeMap::WritableNativeMap()\n  : HybridBase(folly::dynamic::object()) {}\n\nWritableNativeMap::WritableNativeMap(folly::dynamic&& val)\n    : HybridBase(std::move(val)) {\n  if (!map_.isObject()) {\n    throw std::runtime_error(\"WritableNativeMap value must be an object.\");\n  }\n}\n\nlocal_ref<WritableNativeMap::jhybriddata> WritableNativeMap::initHybrid(alias_ref<jclass>) {\n  return makeCxxInstance();\n}\n\nvoid WritableNativeMap::putNull(std::string key) {\n  throwIfConsumed();\n  map_.insert(std::move(key), nullptr);\n}\n\nvoid WritableNativeMap::putBoolean(std::string key, bool val) {\n  throwIfConsumed();\n  map_.insert(std::move(key), val);\n}\n\nvoid WritableNativeMap::putDouble(std::string key, double val) {\n  throwIfConsumed();\n  map_.insert(std::move(key), val);\n}\n\nvoid WritableNativeMap::putInt(std::string key, int val) {\n  throwIfConsumed();\n  map_.insert(std::move(key), val);\n}\n\nvoid WritableNativeMap::putString(std::string key, alias_ref<jstring> val) {\n  if (!val) {\n    putNull(std::move(key));\n    return;\n  }\n  throwIfConsumed();\n  map_.insert(std::move(key), val->toString());\n}\n\nvoid WritableNativeMap::putNativeArray(std::string key, WritableNativeArray* otherArray) {\n  if (!otherArray) {\n    putNull(std::move(key));\n    return;\n  }\n  throwIfConsumed();\n  map_.insert(key, otherArray->consume());\n}\n\nvoid WritableNativeMap::putNativeMap(std::string key, WritableNativeMap *otherMap) {\n  if (!otherMap) {\n    putNull(std::move(key));\n    return;\n  }\n  throwIfConsumed();\n  map_.insert(std::move(key), otherMap->consume());\n}\n\nvoid WritableNativeMap::mergeNativeMap(ReadableNativeMap* other) {\n  throwIfConsumed();\n  other->throwIfConsumed();\n\n  for (auto sourceIt : other->map_.items()) {\n    map_[sourceIt.first] = sourceIt.second;\n  }\n}\n\nvoid WritableNativeMap::registerNatives() {\n  registerHybrid({\n      makeNativeMethod(\"putNull\", WritableNativeMap::putNull),\n      makeNativeMethod(\"putBoolean\", WritableNativeMap::putBoolean),\n      makeNativeMethod(\"putDouble\", WritableNativeMap::putDouble),\n      makeNativeMethod(\"putInt\", WritableNativeMap::putInt),\n      makeNativeMethod(\"putString\", WritableNativeMap::putString),\n      makeNativeMethod(\"putNativeArray\", WritableNativeMap::putNativeArray),\n      makeNativeMethod(\"putNativeMap\", WritableNativeMap::putNativeMap),\n      makeNativeMethod(\"mergeNativeMap\", WritableNativeMap::mergeNativeMap),\n      makeNativeMethod(\"initHybrid\", WritableNativeMap::initHybrid),\n    });\n}\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/jni/WritableNativeMap.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <fb/fbjni.h>\n#include <folly/dynamic.h>\n#include <folly/json.h>\n\n#include \"ReadableNativeMap.h\"\n#include \"WritableNativeArray.h\"\n\nnamespace facebook {\nnamespace react {\n\nstruct WritableNativeMap : jni::HybridClass<WritableNativeMap, ReadableNativeMap> {\n  static auto constexpr kJavaDescriptor = \"Lcom/facebook/react/bridge/WritableNativeMap;\";\n\n  WritableNativeMap();\n  WritableNativeMap(folly::dynamic&& val);\n\n  static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);\n\n  void putNull(std::string key);\n  void putBoolean(std::string key, bool val);\n  void putDouble(std::string key, double val);\n  void putInt(std::string key, int val);\n  void putString(std::string key, jni::alias_ref<jstring> val);\n  void putNativeArray(std::string key, WritableNativeArray* val);\n  void putNativeMap(std::string key, WritableNativeMap* val);\n  void mergeNativeMap(ReadableNativeMap* other);\n\n  static void registerNatives();\n\n  friend HybridBase;\n};\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/perftests/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nfb_xplat_cxx_library(\n    name = \"perftests\",\n    srcs = [\"OnLoad.cpp\"],\n    compiler_flags = [\n        \"-fexceptions\",\n        \"-std=c++1y\",\n    ],\n    soname = \"libnativereactperftests.$(ext)\",\n    visibility = [\n        \"//instrumentation_tests/com/facebook/react/...\",\n    ],\n    deps = [\n        \"xplat//folly:molly\",\n        \"//native:base\",\n        \"//native/fb:fb\",\n        react_native_xplat_target(\"cxxreact:module\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/react/perftests/OnLoad.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <fb/log.h>\n#include <fb/fbjni.h>\n#include <cxxreact/CxxModule.h>\n#include <cxxreact/JsArgumentHelpers.h>\n\n#include <mutex>\n#include <condition_variable>\n\nnamespace facebook {\nnamespace react {\n\nusing facebook::jni::alias_ref;\n\nnamespace {\n\n// This is a wrapper around the Java proxy to the javascript module. This\n// allows us to call functions on the js module from c++.  Are you seeing\n// crashes in this class?  Android 6+ crashes when you try to call a\n// method on a Proxy.  Switch to an older version of Android.  If you're\n// really desperate, you can fix this by using ToReflectedMethod on the\n// underlying jmethodid and invoking that.\nclass JavaJSModule : public jni::JavaClass<JavaJSModule> {\npublic:\n  static constexpr auto kJavaDescriptor =\n    \"Lcom/facebook/react/CatalystBridgeBenchmarks$BridgeBenchmarkModule;\";\n\n  static void bounceCxx(alias_ref<javaobject> obj, int iters) {\n    static auto method = javaClassLocal()->getMethod<void(jint)>(\"bounceCxx\");\n    method(obj, iters);\n  }\n\n  static void bounceArgsCxx(\n      alias_ref<javaobject> obj,\n      int iters,\n      int a, int b,\n      double x, double y,\n      const std::string& s, const std::string& t) {\n    static auto method =\n      javaClassLocal()->getMethod<void(jint, jint, jint, jdouble, jdouble, jstring, jstring)>(\"bounceArgsCxx\");\n    method(obj, iters, a, b, x, y, jni::make_jstring(s).get(), jni::make_jstring(t).get());\n  }\n};\n\n// This is just the test instance itself. Used only to countdown the latch.\nclass CatalystBridgeBenchmarks : public jni::JavaClass<CatalystBridgeBenchmarks> {\npublic:\n  static constexpr auto kJavaDescriptor =\n    \"Lcom/facebook/react/CatalystBridgeBenchmarks;\";\n\n  static void countDown(alias_ref<javaobject> obj) {\n    static auto method = javaClassLocal()->getMethod<void()>(\"countDown\");\n    method(obj);\n  }\n};\n\n// This is the shared data for two cxx bounce threads.\nstruct Data {\n  std::mutex m;\n  std::condition_variable cv;\n  bool leftActive;\n  Data() : leftActive(true) {}\n};\nData data;\n\nvoid runBounce(jni::alias_ref<jclass>, bool isLeft, int iters) {\n  for (int i = 0; i < iters; i++) {\n    std::unique_lock<std::mutex> lk(data.m);\n    data.cv.wait(lk, [&]{ return data.leftActive == isLeft; });\n    data.leftActive = !isLeft;\n    data.cv.notify_one();\n  }\n}\n\nstatic jni::global_ref<JavaJSModule::javaobject> jsModule;\nstatic jni::global_ref<CatalystBridgeBenchmarks::javaobject> javaTestInstance;\n\nclass CxxBenchmarkModule : public xplat::module::CxxModule {\npublic:\n  virtual std::string getName() override {\n    return \"CxxBenchmarkModule\";\n  }\n\n  virtual auto getConstants() -> std::map<std::string, folly::dynamic> override {\n    return std::map<std::string, folly::dynamic>();\n  }\n\n  virtual auto getMethods() -> std::vector<Method> override {\n    return std::vector<Method>{\n      Method(\"bounce\", [this] (folly::dynamic args) {\n          this->bounce(xplat::jsArgAsInt(args, 0));\n      }),\n      Method(\"bounceArgs\", [this] (folly::dynamic args) {\n          this->bounceArgs(\n            xplat::jsArgAsInt(args, 0),\n            xplat::jsArgAsInt(args, 1),\n            xplat::jsArgAsInt(args, 2),\n            xplat::jsArgAsDouble(args, 3),\n            xplat::jsArgAsDouble(args, 4),\n            xplat::jsArgAsString(args, 5),\n            xplat::jsArgAsString(args, 6));\n      }),\n    };\n  }\n\n  void bounce(int iters) {\n    if (iters == 0) {\n      CatalystBridgeBenchmarks::countDown(javaTestInstance);\n    } else {\n      JavaJSModule::bounceCxx(jsModule, iters - 1);\n    }\n  }\n\n  void bounceArgs(\n      int iters,\n      int a, int b,\n      double x, double y,\n      const std::string& s, const std::string& t) {\n    if (iters == 0) {\n      CatalystBridgeBenchmarks::countDown(javaTestInstance);\n    } else {\n      JavaJSModule::bounceArgsCxx(jsModule, iters - 1, a, b, x, y, s, t);\n    }\n  }\n};\n\n\nvoid setUp(\n    alias_ref<CatalystBridgeBenchmarks::javaobject> obj,\n    alias_ref<JavaJSModule::javaobject> mod) {\n  javaTestInstance = jni::make_global(obj);\n  jsModule = jni::make_global(mod);\n}\n\nvoid tearDown(\n    alias_ref<CatalystBridgeBenchmarks::javaobject>) {\n  javaTestInstance.reset();\n  jsModule.reset();\n}\n\nnamespace logwatcher {\n\nstatic std::string gMessageToLookFor;\nstatic int gMessagePriorityToLookFor;\nstatic bool gHasSeenMessage = false;\n\n/**\n * NB: Don't put JNI logic (or anything else that could trigger a log) here!\n */\nstatic void stubLogHandler(int pri, const char *tag, const char *msg) {\n  if (gMessageToLookFor.empty()) {\n    return;\n  }\n\n  bool priorityMatches = pri == gMessagePriorityToLookFor;\n  bool substringFound = strstr(msg, gMessageToLookFor.c_str()) != NULL;\n  gHasSeenMessage |= priorityMatches && substringFound;\n}\n\nstatic jboolean hasSeenExpectedLogMessage(JNIEnv*, jclass) {\n  return gHasSeenMessage ? JNI_TRUE : JNI_FALSE;\n}\n\nstatic void stopWatchingLogMessages(JNIEnv*, jclass) {\n  gMessageToLookFor = \"\";\n  gHasSeenMessage = false;\n  setLogHandler(NULL);\n}\n\nstatic void startWatchingForLogMessage(JNIEnv* env, jclass loggerClass, jstring jmsg, jint priority) {\n  stopWatchingLogMessages(env, loggerClass);\n  gMessageToLookFor = jni::wrap_alias(jmsg)->toStdString();\n  gMessagePriorityToLookFor = priority;\n  setLogHandler(&stubLogHandler);\n}\n\n} // namespace logwatcher\n} // namespace\n} // namespace react\n} // namespace facebook\n\nusing namespace facebook::react;\n\nextern \"C\" facebook::xplat::module::CxxModule* CxxBenchmarkModule() {\n  return new facebook::react::CxxBenchmarkModule();\n}\n\nextern \"C\" jint JNI_OnLoad(JavaVM* vm, void*) {\n  return facebook::jni::initialize(vm, [] {\n      facebook::jni::registerNatives(\n        \"com/facebook/catalyst/testing/LogWatcher\", {\n          makeNativeMethod(\"startWatchingForLogMessage\", \"(Ljava/lang/String;I)V\", logwatcher::startWatchingForLogMessage),\n          makeNativeMethod(\"stopWatchingLogMessages\", \"()V\", logwatcher::stopWatchingLogMessages),\n          makeNativeMethod(\"hasSeenExpectedLogMessage\", \"()Z\", logwatcher::hasSeenExpectedLogMessage),\n      });\n      facebook::jni::registerNatives(\n        \"com/facebook/react/CatalystBridgeBenchmarks\", {\n          makeNativeMethod(\"runNativeBounce\", runBounce),\n          makeNativeMethod(\"nativeSetUp\", setUp),\n          makeNativeMethod(\"nativeTearDown\", tearDown),\n        });\n      });\n}\n\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/third-party/android-ndk/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\n# NOTE(agallagher): The platform should really be responsible for providing\n# this type of implicit dependency.  As it is now, we need to setup a dummy\n# rules to model the Android NDK's built in libraries.\n\nLIBS = (\n    \"android\",\n    \"EGL\",\n    \"GLESv2\",\n    \"jnigraphics\",\n    \"log\",\n    \"z\",\n)\n\nfor lib in LIBS:\n  prebuilt_cxx_library(\n    name = lib,\n    header_only = True,\n    exported_platform_linker_flags = [\n      ('android.*', ['-l' + lib]),\n    ],\n    visibility = [\n      'PUBLIC',\n    ],\n  )\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/third-party/boost/Android.mk",
    "content": "LOCAL_PATH:= $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0\nCXX11_FLAGS := -std=gnu++11\nLOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)\n\nLOCAL_MODULE    := boost\n\ninclude $(BUILD_STATIC_LIBRARY)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/third-party/folly/Android.mk",
    "content": "LOCAL_PATH:= $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES:= \\\n\tfolly/json.cpp \\\n\tfolly/Unicode.cpp \\\n\tfolly/Conv.cpp \\\n\tfolly/Demangle.cpp \\\n  folly/detail/MallocImpl.cpp \\\n  folly/StringBase.cpp \\\n  folly/dynamic.cpp \\\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n\nLOCAL_CFLAGS += -fexceptions -fno-omit-frame-pointer -frtti\nLOCAL_CFLAGS += -Wall -Werror -std=c++11\n\nCXX11_FLAGS := -std=gnu++11\nLOCAL_CFLAGS += $(CXX11_FLAGS)\n\nFOLLY_FLAGS := -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1\nLOCAL_CFLAGS += $(FOLLY_FLAGS)\n\nLOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS) $(FOLLY_FLAGS)\n\nLOCAL_MODULE := libfolly_json\n\nLOCAL_SHARED_LIBRARIES := libglog libdouble-conversion\n# Boost is header-only library we pretend to link is statically as\n# this way android makefile will automatically setup path to boost header\n# file, but except from that this will have no effect, as no c/cpp files\n# are part of this static library\nLOCAL_STATIC_LIBRARIES := libboost\n\ninclude $(BUILD_SHARED_LIBRARY)\n\n$(call import-module,glog)\n$(call import-module,double-conversion)\n$(call import-module,boost)\n"
  },
  {
    "path": "ReactAndroid/src/main/jni/third-party/glibc/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\n# NOTE(agallagher): The platform really should be responsible for providing\n# this type of provided dependency.  As it is now, we need to setup dummy\n# rules to model glibc's libraries.\n\n# libpthread is implicitly included in the android runtime so, when building\n# on an android platform, we don't do anything.\nprebuilt_cxx_library(\n    name = \"pthread\",\n    exported_platform_linker_flags = [\n        (\n            \"android\",\n            [],\n        ),\n        (\n            \"^(default|linux)\",\n            [\"-lpthread\"],\n        ),\n        (\n            \"static\",\n            [\"-lpthread\"],\n        ),\n    ],\n    header_only = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n\nprebuilt_cxx_library(\n    name = \"dl\",\n    exported_linker_flags = [\n        \"-ldl\",\n    ],\n    header_only = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n\nprebuilt_cxx_library(\n    name = \"m\",\n    exported_linker_flags = [\n        \"-lm\",\n    ],\n    header_only = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n\nprebuilt_cxx_library(\n    name = \"rt\",\n    exported_platform_linker_flags = [\n        (\n            \"android\",  # Empty, since `-lc` is implicit\n            [],\n        ),\n        (\n            \"^(default|linux)\",\n            [\"-lrt\"],\n        ),\n    ],\n    header_only = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/libraries/fbcore/src/main/java/com/facebook/common/logging/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"logging\",\n    exported_deps = [\n        react_native_dep(\"libraries/fresco/fresco-react-native:fbcore\"),\n    ],\n    visibility = [\"//ReactAndroid/...\"],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/libraries/fbcore/src/test/java/com/facebook/powermock/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"powermock\",\n    exported_deps = [\n        \":javassist\",\n        \":mockito-all\",\n        \":powermock-api-mockito\",\n        \":powermock-api-support\",\n        \":powermock-classloading-base\",\n        \":powermock-classloading-xstream\",\n        \":powermock-core\",\n        \":powermock-module-junit4-rule\",\n        \":powermock-reflect\",\n        \":xmlpull\",\n        \":xpp3\",\n        \":xstream\",\n    ],\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nprebuilt_jar(\n    name = \"powermock-core\",\n    binary_jar = \":download-powermock-core\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-powermock-core\",\n    sha1 = \"ea04e79244e19dcf0c3ccf6863c5b028b4b58c9c\",\n    url = \"mvn:org.powermock:powermock-core:jar:1.6.2\",\n)\n\nprebuilt_jar(\n    name = \"powermock-api-mockito\",\n    binary_jar = \":download-powermock-api-mockito\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-powermock-api-mockito\",\n    sha1 = \"c213230ae20a7b422f3d622a261d0e3427d2464c\",\n    url = \"mvn:org.powermock:powermock-api-mockito:jar:1.6.2\",\n)\n\nprebuilt_jar(\n    name = \"powermock-api-support\",\n    binary_jar = \":download-powermock-api-support\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-powermock-api-support\",\n    sha1 = \"93b21413b4ee99b7bc0dd34e1416fdca96866aaf\",\n    url = \"mvn:org.powermock:powermock-api-support:jar:1.6.2\",\n)\n\nprebuilt_jar(\n    name = \"powermock-module-junit4-rule\",\n    binary_jar = \":download-powermock-module-junit4-rule\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-powermock-module-junit4-rule\",\n    sha1 = \"4847638c5729b9f203e21144b0bdb5d34d888473\",\n    url = \"mvn:org.powermock:powermock-module-junit4-rule:jar:1.6.2\",\n)\n\nprebuilt_jar(\n    name = \"powermock-classloading-xstream\",\n    binary_jar = \":download-powermock-classloading-xstream\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-powermock-classloading-xstream\",\n    sha1 = \"3ced31cd7024fe365b9f3c8082d22c02434577da\",\n    url = \"mvn:org.powermock:powermock-classloading-xstream:jar:1.6.2\",\n)\n\nprebuilt_jar(\n    name = \"powermock-classloading-base\",\n    binary_jar = \":download-powermock-classloading-base\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-powermock-classloading-base\",\n    sha1 = \"c8bfc10731a02d3b241892cf2c334a754d473ca7\",\n    url = \"mvn:org.powermock:powermock-classloading-base:jar:1.6.2\",\n)\n\nprebuilt_jar(\n    name = \"xstream\",\n    binary_jar = \":download-xstream\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-xstream\",\n    sha1 = \"97e5013f391487cce4de6b0eebcde21549e91872\",\n    url = \"mvn:com.thoughtworks.xstream:xstream:jar:1.4.2\",\n)\n\nprebuilt_jar(\n    name = \"powermock-reflect\",\n    binary_jar = \":download-powermock-reflect\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-powermock-reflect\",\n    sha1 = \"1af1bbd1207c3ecdcf64973e6f9d57dcd17cc145\",\n    url = \"mvn:org.powermock:powermock-reflect:jar:1.6.2\",\n)\n\nprebuilt_jar(\n    name = \"javassist\",\n    binary_jar = \":download-javassist\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-javassist\",\n    sha1 = \"a9cbcdfb7e9f86fbc74d3afae65f2248bfbf82a0\",\n    url = \"mvn:org.javassist:javassist:jar:3.20.0-GA\",\n)\n\nprebuilt_jar(\n    name = \"mockito-all\",\n    binary_jar = \":download-mockito-all\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-mockito-all\",\n    sha1 = \"539df70269cc254a58cccc5d8e43286b4a73bf30\",\n    url = \"mvn:org.mockito:mockito-all:jar:1.10.19\",\n)\n\nprebuilt_jar(\n    name = \"xmlpull\",\n    binary_jar = \":download-xmlpull\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-xmlpull\",\n    sha1 = \"2b8e230d2ab644e4ecaa94db7cdedbc40c805dfa\",\n    url = \"mvn:xmlpull:xmlpull:jar:1.1.3.1\",\n)\n\nprebuilt_jar(\n    name = \"xpp3\",\n    binary_jar = \":download-xpp3\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-xpp3\",\n    sha1 = \"19d4e90b43059058f6e056f794f0ea4030d60b86\",\n    url = \"mvn:xpp3:xpp3_min:jar:1.1.4c\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/libraries/fresco/fresco-react-native/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_prebuilt_aar(\n    name = \"fresco-react-native\",\n    aar = \":fresco-binary-aar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"fresco-binary-aar\",\n    sha1 = \"b6271dc58383b4ce119ecc05e2bcaedde0e74ad9\",\n    url = \"mvn:com.facebook.fresco:fresco:aar:1.3.0\",\n)\n\nandroid_prebuilt_aar(\n    name = \"fresco-drawee\",\n    aar = \":drawee-binary-aar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"drawee-binary-aar\",\n    sha1 = \"c88fb84ed4ae8a4e0efe6fd3cad1a1d20c19ea69\",\n    url = \"mvn:com.facebook.fresco:drawee:aar:1.3.0\",\n)\n\nandroid_library(\n    name = \"imagepipeline\",\n    exported_deps = [\n        \":bolts\",\n        \":imagepipeline-base\",\n        \":imagepipeline-core\",\n    ],\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nandroid_prebuilt_aar(\n    name = \"imagepipeline-base\",\n    aar = \":imagepipeline-base-aar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"imagepipeline-base-aar\",\n    sha1 = \"a43f1043fc684d2794438544f73f1968ec9cf21a\",\n    url = \"mvn:com.facebook.fresco:imagepipeline-base:aar:1.3.0\",\n)\n\nandroid_prebuilt_aar(\n    name = \"imagepipeline-core\",\n    aar = \":imagepipeline-aar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"imagepipeline-aar\",\n    sha1 = \"32c08122d47210d437f34eba5472e880b0f1e8b8\",\n    url = \"mvn:com.facebook.fresco:imagepipeline:aar:1.3.0\",\n)\n\nprebuilt_jar(\n    name = \"bolts\",\n    binary_jar = \":download-bolts\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-bolts\",\n    sha1 = \"d85884acf6810a3bbbecb587f239005cbc846dc4\",\n    url = \"mvn:com.parse.bolts:bolts-tasks:jar:1.4.0\",\n)\n\nandroid_prebuilt_aar(\n    name = \"fbcore\",\n    aar = \":fbcore-aar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"fbcore-aar\",\n    sha1 = \"3b941157dd0c36fca9a19c22cae578f37deb97e5\",\n    url = \"mvn:com.facebook.fresco:fbcore:aar:1.3.0\",\n)\n\nandroid_prebuilt_aar(\n    name = \"imagepipeline-okhttp3\",\n    aar = \":imagepipeline-okhttp3-binary-aar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"imagepipeline-okhttp3-binary-aar\",\n    sha1 = \"ac9b1a7c9906ed6be41c8df923a59f6952fce94c\",\n    url = \"mvn:com.facebook.fresco:imagepipeline-okhttp3:aar:1.3.0\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/libraries/soloader/java/com/facebook/soloader/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_prebuilt_aar(\n    name = \"soloader\",\n    aar = \":soloader-binary-aar\",\n    visibility = [\"PUBLIC\"],\n)\n\nremote_file(\n    name = \"soloader-binary-aar\",\n    sha1 = \"918573465c94c6bc9bad48ef259f1e0cd6543c1b\",\n    url = \"mvn:com.facebook.soloader:soloader:aar:0.1.0\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/libraries/textlayoutbuilder/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"textlayoutbuilder\",\n    exported_deps = [\n        \":staticlayoutproxy\",\n        \":textlayoutbuilder-base\",\n    ],\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nandroid_prebuilt_aar(\n    name = \"textlayoutbuilder-base\",\n    aar = \":textlayoutbuilder-base-aar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"textlayoutbuilder-base-aar\",\n    sha1 = \"29bc8e5a1e2b33944b88277652ee83092ae1dbc0\",\n    url = \"mvn:com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:aar:1.0.0\",\n)\n\nprebuilt_jar(\n    name = \"staticlayoutproxy\",\n    binary_jar = \":staticlayoutproxy-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"staticlayoutproxy-jar\",\n    sha1 = \"f162442a19fff13995fbd51ba414d9ee05579080\",\n    url = \"mvn:com.facebook.fbui.textlayoutbuilder:staticlayout-proxy:jar:1.0\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/res/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_resource(\n    name = \"devsupport\",\n    package = \"com.facebook.react\",\n    res = \"devsupport\",\n    visibility = [\n        react_native_target(\"java/com/facebook/react/devsupport/...\"),\n    ],\n)\n\nandroid_resource(\n    name = \"shell\",\n    package = \"com.facebook.react\",\n    res = \"shell\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n\nandroid_resource(\n    name = \"modal\",\n    package = \"com.facebook.react\",\n    res = \"views/modal\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n\nandroid_resource(\n    name = \"uimanager\",\n    package = \"com.facebook.react\",\n    res = \"views/uimanager\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n\n# New resource directories must be added to react-native-github/ReactAndroid/build.gradle\n"
  },
  {
    "path": "ReactAndroid/src/main/res/devsupport/layout/dev_loading_view.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<TextView\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"match_parent\"\n  android:layout_height=\"wrap_content\"\n  android:paddingTop=\"5dp\"\n  android:paddingBottom=\"5dp\"\n  android:paddingStart=\"8dp\"\n  android:paddingEnd=\"8dp\"\n  android:textSize=\"12sp\"\n  android:maxLines=\"1\"\n  android:ellipsize=\"end\"\n  android:gravity=\"center\"/>\n"
  },
  {
    "path": "ReactAndroid/src/main/res/devsupport/layout/redbox_view.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"match_parent\"\n  android:layout_height=\"match_parent\"\n  android:orientation=\"vertical\"\n  android:background=\"#E80000\"\n  >\n  <ListView\n    android:id=\"@+id/rn_redbox_stack\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"0dp\"\n    android:layout_weight=\"1\"\n    />\n  <View\n    android:id=\"@+id/rn_redbox_line_separator\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"1dp\"\n    android:background=\"@android:color/darker_gray\"\n    android:visibility=\"gone\"\n    />\n  <LinearLayout\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:orientation=\"horizontal\"\n    >\n    <ProgressBar\n      android:id=\"@+id/rn_redbox_loading_indicator\"\n      android:layout_width=\"wrap_content\"\n      android:layout_height=\"match_parent\"\n      style=\"@android:style/Widget.ProgressBar.Small\"\n      android:indeterminateOnly=\"true\"\n      android:visibility=\"gone\"\n      android:paddingLeft=\"16dp\"\n      />\n    <TextView\n      android:id=\"@+id/rn_redbox_report_label\"\n      android:layout_width=\"match_parent\"\n      android:layout_height=\"wrap_content\"\n      android:textColor=\"@android:color/white\"\n      android:textSize=\"14sp\"\n      android:fontFamily=\"monospace\"\n      android:visibility=\"gone\"\n      android:paddingTop=\"16dp\"\n      android:paddingBottom=\"16dp\"\n      android:paddingLeft=\"16dp\"\n      android:paddingRight=\"16dp\"\n      android:lineSpacingExtra=\"4dp\"\n      />\n  </LinearLayout>\n  <LinearLayout\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:orientation=\"horizontal\"\n    >\n    <Button\n      android:id=\"@+id/rn_redbox_dismiss_button\"\n      android:layout_width=\"0dp\"\n      android:layout_height=\"wrap_content\"\n      android:layout_weight=\"1\"\n      android:layout_margin=\"4dp\"\n      android:text=\"@string/catalyst_dismiss_button\"\n      android:textColor=\"@android:color/white\"\n      android:textSize=\"14sp\"\n      android:alpha=\"0.5\"\n      style=\"?android:attr/borderlessButtonStyle\"\n      android:gravity=\"center_horizontal|top\"\n    />\n    <Button\n      android:id=\"@+id/rn_redbox_reload_button\"\n      android:layout_width=\"0dp\"\n      android:layout_height=\"wrap_content\"\n      android:layout_weight=\"1\"\n      android:layout_margin=\"4dp\"\n      android:text=\"@string/catalyst_reload_button\"\n      android:textColor=\"@android:color/white\"\n      android:textSize=\"14sp\"\n      android:alpha=\"0.5\"\n      style=\"?android:attr/borderlessButtonStyle\"\n      android:gravity=\"center_horizontal|top\"\n    />\n    <Button\n      android:id=\"@+id/rn_redbox_copy_button\"\n      android:layout_width=\"0dp\"\n      android:layout_height=\"wrap_content\"\n      android:layout_weight=\"1\"\n      android:layout_margin=\"4dp\"\n      android:text=\"@string/catalyst_copy_button\"\n      android:textColor=\"@android:color/white\"\n      android:textSize=\"14sp\"\n      android:alpha=\"0.5\"\n      style=\"?android:attr/borderlessButtonStyle\"\n      android:gravity=\"center_horizontal|top\"\n    />\n    <Button\n      android:id=\"@+id/rn_redbox_report_button\"\n      android:layout_width=\"0dp\"\n      android:layout_height=\"wrap_content\"\n      android:layout_weight=\"1\"\n      android:layout_margin=\"4dp\"\n      android:text=\"@string/catalyst_report_button\"\n      android:textColor=\"@android:color/white\"\n      android:textSize=\"14sp\"\n      android:alpha=\"0.5\"\n      style=\"?android:attr/borderlessButtonStyle\"\n      android:visibility=\"gone\"\n      android:gravity=\"center_horizontal|top\"\n    />\n  </LinearLayout>\n</LinearLayout>\n"
  },
  {
    "path": "ReactAndroid/src/main/res/devsupport/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n  <string name=\"catalyst_reloadjs\" project=\"catalyst\" translatable=\"false\">Reload</string>\n  <string name=\"catalyst_debugjs_nuclide\" project=\"catalyst\" translatable=\"false\">Debug JS in Nuclide</string>\n  <string name=\"catalyst_debugjs_nuclide_failure\" project=\"catalyst\" translatable=\"false\">The request to attach Nuclide could not reach Metro Bundler!</string>\n  <string name=\"catalyst_debugjs\" project=\"catalyst\" translatable=\"false\">Debug JS Remotely</string>\n  <string name=\"catalyst_debugjs_off\" project=\"catalyst\" translatable=\"false\">Stop Remote JS Debugging</string>\n  <string name=\"catalyst_hot_module_replacement\" project=\"catalyst\" translatable=\"false\">Enable Hot Reloading</string>\n  <string name=\"catalyst_hot_module_replacement_off\" project=\"catalyst\" translatable=\"false\">Disable Hot Reloading</string>\n  <string name=\"catalyst_live_reload\" project=\"catalyst\" translatable=\"false\">Enable Live Reload</string>\n  <string name=\"catalyst_live_reload_off\" project=\"catalyst\" translatable=\"false\">Disable Live Reload</string>\n  <string name=\"catalyst_perf_monitor\" project=\"catalyst\" translatable=\"false\">Show Perf Monitor</string>\n  <string name=\"catalyst_perf_monitor_off\" project=\"catalyst\" translatable=\"false\">Hide Perf Monitor</string>\n  <string name=\"catalyst_settings\" project=\"catalyst\" translatable=\"false\">Dev Settings</string>\n  <string name=\"catalyst_settings_title\" project=\"catalyst\" translatable=\"false\">Catalyst Dev Settings</string>\n  <string name=\"catalyst_jsload_error\" project=\"catalyst\" translatable=\"false\">Unable to download JS bundle. Did you forget to start the development server or connect your device?</string>\n  <string name=\"catalyst_remotedbg_message\" project=\"catalyst\" translatable=\"false\">Connecting to remote debugger</string>\n  <string name=\"catalyst_remotedbg_error\" project=\"catalyst\" translatable=\"false\">Unable to connect with remote debugger</string>\n  <string name=\"catalyst_element_inspector\" project=\"catalyst\" translatable=\"false\">Toggle Inspector</string>\n  <string name=\"catalyst_heap_capture\" project=\"catalyst\" translatable=\"false\">Capture Heap</string>\n  <string name=\"catalyst_dismiss_button\" project=\"catalyst\" translatable=\"false\">Dismiss\\n(ESC)</string>\n  <string name=\"catalyst_reload_button\" project=\"catalyst\" translatable=\"false\">Reload\\n(R,\\u00A0R)</string>\n  <string name=\"catalyst_poke_sampling_profiler\" project=\"catalyst\" translatable=\"false\">Start/Stop Sampling Profiler</string>\n  <string name=\"catalyst_copy_button\" project=\"catalyst\" translatable=\"false\">Copy</string>\n  <string name=\"catalyst_report_button\" project=\"catalyst\" translatable=\"false\">Report</string>\n  <string name=\"catalyst_loading_from_url\" project=\"catalyst\" translatable=\"false\">Loading from %1$s…</string>\n</resources>\n"
  },
  {
    "path": "ReactAndroid/src/main/res/devsupport/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n  <style name=\"Theme\"/>\n  <style name=\"Theme.Catalyst\"/>\n  <style name=\"Theme.Catalyst.RedBox\">\n    <item name=\"android:windowBackground\">@color/catalyst_redbox_background</item>\n    <item name=\"android:windowAnimationStyle\">@style/Animation.Catalyst.RedBox</item>\n    <item name=\"android:inAnimation\">@android:anim/fade_in</item>\n    <item name=\"android:outAnimation\">@android:anim/fade_out</item>\n    <item name=\"android:textColor\">@android:color/white</item>\n  </style>\n  <style name=\"Animation.Catalyst.RedBox\" parent=\"@android:style/Animation\">\n    <item name=\"android:windowEnterAnimation\">@anim/catalyst_push_up_in</item>\n    <item name=\"android:windowExitAnimation\">@anim/catalyst_push_up_out</item>\n  </style>\n</resources>\n"
  },
  {
    "path": "ReactAndroid/src/main/res/devsupport/xml/preferences.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<PreferenceScreen\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    >\n  <PreferenceCategory\n      android:key=\"catalyst_perf\"\n      android:title=\"Performance\"\n      >\n    <CheckBoxPreference\n        android:key=\"js_dev_mode_debug\"\n        android:title=\"JS Dev Mode\"\n        android:summary=\"Load JavaScript bundle with __DEV__ = true for easier debugging.  Disable for performance testing. Reload for the change to take effect.\"\n        android:defaultValue=\"true\"\n        />\n    <CheckBoxPreference\n        android:key=\"js_minify_debug\"\n        android:title=\"JS Minify\"\n        android:summary=\"Load JavaScript bundle with minify=true for debugging minification issues.\"\n        android:defaultValue=\"false\"\n        />\n    <CheckBoxPreference\n      android:key=\"js_bundle_deltas\"\n      android:title=\"Use JS Deltas\"\n      android:summary=\"Request delta bundles from metro to get faster reloads (Experimental)\"\n      android:defaultValue=\"true\"\n      />\n    <CheckBoxPreference\n        android:key=\"animations_debug\"\n        android:title=\"Animations FPS Summaries\"\n        android:summary=\"At the end of animations, Toasts and logs to logcat debug information about the FPS during that transition. Currently only supported for transitions (animated navigations).\"\n        android:defaultValue=\"false\"\n        />\n  </PreferenceCategory>\n  <PreferenceCategory\n      android:key=\"pref_key_catalyst_debug\"\n      android:title=\"Debugging\"\n      >\n    <EditTextPreference\n        android:key=\"debug_http_host\"\n        android:title=\"Debug server host &amp; port for device\"\n        android:summary=\"Debug server host &amp; port for downloading JS bundle or communicating with JS debugger. With this setting empty launcher should work fine when running on emulator (or genymotion) and connection to debug server running on emulator's host.\"\n        android:defaultValue=\"\"\n        />\n    <CheckBoxPreference\n        android:key=\"start_sampling_profiler_on_init\"\n        android:title=\"Start Sampling Profiler on init\"\n        android:summary=\"If true the Sampling Profiler will start on initialization of JS. Useful for profiling startup of the app. Reload JS after setting.\"\n        android:defaultValue=\"false\"\n        />\n    <EditTextPreference\n        android:key=\"sampling_profiler_sample_interval\"\n        android:title=\"Sample interval for Sampling Profiler\"\n        android:summary=\"Sample interval in microseconds for the Sampling Profiler (default: 1000). Reload JS after setting.\"\n        android:defaultValue=\"1000\"\n        android:inputType=\"number\"\n        />\n  </PreferenceCategory>\n</PreferenceScreen>\n"
  },
  {
    "path": "ReactAndroid/src/main/res/shell/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources xmlns:tools=\"http://schemas.android.com/tools\">\n    <style name=\"Theme.ReactNative.AppCompat.Light\" parent=\"@style/Theme.AppCompat.Light.NoActionBar\">\n        <item name=\"android:textColor\">@android:color/black</item>\n    </style>\n    <style name=\"Theme.ReactNative.AppCompat.Light.NoActionBar.FullScreen\"\n           parent=\"@style/Theme.ReactNative.AppCompat.Light\">\n        <item name=\"android:windowNoTitle\">true</item>\n        <item name=\"windowActionBar\">false</item>\n        <item name=\"android:windowFullscreen\">true</item>\n        <item name=\"android:windowContentOverlay\">@null</item>\n    </style>\n\n    <style name=\"SpinnerDatePickerDialog\" parent=\"Theme.AppCompat.Light.Dialog\" tools:targetApi=\"lollipop\">\n        <item name=\"android:datePickerStyle\">@style/SpinnerDatePickerStyle</item>\n    </style>\n\n    <style name=\"SpinnerDatePickerStyle\" parent=\"android:Widget.Material.Light.DatePicker\" tools:targetApi=\"lollipop\">\n        <item name=\"android:datePickerMode\">spinner</item>\n    </style>\n\n    <style name=\"CalendarDatePickerDialog\" parent=\"Theme.AppCompat.Light.Dialog\" tools:targetApi=\"lollipop\">\n        <item name=\"android:datePickerStyle\">@style/CalendarDatePickerStyle</item>\n    </style>\n\n    <style name=\"CalendarDatePickerStyle\" parent=\"android:Widget.Material.Light.DatePicker\" tools:targetApi=\"lollipop\">\n        <item name=\"android:datePickerMode\">calendar</item>\n    </style>\n\n\n    <style name=\"ClockTimePickerDialog\" parent=\"Theme.AppCompat.Light.Dialog\" tools:targetApi=\"lollipop\">\n      <item name=\"android:timePickerStyle\">@style/ClockTimePickerStyle</item>\n    </style>\n\n    <style name=\"ClockTimePickerStyle\" parent=\"android:Widget.Material.Light.TimePicker\" tools:targetApi=\"lollipop\">\n      <item name=\"android:timePickerMode\">clock</item>\n    </style>\n\n    <style name=\"SpinnerTimePickerDialog\" parent=\"Theme.AppCompat.Light.Dialog\" tools:targetApi=\"lollipop\">\n      <item name=\"android:timePickerStyle\">@style/SpinnerTimePickerStyle</item>\n    </style>\n\n    <style name=\"SpinnerTimePickerStyle\" parent=\"android:Widget.Material.Light.TimePicker\" tools:targetApi=\"lollipop\">\n      <item name=\"android:timePickerMode\">spinner</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "ReactAndroid/src/main/res/views/modal/anim/catalyst_fade_in.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<alpha xmlns:android=\"http://schemas.android.com/apk/res/android\"\n           android:duration=\"@android:integer/config_shortAnimTime\"\n           android:interpolator=\"@android:anim/accelerate_interpolator\"\n           android:fromAlpha=\"0.0\"\n           android:toAlpha=\"1.0\"\n    />\n"
  },
  {
    "path": "ReactAndroid/src/main/res/views/modal/anim/catalyst_fade_out.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<alpha xmlns:android=\"http://schemas.android.com/apk/res/android\"\n           android:duration=\"@android:integer/config_shortAnimTime\"\n           android:interpolator=\"@android:anim/accelerate_interpolator\"\n           android:fromAlpha=\"1.0\"\n           android:toAlpha=\"0.0\"\n  />\n"
  },
  {
    "path": "ReactAndroid/src/main/res/views/modal/anim/catalyst_slide_down.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<translate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n           android:duration=\"@android:integer/config_shortAnimTime\"\n           android:fromYDelta=\"0%p\"\n           android:toYDelta=\"100%p\"\n    />\n"
  },
  {
    "path": "ReactAndroid/src/main/res/views/modal/anim/catalyst_slide_up.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<translate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n           android:duration=\"@android:integer/config_shortAnimTime\"\n           android:fromYDelta=\"100%p\"\n           android:toYDelta=\"0%p\"\n    />\n"
  },
  {
    "path": "ReactAndroid/src/main/res/views/modal/values/themes.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<resources>\n\n  <style name=\"Theme.FullScreenDialog\">\n    <item name=\"android:windowNoTitle\">true</item>\n    <item name=\"android:windowIsFloating\">false</item>\n    <item name=\"android:windowBackground\">@android:color/transparent</item>\n    <item name=\"android:windowDrawsSystemBarBackgrounds\">true</item>\n    <item name=\"android:statusBarColor\">@android:color/transparent</item>\n  </style>\n\n  <style name=\"Theme.FullScreenDialogAnimatedSlide\" parent=\"Theme.FullScreenDialog\">\n    <item name=\"android:windowAnimationStyle\">@style/DialogAnimationSlide</item>\n  </style>\n\n  <style name=\"Theme.FullScreenDialogAnimatedFade\" parent=\"Theme.FullScreenDialog\">\n    <item name=\"android:windowAnimationStyle\">@style/DialogAnimationFade</item>\n  </style>\n\n  <style name=\"DialogAnimationSlide\">\n    <item name=\"android:windowEnterAnimation\">@anim/catalyst_slide_up</item>\n    <item name=\"android:windowExitAnimation\">@anim/catalyst_slide_down</item>\n  </style>\n\n  <style name=\"DialogAnimationFade\">\n    <item name=\"android:windowEnterAnimation\">@anim/catalyst_fade_in</item>\n    <item name=\"android:windowExitAnimation\">@anim/catalyst_fade_out</item>\n  </style>\n\n\n\n</resources>\n"
  },
  {
    "path": "ReactAndroid/src/main/res/views/uimanager/values/ids.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n  <!-- tag is used to store the testID tag -->\n  <item type=\"id\" name=\"react_test_id\"/>\n\n  <!-- tag is used to store the nativeID tag -->\n  <item type=\"id\" name=\"view_tag_native_id\"/>\n</resources>\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/android/support/v4/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_prebuilt_aar(\n    name = \"lib-support-v4\",\n    aar = \":lib-support-v4-binary-aar\",\n    visibility = [\"PUBLIC\"],\n)\n\nremote_file(\n    name = \"lib-support-v4-binary-aar\",\n    sha1 = \"9e8da0e4ecf9f63258c7fbd273889252cba2d0c3\",\n    url = \"mvn:com.android.support:support-v4:aar:23.0.1\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/android/support/v7/appcompat-orig/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\n# This is a bit messy and hopefully a temporary thing\n# The problem is that Gradle extracts appcompat resources into app namespace, com.facebook.react\n# While BUCK behaves properly and extracts them into android.support.v7.appcompat package.\n# We want to support both Gradle and BUCK builds so we hack a bit how BUCK extracts resources.\n# Besides that we still need JAVA classes from appcompat-v7.aar, that is why android_library\n# extracts classes.jar but the trick is that we can't take full appcompat.aar because resources\n# extracted from it by BUCK would conflict with resources we use under Gradelified package\n# All this mumbo jumbo will go away after t10182713\n\nandroid_library(\n    name = \"appcompat\",\n    exported_deps = [\n        \":classes-for-react-native\",\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        \":res-for-appcompat\",\n    ],\n)\n\n# still used by appcompat library internally, so we need both during the build\nandroid_resource(\n    name = \"res-for-appcompat\",\n    package = \"android.support.v7.appcompat\",\n    res = \":res-unpacker-cmd\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nprebuilt_jar(\n    name = \"classes-for-react-native\",\n    binary_jar = \":classes-unpacker-cmd\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\ngenrule(\n    name = \"classes-unpacker-cmd\",\n    out = \"classes.jar\",\n    cmd = \"$(exe :aar-unpacker) $(location :appcompat-binary-aar) classes.jar $OUT\",\n)\n\ngenrule(\n    name = \"res-unpacker-cmd\",\n    out = \"res\",\n    cmd = \"$(exe :aar-unpacker) $(location :appcompat-binary-aar) res/ $OUT\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\npython_binary(\n    name = \"aar-unpacker\",\n    main = \"aar-unpacker.py\",\n)\n\nremote_file(\n    name = \"appcompat-binary-aar\",\n    sha1 = \"7d659f671541394a8bc2b9f909950aa2a5ec87ff\",\n    url = \"mvn:com.android.support:appcompat-v7:aar:23.0.1\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/android/support-annotations/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nprebuilt_jar(\n    name = \"android-support-annotations\",\n    binary_jar = \":support-annotations-binary-aar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"support-annotations-binary-aar\",\n    sha1 = \"1fce89a6428c51467090d7f424e4c9c3dbd55f7e\",\n    url = \"mvn:com.android.support:support-annotations:jar:23.0.1\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/asm/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"asm\",\n    exported_deps = [\n        \":asm-analysis\",\n        \":asm-commons\",\n        \":asm-core\",\n        \":asm-tree\",\n        \":asm-util\",\n    ],\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nprebuilt_jar(\n    name = \"asm-core\",\n    binary_jar = \":download-asm\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-asm\",\n    sha1 = \"2fd56467a018aafe6ec6a73ccba520be4a7e1565\",\n    url = \"mvn:org.ow2.asm:asm:jar:5.0.1\",\n)\n\nprebuilt_jar(\n    name = \"asm-commons\",\n    binary_jar = \":download-asm-commons\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-asm-commons\",\n    sha1 = \"7b7147a390a93a14d2edfdcf3f7b0e87a0939c3e\",\n    url = \"mvn:org.ow2.asm:asm-commons:jar:5.0.1\",\n)\n\nprebuilt_jar(\n    name = \"asm-tree\",\n    binary_jar = \":download-asm-tree\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-asm-tree\",\n    sha1 = \"1b1e6e9d869acd704056d0a4223071a511c619e6\",\n    url = \"mvn:org.ow2.asm:asm-tree:jar:5.0.1\",\n)\n\nprebuilt_jar(\n    name = \"asm-util\",\n    binary_jar = \":download-asm-util\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-asm-util\",\n    sha1 = \"7c8caddfbd0b2d7b844f8fcc75175b9cb9cf4724\",\n    url = \"mvn:org.ow2.asm:asm-util:jar:5.0.1\",\n)\n\nprebuilt_jar(\n    name = \"asm-analysis\",\n    binary_jar = \":download-asm-analysis\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-asm-analysis\",\n    sha1 = \"e286fbee48efacb4e7c175f7948d9d8b2ab52352\",\n    url = \"mvn:org.ow2.asm:asm-analysis:jar:5.0.1\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/buck-android-support/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\n# this lib was compiled by buck version : 6cbf2709778ea352a169d1c84e3ef2894dfa39ec\nprebuilt_jar(\n    name = \"buck-android-support\",\n    binary_jar = \"buck-android-support.jar\",\n    visibility = [\n        react_native_integration_tests_target(\"...\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/fest/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"fest\",\n    exported_deps = [\n        \":fest-core\",\n        \":fest-util\",\n    ],\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nprebuilt_jar(\n    name = \"fest-core\",\n    binary_jar = \":fest-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"fest-binary-jar\",\n    sha1 = \"cb7c91cf614901928ae405f19d9bcdedf82781db\",\n    url = \"mvn:org.easytesting:fest-assert-core:jar:2.0M10\",\n)\n\nprebuilt_jar(\n    name = \"fest-util\",\n    binary_jar = \":fest-util-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"fest-util-binary-jar\",\n    sha1 = \"c4a8d7305b23b8d043be12c979813b096df11f44\",\n    url = \"mvn:org.easytesting:fest-util:jar:1.2.5\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/infer-annotations/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nprebuilt_jar(\n    name = \"infer-annotations\",\n    binary_jar = \"infer-annotations-4.0.jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/javapoet/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nprebuilt_jar(\n    name = \"javapoet\",\n    binary_jar = \":jsr305-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"jsr305-binary-jar\",\n    sha1 = \"ad3ba65c1788f4d814a4da056323e2b84412fb3c\",\n    url = \"mvn:com.squareup:javapoet:jar:1.2.0\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/jsr-305/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nprebuilt_jar(\n    name = \"jsr-305\",\n    binary_jar = \":jsr305-binary-jar\",\n    visibility = [\"PUBLIC\"],\n)\n\nremote_file(\n    name = \"jsr305-binary-jar\",\n    sha1 = \"5871fb60dc68d67da54a663c3fd636a10a532948\",\n    url = \"mvn:com.google.code.findbugs:jsr305:jar:3.0.0\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/jsr-330/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nprebuilt_jar(\n    name = \"jsr-330\",\n    binary_jar = \":jsr330-binary-jar\",\n    visibility = [\"PUBLIC\"],\n)\n\nremote_file(\n    name = \"jsr330-binary-jar\",\n    sha1 = \"6975da39a7040257bd51d21a231b76c915872d38\",\n    url = \"mvn:javax.inject:javax.inject:jar:1\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/junit/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"junit\",\n    exported_deps = [\n        \":hamcrest\",\n        \":junit-core\",\n    ],\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nprebuilt_jar(\n    name = \"junit-core\",\n    binary_jar = \":download-junit\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-junit\",\n    sha1 = \"2973d150c0dc1fefe998f834810d68f278ea58ec\",\n    url = \"mvn:junit:junit:jar:4.12\",\n)\n\nprebuilt_jar(\n    name = \"hamcrest\",\n    binary_jar = \":download-hamcrest\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-hamcrest\",\n    sha1 = \"63a21ebc981131004ad02e0434e799fd7f3a8d5a\",\n    url = \"mvn:org.hamcrest:hamcrest-all:jar:1.3\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/mockito/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"mockito\",\n    exported_deps = [\n        \":mockito-core\",\n        \":objenesis\",\n    ],\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nprebuilt_jar(\n    name = \"mockito-core\",\n    binary_jar = \":mockito-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"mockito-binary-jar\",\n    sha1 = \"e8546f5bef4e061d8dd73895b4e8f40e3fe6effe\",\n    url = \"mvn:org.mockito:mockito-core:jar:1.10.19\",\n)\n\nprebuilt_jar(\n    name = \"objenesis\",\n    binary_jar = \":objenesis-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"objenesis-binary-jar\",\n    sha1 = \"87c0ea803b69252868d09308b4618f766f135a96\",\n    url = \"mvn:org.objenesis:objenesis:jar:2.1\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/okhttp/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nprebuilt_jar(\n    name = \"okhttp3\",\n    binary_jar = \":okhttp3-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"okhttp3-binary-jar\",\n    sha1 = \"69edde9fc4b01c9fd51d25b83428837478c27254\",\n    url = \"mvn:com.squareup.okhttp3:okhttp:jar:3.6.0\",\n)\n\nprebuilt_jar(\n    name = \"okhttp3-urlconnection\",\n    binary_jar = \":okhttp3-urlconnection-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"okhttp3-urlconnection-binary-jar\",\n    sha1 = \"3f9b16b774f2c36cfd86dd2053d0b3059531dacc\",\n    url = \"mvn:com.squareup.okhttp3:okhttp-urlconnection:jar:3.6.0\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/okio/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nprebuilt_jar(\n    name = \"okio\",\n    binary_jar = \":okio-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"okio-binary-jar\",\n    sha1 = \"a9283170b7305c8d92d25aff02a6ab7e45d06cbe\",\n    url = \"mvn:com.squareup.okio:okio:jar:1.13.0\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/robolectric3/robolectric/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"robolectric\",\n    exported_deps = [\n        \":android-all-4.1.2_r1-robolectric-0\",\n        \":bouncycastle\",\n        \":icu\",\n        \":json-20080701\",\n        \":robolectric-annotations\",\n        \":robolectric-core\",\n        \":robolectric-resources\",\n        \":robolectric-utils\",\n        \":shadows-core-3.0-16\",\n        \":tagsoup-1.2\",\n        \":vtd-xml\",\n        react_native_dep(\"third-party/java/asm:asm\"),\n        react_native_dep(\"third-party/java/sqlite:sqlite\"),\n    ],\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nprebuilt_jar(\n    name = \"robolectric-core\",\n    binary_jar = \":robolectric-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"robolectric-binary-jar\",\n    sha1 = \"f888cea3bc1a24110e315eb9827ab593610ea62f\",\n    url = \"mvn:org.robolectric:robolectric:jar:3.0\",\n)\n\nprebuilt_jar(\n    name = \"robolectric-resources\",\n    binary_jar = \":robolectric-resources-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"robolectric-resources-binary-jar\",\n    sha1 = \"1ab609054aab67cd13a434567467f4b4774f2465\",\n    url = \"mvn:org.robolectric:robolectric-resources:jar:3.0\",\n)\n\nprebuilt_jar(\n    name = \"robolectric-annotations\",\n    binary_jar = \":robolectric-annotations-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"robolectric-annotations-binary-jar\",\n    sha1 = \"2a6cfc072d7680694c1ff893c5dc8fec33163110\",\n    url = \"mvn:org.robolectric:robolectric-annotations:jar:3.0\",\n)\n\nprebuilt_jar(\n    name = \"robolectric-utils\",\n    binary_jar = \":robolectric-utils-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"robolectric-utils-binary-jar\",\n    sha1 = \"4bcecd8115fe7296088bb1636e6cbd7ae8927392\",\n    url = \"mvn:org.robolectric:robolectric-utils:jar:3.0\",\n)\n\nprebuilt_jar(\n    name = \"bouncycastle\",\n    binary_jar = \":bouncycastle-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"bouncycastle-binary-jar\",\n    sha1 = \"ce091790943599535cbb4de8ede84535b0c1260c\",\n    url = \"mvn:org.bouncycastle:bcprov-jdk16:jar:1.46\",\n)\n\nprebuilt_jar(\n    name = \"vtd-xml\",\n    binary_jar = \":vtd-xml-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"vtd-xml-binary-jar\",\n    sha1 = \"ee5bcf62c1acf76434ee9f1c67a840bafef72a6d\",\n    url = \"mvn:com.ximpleware:vtd-xml:jar:2.11\",\n)\n\nprebuilt_jar(\n    name = \"icu\",\n    binary_jar = \":icu-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"icu-binary-jar\",\n    sha1 = \"786d9055d4ca8c1aab4a7d4ac8283f973fd7e41f\",\n    url = \"mvn:com.ibm.icu:icu4j:jar:53.1\",\n)\n\nprebuilt_jar(\n    name = \"android-all-4.1.2_r1-robolectric-0\",  # name defines filename used by robolectric in runtime\n    binary_jar = \":robolectric-android-all-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\n# This new rule will make the .jar file appear in the \"right\" location,\n# though that may change in the future\nexport_file(\n    name = \"robolectric-android-all-binary-jar\",\n    src = \":robolectric-android-all-binary-remote-jar\",\n    out = \"android-all-4.1.2_r1-robolectric-0.jar\",  # name defines filename used by robolectric in runtime\n)\n\nremote_file(\n    name = \"robolectric-android-all-binary-remote-jar\",\n    sha1 = \"aecc8ce5119a25fcea1cdf8285469c9d1261a352\",\n    url = \"mvn:org.robolectric:android-all:jar:4.1.2_r1-robolectric-0\",\n)\n\nprebuilt_jar(\n    name = \"json-20080701\",  # name defines filename used by robolectric in runtime\n    binary_jar = \":json-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nexport_file(\n    name = \"json-jar\",\n    src = \":json-remote-jar\",\n    out = \"json-20080701.jar\",  # name defines filename used by robolectric in runtime\n)\n\nremote_file(\n    name = \"json-remote-jar\",\n    sha1 = \"d652f102185530c93b66158b1859f35d45687258\",\n    url = \"mvn:org.json:json:jar:20080701\",\n)\n\nprebuilt_jar(\n    name = \"tagsoup-1.2\",  # name defines filename used by robolectric in runtime\n    binary_jar = \":tagsoup-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nexport_file(\n    name = \"tagsoup-jar\",\n    src = \":tagsoup-remote-jar\",\n    out = \"tagsoup-1.2.jar\",  # name defines filename used by robolectric in runtime\n)\n\nremote_file(\n    name = \"tagsoup-remote-jar\",\n    sha1 = \"639fd364750d7363c85797dc944b4a80f78fa684\",\n    url = \"mvn:org.ccil.cowan.tagsoup:tagsoup:jar:1.2\",\n)\n\nprebuilt_jar(\n    name = \"shadows-core-3.0-16\",  # name defines filename used by robolectric in runtime\n    binary_jar = \":robolectric-shadows-binary-jar\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nexport_file(\n    name = \"robolectric-shadows-binary-jar\",\n    src = \":robolectric-shadows-binary-remote-jar\",\n    out = \"shadows-core-3.0-16.jar\",  # name defines filename used by robolectric in runtime\n)\n\nremote_file(\n    name = \"robolectric-shadows-binary-remote-jar\",\n    sha1 = \"39d7a856bf91640b1a6d044333336a2b3f3c198f\",\n    url = \"https://repo1.maven.org/maven2/org/robolectric/shadows-core/3.0/shadows-core-3.0-16.jar\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/sqlite/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"sqlite\",\n    exported_deps = [\n        \":sqlite4java\",\n    ],\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nprebuilt_jar(\n    name = \"sqlite4java\",\n    binary_jar = \":download-sqlite4java\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"download-sqlite4java\",\n    sha1 = \"745a7e2f35fdbe6336922e0d492c979dbbfa74fb\",\n    url = \"mvn:com.almworks.sqlite4java:sqlite4java:jar:0.282\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/main/third-party/java/testing-support-lib/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_prebuilt_aar(\n    name = \"runner\",\n    aar = \":testing-support-lib-runner-download\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"testing-support-lib-runner-download\",\n    sha1 = \"a31e7e8db98ca19fb3fab23f120d19a6f4e3e8a9\",\n    url = \"mvn:com.android.support.test:runner:aar:0.3\",\n)\n\nandroid_prebuilt_aar(\n    name = \"exposed-instrumentation-api\",\n    aar = \":testing-support-instrumentation\",\n    visibility = [\"//ReactAndroid/...\"],\n)\n\nremote_file(\n    name = \"testing-support-instrumentation\",\n    sha1 = \"a7161eafdfbd02a39461f076c9dce0c8e5e7a149\",\n    url = \"mvn:com.android.support.test:exposed-instrumentation-api-publish:aar:0.3\",\n)\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/common/logging/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"logging\",\n    srcs = glob([\"**/*.java\"]),\n    exported_deps = [\n        react_native_dep(\"libraries/fbcore/src/main/java/com/facebook/common/logging:logging\"),\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/common/logging/FakeLoggingDelegate.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.common.logging;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collections;\n\nimport javax.annotation.Nullable;\n\npublic final class FakeLoggingDelegate implements LoggingDelegate {\n\n  public static final class LogLine {\n    public final int priority;\n    public final String tag;\n    public final String msg;\n    public final @Nullable Throwable tr;\n\n    private LogLine(\n      int priority,\n      String tag,\n      String msg,\n      @Nullable Throwable tr) {\n\n      this.priority = priority;\n      this.tag = tag;\n      this.msg = msg;\n      this.tr = tr;\n    }\n  }\n\n  public static final int ASSERT  = FLog.ASSERT;\n  public static final int DEBUG   = FLog.DEBUG;\n  public static final int ERROR   = FLog.ERROR;\n  public static final int INFO    = FLog.INFO;\n  public static final int VERBOSE = FLog.VERBOSE;\n  public static final int WARN    = FLog.WARN;\n\n  /**\n   * There is no log level for Terrible Failures (we emit them at the Error\n   * Log-level), but to test that WTF errors are being logged, we are making up\n   * a new log level here, guaranteed to be larger than any of the other log\n   * levels.\n   */\n  public static final int WTF =\n    1 + Collections.max(Arrays.asList(ASSERT, DEBUG, ERROR, INFO, VERBOSE, WARN));\n\n  private int mMinLogLevel = FLog.VERBOSE;\n  private final ArrayList<LogLine> mLogs = new ArrayList<>();\n\n  /** Test Harness */\n\n  private static boolean matchLogQuery(\n      int priority,\n      String tag,\n      @Nullable String throwMsg,\n      LogLine line) {\n    return priority == line.priority\n      && tag.equals(line.tag)\n      && (throwMsg == null || throwMsg.equals(line.tr.getMessage()));\n  }\n\n  public boolean logContains(int priority, String tag, String throwMsg) {\n    for (FakeLoggingDelegate.LogLine line : mLogs) {\n      if (matchLogQuery(priority, tag, throwMsg, line)) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  /** LoggingDelegate API */\n\n  public int getMinimumLoggingLevel() {\n    return mMinLogLevel;\n  }\n\n  public void setMinimumLoggingLevel(int level) {\n    mMinLogLevel = level;\n  }\n\n  public boolean isLoggable(int level) {\n    return level >= mMinLogLevel;\n  }\n\n  private void logImpl(int priority, String tag, String msg, Throwable tr) {\n    if (isLoggable(priority)) {\n      mLogs.add(new LogLine(priority, tag, msg, tr));\n    }\n  }\n\n  public void log(int priority, String tag, String msg) {\n    logImpl(priority, tag, msg, null);\n  }\n\n  public void d(String tag, String msg, Throwable tr) {\n    logImpl(DEBUG, tag, msg, tr);\n  }\n\n  public void d(String tag, String msg) {\n    logImpl(DEBUG, tag, msg, null);\n  }\n\n  public void e(String tag, String msg, Throwable tr) {\n    logImpl(ERROR, tag, msg, tr);\n  }\n\n  public void e(String tag, String msg) {\n    logImpl(ERROR, tag, msg, null);\n  }\n\n  public void i(String tag, String msg, Throwable tr) {\n    logImpl(INFO, tag, msg, tr);\n  }\n\n  public void i(String tag, String msg) {\n    logImpl(INFO, tag, msg, null);\n  }\n\n  public void v(String tag, String msg, Throwable tr) {\n    logImpl(VERBOSE, tag, msg, tr);\n  }\n\n  public void v(String tag, String msg) {\n    logImpl(VERBOSE, tag, msg, null);\n  }\n\n  public void w(String tag, String msg, Throwable tr) {\n    logImpl(WARN, tag, msg, tr);\n  }\n\n  public void w(String tag, String msg) {\n    logImpl(WARN, tag, msg, null);\n  }\n\n  public void wtf(String tag, String msg, Throwable tr) {\n    logImpl(WTF, tag, msg, tr);\n  }\n\n  public void wtf(String tag, String msg) {\n    logImpl(WTF, tag, msg, null);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nrn_robolectric_test(\n    name = \"react\",\n    srcs = glob([\"*.java\"]),\n    # Please change the contact to the oncall of your team\n    contacts = [\"oncall+fbandroid_sheriff@xmail.facebook.com\"],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"libraries/fbcore/src/test/java/com/facebook/powermock:powermock\"),\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n        react_native_dep(\"third-party/java/fest:fest\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/junit:junit\"),\n        react_native_dep(\"third-party/java/mockito:mockito\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_dep(\"third-party/java/robolectric3/robolectric:robolectric\"),\n        react_native_target(\"java/com/facebook/react:react\"),\n        react_native_target(\"java/com/facebook/react/animation:animation\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/touch:touch\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/views/text:text\"),\n        react_native_target(\"java/com/facebook/react/views/view:view\"),\n        react_native_tests_target(\"java/com/facebook/react/bridge:testhelpers\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/CompositeReactPackageTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport java.util.Arrays;\nimport java.util.ArrayList;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\n\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.junit.Rule;\n\nimport org.mockito.Mock;\nimport org.mockito.MockitoAnnotations;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class CompositeReactPackageTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  @Mock ReactPackage packageNo1;\n  @Mock ReactPackage packageNo2;\n  @Mock ReactPackage packageNo3;\n\n  @Mock ReactApplicationContext reactContext;\n\n  @Before\n  public void initMocks() {\n    MockitoAnnotations.initMocks(this);\n  }\n\n  @Test\n  public void testThatCreateNativeModulesIsCalledOnAllPackages() {\n    // Given\n    CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2, packageNo3);\n\n    // When\n    composite.createNativeModules(reactContext);\n\n    // Then\n    verify(packageNo1).createNativeModules(reactContext);\n    verify(packageNo2).createNativeModules(reactContext);\n    verify(packageNo3).createNativeModules(reactContext);\n  }\n\n  @Test\n  public void testThatCreateViewManagersIsCalledOnAllPackages() {\n    // Given\n    CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2, packageNo3);\n\n    // When\n    composite.createViewManagers(reactContext);\n\n    // Then\n    verify(packageNo1).createViewManagers(reactContext);\n    verify(packageNo2).createViewManagers(reactContext);\n    verify(packageNo3).createViewManagers(reactContext);\n  }\n\n  @Test\n  public void testThatCompositeReturnsASumOfNativeModules() {\n    // Given\n    CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2);\n\n    NativeModule moduleNo1 = mock(NativeModule.class);\n    when(moduleNo1.getName()).thenReturn(\"ModuleNo1\");\n\n    // module2 and module3 will share same name, composite should return only the latter one\n    final String sameModuleName = \"SameModuleName\";\n\n    NativeModule moduleNo2 = mock(NativeModule.class);\n    when(moduleNo2.getName()).thenReturn(sameModuleName);\n\n    NativeModule moduleNo3 = mock(NativeModule.class);\n    when(moduleNo3.getName()).thenReturn(sameModuleName);\n\n    NativeModule moduleNo4 = mock(NativeModule.class);\n    when(moduleNo4.getName()).thenReturn(\"ModuleNo4\");\n\n    when(packageNo1.createNativeModules(reactContext)).thenReturn(\n        Arrays.asList(new NativeModule[]{moduleNo1, moduleNo2}));\n\n    when(packageNo2.createNativeModules(reactContext)).thenReturn(\n        Arrays.asList(new NativeModule[]{moduleNo3, moduleNo4}));\n\n    // When\n    List<NativeModule> compositeModules = composite.createNativeModules(reactContext);\n\n    // Then\n\n    // Wrapping lists into sets to be order-independent.\n    // Note that there should be no module2 returned.\n    Set<NativeModule> expected = new HashSet<>(\n        Arrays.asList(new NativeModule[]{moduleNo1, moduleNo3, moduleNo4}));\n    Set<NativeModule> actual = new HashSet<>(compositeModules);\n\n    assertEquals(expected, actual);\n  }\n\n  @Test\n  public void testThatCompositeReturnsASumOfViewManagers() {\n    // Given\n    CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2);\n\n    ViewManager managerNo1 = mock(ViewManager.class);\n    when(managerNo1.getName()).thenReturn(\"ManagerNo1\");\n\n    // managerNo2 and managerNo3 will share same name, composite should return only the latter one\n    final String sameModuleName = \"SameModuleName\";\n\n    ViewManager managerNo2 = mock(ViewManager.class);\n    when(managerNo2.getName()).thenReturn(sameModuleName);\n\n    ViewManager managerNo3 = mock(ViewManager.class);\n    when(managerNo3.getName()).thenReturn(sameModuleName);\n\n    ViewManager managerNo4 = mock(ViewManager.class);\n    when(managerNo4.getName()).thenReturn(\"ManagerNo4\");\n\n    when(packageNo1.createViewManagers(reactContext)).thenReturn(\n        Arrays.asList(new ViewManager[]{managerNo1, managerNo2}));\n\n    when(packageNo2.createViewManagers(reactContext)).thenReturn(\n        Arrays.asList(new ViewManager[]{managerNo3, managerNo4}));\n\n    // When\n    List<ViewManager> compositeModules = composite.createViewManagers(reactContext);\n\n    // Then\n\n    // Wrapping lists into sets to be order-independent.\n    // Note that there should be no managerNo2 returned.\n    Set<ViewManager> expected = new HashSet<>(\n        Arrays.asList(new ViewManager[]{managerNo1, managerNo3, managerNo4})\n    );\n    Set<ViewManager> actual = new HashSet<>(compositeModules);\n\n    assertEquals(expected, actual);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/RootViewTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react;\n\nimport java.util.Date;\n\nimport android.util.DisplayMetrics;\nimport android.view.MotionEvent;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.ReactTestHelper;\nimport com.facebook.react.bridge.JavaOnlyArray;\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.common.SystemClock;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.DisplayMetricsHolder;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.junit.Rule;\nimport org.mockito.ArgumentCaptor;\nimport org.mockito.invocation.InvocationOnMock;\nimport org.mockito.stubbing.Answer;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\nimport static org.mockito.Matchers.any;\nimport static org.mockito.Matchers.eq;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.reset;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\nimport static org.mockito.Mockito.when;\n\n@PrepareForTest({Arguments.class, SystemClock.class})\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class RootViewTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private ReactContext mReactContext;\n  private CatalystInstance mCatalystInstanceMock;\n\n  @Before\n  public void setUp() {\n    final long ts = SystemClock.uptimeMillis();\n    PowerMockito.mockStatic(Arguments.class);\n    PowerMockito.when(Arguments.createArray()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return new JavaOnlyArray();\n      }\n    });\n    PowerMockito.when(Arguments.createMap()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return new JavaOnlyMap();\n      }\n    });\n    PowerMockito.mockStatic(SystemClock.class);\n    PowerMockito.when(SystemClock.uptimeMillis()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return ts;\n      }\n    });\n\n    mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();\n    mReactContext = new ReactApplicationContext(RuntimeEnvironment.application);\n    mReactContext.initializeWithInstance(mCatalystInstanceMock);\n    DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(mReactContext);\n\n    UIManagerModule uiManagerModuleMock = mock(UIManagerModule.class);\n    when(mCatalystInstanceMock.getNativeModule(UIManagerModule.class))\n        .thenReturn(uiManagerModuleMock);\n  }\n\n  @Test\n  public void testTouchEmitter() {\n    ReactInstanceManager instanceManager = mock(ReactInstanceManager.class);\n    when(instanceManager.getCurrentReactContext()).thenReturn(mReactContext);\n\n    UIManagerModule uiManager = mock(UIManagerModule.class);\n    EventDispatcher eventDispatcher = mock(EventDispatcher.class);\n    RCTEventEmitter eventEmitterModuleMock = mock(RCTEventEmitter.class);\n    when(mCatalystInstanceMock.getNativeModule(UIManagerModule.class))\n        .thenReturn(uiManager);\n    when(uiManager.getEventDispatcher()).thenReturn(eventDispatcher);\n\n    int rootViewId = 7;\n\n    ReactRootView rootView = new ReactRootView(mReactContext);\n    rootView.setId(rootViewId);\n    rootView.startReactApplication(instanceManager, \"\");\n    rootView.simulateAttachForTesting();\n\n    long ts = SystemClock.uptimeMillis();\n\n    // Test ACTION_DOWN event\n    rootView.onTouchEvent(\n        MotionEvent.obtain(100, ts, MotionEvent.ACTION_DOWN, 0, 0, 0));\n\n    ArgumentCaptor<Event> downEventCaptor = ArgumentCaptor.forClass(Event.class);\n    verify(eventDispatcher).dispatchEvent(downEventCaptor.capture());\n    verifyNoMoreInteractions(eventDispatcher);\n\n    downEventCaptor.getValue().dispatch(eventEmitterModuleMock);\n\n    ArgumentCaptor<JavaOnlyArray> downActionTouchesArgCaptor =\n        ArgumentCaptor.forClass(JavaOnlyArray.class);\n    verify(eventEmitterModuleMock).receiveTouches(\n        eq(\"topTouchStart\"),\n        downActionTouchesArgCaptor.capture(),\n        any(JavaOnlyArray.class));\n    verifyNoMoreInteractions(eventEmitterModuleMock);\n\n    assertThat(downActionTouchesArgCaptor.getValue().size()).isEqualTo(1);\n    assertThat(downActionTouchesArgCaptor.getValue().getMap(0)).isEqualTo(\n        JavaOnlyMap.of(\n            \"pageX\",\n            0.,\n            \"pageY\",\n            0.,\n            \"locationX\",\n            0.,\n            \"locationY\",\n            0.,\n            \"target\",\n            rootViewId,\n            \"timestamp\",\n            (double) ts,\n            \"identifier\",\n            0.));\n\n    // Test ACTION_UP event\n    reset(eventEmitterModuleMock, eventDispatcher);\n\n    ArgumentCaptor<Event> upEventCaptor = ArgumentCaptor.forClass(Event.class);\n    ArgumentCaptor<JavaOnlyArray> upActionTouchesArgCaptor =\n        ArgumentCaptor.forClass(JavaOnlyArray.class);\n\n    rootView.onTouchEvent(\n        MotionEvent.obtain(50, ts, MotionEvent.ACTION_UP, 0, 0, 0));\n    verify(eventDispatcher).dispatchEvent(upEventCaptor.capture());\n    verifyNoMoreInteractions(eventDispatcher);\n\n    upEventCaptor.getValue().dispatch(eventEmitterModuleMock);\n    verify(eventEmitterModuleMock).receiveTouches(\n        eq(\"topTouchEnd\"),\n        upActionTouchesArgCaptor.capture(),\n        any(WritableArray.class));\n    verifyNoMoreInteractions(eventEmitterModuleMock);\n\n    assertThat(upActionTouchesArgCaptor.getValue().size()).isEqualTo(1);\n    assertThat(upActionTouchesArgCaptor.getValue().getMap(0)).isEqualTo(\n        JavaOnlyMap.of(\n            \"pageX\",\n            0.,\n            \"pageY\",\n            0.,\n            \"locationX\",\n            0.,\n            \"locationY\",\n            0.,\n            \"target\",\n            rootViewId,\n            \"timestamp\",\n            (double) ts,\n            \"identifier\",\n            0.));\n\n    // Test other action\n    reset(eventDispatcher);\n    rootView.onTouchEvent(\n        MotionEvent.obtain(50, new Date().getTime(), MotionEvent.ACTION_HOVER_MOVE, 0, 0, 0));\n    verifyNoMoreInteractions(eventDispatcher);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/animated/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nrn_robolectric_test(\n    name = \"animated\",\n    srcs = glob([\"**/*.java\"]),\n    # Please change the contact to the oncall of your team\n    contacts = [\"oncall+fbandroid_sheriff@xmail.facebook.com\"],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/test/java/com/facebook/powermock:powermock\"),\n        react_native_dep(\"third-party/java/fest:fest\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/junit:junit\"),\n        react_native_dep(\"third-party/java/mockito:mockito\"),\n        react_native_dep(\"third-party/java/robolectric3/robolectric:robolectric\"),\n        react_native_target(\"java/com/facebook/react:react\"),\n        react_native_target(\"java/com/facebook/react/animated:animated\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_tests_target(\"java/com/facebook/react/bridge:testhelpers\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.java",
    "content": "package com.facebook.react.animated;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\n\n/**\n * Tests method used by {@link InterpolationAnimatedNode} to interpolate value of the input nodes.\n */\n@RunWith(RobolectricTestRunner.class)\npublic class NativeAnimatedInterpolationTest {\n\n  private double simpleInterpolation(double value, double[] input, double[] output) {\n    return InterpolationAnimatedNode.interpolate(\n      value,\n      input,\n      output,\n      InterpolationAnimatedNode.EXTRAPOLATE_TYPE_EXTEND,\n      InterpolationAnimatedNode.EXTRAPOLATE_TYPE_EXTEND\n    );\n  }\n\n  @Test\n  public void testSimpleOneToOneMapping() {\n    double[] input = new double[] {0d, 1d};\n    double[] output = new double[] {0d, 1d};\n    assertThat(simpleInterpolation(0, input, output)).isEqualTo(0);\n    assertThat(simpleInterpolation(0.5, input, output)).isEqualTo(0.5);\n    assertThat(simpleInterpolation(0.8, input, output)).isEqualTo(0.8);\n    assertThat(simpleInterpolation(1, input, output)).isEqualTo(1);\n  }\n\n  @Test\n  public void testWiderOutputRange() {\n    double[] input = new double[] {0d, 1d};\n    double[] output = new double[] {100d, 200d};\n    assertThat(simpleInterpolation(0, input, output)).isEqualTo(100);\n    assertThat(simpleInterpolation(0.5, input, output)).isEqualTo(150);\n    assertThat(simpleInterpolation(0.8, input, output)).isEqualTo(180);\n    assertThat(simpleInterpolation(1, input, output)).isEqualTo(200);\n  }\n\n  @Test\n  public void testWiderInputRange() {\n    double[] input = new double[] {2000d, 3000d};\n    double[] output = new double[] {1d, 2d};\n    assertThat(simpleInterpolation(2000, input, output)).isEqualTo(1);\n    assertThat(simpleInterpolation(2250, input, output)).isEqualTo(1.25);\n    assertThat(simpleInterpolation(2800, input, output)).isEqualTo(1.8);\n    assertThat(simpleInterpolation(3000, input, output)).isEqualTo(2);\n  }\n\n  @Test\n  public void testManySegments() {\n    double[] input = new double[] {-1d, 1d, 5d};\n    double[] output = new double[] {0, 10d, 20d};\n    assertThat(simpleInterpolation(-1, input, output)).isEqualTo(0);\n    assertThat(simpleInterpolation(0, input, output)).isEqualTo(5);\n    assertThat(simpleInterpolation(1, input, output)).isEqualTo(10);\n    assertThat(simpleInterpolation(2, input, output)).isEqualTo(12.5);\n    assertThat(simpleInterpolation(5, input, output)).isEqualTo(20);\n  }\n\n  @Test\n  public void testExtendExtrapolate() {\n    double[] input = new double[] {10d, 20d};\n    double[] output = new double[] {0d, 1d};\n    assertThat(simpleInterpolation(30d, input, output)).isEqualTo(2);\n    assertThat(simpleInterpolation(5d, input, output)).isEqualTo(-0.5);\n  }\n\n  @Test\n  public void testClampExtrapolate() {\n    double[] input = new double[] {10d, 20d};\n    double[] output = new double[] {0d, 1d};\n    assertThat(InterpolationAnimatedNode.interpolate(\n      30d,\n      input,\n      output,\n      InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP,\n      InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP\n    )).isEqualTo(1);\n    assertThat(InterpolationAnimatedNode.interpolate(\n      5d,\n      input,\n      output,\n      InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP,\n      InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP\n    )).isEqualTo(0);\n  }\n\n  @Test\n  public void testIdentityExtrapolate() {\n    double[] input = new double[] {10d, 20d};\n    double[] output = new double[] {0d, 1d};\n    assertThat(InterpolationAnimatedNode.interpolate(\n      30d,\n      input,\n      output,\n      InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY,\n      InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY\n    )).isEqualTo(30);\n    assertThat(InterpolationAnimatedNode.interpolate(\n      5d,\n      input,\n      output,\n      InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY,\n      InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY\n    )).isEqualTo(5);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.animated;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.JavaOnlyArray;\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.uimanager.ReactStylesDiffMap;\nimport com.facebook.react.uimanager.UIImplementation;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.events.Event;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport com.facebook.react.uimanager.events.RCTEventEmitter;\n\nimport java.util.Map;\n\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.ArgumentCaptor;\nimport org.mockito.invocation.InvocationOnMock;\nimport org.mockito.stubbing.Answer;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\nimport static org.mockito.Matchers.any;\nimport static org.mockito.Matchers.anyInt;\nimport static org.mockito.Matchers.eq;\nimport static org.mockito.Mockito.atMost;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.reset;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\n\n/**\n * Tests the animated nodes graph traversal algorithm from {@link NativeAnimatedNodesManager}.\n */\n@PrepareForTest({Arguments.class})\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class NativeAnimatedNodeTraversalTest {\n\n  private static long FRAME_LEN_NANOS = 1000000000L / 60L;\n  private static long INITIAL_FRAME_TIME_NANOS = 14599233201256L; /* random */\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private long mFrameTimeNanos;\n  private UIManagerModule mUIManagerMock;\n  private UIImplementation mUIImplementationMock;\n  private EventDispatcher mEventDispatcherMock;\n  private NativeAnimatedNodesManager mNativeAnimatedNodesManager;\n\n  private long nextFrameTime() {\n    return mFrameTimeNanos += FRAME_LEN_NANOS;\n  }\n\n  @Before\n  public void setUp() {\n    PowerMockito.mockStatic(Arguments.class);\n    PowerMockito.when(Arguments.createArray()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return new JavaOnlyArray();\n      }\n    });\n    PowerMockito.when(Arguments.createMap()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return new JavaOnlyMap();\n      }\n    });\n\n    mFrameTimeNanos = INITIAL_FRAME_TIME_NANOS;\n    mUIManagerMock = mock(UIManagerModule.class);\n    mUIImplementationMock = mock(UIImplementation.class);\n    mEventDispatcherMock = mock(EventDispatcher.class);\n    PowerMockito.when(mUIManagerMock.getUIImplementation()).thenAnswer(new Answer<UIImplementation>() {\n      @Override\n      public UIImplementation answer(InvocationOnMock invocation) throws Throwable {\n        return mUIImplementationMock;\n      }\n    });\n    PowerMockito.when(mUIManagerMock.getEventDispatcher()).thenAnswer(new Answer<EventDispatcher>() {\n      @Override\n      public EventDispatcher answer(InvocationOnMock invocation) throws Throwable {\n        return mEventDispatcherMock;\n      }\n    });\n    PowerMockito.when(mUIManagerMock.getConstants()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return MapBuilder.of(\"customDirectEventTypes\", MapBuilder.newHashMap());\n      }\n    });\n    PowerMockito\n        .when(mUIManagerMock.getDirectEventNamesResolver())\n        .thenAnswer(new Answer<UIManagerModule.CustomEventNamesResolver>() {\n      @Override\n      public UIManagerModule.CustomEventNamesResolver answer(InvocationOnMock invocation) throws Throwable {\n        return new UIManagerModule.CustomEventNamesResolver() {\n          @Override\n          public String resolveCustomEventName(String eventName) {\n            Map<String, Map> directEventTypes =\n                (Map<String, Map>) mUIManagerMock.getConstants().get(\"customDirectEventTypes\");\n            if (directEventTypes != null) {\n              Map<String, String> customEventType = (Map<String, String>) directEventTypes.get(eventName);\n              if (customEventType != null) {\n                return customEventType.get(\"registrationName\");\n              }\n            }\n            return eventName;\n          }\n        };\n      }\n    });\n    mNativeAnimatedNodesManager = new NativeAnimatedNodesManager(mUIManagerMock);\n  }\n\n  /**\n   * Generates a simple animated nodes graph and attaches the props node to a given {@param viewTag}\n   * Parameter {@param opacity} is used as a initial value for the \"opacity\" attribute.\n   *\n   * Nodes are connected as follows (nodes IDs in parens):\n   * ValueNode(1) -> StyleNode(2) -> PropNode(3)\n   */\n  private void createSimpleAnimatedViewWithOpacity(int viewTag, double opacity) {\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      1,\n      JavaOnlyMap.of(\"type\", \"value\", \"value\", opacity, \"offset\", 0d));\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      2,\n      JavaOnlyMap.of(\"type\", \"style\", \"style\", JavaOnlyMap.of(\"opacity\", 1)));\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      3,\n      JavaOnlyMap.of(\"type\", \"props\", \"props\", JavaOnlyMap.of(\"style\", 2)));\n    mNativeAnimatedNodesManager.connectAnimatedNodes(1, 2);\n    mNativeAnimatedNodesManager.connectAnimatedNodes(2, 3);\n    mNativeAnimatedNodesManager.connectAnimatedNodeToView(3, viewTag);\n  }\n\n  @Test\n  public void testFramesAnimation() {\n    createSimpleAnimatedViewWithOpacity(1000, 0d);\n\n    JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d);\n    Callback animationCallback = mock(Callback.class);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 1d),\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n        ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN)).isEqualTo(0);\n\n    for (int i = 0; i < frames.size(); i++) {\n      reset(mUIImplementationMock);\n      mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n      verify(mUIImplementationMock)\n          .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n      assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN))\n          .isEqualTo(frames.getDouble(i));\n    }\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(mUIImplementationMock);\n  }\n\n  @Test\n  public void testFramesAnimationLoopsFiveTimes() {\n    createSimpleAnimatedViewWithOpacity(1000, 0d);\n\n    JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d);\n    Callback animationCallback = mock(Callback.class);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 1d, \"iterations\", 5),\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n        ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN)).isEqualTo(0);\n\n    for (int iteration = 0; iteration < 5; iteration++) {\n      for (int i = 0; i < frames.size(); i++) {\n        reset(mUIImplementationMock);\n        mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n        verify(mUIImplementationMock)\n            .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n        assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN))\n            .isEqualTo(frames.getDouble(i));\n      }\n    }\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(mUIImplementationMock);\n  }\n\n  @Test\n  public void testNodeValueListenerIfNotListening() {\n    int nodeId = 1;\n\n    createSimpleAnimatedViewWithOpacity(1000, 0d);\n    JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d);\n\n    Callback animationCallback = mock(Callback.class);\n    AnimatedNodeValueListener valueListener = mock(AnimatedNodeValueListener.class);\n\n    mNativeAnimatedNodesManager.startListeningToAnimatedNodeValue(nodeId, valueListener);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      nodeId,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 1d),\n      animationCallback);\n\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(valueListener).onValueUpdate(eq(0d));\n\n    mNativeAnimatedNodesManager.stopListeningToAnimatedNodeValue(nodeId);\n\n    reset(valueListener);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(valueListener);\n  }\n\n  @Test\n  public void testNodeValueListenerIfListening() {\n    int nodeId = 1;\n\n    createSimpleAnimatedViewWithOpacity(1000, 0d);\n    JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d);\n\n    Callback animationCallback = mock(Callback.class);\n    AnimatedNodeValueListener valueListener = mock(AnimatedNodeValueListener.class);\n\n    mNativeAnimatedNodesManager.startListeningToAnimatedNodeValue(nodeId, valueListener);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      nodeId,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 1d),\n      animationCallback);\n\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(valueListener).onValueUpdate(eq(0d));\n\n    for (int i = 0; i < frames.size(); i++) {\n      reset(valueListener);\n      mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n      verify(valueListener).onValueUpdate(eq(frames.getDouble(i)));\n    }\n\n    reset(valueListener);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(valueListener);\n  }\n\n  public void performSpringAnimationTestWithConfig(JavaOnlyMap config, boolean testForCriticallyDamped) {\n    createSimpleAnimatedViewWithOpacity(1000, 0d);\n\n    Callback animationCallback = mock(Callback.class);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      config,\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN)).isEqualTo(0);\n\n    double previousValue = 0d;\n    boolean wasGreaterThanOne = false;\n    /* run 3 secs of animation */\n    for (int i = 0; i < 3 * 60; i++) {\n      reset(mUIImplementationMock);\n      mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n      verify(mUIImplementationMock, atMost(1))\n        .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n      double currentValue = stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN);\n      if (currentValue > 1d) {\n        wasGreaterThanOne = true;\n      }\n      // verify that animation step is relatively small\n      assertThat(Math.abs(currentValue - previousValue)).isLessThan(0.12d);\n      previousValue = currentValue;\n    }\n    // verify that we've reach the final value at the end of animation\n    assertThat(previousValue).isEqualTo(1d);\n    // verify that value has reached some maximum value that is greater than the final value (bounce)\n    if (testForCriticallyDamped) {\n      assertThat(!wasGreaterThanOne);\n    } else {\n      assertThat(wasGreaterThanOne);\n    }\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(mUIImplementationMock);\n  }\n\n  @Test\n  public void testUnderdampedSpringAnimation() {\n    performSpringAnimationTestWithConfig(\n      JavaOnlyMap.of(\n        \"type\",\n        \"spring\",\n        \"stiffness\",\n        230.2d,\n        \"damping\",\n        22d,\n        \"mass\",\n        1d,\n        \"initialVelocity\",\n        0d,\n        \"toValue\",\n        1d,\n        \"restSpeedThreshold\",\n        0.001d,\n        \"restDisplacementThreshold\",\n        0.001d,\n        \"overshootClamping\",\n        false\n      ),\n      false\n    );\n  }\n\n  @Test\n  public void testCriticallyDampedSpringAnimation() {\n    performSpringAnimationTestWithConfig(\n      JavaOnlyMap.of(\n        \"type\",\n        \"spring\",\n        \"stiffness\",\n        1000d,\n        \"damping\",\n        500d,\n        \"mass\",\n        3.0d,\n        \"initialVelocity\",\n        0d,\n        \"toValue\",\n        1d,\n        \"restSpeedThreshold\",\n        0.001d,\n        \"restDisplacementThreshold\",\n        0.001d,\n        \"overshootClamping\",\n        false\n      ),\n      true\n    );\n  }\n\n  @Test\n  public void testSpringAnimationLoopsFiveTimes() {\n    createSimpleAnimatedViewWithOpacity(1000, 0d);\n\n    Callback animationCallback = mock(Callback.class);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\n        \"type\",\n        \"spring\",\n        \"stiffness\",\n        230.2d,\n        \"damping\",\n        22d,\n        \"mass\",\n        1d,\n        \"initialVelocity\",\n        0d,\n        \"toValue\",\n        1d,\n        \"restSpeedThreshold\",\n        0.001d,\n        \"restDisplacementThreshold\",\n        0.001d,\n        \"overshootClamping\",\n        false,\n        \"iterations\",\n        5\n      ),\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN)).isEqualTo(0);\n\n    double previousValue = 0d;\n    boolean wasGreaterThanOne = false;\n    boolean didComeToRest = false;\n    int numberOfResets = 0;\n    /* run 3 secs of animation, five times */\n    for (int i = 0; i < 3 * 60 * 5; i++) {\n      reset(mUIImplementationMock);\n      mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n      verify(mUIImplementationMock, atMost(1))\n        .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n      double currentValue = stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN);\n      if (currentValue > 1d) {\n        wasGreaterThanOne = true;\n      }\n      // Test to see if it reset after coming to rest\n      if (didComeToRest &&\n          currentValue == 0d &&\n          Math.abs(Math.abs(currentValue - previousValue) - 1d) < 0.001d) {\n        numberOfResets++;\n      }\n\n      // verify that an animation step is relatively small, unless it has come to rest and reset\n      if (!didComeToRest) assertThat(Math.abs(currentValue - previousValue)).isLessThan(0.12d);\n\n\n       // record that the animation did come to rest when it rests on toValue\n      didComeToRest = Math.abs(currentValue - 1d) < 0.001d &&\n                      Math.abs(currentValue - previousValue) < 0.001d;\n      previousValue = currentValue;\n    }\n    // verify that we've reach the final value at the end of animation\n    assertThat(previousValue).isEqualTo(1d);\n    // verify that value has reached some maximum value that is greater than the final value (bounce)\n    assertThat(wasGreaterThanOne);\n    // verify that value reset 4 times after finishing a full animation\n    assertThat(numberOfResets).isEqualTo(4);\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(mUIImplementationMock);\n  }\n\n  @Test\n  public void testDecayAnimation() {\n    createSimpleAnimatedViewWithOpacity(1000, 0d);\n\n    Callback animationCallback = mock(Callback.class);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\n        \"type\",\n        \"decay\",\n        \"velocity\",\n        0.5d,\n        \"deceleration\",\n        0.998d),\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock, atMost(1))\n      .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n    double previousValue = stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN);\n    double previousDiff = Double.POSITIVE_INFINITY;\n    /* run 3 secs of animation */\n    for (int i = 0; i < 3 * 60; i++) {\n      reset(mUIImplementationMock);\n      mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n      verify(mUIImplementationMock, atMost(1))\n        .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n      double currentValue = stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN);\n      double currentDiff = currentValue - previousValue;\n      // verify monotonicity\n      // greater *or equal* because the animation stops during these 3 seconds\n      assertThat(currentValue).as(\"on frame \" + i).isGreaterThanOrEqualTo(previousValue);\n      // verify decay\n      if (i > 3) {\n        // i > 3 because that's how long it takes to settle previousDiff\n        if (i % 3 != 0) {\n          // i % 3 != 0 because every 3 frames we go a tiny\n          // bit faster, because frame length is 16.(6)ms\n          assertThat(currentDiff).as(\"on frame \" + i).isLessThanOrEqualTo(previousDiff);\n        } else {\n          assertThat(currentDiff).as(\"on frame \" + i).isGreaterThanOrEqualTo(previousDiff);\n        }\n      }\n      previousValue = currentValue;\n      previousDiff = currentDiff;\n    }\n    // should be done in 3s\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(mUIImplementationMock);\n  }\n\n  @Test\n  public void testDecayAnimationLoopsFiveTimes() {\n    createSimpleAnimatedViewWithOpacity(1000, 0d);\n\n    Callback animationCallback = mock(Callback.class);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\n        \"type\",\n        \"decay\",\n        \"velocity\",\n        0.5d,\n        \"deceleration\",\n        0.998d,\n        \"iterations\",\n        5),\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock, atMost(1))\n      .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n    double previousValue = stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN);\n    double previousDiff = Double.POSITIVE_INFINITY;\n    double initialValue = stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN);\n    boolean didComeToRest = false;\n    int numberOfResets = 0;\n    /* run 3 secs of animation, five times */\n    for (int i = 0; i < 3 * 60 * 5; i++) {\n      reset(mUIImplementationMock);\n      mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n      verify(mUIImplementationMock, atMost(1))\n        .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture());\n      double currentValue = stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN);\n      double currentDiff = currentValue - previousValue;\n      // Test to see if it reset after coming to rest (i.e. dropped back to )\n      if (didComeToRest && currentValue == initialValue) {\n        numberOfResets++;\n      }\n\n      // verify monotonicity, unless it has come to rest and reset\n      // greater *or equal* because the animation stops during these 3 seconds\n      if (!didComeToRest) assertThat(currentValue).as(\"on frame \" + i).isGreaterThanOrEqualTo(previousValue);\n\n      // Test if animation has come to rest using the 0.1 threshold from DecayAnimation.java\n      didComeToRest = Math.abs(currentDiff) < 0.1d;\n      previousValue = currentValue;\n      previousDiff = currentDiff;\n    }\n\n    // verify that value reset (looped) 4 times after finishing a full animation\n    assertThat(numberOfResets).isEqualTo(4);\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(mUIImplementationMock);\n  }\n\n  @Test\n  public void testAnimationCallbackFinish() {\n    createSimpleAnimatedViewWithOpacity(1000, 0d);\n\n    JavaOnlyArray frames = JavaOnlyArray.of(0d, 1d);\n    Callback animationCallback = mock(Callback.class);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 1d),\n      animationCallback);\n\n    ArgumentCaptor<ReadableMap> callbackResponseCaptor = ArgumentCaptor.forClass(ReadableMap.class);\n\n    reset(animationCallback);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(animationCallback);\n\n    reset(animationCallback);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(animationCallback).invoke(callbackResponseCaptor.capture());\n\n    assertThat(callbackResponseCaptor.getValue().hasKey(\"finished\")).isTrue();\n    assertThat(callbackResponseCaptor.getValue().getBoolean(\"finished\")).isTrue();\n\n    reset(animationCallback);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(animationCallback);\n  }\n\n  /**\n   * Creates a following graph of nodes:\n   * Value(1, firstValue) ----> Add(3) ---> Style(4) ---> Props(5) ---> View(viewTag)\n   *                         |\n   * Value(2, secondValue) --+\n   *\n   * Add(3) node maps to a \"translateX\" attribute of the Style(4) node.\n   */\n  private void createAnimatedGraphWithAdditionNode(\n      int viewTag,\n      double firstValue,\n      double secondValue) {\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      1,\n      JavaOnlyMap.of(\"type\", \"value\", \"value\", 100d, \"offset\", 0d));\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      2,\n      JavaOnlyMap.of(\"type\", \"value\", \"value\", 1000d, \"offset\", 0d));\n\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      3,\n      JavaOnlyMap.of(\"type\", \"addition\", \"input\", JavaOnlyArray.of(1, 2)));\n\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      4,\n      JavaOnlyMap.of(\"type\", \"style\", \"style\", JavaOnlyMap.of(\"translateX\", 3)));\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      5,\n      JavaOnlyMap.of(\"type\", \"props\", \"props\", JavaOnlyMap.of(\"style\", 4)));\n    mNativeAnimatedNodesManager.connectAnimatedNodes(1, 3);\n    mNativeAnimatedNodesManager.connectAnimatedNodes(2, 3);\n    mNativeAnimatedNodesManager.connectAnimatedNodes(3, 4);\n    mNativeAnimatedNodesManager.connectAnimatedNodes(4, 5);\n    mNativeAnimatedNodesManager.connectAnimatedNodeToView(5, 50);\n  }\n\n  @Test\n  public void testAdditionNode() {\n    createAnimatedGraphWithAdditionNode(50, 100d, 1000d);\n\n    Callback animationCallback = mock(Callback.class);\n    JavaOnlyArray frames = JavaOnlyArray.of(0d, 1d);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 101d),\n      animationCallback);\n\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      2,\n      2,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 1010d),\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN)).isEqualTo(1100d);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock)\n      .synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN)).isEqualTo(1100d);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock)\n      .synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN)).isEqualTo(1111d);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(mUIImplementationMock);\n  }\n\n  /**\n   * Verifies that {@link NativeAnimatedNodesManager#runUpdates} updates the view correctly in case\n   * when one of the addition input nodes has started animating while the other one has not.\n   *\n   * We expect that the output of the addition node will take the starting value of the second input\n   * node even though the node hasn't been connected to an active animation driver.\n   */\n  @Test\n  public void testViewReceiveUpdatesIfOneOfAnimationHasntStarted() {\n    createAnimatedGraphWithAdditionNode(50, 100d, 1000d);\n\n    // Start animating only the first addition input node\n    Callback animationCallback = mock(Callback.class);\n    JavaOnlyArray frames = JavaOnlyArray.of(0d, 1d);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 101d),\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN)).isEqualTo(1100d);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock)\n      .synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN)).isEqualTo(1100d);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock)\n      .synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN)).isEqualTo(1101d);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(mUIImplementationMock);\n  }\n\n  /**\n   * Verifies that {@link NativeAnimatedNodesManager#runUpdates} updates the view correctly in case\n   * when one of the addition input nodes animation finishes before the other.\n   *\n   * We expect that the output of the addition node after one of the animation has finished will\n   * take the last value of the animated node and the view will receive updates up until the second\n   * animation is over.\n   */\n  @Test\n  public void testViewReceiveUpdatesWhenOneOfAnimationHasFinished() {\n    createAnimatedGraphWithAdditionNode(50, 100d, 1000d);\n\n    Callback animationCallback = mock(Callback.class);\n\n    // Start animating for the first addition input node, will have 2 frames only\n    JavaOnlyArray firstFrames = JavaOnlyArray.of(0d, 1d);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", firstFrames, \"toValue\", 200d),\n      animationCallback);\n\n    // Start animating for the first addition input node, will have 6 frames\n    JavaOnlyArray secondFrames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      2,\n      2,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", secondFrames, \"toValue\", 1010d),\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN)).isEqualTo(1100d);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN)).isEqualTo(1100d);\n\n    for (int i = 1; i < secondFrames.size(); i++) {\n      reset(mUIImplementationMock);\n      mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n      verify(mUIImplementationMock)\n        .synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n      assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN))\n        .isEqualTo(1200d + secondFrames.getDouble(i) * 10d);\n    }\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(mUIImplementationMock);\n  }\n\n  @Test\n  public void testMultiplicationNode() {\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      1,\n      JavaOnlyMap.of(\"type\", \"value\", \"value\", 1d, \"offset\", 0d));\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      2,\n      JavaOnlyMap.of(\"type\", \"value\", \"value\", 5d, \"offset\", 0d));\n\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      3,\n      JavaOnlyMap.of(\"type\", \"multiplication\", \"input\", JavaOnlyArray.of(1, 2)));\n\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      4,\n      JavaOnlyMap.of(\"type\", \"style\", \"style\", JavaOnlyMap.of(\"translateX\", 3)));\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      5,\n      JavaOnlyMap.of(\"type\", \"props\", \"props\", JavaOnlyMap.of(\"style\", 4)));\n    mNativeAnimatedNodesManager.connectAnimatedNodes(1, 3);\n    mNativeAnimatedNodesManager.connectAnimatedNodes(2, 3);\n    mNativeAnimatedNodesManager.connectAnimatedNodes(3, 4);\n    mNativeAnimatedNodesManager.connectAnimatedNodes(4, 5);\n    mNativeAnimatedNodesManager.connectAnimatedNodeToView(5, 50);\n\n    Callback animationCallback = mock(Callback.class);\n    JavaOnlyArray frames = JavaOnlyArray.of(0d, 1d);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 2d),\n      animationCallback);\n\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      2,\n      2,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 10d),\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN)).isEqualTo(5d);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN)).isEqualTo(5d);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"translateX\", Double.NaN)).isEqualTo(20d);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(mUIImplementationMock);\n  }\n\n  /**\n   * This test verifies that when {@link NativeAnimatedModule#stopAnimation} is called the animation\n   * will no longer be updating the nodes it has been previously attached to and that the animation\n   * callback will be triggered with {@code {finished: false}}\n   */\n  @Test\n  public void testHandleStoppingAnimation() {\n    createSimpleAnimatedViewWithOpacity(1000, 0d);\n\n    JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1.0d);\n    Callback animationCallback = mock(Callback.class);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      404,\n      1,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 1d),\n      animationCallback);\n\n    ArgumentCaptor<ReadableMap> callbackResponseCaptor = ArgumentCaptor.forClass(ReadableMap.class);\n\n    reset(animationCallback);\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock, times(2))\n      .synchronouslyUpdateViewOnUIThread(anyInt(), any(ReactStylesDiffMap.class));\n    verifyNoMoreInteractions(animationCallback);\n\n    reset(animationCallback);\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.stopAnimation(404);\n    verify(animationCallback).invoke(callbackResponseCaptor.capture());\n    verifyNoMoreInteractions(animationCallback);\n    verifyNoMoreInteractions(mUIImplementationMock);\n\n    assertThat(callbackResponseCaptor.getValue().hasKey(\"finished\")).isTrue();\n    assertThat(callbackResponseCaptor.getValue().getBoolean(\"finished\")).isFalse();\n\n    reset(animationCallback);\n    reset(mUIImplementationMock);\n    // Run \"update\" loop a few more times -> we expect no further updates nor callback calls to be\n    // triggered\n    for (int i = 0; i < 5; i++) {\n      mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    }\n\n    verifyNoMoreInteractions(mUIImplementationMock);\n    verifyNoMoreInteractions(animationCallback);\n  }\n\n  @Test\n  public void testInterpolationNode() {\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      1,\n      JavaOnlyMap.of(\"type\", \"value\", \"value\", 10d, \"offset\", 0d));\n\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      2,\n      JavaOnlyMap.of(\n        \"type\",\n        \"interpolation\",\n        \"inputRange\",\n        JavaOnlyArray.of(10d, 20d),\n        \"outputRange\",\n        JavaOnlyArray.of(0d, 1d),\n        \"extrapolateLeft\",\n        \"extend\",\n        \"extrapolateRight\",\n        \"extend\"));\n\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      3,\n      JavaOnlyMap.of(\"type\", \"style\", \"style\", JavaOnlyMap.of(\"opacity\", 2)));\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      4,\n      JavaOnlyMap.of(\"type\", \"props\", \"props\", JavaOnlyMap.of(\"style\", 3)));\n    mNativeAnimatedNodesManager.connectAnimatedNodes(1, 2);\n    mNativeAnimatedNodesManager.connectAnimatedNodes(2, 3);\n    mNativeAnimatedNodesManager.connectAnimatedNodes(3, 4);\n    mNativeAnimatedNodesManager.connectAnimatedNodeToView(4, 50);\n\n    Callback animationCallback = mock(Callback.class);\n    JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 20d),\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN)).isEqualTo(0d);\n\n    for (int i = 0; i < frames.size(); i++) {\n      reset(mUIImplementationMock);\n      mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n      verify(mUIImplementationMock)\n        .synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());\n      assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN))\n        .isEqualTo(frames.getDouble(i));\n    }\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verifyNoMoreInteractions(mUIImplementationMock);\n  }\n\n  private Event createScrollEvent(final int tag, final double value) {\n    return new Event(tag) {\n      @Override\n      public String getEventName() {\n        return \"topScroll\";\n      }\n\n      @Override\n      public void dispatch(RCTEventEmitter rctEventEmitter) {\n        rctEventEmitter.receiveEvent(tag, \"topScroll\", JavaOnlyMap.of(\n          \"contentOffset\", JavaOnlyMap.of(\"y\", value)));\n      }\n    };\n  }\n\n  @Test\n  public void testNativeAnimatedEventDoUpdate() {\n    int viewTag = 1000;\n\n    createSimpleAnimatedViewWithOpacity(viewTag, 0d);\n\n    mNativeAnimatedNodesManager.addAnimatedEventToView(viewTag, \"topScroll\", JavaOnlyMap.of(\n      \"animatedValueTag\", 1,\n      \"nativeEventPath\", JavaOnlyArray.of(\"contentOffset\", \"y\")));\n\n    mNativeAnimatedNodesManager.onEventDispatch(createScrollEvent(viewTag, 10));\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN)).isEqualTo(10);\n  }\n\n  @Test\n  public void testNativeAnimatedEventDoNotUpdate() {\n    int viewTag = 1000;\n\n    createSimpleAnimatedViewWithOpacity(viewTag, 0d);\n\n    mNativeAnimatedNodesManager.addAnimatedEventToView(viewTag, \"otherEvent\", JavaOnlyMap.of(\n      \"animatedValueTag\", 1,\n      \"nativeEventPath\", JavaOnlyArray.of(\"contentOffset\", \"y\")));\n\n    mNativeAnimatedNodesManager.addAnimatedEventToView(999, \"topScroll\", JavaOnlyMap.of(\n      \"animatedValueTag\", 1,\n      \"nativeEventPath\", JavaOnlyArray.of(\"contentOffset\", \"y\")));\n\n    mNativeAnimatedNodesManager.onEventDispatch(createScrollEvent(viewTag, 10));\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN)).isEqualTo(0);\n  }\n\n  @Test\n  public void testNativeAnimatedEventCustomMapping() {\n    int viewTag = 1000;\n\n    PowerMockito.when(mUIManagerMock.getConstants()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return MapBuilder.of(\"customDirectEventTypes\", MapBuilder.of(\n          \"topScroll\", MapBuilder.of(\"registrationName\", \"onScroll\")\n        ));\n      }\n    });\n    mNativeAnimatedNodesManager = new NativeAnimatedNodesManager(mUIManagerMock);\n\n    createSimpleAnimatedViewWithOpacity(viewTag, 0d);\n\n    mNativeAnimatedNodesManager.addAnimatedEventToView(viewTag, \"onScroll\", JavaOnlyMap.of(\n      \"animatedValueTag\", 1,\n      \"nativeEventPath\", JavaOnlyArray.of(\"contentOffset\", \"y\")));\n\n    mNativeAnimatedNodesManager.onEventDispatch(createScrollEvent(viewTag, 10));\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN)).isEqualTo(10);\n  }\n\n  @Test\n  public void testRestoreDefaultProps() {\n    int viewTag = 1000;\n    int propsNodeTag = 3;\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      1,\n      JavaOnlyMap.of(\"type\", \"value\", \"value\", 1d, \"offset\", 0d));\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      2,\n      JavaOnlyMap.of(\"type\", \"style\", \"style\", JavaOnlyMap.of(\"opacity\", 1)));\n    mNativeAnimatedNodesManager.createAnimatedNode(\n      propsNodeTag,\n      JavaOnlyMap.of(\"type\", \"props\", \"props\", JavaOnlyMap.of(\"style\", 2)));\n    mNativeAnimatedNodesManager.connectAnimatedNodes(1, 2);\n    mNativeAnimatedNodesManager.connectAnimatedNodes(2, propsNodeTag);\n    mNativeAnimatedNodesManager.connectAnimatedNodeToView(propsNodeTag, viewTag);\n\n    JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.5d, 1d);\n    Callback animationCallback = mock(Callback.class);\n    mNativeAnimatedNodesManager.startAnimatingNode(\n      1,\n      1,\n      JavaOnlyMap.of(\"type\", \"frames\", \"frames\", frames, \"toValue\", 0d),\n      animationCallback);\n\n    ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =\n      ArgumentCaptor.forClass(ReactStylesDiffMap.class);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN)).isEqualTo(1);\n\n    for (int i = 0; i < frames.size(); i++) {\n      reset(mUIImplementationMock);\n      mNativeAnimatedNodesManager.runUpdates(nextFrameTime());\n    }\n\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().getDouble(\"opacity\", Double.NaN)).isEqualTo(0);\n\n    reset(mUIImplementationMock);\n    mNativeAnimatedNodesManager.restoreDefaultValues(propsNodeTag, viewTag);\n    verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture());\n    assertThat(stylesCaptor.getValue().isNull(\"opacity\"));\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/bridge/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nSTANDARD_TEST_SRCS = [\n    \"*Test.java\",\n]\n\nandroid_library(\n    name = \"testhelpers\",\n    srcs = glob(\n        [\"*.java\"],\n        excludes = STANDARD_TEST_SRCS,\n    ),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/mockito:mockito\"),\n        react_native_dep(\"third-party/java/robolectric3/robolectric:robolectric\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_tests_target(\"java/org/mockito/configuration:configuration\"),\n    ],\n)\n\nrn_robolectric_test(\n    name = \"bridge\",\n    srcs = glob(STANDARD_TEST_SRCS),\n    # Please change the contact to the oncall of your team\n    contacts = [\"oncall+fbandroid_sheriff@xmail.facebook.com\"],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        \":testhelpers\",\n        react_native_dep(\"libraries/fbcore/src/test/java/com/facebook/powermock:powermock\"),\n        react_native_dep(\"libraries/soloader/java/com/facebook/soloader:soloader\"),\n        react_native_dep(\"third-party/java/fest:fest\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/junit:junit\"),\n        react_native_dep(\"third-party/java/mockito:mockito\"),\n        react_native_dep(\"third-party/java/robolectric3/robolectric:robolectric\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_tests_target(\"java/com/facebook/common/logging:logging\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport javax.inject.Provider;\nimport java.util.List;\n\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.runner.RunWith;\nimport org.junit.Test;\nimport org.mockito.Mockito;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\n\nimport com.facebook.soloader.SoLoader;\n\n/**\n * Tests for {@link BaseJavaModule} and {@link JavaModuleWrapper}\n */\n@PrepareForTest({ReadableNativeArray.class, SoLoader.class})\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\n@RunWith(RobolectricTestRunner.class)\npublic class BaseJavaModuleTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private List<JavaModuleWrapper.MethodDescriptor> mMethods;\n  private JavaModuleWrapper mWrapper;\n  private ReadableNativeArray mArguments;\n\n  @Before\n  public void setup() {\n    ModuleHolder moduleHolder = new ModuleHolder(new MethodsModule());\n    mWrapper = new JavaModuleWrapper(null, MethodsModule.class, moduleHolder);\n    mMethods = mWrapper.getMethodDescriptors();\n    PowerMockito.mockStatic(SoLoader.class);\n    mArguments = PowerMockito.mock(ReadableNativeArray.class);\n  }\n\n  private int findMethod(String mname, List<JavaModuleWrapper.MethodDescriptor> methods) {\n    int posn = -1;\n    for (int i = 0; i< methods.size(); i++) {\n      JavaModuleWrapper.MethodDescriptor md = methods.get(i);\n      if (md.name == mname) {\n        posn = i;\n        break;\n      }\n    }\n    return posn;\n  }\n\n  @Test(expected = NativeArgumentsParseException.class)\n  public void testCallMethodWithoutEnoughArgs() throws Exception {\n    int methodId = findMethod(\"regularMethod\",mMethods);\n    Mockito.stub(mArguments.size()).toReturn(1);\n    mWrapper.invoke(methodId, mArguments);\n  }\n\n  @Test\n  public void testCallMethodWithEnoughArgs() {\n    int methodId = findMethod(\"regularMethod\", mMethods);\n    Mockito.stub(mArguments.size()).toReturn(2);\n    mWrapper.invoke(methodId, mArguments);\n  }\n\n  @Test\n  public void testCallAsyncMethodWithEnoughArgs() {\n    // Promise block evaluates to 2 args needing to be passed from JS\n    int methodId = findMethod(\"asyncMethod\", mMethods);\n    Mockito.stub(mArguments.size()).toReturn(3);\n    mWrapper.invoke(methodId, mArguments);\n  }\n\n  @Test\n  public void testCallSyncMethod() {\n    int methodId = findMethod(\"syncMethod\", mMethods);\n    Mockito.stub(mArguments.size()).toReturn(2);\n    mWrapper.invoke(methodId, mArguments);\n  }\n\n  private static class MethodsModule extends BaseJavaModule {\n    @Override\n    public String getName() {\n      return \"Methods\";\n    }\n\n    @ReactMethod\n    public void regularMethod(String a, int b) {}\n\n    @ReactMethod\n    public void asyncMethod(int a, Promise p) {}\n\n    @ReactMethod(isBlockingSynchronousMethod = true)\n    public int syncMethod(int a, int b) {\n      return a + b;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/bridge/FallbackJSBundleLoaderTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport com.facebook.common.logging.FLog;\nimport com.facebook.common.logging.FakeLoggingDelegate;\nimport com.facebook.common.logging.LoggingDelegate;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\nimport static org.fest.assertions.api.Assertions.fail;\n\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.never;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\npublic class FallbackJSBundleLoaderTest {\n\n  private static final String UNRECOVERABLE;\n  static {\n    String prefix = FallbackJSBundleLoader.RECOVERABLE;\n    char first = prefix.charAt(0);\n\n    UNRECOVERABLE = prefix.replace(first, (char) (first + 1));\n  }\n\n  private FakeLoggingDelegate mLoggingDelegate;\n\n  @Before\n  public void setup() {\n    mLoggingDelegate = new FakeLoggingDelegate();\n    FLog.setLoggingDelegate(mLoggingDelegate);\n  }\n\n  @Test\n  public void firstLoaderSucceeds() {\n    JSBundleLoader delegates[] = new JSBundleLoader[] {\n      successfulLoader(\"url1\"),\n      successfulLoader(\"url2\")\n    };\n\n    FallbackJSBundleLoader fallbackLoader =\n      new FallbackJSBundleLoader(new ArrayList<>(Arrays.asList(delegates)));\n\n    assertThat(fallbackLoader.loadScript(null)).isEqualTo(\"url1\");\n\n    verify(delegates[0], times(1)).loadScript(null);\n    verify(delegates[1], never()).loadScript(null);\n\n    assertThat(mLoggingDelegate.logContains(\n        FakeLoggingDelegate.WTF,\n        FallbackJSBundleLoader.TAG,\n        null))\n      .isFalse();\n  }\n\n  @Test\n  public void fallingBackSuccessfully() {\n    JSBundleLoader delegates[] = new JSBundleLoader[] {\n      recoverableLoader(\"url1\", \"error1\"),\n      successfulLoader(\"url2\"),\n      successfulLoader(\"url3\")\n    };\n\n    FallbackJSBundleLoader fallbackLoader =\n      new FallbackJSBundleLoader(new ArrayList<>(Arrays.asList(delegates)));\n\n    assertThat(fallbackLoader.loadScript(null)).isEqualTo(\"url2\");\n\n    verify(delegates[0], times(1)).loadScript(null);\n    verify(delegates[1], times(1)).loadScript(null);\n    verify(delegates[2], never()).loadScript(null);\n\n    assertThat(mLoggingDelegate.logContains(\n        FakeLoggingDelegate.WTF,\n        FallbackJSBundleLoader.TAG,\n        recoverableMsg(\"error1\")))\n      .isTrue();\n  }\n\n  @Test\n  public void fallingbackUnsuccessfully() {\n    JSBundleLoader delegates[] = new JSBundleLoader[] {\n      recoverableLoader(\"url1\", \"error1\"),\n      recoverableLoader(\"url2\", \"error2\")\n    };\n\n    FallbackJSBundleLoader fallbackLoader =\n      new FallbackJSBundleLoader(new ArrayList<>(Arrays.asList(delegates)));\n\n    try {\n      fallbackLoader.loadScript(null);\n      fail(\"expect throw\");\n    } catch (Exception e) {\n      assertThat(e).isInstanceOf(RuntimeException.class);\n\n      Throwable cause = e.getCause();\n      ArrayList<String> msgs = new ArrayList<>();\n      while (cause != null) {\n        msgs.add(cause.getMessage());\n        cause = cause.getCause();\n      }\n\n      assertThat(msgs).containsExactly(\n        recoverableMsg(\"error1\"),\n        recoverableMsg(\"error2\"));\n    }\n\n    verify(delegates[0], times(1)).loadScript(null);\n    verify(delegates[1], times(1)).loadScript(null);\n\n    assertThat(mLoggingDelegate.logContains(\n        FakeLoggingDelegate.WTF,\n        FallbackJSBundleLoader.TAG,\n        recoverableMsg(\"error1\")))\n      .isTrue();\n\n    assertThat(mLoggingDelegate.logContains(\n        FakeLoggingDelegate.WTF,\n        FallbackJSBundleLoader.TAG,\n        recoverableMsg(\"error2\")))\n      .isTrue();\n  }\n\n  @Test\n  public void unrecoverable() {\n    JSBundleLoader delegates[] = new JSBundleLoader[] {\n      fatalLoader(\"url1\", \"error1\"),\n      recoverableLoader(\"url2\", \"error2\")\n    };\n\n    FallbackJSBundleLoader fallbackLoader =\n      new FallbackJSBundleLoader(new ArrayList(Arrays.asList(delegates)));\n\n    try {\n      fallbackLoader.loadScript(null);\n      fail(\"expect throw\");\n    } catch (Exception e) {\n      assertThat(e.getMessage()).isEqualTo(fatalMsg(\"error1\"));\n    }\n\n    verify(delegates[0], times(1)).loadScript(null);\n    verify(delegates[1], never()).loadScript(null);\n\n    assertThat(mLoggingDelegate.logContains(\n        FakeLoggingDelegate.WTF,\n        FallbackJSBundleLoader.TAG,\n        null))\n      .isFalse();\n  }\n\n  private static JSBundleLoader successfulLoader(String url) {\n    JSBundleLoader loader = mock(JSBundleLoader.class);\n    when(loader.loadScript(null)).thenReturn(url);\n\n    return loader;\n  }\n\n  private static String recoverableMsg(String errMsg) {\n    return FallbackJSBundleLoader.RECOVERABLE + errMsg;\n  }\n\n  private static JSBundleLoader recoverableLoader(String url, String errMsg) {\n    JSBundleLoader loader = mock(JSBundleLoader.class);\n    when(loader.loadScript(null))\n      .thenThrow(new RuntimeException(FallbackJSBundleLoader.RECOVERABLE + errMsg));\n\n    return loader;\n  }\n\n  private static String fatalMsg(String errMsg) {\n    return UNRECOVERABLE + errMsg;\n  }\n\n  private static JSBundleLoader fatalLoader(String url, String errMsg) {\n    JSBundleLoader loader = mock(JSBundleLoader.class);\n    when(loader.loadScript(null))\n      .thenThrow(new RuntimeException(UNRECOVERABLE + errMsg));\n\n    return loader;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/bridge/JavaOnlyArrayTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport org.junit.Test;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\n\n/**\n * Tests for {@link JavaOnlyArray}\n */\npublic class JavaOnlyArrayTest {\n\n  @Test\n  public void testGetType() throws Exception {\n    JavaOnlyArray values = JavaOnlyArray.of(\n        1,\n        2f,\n        3.,\n        \"4\",\n        false,\n        JavaOnlyArray.of(),\n        JavaOnlyMap.of(),\n        null);\n    ReadableType[] expectedTypes = new ReadableType[] {\n      ReadableType.Number,\n      ReadableType.Number,\n      ReadableType.Number,\n      ReadableType.String,\n      ReadableType.Boolean,\n      ReadableType.Array,\n      ReadableType.Map,\n      ReadableType.Null\n    };\n\n    for (int i = 0; i < values.size(); i++) {\n      assertThat(values.getType(i)).isEqualTo(expectedTypes[i]);\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/bridge/JsonWriterTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport java.io.IOException;\nimport java.io.StringWriter;\n\nimport org.junit.Test;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\n\npublic class JsonWriterTest {\n  private final StringWriter mStringWriter;\n  private final JsonWriter mWriter;\n\n  public JsonWriterTest() {\n    mStringWriter = new StringWriter();\n    mWriter = new JsonWriter(mStringWriter);\n  }\n\n  @Test\n  public void emptyObject() throws IOException {\n    mWriter.beginObject();\n    mWriter.endObject();\n    verify(\"{}\");\n  }\n\n  @Test\n  public void emptyNestedObject() throws IOException {\n    mWriter.beginObject();\n    mWriter.beginObject();\n    mWriter.endObject();\n    mWriter.endObject();\n    verify(\"{{}}\");\n  }\n\n  @Test\n  public void emptyArray() throws IOException {\n    mWriter.beginArray();\n    mWriter.endArray();\n    verify(\"[]\");\n  }\n\n  @Test\n  public void emptyNestedArray() throws IOException {\n    mWriter.beginArray();\n    mWriter.beginArray();\n    mWriter.endArray();\n    mWriter.endArray();\n    verify(\"[[]]\");\n  }\n\n  @Test\n  public void smallObject() throws IOException {\n    mWriter.beginObject();\n    mWriter.name(\"hello\").value(true);\n    mWriter.name(\"hello_again\").value(\"hi!\");\n    mWriter.endObject();\n    verify(\"{\\\"hello\\\":true,\\\"hello_again\\\":\\\"hi!\\\"}\");\n  }\n\n  @Test\n  public void smallArray() throws IOException {\n    mWriter.beginArray();\n    mWriter.value(true);\n    mWriter.value(1);\n    mWriter.value(1.0);\n    mWriter.value(\"hi!\");\n    mWriter.endArray();\n    verify(\"[true,1,1.0,\\\"hi!\\\"]\");\n  }\n\n  @Test\n  public void string() throws IOException {\n    mWriter.beginObject();\n    mWriter.name(\"string\").value(\"hello!\");\n    mWriter.endObject();\n    verify(\"{\\\"string\\\":\\\"hello!\\\"}\");\n  }\n\n  @Test\n  public void complexString() throws IOException {\n    mWriter.beginObject();\n    mWriter.name(\"string\").value(\"\\t\\uD83D\\uDCA9\");\n    mWriter.endObject();\n    verify(\"{\\\"string\\\":\\\"\\\\t\\uD83D\\uDCA9\\\"}\");\n  }\n\n  private void verify(String expected) throws IOException {\n    mWriter.close();\n    assertThat(mStringWriter.getBuffer().toString()).isEqualTo(expected);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/bridge/ModuleSpecTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.bridge;\n\nimport com.facebook.react.common.build.ReactBuildConfig;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.powermock.reflect.Whitebox;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\nimport static org.mockito.Mockito.mock;\n\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\n@SuppressStaticInitializationFor(\"com.facebook.react.common.build.ReactBuildConfig\")\n@PrepareForTest({ReactBuildConfig.class})\n@RunWith(RobolectricTestRunner.class)\npublic class ModuleSpecTest {\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  @Test(expected = IllegalArgumentException.class)\n  public void testSimpleFailFast() {\n    Whitebox.setInternalState(ReactBuildConfig.class, \"DEBUG\", true);\n    ModuleSpec.simple(ComplexModule.class, mock(ReactApplicationContext.class));\n  }\n\n  @Test(expected = IllegalArgumentException.class)\n  public void testSimpleFailFastDefault() {\n    Whitebox.setInternalState(ReactBuildConfig.class, \"DEBUG\", true);\n    ModuleSpec.simple(ComplexModule.class);\n  }\n\n  @Test\n  public void testSimpleNoFailFastRelease() {\n    Whitebox.setInternalState(ReactBuildConfig.class, \"DEBUG\", false);\n    ModuleSpec.simple(ComplexModule.class, mock(ReactApplicationContext.class));\n  }\n\n  @Test(expected = RuntimeException.class)\n  public void testSimpleFailLateRelease() {\n    Whitebox.setInternalState(ReactBuildConfig.class, \"DEBUG\", false);\n    ModuleSpec spec = ModuleSpec.simple(ComplexModule.class, mock(ReactApplicationContext.class));\n    spec.getProvider().get();\n  }\n\n  @Test\n  public void testSimpleDefaultConstructor() {\n    Whitebox.setInternalState(ReactBuildConfig.class, \"DEBUG\", true);\n    ModuleSpec spec = ModuleSpec.simple(SimpleModule.class);\n    assertThat(spec.getProvider().get()).isInstanceOf(SimpleModule.class);\n  }\n\n  @Test\n  public void testSimpleContextConstructor() {\n    Whitebox.setInternalState(ReactBuildConfig.class, \"DEBUG\", true);\n    ReactApplicationContext context = mock(ReactApplicationContext.class);\n    ModuleSpec spec = ModuleSpec.simple(SimpleContextModule.class, context);\n\n    NativeModule module = spec.getProvider().get();\n    assertThat(module).isInstanceOf(SimpleContextModule.class);\n    SimpleContextModule contextModule = (SimpleContextModule) module;\n    assertThat(contextModule.getReactApplicationContext()).isSameAs(context);\n  }\n\n  public static class ComplexModule extends BaseJavaModule {\n\n    public ComplexModule(int a, int b) {\n    }\n\n    public String getName() {\n      return \"ComplexModule\";\n    }\n  }\n\n  public static class SimpleModule extends BaseJavaModule {\n\n    public String getName() {\n      return \"SimpleModule\";\n    }\n  }\n\n  public static class SimpleContextModule extends ReactContextBaseJavaModule {\n\n    public SimpleContextModule(ReactApplicationContext context) {\n      super(context);\n    }\n\n    public String getName() {\n      return \"SimpleContextModule\";\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/devsupport/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nrn_robolectric_test(\n    name = \"devsupport\",\n    srcs = glob([\"**/*.java\"]),\n    # Please change the contact to the oncall of your team\n    contacts = [\"oncall+fbandroid_sheriff@xmail.facebook.com\"],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/test/java/com/facebook/powermock:powermock\"),\n        react_native_dep(\"third-party/java/fest:fest\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/junit:junit\"),\n        react_native_dep(\"third-party/java/mockito:mockito\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_dep(\"third-party/java/robolectric3/robolectric:robolectric\"),\n        react_native_target(\"java/com/facebook/react:react\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/devsupport:devsupport\"),\n        react_native_target(\"java/com/facebook/react/devsupport:interfaces\"),\n        react_native_tests_target(\"java/com/facebook/react/bridge:testhelpers\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/devsupport/JSDebuggerWebSocketClientTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport com.facebook.react.common.JavascriptException;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\n\nimport java.util.HashMap;\n\nimport okio.ByteString;\n\nimport static org.mockito.Mockito.*;\n\n@PrepareForTest({ JSDebuggerWebSocketClient.class })\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class JSDebuggerWebSocketClientTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  @Test\n  public void test_prepareJSRuntime_ShouldSendCorrectMessage() throws Exception {\n    final JSDebuggerWebSocketClient.JSDebuggerCallback cb =\n      PowerMockito.mock(JSDebuggerWebSocketClient.JSDebuggerCallback.class);\n\n    JSDebuggerWebSocketClient client = PowerMockito.spy(new JSDebuggerWebSocketClient());\n    client.prepareJSRuntime(cb);\n    PowerMockito.verifyPrivate(client).invoke(\"sendMessage\", 0,\n      \"{\\\"id\\\":0,\\\"method\\\":\\\"prepareJSRuntime\\\"}\");\n  }\n\n  @Test\n  public void test_loadApplicationScript_ShouldSendCorrectMessage() throws Exception {\n    final JSDebuggerWebSocketClient.JSDebuggerCallback cb =\n      PowerMockito.mock(JSDebuggerWebSocketClient.JSDebuggerCallback.class);\n\n    JSDebuggerWebSocketClient client = PowerMockito.spy(new JSDebuggerWebSocketClient());\n    HashMap<String, String> injectedObjects = new HashMap<>();\n    injectedObjects.put(\"key1\", \"value1\");\n    injectedObjects.put(\"key2\", \"value2\");\n\n    client.loadApplicationScript(\"http://localhost:8080/index.js\", injectedObjects, cb);\n    PowerMockito.verifyPrivate(client).invoke(\"sendMessage\", 0,\n      \"{\\\"id\\\":0,\\\"method\\\":\\\"executeApplicationScript\\\",\\\"url\\\":\\\"http://localhost:8080/index.js\\\"\" +\n      \",\\\"inject\\\":{\\\"key1\\\":\\\"value1\\\",\\\"key2\\\":\\\"value2\\\"}}\");\n  }\n\n  @Test\n  public void test_executeJSCall_ShouldSendCorrectMessage() throws Exception {\n    final JSDebuggerWebSocketClient.JSDebuggerCallback cb =\n      PowerMockito.mock(JSDebuggerWebSocketClient.JSDebuggerCallback.class);\n\n    JSDebuggerWebSocketClient client = PowerMockito.spy(new JSDebuggerWebSocketClient());\n\n    client.executeJSCall(\"foo\", \"[1,2,3]\", cb);\n    PowerMockito.verifyPrivate(client).invoke(\"sendMessage\", 0,\n      \"{\\\"id\\\":0,\\\"method\\\":\\\"foo\\\",\\\"arguments\\\":[1,2,3]}\");\n  }\n\n  @Test\n  public void test_onMessage_WithInvalidContentType_ShouldNotTriggerCallbacks() throws Exception {\n    JSDebuggerWebSocketClient client = PowerMockito.spy(new JSDebuggerWebSocketClient());\n\n    client.onMessage(null, ByteString.encodeUtf8(\"{\\\"replyID\\\":0, \\\"result\\\":\\\"OK\\\"}\"));\n    PowerMockito.verifyPrivate(client, never()).invoke(\"triggerRequestSuccess\", anyInt(), anyString());\n    PowerMockito.verifyPrivate(client, never()).invoke(\"triggerRequestFailure\", anyInt(), any());\n  }\n\n  @Test\n  public void test_onMessage_WithoutReplyId_ShouldNotTriggerCallbacks() throws Exception {\n    JSDebuggerWebSocketClient client = PowerMockito.spy(new JSDebuggerWebSocketClient());\n\n    client.onMessage(null, \"{\\\"result\\\":\\\"OK\\\"}\");\n    PowerMockito.verifyPrivate(client, never()).invoke(\"triggerRequestSuccess\", anyInt(), anyString());\n    PowerMockito.verifyPrivate(client, never()).invoke(\"triggerRequestFailure\", anyInt(), any());\n  }\n\n  @Test\n  public void test_onMessage_With_Null_ReplyId_ShouldNotTriggerCallbacks() throws Exception {\n    JSDebuggerWebSocketClient client = PowerMockito.spy(new JSDebuggerWebSocketClient());\n\n    client.onMessage(null, \"{\\\"replyID\\\":null, \\\"result\\\":\\\"OK\\\"}\");\n    PowerMockito.verifyPrivate(client, never()).invoke(\"triggerRequestSuccess\", anyInt(), anyString());\n    PowerMockito.verifyPrivate(client, never()).invoke(\"triggerRequestFailure\", anyInt(), any());\n  }\n\n  @Test\n  public void test_onMessage_WithResult_ShouldTriggerRequestSuccess() throws Exception {\n    JSDebuggerWebSocketClient client = PowerMockito.spy(new JSDebuggerWebSocketClient());\n\n    client.onMessage(null, \"{\\\"replyID\\\":0, \\\"result\\\":\\\"OK\\\"}\");\n    PowerMockito.verifyPrivate(client).invoke(\"triggerRequestSuccess\", 0, \"OK\");\n    PowerMockito.verifyPrivate(client, never()).invoke(\"triggerRequestFailure\", anyInt(), any());\n  }\n\n  @Test\n  public void test_onMessage_With_Null_Result_ShouldTriggerRequestSuccess() throws Exception {\n    JSDebuggerWebSocketClient client = PowerMockito.spy(new JSDebuggerWebSocketClient());\n\n    client.onMessage(null, \"{\\\"replyID\\\":0, \\\"result\\\":null}\");\n    PowerMockito.verifyPrivate(client).invoke(\"triggerRequestSuccess\", 0, null);\n    PowerMockito.verifyPrivate(client, never()).invoke(\"triggerRequestFailure\", anyInt(), any());\n  }\n\n  @Test\n  public void test_onMessage_WithError_ShouldCallAbort() throws Exception {\n    JSDebuggerWebSocketClient client = PowerMockito.spy(new JSDebuggerWebSocketClient());\n\n    client.onMessage(null, \"{\\\"replyID\\\":0, \\\"error\\\":\\\"BOOM\\\"}\");\n    PowerMockito.verifyPrivate(client).invoke(\"abort\", eq(\"BOOM\"), isA(JavascriptException.class));\n  }\n\n  @Test\n  public void test_onMessage_With_Null_Error_ShouldTriggerRequestSuccess() throws Exception {\n    JSDebuggerWebSocketClient client = PowerMockito.spy(new JSDebuggerWebSocketClient());\n\n    client.onMessage(null, \"{\\\"replyID\\\":0, \\\"error\\\":null}\");\n    PowerMockito.verifyPrivate(client).invoke(\"triggerRequestSuccess\", anyInt(), anyString());\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.robolectric.RobolectricTestRunner;\n\nimport java.io.IOException;\nimport java.util.Map;\n\nimport okio.Buffer;\nimport okio.ByteString;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\n\n@RunWith(RobolectricTestRunner.class)\npublic class MultipartStreamReaderTest {\n\n  class CallCountTrackingChunkCallback implements MultipartStreamReader.ChunkCallback {\n    private int mCount = 0;\n\n    @Override\n    public void execute(Map<String, String> headers, Buffer body, boolean done) throws IOException {\n      mCount++;\n    }\n\n    public int getCallCount() {\n      return mCount;\n    }\n  }\n\n  @Test\n  public void testSimpleCase() throws IOException {\n    ByteString response = ByteString.encodeUtf8(\n      \"preable, should be ignored\\r\\n\" +\n      \"--sample_boundary\\r\\n\" +\n      \"Content-Type: application/json; charset=utf-8\\r\\n\" +\n      \"Content-Length: 2\\r\\n\\r\\n\" +\n      \"{}\\r\\n\" +\n      \"--sample_boundary--\\r\\n\" +\n      \"epilogue, should be ignored\");\n\n    Buffer source = new Buffer();\n    source.write(response);\n\n    MultipartStreamReader reader = new MultipartStreamReader(source, \"sample_boundary\");\n\n    CallCountTrackingChunkCallback callback = new CallCountTrackingChunkCallback() {\n      @Override\n      public void execute(Map<String, String> headers, Buffer body, boolean done) throws IOException {\n        super.execute(headers, body, done);\n\n        assertThat(done).isTrue();\n        assertThat(headers.get(\"Content-Type\")).isEqualTo(\"application/json; charset=utf-8\");\n        assertThat(body.readUtf8()).isEqualTo(\"{}\");\n      }\n    };\n    boolean success = reader.readAllParts(callback);\n\n    assertThat(callback.getCallCount()).isEqualTo(1);\n    assertThat(success).isTrue();\n  }\n\n  @Test\n  public void testMultipleParts() throws IOException {\n    ByteString response = ByteString.encodeUtf8(\n      \"preable, should be ignored\\r\\n\" +\n      \"--sample_boundary\\r\\n\" +\n      \"1\\r\\n\" +\n      \"--sample_boundary\\r\\n\" +\n      \"2\\r\\n\" +\n      \"--sample_boundary\\r\\n\" +\n      \"3\\r\\n\" +\n      \"--sample_boundary--\\r\\n\" +\n      \"epilogue, should be ignored\");\n\n    Buffer source = new Buffer();\n    source.write(response);\n\n    MultipartStreamReader reader = new MultipartStreamReader(source, \"sample_boundary\");\n\n    CallCountTrackingChunkCallback callback = new CallCountTrackingChunkCallback() {\n      @Override\n      public void execute(Map<String, String> headers, Buffer body, boolean done) throws IOException {\n        super.execute(headers, body, done);\n\n        assertThat(done).isEqualTo(getCallCount() == 3);\n        assertThat(body.readUtf8()).isEqualTo(String.valueOf(getCallCount()));\n      }\n    };\n    boolean success = reader.readAllParts(callback);\n\n    assertThat(callback.getCallCount()).isEqualTo(3);\n    assertThat(success).isTrue();\n  }\n\n  @Test\n  public void testNoDelimiter() throws IOException {\n    ByteString response = ByteString.encodeUtf8(\"Yolo\");\n\n    Buffer source = new Buffer();\n    source.write(response);\n\n    MultipartStreamReader reader = new MultipartStreamReader(source, \"sample_boundary\");\n\n    CallCountTrackingChunkCallback callback = new CallCountTrackingChunkCallback();\n    boolean success = reader.readAllParts(callback);\n\n    assertThat(callback.getCallCount()).isEqualTo(0);\n    assertThat(success).isFalse();\n  }\n\n  @Test\n  public void testNoCloseDelimiter() throws IOException {\n    ByteString response = ByteString.encodeUtf8(\n      \"preable, should be ignored\\r\\n\" +\n      \"--sample_boundary\\r\\n\" +\n      \"Content-Type: application/json; charset=utf-8\\r\\n\" +\n      \"Content-Length: 2\\r\\n\\r\\n\" +\n      \"{}\\r\\n\" +\n      \"--sample_boundary\\r\\n\" +\n      \"incomplete message...\");\n\n    Buffer source = new Buffer();\n    source.write(response);\n\n    MultipartStreamReader reader = new MultipartStreamReader(source, \"sample_boundary\");\n\n    CallCountTrackingChunkCallback callback = new CallCountTrackingChunkCallback();\n    boolean success = reader.readAllParts(callback);\n\n    assertThat(callback.getCallCount()).isEqualTo(1);\n    assertThat(success).isFalse();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/devsupport/StackTraceHelperTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.devsupport;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\n\nimport com.facebook.react.devsupport.interfaces.StackFrame;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.robolectric.RobolectricTestRunner;\n\n@RunWith(RobolectricTestRunner.class)\npublic class StackTraceHelperTest {\n\n  @Test\n  public void testParseStackFrameWithMethod() {\n    final StackFrame frame = StackTraceHelper.convertJsStackTrace(\n        \"render@Test.bundle:1:2000\")[0];\n    assertThat(frame.getMethod()).isEqualTo(\"render\");\n    assertThat(frame.getFileName()).isEqualTo(\"Test.bundle\");\n    assertThat(frame.getLine()).isEqualTo(1);\n    assertThat(frame.getColumn()).isEqualTo(2000);\n  }\n\n  @Test\n  public void testParseStackFrameWithoutMethod() {\n    final StackFrame frame = StackTraceHelper.convertJsStackTrace(\n        \"Test.bundle:1:2000\")[0];\n    assertThat(frame.getMethod()).isEqualTo(\"(unknown)\");\n    assertThat(frame.getFileName()).isEqualTo(\"Test.bundle\");\n    assertThat(frame.getLine()).isEqualTo(1);\n    assertThat(frame.getColumn()).isEqualTo(2000);\n  }\n\n  @Test\n  public void testParseStackFrameWithInvalidFrame() {\n    final StackFrame frame = StackTraceHelper.convertJsStackTrace(\"Test.bundle:ten:twenty\")[0];\n    assertThat(frame.getMethod()).isEqualTo(\"Test.bundle:ten:twenty\");\n    assertThat(frame.getFileName()).isEqualTo(\"\");\n    assertThat(frame.getLine()).isEqualTo(-1);\n    assertThat(frame.getColumn()).isEqualTo(-1);\n  }\n\n  @Test\n  public void testParseStackFrameWithNativeCodeFrame() {\n    final StackFrame frame = StackTraceHelper.convertJsStackTrace(\"forEach@[native code]\")[0];\n    assertThat(frame.getMethod()).isEqualTo(\"forEach@[native code]\");\n    assertThat(frame.getFileName()).isEqualTo(\"\");\n    assertThat(frame.getLine()).isEqualTo(-1);\n    assertThat(frame.getColumn()).isEqualTo(-1);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/modules/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nrn_robolectric_test(\n    name = \"modules\",\n    srcs = glob([\"**/*.java\"]),\n    # Please change the contact to the oncall of your team\n    contacts = [\"oncall+fbandroid_sheriff@xmail.facebook.com\"],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"libraries/fbcore/src/test/java/com/facebook/powermock:powermock\"),\n        react_native_dep(\"third-party/android/support/v4:lib-support-v4\"),\n        react_native_dep(\"third-party/java/fest:fest\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/junit:junit\"),\n        react_native_dep(\"third-party/java/mockito:mockito\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_dep(\"third-party/java/robolectric3/robolectric:robolectric\"),\n        react_native_target(\"java/com/facebook/react:react\"),\n        react_native_target(\"java/com/facebook/react/animation:animation\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/common/network:network\"),\n        react_native_target(\"java/com/facebook/react/devsupport:interfaces\"),\n        react_native_target(\"java/com/facebook/react/jstasks:jstasks\"),\n        react_native_target(\"java/com/facebook/react/modules/camera:camera\"),\n        react_native_target(\"java/com/facebook/react/modules/clipboard:clipboard\"),\n        react_native_target(\"java/com/facebook/react/modules/common:common\"),\n        react_native_target(\"java/com/facebook/react/modules/core:core\"),\n        react_native_target(\"java/com/facebook/react/modules/debug:debug\"),\n        react_native_target(\"java/com/facebook/react/modules/dialog:dialog\"),\n        react_native_target(\"java/com/facebook/react/modules/network:network\"),\n        react_native_target(\"java/com/facebook/react/modules/share:share\"),\n        react_native_target(\"java/com/facebook/react/modules/storage:storage\"),\n        react_native_target(\"java/com/facebook/react/modules/systeminfo:systeminfo\"),\n        react_native_target(\"java/com/facebook/react/touch:touch\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_tests_target(\"java/com/facebook/react/bridge:testhelpers\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/modules/camera/ImageStoreManagerTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\npackage com.facebook.react.modules.camera;\n\nimport android.util.Base64;\nimport android.util.Base64InputStream;\n\nimport com.facebook.react.bridge.ReactApplicationContext;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.robolectric.RobolectricTestRunner;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Random;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertFalse;\nimport static org.mockito.Mockito.mock;\n\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class ImageStoreManagerTest {\n\n  @Test\n  public void itDoesNotAddLineBreaks_whenBasicStringProvided() throws IOException {\n    byte[] exampleString = \"test\".getBytes();\n    assertEquals(\"dGVzdA==\", invokeConversion(new ByteArrayInputStream(exampleString)));\n  }\n\n  @Test\n  public void itDoesNotAddLineBreaks_whenEmptyStringProvided() throws IOException {\n    byte[] exampleString = \"\".getBytes();\n    assertEquals(\"\", invokeConversion(new ByteArrayInputStream(exampleString)));\n  }\n\n  @Test\n  public void itDoesNotAddLineBreaks_whenStringWithSpecialCharsProvided() throws IOException {\n    byte[] exampleString = \"sdfsdf\\nasdfsdfsdfsd\\r\\nasdas\".getBytes();\n    ByteArrayInputStream inputStream = new ByteArrayInputStream(exampleString);\n    assertFalse(invokeConversion(inputStream).contains(\"\\n\"));\n  }\n\n  /**\n   * This test tries to test the conversion when going beyond the current buffer size (8192 bytes)\n   */\n  @Test\n  public void itDoesNotAddLineBreaks_whenStringBiggerThanBuffer() throws IOException {\n    ByteArrayInputStream inputStream = new ByteArrayInputStream(generateRandomByteString(10000));\n    assertFalse(invokeConversion(inputStream).contains(\"\\n\"));\n  }\n\n  /**\n   * Just to test if using the ByteArrayInputStream isn't missing something\n   */\n  @Test\n  public void itDoesNotAddLineBreaks_whenBase64InputStream() throws IOException {\n    byte[] exampleString = \"dGVzdA==\".getBytes();\n    Base64InputStream inputStream =\n        new Base64InputStream(new ByteArrayInputStream(exampleString), Base64.NO_WRAP);\n    assertEquals(\"dGVzdA==\", invokeConversion(inputStream));\n  }\n\n  private String invokeConversion(InputStream inputStream) throws IOException {\n    return new ImageStoreManager(mock(ReactApplicationContext.class))\n        .convertInputStreamToBase64OutputStream(inputStream);\n  }\n\n  private byte[] generateRandomByteString(final int length) {\n    Random r = new Random();\n    StringBuilder sb = new StringBuilder();\n    for (int i = 0; i < length; i++) {\n      char c = (char) (r.nextInt((int) (Character.MAX_VALUE)));\n      sb.append(c);\n    }\n    return sb.toString().getBytes();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/modules/clipboard/ClipboardModuleTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.clipboard;\n\nimport android.annotation.SuppressLint;\nimport android.content.Context;\nimport android.text.ClipboardManager;\n\nimport com.facebook.react.bridge.ReactTestHelper;\nimport com.facebook.react.modules.clipboard.ClipboardModule;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.robolectric.Robolectric;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\n\nimport static org.junit.Assert.assertTrue;\nimport static org.junit.Assert.assertFalse;\n\n@SuppressLint({\"ClipboardManager\", \"DeprecatedClass\"})\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class ClipboardModuleTest {\n\n  private static final String TEST_CONTENT = \"test\";\n\n  private ClipboardModule mClipboardModule;\n  private ClipboardManager mClipboardManager;\n\n  @Before\n  public void setUp() {\n    mClipboardModule = new ClipboardModule(RuntimeEnvironment.application);\n    mClipboardManager =\n        (ClipboardManager) RuntimeEnvironment.application.getSystemService(Context.CLIPBOARD_SERVICE);\n  }\n\n  @Test\n  public void testSetString() {\n    mClipboardModule.setString(TEST_CONTENT);\n    assertTrue(mClipboardManager.getText().equals(TEST_CONTENT));\n\n    mClipboardModule.setString(null);\n    assertFalse(mClipboardManager.hasText());\n\n    mClipboardModule.setString(\"\");\n    assertFalse(mClipboardManager.hasText());\n\n    mClipboardModule.setString(\" \");\n    assertTrue(mClipboardManager.hasText());\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.dialog;\n\nimport android.app.AlertDialog;\nimport android.content.DialogInterface;\nimport android.app.Activity;\n\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.JavaOnlyMap;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.robolectric.Robolectric;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.util.ActivityController;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertNotNull;\n\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class DialogModuleTest {\n\n  private ActivityController<Activity> mActivityController;\n  private Activity mActivity;\n  private DialogModule mDialogModule;\n\n  final static class SimpleCallback implements Callback {\n    private Object[] mArgs;\n    private int mCalls;\n\n    @Override\n    public void invoke(Object... args) {\n      mCalls++;\n      mArgs = args;\n    }\n\n    public int getCalls() {\n      return mCalls;\n    }\n\n    public Object[] getArgs() {\n      return mArgs;\n    }\n  }\n\n  @Before\n  public void setUp() throws Exception {\n    mActivityController = Robolectric.buildActivity(Activity.class);\n    mActivity = mActivityController\n        .create()\n        .start()\n        .resume()\n        .get();\n\n    final ReactApplicationContext context = PowerMockito.mock(ReactApplicationContext.class);\n    PowerMockito.when(context.hasActiveCatalystInstance()).thenReturn(true);\n    PowerMockito.when(context, \"getCurrentActivity\").thenReturn(mActivity);\n\n    mDialogModule = new DialogModule(context);\n    mDialogModule.onHostResume();\n  }\n\n  @After\n  public void tearDown() {\n    mActivityController.pause().stop().destroy();\n\n    mActivityController = null;\n    mDialogModule = null;\n  }\n\n  @Test\n  public void testAllOptions() {\n    final JavaOnlyMap options = new JavaOnlyMap();\n    options.putString(\"title\", \"Title\");\n    options.putString(\"message\", \"Message\");\n    options.putString(\"buttonPositive\", \"OK\");\n    options.putString(\"buttonNegative\", \"Cancel\");\n    options.putString(\"buttonNeutral\", \"Later\");\n    options.putBoolean(\"cancelable\", false);\n\n    mDialogModule.showAlert(options, null, null);\n\n    final AlertFragment fragment = getFragment();\n    assertNotNull(\"Fragment was not displayed\", fragment);\n    assertEquals(false, fragment.isCancelable());\n\n    final AlertDialog dialog = (AlertDialog) fragment.getDialog();\n    assertEquals(\"OK\", dialog.getButton(DialogInterface.BUTTON_POSITIVE).getText().toString());\n    assertEquals(\"Cancel\", dialog.getButton(DialogInterface.BUTTON_NEGATIVE).getText().toString());\n    assertEquals(\"Later\", dialog.getButton(DialogInterface.BUTTON_NEUTRAL).getText().toString());\n  }\n\n  @Test\n  public void testCallbackPositive() {\n    final JavaOnlyMap options = new JavaOnlyMap();\n    options.putString(\"buttonPositive\", \"OK\");\n\n    final SimpleCallback actionCallback = new SimpleCallback();\n    mDialogModule.showAlert(options, null, actionCallback);\n\n    final AlertDialog dialog = (AlertDialog) getFragment().getDialog();\n    dialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick();\n\n    assertEquals(1, actionCallback.getCalls());\n    assertEquals(DialogModule.ACTION_BUTTON_CLICKED, actionCallback.getArgs()[0]);\n    assertEquals(DialogInterface.BUTTON_POSITIVE, actionCallback.getArgs()[1]);\n  }\n\n  @Test\n  public void testCallbackNegative() {\n    final JavaOnlyMap options = new JavaOnlyMap();\n    options.putString(\"buttonNegative\", \"Cancel\");\n\n    final SimpleCallback actionCallback = new SimpleCallback();\n    mDialogModule.showAlert(options, null, actionCallback);\n\n    final AlertDialog dialog = (AlertDialog) getFragment().getDialog();\n    dialog.getButton(DialogInterface.BUTTON_NEGATIVE).performClick();\n\n    assertEquals(1, actionCallback.getCalls());\n    assertEquals(DialogModule.ACTION_BUTTON_CLICKED, actionCallback.getArgs()[0]);\n    assertEquals(DialogInterface.BUTTON_NEGATIVE, actionCallback.getArgs()[1]);\n  }\n\n  @Test\n  public void testCallbackNeutral() {\n    final JavaOnlyMap options = new JavaOnlyMap();\n    options.putString(\"buttonNeutral\", \"Later\");\n\n    final SimpleCallback actionCallback = new SimpleCallback();\n    mDialogModule.showAlert(options, null, actionCallback);\n\n    final AlertDialog dialog = (AlertDialog) getFragment().getDialog();\n    dialog.getButton(DialogInterface.BUTTON_NEUTRAL).performClick();\n\n    assertEquals(1, actionCallback.getCalls());\n    assertEquals(DialogModule.ACTION_BUTTON_CLICKED, actionCallback.getArgs()[0]);\n    assertEquals(DialogInterface.BUTTON_NEUTRAL, actionCallback.getArgs()[1]);\n  }\n\n  @Test\n  public void testCallbackDismiss() {\n    final JavaOnlyMap options = new JavaOnlyMap();\n\n    final SimpleCallback actionCallback = new SimpleCallback();\n    mDialogModule.showAlert(options, null, actionCallback);\n\n    getFragment().getDialog().dismiss();\n\n    assertEquals(1, actionCallback.getCalls());\n    assertEquals(DialogModule.ACTION_DISMISSED, actionCallback.getArgs()[0]);\n  }\n\n  private AlertFragment getFragment() {\n    return (AlertFragment) mActivity.getFragmentManager()\n        .findFragmentByTag(DialogModule.FRAGMENT_TAG);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkingModuleTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.network;\n\nimport java.io.InputStream;\nimport java.util.Arrays;\nimport java.util.List;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.JavaOnlyArray;\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContext;\nimport com.facebook.react.bridge.WritableArray;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.common.network.OkHttpCallUtil;\nimport com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;\n\nimport okhttp3.Call;\nimport okhttp3.Headers;\nimport okhttp3.MediaType;\nimport okhttp3.MultipartBody;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okio.Buffer;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.ArgumentCaptor;\nimport org.mockito.Mockito;\nimport org.mockito.invocation.InvocationOnMock;\nimport org.mockito.stubbing.Answer;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\nimport static org.mockito.Mockito.any;\nimport static org.mockito.Mockito.eq;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\n/**\n * Tests for {@link NetworkingModule}.\n */\n@PrepareForTest({\n    Arguments.class,\n    Call.class,\n    RequestBodyUtil.class,\n    ProgressRequestBody.class,\n    ProgressListener.class,\n    MultipartBody.class,\n    MultipartBody.Builder.class,\n    NetworkingModule.class,\n    OkHttpClient.class,\n    OkHttpClient.Builder.class,\n    OkHttpCallUtil.class})\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class NetworkingModuleTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  @Test\n  public void testGetWithoutHeaders() throws Exception {\n    OkHttpClient httpClient = mock(OkHttpClient.class);\n    when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        Call callMock = mock(Call.class);\n        return callMock;\n      }\n    });\n    OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);\n    when(clientBuilder.build()).thenReturn(httpClient);\n    when(httpClient.newBuilder()).thenReturn(clientBuilder);\n    NetworkingModule networkingModule =\n      new NetworkingModule(mock(ReactApplicationContext.class), \"\", httpClient);\n\n    networkingModule.sendRequest(\n      \"GET\",\n      \"http://somedomain/foo\",\n      /* requestId */ 0,\n      /* headers */ JavaOnlyArray.of(),\n      /* body */ null,\n      /* responseType */ \"text\",\n      /* useIncrementalUpdates*/ true,\n      /* timeout */ 0,\n      /* withCredentials */ false);\n\n    ArgumentCaptor<Request> argumentCaptor = ArgumentCaptor.forClass(Request.class);\n    verify(httpClient).newCall(argumentCaptor.capture());\n    assertThat(argumentCaptor.getValue().url().toString()).isEqualTo(\"http://somedomain/foo\");\n    // We set the User-Agent header by default\n    assertThat(argumentCaptor.getValue().headers().size()).isEqualTo(1);\n    assertThat(argumentCaptor.getValue().method()).isEqualTo(\"GET\");\n  }\n\n  @Test\n  public void testFailGetWithInvalidHeadersStruct() throws Exception {\n    RCTDeviceEventEmitter emitter = mock(RCTDeviceEventEmitter.class);\n    ReactApplicationContext context = mock(ReactApplicationContext.class);\n    when(context.getJSModule(any(Class.class))).thenReturn(emitter);\n\n    OkHttpClient httpClient = mock(OkHttpClient.class);\n    OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);\n    when(clientBuilder.build()).thenReturn(httpClient);\n    when(httpClient.newBuilder()).thenReturn(clientBuilder);\n    NetworkingModule networkingModule = new NetworkingModule(context, \"\", httpClient);\n\n    List<JavaOnlyArray> invalidHeaders = Arrays.asList(JavaOnlyArray.of(\"foo\"));\n\n    mockEvents();\n\n    networkingModule.sendRequest(\n      \"GET\",\n      \"http://somedoman/foo\",\n      /* requestId */ 0,\n      /* headers */ JavaOnlyArray.from(invalidHeaders),\n      /* body */ null,\n      /* responseType */ \"text\",\n      /* useIncrementalUpdates*/ true,\n      /* timeout */ 0,\n      /* withCredentials */ false);\n\n    verifyErrorEmit(emitter, 0);\n  }\n\n  @Test\n  public void testFailPostWithoutContentType() throws Exception {\n    RCTDeviceEventEmitter emitter = mock(RCTDeviceEventEmitter.class);\n    ReactApplicationContext context = mock(ReactApplicationContext.class);\n    when(context.getJSModule(any(Class.class))).thenReturn(emitter);\n\n    OkHttpClient httpClient = mock(OkHttpClient.class);\n    OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);\n    when(clientBuilder.build()).thenReturn(httpClient);\n    when(httpClient.newBuilder()).thenReturn(clientBuilder);\n    NetworkingModule networkingModule = new NetworkingModule(context, \"\", httpClient);\n\n    JavaOnlyMap body = new JavaOnlyMap();\n    body.putString(\"string\", \"This is request body\");\n\n    mockEvents();\n\n    networkingModule.sendRequest(\n      \"POST\",\n      \"http://somedomain/bar\",\n      0,\n      JavaOnlyArray.of(),\n      body,\n      /* responseType */ \"text\",\n      /* useIncrementalUpdates*/ true,\n      /* timeout */ 0,\n      /* withCredentials */ false);\n\n    verifyErrorEmit(emitter, 0);\n  }\n\n  private static void verifyErrorEmit(RCTDeviceEventEmitter emitter, int requestId) {\n    ArgumentCaptor<WritableArray> captor = ArgumentCaptor.forClass(WritableArray.class);\n    verify(emitter).emit(eq(\"didCompleteNetworkResponse\"), captor.capture());\n\n    WritableArray array = captor.getValue();\n    assertThat(array.getInt(0)).isEqualTo(requestId);\n    assertThat(array.getString(1)).isNotNull();\n  }\n\n  private static void mockEvents() {\n    PowerMockito.mockStatic(Arguments.class);\n    Mockito.when(Arguments.createArray()).thenAnswer(\n        new Answer<WritableArray>() {\n          @Override\n          public WritableArray answer(InvocationOnMock invocation) throws Throwable {\n            return new JavaOnlyArray();\n          }\n        });\n\n    Mockito.when(Arguments.createMap()).thenAnswer(\n        new Answer<WritableMap>() {\n          @Override\n          public WritableMap answer(InvocationOnMock invocation) throws Throwable {\n            return new JavaOnlyMap();\n          }\n        });\n  }\n\n  @Test\n  public void testSuccessfulPostRequest() throws Exception {\n    OkHttpClient httpClient = mock(OkHttpClient.class);\n    when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() {\n          @Override\n          public Object answer(InvocationOnMock invocation) throws Throwable {\n            Call callMock = mock(Call.class);\n            return callMock;\n          }\n        });\n    OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);\n    when(clientBuilder.build()).thenReturn(httpClient);\n    when(httpClient.newBuilder()).thenReturn(clientBuilder);\n    NetworkingModule networkingModule =\n      new NetworkingModule(mock(ReactApplicationContext.class), \"\", httpClient);\n\n    JavaOnlyMap body = new JavaOnlyMap();\n    body.putString(\"string\", \"This is request body\");\n\n    networkingModule.sendRequest(\n      \"POST\",\n      \"http://somedomain/bar\",\n      0,\n      JavaOnlyArray.of(JavaOnlyArray.of(\"Content-Type\", \"text/plain\")),\n      body,\n      /* responseType */ \"text\",\n      /* useIncrementalUpdates*/ true,\n      /* timeout */ 0,\n      /* withCredentials */ false);\n\n    ArgumentCaptor<Request> argumentCaptor = ArgumentCaptor.forClass(Request.class);\n    verify(httpClient).newCall(argumentCaptor.capture());\n    assertThat(argumentCaptor.getValue().url().toString()).isEqualTo(\"http://somedomain/bar\");\n    assertThat(argumentCaptor.getValue().headers().size()).isEqualTo(2);\n    assertThat(argumentCaptor.getValue().method()).isEqualTo(\"POST\");\n    assertThat(argumentCaptor.getValue().body().contentType().type()).isEqualTo(\"text\");\n    assertThat(argumentCaptor.getValue().body().contentType().subtype()).isEqualTo(\"plain\");\n    Buffer contentBuffer = new Buffer();\n    argumentCaptor.getValue().body().writeTo(contentBuffer);\n    assertThat(contentBuffer.readUtf8()).isEqualTo(\"This is request body\");\n  }\n\n  @Test\n  public void testHeaders() throws Exception {\n    OkHttpClient httpClient = mock(OkHttpClient.class);\n    when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        Call callMock = mock(Call.class);\n        return callMock;\n      }\n    });\n    OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);\n    when(clientBuilder.build()).thenReturn(httpClient);\n    when(httpClient.newBuilder()).thenReturn(clientBuilder);\n    NetworkingModule networkingModule =\n      new NetworkingModule(mock(ReactApplicationContext.class), \"\", httpClient);\n\n    List<JavaOnlyArray> headers = Arrays.asList(\n        JavaOnlyArray.of(\"Accept\", \"text/plain\"),\n        JavaOnlyArray.of(\"User-Agent\", \"React test agent/1.0\"));\n\n    networkingModule.sendRequest(\n      \"GET\",\n      \"http://someurl/baz\",\n      0,\n      JavaOnlyArray.from(headers),\n      null,\n      /* responseType */ \"text\",\n      /* useIncrementalUpdates*/ true,\n      /* timeout */ 0,\n      /* withCredentials */ false);\n    ArgumentCaptor<Request> argumentCaptor = ArgumentCaptor.forClass(Request.class);\n    verify(httpClient).newCall(argumentCaptor.capture());\n    Headers requestHeaders = argumentCaptor.getValue().headers();\n    assertThat(requestHeaders.size()).isEqualTo(2);\n    assertThat(requestHeaders.get(\"Accept\")).isEqualTo(\"text/plain\");\n    assertThat(requestHeaders.get(\"User-Agent\")).isEqualTo(\"React test agent/1.0\");\n  }\n\n  @Test\n  public void testMultipartPostRequestSimple() throws Exception {\n    PowerMockito.mockStatic(RequestBodyUtil.class);\n    when(RequestBodyUtil.getFileInputStream(any(ReactContext.class), any(String.class)))\n        .thenReturn(mock(InputStream.class));\n    when(RequestBodyUtil.create(any(MediaType.class), any(InputStream.class)))\n        .thenReturn(mock(RequestBody.class));\n    when(RequestBodyUtil.createProgressRequest(any(RequestBody.class), any(ProgressListener.class)))\n        .thenCallRealMethod();\n\n    JavaOnlyMap body = new JavaOnlyMap();\n    JavaOnlyArray formData = new JavaOnlyArray();\n    JavaOnlyMap bodyPart = new JavaOnlyMap();\n    bodyPart.putString(\"string\", \"value\");\n    bodyPart.putArray(\n        \"headers\",\n        JavaOnlyArray.from(\n            Arrays.asList(\n                JavaOnlyArray.of(\"content-disposition\", \"name\"))));\n    formData.pushMap(bodyPart);\n    body.putArray(\"formData\", formData);\n\n    OkHttpClient httpClient = mock(OkHttpClient.class);\n    when(httpClient.newCall(any(Request.class))).thenAnswer(\n        new Answer<Object>() {\n          @Override\n          public Object answer(InvocationOnMock invocation) throws Throwable {\n            Call callMock = mock(Call.class);\n            return callMock;\n          }\n        });\n    OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);\n    when(clientBuilder.build()).thenReturn(httpClient);\n    when(httpClient.newBuilder()).thenReturn(clientBuilder);\n    NetworkingModule networkingModule =\n      new NetworkingModule(mock(ReactApplicationContext.class), \"\", httpClient);\n    networkingModule.sendRequest(\n      \"POST\",\n      \"http://someurl/uploadFoo\",\n      0,\n      new JavaOnlyArray(),\n      body,\n      /* responseType */ \"text\",\n      /* useIncrementalUpdates*/ true,\n      /* timeout */ 0,\n      /* withCredentials */ false);\n\n    // verify url, method, headers\n    ArgumentCaptor<Request> argumentCaptor = ArgumentCaptor.forClass(Request.class);\n    verify(httpClient).newCall(argumentCaptor.capture());\n    assertThat(argumentCaptor.getValue().url().toString()).isEqualTo(\"http://someurl/uploadFoo\");\n    assertThat(argumentCaptor.getValue().method()).isEqualTo(\"POST\");\n    assertThat(argumentCaptor.getValue().body().contentType().type()).\n        isEqualTo(MultipartBody.FORM.type());\n    assertThat(argumentCaptor.getValue().body().contentType().subtype()).\n        isEqualTo(MultipartBody.FORM.subtype());\n    Headers requestHeaders = argumentCaptor.getValue().headers();\n    assertThat(requestHeaders.size()).isEqualTo(1);\n  }\n\n  @Test\n  public void testMultipartPostRequestHeaders() throws Exception {\n    PowerMockito.mockStatic(RequestBodyUtil.class);\n    when(RequestBodyUtil.getFileInputStream(any(ReactContext.class), any(String.class)))\n        .thenReturn(mock(InputStream.class));\n    when(RequestBodyUtil.create(any(MediaType.class), any(InputStream.class)))\n        .thenReturn(mock(RequestBody.class));\n    when(RequestBodyUtil.createProgressRequest(any(RequestBody.class), any(ProgressListener.class)))\n        .thenCallRealMethod();\n\n    List<JavaOnlyArray> headers = Arrays.asList(\n            JavaOnlyArray.of(\"Accept\", \"text/plain\"),\n            JavaOnlyArray.of(\"User-Agent\", \"React test agent/1.0\"),\n            JavaOnlyArray.of(\"content-type\", \"multipart/form-data\"));\n\n    JavaOnlyMap body = new JavaOnlyMap();\n    JavaOnlyArray formData = new JavaOnlyArray();\n    JavaOnlyMap bodyPart = new JavaOnlyMap();\n    bodyPart.putString(\"string\", \"value\");\n    bodyPart.putArray(\n        \"headers\",\n        JavaOnlyArray.from(\n            Arrays.asList(\n                JavaOnlyArray.of(\"content-disposition\", \"name\"))));\n    formData.pushMap(bodyPart);\n    body.putArray(\"formData\", formData);\n\n    OkHttpClient httpClient = mock(OkHttpClient.class);\n    when(httpClient.newCall(any(Request.class))).thenAnswer(\n        new Answer<Object>() {\n          @Override\n          public Object answer(InvocationOnMock invocation) throws Throwable {\n            Call callMock = mock(Call.class);\n            return callMock;\n          }\n        });\n    OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);\n    when(clientBuilder.build()).thenReturn(httpClient);\n    when(httpClient.newBuilder()).thenReturn(clientBuilder);\n    NetworkingModule networkingModule =\n      new NetworkingModule(mock(ReactApplicationContext.class), \"\", httpClient);\n    networkingModule.sendRequest(\n      \"POST\",\n      \"http://someurl/uploadFoo\",\n      0,\n      JavaOnlyArray.from(headers),\n      body,\n      /* responseType */ \"text\",\n      /* useIncrementalUpdates*/ true,\n      /* timeout */ 0,\n      /* withCredentials */ false);\n\n    // verify url, method, headers\n    ArgumentCaptor<Request> argumentCaptor = ArgumentCaptor.forClass(Request.class);\n    verify(httpClient).newCall(argumentCaptor.capture());\n    assertThat(argumentCaptor.getValue().url().toString()).isEqualTo(\"http://someurl/uploadFoo\");\n    assertThat(argumentCaptor.getValue().method()).isEqualTo(\"POST\");\n    assertThat(argumentCaptor.getValue().body().contentType().type()).\n        isEqualTo(MultipartBody.FORM.type());\n    assertThat(argumentCaptor.getValue().body().contentType().subtype()).\n        isEqualTo(MultipartBody.FORM.subtype());\n    Headers requestHeaders = argumentCaptor.getValue().headers();\n    assertThat(requestHeaders.size()).isEqualTo(3);\n    assertThat(requestHeaders.get(\"Accept\")).isEqualTo(\"text/plain\");\n    assertThat(requestHeaders.get(\"User-Agent\")).isEqualTo(\"React test agent/1.0\");\n    assertThat(requestHeaders.get(\"content-type\")).isEqualTo(\"multipart/form-data\");\n  }\n\n  @Test\n  public void testMultipartPostRequestBody() throws Exception {\n    InputStream inputStream = mock(InputStream.class);\n    PowerMockito.mockStatic(RequestBodyUtil.class);\n    when(RequestBodyUtil.getFileInputStream(any(ReactContext.class), any(String.class)))\n        .thenReturn(inputStream);\n    when(RequestBodyUtil.create(any(MediaType.class), any(InputStream.class))).thenCallRealMethod();\n    when(RequestBodyUtil.createProgressRequest(any(RequestBody.class), any(ProgressListener.class)))\n        .thenCallRealMethod();\n    when(inputStream.available()).thenReturn(\"imageUri\".length());\n\n    final MultipartBody.Builder multipartBuilder = mock(MultipartBody.Builder.class);\n    PowerMockito.whenNew(MultipartBody.Builder.class).withNoArguments().thenReturn(multipartBuilder);\n    when(multipartBuilder.setType(any(MediaType.class))).thenAnswer(\n        new Answer<Object>() {\n          @Override\n          public Object answer(InvocationOnMock invocation) throws Throwable {\n            return multipartBuilder;\n          }\n        });\n    when(multipartBuilder.addPart(any(Headers.class), any(RequestBody.class))).thenAnswer(\n        new Answer<Object>() {\n          @Override\n          public Object answer(InvocationOnMock invocation) throws Throwable {\n            return multipartBuilder;\n          }\n        });\n    when(multipartBuilder.build()).thenAnswer(\n        new Answer<Object>() {\n          @Override\n          public Object answer(InvocationOnMock invocation) throws Throwable {\n            return mock(MultipartBody.class);\n          }\n        });\n\n    List<JavaOnlyArray> headers = Arrays.asList(\n            JavaOnlyArray.of(\"content-type\", \"multipart/form-data\"));\n\n    JavaOnlyMap body = new JavaOnlyMap();\n    JavaOnlyArray formData = new JavaOnlyArray();\n    body.putArray(\"formData\", formData);\n\n    JavaOnlyMap bodyPart = new JavaOnlyMap();\n    bodyPart.putString(\"string\", \"locale\");\n    bodyPart.putArray(\n        \"headers\",\n        JavaOnlyArray.from(\n            Arrays.asList(\n                          JavaOnlyArray.of(\"content-disposition\", \"user\"))));\n    formData.pushMap(bodyPart);\n\n    JavaOnlyMap imageBodyPart = new JavaOnlyMap();\n    imageBodyPart.putString(\"uri\", \"imageUri\");\n    imageBodyPart.putArray(\n        \"headers\",\n        JavaOnlyArray.from(\n            Arrays.asList(\n                JavaOnlyArray.of(\"content-type\", \"image/jpg\"),\n                JavaOnlyArray.of(\"content-disposition\", \"filename=photo.jpg\"))));\n    formData.pushMap(imageBodyPart);\n\n    OkHttpClient httpClient = mock(OkHttpClient.class);\n    when(httpClient.newCall(any(Request.class))).thenAnswer(\n        new Answer<Object>() {\n          @Override\n          public Object answer(InvocationOnMock invocation) throws Throwable {\n            Call callMock = mock(Call.class);\n            return callMock;\n          }\n        });\n    OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);\n    when(clientBuilder.build()).thenReturn(httpClient);\n    when(httpClient.newBuilder()).thenReturn(clientBuilder);\n\n    NetworkingModule networkingModule =\n      new NetworkingModule(mock(ReactApplicationContext.class), \"\", httpClient);\n    networkingModule.sendRequest(\n      \"POST\",\n      \"http://someurl/uploadFoo\",\n      0,\n      JavaOnlyArray.from(headers),\n      body,\n      /* responseType */ \"text\",\n      /* useIncrementalUpdates*/ true,\n      /* timeout */ 0,\n      /* withCredentials */ false);\n\n    // verify RequestBodyPart for image\n    PowerMockito.verifyStatic(times(1));\n    RequestBodyUtil.getFileInputStream(any(ReactContext.class), eq(\"imageUri\"));\n    PowerMockito.verifyStatic(times(1));\n    RequestBodyUtil.create(MediaType.parse(\"image/jpg\"), inputStream);\n\n    // verify body\n    verify(multipartBuilder).build();\n    verify(multipartBuilder).setType(MultipartBody.FORM);\n    ArgumentCaptor<Headers> headersArgumentCaptor = ArgumentCaptor.forClass(Headers.class);\n    ArgumentCaptor<RequestBody> bodyArgumentCaptor = ArgumentCaptor.forClass(RequestBody.class);\n    verify(multipartBuilder, times(2)).\n        addPart(headersArgumentCaptor.capture(), bodyArgumentCaptor.capture());\n\n    List<Headers> bodyHeaders = headersArgumentCaptor.getAllValues();\n    assertThat(bodyHeaders.size()).isEqualTo(2);\n    List<RequestBody> bodyRequestBody = bodyArgumentCaptor.getAllValues();\n    assertThat(bodyRequestBody.size()).isEqualTo(2);\n\n    assertThat(bodyHeaders.get(0).get(\"content-disposition\")).isEqualTo(\"user\");\n    assertThat(bodyRequestBody.get(0).contentType()).isNull();\n    assertThat(bodyRequestBody.get(0).contentLength()).isEqualTo(\"locale\".getBytes().length);\n    assertThat(bodyHeaders.get(1).get(\"content-disposition\")).isEqualTo(\"filename=photo.jpg\");\n    assertThat(bodyRequestBody.get(1).contentType()).isEqualTo(MediaType.parse(\"image/jpg\"));\n    assertThat(bodyRequestBody.get(1).contentLength()).isEqualTo(\"imageUri\".getBytes().length);\n  }\n\n  @Test\n  public void testCancelAllCallsOnCatalystInstanceDestroy() throws Exception {\n    PowerMockito.mockStatic(OkHttpCallUtil.class);\n    OkHttpClient httpClient = mock(OkHttpClient.class);\n    final int requests = 3;\n    final Call[] calls = new Call[requests];\n    for (int idx = 0; idx < requests; idx++) {\n      calls[idx] = mock(Call.class);\n    }\n\n    when(httpClient.cookieJar()).thenReturn(mock(CookieJarContainer.class));\n    when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        Request request = (Request) invocation.getArguments()[0];\n        return calls[(Integer) request.tag() - 1];\n      }\n    });\n    OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);\n    when(clientBuilder.build()).thenReturn(httpClient);\n    when(httpClient.newBuilder()).thenReturn(clientBuilder);\n    NetworkingModule networkingModule =\n      new NetworkingModule(mock(ReactApplicationContext.class), \"\", httpClient);\n    networkingModule.initialize();\n\n    for (int idx = 0; idx < requests; idx++) {\n      networkingModule.sendRequest(\n        \"GET\",\n        \"http://somedomain/foo\",\n        idx + 1,\n        JavaOnlyArray.of(),\n        null,\n        /* responseType */ \"text\",\n        /* useIncrementalUpdates*/ true,\n        /* timeout */ 0,\n        /* withCredentials */ false);\n    }\n    verify(httpClient, times(3)).newCall(any(Request.class));\n\n    networkingModule.onCatalystInstanceDestroy();\n    PowerMockito.verifyStatic(times(3));\n    ArgumentCaptor<OkHttpClient> clientArguments = ArgumentCaptor.forClass(OkHttpClient.class);\n    ArgumentCaptor<Integer> requestIdArguments = ArgumentCaptor.forClass(Integer.class);\n    OkHttpCallUtil.cancelTag(clientArguments.capture(), requestIdArguments.capture());\n\n    assertThat(requestIdArguments.getAllValues().size()).isEqualTo(requests);\n    for (int idx = 0; idx < requests; idx++) {\n      assertThat(requestIdArguments.getAllValues().contains(idx + 1)).isTrue();\n    }\n  }\n\n  @Test\n  public void testCancelSomeCallsOnCatalystInstanceDestroy() throws Exception {\n    PowerMockito.mockStatic(OkHttpCallUtil.class);\n    OkHttpClient httpClient = mock(OkHttpClient.class);\n    final int requests = 3;\n    final Call[] calls = new Call[requests];\n    for (int idx = 0; idx < requests; idx++) {\n      calls[idx] = mock(Call.class);\n    }\n\n    when(httpClient.cookieJar()).thenReturn(mock(CookieJarContainer.class));\n    when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        Request request = (Request) invocation.getArguments()[0];\n        return calls[(Integer) request.tag() - 1];\n      }\n    });\n    OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);\n    when(clientBuilder.build()).thenReturn(httpClient);\n    when(httpClient.newBuilder()).thenReturn(clientBuilder);\n    NetworkingModule networkingModule =\n      new NetworkingModule(mock(ReactApplicationContext.class), \"\", httpClient);\n\n    for (int idx = 0; idx < requests; idx++) {\n      networkingModule.sendRequest(\n        \"GET\",\n        \"http://somedomain/foo\",\n        idx + 1,\n        JavaOnlyArray.of(),\n        null,\n        /* responseType */ \"text\",\n        /* useIncrementalUpdates*/ true,\n        /* timeout */ 0,\n        /* withCredentials */ false);\n    }\n    verify(httpClient, times(3)).newCall(any(Request.class));\n\n    networkingModule.abortRequest(requests);\n    PowerMockito.verifyStatic(times(1));\n    ArgumentCaptor<OkHttpClient> clientArguments = ArgumentCaptor.forClass(OkHttpClient.class);\n    ArgumentCaptor<Integer> requestIdArguments = ArgumentCaptor.forClass(Integer.class);\n    OkHttpCallUtil.cancelTag(clientArguments.capture(), requestIdArguments.capture());\n    assertThat(requestIdArguments.getAllValues().size()).isEqualTo(1);\n    assertThat(requestIdArguments.getAllValues().get(0)).isEqualTo(requests);\n\n    // verifyStatic actually does not clear all calls so far, so we have to check for all of them.\n    // If `cancelTag` would've been called again for the aborted call, we would have had\n    // `requests + 1` calls.\n    networkingModule.onCatalystInstanceDestroy();\n    PowerMockito.verifyStatic(times(requests));\n    clientArguments = ArgumentCaptor.forClass(OkHttpClient.class);\n    requestIdArguments = ArgumentCaptor.forClass(Integer.class);\n    OkHttpCallUtil.cancelTag(clientArguments.capture(), requestIdArguments.capture());\n    assertThat(requestIdArguments.getAllValues().size()).isEqualTo(requests);\n    for (int idx = 0; idx < requests; idx++) {\n      assertThat(requestIdArguments.getAllValues().contains(idx + 1)).isTrue();\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/modules/share/ShareModuleTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.share;\n\nimport android.app.Activity;\nimport android.content.Intent;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Promise;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactTestHelper;\nimport com.facebook.react.bridge.JavaOnlyMap;\n\nimport javax.annotation.Nullable;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.Rule;\nimport org.junit.runner.RunWith;\nimport org.mockito.Mockito;\nimport org.mockito.invocation.InvocationOnMock;\nimport org.mockito.stubbing.Answer;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.internal.ShadowExtractor;\nimport org.robolectric.Robolectric;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\nimport org.robolectric.shadows.ShadowApplication;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertNotNull;\n\n@PrepareForTest({Arguments.class})\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class ShareModuleTest {\n\n  private Activity mActivity;\n  private ShareModule mShareModule;\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  @Before\n  public void prepareModules() throws Exception {\n    PowerMockito.mockStatic(Arguments.class);\n    Mockito.when(Arguments.createMap()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return new JavaOnlyMap();\n      }\n    });\n\n    mShareModule = new ShareModule(ReactTestHelper.createCatalystContextForTest());\n  }\n\n  @After\n  public void cleanUp() {\n    mActivity = null;\n    mShareModule = null;\n  }\n\n  @Test\n  public void testShareDialog() {\n    final String title = \"Title\";\n    final String message = \"Message\";\n    final String dialogTitle = \"Dialog Title\";\n\n    JavaOnlyMap content = new JavaOnlyMap();\n    content.putString(\"title\", title);\n    content.putString(\"message\", message);\n\n    final SimplePromise promise = new SimplePromise();\n\n    mShareModule.share(content, dialogTitle, promise);\n\n    final Intent chooserIntent = \n      ((ShadowApplication)ShadowExtractor.extract(RuntimeEnvironment.application)).getNextStartedActivity();\n    assertNotNull(\"Dialog was not displayed\", chooserIntent);\n    assertEquals(Intent.ACTION_CHOOSER, chooserIntent.getAction());\n    assertEquals(dialogTitle, chooserIntent.getExtras().get(Intent.EXTRA_TITLE));\n\n    final Intent contentIntent = (Intent)chooserIntent.getExtras().get(Intent.EXTRA_INTENT);\n    assertNotNull(\"Intent was not built correctly\", contentIntent);\n    assertEquals(Intent.ACTION_SEND, contentIntent.getAction());\n    assertEquals(title, contentIntent.getExtras().get(Intent.EXTRA_SUBJECT));\n    assertEquals(message, contentIntent.getExtras().get(Intent.EXTRA_TEXT));\n\n    assertEquals(1, promise.getResolved());\n  }\n\n  @Test\n  public void testInvalidContent() {\n    final String dialogTitle = \"Dialog Title\";\n\n    final SimplePromise promise = new SimplePromise();\n\n    mShareModule.share(null, dialogTitle, promise);\n\n    assertEquals(1, promise.getRejected());\n    assertEquals(ShareModule.ERROR_INVALID_CONTENT, promise.getErrorCode());\n  }\n\n  final static class SimplePromise implements Promise {\n    private static final String DEFAULT_ERROR = \"EUNSPECIFIED\";\n\n    private int mResolved;\n    private int mRejected;\n    private Object mValue;\n    private String mErrorCode;\n    private String mErrorMessage;\n\n    public int getResolved() {\n      return mResolved;\n    }\n\n    public int getRejected() {\n      return mRejected;\n    }\n    \n    public Object getValue() {\n      return mValue;\n    }\n\n    public String getErrorCode() {\n      return mErrorCode;\n    }\n\n    public String getErrorMessage() {\n      return mErrorMessage;\n    }\n\n    @Override\n    public void resolve(Object value) {\n      mResolved++;\n      mValue = value;\n    }\n\n    @Override\n    public void reject(String code, String message) {\n      reject(code, message, /*Throwable*/null);\n    }\n\n    @Override\n    @Deprecated\n    public void reject(String message) {\n      reject(DEFAULT_ERROR, message, /*Throwable*/null);\n    }\n\n    @Override\n    public void reject(String code, Throwable e) {\n      reject(code, e.getMessage(), e);\n    }\n\n    @Override\n    public void reject(Throwable e) {\n      reject(DEFAULT_ERROR, e.getMessage(), e);\n    }\n\n    @Override\n    public void reject(String code, String message, @Nullable Throwable e) {\n      mRejected++;\n      mErrorCode = code;\n      mErrorMessage = message;\n    }\n  }\n\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.timing;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.JavaOnlyArray;\nimport com.facebook.react.devsupport.interfaces.DevSupportManager;\nimport com.facebook.react.common.SystemClock;\nimport com.facebook.react.modules.core.ChoreographerCompat;\nimport com.facebook.react.modules.core.JSTimers;\nimport com.facebook.react.modules.core.ReactChoreographer;\nimport com.facebook.react.modules.core.Timing;\n\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.invocation.InvocationOnMock;\nimport org.mockito.stubbing.Answer;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static org.mockito.Mockito.*;\n\n/**\n * Tests for {@link Timing}.\n */\n// DISABLED, BROKEN https://circleci.com/gh/facebook/react-native/12068\n// t=13905097\n@PrepareForTest({Arguments.class, SystemClock.class, ReactChoreographer.class})\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\n@RunWith(RobolectricTestRunner.class)\npublic class TimingModuleTest {\n\n  private static final long FRAME_TIME_NS = 17 * 1000 * 1000; // 17 ms\n\n  private Timing mTiming;\n  private ReactChoreographer mReactChoreographerMock;\n  private PostFrameCallbackHandler mPostFrameCallbackHandler;\n  private PostFrameIdleCallbackHandler mIdlePostFrameCallbackHandler;\n  private long mCurrentTimeNs;\n  private JSTimers mJSTimersMock;\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  @Before\n  public void prepareModules() {\n    PowerMockito.mockStatic(Arguments.class);\n    when(Arguments.createArray()).thenAnswer(\n      new Answer<Object>() {\n        @Override\n        public Object answer(InvocationOnMock invocation) throws Throwable {\n          return new JavaOnlyArray();\n        }\n      });\n\n    PowerMockito.mockStatic(SystemClock.class);\n    when(SystemClock.uptimeMillis()).thenReturn(mCurrentTimeNs / 1000000);\n    when(SystemClock.currentTimeMillis()).thenReturn(mCurrentTimeNs / 1000000);\n    when(SystemClock.nanoTime()).thenReturn(mCurrentTimeNs);\n\n    mReactChoreographerMock = mock(ReactChoreographer.class);\n    PowerMockito.mockStatic(ReactChoreographer.class);\n    when(ReactChoreographer.getInstance()).thenReturn(mReactChoreographerMock);\n\n    CatalystInstance reactInstance = mock(CatalystInstance.class);\n    ReactApplicationContext reactContext = mock(ReactApplicationContext.class);\n    when(reactContext.getCatalystInstance()).thenReturn(reactInstance);\n\n    mCurrentTimeNs = 0;\n    mPostFrameCallbackHandler = new PostFrameCallbackHandler();\n    mIdlePostFrameCallbackHandler = new PostFrameIdleCallbackHandler();\n\n    doAnswer(mPostFrameCallbackHandler)\n      .when(mReactChoreographerMock)\n      .postFrameCallback(\n        eq(ReactChoreographer.CallbackType.TIMERS_EVENTS),\n        any(ChoreographerCompat.FrameCallback.class));\n\n    doAnswer(mIdlePostFrameCallbackHandler)\n      .when(mReactChoreographerMock)\n      .postFrameCallback(\n        eq(ReactChoreographer.CallbackType.IDLE_EVENT),\n        any(ChoreographerCompat.FrameCallback.class));\n\n    mTiming = new Timing(reactContext, mock(DevSupportManager.class));\n    mJSTimersMock = mock(JSTimers.class);\n    when(reactContext.getJSModule(JSTimers.class)).thenReturn(mJSTimersMock);\n\n    doAnswer(new Answer() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        ((Runnable) invocation.getArguments()[0]).run();\n        return null;\n      }\n    }).when(reactContext).runOnJSQueueThread(any(Runnable.class));\n\n    mTiming.initialize();\n  }\n\n  private void stepChoreographerFrame() {\n    ChoreographerCompat.FrameCallback callback = mPostFrameCallbackHandler.getAndResetFrameCallback();\n    ChoreographerCompat.FrameCallback idleCallback = mIdlePostFrameCallbackHandler.getAndResetFrameCallback();\n\n    mCurrentTimeNs += FRAME_TIME_NS;\n    when(SystemClock.uptimeMillis()).thenReturn(mCurrentTimeNs / 1000000);\n    if (callback != null) {\n      callback.doFrame(mCurrentTimeNs);\n    }\n\n    if (idleCallback != null) {\n      idleCallback.doFrame(mCurrentTimeNs);\n    }\n  }\n\n  @Test\n  public void testSimpleTimer() {\n    mTiming.onHostResume();\n    mTiming.createTimer(1, 1, 0, false);\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(1));\n    reset(mJSTimersMock);\n    stepChoreographerFrame();\n    verifyNoMoreInteractions(mJSTimersMock);\n  }\n\n  @Test\n  public void testSimpleRecurringTimer() {\n    mTiming.createTimer(100, 1, 0, true);\n    mTiming.onHostResume();\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(100));\n\n    reset(mJSTimersMock);\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(100));\n  }\n\n  @Test\n  public void testCancelRecurringTimer() {\n    mTiming.onHostResume();\n    mTiming.createTimer(105, 1, 0, true);\n\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(105));\n\n    reset(mJSTimersMock);\n    mTiming.deleteTimer(105);\n    stepChoreographerFrame();\n    verifyNoMoreInteractions(mJSTimersMock);\n  }\n\n  @Test\n  public void testPausingAndResuming() {\n    mTiming.onHostResume();\n    mTiming.createTimer(41, 1, 0, true);\n\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41));\n\n    reset(mJSTimersMock);\n    mTiming.onHostPause();\n    stepChoreographerFrame();\n    verifyNoMoreInteractions(mJSTimersMock);\n\n    reset(mJSTimersMock);\n    mTiming.onHostResume();\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41));\n  }\n\n  @Test\n  public void testHeadlessJsTaskInBackground() {\n    mTiming.onHostPause();\n    mTiming.onHeadlessJsTaskStart(42);\n    mTiming.createTimer(41, 1, 0, true);\n\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41));\n\n    reset(mJSTimersMock);\n    mTiming.onHeadlessJsTaskFinish(42);\n    stepChoreographerFrame();\n    verifyNoMoreInteractions(mJSTimersMock);\n  }\n\n  @Test\n  public void testHeadlessJsTaskInForeground() {\n    mTiming.onHostResume();\n    mTiming.onHeadlessJsTaskStart(42);\n    mTiming.createTimer(41, 1, 0, true);\n\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41));\n\n    reset(mJSTimersMock);\n    mTiming.onHeadlessJsTaskFinish(42);\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41));\n\n    reset(mJSTimersMock);\n    mTiming.onHostPause();\n    verifyNoMoreInteractions(mJSTimersMock);\n  }\n\n  @Test\n  public void testHeadlessJsTaskIntertwine() {\n    mTiming.onHostResume();\n    mTiming.onHeadlessJsTaskStart(42);\n    mTiming.createTimer(41, 1, 0, true);\n    mTiming.onHostPause();\n\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41));\n\n    reset(mJSTimersMock);\n    mTiming.onHostResume();\n    mTiming.onHeadlessJsTaskFinish(42);\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41));\n\n    reset(mJSTimersMock);\n    mTiming.onHostPause();\n    stepChoreographerFrame();\n    verifyNoMoreInteractions(mJSTimersMock);\n  }\n\n  @Test\n  public void testSetTimeoutZero() {\n    mTiming.createTimer(100, 0, 0, false);\n    verify(mJSTimersMock).callTimers(JavaOnlyArray.of(100));\n  }\n\n  @Test\n  public void testIdleCallback() {\n    mTiming.onHostResume();\n    mTiming.setSendIdleEvents(true);\n\n    stepChoreographerFrame();\n    verify(mJSTimersMock).callIdleCallbacks(SystemClock.currentTimeMillis());\n  }\n\n  private static class PostFrameIdleCallbackHandler implements Answer<Void> {\n\n    private ChoreographerCompat.FrameCallback mFrameCallback;\n\n    @Override\n    public Void answer(InvocationOnMock invocation) throws Throwable {\n      Object[] args = invocation.getArguments();\n      mFrameCallback = (ChoreographerCompat.FrameCallback) args[1];\n      return null;\n    }\n\n    public ChoreographerCompat.FrameCallback getAndResetFrameCallback() {\n      ChoreographerCompat.FrameCallback callback = mFrameCallback;\n      mFrameCallback = null;\n      return callback;\n    }\n  }\n\n  private static class PostFrameCallbackHandler implements Answer<Void> {\n\n    private ChoreographerCompat.FrameCallback mFrameCallback;\n\n    @Override\n    public Void answer(InvocationOnMock invocation) throws Throwable {\n      Object[] args = invocation.getArguments();\n      mFrameCallback = (ChoreographerCompat.FrameCallback) args[1];\n      return null;\n    }\n\n    public ChoreographerCompat.FrameCallback getAndResetFrameCallback() {\n      ChoreographerCompat.FrameCallback callback = mFrameCallback;\n      mFrameCallback = null;\n      return callback;\n    }\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/packagerconnection/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nrn_robolectric_test(\n    name = \"packagerconnection\",\n    srcs = glob([\"**/*.java\"]),\n    # Please change the contact to the oncall of your team\n    contacts = [\"oncall+fbandroid_sheriff@xmail.facebook.com\"],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"libraries/fbcore/src/test/java/com/facebook/powermock:powermock\"),\n        react_native_dep(\"third-party/java/fest:fest\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/junit:junit\"),\n        react_native_dep(\"third-party/java/mockito:mockito\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_dep(\"third-party/java/robolectric3/robolectric:robolectric\"),\n        react_native_target(\"java/com/facebook/react/packagerconnection:packagerconnection\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/packagerconnection/JSPackagerClientTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.packagerconnection;\n\nimport com.facebook.react.packagerconnection.ReconnectingWebSocket.ConnectionCallback;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport okio.ByteString;\n\nimport static org.mockito.Mockito.*;\nimport org.robolectric.RobolectricTestRunner;\n\n@RunWith(RobolectricTestRunner.class)\npublic class JSPackagerClientTest {\n  private static Map<String, RequestHandler> createRH(\n      String action, RequestHandler handler) {\n    Map<String, RequestHandler> m =\n      new HashMap<String, RequestHandler>();\n    m.put(action, handler);\n    return m;\n  }\n\n  private PackagerConnectionSettings mSettings;\n\n  @Before\n  public void setUp() {\n    mSettings = mock(PackagerConnectionSettings.class);\n    when(mSettings.getDebugServerHost()).thenReturn(\"ws://not_needed\");\n    when(mSettings.getPackageName()).thenReturn(\"my_test_package\");\n  }\n\n  @Test\n  public void test_onMessage_ShouldTriggerNotification() throws IOException {\n    RequestHandler handler = mock(RequestHandler.class);\n    final JSPackagerClient client = new JSPackagerClient(\"test_client\", mSettings, createRH(\"methodValue\", handler));\n\n    client.onMessage(\"{\\\"version\\\": 2, \\\"method\\\": \\\"methodValue\\\", \\\"params\\\": \\\"paramsValue\\\"}\");\n    verify(handler).onNotification(eq(\"paramsValue\"));\n    verify(handler, never()).onRequest(any(), any(Responder.class));\n  }\n\n  @Test\n  public void test_onMessage_ShouldTriggerRequest() throws IOException {\n    RequestHandler handler = mock(RequestHandler.class);\n    final JSPackagerClient client = new JSPackagerClient(\"test_client\", mSettings, createRH(\"methodValue\", handler));\n\n    client.onMessage(\"{\\\"version\\\": 2, \\\"id\\\": \\\"idValue\\\", \\\"method\\\": \\\"methodValue\\\", \\\"params\\\": \\\"paramsValue\\\"}\");\n    verify(handler, never()).onNotification(any());\n    verify(handler).onRequest(eq(\"paramsValue\"), any(Responder.class));\n  }\n\n  @Test\n  public void test_onMessage_WithoutParams_ShouldTriggerNotification() throws IOException {\n    RequestHandler handler = mock(RequestHandler.class);\n    final JSPackagerClient client = new JSPackagerClient(\"test_client\", mSettings, createRH(\"methodValue\", handler));\n\n    client.onMessage(\"{\\\"version\\\": 2, \\\"method\\\": \\\"methodValue\\\"}\");\n    verify(handler).onNotification(eq(null));\n    verify(handler, never()).onRequest(any(), any(Responder.class));\n  }\n\n  @Test\n  public void test_onMessage_WithInvalidContentType_ShouldNotTriggerCallback() throws IOException {\n    RequestHandler handler = mock(RequestHandler.class);\n    final JSPackagerClient client = new JSPackagerClient(\"test_client\", mSettings, createRH(\"methodValue\", handler));\n\n    client.onMessage(ByteString.encodeUtf8(\"{\\\"version\\\": 2, \\\"method\\\": \\\"methodValue\\\"}\"));\n    verify(handler, never()).onNotification(any());\n    verify(handler, never()).onRequest(any(), any(Responder.class));\n  }\n\n  @Test\n  public void test_onMessage_WithoutMethod_ShouldNotTriggerCallback() throws IOException {\n    RequestHandler handler = mock(RequestHandler.class);\n    final JSPackagerClient client = new JSPackagerClient(\"test_client\", mSettings, createRH(\"methodValue\", handler));\n\n    client.onMessage(\"{\\\"version\\\": 2}\");\n    verify(handler, never()).onNotification(any());\n    verify(handler, never()).onRequest(any(), any(Responder.class));\n  }\n\n  @Test\n  public void test_onMessage_With_Null_Action_ShouldNotTriggerCallback() throws IOException {\n    RequestHandler handler = mock(RequestHandler.class);\n    final JSPackagerClient client = new JSPackagerClient(\"test_client\", mSettings, createRH(\"methodValue\", handler));\n\n    client.onMessage(\"{\\\"version\\\": 2, \\\"method\\\": null}\");\n    verify(handler, never()).onNotification(any());\n    verify(handler, never()).onRequest(any(), any(Responder.class));\n  }\n\n  @Test\n  public void test_onMessage_WithInvalidMethod_ShouldNotTriggerCallback() throws IOException {\n    RequestHandler handler = mock(RequestHandler.class);\n    final JSPackagerClient client = new JSPackagerClient(\"test_client\", mSettings, createRH(\"methodValue\", handler));\n\n    client.onMessage(ByteString.EMPTY);\n    verify(handler, never()).onNotification(any());\n    verify(handler, never()).onRequest(any(), any(Responder.class));\n  }\n\n  @Test\n  public void test_onMessage_WrongVersion_ShouldNotTriggerCallback() throws IOException {\n    RequestHandler handler = mock(RequestHandler.class);\n    final JSPackagerClient client = new JSPackagerClient(\"test_client\", mSettings, createRH(\"methodValue\", handler));\n\n    client.onMessage(\"{\\\"version\\\": 1, \\\"method\\\": \\\"methodValue\\\"}\");\n    verify(handler, never()).onNotification(any());\n    verify(handler, never()).onRequest(any(), any(Responder.class));\n  }\n\n  @Test\n  public void test_onDisconnection_ShouldTriggerDisconnectionCallback() throws IOException {\n    ConnectionCallback connectionHandler = mock(ConnectionCallback.class);\n    RequestHandler handler = mock(RequestHandler.class);\n    final JSPackagerClient client =\n      new JSPackagerClient(\"test_client\", mSettings, new HashMap<String,RequestHandler>(), connectionHandler);\n\n    client.close();\n\n    verify(connectionHandler, never()).onConnected();\n    verify(connectionHandler, times(1)).onDisconnected();\n\n    verify(handler, never()).onNotification(any());\n    verify(handler, never()).onRequest(any(), any(Responder.class));\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/uimanager/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nrn_robolectric_test(\n    name = \"uimanager\",\n    # TODO Disabled temporarily until Yoga linking is fixed t14964130\n    # srcs = glob(['**/*.java']),\n    srcs = [\n        \"MatrixMathHelperTest.java\",\n        \"SimpleViewPropertyTest.java\",\n    ],\n    # Please change the contact to the oncall of your team\n    contacts = [\"oncall+fbandroid_sheriff@xmail.facebook.com\"],\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"libraries/fbcore/src/test/java/com/facebook/powermock:powermock\"),\n        react_native_dep(\"third-party/java/fest:fest\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/junit:junit\"),\n        react_native_dep(\"third-party/java/mockito:mockito\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_dep(\"third-party/java/robolectric3/robolectric:robolectric\"),\n        react_native_target(\"java/com/facebook/react:react\"),\n        react_native_target(\"java/com/facebook/react/animation:animation\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/touch:touch\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/text:text\"),\n        react_native_target(\"java/com/facebook/react/views/view:view\"),\n        react_native_tests_target(\"java/com/facebook/react/bridge:testhelpers\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/uimanager/LayoutPropertyApplicatorTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.util.DisplayMetrics;\n\nimport com.facebook.yoga.YogaAlign;\nimport com.facebook.yoga.YogaConstants;\nimport com.facebook.yoga.YogaFlexDirection;\nimport com.facebook.yoga.YogaJustify;\nimport com.facebook.yoga.YogaPositionType;\nimport com.facebook.react.bridge.JavaOnlyMap;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.invocation.InvocationOnMock;\nimport org.mockito.stubbing.Answer;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static junit.framework.Assert.assertEquals;\nimport static org.mockito.Matchers.any;\nimport static org.mockito.Matchers.anyFloat;\nimport static org.mockito.Matchers.anyInt;\nimport static org.mockito.Matchers.eq;\nimport static org.mockito.Mockito.never;\nimport static org.mockito.Mockito.reset;\nimport static org.mockito.Mockito.spy;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\nimport static org.powermock.api.mockito.PowerMockito.mockStatic;\n\n@PrepareForTest({PixelUtil.class})\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class LayoutPropertyApplicatorTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  @Before\n  public void setup() {\n    DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());\n    DisplayMetricsHolder.setScreenDisplayMetrics(new DisplayMetrics());\n  }\n\n  @After\n  public void teardown() {\n    DisplayMetricsHolder.setWindowDisplayMetrics(null);\n    DisplayMetricsHolder.setScreenDisplayMetrics(null);\n  }\n\n  public ReactStylesDiffMap buildStyles(Object... keysAndValues) {\n    return new ReactStylesDiffMap(JavaOnlyMap.of(keysAndValues));\n  }\n\n  @Test\n  public void testDimensions() {\n    LayoutShadowNode reactShadowNode = spy(new LayoutShadowNode());\n    ReactStylesDiffMap map = spy(\n        buildStyles(\n            \"width\",\n            10.0,\n            \"height\",\n            10.0,\n            \"left\",\n            10.0,\n            \"top\",\n            10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setStyleWidth(anyFloat());\n    verify(map).getFloat(eq(\"width\"), anyFloat());\n    verify(reactShadowNode).setStyleHeight(anyFloat());\n    verify(map).getFloat(eq(\"height\"), anyFloat());\n    verify(reactShadowNode).setPosition(eq(Spacing.START), anyFloat());\n    verify(map).getFloat(eq(\"left\"), anyFloat());\n    verify(reactShadowNode).setPosition(eq(Spacing.TOP), anyFloat());\n    verify(map).getFloat(eq(\"top\"), anyFloat());\n\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles());\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode, never()).setStyleWidth(anyFloat());\n    verify(map, never()).getFloat(eq(\"width\"), anyFloat());\n    verify(reactShadowNode, never()).setStyleHeight(anyFloat());\n    verify(map, never()).getFloat(eq(\"height\"), anyFloat());\n    verify(reactShadowNode, never()).setPosition(eq(Spacing.START), anyFloat());\n    verify(map, never()).getFloat(eq(\"left\"), anyFloat());\n    verify(reactShadowNode, never()).setPosition(eq(Spacing.TOP), anyFloat());\n    verify(map, never()).getFloat(eq(\"top\"), anyFloat());\n  }\n\n  @Test\n  public void testFlex() {\n    LayoutShadowNode reactShadowNode = spy(new LayoutShadowNode());\n    ReactStylesDiffMap map = spy(buildStyles(\"flex\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setFlex(anyFloat());\n    verify(map).getFloat(\"flex\", 0.f);\n\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles());\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode, never()).setFlex(anyFloat());\n    verify(map, never()).getFloat(\"flex\", 0.f);\n  }\n\n  @Test\n  public void testPosition() {\n    LayoutShadowNode reactShadowNode = spy(new LayoutShadowNode());\n    ReactStylesDiffMap map = spy(buildStyles(\n        \"position\",\n        \"absolute\",\n        \"bottom\",\n        10.0,\n        \"right\",\n        5.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setPosition(eq(Spacing.BOTTOM), anyFloat());\n    verify(reactShadowNode).setPosition(eq(Spacing.END), anyFloat());\n    verify(reactShadowNode).setPositionType(any(YogaPositionType.class));\n    verify(map).getFloat(\"bottom\", Float.NaN);\n    verify(map).getFloat(\"right\", Float.NaN);\n\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles());\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode, never()).setPosition(eq(Spacing.BOTTOM), anyFloat());\n    verify(reactShadowNode, never()).setPosition(eq(Spacing.END), anyFloat());\n    verify(reactShadowNode, never()).setPositionType(any(YogaPositionType.class));\n    verify(map, never()).getFloat(\"bottom\", Float.NaN);\n    verify(map, never()).getFloat(\"right\", Float.NaN);\n  }\n\n  @Test\n  public void testMargin() {\n    // margin\n    LayoutShadowNode reactShadowNode = spy(new LayoutShadowNode());\n    ReactStylesDiffMap map = spy(buildStyles(\"margin\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setMargin(eq(Spacing.ALL), anyFloat());\n    verify(map).getFloat(\"margin\", YogaConstants.UNDEFINED);\n\n    // marginVertical\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"marginVertical\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setMargin(eq(Spacing.VERTICAL), anyFloat());\n    verify(map).getFloat(\"marginVertical\", YogaConstants.UNDEFINED);\n\n    // marginHorizontal\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"marginHorizontal\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setMargin(eq(Spacing.HORIZONTAL), anyFloat());\n    verify(map).getFloat(\"marginHorizontal\", YogaConstants.UNDEFINED);\n\n    // marginTop\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"marginTop\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setMargin(eq(Spacing.TOP), anyFloat());\n    verify(map).getFloat(\"marginTop\", YogaConstants.UNDEFINED);\n\n    // marginBottom\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"marginBottom\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setMargin(eq(Spacing.BOTTOM), anyFloat());\n    verify(map).getFloat(\"marginBottom\", YogaConstants.UNDEFINED);\n\n    // marginLeft\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"marginLeft\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setMargin(eq(Spacing.START), anyFloat());\n    verify(map).getFloat(\"marginLeft\", YogaConstants.UNDEFINED);\n\n    // marginRight\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"marginRight\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setMargin(eq(Spacing.END), anyFloat());\n    verify(map).getFloat(\"marginRight\", YogaConstants.UNDEFINED);\n\n    // no margin\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles());\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode, never()).setMargin(anyInt(), anyFloat());\n    verify(map, never()).getFloat(\"margin\", YogaConstants.UNDEFINED);\n  }\n\n  @Test\n  public void testPadding() {\n    // padding\n    LayoutShadowNode reactShadowNode = spy(new LayoutShadowNode());\n    ReactStylesDiffMap map = spy(buildStyles(\"padding\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setPadding(eq(Spacing.ALL), anyFloat());\n    verify(map).getFloat(\"padding\", YogaConstants.UNDEFINED);\n\n    // paddingVertical\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"paddingVertical\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setPadding(eq(Spacing.VERTICAL), anyFloat());\n    verify(map).getFloat(\"paddingVertical\", YogaConstants.UNDEFINED);\n\n    // paddingHorizontal\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"paddingHorizontal\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setPadding(eq(Spacing.HORIZONTAL), anyFloat());\n    verify(map).getFloat(\"paddingHorizontal\", YogaConstants.UNDEFINED);\n\n    // paddingTop\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"paddingTop\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setPadding(eq(Spacing.TOP), anyFloat());\n    verify(map).getFloat(\"paddingTop\", YogaConstants.UNDEFINED);\n\n    // paddingBottom\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"paddingBottom\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setPadding(eq(Spacing.BOTTOM), anyFloat());\n    verify(map).getFloat(\"paddingBottom\", YogaConstants.UNDEFINED);\n\n    // paddingLeft\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"paddingLeft\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setPadding(eq(Spacing.START), anyFloat());\n    verify(map).getFloat(\"paddingLeft\", YogaConstants.UNDEFINED);\n\n    // paddingRight\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles(\"paddingRight\", 10.0));\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setPadding(eq(Spacing.END), anyFloat());\n    verify(map).getFloat(\"paddingRight\", YogaConstants.UNDEFINED);\n\n    // no padding\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = spy(buildStyles());\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode, never()).setPadding(anyInt(), anyFloat());\n    verify(map, never()).getFloat(\"padding\", YogaConstants.UNDEFINED);\n  }\n\n  @Test\n  public void testEnumerations() {\n    LayoutShadowNode reactShadowNode = spy(new LayoutShadowNode());\n    ReactStylesDiffMap map = buildStyles(\n        \"flexDirection\",\n        \"column\",\n        \"alignSelf\",\n        \"stretch\",\n        \"alignItems\",\n        \"center\",\n        \"justifyContent\",\n        \"space_between\",\n        \"position\",\n        \"relative\");\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setFlexDirection(YogaFlexDirection.COLUMN);\n    verify(reactShadowNode).setAlignSelf(YogaAlign.STRETCH);\n    verify(reactShadowNode).setAlignItems(YogaAlign.CENTER);\n    verify(reactShadowNode).setJustifyContent(YogaJustify.SPACE_BETWEEN);\n    verify(reactShadowNode).setPositionType(YogaPositionType.RELATIVE);\n\n    reactShadowNode = spy(new LayoutShadowNode());\n    map = buildStyles();\n    reactShadowNode.updateProperties(map);\n\n    verify(reactShadowNode, never()).setFlexDirection(any(YogaFlexDirection.class));\n    verify(reactShadowNode, never()).setAlignSelf(any(YogaAlign.class));\n    verify(reactShadowNode, never()).setAlignItems(any(YogaAlign.class));\n    verify(reactShadowNode, never()).setJustifyContent(any(YogaJustify.class));\n    verify(reactShadowNode, never()).setPositionType(any(YogaPositionType.class));\n  }\n\n  @Test\n  public void testPropertiesResetToDefault() {\n    DisplayMetrics displayMetrics = new DisplayMetrics();\n    displayMetrics.density = 1.0f;\n    DisplayMetricsHolder.setWindowDisplayMetrics(displayMetrics);\n\n    LayoutShadowNode reactShadowNode = spy(new LayoutShadowNode());\n    ReactStylesDiffMap map = buildStyles(\n        \"width\",\n        10.0,\n        \"height\",\n        10.0,\n        \"left\",\n        10.0,\n        \"top\",\n        10.0,\n        \"flex\",\n        1.0,\n        \"padding\",\n        10.0,\n        \"marginLeft\",\n        10.0,\n        \"borderTopWidth\",\n        10.0,\n        \"flexDirection\",\n        \"row\",\n        \"alignSelf\",\n        \"stretch\",\n        \"alignItems\",\n        \"center\",\n        \"justifyContent\",\n        \"space_between\",\n        \"position\",\n        \"absolute\");\n\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setStyleWidth(10.f);\n    verify(reactShadowNode).setStyleHeight(10.f);\n    verify(reactShadowNode).setPosition(Spacing.START, 10.f);\n    verify(reactShadowNode).setPosition(Spacing.TOP, 10.f);\n    verify(reactShadowNode).setFlex(1.0f);\n    verify(reactShadowNode).setPadding(Spacing.ALL, 10.f);\n    verify(reactShadowNode).setMargin(Spacing.START, 10.f);\n    verify(reactShadowNode).setBorder(Spacing.TOP, 10.f);\n    verify(reactShadowNode).setFlexDirection(YogaFlexDirection.ROW);\n    verify(reactShadowNode).setAlignSelf(YogaAlign.STRETCH);\n    verify(reactShadowNode).setAlignItems(YogaAlign.CENTER);\n    verify(reactShadowNode).setJustifyContent(YogaJustify.SPACE_BETWEEN);\n    verify(reactShadowNode).setPositionType(YogaPositionType.ABSOLUTE);\n\n    map = buildStyles(\n        \"width\",\n        null,\n        \"height\",\n        null,\n        \"left\",\n        null,\n        \"top\",\n        null,\n        \"flex\",\n        null,\n        \"padding\",\n        null,\n        \"marginLeft\",\n        null,\n        \"borderTopWidth\",\n        null,\n        \"flexDirection\",\n        null,\n        \"alignSelf\",\n        null,\n        \"alignItems\",\n        null,\n        \"justifyContent\",\n        null,\n        \"position\",\n        null);\n\n    reset(reactShadowNode);\n    reactShadowNode.updateProperties(map);\n    verify(reactShadowNode).setStyleWidth(YogaConstants.UNDEFINED);\n    verify(reactShadowNode).setStyleHeight(YogaConstants.UNDEFINED);\n    verify(reactShadowNode).setPosition(Spacing.START, YogaConstants.UNDEFINED);\n    verify(reactShadowNode).setPosition(Spacing.TOP, YogaConstants.UNDEFINED);\n    verify(reactShadowNode).setFlex(0.f);\n    verify(reactShadowNode).setPadding(Spacing.ALL, YogaConstants.UNDEFINED);\n    verify(reactShadowNode).setMargin(Spacing.START, YogaConstants.UNDEFINED);\n    verify(reactShadowNode).setBorder(Spacing.TOP, YogaConstants.UNDEFINED);\n    verify(reactShadowNode).setFlexDirection(YogaFlexDirection.COLUMN);\n    verify(reactShadowNode).setAlignSelf(YogaAlign.AUTO);\n    verify(reactShadowNode).setAlignItems(YogaAlign.STRETCH);\n    verify(reactShadowNode).setJustifyContent(YogaJustify.FLEX_START);\n    verify(reactShadowNode).setPositionType(YogaPositionType.RELATIVE);\n  }\n\n  @Test\n  public void testSettingDefaultStyleValues() {\n    mockStatic(PixelUtil.class);\n    when(PixelUtil.toPixelFromDIP(anyFloat())).thenAnswer(\n        new Answer() {\n          @Override\n          public Float answer(InvocationOnMock invocation) throws Throwable {\n            Object[] args = invocation.getArguments();\n            return (Float) args[0];\n          }\n        });\n\n    LayoutShadowNode[] nodes = new LayoutShadowNode[7];\n    for (int idx = 0; idx < nodes.length; idx++) {\n      nodes[idx] = new LayoutShadowNode();\n      nodes[idx].setDefaultPadding(Spacing.START, 15);\n      nodes[idx].setDefaultPadding(Spacing.TOP, 25);\n      nodes[idx].setDefaultPadding(Spacing.END, 35);\n      nodes[idx].setDefaultPadding(Spacing.BOTTOM, 45);\n    }\n\n    ReactStylesDiffMap[] mapNodes = new ReactStylesDiffMap[7];\n    mapNodes[0] = buildStyles(\"paddingLeft\", 10.0, \"paddingHorizontal\", 5.0);\n    mapNodes[1] = buildStyles(\"padding\", 10.0, \"paddingTop\", 5.0);\n    mapNodes[2] = buildStyles(\"paddingLeft\", 10.0, \"paddingVertical\", 5.0);\n    mapNodes[3] = buildStyles(\"paddingBottom\", 10.0, \"paddingHorizontal\", 5.0);\n    mapNodes[4] = buildStyles(\"padding\", null, \"paddingTop\", 5.0);\n    mapNodes[5] = buildStyles(\n        \"paddingRight\",\n        10.0,\n        \"paddingHorizontal\",\n        null,\n        \"paddingVertical\",\n        7.0);\n    mapNodes[6] = buildStyles(\"margin\", 5.0);\n\n    for (int idx = 0; idx < nodes.length; idx++) {\n      nodes[idx].updateProperties(mapNodes[idx]);\n    }\n\n    assertEquals(10.0, nodes[0].getPadding(Spacing.START), .0001);\n    assertEquals(25.0, nodes[0].getPadding(Spacing.TOP), .0001);\n    assertEquals(5.0, nodes[0].getPadding(Spacing.END), .0001);\n    assertEquals(45.0, nodes[0].getPadding(Spacing.BOTTOM), .0001);\n\n    assertEquals(10.0, nodes[1].getPadding(Spacing.START), .0001);\n    assertEquals(5.0, nodes[1].getPadding(Spacing.TOP), .0001);\n    assertEquals(10.0, nodes[1].getPadding(Spacing.END), .0001);\n    assertEquals(10.0, nodes[1].getPadding(Spacing.BOTTOM), .0001);\n\n    assertEquals(10.0, nodes[2].getPadding(Spacing.START), .0001);\n    assertEquals(5.0, nodes[2].getPadding(Spacing.TOP), .0001);\n    assertEquals(35.0, nodes[2].getPadding(Spacing.END), .0001);\n    assertEquals(5.0, nodes[2].getPadding(Spacing.BOTTOM), .0001);\n\n    assertEquals(5.0, nodes[3].getPadding(Spacing.START), .0001);\n    assertEquals(25.0, nodes[3].getPadding(Spacing.TOP), .0001);\n    assertEquals(5.0, nodes[3].getPadding(Spacing.END), .0001);\n    assertEquals(10.0, nodes[3].getPadding(Spacing.BOTTOM), .0001);\n\n    assertEquals(15.0, nodes[4].getPadding(Spacing.START), .0001);\n    assertEquals(5.0, nodes[4].getPadding(Spacing.TOP), .0001);\n    assertEquals(35.0, nodes[4].getPadding(Spacing.END), .0001);\n    assertEquals(45.0, nodes[4].getPadding(Spacing.BOTTOM), .0001);\n\n    assertEquals(15.0, nodes[5].getPadding(Spacing.START), .0001);\n    assertEquals(7.0, nodes[5].getPadding(Spacing.TOP), .0001);\n    assertEquals(10.0, nodes[5].getPadding(Spacing.END), .0001);\n    assertEquals(7.0, nodes[5].getPadding(Spacing.BOTTOM), .0001);\n\n    assertEquals(15.0, nodes[6].getPadding(Spacing.START), .0001);\n    assertEquals(25.0, nodes[6].getPadding(Spacing.TOP), .0001);\n    assertEquals(35.0, nodes[6].getPadding(Spacing.END), .0001);\n    assertEquals(45.0, nodes[6].getPadding(Spacing.BOTTOM), .0001);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/uimanager/MatrixMathHelperTest.java",
    "content": "package com.facebook.react.uimanager;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\n\n/**\n * Test for {@link MatrixMathHelper}\n */\n@RunWith(RobolectricTestRunner.class)\npublic class MatrixMathHelperTest {\n\n  private void verifyZRotatedMatrix(double degrees, double rotX, double rotY, double rotZ) {\n    MatrixMathHelper.MatrixDecompositionContext ctx =\n      new MatrixMathHelper.MatrixDecompositionContext();\n    double[] matrix = createRotateZ(degreesToRadians(degrees));\n    MatrixMathHelper.decomposeMatrix(matrix, ctx);\n    assertThat(ctx.rotationDegrees).containsSequence(rotX, rotY, rotZ);\n  }\n\n  private void verifyYRotatedMatrix(double degrees, double rotX, double rotY, double rotZ) {\n    MatrixMathHelper.MatrixDecompositionContext ctx =\n      new MatrixMathHelper.MatrixDecompositionContext();\n    double[] matrix = createRotateY(degreesToRadians(degrees));\n    MatrixMathHelper.decomposeMatrix(matrix, ctx);\n    assertThat(ctx.rotationDegrees).containsSequence(rotX, rotY, rotZ);\n  }\n\n  private void verifyXRotatedMatrix(double degrees, double rotX, double rotY, double rotZ) {\n    MatrixMathHelper.MatrixDecompositionContext ctx =\n      new MatrixMathHelper.MatrixDecompositionContext();\n    double[] matrix = createRotateX(degreesToRadians(degrees));\n    MatrixMathHelper.decomposeMatrix(matrix, ctx);\n    assertThat(ctx.rotationDegrees).containsSequence(rotX, rotY, rotZ);\n  }\n\n  private void verifyRotatedMatrix(double degreesX, double degreesY, double degreesZ, double rotX, double rotY, double rotZ) {\n    MatrixMathHelper.MatrixDecompositionContext ctx =\n      new MatrixMathHelper.MatrixDecompositionContext();\n    double[] matrixX = createRotateX(degreesToRadians(degreesX));\n    double[] matrixY = createRotateY(degreesToRadians(degreesY));\n    double[] matrixZ = createRotateZ(degreesToRadians(degreesZ));\n    double[] matrix = MatrixMathHelper.createIdentityMatrix();\n    MatrixMathHelper.multiplyInto(matrix, matrix, matrixX);\n    MatrixMathHelper.multiplyInto(matrix, matrix, matrixY);\n    MatrixMathHelper.multiplyInto(matrix, matrix, matrixZ);\n    MatrixMathHelper.decomposeMatrix(matrix, ctx);\n    assertThat(ctx.rotationDegrees).containsSequence(rotX, rotY, rotZ);\n  }\n\n  @Test\n  public void testDecomposing4x4MatrixToProduceAccurateZaxisAngles() {\n\n    MatrixMathHelper.MatrixDecompositionContext ctx =\n      new MatrixMathHelper.MatrixDecompositionContext();\n\n    MatrixMathHelper.decomposeMatrix(\n      new double[]{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1},\n      ctx);\n\n    assertThat(ctx.rotationDegrees).containsSequence(0d, 0d, 0d);\n\n    double[] angles = new double[]{30, 45, 60, 75, 90, 100, 115, 120, 133, 167};\n    for (double angle : angles) {\n      verifyZRotatedMatrix(angle, 0d, 0d, angle);\n      verifyZRotatedMatrix(-angle, 0d, 0d, -angle);\n    }\n\n    verifyZRotatedMatrix(180d, 0d, 0d, 180d);\n\n    // all values are between 0 and 180;\n    // change of sign and direction in the third and fourth quadrant\n    verifyZRotatedMatrix(222, 0d, 0d, -138d);\n\n    verifyZRotatedMatrix(270, 0d, 0d, -90d);\n\n    // 360 is expressed as 0\n    verifyZRotatedMatrix(360, 0d, 0d, 0d);\n\n    verifyZRotatedMatrix(33.33333333, 0d, 0d, 33.333d);\n\n    verifyZRotatedMatrix(86.75309, 0d, 0d, 86.753d);\n\n    verifyZRotatedMatrix(42.00000000001, 0d, 0d, 42d);\n\n    verifyZRotatedMatrix(42.99999999999, 0d, 0d, 43d);\n\n    verifyZRotatedMatrix(42.99999999999, 0d, 0d, 43d);\n\n    verifyZRotatedMatrix(42.49999999999, 0d, 0d, 42.5d);\n\n    verifyZRotatedMatrix(42.55555555555, 0d, 0d, 42.556d);\n  }\n\n  @Test\n  public void testDecomposing4x4MatrixToProduceAccurateYaxisAngles() {\n    double[] angles = new double[]{30, 45, 60, 75, 90};\n    for (double angle : angles) {\n      verifyYRotatedMatrix(angle, 0d, angle, 0d);\n      verifyYRotatedMatrix(-angle, 0d, -angle, 0d);\n    }\n\n    // all values are between -90 and 90;\n    // change of sign and direction in the third and fourth quadrant\n    verifyYRotatedMatrix(222, -180d, -42d, -180d);\n\n    verifyYRotatedMatrix(270, -180d, -90d, -180d);\n\n    verifyYRotatedMatrix(360, 0d, 0d, 0d);\n  }\n\n  @Test\n  public void testDecomposing4x4MatrixToProduceAccurateXaxisAngles() {\n    double[] angles = new double[]{30, 45, 60, 75, 90, 100, 110, 120, 133, 167};\n    for (double angle : angles) {\n      verifyXRotatedMatrix(angle, angle, 0d, 0d);\n      verifyXRotatedMatrix(-angle, -angle, 0d, 0d);\n    }\n\n    // all values are between 0 and 180;\n    // change of sign and direction in the third and fourth quadrant\n    verifyXRotatedMatrix(222, -138d, 0d, 0d);\n\n    verifyXRotatedMatrix(270, -90d, 0d, 0d);\n\n    verifyXRotatedMatrix(360, 0d, 0d, 0d);\n  }\n\n  @Test\n  public void testDecomposingComplex4x4MatrixToProduceAccurateAngles() {\n    verifyRotatedMatrix(10, -80, 0, 10, -80, 0);\n    // x and y will flip\n    verifyRotatedMatrix(10, -95, 0, -170, -85, -180);\n  }\n\n  private static double degreesToRadians(double degrees) {\n    return degrees * Math.PI / 180;\n  }\n\n  private static double[] createRotateZ(double radians) {\n    double[] mat = MatrixMathHelper.createIdentityMatrix();\n    mat[0] = Math.cos(radians);\n    mat[1] = Math.sin(radians);\n    mat[4] = -Math.sin(radians);\n    mat[5] = Math.cos(radians);\n    return mat;\n  }\n\n  private static double[] createRotateY(double radians) {\n    double[] mat = MatrixMathHelper.createIdentityMatrix();\n    mat[0] = Math.cos(radians);\n    mat[2] = -Math.sin(radians);\n    mat[8] = Math.sin(radians);\n    mat[10] = Math.cos(radians);\n    return mat;\n  }\n\n  private static double[] createRotateX(double radians) {\n    double[] mat = MatrixMathHelper.createIdentityMatrix();\n    mat[5] = Math.cos(radians);\n    mat[6] = Math.sin(radians);\n    mat[9] = -Math.sin(radians);\n    mat[10] = Math.cos(radians);\n    return mat;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropConstantsTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\nimport static org.fest.assertions.api.Assertions.fail;\n\nimport android.view.View;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\n\n/**\n * Verifies that prop constants are generated properly based on {@code ReactProp} annotation.\n */\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class ReactPropConstantsTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private class ViewManagerUnderTest extends ViewManager<View, ReactShadowNode> {\n\n    @Override\n    public String getName() {\n      return \"SomeView\";\n    }\n\n    @Override\n    public ReactShadowNode createShadowNodeInstance() {\n      fail(\"This method should not be executed as a part of this test\");\n      return null;\n    }\n\n    @Override\n    protected View createViewInstance(ThemedReactContext reactContext) {\n      fail(\"This method should not be executed as a part of this test\");\n      return null;\n    }\n\n    @Override\n    public Class<? extends ReactShadowNode> getShadowNodeClass() {\n      return ReactShadowNode.class;\n    }\n\n    @Override\n    public void updateExtraData(View root, Object extraData) {\n      fail(\"This method should not be executed as a part of this test\");\n    }\n\n    @ReactProp(name = \"boolProp\")\n    public void setBoolProp(View v, boolean value) {\n    }\n\n    @ReactProp(name = \"intProp\")\n    public void setIntProp(View v, int value) {\n    }\n\n    @ReactProp(name = \"floatProp\")\n    public void setFloatProp(View v, float value) {\n    }\n\n    @ReactProp(name = \"doubleProp\")\n    public void setDoubleProp(View v, double value) {\n    }\n\n    @ReactProp(name = \"stringProp\")\n    public void setStringProp(View v, String value) {\n    }\n\n    @ReactProp(name = \"boxedBoolProp\")\n    public void setBoxedBoolProp(View v, Boolean value) {\n    }\n\n    @ReactProp(name = \"boxedIntProp\")\n    public void setBoxedIntProp(View v, Integer value) {\n    }\n\n    @ReactProp(name = \"arrayProp\")\n    public void setArrayProp(View v, ReadableArray value) {\n    }\n\n    @ReactProp(name = \"mapProp\")\n    public void setMapProp(View v, ReadableMap value) {\n    }\n\n    @ReactPropGroup(names = {\n        \"floatGroupPropFirst\",\n        \"floatGroupPropSecond\",\n    })\n    public void setFloatGroupProp(View v, int index, float value) {\n    }\n\n    @ReactPropGroup(names = {\n        \"intGroupPropFirst\",\n        \"intGroupPropSecond\"\n    })\n    public void setIntGroupProp(View v, int index, int value) {\n    }\n\n    @ReactPropGroup(names = {\n        \"boxedIntGroupPropFirst\",\n        \"boxedIntGroupPropSecond\",\n    })\n    public void setBoxedIntGroupProp(View v, int index, Integer value) {\n    }\n\n    @ReactProp(name = \"customIntProp\", customType = \"date\")\n    public void customIntProp(View v, int value) {\n    }\n\n    @ReactPropGroup(names = {\n        \"customBoxedIntGroupPropFirst\",\n        \"customBoxedIntGroupPropSecond\"\n    }, customType = \"color\")\n    public void customIntGroupProp(View v, int index, Integer value) {\n    }\n  }\n\n  @Test\n  public void testNativePropsIncludeCorrectTypes() {\n    List<ViewManager> viewManagers = Arrays.<ViewManager>asList(new ViewManagerUnderTest());\n    ReactApplicationContext reactContext = new ReactApplicationContext(RuntimeEnvironment.application);\n    UIManagerModule uiManagerModule =\n        new UIManagerModule(reactContext, viewManagers, new UIImplementationProvider(), 0);\n    Map<String, String> constants =\n        (Map) valueAtPath(uiManagerModule.getConstants(), \"SomeView\", \"NativeProps\");\n    assertThat(constants).isEqualTo(\n        MapBuilder.<String, String>builder()\n            .put(\"boolProp\", \"boolean\")\n            .put(\"intProp\", \"number\")\n            .put(\"doubleProp\", \"number\")\n            .put(\"floatProp\", \"number\")\n            .put(\"stringProp\", \"String\")\n            .put(\"boxedBoolProp\", \"boolean\")\n            .put(\"boxedIntProp\", \"number\")\n            .put(\"arrayProp\", \"Array\")\n            .put(\"mapProp\", \"Map\")\n            .put(\"floatGroupPropFirst\", \"number\")\n            .put(\"floatGroupPropSecond\", \"number\")\n            .put(\"intGroupPropFirst\", \"number\")\n            .put(\"intGroupPropSecond\", \"number\")\n            .put(\"boxedIntGroupPropFirst\", \"number\")\n            .put(\"boxedIntGroupPropSecond\", \"number\")\n            .put(\"customIntProp\", \"date\")\n            .put(\"customBoxedIntGroupPropFirst\", \"color\")\n            .put(\"customBoxedIntGroupPropSecond\", \"color\")\n            .build());\n  }\n\n  private static Object valueAtPath(Map nestedMap, String... keyPath) {\n    assertThat(keyPath).isNotEmpty();\n    Object value = nestedMap;\n    for (String key : keyPath) {\n      assertThat(value).isInstanceOf(Map.class);\n      nestedMap = (Map) value;\n      assertThat(nestedMap).containsKey(key);\n      value = nestedMap.get(key);\n    }\n    return value;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropForShadowNodeSetterTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.reset;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\n\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.bridge.ReadableArray;\nimport com.facebook.react.bridge.ReadableMap;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport javax.annotation.Nullable;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\n\n/**\n * Test {@link ReactProp} annotation for {@link ReactShadowNode}. More comprehensive test of this\n * annotation can be found in {@link ReactPropAnnotationSetterTest} where we test all possible types\n * of properties to be updated.\n */\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class ReactPropForShadowNodeSetterTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  public interface ViewManagerUpdatesReceiver {\n    void onBooleanSetterCalled(boolean value);\n    void onIntSetterCalled(int value);\n    void onDoubleSetterCalled(double value);\n    void onFloatSetterCalled(float value);\n    void onStringSetterCalled(String value);\n    void onBoxedBooleanSetterCalled(Boolean value);\n    void onBoxedIntSetterCalled(Integer value);\n    void onArraySetterCalled(ReadableArray value);\n    void onMapSetterCalled(ReadableMap value);\n    void onFloatGroupPropSetterCalled(int index, float value);\n    void onIntGroupPropSetterCalled(int index, int value);\n    void onBoxedIntGroupPropSetterCalled(int index, Integer value);\n  }\n\n  public static ReactStylesDiffMap buildStyles(Object... keysAndValues) {\n    return new ReactStylesDiffMap(JavaOnlyMap.of(keysAndValues));\n  }\n\n  private class ShadowViewUnderTest extends ReactShadowNodeImpl {\n\n    private ViewManagerUpdatesReceiver mViewManagerUpdatesReceiver;\n\n    private ShadowViewUnderTest(ViewManagerUpdatesReceiver viewManagerUpdatesReceiver) {\n      mViewManagerUpdatesReceiver = viewManagerUpdatesReceiver;\n    }\n\n    @ReactProp(name = \"boolProp\")\n    public void setBoolProp(boolean value) {\n      mViewManagerUpdatesReceiver.onBooleanSetterCalled(value);\n    }\n\n    @ReactProp(name = \"stringProp\")\n    public void setStringProp(@Nullable String value) {\n      mViewManagerUpdatesReceiver.onStringSetterCalled(value);\n    }\n\n    @ReactProp(name = \"boxedIntProp\")\n    public void setBoxedIntProp(@Nullable Integer value) {\n      mViewManagerUpdatesReceiver.onBoxedIntSetterCalled(value);\n    }\n\n    @ReactPropGroup(names = {\n      \"floatGroupPropFirst\",\n      \"floatGroupPropSecond\",\n    })\n    public void setFloatGroupProp(int index, float value) {\n      mViewManagerUpdatesReceiver.onFloatGroupPropSetterCalled(index, value);\n    }\n  }\n\n  private ViewManagerUpdatesReceiver mUpdatesReceiverMock;\n  private ShadowViewUnderTest mShadowView;\n\n  @Before\n  public void setup() {\n    mUpdatesReceiverMock = mock(ViewManagerUpdatesReceiver.class);\n    mShadowView = new ShadowViewUnderTest(mUpdatesReceiverMock);\n  }\n\n  @Test\n  public void testBooleanSetter() {\n    mShadowView.updateProperties(buildStyles(\"boolProp\", true));\n    verify(mUpdatesReceiverMock).onBooleanSetterCalled(true);\n    verifyNoMoreInteractions(mUpdatesReceiverMock);\n    reset(mUpdatesReceiverMock);\n\n    mShadowView.updateProperties(buildStyles(\"boolProp\", false));\n    verify(mUpdatesReceiverMock).onBooleanSetterCalled(false);\n    verifyNoMoreInteractions(mUpdatesReceiverMock);\n    reset(mUpdatesReceiverMock);\n\n    mShadowView.updateProperties(buildStyles(\"boolProp\", null));\n    verify(mUpdatesReceiverMock).onBooleanSetterCalled(false);\n    verifyNoMoreInteractions(mUpdatesReceiverMock);\n    reset(mUpdatesReceiverMock);\n  }\n\n  @Test\n  public void testStringSetter() {\n    mShadowView.updateProperties(buildStyles(\"stringProp\", \"someRandomString\"));\n    verify(mUpdatesReceiverMock).onStringSetterCalled(\"someRandomString\");\n    verifyNoMoreInteractions(mUpdatesReceiverMock);\n    reset(mUpdatesReceiverMock);\n\n    mShadowView.updateProperties(buildStyles(\"stringProp\", null));\n    verify(mUpdatesReceiverMock).onStringSetterCalled(null);\n    verifyNoMoreInteractions(mUpdatesReceiverMock);\n    reset(mUpdatesReceiverMock);\n  }\n\n  @Test\n  public void testFloatGroupSetter() {\n    mShadowView.updateProperties(buildStyles(\"floatGroupPropFirst\", 11.0));\n    verify(mUpdatesReceiverMock).onFloatGroupPropSetterCalled(0, 11.0f);\n    verifyNoMoreInteractions(mUpdatesReceiverMock);\n    reset(mUpdatesReceiverMock);\n\n    mShadowView.updateProperties(buildStyles(\"floatGroupPropSecond\", -111.0));\n    verify(mUpdatesReceiverMock).onFloatGroupPropSetterCalled(1, -111.0f);\n    verifyNoMoreInteractions(mUpdatesReceiverMock);\n    reset(mUpdatesReceiverMock);\n\n    mShadowView.updateProperties(buildStyles(\"floatGroupPropSecond\", null));\n    verify(mUpdatesReceiverMock).onFloatGroupPropSetterCalled(1, 0.0f);\n    verifyNoMoreInteractions(mUpdatesReceiverMock);\n    reset(mUpdatesReceiverMock);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropForShadowNodeSpecTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport android.view.View;\nimport com.facebook.react.uimanager.annotations.ReactProp;\nimport com.facebook.react.uimanager.annotations.ReactPropGroup;\nimport java.util.Map;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\n\n/**\n * Test that verifies that spec of methods annotated with @ReactProp in {@link ReactShadowNode} is\n * correct\n */\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class ReactPropForShadowNodeSpecTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private static class BaseViewManager extends ViewManager {\n\n    private final Class<? extends ReactShadowNode> mShadowNodeClass;\n\n    private BaseViewManager(Class<? extends ReactShadowNode> shadowNodeClass) {\n      mShadowNodeClass = shadowNodeClass;\n    }\n\n    @Override\n    public String getName() {\n      return \"IgnoredName\";\n    }\n\n    @Override\n    public ReactShadowNode createShadowNodeInstance() {\n      return null;\n    }\n\n    @Override\n    public Class getShadowNodeClass() {\n      return mShadowNodeClass;\n    }\n\n    @Override\n    protected View createViewInstance(ThemedReactContext reactContext) {\n      return null;\n    }\n\n    @Override\n    public void updateExtraData(View root, Object extraData) {\n    }\n  }\n\n  @Test(expected = RuntimeException.class)\n  public void testMethodWithWrongNumberOfParams() {\n    new BaseViewManager(\n            new ReactShadowNodeImpl() {\n              @ReactProp(name = \"prop\")\n              public void setterWithIncorrectNumberOfArgs(boolean value, int anotherValue) {}\n            }.getClass())\n        .getNativeProps();\n  }\n\n  @Test(expected = RuntimeException.class)\n  public void testMethodWithTooFewParams() {\n    new BaseViewManager(\n            new ReactShadowNodeImpl() {\n              @ReactProp(name = \"prop\")\n              public void setterWithNoArgs() {}\n            }.getClass())\n        .getNativeProps();\n  }\n\n  @Test(expected = RuntimeException.class)\n  public void testUnsupportedValueType() {\n    new BaseViewManager(\n            new ReactShadowNodeImpl() {\n              @ReactProp(name = \"prop\")\n              public void setterWithMap(Map value) {}\n            }.getClass())\n        .getNativeProps();\n  }\n\n  @Test(expected = RuntimeException.class)\n  public void testGroupInvalidNumberOfParams() {\n    new BaseViewManager(\n            new ReactShadowNodeImpl() {\n              @ReactPropGroup(names = {\"prop1\", \"prop2\"})\n              public void setterWithTooManyParams(int index, float value, boolean bool) {}\n            }.getClass())\n        .getNativeProps();\n  }\n\n  @Test(expected = RuntimeException.class)\n  public void testGroupTooFewParams() {\n    new BaseViewManager(\n            new ReactShadowNodeImpl() {\n              @ReactPropGroup(names = {\"prop1\", \"prop2\"})\n              public void setterWithTooManyParams(int index) {}\n            }.getClass())\n        .getNativeProps();\n  }\n\n  @Test(expected = RuntimeException.class)\n  public void testGroupNoIndexParam() {\n    new BaseViewManager(\n            new ReactShadowNodeImpl() {\n              @ReactPropGroup(names = {\"prop1\", \"prop2\"})\n              public void setterWithTooManyParams(float value, boolean bool) {}\n            }.getClass())\n        .getNativeProps();\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\nimport static org.mockito.Matchers.any;\nimport static org.mockito.Matchers.anyInt;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.common.MapBuilder;\nimport com.facebook.react.uimanager.events.EventDispatcher;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport org.fest.assertions.data.MapEntry;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\n\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class UIManagerModuleConstantsTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private static final String CUSTOM_BUBBLING_EVENT_TYPES = \"customBubblingEventTypes\";\n  private static final String CUSTOM_DIRECT_EVENT_TYPES = \"customDirectEventTypes\";\n\n  private static final Map TWIRL_BUBBLING_EVENT_MAP = MapBuilder.of(\n      \"phasedRegistrationNames\",\n      MapBuilder.of(\n          \"bubbled\",\n          \"onTwirl\",\n          \"captured\",\n          \"onTwirlCaptured\"));\n  private static final Map TWIRL_DIRECT_EVENT_MAP = MapBuilder.of(\"registrationName\", \"onTwirl\");\n\n  private ReactApplicationContext mReactContext;\n  private UIImplementationProvider mUIImplementationProvider;\n\n  @Before\n  public void setUp() {\n    mReactContext = new ReactApplicationContext(RuntimeEnvironment.application);\n    mUIImplementationProvider = mock(UIImplementationProvider.class);\n    when(mUIImplementationProvider.createUIImplementation(\n            any(ReactApplicationContext.class),\n            any(List.class),\n            any(EventDispatcher.class),\n            anyInt()))\n        .thenReturn(mock(UIImplementation.class));\n  }\n\n  @Test\n  public void testNoCustomConstants() {\n    List<ViewManager> viewManagers = Arrays.asList(mock(ViewManager.class));\n    UIManagerModule uiManagerModule =\n        new UIManagerModule(mReactContext, viewManagers, mUIImplementationProvider, 0);\n    Map<String, Object> constants = uiManagerModule.getConstants();\n    assertThat(constants)\n        .containsKey(CUSTOM_BUBBLING_EVENT_TYPES)\n        .containsKey(CUSTOM_DIRECT_EVENT_TYPES)\n        .containsKey(\"Dimensions\");\n  }\n\n  @Test\n  public void testCustomBubblingEvents() {\n    ViewManager mockViewManager = mock(ViewManager.class);\n    List<ViewManager> viewManagers = Arrays.asList(mockViewManager);\n    when(mockViewManager.getExportedCustomBubblingEventTypeConstants())\n        .thenReturn(MapBuilder.of(\"onTwirl\", TWIRL_BUBBLING_EVENT_MAP));\n    UIManagerModule uiManagerModule =\n        new UIManagerModule(mReactContext, viewManagers, mUIImplementationProvider, 0);\n    Map<String, Object> constants = uiManagerModule.getConstants();\n    assertThat((Map) constants.get(CUSTOM_BUBBLING_EVENT_TYPES))\n        .contains(MapEntry.entry(\"onTwirl\", TWIRL_BUBBLING_EVENT_MAP))\n        .containsKey(\"topChange\");\n  }\n\n  @Test\n  public void testCustomDirectEvents() {\n    ViewManager mockViewManager = mock(ViewManager.class);\n    List<ViewManager> viewManagers = Arrays.asList(mockViewManager);\n    when(mockViewManager.getExportedCustomDirectEventTypeConstants())\n        .thenReturn(MapBuilder.of(\"onTwirl\", TWIRL_DIRECT_EVENT_MAP));\n    UIManagerModule uiManagerModule =\n        new UIManagerModule(mReactContext, viewManagers, mUIImplementationProvider, 0);\n    Map<String, Object> constants = uiManagerModule.getConstants();\n    assertThat((Map) constants.get(CUSTOM_DIRECT_EVENT_TYPES))\n        .contains(MapEntry.entry(\"onTwirl\", TWIRL_DIRECT_EVENT_MAP))\n        .containsKey(\"topLoadingStart\");\n  }\n\n  @Test\n  public void testCustomViewConstants() {\n    ViewManager mockViewManager = mock(ViewManager.class);\n    List<ViewManager> viewManagers = Arrays.asList(mockViewManager);\n    when(mockViewManager.getName()).thenReturn(\"RedPandaPhotoOfTheDayView\");\n    when(mockViewManager.getExportedViewConstants())\n        .thenReturn(MapBuilder.of(\"PhotoSizeType\", MapBuilder.of(\"Small\", 1, \"Large\", 2)));\n    UIManagerModule uiManagerModule =\n        new UIManagerModule(mReactContext, viewManagers, mUIImplementationProvider, 0);\n    Map<String, Object> constants = uiManagerModule.getConstants();\n    assertThat(constants).containsKey(\"RedPandaPhotoOfTheDayView\");\n    assertThat((Map) constants.get(\"RedPandaPhotoOfTheDayView\")).containsKey(\"Constants\");\n    assertThat((Map) valueAtPath(constants, \"RedPandaPhotoOfTheDayView\", \"Constants\"))\n        .containsKey(\"PhotoSizeType\");\n  }\n\n  @Test\n  public void testNativeProps() {\n    ViewManager mockViewManager = mock(ViewManager.class);\n    List<ViewManager> viewManagers = Arrays.asList(mockViewManager);\n    when(mockViewManager.getName()).thenReturn(\"SomeView\");\n    when(mockViewManager.getNativeProps())\n        .thenReturn(MapBuilder.of(\"fooProp\", \"number\"));\n    UIManagerModule uiManagerModule =\n        new UIManagerModule(mReactContext, viewManagers, mUIImplementationProvider, 0);\n    Map<String, Object> constants = uiManagerModule.getConstants();\n    assertThat((String) valueAtPath(constants, \"SomeView\", \"NativeProps\", \"fooProp\"))\n        .isEqualTo(\"number\");\n  }\n\n  @Test\n  public void testMergeConstants() {\n    ViewManager managerX = mock(ViewManager.class);\n    when(managerX.getExportedCustomDirectEventTypeConstants()).thenReturn(MapBuilder.of(\n        \"onTwirl\",\n        MapBuilder.of(\n            \"registrationName\",\n            \"onTwirl\",\n            \"keyToOverride\",\n            \"valueX\",\n            \"mapToMerge\",\n            MapBuilder.of(\"keyToOverride\", \"innerValueX\", \"anotherKey\", \"valueX\"))));\n\n    ViewManager managerY = mock(ViewManager.class);\n    when(managerY.getExportedCustomDirectEventTypeConstants()).thenReturn(MapBuilder.of(\n        \"onTwirl\",\n        MapBuilder.of(\n            \"extraKey\",\n            \"extraValue\",\n            \"keyToOverride\",\n            \"valueY\",\n            \"mapToMerge\",\n            MapBuilder.of(\"keyToOverride\", \"innerValueY\", \"extraKey\", \"valueY\"))));\n\n    List<ViewManager> viewManagers = Arrays.asList(managerX, managerY);\n    UIManagerModule uiManagerModule =\n        new UIManagerModule(mReactContext, viewManagers, mUIImplementationProvider, 0);\n    Map<String, Object> constants = uiManagerModule.getConstants();\n    assertThat((Map) constants.get(CUSTOM_DIRECT_EVENT_TYPES)).containsKey(\"onTwirl\");\n\n    Map twirlMap = (Map) valueAtPath(constants, CUSTOM_DIRECT_EVENT_TYPES, \"onTwirl\");\n    assertThat(twirlMap)\n        .contains(MapEntry.entry(\"registrationName\", \"onTwirl\"))\n        .contains(MapEntry.entry(\"keyToOverride\", \"valueY\"))\n        .contains(MapEntry.entry(\"extraKey\", \"extraValue\"))\n        .containsKey(\"mapToMerge\");\n\n    Map mapToMerge = (Map) valueAtPath(twirlMap, \"mapToMerge\");\n    assertThat(mapToMerge)\n        .contains(MapEntry.entry(\"keyToOverride\", \"innerValueY\"))\n        .contains(MapEntry.entry(\"anotherKey\", \"valueX\"))\n        .contains(MapEntry.entry(\"extraKey\", \"valueY\"));\n  }\n\n  private static Object valueAtPath(Map nestedMap, String... keyPath) {\n    assertThat(keyPath).isNotEmpty();\n    Object value = nestedMap;\n    for (String key : keyPath) {\n      assertThat(value).isInstanceOf(Map.class);\n      nestedMap = (Map) value;\n      assertThat(nestedMap).containsKey(key);\n      value = nestedMap.get(key);\n    }\n    return value;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.uimanager;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\nimport static org.mockito.Matchers.any;\nimport static org.mockito.Mockito.doAnswer;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.spy;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\nimport android.graphics.Color;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.TextView;\nimport com.facebook.react.ReactRootView;\nimport com.facebook.react.animation.Animation;\nimport com.facebook.react.animation.AnimationPropertyUpdater;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.Callback;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.JavaOnlyArray;\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactTestHelper;\nimport com.facebook.react.modules.core.ChoreographerCompat;\nimport com.facebook.react.modules.core.ReactChoreographer;\nimport com.facebook.react.views.text.ReactRawTextManager;\nimport com.facebook.react.views.text.ReactRawTextShadowNode;\nimport com.facebook.react.views.text.ReactTextViewManager;\nimport com.facebook.react.views.view.ReactViewGroup;\nimport com.facebook.react.views.view.ReactViewManager;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.invocation.InvocationOnMock;\nimport org.mockito.stubbing.Answer;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\n\n/**\n * Tests for {@link UIManagerModule}.\n */\n@PrepareForTest({Arguments.class, ReactChoreographer.class})\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class UIManagerModuleTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private ReactApplicationContext mReactContext;\n  private CatalystInstance mCatalystInstanceMock;\n  private ArrayList<ChoreographerCompat.FrameCallback> mPendingFrameCallbacks;\n\n  @Before\n  public void setUp() {\n    PowerMockito.mockStatic(Arguments.class, ReactChoreographer.class);\n\n    ReactChoreographer choreographerMock = mock(ReactChoreographer.class);\n    PowerMockito.when(Arguments.createArray()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return new JavaOnlyArray();\n      }\n    });\n    PowerMockito.when(Arguments.createMap()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return new JavaOnlyMap();\n      }\n    });\n    PowerMockito.when(ReactChoreographer.getInstance()).thenReturn(choreographerMock);\n\n    mPendingFrameCallbacks = new ArrayList<>();\n    doAnswer(new Answer() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        mPendingFrameCallbacks\n            .add((ChoreographerCompat.FrameCallback) invocation.getArguments()[1]);\n        return null;\n      }\n    }).when(choreographerMock).postFrameCallback(\n        any(ReactChoreographer.CallbackType.class),\n        any(ChoreographerCompat.FrameCallback.class));\n\n    mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();\n    mReactContext = new ReactApplicationContext(RuntimeEnvironment.application);\n    mReactContext.initializeWithInstance(mCatalystInstanceMock);\n\n    UIManagerModule uiManagerModuleMock = mock(UIManagerModule.class);\n    when(mCatalystInstanceMock.getNativeModule(UIManagerModule.class))\n        .thenReturn(uiManagerModuleMock);\n  }\n\n  @Test\n  public void testCreateSimpleHierarchy() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ViewGroup rootView = createSimpleTextHierarchy(uiManager, \"Some text\");\n\n    assertThat(rootView.getChildCount()).isEqualTo(1);\n\n    View firstChild = rootView.getChildAt(0);\n    assertThat(firstChild).isInstanceOf(TextView.class);\n    assertThat(((TextView) firstChild).getText().toString()).isEqualTo(\"Some text\");\n  }\n\n  @Test\n  public void testUpdateSimpleHierarchy() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ViewGroup rootView = createSimpleTextHierarchy(uiManager, \"Some text\");\n    TextView textView = (TextView) rootView.getChildAt(0);\n\n    int rawTextTag = 3;\n    uiManager.updateView(\n        rawTextTag,\n        ReactRawTextManager.REACT_CLASS,\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"New text\"));\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertThat(textView.getText().toString()).isEqualTo(\"New text\");\n  }\n\n  @Test\n  public void testHierarchyWithView() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView =\n        new ReactRootView(RuntimeEnvironment.application.getApplicationContext());\n    int rootTag = uiManager.addRootView(rootView);\n    int viewTag = rootTag + 1;\n    int subViewTag = viewTag + 1;\n\n    uiManager.createView(\n        viewTag,\n        ReactViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n    uiManager.createView(\n        subViewTag,\n        ReactViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n\n    uiManager.manageChildren(\n        viewTag,\n        null,\n        null,\n        JavaOnlyArray.of(subViewTag),\n        JavaOnlyArray.of(0),\n        null);\n\n    uiManager.manageChildren(\n        rootTag,\n        null,\n        null,\n        JavaOnlyArray.of(viewTag),\n        JavaOnlyArray.of(0),\n        null);\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertThat(rootView.getChildCount()).isEqualTo(1);\n\n    ViewGroup child = (ViewGroup) rootView.getChildAt(0);\n    assertThat(child.getChildCount()).isEqualTo(1);\n\n    ViewGroup grandchild = (ViewGroup) child.getChildAt(0);\n    assertThat(grandchild).isInstanceOf(ViewGroup.class);\n    assertThat(grandchild.getChildCount()).isEqualTo(0);\n  }\n\n  @Test\n  public void testMoveViews() {\n    UIManagerModule uiManager = getUIManagerModule();\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    View expectedViewAt0 = hierarchy.nativeRootView.getChildAt(1);\n    View expectedViewAt1 = hierarchy.nativeRootView.getChildAt(2);\n    View expectedViewAt2 = hierarchy.nativeRootView.getChildAt(0);\n    View expectedViewAt3 = hierarchy.nativeRootView.getChildAt(3);\n\n    uiManager.manageChildren(\n        hierarchy.rootView,\n        JavaOnlyArray.of(1, 0, 2),\n        JavaOnlyArray.of(0, 2, 1),\n        null,\n        null,\n        null);\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertChildrenAreExactly(\n        hierarchy.nativeRootView,\n        expectedViewAt0,\n        expectedViewAt1,\n        expectedViewAt2,\n        expectedViewAt3);\n  }\n\n  @Test\n  public void testDeleteViews() {\n    UIManagerModule uiManager = getUIManagerModule();\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    View expectedViewAt0 = hierarchy.nativeRootView.getChildAt(1);\n    View expectedViewAt1 = hierarchy.nativeRootView.getChildAt(2);\n\n    uiManager.manageChildren(\n        hierarchy.rootView,\n        null,\n        null,\n        null,\n        null,\n        JavaOnlyArray.of(0, 3));\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertChildrenAreExactly(\n        hierarchy.nativeRootView,\n        expectedViewAt0,\n        expectedViewAt1);\n  }\n\n  @Test\n  public void testMoveAndDeleteViews() {\n    UIManagerModule uiManager = getUIManagerModule();\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    View expectedViewAt0 = hierarchy.nativeRootView.getChildAt(0);\n    View expectedViewAt1 = hierarchy.nativeRootView.getChildAt(3);\n    View expectedViewAt2 = hierarchy.nativeRootView.getChildAt(2);\n\n    uiManager.manageChildren(\n        hierarchy.rootView,\n        JavaOnlyArray.of(3),\n        JavaOnlyArray.of(1),\n        null,\n        null,\n        JavaOnlyArray.of(1));\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertChildrenAreExactly(\n        hierarchy.nativeRootView,\n        expectedViewAt0,\n        expectedViewAt1,\n        expectedViewAt2);\n  }\n\n  @Test(expected = IllegalViewOperationException.class)\n  public void testMoveAndDeleteRemoveViewsDuplicateRemove() {\n    UIManagerModule uiManager = getUIManagerModule();\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    uiManager.manageChildren(\n        hierarchy.rootView,\n        JavaOnlyArray.of(3),\n        JavaOnlyArray.of(1),\n        null,\n        null,\n        JavaOnlyArray.of(3));\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n  }\n\n  @Test(expected = IllegalViewOperationException.class)\n  public void testDuplicateRemove() {\n    UIManagerModule uiManager = getUIManagerModule();\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    uiManager.manageChildren(\n        hierarchy.rootView,\n        null,\n        null,\n        null,\n        null,\n        JavaOnlyArray.of(3, 3));\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n  }\n\n  @Test\n  public void testMoveAndAddViews() {\n    UIManagerModule uiManager = getUIManagerModule();\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    int textViewTag = 1000;\n    uiManager.createView(\n        textViewTag,\n        ReactTextViewManager.REACT_CLASS,\n        hierarchy.rootView,\n        JavaOnlyMap.of(\"collapsable\", false));\n\n    View expectedViewAt0 = hierarchy.nativeRootView.getChildAt(0);\n    View expectedViewAt1 = hierarchy.nativeRootView.getChildAt(3);\n    View expectedViewAt3 = hierarchy.nativeRootView.getChildAt(1);\n    View expectedViewAt4 = hierarchy.nativeRootView.getChildAt(2);\n\n    uiManager.manageChildren(\n        hierarchy.rootView,\n        JavaOnlyArray.of(1, 2, 3),\n        JavaOnlyArray.of(3, 4, 1),\n        JavaOnlyArray.of(textViewTag),\n        JavaOnlyArray.of(2),\n        null);\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertThat(hierarchy.nativeRootView.getChildCount()).isEqualTo(5);\n    assertThat(hierarchy.nativeRootView.getChildAt(0)).isEqualTo(expectedViewAt0);\n    assertThat(hierarchy.nativeRootView.getChildAt(1)).isEqualTo(expectedViewAt1);\n    assertThat(hierarchy.nativeRootView.getChildAt(3)).isEqualTo(expectedViewAt3);\n    assertThat(hierarchy.nativeRootView.getChildAt(4)).isEqualTo(expectedViewAt4);\n  }\n\n  @Test\n  public void testMoveViewsWithChildren() {\n    UIManagerModule uiManager = getUIManagerModule();\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    View expectedViewAt0 = hierarchy.nativeRootView.getChildAt(0);\n    View expectedViewAt1 = hierarchy.nativeRootView.getChildAt(2);\n    View expectedViewAt2 = hierarchy.nativeRootView.getChildAt(1);\n    View expectedViewAt3 = hierarchy.nativeRootView.getChildAt(3);\n\n    uiManager.manageChildren(\n        hierarchy.rootView,\n        JavaOnlyArray.of(1, 2),\n        JavaOnlyArray.of(2, 1),\n        null,\n        null,\n        null);\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertChildrenAreExactly(\n        hierarchy.nativeRootView,\n        expectedViewAt0,\n        expectedViewAt1,\n        expectedViewAt2,\n        expectedViewAt3);\n    assertThat(((ViewGroup) hierarchy.nativeRootView.getChildAt(2)).getChildCount()).isEqualTo(2);\n  }\n\n  @Test\n  public void testDeleteViewsWithChildren() {\n    UIManagerModule uiManager = getUIManagerModule();\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    View expectedViewAt0 = hierarchy.nativeRootView.getChildAt(0);\n    View expectedViewAt1 = hierarchy.nativeRootView.getChildAt(2);\n    View expectedViewAt2 = hierarchy.nativeRootView.getChildAt(3);\n\n    uiManager.manageChildren(\n        hierarchy.rootView,\n        null,\n        null,\n        null,\n        null,\n        JavaOnlyArray.of(1));\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertChildrenAreExactly(\n        hierarchy.nativeRootView,\n        expectedViewAt0,\n        expectedViewAt1,\n        expectedViewAt2);\n  }\n\n  @Test\n  public void testLayoutAppliedToNodes() throws Exception {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    int newViewTag = 10000;\n    uiManager.createView(\n        newViewTag,\n        ReactViewManager.REACT_CLASS,\n        hierarchy.rootView,\n        JavaOnlyMap\n            .of(\"left\", 10.0, \"top\", 20.0, \"width\", 30.0, \"height\", 40.0, \"collapsable\", false));\n\n    uiManager.manageChildren(\n        hierarchy.rootView,\n        null,\n        null,\n        JavaOnlyArray.of(newViewTag),\n        JavaOnlyArray.of(4),\n        null);\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    View newView = hierarchy.nativeRootView.getChildAt(4);\n    assertThat(newView.getLeft()).isEqualTo(10);\n    assertThat(newView.getTop()).isEqualTo(20);\n\n    assertThat(newView.getWidth()).isEqualTo(30);\n    assertThat(newView.getHeight()).isEqualTo(40);\n  }\n\n  /**\n   * This is to make sure we execute enqueued operations in the order given by JS.\n   */\n  @Test\n  public void testAddUpdateRemoveInSingleBatch() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    int newViewTag = 10000;\n    uiManager.createView(\n        newViewTag,\n        ReactViewManager.REACT_CLASS,\n        hierarchy.rootView,\n        JavaOnlyMap.of(\"collapsable\", false));\n\n    uiManager.manageChildren(\n        hierarchy.rootView,\n        null,\n        null,\n        JavaOnlyArray.of(newViewTag),\n        JavaOnlyArray.of(4),\n        null);\n\n    uiManager.updateView(\n        newViewTag,\n        ReactViewManager.REACT_CLASS,\n        JavaOnlyMap.of(\"backgroundColor\", Color.RED));\n\n    uiManager.manageChildren(\n        hierarchy.rootView,\n        null,\n        null,\n        null,\n        null,\n        JavaOnlyArray.of(4));\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertThat(hierarchy.nativeRootView.getChildCount()).isEqualTo(4);\n  }\n\n  @Test\n  public void testTagsAssignment() {\n    UIManagerModule uiManager = getUIManagerModule();\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    View view0 = hierarchy.nativeRootView.getChildAt(0);\n    assertThat(view0.getId()).isEqualTo(hierarchy.view0);\n\n    View viewWithChildren1 = hierarchy.nativeRootView.getChildAt(1);\n    assertThat(viewWithChildren1.getId()).isEqualTo(hierarchy.viewWithChildren1);\n\n    View childView0 = ((ViewGroup) viewWithChildren1).getChildAt(0);\n    assertThat(childView0.getId()).isEqualTo(hierarchy.childView0);\n\n    View childView1 = ((ViewGroup) viewWithChildren1).getChildAt(1);\n    assertThat(childView1.getId()).isEqualTo(hierarchy.childView1);\n\n    View view2 = hierarchy.nativeRootView.getChildAt(2);\n    assertThat(view2.getId()).isEqualTo(hierarchy.view2);\n\n    View view3 = hierarchy.nativeRootView.getChildAt(3);\n    assertThat(view3.getId()).isEqualTo(hierarchy.view3);\n  }\n\n  @Test\n  public void testLayoutPropertyUpdatingOnlyOnLayoutChange() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    // Update layout to some values, this way we can verify it hasn't been updated, because the\n    // update process would normally reset it back to some non-negative value\n    View view0 = hierarchy.nativeRootView.getChildAt(0);\n    view0.layout(1, 2, 3, 4);\n\n    // verify that X get updated when we update layout properties\n    uiManager.updateView(\n        hierarchy.view0,\n        ReactViewManager.REACT_CLASS,\n        JavaOnlyMap.of(\"left\", 10.0, \"top\", 20.0, \"width\", 30.0, \"height\", 40.0));\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n    assertThat(view0.getLeft()).isGreaterThan(2);\n\n    // verify that the layout doesn't get updated when we update style property not affecting the\n    // position (e.g., background-color)\n    view0.layout(1, 2, 3, 4);\n    uiManager.updateView(\n        hierarchy.view0,\n        ReactViewManager.REACT_CLASS,\n        JavaOnlyMap.of(\"backgroundColor\", Color.RED));\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n    assertThat(view0.getLeft()).isEqualTo(1);\n  }\n\n  private static class AnimationStub extends Animation {\n\n    public AnimationStub(int animationID, AnimationPropertyUpdater propertyUpdater) {\n      super(animationID, propertyUpdater);\n    }\n\n    @Override\n    public void run() {\n    }\n  }\n\n  @Test\n  public void testAddAndRemoveAnimation() {\n    UIManagerModule uiManagerModule = getUIManagerModule();\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManagerModule);\n\n    AnimationPropertyUpdater mockPropertyUpdater = mock(AnimationPropertyUpdater.class);\n    Animation mockAnimation = spy(new AnimationStub(1000, mockPropertyUpdater));\n    Callback callbackMock = mock(Callback.class);\n\n    int rootTag = hierarchy.rootView;\n    uiManagerModule.createView(\n        hierarchy.rootView,\n        ReactViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n\n    uiManagerModule.registerAnimation(mockAnimation);\n    uiManagerModule.addAnimation(hierarchy.rootView, 1000, callbackMock);\n    uiManagerModule.removeAnimation(hierarchy.rootView, 1000);\n\n    uiManagerModule.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    verify(callbackMock, times(1)).invoke(false);\n    verify(mockAnimation).run();\n    verify(mockAnimation).cancel();\n  }\n\n  /**\n   * Makes sure replaceExistingNonRootView by replacing a view with a new view that has a background\n   * color set.\n   */\n  @Test\n  public void testReplaceExistingNonRootView() {\n    UIManagerModule uiManager = getUIManagerModule();\n    TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager);\n\n    int newViewTag = 1234;\n    uiManager.createView(\n        newViewTag,\n        ReactViewManager.REACT_CLASS,\n        hierarchy.rootView,\n        JavaOnlyMap.of(\"backgroundColor\", Color.RED));\n\n    uiManager.replaceExistingNonRootView(hierarchy.view2, newViewTag);\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertThat(hierarchy.nativeRootView.getChildCount()).isEqualTo(4);\n    assertThat(hierarchy.nativeRootView.getChildAt(2)).isInstanceOf(ReactViewGroup.class);\n    ReactViewGroup view = (ReactViewGroup) hierarchy.nativeRootView.getChildAt(2);\n    assertThat(view.getBackgroundColor()).isEqualTo(Color.RED);\n  }\n\n  /**\n   * Verifies removeSubviewsFromContainerWithID works by adding subviews, removing them, and\n   * checking that the final number of children is correct.\n   */\n  @Test\n  public void testRemoveSubviewsFromContainerWithID() {\n    UIManagerModule uiManager = getUIManagerModule();\n    ReactRootView rootView =\n        new ReactRootView(RuntimeEnvironment.application.getApplicationContext());\n    int rootTag = uiManager.addRootView(rootView);\n\n    final int containerTag = rootTag + 1;\n    final int containerSiblingTag = containerTag + 1;\n\n    uiManager.createView(\n        containerTag,\n        ReactViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n    uiManager.createView(\n        containerSiblingTag,\n        ReactViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n    addChild(uiManager, rootTag, containerTag, 0);\n    addChild(uiManager, rootTag, containerSiblingTag, 1);\n\n    uiManager.createView(\n        containerTag + 2,\n        ReactTextViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n    uiManager.createView(\n        containerTag + 3,\n        ReactTextViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n    addChild(uiManager, containerTag, containerTag + 2, 0);\n    addChild(uiManager, containerTag, containerTag + 3, 1);\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertThat(rootView.getChildCount()).isEqualTo(2);\n    assertThat(((ViewGroup) rootView.getChildAt(0)).getChildCount()).isEqualTo(2);\n\n    uiManager.removeSubviewsFromContainerWithID(containerTag);\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    assertThat(rootView.getChildCount()).isEqualTo(2);\n    assertThat(((ViewGroup) rootView.getChildAt(0)).getChildCount()).isEqualTo(0);\n  }\n\n  /**\n   * Assuming no other views have been created, the root view will have tag 1, Text tag 2, and\n   * RawText tag 3.\n   */\n  private ViewGroup createSimpleTextHierarchy(UIManagerModule uiManager, String text) {\n    ReactRootView rootView =\n        new ReactRootView(RuntimeEnvironment.application.getApplicationContext());\n    int rootTag = uiManager.addRootView(rootView);\n    int textTag = rootTag + 1;\n    int rawTextTag = textTag + 1;\n\n    uiManager.createView(\n        textTag,\n        ReactTextViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n    uiManager.createView(\n        rawTextTag,\n        ReactRawTextManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, text, \"collapsable\", false));\n\n    uiManager.manageChildren(\n        textTag,\n        null,\n        null,\n        JavaOnlyArray.of(rawTextTag),\n        JavaOnlyArray.of(0),\n        null);\n\n    uiManager.manageChildren(\n        rootTag,\n        null,\n        null,\n        JavaOnlyArray.of(textTag),\n        JavaOnlyArray.of(0),\n        null);\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    return rootView;\n  }\n\n  private TestMoveDeleteHierarchy createMoveDeleteHierarchy(UIManagerModule uiManager) {\n    ReactRootView rootView = new ReactRootView(mReactContext);\n    int rootTag = uiManager.addRootView(rootView);\n\n    TestMoveDeleteHierarchy hierarchy = new TestMoveDeleteHierarchy(rootView, rootTag);\n\n    uiManager.createView(\n        hierarchy.view0,\n        ReactViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n    uiManager.createView(\n        hierarchy.viewWithChildren1,\n        ReactViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n    uiManager.createView(\n        hierarchy.view2,\n        ReactViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n    uiManager.createView(\n        hierarchy.view3,\n        ReactViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n    uiManager.createView(\n        hierarchy.childView0,\n        ReactViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n    uiManager.createView(\n        hierarchy.childView1,\n        ReactViewManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\"collapsable\", false));\n\n    addChild(uiManager, rootTag, hierarchy.view0, 0);\n    addChild(uiManager, rootTag, hierarchy.viewWithChildren1, 1);\n    addChild(uiManager, rootTag, hierarchy.view2, 2);\n    addChild(uiManager, rootTag, hierarchy.view3, 3);\n\n    addChild(uiManager, hierarchy.viewWithChildren1, hierarchy.childView0, 0);\n    addChild(uiManager, hierarchy.viewWithChildren1, hierarchy.childView1, 1);\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n\n    return hierarchy;\n  }\n\n  private void addChild(UIManagerModule uiManager, int parentTag, int childTag, int index) {\n    uiManager.manageChildren(\n        parentTag,\n        null,\n        null,\n        JavaOnlyArray.of(childTag),\n        JavaOnlyArray.of(index),\n        null);\n  }\n\n  private void assertChildrenAreExactly(ViewGroup parent, View... views) {\n    assertThat(parent.getChildCount()).isEqualTo(views.length);\n    for (int i = 0; i < views.length; i++) {\n      assertThat(parent.getChildAt(i))\n          .describedAs(\"View at \" + i)\n          .isEqualTo(views[i]);\n    }\n  }\n\n  /**\n   * Holder for the tags that represent that represent views in the following hierarchy:\n   *  - View rootView\n   *    - View view0\n   *    - View viewWithChildren1\n   *      - View childView0\n   *      - View childView1\n   *    - View view2\n   *    - View view3\n   *\n   * This hierarchy is used to test move/delete functionality in manageChildren.\n   */\n  private static class TestMoveDeleteHierarchy {\n\n    public ReactRootView nativeRootView;\n    public int rootView;\n    public int view0;\n    public int viewWithChildren1;\n    public int view2;\n    public int view3;\n    public int childView0;\n    public int childView1;\n\n    public TestMoveDeleteHierarchy(ReactRootView nativeRootView, int rootViewTag) {\n      this.nativeRootView = nativeRootView;\n      rootView = rootViewTag;\n      view0 = rootView + 1;\n      viewWithChildren1 = rootView + 2;\n      view2 = rootView + 3;\n      view3 = rootView + 4;\n      childView0 = rootView + 5;\n      childView1 = rootView + 6;\n    }\n  }\n\n  private void executePendingFrameCallbacks() {\n    ArrayList<ChoreographerCompat.FrameCallback> callbacks =\n        new ArrayList<>(mPendingFrameCallbacks);\n    mPendingFrameCallbacks.clear();\n    for (ChoreographerCompat.FrameCallback frameCallback : callbacks) {\n      frameCallback.doFrame(0);\n    }\n  }\n\n  private UIManagerModule getUIManagerModule() {\n    List<ViewManager> viewManagers = Arrays.<ViewManager>asList(\n        new ReactViewManager(),\n        new ReactTextViewManager(),\n        new ReactRawTextManager());\n    UIManagerModule uiManagerModule =\n        new UIManagerModule(mReactContext, viewManagers, new UIImplementationProvider(), 0);\n    uiManagerModule.onHostResume();\n    return uiManagerModule;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/views/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nrn_robolectric_test(\n    name = \"views\",\n    # TODO Disabled temporarily until Yoga linking is fixed t14964130\n    # srcs = glob(['**/*.java']),\n    srcs = glob([\"image/*.java\"]),\n    # Please change the contact to the oncall of your team\n    contacts = [\"oncall+fbandroid_sheriff@xmail.facebook.com\"],\n    deps = [\n        YOGA_TARGET,\n        react_native_dep(\"libraries/fbcore/src/test/java/com/facebook/powermock:powermock\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-drawee\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:fresco-react-native\"),\n        react_native_dep(\"libraries/fresco/fresco-react-native:imagepipeline\"),\n        react_native_dep(\"third-party/java/fest:fest\"),\n        react_native_dep(\"third-party/java/jsr-305:jsr-305\"),\n        react_native_dep(\"third-party/java/junit:junit\"),\n        react_native_dep(\"third-party/java/mockito:mockito\"),\n        react_native_dep(\"third-party/java/okhttp:okhttp3\"),\n        react_native_dep(\"third-party/java/okio:okio\"),\n        react_native_dep(\"third-party/java/robolectric3/robolectric:robolectric\"),\n        react_native_target(\"java/com/facebook/react:react\"),\n        react_native_target(\"java/com/facebook/react/bridge:bridge\"),\n        react_native_target(\"java/com/facebook/react/common:common\"),\n        react_native_target(\"java/com/facebook/react/touch:touch\"),\n        react_native_target(\"java/com/facebook/react/uimanager:uimanager\"),\n        react_native_target(\"java/com/facebook/react/uimanager/annotations:annotations\"),\n        react_native_target(\"java/com/facebook/react/views/image:image\"),\n        react_native_target(\"java/com/facebook/react/views/slider:slider\"),\n        react_native_target(\"java/com/facebook/react/views/text:text\"),\n        react_native_target(\"java/com/facebook/react/views/textinput:textinput\"),\n        react_native_target(\"java/com/facebook/react/views/view:view\"),\n        react_native_tests_target(\"java/com/facebook/react/bridge:testhelpers\"),\n    ],\n)\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/views/image/ImageResizeModeTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.image;\n\nimport com.facebook.drawee.drawable.ScalingUtils;\n\nimport org.junit.Rule;\nimport org.junit.runner.RunWith;\nimport org.junit.Test;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\n\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class ImageResizeModeTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  @Test\n  public void testImageResizeMode() {\n    assertThat(ImageResizeMode.toScaleType(null))\n        .isEqualTo(ScalingUtils.ScaleType.CENTER_CROP);\n\n    assertThat(ImageResizeMode.toScaleType(\"contain\"))\n        .isEqualTo(ScalingUtils.ScaleType.FIT_CENTER);\n\n    assertThat(ImageResizeMode.toScaleType(\"cover\"))\n        .isEqualTo(ScalingUtils.ScaleType.CENTER_CROP);\n\n    assertThat(ImageResizeMode.toScaleType(\"stretch\"))\n        .isEqualTo(ScalingUtils.ScaleType.FIT_XY);\n\n    assertThat(ImageResizeMode.toScaleType(\"center\"))\n        .isEqualTo(ScalingUtils.ScaleType.CENTER_INSIDE);\n\n    // No resizeMode set\n    assertThat(ImageResizeMode.defaultValue())\n        .isEqualTo(ScalingUtils.ScaleType.CENTER_CROP);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/views/image/ReactImagePropertyTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.image;\n\nimport android.graphics.Color;\nimport android.util.DisplayMetrics;\n\nimport com.facebook.drawee.backends.pipeline.Fresco;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.JavaOnlyArray;\nimport com.facebook.react.bridge.ReactTestHelper;\nimport com.facebook.react.bridge.JSApplicationIllegalArgumentException;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.uimanager.ReactStylesDiffMap;\nimport com.facebook.react.uimanager.DisplayMetricsHolder;\nimport com.facebook.react.uimanager.ThemedReactContext;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.Rule;\nimport org.junit.runner.RunWith;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\nimport org.robolectric.Robolectric;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertNotNull;\nimport static org.junit.Assert.assertNull;\n\n/**\n * Verify that {@link ScalingUtils} properties are being applied correctly\n * by {@link ReactImageManager}.\n */\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class ReactImagePropertyTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private ReactApplicationContext mContext;\n  private CatalystInstance mCatalystInstanceMock;\n  private ThemedReactContext mThemeContext;\n\n  @Before\n  public void setup() {\n    mContext = new ReactApplicationContext(RuntimeEnvironment.application);\n    mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();\n    mContext.initializeWithInstance(mCatalystInstanceMock);\n    mThemeContext = new ThemedReactContext(mContext, mContext);\n    Fresco.initialize(mContext);\n    DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());\n  }\n\n  @After\n  public void teardown() {\n    DisplayMetricsHolder.setWindowDisplayMetrics(null);\n  }\n\n  public ReactStylesDiffMap buildStyles(Object... keysAndValues) {\n    return new ReactStylesDiffMap(JavaOnlyMap.of(keysAndValues));\n  }\n\n  @Test(expected=JSApplicationIllegalArgumentException.class)\n  public void testImageInvalidResizeMode() {\n    ReactImageManager viewManager = new ReactImageManager();\n    ReactImageView view = viewManager.createViewInstance(mThemeContext);\n    viewManager.updateProperties(view, buildStyles(\"resizeMode\", \"pancakes\"));\n  }\n\n  @Test\n  public void testBorderColor() {\n    ReactImageManager viewManager = new ReactImageManager();\n    ReactImageView view = viewManager.createViewInstance(mThemeContext);\n    viewManager.updateProperties(\n      view,\n      buildStyles(\"src\", JavaOnlyArray.of(JavaOnlyMap.of(\"uri\", \"http://mysite.com/mypic.jpg\"))));\n\n    viewManager.updateProperties(view, buildStyles(\"borderColor\", Color.argb(0, 0, 255, 255)));\n    int borderColor = view.getHierarchy().getRoundingParams().getBorderColor();\n    assertEquals(0, Color.alpha(borderColor));\n    assertEquals(0, Color.red(borderColor));\n    assertEquals(255, Color.green(borderColor));\n    assertEquals(255, Color.blue(borderColor));\n\n    viewManager.updateProperties(view, buildStyles(\"borderColor\", Color.argb(0, 255, 50, 128)));\n    borderColor = view.getHierarchy().getRoundingParams().getBorderColor();\n    assertEquals(0, Color.alpha(borderColor));\n    assertEquals(255, Color.red(borderColor));\n    assertEquals(50, Color.green(borderColor));\n    assertEquals(128, Color.blue(borderColor));\n\n    viewManager.updateProperties(view, buildStyles(\"borderColor\", null));\n    borderColor = view.getHierarchy().getRoundingParams().getBorderColor();\n    assertEquals(0, Color.alpha(borderColor));\n    assertEquals(0, Color.red(borderColor));\n    assertEquals(0, Color.green(borderColor));\n    assertEquals(0, Color.blue(borderColor));\n  }\n\n  @Test\n  public void testRoundedCorners() {\n    ReactImageManager viewManager = new ReactImageManager();\n    ReactImageView view = viewManager.createViewInstance(mThemeContext);\n    viewManager.updateProperties(\n      view,\n      buildStyles(\"src\", JavaOnlyArray.of(JavaOnlyMap.of(\"uri\", \"http://mysite.com/mypic.jpg\"))));\n\n    // We can't easily verify if rounded corner was honored or not, this tests simply verifies\n    // we're not crashing..\n    viewManager.updateProperties(view, buildStyles(\"borderRadius\", (double) 10));\n    viewManager.updateProperties(view, buildStyles(\"borderRadius\", (double) 0));\n    viewManager.updateProperties(view, buildStyles(\"borderRadius\", null));\n  }\n\n  @Test\n  public void testTintColor() {\n    ReactImageManager viewManager = new ReactImageManager();\n    ReactImageView view = viewManager.createViewInstance(mThemeContext);\n    assertNull(view.getColorFilter());\n    viewManager.updateProperties(view, buildStyles(\"tintColor\", Color.argb(50, 0, 0, 255)));\n            // Can't actually assert the specific color so this is the next best thing.\n            // Does the color filter now exist?\n            assertNotNull(view.getColorFilter());\n    viewManager.updateProperties(view, buildStyles(\"tintColor\", null));\n    assertNull(view.getColorFilter());\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/views/slider/ReactSliderPropertyTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.slider;\n\nimport android.widget.SeekBar;\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactTestHelper;\nimport com.facebook.react.uimanager.ReactStylesDiffMap;\nimport com.facebook.react.uimanager.ThemedReactContext;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\n\n/**\n * Verify {@link SeekBar} view property being applied properly by {@link ReactSliderManager}\n */\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class ReactSliderPropertyTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private ThemedReactContext mThemedContext;\n  private ReactSliderManager mManager;\n\n  @Before\n  public void setup() {\n    ReactApplicationContext mContext = new ReactApplicationContext(RuntimeEnvironment.application);\n    CatalystInstance mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();\n    mContext.initializeWithInstance(mCatalystInstanceMock);\n    mThemedContext = new ThemedReactContext(mContext, mContext);\n    mManager = new ReactSliderManager();\n  }\n\n  public ReactStylesDiffMap buildStyles(Object... keysAndValues) {\n    return new ReactStylesDiffMap(JavaOnlyMap.of(keysAndValues));\n  }\n\n  @Test\n  public void testValueWithMaxValue() {\n    ReactSlider view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles(\"maximumValue\", 10.0));\n    mManager.updateProperties(view, buildStyles(\"value\", 5.5));\n    assertThat(view.getProgress()).isEqualTo(70);\n  }\n\n  @Test\n  public void testValueWithMaxValueSetBeforeMinValue() {\n    ReactSlider view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles(\"maximumValue\", 10.0));\n    mManager.updateProperties(view, buildStyles(\"minimumValue\", 5.0));\n    mManager.updateProperties(view, buildStyles(\"value\", 5.5));\n    assertThat(view.getProgress()).isEqualTo(13);\n  }\n\n  @Test\n  public void testValueWithMinValueSetBeforeMaxValue() {\n    ReactSlider view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles(\"minimumValue\", 5.0));\n    mManager.updateProperties(view, buildStyles(\"maximumValue\", 10.0));\n    mManager.updateProperties(view, buildStyles(\"value\", 5.5));\n    assertThat(view.getProgress()).isEqualTo(13);\n  }\n\n  @Test\n  public void testValueWithMaxValueAndStep() {\n    ReactSlider view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles(\"maximumValue\", 10.0));\n    mManager.updateProperties(view, buildStyles(\"step\", 3.0));\n    mManager.updateProperties(view, buildStyles(\"value\", 5.5));\n    assertThat(view.getProgress()).isEqualTo(2);\n  }\n\n  @Test\n  public void testValueWithMaxValueAndMinValueAndStep() {\n    ReactSlider view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles(\"maximumValue\", 10.0));\n    mManager.updateProperties(view, buildStyles(\"minimumValue\", 5.0));\n    mManager.updateProperties(view, buildStyles(\"step\", 3.0));\n    mManager.updateProperties(view, buildStyles(\"value\", 10.0));\n    assertThat(view.getProgress()).isEqualTo(2);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/views/text/CustomLineHeightSpanTest.java",
    "content": "package com.facebook.react.views.text;\n\nimport android.graphics.Paint;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.robolectric.RobolectricTestRunner;\n\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class CustomLineHeightSpanTest {\n\n  @Test\n  public void shouldIncreaseAllMetricsProportionally() {\n    CustomLineHeightSpan customLineHeightSpan = new CustomLineHeightSpan(22);\n    Paint.FontMetricsInt fm = new Paint.FontMetricsInt();\n    fm.top = -10;\n    fm.ascent = -5;\n    fm.descent = 5;\n    fm.bottom = 10;\n    customLineHeightSpan.chooseHeight(\"Hi\", 0, 2, 0, 0, fm);\n    assertThat(fm.top).isEqualTo(-11);\n    assertThat(fm.ascent).isEqualTo(-6);\n    assertThat(fm.descent).isEqualTo(6);\n    assertThat(fm.bottom).isEqualTo(11);\n  }\n\n  @Test\n  public void shouldReduceTopFirst() {\n    CustomLineHeightSpan customLineHeightSpan = new CustomLineHeightSpan(19);\n    Paint.FontMetricsInt fm = new Paint.FontMetricsInt();\n    fm.top = -10;\n    fm.ascent = -5;\n    fm.descent = 5;\n    fm.bottom = 10;\n    customLineHeightSpan.chooseHeight(\"Hi\", 0, 2, 0, 0, fm);\n    assertThat(fm.top).isEqualTo(-9);\n    assertThat(fm.ascent).isEqualTo(-5);\n    assertThat(fm.descent).isEqualTo(5);\n    assertThat(fm.bottom).isEqualTo(10);\n  }\n\n  @Test\n  public void shouldReduceBottomSecond() {\n    CustomLineHeightSpan customLineHeightSpan = new CustomLineHeightSpan(14);\n    Paint.FontMetricsInt fm = new Paint.FontMetricsInt();\n    fm.top = -10;\n    fm.ascent = -5;\n    fm.descent = 5;\n    fm.bottom = 10;\n    customLineHeightSpan.chooseHeight(\"Hi\", 0, 2, 0, 0, fm);\n    assertThat(fm.top).isEqualTo(-5);\n    assertThat(fm.ascent).isEqualTo(-5);\n    assertThat(fm.descent).isEqualTo(5);\n    assertThat(fm.bottom).isEqualTo(9);\n  }\n\n  @Test\n  public void shouldReduceAscentThird() {\n    CustomLineHeightSpan customLineHeightSpan = new CustomLineHeightSpan(9);\n    Paint.FontMetricsInt fm = new Paint.FontMetricsInt();\n    fm.top = -10;\n    fm.ascent = -5;\n    fm.descent = 5;\n    fm.bottom = 10;\n    customLineHeightSpan.chooseHeight(\"Hi\", 0, 2, 0, 0, fm);\n    assertThat(fm.top).isEqualTo(-4);\n    assertThat(fm.ascent).isEqualTo(-4);\n    assertThat(fm.descent).isEqualTo(5);\n    assertThat(fm.bottom).isEqualTo(5);\n  }\n\n  @Test\n  public void shouldReduceDescentLast() {\n    CustomLineHeightSpan customLineHeightSpan = new CustomLineHeightSpan(4);\n    Paint.FontMetricsInt fm = new Paint.FontMetricsInt();\n    fm.top = -10;\n    fm.ascent = -5;\n    fm.descent = 5;\n    fm.bottom = 10;\n    customLineHeightSpan.chooseHeight(\"Hi\", 0, 2, 0, 0, fm);\n    assertThat(fm.top).isEqualTo(0);\n    assertThat(fm.ascent).isEqualTo(0);\n    assertThat(fm.descent).isEqualTo(4);\n    assertThat(fm.bottom).isEqualTo(4);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/views/text/ReactTextTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.text;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\nimport static org.mockito.Matchers.any;\nimport static org.mockito.Mockito.doAnswer;\nimport static org.mockito.Mockito.mock;\n\nimport android.annotation.TargetApi;\nimport android.graphics.Color;\nimport android.graphics.Typeface;\nimport android.graphics.drawable.Drawable;\nimport android.os.Build;\nimport android.text.Spanned;\nimport android.text.TextUtils;\nimport android.text.style.AbsoluteSizeSpan;\nimport android.text.style.StrikethroughSpan;\nimport android.text.style.UnderlineSpan;\nimport android.widget.TextView;\nimport com.facebook.react.ReactRootView;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.JavaOnlyArray;\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactTestHelper;\nimport com.facebook.react.modules.core.ChoreographerCompat;\nimport com.facebook.react.modules.core.ReactChoreographer;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.uimanager.ViewProps;\nimport com.facebook.react.views.text.ReactRawTextShadowNode;\nimport com.facebook.react.views.view.ReactViewBackgroundDrawable;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.invocation.InvocationOnMock;\nimport org.mockito.stubbing.Answer;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\n\n/**\n * Tests for {@link UIManagerModule} specifically for React Text/RawText.\n */\n@PrepareForTest({Arguments.class, ReactChoreographer.class})\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class ReactTextTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private ArrayList<ChoreographerCompat.FrameCallback> mPendingFrameCallbacks;\n\n  @Before\n  public void setUp() {\n    PowerMockito.mockStatic(Arguments.class, ReactChoreographer.class);\n\n    ReactChoreographer uiDriverMock = mock(ReactChoreographer.class);\n    PowerMockito.when(Arguments.createMap()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return new JavaOnlyMap();\n      }\n    });\n    PowerMockito.when(ReactChoreographer.getInstance()).thenReturn(uiDriverMock);\n\n    mPendingFrameCallbacks = new ArrayList<>();\n    doAnswer(new Answer() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        mPendingFrameCallbacks\n            .add((ChoreographerCompat.FrameCallback) invocation.getArguments()[1]);\n        return null;\n      }\n    }).when(uiDriverMock).postFrameCallback(\n        any(ReactChoreographer.CallbackType.class),\n        any(ChoreographerCompat.FrameCallback.class));\n  }\n\n  @Test\n  public void testFontSizeApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.FONT_SIZE, 21.0),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    AbsoluteSizeSpan sizeSpan = getSingleSpan(\n        (TextView) rootView.getChildAt(0), AbsoluteSizeSpan.class);\n    assertThat(sizeSpan.getSize()).isEqualTo(21);\n  }\n\n  @Test\n  public void testBoldFontApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.FONT_WEIGHT, \"bold\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    CustomStyleSpan customStyleSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);\n    assertThat(customStyleSpan.getWeight() & Typeface.BOLD).isNotZero();\n    assertThat(customStyleSpan.getStyle() & Typeface.ITALIC).isZero();\n  }\n\n  @Test\n  public void testNumericBoldFontApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.FONT_WEIGHT, \"500\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    CustomStyleSpan customStyleSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);\n    assertThat(customStyleSpan.getWeight() & Typeface.BOLD).isNotZero();\n    assertThat(customStyleSpan.getStyle() & Typeface.ITALIC).isZero();\n  }\n\n  @Test\n  public void testItalicFontApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.FONT_STYLE, \"italic\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    CustomStyleSpan customStyleSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);\n    assertThat(customStyleSpan.getStyle() & Typeface.ITALIC).isNotZero();\n    assertThat(customStyleSpan.getWeight() & Typeface.BOLD).isZero();\n  }\n\n  @Test\n  public void testBoldItalicFontApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.FONT_WEIGHT, \"bold\", ViewProps.FONT_STYLE, \"italic\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    CustomStyleSpan customStyleSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);\n    assertThat(customStyleSpan.getStyle() & Typeface.ITALIC).isNotZero();\n    assertThat(customStyleSpan.getWeight() & Typeface.BOLD).isNotZero();\n  }\n\n  @Test\n  public void testNormalFontWeightApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.FONT_WEIGHT, \"normal\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    CustomStyleSpan customStyleSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);\n    assertThat(customStyleSpan.getWeight() & Typeface.BOLD).isZero();\n  }\n\n  @Test\n  public void testNumericNormalFontWeightApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.FONT_WEIGHT, \"200\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    CustomStyleSpan customStyleSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);\n    assertThat(customStyleSpan.getWeight() & Typeface.BOLD).isZero();\n  }\n\n  @Test\n  public void testNormalFontStyleApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.FONT_STYLE, \"normal\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    CustomStyleSpan customStyleSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);\n    assertThat(customStyleSpan.getStyle() & Typeface.ITALIC).isZero();\n  }\n\n  @Test\n  public void testFontFamilyStyleApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.FONT_FAMILY, \"sans-serif\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    CustomStyleSpan customStyleSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);\n    assertThat(customStyleSpan.getFontFamily()).isEqualTo(\"sans-serif\");\n    assertThat(customStyleSpan.getStyle() & Typeface.ITALIC).isZero();\n    assertThat(customStyleSpan.getWeight() & Typeface.BOLD).isZero();\n  }\n\n  @Test\n  public void testFontFamilyBoldStyleApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.FONT_FAMILY, \"sans-serif\", ViewProps.FONT_WEIGHT, \"bold\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    CustomStyleSpan customStyleSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);\n    assertThat(customStyleSpan.getFontFamily()).isEqualTo(\"sans-serif\");\n    assertThat(customStyleSpan.getStyle() & Typeface.ITALIC).isZero();\n    assertThat(customStyleSpan.getWeight() & Typeface.BOLD).isNotZero();\n  }\n\n  @Test\n  public void testFontFamilyItalicStyleApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.FONT_FAMILY, \"sans-serif\", ViewProps.FONT_STYLE, \"italic\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    CustomStyleSpan customStyleSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);\n    assertThat(customStyleSpan.getFontFamily()).isEqualTo(\"sans-serif\");\n    assertThat(customStyleSpan.getStyle() & Typeface.ITALIC).isNotZero();\n    assertThat(customStyleSpan.getWeight() & Typeface.BOLD).isZero();\n  }\n\n  @Test\n  public void testFontFamilyBoldItalicStyleApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(\n            ViewProps.FONT_FAMILY, \"sans-serif\",\n            ViewProps.FONT_WEIGHT, \"500\",\n            ViewProps.FONT_STYLE, \"italic\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    CustomStyleSpan customStyleSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);\n    assertThat(customStyleSpan.getFontFamily()).isEqualTo(\"sans-serif\");\n    assertThat(customStyleSpan.getStyle() & Typeface.ITALIC).isNotZero();\n    assertThat(customStyleSpan.getWeight() & Typeface.BOLD).isNotZero();\n  }\n\n  @Test\n  public void testTextDecorationLineUnderlineApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.TEXT_DECORATION_LINE, \"underline\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    TextView textView = (TextView) rootView.getChildAt(0);\n    Spanned text = (Spanned) textView.getText();\n    UnderlineSpan underlineSpan = getSingleSpan(textView, UnderlineSpan.class);\n    StrikethroughSpan[] strikeThroughSpans =\n        text.getSpans(0, text.length(), StrikethroughSpan.class);\n    assertThat(underlineSpan instanceof UnderlineSpan).isTrue();\n    assertThat(strikeThroughSpans).hasSize(0);\n  }\n\n  @Test\n  public void testTextDecorationLineLineThroughApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.TEXT_DECORATION_LINE, \"line-through\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    TextView textView = (TextView) rootView.getChildAt(0);\n    Spanned text = (Spanned) textView.getText();\n    UnderlineSpan[] underlineSpans =\n        text.getSpans(0, text.length(), UnderlineSpan.class);\n    StrikethroughSpan strikeThroughSpan =\n        getSingleSpan(textView, StrikethroughSpan.class);\n    assertThat(underlineSpans).hasSize(0);\n    assertThat(strikeThroughSpan instanceof StrikethroughSpan).isTrue();\n  }\n\n  @Test\n  public void testTextDecorationLineUnderlineLineThroughApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.TEXT_DECORATION_LINE, \"underline line-through\"),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    UnderlineSpan underlineSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), UnderlineSpan.class);\n    StrikethroughSpan strikeThroughSpan =\n        getSingleSpan((TextView) rootView.getChildAt(0), StrikethroughSpan.class);\n    assertThat(underlineSpan instanceof UnderlineSpan).isTrue();\n    assertThat(strikeThroughSpan instanceof StrikethroughSpan).isTrue();\n  }\n\n  @Test\n  public void testBackgroundColorStyleApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.BACKGROUND_COLOR, Color.BLUE),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    Drawable backgroundDrawable = ((TextView) rootView.getChildAt(0)).getBackground();\n    assertThat(((ReactViewBackgroundDrawable) backgroundDrawable).getColor()).isEqualTo(Color.BLUE);\n  }\n\n  // JELLY_BEAN is needed for TextView#getMaxLines(), which is OK, because in the actual code we\n  // only use TextView#setMaxLines() which exists since API Level 1.\n  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)\n  @Test\n  public void testMaxLinesApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = createText(\n        uiManager,\n        JavaOnlyMap.of(ViewProps.NUMBER_OF_LINES, 2),\n        JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, \"test text\"));\n\n    TextView textView = (TextView) rootView.getChildAt(0);\n    assertThat(textView.getText().toString()).isEqualTo(\"test text\");\n    assertThat(textView.getMaxLines()).isEqualTo(2);\n    assertThat(textView.getEllipsize()).isEqualTo(TextUtils.TruncateAt.END);\n  }\n\n  /**\n   * Make sure TextView has exactly one span and that span has given type.\n   */\n  private static <TSPAN> TSPAN getSingleSpan(TextView textView, Class<TSPAN> spanClass) {\n    Spanned text = (Spanned) textView.getText();\n    TSPAN[] spans = text.getSpans(0, text.length(), spanClass);\n    assertThat(spans).hasSize(1);\n    return spans[0];\n  }\n\n  private ReactRootView createText(\n      UIManagerModule uiManager,\n      JavaOnlyMap textProps,\n      JavaOnlyMap rawTextProps) {\n    ReactRootView rootView = new ReactRootView(RuntimeEnvironment.application);\n    int rootTag = uiManager.addRootView(rootView);\n    int textTag = rootTag + 1;\n    int rawTextTag = textTag + 1;\n\n    uiManager.createView(\n        textTag,\n        ReactTextViewManager.REACT_CLASS,\n        rootTag,\n        textProps);\n    uiManager.createView(\n        rawTextTag,\n        ReactRawTextManager.REACT_CLASS,\n        rootTag,\n        rawTextProps);\n\n    uiManager.manageChildren(\n        textTag,\n        null,\n        null,\n        JavaOnlyArray.of(rawTextTag),\n        JavaOnlyArray.of(0),\n        null);\n\n    uiManager.manageChildren(\n        rootTag,\n        null,\n        null,\n        JavaOnlyArray.of(textTag),\n        JavaOnlyArray.of(0),\n        null);\n\n    uiManager.onBatchComplete();\n    executePendingFrameCallbacks();\n    return rootView;\n  }\n\n  private void executePendingFrameCallbacks() {\n    ArrayList<ChoreographerCompat.FrameCallback> callbacks =\n        new ArrayList<>(mPendingFrameCallbacks);\n    mPendingFrameCallbacks.clear();\n    for (ChoreographerCompat.FrameCallback frameCallback : callbacks) {\n      frameCallback.doFrame(0);\n    }\n  }\n\n  public UIManagerModule getUIManagerModule() {\n    ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();\n    List<ViewManager> viewManagers = Arrays.asList(\n        new ViewManager[] {\n            new ReactTextViewManager(),\n            new ReactRawTextManager(),\n        });\n    UIManagerModule uiManagerModule =\n        new UIManagerModule(reactContext, viewManagers, new UIImplementationProvider(), 0);\n    uiManagerModule.onHostResume();\n    return uiManagerModule;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/views/textinput/ReactTextInputPropertyTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport android.content.res.ColorStateList;\nimport android.graphics.Color;\nimport android.text.InputType;\nimport android.text.InputFilter;\nimport android.util.DisplayMetrics;\nimport android.view.Gravity;\nimport android.view.inputmethod.EditorInfo;\nimport android.widget.EditText;\n\nimport com.facebook.react.bridge.CatalystInstance;\nimport com.facebook.react.bridge.ReactTestHelper;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.JSApplicationCausedNativeException;\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.uimanager.ReactStylesDiffMap;\nimport com.facebook.react.uimanager.DisplayMetricsHolder;\nimport com.facebook.react.views.text.DefaultStyleValuesUtil;\nimport com.facebook.react.uimanager.ThemedReactContext;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.Rule;\nimport org.junit.runner.RunWith;\nimport org.robolectric.Robolectric;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\n\n/**\n * Verify {@link EditText} view property being applied properly by {@link ReactTextInputManager}\n */\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class ReactTextInputPropertyTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private ReactApplicationContext mContext;\n  private CatalystInstance mCatalystInstanceMock;\n  private ThemedReactContext mThemedContext;\n  private ReactTextInputManager mManager;\n\n  @Before\n  public void setup() {\n    mContext = new ReactApplicationContext(RuntimeEnvironment.application);\n    mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();\n    mContext.initializeWithInstance(mCatalystInstanceMock);\n    mThemedContext = new ThemedReactContext(mContext, mContext);\n    mManager = new ReactTextInputManager();\n    DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());\n  }\n\n  public ReactStylesDiffMap buildStyles(Object... keysAndValues) {\n    return new ReactStylesDiffMap(JavaOnlyMap.of(keysAndValues));\n  }\n\n  @Test\n  public void testAutoCorrect() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles());\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS).isZero();\n\n    mManager.updateProperties(view, buildStyles(\"autoCorrect\", true));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT).isNotZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS).isZero();\n\n    mManager.updateProperties(view, buildStyles(\"autoCorrect\", false));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS).isNotZero();\n\n    mManager.updateProperties(view, buildStyles(\"autoCorrect\", null));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS).isZero();\n  }\n\n  @Test\n  public void testAutoCapitalize() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles());\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_SENTENCES).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_WORDS).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS).isZero();\n\n    mManager.updateProperties(\n        view,\n        buildStyles(\"autoCapitalize\", InputType.TYPE_TEXT_FLAG_CAP_SENTENCES));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_SENTENCES).isNotZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_WORDS).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS).isZero();\n\n    mManager.updateProperties(\n        view,\n        buildStyles(\"autoCapitalize\", InputType.TYPE_TEXT_FLAG_CAP_WORDS));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_SENTENCES).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_WORDS).isNotZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS).isZero();\n\n    mManager.updateProperties(\n        view,\n        buildStyles(\"autoCapitalize\", InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_SENTENCES).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_WORDS).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS).isNotZero();\n\n    mManager.updateProperties(\n        view,\n        buildStyles(\"autoCapitalize\", InputType.TYPE_CLASS_TEXT));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_SENTENCES).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_WORDS).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS).isZero();\n  }\n\n  @Test\n  public void testPlaceholder() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n    mManager.updateProperties(view, buildStyles());\n    assertThat(view.getHint()).isNull();\n\n    mManager.updateProperties(view, buildStyles(\"placeholder\", \"sometext\"));\n    assertThat(view.getHint()).isEqualTo(\"sometext\");\n\n    mManager.updateProperties(view, buildStyles(\"placeholder\", null));\n    assertThat(view.getHint()).isNull();\n  }\n\n  @Test\n  public void testEditable() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles());\n    assertThat(view.isEnabled()).isTrue();\n\n    mManager.updateProperties(view, buildStyles(\"editable\", false));\n    assertThat(view.isEnabled()).isFalse();\n\n    mManager.updateProperties(view, buildStyles(\"editable\", null));\n    assertThat(view.isEnabled()).isTrue();\n\n    mManager.updateProperties(view, buildStyles(\"editable\", false));\n    assertThat(view.isEnabled()).isFalse();\n\n    mManager.updateProperties(view, buildStyles(\"editable\", true));\n    assertThat(view.isEnabled()).isTrue();\n  }\n\n  @Test\n  public void testPlaceholderTextColor() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n\n    final ColorStateList defaultPlaceholderColorStateList =\n        DefaultStyleValuesUtil.getDefaultTextColorHint(\n            view.getContext());\n\n    ColorStateList colors = view.getHintTextColors();\n    assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);\n\n    mManager.updateProperties(view, buildStyles(\"placeholderTextColor\", null));\n    colors = view.getHintTextColors();\n    assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);\n\n    mManager.updateProperties(view, buildStyles(\"placeholderTextColor\", Color.RED));\n    colors = view.getHintTextColors();\n    assertThat(colors.getDefaultColor()).isEqualTo(Color.RED);\n\n    mManager.updateProperties(view, buildStyles(\"placeholderTextColor\", null));\n    colors = view.getHintTextColors();\n    assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);\n  }\n\n  @Test\n  public void testMultiline() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles());\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE).isZero();\n\n    mManager.updateProperties(view, buildStyles(\"multiline\", false));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE).isZero();\n\n    mManager.updateProperties(view, buildStyles(\"multiline\", true));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE).isNotZero();\n\n    mManager.updateProperties(view, buildStyles(\"multiline\", null));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE).isZero();\n  }\n\n  @Test\n  public void testBlurMultiline() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles(\"multiline\", true));\n    mManager.updateProperties(view, buildStyles(\"blurOnSubmit\", true));\n\n    EditorInfo editorInfo = new EditorInfo();\n    editorInfo.imeOptions = EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_ENTER_ACTION;\n    view.onCreateInputConnection(editorInfo);\n\n    assertThat(editorInfo.imeOptions).isEqualTo(EditorInfo.IME_ACTION_DONE);\n  }\n\n  @Test\n  public void testNumLines() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles());\n    assertThat(view.getMinLines()).isEqualTo(1);\n\n    mManager.updateProperties(view, buildStyles(\"numberOfLines\", 5));\n    assertThat(view.getMinLines()).isEqualTo(5);\n\n    mManager.updateProperties(view, buildStyles(\"numberOfLines\", 4));\n    assertThat(view.getMinLines()).isEqualTo(4);\n  }\n\n  @Test\n  public void testKeyboardType() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles());\n    assertThat(view.getInputType() & InputType.TYPE_CLASS_NUMBER).isZero();\n\n    mManager.updateProperties(view, buildStyles(\"keyboardType\", \"text\"));\n    assertThat(view.getInputType() & InputType.TYPE_CLASS_NUMBER).isZero();\n\n    mManager.updateProperties(view, buildStyles(\"keyboardType\", \"numeric\"));\n    assertThat(view.getInputType() & InputType.TYPE_CLASS_NUMBER).isNotZero();\n\n    mManager.updateProperties(view, buildStyles(\"keyboardType\", \"email-address\"));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS).isNotZero();\n\n    mManager.updateProperties(view, buildStyles(\"keyboardType\", null));\n    assertThat(view.getInputType() & InputType.TYPE_CLASS_NUMBER).isZero();\n  }\n\n  @Test\n  public void testPasswordInput() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles());\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_VARIATION_PASSWORD).isZero();\n\n    mManager.updateProperties(view, buildStyles(\"secureTextEntry\", false));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_VARIATION_PASSWORD).isZero();\n\n    mManager.updateProperties(view, buildStyles(\"secureTextEntry\", true));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_VARIATION_PASSWORD).isNotZero();\n\n    mManager.updateProperties(view, buildStyles(\"secureTextEntry\", null));\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_VARIATION_PASSWORD).isZero();\n  }\n\n  @Test\n  public void testIncrementalInputTypeUpdates() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n\n    mManager.updateProperties(view, buildStyles());\n    assertThat(view.getInputType() & InputType.TYPE_CLASS_NUMBER).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS).isZero();\n\n    mManager.updateProperties(view, buildStyles(\"multiline\", true));\n    assertThat(view.getInputType() & InputType.TYPE_CLASS_NUMBER).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE).isNotZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS).isZero();\n\n    mManager.updateProperties(view, buildStyles(\"autoCorrect\", false));\n    assertThat(view.getInputType() & InputType.TYPE_CLASS_NUMBER).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE).isNotZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS).isNotZero();\n\n    mManager.updateProperties(view, buildStyles(\"keyboardType\", \"NUMERIC\"));\n    assertThat(view.getInputType() & InputType.TYPE_CLASS_NUMBER).isNotZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE).isNotZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS).isNotZero();\n\n    mManager.updateProperties(view, buildStyles(\"multiline\", null));\n    assertThat(view.getInputType() & InputType.TYPE_CLASS_NUMBER).isNotZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT).isZero();\n    assertThat(view.getInputType() & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS).isNotZero();\n  }\n\n  @Test\n  public void testTextAlign() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n    int defaultGravity = view.getGravity();\n    int defaultHorizontalGravity = defaultGravity & Gravity.HORIZONTAL_GRAVITY_MASK;\n    int defaultVerticalGravity = defaultGravity & Gravity.VERTICAL_GRAVITY_MASK;\n\n    // Theme\n    assertThat(view.getGravity()).isNotEqualTo(Gravity.NO_GRAVITY);\n\n    // TextAlign\n    mManager.updateProperties(view, buildStyles(\"textAlign\", \"left\"));\n    assertThat(view.getGravity() & Gravity.HORIZONTAL_GRAVITY_MASK).isEqualTo(Gravity.LEFT);\n    mManager.updateProperties(view, buildStyles(\"textAlign\", \"right\"));\n    assertThat(view.getGravity() & Gravity.HORIZONTAL_GRAVITY_MASK).isEqualTo(Gravity.RIGHT);\n    mManager.updateProperties(view, buildStyles(\"textAlign\", \"center\"));\n    assertThat(view.getGravity() & Gravity.HORIZONTAL_GRAVITY_MASK).isEqualTo(Gravity.CENTER_HORIZONTAL);\n    mManager.updateProperties(view, buildStyles(\"textAlign\", null));\n    assertThat(view.getGravity() & Gravity.HORIZONTAL_GRAVITY_MASK).isEqualTo(defaultHorizontalGravity);\n\n    // TextAlignVertical\n    mManager.updateProperties(view, buildStyles(\"textAlignVertical\", \"top\"));\n    assertThat(view.getGravity() & Gravity.VERTICAL_GRAVITY_MASK).isEqualTo(Gravity.TOP);\n    mManager.updateProperties(view, buildStyles(\"textAlignVertical\", \"bottom\"));\n    assertThat(view.getGravity() & Gravity.VERTICAL_GRAVITY_MASK).isEqualTo(Gravity.BOTTOM);\n    mManager.updateProperties(view, buildStyles(\"textAlignVertical\", \"center\"));\n    assertThat(view.getGravity() & Gravity.VERTICAL_GRAVITY_MASK).isEqualTo(Gravity.CENTER_VERTICAL);\n    mManager.updateProperties(view, buildStyles(\"textAlignVertical\", null));\n    assertThat(view.getGravity() & Gravity.VERTICAL_GRAVITY_MASK).isEqualTo(defaultVerticalGravity);\n\n    // TextAlign + TextAlignVertical\n    mManager.updateProperties(\n      view,\n      buildStyles(\"textAlign\", \"center\", \"textAlignVertical\", \"center\"));\n    assertThat(view.getGravity()).isEqualTo(Gravity.CENTER);\n    mManager.updateProperties(\n      view,\n      buildStyles(\"textAlign\", \"right\", \"textAlignVertical\", \"bottom\"));\n    assertThat(view.getGravity()).isEqualTo(Gravity.RIGHT | Gravity.BOTTOM);\n    mManager.updateProperties(\n      view,\n      buildStyles(\"textAlign\", null, \"textAlignVertical\", null));\n    assertThat(view.getGravity()).isEqualTo(defaultGravity);\n  }\n\n  @Test\n  public void testMaxLength() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n    InputFilter[] filters = new InputFilter[] { new InputFilter.AllCaps() };\n    view.setFilters(filters);\n    mManager.setMaxLength(view, null);\n    assertThat(view.getFilters()).isEqualTo(filters);\n  }\n\n  @Test\n  public void testSelection() {\n    ReactEditText view = mManager.createViewInstance(mThemedContext);\n    view.setText(\"Need some text to select something...\");\n\n    mManager.updateProperties(view, buildStyles());\n    assertThat(view.getSelectionStart()).isEqualTo(0);\n    assertThat(view.getSelectionEnd()).isEqualTo(0);\n\n    JavaOnlyMap selection = JavaOnlyMap.of(\"start\", 5, \"end\", 10);\n    mManager.updateProperties(view, buildStyles(\"selection\", selection));\n    assertThat(view.getSelectionStart()).isEqualTo(5);\n    assertThat(view.getSelectionEnd()).isEqualTo(10);\n\n    mManager.updateProperties(view, buildStyles(\"selection\", null));\n    assertThat(view.getSelectionStart()).isEqualTo(5);\n    assertThat(view.getSelectionEnd()).isEqualTo(10);\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/com/facebook/react/views/textinput/TextInputTest.java",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.views.textinput;\n\nimport static org.fest.assertions.api.Assertions.assertThat;\nimport static org.mockito.Matchers.any;\nimport static org.mockito.Mockito.doAnswer;\nimport static org.mockito.Mockito.mock;\n\nimport android.widget.EditText;\nimport com.facebook.react.ReactRootView;\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.JavaOnlyArray;\nimport com.facebook.react.bridge.JavaOnlyMap;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactTestHelper;\nimport com.facebook.react.modules.core.ChoreographerCompat;\nimport com.facebook.react.modules.core.ReactChoreographer;\nimport com.facebook.react.uimanager.UIImplementationProvider;\nimport com.facebook.react.uimanager.UIManagerModule;\nimport com.facebook.react.uimanager.ViewManager;\nimport com.facebook.react.uimanager.ViewProps;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.invocation.InvocationOnMock;\nimport org.mockito.stubbing.Answer;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.modules.junit4.rule.PowerMockRule;\nimport org.robolectric.RobolectricTestRunner;\nimport org.robolectric.RuntimeEnvironment;\n\n/**\n * Tests for TextInput.\n */\n@PrepareForTest({Arguments.class, ReactChoreographer.class})\n@RunWith(RobolectricTestRunner.class)\n@PowerMockIgnore({\"org.mockito.*\", \"org.robolectric.*\", \"android.*\"})\npublic class TextInputTest {\n\n  @Rule\n  public PowerMockRule rule = new PowerMockRule();\n\n  private ArrayList<ChoreographerCompat.FrameCallback> mPendingChoreographerCallbacks;\n\n  @Before\n  public void setUp() {\n    PowerMockito.mockStatic(Arguments.class, ReactChoreographer.class);\n\n    ReactChoreographer choreographerMock = mock(ReactChoreographer.class);\n    PowerMockito.when(Arguments.createMap()).thenAnswer(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        return new JavaOnlyMap();\n      }\n    });\n    PowerMockito.when(ReactChoreographer.getInstance()).thenReturn(choreographerMock);\n\n    mPendingChoreographerCallbacks = new ArrayList<>();\n    doAnswer(new Answer() {\n      @Override\n      public Object answer(InvocationOnMock invocation) throws Throwable {\n        mPendingChoreographerCallbacks\n            .add((ChoreographerCompat.FrameCallback) invocation.getArguments()[1]);\n        return null;\n      }\n    }).when(choreographerMock).postFrameCallback(\n        any(ReactChoreographer.CallbackType.class),\n        any(ChoreographerCompat.FrameCallback.class));\n  }\n\n  @Test\n  public void testPropsApplied() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = new ReactRootView(RuntimeEnvironment.application);\n    rootView.setLayoutParams(new ReactRootView.LayoutParams(100, 100));\n    int rootTag = uiManager.addRootView(rootView);\n    int textInputTag = rootTag + 1;\n    final String hintStr = \"placeholder text\";\n\n    uiManager.createView(\n        textInputTag,\n        ReactTextInputManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\n            ViewProps.FONT_SIZE, 13.37, ViewProps.HEIGHT, 20.0, \"placeholder\", hintStr));\n\n    uiManager.manageChildren(\n        rootTag,\n        null,\n        null,\n        JavaOnlyArray.of(textInputTag),\n        JavaOnlyArray.of(0),\n        null);\n\n    uiManager.onBatchComplete();\n    executePendingChoreographerCallbacks();\n\n    EditText editText = (EditText) rootView.getChildAt(0);\n    assertThat(editText.getHint()).isEqualTo(hintStr);\n    assertThat(editText.getTextSize()).isEqualTo((float) Math.ceil(13.37));\n    assertThat(editText.getHeight()).isEqualTo(20);\n  }\n\n  @Test\n  public void testPropsUpdate() {\n    UIManagerModule uiManager = getUIManagerModule();\n\n    ReactRootView rootView = new ReactRootView(RuntimeEnvironment.application);\n    rootView.setLayoutParams(new ReactRootView.LayoutParams(100, 100));\n    int rootTag = uiManager.addRootView(rootView);\n    int textInputTag = rootTag + 1;\n    final String hintStr = \"placeholder text\";\n\n    uiManager.createView(\n        textInputTag,\n        ReactTextInputManager.REACT_CLASS,\n        rootTag,\n        JavaOnlyMap.of(\n            ViewProps.FONT_SIZE, 13.37, ViewProps.HEIGHT, 20.0, \"placeholder\", hintStr));\n\n    uiManager.manageChildren(\n        rootTag,\n        null,\n        null,\n        JavaOnlyArray.of(textInputTag),\n        JavaOnlyArray.of(0),\n        null);\n    uiManager.onBatchComplete();\n    executePendingChoreographerCallbacks();\n\n    EditText editText = (EditText) rootView.getChildAt(0);\n    assertThat(editText.getHint()).isEqualTo(hintStr);\n    assertThat(editText.getTextSize()).isEqualTo((float) Math.ceil(13.37));\n    assertThat(editText.getHeight()).isEqualTo(20);\n\n    final String hintStr2 = \"such hint\";\n    uiManager.updateView(\n        textInputTag,\n        ReactTextInputManager.REACT_CLASS,\n        JavaOnlyMap.of(\n            ViewProps.FONT_SIZE, 26.74, ViewProps.HEIGHT, 40.0, \"placeholder\", hintStr2));\n\n    uiManager.onBatchComplete();\n    executePendingChoreographerCallbacks();\n\n    EditText updatedEditText = (EditText) rootView.getChildAt(0);\n    assertThat(updatedEditText.getHint()).isEqualTo(hintStr2);\n    assertThat(updatedEditText.getTextSize()).isEqualTo((float) Math.ceil(26.74f));\n    assertThat(updatedEditText.getHeight()).isEqualTo(40);\n  }\n\n  private void executePendingChoreographerCallbacks() {\n    ArrayList<ChoreographerCompat.FrameCallback> callbacks =\n        new ArrayList<>(mPendingChoreographerCallbacks);\n    mPendingChoreographerCallbacks.clear();\n    for (ChoreographerCompat.FrameCallback frameCallback : callbacks) {\n      frameCallback.doFrame(0);\n    }\n  }\n\n  public UIManagerModule getUIManagerModule() {\n    ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();\n    List<ViewManager> viewManagers = Arrays.asList(\n        new ViewManager[] {\n            new ReactTextInputManager(),\n        });\n    UIManagerModule uiManagerModule =\n        new UIManagerModule(reactContext, viewManagers, new UIImplementationProvider(), 0);\n    uiManagerModule.onHostResume();\n    return uiManagerModule;\n  }\n}\n"
  },
  {
    "path": "ReactAndroid/src/test/java/org/mockito/configuration/BUCK",
    "content": "include_defs(\"//ReactAndroid/DEFS\")\n\nandroid_library(\n    name = \"configuration\",\n    srcs = glob([\"**/*.java\"]),\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        react_native_dep(\"third-party/java/mockito:mockito\"),\n    ],\n)\n"
  },
  {
    "path": "ReactCommon/DEFS",
    "content": "# Set up common deps\n\n# Building is not supported in OSS right now\ndef rn_xplat_cxx_library(name, **kwargs):\n  cxx_library(name = name)\n\n# Helper for referring to an Android RN target\ndef react_native_target(path):\n  return '//ReactAndroid/src/main/' + path\n\n# Helper for referring to an xplat RN target\ndef react_native_xplat_target(path):\n  return '//ReactCommon/' + path\n\nGLOG_DEP = \"//ReactAndroid/build/third-party-ndk/glog:glog\"\n\nINSPECTOR_FLAGS = []\nDEBUG_PREPROCESSOR_FLAGS = []\nSTATIC_LIBRARY_IOS_FLAGS = []\n\nJSC_DEPS = []\nJSC_INTERNAL_DEPS = []\n\nTHIS_IS_FBOBJC = False\nTHIS_IS_FBANDROID = False\n"
  },
  {
    "path": "ReactCommon/cxxreact/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := reactnative\n\nLOCAL_SRC_FILES := \\\n  CxxNativeModule.cpp \\\n  Instance.cpp \\\n  JSBigString.cpp \\\n  JSBundleType.cpp \\\n  JSCExecutor.cpp \\\n  JSCLegacyTracing.cpp \\\n  JSCMemory.cpp \\\n  JSCNativeModules.cpp \\\n  JSCPerfStats.cpp \\\n  JSCSamplingProfiler.cpp \\\n  JSCTracing.cpp \\\n  JSCUtils.cpp \\\n  JSIndexedRAMBundle.cpp \\\n  MethodCall.cpp \\\n  ModuleRegistry.cpp \\\n  NativeToJsBridge.cpp \\\n  Platform.cpp \\\n\tRAMBundleRegistry.cpp \\\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/..\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)\n\nLOCAL_CFLAGS := \\\n  -DLOG_TAG=\\\"ReactNative\\\"\n\nLOCAL_CFLAGS += -Wall -Werror -fexceptions -frtti\nCXX11_FLAGS := -std=c++11\nLOCAL_CFLAGS += $(CXX11_FLAGS)\nLOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)\n\nLOCAL_STATIC_LIBRARIES := jschelpers\nLOCAL_SHARED_LIBRARIES := libfb libfolly_json libjsc libglog\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,fb)\n$(call import-module,folly)\n$(call import-module,jsc)\n$(call import-module,glog)\n$(call import-module,jschelpers)\n$(call import-module,jsinspector)\n$(call import-module,privatedata)\n"
  },
  {
    "path": "ReactCommon/cxxreact/BUCK",
    "content": "include_defs(\"xplat//configurations/buck/apple/flag_defs.bzl\")\n\ninclude_defs(\"//ReactCommon/DEFS\")\n\nCXX_LIBRARY_COMPILER_FLAGS = [\n    \"-std=c++14\",\n    \"-Wall\",\n]\n\nif THIS_IS_FBOBJC:\n  inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS\n  CXX_LIBRARY_COMPILER_FLAGS += flags.get_flag_value(inherited_buck_flags, 'compiler_flags')\n\nrn_xplat_cxx_library(\n    name = \"module\",\n    header_namespace = \"\",\n    exported_headers = subdir_glob(\n        [\n            (\"\", \"CxxModule.h\"),\n            (\"\", \"JsArgumentHelpers.h\"),\n            (\"\", \"JsArgumentHelpers-inl.h\"),\n        ],\n        prefix = \"cxxreact\",\n    ),\n    compiler_flags = CXX_LIBRARY_COMPILER_FLAGS,\n    force_static = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        \"xplat//folly:molly\",\n    ],\n)\n\nrn_xplat_cxx_library(\n    name = \"jsbigstring\",\n    srcs = [\n        \"JSBigString.cpp\",\n    ],\n    header_namespace = \"\",\n    exported_headers = subdir_glob(\n        [(\"\", \"JSBigString.h\")],\n        prefix = \"cxxreact\",\n    ),\n    compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [\n        \"-fexceptions\",\n        \"-frtti\",\n    ],\n    force_static = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        \"xplat//folly:molly\",\n    ],\n)\n\nrn_xplat_cxx_library(\n    name = \"samplemodule\",\n    srcs = [\"SampleCxxModule.cpp\"],\n    header_namespace = \"\",\n    exported_headers = [\"SampleCxxModule.h\"],\n    compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [\n        \"-fno-omit-frame-pointer\",\n        \"-fexceptions\",\n    ],\n    soname = \"libxplat_react_module_samplemodule.$(ext)\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        \"xplat//folly:molly\",\n        \":module\",\n    ],\n)\n\nCXXREACT_PUBLIC_HEADERS = [\n    \"CxxNativeModule.h\",\n    \"Instance.h\",\n    \"JSBundleType.h\",\n    \"JSExecutor.h\",\n    \"JSCExecutor.h\",\n    \"JSCNativeModules.h\",\n    \"JSIndexedRAMBundle.h\",\n    \"JSModulesUnbundle.h\",\n    \"MessageQueueThread.h\",\n    \"MethodCall.h\",\n    \"ModuleRegistry.h\",\n    \"NativeModule.h\",\n    \"NativeToJsBridge.h\",\n    \"Platform.h\",\n    \"RAMBundleRegistry.h\",\n    \"RecoverableError.h\",\n    \"SharedProxyCxxModule.h\",\n    \"SystraceSection.h\",\n]\n\nrn_xplat_cxx_library(\n    name = \"bridge\",\n    srcs = glob(\n        [\"*.cpp\"],\n        excludes = [\n            \"JSBigString.cpp\",\n            \"SampleCxxModule.cpp\",\n        ],\n    ),\n    headers = glob(\n        [\"*.h\"],\n        excludes = CXXREACT_PUBLIC_HEADERS,\n    ),\n    header_namespace = \"\",\n    exported_headers = dict([\n        (\n            \"cxxreact/%s\" % header,\n            header,\n        )\n        for header in CXXREACT_PUBLIC_HEADERS\n    ]),\n    compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [\n        \"-fexceptions\",\n        \"-frtti\",\n    ],\n    fbandroid_preprocessor_flags = [\n        \"-DWITH_JSC_EXTRA_TRACING=1\",\n        \"-DWITH_JSC_MEMORY_PRESSURE=1\",\n        \"-DWITH_FB_MEMORY_PROFILING=1\",\n    ],\n    fbobjc_frameworks = [\n        \"$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework\",\n    ],\n    fbobjc_inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS,\n    fbobjc_preprocessor_flags = DEBUG_PREPROCESSOR_FLAGS,\n    force_static = True,\n    preprocessor_flags = [\n        \"-DLOG_TAG=\\\"ReactNative\\\"\",\n        \"-DWITH_FBSYSTRACE=1\",\n    ] + INSPECTOR_FLAGS,\n    tests = [\n        react_native_xplat_target(\"cxxreact/tests:tests\"),\n    ],\n    visibility = [\"PUBLIC\"],\n    deps = [\n        \":module\",\n        \":jsbigstring\",\n        \"xplat//fbsystrace:fbsystrace\",\n        \"xplat//folly:molly\",\n        react_native_xplat_target(\"jschelpers:jschelpers\"),\n        react_native_xplat_target(\"jsinspector:jsinspector\"),\n        react_native_xplat_target(\"microprofiler:microprofiler\"),\n    ] + JSC_DEPS,\n)\n"
  },
  {
    "path": "ReactCommon/cxxreact/CxxModule.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <functional>\n#include <map>\n#include <tuple>\n#include <vector>\n\n#include <folly/dynamic.h>\n\nusing namespace std::placeholders;\n\nnamespace facebook {\nnamespace react {\n\nclass Instance;\n\n}}\n\nnamespace facebook {\nnamespace xplat {\nnamespace module {\n\n/**\n * Base class for Catalyst native modules whose implementations are\n * written in C++.  Native methods are represented by instances of the\n * Method struct.  Generally, a derived class will manage an instance\n * which represents the data for the module, and non-Catalyst-specific\n * methods can be wrapped in lambdas which convert between\n * folly::dynamic and native C++ objects.  The Callback arguments will\n * pass through to js functions passed to the analogous javascript\n * methods.  At most two callbacks will be converted.  Results should\n * be passed to the first callback, and errors to the second callback.\n * Exceptions thrown by a method will be converted to platform\n * exceptions, and handled however they are handled on that platform.\n * (TODO mhorowitz #7128529: this exception behavior is not yet\n * implemented.)\n *\n * There are two sets of constructors here.  The first set initializes\n * a Method using a name and anything convertible to a std::function.\n * This is most useful for registering a lambda as a RN method.  There\n * are overloads to support functions which take no arguments,\n * arguments only, and zero, one, or two callbacks.\n *\n * The second set of methods is similar, but instead of taking a\n * function, takes the method name, an object, and a pointer to a\n * method on that object.\n */\n\nclass CxxModule {\n  class AsyncTagType {};\n  class SyncTagType {};\n\npublic:\n  typedef std::function<std::unique_ptr<CxxModule>()> Provider;\n\n  typedef std::function<void(std::vector<folly::dynamic>)> Callback;\n\n  constexpr static AsyncTagType AsyncTag = AsyncTagType();\n  constexpr static SyncTagType SyncTag = SyncTagType();\n\n  struct Method {\n    std::string name;\n\n    size_t callbacks;\n    std::function<void(folly::dynamic, Callback, Callback)> func;\n\n    std::function<folly::dynamic(folly::dynamic)> syncFunc;\n\n    const char *getType() {\n      assert(func || syncFunc);\n      return func ? (callbacks == 2 ? \"promise\" : \"async\") : \"sync\";\n    }\n\n    // std::function/lambda ctors\n\n    Method(std::string aname,\n           std::function<void()>&& afunc)\n      : name(std::move(aname))\n      , callbacks(0)\n      , func(std::bind(std::move(afunc))) {}\n\n    Method(std::string aname,\n           std::function<void(folly::dynamic)>&& afunc)\n      : name(std::move(aname))\n      , callbacks(0)\n      , func(std::bind(std::move(afunc), _1)) {}\n\n    Method(std::string aname,\n           std::function<void(folly::dynamic, Callback)>&& afunc)\n      : name(std::move(aname))\n      , callbacks(1)\n      , func(std::bind(std::move(afunc), _1, _2)) {}\n\n    Method(std::string aname,\n           std::function<void(folly::dynamic, Callback, Callback)>&& afunc)\n      : name(std::move(aname))\n      , callbacks(2)\n      , func(std::move(afunc)) {}\n\n    // method pointer ctors\n\n    template <typename T>\n    Method(std::string aname, T* t, void (T::*method)())\n      : name(std::move(aname))\n      , callbacks(0)\n      , func(std::bind(method, t)) {}\n\n    template <typename T>\n    Method(std::string aname, T* t, void (T::*method)(folly::dynamic))\n      : name(std::move(aname))\n      , callbacks(0)\n      , func(std::bind(method, t, _1)) {}\n\n    template <typename T>\n    Method(std::string aname, T* t, void (T::*method)(folly::dynamic, Callback))\n      : name(std::move(aname))\n      , callbacks(1)\n      , func(std::bind(method, t, _1, _2)) {}\n\n    template <typename T>\n    Method(std::string aname, T* t, void (T::*method)(folly::dynamic, Callback, Callback))\n      : name(std::move(aname))\n      , callbacks(2)\n      , func(std::bind(method, t, _1, _2, _3)) {}\n\n    // sync std::function/lambda ctors\n\n    // Overloads for functions returning void give ambiguity errors.\n    // I am not sure if this is a runtime/compiler bug, or a\n    // limitation I do not understand.\n\n    Method(std::string aname,\n           std::function<folly::dynamic()>&& afunc,\n           SyncTagType)\n      : name(std::move(aname))\n      , callbacks(0)\n      , syncFunc([afunc=std::move(afunc)] (const folly::dynamic&)\n                 { return afunc(); })\n    {}\n\n    Method(std::string aname,\n           std::function<folly::dynamic(folly::dynamic)>&& afunc,\n           SyncTagType)\n      : name(std::move(aname))\n      , callbacks(0)\n      , syncFunc(std::move(afunc))\n      {}\n  };\n\n  /**\n   * This may block, if necessary to complete cleanup before the\n   * object is destroyed.\n   */\n  virtual ~CxxModule() {}\n\n  /**\n   * @return the name of this module. This will be the name used to {@code require()} this module\n   * from javascript.\n   */\n  virtual std::string getName() = 0;\n\n  /**\n   * Each entry in the map will be exported as a property to JS.  The\n   * key is the property name, and the value can be anything.\n   */\n  virtual auto getConstants() -> std::map<std::string, folly::dynamic> { return {}; };\n\n  /**\n   * @return a list of methods this module exports to JS.\n   */\n  virtual auto getMethods() -> std::vector<Method> = 0;\n\n  /**\n   *  Called during the construction of CxxNativeModule.\n   */\n  void setInstance(std::weak_ptr<react::Instance> instance) {\n    instance_ = instance;\n  }\n\n  /**\n   * @return a weak_ptr to the current instance of the bridge.\n   * When used with CxxNativeModule, this gives Cxx modules access to functions\n   * such as `callJSFunction`, allowing them to communicate back to JS outside\n   * of the regular callbacks.\n   */\n  std::weak_ptr<react::Instance> getInstance() {\n    return instance_;\n  }\n\nprivate:\n  std::weak_ptr<react::Instance> instance_;\n};\n\n}}}\n"
  },
  {
    "path": "ReactCommon/cxxreact/CxxNativeModule.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"CxxNativeModule.h\"\n#include \"Instance.h\"\n\n#include <iterator>\n#include <glog/logging.h>\n#include <folly/json.h>\n\n#include \"JsArgumentHelpers.h\"\n#include \"SystraceSection.h\"\n#include \"MessageQueueThread.h\"\n\nusing facebook::xplat::module::CxxModule;\nnamespace facebook {\nnamespace react {\n\nstd::function<void(folly::dynamic)> makeCallback(\n    std::weak_ptr<Instance> instance, const folly::dynamic& callbackId) {\n  if (!callbackId.isNumber()) {\n    throw std::invalid_argument(\"Expected callback(s) as final argument\");\n  }\n\n  auto id = callbackId.asInt();\n  return [winstance = std::move(instance), id](folly::dynamic args) {\n    if (auto instance = winstance.lock()) {\n      instance->callJSCallback(id, std::move(args));\n    }\n  };\n}\n\nnamespace {\n\n/**\n * CxxModule::Callback accepts a vector<dynamic>, makeCallback returns\n * a callback that accepts a dynamic, adapt the second into the first.\n * TODO: Callback types should be made equal (preferably\n * function<void(dynamic)>) to avoid the extra copy and indirect call.\n */\nCxxModule::Callback convertCallback(\n    std::function<void(folly::dynamic)> callback) {\n  return [callback = std::move(callback)](std::vector<folly::dynamic> args) {\n    callback(folly::dynamic(std::make_move_iterator(args.begin()),\n                            std::make_move_iterator(args.end())));\n  };\n}\n\n}\n\nstd::string CxxNativeModule::getName() {\n  return name_;\n}\n\nstd::vector<MethodDescriptor> CxxNativeModule::getMethods() {\n  lazyInit();\n\n  std::vector<MethodDescriptor> descs;\n  for (auto& method : methods_) {\n    descs.emplace_back(method.name, method.getType());\n  }\n  return descs;\n}\n\nfolly::dynamic CxxNativeModule::getConstants() {\n  lazyInit();\n\n  if (!module_) {\n    return nullptr;\n  }\n\n  folly::dynamic constants = folly::dynamic::object();\n  for (auto& pair : module_->getConstants()) {\n    constants.insert(std::move(pair.first), std::move(pair.second));\n  }\n  return constants;\n}\n\nvoid CxxNativeModule::invoke(unsigned int reactMethodId, folly::dynamic&& params, int callId) {\n  if (reactMethodId >= methods_.size()) {\n    throw std::invalid_argument(folly::to<std::string>(\"methodId \", reactMethodId,\n        \" out of range [0..\", methods_.size(), \"]\"));\n  }\n  if (!params.isArray()) {\n    throw std::invalid_argument(\n      folly::to<std::string>(\"method parameters should be array, but are \", params.typeName()));\n  }\n\n  CxxModule::Callback first;\n  CxxModule::Callback second;\n\n  const auto& method = methods_[reactMethodId];\n\n  if (!method.func) {\n    throw std::runtime_error(folly::to<std::string>(\"Method \", method.name,\n        \" is synchronous but invoked asynchronously\"));\n  }\n\n  if (params.size() < method.callbacks) {\n    throw std::invalid_argument(folly::to<std::string>(\"Expected \", method.callbacks,\n        \" callbacks, but only \", params.size(), \" parameters provided\"));\n  }\n\n  if (method.callbacks == 1) {\n    first = convertCallback(makeCallback(instance_, params[params.size() - 1]));\n  } else if (method.callbacks == 2) {\n    first = convertCallback(makeCallback(instance_, params[params.size() - 2]));\n    second = convertCallback(makeCallback(instance_, params[params.size() - 1]));\n  }\n\n  params.resize(params.size() - method.callbacks);\n\n  // I've got a few flawed options here.  I can let the C++ exception\n  // propogate, and the registry will log/convert them to java exceptions.\n  // This lets all the java and red box handling work ok, but the only info I\n  // can capture about the C++ exception is the what() string, not the stack.\n  // I can std::terminate() the app.  This causes the full, accurate C++\n  // stack trace to be added to logcat by debuggerd.  The java state is lost,\n  // but in practice, the java stack is always the same in this case since\n  // the javascript stack is not visible, and the crash is unfriendly to js\n  // developers, but crucial to C++ developers.  The what() value is also\n  // lost.  Finally, I can catch, log the java stack, then rethrow the C++\n  // exception.  In this case I get java and C++ stack data, but the C++\n  // stack is as of the rethrow, not the original throw, both the C++ and\n  // java stacks always look the same.\n  //\n  // I am going with option 2, since that seems like the most useful\n  // choice.  It would be nice to be able to get what() and the C++\n  // stack.  I'm told that will be possible in the future.  TODO\n  // mhorowitz #7128529: convert C++ exceptions to Java\n\n  messageQueueThread_->runOnQueue([method, params=std::move(params), first, second, callId] () {\n  #ifdef WITH_FBSYSTRACE\n    if (callId != -1) {\n      fbsystrace_end_async_flow(TRACE_TAG_REACT_APPS, \"native\", callId);\n    }\n  #endif\n    SystraceSection s(method.name.c_str());\n    try {\n      method.func(std::move(params), first, second);\n    } catch (const facebook::xplat::JsArgumentException& ex) {\n      throw;\n    } catch (std::exception& e) {\n      LOG(ERROR) << \"std::exception. Method call \" << method.name.c_str() << \" failed: \" << e.what();\n      std::terminate();\n    } catch (std::string& error) {\n      LOG(ERROR) << \"std::string. Method call \" << method.name.c_str() << \" failed: \" << error.c_str();\n      std::terminate();\n    } catch (...) {\n      LOG(ERROR) << \"Method call \" << method.name.c_str() << \" failed. unknown error\";\n      std::terminate();\n    }\n  });\n}\n\nMethodCallResult CxxNativeModule::callSerializableNativeHook(unsigned int hookId, folly::dynamic&& args) {\n  if (hookId >= methods_.size()) {\n    throw std::invalid_argument(\n      folly::to<std::string>(\"methodId \", hookId, \" out of range [0..\", methods_.size(), \"]\"));\n  }\n\n  const auto& method = methods_[hookId];\n\n  if (!method.syncFunc) {\n    throw std::runtime_error(\n      folly::to<std::string>(\"Method \", method.name,\n                             \" is asynchronous but invoked synchronously\"));\n  }\n\n  return method.syncFunc(std::move(args));\n}\n\nvoid CxxNativeModule::lazyInit() {\n  if (module_ || !provider_) {\n    return;\n  }\n\n  // TODO 17216751: providers should never return null modules\n  module_ = provider_();\n  provider_ = nullptr;\n  if (module_) {\n    methods_ = module_->getMethods();\n    module_->setInstance(instance_);\n  }\n}\n\n}\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/CxxNativeModule.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <cxxreact/CxxModule.h>\n#include <cxxreact/NativeModule.h>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\nclass Instance;\nclass MessageQueueThread;\n\nstd::function<void(folly::dynamic)> makeCallback(\n  std::weak_ptr<Instance> instance, const folly::dynamic& callbackId);\n\nclass RN_EXPORT CxxNativeModule : public NativeModule {\npublic:\n  CxxNativeModule(std::weak_ptr<Instance> instance,\n                  std::string name,\n                  xplat::module::CxxModule::Provider provider,\n                  std::shared_ptr<MessageQueueThread> messageQueueThread)\n  : instance_(instance)\n  , name_(std::move(name))\n  , provider_(provider)\n  , messageQueueThread_(messageQueueThread) {}\n\n  std::string getName() override;\n  std::vector<MethodDescriptor> getMethods() override;\n  folly::dynamic getConstants() override;\n  void invoke(unsigned int reactMethodId, folly::dynamic&& params, int callId) override;\n  MethodCallResult callSerializableNativeHook(unsigned int hookId, folly::dynamic&& args) override;\n\nprivate:\n  void lazyInit();\n\n  std::weak_ptr<Instance> instance_;\n  std::string name_;\n  xplat::module::CxxModule::Provider provider_;\n  std::shared_ptr<MessageQueueThread> messageQueueThread_;\n  std::unique_ptr<xplat::module::CxxModule> module_;\n  std::vector<xplat::module::CxxModule::Method> methods_;\n};\n\n}\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/Instance.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"Instance.h\"\n\n#include \"JSBigString.h\"\n#include \"JSBundleType.h\"\n#include \"JSExecutor.h\"\n#include \"MessageQueueThread.h\"\n#include \"MethodCall.h\"\n#include \"NativeToJsBridge.h\"\n#include \"RAMBundleRegistry.h\"\n#include \"RecoverableError.h\"\n#include \"SystraceSection.h\"\n\n#include <cxxreact/JSIndexedRAMBundle.h>\n#include <folly/Memory.h>\n#include <folly/MoveWrapper.h>\n#include <folly/json.h>\n\n#include <glog/logging.h>\n\n#include <condition_variable>\n#include <fstream>\n#include <mutex>\n#include <string>\n\nnamespace facebook {\nnamespace react {\n\nInstance::~Instance() {\n  if (nativeToJsBridge_) {\n    nativeToJsBridge_->destroy();\n  }\n}\n\nvoid Instance::initializeBridge(\n    std::unique_ptr<InstanceCallback> callback,\n    std::shared_ptr<JSExecutorFactory> jsef,\n    std::shared_ptr<MessageQueueThread> jsQueue,\n    std::shared_ptr<ModuleRegistry> moduleRegistry) {\n  callback_ = std::move(callback);\n  moduleRegistry_ = std::move(moduleRegistry);\n\n  jsQueue->runOnQueueSync([this, &jsef, jsQueue]() mutable {\n    nativeToJsBridge_ = folly::make_unique<NativeToJsBridge>(\n        jsef.get(), moduleRegistry_, jsQueue, callback_);\n\n    std::lock_guard<std::mutex> lock(m_syncMutex);\n    m_syncReady = true;\n    m_syncCV.notify_all();\n  });\n\n  CHECK(nativeToJsBridge_);\n}\n\nvoid Instance::loadApplication(std::unique_ptr<RAMBundleRegistry> bundleRegistry,\n                               std::unique_ptr<const JSBigString> string,\n                               std::string sourceURL) {\n  callback_->incrementPendingJSCalls();\n  SystraceSection s(\"Instance::loadApplication\", \"sourceURL\",\n                    sourceURL);\n  nativeToJsBridge_->loadApplication(std::move(bundleRegistry), std::move(string),\n                                     std::move(sourceURL));\n}\n\nvoid Instance::loadApplicationSync(std::unique_ptr<RAMBundleRegistry> bundleRegistry,\n                                   std::unique_ptr<const JSBigString> string,\n                                   std::string sourceURL) {\n  std::unique_lock<std::mutex> lock(m_syncMutex);\n  m_syncCV.wait(lock, [this] { return m_syncReady; });\n\n  SystraceSection s(\"Instance::loadApplicationSync\", \"sourceURL\",\n                    sourceURL);\n  nativeToJsBridge_->loadApplicationSync(std::move(bundleRegistry), std::move(string),\n                                         std::move(sourceURL));\n}\n\nvoid Instance::setSourceURL(std::string sourceURL) {\n  callback_->incrementPendingJSCalls();\n  SystraceSection s(\"Instance::setSourceURL\", \"sourceURL\", sourceURL);\n\n  nativeToJsBridge_->loadApplication(nullptr, nullptr, std::move(sourceURL));\n}\n\nvoid Instance::loadScriptFromString(std::unique_ptr<const JSBigString> string,\n                                    std::string sourceURL,\n                                    bool loadSynchronously) {\n  SystraceSection s(\"Instance::loadScriptFromString\", \"sourceURL\",\n                    sourceURL);\n  if (loadSynchronously) {\n    loadApplicationSync(nullptr, std::move(string), std::move(sourceURL));\n  } else {\n    loadApplication(nullptr, std::move(string), std::move(sourceURL));\n  }\n}\n\nbool Instance::isIndexedRAMBundle(const char *sourcePath) {\n  std::ifstream bundle_stream(sourcePath, std::ios_base::in);\n  BundleHeader header;\n\n  if (!bundle_stream ||\n      !bundle_stream.read(reinterpret_cast<char *>(&header), sizeof(header))) {\n    return false;\n  }\n\n  return parseTypeFromHeader(header) == ScriptTag::RAMBundle;\n}\n\nvoid Instance::loadRAMBundleFromFile(const std::string& sourcePath,\n                           const std::string& sourceURL,\n                           bool loadSynchronously) {\n    auto bundle = folly::make_unique<JSIndexedRAMBundle>(sourcePath.c_str());\n    auto startupScript = bundle->getStartupCode();\n    auto registry = RAMBundleRegistry::multipleBundlesRegistry(std::move(bundle), JSIndexedRAMBundle::buildFactory());\n    loadRAMBundle(\n      std::move(registry),\n      std::move(startupScript),\n      sourceURL,\n      loadSynchronously);\n}\n\nvoid Instance::loadRAMBundle(std::unique_ptr<RAMBundleRegistry> bundleRegistry,\n                             std::unique_ptr<const JSBigString> startupScript,\n                             std::string startupScriptSourceURL,\n                             bool loadSynchronously) {\n  if (loadSynchronously) {\n    loadApplicationSync(std::move(bundleRegistry), std::move(startupScript),\n                        std::move(startupScriptSourceURL));\n  } else {\n    loadApplication(std::move(bundleRegistry), std::move(startupScript),\n                    std::move(startupScriptSourceURL));\n  }\n}\n\nvoid Instance::setGlobalVariable(std::string propName,\n                                 std::unique_ptr<const JSBigString> jsonValue) {\n  nativeToJsBridge_->setGlobalVariable(std::move(propName),\n                                       std::move(jsonValue));\n}\n\nvoid *Instance::getJavaScriptContext() {\n  return nativeToJsBridge_ ? nativeToJsBridge_->getJavaScriptContext()\n                           : nullptr;\n}\n\nbool Instance::isInspectable() {\n  return nativeToJsBridge_ ? nativeToJsBridge_->isInspectable() : false;\n}\n\nvoid Instance::callJSFunction(std::string &&module, std::string &&method,\n                              folly::dynamic &&params) {\n  callback_->incrementPendingJSCalls();\n  nativeToJsBridge_->callFunction(std::move(module), std::move(method),\n                                  std::move(params));\n}\n\nvoid Instance::callJSCallback(uint64_t callbackId, folly::dynamic &&params) {\n  SystraceSection s(\"Instance::callJSCallback\");\n  callback_->incrementPendingJSCalls();\n  nativeToJsBridge_->invokeCallback((double)callbackId, std::move(params));\n}\n\nvoid Instance::registerBundle(uint32_t bundleId, const std::string& bundlePath) {\n  nativeToJsBridge_->registerBundle(bundleId, bundlePath);\n}\n\nconst ModuleRegistry &Instance::getModuleRegistry() const {\n  return *moduleRegistry_;\n}\n\nModuleRegistry &Instance::getModuleRegistry() { return *moduleRegistry_; }\n\n#ifdef WITH_JSC_MEMORY_PRESSURE\nvoid Instance::handleMemoryPressure(int pressureLevel) {\n  nativeToJsBridge_->handleMemoryPressure(pressureLevel);\n}\n#endif\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactCommon/cxxreact/Instance.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <condition_variable>\n#include <memory>\n\n#include <cxxreact/NativeToJsBridge.h>\n#include <jschelpers/Value.h>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace folly {\nstruct dynamic;\n}\n\nnamespace facebook {\nnamespace react {\n\nclass JSBigString;\nclass JSExecutorFactory;\nclass MessageQueueThread;\nclass ModuleRegistry;\nclass RAMBundleRegistry;\n\nstruct InstanceCallback {\n  virtual ~InstanceCallback() {}\n  virtual void onBatchComplete() {}\n  virtual void incrementPendingJSCalls() {}\n  virtual void decrementPendingJSCalls() {}\n};\n\nclass RN_EXPORT Instance {\npublic:\n  ~Instance();\n  void initializeBridge(std::unique_ptr<InstanceCallback> callback,\n                        std::shared_ptr<JSExecutorFactory> jsef,\n                        std::shared_ptr<MessageQueueThread> jsQueue,\n                        std::shared_ptr<ModuleRegistry> moduleRegistry);\n\n  void setSourceURL(std::string sourceURL);\n\n  void loadScriptFromString(std::unique_ptr<const JSBigString> string,\n                            std::string sourceURL, bool loadSynchronously);\n  static bool isIndexedRAMBundle(const char *sourcePath);\n  void loadRAMBundleFromFile(const std::string& sourcePath,\n                             const std::string& sourceURL,\n                             bool loadSynchronously);\n  void loadRAMBundle(std::unique_ptr<RAMBundleRegistry> bundleRegistry,\n                     std::unique_ptr<const JSBigString> startupScript,\n                     std::string startupScriptSourceURL, bool loadSynchronously);\n  bool supportsProfiling();\n  void setGlobalVariable(std::string propName,\n                         std::unique_ptr<const JSBigString> jsonValue);\n  void *getJavaScriptContext();\n  bool isInspectable();\n  void callJSFunction(std::string &&module, std::string &&method,\n                      folly::dynamic &&params);\n  void callJSCallback(uint64_t callbackId, folly::dynamic &&params);\n\n  // This method is experimental, and may be modified or removed.\n  void registerBundle(uint32_t bundleId, const std::string& bundlePath);\n\n  // This method is experimental, and may be modified or removed.\n  template <typename T>\n  Value callFunctionSync(const std::string &module, const std::string &method,\n                         T &&args) {\n    CHECK(nativeToJsBridge_);\n    return nativeToJsBridge_->callFunctionSync(module, method,\n                                               std::forward<T>(args));\n  }\n\n  const ModuleRegistry &getModuleRegistry() const;\n  ModuleRegistry &getModuleRegistry();\n\n#ifdef WITH_JSC_MEMORY_PRESSURE\n  void handleMemoryPressure(int pressureLevel);\n#endif\n\nprivate:\n  void callNativeModules(folly::dynamic &&calls, bool isEndOfBatch);\n  void loadApplication(std::unique_ptr<RAMBundleRegistry> bundleRegistry,\n                       std::unique_ptr<const JSBigString> startupScript,\n                       std::string startupScriptSourceURL);\n  void loadApplicationSync(std::unique_ptr<RAMBundleRegistry> bundleRegistry,\n                           std::unique_ptr<const JSBigString> startupScript,\n                           std::string startupScriptSourceURL);\n\n  std::shared_ptr<InstanceCallback> callback_;\n  std::unique_ptr<NativeToJsBridge> nativeToJsBridge_;\n  std::shared_ptr<ModuleRegistry> moduleRegistry_;\n\n  std::mutex m_syncMutex;\n  std::condition_variable m_syncCV;\n  bool m_syncReady = false;\n};\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSBigString.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSBigString.h\"\n\n#include <fcntl.h>\n#include <sys/stat.h>\n\n#include <folly/Memory.h>\n#include <folly/ScopeGuard.h>\n\nnamespace facebook {\nnamespace react {\n\nstd::unique_ptr<const JSBigFileString> JSBigFileString::fromPath(const std::string& sourceURL) {\n  int fd = ::open(sourceURL.c_str(), O_RDONLY);\n  folly::checkUnixError(fd, \"Could not open file\", sourceURL);\n  SCOPE_EXIT { CHECK(::close(fd) == 0); };\n\n  struct stat fileInfo;\n  folly::checkUnixError(::fstat(fd, &fileInfo), \"fstat on bundle failed.\");\n\n  return folly::make_unique<const JSBigFileString>(fd, fileInfo.st_size);\n}\n\n}  // namespace react\n}  // namespace facebook\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSBigString.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#undef check\n#pragma once\n\n#include <fcntl.h>\n#include <sys/mman.h>\n\n#include <folly/Exception.h>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\n// JSExecutor functions sometimes take large strings, on the order of\n// megabytes.  Copying these can be expensive.  Introducing a\n// move-only, non-CopyConstructible type will let the compiler ensure\n// that no copies occur.  folly::MoveWrapper should be used when a\n// large string needs to be curried into a std::function<>, which must\n// by CopyConstructible.\n\nclass JSBigString {\npublic:\n  JSBigString() = default;\n\n  // Not copyable\n  JSBigString(const JSBigString&) = delete;\n  JSBigString& operator=(const JSBigString&) = delete;\n\n  virtual ~JSBigString() {}\n\n  virtual bool isAscii() const = 0;\n\n  // This needs to be a \\0 terminated string\n  virtual const char* c_str() const = 0;\n\n  // Length of the c_str without the NULL byte.\n  virtual size_t size() const = 0;\n};\n\n// Concrete JSBigString implementation which holds a std::string\n// instance.\nclass JSBigStdString : public JSBigString {\npublic:\n  JSBigStdString(std::string str, bool isAscii=false)\n  : m_isAscii(isAscii)\n  , m_str(std::move(str)) {}\n\n  bool isAscii() const override {\n    return m_isAscii;\n  }\n\n  const char* c_str() const override {\n    return m_str.c_str();\n  }\n\n  size_t size() const override {\n    return m_str.size();\n  }\n\nprivate:\n  bool m_isAscii;\n  std::string m_str;\n};\n\n// Concrete JSBigString implementation which holds a heap-allocated\n// buffer, and provides an accessor for writing to it.  This can be\n// used to construct a JSBigString in place, such as by reading from a\n// file.\nclass JSBigBufferString : public JSBigString {\npublic:\n  JSBigBufferString(size_t size)\n  : m_data(new char[size + 1])\n  , m_size(size) {\n    // Guarantee nul-termination.  The caller is responsible for\n    // filling in the rest of m_data.\n    m_data[m_size] = '\\0';\n  }\n\n  ~JSBigBufferString() {\n    delete[] m_data;\n  }\n\n  bool isAscii() const override {\n    return true;\n  }\n\n  const char* c_str() const override {\n    return m_data;\n  }\n\n  size_t size() const override {\n    return m_size;\n  }\n\n  char* data() {\n    return m_data;\n  }\n\nprivate:\n  char* m_data;\n  size_t m_size;\n};\n\n// JSBigString interface implemented by a file-backed mmap region.\nclass RN_EXPORT JSBigFileString : public JSBigString {\npublic:\n\n  JSBigFileString(int fd, size_t size, off_t offset = 0)\n  : m_fd   {-1}\n  , m_data {nullptr}\n  {\n    folly::checkUnixError(m_fd = dup(fd),\n      \"Could not duplicate file descriptor\");\n\n    // Offsets given to mmap must be page aligend. We abstract away that\n    // restriction by sending a page aligned offset to mmap, and keeping track\n    // of the offset within the page that we must alter the mmap pointer by to\n    // get the final desired offset.\n    if (offset != 0) {\n      const static auto ps = getpagesize();\n      auto d  = lldiv(offset, ps);\n\n      m_mapOff  = d.quot;\n      m_pageOff = d.rem;\n      m_size    = size + m_pageOff;\n    } else {\n      m_mapOff  = 0;\n      m_pageOff = 0;\n      m_size    = size;\n    }\n  }\n\n  ~JSBigFileString() {\n    if (m_data) {\n      munmap((void *)m_data, m_size);\n    }\n    close(m_fd);\n  }\n\n  bool isAscii() const override {\n    return true;\n  }\n\n  const char *c_str() const override {\n    if (!m_data) {\n      m_data =\n        (const char *)mmap(0, m_size, PROT_READ, MAP_PRIVATE, m_fd, m_mapOff);\n      CHECK(m_data != MAP_FAILED)\n      << \" fd: \" << m_fd\n      << \" size: \" << m_size\n      << \" offset: \" << m_mapOff\n      << \" error: \" << std::strerror(errno);\n    }\n    return m_data + m_pageOff;\n  }\n\n  size_t size() const override {\n    return m_size - m_pageOff;\n  }\n\n  int fd() const {\n    return m_fd;\n  }\n\n  static std::unique_ptr<const JSBigFileString> fromPath(const std::string& sourceURL);\n\nprivate:\n  int m_fd;                     // The file descriptor being mmaped\n  size_t m_size;                // The size of the mmaped region\n  size_t m_pageOff;             // The offset in the mmaped region to the data.\n  off_t m_mapOff;               // The offset in the file to the mmaped region.\n  mutable const char *m_data;   // Pointer to the mmaped region.\n};\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSBundleType.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSBundleType.h\"\n#include \"oss-compat-util.h\"\n\nnamespace facebook {\nnamespace react {\n\nstatic uint32_t constexpr RAMBundleMagicNumber = 0xFB0BD1E5;\nstatic uint32_t constexpr BCBundleMagicNumber  = 0x6D657300;\n\nScriptTag parseTypeFromHeader(const BundleHeader& header) {\n\n  switch (littleEndianToHost(header.magic)) {\n  case RAMBundleMagicNumber:\n    return ScriptTag::RAMBundle;\n  case BCBundleMagicNumber:\n    return ScriptTag::BCBundle;\n  default:\n    return ScriptTag::String;\n  }\n}\n\nconst char *stringForScriptTag(const ScriptTag& tag) {\n  switch (tag) {\n    case ScriptTag::String:\n      return \"String\";\n    case ScriptTag::RAMBundle:\n      return \"RAM Bundle\";\n    case ScriptTag::BCBundle:\n      return \"BC Bundle\";\n  }\n  return \"\";\n}\n\n}  // namespace react\n}  // namespace facebook\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSBundleType.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <cstdint>\n#include <cstring>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\n/*\n * ScriptTag\n *\n * Scripts given to the JS Executors to run could be in any of the following\n * formats. They are tagged so the executor knows how to run them.\n */\nenum struct ScriptTag {\n  String = 0,\n  RAMBundle,\n  BCBundle,\n};\n\n/**\n * BundleHeader\n *\n * RAM bundles and BC bundles begin with headers. For RAM bundles this is\n * 4 bytes, for BC bundles this is 12 bytes. This structure holds the first 12\n * bytes from a bundle in a way that gives access to that information.\n */\nstruct __attribute__((packed)) BundleHeader {\n  BundleHeader() {\n    std::memset(this, 0, sizeof(BundleHeader));\n  }\n\n  uint32_t magic;\n  uint32_t reserved_;\n  uint32_t version;\n};\n\n/**\n * parseTypeFromHeader\n *\n * Takes the first 8 bytes of a bundle, and returns a tag describing the\n * bundle's format.\n */\nRN_EXPORT ScriptTag parseTypeFromHeader(const BundleHeader& header);\n\n/**\n * stringForScriptTag\n *\n * Convert an `ScriptTag` enum into a string, useful for emitting in errors\n * and diagnostic messages.\n */\nRN_EXPORT const char* stringForScriptTag(const ScriptTag& tag);\n\n}  // namespace react\n}  // namespace facebook\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCExecutor.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSCExecutor.h\"\n\n#include <algorithm>\n#include <condition_variable>\n#include <fcntl.h>\n#include <mutex>\n#include <sstream>\n#include <string>\n#include <sys/time.h>\n#include <sys/socket.h>\n#include <system_error>\n\n#include <arpa/inet.h>\n#include <folly/Conv.h>\n#include <folly/Exception.h>\n#include <folly/json.h>\n#include <folly/Memory.h>\n#include <folly/String.h>\n#include <glog/logging.h>\n#include <jschelpers/JSCHelpers.h>\n#include <jschelpers/Value.h>\n#include <jsinspector/InspectorInterfaces.h>\n\n#include \"JSBigString.h\"\n#include \"JSBundleType.h\"\n#include \"JSCLegacyTracing.h\"\n#include \"JSCMemory.h\"\n#include \"JSCNativeModules.h\"\n#include \"JSCPerfStats.h\"\n#include \"JSCSamplingProfiler.h\"\n#include \"JSCTracing.h\"\n#include \"JSCUtils.h\"\n#include \"JSModulesUnbundle.h\"\n#include \"ModuleRegistry.h\"\n#include \"Platform.h\"\n#include \"RAMBundleRegistry.h\"\n#include \"RecoverableError.h\"\n#include \"SystraceSection.h\"\n\n#if defined(WITH_JSC_MEMORY_PRESSURE)\n#include <jsc_memory.h>\n#endif\n\n#if defined(WITH_FB_JSC_TUNING) && defined(__ANDROID__)\n#include <jsc_config_android.h>\n#endif\n\nnamespace facebook {\n  namespace react {\n\n    namespace {\n\n      template<JSValueRef (JSCExecutor::*method)(size_t, const JSValueRef[])>\n      inline JSObjectCallAsFunctionCallback exceptionWrapMethod() {\n        struct funcWrapper {\n          static JSValueRef call(\n                                 JSContextRef ctx,\n                                 JSObjectRef function,\n                                 JSObjectRef thisObject,\n                                 size_t argumentCount,\n                                 const JSValueRef arguments[],\n                                 JSValueRef *exception) {\n            try {\n              auto executor = Object::getGlobalObject(ctx).getPrivate<JSCExecutor>();\n              if (executor && executor->getJavaScriptContext()) { // Executor not invalidated\n                return (executor->*method)(argumentCount, arguments);\n              }\n            } catch (...) {\n              *exception = translatePendingCppExceptionToJSError(ctx, function);\n            }\n            return Value::makeUndefined(ctx);\n          }\n        };\n\n        return &funcWrapper::call;\n      }\n\n      template<JSValueRef (JSCExecutor::*method)(JSObjectRef object, JSStringRef propertyName)>\n      inline JSObjectGetPropertyCallback exceptionWrapMethod() {\n        struct funcWrapper {\n          static JSValueRef call(\n                                 JSContextRef ctx,\n                                 JSObjectRef object,\n                                 JSStringRef propertyName,\n                                 JSValueRef *exception) {\n            try {\n              auto executor = Object::getGlobalObject(ctx).getPrivate<JSCExecutor>();\n              if (executor && executor->getJavaScriptContext()) { // Executor not invalidated\n                return (executor->*method)(object, propertyName);\n              }\n            } catch (...) {\n              *exception = translatePendingCppExceptionToJSError(ctx, object);\n            }\n            return Value::makeUndefined(ctx);\n          }\n        };\n\n        return &funcWrapper::call;\n      }\n\n    }\n\n#if DEBUG\n    static JSValueRef nativeInjectHMRUpdate(\n                                            JSContextRef ctx,\n                                            JSObjectRef function,\n                                            JSObjectRef thisObject,\n                                            size_t argumentCount,\n                                            const JSValueRef arguments[],\n                                            JSValueRef *exception) {\n      String execJSString = Value(ctx, arguments[0]).toString();\n      String jsURL = Value(ctx, arguments[1]).toString();\n      evaluateScript(ctx, execJSString, jsURL);\n      return Value::makeUndefined(ctx);\n    }\n#endif\n\n    std::unique_ptr<JSExecutor> JSCExecutorFactory::createJSExecutor(\n                                                                     std::shared_ptr<ExecutorDelegate> delegate, std::shared_ptr<MessageQueueThread> jsQueue) {\n      return folly::make_unique<JSCExecutor>(delegate, jsQueue, m_jscConfig);\n    }\n\n    JSCExecutor::JSCExecutor(std::shared_ptr<ExecutorDelegate> delegate,\n                             std::shared_ptr<MessageQueueThread> messageQueueThread,\n                             const folly::dynamic& jscConfig) throw(JSException) :\n    m_delegate(delegate),\n    m_messageQueueThread(messageQueueThread),\n    m_nativeModules(delegate ? delegate->getModuleRegistry() : nullptr),\n    m_jscConfig(jscConfig) {\n      initOnJSVMThread();\n\n      {\n        SystraceSection s(\"nativeModuleProxy object\");\n        installGlobalProxy(m_context, \"nativeModuleProxy\",\n                           exceptionWrapMethod<&JSCExecutor::getNativeModule>());\n      }\n    }\n\n    JSCExecutor::~JSCExecutor() {\n      CHECK(*m_isDestroyed) << \"JSCExecutor::destroy() must be called before its destructor!\";\n    }\n\n    void JSCExecutor::destroy() {\n      *m_isDestroyed = true;\n      if (m_messageQueueThread.get()) {\n        m_messageQueueThread->runOnQueueSync([this] () {\n          terminateOnJSVMThread();\n        });\n      } else {\n        terminateOnJSVMThread();\n      }\n    }\n\n    void JSCExecutor::setContextName(const std::string& name) {\n      String jsName = String(m_context, name.c_str());\n      JSC_JSGlobalContextSetName(m_context, jsName);\n    }\n\n    static bool canUseInspector(JSContextRef context) {\n#ifdef WITH_INSPECTOR\n#if defined(__APPLE__)\n      return isCustomJSCPtr(context); // WITH_INSPECTOR && Apple\n#else\n      return true; // WITH_INSPECTOR && Android\n#endif\n#else\n      return false; // !WITH_INSPECTOR\n#endif\n    }\n\n    static bool canUseSamplingProfiler(JSContextRef context) {\n#if defined(__APPLE__) || defined(WITH_JSC_EXTRA_TRACING)\n      return JSC_JSSamplingProfilerEnabled(context);\n#else\n      return false;\n#endif\n    }\n\n    void JSCExecutor::initOnJSVMThread() throw(JSException) {\n      SystraceSection s(\"JSCExecutor::initOnJSVMThread\");\n\n#if defined(__APPLE__)\n      const bool useCustomJSC = m_jscConfig.getDefault(\"UseCustomJSC\", false).getBool();\n      if (useCustomJSC) {\n        JSC_configureJSCForIOS(true, toJson(m_jscConfig));\n      }\n#else\n      const bool useCustomJSC = false;\n#endif\n\n#if defined(WITH_FB_JSC_TUNING) && defined(__ANDROID__)\n      configureJSCForAndroid(m_jscConfig);\n#endif\n\n      // Create a custom global class, so we can store data in it later using JSObjectSetPrivate\n      JSClassRef globalClass = nullptr;\n      {\n        SystraceSection s_(\"JSClassCreate\");\n        JSClassDefinition definition = kJSClassDefinitionEmpty;\n        definition.attributes |= kJSClassAttributeNoAutomaticPrototype;\n        globalClass = JSC_JSClassCreate(useCustomJSC, &definition);\n      }\n      {\n        SystraceSection s_(\"JSGlobalContextCreateInGroup\");\n        m_context = JSC_JSGlobalContextCreateInGroup(useCustomJSC, nullptr, globalClass);\n      }\n      JSC_JSClassRelease(useCustomJSC, globalClass);\n\n      // Add a pointer to ourselves so we can retrieve it later in our hooks\n      Object::getGlobalObject(m_context).setPrivate(this);\n\n      if (canUseInspector(m_context)) {\n        const std::string ownerId = m_jscConfig.getDefault(\"OwnerIdentity\", \"unknown\").getString();\n        const std::string appId = m_jscConfig.getDefault(\"AppIdentity\", \"unknown\").getString();\n        const std::string deviceId = m_jscConfig.getDefault(\"DeviceIdentity\", \"unknown\").getString();\n        auto checkIsInspectedRemote = [ownerId, appId, deviceId]() {\n          return isNetworkInspected(ownerId, appId, deviceId);\n        };\n\n        auto& globalInspector = facebook::react::getInspectorInstance();\n        JSC_JSGlobalContextEnableDebugger(m_context, globalInspector, ownerId.c_str(), checkIsInspectedRemote);\n      }\n\n      installNativeHook<&JSCExecutor::nativeFlushQueueImmediate>(\"nativeFlushQueueImmediate\");\n      installNativeHook<&JSCExecutor::nativeCallSyncHook>(\"nativeCallSyncHook\");\n\n      installGlobalFunction(m_context, \"nativeLoggingHook\", JSCNativeHooks::loggingHook);\n      installGlobalFunction(m_context, \"nativePerformanceNow\", JSCNativeHooks::nowHook);\n\n#if DEBUG\n      installGlobalFunction(m_context, \"nativeInjectHMRUpdate\", nativeInjectHMRUpdate);\n#endif\n\n      addNativeTracingHooks(m_context);\n      addNativeTracingLegacyHooks(m_context);\n      addJSCMemoryHooks(m_context);\n      addJSCPerfStatsHooks(m_context);\n\n      JSCNativeHooks::installPerfHooks(m_context);\n\n      if (canUseSamplingProfiler(m_context)) {\n        initSamplingProfilerOnMainJSCThread(m_context);\n      }\n    }\n\n    bool JSCExecutor::isNetworkInspected(const std::string &owner, const std::string &app, const std::string &device) {\n#ifdef WITH_FB_DBG_ATTACH_BEFORE_EXEC\n      auto connect_socket = [](int socket_desc, std::string address, int port) {\n        if (socket_desc < 0) {\n          ::close(socket_desc);\n          return false;\n        }\n\n        struct timeval tv;\n        tv.tv_sec = 1;\n        tv.tv_usec = 0;\n        auto sock_opt_rcv_resp = setsockopt(socket_desc, SOL_SOCKET, SO_RCVTIMEO, (const char*)&tv, sizeof(struct timeval));\n        if (sock_opt_rcv_resp < 0) {\n          ::close(socket_desc);\n          return false;\n        }\n\n        auto sock_opt_snd_resp = setsockopt(socket_desc, SOL_SOCKET, SO_SNDTIMEO, (const char*)&tv, sizeof(struct timeval));\n        if (sock_opt_snd_resp < 0) {\n          ::close(socket_desc);\n          return false;\n        }\n\n        struct sockaddr_in server;\n        server.sin_addr.s_addr = inet_addr(address.c_str());\n        server.sin_family = AF_INET;\n        server.sin_port = htons(port);\n        auto connect_resp = ::connect(socket_desc, (struct sockaddr *)&server, sizeof(server));\n        if (connect_resp < 0) {\n          ::close(socket_desc);\n          return false;\n        }\n\n        return true;\n      };\n\n      int socket_desc = socket(AF_INET, SOCK_STREAM, 0);\n\n      if (!connect_socket(socket_desc, \"127.0.0.1\", 8082)) {\n#if defined(__ANDROID__)\n        socket_desc = socket(AF_INET, SOCK_STREAM, 0);\n        if (!connect_socket(socket_desc, \"10.0.2.2\", 8082) /* emulator */) {\n          socket_desc = socket(AF_INET, SOCK_STREAM, 0);\n          if (!connect_socket(socket_desc, \"10.0.3.2\", 8082) /* genymotion */) {\n            return false;\n          }\n        }\n#else //!defined(__ANDROID__)\n        return false;\n#endif //defined(__ANDROID__)\n      }\n\n      std::string escapedOwner = folly::uriEscape<std::string>(owner, folly::UriEscapeMode::QUERY);\n      std::string escapedApp = folly::uriEscape<std::string>(app, folly::UriEscapeMode::QUERY);\n      std::string escapedDevice = folly::uriEscape<std::string>(device, folly::UriEscapeMode::QUERY);\n      std::string msg = folly::to<std::string>(\n        \"GET /autoattach?title=\", escapedOwner,\n        \"&app=\" , escapedApp,\n        \"&device=\" , escapedDevice,\n        \" HTTP/1.1\\r\\n\\r\\n\");\n      auto send_resp = ::send(socket_desc, msg.c_str(), msg.length(), 0);\n      if (send_resp < 0) {\n        ::close(socket_desc);\n        return false;\n      }\n\n      char server_reply[200];\n      server_reply[199] = '\\0';\n      auto recv_resp = ::recv(socket_desc, server_reply,\n                              sizeof(server_reply) - 1, 0);\n      if (recv_resp < 0) {\n        ::close(socket_desc);\n        return false;\n      }\n\n      std::string response(server_reply);\n      if (response.size() < 25) {\n        ::close(socket_desc);\n        return false;\n      }\n      auto responseCandidate = response.substr(response.size() - 25);\n      auto found = responseCandidate.find(\"{\\\"autoattach\\\":true}\") != std::string::npos;\n      ::close(socket_desc);\n      return found;\n#else //!WITH_FB_DBG_ATTACH_BEFORE_EXEC\n      return false;\n#endif //WITH_FB_DBG_ATTACH_BEFORE_EXEC\n    }\n\n    void JSCExecutor::terminateOnJSVMThread() {\n      JSGlobalContextRef context = m_context;\n      m_context = nullptr;\n      Object::getGlobalObject(context).setPrivate(nullptr);\n      m_nativeModules.reset();\n\n      if (canUseInspector(context)) {\n        auto &globalInspector = facebook::react::getInspectorInstance();\n        JSC_JSGlobalContextDisableDebugger(context, globalInspector);\n      }\n\n      JSC_JSGlobalContextRelease(context);\n    }\n\n#ifdef WITH_FBJSCEXTENSIONS\n    static const char* explainLoadSourceStatus(JSLoadSourceStatus status) {\n      switch (status) {\n        case JSLoadSourceIsCompiled:\n          return \"No error encountered during source load\";\n\n        case JSLoadSourceErrorOnRead:\n          return \"Error reading source\";\n\n        case JSLoadSourceIsNotCompiled:\n          return \"Source is not compiled\";\n\n        case JSLoadSourceErrorVersionMismatch:\n          return \"Source version not supported\";\n\n        default:\n          return \"Bad error code\";\n      }\n    }\n#endif\n\n    // basename_r isn't in all iOS SDKs, so use this simple version instead.\n    static std::string simpleBasename(const std::string &path) {\n      size_t pos = path.rfind(\"/\");\n      return (pos != std::string::npos) ? path.substr(pos) : path;\n    }\n\n    void JSCExecutor::loadApplicationScript(std::unique_ptr<const JSBigString> script, std::string sourceURL) {\n      SystraceSection s(\"JSCExecutor::loadApplicationScript\",\n                        \"sourceURL\", sourceURL);\n\n      std::string scriptName = simpleBasename(sourceURL);\n      ReactMarker::logTaggedMarker(ReactMarker::RUN_JS_BUNDLE_START, scriptName.c_str());\n      String jsSourceURL(m_context, sourceURL.c_str());\n\n      // TODO t15069155: reduce the number of overrides here\n#ifdef WITH_FBJSCEXTENSIONS\n      if (auto fileStr = dynamic_cast<const JSBigFileString *>(script.get())) {\n        JSContextLock lock(m_context);\n        JSLoadSourceStatus jsStatus;\n        auto bcSourceCode = JSCreateSourceCodeFromFile(fileStr->fd(), jsSourceURL, nullptr, &jsStatus);\n\n        switch (jsStatus) {\n          case JSLoadSourceIsCompiled:\n            if (!bcSourceCode) {\n              throw std::runtime_error(\"Unexpected error opening compiled bundle\");\n            }\n            evaluateSourceCode(m_context, bcSourceCode, jsSourceURL);\n\n            flush();\n\n            ReactMarker::logMarker(ReactMarker::CREATE_REACT_CONTEXT_STOP);\n            ReactMarker::logTaggedMarker(ReactMarker::RUN_JS_BUNDLE_STOP, scriptName.c_str());\n            return;\n\n          case JSLoadSourceErrorVersionMismatch:\n            throw RecoverableError(explainLoadSourceStatus(jsStatus));\n\n          case JSLoadSourceErrorOnRead:\n          case JSLoadSourceIsNotCompiled:\n            // Not bytecode, fall through.\n            break;\n        }\n      }\n#elif defined(__APPLE__)\n      BundleHeader header;\n      memcpy(&header, script->c_str(), std::min(script->size(), sizeof(BundleHeader)));\n      auto scriptTag = parseTypeFromHeader(header);\n\n      if (scriptTag == ScriptTag::BCBundle) {\n        using file_ptr = std::unique_ptr<FILE, decltype(&fclose)>;\n        file_ptr source(fopen(sourceURL.c_str(), \"r\"), fclose);\n        int sourceFD = fileno(source.get());\n\n        JSValueRef jsError;\n        JSValueRef result = JSC_JSEvaluateBytecodeBundle(m_context, NULL, sourceFD, jsSourceURL, &jsError);\n        if (result == nullptr) {\n          throw JSException(m_context, jsError, jsSourceURL);\n        }\n      } else\n#endif\n      {\n        String jsScript;\n        JSContextLock lock(m_context);\n        {\n          SystraceSection s_(\"JSCExecutor::loadApplicationScript-createExpectingAscii\");\n          ReactMarker::logMarker(ReactMarker::JS_BUNDLE_STRING_CONVERT_START);\n          jsScript = adoptString(std::move(script));\n          ReactMarker::logMarker(ReactMarker::JS_BUNDLE_STRING_CONVERT_STOP);\n        }\n\n        SystraceSection s_(\"JSCExecutor::loadApplicationScript-evaluateScript\");\n        evaluateScript(m_context, jsScript, jsSourceURL);\n      }\n\n      flush();\n\n      ReactMarker::logMarker(ReactMarker::CREATE_REACT_CONTEXT_STOP);\n      ReactMarker::logTaggedMarker(ReactMarker::RUN_JS_BUNDLE_STOP, scriptName.c_str());\n    }\n\n    void JSCExecutor::setBundleRegistry(std::unique_ptr<RAMBundleRegistry> bundleRegistry) {\n      if (!m_bundleRegistry) {\n        installNativeHook<&JSCExecutor::nativeRequire>(\"nativeRequire\");\n      }\n      m_bundleRegistry = std::move(bundleRegistry);\n    }\n\n    void JSCExecutor::registerBundle(uint32_t bundleId, const std::string& bundlePath) {\n      if (m_bundleRegistry) {\n        m_bundleRegistry->registerBundle(bundleId, bundlePath);\n      }\n    }\n\n    void JSCExecutor::bindBridge() throw(JSException) {\n      SystraceSection s(\"JSCExecutor::bindBridge\");\n      std::call_once(m_bindFlag, [this] {\n        auto global = Object::getGlobalObject(m_context);\n        auto batchedBridgeValue = global.getProperty(\"__fbBatchedBridge\");\n        if (batchedBridgeValue.isUndefined()) {\n          auto requireBatchedBridge = global.getProperty(\"__fbRequireBatchedBridge\");\n          if (!requireBatchedBridge.isUndefined()) {\n            batchedBridgeValue = requireBatchedBridge.asObject().callAsFunction({});\n          }\n          if (batchedBridgeValue.isUndefined()) {\n            throw JSException(\"Could not get BatchedBridge, make sure your bundle is packaged correctly\");\n          }\n        }\n\n        auto batchedBridge = batchedBridgeValue.asObject();\n        m_callFunctionReturnFlushedQueueJS = batchedBridge.getProperty(\"callFunctionReturnFlushedQueue\").asObject();\n        m_invokeCallbackAndReturnFlushedQueueJS = batchedBridge.getProperty(\"invokeCallbackAndReturnFlushedQueue\").asObject();\n        m_flushedQueueJS = batchedBridge.getProperty(\"flushedQueue\").asObject();\n        m_callFunctionReturnResultAndFlushedQueueJS = batchedBridge.getProperty(\"callFunctionReturnResultAndFlushedQueue\").asObject();\n      });\n    }\n\n    void JSCExecutor::callNativeModules(Value&& value) {\n      SystraceSection s(\"JSCExecutor::callNativeModules\");\n      // If this fails, you need to pass a fully functional delegate with a\n      // module registry to the factory/ctor.\n      CHECK(m_delegate) << \"Attempting to use native modules without a delegate\";\n      try {\n        auto calls = value.toJSONString();\n        m_delegate->callNativeModules(*this, folly::parseJson(calls), true);\n      } catch (...) {\n        std::string message = \"Error in callNativeModules()\";\n        try {\n          message += \":\" + value.toString().str();\n        } catch (...) {\n          // ignored\n        }\n        std::throw_with_nested(std::runtime_error(message));\n      }\n    }\n\n    void JSCExecutor::flush() {\n      SystraceSection s(\"JSCExecutor::flush\");\n\n      if (m_flushedQueueJS) {\n        callNativeModules(m_flushedQueueJS->callAsFunction({}));\n        return;\n      }\n\n      // When a native module is called from JS, BatchedBridge.enqueueNativeCall()\n      // is invoked.  For that to work, require('BatchedBridge') has to be called,\n      // and when that happens, __fbBatchedBridge is set as a side effect.\n      auto global = Object::getGlobalObject(m_context);\n      auto batchedBridgeValue = global.getProperty(\"__fbBatchedBridge\");\n      // So here, if __fbBatchedBridge doesn't exist, then we know no native calls\n      // have happened, and we were able to determine this without forcing\n      // BatchedBridge to be loaded as a side effect.\n      if (!batchedBridgeValue.isUndefined()) {\n        // If calls were made, we bind to the JS bridge methods, and use them to\n        // get the pending queue of native calls.\n        bindBridge();\n        callNativeModules(m_flushedQueueJS->callAsFunction({}));\n      } else if (m_delegate) {\n        // If we have a delegate, we need to call it; we pass a null list to\n        // callNativeModules, since we know there are no native calls, without\n        // calling into JS again.  If no calls were made and there's no delegate,\n        // nothing happens, which is correct.\n        callNativeModules(Value::makeNull(m_context));\n      }\n    }\n\n    void JSCExecutor::callFunction(const std::string& moduleId, const std::string& methodId, const folly::dynamic& arguments) {\n      SystraceSection s(\"JSCExecutor::callFunction\");\n      // This weird pattern is because Value is not default constructible.\n      // The lambda is inlined, so there's no overhead.\n      auto result = [&] {\n        JSContextLock lock(m_context);\n        try {\n          if (!m_callFunctionReturnResultAndFlushedQueueJS) {\n            bindBridge();\n          }\n          return m_callFunctionReturnFlushedQueueJS->callAsFunction({\n            Value(m_context, String::createExpectingAscii(m_context, moduleId)),\n            Value(m_context, String::createExpectingAscii(m_context, methodId)),\n            Value::fromDynamic(m_context, std::move(arguments))\n          });\n        } catch (...) {\n          std::throw_with_nested(\n                                 std::runtime_error(\"Error calling \" + moduleId + \".\" + methodId));\n        }\n      }();\n      callNativeModules(std::move(result));\n    }\n\n    void JSCExecutor::invokeCallback(const double callbackId, const folly::dynamic& arguments) {\n      SystraceSection s(\"JSCExecutor::invokeCallback\");\n      auto result = [&] {\n        JSContextLock lock(m_context);\n        try {\n          if (!m_invokeCallbackAndReturnFlushedQueueJS) {\n            bindBridge();\n          }\n          return m_invokeCallbackAndReturnFlushedQueueJS->callAsFunction({\n            Value::makeNumber(m_context, callbackId),\n            Value::fromDynamic(m_context, std::move(arguments))\n          });\n        } catch (...) {\n          std::throw_with_nested(\n                                 std::runtime_error(folly::to<std::string>(\"Error invoking callback \", callbackId)));\n        }\n      }();\n      callNativeModules(std::move(result));\n    }\n\n    Value JSCExecutor::callFunctionSyncWithValue(\n                                                 const std::string& module, const std::string& method, Value args) {\n      SystraceSection s(\"JSCExecutor::callFunction\");\n      Object result = [&] {\n        JSContextLock lock(m_context);\n        if (!m_callFunctionReturnResultAndFlushedQueueJS) {\n          bindBridge();\n        }\n        return m_callFunctionReturnResultAndFlushedQueueJS->callAsFunction({\n          Value(m_context, String::createExpectingAscii(m_context, module)),\n          Value(m_context, String::createExpectingAscii(m_context, method)),\n          std::move(args),\n        }).asObject();\n      }();\n\n      Value length = result.getProperty(\"length\");\n\n      if (!length.isNumber() || length.asInteger() != 2) {\n        std::runtime_error(\"Return value of a callFunction must be an array of size 2\");\n      }\n      callNativeModules(result.getPropertyAtIndex(1));\n      return result.getPropertyAtIndex(0);\n    }\n\n    void JSCExecutor::setGlobalVariable(std::string propName, std::unique_ptr<const JSBigString> jsonValue) {\n      try {\n        SystraceSection s(\"JSCExecutor::setGlobalVariable\", \"propName\", propName);\n        auto valueToInject = Value::fromJSON(adoptString(std::move(jsonValue)));\n        Object::getGlobalObject(m_context).setProperty(propName.c_str(), valueToInject);\n      } catch (...) {\n        std::throw_with_nested(std::runtime_error(\"Error setting global variable: \" + propName));\n      }\n    }\n\n    std::string JSCExecutor::getDescription() {\n#if defined(__APPLE__)\n      if (isCustomJSCPtr(m_context)) {\n        return \"Custom JSC\";\n      } else {\n        return \"System JSC\";\n      }\n#else\n      return \"JSC\";\n#endif\n    }\n\n    String JSCExecutor::adoptString(std::unique_ptr<const JSBigString> script) {\n#if defined(WITH_FBJSCEXTENSIONS)\n      const JSBigString* string = script.release();\n      auto jsString = JSStringCreateAdoptingExternal(string->c_str(), string->size(), (void*)string, [](void* s) {\n        delete static_cast<JSBigString*>(s);\n      });\n      return String::adopt(m_context, jsString);\n#else\n      return script->isAscii()\n      ? String::createExpectingAscii(m_context, script->c_str(), script->size())\n      : String(m_context, script->c_str());\n#endif\n    }\n\n    void* JSCExecutor::getJavaScriptContext() {\n      return m_context;\n    }\n\n    bool JSCExecutor::isInspectable() {\n      return canUseInspector(m_context);\n    }\n\n#ifdef WITH_JSC_MEMORY_PRESSURE\n    void JSCExecutor::handleMemoryPressure(int pressureLevel) {\n      JSHandleMemoryPressure(this, m_context, static_cast<JSMemoryPressure>(pressureLevel));\n    }\n#endif\n\n    void JSCExecutor::flushQueueImmediate(Value&& queue) {\n      auto queueStr = queue.toJSONString();\n      m_delegate->callNativeModules(*this, folly::parseJson(queueStr), false);\n    }\n\n    void JSCExecutor::loadModule(uint32_t bundleId, uint32_t moduleId) {\n      auto module = m_bundleRegistry->getModule(bundleId, moduleId);\n      auto sourceUrl = String::createExpectingAscii(m_context, module.name);\n      auto source = adoptString(std::unique_ptr<JSBigString>(new JSBigStdString(module.code)));\n      evaluateScript(m_context, source, sourceUrl);\n    }\n\n    // Native JS hooks\n    template<JSValueRef (JSCExecutor::*method)(size_t, const JSValueRef[])>\n    void JSCExecutor::installNativeHook(const char* name) {\n      installGlobalFunction(m_context, name, exceptionWrapMethod<method>());\n    }\n\n    JSValueRef JSCExecutor::getNativeModule(JSObjectRef object, JSStringRef propertyName) {\n      if (JSC_JSStringIsEqualToUTF8CString(m_context, propertyName, \"name\")) {\n        return Value(m_context, String(m_context, \"NativeModules\"));\n      }\n\n      return m_nativeModules.getModule(m_context, propertyName);\n    }\n\n    JSValueRef JSCExecutor::nativeRequire(\n                                          size_t argumentCount,\n                                          const JSValueRef arguments[]) {\n      uint32_t bundleId, moduleId;\n      std::tie(bundleId, moduleId) = parseNativeRequireParameters(m_context, arguments, argumentCount);\n      ReactMarker::logMarker(ReactMarker::NATIVE_REQUIRE_START);\n      loadModule(bundleId, moduleId);\n      ReactMarker::logMarker(ReactMarker::NATIVE_REQUIRE_STOP);\n      return Value::makeUndefined(m_context);\n    }\n\n    JSValueRef JSCExecutor::nativeFlushQueueImmediate(\n                                                      size_t argumentCount,\n                                                      const JSValueRef arguments[]) {\n      if (argumentCount != 1) {\n        throw std::invalid_argument(\"Got wrong number of args\");\n      }\n\n      flushQueueImmediate(Value(m_context, arguments[0]));\n      return Value::makeUndefined(m_context);\n    }\n\n    JSValueRef JSCExecutor::nativeCallSyncHook(\n                                               size_t argumentCount,\n                                               const JSValueRef arguments[]) {\n      if (argumentCount != 3) {\n        throw std::invalid_argument(\"Got wrong number of args\");\n      }\n\n      unsigned int moduleId = Value(m_context, arguments[0]).asUnsignedInteger();\n      unsigned int methodId = Value(m_context, arguments[1]).asUnsignedInteger();\n      folly::dynamic args = folly::parseJson(Value(m_context, arguments[2]).toJSONString());\n\n      if (!args.isArray()) {\n        throw std::invalid_argument(\n                                    folly::to<std::string>(\"method parameters should be array, but are \", args.typeName()));\n      }\n\n      MethodCallResult result = m_delegate->callSerializableNativeHook(\n                                                                       *this,\n                                                                       moduleId,\n                                                                       methodId,\n                                                                       std::move(args));\n      if (!result.hasValue()) {\n        return Value::makeUndefined(m_context);\n      }\n      return Value::fromDynamic(m_context, result.value());\n    }\n\n  } }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCExecutor.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <cstdint>\n#include <memory>\n#include <mutex>\n\n#include <cxxreact/JSCNativeModules.h>\n#include <cxxreact/JSExecutor.h>\n#include <folly/Optional.h>\n#include <folly/json.h>\n#include <jschelpers/JSCHelpers.h>\n#include <jschelpers/JavaScriptCore.h>\n#include <jschelpers/Value.h>\n#include <privatedata/PrivateDataBase.h>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\nclass MessageQueueThread;\nclass RAMBundleRegistry;\n\nclass RN_EXPORT JSCExecutorFactory : public JSExecutorFactory {\npublic:\n  JSCExecutorFactory(const folly::dynamic& jscConfig) :\n    m_jscConfig(jscConfig) {}\n  std::unique_ptr<JSExecutor> createJSExecutor(\n    std::shared_ptr<ExecutorDelegate> delegate,\n    std::shared_ptr<MessageQueueThread> jsQueue) override;\nprivate:\n  std::string m_cacheDir;\n  folly::dynamic m_jscConfig;\n};\n\ntemplate<typename T>\nstruct JSCValueEncoder {\n  // If you get a build error here, it means the compiler can't see the template instantation of toJSCValue\n  // applicable to your type.\n  static const Value toJSCValue(JSGlobalContextRef ctx, T&& value);\n};\n\ntemplate<>\nstruct JSCValueEncoder<folly::dynamic> {\n  static const Value toJSCValue(JSGlobalContextRef ctx, const folly::dynamic &&value) {\n    return Value::fromDynamic(ctx, value);\n  }\n};\n\nclass RN_EXPORT JSCExecutor : public JSExecutor, public PrivateDataBase {\npublic:\n  /**\n   * Must be invoked from thread this Executor will run on.\n   */\n  explicit JSCExecutor(std::shared_ptr<ExecutorDelegate> delegate,\n                       std::shared_ptr<MessageQueueThread> messageQueueThread,\n                       const folly::dynamic& jscConfig) throw(JSException);\n  ~JSCExecutor() override;\n\n  virtual void loadApplicationScript(\n    std::unique_ptr<const JSBigString> script,\n    std::string sourceURL) override;\n\n  virtual void setBundleRegistry(std::unique_ptr<RAMBundleRegistry> bundleRegistry) override;\n  virtual void registerBundle(uint32_t bundleId, const std::string& bundlePath) override;\n\n  virtual void callFunction(\n    const std::string& moduleId,\n    const std::string& methodId,\n    const folly::dynamic& arguments) override;\n\n  virtual void invokeCallback(\n    const double callbackId,\n    const folly::dynamic& arguments) override;\n\n  template <typename T>\n  Value callFunctionSync(\n      const std::string& module, const std::string& method, T&& args) {\n    return callFunctionSyncWithValue(\n      module, method, JSCValueEncoder<typename std::decay<T>::type>::toJSCValue(\n        m_context, std::forward<T>(args)));\n  }\n\n  virtual void setGlobalVariable(\n    std::string propName,\n    std::unique_ptr<const JSBigString> jsonValue) override;\n\n  virtual std::string getDescription() override;\n\n  virtual void* getJavaScriptContext() override;\n\n  virtual bool isInspectable() override;\n\n#ifdef WITH_JSC_MEMORY_PRESSURE\n  virtual void handleMemoryPressure(int pressureLevel) override;\n#endif\n\n  virtual void destroy() override;\n\n  void setContextName(const std::string& name);\n\nprivate:\n  JSGlobalContextRef m_context;\n  std::shared_ptr<ExecutorDelegate> m_delegate;\n  std::shared_ptr<bool> m_isDestroyed = std::shared_ptr<bool>(new bool(false));\n  std::shared_ptr<MessageQueueThread> m_messageQueueThread;\n  std::unique_ptr<RAMBundleRegistry> m_bundleRegistry;\n  JSCNativeModules m_nativeModules;\n  folly::dynamic m_jscConfig;\n  std::once_flag m_bindFlag;\n\n  folly::Optional<Object> m_invokeCallbackAndReturnFlushedQueueJS;\n  folly::Optional<Object> m_callFunctionReturnFlushedQueueJS;\n  folly::Optional<Object> m_flushedQueueJS;\n  folly::Optional<Object> m_callFunctionReturnResultAndFlushedQueueJS;\n\n  void initOnJSVMThread() throw(JSException);\n  static bool isNetworkInspected(const std::string &owner, const std::string &app, const std::string &device);\n  // This method is experimental, and may be modified or removed.\n  Value callFunctionSyncWithValue(\n    const std::string& module, const std::string& method, Value value);\n  void terminateOnJSVMThread();\n  void bindBridge() throw(JSException);\n  void callNativeModules(Value&&);\n  void flush();\n  void flushQueueImmediate(Value&&);\n  void loadModule(uint32_t bundleId, uint32_t moduleId);\n\n  String adoptString(std::unique_ptr<const JSBigString>);\n\n  template<JSValueRef (JSCExecutor::*method)(size_t, const JSValueRef[])>\n  void installNativeHook(const char* name);\n  JSValueRef getNativeModule(JSObjectRef object, JSStringRef propertyName);\n\n  JSValueRef nativeRequire(\n      size_t argumentCount,\n      const JSValueRef arguments[]);\n  JSValueRef nativeFlushQueueImmediate(\n      size_t argumentCount,\n      const JSValueRef arguments[]);\n  JSValueRef nativeCallSyncHook(\n      size_t argumentCount,\n      const JSValueRef arguments[]);\n};\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCLegacyTracing.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSCLegacyTracing.h\"\n\n#if defined(WITH_JSC_EXTRA_TRACING)\n\n#include <fbsystrace.h>\n#include <JavaScriptCore/API/JSProfilerPrivate.h>\n#include <jschelpers/JSCHelpers.h>\n#include <jschelpers/Value.h>\n\nstatic const char *ENABLED_FBSYSTRACE_PROFILE_NAME = \"__fbsystrace__\";\n\nusing namespace facebook::react;\n\nstatic int64_t int64FromJSValue(JSContextRef ctx, JSValueRef value, JSValueRef* exception) {\n  return static_cast<int64_t>(JSC_JSValueToNumber(ctx, value, exception));\n}\n\nstatic JSValueRef nativeTraceBeginLegacy(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  if (FBSYSTRACE_LIKELY(argumentCount >= 1)) {\n    uint64_t tag = int64FromJSValue(ctx, arguments[0], exception);\n    if (!fbsystrace_is_tracing(tag)) {\n      return Value::makeUndefined(ctx);\n    }\n  }\n\n  JSStartProfiling(ctx, String(ctx, ENABLED_FBSYSTRACE_PROFILE_NAME), true);\n\n  return Value::makeUndefined(ctx);\n}\n\nstatic JSValueRef nativeTraceEndLegacy(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  if (FBSYSTRACE_LIKELY(argumentCount >= 1)) {\n    uint64_t tag = int64FromJSValue(ctx, arguments[0], exception);\n    if (!fbsystrace_is_tracing(tag)) {\n      return Value::makeUndefined(ctx);\n    }\n  }\n\n  JSEndProfiling(ctx, String(ctx, ENABLED_FBSYSTRACE_PROFILE_NAME));\n\n  return Value::makeUndefined(ctx);\n}\n\n#endif\n\nnamespace facebook {\nnamespace react {\n\nvoid addNativeTracingLegacyHooks(JSGlobalContextRef ctx) {\n#if defined(WITH_JSC_EXTRA_TRACING)\n  installGlobalFunction(ctx, \"nativeTraceBeginLegacy\", nativeTraceBeginLegacy);\n  installGlobalFunction(ctx, \"nativeTraceEndLegacy\", nativeTraceEndLegacy);\n#endif\n}\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCLegacyTracing.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <jschelpers/JavaScriptCore.h>\n\nnamespace facebook {\nnamespace react {\n\nvoid addNativeTracingLegacyHooks(JSGlobalContextRef ctx);\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCMemory.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSCMemory.h\"\n\n#ifdef WITH_FB_MEMORY_PROFILING\n\n#include <stdio.h>\n#include <string.h>\n#include <JavaScriptCore/API/JSProfilerPrivate.h>\n#include <jschelpers/JSCHelpers.h>\n#include <jschelpers/Value.h>\n\nusing namespace facebook::react;\n\nstatic JSValueRef nativeCaptureHeap(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  if (argumentCount < 1) {\n    if (exception) {\n      *exception = Value::makeError(\n        ctx,\n        \"nativeCaptureHeap requires the path to save the capture\");\n    }\n    return Value::makeUndefined(ctx);\n  }\n\n  auto outputFilename = Value(ctx, arguments[0]).toString();\n  JSCaptureHeap(ctx, outputFilename.str().c_str(), exception);\n  return Value::makeUndefined(ctx);\n}\n\n#endif // WITH_FB_MEMORY_PROFILING\n\nnamespace facebook {\nnamespace react {\n\nvoid addJSCMemoryHooks(JSGlobalContextRef ctx) {\n#ifdef WITH_FB_MEMORY_PROFILING\n  installGlobalFunction(ctx, \"nativeCaptureHeap\", nativeCaptureHeap);\n#endif // WITH_FB_MEMORY_PROFILING\n}\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCMemory.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <jschelpers/JavaScriptCore.h>\n\nnamespace facebook {\nnamespace react {\n\nvoid addJSCMemoryHooks(JSGlobalContextRef ctx);\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCNativeModules.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSCNativeModules.h\"\n\n#include <string>\n\n#include \"Platform.h\"\n\nnamespace facebook {\nnamespace react {\n\nJSCNativeModules::JSCNativeModules(std::shared_ptr<ModuleRegistry> moduleRegistry) :\n  m_moduleRegistry(std::move(moduleRegistry)) {}\n\nJSValueRef JSCNativeModules::getModule(JSContextRef context, JSStringRef jsName) {\n  if (!m_moduleRegistry) {\n    return nullptr;\n  }\n\n  std::string moduleName = String::ref(context, jsName).str();\n\n  const auto it = m_objects.find(moduleName);\n  if (it != m_objects.end()) {\n    return static_cast<JSObjectRef>(it->second);\n  }\n\n  auto module = createModule(moduleName, context);\n  if (!module.hasValue()) {\n    // Allow lookup to continue in the objects own properties, which allows for overrides of NativeModules\n    return nullptr;\n  }\n\n  // Protect since we'll be holding on to this value, even though JS may not\n  module->makeProtected();\n\n  auto result = m_objects.emplace(std::move(moduleName), std::move(*module)).first;\n  return static_cast<JSObjectRef>(result->second);\n}\n\nvoid JSCNativeModules::reset() {\n  m_genNativeModuleJS = nullptr;\n  m_objects.clear();\n}\n\nfolly::Optional<Object> JSCNativeModules::createModule(const std::string& name, JSContextRef context) {\n  ReactMarker::logTaggedMarker(ReactMarker::NATIVE_MODULE_SETUP_START, name.c_str());\n\n  if (!m_genNativeModuleJS) {\n    auto global = Object::getGlobalObject(context);\n    m_genNativeModuleJS = global.getProperty(\"__fbGenNativeModule\").asObject();\n    m_genNativeModuleJS->makeProtected();\n  }\n\n  auto result = m_moduleRegistry->getConfig(name);\n  if (!result.hasValue()) {\n    return nullptr;\n  }\n\n  Value moduleInfo = m_genNativeModuleJS->callAsFunction({\n    Value::fromDynamic(context, result->config),\n    Value::makeNumber(context, result->index)\n  });\n  CHECK(!moduleInfo.isNull()) << \"Module returned from genNativeModule is null\";\n\n  folly::Optional<Object> module(moduleInfo.asObject().getProperty(\"module\").asObject());\n\n  ReactMarker::logTaggedMarker(ReactMarker::NATIVE_MODULE_SETUP_STOP, name.c_str());\n\n  return module;\n}\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCNativeModules.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <memory>\n#include <string>\n\n#include <cxxreact/ModuleRegistry.h>\n#include <folly/Optional.h>\n#include <jschelpers/Value.h>\n\nnamespace facebook {\nnamespace react {\n\n/**\n * Holds and creates JS representations of the modules in ModuleRegistry\n */\nclass JSCNativeModules {\n\npublic:\n  explicit JSCNativeModules(std::shared_ptr<ModuleRegistry> moduleRegistry);\n  JSValueRef getModule(JSContextRef context, JSStringRef name);\n  void reset();\n\nprivate:\n  folly::Optional<Object> m_genNativeModuleJS;\n  std::shared_ptr<ModuleRegistry> m_moduleRegistry;\n  std::unordered_map<std::string, Object> m_objects;\n\n  folly::Optional<Object> createModule(const std::string& name, JSContextRef context);\n};\n\n}\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCPerfStats.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSCPerfStats.h\"\n\n#ifdef JSC_HAS_PERF_STATS_API\n\n#include <cstdint>\n\n#include <sys/time.h>\n#include <sys/resource.h>\n\n#include <JavaScriptCore/JSPerfStats.h>\n#include <jschelpers/JSCHelpers.h>\n#include <jschelpers/Value.h>\n\nusing namespace facebook::react;\n\nstatic uint64_t toMillis(struct timeval tv) {\n  return tv.tv_sec * 1000ULL + tv.tv_usec / 1000ULL;\n}\n\nstatic JSValueRef nativeGetProcessPerfStats(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  struct rusage usage{};\n  if (getrusage(RUSAGE_SELF, &usage) != 0) {\n    return Value::makeUndefined(ctx);\n  }\n\n  auto result = Object::create(ctx);\n  uint64_t cpu_time_ms = toMillis(usage.ru_utime) + toMillis(usage.ru_stime);\n  result.setProperty(\"major_faults\", Value::makeNumber(ctx, usage.ru_majflt));\n  result.setProperty(\"minor_faults\", Value::makeNumber(ctx, usage.ru_minflt));\n  result.setProperty(\"cpu_time_ms\", Value::makeNumber(ctx, cpu_time_ms));\n  result.setProperty(\"input_blocks\", Value::makeNumber(ctx, usage.ru_inblock));\n  result.setProperty(\"output_blocks\", Value::makeNumber(ctx, usage.ru_oublock));\n  return static_cast<JSObjectRef>(result);\n}\n\nstatic JSValueRef nativeGetHeapStats(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  JSHeapStats heapStats = {0};\n  JSGetHeapStats(ctx, &heapStats);\n\n  auto result = Object::create(ctx);\n  result.setProperty(\"size\", Value::makeNumber(ctx, heapStats.size));\n  result.setProperty(\"extra_size\", Value::makeNumber(ctx, heapStats.extraSize));\n  result.setProperty(\"capacity\", Value::makeNumber(ctx, heapStats.capacity));\n  result.setProperty(\"object_count\", Value::makeNumber(ctx, heapStats.objectCount));\n  result.setProperty(\"object_size\", Value::makeNumber(ctx, heapStats.objectSizeAfterLastCollect));\n  result.setProperty(\"object_capacity\", Value::makeNumber(ctx, heapStats.objectCapacityAfterLastCollect));\n  result.setProperty(\"block_size\", Value::makeNumber(ctx, heapStats.blockSize));\n  result.setProperty(\"malloc_size\", Value::makeNumber(ctx, heapStats.mallocSize));\n  return static_cast<JSObjectRef>(result);\n}\n\nstatic JSValueRef nativeGetGCStats(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  JSGCStats gcStats = {0};\n  JSGetGCStats(ctx, &gcStats);\n\n  auto result = Object::create(ctx);\n  result.setProperty(\"last_full_gc_length\", Value::makeNumber(ctx, gcStats.lastFullGCLength));\n  result.setProperty(\"last_eden_gc_length\", Value::makeNumber(ctx, gcStats.lastEdenGCLength));\n  return static_cast<JSObjectRef>(result);\n}\n\n#endif\n\nnamespace facebook {\nnamespace react {\n\nvoid addJSCPerfStatsHooks(JSGlobalContextRef ctx) {\n#ifdef JSC_HAS_PERF_STATS_API\n  installGlobalFunction(ctx, \"nativeGetProcessPerfStats\", nativeGetProcessPerfStats);\n  installGlobalFunction(ctx, \"nativeGetHeapStats\", nativeGetHeapStats);\n  installGlobalFunction(ctx, \"nativeGetGCStats\", nativeGetGCStats);\n#endif\n}\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCPerfStats.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <jschelpers/JavaScriptCore.h>\n\nnamespace facebook {\nnamespace react {\n\nvoid addJSCPerfStatsHooks(JSGlobalContextRef ctx);\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCSamplingProfiler.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSCSamplingProfiler.h\"\n\n#include <jschelpers/JSCHelpers.h>\n\nstatic JSValueRef pokeSamplingProfiler(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  return JSC_JSPokeSamplingProfiler(ctx);\n}\n\nnamespace facebook {\nnamespace react {\n\nvoid initSamplingProfilerOnMainJSCThread(JSGlobalContextRef ctx) {\n  JSC_JSStartSamplingProfilingOnMainJSCThread(ctx);\n\n  // Allow the profiler to be poked from JS as well\n  // (see SamplingProfiler.js for an example of how it could be used with the JSCSamplingProfiler module).\n  installGlobalFunction(ctx, \"pokeSamplingProfiler\", pokeSamplingProfiler);\n}\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCSamplingProfiler.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <jschelpers/JavaScriptCore.h>\n\nnamespace facebook {\nnamespace react {\n\nvoid initSamplingProfilerOnMainJSCThread(JSGlobalContextRef ctx);\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCTracing.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSCTracing.h\"\n\n#if defined(WITH_FBSYSTRACE) && (defined(WITH_JSC_EXTRA_TRACING) || DEBUG)\n#define USE_JSCTRACING 1\n#else\n#define USE_JSCTRACING 0\n#endif\n\n#if USE_JSCTRACING\n\n#include <algorithm>\n#include <fbsystrace.h>\n#include <sys/types.h>\n#include <unistd.h>\n\n#include <jschelpers/JavaScriptCore.h>\n#include <jschelpers/JSCHelpers.h>\n#include <jschelpers/Value.h>\n\nusing std::min;\nusing namespace facebook::react;\n\nstatic int64_t int64FromJSValue(JSContextRef ctx, JSValueRef value, JSValueRef* exception) {\n  return static_cast<int64_t>(JSC_JSValueToNumber(ctx, value, exception));\n}\n\nstatic size_t copyTruncatedAsciiChars(\n    char* buf,\n    size_t bufLen,\n    JSContextRef ctx,\n    JSValueRef value,\n    size_t maxLen) {\n  JSStringRef jsString = JSC_JSValueToStringCopy(ctx, value, NULL);\n  size_t stringLen = JSC_JSStringGetLength(ctx, jsString);\n  // Unlike the Java version, we truncate from the end of the string,\n  // rather than the beginning.\n  size_t toWrite = min(stringLen, min(bufLen, maxLen));\n\n  const char *startBuf = buf;\n  const JSChar* chars = JSC_JSStringGetCharactersPtr(ctx, jsString);\n  while (toWrite-- > 0) {\n    *(buf++) = (char)*(chars++);\n  }\n\n  JSC_JSStringRelease(ctx, jsString);\n\n  // Return the number of bytes written\n  return buf - startBuf;\n}\n\nstatic size_t copyArgsToBuffer(\n    char* buf,\n    size_t bufLen,\n    size_t pos,\n    JSContextRef ctx,\n    size_t argumentCount,\n    const JSValueRef arguments[]) {\n  char separator = '|';\n  for (\n      size_t idx = 0;\n      idx + 1 < argumentCount;  // Make sure key and value are present.\n      idx += 2) {\n    JSValueRef key = arguments[idx];\n    JSValueRef value = arguments[idx+1];\n\n    buf[pos++] = separator;\n    separator = ';';\n    if (FBSYSTRACE_UNLIKELY(pos >= bufLen)) { break; }\n    pos += copyTruncatedAsciiChars(\n        buf + pos, bufLen - pos, ctx, key, FBSYSTRACE_MAX_MESSAGE_LENGTH);\n    if (FBSYSTRACE_UNLIKELY(pos >= bufLen)) { break; }\n    buf[pos++] = '=';\n    if (FBSYSTRACE_UNLIKELY(pos >= bufLen)) { break; }\n    pos += copyTruncatedAsciiChars(\n        buf + pos, bufLen - pos, ctx, value, FBSYSTRACE_MAX_MESSAGE_LENGTH);\n    if (FBSYSTRACE_UNLIKELY(pos >= bufLen)) { break; }\n  }\n  return pos;\n}\n\nstatic JSValueRef nativeTraceBeginSection(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  if (FBSYSTRACE_UNLIKELY(argumentCount < 2)) {\n    if (exception) {\n      *exception = Value::makeError(\n        ctx,\n        \"nativeTraceBeginSection: requires at least 2 arguments\");\n    }\n    return Value::makeUndefined(ctx);\n  }\n\n  uint64_t tag = int64FromJSValue(ctx, arguments[0], exception);\n  if (!fbsystrace_is_tracing(tag)) {\n    return Value::makeUndefined(ctx);\n  }\n\n  char buf[FBSYSTRACE_MAX_MESSAGE_LENGTH];\n  size_t pos = 0;\n\n  pos += snprintf(buf + pos, sizeof(buf) - pos, \"B|%d|\", getpid());\n  // Skip the overflow check here because the int will be small.\n  pos += copyTruncatedAsciiChars(buf + pos, sizeof(buf) - pos, ctx, arguments[1], FBSYSTRACE_MAX_SECTION_NAME_LENGTH);\n  // Skip the overflow check here because the section name will be small-ish.\n\n  pos = copyArgsToBuffer(buf, sizeof(buf), pos, ctx, argumentCount - 2, arguments + 2);\n  if (FBSYSTRACE_UNLIKELY(pos >= sizeof(buf))) {\n    goto flush;\n  }\n\nflush:\n  fbsystrace_trace_raw(buf, min(pos, sizeof(buf)-1));\n\n  return Value::makeUndefined(ctx);\n}\n\nstatic JSValueRef nativeTraceEndSection(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  if (FBSYSTRACE_UNLIKELY(argumentCount < 1)) {\n    if (exception) {\n      *exception = Value::makeError(\n        ctx,\n        \"nativeTraceEndSection: requires at least 1 argument\");\n    }\n    return Value::makeUndefined(ctx);\n  }\n\n  uint64_t tag = int64FromJSValue(ctx, arguments[0], exception);\n  if (!fbsystrace_is_tracing(tag)) {\n    return Value::makeUndefined(ctx);\n  }\n\n  if (FBSYSTRACE_LIKELY(argumentCount == 1)) {\n    fbsystrace_end_section(tag);\n  } else {\n    char buf[FBSYSTRACE_MAX_MESSAGE_LENGTH];\n    size_t pos = 0;\n\n    buf[pos++] = 'E';\n    buf[pos++] = '|';\n    buf[pos++] = '|';\n    pos = copyArgsToBuffer(buf, sizeof(buf), pos, ctx, argumentCount - 1, arguments + 1);\n    if (FBSYSTRACE_UNLIKELY(pos >= sizeof(buf))) {\n      goto flush;\n    }\n\nflush:\n    fbsystrace_trace_raw(buf, min(pos, sizeof(buf)-1));\n  }\n\n  return Value::makeUndefined(ctx);\n}\n\nstatic JSValueRef beginOrEndAsync(\n    bool isEnd,\n    bool isFlow,\n    JSContextRef ctx,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  if (FBSYSTRACE_UNLIKELY(argumentCount < 3)) {\n    if (exception) {\n      *exception = Value::makeError(\n        ctx,\n        \"beginOrEndAsync: requires at least 3 arguments\");\n    }\n    return Value::makeUndefined(ctx);\n  }\n\n  uint64_t tag = int64FromJSValue(ctx, arguments[0], exception);\n  if (!fbsystrace_is_tracing(tag)) {\n    return Value::makeUndefined(ctx);\n  }\n\n  char buf[FBSYSTRACE_MAX_MESSAGE_LENGTH];\n  size_t pos = 0;\n\n  // This uses an if-then-else instruction in ARMv7, which should be cheaper\n  // than a full branch.\n  buf[pos++] = ((isFlow) ? (isEnd ? 'f' : 's') : (isEnd ? 'F' : 'S'));\n  pos += snprintf(buf + pos, sizeof(buf) - pos, \"|%d|\", getpid());\n  // Skip the overflow check here because the int will be small.\n  pos += copyTruncatedAsciiChars(buf + pos, sizeof(buf) - pos, ctx, arguments[1], FBSYSTRACE_MAX_SECTION_NAME_LENGTH);\n  // Skip the overflow check here because the section name will be small-ish.\n\n  // I tried some trickery to avoid a branch here, but gcc did not cooperate.\n  // We could consider changing the implementation to be lest branchy in the\n  // future.\n  // This is not required for flow use an or to avoid introducing another branch\n  if (!(isEnd | isFlow)) {\n    buf[pos++] = '<';\n    buf[pos++] = '0';\n    buf[pos++] = '>';\n  }\n  buf[pos++] = '|';\n\n  // Append the cookie.  It should be an integer, but copyTruncatedAsciiChars\n  // will automatically convert it to a string.  We might be able to get more\n  // performance by just getting the number and doing to string\n  // conversion ourselves.  We truncate to FBSYSTRACE_MAX_SECTION_NAME_LENGTH\n  // just to make sure we can avoid the overflow check even if the caller\n  // passes in something bad.\n  pos += copyTruncatedAsciiChars(buf + pos, sizeof(buf) - pos, ctx, arguments[2], FBSYSTRACE_MAX_SECTION_NAME_LENGTH);\n\n  pos = copyArgsToBuffer(buf, sizeof(buf), pos, ctx, argumentCount - 3, arguments + 3);\n  if (FBSYSTRACE_UNLIKELY(pos >= sizeof(buf))) {\n    goto flush;\n  }\n\nflush:\n  fbsystrace_trace_raw(buf, min(pos, sizeof(buf)-1));\n\n  return Value::makeUndefined(ctx);\n}\n\nstatic JSValueRef nativeTraceBeginAsyncSection(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  return beginOrEndAsync(false /* isEnd */, false /* isFlow */,\n    ctx, argumentCount, arguments, exception);\n}\n\nstatic JSValueRef nativeTraceEndAsyncSection(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  return beginOrEndAsync(true /* isEnd */, false /* isFlow */,\n      ctx, argumentCount, arguments, exception);\n}\n\nstatic JSValueRef nativeTraceBeginAsyncFlow(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  return beginOrEndAsync(false /* isEnd */, true /* isFlow */,\n      ctx, argumentCount, arguments, exception);\n}\n\nstatic JSValueRef nativeTraceEndAsyncFlow(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  return beginOrEndAsync(true /* isEnd */, true /* isFlow */,\n      ctx, argumentCount, arguments, exception);\n}\n\nstatic JSValueRef nativeTraceCounter(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  if (FBSYSTRACE_UNLIKELY(argumentCount < 3)) {\n    if (exception) {\n      *exception = Value::makeError(\n        ctx,\n        \"nativeTraceCounter: requires at least 3 arguments\");\n    }\n    return Value::makeUndefined(ctx);\n  }\n\n  uint64_t tag = int64FromJSValue(ctx, arguments[0], exception);\n  if (!fbsystrace_is_tracing(tag)) {\n    return Value::makeUndefined(ctx);\n  }\n\n  char buf[FBSYSTRACE_MAX_MESSAGE_LENGTH];\n  size_t len = copyTruncatedAsciiChars(buf, sizeof(buf), ctx,\n    arguments[1], FBSYSTRACE_MAX_SECTION_NAME_LENGTH);\n  buf[min(len,(FBSYSTRACE_MAX_MESSAGE_LENGTH-1))] = 0;\n  int64_t value = int64FromJSValue(ctx, arguments[2], exception);\n\n  fbsystrace_counter(tag, buf, value);\n\n  return Value::makeUndefined(ctx);\n}\n\n#endif\n\nnamespace facebook {\nnamespace react {\n\nvoid addNativeTracingHooks(JSGlobalContextRef ctx) {\n#if USE_JSCTRACING\n  installGlobalFunction(ctx, \"nativeTraceBeginSection\", nativeTraceBeginSection);\n  installGlobalFunction(ctx, \"nativeTraceEndSection\", nativeTraceEndSection);\n  installGlobalFunction(ctx, \"nativeTraceBeginAsyncSection\", nativeTraceBeginAsyncSection);\n  installGlobalFunction(ctx, \"nativeTraceEndAsyncSection\", nativeTraceEndAsyncSection);\n  installGlobalFunction(ctx, \"nativeTraceBeginAsyncFlow\", nativeTraceBeginAsyncFlow);\n  installGlobalFunction(ctx, \"nativeTraceEndAsyncFlow\", nativeTraceEndAsyncFlow);\n  installGlobalFunction(ctx, \"nativeTraceCounter\", nativeTraceCounter);\n#endif\n}\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCTracing.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <jschelpers/JavaScriptCore.h>\n\nnamespace facebook {\nnamespace react {\n\nvoid addNativeTracingHooks(JSGlobalContextRef ctx);\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCUtils.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSCUtils.h\"\n\nnamespace facebook {\nnamespace react {\n\nString jsStringFromBigString(JSContextRef ctx, const JSBigString& bigstr) {\n  if (bigstr.isAscii()) {\n    return String::createExpectingAscii(ctx, bigstr.c_str(), bigstr.size());\n  } else {\n    return String(ctx, bigstr.c_str());\n  }\n}\n\nstd::pair<uint32_t, uint32_t> parseNativeRequireParameters(\n    const JSGlobalContextRef& context,\n    const JSValueRef arguments[],\n    size_t argumentCount) {\n  double moduleId = 0, bundleId = 0;\n\n  if (argumentCount == 1) {\n    moduleId = Value(context, arguments[0]).asNumber();\n  } else if (argumentCount == 2) {\n    moduleId = Value(context, arguments[0]).asNumber();\n    bundleId = Value(context, arguments[1]).asNumber();\n  } else {\n    throw std::invalid_argument(\"Got wrong number of args\");\n  }\n\n  if (moduleId < 0) {\n    throw std::invalid_argument(folly::to<std::string>(\"Received invalid module ID: \",\n                                                       Value(context, arguments[0]).toString().str()));\n  }\n\n  if (bundleId < 0) {\n    throw std::invalid_argument(folly::to<std::string>(\"Received invalid bundle ID: \",\n                                                       Value(context, arguments[1]).toString().str()));\n  }\n\n  return std::make_pair(static_cast<uint32_t>(bundleId), static_cast<uint32_t>(moduleId));\n}\n\n}\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSCUtils.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <cxxreact/JSBigString.h>\n#include <jschelpers/JavaScriptCore.h>\n#include <jschelpers/Value.h>\n\nnamespace facebook {\nnamespace react {\n\nString jsStringFromBigString(JSContextRef ctx, const JSBigString& bigstr);\n\n/**\n * Parses \"nativeRequire\" parameters\n * and returns pair of \"bundle id\" & \"module id\" values\n */\nstd::pair<uint32_t, uint32_t> parseNativeRequireParameters(const JSGlobalContextRef& context,\n                                                           const JSValueRef arguments[],\n                                                           size_t argumentCount);\n\n}\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSExecutor.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <memory>\n#include <string>\n\n#include <cxxreact/NativeModule.h>\n#include <folly/dynamic.h>\n\nnamespace facebook {\nnamespace react {\n\nclass JSBigString;\nclass JSExecutor;\nclass JSModulesUnbundle;\nclass MessageQueueThread;\nclass ModuleRegistry;\nclass RAMBundleRegistry;\n\n// This interface describes the delegate interface required by\n// Executor implementations to call from JS into native code.\nclass ExecutorDelegate {\n public:\n  virtual ~ExecutorDelegate() {}\n\n  virtual std::shared_ptr<ModuleRegistry> getModuleRegistry() = 0;\n\n  virtual void callNativeModules(\n    JSExecutor& executor, folly::dynamic&& calls, bool isEndOfBatch) = 0;\n  virtual MethodCallResult callSerializableNativeHook(\n    JSExecutor& executor, unsigned int moduleId, unsigned int methodId, folly::dynamic&& args) = 0;\n};\n\nclass JSExecutorFactory {\npublic:\n  virtual std::unique_ptr<JSExecutor> createJSExecutor(\n    std::shared_ptr<ExecutorDelegate> delegate,\n    std::shared_ptr<MessageQueueThread> jsQueue) = 0;\n  virtual ~JSExecutorFactory() {}\n};\n\nclass JSExecutor {\npublic:\n  /**\n   * Execute an application script bundle in the JS context.\n   */\n  virtual void loadApplicationScript(std::unique_ptr<const JSBigString> script,\n                                     std::string sourceURL) = 0;\n\n  /**\n   * Add an application \"RAM\" bundle registry\n   */\n  virtual void setBundleRegistry(std::unique_ptr<RAMBundleRegistry> bundleRegistry) = 0;\n\n  /**\n   * Register a file path for an additional \"RAM\" bundle\n   */\n  virtual void registerBundle(uint32_t bundleId, const std::string& bundlePath) = 0;\n\n  /**\n   * Executes BatchedBridge.callFunctionReturnFlushedQueue with the module ID,\n   * method ID and optional additional arguments in JS. The executor is responsible\n   * for using Bridge->callNativeModules to invoke any necessary native modules methods.\n   */\n  virtual void callFunction(const std::string& moduleId, const std::string& methodId, const folly::dynamic& arguments) = 0;\n\n  /**\n   * Executes BatchedBridge.invokeCallbackAndReturnFlushedQueue with the cbID,\n   * and optional additional arguments in JS and returns the next queue. The executor\n   * is responsible for using Bridge->callNativeModules to invoke any necessary\n   * native modules methods.\n   */\n  virtual void invokeCallback(const double callbackId, const folly::dynamic& arguments) = 0;\n\n  virtual void setGlobalVariable(std::string propName,\n                                 std::unique_ptr<const JSBigString> jsonValue) = 0;\n\n  virtual void* getJavaScriptContext() {\n    return nullptr;\n  }\n\n  /**\n   * Returns whether or not the underlying executor supports debugging via the\n   * Chrome remote debugging protocol.\n   */\n  virtual bool isInspectable() {\n    return false;\n  }\n\n  /**\n   * The description is displayed in the dev menu, if there is one in\n   * this build.  There is a default, but if this method returns a\n   * non-empty string, it will be used instead.\n   */\n  virtual std::string getDescription() = 0;\n\n  virtual void handleMemoryPressure(int pressureLevel) {}\n\n  virtual void destroy() {}\n  virtual ~JSExecutor() {}\n};\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSIndexedRAMBundle.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSIndexedRAMBundle.h\"\n\n#include <folly/Memory.h>\n\n#include \"oss-compat-util.h\"\n\nnamespace facebook {\nnamespace react {\n\nstd::function<std::unique_ptr<JSModulesUnbundle>(std::string)> JSIndexedRAMBundle::buildFactory() {\n  return [](const std::string& bundlePath){\n    return folly::make_unique<JSIndexedRAMBundle>(bundlePath.c_str());\n  };\n}\n\nJSIndexedRAMBundle::JSIndexedRAMBundle(const char *sourcePath) :\n    m_bundle (sourcePath, std::ios_base::in) {\n  if (!m_bundle) {\n    throw std::ios_base::failure(\n      toString(\"Bundle \", sourcePath,\n               \"cannot be opened: \", m_bundle.rdstate()));\n  }\n\n  // read in magic header, number of entries, and length of the startup section\n  uint32_t header[3];\n  static_assert(\n    sizeof(header) == 12,\n    \"header size must exactly match the input file format\");\n\n  readBundle(reinterpret_cast<char *>(header), sizeof(header));\n  const size_t numTableEntries = littleEndianToHost(header[1]);\n  const size_t startupCodeSize = littleEndianToHost(header[2]);\n\n  // allocate memory for meta data and lookup table.\n  m_table = ModuleTable(numTableEntries);\n  m_baseOffset = sizeof(header) + m_table.byteLength();\n\n  // read the lookup table from the file\n  readBundle(\n    reinterpret_cast<char *>(m_table.data.get()), m_table.byteLength());\n\n  // read the startup code\n  m_startupCode = std::unique_ptr<JSBigBufferString>(new JSBigBufferString{startupCodeSize - 1});\n\n  readBundle(m_startupCode->data(), startupCodeSize - 1);\n}\n\nJSIndexedRAMBundle::Module JSIndexedRAMBundle::getModule(uint32_t moduleId) const {\n  Module ret;\n  ret.name = toString(moduleId, \".js\");\n  ret.code = getModuleCode(moduleId);\n  return ret;\n}\n\nstd::unique_ptr<const JSBigString> JSIndexedRAMBundle::getStartupCode() {\n  CHECK(m_startupCode) << \"startup code for a RAM Bundle can only be retrieved once\";\n  return std::move(m_startupCode);\n}\n\nstd::string JSIndexedRAMBundle::getModuleCode(const uint32_t id) const {\n  const auto moduleData = id < m_table.numEntries ? &m_table.data[id] : nullptr;\n\n  // entries without associated code have offset = 0 and length = 0\n  const uint32_t length = moduleData ? littleEndianToHost(moduleData->length) : 0;\n  if (length == 0) {\n    throw std::ios_base::failure(\n      toString(\"Error loading module\", id, \"from RAM Bundle\"));\n  }\n\n  std::string ret(length - 1, '\\0');\n  readBundle(&ret.front(), length - 1, m_baseOffset + littleEndianToHost(moduleData->offset));\n  return ret;\n}\n\nvoid JSIndexedRAMBundle::readBundle(char *buffer, const std::streamsize bytes) const {\n  if (!m_bundle.read(buffer, bytes)) {\n    if (m_bundle.rdstate() & std::ios::eofbit) {\n      throw std::ios_base::failure(\"Unexpected end of RAM Bundle file\");\n    }\n    throw std::ios_base::failure(\n      toString(\"Error reading RAM Bundle: \", m_bundle.rdstate()));\n  }\n}\n\nvoid JSIndexedRAMBundle::readBundle(\n    char *buffer,\n    const std::streamsize bytes,\n    const std::ifstream::pos_type position) const {\n\n  if (!m_bundle.seekg(position)) {\n    throw std::ios_base::failure(\n      toString(\"Error reading RAM Bundle: \", m_bundle.rdstate()));\n  }\n  readBundle(buffer, bytes);\n}\n\n}  // namespace react\n}  // namespace facebook\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSIndexedRAMBundle.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <fstream>\n#include <memory>\n\n#include <cxxreact/JSBigString.h>\n#include <cxxreact/JSModulesUnbundle.h>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\nclass RN_EXPORT JSIndexedRAMBundle : public JSModulesUnbundle {\npublic:\n  static std::function<std::unique_ptr<JSModulesUnbundle>(std::string)> buildFactory();\n\n  // Throws std::runtime_error on failure.\n  JSIndexedRAMBundle(const char *sourceURL);\n\n  // Throws std::runtime_error on failure.\n  std::unique_ptr<const JSBigString> getStartupCode();\n  // Throws std::runtime_error on failure.\n  Module getModule(uint32_t moduleId) const override;\n\nprivate:\n  struct ModuleData {\n    uint32_t offset;\n    uint32_t length;\n  };\n  static_assert(\n    sizeof(ModuleData) == 8,\n    \"ModuleData must not have any padding and use sizes matching input files\");\n\n  struct ModuleTable {\n    size_t numEntries;\n    std::unique_ptr<ModuleData[]> data;\n    ModuleTable() : numEntries(0) {};\n    ModuleTable(size_t entries) :\n      numEntries(entries),\n      data(std::unique_ptr<ModuleData[]>(new ModuleData[numEntries])) {};\n    size_t byteLength() const {\n      return numEntries * sizeof(ModuleData);\n    }\n  };\n\n  std::string getModuleCode(const uint32_t id) const;\n  void readBundle(char *buffer, const std::streamsize bytes) const;\n  void readBundle(\n    char *buffer, const\n    std::streamsize bytes,\n    const std::ifstream::pos_type position) const;\n\n  mutable std::ifstream m_bundle;\n  ModuleTable m_table;\n  size_t m_baseOffset;\n  std::unique_ptr<JSBigBufferString> m_startupCode;\n};\n\n}  // namespace react\n}  // namespace facebook\n"
  },
  {
    "path": "ReactCommon/cxxreact/JSModulesUnbundle.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <cstdint>\n#include <string>\n#include <stdexcept>\n\n#include <jschelpers/noncopyable.h>\n\nnamespace facebook {\nnamespace react {\n\nclass JSModulesUnbundle : noncopyable {\n  /**\n   * Represents the set of JavaScript modules that the application consists of.\n   * The source code of each module can be retrieved by module ID.\n   *\n   * The class is non-copyable because copying instances might involve copying\n   * several megabytes of memory.\n   */\npublic:\n  class ModuleNotFound : public std::out_of_range {\n    using std::out_of_range::out_of_range;\n  };\n  struct Module {\n    std::string name;\n    std::string code;\n  };\n  virtual ~JSModulesUnbundle() {}\n  virtual Module getModule(uint32_t moduleId) const = 0;\n};\n\n}\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/JsArgumentHelpers-inl.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\nnamespace facebook {\nnamespace xplat {\n\nnamespace detail {\n\ntemplate <typename R, typename M, typename... T>\nR jsArg1(const folly::dynamic& arg, M asFoo, const T&... desc) {\n  try {\n    return (arg.*asFoo)();\n  } catch (const folly::TypeError& ex) {\n    throw JsArgumentException(\n      folly::to<std::string>(\n        \"Error converting javascript arg \", desc..., \" to C++: \", ex.what()));\n  } catch (const std::range_error& ex) {\n    throw JsArgumentException(\n      folly::to<std::string>(\n        \"Could not convert argument \", desc..., \" to required type: \", ex.what()));\n  }\n}\n\n}\n\ntemplate <typename R, typename... T>\nR jsArg(const folly::dynamic& arg, R (folly::dynamic::*asFoo)() const, const T&... desc) {\n  return detail::jsArg1<R>(arg, asFoo, desc...);\n}\n\ntemplate <typename R, typename... T>\nR jsArg(const folly::dynamic& arg, R (folly::dynamic::*asFoo)() const&, const T&... desc) {\n  return detail::jsArg1<R>(arg, asFoo, desc...);\n}\n\ntemplate <typename T>\ntypename detail::is_dynamic<T>::type& jsArgAsDynamic(T&& args, size_t n) {\n  try {\n    return args[n];\n  } catch (const std::out_of_range& ex) {\n    // Use 1-base counting for argument description.\n    throw JsArgumentException(\n      folly::to<std::string>(\n        \"JavaScript provided \", args.size(),\n        \" arguments for C++ method which references at least \", n + 1,\n        \" arguments: \", ex.what()));\n  }\n}\n\ntemplate <typename R>\nR jsArgN(const folly::dynamic& args, size_t n, R (folly::dynamic::*asFoo)() const) {\n  return jsArg(jsArgAsDynamic(args, n), asFoo, n);\n}\ntemplate <typename R>\nR jsArgN(const folly::dynamic& args, size_t n, R (folly::dynamic::*asFoo)() const&) {\n  return jsArg(jsArgAsDynamic(args, n), asFoo, n);\n}\n\nnamespace detail {\n\n// This is a helper for jsArgAsArray and jsArgAsObject.\n\ntemplate <typename T>\ntypename detail::is_dynamic<T>::type& jsArgAsType(T&& args, size_t n, const char* required,\n                                                  bool (folly::dynamic::*isFoo)() const) {\n  T& ret = jsArgAsDynamic(args, n);\n  if ((ret.*isFoo)()) {\n    return ret;\n  }\n\n  // Use 1-base counting for argument description.\n  throw JsArgumentException(\n    folly::to<std::string>(\n      \"Argument \", n + 1, \" of type \", ret.typeName(), \" is not required type \", required));\n}\n\n} // end namespace detail\n\ntemplate <typename T>\ntypename detail::is_dynamic<T>::type& jsArgAsArray(T&& args, size_t n) {\n  return detail::jsArgAsType(args, n, \"Array\", &folly::dynamic::isArray);\n}\n\ntemplate <typename T>\ntypename detail::is_dynamic<T>::type& jsArgAsObject(T&& args, size_t n) {\n  return detail::jsArgAsType(args, n, \"Object\", &folly::dynamic::isObject);\n}\n\n}}\n"
  },
  {
    "path": "ReactCommon/cxxreact/JsArgumentHelpers.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <exception>\n#include <string>\n\n#include <folly/Conv.h>\n#include <folly/dynamic.h>\n\n// When building a cross-platform module for React Native, arguments passed\n// from JS are represented as a folly::dynamic.  This class provides helpers to\n// extract arguments from the folly::dynamic to concrete types usable by\n// cross-platform code, and converting exceptions to a JsArgumentException so\n// they can be caught and reported to RN consistently.  The goal is to make the\n// jsArgAs... methods at the end simple to use should be most common, but any\n// non-detail method can be used when needed.\n\nnamespace facebook {\nnamespace xplat {\n\nclass JsArgumentException : public std::logic_error {\npublic:\n  JsArgumentException(const std::string& msg) : std::logic_error(msg) {}\n};\n\n// This extracts a single argument by calling the given method pointer on it.\n// If an exception is thrown, the additional arguments are passed to\n// folly::to<> to be included in the exception string.  This will be most\n// commonly used when extracting values from non-scalar argument.  The second\n// overload accepts ref-qualified member functions.\n\ntemplate <typename R, typename... T>\nR jsArg(const folly::dynamic& arg, R (folly::dynamic::*asFoo)() const, const T&... desc);\ntemplate <typename R, typename... T>\nR jsArg(const folly::dynamic& arg, R (folly::dynamic::*asFoo)() const&, const T&... desc);\n\n// This is like jsArg, but a operates on a dynamic representing an array of\n// arguments.  The argument n is used both to index the array and build the\n// exception message, if any.  It can be used directly, but will more often be\n// used by the type-specific methods following.\n\ntemplate <typename R>\nR jsArgN(const folly::dynamic& args, size_t n, R (folly::dynamic::*asFoo)() const);\ntemplate <typename R>\nR jsArgN(const folly::dynamic& args, size_t n, R (folly::dynamic::*asFoo)() const&);\n\nnamespace detail {\n\n// This is a type helper to implement functions which should work on both const\n// and non-const folly::dynamic arguments, and return a type with the same\n// constness.  Basically, it causes the templates which use it to be defined\n// only for types compatible with folly::dynamic.\ntemplate <typename T>\nstruct is_dynamic {\n  typedef typename std::enable_if<std::is_assignable<folly::dynamic, T>::value, T>::type type;\n};\n\n} // end namespace detail\n\n// Easy to use conversion helpers are here:\n\n// Extract the n'th arg from the given dynamic, as a dynamic.  Throws a\n// JsArgumentException if there is no n'th arg in the input.\ntemplate <typename T>\ntypename detail::is_dynamic<T>::type& jsArgAsDynamic(T&& args, size_t n);\n\n// Extract the n'th arg from the given dynamic, as a dynamic Array.  Throws a\n// JsArgumentException if there is no n'th arg in the input, or it is not an\n// Array.\ntemplate <typename T>\ntypename detail::is_dynamic<T>::type& jsArgAsArray(T&& args, size_t n);\n\n// Extract the n'th arg from the given dynamic, as a dynamic Object.  Throws a\n// JsArgumentException if there is no n'th arg in the input, or it is not an\n// Object.\ntemplate <typename T>\ntypename detail::is_dynamic<T>::type& jsArgAsObject(T&& args, size_t n);\n\n// Extract the n'th arg from the given dynamic, as a bool.  Throws a\n// JsArgumentException if this fails for some reason.\ninline bool jsArgAsBool(const folly::dynamic& args, size_t n) {\n  return jsArgN(args, n, &folly::dynamic::asBool);\n}\n\n// Extract the n'th arg from the given dynamic, as an integer.  Throws a\n// JsArgumentException if this fails for some reason.\ninline int64_t jsArgAsInt(const folly::dynamic& args, size_t n) {\n  return jsArgN(args, n, &folly::dynamic::asInt);\n}\n\n// Extract the n'th arg from the given dynamic, as a double.  Throws a\n// JsArgumentException if this fails for some reason.\ninline double jsArgAsDouble(const folly::dynamic& args, size_t n) {\n  return jsArgN(args, n, &folly::dynamic::asDouble);\n}\n\n// Extract the n'th arg from the given dynamic, as a string.  Throws a\n// JsArgumentException if this fails for some reason.\ninline std::string jsArgAsString(const folly::dynamic& args, size_t n) {\n  return jsArgN(args, n, &folly::dynamic::asString);\n}\n\n}}\n\n#include <cxxreact/JsArgumentHelpers-inl.h>\n"
  },
  {
    "path": "ReactCommon/cxxreact/MessageQueueThread.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <condition_variable>\n#include <functional>\n#include <mutex>\n\nnamespace facebook {\nnamespace react {\n\nclass MessageQueueThread {\n public:\n  virtual ~MessageQueueThread() {}\n  virtual void runOnQueue(std::function<void()>&&) = 0;\n  // runOnQueueSync and quitSynchronous are dangerous.  They should only be\n  // used for initialization and cleanup.\n  virtual void runOnQueueSync(std::function<void()>&&) = 0;\n  // Once quitSynchronous() returns, no further work should run on the queue.\n  virtual void quitSynchronous() = 0;\n};\n\n}}\n"
  },
  {
    "path": "ReactCommon/cxxreact/MethodCall.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"MethodCall.h\"\n\n#include <folly/json.h>\n#include <stdexcept>\n\nnamespace facebook {\nnamespace react {\n\n#define REQUEST_MODULE_IDS 0\n#define REQUEST_METHOD_IDS 1\n#define REQUEST_PARAMSS 2\n#define REQUEST_CALLID 3\n\nstatic const char *errorPrefix = \"Malformed calls from JS: \";\n\nstd::vector<MethodCall> parseMethodCalls(folly::dynamic&& jsonData) throw(std::invalid_argument) {\n  if (jsonData.isNull()) {\n    return {};\n  }\n\n  if (!jsonData.isArray()) {\n    throw std::invalid_argument(\n      folly::to<std::string>(errorPrefix, \"input isn't array but \", jsonData.typeName()));\n  }\n\n  if (jsonData.size() < REQUEST_PARAMSS + 1) {\n    throw std::invalid_argument(\n      folly::to<std::string>(errorPrefix, \"size == \", jsonData.size()));\n  }\n\n  auto& moduleIds = jsonData[REQUEST_MODULE_IDS];\n  auto& methodIds = jsonData[REQUEST_METHOD_IDS];\n  auto& params = jsonData[REQUEST_PARAMSS];\n  int  callId = -1;\n\n  if (!moduleIds.isArray() || !methodIds.isArray() || !params.isArray()) {\n    throw std::invalid_argument(\n      folly::to<std::string>(errorPrefix, \"not all fields are arrays.\\n\\n\", folly::toJson(jsonData)));\n  }\n\n  if (moduleIds.size() != methodIds.size() || moduleIds.size() != params.size()) {\n    throw std::invalid_argument(\n      folly::to<std::string>(errorPrefix, \"field sizes are different.\\n\\n\", folly::toJson(jsonData)));\n  }\n\n  if (jsonData.size() > REQUEST_CALLID) {\n    if (!jsonData[REQUEST_CALLID].isNumber()) {\n      throw std::invalid_argument(\n        folly::to<std::string>(errorPrefix, \"invalid callId\", jsonData[REQUEST_CALLID].typeName()));\n    }\n    callId = jsonData[REQUEST_CALLID].asInt();\n  }\n\n  std::vector<MethodCall> methodCalls;\n  for (size_t i = 0; i < moduleIds.size(); i++) {\n    if (!params[i].isArray()) {\n      throw std::invalid_argument(\n          folly::to<std::string>(errorPrefix, \"method arguments isn't array but \", params[i].typeName()));\n    }\n\n    methodCalls.emplace_back(\n      moduleIds[i].asInt(),\n      methodIds[i].asInt(),\n      std::move(params[i]),\n      callId);\n\n    // only incremement callid if contains valid callid as callid is optional\n    callId += (callId != -1) ? 1 : 0;\n  }\n\n  return methodCalls;\n}\n\n}}\n\n"
  },
  {
    "path": "ReactCommon/cxxreact/MethodCall.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <map>\n#include <string>\n#include <vector>\n\n#include <folly/dynamic.h>\n\nnamespace facebook {\nnamespace react {\n\nstruct MethodCall {\n  int moduleId;\n  int methodId;\n  folly::dynamic arguments;\n  int callId;\n\n  MethodCall(int mod, int meth, folly::dynamic&& args, int cid)\n    : moduleId(mod)\n    , methodId(meth)\n    , arguments(std::move(args))\n    , callId(cid) {}\n};\n\nstd::vector<MethodCall> parseMethodCalls(folly::dynamic&& calls) throw(std::invalid_argument);\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/ModuleRegistry.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"ModuleRegistry.h\"\n\n#include <glog/logging.h>\n\n#include \"NativeModule.h\"\n#include \"SystraceSection.h\"\n\nnamespace facebook {\nnamespace react {\n\nnamespace {\n\nstd::string normalizeName(std::string name) {\n  // TODO mhorowitz #10487027: This is super ugly.  We should just\n  // change iOS to emit normalized names, drop the \"RK...\" from\n  // names hardcoded in Android, and then delete this and the\n  // similar hacks in js.\n  if (name.compare(0, 3, \"RCT\") == 0) {\n    return name.substr(3);\n  } else if (name.compare(0, 2, \"RK\") == 0) {\n    return name.substr(2);\n  }\n  return name;\n}\n\n}\n\nModuleRegistry::ModuleRegistry(std::vector<std::unique_ptr<NativeModule>> modules, ModuleNotFoundCallback callback)\n    : modules_{std::move(modules)}, moduleNotFoundCallback_{callback} {}\n\nvoid ModuleRegistry::updateModuleNamesFromIndex(size_t index) {\n  for (; index < modules_.size(); index++ ) {\n    std::string name = normalizeName(modules_[index]->getName());\n    modulesByName_[name] = index;\n  }\n}\n\nvoid ModuleRegistry::registerModules(std::vector<std::unique_ptr<NativeModule>> modules) {\n  if (modules_.empty() && unknownModules_.empty()) {\n    modules_ = std::move(modules);\n  } else {\n    size_t modulesSize = modules_.size();\n    size_t addModulesSize = modules.size();\n    bool addToNames = !modulesByName_.empty();\n    modules_.reserve(modulesSize + addModulesSize);\n    std::move(modules.begin(), modules.end(), std::back_inserter(modules_));\n    if (!unknownModules_.empty()) {\n      for (size_t index = modulesSize; index < modulesSize + addModulesSize; index++) {\n        std::string name = normalizeName(modules_[index]->getName());\n        auto it = unknownModules_.find(name);\n        if (it != unknownModules_.end()) {\n          throw std::runtime_error(\n            folly::to<std::string>(\"module \", name, \" was required without being registered and is now being registered.\"));\n        } else if (addToNames) {\n          modulesByName_[name] = index;\n        }\n      }\n    } else if (addToNames) {\n      updateModuleNamesFromIndex(modulesSize);\n    }\n  }\n}\n\nstd::vector<std::string> ModuleRegistry::moduleNames() {\n  std::vector<std::string> names;\n  for (size_t i = 0; i < modules_.size(); i++) {\n    std::string name = normalizeName(modules_[i]->getName());\n    modulesByName_[name] = i;\n    names.push_back(std::move(name));\n  }\n  return names;\n}\n\nfolly::Optional<ModuleConfig> ModuleRegistry::getConfig(const std::string& name) {\n  SystraceSection s(\"ModuleRegistry::getConfig\", \"module\", name);\n\n  // Initialize modulesByName_\n  if (modulesByName_.empty() && !modules_.empty()) {\n    moduleNames();\n  }\n\n  auto it = modulesByName_.find(name);\n\n  if (it == modulesByName_.end()) {\n    if (unknownModules_.find(name) != unknownModules_.end()) {\n      return nullptr;\n    }\n    if (!moduleNotFoundCallback_ ||\n        !moduleNotFoundCallback_(name) ||\n        (it = modulesByName_.find(name)) == modulesByName_.end()) {\n      unknownModules_.insert(name);\n      return nullptr;\n    }\n  }\n  size_t index = it->second;\n\n  CHECK(index < modules_.size());\n  NativeModule *module = modules_[index].get();\n\n  // string name, object constants, array methodNames (methodId is index), [array promiseMethodIds], [array syncMethodIds]\n  folly::dynamic config = folly::dynamic::array(name);\n\n  {\n    SystraceSection s_(\"getConstants\");\n    config.push_back(module->getConstants());\n  }\n\n  {\n    SystraceSection s_(\"getMethods\");\n    std::vector<MethodDescriptor> methods = module->getMethods();\n\n    folly::dynamic methodNames = folly::dynamic::array;\n    folly::dynamic promiseMethodIds = folly::dynamic::array;\n    folly::dynamic syncMethodIds = folly::dynamic::array;\n\n    for (auto& descriptor : methods) {\n      // TODO: #10487027 compare tags instead of doing string comparison?\n      methodNames.push_back(std::move(descriptor.name));\n      if (descriptor.type == \"promise\") {\n        promiseMethodIds.push_back(methodNames.size() - 1);\n      } else if (descriptor.type == \"sync\") {\n        syncMethodIds.push_back(methodNames.size() - 1);\n      }\n    }\n\n    if (!methodNames.empty()) {\n      config.push_back(std::move(methodNames));\n      if (!promiseMethodIds.empty() || !syncMethodIds.empty()) {\n        config.push_back(std::move(promiseMethodIds));\n        if (!syncMethodIds.empty()) {\n          config.push_back(std::move(syncMethodIds));\n        }\n      }\n    }\n  }\n\n  if (config.size() == 2 && config[1].empty()) {\n    // no constants or methods\n    return nullptr;\n  } else {\n    return ModuleConfig{index, config};\n  }\n}\n\nvoid ModuleRegistry::callNativeMethod(unsigned int moduleId, unsigned int methodId, folly::dynamic&& params, int callId) {\n  if (moduleId >= modules_.size()) {\n    throw std::runtime_error(\n      folly::to<std::string>(\"moduleId \", moduleId, \" out of range [0..\", modules_.size(), \")\"));\n  }\n  modules_[moduleId]->invoke(methodId, std::move(params), callId);\n}\n\nMethodCallResult ModuleRegistry::callSerializableNativeHook(unsigned int moduleId, unsigned int methodId, folly::dynamic&& params) {\n  if (moduleId >= modules_.size()) {\n    throw std::runtime_error(\n      folly::to<std::string>(\"moduleId \", moduleId, \"out of range [0..\", modules_.size(), \")\"));\n  }\n  return modules_[moduleId]->callSerializableNativeHook(methodId, std::move(params));\n}\n\n}}\n"
  },
  {
    "path": "ReactCommon/cxxreact/ModuleRegistry.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <memory>\n#include <unordered_set>\n#include <vector>\n\n#include <cxxreact/JSExecutor.h>\n#include <folly/Optional.h>\n#include <folly/dynamic.h>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\nclass NativeModule;\n\nstruct ModuleConfig {\n  size_t index;\n  folly::dynamic config;\n};\n\nclass RN_EXPORT ModuleRegistry {\n public:\n  // not implemented:\n  // onBatchComplete: see https://our.intern.facebook.com/intern/tasks/?t=5279396\n  // getModule: only used by views\n  // getAllModules: only used for cleanup; use RAII instead\n  // notifyCatalystInstanceInitialized: this is really only used by view-related code\n  // notifyCatalystInstanceDestroy: use RAII instead\n\n  using ModuleNotFoundCallback = std::function<bool(const std::string &name)>;\n\n  ModuleRegistry(std::vector<std::unique_ptr<NativeModule>> modules, ModuleNotFoundCallback callback = nullptr);\n  void registerModules(std::vector<std::unique_ptr<NativeModule>> modules);\n\n  std::vector<std::string> moduleNames();\n\n  folly::Optional<ModuleConfig> getConfig(const std::string& name);\n\n  void callNativeMethod(unsigned int moduleId, unsigned int methodId, folly::dynamic&& params, int callId);\n  MethodCallResult callSerializableNativeHook(unsigned int moduleId, unsigned int methodId, folly::dynamic&& args);\n\n private:\n  // This is always populated\n  std::vector<std::unique_ptr<NativeModule>> modules_;\n\n  // This is used to extend the population of modulesByName_ if registerModules is called after moduleNames\n  void updateModuleNamesFromIndex(size_t size);\n\n  // This is only populated if moduleNames() is called.  Values are indices into modules_.\n  std::unordered_map<std::string, size_t> modulesByName_;\n\n  // This is populated with modules that are requested via getConfig but are unknown.\n  // An error will be thrown if they are subsquently added to the registry.\n  std::unordered_set<std::string> unknownModules_;\n\n  // Function will be called if a module was requested but was not found.\n  // If the function returns true, ModuleRegistry will try to find the module again (assuming it's registered)\n  // If the functon returns false, ModuleRegistry will not try to find the module and return nullptr instead.\n  ModuleNotFoundCallback moduleNotFoundCallback_;\n};\n\n}\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/NativeModule.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <string>\n#include <vector>\n\n#include <folly/Optional.h>\n#include <folly/dynamic.h>\n\nnamespace facebook {\nnamespace react {\n\nstruct MethodDescriptor {\n  std::string name;\n  // type is one of js MessageQueue.MethodTypes\n  std::string type;\n\n  MethodDescriptor(std::string n, std::string t)\n      : name(std::move(n))\n      , type(std::move(t)) {}\n};\n\n  using MethodCallResult = folly::Optional<folly::dynamic>;\n\nclass NativeModule {\n public:\n  virtual ~NativeModule() {}\n  virtual std::string getName() = 0;\n  virtual std::vector<MethodDescriptor> getMethods() = 0;\n  virtual folly::dynamic getConstants() = 0;\n  virtual void invoke(unsigned int reactMethodId, folly::dynamic&& params, int callId) = 0;\n  virtual MethodCallResult callSerializableNativeHook(unsigned int reactMethodId, folly::dynamic&& args) = 0;\n};\n\n}\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/NativeToJsBridge.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"NativeToJsBridge.h\"\n\n#include <folly/json.h>\n#include <folly/Memory.h>\n#include <folly/MoveWrapper.h>\n\n#include \"Instance.h\"\n#include \"JSBigString.h\"\n#include \"SystraceSection.h\"\n#include \"MethodCall.h\"\n#include \"MessageQueueThread.h\"\n#include \"RAMBundleRegistry.h\"\n\n#ifdef WITH_FBSYSTRACE\n#include <fbsystrace.h>\nusing fbsystrace::FbSystraceAsyncFlow;\n#endif\n\nnamespace facebook {\nnamespace react {\n\n// This class manages calls from JS to native code.\nclass JsToNativeBridge : public react::ExecutorDelegate {\npublic:\n  JsToNativeBridge(std::shared_ptr<ModuleRegistry> registry,\n                   std::shared_ptr<InstanceCallback> callback)\n    : m_registry(registry)\n    , m_callback(callback) {}\n\n  std::shared_ptr<ModuleRegistry> getModuleRegistry() override {\n    return m_registry;\n  }\n\n  void callNativeModules(\n      JSExecutor& executor, folly::dynamic&& calls, bool isEndOfBatch) override {\n\n    CHECK(m_registry || calls.empty()) <<\n      \"native module calls cannot be completed with no native modules\";\n    m_batchHadNativeModuleCalls = m_batchHadNativeModuleCalls || !calls.empty();\n\n    // An exception anywhere in here stops processing of the batch.  This\n    // was the behavior of the Android bridge, and since exception handling\n    // terminates the whole bridge, there's not much point in continuing.\n    for (auto& call : parseMethodCalls(std::move(calls))) {\n      m_registry->callNativeMethod(call.moduleId, call.methodId, std::move(call.arguments), call.callId);\n    }\n    if (isEndOfBatch) {\n      // onBatchComplete will be called on the native (module) queue, but\n      // decrementPendingJSCalls will be called sync. Be aware that the bridge may still\n      // be processing native calls when the birdge idle signaler fires.\n      if (m_batchHadNativeModuleCalls) {\n        m_callback->onBatchComplete();\n        m_batchHadNativeModuleCalls = false;\n      }\n      m_callback->decrementPendingJSCalls();\n    }\n  }\n\n  MethodCallResult callSerializableNativeHook(\n      JSExecutor& executor, unsigned int moduleId, unsigned int methodId,\n      folly::dynamic&& args) override {\n    return m_registry->callSerializableNativeHook(moduleId, methodId, std::move(args));\n  }\n\nprivate:\n\n  // These methods are always invoked from an Executor.  The NativeToJsBridge\n  // keeps a reference to the executor, and when destroy() is called, the\n  // executor is destroyed synchronously on its queue.\n  std::shared_ptr<ModuleRegistry> m_registry;\n  std::shared_ptr<InstanceCallback> m_callback;\n  bool m_batchHadNativeModuleCalls = false;\n};\n\nNativeToJsBridge::NativeToJsBridge(\n    JSExecutorFactory* jsExecutorFactory,\n    std::shared_ptr<ModuleRegistry> registry,\n    std::shared_ptr<MessageQueueThread> jsQueue,\n    std::shared_ptr<InstanceCallback> callback)\n    : m_destroyed(std::make_shared<bool>(false))\n    , m_delegate(std::make_shared<JsToNativeBridge>(registry, callback))\n    , m_executor(jsExecutorFactory->createJSExecutor(m_delegate, jsQueue))\n    , m_executorMessageQueueThread(std::move(jsQueue)) {}\n\n// This must be called on the same thread on which the constructor was called.\nNativeToJsBridge::~NativeToJsBridge() {\n  CHECK(*m_destroyed) <<\n    \"NativeToJsBridge::destroy() must be called before deallocating the NativeToJsBridge!\";\n}\n\nvoid NativeToJsBridge::loadApplication(\n    std::unique_ptr<RAMBundleRegistry> bundleRegistry,\n    std::unique_ptr<const JSBigString> startupScript,\n    std::string startupScriptSourceURL) {\n  runOnExecutorQueue(\n      [bundleRegistryWrap=folly::makeMoveWrapper(std::move(bundleRegistry)),\n       startupScript=folly::makeMoveWrapper(std::move(startupScript)),\n       startupScriptSourceURL=std::move(startupScriptSourceURL)]\n        (JSExecutor* executor) mutable {\n    auto bundleRegistry = bundleRegistryWrap.move();\n    if (bundleRegistry) {\n      executor->setBundleRegistry(std::move(bundleRegistry));\n    }\n    executor->loadApplicationScript(std::move(*startupScript),\n                                    std::move(startupScriptSourceURL));\n  });\n}\n\nvoid NativeToJsBridge::loadApplicationSync(\n    std::unique_ptr<RAMBundleRegistry> bundleRegistry,\n    std::unique_ptr<const JSBigString> startupScript,\n    std::string startupScriptSourceURL) {\n  if (bundleRegistry) {\n    m_executor->setBundleRegistry(std::move(bundleRegistry));\n  }\n  m_executor->loadApplicationScript(std::move(startupScript),\n                                        std::move(startupScriptSourceURL));\n}\n\nvoid NativeToJsBridge::callFunction(\n    std::string&& module,\n    std::string&& method,\n    folly::dynamic&& arguments) {\n  int systraceCookie = -1;\n  #ifdef WITH_FBSYSTRACE\n  systraceCookie = m_systraceCookie++;\n  FbSystraceAsyncFlow::begin(\n      TRACE_TAG_REACT_CXX_BRIDGE,\n      \"JSCall\",\n      systraceCookie);\n  #endif\n\n  runOnExecutorQueue([module = std::move(module), method = std::move(method), arguments = std::move(arguments), systraceCookie]\n    (JSExecutor* executor) {\n      #ifdef WITH_FBSYSTRACE\n      FbSystraceAsyncFlow::end(\n          TRACE_TAG_REACT_CXX_BRIDGE,\n          \"JSCall\",\n          systraceCookie);\n      SystraceSection s(\"NativeToJsBridge::callFunction\", \"module\", module, \"method\", method);\n      #endif\n      // This is safe because we are running on the executor's thread: it won't\n      // destruct until after it's been unregistered (which we check above) and\n      // that will happen on this thread\n      executor->callFunction(module, method, arguments);\n    });\n}\n\nvoid NativeToJsBridge::invokeCallback(double callbackId, folly::dynamic&& arguments) {\n  int systraceCookie = -1;\n  #ifdef WITH_FBSYSTRACE\n  systraceCookie = m_systraceCookie++;\n  FbSystraceAsyncFlow::begin(\n      TRACE_TAG_REACT_CXX_BRIDGE,\n      \"<callback>\",\n      systraceCookie);\n  #endif\n\n  runOnExecutorQueue([callbackId, arguments = std::move(arguments), systraceCookie]\n    (JSExecutor* executor) {\n      #ifdef WITH_FBSYSTRACE\n      FbSystraceAsyncFlow::end(\n          TRACE_TAG_REACT_CXX_BRIDGE,\n          \"<callback>\",\n          systraceCookie);\n      SystraceSection s(\"NativeToJsBridge::invokeCallback\");\n      #endif\n      executor->invokeCallback(callbackId, arguments);\n    });\n}\n\nvoid NativeToJsBridge::registerBundle(uint32_t bundleId, const std::string& bundlePath) {\n  runOnExecutorQueue([bundleId, bundlePath] (JSExecutor* executor) {\n    executor->registerBundle(bundleId, bundlePath);\n  });\n}\n\nvoid NativeToJsBridge::setGlobalVariable(std::string propName,\n                                         std::unique_ptr<const JSBigString> jsonValue) {\n  runOnExecutorQueue([propName=std::move(propName), jsonValue=folly::makeMoveWrapper(std::move(jsonValue))]\n    (JSExecutor* executor) mutable {\n      executor->setGlobalVariable(propName, jsonValue.move());\n    });\n}\n\nvoid* NativeToJsBridge::getJavaScriptContext() {\n  // TODO(cjhopman): this seems unsafe unless we require that it is only called on the main js queue.\n  return m_executor->getJavaScriptContext();\n}\n\nbool NativeToJsBridge::isInspectable() {\n  return m_executor->isInspectable();\n}\n\n#ifdef WITH_JSC_MEMORY_PRESSURE\nvoid NativeToJsBridge::handleMemoryPressure(int pressureLevel) {\n  runOnExecutorQueue([=] (JSExecutor* executor) {\n    executor->handleMemoryPressure(pressureLevel);\n  });\n}\n#endif\n\nvoid NativeToJsBridge::destroy() {\n  // All calls made through runOnExecutorQueue have an early exit if\n  // m_destroyed is true. Setting this before the runOnQueueSync will cause\n  // pending work to be cancelled and we won't have to wait for it.\n  *m_destroyed = true;\n  m_executorMessageQueueThread->runOnQueueSync([this] {\n    m_executor->destroy();\n    m_executorMessageQueueThread->quitSynchronous();\n    m_executor = nullptr;\n  });\n}\n\nvoid NativeToJsBridge::runOnExecutorQueue(std::function<void(JSExecutor*)> task) {\n  if (*m_destroyed) {\n    return;\n  }\n\n  std::shared_ptr<bool> isDestroyed = m_destroyed;\n  m_executorMessageQueueThread->runOnQueue([this, isDestroyed, task=std::move(task)] {\n    if (*isDestroyed) {\n      return;\n    }\n\n    // The executor is guaranteed to be valid for the duration of the task because:\n    // 1. the executor is only destroyed after it is unregistered\n    // 2. the executor is unregistered on this queue\n    // 3. we just confirmed that the executor hasn't been unregistered above\n    task(m_executor.get());\n  });\n}\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/NativeToJsBridge.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <atomic>\n#include <functional>\n#include <map>\n#include <vector>\n\n#include <cxxreact/JSCExecutor.h>\n#include <cxxreact/JSExecutor.h>\n\nnamespace folly {\nstruct dynamic;\n}\n\nnamespace facebook {\nnamespace react {\n\nstruct InstanceCallback;\nclass JsToNativeBridge;\nclass MessageQueueThread;\nclass ModuleRegistry;\nclass RAMBundleRegistry;\n\n// This class manages calls from native code to JS.  It also manages\n// executors and their threads.  All functions here can be called from\n// any thread.\n//\n// Except for loadApplicationScriptSync(), all void methods will queue\n// work to run on the jsQueue passed to the ctor, and return\n// immediately.\nclass NativeToJsBridge {\npublic:\n  friend class JsToNativeBridge;\n\n  /**\n   * This must be called on the main JS thread.\n   */\n  NativeToJsBridge(\n      JSExecutorFactory* jsExecutorFactory,\n      std::shared_ptr<ModuleRegistry> registry,\n      std::shared_ptr<MessageQueueThread> jsQueue,\n      std::shared_ptr<InstanceCallback> callback);\n  virtual ~NativeToJsBridge();\n\n  /**\n   * Executes a function with the module ID and method ID and any additional\n   * arguments in JS.\n   */\n  void callFunction(std::string&& module, std::string&& method, folly::dynamic&& args);\n\n  /**\n   * Invokes a callback with the cbID, and optional additional arguments in JS.\n   */\n  void invokeCallback(double callbackId, folly::dynamic&& args);\n\n  /**\n   * Executes a JS method on the given executor synchronously, returning its\n   * return value.  JSException will be thrown if JS throws an exception;\n   * another standard exception may be thrown for C++ bridge failures, or if\n   * the executor is not capable of synchronous calls.\n   *\n   * This method is experimental, and may be modified or removed.\n   *\n   * loadApplicationScriptSync() must be called and finished executing\n   * before callFunctionSync().\n   */\n  template <typename T>\n  Value callFunctionSync(const std::string& module, const std::string& method, T&& args) {\n    if (*m_destroyed) {\n      throw std::logic_error(\n        folly::to<std::string>(\"Synchronous call to \", module, \".\", method,\n                               \" after bridge is destroyed\"));\n    }\n\n    JSCExecutor *jscExecutor = dynamic_cast<JSCExecutor*>(m_executor.get());\n    if (!jscExecutor) {\n      throw std::invalid_argument(\n        folly::to<std::string>(\"Executor type \", typeid(m_executor.get()).name(),\n                               \" does not support synchronous calls\"));\n    }\n\n    return jscExecutor->callFunctionSync(module, method, std::forward<T>(args));\n  }\n\n  /**\n   * Starts the JS application.  If bundleRegistry is non-null, then it is\n   * used to fetch JavaScript modules as individual scripts.\n   * Otherwise, the script is assumed to include all the modules.\n   */\n  void loadApplication(\n    std::unique_ptr<RAMBundleRegistry> bundleRegistry,\n    std::unique_ptr<const JSBigString> startupCode,\n    std::string sourceURL);\n  void loadApplicationSync(\n    std::unique_ptr<RAMBundleRegistry> bundleRegistry,\n    std::unique_ptr<const JSBigString> startupCode,\n    std::string sourceURL);\n\n  void registerBundle(uint32_t bundleId, const std::string& bundlePath);\n  void setGlobalVariable(std::string propName, std::unique_ptr<const JSBigString> jsonValue);\n  void* getJavaScriptContext();\n  bool isInspectable();\n\n  #ifdef WITH_JSC_MEMORY_PRESSURE\n  void handleMemoryPressure(int pressureLevel);\n  #endif\n\n  /**\n   * Synchronously tears down the bridge and the main executor.\n   */\n  void destroy();\nprivate:\n  void runOnExecutorQueue(std::function<void(JSExecutor*)> task);\n\n  // This is used to avoid a race condition where a proxyCallback gets queued\n  // after ~NativeToJsBridge(), on the same thread. In that case, the callback\n  // will try to run the task on m_callback which will have been destroyed\n  // within ~NativeToJsBridge(), thus causing a SIGSEGV.\n  std::shared_ptr<bool> m_destroyed;\n  std::shared_ptr<JsToNativeBridge> m_delegate;\n  std::unique_ptr<JSExecutor> m_executor;\n  std::shared_ptr<MessageQueueThread> m_executorMessageQueueThread;\n\n  #ifdef WITH_FBSYSTRACE\n  std::atomic_uint_least32_t m_systraceCookie = ATOMIC_VAR_INIT();\n  #endif\n};\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/Platform.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"Platform.h\"\n\nnamespace facebook {\nnamespace react {\n\n#if __clang__\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wglobal-constructors\"\n#endif\n\nnamespace ReactMarker {\n\nLogTaggedMarker logTaggedMarker = nullptr;\nvoid logMarker(const ReactMarkerId markerId) {\n  logTaggedMarker(markerId, nullptr);\n}\n\n}\n\nnamespace JSCNativeHooks {\n\nHook loggingHook = nullptr;\nHook nowHook = nullptr;\nConfigurationHook installPerfHooks = nullptr;\n\n}\n\n#if __clang__\n#pragma clang diagnostic pop\n#endif\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/Platform.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <functional>\n#include <memory>\n#include <string>\n\n#include <cxxreact/JSExecutor.h>\n#include <cxxreact/MessageQueueThread.h>\n#include <jschelpers/JavaScriptCore.h>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\nnamespace ReactMarker {\n\nenum ReactMarkerId {\n  NATIVE_REQUIRE_START,\n  NATIVE_REQUIRE_STOP,\n  RUN_JS_BUNDLE_START,\n  RUN_JS_BUNDLE_STOP,\n  CREATE_REACT_CONTEXT_STOP,\n  JS_BUNDLE_STRING_CONVERT_START,\n  JS_BUNDLE_STRING_CONVERT_STOP,\n  NATIVE_MODULE_SETUP_START,\n  NATIVE_MODULE_SETUP_STOP,\n};\n\n#ifdef __APPLE__\nusing LogTaggedMarker = std::function<void(const ReactMarkerId, const char* tag)>;\n#else\ntypedef void(*LogTaggedMarker)(const ReactMarkerId, const char* tag);\n#endif\nextern RN_EXPORT LogTaggedMarker logTaggedMarker;\n\nextern void logMarker(const ReactMarkerId markerId);\n\n}\n\nnamespace JSCNativeHooks {\n\nusing Hook = JSValueRef(*)(\n  JSContextRef ctx,\n  JSObjectRef function,\n  JSObjectRef thisObject,\n  size_t argumentCount,\n  const JSValueRef arguments[],\n  JSValueRef *exception);\nextern RN_EXPORT Hook loggingHook;\nextern RN_EXPORT Hook nowHook;\n\ntypedef void(*ConfigurationHook)(JSGlobalContextRef);\nextern RN_EXPORT ConfigurationHook installPerfHooks;\n\n}\n\n} }\n"
  },
  {
    "path": "ReactCommon/cxxreact/RAMBundleRegistry.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"RAMBundleRegistry.h\"\n\n#include <folly/Memory.h>\n\n#include <libgen.h>\n\nnamespace facebook {\nnamespace react {\n\nconstexpr uint32_t RAMBundleRegistry::MAIN_BUNDLE_ID;\n\nstd::unique_ptr<RAMBundleRegistry> RAMBundleRegistry::singleBundleRegistry(std::unique_ptr<JSModulesUnbundle> mainBundle) {\n  RAMBundleRegistry *registry = new RAMBundleRegistry(std::move(mainBundle));\n  return std::unique_ptr<RAMBundleRegistry>(registry);\n}\n\nstd::unique_ptr<RAMBundleRegistry> RAMBundleRegistry::multipleBundlesRegistry(std::unique_ptr<JSModulesUnbundle> mainBundle, std::function<std::unique_ptr<JSModulesUnbundle>(std::string)> factory) {\n  RAMBundleRegistry *registry = new RAMBundleRegistry(std::move(mainBundle), std::move(factory));\n  return std::unique_ptr<RAMBundleRegistry>(registry);\n}\n\nRAMBundleRegistry::RAMBundleRegistry(std::unique_ptr<JSModulesUnbundle> mainBundle, std::function<std::unique_ptr<JSModulesUnbundle>(std::string)> factory): m_factory(factory) {\n  m_bundles.emplace(MAIN_BUNDLE_ID, std::move(mainBundle));\n}\n\nvoid RAMBundleRegistry::registerBundle(uint32_t bundleId, std::string bundlePath) {\n  m_bundlePaths.emplace(bundleId, bundlePath);\n}\n\nJSModulesUnbundle::Module RAMBundleRegistry::getModule(uint32_t bundleId, uint32_t moduleId) {\n  if (m_bundles.find(bundleId) == m_bundles.end()) {\n    if (!m_factory) {\n      throw std::runtime_error(\"You need to register factory function in order to support multiple RAM bundles.\");\n    }\n\n    auto bundlePath = m_bundlePaths.find(bundleId);\n    if (bundlePath == m_bundlePaths.end()) {\n      throw std::runtime_error(\"In order to fetch RAM bundle from the registry, its file path needs to be registered first.\");\n    }\n    m_bundles.emplace(bundleId, m_factory(bundlePath->second));\n  }\n\n  return getBundle(bundleId)->getModule(moduleId);\n}\n\nJSModulesUnbundle *RAMBundleRegistry::getBundle(uint32_t bundleId) const {\n  return m_bundles.at(bundleId).get();\n}\n\n}  // namespace react\n}  // namespace facebook\n"
  },
  {
    "path": "ReactCommon/cxxreact/RAMBundleRegistry.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <cstdint>\n#include <functional>\n#include <memory>\n#include <unordered_map>\n#include <utility>\n\n#include <cxxreact/JSModulesUnbundle.h>\n#include <jschelpers/noncopyable.h>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\nclass RN_EXPORT RAMBundleRegistry : noncopyable {\npublic:\n  using unique_ram_bundle = std::unique_ptr<JSModulesUnbundle>;\n  using bundle_path = std::string;\n  constexpr static uint32_t MAIN_BUNDLE_ID = 0;\n\n  static std::unique_ptr<RAMBundleRegistry> singleBundleRegistry(unique_ram_bundle mainBundle);\n  static std::unique_ptr<RAMBundleRegistry> multipleBundlesRegistry(unique_ram_bundle mainBundle, std::function<unique_ram_bundle(bundle_path)> factory);\n\n  RAMBundleRegistry(RAMBundleRegistry&&) = default;\n  RAMBundleRegistry& operator=(RAMBundleRegistry&&) = default;\n\n  void registerBundle(uint32_t bundleId, bundle_path bundlePath);\n  JSModulesUnbundle::Module getModule(uint32_t bundleId, uint32_t moduleId);\n  virtual ~RAMBundleRegistry() {};\nprivate:\n  explicit RAMBundleRegistry(unique_ram_bundle mainBundle, std::function<unique_ram_bundle(bundle_path)> factory = {});\n  JSModulesUnbundle *getBundle(uint32_t bundleId) const;\n\n  std::function<unique_ram_bundle(bundle_path)> m_factory;\n  std::unordered_map<uint32_t, bundle_path> m_bundlePaths;\n  std::unordered_map<uint32_t, unique_ram_bundle> m_bundles;\n};\n\n}  // namespace react\n}  // namespace facebook\n"
  },
  {
    "path": "ReactCommon/cxxreact/RecoverableError.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <exception>\n#include <functional>\n#include <string>\n\nnamespace facebook {\nnamespace react {\n\n/**\n * RecoverableError\n *\n * An exception that it is expected we should be able to recover from.\n */\nstruct RecoverableError : public std::exception {\n\n  explicit RecoverableError(const std::string &what_)\n    : m_what { \"facebook::react::Recoverable: \" + what_ }\n  {}\n\n  virtual const char* what() const throw() override { return m_what.c_str(); }\n\n  /**\n   * runRethrowingAsRecoverable\n   *\n   * Helper function that converts any exception of type `E`, thrown within the\n   * `act` routine into a recoverable error with the same message.\n   */\n  template <typename E>\n  inline static void runRethrowingAsRecoverable(std::function<void()> act) {\n    try {\n      act();\n    } catch(const E &err) {\n      throw RecoverableError(err.what());\n    }\n  }\n\nprivate:\n  std::string m_what;\n};\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactCommon/cxxreact/SampleCxxModule.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"SampleCxxModule.h\"\n#include <cxxreact/JsArgumentHelpers.h>\n\n#include <folly/Memory.h>\n#include <glog/logging.h>\n\n#include <thread>\n\nusing namespace folly;\n\nnamespace facebook { namespace xplat { namespace samples {\n\nstd::string Sample::hello() {\n  LOG(WARNING) << \"glog: hello, world\";\n  return \"hello\";\n}\n\ndouble Sample::add(double a, double b) {\n  return a + b;\n}\n\nstd::string Sample::concat(const std::string& a, const std::string& b) {\n  return a + b;\n}\n\nstd::string Sample::repeat(int count, const std::string& str) {\n  std::string ret;\n  for (int i = 0; i < count; i++) {\n    ret += str;\n  }\n\n  return ret;\n}\n\nvoid Sample::save(std::map<std::string, std::string> dict)\n{\n  state_ = std::move(dict);\n}\n\nstd::map<std::string, std::string> Sample::load() {\n  return state_;\n}\n\nvoid Sample::except() {\n// TODO mhorowitz #7128529: There's no way to automatically test this\n// right now.\n  // throw std::runtime_error(\"oops\");\n}\n\nvoid Sample::call_later(int msec, std::function<void()> f) {\n  std::thread t([=] {\n      std::this_thread::sleep_for(std::chrono::milliseconds(msec));\n      f();\n    });\n  t.detach();\n}\n\ndouble Sample::twice(double n) {\n  return n * 2;\n}\n\nSampleCxxModule::SampleCxxModule(std::unique_ptr<Sample> sample)\n  : sample_(std::move(sample)) {}\n\nstd::string SampleCxxModule::getName() {\n  return \"Sample\";\n}\n\nauto SampleCxxModule::getConstants() -> std::map<std::string, folly::dynamic> {\n  return {\n    { \"one\", 1 },\n    { \"two\", 2 },\n    { \"animal\", \"fox\" },\n  };\n}\n\nauto SampleCxxModule::getMethods() -> std::vector<Method> {\n  return {\n    Method(\"hello\", [this] {\n        sample_->hello();\n      }),\n    Method(\"add\", [this](dynamic args, Callback cb) {\n        LOG(WARNING) << \"Sample: add => \"\n                     << sample_->add(jsArgAsDouble(args, 0), jsArgAsDouble(args, 1));\n        cb({sample_->add(jsArgAsDouble(args, 0), jsArgAsDouble(args, 1))});\n      }),\n    Method(\"concat\", [this](dynamic args, Callback cb) {\n        cb({sample_->concat(jsArgAsString(args, 0),\n                            jsArgAsString(args, 1))});\n      }),\n    Method(\"repeat\", [this](dynamic args, Callback cb) {\n        cb({sample_->repeat(jsArgAsInt(args, 0),\n                            jsArgAsString(args, 1))});\n      }),\n    Method(\"save\", this, &SampleCxxModule::save),\n    Method(\"load\", this, &SampleCxxModule::load),\n    Method(\"call_later\", [this](dynamic args, Callback cb) {\n        sample_->call_later(jsArgAsInt(args, 0), [cb] {\n            cb({});\n          });\n      }),\n    Method(\"except\", [this] {\n        sample_->except();\n      }),\n    Method(\"twice\", [this](dynamic args) -> dynamic {\n        return sample_->twice(jsArgAsDouble(args, 0));\n      }, SyncTag),\n    Method(\"syncHello\", [this]() -> dynamic {\n        sample_->hello();\n        return nullptr;\n      }, SyncTag),\n  };\n}\n\nvoid SampleCxxModule::save(folly::dynamic args) {\n  std::map<std::string, std::string> m;\n  for (const auto& p : jsArgN(args, 0, &dynamic::items)) {\n    m.emplace(jsArg(p.first, &dynamic::asString, \"map key\"),\n              jsArg(p.second, &dynamic::asString, \"map value\"));\n  }\n  sample_->save(std::move(m));\n}\n\nvoid SampleCxxModule::load(folly::dynamic args, Callback cb) {\n  dynamic d = dynamic::object;\n  for (const auto& p : sample_->load()) {\n    d.insert(p.first, p.second);\n  }\n  cb({d});\n}\n\n}}}\n\n// By convention, the function name should be the same as the class name.\nfacebook::xplat::module::CxxModule *SampleCxxModule() {\n  return new facebook::xplat::samples::SampleCxxModule(\n    folly::make_unique<facebook::xplat::samples::Sample>());\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/SampleCxxModule.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <memory>\n#include <vector>\n\n#include <cxxreact/CxxModule.h>\n\nnamespace facebook { namespace xplat { namespace samples {\n\n// In a less contrived example, Sample would be part of a traditional\n// C++ library.\n\nclass Sample {\npublic:\n  std::string hello();\n  double add(double a, double b);\n  std::string concat(const std::string& a, const std::string& b);\n  std::string repeat(int count, const std::string& str);\n  void save(std::map<std::string, std::string> dict);\n  std::map<std::string, std::string> load();\n  void call_later(int msec, std::function<void()> f);\n  void except();\n  double twice(double n);\n\nprivate:\n  std::map<std::string, std::string> state_;\n};\n\nclass SampleCxxModule : public module::CxxModule {\npublic:\n  SampleCxxModule(std::unique_ptr<Sample> sample);\n\n  std::string getName();\n\n  virtual auto getConstants() -> std::map<std::string, folly::dynamic>;\n\n  virtual auto getMethods() -> std::vector<Method>;\n\nprivate:\n  void save(folly::dynamic args);\n  void load(folly::dynamic args, Callback cb);\n\n  std::unique_ptr<Sample> sample_;\n};\n\n}}}\n\nextern \"C\" facebook::xplat::module::CxxModule *SampleCxxModule();\n"
  },
  {
    "path": "ReactCommon/cxxreact/SharedProxyCxxModule.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <memory>\n\n#include <cxxreact/CxxModule.h>\n\nnamespace facebook { namespace xplat { namespace module {\n\n// Allows a Cxx-module to be shared or reused across multiple React instances\n// Caveat: the setInstance call is not forwarded, so usages of getInstance inside your\n// module (e.g. dispatching events) will always be nullptr.\nclass SharedProxyCxxModule : public CxxModule {\npublic:\n  explicit SharedProxyCxxModule(std::shared_ptr<CxxModule> shared)\n    : shared_(shared) {}\n\n  std::string getName() override {\n    return shared_->getName();\n  }\n\n  auto getConstants() -> std::map<std::string, folly::dynamic> override {\n    return shared_->getConstants();\n  }\n\n  auto getMethods() -> std::vector<Method> override {\n    return shared_->getMethods();\n  }\n\nprivate:\n  std::shared_ptr<CxxModule> shared_;\n};\n\n}\n}\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/SystraceSection.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#ifdef WITH_FBSYSTRACE\n#include <fbsystrace.h>\n#endif\n\nnamespace facebook {\nnamespace react {\n\n/**\n * This is a convenience class to avoid lots of verbose profiling\n * #ifdefs.  If WITH_FBSYSTRACE is not defined, the optimizer will\n * remove this completely.  If it is defined, it will behave as\n * FbSystraceSection, with the right tag provided. Use two separate classes to\n * to ensure that the ODR rule isn't violated, that is, if WITH_FBSYSTRACE has\n * different values in different files, there is no inconsistency in the sizes\n * of defined symbols.\n */\n#ifdef WITH_FBSYSTRACE\nstruct ConcreteSystraceSection {\npublic:\n  template<typename... ConvertsToStringPiece>\n  explicit\n  ConcreteSystraceSection(const char* name, ConvertsToStringPiece&&... args)\n    : m_section(TRACE_TAG_REACT_CXX_BRIDGE, name, args...)\n  {}\n\nprivate:\n  fbsystrace::FbSystraceSection m_section;\n};\nusing SystraceSection = ConcreteSystraceSection;\n#else\nstruct DummySystraceSection {\npublic:\n  template<typename... ConvertsToStringPiece>\n  explicit\n  DummySystraceSection(const char* name, ConvertsToStringPiece&&... args)\n    {}\n};\nusing SystraceSection = DummySystraceSection;\n#endif\n\n}}\n"
  },
  {
    "path": "ReactCommon/cxxreact/oss-compat-util.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n//TODO #14683310 remove this header as soon as RN iOS OSS links against folly\n\n#pragma once\n\n#if defined(ANDROID)\n  #define USE_FOLLY_FOR_ENDIAN_SWAP 1\n  #define USE_FOLLY_FOR_TO_STRING 1\n#elif defined(__has_include)\n  #define USE_FOLLY_FOR_ENDIAN_SWAP __has_include(<folly/Bits.h>)\n  #define USE_FOLLY_FOR_TO_STRING __has_include(<folly/Conv.h>)\n#else\n  #define USE_FOLLY_FOR_ENDIAN_SWAP 0\n  #define USE_FOLLY_FOR_TO_STRING 0\n#endif\n\n#if USE_FOLLY_FOR_ENDIAN_SWAP\n#include <folly/Bits.h>\n#elif defined(__APPLE__)\n#include <cstdint>\n#include <CoreFoundation/CFByteOrder.h>\n#endif // USE_FOLLY_FOR_ENDIAN_SWAP\n\n#if USE_FOLLY_FOR_TO_STRING\n#include <folly/Conv.h>\n#else\n#include <sstream>\n#include <string>\n#endif // USE_FOLLY_FOR_TO_STRING\n\n\n#if USE_FOLLY_FOR_ENDIAN_SWAP\nnamespace facebook {\nnamespace react {\n\ntemplate <typename T>\ninline T littleEndianToHost(T x) {\n  return folly::Endian::little(x);\n}\n\n#elif defined(__APPLE__)\n\nnamespace facebook {\nnamespace react {\n\n// Yes, this is horrible. #14683310\n\ninline int32_t littleEndianToHost(int32_t x) {\n  return CFSwapInt32LittleToHost(x);\n}\n\ninline uint32_t littleEndianToHost(uint32_t x) {\n  return CFSwapInt32LittleToHost(x);\n}\n\ninline int64_t littleEndianToHost(int64_t x) {\n  return CFSwapInt64LittleToHost(x);\n}\n\ninline uint64_t littleEndianToHost(uint64_t x) {\n  return CFSwapInt64LittleToHost(x);\n}\n\n#endif // USE_FOLLY_FOR_ENDIAN_SWAP\n\n#if USE_FOLLY_FOR_TO_STRING\n\ntemplate <typename ...Ts>\ninline std::string toString(Ts... values) {\n  return folly::to<std::string>(std::forward<Ts>(values)...);\n}\n\n#else\n\nnamespace {\n\ntemplate <typename ...Ts>\nstd::string toString(const std::stringstream& buf) {\n  return buf.str();\n}\n\ntemplate <typename T, typename ...Ts>\nstd::string toString(std::stringstream& buf, T value, Ts... values) {\n  buf << value;\n  return toString(buf, std::forward<Ts>(values)...);\n}\n\n} // anonymous namespace\n\ntemplate <typename ...Ts>\nstd::string toString(Ts... values) {\n  std::stringstream buf{};\n  return toString(buf, std::forward<Ts>(values)...);\n}\n\n#endif // USE_FOLLY_FOR_TO_STRING\n\n}  // namespace react\n}  // namespace facebook\n\n#undef USE_FOLLY_FOR_ENDIAN_SWAP\n#undef USE_FOLLY_FOR_TO_STRING\n"
  },
  {
    "path": "ReactCommon/cxxreact/tests/BUCK",
    "content": "TEST_SRCS = [\n    \"RecoverableErrorTest.cpp\",\n    \"jsarg_helpers.cpp\",\n    \"jsbigstring.cpp\",\n    \"jscexecutor.cpp\",\n    \"jsclogging.cpp\",\n    \"methodcall.cpp\",\n    \"value.cpp\",\n]\n\nif THIS_IS_FBANDROID:\n  include_defs('//ReactAndroid/DEFS')\n  include_defs('//ReactAndroid/TEST_DEFS')\n  jni_instrumentation_test_lib(\n    name = 'tests',\n    class_under_test = 'com/facebook/react/XplatBridgeTest',\n    soname = 'libxplat-bridge.so',\n    srcs = TEST_SRCS,\n    compiler_flags = [\n      '-fexceptions',\n      '-frtti',\n      '-std=c++14',\n    ],\n    deps = [\n      '//native/third-party/android-ndk:android',\n      'xplat//third-party/gmock:gtest',\n      react_native_xplat_target('cxxreact:bridge'),\n    ],\n    visibility = ['//instrumentation_tests/...'],\n  )\n\nif THIS_IS_FBOBJC:\n  fb_xplat_cxx_test(\n    name = 'tests',\n    srcs = TEST_SRCS,\n    compiler_flags = [\n      '-fexceptions',\n      '-frtti',\n    ],\n    deps = [\n      'xplat//folly:molly',\n      'xplat//third-party/gmock:gtest',\n      react_native_xplat_target('cxxreact:bridge'),\n      react_native_xplat_target('jschelpers:jschelpers'),\n    ],\n    visibility = [react_native_xplat_target('cxxreact/...')],\n  )\n"
  },
  {
    "path": "ReactCommon/cxxreact/tests/RecoverableErrorTest.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <gtest/gtest.h>\n\n#include <exception>\n#include <stdexcept>\n\n#include <cxxreact/RecoverableError.h>\n\nusing namespace facebook::react;\n\nTEST(RecoverableError, RunRethrowingAsRecoverableRecoverTest) {\n  try {\n    RecoverableError::runRethrowingAsRecoverable<std::runtime_error>([]() {\n        throw std::runtime_error(\"catch me\");\n      });\n    FAIL() << \"Unthrown exception\";\n  } catch (const RecoverableError &err) {\n    ASSERT_STREQ(err.what(), \"facebook::react::Recoverable: catch me\");\n  } catch (...) {\n    FAIL() << \"Uncaught exception\";\n  }\n}\n\nTEST(RecoverableError, RunRethrowingAsRecoverableFallthroughTest) {\n  try {\n    RecoverableError::runRethrowingAsRecoverable<std::runtime_error>([]() {\n        throw std::logic_error(\"catch me\");\n      });\n    FAIL() << \"Unthrown exception\";\n  } catch (const RecoverableError &err) {\n    FAIL() << \"Recovered exception that should have fallen through\";\n  } catch (const std::exception &err) {\n    ASSERT_STREQ(err.what(), \"catch me\");\n  }\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/tests/jsarg_helpers.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <cxxreact/JsArgumentHelpers.h>\n\n#include <folly/dynamic.h>\n\n#include <gtest/gtest.h>\n#include <algorithm>\n\nusing namespace std;\nusing namespace folly;\nusing namespace facebook::xplat;\n\n#define EXPECT_JSAE(statement, exstr) do {                              \\\n    try {                                                               \\\n      statement;                                                        \\\n      FAIL() << \"Expected JsArgumentException(\" << (exstr) << \") not thrown\"; \\\n    } catch (const JsArgumentException& ex) {                           \\\n      EXPECT_EQ(ex.what(), std::string(exstr));                         \\\n    }                                                                   \\\n  } while(0) // let any other exception escape, gtest will deal.\n\nTEST(JsArgumentHelpersTest, args) {\n  const bool aBool = true;\n  const int64_t anInt = 17;\n  const double aDouble = 3.14;\n  const string aString = \"word\";\n  const dynamic anArray = dynamic::array(\"a\", \"b\", \"c\");\n  const dynamic anObject = dynamic::object(\"k1\", \"v1\")(\"k2\", \"v2\");\n  const string aNumericString = to<string>(anInt);\n\n  folly::dynamic args = dynamic::array(aBool, anInt, aDouble, aString, anArray, anObject, aNumericString);\n\n  EXPECT_EQ(jsArgAsBool(args, 0), aBool);\n  EXPECT_EQ(jsArgAsInt(args, 1), anInt);\n  EXPECT_EQ(jsArgAsDouble(args, 2), aDouble);\n  EXPECT_EQ(jsArgAsString(args, 3), aString);\n  EXPECT_EQ(jsArgAsArray(args, 4), anArray);\n  EXPECT_EQ(jsArgAsObject(args, 5), anObject);\n\n  // const args\n  const folly::dynamic& cargs = args;\n  const folly::dynamic& a4 = jsArgAsArray(cargs, 4);\n  EXPECT_EQ(a4, anArray);\n  EXPECT_EQ(jsArgAsObject(cargs, 5), anObject);\n\n  // helpers returning dynamic should return same object without copying\n  EXPECT_EQ(&jsArgAsArray(args, 4), &(args[4]));\n  EXPECT_EQ(&jsArgAsArray(cargs, 4), &(args[4]));\n\n  // dynamics returned for mutable args should be mutable.  The test is that\n  // this compiles.\n  jsArgAsArray(args, 4)[2] = \"d\";\n  jsArgAsArray(args, 4)[2] = \"c\";\n  // These fail to compile due to constness.\n  // jsArgAsArray(cargs, 4)[2] = \"d\";\n  // jsArgAsArray(cargs, 4)[2] = \"c\";\n\n  // ref-qualified member function tests\n  EXPECT_EQ(jsArgN(args, 3, &folly::dynamic::getString), aString);\n  EXPECT_EQ(jsArg(args[3], &folly::dynamic::getString), aString);\n\n  // conversions\n  EXPECT_EQ(jsArgAsDouble(args, 1), anInt * 1.0);\n  EXPECT_EQ(jsArgAsString(args, 1), aNumericString);\n  EXPECT_EQ(jsArgAsInt(args, 6), anInt);\n\n  // Test exception messages.\n\n  // out_of_range\n  EXPECT_JSAE(jsArgAsBool(args, 7),\n              \"JavaScript provided 7 arguments for C++ method which references at least \"\n              \"8 arguments: out of range in dynamic array\");\n  // Conv range_error (invalid value conversion)\n  const std::string exhead = \"Could not convert argument 3 to required type: \";\n  const std::string extail = \": Invalid leading character: \\\"word\\\"\";\n  try {\n    jsArgAsInt(args, 3);\n    FAIL() << \"Expected JsArgumentException(\" << exhead << \"...\" << extail << \") not thrown\";\n  } catch (const JsArgumentException& ex) {\n    const std::string exwhat = ex.what();\n\n    EXPECT_GT(exwhat.size(), exhead.size());\n    EXPECT_GT(exwhat.size(), extail.size());\n\n    EXPECT_TRUE(std::equal(exhead.cbegin(), exhead.cend(), exwhat.cbegin()))\n      << \"JsArgumentException('\" << exwhat << \"') does not begin with '\" << exhead << \"'\";\n    EXPECT_TRUE(std::equal(extail.crbegin(), extail.crend(), exwhat.crbegin()))\n      << \"JsArgumentException('\" << exwhat << \"') does not end with '\" << extail << \"'\";\n  }\n  // inconvertible types\n  EXPECT_JSAE(jsArgAsArray(args, 2),\n              \"Argument 3 of type double is not required type Array\");\n  EXPECT_JSAE(jsArgAsInt(args, 4),\n              \"Error converting javascript arg 4 to C++: \"\n              \"TypeError: expected dynamic type `int/double/bool/string', but had type `array'\");\n  // type predicate failure\n  EXPECT_JSAE(jsArgAsObject(args, 4),\n              \"Argument 5 of type array is not required type Object\");\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/tests/jsbigstring.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n#include <sys/mman.h>\n#include <fcntl.h>\n\n#include <folly/File.h>\n#include <gtest/gtest.h>\n#include <cxxreact/JSBigString.h>\n\nusing namespace facebook;\nusing namespace facebook::react;\n\nnamespace {\nint tempFileFromString(std::string contents)\n{\n  std::string tmp {getenv(\"TMPDIR\")};\n  tmp += \"/temp.XXXXXX\";\n\n  std::vector<char> tmpBuf {tmp.begin(), tmp.end()};\n  tmpBuf.push_back('\\0');\n\n  const int fd = mkstemp(tmpBuf.data());\n  write(fd, contents.c_str(), contents.size() + 1);\n\n  return fd;\n}\n};\n\nTEST(JSBigFileString, MapWholeFileTest) {\n  std::string data {\"Hello, world\"};\n  const auto size = data.length() + 1;\n\n  // Initialise Big String\n  int fd = tempFileFromString(\"Hello, world\");\n  JSBigFileString bigStr {fd, size};\n\n  // Test\n  ASSERT_STREQ(data.c_str(), bigStr.c_str());\n}\n\nTEST(JSBigFileString, MapPartTest) {\n  std::string data {\"Hello, world\"};\n\n  // Sub-string to actually map\n  std::string needle {\"or\"};\n  off_t offset = data.find(needle);\n\n  // Initialise Big String\n  int fd = tempFileFromString(data);\n  JSBigFileString bigStr {fd, needle.size(), offset};\n\n  // Test\n  ASSERT_EQ(needle.length(), bigStr.size());\n  for (unsigned int i = 0; i < needle.length(); ++i) {\n    ASSERT_EQ(needle[i], bigStr.c_str()[i]);\n  }\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/tests/jscexecutor.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <gtest/gtest.h>\n#include <cxxreact/JSCExecutor.h>\n#include <cxxreact/MessageQueueThread.h>\n#include <cxxreact/MethodCall.h>\n\nusing namespace facebook;\nusing namespace facebook::react;\n\n\n// TODO(12340362): Fix these tests. And add checks for sizes.\n/*\n\nnamespace {\n\nstd::string capturedMethodCalls;\n\nstruct NullDelegate : ExecutorDelegate {\n  virtual void registerExecutor(std::unique_ptr<JSExecutor> executor,\n                                std::shared_ptr<MessageQueueThread> queue) {\n    std::terminate();\n  }\n\n  virtual std::unique_ptr<JSExecutor> unregisterExecutor(JSExecutor& executor) {\n    std::terminate();\n  }\n\n  virtual std::vector<std::string> moduleNames() {\n    return std::vector<std::string>{};\n  }\n\n  virtual folly::dynamic getModuleConfig(const std::string& name) {\n    std::terminate();\n  }\n  virtual void callNativeModules(\n      JSExecutor& executor, std::string callJSON, bool isEndOfBatch) {\n    // TODO: capture calljson\n    std::terminate();\n  }\n  virtual MethodCallResult callSerializableNativeHook(\n      JSExecutor& executor, unsigned int moduleId, unsigned int methodId, folly::dynamic&& args) {\n    std::terminate();\n  }\n};\n\nstruct FakeMessageQueue : MessageQueueThread {\n  virtual void runOnQueue(std::function<void()>&& runnable) {\n    // This is wrong, but oh well.\n    runnable();\n  }\n\n  virtual void runOnQueueSync(std::function<void()>&& runnable) {\n    runnable();\n  }\n\n  virtual void quitSynchronous() {\n    std::terminate();\n  }\n};\n\nstd::vector<MethodCall> executeForMethodCalls(\n    JSCExecutor& e,\n    int moduleId,\n    int methodId,\n    folly::dynamic args = folly::dynamic::array()) {\n  e.callFunction(folly::to<std::string>(moduleId), folly::to<std::string>(methodId), std::move(args));\n  return parseMethodCalls(capturedMethodCalls);\n}\n\nvoid loadApplicationScript(JSCExecutor& e, std::string jsText) {\n  e.loadApplicationScript(std::unique_ptr<JSBigString>(new JSBigStdString(jsText)), \"\");\n}\n\nvoid setGlobalVariable(JSCExecutor& e, std::string name, std::string jsonObject) {\n  e.setGlobalVariable(name, std::unique_ptr<JSBigString>(new JSBigStdString(jsonObject)));\n}\n\n}\n\nTEST(JSCExecutor, Initialize) {\n  JSCExecutor executor(std::make_shared<NullDelegate>(), std::make_shared<FakeMessageQueue>(), \"\", folly::dynamic::object);\n}\n\nTEST(JSCExecutor, Two) {\n  JSCExecutor exec1(std::make_shared<NullDelegate>(), std::make_shared<FakeMessageQueue>(), \"\", folly::dynamic::object);\n  JSCExecutor exec2(std::make_shared<NullDelegate>(), std::make_shared<FakeMessageQueue>(), \"\", folly::dynamic::object);\n}\n\nTEST(JSCExecutor, CallFunction) {\n  auto jsText = \"\"\n  \"var Bridge = {\"\n  \"  callFunctionReturnFlushedQueue: function (module, method, args) {\"\n  \"    return [[module + 1], [method + 1], [args]];\"\n  \"  },\"\n  \"};\"\n  \"function require() { return Bridge; }\"\n  \"\";\n  JSCExecutor e(std::make_shared<NullDelegate>(), std::make_shared<FakeMessageQueue>(), \"\", folly::dynamic::object);\n  loadApplicationScript(e, jsText);\n  folly::dynamic args = folly::dynamic::array();\n  args.push_back(true);\n  args.push_back(0.4);\n  args.push_back(\"hello, world\");\n  args.push_back(4.0);\n  auto returnedCalls = executeForMethodCalls(e, 10, 9, args);\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  EXPECT_EQ(11, returnedCall.moduleId);\n  EXPECT_EQ(10, returnedCall.methodId);\n  ASSERT_EQ(4, returnedCall.arguments.size());\n  EXPECT_EQ(args[0], returnedCall.arguments[0]);\n  EXPECT_EQ(args[1], returnedCall.arguments[1]);\n  EXPECT_EQ(args[2], returnedCall.arguments[2]);\n  EXPECT_EQ(folly::dynamic(4.0), returnedCall.arguments[3]);\n}\n\nTEST(JSCExecutor, CallFunctionWithMap) {\n  auto jsText = \"\"\n  \"var Bridge = {\"\n  \"  callFunctionReturnFlushedQueue: function (module, method, args) {\"\n  \"    var s = args[0].foo + args[0].bar + args[0].baz;\"\n  \"    return [[module], [method], [[s]]];\"\n  \"  },\"\n  \"};\"\n  \"function require() { return Bridge; }\"\n  \"\";\n  JSCExecutor e(std::make_shared<NullDelegate>(), std::make_shared<FakeMessageQueue>(), \"\", folly::dynamic::object);\n  loadApplicationScript(e, jsText);\n  folly::dynamic args = folly::dynamic::array();\n  folly::dynamic map = folly::dynamic::object\n    (\"foo\", folly::dynamic(\"hello\"))\n    (\"bar\", folly::dynamic(4.0))\n    (\"baz\", folly::dynamic(true))\n  ;\n  args.push_back(std::move(map));\n  auto returnedCalls = executeForMethodCalls(e, 10, 9, args);\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  EXPECT_EQ(\"hello4true\", returnedCall.arguments[0].getString());\n}\n\nTEST(JSCExecutor, CallFunctionReturningMap) {\n  auto jsText = \"\"\n  \"var Bridge = {\"\n  \"  callFunctionReturnFlushedQueue: function (module, method, args) {\"\n  \"    var s = { foo: 4, bar: true };\"\n  \"    return [[module], [method], [[s]]];\"\n  \"  },\"\n  \"};\"\n  \"function require() { return Bridge; }\"\n  \"\";\n  JSCExecutor e(std::make_shared<NullDelegate>(), std::make_shared<FakeMessageQueue>(), \"\", folly::dynamic::object);\n  loadApplicationScript(e, jsText);\n  auto returnedCalls = executeForMethodCalls(e, 10, 9);\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  ASSERT_EQ(folly::dynamic::OBJECT, returnedCall.arguments[0].type());\n  auto& returnedMap = returnedCall.arguments[0];\n  auto foo = returnedMap.at(\"foo\");\n  EXPECT_EQ(folly::dynamic(4.0), foo);\n  auto bar = returnedMap.at(\"bar\");\n  EXPECT_EQ(folly::dynamic(true), bar);\n}\n\nTEST(JSCExecutor, CallFunctionWithArray) {\n  auto jsText = \"\"\n  \"var Bridge = {\"\n  \"  callFunctionReturnFlushedQueue: function (module, method, args) {\"\n  \"    var s = args[0][0]+ args[0][1] + args[0][2] + args[0].length;\"\n  \"    return [[module], [method], [[s]]];\"\n  \"  },\"\n  \"};\"\n  \"function require() { return Bridge; }\"\n  \"\";\n  JSCExecutor e(std::make_shared<NullDelegate>(), std::make_shared<FakeMessageQueue>(), \"\", folly::dynamic::object);\n  loadApplicationScript(e, jsText);\n  std::vector<folly::dynamic> args;\n  std::vector<folly::dynamic> array {\n    folly::dynamic(\"hello\"),\n    folly::dynamic(4.0),\n    folly::dynamic(true),\n  };\n  args.push_back(std::move(array));\n  auto returnedCalls = executeForMethodCalls(e, 10, 9, args);\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  EXPECT_EQ(\"hello4true3\", returnedCall.arguments[0].getString());\n}\n\nTEST(JSCExecutor, CallFunctionReturningNumberArray) {\n  auto jsText = \"\"\n  \"var Bridge = {\"\n  \"  callFunctionReturnFlushedQueue: function (module, method, args) {\"\n  \"    var s = [3, 1, 4];\"\n  \"    return [[module], [method], [[s]]];\"\n  \"  },\"\n  \"};\"\n  \"function require() { return Bridge; }\"\n  \"\";\n  JSCExecutor e(std::make_shared<NullDelegate>(), std::make_shared<FakeMessageQueue>(), \"\", folly::dynamic::object);\n  loadApplicationScript(e, jsText);\n  auto returnedCalls = executeForMethodCalls(e, 10, 9);\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  ASSERT_EQ(folly::dynamic::ARRAY, returnedCall.arguments[0].type());\n\n  auto& array = returnedCall.arguments[0];\n  EXPECT_EQ(3, array.size());\n  EXPECT_EQ(folly::dynamic(3.0), array[0]);\n  EXPECT_EQ(folly::dynamic(4.0), array[2]);\n}\n\nTEST(JSCExecutor, SetSimpleGlobalVariable) {\n  auto jsText = \"\"\n  \"var Bridge = {\"\n  \"  callFunctionReturnFlushedQueue: function (module, method, args) {\"\n  \"    return [[module], [method], [[__foo]]];\"\n  \"  },\"\n  \"};\"\n  \"function require() { return Bridge; }\"\n  \"\";\n  JSCExecutor e(std::make_shared<NullDelegate>(), std::make_shared<FakeMessageQueue>(), \"\", folly::dynamic::object);\n  loadApplicationScript(e, jsText);\n  setGlobalVariable(e, \"__foo\", \"42\");\n  auto returnedCalls = executeForMethodCalls(e, 10, 9);\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  ASSERT_EQ(42.0, returnedCall.arguments[0].getDouble());\n}\n\nTEST(JSCExecutor, SetObjectGlobalVariable) {\n  auto jsText = \"\"\n  \"var Bridge = {\"\n  \"  callFunctionReturnFlushedQueue: function (module, method, args) {\"\n  \"    return [[module], [method], [[__foo]]];\"\n  \"  },\"\n  \"};\"\n  \"function require() { return Bridge; }\"\n  \"\";\n  JSCExecutor e(std::make_shared<NullDelegate>(), std::make_shared<FakeMessageQueue>(), \"\", folly::dynamic::object);\n  loadApplicationScript(e, jsText);\n  auto jsonObject = \"\"\n  \"{\"\n  \"  \\\"foo\\\": \\\"hello\\\",\"\n  \"  \\\"bar\\\": 4,\"\n  \"  \\\"baz\\\": true\"\n  \"}\"\n  \"\";\n  setGlobalVariable(e, \"__foo\", jsonObject);\n  auto returnedCalls = executeForMethodCalls(e, 10, 9);\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  ASSERT_EQ(folly::dynamic::OBJECT, returnedCall.arguments[0].type());\n  auto& returnedMap = returnedCall.arguments[0];\n  auto foo = returnedMap.at(\"foo\");\n  EXPECT_EQ(folly::dynamic(\"hello\"), foo);\n  auto bar = returnedMap.at(\"bar\");\n  EXPECT_EQ(folly::dynamic(4.0), bar);\n  auto baz = returnedMap.at(\"baz\");\n  EXPECT_EQ(folly::dynamic(true), baz);\n}\n\n*/\n"
  },
  {
    "path": "ReactCommon/cxxreact/tests/jsclogging.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <gtest/gtest.h>\n#include <cxxreact/JSCExecutor.h>\n\nusing namespace facebook;\nusing namespace facebook::react;\n\n/*\nstatic const char* expectedLogMessageSubstring = NULL;\nstatic bool hasSeenExpectedLogMessage = false;\n\nstatic void mockLogHandler(int pri, const char *tag, const char *msg) {\n  if (expectedLogMessageSubstring == NULL) {\n    return;\n  }\n\n  hasSeenExpectedLogMessage |= (strstr(msg, expectedLogMessageSubstring) != NULL);\n}\n\nclass JSCLoggingTest : public testing::Test {\n  protected:\n    virtual void SetUp() override {\n      setLogHandler(&mockLogHandler);\n    }\n\n    virtual void TearDown() override {\n      setLogHandler(NULL);\n      expectedLogMessageSubstring = NULL;\n      hasSeenExpectedLogMessage = false;\n    }\n\n};\n\nTEST_F(JSCLoggingTest, LogException) {\n  auto jsText = \"throw new Error('I am a banana!');\";\n  expectedLogMessageSubstring = \"I am a banana!\";\n\n  JSCExecutor e;\n  e.loadApplicationScript(jsText, \"\");\n\n  ASSERT_TRUE(hasSeenExpectedLogMessage);\n}\n*/\n"
  },
  {
    "path": "ReactCommon/cxxreact/tests/methodcall.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <cxxreact/MethodCall.h>\n\n#include <folly/json.h>\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsign-compare\"\n#include <gtest/gtest.h>\n#pragma GCC diagnostic pop\n\nusing namespace facebook;\nusing namespace facebook::react;\nusing namespace folly;\n\nTEST(parseMethodCalls, SingleReturnCallNoArgs) {\n  auto jsText = \"[[7],[3],[[]]]\";\n  auto returnedCalls = parseMethodCalls(folly::parseJson(jsText));\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(0, returnedCall.arguments.size());\n  ASSERT_EQ(7, returnedCall.moduleId);\n  ASSERT_EQ(3, returnedCall.methodId);\n}\n\nTEST(parseMethodCalls, InvalidReturnFormat) {\n  try {\n    auto input = dynamic::object(\"foo\", 1);\n    parseMethodCalls(std::move(input));\n    ADD_FAILURE();\n  } catch (const std::invalid_argument&) {\n    // ignored\n  }\n  try {\n    auto input = dynamic::array(dynamic::object(\"foo\", 1));\n    parseMethodCalls(std::move(input));\n    ADD_FAILURE();\n  } catch (const std::invalid_argument&) {\n    // ignored\n  }\n  try {\n    auto input = dynamic::array(1, 4, dynamic::object(\"foo\", 2));\n    parseMethodCalls(std::move(input));\n    ADD_FAILURE();\n  } catch (const std::invalid_argument&) {\n    // ignored\n  }\n  try {\n    auto input = dynamic::array(dynamic::array(1),\n                                dynamic::array(4),\n                                dynamic::object(\"foo\", 2));\n    parseMethodCalls(std::move(input));\n    ADD_FAILURE();\n  } catch (const std::invalid_argument&) {\n    // ignored\n  }\n  try {\n    auto input = dynamic::array(dynamic::array(1),\n                                dynamic::array(4),\n                                dynamic::array());\n    parseMethodCalls(std::move(input));\n    ADD_FAILURE();\n  } catch (const std::invalid_argument&) {\n    // ignored\n  }\n}\n\nTEST(parseMethodCalls, NumberReturn) {\n  auto jsText = \"[[0],[0],[[\\\"foobar\\\"]]]\";\n  auto returnedCalls = parseMethodCalls(folly::parseJson(jsText));\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  ASSERT_EQ(folly::dynamic::STRING, returnedCall.arguments[0].type());\n  ASSERT_EQ(\"foobar\", returnedCall.arguments[0].asString());\n}\n\nTEST(parseMethodCalls, StringReturn) {\n  auto jsText = \"[[0],[0],[[42.16]]]\";\n  auto returnedCalls = parseMethodCalls(folly::parseJson(jsText));\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  ASSERT_EQ(folly::dynamic::DOUBLE, returnedCall.arguments[0].type());\n  ASSERT_EQ(42.16, returnedCall.arguments[0].asDouble());\n}\n\nTEST(parseMethodCalls, BooleanReturn) {\n  auto jsText = \"[[0],[0],[[false]]]\";\n  auto returnedCalls = parseMethodCalls(folly::parseJson(jsText));\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  ASSERT_EQ(folly::dynamic::BOOL, returnedCall.arguments[0].type());\n  ASSERT_FALSE(returnedCall.arguments[0].asBool());\n}\n\nTEST(parseMethodCalls, NullReturn) {\n  auto jsText = \"[[0],[0],[[null]]]\";\n  auto returnedCalls = parseMethodCalls(folly::parseJson(jsText));\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  ASSERT_EQ(folly::dynamic::NULLT, returnedCall.arguments[0].type());\n}\n\nTEST(parseMethodCalls, MapReturn) {\n  auto jsText = \"[[0],[0],[[{\\\"foo\\\": \\\"hello\\\", \\\"bar\\\": 4.0, \\\"baz\\\": true}]]]\";\n  auto returnedCalls = parseMethodCalls(folly::parseJson(jsText));\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  ASSERT_EQ(folly::dynamic::OBJECT, returnedCall.arguments[0].type());\n  auto& returnedMap = returnedCall.arguments[0];\n  auto foo = returnedMap.at(\"foo\");\n  EXPECT_EQ(folly::dynamic(\"hello\"), foo);\n  auto bar = returnedMap.at(\"bar\");\n  EXPECT_EQ(folly::dynamic(4.0), bar);\n  auto baz = returnedMap.at(\"baz\");\n  EXPECT_EQ(folly::dynamic(true), baz);\n}\n\nTEST(parseMethodCalls, ArrayReturn) {\n  auto jsText = \"[[0],[0],[[[\\\"foo\\\", 42.0, false]]]]\";\n  auto returnedCalls = parseMethodCalls(folly::parseJson(jsText));\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(1, returnedCall.arguments.size());\n  ASSERT_EQ(folly::dynamic::ARRAY, returnedCall.arguments[0].type());\n  auto& returnedArray = returnedCall.arguments[0];\n  ASSERT_EQ(3, returnedArray.size());\n  ASSERT_EQ(folly::dynamic(\"foo\"), returnedArray[0]);\n  ASSERT_EQ(folly::dynamic(42.0), returnedArray[1]);\n  ASSERT_EQ(folly::dynamic(false), returnedArray[2]);\n}\n\nTEST(parseMethodCalls, ReturnMultipleParams) {\n  auto jsText = \"[[0],[0],[[\\\"foo\\\", 14, null, false]]]\";\n  auto returnedCalls = parseMethodCalls(folly::parseJson(jsText));\n  ASSERT_EQ(1, returnedCalls.size());\n  auto returnedCall = returnedCalls[0];\n  ASSERT_EQ(4, returnedCall.arguments.size());\n  ASSERT_EQ(folly::dynamic::STRING, returnedCall.arguments[0].type());\n  ASSERT_EQ(folly::dynamic::INT64, returnedCall.arguments[1].type());\n  ASSERT_EQ(folly::dynamic::NULLT, returnedCall.arguments[2].type());\n  ASSERT_EQ(folly::dynamic::BOOL, returnedCall.arguments[3].type());\n}\n\nTEST(parseMethodCalls, ParseTwoCalls) {\n  auto jsText = \"[[0,0],[1,1],[[],[]]]\";\n  auto returnedCalls = parseMethodCalls(folly::parseJson(jsText));\n  ASSERT_EQ(2, returnedCalls.size());\n}\n"
  },
  {
    "path": "ReactCommon/cxxreact/tests/value.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n#include <string>\n#include <gtest/gtest.h>\n#include <folly/json.h>\n#include <jschelpers/Value.h>\n\n#ifdef WITH_FBJSCEXTENSION\n#undef ASSERT\n#include <JavaScriptCore/config.h>\n#include \"OpaqueJSString.h\"\n#endif\n\n#include <stdexcept>\n\nusing namespace facebook::react;\n\n#ifdef ANDROID\n#include <android/looper.h>\nstatic void prepare() {\n  ALooper_prepare(0);\n}\n#else\nstatic void prepare() {}\n#endif\n\nTEST(Value, Undefined) {\n  prepare();\n  JSGlobalContextRef ctx = JSC_JSGlobalContextCreateInGroup(false, nullptr, nullptr);\n  auto v = Value::makeUndefined(ctx);\n  auto s = String::adopt(ctx, JSC_JSValueToStringCopy(ctx, v, nullptr));\n  EXPECT_EQ(\"undefined\", s.str());\n  JSC_JSGlobalContextRelease(ctx);\n}\n\nTEST(Value, FromJSON) {\n  prepare();\n  JSGlobalContextRef ctx = JSC_JSGlobalContextCreateInGroup(false, nullptr, nullptr);\n  String s(ctx, \"{\\\"a\\\": 4}\");\n  Value v(Value::fromJSON(s));\n  EXPECT_TRUE(v.isObject());\n  JSC_JSGlobalContextRelease(ctx);\n}\n\nTEST(Value, ToJSONString) {\n  prepare();\n  JSGlobalContextRef ctx = JSC_JSGlobalContextCreateInGroup(false, nullptr, nullptr);\n  String s(ctx, \"{\\\"a\\\": 4}\");\n  Value v(Value::fromJSON(s));\n  folly::dynamic dyn = folly::parseJson(v.toJSONString());\n  ASSERT_NE(nullptr, dyn);\n  EXPECT_TRUE(dyn.isObject());\n  auto val = dyn.at(\"a\");\n  ASSERT_NE(nullptr, val);\n  ASSERT_TRUE(val.isNumber());\n  EXPECT_EQ(4, val.asInt());\n  EXPECT_EQ(4.0f, val.asDouble());\n\n  JSC_JSGlobalContextRelease(ctx);\n}\n\n#ifdef WITH_FBJSCEXTENSION\n// Just test that handling invalid data doesn't crash.\nTEST(Value, FromBadUtf8) {\n  prepare();\n  JSGlobalContextRef ctx = JSC_JSGlobalContextCreateInGroup(false, nullptr, nullptr);\n  // 110xxxxx 10xxxxxx\n  auto dyn = folly::dynamic(\"\\xC0\");\n  Value::fromDynamic(ctx, dyn);\n  dyn = folly::dynamic(\"\\xC0\\x00\");\n  Value::fromDynamic(ctx, dyn);\n  // 1110xxxx 10xxxxxx  10xxxxxx\n  dyn = \"\\xE0\";\n  Value::fromDynamic(ctx, dyn);\n  Value(ctx, Value::fromDynamic(ctx, dyn)).toJSONString();\n  dyn = \"\\xE0\\x00\";\n  Value::fromDynamic(ctx, dyn);\n  Value(ctx, Value::fromDynamic(ctx, dyn)).toJSONString();\n  dyn = \"\\xE0\\x00\\x00\";\n  Value::fromDynamic(ctx, dyn);\n  Value(ctx, Value::fromDynamic(ctx, dyn)).toJSONString();\n  dyn = \"\\xE0\\xA0\\x00\";\n  Value::fromDynamic(ctx, dyn);\n  // 11110xxx 10xxxxxx  10xxxxxx  10xxxxxx\n  dyn = \"\\xF0\";\n  Value::fromDynamic(ctx, dyn);\n  Value(ctx, Value::fromDynamic(ctx, dyn)).toJSONString();\n  dyn = \"\\xF0\\x00\\x00\\x00\";\n  Value::fromDynamic(ctx, dyn);\n  dyn = \"\\xF0\\x80\\x80\\x00\";\n  Value::fromDynamic(ctx, dyn);\n  Value(ctx, Value::fromDynamic(ctx, dyn)).toJSONString();\n  JSC_JSGlobalContextRelease(ctx);\n}\n\n// Just test that handling invalid data doesn't crash.\nTEST(Value, BadUtf16) {\n  prepare();\n  JSGlobalContextRef ctx = JSC_JSGlobalContextCreateInGroup(false, nullptr, nullptr);\n  UChar buf[] = { 0xDD00, 0xDD00, 0xDD00, 0x1111 };\n  JSStringRef ref = OpaqueJSString::create(buf, 4).leakRef();\n  Value v(ctx, ref);\n  v.toJSONString(0);\n  JSC_JSGlobalContextRelease(ctx);\n}\n#endif\n"
  },
  {
    "path": "ReactCommon/jschelpers/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := jschelpers\n\nLOCAL_SRC_FILES := \\\n  JSCHelpers.cpp \\\n  Unicode.cpp \\\n  Value.cpp \\\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/..\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)\n\nLOCAL_CFLAGS := \\\n  -DLOG_TAG=\\\"ReactNative\\\"\n\nLOCAL_CFLAGS += -Wall -Werror -fexceptions -frtti\nCXX11_FLAGS := -std=c++11\nLOCAL_CFLAGS += $(CXX11_FLAGS)\nLOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)\n\nLOCAL_SHARED_LIBRARIES := libfolly_json libjsc libglog\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,folly)\n$(call import-module,jsc)\n$(call import-module,glog)\n$(call import-module,privatedata)\n"
  },
  {
    "path": "ReactCommon/jschelpers/BUCK",
    "content": "include_defs(\"xplat//configurations/buck/apple/flag_defs.bzl\")\n\ninclude_defs(\"//ReactCommon/DEFS\")\n\nEXPORTED_HEADERS = [\n    \"JavaScriptCore.h\",\n    \"JSCHelpers.h\",\n    \"JSCWrapper.h\",\n    \"noncopyable.h\",\n    \"Unicode.h\",\n    \"Value.h\",\n]\n\nrn_xplat_cxx_library(\n    name = \"jscinternalhelpers\",\n    srcs = glob(\n        [\"*.cpp\"],\n        excludes = [\"systemJSCWrapper.cpp\"],\n    ),\n    headers = glob(\n        [\"*.h\"],\n        excludes = EXPORTED_HEADERS,\n    ),\n    header_namespace = \"\",\n    exported_headers = dict([\n        (\n            \"jschelpers/%s\" % header,\n            header,\n        )\n        for header in EXPORTED_HEADERS\n    ]),\n    compiler_flags = [\n        \"-Wall\",\n        \"-fexceptions\",\n        \"-frtti\",\n        \"-fvisibility=hidden\",\n        \"-std=c++1y\",\n    ],\n    exported_deps = [\n        react_native_xplat_target(\"privatedata:privatedata\"),\n    ],\n    fbobjc_inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS,\n    force_static = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = JSC_INTERNAL_DEPS + [\n        \"xplat//folly:molly\",\n    ],\n)\n\nrn_xplat_cxx_library(\n    name = \"jschelpers\",\n    srcs = [],\n    compiler_flags = [\n        \"-Wall\",\n        \"-fexceptions\",\n        \"-fvisibility=hidden\",\n        \"-std=c++1y\",\n    ],\n    fbobjc_frameworks = [\n        \"$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework\",\n    ],\n    fbobjc_inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS,\n    fbobjc_srcs = [\"systemJSCWrapper.cpp\"],\n    force_static = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\":jscinternalhelpers\"],\n)\n"
  },
  {
    "path": "ReactCommon/jschelpers/JSCHelpers.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"JSCHelpers.h\"\n\n#ifdef WITH_FBSYSTRACE\n#include <fbsystrace.h>\n#endif\n\n#include <glog/logging.h>\n\n#if WITH_FBJSCEXTENSIONS\n#include <pthread.h>\n#endif\n\n#include \"JavaScriptCore.h\"\n#include \"Value.h\"\n#include <privatedata/PrivateDataBase.h>\n\n#if WITH_FBJSCEXTENSIONS\n#undef ASSERT\n#undef WTF_EXPORT_PRIVATE\n\n#include <JavaScriptCore/config.h>\n#include <wtf/WTFThreadData.h>\n\n#undef TRUE\n#undef FALSE\n#endif\n\nnamespace facebook {\nnamespace react {\n\nnamespace {\n\nclass JSFunctionPrivateData : public PrivateDataBase {\n public:\n  explicit JSFunctionPrivateData(JSFunction&& function) : jsFunction_{std::move(function)} {}\n\n  JSFunction& getJSFunction() {\n    return jsFunction_;\n  }\n\nprivate:\n  JSFunction jsFunction_;\n};\n\nJSValueRef functionCaller(\n    JSContextRef ctx,\n    JSObjectRef function,\n    JSObjectRef thisObject,\n    size_t argumentCount,\n    const JSValueRef arguments[],\n    JSValueRef* exception) {\n  const bool isCustomJSC = isCustomJSCPtr(ctx);\n  auto* privateData = PrivateDataBase::cast<JSFunctionPrivateData>(\n    JSC_JSObjectGetPrivate(isCustomJSC, function));\n  return (privateData->getJSFunction())(ctx, thisObject, argumentCount, arguments);\n}\n\nJSClassRef createFuncClass(JSContextRef ctx) {\n  JSClassDefinition definition = kJSClassDefinitionEmpty;\n  definition.attributes |= kJSClassAttributeNoAutomaticPrototype;\n\n  // Need to duplicate the two different finalizer blocks, since there's no way\n  // for it to capture this static information.\n  const bool isCustomJSC = isCustomJSCPtr(ctx);\n  if (isCustomJSC) {\n    definition.finalize = [](JSObjectRef object) {\n      auto* privateData = PrivateDataBase::cast<JSFunctionPrivateData>(\n        JSC_JSObjectGetPrivate(true, object));\n      delete privateData;\n    };\n  } else {\n    definition.finalize = [](JSObjectRef object) {\n      auto* privateData = PrivateDataBase::cast<JSFunctionPrivateData>(\n        JSC_JSObjectGetPrivate(false, object));\n      delete privateData;\n    };\n  }\n  definition.callAsFunction = exceptionWrapMethod<&functionCaller>();\n\n  return JSC_JSClassCreate(isCustomJSC, &definition);\n}\n\nJSObjectRef makeFunction(\n    JSContextRef ctx,\n    JSStringRef name,\n    JSFunction function) {\n  static JSClassRef kClassDef = NULL, kCustomJSCClassDef = NULL;\n  JSClassRef *classRef = isCustomJSCPtr(ctx) ? &kCustomJSCClassDef : &kClassDef;\n  if (!*classRef) {\n    *classRef = createFuncClass(ctx);\n  }\n\n  // dealloc in kClassDef.finalize\n  JSFunctionPrivateData *functionDataPtr = new JSFunctionPrivateData(std::move(function));\n  auto functionObject = Object(ctx, JSC_JSObjectMake(ctx, *classRef, functionDataPtr));\n  functionObject.setProperty(\"name\", Value(ctx, name));\n  return functionObject;\n}\n\n}\n\nvoid JSException::buildMessage(JSContextRef ctx, JSValueRef exn, JSStringRef sourceURL, const char* errorMsg) {\n  std::ostringstream msgBuilder;\n  if (errorMsg && strlen(errorMsg) > 0) {\n    msgBuilder << errorMsg << \": \";\n  }\n\n  Object exnObject = Value(ctx, exn).asObject();\n  Value exnMessage = exnObject.getProperty(\"message\");\n  msgBuilder << (exnMessage.isString() ? exnMessage : (Value)exnObject).toString().str();\n\n  // The null/empty-ness of source tells us if the JS came from a\n  // file/resource, or was a constructed statement.  The location\n  // info will include that source, if any.\n  std::string locationInfo = sourceURL != nullptr ? String::ref(ctx, sourceURL).str() : \"\";\n  auto line = exnObject.getProperty(\"line\");\n  if (line != nullptr && line.isNumber()) {\n    if (locationInfo.empty() && line.asInteger() != 1) {\n      // If there is a non-trivial line number, but there was no\n      // location info, we include a placeholder, and the line\n      // number.\n      locationInfo = folly::to<std::string>(\"<unknown file>:\", line.asInteger());\n    } else if (!locationInfo.empty()) {\n      // If there is location info, we always include the line\n      // number, regardless of its value.\n      locationInfo += folly::to<std::string>(\":\", line.asInteger());\n    }\n  }\n\n  if (!locationInfo.empty()) {\n    msgBuilder << \" (\" << locationInfo << \")\";\n  }\n\n  auto exceptionText = msgBuilder.str();\n  LOG(ERROR) << \"Got JS Exception: \" << exceptionText;\n  msg_ = std::move(exceptionText);\n\n  Value jsStack = exnObject.getProperty(\"stack\");\n  if (jsStack.isString()) {\n    auto stackText = jsStack.toString().str();\n    LOG(ERROR) << \"Got JS Stack: \" << stackText;\n    stack_ = std::move(stackText);\n  }\n}\n\nnamespace ExceptionHandling {\n\nPlatformErrorExtractor platformErrorExtractor;\n\n}\n\nJSObjectRef makeFunction(\n    JSContextRef ctx,\n    const char* name,\n    JSFunction function) {\n  return makeFunction(ctx, String(ctx, name), std::move(function));\n}\n\nvoid installGlobalFunction(\n    JSGlobalContextRef ctx,\n    const char* name,\n    JSFunction function) {\n  auto jsName = String(ctx, name);\n  auto functionObj = makeFunction(ctx, jsName, std::move(function));\n  Object::getGlobalObject(ctx).setProperty(jsName, Value(ctx, functionObj));\n}\n\nJSObjectRef makeFunction(\n    JSGlobalContextRef ctx,\n    const char* name,\n    JSObjectCallAsFunctionCallback callback) {\n  auto jsName = String(ctx, name);\n  return JSC_JSObjectMakeFunctionWithCallback(ctx, jsName, callback);\n}\n\nvoid installGlobalFunction(\n    JSGlobalContextRef ctx,\n    const char* name,\n    JSObjectCallAsFunctionCallback callback) {\n  String jsName(ctx, name);\n  JSObjectRef functionObj = JSC_JSObjectMakeFunctionWithCallback(\n    ctx, jsName, callback);\n  Object::getGlobalObject(ctx).setProperty(jsName, Value(ctx, functionObj));\n}\n\nvoid installGlobalProxy(\n    JSGlobalContextRef ctx,\n    const char* name,\n    JSObjectGetPropertyCallback callback) {\n  JSClassDefinition proxyClassDefintion = kJSClassDefinitionEmpty;\n  proxyClassDefintion.attributes |= kJSClassAttributeNoAutomaticPrototype;\n  proxyClassDefintion.getProperty = callback;\n\n  const bool isCustomJSC = isCustomJSCPtr(ctx);\n  JSClassRef proxyClass = JSC_JSClassCreate(isCustomJSC, &proxyClassDefintion);\n  JSObjectRef proxyObj = JSC_JSObjectMake(ctx, proxyClass, nullptr);\n  JSC_JSClassRelease(isCustomJSC, proxyClass);\n\n  Object::getGlobalObject(ctx).setProperty(name, Value(ctx, proxyObj));\n}\n\nvoid removeGlobal(JSGlobalContextRef ctx, const char* name) {\n  Object::getGlobalObject(ctx).setProperty(name, Value::makeUndefined(ctx));\n}\n\nJSValueRef evaluateScript(JSContextRef context, JSStringRef script, JSStringRef sourceURL) {\n  JSValueRef exn, result;\n  result = JSC_JSEvaluateScript(context, script, NULL, sourceURL, 0, &exn);\n  if (result == nullptr) {\n    throw JSException(context, exn, sourceURL);\n  }\n  return result;\n}\n\n#if WITH_FBJSCEXTENSIONS\nJSValueRef evaluateSourceCode(JSContextRef context, JSSourceCodeRef source, JSStringRef sourceURL) {\n  JSValueRef exn, result;\n  result = JSEvaluateSourceCode(context, source, NULL, &exn);\n  if (result == nullptr) {\n    throw JSException(context, exn, sourceURL);\n  }\n  return result;\n}\n#endif\n\nJSContextLock::JSContextLock(JSGlobalContextRef ctx) noexcept\n#if WITH_FBJSCEXTENSIONS\n  : ctx_(ctx),\n   globalLock_(PTHREAD_MUTEX_INITIALIZER)\n   {\n  WTFThreadData& threadData = wtfThreadData();\n\n  // Code below is responsible for acquiring locks. It should execute\n  // atomically, thus none of the functions invoked from now on are allowed to\n  // throw an exception\n  try {\n    if (!threadData.isDebuggerThread()) {\n      CHECK(0 == pthread_mutex_lock(&globalLock_));\n    }\n    JSLock(ctx_);\n  } catch (...) {\n    abort();\n  }\n}\n#else\n{}\n#endif\n\n\nJSContextLock::~JSContextLock() noexcept {\n  #if WITH_FBJSCEXTENSIONS\n  WTFThreadData& threadData = wtfThreadData();\n\n  JSUnlock(ctx_);\n  if (!threadData.isDebuggerThread()) {\n    CHECK(0 == pthread_mutex_unlock(&globalLock_));\n  }\n  #endif\n}\n\n\nJSValueRef translatePendingCppExceptionToJSError(JSContextRef ctx, const char *exceptionLocation) {\n  try {\n    throw;\n  } catch (const std::bad_alloc& ex) {\n    throw; // We probably shouldn't try to handle this in JS\n  } catch (const std::exception& ex) {\n    if (ExceptionHandling::platformErrorExtractor) {\n      auto extractedEror = ExceptionHandling::platformErrorExtractor(ex, exceptionLocation);\n      if (extractedEror.message.length() > 0) {\n        return Value::makeError(ctx, extractedEror.message.c_str(), extractedEror.stack.c_str());\n      }\n    }\n    auto msg = folly::to<std::string>(\"C++ exception in '\", exceptionLocation, \"'\\n\\n\", ex.what());\n    return Value::makeError(ctx, msg.c_str());\n  } catch (const char* ex) {\n    auto msg = folly::to<std::string>(\"C++ exception (thrown as a char*) in '\", exceptionLocation, \"'\\n\\n\", ex);\n    return Value::makeError(ctx, msg.c_str());\n  } catch (...) {\n    auto msg = folly::to<std::string>(\"Unknown C++ exception in '\", exceptionLocation, \"'\");\n    return Value::makeError(ctx, msg.c_str());\n  }\n}\n\nJSValueRef translatePendingCppExceptionToJSError(JSContextRef ctx, JSObjectRef jsFunctionCause) {\n  try {\n    auto functionName = Object(ctx, jsFunctionCause).getProperty(\"name\").toString().str();\n    return translatePendingCppExceptionToJSError(ctx, functionName.c_str());\n  } catch (...) {\n    return Value::makeError(ctx, \"Failed to translate native exception\");\n  }\n}\n\n} }\n"
  },
  {
    "path": "ReactCommon/jschelpers/JSCHelpers.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <algorithm>\n#include <functional>\n#include <stdexcept>\n\n#include <jschelpers/JavaScriptCore.h>\n#include <jschelpers/Value.h>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\nclass RN_EXPORT JSException : public std::exception {\npublic:\n  explicit JSException(const char* msg)\n    : msg_(msg) {}\n\n  explicit JSException(JSContextRef ctx, JSValueRef exn, const char* msg) {\n    buildMessage(ctx, exn, nullptr, msg);\n  }\n\n  explicit JSException(JSContextRef ctx, JSValueRef exn, JSStringRef sourceURL) {\n    buildMessage(ctx, exn, sourceURL, nullptr);\n  }\n\n  const std::string& getStack() const {\n    return stack_;\n  }\n\n  virtual const char* what() const noexcept override {\n    return msg_.c_str();\n  }\n\nprivate:\n  std::string msg_;\n  std::string stack_;\n\n  void buildMessage(JSContextRef ctx, JSValueRef exn, JSStringRef sourceURL, const char* errorMsg);\n};\n\nnamespace ExceptionHandling {\n  struct ExtractedEror {\n    std::string message;\n    // Stacktrace formatted like JS stack\n    // method@filename[:line[:column]]\n    std::string stack;\n  };\n  typedef ExtractedEror(*PlatformErrorExtractor)(const std::exception &ex, const char *context);\n  extern PlatformErrorExtractor platformErrorExtractor;\n}\n\nusing JSFunction = std::function<JSValueRef(JSContextRef, JSObjectRef, size_t, const JSValueRef[])>;\n\nJSObjectRef makeFunction(\n    JSContextRef ctx,\n    const char* name,\n    JSFunction function);\n\nRN_EXPORT void installGlobalFunction(\n    JSGlobalContextRef ctx,\n    const char* name,\n    JSFunction function);\n\nJSObjectRef makeFunction(\n    JSGlobalContextRef ctx,\n    const char* name,\n    JSObjectCallAsFunctionCallback callback);\n\nRN_EXPORT void installGlobalFunction(\n    JSGlobalContextRef ctx,\n    const char* name,\n    JSObjectCallAsFunctionCallback callback);\n\nvoid installGlobalProxy(\n    JSGlobalContextRef ctx,\n    const char* name,\n    JSObjectGetPropertyCallback callback);\n\nvoid removeGlobal(JSGlobalContextRef ctx, const char* name);\n\nJSValueRef evaluateScript(\n    JSContextRef ctx,\n    JSStringRef script,\n    JSStringRef sourceURL);\n\n#if WITH_FBJSCEXTENSIONS\nJSValueRef evaluateSourceCode(\n    JSContextRef ctx,\n    JSSourceCodeRef source,\n    JSStringRef sourceURL);\n#endif\n\n/**\n * A lock for protecting accesses to the JSGlobalContext\n * This will be a no-op for most compilations, where #if WITH_FBJSCEXTENSIONS is false,\n * but avoids deadlocks in execution environments with advanced locking requirements,\n * particularly with uses of the pthread mutex lock\n**/\nclass JSContextLock {\npublic:\n  JSContextLock(JSGlobalContextRef ctx) noexcept;\n  ~JSContextLock() noexcept;\nprivate:\n#if WITH_FBJSCEXTENSIONS\n  JSGlobalContextRef ctx_;\n  pthread_mutex_t globalLock_;\n#endif\n};\n\nJSValueRef translatePendingCppExceptionToJSError(JSContextRef ctx, const char *exceptionLocation);\nJSValueRef translatePendingCppExceptionToJSError(JSContextRef ctx, JSObjectRef jsFunctionCause);\n\ntemplate<JSValueRef (method)(JSContextRef ctx,\n        JSObjectRef function,\n        JSObjectRef thisObject,\n        size_t argumentCount,\n        const JSValueRef arguments[],\n        JSValueRef *exception)>\ninline JSObjectCallAsFunctionCallback exceptionWrapMethod() {\n  struct funcWrapper {\n    static JSValueRef call(\n        JSContextRef ctx,\n        JSObjectRef function,\n        JSObjectRef thisObject,\n        size_t argumentCount,\n        const JSValueRef arguments[],\n        JSValueRef *exception) {\n      try {\n        return (*method)(ctx, function, thisObject, argumentCount, arguments, exception);\n      } catch (...) {\n        *exception = translatePendingCppExceptionToJSError(ctx, function);\n        return JSC_JSValueMakeUndefined(ctx);\n      }\n    }\n  };\n\n  return &funcWrapper::call;\n}\n\n} }\n"
  },
  {
    "path": "ReactCommon/jschelpers/JSCWrapper.cpp",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"JSCWrapper.h\"\n\n#if defined(__APPLE__)\n\n// TODO: use glog in OSS too\n#if __has_include(<glog/logging.h>)\n#define USE_GLOG 1\n#include <glog/logging.h>\n#else\n#define USE_GLOG 0\n#endif\n\nnamespace facebook {\nnamespace react {\n\nstatic const JSCWrapper* s_customWrapper = nullptr;\n\nbool isCustomJSCWrapperSet() {\n  return s_customWrapper != nullptr;\n}\n\nconst JSCWrapper* customJSCWrapper() {\n  #if USE_GLOG\n  CHECK(s_customWrapper != nullptr) << \"Accessing custom JSC wrapper before it's set\";\n  #endif\n  return s_customWrapper;\n}\n\nvoid setCustomJSCWrapper(const JSCWrapper* wrapper) {\n  #if USE_GLOG\n  CHECK(s_customWrapper == nullptr) << \"Can't set custom JSC wrapper multiple times\";\n  #endif\n  s_customWrapper = wrapper;\n}\n\n} }\n\n#endif\n"
  },
  {
    "path": "ReactCommon/jschelpers/JSCWrapper.h",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <functional>\n#include <string>\n#include <JavaScriptCore/JavaScript.h>\n\n#if WITH_FBJSCEXTENSIONS\n#include <jsc_stringref.h>\n#endif\n\n#if defined(JSCINTERNAL) || (!defined(__APPLE__))\n#define JSC_IMPORT extern \"C\"\n#else\n#define JSC_IMPORT extern\n#endif\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n  class IInspector;\n}\n}\n\nJSC_IMPORT void JSGlobalContextEnableDebugger(\n    JSGlobalContextRef ctx,\n    facebook::react::IInspector &globalInspector,\n    const char *title,\n    const std::function<bool()> &checkIsInspectedRemote);\nJSC_IMPORT void JSGlobalContextDisableDebugger(\n    JSGlobalContextRef ctx,\n    facebook::react::IInspector &globalInspector);\n\n// This is used to substitute an alternate JSC implementation for\n// testing. These calls must all be ABI compatible with the standard JSC.\nJSC_IMPORT JSValueRef JSEvaluateBytecodeBundle(JSContextRef, JSObjectRef, int, JSStringRef, JSValueRef*);\nJSC_IMPORT bool JSSamplingProfilerEnabled();\nJSC_IMPORT void JSStartSamplingProfilingOnMainJSCThread(JSGlobalContextRef);\nJSC_IMPORT JSValueRef JSPokeSamplingProfiler(JSContextRef);\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nJSC_IMPORT void configureJSCForIOS(std::string); // TODO: replace with folly::dynamic once supported\nJSC_IMPORT void FBJSContextStartGCTimers(JSContextRef);\n#ifdef __cplusplus\n}\n#endif\n\n#if defined(__APPLE__)\n#import <objc/objc.h>\n#import <JavaScriptCore/JSStringRefCF.h>\n#import <string>\n\n/**\n * JSNoBytecodeFileFormatVersion\n *\n * Version number indicating that bytecode is not supported by this runtime.\n */\nRN_EXPORT extern const int32_t JSNoBytecodeFileFormatVersion;\n\nnamespace facebook {\nnamespace react {\n\n#define JSC_WRAPPER_METHOD(m) decltype(&m) m\n\nstruct JSCWrapper {\n  // JSGlobalContext\n  JSC_WRAPPER_METHOD(JSGlobalContextCreateInGroup);\n  JSC_WRAPPER_METHOD(JSGlobalContextRelease);\n  JSC_WRAPPER_METHOD(JSGlobalContextSetName);\n\n  // JSContext\n  JSC_WRAPPER_METHOD(JSContextGetGlobalContext);\n  JSC_WRAPPER_METHOD(JSContextGetGlobalObject);\n  JSC_WRAPPER_METHOD(FBJSContextStartGCTimers);\n\n  // JSEvaluate\n  JSC_WRAPPER_METHOD(JSEvaluateScript);\n  JSC_WRAPPER_METHOD(JSEvaluateBytecodeBundle);\n\n  // JSString\n  JSC_WRAPPER_METHOD(JSStringCreateWithUTF8CString);\n  JSC_WRAPPER_METHOD(JSStringCreateWithCFString);\n  #if WITH_FBJSCEXTENSIONS\n  JSC_WRAPPER_METHOD(JSStringCreateWithUTF8CStringExpectAscii);\n  #endif\n  JSC_WRAPPER_METHOD(JSStringCopyCFString);\n  JSC_WRAPPER_METHOD(JSStringGetCharactersPtr);\n  JSC_WRAPPER_METHOD(JSStringGetLength);\n  JSC_WRAPPER_METHOD(JSStringGetMaximumUTF8CStringSize);\n  JSC_WRAPPER_METHOD(JSStringIsEqualToUTF8CString);\n  JSC_WRAPPER_METHOD(JSStringRelease);\n  JSC_WRAPPER_METHOD(JSStringRetain);\n\n  // JSClass\n  JSC_WRAPPER_METHOD(JSClassCreate);\n  JSC_WRAPPER_METHOD(JSClassRelease);\n\n  // JSObject\n  JSC_WRAPPER_METHOD(JSObjectCallAsConstructor);\n  JSC_WRAPPER_METHOD(JSObjectCallAsFunction);\n  JSC_WRAPPER_METHOD(JSObjectGetPrivate);\n  JSC_WRAPPER_METHOD(JSObjectGetProperty);\n  JSC_WRAPPER_METHOD(JSObjectGetPropertyAtIndex);\n  JSC_WRAPPER_METHOD(JSObjectIsConstructor);\n  JSC_WRAPPER_METHOD(JSObjectIsFunction);\n  JSC_WRAPPER_METHOD(JSObjectMake);\n  JSC_WRAPPER_METHOD(JSObjectMakeArray);\n  JSC_WRAPPER_METHOD(JSObjectMakeDate);\n  JSC_WRAPPER_METHOD(JSObjectMakeError);\n  JSC_WRAPPER_METHOD(JSObjectMakeFunctionWithCallback);\n  JSC_WRAPPER_METHOD(JSObjectSetPrivate);\n  JSC_WRAPPER_METHOD(JSObjectSetProperty);\n  JSC_WRAPPER_METHOD(JSObjectSetPropertyAtIndex);\n\n  // JSPropertyNameArray\n  JSC_WRAPPER_METHOD(JSObjectCopyPropertyNames);\n  JSC_WRAPPER_METHOD(JSPropertyNameArrayGetCount);\n  JSC_WRAPPER_METHOD(JSPropertyNameArrayGetNameAtIndex);\n  JSC_WRAPPER_METHOD(JSPropertyNameArrayRelease);\n\n  // JSValue\n  JSC_WRAPPER_METHOD(JSValueCreateJSONString);\n  JSC_WRAPPER_METHOD(JSValueGetType);\n  JSC_WRAPPER_METHOD(JSValueMakeFromJSONString);\n  JSC_WRAPPER_METHOD(JSValueMakeBoolean);\n  JSC_WRAPPER_METHOD(JSValueMakeNull);\n  JSC_WRAPPER_METHOD(JSValueMakeNumber);\n  JSC_WRAPPER_METHOD(JSValueMakeString);\n  JSC_WRAPPER_METHOD(JSValueMakeUndefined);\n  JSC_WRAPPER_METHOD(JSValueProtect);\n  JSC_WRAPPER_METHOD(JSValueToBoolean);\n  JSC_WRAPPER_METHOD(JSValueToNumber);\n  JSC_WRAPPER_METHOD(JSValueToObject);\n  JSC_WRAPPER_METHOD(JSValueToStringCopy);\n  JSC_WRAPPER_METHOD(JSValueUnprotect);\n\n  // Sampling profiler\n  JSC_WRAPPER_METHOD(JSSamplingProfilerEnabled);\n  JSC_WRAPPER_METHOD(JSPokeSamplingProfiler);\n  JSC_WRAPPER_METHOD(JSStartSamplingProfilingOnMainJSCThread);\n\n  JSC_WRAPPER_METHOD(JSGlobalContextEnableDebugger);\n  JSC_WRAPPER_METHOD(JSGlobalContextDisableDebugger);\n\n  JSC_WRAPPER_METHOD(configureJSCForIOS);\n\n  // Objective-C API\n  Class JSContext;\n  Class JSValue;\n\n  int32_t JSBytecodeFileFormatVersion;\n};\n\ntemplate <typename T>\nbool isCustomJSCPtr(T *x) {\n  return (uintptr_t)x & 0x1;\n}\n\nRN_EXPORT bool isCustomJSCWrapperSet();\nRN_EXPORT void setCustomJSCWrapper(const JSCWrapper* wrapper);\n\n// This will return a single value for the whole life of the process.\nRN_EXPORT const JSCWrapper *systemJSCWrapper();\nRN_EXPORT const JSCWrapper *customJSCWrapper();\n\n} }\n\n#else\n\nnamespace facebook {\nnamespace react {\n\ntemplate <typename T>\nbool isCustomJSCPtr(T *x) {\n  // Always use system JSC pointers\n  return false;\n}\n\n} }\n\n#endif\n"
  },
  {
    "path": "ReactCommon/jschelpers/JavaScriptCore.h",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <jschelpers/JSCWrapper.h>\n\n#if defined(__APPLE__)\n\n// Use for methods that are taking JSContextRef as a first param\n#define __jsc_wrapper(method, ctx, ...)   \\\n  (facebook::react::isCustomJSCPtr(ctx) ? \\\n    facebook::react::customJSCWrapper() : \\\n    facebook::react::systemJSCWrapper()   \\\n  )->method(ctx, ## __VA_ARGS__)\n\n// Use for methods that don't take a JSContextRef as a first param. The wrapped version\n// of this method will require context as an additional param, but it will be dropped\n// before calling into the JSC method.\n#define __jsc_drop_ctx_wrapper(method, ctx, ...) \\\n  (facebook::react::isCustomJSCPtr(ctx) ?        \\\n    facebook::react::customJSCWrapper() :        \\\n    facebook::react::systemJSCWrapper()          \\\n  )->method(__VA_ARGS__)\n\n// Use for methods were access to a JSContextRef is impractical. The first bool param\n// will be dropped before the JSC method is invoked.\n#define __jsc_ensure_bool(field) \\\n  static_assert(std::is_same<typename std::decay<decltype(field)>::type, bool>::value, \"useCustomJSC must be bool\");\n#define __jsc_bool_wrapper(method, useCustomJSC, ...)    \\\n  ([]{ __jsc_ensure_bool(useCustomJSC) }, useCustomJSC ? \\\n    facebook::react::customJSCWrapper() :                \\\n    facebook::react::systemJSCWrapper()                  \\\n  )->method(__VA_ARGS__)\n\n// Used for wrapping properties\n#define __jsc_prop_wrapper(prop, ctx)     \\\n  (facebook::react::isCustomJSCPtr(ctx) ? \\\n    facebook::react::customJSCWrapper() : \\\n    facebook::react::systemJSCWrapper()   \\\n  )->prop\n\n// Poison all regular versions of the JSC API in shared code. This prevents accidental\n// mixed usage of regular and custom JSC methods.\n// See https://gcc.gnu.org/onlinedocs/gcc-3.3/cpp/Pragmas.html for details\n#define jsc_pragma(x) _Pragma(#x)\n#ifndef NO_JSC_POISON\n#define jsc_poison(methods) jsc_pragma(GCC poison methods)\n#else\n#define jsc_poison(methods)\n#endif\n\n#else\n\n#define __jsc_wrapper(method, ctx, ...) method(ctx, ## __VA_ARGS__)\n#define __jsc_drop_ctx_wrapper(method, ctx, ...) ((void)ctx, method(__VA_ARGS__))\n#define __jsc_bool_wrapper(method, useCustomJSC, ...) \\\n  ((void)useCustomJSC, method(__VA_ARGS__))\n#define __jsc_prop_wrapper(prop, ctx) prop\n\n#define jsc_pragma(x)\n#define jsc_poison(methods)\n\n#endif\n\n// JSGlobalContext\n#define JSC_JSGlobalContextCreateInGroup(...) __jsc_bool_wrapper(JSGlobalContextCreateInGroup, __VA_ARGS__)\n#define JSC_JSGlobalContextRelease(...) __jsc_wrapper(JSGlobalContextRelease, __VA_ARGS__)\n#define JSC_JSGlobalContextSetName(...) __jsc_wrapper(JSGlobalContextSetName, __VA_ARGS__)\n\njsc_poison(JSContextGroupCreate JSContextGroupRelease JSContextGroupRetain\n           JSGlobalContextCreate JSGlobalContextCreateInGroup JSGlobalContextCopyName\n           JSGlobalContextRelease JSGlobalContextRetain JSGlobalContextSetName)\n\n// JSContext\n#define JSC_JSContextGetGlobalContext(...) __jsc_wrapper(JSContextGetGlobalContext, __VA_ARGS__)\n#define JSC_JSContextGetGlobalObject(...) __jsc_wrapper(JSContextGetGlobalObject, __VA_ARGS__)\n#define JSC_FBJSContextStartGCTimers(...) __jsc_wrapper(FBJSContextStartGCTimers, __VA_ARGS__)\n\njsc_poison(JSContextGetGlobalContext JSContextGetGlobalObject JSContextGetGroup FBJSContextStartGCTimers)\n\n// JSEvaluate\n#define JSC_JSEvaluateScript(...) __jsc_wrapper(JSEvaluateScript, __VA_ARGS__)\n#define JSC_JSEvaluateBytecodeBundle(...) __jsc_wrapper(JSEvaluateBytecodeBundle, __VA_ARGS__)\n\njsc_poison(JSCheckScriptSyntax JSEvaluateScript JSEvaluateBytecodeBundle JSGarbageCollect)\n\n// JSString\n#define JSC_JSStringCreateWithCFString(...) __jsc_drop_ctx_wrapper(JSStringCreateWithCFString, __VA_ARGS__)\n#define JSC_JSStringCreateWithUTF8CString(...) __jsc_drop_ctx_wrapper(JSStringCreateWithUTF8CString, __VA_ARGS__)\n#define JSC_JSStringCreateWithUTF8CStringExpectAscii(...) __jsc_drop_ctx_wrapper(JSStringCreateWithUTF8CStringExpectAscii, __VA_ARGS__)\n#define JSC_JSStringCopyCFString(...) __jsc_drop_ctx_wrapper(JSStringCopyCFString, __VA_ARGS__)\n#define JSC_JSStringGetCharactersPtr(...) __jsc_drop_ctx_wrapper(JSStringGetCharactersPtr, __VA_ARGS__)\n#define JSC_JSStringGetLength(...) __jsc_drop_ctx_wrapper(JSStringGetLength, __VA_ARGS__)\n#define JSC_JSStringGetMaximumUTF8CStringSize(...) __jsc_drop_ctx_wrapper(JSStringGetMaximumUTF8CStringSize, __VA_ARGS__)\n#define JSC_JSStringIsEqualToUTF8CString(...) __jsc_drop_ctx_wrapper(JSStringIsEqualToUTF8CString, __VA_ARGS__)\n#define JSC_JSStringRelease(...) __jsc_drop_ctx_wrapper(JSStringRelease, __VA_ARGS__)\n#define JSC_JSStringRetain(...) __jsc_drop_ctx_wrapper(JSStringRetain, __VA_ARGS__)\n\njsc_poison(JSStringCopyCFString JSStringCreateWithCharacters JSStringCreateWithCFString\n           JSStringCreateWithUTF8CString JSStringCreateWithUTF8CStringExpectAscii\n           JSStringGetCharactersPtr JSStringGetLength JSStringGetMaximumUTF8CStringSize\n           JSStringGetUTF8CString JSStringIsEqual JSStringIsEqualToUTF8CString\n           JSStringRelease JSStringRetain)\n\n// JSValueRef\n#define JSC_JSValueCreateJSONString(...) __jsc_wrapper(JSValueCreateJSONString, __VA_ARGS__)\n#define JSC_JSValueGetType(...) __jsc_wrapper(JSValueGetType, __VA_ARGS__)\n#define JSC_JSValueMakeFromJSONString(...) __jsc_wrapper(JSValueMakeFromJSONString, __VA_ARGS__)\n#define JSC_JSValueMakeBoolean(...) __jsc_wrapper(JSValueMakeBoolean, __VA_ARGS__)\n#define JSC_JSValueMakeNull(...) __jsc_wrapper(JSValueMakeNull, __VA_ARGS__)\n#define JSC_JSValueMakeNumber(...) __jsc_wrapper(JSValueMakeNumber, __VA_ARGS__)\n#define JSC_JSValueMakeString(...) __jsc_wrapper(JSValueMakeString, __VA_ARGS__)\n#define JSC_JSValueMakeUndefined(...) __jsc_wrapper(JSValueMakeUndefined, __VA_ARGS__)\n#define JSC_JSValueProtect(...) __jsc_wrapper(JSValueProtect, __VA_ARGS__)\n#define JSC_JSValueToBoolean(...) __jsc_wrapper(JSValueToBoolean, __VA_ARGS__)\n#define JSC_JSValueToNumber(...) __jsc_wrapper(JSValueToNumber, __VA_ARGS__)\n#define JSC_JSValueToObject(...) __jsc_wrapper(JSValueToObject, __VA_ARGS__)\n#define JSC_JSValueToStringCopy(...) __jsc_wrapper(JSValueToStringCopy, __VA_ARGS__)\n#define JSC_JSValueUnprotect(...) __jsc_wrapper(JSValueUnprotect, __VA_ARGS__)\n\njsc_poison(JSValueCreateJSONString JSValueGetType JSValueGetTypedArrayType JSValueIsArray\n           JSValueIsBoolean JSValueIsDate JSValueIsEqual JSValueIsInstanceOfConstructor\n           JSValueIsNull JSValueIsNumber JSValueIsObject JSValueIsObjectOfClass\n           JSValueIsStrictEqual JSValueIsString JSValueIsString JSValueIsUndefined\n           JSValueMakeBoolean JSValueMakeFromJSONString JSValueMakeNull JSValueMakeNumber\n           JSValueMakeString JSValueMakeUndefined JSValueProtect JSValueToBoolean\n           JSValueToNumber JSValueToObject JSValueToStringCopy JSValueUnprotect)\n\n// JSClass\n#define JSC_JSClassCreate(...) __jsc_bool_wrapper(JSClassCreate, __VA_ARGS__)\n#define JSC_JSClassRelease(...) __jsc_bool_wrapper(JSClassRelease, __VA_ARGS__)\n\njsc_poison(JSClassCreate JSClassRelease JSClassRetain)\n\n// JSObject\n#define JSC_JSObjectCallAsConstructor(...) __jsc_wrapper(JSObjectCallAsConstructor, __VA_ARGS__)\n#define JSC_JSObjectCallAsFunction(...) __jsc_wrapper(JSObjectCallAsFunction, __VA_ARGS__)\n#define JSC_JSObjectGetPrivate(...) __jsc_bool_wrapper(JSObjectGetPrivate, __VA_ARGS__)\n#define JSC_JSObjectGetProperty(...) __jsc_wrapper(JSObjectGetProperty, __VA_ARGS__)\n#define JSC_JSObjectGetPropertyAtIndex(...) __jsc_wrapper(JSObjectGetPropertyAtIndex, __VA_ARGS__)\n#define JSC_JSObjectIsConstructor(...) __jsc_wrapper(JSObjectIsConstructor, __VA_ARGS__)\n#define JSC_JSObjectIsFunction(...) __jsc_wrapper(JSObjectIsFunction, __VA_ARGS__)\n#define JSC_JSObjectMake(...) __jsc_wrapper(JSObjectMake, __VA_ARGS__)\n#define JSC_JSObjectMakeArray(...) __jsc_wrapper(JSObjectMakeArray, __VA_ARGS__)\n#define JSC_JSObjectMakeDate(...) __jsc_wrapper(JSObjectMakeDate, __VA_ARGS__)\n#define JSC_JSObjectMakeError(...) __jsc_wrapper(JSObjectMakeError, __VA_ARGS__)\n#define JSC_JSObjectMakeFunctionWithCallback(...) __jsc_wrapper(JSObjectMakeFunctionWithCallback, __VA_ARGS__)\n#define JSC_JSObjectSetPrivate(...) __jsc_bool_wrapper(JSObjectSetPrivate, __VA_ARGS__)\n#define JSC_JSObjectSetProperty(...) __jsc_wrapper(JSObjectSetProperty, __VA_ARGS__)\n#define JSC_JSObjectSetPropertyAtIndex(...) __jsc_wrapper(JSObjectSetPropertyAtIndex, __VA_ARGS__)\n\njsc_poison(JSObjectCallAsConstructor JSObjectCallAsFunction JSObjectDeleteProperty\n           JSObjectGetPrivate JSObjectGetProperty JSObjectGetPropertyAtIndex\n           JSObjectGetPrototype JSObjectHasProperty JSObjectIsConstructor\n           JSObjectIsFunction JSObjectMake JSObjectMakeArray JSObjectMakeConstructor\n           JSObjectMakeDate JSObjectMakeError JSObjectMakeFunction\n           JSObjectMakeFunctionWithCallback JSObjectMakeRegExp JSObjectSetPrivate\n           JSObjectSetPrototype JSObjectSetProperty JSObjectSetPropertyAtIndex)\n\n// JSPropertyNameArray\n#define JSC_JSObjectCopyPropertyNames(...) __jsc_wrapper(JSObjectCopyPropertyNames, __VA_ARGS__)\n#define JSC_JSPropertyNameArrayGetCount(...) __jsc_drop_ctx_wrapper(JSPropertyNameArrayGetCount, __VA_ARGS__)\n#define JSC_JSPropertyNameArrayGetNameAtIndex(...) __jsc_drop_ctx_wrapper(JSPropertyNameArrayGetNameAtIndex, __VA_ARGS__)\n#define JSC_JSPropertyNameArrayRelease(...) __jsc_drop_ctx_wrapper(JSPropertyNameArrayRelease, __VA_ARGS__)\n\njsc_poison(JSObjectCopyPropertyNames JSPropertyNameAccumulatorAddName\n           JSPropertyNameArrayGetCount JSPropertyNameArrayGetNameAtIndex\n           JSPropertyNameArrayRelease JSPropertyNameArrayRetain)\n\n// JSTypedArray\njsc_poison(JSObjectMakeArrayBufferWithBytesNoCopy JSObjectMakeTypedArray\n           JSObjectMakeTypedArrayWithArrayBuffer\n           JSObjectMakeTypedArrayWithArrayBufferAndOffset\n           JSObjectMakeTypedArrayWithBytesNoCopy JSObjectGetTypedArrayByteLength\n           JSObjectGetTypedArrayByteOffset JSObjectGetTypedArrayBytesPtr\n           JSObjectGetTypedArrayBuffer JSObjectGetTypedArrayLength\n           JSObjectGetArrayBufferBytesPtr JSObjectGetArrayBufferByteLength)\n\n// Sampling profiler\n#define JSC_JSSamplingProfilerEnabled(...) __jsc_drop_ctx_wrapper(JSSamplingProfilerEnabled, __VA_ARGS__)\n#define JSC_JSPokeSamplingProfiler(...) __jsc_wrapper(JSPokeSamplingProfiler, __VA_ARGS__)\n#define JSC_JSStartSamplingProfilingOnMainJSCThread(...) __jsc_wrapper(JSStartSamplingProfilingOnMainJSCThread, __VA_ARGS__)\n\njsc_poison(JSSamplingProfilerEnabled JSPokeSamplingProfiler\n           JSStartSamplingProfilingOnMainJSCThread)\n\n#define JSC_JSGlobalContextEnableDebugger(...) __jsc_wrapper(JSGlobalContextEnableDebugger, __VA_ARGS__)\n// no need to poison JSGlobalContextEnableDebugger because it's not defined for System JSC / standard SDK header\n// jsc_poison(JSGlobalContextEnableDebugger)\n\n#define JSC_JSGlobalContextDisableDebugger(...) __jsc_wrapper(JSGlobalContextDisableDebugger, __VA_ARGS__)\n// no need to poison JSGlobalContextDisableDebugger because it's not defined for System JSC / standard SDK header\n// jsc_poison(JSGlobalContextDisableDebugger)\n\n\n#define JSC_configureJSCForIOS(...) __jsc_bool_wrapper(configureJSCForIOS, __VA_ARGS__)\n\njsc_poison(configureJSCForIOS)\n\n// Objective-C API\n#define JSC_JSContext(ctx) __jsc_prop_wrapper(JSContext, ctx)\n#define JSC_JSValue(ctx) __jsc_prop_wrapper(JSValue, ctx)\n\n#undef jsc_poison\n#undef jsc_pragma\n"
  },
  {
    "path": "ReactCommon/jschelpers/Unicode.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"Unicode.h\"\n\nnamespace facebook {\nnamespace react {\nnamespace unicode {\nnamespace {\n\n// TODO(12827176): Don't duplicate this code here and fbjni.\n\nconst uint16_t kUtf8OneByteBoundary       = 0x80;\nconst uint16_t kUtf8TwoBytesBoundary      = 0x800;\nconst uint16_t kUtf16HighSubLowBoundary   = 0xD800;\nconst uint16_t kUtf16HighSubHighBoundary  = 0xDC00;\nconst uint16_t kUtf16LowSubHighBoundary   = 0xE000;\n\n// Calculate how many bytes are needed to convert an UTF16 string into UTF8\n// UTF16 string\nsize_t utf16toUTF8Length(const uint16_t* utf16String, size_t utf16StringLen) {\n  if (!utf16String || utf16StringLen == 0) {\n    return 0;\n  }\n\n  uint32_t utf8StringLen = 0;\n  auto utf16StringEnd = utf16String + utf16StringLen;\n  auto idx16 = utf16String;\n  while (idx16 < utf16StringEnd) {\n    auto ch = *idx16++;\n    if (ch < kUtf8OneByteBoundary) {\n      utf8StringLen++;\n    } else if (ch < kUtf8TwoBytesBoundary) {\n      utf8StringLen += 2;\n    } else if (\n        (ch >= kUtf16HighSubLowBoundary) && (ch < kUtf16HighSubHighBoundary) &&\n        (idx16 < utf16StringEnd) &&\n        (*idx16 >= kUtf16HighSubHighBoundary) && (*idx16 < kUtf16LowSubHighBoundary)) {\n      utf8StringLen += 4;\n      idx16++;\n    } else {\n      utf8StringLen += 3;\n    }\n  }\n\n  return utf8StringLen;\n}\n\n} // namespace\n\nstd::string utf16toUTF8(const uint16_t* utf16String, size_t utf16StringLen) noexcept {\n  if (!utf16String || utf16StringLen <= 0) {\n    return \"\";\n  }\n\n  std::string utf8String(utf16toUTF8Length(utf16String, utf16StringLen), '\\0');\n  auto idx8 = utf8String.begin();\n  auto idx16 = utf16String;\n  auto utf16StringEnd = utf16String + utf16StringLen;\n  while (idx16 < utf16StringEnd) {\n    auto ch = *idx16++;\n    if (ch < kUtf8OneByteBoundary) {\n      *idx8++ = (ch & 0x7F);\n    } else if (ch < kUtf8TwoBytesBoundary) {\n      *idx8++ = 0b11000000 | (ch >> 6);\n      *idx8++ = 0b10000000 | (ch & 0x3F);\n    } else if (\n        (ch >= kUtf16HighSubLowBoundary) && (ch < kUtf16HighSubHighBoundary) &&\n        (idx16 < utf16StringEnd) &&\n        (*idx16 >= kUtf16HighSubHighBoundary) && (*idx16 < kUtf16LowSubHighBoundary)) {\n      auto ch2 = *idx16++;\n      uint8_t trunc_byte = (((ch >> 6) & 0x0F) + 1);\n      *idx8++ = 0b11110000 | (trunc_byte >> 2);\n      *idx8++ = 0b10000000 | ((trunc_byte & 0x03) << 4) | ((ch >> 2) & 0x0F);\n      *idx8++ = 0b10000000 | ((ch & 0x03) << 4) | ((ch2 >> 6) & 0x0F);\n      *idx8++ = 0b10000000 | (ch2 & 0x3F);\n    } else {\n      *idx8++ = 0b11100000 | (ch >> 12);\n      *idx8++ = 0b10000000 | ((ch >> 6) & 0x3F);\n      *idx8++ = 0b10000000 | (ch & 0x3F);\n    }\n  }\n\n  return utf8String;\n}\n\n} // namespace unicode\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactCommon/jschelpers/Unicode.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <string>\n#include <cstdint>\n\nnamespace facebook {\nnamespace react {\nnamespace unicode {\n__attribute__((visibility(\"default\"))) std::string utf16toUTF8(const uint16_t* utf16, size_t length) noexcept;\n}\n}\n}\n"
  },
  {
    "path": "ReactCommon/jschelpers/Value.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"Value.h\"\n\n#include <folly/json.h>\n#include <folly/Conv.h>\n\n#include \"JSCHelpers.h\"\n#include \"JavaScriptCore.h\"\n\n// See the comment under Value::fromDynamic()\n#if !defined(__APPLE__) && defined(WITH_FB_JSC_TUNING)\n#define USE_FAST_FOLLY_DYNAMIC_CONVERSION 1\n#else\n#define USE_FAST_FOLLY_DYNAMIC_CONVERSION 0\n#endif\n\nnamespace facebook {\nnamespace react {\n\n/* static */\nObject Object::makeDate(JSContextRef ctx, Object::TimeType time) {\n  using std::chrono::duration_cast;\n  using std::chrono::milliseconds;\n\n  JSValueRef arguments[1];\n  arguments[0] = JSC_JSValueMakeNumber(\n    ctx,\n    duration_cast<milliseconds>(time.time_since_epoch()).count());\n\n  JSValueRef exn;\n  auto result = JSC_JSObjectMakeDate(ctx, 1, arguments, &exn);\n  if (!result) {\n    throw JSException(ctx, exn, \"Failed to create Date\");\n  }\n  return Object(ctx, result);\n}\n\nObject Object::makeArray(JSContextRef ctx, JSValueRef* elements, unsigned length) {\n  JSValueRef exn;\n  auto arr = JSC_JSObjectMakeArray(ctx, length, elements, &exn);\n  if (!arr) {\n    throw JSException(ctx, exn, \"Failed to create an Array\");\n  }\n  return Object(ctx, arr);\n}\n\nValue::Value(JSContextRef context, JSValueRef value)\n  : m_context(context), m_value(value) {}\n\nValue::Value(JSContextRef context, JSStringRef str)\n  : m_context(context), m_value(JSC_JSValueMakeString(context, str)) {}\n\nJSContextRef Value::context() const {\n  return m_context;\n}\n\n/* static */\nstd::string Value::toJSONString(unsigned indent) const {\n  JSValueRef exn;\n  auto stringToAdopt = JSC_JSValueCreateJSONString(m_context, m_value, indent, &exn);\n  if (!stringToAdopt) {\n    throw JSException(m_context, exn, \"Exception creating JSON string\");\n  }\n  return String::adopt(m_context, stringToAdopt).str();\n}\n\n/* static */\nValue Value::fromJSON(const String& json) {\n  JSContextRef ctx = json.context();\n  auto result = JSC_JSValueMakeFromJSONString(ctx, json);\n  if (!result) {\n    throw JSException(folly::to<std::string>(\n      \"Failed to create Value from JSON: \", json.str()).c_str());\n  }\n  return Value(ctx, result);\n}\n\nValue Value::fromDynamic(JSContextRef ctx, const folly::dynamic& value) {\n// JavaScriptCore's iOS APIs have their own version of this direct conversion.\n// In addition, using this requires exposing some of JSC's private APIs,\n//  so it's limited to non-apple platforms and to builds that use the custom JSC.\n// Otherwise, we use the old way of converting through JSON.\n#if USE_FAST_FOLLY_DYNAMIC_CONVERSION\n  // Defer GC during the creation of the JSValue, as we don't want\n  //  intermediate objects to be collected.\n  // We could use JSValueProtect(), but it will make the process much slower.\n  JSDeferredGCRef deferGC = JSDeferGarbageCollection(ctx);\n  // Set a global lock for the whole process,\n  //  instead of re-acquiring the lock for each operation.\n  JSLock(ctx);\n  JSValueRef jsVal = Value::fromDynamicInner(ctx, value);\n  JSUnlock(ctx);\n  JSResumeGarbageCollection(ctx, deferGC);\n  return Value(ctx, jsVal);\n#else\n  auto json = folly::toJson(value);\n  return fromJSON(String(ctx, json.c_str()));\n#endif\n}\n\nJSValueRef Value::fromDynamicInner(JSContextRef ctx, const folly::dynamic& obj) {\n  switch (obj.type()) {\n    // For primitive types (and strings), just create and return an equivalent JSValue\n    case folly::dynamic::Type::NULLT:\n      return JSC_JSValueMakeNull(ctx);\n\n    case folly::dynamic::Type::BOOL:\n      return JSC_JSValueMakeBoolean(ctx, obj.getBool());\n\n    case folly::dynamic::Type::DOUBLE:\n      return JSC_JSValueMakeNumber(ctx, obj.getDouble());\n\n    case folly::dynamic::Type::INT64:\n      return JSC_JSValueMakeNumber(ctx, obj.asDouble());\n\n    case folly::dynamic::Type::STRING:\n      return JSC_JSValueMakeString(ctx, String(ctx, obj.getString().c_str()));\n\n    case folly::dynamic::Type::ARRAY: {\n      // Collect JSValue for every element in the array\n      JSValueRef vals[obj.size()];\n      for (size_t i = 0; i < obj.size(); ++i) {\n        vals[i] = fromDynamicInner(ctx, obj[i]);\n      }\n      // Create a JSArray with the values\n      JSValueRef arr = JSC_JSObjectMakeArray(ctx, obj.size(), vals, nullptr);\n      return arr;\n    }\n\n    case folly::dynamic::Type::OBJECT: {\n      // Create an empty object\n      JSObjectRef jsObj = JSC_JSObjectMake(ctx, nullptr, nullptr);\n      // Create a JSValue for each of the object's children and set them in the object\n      for (auto it = obj.items().begin(); it != obj.items().end(); ++it) {\n        JSC_JSObjectSetProperty(\n          ctx,\n          jsObj,\n          String(ctx, it->first.asString().c_str()),\n          fromDynamicInner(ctx, it->second),\n          kJSPropertyAttributeNone,\n          nullptr);\n      }\n      return jsObj;\n    }\n    default:\n      // Assert not reached\n      LOG(FATAL) << \"Trying to convert a folly object of unsupported type.\";\n      return JSC_JSValueMakeNull(ctx);\n  }\n}\n\nObject Value::asObject() const {\n  JSValueRef exn;\n  JSObjectRef jsObj = JSC_JSValueToObject(context(), m_value, &exn);\n  if (!jsObj) {\n    throw JSException(m_context, exn, \"Failed to convert to object\");\n  }\n  return Object(context(), jsObj);\n}\n\nString Value::toString() const {\n  JSValueRef exn;\n  JSStringRef jsStr = JSC_JSValueToStringCopy(context(), m_value, &exn);\n  if (!jsStr) {\n    throw JSException(m_context, exn, \"Failed to convert to string\");\n  }\n  return String::adopt(context(), jsStr);\n}\n\nValue Value::makeError(JSContextRef ctx, const char *error, const char *stack)\n{\n  auto errorMsg = Value(ctx, String(ctx, error));\n  JSValueRef args[] = {errorMsg};\n  if (stack) {\n    // Using this instead of JSObjectMakeError to actually get a stack property.\n    // MakeError only sets it stack when returning from the invoked function, so we\n    // can't extend it here.\n    auto errorConstructor = Object::getGlobalObject(ctx).getProperty(\"Error\").asObject();\n    auto jsError = errorConstructor.callAsConstructor({errorMsg});\n    auto fullStack = std::string(stack) + jsError.getProperty(\"stack\").toString().str();\n    jsError.setProperty(\"stack\", String(ctx, fullStack.c_str()));\n    return jsError;\n  } else {\n    JSValueRef exn;\n    JSObjectRef errorObj = JSC_JSObjectMakeError(ctx, 1, args, &exn);\n    if (!errorObj) {\n      throw JSException(ctx, exn, \"Exception making error\");\n    }\n    return Value(ctx, errorObj);\n  }\n}\n\nObject::operator Value() const {\n  return Value(m_context, m_obj);\n}\n\nValue Object::callAsFunction(std::initializer_list<JSValueRef> args) const {\n  return callAsFunction(nullptr, args.size(), args.begin());\n}\n\nValue Object::callAsFunction(const Object& thisObj, std::initializer_list<JSValueRef> args) const {\n  return callAsFunction((JSObjectRef)thisObj, args.size(), args.begin());\n}\n\nValue Object::callAsFunction(int nArgs, const JSValueRef args[]) const {\n  return callAsFunction(nullptr, nArgs, args);\n}\n\nValue Object::callAsFunction(const Object& thisObj, int nArgs, const JSValueRef args[]) const {\n  return callAsFunction(static_cast<JSObjectRef>(thisObj), nArgs, args);\n}\n\nValue Object::callAsFunction(JSObjectRef thisObj, int nArgs, const JSValueRef args[]) const {\n  JSValueRef exn;\n  JSValueRef result = JSC_JSObjectCallAsFunction(m_context, m_obj, thisObj, nArgs, args, &exn);\n  if (!result) {\n    throw JSException(m_context, exn, \"Exception calling object as function\");\n  }\n  return Value(m_context, result);\n}\n\nObject Object::callAsConstructor(std::initializer_list<JSValueRef> args) const {\n  JSValueRef exn;\n  JSObjectRef result = JSC_JSObjectCallAsConstructor(m_context, m_obj, args.size(), args.begin(), &exn);\n  if (!result) {\n    throw JSException(m_context, exn, \"Exception calling object as constructor\");\n  }\n  return Object(m_context, result);\n}\n\nValue Object::getProperty(const String& propName) const {\n  JSValueRef exn;\n  JSValueRef property = JSC_JSObjectGetProperty(m_context, m_obj, propName, &exn);\n  if (!property) {\n    throw JSException(m_context, exn, folly::to<std::string>(\n      \"Failed to get property '\", propName.str(), \"'\").c_str());\n  }\n  return Value(m_context, property);\n}\n\nValue Object::getPropertyAtIndex(unsigned int index) const {\n  JSValueRef exn;\n  JSValueRef property = JSC_JSObjectGetPropertyAtIndex(m_context, m_obj, index, &exn);\n  if (!property) {\n    throw JSException(m_context, exn, folly::to<std::string>(\n      \"Failed to get property at index \", index).c_str());\n  }\n  return Value(m_context, property);\n}\n\nValue Object::getProperty(const char *propName) const {\n  return getProperty(String(m_context, propName));\n}\n\nvoid Object::setProperty(const String& propName, const Value& value) {\n  JSValueRef exn = nullptr;\n  JSC_JSObjectSetProperty(m_context, m_obj, propName, value, kJSPropertyAttributeNone, &exn);\n  if (exn) {\n    throw JSException(m_context, exn, folly::to<std::string>(\n      \"Failed to set property '\", propName.str(), \"'\").c_str());\n  }\n}\n\nvoid Object::setPropertyAtIndex(unsigned int index, const Value& value) {\n  JSValueRef exn = nullptr;\n  JSC_JSObjectSetPropertyAtIndex(m_context, m_obj, index, value, &exn);\n  if (exn) {\n    throw JSException(m_context, exn, folly::to<std::string>(\n      \"Failed to set property at index \", index).c_str());\n  }\n}\n\nvoid Object::setProperty(const char *propName, const Value& value) {\n  setProperty(String(m_context, propName), value);\n}\n\nstd::vector<String> Object::getPropertyNames() const {\n  auto namesRef = JSC_JSObjectCopyPropertyNames(m_context, m_obj);\n  size_t count = JSC_JSPropertyNameArrayGetCount(m_context, namesRef);\n  std::vector<String> names;\n  names.reserve(count);\n  for (size_t i = 0; i < count; i++) {\n    names.emplace_back(String::ref(m_context,\n      JSC_JSPropertyNameArrayGetNameAtIndex(m_context, namesRef, i)));\n  }\n  JSC_JSPropertyNameArrayRelease(m_context, namesRef);\n  return names;\n}\n\nstd::unordered_map<std::string, std::string> Object::toJSONMap() const {\n  std::unordered_map<std::string, std::string> map;\n  auto namesRef = JSC_JSObjectCopyPropertyNames(m_context, m_obj);\n  size_t count = JSC_JSPropertyNameArrayGetCount(m_context, namesRef);\n  for (size_t i = 0; i < count; i++) {\n    auto key = String::ref(m_context,\n      JSC_JSPropertyNameArrayGetNameAtIndex(m_context, namesRef, i));\n    map.emplace(key.str(), getProperty(key).toJSONString());\n  }\n  JSC_JSPropertyNameArrayRelease(m_context, namesRef);\n  return map;\n}\n\n/* static */\nObject Object::create(JSContextRef ctx) {\n  JSObjectRef newObj = JSC_JSObjectMake(\n      ctx,\n      NULL, // create instance of default object class\n      NULL); // no private data\n  return Object(ctx, newObj);\n}\n\n} }\n"
  },
  {
    "path": "ReactCommon/jschelpers/Value.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <chrono>\n#include <memory>\n#include <sstream>\n#include <unordered_map>\n#include <vector>\n\n#include <folly/dynamic.h>\n#include <jschelpers/JavaScriptCore.h>\n#include <jschelpers/Unicode.h>\n#include <jschelpers/noncopyable.h>\n#include <privatedata/PrivateDataBase.h>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\nclass Value;\n\n// C++ object wrapper for JSStringRef\nclass String : public noncopyable {\npublic:\n  explicit String(): m_context(nullptr), m_string(nullptr) {} // dummy empty constructor\n\n  explicit String(JSContextRef context, const char* utf8)\n  : m_context(context), m_string(JSC_JSStringCreateWithUTF8CString(context, utf8)) {}\n\n  String(String&& other) :\n    m_context(other.m_context), m_string(other.m_string)\n  {\n    other.m_string = nullptr;\n  }\n\n  String(const String& other) :\n    m_context(other.m_context), m_string(other.m_string)\n  {\n    if (m_string) {\n      JSC_JSStringRetain(m_context, m_string);\n    }\n  }\n\n  ~String() {\n    if (m_string) {\n      JSC_JSStringRelease(m_context, m_string);\n    }\n  }\n\n  String& operator=(String&& other) {\n    if (m_string) {\n      JSC_JSStringRelease(m_context, m_string);\n    }\n\n    m_context = other.m_context;\n    m_string = other.m_string;\n    other.m_string = nullptr;\n\n    return *this;\n  }\n\n  operator JSStringRef() const {\n    return m_string;\n  }\n\n  JSContextRef context() const {\n    return m_context;\n  }\n\n  // Length in characters\n  size_t length() const {\n    return m_string ? JSC_JSStringGetLength(m_context, m_string) : 0;\n  }\n\n  // Length in bytes of a nul-terminated utf8 encoded value\n  size_t utf8Size() const {\n    return m_string ? JSC_JSStringGetMaximumUTF8CStringSize(m_context, m_string) : 0;\n  }\n\n  /*\n   * JavaScriptCore is built with strict utf16 -> utf8 conversion.\n   * This means if JSC's built-in conversion function encounters a JavaScript\n   * string which contains half of a 32-bit UTF-16 symbol, it produces an error\n   * rather than returning a string.\n   *\n   * Instead of relying on this, we use our own utf16 -> utf8 conversion function\n   * which is more lenient and always returns a string. When an invalid UTF-16\n   * string is provided, it'll likely manifest as a rendering glitch in the app for\n   * the invalid symbol.\n   *\n   * For details on JavaScript's unicode support see:\n   * https://mathiasbynens.be/notes/javascript-unicode\n   */\n  std::string str() const {\n    if (!m_string) {\n      return \"\";\n    }\n    const JSChar* utf16 = JSC_JSStringGetCharactersPtr(m_context, m_string);\n    size_t stringLength = JSC_JSStringGetLength(m_context, m_string);\n    return unicode::utf16toUTF8(utf16, stringLength);\n  }\n\n  // Assumes that utf8 is nul-terminated\n  bool equals(const char* utf8) {\n    return m_string ? JSC_JSStringIsEqualToUTF8CString(m_context, m_string, utf8) : false;\n  }\n\n  // This assumes ascii is nul-terminated.\n  static String createExpectingAscii(JSContextRef context, const char* ascii, size_t len) {\n#if WITH_FBJSCEXTENSIONS\n    return String(context, JSC_JSStringCreateWithUTF8CStringExpectAscii(context, ascii, len), true);\n#else\n    return String(context, JSC_JSStringCreateWithUTF8CString(context, ascii), true);\n#endif\n  }\n\n  static String createExpectingAscii(JSContextRef context, std::string const &ascii) {\n    return createExpectingAscii(context, ascii.c_str(), ascii.size());\n  }\n\n  // Creates a String wrapper and increases the refcount of the JSStringRef\n  static String ref(JSContextRef context, JSStringRef string) {\n    return String(context, string, false);\n  }\n\n  // Creates a String wrapper that takes over ownership of the string. The\n  // JSStringRef passed in must previously have been created or retained.\n  static String adopt(JSContextRef context, JSStringRef string) {\n    return String(context, string, true);\n  }\n\nprivate:\n  explicit String(JSContextRef context, JSStringRef string, bool adopt) :\n    m_context(context), m_string(string)\n  {\n    if (!adopt && string) {\n      JSC_JSStringRetain(context, string);\n    }\n  }\n\n  JSContextRef m_context;\n  JSStringRef m_string;\n};\n\n// C++ object wrapper for JSObjectRef. The underlying JSObjectRef can be\n// optionally protected. You must protect the object if it is ever\n// heap-allocated, since otherwise you may end up with an invalid reference.\nclass Object : public noncopyable {\npublic:\n  using TimeType = std::chrono::time_point<std::chrono::system_clock>;\n\n  Object(JSContextRef context, JSObjectRef obj) :\n    m_context(context),\n    m_obj(obj)\n  {}\n\n  Object(Object&& other) :\n      m_context(other.m_context),\n      m_obj(other.m_obj),\n      m_isProtected(other.m_isProtected) {\n    other.m_obj = nullptr;\n    other.m_isProtected = false;\n  }\n\n  ~Object() {\n    if (m_isProtected && m_obj) {\n      JSC_JSValueUnprotect(m_context, m_obj);\n    }\n  }\n\n  Object& operator=(Object&& other) {\n    std::swap(m_context, other.m_context);\n    std::swap(m_obj, other.m_obj);\n    std::swap(m_isProtected, other.m_isProtected);\n    return *this;\n  }\n\n  operator JSObjectRef() const {\n    return m_obj;\n  }\n\n  operator Value() const;\n\n  bool isFunction() const {\n    return JSC_JSObjectIsFunction(m_context, m_obj);\n  }\n\n  Value callAsFunction(std::initializer_list<JSValueRef> args) const;\n  Value callAsFunction(const Object& thisObj, std::initializer_list<JSValueRef> args) const;\n  Value callAsFunction(int nArgs, const JSValueRef args[]) const;\n  Value callAsFunction(const Object& thisObj, int nArgs, const JSValueRef args[]) const;\n\n  Object callAsConstructor(std::initializer_list<JSValueRef> args) const;\n\n  Value getProperty(const String& propName) const;\n  Value getProperty(const char *propName) const;\n  Value getPropertyAtIndex(unsigned int index) const;\n  void setProperty(const String& propName, const Value& value);\n  void setProperty(const char *propName, const Value& value);\n  void setPropertyAtIndex(unsigned int index, const Value& value);\n  std::vector<String> getPropertyNames() const;\n  std::unordered_map<std::string, std::string> toJSONMap() const;\n\n  void makeProtected() {\n    if (!m_isProtected && m_obj) {\n      JSC_JSValueProtect(m_context, m_obj);\n      m_isProtected = true;\n    }\n  }\n\n  RN_EXPORT static Object makeArray(JSContextRef ctx, JSValueRef* elements, unsigned length);\n  RN_EXPORT static Object makeDate(JSContextRef ctx, TimeType time);\n\n  template<typename ReturnType>\n  ReturnType* getPrivate() const {\n    const bool isCustomJSC = isCustomJSCPtr(m_context);\n    return PrivateDataBase::cast<ReturnType>(JSC_JSObjectGetPrivate(isCustomJSC, m_obj));\n  }\n\n  void setPrivate(PrivateDataBase* data) const {\n    const bool isCustomJSC = isCustomJSCPtr(m_context);\n    JSC_JSObjectSetPrivate(isCustomJSC, m_obj, data);\n  }\n\n  JSContextRef context() const {\n    return m_context;\n  }\n\n  static Object getGlobalObject(JSContextRef ctx) {\n    auto globalObj = JSC_JSContextGetGlobalObject(ctx);\n    return Object(ctx, globalObj);\n  }\n\n  /**\n   * Creates an instance of the default object class.\n   */\n  static Object create(JSContextRef ctx);\n\nprivate:\n  JSContextRef m_context;\n  JSObjectRef m_obj;\n  bool m_isProtected = false;\n\n  Value callAsFunction(JSObjectRef thisObj, int nArgs, const JSValueRef args[]) const;\n};\n\n// C++ object wrapper for JSValueRef. The underlying JSValueRef is not\n// protected, so this class should always be used as a stack-allocated\n// variable.\nclass Value : public noncopyable {\npublic:\n  RN_EXPORT Value(JSContextRef context, JSValueRef value);\n  RN_EXPORT Value(JSContextRef context, JSStringRef value);\n\n  RN_EXPORT Value(const Value &o) : Value(o.m_context, o.m_value) {}\n  RN_EXPORT Value(const String &o) : Value(o.context(), o) {}\n\n  Value& operator=(Value&& other) {\n    m_context = other.m_context;\n    m_value = other.m_value;\n    other.m_value = NULL;\n    return *this;\n  };\n\n  operator JSValueRef() const {\n    return m_value;\n  }\n\n  JSType getType() const {\n    return JSC_JSValueGetType(m_context, m_value);\n  }\n\n  bool isBoolean() const {\n    return getType() == kJSTypeBoolean;\n  }\n\n  bool asBoolean() const {\n    return JSC_JSValueToBoolean(context(), m_value);\n  }\n\n  bool isNumber() const {\n    return getType() == kJSTypeNumber;\n  }\n\n  bool isNull() const {\n    return getType() == kJSTypeNull;\n  }\n\n  bool isUndefined() const {\n    return getType() == kJSTypeUndefined;\n  }\n\n  double asNumber() const {\n    if (isNumber()) {\n      return JSC_JSValueToNumber(context(), m_value, nullptr);\n    } else {\n      return 0.0f;\n    }\n  }\n\n  int32_t asInteger() const {\n    return static_cast<int32_t>(asNumber());\n  }\n\n  uint32_t asUnsignedInteger() const {\n    return static_cast<uint32_t>(asNumber());\n  }\n\n  bool isObject() const {\n    return getType() == kJSTypeObject;\n  }\n\n  RN_EXPORT Object asObject() const;\n\n  bool isString() const {\n    return getType() == kJSTypeString;\n  }\n\n  RN_EXPORT String toString() const;\n\n  // Create an error, optionally adding an additional number of lines to the stack.\n  // Stack must be empty or newline terminated.\n  RN_EXPORT static Value makeError(JSContextRef ctx, const char *error, const char *stack = nullptr);\n\n  static Value makeNumber(JSContextRef ctx, double value) {\n    return Value(ctx, JSC_JSValueMakeNumber(ctx, value));\n  }\n\n  static Value makeUndefined(JSContextRef ctx) {\n    return Value(ctx, JSC_JSValueMakeUndefined(ctx));\n  }\n\n  static Value makeNull(JSContextRef ctx) {\n    return Value(ctx, JSC_JSValueMakeNull(ctx));\n  }\n\n  static Value makeBoolean(JSContextRef ctx, bool value) {\n    return Value(ctx, JSC_JSValueMakeBoolean(ctx, value));\n  }\n\n  static Value makeString(JSContextRef ctx, const char* utf8) {\n    return Value(ctx, String(ctx, utf8));\n  }\n\n  RN_EXPORT std::string toJSONString(unsigned indent = 0) const;\n  RN_EXPORT static Value fromJSON(const String& json);\n  RN_EXPORT static Value fromDynamic(JSContextRef ctx, const folly::dynamic& value);\n  RN_EXPORT JSContextRef context() const;\n\nprivate:\n  JSContextRef m_context;\n  JSValueRef m_value;\n\n  static JSValueRef fromDynamicInner(JSContextRef ctx, const folly::dynamic& obj);\n};\n\n} }\n"
  },
  {
    "path": "ReactCommon/jschelpers/noncopyable.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\nnamespace facebook {\nnamespace react {\nstruct noncopyable {\n  noncopyable(const noncopyable&) = delete;\n  noncopyable& operator=(const noncopyable&) = delete;\n protected:\n  noncopyable() = default;\n};\n}}\n"
  },
  {
    "path": "ReactCommon/jschelpers/systemJSCWrapper.cpp",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include <jschelpers/JSCWrapper.h>\n\n#if defined(__APPLE__)\n\n#include <mutex>\n\n#include <objc/runtime.h>\n\n// Crash the app (with a descriptive stack trace) if a function that is not supported by\n// the system JSC is called.\n#define UNIMPLEMENTED_SYSTEM_JSC_FUNCTION(FUNC_NAME)            \\\nstatic void Unimplemented_##FUNC_NAME(__unused void* args...) { \\\n  assert(false);                                                \\\n}\n\nUNIMPLEMENTED_SYSTEM_JSC_FUNCTION(JSEvaluateBytecodeBundle)\n#if WITH_FBJSCEXTENSIONS\nUNIMPLEMENTED_SYSTEM_JSC_FUNCTION(JSStringCreateWithUTF8CStringExpectAscii)\n#endif\nUNIMPLEMENTED_SYSTEM_JSC_FUNCTION(JSPokeSamplingProfiler)\nUNIMPLEMENTED_SYSTEM_JSC_FUNCTION(JSStartSamplingProfilingOnMainJSCThread)\n\nUNIMPLEMENTED_SYSTEM_JSC_FUNCTION(JSGlobalContextEnableDebugger)\nUNIMPLEMENTED_SYSTEM_JSC_FUNCTION(JSGlobalContextDisableDebugger)\n\nUNIMPLEMENTED_SYSTEM_JSC_FUNCTION(configureJSCForIOS)\n\nUNIMPLEMENTED_SYSTEM_JSC_FUNCTION(FBJSContextStartGCTimers)\n\nbool JSSamplingProfilerEnabled() {\n  return false;\n}\n\nconst int32_t JSNoBytecodeFileFormatVersion = -1;\n\nnamespace facebook {\nnamespace react {\n\nstatic JSCWrapper s_systemWrapper = {};\n\nconst JSCWrapper* systemJSCWrapper() {\n  // Note that this is not used on Android. All methods are statically linked instead.\n  // Some fields are lazily initialized\n  static std::once_flag flag;\n  std::call_once(flag, []() {\n    s_systemWrapper = {\n      .JSGlobalContextCreateInGroup = JSGlobalContextCreateInGroup,\n      .JSGlobalContextRelease = JSGlobalContextRelease,\n      .JSGlobalContextSetName = JSGlobalContextSetName,\n\n      .JSContextGetGlobalContext = JSContextGetGlobalContext,\n      .JSContextGetGlobalObject = JSContextGetGlobalObject,\n      .FBJSContextStartGCTimers =\n        (decltype(&FBJSContextStartGCTimers))\n        Unimplemented_FBJSContextStartGCTimers,\n\n      .JSEvaluateScript = JSEvaluateScript,\n      .JSEvaluateBytecodeBundle =\n        (decltype(&JSEvaluateBytecodeBundle))\n        Unimplemented_JSEvaluateBytecodeBundle,\n\n      .JSStringCreateWithUTF8CString = JSStringCreateWithUTF8CString,\n      .JSStringCreateWithCFString = JSStringCreateWithCFString,\n      #if WITH_FBJSCEXTENSIONS\n      .JSStringCreateWithUTF8CStringExpectAscii =\n        (decltype(&JSStringCreateWithUTF8CStringExpectAscii))\n        Unimplemented_JSStringCreateWithUTF8CStringExpectAscii,\n      #endif\n      .JSStringCopyCFString = JSStringCopyCFString,\n      .JSStringGetCharactersPtr = JSStringGetCharactersPtr,\n      .JSStringGetLength = JSStringGetLength,\n      .JSStringGetMaximumUTF8CStringSize = JSStringGetMaximumUTF8CStringSize,\n      .JSStringIsEqualToUTF8CString = JSStringIsEqualToUTF8CString,\n      .JSStringRelease = JSStringRelease,\n      .JSStringRetain = JSStringRetain,\n\n      .JSClassCreate = JSClassCreate,\n      .JSClassRelease = JSClassRelease,\n\n      .JSObjectCallAsConstructor = JSObjectCallAsConstructor,\n      .JSObjectCallAsFunction = JSObjectCallAsFunction,\n      .JSObjectGetPrivate = JSObjectGetPrivate,\n      .JSObjectGetProperty = JSObjectGetProperty,\n      .JSObjectGetPropertyAtIndex = JSObjectGetPropertyAtIndex,\n      .JSObjectIsConstructor = JSObjectIsConstructor,\n      .JSObjectIsFunction = JSObjectIsFunction,\n      .JSObjectMake = JSObjectMake,\n      .JSObjectMakeArray = JSObjectMakeArray,\n      .JSObjectMakeDate = JSObjectMakeDate,\n      .JSObjectMakeError = JSObjectMakeError,\n      .JSObjectMakeFunctionWithCallback = JSObjectMakeFunctionWithCallback,\n      .JSObjectSetPrivate = JSObjectSetPrivate,\n      .JSObjectSetProperty = JSObjectSetProperty,\n      .JSObjectSetPropertyAtIndex = JSObjectSetPropertyAtIndex,\n\n      .JSObjectCopyPropertyNames = JSObjectCopyPropertyNames,\n      .JSPropertyNameArrayGetCount = JSPropertyNameArrayGetCount,\n      .JSPropertyNameArrayGetNameAtIndex = JSPropertyNameArrayGetNameAtIndex,\n      .JSPropertyNameArrayRelease = JSPropertyNameArrayRelease,\n\n      .JSValueCreateJSONString = JSValueCreateJSONString,\n      .JSValueGetType = JSValueGetType,\n      .JSValueMakeFromJSONString = JSValueMakeFromJSONString,\n      .JSValueMakeBoolean = JSValueMakeBoolean,\n      .JSValueMakeNull = JSValueMakeNull,\n      .JSValueMakeNumber = JSValueMakeNumber,\n      .JSValueMakeString = JSValueMakeString,\n      .JSValueMakeUndefined = JSValueMakeUndefined,\n      .JSValueProtect = JSValueProtect,\n      .JSValueToBoolean = JSValueToBoolean,\n      .JSValueToNumber = JSValueToNumber,\n      .JSValueToObject = JSValueToObject,\n      .JSValueToStringCopy = JSValueToStringCopy,\n      .JSValueUnprotect = JSValueUnprotect,\n\n      .JSSamplingProfilerEnabled = JSSamplingProfilerEnabled,\n      .JSPokeSamplingProfiler =\n        (decltype(&JSPokeSamplingProfiler))\n        Unimplemented_JSPokeSamplingProfiler,\n      .JSStartSamplingProfilingOnMainJSCThread =\n        (decltype(&JSStartSamplingProfilingOnMainJSCThread))\n        Unimplemented_JSStartSamplingProfilingOnMainJSCThread,\n\n      .JSGlobalContextEnableDebugger =\n        (decltype(&JSGlobalContextEnableDebugger))\n        Unimplemented_JSGlobalContextEnableDebugger,\n      .JSGlobalContextDisableDebugger =\n        (decltype(&JSGlobalContextDisableDebugger))\n        Unimplemented_JSGlobalContextDisableDebugger,\n\n      .configureJSCForIOS =\n        (decltype(&configureJSCForIOS))Unimplemented_configureJSCForIOS,\n\n      .JSContext = objc_getClass(\"JSContext\"),\n      .JSValue = objc_getClass(\"JSValue\"),\n\n      .JSBytecodeFileFormatVersion = JSNoBytecodeFileFormatVersion,\n    };\n  });\n  return &s_systemWrapper;\n}\n\n} }\n\n#endif\n"
  },
  {
    "path": "ReactCommon/jsinspector/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := jsinspector\n\nLOCAL_SRC_FILES := \\\n  InspectorInterfaces.cpp\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/..\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)\n\nLOCAL_CFLAGS += -Wall -Werror -fexceptions\nCXX11_FLAGS := -std=c++11\nLOCAL_CFLAGS += $(CXX11_FLAGS)\nLOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)\n\ninclude $(BUILD_SHARED_LIBRARY)\n"
  },
  {
    "path": "ReactCommon/jsinspector/BUCK",
    "content": "include_defs(\"//ReactCommon/DEFS\")\n\nEXPORTED_HEADERS = [\n    \"InspectorInterfaces.h\",\n]\n\nrn_xplat_cxx_library(\n    name = \"jsinspector\",\n    srcs = glob(\n        [\"*.cpp\"],\n    ),\n    headers = glob(\n        [\"*.h\"],\n        excludes = EXPORTED_HEADERS,\n    ),\n    header_namespace = \"jsinspector\",\n    exported_headers = EXPORTED_HEADERS,\n    compiler_flags = [\n        \"-Wall\",\n        \"-fexceptions\",\n        \"-std=c++1y\",\n    ],\n    fbandroid_preferred_linkage = \"shared\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n"
  },
  {
    "path": "ReactCommon/jsinspector/InspectorInterfaces.cpp",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"InspectorInterfaces.h\"\n\n#include <mutex>\n#include <unordered_map>\n\nnamespace facebook {\nnamespace react {\n\n// pure destructors in C++ are odd. You would think they don't want an\n// implementation, but in fact the linker requires one. Define them to be\n// empty so that people don't count on them for any particular behaviour.\nIDestructible::~IDestructible() { }\nILocalConnection::~ILocalConnection() { }\nIRemoteConnection::~IRemoteConnection() { }\n\nnamespace {\n\nclass InspectorImpl : public IInspector {\n public:\n  int addPage(const std::string& title, ConnectFunc connectFunc) override;\n  void removePage(int pageId) override;\n\n  std::vector<InspectorPage> getPages() const override;\n  std::unique_ptr<ILocalConnection> connect(\n      int pageId,\n      std::unique_ptr<IRemoteConnection> remote) override;\n\n private:\n  mutable std::mutex mutex_;\n  int nextPageId_{1};\n  std::unordered_map<int, std::string> titles_;\n  std::unordered_map<int, ConnectFunc> connectFuncs_;\n};\n\nint InspectorImpl::addPage(const std::string& title, ConnectFunc connectFunc) {\n  std::lock_guard<std::mutex> lock(mutex_);\n\n  int pageId = nextPageId_++;\n  titles_[pageId] = title;\n  connectFuncs_[pageId] = std::move(connectFunc);\n\n  return pageId;\n}\n\nvoid InspectorImpl::removePage(int pageId) {\n  std::lock_guard<std::mutex> lock(mutex_);\n\n  titles_.erase(pageId);\n  connectFuncs_.erase(pageId);\n}\n\nstd::vector<InspectorPage> InspectorImpl::getPages() const {\n  std::lock_guard<std::mutex> lock(mutex_);\n\n  std::vector<InspectorPage> inspectorPages;\n  for (auto& it : titles_) {\n    inspectorPages.push_back(InspectorPage{it.first, it.second});\n  }\n\n  return inspectorPages;\n}\n\nstd::unique_ptr<ILocalConnection> InspectorImpl::connect(\n    int pageId,\n    std::unique_ptr<IRemoteConnection> remote) {\n  IInspector::ConnectFunc connectFunc;\n\n  {\n    std::lock_guard<std::mutex> lock(mutex_);\n\n    auto it = connectFuncs_.find(pageId);\n    if (it != connectFuncs_.end()) {\n      connectFunc = it->second;\n    }\n  }\n\n  return connectFunc ? connectFunc(std::move(remote)) : nullptr;\n}\n\n} // namespace\n\nIInspector& getInspectorInstance() {\n  static InspectorImpl instance;\n  return instance;\n}\n\nstd::unique_ptr<IInspector> makeTestInspectorInstance() {\n  return std::make_unique<InspectorImpl>();\n}\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactCommon/jsinspector/InspectorInterfaces.h",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <functional>\n#include <memory>\n#include <string>\n#include <vector>\n\nnamespace facebook {\nnamespace react {\n\nclass IDestructible {\n public:\n  virtual ~IDestructible() = 0;\n};\n\nstruct InspectorPage {\n  const int id;\n  const std::string title;\n};\n\n/// IRemoteConnection allows the VM to send debugger messages to the client.\nclass IRemoteConnection : public IDestructible {\n public:\n  virtual ~IRemoteConnection() = 0;\n  virtual void onMessage(std::string message) = 0;\n  virtual void onDisconnect() = 0;\n};\n\n/// ILocalConnection allows the client to send debugger messages to the VM.\nclass ILocalConnection : public IDestructible {\n public:\n  virtual ~ILocalConnection() = 0;\n  virtual void sendMessage(std::string message) = 0;\n  virtual void disconnect() = 0;\n};\n\n/// IInspector tracks debuggable JavaScript targets (pages).\nclass IInspector {\n public:\n  using ConnectFunc = std::function<std::unique_ptr<ILocalConnection>(\n      std::unique_ptr<IRemoteConnection>)>;\n\n  /// addPage is called by the VM to add a page to the list of debuggable pages.\n  virtual int addPage(const std::string& title, ConnectFunc connectFunc) = 0;\n\n  /// removePage is called by the VM to remove a page from the list of\n  /// debuggable pages.\n  virtual void removePage(int pageId) = 0;\n\n  /// getPages is called by the client to list all debuggable pages.\n  virtual std::vector<InspectorPage> getPages() const = 0;\n\n  /// connect is called by the client to initiate a debugging session on the\n  /// given page.\n  virtual std::unique_ptr<ILocalConnection> connect(\n      int pageId,\n      std::unique_ptr<IRemoteConnection> remote) = 0;\n};\n\n/// getInspectorInstance retrieves the singleton inspector that tracks all\n/// debuggable pages in this process.\nextern IInspector& getInspectorInstance();\n\n/// makeTestInspectorInstance creates an independent inspector instance that\n/// should only be used in tests.\nextern std::unique_ptr<IInspector> makeTestInspectorInstance();\n\n} // namespace react\n} // namespace facebook\n"
  },
  {
    "path": "ReactCommon/microprofiler/BUCK",
    "content": "include_defs(\"//ReactCommon/DEFS\")\n\nfb_xplat_cxx_library(\n    name = \"microprofiler\",\n    srcs = [\n        \"MicroProfiler.cpp\",\n    ],\n    header_namespace = \"microprofiler\",\n    exported_headers = [\n        \"MicroProfiler.h\",\n    ],\n    compiler_flags = [\n        \"-Wall\",\n        \"-Werror\",\n        \"-std=c++11\",\n        \"-fexceptions\",\n    ],\n    force_static = True,\n    visibility = [\n        \"PUBLIC\",\n    ],\n    deps = [\n        GLOG_DEP,\n    ],\n)\n"
  },
  {
    "path": "ReactCommon/microprofiler/MicroProfiler.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include <algorithm>\n#include <chrono>\n#include <mutex>\n#include <vector>\n#include <time.h>\n\n#include <glog/logging.h>\n\n#include \"MicroProfiler.h\"\n\n// iOS doesn't support 'thread_local'. If we reimplement this to use pthread_setspecific\n// we can get rid of this\n#if defined(__APPLE__)\n#define MICRO_PROFILER_STUB_IMPLEMENTATION 1\n#else\n#define MICRO_PROFILER_STUB_IMPLEMENTATION 0\n#endif\n\nnamespace facebook {\nnamespace react {\n\n#if !MICRO_PROFILER_STUB_IMPLEMENTATION\nstruct TraceData {\n  TraceData();\n  ~TraceData();\n\n  void addTime(MicroProfilerName name, uint_fast64_t time, uint_fast32_t internalClockCalls);\n\n  std::thread::id threadId_;\n  uint_fast64_t startTime_;\n  std::atomic_uint_fast64_t times_[MicroProfilerName::__LENGTH__] = {};\n  std::atomic_uint_fast32_t calls_[MicroProfilerName::__LENGTH__] = {};\n  std::atomic_uint_fast32_t childProfileSections_[MicroProfilerName::__LENGTH__] = {};\n};\n\nstruct ProfilingImpl {\n  std::mutex mutex_;\n  std::vector<TraceData*> allTraceData_;\n  bool isProfiling_ = false;\n  uint_fast64_t startTime_;\n  uint_fast64_t endTime_;\n  uint_fast64_t clockOverhead_;\n  uint_fast64_t profileSectionOverhead_;\n};\n\nstatic ProfilingImpl profiling;\nthread_local TraceData myTraceData;\nthread_local uint_fast32_t profileSections = 0;\n\nstatic uint_fast64_t nowNs() {\n  struct timespec time;\n  clock_gettime(CLOCK_REALTIME, &time);\n  return uint_fast64_t(1000000000) * time.tv_sec + time.tv_nsec;\n}\n\nstatic uint_fast64_t diffNs(uint_fast64_t start, uint_fast64_t end) {\n  return end - start;\n}\n\nstatic std::string formatTimeNs(uint_fast64_t timeNs) {\n  std::ostringstream out;\n  out.precision(2);\n  if (timeNs < 1000) {\n    out << timeNs << \"ns\";\n  } else if (timeNs < 1000000) {\n    out << timeNs / 1000.0 << \"us\";\n  } else {\n    out << std::fixed << timeNs / 1000000.0 << \"ms\";\n  }\n  return out.str();\n}\n\nMicroProfilerSection::MicroProfilerSection(MicroProfilerName name) :\n    isProfiling_(profiling.isProfiling_),\n    name_(name),\n    startNumProfileSections_(profileSections) {\n  if (!isProfiling_) {\n    return;\n  }\n  profileSections++;\n  startTime_ = nowNs();\n}\nMicroProfilerSection::~MicroProfilerSection() {\n  if (!isProfiling_ || !profiling.isProfiling_) {\n    return;\n  }\n  auto endTime = nowNs();\n  auto endNumProfileSections = profileSections;\n  myTraceData.addTime(name_, endTime - startTime_, endNumProfileSections - startNumProfileSections_ - 1);\n}\n\nTraceData::TraceData() :\n    threadId_(std::this_thread::get_id()) {\n  std::lock_guard<std::mutex> lock(profiling.mutex_);\n  profiling.allTraceData_.push_back(this);\n}\n\nTraceData::~TraceData() {\n  std::lock_guard<std::mutex> lock(profiling.mutex_);\n  auto& infos = profiling.allTraceData_;\n  infos.erase(std::remove(infos.begin(), infos.end(), this), infos.end());\n}\n\nvoid TraceData::addTime(MicroProfilerName name, uint_fast64_t time, uint_fast32_t childprofileSections) {\n  times_[name] += time;\n  calls_[name]++;\n  childProfileSections_[name] += childprofileSections;\n}\n\nstatic void printReport() {\n  LOG(ERROR) << \"======= MICRO PROFILER REPORT =======\";\n  LOG(ERROR) << \"- Total Time: \" << formatTimeNs(diffNs(profiling.startTime_, profiling.endTime_));\n  LOG(ERROR) << \"- Clock Overhead: \" << formatTimeNs(profiling.clockOverhead_);\n  LOG(ERROR) << \"- Profiler Section Overhead: \" << formatTimeNs(profiling.profileSectionOverhead_);\n  for (auto info : profiling.allTraceData_) {\n    LOG(ERROR) << \"--- Thread ID 0x\" << std::hex << info->threadId_ << \" ---\";\n    for (int i = 0; i < MicroProfilerName::__LENGTH__; i++) {\n      if (info->times_[i] > 0) {\n        auto totalTime = info->times_[i].load();\n        auto calls = info->calls_[i].load();\n        auto clockOverhead = profiling.clockOverhead_ * calls + profiling.profileSectionOverhead_ * info->childProfileSections_[i].load();\n        if (totalTime < clockOverhead) {\n          LOG(ERROR) << \"- \" << MicroProfiler::profilingNameToString(static_cast<MicroProfilerName>(i)) << \": \"\n              << \"ERROR: Total time was \" << totalTime << \"ns but clock overhead was calculated to be \" << clockOverhead << \"ns!\";\n        } else {\n          auto correctedTime = totalTime - clockOverhead;\n          auto timePerCall = correctedTime / calls;\n          LOG(ERROR) << \"- \" << MicroProfiler::profilingNameToString(static_cast<MicroProfilerName>(i)) << \": \"\n              << formatTimeNs(correctedTime) << \" (\" << calls << \" calls, \" << formatTimeNs(timePerCall) << \"/call)\";\n        }\n      }\n    }\n  }\n}\n\nstatic void clearProfiling() {\n  CHECK(!profiling.isProfiling_) << \"Trying to clear profiling but profiling was already started!\";\n  for (auto info : profiling.allTraceData_) {\n    for (unsigned int i = 0; i < MicroProfilerName::__LENGTH__; i++) {\n      info->times_[i] = 0;\n      info->calls_[i] = 0;\n      info->childProfileSections_[i] = 0;\n    }\n  }\n}\n\nstatic uint_fast64_t calculateClockOverhead() {\n  int numCalls = 1000000;\n  uint_fast64_t start = nowNs();\n  for (int i = 0; i < numCalls; i++) {\n    nowNs();\n  }\n  uint_fast64_t end = nowNs();\n  return (end - start) / numCalls;\n}\n\nstatic uint_fast64_t calculateProfileSectionOverhead() {\n  int numCalls = 1000000;\n  uint_fast64_t start = nowNs();\n  profiling.isProfiling_ = true;\n  for (int i = 0; i < numCalls; i++) {\n    MICRO_PROFILER_SECTION(static_cast<MicroProfilerName>(0));\n  }\n  uint_fast64_t end = nowNs();\n  profiling.isProfiling_ = false;\n  return (end - start) / numCalls;\n}\n\nvoid MicroProfiler::startProfiling() {\n  CHECK(!profiling.isProfiling_) << \"Trying to start profiling but profiling was already started!\";\n\n  profiling.clockOverhead_ = calculateClockOverhead();\n  profiling.profileSectionOverhead_ = calculateProfileSectionOverhead();\n\n  std::lock_guard<std::mutex> lock(profiling.mutex_);\n  clearProfiling();\n\n  profiling.startTime_ = nowNs();\n  profiling.isProfiling_ = true;\n}\n\nvoid MicroProfiler::stopProfiling() {\n  CHECK(profiling.isProfiling_) << \"Trying to stop profiling but profiling hasn't been started!\";\n\n  profiling.isProfiling_ = false;\n  profiling.endTime_ = nowNs();\n\n  std::lock_guard<std::mutex> lock(profiling.mutex_);\n\n  printReport();\n\n  clearProfiling();\n}\n\nbool MicroProfiler::isProfiling() {\n  return profiling.isProfiling_;\n}\n\nvoid MicroProfiler::runInternalBenchmark() {\n  MicroProfiler::startProfiling();\n  for (int i = 0; i < 1000000; i++) {\n    MICRO_PROFILER_SECTION_NAMED(outer, __INTERNAL_BENCHMARK_OUTER);\n    {\n      MICRO_PROFILER_SECTION_NAMED(inner, __INTERNAL_BENCHMARK_INNER);\n    }\n  }\n  MicroProfiler::stopProfiling();\n}\n#else\nvoid MicroProfiler::startProfiling() {\n  CHECK(false) << \"This platform has a stub implementation of the micro profiler and cannot collect traces\";\n}\nvoid MicroProfiler::stopProfiling() {\n}\nbool MicroProfiler::isProfiling() {\n  return false;\n}\nvoid MicroProfiler::runInternalBenchmark() {\n}\n#endif\n\n} }\n"
  },
  {
    "path": "ReactCommon/microprofiler/MicroProfiler.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <atomic>\n#include <thread>\n\n// #define WITH_MICRO_PROFILER 1\n\n#ifdef WITH_MICRO_PROFILER\n#define MICRO_PROFILER_SECTION(name) MicroProfilerSection __b(name)\n#define MICRO_PROFILER_SECTION_NAMED(var_name, name) MicroProfilerSection var_name(name)\n#else\n#define MICRO_PROFILER_SECTION(name)\n#define MICRO_PROFILER_SECTION_NAMED(var_name, name)\n#endif\n\nnamespace facebook {\nnamespace react {\n\nenum MicroProfilerName {\n  __INTERNAL_BENCHMARK_INNER,\n  __INTERNAL_BENCHMARK_OUTER,\n  __LENGTH__,\n};\n\n/**\n * MicroProfiler is a performance profiler for measuring the cumulative impact of\n * a large number of small-ish calls. This is normally a problem for standard profilers\n * like Systrace because the overhead of the profiler itself skews the timings you\n * are able to collect. This is especially a problem when doing nested calls to\n * profiled functions, as the parent calls will contain the overhead of their profiling\n * plus the overhead of all their childrens' profiling.\n *\n * MicroProfiler attempts to be low overhead by 1) aggregating timings in memory and\n * 2) trying to remove estimated profiling overhead from the returned timings.\n *\n * To remove estimated overhead, at the beginning of each trace we calculate the\n * average cost of profiling a no-op code section, as well as invoking the average\n * cost of invoking the system clock. The former is subtracted out for each child\n * profiler section that is invoked within a parent profiler section. The latter is\n * subtracted from each section, child or not.\n *\n * After MicroProfiler::stopProfiling() is called, a table of tracing data is emitted\n * to glog (which shows up in logcat on Android).\n */\nstruct MicroProfiler {\n  static const char* profilingNameToString(MicroProfilerName name) {\n    switch (name) {\n      case __INTERNAL_BENCHMARK_INNER:\n        return \"__INTERNAL_BENCHMARK_INNER\";\n      case __INTERNAL_BENCHMARK_OUTER:\n        return \"__INTERNAL_BENCHMARK_OUTER\";\n      case __LENGTH__:\n        throw std::runtime_error(\"__LENGTH__ has no name\");\n      default:\n        throw std::runtime_error(\"Trying to convert unknown MicroProfilerName to string\");\n    }\n  }\n\n  static void startProfiling();\n  static void stopProfiling();\n  static bool isProfiling();\n  static void runInternalBenchmark();\n};\n\nclass MicroProfilerSection {\npublic:\n  MicroProfilerSection(MicroProfilerName name);\n  ~MicroProfilerSection();\n\nprivate:\n  bool isProfiling_;\n  MicroProfilerName name_;\n  uint_fast64_t startTime_;\n  uint_fast32_t startNumProfileSections_;\n};\n\n} }\n"
  },
  {
    "path": "ReactCommon/privatedata/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := privatedata\n\nLOCAL_SRC_FILES := \\\n  PrivateDataBase.cpp \\\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/..\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)\n\nLOCAL_CFLAGS := \\\n  -DLOG_TAG=\\\"ReactNative\\\"\n\nLOCAL_CFLAGS += -Wall -Werror -fexceptions -frtti\nCXX11_FLAGS := -std=c++11\nLOCAL_CFLAGS += $(CXX11_FLAGS)\nLOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)\n\ninclude $(BUILD_SHARED_LIBRARY)\n"
  },
  {
    "path": "ReactCommon/privatedata/BUCK",
    "content": "include_defs(\"//ReactCommon/DEFS\")\n\nrn_xplat_cxx_library(\n    name = \"privatedata\",\n    srcs = glob([\"**/*.cpp\"]),\n    header_namespace = \"\",\n    exported_headers = subdir_glob(\n        [\n            (\"\", \"**/*.h\"),\n        ],\n        prefix = \"privatedata\",\n    ),\n    compiler_flags = [\n        \"-Wall\",\n        \"-fexceptions\",\n        \"-frtti\",\n        \"-fvisibility=hidden\",\n        \"-std=c++1y\",\n    ],\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n"
  },
  {
    "path": "ReactCommon/privatedata/PrivateDataBase.cpp",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#include \"PrivateDataBase.h\"\n\nnamespace facebook {\nnamespace react {\n\nPrivateDataBase::~PrivateDataBase() {}\n\n} }\n"
  },
  {
    "path": "ReactCommon/privatedata/PrivateDataBase.h",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\n#pragma once\n\n#include <cassert>\n#include <cstdlib>\n#include <type_traits>\n\n#ifndef RN_EXPORT\n#define RN_EXPORT __attribute__((visibility(\"default\")))\n#endif\n\nnamespace facebook {\nnamespace react {\n\n// Base class for private data used to implement hybrid JS-native objects. A common root class,\n// rtti and dynamic_cast allow us to do some runtime type checking that makes it possible\n// for multiple hybrid object implementations to co-exist.\nclass RN_EXPORT PrivateDataBase {\n public:\n  virtual ~PrivateDataBase();\n\n  // Casts given void* to PrivateDataBase and performs dynamic_cast to desired type. Returns null on\n  // failure.\n  template <typename T>\n  static typename std::enable_if<std::is_base_of<PrivateDataBase, T>::value, T>::type* tryCast(void* ptr) {\n    return dynamic_cast<T*>(reinterpret_cast<PrivateDataBase*>(ptr));\n  }\n\n  // Like tryCast, but aborts on failure.\n  template <typename T>\n  static typename std::enable_if<std::is_base_of<PrivateDataBase, T>::value, T>::type* cast(void* ptr) {\n    auto result = tryCast<T>(ptr);\n    if (!result) {\n      assert(false && \"could not cast to desired type\");\n      abort();\n    }\n    return result;\n  }\n};\n\n} }\n"
  },
  {
    "path": "ReactCommon/yoga/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := yogacore\n\nLOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/yoga/*.cpp)\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)\n\nLOCAL_CFLAGS := -Wall -Werror -fexceptions -frtti -std=c++1y -O3\n\ninclude $(BUILD_STATIC_LIBRARY)\n"
  },
  {
    "path": "ReactCommon/yoga/BUCK",
    "content": "fb_xplat_cxx_library(\n    name = \"yoga\",\n    srcs = glob([\"yoga/*.cpp\"]),\n    header_namespace = \"\",\n    exported_headers = glob([\"yoga/*.h\"]),\n    compiler_flags = [\n        \"-fno-omit-frame-pointer\",\n        \"-fexceptions\",\n        \"-Wall\",\n        \"-Werror\",\n        \"-std=c++1y\",\n        \"-O3\",\n    ],\n    force_static = True,\n    visibility = [\"PUBLIC\"],\n    deps = [\n    ],\n)\n"
  },
  {
    "path": "ReactCommon/yoga/yoga/YGEnums.cpp",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"YGEnums.h\"\n\nconst char *YGAlignToString(const YGAlign value){\n  switch(value){\n    case YGAlignAuto:\n      return \"auto\";\n    case YGAlignFlexStart:\n      return \"flex-start\";\n    case YGAlignCenter:\n      return \"center\";\n    case YGAlignFlexEnd:\n      return \"flex-end\";\n    case YGAlignStretch:\n      return \"stretch\";\n    case YGAlignBaseline:\n      return \"baseline\";\n    case YGAlignSpaceBetween:\n      return \"space-between\";\n    case YGAlignSpaceAround:\n      return \"space-around\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGDimensionToString(const YGDimension value){\n  switch(value){\n    case YGDimensionWidth:\n      return \"width\";\n    case YGDimensionHeight:\n      return \"height\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGDirectionToString(const YGDirection value){\n  switch(value){\n    case YGDirectionInherit:\n      return \"inherit\";\n    case YGDirectionLTR:\n      return \"ltr\";\n    case YGDirectionRTL:\n      return \"rtl\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGDisplayToString(const YGDisplay value){\n  switch(value){\n    case YGDisplayFlex:\n      return \"flex\";\n    case YGDisplayNone:\n      return \"none\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGEdgeToString(const YGEdge value){\n  switch(value){\n    case YGEdgeLeft:\n      return \"left\";\n    case YGEdgeTop:\n      return \"top\";\n    case YGEdgeRight:\n      return \"right\";\n    case YGEdgeBottom:\n      return \"bottom\";\n    case YGEdgeStart:\n      return \"start\";\n    case YGEdgeEnd:\n      return \"end\";\n    case YGEdgeHorizontal:\n      return \"horizontal\";\n    case YGEdgeVertical:\n      return \"vertical\";\n    case YGEdgeAll:\n      return \"all\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGExperimentalFeatureToString(const YGExperimentalFeature value){\n  switch(value){\n    case YGExperimentalFeatureWebFlexBasis:\n      return \"web-flex-basis\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGFlexDirectionToString(const YGFlexDirection value){\n  switch(value){\n    case YGFlexDirectionColumn:\n      return \"column\";\n    case YGFlexDirectionColumnReverse:\n      return \"column-reverse\";\n    case YGFlexDirectionRow:\n      return \"row\";\n    case YGFlexDirectionRowReverse:\n      return \"row-reverse\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGJustifyToString(const YGJustify value){\n  switch(value){\n    case YGJustifyFlexStart:\n      return \"flex-start\";\n    case YGJustifyCenter:\n      return \"center\";\n    case YGJustifyFlexEnd:\n      return \"flex-end\";\n    case YGJustifySpaceBetween:\n      return \"space-between\";\n    case YGJustifySpaceAround:\n      return \"space-around\";\n    case YGJustifySpaceEvenly:\n      return \"space-evenly\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGLogLevelToString(const YGLogLevel value){\n  switch(value){\n    case YGLogLevelError:\n      return \"error\";\n    case YGLogLevelWarn:\n      return \"warn\";\n    case YGLogLevelInfo:\n      return \"info\";\n    case YGLogLevelDebug:\n      return \"debug\";\n    case YGLogLevelVerbose:\n      return \"verbose\";\n    case YGLogLevelFatal:\n      return \"fatal\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGMeasureModeToString(const YGMeasureMode value){\n  switch(value){\n    case YGMeasureModeUndefined:\n      return \"undefined\";\n    case YGMeasureModeExactly:\n      return \"exactly\";\n    case YGMeasureModeAtMost:\n      return \"at-most\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGNodeTypeToString(const YGNodeType value){\n  switch(value){\n    case YGNodeTypeDefault:\n      return \"default\";\n    case YGNodeTypeText:\n      return \"text\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGOverflowToString(const YGOverflow value){\n  switch(value){\n    case YGOverflowVisible:\n      return \"visible\";\n    case YGOverflowHidden:\n      return \"hidden\";\n    case YGOverflowScroll:\n      return \"scroll\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGPositionTypeToString(const YGPositionType value){\n  switch(value){\n    case YGPositionTypeRelative:\n      return \"relative\";\n    case YGPositionTypeAbsolute:\n      return \"absolute\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGPrintOptionsToString(const YGPrintOptions value){\n  switch(value){\n    case YGPrintOptionsLayout:\n      return \"layout\";\n    case YGPrintOptionsStyle:\n      return \"style\";\n    case YGPrintOptionsChildren:\n      return \"children\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGUnitToString(const YGUnit value){\n  switch(value){\n    case YGUnitUndefined:\n      return \"undefined\";\n    case YGUnitPoint:\n      return \"point\";\n    case YGUnitPercent:\n      return \"percent\";\n    case YGUnitAuto:\n      return \"auto\";\n  }\n  return \"unknown\";\n}\n\nconst char *YGWrapToString(const YGWrap value){\n  switch(value){\n    case YGWrapNoWrap:\n      return \"no-wrap\";\n    case YGWrapWrap:\n      return \"wrap\";\n    case YGWrapWrapReverse:\n      return \"wrap-reverse\";\n  }\n  return \"unknown\";\n}\n"
  },
  {
    "path": "ReactCommon/yoga/yoga/YGEnums.h",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include \"YGMacros.h\"\n\nYG_EXTERN_C_BEGIN\n\n#define YGAlignCount 8\ntypedef YG_ENUM_BEGIN(YGAlign) {\n  YGAlignAuto,\n  YGAlignFlexStart,\n  YGAlignCenter,\n  YGAlignFlexEnd,\n  YGAlignStretch,\n  YGAlignBaseline,\n  YGAlignSpaceBetween,\n  YGAlignSpaceAround,\n} YG_ENUM_END(YGAlign);\nWIN_EXPORT const char *YGAlignToString(const YGAlign value);\n\n#define YGDimensionCount 2\ntypedef YG_ENUM_BEGIN(YGDimension) {\n  YGDimensionWidth,\n  YGDimensionHeight,\n} YG_ENUM_END(YGDimension);\nWIN_EXPORT const char *YGDimensionToString(const YGDimension value);\n\n#define YGDirectionCount 3\ntypedef YG_ENUM_BEGIN(YGDirection) {\n  YGDirectionInherit,\n  YGDirectionLTR,\n  YGDirectionRTL,\n} YG_ENUM_END(YGDirection);\nWIN_EXPORT const char *YGDirectionToString(const YGDirection value);\n\n#define YGDisplayCount 2\ntypedef YG_ENUM_BEGIN(YGDisplay) {\n  YGDisplayFlex,\n  YGDisplayNone,\n} YG_ENUM_END(YGDisplay);\nWIN_EXPORT const char *YGDisplayToString(const YGDisplay value);\n\n#define YGEdgeCount 9\ntypedef YG_ENUM_BEGIN(YGEdge) {\n  YGEdgeLeft,\n  YGEdgeTop,\n  YGEdgeRight,\n  YGEdgeBottom,\n  YGEdgeStart,\n  YGEdgeEnd,\n  YGEdgeHorizontal,\n  YGEdgeVertical,\n  YGEdgeAll,\n} YG_ENUM_END(YGEdge);\nWIN_EXPORT const char *YGEdgeToString(const YGEdge value);\n\n#define YGExperimentalFeatureCount 1\ntypedef YG_ENUM_BEGIN(YGExperimentalFeature) {\n  YGExperimentalFeatureWebFlexBasis,\n} YG_ENUM_END(YGExperimentalFeature);\nWIN_EXPORT const char *YGExperimentalFeatureToString(const YGExperimentalFeature value);\n\n#define YGFlexDirectionCount 4\ntypedef YG_ENUM_BEGIN(YGFlexDirection) {\n  YGFlexDirectionColumn,\n  YGFlexDirectionColumnReverse,\n  YGFlexDirectionRow,\n  YGFlexDirectionRowReverse,\n} YG_ENUM_END(YGFlexDirection);\nWIN_EXPORT const char *YGFlexDirectionToString(const YGFlexDirection value);\n\n#define YGJustifyCount 6\ntypedef YG_ENUM_BEGIN(YGJustify){\n    YGJustifyFlexStart,\n    YGJustifyCenter,\n    YGJustifyFlexEnd,\n    YGJustifySpaceBetween,\n    YGJustifySpaceAround,\n    YGJustifySpaceEvenly,\n} YG_ENUM_END(YGJustify);\nWIN_EXPORT const char *YGJustifyToString(const YGJustify value);\n\n#define YGLogLevelCount 6\ntypedef YG_ENUM_BEGIN(YGLogLevel) {\n  YGLogLevelError,\n  YGLogLevelWarn,\n  YGLogLevelInfo,\n  YGLogLevelDebug,\n  YGLogLevelVerbose,\n  YGLogLevelFatal,\n} YG_ENUM_END(YGLogLevel);\nWIN_EXPORT const char *YGLogLevelToString(const YGLogLevel value);\n\n#define YGMeasureModeCount 3\ntypedef YG_ENUM_BEGIN(YGMeasureMode) {\n  YGMeasureModeUndefined,\n  YGMeasureModeExactly,\n  YGMeasureModeAtMost,\n} YG_ENUM_END(YGMeasureMode);\nWIN_EXPORT const char *YGMeasureModeToString(const YGMeasureMode value);\n\n#define YGNodeTypeCount 2\ntypedef YG_ENUM_BEGIN(YGNodeType) {\n  YGNodeTypeDefault,\n  YGNodeTypeText,\n} YG_ENUM_END(YGNodeType);\nWIN_EXPORT const char *YGNodeTypeToString(const YGNodeType value);\n\n#define YGOverflowCount 3\ntypedef YG_ENUM_BEGIN(YGOverflow) {\n  YGOverflowVisible,\n  YGOverflowHidden,\n  YGOverflowScroll,\n} YG_ENUM_END(YGOverflow);\nWIN_EXPORT const char *YGOverflowToString(const YGOverflow value);\n\n#define YGPositionTypeCount 2\ntypedef YG_ENUM_BEGIN(YGPositionType) {\n  YGPositionTypeRelative,\n  YGPositionTypeAbsolute,\n} YG_ENUM_END(YGPositionType);\nWIN_EXPORT const char *YGPositionTypeToString(const YGPositionType value);\n\n#define YGPrintOptionsCount 3\ntypedef YG_ENUM_BEGIN(YGPrintOptions) {\n  YGPrintOptionsLayout = 1,\n  YGPrintOptionsStyle = 2,\n  YGPrintOptionsChildren = 4,\n} YG_ENUM_END(YGPrintOptions);\nWIN_EXPORT const char *YGPrintOptionsToString(const YGPrintOptions value);\n\n#define YGUnitCount 4\ntypedef YG_ENUM_BEGIN(YGUnit) {\n  YGUnitUndefined,\n  YGUnitPoint,\n  YGUnitPercent,\n  YGUnitAuto,\n} YG_ENUM_END(YGUnit);\nWIN_EXPORT const char *YGUnitToString(const YGUnit value);\n\n#define YGWrapCount 3\ntypedef YG_ENUM_BEGIN(YGWrap) {\n  YGWrapNoWrap,\n  YGWrapWrap,\n  YGWrapWrapReverse,\n} YG_ENUM_END(YGWrap);\nWIN_EXPORT const char *YGWrapToString(const YGWrap value);\n\nYG_EXTERN_C_END\n"
  },
  {
    "path": "ReactCommon/yoga/yoga/YGMacros.h",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#ifdef __cplusplus\n#define YG_EXTERN_C_BEGIN extern \"C\" {\n#define YG_EXTERN_C_END }\n#else\n#define YG_EXTERN_C_BEGIN\n#define YG_EXTERN_C_END\n#endif\n\n#ifdef _WINDLL\n#define WIN_EXPORT __declspec(dllexport)\n#else\n#define WIN_EXPORT\n#endif\n\n#ifdef WINARMDLL\n#define WIN_STRUCT(type) type *\n#define WIN_STRUCT_REF(value) &value\n#else\n#define WIN_STRUCT(type) type\n#define WIN_STRUCT_REF(value) value\n#endif\n\n#ifdef NS_ENUM\n// Cannot use NSInteger as NSInteger has a different size than int (which is the default type of a\n// enum).\n// Therefor when linking the Yoga C library into obj-c the header is a missmatch for the Yoga ABI.\n#define YG_ENUM_BEGIN(name) NS_ENUM(int, name)\n#define YG_ENUM_END(name)\n#else\n#define YG_ENUM_BEGIN(name) enum name\n#define YG_ENUM_END(name) name\n#endif\n"
  },
  {
    "path": "ReactCommon/yoga/yoga/YGNode.cpp",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"YGNode.h\"\n#include <iostream>\n\nvoid* YGNode::getContext() const {\n  return context_;\n}\n\nYGPrintFunc YGNode::getPrintFunc() const {\n  return print_;\n}\n\nbool YGNode::getHasNewLayout() const {\n  return hasNewLayout_;\n}\n\nYGNodeType YGNode::getNodeType() const {\n  return nodeType_;\n}\n\nYGMeasureFunc YGNode::getMeasure() const {\n  return measure_;\n}\n\nYGBaselineFunc YGNode::getBaseline() const {\n  return baseline_;\n}\n\nYGStyle& YGNode::getStyle() {\n  return style_;\n}\n\nYGLayout& YGNode::getLayout() {\n  return layout_;\n}\n\nuint32_t YGNode::getLineIndex() const {\n  return lineIndex_;\n}\n\nYGNodeRef YGNode::getParent() const {\n  return parent_;\n}\n\nYGVector YGNode::getChildren() const {\n  return children_;\n}\n\nYGNodeRef YGNode::getChild(uint32_t index) const {\n  return children_.at(index);\n}\n\nYGNodeRef YGNode::getNextChild() const {\n  return nextChild_;\n}\n\nYGConfigRef YGNode::getConfig() const {\n  return config_;\n}\n\nbool YGNode::isDirty() const {\n  return isDirty_;\n}\n\nYGValue YGNode::getResolvedDimension(int index) {\n  return resolvedDimensions_[index];\n}\n\nstd::array<YGValue, 2> YGNode::getResolvedDimensions() const {\n  return resolvedDimensions_;\n}\n// Setters\n\nvoid YGNode::setContext(void* context) {\n  context_ = context;\n}\n\nvoid YGNode::setPrintFunc(YGPrintFunc printFunc) {\n  print_ = printFunc;\n}\n\nvoid YGNode::setHasNewLayout(bool hasNewLayout) {\n  hasNewLayout_ = hasNewLayout;\n}\n\nvoid YGNode::setNodeType(YGNodeType nodeType) {\n  nodeType_ = nodeType;\n}\n\nvoid YGNode::setStyleFlexDirection(YGFlexDirection direction) {\n  style_.flexDirection = direction;\n}\n\nvoid YGNode::setStyleAlignContent(YGAlign alignContent) {\n  style_.alignContent = alignContent;\n}\n\nvoid YGNode::setMeasureFunc(YGMeasureFunc measureFunc) {\n  if (measureFunc == nullptr) {\n    measure_ = nullptr;\n    // TODO: t18095186 Move nodeType to opt-in function and mark appropriate\n    // places in Litho\n    nodeType_ = YGNodeTypeDefault;\n  } else {\n    YGAssertWithNode(\n        this,\n        children_.size() == 0,\n        \"Cannot set measure function: Nodes with measure functions cannot have children.\");\n    measure_ = measureFunc;\n    // TODO: t18095186 Move nodeType to opt-in function and mark appropriate\n    // places in Litho\n    setNodeType(YGNodeTypeText);\n  }\n\n  measure_ = measureFunc;\n}\n\nvoid YGNode::setBaseLineFunc(YGBaselineFunc baseLineFunc) {\n  baseline_ = baseLineFunc;\n}\n\nvoid YGNode::setStyle(YGStyle style) {\n  style_ = style;\n}\n\nvoid YGNode::setLayout(YGLayout layout) {\n  layout_ = layout;\n}\n\nvoid YGNode::setLineIndex(uint32_t lineIndex) {\n  lineIndex_ = lineIndex;\n}\n\nvoid YGNode::setParent(YGNodeRef parent) {\n  parent_ = parent;\n}\n\nvoid YGNode::setChildren(YGVector children) {\n  children_ = children;\n}\n\nvoid YGNode::setNextChild(YGNodeRef nextChild) {\n  nextChild_ = nextChild;\n}\n\nvoid YGNode::replaceChild(YGNodeRef child, uint32_t index) {\n  children_[index] = child;\n}\n\nvoid YGNode::replaceChild(YGNodeRef oldChild, YGNodeRef newChild) {\n  std::replace(children_.begin(), children_.end(), oldChild, newChild);\n}\n\nvoid YGNode::insertChild(YGNodeRef child, uint32_t index) {\n  children_.insert(children_.begin() + index, child);\n}\n\nvoid YGNode::setConfig(YGConfigRef config) {\n  config_ = config;\n}\n\nvoid YGNode::setDirty(bool isDirty) {\n  isDirty_ = isDirty;\n}\n\nbool YGNode::removeChild(YGNodeRef child) {\n  std::vector<YGNodeRef>::iterator p =\n      std::find(children_.begin(), children_.end(), child);\n  if (p != children_.end()) {\n    children_.erase(p);\n    return true;\n  }\n  return false;\n}\n\nvoid YGNode::removeChild(uint32_t index) {\n  children_.erase(children_.begin() + index);\n}\n\nvoid YGNode::setLayoutDirection(YGDirection direction) {\n  layout_.direction = direction;\n}\n\nvoid YGNode::setLayoutMargin(float margin, int index) {\n  layout_.margin[index] = margin;\n}\n\nvoid YGNode::setLayoutBorder(float border, int index) {\n  layout_.border[index] = border;\n}\n\nvoid YGNode::setLayoutPadding(float padding, int index) {\n  layout_.padding[index] = padding;\n}\n\nvoid YGNode::setLayoutLastParentDirection(YGDirection direction) {\n  layout_.lastParentDirection = direction;\n}\n\nvoid YGNode::setLayoutComputedFlexBasis(float computedFlexBasis) {\n  layout_.computedFlexBasis = computedFlexBasis;\n}\n\nvoid YGNode::setLayoutPosition(float position, int index) {\n  layout_.position[index] = position;\n}\n\nvoid YGNode::setLayoutComputedFlexBasisGeneration(\n    uint32_t computedFlexBasisGeneration) {\n  layout_.computedFlexBasisGeneration = computedFlexBasisGeneration;\n}\n\nvoid YGNode::setLayoutMeasuredDimension(float measuredDimension, int index) {\n  layout_.measuredDimensions[index] = measuredDimension;\n}\n\nvoid YGNode::setLayoutHadOverflow(bool hadOverflow) {\n  layout_.hadOverflow = hadOverflow;\n}\n\nvoid YGNode::setLayoutDimension(float dimension, int index) {\n  layout_.dimensions[index] = dimension;\n}\n\nYGNode::YGNode()\n    : context_(nullptr),\n      print_(nullptr),\n      hasNewLayout_(true),\n      nodeType_(YGNodeTypeDefault),\n      measure_(nullptr),\n      baseline_(nullptr),\n      style_(gYGNodeStyleDefaults),\n      layout_(gYGNodeLayoutDefaults),\n      lineIndex_(0),\n      parent_(nullptr),\n      children_(YGVector()),\n      nextChild_(nullptr),\n      config_(nullptr),\n      isDirty_(false),\n      resolvedDimensions_({{YGValueUndefined, YGValueUndefined}}) {}\n\nYGNode::YGNode(const YGNode& node)\n    : context_(node.context_),\n      print_(node.print_),\n      hasNewLayout_(node.hasNewLayout_),\n      nodeType_(node.nodeType_),\n      measure_(node.measure_),\n      baseline_(node.baseline_),\n      style_(node.style_),\n      layout_(node.layout_),\n      lineIndex_(node.lineIndex_),\n      parent_(node.parent_),\n      children_(node.children_),\n      nextChild_(node.nextChild_),\n      config_(node.config_),\n      isDirty_(node.isDirty_),\n      resolvedDimensions_(node.resolvedDimensions_) {}\n\nYGNode::YGNode(const YGConfigRef newConfig) : YGNode() {\n  config_ = newConfig;\n}\n\nYGNode::YGNode(\n    void* context,\n    YGPrintFunc print,\n    bool hasNewLayout,\n    YGNodeType nodeType,\n    YGMeasureFunc measure,\n    YGBaselineFunc baseline,\n    YGStyle style,\n    YGLayout layout,\n    uint32_t lineIndex,\n    YGNodeRef parent,\n    YGVector children,\n    YGNodeRef nextChild,\n    YGConfigRef config,\n    bool isDirty,\n    std::array<YGValue, 2> resolvedDimensions)\n    : context_(context),\n      print_(print),\n      hasNewLayout_(hasNewLayout),\n      nodeType_(nodeType),\n      measure_(measure),\n      baseline_(baseline),\n      style_(style),\n      layout_(layout),\n      lineIndex_(lineIndex),\n      parent_(parent),\n      children_(children),\n      nextChild_(nextChild),\n      config_(config),\n      isDirty_(isDirty),\n      resolvedDimensions_(resolvedDimensions) {}\n\nYGNode& YGNode::operator=(const YGNode& node) {\n  if (&node == this) {\n    return *this;\n  }\n\n  for (auto child : children_) {\n    delete child;\n  }\n\n  context_ = node.getContext();\n  print_ = node.getPrintFunc();\n  hasNewLayout_ = node.getHasNewLayout();\n  nodeType_ = node.getNodeType();\n  measure_ = node.getMeasure();\n  baseline_ = node.getBaseline();\n  style_ = node.style_;\n  layout_ = node.layout_;\n  lineIndex_ = node.getLineIndex();\n  parent_ = node.getParent();\n  children_ = node.getChildren();\n  nextChild_ = node.getNextChild();\n  config_ = node.getConfig();\n  isDirty_ = node.isDirty();\n  resolvedDimensions_ = node.getResolvedDimensions();\n\n  return *this;\n}\n\nYGValue YGNode::marginLeadingValue(const YGFlexDirection axis) const {\n  if (YGFlexDirectionIsRow(axis) &&\n      style_.margin[YGEdgeStart].unit != YGUnitUndefined) {\n    return style_.margin[YGEdgeStart];\n  } else {\n    return style_.margin[leading[axis]];\n  }\n}\n\nYGValue YGNode::marginTrailingValue(const YGFlexDirection axis) const {\n  if (YGFlexDirectionIsRow(axis) &&\n      style_.margin[YGEdgeEnd].unit != YGUnitUndefined) {\n    return style_.margin[YGEdgeEnd];\n  } else {\n    return style_.margin[trailing[axis]];\n  }\n}\n\nYGValue YGNode::resolveFlexBasisPtr() const {\n  YGValue flexBasis = style_.flexBasis;\n  if (flexBasis.unit != YGUnitAuto && flexBasis.unit != YGUnitUndefined) {\n    return flexBasis;\n  }\n  if (!YGFloatIsUndefined(style_.flex) && style_.flex > 0.0f) {\n    return config_->useWebDefaults ? YGValueAuto : YGValueZero;\n  }\n  return YGValueAuto;\n}\n\nvoid YGNode::resolveDimension() {\n  for (uint32_t dim = YGDimensionWidth; dim < YGDimensionCount; dim++) {\n    if (getStyle().maxDimensions[dim].unit != YGUnitUndefined &&\n        YGValueEqual(\n            getStyle().maxDimensions[dim], style_.minDimensions[dim])) {\n      resolvedDimensions_[dim] = style_.maxDimensions[dim];\n    } else {\n      resolvedDimensions_[dim] = style_.dimensions[dim];\n    }\n  }\n}\n\nvoid YGNode::clearChildren() {\n  children_.clear();\n  children_.shrink_to_fit();\n}\n\nYGNode::~YGNode() {\n  // All the member variables are deallocated externally, so no need to\n  // deallocate here\n}\n\n// Other Methods\n\nvoid YGNode::cloneChildrenIfNeeded() {\n  // YGNodeRemoveChild in yoga.cpp has a forked variant of this algorithm\n  // optimized for deletions.\n\n  const uint32_t childCount = children_.size();\n  if (childCount == 0) {\n    // This is an empty set. Nothing to clone.\n    return;\n  }\n\n  const YGNodeRef firstChild = children_.front();\n  if (firstChild->getParent() == this) {\n    // If the first child has this node as its parent, we assume that it is\n    // already unique. We can do this because if we have it has a child, that\n    // means that its parent was at some point cloned which made that subtree\n    // immutable. We also assume that all its sibling are cloned as well.\n    return;\n  }\n\n  const YGNodeClonedFunc cloneNodeCallback = config_->cloneNodeCallback;\n  for (uint32_t i = 0; i < childCount; ++i) {\n    const YGNodeRef oldChild = children_[i];\n    const YGNodeRef newChild = YGNodeClone(oldChild);\n    replaceChild(newChild, i);\n    newChild->setParent(this);\n    if (cloneNodeCallback) {\n      cloneNodeCallback(oldChild, newChild, this, i);\n    }\n  }\n}\n\nvoid YGNode::markDirtyAndPropogate() {\n  if (!isDirty_) {\n    isDirty_ = true;\n    setLayoutComputedFlexBasis(YGUndefined);\n    if (parent_) {\n      parent_->markDirtyAndPropogate();\n    }\n  }\n}\n\nfloat YGNode::resolveFlexGrow() {\n  // Root nodes flexGrow should always be 0\n  if (parent_ == nullptr) {\n    return 0.0;\n  }\n  if (!YGFloatIsUndefined(style_.flexGrow)) {\n    return style_.flexGrow;\n  }\n  if (!YGFloatIsUndefined(style_.flex) && style_.flex > 0.0f) {\n    return style_.flex;\n  }\n  return kDefaultFlexGrow;\n}\n\nfloat YGNode::resolveFlexShrink() {\n  if (parent_ == nullptr) {\n    return 0.0;\n  }\n  if (!YGFloatIsUndefined(style_.flexShrink)) {\n    return style_.flexShrink;\n  }\n  if (!config_->useWebDefaults && !YGFloatIsUndefined(style_.flex) &&\n      style_.flex < 0.0f) {\n    return -style_.flex;\n  }\n  return config_->useWebDefaults ? kWebDefaultFlexShrink : kDefaultFlexShrink;\n}\n"
  },
  {
    "path": "ReactCommon/yoga/yoga/YGNode.h",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n#include <stdio.h>\n\n#include \"Yoga-internal.h\"\n\nstruct YGNode {\n private:\n  void* context_;\n  YGPrintFunc print_;\n  bool hasNewLayout_;\n  YGNodeType nodeType_;\n  YGMeasureFunc measure_;\n  YGBaselineFunc baseline_;\n  YGStyle style_;\n  YGLayout layout_;\n  uint32_t lineIndex_;\n  YGNodeRef parent_;\n  YGVector children_;\n  YGNodeRef nextChild_;\n  YGConfigRef config_;\n  bool isDirty_;\n  std::array<YGValue, 2> resolvedDimensions_;\n\n public:\n  YGNode();\n  ~YGNode();\n  explicit YGNode(const YGConfigRef newConfig);\n  YGNode(const YGNode& node);\n  YGNode& operator=(const YGNode& node);\n  YGNode(\n      void* context,\n      YGPrintFunc print,\n      bool hasNewLayout,\n      YGNodeType nodeType,\n      YGMeasureFunc measure,\n      YGBaselineFunc baseline,\n      YGStyle style,\n      YGLayout layout,\n      uint32_t lineIndex,\n      YGNodeRef parent,\n      YGVector children,\n      YGNodeRef nextChild,\n      YGConfigRef config,\n      bool isDirty,\n      std::array<YGValue, 2> resolvedDimensions);\n\n  // Getters\n  void* getContext() const;\n  YGPrintFunc getPrintFunc() const;\n  bool getHasNewLayout() const;\n  YGNodeType getNodeType() const;\n  YGMeasureFunc getMeasure() const;\n  YGBaselineFunc getBaseline() const;\n  // For Perfomance reasons passing as reference.\n  YGStyle& getStyle();\n  // For Perfomance reasons passing as reference.\n  YGLayout& getLayout();\n  uint32_t getLineIndex() const;\n  YGNodeRef getParent() const;\n  YGVector getChildren() const;\n  YGNodeRef getChild(uint32_t index) const;\n  YGNodeRef getNextChild() const;\n  YGConfigRef getConfig() const;\n  bool isDirty() const;\n  std::array<YGValue, 2> getResolvedDimensions() const;\n  YGValue getResolvedDimension(int index);\n\n  // Setters\n\n  void setContext(void* context);\n  void setPrintFunc(YGPrintFunc printFunc);\n  void setHasNewLayout(bool hasNewLayout);\n  void setNodeType(YGNodeType nodeTye);\n  void setMeasureFunc(YGMeasureFunc measureFunc);\n  void setBaseLineFunc(YGBaselineFunc baseLineFunc);\n  void setStyle(YGStyle style);\n  void setStyleFlexDirection(YGFlexDirection direction);\n  void setStyleAlignContent(YGAlign alignContent);\n  void setLayout(YGLayout layout);\n  void setLineIndex(uint32_t lineIndex);\n  void setParent(YGNodeRef parent);\n  void setChildren(YGVector children);\n  void setNextChild(YGNodeRef nextChild);\n  void setConfig(YGConfigRef config);\n  void setDirty(bool isDirty);\n  void setLayoutLastParentDirection(YGDirection direction);\n  void setLayoutComputedFlexBasis(float computedFlexBasis);\n  void setLayoutComputedFlexBasisGeneration(\n      uint32_t computedFlexBasisGeneration);\n  void setLayoutMeasuredDimension(float measuredDimension, int index);\n  void setLayoutHadOverflow(bool hadOverflow);\n  void setLayoutDimension(float dimension, int index);\n\n  // Other methods\n  YGValue marginLeadingValue(const YGFlexDirection axis) const;\n  YGValue marginTrailingValue(const YGFlexDirection axis) const;\n  YGValue resolveFlexBasisPtr() const;\n  void resolveDimension();\n  void clearChildren();\n  /// Replaces the occurrences of oldChild with newChild\n  void replaceChild(YGNodeRef oldChild, YGNodeRef newChild);\n  void replaceChild(YGNodeRef child, uint32_t index);\n  void insertChild(YGNodeRef child, uint32_t index);\n  /// Removes the first occurrence of child\n  bool removeChild(YGNodeRef child);\n  void removeChild(uint32_t index);\n  void setLayoutDirection(YGDirection direction);\n  void setLayoutMargin(float margin, int index);\n  void setLayoutBorder(float border, int index);\n  void setLayoutPadding(float padding, int index);\n  void setLayoutPosition(float position, int index);\n\n  // Other methods\n  void cloneChildrenIfNeeded();\n  void markDirtyAndPropogate();\n  float resolveFlexGrow();\n  float resolveFlexShrink();\n};\n"
  },
  {
    "path": "ReactCommon/yoga/yoga/YGNodePrint.cpp",
    "content": "/*\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"YGNodePrint.h\"\n#include <stdarg.h>\n#include \"YGEnums.h\"\n#include \"YGNode.h\"\n#include \"Yoga-internal.h\"\n\nnamespace facebook {\nnamespace yoga {\ntypedef std::string string;\n\nstatic void indent(string* base, uint32_t level) {\n  for (uint32_t i = 0; i < level; ++i) {\n    base->append(\"  \");\n  }\n}\n\nstatic bool areFourValuesEqual(const std::array<YGValue, YGEdgeCount>& four) {\n  return YGValueEqual(four[0], four[1]) && YGValueEqual(four[0], four[2]) &&\n      YGValueEqual(four[0], four[3]);\n}\n\nstatic void appendFormatedString(string* str, const char* fmt, ...) {\n  char buffer[1024];\n  va_list args;\n  va_start(args, fmt);\n  va_list argsCopy;\n  va_copy(argsCopy, args);\n  va_end(args);\n  vsnprintf(buffer, 1024, fmt, argsCopy);\n  va_end(argsCopy);\n  string result = string(buffer);\n  str->append(result);\n}\n\nstatic void\nappendFloatIfNotUndefined(string* base, const string key, const float num) {\n  if (!YGFloatIsUndefined(num)) {\n    appendFormatedString(base, \"%s: %g; \", key.c_str(), num);\n  }\n}\n\nstatic void appendNumberIfNotUndefined(\n    string* base,\n    const string key,\n    const YGValue number) {\n  if (number.unit != YGUnitUndefined) {\n    if (number.unit == YGUnitAuto) {\n      base->append(key + \": auto; \");\n    } else {\n      string unit = number.unit == YGUnitPoint ? \"px\" : \"%%\";\n      appendFormatedString(\n          base, \"%s: %g%s; \", key.c_str(), number.value, unit.c_str());\n    }\n  }\n}\n\nstatic void\nappendNumberIfNotAuto(string* base, const string& key, const YGValue number) {\n  if (number.unit != YGUnitAuto) {\n    appendNumberIfNotUndefined(base, key, number);\n  }\n}\n\nstatic void\nappendNumberIfNotZero(string* base, const string& str, const YGValue number) {\n  if (!YGFloatsEqual(number.value, 0)) {\n    appendNumberIfNotUndefined(base, str, number);\n  }\n}\n\nstatic void appendEdges(\n    string* base,\n    const string& key,\n    const std::array<YGValue, YGEdgeCount>& edges) {\n  if (areFourValuesEqual(edges)) {\n    appendNumberIfNotZero(base, key, edges[YGEdgeLeft]);\n  } else {\n    for (int edge = YGEdgeLeft; edge != YGEdgeAll; ++edge) {\n      string str = key + \"-\" + YGEdgeToString(static_cast<YGEdge>(edge));\n      appendNumberIfNotZero(base, str, edges[edge]);\n    }\n  }\n}\n\nstatic void appendEdgeIfNotUndefined(\n    string* base,\n    const string& str,\n    const std::array<YGValue, YGEdgeCount>& edges,\n    const YGEdge edge) {\n  appendNumberIfNotUndefined(\n      base, str, *YGComputedEdgeValue(edges, edge, &YGValueUndefined));\n}\n\nvoid YGNodeToString(\n    std::string* str,\n    YGNodeRef node,\n    YGPrintOptions options,\n    uint32_t level) {\n  indent(str, level);\n  appendFormatedString(str, \"<div \");\n  if (node->getPrintFunc() != nullptr) {\n    node->getPrintFunc()(node);\n  }\n\n  if (options & YGPrintOptionsLayout) {\n    appendFormatedString(str, \"layout=\\\"\");\n    appendFormatedString(\n        str, \"width: %g; \", node->getLayout().dimensions[YGDimensionWidth]);\n    appendFormatedString(\n        str, \"height: %g; \", node->getLayout().dimensions[YGDimensionHeight]);\n    appendFormatedString(\n        str, \"top: %g; \", node->getLayout().position[YGEdgeTop]);\n    appendFormatedString(\n        str, \"left: %g;\", node->getLayout().position[YGEdgeLeft]);\n    appendFormatedString(str, \"\\\" \");\n  }\n\n  if (options & YGPrintOptionsStyle) {\n    appendFormatedString(str, \"style=\\\"\");\n    if (node->getStyle().flexDirection != YGNode().getStyle().flexDirection) {\n      appendFormatedString(\n          str,\n          \"flex-direction: %s; \",\n          YGFlexDirectionToString(node->getStyle().flexDirection));\n    }\n    if (node->getStyle().justifyContent != YGNode().getStyle().justifyContent) {\n      appendFormatedString(\n          str,\n          \"justify-content: %s; \",\n          YGJustifyToString(node->getStyle().justifyContent));\n    }\n    if (node->getStyle().alignItems != YGNode().getStyle().alignItems) {\n      appendFormatedString(\n          str,\n          \"align-items: %s; \",\n          YGAlignToString(node->getStyle().alignItems));\n    }\n    if (node->getStyle().alignContent != YGNode().getStyle().alignContent) {\n      appendFormatedString(\n          str,\n          \"align-content: %s; \",\n          YGAlignToString(node->getStyle().alignContent));\n    }\n    if (node->getStyle().alignSelf != YGNode().getStyle().alignSelf) {\n      appendFormatedString(\n          str, \"align-self: %s; \", YGAlignToString(node->getStyle().alignSelf));\n    }\n    appendFloatIfNotUndefined(str, \"flex-grow\", node->getStyle().flexGrow);\n    appendFloatIfNotUndefined(str, \"flex-shrink\", node->getStyle().flexShrink);\n    appendNumberIfNotAuto(str, \"flex-basis\", node->getStyle().flexBasis);\n    appendFloatIfNotUndefined(str, \"flex\", node->getStyle().flex);\n\n    if (node->getStyle().flexWrap != YGNode().getStyle().flexWrap) {\n      appendFormatedString(\n          str, \"flexWrap: %s; \", YGWrapToString(node->getStyle().flexWrap));\n    }\n\n    if (node->getStyle().overflow != YGNode().getStyle().overflow) {\n      appendFormatedString(\n          str, \"overflow: %s; \", YGOverflowToString(node->getStyle().overflow));\n    }\n\n    if (node->getStyle().display != YGNode().getStyle().display) {\n      appendFormatedString(\n          str, \"display: %s; \", YGDisplayToString(node->getStyle().display));\n    }\n    appendEdges(str, \"margin\", node->getStyle().margin);\n    appendEdges(str, \"padding\", node->getStyle().padding);\n    appendEdges(str, \"border\", node->getStyle().border);\n\n    appendNumberIfNotAuto(\n        str, \"width\", node->getStyle().dimensions[YGDimensionWidth]);\n    appendNumberIfNotAuto(\n        str, \"height\", node->getStyle().dimensions[YGDimensionHeight]);\n    appendNumberIfNotAuto(\n        str, \"max-width\", node->getStyle().maxDimensions[YGDimensionWidth]);\n    appendNumberIfNotAuto(\n        str, \"max-height\", node->getStyle().maxDimensions[YGDimensionHeight]);\n    appendNumberIfNotAuto(\n        str, \"min-width\", node->getStyle().minDimensions[YGDimensionWidth]);\n    appendNumberIfNotAuto(\n        str, \"min-height\", node->getStyle().minDimensions[YGDimensionHeight]);\n\n    if (node->getStyle().positionType != YGNode().getStyle().positionType) {\n      appendFormatedString(\n          str,\n          \"position: %s; \",\n          YGPositionTypeToString(node->getStyle().positionType));\n    }\n\n    appendEdgeIfNotUndefined(\n        str, \"left\", node->getStyle().position, YGEdgeLeft);\n    appendEdgeIfNotUndefined(\n        str, \"right\", node->getStyle().position, YGEdgeRight);\n    appendEdgeIfNotUndefined(str, \"top\", node->getStyle().position, YGEdgeTop);\n    appendEdgeIfNotUndefined(\n        str, \"bottom\", node->getStyle().position, YGEdgeBottom);\n    appendFormatedString(str, \"\\\" \");\n\n    if (node->getMeasure() != nullptr) {\n      appendFormatedString(str, \"has-custom-measure=\\\"true\\\"\");\n    }\n  }\n  appendFormatedString(str, \">\");\n\n  const uint32_t childCount = node->getChildren().size();\n  if (options & YGPrintOptionsChildren && childCount > 0) {\n    for (uint32_t i = 0; i < childCount; i++) {\n      appendFormatedString(str, \"\\n\");\n      YGNodeToString(str, YGNodeGetChild(node, i), options, level + 1);\n    }\n    appendFormatedString(str, \"\\n\");\n    indent(str, level);\n  }\n  appendFormatedString(str, \"</div>\");\n}\n} // namespace yoga\n} // namespace facebook\n"
  },
  {
    "path": "ReactCommon/yoga/yoga/YGNodePrint.h",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n#pragma once\n#include <string>\n\n#include \"Yoga.h\"\n\nnamespace facebook {\nnamespace yoga {\n\nvoid YGNodeToString(\n    std::string* str,\n    YGNodeRef node,\n    YGPrintOptions options,\n    uint32_t level);\n\n} // namespace yoga\n} // namespace facebook\n"
  },
  {
    "path": "ReactCommon/yoga/yoga/Yoga-internal.h",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n#include <algorithm>\n#include <array>\n#include <cmath>\n#include <vector>\n\n#include \"Yoga.h\"\n\nusing YGVector = std::vector<YGNodeRef>;\n\nYG_EXTERN_C_BEGIN\n\nWIN_EXPORT float YGRoundValueToPixelGrid(const float value,\n                                         const float pointScaleFactor,\n                                         const bool forceCeil,\n                                         const bool forceFloor);\n\nYG_EXTERN_C_END\n\nextern const std::array<YGEdge, 4> trailing;\nextern const std::array<YGEdge, 4> leading;\nextern bool YGFlexDirectionIsRow(const YGFlexDirection flexDirection);\nextern bool YGValueEqual(const YGValue a, const YGValue b);\nextern const YGValue YGValueUndefined;\nextern const YGValue YGValueAuto;\nextern const YGValue YGValueZero;\n\ntemplate <std::size_t size>\nbool YGValueArrayEqual(\n    const std::array<YGValue, size> val1,\n    const std::array<YGValue, size> val2) {\n  bool areEqual = true;\n  for (uint32_t i = 0; i < size && areEqual; ++i) {\n    areEqual = YGValueEqual(val1[i], val2[i]);\n  }\n  return areEqual;\n}\n\ntypedef struct YGCachedMeasurement {\n  float availableWidth;\n  float availableHeight;\n  YGMeasureMode widthMeasureMode;\n  YGMeasureMode heightMeasureMode;\n\n  float computedWidth;\n  float computedHeight;\n} YGCachedMeasurement;\n\n// This value was chosen based on empiracle data. Even the most complicated\n// layouts should not require more than 16 entries to fit within the cache.\n#define YG_MAX_CACHED_RESULT_COUNT 16\n\nstruct YGLayout {\n  std::array<float, 4> position;\n  std::array<float, 2> dimensions;\n  std::array<float, 6> margin;\n  std::array<float, 6> border;\n  std::array<float, 6> padding;\n  YGDirection direction;\n\n  uint32_t computedFlexBasisGeneration;\n  float computedFlexBasis;\n  bool hadOverflow;\n\n  // Instead of recomputing the entire layout every single time, we\n  // cache some information to break early when nothing changed\n  uint32_t generationCount;\n  YGDirection lastParentDirection;\n\n  uint32_t nextCachedMeasurementsIndex;\n  YGCachedMeasurement cachedMeasurements[YG_MAX_CACHED_RESULT_COUNT];\n  std::array<float, 2> measuredDimensions;\n\n  YGCachedMeasurement cachedLayout;\n};\n\nstruct YGStyle {\n  YGDirection direction;\n  YGFlexDirection flexDirection;\n  YGJustify justifyContent;\n  YGAlign alignContent;\n  YGAlign alignItems;\n  YGAlign alignSelf;\n  YGPositionType positionType;\n  YGWrap flexWrap;\n  YGOverflow overflow;\n  YGDisplay display;\n  float flex;\n  float flexGrow;\n  float flexShrink;\n  YGValue flexBasis;\n  std::array<YGValue, YGEdgeCount> margin;\n  std::array<YGValue, YGEdgeCount> position;\n  std::array<YGValue, YGEdgeCount> padding;\n  std::array<YGValue, YGEdgeCount> border;\n  std::array<YGValue, 2> dimensions;\n  std::array<YGValue, 2> minDimensions;\n  std::array<YGValue, 2> maxDimensions;\n\n  // Yoga specific properties, not compatible with flexbox specification\n  float aspectRatio;\n  bool operator==(YGStyle style) {\n    bool areNonFloatValuesEqual = direction == style.direction &&\n        flexDirection == style.flexDirection &&\n        justifyContent == style.justifyContent &&\n        alignContent == style.alignContent && alignItems == style.alignItems &&\n        alignSelf == style.alignSelf && positionType == style.positionType &&\n        flexWrap == style.flexWrap && overflow == style.overflow &&\n        display == style.display && YGValueEqual(flexBasis, style.flexBasis) &&\n        YGValueArrayEqual(margin, style.margin) &&\n        YGValueArrayEqual(position, style.position) &&\n        YGValueArrayEqual(padding, style.padding) &&\n        YGValueArrayEqual(border, style.border) &&\n        YGValueArrayEqual(dimensions, style.dimensions) &&\n        YGValueArrayEqual(minDimensions, style.minDimensions) &&\n        YGValueArrayEqual(maxDimensions, style.maxDimensions);\n\n    if (!(std::isnan(flex) && std::isnan(style.flex))) {\n      areNonFloatValuesEqual = areNonFloatValuesEqual && flex == style.flex;\n    }\n\n    if (!(std::isnan(flexGrow) && std::isnan(style.flexGrow))) {\n      areNonFloatValuesEqual =\n          areNonFloatValuesEqual && flexGrow == style.flexGrow;\n    }\n\n    if (!(std::isnan(flexShrink) && std::isnan(style.flexShrink))) {\n      areNonFloatValuesEqual =\n          areNonFloatValuesEqual && flexShrink == style.flexShrink;\n    }\n\n    if (!(std::isnan(aspectRatio) && std::isnan(style.aspectRatio))) {\n      areNonFloatValuesEqual =\n          areNonFloatValuesEqual && aspectRatio == style.aspectRatio;\n    }\n\n    return areNonFloatValuesEqual;\n  }\n\n  bool operator!=(YGStyle style) {\n    return !(*this == style);\n  }\n};\n\ntypedef struct YGConfig {\n  bool experimentalFeatures[YGExperimentalFeatureCount + 1];\n  bool useWebDefaults;\n  bool useLegacyStretchBehaviour;\n  float pointScaleFactor;\n  YGLogger logger;\n  YGNodeClonedFunc cloneNodeCallback;\n  void* context;\n} YGConfig;\n\n#define YG_UNDEFINED_VALUES \\\n  { .value = YGUndefined, .unit = YGUnitUndefined }\n\n#define YG_AUTO_VALUES \\\n  { .value = YGUndefined, .unit = YGUnitAuto }\n\n#define YG_DEFAULT_EDGE_VALUES_UNIT                                            \\\n  {                                                                            \\\n    [YGEdgeLeft] = YG_UNDEFINED_VALUES, [YGEdgeTop] = YG_UNDEFINED_VALUES,     \\\n    [YGEdgeRight] = YG_UNDEFINED_VALUES, [YGEdgeBottom] = YG_UNDEFINED_VALUES, \\\n    [YGEdgeStart] = YG_UNDEFINED_VALUES, [YGEdgeEnd] = YG_UNDEFINED_VALUES,    \\\n    [YGEdgeHorizontal] = YG_UNDEFINED_VALUES,                                  \\\n    [YGEdgeVertical] = YG_UNDEFINED_VALUES, [YGEdgeAll] = YG_UNDEFINED_VALUES, \\\n  }\n\n#define YG_DEFAULT_DIMENSION_VALUES \\\n  { [YGDimensionWidth] = YGUndefined, [YGDimensionHeight] = YGUndefined, }\n\n#define YG_DEFAULT_DIMENSION_VALUES_UNIT       \\\n  {                                            \\\n    [YGDimensionWidth] = YG_UNDEFINED_VALUES,  \\\n    [YGDimensionHeight] = YG_UNDEFINED_VALUES, \\\n  }\n\n#define YG_DEFAULT_DIMENSION_VALUES_AUTO_UNIT \\\n  { [YGDimensionWidth] = YG_AUTO_VALUES, [YGDimensionHeight] = YG_AUTO_VALUES, }\n\nstatic const float kDefaultFlexGrow = 0.0f;\nstatic const float kDefaultFlexShrink = 0.0f;\nstatic const float kWebDefaultFlexShrink = 1.0f;\n\nstatic const YGStyle gYGNodeStyleDefaults = {\n    .direction = YGDirectionInherit,\n    .flexDirection = YGFlexDirectionColumn,\n    .justifyContent = YGJustifyFlexStart,\n    .alignContent = YGAlignFlexStart,\n    .alignItems = YGAlignStretch,\n    .alignSelf = YGAlignAuto,\n    .positionType = YGPositionTypeRelative,\n    .flexWrap = YGWrapNoWrap,\n    .overflow = YGOverflowVisible,\n    .display = YGDisplayFlex,\n    .flex = YGUndefined,\n    .flexGrow = YGUndefined,\n    .flexShrink = YGUndefined,\n    .flexBasis = YG_AUTO_VALUES,\n    .margin = {{YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES}},\n    .position = {{YG_UNDEFINED_VALUES,\n                  YG_UNDEFINED_VALUES,\n                  YG_UNDEFINED_VALUES,\n                  YG_UNDEFINED_VALUES,\n                  YG_UNDEFINED_VALUES,\n                  YG_UNDEFINED_VALUES,\n                  YG_UNDEFINED_VALUES,\n                  YG_UNDEFINED_VALUES,\n                  YG_UNDEFINED_VALUES}},\n    .padding = {{YG_UNDEFINED_VALUES,\n                 YG_UNDEFINED_VALUES,\n                 YG_UNDEFINED_VALUES,\n                 YG_UNDEFINED_VALUES,\n                 YG_UNDEFINED_VALUES,\n                 YG_UNDEFINED_VALUES,\n                 YG_UNDEFINED_VALUES,\n                 YG_UNDEFINED_VALUES,\n                 YG_UNDEFINED_VALUES}},\n    .border = {{YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES,\n                YG_UNDEFINED_VALUES}},\n    .dimensions = {{YG_AUTO_VALUES, YG_AUTO_VALUES}},\n    .minDimensions = {{YG_UNDEFINED_VALUES, YG_UNDEFINED_VALUES}},\n    .maxDimensions = {{YG_UNDEFINED_VALUES, YG_UNDEFINED_VALUES}},\n    .aspectRatio = YGUndefined,\n};\n\nstatic const YGLayout gYGNodeLayoutDefaults = {\n    .position = {},\n    .dimensions = {{YGUndefined, YGUndefined}},\n    .margin = {},\n    .border = {},\n    .padding = {},\n    .direction = YGDirectionInherit,\n    .computedFlexBasisGeneration = 0,\n    .computedFlexBasis = YGUndefined,\n    .hadOverflow = false,\n    .generationCount = 0,\n    .lastParentDirection = (YGDirection)-1,\n    .nextCachedMeasurementsIndex = 0,\n    .cachedMeasurements = {},\n    .measuredDimensions = {{YGUndefined, YGUndefined}},\n    .cachedLayout =\n        {\n            .availableWidth = 0,\n            .availableHeight = 0,\n            .widthMeasureMode = (YGMeasureMode)-1,\n            .heightMeasureMode = (YGMeasureMode)-1,\n            .computedWidth = -1,\n            .computedHeight = -1,\n        },\n};\n\nextern bool YGFloatsEqual(const float a, const float b);\nextern bool YGValueEqual(const YGValue a, const YGValue b);\nextern const YGValue* YGComputedEdgeValue(\n    const std::array<YGValue, YGEdgeCount>& edges,\n    const YGEdge edge,\n    const YGValue* const defaultValue);\n"
  },
  {
    "path": "ReactCommon/yoga/yoga/Yoga.cpp",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#include \"Yoga.h\"\n#include <string.h>\n#include <algorithm>\n#include \"YGNode.h\"\n#include \"YGNodePrint.h\"\n#include \"Yoga-internal.h\"\n\n#ifdef _MSC_VER\n#include <float.h>\n\n/* define fmaxf if < VC12 */\n#if _MSC_VER < 1800\n__forceinline const float fmaxf(const float a, const float b) {\n  return (a > b) ? a : b;\n}\n#endif\n#endif\n\n#ifdef ANDROID\nstatic int YGAndroidLog(const YGConfigRef config,\n                        const YGNodeRef node,\n                        YGLogLevel level,\n                        const char *format,\n                        va_list args);\n#else\nstatic int YGDefaultLog(const YGConfigRef config,\n                        const YGNodeRef node,\n                        YGLogLevel level,\n                        const char *format,\n                        va_list args);\n#endif\n\nstatic YGConfig gYGConfigDefaults = {\n    .experimentalFeatures =\n        {\n            [YGExperimentalFeatureWebFlexBasis] = false,\n        },\n    .useWebDefaults = false,\n    .useLegacyStretchBehaviour = false,\n    .pointScaleFactor = 1.0f,\n#ifdef ANDROID\n    .logger = &YGAndroidLog,\n#else\n    .logger = &YGDefaultLog,\n#endif\n    .cloneNodeCallback = nullptr,\n    .context = nullptr,\n};\n\nconst YGValue YGValueZero = {.value = 0, .unit = YGUnitPoint};\nconst YGValue YGValueUndefined = {YGUndefined, YGUnitUndefined};\nconst YGValue YGValueAuto = {YGUndefined, YGUnitAuto};\n\n#ifdef ANDROID\n#include <android/log.h>\nstatic int YGAndroidLog(const YGConfigRef config,\n                        const YGNodeRef node,\n                        YGLogLevel level,\n                        const char *format,\n                        va_list args) {\n  int androidLevel = YGLogLevelDebug;\n  switch (level) {\n    case YGLogLevelFatal:\n      androidLevel = ANDROID_LOG_FATAL;\n      break;\n    case YGLogLevelError:\n      androidLevel = ANDROID_LOG_ERROR;\n      break;\n    case YGLogLevelWarn:\n      androidLevel = ANDROID_LOG_WARN;\n      break;\n    case YGLogLevelInfo:\n      androidLevel = ANDROID_LOG_INFO;\n      break;\n    case YGLogLevelDebug:\n      androidLevel = ANDROID_LOG_DEBUG;\n      break;\n    case YGLogLevelVerbose:\n      androidLevel = ANDROID_LOG_VERBOSE;\n      break;\n  }\n  const int result = __android_log_vprint(androidLevel, \"yoga\", format, args);\n  return result;\n}\n#else\n#define YG_UNUSED(x) (void)(x);\n\nstatic int YGDefaultLog(const YGConfigRef config,\n                        const YGNodeRef node,\n                        YGLogLevel level,\n                        const char *format,\n                        va_list args) {\n  YG_UNUSED(config);\n  YG_UNUSED(node);\n  switch (level) {\n    case YGLogLevelError:\n    case YGLogLevelFatal:\n      return vfprintf(stderr, format, args);\n    case YGLogLevelWarn:\n    case YGLogLevelInfo:\n    case YGLogLevelDebug:\n    case YGLogLevelVerbose:\n    default:\n      return vprintf(format, args);\n  }\n}\n\n#undef YG_UNUSED\n#endif\n\nbool YGFloatIsUndefined(const float value) {\n  return std::isnan(value);\n}\n\nconst YGValue* YGComputedEdgeValue(\n    const std::array<YGValue, YGEdgeCount>& edges,\n    const YGEdge edge,\n    const YGValue* const defaultValue) {\n  if (edges[edge].unit != YGUnitUndefined) {\n    return &edges[edge];\n  }\n\n  if ((edge == YGEdgeTop || edge == YGEdgeBottom) &&\n      edges[YGEdgeVertical].unit != YGUnitUndefined) {\n    return &edges[YGEdgeVertical];\n  }\n\n  if ((edge == YGEdgeLeft || edge == YGEdgeRight || edge == YGEdgeStart || edge == YGEdgeEnd) &&\n      edges[YGEdgeHorizontal].unit != YGUnitUndefined) {\n    return &edges[YGEdgeHorizontal];\n  }\n\n  if (edges[YGEdgeAll].unit != YGUnitUndefined) {\n    return &edges[YGEdgeAll];\n  }\n\n  if (edge == YGEdgeStart || edge == YGEdgeEnd) {\n    return &YGValueUndefined;\n  }\n\n  return defaultValue;\n}\n\nstatic inline float YGResolveValue(\n    const YGValue value,\n    const float parentSize) {\n  switch (value.unit) {\n    case YGUnitUndefined:\n    case YGUnitAuto:\n      return YGUndefined;\n    case YGUnitPoint:\n      return value.value;\n    case YGUnitPercent:\n      return value.value * parentSize / 100.0f;\n  }\n  return YGUndefined;\n}\n\nstatic inline float YGResolveValueMargin(\n    const YGValue value,\n    const float parentSize) {\n  return value.unit == YGUnitAuto ? 0 : YGResolveValue(value, parentSize);\n}\n\nvoid* YGNodeGetContext(YGNodeRef node) {\n  return node->getContext();\n}\n\nvoid YGNodeSetContext(YGNodeRef node, void* context) {\n  return node->setContext(context);\n}\n\nYGMeasureFunc YGNodeGetMeasureFunc(YGNodeRef node) {\n  return node->getMeasure();\n}\n\nvoid YGNodeSetMeasureFunc(YGNodeRef node, YGMeasureFunc measureFunc) {\n  node->setMeasureFunc(measureFunc);\n}\n\nYGBaselineFunc YGNodeGetBaselineFunc(YGNodeRef node) {\n  return node->getBaseline();\n}\n\nvoid YGNodeSetBaselineFunc(YGNodeRef node, YGBaselineFunc baselineFunc) {\n  node->setBaseLineFunc(baselineFunc);\n}\n\nYGPrintFunc YGNodeGetPrintFunc(YGNodeRef node) {\n  return node->getPrintFunc();\n}\n\nvoid YGNodeSetPrintFunc(YGNodeRef node, YGPrintFunc printFunc) {\n  node->setPrintFunc(printFunc);\n}\n\nbool YGNodeGetHasNewLayout(YGNodeRef node) {\n  return node->getHasNewLayout();\n}\n\nvoid YGNodeSetHasNewLayout(YGNodeRef node, bool hasNewLayout) {\n  node->setHasNewLayout(hasNewLayout);\n}\n\nYGNodeType YGNodeGetNodeType(YGNodeRef node) {\n  return node->getNodeType();\n}\n\nvoid YGNodeSetNodeType(YGNodeRef node, YGNodeType nodeType) {\n  return node->setNodeType(nodeType);\n}\n\nbool YGNodeIsDirty(YGNodeRef node) {\n  return node->isDirty();\n}\n\nint32_t gNodeInstanceCount = 0;\nint32_t gConfigInstanceCount = 0;\n\nWIN_EXPORT YGNodeRef YGNodeNewWithConfig(const YGConfigRef config) {\n  const YGNodeRef node = new YGNode();\n  YGAssertWithConfig(\n      config, node != nullptr, \"Could not allocate memory for node\");\n  gNodeInstanceCount++;\n\n  if (config->useWebDefaults) {\n    node->setStyleFlexDirection(YGFlexDirectionRow);\n    node->setStyleAlignContent(YGAlignStretch);\n  }\n  node->setConfig(config);\n  return node;\n}\n\nYGNodeRef YGNodeNew(void) {\n  return YGNodeNewWithConfig(&gYGConfigDefaults);\n}\n\nYGNodeRef YGNodeClone(YGNodeRef oldNode) {\n  YGNodeRef node = new YGNode(*oldNode);\n  YGAssertWithConfig(\n      oldNode->getConfig(),\n      node != nullptr,\n      \"Could not allocate memory for node\");\n  gNodeInstanceCount++;\n  node->setParent(nullptr);\n  return node;\n}\n\nvoid YGNodeFree(const YGNodeRef node) {\n  if (node->getParent()) {\n    node->getParent()->removeChild(node);\n    node->setParent(nullptr);\n  }\n\n  const uint32_t childCount = YGNodeGetChildCount(node);\n  for (uint32_t i = 0; i < childCount; i++) {\n    const YGNodeRef child = YGNodeGetChild(node, i);\n    child->setParent(nullptr);\n  }\n\n  node->clearChildren();\n  free(node);\n  gNodeInstanceCount--;\n}\n\nvoid YGNodeFreeRecursive(const YGNodeRef root) {\n  while (YGNodeGetChildCount(root) > 0) {\n    const YGNodeRef child = YGNodeGetChild(root, 0);\n    if (child->getParent() != root) {\n      // Don't free shared nodes that we don't own.\n      break;\n    }\n    YGNodeRemoveChild(root, child);\n    YGNodeFreeRecursive(child);\n  }\n  YGNodeFree(root);\n}\n\nvoid YGNodeReset(const YGNodeRef node) {\n  YGAssertWithNode(node,\n                   YGNodeGetChildCount(node) == 0,\n                   \"Cannot reset a node which still has children attached\");\n  YGAssertWithNode(\n      node,\n      node->getParent() == nullptr,\n      \"Cannot reset a node still attached to a parent\");\n\n  node->clearChildren();\n\n  const YGConfigRef config = node->getConfig();\n  *node = YGNode();\n  if (config->useWebDefaults) {\n    node->setStyleFlexDirection(YGFlexDirectionRow);\n    node->setStyleAlignContent(YGAlignStretch);\n  }\n  node->setConfig(config);\n}\n\nint32_t YGNodeGetInstanceCount(void) {\n  return gNodeInstanceCount;\n}\n\nint32_t YGConfigGetInstanceCount(void) {\n  return gConfigInstanceCount;\n}\n\n// Export only for C#\nYGConfigRef YGConfigGetDefault() {\n  return &gYGConfigDefaults;\n}\n\nYGConfigRef YGConfigNew(void) {\n  const YGConfigRef config = (const YGConfigRef)malloc(sizeof(YGConfig));\n  YGAssert(config != nullptr, \"Could not allocate memory for config\");\n\n  gConfigInstanceCount++;\n  memcpy(config, &gYGConfigDefaults, sizeof(YGConfig));\n  return config;\n}\n\nvoid YGConfigFree(const YGConfigRef config) {\n  free(config);\n  gConfigInstanceCount--;\n}\n\nvoid YGConfigCopy(const YGConfigRef dest, const YGConfigRef src) {\n  memcpy(dest, src, sizeof(YGConfig));\n}\n\nvoid YGNodeInsertChild(const YGNodeRef node, const YGNodeRef child, const uint32_t index) {\n  YGAssertWithNode(\n      node,\n      child->getParent() == nullptr,\n      \"Child already has a parent, it must be removed first.\");\n  YGAssertWithNode(\n      node,\n      node->getMeasure() == nullptr,\n      \"Cannot add child: Nodes with measure functions cannot have children.\");\n\n  node->cloneChildrenIfNeeded();\n  node->insertChild(child, index);\n  child->setParent(node);\n  node->markDirtyAndPropogate();\n}\n\nvoid YGNodeRemoveChild(const YGNodeRef parent, const YGNodeRef excludedChild) {\n  // This algorithm is a forked variant from cloneChildrenIfNeeded in YGNode\n  // that excludes a child.\n  const uint32_t childCount = YGNodeGetChildCount(parent);\n\n  if (childCount == 0) {\n    // This is an empty set. Nothing to remove.\n    return;\n  }\n  const YGNodeRef firstChild = YGNodeGetChild(parent, 0);\n  if (firstChild->getParent() == parent) {\n    // If the first child has this node as its parent, we assume that it is already unique.\n    // We can now try to delete a child in this list.\n    if (parent->removeChild(excludedChild)) {\n      excludedChild->setLayout(\n          YGNode().getLayout()); // layout is no longer valid\n      excludedChild->setParent(nullptr);\n      parent->markDirtyAndPropogate();\n    }\n    return;\n  }\n  // Otherwise we have to clone the node list except for the child we're trying to delete.\n  // We don't want to simply clone all children, because then the host will need to free\n  // the clone of the child that was just deleted.\n  const YGNodeClonedFunc cloneNodeCallback =\n      parent->getConfig()->cloneNodeCallback;\n  uint32_t nextInsertIndex = 0;\n  for (uint32_t i = 0; i < childCount; i++) {\n    const YGNodeRef oldChild = parent->getChild(i);\n    if (excludedChild == oldChild) {\n      // Ignore the deleted child. Don't reset its layout or parent since it is still valid\n      // in the other parent. However, since this parent has now changed, we need to mark it\n      // as dirty.\n      parent->markDirtyAndPropogate();\n      continue;\n    }\n    const YGNodeRef newChild = YGNodeClone(oldChild);\n    parent->replaceChild(newChild, nextInsertIndex);\n    newChild->setParent(parent);\n    if (cloneNodeCallback) {\n      cloneNodeCallback(oldChild, newChild, parent, nextInsertIndex);\n    }\n    nextInsertIndex++;\n  }\n  while (nextInsertIndex < childCount) {\n    parent->removeChild(nextInsertIndex);\n    nextInsertIndex++;\n  }\n}\n\nvoid YGNodeRemoveAllChildren(const YGNodeRef parent) {\n  const uint32_t childCount = YGNodeGetChildCount(parent);\n  if (childCount == 0) {\n    // This is an empty set already. Nothing to do.\n    return;\n  }\n  const YGNodeRef firstChild = YGNodeGetChild(parent, 0);\n  if (firstChild->getParent() == parent) {\n    // If the first child has this node as its parent, we assume that this child set is unique.\n    for (uint32_t i = 0; i < childCount; i++) {\n      const YGNodeRef oldChild = YGNodeGetChild(parent, i);\n      oldChild->setLayout(YGNode().getLayout()); // layout is no longer valid\n      oldChild->setParent(nullptr);\n    }\n    parent->clearChildren();\n    parent->markDirtyAndPropogate();\n    return;\n  }\n  // Otherwise, we are not the owner of the child set. We don't have to do anything to clear it.\n  parent->setChildren(YGVector());\n  parent->markDirtyAndPropogate();\n}\n\nYGNodeRef YGNodeGetChild(const YGNodeRef node, const uint32_t index) {\n  if (index < node->getChildren().size()) {\n    return node->getChild(index);\n  }\n  return nullptr;\n}\n\nuint32_t YGNodeGetChildCount(const YGNodeRef node) {\n  return node->getChildren().size();\n}\n\nYGNodeRef YGNodeGetParent(const YGNodeRef node) {\n  return node->getParent();\n}\n\nvoid YGNodeMarkDirty(const YGNodeRef node) {\n  YGAssertWithNode(\n      node,\n      node->getMeasure() != nullptr,\n      \"Only leaf nodes with custom measure functions\"\n      \"should manually mark themselves as dirty\");\n\n  node->markDirtyAndPropogate();\n}\n\nvoid YGNodeCopyStyle(const YGNodeRef dstNode, const YGNodeRef srcNode) {\n  if (!(dstNode->getStyle() == srcNode->getStyle())) {\n    dstNode->setStyle(srcNode->getStyle());\n    dstNode->markDirtyAndPropogate();\n  }\n}\n\nfloat YGNodeStyleGetFlexGrow(const YGNodeRef node) {\n  return YGFloatIsUndefined(node->getStyle().flexGrow)\n      ? kDefaultFlexGrow\n      : node->getStyle().flexGrow;\n}\n\nfloat YGNodeStyleGetFlexShrink(const YGNodeRef node) {\n  return YGFloatIsUndefined(node->getStyle().flexShrink)\n      ? (node->getConfig()->useWebDefaults ? kWebDefaultFlexShrink\n                                           : kDefaultFlexShrink)\n      : node->getStyle().flexShrink;\n}\n\n#define YG_NODE_STYLE_PROPERTY_SETTER_IMPL(                               \\\n    type, name, paramName, instanceName)                                  \\\n  void YGNodeStyleSet##name(const YGNodeRef node, const type paramName) { \\\n    if (node->getStyle().instanceName != paramName) {                     \\\n      YGStyle style = node->getStyle();                                   \\\n      style.instanceName = paramName;                                     \\\n      node->setStyle(style);                                              \\\n      node->markDirtyAndPropogate();                                      \\\n    }                                                                     \\\n  }\n\n#define YG_NODE_STYLE_PROPERTY_SETTER_UNIT_IMPL(                               \\\n    type, name, paramName, instanceName)                                       \\\n  void YGNodeStyleSet##name(const YGNodeRef node, const type paramName) {      \\\n    YGValue value = {                                                          \\\n        .value = paramName,                                                    \\\n        .unit = YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPoint, \\\n    };                                                                         \\\n    if ((node->getStyle().instanceName.value != value.value &&                 \\\n         value.unit != YGUnitUndefined) ||                                     \\\n        node->getStyle().instanceName.unit != value.unit) {                    \\\n      YGStyle style = node->getStyle();                                        \\\n      style.instanceName = value;                                              \\\n      node->setStyle(style);                                                   \\\n      node->markDirtyAndPropogate();                                           \\\n    }                                                                          \\\n  }                                                                            \\\n                                                                               \\\n  void YGNodeStyleSet##name##Percent(                                          \\\n      const YGNodeRef node, const type paramName) {                            \\\n    YGValue value = {                                                          \\\n        .value = paramName,                                                    \\\n        .unit =                                                                \\\n            YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPercent,   \\\n    };                                                                         \\\n    if ((node->getStyle().instanceName.value != value.value &&                 \\\n         value.unit != YGUnitUndefined) ||                                     \\\n        node->getStyle().instanceName.unit != value.unit) {                    \\\n      YGStyle style = node->getStyle();                                        \\\n                                                                               \\\n      style.instanceName = value;                                              \\\n      node->setStyle(style);                                                   \\\n      node->markDirtyAndPropogate();                                           \\\n    }                                                                          \\\n  }\n\n#define YG_NODE_STYLE_PROPERTY_SETTER_UNIT_AUTO_IMPL(                          \\\n    type, name, paramName, instanceName)                                       \\\n  void YGNodeStyleSet##name(const YGNodeRef node, const type paramName) {      \\\n    YGValue value = {                                                          \\\n        .value = paramName,                                                    \\\n        .unit = YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPoint, \\\n    };                                                                         \\\n    if ((node->getStyle().instanceName.value != value.value &&                 \\\n         value.unit != YGUnitUndefined) ||                                     \\\n        node->getStyle().instanceName.unit != value.unit) {                    \\\n      YGStyle style = node->getStyle();                                        \\\n      style.instanceName = value;                                              \\\n      node->setStyle(style);                                                   \\\n      node->markDirtyAndPropogate();                                           \\\n    }                                                                          \\\n  }                                                                            \\\n                                                                               \\\n  void YGNodeStyleSet##name##Percent(                                          \\\n      const YGNodeRef node, const type paramName) {                            \\\n    if (node->getStyle().instanceName.value != paramName ||                    \\\n        node->getStyle().instanceName.unit != YGUnitPercent) {                 \\\n      YGStyle style = node->getStyle();                                        \\\n      style.instanceName.value = paramName;                                    \\\n      style.instanceName.unit =                                                \\\n          YGFloatIsUndefined(paramName) ? YGUnitAuto : YGUnitPercent;          \\\n      node->setStyle(style);                                                   \\\n      node->markDirtyAndPropogate();                                           \\\n    }                                                                          \\\n  }                                                                            \\\n                                                                               \\\n  void YGNodeStyleSet##name##Auto(const YGNodeRef node) {                      \\\n    if (node->getStyle().instanceName.unit != YGUnitAuto) {                    \\\n      YGStyle style = node->getStyle();                                        \\\n      style.instanceName.value = YGUndefined;                                  \\\n      style.instanceName.unit = YGUnitAuto;                                    \\\n      node->setStyle(style);                                                   \\\n      node->markDirtyAndPropogate();                                           \\\n    }                                                                          \\\n  }\n\n#define YG_NODE_STYLE_PROPERTY_IMPL(type, name, paramName, instanceName)  \\\n  YG_NODE_STYLE_PROPERTY_SETTER_IMPL(type, name, paramName, instanceName) \\\n                                                                          \\\n  type YGNodeStyleGet##name(const YGNodeRef node) {                       \\\n    return node->getStyle().instanceName;                                 \\\n  }\n\n#define YG_NODE_STYLE_PROPERTY_UNIT_IMPL(type, name, paramName, instanceName) \\\n  YG_NODE_STYLE_PROPERTY_SETTER_UNIT_IMPL(                                    \\\n      float, name, paramName, instanceName)                                   \\\n                                                                              \\\n  type YGNodeStyleGet##name(const YGNodeRef node) {                           \\\n    return node->getStyle().instanceName;                                     \\\n  }\n\n#define YG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(      \\\n    type, name, paramName, instanceName)            \\\n  YG_NODE_STYLE_PROPERTY_SETTER_UNIT_AUTO_IMPL(     \\\n      float, name, paramName, instanceName)         \\\n                                                    \\\n  type YGNodeStyleGet##name(const YGNodeRef node) { \\\n    return node->getStyle().instanceName;           \\\n  }\n\n#define YG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO_IMPL(type, name, instanceName) \\\n  void YGNodeStyleSet##name##Auto(const YGNodeRef node, const YGEdge edge) { \\\n    if (node->getStyle().instanceName[edge].unit != YGUnitAuto) {            \\\n      YGStyle style = node->getStyle();                                      \\\n      style.instanceName[edge].value = YGUndefined;                          \\\n      style.instanceName[edge].unit = YGUnitAuto;                            \\\n      node->setStyle(style);                                                 \\\n      node->markDirtyAndPropogate();                                         \\\n    }                                                                        \\\n  }\n\n#define YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(                                 \\\n    type, name, paramName, instanceName)                                       \\\n  void YGNodeStyleSet##name(                                                   \\\n      const YGNodeRef node, const YGEdge edge, const float paramName) {        \\\n    YGValue value = {                                                          \\\n        .value = paramName,                                                    \\\n        .unit = YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPoint, \\\n    };                                                                         \\\n    if ((node->getStyle().instanceName[edge].value != value.value &&           \\\n         value.unit != YGUnitUndefined) ||                                     \\\n        node->getStyle().instanceName[edge].unit != value.unit) {              \\\n      YGStyle style = node->getStyle();                                        \\\n      style.instanceName[edge] = value;                                        \\\n      node->setStyle(style);                                                   \\\n      node->markDirtyAndPropogate();                                           \\\n    }                                                                          \\\n  }                                                                            \\\n                                                                               \\\n  void YGNodeStyleSet##name##Percent(                                          \\\n      const YGNodeRef node, const YGEdge edge, const float paramName) {        \\\n    YGValue value = {                                                          \\\n        .value = paramName,                                                    \\\n        .unit =                                                                \\\n            YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPercent,   \\\n    };                                                                         \\\n    if ((node->getStyle().instanceName[edge].value != value.value &&           \\\n         value.unit != YGUnitUndefined) ||                                     \\\n        node->getStyle().instanceName[edge].unit != value.unit) {              \\\n      YGStyle style = node->getStyle();                                        \\\n      style.instanceName[edge] = value;                                        \\\n      node->setStyle(style);                                                   \\\n      node->markDirtyAndPropogate();                                           \\\n    }                                                                          \\\n  }                                                                            \\\n                                                                               \\\n  WIN_STRUCT(type)                                                             \\\n  YGNodeStyleGet##name(const YGNodeRef node, const YGEdge edge) {              \\\n    return WIN_STRUCT_REF(node->getStyle().instanceName[edge]);                \\\n  }\n\n#define YG_NODE_STYLE_EDGE_PROPERTY_IMPL(type, name, paramName, instanceName)  \\\n  void YGNodeStyleSet##name(                                                   \\\n      const YGNodeRef node, const YGEdge edge, const float paramName) {        \\\n    YGValue value = {                                                          \\\n        .value = paramName,                                                    \\\n        .unit = YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPoint, \\\n    };                                                                         \\\n    if ((node->getStyle().instanceName[edge].value != value.value &&           \\\n         value.unit != YGUnitUndefined) ||                                     \\\n        node->getStyle().instanceName[edge].unit != value.unit) {              \\\n      YGStyle style = node->getStyle();                                        \\\n      style.instanceName[edge] = value;                                        \\\n      node->setStyle(style);                                                   \\\n      node->markDirtyAndPropogate();                                           \\\n    }                                                                          \\\n  }                                                                            \\\n                                                                               \\\n  float YGNodeStyleGet##name(const YGNodeRef node, const YGEdge edge) {        \\\n    return node->getStyle().instanceName[edge].value;                          \\\n  }\n\n#define YG_NODE_LAYOUT_PROPERTY_IMPL(type, name, instanceName) \\\n  type YGNodeLayoutGet##name(const YGNodeRef node) {           \\\n    return node->getLayout().instanceName;                     \\\n  }\n\n#define YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(type, name, instanceName) \\\n  type YGNodeLayoutGet##name(const YGNodeRef node, const YGEdge edge) { \\\n    YGAssertWithNode(                                                   \\\n        node,                                                           \\\n        edge <= YGEdgeEnd,                                              \\\n        \"Cannot get layout properties of multi-edge shorthands\");       \\\n                                                                        \\\n    if (edge == YGEdgeLeft) {                                           \\\n      if (node->getLayout().direction == YGDirectionRTL) {              \\\n        return node->getLayout().instanceName[YGEdgeEnd];               \\\n      } else {                                                          \\\n        return node->getLayout().instanceName[YGEdgeStart];             \\\n      }                                                                 \\\n    }                                                                   \\\n                                                                        \\\n    if (edge == YGEdgeRight) {                                          \\\n      if (node->getLayout().direction == YGDirectionRTL) {              \\\n        return node->getLayout().instanceName[YGEdgeStart];             \\\n      } else {                                                          \\\n        return node->getLayout().instanceName[YGEdgeEnd];               \\\n      }                                                                 \\\n    }                                                                   \\\n                                                                        \\\n    return node->getLayout().instanceName[edge];                        \\\n  }\n\n// YG_NODE_PROPERTY_IMPL(void *, Context, context, context);\n// YG_NODE_PROPERTY_IMPL(YGPrintFunc, PrintFunc, printFunc, print);\n// YG_NODE_PROPERTY_IMPL(bool, HasNewLayout, hasNewLayout, hasNewLayout);\n// YG_NODE_PROPERTY_IMPL(YGNodeType, NodeType, nodeType, nodeType);\n\nYG_NODE_STYLE_PROPERTY_IMPL(YGDirection, Direction, direction, direction);\nYG_NODE_STYLE_PROPERTY_IMPL(YGFlexDirection, FlexDirection, flexDirection, flexDirection);\nYG_NODE_STYLE_PROPERTY_IMPL(YGJustify, JustifyContent, justifyContent, justifyContent);\nYG_NODE_STYLE_PROPERTY_IMPL(YGAlign, AlignContent, alignContent, alignContent);\nYG_NODE_STYLE_PROPERTY_IMPL(YGAlign, AlignItems, alignItems, alignItems);\nYG_NODE_STYLE_PROPERTY_IMPL(YGAlign, AlignSelf, alignSelf, alignSelf);\nYG_NODE_STYLE_PROPERTY_IMPL(YGPositionType, PositionType, positionType, positionType);\nYG_NODE_STYLE_PROPERTY_IMPL(YGWrap, FlexWrap, flexWrap, flexWrap);\nYG_NODE_STYLE_PROPERTY_IMPL(YGOverflow, Overflow, overflow, overflow);\nYG_NODE_STYLE_PROPERTY_IMPL(YGDisplay, Display, display, display);\n\nYG_NODE_STYLE_PROPERTY_IMPL(float, Flex, flex, flex);\nYG_NODE_STYLE_PROPERTY_SETTER_IMPL(float, FlexGrow, flexGrow, flexGrow);\nYG_NODE_STYLE_PROPERTY_SETTER_IMPL(float, FlexShrink, flexShrink, flexShrink);\nYG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(YGValue, FlexBasis, flexBasis, flexBasis);\n\nYG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Position, position, position);\nYG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Margin, margin, margin);\nYG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO_IMPL(YGValue, Margin, margin);\nYG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Padding, padding, padding);\nYG_NODE_STYLE_EDGE_PROPERTY_IMPL(float, Border, border, border);\n\nYG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(YGValue, Width, width, dimensions[YGDimensionWidth]);\nYG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(YGValue, Height, height, dimensions[YGDimensionHeight]);\nYG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, MinWidth, minWidth, minDimensions[YGDimensionWidth]);\nYG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, MinHeight, minHeight, minDimensions[YGDimensionHeight]);\nYG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, MaxWidth, maxWidth, maxDimensions[YGDimensionWidth]);\nYG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, MaxHeight, maxHeight, maxDimensions[YGDimensionHeight]);\n\n// Yoga specific properties, not compatible with flexbox specification\nYG_NODE_STYLE_PROPERTY_IMPL(float, AspectRatio, aspectRatio, aspectRatio);\n\nYG_NODE_LAYOUT_PROPERTY_IMPL(float, Left, position[YGEdgeLeft]);\nYG_NODE_LAYOUT_PROPERTY_IMPL(float, Top, position[YGEdgeTop]);\nYG_NODE_LAYOUT_PROPERTY_IMPL(float, Right, position[YGEdgeRight]);\nYG_NODE_LAYOUT_PROPERTY_IMPL(float, Bottom, position[YGEdgeBottom]);\nYG_NODE_LAYOUT_PROPERTY_IMPL(float, Width, dimensions[YGDimensionWidth]);\nYG_NODE_LAYOUT_PROPERTY_IMPL(float, Height, dimensions[YGDimensionHeight]);\nYG_NODE_LAYOUT_PROPERTY_IMPL(YGDirection, Direction, direction);\nYG_NODE_LAYOUT_PROPERTY_IMPL(bool, HadOverflow, hadOverflow);\n\nYG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Margin, margin);\nYG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Border, border);\nYG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Padding, padding);\n\nuint32_t gCurrentGenerationCount = 0;\n\nbool YGLayoutNodeInternal(const YGNodeRef node,\n                          const float availableWidth,\n                          const float availableHeight,\n                          const YGDirection parentDirection,\n                          const YGMeasureMode widthMeasureMode,\n                          const YGMeasureMode heightMeasureMode,\n                          const float parentWidth,\n                          const float parentHeight,\n                          const bool performLayout,\n                          const char *reason,\n                          const YGConfigRef config);\n\nbool YGValueEqual(const YGValue a, const YGValue b) {\n  if (a.unit != b.unit) {\n    return false;\n  }\n\n  if (a.unit == YGUnitUndefined ||\n      (std::isnan(a.value) && std::isnan(b.value))) {\n    return true;\n  }\n\n  return fabs(a.value - b.value) < 0.0001f;\n}\n\nbool YGFloatsEqual(const float a, const float b) {\n  if (YGFloatIsUndefined(a)) {\n    return YGFloatIsUndefined(b);\n  }\n  return fabs(a - b) < 0.0001f;\n}\n\nstatic void YGNodePrintInternal(const YGNodeRef node,\n                                const YGPrintOptions options) {\n  std::string str;\n  facebook::yoga::YGNodeToString(&str, node, options, 0);\n  YGLog(node, YGLogLevelDebug, str.c_str());\n}\n\nvoid YGNodePrint(const YGNodeRef node, const YGPrintOptions options) {\n  YGNodePrintInternal(node, options);\n}\n\nconst std::array<YGEdge, 4> leading = {\n    {YGEdgeTop, YGEdgeBottom, YGEdgeLeft, YGEdgeRight}};\n\nconst std::array<YGEdge, 4> trailing = {\n    {YGEdgeBottom, YGEdgeTop, YGEdgeRight, YGEdgeLeft}};\nstatic const std::array<YGEdge, 4> pos = {{\n    YGEdgeTop,\n    YGEdgeBottom,\n    YGEdgeLeft,\n    YGEdgeRight,\n}};\nstatic const std::array<YGDimension, 4> dim = {\n    {YGDimensionHeight, YGDimensionHeight, YGDimensionWidth, YGDimensionWidth}};\n\nbool YGFlexDirectionIsRow(const YGFlexDirection flexDirection) {\n  return flexDirection == YGFlexDirectionRow || flexDirection == YGFlexDirectionRowReverse;\n}\n\nstatic inline bool YGFlexDirectionIsColumn(const YGFlexDirection flexDirection) {\n  return flexDirection == YGFlexDirectionColumn || flexDirection == YGFlexDirectionColumnReverse;\n}\n\nstatic inline float YGNodeLeadingMargin(const YGNodeRef node,\n                                        const YGFlexDirection axis,\n                                        const float widthSize) {\n  if (YGFlexDirectionIsRow(axis) &&\n      node->getStyle().margin[YGEdgeStart].unit != YGUnitUndefined) {\n    return YGResolveValueMargin(\n        node->getStyle().margin[YGEdgeStart], widthSize);\n  }\n\n  return YGResolveValueMargin(\n      *YGComputedEdgeValue(\n          node->getStyle().margin, leading[axis], &YGValueZero),\n      widthSize);\n}\n\nstatic float YGNodeTrailingMargin(const YGNodeRef node,\n                                  const YGFlexDirection axis,\n                                  const float widthSize) {\n  if (YGFlexDirectionIsRow(axis) &&\n      node->getStyle().margin[YGEdgeEnd].unit != YGUnitUndefined) {\n    return YGResolveValueMargin(node->getStyle().margin[YGEdgeEnd], widthSize);\n  }\n\n  return YGResolveValueMargin(\n      *YGComputedEdgeValue(\n          node->getStyle().margin, trailing[axis], &YGValueZero),\n      widthSize);\n}\n\nstatic float YGNodeLeadingPadding(const YGNodeRef node,\n                                  const YGFlexDirection axis,\n                                  const float widthSize) {\n  if (YGFlexDirectionIsRow(axis) &&\n      node->getStyle().padding[YGEdgeStart].unit != YGUnitUndefined &&\n      YGResolveValue(node->getStyle().padding[YGEdgeStart], widthSize) >=\n          0.0f) {\n    return YGResolveValue(node->getStyle().padding[YGEdgeStart], widthSize);\n  }\n\n  return fmaxf(\n      YGResolveValue(\n          *YGComputedEdgeValue(\n              node->getStyle().padding, leading[axis], &YGValueZero),\n          widthSize),\n      0.0f);\n}\n\nstatic float YGNodeTrailingPadding(const YGNodeRef node,\n                                   const YGFlexDirection axis,\n                                   const float widthSize) {\n  if (YGFlexDirectionIsRow(axis) &&\n      node->getStyle().padding[YGEdgeEnd].unit != YGUnitUndefined &&\n      YGResolveValue(node->getStyle().padding[YGEdgeEnd], widthSize) >= 0.0f) {\n    return YGResolveValue(node->getStyle().padding[YGEdgeEnd], widthSize);\n  }\n\n  return fmaxf(\n      YGResolveValue(\n          *YGComputedEdgeValue(\n              node->getStyle().padding, trailing[axis], &YGValueZero),\n          widthSize),\n      0.0f);\n}\n\nstatic float YGNodeLeadingBorder(\n    const YGNodeRef node,\n    const YGFlexDirection axis) {\n  if (YGFlexDirectionIsRow(axis) &&\n      node->getStyle().border[YGEdgeStart].unit != YGUnitUndefined &&\n      node->getStyle().border[YGEdgeStart].value >= 0.0f) {\n    return node->getStyle().border[YGEdgeStart].value;\n  }\n\n  return fmaxf(\n      YGComputedEdgeValue(node->getStyle().border, leading[axis], &YGValueZero)\n          ->value,\n      0.0f);\n}\n\nstatic float YGNodeTrailingBorder(\n    const YGNodeRef node,\n    const YGFlexDirection axis) {\n  if (YGFlexDirectionIsRow(axis) &&\n      node->getStyle().border[YGEdgeEnd].unit != YGUnitUndefined &&\n      node->getStyle().border[YGEdgeEnd].value >= 0.0f) {\n    return node->getStyle().border[YGEdgeEnd].value;\n  }\n\n  return fmaxf(\n      YGComputedEdgeValue(node->getStyle().border, trailing[axis], &YGValueZero)\n          ->value,\n      0.0f);\n}\n\nstatic inline float YGNodeLeadingPaddingAndBorder(\n    const YGNodeRef node,\n    const YGFlexDirection axis,\n    const float widthSize) {\n  return YGNodeLeadingPadding(node, axis, widthSize) +\n      YGNodeLeadingBorder(node, axis);\n}\n\nstatic inline float YGNodeTrailingPaddingAndBorder(const YGNodeRef node,\n                                                   const YGFlexDirection axis,\n                                                   const float widthSize) {\n  return YGNodeTrailingPadding(node, axis, widthSize) + YGNodeTrailingBorder(node, axis);\n}\n\nstatic inline float YGNodeMarginForAxis(const YGNodeRef node,\n                                        const YGFlexDirection axis,\n                                        const float widthSize) {\n  return YGNodeLeadingMargin(node, axis, widthSize) + YGNodeTrailingMargin(node, axis, widthSize);\n}\n\nstatic inline float YGNodePaddingAndBorderForAxis(const YGNodeRef node,\n                                                  const YGFlexDirection axis,\n                                                  const float widthSize) {\n  return YGNodeLeadingPaddingAndBorder(node, axis, widthSize) +\n         YGNodeTrailingPaddingAndBorder(node, axis, widthSize);\n}\n\nstatic inline YGAlign YGNodeAlignItem(const YGNodeRef node, const YGNodeRef child) {\n  const YGAlign align = child->getStyle().alignSelf == YGAlignAuto\n      ? node->getStyle().alignItems\n      : child->getStyle().alignSelf;\n  if (align == YGAlignBaseline &&\n      YGFlexDirectionIsColumn(node->getStyle().flexDirection)) {\n    return YGAlignFlexStart;\n  }\n  return align;\n}\n\nstatic inline YGDirection YGNodeResolveDirection(const YGNodeRef node,\n                                                 const YGDirection parentDirection) {\n  if (node->getStyle().direction == YGDirectionInherit) {\n    return parentDirection > YGDirectionInherit ? parentDirection : YGDirectionLTR;\n  } else {\n    return node->getStyle().direction;\n  }\n}\n\nstatic float YGBaseline(const YGNodeRef node) {\n  if (node->getBaseline() != nullptr) {\n    const float baseline = node->getBaseline()(\n        node,\n        node->getLayout().measuredDimensions[YGDimensionWidth],\n        node->getLayout().measuredDimensions[YGDimensionHeight]);\n    YGAssertWithNode(node,\n                     !YGFloatIsUndefined(baseline),\n                     \"Expect custom baseline function to not return NaN\");\n    return baseline;\n  }\n\n  YGNodeRef baselineChild = nullptr;\n  const uint32_t childCount = YGNodeGetChildCount(node);\n  for (uint32_t i = 0; i < childCount; i++) {\n    const YGNodeRef child = YGNodeGetChild(node, i);\n    if (child->getLineIndex() > 0) {\n      break;\n    }\n    if (child->getStyle().positionType == YGPositionTypeAbsolute) {\n      continue;\n    }\n    if (YGNodeAlignItem(node, child) == YGAlignBaseline) {\n      baselineChild = child;\n      break;\n    }\n\n    if (baselineChild == nullptr) {\n      baselineChild = child;\n    }\n  }\n\n  if (baselineChild == nullptr) {\n    return node->getLayout().measuredDimensions[YGDimensionHeight];\n  }\n\n  const float baseline = YGBaseline(baselineChild);\n  return baseline + baselineChild->getLayout().position[YGEdgeTop];\n}\n\nstatic inline YGFlexDirection YGResolveFlexDirection(const YGFlexDirection flexDirection,\n                                                     const YGDirection direction) {\n  if (direction == YGDirectionRTL) {\n    if (flexDirection == YGFlexDirectionRow) {\n      return YGFlexDirectionRowReverse;\n    } else if (flexDirection == YGFlexDirectionRowReverse) {\n      return YGFlexDirectionRow;\n    }\n  }\n\n  return flexDirection;\n}\n\nstatic YGFlexDirection YGFlexDirectionCross(const YGFlexDirection flexDirection,\n                                            const YGDirection direction) {\n  return YGFlexDirectionIsColumn(flexDirection)\n             ? YGResolveFlexDirection(YGFlexDirectionRow, direction)\n             : YGFlexDirectionColumn;\n}\n\nstatic inline bool YGNodeIsFlex(const YGNodeRef node) {\n  return (\n      node->getStyle().positionType == YGPositionTypeRelative &&\n      (node->resolveFlexGrow() != 0 || node->resolveFlexShrink() != 0));\n}\n\nstatic bool YGIsBaselineLayout(const YGNodeRef node) {\n  if (YGFlexDirectionIsColumn(node->getStyle().flexDirection)) {\n    return false;\n  }\n  if (node->getStyle().alignItems == YGAlignBaseline) {\n    return true;\n  }\n  const uint32_t childCount = YGNodeGetChildCount(node);\n  for (uint32_t i = 0; i < childCount; i++) {\n    const YGNodeRef child = YGNodeGetChild(node, i);\n    if (child->getStyle().positionType == YGPositionTypeRelative &&\n        child->getStyle().alignSelf == YGAlignBaseline) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nstatic inline float YGNodeDimWithMargin(const YGNodeRef node,\n                                        const YGFlexDirection axis,\n                                        const float widthSize) {\n  return node->getLayout().measuredDimensions[dim[axis]] +\n      YGNodeLeadingMargin(node, axis, widthSize) +\n      YGNodeTrailingMargin(node, axis, widthSize);\n}\n\nstatic inline bool YGNodeIsStyleDimDefined(const YGNodeRef node,\n                                           const YGFlexDirection axis,\n                                           const float parentSize) {\n  return !(\n      node->getResolvedDimension(dim[axis]).unit == YGUnitAuto ||\n      node->getResolvedDimension(dim[axis]).unit == YGUnitUndefined ||\n      (node->getResolvedDimension(dim[axis]).unit == YGUnitPoint &&\n       node->getResolvedDimension(dim[axis]).value < 0.0f) ||\n      (node->getResolvedDimension(dim[axis]).unit == YGUnitPercent &&\n       (node->getResolvedDimension(dim[axis]).value < 0.0f ||\n        YGFloatIsUndefined(parentSize))));\n}\n\nstatic inline bool YGNodeIsLayoutDimDefined(const YGNodeRef node, const YGFlexDirection axis) {\n  const float value = node->getLayout().measuredDimensions[dim[axis]];\n  return !YGFloatIsUndefined(value) && value >= 0.0f;\n}\n\nstatic inline bool YGNodeIsLeadingPosDefined(const YGNodeRef node, const YGFlexDirection axis) {\n  return (YGFlexDirectionIsRow(axis) &&\n          YGComputedEdgeValue(\n              node->getStyle().position, YGEdgeStart, &YGValueUndefined)\n                  ->unit != YGUnitUndefined) ||\n      YGComputedEdgeValue(\n          node->getStyle().position, leading[axis], &YGValueUndefined)\n          ->unit != YGUnitUndefined;\n}\n\nstatic inline bool YGNodeIsTrailingPosDefined(const YGNodeRef node, const YGFlexDirection axis) {\n  return (YGFlexDirectionIsRow(axis) &&\n          YGComputedEdgeValue(\n              node->getStyle().position, YGEdgeEnd, &YGValueUndefined)\n                  ->unit != YGUnitUndefined) ||\n      YGComputedEdgeValue(\n          node->getStyle().position, trailing[axis], &YGValueUndefined)\n          ->unit != YGUnitUndefined;\n}\n\nstatic float YGNodeLeadingPosition(const YGNodeRef node,\n                                   const YGFlexDirection axis,\n                                   const float axisSize) {\n  if (YGFlexDirectionIsRow(axis)) {\n    const YGValue* leadingPosition = YGComputedEdgeValue(\n        node->getStyle().position, YGEdgeStart, &YGValueUndefined);\n    if (leadingPosition->unit != YGUnitUndefined) {\n      return YGResolveValue(\n          *leadingPosition,\n          axisSize); // leadingPosition->resolveValue(axisSize);\n    }\n  }\n\n  const YGValue* leadingPosition = YGComputedEdgeValue(\n      node->getStyle().position, leading[axis], &YGValueUndefined);\n\n  return leadingPosition->unit == YGUnitUndefined\n      ? 0.0f\n      : YGResolveValue(*leadingPosition, axisSize);\n}\n\nstatic float YGNodeTrailingPosition(const YGNodeRef node,\n                                    const YGFlexDirection axis,\n                                    const float axisSize) {\n  if (YGFlexDirectionIsRow(axis)) {\n    const YGValue* trailingPosition = YGComputedEdgeValue(\n        node->getStyle().position, YGEdgeEnd, &YGValueUndefined);\n    if (trailingPosition->unit != YGUnitUndefined) {\n      return YGResolveValue(*trailingPosition, axisSize);\n    }\n  }\n\n  const YGValue* trailingPosition = YGComputedEdgeValue(\n      node->getStyle().position, trailing[axis], &YGValueUndefined);\n\n  return trailingPosition->unit == YGUnitUndefined\n      ? 0.0f\n      : YGResolveValue(*trailingPosition, axisSize);\n}\n\nstatic float YGNodeBoundAxisWithinMinAndMax(const YGNodeRef node,\n                                            const YGFlexDirection axis,\n                                            const float value,\n                                            const float axisSize) {\n  float min = YGUndefined;\n  float max = YGUndefined;\n\n  if (YGFlexDirectionIsColumn(axis)) {\n    min = YGResolveValue(\n        node->getStyle().minDimensions[YGDimensionHeight], axisSize);\n    max = YGResolveValue(\n        node->getStyle().maxDimensions[YGDimensionHeight], axisSize);\n  } else if (YGFlexDirectionIsRow(axis)) {\n    min = YGResolveValue(\n        node->getStyle().minDimensions[YGDimensionWidth], axisSize);\n    max = YGResolveValue(\n        node->getStyle().maxDimensions[YGDimensionWidth], axisSize);\n  }\n\n  float boundValue = value;\n\n  if (!YGFloatIsUndefined(max) && max >= 0.0f && boundValue > max) {\n    boundValue = max;\n  }\n\n  if (!YGFloatIsUndefined(min) && min >= 0.0f && boundValue < min) {\n    boundValue = min;\n  }\n\n  return boundValue;\n}\n\n// Like YGNodeBoundAxisWithinMinAndMax but also ensures that the value doesn't go\n// below the\n// padding and border amount.\nstatic inline float YGNodeBoundAxis(const YGNodeRef node,\n                                    const YGFlexDirection axis,\n                                    const float value,\n                                    const float axisSize,\n                                    const float widthSize) {\n  return fmaxf(YGNodeBoundAxisWithinMinAndMax(node, axis, value, axisSize),\n               YGNodePaddingAndBorderForAxis(node, axis, widthSize));\n}\n\nstatic void YGNodeSetChildTrailingPosition(const YGNodeRef node,\n                                           const YGNodeRef child,\n                                           const YGFlexDirection axis) {\n  const float size = child->getLayout().measuredDimensions[dim[axis]];\n  child->setLayoutPosition(\n      node->getLayout().measuredDimensions[dim[axis]] - size -\n          child->getLayout().position[pos[axis]],\n      trailing[axis]);\n}\n\n// If both left and right are defined, then use left. Otherwise return\n// +left or -right depending on which is defined.\nstatic float YGNodeRelativePosition(const YGNodeRef node,\n                                    const YGFlexDirection axis,\n                                    const float axisSize) {\n  return YGNodeIsLeadingPosDefined(node, axis) ? YGNodeLeadingPosition(node, axis, axisSize)\n                                               : -YGNodeTrailingPosition(node, axis, axisSize);\n}\n\nstatic void YGConstrainMaxSizeForMode(const YGNodeRef node,\n                                      const enum YGFlexDirection axis,\n                                      const float parentAxisSize,\n                                      const float parentWidth,\n                                      YGMeasureMode *mode,\n                                      float *size) {\n  const float maxSize =\n      YGResolveValue(\n          node->getStyle().maxDimensions[dim[axis]], parentAxisSize) +\n      YGNodeMarginForAxis(node, axis, parentWidth);\n  switch (*mode) {\n    case YGMeasureModeExactly:\n    case YGMeasureModeAtMost:\n      *size = (YGFloatIsUndefined(maxSize) || *size < maxSize) ? *size : maxSize;\n      break;\n    case YGMeasureModeUndefined:\n      if (!YGFloatIsUndefined(maxSize)) {\n        *mode = YGMeasureModeAtMost;\n        *size = maxSize;\n      }\n      break;\n  }\n}\n\nstatic void YGNodeSetPosition(const YGNodeRef node,\n                              const YGDirection direction,\n                              const float mainSize,\n                              const float crossSize,\n                              const float parentWidth) {\n  /* Root nodes should be always layouted as LTR, so we don't return negative values. */\n  const YGDirection directionRespectingRoot =\n      node->getParent() != nullptr ? direction : YGDirectionLTR;\n  const YGFlexDirection mainAxis = YGResolveFlexDirection(\n      node->getStyle().flexDirection, directionRespectingRoot);\n  const YGFlexDirection crossAxis = YGFlexDirectionCross(mainAxis, directionRespectingRoot);\n\n  const float relativePositionMain = YGNodeRelativePosition(node, mainAxis, mainSize);\n  const float relativePositionCross = YGNodeRelativePosition(node, crossAxis, crossSize);\n\n  node->setLayoutPosition(\n      YGNodeLeadingMargin(node, mainAxis, parentWidth) + relativePositionMain,\n      leading[mainAxis]);\n  node->setLayoutPosition(\n      YGNodeTrailingMargin(node, mainAxis, parentWidth) + relativePositionMain,\n      trailing[mainAxis]);\n  node->setLayoutPosition(\n      YGNodeLeadingMargin(node, crossAxis, parentWidth) + relativePositionCross,\n      leading[crossAxis]);\n  node->setLayoutPosition(\n      YGNodeTrailingMargin(node, crossAxis, parentWidth) +\n          relativePositionCross,\n      trailing[crossAxis]);\n}\n\nstatic void YGNodeComputeFlexBasisForChild(const YGNodeRef node,\n                                           const YGNodeRef child,\n                                           const float width,\n                                           const YGMeasureMode widthMode,\n                                           const float height,\n                                           const float parentWidth,\n                                           const float parentHeight,\n                                           const YGMeasureMode heightMode,\n                                           const YGDirection direction,\n                                           const YGConfigRef config) {\n  const YGFlexDirection mainAxis =\n      YGResolveFlexDirection(node->getStyle().flexDirection, direction);\n  const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis);\n  const float mainAxisSize = isMainAxisRow ? width : height;\n  const float mainAxisParentSize = isMainAxisRow ? parentWidth : parentHeight;\n\n  float childWidth;\n  float childHeight;\n  YGMeasureMode childWidthMeasureMode;\n  YGMeasureMode childHeightMeasureMode;\n\n  const float resolvedFlexBasis =\n      YGResolveValue(child->resolveFlexBasisPtr(), mainAxisParentSize);\n  const bool isRowStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, parentWidth);\n  const bool isColumnStyleDimDefined =\n      YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, parentHeight);\n\n  if (!YGFloatIsUndefined(resolvedFlexBasis) && !YGFloatIsUndefined(mainAxisSize)) {\n    if (YGFloatIsUndefined(child->getLayout().computedFlexBasis) ||\n        (YGConfigIsExperimentalFeatureEnabled(\n             child->getConfig(), YGExperimentalFeatureWebFlexBasis) &&\n         child->getLayout().computedFlexBasisGeneration !=\n             gCurrentGenerationCount)) {\n      child->setLayoutComputedFlexBasis(fmaxf(\n          resolvedFlexBasis,\n          YGNodePaddingAndBorderForAxis(child, mainAxis, parentWidth)));\n    }\n  } else if (isMainAxisRow && isRowStyleDimDefined) {\n    // The width is definite, so use that as the flex basis.\n    child->setLayoutComputedFlexBasis(fmaxf(\n        YGResolveValue(\n            child->getResolvedDimension(YGDimensionWidth), parentWidth),\n        YGNodePaddingAndBorderForAxis(child, YGFlexDirectionRow, parentWidth)));\n  } else if (!isMainAxisRow && isColumnStyleDimDefined) {\n    // The height is definite, so use that as the flex basis.\n    child->setLayoutComputedFlexBasis(fmaxf(\n        YGResolveValue(\n            child->getResolvedDimension(YGDimensionHeight), parentHeight),\n        YGNodePaddingAndBorderForAxis(\n            child, YGFlexDirectionColumn, parentWidth)));\n  } else {\n    // Compute the flex basis and hypothetical main size (i.e. the clamped\n    // flex basis).\n    childWidth = YGUndefined;\n    childHeight = YGUndefined;\n    childWidthMeasureMode = YGMeasureModeUndefined;\n    childHeightMeasureMode = YGMeasureModeUndefined;\n\n    const float marginRow =\n        YGNodeMarginForAxis(child, YGFlexDirectionRow, parentWidth);\n    const float marginColumn =\n        YGNodeMarginForAxis(child, YGFlexDirectionColumn, parentWidth);\n\n    if (isRowStyleDimDefined) {\n      childWidth =\n          YGResolveValue(\n              child->getResolvedDimension(YGDimensionWidth), parentWidth) +\n          marginRow;\n      childWidthMeasureMode = YGMeasureModeExactly;\n    }\n    if (isColumnStyleDimDefined) {\n      childHeight =\n          YGResolveValue(\n              child->getResolvedDimension(YGDimensionHeight), parentHeight) +\n          marginColumn;\n      childHeightMeasureMode = YGMeasureModeExactly;\n    }\n\n    // The W3C spec doesn't say anything about the 'overflow' property,\n    // but all major browsers appear to implement the following logic.\n    if ((!isMainAxisRow && node->getStyle().overflow == YGOverflowScroll) ||\n        node->getStyle().overflow != YGOverflowScroll) {\n      if (YGFloatIsUndefined(childWidth) && !YGFloatIsUndefined(width)) {\n        childWidth = width;\n        childWidthMeasureMode = YGMeasureModeAtMost;\n      }\n    }\n\n    if ((isMainAxisRow && node->getStyle().overflow == YGOverflowScroll) ||\n        node->getStyle().overflow != YGOverflowScroll) {\n      if (YGFloatIsUndefined(childHeight) && !YGFloatIsUndefined(height)) {\n        childHeight = height;\n        childHeightMeasureMode = YGMeasureModeAtMost;\n      }\n    }\n\n    if (!YGFloatIsUndefined(child->getStyle().aspectRatio)) {\n      if (!isMainAxisRow && childWidthMeasureMode == YGMeasureModeExactly) {\n        childHeight = (childWidth - marginRow) / child->getStyle().aspectRatio;\n        childHeightMeasureMode = YGMeasureModeExactly;\n      } else if (isMainAxisRow && childHeightMeasureMode == YGMeasureModeExactly) {\n        childWidth =\n            (childHeight - marginColumn) * child->getStyle().aspectRatio;\n        childWidthMeasureMode = YGMeasureModeExactly;\n      }\n    }\n\n    // If child has no defined size in the cross axis and is set to stretch,\n    // set the cross\n    // axis to be measured exactly with the available inner width\n\n    const bool hasExactWidth = !YGFloatIsUndefined(width) && widthMode == YGMeasureModeExactly;\n    const bool childWidthStretch = YGNodeAlignItem(node, child) == YGAlignStretch &&\n                                   childWidthMeasureMode != YGMeasureModeExactly;\n    if (!isMainAxisRow && !isRowStyleDimDefined && hasExactWidth && childWidthStretch) {\n      childWidth = width;\n      childWidthMeasureMode = YGMeasureModeExactly;\n      if (!YGFloatIsUndefined(child->getStyle().aspectRatio)) {\n        childHeight = (childWidth - marginRow) / child->getStyle().aspectRatio;\n        childHeightMeasureMode = YGMeasureModeExactly;\n      }\n    }\n\n    const bool hasExactHeight = !YGFloatIsUndefined(height) && heightMode == YGMeasureModeExactly;\n    const bool childHeightStretch = YGNodeAlignItem(node, child) == YGAlignStretch &&\n                                    childHeightMeasureMode != YGMeasureModeExactly;\n    if (isMainAxisRow && !isColumnStyleDimDefined && hasExactHeight && childHeightStretch) {\n      childHeight = height;\n      childHeightMeasureMode = YGMeasureModeExactly;\n\n      if (!YGFloatIsUndefined(child->getStyle().aspectRatio)) {\n        childWidth =\n            (childHeight - marginColumn) * child->getStyle().aspectRatio;\n        childWidthMeasureMode = YGMeasureModeExactly;\n      }\n    }\n\n    YGConstrainMaxSizeForMode(\n        child, YGFlexDirectionRow, parentWidth, parentWidth, &childWidthMeasureMode, &childWidth);\n    YGConstrainMaxSizeForMode(child,\n                              YGFlexDirectionColumn,\n                              parentHeight,\n                              parentWidth,\n                              &childHeightMeasureMode,\n                              &childHeight);\n\n    // Measure the child\n    YGLayoutNodeInternal(child,\n                         childWidth,\n                         childHeight,\n                         direction,\n                         childWidthMeasureMode,\n                         childHeightMeasureMode,\n                         parentWidth,\n                         parentHeight,\n                         false,\n                         \"measure\",\n                         config);\n\n    child->setLayoutComputedFlexBasis(fmaxf(\n        child->getLayout().measuredDimensions[dim[mainAxis]],\n        YGNodePaddingAndBorderForAxis(child, mainAxis, parentWidth)));\n  }\n  child->setLayoutComputedFlexBasisGeneration(gCurrentGenerationCount);\n}\n\nstatic void YGNodeAbsoluteLayoutChild(const YGNodeRef node,\n                                      const YGNodeRef child,\n                                      const float width,\n                                      const YGMeasureMode widthMode,\n                                      const float height,\n                                      const YGDirection direction,\n                                      const YGConfigRef config) {\n  const YGFlexDirection mainAxis =\n      YGResolveFlexDirection(node->getStyle().flexDirection, direction);\n  const YGFlexDirection crossAxis = YGFlexDirectionCross(mainAxis, direction);\n  const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis);\n\n  float childWidth = YGUndefined;\n  float childHeight = YGUndefined;\n  YGMeasureMode childWidthMeasureMode = YGMeasureModeUndefined;\n  YGMeasureMode childHeightMeasureMode = YGMeasureModeUndefined;\n\n  const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, width);\n  const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, width);\n\n  if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, width)) {\n    childWidth =\n        YGResolveValue(child->getResolvedDimension(YGDimensionWidth), width) +\n        marginRow;\n  } else {\n    // If the child doesn't have a specified width, compute the width based\n    // on the left/right\n    // offsets if they're defined.\n    if (YGNodeIsLeadingPosDefined(child, YGFlexDirectionRow) &&\n        YGNodeIsTrailingPosDefined(child, YGFlexDirectionRow)) {\n      childWidth = node->getLayout().measuredDimensions[YGDimensionWidth] -\n          (YGNodeLeadingBorder(node, YGFlexDirectionRow) +\n           YGNodeTrailingBorder(node, YGFlexDirectionRow)) -\n          (YGNodeLeadingPosition(child, YGFlexDirectionRow, width) +\n           YGNodeTrailingPosition(child, YGFlexDirectionRow, width));\n      childWidth = YGNodeBoundAxis(child, YGFlexDirectionRow, childWidth, width, width);\n    }\n  }\n\n  if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, height)) {\n    childHeight =\n        YGResolveValue(child->getResolvedDimension(YGDimensionHeight), height) +\n        marginColumn;\n  } else {\n    // If the child doesn't have a specified height, compute the height\n    // based on the top/bottom\n    // offsets if they're defined.\n    if (YGNodeIsLeadingPosDefined(child, YGFlexDirectionColumn) &&\n        YGNodeIsTrailingPosDefined(child, YGFlexDirectionColumn)) {\n      childHeight = node->getLayout().measuredDimensions[YGDimensionHeight] -\n          (YGNodeLeadingBorder(node, YGFlexDirectionColumn) +\n           YGNodeTrailingBorder(node, YGFlexDirectionColumn)) -\n          (YGNodeLeadingPosition(child, YGFlexDirectionColumn, height) +\n           YGNodeTrailingPosition(child, YGFlexDirectionColumn, height));\n      childHeight = YGNodeBoundAxis(child, YGFlexDirectionColumn, childHeight, height, width);\n    }\n  }\n\n  // Exactly one dimension needs to be defined for us to be able to do aspect ratio\n  // calculation. One dimension being the anchor and the other being flexible.\n  if (YGFloatIsUndefined(childWidth) ^ YGFloatIsUndefined(childHeight)) {\n    if (!YGFloatIsUndefined(child->getStyle().aspectRatio)) {\n      if (YGFloatIsUndefined(childWidth)) {\n        childWidth = marginRow +\n            (childHeight - marginColumn) * child->getStyle().aspectRatio;\n      } else if (YGFloatIsUndefined(childHeight)) {\n        childHeight = marginColumn +\n            (childWidth - marginRow) / child->getStyle().aspectRatio;\n      }\n    }\n  }\n\n  // If we're still missing one or the other dimension, measure the content.\n  if (YGFloatIsUndefined(childWidth) || YGFloatIsUndefined(childHeight)) {\n    childWidthMeasureMode =\n        YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined : YGMeasureModeExactly;\n    childHeightMeasureMode =\n        YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeExactly;\n\n    // If the size of the parent is defined then try to constrain the absolute child to that size\n    // as well. This allows text within the absolute child to wrap to the size of its parent.\n    // This is the same behavior as many browsers implement.\n    if (!isMainAxisRow && YGFloatIsUndefined(childWidth) && widthMode != YGMeasureModeUndefined &&\n        width > 0) {\n      childWidth = width;\n      childWidthMeasureMode = YGMeasureModeAtMost;\n    }\n\n    YGLayoutNodeInternal(child,\n                         childWidth,\n                         childHeight,\n                         direction,\n                         childWidthMeasureMode,\n                         childHeightMeasureMode,\n                         childWidth,\n                         childHeight,\n                         false,\n                         \"abs-measure\",\n                         config);\n    childWidth = child->getLayout().measuredDimensions[YGDimensionWidth] +\n        YGNodeMarginForAxis(child, YGFlexDirectionRow, width);\n    childHeight = child->getLayout().measuredDimensions[YGDimensionHeight] +\n        YGNodeMarginForAxis(child, YGFlexDirectionColumn, width);\n  }\n\n  YGLayoutNodeInternal(child,\n                       childWidth,\n                       childHeight,\n                       direction,\n                       YGMeasureModeExactly,\n                       YGMeasureModeExactly,\n                       childWidth,\n                       childHeight,\n                       true,\n                       \"abs-layout\",\n                       config);\n\n  if (YGNodeIsTrailingPosDefined(child, mainAxis) && !YGNodeIsLeadingPosDefined(child, mainAxis)) {\n    child->setLayoutPosition(\n        node->getLayout().measuredDimensions[dim[mainAxis]] -\n            child->getLayout().measuredDimensions[dim[mainAxis]] -\n            YGNodeTrailingBorder(node, mainAxis) -\n            YGNodeTrailingMargin(child, mainAxis, width) -\n            YGNodeTrailingPosition(\n                child, mainAxis, isMainAxisRow ? width : height),\n        leading[mainAxis]);\n  } else if (\n      !YGNodeIsLeadingPosDefined(child, mainAxis) &&\n      node->getStyle().justifyContent == YGJustifyCenter) {\n    child->setLayoutPosition(\n        (node->getLayout().measuredDimensions[dim[mainAxis]] -\n         child->getLayout().measuredDimensions[dim[mainAxis]]) /\n            2.0f,\n        leading[mainAxis]);\n  } else if (\n      !YGNodeIsLeadingPosDefined(child, mainAxis) &&\n      node->getStyle().justifyContent == YGJustifyFlexEnd) {\n    child->setLayoutPosition(\n        (node->getLayout().measuredDimensions[dim[mainAxis]] -\n         child->getLayout().measuredDimensions[dim[mainAxis]]),\n        leading[mainAxis]);\n  }\n\n  if (YGNodeIsTrailingPosDefined(child, crossAxis) &&\n      !YGNodeIsLeadingPosDefined(child, crossAxis)) {\n    child->setLayoutPosition(\n        node->getLayout().measuredDimensions[dim[crossAxis]] -\n            child->getLayout().measuredDimensions[dim[crossAxis]] -\n            YGNodeTrailingBorder(node, crossAxis) -\n            YGNodeTrailingMargin(child, crossAxis, width) -\n            YGNodeTrailingPosition(\n                child, crossAxis, isMainAxisRow ? height : width),\n        leading[crossAxis]);\n\n  } else if (!YGNodeIsLeadingPosDefined(child, crossAxis) &&\n             YGNodeAlignItem(node, child) == YGAlignCenter) {\n    child->setLayoutPosition(\n        (node->getLayout().measuredDimensions[dim[crossAxis]] -\n         child->getLayout().measuredDimensions[dim[crossAxis]]) /\n            2.0f,\n        leading[crossAxis]);\n  } else if (\n      !YGNodeIsLeadingPosDefined(child, crossAxis) &&\n      ((YGNodeAlignItem(node, child) == YGAlignFlexEnd) ^\n       (node->getStyle().flexWrap == YGWrapWrapReverse))) {\n    child->setLayoutPosition(\n        (node->getLayout().measuredDimensions[dim[crossAxis]] -\n         child->getLayout().measuredDimensions[dim[crossAxis]]),\n        leading[crossAxis]);\n  }\n}\n\nstatic void YGNodeWithMeasureFuncSetMeasuredDimensions(const YGNodeRef node,\n                                                       const float availableWidth,\n                                                       const float availableHeight,\n                                                       const YGMeasureMode widthMeasureMode,\n                                                       const YGMeasureMode heightMeasureMode,\n                                                       const float parentWidth,\n                                                       const float parentHeight) {\n  YGAssertWithNode(\n      node,\n      node->getMeasure() != nullptr,\n      \"Expected node to have custom measure function\");\n\n  const float paddingAndBorderAxisRow =\n      YGNodePaddingAndBorderForAxis(node, YGFlexDirectionRow, availableWidth);\n  const float paddingAndBorderAxisColumn =\n      YGNodePaddingAndBorderForAxis(node, YGFlexDirectionColumn, availableWidth);\n  const float marginAxisRow = YGNodeMarginForAxis(node, YGFlexDirectionRow, availableWidth);\n  const float marginAxisColumn = YGNodeMarginForAxis(node, YGFlexDirectionColumn, availableWidth);\n\n  // We want to make sure we don't call measure with negative size\n  const float innerWidth = YGFloatIsUndefined(availableWidth)\n                               ? availableWidth\n                               : fmaxf(0, availableWidth - marginAxisRow - paddingAndBorderAxisRow);\n  const float innerHeight =\n      YGFloatIsUndefined(availableHeight)\n          ? availableHeight\n          : fmaxf(0, availableHeight - marginAxisColumn - paddingAndBorderAxisColumn);\n\n  if (widthMeasureMode == YGMeasureModeExactly && heightMeasureMode == YGMeasureModeExactly) {\n    // Don't bother sizing the text if both dimensions are already defined.\n    node->setLayoutMeasuredDimension(\n        YGNodeBoundAxis(\n            node,\n            YGFlexDirectionRow,\n            availableWidth - marginAxisRow,\n            parentWidth,\n            parentWidth),\n        YGDimensionWidth);\n    node->setLayoutMeasuredDimension(\n        YGNodeBoundAxis(\n            node,\n            YGFlexDirectionColumn,\n            availableHeight - marginAxisColumn,\n            parentHeight,\n            parentWidth),\n        YGDimensionHeight);\n  } else {\n    // Measure the text under the current constraints.\n    const YGSize measuredSize = node->getMeasure()(\n        node, innerWidth, widthMeasureMode, innerHeight, heightMeasureMode);\n\n    node->setLayoutMeasuredDimension(\n        YGNodeBoundAxis(\n            node,\n            YGFlexDirectionRow,\n            (widthMeasureMode == YGMeasureModeUndefined ||\n             widthMeasureMode == YGMeasureModeAtMost)\n                ? measuredSize.width + paddingAndBorderAxisRow\n                : availableWidth - marginAxisRow,\n            parentWidth,\n            parentWidth),\n        YGDimensionWidth);\n\n    node->setLayoutMeasuredDimension(\n        YGNodeBoundAxis(\n            node,\n            YGFlexDirectionColumn,\n            (heightMeasureMode == YGMeasureModeUndefined ||\n             heightMeasureMode == YGMeasureModeAtMost)\n                ? measuredSize.height + paddingAndBorderAxisColumn\n                : availableHeight - marginAxisColumn,\n            parentHeight,\n            parentWidth),\n        YGDimensionHeight);\n  }\n}\n\n// For nodes with no children, use the available values if they were provided,\n// or the minimum size as indicated by the padding and border sizes.\nstatic void YGNodeEmptyContainerSetMeasuredDimensions(const YGNodeRef node,\n                                                      const float availableWidth,\n                                                      const float availableHeight,\n                                                      const YGMeasureMode widthMeasureMode,\n                                                      const YGMeasureMode heightMeasureMode,\n                                                      const float parentWidth,\n                                                      const float parentHeight) {\n  const float paddingAndBorderAxisRow =\n      YGNodePaddingAndBorderForAxis(node, YGFlexDirectionRow, parentWidth);\n  const float paddingAndBorderAxisColumn =\n      YGNodePaddingAndBorderForAxis(node, YGFlexDirectionColumn, parentWidth);\n  const float marginAxisRow = YGNodeMarginForAxis(node, YGFlexDirectionRow, parentWidth);\n  const float marginAxisColumn = YGNodeMarginForAxis(node, YGFlexDirectionColumn, parentWidth);\n\n  node->setLayoutMeasuredDimension(\n      YGNodeBoundAxis(\n          node,\n          YGFlexDirectionRow,\n          (widthMeasureMode == YGMeasureModeUndefined ||\n           widthMeasureMode == YGMeasureModeAtMost)\n              ? paddingAndBorderAxisRow\n              : availableWidth - marginAxisRow,\n          parentWidth,\n          parentWidth),\n      YGDimensionWidth);\n\n  node->setLayoutMeasuredDimension(\n      YGNodeBoundAxis(\n          node,\n          YGFlexDirectionColumn,\n          (heightMeasureMode == YGMeasureModeUndefined ||\n           heightMeasureMode == YGMeasureModeAtMost)\n              ? paddingAndBorderAxisColumn\n              : availableHeight - marginAxisColumn,\n          parentHeight,\n          parentWidth),\n      YGDimensionHeight);\n}\n\nstatic bool YGNodeFixedSizeSetMeasuredDimensions(const YGNodeRef node,\n                                                 const float availableWidth,\n                                                 const float availableHeight,\n                                                 const YGMeasureMode widthMeasureMode,\n                                                 const YGMeasureMode heightMeasureMode,\n                                                 const float parentWidth,\n                                                 const float parentHeight) {\n  if ((widthMeasureMode == YGMeasureModeAtMost && availableWidth <= 0.0f) ||\n      (heightMeasureMode == YGMeasureModeAtMost && availableHeight <= 0.0f) ||\n      (widthMeasureMode == YGMeasureModeExactly && heightMeasureMode == YGMeasureModeExactly)) {\n    const float marginAxisColumn = YGNodeMarginForAxis(node, YGFlexDirectionColumn, parentWidth);\n    const float marginAxisRow = YGNodeMarginForAxis(node, YGFlexDirectionRow, parentWidth);\n\n    node->setLayoutMeasuredDimension(\n        YGNodeBoundAxis(\n            node,\n            YGFlexDirectionRow,\n            YGFloatIsUndefined(availableWidth) ||\n                    (widthMeasureMode == YGMeasureModeAtMost &&\n                     availableWidth < 0.0f)\n                ? 0.0f\n                : availableWidth - marginAxisRow,\n            parentWidth,\n            parentWidth),\n        YGDimensionWidth);\n\n    node->setLayoutMeasuredDimension(\n        YGNodeBoundAxis(\n            node,\n            YGFlexDirectionColumn,\n            YGFloatIsUndefined(availableHeight) ||\n                    (heightMeasureMode == YGMeasureModeAtMost &&\n                     availableHeight < 0.0f)\n                ? 0.0f\n                : availableHeight - marginAxisColumn,\n            parentHeight,\n            parentWidth),\n        YGDimensionHeight);\n    return true;\n  }\n\n  return false;\n}\n\nstatic void YGZeroOutLayoutRecursivly(const YGNodeRef node) {\n  memset(&(node->getLayout()), 0, sizeof(YGLayout));\n  node->setHasNewLayout(true);\n  node->cloneChildrenIfNeeded();\n  const uint32_t childCount = YGNodeGetChildCount(node);\n  for (uint32_t i = 0; i < childCount; i++) {\n    const YGNodeRef child = node->getChild(i);\n    YGZeroOutLayoutRecursivly(child);\n  }\n}\n\n//\n// This is the main routine that implements a subset of the flexbox layout\n// algorithm\n// described in the W3C YG documentation: https://www.w3.org/TR/YG3-flexbox/.\n//\n// Limitations of this algorithm, compared to the full standard:\n//  * Display property is always assumed to be 'flex' except for Text nodes,\n//  which\n//    are assumed to be 'inline-flex'.\n//  * The 'zIndex' property (or any form of z ordering) is not supported. Nodes\n//  are\n//    stacked in document order.\n//  * The 'order' property is not supported. The order of flex items is always\n//  defined\n//    by document order.\n//  * The 'visibility' property is always assumed to be 'visible'. Values of\n//  'collapse'\n//    and 'hidden' are not supported.\n//  * There is no support for forced breaks.\n//  * It does not support vertical inline directions (top-to-bottom or\n//  bottom-to-top text).\n//\n// Deviations from standard:\n//  * Section 4.5 of the spec indicates that all flex items have a default\n//  minimum\n//    main size. For text blocks, for example, this is the width of the widest\n//    word.\n//    Calculating the minimum width is expensive, so we forego it and assume a\n//    default\n//    minimum main size of 0.\n//  * Min/Max sizes in the main axis are not honored when resolving flexible\n//  lengths.\n//  * The spec indicates that the default value for 'flexDirection' is 'row',\n//  but\n//    the algorithm below assumes a default of 'column'.\n//\n// Input parameters:\n//    - node: current node to be sized and layed out\n//    - availableWidth & availableHeight: available size to be used for sizing\n//    the node\n//      or YGUndefined if the size is not available; interpretation depends on\n//      layout\n//      flags\n//    - parentDirection: the inline (text) direction within the parent\n//    (left-to-right or\n//      right-to-left)\n//    - widthMeasureMode: indicates the sizing rules for the width (see below\n//    for explanation)\n//    - heightMeasureMode: indicates the sizing rules for the height (see below\n//    for explanation)\n//    - performLayout: specifies whether the caller is interested in just the\n//    dimensions\n//      of the node or it requires the entire node and its subtree to be layed\n//      out\n//      (with final positions)\n//\n// Details:\n//    This routine is called recursively to lay out subtrees of flexbox\n//    elements. It uses the\n//    information in node.style, which is treated as a read-only input. It is\n//    responsible for\n//    setting the layout.direction and layout.measuredDimensions fields for the\n//    input node as well\n//    as the layout.position and layout.lineIndex fields for its child nodes.\n//    The\n//    layout.measuredDimensions field includes any border or padding for the\n//    node but does\n//    not include margins.\n//\n//    The spec describes four different layout modes: \"fill available\", \"max\n//    content\", \"min\n//    content\",\n//    and \"fit content\". Of these, we don't use \"min content\" because we don't\n//    support default\n//    minimum main sizes (see above for details). Each of our measure modes maps\n//    to a layout mode\n//    from the spec (https://www.w3.org/TR/YG3-sizing/#terms):\n//      - YGMeasureModeUndefined: max content\n//      - YGMeasureModeExactly: fill available\n//      - YGMeasureModeAtMost: fit content\n//\n//    When calling YGNodelayoutImpl and YGLayoutNodeInternal, if the caller passes\n//    an available size of\n//    undefined then it must also pass a measure mode of YGMeasureModeUndefined\n//    in that dimension.\n//\nstatic void YGNodelayoutImpl(const YGNodeRef node,\n                             const float availableWidth,\n                             const float availableHeight,\n                             const YGDirection parentDirection,\n                             const YGMeasureMode widthMeasureMode,\n                             const YGMeasureMode heightMeasureMode,\n                             const float parentWidth,\n                             const float parentHeight,\n                             const bool performLayout,\n                             const YGConfigRef config) {\n  YGAssertWithNode(node,\n                   YGFloatIsUndefined(availableWidth) ? widthMeasureMode == YGMeasureModeUndefined\n                                                      : true,\n                   \"availableWidth is indefinite so widthMeasureMode must be \"\n                   \"YGMeasureModeUndefined\");\n  YGAssertWithNode(node,\n                   YGFloatIsUndefined(availableHeight) ? heightMeasureMode == YGMeasureModeUndefined\n                                                       : true,\n                   \"availableHeight is indefinite so heightMeasureMode must be \"\n                   \"YGMeasureModeUndefined\");\n\n  // Set the resolved resolution in the node's layout.\n  const YGDirection direction = YGNodeResolveDirection(node, parentDirection);\n  node->setLayoutDirection(direction);\n\n  const YGFlexDirection flexRowDirection = YGResolveFlexDirection(YGFlexDirectionRow, direction);\n  const YGFlexDirection flexColumnDirection =\n      YGResolveFlexDirection(YGFlexDirectionColumn, direction);\n\n  node->setLayoutMargin(\n      YGNodeLeadingMargin(node, flexRowDirection, parentWidth), YGEdgeStart);\n  node->setLayoutMargin(\n      YGNodeTrailingMargin(node, flexRowDirection, parentWidth), YGEdgeEnd);\n  node->setLayoutMargin(\n      YGNodeLeadingMargin(node, flexColumnDirection, parentWidth), YGEdgeTop);\n  node->setLayoutMargin(\n      YGNodeTrailingMargin(node, flexColumnDirection, parentWidth),\n      YGEdgeBottom);\n\n  node->setLayoutBorder(\n      YGNodeLeadingBorder(node, flexRowDirection), YGEdgeStart);\n  node->setLayoutBorder(\n      YGNodeTrailingBorder(node, flexRowDirection), YGEdgeEnd);\n  node->setLayoutBorder(\n      YGNodeLeadingBorder(node, flexColumnDirection), YGEdgeTop);\n  node->setLayoutBorder(\n      YGNodeTrailingBorder(node, flexColumnDirection), YGEdgeBottom);\n\n  node->setLayoutPadding(\n      YGNodeLeadingPadding(node, flexRowDirection, parentWidth), YGEdgeStart);\n  node->setLayoutPadding(\n      YGNodeTrailingPadding(node, flexRowDirection, parentWidth), YGEdgeEnd);\n  node->setLayoutPadding(\n      YGNodeLeadingPadding(node, flexColumnDirection, parentWidth), YGEdgeTop);\n  node->setLayoutPadding(\n      YGNodeTrailingPadding(node, flexColumnDirection, parentWidth),\n      YGEdgeBottom);\n\n  if (node->getMeasure() != nullptr) {\n    YGNodeWithMeasureFuncSetMeasuredDimensions(node,\n                                               availableWidth,\n                                               availableHeight,\n                                               widthMeasureMode,\n                                               heightMeasureMode,\n                                               parentWidth,\n                                               parentHeight);\n    return;\n  }\n\n  const uint32_t childCount = node->getChildren().size();\n  if (childCount == 0) {\n    YGNodeEmptyContainerSetMeasuredDimensions(node,\n                                              availableWidth,\n                                              availableHeight,\n                                              widthMeasureMode,\n                                              heightMeasureMode,\n                                              parentWidth,\n                                              parentHeight);\n    return;\n  }\n\n  // If we're not being asked to perform a full layout we can skip the algorithm if we already know\n  // the size\n  if (!performLayout && YGNodeFixedSizeSetMeasuredDimensions(node,\n                                                             availableWidth,\n                                                             availableHeight,\n                                                             widthMeasureMode,\n                                                             heightMeasureMode,\n                                                             parentWidth,\n                                                             parentHeight)) {\n    return;\n  }\n\n  // At this point we know we're going to perform work. Ensure that each child has a mutable copy.\n  node->cloneChildrenIfNeeded();\n  // Reset layout flags, as they could have changed.\n  node->setLayoutHadOverflow(false);\n\n  // STEP 1: CALCULATE VALUES FOR REMAINDER OF ALGORITHM\n  const YGFlexDirection mainAxis =\n      YGResolveFlexDirection(node->getStyle().flexDirection, direction);\n  const YGFlexDirection crossAxis = YGFlexDirectionCross(mainAxis, direction);\n  const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis);\n  const YGJustify justifyContent = node->getStyle().justifyContent;\n  const bool isNodeFlexWrap = node->getStyle().flexWrap != YGWrapNoWrap;\n\n  const float mainAxisParentSize = isMainAxisRow ? parentWidth : parentHeight;\n  const float crossAxisParentSize = isMainAxisRow ? parentHeight : parentWidth;\n\n  YGNodeRef firstAbsoluteChild = nullptr;\n  YGNodeRef currentAbsoluteChild = nullptr;\n\n  const float leadingPaddingAndBorderMain =\n      YGNodeLeadingPaddingAndBorder(node, mainAxis, parentWidth);\n  const float trailingPaddingAndBorderMain =\n      YGNodeTrailingPaddingAndBorder(node, mainAxis, parentWidth);\n  const float leadingPaddingAndBorderCross =\n      YGNodeLeadingPaddingAndBorder(node, crossAxis, parentWidth);\n  const float paddingAndBorderAxisMain = YGNodePaddingAndBorderForAxis(node, mainAxis, parentWidth);\n  const float paddingAndBorderAxisCross =\n      YGNodePaddingAndBorderForAxis(node, crossAxis, parentWidth);\n\n  YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode;\n  YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode;\n\n  const float paddingAndBorderAxisRow =\n      isMainAxisRow ? paddingAndBorderAxisMain : paddingAndBorderAxisCross;\n  const float paddingAndBorderAxisColumn =\n      isMainAxisRow ? paddingAndBorderAxisCross : paddingAndBorderAxisMain;\n\n  const float marginAxisRow = YGNodeMarginForAxis(node, YGFlexDirectionRow, parentWidth);\n  const float marginAxisColumn = YGNodeMarginForAxis(node, YGFlexDirectionColumn, parentWidth);\n\n  // STEP 2: DETERMINE AVAILABLE SIZE IN MAIN AND CROSS DIRECTIONS\n  const float minInnerWidth =\n      YGResolveValue(\n          node->getStyle().minDimensions[YGDimensionWidth], parentWidth) -\n      paddingAndBorderAxisRow;\n  const float maxInnerWidth =\n      YGResolveValue(\n          node->getStyle().maxDimensions[YGDimensionWidth], parentWidth) -\n      paddingAndBorderAxisRow;\n  const float minInnerHeight =\n      YGResolveValue(\n          node->getStyle().minDimensions[YGDimensionHeight], parentHeight) -\n      paddingAndBorderAxisColumn;\n  const float maxInnerHeight =\n      YGResolveValue(\n          node->getStyle().maxDimensions[YGDimensionHeight], parentHeight) -\n      paddingAndBorderAxisColumn;\n  const float minInnerMainDim = isMainAxisRow ? minInnerWidth : minInnerHeight;\n  const float maxInnerMainDim = isMainAxisRow ? maxInnerWidth : maxInnerHeight;\n\n  // Max dimension overrides predefined dimension value; Min dimension in turn overrides both of the\n  // above\n  float availableInnerWidth = availableWidth - marginAxisRow - paddingAndBorderAxisRow;\n  if (!YGFloatIsUndefined(availableInnerWidth)) {\n    // We want to make sure our available width does not violate min and max constraints\n    availableInnerWidth = fmaxf(fminf(availableInnerWidth, maxInnerWidth), minInnerWidth);\n  }\n\n  float availableInnerHeight = availableHeight - marginAxisColumn - paddingAndBorderAxisColumn;\n  if (!YGFloatIsUndefined(availableInnerHeight)) {\n    // We want to make sure our available height does not violate min and max constraints\n    availableInnerHeight = fmaxf(fminf(availableInnerHeight, maxInnerHeight), minInnerHeight);\n  }\n\n  float availableInnerMainDim = isMainAxisRow ? availableInnerWidth : availableInnerHeight;\n  const float availableInnerCrossDim = isMainAxisRow ? availableInnerHeight : availableInnerWidth;\n\n  // If there is only one child with flexGrow + flexShrink it means we can set the\n  // computedFlexBasis to 0 instead of measuring and shrinking / flexing the child to exactly\n  // match the remaining space\n  YGNodeRef singleFlexChild = nullptr;\n  if (measureModeMainDim == YGMeasureModeExactly) {\n    for (uint32_t i = 0; i < childCount; i++) {\n      const YGNodeRef child = YGNodeGetChild(node, i);\n      if (singleFlexChild) {\n        if (YGNodeIsFlex(child)) {\n          // There is already a flexible child, abort.\n          singleFlexChild = nullptr;\n          break;\n        }\n      } else if (\n          child->resolveFlexGrow() > 0.0f &&\n          child->resolveFlexShrink() > 0.0f) {\n        singleFlexChild = child;\n      }\n    }\n  }\n\n  float totalOuterFlexBasis = 0;\n\n  // STEP 3: DETERMINE FLEX BASIS FOR EACH ITEM\n  for (uint32_t i = 0; i < childCount; i++) {\n    const YGNodeRef child = node->getChild(i);\n    if (child->getStyle().display == YGDisplayNone) {\n      YGZeroOutLayoutRecursivly(child);\n      child->setHasNewLayout(true);\n      child->setDirty(false);\n      continue;\n    }\n    child->resolveDimension();\n    if (performLayout) {\n      // Set the initial position (relative to the parent).\n      const YGDirection childDirection = YGNodeResolveDirection(child, direction);\n      YGNodeSetPosition(child,\n                        childDirection,\n                        availableInnerMainDim,\n                        availableInnerCrossDim,\n                        availableInnerWidth);\n    }\n\n    // Absolute-positioned children don't participate in flex layout. Add them\n    // to a list that we can process later.\n    if (child->getStyle().positionType == YGPositionTypeAbsolute) {\n      // Store a private linked list of absolutely positioned children\n      // so that we can efficiently traverse them later.\n      if (firstAbsoluteChild == nullptr) {\n        firstAbsoluteChild = child;\n      }\n      if (currentAbsoluteChild != nullptr) {\n        currentAbsoluteChild->setNextChild(child);\n      }\n      currentAbsoluteChild = child;\n      child->setNextChild(nullptr);\n    } else {\n      if (child == singleFlexChild) {\n        child->setLayoutComputedFlexBasisGeneration(gCurrentGenerationCount);\n        child->setLayoutComputedFlexBasis(0);\n      } else {\n        YGNodeComputeFlexBasisForChild(node,\n                                       child,\n                                       availableInnerWidth,\n                                       widthMeasureMode,\n                                       availableInnerHeight,\n                                       availableInnerWidth,\n                                       availableInnerHeight,\n                                       heightMeasureMode,\n                                       direction,\n                                       config);\n      }\n    }\n\n    totalOuterFlexBasis += child->getLayout().computedFlexBasis +\n        YGNodeMarginForAxis(child, mainAxis, availableInnerWidth);\n    ;\n  }\n\n  const bool flexBasisOverflows = measureModeMainDim == YGMeasureModeUndefined\n                                      ? false\n                                      : totalOuterFlexBasis > availableInnerMainDim;\n  if (isNodeFlexWrap && flexBasisOverflows && measureModeMainDim == YGMeasureModeAtMost) {\n    measureModeMainDim = YGMeasureModeExactly;\n  }\n\n  // STEP 4: COLLECT FLEX ITEMS INTO FLEX LINES\n\n  // Indexes of children that represent the first and last items in the line.\n  uint32_t startOfLineIndex = 0;\n  uint32_t endOfLineIndex = 0;\n\n  // Number of lines.\n  uint32_t lineCount = 0;\n\n  // Accumulated cross dimensions of all lines so far.\n  float totalLineCrossDim = 0;\n\n  // Max main dimension of all the lines.\n  float maxLineMainDim = 0;\n\n  for (; endOfLineIndex < childCount; lineCount++, startOfLineIndex = endOfLineIndex) {\n    // Number of items on the currently line. May be different than the\n    // difference\n    // between start and end indicates because we skip over absolute-positioned\n    // items.\n    uint32_t itemsOnLine = 0;\n\n    // sizeConsumedOnCurrentLine is accumulation of the dimensions and margin\n    // of all the children on the current line. This will be used in order to\n    // either set the dimensions of the node if none already exist or to compute\n    // the remaining space left for the flexible children.\n    float sizeConsumedOnCurrentLine = 0;\n    float sizeConsumedOnCurrentLineIncludingMinConstraint = 0;\n\n    float totalFlexGrowFactors = 0;\n    float totalFlexShrinkScaledFactors = 0;\n\n    // Maintain a linked list of the child nodes that can shrink and/or grow.\n    YGNodeRef firstRelativeChild = nullptr;\n    YGNodeRef currentRelativeChild = nullptr;\n\n    // Add items to the current line until it's full or we run out of items.\n    for (uint32_t i = startOfLineIndex; i < childCount; i++, endOfLineIndex++) {\n      const YGNodeRef child = node->getChild(i);\n      if (child->getStyle().display == YGDisplayNone) {\n        continue;\n      }\n      child->setLineIndex(lineCount);\n\n      if (child->getStyle().positionType != YGPositionTypeAbsolute) {\n        const float childMarginMainAxis = YGNodeMarginForAxis(child, mainAxis, availableInnerWidth);\n        const float flexBasisWithMaxConstraints = fminf(\n            YGResolveValue(\n                child->getStyle().maxDimensions[dim[mainAxis]],\n                mainAxisParentSize),\n            child->getLayout().computedFlexBasis);\n        const float flexBasisWithMinAndMaxConstraints = fmaxf(\n            YGResolveValue(\n                child->getStyle().minDimensions[dim[mainAxis]],\n                mainAxisParentSize),\n            flexBasisWithMaxConstraints);\n\n        // If this is a multi-line flow and this item pushes us over the\n        // available size, we've\n        // hit the end of the current line. Break out of the loop and lay out\n        // the current line.\n        if (sizeConsumedOnCurrentLineIncludingMinConstraint + flexBasisWithMinAndMaxConstraints +\n                    childMarginMainAxis >\n                availableInnerMainDim &&\n            isNodeFlexWrap && itemsOnLine > 0) {\n          break;\n        }\n\n        sizeConsumedOnCurrentLineIncludingMinConstraint +=\n            flexBasisWithMinAndMaxConstraints + childMarginMainAxis;\n        sizeConsumedOnCurrentLine += flexBasisWithMinAndMaxConstraints + childMarginMainAxis;\n        itemsOnLine++;\n\n        if (YGNodeIsFlex(child)) {\n          totalFlexGrowFactors += child->resolveFlexGrow();\n\n          // Unlike the grow factor, the shrink factor is scaled relative to the child dimension.\n          totalFlexShrinkScaledFactors += -child->resolveFlexShrink() *\n              child->getLayout().computedFlexBasis;\n        }\n\n        // Store a private linked list of children that need to be layed out.\n        if (firstRelativeChild == nullptr) {\n          firstRelativeChild = child;\n        }\n        if (currentRelativeChild != nullptr) {\n          currentRelativeChild->setNextChild(child);\n        }\n        currentRelativeChild = child;\n        child->setNextChild(nullptr);\n      }\n    }\n\n    // The total flex factor needs to be floored to 1.\n    if (totalFlexGrowFactors > 0 && totalFlexGrowFactors < 1) {\n      totalFlexGrowFactors = 1;\n    }\n\n    // The total flex shrink factor needs to be floored to 1.\n    if (totalFlexShrinkScaledFactors > 0 && totalFlexShrinkScaledFactors < 1) {\n      totalFlexShrinkScaledFactors = 1;\n    }\n\n    // If we don't need to measure the cross axis, we can skip the entire flex\n    // step.\n    const bool canSkipFlex = !performLayout && measureModeCrossDim == YGMeasureModeExactly;\n\n    // In order to position the elements in the main axis, we have two\n    // controls. The space between the beginning and the first element\n    // and the space between each two elements.\n    float leadingMainDim = 0;\n    float betweenMainDim = 0;\n\n    // STEP 5: RESOLVING FLEXIBLE LENGTHS ON MAIN AXIS\n    // Calculate the remaining available space that needs to be allocated.\n    // If the main dimension size isn't known, it is computed based on\n    // the line length, so there's no more space left to distribute.\n\n    bool sizeBasedOnContent = false;\n    // If we don't measure with exact main dimension we want to ensure we don't violate min and max\n    if (measureModeMainDim != YGMeasureModeExactly) {\n      if (!YGFloatIsUndefined(minInnerMainDim) && sizeConsumedOnCurrentLine < minInnerMainDim) {\n        availableInnerMainDim = minInnerMainDim;\n      } else if (!YGFloatIsUndefined(maxInnerMainDim) &&\n                 sizeConsumedOnCurrentLine > maxInnerMainDim) {\n        availableInnerMainDim = maxInnerMainDim;\n      } else {\n        if (!node->getConfig()->useLegacyStretchBehaviour &&\n            (totalFlexGrowFactors == 0 || node->resolveFlexGrow() == 0)) {\n          // If we don't have any children to flex or we can't flex the node itself,\n          // space we've used is all space we need. Root node also should be shrunk to minimum\n          availableInnerMainDim = sizeConsumedOnCurrentLine;\n        }\n        sizeBasedOnContent = !node->getConfig()->useLegacyStretchBehaviour;\n      }\n    }\n\n    float remainingFreeSpace = 0;\n    if (!sizeBasedOnContent && !YGFloatIsUndefined(availableInnerMainDim)) {\n      remainingFreeSpace = availableInnerMainDim - sizeConsumedOnCurrentLine;\n    } else if (sizeConsumedOnCurrentLine < 0) {\n      // availableInnerMainDim is indefinite which means the node is being sized based on its\n      // content.\n      // sizeConsumedOnCurrentLine is negative which means the node will allocate 0 points for\n      // its content. Consequently, remainingFreeSpace is 0 - sizeConsumedOnCurrentLine.\n      remainingFreeSpace = -sizeConsumedOnCurrentLine;\n    }\n\n    const float originalRemainingFreeSpace = remainingFreeSpace;\n    float deltaFreeSpace = 0;\n\n    if (!canSkipFlex) {\n      float childFlexBasis;\n      float flexShrinkScaledFactor;\n      float flexGrowFactor;\n      float baseMainSize;\n      float boundMainSize;\n\n      // Do two passes over the flex items to figure out how to distribute the\n      // remaining space.\n      // The first pass finds the items whose min/max constraints trigger,\n      // freezes them at those\n      // sizes, and excludes those sizes from the remaining space. The second\n      // pass sets the size\n      // of each flexible item. It distributes the remaining space amongst the\n      // items whose min/max\n      // constraints didn't trigger in pass 1. For the other items, it sets\n      // their sizes by forcing\n      // their min/max constraints to trigger again.\n      //\n      // This two pass approach for resolving min/max constraints deviates from\n      // the spec. The\n      // spec (https://www.w3.org/TR/YG-flexbox-1/#resolve-flexible-lengths)\n      // describes a process\n      // that needs to be repeated a variable number of times. The algorithm\n      // implemented here\n      // won't handle all cases but it was simpler to implement and it mitigates\n      // performance\n      // concerns because we know exactly how many passes it'll do.\n\n      // First pass: detect the flex items whose min/max constraints trigger\n      float deltaFlexShrinkScaledFactors = 0;\n      float deltaFlexGrowFactors = 0;\n      currentRelativeChild = firstRelativeChild;\n      while (currentRelativeChild != nullptr) {\n        childFlexBasis = fminf(\n            YGResolveValue(\n                currentRelativeChild->getStyle().maxDimensions[dim[mainAxis]],\n                mainAxisParentSize),\n            fmaxf(\n                YGResolveValue(\n                    currentRelativeChild->getStyle()\n                        .minDimensions[dim[mainAxis]],\n                    mainAxisParentSize),\n                currentRelativeChild->getLayout().computedFlexBasis));\n\n        if (remainingFreeSpace < 0) {\n          flexShrinkScaledFactor =\n              -currentRelativeChild->resolveFlexShrink() * childFlexBasis;\n\n          // Is this child able to shrink?\n          if (flexShrinkScaledFactor != 0) {\n            baseMainSize =\n                childFlexBasis +\n                remainingFreeSpace / totalFlexShrinkScaledFactors * flexShrinkScaledFactor;\n            boundMainSize = YGNodeBoundAxis(currentRelativeChild,\n                                            mainAxis,\n                                            baseMainSize,\n                                            availableInnerMainDim,\n                                            availableInnerWidth);\n            if (baseMainSize != boundMainSize) {\n              // By excluding this item's size and flex factor from remaining,\n              // this item's\n              // min/max constraints should also trigger in the second pass\n              // resulting in the\n              // item's size calculation being identical in the first and second\n              // passes.\n              deltaFreeSpace -= boundMainSize - childFlexBasis;\n              deltaFlexShrinkScaledFactors -= flexShrinkScaledFactor;\n            }\n          }\n        } else if (remainingFreeSpace > 0) {\n          flexGrowFactor = currentRelativeChild->resolveFlexGrow();\n\n          // Is this child able to grow?\n          if (flexGrowFactor != 0) {\n            baseMainSize =\n                childFlexBasis + remainingFreeSpace / totalFlexGrowFactors * flexGrowFactor;\n            boundMainSize = YGNodeBoundAxis(currentRelativeChild,\n                                            mainAxis,\n                                            baseMainSize,\n                                            availableInnerMainDim,\n                                            availableInnerWidth);\n\n            if (baseMainSize != boundMainSize) {\n              // By excluding this item's size and flex factor from remaining,\n              // this item's\n              // min/max constraints should also trigger in the second pass\n              // resulting in the\n              // item's size calculation being identical in the first and second\n              // passes.\n              deltaFreeSpace -= boundMainSize - childFlexBasis;\n              deltaFlexGrowFactors -= flexGrowFactor;\n            }\n          }\n        }\n\n        currentRelativeChild = currentRelativeChild->getNextChild();\n      }\n\n      totalFlexShrinkScaledFactors += deltaFlexShrinkScaledFactors;\n      totalFlexGrowFactors += deltaFlexGrowFactors;\n      remainingFreeSpace += deltaFreeSpace;\n\n      // Second pass: resolve the sizes of the flexible items\n      deltaFreeSpace = 0;\n      currentRelativeChild = firstRelativeChild;\n      while (currentRelativeChild != nullptr) {\n        childFlexBasis = fminf(\n            YGResolveValue(\n                currentRelativeChild->getStyle().maxDimensions[dim[mainAxis]],\n                mainAxisParentSize),\n            fmaxf(\n                YGResolveValue(\n                    currentRelativeChild->getStyle()\n                        .minDimensions[dim[mainAxis]],\n                    mainAxisParentSize),\n                currentRelativeChild->getLayout().computedFlexBasis));\n        float updatedMainSize = childFlexBasis;\n\n        if (remainingFreeSpace < 0) {\n          flexShrinkScaledFactor =\n              -currentRelativeChild->resolveFlexShrink() * childFlexBasis;\n          // Is this child able to shrink?\n          if (flexShrinkScaledFactor != 0) {\n            float childSize;\n\n            if (totalFlexShrinkScaledFactors == 0) {\n              childSize = childFlexBasis + flexShrinkScaledFactor;\n            } else {\n              childSize =\n                  childFlexBasis +\n                  (remainingFreeSpace / totalFlexShrinkScaledFactors) * flexShrinkScaledFactor;\n            }\n\n            updatedMainSize = YGNodeBoundAxis(currentRelativeChild,\n                                              mainAxis,\n                                              childSize,\n                                              availableInnerMainDim,\n                                              availableInnerWidth);\n          }\n        } else if (remainingFreeSpace > 0) {\n          flexGrowFactor = currentRelativeChild->resolveFlexGrow();\n\n          // Is this child able to grow?\n          if (flexGrowFactor != 0) {\n            updatedMainSize =\n                YGNodeBoundAxis(currentRelativeChild,\n                                mainAxis,\n                                childFlexBasis +\n                                    remainingFreeSpace / totalFlexGrowFactors * flexGrowFactor,\n                                availableInnerMainDim,\n                                availableInnerWidth);\n          }\n        }\n\n        deltaFreeSpace -= updatedMainSize - childFlexBasis;\n\n        const float marginMain =\n            YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth);\n        const float marginCross =\n            YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth);\n\n        float childCrossSize;\n        float childMainSize = updatedMainSize + marginMain;\n        YGMeasureMode childCrossMeasureMode;\n        YGMeasureMode childMainMeasureMode = YGMeasureModeExactly;\n\n        if (!YGFloatIsUndefined(currentRelativeChild->getStyle().aspectRatio)) {\n          childCrossSize = isMainAxisRow ? (childMainSize - marginMain) /\n                  currentRelativeChild->getStyle().aspectRatio\n                                         : (childMainSize - marginMain) *\n                  currentRelativeChild->getStyle().aspectRatio;\n          childCrossMeasureMode = YGMeasureModeExactly;\n\n          childCrossSize += marginCross;\n        } else if (\n            !YGFloatIsUndefined(availableInnerCrossDim) &&\n            !YGNodeIsStyleDimDefined(\n                currentRelativeChild, crossAxis, availableInnerCrossDim) &&\n            measureModeCrossDim == YGMeasureModeExactly &&\n            !(isNodeFlexWrap && flexBasisOverflows) &&\n            YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch &&\n            currentRelativeChild->marginLeadingValue(crossAxis).unit !=\n                YGUnitAuto &&\n            currentRelativeChild->marginTrailingValue(crossAxis).unit !=\n                YGUnitAuto) {\n          childCrossSize = availableInnerCrossDim;\n          childCrossMeasureMode = YGMeasureModeExactly;\n        } else if (!YGNodeIsStyleDimDefined(currentRelativeChild,\n                                            crossAxis,\n                                            availableInnerCrossDim)) {\n          childCrossSize = availableInnerCrossDim;\n          childCrossMeasureMode =\n              YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost;\n        } else {\n          childCrossSize =\n              YGResolveValue(\n                  currentRelativeChild->getResolvedDimension(dim[crossAxis]),\n                  availableInnerCrossDim) +\n              marginCross;\n          const bool isLoosePercentageMeasurement =\n              currentRelativeChild->getResolvedDimension(dim[crossAxis]).unit ==\n                  YGUnitPercent &&\n              measureModeCrossDim != YGMeasureModeExactly;\n          childCrossMeasureMode =\n              YGFloatIsUndefined(childCrossSize) || isLoosePercentageMeasurement\n              ? YGMeasureModeUndefined\n              : YGMeasureModeExactly;\n        }\n\n        YGConstrainMaxSizeForMode(\n            currentRelativeChild,\n            mainAxis,\n            availableInnerMainDim,\n            availableInnerWidth,\n            &childMainMeasureMode,\n            &childMainSize);\n        YGConstrainMaxSizeForMode(\n            currentRelativeChild,\n            crossAxis,\n            availableInnerCrossDim,\n            availableInnerWidth,\n            &childCrossMeasureMode,\n            &childCrossSize);\n\n        const bool requiresStretchLayout =\n            !YGNodeIsStyleDimDefined(\n                currentRelativeChild, crossAxis, availableInnerCrossDim) &&\n            YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch &&\n            currentRelativeChild->marginLeadingValue(crossAxis).unit !=\n                YGUnitAuto &&\n            currentRelativeChild->marginTrailingValue(crossAxis).unit !=\n                YGUnitAuto;\n\n        const float childWidth = isMainAxisRow ? childMainSize : childCrossSize;\n        const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize;\n\n        const YGMeasureMode childWidthMeasureMode =\n            isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode;\n        const YGMeasureMode childHeightMeasureMode =\n            !isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode;\n\n        // Recursively call the layout algorithm for this child with the updated\n        // main size.\n        YGLayoutNodeInternal(currentRelativeChild,\n                             childWidth,\n                             childHeight,\n                             direction,\n                             childWidthMeasureMode,\n                             childHeightMeasureMode,\n                             availableInnerWidth,\n                             availableInnerHeight,\n                             performLayout && !requiresStretchLayout,\n                             \"flex\",\n                             config);\n        node->setLayoutHadOverflow(\n            node->getLayout().hadOverflow |\n            currentRelativeChild->getLayout().hadOverflow);\n        currentRelativeChild = currentRelativeChild->getNextChild();\n      }\n    }\n\n    remainingFreeSpace = originalRemainingFreeSpace + deltaFreeSpace;\n    node->setLayoutHadOverflow(\n        node->getLayout().hadOverflow | (remainingFreeSpace < 0));\n\n    // STEP 6: MAIN-AXIS JUSTIFICATION & CROSS-AXIS SIZE DETERMINATION\n\n    // At this point, all the children have their dimensions set in the main\n    // axis.\n    // Their dimensions are also set in the cross axis with the exception of\n    // items\n    // that are aligned \"stretch\". We need to compute these stretch values and\n    // set the final positions.\n\n    // If we are using \"at most\" rules in the main axis. Calculate the remaining space when\n    // constraint by the min size defined for the main axis.\n\n    if (measureModeMainDim == YGMeasureModeAtMost && remainingFreeSpace > 0) {\n      if (node->getStyle().minDimensions[dim[mainAxis]].unit !=\n              YGUnitUndefined &&\n          YGResolveValue(\n              node->getStyle().minDimensions[dim[mainAxis]],\n              mainAxisParentSize) >= 0) {\n        remainingFreeSpace = fmaxf(\n            0,\n            YGResolveValue(\n                node->getStyle().minDimensions[dim[mainAxis]],\n                mainAxisParentSize) -\n                (availableInnerMainDim - remainingFreeSpace));\n      } else {\n        remainingFreeSpace = 0;\n      }\n    }\n\n    int numberOfAutoMarginsOnCurrentLine = 0;\n    for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) {\n      const YGNodeRef child = node->getChild(i);\n      if (child->getStyle().positionType == YGPositionTypeRelative) {\n        if (child->marginLeadingValue(mainAxis).unit == YGUnitAuto) {\n          numberOfAutoMarginsOnCurrentLine++;\n        }\n        if (child->marginTrailingValue(mainAxis).unit == YGUnitAuto) {\n          numberOfAutoMarginsOnCurrentLine++;\n        }\n      }\n    }\n\n    if (numberOfAutoMarginsOnCurrentLine == 0) {\n      switch (justifyContent) {\n        case YGJustifyCenter:\n          leadingMainDim = remainingFreeSpace / 2;\n          break;\n        case YGJustifyFlexEnd:\n          leadingMainDim = remainingFreeSpace;\n          break;\n        case YGJustifySpaceBetween:\n          if (itemsOnLine > 1) {\n            betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1);\n          } else {\n            betweenMainDim = 0;\n          }\n          break;\n        case YGJustifySpaceEvenly:\n          // Space is distributed evenly across all elements\n          betweenMainDim = remainingFreeSpace / (itemsOnLine + 1);\n          leadingMainDim = betweenMainDim;\n          break;\n        case YGJustifySpaceAround:\n          // Space on the edges is half of the space between elements\n          betweenMainDim = remainingFreeSpace / itemsOnLine;\n          leadingMainDim = betweenMainDim / 2;\n          break;\n        case YGJustifyFlexStart:\n          break;\n      }\n    }\n\n    float mainDim = leadingPaddingAndBorderMain + leadingMainDim;\n    float crossDim = 0;\n\n    for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) {\n      const YGNodeRef child = node->getChild(i);\n      if (child->getStyle().display == YGDisplayNone) {\n        continue;\n      }\n      if (child->getStyle().positionType == YGPositionTypeAbsolute &&\n          YGNodeIsLeadingPosDefined(child, mainAxis)) {\n        if (performLayout) {\n          // In case the child is position absolute and has left/top being\n          // defined, we override the position to whatever the user said\n          // (and margin/border).\n          child->setLayoutPosition(\n              YGNodeLeadingPosition(child, mainAxis, availableInnerMainDim) +\n                  YGNodeLeadingBorder(node, mainAxis) +\n                  YGNodeLeadingMargin(child, mainAxis, availableInnerWidth),\n              pos[mainAxis]);\n        }\n      } else {\n        // Now that we placed the element, we need to update the variables.\n        // We need to do that only for relative elements. Absolute elements\n        // do not take part in that phase.\n        if (child->getStyle().positionType == YGPositionTypeRelative) {\n          if (child->marginLeadingValue(mainAxis).unit == YGUnitAuto) {\n            mainDim += remainingFreeSpace / numberOfAutoMarginsOnCurrentLine;\n          }\n\n          if (performLayout) {\n            child->setLayoutPosition(\n                child->getLayout().position[pos[mainAxis]] + mainDim,\n                pos[mainAxis]);\n          }\n\n          if (child->marginTrailingValue(mainAxis).unit == YGUnitAuto) {\n            mainDim += remainingFreeSpace / numberOfAutoMarginsOnCurrentLine;\n          }\n\n          if (canSkipFlex) {\n            // If we skipped the flex step, then we can't rely on the\n            // measuredDims because\n            // they weren't computed. This means we can't call YGNodeDimWithMargin.\n            mainDim += betweenMainDim +\n                YGNodeMarginForAxis(child, mainAxis, availableInnerWidth) +\n                child->getLayout().computedFlexBasis;\n            crossDim = availableInnerCrossDim;\n          } else {\n            // The main dimension is the sum of all the elements dimension plus the spacing.\n            mainDim += betweenMainDim + YGNodeDimWithMargin(child, mainAxis, availableInnerWidth);\n\n            // The cross dimension is the max of the elements dimension since\n            // there can only be one element in that cross dimension.\n            crossDim = fmaxf(crossDim, YGNodeDimWithMargin(child, crossAxis, availableInnerWidth));\n          }\n        } else if (performLayout) {\n          child->setLayoutPosition(\n              child->getLayout().position[pos[mainAxis]] +\n                  YGNodeLeadingBorder(node, mainAxis) + leadingMainDim,\n              pos[mainAxis]);\n        }\n      }\n    }\n\n    mainDim += trailingPaddingAndBorderMain;\n\n    float containerCrossAxis = availableInnerCrossDim;\n    if (measureModeCrossDim == YGMeasureModeUndefined ||\n        measureModeCrossDim == YGMeasureModeAtMost) {\n      // Compute the cross axis from the max cross dimension of the children.\n      containerCrossAxis = YGNodeBoundAxis(node,\n                                           crossAxis,\n                                           crossDim + paddingAndBorderAxisCross,\n                                           crossAxisParentSize,\n                                           parentWidth) -\n                           paddingAndBorderAxisCross;\n    }\n\n    // If there's no flex wrap, the cross dimension is defined by the container.\n    if (!isNodeFlexWrap && measureModeCrossDim == YGMeasureModeExactly) {\n      crossDim = availableInnerCrossDim;\n    }\n\n    // Clamp to the min/max size specified on the container.\n    crossDim = YGNodeBoundAxis(node,\n                               crossAxis,\n                               crossDim + paddingAndBorderAxisCross,\n                               crossAxisParentSize,\n                               parentWidth) -\n               paddingAndBorderAxisCross;\n\n    // STEP 7: CROSS-AXIS ALIGNMENT\n    // We can skip child alignment if we're just measuring the container.\n    if (performLayout) {\n      for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) {\n        const YGNodeRef child = node->getChild(i);\n        if (child->getStyle().display == YGDisplayNone) {\n          continue;\n        }\n        if (child->getStyle().positionType == YGPositionTypeAbsolute) {\n          // If the child is absolutely positioned and has a\n          // top/left/bottom/right\n          // set, override all the previously computed positions to set it\n          // correctly.\n          const bool isChildLeadingPosDefined = YGNodeIsLeadingPosDefined(child, crossAxis);\n          if (isChildLeadingPosDefined) {\n            child->setLayoutPosition(\n                YGNodeLeadingPosition(\n                    child, crossAxis, availableInnerCrossDim) +\n                    YGNodeLeadingBorder(node, crossAxis) +\n                    YGNodeLeadingMargin(child, crossAxis, availableInnerWidth),\n                pos[crossAxis]);\n          }\n          // If leading position is not defined or calculations result in Nan, default to border + margin\n          if (!isChildLeadingPosDefined ||\n              YGFloatIsUndefined(child->getLayout().position[pos[crossAxis]])) {\n            child->setLayoutPosition(\n                YGNodeLeadingBorder(node, crossAxis) +\n                    YGNodeLeadingMargin(child, crossAxis, availableInnerWidth),\n                pos[crossAxis]);\n          }\n        } else {\n          float leadingCrossDim = leadingPaddingAndBorderCross;\n\n          // For a relative children, we're either using alignItems (parent) or\n          // alignSelf (child) in order to determine the position in the cross\n          // axis\n          const YGAlign alignItem = YGNodeAlignItem(node, child);\n\n          // If the child uses align stretch, we need to lay it out one more\n          // time, this time\n          // forcing the cross-axis size to be the computed cross size for the\n          // current line.\n          if (alignItem == YGAlignStretch &&\n              child->marginLeadingValue(crossAxis).unit != YGUnitAuto &&\n              child->marginTrailingValue(crossAxis).unit != YGUnitAuto) {\n            // If the child defines a definite size for its cross axis, there's\n            // no need to stretch.\n            if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) {\n              float childMainSize =\n                  child->getLayout().measuredDimensions[dim[mainAxis]];\n              float childCrossSize =\n                  !YGFloatIsUndefined(child->getStyle().aspectRatio)\n                  ? ((YGNodeMarginForAxis(\n                          child, crossAxis, availableInnerWidth) +\n                      (isMainAxisRow\n                           ? childMainSize / child->getStyle().aspectRatio\n                           : childMainSize * child->getStyle().aspectRatio)))\n                  : crossDim;\n\n              childMainSize += YGNodeMarginForAxis(child, mainAxis, availableInnerWidth);\n\n              YGMeasureMode childMainMeasureMode = YGMeasureModeExactly;\n              YGMeasureMode childCrossMeasureMode = YGMeasureModeExactly;\n              YGConstrainMaxSizeForMode(child,\n                                        mainAxis,\n                                        availableInnerMainDim,\n                                        availableInnerWidth,\n                                        &childMainMeasureMode,\n                                        &childMainSize);\n              YGConstrainMaxSizeForMode(child,\n                                        crossAxis,\n                                        availableInnerCrossDim,\n                                        availableInnerWidth,\n                                        &childCrossMeasureMode,\n                                        &childCrossSize);\n\n              const float childWidth = isMainAxisRow ? childMainSize : childCrossSize;\n              const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize;\n\n              const YGMeasureMode childWidthMeasureMode =\n                  YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined\n                                                 : YGMeasureModeExactly;\n              const YGMeasureMode childHeightMeasureMode =\n                  YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined\n                                                  : YGMeasureModeExactly;\n\n              YGLayoutNodeInternal(\n                  child,\n                  childWidth,\n                  childHeight,\n                  direction,\n                  childWidthMeasureMode,\n                  childHeightMeasureMode,\n                  availableInnerWidth,\n                  availableInnerHeight,\n                  true,\n                  \"stretch\",\n                  config);\n            }\n          } else {\n            const float remainingCrossDim = containerCrossAxis -\n                YGNodeDimWithMargin(child, crossAxis, availableInnerWidth);\n\n            if (child->marginLeadingValue(crossAxis).unit == YGUnitAuto &&\n                child->marginTrailingValue(crossAxis).unit == YGUnitAuto) {\n              leadingCrossDim += fmaxf(0.0f, remainingCrossDim / 2);\n            } else if (\n                child->marginTrailingValue(crossAxis).unit == YGUnitAuto) {\n              // No-Op\n            } else if (\n                child->marginLeadingValue(crossAxis).unit == YGUnitAuto) {\n              leadingCrossDim += fmaxf(0.0f, remainingCrossDim);\n            } else if (alignItem == YGAlignFlexStart) {\n              // No-Op\n            } else if (alignItem == YGAlignCenter) {\n              leadingCrossDim += remainingCrossDim / 2;\n            } else {\n              leadingCrossDim += remainingCrossDim;\n            }\n          }\n          // And we apply the position\n          child->setLayoutPosition(\n              child->getLayout().position[pos[crossAxis]] + totalLineCrossDim +\n                  leadingCrossDim,\n              pos[crossAxis]);\n        }\n      }\n    }\n\n    totalLineCrossDim += crossDim;\n    maxLineMainDim = fmaxf(maxLineMainDim, mainDim);\n  }\n\n  // STEP 8: MULTI-LINE CONTENT ALIGNMENT\n  if (performLayout && (lineCount > 1 || YGIsBaselineLayout(node)) &&\n      !YGFloatIsUndefined(availableInnerCrossDim)) {\n    const float remainingAlignContentDim = availableInnerCrossDim - totalLineCrossDim;\n\n    float crossDimLead = 0;\n    float currentLead = leadingPaddingAndBorderCross;\n\n    switch (node->getStyle().alignContent) {\n      case YGAlignFlexEnd:\n        currentLead += remainingAlignContentDim;\n        break;\n      case YGAlignCenter:\n        currentLead += remainingAlignContentDim / 2;\n        break;\n      case YGAlignStretch:\n        if (availableInnerCrossDim > totalLineCrossDim) {\n          crossDimLead = remainingAlignContentDim / lineCount;\n        }\n        break;\n      case YGAlignSpaceAround:\n        if (availableInnerCrossDim > totalLineCrossDim) {\n          currentLead += remainingAlignContentDim / (2 * lineCount);\n          if (lineCount > 1) {\n            crossDimLead = remainingAlignContentDim / lineCount;\n          }\n        } else {\n          currentLead += remainingAlignContentDim / 2;\n        }\n        break;\n      case YGAlignSpaceBetween:\n        if (availableInnerCrossDim > totalLineCrossDim && lineCount > 1) {\n          crossDimLead = remainingAlignContentDim / (lineCount - 1);\n        }\n        break;\n      case YGAlignAuto:\n      case YGAlignFlexStart:\n      case YGAlignBaseline:\n        break;\n    }\n\n    uint32_t endIndex = 0;\n    for (uint32_t i = 0; i < lineCount; i++) {\n      const uint32_t startIndex = endIndex;\n      uint32_t ii;\n\n      // compute the line's height and find the endIndex\n      float lineHeight = 0;\n      float maxAscentForCurrentLine = 0;\n      float maxDescentForCurrentLine = 0;\n      for (ii = startIndex; ii < childCount; ii++) {\n        const YGNodeRef child = node->getChild(ii);\n        if (child->getStyle().display == YGDisplayNone) {\n          continue;\n        }\n        if (child->getStyle().positionType == YGPositionTypeRelative) {\n          if (child->getLineIndex() != i) {\n            break;\n          }\n          if (YGNodeIsLayoutDimDefined(child, crossAxis)) {\n            lineHeight = fmaxf(\n                lineHeight,\n                child->getLayout().measuredDimensions[dim[crossAxis]] +\n                    YGNodeMarginForAxis(child, crossAxis, availableInnerWidth));\n          }\n          if (YGNodeAlignItem(node, child) == YGAlignBaseline) {\n            const float ascent =\n                YGBaseline(child) +\n                YGNodeLeadingMargin(child, YGFlexDirectionColumn, availableInnerWidth);\n            const float descent =\n                child->getLayout().measuredDimensions[YGDimensionHeight] +\n                YGNodeMarginForAxis(\n                    child, YGFlexDirectionColumn, availableInnerWidth) -\n                ascent;\n            maxAscentForCurrentLine = fmaxf(maxAscentForCurrentLine, ascent);\n            maxDescentForCurrentLine = fmaxf(maxDescentForCurrentLine, descent);\n            lineHeight = fmaxf(lineHeight, maxAscentForCurrentLine + maxDescentForCurrentLine);\n          }\n        }\n      }\n      endIndex = ii;\n      lineHeight += crossDimLead;\n\n      if (performLayout) {\n        for (ii = startIndex; ii < endIndex; ii++) {\n          const YGNodeRef child = node->getChild(ii);\n          if (child->getStyle().display == YGDisplayNone) {\n            continue;\n          }\n          if (child->getStyle().positionType == YGPositionTypeRelative) {\n            switch (YGNodeAlignItem(node, child)) {\n              case YGAlignFlexStart: {\n                child->setLayoutPosition(\n                    currentLead +\n                        YGNodeLeadingMargin(\n                            child, crossAxis, availableInnerWidth),\n                    pos[crossAxis]);\n                break;\n              }\n              case YGAlignFlexEnd: {\n                child->setLayoutPosition(\n                    currentLead + lineHeight -\n                        YGNodeTrailingMargin(\n                            child, crossAxis, availableInnerWidth) -\n                        child->getLayout().measuredDimensions[dim[crossAxis]],\n                    pos[crossAxis]);\n                break;\n              }\n              case YGAlignCenter: {\n                float childHeight =\n                    child->getLayout().measuredDimensions[dim[crossAxis]];\n\n                child->setLayoutPosition(\n                    currentLead + (lineHeight - childHeight) / 2,\n                    pos[crossAxis]);\n                break;\n              }\n              case YGAlignStretch: {\n                child->setLayoutPosition(\n                    currentLead +\n                        YGNodeLeadingMargin(\n                            child, crossAxis, availableInnerWidth),\n                    pos[crossAxis]);\n\n                // Remeasure child with the line height as it as been only measured with the\n                // parents height yet.\n                if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) {\n                  const float childWidth = isMainAxisRow\n                      ? (child->getLayout()\n                             .measuredDimensions[YGDimensionWidth] +\n                         YGNodeMarginForAxis(\n                             child, mainAxis, availableInnerWidth))\n                      : lineHeight;\n\n                  const float childHeight = !isMainAxisRow\n                      ? (child->getLayout()\n                             .measuredDimensions[YGDimensionHeight] +\n                         YGNodeMarginForAxis(\n                             child, crossAxis, availableInnerWidth))\n                      : lineHeight;\n\n                  if (!(YGFloatsEqual(\n                            childWidth,\n                            child->getLayout()\n                                .measuredDimensions[YGDimensionWidth]) &&\n                        YGFloatsEqual(\n                            childHeight,\n                            child->getLayout()\n                                .measuredDimensions[YGDimensionHeight]))) {\n                    YGLayoutNodeInternal(child,\n                                         childWidth,\n                                         childHeight,\n                                         direction,\n                                         YGMeasureModeExactly,\n                                         YGMeasureModeExactly,\n                                         availableInnerWidth,\n                                         availableInnerHeight,\n                                         true,\n                                         \"multiline-stretch\",\n                                         config);\n                  }\n                }\n                break;\n              }\n              case YGAlignBaseline: {\n                child->setLayoutPosition(\n                    currentLead + maxAscentForCurrentLine - YGBaseline(child) +\n                        YGNodeLeadingPosition(\n                            child,\n                            YGFlexDirectionColumn,\n                            availableInnerCrossDim),\n                    YGEdgeTop);\n\n                break;\n              }\n              case YGAlignAuto:\n              case YGAlignSpaceBetween:\n              case YGAlignSpaceAround:\n                break;\n            }\n          }\n        }\n      }\n\n      currentLead += lineHeight;\n    }\n  }\n\n  // STEP 9: COMPUTING FINAL DIMENSIONS\n\n  node->setLayoutMeasuredDimension(\n      YGNodeBoundAxis(\n          node,\n          YGFlexDirectionRow,\n          availableWidth - marginAxisRow,\n          parentWidth,\n          parentWidth),\n      YGDimensionWidth);\n\n  node->setLayoutMeasuredDimension(\n      YGNodeBoundAxis(\n          node,\n          YGFlexDirectionColumn,\n          availableHeight - marginAxisColumn,\n          parentHeight,\n          parentWidth),\n      YGDimensionHeight);\n\n  // If the user didn't specify a width or height for the node, set the\n  // dimensions based on the children.\n  if (measureModeMainDim == YGMeasureModeUndefined ||\n      (node->getStyle().overflow != YGOverflowScroll &&\n       measureModeMainDim == YGMeasureModeAtMost)) {\n    // Clamp the size to the min/max size, if specified, and make sure it\n    // doesn't go below the padding and border amount.\n    node->setLayoutMeasuredDimension(\n        YGNodeBoundAxis(\n            node, mainAxis, maxLineMainDim, mainAxisParentSize, parentWidth),\n        dim[mainAxis]);\n\n  } else if (\n      measureModeMainDim == YGMeasureModeAtMost &&\n      node->getStyle().overflow == YGOverflowScroll) {\n    node->setLayoutMeasuredDimension(\n        fmaxf(\n            fminf(\n                availableInnerMainDim + paddingAndBorderAxisMain,\n                YGNodeBoundAxisWithinMinAndMax(\n                    node, mainAxis, maxLineMainDim, mainAxisParentSize)),\n            paddingAndBorderAxisMain),\n        dim[mainAxis]);\n  }\n\n  if (measureModeCrossDim == YGMeasureModeUndefined ||\n      (node->getStyle().overflow != YGOverflowScroll &&\n       measureModeCrossDim == YGMeasureModeAtMost)) {\n    // Clamp the size to the min/max size, if specified, and make sure it\n    // doesn't go below the padding and border amount.\n\n    node->setLayoutMeasuredDimension(\n        YGNodeBoundAxis(\n            node,\n            crossAxis,\n            totalLineCrossDim + paddingAndBorderAxisCross,\n            crossAxisParentSize,\n            parentWidth),\n        dim[crossAxis]);\n\n  } else if (\n      measureModeCrossDim == YGMeasureModeAtMost &&\n      node->getStyle().overflow == YGOverflowScroll) {\n    node->setLayoutMeasuredDimension(\n        fmaxf(\n            fminf(\n                availableInnerCrossDim + paddingAndBorderAxisCross,\n                YGNodeBoundAxisWithinMinAndMax(\n                    node,\n                    crossAxis,\n                    totalLineCrossDim + paddingAndBorderAxisCross,\n                    crossAxisParentSize)),\n            paddingAndBorderAxisCross),\n        dim[crossAxis]);\n  }\n\n  // As we only wrapped in normal direction yet, we need to reverse the positions on wrap-reverse.\n  if (performLayout && node->getStyle().flexWrap == YGWrapWrapReverse) {\n    for (uint32_t i = 0; i < childCount; i++) {\n      const YGNodeRef child = YGNodeGetChild(node, i);\n      if (child->getStyle().positionType == YGPositionTypeRelative) {\n        child->setLayoutPosition(\n            node->getLayout().measuredDimensions[dim[crossAxis]] -\n                child->getLayout().position[pos[crossAxis]] -\n                child->getLayout().measuredDimensions[dim[crossAxis]],\n            pos[crossAxis]);\n      }\n    }\n  }\n\n  if (performLayout) {\n    // STEP 10: SIZING AND POSITIONING ABSOLUTE CHILDREN\n    for (currentAbsoluteChild = firstAbsoluteChild;\n         currentAbsoluteChild != nullptr;\n         currentAbsoluteChild = currentAbsoluteChild->getNextChild()) {\n      YGNodeAbsoluteLayoutChild(node,\n                                currentAbsoluteChild,\n                                availableInnerWidth,\n                                isMainAxisRow ? measureModeMainDim : measureModeCrossDim,\n                                availableInnerHeight,\n                                direction,\n                                config);\n    }\n\n    // STEP 11: SETTING TRAILING POSITIONS FOR CHILDREN\n    const bool needsMainTrailingPos =\n        mainAxis == YGFlexDirectionRowReverse || mainAxis == YGFlexDirectionColumnReverse;\n    const bool needsCrossTrailingPos =\n        crossAxis == YGFlexDirectionRowReverse || crossAxis == YGFlexDirectionColumnReverse;\n\n    // Set trailing position if necessary.\n    if (needsMainTrailingPos || needsCrossTrailingPos) {\n      for (uint32_t i = 0; i < childCount; i++) {\n        const YGNodeRef child = node->getChild(i);\n        if (child->getStyle().display == YGDisplayNone) {\n          continue;\n        }\n        if (needsMainTrailingPos) {\n          YGNodeSetChildTrailingPosition(node, child, mainAxis);\n        }\n\n        if (needsCrossTrailingPos) {\n          YGNodeSetChildTrailingPosition(node, child, crossAxis);\n        }\n      }\n    }\n  }\n}\n\nuint32_t gDepth = 0;\nbool gPrintTree = false;\nbool gPrintChanges = false;\nbool gPrintSkips = false;\n\nstatic const char *spacer = \"                                                            \";\n\nstatic const char *YGSpacer(const unsigned long level) {\n  const size_t spacerLen = strlen(spacer);\n  if (level > spacerLen) {\n    return &spacer[0];\n  } else {\n    return &spacer[spacerLen - level];\n  }\n}\n\nstatic const char *YGMeasureModeName(const YGMeasureMode mode, const bool performLayout) {\n  const char *kMeasureModeNames[YGMeasureModeCount] = {\"UNDEFINED\", \"EXACTLY\", \"AT_MOST\"};\n  const char *kLayoutModeNames[YGMeasureModeCount] = {\"LAY_UNDEFINED\",\n                                                      \"LAY_EXACTLY\",\n                                                      \"LAY_AT_\"\n                                                      \"MOST\"};\n\n  if (mode >= YGMeasureModeCount) {\n    return \"\";\n  }\n\n  return performLayout ? kLayoutModeNames[mode] : kMeasureModeNames[mode];\n}\n\nstatic inline bool YGMeasureModeSizeIsExactAndMatchesOldMeasuredSize(YGMeasureMode sizeMode,\n                                                                     float size,\n                                                                     float lastComputedSize) {\n  return sizeMode == YGMeasureModeExactly && YGFloatsEqual(size, lastComputedSize);\n}\n\nstatic inline bool YGMeasureModeOldSizeIsUnspecifiedAndStillFits(YGMeasureMode sizeMode,\n                                                                 float size,\n                                                                 YGMeasureMode lastSizeMode,\n                                                                 float lastComputedSize) {\n  return sizeMode == YGMeasureModeAtMost && lastSizeMode == YGMeasureModeUndefined &&\n         (size >= lastComputedSize || YGFloatsEqual(size, lastComputedSize));\n}\n\nstatic inline bool YGMeasureModeNewMeasureSizeIsStricterAndStillValid(YGMeasureMode sizeMode,\n                                                                      float size,\n                                                                      YGMeasureMode lastSizeMode,\n                                                                      float lastSize,\n                                                                      float lastComputedSize) {\n  return lastSizeMode == YGMeasureModeAtMost && sizeMode == YGMeasureModeAtMost &&\n         lastSize > size && (lastComputedSize <= size || YGFloatsEqual(size, lastComputedSize));\n}\n\nfloat YGRoundValueToPixelGrid(const float value,\n                              const float pointScaleFactor,\n                              const bool forceCeil,\n                              const bool forceFloor) {\n  float scaledValue = value * pointScaleFactor;\n  float fractial = fmodf(scaledValue, 1.0);\n  if (YGFloatsEqual(fractial, 0)) {\n    // First we check if the value is already rounded\n    scaledValue = scaledValue - fractial;\n  } else if (YGFloatsEqual(fractial, 1.0)) {\n    scaledValue = scaledValue - fractial + 1.0;\n  } else if (forceCeil) {\n    // Next we check if we need to use forced rounding\n    scaledValue = scaledValue - fractial + 1.0f;\n  } else if (forceFloor) {\n    scaledValue = scaledValue - fractial;\n  } else {\n    // Finally we just round the value\n    scaledValue = scaledValue - fractial +\n        (fractial > 0.5f || YGFloatsEqual(fractial, 0.5f) ? 1.0f : 0.0f);\n  }\n  return scaledValue / pointScaleFactor;\n}\n\nbool YGNodeCanUseCachedMeasurement(const YGMeasureMode widthMode,\n                                   const float width,\n                                   const YGMeasureMode heightMode,\n                                   const float height,\n                                   const YGMeasureMode lastWidthMode,\n                                   const float lastWidth,\n                                   const YGMeasureMode lastHeightMode,\n                                   const float lastHeight,\n                                   const float lastComputedWidth,\n                                   const float lastComputedHeight,\n                                   const float marginRow,\n                                   const float marginColumn,\n                                   const YGConfigRef config) {\n  if (lastComputedHeight < 0 || lastComputedWidth < 0) {\n    return false;\n  }\n  bool useRoundedComparison =\n      config != nullptr && config->pointScaleFactor != 0;\n  const float effectiveWidth =\n      useRoundedComparison ? YGRoundValueToPixelGrid(width, config->pointScaleFactor, false, false)\n                           : width;\n  const float effectiveHeight =\n      useRoundedComparison ? YGRoundValueToPixelGrid(height, config->pointScaleFactor, false, false)\n                           : height;\n  const float effectiveLastWidth =\n      useRoundedComparison\n          ? YGRoundValueToPixelGrid(lastWidth, config->pointScaleFactor, false, false)\n          : lastWidth;\n  const float effectiveLastHeight =\n      useRoundedComparison\n          ? YGRoundValueToPixelGrid(lastHeight, config->pointScaleFactor, false, false)\n          : lastHeight;\n\n  const bool hasSameWidthSpec =\n      lastWidthMode == widthMode && YGFloatsEqual(effectiveLastWidth, effectiveWidth);\n  const bool hasSameHeightSpec =\n      lastHeightMode == heightMode && YGFloatsEqual(effectiveLastHeight, effectiveHeight);\n\n  const bool widthIsCompatible =\n      hasSameWidthSpec || YGMeasureModeSizeIsExactAndMatchesOldMeasuredSize(widthMode,\n                                                                            width - marginRow,\n                                                                            lastComputedWidth) ||\n      YGMeasureModeOldSizeIsUnspecifiedAndStillFits(widthMode,\n                                                    width - marginRow,\n                                                    lastWidthMode,\n                                                    lastComputedWidth) ||\n      YGMeasureModeNewMeasureSizeIsStricterAndStillValid(\n          widthMode, width - marginRow, lastWidthMode, lastWidth, lastComputedWidth);\n\n  const bool heightIsCompatible =\n      hasSameHeightSpec || YGMeasureModeSizeIsExactAndMatchesOldMeasuredSize(heightMode,\n                                                                             height - marginColumn,\n                                                                             lastComputedHeight) ||\n      YGMeasureModeOldSizeIsUnspecifiedAndStillFits(heightMode,\n                                                    height - marginColumn,\n                                                    lastHeightMode,\n                                                    lastComputedHeight) ||\n      YGMeasureModeNewMeasureSizeIsStricterAndStillValid(\n          heightMode, height - marginColumn, lastHeightMode, lastHeight, lastComputedHeight);\n\n  return widthIsCompatible && heightIsCompatible;\n}\n\n//\n// This is a wrapper around the YGNodelayoutImpl function. It determines\n// whether the layout request is redundant and can be skipped.\n//\n// Parameters:\n//  Input parameters are the same as YGNodelayoutImpl (see above)\n//  Return parameter is true if layout was performed, false if skipped\n//\nbool YGLayoutNodeInternal(const YGNodeRef node,\n                          const float availableWidth,\n                          const float availableHeight,\n                          const YGDirection parentDirection,\n                          const YGMeasureMode widthMeasureMode,\n                          const YGMeasureMode heightMeasureMode,\n                          const float parentWidth,\n                          const float parentHeight,\n                          const bool performLayout,\n                          const char *reason,\n                          const YGConfigRef config) {\n  YGLayout* layout = &node->getLayout();\n\n  gDepth++;\n\n  const bool needToVisitNode =\n      (node->isDirty() && layout->generationCount != gCurrentGenerationCount) ||\n      layout->lastParentDirection != parentDirection;\n\n  if (needToVisitNode) {\n    // Invalidate the cached results.\n    layout->nextCachedMeasurementsIndex = 0;\n    layout->cachedLayout.widthMeasureMode = (YGMeasureMode) -1;\n    layout->cachedLayout.heightMeasureMode = (YGMeasureMode) -1;\n    layout->cachedLayout.computedWidth = -1;\n    layout->cachedLayout.computedHeight = -1;\n  }\n\n  YGCachedMeasurement* cachedResults = nullptr;\n\n  // Determine whether the results are already cached. We maintain a separate\n  // cache for layouts and measurements. A layout operation modifies the\n  // positions\n  // and dimensions for nodes in the subtree. The algorithm assumes that each\n  // node\n  // gets layed out a maximum of one time per tree layout, but multiple\n  // measurements\n  // may be required to resolve all of the flex dimensions.\n  // We handle nodes with measure functions specially here because they are the\n  // most\n  // expensive to measure, so it's worth avoiding redundant measurements if at\n  // all possible.\n  if (node->getMeasure() != nullptr) {\n    const float marginAxisRow = YGNodeMarginForAxis(node, YGFlexDirectionRow, parentWidth);\n    const float marginAxisColumn = YGNodeMarginForAxis(node, YGFlexDirectionColumn, parentWidth);\n\n    // First, try to use the layout cache.\n    if (YGNodeCanUseCachedMeasurement(widthMeasureMode,\n                                      availableWidth,\n                                      heightMeasureMode,\n                                      availableHeight,\n                                      layout->cachedLayout.widthMeasureMode,\n                                      layout->cachedLayout.availableWidth,\n                                      layout->cachedLayout.heightMeasureMode,\n                                      layout->cachedLayout.availableHeight,\n                                      layout->cachedLayout.computedWidth,\n                                      layout->cachedLayout.computedHeight,\n                                      marginAxisRow,\n                                      marginAxisColumn,\n                                      config)) {\n      cachedResults = &layout->cachedLayout;\n    } else {\n      // Try to use the measurement cache.\n      for (uint32_t i = 0; i < layout->nextCachedMeasurementsIndex; i++) {\n        if (YGNodeCanUseCachedMeasurement(widthMeasureMode,\n                                          availableWidth,\n                                          heightMeasureMode,\n                                          availableHeight,\n                                          layout->cachedMeasurements[i].widthMeasureMode,\n                                          layout->cachedMeasurements[i].availableWidth,\n                                          layout->cachedMeasurements[i].heightMeasureMode,\n                                          layout->cachedMeasurements[i].availableHeight,\n                                          layout->cachedMeasurements[i].computedWidth,\n                                          layout->cachedMeasurements[i].computedHeight,\n                                          marginAxisRow,\n                                          marginAxisColumn,\n                                          config)) {\n          cachedResults = &layout->cachedMeasurements[i];\n          break;\n        }\n      }\n    }\n  } else if (performLayout) {\n    if (YGFloatsEqual(layout->cachedLayout.availableWidth, availableWidth) &&\n        YGFloatsEqual(layout->cachedLayout.availableHeight, availableHeight) &&\n        layout->cachedLayout.widthMeasureMode == widthMeasureMode &&\n        layout->cachedLayout.heightMeasureMode == heightMeasureMode) {\n      cachedResults = &layout->cachedLayout;\n    }\n  } else {\n    for (uint32_t i = 0; i < layout->nextCachedMeasurementsIndex; i++) {\n      if (YGFloatsEqual(layout->cachedMeasurements[i].availableWidth, availableWidth) &&\n          YGFloatsEqual(layout->cachedMeasurements[i].availableHeight, availableHeight) &&\n          layout->cachedMeasurements[i].widthMeasureMode == widthMeasureMode &&\n          layout->cachedMeasurements[i].heightMeasureMode == heightMeasureMode) {\n        cachedResults = &layout->cachedMeasurements[i];\n        break;\n      }\n    }\n  }\n\n  if (!needToVisitNode && cachedResults != nullptr) {\n    layout->measuredDimensions[YGDimensionWidth] = cachedResults->computedWidth;\n    layout->measuredDimensions[YGDimensionHeight] = cachedResults->computedHeight;\n\n    if (gPrintChanges && gPrintSkips) {\n      YGLog(node, YGLogLevelVerbose, \"%s%d.{[skipped] \", YGSpacer(gDepth), gDepth);\n      if (node->getPrintFunc() != nullptr) {\n        node->getPrintFunc()(node);\n      }\n      YGLog(\n          node,\n          YGLogLevelVerbose,\n          \"wm: %s, hm: %s, aw: %f ah: %f => d: (%f, %f) %s\\n\",\n          YGMeasureModeName(widthMeasureMode, performLayout),\n          YGMeasureModeName(heightMeasureMode, performLayout),\n          availableWidth,\n          availableHeight,\n          cachedResults->computedWidth,\n          cachedResults->computedHeight,\n          reason);\n    }\n  } else {\n    if (gPrintChanges) {\n      YGLog(\n          node,\n          YGLogLevelVerbose,\n          \"%s%d.{%s\",\n          YGSpacer(gDepth),\n          gDepth,\n          needToVisitNode ? \"*\" : \"\");\n      if (node->getPrintFunc() != nullptr) {\n        node->getPrintFunc()(node);\n      }\n      YGLog(\n          node,\n          YGLogLevelVerbose,\n          \"wm: %s, hm: %s, aw: %f ah: %f %s\\n\",\n          YGMeasureModeName(widthMeasureMode, performLayout),\n          YGMeasureModeName(heightMeasureMode, performLayout),\n          availableWidth,\n          availableHeight,\n          reason);\n    }\n\n    YGNodelayoutImpl(node,\n                     availableWidth,\n                     availableHeight,\n                     parentDirection,\n                     widthMeasureMode,\n                     heightMeasureMode,\n                     parentWidth,\n                     parentHeight,\n                     performLayout,\n                     config);\n\n    if (gPrintChanges) {\n      YGLog(\n          node,\n          YGLogLevelVerbose,\n          \"%s%d.}%s\",\n          YGSpacer(gDepth),\n          gDepth,\n          needToVisitNode ? \"*\" : \"\");\n      if (node->getPrintFunc() != nullptr) {\n        node->getPrintFunc()(node);\n      }\n      YGLog(\n          node,\n          YGLogLevelVerbose,\n          \"wm: %s, hm: %s, d: (%f, %f) %s\\n\",\n          YGMeasureModeName(widthMeasureMode, performLayout),\n          YGMeasureModeName(heightMeasureMode, performLayout),\n          layout->measuredDimensions[YGDimensionWidth],\n          layout->measuredDimensions[YGDimensionHeight],\n          reason);\n    }\n\n    layout->lastParentDirection = parentDirection;\n\n    if (cachedResults == nullptr) {\n      if (layout->nextCachedMeasurementsIndex == YG_MAX_CACHED_RESULT_COUNT) {\n        if (gPrintChanges) {\n          YGLog(node, YGLogLevelVerbose, \"Out of cache entries!\\n\");\n        }\n        layout->nextCachedMeasurementsIndex = 0;\n      }\n\n      YGCachedMeasurement *newCacheEntry;\n      if (performLayout) {\n        // Use the single layout cache entry.\n        newCacheEntry = &layout->cachedLayout;\n      } else {\n        // Allocate a new measurement cache entry.\n        newCacheEntry = &layout->cachedMeasurements[layout->nextCachedMeasurementsIndex];\n        layout->nextCachedMeasurementsIndex++;\n      }\n\n      newCacheEntry->availableWidth = availableWidth;\n      newCacheEntry->availableHeight = availableHeight;\n      newCacheEntry->widthMeasureMode = widthMeasureMode;\n      newCacheEntry->heightMeasureMode = heightMeasureMode;\n      newCacheEntry->computedWidth = layout->measuredDimensions[YGDimensionWidth];\n      newCacheEntry->computedHeight = layout->measuredDimensions[YGDimensionHeight];\n    }\n  }\n\n  if (performLayout) {\n    node->setLayoutDimension(\n        node->getLayout().measuredDimensions[YGDimensionWidth],\n        YGDimensionWidth);\n    node->setLayoutDimension(\n        node->getLayout().measuredDimensions[YGDimensionHeight],\n        YGDimensionHeight);\n\n    node->setHasNewLayout(true);\n    node->setDirty(false);\n  }\n\n  gDepth--;\n  layout->generationCount = gCurrentGenerationCount;\n  return (needToVisitNode || cachedResults == nullptr);\n}\n\nvoid YGConfigSetPointScaleFactor(const YGConfigRef config, const float pixelsInPoint) {\n  YGAssertWithConfig(config, pixelsInPoint >= 0.0f, \"Scale factor should not be less than zero\");\n\n  // We store points for Pixel as we will use it for rounding\n  if (pixelsInPoint == 0.0f) {\n    // Zero is used to skip rounding\n    config->pointScaleFactor = 0.0f;\n  } else {\n    config->pointScaleFactor = pixelsInPoint;\n  }\n}\n\nstatic void YGRoundToPixelGrid(const YGNodeRef node,\n                               const float pointScaleFactor,\n                               const float absoluteLeft,\n                               const float absoluteTop) {\n  if (pointScaleFactor == 0.0f) {\n    return;\n  }\n\n  const float nodeLeft = node->getLayout().position[YGEdgeLeft];\n  const float nodeTop = node->getLayout().position[YGEdgeTop];\n\n  const float nodeWidth = node->getLayout().dimensions[YGDimensionWidth];\n  const float nodeHeight = node->getLayout().dimensions[YGDimensionHeight];\n\n  const float absoluteNodeLeft = absoluteLeft + nodeLeft;\n  const float absoluteNodeTop = absoluteTop + nodeTop;\n\n  const float absoluteNodeRight = absoluteNodeLeft + nodeWidth;\n  const float absoluteNodeBottom = absoluteNodeTop + nodeHeight;\n\n  // If a node has a custom measure function we never want to round down its size as this could\n  // lead to unwanted text truncation.\n  const bool textRounding = node->getNodeType() == YGNodeTypeText;\n\n  node->setLayoutPosition(\n      YGRoundValueToPixelGrid(nodeLeft, pointScaleFactor, false, textRounding),\n      YGEdgeLeft);\n\n  node->setLayoutPosition(\n      YGRoundValueToPixelGrid(nodeTop, pointScaleFactor, false, textRounding),\n      YGEdgeTop);\n\n  // We multiply dimension by scale factor and if the result is close to the whole number, we don't\n  // have any fraction\n  // To verify if the result is close to whole number we want to check both floor and ceil numbers\n  const bool hasFractionalWidth = !YGFloatsEqual(fmodf(nodeWidth * pointScaleFactor, 1.0), 0) &&\n                                  !YGFloatsEqual(fmodf(nodeWidth * pointScaleFactor, 1.0), 1.0);\n  const bool hasFractionalHeight = !YGFloatsEqual(fmodf(nodeHeight * pointScaleFactor, 1.0), 0) &&\n                                   !YGFloatsEqual(fmodf(nodeHeight * pointScaleFactor, 1.0), 1.0);\n\n  node->setLayoutDimension(\n      YGRoundValueToPixelGrid(\n          absoluteNodeRight,\n          pointScaleFactor,\n          (textRounding && hasFractionalWidth),\n          (textRounding && !hasFractionalWidth)) -\n          YGRoundValueToPixelGrid(\n              absoluteNodeLeft, pointScaleFactor, false, textRounding),\n      YGDimensionWidth);\n\n  node->setLayoutDimension(\n      YGRoundValueToPixelGrid(\n          absoluteNodeBottom,\n          pointScaleFactor,\n          (textRounding && hasFractionalHeight),\n          (textRounding && !hasFractionalHeight)) -\n          YGRoundValueToPixelGrid(\n              absoluteNodeTop, pointScaleFactor, false, textRounding),\n      YGDimensionHeight);\n\n  const uint32_t childCount = node->getChildren().size();\n  for (uint32_t i = 0; i < childCount; i++) {\n    YGRoundToPixelGrid(YGNodeGetChild(node, i), pointScaleFactor, absoluteNodeLeft, absoluteNodeTop);\n  }\n}\n\nvoid YGNodeCalculateLayout(const YGNodeRef node,\n                           const float parentWidth,\n                           const float parentHeight,\n                           const YGDirection parentDirection) {\n  // Increment the generation count. This will force the recursive routine to\n  // visit\n  // all dirty nodes at least once. Subsequent visits will be skipped if the\n  // input\n  // parameters don't change.\n  gCurrentGenerationCount++;\n\n  node->resolveDimension();\n  float width = YGUndefined;\n  YGMeasureMode widthMeasureMode = YGMeasureModeUndefined;\n  if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow, parentWidth)) {\n    width =\n        YGResolveValue(\n            node->getResolvedDimension(dim[YGFlexDirectionRow]), parentWidth) +\n        YGNodeMarginForAxis(node, YGFlexDirectionRow, parentWidth);\n    widthMeasureMode = YGMeasureModeExactly;\n  } else if (\n      YGResolveValue(\n          node->getStyle().maxDimensions[YGDimensionWidth], parentWidth) >=\n      0.0f) {\n    width = YGResolveValue(\n        node->getStyle().maxDimensions[YGDimensionWidth], parentWidth);\n    widthMeasureMode = YGMeasureModeAtMost;\n  } else {\n    width = parentWidth;\n    widthMeasureMode = YGFloatIsUndefined(width) ? YGMeasureModeUndefined : YGMeasureModeExactly;\n  }\n\n  float height = YGUndefined;\n  YGMeasureMode heightMeasureMode = YGMeasureModeUndefined;\n  if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn, parentHeight)) {\n    height = YGResolveValue(\n                 node->getResolvedDimension(dim[YGFlexDirectionColumn]),\n                 parentHeight) +\n        YGNodeMarginForAxis(node, YGFlexDirectionColumn, parentWidth);\n    heightMeasureMode = YGMeasureModeExactly;\n  } else if (\n      YGResolveValue(\n          node->getStyle().maxDimensions[YGDimensionHeight], parentHeight) >=\n      0.0f) {\n    height = YGResolveValue(\n        node->getStyle().maxDimensions[YGDimensionHeight], parentHeight);\n    heightMeasureMode = YGMeasureModeAtMost;\n  } else {\n    height = parentHeight;\n    heightMeasureMode = YGFloatIsUndefined(height) ? YGMeasureModeUndefined : YGMeasureModeExactly;\n  }\n\n  if (YGLayoutNodeInternal(\n          node,\n          width,\n          height,\n          parentDirection,\n          widthMeasureMode,\n          heightMeasureMode,\n          parentWidth,\n          parentHeight,\n          true,\n          \"initial\",\n          node->getConfig())) {\n    YGNodeSetPosition(\n        node,\n        node->getLayout().direction,\n        parentWidth,\n        parentHeight,\n        parentWidth);\n    YGRoundToPixelGrid(node, node->getConfig()->pointScaleFactor, 0.0f, 0.0f);\n\n    if (gPrintTree) {\n      YGNodePrint(\n          node,\n          (YGPrintOptions)(\n              YGPrintOptionsLayout | YGPrintOptionsChildren |\n              YGPrintOptionsStyle));\n    }\n  }\n}\n\nvoid YGConfigSetLogger(const YGConfigRef config, YGLogger logger) {\n  if (logger != nullptr) {\n    config->logger = logger;\n  } else {\n#ifdef ANDROID\n    config->logger = &YGAndroidLog;\n#else\n    config->logger = &YGDefaultLog;\n#endif\n  }\n}\n\nstatic void YGVLog(const YGConfigRef config,\n                   const YGNodeRef node,\n                   YGLogLevel level,\n                   const char *format,\n                   va_list args) {\n  const YGConfigRef logConfig = config != nullptr ? config : &gYGConfigDefaults;\n  logConfig->logger(logConfig, node, level, format, args);\n\n  if (level == YGLogLevelFatal) {\n    abort();\n  }\n}\n\nvoid YGLogWithConfig(const YGConfigRef config, YGLogLevel level, const char *format, ...) {\n  va_list args;\n  va_start(args, format);\n  YGVLog(config, nullptr, level, format, args);\n  va_end(args);\n}\n\nvoid YGLog(const YGNodeRef node, YGLogLevel level, const char *format, ...) {\n  va_list args;\n  va_start(args, format);\n  YGVLog(\n      node == nullptr ? nullptr : node->getConfig(), node, level, format, args);\n  va_end(args);\n}\n\nvoid YGAssert(const bool condition, const char *message) {\n  if (!condition) {\n    YGLog(nullptr, YGLogLevelFatal, \"%s\\n\", message);\n  }\n}\n\nvoid YGAssertWithNode(const YGNodeRef node, const bool condition, const char *message) {\n  if (!condition) {\n    YGLog(node, YGLogLevelFatal, \"%s\\n\", message);\n  }\n}\n\nvoid YGAssertWithConfig(const YGConfigRef config, const bool condition, const char *message) {\n  if (!condition) {\n    YGLogWithConfig(config, YGLogLevelFatal, \"%s\\n\", message);\n  }\n}\n\nvoid YGConfigSetExperimentalFeatureEnabled(const YGConfigRef config,\n                                           const YGExperimentalFeature feature,\n                                           const bool enabled) {\n  config->experimentalFeatures[feature] = enabled;\n}\n\ninline bool YGConfigIsExperimentalFeatureEnabled(const YGConfigRef config,\n                                                 const YGExperimentalFeature feature) {\n  return config->experimentalFeatures[feature];\n}\n\nvoid YGConfigSetUseWebDefaults(const YGConfigRef config, const bool enabled) {\n  config->useWebDefaults = enabled;\n}\n\nvoid YGConfigSetUseLegacyStretchBehaviour(const YGConfigRef config,\n                                          const bool useLegacyStretchBehaviour) {\n  config->useLegacyStretchBehaviour = useLegacyStretchBehaviour;\n}\n\nbool YGConfigGetUseWebDefaults(const YGConfigRef config) {\n  return config->useWebDefaults;\n}\n\nvoid YGConfigSetContext(const YGConfigRef config, void *context) {\n  config->context = context;\n}\n\nvoid *YGConfigGetContext(const YGConfigRef config) {\n  return config->context;\n}\n\nvoid YGConfigSetNodeClonedFunc(const YGConfigRef config, const YGNodeClonedFunc callback) {\n  config->cloneNodeCallback = callback;\n}\n"
  },
  {
    "path": "ReactCommon/yoga/yoga/Yoga.h",
    "content": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#pragma once\n\n#include <assert.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#ifndef __cplusplus\n#include <stdbool.h>\n#endif\n\n// Not defined in MSVC++\n#ifndef NAN\nstatic const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};\n#define NAN (*(const float *) __nan)\n#endif\n\n#define YGUndefined NAN\n\n#include \"YGEnums.h\"\n#include \"YGMacros.h\"\n\nYG_EXTERN_C_BEGIN\n\ntypedef struct YGSize {\n  float width;\n  float height;\n} YGSize;\n\ntypedef struct YGValue {\n  float value;\n  YGUnit unit;\n} YGValue;\n\nextern const YGValue YGValueUndefined;\nextern const YGValue YGValueAuto;\n\ntypedef struct YGConfig *YGConfigRef;\n\ntypedef struct YGNode* YGNodeRef;\n\ntypedef YGSize (*YGMeasureFunc)(YGNodeRef node,\n                                float width,\n                                YGMeasureMode widthMode,\n                                float height,\n                                YGMeasureMode heightMode);\ntypedef float (*YGBaselineFunc)(YGNodeRef node, const float width, const float height);\ntypedef void (*YGPrintFunc)(YGNodeRef node);\ntypedef int (*YGLogger)(const YGConfigRef config,\n                        const YGNodeRef node,\n                        YGLogLevel level,\n                        const char *format,\n                        va_list args);\ntypedef void (*YGNodeClonedFunc)(YGNodeRef oldNode,\n                                 YGNodeRef newNode,\n                                 YGNodeRef parent,\n                                 int childIndex);\n\n// YGNode\nWIN_EXPORT YGNodeRef YGNodeNew(void);\nWIN_EXPORT YGNodeRef YGNodeNewWithConfig(const YGConfigRef config);\nWIN_EXPORT YGNodeRef YGNodeClone(const YGNodeRef node);\nWIN_EXPORT void YGNodeFree(const YGNodeRef node);\nWIN_EXPORT void YGNodeFreeRecursive(const YGNodeRef node);\nWIN_EXPORT void YGNodeReset(const YGNodeRef node);\nWIN_EXPORT int32_t YGNodeGetInstanceCount(void);\n\nWIN_EXPORT void YGNodeInsertChild(const YGNodeRef node,\n                                  const YGNodeRef child,\n                                  const uint32_t index);\nWIN_EXPORT void YGNodeRemoveChild(const YGNodeRef node, const YGNodeRef child);\nWIN_EXPORT void YGNodeRemoveAllChildren(const YGNodeRef node);\nWIN_EXPORT YGNodeRef YGNodeGetChild(const YGNodeRef node, const uint32_t index);\nWIN_EXPORT YGNodeRef YGNodeGetParent(const YGNodeRef node);\nWIN_EXPORT uint32_t YGNodeGetChildCount(const YGNodeRef node);\n\nWIN_EXPORT void YGNodeCalculateLayout(const YGNodeRef node,\n                                      const float availableWidth,\n                                      const float availableHeight,\n                                      const YGDirection parentDirection);\n\n// Mark a node as dirty. Only valid for nodes with a custom measure function\n// set.\n// YG knows when to mark all other nodes as dirty but because nodes with\n// measure functions\n// depends on information not known to YG they must perform this dirty\n// marking manually.\nWIN_EXPORT void YGNodeMarkDirty(const YGNodeRef node);\n\nWIN_EXPORT void YGNodePrint(const YGNodeRef node, const YGPrintOptions options);\n\nWIN_EXPORT bool YGFloatIsUndefined(const float value);\n\nWIN_EXPORT bool YGNodeCanUseCachedMeasurement(const YGMeasureMode widthMode,\n                                              const float width,\n                                              const YGMeasureMode heightMode,\n                                              const float height,\n                                              const YGMeasureMode lastWidthMode,\n                                              const float lastWidth,\n                                              const YGMeasureMode lastHeightMode,\n                                              const float lastHeight,\n                                              const float lastComputedWidth,\n                                              const float lastComputedHeight,\n                                              const float marginRow,\n                                              const float marginColumn,\n                                              const YGConfigRef config);\n\nWIN_EXPORT void YGNodeCopyStyle(const YGNodeRef dstNode, const YGNodeRef srcNode);\n\n#define YG_NODE_PROPERTY(type, name, paramName)                          \\\n  WIN_EXPORT void YGNodeSet##name(const YGNodeRef node, type paramName); \\\n  WIN_EXPORT type YGNodeGet##name(const YGNodeRef node);\n\n#define YG_NODE_STYLE_PROPERTY(type, name, paramName)                               \\\n  WIN_EXPORT void YGNodeStyleSet##name(const YGNodeRef node, const type paramName); \\\n  WIN_EXPORT type YGNodeStyleGet##name(const YGNodeRef node);\n\n#define YG_NODE_STYLE_PROPERTY_UNIT(type, name, paramName)                                    \\\n  WIN_EXPORT void YGNodeStyleSet##name(const YGNodeRef node, const float paramName);          \\\n  WIN_EXPORT void YGNodeStyleSet##name##Percent(const YGNodeRef node, const float paramName); \\\n  WIN_EXPORT type YGNodeStyleGet##name(const YGNodeRef node);\n\n#define YG_NODE_STYLE_PROPERTY_UNIT_AUTO(type, name, paramName) \\\n  YG_NODE_STYLE_PROPERTY_UNIT(type, name, paramName)            \\\n  WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node);\n\n#define YG_NODE_STYLE_EDGE_PROPERTY(type, name, paramName)    \\\n  WIN_EXPORT void YGNodeStyleSet##name(const YGNodeRef node,  \\\n                                       const YGEdge edge,     \\\n                                       const type paramName); \\\n  WIN_EXPORT type YGNodeStyleGet##name(const YGNodeRef node, const YGEdge edge);\n\n#define YG_NODE_STYLE_EDGE_PROPERTY_UNIT(type, name, paramName)         \\\n  WIN_EXPORT void YGNodeStyleSet##name(const YGNodeRef node,            \\\n                                       const YGEdge edge,               \\\n                                       const float paramName);          \\\n  WIN_EXPORT void YGNodeStyleSet##name##Percent(const YGNodeRef node,   \\\n                                                const YGEdge edge,      \\\n                                                const float paramName); \\\n  WIN_EXPORT WIN_STRUCT(type) YGNodeStyleGet##name(const YGNodeRef node, const YGEdge edge);\n\n#define YG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO(type, name) \\\n  WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node, const YGEdge edge);\n\n#define YG_NODE_LAYOUT_PROPERTY(type, name) \\\n  WIN_EXPORT type YGNodeLayoutGet##name(const YGNodeRef node);\n\n#define YG_NODE_LAYOUT_EDGE_PROPERTY(type, name) \\\n  WIN_EXPORT type YGNodeLayoutGet##name(const YGNodeRef node, const YGEdge edge);\n\nvoid* YGNodeGetContext(YGNodeRef node);\nvoid YGNodeSetContext(YGNodeRef node, void* context);\nYGMeasureFunc YGNodeGetMeasureFunc(YGNodeRef node);\nvoid YGNodeSetMeasureFunc(YGNodeRef node, YGMeasureFunc measureFunc);\nYGBaselineFunc YGNodeGetBaselineFunc(YGNodeRef node);\nvoid YGNodeSetBaselineFunc(YGNodeRef node, YGBaselineFunc baselineFunc);\nYGPrintFunc YGNodeGetPrintFunc(YGNodeRef node);\nvoid YGNodeSetPrintFunc(YGNodeRef node, YGPrintFunc printFunc);\nbool YGNodeGetHasNewLayout(YGNodeRef node);\nvoid YGNodeSetHasNewLayout(YGNodeRef node, bool hasNewLayout);\nYGNodeType YGNodeGetNodeType(YGNodeRef node);\nvoid YGNodeSetNodeType(YGNodeRef node, YGNodeType nodeType);\nbool YGNodeIsDirty(YGNodeRef node);\n\nYG_NODE_STYLE_PROPERTY(YGDirection, Direction, direction);\nYG_NODE_STYLE_PROPERTY(YGFlexDirection, FlexDirection, flexDirection);\nYG_NODE_STYLE_PROPERTY(YGJustify, JustifyContent, justifyContent);\nYG_NODE_STYLE_PROPERTY(YGAlign, AlignContent, alignContent);\nYG_NODE_STYLE_PROPERTY(YGAlign, AlignItems, alignItems);\nYG_NODE_STYLE_PROPERTY(YGAlign, AlignSelf, alignSelf);\nYG_NODE_STYLE_PROPERTY(YGPositionType, PositionType, positionType);\nYG_NODE_STYLE_PROPERTY(YGWrap, FlexWrap, flexWrap);\nYG_NODE_STYLE_PROPERTY(YGOverflow, Overflow, overflow);\nYG_NODE_STYLE_PROPERTY(YGDisplay, Display, display);\n\nYG_NODE_STYLE_PROPERTY(float, Flex, flex);\nYG_NODE_STYLE_PROPERTY(float, FlexGrow, flexGrow);\nYG_NODE_STYLE_PROPERTY(float, FlexShrink, flexShrink);\nYG_NODE_STYLE_PROPERTY_UNIT_AUTO(YGValue, FlexBasis, flexBasis);\n\nYG_NODE_STYLE_EDGE_PROPERTY_UNIT(YGValue, Position, position);\nYG_NODE_STYLE_EDGE_PROPERTY_UNIT(YGValue, Margin, margin);\nYG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO(YGValue, Margin);\nYG_NODE_STYLE_EDGE_PROPERTY_UNIT(YGValue, Padding, padding);\nYG_NODE_STYLE_EDGE_PROPERTY(float, Border, border);\n\nYG_NODE_STYLE_PROPERTY_UNIT_AUTO(YGValue, Width, width);\nYG_NODE_STYLE_PROPERTY_UNIT_AUTO(YGValue, Height, height);\nYG_NODE_STYLE_PROPERTY_UNIT(YGValue, MinWidth, minWidth);\nYG_NODE_STYLE_PROPERTY_UNIT(YGValue, MinHeight, minHeight);\nYG_NODE_STYLE_PROPERTY_UNIT(YGValue, MaxWidth, maxWidth);\nYG_NODE_STYLE_PROPERTY_UNIT(YGValue, MaxHeight, maxHeight);\n\n// Yoga specific properties, not compatible with flexbox specification\n// Aspect ratio control the size of the undefined dimension of a node.\n// Aspect ratio is encoded as a floating point value width/height. e.g. A value of 2 leads to a node\n// with a width twice the size of its height while a value of 0.5 gives the opposite effect.\n//\n// - On a node with a set width/height aspect ratio control the size of the unset dimension\n// - On a node with a set flex basis aspect ratio controls the size of the node in the cross axis if\n// unset\n// - On a node with a measure function aspect ratio works as though the measure function measures\n// the flex basis\n// - On a node with flex grow/shrink aspect ratio controls the size of the node in the cross axis if\n// unset\n// - Aspect ratio takes min/max dimensions into account\nYG_NODE_STYLE_PROPERTY(float, AspectRatio, aspectRatio);\n\nYG_NODE_LAYOUT_PROPERTY(float, Left);\nYG_NODE_LAYOUT_PROPERTY(float, Top);\nYG_NODE_LAYOUT_PROPERTY(float, Right);\nYG_NODE_LAYOUT_PROPERTY(float, Bottom);\nYG_NODE_LAYOUT_PROPERTY(float, Width);\nYG_NODE_LAYOUT_PROPERTY(float, Height);\nYG_NODE_LAYOUT_PROPERTY(YGDirection, Direction);\nYG_NODE_LAYOUT_PROPERTY(bool, HadOverflow);\n\n// Get the computed values for these nodes after performing layout. If they were set using\n// point values then the returned value will be the same as YGNodeStyleGetXXX. However if\n// they were set using a percentage value then the returned value is the computed value used\n// during layout.\nYG_NODE_LAYOUT_EDGE_PROPERTY(float, Margin);\nYG_NODE_LAYOUT_EDGE_PROPERTY(float, Border);\nYG_NODE_LAYOUT_EDGE_PROPERTY(float, Padding);\n\nWIN_EXPORT void YGConfigSetLogger(const YGConfigRef config, YGLogger logger);\nWIN_EXPORT void YGLog(const YGNodeRef node, YGLogLevel level, const char *message, ...);\nWIN_EXPORT void YGLogWithConfig(const YGConfigRef config, YGLogLevel level, const char *format, ...);\nWIN_EXPORT void YGAssert(const bool condition, const char *message);\nWIN_EXPORT void YGAssertWithNode(const YGNodeRef node, const bool condition, const char *message);\nWIN_EXPORT void YGAssertWithConfig(const YGConfigRef config,\n                                   const bool condition,\n                                   const char *message);\n\n// Set this to number of pixels in 1 point to round calculation results\n// If you want to avoid rounding - set PointScaleFactor to 0\nWIN_EXPORT void YGConfigSetPointScaleFactor(const YGConfigRef config, const float pixelsInPoint);\n\n// Yoga previously had an error where containers would take the maximum space possible instead of\n// the minimum\n// like they are supposed to. In practice this resulted in implicit behaviour similar to align-self:\n// stretch;\n// Because this was such a long-standing bug we must allow legacy users to switch back to this\n// behaviour.\nWIN_EXPORT void YGConfigSetUseLegacyStretchBehaviour(const YGConfigRef config,\n                                                     const bool useLegacyStretchBehaviour);\n\n// YGConfig\nWIN_EXPORT YGConfigRef YGConfigNew(void);\nWIN_EXPORT void YGConfigFree(const YGConfigRef config);\nWIN_EXPORT void YGConfigCopy(const YGConfigRef dest, const YGConfigRef src);\nWIN_EXPORT int32_t YGConfigGetInstanceCount(void);\n\nWIN_EXPORT void YGConfigSetExperimentalFeatureEnabled(const YGConfigRef config,\n                                                      const YGExperimentalFeature feature,\n                                                      const bool enabled);\nWIN_EXPORT bool YGConfigIsExperimentalFeatureEnabled(const YGConfigRef config,\n                                                     const YGExperimentalFeature feature);\n\n// Using the web defaults is the prefered configuration for new projects.\n// Usage of non web defaults should be considered as legacy.\nWIN_EXPORT void YGConfigSetUseWebDefaults(const YGConfigRef config, const bool enabled);\nWIN_EXPORT bool YGConfigGetUseWebDefaults(const YGConfigRef config);\n\nWIN_EXPORT void YGConfigSetNodeClonedFunc(const YGConfigRef config,\n                                          const YGNodeClonedFunc callback);\n\n// Export only for C#\nWIN_EXPORT YGConfigRef YGConfigGetDefault(void);\n\nWIN_EXPORT void YGConfigSetContext(const YGConfigRef config, void *context);\nWIN_EXPORT void *YGConfigGetContext(const YGConfigRef config);\n\nWIN_EXPORT float YGRoundValueToPixelGrid(\n    const float value,\n    const float pointScaleFactor,\n    const bool forceCeil,\n    const bool forceFloor);\n\nYG_EXTERN_C_END\n"
  },
  {
    "path": "ReactCommon/yoga/yoga.podspec",
    "content": "package = JSON.parse(File.read(File.expand_path('../../package.json', __dir__)))\nversion = package['version']\n\nsource = { :git => ENV['INSTALL_YOGA_FROM_LOCATION'] || 'https://github.com/facebook/react-native.git' }\nif version == '1000.0.0'\n  # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.\n  source[:commit] = `git rev-parse HEAD`.strip\nelse\n  source[:tag] = \"v#{version}\"\nend\n\nPod::Spec.new do |spec|\n  spec.name = 'yoga'\n  spec.version = \"#{version}.React\"\n  spec.license =  { :type => 'BSD' }\n  spec.homepage = 'https://facebook.github.io/yoga/'\n  spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/c/'\n\n  spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'\n  spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'\n\n  spec.authors = 'Facebook'\n  spec.source = source\n\n  spec.module_name = 'yoga'\n  spec.requires_arc = false\n  spec.compiler_flags = [\n      '-fno-omit-frame-pointer',\n      '-fexceptions',\n      '-Wall',\n      '-Werror',\n      '-std=c++1y',\n      '-fPIC'\n  ]\n\n  # Pinning to the same version as React.podspec.\n  spec.platforms = { :ios => \"8.0\", :tvos => \"9.2\" }\n\n  # Set this environment variable when not using the `:path` option to install the pod.\n  # E.g. when publishing this spec to a spec repo.\n  source_files = 'yoga/**/*.{cpp,h}'\n  source_files = File.join('ReactCommon/yoga', source_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION']\n  spec.source_files = source_files\nend\n"
  },
  {
    "path": "Releases.md",
    "content": "# Releases Guide\n\nThis document serves as guide for release coordinators. You can find a list of releases and their release notes at https://github.com/facebook/react-native/releases\n\n## Release schedule\n\nReact Native follows a monthly release train. Every month, a new branch created off master enters the Release Candidate phase, and the previous Release Candidate branch is released and considered stable.\n\n\n| Version | RC release          | Stable release   |\n| ------- | ------------------- | ---------------- |\n| 0.38.0  | week of November 7  | November 21      |\n| 0.39.0  | week of November 21 | December 2       |\n| 0.40.0  | 1st of December     | 1st of January   |\n| 0.41.0  | 1st of January      | 1st of February  |\n| 0.42.0  | 1st of February     | 1st of March     |\n| 0.43.0  | 1st of March        | 1st of April     |\n| 0.44.0  | 1st of April        | 1st of May       |\n| 0.45.0  | 1st of May          | 1st of June      |\n| 0.46.0  | 1st of June         | 1st of July      |\n| 0.47.0  | 1st of July         | 1st of August    |\n| 0.48.0  | 1st of August       | 1st of September |\n| 0.49.0  | 1st of September    | 1st of October   |\n| 0.50.0  | 1st of October      | 1st of November  |\n| ...     | ...                 | ...              |\n\n-------------------\n\n## How to cut a new release branch\n\n### Prerequisites\n\nThe following are required for the local test suite to run:\n- macOS with [Android dev environment set up](https://github.com/facebook/react-native/blob/master/ReactAndroid/README.md)\n- At least 0.2.0 [react-native-cli](https://www.npmjs.com/package/react-native-cli) installed globally\n\n### Step 1: Check everything works\n\nBefore cutting a release branch, make sure CI systems [Travis](https://travis-ci.org/facebook/react-native) and [Circle](https://circleci.com/gh/facebook/react-native) are green.\n\nBefore executing the following script, make sure you have:\n- An Android emulator / Genymotion device running\n- No packager running in any of the projects\n\n```bash\n./scripts/test-manual-e2e.sh\n```\n\nThis script bundles a react-native package locally and passes it to the `react-native` cli that creates a test project inside `/tmp` folder using that version.\n\nAfter `npm install` completes, the script prints a set of manual checks you have to do to ensure the release you are preparing is working as expected on both platforms.\n\n### Step 2: Cut a release branch and push to GitHub\n\nRun:\n\n```bash\ngit checkout -b <version_you_are_releasing>-stable\n# e.g. git checkout -b 0.50-stable\n\n./scripts/bump-oss-version.js <exact-version_you_are_releasing>\n# e.g. ./scripts/bump-oss-version.js 0.50.0-rc\n# You can use the --remote option to specify a Git remote other than the default \"origin\"\ngit push --tags\ngit push\n```\n\nCircle CI will automatically run the tests and publish to npm with the version you have specified (e.g `0.50.0-rc`) and tag `next` meaning that this version will not be installed for users by default.\n\nGo to [Circle CI](https://circleci.com/gh/facebook/react-native) and look for the build triggered by your push (e.g. _0.50-stable, [0.50.0] Bump version numbers_), then scroll down to the npm publish step to verify the package was published successfully (the build will be red if not).\n\n### Step 3: Write the release notes\n\nWrite the release notes, or post in [React Native Core Contributors](https://www.facebook.com/groups/reactnativeoss/) that the RC is ready to find a voluteer. You can also use [react-native-release-notes](https://github.com/knowbody/react-native-release-notes) to generate a draft of release notes.\n\nTo go through all the commits that went into a release, one way is to use the GitHub compare view:\n\n```\nhttps://github.com/facebook/react-native/compare/0.49-stable...0.50-stable\n```\n\n**Note**: This only shows **250** commits, if there are more use git.\n\nWhen making a list of changes, ignore docs, showcase updates and minor typos.\n\nSometimes commit messages might be really short / confusing - try rewording them where it makes sense. Below are few examples:\n\n- `Fix logging reported by RUN_JS_BUNDLE` -> `Fix systrace logging of RUN_JS_BUNDLE event`\n- `Fixes hot code reloading issue` -> `Fix an edge case in hot module reloading`\n\nBefore posting the list of changes, consider asking one of contributors for their opinion. Once everything is ready, post the release notes: https://github.com/facebook/react-native/releases\n\n**Important**: For release candidate releases, make sure to check \"This is a pre-release\".\n\n### Step 4: Update `Breaking Changes` document\n\nOnce the release is cut, go to the [page](https://github.com/facebook/react-native/wiki/Breaking-Changes) where all breaking changes are listed and create section for the release. Don't forget to move all breaking changes from `master` that are now part of the release.\n\nWhen finished and there are breaking changes, include them in the release notes you just created.\n\n### Step 5: Tweet about the RC release\n\nTweet about it! Link to release notes and say \"please report issues\" and link to the master issue to track bugs you created.\n\n### Step 6: IMPORTANT: Track bug reports from the community during the following month, ping owners to get them fixed\n\nNow that the release is out in the open, go ahead and create a GitHub issue titled \"[[0.XX-RC] Commits to cherry-pick](https://github.com/facebook/react-native/issues/14713)\" where 0.XX matches the release version. Use this issue to track bugs that have been reported for this particular release, including commits that should be cherry-picked in cases that a fix cannot wait until the next release.\n\n-------------------\n\n## How to release an RC update (e.g. 0.50.0-rc.1, 0.50.0-rc.2)\n\nThe release is now in the open, people are finding bugs, and fixes have landed in master. People have been nominating fixes in the issue you created above. Use your best judgment to decide which commits merit an RC update. It's a good idea to do a new RC release when several small and non-risky bugs have been fixed. Having a few RC releases can also help people bisect in case we cherry-pick a bad commit by mistake.\n\n**Only cherry-pick small and non-risky bug fixes**. **Don't pick new features into the release** as this greatly increases the risk of something breaking. The main point of the RC is to let people to use it for a month and fix the most serious bugs.\n\n\n### Step 1: Check out the release branch\n\nFollow these steps to check out the release branch:\n\n```bash\ngit checkout <version_you_are_patching>-stable\n# e.g. git checkout 0.50-stable\n\ngit pull origin <version_you_are_patching>-stable\n# e.g. git pull origin 0.50-stable\n```\n\n> If you don't have a local checkout of the release branch, you can run the following instead:\n> `git checkout -b <version_you_are_patching>-stable -t origin/<version_you_are_patching>-stable`\n\n### Step 2: Cherry-pick commits\n\nNow, cherry-pick those commits:\n\n```\ngit cherry-pick commitHash1\n```\n\n### Step 3: IMPORTANT: Test everything again (Chrome debugging, Reload JS, Hot Module Reloading)\n\nGo through the same process as earlier to test the release:\n\n```\n./scripts/test-manual-e2e.sh\n```\n\n### Step 4: Bump the version number\n\nIf everything worked, run the following to bump the version number:\n\n```bash\n./scripts/bump-oss-version.js <exact_version_you_are_releasing>\n# e.g. ./scripts/bump-oss-version.js 0.50.0-rc.1\n```\n\n### Step 5: Push to GitHub\n\nFinally, push the new tags and commits to GitHub:\n\n```\ngit push --tags\ngit push\n````\n\nAgain, Circle CI will automatically run the tests and publish to npm with the version you have specified (e.g `0.50.0-rc.1`).\n\n### Step 6: Update the release notes\n\nGo to https://github.com/facebook/react-native/releases and find the release notes for this release candidate. Edit them so that they now point to the tag that you've just created. We want single release notes per version. For example, if there is v0.50.0-rc and you just released v0.50.0-rc.1, the release notes should live on the v0.50.0-rc.1 tag at https://github.com/facebook/react-native/tags\n\n-------------------\n\n## How to do the final stable release (e.g. 0.50.0, 0.50.1)\n\nA stable release is promoted roughly a month after the release branch is cut (refer to the schedule above). The release may be delayed for several reasons, including major issues in the release candidate. Make sure that all bug fixes that have been nominated in your tracking issue have been addressed as needed. Avoid cherry-picking commits that have not been vetted in the release candidate phase at this point.\n\nOnce you are sure that the release is solid, perform the following steps. Note that they're similar to the steps you may have followed earlier when patching the release candidate, but we're not cherry-picking any additional commits at this point. \n\n### Step 1: Check out the release branch\n\n```bash\ngit checkout <version_you_are_patching>-stable\n# e.g. git checkout 0.50-stable\n\ngit pull origin <version_you_are_patching>-stable\n# e.g. git pull origin 0.50-stable\n```\n\n> If you don't have a local checkout of the release branch, you can run the following instead:\n> `git checkout -b <version_you_are_patching>-stable -t origin/<version_you_are_patching>-stable`\n\n### Step 2: IMPORTANT: Test everything again (Chrome debugging, Reload JS, Hot Module Reloading)\n\nIt's **important** to test everything again: you don't want to cut a release with a major blocking issue!\n\n```\n./scripts/test-manual-e2e.sh\n```\n\n### Step 3: Bump the version number\n\nIf everything worked:\n\n```bash\n./scripts/bump-oss-version.js <exact_version_you_are_releasing>\n# e.g. ./scripts/bump-oss-version.js 0.50.0\n```\n\n### Step 4: Push to GitHub\n\nFinally, push the new tags and commits to GitHub:\n\n```\ngit push --tags\ngit push\n```\n\nAs with the release candidate, Circle CI will automatically run the tests and publish to npm with the version you have specified (e.g `0.50.0`).\n\nGo to [Circle CI](https://circleci.com/gh/facebook/react-native) and look for the build triggered by your push (e.g. _0.50-stable, [0.50.0] Bump version numbers_), then scroll down to the npm publish step to verify the package was published successfully (the build will be red if not).\n\nThis will now become the latest release, and will be installed by users by default. At this point, the website will be updated and the docs for this release will be displayed by default.\n\n### Step 5: Update the release notes\n\nOnce you see that the website is displaying the version that you have just created, you will need to update the release notes. Move the release notes from the release candidate, to the tag that you've just created. We want single release notes per version. For example, if there is v0.50.0-rc and later we release v0.50.0, the release notes should live on v0.50.0:\nhttps://github.com/facebook/react-native/tags\n\nFor non-RC releases: Uncheck the box \"This is a pre-release\" and publish the notes.\n\n### Supporting the release\n\nSometimes things don't go well and a major issue is missed during the release candidate phase. If a fix cannot wait until the next release is cut, it may be necessary to cherry-pick it into the current stable release. Go back to your `[0.XX-RC] Commits to cherry-pick` issue and rename it to `[0.XX] Commits to cherry-pick`, then add a comment stating that any cherry-pick requests from then on will be applied to the stable release.\n\n**The same guidelines for RC cherry-picks apply here. If anything, the bar for cherry-picking into a stable release is higher.** Stick to commits that fix blocking issues. Examples may be RedBoxes on newly generated projects, broken upgrade flows with no workaround, or bugs affecting the compiling and/or building of projects.\n"
  },
  {
    "path": "babel-preset/README.md",
    "content": "# babel-preset-react-native\n\nBabel presets for React Native applications. React Native itself uses this Babel preset by default when transforming your app's source code.\n\nIf you wish to use a custom Babel configuration by writing a `.babelrc` file in your project's root directory, you must specify all the plugins necessary to transform your code. React Native does not apply its default Babel configuration in this case. So, to make your life easier, you can use this preset to get the default configuration and then specify more plugins that run before it.\n\n## Usage\n\nAs mentioned above, you only need to use this preset if you are writing a custom `.babelrc` file.\n\n### Installation\n\nInstall `babel-preset-react-native` in your app:\n```sh\nnpm i babel-preset-react-native --save-dev\n```\n\n### Configuring Babel\n\nThen, create a file called `.babelrc` in your project's root directory. The existence of this `.babelrc` file will tell React Native to use your custom Babel configuration instead of its own. Then load this preset:\n```\n{\n  \"presets\": [\"react-native\"]\n}\n```\n\nYou can further customize your Babel configuration by specifying plugins and other options. See [Babel's `.babelrc` documentation](https://babeljs.io/docs/usage/babelrc/) to learn more.\n\n## Help and Support\n\nIf you get stuck configuring Babel, please ask a question on Stack Overflow or find a consultant for help. If you discover a bug, please open up an issue.\n"
  },
  {
    "path": "babel-preset/configs/hmr.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nvar path = require('path');\nvar resolvePlugins = require('../lib/resolvePlugins');\n\nvar hmrTransform = 'react-transform-hmr/lib/index.js';\nvar transformPath = require.resolve(hmrTransform);\n\nmodule.exports = function(options, filename) {\n  var transform = filename\n      ? './' + path.relative(path.dirname(filename), transformPath) // packager can't handle absolute paths\n      : hmrTransform;\n\n  // Fix the module path to use '/' on Windows.\n  if (path.sep === '\\\\') {\n    transform = transform.replace(/\\\\/g, '/');\n  }\n\n  return {\n    plugins: resolvePlugins([\n      [\n        'react-transform',\n        {\n          transforms: [{\n            transform: transform,\n            imports: ['react'],\n            locals: ['module'],\n          }]\n        },\n      ]\n    ])\n  };\n};\n"
  },
  {
    "path": "babel-preset/configs/main.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n'use strict';\n\nvar resolvePlugins = require('../lib/resolvePlugins');\n\nconst getPreset = (src, options) => {\n  const plugins = [];\n  const isNull = src === null || src === undefined;\n  const hasClass = isNull || src.indexOf('class') !== -1;\n  const hasForOf =\n    isNull || (src.indexOf('for') !== -1 && src.indexOf('of') !== -1);\n\n  plugins.push(\n    'syntax-class-properties',\n    'syntax-trailing-function-commas',\n    'transform-class-properties',\n    'transform-es2015-block-scoping',\n    'transform-es2015-computed-properties',\n    'transform-es2015-destructuring',\n    'transform-es2015-function-name',\n    'transform-es2015-literals',\n    'transform-es2015-parameters',\n    'transform-es2015-shorthand-properties',\n    'transform-flow-strip-types',\n    'transform-react-jsx',\n    'transform-regenerator',\n    [\n      'transform-es2015-modules-commonjs',\n      {strict: false, allowTopLevelThis: true},\n    ]\n  );\n\n  if (isNull || src.indexOf('async') !== -1 || src.indexOf('await') !== -1) {\n    plugins.push('syntax-async-functions');\n  }\n  if (hasClass) {\n    plugins.push('transform-es2015-classes');\n  }\n  if (isNull || src.indexOf('=>') !== -1) {\n    plugins.push('transform-es2015-arrow-functions');\n  }\n  if (isNull || src.indexOf('const') !== -1) {\n    plugins.push('check-es2015-constants');\n  }\n  if (isNull || hasClass || src.indexOf('...') !== -1) {\n    plugins.push('transform-es2015-spread');\n    plugins.push('transform-object-rest-spread');\n  }\n  if (isNull || src.indexOf('`') !== -1) {\n    plugins.push('transform-es2015-template-literals');\n  }\n  if (isNull || src.indexOf('**') !== -1) {\n    plugins.push('transform-exponentiation-operator');\n  }\n  if (isNull || src.indexOf('Object.assign') !== -1) {\n    plugins.push('transform-object-assign');\n  }\n  if (hasForOf) {\n    plugins.push(['transform-es2015-for-of', {loose: true}]);\n  }\n  if (hasForOf || src.indexOf('Symbol') !== -1) {\n    plugins.push(require('../transforms/transform-symbol-member'));\n  }\n  if (\n    isNull ||\n    src.indexOf('React.createClass') !== -1 ||\n    src.indexOf('createReactClass') !== -1\n  ) {\n    plugins.push('transform-react-display-name');\n  }\n\n  if (options && options.dev) {\n    plugins.push('transform-react-jsx-source');\n  }\n\n  return {\n    comments: false,\n    compact: true,\n    plugins: resolvePlugins(plugins),\n  };\n};\n\nconst base = getPreset(null);\nconst devTools = getPreset(null, {dev: true});\n\nmodule.exports = options => {\n  if (options.withDevTools == null) {\n    const env = process.env.BABEL_ENV || process.env.NODE_ENV;\n    if (!env || env === 'development') {\n      return devTools;\n    }\n  }\n  return base;\n};\n\nmodule.exports.getPreset = getPreset;\n"
  },
  {
    "path": "babel-preset/index.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nmodule.exports = require('./configs/main');\n"
  },
  {
    "path": "babel-preset/lib/resolvePlugins.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\n/**\n * Manually resolve all default Babel plugins.\n * `babel.transform` will attempt to resolve all base plugins relative to\n * the file it's compiling. This makes sure that we're using the plugins\n * installed in the react-native package.\n */\nfunction resolvePlugins(plugins) {\n  return plugins.map(function(plugin) {\n    // Normalise plugin to an array.\n    if (!Array.isArray(plugin)) {\n      plugin = [plugin];\n    }\n    // Only resolve the plugin if it's a string reference.\n    if (typeof plugin[0] === 'string') {\n      plugin[0] = require('babel-plugin-' + plugin[0]);\n      plugin[0] = plugin[0].__esModule ? plugin[0].default : plugin[0];\n    }\n    return plugin;\n  });\n}\n\nmodule.exports = resolvePlugins;\n"
  },
  {
    "path": "babel-preset/package.json",
    "content": "{\n  \"name\": \"babel-preset-react-native\",\n  \"version\": \"4.0.0\",\n  \"description\": \"Babel preset for React Native applications\",\n  \"main\": \"index.js\",\n  \"repository\": \"https://github.com/facebook/react-native/tree/master/babel-preset\",\n  \"keywords\": [\n    \"babel\",\n    \"preset\",\n    \"react-native\"\n  ],\n  \"license\": \"BSD-3-Clause\",\n  \"bugs\": {\n    \"url\": \"https://github.com/facebook/react-native/issues\"\n  },\n  \"homepage\": \"https://github.com/facebook/react-native/tree/master/babel-preset/README.md\",\n  \"dependencies\": {\n    \"babel-plugin-check-es2015-constants\": \"^6.5.0\",\n    \"babel-plugin-react-transform\": \"^3.0.0\",\n    \"babel-plugin-syntax-async-functions\": \"^6.5.0\",\n    \"babel-plugin-syntax-class-properties\": \"^6.5.0\",\n    \"babel-plugin-syntax-dynamic-import\": \"^6.18.0\",\n    \"babel-plugin-syntax-flow\": \"^6.5.0\",\n    \"babel-plugin-syntax-jsx\": \"^6.5.0\",\n    \"babel-plugin-syntax-trailing-function-commas\": \"^6.5.0\",\n    \"babel-plugin-transform-class-properties\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-arrow-functions\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-block-scoping\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-classes\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-computed-properties\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-destructuring\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-for-of\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-function-name\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-literals\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-modules-commonjs\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-parameters\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-shorthand-properties\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-spread\": \"^6.5.0\",\n    \"babel-plugin-transform-es2015-template-literals\": \"^6.5.0\",\n    \"babel-plugin-transform-exponentiation-operator\": \"^6.5.0\",\n    \"babel-plugin-transform-flow-strip-types\": \"^6.5.0\",\n    \"babel-plugin-transform-object-assign\": \"^6.5.0\",\n    \"babel-plugin-transform-object-rest-spread\": \"^6.5.0\",\n    \"babel-plugin-transform-react-display-name\": \"^6.5.0\",\n    \"babel-plugin-transform-react-jsx\": \"^6.5.0\",\n    \"babel-plugin-transform-react-jsx-source\": \"^6.5.0\",\n    \"babel-plugin-transform-regenerator\": \"^6.5.0\",\n    \"babel-plugin-module-resolver\": \"^3.1.1\",\n    \"babel-template\": \"^6.24.1\",\n    \"react-transform-hmr\": \"^1.0.4\"\n  }\n}\n"
  },
  {
    "path": "babel-preset/plugins.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nmodule.exports = {\n  'babel-plugin-react-transform': require('babel-plugin-react-transform'),\n  'babel-plugin-syntax-async-functions': require('babel-plugin-syntax-async-functions'),\n  'babel-plugin-syntax-class-properties': require('babel-plugin-syntax-class-properties'),\n  'babel-plugin-syntax-dynamic-import': require('babel-plugin-syntax-dynamic-import'),\n  'babel-plugin-syntax-trailing-function-commas': require('babel-plugin-syntax-trailing-function-commas'),\n  'babel-plugin-transform-class-properties': require('babel-plugin-transform-class-properties'),\n  'babel-plugin-transform-es2015-function-name': require('babel-plugin-transform-es2015-function-name'),\n  'babel-plugin-transform-es2015-arrow-functions': require('babel-plugin-transform-es2015-arrow-functions'),\n  'babel-plugin-transform-es2015-block-scoping': require('babel-plugin-transform-es2015-block-scoping'),\n  'babel-plugin-transform-es2015-classes': require('babel-plugin-transform-es2015-classes'),\n  'babel-plugin-transform-es2015-computed-properties': require('babel-plugin-transform-es2015-computed-properties'),\n  'babel-plugin-check-es2015-constants': require('babel-plugin-check-es2015-constants'),\n  'babel-plugin-transform-es2015-destructuring': require('babel-plugin-transform-es2015-destructuring'),\n  'babel-plugin-transform-es2015-modules-commonjs': require('babel-plugin-transform-es2015-modules-commonjs'),\n  'babel-plugin-transform-es2015-parameters': require('babel-plugin-transform-es2015-parameters'),\n  'babel-plugin-transform-es2015-shorthand-properties': require('babel-plugin-transform-es2015-shorthand-properties'),\n  'babel-plugin-transform-es2015-spread': require('babel-plugin-transform-es2015-spread'),\n  'babel-plugin-transform-es2015-template-literals': require('babel-plugin-transform-es2015-template-literals'),\n  'babel-plugin-transform-es2015-literals' : require('babel-plugin-transform-es2015-literals'),\n  'babel-plugin-transform-flow-strip-types': require('babel-plugin-transform-flow-strip-types'),\n  'babel-plugin-transform-object-assign': require('babel-plugin-transform-object-assign'),\n  'babel-plugin-transform-object-rest-spread': require('babel-plugin-transform-object-rest-spread'),\n  'babel-plugin-transform-react-display-name': require('babel-plugin-transform-react-display-name'),\n  'babel-plugin-transform-react-jsx-source': require('babel-plugin-transform-react-jsx-source'),\n  'babel-plugin-transform-react-jsx': require('babel-plugin-transform-react-jsx'),\n  'babel-plugin-transform-regenerator': require('babel-plugin-transform-regenerator'),\n  'babel-plugin-transform-es2015-for-of': require('babel-plugin-transform-es2015-for-of'),\n};\n"
  },
  {
    "path": "babel-preset/transforms/transform-symbol-member.js",
    "content": "/**\n * Copyright 2004-present Facebook. All Rights Reserved.\n */\n\n'use strict';\n\n/*eslint consistent-return: 0*/\n\n/**\n * Transforms function properties of the `Symbol` into\n * the presence check, and fallback string \"@@<name>\".\n *\n * Example:\n *\n *   Symbol.iterator;\n *\n * Transformed to:\n *\n *   typeof Symbol.iterator === 'function' ? Symbol.iterator : '@@iterator';\n */\nmodule.exports = function symbolMember(babel) {\n  const t = babel.types;\n\n  return {\n    visitor: {\n      MemberExpression(path) {\n        if (!isAppropriateMember(path)) {\n          return;\n        }\n\n        let node = path.node;\n\n        path.replaceWith(\n          t.conditionalExpression(\n            t.binaryExpression(\n              '===',\n              t.unaryExpression(\n                'typeof',\n                t.identifier('Symbol'),\n                true\n              ),\n              t.stringLiteral('function')\n            ),\n            node,\n            t.stringLiteral(`@@${node.property.name}`)\n          )\n        );\n\n        // We should stop to avoid infinite recursion, since Babel\n        // traverses replaced path, and again would hit our transform.\n        path.stop();\n      },\n    },\n  };\n};\n\nfunction isAppropriateMember(path) {\n  let node = path.node;\n\n  return path.parentPath.type !== 'AssignmentExpression' &&\n    node.object.type === 'Identifier' &&\n    node.object.name === 'Symbol' &&\n    node.property.type === 'Identifier';\n}\n"
  },
  {
    "path": "blog/2015-03-26-react-native-bringing-modern-web-techniques-to-mobile.md",
    "content": "---\ntitle: React Native: Bringing modern web techniques to mobile\nauthor: Tom Occhino\nauthorTitle: Engineering Manager at Facebook\nauthorURL: https://github.com/tomocchino\nauthorImage: https://avatars0.githubusercontent.com/u/13947?v=3&s=460\nauthorTwitter: tomocchino\nhero: /react-native/blog/img/dark-hero.png\ncategory: announcements\n---\n\nWe introduced [React](https://code.facebook.com/projects/176988925806765/react/) to the world two years ago, and since then it's seen impressive growth, both inside and outside of Facebook. Today, even though no one is forced to use it, new web projects at Facebook are commonly built using React in one form or another, and it's being broadly adopted across the industry. Engineers are choosing to use React every day because it enables them to spend more time focusing on their products and less time fighting with their framework. It wasn't until we'd been building with React for a while, though, that we started to understand what makes it so powerful.\n\nReact forces us to break our applications down into discrete components, each representing a single view. These components make it easier to iterate on our products, since we don't need to keep the entire system in our head in order to make changes to one part of it. More important, though, React wraps the DOM's mutative, imperative API with a declarative one, which raises the level of abstraction and simplifies the programming model. What we've found is that when we build with React, our code is a lot more predictable. This predictability makes it so we can iterate more quickly with confidence, and our applications are a lot more reliable as a result. Additionally, it's not only easier to scale our applications when they're built with React, but we've found it's also easier to scale the size of our teams themselves.\n\nTogether with the rapid iteration cycle of the web, we've been able to build some awesome products with React, including many components of Facebook.com. Additionally, we've built amazing frameworks in JavaScript on top of React, like [Relay](https://facebook.github.io/react/blog/2015/02/20/introducing-relay-and-graphql.html), which allows us to greatly simplify our data fetching at scale. Of course, web is only part of the story. Facebook also has widely used Android and iOS apps, which are built on top of disjointed, proprietary technology stacks. Having to build our apps on top of multiple platforms has bifurcated our engineering organization, but that's only one of the things that makes native mobile application development hard.\n\n<footer>\n  <a href=\"https://code.facebook.com/posts/1014532261909640/react-native-bringing-modern-web-techniques-to-mobile/\" class=\"btn\">Read more</a>\n</footer>\n\n> This is an excerpt. Read the rest of the post on [Facebook Code](https://code.facebook.com/posts/1014532261909640/react-native-bringing-modern-web-techniques-to-mobile/).\n"
  },
  {
    "path": "blog/2015-09-14-react-native-for-android.md",
    "content": "---\ntitle: React Native for Android: How we built the first cross-platform React Native app\nauthor: Daniel Witte\nauthorTitle: Software Engineer at Facebook\nauthorURL: https://www.facebook.com/drwitte\nauthorImage: https://scontent-sea1-1.xx.fbcdn.net/v/t1.0-1/c54.54.681.681/s160x160/20622_10100459314481893_1435252658_n.jpg?_nc_log=1&oh=7afdb6aaa02f320c4dd4749733140133&oe=59D77C28\nhero: /react-native/blog/img/blue-hero.jpg\ncategory: announcements\n---\n\nEarlier this year, we introduced [React Native for iOS](https://code.facebook.com/posts/1014532261909640/react-native-bringing-modern-web-techniques-to-mobile/). React Native brings what developers are used to from React on the web — declarative self-contained UI components and fast development cycles — to the mobile platform, while retaining the speed, fidelity, and feel of native applications. Today, we're happy to release React Native for Android.\n\nAt Facebook we've been using React Native in production for over a year now. Almost exactly a year ago, our team set out to develop the [Ads Manager app](https://www.facebook.com/business/news/ads-manager-app). Our goal was to create a new app to let the millions of people who advertise on Facebook manage their accounts and create new ads on the go. It ended up being not only Facebook's first fully React Native app but also the first cross-platform one. In this post, we'd like to share with you how we built this app, how React Native enabled us to move faster, and the lessons we learned.\n\n<footer>\n  <a href=\"https://code.facebook.com/posts/1189117404435352/react-native-for-android-how-we-built-the-first-cross-platform-react-native-app/\" class=\"btn\">Read more</a>\n</footer>\n\n> This is an excerpt. Read the rest of the post on [Facebook Code](https://code.facebook.com/posts/1189117404435352/react-native-for-android-how-we-built-the-first-cross-platform-react-native-app/).\n"
  },
  {
    "path": "blog/2015-11-23-making-react-native-apps-accessible.md",
    "content": "---\ntitle: Making React Native apps accessible\nauthor: Georgiy Kassabli\nauthorTitle: Software Engineer at Facebook\nauthorURL: https://www.facebook.com/georgiy.kassabli\nauthorImage: https://scontent-sea1-1.xx.fbcdn.net/v/t1.0-1/c0.0.160.160/p160x160/1978838_795592927136196_1205041943_n.jpg?_nc_log=1&oh=d7a500fdece1250955a4d27b0a80fee2&oe=59E8165A\nhero: /react-native/blog/img/blue-hero.jpg\ncategory: engineering\n---\n\nWith the recent launch of React on web and React Native on mobile, we've provided a new front-end framework for developers to build products. One key aspect of building a robust product is ensuring that anyone can use it, including people who have vision loss or other disabilities. The Accessibility API for React and React Native enables you to make any React-powered experience usable by someone who may use assistive technology, like a screen reader for the blind and visually impaired.\n\nFor this post, we're going to focus on React Native apps. We've designed the React Accessibility API to look and feel similar to the iOS and Android APIs. If you've developed accessible applications for the web, iOS, or Android before, you should feel comfortable with the framework and nomenclature of the React AX API. For instance, you can make a UI element _accessible_ (therefore exposed to assistive technology) and use _accessibilityLabel_ to provide a string description for the element:\n\n```\n<View accessible={true} accessibilityLabel=”This is simple view”>\n```\n\nLet's walk through a slightly more involved application of the React AX API by looking at one of Facebook's own React-powered products: the **Ads Manager app**.\n\n<footer>\n  <a href=\"https://code.facebook.com/posts/435862739941212/making-react-native-apps-accessible/\" class=\"btn\">Read more</a>\n</footer>\n\n> This is an excerpt. Read the rest of the post on [Facebook Code](https://code.facebook.com/posts/435862739941212/making-react-native-apps-accessible/).\n"
  },
  {
    "path": "blog/2016-03-24-introducing-hot-reloading.md",
    "content": "---\ntitle: Introducing Hot Reloading\nauthor: Martín Bigio\nauthorTitle: Software Engineer at Instagram\nauthorURL: https://twitter.com/martinbigio\nauthorImage: https://avatars3.githubusercontent.com/u/535661?v=3&s=128\nauthorTwitter: martinbigio\ncategory: engineering\n---\n\nReact Native's goal is to give you the best possible developer experience. A big part of it is the time it takes between you save a file and be able to see the changes. Our goal is to get this feedback loop to be under 1 second, even as your app grows.\n\nWe got close to this ideal via three main features:\n\n* Use JavaScript as the language doesn't have a long compilation cycle time.\n* Implement a tool called Packager that transforms es6/flow/jsx files into normal JavaScript that the VM can understand. It was designed as a server that keeps intermediate state in memory to enable fast incremental changes and uses multiple cores.\n* Build a feature called Live Reload that reloads the app on save.\n\nAt this point, the bottleneck for developers is no longer the time it takes to reload the app but losing the state of your app. A common scenario is to work on a feature that is multiple screens away from the launch screen. Every time you reload, you've got to click on the same path again and again to get back to your feature, making the cycle multiple-seconds long.\n\n\n## Hot Reloading\n\nThe idea behind hot reloading is to keep the app running and to inject new versions of the files that you edited at runtime. This way, you don't lose any of your state which is especially useful if you are tweaking the UI.\n\nA video is worth a thousand words. Check out the difference between Live Reload (current) and Hot Reload (new).\n\n<iframe width=\"100%\" height=\"315\" src=\"https://www.youtube.com/embed/2uQzVi-KFuc\" frameborder=\"0\" allowfullscreen></iframe>\n\nIf you look closely, you can notice that it is possible to recover from a red box and you can also start importing modules that were not previously there without having to do a full reload.\n\n**Word of warning:** because JavaScript is a very stateful language, hot reloading cannot be perfectly implemented. In practice, we found out that the current setup is working well for a large amount of usual use cases and a full reload is always available in case something gets messed up.\n\nHot reloading is available as of 0.22, you can enable it:\n\n* Open the developer menu\n* Tap on \"Enable Hot Reloading\"\n\n\n## Implementation in a nutshell\n\nNow that we've seen why we want it and how to use it, the fun part begins: how it actually works.\n\nHot Reloading is built on top of a feature [Hot Module Replacement](https://webpack.github.io/docs/hot-module-replacement-with-webpack.html), or HMR. It was first introduced by Webpack and we implemented it inside of React Native Packager. HMR makes the Packager watch for file changes and send HMR updates to a thin HMR runtime included on the app.\n\nIn a nutshell, the HMR update contains the new code of the JS modules that changed. When the runtime receives them, it replaces the old modules' code with the new one:\n\n![](/react-native/blog/img/hmr-architecture.png)\n\n\nThe HMR update contains a bit more than just the module's code we want to change because replacing it, it's not enough for the runtime to pick up the changes. The problem is that the module system may have already cached the *exports* of the module we want to update. For instance, say you have an app composed of these two modules:\n\n```\n// log.js\nfunction log(message) {\n  const time = require('./time');\n  console.log(`[${time()}] ${message}`);\n}\n\nmodule.exports = log;\n```\n\n```\n// time.js\nfunction time() {\n  return new Date().getTime();\n}\n\nmodule.exports = time;\n```\n\nThe module `log`, prints out the provided message including the current date provided by the module `time`.\n\nWhen the app is bundled, React Native registers each module on the module system using the `__d` function. For this app, among many `__d` definitions, there will one for `log`:\n\n```\n__d('log', function() {\n  ... // module's code\n});\n```\n\nThis invocation wraps each module's code into an anonymous function which we generally refer to as the factory function. The module system runtime keeps track of each module's factory function, whether it has already been executed, and the result of such execution (exports). When a module is required, the module system either provides the already cached exports or executes the module's factory function for the first time and saves the result.\n\nSo say you start your app and require `log`. At this point, neither `log` nor `time`'s factory functions have been executed so no exports have been cached.  Then, the user modifies `time` to return the date in `MM/DD`:\n\n```\n// time.js\nfunction bar() {\n  var date = new Date();\n  return `${date.getMonth() + 1}/${date.getDate()}`;\n}\n\nmodule.exports = bar;\n```\n\nThe Packager will send time's new code to the runtime (step 1), and when `log` gets eventually required the exported function gets executed it will do so with `time`'s changes (step 2):\n\n![](/react-native/blog/img/hmr-step.png)\n\n\nNow say the code of `log` requires `time` as a top level require:\n\n```\nconst time = require('./time'); // top level require\n\n// log.js\nfunction log(message) {\n  console.log(`[${time()}] ${message}`);\n}\n\nmodule.exports = log;\n```\n\nWhen `log` is required, the runtime will cache its exports and `time`'s one. (step 1). Then, when `time` is modified, the HMR process cannot simply finish after replacing `time`'s code. If it did, when `log` gets executed, it would do so with a cached copy of `time` (old code).\n\nFor `log` to pick up `time` changes, we'll need to clear its cached exports because one of the modules it depends on was hot swapped (step 3). Finally, when `log` gets required again, its factory function will get executed requiring `time` and getting its new code.\n\n![](/react-native/blog/img/hmr-log.png)\n\n\n## HMR API\n\nHMR in React Native extends the module system by introducing the `hot` object. This API is based on [Webpack](https://webpack.github.io/docs/hot-module-replacement.html)'s one. The `hot` object exposes a function called `accept` which allows you to define a callback that will be executed when the module needs to be hot swapped. For instance, if we would change `time`'s code as follows, every time we save time, we'll see “time changed” in the console:\n\n```\n// time.js\nfunction time() {\n  ... // new code\n}\n\nmodule.hot.accept(() => {\n  console.log('time changed');\n});\n\nmodule.exports = time;\n```\n\nNote that only in rare cases you would need to use this API manually. Hot Reloading should work out of the box for the most common use cases.\n\n## HMR Runtime\n\nAs we've seen before, sometimes it's not enough only accepting the HMR update because a module that uses the one being hot swapped may have been already executed and its imports cached. For instance, suppose the dependency tree for the movies app example had a top-level `MovieRouter` that depended on the `MovieSearch` and `MovieScreen` views, which depended on the `log` and `time` modules from the previous examples:\n\n\n![](/react-native/blog/img/hmr-diamond.png)\n\n\nIf the user accesses the movies' search view but not the other one, all the modules except for `MovieScreen` would have cached exports. If a change is made to module `time`, the runtime will have to clear the exports of `log` for it to pick up `time`'s changes. The process wouldn't finish there: the runtime will repeat this process recursively up until all the parents have been accepted. So, it'll grab the modules that depend on `log` and try to accept them. For `MovieScreen` it can bail, as it hasn't been required yet. For `MovieSearch`, it will have to clear its exports and process its parents recursively. Finally, it will do the same thing for `MovieRouter` and finish there as no modules depends on it.\n\nIn order to walk the dependency tree, the runtime receives the inverse dependency tree from the Packager on the HMR update. For this example the runtime will receive a JSON object like this one:\n\n```\n{\n  modules: [\n    {\n      name: 'time',\n      code: /* time's new code */\n    }\n  ],\n  inverseDependencies: {\n    MovieRouter: [],\n    MovieScreen: ['MovieRouter'],\n    MovieSearch: ['MovieRouter'],\n    log: ['MovieScreen', 'MovieSearch'],\n    time: ['log'],\n  }\n}\n```\n\n## React Components\n\nReact components are a bit harder to get to work with Hot Reloading. The problem is that we can't simply replace the old code with the new one as we'd loose the component's state. For React web applications, [Dan Abramov](https://twitter.com/dan_abramov) implemented a babel [transform](https://gaearon.github.io/react-hot-loader/) that uses Webpack's HMR API to solve this issue. In a nutshell, his solution works by creating a proxy for every single React component on *transform time*. The proxies hold the component's state and delegate the lifecycle methods to the actual components, which are the ones we hot reload:\n\n![](/react-native/blog/img/hmr-proxy.png)\n\nBesides creating the proxy component, the transform also defines the `accept` function with a piece of code to force React to re-render the component. This way, we can hot reload rendering code without losing any of the app's state.\n\nThe default [transformer](https://github.com/facebook/react-native/blob/master/packager/transformer.js#L92-L95) that comes with React Native uses the `babel-preset-react-native`, which is [configured](https://github.com/facebook/react-native/blob/master/babel-preset/configs/hmr.js#L24-L31) to use `react-transform` the same way you'd use it on a React web project that uses Webpack.\n\n## Redux Stores\n\nTo enable Hot Reloading on [Redux](https://redux.js.org/) stores you will just need to use the HMR API similarly to what you'd do on a web project that uses Webpack:\n\n```\n// configureStore.js\nimport { createStore, applyMiddleware, compose } from 'redux';\nimport thunk from 'redux-thunk';\nimport reducer from '../reducers';\n\nexport default function configureStore(initialState) {\n  const store = createStore(\n    reducer,\n    initialState,\n    applyMiddleware(thunk),\n  );\n\n  if (module.hot) {\n    module.hot.accept(() => {\n      const nextRootReducer = require('../reducers/index').default;\n      store.replaceReducer(nextRootReducer);\n    });\n  }\n\n  return store;\n};\n```\n\nWhen you change a reducer, the code to accept that reducer will be sent to the client. Then the client will realize that the reducer doesn't know how to accept itself, so it will look for all the modules that refer it and try to accept them. Eventually, the flow will get to the single store, the `configureStore` module, which will accept the HMR update.\n\n## Conclusion\n\nIf you are interested in helping making hot reloading better, I encourage you to read [Dan Abramov's post around the future of hot reloading](https://medium.com/@dan_abramov/hot-reloading-in-react-1140438583bf#.jmivpvmz4) and to contribute. For example, Johny Days is going to [make it work with multiple connected clients](https://github.com/facebook/react-native/pull/6179). We're relying on you all to maintain and improve this feature.\n\nWith React Native, we have the opportunity to rethink the way we build apps in order to make it a great developer experience. Hot reloading is only one piece of the puzzle, what other crazy hacks can we do to make it better?\n"
  },
  {
    "path": "blog/2016-03-28-dive-into-react-native-performance.md",
    "content": "---\ntitle: Dive into React Native Performance\nauthor: Pieter De Baets\nauthorTitle: Software Engineer at Facebook\nauthorURL: https://github.com/javache\nauthorImage: https://avatars1.githubusercontent.com/u/5676?v=3&s=460\nauthorTwitter: javache\ncategory: engineering\n---\n\nReact Native allows you to build iOS and Android apps in JavaScript using React and Relay's declarative programming model. This leads to more concise, easier-to-understand code; fast iteration without a compile cycle; and easy sharing of code across multiple platforms. You can ship faster and focus on details that really matter, making your app look and feel fantastic. Optimizing performance is a big part of this. Here is the story of how we made React Native app startup twice as fast.\n\n## Why the hurry?\n\nWith an app that runs faster, content loads quickly, which means people get more time to interact with it, and smooth animations make the app enjoyable to use. In emerging markets, where [2011 class phones](https://code.facebook.com/posts/952628711437136/classes-performance-and-network-segmentation-on-android/) on [2G networks](https://newsroom.fb.com/news/2015/10/news-feed-fyi-building-for-all-connectivity/) are the majority, a focus on performance can make the difference between an app that is usable and one that isn't.\n\nSince releasing React Native on [iOS](https://facebook.github.io/react/blog/2015/03/26/introducing-react-native.html) and on [Android](https://code.facebook.com/posts/1189117404435352/react-native-for-android-how-we-built-the-first-cross-platform-react-native-app/), we have been improving list view scrolling performance, memory efficiency, UI responsiveness, and app startup time. Startup sets the first impression of an app and stresses all parts of the framework, so it is the most rewarding and challenging problem to tackle.\n\n<footer>\n  <a href=\"https://code.facebook.com/posts/895897210527114/dive-into-react-native-performance/\" class=\"btn\">Read more</a>\n</footer>\n\n> This is an excerpt. Read the rest of the post on [Facebook Code](https://code.facebook.com/posts/895897210527114/dive-into-react-native-performance/).\n"
  },
  {
    "path": "blog/2016-04-13-react-native-a-year-in-review.md",
    "content": "---\ntitle: React Native: A year in review\nauthor: Martin Konicek\nauthorTitle: Software Engineer at Facebook\nauthorURL: https://github.com/mkonicek\nauthorImage: https://avatars1.githubusercontent.com/u/346214?v=3&s=460\nauthorTwitter: martinkonicek\nhero: /react-native/blog/img/big-hero.jpg\ncategory: announcements\n---\n\nIt's been one year since we open-sourced React Native. What started as an idea with a handful of engineers is now a framework being used by product teams across Facebook and beyond. Today at F8 we announced that Microsoft is bringing [React Native to the Windows ecosystem](https://microsoft.github.io/code-push/articles/ReactNativeWindows.html), giving developers the potential to build React Native on Windows PC, Phone, and Xbox. It will also provide open source tools and services such as a React Native extension for Visual Studio Code and CodePush to help developers create React Native apps on the Windows platform. In addition, [Samsung](https://www.tizen.org/blogs) is building React Native for its hybrid platform, which will empower developers to build apps for millions of SmartTVs and mobile and wearable devices. We also released the [Facebook SDK for React Native](https://github.com/facebook/react-native-fbsdk), which makes it easier for developers to incorporate Facebook social features like Login, Sharing, App Analytics, and Graph APIs into their apps. In one year, React Native has changed the way developers build on every major platform.\n\nIt's been an epic ride — but we are only getting started. Here is a look back at how React Native has grown and evolved since we open-sourced it a year ago, some challenges we faced along the way, and what we expect as we look ahead to the future.\n\n<footer>\n  <a href=\"https://code.facebook.com/posts/597378980427792/react-native-a-year-in-review/\" class=\"btn\">Read more</a>\n</footer>\n\n> This is an excerpt. Read the rest of the post on [Facebook Code](https://code.facebook.com/posts/597378980427792/react-native-a-year-in-review/).\n"
  },
  {
    "path": "blog/2016-07-06-toward-better-documentation.md",
    "content": "---\ntitle: Toward Better Documentation\nauthor: Kevin Lacker\nauthorTitle: Engineering Manager at Facebook\nauthorURL: https://twitter.com/lacker\nauthorImage: http://www.gravatar.com/avatar/9b790592be15d4f55a5ed7abb5103304?s=128\nauthorTwitter: lacker\ncategory: announcements\n---\n\nPart of having a great developer experience is having great documentation. A lot goes into creating good docs - the ideal documentation is concise, helpful, accurate, complete, and delightful. Recently we've been working hard to make the docs better based on your feedback, and we wanted to share some of the improvements we've made.\n\n## Inline Examples\n\nWhen you learn a new library, a new programming language, or a new framework, there's a beautiful moment when you first write a bit of code, try it out, see if it works... and it *does* work. You created something real. We wanted to put that visceral experience right into our docs. Like this:\n\n```ReactNativeWebPlayer\nimport React, { Component } from 'react';\nimport { AppRegistry, Text, View } from 'react-native';\n\nclass ScratchPad extends Component {\n  render() {\n    return (\n      <View style={{flex: 1}}>\n        <Text style={{fontSize: 30, flex: 1, textAlign: 'center'}}>\n          Isn't this cool?\n        </Text>\n        <Text style={{fontSize: 100, flex: 1, textAlign: 'center'}}>\n          👍\n        </Text>\n      </View>\n    );\n  }\n}\n\nAppRegistry.registerComponent('ScratchPad', () => ScratchPad);\n```\n\nWe think these inline examples, using the [`react-native-web-player`](https://github.com/dabbott/react-native-web-player) module with help from [Devin Abbott](https://twitter.com/devinaabbott), are a great way to learn the basics of React Native, and we have updated our [tutorial for new React Native developers](/react-native/docs/tutorial.html) to use these wherever possible. Check it out - if you have ever been curious to see what would happen if you modified just one little bit of sample code, this is a really nice way to poke around. Also, if you're building developer tools and you want to show a live React Native sample on your own site, [`react-native-web-player`](https://github.com/dabbott/react-native-web-player) can make that straightforward.\n\nThe core simulation engine is provided by [Nicolas Gallagher](https://twitter.com/necolas)'s [`react-native-web`](https://github.com/necolas/react-native-web) project, which provides a way to display React Native components like `Text` and `View` on the web. Check out [`react-native-web`](https://github.com/necolas/react-native-web) if you're interested in building mobile and web experiences that share a large chunk of the codebase.\n\n## Better Guides\n\nIn some parts of React Native, there are multiple ways to do things, and we've heard feedback that we could provide better guidance.\n\nWe have a new [guide to Navigation](/react-native/docs/navigator-comparison.html) that compares the different approaches and advises on what you should use - `Navigator`, `NavigatorIOS`, `NavigationExperimental`. In the medium term, we're working towards improving and consolidating those interfaces. In the short term, we hope that a better guide will make your life easier.\n\nWe also have a new [guide to handling touches](/react-native/docs/handling-touches.html) that explains some of the basics of making button-like interfaces, and a brief summary of the different ways to handle touch events.\n\nAnother area we worked on is Flexbox. This includes tutorials on how to [handle layout with Flexbox](/react-native/docs/flexbox.html) and how to control [the size of components](/react-native/docs/height-and-width.html). It also includes an unsexy but hopefully-useful [list of all the props that control layout in React Native](/react-native/docs/layout-props.html).\n\n## Getting Started\n\nWhen you start getting a React Native development environment set up on your machine, you do have to do a bunch of installing and configuring things. It's hard to make installation a really fun and exciting experience, but we can at least make it as quick and painless as possible.\n\nWe built a [new Getting Started workflow](/react-native/releases/next/docs/getting-started.html) that lets you select your development operating system and your mobile operating system up front, to provide one concise place with all the setup instructions. We also went through the installation process to make sure everything worked and to make sure that every decision point had a clear recommendation. After testing it out on our innocent coworkers, we're pretty sure this is an improvement.\n\nWe also worked on the [guide to integrating React Native into an existing app](/react-native/docs/integration-with-existing-apps.html). Many of the largest apps that use React Native, like the Facebook app itself, actually build part of the app in React Native, and part of it using regular development tools. We hope this guide makes it easier for more people to build apps this way.\n\n## We Need Your Help\n\nYour feedback lets us know what we should prioritize. I know some people will read this blog post and think \"Better docs? Pffft. The documentation for X is still garbage!\". That's great - we need that energy. The best way to give us feedback depends on the sort of feedback.\n\nIf you find a mistake in the documentation, like inaccurate descriptions or code that doesn't actually work, [file an issue](https://github.com/facebook/react-native/issues). Tag it with \"Documentation\", so that it's easier to route it to the right people.\n\nIf there isn't a specific mistake, but something in the documentation is fundamentally confusing, it's not a great fit for a GitHub issue. Instead, post on [Canny](https://react-native.canny.io/feature-requests) about the area of the docs that could use help. This helps us prioritize when we are doing more general work like guide-writing.\n\nThanks for reading this far, and thanks for using React Native!\n"
  },
  {
    "path": "blog/2016-08-12-react-native-meetup-san-francisco.md",
    "content": "---\ntitle: San Francisco Meetup Recap\nauthor: Héctor Ramos\nauthorTitle: Developer Advocate at Facebook\nauthorURL: https://twitter.com/hectorramos\nauthorImage: https://s.gravatar.com/avatar/f2223874e66e884c99087e452501f2da?s=128\nauthorTwitter: hectorramos\nhero: /react-native/blog/img/rnmsf-august-2016-hero.jpg\ncategory: events\n---\n\nLast week I had the opportunity to attend the [React Native Meetup](https://www.meetup.com/React-Native-San-Francisco/photos/27168649/#452793854) at Zynga’s San Francisco office. With around 200 people in attendance, it served as a great place to meet other developers near me that are also interested in React Native.\n\nI was particularly interested in learning more about how React and React Native are used at companies like Zynga, Netflix, and Airbnb. The agenda for the night would be as follows:\n\n* Rapid Prototyping in React\n* Designing APIs for React Native\n* Bridging the Gap: Using React Native in Existing Codebases\n\nBut first, the event started off with a quick introduction and a brief recap of recent news:\n\n* Did you know that React Native is now the [top Java repository on GitHub](https://twitter.com/jamespearce/status/759637111880359937)?\n* [rnpm](https://github.com/rnpm/rnpm) is now part of React Native core! You can now use `react-native link` in place of `rnpm link` to [install libraries with native dependencies](https://facebook.github.io/react-native/docs/linking-libraries-ios.html).\n* The React Native Meetup community is growing fast! There are now over 4,800 developers across a variety of React Native meetup groups all over the globe.\n\nIf [one of these meetups](https://www.meetup.com/find/?allMeetups=false&keywords=react+native&radius=Infinity&userFreeform=San+Francisco%2C+CA&mcId=z94105&mcName=San+Francisco%2C+CA&sort=recommended&eventFilter=mysugg) is held near you, I highly recommend attending!\n\n## Rapid Prototyping in React at Zynga\n\nThe first round of news was followed by a quick introduction by Zynga, our hosts for the evening. Abhishek Chadha talked about how they use React to quickly prototype new experiences on mobile, demoing a quick prototype of a Draw Something-like app. They use a similar approach as React Native, providing access to native APIs via a bridge. This was demonstrated when Abhishek used the device's camera to snap a photo of the audience and then drew a hat on someone's head.\n\n## Designing APIs for React Native at Netflix\n\nUp next, the first featured talk of the evening. [Clarence Leung](https://twitter.com/clarler), Senior Software Engineer at Netflix, presented his talk on Designing APIs for React Native. First he noted the two main types of libraries one may work on: components such as tab bars and date pickers, and libraries that provide access to native services such as the camera roll or in-app payments. There are two ways one may approach when building a library for use in React Native:\n\n* Provide platform-specific components\n* A cross-platform library with a similar API for both iOS and Android\n\nEach approach has its own considerations, and it’s up to you to determine what works best for your needs.\n\n**Approach #1**\n\nAs an example of platform-specific components, Clarence talked about the DatePickerIOS and DatePickerAndroid from core React Native. On iOS, date pickers are rendered as part of the UI and can be easily embedded in an existing view, while date pickers on Android are presented modally. It makes sense to provide separate components in this case.\n\n**Approach #2**\n\nPhoto pickers, on the other hand, are treated similarly on iOS and Android. There are some slight differences — Android does not group photos into folders like iOS does with Selfies, for example — but those are easily handled using `if` statements and the `Platform` component.\n\nRegardless of which approach you settle on, it’s a good idea to minimize the API surface and build app-specific libraries. For example, iOS’s In-App Purchase framework supports one-time, consumable purchases, as well as renewable subscriptions. If your app will only need to support consumable purchases, you may get away with dropping support for subscriptions in your cross-platform library.\n\n![](/react-native/blog/img/rnmsf-august-2016-netflix.jpg)\n\nThere was a brief Q&A session at the end of Clarence’s talk. One of the interesting tid bits that came out of it was that around 80% of the React Native code written for these libraries at Netflix is shared across both iOS and Android.\n\n## Bridging the Gap, Using React Native in Existing Codebases\n\nThe final talk of the night was by [Leland Richardson](https://twitter.com/intelligibabble) from Airbnb. The talk was focused on the use of React Native in existing codebases. I already know how easy it is to write a new app from scratch using React Native, so I was very interested to hear about Airbnb’s experience adopting React Native in their existing native apps.\n\nLeland started off by talking about greenfield apps versus brownfield apps. Greenfield means to start a project without the need to consider any prior work. This is in contrast to brownfield projects where you need to take into account the existing project’s requirements, development processes, and all of the teams various needs.\n\nWhen you’re working on a greenfield app, the React Native CLI sets up a single repository for both iOS and Android and everything just works. The first challenge against using React Native at Airbnb was the fact that the iOS and Android app each had their own repository. Multi-repo companies have some hurdles to get past before they can adopt React Native.\n\nTo get around this, Airbnb first set up a new repo for the React Native codebase. They used their continuous integration servers to mirror the iOS and Android repos into this new repo. After tests are run and the bundle is built, the build artifacts are synced back to the iOS and Android repos. This allows the mobile engineers to work on native code without altering their development enviroment. Mobile engineers don't need to install npm, run the packager, or remember to build the JavaScript bundle. The engineers writing actual React Native code do not have to worry about syncing their code across iOS and Android, as they work on the React Native repository directly.\n\nThis does come with some drawbacks, mainly they could not ship atomic updates. Changes that require a combination of native and JavaScript code would require three separate pull requests, all of which had to be carefully landed. In order to avoid conflicts, CI will fail to land changes back to the iOS and Android repos if master has changed since the build started. This would cause long delays during high commit frequency days (such as when new releases are cut).\n\nAirbnb has since moved to a mono repo approach. Fortunately this was already under consideration, and once the iOS and Android teams became comfortable with using React Native they were happy to accelerate the move towards the mono repo.\n\nThis has solved most of the issues they had with the split repo approach. Leland did note that this does cause a higher strain on the version control servers, which may be an issue for smaller companies.\n\n![](/react-native/blog/img/rnmsf-august-2016-airbnb.jpg)\n\n### The Navigation Problem\n\nThe second half of Leland's talk focused on a topic that is dear to me: the Navigation problem in React Native. He talked about the abundance of navigation libraries in React Native, both first party and third party. NavigationExperimental was mentioned as something that seemed promising, but ended up not being well suited for their use case.\n\nIn fact, none of the existing navigation libraries seem to work well for brownfield apps. A brownfield app requires that the navigation state be fully owned by the native app. For example, if a user’s session expires while a React Native view is being presented, the native app should be able to take over and present a login screen as needed.\n\nAirbnb also wanted to avoid replacing native navigation bars with JavaScript versions as part of a transition, as the effect could be jarring. Initially they limited themselves to modally presented views, but this obviously presented a problem when it came to adopting React Native more widely within their apps.\n\nThey decided that they needed their own library. The library is called `airbnb-navigation`. The library has not yet being open sourced as it is strongly tied to Airbnb’s codebase, but it is something they’d like to release by the end of the year.\n\nI won’t go into much detail into the library’s API, but here are some of the key takeaways:\n\n* One must preregister scenes ahead of time\n* Each scene is displayed within its own `RCTRootView`. They are presented natively on each platform (e.g. `UINavigationController`s are used on iOS).\n* The main `ScrollView` in a scene should be wrapped in a `ScrollScene` component. Doing so allows you to take advantage of native behaviors such as tapping on the status bar to scroll to the top on iOS.\n* Transitions between scenes are handled natively, no need to worry about performance.\n* The Android back button is automatically supported.\n* They can take advantage of View Controller based navigation bar styling via a Navigator.Config UI-less component.\n\nThere’s also some considerations to keep in mind:\n\n* The navigation bar is not easily customized in JavaScript, as it is a native component. This is intentional, as using native navigation bars is a hard requirement for this type of library.\n* ScreenProps must be serialized/de-serialized whenever they're sent through the bridge, so care must be taken if sending too much data here.\n* Navigation state is owned by the native app (also a hard requirement for the library), so things like Redux cannot manipulate navigation state.\n\nLeland's talk was also followed by a Q&A session. Overall, Airbnb is satisfied with React Native. They’re interested in using Code Push to fix any issues without going through the App Store, and their engineers love Live Reload, as they don't have to wait for the native app to be rebuilt after every minor change.\n\n## Closing Remarks\n\nThe event ended with some additional React Native news:\n\n* Deco announced their [React Native Showcase](https://www.decosoftware.com/showcase), and invited everyone to add their app to the list.\n* The recent [documentation overhaul](https://facebook.github.io/react-native/blog/2016/07/06/toward-better-documentation.html) got a shoutout!\n* Devin Abbott, one of the creators of Deco IDE, will be teaching an introductory [React Native course](https://www.decosoftware.com/course).\n\n![](/react-native/blog/img/rnmsf-august-2016-docs.jpg)\n\nMeetups provide a good opportunity to meet and learn from other developers in the community. I'm looking forward to attending more React Native meetups in the future. If you make it up to one of these, please look out for me and let me know how we can make React Native work better for you!\n"
  },
  {
    "path": "blog/2016-08-19-right-to-left-support-for-react-native-apps.md",
    "content": "---\ntitle: Right-to-Left Layout Support For React Native Apps\nauthor: Mengjue (Mandy) Wang\nauthorTitle: Software Engineer Intern at Facebook\nauthorURL: https://github.com/MengjueW\nauthorImage: https://avatars0.githubusercontent.com/u/13987140?v=3&s=128\ncategory: engineering\n---\nAfter launching an app to the app stores, internationalization is the next step to further your audience reach. Over 20 countries and numerous people around the world use Right-to-Left (RTL) languages. Thus, making your app support RTL for them is necessary.\n\nWe're glad to announce that React Native has been improved to support RTL layouts. This is now available in the [react-native](https://github.com/facebook/react-native) master branch today, and will be available in the next RC: [`v0.33.0-rc`](https://github.com/facebook/react-native/releases).\n\nThis involved changing [css-layout](https://github.com/facebook/css-layout), the core layout engine used by RN, and RN core implementation, as well as specific OSS JS components to support RTL.\n\nTo battle test the RTL support in production, the latest version of the **Facebook Ads Manager** app (the first cross-platform 100% RN app) is now available in Arabic and Hebrew with RTL layouts for both [iOS](https://itunes.apple.com/app/id964397083) and [Android](https://play.google.com/store/apps/details?id=com.facebook.adsmanager). Here is how it looks like in those RTL languages:\n\n<p align=\"center\">\n  <img src=\"/react-native/blog/img/rtl-ama-ios-arabic.png\" width=\"280\" style=\"margin:10px\">\n  <img src=\"/react-native/blog/img/rtl-ama-android-hebrew.png\" width=\"280\" style=\"margin:10px\">\n</p>\n\n## Overview Changes in RN for RTL support\n[css-layout](https://github.com/facebook/css-layout) already has a concept of `start` and `end` for the layout. In the Left-to-Right (LTR) layout, `start` means `left`, and `end` means `right`. But in RTL, `start` means `right`, and `end` means `left`. This means we can make RN depend on the `start` and `end` calculation to compute the correct layout, which includes `position`, `padding`, and `margin`.\n\nIn addition, [css-layout](https://github.com/facebook/css-layout) already makes each component's direction inherits from its parent. This means, we simply need to set the direction of the root component to RTL, and the entire app will flip.\n\nThe diagram below describes the changes at high level:\n\n![](/react-native/blog/img/rtl-rn-core-updates.png)\n\nThese include:\n\n* [css-layout RTL support for absolute positioning](https://github.com/facebook/css-layout/commit/46c842c71a1232c3c78c4215275d104a389a9a0f)\n* mapping `left` and `right` to `start` and `end` in RN core implementation for shadow nodes\n* and exposing a [bridged utility module](https://github.com/facebook/react-native/blob/f0fb228ec76ed49e6ed6d786d888e8113b8959a2/Libraries/Utilities/I18nManager.js) to help control the RTL layout\n\nWith this update, when you allow RTL layout for your app:\n\n* every component layout will flip horizontally\n* some gestures and animations will automatically have RTL layout, if you are using RTL-ready OSS components\n* minimal additional effort may be needed to make your app fully RTL-ready\n\n## Making an App RTL-ready\n\n1. To support RTL, you should first add the RTL language bundles to your app.\n   * See the general guides from [iOS](https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/LocalizingYourApp/LocalizingYourApp.html#//apple_ref/doc/uid/10000171i-CH5-SW1) and [Android](https://developer.android.com/training/basics/supporting-devices/languages.html).\n\n2. Allow RTL layout for your app by calling the `allowRTL()` function at the beginning of native code. We provided this utility to only apply to an RTL layout when your app is ready. Here is an example:\n\n   iOS:\n    ```objc\n    // in AppDelegate.m\n  \t[[RCTI18nUtil sharedInstance] allowRTL:YES];\n    ```\n\n   Android:\n    ```java\n    // in MainActivity.java\n  \tI18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();\n  \tsharedI18nUtilInstance.allowRTL(context, true);\n    ```\n\n3. For Android, you need add `android:supportsRtl=\"true\"` to the [`<application>`](https://developer.android.com/guide/topics/manifest/application-element.html) element in `AndroidManifest.xml` file.\n\nNow, when you recompile your app and change the device language to an RTL language (e.g. Arabic or Hebrew), your app layout should change to RTL automatically.\n\n## Writing RTL-ready Components\n\nIn general, most components are already RTL-ready, for example:\n\n* Left-to-Right Layout\n\n  <p align=\"left\">\n    <img src=\"/react-native/blog/img/rtl-demo-listitem-ltr.png\" width=\"300\">\n  </p>\n\n* Right-to-Left Layout\n\n  <p align=\"left\">\n    <img src=\"/react-native/blog/img/rtl-demo-listitem-rtl.png\" width=\"300\">\n  </p>\n\nHowever, there are several cases to be aware of, for which you will need the [`I18nManager`](https://github.com/facebook/react-native/blob/f0fb228ec76ed49e6ed6d786d888e8113b8959a2/Libraries/Utilities/I18nManager.js). In [`I18nManager`](https://github.com/facebook/react-native/blob/f0fb228ec76ed49e6ed6d786d888e8113b8959a2/Libraries/Utilities/I18nManager.js), there is a constant `isRTL` to tell if layout of app is RTL or not, so that you can make the necessary changes according to the layout.\n\n#### Icons with Directional Meaning\nIf your component has icons or images, they will be displayed the same way in LTR and RTL layout, because RN will not flip your source image. Therefore, you should flip them according to the layout style.\n\n* Left-to-Right Layout\n\n  <p align=\"left\">\n    <img src=\"/react-native/blog/img/rtl-demo-icon-ltr.png\" width=\"300\">\n  </p>\n\n* Right-to-Left Layout\n\n  <p align=\"left\">\n    <img src=\"/react-native/blog/img/rtl-demo-icon-rtl.png\" width=\"300\">\n  </p>\n\nHere are two ways to flip the icon according to the direction:\n\n* Adding a `transform` style to the image component:\n  ```js\n  <Image\n    source={...}\n    style={{transform: [{scaleX: I18nManager.isRTL ? -1 : 1}]}}\n  />\n  ```\n\n* Or, changing the image source according to the direction:\n  ```js\n  let imageSource = require('./back.png');\n  if (I18nManager.isRTL) {\n  \timageSource = require('./forward.png');\n  }\n  return (\n    <Image source={imageSource} />\n  );\n  ```\n\n#### Gestures and Animations\n\nIn iOS and Android development, when you change to RTL layout, the gestures and animations are the opposite of LTR layout. Currently, in RN, gestures and animations are not supported on RN core code level, but on components level. The good news is, some of these components already support RTL today, such as [`SwipeableRow`](https://github.com/facebook/react-native/blob/38a6eec0db85a5204e85a9a92b4dee2db9641671/Libraries/Experimental/SwipeableRow/SwipeableRow.js) and [`NavigationExperimental`](https://github.com/facebook/react-native/tree/master/Libraries/NavigationExperimental). However, other components with gestures will need to support RTL manually.\n\nA good example to illustrate gesture RTL support is [`SwipeableRow`](https://github.com/facebook/react-native/blob/38a6eec0db85a5204e85a9a92b4dee2db9641671/Libraries/Experimental/SwipeableRow/SwipeableRow.js).\n\n<p align=\"center\">\n  <img src=\"/react-native/blog/img/rtl-demo-swipe-ltr.png\" width=\"280\" style=\"margin:10px\">\n  <img src=\"/react-native/blog/img/rtl-demo-swipe-rtl.png\" width=\"280\" style=\"margin:10px\">\n</p>\n\n\n##### Gestures Example\n```js\n// SwipeableRow.js\n_isSwipingExcessivelyRightFromClosedPosition(gestureState: Object): boolean {\n  // ...\n  const gestureStateDx = IS_RTL ? -gestureState.dx : gestureState.dx;\n  return (\n    this._isSwipingRightFromClosed(gestureState) &&\n    gestureStateDx > RIGHT_SWIPE_THRESHOLD\n  );\n},\n```\n\n##### Animation Example\n```js\n// SwipeableRow.js\n_animateBounceBack(duration: number): void {\n  // ...\n  const swipeBounceBackDistance = IS_RTL ?\n    -RIGHT_SWIPE_BOUNCE_BACK_DISTANCE :\n    RIGHT_SWIPE_BOUNCE_BACK_DISTANCE;\n  this._animateTo(\n    -swipeBounceBackDistance,\n    duration,\n    this._animateToClosedPositionDuringBounce,\n  );\n},\n```\n\n\n## Maintaining Your RTL-ready App\n\nEven after the initial RTL-compatible app release, you will likely need to iterate on new features. To improve development efficiency, [`I18nManager`](https://github.com/facebook/react-native/blob/f0fb228ec76ed49e6ed6d786d888e8113b8959a2/Libraries/Utilities/I18nManager.js) provides the `forceRTL()` function for faster RTL testing without changing the test device language. You might want to provide a simple switch for this in your app. Here's an example from the RTL example in the RNTester:\n\n<p align=\"center\">\n  <img src=\"/react-native/blog/img/rtl-demo-forcertl.png\" width=\"300\">\n</p>\n\n```js\n<RNTesterBlock title={'Quickly Test RTL Layout'}>\n  <View style={styles.flexDirectionRow}>\n    <Text style={styles.switchRowTextView}>\n      forceRTL\n    </Text>\n    <View style={styles.switchRowSwitchView}>\n      <Switch\n        onValueChange={this._onDirectionChange}\n        style={styles.rightAlignStyle}\n        value={this.state.isRTL} />\n    </View>\n  </View>\n</RNTesterBlock>\n\n_onDirectionChange = () => {\n  I18nManager.forceRTL(!this.state.isRTL);\n  this.setState({isRTL: !this.state.isRTL});\n  Alert.alert('Reload this page',\n   'Please reload this page to change the UI direction! ' +\n   'All examples in this app will be affected. ' +\n   'Check them out to see what they look like in RTL layout.'\n  );\n};\n```\n\nWhen working on a new feature, you can easily toggle this button and reload the app to see RTL layout. The benefit is you won't need to change the language setting to test, however some text alignment won't change, as explained in the next section. Therefore, it's always a good idea to test your app in the RTL language before launching.\n\n## Limitations and Future Plan\n\nThe RTL support should cover most of the UX in your app; however, there are some limitations for now:\n\n* Text alignment behaviors differ in iOS and Android\n    * In iOS, the default text alignment depends on the active language bundle, they are consistently on one side. In Android, the default text alignment depends on the language of the text content, i.e. English will be left-aligned and Arabic will be right-aligned.\n    * In theory, this should be made consistent across platform, but some people may prefer one behavior to another when using an app. More user experience research may be needed to find out the best practice for text alignment.\n\n\n* There is no \"true\" left/right\n\n    As discussed before, we map the `left`/`right` styles from the JS side to `start`/`end`, all `left` in code for RTL layout becomes \"right\" on screen, and `right` in code becomes \"left\" on screen. This is convenient because you don't need to change your product code too much, but it means there is no way to specify \"true left\" or \"true right\" in the code. In the future, allowing a component to control its direction regardless of the language may be necessary.\n\n* Make RTL support for gestures and animations more developer friendly\n\n   Currently, there is still some programming effort required to make gestures and animations RTL compatible.\n   In the future, it would be ideal to find a way to make gestures and animations RTL support more developer friendly.\n\n## Try it Out!\nCheck out the [`RTLExample`](https://github.com/facebook/react-native/blob/master/RNTester/js/RTLExample.js) in the `RNTester` to understand more about RTL support, and let us know how it works for you!\n\nFinally, thank you for reading! We hope that the RTL support for React Native helps you grow your apps for international audience!\n"
  },
  {
    "path": "blog/2016-09-08-exponent-talks-unraveling-navigation.md",
    "content": "---\ntitle: Expo Talks: Adam on Unraveling Navigation\nauthor: Héctor Ramos\nauthorTitle: Developer Advocate at Facebook\nauthorURL: https://twitter.com/hectorramos\nauthorImage: https://s.gravatar.com/avatar/f2223874e66e884c99087e452501f2da?s=128\nauthorTwitter: hectorramos\nyoutubeVideoId: oeSjTxVkMhc\ncategory: videos\n---\n\n[Adam Miskiewicz](https://twitter.com/skevy) from [Expo](https://expo.io/) talks about mobile navigation and the [`ex-navigation`](https://github.com/exponent/ex-navigation) React Native library at Expo's office hours last week.\n"
  },
  {
    "path": "blog/2016-10-25-0.36-headless-js-the-keyboard-api-and-more.md",
    "content": "---\ntitle: 0.36: Headless JS, the Keyboard API, & more\nauthor: Héctor Ramos\nauthorTitle: Developer Advocate at Facebook\nauthorURL: https://twitter.com/hectorramos\nauthorImage: https://s.gravatar.com/avatar/f2223874e66e884c99087e452501f2da?s=128\nauthorTwitter: hectorramos\ncategory: announcements\n---\n\nToday we are releasing [React Native 0.36](https://github.com/facebook/react-native/releases/tag/v0.36.0). Read on to learn more about what's new.\n\n## Headless JS\n\nHeadless JS is a way to run tasks in JavaScript while your app is in the background. It can be used, for example, to sync fresh data, handle push notifications, or play music. It is only available on Android, for now.\n\nTo get started, define your async task in a dedicated file (e.g. `SomeTaskName.js`):\n\n```javascript\nmodule.exports = async (taskData) => {\n  // Perform your task here.\n}\n```\n\nNext, register your task in on `AppRegistry`:\n\n```javascript\nAppRegistry.registerHeadlessTask('SomeTaskName', () => require('SomeTaskName'));\n```\n\nUsing Headless JS does require some native Java code to be written in order to allow you to start up the service when needed. Take a look at our new [Headless JS docs](/react-native/docs/headless-js-android.html) to learn more!\n\n## The Keyboard API\n\nWorking with the on-screen keyboard is now easier with [`Keyboard`](/react-native/docs/keyboard.html). You can now listen for native keyboard events and react to them. For example, to dismiss the active keyboard, simply call `Keyboard.dismiss()`:\n\n```js\nimport { Keyboard } from 'react-native'\n\n// Hide that keyboard!\nKeyboard.dismiss()\n```\n\n## Animated Division\n\nCombining two animated values via addition, multiplication, and modulo are already supported by React Native. With version 0.36, combining two [animated values via division](/react-native/docs/animated.html#divide) is now possible. There are some cases where an animated value needs to invert another animated value for calculation. An example is inverting a scale (2x --> 0.5x):\n\n```\nconst a = Animated.Value(1);\nconst b = Animated.divide(1, a);\n\nAnimated.spring(a, {\n  toValue: 2,\n}).start();\n```\n\n`b` will then follow `a`'s spring animation and produce the value of `1 / a`.\n\nThe basic usage is like this:\n\n```\n<Animated.View style={{transform: [{scale: a}]}}>\n  <Animated.Image style={{transform: [{scale: b}]}} />\n<Animated.View>\n```\n\nIn this example, the inner image won't get stretched at all because the parent's scaling gets cancelled out. If you'd like to learn more, check out the [Animations guide](/react-native/docs/animations.html).\n\n## Dark Status Bars\n\nA new `barStyle` value has been added to `StatusBar`: `dark-content`. With this addition, you can now use [`barStyle`](/react-native/docs/statusbar.html#barstyle) on both iOS and Android. The behavior will now be the following:\n\n- `default`: Use the platform default (light on iOS, dark on Android).\n- `light-content`: Use a light status bar with black text and icons.\n- `dark-content`: Use a dark status bar with white text and icons.\n\n## ...and more\n\nThe above is just a sample of what has changed in 0.36. Check out the [release notes on GitHub](https://github.com/facebook/react-native/releases/tag/v0.36.0) to see the full list of new features, bug fixes, and breaking changes.\n\nYou can upgrade to 0.36 by running the following commands in a terminal:\n\n```bash\n$ npm install --save react-native@0.36\n$ react-native upgrade\n```\n"
  },
  {
    "path": "blog/2016-11-08-introducing-button-yarn-and-a-public-roadmap.md",
    "content": "---\ntitle: Introducing Button, Faster Installs with Yarn, and a Public Roadmap\nauthor: Héctor Ramos\nauthorTitle: Developer Advocate at Facebook\nauthorURL: https://twitter.com/hectorramos\nauthorImage: https://s.gravatar.com/avatar/f2223874e66e884c99087e452501f2da?s=128\nauthorTwitter: hectorramos\ncategory: announcements\n---\n\nWe have heard from many people that there is so much work happening with React Native, it can be tough to keep track of what's going on. To help communicate what work is in progress, we are now publishing a [roadmap for React Native](https://github.com/facebook/react-native/wiki/Roadmap). At a high level, this work can be broken down into three priorities:\n\n- **Core Libraries**. Adding more functionality to the most useful components and APIs.\n- **Stability**. Improve the underlying infrastructure to reduce bugs and improve code quality.\n- **Developer Experience**. Help React Native developers move faster\n\nIf you have suggestions for features that you think would be valuable on the roadmap, check out [Canny](https://react-native.canny.io/feature-requests), where you can suggest new features and discuss existing proposals.\n\n## What's new in React Native\n\n[Version 0.37 of React Native](https://github.com/facebook/react-native/releases/tag/v0.37.0), released today, introduces a new core component to make it really easy to add a touchable Button to any app. We're also introducing support for the new [Yarn](https://yarnpkg.com/) package manager, which should speed up the whole process of updating your app's dependencies.\n\n## Introducing Button\n\nToday we're introducing a basic `<Button />` component that looks great on every platform. This addresses one of the most common pieces of feedback we get: React Native is one of the only mobile development toolkits without a button ready to use out of the box.\n\n![Simple Button on Android, iOS](/react-native/blog/img/button-android-ios.png)\n\n```\n<Button\n  onPress={onPressMe}\n  title=\"Press Me\"\n  accessibilityLabel=\"Learn more about this Simple Button\"\n/>\n```\n\nExperienced React Native developers know how to make a button: use TouchableOpacity for the default look on iOS, TouchableNativeFeedback for the ripple effect on Android, then apply a few styles. Custom buttons aren't particularly hard to build or install, but we aim to make React Native radically easy to learn. With the addition of a basic button into core, newcomers will be able to develop something awesome in their first day, rather than spending that time formatting a Button and learning about Touchable nuances.\n\nButton is meant to work great and look native on every platform, so it won't support all the bells and whistles that custom buttons do. It is a great starting point, but is not meant to replace all your existing buttons. To learn more, check out the [new Button documentation](https://facebook.github.io/react-native/docs/button.html), complete with a runnable example!\n\n\n## Speed up `react-native init` using Yarn\n\nYou can now use [Yarn](https://yarnpkg.com/), the new package manager for JavaScript, to speed up `react-native init` significantly. To see the speedup please [install yarn](https://yarnpkg.com/en/docs/install) and upgrade your `react-native-cli` to 1.2.0:\n\n```\n$ npm install -g react-native-cli\n```\n\nYou should now see “Using yarn” when setting up new apps:\n\n![Using yarn](/react-native/blog/img/yarn-rncli.png)\n\nIn simple local testing `react-native init` finished in **about 1 minute on a good network** (vs around 3 minutes when using npm 3.10.8). Installing yarn is optional but highly recommended.\n\n## Thank you!\n\nWe'd like to thank everyone who contributed to this release. The full [release notes](https://github.com/facebook/react-native/releases/tag/v0.37.0) are now available on GitHub. With over two dozen bug fixes and new features, React Native just keeps getting better thanks to you.\n"
  },
  {
    "path": "blog/2016-12-05-easier-upgrades.md",
    "content": "---\ntitle: Easier Upgrades Thanks to Git\nauthor: Nicolas Cuillery\nauthorTitle: JavaScript consultant and trainer at Zenika\nauthorURL: https://twitter.com/ncuillery\nauthorImage: https://fr.gravatar.com/userimage/78328995/184460def705a160fd8edadc04f60eaf.jpg?size=128\nauthorTwitter: ncuillery\ncategory: announcements\n---\n\nUpgrading to new versions of React Native has been difficult. You might have seen something like this before:\n\n![](/react-native/blog/img/git-upgrade-conflict.png)\n\nNone of those options is ideal. By overwriting the file we lose our local changes. By not overwriting we don't get the latest updates.\n\nToday I am proud to introduce a new tool that helps solve this problem. The tool is called `react-native-git-upgrade` and uses Git behind the scenes to resolve conflicts automatically whenever possible.\n\n## Usage\n\n> **Requirement**: Git has to be available in the `PATH`. Your project doesn't have to be managed by Git.\n\nInstall `react-native-git-upgrade` globally:\n\n```shell\n$ npm install -g react-native-git-upgrade\n```\nor, using [Yarn](https://yarnpkg.com/):\n\n```shell\n$ yarn global add react-native-git-upgrade\n```\n\nThen, run it inside your project directory:\n\n```shell\n$ cd MyProject\n$ react-native-git-upgrade 0.38.0\n```\n\n> Note: Do **not** run 'npm install' to install a new version of `react-native`. The tool needs to be able to compare the old and new project template to work correctly. Simply run it inside your app folder as shown above, while still on the old version.\n\nExample output:\n\n![](/react-native/blog/img/git-upgrade-output.png)\n\nYou can also run `react-native-git-upgrade` with no arguments to upgrade to the latest version of React Native.\n\nWe try to preserve your changes in iOS and Android build files, so you don't need to run `react-native link` after an upgrade.\n\nWe have designed the implementation to be as little intrusive as possible. It is entirely based on a local Git repository created on-the-fly in a temporary directory. It won't interfere with your project repository (no matter what VCS you use: Git, SVN, Mercurial, ... or none). Your sources are restored in case of unexpected errors.\n\n## How does it work?\n\nThe key step is generating a Git patch. The patch contains all the changes made in the React Native templates between the version your app is using and the new version.\n\nTo obtain this patch, we need to generate an app from the templates embedded in the `react-native` package inside your `node_modules` directory (these are the same templates the `react-native init` commands uses). Then, after the native apps have been generated from the templates in both the current version and the new version, Git is able to produce a patch that is adapted to your project (i.e. containing your app name):\n\n```\n[...]\n\ndiff --git a/ios/MyAwesomeApp/Info.plist b/ios/MyAwesomeApp/Info.plist\nindex e98ebb0..2fb6a11 100644\n--- a/ios/MyAwesomeApp/Info.plist\n+++ b/ios/MyAwesomeApp/Info.plist\n@@ -45,7 +45,7 @@\n \t\t<dict>\n \t\t\t<key>localhost</key>\n \t\t\t<dict>\n-\t\t\t\t<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>\n+\t\t\t\t<key>NSExceptionAllowsInsecureHTTPLoads</key>\n \t\t\t\t<true/>\n \t\t\t</dict>\n \t\t</dict>\n[...]\n```\n\nAll we need now is to apply this patch to your source files. While the old `react-native upgrade` process would have prompted you for any small difference, Git is able to merge most of the changes automatically using its 3-way merge algorithm and eventually leave us with familiar conflict delimiters:\n\n```\n\t\t13B07F951A680F5B00A75B9A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n<<<<<<< ours\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/HockeySDK.embeddedframework\",\n\t\t\t\t\t\"$(PROJECT_DIR)/HockeySDK-iOS/HockeySDK.embeddedframework\",\n\t\t\t\t);\n=======\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n>>>>>>> theirs\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native/React/**\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**\",\n\t\t\t\t);\n```\n\nThese conflicts are generally easy to reason about. The delimiter **ours** stands for \"your team\" whereas **theirs** could be seen as \"the React Native team\".\n\n## Why introduce a new global package?\n\nReact Native comes with a global CLI (the [react-native-cli](https://www.npmjs.com/package/react-native-cli) package) which delegates commands to the local CLI embedded in the `node_modules/react-native/local-cli` directory.\n\nAs we mentioned above, the process has to be started from your current React Native version. If we had embedded the implementation in the local-cli, you wouldn't be able to enjoy this feature when using old versions of React Native. For example, you wouldn't be able to upgrade from 0.29.2 to 0.38.0 if this new upgrade code was only released in 0.38.0.\n\nUpgrading based on Git is a big improvement in developer experience and it is important to make it available to everyone. By using a separate package [react-native-git-upgrade](https://www.npmjs.com/package/react-native-git-upgrade) installed globally you can use this new code today no matter what version of React Native your project is using.\n\nOne more reason is the recent [Yeoman wipeout](https://twitter.com/martinkonicek/status/800730190141857793) by Martin Konicek. We didn't want to get these Yeoman dependencies back into the `react-native` package to be able to evaluate the old template in order to create the patch.\n\n## Try it out and provide feedback\n\nAs a conclusion, I would say, enjoy the feature and feel free [to suggest improvements, report issues](https://github.com/facebook/react-native/issues) and especially [send pull requests](https://github.com/facebook/react-native/pulls). Each environment is a bit different and each React Native project is different, and we need your feedback to make this work well for everyone.\n\n### Thank you!\n\nI would like to thank the awesome companies [Zenika](https://www.zenika.com) and [M6 Web](http://www.groupem6.fr/le-groupe_en/activites/diversifications/m6-web.html) without whom none of this would have been possible!\n"
  },
  {
    "path": "blog/2017-01-07-monthly-release-cadence.md",
    "content": "---\ntitle: A Monthly Release Cadence: Releasing December and January RC\nauthor: Eric Vicenti\nauthorTitle: Engineer at Facebook\nauthorURL: https://twitter.com/EricVicenti\nauthorImage: https://secure.gravatar.com/avatar/077ad5372b65567fe952a99f3b627048?s=128\nauthorTwitter: EricVicenti\ncategory: announcements\n---\n\nShortly after React Native was introduced, we started releasing every two weeks to help the community adopt new features, while keeping versions stable for production use. At Facebook we had to stabilize the codebase every two weeks for the release of our production iOS apps, so we decided to release the open source versions at the same pace. Now, many of the Facebook apps ship once per week, especially on Android. Because we ship from master weekly, we need to keep it quite stable. So the bi-weekly release cadence doesn't even benefit internal contributors anymore.\n\nWe frequently hear feedback from the community that the release rate is hard to keep up with. Tools like [Expo](https://expo.io/) had to skip every other release in order to manage the rapid change in version. So it seems clear that the bi-weekly releases did not serve the community well.\n\n### Now releasing monthly\n\nWe're happy to announce the new monthly release cadence, and the December 2016 release, `v0.40`, which has been stabilizing for all last month and is ready to adopt. (Just make sure to [update headers in your native modules on iOS](https://github.com/facebook/react-native/releases/tag/v0.40.0)).\n\nAlthough it may vary a few days to avoid weekends or handle unforeseen issues, you can now expect a given release to be available on the first day of the month, and released on the last.\n\n### Use the current month for the best support\n\nThe January release candidate is ready to try, and you can [see what's new here](https://github.com/facebook/react-native/releases/tag/v0.41.0-rc.0).\n\nTo see what changes are coming and provide better feedback to React Native contributors, always use the current month's release candidate when possible. By the time each version is released at the end of the month, the changes it contains will have been shipped in production Facebook apps for over two weeks.\n\nYou can easily upgrade your app with the new [react-native-git-upgrade](https://facebook.github.io/react-native/blog/2016/12/05/easier-upgrades.html) command:\n\n```\nnpm install -g react-native-git-upgrade\nreact-native-git-upgrade 0.41.0-rc.0\n```\n\nWe hope this simpler approach will make it easier for the community to keep track of changes in React Native, and to adopt new versions as quickly as possible!\n\n(Thanks go to [Martin Konicek](https://github.com/mkonicek) for coming up with this plan and [Mike Grabowski](https://github.com/grabbou) for making it happen)\n"
  },
  {
    "path": "blog/2017-02-14-using-native-driver-for-animated.md",
    "content": "---\ntitle: Using Native Driver for Animated\nauthor: Janic Duplessis\nauthorTitle: Software Engineer at App & Flow\nauthorURL: https://twitter.com/janicduplessis\nauthorImage: https://secure.gravatar.com/avatar/8d6b6c0f5b228b0a8566a69de448b9dd?s=128\nauthorTwitter: janicduplessis\ncategory: engineering\n---\n\nFor the past year, we've been working on improving performance of animations that use the Animated library. Animations are very important to create a beautiful user experience but can also be hard to do right. We want to make it easy for developers to create performant animations without having to worry about some of their code causing it to lag.\n\n## What is this?\n\nThe Animated API was designed with a very important constraint in mind, it is serializable. This means we can send everything about the animation to native before it has even started and allows native code to perform the animation on the UI thread without having to go through the bridge on every frame. It is very useful because once the animation has started, the JS thread can be blocked and the animation will still run smoothly. In practice this can happen a lot because user code runs on the JS thread and React renders can also lock JS for a long time.\n\n## A bit of history...\n\nThis project started about a year ago, when Expo built the li.st app on Android. [Krzysztof Magiera](https://twitter.com/kzzzf) was contracted to build the initial implementation on Android. It ended up working well and li.st was the first app to ship with native driven animations using Animated. A few months later, [Brandon Withrow](https://github.com/buba447) built the initial implementation on iOS. After that, [Ryan Gomba](https://twitter.com/ryangomba) and myself worked on adding missing features like support for `Animated.event` as well as squash bugs we found when using it in production apps. This was truly a community effort and I would like to thanks everyone that was involved as well as Expo for sponsoring a large part of the development. It is now used by `Touchable` components in React Native as well as for navigation animations in the newly released [React Navigation](https://github.com/react-community/react-navigation) library.\n\n## How does it work?\n\nFirst, let's check out how animations currently work using Animated with the JS driver. When using Animated, you declare a graph of nodes that represent the animations that you want to perform, and then use a driver to update an Animated value using a predefined curve. You may also update an Animated value by connecting it to an event of a `View` using `Animated.event`.\n\n![](/react-native/blog/img/animated-diagram.png)\n\nHere's a breakdown of the steps for an animation and where it happens:\n\n- JS: The animation driver uses `requestAnimationFrame` to execute on every frame and update the value it drives using the new value it calculates based on the animation curve.\n- JS: Intermediate values are calculated and passed to a props node that is attached to a `View`.\n- JS: The `View` is updated using `setNativeProps`.\n- JS to Native bridge.\n- Native: The `UIView` or `android.View` is updated.\n\nAs you can see, most of the work happens on the JS thread. If it is blocked the animation will skip frames. It also needs to go through the JS to Native bridge on every frame to update native views.\n\nWhat the native driver does is move all of these steps to native. Since Animated produces a graph of animated nodes, it can be serialized and sent to native only once when the animation starts, eliminating the need to callback into the JS thread; the native code can take care of updating the views directly on the UI thread on every frame.\n\nHere's an example of how we can serialize an animated value and an interpolation node (not the exact implementation, just an example).\n\nCreate the native value node, this is the value that will be animated:\n```\nNativeAnimatedModule.createNode({\n  id: 1,\n  type: 'value',\n  initialValue: 0,\n});\n```\n\nCreate the native interpolation node, this tells the native driver how to interpolate a value:\n```\nNativeAnimatedModule.createNode({\n  id: 2,\n  type: 'interpolation',\n  inputRange: [0, 10],\n  outputRange: [10, 0],\n  extrapolate: 'clamp',\n});\n```\n\nCreate the native props node, this tells the native driver which prop on the view it is attached to:\n```\nNativeAnimatedModule.createNode({\n  id: 3,\n  type: 'props',\n  properties: ['style.opacity'],\n});\n```\n\nConnect nodes together:\n```\nNativeAnimatedModule.connectNodes(1, 2);\nNativeAnimatedModule.connectNodes(2, 3);\n```\n\nConnect the props node to a view:\n```\nNativeAnimatedModule.connectToView(3, ReactNative.findNodeHandle(viewRef));\n```\n\nWith that, the native animated module has all the info it needs to update the native views directly without having to go to JS to calculate any value.\n\nAll there is left to do is actually start the animation by specifying what type of animation curve we want and what animated value to update. Timing animations can also be simplified by calculating every frame of the animation in advance in JS to make the native implementation smaller.\n```\nNativeAnimatedModule.startAnimation({\n  type: 'timing',\n  frames: [0, 0.1, 0.2, 0.4, 0.65, ...],\n  animatedValueId: 1,\n});\n```\n\nAnd now here's the breakdown of what happens when the animation runs:\n\n- Native: The native animation driver uses `CADisplayLink` or `android.view.Choreographer` to execute on every frame and update the value it drives using the new value it calculates based on the animation curve.\n- Native: Intermediate values are calculated and passed to a props node that is attached to a native view.\n- Native: The `UIView` or `android.View` is updated.\n\nAs you can see, no more JS thread and no more bridge which means faster animations! 🎉🎉\n\n## How do I use this in my app?\n\nFor normal animations the answer is simple, just add `useNativeDriver: true` to the animation config when starting it.\n\nBefore:\n```\nAnimated.timing(this.state.animatedValue, {\n  toValue: 1,\n  duration: 500,\n}).start();\n```\nAfter:\n```\nAnimated.timing(this.state.animatedValue, {\n  toValue: 1,\n  duration: 500,\n  useNativeDriver: true, // <-- Add this\n}).start();\n```\n\nAnimated values are only compatible with one driver so if you use native driver when starting an animation on a value, make sure every animation on that value also uses the native driver.\n\nIt also works with `Animated.event`, this is very useful if you have an animation that must follow the scroll position because without the native driver it will always run a frame behind of the gesture because of the async nature of React Native.\n\nBefore:\n```\n<ScrollView\n  scrollEventThrottle={16}\n  onScroll={Animated.event(\n    [{ nativeEvent: { contentOffset: { y: this.state.animatedValue } } }]\n  )}\n>\n  {content}\n</ScrollView>\n```\nAfter:\n```\n<Animated.ScrollView // <-- Use the Animated ScrollView wrapper\n  scrollEventThrottle={1} // <-- Use 1 here to make sure no events are ever missed\n  onScroll={Animated.event(\n    [{ nativeEvent: { contentOffset: { y: this.state.animatedValue } } }],\n    { useNativeDriver: true } // <-- Add this\n  )}\n>\n  {content}\n</Animated.ScrollView>\n```\n\n## Caveats\n\nNot everything you can do with Animated is currently supported in Native Animated. The main limitation is that you can only animate non-layout properties, things like `transform` and `opacity` will work but flexbox and position properties won't. Another one is with `Animated.event`, it will only work with direct events and not bubbling events. This means it does not work with `PanResponder` but does work with things like `ScrollView#onScroll`.\n\nNative Animated has also been part of React Native for quite a while but has never been documented because it was considered experimental. Because of that make sure you are using a recent version (0.40+) of React Native if you want to use this feature.\n\n## Resources\n\nFor more information about animated I recommend watching [this talk](https://www.youtube.com/watch?v=xtqUJVqpKNo) by [Christopher Chedeau](https://twitter.com/Vjeux).\n\nIf you want a deep dive into animations and how offloading them to native can improve user experience there is also [this talk](https://www.youtube.com/watch?v=qgSMjYWqBk4) by [Krzysztof Magiera](https://twitter.com/kzzzf).\n"
  },
  {
    "path": "blog/2017-03-13-better-list-views.md",
    "content": "---\ntitle: Better List Views in React Native\nauthor: Spencer Ahrens\nauthorTitle: Software Engineer at Facebook\nauthorURL: https://github.com/sahrens\nauthorImage: https://avatars1.githubusercontent.com/u/1509831\nauthorTwitter: sahrens2012\ncategory: engineering\n---\n\nMany of you have started playing with some of our new List components already after our [teaser announcement in the community group](https://www.facebook.com/groups/react.native.community/permalink/921378591331053), but we are officially announcing them today! No more `ListView`s or `DataSource`s, stale rows, ignored bugs, or excessive memory consumption - with the latest React Native March 2017 release candidate (`0.43-rc.1`) you can pick from the new suite of components what best fits your use-case, with great perf and feature sets out of the box:\n\n### [`<FlatList>`](https://facebook.github.io/react-native/releases/next/docs/flatlist.html) ###\n\nThis is the workhorse component for simple, performant lists. Provide an array of data and a `renderItem` function and you're good to go:\n\n```\n<FlatList\n  data={[{title: 'Title Text', key: 'item1'}, ...]}\n  renderItem={({item}) => <ListItem title={item.title} />}\n/>\n```\n\n### [`<SectionList>`](https://facebook.github.io/react-native/releases/next/docs/sectionlist.html) ###\n\nIf you want to render a set of data broken into logical sections, maybe with section headers (e.g. in an alphabetical address book), and potentially with heterogeneous data and rendering (such as a profile view with some buttons followed by a composer, then a photo grid, then a friend grid, and finally a list of stories), this is the way to go.\n\n```\n<SectionList\n  renderItem={({item}) => <ListItem title={item.title} />}\n  renderSectionHeader={({section}) => <H1 title={section.key} />}\n  sections={[ // homogeneous rendering between sections\n    {data: [...], key: ...},\n    {data: [...], key: ...},\n    {data: [...], key: ...},\n  ]}\n/>\n\n<SectionList\n  sections={[ // heterogeneous rendering between sections\n    {data: [...], key: ..., renderItem: ...},\n    {data: [...], key: ..., renderItem: ...},\n    {data: [...], key: ..., renderItem: ...},\n  ]}\n/>\n```\n\n### [`<VirtualizedList>`](https://facebook.github.io/react-native/releases/next/docs/virtualizedlist.html) ##\n\nThe implementation behind the scenes with a more flexible API. Especially handy if your data is not in a plain array (e.g. an immutable list).\n\n## Features ##\n\nLists are used in many contexts, so we packed the new components full of features to handle the majority of use cases out of the box:\n\n* Scroll loading (`onEndReached`).\n* Pull to refresh (`onRefresh` / `refreshing`).\n* [Configurable](https://github.com/facebook/react-native/blob/master/Libraries/CustomComponents/Lists/ViewabilityHelper.js) viewability (VPV) callbacks (`onViewableItemsChanged` / `viewabilityConfig`).\n* Horizontal mode (`horizontal`).\n* Intelligent item and section separators.\n* Multi-column support (`numColumns`)\n* `scrollToEnd`, `scrollToIndex`, and `scrollToItem`\n* Better Flow typing.\n\n### Some Caveats ###\n\n- The internal state of item subtrees is not preserved when content scrolls out of the render window. Make sure all your data is captured in the item data or external stores like Flux, Redux, or Relay.\n\n- These components are based on `PureComponent` which means that they will not re-render if `props` remains shallow-equal. Make sure that everything your `renderItem` function depends on directly is passed as a prop that is not `===` after updates, otherwise your UI may not update on changes. This includes the `data` prop and parent component state. For example:\n\n  ```javascript\n  <FlatList\n    data={this.state.data}\n    renderItem={({item}) => <MyItem\n      item={item}\n      onPress={() => this.setState((oldState) => ({\n        selected: { // New instance breaks `===`\n          ...oldState.selected, // copy old data\n          [item.key]: !oldState.selected[item.key], // toggle\n        }}))\n      }\n      selected={\n        !!this.state.selected[item.key] // renderItem depends on state\n      }\n    />}\n    selected={ // Can be any prop that doesn't collide with existing props\n      this.state.selected // A change to selected should re-render FlatList\n    }\n  />\n  ```\n\n- In order to constrain memory and enable smooth scrolling, content is rendered asynchronously offscreen. This means it's possible to scroll faster than the fill rate and momentarily see blank content. This is a tradeoff that can be adjusted to suit the needs of each application, and we are working on improving it behind the scenes.\n\n- By default, these new lists look for a `key` prop on each item and use that for the React key. Alternatively, you can provide a custom `keyExtractor` prop.\n\n## Performance ##\n\nBesides simplifying the API, the new list components also have significant performance enhancements, the main one being nearly constant memory usage for any number of rows. This is done by 'virtualizing' elements that are outside of the render window by completely unmounting them from the component hierarchy and reclaiming the JS memory from the react components, along with the native memory from the shadow tree and the UI views. This has a catch which is that internal component state will not be preserved, so **make sure you track any important state outside of the components themselves, e.g. in Relay or Redux or Flux store.**\n\nLimiting the render window also reduces the amount of work that needs to be done by React and the native platform, e.g from view traversals. Even if you are rendering the last of a million elements, with these new lists there is no need to iterate through all those elements in order to render. You can even jump to the middle with `scrollToIndex` without excessive rendering.\n\nWe've also made some improvements with scheduling which should help with application responsiveness. Items at the edge of the render window are rendered infrequently and at a lower priority after any active gestures or animations or other interactions have completed.\n\n## Advanced Usage ##\n\nUnlike `ListView`, all items in the render window are re-rendered any time any props change. Often this is fine because the windowing reduces the number of items to a constant number, but if your items are on the complex side, you should make sure to follow React best practices for performance and use `React.PureComponent` and/or `shouldComponentUpdate` as appropriate within your components to limit re-renders of the recursive subtree.\n\nIf you can calculate the height of your rows without rendering them, you can improve the user experience by providing the `getItemLayout` prop. This makes it much smoother to scroll to specific items with e.g. `scrollToIndex`, and will improve the scroll indicator UI because the height of the content can be determined without rendering it.\n\nIf you have an alternative data type, like an immutable list, `<VirtualizedList>` is the way to go. It takes a `getItem` prop that lets you return the item data for any given index and has looser flow typing.\n\nThere are also a bunch of parameters you can tweak if you have an unusual use case. For example, you can use `windowSize` to trade off memory usage vs. user experience, `maxToRenderPerBatch` to adjust fill rate vs. responsiveness, `onEndReachedThreshold` to control when scroll loading happens, and more.\n\n## Future Work ##\n\n* Migration of existing surfaces (ultimately deprecation of `ListView`).\n* More features as we see/hear the need (let us know!).\n* Sticky section header support.\n* More performance optimizations.\n* Support functional item components with state.\n"
  },
  {
    "path": "blog/2017-03-13-idx-the-existential-function.md",
    "content": "---\ntitle: idx: The Existential Function\nauthor: Timothy Yung\nauthorTitle: Engineering Manager at Facebook\nauthorURL: https://github.com/yungsters\nauthorImage: https://pbs.twimg.com/profile_images/1592444107/image.jpg\nauthorTwitter: yungsters\ncategory: engineering\n---\n\nAt Facebook, we often need to access deeply nested values in data structures fetched with GraphQL. On the way to accessing these deeply nested values, it is common for one or more intermediate fields to be nullable. These intermediate fields may be null for a variety of reasons, from failed privacy checks to the mere fact that null happens to be the most flexible way to represent non-fatal errors.\n\nUnfortunately, accessing these deeply nested values is currently tedious and verbose.\n\n```javascript\nprops.user &&\nprops.user.friends &&\nprops.user.friends[0] &&\nprops.user.friends[0].friends\n```\n\nThere is [an ECMAScript proposal to introduce the existential operator](https://github.com/claudepache/es-optional-chaining) which will make this much more convenient. But until a time when that proposal is finalized, we want a solution that improves our quality of life, maintains existing language semantics, and encourages type safety with Flow.\n\nWe came up with an existential _function_ we call `idx`.\n\n```javascript\nidx(props, _ => _.user.friends[0].friends)\n```\n\nThe invocation in this code snippet behaves similarly to the boolean expression in the code snippet above, except with significantly less repetition. The `idx` function takes exactly two arguments:\n\n- Any value, typically an object or array into which you want to access a nested value.\n- A function that receives the first argument and accesses a nested value on it.\n\nIn theory, the `idx` function will try-catch errors that are the result of accessing properties on null or undefined. If such an error is caught, it will return either null or undefined. (And you can see how this might be implemented in [idx.js](https://github.com/facebookincubator/idx/blob/master/packages/idx/src/idx.js).)\n\nIn practice, try-catching every nested property access is slow, and differentiating between specific kinds of TypeErrors is fragile. To deal with these shortcomings, we created a Babel plugin that transforms the above `idx` invocation into the following expression:\n\n```javascript\nprops.user == null ? props.user :\nprops.user.friends == null ? props.user.friends :\nprops.user.friends[0] == null ? props.user.friends[0] :\nprops.user.friends[0].friends\n```\n\nFinally, we added a custom Flow type declaration for `idx` that allows the traversal in the second argument to be properly type-checked while permitting nested access on nullable properties.\n\nThe function, Babel plugin, and Flow declaration are now [available on GitHub](https://github.com/facebookincubator/idx). They are used by installing the **idx** and **babel-plugin-idx** npm packages, and adding “idx” to the list of plugins in your `.babelrc` file.\n"
  },
  {
    "path": "blog/2017-03-13-introducing-create-react-native-app.md",
    "content": "---\ntitle: Introducing Create React Native App\nauthor: Adam Perry\nauthorTitle: Software Engineer at Expo\nauthorURL: https://github.com/dikaiosune\nauthorImage: https://avatars2.githubusercontent.com/u/6812281\nauthorTwitter: dika10sune\ncategory: engineering\nyoutubeVideoId: 9baaVjGdBqs\n---\n\nToday we’re announcing [Create React Native App](https://github.com/react-community/create-react-native-app): a new tool that makes it significantly easier to get started with a React Native project! It’s heavily inspired by the design of [Create React App](https://github.com/facebookincubator/create-react-app) and is the product of a collaboration between [Facebook](https://code.facebook.com) and [Expo](https://expo.io) (formerly Exponent).\n\nMany developers struggle with installing and configuring React Native’s current native build dependencies, especially for Android. With Create React Native App, there’s no need to use Xcode or Android Studio, and you can develop for your iOS device using Linux or Windows. This is accomplished using the Expo app, which loads and runs CRNA projects written in pure JavaScript without compiling any native code.\n\nTry creating a new project (replace with suitable yarn commands if you have it installed):\n\n```\n$ npm i -g create-react-native-app\n$ create-react-native-app my-project\n$ cd my-project\n$ npm start\n```\n\nThis will start the React Native packager and print a QR code. Open it in the [Expo app](https://expo.io) to load your JavaScript. Calls to `console.log` are forwarded to your terminal. You can make use of any standard React Native APIs as well as the [Expo SDK](https://docs.expo.io/versions/latest/sdk/index.html).\n\n## What about native code?\n\nMany React Native projects have Java or Objective-C/Swift dependencies that need to be compiled. The Expo app does include APIs for camera, video, contacts, and more, and bundles popular libraries like [Airbnb’s react-native-maps](https://docs.expo.io/versions/v14.0.0/sdk/map-view.html), or [Facebook authentication](https://docs.expo.io/versions/latest/sdk/facebook.html). However if you need a native code dependency that Expo doesn’t bundle then you’ll probably need to have your own build configuration for it. Just like Create React App, “ejecting” is supported by CRNA.\n\nYou can run `npm run eject` to get a project very similar to what `react-native init` would generate. At that point you’ll need Xcode and/or Android Studio just as you would if you started with `react-native init` , adding libraries with `react-native link` will work, and you’ll have full control over the native code compilation process.\n\n## Questions? Feedback?\n\nCreate React Native App is now stable enough for general use, which means we’re very eager to hear about your experience using it! You can find me [on Twitter](https://twitter.com/dika10sune) or open an issue on [the GitHub repository](https://github.com/react-community/create-react-native-app). Pull requests are very welcome!\n"
  },
  {
    "path": "blog/2017-06-21-react-native-monthly-1.md",
    "content": "---\ntitle: React Native Monthly #1\nauthor: Tomislav Tenodi\nauthorTitle: Product Manager at Shoutem\nauthorURL: https://github.com/tenodi\nauthorImage: https://pbs.twimg.com/profile_images/877237660225609729/bKFDwfAq.jpg\nauthorTwitter: TomislavTenodi\ncategory: engineering\n---\n\nAt [Shoutem](https://shoutem.github.io/), we've been fortunate enough to work with React Native from its very beginnings. We decided we wanted to be part of the amazing community from day one. Soon enough, we realized it's almost impossible to keep up with the pace the community was growing and improving. That's why we decided to organize a monthly meeting where all major React Native contributors can briefly present what their efforts and plans are.\n\n## Monthly meetings\n\nWe had our first session of the monthly meeting on June 14, 2017. The mission for React Native Monthly is simple and straightforward: **improve the React Native community**. Presenting teams' efforts eases collaboration between teams done offline.\n\n## Teams\n\nOn the first meeting, we had 8 teams join us:\n\n- [Airbnb](https://github.com/airbnb)\n- [Callstack](https://github.com/callstack-io)\n- [Expo](https://github.com/expo)\n- [Facebook](https://github.com/facebook)\n- [GeekyAnts](https://github.com/GeekyAnts)\n- [Microsoft](https://github.com/microsoft)\n- [Shoutem](https://github.com/shoutem)\n- [Wix](https://github.com/wix)\n\nWe hope to have more core contributors join the upcoming sessions!\n\n## Notes\n\nAs teams' plans might be of interest to a broader audience, we'll be sharing them here, on the React Native blog. So, here they are:\n\n### Airbnb\n\n- Plans to add some A11y (accessibility) APIs to `View` and the `AccessibilityInfo` native module.\n- Will be investigating adding some APIs to native modules on Android to allow for specifying threads for them to run on.\n- Have been investigating potential initialization performance improvements.\n- Have been investigating some more sophisticated bundling strategies to use on top of \"unbundle\".\n\n### Callstack\n\n- Looking into improving the release process by using [Detox](https://github.com/wix/detox) for E2E testing. Pull request should land soon.\n- Blob pull request they have been working on has been merged, subsequent pull requests coming up.\n- Increasing [Haul](https://github.com/callstack-io/haul) adoption across internal projects to see how it performs compared to [Metro](https://github.com/facebook/metro). Working on better multi-threaded performance with the Webpack team.\n- Internally, they have implemented a better infrastructure to manage open source projects. Plans to be getting more stuff out in upcoming weeks.\n- The React Native Europe conference is coming along, nothing interesting yet, but y'all invited!\n- Stepped back from [react-navigation](https://github.com/react-community/react-navigation) for a while to investigate alternatives (especially native navigations).\n\n### Expo\n\n- Working on making it possible to install npm modules in [Snack](https://snack.expo.io/), will be useful for libraries to add examples to documentation.\n- Working with [Krzysztof](https://github.com/kmagiera) and other people at [Software Mansion](https://github.com/softwaremansion) on a JSC update on Android and a gesture handling library.\n- [Adam Miskiewicz](https://github.com/skevy) is transitioning his focus towards [react-navigation](https://github.com/react-community/react-navigation).\n- [Create React Native App](https://github.com/react-community/create-react-native-app) is in the [Getting Started guide](https://facebook.github.io/react-native/docs/getting-started.html) in the docs. Expo wants to encourage library authors to explain clearly whether their lib works with CRNA or not, and if so, explain how to set it up.\n\n### Facebook\n\n- React Native's packager is now [Metro](https://github.com/facebook/metro), in an independent repo. The Metro Bundler team in London is excited to address the needs of the community, improve modularity for additional use-cases beyond React Native, and increase responsiveness on issues and PRs.\n- In the coming months, the React Native team will work on refining the APIs of primitive components. Expect improvements in layout quirks, accessibility, and flow typing.\n- The React Native team also plans on improving core modularity this year, by refactoring to fully support 3rd party platforms such as Windows and macOS.\n\n### GeekyAnts\n\n- The team is working on a UI/UX design app (codename: Builder) which directly works with `.js` files. Right now, it supports only React Native. It’s similar to Adobe XD and Sketch.\n- The team is working hard so that you can load up an existing React Native app in the editor, make changes (visually, as a designer) and save the changes directly to the JS file.\n- Folks are trying to bridge the gap between Designers and Developers and bring them on the same repo.\n- Also, [NativeBase](https://github.com/GeekyAnts/NativeBase) recently reached 5,000 GitHub stars.\n\n### Microsoft\n\n- [CodePush](https://github.com/Microsoft/code-push) has now been integrated into [Mobile Center](https://mobile.azure.com/). This is the first step in providing a much more integrated experience with distribution, analytics and other services. See their announcement [here](https://microsoft.github.io/code-push/articles/CodePushOnMobileCenter.html).\n- [VSCode](https://github.com/Microsoft/vscode) has a bug with debugging, they are working on fixing that right now and will have a new build.\n- Investigating [Detox](https://github.com/wix/detox) for Integration testing, looking at JSC Context to get variables alongside crash reports.\n\n### Shoutem\n\n- Making it easier to work on Shoutem apps with tools from the React Native community. You will be able to use all the React Native commands to run the apps created on [Shoutem](https://shoutem.github.io/).\n- Investigating profiling tools for React Native. They had a lot of problems setting it up and they will write some of the insights they discovered along the way.\n- Shoutem is working on making it easier to integrate React Native with existing native apps. They will document the concept that they developed internally in the company, in order to get the feedback from the community.\n\n### Wix\n\n- Working internally to adopt [Detox](https://github.com/wix/detox) to move significant parts of the Wix app to \"zero manual QA\". As a result, Detox is being used heavily in a production setting by dozens of developers and maturing rapidly.\n- Working to add support to the [Metro](https://github.com/facebook/metro) for overriding any file extension during the build. Instead of just \"ios\" and \"android\", it would support any custom extension like \"e2e\" or \"detox\". Plans to use this for E2E mocking. There's already a library out called [react-native-repackager](https://github.com/wix/react-native-repackager), now working on a PR.\n- Investigating automation of performance tests. This is a new repo called [DetoxInstruments](https://github.com/wix/DetoxInstruments). You can take a look, it's being developed open source.\n- Working with a contributor from KPN on Detox for Android and supporting real devices.\n- Thinking about \"Detox as a platform\" to allow building other tools that need to automate the simulator/device. An example is [Storybook](https://github.com/storybooks/react-native-storybook) for React Native or Ram's idea for integration testing.\n\n## Next session\n\nMeetings will be held every four weeks. The next session is scheduled for July 12, 2017. As we just started with this meeting, we'd like to know how do these notes benefit the React Native community. Feel free to ping me [on Twitter](https://twitter.com/TomislavTenodi) if you have any suggestion on what we should cover in the following sessions, or how we should improve the output of the meeting.\n"
  },
  {
    "path": "blog/2017-07-28-react-native-monthly-2.md",
    "content": "---\ntitle: React Native Monthly #2\nauthor: Tomislav Tenodi\nauthorTitle: Product Manager at Shoutem\nauthorURL: https://github.com/tenodi\nauthorImage: https://pbs.twimg.com/profile_images/877237660225609729/bKFDwfAq.jpg\nauthorTwitter: TomislavTenodi\ncategory: engineering\n---\n\nThe React Native monthly meeting continues! On this session, we were joined by [Infinite Red](https://infinite.red/), great minds behind [Chain React, the React Native Conference](https://infinite.red/ChainReactConf). As most of the people here were presenting talks at Chain React, we pushed the meeting to a week later. Talks from the conference have been [posted online](https://www.youtube.com/playlist?list=PLFHvL21g9bk3RxJ1Ut5nR_uTZFVOxu522) and I encourage you to check them out. So, let's see what our teams are up to.\n\n## Teams\n\nOn this second meeting, we had 9 teams join us:\n\n- [Airbnb](https://github.com/airbnb)\n- [Callstack](https://github.com/callstack-io)\n- [Expo](https://github.com/expo)\n- [Facebook](https://github.com/facebook)\n- [GeekyAnts](https://github.com/GeekyAnts)\n- [Infinite Red](https://github.com/infinitered)\n- [Microsoft](https://github.com/microsoft)\n- [Shoutem](https://github.com/shoutem)\n- [Wix](https://github.com/wix)\n\n## Notes\n\nHere are the notes from each team:\n\n### Airbnb\n\n- Check out the [Airbnb repository](https://github.com/airbnb) for React Native related projects.\n\n### Callstack\n\n- [Mike Grabowski](https://github.com/grabbou) has been managing React Native's monthly releases as always, including a few betas that were pushed out. In particular, working on getting a v0.43.5 build published to npm since it unblocks Windows users!\n- Slow but consistent work is happening on [Haul](https://github.com/callstack-io/haul). There is a pull request that adds HMR, and other improvements have shipped. Recently got a few industry leaders to adopt it. Possibly planning to start a full-time paid work in that area.\n- [Michał Pierzchała](https://twitter.com/thymikee) from the [Jest](https://github.com/facebook/jest) team has joined us at Callstack this month. He will help maintain [Haul](https://github.com/callstack-io/haul) and possibly work on [Metro Bundler](https://github.com/facebook/metro) and [Jest](https://github.com/facebook/jest).\n- [Satyajit Sahoo](https://twitter.com/satya164) is now with us, yay!\n- Got a bunch of cool stuff coming up from our OSS department. In particular, working on bringing Material Palette API to React Native. Planning to finally release our native iOS kit which is aimed to provide 1:1 look & feel of native components.\n\n### Expo\n\n- Recently launched [Native Directory](https://native.directory) to help with discoverability and evaluation of libraries in React Native ecosystem. The problem: lots of libraries, hard to test, need to manually apply heuristics and not immediately obvious which ones are just the best ones that you should use. It's also hard to know if something is compatible with CRNA/Expo. So Native Directory tries to solve these problems. Check it out and [add your library](https://github.com/react-community/native-directory) to it. The list of libraries is in [here](https://github.com/react-community/native-directory/blob/master/react-native-libraries.json). This is just our first pass of it, and we want this to be owned and run by the community, not just Expo folks. So please pitch in if you think this is valuable and want to make it better!\n- Added initial support for installing npm packages in [Snack](https://snack.expo.io/) with Expo SDK 19. Let us know if you run into any issues with it, we are still working through some bugs. Along with Native Directory, this should make it easy to test libraries that have only JS dependencies, or dependencies included in [Expo SDK](https://github.com/expo/expo-sdk). Try it out:\n  - [react-native-modal](https://snack.expo.io/ByBCD_2r-)\n  - [react-native-animatable](https://snack.expo.io/SJfJguhrW)\n  - [react-native-calendars](https://snack.expo.io/HkoXUdhr-)\n- [Released Expo SDK19](https://blog.expo.io/expo-sdk-v19-0-0-is-now-available-821a62b58d3d) with a bunch of improvements across the board, and we're now using the [updated Android JSC](https://github.com/SoftwareMansion/jsc-android-buildscripts).\n- Working on a guide in docs with [Alexander Kotliarskyi](https://github.com/frantic) with a list of tips on how to improve the user experience of your app. Please join in and add to the list or help write some of it!\n  - Issue: [#14979](https://github.com/facebook/react-native/issues/14979)\n  - Initial pull request: [#14993](https://github.com/facebook/react-native/pull/14993)\n- Continuing to work on: audio/video, camera, gestures (with Software Mansion, `react-native-gesture-handler`), GL camera integration and hoping to land some of these for the first time in SDK20 (August), and significant improvements to others by then as well. We're just getting started on building infrastructure into the Expo client for background work (geolocation, audio, handling notifications, etc.).\n- [Adam Miskiewicz](https://twitter.com/skevy) has made some nice progress on imitating the transitions from [UINavigationController](https://developer.apple.com/documentation/uikit/uinavigationcontroller) in [react-navigation](https://github.com/react-community/react-navigation). Check out an earlier version of it in [his tweet](https://twitter.com/skevy/status/884932473070735361) - release coming with it soon. Also check out `MaskedViewIOS` which he [upstreamed](https://github.com/facebook/react-native/commit/8ea6cea39a3db6171dd74838a6eea4631cf42bba). If you have the skills and desire to implement `MaskedView` for Android that would be awesome!\n\n### Facebook\n\n- Facebook is internally exploring being able to embed native [ComponentKit](http://componentkit.org/) and [Litho](https://fblitho.com/) components inside of React Native.\n- Contributions to React Native are very welcome! If you are wondering how you can contribute, the [\"How to Contribute\" guide](http://facebook.github.io/react-native/docs/contributing.html) describes our development process and lays out the steps to send your first pull request. There are other ways to contribute that do not require writing code, such as by triaging issues or updating the docs.\n  - At the time of writing, React Native has **635** [open issues](https://github.com/facebook/react-native/issues) and **249** [open pull requests](https://github.com/facebook/react-native/pulls). This is overwhelming for our maintainers, and when things get fixed internally, it is difficult to ensure the relevant tasks are updated.\n  - We are unsure what the best approach is to handle this while keeping the community satisfied. Some (but not all!) options include closing stale issues, giving significantly more people permissions to manage issues, and automatically closing issues that do not follow the issue template. We wrote a [\"What to Expect from Maintainers\"](https://facebook.github.io/react-native/docs/maintainers.html) guide to set expectations and avoid surprises. If you have ideas on how we can make this experience better for maintainers as well as ensuring people opening issues and pull requests feel heard and valued, please let us know!\n\n### GeekyAnts\n\n- We demoed the Designer Tool which works with React Native files on Chain React. Many attendees signed up for the waiting list.  \n- We are also looking at other cross-platform solutions like [Google Flutter](https://flutter.io/) (a major comparison coming along), [Kotlin Native](https://github.com/JetBrains/kotlin-native), and [Apache Weex](https://weex.incubator.apache.org/) to understand the architectural differences and what we can learn from them to improve the overall performance of React Native.\n- Switched to [react-navigation](https://github.com/react-community/react-navigation) for most of our apps, which has improved the overall performance.\n- Also, announced [NativeBase Market](https://market.nativebase.io/) - A marketplace for React Native components and apps (for and by the developers).\n\n### Infinite Red\n\n- We want to introduce the [Reactotron](https://github.com/infinitered/reactotron). Check out the [introductory video](https://www.youtube.com/watch?v=tPBRfxswDjA). We'll be adding more features very soon!\n- Organised Chain React Conference. It was awesome, thanks all for coming! [The videos are now online!](https://www.youtube.com/playlist?list=PLFHvL21g9bk3RxJ1Ut5nR_uTZFVOxu522)\n\n### Microsoft\n\n- [CodePush](https://github.com/Microsoft/code-push) has now been integrated into [Mobile Center](https://mobile.azure.com/). Existing users will have no change in their workflow.\n  - Some people have reported an issue with duplicate apps - they already had an app on Mobile Center. We are working on resolving them, but if you have two apps, let us know, and we can merge them for you.\n- Mobile Center now supports Push Notifications for CodePush. We also showed how a combination of Notifications and CodePush could be used for A/B testing apps - something unique to the ReactNative architecture.\n- [VSCode](https://github.com/Microsoft/vscode) has a known debugging issue with ReactNative - the next release of the extension in a couple of days will be fixing the issue.\n- Since there are many other teams also working on React Native inside Microsoft, we will work on getting better representation from all the groups for the next meeting.\n\n### Shoutem\n\n- Finished the process of making the React Native development easier on [Shoutem](https://shoutem.github.io/). You can use all the standard `react-native` commands when developing apps on Shoutem.\n- We did a lot of work trying to figure out how to best approach the profiling on React Native. A big chunk of [documentation](https://facebook.github.io/react-native/docs/performance.html) is outdated, and we'll do our best to create a pull request on the official docs or at least write some of our conclusions in a blog post.\n- Switching our navigation solution to [react-navigation](https://github.com/react-community/react-navigation), so we might have some feedback soon.\n- We released [a new HTML component](https://github.com/shoutem/ui/tree/develop/html) in our toolkit which transforms the raw HTML to the React Native components tree.\n\n### Wix\n\n- We started working on a pull request to [Metro Bundler](https://github.com/facebook/metro) with [react-native-repackager](https://github.com/wix/react-native-repackager) capabilities. We updated react-native-repackager to support RN 44 (which we use in production). We are using it for our mocking infrastructure for [detox](https://github.com/wix/detox).\n- We have been covering the Wix app in detox tests for the last three weeks. It's an amazing learning experience of how to reduce manual QA in an app of this scale (over 40 engineers). We have resolved several issues with detox as a result, a new version was just published. I am happy to report that we are living up to the \"zero flakiness policy\" and the tests are passing consistently so far.\n- Detox for Android is moving forward nicely. We are getting significant help from the community. We are expecting an initial version in about two weeks.\n- [DetoxInstruments](https://github.com/wix/detoxinstruments), our performance testing tool, is getting a little bigger than we originally intended. We are now planning to turn it into a standalone tool that will not be tightly coupled to detox. It will allow investigating the performance of iOS apps in general. It will also be integrated with detox so we can run automated tests on performance metrics.\n\n## Next session\n\nThe next session is scheduled for August 16, 2017. As this was only our second meeting, we'd like to know how do these notes benefit the React Native community. Feel free to ping me [on Twitter](https://twitter.com/TomislavTenodi) if you have any suggestion on how we should improve the output of the meeting.\n"
  },
  {
    "path": "blog/2017-08-07-react-native-performance-in-marketplace.md",
    "content": "---\ntitle: React Native Performance in Marketplace\nauthor: Aaron Chiu\nauthorTitle: Software Engineer at Facebook\nauthorURL: https://www.facebook.com/aaronechiu\nauthorImage: https://fb-s-d-a.akamaihd.net/h-ak-fbx/v/t1.0-9/185908_1738453495300_6268428_n.jpg?_nc_log=1&oh=b0d497607c0d2012e88fde70cf4c7c7e&oe=59ED387B&__gda__=1509259466_d31a1cfbe282168c51f63019db5db391\nauthorTwitter: AaaChiuuu\ncategory: engineering\n---\n\nReact Native is used in multiple places across multiple apps in the Facebook family including a top level tab in the main Facebook apps. Our focus for this post is a highly visible product, [Marketplace](https://newsroom.fb.com/news/2016/10/introducing-marketplace-buy-and-sell-with-your-local-community/). It is available in a dozen or so countries and enables users to discover products and services provided by other users.\n\nIn the first half of 2017, through the joint effort of the Relay Team, the Marketplace team, the Mobile JS Platform team, and the React Native team, we cut Marketplace Time to Interaction (TTI) in half for Android [Year Class 2010-11 devices](https://code.facebook.com/posts/307478339448736/year-class-a-classification-system-for-android/). Facebook has historically considered these devices as low-end Android devices, and they have the slowest TTIs on any platform or device type.\n\nA typical React Native startup looks something like this:\n\n[![](/react-native/blog/img/RNPerformanceStartup.png)](/react-native/blog/img/RNPerformanceStartup.png)\n\n> Disclaimer: ratios aren't representative and will vary depending on how React Native is configured and used.\n\nWe first initialize the React Native core (aka the “Bridge”) before running the product specific JavaScript which determines what native views React Native will render in the Native Processing Time.\n\n### A different approach\n\nOne of the earlier mistakes that we made was to let [Systrace and CTScan](https://code.facebook.com/posts/747457662026706/performance-instrumentation-for-android-apps/) drive our performance efforts. These tools helped us find a lot of low-hanging fruit in 2016, but we discovered that both Systrace and CTScan are **not representative of production scenarios** and cannot emulate what happens in the wild. Ratios of time spent in the breakdowns are often incorrect and, wildly off-base at times. At the extreme, some things that we expected to take a few milliseconds actually take hundreds or thousands of milliseconds. That said, CTScan is useful and we've found it catches a third of regressions before they hit production.\n\nOn Android, we attribute the shortcomings of these tools to the fact that 1) React Native is a multithreaded framework, 2) Marketplace is co-located with a multitude of complex views such as Newsfeed and other top-level tabs, and 3) computation times vary wildly. Thus, this half, we let production measurements and breakdowns drive almost all of our decision making and prioritization.\n\n### Down the path of production instrumentation\n\nInstrumenting production may sound simple on the surface, but it turned out to be quite a complex process. It took multiple iteration cycles of 2-3 weeks each; due to the latency of landing a commit in master, to pushing the app to the Play Store, to gathering sufficient production samples to have confidence in our work. Each iteration cycle involved discovering if our breakdowns were accurate, if they had the right level of granularity, and if they properly added up to the whole time span. We could not rely on alpha and beta releases because they are not representative of the general population. In essence, we very tediously built a very accurate production trace based on the aggregate of millions of samples.\n\nOne of the reasons we meticulously verified that every millisecond in breakdowns properly added up to their parent metrics was that we realized early on there were gaps in our instrumentation. It turned out that our initial breakdowns did not account for stalls caused by thread jumps. Thread jumps themselves aren't expensive, but thread jumps to busy threads already doing work are very expensive. We eventually reproduced these blockages locally by sprinkling `Thread.sleep()` calls at the right moments, and we managed to fix them by:\n\n1. removing our dependency on AsyncTask, \n2. undoing the forced initialization of ReactContext and NativeModules on the UI thread, and \n3. removing the dependency on measuring the ReactRootView at initialization time.\n\nTogether, removing these thread blockage issues reduced the startup time by over 25%.\n\nProduction metrics also challenged some of our prior assumptions. For example, we used to pre-load many JavaScript modules on the startup path under the assumption that co-locating modules in one bundle would reduce their initialization cost. However, the cost of pre-loading and co-locating these modules far outweighed the benefits. By re-configuring our inline require blacklists and removing JavaScript modules from the startup path, we were able to avoid loading unnecessary modules such as Relay Classic (when only [Relay Modern](https://facebook.github.io/relay/docs/new-in-relay-modern.html) was necessary). Today, our `RUN_JS_BUNDLE` breakdown is over 75% faster.\n\nWe also found wins by investigating product-specific native modules. For example, by lazily injecting a native module's dependencies, we reduced that native module's cost by 98%. By removing the contention of Marketplace startup with other products, we reduced startup by an equivalent interval.\n\nThe best part is that many of these improvements are broadly applicable to all screens built with React Native.\n\n## Conclusion\n\nPeople assume that React Native startup performance problems are caused by JavaScript being slow or exceedingly high network times. While speeding up things like JavaScript would bring down TTI by a non-trivial sum, each of these contribute a much smaller percentage of TTI than was previously believed.\n\nThe lesson so far has been to *measure, measure, measure!* Some wins come from moving run-time costs to build time, such as Relay Modern and [Lazy NativeModules](https://github.com/facebook/react-native/commit/797ca6c219b2a44f88f10c61d91e8cc21e2f306e). Other wins come from avoiding work by being smarter about parallelizing code or removing dead code. And some wins come from large architectural changes to React Native, such as cleaning up thread blockages. There is no grand solution to performance, and longer-term performance wins will come from incremental instrumentation and improvements. Do not let cognitive bias influence your decisions. Instead, carefully gather and interpret production data to guide future work.\n\n## Future plans\n\nIn the long term, we want Marketplace TTI to be comparable to similar products built with Native, and, in general, have React Native performance on par with native performance. Further more, although this half we drastically reduced the bridge startup cost by about 80%, we plan to bring the cost of the React Native bridge close to zero via projects like [Prepack](https://prepack.io/) and more build time processing.\n\n\n"
  },
  {
    "path": "blog/2017-08-30-react-native-monthly-3.md",
    "content": "---\ntitle: React Native Monthly #3\nauthor: Mike Grabowski\nauthorTitle: CTO at Callstack\nauthorURL: https://github.com/grabbou\nauthorImage: https://pbs.twimg.com/profile_images/836150188725121024/NkU0AcqW_400x400.jpg\nauthorTwitter: grabbou\ncategory: engineering\n---\n\nThe React Native monthly meeting continues! This month's meeting was a bit shorter as most of our teams were busy shipping. Next month, we are at [React Native EU](https://react-native.eu/) conference in Wroclaw, Poland. Make sure to grab a ticket and see you there in person! Meanwhile, let's see what our teams are up to.\n\n## Teams\n\nOn this third meeting, we had 5 teams join us:\n\n- [Callstack](https://github.com/callstack-io)\n- [Expo](https://github.com/expo)\n- [Facebook](https://github.com/facebook)\n- [Microsoft](https://github.com/microsoft)\n- [Shoutem](https://github.com/shoutem)\n\n## Notes\n\nHere are the notes from each team:\n\n### Callstack\n\n- Recently open sourced [`react-native-material-palette`](https://github.com/callstack-io/react-native-material-palette). It extracts prominent colors from images to help you create visually engaging apps. It's Android only at the moment, but we are looking into adding support for iOS in the future. \n- We have landed HMR support into [`haul`](https://github.com/callstack-io/haul) and a bunch of other, cool stuff! Check out latest releases.\n- React Native EU 2017 is coming! Next month is all about React Native and Poland! Make sure to grab last tickets available [here](https://react-native.eu/).\n\n### Expo\n\n- Released support for installing npm packages on [Snack](https://snack.expo.io). Usual Expo restrictions apply -- packages can't depend on custom native APIs that aren't already included in Expo. We are also working on supporting multiple files and uploading assets in Snack. [Satyajit](https://github.com/satya164) will talk about Snack at [React Native Europe](https://react-native.eu/).\n- Released SDK20 with camera, payments, secure storage, magnetometer, pause/resume fs downloads, and improved splash/loading screen.\n- Continuing to work with [Krzysztof](https://github.com/kmagiera) on [react-native-gesture-handler](https://github.com/kmagiera/react-native-gesture-handler). Please give it a try, rebuild some gesture that you have previously built using PanResponder or native gesture recognizers and let us know what issues you encounter.\n- Experimenting with JSC debugging protocol, working on a bunch of feature requests on [Canny](https://expo.canny.io/feature-requests).\n\n### Facebook\n\n- Last month we discussed management of the GitHub issue tracker and that we would try to make improvements to address the maintainability of the project.\n- Currently, the number of open issues is holding steady at around 600, and it seems like it may stay that way for a while. In the past month, we have closed 690 issues due to lack of activity (defined as no comments in the last 60 days). Out of those 690 issues, 58 were re-opened for a variety of reasons (a maintainer committed to providing a fix, or a contributor made a great case for keeping the issue open).\n- We plan to continue with the automated closing of stale issues for the foreseeable future. We’d like to be in a state where every impactful issue opened in the tracker is acted upon, but we’re not there yet. We need all the help we can from maintainers to triage issues and make sure we don't miss issues that introduce regressions or introduce breaking changes, especially those that affect newly created projects. People interested in helping out can use the Facebook GitHub Bot to triage issues and pull requests. The new [Maintainers Guide](https://facebook.github.io/react-native/docs/maintainers.html) contains more information on triage and use of the GitHub Bot. Please add yourself to the [issue task force](https://github.com/facebook/react-native/blob/master/bots/IssueCommands.txt) and encourage other active community members to do the same!\n\n### Microsoft\n\n- The new Skype app is built on top of React Native in order to facilitate sharing as much code between platforms as possible. The React Native-based Skype app is currently available in the iOS and Android app stores.\n- While building the Skype app on React Native, we send pull requests to React Native in order to address bugs and missing features that we come across. So far, we've gotten about [70 pull requests merged](https://github.com/facebook/react-native/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Arigdern%20).\n- React Native enabled us to power both the iOS and Android Skype apps from the same codebase. We also want to use that codebase to power the Skype web app. To help us achieve that goal, we built and open sourced a thin layer on top of React/React Native called [ReactXP](https://microsoft.github.io/reactxp/blog/2017/04/06/introducing-reactxp.html). ReactXP provides a set of cross platform components that get mapped to React Native when targeting iOS/Android and to react-dom when targeting the web. ReactXP's goals are similar to another open source library called React Native for Web. There's a brief description of how the approaches of these libraries differ in the [ReactXP FAQ](https://microsoft.github.io/reactxp/docs/faq.html).\n\n### Shoutem\n\n- We are continuing our efforts on improving and simplifying the developer experience when building apps using [Shoutem](https://shoutem.github.io/).\n- Started migrating all our apps to react-navigation, but we ended postponing this until a more stable version is released, or one of the native navigation solutions becomes stable.\n- Updating all our [extensions](https://github.com/shoutem/extensions) and most of our open source libraries ([animation](https://github.com/shoutem/animation), [theme](https://github.com/shoutem/theme), [ui](https://github.com/shoutem/ui)) to React Native 0.47.1.\n\n## Next session\n\nThe next session is scheduled for Wednesday 13, September 2017. As this was only our third meeting, we'd like to know how do these notes benefit the React Native community. Feel free to ping me [on Twitter](https://twitter.com/grabbou) if you have any suggestion on how we should improve the output of the meeting.\n"
  },
  {
    "path": "blog/2017-09-21-react-native-monthly-4.md",
    "content": "---\ntitle: React Native Monthly #4\nauthor: Mike Grabowski\nauthorTitle: CTO at Callstack\nauthorURL: https://github.com/grabbou\nauthorImage: https://pbs.twimg.com/profile_images/836150188725121024/NkU0AcqW_400x400.jpg\nauthorTwitter: grabbou\ncategory: engineering\n---\n\nThe React Native monthly meeting continues! Here are the notes from each team:\n\n### Callstack\n\n- [React Native EU](https://react-native.eu) is over. More than 300 participants from 33 countries have visited Wroclaw. Talks can be found [on Youtube](https://www.youtube.com/channel/UCUNE_g1mQPuyW975WjgjYxA/videos).\n- We are slowly getting back to our open source schedule after the conference. One thing worth mentioning is that we are working on a next release of [react-native-opentok](https://github.com/callstack/react-native-opentok) that fixes most of the existing issues.\n\n### GeekyAnts\n\nTrying to lower the entry barrier for the developers embracing React Native with the following things:\n\n- Announced [BuilderX.io](https://builderx.io/) at [React Native EU](https://react-native.eu). BuilderX is a design tool that directly works with JavaScript files (only React Native is supported at the moment) to generate beautiful, readable, and editable code.\n- Launched [ReactNativeSeed.com](https://reactnativeseed.com/) which provides a set of boilerplates for your next React Native project. It comes with a variety of options that include TypeScript & Flow for data-types, MobX, Redux, and mobx-state-tree for state-management with CRNA and plain React-Native as the stack.\n\n### Expo\n\n- Will release SDK 21 shortly, which adds support for react-native 0.48.3 and a bunch of bugfixes/reliability improvements/new features in the Expo SDK, including video recording, a new splash screen API, support for `react-native-gesture-handler`, and improved error handling.\n- Re: [react-native-gesture-handler](https://github.com/kmagiera/react-native-gesture-handler), [Krzysztof Magiera](https://github.com/kmagiera) of [Software Mansion](https://swmansion.com/) continues pushing this forward and we've been helping him with testing it and funding part of his development time. Having this integrated in Expo in SDK21 will allow people to play with it easily in Snack, so we're excited to see what people come up with.\n- Re: improved error logging / handling - see [this gist of an internal Expo PR](https://gist.github.com/brentvatne/00407710a854627aa021fdf90490b958) for details on logging, (in particular, \"Problem 2\"), and [this commit](https://github.com/expo/xdl/commit/1d62eca293dfb867fc0afc920c3dad94b7209987) for a change that handles failed attempts to import npm standard library modules. There is plenty of opportunity to improve error messages upstream in React Native in this way and we will work on follow up upstream PRs. It would be great for the community to get involved too.\n- [native.directory](https://native.directory/) continues to grow, you can add your projects from [the Github repo](https://github.com/react-community/native-directory).\n- Visit hackathons around North America, including [PennApps](https://pennapps.com/), [Hack The North](http://hackthenorth.com/), [HackMIT](https://hackmit.org/), and soon [MHacks](https://mhacks.org/).\n\n### Facebook\n\n- Working on improving `<Text>` and `<TextInput>` components on Android. (Native auto-growing for `<TextInput>`; deeply nested `<Text>` components layout issues; better code structure; performance optimizations).\n- We're still looking for additional contributors who would like to help [triage issues and pull requests](https://facebook.github.io/react-native/docs/maintainers.html#facebook-github-bot).\n\n### Microsoft\n\n- Released Code Signing feature for CodePush. React Native developers are now able to sign their application bundles in CodePush. The announcement can be found [here](https://microsoft.github.io/code-push/articles/CodeSigningAnnouncement.html)\n- Working on completing integration of CodePush to Mobile Center. Considering test/crash integration as well. \n\n## Next session\n\nThe next session is scheduled for Wednesday 10, October 2017. As this was only our fourth meeting, we'd like to know how do these notes benefit the React Native community. Feel free to ping me [on Twitter](https://twitter.com/grabbou) if you have any suggestion on how we should improve the output of the meeting.\n"
  },
  {
    "path": "blog/2017-11-06-react-native-monthly-5.md",
    "content": "---\ntitle: React Native Monthly #5\nauthor: Tomislav Tenodi\nauthorTitle: Founder at Speck\nauthorURL: https://github.com/tenodi\nauthorImage: https://pbs.twimg.com/profile_images/877237660225609729/bKFDwfAq.jpg\nauthorTwitter: TomislavTenodi\ncategory: engineering\n---\n\nThe React Native monthly meeting continues! Let's see what our teams are up to.\n\n### Callstack\n\n- We’ve been working on React Native CI. Most importantly, we have migrated from Travis to Circle, leaving React Native with a single, unified CI pipeline.\n- We’ve organised [Hacktoberfest - React Native edition](https://blog.callstack.io/announcing-hacktoberfest-7313ea5ccf4f) where, together with attendees, we tried to submit many pull requests to open source projects.\n- We keep working on [Haul](https://github.com/callstack/haul). Last month, we have submitted two new releases, including Webpack 3 support. We plan to add [CRNA](https://github.com/react-community/create-react-native-app) and [Expo](https://github.com/expo/expo) support as well as work on better HMR. Our roadmap is public on the issue tracker. If you would like to suggest improvements or give feedback, let us know!\n\n### Expo\n\n- Released [Expo SDK 22](https://blog.expo.io/expo-sdk-v22-0-0-is-now-available-7745bfe97fc6) (using React Native 0.49) and updated [CRNA](https://github.com/react-community/create-react-native-app) for it.\n  - Includes improved splash screen API, basic ARKit support, “DeviceMotion” API, SFAuthenticationSession support on iOS11, and [more](https://blog.expo.io/expo-sdk-v22-0-0-is-now-available-7745bfe97fc6).\n- Your [snacks](https://snack.expo.io) can now have multiple JavaScript files and you can upload images and other assets by just dragging them into the editor.\n- Contribute to [react-navigation](https://github.com/react-community/react-navigation) to add support for iPhone X.\n- Focus our attention on rough edges when building large applications with Expo. For example:\n  - First-class support for deploying to multiple environments: staging, production, and arbitrary channels. Channels will support rolling back and setting the active release for a given channel. Let us know if you want to be an early tester, [@expo_io](https://twitter.com/expo_io).\n  - We are also working on improving our standalone app building infrastructure and adding support for bundling images and other non-code assets in standalone app builds while keeping the ability to update assets over the air.\n\n### Facebook\n\n- Better RTL support:\n  - We’re introducing a number of direction-aware styles.\n    - Position:\n      - (left|right) → (start|end)\n    - Margin:\n      - margin(Left|Right) → margin(Start|End)\n    - Padding:\n      - padding(Left|Right) → padding(Start|End)\n    - Border:\n      - borderTop(Left|Right)Radius → borderTop(Start|End)Radius\n      - borderBottom(Left|Right)Radius → borderBottom(Start|End)Radius\n      - border(Left|Right)Width → border(Start|End)Width\n      - border(Left|Right)Color → border(Start|End)Color\n  - The meaning of “left” and “right” were swapped in RTL for position, margin, padding, and border styles. Within a few months, we’re going to remove this behaviour and make “left” always mean “left,” and “right” always mean “right”. The breaking changes are hidden under a flag. Use `I18nManager.swapLeftAndRightInRTL(false)` in your React Native components to opt into them. \n- Working on [Flow](https://github.com/facebook/flow) typing our internal native modules and using those to generate interfaces in Java and protocols in ObjC that the native implementations must implement. We hope this codegen becomes open source next year, at the earliest.\n\n\n### Infinite Red\n\n- New OSS tool for helping React Native and other projects. More [here](https://shift.infinite.red/solidarity-the-cli-for-developer-sanity-672fa81b98e9).\n- Revamping [Ignite](https://github.com/infinitered/ignite) for a new boilerplate release (Code name: Bowser)\n\n### Shoutem\n\n- Improving the development flow on Shoutem. We want to streamline the process from creating an app to first custom screen and make it really easy, thus lowering the barrier for new React Native developers. Prepared a few workshops to test out new features. We also improved [Shoutem CLI](https://github.com/shoutem/cli) to support new flows.\n- [Shoutem UI](https://github.com/shoutem/ui) received a few component improvements and bugfixes. We also checked compatibility with latest React Native versions.\n- Shoutem platform received a few notable updates, new integrations are available as part of the [open-source extensions project](https://github.com/shoutem/extensions). We are really excited to see active development on Shoutem extensions from other developers. We actively contact and offer advice and guidance about their extensions.\n\n## Next session\n\nThe next session is scheduled for Wednesday 6, December 2017. Feel free to ping me [on Twitter](https://twitter.com/TomislavTenodi) if you have any suggestion on how we should improve the output of the meeting.\n"
  },
  {
    "path": "bots/IssueCommands.txt",
    "content": "React Native GitHub Issue Task Force: AndrewJack, astreet, bestander, brentvatne, browniefed, cancan101, charpeni, chirag04, christopherdro, corbt, cosmith, damusnet, DanielMSchmidt, davidaurelio, dmmiller, dsibiski, foghina, frantic, gantman, geirman, grabbou, gre, ide, janicduplessis, javache, jaygarcia, jsierles, kmagiera, knowbody, kmagiera, Kureev, lelandrichardson, lwinkyawmyat, martinbigio, melihmucuk, mkonicek, ncuillery, radko93, react-native-bot, rigdern, rmevans9, rt2zz, ryankask, satya164, skevy, tabrindle, timwangdev, vjeux\n\n@facebook-github-bot answered\ncomment Closing this issue as {author} says the question asked has been answered.\nclose\n\n@facebook-github-bot duplicate (#[0-9]+)\ncomment Duplicate of {match0}\nclose\n\n@facebook-github-bot expected\ncomment The comment above tells me this is expected behavior. If you'd like to change how this feature works, please submit a feature request on [Canny](https://react-native.canny.io/feature-requests) so that other people can vote on it.<br/><br/><sub>[How to Contribute](https://facebook.github.io/react-native/docs/contributing.html#bugs) • [What to Expect from Maintainers](https://facebook.github.io/react-native/docs/maintainers.html#handling-issues)</sub>\nclose\n\n@facebook-github-bot stack-overflow\ncomment Hey {issue_author}, thanks for posting this! {author} tells me this issue looks like a question that would be best asked on [Stack Overflow](https://stackoverflow.com/questions/tagged/react-native). Stack Overflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.<br/><br/><sub>[How to Contribute](https://facebook.github.io/react-native/docs/contributing.html#bugs) • [What to Expect from Maintainers](https://facebook.github.io/react-native/docs/maintainers.html#handling-issues)</sub>\nadd-label For Stack Overflow\nclose\n\n@facebook-github-bot label (.*)\nadd-label {match0}\n\n@facebook-github-bot no-reply\ncomment Closing this issue as more information is needed to debug this and we haven't heard back from the author.\nadd-label Needs Response from Author\nclose\n\n@facebook-github-bot no-template\ncomment Hey {issue_author}, thanks for posting this! It looks like your issue is missing some required information. Can you please add all the details specified in the [Issue Template](https://raw.githubusercontent.com/facebook/react-native/master/.github/ISSUE_TEMPLATE.md)? This is necessary for people to be able to understand and reproduce your issue. I am going to close this, but please feel free to open a new issue with the additional information provided. Thanks!<br/><br/><sub>[How to Contribute](https://facebook.github.io/react-native/docs/contributing.html#bugs) • [What to Expect from Maintainers](https://facebook.github.io/react-native/docs/maintainers.html#handling-issues)</sub>\nadd-label Needs more information\nclose\n\n@facebook-github-bot close\ncomment {author} has closed this issue.\nclose\n\n@facebook-github-bot large-pr\ncomment Thank you for your contribution. Unfortunately, this pull request seems relatively large.<br/><br/>In order to reduce the load on maintainers, it would be valuable if you could [split this into small, targeted PRs that changed one thing at a time](https://graysonkoonce.com/stacked-pull-requests-keeping-github-diffs-small/).<br/><br/>If doing this requires more than a few pull requests, please open (or update) an issue specifying your goal and the different steps you will take in your PRs. This will ensure maintainers have context on the relationship between the PRs.<br/><br/>If this is a codemod or other formatting change that is simple but inherently touches many files, please comment on this and let us know and we will reopen the PR.\nadd-label Large PR\nclose\n\n@facebook-github-bot bugfix\ncomment Hey {issue_author}, if you're sure this is a bug, can you send a pull request with a fix?<br/><br/><sub>[How to Contribute](https://facebook.github.io/react-native/docs/contributing.html#bugs) • [What to Expect from Maintainers](https://facebook.github.io/react-native/docs/maintainers.html#handling-issues)</sub>\nadd-label Help Wanted\n\n@facebook-github-bot needs-repro\ncomment Can you reproduce the issue using [Snack](https://snack.expo.io)? This step is necessary for people to be able to see and debug the issue being reported.<br/><br/><sub>[How to Contribute](https://facebook.github.io/react-native/docs/contributing.html#bugs) • [What to Expect from Maintainers](https://facebook.github.io/react-native/docs/maintainers.html#handling-issues)</sub>\nadd-label Needs more information\n\n@facebook-github-bot cannot-repro\ncomment Thanks for opening the issue! It does not appear like a community member will be able to reliably reproduce this issue. This may be for several reasons; perhaps it affects a particular app but a minimal repro has not been provided, or the issue may be sporadic. As it happens, we need a concrete set of steps that can demonstrably reproduce the issue as this will allow your fellow community members to validate a fix. We'll close the issue for now, but feel free to submit a new issue once you're able to reliably reproduce the issue locally. Thanks for your understanding!<br/><br/><sub>[How to Contribute](https://facebook.github.io/react-native/docs/contributing.html#bugs) • [What to Expect from Maintainers](https://facebook.github.io/react-native/docs/maintainers.html#handling-issues)</sub>\nclose\n\n@facebook-github-bot reopen\ncomment Okay, reopening this issue.\nreopen\n\n@facebook-github-bot feature\ncomment Hey {issue_author}! Thanks for opening the issue, however it looks like a feature request. As noted in the [Issue template](https://raw.githubusercontent.com/facebook/react-native/master/.github/ISSUE_TEMPLATE.md) we'd like to use the GitHub issues to track bugs only. Can you implement the feature as a standalone npm module? If not, consider sending a pull request or a creating an entry on [Canny](https://react-native.canny.io/feature-requests/). It has a voting system and if the feature gets upvoted enough it might get implemented. Closing this now, thanks for understanding!<br/><br/><sub>[How to Contribute](https://facebook.github.io/react-native/docs/contributing.html#bugs) • [What to Expect from Maintainers](https://facebook.github.io/react-native/docs/maintainers.html#handling-issues)</sub>\nadd-label Feature Request\nclose\n\n@facebook-github-bot cla\ncomment Hey {issue_author}! Thanks for sending this pull request! We would love to review your changes however it looks like you haven't signed the CLA yet. You can do so at https://code.facebook.com/cla. See [\"How to Contribute\"](https://facebook.github.io/react-native/docs/contributing.html#pull-requests) to learn more.\nadd-label Needs Response from Author\n\n@facebook-github-bot icebox\ncomment {author} tells me to close this issue because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!<br/><br/>If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened: <ul><li>Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.</li><li>If so, is there any information missing from the bug report? Post a comment with all the information required by the [issue template](https://github.com/facebook/react-native/blob/master/.github/ISSUE_TEMPLATE.md).</li><li>Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.</li></ul>If you would like to work on a patch to fix the issue, *contributions are very welcome*! Read through the [contribution guide](https://facebook.github.io/react-native/docs/contributing.html), and feel free to hop into [#react-native](https://discordapp.com/invite/0ZcbPKXt5bZjGY5n) if you need help planning your contribution.<br/><br/><sub>[How to Contribute](https://facebook.github.io/react-native/docs/contributing.html#bugs) • [What to Expect from Maintainers](https://facebook.github.io/react-native/docs/maintainers.html#handling-issues)</sub>\nadd-label Icebox\nclose\n"
  },
  {
    "path": "bots/NewIssueGreeting.md",
    "content": "Hey {author}, thanks for reporting this issue!\n\nReact Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.\n\n- If you **don't know how to do something** or **something is not working as you expect but not sure it's a bug**, please ask on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) with the tag `react-native` or for more real time interactions, ask on [Discord](https://discord.gg/0ZcbPKXt5bZjGY5n) in the #react-native channel.\n\n- If this is a **feature request or a bug** that you would like to be fixed, please report it on [Canny](https://react-native.canny.io/feature-requests). It has a ranking feature that lets us focus on the most important issues the community is experiencing.\n\n- We welcome clear issues and PRs that are ready for in-depth discussion. Please provide **screenshots** where appropriate and always mention the **version** of React Native you're using. Thank you for your contributions!\n"
  },
  {
    "path": "bots/QuestionGreeting.md",
    "content": "*By analyzing the title and description for some common words it looks like this issue might be a question. I'm just a bot and might be wrong. In that case please cc mkonicek, he would like to know about it :)*\n\nPlease consider using [Stack Overflow](https://stackoverflow.com/questions/tagged/react-native) for questions. It's the best system for Q&A and the best way to get questions answered.\n\nMany people from the community hang out on Stack Overflow and will be able to see your question and be more likely to answer because of the reputation system. If after reading this you think your question is better suited for Stack Overflow, please consider closing this issue.\n"
  },
  {
    "path": "bots/code-analysis-bot.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nif (!process.env.CI_USER) {\n  console.error('Missing CI_USER. Example: facebook');\n  process.exit(1);\n}\nif (!process.env.CI_REPO) {\n  console.error('Missing CI_REPO. Example: react-native');\n  process.exit(1);\n}\nif (!process.env.GITHUB_TOKEN) {\n  console.error('Missing GITHUB_TOKEN. Example: 5fd88b964fa214c4be2b144dc5af5d486a2f8c1e');\n  process.exit(1);\n}\nif (!process.env.PULL_REQUEST_NUMBER) {\n  console.error('Missing PULL_REQUEST_NUMBER. Example: 4687');\n  // for master branch don't throw and error\n  process.exit(0);\n}\n\nvar GitHubApi = require('github');\nvar path = require('path');\n\nvar github = new GitHubApi({\n  version: '3.0.0',\n});\n\ngithub.authenticate({\n  type: 'oauth',\n  token: process.env.GITHUB_TOKEN,\n});\n\nfunction push(arr, key, value) {\n  if (!arr[key]) {\n    arr[key] = [];\n  }\n  arr[key].push(value);\n}\n\n/**\n * There is unfortunately no standard format to report an error, so we have\n * to write a specific converter for each tool we want to support.\n *\n * Those functions take a json object as input and fill the output with the\n * following format:\n *\n * { [ path: string ]: Array< { message: string, line: number }> }\n *\n * This is an object where the keys are the path of the files and values\n * is an array of objects of the shape message and line.\n */\nvar converters = {\n  raw: function(output, input) {\n    for (var key in input) {\n      input[key].forEach(function(message) {\n        push(output, key, message);\n      });\n    }\n  },\n\n  flow: function(output, input) {\n    if (!input || !input.errors) {\n      return;\n    }\n\n    input.errors.forEach(function(error) {\n      push(output, error.message[0].path, {\n        message: error.message.map(message => message.descr).join(' '),\n        line: error.message[0].line,\n      });\n    });\n  },\n\n  eslint: function(output, input) {\n    if (!input) {\n      return;\n    }\n\n    input.forEach(function(file) {\n      file.messages.forEach(function(message) {\n        push(output, file.filePath, {\n          message: message.ruleId + ': ' + message.message,\n          line: message.line,\n        });\n      });\n    });\n  }\n};\n\nfunction getShaFromPullRequest(user, repo, number, callback) {\n  github.pullRequests.get({user, repo, number}, (error, res) => {\n    if (error) {\n      console.log(error);\n      return;\n    }\n    callback(res.head.sha);\n  });\n}\n\nfunction getFilesFromCommit(user, repo, sha, callback) {\n  github.repos.getCommit({user, repo, sha}, (error, res) => {\n    if (error) {\n      console.log(error);\n      return;\n    }\n    // A merge commit should not have any new changes to report\n    if (res.parents && res.parents.length > 1) {\n      return;\n    }\n\n    callback(res.files);\n  });\n}\n\n\n/**\n * Sadly we can't just give the line number to github, we have to give the\n * line number relative to the patch file which is super annoying. This\n * little function builds a map of line number in the file to line number\n * in the patch file\n */\nfunction getLineMapFromPatch(patchString) {\n  var diffLineIndex = 0;\n  var fileLineIndex = 0;\n  var lineMap = {};\n\n  patchString.split('\\n').forEach((line) => {\n    if (line.match(/^@@/)) {\n      fileLineIndex = line.match(/\\+([0-9]+)/)[1] - 1;\n      return;\n    }\n\n    diffLineIndex++;\n    if (line[0] !== '-') {\n      fileLineIndex++;\n      if (line[0] === '+') {\n        lineMap[fileLineIndex] = diffLineIndex;\n      }\n    }\n  });\n\n  return lineMap;\n}\n\nfunction sendComment(user, repo, number, sha, filename, lineMap, message) {\n  if (!lineMap[message.line]) {\n    // Do not send messages on lines that did not change\n    return;\n  }\n\n  var opts = {\n    user,\n    repo,\n    number,\n    sha,\n    path: filename,\n    commit_id: sha,\n    body: message.message,\n    position: lineMap[message.line],\n  };\n  github.pullRequests.createComment(opts, function(error, res) {\n    if (error) {\n      console.log(error);\n      return;\n    }\n  });\n  console.log('Sending comment', opts);\n}\n\nfunction main(messages, user, repo, number) {\n  // No message, we don't need to do anything :)\n  if (Object.keys(messages).length === 0) {\n    return;\n  }\n\n  getShaFromPullRequest(user, repo, number, (sha) => {\n    getFilesFromCommit(user, repo, sha, (files) => {\n      files\n        .filter((file) => messages[file.filename])\n        .forEach((file) => {\n          // github api sometimes does not return a patch on large commits\n          if (!file.patch) {\n            return;\n          }\n          var lineMap = getLineMapFromPatch(file.patch);\n          messages[file.filename].forEach((message) => {\n            sendComment(user, repo, number, sha, file.filename, lineMap, message);\n          });\n        });\n    });\n  });\n}\n\nvar content = '';\nprocess.stdin.resume();\nprocess.stdin.on('data', function(buf) { content += buf.toString(); });\nprocess.stdin.on('end', function() {\n  var messages = {};\n\n  // Since we send a few http requests to setup the process, we don't want\n  // to run this file one time per code analysis tool. Instead, we write all\n  // the results in the same stdin stream.\n  // The format of this stream is\n  //\n  //   name-of-the-converter\n  //   {\"json\":\"payload\"}\n  //   name-of-the-other-converter\n  //   {\"other\": [\"json\", \"payload\"]}\n  //\n  // In order to generate such stream, here is a sample bash command:\n  //\n  //   cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; flow --json) | node code-analysis-bot.js\n\n  var lines = content.trim().split('\\n');\n  for (var i = 0; i < Math.ceil(lines.length / 2); ++i) {\n    var converter = converters[lines[i * 2]];\n    if (!converter) {\n      throw new Error('Unknown converter ' + lines[i * 2]);\n    }\n    var json;\n    try {\n      json = JSON.parse(lines[i * 2 + 1]);\n    } catch (e) {}\n\n    converter(messages, json);\n  }\n\n  // The paths are returned in absolute from code analysis tools but github works\n  // on paths relative from the root of the project. Doing the normalization here.\n  var pwd = path.resolve('.');\n  for (var absolutePath in messages) {\n    var relativePath = path.relative(pwd, absolutePath);\n    if (relativePath === absolutePath) {\n      continue;\n    }\n    messages[relativePath] = messages[absolutePath];\n    delete messages[absolutePath];\n  }\n\n  var user = process.env.CI_USER;\n  var repo = process.env.CI_REPO;\n  var number = process.env.PULL_REQUEST_NUMBER;\n\n  // intentional lint warning to make sure that the bot is working :)\n  main(messages, user, repo, number);\n});\n"
  },
  {
    "path": "bots/pr-inactivity-bookmarklet.js",
    "content": "javascript:(function(){$('#new_comment_field')[0].value='Hey @' + $(\".timeline-comment-header-text\").first().find(\".author\").text() + '! Thanks for making the pull request, but we are closing it due to inactivity (' + Math.round(Math.abs((Date.now() - new Date($(\".timeline-comment-header-text\").last().find(\"time\").attr(\"datetime\")).getTime())/(24*60*60*1000))) + ' days with no activity). If you want to get your proposed changes merged, please rebase your branch with master and send a new pull request. :)';/*$('button.btn-primary:contains(\"Comment\")').click()*/})()\n"
  },
  {
    "path": "bots/question-bookmarklet.js",
    "content": "javascript:(function(){$('#new_comment_field')[0].value='Hey @' + $(\".timeline-comment-header-text\").first().find(\".author\").text() + '! Thanks for reporting this!\\n\\nThere\\'s an awesome place to ask question like this one: [StackOverflow](http://stackoverflow.com/questions/tagged/react-native). It\\'s the best system for Q&A. Many people from the community hang out there and will be able to see your question, you can vote on answers and mark question as answered etc. This lets us keep a list of bug reports and feature requests on github and especially [Canny](https://react-native.canny.io/feature-requests) (again, with voting which is really nice).\\n\\nIf you think StackOverflow works for you please consider posting there instead and closing this issue.\\n\\nI\\'m posting this here because github issues haven\\'t been working very well for us and because StackOverflow is so much better. Thanks for reading! :)';$('button.btn-primary:contains(\"Comment\")').click()})()\n"
  },
  {
    "path": "breaking-changes.md",
    "content": "# Breaking Changes\n\n**Breaking changes are now tracked in [the Wiki](https://github.com/facebook/react-native/wiki/Breaking-Changes)**.\n"
  },
  {
    "path": "build.gradle",
    "content": "// Copyright 2015-present Facebook. All Rights Reserved.\n\nbuildscript {\n    repositories {\n        jcenter()\n        mavenLocal()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:2.2.2'\n        classpath 'de.undercouch:gradle-download-task:3.1.2'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n        mavenLocal()\n\n        def androidSdk = System.getenv(\"ANDROID_SDK\")\n        maven {\n            url \"$androidSdk/extras/m2repository/\"\n        }\n    }\n}\n"
  },
  {
    "path": "cli.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nmodule.exports = require('./local-cli/cli.js');\n"
  },
  {
    "path": "danger/.babelrc",
    "content": "{}\n"
  },
  {
    "path": "danger/README.md",
    "content": "If you'd like to make changes to the Dangerfile, find an existing PR and copy the URL.\t\t\n\t\t\nThen run from the React Native root:\t\t\n\n```\ncd danger\nnpm install\n..\nnode danger/node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/1\t\t\n```\n\nAnd you will get the responses from parsing the Dangerfile.\n"
  },
  {
    "path": "danger/dangerfile.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nconst fs = require('fs');\nconst includes = require('lodash.includes');\nconst minimatch = require('minimatch');\n\nimport { danger, fail, markdown, message, warn } from 'danger';\n\n// Fails if the description is too short.\nif (!danger.github.pr.body || danger.github.pr.body.length < 10) {\n  fail(':grey_question: This pull request needs a description.');\n  markdown('@facebook-github-bot label Needs more information');\n}\n\n// Warns if the PR title contains [WIP]\nconst isWIP = includes(danger.github.pr.title, '[WIP]');\nif (isWIP) {\n  const title = ':construction_worker: Work In Progress';\n  const idea = 'This PR appears to be a work in progress, and may not be ready to be merged yet.';\n  warn(`${title} - <i>${idea}</i>`);\n}\n\n// Warns if there are changes to package.json, and tags the team.\nconst packageChanged = includes(danger.git.modified_files, 'package.json');\nif (packageChanged) {\n  const title = ':lock: package.json';\n  const idea = 'Changes were made to package.json. ' +\n    'This will require a manual import by a Facebook employee.';\n  warn(`${title} - <i>${idea}</i>`);\n}\n\n// Warns if a test plan is missing.\nconst includesTestPlan = danger.github.pr.body && danger.github.pr.body.toLowerCase().includes('test plan');\nif (!includesTestPlan) {\n  const title = ':clipboard: Test Plan';\n  const idea = 'This PR appears to be missing a Test Plan.';\n  warn(`${title} - <i>${idea}</i>`);\n  markdown('@facebook-github-bot label Needs more information');\n}\n\n// Regex looks for given categories, types, a file/framework/component, and a message - broken into 4 capture groups\nconst releaseNotesRegex = /\\[(ANDROID|CLI|DOCS|GENERAL|INTERNAL|IOS|TVOS|WINDOWS)\\]\\s*?\\[(BREAKING|BUGFIX|ENHANCEMENT|FEATURE|MINOR)\\]\\s*?\\[(.*)\\]\\s*?\\-\\s*?(.*)/ig;\nconst includesReleaseNotes = danger.github.pr.body.toLowerCase().includes('release notes');\nconst correctlyFormattedReleaseNotes = releaseNotesRegex.test(danger.github.pr.body);\nconst releaseNotesCaptureGroups = releaseNotesRegex.exec(danger.github.pr.body);\n\nif (!includesReleaseNotes) {\n  const title = ':clipboard: Release Notes';\n  const idea = 'This PR appears to be missing Release Notes.';\n  warn(`${title} - <i>${idea}</i>`);\n  markdown('@facebook-github-bot label Needs more information');\n} else if (!correctlyFormattedReleaseNotes) {\n  const title = ':clipboard: Release Notes';\n  const idea = 'This PR may have incorrectly formatted Release Notes.';\n  warn(`${title} - <i>${idea}</i>`);\n  markdown('@facebook-github-bot label Needs more information');\n} else if (releaseNotesCaptureGroups) {\n  const category = releaseNotesCaptureGroups[1].toLowerCase();\n\n  // Use Release Notes to Tag PRs appropriately\n  if (category === 'ios' ){\n    markdown('@facebook-github-bot label iOS');\n  }\n\n  if (category === 'android' ){\n    markdown('@facebook-github-bot label Android');\n  }\n}\n\n// Tags PRs that have been submitted by a core contributor.\n// TODO: Switch to using an actual MAINTAINERS file.\nconst taskforce = fs.readFileSync('../bots/IssueCommands.txt', 'utf8').split('\\n')[0].split(':')[1];\nconst isSubmittedByTaskforce = includes(taskforce, danger.github.pr.user.login);\nif (isSubmittedByTaskforce) {\n  markdown('@facebook-github-bot label Core Team');\n}\n\n// Tags big PRs\nvar bigPRThreshold = 600;\nif (danger.github.pr.additions + danger.github.pr.deletions > bigPRThreshold) {\n  const title = ':exclamation: Big PR';\n  const idea = `This PR is extremely unlikely to get reviewed because it touches ${danger.github.pr.additions + danger.github.pr.deletions} lines.`;\n  warn(`${title} - <i>${idea}</i>`);\n\n  markdown('@facebook-github-bot large-pr');  \n}\nif (danger.git.modified_files + danger.git.added_files + danger.git.deleted_files > bigPRThreshold) {\n  const title = ':exclamation: Big PR';\n  const idea = `This PR is extremely unlikely to get reviewed because it touches ${danger.git.modified_files + danger.git.added_files + danger.git.deleted_files} files.`;\n  warn(`${title} - <i>${idea}</i>`);\n\n  markdown('@facebook-github-bot large-pr');  \n}\n\n// Warns if the bots whitelist file is updated.\nconst issueCommandsFileModified = includes(danger.git.modified_files, 'bots/IssueCommands.txt');\nif (issueCommandsFileModified) {\n  const title = ':exclamation: Bots';\n  const idea = 'This PR appears to modify the list of people that may issue ' + \n  'commands to the GitHub bot.';\n  warn(`${title} - <i>${idea}</i>`);\n}\n\n// Warns if the PR is opened against stable, as commits need to be cherry picked and tagged by a release maintainer.\n// Fails if the PR is opened against anything other than `master` or `-stable`.\nconst isMergeRefMaster = danger.github.pr.base.ref === 'master';\nconst isMergeRefStable = danger.github.pr.base.ref.indexOf(`-stable`) !== -1;\nif (!isMergeRefMaster && isMergeRefStable) {\n  const title = ':grey_question: Base Branch';\n  const idea = 'The base branch for this PR is something other than `master`. Are you sure you want to merge these changes into a stable release? If you are interested in backporting updates to an older release, the suggested approach is to land those changes on `master` first and then cherry-pick the commits into the branch for that release. The [Releases Guide](https://github.com/facebook/react-native/blob/master/Releases.md) has more information.';\n  warn(`${title} - <i>${idea}</i>`);\n} else if (!isMergeRefMaster && !isMergeRefStable) {\n  const title = ':exclamation: Base Branch';\n  const idea = 'The base branch for this PR is something other than `master`. [Are you sure you want to target something other than the `master` branch?](http://facebook.github.io/react-native/docs/contributing.html#pull-requests)';\n  fail(`${title} - <i>${idea}</i>`);\n}\n\n// People can add themselves to CODEOWNERS in order to be automatically added as reviewers when a file matching a glob pattern is modified. The following will have the bot add a mention in that case.\nconst codeowners = fs.readFileSync('../.github/CODEOWNERS', 'utf8').split('\\n');\nlet mentions = [];\ncodeowners.forEach((codeowner) => {\n  const pattern = codeowner.split(' ')[0];\n  const owners = codeowner.substring(pattern.length).trim().split(' ');\n\n  const modifiedFileHasOwner = path => minimatch(path, pattern);\n  const modifiesOwnedCode = danger.git.modified_files.filter(modifiedFileHasOwner).length > 0;\n\n  if (modifiesOwnedCode) {\n    mentions = mentions.concat(owners);\n  }\n});\nconst isOwnedCodeModified = mentions.length > 0;\nif (isOwnedCodeModified) {\n  const uniqueMentions = new Set(mentions);\n  markdown('Attention: ' + [...uniqueMentions].join(', '));\n}\n"
  },
  {
    "path": "danger/package.json",
    "content": "{\n  \"private\": true,\n  \"scripts\": {\n    \"danger\": \"node ./node_modules/.bin/danger\"\n  },\n  \"devDependencies\": {\n    \"danger\": \"^2.1.6\",\n    \"lodash.includes\": \"^4.3.0\",\n    \"minimatch\": \"^3.0.4\"\n  }\n}\n"
  },
  {
    "path": "flow/Map.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\n// These annotations are copy/pasted from the built-in Flow definitions for\n// Native Map.\n\ndeclare module \"Map\" {\n  // Use the name \"MapPolyfill\" so that we don't get confusing error\n  // messages about \"Using Map instead of Map\".\n  declare class MapPolyfill<K, V> {\n    @@iterator(): Iterator<[K, V]>;\n    constructor<Key, Value>(_: void): MapPolyfill<Key, Value>;\n    constructor<Key, Value>(_: null): MapPolyfill<Key, Value>;\n    constructor<Key, Value>(iterable: Iterable<[Key, Value]>): MapPolyfill<Key, Value>;\n    clear(): void;\n    delete(key: K): boolean;\n    entries(): Iterator<[K, V]>;\n    forEach(callbackfn: (value: V, index: K, map: MapPolyfill<K, V>) => mixed, thisArg?: any): void;\n    get(key: K): V | void;\n    has(key: K): boolean;\n    keys(): Iterator<K>;\n    set(key: K, value: V): MapPolyfill<K, V>;\n    size: number;\n    values(): Iterator<V>;\n  }\n\n  declare module.exports: typeof MapPolyfill;\n}\n"
  },
  {
    "path": "flow/Position.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @nolint\n */\n\ndeclare class Position {\n  coords: Coordinates,\n  timestamp: number,\n  mocked: boolean,\n}\n"
  },
  {
    "path": "flow/Promise.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\n// These annotations are copy/pasted from the built-in Flow definitions for\n// Native Promises with some non-standard APIs added in\ndeclare class Promise<+R> {\n  constructor(callback: (\n    resolve: (result?: Promise<R> | R) => void,\n    reject: (error?: any) => void\n  ) => mixed): void;\n\n  then<U>(\n    onFulfill?: ?(value: R) => Promise<U> | ?U,\n    onReject?: ?(error: any) => Promise<U> | ?U\n  ): Promise<U>;\n\n  catch<U>(\n    onReject?: (error: any) => ?Promise<U> | U\n  ): Promise<U>;\n\n  static resolve<T>(object?: Promise<T> | T): Promise<T>;\n  static reject<T>(error?: any): Promise<T>;\n\n  static all<T: Iterable<mixed>>(promises: T): Promise<$TupleMap<T, typeof $await>>;\n  static race<T>(promises: Array<Promise<T>>): Promise<T>;\n\n  // Non-standard APIs\n\n  // See https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/__forks__/Promise.native.js#L21\n  finally<U>(\n    onFinally?: ?(value: any) => Promise<U> | U\n  ): Promise<U>;\n\n  done<U>(\n    onFulfill?: ?(value: R) => mixed,\n    onReject?: ?(error: any) => mixed\n  ): void;\n\n  static cast<T>(object?: T): Promise<T>;\n}\n"
  },
  {
    "path": "flow/Set.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @nolint\n */\n\n// These annotations are copy/pasted from the built-in Flow definitions for\n// Native Set.\n\ndeclare module \"Set\" {\n  // Use the name \"SetPolyfill\" so that we don't get confusing error\n  // messages about \"Using Set instead of Set\".\n  declare class SetPolyfill<T> {\n    @@iterator(): Iterator<T>;\n    constructor(iterable: ?Iterable<T>): void;\n    add(value: T): SetPolyfill<T>;\n    clear(): void;\n    delete(value: T): boolean;\n    entries(): Iterator<[T, T]>;\n    forEach(callbackfn: (value: T, index: T, set: SetPolyfill<T>) => mixed, thisArg?: any): void;\n    has(value: T): boolean;\n    keys(): Iterator<T>;\n    size: number;\n    values(): Iterator<T>;\n  }\n\n  declare module.exports: typeof SetPolyfill;\n}\n"
  },
  {
    "path": "flow/console.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\ndeclare module 'console' {\n  declare function assert(value: any, ...message: any): void;\n  declare function dir(\n    obj: Object,\n    options: {showHidden: boolean, depth: number, colors: boolean},\n  ): void;\n  declare function error(...data: any): void;\n  declare function info(...data: any): void;\n  declare function log(...data: any): void;\n  declare function time(label: any): void;\n  declare function timeEnd(label: any): void;\n  declare function trace(first: any, ...rest: any): void;\n  declare function warn(...data: any): void;\n  declare class Console {\n    constructor(stdout: stream$Writable, stdin?: stream$Writable): void;\n    assert(value: any, ...message: any): void,\n    dir(\n      obj: Object,\n      options: {showHidden: boolean, depth: number, colors: boolean},\n    ): void,\n    error(...data: any): void,\n    info(...data: any): void,\n    log(...data: any): void,\n    time(label: any): void,\n    timeEnd(label: any): void,\n    trace(first: any, ...rest: any): void,\n    warn(...data: any): void,\n  }\n}\n"
  },
  {
    "path": "flow/create-react-class.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @nolint\n */\n\n// TODO (acdlite) Remove this file once flowtype/flow-typed/pull/773 is merged\n\ndeclare module 'create-react-class' {\n  declare module.exports: React$CreateClass;\n}\n"
  },
  {
    "path": "flow/fbjs.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\ndeclare module 'fbjs/lib/invariant' {\n  declare module.exports: <T>(condition: any, message: string, ...args: Array<any>) => void;\n}\n\ndeclare module 'fbjs/lib/nullthrows' {\n  declare module.exports: <T>(value: ?T) => T;\n}\n"
  },
  {
    "path": "flow/prop-types.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @nolint\n */\n\n// TODO (bvaughn) Remove this file once flowtype/flow-typed/pull/773 is merged\n\ntype $npm$propTypes$ReactPropsCheckType = (\n  props: any,\n  propName: string,\n  componentName: string,\n  href?: string\n) => ?Error;\n\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<Function>;\n  declare var number: React$PropType$Primitive<number>;\n  declare var object: React$PropType$Primitive<Object>;\n  declare var string: React$PropType$Primitive<string>;\n  declare var any: React$PropType$Primitive<any>;\n  declare var arrayOf: React$PropType$ArrayOf;\n  declare var element: React$PropType$Primitive<any>; /* TODO */\n  declare var instanceOf: React$PropType$InstanceOf;\n  declare var node: React$PropType$Primitive<any>; /* TODO */\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: $Subtype<{[_: $Keys<V>]: $npm$propTypes$ReactPropsCheckType}>,\n    values: V,\n    location: string,\n    componentName: string,\n    getStack: ?(() => ?string)\n  ) : void;\n}\n"
  },
  {
    "path": "flow-github/metro.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\ndeclare module 'metro' {\n  declare module.exports: any;\n}\n\ndeclare module 'metro/src/lib/TerminalReporter' {\n  declare module.exports: any;\n}\n\ndeclare module 'metro/src/HmrServer' {\n  declare module.exports: any;\n}"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Mon Jan 16 11:21:59 CST 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.14.1-all.zip\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windows variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\ngoto execute\r\n\r\n:4NT_args\r\n@rem Get arguments from the 4NT Shell from JP Software\r\nset CMD_LINE_ARGS=%$\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "jest/.eslintrc",
    "content": "{\n  \"rules\": {\n    // This folder currently runs through babel and doesn't need to be\n    // compatible with node 4\n    \"comma-dangle\": 0\n  }\n}\n"
  },
  {
    "path": "jest/assetFileTransformer.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\n/* eslint-env node */\n\nconst path = require('path');\nconst createCacheKeyFunction = require('fbjs-scripts/jest/createCacheKeyFunction');\n\nmodule.exports = {\n  // Mocks asset requires to return the filename. Makes it possible to test that\n  // the correct images are loaded for components. Essentially\n  // require('img1.png') becomes `Object { \"testUri\": 'path/to/img1.png' }` in\n  // the Jest snapshot.\n  process: (_, filename) =>\n    `module.exports = {\n      testUri: ${JSON.stringify(path.relative(__dirname, filename))}\n    };`,\n  getCacheKey: createCacheKeyFunction([__filename]),\n};\n"
  },
  {
    "path": "jest/mockComponent.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nmodule.exports = moduleName => {\n  const RealComponent = require.requireActual(moduleName);\n  const React = require('react');\n\n  const Component = class extends RealComponent {\n    render() {\n      const name = RealComponent.displayName || RealComponent.name;\n\n      return React.createElement(\n        name.replace(/^(RCT|RK)/,''),\n        this.props,\n        this.props.children,\n      );\n    }\n  };\n  return Component;\n};\n"
  },
  {
    "path": "jest/preprocessor.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\n/* eslint-env node */\n\n'use strict';\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst babel = require('babel-core');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst babelRegisterOnly = require('metro/src/babelRegisterOnly');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst createCacheKeyFunction = require('fbjs-scripts/jest/createCacheKeyFunction');\nconst generate = require('babel-generator').default;\n\nconst nodeFiles = RegExp([\n  '/local-cli/',\n  '/metro(-bundler)?/',\n].join('|'));\nconst nodeOptions = babelRegisterOnly.config([nodeFiles]);\n\nbabelRegisterOnly([]);\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst transformer = require('metro/src/transformer.js');\nmodule.exports = {\n  process(src/*: string*/, file/*: string*/) {\n    if (nodeFiles.test(file)) { // node specific transforms only\n      return babel.transform(\n        src,\n        Object.assign({filename: file}, nodeOptions)\n      ).code;\n    }\n\n    const {ast} = transformer.transform({\n      filename: file,\n      localPath: file,\n      options: {\n        dev: true,\n        inlineRequires: true,\n        minify: false,\n        platform: '',\n        projectRoot: '',\n        retainLines: true,\n      },\n      src,\n    });\n\n    return generate(ast, {\n      code: true,\n      comments: false,\n      compact: false,\n      filename: file,\n      retainLines: true,\n      sourceFileName: file,\n      sourceMaps: true,\n    }, src).code;\n  },\n\n  getCacheKey: createCacheKeyFunction([\n    __filename,\n    require.resolve('metro/src/transformer.js'),\n    require.resolve('babel-core/package.json'),\n  ]),\n};\n"
  },
  {
    "path": "jest/setup.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst mockComponent = require.requireActual('./mockComponent');\n\nrequire.requireActual('../Libraries/polyfills/babelHelpers.js');\nrequire.requireActual('../Libraries/polyfills/Object.es7.js');\nrequire.requireActual('../Libraries/polyfills/error-guard');\n\nglobal.__DEV__ = true;\n\nglobal.Promise = require.requireActual('promise');\nglobal.regeneratorRuntime = require.requireActual('regenerator-runtime/runtime');\n\nglobal.requestAnimationFrame = function(callback) {\n  return setTimeout(callback, 0);\n};\nglobal.cancelAnimationFrame = function(id) {\n  clearTimeout(id);\n};\n\njest\n  .mock('setupDevtools')\n  .mock('npmlog');\n\n// there's a __mock__ for it.\njest.setMock('ErrorUtils', require('ErrorUtils'));\n\njest\n  .mock('InitializeCore', () => {})\n  .mock('Image', () => mockComponent('Image'))\n  .mock('Text', () => mockComponent('Text'))\n  .mock('TextInput', () => mockComponent('TextInput'))\n  .mock('Modal', () => mockComponent('Modal'))\n  .mock('View', () => mockComponent('View'))\n  .mock('RefreshControl', () => require.requireMock('RefreshControlMock'))\n  .mock('ScrollView', () => require.requireMock('ScrollViewMock'))\n  .mock(\n    'ActivityIndicator',\n    () => mockComponent('ActivityIndicator'),\n  )\n  .mock('ListView', () => require.requireMock('ListViewMock'))\n  .mock('ListViewDataSource', () => {\n    const DataSource = require.requireActual('ListViewDataSource');\n    DataSource.prototype.toJSON = function() {\n      function ListViewDataSource(dataBlob) {\n        this.items = 0;\n        // Ensure this doesn't throw.\n        try {\n          Object.keys(dataBlob).forEach(key => {\n            this.items += dataBlob[key] && (\n              dataBlob[key].length || dataBlob[key].size || 0\n            );\n          });\n        } catch (e) {\n          this.items = 'unknown';\n        }\n      }\n\n      return new ListViewDataSource(this._dataBlob);\n    };\n    return DataSource;\n  })\n  .mock('AnimatedImplementation', () => {\n    const AnimatedImplementation = require.requireActual('AnimatedImplementation');\n    const oldCreate = AnimatedImplementation.createAnimatedComponent;\n    AnimatedImplementation.createAnimatedComponent = function(Component) {\n      const Wrapped = oldCreate(Component);\n      Wrapped.__skipSetNativeProps_FOR_TESTS_ONLY = true;\n      return Wrapped;\n    };\n    return AnimatedImplementation;\n  })\n  .mock('ReactNative', () => {\n    const ReactNative = require.requireActual('ReactNative');\n    const NativeMethodsMixin =\n      ReactNative.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.NativeMethodsMixin;\n    [\n      'measure',\n      'measureInWindow',\n      'measureLayout',\n      'setNativeProps',\n      'focus',\n      'blur',\n    ].forEach((key) => {\n      let warned = false;\n      NativeMethodsMixin[key] = function() {\n        if (warned) {\n          return;\n        }\n        warned = true;\n        console.warn(\n          'Calling .' + key + '() in the test renderer environment is not ' +\n            'supported. Instead, mock out your components that use ' +\n            'findNodeHandle with replacements that don\\'t rely on the ' +\n            'native environment.',\n        );\n      };\n    });\n    return ReactNative;\n  })\n  .mock('ensureComponentIsNative', () => () => true);\n\nconst mockEmptyObject = {};\nconst mockNativeModules = {\n  AlertManager: {\n    alertWithArgs: jest.fn(),\n  },\n  AppState: {\n    addEventListener: jest.fn(),\n  },\n  AsyncLocalStorage: {\n    multiGet: jest.fn((keys, callback) => process.nextTick(() => callback(null, []))),\n    multiSet: jest.fn((entries, callback) => process.nextTick(() => callback(null))),\n    multiRemove: jest.fn((keys, callback) => process.nextTick(() => callback(null))),\n    multiMerge: jest.fn((entries, callback) => process.nextTick(() => callback(null))),\n    clear: jest.fn(callback => process.nextTick(() => callback(null))),\n    getAllKeys: jest.fn(callback => process.nextTick(() => callback(null, []))),\n  },\n  BuildInfo: {\n    appVersion: '0',\n    buildVersion: '0',\n  },\n  Clipboard: {\n    setString: jest.fn(),\n  },\n  DataManager: {\n    queryData: jest.fn(),\n  },\n  DeviceInfo: {\n    Dimensions: {\n      window: {\n        fontScale: 2,\n        height: 1334,\n        scale: 2,\n        width: 750,\n      },\n      screen: {\n        fontScale: 2,\n        height: 1334,\n        scale: 2,\n        width: 750,\n      },\n    },\n  },\n  FacebookSDK: {\n    login: jest.fn(),\n    logout: jest.fn(),\n    queryGraphPath: jest.fn((path, method, params, callback) => callback()),\n  },\n  FbRelayNativeAdapter: {\n    updateCLC: jest.fn(),\n  },\n  GraphPhotoUpload: {\n    upload: jest.fn(),\n  },\n  I18n: {\n    translationsDictionary: JSON.stringify({\n      'Good bye, {name}!|Bye message': '\\u{00A1}Adi\\u{00F3}s {name}!',\n    }),\n  },\n  ImageLoader: {\n    getSize: jest.fn(\n      (url) => Promise.resolve({width: 320, height: 240})\n    ),\n    prefetchImage: jest.fn(),\n  },\n  ImageViewManager: {\n    getSize: jest.fn(\n      (uri, success) => process.nextTick(() => success(320, 240))\n    ),\n    prefetchImage: jest.fn(),\n  },\n  KeyboardObserver: {\n    addListener: jest.fn(),\n    removeListeners: jest.fn(),\n  },\n  Linking: {\n    openURL: jest.fn(),\n    canOpenURL: jest.fn(\n      () => Promise.resolve(true)\n    ),\n    addEventListener: jest.fn(),\n    getInitialURL: jest.fn(\n      () => Promise.resolve()\n    ),\n    removeEventListener: jest.fn(),\n  },\n  LocationObserver: {\n    getCurrentPosition: jest.fn(),\n    startObserving: jest.fn(),\n    stopObserving: jest.fn(),\n  },\n  ModalFullscreenViewManager: {},\n  NetInfo: {\n    fetch: jest.fn(\n      () => Promise.resolve()\n    ),\n    getConnectionInfo: jest.fn(\n      () => Promise.resolve()\n    ),\n    addEventListener: jest.fn(),\n    removeEventListener: jest.fn(),\n    isConnected: {\n      fetch: jest.fn(\n        () => Promise.resolve()\n      ),\n      addEventListener: jest.fn(),\n      removeEventListener: jest.fn(),\n    },\n    isConnectionExpensive: jest.fn(\n      () => Promise.resolve()\n    ),\n  },\n  Networking: {\n    sendRequest: jest.fn(),\n    abortRequest: jest.fn(),\n    addListener: jest.fn(),\n    removeListeners: jest.fn(),\n  },\n  PushNotificationManager: {\n    presentLocalNotification: jest.fn(),\n    scheduleLocalNotification: jest.fn(),\n    cancelAllLocalNotifications: jest.fn(),\n    removeAllDeliveredNotifications: jest.fn(),\n    getDeliveredNotifications: jest.fn(callback => process.nextTick(() => [])),\n    removeDeliveredNotifications: jest.fn(),\n    setApplicationIconBadgeNumber: jest.fn(),\n    getApplicationIconBadgeNumber: jest.fn(callback => process.nextTick(() => callback(0))),\n    cancelLocalNotifications: jest.fn(),\n    getScheduledLocalNotifications: jest.fn(callback => process.nextTick(() => callback())),\n    requestPermissions: jest.fn(() => Promise.resolve({alert: true, badge: true, sound: true})),\n    abandonPermissions: jest.fn(),\n    checkPermissions: jest.fn(callback => process.nextTick(() => callback({alert: true, badge: true, sound: true}))),\n    getInitialNotification: jest.fn(() => Promise.resolve(null)),\n    addListener: jest.fn(),\n    removeListeners: jest.fn(),\n  },\n  SourceCode: {\n    scriptURL: null,\n  },\n  StatusBarManager: {\n    setColor: jest.fn(),\n    setStyle: jest.fn(),\n    setHidden: jest.fn(),\n    setNetworkActivityIndicatorVisible: jest.fn(),\n    setBackgroundColor: jest.fn(),\n    setTranslucent: jest.fn(),\n  },\n  Timing: {\n    createTimer: jest.fn(),\n    deleteTimer: jest.fn(),\n  },\n  UIManager: {\n    AndroidViewPager: {\n      Commands: {\n        setPage: jest.fn(),\n        setPageWithoutAnimation: jest.fn(),\n      },\n    },\n    blur: jest.fn(),\n    createView: jest.fn(),\n    dispatchViewManagerCommand: jest.fn(),\n    focus: jest.fn(),\n    setChildren: jest.fn(),\n    manageChildren: jest.fn(),\n    updateView: jest.fn(),\n    removeSubviewsFromContainerWithID: jest.fn(),\n    replaceExistingNonRootView: jest.fn(),\n    customBubblingEventTypes: {},\n    customDirectEventTypes: {},\n    AndroidTextInput: {\n      Commands: {},\n    },\n    ModalFullscreenView: {\n      Constants: {},\n    },\n    ScrollView: {\n      Constants: {},\n    },\n    View: {\n      Constants: {},\n    },\n  },\n  BlobModule: {\n    BLOB_URI_SCHEME: 'content',\n    BLOB_URI_HOST: null,\n    enableBlobSupport: jest.fn(),\n    disableBlobSupport: jest.fn(),\n    createFromParts: jest.fn(),\n    sendBlob: jest.fn(),\n    release: jest.fn(),\n  },\n  WebSocketModule: {\n    connect: jest.fn(),\n    send: jest.fn(),\n    sendBinary: jest.fn(),\n    ping: jest.fn(),\n    close: jest.fn(),\n    addListener: jest.fn(),\n    removeListeners: jest.fn(),\n  },\n};\n\nObject.keys(mockNativeModules).forEach(module => {\n  try {\n    jest.doMock(module, () => mockNativeModules[module]); // needed by FacebookSDK-test\n  } catch (e) {\n    jest.doMock(module, () => mockNativeModules[module], {virtual: true});\n  }\n});\n\njest\n  .doMock('NativeModules', () => mockNativeModules)\n  .doMock('ReactNativePropRegistry', () => ({\n    register: id => id,\n    getByID: () => mockEmptyObject,\n  }));\n\njest.doMock('requireNativeComponent', () => {\n  const React = require('react');\n\n  return viewName => class extends React.Component {\n    render() {\n      return React.createElement(\n        viewName,\n        this.props,\n        this.props.children,\n      );\n    }\n  };\n});\n"
  },
  {
    "path": "jest-preset.json",
    "content": "{\n  \"haste\": {\n    \"defaultPlatform\": \"macos\",\n    \"platforms\": [\"android\", \"ios\", \"native\", \"macos\"],\n    \"providesModuleNodeModules\": [\n      \"react-native-macos\"\n    ]\n  },\n  \"moduleNameMapper\": {\n    \"^React$\": \"<rootDir>/node_modules/react\"\n  },\n  \"modulePathIgnorePatterns\": [\n    \"<rootDir>/node_modules/react-native-macos/Libraries/react-native/\"\n  ],\n  \"transform\": {\n    \"^.+\\\\.js$\": \"babel-jest\",\n    \"^[./a-zA-Z0-9$_-]+\\\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$\": \"<rootDir>/node_modules/react-native/jest/assetFileTransformer.js\"\n  },\n  \"transformIgnorePatterns\": [\n    \"node_modules/(?!(jest-)?react-native|react-clone-referenced-element)\"\n  ],\n  \"setupFiles\": [\n    \"<rootDir>/node_modules/react-native-macos/jest/setup.js\"\n  ],\n  \"testEnvironment\": \"node\"\n}\n"
  },
  {
    "path": "keystores/BUCK",
    "content": "keystore(\n    name = \"debug\",\n    properties = \"debug.keystore.properties\",\n    store = \"debug.keystore\",\n    visibility = [\n        \"PUBLIC\",\n    ],\n)\n"
  },
  {
    "path": "keystores/debug.keystore.properties",
    "content": "key.store=debug.keystore\nkey.alias=androiddebugkey\nkey.store.password=android\nkey.alias.password=android\n"
  },
  {
    "path": "lib/InitializeJavaScriptAppEngine.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\n// This is a forwarding module to allow React to require React Native internals\n// as node dependency\nmodule.exports = require('InitializeCore');\n"
  },
  {
    "path": "lib/RCTEventEmitter.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\n// This is a forwarding module to allow React to require React Native internals\n// as node dependency\nmodule.exports = require('RCTEventEmitter');\n"
  },
  {
    "path": "lib/README",
    "content": "JS modules in this folder are forwarding modules to allow React to require React Native internals as node dependencies.\n"
  },
  {
    "path": "lib/TextInputState.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\n// This is a forwarding module to allow React to require React Native internals\n// as node dependency\nmodule.exports = require('TextInputState');\n"
  },
  {
    "path": "lib/UIManager.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\n// This is a forwarding module to allow React to require React Native internals\n// as node dependency\nmodule.exports = require('UIManager');\n"
  },
  {
    "path": "lib/UIManagerStatTracker.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\n// This is a forwarding module to allow React to require React Native internals\n// as node dependency\nmodule.exports = require('UIManagerStatTracker');\n"
  },
  {
    "path": "lib/View.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\n// This is a forwarding module to allow React to require React Native internals\n// as node dependency\nmodule.exports = require('View');\n"
  },
  {
    "path": "lib/deepDiffer.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\n// This is a forwarding module to allow React to require React Native internals\n// as node dependency\nmodule.exports = require('deepDiffer');\n"
  },
  {
    "path": "lib/deepFreezeAndThrowOnMutationInDev.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\n// This is a forwarding module to allow React to require React Native internals\n// as node dependency\nmodule.exports = require('deepFreezeAndThrowOnMutationInDev');\n"
  },
  {
    "path": "lib/flattenStyle.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\n// This is a forwarding module to allow React to require React Native internals\n// as node dependency\nmodule.exports = require('flattenStyle');\n"
  },
  {
    "path": "local-cli/.eslintrc",
    "content": "{\n  \"rules\": {\n    // This folder currently runs through babel and doesn't need to be\n    // compatible with node 4\n    \"comma-dangle\": 0,\n\n    \"extra-arrow-initializer\": 0,\n    \"no-alert\": 0,\n    \"no-console-disallow\": 0\n  },\n  \"env\": {\n    \"node\": true\n  }\n}\n"
  },
  {
    "path": "local-cli/__mocks__/beeper.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n 'use strict';\n\n// beeper@1.1.0 has a return statement outside of a function\n// and therefore doesn't parse. Let's mock it so that we can\n// run the tests.\nmodule.exports = function () {};\n"
  },
  {
    "path": "local-cli/__mocks__/fs.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n */\n\n'use strict';\n\nconst asyncify = require('async/asyncify');\nconst {EventEmitter} = require('events');\nconst {dirname} = require.requireActual('path');\nconst fs = jest.genMockFromModule('fs');\nconst invariant = require('fbjs/lib/invariant');\nconst path = require('path');\nconst stream = require.requireActual('stream');\n\nconst noop = () => {};\n\nfunction asyncCallback(cb) {\n  return function() {\n    setImmediate(() => cb.apply(this, arguments));\n  };\n}\n\nconst mtime = {\n  getTime: () => Math.ceil(Math.random() * 10000000),\n};\n\nfs.realpath.mockImplementation((filepath, callback) => {\n  callback = asyncCallback(callback);\n  let node;\n  try {\n    node = getToNode(filepath);\n  } catch (e) {\n    return callback(e);\n  }\n  if (node && typeof node === 'object' && node.SYMLINK != null) {\n    return callback(null, node.SYMLINK);\n  }\n  return callback(null, filepath);\n});\n\nfs.readdirSync.mockImplementation(filepath => Object.keys(getToNode(filepath)));\n\nfs.readdir.mockImplementation((filepath, callback) => {\n  callback = asyncCallback(callback);\n  let node;\n  try {\n    node = getToNode(filepath);\n    if (node && typeof node === 'object' && node.SYMLINK != null) {\n      node = getToNode(node.SYMLINK);\n    }\n  } catch (e) {\n    return callback(e);\n  }\n\n  if (!(node && typeof node === 'object' && node.SYMLINK == null)) {\n    return callback(new Error(filepath + ' is not a directory.'));\n  }\n\n  return callback(null, Object.keys(node));\n});\n\nfs.readFile.mockImplementation(asyncify(fs.readFileSync));\n\nfs.readFileSync.mockImplementation(function(filepath, encoding) {\n  filepath = path.normalize(filepath);\n  const node = getToNode(filepath);\n  if (isDirNode(node)) {\n    throw new Error('Error readFileSync a dir: ' + filepath);\n  }\n  if (Buffer.isBuffer(node) && typeof encoding !== 'undefined') {\n    return node.toString();\n  }\n  return node;\n});\n\nfs.writeFile.mockImplementation(asyncify(fs.writeFileSync));\n\nfs.writeFileSync.mockImplementation((filePath, content, options) => {\n  filePath = path.normalize(filePath);\n  if (options == null || typeof options === 'string') {\n    options = {encoding: options};\n  }\n  invariant(\n    options.encoding == null || options.encoding === 'utf8',\n    '`options` argument supports only `null` or `\"utf8\"`',\n  );\n  const dirPath = path.dirname(filePath);\n  const node = getToNode(dirPath);\n  if (!isDirNode(node)) {\n    throw fsError('ENOTDIR', 'not a directory: ' + dirPath);\n  }\n  node[path.basename(filePath)] = content;\n});\n\nconst openFds = new Map();\nlet nextFd = 3;\n\nfs.openSync.mockImplementation((filePath, flags) => {\n  const dirPath = path.dirname(filePath);\n  const node = getToNode(dirPath);\n  if (!isDirNode(node)) {\n    throw fsError('ENOTDIR', 'not a directory: ' + dirPath);\n  }\n  node[path.basename(filePath)] = '';\n  openFds.set(nextFd, {filePath, flags, node});\n  return nextFd++;\n});\n\nfs.writeSync.mockImplementation((fd, str) => {\n  invariant(typeof str === 'string', 'only strings supported');\n  const data = openFds.get(fd);\n  if (data == null || data.flags !== 'w') {\n    throw fsError('EBADF', 'bad file descriptor, write');\n  }\n  data.node[path.basename(data.filePath)] += str;\n});\n\nfs.closeSync.mockImplementation(fd => {\n  openFds.delete(fd);\n});\n\nfs.mkdir.mockImplementation(asyncify(fs.mkdirSync));\n\nfs.mkdirSync.mockImplementation((dirPath, mode) => {\n  const parentPath = path.dirname(dirPath);\n  const node = getToNode(parentPath);\n  if (!isDirNode(node)) {\n    throw fsError('ENOTDIR', 'not a directory: ' + parentPath);\n  }\n  if (node[path.basename(dirPath)] == null) {\n    node[path.basename(dirPath)] = {};\n  }\n});\n\nfunction fsError(code, message) {\n  const error = new Error(code + ': ' + message);\n  error.code = code;\n  return error;\n}\n\nfunction isDirNode(node) {\n  return (\n    node &&\n    typeof node === 'object' &&\n    node.SYMLINK == null &&\n    Buffer.isBuffer(node) === false\n  );\n}\n\nfunction readlinkSync(filepath) {\n  const node = getToNode(filepath);\n  if (node !== null && typeof node === 'object' && !!node.SYMLINK) {\n    return node.SYMLINK;\n  } else {\n    throw new Error(`EINVAL: invalid argument, readlink '${filepath}'`);\n  }\n}\n\nfs.readlink.mockImplementation((filepath, callback) => {\n  callback = asyncCallback(callback);\n  let result;\n  try {\n    result = readlinkSync(filepath);\n  } catch (e) {\n    callback(e);\n    return;\n  }\n  callback(null, result);\n});\n\nfs.readlinkSync.mockImplementation(readlinkSync);\n\nfunction existsSync(filepath) {\n  try {\n    const node = getToNode(filepath);\n    return node !== null;\n  } catch (e) {\n    return false;\n  }\n}\n\nfs.exists.mockImplementation((filepath, callback) => {\n  callback = asyncCallback(callback);\n  let result;\n  try {\n    result = existsSync(filepath);\n  } catch (e) {\n    callback(e);\n    return;\n  }\n  callback(null, result);\n});\n\nfs.existsSync.mockImplementation(existsSync);\n\nfunction makeStatResult(node) {\n  const isSymlink = node != null && node.SYMLINK != null;\n  return {\n    isBlockDevice: () => false,\n    isCharacterDevice: () => false,\n    isDirectory: () => node != null && typeof node === 'object' && !isSymlink,\n    isFIFO: () => false,\n    isFile: () => node != null && typeof node === 'string',\n    isSocket: () => false,\n    isSymbolicLink: () => isSymlink,\n    mtime,\n  };\n}\n\nfunction statSync(filepath) {\n  const node = getToNode(filepath);\n  if (node != null && node.SYMLINK) {\n    return statSync(node.SYMLINK);\n  }\n  return makeStatResult(node);\n}\n\nfs.stat.mockImplementation((filepath, callback) => {\n  callback = asyncCallback(callback);\n  let result;\n  try {\n    result = statSync(filepath);\n  } catch (e) {\n    callback(e);\n    return;\n  }\n  callback(null, result);\n});\n\nfs.statSync.mockImplementation(statSync);\n\nfunction lstatSync(filepath) {\n  const node = getToNode(filepath);\n  return makeStatResult(node);\n}\n\nfs.lstat.mockImplementation((filepath, callback) => {\n  callback = asyncCallback(callback);\n  let result;\n  try {\n    result = lstatSync(filepath);\n  } catch (e) {\n    callback(e);\n    return;\n  }\n  callback(null, result);\n});\n\nfs.lstatSync.mockImplementation(lstatSync);\n\nfs.open.mockImplementation(function(filepath) {\n  const callback = arguments[arguments.length - 1] || noop;\n  let data, error, fd;\n  try {\n    data = getToNode(filepath);\n  } catch (e) {\n    error = e;\n  }\n\n  if (error || data == null) {\n    error = Error(`ENOENT: no such file or directory: \\`${filepath}\\``);\n  }\n  if (data != null) {\n    /* global Buffer: true */\n    fd = {buffer: new Buffer(data, 'utf8'), position: 0};\n  }\n\n  callback(error, fd);\n});\n\nfs.read.mockImplementation(\n  (fd, buffer, writeOffset, length, position, callback = noop) => {\n    let bytesWritten;\n    try {\n      if (position == null || position < 0) {\n        ({position} = fd);\n      }\n      bytesWritten = fd.buffer.copy(\n        buffer,\n        writeOffset,\n        position,\n        position + length,\n      );\n      fd.position = position + bytesWritten;\n    } catch (e) {\n      callback(Error('invalid argument'));\n      return;\n    }\n    callback(null, bytesWritten, buffer);\n  },\n);\n\nfs.close.mockImplementation((fd, callback = noop) => {\n  try {\n    fd.buffer = fs.position = undefined;\n  } catch (e) {\n    callback(Error('invalid argument'));\n    return;\n  }\n  callback(null);\n});\n\nlet filesystem = {};\n\nfs.mock = {\n  clear() {\n    filesystem = {};\n  },\n};\n\nfs.createReadStream.mockImplementation(filepath => {\n  if (!filepath.startsWith('/')) {\n    throw Error('Cannot open file ' + filepath);\n  }\n\n  const parts = filepath.split('/').slice(1);\n  let file = filesystem;\n\n  for (const part of parts) {\n    file = file[part];\n    if (!file) {\n      break;\n    }\n  }\n\n  if (typeof file !== 'string') {\n    throw Error('Cannot open file ' + filepath);\n  }\n\n  return new stream.Readable({\n    read() {\n      this.push(file, 'utf8');\n      this.push(null);\n    },\n  });\n});\n\nfs.createWriteStream.mockImplementation(filePath => {\n  let node;\n  const writeStream = new stream.Writable({\n    write(chunk, encoding, callback) {\n      this.__chunks.push(chunk);\n      node[path.basename(filePath)] = this.__chunks.join('');\n      callback();\n    },\n  });\n  writeStream.__file = filePath;\n  writeStream.__chunks = [];\n  writeStream.end = jest.fn(writeStream.end);\n  fs.createWriteStream.mock.returned.push(writeStream);\n  try {\n    const dirPath = dirname(filePath);\n    node = getToNode(dirPath);\n    if (!isDirNode(node)) {\n      throw fsError('ENOTDIR', 'not a directory: ' + dirPath);\n    }\n    // Truncate the file on opening.\n    node[path.basename(filePath)] = '';\n  } catch (error) {\n    process.nextTick(() => writeStream.emit('error', error));\n  }\n  return writeStream;\n});\nfs.createWriteStream.mock.returned = [];\n\nfs.__setMockFilesystem = object => (filesystem = object);\n\nconst watcherListByPath = new Map();\n\nfs.watch.mockImplementation((filename, options, listener) => {\n  if (options.recursive) {\n    throw new Error('recursive watch not implemented');\n  }\n  let watcherList = watcherListByPath.get(filename);\n  if (watcherList == null) {\n    watcherList = [];\n    watcherListByPath.set(filename, watcherList);\n  }\n  const fsWatcher = new EventEmitter();\n  fsWatcher.on('change', listener);\n  fsWatcher.close = () => {\n    watcherList.splice(watcherList.indexOf(fsWatcher), 1);\n    fsWatcher.close = () => {\n      throw new Error('FSWatcher is already closed');\n    };\n  };\n  watcherList.push(fsWatcher);\n});\n\nfs.__triggerWatchEvent = (eventType, filename) => {\n  const directWatchers = watcherListByPath.get(filename) || [];\n  directWatchers.forEach(wtc => wtc.emit('change', eventType));\n  const dirPath = path.dirname(filename);\n  const dirWatchers = watcherListByPath.get(dirPath) || [];\n  dirWatchers.forEach(wtc =>\n    wtc.emit('change', eventType, path.relative(dirPath, filename)),\n  );\n};\n\nfunction getToNode(filepath) {\n  // Ignore the drive for Windows paths.\n  if (filepath.match(/^[a-zA-Z]:\\\\/)) {\n    filepath = filepath.substring(2);\n  }\n\n  if (filepath.endsWith(path.sep)) {\n    filepath = filepath.slice(0, -1);\n  }\n  const parts = filepath.split(/[\\/\\\\]/);\n  if (parts[0] !== '') {\n    throw new Error('Make sure all paths are absolute.');\n  }\n  let node = filesystem;\n  parts.slice(1).forEach(part => {\n    if (node && node.SYMLINK) {\n      node = getToNode(node.SYMLINK);\n    }\n    node = node[part];\n    if (node == null) {\n      const err = new Error(\n        `ENOENT: no such file or directory: \\`${filepath}\\``,\n      );\n      err.code = 'ENOENT';\n      throw err;\n    }\n  });\n\n  return node;\n}\n\nmodule.exports = fs;\n"
  },
  {
    "path": "local-cli/__tests__/fs-mock-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n * @flow\n * @format\n */\n\n'use strict';\n\ndeclare var jest: any;\ndeclare var describe: any;\ndeclare var beforeEach: any;\ndeclare var expect: any;\ndeclare var it: any;\n\njest.mock('fs');\n\nconst fs = require('fs');\n\ndescribe('fs mock', () => {\n  beforeEach(() => {\n    (fs: $FlowFixMe).mock.clear();\n  });\n\n  describe('writeFileSync()', () => {\n    it('stores content correctly', () => {\n      fs.writeFileSync('/test', 'foobar', 'utf8');\n      const content = fs.readFileSync('/test', 'utf8');\n      /* $FlowFixMe(>=0.56.0 site=react_native_oss) This comment suppresses an\n       * error found when Flow v0.56 was deployed. To see the error delete this\n       * comment and run Flow. */\n      expect(content).toEqual('foobar');\n    });\n\n    it('fails on missing path', () => {\n      /* $FlowFixMe(>=0.56.0 site=react_native_oss) This comment suppresses an\n       * error found when Flow v0.56 was deployed. To see the error delete this\n       * comment and run Flow. */\n      expect(() =>\n        fs.writeFileSync('/dir/test', 'foobar', 'utf8'),\n      ).toThrowError('ENOENT: no such file or directory');\n    });\n\n    it('properly normalizes paths', () => {\n      fs.writeFileSync('/test/foo/../bar/../../tadam', 'beep', 'utf8');\n      const content = fs.readFileSync('/glo/../tadam', 'utf8');\n      expect(content).toEqual('beep');\n    });\n  });\n\n  describe('mkdirSync()', () => {\n    it('creates folders that we can write files in', () => {\n      fs.mkdirSync('/dir', 0o777);\n      fs.writeFileSync('/dir/test', 'foobar', 'utf8');\n      const content = fs.readFileSync('/dir/test', 'utf8');\n      /* $FlowFixMe(>=0.56.0 site=react_native_oss) This comment suppresses an\n       * error found when Flow v0.56 was deployed. To see the error delete this\n       * comment and run Flow. */\n      expect(content).toEqual('foobar');\n    });\n\n    it('does not erase directories', () => {\n      fs.mkdirSync('/dir', 0o777);\n      fs.writeFileSync('/dir/test', 'foobar', 'utf8');\n      fs.mkdirSync('/dir', 0o777);\n      const content = fs.readFileSync('/dir/test', 'utf8');\n      /* $FlowFixMe(>=0.56.0 site=react_native_oss) This comment suppresses an\n       * error found when Flow v0.56 was deployed. To see the error delete this\n       * comment and run Flow. */\n      expect(content).toEqual('foobar');\n    });\n  });\n\n  describe('createWriteStream()', () => {\n    it('writes content', done => {\n      const stream = fs.createWriteStream('/test');\n      stream.write('hello, ');\n      stream.write('world');\n      stream.end('!');\n      process.nextTick(() => {\n        const content = fs.readFileSync('/test', 'utf8');\n        expect(content).toEqual('hello, world!');\n        done();\n      });\n    });\n  });\n\n  describe('writeSync()', () => {\n    it('writes content', () => {\n      const fd = fs.openSync('/test', 'w');\n      fs.writeSync(fd, 'hello, world!');\n      fs.closeSync(fd);\n      const content = fs.readFileSync('/test', 'utf8');\n      expect(content).toEqual('hello, world!');\n    });\n  });\n});\n"
  },
  {
    "path": "local-cli/bundle/__mocks__/sign.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nfunction sign(source) {\n  return source;\n}\n\nmodule.exports = sign;\n"
  },
  {
    "path": "local-cli/bundle/__tests__/filterPlatformAssetScales-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n */\n'use strict';\n\njest\n  .dontMock('../filterPlatformAssetScales')\n  .dontMock('../assetPathUtils');\n\nconst filterPlatformAssetScales = require('../filterPlatformAssetScales');\n\ndescribe('filterPlatformAssetScales', () => {\n  it('removes everything but 2x and 3x for iOS', () => {\n    expect(filterPlatformAssetScales('ios', [1, 1.5, 2, 3, 4])).toEqual([1, 2, 3]);\n    expect(filterPlatformAssetScales('ios', [3, 4])).toEqual([3]);\n  });\n\n  it('keeps closest largest one if nothing matches', () => {\n    expect(filterPlatformAssetScales('ios', [0.5, 4, 100])).toEqual([4]);\n    expect(filterPlatformAssetScales('ios', [0.5, 100])).toEqual([100]);\n    expect(filterPlatformAssetScales('ios', [0.5])).toEqual([0.5]);\n    expect(filterPlatformAssetScales('ios', [])).toEqual([]);\n  });\n\n  it('keeps all scales for unknown platform', () => {\n    expect(filterPlatformAssetScales('freebsd', [1, 1.5, 2, 3.7])).toEqual([1, 1.5, 2, 3.7]);\n  });\n});\n"
  },
  {
    "path": "local-cli/bundle/__tests__/getAssetDestPathAndroid-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n */\n'use strict';\n\njest\n  .dontMock('../getAssetDestPathAndroid')\n  .dontMock('../assetPathUtils');\n\nconst getAssetDestPathAndroid = require('../getAssetDestPathAndroid');\n\ndescribe('getAssetDestPathAndroid', () => {\n  it('should use the right destination folder', () => {\n    const asset = {\n      name: 'icon',\n      type: 'png',\n      httpServerLocation: '/assets/test',\n    };\n\n    const expectDestPathForScaleToStartWith = (scale, path) => {\n      if (!getAssetDestPathAndroid(asset, scale).startsWith(path)) {\n        throw new Error(`asset for scale ${scale} should start with path '${path}'`);\n      }\n    };\n\n    expectDestPathForScaleToStartWith(1, 'drawable-mdpi');\n    expectDestPathForScaleToStartWith(1.5, 'drawable-hdpi');\n    expectDestPathForScaleToStartWith(2, 'drawable-xhdpi');\n    expectDestPathForScaleToStartWith(3, 'drawable-xxhdpi');\n    expectDestPathForScaleToStartWith(4, 'drawable-xxxhdpi');\n  });\n\n  it('should lowercase path', () => {\n    const asset = {\n      name: 'Icon',\n      type: 'png',\n      httpServerLocation: '/assets/App/Test',\n    };\n\n    expect(getAssetDestPathAndroid(asset, 1)).toBe(\n      'drawable-mdpi/app_test_icon.png'\n    );\n  });\n\n  it('should remove `assets/` prefix', () => {\n    const asset = {\n      name: 'icon',\n      type: 'png',\n      httpServerLocation: '/assets/RKJSModules/Apps/AndroidSample/Assets',\n    };\n\n    expect(\n      getAssetDestPathAndroid(asset, 1).startsWith('assets_')\n    ).toBeFalsy();\n  });\n\n  it('should put non-drawable resources to `raw/`', () => {\n    const asset = {\n      name: 'video',\n      type: 'mp4',\n      httpServerLocation: '/assets/app/test',\n    };\n\n    expect(getAssetDestPathAndroid(asset, 1)).toBe(\n      'raw/app_test_video.mp4'\n    );\n  });\n});\n"
  },
  {
    "path": "local-cli/bundle/__tests__/getAssetDestPathIOS-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n */\n'use strict';\n\njest.dontMock('../getAssetDestPathIOS');\n\nconst getAssetDestPathIOS = require('../getAssetDestPathIOS');\n\ndescribe('getAssetDestPathIOS', () => {\n  it('should build correct path', () => {\n    const asset = {\n      name: 'icon',\n      type: 'png',\n      httpServerLocation: '/assets/test',\n    };\n\n    expect(getAssetDestPathIOS(asset, 1)).toBe('assets/test/icon.png');\n  });\n\n  it('should consider scale', () => {\n    const asset = {\n      name: 'icon',\n      type: 'png',\n      httpServerLocation: '/assets/test',\n    };\n\n    expect(getAssetDestPathIOS(asset, 2)).toBe('assets/test/icon@2x.png');\n    expect(getAssetDestPathIOS(asset, 3)).toBe('assets/test/icon@3x.png');\n  });\n});\n"
  },
  {
    "path": "local-cli/bundle/assetPathUtils.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\n'use strict';\n\nimport type {PackagerAsset} from '../../Libraries/Image/AssetRegistry';\n\n/**\n * FIXME: using number to represent discrete scale numbers is fragile in essence because of\n * floating point numbers imprecision.\n */\nfunction getAndroidAssetSuffix(scale: number): string {\n  switch (scale) {\n    case 0.75: return 'ldpi';\n    case 1: return 'mdpi';\n    case 1.5: return 'hdpi';\n    case 2: return 'xhdpi';\n    case 3: return 'xxhdpi';\n    case 4: return 'xxxhdpi';\n  }\n  throw new Error('no such scale');\n}\n\n// See https://developer.android.com/guide/topics/resources/drawable-resource.html\nconst drawableFileTypes = new Set([\n  'gif',\n  'jpeg',\n  'jpg',\n  'png',\n  'svg',\n  'webp',\n  'xml',\n]);\n\nfunction getAndroidResourceFolderName(asset: PackagerAsset, scale: number) {\n  if (!drawableFileTypes.has(asset.type)) {\n    return 'raw';\n  }\n  var suffix = getAndroidAssetSuffix(scale);\n  if (!suffix) {\n    throw new Error(\n      'Don\\'t know which android drawable suffix to use for asset: ' +\n      JSON.stringify(asset)\n    );\n  }\n  const androidFolder = 'drawable-' + suffix;\n  return androidFolder;\n}\n\nfunction getAndroidResourceIdentifier(asset: PackagerAsset) {\n  var folderPath = getBasePath(asset);\n  return (folderPath + '/' + asset.name)\n    .toLowerCase()\n    .replace(/\\//g, '_')           // Encode folder structure in file name\n    .replace(/([^a-z0-9_])/g, '')  // Remove illegal chars\n    .replace(/^assets_/, '');      // Remove \"assets_\" prefix\n}\n\nfunction getBasePath(asset: PackagerAsset) {\n  var basePath = asset.httpServerLocation;\n  if (basePath[0] === '/') {\n    basePath = basePath.substr(1);\n  }\n  return basePath;\n}\n\nmodule.exports = {\n  getAndroidAssetSuffix: getAndroidAssetSuffix,\n  getAndroidResourceFolderName: getAndroidResourceFolderName,\n  getAndroidResourceIdentifier: getAndroidResourceIdentifier,\n  getBasePath: getBasePath\n};\n"
  },
  {
    "path": "local-cli/bundle/buildBundle.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\n'use strict';\n\nconst log = require('../util/log').out('bundle');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst Server = require('metro/src/Server');\nconst {Terminal} = require('metro-core');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst TerminalReporter = require('metro/src/lib/TerminalReporter');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst TransformCaching = require('metro/src/lib/TransformCaching');\n\nconst {defaults} = require('metro');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst outputBundle = require('metro/src/shared/output/bundle');\nconst path = require('path');\nconst saveAssets = require('./saveAssets');\n\nconst {ASSET_REGISTRY_PATH} = require('../core/Constants');\n\nimport type {RequestOptions, OutputOptions} from './types.flow';\nimport type {ConfigT} from 'metro';\n\nconst defaultAssetExts = defaults.assetExts;\nconst defaultSourceExts = defaults.sourceExts;\nconst defaultPlatforms = defaults.platforms;\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst defaultProvidesModuleNodeModules = defaults.providesModuleNodeModules;\n\nasync function buildBundle(\n  args: OutputOptions & {\n    assetsDest: mixed,\n    entryFile: string,\n    maxWorkers: number,\n    resetCache: boolean,\n    transformer: string,\n  },\n  config: ConfigT,\n  output = outputBundle,\n  packagerInstance,\n) {\n  // This is used by a bazillion of npm modules we don't control so we don't\n  // have other choice than defining it as an env variable here.\n  process.env.NODE_ENV = args.dev ? 'development' : 'production';\n\n  let sourceMapUrl = args.sourcemapOutput;\n  if (sourceMapUrl && !args.sourcemapUseAbsolutePath) {\n    sourceMapUrl = path.basename(sourceMapUrl);\n  }\n\n  const requestOpts: RequestOptions = {\n    entryFile: args.entryFile,\n    sourceMapUrl,\n    dev: args.dev,\n    minify: !args.dev,\n    platform: args.platform,\n  };\n\n  // If a packager instance was not provided, then just create one for this\n  // bundle command and close it down afterwards.\n  var shouldClosePackager = false;\n  if (!packagerInstance) {\n    const assetExts = (config.getAssetExts && config.getAssetExts()) || [];\n    const sourceExts = (config.getSourceExts && config.getSourceExts()) || [];\n    const platforms = (config.getPlatforms && config.getPlatforms()) || [];\n\n    const transformModulePath = args.transformer\n      ? path.resolve(args.transformer)\n      : config.getTransformModulePath();\n\n    const providesModuleNodeModules =\n      typeof config.getProvidesModuleNodeModules === 'function'\n        ? config.getProvidesModuleNodeModules()\n        : defaultProvidesModuleNodeModules;\n\n    const terminal = new Terminal(process.stdout);\n    const options = {\n      assetExts: defaultAssetExts.concat(assetExts),\n      assetRegistryPath: ASSET_REGISTRY_PATH,\n      blacklistRE: config.getBlacklistRE(args.platform),\n      extraNodeModules: config.extraNodeModules,\n      getModulesRunBeforeMainModule: config.getModulesRunBeforeMainModule,\n      getPolyfills: config.getPolyfills,\n      getTransformOptions: config.getTransformOptions,\n      globalTransformCache: null,\n      hasteImpl: config.hasteImpl,\n      maxWorkers: args.maxWorkers,\n      platforms: defaultPlatforms.concat(platforms),\n      postMinifyProcess: config.postMinifyProcess,\n      postProcessModules: config.postProcessModules,\n      postProcessBundleSourcemap: config.postProcessBundleSourcemap,\n      projectRoots: config.getProjectRoots(),\n      providesModuleNodeModules: providesModuleNodeModules,\n      resetCache: args.resetCache,\n      reporter: new TerminalReporter(terminal),\n      sourceExts: defaultSourceExts.concat(sourceExts),\n      transformCache: TransformCaching.useTempDir(),\n      transformModulePath: transformModulePath,\n      watch: false,\n      workerPath: config.getWorkerPath && config.getWorkerPath(),\n    };\n\n    packagerInstance = new Server(options);\n    shouldClosePackager = true;\n  }\n\n  const bundle = await output.build(packagerInstance, requestOpts);\n\n  await output.save(bundle, args, log);\n\n  // Save the assets of the bundle\n  const outputAssets = await packagerInstance.getAssets({\n    ...Server.DEFAULT_BUNDLE_OPTIONS,\n    ...requestOpts,\n    bundleType: 'todo',\n  });\n\n  // When we're done saving bundle output and the assets, we're done.\n  const assets = await saveAssets(\n    outputAssets,\n    args.platform,\n    args.assetsDest,\n  );\n\n  if (shouldClosePackager) {\n    packagerInstance.end();\n  }\n\n  return assets;\n}\n\nmodule.exports = buildBundle;\n"
  },
  {
    "path": "local-cli/bundle/bundle.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst buildBundle = require('./buildBundle');\nconst bundleCommandLineArgs = require('./bundleCommandLineArgs');\nconst outputBundle = require('metro/src/shared/output/bundle');\n\n/**\n * Builds the bundle starting to look for dependencies at the given entry path.\n */\nfunction bundleWithOutput(argv, config, args, output, packagerInstance) {\n  if (!output) {\n    output = outputBundle;\n  }\n  return buildBundle(args, config, output, packagerInstance);\n}\n\nfunction bundle(argv, config, args, packagerInstance) {\n  return bundleWithOutput(argv, config, args, undefined, packagerInstance);\n}\n\nmodule.exports = {\n  name: 'bundle',\n  description: 'builds the javascript bundle for offline use',\n  func: bundle,\n  options: bundleCommandLineArgs,\n\n  // not used by the CLI itself\n  withOutput: bundleWithOutput,\n};\n"
  },
  {
    "path": "local-cli/bundle/bundleCommandLineArgs.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nmodule.exports = [\n  {\n    command: '--entry-file <path>',\n    description: 'Path to the root JS file, either absolute or relative to JS root',\n  }, {\n    command: '--platform [string]',\n    description: 'Either \"ios\" or \"android\"',\n    default: 'ios',\n  }, {\n    command: '--transformer [string]',\n    description: 'Specify a custom transformer to be used',\n  }, {\n    command: '--dev [boolean]',\n    description: 'If false, warnings are disabled and the bundle is minified',\n    parse: (val) => val === 'false' ? false : true,\n    default: true,\n  }, {\n    command: '--bundle-output <string>',\n    description: 'File name where to store the resulting bundle, ex. /tmp/groups.bundle',\n  }, {\n    command: '--bundle-encoding [string]',\n    description: 'Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer).',\n    default: 'utf8',\n  }, {\n    command: '--max-workers [number]',\n    description: 'Specifies the maximum number of workers the worker-pool ' +\n      'will spawn for transforming files. This defaults to the number of the ' +\n      'cores available on your machine.',\n    parse: (workers: string) => Number(workers),\n  }, {\n    command: '--sourcemap-output [string]',\n    description: 'File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map',\n  }, {\n    command: '--sourcemap-sources-root [string]',\n    description: 'Path to make sourcemap\\'s sources entries relative to, ex. /root/dir',\n  }, {\n    command: '--sourcemap-use-absolute-path',\n    description: 'Report SourceMapURL using its full path',\n    default: false,\n  }, {\n    command: '--assets-dest [string]',\n    description: 'Directory name where to store assets referenced in the bundle',\n  }, {\n    command: '--verbose',\n    description: 'Enables logging',\n    default: false,\n  }, {\n    command: '--reset-cache',\n    description: 'Removes cached files',\n    default: false,\n  }, {\n    command: '--read-global-cache',\n    description: 'Try to fetch transformed JS code from the global cache, if configured.',\n    default: false,\n  },\n];\n"
  },
  {
    "path": "local-cli/bundle/filterPlatformAssetScales.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nconst ALLOWED_SCALES = {\n  ios: [1, 2, 3],\n};\n\nfunction filterPlatformAssetScales(\n  platform: string,\n  scales: $ReadOnlyArray<number>,\n): $ReadOnlyArray<number> {\n  const whitelist = ALLOWED_SCALES[platform];\n  if (!whitelist) {\n    return scales;\n  }\n  const result = scales.filter(scale => whitelist.indexOf(scale) > -1);\n  if (result.length === 0 && scales.length > 0) {\n    // No matching scale found, but there are some available. Ideally we don't\n    // want to be in this situation and should throw, but for now as a fallback\n    // let's just use the closest larger image\n    const maxScale = whitelist[whitelist.length - 1];\n    for (const scale of scales) {\n      if (scale > maxScale) {\n        result.push(scale);\n        break;\n      }\n    }\n\n    // There is no larger scales available, use the largest we have\n    if (result.length === 0) {\n      result.push(scales[scales.length - 1]);\n    }\n  }\n  return result;\n}\n\nmodule.exports = filterPlatformAssetScales;\n"
  },
  {
    "path": "local-cli/bundle/getAssetDestPathAndroid.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\n'use strict';\n\nconst assetPathUtils = require('./assetPathUtils');\nconst path = require('path');\n\nimport type {PackagerAsset} from '../../Libraries/Image/AssetRegistry';\n\nfunction getAssetDestPathAndroid(asset: PackagerAsset, scale: number): string {\n  const androidFolder = assetPathUtils.getAndroidResourceFolderName(asset, scale);\n  const fileName =  assetPathUtils.getAndroidResourceIdentifier(asset);\n  return path.join(androidFolder, fileName + '.' + asset.type);\n}\n\nmodule.exports = getAssetDestPathAndroid;\n"
  },
  {
    "path": "local-cli/bundle/getAssetDestPathIOS.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\n'use strict';\n\nconst path = require('path');\n\nimport type {PackagerAsset} from '../../Libraries/Image/AssetRegistry';\n\nfunction getAssetDestPathIOS(asset: PackagerAsset, scale: number): string {\n  const suffix = scale === 1 ? '' : '@' + scale + 'x';\n  const fileName = asset.name + suffix + '.' + asset.type;\n  return path.join(asset.httpServerLocation.substr(1), fileName);\n}\n\nmodule.exports = getAssetDestPathIOS;\n"
  },
  {
    "path": "local-cli/bundle/saveAssets.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst filterPlatformAssetScales = require('./filterPlatformAssetScales');\nconst fs = require('fs');\nconst getAssetDestPathAndroid = require('./getAssetDestPathAndroid');\nconst getAssetDestPathIOS = require('./getAssetDestPathIOS');\nconst log = require('../util/log').out('bundle');\nconst mkdirp = require('mkdirp');\nconst path = require('path');\n\nfunction saveAssets(\n  assets,\n  platform,\n  assetsDest\n) {\n  if (!assetsDest) {\n    console.warn('Assets destination folder is not set, skipping...');\n    return Promise.resolve();\n  }\n\n  const getAssetDestPath = platform === 'android'\n    ? getAssetDestPathAndroid\n    : getAssetDestPathIOS;\n\n  const filesToCopy = Object.create(null); // Map src -> dest\n  assets\n    .forEach(asset => {\n      const validScales = new Set(filterPlatformAssetScales(platform, asset.scales));\n      asset.scales.forEach((scale, idx) => {\n        if (!validScales.has(scale)) {\n          return;\n        }\n        const src = asset.files[idx];\n        const dest = path.join(assetsDest, getAssetDestPath(asset, scale));\n        filesToCopy[src] = dest;\n      });\n    });\n\n  return copyAll(filesToCopy);\n}\n\nfunction copyAll(filesToCopy) {\n  const queue = Object.keys(filesToCopy);\n  if (queue.length === 0) {\n    return Promise.resolve();\n  }\n\n  log('Copying ' + queue.length + ' asset files');\n  return new Promise((resolve, reject) => {\n    const copyNext = (error) => {\n      if (error) {\n        return reject(error);\n      }\n      if (queue.length === 0) {\n        log('Done copying assets');\n        resolve();\n      } else {\n        const src = queue.shift();\n        const dest = filesToCopy[src];\n        copy(src, dest, copyNext);\n      }\n    };\n    copyNext();\n  });\n}\n\nfunction copy(src, dest, callback) {\n  const destDir = path.dirname(dest);\n  mkdirp(destDir, err => {\n    if (err) {\n      return callback(err);\n    }\n    fs.createReadStream(src)\n      .pipe(fs.createWriteStream(dest))\n      .on('finish', callback);\n  });\n}\n\nmodule.exports = saveAssets;\n"
  },
  {
    "path": "local-cli/bundle/types.flow.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nexport type {OutputOptions, RequestOptions} from 'metro/src/shared/types.flow';\n"
  },
  {
    "path": "local-cli/bundle/unbundle.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst bundleWithOutput = require('./bundle').withOutput;\nconst bundleCommandLineArgs = require('./bundleCommandLineArgs');\nconst outputUnbundle = require('metro/src/shared/output/unbundle');\n\n/**\n * Builds the bundle starting to look for dependencies at the given entry path.\n */\nfunction unbundle(argv, config, args, packagerInstance) {\n  return bundleWithOutput(argv, config, args, outputUnbundle, packagerInstance);\n}\n\nmodule.exports = {\n  name: 'unbundle',\n  description: 'builds javascript as \"unbundle\" for offline use',\n  func: unbundle,\n  options: bundleCommandLineArgs.concat({\n    command: '--indexed-unbundle',\n    description: 'Force indexed unbundle file format, even when building for android',\n    default: false,\n  }),\n};\n"
  },
  {
    "path": "local-cli/cli.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\n// gracefulify() has to be called before anything else runs\nrequire('graceful-fs').gracefulify(require('fs'));\n\n// This file must be able to run in node 0.12 without babel so we can show that\n// it is not supported. This is why the rest of the cli code is in `cliEntry.js`.\nrequire('./server/checkNodeVersion')();\n\nrequire('../setupBabel')();\n\nvar cliEntry = require('./cliEntry');\n\nif (require.main === module) {\n  cliEntry.run();\n}\n\nmodule.exports = cliEntry;\n"
  },
  {
    "path": "local-cli/cliEntry.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\nconst config = require('./core');\n\nconst assertRequiredOptions = require('./util/assertRequiredOptions');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst chalk = require('chalk');\nconst childProcess = require('child_process');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst commander = require('commander');\nconst commands = require('./commands');\nconst init = require('./init/init');\nconst path = require('path');\nconst pkg = require('../package.json');\n\nimport type {CommandT} from './commands';\nimport type {RNConfig} from './core';\n\ncommander.version(pkg.version);\n\nconst defaultOptParser = (val) => val;\n\nconst handleError = (err) => {\n  console.error();\n  console.error(err.message || err);\n  console.error();\n  process.exit(1);\n};\n\n// Custom printHelpInformation command inspired by internal Commander.js\n// one modified to suit our needs\nfunction printHelpInformation() {\n  let cmdName = this._name;\n  if (this._alias) {\n    cmdName = cmdName + '|' + this._alias;\n  }\n\n  const sourceInformation = this.pkg\n    ? [\n      `  ${chalk.bold('Source:')} ${this.pkg.name}@${this.pkg.version}`,\n      '',\n    ]\n    : [];\n\n  let output = [\n    '',\n    chalk.bold(chalk.cyan((`  react-native ${cmdName} ${this.usage()}`))),\n    `  ${this._description}`,\n    '',\n    ...sourceInformation,\n    `  ${chalk.bold('Options:')}`,\n    '',\n    this.optionHelp().replace(/^/gm, '    '),\n    '',\n  ];\n\n  if (this.examples && this.examples.length > 0) {\n    const formattedUsage = this.examples.map(\n      example => `    ${example.desc}: \\n    ${chalk.cyan(example.cmd)}`,\n    ).join('\\n\\n');\n\n    output = output.concat([\n      chalk.bold('  Example usage:'),\n      '',\n      formattedUsage,\n    ]);\n  }\n\n  return output.concat([\n    '',\n    '',\n  ]).join('\\n');\n}\n\nfunction printUnknownCommand(cmdName) {\n  console.log([\n    '',\n    cmdName\n      ? chalk.red(`  Unrecognized command '${cmdName}'`)\n      : chalk.red('  You didn\\'t pass any command'),\n    `  Run ${chalk.cyan('react-native --help')} to see list of all available commands`,\n    '',\n  ].join('\\n'));\n}\n\nconst addCommand = (command: CommandT, cfg: RNConfig) => {\n  const options = command.options || [];\n\n  const cmd = commander\n    .command(command.name, undefined, {\n      noHelp: !command.description,\n    })\n    .description(command.description)\n    .action(function runAction() {\n      const passedOptions = this.opts();\n      const argv: Array<string> = Array.from(arguments).slice(0, -1);\n\n      Promise.resolve()\n        .then(() => {\n          assertRequiredOptions(options, passedOptions);\n          return command.func(argv, cfg, passedOptions);\n        })\n        .catch(handleError);\n    });\n\n    cmd.helpInformation = printHelpInformation.bind(cmd);\n    cmd.examples = command.examples;\n    cmd.pkg = command.pkg;\n\n  options\n    .forEach(opt => cmd.option(\n      opt.command,\n      opt.description,\n      opt.parse || defaultOptParser,\n      typeof opt.default === 'function' ? opt.default(cfg) : opt.default,\n    ));\n\n  // Placeholder option for --config, which is parsed before any other option,\n  // but needs to be here to avoid \"unknown option\" errors when specified\n  cmd.option('--config [string]', 'Path to the CLI configuration file');\n};\n\nfunction run() {\n  const setupEnvScript = /^win/.test(process.platform)\n    ? 'setup_env.bat'\n    : 'setup_env.sh';\n\n  childProcess.execFileSync(path.join(__dirname, setupEnvScript));\n\n  commands.forEach(cmd => addCommand(cmd, config));\n\n  commander.parse(process.argv);\n\n  const isValidCommand = commands.find(cmd => cmd.name.split(' ')[0] === process.argv[2]);\n\n  if (!isValidCommand) {\n    printUnknownCommand(process.argv[2]);\n    return;\n  }\n\n  if (!commander.args.length) {\n    commander.help();\n  }\n}\n\nmodule.exports = {\n  run: run,\n  init: init,\n};\n"
  },
  {
    "path": "local-cli/commands.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\nconst { getProjectCommands } = require('./core');\n\nimport type { RNConfig } from './core';\n\nexport type CommandT = {\n  name: string,\n  description?: string,\n  usage?: string,\n  func: (argv: Array<string>, config: RNConfig, args: Object) => ?Promise<void>,\n  options?: Array<{\n    command: string,\n    description?: string,\n    parse?: (val: string) => any,\n    default?: ((config: RNConfig) => mixed) | mixed,\n  }>,\n  examples?: Array<{\n    desc: string,\n    cmd: string,\n  }>,\n  pkg?: {\n    version: string,\n    name: string,\n  },\n};\n\nconst documentedCommands = [\n  require('./server/server'),\n  require('./runIOS/runIOS'),\n  require('./runAndroid/runAndroid'),\n  require('./runMacOS/runMacOS'),\n  require('./library/library'),\n  require('./bundle/bundle'),\n  require('./bundle/unbundle'),\n  require('./eject/eject'),\n  require('./link/link'),\n  require('./link/unlink'),\n  require('./install/install'),\n  require('./install/uninstall'),\n  require('./upgrade/upgrade'),\n  require('./logAndroid/logAndroid'),\n  require('./logIOS/logIOS'),\n  require('./dependencies/dependencies'),\n  require('./info/info'),\n];\n\n// The user should never get here because projects are inited by\n// using `react-native-cli` from outside a project directory.\nconst undocumentedCommands = [\n  {\n    name: 'init',\n    func: () => {\n      console.log([\n        'Looks like React Native project already exists in the current',\n        'folder. Run this command from a different folder or remove node_modules/react-native',\n      ].join('\\n'));\n    },\n  },\n];\n\nconst commands: Array<CommandT> = [\n  ...documentedCommands,\n  ...undocumentedCommands,\n  ...getProjectCommands(),\n];\n\nmodule.exports = commands;\n"
  },
  {
    "path": "local-cli/core/Constants.js",
    "content": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nconst ASSET_REGISTRY_PATH = 'react-native-macos/Libraries/Image/AssetRegistry';\nconst ASSET_SOURCE_RESOLVER_PATH =\n  'react-native-macos/Libraries/Image/AssetSourceResolver';\n\nmodule.exports = {\n  ASSET_REGISTRY_PATH,\n  ASSET_SOURCE_RESOLVER_PATH,\n};\n"
  },
  {
    "path": "local-cli/core/__fixtures__/android.js",
    "content": "const fs = require.requireActual('fs');\nconst path = require('path');\n\nconst manifest = fs.readFileSync(path.join(__dirname, './files/AndroidManifest.xml'));\nconst mainJavaClass = fs.readFileSync(path.join(__dirname, './files/Main.java'));\n\nfunction generateValidFileStructure(classFileName) {\n  return {\n    src: {\n      'AndroidManifest.xml': manifest,\n      main: {\n        com: {\n          some: {\n            example: {\n              'Main.java': mainJavaClass,\n              [classFileName]: fs.readFileSync(path.join(__dirname, `./files/${classFileName}`)),\n            },\n          },\n        },\n      },\n    },\n  };\n}\n\nexports.valid = generateValidFileStructure('ReactPackage.java');\n\nexports.validKotlin = generateValidFileStructure('ReactPackage.kt');\n\nexports.userConfigManifest = {\n  src: {\n    main: {\n      'AndroidManifest.xml': manifest,\n      com: {\n        some: {\n          example: {\n            'Main.java': mainJavaClass,\n            'ReactPackage.java': fs.readFileSync(path.join(__dirname, './files/ReactPackage.java')),\n          },\n        },\n      },\n    },\n    debug: {\n      'AndroidManifest.xml': fs.readFileSync(path.join(__dirname, './files/AndroidManifest-debug.xml')),\n    },\n  },\n};\n\nexports.corrupted = {\n  src: {\n    'AndroidManifest.xml': manifest,\n    main: {\n      com: {\n        some: {\n          example: {},\n        },\n      },\n    },\n  },\n};\n\nexports.noPackage = {\n  src: {\n    'AndroidManifest.xml': manifest,\n    main: {\n      com: {\n        some: {\n          example: {\n            'Main.java': mainJavaClass,\n          },\n        },\n      },\n    },\n  },\n};\n"
  },
  {
    "path": "local-cli/core/__fixtures__/commands.js",
    "content": "exports.single = {\n  func: () => {},\n  description: 'Test action',\n  name: 'test',\n};\n\nexports.multiple = [{\n  func: () => {},\n  description: 'Test action #1',\n  name: 'test1',\n}, {\n  func: () => {},\n  description: 'Test action #2',\n  name: 'test2',\n}];\n"
  },
  {
    "path": "local-cli/core/__fixtures__/dependencies.js",
    "content": "const fs = require.requireActual('fs');\nconst path = require('path');\nconst android = require('./android');\n\nconst pjson = fs.readFileSync(path.join(__dirname, 'files', 'package.json'));\n\nmodule.exports = {\n  valid: {\n    'package.json': pjson,\n    android: android.valid,\n  },\n  withAssets: {\n    'package.json': pjson,\n    android: android.valid,\n    fonts: {\n      'A.ttf': '',\n      'B.ttf': '',\n    },\n    images: {\n      'C.jpg': '',\n    },\n  },\n  noPackage: {\n    'package.json': pjson,\n    android: android.noPackage,\n  },\n};\n"
  },
  {
    "path": "local-cli/core/__fixtures__/files/AndroidManifest-debug.xml",
    "content": "<manifest\n  xmlns:android=\"http://schemas.android.com/apk/res/android\">\n</manifest>\n"
  },
  {
    "path": "local-cli/core/__fixtures__/files/AndroidManifest.xml",
    "content": "<manifest\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  package=\"com.some.example\">\n</manifest>\n"
  },
  {
    "path": "local-cli/core/__fixtures__/files/Main.java",
    "content": "package com.some.example;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class SomeExamplePackage {}\n"
  },
  {
    "path": "local-cli/core/__fixtures__/files/ReactPackage.java",
    "content": "package com.some.example;\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class SomeExampleJavaPackage implements ReactPackage {\n\n  @Override\n  public List<NativeModule> createNativeModules(\n      ReactApplicationContext reactContext) {\n    List<NativeModule> modules = new ArrayList<>();\n    modules.add(new SomeExampleModule(reactContext));\n    return modules;\n  }\n\n  @Override\n  public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {\n    return Collections.emptyList();\n  }\n}\n"
  },
  {
    "path": "local-cli/core/__fixtures__/files/ReactPackage.kt",
    "content": "package com.some.example;\n\nimport android.view.View\nimport com.facebook.react.ReactPackage\nimport com.facebook.react.bridge.NativeModule\nimport com.facebook.react.bridge.ReactApplicationContext\nimport com.facebook.react.uimanager.ReactShadowNode\nimport com.facebook.react.uimanager.ViewManager\nimport java.util.*\n\nclass SomeExampleKotlinPackage : ReactPackage {\n\n    override fun createNativeModules(reactContext: ReactApplicationContext): MutableList<NativeModule>\n            = mutableListOf(MaterialPaletteModule(reactContext))\n\n    override fun createViewManagers(reactContext: ReactApplicationContext?):\n            MutableList<ViewManager<View, ReactShadowNode>> = Collections.emptyList()\n\n}\n"
  },
  {
    "path": "local-cli/core/__fixtures__/files/package.json",
    "content": "{\n  \"name\": \"react-native-vector-icons\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Customizable Icons for React Native with support for NavBar/TabBar, image source and full styling. Choose from 3000+ bundled icons or use your own.\",\n  \"main\": \"index.js\",\n  \"bin\": {\n    \"generate-icon\": \"./generate-icon.js\"\n  },\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"rm -rf {Fonts,Entypo.js,EvilIcons.js,FontAwesome.js,Foundation.js,Ionicons.js,MaterialIcons.js,Octicons.js,Zocial.js} && mkdir Fonts && npm run build-entypo && npm run build-evilicons && npm run build-fontawesome && npm run build-foundation && npm run build-ionicons && npm run build-materialicons && npm run build-octicons && npm run build-zocial\",\n    \"build-entypo\": \"mkdir -p tmp/svg && curl https://dl.dropboxusercontent.com/u/4339492/entypo.zip > tmp/entypo.zip && unzip -j tmp/entypo.zip *.svg -x __MACOSX/* -d tmp/svg && fontcustom compile tmp/svg -o tmp -n Entypo -t css -h && node generate-icon tmp/Entypo.css --componentName=Entypo --fontFamily=Entypo > Entypo.js && cp tmp/Entypo.ttf Fonts && rm -rf {tmp,.fontcustom-manifest.json}\",\n    \"build-evilicons\": \"fontcustom compile node_modules/evil-icons/assets/icons -o tmp -n EvilIcons -t css -h && node generate-icon tmp/EvilIcons.css --prefix=.icon-ei- --componentName=EvilIcons --fontFamily=EvilIcons > EvilIcons.js && cp tmp/EvilIcons.ttf Fonts && rm -rf {tmp,.fontcustom-manifest.json}\",\n    \"build-fontawesome\": \"node generate-icon node_modules/font-awesome/css/font-awesome.css --prefix=.fa- --componentName=FontAwesome --fontFamily=FontAwesome > FontAwesome.js && cp node_modules/font-awesome/fonts/fontawesome-webfont.ttf Fonts/FontAwesome.ttf\",\n    \"build-foundation\": \"node generate-icon bower_components/foundation-icon-fonts/foundation-icons.css --prefix=.fi- --componentName=Foundation --fontFamily=fontcustom > Foundation.js && cp bower_components/foundation-icon-fonts/foundation-icons.ttf Fonts/Foundation.ttf\",\n    \"build-ionicons\": \"node generate-icon bower_components/ionicons/css/ionicons.css --prefix=.ion- --componentName=Ionicons --fontFamily=Ionicons > Ionicons.js && cp bower_components/ionicons/fonts/ionicons.ttf Fonts/Ionicons.ttf\",\n    \"build-materialicons\": \"mkdir -p tmp/svg && for f in ./node_modules/material-design-icons/*/svg/production/ic_*_48px.svg; do t=${f/*\\\\/ic_/}; t=${t/_48px/}; cp \\\"$f\\\" \\\"./tmp/svg/${t//_/-}\\\"; done && fontcustom compile tmp/svg -o tmp -n MaterialIcons -t css -h && node generate-icon tmp/MaterialIcons.css --componentName=MaterialIcons --fontFamily=MaterialIcons > MaterialIcons.js && cp tmp/MaterialIcons.ttf Fonts && rm -rf {tmp,.fontcustom-manifest.json}\",\n    \"build-octicons\": \"node generate-icon bower_components/octicons/octicons/octicons.css --prefix=.octicon- --componentName=Octicons --fontFamily=octicons > Octicons.js && cp bower_components/octicons/octicons/octicons.ttf Fonts/Octicons.ttf\",\n    \"build-zocial\": \"node generate-icon bower_components/css-social-buttons/css/zocial.css --prefix=.zocial. --componentName=Zocial --fontFamily=zocial > Zocial.js && cp bower_components/css-social-buttons/css/zocial.ttf Fonts/Zocial.ttf\"\n  },\n  \"keywords\": [\n    \"react-native\",\n    \"react-component\",\n    \"react-native-component\",\n    \"react\",\n    \"mobile\",\n    \"ios\",\n    \"android\",\n    \"ui\",\n    \"icon\",\n    \"icons\",\n    \"vector\",\n    \"retina\",\n    \"font\"\n  ],\n  \"author\": {\n    \"name\": \"Joel Arvidsson\",\n    \"email\": \"joel@oblador.se\"\n  },\n  \"homepage\": \"https://github.com/oblador/react-native-vector-icons\",\n  \"bugs\": {\n    \"url\": \"https://github.com/oblador/react-native-vector-icons/issues\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/oblador/react-native-vector-icons.git\"\n  },\n  \"license\": \"MIT\",\n  \"peerDependencies\": {\n    \"react-native\": \">=0.4.0 || 0.5.0-rc1 || 0.6.0-rc || 0.7.0-rc || 0.7.0-rc.2 || 0.8.0-rc || 0.8.0-rc.2 || 0.9.0-rc || 0.10.0-rc || 0.11.0-rc || 0.12.0-rc || 0.13.0-rc || 0.14.0-rc || 0.15.0-rc || 0.16.0-rc\"\n  },\n  \"dependencies\": {\n    \"lodash\": \"^4.17.5\",\n    \"yargs\": \"^3.30.0\",\n    \"rnpm-plugin-test\": \"*\"\n  },\n  \"devDependencies\": {\n    \"evil-icons\": \"^1.7.6\",\n    \"font-awesome\": \"^4.4.0\",\n    \"material-design-icons\": \"^2.1.1\"\n  }\n}\n"
  },
  {
    "path": "local-cli/core/__fixtures__/files/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n/* Begin PBXBuildFile section */\n\t\t00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };\n\t\t00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };\n\t\t00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };\n\t\t00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };\n\t\t00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };\n\t\t00E356F31AD99517003FC87E /* androidTestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* androidTestTests.m */; };\n\t\t133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };\n\t\t139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };\n\t\t139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };\n\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n\t\t13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };\n\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n\t\t146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };\n\t\t672DE8B31B124B8088D0D29F /* libBVLinearGradient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B5255B7628A54AC2A9B4B2A0 /* libBVLinearGradient.a */; };\n\t\t68FEB18F24414EF981BD7940 /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 53C67FE8F7294B7A83790610 /* libCodePush.a */; };\n\t\t832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };\n\t\tC6C437D070BA42D6BE39198B /* libRCTVideo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7396DFBAFA4CA092E367F5 /* libRCTVideo.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTActionSheet;\n\t\t};\n\t\t00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTGeolocation;\n\t\t};\n\t\t00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5115D1A9E6B3D00147676;\n\t\t\tremoteInfo = RCTImage;\n\t\t};\n\t\t00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B511DB1A9E6C8500147676;\n\t\t\tremoteInfo = RCTNetwork;\n\t\t};\n\t\t00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 832C81801AAF6DEF007FA2F7;\n\t\t\tremoteInfo = RCTVibration;\n\t\t};\n\t\t00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 13B07F861A680F5B00A75B9A;\n\t\t\tremoteInfo = androidTest;\n\t\t};\n\t\t139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTSettings;\n\t\t};\n\t\t139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3C86DF461ADF2C930047B81A;\n\t\t\tremoteInfo = RCTWebSocket;\n\t\t};\n\t\t146834031AC3E56700842450 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;\n\t\t\tremoteInfo = React;\n\t\t};\n\t\t78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTLinking;\n\t\t};\n\t\t832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5119B1A9E6C1200147676;\n\t\t\tremoteInfo = RCTText;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = \"<group>\"; };\n\t\t00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTActionSheet.xcodeproj; path = \"../node_modules/\n\t\tariesActionSheetIOS/RCTActionSheet.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTGeolocation.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesGeolocation/RCTGeolocation.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTImage.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesImage/RCTImage.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTNetwork.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesNetwork/RCTNetwork.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTVibration.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesVibration/RCTVibration.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00E356EE1AD99517003FC87E /* androidTestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = androidTestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t00E356F21AD99517003FC87E /* androidTestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = androidTestTests.m; sourceTree = \"<group>\"; };\n\t\t139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTSettings.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesSettings/RCTSettings.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTWebSocket.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesWebSocket/RCTWebSocket.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t13B07F961A680F5B00A75B9A /* androidTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = androidTest.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = androidTest/AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = androidTest/AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = \"<group>\"; };\n\t\t13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = androidTest/Images.xcassets; sourceTree = \"<group>\"; };\n\t\t13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = androidTest/Info.plist; sourceTree = \"<group>\"; };\n\t\t13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = androidTest/main.m; sourceTree = \"<group>\"; };\n\t\t146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = React.xcodeproj; path = \"../node_modules/react-native/React/React.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t53C67FE8F7294B7A83790610 /* libCodePush.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libCodePush.a; sourceTree = \"<group>\"; };\n\t\t78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTLinking.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesLinkingIOS/RCTLinking.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTText.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesText/RCTText.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\tB5255B7628A54AC2A9B4B2A0 /* libBVLinearGradient.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libBVLinearGradient.a; sourceTree = \"<group>\"; };\n\t\t467A6CBCB2164E7D9B673D4C /* CodePush.xcodeproj */ = {isa = PBXFileReference; name = \"CodePush.xcodeproj\"; path = \"../node_modules/react-native-code-push/CodePush.xcodeproj\"; sourceTree = \"<group>\"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };\n\t\tFD7121847BA447D8B737F22A /* BVLinearGradient.xcodeproj */ = {isa = PBXFileReference; name = \"BVLinearGradient.xcodeproj\"; path = \"../node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj\"; sourceTree = \"<group>\"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };\n\t\t409DA945815C46DEB4F254DB /* RCTVideo.xcodeproj */ = {isa = PBXFileReference; name = \"RCTVideo.xcodeproj\"; path = \"../node_modules/react-native-video/RCTVideo.xcodeproj\"; sourceTree = \"<group>\"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };\n\t\t3A7396DFBAFA4CA092E367F5 /* libRCTVideo.a */ = {isa = PBXFileReference; name = \"libRCTVideo.a\"; path = \"libRCTVideo.a\"; sourceTree = \"<group>\"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t00E356EB1AD99517003FC87E /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t146834051AC3E58100842450 /* libReact.a in Frameworks */,\n\t\t\t\t00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,\n\t\t\t\t00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,\n\t\t\t\t00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,\n\t\t\t\t133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,\n\t\t\t\t00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,\n\t\t\t\t139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,\n\t\t\t\t832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,\n\t\t\t\t00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,\n\t\t\t\t139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,\n\t\t\t\t672DE8B31B124B8088D0D29F /* libBVLinearGradient.a in Frameworks */,\n\t\t\t\t68FEB18F24414EF981BD7940 /* libCodePush.a in Frameworks */,\n\t\t\t\tC6C437D070BA42D6BE39198B /* libRCTVideo.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t00C302A81ABCB8CE00DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302B61ABCB90400DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302BC1ABCB91800DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302C01ABCB91800DB3ED1 /* libRCTImage.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302D41ABCB9D200DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302E01ABCB9EE00DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00E356EF1AD99517003FC87E /* androidTestTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00E356F21AD99517003FC87E /* androidTestTests.m */,\n\t\t\t\t00E356F01AD99517003FC87E /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = androidTestTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00E356F01AD99517003FC87E /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00E356F11AD99517003FC87E /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139105B71AF99BAD00B5F7CC /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139FDEE71B06529A00C62182 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13B07FAE1A68108700A75B9A /* androidTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t008F07F21AC5B25A0029DE68 /* main.jsbundle */,\n\t\t\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */,\n\t\t\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */,\n\t\t\t\t13B07FB51A68108700A75B9A /* Images.xcassets */,\n\t\t\t\t13B07FB61A68108700A75B9A /* Info.plist */,\n\t\t\t\t13B07FB11A68108700A75B9A /* LaunchScreen.xib */,\n\t\t\t\t13B07FB71A68108700A75B9A /* main.m */,\n\t\t\t);\n\t\t\tname = androidTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t146834001AC3E56700842450 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t146834041AC3E56700842450 /* libReact.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t78C398B11ACF4ADC00677621 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t78C398B91ACF4ADC00677621 /* libRCTLinking.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t832341AE1AAA6A7D00B99B32 /* Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t146833FF1AC3E56700842450 /* React.xcodeproj */,\n\t\t\t\t00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,\n\t\t\t\t00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,\n\t\t\t\t00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,\n\t\t\t\t78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,\n\t\t\t\t00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,\n\t\t\t\t139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,\n\t\t\t\t832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,\n\t\t\t\t00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,\n\t\t\t\t139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,\n\t\t\t\t467A6CBCB2164E7D9B673D4C /* CodePush.xcodeproj */,\n\t\t\t\tFD7121847BA447D8B737F22A /* BVLinearGradient.xcodeproj */,\n\t\t\t\t409DA945815C46DEB4F254DB /* RCTVideo.xcodeproj */,\n\t\t\t);\n\t\t\tname = Libraries;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t832341B11AAA6A8300B99B32 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t832341B51AAA6A8300B99B32 /* libRCTText.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBB9F61A601CBA00E9B192 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07FAE1A68108700A75B9A /* androidTest */,\n\t\t\t\t832341AE1AAA6A7D00B99B32 /* Libraries */,\n\t\t\t\t00E356EF1AD99517003FC87E /* androidTestTests */,\n\t\t\t\t83CBBA001A601CBA00E9B192 /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t};\n\t\t83CBBA001A601CBA00E9B192 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07F961A680F5B00A75B9A /* androidTest.app */,\n\t\t\t\t00E356EE1AD99517003FC87E /* androidTestTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t00E356ED1AD99517003FC87E /* androidTestTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget \"androidTestTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t00E356EA1AD99517003FC87E /* Sources */,\n\t\t\t\t00E356EB1AD99517003FC87E /* Frameworks */,\n\t\t\t\t00E356EC1AD99517003FC87E /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t00E356F51AD99517003FC87E /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = androidTestTests;\n\t\t\tproductName = androidTestTests;\n\t\t\tproductReference = 00E356EE1AD99517003FC87E /* androidTestTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t13B07F861A680F5B00A75B9A /* androidTest */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"androidTest\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t13B07F871A680F5B00A75B9A /* Sources */,\n\t\t\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */,\n\t\t\t\t13B07F8E1A680F5B00A75B9A /* Resources */,\n\t\t\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = androidTest;\n\t\t\tproductName = \"Hello World\";\n\t\t\tproductReference = 13B07F961A680F5B00A75B9A /* androidTest.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t83CBB9F71A601CBA00E9B192 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t00E356ED1AD99517003FC87E = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.2;\n\t\t\t\t\t\tTestTargetID = 13B07F861A680F5B00A75B9A;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"androidTest\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 83CBB9F61A601CBA00E9B192;\n\t\t\tproductRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 78C398B11ACF4ADC00677621 /* Products */;\n\t\t\t\t\tProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;\n\t\t\t\t\tProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 832341B11AAA6A8300B99B32 /* Products */;\n\t\t\t\t\tProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 139FDEE71B06529A00C62182 /* Products */;\n\t\t\t\t\tProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 146834001AC3E56700842450 /* Products */;\n\t\t\t\t\tProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t13B07F861A680F5B00A75B9A /* androidTest */,\n\t\t\t\t00E356ED1AD99517003FC87E /* androidTestTests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\t00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTActionSheet.a;\n\t\t\tremoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTGeolocation.a;\n\t\t\tremoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTImage.a;\n\t\t\tremoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTNetwork.a;\n\t\t\tremoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTVibration.a;\n\t\t\tremoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTSettings.a;\n\t\t\tremoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTWebSocket.a;\n\t\t\tremoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t146834041AC3E56700842450 /* libReact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libReact.a;\n\t\t\tremoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTLinking.a;\n\t\t\tremoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t832341B51AAA6A8300B99B32 /* libRCTText.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTText.a;\n\t\t\tremoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t00E356EC1AD99517003FC87E /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F8E1A680F5B00A75B9A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,\n\t\t\t\t13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Bundle React Native code and images\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"../node_modules/react-native/scripts/react-native-xcode.sh\";\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t00E356EA1AD99517003FC87E /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t00E356F31AD99517003FC87E /* androidTestTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F871A680F5B00A75B9A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,\n\t\t\t\t13B07FC11A68108700A75B9A /* main.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t00E356F51AD99517003FC87E /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 13B07F861A680F5B00A75B9A /* androidTest */;\n\t\t\ttargetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin PBXVariantGroup section */\n\t\t13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07FB21A68108700A75B9A /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.xib;\n\t\t\tpath = androidTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t00E356F61AD99517003FC87E /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(SDKROOT)/Developer/Library/Frameworks\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = androidTestTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/$(TARGET_NAME)\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/$(TARGET_NAME)\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/$(TARGET_NAME)\\\"\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/androidTest.app/androidTest\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t00E356F71AD99517003FC87E /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(SDKROOT)/Developer/Library/Frameworks\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = androidTestTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/$(TARGET_NAME)\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/$(TARGET_NAME)\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/$(TARGET_NAME)\\\"\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/androidTest.app/androidTest\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t13B07F941A680F5B00A75B9A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tDEAD_CODE_STRIPPING = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native/React/**\",\n\t\t\t\t\t\"$(SRCROOT)\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-code-push\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-linear-gradient/**\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-video\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = androidTest/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = androidTest;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t13B07F951A680F5B00A75B9A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native/React/**\",\n\t\t\t\t\t\"$(SRCROOT)\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-code-push\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-linear-gradient/**\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-video\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = androidTest/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = androidTest;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA201A601CBA00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native/React/**\",\n\t\t\t\t\t\"$(SRCROOT)\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-code-push\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-linear-gradient/**\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-video\",\n\t\t\t\t);\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA211A601CBA00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native/React/**\",\n\t\t\t\t\t\"$(SRCROOT)\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-code-push\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-linear-gradient/**\",\n\t\t\t\t\t\"$(SRCROOT)/../node_modules/react-native-video\",\n\t\t\t\t);\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget \"androidTestTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t00E356F61AD99517003FC87E /* Debug */,\n\t\t\t\t00E356F71AD99517003FC87E /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"androidTest\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t13B07F941A680F5B00A75B9A /* Debug */,\n\t\t\t\t13B07F951A680F5B00A75B9A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"androidTest\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA201A601CBA00E9B192 /* Debug */,\n\t\t\t\t83CBBA211A601CBA00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;\n}\n"
  },
  {
    "path": "local-cli/core/__fixtures__/ios.js",
    "content": "const fs = require.requireActual('fs');\nconst path = require('path');\n\nexports.valid = {\n  'demoProject.xcodeproj': {\n    'project.pbxproj': fs.readFileSync(path.join(__dirname, './files/project.pbxproj')),\n  },\n  'TestPod.podspec': 'empty'\n};\n\nexports.validTestName = {\n  'MyTestProject.xcodeproj': {\n    'project.pbxproj': fs.readFileSync(path.join(__dirname, './files/project.pbxproj')),\n  },\n};\n\nexports.pod = {\n  'TestPod.podspec': 'empty'\n};\n"
  },
  {
    "path": "local-cli/core/__fixtures__/projects.js",
    "content": "const android = require('./android');\nconst ios = require('./ios');\n\nconst flat = {\n  android: android.valid,\n  ios: ios.valid,\n  Podfile: 'empty'\n};\n\nconst nested = {\n  android: {\n    app: android.valid,\n  },\n  ios: ios.valid,\n};\n\nconst withExamples = {\n  Examples: flat,\n  ios: ios.valid,\n  android: android.valid,\n};\n\nconst withPods = {\n  Podfile: 'content',\n  ios: ios.pod\n};\n\nmodule.exports = { flat, nested, withExamples, withPods };\n"
  },
  {
    "path": "local-cli/core/__tests__/android/findAndroidAppFolder.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nconst fs = require('fs');\nconst findAndroidAppFolder = require('../../android/findAndroidAppFolder');\nconst mocks = require('../../__fixtures__/android');\n\ndescribe('android::findAndroidAppFolder', () => {\n  beforeAll(() => {\n    fs.__setMockFilesystem({\n      empty: {},\n      nested: {\n        android: {\n          app: mocks.valid,\n        },\n      },\n      flat: {\n        android: mocks.valid,\n      },\n    });\n  });\n\n  it('returns an android app folder if it exists in the given folder', () => {\n    expect(findAndroidAppFolder('/flat')).toBe('android');\n    expect(findAndroidAppFolder('/nested')).toBe('android/app');\n  });\n\n  it('returns `null` if there is no android app folder', () => {\n    expect(findAndroidAppFolder('/empty')).toBeNull();\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/android/findManifest.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nconst findManifest = require('../../android/findManifest');\nconst fs = require('fs');\nconst mocks = require('../../__fixtures__/android');\n\ndescribe('android::findManifest', () => {\n  beforeAll(() => {\n    fs.__setMockFilesystem({\n      empty: {},\n      flat: {\n        android: mocks.valid,\n      },\n    });\n  });\n\n  it('returns a manifest path if file exists in the folder', () => {\n    expect(typeof findManifest('/flat')).toBe('string');\n  });\n\n  it('returns `null` if there is no manifest in the folder', () => {\n    expect(findManifest('/empty')).toBeNull();\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/android/findPackageClassName.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nconst findPackageClassName = require('../../android/findPackageClassName');\nconst fs = require('fs');\nconst mocks = require('../../__fixtures__/android');\n\ndescribe('android::findPackageClassName', () => {\n  beforeAll(() => {\n    fs.__setMockFilesystem({\n      empty: {},\n      flatJava: {\n        android: mocks.valid,\n      },\n      flatKotlin: {\n        android: mocks.validKotlin,\n      },\n    });\n  });\n\n  it('returns manifest content if file exists in the folder', () => {\n    expect(typeof findPackageClassName('/flatJava')).toBe('string');\n  });\n\n  it('returns the name of the java class implementing ReactPackage', () => {\n    expect(findPackageClassName('/flatJava')).toBe('SomeExampleJavaPackage');\n  });\n\n  it('returns the name of the kotlin class implementing ReactPackage', () => {\n    expect(findPackageClassName('/flatKotlin')).toBe(\n      'SomeExampleKotlinPackage',\n    );\n  });\n\n  it('returns `null` if there are no matches', () => {\n    expect(findPackageClassName('/empty')).toBeNull();\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/android/getDependencyConfig.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nconst getDependencyConfig = require('../../android').dependencyConfig;\nconst fs = require('fs');\nconst mocks = require('../../__fixtures__/android');\n\nconst userConfig = {};\n\ndescribe('android::getDependencyConfig', () => {\n  beforeAll(() => {\n    fs.__setMockFilesystem({\n      empty: {},\n      nested: {\n        android: {\n          app: mocks.valid,\n        },\n      },\n      corrupted: {\n        android: {\n          app: mocks.corrupted,\n        },\n      },\n      noPackage: {\n        android: {},\n      },\n    });\n  });\n\n  it('returns an object with android project configuration', () => {\n    expect(getDependencyConfig('/nested', userConfig)).not.toBeNull();\n    expect(typeof getDependencyConfig('/nested', userConfig)).toBe('object');\n  });\n\n  it('returns `null` if manifest file has not been found', () => {\n    expect(getDependencyConfig('/empty', userConfig)).toBeNull();\n  });\n\n  it('returns `null` if android project was not found', () => {\n    expect(getDependencyConfig('/empty', userConfig)).toBeNull();\n  });\n\n  it('returns `null` if android project does not contain ReactPackage', () => {\n    expect(getDependencyConfig('/noPackage', userConfig)).toBeNull();\n  });\n\n  it('returns `null` if it cannot find a packageClassName', () => {\n    expect(getDependencyConfig('/corrupted', userConfig)).toBeNull();\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/android/getProjectConfig.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nconst getProjectConfig = require('../../android').projectConfig;\nconst fs = require('fs');\nconst mocks = require('../../__fixtures__/android');\n\ndescribe('android::getProjectConfig', () => {\n  beforeAll(() => {\n    fs.__setMockFilesystem({\n      empty: {},\n      nested: {\n        android: {\n          app: mocks.valid,\n        },\n      },\n      flat: {\n        android: mocks.valid,\n      },\n      multiple: {\n        android: mocks.userConfigManifest,\n      },\n      noManifest: {\n        android: {},\n      },\n    });\n  });\n\n  it(\"returns `null` if manifest file hasn't been found\", () => {\n    const userConfig = {};\n    const folder = '/noManifest';\n\n    expect(getProjectConfig(folder, userConfig)).toBeNull();\n  });\n\n  describe('returns an object with android project configuration for', () => {\n    it('nested structure', () => {\n      const userConfig = {};\n      const folder = '/nested';\n\n      expect(getProjectConfig(folder, userConfig)).not.toBeNull();\n      expect(typeof getProjectConfig(folder, userConfig)).toBe('object');\n    });\n\n    it('flat structure', () => {\n      const userConfig = {};\n      const folder = '/flat';\n\n      expect(getProjectConfig(folder, userConfig)).not.toBeNull();\n      expect(typeof getProjectConfig(folder, userConfig)).toBe('object');\n    });\n\n    it('multiple', () => {\n      const userConfig = {\n        manifestPath: 'src/main/AndroidManifest.xml',\n      };\n      const folder = '/multiple';\n\n      expect(getProjectConfig(folder, userConfig)).not.toBeNull();\n      expect(typeof getProjectConfig(folder, userConfig)).toBe('object');\n    });\n  });\n\n  it('should return `null` if android project was not found', () => {\n    const userConfig = {};\n    const folder = '/empty';\n\n    expect(getProjectConfig(folder, userConfig)).toBeNull();\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/android/readManifest.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nconst findManifest = require('../../android/findManifest');\nconst readManifest = require('../../android/readManifest');\nconst fs = require('fs');\nconst mocks = require('../../__fixtures__/android');\n\ndescribe('android::readManifest', () => {\n  beforeAll(() => {\n    fs.__setMockFilesystem({\n      empty: {},\n      nested: {\n        android: {\n          app: mocks.valid,\n        },\n      },\n    });\n  });\n\n  it('returns manifest content if file exists in the folder', () => {\n    const manifestPath = findManifest('/nested');\n    expect(readManifest(manifestPath)).not.toBeNull();\n    expect(typeof readManifest(manifestPath)).toBe('object');\n  });\n\n  it('throws an error if there is no manifest in the folder', () => {\n    const fakeManifestPath = findManifest('/empty');\n    expect(() => {\n      readManifest(fakeManifestPath);\n    }).toThrow();\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/findAssets.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nconst findAssets = require('../findAssets');\nconst dependencies = require('../__fixtures__/dependencies');\nconst fs = require('fs');\n\ndescribe('findAssets', () => {\n  beforeEach(() => {\n    fs.__setMockFilesystem({testDir: dependencies.withAssets});\n  });\n\n  it('returns an array of all files in given folders', () => {\n    const assets = findAssets('/testDir', ['fonts', 'images']);\n\n    expect(Array.isArray(assets)).toBeTruthy();\n    expect(assets).toHaveLength(3);\n  });\n\n  it('prepends assets paths with the folder path', () => {\n    const assets = findAssets('/testDir', ['fonts', 'images']);\n\n    assets.forEach(assetPath => {\n      expect(assetPath).toContain('testDir');\n    });\n  });\n\n  it('returns an empty array if given assets are null', () => {\n    expect(findAssets('/testDir', null)).toHaveLength(0);\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/findPlugins.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst findPlugins = require('../findPlugins');\nconst path = require('path');\n\nconst ROOT = path.join(__dirname, '..', '..', '..');\nconst pjsonPath = path.join(ROOT, 'package.json');\n\ndescribe('findPlugins', () => {\n  beforeEach(() => {\n    jest.resetModules();\n  });\n\n  it('returns an array of dependencies', () => {\n    jest.mock(pjsonPath, () => ({\n      dependencies: {'rnpm-plugin-test': '*'},\n    }));\n    expect(findPlugins([ROOT])).toHaveLength(1);\n    expect(findPlugins([ROOT])[0]).toBe('rnpm-plugin-test');\n  });\n\n  it('returns an empty array if there are no plugins in this folder', () => {\n    jest.mock(pjsonPath, () => ({}));\n    expect(findPlugins([ROOT])).toHaveLength(0);\n  });\n\n  it('returns an empty array if there is no package.json in the supplied folder', () => {\n    expect(Array.isArray(findPlugins(['fake-path']))).toBeTruthy();\n    expect(findPlugins(['fake-path'])).toHaveLength(0);\n  });\n\n  it('returns plugins from both dependencies and dev dependencies', () => {\n    jest.mock(pjsonPath, () => ({\n      dependencies: {'rnpm-plugin-test': '*'},\n      devDependencies: {'rnpm-plugin-test-2': '*'},\n    }));\n    expect(findPlugins([ROOT])).toHaveLength(2);\n  });\n\n  it('returns unique list of plugins', () => {\n    jest.mock(pjsonPath, () => ({\n      dependencies: {'rnpm-plugin-test': '*'},\n      devDependencies: {'rnpm-plugin-test': '*'},\n    }));\n    expect(findPlugins([ROOT])).toHaveLength(1);\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/ios/findPodfilePath.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nconst findPodfilePath = require('../../ios/findPodfilePath');\nconst fs = require('fs');\nconst projects = require('../../__fixtures__/projects');\nconst ios = require('../../__fixtures__/ios');\n\ndescribe('ios::findPodfilePath', () => {\n  it('returns null if there is no Podfile', () => {\n    fs.__setMockFilesystem(ios.valid);\n    expect(findPodfilePath('')).toBeNull();\n  });\n\n  it('returns Podfile path if it exists', () => {\n    fs.__setMockFilesystem(projects.withPods);\n    expect(findPodfilePath('/ios')).toContain('Podfile');\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/ios/findPodspecName.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nconst findPodspecName = require('../../ios/findPodspecName');\nconst fs = require('fs');\nconst projects = require('../../__fixtures__/projects');\nconst ios = require('../../__fixtures__/ios');\n\ndescribe('ios::findPodspecName', () => {\n  it('returns null if there is not podspec file', () => {\n    fs.__setMockFilesystem(projects.flat);\n    expect(findPodspecName('')).toBeNull();\n  });\n\n  it('returns podspec name if only one exists', () => {\n    fs.__setMockFilesystem(ios.pod);\n    expect(findPodspecName('/')).toBe('TestPod');\n  });\n\n  it('returns podspec name that match packet directory', () => {\n    fs.__setMockFilesystem({\n      user: {\n        PacketName: {\n          'Another.podspec': 'empty',\n          'PacketName.podspec': 'empty'\n        }\n      }\n    });\n    expect(findPodspecName('/user/PacketName')).toBe('PacketName');\n  });\n\n  it('returns first podspec name if not match in directory', () => {\n    fs.__setMockFilesystem({\n      user: {\n        packet: {\n          'Another.podspec': 'empty',\n          'PacketName.podspec': 'empty'\n        }\n      }\n    });\n    expect(findPodspecName('/user/packet')).toBe('Another');\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/ios/findProject.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nconst findProject = require('../../ios/findProject');\nconst fs = require('fs');\nconst projects = require('../../__fixtures__/projects');\nconst ios = require('../../__fixtures__/ios');\n\ndescribe('ios::findProject', () => {\n  it('returns path to xcodeproj if found', () => {\n    fs.__setMockFilesystem(projects.flat);\n    expect(findProject('/')).not.toBeNull();\n  });\n\n  it('returns null if there are no projects', () => {\n    fs.__setMockFilesystem({testDir: projects});\n    expect(findProject('/')).toBeNull();\n  });\n\n  it('returns ios project regardless of its name', () => {\n    fs.__setMockFilesystem({ios: ios.validTestName});\n    expect(findProject('/')).not.toBeNull();\n  });\n\n  it('ignores node_modules', () => {\n    fs.__setMockFilesystem({node_modules: projects.flat});\n    expect(findProject('/')).toBeNull();\n  });\n\n  it('ignores Pods', () => {\n    fs.__setMockFilesystem({Pods: projects.flat});\n    expect(findProject('/')).toBeNull();\n  });\n\n  it('ignores Pods inside `ios` folder', () => {\n    fs.__setMockFilesystem({\n      ios: {\n        Pods: projects.flat,\n        DemoApp: projects.flat.ios,\n      },\n    });\n    expect(findProject('/')).toBe('ios/DemoApp/demoProject.xcodeproj');\n  });\n\n  it('ignores xcodeproj from example folders', () => {\n    fs.__setMockFilesystem({\n      examples: projects.flat,\n      Examples: projects.flat,\n      example: projects.flat,\n      KeychainExample: projects.flat,\n      Zpp: projects.flat,\n    });\n\n    expect(findProject('/').toLowerCase()).not.toContain('example');\n  });\n\n  it('ignores xcodeproj from sample folders', () => {\n    fs.__setMockFilesystem({\n      samples: projects.flat,\n      Samples: projects.flat,\n      sample: projects.flat,\n      KeychainSample: projects.flat,\n      Zpp: projects.flat,\n    });\n\n    expect(findProject('/').toLowerCase()).not.toContain('sample');\n  });\n\n  it('ignores xcodeproj from test folders at any level', () => {\n    fs.__setMockFilesystem({\n      test: projects.flat,\n      IntegrationTests: projects.flat,\n      tests: projects.flat,\n      Zpp: {\n        tests: projects.flat,\n        src: projects.flat,\n      },\n    });\n\n    expect(findProject('/').toLowerCase()).not.toContain('test');\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/ios/getProjectConfig.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nconst getProjectConfig = require('../../ios').projectConfig;\nconst fs = require('fs');\nconst projects = require('../../__fixtures__/projects');\n\ndescribe('ios::getProjectConfig', () => {\n  const userConfig = {};\n\n  beforeEach(() => {\n    fs.__setMockFilesystem({testDir: projects});\n  });\n\n  it('returns an object with ios project configuration', () => {\n    const folder = '/testDir/nested';\n\n    expect(getProjectConfig(folder, userConfig)).not.toBeNull();\n    expect(typeof getProjectConfig(folder, userConfig)).toBe('object');\n  });\n\n  it('returns `null` if ios project was not found', () => {\n    const folder = '/testDir/empty';\n\n    expect(getProjectConfig(folder, userConfig)).toBeNull();\n  });\n\n  it('returns normalized shared library names', () => {\n    const projectConfig = getProjectConfig('/testDir/nested', {\n      sharedLibraries: ['libc++', 'libz.tbd', 'HealthKit', 'HomeKit.framework'],\n    });\n\n    expect(projectConfig.sharedLibraries).toEqual([\n      'libc++.tbd',\n      'libz.tbd',\n      'HealthKit.framework',\n      'HomeKit.framework',\n    ]);\n  });\n});\n"
  },
  {
    "path": "local-cli/core/__tests__/makeCommand.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nlet spawnError = false;\n\njest.setMock('child_process', {\n  spawn: () => ({\n    on: (event, cb) => cb(spawnError),\n  }),\n});\n\nconst makeCommand = require('../makeCommand');\n\ndescribe('makeCommand', () => {\n  const command = makeCommand('echo');\n\n  it('generates a function around shell command', () => {\n    expect(typeof command).toBe('function');\n  });\n\n  it('throws an error if there is no callback provided', () => {\n    expect(command).toThrow();\n  });\n\n  it('invokes a callback after command execution', () => {\n    const spy = jest.fn();\n    command(spy);\n    expect(spy.mock.calls).toHaveLength(1);\n  });\n\n  it('throws an error if spawn ended up with error', () => {\n    spawnError = true;\n    const cb = jest.fn();\n    expect(() => {\n      command(cb);\n    }).toThrow();\n  });\n});\n"
  },
  {
    "path": "local-cli/core/android/findAndroidAppFolder.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\n/**\n * @param  {String} folder Folder to seek in\n * @return {String}\n */\nmodule.exports = function findAndroidAppFolder(folder) {\n  const flat = 'android';\n  const nested = path.join('android', 'app');\n\n  if (fs.existsSync(path.join(folder, nested))) {\n    return nested;\n  }\n\n  if (fs.existsSync(path.join(folder, flat))) {\n    return flat;\n  }\n\n  return null;\n};\n"
  },
  {
    "path": "local-cli/core/android/findManifest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst glob = require('glob');\nconst path = require('path');\n\n/**\n * Find an android application path in the folder\n *\n * @param {String} folder Name of the folder where to seek\n * @return {String}\n */\nmodule.exports = function findManifest(folder) {\n  const manifestPath = glob.sync(path.join('**', 'AndroidManifest.xml'), {\n    cwd: folder,\n    ignore: ['node_modules/**', '**/build/**', 'Examples/**', 'examples/**'],\n  })[0];\n\n  return manifestPath ? path.join(folder, manifestPath) : null;\n};\n"
  },
  {
    "path": "local-cli/core/android/findPackageClassName.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst fs = require('fs');\nconst glob = require('glob');\nconst path = require('path');\n\n/**\n * Gets package's class name (class that implements ReactPackage)\n * by searching for its declaration in all Java/Kotlin files present in the folder\n *\n * @param {String} folder Folder to find java/kt files\n */\nmodule.exports = function getPackageClassName(folder) {\n  const files = glob.sync('**/+(*.java|*.kt)', { cwd: folder });\n\n  const packages = files\n    .map(filePath => fs.readFileSync(path.join(folder, filePath), 'utf8'))\n    .map(file => file.match(/class (.*) +(implements|:) ReactPackage/))\n    .filter(match => match);\n\n  return packages.length ? packages[0][1] : null;\n};\n"
  },
  {
    "path": "local-cli/core/android/index.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst findAndroidAppFolder = require('./findAndroidAppFolder');\nconst findManifest = require('./findManifest');\nconst findPackageClassName = require('./findPackageClassName');\nconst path = require('path');\nconst readManifest = require('./readManifest');\n\nconst getPackageName = (manifest) => manifest.attr.package;\n\n/**\n * Gets android project config by analyzing given folder and taking some\n * defaults specified by user into consideration\n */\nexports.projectConfig = function projectConfigAndroid(folder, userConfig) {\n  const src = userConfig.sourceDir || findAndroidAppFolder(folder);\n\n  if (!src) {\n    return null;\n  }\n\n  const sourceDir = path.join(folder, src);\n  const isFlat = sourceDir.indexOf('app') === -1;\n  const manifestPath = userConfig.manifestPath\n    ? path.join(sourceDir, userConfig.manifestPath)\n    : findManifest(sourceDir);\n\n  if (!manifestPath) {\n    return null;\n  }\n\n  const manifest = readManifest(manifestPath);\n\n  const packageName = userConfig.packageName || getPackageName(manifest);\n\n  if (!packageName) {\n    throw new Error(`Package name not found in ${manifestPath}`);\n  }\n\n  const packageFolder = userConfig.packageFolder ||\n    packageName.replace(/\\./g, path.sep);\n\n  const mainFilePath = path.join(\n    sourceDir,\n    userConfig.mainFilePath || `src/main/java/${packageFolder}/MainApplication.java`\n  );\n\n  const stringsPath = path.join(\n    sourceDir,\n    userConfig.stringsPath || 'src/main/res/values/strings.xml'\n  );\n\n  const settingsGradlePath = path.join(\n    folder,\n    'android',\n    userConfig.settingsGradlePath || 'settings.gradle'\n  );\n\n  const assetsPath = path.join(\n    sourceDir,\n    userConfig.assetsPath || 'src/main/assets'\n  );\n\n  const buildGradlePath = path.join(\n    sourceDir,\n    userConfig.buildGradlePath || 'build.gradle'\n  );\n\n  return {\n    sourceDir,\n    isFlat,\n    folder,\n    stringsPath,\n    manifestPath,\n    buildGradlePath,\n    settingsGradlePath,\n    assetsPath,\n    mainFilePath,\n  };\n};\n\n/**\n * Same as projectConfigAndroid except it returns\n * different config that applies to packages only\n */\nexports.dependencyConfig = function dependencyConfigAndroid(folder, userConfig) {\n  const src = userConfig.sourceDir || findAndroidAppFolder(folder);\n\n  if (!src) {\n    return null;\n  }\n\n  const sourceDir = path.join(folder, src);\n  const manifestPath = userConfig.manifestPath\n    ? path.join(sourceDir, userConfig.manifestPath)\n    : findManifest(sourceDir);\n\n  if (!manifestPath) {\n    return null;\n  }\n\n  const manifest = readManifest(manifestPath);\n  const packageName = userConfig.packageName || getPackageName(manifest);\n  const packageClassName = findPackageClassName(sourceDir);\n\n  /**\n   * This module has no package to export\n   */\n  if (!packageClassName) {\n    return null;\n  }\n\n  const packageImportPath = userConfig.packageImportPath ||\n    `import ${packageName}.${packageClassName};`;\n\n  const packageInstance = userConfig.packageInstance ||\n    `new ${packageClassName}()`;\n\n  return { sourceDir, folder, manifest, packageImportPath, packageInstance };\n};\n"
  },
  {
    "path": "local-cli/core/android/readManifest.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst fs = require('fs');\nconst xml = require('xmldoc');\n\n/**\n * @param  {String} manifestPath\n * @return {XMLDocument} Parsed manifest's content\n */\nmodule.exports = function readManifest(manifestPath) {\n  return new xml.XmlDocument(fs.readFileSync(manifestPath, 'utf8'));\n};\n"
  },
  {
    "path": "local-cli/core/default.config.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\nconst path = require('path');\nconst flatten = require('lodash').flatten;\nconst android = require('./android');\nconst findAssets = require('./findAssets');\nconst ios = require('./ios');\nconst macos = require('./macos');\nconst windows = require('./windows');\nconst wrapCommands = require('./wrapCommands');\nconst findPlugins = require('./findPlugins');\nconst findSymlinksPaths = require('../util/findSymlinksPaths');\n\nfunction getProjectPath() {\n  if (__dirname.match(/node_modules[\\/\\\\]react-native-macos[\\/\\\\]local-cli[\\/\\\\]core$/)) {\n    // Packager is running from node_modules.\n    // This is the default case for all projects created using 'react-native init'.\n    return path.resolve(__dirname, '../../../..');\n  } else if (__dirname.match(/Pods[\\/\\\\]React[\\/\\\\]packager$/)) {\n    // React Native was installed using CocoaPods.\n    return path.resolve(__dirname, '../../../..');\n  }\n  return path.resolve(__dirname, '../..');\n}\n\nconst getRNPMConfig = (folder) =>\n  // $FlowFixMe non-literal require\n  require(path.join(folder, './package.json')).rnpm || {};\n\nconst attachPackage = (command, pkg) => Array.isArray(command)\n  ? command.map(cmd => attachPackage(cmd, pkg))\n  : { ...command, pkg };\n\nconst resolveSymlink = (roots) =>\n  roots.concat(\n    findSymlinksPaths(\n      path.join(getProjectPath(), 'node_modules'),\n      roots\n    )\n  );\n\n/**\n * Default configuration for the CLI.\n *\n * If you need to override any of this functions do so by defining the file\n * `rn-cli.config.js` on the root of your project with the functions you need\n * to tweak.\n */\nconst config = {\n  getProjectCommands() {\n    const appRoot = process.cwd();\n    const plugins = findPlugins([appRoot])\n      .map(pathToCommands => {\n        const name = pathToCommands.split(path.sep)[0];\n\n        return attachPackage(\n          // $FlowFixMe non-literal require\n          require(path.join(appRoot, 'node_modules', pathToCommands)),\n          // $FlowFixMe non-literal require\n          require(path.join(appRoot, 'node_modules', name, 'package.json'))\n        );\n      });\n\n    return flatten(plugins);\n  },\n  getProjectConfig() {\n    const folder = process.cwd();\n    const rnpm = getRNPMConfig(folder);\n\n    return Object.assign({}, rnpm, {\n      macos: macos.dependencyConfig(folder, rnpm.ios || {}),\n      ios: ios.projectConfig(folder, rnpm.ios || {}),\n      android: android.projectConfig(folder, rnpm.android || {}),\n      windows: windows.projectConfig(folder, rnpm.windows || {}),\n      assets: findAssets(folder, rnpm.assets),\n    });\n  },\n  getDependencyConfig(packageName: string) {\n    const folder = path.join(process.cwd(), 'node_modules', packageName);\n    const rnpm = getRNPMConfig(\n      path.join(process.cwd(), 'node_modules', packageName)\n    );\n\n    return Object.assign({}, rnpm, {\n      macos: macos.dependencyConfig(folder, rnpm.ios || {}),\n      ios: ios.dependencyConfig(folder, rnpm.ios || {}),\n      android: android.dependencyConfig(folder, rnpm.android || {}),\n      windows: windows.dependencyConfig(folder, rnpm.windows || {}),\n      assets: findAssets(folder, rnpm.assets),\n      commands: wrapCommands(rnpm.commands),\n      params: rnpm.params || [],\n    });\n  },\n  getProjectRoots() {\n    const root = process.env.REACT_NATIVE_APP_ROOT;\n    if (root) {\n      return resolveSymlink([path.resolve(root)]);\n    }\n\n    return resolveSymlink([getProjectPath()]);\n  },\n};\n\nmodule.exports = config;\n"
  },
  {
    "path": "local-cli/core/findAssets.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst glob = require('glob');\nconst path = require('path');\n\nconst findAssetsInFolder = (folder) =>\n  glob.sync(path.join(folder, '**'), { nodir: true });\n\n/**\n * Given an array of assets folders, e.g. ['Fonts', 'Images'],\n * it globs in them to find all files that can be copied.\n *\n * It returns an array of absolute paths to files found.\n */\nmodule.exports = function findAssets(folder, assets) {\n  return (assets || [])\n    .map(assetsFolder => path.join(folder, assetsFolder))\n    .reduce((_assets, assetsFolder) =>\n      _assets.concat(findAssetsInFolder(assetsFolder)),\n      []\n    );\n};\n"
  },
  {
    "path": "local-cli/core/findPlugins.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst path = require('path');\nconst union = require('lodash').union;\nconst uniq = require('lodash').uniq;\nconst flatten = require('lodash').flatten;\n\n/**\n * Filter dependencies by name pattern\n * @param  {String} dependency Name of the dependency\n * @return {Boolean}           If dependency is a rnpm plugin\n */\nconst isRNPMPlugin = (dependency) => dependency.indexOf('rnpm-plugin-') === 0;\nconst isReactNativePlugin = (dependency) => dependency.indexOf('react-native-') === 0;\n\nconst readPackage = (folder) => {\n  try {\n    return require(path.join(folder, 'package.json'));\n  } catch (e) {\n    return null;\n  }\n};\n\nconst findPluginsInReactNativePackage = (pjson) => {\n  if (!pjson.rnpm || !pjson.rnpm.plugin) {\n    return [];\n  }\n\n  return path.join(pjson.name, pjson.rnpm.plugin);\n};\n\nconst findPluginInFolder = (folder) => {\n  const pjson = readPackage(folder);\n\n  if (!pjson) {\n    return [];\n  }\n\n  const deps = union(\n    Object.keys(pjson.dependencies || {}),\n    Object.keys(pjson.devDependencies || {})\n  );\n\n  return deps.reduce(\n    (acc, pkg) => {\n      if (isRNPMPlugin(pkg)) {\n        return acc.concat(pkg);\n      }\n      if (isReactNativePlugin(pkg)) {\n        const pkgJson = readPackage(path.join(folder, 'node_modules', pkg));\n        if (!pkgJson) {\n          return acc;\n        }\n        return acc.concat(findPluginsInReactNativePackage(pkgJson));\n      }\n      return acc;\n    },\n    []\n  );\n};\n\n/**\n * Find plugins in package.json of the given folder\n * @param {String} folder Path to the folder to get the package.json from\n * @type  {Array}         Array of plugins or an empty array if no package.json found\n */\nmodule.exports = function findPlugins(folders) {\n  return uniq(flatten(folders.map(findPluginInFolder)));\n};\n"
  },
  {
    "path": "local-cli/core/index.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\nconst android = require('./android');\nconst Config = require('../util/Config');\nconst findPlugins = require('./findPlugins');\nconst findAssets = require('./findAssets');\nconst ios = require('./ios');\nconst windows = require('./windows');\nconst wrapCommands = require('./wrapCommands');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst flatten = require('lodash').flatten;\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst minimist = require('minimist');\nconst path = require('path');\n\nimport type {CommandT} from '../commands';\nimport type {ConfigT} from 'metro';\n\nexport type RNConfig = {\n  ...ConfigT,\n  /**\n   * Returns an array of project commands used by the CLI to load\n   */\n  getProjectCommands(): Array<CommandT>,\n  /**\n   * Returns project config from the current working directory\n   */\n  getProjectConfig(): Object,\n  /**\n   * Returns dependency config from <node_modules>/packageName\n   */\n  getDependencyConfig(pkgName: string): Object,\n};\n\nconst getRNPMConfig = (folder) =>\n  // $FlowFixMe non-literal require\n  require(path.join(folder, './package.json')).rnpm || {};\n\nconst attachPackage = (command, pkg) => Array.isArray(command)\n  ? command.map(cmd => attachPackage(cmd, pkg))\n  : { ...command, pkg };\n\nconst defaultRNConfig = {\n  getProjectCommands(): Array<CommandT> {\n    const appRoot = process.cwd();\n    const plugins = findPlugins([appRoot])\n      .map(pathToCommands => {\n        const name = pathToCommands.split(path.sep)[0];\n\n        return attachPackage(\n          // $FlowFixMe non-literal require\n          require(path.join(appRoot, 'node_modules', pathToCommands)),\n          // $FlowFixMe non-literal require\n          require(path.join(appRoot, 'node_modules', name, 'package.json'))\n        );\n      });\n\n    return flatten(plugins);\n  },\n\n  getProjectConfig(): Object {\n    const folder = process.cwd();\n    const rnpm = getRNPMConfig(folder);\n\n    return Object.assign({}, rnpm, {\n      ios: ios.projectConfig(folder, rnpm.ios || {}),\n      android: android.projectConfig(folder, rnpm.android || {}),\n      windows: windows.projectConfig(folder, rnpm.windows || {}),\n      assets: findAssets(folder, rnpm.assets),\n    });\n  },\n\n  getDependencyConfig(packageName: string) {\n    const folder = path.join(process.cwd(), 'node_modules', packageName);\n    const rnpm = getRNPMConfig(\n      path.join(process.cwd(), 'node_modules', packageName)\n    );\n\n    return Object.assign({}, rnpm, {\n      ios: ios.dependencyConfig(folder, rnpm.ios || {}),\n      android: android.dependencyConfig(folder, rnpm.android || {}),\n      windows: windows.dependencyConfig(folder, rnpm.windows || {}),\n      assets: findAssets(folder, rnpm.assets),\n      commands: wrapCommands(rnpm.commands),\n      params: rnpm.params || [],\n    });\n  },\n};\n\n/**\n * Loads the CLI configuration\n */\nfunction getCliConfig(): RNConfig {\n  const cliArgs = minimist(process.argv.slice(2));\n  const config = cliArgs.config != null\n    ? Config.load(path.resolve(__dirname, cliArgs.config))\n    : Config.findOptional(__dirname);\n\n  return {...defaultRNConfig, ...config};\n}\n\nmodule.exports = getCliConfig();\n"
  },
  {
    "path": "local-cli/core/ios/findPodfilePath.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\nmodule.exports = function findPodfilePath(projectFolder) {\n  const podFilePath = path.join(projectFolder, '..', 'Podfile');\n  const podFileExists = fs.existsSync(podFilePath);\n\n  return podFileExists ? podFilePath : null;\n};\n"
  },
  {
    "path": "local-cli/core/ios/findPodspecName.js",
    "content": "'use strict';\n\nconst glob = require('glob');\nconst path = require('path');\n\nmodule.exports = function findPodspecName(folder) {\n  const podspecs = glob.sync('*.podspec', { cwd: folder });\n  let podspecFile = null;\n  if (podspecs.length === 0) {\n    return null;\n  }\n  else if (podspecs.length === 1) {\n    podspecFile = podspecs[0];\n  }\n  else {\n    const folderParts = folder.split(path.sep);\n    const currentFolder = folderParts[folderParts.length - 1];\n    const toSelect = podspecs.indexOf(currentFolder + '.podspec');\n    if (toSelect === -1) {\n      podspecFile = podspecs[0];\n    }\n    else {\n      podspecFile = podspecs[toSelect];\n    }\n  }\n\n  return podspecFile.replace('.podspec', '');\n};\n"
  },
  {
    "path": "local-cli/core/ios/findProject.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst glob = require('glob');\nconst path = require('path');\n\n/**\n * Glob pattern to look for xcodeproj\n */\nconst GLOB_PATTERN = '**/*.xcodeproj';\n\n/**\n * Regexp matching all test projects\n */\nconst TEST_PROJECTS = /test|example|sample/i;\n\n/**\n * Base iOS folder\n */\nconst IOS_BASE = 'ios';\n\n/**\n * These folders will be excluded from search to speed it up\n */\nconst GLOB_EXCLUDE_PATTERN = ['**/@(Pods|node_modules)/**'];\n\n/**\n * Finds iOS project by looking for all .xcodeproj files\n * in given folder.\n *\n * Returns first match if files are found or null\n *\n * Note: `./ios/*.xcodeproj` are returned regardless of the name\n */\nmodule.exports = function findProject(folder) {\n  const projects = glob\n    .sync(GLOB_PATTERN, {\n      cwd: folder,\n      ignore: GLOB_EXCLUDE_PATTERN,\n    })\n    .filter(project => {\n      return path.dirname(project) === IOS_BASE || !TEST_PROJECTS.test(project);\n    })\n    .sort((projectA, projectB) => {\n      return path.dirname(projectA) === IOS_BASE ? -1 : 1;\n    });\n\n  if (projects.length === 0) {\n    return null;\n  }\n\n  return projects[0];\n};\n"
  },
  {
    "path": "local-cli/core/ios/index.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst findProject = require('./findProject');\nconst findPodfilePath = require('./findPodfilePath');\nconst findPodspecName = require('./findPodspecName');\nconst path = require('path');\n\n/**\n * For libraries specified without an extension, add '.tbd' for those that\n * start with 'lib' and '.framework' to the rest.\n */\nconst mapSharedLibaries = (libraries) => {\n  return libraries.map(name => {\n    if (path.extname(name)) {\n      return name;\n    }\n    return name + (name.indexOf('lib') === 0 ? '.tbd' : '.framework');\n  });\n};\n\n/**\n * Returns project config by analyzing given folder and applying some user defaults\n * when constructing final object\n */\nexports.projectConfig = function projectConfigIOS(folder, userConfig) {\n  const project = userConfig.project || findProject(folder);\n\n  /**\n   * No iOS config found here\n   */\n  if (!project) {\n    return null;\n  }\n\n  const projectPath = path.join(folder, project);\n\n  return {\n    sourceDir: path.dirname(projectPath),\n    folder: folder,\n    pbxprojPath: path.join(projectPath, 'project.pbxproj'),\n    podfile: findPodfilePath(projectPath),\n    podspec: findPodspecName(folder),\n    projectPath: projectPath,\n    projectName: path.basename(projectPath),\n    libraryFolder: userConfig.libraryFolder || 'Libraries',\n    sharedLibraries: mapSharedLibaries(userConfig.sharedLibraries || []),\n    plist: userConfig.plist || [],\n  };\n};\n\nexports.dependencyConfig = exports.projectConfig;\n"
  },
  {
    "path": "local-cli/core/macos/findProject.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst glob = require('glob');\nconst path = require('path');\n\n/**\n * Glob pattern to look for xcodeproj\n */\nconst GLOB_PATTERN = '**/*.xcodeproj';\n\n/**\n * Regexp matching all test projects\n */\nconst TEST_PROJECTS = /test|example|sample/i;\n\n/**\n * Base iOS folder\n */\nconst IOS_BASE = 'macos';\n\n/**\n * These folders will be excluded from search to speed it up\n */\nconst GLOB_EXCLUDE_PATTERN = ['**/@(Pods|node_modules)/**'];\n\n/**\n * Finds iOS project by looking for all .xcodeproj files\n * in given folder.\n *\n * Returns first match if files are found or null\n *\n * Note: `./ios/*.xcodeproj` are returned regardless of the name\n */\nmodule.exports = function findProject(folder) {\n  const projects = glob\n    .sync(GLOB_PATTERN, {\n      cwd: folder,\n      ignore: GLOB_EXCLUDE_PATTERN,\n    })\n    .filter(project => {\n      return path.dirname(project) === IOS_BASE || !TEST_PROJECTS.test(project);\n    })\n    .sort((projectA, projectB) => {\n      return path.dirname(projectA) === IOS_BASE ? -1 : 1;\n    });\n\n  if (projects.length === 0) {\n    return null;\n  }\n\n  return projects[0];\n};\n"
  },
  {
    "path": "local-cli/core/macos/index.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst findProject = require('./findProject');\nconst path = require('path');\n\n/**\n * For libraries specified without an extension, add '.tbd' for those that\n * start with 'lib' and '.framework' to the rest.\n */\nconst mapSharedLibaries = (libraries) => {\n  return libraries.map(name => {\n    if (path.extname(name)) {\n      return name;\n    }\n    return name + (name.indexOf('lib') === 0 ? '.tbd' : '.framework');\n  });\n};\n\n/**\n * Returns project config by analyzing given folder and applying some user defaults\n * when constructing final object\n */\nexports.projectConfig = function projectConfigIOS(folder, userConfig) {\n  const project = userConfig.project || findProject(folder);\n\n  /**\n   * No iOS config found here\n   */\n  if (!project) {\n    return null;\n  }\n\n  const projectPath = path.join(folder, project);\n\n  return {\n    sourceDir: path.dirname(projectPath),\n    folder: folder,\n    pbxprojPath: path.join(projectPath, 'project.pbxproj'),\n    projectPath: projectPath,\n    projectName: path.basename(projectPath),\n    libraryFolder: userConfig.libraryFolder || 'Libraries',\n    sharedLibraries: mapSharedLibaries(userConfig.sharedLibraries || []),\n    plist: userConfig.plist || [],\n  };\n};\n\nexports.dependencyConfig = exports.projectConfig;\n"
  },
  {
    "path": "local-cli/core/makeCommand.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst spawn = require('child_process').spawn;\n\nmodule.exports = function makeCommand(command) {\n  return (cb) => {\n    if (!cb) {\n      throw new Error(`You missed a callback function for the ${command} command`);\n    }\n\n    const args = command.split(' ');\n    const cmd = args.shift();\n\n    const commandProcess = spawn(cmd, args, {\n      stdio: 'inherit',\n      stdin: 'inherit',\n    });\n\n    commandProcess.on('close', function prelink(code) {\n      if (code) {\n        throw new Error(`Error occured during executing \"${command}\" command`);\n      }\n\n      cb();\n    });\n  };\n};\n"
  },
  {
    "path": "local-cli/core/windows/findNamespace.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst fs = require('fs');\nconst glob = require('glob');\nconst path = require('path');\n\n/**\n * Gets package's namespace\n * by searching for its declaration in all C# files present in the folder\n *\n * @param {String} folder Folder to find C# files\n */\nmodule.exports = function getNamespace(folder) {\n  const files = glob.sync('**/*.cs', { cwd: folder });\n\n  const packages = files\n    .map(filePath => fs.readFileSync(path.join(folder, filePath), 'utf8'))\n    .map(file => file.match(/namespace (.*)[\\s\\S]+IReactPackage/))\n    .filter(match => match);\n\n  return packages.length ? packages[0][1] : null;\n};\n"
  },
  {
    "path": "local-cli/core/windows/findPackageClassName.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst fs = require('fs');\nconst glob = require('glob');\nconst path = require('path');\n\n/**\n * Gets package's class name (class that implements IReactPackage)\n * by searching for its declaration in all C# files present in the folder\n *\n * @param {String} folder Folder to find C# files\n */\nmodule.exports = function getPackageClassName(folder) {\n  const files = glob.sync('**/*.cs', { cwd: folder });\n\n  const packages = files\n    .map(filePath => fs.readFileSync(path.join(folder, filePath), 'utf8'))\n    .map(file => file.match(/class (.*) : IReactPackage/))\n    .filter(match => match);\n\n  return packages.length ? packages[0][1] : null;\n};\n"
  },
  {
    "path": "local-cli/core/windows/findProject.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst glob = require('glob');\nconst path = require('path');\n\n/**\n * Find an C# project file\n *\n * @param {String} folder Name of the folder where to seek\n * @return {String}\n */\nmodule.exports = function findManifest(folder) {\n  const csprojPath = glob.sync(path.join('**', '*.csproj'), {\n    cwd: folder,\n    ignore: ['node_modules/**', '**/build/**', 'Examples/**', 'examples/**'],\n  })[0];\n\n  return csprojPath ? path.join(folder, csprojPath) : null;\n};\n"
  },
  {
    "path": "local-cli/core/windows/findWindowsSolution.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst glob = require('glob');\nconst path = require('path');\n\n/**\n * Glob pattern to look for solution file\n */\nconst GLOB_PATTERN = '**/*.sln';\n\n/**\n * Regexp matching all test projects\n */\nconst TEST_PROJECTS = /test|example|sample/i;\n\n/**\n * Base windows folder\n */\nconst WINDOWS_BASE = 'windows';\n\n/**\n * These folders will be excluded from search to speed it up\n */\nconst GLOB_EXCLUDE_PATTERN = ['**/@(node_modules)/**'];\n\n/**\n * Finds windows project by looking for all .sln files\n * in given folder.\n *\n * Returns first match if files are found or null\n *\n * Note: `./windows/*.sln` are returned regardless of the name\n */\nmodule.exports = function findSolution(folder) {\n  const projects = glob\n    .sync(GLOB_PATTERN, {\n      cwd: folder,\n      ignore: GLOB_EXCLUDE_PATTERN,\n    })\n    .filter(project => {\n      return path.dirname(project) === WINDOWS_BASE || !TEST_PROJECTS.test(project);\n    })\n    .sort((projectA, projectB) => {\n      return path.dirname(projectA) === WINDOWS_BASE ? -1 : 1;\n    });\n\n  if (projects.length === 0) {\n    return null;\n  }\n\n  return projects[0];\n};\n"
  },
  {
    "path": "local-cli/core/windows/generateGUID.js",
    "content": "const s4 = () => {\n  return Math.floor((1 + Math.random()) * 0x10000)\n    .toString(16)\n    .substring(1);\n};\n\nmodule.exports = function generateGUID() {\n  return s4() + s4() + '-' + s4() + '-' + s4() + '-' +\n    s4() + '-' + s4() + s4() + s4();\n};\n"
  },
  {
    "path": "local-cli/core/windows/index.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst findWindowsSolution = require('./findWindowsSolution');\nconst findNamespace = require('./findNamespace');\nconst findProject = require('./findProject');\nconst findPackageClassName = require('./findPackageClassName');\nconst path = require('path');\nconst generateGUID = require('./generateGUID');\n\nconst relativeProjectPath = (fullProjPath) => {\n  const windowsPath = fullProjPath\n                  .substring(fullProjPath.lastIndexOf('node_modules') - 1, fullProjPath.length)\n                  .replace(/\\//g, '\\\\');\n\n  return '..' + windowsPath;\n};\n\nconst getProjectName = (fullProjPath) => {\n  return fullProjPath.split('/').slice(-1)[0].replace(/\\.csproj/i, '');\n};\n\n/**\n * Gets windows project config by analyzing given folder and taking some\n * defaults specified by user into consideration\n */\nexports.projectConfig = function projectConfigWindows(folder, userConfig) {\n\n  const csSolution = userConfig.csSolution || findWindowsSolution(folder);\n\n  if (!csSolution) {\n    return null;\n  }\n\n  // expects solutions to be named the same as project folders\n  const solutionPath = path.join(folder, csSolution);\n  const windowsAppFolder = csSolution.substring(0, csSolution.lastIndexOf('.sln'));\n  const src = userConfig.sourceDir || windowsAppFolder;\n  const sourceDir = path.join(folder, src);\n  const mainPage = path.join(sourceDir, 'MainPage.cs');\n  const projectPath = userConfig.projectPath || findProject(folder);\n\n  return {\n    sourceDir,\n    solutionPath,\n    projectPath,\n    mainPage,\n    folder,\n    userConfig,\n  };\n};\n\n/**\n * Same as projectConfigWindows except it returns\n * different config that applies to packages only\n */\nexports.dependencyConfig = function dependencyConfigWindows(folder, userConfig) {\n\n  const csSolution = userConfig.csSolution || findWindowsSolution(folder);\n\n  if (!csSolution) {\n    return null;\n  }\n\n  // expects solutions to be named the same as project folders\n  const windowsAppFolder = csSolution.substring(0, csSolution.lastIndexOf('.sln'));\n  const src = userConfig.sourceDir || windowsAppFolder;\n\n  if (!src) {\n    return null;\n  }\n\n  const sourceDir = path.join(folder, src);\n  const packageClassName = findPackageClassName(sourceDir);\n  const namespace = userConfig.namespace || findNamespace(sourceDir);\n  const csProj = userConfig.csProj || findProject(folder);\n\n  /**\n   * This module has no package to export or no namespace\n   */\n  if (!packageClassName || !namespace) {\n    return null;\n  }\n\n  const packageUsingPath = userConfig.packageUsingPath ||\n    `using ${namespace};`;\n\n  const packageInstance = userConfig.packageInstance ||\n    `new ${packageClassName}()`;\n\n  const projectGUID = generateGUID();\n  const pathGUID = generateGUID();\n  const projectName = getProjectName(csProj);\n  const relativeProjPath = relativeProjectPath(csProj);\n\n  return {\n    sourceDir,\n    packageUsingPath,\n    packageInstance,\n    projectName,\n    csProj,\n    folder,\n    projectGUID,\n    pathGUID,\n    relativeProjPath,\n  };\n};\n"
  },
  {
    "path": "local-cli/core/wrapCommands.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst makeCommand = require('./makeCommand');\n\nmodule.exports = function wrapCommands(commands) {\n  const mappedCommands = {};\n  Object.keys(commands || []).forEach((k) => {\n    mappedCommands[k] = makeCommand(commands[k]);\n  });\n  return mappedCommands;\n};\n"
  },
  {
    "path": "local-cli/dependencies/dependencies.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst Metro = require('metro');\n\nconst denodeify = require('denodeify');\nconst fs = require('fs');\nconst path = require('path');\n\nconst {ASSET_REGISTRY_PATH} = require('../core/Constants');\n\nfunction dependencies(argv, config, args, packagerInstance) {\n  const rootModuleAbsolutePath = args.entryFile;\n  if (!fs.existsSync(rootModuleAbsolutePath)) {\n    return Promise.reject(new Error(`File ${rootModuleAbsolutePath} does not exist`));\n  }\n\n  const transformModulePath =\n      args.transformer ? path.resolve(args.transformer) :\n      typeof config.getTransformModulePath === 'function' ? config.getTransformModulePath() :\n      undefined;\n\n  const packageOpts = {\n    assetRegistryPath: ASSET_REGISTRY_PATH,\n    projectRoots: config.getProjectRoots(),\n    blacklistRE: config.getBlacklistRE(),\n    getPolyfills: config.getPolyfills,\n    getTransformOptions: config.getTransformOptions,\n    hasteImpl: config.hasteImpl,\n    postMinifyProcess: config.postMinifyProcess,\n    transformModulePath: transformModulePath,\n    extraNodeModules: config.extraNodeModules,\n    verbose: config.verbose,\n    workerPath: config.getWorkerPath(),\n  };\n\n  const relativePath = packageOpts.projectRoots.map(root =>\n    path.relative(\n      root,\n      rootModuleAbsolutePath\n    )\n  )[0];\n\n  const options = {\n    platform: args.platform,\n    entryFile: relativePath,\n    dev: args.dev,\n    minify: false,\n    generateSourceMaps: !args.dev,\n  };\n\n  const writeToFile = args.output;\n  const outStream = writeToFile\n    ? fs.createWriteStream(args.output)\n    : process.stdout;\n\n  return Promise.resolve((packagerInstance ?\n    packagerInstance.getOrderedDependencyPaths(options) :\n    Metro.getOrderedDependencyPaths(packageOpts, options)).then(\n    deps => {\n      deps.forEach(modulePath => {\n        // Temporary hack to disable listing dependencies not under this directory.\n        // Long term, we need either\n        // (a) JS code to not depend on anything outside this directory, or\n        // (b) Come up with a way to declare this dependency in Buck.\n        const isInsideProjectRoots = packageOpts.projectRoots.filter(\n          root => modulePath.startsWith(root)\n        ).length > 0;\n\n        if (isInsideProjectRoots) {\n          outStream.write(modulePath + '\\n');\n        }\n      });\n      return writeToFile\n        ? denodeify(outStream.end).bind(outStream)()\n        : Promise.resolve();\n    }\n  ));\n}\n\nmodule.exports = {\n  name: 'dependencies',\n  func: dependencies,\n  options: [\n    {\n      command: '--entry-file <path>',\n      description: 'Absolute path to the root JS file',\n    }, {\n      command: '--output [path]',\n      description: 'File name where to store the output, ex. /tmp/dependencies.txt',\n    }, {\n      command: '--platform [extension]',\n      description: 'The platform extension used for selecting modules',\n    }, {\n      command: '--transformer [path]',\n      description: 'Specify a custom transformer to be used'\n    }, {\n      command: '--max-workers [number]',\n      description: 'Specifies the maximum number of workers the worker-pool ' +\n        'will spawn for transforming files. This defaults to the number of the ' +\n        'cores available on your machine.',\n      parse: (workers: string) => Number(workers),\n    }, {\n      command: '--dev [boolean]',\n      description: 'If false, skip all dev-only code path',\n      parse: (val) => val === 'false' ? false : true,\n      default: true,\n    }, {\n      command: '--verbose',\n      description: 'Enables logging',\n      default: false,\n    },\n  ],\n};\n"
  },
  {
    "path": "local-cli/eject/eject.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst copyProjectTemplateAndReplace = require('../generator/copyProjectTemplateAndReplace');\nconst path = require('path');\nconst fs = require('fs');\n\n/**\n * The eject command re-creates the `android` and `ios` native folders. Because native code can be\n * difficult to maintain, this new script allows an `app.json` to be defined for the project, which\n * is used to configure the native app.\n *\n * The `app.json` config may contain the following keys:\n *\n * - `name` - The short name used for the project, should be TitleCase\n * - `displayName` - The app's name on the home screen\n */\n\nfunction eject() {\n\n  const doesIOSExist = fs.existsSync(path.resolve('ios'));\n  const doesAndroidExist = fs.existsSync(path.resolve('android'));\n  if (doesIOSExist && doesAndroidExist) {\n    console.error(\n      'Both the iOS and Android folders already exist! Please delete `ios` and/or `android` ' +\n      'before ejecting.'\n    );\n    process.exit(1);\n  }\n\n  let appConfig = null;\n  try {\n    appConfig = require(path.resolve('app.json'));\n  } catch (e) {\n    console.error(\n      'Eject requires an `app.json` config file to be located at ' +\n      `${path.resolve('app.json')}, and it must at least specify a \\`name\\` for the project ` +\n      'name, and a `displayName` for the app\\'s home screen label.'\n    );\n    process.exit(1);\n  }\n\n  const appName = appConfig.name;\n  if (!appName) {\n    console.error(\n      'App `name` must be defined in the `app.json` config file to define the project name. ' +\n      'It must not contain any spaces or dashes.'\n    );\n    process.exit(1);\n  }\n  const displayName = appConfig.displayName;\n  if (!displayName) {\n    console.error(\n      'App `displayName` must be defined in the `app.json` config file, to define the label ' +\n      'of the app on the home screen.'\n    );\n    process.exit(1);\n  }\n\n  const templateOptions = { displayName };\n\n  if (!doesIOSExist) {\n    console.log('Generating the iOS folder.');\n    copyProjectTemplateAndReplace(\n      path.resolve('node_modules', 'react-native', 'local-cli', 'templates', 'HelloWorld', 'ios'),\n      path.resolve('ios'),\n      appName,\n      templateOptions\n    );\n  }\n\n  if (!doesAndroidExist) {\n    console.log('Generating the Android folder.');\n    copyProjectTemplateAndReplace(\n      path.resolve('node_modules', 'react-native', 'local-cli', 'templates', 'HelloWorld', 'android'),\n      path.resolve('android'),\n      appName,\n      templateOptions\n    );\n  }\n\n}\n\nmodule.exports = {\n  name: 'eject',\n  description: 'Re-create the iOS and Android folders and native code',\n  func: eject,\n  options: [],\n};\n"
  },
  {
    "path": "local-cli/generator/copyProjectTemplateAndReplace.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst chalk = require('chalk');\nconst copyAndReplace = require('../util/copyAndReplace');\nconst path = require('path');\nconst prompt = require('./promptSync')();\nconst walk = require('../util/walk');\n\n/**\n * Util for creating a new React Native project.\n * Copy the project from a template and use the correct project name in\n * all files.\n * @param srcPath e.g. '/Users/martin/AwesomeApp/node_modules/react-native/local-cli/templates/HelloWorld'\n * @param destPath e.g. '/Users/martin/AwesomeApp'\n * @param newProjectName e.g. 'AwesomeApp'\n * @param options e.g. {\n *          upgrade: true,\n *          force: false,\n *          displayName: 'Hello World',\n *          ignorePaths: ['template/file/to/ignore.md'],\n *        }\n */\nfunction copyProjectTemplateAndReplace(srcPath, destPath, newProjectName, options) {\n  if (!srcPath) { throw new Error('Need a path to copy from'); }\n  if (!destPath) { throw new Error('Need a path to copy to'); }\n  if (!newProjectName) { throw new Error('Need a project name'); }\n\n  options = options || {};\n\n  walk(srcPath).forEach(absoluteSrcFilePath => {\n\n    // 'react-native upgrade'\n    if (options.upgrade) {\n      // Don't upgrade these files\n      const fileName = path.basename(absoluteSrcFilePath);\n      // This also includes __tests__/index.*.js\n      if (fileName === 'index.ios.js') { return; }\n      if (fileName === 'index.android.js') { return; }\n      if (fileName === 'index.js') { return; }\n      if (fileName === 'App.js') { return; }\n    }\n\n    const relativeFilePath = path.relative(srcPath, absoluteSrcFilePath);\n    const relativeRenamedPath = dotFilePath(relativeFilePath)\n      .replace(/HelloWorld/g, newProjectName)\n      .replace(/helloworld/g, newProjectName.toLowerCase());\n\n    // Templates may contain files that we don't want to copy.\n    // Examples:\n    // - Dummy package.json file included in the template only for publishing to npm\n    // - Docs specific to the template (.md files)\n    if (options.ignorePaths) {\n      if (!Array.isArray(options.ignorePaths)) {\n        throw new Error('options.ignorePaths must be an array');\n      }\n      if (options.ignorePaths.some(ignorePath => ignorePath === relativeFilePath)) {\n        // Skip copying this file\n        return;\n      }\n    }\n\n    let contentChangedCallback = null;\n    if (options.upgrade && (!options.force)) {\n      contentChangedCallback = (_, contentChanged) => {\n        return upgradeFileContentChangedCallback(\n          absoluteSrcFilePath,\n          relativeRenamedPath,\n          contentChanged,\n        );\n      };\n    }\n    copyAndReplace(\n      absoluteSrcFilePath,\n      path.resolve(destPath, relativeRenamedPath),\n      {\n        'Hello App Display Name': options.displayName || newProjectName,\n        'HelloWorld': newProjectName,\n        'helloworld': newProjectName.toLowerCase(),\n      },\n      contentChangedCallback,\n    );\n  });\n}\n\n/**\n * There are various dotfiles in the templates folder in the RN repo. We want\n * these to be ignored by tools when working with React Native itself.\n * Example: _babelrc file is ignored by Babel, renamed to .babelrc inside\n *          a real app folder.\n * This is especially important for .gitignore because npm has some special\n * behavior of automatically renaming .gitignore to .npmignore.\n */\nfunction dotFilePath(path) {\n  if (!path) {return path;}\n  return path\n    .replace('_gitignore', '.gitignore')\n    .replace('_gitattributes', '.gitattributes')\n    .replace('_babelrc', '.babelrc')\n    .replace('_flowconfig', '.flowconfig')\n    .replace('_buckconfig', '.buckconfig')\n    .replace('_watchmanconfig', '.watchmanconfig');\n}\n\nfunction upgradeFileContentChangedCallback(\n  absoluteSrcFilePath,\n  relativeDestPath,\n  contentChanged\n) {\n  if (contentChanged === 'new') {\n    console.log(chalk.bold('new') + ' ' + relativeDestPath);\n    return 'overwrite';\n  } else if (contentChanged === 'changed') {\n    console.log(chalk.bold(relativeDestPath) + ' ' +\n      'has changed in the new version.\\nDo you want to keep your ' +\n      relativeDestPath + ' or replace it with the ' +\n      'latest version?\\nIf you ever made any changes ' +\n      'to this file, you\\'ll probably want to keep it.\\n' +\n      'You can see the new version here: ' + absoluteSrcFilePath + '\\n' +\n      'Do you want to replace ' + relativeDestPath + '? ' +\n      'Answer y to replace, n to keep your version: ');\n    const answer = prompt();\n    if (answer === 'y') {\n      console.log('Replacing ' + relativeDestPath);\n      return 'overwrite';\n    } else {\n      console.log('Keeping your ' + relativeDestPath);\n      return 'keep';\n    }\n  } else if (contentChanged === 'identical') {\n    return 'keep';\n  } else {\n    throw new Error(`Unkown file changed state: ${relativeDestPath}, ${contentChanged}`);\n  }\n}\n\nmodule.exports = copyProjectTemplateAndReplace;\n"
  },
  {
    "path": "local-cli/generator/printRunInstructions.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nvar chalk = require('chalk');\nvar path = require('path');\n\nfunction printRunInstructions(projectDir, projectName) {\n  const absoluteProjectDir = path.resolve(projectDir);\n  // iOS\n  const xcodeProjectPath = path.resolve(projectDir, 'macos', projectName) + '.xcodeproj';\n  const relativeXcodeProjectPath = path.relative(process.cwd(), xcodeProjectPath);\n  // console.log(chalk.white.bold('To run your app on iOS:'));\n  // console.log('   cd ' + absoluteProjectDir);\n  // console.log('   react-native run-ios');\n  // console.log('   - or -');\n  // console.log('   Open ' + relativeXcodeProjectPath + ' in Xcode');\n  // console.log('   Hit the Run button');\n  // // Android\n  // console.log(chalk.white.bold('To run your app on Android:'));\n  // console.log('   cd ' + absoluteProjectDir);\n  // console.log('   Have an Android emulator running (quickest way to get started), or a device connected');\n  // console.log('   react-native run-android');\n  // macOS\n  console.log(chalk.white.bold('To run your app on macOS:'));\n  console.log('   cd ' + absoluteProjectDir);\n  console.log('   react-native-macos run-macos');\n  console.log('   Open ' + relativeXcodeProjectPath + ' in Xcode');\n  console.log('   Hit the Run button');\n}\n\nmodule.exports = printRunInstructions;\n"
  },
  {
    "path": "local-cli/generator/promptSync.js",
    "content": "// Simplified version of:\n// https://github.com/0x00A/prompt-sync/blob/master/index.js\n\n'use strict';\n\nvar fs = require('fs');\nvar term = 13; // carriage return\n\nfunction create() {\n\n  return prompt;\n\n  function prompt(ask, value, opts) {\n    var insert = 0, savedinsert = 0, res, i, savedstr;\n    opts = opts || {};\n\n    if (Object(ask) === ask) {\n      opts = ask;\n      ask = opts.ask;\n    } else if (Object(value) === value) {\n      opts = value;\n      value = opts.value;\n    }\n    ask = ask || '';\n    var echo = opts.echo;\n    var masked = 'echo' in opts;\n\n    var fd = (process.platform === 'win32') ?\n      process.stdin.fd :\n      fs.openSync('/dev/tty', 'rs');\n\n    var wasRaw = process.stdin.isRaw;\n    if (!wasRaw) { process.stdin.setRawMode(true); }\n\n    var buf = new Buffer(3);\n    var str = '', character, read;\n\n    savedstr = '';\n\n    if (ask) {\n      process.stdout.write(ask);\n    }\n\n    var cycle = 0;\n    var prevComplete;\n\n    while (true) {\n      read = fs.readSync(fd, buf, 0, 3);\n      if (read > 1) { // received a control sequence\n        if (buf.toString()) {\n          str = str + buf.toString();\n          str = str.replace(/\\0/g, '');\n          insert = str.length;\n          process.stdout.write('\\u001b[2K\\u001b[0G' + ask + str);\n          process.stdout.write('\\u001b[' + (insert + ask.length + 1) + 'G');\n          buf = new Buffer(3);\n        }\n        continue; // any other 3 character sequence is ignored\n      }\n\n      // if it is not a control character seq, assume only one character is read\n      character = buf[read - 1];\n\n      // catch a ^C and return null\n      if (character == 3){\n        process.stdout.write('^C\\n');\n        fs.closeSync(fd);\n        process.exit(130);\n        process.stdin.setRawMode(wasRaw);\n        return null;\n      }\n\n      // catch the terminating character\n      if (character == term) {\n        fs.closeSync(fd);\n        break;\n      }\n\n      if (character == 127 || (process.platform == 'win32' && character == 8)) { //backspace\n        if (!insert) {continue;}\n        str = str.slice(0, insert - 1) + str.slice(insert);\n        insert--;\n        process.stdout.write('\\u001b[2D');\n      } else {\n        if ((character < 32 ) || (character > 126))\n            {continue;}\n        str = str.slice(0, insert) + String.fromCharCode(character) + str.slice(insert);\n        insert++;\n      }\n\n      if (masked) {\n          process.stdout.write('\\u001b[2K\\u001b[0G' + ask + Array(str.length + 1).join(echo));\n      } else {\n        process.stdout.write('\\u001b[s');\n        if (insert == str.length) {\n            process.stdout.write('\\u001b[2K\\u001b[0G' + ask + str);\n        } else {\n          if (ask) {\n            process.stdout.write('\\u001b[2K\\u001b[0G' + ask + str);\n          } else {\n            process.stdout.write('\\u001b[2K\\u001b[0G' + str + '\\u001b[' + (str.length - insert) + 'D');\n          }\n        }\n        process.stdout.write('\\u001b[u');\n        process.stdout.write('\\u001b[1C');\n      }\n\n    }\n\n    process.stdout.write('\\n');\n\n    process.stdin.setRawMode(wasRaw);\n\n    return str || value || '';\n  }\n}\n\nmodule.exports = create;\n"
  },
  {
    "path": "local-cli/generator/templates.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst copyProjectTemplateAndReplace = require('./copyProjectTemplateAndReplace');\nconst execSync = require('child_process').execSync;\nconst fs = require('fs');\nconst path = require('path');\n\n/**\n * Templates released as part of react-native in local-cli/templates.\n */\nconst builtInTemplates = {\n  navigation: 'HelloNavigation',\n};\n\nfunction listTemplatesAndExit(newProjectName, options) {\n  if (options.template === true) {\n    // Just listing templates using 'react-native init --template'.\n    // Not creating a new app.\n    // Print available templates and exit.\n    const templateKeys = Object.keys(builtInTemplates);\n    if (templateKeys.length === 0) {\n      // Just a guard, should never happen as long builtInTemplates\n      // above is defined correctly :)\n      console.log(\n        'There are no templates available besides ' +\n        'the default \"Hello World\" one.'\n      );\n    } else {\n      console.log(\n        'The available templates are:\\n' +\n        templateKeys.join('\\n') +\n        '\\nYou can use these to create an app based on a template, for example: ' +\n        'you could run: ' +\n        'react-native init ' + newProjectName + ' --template ' + templateKeys[0]\n      );\n    }\n    // Exit 'react-native init'\n    return true;\n  }\n  // Continue 'react-native init'\n  return false;\n}\n\n/**\n * @param destPath Create the new project at this path.\n * @param newProjectName For example 'AwesomeApp'.\n * @param template Template to use, for example 'navigation'.\n * @param yarnVersion Version of yarn available on the system, or null if\n *                    yarn is not available. For example '0.18.1'.\n */\nfunction createProjectFromTemplate(destPath, newProjectName, template, yarnVersion) {\n  // Expand the basic 'HelloWorld' template\n  copyProjectTemplateAndReplace(\n    path.resolve('node_modules', 'react-native-macos', 'local-cli', 'templates', 'HelloWorld'),\n    destPath,\n    newProjectName\n  );\n\n  if (template === undefined) {\n    // No specific template, use just the HelloWorld template above\n    return;\n  }\n\n  // Keep the files from the 'HelloWorld' template, and overwrite some of them\n  // with the specified project template.\n  // The 'HelloWorld' template contains the native files (these are used by\n  // all templates) and every other template only contains additional JS code.\n  // Reason:\n  // This way we don't have to duplicate the native files in every template.\n  // If we duplicated them we'd make RN larger and risk that people would\n  // forget to maintain all the copies so they would go out of sync.\n  const builtInTemplateName = builtInTemplates[template];\n  if (builtInTemplateName) {\n    // template is e.g. 'navigation',\n    // use the built-in local-cli/templates/HelloNavigation folder\n    createFromBuiltInTemplate(builtInTemplateName, destPath, newProjectName, yarnVersion);\n  } else {\n    // template is e.g. 'ignite',\n    // use the template react-native-template-ignite from npm\n    createFromRemoteTemplate(template, destPath, newProjectName, yarnVersion);\n  }\n}\n\n// (We might want to get rid of built-in templates in the future -\n// publish them to npm and install from there.)\nfunction createFromBuiltInTemplate(templateName, destPath, newProjectName, yarnVersion) {\n  const templatePath = path.resolve(\n    'node_modules', 'react-native-macos', 'local-cli', 'templates', templateName\n  );\n  copyProjectTemplateAndReplace(\n    templatePath,\n    destPath,\n    newProjectName,\n  );\n  installTemplateDependencies(templatePath, yarnVersion);\n}\n\n/**\n * The following formats are supported for the template:\n * - 'demo' -> Fetch the package react-native-template-demo from npm\n * - git://..., http://..., file://... or any other URL supported by npm\n */\nfunction createFromRemoteTemplate(template, destPath, newProjectName, yarnVersion) {\n  let installPackage;\n  let templateName;\n  if (template.includes('://')) {\n     // URL, e.g. git://, file://\n     installPackage = template;\n     templateName = template.substr(template.lastIndexOf('/') + 1);\n  } else {\n    // e.g 'demo'\n    installPackage = 'react-native-template-' + template;\n    templateName = installPackage;\n  }\n\n  // Check if the template exists\n  console.log(`Fetching template ${installPackage}...`);\n  try {\n    if (yarnVersion) {\n      execSync(`yarn add ${installPackage} --ignore-scripts`, {stdio: 'inherit'});\n    } else {\n      execSync(`npm install ${installPackage} --save --save-exact --ignore-scripts`, {stdio: 'inherit'});\n    }\n    const templatePath = path.resolve(\n      'node_modules', templateName\n    );\n    copyProjectTemplateAndReplace(\n      templatePath,\n      destPath,\n      newProjectName,\n      {\n        // Every template contains a dummy package.json file included\n        // only for publishing the template to npm.\n        // We want to ignore this dummy file, otherwise it would overwrite\n        // our project's package.json file.\n        ignorePaths: ['package.json', 'dependencies.json'],\n      }\n    );\n    installTemplateDependencies(templatePath, yarnVersion);\n  } finally {\n    // Clean up the temp files\n    try {\n      if (yarnVersion) {\n        execSync(`yarn remove ${templateName} --ignore-scripts`);\n      } else {\n        execSync(`npm uninstall ${templateName} --ignore-scripts`);\n      }\n    } catch (err) {\n      // Not critical but we still want people to know and report\n      // if this the clean up fails.\n      console.warn(\n        `Failed to clean up template temp files in node_modules/${templateName}. ` +\n        'This is not a critical error, you can work on your app.'\n      );\n    }\n  }\n}\n\nfunction installTemplateDependencies(templatePath, yarnVersion) {\n  // dependencies.json is a special file that lists additional dependencies\n  // that are required by this template\n  const dependenciesJsonPath = path.resolve(\n    templatePath, 'dependencies.json'\n  );\n  console.log('Adding dependencies for the project...');\n  if (!fs.existsSync(dependenciesJsonPath)) {\n    console.log('No additional dependencies.');\n    return;\n  }\n\n  let dependencies;\n  try {\n    dependencies = JSON.parse(fs.readFileSync(dependenciesJsonPath));\n  } catch (err) {\n    throw new Error(\n      'Could not parse the template\\'s dependencies.json: ' + err.message\n    );\n  }\n  for (let depName in dependencies) {\n    const depVersion = dependencies[depName];\n    const depToInstall = depName + '@' + depVersion;\n    console.log('Adding ' + depToInstall + '...');\n    if (yarnVersion) {\n      execSync(`yarn add ${depToInstall}`, {stdio: 'inherit'});\n    } else {\n      execSync(`npm install ${depToInstall} --save --save-exact`, {stdio: 'inherit'});\n    }\n  }\n  console.log('Linking native dependencies into the project\\'s build files...');\n  execSync('react-native link', {stdio: 'inherit'});\n}\n\nmodule.exports = {\n  listTemplatesAndExit,\n  createProjectFromTemplate,\n};\n"
  },
  {
    "path": "local-cli/index.js",
    "content": "'use strict';\n\nmodule.exports = [\n  require('./runMacOS/runMacOS')\n];"
  },
  {
    "path": "local-cli/info/info.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst envinfo = require('envinfo');\n\nconst info = function() {\n  const args = Array.prototype.slice.call(arguments)[2];\n\n  try {\n    envinfo.print({\n      packages: typeof args.packages === 'string' ? ['react', 'react-native'].concat(args.packages.split(',')) : args.packages\n    });\n  } catch (error) {\n    console.log('Error: unable to print environment info');\n    console.log(error);\n  }\n};\n\nmodule.exports = {\n  name: 'info',\n  description: 'Get relevant version info about OS, toolchain and libraries',\n  options: [\n    {\n      command: '--packages [string]',\n      description: 'Which packages from your package.json to include, in addition to the default React Native and React versions.',\n      default: ['react', 'react-native']\n    },\n  ],\n  examples: [\n    {\n      desc: 'Get standard version info',\n      cmd: 'react-native info',\n    },\n    {\n      desc: 'Get standard version info & specified package versions',\n      cmd: 'react-native info --packages jest,eslint,babel-polyfill',\n    }\n  ],\n  func: info,\n};\n"
  },
  {
    "path": "local-cli/init/init.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst {\n  listTemplatesAndExit,\n  createProjectFromTemplate,\n} = require('../generator/templates');\nconst execSync = require('child_process').execSync;\nconst fs = require('fs');\nconst minimist = require('minimist');\nconst path = require('path');\nconst printRunInstructions = require('../generator/printRunInstructions');\nconst process = require('process');\nconst yarn = require('../util/yarn');\n\n/**\n * Creates the template for a React Native project given the provided\n * parameters:\n * @param projectDir Templates will be copied here.\n * @param argsOrName Project name or full list of custom arguments\n *                   for the generator.\n * @param options Command line options passed from the react-native-cli directly.\n *                E.g. `{ version: '0.43.0', template: 'navigation' }`\n */\nfunction init(projectDir, argsOrName) {\n  const args = Array.isArray(argsOrName)\n    ? argsOrName // argsOrName was e.g. ['AwesomeApp', '--verbose']\n    : [argsOrName].concat(process.argv.slice(4)); // argsOrName was e.g. 'AwesomeApp'\n\n  // args array is e.g. ['AwesomeApp', '--verbose', '--template', 'navigation']\n  if (!args || args.length === 0) {\n    console.error('react-native init requires a project name.');\n    return;\n  }\n\n  const newProjectName = args[0];\n  const options = minimist(args);\n\n  if (listTemplatesAndExit(newProjectName, options)) {\n    // Just listing templates using 'react-native init --template'\n    // Not creating a new app.\n    return;\n  } else {\n    console.log('Setting up new React Native app in ' + projectDir);\n    generateProject(projectDir, newProjectName, options);\n  }\n}\n\n/**\n * Generates a new React Native project based on the template.\n * @param Absolute path at which the project folder should be created.\n * @param options Command line arguments parsed by minimist.\n */\nfunction generateProject(destinationRoot, newProjectName, options) {\n  var reactNativePackageJson = require('../../package.json');\n  var { peerDependencies } = reactNativePackageJson;\n  if (!peerDependencies) {\n    console.error('Missing React peer dependency in React Native\\'s package.json. Aborting.');\n    return;\n  }\n\n  var reactVersion = peerDependencies.react;\n  if (!reactVersion) {\n    console.error('Missing React peer dependency in React Native\\'s package.json. Aborting.');\n    return;\n  }\n\n  const yarnVersion =\n    (!options.npm) &&\n    yarn.getYarnVersionIfAvailable() &&\n    yarn.isGlobalCliUsingYarn(destinationRoot);\n\n  createProjectFromTemplate(destinationRoot, newProjectName, options.template, yarnVersion);\n\n  if (yarnVersion) {\n    console.log('Adding React...');\n    execSync(`yarn add react@${reactVersion}`, {stdio: 'inherit'});\n    execSync(`yarn add babel-plugin-module-resolver`, {stdio: 'inherit'});\n  } else {\n    console.log('Installing React...');\n    execSync(`npm install react@${reactVersion} --save --save-exact`, {stdio: 'inherit'});\n    execSync(`npm install babel-plugin-module-resolver --save-dev`);\n  }\n  if (!options['skip-jest']) {\n    const jestDeps = (\n      `jest babel-jest babel-preset-react-native react-test-renderer@${reactVersion}`\n    );\n    if (yarnVersion) {\n      console.log('Adding Jest...');\n      execSync(`yarn add ${jestDeps} --dev --exact`, {stdio: 'inherit'});\n    } else {\n      console.log('Installing Jest...');\n      execSync(`npm install ${jestDeps} --save-dev --save-exact`, {stdio: 'inherit'});\n    }\n    addJestToPackageJson(destinationRoot);\n  }\n  printRunInstructions(destinationRoot, newProjectName);\n}\n\n/**\n * Add Jest-related stuff to package.json, which was created by the react-native-cli.\n */\nfunction addJestToPackageJson(destinationRoot) {\n  var packageJSONPath = path.join(destinationRoot, 'package.json');\n  var packageJSON = JSON.parse(fs.readFileSync(packageJSONPath));\n\n  packageJSON.scripts.test = 'jest';\n  packageJSON.jest = {\n    preset: 'react-native-macos'\n  };\n  fs.writeFileSync(packageJSONPath, JSON.stringify(packageJSON, null, 2));\n}\n\nmodule.exports = init;\n"
  },
  {
    "path": "local-cli/install/install.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst spawnSync = require('child_process').spawnSync;\nconst log = require('npmlog');\nconst PackageManager = require('../util/PackageManager');\nconst spawnOpts = {\n  stdio: 'inherit',\n  stdin: 'inherit',\n};\n\nlog.heading = 'rnpm-install';\n\nfunction install(args, config) {\n  const name = args[0];\n\n  let res = PackageManager.add(name);\n\n  if (res.status) {\n    process.exit(res.status);\n  }\n\n  res = spawnSync('react-native', ['link', name], spawnOpts);\n\n  if (res.status) {\n    process.exit(res.status);\n  }\n\n  log.info(`Module ${name} has been successfully installed & linked`);\n}\n\nmodule.exports = {\n  func: install,\n  description: 'install and link native dependencies',\n  name: 'install <packageName>',\n};\n"
  },
  {
    "path": "local-cli/install/uninstall.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst spawnSync = require('child_process').spawnSync;\nconst log = require('npmlog');\nconst PackageManager = require('../util/PackageManager');\nconst spawnOpts = {\n  stdio: 'inherit',\n  stdin: 'inherit',\n};\n\nlog.heading = 'rnpm-install';\n\nfunction uninstall(args, config) {\n  const name = args[0];\n\n  var res = spawnSync('react-native', ['unlink', name], spawnOpts);\n\n  if (res.status) {\n    process.exit(res.status);\n  }\n\n  res = PackageManager.remove(name);\n\n  if (res.status) {\n    process.exit(res.status);\n  }\n\n  log.info(`Module ${name} has been successfully uninstalled & unlinked`);\n}\n\nmodule.exports = {\n  func: uninstall,\n  description: 'uninstall and unlink native dependencies',\n  name: 'uninstall <packageName>',\n};\n"
  },
  {
    "path": "local-cli/library/library.js",
    "content": " /**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst copyAndReplace = require('../util/copyAndReplace');\nconst fs = require('fs');\nconst isValidPackageName = require('../util/isValidPackageName');\nconst path = require('path');\nconst walk = require('../util/walk');\n\n/**\n * Creates a new native library with the given name\n */\nfunction library(argv, config, args) {\n  if (!isValidPackageName(args.name)) {\n    return Promise.reject(\n      args.name + ' is not a valid name for a project. Please use a valid ' +\n      'identifier name (alphanumeric).'\n    );\n  }\n\n  const root = process.cwd();\n  const libraries = path.resolve(root, 'Libraries');\n  const libraryDest = path.resolve(libraries, args.name);\n  const source = path.resolve('node_modules', 'react-native', 'Libraries', 'Sample');\n\n  if (!fs.existsSync(libraries)) {\n    fs.mkdir(libraries);\n  }\n\n  if (fs.existsSync(libraryDest)) {\n    return Promise.reject(new Error(`Library already exists in ${libraryDest}`));\n  }\n\n  walk(source).forEach(f => {\n    if (f.indexOf('project.xcworkspace') !== -1 ||\n        f.indexOf('.xcodeproj/xcuserdata') !== -1) {\n      return;\n    }\n\n    const dest = path.relative(source, f.replace(/Sample/g, args.name).replace(/^_/, '.'));\n    copyAndReplace(\n      path.resolve(source, f),\n      path.resolve(libraryDest, dest),\n      {'Sample': args.name}\n    );\n  });\n\n  console.log('Created library in', libraryDest);\n  console.log('Next Steps:');\n  console.log('   Link your library in Xcode:');\n  console.log(\n    '   https://facebook.github.io/react-native/docs/' +\n    'linking-libraries-ios.html#content\\n'\n  );\n}\n\nmodule.exports = {\n  name: 'new-library',\n  func: library,\n  description: 'generates a native library bridge',\n  options: [{\n    command: '--name <string>',\n    description: 'name of the library to generate',\n    default: null,\n  }],\n};\n"
  },
  {
    "path": "local-cli/link/__fixtures__/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "local-cli/link/__fixtures__/android/0.17/MainActivity.java",
    "content": "package com.basic;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.view.KeyEvent;\n\nimport com.facebook.react.LifecycleState;\nimport com.facebook.react.ReactInstanceManager;\nimport com.facebook.react.ReactRootView;\nimport com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;\nimport com.facebook.react.shell.MainReactPackage;\nimport com.facebook.soloader.SoLoader;\n\npublic class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {\n\n    private ReactInstanceManager mReactInstanceManager;\n    private ReactRootView mReactRootView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        mReactRootView = new ReactRootView(this);\n\n        mReactInstanceManager = ReactInstanceManager.builder()\n                .setApplication(getApplication())\n                .setBundleAssetName(\"index.android.bundle\")\n                .setJSMainModuleName(\"index.android\")\n                .addPackage(new MainReactPackage())\n                .setUseDeveloperSupport(BuildConfig.DEBUG)\n                .setInitialLifecycleState(LifecycleState.RESUMED)\n                .build();\n\n        mReactRootView.startReactApplication(mReactInstanceManager, \"Basic\", null);\n\n        setContentView(mReactRootView);\n    }\n\n    @Override\n    public boolean onKeyUp(int keyCode, KeyEvent event) {\n        if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) {\n            mReactInstanceManager.showDevOptionsDialog();\n            return true;\n        }\n        return super.onKeyUp(keyCode, event);\n    }\n\n    @Override\n    public void onBackPressed() {\n      if (mReactInstanceManager != null) {\n        mReactInstanceManager.onBackPressed();\n      } else {\n        super.onBackPressed();\n      }\n    }\n\n    @Override\n    public void invokeDefaultOnBackPressed() {\n      super.onBackPressed();\n    }\n\n    @Override\n    protected void onPause() {\n        super.onPause();\n\n        if (mReactInstanceManager != null) {\n            mReactInstanceManager.onPause();\n        }\n    }\n\n    @Override\n    protected void onResume() {\n        super.onResume();\n\n        if (mReactInstanceManager != null) {\n            mReactInstanceManager.onResume(this, this);\n        }\n    }\n}\n"
  },
  {
    "path": "local-cli/link/__fixtures__/android/0.17/patchedMainActivity.java",
    "content": "package com.basic;\n\nimport android.app.Activity;\nimport com.oblador.vectoricons.VectorIconsPackage;\nimport android.os.Bundle;\nimport android.view.KeyEvent;\n\nimport com.facebook.react.LifecycleState;\nimport com.facebook.react.ReactInstanceManager;\nimport com.facebook.react.ReactRootView;\nimport com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;\nimport com.facebook.react.shell.MainReactPackage;\nimport com.facebook.soloader.SoLoader;\n\npublic class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {\n\n    private ReactInstanceManager mReactInstanceManager;\n    private ReactRootView mReactRootView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        mReactRootView = new ReactRootView(this);\n\n        mReactInstanceManager = ReactInstanceManager.builder()\n                .setApplication(getApplication())\n                .setBundleAssetName(\"index.android.bundle\")\n                .setJSMainModuleName(\"index.android\")\n                .addPackage(new MainReactPackage())\n                .addPackage(new VectorIconsPackage())\n                .setUseDeveloperSupport(BuildConfig.DEBUG)\n                .setInitialLifecycleState(LifecycleState.RESUMED)\n                .build();\n\n        mReactRootView.startReactApplication(mReactInstanceManager, \"Basic\", null);\n\n        setContentView(mReactRootView);\n    }\n\n    @Override\n    public boolean onKeyUp(int keyCode, KeyEvent event) {\n        if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) {\n            mReactInstanceManager.showDevOptionsDialog();\n            return true;\n        }\n        return super.onKeyUp(keyCode, event);\n    }\n\n    @Override\n    public void onBackPressed() {\n      if (mReactInstanceManager != null) {\n        mReactInstanceManager.onBackPressed();\n      } else {\n        super.onBackPressed();\n      }\n    }\n\n    @Override\n    public void invokeDefaultOnBackPressed() {\n      super.onBackPressed();\n    }\n\n    @Override\n    protected void onPause() {\n        super.onPause();\n\n        if (mReactInstanceManager != null) {\n            mReactInstanceManager.onPause();\n        }\n    }\n\n    @Override\n    protected void onResume() {\n        super.onResume();\n\n        if (mReactInstanceManager != null) {\n            mReactInstanceManager.onResume(this, this);\n        }\n    }\n}\n"
  },
  {
    "path": "local-cli/link/__fixtures__/android/0.18/MainActivity.java",
    "content": "package com.testrn;\n\nimport com.facebook.react.ReactActivity;\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.shell.MainReactPackage;\n\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class MainActivity extends ReactActivity {\n\n    /**\n     * Returns the name of the main component registered from JavaScript.\n     * This is used to schedule rendering of the component.\n     */\n    @Override\n    protected String getMainComponentName() {\n        return \"TestRN\";\n    }\n\n    /**\n     * Returns whether dev mode should be enabled.\n     * This enables e.g. the dev menu.\n     */\n    @Override\n    protected boolean getUseDeveloperSupport() {\n        return BuildConfig.DEBUG;\n    }\n\n   /**\n   * A list of packages used by the app. If the app uses additional views\n   * or modules besides the default ones, add more packages here.\n   */\n    @Override\n    protected List<ReactPackage> getPackages() {\n      return Arrays.<ReactPackage>asList(\n        new MainReactPackage());\n    }\n}\n"
  },
  {
    "path": "local-cli/link/__fixtures__/android/0.18/patchedMainActivity.java",
    "content": "package com.testrn;\n\nimport com.facebook.react.ReactActivity;\nimport com.oblador.vectoricons.VectorIconsPackage;\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.shell.MainReactPackage;\n\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class MainActivity extends ReactActivity {\n\n    /**\n     * Returns the name of the main component registered from JavaScript.\n     * This is used to schedule rendering of the component.\n     */\n    @Override\n    protected String getMainComponentName() {\n        return \"TestRN\";\n    }\n\n    /**\n     * Returns whether dev mode should be enabled.\n     * This enables e.g. the dev menu.\n     */\n    @Override\n    protected boolean getUseDeveloperSupport() {\n        return BuildConfig.DEBUG;\n    }\n\n   /**\n   * A list of packages used by the app. If the app uses additional views\n   * or modules besides the default ones, add more packages here.\n   */\n    @Override\n    protected List<ReactPackage> getPackages() {\n      return Arrays.<ReactPackage>asList(\n        new MainReactPackage(),\n        new VectorIconsPackage());\n    }\n}\n"
  },
  {
    "path": "local-cli/link/__fixtures__/android/0.20/MainActivity.java",
    "content": "package com.myawesomeproject;\n\nimport com.facebook.react.ReactActivity;\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.shell.MainReactPackage;\n\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class MainActivity extends ReactActivity {\n\n    /**\n     * Returns the name of the main component registered from JavaScript.\n     * This is used to schedule rendering of the component.\n     */\n    @Override\n    protected String getMainComponentName() {\n        return \"TestRN\";\n    }\n\n    /**\n     * Returns whether dev mode should be enabled.\n     * This enables e.g. the dev menu.\n     */\n    @Override\n    protected boolean getUseDeveloperSupport() {\n        return BuildConfig.DEBUG;\n    }\n\n    /**\n     * A list of packages used by the app. If the app uses additional views\n     * or modules besides the default ones, add more packages here.\n     */\n    @Override\n    protected List<ReactPackage> getPackages() {\n        return Arrays.<ReactPackage>asList(\n            new MainReactPackage()\n        );\n    }\n}\n"
  },
  {
    "path": "local-cli/link/__fixtures__/android/build.gradle",
    "content": "dependencies {\n    compile fileTree(dir: \"libs\", include: [\"*.jar\"])\n    compile \"com.android.support:appcompat-v7:23.0.1\"\n    compile \"com.facebook.react:react-native:0.18.+\"\n}\n"
  },
  {
    "path": "local-cli/link/__fixtures__/android/patchedBuild.gradle",
    "content": "dependencies {\n    compile project(':test')\n    compile(project(':test2')) {\n      exclude(group: 'org.unwanted', module: 'test10')\n    }\n    compile fileTree(dir: \"libs\", include: [\"*.jar\"])\n    compile \"com.android.support:appcompat-v7:23.0.1\"\n    compile \"com.facebook.react:react-native:0.18.+\"\n}\n"
  },
  {
    "path": "local-cli/link/__fixtures__/android/patchedSettings.gradle",
    "content": "rootProject.name = 'TestRN'\n\ninclude ':app'\ninclude ':test'\nproject(':test').projectDir = new File(rootProject.projectDir, '../node_modules/test/android')\n"
  },
  {
    "path": "local-cli/link/__fixtures__/android/settings.gradle",
    "content": "rootProject.name = 'TestRN'\n\ninclude ':app'\n"
  },
  {
    "path": "local-cli/link/__fixtures__/linearGradient.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\tBBD49E3F1AC8DEF000610F8E /* BVLinearGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD49E3A1AC8DEF000610F8E /* BVLinearGradient.m */; };\n\t\tBBD49E401AC8DEF000610F8E /* BVLinearGradientManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD49E3C1AC8DEF000610F8E /* BVLinearGradientManager.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t58B511D91A9E6C8500147676 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/$(PRODUCT_NAME)\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t134814201AA4EA6300B7C361 /* libBVLinearGradient.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBVLinearGradient.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tBBD49E391AC8DEF000610F8E /* BVLinearGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BVLinearGradient.h; sourceTree = \"<group>\"; };\n\t\tBBD49E3A1AC8DEF000610F8E /* BVLinearGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BVLinearGradient.m; sourceTree = \"<group>\"; };\n\t\tBBD49E3B1AC8DEF000610F8E /* BVLinearGradientManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BVLinearGradientManager.h; sourceTree = \"<group>\"; };\n\t\tBBD49E3C1AC8DEF000610F8E /* BVLinearGradientManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BVLinearGradientManager.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t58B511D81A9E6C8500147676 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t134814211AA4EA7D00B7C361 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134814201AA4EA6300B7C361 /* libBVLinearGradient.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58B511D21A9E6C8500147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tBBD49E391AC8DEF000610F8E /* BVLinearGradient.h */,\n\t\t\t\tBBD49E3A1AC8DEF000610F8E /* BVLinearGradient.m */,\n\t\t\t\tBBD49E3B1AC8DEF000610F8E /* BVLinearGradientManager.h */,\n\t\t\t\tBBD49E3C1AC8DEF000610F8E /* BVLinearGradientManager.m */,\n\t\t\t\t134814211AA4EA7D00B7C361 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t58B511DA1A9E6C8500147676 /* BVLinearGradient */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"BVLinearGradient\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t58B511D71A9E6C8500147676 /* Sources */,\n\t\t\t\t58B511D81A9E6C8500147676 /* Frameworks */,\n\t\t\t\t58B511D91A9E6C8500147676 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = BVLinearGradient;\n\t\t\tproductName = RCTDataManager;\n\t\t\tproductReference = 134814201AA4EA6300B7C361 /* libBVLinearGradient.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511D31A9E6C8500147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t58B511DA1A9E6C8500147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"BVLinearGradient\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511D21A9E6C8500147676;\n\t\t\tproductRefGroup = 58B511D21A9E6C8500147676;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B511DA1A9E6C8500147676 /* BVLinearGradient */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t58B511D71A9E6C8500147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tBBD49E3F1AC8DEF000610F8E /* BVLinearGradient.m in Sources */,\n\t\t\t\tBBD49E401AC8DEF000610F8E /* BVLinearGradientManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t58B511ED1A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511EE1A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511F01A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,\n\t\t\t\t\t\"$(SRCROOT)/../../React/**\",\n\t\t\t\t\t\"$(SRCROOT)/../react-native/React/**\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = BVLinearGradient;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511F11A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,\n\t\t\t\t\t\"$(SRCROOT)/../../React/**\",\n\t\t\t\t\t\"$(SRCROOT)/../react-native/React/**\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = BVLinearGradient;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"BVLinearGradient\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511ED1A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511EE1A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"BVLinearGradient\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511F01A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511F11A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511D31A9E6C8500147676 /* Project object */;\n}\n"
  },
  {
    "path": "local-cli/link/__fixtures__/pods/PodfileSimple",
    "content": "source 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '9.0'\n\ntarget 'Testing' do\n  pod 'TestPod', '~> 3.1'\n  \n  # test should point to this line\nend\n"
  },
  {
    "path": "local-cli/link/__fixtures__/pods/PodfileWithFunction",
    "content": "source 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '9.0'\n\ntarget 'none' do\n  pod 'React',\n    :path => \"../node_modules/react-native\",\n    :subspecs => [\n      \"Core\",\n      \"ART\",\n      \"RCTActionSheet\",\n      \"RCTAnimation\",\n      \"RCTCameraRoll\",\n      \"RCTGeolocation\",\n      \"RCTImage\",\n      \"RCTNetwork\",\n      \"RCTText\",\n      \"RCTVibration\",\n      \"RCTWebSocket\",\n      \"DevSupport\",\n      \"BatchedBridge\"\n    ]\n\n  pod 'Yoga',\n    :path => \"../node_modules/react-native/ReactCommon/yoga\" \n  \n  # test should point to this line\n  post_install do |installer|\n      \n  end\nend\n"
  },
  {
    "path": "local-cli/link/__fixtures__/pods/PodfileWithMarkers",
    "content": "source 'https://github.com/CocoaPods/Specs.git'\n# platform :ios, '9.0'\n\ntarget 'None' do\n  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks\n  # use_frameworks!\n  # Your 'node_modules' directory is probably in the root of your project, # but if not, adjust the `:path` accordingly \n  pod 'React', :path => '../node_modules/react-native', :subspecs => [\n    'Core',\n    'RCTText',\n    'RCTNetwork',\n    'BatchedBridge',\n    'RCTImage',\n    'RCTWebSocket', # needed for debugging \n    # Add any other subspecs you want to use in your project \n  ]\n  \n  # Add new pods below this line  \n\n  # test should point to this line\n  target 'NoneTests' do\n    inherit! :search_paths\n    # Pods for testing\n  end\nend\n\ntarget 'Second' do\n  \n  target 'NoneUITests' do\n    inherit! :search_paths\n    # Add new pods below this line\n  end\n\nend"
  },
  {
    "path": "local-cli/link/__fixtures__/pods/PodfileWithTarget",
    "content": "source 'https://github.com/CocoaPods/Specs.git'\n# platform :ios, '9.0'\n\ntarget 'None' do\n  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks\n  # use_frameworks!\n  # Your 'node_modules' directory is probably in the root of your project, # but if not, adjust the `:path` accordingly \n  pod 'React', :path => '../node_modules/react-native', :subspecs => [\n    'Core',\n    'RCTText',\n    'RCTNetwork',\n    'BatchedBridge',\n    'RCTImage',\n    'RCTWebSocket', # needed for debugging \n    # Add any other subspecs you want to use in your project \n  ]\n  \n  # Explicitly include Yoga if you are using RN >= 0.42.0\n  pod \"Yoga\", :path => \"../node_modules/react-native/ReactCommon/yoga\"\n\n  # test should point to this line\n  target 'NoneTests' do\n    inherit! :search_paths\n    # Pods for testing\n  end\n\n  target 'NoneUITests' do\n    inherit! :search_paths\n    # Pods for testing\n  end\n\nend"
  },
  {
    "path": "local-cli/link/__fixtures__/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n/* Begin PBXBuildFile section */\n\t\t00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };\n\t\t00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };\n\t\t00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };\n\t\t00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };\n\t\t00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };\n\t\t00E356F31AD99517003FC87E /* BasicTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* BasicTests.m */; };\n\t\t133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };\n\t\t139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };\n\t\t139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };\n\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n\t\t13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };\n\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n\t\t140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };\n\t\t146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };\n\t\t5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };\n\t\t832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTActionSheet;\n\t\t};\n\t\t00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTGeolocation;\n\t\t};\n\t\t00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5115D1A9E6B3D00147676;\n\t\t\tremoteInfo = RCTImage;\n\t\t};\n\t\t00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B511DB1A9E6C8500147676;\n\t\t\tremoteInfo = RCTNetwork;\n\t\t};\n\t\t00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 832C81801AAF6DEF007FA2F7;\n\t\t\tremoteInfo = RCTVibration;\n\t\t};\n\t\t00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 13B07F861A680F5B00A75B9A;\n\t\t\tremoteInfo = Basic;\n\t\t};\n\t\t139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTSettings;\n\t\t};\n\t\t139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3C86DF461ADF2C930047B81A;\n\t\t\tremoteInfo = RCTWebSocket;\n\t\t};\n\t\t146834031AC3E56700842450 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;\n\t\t\tremoteInfo = React;\n\t\t};\n\t\t3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A283A1D9B042B00D4039D;\n\t\t\tremoteInfo = \"RCTImage-tvOS\";\n\t\t};\n\t\t3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28471D9B043800D4039D;\n\t\t\tremoteInfo = \"RCTLinking-tvOS\";\n\t\t};\n\t\t3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28541D9B044C00D4039D;\n\t\t\tremoteInfo = \"RCTNetwork-tvOS\";\n\t\t};\n\t\t3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28611D9B046600D4039D;\n\t\t\tremoteInfo = \"RCTSettings-tvOS\";\n\t\t};\n\t\t3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A287B1D9B048500D4039D;\n\t\t\tremoteInfo = \"RCTText-tvOS\";\n\t\t};\n\t\t3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28881D9B049200D4039D;\n\t\t\tremoteInfo = \"RCTWebSocket-tvOS\";\n\t\t};\n\t\t3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28131D9B038B00D4039D;\n\t\t\tremoteInfo = \"React-tvOS\";\n\t\t};\n\t\t3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3C059A1DE3340900C268FA;\n\t\t\tremoteInfo = yoga;\n\t\t};\n\t\t3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3C06751DE3340C00C268FA;\n\t\t\tremoteInfo = \"yoga-tvOS\";\n\t\t};\n\t\t3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4;\n\t\t\tremoteInfo = cxxreact;\n\t\t};\n\t\t3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;\n\t\t\tremoteInfo = \"cxxreact-tvOS\";\n\t\t};\n\t\t3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4;\n\t\t\tremoteInfo = jschelpers;\n\t\t};\n\t\t3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;\n\t\t\tremoteInfo = \"jschelpers-tvOS\";\n\t\t};\n\t\t5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTAnimation;\n\t\t};\n\t\t5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28201D9B03D100D4039D;\n\t\t\tremoteInfo = \"RCTAnimation-tvOS\";\n\t\t};\n\t\t78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTLinking;\n\t\t};\n\t\t832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5119B1A9E6C1200147676;\n\t\t\tremoteInfo = RCTText;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = \"<group>\"; };\n\t\t00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTActionSheet.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesActionSheetIOS/RCTActionSheet.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTGeolocation.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesGeolocation/RCTGeolocation.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTImage.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesImage/RCTImage.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTNetwork.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesNetwork/RCTNetwork.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTVibration.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesVibration/RCTVibration.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00E356EE1AD99517003FC87E /* BasicTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BasicTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t00E356F21AD99517003FC87E /* BasicTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BasicTests.m; sourceTree = \"<group>\"; };\n\t\t139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTSettings.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesSettings/RCTSettings.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTWebSocket.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesWebSocket/RCTWebSocket.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t13B07F961A680F5B00A75B9A /* Basic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Basic.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Basic/AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Basic/AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = \"<group>\"; };\n\t\t13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Basic/Images.xcassets; sourceTree = \"<group>\"; };\n\t\t13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Basic/Info.plist; sourceTree = \"<group>\"; };\n\t\t13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Basic/main.m; sourceTree = \"<group>\"; };\n\t\t146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = React.xcodeproj; path = \"../node_modules/react-native/React/React.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTAnimation.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesNativeAnimation/RCTAnimation.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTLinking.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesLinkingIOS/RCTLinking.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTText.xcodeproj; path = \"../node_modules/react-native-macos/LibrariesText/RCTText.xcodeproj\"; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t00E356EB1AD99517003FC87E /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */,\n\t\t\t\t146834051AC3E58100842450 /* libReact.a in Frameworks */,\n\t\t\t\t00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,\n\t\t\t\t00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,\n\t\t\t\t00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,\n\t\t\t\t133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,\n\t\t\t\t00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,\n\t\t\t\t139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,\n\t\t\t\t832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,\n\t\t\t\t00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,\n\t\t\t\t139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t00C302A81ABCB8CE00DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302B61ABCB90400DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302BC1ABCB91800DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302C01ABCB91800DB3ED1 /* libRCTImage.a */,\n\t\t\t\t3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302D41ABCB9D200DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */,\n\t\t\t\t3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302E01ABCB9EE00DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00E356EF1AD99517003FC87E /* BasicTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00E356F21AD99517003FC87E /* BasicTests.m */,\n\t\t\t\t00E356F01AD99517003FC87E /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = BasicTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00E356F01AD99517003FC87E /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00E356F11AD99517003FC87E /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139105B71AF99BAD00B5F7CC /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,\n\t\t\t\t3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139FDEE71B06529A00C62182 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,\n\t\t\t\t3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13B07FAE1A68108700A75B9A /* Basic */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t008F07F21AC5B25A0029DE68 /* main.jsbundle */,\n\t\t\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */,\n\t\t\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */,\n\t\t\t\t13B07FB51A68108700A75B9A /* Images.xcassets */,\n\t\t\t\t13B07FB61A68108700A75B9A /* Info.plist */,\n\t\t\t\t13B07FB11A68108700A75B9A /* LaunchScreen.xib */,\n\t\t\t\t13B07FB71A68108700A75B9A /* main.m */,\n\t\t\t);\n\t\t\tname = Basic;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t146834001AC3E56700842450 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t146834041AC3E56700842450 /* libReact.a */,\n\t\t\t\t3DAD3EA31DF850E9000B6D8A /* libReact.a */,\n\t\t\t\t3DAD3EA51DF850E9000B6D8A /* libyoga.a */,\n\t\t\t\t3DAD3EA71DF850E9000B6D8A /* libyoga.a */,\n\t\t\t\t3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */,\n\t\t\t\t3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */,\n\t\t\t\t3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */,\n\t\t\t\t3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5E91572E1DD0AC6500FF2AA8 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */,\n\t\t\t\t5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t78C398B11ACF4ADC00677621 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t78C398B91ACF4ADC00677621 /* libRCTLinking.a */,\n\t\t\t\t3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t832341AE1AAA6A7D00B99B32 /* Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */,\n\t\t\t\t146833FF1AC3E56700842450 /* React.xcodeproj */,\n\t\t\t\t00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,\n\t\t\t\t00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,\n\t\t\t\t00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,\n\t\t\t\t78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,\n\t\t\t\t00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,\n\t\t\t\t139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,\n\t\t\t\t832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,\n\t\t\t\t00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,\n\t\t\t\t139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,\n\t\t\t);\n\t\t\tname = Libraries;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t832341B11AAA6A8300B99B32 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t832341B51AAA6A8300B99B32 /* libRCTText.a */,\n\t\t\t\t3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBB9F61A601CBA00E9B192 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n        AD9196DA1CABA83E000E8D91 /* NestedGroup */,\n\t\t\t\t13B07FAE1A68108700A75B9A /* Basic */,\n\t\t\t\t832341AE1AAA6A7D00B99B32 /* Libraries */,\n\t\t\t\t00E356EF1AD99517003FC87E /* BasicTests */,\n\t\t\t\t83CBBA001A601CBA00E9B192 /* Products */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t};\n\t\t83CBBA001A601CBA00E9B192 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07F961A680F5B00A75B9A /* Basic.app */,\n\t\t\t\t00E356EE1AD99517003FC87E /* BasicTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t  AD9196DA1CABA83E000E8D91 /* NestedGroup */ = {\n      isa = PBXGroup;\n      children = (\n        AD9196DB1CABA844000E8D91 /* Libraries */,\n      );\n      name = NestedGroup;\n      sourceTree = \"<group>\";\n    };\n    AD9196DB1CABA844000E8D91 /* Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tname = Libraries;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t00E356ED1AD99517003FC87E /* BasicTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget \"BasicTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t00E356EA1AD99517003FC87E /* Sources */,\n\t\t\t\t00E356EB1AD99517003FC87E /* Frameworks */,\n\t\t\t\t00E356EC1AD99517003FC87E /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t00E356F51AD99517003FC87E /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = BasicTests;\n\t\t\tproductName = BasicTests;\n\t\t\tproductReference = 00E356EE1AD99517003FC87E /* BasicTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t13B07F861A680F5B00A75B9A /* Basic */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"Basic\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t13B07F871A680F5B00A75B9A /* Sources */,\n\t\t\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */,\n\t\t\t\t13B07F8E1A680F5B00A75B9A /* Resources */,\n\t\t\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = Basic;\n\t\t\tproductName = \"Hello World\";\n\t\t\tproductReference = 13B07F961A680F5B00A75B9A /* Basic.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t83CBB9F71A601CBA00E9B192 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t00E356ED1AD99517003FC87E = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.2;\n\t\t\t\t\t\tTestTargetID = 13B07F861A680F5B00A75B9A;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"Basic\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 83CBB9F61A601CBA00E9B192;\n\t\t\tproductRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */;\n\t\t\t\t\tProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 78C398B11ACF4ADC00677621 /* Products */;\n\t\t\t\t\tProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;\n\t\t\t\t\tProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 832341B11AAA6A8300B99B32 /* Products */;\n\t\t\t\t\tProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 139FDEE71B06529A00C62182 /* Products */;\n\t\t\t\t\tProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 146834001AC3E56700842450 /* Products */;\n\t\t\t\t\tProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t13B07F861A680F5B00A75B9A /* Basic */,\n\t\t\t\t00E356ED1AD99517003FC87E /* BasicTests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\t00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTActionSheet.a;\n\t\t\tremoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTGeolocation.a;\n\t\t\tremoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTImage.a;\n\t\t\tremoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTNetwork.a;\n\t\t\tremoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTVibration.a;\n\t\t\tremoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTSettings.a;\n\t\t\tremoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTWebSocket.a;\n\t\t\tremoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t146834041AC3E56700842450 /* libReact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libReact.a;\n\t\t\tremoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTImage-tvOS.a\";\n\t\t\tremoteRef = 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTLinking-tvOS.a\";\n\t\t\tremoteRef = 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTNetwork-tvOS.a\";\n\t\t\tremoteRef = 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTSettings-tvOS.a\";\n\t\t\tremoteRef = 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTText-tvOS.a\";\n\t\t\tremoteRef = 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTWebSocket-tvOS.a\";\n\t\t\tremoteRef = 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EA31DF850E9000B6D8A /* libReact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libReact.a;\n\t\t\tremoteRef = 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EA51DF850E9000B6D8A /* libyoga.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libyoga.a;\n\t\t\tremoteRef = 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EA71DF850E9000B6D8A /* libyoga.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libyoga.a;\n\t\t\tremoteRef = 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libcxxreact.a;\n\t\t\tremoteRef = 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libcxxreact.a;\n\t\t\tremoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjschelpers.a;\n\t\t\tremoteRef = 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjschelpers.a;\n\t\t\tremoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTAnimation.a;\n\t\t\tremoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTAnimation-tvOS.a\";\n\t\t\tremoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTLinking.a;\n\t\t\tremoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t832341B51AAA6A8300B99B32 /* libRCTText.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTText.a;\n\t\t\tremoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t00E356EC1AD99517003FC87E /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F8E1A680F5B00A75B9A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,\n\t\t\t\t13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Bundle React Native code and images\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"export NODE_BINARY=node\\n../node_modules/react-native/scripts/react-native-xcode.sh\";\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t00E356EA1AD99517003FC87E /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t00E356F31AD99517003FC87E /* BasicTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F871A680F5B00A75B9A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,\n\t\t\t\t13B07FC11A68108700A75B9A /* main.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t00E356F51AD99517003FC87E /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 13B07F861A680F5B00A75B9A /* Basic */;\n\t\t\ttargetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin PBXVariantGroup section */\n\t\t13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07FB21A68108700A75B9A /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.xib;\n\t\t\tpath = Basic;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t00E356F61AD99517003FC87E /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = BasicTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/Basic.app/Basic\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t00E356F71AD99517003FC87E /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tINFOPLIST_FILE = BasicTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/Basic.app/Basic\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t13B07F941A680F5B00A75B9A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEAD_CODE_STRIPPING = NO;\n\t\t\t\tINFOPLIST_FILE = Basic/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = Basic;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t13B07F951A680F5B00A75B9A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tINFOPLIST_FILE = Basic/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = Basic;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA201A601CBA00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA211A601CBA00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget \"BasicTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t00E356F61AD99517003FC87E /* Debug */,\n\t\t\t\t00E356F71AD99517003FC87E /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"Basic\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t13B07F941A680F5B00A75B9A /* Debug */,\n\t\t\t\t13B07F951A680F5B00A75B9A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"Basic\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA201A601CBA00E9B192 /* Debug */,\n\t\t\t\t83CBBA211A601CBA00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;\n}\n"
  },
  {
    "path": "local-cli/link/__tests__/android/applyPatch.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst applyParams = require('../../android/patches/applyParams');\n\ndescribe('applyParams', () => {\n  it('apply params to the string', () => {\n    expect(\n      applyParams('${foo}', {foo: 'foo'}, 'react-native')\n    ).toEqual('getResources().getString(R.string.reactNative_foo)');\n  });\n\n  it('use null if no params provided', () => {\n    expect(\n      applyParams('${foo}', {}, 'react-native')\n    ).toEqual('null');\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/android/isInstalled.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst path = require('path');\nconst isInstalled = require('../../android/isInstalled');\n\nconst projectConfig = {\n  buildGradlePath: path.join(__dirname, '../../__fixtures__/android/patchedBuild.gradle'),\n};\n\ndescribe('android::isInstalled', () => {\n  it('should return true when project is already in build.gradle', () => {\n    expect(isInstalled(projectConfig, 'test')).toBeTruthy();\n    expect(isInstalled(projectConfig, 'test2')).toBeTruthy();\n  });\n\n  it('should return false when project is not in build.gradle', () =>\n    expect(isInstalled(projectConfig, 'test3')).toBeFalsy()\n  );\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/android/makeBuildPatch.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst makeBuildPatch = require('../../android/patches/makeBuildPatch');\nconst name = 'test';\n\ndescribe('makeBuildPatch', () => {\n  it('should build a patch function', () => {\n    expect(Object.prototype.toString(makeBuildPatch(name)))\n      .toBe('[object Object]');\n  });\n\n  it('should make a correct patch', () => {\n    const {patch} = makeBuildPatch(name);\n    expect(patch).toBe(`    compile project(':${name}')\\n`);\n  });\n\n  it('should make a correct install check pattern', () => {\n    const {installPattern} = makeBuildPatch(name);\n    const match = `/\\\\s{4}(compile)(\\\\(|\\\\s)(project)\\\\(\\\\':${name}\\\\'\\\\)(\\\\)|\\\\s)/`;\n    expect(installPattern.toString()).toBe(match);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/android/makeImportPatch.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst makeImportPatch = require('../../android/patches/makeImportPatch');\n\nconst packageImportPath = 'import some.example.project';\n\ndescribe('makeImportPatch', () => {\n  it('should build a patch', () => {\n    expect(Object.prototype.toString(makeImportPatch(packageImportPath)))\n      .toBe('[object Object]');\n  });\n\n  it('MainActivity contains a correct import patch', () => {\n    const {patch} = makeImportPatch(packageImportPath);\n\n    expect(patch).toBe('\\n' + packageImportPath);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/android/makePackagePatch.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst makePackagePatch = require('../../android/patches/makePackagePatch');\nconst applyParams = require('../../android/patches/applyParams');\n\nconst packageInstance = 'new SomeLibrary(${foo}, ${bar}, \\'something\\')';\nconst name = 'some-library';\nconst params = {\n  foo: 'foo',\n  bar: 'bar',\n};\n\ndescribe('makePackagePatch@0.20', () => {\n  it('should build a patch', () => {\n    const packagePatch = makePackagePatch(packageInstance, params, name);\n    expect(Object.prototype.toString(packagePatch))\n      .toBe('[object Object]');\n  });\n\n  it('MainActivity contains a correct 0.20 import patch', () => {\n    const {patch} = makePackagePatch(packageInstance, params, name);\n    const processedInstance = applyParams(packageInstance, params, name);\n\n    expect(patch).toBe(',\\n            ' + processedInstance);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/android/makeSettingsPatch.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst path = require('path');\nconst makeSettingsPatch = require('../../android/patches/makeSettingsPatch');\n\nconst name = 'test';\nconst projectConfig = {\n  sourceDir: '/home/project/android/app',\n  settingsGradlePath: '/home/project/android/settings.gradle',\n};\nconst dependencyConfig = {\n  sourceDir: `/home/project/node_modules/${name}/android`,\n};\n\ndescribe('makeSettingsPatch', () => {\n  it('should build a patch function', () => {\n    expect(Object.prototype.toString(\n      makeSettingsPatch(name, dependencyConfig, projectConfig)\n    )).toBe('[object Object]');\n  });\n\n  it('should make a correct patch', () => {\n    const projectDir = path.relative(\n      path.dirname(projectConfig.settingsGradlePath),\n      dependencyConfig.sourceDir\n    );\n\n    const {patch} = makeSettingsPatch(name, dependencyConfig, projectConfig);\n\n    expect(patch)\n      .toBe(\n        `include ':${name}'\\n` +\n        `project(':${name}').projectDir = ` +\n        `new File(rootProject.projectDir, '${projectDir}')\\n`\n      );\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/android/makeStringsPatch.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst makeStringsPatch = require('../../android/patches/makeStringsPatch');\n\ndescribe('makeStringsPatch', () => {\n  it('should export a patch with <string> element', () => {\n    const params = {\n      keyA: 'valueA',\n    };\n\n    expect(makeStringsPatch(params, 'module').patch)\n      .toContain('<string moduleConfig=\"true\" name=\"module_keyA\">valueA</string>');\n  });\n\n  it('should export an empty patch if no params given', () => {\n    expect(makeStringsPatch({}, 'module').patch).toBe('');\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/getDependencyConfig.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst getDependencyConfig = require('../getDependencyConfig');\nconst sinon = require('sinon');\n\ndescribe('getDependencyConfig', () => {\n  it('should return an array of dependencies\\' rnpm config', () => {\n    const config = {\n      getDependencyConfig: sinon.stub(),\n    };\n\n    expect(Array.isArray(getDependencyConfig(config, ['abcd']))).toBeTruthy();\n    expect(config.getDependencyConfig.callCount).toEqual(1);\n  });\n\n  it('should filter out invalid react-native projects', () => {\n    const config = {\n      getDependencyConfig: sinon.stub().throws(new Error('Cannot require')),\n    };\n\n    expect(getDependencyConfig(config, ['abcd'])).toEqual([]);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/getProjectDependencies.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst getProjectDependencies = require('../getProjectDependencies');\nconst path = require('path');\n\ndescribe('getProjectDependencies', () => {\n  beforeEach(() => {\n    jest.resetModules();\n  });\n  it('should return an array of project dependencies', () => {\n    jest.setMock(\n      path.join(process.cwd(), './package.json'),\n      { dependencies: { lodash: '^6.0.0', 'react-native': '^16.0.0' }}\n    );\n\n    expect(getProjectDependencies()).toEqual(['lodash']);\n  });\n\n  it('should return an empty array when no dependencies set', () => {\n    jest.setMock(path.join(process.cwd(), './package.json'), {});\n    expect(getProjectDependencies()).toEqual([]);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/groupFilesByType.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst groupFilesByType = require('../groupFilesByType');\n\ndescribe('groupFilesByType', () => {\n\n  it('should group files by its type', () => {\n    const fonts = [\n      'fonts/a.ttf',\n      'fonts/b.ttf',\n    ];\n    const images = [\n      'images/a.jpg',\n      'images/c.jpeg',\n    ];\n\n    const groupedFiles = groupFilesByType(fonts.concat(images));\n\n    expect(groupedFiles.font).toEqual(fonts);\n    expect(groupedFiles.image).toEqual(images);\n  });\n\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/addFileToProject.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst path = require('path');\nconst addFileToProject = require('../../ios/addFileToProject');\nconst _ = require('lodash');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::addFileToProject', () => {\n  beforeEach(() => {\n    project.parseSync();\n  });\n\n  xit('should add file to a project', () => {\n    expect(\n      _.includes(\n        Object.keys(project.pbxFileReferenceSection()),\n        addFileToProject(project, '../../__fixtures__/linearGradient.pbxproj').fileRef\n      )\n    ).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/addProjectToLibraries.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst path = require('path');\nconst PbxFile = require('xcode/lib/pbxFile');\nconst addProjectToLibraries = require('../../ios/addProjectToLibraries');\nconst last = require('lodash').last;\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::addProjectToLibraries', () => {\n  beforeEach(() => {\n    project.parseSync();\n  });\n\n  it('should append file to Libraries group', () => {\n    const file = new PbxFile('fakePath');\n    const libraries = project.pbxGroupByName('Libraries');\n\n    addProjectToLibraries(libraries, file);\n\n    const child = last(libraries.children);\n\n    expect(child.comment).toBe(file.basename);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/addSharedLibraries.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst path = require('path');\nconst addSharedLibraries = require('../../ios/addSharedLibraries');\nconst getGroup = require('../../ios/getGroup');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::addSharedLibraries', () => {\n\n  beforeEach(() => {\n    project.parseSync();\n  });\n\n  it('should automatically create Frameworks group', () => {\n    expect(getGroup(project, 'Frameworks')).toBeNull();\n    addSharedLibraries(project, ['libz.tbd']);\n    expect(getGroup(project, 'Frameworks')).not.toBeNull();\n  });\n\n  it('should add shared libraries to project', () => {\n    addSharedLibraries(project, ['libz.tbd']);\n\n    const frameworksGroup = getGroup(project, 'Frameworks');\n    expect(frameworksGroup.children.length).toEqual(1);\n    expect(frameworksGroup.children[0].comment).toEqual('libz.tbd');\n\n    addSharedLibraries(project, ['MessageUI.framework']);\n    expect(frameworksGroup.children.length).toEqual(2);\n  });\n\n  it('should not add duplicate libraries to project', () => {\n    addSharedLibraries(project, ['libz.tbd']);\n    addSharedLibraries(project, ['libz.tbd']);\n\n    const frameworksGroup = getGroup(project, 'Frameworks');\n    expect(frameworksGroup.children.length).toEqual(1);\n  });\n\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/createGroup.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst path = require('path');\nconst createGroup = require('../../ios/createGroup');\nconst getGroup = require('../../ios/getGroup');\nconst last = require('lodash').last;\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::createGroup', () => {\n  beforeEach(() => {\n    project.parseSync();\n  });\n\n  it('should create a group with given name', () => {\n    const createdGroup = createGroup(project, 'Resources');\n    expect(createdGroup.name).toBe('Resources');\n  });\n\n  it('should attach group to main project group', () => {\n    const createdGroup = createGroup(project, 'Resources');\n    const mainGroup = getGroup(project);\n\n    expect(\n      last(mainGroup.children).comment\n    ).toBe(createdGroup.name);\n  });\n\n  it('should create a nested group with given path', () => {\n    const createdGroup = createGroup(project, 'NewGroup/NewNestedGroup');\n    const outerGroup = getGroup(project, 'NewGroup');\n\n    expect(\n      last(outerGroup.children).comment\n    ).toBe(createdGroup.name);\n  });\n\n  it('should-not create already created groups', () => {\n    const createdGroup = createGroup(project, 'Libraries/NewNestedGroup');\n    const outerGroup = getGroup(project, 'Libraries');\n    const mainGroup = getGroup(project);\n\n    expect(\n      mainGroup\n        .children\n        .filter(group => group.comment === 'Libraries')\n        .length\n    ).toBe(1);\n    expect(last(outerGroup.children).comment).toBe(createdGroup.name);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/getBuildProperty.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst path = require('path');\nconst getBuildProperty = require('../../ios/getBuildProperty');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::getBuildProperty', () => {\n  beforeEach(() => {\n    project.parseSync();\n  });\n\n  it('should return build property from main target', () => {\n    const plistPath = getBuildProperty(project, 'INFOPLIST_FILE');\n    expect(plistPath).toEqual('Basic/Info.plist');\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/getGroup.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst getGroup = require('../../ios/getGroup');\nconst path = require('path');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::getGroup', () => {\n  beforeEach(() => {\n    project.parseSync();\n  });\n\n  it('should return a top-level group', () => {\n    const group = getGroup(project, 'Libraries');\n    expect(group.children.length > 0).toBeTruthy();\n    expect(group.name).toBe('Libraries');\n  });\n\n  it('should return nested group when specified', () => {\n    const group = getGroup(project, 'NestedGroup/Libraries');\n    expect(group.children.length).toBe(0); // our test nested Libraries is empty\n    expect(group.name).toBe('Libraries');\n  });\n\n  it('should return null when no group found', () => {\n    const group = getGroup(project, 'I-Dont-Exist');\n    expect(group).toBeNull();\n  });\n\n  it('should return top-level group when name not specified', () => {\n    const mainGroupId = project.getFirstProject().firstProject.mainGroup;\n    const mainGroup = project.getPBXGroupByKey(mainGroupId);\n    const group = getGroup(project);\n    expect(group).toEqual(mainGroup);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/getHeaderSearchPath.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst getHeaderSearchPath = require('../../ios/getHeaderSearchPath');\nconst path = require('path');\n\nconst SRC_DIR = path.join('react-native-project', 'ios');\n\ndescribe('ios::getHeaderSearchPath', () => {\n  /**\n   * See https://github.com/Microsoft/react-native-code-push\n   */\n  it('should return correct path when all headers are in root folder', () => {\n    const files = [\n      path.join('react-native-project', 'node_modules', 'package', 'Gradient.h'),\n      path.join('react-native-project', 'node_modules', 'package', 'Manager.h'),\n    ];\n\n    const searchPath = getHeaderSearchPath(SRC_DIR, files);\n\n    expect(searchPath).toBe(\n      `\"${['$(SRCROOT)', '..', 'node_modules', 'package'].join(path.sep)}\"`\n    );\n  });\n\n  /**\n   * See https://github.com/facebook/react-native/tree/master/React\n   */\n  it('should return correct path when headers are in multiple folders', () => {\n    const files = [\n      path.join('react-native-project', 'node_modules', 'package', 'src', 'folderA', 'Gradient.h'),\n      path.join('react-native-project', 'node_modules', 'package', 'src', 'folderB', 'Manager.h'),\n    ];\n\n    const searchPath = getHeaderSearchPath(SRC_DIR, files);\n\n    expect(searchPath).toBe(\n      `\"${['$(SRCROOT)', '..', 'node_modules', 'package', 'src'].join(path.sep)}/**\"`\n    );\n  });\n\n  /**\n   * This is just to make sure the above two does not collide with each other\n   */\n  it('should return correct path when headers are in root and nested folders', () => {\n    const files = [\n      path.join('react-native-project', 'node_modules', 'package', 'src', 'folderA', 'Gradient.h'),\n      path.join('react-native-project', 'node_modules', 'package', 'src', 'folderB', 'Manager.h'),\n      path.join('react-native-project', 'node_modules', 'package', 'src', 'Manager.h'),\n    ];\n\n    const searchPath = getHeaderSearchPath(SRC_DIR, files);\n\n    expect(searchPath).toBe(\n      `\"${['$(SRCROOT)', '..', 'node_modules', 'package', 'src'].join(path.sep)}/**\"`\n    );\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/getHeadersInFolder.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst getHeadersInFolder = require('../../ios/getHeadersInFolder');\n\ndescribe('ios::getHeadersInFolder', () => {\n  xit('should return an array of all headers in given folder', () => {\n    jest.setMock({\n      'FileA.h': '',\n      'FileB.h': '',\n    });\n\n    const foundHeaders = getHeadersInFolder(process.cwd());\n\n    expect(foundHeaders.length).toBe(2);\n\n    getHeadersInFolder(process.cwd()).forEach(headerPath => {\n      expect(headerPath).to.contain(process.cwd());\n    });\n  });\n\n  xit('should ignore all headers in Pods, Examples & node_modules', () => {\n    jest.setMock({\n      'FileA.h': '',\n      'FileB.h': '',\n      Pods: {\n        'FileC.h': '',\n      },\n      Examples: {\n        'FileD.h': '',\n      },\n      node_modules: {\n        'FileE.h': '',\n      },\n    });\n\n    expect(getHeadersInFolder(process.cwd()).length).to.equals(2);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/getPlist.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst getPlist = require('../../ios/getPlist');\nconst path = require('path');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::getPlist', () => {\n  beforeEach(() => {\n    project.parseSync();\n  });\n\n  it('should return null when `.plist` file missing', () => {\n    const plistPath = getPlist(project, process.cwd());\n    expect(plistPath).toBeNull();\n  });\n\n  // @todo - Happy scenario\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/getPlistPath.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst getPlistPath = require('../../ios/getPlistPath');\nconst path = require('path');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::getPlistPath', () => {\n  beforeEach(() => {\n    project.parseSync();\n  });\n\n  it('should return path without Xcode $(SRCROOT)', () => {\n    const plistPath = getPlistPath(project, '/');\n    expect(plistPath).toBe('/Basic/Info.plist');\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/getProducts.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst getProducts = require('../../ios/getProducts');\nconst path = require('path');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::getProducts', () => {\n  beforeEach(() => {\n    project.parseSync();\n  });\n\n  it('should return an array of static libraries project exports', () => {\n    const products = getProducts(project);\n    expect(products.length).toBe(1);\n    expect(products).toContain('libRCTActionSheet.a');\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/hasLibraryImported.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst hasLibraryImported = require('../../ios/hasLibraryImported');\nconst path = require('path');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::hasLibraryImported', () => {\n  beforeEach(() => {\n    project.parseSync();\n  });\n\n  it('should return true if project has been already imported', () => {\n    const libraries = project.pbxGroupByName('Libraries');\n    expect(hasLibraryImported(libraries, 'React.xcodeproj')).toBeTruthy();\n  });\n\n  it('should return false if project is not imported', () => {\n    const libraries = project.pbxGroupByName('Libraries');\n    expect(hasLibraryImported(libraries, 'ACME.xcodeproj')).toBeFalsy();\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/isInstalled.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst path = require('path');\nconst isInstalled = require('../../ios/isInstalled');\n\nconst baseProjectConfig = {\n  pbxprojPath: path.join(__dirname, '../../__fixtures__/project.pbxproj'),\n  libraryFolder: 'Libraries',\n};\n\ndescribe('ios::isInstalled', () => {\n  it('should return true when .xcodeproj in Libraries', () => {\n    const dependencyConfig = { projectName: 'React.xcodeproj' };\n    expect(isInstalled(baseProjectConfig, dependencyConfig)).toBeTruthy();\n  });\n\n  it('should return false when .xcodeproj not in Libraries', () => {\n    const dependencyConfig = { projectName: 'Missing.xcodeproj' };\n    expect(isInstalled(baseProjectConfig, dependencyConfig)).toBeFalsy();\n  });\n\n  it('should return false when `LibraryFolder` is missing', () => {\n    const dependencyConfig = { projectName: 'React.xcodeproj' };\n    const projectConfig = Object.assign({}, baseProjectConfig, { libraryFolder: 'Missing' });\n    expect(isInstalled(projectConfig, dependencyConfig)).toBeFalsy();\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/mapHeaderSearchPaths.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst mapHeaderSearchPaths = require('../../ios/mapHeaderSearchPaths');\nconst path = require('path');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::mapHeaderSearchPaths', () => {\n  beforeEach(() => {\n    project.parseSync();\n  });\n\n  /**\n   * Based on the fixtures, our assumption is that this function\n   * has to be executed two times.\n   */\n  it('should be called twice', () => {\n    const callback = jest.fn();\n    mapHeaderSearchPaths(project, callback);\n\n    expect(callback.mock.calls.length).toBe(2);\n  });\n\n  it('calls the function with an array of paths, given a project with one', () => {\n    const callback = jest.fn();\n    mapHeaderSearchPaths(project, callback);\n\n    const paths = callback.mock.calls[0][0];\n\n    expect(paths instanceof Array).toBe(true);\n    expect(paths.length).toBe(1);\n    expect(paths[0]).toBe('\"$(inherited)\"');\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/removeProjectFromLibraries.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst PbxFile = require('xcode/lib/pbxFile');\nconst addProjectToLibraries = require('../../ios/addProjectToLibraries');\nconst removeProjectFromLibraries = require('../../ios/removeProjectFromLibraries');\nconst last = require('lodash').last;\nconst path = require('path');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::removeProjectFromLibraries', () => {\n  beforeEach(() => {\n    project.parseSync();\n\n    addProjectToLibraries(\n      project.pbxGroupByName('Libraries'),\n      new PbxFile('fakePath')\n    );\n  });\n\n  it('should remove file from Libraries group', () => {\n    const file = new PbxFile('fakePath');\n    const libraries = project.pbxGroupByName('Libraries');\n\n    removeProjectFromLibraries(libraries, file);\n\n    const child = last(libraries.children);\n\n    expect(child.comment).not.toBe(file.basename);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/removeProjectFromProject.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst pbxFile = require('xcode/lib/pbxFile');\nconst addFileToProject = require('../../ios/addFileToProject');\nconst removeProjectFromProject = require('../../ios/removeProjectFromProject');\nconst path = require('path');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\nconst filePath = '../../__fixtures__/linearGradient.pbxproj';\n\ndescribe('ios::addFileToProject', () => {\n  beforeEach(() => {\n    project.parseSync();\n    addFileToProject(project, filePath);\n  });\n\n  it('should return removed file', () => {\n    expect(removeProjectFromProject(project, filePath) instanceof pbxFile)\n      .toBeTruthy();\n  });\n\n  it('should remove file from a project', () => {\n    const file = removeProjectFromProject(project, filePath);\n    expect(project.pbxFileReferenceSection()[file.fileRef]).not.toBeDefined();\n  });\n\n  xit('should remove file from PBXContainerProxy', () => {\n    // todo(mike): add in .xcodeproj after Xcode modifications so we can test extra\n    // removals later.\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/removeSharedLibrary.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst xcode = require('xcode');\nconst path = require('path');\nconst addSharedLibraries = require('../../ios/addSharedLibraries');\nconst removeSharedLibraries = require('../../ios/removeSharedLibraries');\nconst getGroup = require('../../ios/getGroup');\n\nconst project = xcode.project(\n  path.join(__dirname, '../../__fixtures__/project.pbxproj')\n);\n\ndescribe('ios::removeSharedLibraries', () => {\n\n  beforeEach(() => {\n    project.parseSync();\n    addSharedLibraries(project, ['libc++.tbd', 'libz.tbd']);\n  });\n\n  it('should remove only the specified shared library', () => {\n    removeSharedLibraries(project, ['libc++.tbd']);\n\n    const frameworksGroup = getGroup(project, 'Frameworks');\n    expect(frameworksGroup.children.length).toEqual(1);\n    expect(frameworksGroup.children[0].comment).toEqual('libz.tbd');\n  });\n\n  it('should ignore missing shared libraries', () => {\n    removeSharedLibraries(project, ['libxml2.tbd']);\n\n    const frameworksGroup = getGroup(project, 'Frameworks');\n    expect(frameworksGroup.children.length).toEqual(2);\n  });\n\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/ios/writePlist.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.mock('fs');\n\nlet plistPath = null;\njest.mock('../../ios/getPlistPath', () => () => plistPath);\n\nconst { readFileSync } = require.requireActual('fs');\nconst fs = require('fs');\n\nconst xcode = require('xcode');\nconst path = require('path');\nconst writePlist = require('../../ios/writePlist');\n\nconst projectPath = path.join(__dirname, '../../__fixtures__/project.pbxproj');\nconst infoPlistPath = path.join(__dirname, '../../__fixtures__/Info.plist');\n\nfs.readFileSync = jest.fn(() => readFileSync(projectPath).toString());\n\nconst project = xcode.project('/Basic/project.pbxproj');\n\nconst plist = {\n  CFBundleDevelopmentRegion: 'en',\n  UISupportedInterfaceOrientations: [\n    'UIInterfaceOrientationPortrait'\n  ]\n};\n\ndescribe('ios::writePlist', () => {\n  beforeEach(() => {\n    project.parseSync();\n    fs.writeFileSync.mockReset();\n  });\n\n  it('should write a `.plist` file', () => {\n    plistPath = '/Basic/Info.plist';\n    const result = writePlist(project, '/', plist);\n    const infoPlist = readFileSync(infoPlistPath).toString();\n    expect(fs.writeFileSync).toHaveBeenCalledWith(plistPath, infoPlist);\n  });\n\n  it('when plistPath is null it should return null', () => {\n    plistPath = null;\n    expect(writePlist(project, '/', plist)).toBeNull();\n    expect(fs.writeFileSync).not.toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/link.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst sinon = require('sinon');\nconst log = require('npmlog');\nconst path = require('path');\njest.setMock(\n  'chalk',\n  { grey: (str) => str, }\n);\n\ndescribe('link', () => {\n  beforeEach(() => {\n    jest.resetModules();\n    delete require.cache[require.resolve('../link')];\n    log.level = 'silent';\n  });\n\n  it('should reject when run in a folder without package.json', (done) => {\n    const config = {\n      getProjectConfig: () => {\n        throw new Error('No package.json found');\n      },\n    };\n\n    const link = require('../link').func;\n    link([], config).catch(() => done());\n  });\n\n  it('should accept a name of a dependency to link', (done) => {\n    const config = {\n      getProjectConfig: () => ({ assets: [] }),\n      getDependencyConfig: sinon.stub().returns({ assets: [], commands: {} }),\n    };\n\n    const link = require('../link').func;\n    link(['react-native-gradient'], config).then(() => {\n      expect(\n        config.getDependencyConfig.calledWith('react-native-gradient')\n      ).toBeTruthy();\n      done();\n    });\n  });\n\n  it('should read dependencies from package.json when name not provided', (done) => {\n    const config = {\n      getProjectConfig: () => ({ assets: [] }),\n      getDependencyConfig: sinon.stub().returns({ assets: [], commands: {} }),\n    };\n\n    jest.setMock(\n      path.join(process.cwd(), 'package.json'),\n      {\n        dependencies: {\n          'react-native-test': '*',\n        },\n      }\n    );\n\n    const link = require('../link').func;\n    link([], config).then(() => {\n      expect(\n        config.getDependencyConfig.calledWith('react-native-test')\n      ).toBeTruthy();\n      done();\n    });\n  });\n\n  it('should register native module when android/ios projects are present', (done) => {\n    const registerNativeModule = sinon.stub();\n    const dependencyConfig = {android: {}, ios: {}, assets: [], commands: {}};\n    const config = {\n      getProjectConfig: () => ({android: {}, ios: {}, assets: []}),\n      getDependencyConfig: sinon.stub().returns(dependencyConfig),\n    };\n\n    jest.setMock(\n      '../android/isInstalled.js',\n      sinon.stub().returns(false)\n    );\n\n    jest.setMock(\n      '../android/registerNativeModule.js',\n      registerNativeModule\n    );\n\n    jest.setMock(\n      '../ios/isInstalled.js',\n      sinon.stub().returns(false)\n    );\n\n    jest.setMock(\n      '../ios/registerNativeModule.js',\n      registerNativeModule\n    );\n\n    const link = require('../link').func;\n\n    link(['react-native-blur'], config).then(() => {\n      expect(registerNativeModule.calledTwice).toBeTruthy();\n      done();\n    });\n  });\n\n  it('should not register modules when they are already installed', (done) => {\n    const registerNativeModule = sinon.stub();\n    const dependencyConfig = {ios: {}, android: {}, assets: [], commands: {}};\n    const config = {\n      getProjectConfig: () => ({ ios: {}, android: {}, assets: [] }),\n      getDependencyConfig: sinon.stub().returns(dependencyConfig),\n    };\n\n    jest.setMock(\n      '../ios/isInstalled.js',\n      sinon.stub().returns(true)\n    );\n\n    jest.setMock(\n      '../android/isInstalled.js',\n      sinon.stub().returns(true)\n    );\n\n    jest.setMock(\n      '../ios/registerNativeModule.js',\n      registerNativeModule\n    );\n\n    jest.setMock(\n      '../android/registerNativeModule.js',\n      registerNativeModule\n    );\n\n    const link = require('../link').func;\n\n    link(['react-native-blur'], config).then(() => {\n      expect(registerNativeModule.callCount).toEqual(0);\n      done();\n    });\n  });\n\n  it('should run prelink and postlink commands at the appropriate times', (done) => {\n    const registerNativeModule = sinon.stub();\n    const prelink = sinon.stub().yieldsAsync();\n    const postlink = sinon.stub().yieldsAsync();\n\n    jest.setMock(\n      '../ios/registerNativeModule.js',\n      registerNativeModule\n    );\n\n    jest.setMock(\n      '../ios/isInstalled.js',\n      sinon.stub().returns(false)\n    );\n\n    const config = {\n      getProjectConfig: () => ({ ios: {}, assets: [] }),\n      getDependencyConfig: sinon.stub().returns({\n        ios: {}, assets: [], commands: { prelink, postlink },\n      }),\n    };\n\n    const link = require('../link').func;\n\n    link(['react-native-blur'], config).then(() => {\n      expect(prelink.calledBefore(registerNativeModule)).toBeTruthy();\n      expect(postlink.calledAfter(registerNativeModule)).toBeTruthy();\n      done();\n    });\n  });\n\n  it('should copy assets from both project and dependencies projects', (done) => {\n    const dependencyAssets = ['Fonts/Font.ttf'];\n    const dependencyConfig = {assets: dependencyAssets, commands: {}};\n    const projectAssets = ['Fonts/FontC.ttf'];\n    const copyAssets = sinon.stub();\n\n    jest.setMock(\n      '../ios/copyAssets.js',\n      copyAssets\n    );\n\n    const config = {\n      getProjectConfig: () => ({ ios: {}, assets: projectAssets }),\n      getDependencyConfig: sinon.stub().returns(dependencyConfig),\n    };\n\n    const link = require('../link').func;\n\n    link(['react-native-blur'], config).then(() => {\n      expect(copyAssets.calledOnce).toBeTruthy();\n      expect(copyAssets.getCall(0).args[0]).toEqual(\n        projectAssets.concat(dependencyAssets)\n      );\n      done();\n    });\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/pods/findLineToAddPod.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst path = require('path');\nconst findLineToAddPod = require('../../pods/findLineToAddPod');\nconst readPodfile = require('../../pods/readPodfile');\n\nconst PODFILES_PATH = path.join(__dirname, '../../__fixtures__/pods');\nconst LINE_AFTER_TARGET_IN_TEST_PODFILE = 4;\n\ndescribe('pods::findLineToAddPod', () => {\n  it('returns null if file is not Podfile', () => {\n    const podfile = readPodfile(path.join(PODFILES_PATH, '../Info.plist'));\n    expect(findLineToAddPod(podfile, LINE_AFTER_TARGET_IN_TEST_PODFILE)).toBeNull();\n  });\n\n  it('returns correct line number for Simple Podfile', () => {\n    const podfile = readPodfile(path.join(PODFILES_PATH, 'PodfileSimple'));\n    expect(findLineToAddPod(podfile, LINE_AFTER_TARGET_IN_TEST_PODFILE)).toEqual({ line: 7, indentation: 2 });\n  });\n\n  it('returns correct line number for Podfile with target', () => {\n    const podfile = readPodfile(path.join(PODFILES_PATH, 'PodfileWithTarget'));\n    expect(findLineToAddPod(podfile, LINE_AFTER_TARGET_IN_TEST_PODFILE)).toEqual({ line: 21, indentation: 2 });\n  });\n\n  it('returns correct line number for Podfile with function', () => {\n    const podfile = readPodfile(path.join(PODFILES_PATH, 'PodfileWithFunction'));\n    expect(findLineToAddPod(podfile, LINE_AFTER_TARGET_IN_TEST_PODFILE)).toEqual({ line: 26, indentation: 2 });\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/pods/findMarkedLinesInPodfile.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst path = require('path');\nconst readPodfile = require('../../pods/readPodfile');\nconst findMarkedLinesInPodfile = require('../../pods/findMarkedLinesInPodfile');\n\nconst PODFILES_PATH = path.join(__dirname, '../../__fixtures__/pods');\nconst LINE_AFTER_TARGET_IN_TEST_PODFILE = 4;\n\ndescribe('pods::findMarkedLinesInPodfile', () => {\n  it('returns empty array if file is not Podfile', () => {\n    const podfile = readPodfile(path.join(PODFILES_PATH, '../Info.plist'));\n    expect(findMarkedLinesInPodfile(podfile)).toEqual([]);\n  });\n\n  it('returns empty array for Simple Podfile', () => {\n    const podfile = readPodfile(path.join(PODFILES_PATH, 'PodfileSimple'));\n    expect(findMarkedLinesInPodfile(podfile, LINE_AFTER_TARGET_IN_TEST_PODFILE)).toEqual([]);\n  });\n\n  it('returns correct line numbers for Podfile with marker', () => {\n    const podfile = readPodfile(path.join(PODFILES_PATH, 'PodfileWithMarkers'));\n    const expectedObject = [{ line: 18, indentation: 2 }, { line: 31, indentation: 4 }];\n    expect(findMarkedLinesInPodfile(podfile, LINE_AFTER_TARGET_IN_TEST_PODFILE)).toEqual(expectedObject);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/pods/findPodTargetLine.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst path = require('path');\nconst findPodTargetLine = require('../../pods/findPodTargetLine');\nconst readPodfile = require('../../pods/readPodfile');\n\nconst PODFILES_PATH = path.join(__dirname, '../../__fixtures__/pods');\n\ndescribe('pods::findPodTargetLine', () => {\n  it('returns null if file is not Podfile', () => {\n    const podfile = readPodfile(path.join(PODFILES_PATH, '../Info.plist'));\n    expect(findPodTargetLine(podfile, 'name')).toBeNull();\n  });\n\n  it('returns null if there is not matching project name', () => {\n    const podfile = readPodfile(path.join(PODFILES_PATH, 'PodfileSimple'));\n    expect(findPodTargetLine(podfile, 'invalidName')).toBeNull();\n  });\n\n  it('returns null if there is not matching project name', () => {\n    const podfile = readPodfile(path.join(PODFILES_PATH, 'PodfileSimple'));\n    expect(findPodTargetLine(podfile, 'Testing')).toBe(4);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/pods/isInstalled.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst path = require('path');\nconst isInstalled = require('../../pods/isInstalled');\n\nconst PODFILES_PATH = path.join(__dirname, '../../__fixtures__/pods');\n\ndescribe('pods::isInstalled', () => {\n  it('returns false if pod is missing', () => {\n    const project = { podfile: path.join(PODFILES_PATH, 'PodfileSimple') };\n    const podspecName = { podspec: 'NotExisting' };\n    expect(isInstalled(project, podspecName)).toBe(false);\n  });\n\n  it('returns true for existing pod with version number', () => {\n    const project = { podfile: path.join(PODFILES_PATH, 'PodfileSimple') };\n    const podspecName = { podspec: 'TestPod' };\n    expect(isInstalled(project, podspecName)).toBe(true);\n  });\n\n  it('returns true for existing pod with path', () => {\n    const project = { podfile: path.join(PODFILES_PATH, 'PodfileWithTarget') };\n    const podspecName = { podspec: 'Yoga' };\n    expect(isInstalled(project, podspecName)).toBe(true);\n  });\n\n  it('returns true for existing pod with multiline definition', () => {\n    const project = { podfile: path.join(PODFILES_PATH, 'PodfileWithFunction') };\n    const podspecName = { podspec: 'React' };\n    expect(isInstalled(project, podspecName)).toBe(true);\n  });\n});\n"
  },
  {
    "path": "local-cli/link/__tests__/pods/removePodEntry.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst path = require('path');\nconst removePodEntry = require('../../pods/removePodEntry');\nconst readPodfile = require('../../pods/readPodfile');\n\nconst PODFILES_PATH = path.join(__dirname, '../../__fixtures__/pods');\n\ndescribe('pods::removePodEntry', () => {\n  it('should remove one line from Podfile with TestPod', () => {\n    const { podfileContent, podLinesCount } = readTestPodFile('PodfileSimple');\n    const podFileWithRemoved = removePodEntry(podfileContent, 'TestPod');\n    const newLineCount = podFileWithRemoved.split('\\n').length;\n    expect(newLineCount).toBe(podLinesCount - 1);\n  });\n\n  it('should remove one line from Podfile with Yoga', () => {\n    const { podfileContent, podLinesCount } = readTestPodFile('PodfileWithTarget');\n    const podFileWithRemoved = removePodEntry(podfileContent, 'Yoga');\n    const newLineCount = podFileWithRemoved.split('\\n').length;\n    expect(newLineCount).toBe(podLinesCount - 1);\n  });\n\n  it('should remove whole reference to React pod from Podfile', () => {\n    const { podfileContent, podLinesCount } = readTestPodFile('PodfileWithTarget');\n    const podFileWithRemoved = removePodEntry(podfileContent, 'React');\n    const newLineCount = podFileWithRemoved.split('\\n').length;\n    expect(newLineCount).toBe(podLinesCount - 9);\n  });\n});\n\nfunction readTestPodFile(fileName) {\n  const podfileLines = readPodfile(path.join(PODFILES_PATH, fileName));\n  return { podfileContent: podfileLines.join('\\n'), podLinesCount: podfileLines.length };\n}\n"
  },
  {
    "path": "local-cli/link/__tests__/promiseWaterfall.spec.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * All rights reserved.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\nconst sinon = require('sinon');\nconst promiseWaterfall = require('../promiseWaterfall');\n\ndescribe('promiseWaterfall', () => {\n\n  it('should run promises in a sequence', (done) => {\n    const tasks = [sinon.stub(), sinon.stub()];\n\n    promiseWaterfall(tasks).then(() => {\n      expect(tasks[0].calledBefore(tasks[1])).toBeTruthy();\n      done();\n    });\n  });\n\n  it('should resolve with last promise value', (done) => {\n    const tasks = [sinon.stub().returns(1), sinon.stub().returns(2)];\n\n    promiseWaterfall(tasks).then(value => {\n      expect(value).toEqual(2);\n      done();\n    });\n  });\n\n  it('should stop the sequence when one of promises is rejected', (done) => {\n    const error = new Error();\n    const tasks = [sinon.stub().throws(error), sinon.stub().returns(2)];\n\n    promiseWaterfall(tasks).catch(err => {\n      expect(err).toEqual(error);\n      expect(tasks[1].callCount).toEqual(0);\n      done();\n    });\n  });\n\n});\n"
  },
  {
    "path": "local-cli/link/android/copyAssets.js",
    "content": "const fs = require('fs-extra');\nconst path = require('path');\nconst groupFilesByType = require('../groupFilesByType');\n\n/**\n * Copies each file from an array of assets provided to targetPath directory\n *\n * For now, the only types of files that are handled are:\n * - Fonts (otf, ttf) - copied to targetPath/fonts under original name\n */\nmodule.exports = function copyAssetsAndroid(files, targetPath) {\n  const assets = groupFilesByType(files);\n\n  (assets.font || []).forEach(asset =>\n    fs.copySync(asset, path.join(targetPath, 'fonts', path.basename(asset)))\n  );\n};\n"
  },
  {
    "path": "local-cli/link/android/fs.js",
    "content": "const fs = require('fs-extra');\n\nexports.readFile = (file) =>\n  () => fs.readFileSync(file, 'utf8');\n\nexports.writeFile = (file, content) => content ?\n  fs.writeFileSync(file, content, 'utf8') :\n  (c) => fs.writeFileSync(file, c, 'utf8');\n"
  },
  {
    "path": "local-cli/link/android/isInstalled.js",
    "content": "const fs = require('fs');\nconst makeBuildPatch = require('./patches/makeBuildPatch');\n\nmodule.exports = function isInstalled(config, name) {\n  const buildGradle = fs.readFileSync(config.buildGradlePath);\n  return makeBuildPatch(name).installPattern.test(buildGradle);\n};\n"
  },
  {
    "path": "local-cli/link/android/patches/applyParams.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst toCamelCase = require('lodash').camelCase;\n\nmodule.exports = function applyParams(str, params, prefix) {\n  return str.replace(\n    /\\$\\{(\\w+)\\}/g,\n    (pattern, param) => {\n      const name = toCamelCase(prefix) + '_' + param;\n\n      return params[param]\n        ? `getResources().getString(R.string.${name})`\n        : null;\n    }\n  );\n};\n"
  },
  {
    "path": "local-cli/link/android/patches/applyPatch.js",
    "content": "const fs = require('fs');\n\nmodule.exports = function applyPatch(file, patch) {\n  fs.writeFileSync(file, fs\n    .readFileSync(file, 'utf8')\n    .replace(patch.pattern, match => `${match}${patch.patch}`)\n  );\n};\n"
  },
  {
    "path": "local-cli/link/android/patches/makeBuildPatch.js",
    "content": "module.exports = function makeBuildPatch(name) {\n  const installPattern = new RegExp(\n    `\\\\s{4}(compile)(\\\\(|\\\\s)(project)\\\\(\\\\\\':${name}\\\\\\'\\\\)(\\\\)|\\\\s)`\n  );\n\n  return {\n    installPattern,\n    pattern: /[^ \\t]dependencies {\\n/,\n    patch: `    compile project(':${name}')\\n`\n  };\n};\n"
  },
  {
    "path": "local-cli/link/android/patches/makeImportPatch.js",
    "content": "module.exports = function makeImportPatch(packageImportPath) {\n  return {\n    pattern: 'import com.facebook.react.ReactApplication;',\n    patch: '\\n' + packageImportPath,\n  };\n};\n"
  },
  {
    "path": "local-cli/link/android/patches/makePackagePatch.js",
    "content": "const applyParams = require('./applyParams');\n\nmodule.exports = function makePackagePatch(packageInstance, params, prefix) {\n  const processedInstance = applyParams(packageInstance, params, prefix);\n\n  return {\n    pattern: 'new MainReactPackage()',\n    patch: ',\\n            ' + processedInstance,\n  };\n};\n"
  },
  {
    "path": "local-cli/link/android/patches/makeSettingsPatch.js",
    "content": "const path = require('path');\nconst isWin = process.platform === 'win32';\n\nmodule.exports = function makeSettingsPatch(name, androidConfig, projectConfig) {\n  var projectDir = path.relative(\n    path.dirname(projectConfig.settingsGradlePath),\n    androidConfig.sourceDir\n  );\n\n  /*\n   * Fix for Windows\n   * Backslashes is the escape character and will result in\n   * an invalid path in settings.gradle\n   * https://github.com/rnpm/rnpm/issues/113\n   */\n  if (isWin) {\n    projectDir = projectDir.replace(/\\\\/g, '/');\n  }\n\n  return {\n    pattern: '\\n',\n    patch: `include ':${name}'\\n` +\n      `project(':${name}').projectDir = ` +\n      `new File(rootProject.projectDir, '${projectDir}')\\n`,\n  };\n};\n"
  },
  {
    "path": "local-cli/link/android/patches/makeStringsPatch.js",
    "content": "const toCamelCase = require('lodash').camelCase;\n\nmodule.exports = function makeStringsPatch(params, prefix) {\n  const values = Object.keys(params)\n    .map(param => {\n      const name = toCamelCase(prefix) + '_' + param;\n      return '    ' +\n        `<string moduleConfig=\"true\" name=\"${name}\">${params[param]}</string>`;\n    });\n\n  const patch = values.length > 0\n    ? values.join('\\n') + '\\n'\n    : '';\n\n  return {\n    pattern: '<resources>\\n',\n    patch,\n  };\n};\n"
  },
  {
    "path": "local-cli/link/android/patches/revokePatch.js",
    "content": "const fs = require('fs');\n\nmodule.exports = function revokePatch(file, patch) {\n  fs.writeFileSync(file, fs\n    .readFileSync(file, 'utf8')\n    .replace(patch.patch, '')\n  );\n};\n"
  },
  {
    "path": "local-cli/link/android/registerNativeModule.js",
    "content": "const applyPatch = require('./patches/applyPatch');\nconst makeStringsPatch = require('./patches/makeStringsPatch');\nconst makeSettingsPatch = require('./patches/makeSettingsPatch');\nconst makeBuildPatch = require('./patches/makeBuildPatch');\nconst makeImportPatch = require('./patches/makeImportPatch');\nconst makePackagePatch = require('./patches/makePackagePatch');\n\nmodule.exports = function registerNativeAndroidModule(\n  name,\n  androidConfig,\n  params,\n  projectConfig\n) {\n  const buildPatch = makeBuildPatch(name);\n\n  applyPatch(\n    projectConfig.settingsGradlePath,\n    makeSettingsPatch(name, androidConfig, projectConfig)\n  );\n\n  applyPatch(projectConfig.buildGradlePath, buildPatch);\n  applyPatch(projectConfig.stringsPath, makeStringsPatch(params, name));\n\n  applyPatch(\n    projectConfig.mainFilePath,\n    makePackagePatch(androidConfig.packageInstance, params, name)\n  );\n\n  applyPatch(\n    projectConfig.mainFilePath,\n    makeImportPatch(androidConfig.packageImportPath)\n  );\n};\n"
  },
  {
    "path": "local-cli/link/android/unlinkAssets.js",
    "content": "const fs = require('fs-extra');\nconst path = require('path');\nconst groupFilesByType = require('../groupFilesByType');\n\n/**\n * Copies each file from an array of assets provided to targetPath directory\n *\n * For now, the only types of files that are handled are:\n * - Fonts (otf, ttf) - copied to targetPath/fonts under original name\n */\nmodule.exports = function unlinkAssetsAndroid(files, targetPath) {\n  const assets = groupFilesByType(files);\n\n  (assets.font || []).forEach((file) => {\n    const filePath = path.join(targetPath, 'fonts', path.basename(file));\n    if (fs.existsSync(filePath)) {\n      fs.unlinkSync(filePath);\n    }\n  });\n};\n"
  },
  {
    "path": "local-cli/link/android/unregisterNativeModule.js",
    "content": "const fs = require('fs');\nconst toCamelCase = require('lodash').camelCase;\n\nconst revokePatch = require('./patches/revokePatch');\nconst makeSettingsPatch = require('./patches/makeSettingsPatch');\nconst makeBuildPatch = require('./patches/makeBuildPatch');\nconst makeStringsPatch = require('./patches/makeStringsPatch');\nconst makeImportPatch = require('./patches/makeImportPatch');\nconst makePackagePatch = require('./patches/makePackagePatch');\n\nmodule.exports = function unregisterNativeAndroidModule(\n  name,\n  androidConfig,\n  projectConfig\n) {\n  const buildPatch = makeBuildPatch(name);\n  const strings = fs.readFileSync(projectConfig.stringsPath, 'utf8');\n  var params = {};\n\n  strings.replace(\n    /moduleConfig=\"true\" name=\"(\\w+)\">(.*)</g,\n    (_, param, value) => {\n      params[param.slice(toCamelCase(name).length + 1)] = value;\n    }\n  );\n\n  revokePatch(\n    projectConfig.settingsGradlePath,\n    makeSettingsPatch(name, androidConfig, projectConfig)\n  );\n\n  revokePatch(projectConfig.buildGradlePath, buildPatch);\n  revokePatch(projectConfig.stringsPath, makeStringsPatch(params, name));\n\n  revokePatch(\n    projectConfig.mainFilePath,\n    makePackagePatch(androidConfig.packageInstance, params, name)\n  );\n\n  revokePatch(\n    projectConfig.mainFilePath,\n    makeImportPatch(androidConfig.packageImportPath)\n  );\n};\n"
  },
  {
    "path": "local-cli/link/commandStub.js",
    "content": "module.exports = (cb) => cb();\n"
  },
  {
    "path": "local-cli/link/getDependencyConfig.js",
    "content": "/**\n * Given an array of dependencies - it returns their RNPM config\n * if they were valid.\n */\nmodule.exports = function getDependencyConfig(config, deps) {\n  return deps.reduce((acc, name) => {\n    try {\n      return acc.concat({\n        config: config.getDependencyConfig(name),\n        name,\n      });\n    } catch (err) {\n      console.log(err);\n      return acc;\n    }\n  }, []);\n};\n"
  },
  {
    "path": "local-cli/link/getProjectDependencies.js",
    "content": "const path = require('path');\n\n/**\n * Returns an array of dependencies that should be linked/checked.\n */\nmodule.exports = function getProjectDependencies() {\n  const pjson = require(path.join(process.cwd(), './package.json'));\n  return Object.keys(pjson.dependencies || {}).filter(name => name !== 'react-native');\n};\n"
  },
  {
    "path": "local-cli/link/groupFilesByType.js",
    "content": "const groupBy = require('lodash').groupBy;\nconst mime = require('mime');\n\n/**\n * Since there are no officially registered MIME types\n * for ttf/otf yet http://www.iana.org/assignments/media-types/media-types.xhtml,\n * we define two non-standard ones for the sake of parsing\n */\nmime.define({\n  'font/opentype': ['otf'],\n  'font/truetype': ['ttf'],\n});\n\n/**\n * Given an array of files, it groups it by it's type.\n * Type of the file is inferred from it's mimetype based on the extension\n * file ends up with. The returned value is an object with properties that\n * correspond to the first part of the mimetype, e.g. images will be grouped\n * under `image` key since the mimetype for them is `image/jpg` etc.\n *\n * Example:\n * Given an array ['fonts/a.ttf', 'images/b.jpg'],\n * the returned object will be: {font: ['fonts/a.ttf'], image: ['images/b.jpg']}\n */\nmodule.exports = function groupFilesByType(assets) {\n  return groupBy(assets, type => mime.lookup(type).split('/')[0]);\n};\n"
  },
  {
    "path": "local-cli/link/ios/addFileToProject.js",
    "content": "const PbxFile = require('xcode/lib/pbxFile');\n\n/**\n * Given xcodeproj and filePath, it creates new file\n * from path provided, adds it to the project\n * and returns newly created instance of a file\n */\nmodule.exports = function addFileToProject(project, filePath) {\n  const file = new PbxFile(filePath);\n  file.uuid = project.generateUuid();\n  file.fileRef = project.generateUuid();\n  project.addToPbxFileReferenceSection(file);\n  return file;\n};\n"
  },
  {
    "path": "local-cli/link/ios/addProjectToLibraries.js",
    "content": "/**\n * Given an array of xcodeproj libraries and pbxFile,\n * it appends it to that group\n *\n * Important: That function mutates `libraries` and it's not pure.\n * It's mainly due to limitations of `xcode` library.\n */\nmodule.exports = function addProjectToLibraries(libraries, file) {\n  return libraries.children.push({\n    value: file.fileRef,\n    comment: file.basename,\n  });\n};\n"
  },
  {
    "path": "local-cli/link/ios/addSharedLibraries.js",
    "content": "const createGroupWithMessage = require('./createGroupWithMessage');\n\nmodule.exports = function addSharedLibraries(project, libraries) {\n  if (!libraries.length) {\n    return;\n  }\n\n  // Create a Frameworks group if necessary.\n  createGroupWithMessage(project, 'Frameworks');\n\n  const target = project.getFirstTarget().uuid;\n\n  for (var name of libraries) {\n    project.addFramework(name, { target });\n  }\n};\n"
  },
  {
    "path": "local-cli/link/ios/addToHeaderSearchPaths.js",
    "content": "const mapHeaderSearchPaths = require('./mapHeaderSearchPaths');\n\nmodule.exports = function addToHeaderSearchPaths(project, path) {\n  mapHeaderSearchPaths(project, searchPaths => searchPaths.concat(path));\n};\n"
  },
  {
    "path": "local-cli/link/ios/copyAssets.js",
    "content": "const fs = require('fs-extra');\nconst path = require('path');\nconst xcode = require('xcode');\nconst log = require('npmlog');\nconst groupFilesByType = require('../groupFilesByType');\nconst createGroupWithMessage = require('./createGroupWithMessage');\nconst getPlist = require('./getPlist');\nconst writePlist = require('./writePlist');\n\n/**\n * This function works in a similar manner to its Android version,\n * except it does not copy fonts but creates Xcode Group references\n */\nmodule.exports = function linkAssetsIOS(files, projectConfig) {\n  const project = xcode.project(projectConfig.pbxprojPath).parseSync();\n  const assets = groupFilesByType(files);\n  const plist = getPlist(project, projectConfig.sourceDir);\n\n  createGroupWithMessage(project, 'Resources');\n\n  function addResourceFile(f) {\n    return (f || [])\n      .map(asset =>\n        project.addResourceFile(\n          path.relative(projectConfig.sourceDir, asset),\n          { target: project.getFirstTarget().uuid }\n        )\n      )\n      .filter(file => file)   // xcode returns false if file is already there\n      .map(file => file.basename);\n  }\n\n  addResourceFile(assets.image);\n\n  const fonts = addResourceFile(assets.font);\n\n  const existingFonts = (plist.UIAppFonts || []);\n  const allFonts = [...existingFonts, ...fonts];\n  plist.UIAppFonts = Array.from(new Set(allFonts)); // use Set to dedupe w/existing\n\n  fs.writeFileSync(\n    projectConfig.pbxprojPath,\n    project.writeSync()\n  );\n\n  writePlist(project, projectConfig.sourceDir, plist);\n};\n"
  },
  {
    "path": "local-cli/link/ios/createGroup.js",
    "content": "const getGroup = require('./getGroup');\n\nconst hasGroup = (pbxGroup, name) => pbxGroup.children.find(group => group.comment === name);\n\n/**\n * Given project and path of the group, it deeply creates a given group\n * making all outer groups if neccessary\n *\n * Returns newly created group\n */\nmodule.exports = function createGroup(project, path) {\n  return path.split('/').reduce(\n    (group, name) => {\n      if (!hasGroup(group, name)) {\n        const uuid = project.pbxCreateGroup(name, '\"\"');\n\n        group.children.push({\n          value: uuid,\n          comment: name,\n        });\n      }\n\n      return project.pbxGroupByName(name);\n    },\n    getGroup(project)\n  );\n};\n"
  },
  {
    "path": "local-cli/link/ios/createGroupWithMessage.js",
    "content": "const log = require('npmlog');\n\nconst createGroup = require('./createGroup');\nconst getGroup = require('./getGroup');\n\n/**\n * Given project and path of the group, it checks if a group exists at that path,\n * and deeply creates a group for that path if its does not already exist.\n *\n * Returns the existing or newly created group\n */\nmodule.exports = function createGroupWithMessage(project, path) {\n  var group = getGroup(project, path);\n\n  if (!group) {\n    group = createGroup(project, path);\n\n    log.warn(\n      'ERRGROUP',\n      `Group '${path}' does not exist in your Xcode project. We have created it automatically for you.`\n    );\n  }\n\n  return group;\n};\n"
  },
  {
    "path": "local-cli/link/ios/getBuildProperty.js",
    "content": "/**\n * Gets build property from the main target build section\n *\n * It differs from the project.getBuildProperty exposed by xcode in the way that:\n * - it only checks for build property in the main target `Debug` section\n * - `xcode` library iterates over all build sections and because it misses\n * an early return when property is found, it will return undefined/wrong value\n * when there's another build section typically after the one you want to access\n * without the property defined (e.g. CocoaPods sections appended to project\n * miss INFOPLIST_FILE), see: https://github.com/alunny/node-xcode/blob/master/lib/pbxProject.js#L1765\n */\nmodule.exports = function getBuildProperty(project, prop) {\n  const target = project.getFirstTarget().firstTarget;\n  const config = project.pbxXCConfigurationList()[target.buildConfigurationList];\n  const buildSection = project.pbxXCBuildConfigurationSection()[config.buildConfigurations[0].value];\n\n  return buildSection.buildSettings[prop];\n};\n"
  },
  {
    "path": "local-cli/link/ios/getGroup.js",
    "content": "const getFirstProject = (project) => project.getFirstProject().firstProject;\n\nconst findGroup = (group, name) => group.children.find(group => group.comment === name);\n\n/**\n * Returns group from .xcodeproj if one exists, null otherwise\n *\n * Unlike node-xcode `pbxGroupByName` - it does not return `first-matching`\n * group if multiple groups with the same name exist\n *\n * If path is not provided, it returns top-level group\n */\nmodule.exports = function getGroup(project, path) {\n  const firstProject = getFirstProject(project);\n\n  var group = project.getPBXGroupByKey(firstProject.mainGroup);\n\n  if (!path) {\n    return group;\n  }\n\n  for (var name of path.split('/')) {\n    var foundGroup = findGroup(group, name);\n\n    if (foundGroup) {\n      group = project.getPBXGroupByKey(foundGroup.value);\n    } else {\n      group = null;\n      break;\n    }\n  }\n\n  return group;\n};\n"
  },
  {
    "path": "local-cli/link/ios/getHeaderSearchPath.js",
    "content": "const path = require('path');\nconst union = require('lodash').union;\nconst last = require('lodash').last;\n\n/**\n * Given an array of directories, it returns the one that contains\n * all the other directories in a given array inside it.\n *\n * Example:\n * Given an array of directories: ['/Users/Kureev/a', '/Users/Kureev/b']\n * the returned folder is `/Users/Kureev`\n *\n * Check `getHeaderSearchPath.spec.js` for more use-cases.\n */\nconst getOuterDirectory = (directories) =>\n  directories.reduce((topDir, currentDir) => {\n    const currentFolders = currentDir.split(path.sep);\n    const topMostFolders = topDir.split(path.sep);\n\n    if (currentFolders.length === topMostFolders.length\n      && last(currentFolders) !== last(topMostFolders)) {\n      return currentFolders.slice(0, -1).join(path.sep);\n    }\n\n    return currentFolders.length < topMostFolders.length\n      ? currentDir\n      : topDir;\n  });\n\n/**\n * Given an array of headers it returns search path so Xcode can resolve\n * headers when referenced like below:\n * ```\n * #import \"CodePush.h\"\n * ```\n * If all files are located in one directory (directories.length === 1),\n * we simply return a relative path to that location.\n *\n * Otherwise, we loop through them all to find the outer one that contains\n * all the headers inside. That location is then returned with /** appended at\n * the end so Xcode marks that location as `recursive` and will look inside\n * every folder of it to locate correct headers.\n */\nmodule.exports = function getHeaderSearchPath(sourceDir, headers) {\n  const directories = union(\n    headers.map(path.dirname)\n  );\n\n  return directories.length === 1\n    ? `\"$(SRCROOT)${path.sep}${path.relative(sourceDir, directories[0])}\"`\n    : `\"$(SRCROOT)${path.sep}${path.relative(sourceDir, getOuterDirectory(directories))}/**\"`;\n};\n"
  },
  {
    "path": "local-cli/link/ios/getHeadersInFolder.js",
    "content": "const glob = require('glob');\nconst path = require('path');\n\nconst GLOB_EXCLUDE_PATTERN = ['node_modules/**', 'Pods/**', 'Examples/**', 'examples/**'];\n\n/**\n * Given folder, it returns an array of all header files\n * inside it, ignoring node_modules and examples\n */\nmodule.exports = function getHeadersInFolder(folder) {\n  return glob\n    .sync('**/*.h', {\n      cwd: folder,\n      nodir: true,\n      ignore: GLOB_EXCLUDE_PATTERN,\n    })\n    .map(file => path.join(folder, file));\n};\n"
  },
  {
    "path": "local-cli/link/ios/getPlist.js",
    "content": "const plistParser = require('plist');\nconst getPlistPath = require('./getPlistPath');\nconst fs = require('fs');\n\n/**\n * Returns Info.plist located in the iOS project\n *\n * Returns `null` if INFOPLIST_FILE is not specified.\n */\nmodule.exports = function getPlist(project, sourceDir) {\n  const plistPath = getPlistPath(project, sourceDir);\n\n  if (!plistPath || !fs.existsSync(plistPath)) {\n    return null;\n  }\n\n  return plistParser.parse(\n    fs.readFileSync(plistPath, 'utf-8')\n  );\n};\n"
  },
  {
    "path": "local-cli/link/ios/getPlistPath.js",
    "content": "const path = require('path');\nconst getBuildProperty = require('./getBuildProperty');\n\nmodule.exports = function getPlistPath(project, sourceDir) {\n  const plistFile = getBuildProperty(project, 'INFOPLIST_FILE');\n\n  if (!plistFile) {\n    return null;\n  }\n\n  return path.join(\n    sourceDir,\n    plistFile.replace(/\"/g, '').replace('$(SRCROOT)', '')\n  );\n};\n"
  },
  {
    "path": "local-cli/link/ios/getProducts.js",
    "content": "/**\n * Given xcodeproj it returns list of products ending with\n * .a extension, so that we know what elements add to target\n * project static library\n */\nmodule.exports = function getProducts(project) {\n  return project\n    .pbxGroupByName('Products')\n    .children\n    .map(c => c.comment)\n    .filter(c => c.indexOf('.a') > -1);\n};\n"
  },
  {
    "path": "local-cli/link/ios/hasLibraryImported.js",
    "content": "/**\n * Given an array of libraries already imported and packageName that will be\n * added, returns true or false depending on whether the library is already linked\n * or not\n */\nmodule.exports = function hasLibraryImported(libraries, packageName) {\n  return libraries.children\n    .filter(library => library.comment === packageName)\n    .length > 0;\n};\n"
  },
  {
    "path": "local-cli/link/ios/isInstalled.js",
    "content": "const xcode = require('xcode');\nconst getGroup = require('./getGroup');\nconst hasLibraryImported = require('./hasLibraryImported');\n\n/**\n * Returns true if `xcodeproj` specified by dependencyConfig is present\n * in a top level `libraryFolder`\n */\nmodule.exports = function isInstalled(projectConfig, dependencyConfig) {\n  const project = xcode.project(projectConfig.pbxprojPath).parseSync();\n  const libraries = getGroup(project, projectConfig.libraryFolder);\n\n  if (!libraries) {\n    return false;\n  }\n\n  return hasLibraryImported(libraries, dependencyConfig.projectName);\n};\n"
  },
  {
    "path": "local-cli/link/ios/mapHeaderSearchPaths.js",
    "content": "/**\n * Given Xcode project and path, iterate over all build configurations\n * and execute func with HEADER_SEARCH_PATHS from current section\n *\n * We cannot use builtin addToHeaderSearchPaths method since react-native init does not\n * use $(TARGET_NAME) for PRODUCT_NAME, but sets it manually so that method will skip\n * that target.\n *\n * To workaround that issue and make it more bullet-proof for different names,\n * we iterate over all configurations and look for `lc++` linker flag to detect\n * React Native target.\n *\n * Important: That function mutates `buildSettings` and it's not pure thus you should\n * not rely on its return value\n */\nconst defaultHeaderPaths = ['\"$(inherited)\"'];\n\nmodule.exports = function headerSearchPathIter(project, func) {\n  const config = project.pbxXCBuildConfigurationSection();\n\n  Object\n    .keys(config)\n    .filter(ref => ref.indexOf('_comment') === -1)\n    .forEach(ref => {\n      const buildSettings = config[ref].buildSettings;\n      const shouldVisitBuildSettings = (\n          Array.isArray(buildSettings.OTHER_LDFLAGS) ?\n            buildSettings.OTHER_LDFLAGS :\n            []\n        )\n        .indexOf('\"-lc++\"') >= 0;\n\n      if (shouldVisitBuildSettings) {\n        const searchPaths = buildSettings.HEADER_SEARCH_PATHS ?\n          [].concat(buildSettings.HEADER_SEARCH_PATHS) :\n          defaultHeaderPaths;\n\n        buildSettings.HEADER_SEARCH_PATHS = func(searchPaths);\n      }\n    });\n};\n"
  },
  {
    "path": "local-cli/link/ios/registerNativeModule.js",
    "content": "const xcode = require('xcode');\nconst fs = require('fs');\nconst path = require('path');\nconst log = require('npmlog');\n\nconst addToHeaderSearchPaths = require('./addToHeaderSearchPaths');\nconst getHeadersInFolder = require('./getHeadersInFolder');\nconst getHeaderSearchPath = require('./getHeaderSearchPath');\nconst getProducts = require('./getProducts');\nconst createGroupWithMessage = require('./createGroupWithMessage');\nconst addFileToProject = require('./addFileToProject');\nconst addProjectToLibraries = require('./addProjectToLibraries');\nconst addSharedLibraries = require('./addSharedLibraries');\nconst isEmpty = require('lodash').isEmpty;\nconst getGroup = require('./getGroup');\n\n/**\n * Register native module IOS adds given dependency to project by adding\n * its xcodeproj to project libraries as well as attaching static library\n * to the first target (the main one)\n *\n * If library is already linked, this action is a no-op.\n */\nmodule.exports = function registerNativeModuleIOS(dependencyConfig, projectConfig) {\n  const project = xcode.project(projectConfig.pbxprojPath).parseSync();\n  const dependencyProject = xcode.project(dependencyConfig.pbxprojPath).parseSync();\n\n  const libraries = createGroupWithMessage(project, projectConfig.libraryFolder);\n  const file = addFileToProject(\n    project,\n    path.relative(projectConfig.sourceDir, dependencyConfig.projectPath)\n  );\n\n  addProjectToLibraries(libraries, file);\n\n  getProducts(dependencyProject).forEach(product => {\n    project.addStaticLibrary(product, {\n      target: project.getFirstTarget().uuid,\n    });\n  });\n\n  addSharedLibraries(project, dependencyConfig.sharedLibraries);\n\n  const headers = getHeadersInFolder(dependencyConfig.folder);\n  if (!isEmpty(headers)) {\n    addToHeaderSearchPaths(\n      project,\n      getHeaderSearchPath(projectConfig.sourceDir, headers)\n    );\n  }\n\n  fs.writeFileSync(\n    projectConfig.pbxprojPath,\n    project.writeSync()\n  );\n};\n"
  },
  {
    "path": "local-cli/link/ios/removeFromHeaderSearchPaths.js",
    "content": "const mapHeaderSearchPaths = require('./mapHeaderSearchPaths');\n\n/**\n * Given Xcode project and absolute path, it makes sure there are no headers referring to it\n */\nmodule.exports = function addToHeaderSearchPaths(project, path) {\n  mapHeaderSearchPaths(project,\n    searchPaths => searchPaths.filter(searchPath => searchPath !== path)\n  );\n};\n"
  },
  {
    "path": "local-cli/link/ios/removeFromPbxItemContainerProxySection.js",
    "content": "/**\n * For all files that are created and referenced from another `.xcodeproj` -\n * a new PBXItemContainerProxy is created that contains `containerPortal` value\n * which equals to xcodeproj file.uuid from PBXFileReference section.\n */\nmodule.exports = function removeFromPbxItemContainerProxySection(project, file) {\n  const section = project.hash.project.objects.PBXContainerItemProxy;\n\n  for (var key of Object.keys(section)) {\n    if (section[key].containerPortal === file.uuid) {\n      delete section[key];\n    }\n  }\n\n  return;\n};\n"
  },
  {
    "path": "local-cli/link/ios/removeFromPbxReferenceProxySection.js",
    "content": "/**\n * Every file added to the project from another project is attached to\n * `PBXItemContainerProxy` through `PBXReferenceProxy`.\n */\nmodule.exports = function removeFromPbxReferenceProxySection(project, file) {\n  const section = project.hash.project.objects.PBXReferenceProxy;\n\n  for (var key of Object.keys(section)) {\n    if (section[key].path === file.basename) {\n      delete section[key];\n    }\n  }\n\n  return;\n};\n"
  },
  {
    "path": "local-cli/link/ios/removeFromProjectReferences.js",
    "content": "/**\n * For each file (.xcodeproj), there's an entry in `projectReferences` created\n * that has two entries - `ProjectRef` - reference to a file.uuid and\n * `ProductGroup` - uuid of a Products group.\n *\n * When projectReference is found - it's deleted and the removed value is returned\n * so that ProductGroup in PBXGroup section can be removed as well.\n *\n * Otherwise returns null\n */\nmodule.exports = function removeFromProjectReferences(project, file) {\n  const firstProject = project.getFirstProject().firstProject;\n\n  const projectRef = firstProject.projectReferences.find(item => item.ProjectRef === file.uuid);\n\n  if (!projectRef) {\n    return null;\n  }\n\n  firstProject.projectReferences.splice(\n    firstProject.projectReferences.indexOf(projectRef),\n    1\n  );\n\n  return projectRef;\n};\n"
  },
  {
    "path": "local-cli/link/ios/removeFromStaticLibraries.js",
    "content": "const PbxFile = require('xcode/lib/pbxFile');\nconst removeFromPbxReferenceProxySection = require('./removeFromPbxReferenceProxySection');\n\n/**\n * Removes file from static libraries\n *\n * Similar to `node-xcode` addStaticLibrary\n */\nmodule.exports = function removeFromStaticLibraries(project, path, opts) {\n  const file = new PbxFile(path);\n\n  file.target = opts ? opts.target : undefined;\n\n  project.removeFromPbxFileReferenceSection(file);\n  project.removeFromPbxBuildFileSection(file);\n  project.removeFromPbxFrameworksBuildPhase(file);\n  project.removeFromLibrarySearchPaths(file);\n  removeFromPbxReferenceProxySection(project, file);\n\n  return file;\n};\n"
  },
  {
    "path": "local-cli/link/ios/removeProductGroup.js",
    "content": "module.exports = function removeProductGroup(project, productGroupId) {\n  const section = project.hash.project.objects.PBXGroup;\n\n  for (var key of Object.keys(section)) {\n    if (key === productGroupId) {\n      delete section[key];\n    }\n  }\n\n  return;\n};\n"
  },
  {
    "path": "local-cli/link/ios/removeProjectFromLibraries.js",
    "content": "/**\n * Given an array of xcodeproj libraries and pbxFile,\n * it removes it from that group by comparing basenames\n *\n * Important: That function mutates `libraries` and it's not pure.\n * It's mainly due to limitations of `xcode` library.\n */\nmodule.exports = function removeProjectFromLibraries(libraries, file) {\n  libraries.children = libraries.children.filter(library =>\n    library.comment !== file.basename\n  );\n};\n"
  },
  {
    "path": "local-cli/link/ios/removeProjectFromProject.js",
    "content": "const PbxFile = require('xcode/lib/pbxFile');\nconst removeFromPbxItemContainerProxySection = require('./removeFromPbxItemContainerProxySection');\nconst removeFromProjectReferences = require('./removeFromProjectReferences');\nconst removeProductGroup = require('./removeProductGroup');\n\n/**\n * Given xcodeproj and filePath, it creates new file\n * from path provided and removes it. That operation is required since\n * underlying method requires PbxFile instance to be passed (it does not\n * have to have uuid or fileRef defined since it will do equality check\n * by path)\n *\n * Returns removed file (that one will have UUID)\n */\nmodule.exports = function removeProjectFromProject(project, filePath) {\n  const file = project.removeFromPbxFileReferenceSection(new PbxFile(filePath));\n  const projectRef = removeFromProjectReferences(project, file);\n\n  if (projectRef) {\n    removeProductGroup(project, projectRef.ProductGroup);\n  }\n\n  removeFromPbxItemContainerProxySection(project, file);\n\n  return file;\n};\n"
  },
  {
    "path": "local-cli/link/ios/removeSharedLibraries.js",
    "content": "module.exports = function removeSharedLibraries(project, libraries) {\n  if (!libraries.length) {\n    return;\n  }\n\n  const target = project.getFirstTarget().uuid;\n\n  for (var name of libraries) {\n    project.removeFramework(name, { target });\n  }\n};\n"
  },
  {
    "path": "local-cli/link/ios/unlinkAssets.js",
    "content": "const fs = require('fs-extra');\nconst path = require('path');\nconst xcode = require('xcode');\nconst log = require('npmlog');\nconst groupFilesByType = require('../groupFilesByType');\nconst getPlist = require('./getPlist');\nconst writePlist = require('./writePlist');\nconst difference = require('lodash').difference;\n\n/**\n * Unlinks assets from iOS project. Removes references for fonts from `Info.plist`\n * fonts provided by application and from `Resources` group\n */\nmodule.exports = function unlinkAssetsIOS(files, projectConfig) {\n  const project = xcode.project(projectConfig.pbxprojPath).parseSync();\n  const assets = groupFilesByType(files);\n  const plist = getPlist(project, projectConfig.sourceDir);\n\n  if (!plist) {\n    return log.error(\n      'ERRPLIST',\n      'Could not locate Info.plist file. Check if your project has \\'INFOPLIST_FILE\\' set properly'\n    );\n  }\n\n  if (!project.pbxGroupByName('Resources')) {\n    return log.error(\n      'ERRGROUP',\n      'Group \\'Resources\\' does not exist in your Xcode project. There is nothing to unlink.'\n    );\n  }\n\n  const removeResourceFile = function (f) {\n    (f || [])\n      .map(asset =>\n        project.removeResourceFile(\n          path.relative(projectConfig.sourceDir, asset),\n          { target: project.getFirstTarget().uuid }\n        )\n      )\n      .map(file => file.basename);\n  };\n\n  removeResourceFile(assets.image);\n\n  const fonts = removeResourceFile(assets.font);\n\n  plist.UIAppFonts = difference(plist.UIAppFonts || [], fonts);\n\n  fs.writeFileSync(\n    projectConfig.pbxprojPath,\n    project.writeSync()\n  );\n\n  writePlist(project, projectConfig.sourceDir, plist);\n};\n"
  },
  {
    "path": "local-cli/link/ios/unregisterNativeModule.js",
    "content": "const xcode = require('xcode');\nconst path = require('path');\nconst fs = require('fs');\nconst difference = require('lodash').difference;\nconst isEmpty = require('lodash').isEmpty;\n\nconst getGroup = require('./getGroup');\nconst getProducts = require('./getProducts');\nconst getHeadersInFolder = require('./getHeadersInFolder');\nconst getHeaderSearchPath = require('./getHeaderSearchPath');\nconst removeProjectFromProject = require('./removeProjectFromProject');\nconst removeProjectFromLibraries = require('./removeProjectFromLibraries');\nconst removeFromStaticLibraries = require('./removeFromStaticLibraries');\nconst removeFromHeaderSearchPaths = require('./removeFromHeaderSearchPaths');\nconst removeSharedLibraries = require('./removeSharedLibraries');\n\n/**\n * Unregister native module IOS\n *\n * If library is already unlinked, this action is a no-op.\n */\nmodule.exports = function unregisterNativeModule(dependencyConfig, projectConfig, iOSDependencies) {\n  const project = xcode.project(projectConfig.pbxprojPath).parseSync();\n  const dependencyProject = xcode.project(dependencyConfig.pbxprojPath).parseSync();\n\n  const libraries = getGroup(project, projectConfig.libraryFolder);\n\n  const file = removeProjectFromProject(\n    project,\n    path.relative(projectConfig.sourceDir, dependencyConfig.projectPath)\n  );\n\n  removeProjectFromLibraries(libraries, file);\n\n  getProducts(dependencyProject).forEach(product => {\n    removeFromStaticLibraries(project, product, {\n      target: project.getFirstTarget().uuid,\n    });\n  });\n\n  const sharedLibraries = difference(\n    dependencyConfig.sharedLibraries,\n    iOSDependencies.reduce(\n      (libs, dependency) => libs.concat(dependency.sharedLibraries),\n      projectConfig.sharedLibraries\n    )\n  );\n\n  removeSharedLibraries(project, sharedLibraries);\n\n  const headers = getHeadersInFolder(dependencyConfig.folder);\n  if (!isEmpty(headers)) {\n    removeFromHeaderSearchPaths(\n      project,\n      getHeaderSearchPath(projectConfig.sourceDir, headers)\n    );\n  }\n\n  fs.writeFileSync(\n    projectConfig.pbxprojPath,\n    project.writeSync()\n  );\n};\n"
  },
  {
    "path": "local-cli/link/ios/writePlist.js",
    "content": "const plistParser = require('plist');\nconst getPlistPath = require('./getPlistPath');\nconst fs = require('fs');\n\n/**\n * Writes to Info.plist located in the iOS project\n *\n * Returns `null` if INFOPLIST_FILE is not specified or file is non-existent.\n */\nmodule.exports = function writePlist(project, sourceDir, plist) {\n  const plistPath = getPlistPath(project, sourceDir);\n\n  if (!plistPath) {\n    return null;\n  }\n\n  // We start with an offset of -1, because Xcode maintains a custom\n  // indentation of the plist.\n  // Ref: https://github.com/facebook/react-native/issues/11668\n  return fs.writeFileSync(\n    plistPath,\n    plistParser.build(plist, { indent: '\\t', offset: -1 }) + '\\n'\n  );\n};\n"
  },
  {
    "path": "local-cli/link/link.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst log = require('npmlog');\nconst path = require('path');\nconst uniqBy = require('lodash').uniqBy;\nconst flatten = require('lodash').flatten;\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst chalk = require('chalk');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst isEmpty = require('lodash').isEmpty;\nconst promiseWaterfall = require('./promiseWaterfall');\nconst registerDependencyAndroid = require('./android/registerNativeModule');\nconst registerDependencyWindows = require('./windows/registerNativeModule');\nconst registerDependencyIOS = require('./ios/registerNativeModule');\nconst registerDependencyPods = require('./pods/registerNativeModule');\nconst isInstalledAndroid = require('./android/isInstalled');\nconst isInstalledWindows = require('./windows/isInstalled');\nconst isInstalledIOS = require('./ios/isInstalled');\nconst isInstalledPods = require('./pods/isInstalled');\nconst copyAssetsAndroid = require('./android/copyAssets');\nconst copyAssetsIOS = require('./ios/copyAssets');\nconst getProjectDependencies = require('./getProjectDependencies');\nconst getDependencyConfig = require('./getDependencyConfig');\nconst pollParams = require('./pollParams');\nconst commandStub = require('./commandStub');\nconst promisify = require('./promisify');\nconst findReactNativeScripts = require('../util/findReactNativeScripts');\n\nimport type {RNConfig} from '../core';\n\nlog.heading = 'rnpm-link';\n\nconst dedupeAssets = (assets) => uniqBy(assets, asset => path.basename(asset));\n\n\nconst linkDependencyAndroid = (androidProject, dependency) => {\n  if (!androidProject || !dependency.config.android) {\n    return null;\n  }\n\n  const isInstalled = isInstalledAndroid(androidProject, dependency.name);\n\n  if (isInstalled) {\n    log.info(chalk.grey(`Android module ${dependency.name} is already linked`));\n    return null;\n  }\n\n  return pollParams(dependency.config.params).then(params => {\n    log.info(`Linking ${dependency.name} android dependency`);\n\n    registerDependencyAndroid(\n      dependency.name,\n      dependency.config.android,\n      params,\n      androidProject\n    );\n\n    log.info(`Android module ${dependency.name} has been successfully linked`);\n  });\n};\n\nconst linkDependencyWindows = (windowsProject, dependency) => {\n\n  if (!windowsProject || !dependency.config.windows) {\n    return null;\n  }\n\n  const isInstalled = isInstalledWindows(windowsProject, dependency.config.windows);\n\n  if (isInstalled) {\n    log.info(chalk.grey(`Windows module ${dependency.name} is already linked`));\n    return null;\n  }\n\n  return pollParams(dependency.config.params).then(params => {\n    log.info(`Linking ${dependency.name} windows dependency`);\n\n    registerDependencyWindows(\n      dependency.name,\n      dependency.config.windows,\n      params,\n      windowsProject\n    );\n\n    log.info(`Windows module ${dependency.name} has been successfully linked`);\n  });\n};\n\nconst linkDependencyIOS = (iOSProject, dependency) => {\n  if (!iOSProject || !dependency.config.ios) {\n    return;\n  }\n\n  const isInstalled = isInstalledIOS(iOSProject, dependency.config.ios) || isInstalledPods(iOSProject, dependency.config.ios);\n  if (isInstalled) {\n    log.info(chalk.grey(`iOS module ${dependency.name} is already linked`));\n    return;\n  }\n\n  log.info(`Linking ${dependency.name} ios dependency`);\n  if (iOSProject.podfile && dependency.config.ios.podspec) {\n    registerDependencyPods(dependency, iOSProject);\n  }\n  else {\n    registerDependencyIOS(dependency.config.ios, iOSProject);\n  }\n  log.info(`iOS module ${dependency.name} has been successfully linked`);\n};\n\nconst linkAssets = (project, assets) => {\n  if (isEmpty(assets)) {\n    return;\n  }\n\n  if (project.ios) {\n    log.info('Linking assets to ios project');\n    copyAssetsIOS(assets, project.ios);\n  }\n\n  if (project.android) {\n    log.info('Linking assets to android project');\n    copyAssetsAndroid(assets, project.android.assetsPath);\n  }\n\n  log.info('Assets have been successfully linked to your project');\n};\n\n/**\n * Updates project and links all dependencies to it.\n *\n * @param args If optional argument [packageName] is provided,\n *             only that package is processed.\n * @param config CLI config, see local-cli/core/index.js\n */\nfunction link(args: Array<string>, config: RNConfig) {\n  var project;\n  try {\n    project = config.getProjectConfig();\n  } catch (err) {\n    log.error(\n      'ERRPACKAGEJSON',\n      'No package found. Are you sure this is a React Native project?'\n    );\n    return Promise.reject(err);\n  }\n\n  if (!project.android && !project.ios && !project.windows && findReactNativeScripts()) {\n    throw new Error(\n      '`react-native link` can not be used in Create React Native App projects. ' +\n      'If you need to include a library that relies on custom native code, ' +\n      'you might have to eject first. ' +\n      'See https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md ' +\n      'for more information.'\n    );\n  }\n\n  let packageName = args[0];\n  // Check if install package by specific version (eg. package@latest)\n  if (packageName !== undefined) {\n    packageName = packageName.split('@')[0];\n  }\n\n  const dependencies = getDependencyConfig(\n    config,\n    packageName ? [packageName] : getProjectDependencies()\n  );\n\n  const assets = dedupeAssets(dependencies.reduce(\n    (assets, dependency) => assets.concat(dependency.config.assets),\n    project.assets\n  ));\n\n  const tasks = flatten(dependencies.map(dependency => [\n    () => promisify(dependency.config.commands.prelink || commandStub),\n    () => linkDependencyAndroid(project.android, dependency),\n    () => linkDependencyIOS(project.ios, dependency),\n    () => linkDependencyWindows(project.windows, dependency),\n    () => promisify(dependency.config.commands.postlink || commandStub),\n  ]));\n\n  tasks.push(() => linkAssets(project, assets));\n\n  return promiseWaterfall(tasks).catch(err => {\n    log.error(\n      `Something went wrong while linking. Error: ${err.message} \\n` +\n      'Please file an issue here: https://github.com/facebook/react-native/issues'\n    );\n    throw err;\n  });\n}\n\nmodule.exports = {\n  func: link,\n  description: 'links all native dependencies (updates native build files)',\n  name: 'link [packageName]',\n};\n"
  },
  {
    "path": "local-cli/link/pods/addPodEntry.js",
    "content": "'use strict';\n\nmodule.exports = function addPodEntry(podLines, linesToAddEntry, podName, nodePath) {\n  const newEntry = `pod '${podName}', :path => '../node_modules/${nodePath}'\\n`;\n\n  if (!linesToAddEntry) {\n    return;\n  } else if (Array.isArray(linesToAddEntry)) {\n    linesToAddEntry.map(({ line, indentation }, idx) =>\n      podLines.splice(line + idx, 0, getLineToAdd(newEntry, indentation))\n    );\n  } else {\n    const { line, indentation } = linesToAddEntry;\n    podLines.splice(line, 0, getLineToAdd(newEntry, indentation));\n  }\n};\n\nfunction getLineToAdd(newEntry, indentation) {\n  const spaces = Array(indentation + 1).join(' ');\n  return spaces + newEntry;\n}\n"
  },
  {
    "path": "local-cli/link/pods/findLineToAddPod.js",
    "content": "'use strict';\n\nmodule.exports = function findLineToAddPod(podLines, firstTargetLine) {\n  // match line with new target: target 'project_name' do (most likely target inside podfile main target)\n  const nextTarget = /target (\\'|\\\")\\w+(\\'|\\\") do/g;\n  // match line that has only 'end' (if we don't catch new target or function, this would mean this is end of current target)\n  const endOfCurrentTarget = /^\\s*end\\s*$/g;\n  // match function definition, like: post_install do |installer| (some Podfiles have function defined inside main target\n  const functionDefinition = /^\\s*[a-z_]+\\s+do(\\s+\\|[a-z]+\\|)?/g;\n\n  for (let i = firstTargetLine, len = podLines.length; i < len; i++) {\n    const matchNextConstruct = podLines[i].match(nextTarget) || podLines[i].match(functionDefinition);\n    const matchEnd = podLines[i].match(endOfCurrentTarget);\n\n    if (matchNextConstruct || matchEnd) {\n      const firstNonSpaceCharacter = podLines[i].search(/\\S/);\n      return {\n        indentation: firstNonSpaceCharacter + (matchEnd ? 2 : 0),\n        line: i\n      };\n    }\n  }\n  return null;\n};\n"
  },
  {
    "path": "local-cli/link/pods/findMarkedLinesInPodfile.js",
    "content": "'use strict';\nconst MARKER_TEXT = '# Add new pods below this line';\n\nmodule.exports = function findMarkedLinesInPodfile(podLines) {\n  const result = [];\n  for (let i = 0, len = podLines.length; i < len; i++) {\n    if (podLines[i].includes(MARKER_TEXT)) {\n      result.push({ line: i + 1, indentation: podLines[i].indexOf('#') });\n    }\n  }\n  return result;\n};\n"
  },
  {
    "path": "local-cli/link/pods/findPodTargetLine.js",
    "content": "'use strict';\n\nmodule.exports = function findPodTargetLine(podLines, projectName) {\n  const targetName = projectName.replace('.xcodeproj', '');\n  //match first target definition in file: target 'target_name' do\n  const targetRegex = new RegExp('target (\\'|\\\")' + targetName + '(\\'|\\\") do', 'g');\n  for (let i = 0, len = podLines.length; i < len; i++) {\n    const match = podLines[i].match(targetRegex);\n    if (match) {\n      return i + 1;\n    }\n  }\n  return null;\n};\n"
  },
  {
    "path": "local-cli/link/pods/isInstalled.js",
    "content": "'use strict';\n\nconst readPodfile = require('./readPodfile');\n\nmodule.exports = function isInstalled(iOSProject, dependencyConfig) {\n  if (!iOSProject.podfile) {\n    return false;\n  }\n  // match line with pod declaration: pod 'dependencyPodName' (other possible parameters of pod are ignored)\n  const dependencyRegExp = new RegExp('pod\\\\s+(\\'|\\\")' + dependencyConfig.podspec + '(\\'|\\\")', 'g');\n  const podLines = readPodfile(iOSProject.podfile);\n  for (let i = 0, len = podLines.length; i < len; i++) {\n    const match = podLines[i].match(dependencyRegExp);\n    if (match) {\n      return true;\n    }\n  }\n  return false;\n};\n"
  },
  {
    "path": "local-cli/link/pods/readPodfile.js",
    "content": "'use strict';\n\nconst fs = require('fs');\n\nmodule.exports = function readPodfile(podfilePath) {\n  const podContent = fs.readFileSync(podfilePath, 'utf8');\n  return podContent.split(/\\r?\\n/g);\n};\n"
  },
  {
    "path": "local-cli/link/pods/registerNativeModule.js",
    "content": "'use strict';\n\nconst readPodfile = require('./readPodfile');\nconst findPodTargetLine = require('./findPodTargetLine');\nconst findLineToAddPod = require('./findLineToAddPod');\nconst findMarkedLinesInPodfile = require('./findMarkedLinesInPodfile');\nconst addPodEntry = require('./addPodEntry');\nconst savePodFile = require('./savePodFile');\n\nmodule.exports = function registerNativeModulePods(dependency, iOSProject) {\n  const podLines = readPodfile(iOSProject.podfile);\n  const linesToAddEntry = getLinesToAddEntry(podLines, iOSProject);\n  addPodEntry(podLines, linesToAddEntry, dependency.config.ios.podspec, dependency.name);\n  savePodFile(iOSProject.podfile, podLines);\n};\n\nfunction getLinesToAddEntry(podLines, { projectName }) {\n  const linesToAddPodWithMarker = findMarkedLinesInPodfile(podLines);\n  if (linesToAddPodWithMarker.length > 0) {\n    return linesToAddPodWithMarker;\n  } else {\n    const firstTargetLined = findPodTargetLine(podLines, projectName);\n    return findLineToAddPod(podLines, firstTargetLined);\n  }\n}\n"
  },
  {
    "path": "local-cli/link/pods/removePodEntry.js",
    "content": "'use strict';\n\nmodule.exports = function removePodEntry(podfileContent, podName) {\n  // this regex should catch line(s) with full pod definition, like: pod 'podname', :path => '../node_modules/podname', :subspecs => ['Sub2', 'Sub1']\n  const podRegex = new RegExp(\"\\\\n( |\\\\t)*pod\\\\s+(\\\"|')\" + podName + \"(\\\"|')(,\\\\s*(:[a-z]+\\\\s*=>)?\\\\s*((\\\"|').*?(\\\"|')|\\\\[[\\\\s\\\\S]*?\\\\]))*\\\\n\", 'g');\n  return podfileContent.replace(podRegex, '\\n');\n};\n"
  },
  {
    "path": "local-cli/link/pods/savePodFile.js",
    "content": "'use strict';\n\nconst fs = require('fs');\n\nmodule.exports = function savePodFile(podfilePath, podLines) {\n  const newPodfile = podLines.join('\\n');\n  fs.writeFileSync(podfilePath, newPodfile);\n};\n"
  },
  {
    "path": "local-cli/link/pods/unregisterNativeModule.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst removePodEntry = require('./removePodEntry');\n\n/**\n * Unregister native module IOS with CocoaPods\n */\nmodule.exports = function unregisterNativeModule(dependencyConfig, iOSProject) {\n\tconst podContent = fs.readFileSync(iOSProject.podfile, 'utf8');\n\tconst removed = removePodEntry(podContent, dependencyConfig.podspec);\n\tfs.writeFileSync(iOSProject.podfile, removed);\n};\n"
  },
  {
    "path": "local-cli/link/pollParams.js",
    "content": "var inquirer = require('inquirer');\n\nmodule.exports = (questions) => new Promise((resolve, reject) => {\n  if (!questions) {\n    return resolve({});\n  }\n\n  inquirer.prompt(questions).then(resolve, reject);\n});\n"
  },
  {
    "path": "local-cli/link/promiseWaterfall.js",
    "content": "/**\n * Given an array of promise creators, executes them in a sequence.\n *\n * If any of the promises in the chain fails, all subsequent promises\n * will be skipped\n *\n * Returns the value last promise from a sequence resolved\n */\nmodule.exports = function promiseWaterfall(tasks) {\n  return tasks.reduce(\n    (prevTaskPromise, task) => prevTaskPromise.then(task),\n    Promise.resolve()\n  );\n};\n"
  },
  {
    "path": "local-cli/link/promisify.js",
    "content": "module.exports = (func) => new Promise((resolve, reject) =>\n  func((err, res) => err ? reject(err) : resolve(res))\n);\n"
  },
  {
    "path": "local-cli/link/unlink.js",
    "content": "const log = require('npmlog');\n\nconst getProjectDependencies = require('./getProjectDependencies');\nconst unregisterDependencyAndroid = require('./android/unregisterNativeModule');\nconst unregisterDependencyWindows = require('./windows/unregisterNativeModule');\nconst unregisterDependencyIOS = require('./ios/unregisterNativeModule');\nconst unregisterDependencyPods = require('./pods/unregisterNativeModule');\nconst isInstalledAndroid = require('./android/isInstalled');\nconst isInstalledWindows = require('./windows/isInstalled');\nconst isInstalledIOS = require('./ios/isInstalled');\nconst isInstalledPods = require('./pods/isInstalled');\nconst unlinkAssetsAndroid = require('./android/unlinkAssets');\nconst unlinkAssetsIOS = require('./ios/unlinkAssets');\nconst getDependencyConfig = require('./getDependencyConfig');\nconst compact = require('lodash').compact;\nconst difference = require('lodash').difference;\nconst filter = require('lodash').filter;\nconst flatten = require('lodash').flatten;\nconst isEmpty = require('lodash').isEmpty;\nconst promiseWaterfall = require('./promiseWaterfall');\nconst commandStub = require('./commandStub');\nconst promisify = require('./promisify');\n\nlog.heading = 'rnpm-link';\n\nconst unlinkDependencyAndroid = (androidProject, dependency, packageName) => {\n  if (!androidProject || !dependency.android) {\n    return;\n  }\n\n  const isInstalled = isInstalledAndroid(androidProject, packageName);\n\n  if (!isInstalled) {\n    log.info(`Android module ${packageName} is not installed`);\n    return;\n  }\n\n  log.info(`Unlinking ${packageName} android dependency`);\n\n  unregisterDependencyAndroid(packageName, dependency.android, androidProject);\n\n  log.info(`Android module ${packageName} has been successfully unlinked`);\n};\n\nconst unlinkDependencyWindows = (windowsProject, dependency, packageName) => {\n  if (!windowsProject || !dependency.windows) {\n    return;\n  }\n\n  const isInstalled = isInstalledWindows(windowsProject, dependency.windows);\n\n  if (!isInstalled) {\n    log.info(`Windows module ${packageName} is not installed`);\n    return;\n  }\n\n  log.info(`Unlinking ${packageName} windows dependency`);\n\n  unregisterDependencyWindows(packageName, dependency.windows, windowsProject);\n\n  log.info(`Windows module ${packageName} has been successfully unlinked`);\n};\n\nconst unlinkDependencyIOS = (iOSProject, dependency, packageName, iOSDependencies) => {\n  if (!iOSProject || !dependency.ios) {\n    return;\n  }\n\n  const isIosInstalled = isInstalledIOS(iOSProject, dependency.ios);\n  const isPodInstalled = isInstalledPods(iOSProject, dependency.ios);\n  if (!isIosInstalled && !isPodInstalled) {\n    log.info(`iOS module ${packageName} is not installed`);\n    return;\n  }\n\n  log.info(`Unlinking ${packageName} ios dependency`);\n\n  if (isIosInstalled) {\n    unregisterDependencyIOS(dependency.ios, iOSProject, iOSDependencies);\n  }\n  else if (isPodInstalled) {\n    unregisterDependencyPods(dependency.ios, iOSProject);\n  }\n\n  log.info(`iOS module ${packageName} has been successfully unlinked`);\n};\n\n/**\n * Updates project and unlink specific dependency\n *\n * If optional argument [packageName] is provided, it's the only one\n * that's checked\n */\nfunction unlink(args, config) {\n  const packageName = args[0];\n\n  var project;\n  var dependency;\n\n  try {\n    project = config.getProjectConfig();\n  } catch (err) {\n    log.error(\n      'ERRPACKAGEJSON',\n      'No package found. Are you sure it\\'s a React Native project?'\n    );\n    return Promise.reject(err);\n  }\n\n  try {\n    dependency = config.getDependencyConfig(packageName);\n  } catch (err) {\n    log.warn(\n      'ERRINVALIDPROJ',\n      `Project ${packageName} is not a react-native library`\n    );\n    return Promise.reject(err);\n  }\n\n  const allDependencies = getDependencyConfig(config, getProjectDependencies());\n  const otherDependencies = filter(allDependencies, d => d.name !== packageName);\n  const iOSDependencies = compact(otherDependencies.map(d => d.config.ios));\n\n  const tasks = [\n    () => promisify(dependency.commands.preunlink || commandStub),\n    () => unlinkDependencyAndroid(project.android, dependency, packageName),\n    () => unlinkDependencyIOS(project.ios, dependency, packageName, iOSDependencies),\n    () => unlinkDependencyWindows(project.windows, dependency, packageName),\n    () => promisify(dependency.commands.postunlink || commandStub)\n  ];\n\n  return promiseWaterfall(tasks)\n    .then(() => {\n      // @todo move all these to `tasks` array, just like in\n      // link\n      const assets = difference(\n        dependency.assets,\n        flatten(allDependencies, d => d.assets)\n      );\n\n      if (isEmpty(assets)) {\n        return Promise.resolve();\n      }\n\n      if (project.ios) {\n        log.info('Unlinking assets from ios project');\n        unlinkAssetsIOS(assets, project.ios);\n      }\n\n      if (project.android) {\n        log.info('Unlinking assets from android project');\n        unlinkAssetsAndroid(assets, project.android.assetsPath);\n      }\n\n      log.info(\n        `${packageName} assets has been successfully unlinked from your project`\n      );\n    })\n    .catch(err => {\n      log.error(\n        `It seems something went wrong while unlinking. Error: ${err.message}`\n      );\n      throw err;\n    });\n}\n\nmodule.exports = {\n  func: unlink,\n  description: 'unlink native dependency',\n  name: 'unlink <packageName>',\n};\n"
  },
  {
    "path": "local-cli/link/windows/isInstalled.js",
    "content": "const fs = require('fs');\nconst makeUsingPatch = require('./patches/makeUsingPatch');\n\nmodule.exports = function isInstalled(config, dependencyConfig) {\n  return fs\n    .readFileSync(config.mainPage)\n    .indexOf(makeUsingPatch(dependencyConfig.packageUsingPath).patch) > -1;\n};\n"
  },
  {
    "path": "local-cli/link/windows/patches/applyParams.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst toCamelCase = require('lodash').camelCase;\n\nmodule.exports = function applyParams(str, params, prefix) {\n  return str.replace(\n    /\\$\\{(\\w+)\\}/g,\n    (pattern, param) => {\n      const name = toCamelCase(prefix) + '_' + param;\n\n      return params[param]\n        ? `getResources().getString(R.string.${name})`\n        : null;\n    }\n  );\n};\n"
  },
  {
    "path": "local-cli/link/windows/patches/applyPatch.js",
    "content": "const fs = require('fs');\n\nmodule.exports = function applyPatch(file, patch, flip = false) {\n\n  fs.writeFileSync(file, fs\n    .readFileSync(file, 'utf8')\n    .replace(patch.pattern, match => {\n      return flip ? `${patch.patch}${match}` : `${match}${patch.patch}`;\n    })\n  );\n};\n"
  },
  {
    "path": "local-cli/link/windows/patches/makePackagePatch.js",
    "content": "const applyParams = require('./applyParams');\n\nmodule.exports = function makePackagePatch(packageInstance, params, prefix) {\n  const processedInstance = applyParams(packageInstance, params, prefix);\n\n  return {\n    pattern: 'new MainReactPackage()',\n    patch: ',\\n                    ' + processedInstance,\n  };\n};\n"
  },
  {
    "path": "local-cli/link/windows/patches/makeProjectPatch.js",
    "content": "module.exports = function makeProjectPatch(windowsConfig) {\n\n  const projectInsert = `<ProjectReference Include=\"..\\\\${windowsConfig.relativeProjPath}\">\n      <Project>{${windowsConfig.pathGUID}}</Project>\n      <Name>${windowsConfig.projectName}</Name>\n    </ProjectReference>\n    `;\n\n  return {\n    pattern: '<ProjectReference Include=\"..\\\\..\\\\node_modules\\\\react-native-windows\\\\ReactWindows\\\\ReactNative\\\\ReactNative.csproj\">',\n    patch: projectInsert,\n    unpatch: new RegExp(`<ProjectReference.+\\\\s+.+\\\\s+.+${windowsConfig.projectName}.+\\\\s+.+\\\\s`),\n  };\n};\n"
  },
  {
    "path": "local-cli/link/windows/patches/makeSolutionPatch.js",
    "content": "module.exports = function makeSolutionPatch(windowsConfig) {\n\n  const solutionInsert = `Project(\"{${windowsConfig.projectGUID.toUpperCase()}}\") = \"${windowsConfig.projectName}\", \"${windowsConfig.relativeProjPath}\", \"{${windowsConfig.pathGUID.toUpperCase()}}\"\nEndProject\n`;\n\n  return {\n    pattern: 'Global',\n    patch: solutionInsert,\n    unpatch: new RegExp(`Project.+${windowsConfig.projectName}.+\\\\s+EndProject\\\\s+`),\n  };\n};\n"
  },
  {
    "path": "local-cli/link/windows/patches/makeUsingPatch.js",
    "content": "module.exports = function makeUsingPatch(packageImportPath) {\n  return {\n    pattern: 'using ReactNative.Modules.Core;',\n    patch: '\\n' + packageImportPath,\n  };\n};\n"
  },
  {
    "path": "local-cli/link/windows/patches/revokePatch.js",
    "content": "const fs = require('fs');\n\nmodule.exports = function revokePatch(file, patch) {\n  const unpatch = patch.unpatch || patch.patch;\n  fs.writeFileSync(file, fs\n    .readFileSync(file, 'utf8')\n    .replace(unpatch, '')\n  );\n};\n"
  },
  {
    "path": "local-cli/link/windows/registerNativeModule.js",
    "content": "const applyPatch = require('./patches/applyPatch');\n\nconst makeProjectPatch = require('./patches/makeProjectPatch');\nconst makeSolutionPatch = require('./patches/makeSolutionPatch');\nconst makeUsingPatch = require('./patches/makeUsingPatch');\nconst makePackagePatch = require('./patches/makePackagePatch');\n\nmodule.exports = function registerNativeWindowsModule(\n  name,\n  windowsConfig,\n  params,\n  projectConfig\n) {\n  applyPatch(projectConfig.projectPath, makeProjectPatch(windowsConfig), true);\n  applyPatch(projectConfig.solutionPath, makeSolutionPatch(windowsConfig), true);\n\n  applyPatch(\n    projectConfig.mainPage,\n    makePackagePatch(windowsConfig.packageInstance, params, name)\n  );\n\n  applyPatch(\n    projectConfig.mainPage,\n    makeUsingPatch(windowsConfig.packageUsingPath)\n  );\n};\n"
  },
  {
    "path": "local-cli/link/windows/unregisterNativeModule.js",
    "content": "const fs = require('fs');\nconst toCamelCase = require('lodash').camelCase;\n\nconst revokePatch = require('./patches/revokePatch');\nconst makeProjectPatch = require('./patches/makeProjectPatch');\nconst makeSolutionPatch = require('./patches/makeSolutionPatch');\nconst makeUsingPatch = require('./patches/makeUsingPatch');\nconst makePackagePatch = require('./patches/makePackagePatch');\n\nmodule.exports = function unregisterNativeWindowsModule(\n  name,\n  windowsConfig,\n  projectConfig\n) {\n  revokePatch(projectConfig.projectPath, makeProjectPatch(windowsConfig));\n  revokePatch(projectConfig.solutionPath, makeSolutionPatch(windowsConfig));\n\n  revokePatch(\n    projectConfig.mainPage,\n    makePackagePatch(windowsConfig.packageInstance, {}, name)\n  );\n\n  revokePatch(\n    projectConfig.mainPage,\n    makeUsingPatch(windowsConfig.packageUsingPath)\n  );\n};\n"
  },
  {
    "path": "local-cli/logAndroid/logAndroid.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst chalk = require('chalk');\nconst child_process = require('child_process');\n\n/**\n * Starts adb logcat\n */\nfunction logAndroid() {\n  return new Promise((resolve, reject) => {\n    _logAndroid(resolve, reject);\n  });\n}\n\nfunction _logAndroid() {\n  try {\n    const adbPath = process.env.ANDROID_HOME\n      ? process.env.ANDROID_HOME + '/platform-tools/adb'\n      : 'adb';\n\n    const adbArgs = ['logcat', '*:S', 'ReactNative:V', 'ReactNativeJS:V'];\n\n    console.log(chalk.bold(\n      `Starting the logger (${adbPath} ${adbArgs.join(' ')})...`\n    ));\n\n    const log = child_process.spawnSync(adbPath, adbArgs, {stdio: 'inherit'});\n\n    if (log.error !== null) {\n      throw log.error;\n    }\n\n  } catch (e) {\n    console.log(chalk.red(\n      'adb invocation failed. Do you have adb in your PATH?'\n    ));\n    return Promise.reject();\n  }\n}\n\nmodule.exports = {\n  name: 'log-android',\n  description: 'starts adb logcat',\n  func: logAndroid,\n};\n"
  },
  {
    "path": "local-cli/logIOS/logIOS.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst chalk = require('chalk');\nconst child_process = require('child_process');\nconst os = require('os');\nconst path = require('path');\n\n/**\n * Starts iOS device syslog tail\n */\nfunction logIOS() {\n  return new Promise((resolve, reject) => {\n    _logIOS(resolve, reject);\n  });\n}\n\nfunction _logIOS() {\n  let rawDevices;\n\n  try {\n    rawDevices = child_process.execFileSync(\n      'xcrun', ['simctl', 'list', 'devices', '--json'], {encoding: 'utf8'}\n    );\n  } catch (e) {\n    console.log(chalk.red(\n      'xcrun invocation failed. Please check that Xcode is installed.'\n    ));\n    return Promise.reject(e);\n  }\n\n  const { devices } = JSON.parse(rawDevices);\n\n  const device = _findAvailableDevice(devices);\n  if (device === undefined) {\n    console.log(chalk.red(\n      'No active iOS device found'\n    ));\n    return Promise.reject();\n  }\n\n  return tailDeviceLogs(device.udid);\n}\n\nfunction _findAvailableDevice(devices) {\n  for (const key of Object.keys(devices)) {\n    for (const device of devices[key]) {\n      if (device.availability === '(available)' && device.state === 'Booted') {\n        return device;\n      }\n    }\n  }\n}\n\nfunction tailDeviceLogs(udid) {\n  const logDir = path.join(\n    os.homedir(),\n    'Library',\n    'Logs',\n    'CoreSimulator',\n    udid,\n    'asl',\n  );\n\n  const log =\n    child_process.spawnSync('syslog', ['-w', '-F', 'std', '-d', logDir], {stdio: 'inherit'});\n\n  if (log.error !== null) {\n    console.log(chalk.red(\n      'syslog invocation failed.'\n    ));\n    return Promise.reject(log.error);\n  }\n}\n\nmodule.exports = {\n  name: 'log-ios',\n  description: 'starts iOS device syslog tail',\n  func: logIOS,\n};\n"
  },
  {
    "path": "local-cli/platform.js",
    "content": "let config = {};\nObject.assign(config, require('./core/macos'));\n\nmodule.exports = { macos: config };"
  },
  {
    "path": "local-cli/runAndroid/adb.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\nconst child_process = require('child_process');\n\n/**\n * Parses the output of the 'adb devices' command\n */\nfunction parseDevicesResult(result: string): Array<string> {\n  if (!result) {\n    return [];\n  }\n\n  const devices = [];\n  const lines = result.trim().split(/\\r?\\n/);\n\n  for (let i = 0; i < lines.length; i++) {\n    let words = lines[i].split(/[ ,\\t]+/).filter((w) => w !== '');\n\n    if (words[1] === 'device') {\n      devices.push(words[0]);\n    }\n  }\n  return devices;\n}\n\n/**\n * Executes the commands needed to get a list of devices from ADB\n */\nfunction getDevices(): Array<string> {\n  try {\n    const devicesResult = child_process.execSync('adb devices');\n    return parseDevicesResult(devicesResult.toString());\n  } catch (e) {\n    return [];\n  }\n\n\n}\n\nmodule.exports = {\n  parseDevicesResult: parseDevicesResult,\n  getDevices: getDevices\n};\n"
  },
  {
    "path": "local-cli/runAndroid/runAndroid.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst adb = require('./adb');\nconst chalk = require('chalk');\nconst child_process = require('child_process');\nconst fs = require('fs');\nconst isPackagerRunning = require('../util/isPackagerRunning');\nconst findReactNativeScripts = require('../util/findReactNativeScripts');\nconst isString = require('lodash/isString');\nconst path = require('path');\nconst Promise = require('promise');\n\n// Verifies this is an Android project\nfunction checkAndroid(root) {\n  return fs.existsSync(path.join(root, 'android/gradlew'));\n}\n\n/**\n * Starts the app on a connected Android emulator or device.\n */\nfunction runAndroid(argv, config, args) {\n  if (!checkAndroid(args.root)) {\n    const reactNativeScriptsPath = findReactNativeScripts();\n    if (reactNativeScriptsPath) {\n      child_process.spawnSync(\n        reactNativeScriptsPath,\n        ['android'].concat(process.argv.slice(1)),\n        {stdio: 'inherit'}\n      );\n    } else {\n      console.log(chalk.red('Android project not found. Maybe run react-native android first?'));\n    }\n    return;\n  }\n\n  if (!args.packager) {\n    return buildAndRun(args);\n  }\n\n  return isPackagerRunning(args.port).then(result => {\n    if (result === 'running') {\n      console.log(chalk.bold('JS server already running.'));\n    } else if (result === 'unrecognized') {\n      console.warn(chalk.yellow('JS server not recognized, continuing with build...'));\n    } else {\n      // result == 'not_running'\n      console.log(chalk.bold('Starting JS server...'));\n      startServerInNewWindow(args.port);\n    }\n    return buildAndRun(args);\n  });\n}\n\nfunction getAdbPath() {\n  return process.env.ANDROID_HOME\n    ? process.env.ANDROID_HOME + '/platform-tools/adb'\n    : 'adb';\n}\n\n// Runs ADB reverse tcp:8081 tcp:8081 to allow loading the jsbundle from the packager\nfunction tryRunAdbReverse(packagerPort, device) {\n  try {\n    const adbPath = getAdbPath();\n    const adbArgs = ['reverse', `tcp:${packagerPort}`, `tcp:${packagerPort}`];\n\n    // If a device is specified then tell adb to use it\n    if (device) {\n      adbArgs.unshift('-s', device);\n    }\n\n    console.log(chalk.bold(\n      `Running ${adbPath} ${adbArgs.join(' ')}`\n    ));\n\n    child_process.execFileSync(adbPath, adbArgs, {\n      stdio: [process.stdin, process.stdout, process.stderr],\n    });\n  } catch (e) {\n    console.log(chalk.yellow(`Could not run adb reverse: ${e.message}`));\n  }\n}\n\nfunction getPackageNameWithSuffix(appId, appIdSuffix, packageName) {\n  if (appId) {\n    return appId;\n  } else if (appIdSuffix) {\n    return packageName + '.' + appIdSuffix;\n  }\n\n  return packageName;\n}\n\n// Builds the app and runs it on a connected emulator / device.\nfunction buildAndRun(args) {\n  process.chdir(path.join(args.root, 'android'));\n  const cmd = process.platform.startsWith('win')\n    ? 'gradlew.bat'\n    : './gradlew';\n\n  const packageName = fs.readFileSync(\n      `${args.appFolder}/src/main/AndroidManifest.xml`,\n      'utf8'\n    ).match(/package=\"(.+?)\"/)[1];\n\n  const packageNameWithSuffix = getPackageNameWithSuffix(args.appId, args.appIdSuffix, packageName);\n\n  const adbPath = getAdbPath();\n  if (args.deviceId) {\n    if (isString(args.deviceId)) {\n        runOnSpecificDevice(args, cmd, packageNameWithSuffix, packageName, adbPath);\n    } else {\n      console.log(chalk.red('Argument missing for parameter --deviceId'));\n    }\n  } else {\n    runOnAllDevices(args, cmd, packageNameWithSuffix, packageName, adbPath);\n  }\n}\n\nfunction runOnSpecificDevice(args, gradlew, packageNameWithSuffix, packageName, adbPath) {\n  let devices = adb.getDevices();\n  if (devices && devices.length > 0) {\n    if (devices.indexOf(args.deviceId) !== -1) {\n      buildApk(gradlew);\n      installAndLaunchOnDevice(args, args.deviceId, packageNameWithSuffix, packageName, adbPath);\n    } else {\n      console.log('Could not find device with the id: \"' + args.deviceId + '\".');\n      console.log('Choose one of the following:');\n      console.log(devices);\n    }\n  } else {\n    console.log('No Android devices connected.');\n  }\n}\n\nfunction buildApk(gradlew) {\n  try {\n    console.log(chalk.bold('Building the app...'));\n\n    // using '-x lint' in order to ignore linting errors while building the apk\n    child_process.execFileSync(gradlew, ['build', '-x', 'lint'], {\n      stdio: [process.stdin, process.stdout, process.stderr],\n    });\n  } catch (e) {\n    console.log(chalk.red('Could not build the app, read the error above for details.\\n'));\n  }\n}\n\nfunction tryInstallAppOnDevice(args, device) {\n  try {\n    const pathToApk = `${args.appFolder}/build/outputs/apk/${args.appFolder}-debug.apk`;\n    const adbPath = getAdbPath();\n    const adbArgs = ['-s', device, 'install', pathToApk];\n    console.log(chalk.bold(\n      `Installing the app on the device (cd android && adb -s ${device} install ${pathToApk}`\n    ));\n    child_process.execFileSync(adbPath, adbArgs, {\n      stdio: [process.stdin, process.stdout, process.stderr],\n    });\n  } catch (e) {\n    console.log(e.message);\n    console.log(chalk.red(\n      'Could not install the app on the device, read the error above for details.\\n'\n    ));\n  }\n}\n\nfunction tryLaunchAppOnDevice(device, packageNameWithSuffix, packageName, adbPath, mainActivity) {\n  try {\n    const adbArgs = ['-s', device, 'shell', 'am', 'start', '-n', packageNameWithSuffix + '/' + packageName + '.' + mainActivity];\n    console.log(chalk.bold(\n      `Starting the app on ${device} (${adbPath} ${adbArgs.join(' ')})...`\n    ));\n    child_process.spawnSync(adbPath, adbArgs, {stdio: 'inherit'});\n  } catch (e) {\n    console.log(chalk.red(\n      'adb invocation failed. Do you have adb in your PATH?'\n    ));\n  }\n}\n\nfunction installAndLaunchOnDevice(args, selectedDevice, packageNameWithSuffix, packageName, adbPath) {\n  tryRunAdbReverse(args.port, selectedDevice);\n  tryInstallAppOnDevice(args, selectedDevice);\n  tryLaunchAppOnDevice(selectedDevice, packageNameWithSuffix, packageName, adbPath, args.mainActivity);\n}\n\nfunction runOnAllDevices(args, cmd, packageNameWithSuffix, packageName, adbPath){\n  try {\n    const gradleArgs = [];\n    if (args.variant) {\n      gradleArgs.push('install' +\n        args.variant[0].toUpperCase() + args.variant.slice(1)\n      );\n    } else if (args.flavor) {\n      console.warn(chalk.yellow(\n        '--flavor has been deprecated. Use --variant instead'\n      ));\n      gradleArgs.push('install' +\n        args.flavor[0].toUpperCase() + args.flavor.slice(1)\n      );\n    } else {\n      gradleArgs.push('installDebug');\n    }\n\n    if (args.installDebug) {\n      gradleArgs.push(args.installDebug);\n    }\n\n    console.log(chalk.bold(\n      `Building and installing the app on the device (cd android && ${cmd} ${gradleArgs.join(' ')})...`\n    ));\n\n    child_process.execFileSync(cmd, gradleArgs, {\n      stdio: [process.stdin, process.stdout, process.stderr],\n    });\n  } catch (e) {\n    console.log(chalk.red(\n      'Could not install the app on the device, read the error above for details.\\n' +\n      'Make sure you have an Android emulator running or a device connected and have\\n' +\n      'set up your Android development environment:\\n' +\n      'https://facebook.github.io/react-native/docs/getting-started.html'\n    ));\n    // stderr is automatically piped from the gradle process, so the user\n    // should see the error already, there is no need to do\n    // `console.log(e.stderr)`\n    return Promise.reject();\n  }\n    const devices = adb.getDevices();\n    if (devices && devices.length > 0) {\n      devices.forEach((device) => {\n        tryRunAdbReverse(args.port, device);\n        tryLaunchAppOnDevice(device, packageNameWithSuffix, packageName, adbPath, args.mainActivity);\n      });\n    } else {\n      try {\n        // If we cannot execute based on adb devices output, fall back to\n        // shell am start\n        const fallbackAdbArgs = [\n          'shell', 'am', 'start', '-n', packageNameWithSuffix + '/' + packageName + '.MainActivity'\n        ];\n        console.log(chalk.bold(\n          `Starting the app (${adbPath} ${fallbackAdbArgs.join(' ')}...`\n        ));\n        child_process.spawnSync(adbPath, fallbackAdbArgs, {stdio: 'inherit'});\n      } catch (e) {\n        console.log(chalk.red(\n          'adb invocation failed. Do you have adb in your PATH?'\n        ));\n        // stderr is automatically piped from the gradle process, so the user\n        // should see the error already, there is no need to do\n        // `console.log(e.stderr)`\n        return Promise.reject();\n      }\n    }\n}\n\nfunction startServerInNewWindow(port) {\n  const scriptFile = /^win/.test(process.platform) ?\n    'launchPackager.bat' :\n    'launchPackager.command';\n  const scriptsDir = path.resolve(__dirname, '..', '..', 'scripts');\n  const launchPackagerScript = path.resolve(scriptsDir, scriptFile);\n  const procConfig = {cwd: scriptsDir};\n  const terminal = process.env.REACT_TERMINAL;\n\n  // setup the .packager.env file to ensure the packager starts on the right port\n  const packagerEnvFile = path.join(__dirname, '..', '..', 'scripts', '.packager.env');\n  const content = `export RCT_METRO_PORT=${port}`;\n  // ensure we overwrite file by passing the 'w' flag\n  fs.writeFileSync(packagerEnvFile, content, {encoding: 'utf8', flag: 'w'});\n\n  if (process.platform === 'darwin') {\n    if (terminal) {\n      return child_process.spawnSync('open', ['-a', terminal, launchPackagerScript], procConfig);\n    }\n    return child_process.spawnSync('open', [launchPackagerScript], procConfig);\n\n  } else if (process.platform === 'linux') {\n    procConfig.detached = true;\n    if (terminal){\n      return child_process.spawn(terminal, ['-e', 'sh ' + launchPackagerScript], procConfig);\n    }\n    return child_process.spawn('sh', [launchPackagerScript], procConfig);\n\n  } else if (/^win/.test(process.platform)) {\n    procConfig.detached = true;\n    procConfig.stdio = 'ignore';\n    return child_process.spawn('cmd.exe', ['/C', launchPackagerScript], procConfig);\n  } else {\n    console.log(chalk.red(`Cannot start the packager. Unknown platform ${process.platform}`));\n  }\n}\n\nmodule.exports = {\n  name: 'run-android',\n  description: 'builds your app and starts it on a connected Android emulator or device',\n  func: runAndroid,\n  options: [{\n    command: '--install-debug',\n  }, {\n    command: '--root [string]',\n    description: 'Override the root directory for the android build (which contains the android directory)',\n    default: '',\n  }, {\n    command: '--flavor [string]',\n    description: '--flavor has been deprecated. Use --variant instead',\n  }, {\n    command: '--variant [string]',\n  }, {\n    command: '--appFolder [string]',\n    description: 'Specify a different application folder name for the android source.',\n    default: 'app',\n  }, {\n    command: '--appId [string]',\n    description: 'Specify an applicationId to launch after build.',\n    default: '',\n  }, {\n    command: '--appIdSuffix [string]',\n    description: 'Specify an applicationIdSuffix to launch after build.',\n    default: '',\n  }, {\n    command: '--main-activity [string]',\n    description: 'Name of the activity to start',\n    default: 'MainActivity',\n  }, {\n    command: '--deviceId [string]',\n    description: 'builds your app and starts it on a specific device/simulator with the ' +\n      'given device id (listed by running \"adb devices\" on the command line).',\n  }, {\n    command: '--no-packager',\n    description: 'Do not launch packager while building',\n  }, {\n    command: '--port [number]',\n    default: process.env.RCT_METRO_PORT || 8081,\n    parse: (val: string) => Number(val),\n  }],\n};\n"
  },
  {
    "path": "local-cli/runIOS/__tests__/findMatchingSimulator-test.js",
    "content": "/**\n * /**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n */\n'use strict';\n\njest.dontMock('../findMatchingSimulator');\n\nconst findMatchingSimulator = require('../findMatchingSimulator');\n\ndescribe('findMatchingSimulator', () => {\n  it('should find simulator', () => {\n    expect(findMatchingSimulator({\n        'devices': {\n          'iOS 9.2': [\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 4s',\n              'udid': 'B9B5E161-416B-43C4-A78F-729CB96CC8C6'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 5',\n              'udid': '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6',\n              'udid': 'BA0D93BD-07E6-4182-9B0A-F60A2474139C'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6 (Plus)',\n              'udid': '9564ABEE-9EC2-4B4A-B443-D3710929A45A'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6s',\n              'udid': 'D0F29BE7-CC3C-4976-888D-C739B4F50508'\n            }\n          ]\n        }\n      },\n      'iPhone 6'\n    )).toEqual({\n      udid: 'BA0D93BD-07E6-4182-9B0A-F60A2474139C',\n      name: 'iPhone 6',\n      version: 'iOS 9.2'\n    });\n  });\n\n  it('should return null if no simulators available', () => {\n    expect(findMatchingSimulator({\n        'devices': {\n          'iOS 9.2': [\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 4s',\n              'udid': 'B9B5E161-416B-43C4-A78F-729CB96CC8C6'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 5',\n              'udid': '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 6',\n              'udid': 'BA0D93BD-07E6-4182-9B0A-F60A2474139C'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 6 (Plus)',\n              'udid': '9564ABEE-9EC2-4B4A-B443-D3710929A45A'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 6s',\n              'udid': 'D0F29BE7-CC3C-4976-888D-C739B4F50508'\n            }\n          ]\n        }\n      },\n      'iPhone 6'\n    )).toEqual(null);\n  });\n\n  it('should return null if an odd input', () => {\n    expect(findMatchingSimulator('random string input', 'iPhone 6')).toEqual(null);\n  });\n\n  it('should return the first simulator in list if none is defined', () => {\n    expect(findMatchingSimulator({\n        'devices': {\n          'iOS 9.2': [\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 4s',\n              'udid': 'B9B5E161-416B-43C4-A78F-729CB96CC8C6'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 5',\n              'udid': '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6',\n              'udid': 'BA0D93BD-07E6-4182-9B0A-F60A2474139C'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6 (Plus)',\n              'udid': '9564ABEE-9EC2-4B4A-B443-D3710929A45A'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 6s',\n              'udid': 'D0F29BE7-CC3C-4976-888D-C739B4F50508'\n            }\n          ]\n        }\n      },\n      null\n    )).toEqual({\n      udid: '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB',\n      name: 'iPhone 5',\n      version: 'iOS 9.2'\n    });\n  });\n\n  it('should return the first simulator in list if none is defined', () => {\n    expect(findMatchingSimulator({\n        'devices': {\n          'iOS 9.2': [\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 4s',\n              'udid': 'B9B5E161-416B-43C4-A78F-729CB96CC8C6'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 5',\n              'udid': '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6',\n              'udid': 'BA0D93BD-07E6-4182-9B0A-F60A2474139C'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6 (Plus)',\n              'udid': '9564ABEE-9EC2-4B4A-B443-D3710929A45A'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 6s',\n              'udid': 'D0F29BE7-CC3C-4976-888D-C739B4F50508'\n            }\n          ],\n          'iOS 10.0': [\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6',\n              'udid': '2FF48AE5-CC3B-4C80-8D25-48966A6BE2C0'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6 (Plus)',\n              'udid': '841E33FE-E8A1-4B65-9FF8-6EAA6442A3FC'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6s',\n              'udid': 'CBBB8FB8-77AB-49A9-8297-4CCFE3189C22'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 7',\n              'udid': '3A409DC5-5188-42A6-8598-3AA6F34607A5'\n            }\n          ]\n        }\n      },\n      null\n    )).toEqual({\n      udid: '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB',\n      name: 'iPhone 5',\n      version: 'iOS 9.2'\n    });\n  });\n\n  it('should return the booted simulator in list if none is defined', () => {\n    expect(findMatchingSimulator({\n        'devices': {\n          'iOS 9.2': [\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 4s',\n              'udid': 'B9B5E161-416B-43C4-A78F-729CB96CC8C6'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 5',\n              'udid': '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6',\n              'udid': 'BA0D93BD-07E6-4182-9B0A-F60A2474139C'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6 (Plus)',\n              'udid': '9564ABEE-9EC2-4B4A-B443-D3710929A45A'\n            },\n            {\n              'state': 'Booted',\n              'availability': '(available)',\n              'name': 'iPhone 6s',\n              'udid': 'D0F29BE7-CC3C-4976-888D-C739B4F50508'\n            }\n          ]\n        }\n      },\n      null\n    )).toEqual({\n      udid: 'D0F29BE7-CC3C-4976-888D-C739B4F50508',\n      name: 'iPhone 6s',\n      version: 'iOS 9.2'\n    });\n  });\n\n  it('should return the booted simulator in list even if another device is defined', () => {\n    expect(findMatchingSimulator({\n        'devices': {\n          'iOS 9.2': [\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 4s',\n              'udid': 'B9B5E161-416B-43C4-A78F-729CB96CC8C6'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 5',\n              'udid': '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6',\n              'udid': 'BA0D93BD-07E6-4182-9B0A-F60A2474139C'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6 (Plus)',\n              'udid': '9564ABEE-9EC2-4B4A-B443-D3710929A45A'\n            },\n            {\n              'state': 'Booted',\n              'availability': '(available)',\n              'name': 'iPhone 6s',\n              'udid': 'D0F29BE7-CC3C-4976-888D-C739B4F50508'\n            }\n          ]\n        }\n      },\n      'iPhone 6'\n    )).toEqual({\n      udid: 'D0F29BE7-CC3C-4976-888D-C739B4F50508',\n      name: 'iPhone 6s',\n      version: 'iOS 9.2'\n    });\n  });\n\n  it('should return the booted simulator in list if none is defined (multi ios versions)', () => {\n    expect(findMatchingSimulator({\n        'devices': {\n          'iOS 9.2': [\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 4s',\n              'udid': 'B9B5E161-416B-43C4-A78F-729CB96CC8C6'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 5',\n              'udid': '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6',\n              'udid': 'BA0D93BD-07E6-4182-9B0A-F60A2474139C'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6 (Plus)',\n              'udid': '9564ABEE-9EC2-4B4A-B443-D3710929A45A'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6s',\n              'udid': 'D0F29BE7-CC3C-4976-888D-C739B4F50508'\n            }\n          ],\n          'iOS 10.0': [\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6',\n              'udid': '2FF48AE5-CC3B-4C80-8D25-48966A6BE2C0'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6 (Plus)',\n              'udid': '841E33FE-E8A1-4B65-9FF8-6EAA6442A3FC'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6s',\n              'udid': 'CBBB8FB8-77AB-49A9-8297-4CCFE3189C22'\n            },\n            {\n              'state': 'Booted',\n              'availability': '(available)',\n              'name': 'iPhone 7',\n              'udid': '3A409DC5-5188-42A6-8598-3AA6F34607A5'\n            }\n          ]\n        }\n      },\n      null\n    )).toEqual({\n      udid: '3A409DC5-5188-42A6-8598-3AA6F34607A5',\n      name: 'iPhone 7',\n      version: 'iOS 10.0'\n    });\n  });\n\n  it('should return the booted simulator in list even if another device is defined (multi ios versions)', () => {\n    expect(findMatchingSimulator({\n        'devices': {\n          'iOS 9.2': [\n            {\n              'state': 'Shutdown',\n              'availability': '(unavailable, runtime profile not found)',\n              'name': 'iPhone 4s',\n              'udid': 'B9B5E161-416B-43C4-A78F-729CB96CC8C6'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 5',\n              'udid': '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6',\n              'udid': 'BA0D93BD-07E6-4182-9B0A-F60A2474139C'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6 (Plus)',\n              'udid': '9564ABEE-9EC2-4B4A-B443-D3710929A45A'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6s',\n              'udid': 'D0F29BE7-CC3C-4976-888D-C739B4F50508'\n            }\n          ],\n          'iOS 10.0': [\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6',\n              'udid': '2FF48AE5-CC3B-4C80-8D25-48966A6BE2C0'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6 (Plus)',\n              'udid': '841E33FE-E8A1-4B65-9FF8-6EAA6442A3FC'\n            },\n            {\n              'state': 'Shutdown',\n              'availability': '(available)',\n              'name': 'iPhone 6s',\n              'udid': 'CBBB8FB8-77AB-49A9-8297-4CCFE3189C22'\n            },\n            {\n              'state': 'Booted',\n              'availability': '(available)',\n              'name': 'iPhone 7',\n              'udid': '3A409DC5-5188-42A6-8598-3AA6F34607A5'\n            }\n          ]\n        }\n      },\n      'iPhone 6s'\n    )).toEqual({\n      udid: '3A409DC5-5188-42A6-8598-3AA6F34607A5',\n      name: 'iPhone 7',\n      version: 'iOS 10.0'\n    });\n  });\n});\n"
  },
  {
    "path": "local-cli/runIOS/__tests__/findXcodeProject-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n */\n'use strict';\n\njest.dontMock('../findXcodeProject');\n\nconst findXcodeProject = require('../findXcodeProject');\n\ndescribe('findXcodeProject', () => {\n  it('should find *.xcodeproj file', () => {\n    expect(findXcodeProject([\n      '.DS_Store',\n      'AwesomeApp',\n      'AwesomeApp.xcodeproj',\n      'AwesomeAppTests',\n      'PodFile',\n      'Podfile.lock',\n      'Pods'\n    ])).toEqual({\n      name: 'AwesomeApp.xcodeproj',\n      isWorkspace: false,\n    });\n  });\n\n  it('should prefer *.xcworkspace', () => {\n    expect(findXcodeProject([\n      '.DS_Store',\n      'AwesomeApp',\n      'AwesomeApp.xcodeproj',\n      'AwesomeApp.xcworkspace',\n      'AwesomeAppTests',\n      'PodFile',\n      'Podfile.lock',\n      'Pods'\n    ])).toEqual({\n      name: 'AwesomeApp.xcworkspace',\n      isWorkspace: true,\n    });\n  });\n\n  it('should return null if nothing found', () => {\n    expect(findXcodeProject([\n      '.DS_Store',\n      'AwesomeApp',\n      'AwesomeAppTests',\n      'PodFile',\n      'Podfile.lock',\n      'Pods'\n    ])).toEqual(null);\n  });\n});\n"
  },
  {
    "path": "local-cli/runIOS/__tests__/parseIOSDevicesList-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @emails oncall+javascript_foundation\n */\n\n'use strict';\n\njest.dontMock('../parseIOSDevicesList');\nvar parseIOSDevicesList = require('../parseIOSDevicesList');\n\ndescribe('parseIOSDevicesList', () => {\n  it('parses typical output', () => {\n    var devices = parseIOSDevicesList([\n      'Known Devices:',\n      'Maxs MacBook Pro [11111111-1111-1111-1111-111111111111]',\n      \"Max's iPhone (9.2) [11111111111111111111aaaaaaaaaaaaaaaaaaaa]\",\n      'iPad 2 (9.3) [07538CE4-675B-4EDA-90F2-3DD3CD93309D] (Simulator)',\n      'iPad Air (9.3) [0745F6D1-6DC5-4427-B9A6-6FBA327ED65A] (Simulator)',\n      'iPhone 6s (9.3) [3DBE4ECF-9A86-469E-921B-EE0F9C9AB8F4] (Simulator)',\n      'Known Templates:',\n      'Activity Monitor',\n      'Blank',\n      'System Usage',\n      'Zombies'\n    ].join('\\n'));\n\n    expect(devices).toEqual([\n      {name: \"Max's iPhone\", udid: '11111111111111111111aaaaaaaaaaaaaaaaaaaa', version: '9.2'},\n    ]);\n  });\n\n  it('ignores garbage', () => {\n    expect(parseIOSDevicesList('Something went terribly wrong (-42)')).toEqual([]);\n  });\n});\n"
  },
  {
    "path": "local-cli/runIOS/findMatchingSimulator.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.*\n */\n'use strict';\n\n/**\n * Takes in a parsed simulator list and a desired name, and returns an object with the matching simulator.\n *\n * If the simulatorName argument is null, we'll go into default mode and return the currently booted simulator, or if\n * none is booted, it will be the first in the list.\n *\n * @param Object simulators a parsed list from `xcrun simctl list --json devices` command\n * @param String|null simulatorName the string with the name of desired simulator. If null, it will use the currently\n *        booted simulator, or if none are booted, the first in the list.\n * @returns {Object} {udid, name, version}\n */\nfunction findMatchingSimulator(simulators, simulatorName) {\n  if (!simulators.devices) {\n    return null;\n  }\n  const devices = simulators.devices;\n  var match;\n  for (let version in devices) {\n    // Making sure the version of the simulator is an iOS (Removes Apple Watch, etc)\n    if (version.indexOf('iOS') !== 0) {\n      continue;\n    }\n    for (let i in devices[version]) {\n      let simulator = devices[version][i];\n      // Skipping non-available simulator\n      if (simulator.availability !== '(available)') {\n        continue;\n      }\n      // If there is a booted simulator, we'll use that as instruments will not boot a second simulator\n      if (simulator.state === 'Booted') {\n        if (simulatorName !== null) {\n          console.warn(\"We couldn't boot your defined simulator due to an already booted simulator. We are limited to one simulator launched at a time.\");\n        }\n        return {\n          udid: simulator.udid,\n          name: simulator.name,\n          version\n        };\n      }\n      if (simulator.name === simulatorName && !match) {\n        match = {\n          udid: simulator.udid,\n          name: simulator.name,\n          version\n        };\n      }\n      // Keeps track of the first available simulator for use if we can't find one above.\n      if (simulatorName === null && !match) {\n        match = {\n          udid: simulator.udid,\n          name: simulator.name,\n          version\n        };\n      }\n    }\n  }\n  if (match) {\n    return match;\n  }\n  return null;\n}\n\nmodule.exports = findMatchingSimulator;\n"
  },
  {
    "path": "local-cli/runIOS/findXcodeProject.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\nconst path = require('path');\n\ntype ProjectInfo = {\n  name: string;\n  isWorkspace: boolean;\n}\n\nfunction findXcodeProject(files: Array<string>): ?ProjectInfo {\n  const sortedFiles = files.sort();\n  for (let i = sortedFiles.length - 1; i >= 0; i--) {\n    const fileName = files[i];\n    const ext = path.extname(fileName);\n\n    if (ext === '.xcworkspace') {\n      return {\n        name: fileName,\n        isWorkspace: true,\n      };\n    }\n    if (ext === '.xcodeproj') {\n      return {\n        name: fileName,\n        isWorkspace: false,\n      };\n    }\n  }\n\n  return null;\n}\n\nmodule.exports = findXcodeProject;\n"
  },
  {
    "path": "local-cli/runIOS/parseIOSDevicesList.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\ntype IOSDeviceInfo = {\n  name: string;\n  udid: string;\n  version: string;\n}\n\n/**\n * Parses the output of `xcrun simctl list devices` command\n */\nfunction parseIOSDevicesList(text: string): Array<IOSDeviceInfo> {\n  const devices = [];\n  text.split('\\n').forEach((line) => {\n    const device = line.match(/(.*?) \\((.*?)\\) \\[(.*?)\\]/);\n    const noSimulator = line.match(/(.*?) \\((.*?)\\) \\[(.*?)\\] \\((.*?)\\)/);\n    if (device != null && noSimulator == null){\n      var name = device[1];\n      var version = device[2];\n      var udid = device[3];\n      devices.push({udid, name, version});\n    }\n  });\n\n  return devices;\n}\n\nmodule.exports = parseIOSDevicesList;\n"
  },
  {
    "path": "local-cli/runIOS/runIOS.js",
    "content": "/**\n* Copyright (c) 2015-present, Facebook, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the BSD-style license found in the\n* LICENSE file in the root directory of this source tree. An additional grant\n* of patent rights can be found in the PATENTS file in the same directory.\n*/\n'use strict';\n\nconst child_process = require('child_process');\nconst fs = require('fs');\nconst path = require('path');\nconst findXcodeProject = require('./findXcodeProject');\nconst findReactNativeScripts = require('../util/findReactNativeScripts');\nconst parseIOSDevicesList = require('./parseIOSDevicesList');\nconst findMatchingSimulator = require('./findMatchingSimulator');\nconst getBuildPath = function(configuration = 'Debug', appName, isDevice) {\n  return `build/Build/Products/${configuration}-${isDevice ? 'iphoneos' : 'iphonesimulator'}/${appName}.app`;\n};\nconst xcprettyAvailable = function() {\n  try {\n    child_process.execSync('xcpretty --version', {\n      stdio: [ 0, 'pipe', 'ignore', ]\n    });\n  } catch (error) {\n    return false;\n  }\n  return true;\n};\n\nfunction runIOS(argv, config, args) {\n  if (!fs.existsSync(args.projectPath)) {\n    const reactNativeScriptsPath = findReactNativeScripts();\n    if (reactNativeScriptsPath) {\n      child_process.spawnSync(\n        reactNativeScriptsPath,\n        ['ios'].concat(process.argv.slice(1)),\n        {stdio: 'inherit'}\n      );\n      return;\n    } else {\n      throw new Error('iOS project folder not found. Are you sure this is a React Native project?');\n    }\n  }\n  process.chdir(args.projectPath);\n  const xcodeProject = findXcodeProject(fs.readdirSync('.'));\n  if (!xcodeProject) {\n    throw new Error('Could not find Xcode project files in ios folder');\n  }\n\n  const inferredSchemeName = path.basename(xcodeProject.name, path.extname(xcodeProject.name));\n  const scheme = args.scheme || inferredSchemeName;\n  console.log(`Found Xcode ${xcodeProject.isWorkspace ? 'workspace' : 'project'} ${xcodeProject.name}`);\n  const devices = parseIOSDevicesList(\n    child_process.execFileSync('xcrun', ['instruments', '-s'], {encoding: 'utf8'})\n  );\n  if (args.device) {\n    const selectedDevice = matchingDevice(devices, args.device);\n    if (selectedDevice) {\n      return runOnDevice(selectedDevice, scheme, xcodeProject, args.configuration, args.packager, args.verbose);\n    } else {\n      if (devices && devices.length > 0) {\n        console.log('Could not find device with the name: \"' + args.device + '\".');\n        console.log('Choose one of the following:');\n        printFoundDevices(devices);\n      } else {\n        console.log('No iOS devices connected.');\n      }\n    }\n  } else if (args.udid) {\n    return runOnDeviceByUdid(args, scheme, xcodeProject, devices);\n  } else {\n    return runOnSimulator(xcodeProject, args, scheme);\n  }\n}\n\nfunction runOnDeviceByUdid(args, scheme, xcodeProject, devices) {\n  const selectedDevice = matchingDeviceByUdid(devices, args.udid);\n  if (selectedDevice) {\n    return runOnDevice(selectedDevice, scheme, xcodeProject, args.configuration, args.packager, args.verbose, args.port);\n  } else {\n    if (devices && devices.length > 0) {\n      console.log('Could not find device with the udid: \"' + args.udid + '\".');\n      console.log('Choose one of the following:');\n      printFoundDevices(devices);\n    } else {\n      console.log('No iOS devices connected.');\n    }\n  }\n}\n\nfunction runOnSimulator(xcodeProject, args, scheme) {\n  return new Promise((resolve) => {\n    try {\n      var simulators = JSON.parse(\n      child_process.execFileSync('xcrun', ['simctl', 'list', '--json', 'devices'], {encoding: 'utf8'})\n      );\n    } catch (e) {\n      throw new Error('Could not parse the simulator list output');\n    }\n\n    const selectedSimulator = findMatchingSimulator(simulators, args.simulator);\n    if (!selectedSimulator) {\n      throw new Error(`Could not find ${args.simulator} simulator`);\n    }\n\n    const simulatorFullName = formattedDeviceName(selectedSimulator);\n    console.log(`Launching ${simulatorFullName}...`);\n    try {\n      child_process.spawnSync('xcrun', ['instruments', '-w', selectedSimulator.udid]);\n    } catch (e) {\n      // instruments always fail with 255 because it expects more arguments,\n      // but we want it to only launch the simulator\n    }\n    resolve(selectedSimulator.udid);\n  })\n  .then((udid) => buildProject(xcodeProject, udid, scheme, args.configuration, args.packager, args.verbose, args.port))\n  .then((appName) => {\n    if (!appName) {\n      appName = scheme;\n    }\n    let appPath = getBuildPath(args.configuration, appName);\n    console.log(`Installing ${appPath}`);\n    child_process.spawnSync('xcrun', ['simctl', 'install', 'booted', appPath], {stdio: 'inherit'});\n\n    const bundleID = child_process.execFileSync(\n      '/usr/libexec/PlistBuddy',\n      ['-c', 'Print:CFBundleIdentifier', path.join(appPath, 'Info.plist')],\n      {encoding: 'utf8'}\n    ).trim();\n\n    console.log(`Launching ${bundleID}`);\n    child_process.spawnSync('xcrun', ['simctl', 'launch', 'booted', bundleID], {stdio: 'inherit'});\n  });\n}\n\nfunction runOnDevice(selectedDevice, scheme, xcodeProject, configuration, launchPackager, verbose, port) {\n  return buildProject(xcodeProject, selectedDevice.udid, scheme, configuration, launchPackager, verbose, port)\n  .then((appName) => {\n    if (!appName) {\n      appName = scheme;\n    }\n    const iosDeployInstallArgs = [\n      '--bundle', getBuildPath(configuration, appName, true),\n      '--id' , selectedDevice.udid,\n      '--justlaunch'\n    ];\n    console.log(`installing and launching your app on ${selectedDevice.name}...`);\n    const iosDeployOutput = child_process.spawnSync('ios-deploy', iosDeployInstallArgs, {encoding: 'utf8'});\n    if (iosDeployOutput.error) {\n      console.log('');\n      console.log('** INSTALLATION FAILED **');\n      console.log('Make sure you have ios-deploy installed globally.');\n      console.log('(e.g \"npm install -g ios-deploy\")');\n    } else {\n      console.log('** INSTALLATION SUCCEEDED **');\n    }\n  });\n}\n\nfunction buildProject(xcodeProject, udid, scheme, configuration = 'Debug', launchPackager = false, verbose, port) {\n  return new Promise((resolve,reject) =>\n  {\n     var xcodebuildArgs = [\n      xcodeProject.isWorkspace ? '-workspace' : '-project', xcodeProject.name,\n      '-configuration', configuration,\n      '-scheme', scheme,\n      '-destination', `id=${udid}`,\n      '-derivedDataPath', 'build',\n    ];\n    console.log(`Building using \"xcodebuild ${xcodebuildArgs.join(' ')}\"`);\n    let xcpretty;\n    if (!verbose) {\n      xcpretty = xcprettyAvailable() && child_process.spawn('xcpretty', [], { stdio: ['pipe', process.stdout, process.stderr] });\n    }\n    const buildProcess = child_process.spawn('xcodebuild', xcodebuildArgs, getProcessOptions(launchPackager, port));\n    let buildOutput = '';\n    buildProcess.stdout.on('data', function(data) {\n      buildOutput += data.toString();\n      if (xcpretty) {\n        xcpretty.stdin.write(data);\n      } else {\n        console.log(data.toString());\n      }\n    });\n    buildProcess.stderr.on('data', function(data) {\n      console.error(data.toString());\n    });\n    buildProcess.on('close', function(code) {\n      if (xcpretty) {\n        xcpretty.stdin.end();\n      }\n      //FULL_PRODUCT_NAME is the actual file name of the app, which actually comes from the Product Name in the build config, which does not necessary match a scheme name,  example output line: export FULL_PRODUCT_NAME=\"Super App Dev.app\"\n      let productNameMatch = /export FULL_PRODUCT_NAME=\"?(.+).app\"?$/m.exec(buildOutput);\n      if (productNameMatch && productNameMatch.length && productNameMatch.length > 1) {\n        return resolve(productNameMatch[1]);//0 is the full match, 1 is the app name\n      }\n      return buildProcess.error ? reject(buildProcess.error) : resolve();\n    });\n  });\n}\n\nfunction matchingDevice(devices, deviceName) {\n  if (deviceName === true && devices.length === 1)\n  {\n    console.log(`Using first available device ${devices[0].name} due to lack of name supplied.`);\n    return devices[0];\n  }\n  for (let i = devices.length - 1; i >= 0; i--) {\n    if (devices[i].name === deviceName || formattedDeviceName(devices[i]) === deviceName) {\n      return devices[i];\n    }\n  }\n}\n\nfunction matchingDeviceByUdid(devices, udid) {\n  for (let i = devices.length - 1; i >= 0; i--) {\n    if (devices[i].udid === udid) {\n      return devices[i];\n    }\n  }\n}\n\nfunction formattedDeviceName(simulator) {\n  return `${simulator.name} (${simulator.version})`;\n}\n\nfunction printFoundDevices(devices) {\n  for (let i = devices.length - 1; i >= 0; i--) {\n    console.log(devices[i].name + ' Udid: ' + devices[i].udid);\n  }\n}\n\nfunction getProcessOptions(launchPackager, port) {\n  if (launchPackager) {\n    return {\n      env: { ...process.env, RCT_METRO_PORT: port }\n    };\n  }\n\n  return {\n    env: { ...process.env, RCT_NO_LAUNCH_PACKAGER: true },\n  };\n}\n\nmodule.exports = {\n  name: 'run-ios',\n  description: 'builds your app and starts it on iOS simulator',\n  func: runIOS,\n  examples: [\n  {\n    desc: 'Run on a different simulator, e.g. iPhone 5',\n    cmd: 'react-native run-ios --simulator \"iPhone 5\"',\n  },\n  {\n    desc: 'Pass a non-standard location of iOS directory',\n    cmd: 'react-native run-ios --project-path \"./app/ios\"',\n  },\n  {\n    desc: \"Run on a connected device, e.g. Max's iPhone\",\n    cmd: 'react-native run-ios --device \"Max\\'s iPhone\"',\n  },\n  ],\n  options: [{\n    command: '--simulator [string]',\n    description: 'Explicitly set simulator to use',\n    default: 'iPhone 6',\n  } , {\n    command: '--configuration [string]',\n    description: 'Explicitly set the scheme configuration to use',\n  } , {\n    command: '--scheme [string]',\n    description: 'Explicitly set Xcode scheme to use',\n  }, {\n    command: '--project-path [string]',\n    description: 'Path relative to project root where the Xcode project '\n      + '(.xcodeproj) lives. The default is \\'ios\\'.',\n    default: 'ios',\n  }, {\n    command: '--device [string]',\n    description: 'Explicitly set device to use by name.  The value is not required if you have a single device connected.',\n  }, {\n    command: '--udid [string]',\n    description: 'Explicitly set device to use by udid',\n  }, {\n    command: '--no-packager',\n    description: 'Do not launch packager while building',\n  }, {\n    command: '--verbose',\n    description: 'Do not use xcpretty even if installed',\n  },{\n    command: '--port [number]',\n    default: process.env.RCT_METRO_PORT || 8081,\n    parse: (val: string) => Number(val),\n  }],\n};\n"
  },
  {
    "path": "local-cli/runMacOS/findXcodeProject.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\nconst path = require('path');\n\nfunction findXcodeProject(files) {\n  const sortedFiles = files.sort();\n  for (let i = sortedFiles.length - 1; i >= 0; i--) {\n    const fileName = files[i];\n    const ext = path.extname(fileName);\n\n    if (ext === '.xcworkspace') {\n      return {\n        name: fileName,\n        isWorkspace: true,\n      };\n    }\n    if (ext === '.xcodeproj') {\n      return {\n        name: fileName,\n        isWorkspace: false,\n      };\n    }\n  }\n\n  return null;\n}\n\nmodule.exports = findXcodeProject;\n"
  },
  {
    "path": "local-cli/runMacOS/runMacOS.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst child_process = require('child_process');\nconst fs = require('fs');\nconst path = require('path');\nconst findXcodeProject = require('./findXcodeProject');\n\nfunction runMacOS(argv, config, args) {\n  process.chdir(args.projectPath);\n  const xcodeProject = findXcodeProject(fs.readdirSync('.'));\n  if (!xcodeProject) {\n    throw new Error('Could not find Xcode project files in macos folder');\n  }\n\n  const inferredSchemeName = path.basename(xcodeProject.name, path.extname(xcodeProject.name));\n  const scheme = args.scheme || inferredSchemeName;\n  console.log(`Found Xcode ${xcodeProject.isWorkspace ? 'workspace' : 'project'} ${xcodeProject.name}`);\n\n  const xcodebuildArgs = [\n    xcodeProject.isWorkspace ? '-workspace' : '-project', xcodeProject.name,\n    '-scheme', scheme,\n    '-derivedDataPath', 'build',\n  ];\n  console.log(`Building using \"xcodebuild ${xcodebuildArgs.join(' ')}\"`);\n  child_process.spawnSync('xcodebuild', xcodebuildArgs, {stdio: 'inherit'});\n\n  const appPath = `build/Build/Products/Debug/${inferredSchemeName}.app`;\n  console.log(`Launching ${appPath}`);\n  child_process.spawnSync('open', [appPath], {stdio: 'inherit'});\n\n  const bundleID = child_process.execFileSync(\n    '/usr/libexec/PlistBuddy',\n    ['-c', 'Print:CFBundleIdentifier', path.join(appPath, 'Contents', 'Info.plist')],\n    {encoding: 'utf8'}\n  ).trim();\n\n  console.log(`Launched ${bundleID}`);\n}\n\nmodule.exports = {\n  name: 'run-macos',\n  description: 'builds your app and starts it',\n  func: runMacOS,\n  examples: [\n    {\n      desc: 'Pass a non-standard location of macOS directory',\n      cmd: 'react-native-macos run-macos --project-path \"./app/macos\"',\n    },\n  ],\n  options: [{\n    command: '--scheme [string]',\n    description: 'Explicitly set Xcode scheme to use',\n  }, {\n    command: '--project-path [string]',\n    description: 'Path relative to project root where the Xcode project '\n    + '(.xcodeproj) lives. The default is \\'macos\\'.',\n    default: 'macos',\n  }]\n};\n"
  },
  {
    "path": "local-cli/server/checkNodeVersion.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nvar chalk = require('chalk');\nvar formatBanner = require('metro-core/src/formatBanner');\nvar semver = require('semver');\n\nmodule.exports = function() {\n  if (!semver.satisfies(process.version, '>=4')) {\n    var engine = semver.satisfies(process.version, '<1')\n      ? 'Node'\n      : 'io.js';\n\n    var message = 'You are currently running ' + engine + ' ' +\n      process.version + '.\\n' +\n      '\\n' +\n      'React Native runs on Node 4.0 or newer. There are several ways to ' +\n      'upgrade Node.js depending on your preference.\\n' +\n      '\\n' +\n      'nvm:       nvm install node && nvm alias default node\\n' +\n      'Homebrew:  brew unlink iojs; brew install node\\n' +\n      'Installer: download the Mac .pkg from https://nodejs.org/\\n' +\n      '\\n' +\n      'About Node.js:   https://nodejs.org\\n' +\n      'Follow along at: https://github.com/facebook/react-native/issues/2545';\n    console.log(formatBanner(message, {\n      chalkFunction: chalk.green,\n      marginLeft: 1,\n      marginRight: 1,\n      paddingBottom: 1,\n    }));\n    process.exit(1);\n  }\n};\n"
  },
  {
    "path": "local-cli/server/middleware/copyToClipBoardMiddleware.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst copyToClipBoard = require('../util/copyToClipBoard');\nvar chalk = require('chalk');\n\n/**\n * Handle the request from JS to copy contents onto host system clipboard.\n * This is only supported on Mac for now.\n */\nmodule.exports = function(req, res, next) {\n  if (req.url === '/copy-to-clipboard') {\n    var ret = copyToClipBoard(req.rawBody);\n    if (!ret) {\n      console.warn(chalk.red('Copy button is not supported on this platform!'));\n    }\n    res.end('OK');\n  } else {\n    next();\n  }\n};\n"
  },
  {
    "path": "local-cli/server/middleware/getDevToolsMiddleware.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n */\n'use strict';\n\nconst launchChrome = require('../util/launchChrome');\n\nconst {exec} = require('child_process');\n\nfunction launchChromeDevTools(port, args = '') {\n  var debuggerURL = 'http://localhost:' + port + '/debugger-ui' + args;\n  console.log('Launching Dev Tools...');\n  launchChrome(debuggerURL);\n}\n\nfunction escapePath(pathname) {\n  // \" Can escape paths with spaces in OS X, Windows, and *nix\n  return '\"' + pathname + '\"';\n}\n\nfunction launchDevTools({port, projectRoots}, isChromeConnected) {\n  // Explicit config always wins\n  var customDebugger = process.env.REACT_DEBUGGER;\n  if (customDebugger) {\n    var projects = projectRoots.map(escapePath).join(' ');\n    var command = customDebugger + ' ' + projects;\n    console.log('Starting custom debugger by executing: ' + command);\n    exec(command, function(error, stdout, stderr) {\n      if (error !== null) {\n        console.log('Error while starting custom debugger: ' + error);\n      }\n    });\n  } else if (!isChromeConnected()) {\n    // Dev tools are not yet open; we need to open a session\n    launchChromeDevTools(port);\n  }\n}\n\nmodule.exports = function(options, isChromeConnected) {\n  return function(req, res, next) {\n    if (req.url === '/launch-safari-devtools') {\n      // TODO: remove `console.log` and dev tools binary\n      console.log(\n        'We removed support for Safari dev-tools. ' +\n          'If you still need this, please let us know.',\n      );\n    } else if (req.url === '/launch-chrome-devtools') {\n      // TODO: Remove this case in the future\n      console.log(\n        'The method /launch-chrome-devtools is deprecated. You are ' +\n          ' probably using an application created with an older CLI with the ' +\n          ' packager of a newer CLI. Please upgrade your application: ' +\n          'https://facebook.github.io/react-native/docs/upgrading.html',\n      );\n      launchDevTools(options, isChromeConnected);\n      res.end('OK');\n    } else if (req.url === '/launch-js-devtools') {\n      launchDevTools(options, isChromeConnected);\n      res.end('OK');\n    } else {\n      next();\n    }\n  };\n};\n"
  },
  {
    "path": "local-cli/server/middleware/getFlowTypeCheckMiddleware.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nvar chalk = require('chalk');\nvar exec = require('child_process').exec;\nvar url = require('url');\nvar Activity = require('../../../packager/react-packager').Activity;\n\nvar hasWarned = {};\n\nfunction getFlowTypeCheckMiddleware(options) {\n  return function(req, res, next) {\n    var reqObj = url.parse(req.url);\n    var isFlowCheck =  (reqObj.path.match(/^\\/flow\\//));\n\n    if (!isFlowCheck) {\n      return next();\n    }\n    if (options.skipflow) {\n      _endSkipFlow(res);\n      return;\n    }\n    if (options.flowroot || options.projectRoots.length === 1) {\n      var flowroot = options.flowroot || options.projectRoots[0];\n    } else {\n      if (!hasWarned.noRoot) {\n        hasWarned.noRoot = true;\n        console.warn('flow: No suitable root');\n      }\n      _endFlowBad(res);\n      return;\n    }\n    exec('command -v flow >/dev/null 2>&1', function(error, stdout) {\n      if (error) {\n        if (!hasWarned.noFlow) {\n          hasWarned.noFlow = true;\n          console.warn(chalk.yellow('flow: Skipping because not installed.  Install with ' +\n            '`brew install flow`.'));\n        }\n        _endFlowBad(res);\n        return;\n      } else {\n        return doFlowTypecheck(res, flowroot, next);\n      }\n    });\n  };\n}\n\nfunction doFlowTypecheck(res, flowroot, next) {\n  var flowCmd = 'cd \"' + flowroot + '\" && flow --json --timeout 20';\n  var eventId = Activity.startEvent('flow static typechecks');\n  exec(flowCmd, function(flowError, stdout, stderr) {\n    Activity.endEvent(eventId);\n    if (!flowError) {\n      _endFlowOk(res);\n      return;\n    } else {\n      try {\n        var flowResponse = JSON.parse(stdout);\n        var errors = [];\n        var errorNum = 1;\n        flowResponse.errors.forEach(function(err) {\n          // flow errors are paired across callsites, so we indent and prefix to\n          // group them\n          var indent = '';\n          err.message.forEach(function(msg) {\n            errors.push({\n              description: indent + 'E' + errorNum + ': ' + msg.descr,\n              filename: msg.path,\n              lineNumber: msg.line,\n              column: msg.start,\n            });\n            indent = '  ';\n          });\n          errorNum++;\n        });\n        var error = {\n          status: 200,\n          message: 'Flow found type errors.  If you think these are wrong, ' +\n            'make sure your flow bin and .flowconfig are up to date, or ' +\n            'disable with --skipflow.',\n          type: 'FlowError',\n          errors: errors,\n        };\n        res.writeHead(error.status, {\n          'Content-Type': 'application/json; charset=UTF-8',\n        });\n        res.end(JSON.stringify(error));\n      } catch (e) {\n        if (stderr.match(/Could not find a \\.flowconfig/)) {\n          if (!hasWarned.noConfig) {\n            hasWarned.noConfig = true;\n            console.warn(chalk.yellow('flow: ' + stderr));\n          }\n          _endFlowBad(res);\n        } else if (flowError.code === 3) {\n          if (!hasWarned.timeout) {\n            hasWarned.timeout = true;\n            console.warn(chalk.yellow('flow: ' + stdout));\n          }\n          _endSkipFlow(res);\n        } else {\n          if (!hasWarned.brokenFlow) {\n            hasWarned.brokenFlow = true;\n            console.warn(chalk.yellow(\n              'Flow failed to provide parseable output:\\n\\n`' + stdout +\n              '`.\\n' + 'stderr: `' + stderr + '`'\n            ));\n          }\n          _endFlowBad(res);\n        }\n        return;\n      }\n    }\n  });\n}\n\nfunction _endRes(res, message, code, silentError) {\n  res.writeHead(code, {\n    'Content-Type': 'application/json; charset=UTF-8',\n  });\n  res.end(JSON.stringify({\n    message: message,\n    errors: [],\n    silentError: silentError,\n  }));\n}\n\nfunction _endFlowOk(res) {\n  _endRes(res, 'No Flow Error', '200', true);\n}\n\nfunction _endFlowBad(res) {\n  // we want to show that flow failed\n  // status 200 is need for the fetch to not be rejected\n  _endRes(res, 'Flow failed to run! Please look at the console for more details.', '200', false);\n}\n\nfunction _endSkipFlow(res) {\n  _endRes(res, 'Flow was skipped, check the server options', '200', true);\n}\n\nmodule.exports = getFlowTypeCheckMiddleware;\n"
  },
  {
    "path": "local-cli/server/middleware/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <title>React Native</title>\n</head>\n<body>\n  <p>React Native packager is running.</p>\n  <p><a href=\"http://facebook.github.io/react-native/\">Visit documentation</a></p>\n</body>\n</html>\n"
  },
  {
    "path": "local-cli/server/middleware/indexPage.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\nmodule.exports = function(req, res, next) {\n  if (req.url === '/') {\n    res.end(fs.readFileSync(path.join(__dirname, 'index.html')));\n  } else {\n    next();\n  }\n};\n"
  },
  {
    "path": "local-cli/server/middleware/loadRawBodyMiddleware.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nmodule.exports = function(req, res, next) {\n  req.rawBody = '';\n  req.setEncoding('utf8');\n\n  req.on('data', function(chunk) {\n    req.rawBody += chunk;\n  });\n\n  req.on('end', function() {\n    next();\n  });\n};\n"
  },
  {
    "path": "local-cli/server/middleware/openStackFrameInEditorMiddleware.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst launchEditor = require('../util/launchEditor');\n\nmodule.exports = function({projectRoots}) {\n  return function(req, res, next) {\n    if (req.url === '/open-stack-frame') {\n      const frame = JSON.parse(req.rawBody);\n      launchEditor(frame.file, frame.lineNumber, projectRoots);\n      res.end('OK');\n    } else {\n      next();\n    }\n  };\n};\n"
  },
  {
    "path": "local-cli/server/middleware/statusPageMiddleware.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\n/**\n * Status page so that anyone who needs to can verify that the packager is\n * running on 8081 and not another program / service.\n */\nmodule.exports = function(req, res, next) {\n  if (req.url === '/status') {\n    res.end('packager-status:running');\n  } else {\n    next();\n  }\n};\n"
  },
  {
    "path": "local-cli/server/middleware/systraceProfileMiddleware.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst fs = require('fs');\n\nmodule.exports = function(req, res, next) {\n  if (req.url !== '/systrace') {\n    next();\n    return;\n  }\n\n  console.log('Dumping profile information...');\n  var dumpName = '/tmp/dump_' + Date.now() + '.json';\n  fs.writeFileSync(dumpName, req.rawBody);\n  var response =\n    'Your profile was saved at:\\n' + dumpName + '\\n\\n' +\n    'On Google Chrome navigate to chrome://tracing and then click on \"load\" ' +\n    'to load and visualise your profile.\\n\\n' +\n    'This message is also printed to your console by the packager so you can copy it :)';\n  console.log(response);\n  res.end(response);\n};\n"
  },
  {
    "path": "local-cli/server/middleware/unless.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nmodule.exports = (url, middleware) => {\n  return (req, res, next) =>  {\n    if (req.url === url || req.url.startsWith(url + '/')) {\n      middleware(req, res, next);\n    } else {\n      next();\n    }\n  };\n};\n"
  },
  {
    "path": "local-cli/server/runServer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nrequire('../../setupBabel')();\n\nconst Metro = require('metro');\n\nconst HmrServer = require('metro/src/HmrServer');\n\nconst {Terminal} = require('metro-core');\n\nconst attachWebsocketServer = require('./util/attachWebsocketServer');\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst connect = require('connect');\nconst copyToClipBoardMiddleware = require('./middleware/copyToClipBoardMiddleware');\nconst defaultAssetExts = Metro.defaults.assetExts;\nconst defaultSourceExts = Metro.defaults.sourceExts;\nconst defaultPlatforms = Metro.defaults.platforms;\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst defaultProvidesModuleNodeModules =\n  Metro.defaults.providesModuleNodeModules;\nconst fs = require('fs');\nconst getDevToolsMiddleware = require('./middleware/getDevToolsMiddleware');\nconst http = require('http');\nconst https = require('https');\nconst indexPageMiddleware = require('./middleware/indexPage');\nconst loadRawBodyMiddleware = require('./middleware/loadRawBodyMiddleware');\nconst messageSocket = require('./util/messageSocket.js');\nconst openStackFrameInEditorMiddleware = require('./middleware/openStackFrameInEditorMiddleware');\nconst path = require('path');\nconst statusPageMiddleware = require('./middleware/statusPageMiddleware.js');\nconst systraceProfileMiddleware = require('./middleware/systraceProfileMiddleware.js');\nconst webSocketProxy = require('./util/webSocketProxy.js');\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst TransformCaching = require('metro/src/lib/TransformCaching');\n\nconst {ASSET_REGISTRY_PATH} = require('../core/Constants');\n\nimport type {ConfigT} from 'metro';\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nimport type {Reporter} from 'metro/src/lib/reporting';\n\nexport type Args = {|\n  +assetExts: $ReadOnlyArray<string>,\n  +host: string,\n  +maxWorkers: number,\n  +nonPersistent: boolean,\n  +platforms: $ReadOnlyArray<string>,\n  +port: number,\n  +projectRoots: $ReadOnlyArray<string>,\n  +resetCache: boolean,\n  +sourceExts: $ReadOnlyArray<string>,\n  +verbose: boolean,\n|};\n\nfunction runServer(\n  args: Args,\n  config: ConfigT,\n  // FIXME: this is weird design. The top-level should pass down a custom\n  // reporter rather than passing it up as argument to an event.\n  startedCallback: (reporter: Reporter) => mixed,\n  readyCallback: (reporter: Reporter) => mixed,\n) {\n  var wsProxy = null;\n  var ms = null;\n\n  const terminal = new Terminal(process.stdout);\n  const ReporterImpl = getReporterImpl(args.customLogReporterPath || null);\n  const reporter = new ReporterImpl(terminal);\n  const packagerServer = getPackagerServer(args, config, reporter);\n  startedCallback(reporter);\n\n  const app = connect()\n    .use(loadRawBodyMiddleware)\n    .use(connect.compress())\n    .use(\n      '/debugger-ui',\n      connect.static(path.join(__dirname, 'util', 'debugger-ui')),\n    )\n    .use(\n      getDevToolsMiddleware(args, () => wsProxy && wsProxy.isChromeConnected()),\n    )\n    .use(getDevToolsMiddleware(args, () => ms && ms.isChromeConnected()))\n    .use(openStackFrameInEditorMiddleware(args))\n    .use(copyToClipBoardMiddleware)\n    .use(statusPageMiddleware)\n    .use(systraceProfileMiddleware)\n    .use(indexPageMiddleware)\n    .use(packagerServer.processRequest.bind(packagerServer));\n\n  args.projectRoots.forEach(root => app.use(connect.static(root)));\n\n  app.use(connect.logger()).use(connect.errorHandler());\n\n  if (args.https && (!args.key || !args.cert)) {\n    throw new Error('Cannot use https without specifying key and cert options');\n  }\n\n  const serverInstance = args.https\n    ? https.createServer(\n        {\n          key: fs.readFileSync(args.key),\n          cert: fs.readFileSync(args.cert),\n        },\n        app,\n      )\n    : http.createServer(app);\n\n  serverInstance.listen(args.port, args.host, 511, function() {\n    attachWebsocketServer({\n      httpServer: serverInstance,\n      path: '/hot',\n      websocketServer: new HmrServer(packagerServer, reporter),\n    });\n\n    wsProxy = webSocketProxy.attachToServer(serverInstance, '/debugger-proxy');\n    ms = messageSocket.attachToServer(serverInstance, '/message');\n    readyCallback(reporter);\n  });\n  // Disable any kind of automatic timeout behavior for incoming\n  // requests in case it takes the packager more than the default\n  // timeout of 120 seconds to respond to a request.\n  serverInstance.timeout = 0;\n}\n\nfunction getReporterImpl(customLogReporterPath: ?string) {\n  if (customLogReporterPath == null) {\n    return require('metro/src/lib/TerminalReporter');\n  }\n  try {\n    // First we let require resolve it, so we can require packages in node_modules\n    // as expected. eg: require('my-package/reporter');\n    /* $FlowFixMe: can't type dynamic require */\n    return require(customLogReporterPath);\n  } catch (e) {\n    if (e.code !== 'MODULE_NOT_FOUND') {\n      throw e;\n    }\n    // If that doesn't work, then we next try relative to the cwd, eg:\n    // require('./reporter');\n    /* $FlowFixMe: can't type dynamic require */\n    return require(path.resolve(customLogReporterPath));\n  }\n}\n\nfunction getPackagerServer(args, config, reporter) {\n  const transformModulePath = args.transformer\n    ? path.resolve(args.transformer)\n    : config.getTransformModulePath();\n\n  const providesModuleNodeModules =\n    args.providesModuleNodeModules || defaultProvidesModuleNodeModules;\n\n  return Metro.createServer({\n    assetExts: defaultAssetExts.concat(args.assetExts),\n    assetRegistryPath: ASSET_REGISTRY_PATH,\n    blacklistRE: config.getBlacklistRE(),\n    cacheVersion: '3',\n    enableBabelRCLookup: config.getEnableBabelRCLookup(),\n    extraNodeModules: config.extraNodeModules,\n    getModulesRunBeforeMainModule: config.getModulesRunBeforeMainModule,\n    getPolyfills: config.getPolyfills,\n    getTransformOptions: config.getTransformOptions,\n    globalTransformCache: null,\n    hasteImpl: config.hasteImpl,\n    maxWorkers: args.maxWorkers,\n    platforms: defaultPlatforms.concat(args.platforms),\n    polyfillModuleNames: config.getPolyfillModuleNames(),\n    postMinifyProcess: config.postMinifyProcess,\n    postProcessBundleSourcemap: config.postProcessBundleSourcemap,\n    postProcessModules: config.postProcessModules,\n    projectRoots: args.projectRoots,\n    providesModuleNodeModules: providesModuleNodeModules,\n    reporter,\n    resetCache: args.resetCache,\n    sourceExts: defaultSourceExts.concat(args.sourceExts),\n    transformModulePath: transformModulePath,\n    transformCache: TransformCaching.useTempDir(),\n    verbose: args.verbose,\n    watch: !args.nonPersistent,\n    workerPath: config.getWorkerPath(),\n  });\n}\n\nmodule.exports = runServer;\n"
  },
  {
    "path": "local-cli/server/server.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n\n'use strict';\n\nconst path = require('path');\nconst runServer = require('./runServer');\n\nimport type {RNConfig} from '../core';\nimport type {ConfigT} from 'metro';\nimport type {Args as RunServerArgs} from './runServer';\n\n/**\n * Starts the React Native Packager Server.\n */\nfunction server(argv: mixed, config: RNConfig, allArgs: Object) {\n  const {root, ...args} = allArgs;\n  args.projectRoots = args.projectRoots.concat(root);\n\n  const startedCallback = logReporter => {\n    logReporter.update({\n      type: 'initialize_started',\n      port: args.port,\n      projectRoots: args.projectRoots,\n    });\n\n    process.on('uncaughtException', error => {\n      logReporter.update({\n        type: 'initialize_failed',\n        port: args.port,\n        error,\n      });\n\n      process.exit(11);\n    });\n  };\n\n  const readyCallback = logReporter => {\n    logReporter.update({\n      type: 'initialize_done',\n    });\n  };\n  const runServerArgs: RunServerArgs = args;\n  /* $FlowFixMe: ConfigT shouldn't be extendable. */\n  const configT: ConfigT = config;\n  runServer(runServerArgs, configT, startedCallback, readyCallback);\n}\n\nmodule.exports = {\n  name: 'start',\n  func: server,\n  description: 'starts the webserver',\n  options: [{\n    command: '--port [number]',\n    default: process.env.RCT_METRO_PORT || 8081,\n    parse: (val: string) => Number(val),\n  }, {\n    command: '--host [string]',\n    default: '',\n  }, {\n    command: '--root [list]',\n    description: 'add another root(s) to be used by the packager in this project',\n    parse: (val: string) => val.split(',').map(root => path.resolve(root)),\n    default: [],\n  }, {\n    command: '--projectRoots [list]',\n    description: 'override the root(s) to be used by the packager',\n    parse: (val: string) => val.split(','),\n    default: (config: ConfigT) => config.getProjectRoots(),\n  }, {\n    command: '--assetExts [list]',\n    description: 'Specify any additional asset extensions to be used by the packager',\n    parse: (val: string) => val.split(','),\n    default: (config: ConfigT) => config.getAssetExts(),\n  }, {\n    command: '--sourceExts [list]',\n    description: 'Specify any additional source extensions to be used by the packager',\n    parse: (val: string) => val.split(','),\n    default: (config: ConfigT) => config.getSourceExts(),\n  }, {\n    command: '--platforms [list]',\n    description: 'Specify any additional platforms to be used by the packager',\n    parse: (val: string) => val.split(','),\n    default: (config: ConfigT) => config.getPlatforms(),\n  }, {\n    command: '--providesModuleNodeModules [list]',\n    description: 'Specify any npm packages that import dependencies with providesModule',\n    parse: (val: string) => val.split(','),\n    default: (config: RNConfig) => {\n      if (typeof config.getProvidesModuleNodeModules === 'function') {\n        return config.getProvidesModuleNodeModules();\n      }\n      return null;\n    },\n  }, {\n    command: '--max-workers [number]',\n    description: 'Specifies the maximum number of workers the worker-pool ' +\n      'will spawn for transforming files. This defaults to the number of the ' +\n      'cores available on your machine.',\n    parse: (workers: string) => Number(workers),\n  }, {\n    command: '--skipflow',\n    description: 'Disable flow checks'\n  }, {\n    command: '--nonPersistent',\n    description: 'Disable file watcher'\n  }, {\n    command: '--transformer [string]',\n    description: 'Specify a custom transformer to be used'\n  }, {\n    command: '--reset-cache, --resetCache',\n    description: 'Removes cached files',\n  }, {\n    command: '--custom-log-reporter-path, --customLogReporterPath [string]',\n    description: 'Path to a JavaScript file that exports a log reporter as a replacement for TerminalReporter',\n  }, {\n    command: '--verbose',\n    description: 'Enables logging',\n  }, {\n    command: '--https',\n    description: 'Enables https connections to the server',\n  }, {\n    command: '--key [path]',\n    description: 'Path to custom SSL key',\n  }, {\n    command: '--cert [path]',\n    description: 'Path to custom SSL cert',\n  }],\n};\n"
  },
  {
    "path": "local-cli/server/util/attachWebsocketServer.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @flow\n */\n\n'use strict';\n\nimport type {Server as HTTPServer} from 'http';\nimport type {Server as HTTPSServer} from 'https';\n\ntype WebsocketServiceInterface<T> = {\n  +onClientConnect: (\n    url: string,\n    sendFn: (data: string) => mixed,\n  ) => Promise<T>,\n  +onClientDisconnect?: (client: T) => mixed,\n  +onClientError?: (client: T, e: Error) => mixed,\n  +onClientMessage?: (client: T, message: string) => mixed,\n};\n\ntype HMROptions<TClient> = {\n  httpServer: HTTPServer | HTTPSServer,\n  websocketServer: WebsocketServiceInterface<TClient>,\n  path: string,\n};\n\n/**\n * Attaches a WebSocket based connection to the Packager to expose\n * Hot Module Replacement updates to the simulator.\n */\nfunction attachWebsocketServer<TClient: Object>({\n  httpServer,\n  websocketServer,\n  path,\n}: HMROptions<TClient>) {\n  const WebSocketServer = require('ws').Server;\n  const wss = new WebSocketServer({\n    server: httpServer,\n    path: path,\n  });\n\n  wss.on('connection', async ws => {\n    let connected = true;\n    const url = ws.upgradeReq.url;\n\n    const sendFn = (...args) => {\n      if (connected) {\n        ws.send(...args);\n      }\n    };\n\n    const client = await websocketServer.onClientConnect(url, sendFn);\n\n    ws.on('error', e => {\n      websocketServer.onClientError && websocketServer.onClientError(client, e);\n    });\n\n    ws.on('close', () => {\n      websocketServer.onClientDisconnect &&\n        websocketServer.onClientDisconnect(client);\n      connected = false;\n    });\n\n    ws.on('message', message => {\n      websocketServer.onClientMessage &&\n        websocketServer.onClientMessage(client, message);\n    });\n  });\n}\n\nmodule.exports = attachWebsocketServer;\n"
  },
  {
    "path": "local-cli/server/util/copyToClipBoard.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nvar child_process = require('child_process');\nvar spawn = child_process.spawn;\nvar path = require('path');\nvar fs  = require('fs');\n\nconst xsel = path.join(__dirname, 'external/xsel');\nfs.chmodSync(xsel, '0755');\n/**\n * Copy the content to host system clipboard.\n */\nfunction copyToClipBoard(content) {\n  switch (process.platform) {\n  case 'darwin':\n    var child = spawn('pbcopy', []);\n    child.stdin.end(new Buffer(content, 'utf8'));\n    return true;\n  case 'win32':\n    var child = spawn('clip', []);\n    child.stdin.end(new Buffer(content, 'utf8'));\n    return true;\n  case 'linux':\n    var child = spawn(xsel, ['--clipboard', '--input']);\n    child.stdin.end(new Buffer(content, 'utf8'));\n    return true;\n  default:\n    return false;\n  }\n}\n\nmodule.exports = copyToClipBoard;\n"
  },
  {
    "path": "local-cli/server/util/debugger-ui/DeltaPatcher.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n */\n\n/**\n * This file is a copy of the reference `DeltaPatcher`, located in\n * metro. The reason to not reuse that file is that in this context\n * we cannot have flow annotations or CJS syntax (since this file is directly)\n * injected into a static HTML page.\n *\n * TODO: Find a simple and lightweight way to compile `DeltaPatcher` to avoid\n * having this duplicated file.\n */\n(function(global) {\n  'use strict';\n\n  /**\n   * This is a reference client for the Delta Bundler: it maintains cached the\n   * last patched bundle delta and it's capable of applying new Deltas received\n   * from the Bundler.\n   */\n  class DeltaPatcher {\n    constructor() {\n      this._lastBundle = {\n        pre: new Map(),\n        post: new Map(),\n        modules: new Map(),\n      };\n      this._initialized = false;\n      this._lastNumModifiedFiles = 0;\n      this._lastModifiedDate = new Date();\n    }\n\n    static get(id) {\n      let deltaPatcher = this._deltaPatchers.get(id);\n\n      if (!deltaPatcher) {\n        deltaPatcher = new DeltaPatcher();\n        this._deltaPatchers.set(id, deltaPatcher);\n      }\n\n      return deltaPatcher;\n    }\n\n    /**\n     * Applies a Delta Bundle to the current bundle.\n     */\n    applyDelta(deltaBundle) {\n      // Make sure that the first received delta is a fresh one.\n      if (!this._initialized && !deltaBundle.reset) {\n        throw new Error(\n          'DeltaPatcher should receive a fresh Delta when being initialized',\n        );\n      }\n\n      this._initialized = true;\n\n      // Reset the current delta when we receive a fresh delta.\n      if (deltaBundle.reset) {\n        this._lastBundle = {\n          pre: new Map(),\n          post: new Map(),\n          modules: new Map(),\n        };\n      }\n\n      this._lastNumModifiedFiles =\n        deltaBundle.pre.size + deltaBundle.post.size + deltaBundle.delta.size;\n\n      if (this._lastNumModifiedFiles > 0) {\n        this._lastModifiedDate = new Date();\n      }\n\n      this._patchMap(this._lastBundle.pre, deltaBundle.pre);\n      this._patchMap(this._lastBundle.post, deltaBundle.post);\n      this._patchMap(this._lastBundle.modules, deltaBundle.delta);\n\n      return this;\n    }\n\n    /**\n     * Returns the number of modified files in the last received Delta. This is\n     * currently used to populate the `X-Metro-Files-Changed-Count` HTTP header\n     * when metro serves the whole JS bundle, and can potentially be removed once\n     * we only send the actual deltas to clients.\n     */\n    getLastNumModifiedFiles() {\n      return this._lastNumModifiedFiles;\n    }\n\n    getLastModifiedDate() {\n      return this._lastModifiedDate;\n    }\n\n    getAllModules() {\n      return [].concat(\n        Array.from(this._lastBundle.pre.values()),\n        Array.from(this._lastBundle.modules.values()),\n        Array.from(this._lastBundle.post.values()),\n      );\n    }\n\n    _patchMap(original, patch) {\n      for (const [key, value] of patch.entries()) {\n        if (value == null) {\n          original.delete(key);\n        } else {\n          original.set(key, value);\n        }\n      }\n    }\n  }\n\n  DeltaPatcher._deltaPatchers = new Map();\n\n  global.DeltaPatcher = DeltaPatcher;\n})(window);\n"
  },
  {
    "path": "local-cli/server/util/debugger-ui/debuggerWorker.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* global __fbBatchedBridge, self, importScripts, postMessage, onmessage: true */\n/* eslint no-unused-vars: 0 */\n\n'use strict';\n\nonmessage = (function() {\n  var visibilityState;\n  var showVisibilityWarning = (function() {\n    var hasWarned = false;\n    return function() {\n      // Wait until `YellowBox` gets initialized before displaying the warning.\n      if (hasWarned || console.warn.toString().includes('[native code]')) {\n        return;\n      }\n      hasWarned = true;\n      console.warn(\n        'Remote debugger is in a background tab which may cause apps to ' +\n        'perform slowly. Fix this by foregrounding the tab (or opening it in ' +\n        'a separate window).'\n      );\n    };\n  })();\n\n  var messageHandlers = {\n    'executeApplicationScript': function(message, sendReply) {\n      for (var key in message.inject) {\n        self[key] = JSON.parse(message.inject[key]);\n      }\n      var error;\n      try {\n        importScripts(message.url);\n      } catch (err) {\n        error = err.message;\n      }\n      sendReply(null /* result */, error);\n    },\n    'setDebuggerVisibility': function(message) {\n      visibilityState = message.visibilityState;\n    },\n  };\n\n  return function(message) {\n    if (visibilityState === 'hidden') {\n      showVisibilityWarning();\n    }\n\n    var object = message.data;\n\n    var sendReply = function(result, error) {\n      postMessage({replyID: object.id, result: result, error: error});\n    };\n\n    var handler = messageHandlers[object.method];\n    if (handler) {\n      // Special cased handlers\n      handler(object, sendReply);\n    } else {\n      // Other methods get called on the bridge\n      var returnValue = [[], [], [], 0];\n      var error;\n      try {\n        if (typeof __fbBatchedBridge === 'object') {\n          returnValue = __fbBatchedBridge[object.method].apply(null, object.arguments);\n        } else {\n          error = 'Failed to call function, __fbBatchedBridge is undefined';\n        }\n      } catch (err) {\n        error = err.message;\n      } finally {\n        sendReply(JSON.stringify(returnValue), error);\n      }\n    }\n  };\n})();\n"
  },
  {
    "path": "local-cli/server/util/debugger-ui/deltaUrlToBlobUrl.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @format\n */\n\n/* global Blob, URL: true */\n\n(function(global) {\n  'use strict';\n\n  let cachedBundleUrls = new Map();\n\n  /**\n   * Converts the passed delta URL into an URL object containing already the\n   * whole JS bundle Blob.\n   */\n  async function deltaUrlToBlobUrl(deltaUrl) {\n    let cachedBundle = cachedBundleUrls.get(deltaUrl);\n\n    const deltaBundleId = cachedBundle\n      ? `&deltaBundleId=${cachedBundle.id}`\n      : '';\n\n    const data = await fetch(deltaUrl + deltaBundleId);\n    const bundle = await data.json();\n\n    const deltaPatcher = global.DeltaPatcher.get(bundle.id).applyDelta({\n      pre: new Map(bundle.pre),\n      post: new Map(bundle.post),\n      delta: new Map(bundle.delta),\n      reset: bundle.reset,\n    });\n\n    // If nothing changed, avoid recreating a bundle blob by reusing the\n    // previous one.\n    if (deltaPatcher.getLastNumModifiedFiles() === 0 && cachedBundle) {\n      return cachedBundle.url;\n    }\n\n    // Clean up the previous bundle URL to not leak memory.\n    if (cachedBundle) {\n      URL.revokeObjectURL(cachedBundle.url);\n    }\n\n    // To make Source Maps work correctly, we need to add a newline between\n    // modules.\n    const blobContent = deltaPatcher\n      .getAllModules()\n      .map(module => module + '\\n');\n\n    // Build the blob with the whole JS bundle.\n    const blob = new Blob(blobContent, {\n      type: 'application/javascript',\n    });\n\n    const bundleUrl = URL.createObjectURL(blob);\n    cachedBundleUrls.set(deltaUrl, {\n      id: bundle.id,\n      url: bundleUrl,\n    });\n\n    return bundleUrl;\n  }\n\n  global.deltaUrlToBlobUrl = deltaUrlToBlobUrl;\n})(window || {});\n"
  },
  {
    "path": "local-cli/server/util/debugger-ui/index.html",
    "content": "<!DOCTYPE html>\n<!--\n  Copyright (c) 2015-present, Facebook, Inc.\n  All rights reserved.\n\n  This source code is licensed under the BSD-style license found in the\n  LICENSE file in the root directory of this source tree. An additional grant\n  of patent rights can be found in the PATENTS file in the same directory.\n-->\n<html>\n<head>\n<meta charset=utf-8>\n<link rel=\"icon\" href=\"data:;base64,iVBORw0KGgo=\">\n<title>React Native Debugger</title>\n<script src=\"/debugger-ui/DeltaPatcher.js\"></script>\n<script src=\"/debugger-ui/deltaUrlToBlobUrl.js\"></script>\n<script>\n/* eslint-env browser */\n'use strict';\n(function() {\n\n  const isMacLike = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);\n  const refreshShortcut = isMacLike ? '⌘R' : 'Ctrl R';\n  window.onload = function() {\n    if (!isMacLike) {\n      document.getElementById('shortcut').innerHTML = 'Ctrl⇧J';\n    }\n    Page.render();\n  };\n\n  const Assets = {\n    blueIcon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAABAJJREFUWMPNV0tIlFEU/nsaPSCrhVFZBBFRFkXvKCpCw6BFtagkWoS1CApp0YMKclHRYxNpj0UUQWUavYmeEi2MsFVS/s7oqOPo6DjqzKjpzOjpnDl35s7MP/8/vyUxFy7c/5x7z/nued5fUcwOgLGKBXIUFYqUaijHqeL0iamGaMSjPbR32IYNMpQaKEbhHlQCpibtpTN09q+HBdJQSCEK7DatWDu7QzJI1pBvrULFPyiOt0iFeWtUw2I8YB825RKEXamFLDM31yifqAIcbwO40QmQ3wIwXtUqmFwDcNQJcKeL96apOiB0LUF+0jH7u26AwUEA3wCERmsAYF+z5B9CUF1B5rmDvPeBx8AdCWOCA05zYEEdCz6JtxqB3xsbACp/M+0WWuR+F6+/9ACsqOczV90AQQSRYdEBQbo0pteJ9p1NrCAsnOYYnNc7IDIuocJRUWdyGpm+qcEgO2JcQTmrEzxkahpZdbH0aABX3LG89Q1M3243CErSGalwBkVmi7gN3SpM2+uQLrgrXLCjSfJ3Cautqk9SrEIVk0qnQfrMtrKwtxiIj70A33vZvwGcA2IGxKxE3j0E9MLHZ6ZZkqQm6Ra1XcOcjofPtwO4AtLULbhuD7DSpwjmspvNTwop8tuQ5wnK/U1+gNMYvFNqdK1QpIjGEsPY7eC0IqFvUPgrHys90MKCz7p43xy0TqaV1xSINPaLmHmNZz73yLTdljgeyhXRySLEXDsr/tYrA29tPQtqxhtZ+zkLnnjlTcns41S+sd3PtCU2Prsaz1b1AfgHOTjjAKiKaKcR4kf0dS0qmRBXyYhGg4rOLCtoBvm7oJXXP/u0VZLc98yrAeDTAHiPAGx+LQCLAJCPJp6ZAMBUVFLg5PWvOADpyHMG2GpxALwaF1C6kb+/ogvm1zJtjXABCSEgo5H20COV3+5kF5D5G4ULVooUpAL2AwH1o8x1Oi7QBOEeB0czpVYpoi71cFwcFEF4RgThDCtnC60vtDMvz8F7X/rYmrQ2DkKdNCQ/X+uQDYgE1fSzMLJQiYeVXsRZ5mUaWSg6bem70GVQD0JpmKQQzauVzYZSsrqPlVExCo+g+K7CJvUIgT0XGTLXaqYQJSnF2aIUZ0eV4jxRim+ihYpETyC3hflb7Uzb3GimFCdpRuHCsiiuGRVHNSPqCdG8ZTYtKP1mlKQdhxvLcpuk0bvgnEsCoDgYGXVmg+iGuXaz7djgQbJQPEhOtPE3AfkkSizldYlIx3KkLbXJjKCgzbSafZAkeZJ96ObAc4tG48XMOOKU/MNOmS3UkEh5mXeoTzKDR+kklbsaPTjp4ZmeoLtRxzvWyn3hVBsXpqE9SlPiWZ4SPyYp8WuWEj+n/+n3/A8emj1HwPlGOgAAAABJRU5ErkJggg==',\n    grayIcon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAA9VJREFUWMPNV+dKJEEQnl93r3Avcfcavpe/zHlXzDmLYlZU1oSrYEDFsGZdVDBvUBTUuv6K6aZ34ioiW1BMT1dPdXWFr3oMI03q7u7+lZOTk5WbmxsQz5DgiOCEyRiHTFkW1hrfRXl5eX+E0qDgmGBKk7E2iG+/vHFZWdlvcaJswclPbJzC+BY6oOvTpxYfhr+6sYMh4bS9kZ+f/098EP2uzTUjoPNvOie3bV5YWEihUIjW1tZobGyMCgoKbBsUFxfT5OQkbWxs8FpxEEcjXD1hxtzR7cfHx/Tx8UGvr68ESiaTNDQ0pOTj4+P08vLCsufnZ167vb3tGg7HnECyOH1QU1PDimdmZvi9ra2Nrq6ueG59fZ22trZ4HI1GqbGxkdcsLy/T+/s7lZeXuxmR7eR6x2zv6+vjDaRysFhPq6urJGlpaQlKlbyrq4vn29vbXasjJRRmnTsuhqtBdXV1KfO6ATixLmttbeX53t5er8QM6gjnCjIdHR2sDKeSc4ODgyoEm5ubPIanpLy/v5/nmpqaPMGKERPQ6VU+wWCQlSERd3d3Of6ILxjJBpbvl5eXnBP7+/v8TWlpqV95ZhkmftuESKDFxUV6enpSrk4kEirLI5EIxx7ux4aYw1pZDaB4PE6zs7NUUlLilgsBw2wsKYKBgQFWBKVHR0d0cHDA45GREVY8NzenvAPGGMaAhoeH+Xl4eEjn5+eqbHt6epyMCBlmJ1OTIi68GdwpE6+lpUWd6P7+nqtgb29PnRRuB/BADtaTtrm5ma6vr+nt7Y2T02JAxDDbqZo8PT2lh4cHRj99HnMgIGEgECArId5TU1M8vrm5saEkwodQWQxI2Aw4OTmhx8dHmwE4OWh0dNTRAMRZGnB7e2szAGGA1yw5ELeFAOWGEFxcXFB1dbVyo4wlDAHoAGoloRwRglgsxqyXIABMhgChdAqBaxKitFB6YBgF9+tJWFFRoeA2HA6zDBiBtUhceBNjzyR0K0O4eWVlRTUgKLq7u2NlGO/s7PCmYGkgZHrZ4n1hYcEVD2QZegJRVVUVK0NJoSSRYBJ8JEkggqthmASiyspKfyDyg+LOzk5WhqcVinE/kD0BYUu3GaVAsV8zksBSW1ubMo/N9STUZQ0NDTajXJuRXzuWjUVvx+D5+XllAPLAqRsC1NJqx14XEpxcv5DAEIAVCHWNmIPOzs6ovr5eVQTyRMK074XE70omywmNCIQSxf1PyicmJlS1oAqw1go6vlcyr0tpUVERdzVcOLExkM26Bkg4PT3NfQHe+vSlNCOu5RnxY5IRv2YZ8XP6U7/n/wFyU6HBPUWxjAAAAABJRU5ErkJggg==',\n    orangeIcon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAABGZJREFUWMPNV+tvFFUU30/4L/i9K0gQImoiQTQmGtEQQAWCoSGgJiZqojZCYsoHQkNIwAcJppWgHwjqLi1SHrVP2m4tfdAULKUW2NLSx0ILbGsf293ZeR7OOXc72+nM7GwbQjrJze7eufeex+/3O+euz5flAyUrliSL/esTAX9hIugPJYI5YfyMicHfQ/SO1tBa35N68LBnpaC/KB7wT8YDOZDd8E/SHtq7cMMV/mfiwZwCjGo6e8PWwXvxDDpr3lFjSlsXatjmCJ6VdTbkwLJV6HnkSRmflY2IXPL8Su/InYyXrAS54zAoPX9Csi0f4sUr7EbOvAjy1QJQ+87w2vjp5Y5OuGaCcHJLuzZ8GQzDAEOZBnoMaRSSLd+a7+W2fWDIU+JdcpzXqv0X3eFw4gSRxXHD3+/wwfL17/m3VLsD9LEunlPuBEG9W8rftUftIFW9z2uUW7+BoWsQL33VGRK05ZR6R7YnG79gAzOHiwOWgRI+BTOPcvMEzj1nvpfqd4s9tbmu6rBAIXTuTB5KNT2J8vcs81YHfrW8ky5t5/nkP5+5kpJsmhUuU5GR6naKaDAq06nmb3hOJQj6zgpjjZ+n31/+Uuyp/jBjseKKSaUzo3wuvC6MDTeCOlgO2mgXkkxDjFX81MXQNR7a6A3kxFlQI7W8J/7XKxmlSbZ9VL8dF5SuAeW/ImT1mJlqI/EIf//PRtVIDWNP6Vfv1TLzdWkMlTJlrtfjIyB3/oiOvOTGhUIfNRGbZ01fsazoUO1+AxqoZ6PJK98JRXQeTWXnDUicXyc4gc4wFC17Rcbuh0B72GbKVmr41EmSIR91MgvmoU+E4dFOk3hSzbZURA9BnxpgFahDVWaklHYqPBQxDSZtxQaxt3oL6ONhhEhhclodyAlTBmKWojPSAnpsEKvdC5bFNMcRYtGhqOc+hLd87aCoCRN3bFWS4CPY5mQg5uBAExqL2BzQMHLhQD4kzr3m4MDLpgP6ZO8cB1ajA1HO2hwOTNkhQLkR3lq0AxJlb6fSuDVFwihC0I8QLAV1oCwNAcpRQDDMQxSuD8ReLGAMgSYzlE4Q2EnY/DWzmaSmDlbwIF5Q9IKEP4kDzq1ltTAJu38RhpvzRC+4V8fZ5B6SkYQuMiScldsn0w2IZIbRG1KUM6QMlLNRpfs4KEOVPKdjhqyyjYLS9bNrPWAZehaii2+ZzYYkqU/0mgXINESFCYc+3sPQqJFLQgkX3vQuRJ6luH5XqhTvmgVRnugBPQEcvwtyImxpKX8s9tTlepdiz2bUuifVjN61NqOeP6wknJ21yk02p1ybkWc7nmksVZutDtw4lu6GyAOMaFY3/EjswaKWVTvOeCHByJn5HUdSstoM2oMWETnqWkUyMkcetGLkG01FEGlnyrTnhcTzSjbSLIiH1y0mnRLD+9+B9JWsfb/lusYyRGXM60qW+VK6irsaXzjx4kmVzbYGO5787yHuC/L1H+Z/KV0U1/JF8cdkUfw1WxR/Tp/W3/PHSyH/l51SdaoAAAAASUVORK5CYII=',\n  };\n\n  const Page = window.Page = {\n\n    state: {\n      isDark: localStorage.getItem('darkTheme') === 'on',\n      isPriorityMaintained: localStorage.getItem('maintainPriority') === 'on',\n      status: {type: 'disconnected'},\n      visibilityState: document.visibilityState,\n    },\n\n    setState(partialState) {\n      Page.state = Object.assign({}, Page.state, partialState);\n      Page.render();\n    },\n\n    render() {\n      const {\n        isDark,\n        isPriorityMaintained,\n        status,\n        visibilityState,\n      } = Page.state;\n\n      const statusNode = document.getElementById('status');\n      switch (status.type) {\n        case 'connected':\n          statusNode.innerHTML = 'Debugger session #' + status.id + ' active.';\n          break;\n        case 'error':\n          statusNode.innerHTML = status.error.reason || 'Disconnected from proxy. Attempting reconnection. Is node server running?';\n          break;\n        case 'connecting':\n        case 'disconnected':\n          // Fall through.\n        default:\n          statusNode.innerHTML = 'Waiting, press <span class=\"shortcut\">' + refreshShortcut + '</span> in simulator to reload and connect.';\n          break;\n      }\n\n      const linkNode = document.querySelector('link[rel=icon]');\n      if (status.type === 'disconnected' ||\n          status.type === 'error') {\n        linkNode.href = Assets.grayIcon;\n      } else {\n        if (visibilityState === 'visible' || isPriorityMaintained) {\n          linkNode.href = Assets.blueIcon;\n        } else {\n          linkNode.href = Assets.orangeIcon;\n        }\n      }\n\n      const darkCheckbox = document.getElementById('dark');\n      document.body.classList.toggle('dark', isDark);\n      darkCheckbox.checked = isDark;\n      localStorage.setItem('darkTheme', isDark ? 'on' : '');\n\n      const maintainPriorityCheckbox = document.getElementById('maintain-priority');\n      const silence = document.getElementById('silence');\n      silence.volume = 0.1;\n      if (isPriorityMaintained) {\n        silence.play();\n      } else {\n        silence.pause();\n      }\n      maintainPriorityCheckbox.checked = isPriorityMaintained;\n      localStorage.setItem('maintainPriority', isPriorityMaintained ? 'on' : '');\n    },\n\n    toggleDarkTheme() {\n      Page.setState({isDark: !Page.state.isDark});\n    },\n\n    togglePriorityMaintenance() {\n      Page.setState({isPriorityMaintained: !Page.state.isPriorityMaintained});\n    },\n\n  };\n\n  function connectToDebuggerProxy() {\n    const ws = new WebSocket('ws://' + window.location.host + '/debugger-proxy?role=debugger&name=Chrome');\n    let worker;\n\n    function createJSRuntime() {\n      // This worker will run the application JavaScript code,\n      // making sure that it's run in an environment without a global\n      // document, to make it consistent with the JSC executor environment.\n      worker = new Worker('debuggerWorker.js');\n      worker.onmessage = function(message) {\n        ws.send(JSON.stringify(message.data));\n      };\n      window.onbeforeunload = function() {\n        return 'If you reload this page, it is going to break the debugging session. ' +\n          'You should press' + refreshShortcut + 'in simulator to reload.';\n      };\n      updateVisibility();\n    }\n\n    function shutdownJSRuntime() {\n      if (worker) {\n        worker.terminate();\n        worker = null;\n        window.onbeforeunload = null;\n      }\n    }\n\n    function updateVisibility() {\n      if (worker && !Page.state.isPriorityMaintained) {\n        worker.postMessage({\n          method: 'setDebuggerVisibility',\n          visibilityState: document.visibilityState,\n        });\n      }\n      Page.setState({visibilityState: document.visibilityState});\n    }\n\n    ws.onopen = function() {\n      Page.setState({status: {type: 'connecting'}});\n    };\n\n    ws.onmessage = async function(message) {\n      if (!message.data) {\n        return;\n      }\n      const object = JSON.parse(message.data);\n\n      if (object.$event === 'client-disconnected') {\n        shutdownJSRuntime();\n        Page.setState({status: {type: 'disconnected'}});\n        return;\n      }\n\n      if (!object.method) {\n        return;\n      }\n\n      // Special message that asks for a new JS runtime\n      if (object.method === 'prepareJSRuntime') {\n        shutdownJSRuntime();\n        console.clear();\n        createJSRuntime();\n        ws.send(JSON.stringify({replyID: object.id}));\n        Page.setState({status: {type: 'connected', id: object.id}});\n      } else if (object.method === '$disconnected') {\n        shutdownJSRuntime();\n        Page.setState({status: {type: 'disconnected'}});\n      } else if (object.method === 'executeApplicationScript') {\n        worker.postMessage({\n          ...object,\n          url: await getBlobUrl(object.url),\n        });\n      } else {\n        // Otherwise, pass through to the worker.\n        worker.postMessage(object);\n      }\n    };\n\n    ws.onclose = function(error) {\n      shutdownJSRuntime();\n      Page.setState({status: {type: 'error', error}});\n      if (error.reason) {\n        console.warn(error.reason);\n      }\n      setTimeout(connectToDebuggerProxy, 500);\n    };\n\n    // Let debuggerWorker.js know when we're not visible so that we can warn about\n    // poor performance when using remote debugging.\n    document.addEventListener('visibilitychange', updateVisibility, false);\n  }\n\n  connectToDebuggerProxy();\n\n  async function getBlobUrl(url) {\n    return await window.deltaUrlToBlobUrl(url.replace('.bundle', '.delta'));\n  }\n})();\n</script>\n<style type=\"text/css\">\n  html,\n  body {\n    font-family: Helvetica, Verdana, sans-serif;\n    font-size: large;\n    font-weight: 200;\n    height: 100%;\n    margin: 0;\n    padding: 0;\n  }\n  .shortcut {\n    border-radius: 4px;\n    color: #eee;\n    background-color: #333;\n    font-family: \"Monaco\", monospace;\n    font-size: medium;\n    letter-spacing: 3px;\n    padding: 4px;\n  }\n  .content {\n    padding: 10px;\n  }\n  body.dark {\n    background-color: #242424;\n    color: #666;\n  }\n  .dark .shortcut {\n    color: #777;\n  }\n  .dark a {\n    color: #3b99fc;\n  }\n  input[type=checkbox] {\n    vertical-align: middle;\n  }\n</style>\n</head>\n<body>\n  <div class=\"content\">\n    <label for=\"dark\">\n      <input type=\"checkbox\" id=\"dark\" onclick=\"Page.toggleDarkTheme()\"> Dark Theme\n    </label>\n    <label for=\"maintain-priority\">\n      <input type=\"checkbox\" id=\"maintain-priority\" onclick=\"Page.togglePriorityMaintenance()\"> Maintain Priority\n    </label>\n    <p>\n      React Native JS code runs as a web worker inside this tab.\n    </p>\n    <p>Press <kbd id=\"shortcut\" class=\"shortcut\">⌘⌥I</kbd> to open Developer Tools. Enable <a href=\"https://stackoverflow.com/a/17324511/232122\" target=\"_blank\">Pause On Caught Exceptions</a> for a better debugging experience.</p>\n    <p>You may also install <a href=\"https://github.com/facebook/react-devtools/tree/master/packages/react-devtools\" target=\"_blank\">the standalone version of React Developer Tools</a> to inspect the React component hierarchy, their props, and state.</p>\n    <p>Status: <span id=\"status\">Loading...</span></p>\n  </div>\n  <audio id=\"silence\" loop src=\"data:audio/wav;base64,UklGRmxsAQBXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhiFgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8AEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////////////////7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/d/93/3f/d/93/3f/d/93/3f/d/93/3f/d/93/3f/d/93/3f/d/93/3f/d/93/3f/d/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/93/3f/d/93/3f/d/93/3f/d/93/3f/d/93/3f/d/93/3f/d/93/3f/d/93/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/3//f/9//3//f/9//3//f/9//3//f/9//3//f/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+//7//v/+//7//v/+//7//v/+//7//v/+//8//z//P/8//z//P/8//z//P/8//z//P/8//z//f/9//3//f/9//3//f/9//3//f/9//3//f/9//7//v/+//7//v/+//7//v/+//7//v/+//7//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAsACwALAAsACwALAAsACwALAAsACwALAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8AEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAARABEAEQARABEAEQARABEAEQARABEAEQARABEAEgASABIAEgASABIAEgASABIAEgASABIAEgATABMAEwATABMAEwATABMAEwATABMAEwATABMAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACIAIgAiACIAIgAiACIAIgAiACIAIgAiACIAIgAiACIAIwAjACMAIwAjACMAIwAjACMAIwAjACMAIwAjACMAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAvAC8ALwAvAC8ALwAvAC8ALwAvAC8ALwAvAC8ALwAvAC8ALwAvAC8ALwAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMgAyADIAMgAyADIAMgAyADIAMgAyADIAMgAyADIAMgAyADIAMgAyADIAMgAyADMAMwAzADMAMwAzADMAMwAzADMAMwAzADMAMwAzADMAMwAzADMAMwAzADMAMwAzADMANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQAMwAzADMAMwAzADMAMwAzADMAMwAzADMAMwAzADMAMwAzADMAMwAzADMAMwAzADIAMgAyADIAMgAyADIAMgAyADIAMgAyADIAMgAyADIAMgAyADIAMgAyADIAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALwAvAC8ALwAvAC8ALwAvAC8ALwAvAC8ALwAvAC8ALwAvAC8ALwAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACMAIwAjACMAIwAjACMAIwAjACMAIwAjACMAIwAiACIAIgAiACIAIgAiACIAIgAiACIAIgAiACIAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAcABwAHAAcABwAHAAcABwAHAAcABwAHAAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGAAYABgAGAAYABgAGAAYABgAGAAYABgAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAWABYAFgAWABYAFgAWABYAFgAWABYAFgAVABUAFQAVABUAFQAVABUAFQAVABUAFQAUABQAFAAUABQAFAAUABQAFAAUABQAEwATABMAEwATABMAEwATABMAEwATABMAEgASABIAEgASABIAEgASABIAEgASABIAEQARABEAEQARABEAEQARABEAEQARABAAEAAQABAAEAAQABAAEAAQABAAEAAQAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgANAA0ADQANAA0ADQANAA0ADQANAA0ADAAMAAwADAAMAAwADAAMAAwADAAMAAsACwALAAsACwALAAsACwALAAsACwALAAoACgAKAAoACgAKAAoACgAKAAoACgAJAAkACQAJAAkACQAJAAkACQAJAAkACAAIAAgACAAIAAgACAAIAAgACAAIAAcABwAHAAcABwAHAAcABwAHAAcABwAGAAYABgAGAAYABgAGAAYABgAGAAYABQAFAAUABQAFAAUABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAEAAQABAADAAMAAwADAAMAAwADAAMAAwADAAIAAgACAAIAAgACAAIAAgACAAIAAgABAAEAAQABAAEAAQABAAEAAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////+//7//v/+//7//v/+//7//v/+//3//f/9//3//f/9//3//f/9//3//f/8//z//P/8//z//P/8//z//P/8//z/+//7//v/+//7//v/+//7//v/+//7//r/+v/6//r/+v/6//r/+v/6//r/+f/5//n/+f/5//n/+f/5//n/+f/5//j/+P/4//j/+P/4//j/+P/4//j/+P/3//f/9//3//f/9//3//f/9//3//b/9v/2//b/9v/2//b/9v/2//b/9v/1//X/9f/1//X/9f/1//X/9f/1//X/9P/0//T/9P/0//T/9P/0//T/9P/0//P/8//z//P/8//z//P/8//z//P/8v/y//L/8v/y//L/8v/y//L/8v/y//H/8f/x//H/8f/x//H/8f/x//H/8f/w//D/8P/w//D/8P/w//D/8P/w//D/7//v/+//7//v/+//7//v/+//7//u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/r/+v/6//r/+v/6//r/+v/6//r/+v/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/5//n/+f/5//n/+f/5//n/+f/5//n/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/3//f/9//3//f/9//3//f/9//3//f/9//3v/e/97/3v/e/97/3v/e/97/3v/e/93/3f/d/93/3f/d/93/3f/d/93/3f/d/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/R/9H/0f/R/9H/0f/R/9H/0f/R/9H/0f/R/9H/0P/Q/9D/0P/Q/9D/0P/Q/9D/0P/Q/9D/0P/P/8//z//P/8//z//P/8//z//P/8//z//P/8//zv/O/87/zv/O/87/zv/O/87/zv/O/87/zv/O/83/zf/N/83/zf/N/83/zf/N/83/zf/N/83/zf/N/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/E/8T/xP/E/8T/xP/E/8T/xP/E/8T/xP/E/8T/xP/E/8T/xP/D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8L/wv/C/8L/wv/C/8L/wv/C/8L/wv/C/8L/wv/C/8L/wv/C/8L/wv/B/8H/wf/B/8H/wf/B/8H/wf/B/8H/wf/B/8H/wf/B/8H/wf/B/8H/wf/A/8D/wP/A/8D/wP/A/8D/wP/A/8D/wP/A/8D/wP/A/8D/wP/A/8D/wP/A/7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/++/77/vv++/77/vv++/77/vv++/77/vv++/77/vv++/77/vv++/77/vv++/77/vv++/77/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+9/73/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf++/77/vv++/77/vv++/77/vv++/77/vv++/77/vv++/77/vv++/77/vv++/77/vv++/7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v//A/8D/wP/A/8D/wP/A/8D/wP/A/8D/wP/A/8D/wP/A/8D/wP/A/8D/wP/B/8H/wf/B/8H/wf/B/8H/wf/B/8H/wf/B/8H/wf/B/8H/wf/B/8H/wv/C/8L/wv/C/8L/wv/C/8L/wv/C/8L/wv/C/8L/wv/C/8L/wv/D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//E/8T/xP/E/8T/xP/E/8T/xP/E/8T/xP/E/8T/xP/E/8T/xP/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/83/zf/N/83/zf/N/83/zf/N/83/zf/N/83/zv/O/87/zv/O/87/zv/O/87/zv/O/87/zv/P/8//z//P/8//z//P/8//z//P/8//z//P/9D/0P/Q/9D/0P/Q/9D/0P/Q/9D/0P/Q/9D/0f/R/9H/0f/R/9H/0f/R/9H/0f/R/9H/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/T/9P/0//T/9P/0//T/9P/0//T/9P/0//U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1//X/9f/1//X/9f/1//X/9f/1//X/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2//b/9v/2//b/9v/2//b/9v/2//b/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/d/93/3f/d/93/3f/d/93/3f/d/97/3v/e/97/3v/e/97/3v/e/97/3v/f/9//3//f/9//3//f/9//3//f/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/h/+H/4f/h/+H/4f/h/+H/4f/h/+L/4v/i/+L/4v/i/+L/4v/i/+L/4//j/+P/4//j/+P/4//j/+P/4//j/+T/5P/k/+T/5P/k/+T/5P/k/+T/5f/l/+X/5f/l/+X/5f/l/+X/5f/m/+b/5v/m/+b/5v/m/+b/5v/m/+f/5//n/+f/5//n/+f/5//n/+j/6P/o/+j/6P/o/+j/6P/o/+j/6f/p/+n/6f/p/+n/6f/p/+n/6f/q/+r/6v/q/+r/6v/q/+r/6v/q/+v/6//r/+v/6//r/+v/6//r/+z/7P/s/+z/7P/s/+z/7P/s/+z/7f/t/+3/7f/t/+3/7f/t/+3/7v/u/+7/7v/u/+7/7v/u/+7/7v/v/+//7//v/+//7//v/+//7//w//D/8P/w//D/8P/w//D/8P/w//H/8f/x//H/8f/x//H/8f/x//L/8v/y//L/8v/y//L/8v/y//P/8//z//P/8//z//P/8//z//P/9P/0//T/9P/0//T/9P/0//T/9f/1//X/9f/1//X/9f/1//X/9v/2//b/9v/2//b/9v/2//b/9//3//f/9//3//f/9//3//f/+P/4//j/+P/4//j/+P/4//j/+P/5//n/+f/5//n/+f/5//n/+f/6//r/+v/6//r/+v/6//r/+v/7//v/+//7//v/+//7//v/+//8//z//P/8//z//P/8//z//P/9//3//f/9//3//f/9//3//f/+//7//v/+//7//v/+//7//v////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQACAAIAAgACAAIAAgACAAIAAgADAAMAAwADAAMAAwADAAMAAwAEAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAGAAYABgAGAAYABgAGAAYABgAHAAcABwAHAAcABwAHAAcABwAIAAgACAAIAAgACAAIAAgACAAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgALAAsACwALAAsACwALAAsADAAMAAwADAAMAAwADAAMAAwADQANAA0ADQANAA0ADQANAA0ADgAOAA4ADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8AEAAQABAAEAAQABAAEAAQABAAEQARABEAEQARABEAEQARABEAEgASABIAEgASABIAEgASABIAEwATABMAEwATABMAEwATABMAFAAUABQAFAAUABQAFAAUABQAFQAVABUAFQAVABUAFQAVABUAFgAWABYAFgAWABYAFgAWABYAFgAXABcAFwAXABcAFwAXABcAFwAYABgAGAAYABgAGAAYABgAGAAZABkAGQAZABkAGQAZABkAGQAaABoAGgAaABoAGgAaABoAGgAbABsAGwAbABsAGwAbABsAGwAcABwAHAAcABwAHAAcABwAHAAcAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB8AHwAfAB8AHwAfAB8AHwAfACAAIAAgACAAIAAgACAAIAAgACAAIQAhACEAIQAhACEAIQAhACEAIgAiACIAIgAiACIAIgAiACIAIgAjACMAIwAjACMAIwAjACMAIwAkACQAJAAkACQAJAAkACQAJAAkACUAJQAlACUAJQAlACUAJQAlACUAJgAmACYAJgAmACYAJgAmACYAJwAnACcAJwAnACcAJwAnACcAJwAoACgAKAAoACgAKAAoACgAKAAoACkAKQApACkAKQApACkAKQApACkAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArACsAKwArACsAKwArACwALAAsACwALAAsACwALAAsACwALQAtAC0ALQAtAC0ALQAtAC0ALQAuAC4ALgAuAC4ALgAuAC4ALgAuAC8ALwAvAC8ALwAvAC8ALwAvAC8AMAAwADAAMAAwADAAMAAwADAAMAAwADEAMQAxADEAMQAxADEAMQAxADEAMgAyADIAMgAyADIAMgAyADIAMgAyADMAMwAzADMAMwAzADMAMwAzADMAMwA0ADQANAA0ADQANAA0ADQANAA0ADQANQA1ADUANQA1ADUANQA1ADUANQA2ADYANgA2ADYANgA2ADYANgA2ADYANgA3ADcANwA3ADcANwA3ADcANwA3ADcAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD4APgA+AD4APgA+AD4APgA+AD4APgA+AD8APwA/AD8APwA/AD8APwA/AD8APwA/AD8AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASQBJAEkASQBJAEkASQBJAEkASQBJAEkASQBJAEkASQBKAEoASgBKAEoASgBKAEoASgBKAEoASgBKAEoASgBKAEoASgBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBOAE4ATgBOAE4ATgBOAE4ATgBOAE4ATgBOAE4ATgBOAE4ATgBOAE4ATgBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATgBOAE4ATgBOAE4ATgBOAE4ATgBOAE4ATgBOAE4ATgBOAE4ATgBOAE4ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBKAEoASgBKAEoASgBKAEoASgBKAEoASgBKAEoASgBKAEoASQBJAEkASQBJAEkASQBJAEkASQBJAEkASQBJAEkASQBIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARABEAEQARABEAEQARABEAEQARABEAEQARABDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBAAEAAQABAAEAAQABAAEAAQABAAEAAQAA/AD8APwA/AD8APwA/AD8APwA/AD8APwA/AD4APgA+AD4APgA+AD4APgA+AD4APgA9AD0APQA9AD0APQA9AD0APQA9AD0APQA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA4ADgAOAA4ADgAOAA4ADgAOAA4ADcANwA3ADcANwA3ADcANwA3ADcANwA2ADYANgA2ADYANgA2ADYANgA2ADUANQA1ADUANQA1ADUANQA1ADUANAA0ADQANAA0ADQANAA0ADQANAA0ADMAMwAzADMAMwAzADMAMwAzADMAMgAyADIAMgAyADIAMgAyADIAMgAxADEAMQAxADEAMQAxADEAMQAwADAAMAAwADAAMAAwADAAMAAwAC8ALwAvAC8ALwAvAC8ALwAvAC8ALgAuAC4ALgAuAC4ALgAuAC4ALQAtAC0ALQAtAC0ALQAtAC0ALQAsACwALAAsACwALAAsACwALAArACsAKwArACsAKwArACsAKwAqACoAKgAqACoAKgAqACoAKgApACkAKQApACkAKQApACkAKQAoACgAKAAoACgAKAAoACgAKAAnACcAJwAnACcAJwAnACcAJwAmACYAJgAmACYAJgAmACYAJgAlACUAJQAlACUAJQAlACUAJQAkACQAJAAkACQAJAAkACQAJAAjACMAIwAjACMAIwAjACMAIwAiACIAIgAiACIAIgAiACIAIQAhACEAIQAhACEAIQAhACEAIAAgACAAIAAgACAAIAAgAB8AHwAfAB8AHwAfAB8AHwAfAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAcABwAHAAcABwAHAAcABwAGwAbABsAGwAbABsAGwAbABoAGgAaABoAGgAaABoAGgAaABkAGQAZABkAGQAZABkAGQAYABgAGAAYABgAGAAYABgAFwAXABcAFwAXABcAFwAXABYAFgAWABYAFgAWABYAFgAVABUAFQAVABUAFQAVABUAFAAUABQAFAAUABQAFAAUABQAEwATABMAEwATABMAEwATABIAEgASABIAEgASABIAEgARABEAEQARABEAEQARABEAEAAQABAAEAAQABAAEAAQAA8ADwAPAA8ADwAPAA8ADgAOAA4ADgAOAA4ADgAOAA0ADQANAA0ADQANAA0ADQAMAAwADAAMAAwADAAMAAwACwALAAsACwALAAsACwALAAoACgAKAAoACgAKAAoACgAJAAkACQAJAAkACQAJAAkACAAIAAgACAAIAAgACAAHAAcABwAHAAcABwAHAAcABgAGAAYABgAGAAYABgAGAAUABQAFAAUABQAFAAUABQAEAAQABAAEAAQABAAEAAMAAwADAAMAAwADAAMAAwACAAIAAgACAAIAAgACAAIAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAA//////////////////////7//v/+//7//v/+//7//v/9//3//f/9//3//f/9//z//P/8//z//P/8//z//P/7//v/+//7//v/+//7//v/+v/6//r/+v/6//r/+v/5//n/+f/5//n/+f/5//n/+P/4//j/+P/4//j/+P/4//f/9//3//f/9//3//f/9v/2//b/9v/2//b/9v/2//X/9f/1//X/9f/1//X/9f/0//T/9P/0//T/9P/0//T/8//z//P/8//z//P/8//y//L/8v/y//L/8v/y//L/8f/x//H/8f/x//H/8f/x//D/8P/w//D/8P/w//D/7//v/+//7//v/+//7//v/+7/7v/u/+7/7v/u/+7/7v/t/+3/7f/t/+3/7f/t/+z/7P/s/+z/7P/s/+z/7P/r/+v/6//r/+v/6//r/+v/6v/q/+r/6v/q/+r/6v/q/+n/6f/p/+n/6f/p/+n/6P/o/+j/6P/o/+j/6P/o/+f/5//n/+f/5//n/+f/5//m/+b/5v/m/+b/5v/m/+b/5f/l/+X/5f/l/+X/5f/l/+T/5P/k/+T/5P/k/+T/5P/j/+P/4//j/+P/4//j/+P/4v/i/+L/4v/i/+L/4v/h/+H/4f/h/+H/4f/h/+H/4P/g/+D/4P/g/+D/4P/g/9//3//f/9//3//f/9//3//e/97/3v/e/97/3v/e/97/3f/d/93/3f/d/93/3f/d/9z/3P/c/9z/3P/c/9z/3P/b/9v/2//b/9v/2//b/9v/2v/a/9r/2v/a/9r/2v/a/9r/2f/Z/9n/2f/Z/9n/2f/Z/9j/2P/Y/9j/2P/Y/9j/2P/X/9f/1//X/9f/1//X/9f/1v/W/9b/1v/W/9b/1v/W/9X/1f/V/9X/1f/V/9X/1f/V/9T/1P/U/9T/1P/U/9T/1P/T/9P/0//T/9P/0//T/9P/0//S/9L/0v/S/9L/0v/S/9L/0f/R/9H/0f/R/9H/0f/R/9D/0P/Q/9D/0P/Q/9D/0P/Q/8//z//P/8//z//P/8//z//P/87/zv/O/87/zv/O/87/zv/N/83/zf/N/83/zf/N/83/zf/M/8z/zP/M/8z/zP/M/8z/zP/L/8v/y//L/8v/y//L/8v/y//K/8r/yv/K/8r/yv/K/8r/yf/J/8n/yf/J/8n/yf/J/8n/yP/I/8j/yP/I/8j/yP/I/8j/x//H/8f/x//H/8f/x//H/8f/x//G/8b/xv/G/8b/xv/G/8b/xv/F/8X/xf/F/8X/xf/F/8X/xf/E/8T/xP/E/8T/xP/E/8T/xP/D/8P/w//D/8P/w//D/8P/w//D/8L/wv/C/8L/wv/C/8L/wv/C/8H/wf/B/8H/wf/B/8H/wf/B/8H/wP/A/8D/wP/A/8D/wP/A/8D/wP+//7//v/+//7//v/+//7//v/+//77/vv++/77/vv++/77/vv++/77/vf+9/73/vf+9/73/vf+9/73/vf+8/7z/vP+8/7z/vP+8/7z/vP+8/7v/u/+7/7v/u/+7/7v/u/+7/7v/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7b/tv+2/7b/tv+2/7b/tv+2/7b/tv+1/7X/tf+1/7X/tf+1/7X/tf+1/7X/tP+0/7T/tP+0/7T/tP+0/7T/tP+0/7T/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/sv+y/7L/sv+y/7L/sv+y/7L/sv+y/7L/sf+x/7H/sf+x/7H/sf+x/7H/sf+x/7H/sP+w/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6r/qv+q/6r/qv+q/6r/qv+q/6r/qv+q/6r/qv+q/6n/qf+p/6n/qf+p/6n/qf+p/6n/qf+p/6n/qf+p/6n/qP+o/6j/qP+o/6j/qP+o/6j/qP+o/6j/qP+o/6j/qP+o/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+m/6b/pv+m/6b/pv+m/6b/pv+m/6b/pv+m/6b/pv+m/6b/pv+m/6X/pf+l/6X/pf+l/6X/pf+l/6X/pf+l/6X/pf+l/6X/pf+l/6X/pf+k/6T/pP+k/6T/pP+k/6T/pP+k/6T/pP+k/6T/pP+k/6T/pP+k/6T/pP+k/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+i/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/57/n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+k/6T/pP+k/6T/pP+k/6T/pP+k/6T/pP+k/6T/pP+k/6T/pP+k/6T/pP+l/6X/pf+l/6X/pf+l/6X/pf+l/6X/pf+l/6X/pf+l/6X/pf+l/6b/pv+m/6b/pv+m/6b/pv+m/6b/pv+m/6b/pv+m/6b/pv+m/6b/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6j/qP+o/6j/qP+o/6j/qP+o/6j/qP+o/6j/qP+o/6j/qf+p/6n/qf+p/6n/qf+p/6n/qf+p/6n/qf+p/6n/qf+q/6r/qv+q/6r/qv+q/6r/qv+q/6r/qv+q/6r/qv+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+w/7H/sf+x/7H/sf+x/7H/sf+x/7H/sf+x/7L/sv+y/7L/sv+y/7L/sv+y/7L/sv+y/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+0/7T/tP+0/7T/tP+0/7T/tP+0/7T/tP+1/7X/tf+1/7X/tf+1/7X/tf+1/7X/tv+2/7b/tv+2/7b/tv+2/7b/tv+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/uP+4/7j/uP+4/7j/uP+4/7j/uP+5/7n/uf+5/7n/uf+5/7n/uf+5/7r/uv+6/7r/uv+6/7r/uv+6/7r/u/+7/7v/u/+7/7v/u/+7/7v/u/+8/7z/vP+8/7z/vP+8/7z/vP+8/73/vf+9/73/vf+9/73/vf+9/73/vv++/77/vv++/77/vv++/77/v/+//7//v/+//7//v/+//7//v//A/8D/wP/A/8D/wP/A/8D/wP/B/8H/wf/B/8H/wf/B/8H/wf/C/8L/wv/C/8L/wv/C/8L/wv/D/8P/w//D/8P/w//D/8P/w//E/8T/xP/E/8T/xP/E/8T/xP/F/8X/xf/F/8X/xf/F/8X/xf/G/8b/xv/G/8b/xv/G/8b/x//H/8f/x//H/8f/x//H/8f/yP/I/8j/yP/I/8j/yP/I/8n/yf/J/8n/yf/J/8n/yf/J/8r/yv/K/8r/yv/K/8r/yv/L/8v/y//L/8v/y//L/8v/zP/M/8z/zP/M/8z/zP/M/8z/zf/N/83/zf/N/83/zf/N/87/zv/O/87/zv/O/87/zv/P/8//z//P/8//z//P/8//0P/Q/9D/0P/Q/9D/0P/Q/9H/0f/R/9H/0f/R/9H/0f/S/9L/0v/S/9L/0v/S/9L/0//T/9P/0//T/9P/0//U/9T/1P/U/9T/1P/U/9T/1f/V/9X/1f/V/9X/1f/V/9b/1v/W/9b/1v/W/9b/1v/X/9f/1//X/9f/1//X/9j/2P/Y/9j/2P/Y/9j/2P/Z/9n/2f/Z/9n/2f/Z/9r/2v/a/9r/2v/a/9r/2v/b/9v/2//b/9v/2//b/9z/3P/c/9z/3P/c/9z/3P/d/93/3f/d/93/3f/d/97/3v/e/97/3v/e/97/3//f/9//3//f/9//3//f/+D/4P/g/+D/4P/g/+D/4f/h/+H/4f/h/+H/4f/i/+L/4v/i/+L/4v/i/+P/4//j/+P/4//j/+P/4//k/+T/5P/k/+T/5P/k/+X/5f/l/+X/5f/l/+X/5v/m/+b/5v/m/+b/5v/n/+f/5//n/+f/5//n/+j/6P/o/+j/6P/o/+j/6f/p/+n/6f/p/+n/6f/q/+r/6v/q/+r/6v/q/+v/6//r/+v/6//r/+v/7P/s/+z/7P/s/+z/7P/t/+3/7f/t/+3/7f/t/+7/7v/u/+7/7v/u/+7/7//v/+//7//v/+//7//w//D/8P/w//D/8P/w//H/8f/x//H/8f/x//H/8v/y//L/8v/y//L/8v/z//P/8//z//P/8//z//T/9P/0//T/9P/0//X/9f/1//X/9f/1//X/9v/2//b/9v/2//b/9v/3//f/9//3//f/9//3//j/+P/4//j/+P/4//j/+f/5//n/+f/5//n/+f/6//r/+v/6//r/+v/7//v/+//7//v/+//7//z//P/8//z//P/8//z//f/9//3//f/9//3//f/+//7//v/+//7//v///////////////////wAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQACAAIAAgACAAIAAgADAAMAAwADAAMAAwADAAQABAAEAAQABAAEAAQABQAFAAUABQAFAAUABQAGAAYABgAGAAYABgAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACQAJAAkACQAJAAkACgAKAAoACgAKAAoACgALAAsACwALAAsACwALAAwADAAMAAwADAAMAAwADQANAA0ADQANAA0ADgAOAA4ADgAOAA4ADgAPAA8ADwAPAA8ADwAPABAAEAAQABAAEAAQABAAEQARABEAEQARABEAEgASABIAEgASABIAEgATABMAEwATABMAEwATABQAFAAUABQAFAAUABQAFQAVABUAFQAVABUAFgAWABYAFgAWABYAFgAXABcAFwAXABcAFwAXABgAGAAYABgAGAAYABgAGQAZABkAGQAZABkAGQAaABoAGgAaABoAGgAbABsAGwAbABsAGwAbABwAHAAcABwAHAAcABwAHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB8AHwAfAB8AHwAfAB8AIAAgACAAIAAgACAAIAAhACEAIQAhACEAIQAiACIAIgAiACIAIgAiACMAIwAjACMAIwAjACMAJAAkACQAJAAkACQAJAAlACUAJQAlACUAJQAlACYAJgAmACYAJgAmACYAJwAnACcAJwAnACcAJwAoACgAKAAoACgAKAAoACkAKQApACkAKQApACkAKQAqACoAKgAqACoAKgAqACsAKwArACsAKwArACsALAAsACwALAAsACwALAAtAC0ALQAtAC0ALQAtAC4ALgAuAC4ALgAuAC4ALwAvAC8ALwAvAC8ALwAvADAAMAAwADAAMAAwADAAMQAxADEAMQAxADEAMQAyADIAMgAyADIAMgAyADIAMwAzADMAMwAzADMAMwA0ADQANAA0ADQANAA0ADUANQA1ADUANQA1ADUANQA2ADYANgA2ADYANgA2ADcANwA3ADcANwA3ADcANwA4ADgAOAA4ADgAOAA4ADkAOQA5ADkAOQA5ADkAOQA6ADoAOgA6ADoAOgA6ADoAOwA7ADsAOwA7ADsAOwA8ADwAPAA8ADwAPAA8ADwAPQA9AD0APQA9AD0APQA9AD4APgA+AD4APgA+AD4APgA/AD8APwA/AD8APwA/AD8AQABAAEAAQABAAEAAQABAAEEAQQBBAEEAQQBBAEEAQQBCAEIAQgBCAEIAQgBCAEIAQwBDAEMAQwBDAEMAQwBDAEQARABEAEQARABEAEQARABFAEUARQBFAEUARQBFAEUARQBGAEYARgBGAEYARgBGAEYARwBHAEcARwBHAEcARwBHAEgASABIAEgASABIAEgASABIAEkASQBJAEkASQBJAEkASQBJAEoASgBKAEoASgBKAEoASgBLAEsASwBLAEsASwBLAEsASwBMAEwATABMAEwATABMAEwATABNAE0ATQBNAE0ATQBNAE0ATQBOAE4ATgBOAE4ATgBOAE4ATgBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUABQAFEAUQBRAFEAUQBRAFEAUQBRAFIAUgBSAFIAUgBSAFIAUgBSAFIAUwBTAFMAUwBTAFMAUwBTAFMAUwBUAFQAVABUAFQAVABUAFQAVABUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVgBWAFYAVgBWAFYAVgBWAFYAVgBXAFcAVwBXAFcAVwBXAFcAVwBXAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFsAWwBbAFsAWwBbAFsAWwBbAFsAWwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABdAF0AXQBdAF0AXQBdAF0AXQBdAF0AXQBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGMAYwBjAGMAYwBjAGMAYwBjAGMAYwBjAGMAYwBjAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGUAZQBlAGUAZQBlAGUAZQBlAGUAZQBlAGUAZQBlAGYAZgBmAGYAZgBmAGYAZgBmAGYAZgBmAGYAZgBmAGYAZgBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABpAGkAaQBpAGkAaQBpAGkAaQBpAGkAaQBpAGkAaQBpAGkAaQBpAGkAagBqAGoAagBqAGoAagBqAGoAagBqAGoAagBqAGoAagBqAGoAagBqAGoAagBrAGsAawBrAGsAawBrAGsAawBrAGsAawBrAGsAawBrAGsAawBrAGsAawBrAGsAawBrAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAawBrAGsAawBrAGsAawBrAGsAawBrAGsAawBrAGsAawBrAGsAawBrAGsAawBrAGsAawBqAGoAagBqAGoAagBqAGoAagBqAGoAagBqAGoAagBqAGoAagBqAGoAagBqAGkAaQBpAGkAaQBpAGkAaQBpAGkAaQBpAGkAaQBpAGkAaQBpAGkAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZgBmAGYAZgBmAGYAZgBmAGYAZgBmAGYAZgBmAGYAZgBlAGUAZQBlAGUAZQBlAGUAZQBlAGUAZQBlAGUAZQBkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABjAGMAYwBjAGMAYwBjAGMAYwBjAGMAYwBjAGMAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYABgAGAAYABgAGAAYABgAGAAYABgAGAAXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXQBdAF0AXQBdAF0AXQBdAF0AXQBdAF0AXABcAFwAXABcAFwAXABcAFwAXABcAFsAWwBbAFsAWwBbAFsAWwBbAFsAWwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWQBZAFkAWQBZAFkAWQBZAFkAWQBYAFgAWABYAFgAWABYAFgAWABYAFcAVwBXAFcAVwBXAFcAVwBXAFcAVgBWAFYAVgBWAFYAVgBWAFYAVgBVAFUAVQBVAFUAVQBVAFUAVQBVAFQAVABUAFQAVABUAFQAVABUAFQAUwBTAFMAUwBTAFMAUwBTAFMAUgBSAFIAUgBSAFIAUgBSAFIAUQBRAFEAUQBRAFEAUQBRAFEAUABQAFAAUABQAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATgBOAE4ATgBOAE4ATgBOAE4ATQBNAE0ATQBNAE0ATQBNAEwATABMAEwATABMAEwATABMAEsASwBLAEsASwBLAEsASwBKAEoASgBKAEoASgBKAEoASgBJAEkASQBJAEkASQBJAEkASABIAEgASABIAEgASABIAEcARwBHAEcARwBHAEcARwBGAEYARgBGAEYARgBGAEYARQBFAEUARQBFAEUARQBFAEQARABEAEQARABEAEQARABDAEMAQwBDAEMAQwBDAEMAQgBCAEIAQgBCAEIAQgBBAEEAQQBBAEEAQQBBAEEAQABAAEAAQABAAEAAQABAAD8APwA/AD8APwA/AD8APgA+AD4APgA+AD4APgA+AD0APQA9AD0APQA9AD0APAA8ADwAPAA8ADwAPAA7ADsAOwA7ADsAOwA7ADsAOgA6ADoAOgA6ADoAOgA5ADkAOQA5ADkAOQA5ADgAOAA4ADgAOAA4ADgANwA3ADcANwA3ADcANwA2ADYANgA2ADYANgA2ADUANQA1ADUANQA1ADUANAA0ADQANAA0ADQANAAzADMAMwAzADMAMwAzADIAMgAyADIAMgAyADIAMQAxADEAMQAxADEAMQAwADAAMAAwADAAMAAwAC8ALwAvAC8ALwAvAC4ALgAuAC4ALgAuAC4ALQAtAC0ALQAtAC0ALQAsACwALAAsACwALAArACsAKwArACsAKwArACoAKgAqACoAKgAqACoAKQApACkAKQApACkAKAAoACgAKAAoACgAKAAnACcAJwAnACcAJwAmACYAJgAmACYAJgAmACUAJQAlACUAJQAlACQAJAAkACQAJAAkACQAIwAjACMAIwAjACMAIgAiACIAIgAiACIAIgAhACEAIQAhACEAIQAgACAAIAAgACAAIAAfAB8AHwAfAB8AHwAfAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdABwAHAAcABwAHAAcABwAGwAbABsAGwAbABsAGgAaABoAGgAaABoAGQAZABkAGQAZABkAGAAYABgAGAAYABgAGAAXABcAFwAXABcAFwAWABYAFgAWABYAFgAVABUAFQAVABUAFQAUABQAFAAUABQAFAATABMAEwATABMAEwATABIAEgASABIAEgASABEAEQARABEAEQARABAAEAAQABAAEAAQAA8ADwAPAA8ADwAPAA4ADgAOAA4ADgAOAA0ADQANAA0ADQANAAwADAAMAAwADAAMAAsACwALAAsACwALAAoACgAKAAoACgAKAAkACQAJAAkACQAJAAgACAAIAAgACAAIAAcABwAHAAcABwAHAAYABgAGAAYABgAGAAUABQAFAAUABQAFAAQABAAEAAQABAAEAAMAAwADAAMAAwADAAMAAgACAAIAAgACAAIAAQABAAEAAQABAAEAAAAAAAAAAAAAAP////////////////7//v/+//7//v/+//3//f/9//3//f/9//z//P/8//z//P/8//v/+//7//v/+//7//r/+v/6//r/+v/6//n/+f/5//n/+f/5//j/+P/4//j/+P/4//f/9//3//f/9//3//b/9v/2//b/9v/2//X/9f/1//X/9f/1//T/9P/0//T/9P/0//P/8//z//P/8//z//L/8v/y//L/8v/y//H/8f/x//H/8f/x//D/8P/w//D/8P/w/+//7//v/+//7//v/+7/7v/u/+7/7v/u/+3/7f/t/+3/7f/t/+z/7P/s/+z/7P/s/+v/6//r/+v/6//r/+r/6v/q/+r/6v/q/+n/6f/p/+n/6f/p/+j/6P/o/+j/6P/o/+f/5//n/+f/5//n/+b/5v/m/+b/5v/m/+X/5f/l/+X/5f/l/+T/5P/k/+T/5P/k/+T/4//j/+P/4//j/+P/4v/i/+L/4v/i/+L/4f/h/+H/4f/h/+H/4P/g/+D/4P/g/+D/3//f/9//3//f/9//3v/e/97/3v/e/97/3f/d/93/3f/d/93/3P/c/9z/3P/c/9z/2//b/9v/2//b/9v/2//a/9r/2v/a/9r/2v/Z/9n/2f/Z/9n/2f/Y/9j/2P/Y/9j/2P/X/9f/1//X/9f/1//W/9b/1v/W/9b/1v/W/9X/1f/V/9X/1f/V/9T/1P/U/9T/1P/U/9P/0//T/9P/0//T/9P/0v/S/9L/0v/S/9L/0f/R/9H/0f/R/9H/0P/Q/9D/0P/Q/9D/0P/P/8//z//P/8//z//O/87/zv/O/87/zv/N/83/zf/N/83/zf/N/8z/zP/M/8z/zP/M/8v/y//L/8v/y//L/8v/yv/K/8r/yv/K/8r/yf/J/8n/yf/J/8n/yf/I/8j/yP/I/8j/yP/H/8f/x//H/8f/x//H/8b/xv/G/8b/xv/G/8X/xf/F/8X/xf/F/8X/xP/E/8T/xP/E/8T/xP/D/8P/w//D/8P/w//C/8L/wv/C/8L/wv/C/8H/wf/B/8H/wf/B/8H/wP/A/8D/wP/A/8D/wP+//7//v/+//7//v/+//77/vv++/77/vv++/77/vf+9/73/vf+9/73/vP+8/7z/vP+8/7z/vP+7/7v/u/+7/7v/u/+7/7r/uv+6/7r/uv+6/7r/uf+5/7n/uf+5/7n/uf+5/7j/uP+4/7j/uP+4/7j/t/+3/7f/t/+3/7f/t/+2/7b/tv+2/7b/tv+2/7X/tf+1/7X/tf+1/7X/tP+0/7T/tP+0/7T/tP+0/7P/s/+z/7P/s/+z/7P/sv+y/7L/sv+y/7L/sv+y/7H/sf+x/7H/sf+x/7H/sP+w/7D/sP+w/7D/sP+w/6//r/+v/6//r/+v/6//r/+u/67/rv+u/67/rv+u/63/rf+t/63/rf+t/63/rf+s/6z/rP+s/6z/rP+s/6z/q/+r/6v/q/+r/6v/q/+r/6r/qv+q/6r/qv+q/6r/qv+p/6n/qf+p/6n/qf+p/6n/qP+o/6j/qP+o/6j/qP+o/6f/p/+n/6f/p/+n/6f/p/+n/6b/pv+m/6b/pv+m/6b/pv+l/6X/pf+l/6X/pf+l/6X/pf+k/6T/pP+k/6T/pP+k/6T/o/+j/6P/o/+j/6P/o/+j/6P/ov+i/6L/ov+i/6L/ov+i/6L/of+h/6H/of+h/6H/of+h/6H/oP+g/6D/oP+g/6D/oP+g/6D/n/+f/5//n/+f/5//n/+f/5//nv+e/57/nv+e/57/nv+e/57/nv+d/53/nf+d/53/nf+d/53/nf+c/5z/nP+c/5z/nP+c/5z/nP+c/5v/m/+b/5v/m/+b/5v/m/+b/5v/mv+a/5r/mv+a/5r/mv+a/5r/mv+Z/5n/mf+Z/5n/mf+Z/5n/mf+Z/5n/mP+Y/5j/mP+Y/5j/mP+Y/5j/mP+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/lv+W/5b/lv+W/5b/lv+W/5b/lv+W/5X/lf+V/5X/lf+V/5X/lf+V/5X/lf+V/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kP+Q/5D/kP+Q/5D/kP+Q/5D/kP+Q/5D/kP+Q/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+O/47/jv+O/47/jv+O/47/jv+O/47/jv+O/47/jv+N/43/jf+N/43/jf+N/43/jf+N/43/jf+N/43/jf+M/4z/jP+M/4z/jP+M/4z/jP+M/4z/jP+M/4z/jP+M/4z/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4r/iv+K/4r/iv+K/4r/iv+K/4r/iv+K/4r/iv+K/4r/iv+K/4r/if+J/4n/if+J/4n/if+J/4n/if+J/4n/if+J/4n/if+J/4n/if+J/4n/iP+I/4j/iP+I/4j/iP+I/4j/iP+I/4j/iP+I/4j/iP+I/4j/iP+I/4j/iP+I/4j/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4T/hP+E/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+F/4X/hf+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/hv+G/4b/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/iP+I/4j/iP+I/4j/iP+I/4j/iP+I/4j/iP+I/4j/iP+I/4j/iP+I/4j/iP+I/4j/if+J/4n/if+J/4n/if+J/4n/if+J/4n/if+J/4n/if+J/4n/if+J/4r/iv+K/4r/iv+K/4r/iv+K/4r/iv+K/4r/iv+K/4r/iv+K/4r/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/jP+M/4z/jP+M/4z/jP+M/4z/jP+M/4z/jP+M/4z/jP+N/43/jf+N/43/jf+N/43/jf+N/43/jf+N/43/jf+O/47/jv+O/47/jv+O/47/jv+O/47/jv+O/47/jv+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/5D/kP+Q/5D/kP+Q/5D/kP+Q/5D/kP+Q/5D/kP+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+V/5X/lf+V/5X/lf+V/5X/lf+V/5X/lv+W/5b/lv+W/5b/lv+W/5b/lv+W/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+Y/5j/mP+Y/5j/mP+Y/5j/mP+Y/5n/mf+Z/5n/mf+Z/5n/mf+Z/5n/mv+a/5r/mv+a/5r/mv+a/5r/mv+b/5v/m/+b/5v/m/+b/5v/m/+b/5z/nP+c/5z/nP+c/5z/nP+c/53/nf+d/53/nf+d/53/nf+d/57/nv+e/57/nv+e/57/nv+e/57/n/+f/5//n/+f/5//n/+f/5//oP+g/6D/oP+g/6D/oP+g/6H/of+h/6H/of+h/6H/of+h/6L/ov+i/6L/ov+i/6L/ov+i/6P/o/+j/6P/o/+j/6P/o/+k/6T/pP+k/6T/pP+k/6T/pP+l/6X/pf+l/6X/pf+l/6X/pv+m/6b/pv+m/6b/pv+m/6f/p/+n/6f/p/+n/6f/p/+o/6j/qP+o/6j/qP+o/6j/qf+p/6n/qf+p/6n/qf+p/6r/qv+q/6r/qv+q/6r/q/+r/6v/q/+r/6v/q/+r/6z/rP+s/6z/rP+s/6z/rP+t/63/rf+t/63/rf+t/67/rv+u/67/rv+u/67/rv+v/6//r/+v/6//r/+v/7D/sP+w/7D/sP+w/7D/sf+x/7H/sf+x/7H/sf+y/7L/sv+y/7L/sv+y/7L/s/+z/7P/s/+z/7P/s/+0/7T/tP+0/7T/tP+0/7X/tf+1/7X/tf+1/7X/tv+2/7b/tv+2/7b/tv+3/7f/t/+3/7f/t/+4/7j/uP+4/7j/uP+4/7n/uf+5/7n/uf+5/7n/uv+6/7r/uv+6/7r/uv+7/7v/u/+7/7v/u/+8/7z/vP+8/7z/vP+8/73/vf+9/73/vf+9/73/vv++/77/vv++/77/v/+//7//v/+//7//v//A/8D/wP/A/8D/wP/B/8H/wf/B/8H/wf/C/8L/wv/C/8L/wv/C/8P/w//D/8P/w//D/8T/xP/E/8T/xP/E/8X/xf/F/8X/xf/F/8X/xv/G/8b/xv/G/8b/x//H/8f/x//H/8f/yP/I/8j/yP/I/8j/yf/J/8n/yf/J/8n/yf/K/8r/yv/K/8r/yv/L/8v/y//L/8v/y//M/8z/zP/M/8z/zP/N/83/zf/N/83/zf/O/87/zv/O/87/zv/P/8//z//P/8//z//Q/9D/0P/Q/9D/0P/R/9H/0f/R/9H/0f/S/9L/0v/S/9L/0v/T/9P/0//T/9P/0//U/9T/1P/U/9T/1f/V/9X/1f/V/9X/1v/W/9b/1v/W/9b/1//X/9f/1//X/9f/2P/Y/9j/2P/Y/9j/2f/Z/9n/2f/Z/9n/2v/a/9r/2v/a/9v/2//b/9v/2//b/9z/3P/c/9z/3P/c/93/3f/d/93/3f/e/97/3v/e/97/3v/f/9//3//f/9//3//g/+D/4P/g/+D/4f/h/+H/4f/h/+H/4v/i/+L/4v/i/+L/4//j/+P/4//j/+T/5P/k/+T/5P/k/+X/5f/l/+X/5f/l/+b/5v/m/+b/5v/n/+f/5//n/+f/5//o/+j/6P/o/+j/6f/p/+n/6f/p/+n/6v/q/+r/6v/q/+v/6//r/+v/6//r/+z/7P/s/+z/7P/t/+3/7f/t/+3/7f/u/+7/7v/u/+7/7//v/+//7//v/+//8P/w//D/8P/w//H/8f/x//H/8f/x//L/8v/y//L/8v/z//P/8//z//P/8//0//T/9P/0//T/9f/1//X/9f/1//X/9v/2//b/9v/2//f/9//3//f/9//3//j/+P/4//j/+P/5//n/+f/5//n/+v/6//r/+v/6//r/+//7//v/+//7//z//P/8//z//P/8//3//f/9//3//f/+//7//v/+//7/////////////////AAAAAAAAAAAAAAEAAQABAAEAAQABAAIAAgACAAIAAgADAAMAAwADAAMABAAEAAQABAAEAAQABQAFAAUABQAFAAYABgAGAAYABgAGAAcABwAHAAcABwAIAAgACAAIAAgACQAJAAkACQAJAAkACgAKAAoACgAKAAsACwALAAsACwALAAwADAAMAAwADAANAA0ADQANAA0ADgAOAA4ADgAOAA4ADwAPAA8ADwAPABAAEAAQABAAEAAQABEAEQARABEAEQASABIAEgASABIAEgATABMAEwATABMAFAAUABQAFAAUABQAFQAVABUAFQAVABYAFgAWABYAFgAWABcAFwAXABcAFwAYABgAGAAYABgAGAAZABkAGQAZABkAGgAaABoAGgAaABoAGwAbABsAGwAbABsAHAAcABwAHAAcAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAfAB8AHwAfAB8AHwAgACAAIAAgACAAIAAhACEAIQAhACEAIgAiACIAIgAiACIAIwAjACMAIwAjACMAJAAkACQAJAAkACUAJQAlACUAJQAlACYAJgAmACYAJgAmACcAJwAnACcAJwAnACgAKAAoACgAKAApACkAKQApACkAKQAqACoAKgAqACoAKgArACsAKwArACsAKwAsACwALAAsACwALAAtAC0ALQAtAC0ALgAuAC4ALgAuAC4ALwAvAC8ALwAvAC8AMAAwADAAMAAwADAAMQAxADEAMQAxADEAMgAyADIAMgAyADIAMwAzADMAMwAzADMANAA0ADQANAA0ADQANQA1ADUANQA1ADUANgA2ADYANgA2ADYANwA3ADcANwA3ADcANwA4ADgAOAA4ADgAOAA5ADkAOQA5ADkAOQA6ADoAOgA6ADoAOgA7ADsAOwA7ADsAOwA8ADwAPAA8ADwAPAA8AD0APQA9AD0APQA9AD4APgA+AD4APgA+AD8APwA/AD8APwA/AD8AQABAAEAAQABAAEAAQQBBAEEAQQBBAEEAQQBCAEIAQgBCAEIAQgBDAEMAQwBDAEMAQwBDAEQARABEAEQARABEAEUARQBFAEUARQBFAEUARgBGAEYARgBGAEYARgBHAEcARwBHAEcARwBIAEgASABIAEgASABIAEkASQBJAEkASQBJAEkASgBKAEoASgBKAEoASgBLAEsASwBLAEsASwBLAEwATABMAEwATABMAEwATQBNAE0ATQBNAE0ATQBOAE4ATgBOAE4ATgBOAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABRAFEAUQBRAFEAUQBRAFEAUgBSAFIAUgBSAFIAUgBTAFMAUwBTAFMAUwBTAFQAVABUAFQAVABUAFQAVABVAFUAVQBVAFUAVQBVAFUAVgBWAFYAVgBWAFYAVgBXAFcAVwBXAFcAVwBXAFcAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWwBbAFsAWwBbAFsAWwBbAFwAXABcAFwAXABcAFwAXABdAF0AXQBdAF0AXQBdAF0AXQBeAF4AXgBeAF4AXgBeAF4AXwBfAF8AXwBfAF8AXwBfAF8AYABgAGAAYABgAGAAYABgAGAAYQBhAGEAYQBhAGEAYQBhAGEAYgBiAGIAYgBiAGIAYgBiAGIAYwBjAGMAYwBjAGMAYwBjAGMAZABkAGQAZABkAGQAZABkAGQAZQBlAGUAZQBlAGUAZQBlAGUAZQBmAGYAZgBmAGYAZgBmAGYAZgBmAGcAZwBnAGcAZwBnAGcAZwBnAGcAaABoAGgAaABoAGgAaABoAGgAaABpAGkAaQBpAGkAaQBpAGkAaQBpAGkAagBqAGoAagBqAGoAagBqAGoAagBrAGsAawBrAGsAawBrAGsAawBrAGsAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbQBtAG0AbQBtAG0AbQBtAG0AbQBtAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABxAHEAcQBxAHEAcQBxAHEAcQBxAHEAcQBxAHEAcgByAHIAcgByAHIAcgByAHIAcgByAHIAcgByAHMAcwBzAHMAcwBzAHMAcwBzAHMAcwBzAHMAcwBzAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB2AHYAdgB2AHYAdgB2AHYAdgB2AHYAdgB2AHYAdgB2AHYAdgB2AHcAdwB3AHcAdwB3AHcAdwB3AHcAdwB3AHcAdwB3AHcAdwB3AHcAdwB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHkAeQB5AHkAeQB5AHkAeQB5AHkAeQB5AHkAeQB5AHkAeQB5AHkAeQB5AHkAeQB5AHkAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHsAewB7AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAegB6AHoAeQB5AHkAeQB5AHkAeQB5AHkAeQB5AHkAeQB5AHkAeQB5AHkAeQB5AHkAeQB5AHkAeQB5AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB3AHcAdwB3AHcAdwB3AHcAdwB3AHcAdwB3AHcAdwB3AHcAdwB3AHcAdgB2AHYAdgB2AHYAdgB2AHYAdgB2AHYAdgB2AHYAdgB2AHYAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAcwBzAHMAcwBzAHMAcwBzAHMAcwBzAHMAcwBzAHMAcwByAHIAcgByAHIAcgByAHIAcgByAHIAcgByAHIAcQBxAHEAcQBxAHEAcQBxAHEAcQBxAHEAcQBxAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAbwBvAG8AbwBvAG8AbwBvAG8AbwBvAG8AbwBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBtAG0AbQBtAG0AbQBtAG0AbQBtAG0AbQBsAGwAbABsAGwAbABsAGwAbABsAGwAbABrAGsAawBrAGsAawBrAGsAawBrAGsAagBqAGoAagBqAGoAagBqAGoAagBqAGkAaQBpAGkAaQBpAGkAaQBpAGkAaQBoAGgAaABoAGgAaABoAGgAaABoAGgAZwBnAGcAZwBnAGcAZwBnAGcAZwBmAGYAZgBmAGYAZgBmAGYAZgBmAGUAZQBlAGUAZQBlAGUAZQBlAGUAZABkAGQAZABkAGQAZABkAGQAZABjAGMAYwBjAGMAYwBjAGMAYwBiAGIAYgBiAGIAYgBiAGIAYgBhAGEAYQBhAGEAYQBhAGEAYQBhAGAAYABgAGAAYABgAGAAYABgAF8AXwBfAF8AXwBfAF8AXwBfAF4AXgBeAF4AXgBeAF4AXgBeAF0AXQBdAF0AXQBdAF0AXQBcAFwAXABcAFwAXABcAFwAXABbAFsAWwBbAFsAWwBbAFsAWgBaAFoAWgBaAFoAWgBaAFoAWQBZAFkAWQBZAFkAWQBZAFgAWABYAFgAWABYAFgAWABXAFcAVwBXAFcAVwBXAFcAVgBWAFYAVgBWAFYAVgBWAFUAVQBVAFUAVQBVAFUAVQBUAFQAVABUAFQAVABUAFQAUwBTAFMAUwBTAFMAUwBTAFIAUgBSAFIAUgBSAFIAUQBRAFEAUQBRAFEAUQBRAFAAUABQAFAAUABQAFAAUABPAE8ATwBPAE8ATwBPAE4ATgBOAE4ATgBOAE4ATQBNAE0ATQBNAE0ATQBNAEwATABMAEwATABMAEwASwBLAEsASwBLAEsASwBKAEoASgBKAEoASgBKAEoASQBJAEkASQBJAEkASQBIAEgASABIAEgASABIAEcARwBHAEcARwBHAEcARgBGAEYARgBGAEYARgBFAEUARQBFAEUARQBFAEQARABEAEQARABEAEQAQwBDAEMAQwBDAEMAQwBCAEIAQgBCAEIAQgBCAEEAQQBBAEEAQQBBAEEAQABAAEAAQABAAEAAPwA/AD8APwA/AD8APwA+AD4APgA+AD4APgA+AD0APQA9AD0APQA9ADwAPAA8ADwAPAA8ADwAOwA7ADsAOwA7ADsAOwA6ADoAOgA6ADoAOgA5ADkAOQA5ADkAOQA5ADgAOAA4ADgAOAA4ADcANwA3ADcANwA3ADcANgA2ADYANgA2ADYANQA1ADUANQA1ADUANQA0ADQANAA0ADQANAAzADMAMwAzADMAMwAzADIAMgAyADIAMgAyADEAMQAxADEAMQAxADAAMAAwADAAMAAwADAALwAvAC8ALwAvAC8ALgAuAC4ALgAuAC4ALQAtAC0ALQAtAC0ALQAsACwALAAsACwALAArACsAKwArACsAKwAqACoAKgAqACoAKgApACkAKQApACkAKQApACgAKAAoACgAKAAoACcAJwAnACcAJwAnACYAJgAmACYAJgAmACUAJQAlACUAJQAlACQAJAAkACQAJAAkACMAIwAjACMAIwAjACIAIgAiACIAIgAiACIAIQAhACEAIQAhACEAIAAgACAAIAAgACAAHwAfAB8AHwAfAB8AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHAAcABwAHAAcABwAGwAbABsAGwAbABsAGgAaABoAGgAaABoAGQAZABkAGQAZABkAGAAYABgAGAAYABgAFwAXABcAFwAXABcAFgAWABYAFgAWABYAFQAVABUAFQAVABUAFAAUABQAFAAUABQAEwATABMAEwATABMAEgASABIAEgASABIAEQARABEAEQARABEAEAAQABAAEAAQABAADwAPAA8ADwAPAA8ADgAOAA4ADgAOAA4ADQANAA0ADQANAA0ADAAMAAwADAAMAAwACwALAAsACwALAAsACgAKAAoACgAKAAoACQAJAAkACQAJAAkACAAIAAgACAAIAAgABwAHAAcABwAHAAcABgAGAAYABgAGAAYABQAFAAUABQAFAAUABAAEAAQABAAEAAQAAwADAAMAAwADAAMAAgACAAIAAgACAAIAAQABAAEAAQABAAEAAAAAAAAAAAAAAP////////////////7//v/+//7//v/+//3//f/9//3//f/9//z//P/8//z//P/8//v/+//7//v/+//7//r/+v/6//r/+v/6//n/+f/5//n/+f/5//j/+P/4//j/+P/4//f/9//3//f/9//3//b/9v/2//b/9v/2//b/9f/1//X/9f/1//X/9P/0//T/9P/0//T/8//z//P/8//z//P/8v/y//L/8v/y//L/8f/x//H/8f/x//H/8P/w//D/8P/w//D/7//v/+//7//v/+//7v/u/+7/7v/u/+7/7f/t/+3/7f/t/+3/7P/s/+z/7P/s/+z/6//r/+v/6//r/+v/6//q/+r/6v/q/+r/6v/p/+n/6f/p/+n/6f/o/+j/6P/o/+j/6P/n/+f/5//n/+f/5//m/+b/5v/m/+b/5v/m/+X/5f/l/+X/5f/l/+T/5P/k/+T/5P/k/+P/4//j/+P/4//j/+L/4v/i/+L/4v/i/+L/4f/h/+H/4f/h/+H/4P/g/+D/4P/g/+D/3//f/9//3//f/9//3//e/97/3v/e/97/3v/d/93/3f/d/93/3f/c/9z/3P/c/9z/3P/c/9v/2//b/9v/2//b/9r/2v/a/9r/2v/a/9r/2f/Z/9n/2f/Z/9n/2P/Y/9j/2P/Y/9j/2P/X/9f/1//X/9f/1//W/9b/1v/W/9b/1v/W/9X/1f/V/9X/1f/V/9X/1P/U/9T/1P/U/9T/0//T/9P/0//T/9P/0//S/9L/0v/S/9L/0v/S/9H/0f/R/9H/0f/R/9D/0P/Q/9D/0P/Q/9D/z//P/8//z//P/8//z//O/87/zv/O/87/zv/O/83/zf/N/83/zf/N/83/zP/M/8z/zP/M/8z/zP/L/8v/y//L/8v/y//L/8r/yv/K/8r/yv/K/8r/yf/J/8n/yf/J/8n/yf/I/8j/yP/I/8j/yP/I/8f/x//H/8f/x//H/8f/xv/G/8b/xv/G/8b/xv/F/8X/xf/F/8X/xf/F/8T/xP/E/8T/xP/E/8T/xP/D/8P/w//D/8P/w//D/8L/wv/C/8L/wv/C/8L/wf/B/8H/wf/B/8H/wf/B/8D/wP/A/8D/wP/A/8D/v/+//7//v/+//7//v/+//77/vv++/77/vv++/77/vv+9/73/vf+9/73/vf+9/7z/vP+8/7z/vP+8/7z/vP+7/7v/u/+7/7v/u/+7/7v/uv+6/7r/uv+6/7r/uv+6/7n/uf+5/7n/uf+5/7n/uf+4/7j/uP+4/7j/uP+4/7j/t/+3/7f/t/+3/7f/t/+3/7b/tv+2/7b/tv+2/7b/tv+2/7X/tf+1/7X/tf+1/7X/tf+0/7T/tP+0/7T/tP+0/7T/tP+z/7P/s/+z/7P/s/+z/7P/sv+y/7L/sv+y/7L/sv+y/7L/sf+x/7H/sf+x/7H/sf+x/7H/sP+w/7D/sP+w/7D/sP+w/7D/r/+v/6//r/+v/6//r/+v/6//rv+u/67/rv+u/67/rv+u/67/rf+t/63/rf+t/63/rf+t/63/rP+s/6z/rP+s/6z/rP+s/6z/rP+r/6v/q/+r/6v/q/+r/6v/q/+q/6r/qv+q/6r/qv+q/6r/qv+q/6n/qf+p/6n/qf+p/6n/qf+p/6n/qP+o/6j/qP+o/6j/qP+o/6j/qP+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/pv+m/6b/pv+m/6b/pv+m/6b/pv+l/6X/pf+l/6X/pf+l/6X/pf+l/6X/pP+k/6T/pP+k/6T/pP+k/6T/pP+k/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+h/6H/of+h/6H/of+h/6H/of+h/6H/of+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+g/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//nv+e/57/nv+e/57/nv+e/57/nv+e/57/nv+d/53/nf+d/53/nf+d/53/nf+d/53/nf+d/53/nP+c/5z/nP+c/5z/nP+c/5z/nP+c/5z/nP+c/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5r/mv+a/5r/mv+a/5r/mv+a/5r/mv+a/5r/mv+a/5r/mf+Z/5n/mf+Z/5n/mf+Z/5n/mf+Z/5n/mf+Z/5n/mf+Z/5j/mP+Y/5j/mP+Y/5j/mP+Y/5j/mP+Y/5j/mP+Y/5j/mP+Y/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/lv+W/5b/lv+W/5b/lv+W/5b/lv+W/5b/lv+W/5b/lv+W/5b/lv+W/5b/lf+V/5X/lf+V/5X/lf+V/5X/lf+V/5X/lf+V/5X/lf+V/5X/lf+V/5X/lf+V/5X/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kf+R/5H/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+S/5L/kv+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5T/lP+U/5X/lf+V/5X/lf+V/5X/lf+V/5X/lf+V/5X/lf+V/5X/lf+V/5X/lf+V/5X/lf+V/5b/lv+W/5b/lv+W/5b/lv+W/5b/lv+W/5b/lv+W/5b/lv+W/5b/lv+W/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+Y/5j/mP+Y/5j/mP+Y/5j/mP+Y/5j/mP+Y/5j/mP+Y/5j/mP+Z/5n/mf+Z/5n/mf+Z/5n/mf+Z/5n/mf+Z/5n/mf+Z/5n/mv+a/5r/mv+a/5r/mv+a/5r/mv+a/5r/mv+a/5r/mv+a/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5z/nP+c/5z/nP+c/5z/nP+c/5z/nP+c/5z/nP+c/53/nf+d/53/nf+d/53/nf+d/53/nf+d/53/nf+e/57/nv+e/57/nv+e/57/nv+e/57/nv+e/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+g/6D/oP+g/6D/oP+g/6D/oP+g/6D/oP+h/6H/of+h/6H/of+h/6H/of+h/6H/of+h/6L/ov+i/6L/ov+i/6L/ov+i/6L/ov+i/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+k/6T/pP+k/6T/pP+k/6T/pP+k/6T/pP+l/6X/pf+l/6X/pf+l/6X/pf+l/6X/pv+m/6b/pv+m/6b/pv+m/6b/pv+m/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+o/6j/qP+o/6j/qP+o/6j/qP+o/6n/qf+p/6n/qf+p/6n/qf+p/6n/qf+q/6r/qv+q/6r/qv+q/6r/qv+q/6v/q/+r/6v/q/+r/6v/q/+r/6v/rP+s/6z/rP+s/6z/rP+s/6z/rP+t/63/rf+t/63/rf+t/63/rf+u/67/rv+u/67/rv+u/67/rv+u/6//r/+v/6//r/+v/6//r/+v/7D/sP+w/7D/sP+w/7D/sP+w/7D/sf+x/7H/sf+x/7H/sf+x/7H/sv+y/7L/sv+y/7L/sv+y/7L/s/+z/7P/s/+z/7P/s/+z/7P/tP+0/7T/tP+0/7T/tP+0/7T/tf+1/7X/tf+1/7X/tf+1/7X/tv+2/7b/tv+2/7b/tv+2/7f/t/+3/7f/t/+3/7f/t/+3/7j/uP+4/7j/uP+4/7j/uP+5/7n/uf+5/7n/uf+5/7n/uf+6/7r/uv+6/7r/uv+6/7r/u/+7/7v/u/+7/7v/u/+7/7z/vP+8/7z/vP+8/7z/vP+8/73/vf+9/73/vf+9/73/vf++/77/vv++/77/vv++/77/v/+//7//v/+//7//v/+//8D/wP/A/8D/wP/A/8D/wP/B/8H/wf/B/8H/wf/B/8H/wv/C/8L/wv/C/8L/wv/C/8P/w//D/8P/w//D/8P/xP/E/8T/xP/E/8T/xP/E/8X/xf/F/8X/xf/F/8X/xf/G/8b/xv/G/8b/xv/G/8f/x//H/8f/x//H/8f/x//I/8j/yP/I/8j/yP/I/8n/yf/J/8n/yf/J/8n/yf/K/8r/yv/K/8r/yv/K/8v/y//L/8v/y//L/8v/y//M/8z/zP/M/8z/zP/M/83/zf/N/83/zf/N/83/zf/O/87/zv/O/87/zv/O/8//z//P/8//z//P/8//0P/Q/9D/0P/Q/9D/0P/R/9H/0f/R/9H/0f/R/9H/0v/S/9L/0v/S/9L/0v/T/9P/0//T/9P/0//T/9T/1P/U/9T/1P/U/9T/1f/V/9X/1f/V/9X/1f/W/9b/1v/W/9b/1v/W/9f/1//X/9f/1//X/9f/2P/Y/9j/2P/Y/9j/2P/Z/9n/2f/Z/9n/2f/Z/9r/2v/a/9r/2v/a/9r/2//b/9v/2//b/9v/2//c/9z/3P/c/9z/3P/c/93/3f/d/93/3f/d/93/3v/e/97/3v/e/97/3v/f/9//3//f/9//3//f/+D/4P/g/+D/4P/g/+D/4f/h/+H/4f/h/+H/4f/i/+L/4v/i/+L/4v/i/+P/4//j/+P/4//j/+P/5P/k/+T/5P/k/+T/5f/l/+X/5f/l/+X/5f/m/+b/5v/m/+b/5v/m/+f/5//n/+f/5//n/+f/6P/o/+j/6P/o/+j/6P/p/+n/6f/p/+n/6f/q/+r/6v/q/+r/6v/q/+v/6//r/+v/6//r/+v/7P/s/+z/7P/s/+z/7P/t/+3/7f/t/+3/7f/u/+7/7v/u/+7/7v/u/+//7//v/+//7//v/+//8P/w//D/8P/w//D/8P/x//H/8f/x//H/8f/y//L/8v/y//L/8v/y//P/8//z//P/8//z//P/9P/0//T/9P/0//T/9f/1//X/9f/1//X/9f/2//b/9v/2//b/9v/2//f/9//3//f/9//3//j/+P/4//j/+P/4//j/+f/5//n/+f/5//n/+f/6//r/+v/6//r/+v/6//v/+//7//v/+//7//z//P/8//z//P/8//z//f/9//3//f/9//3//f/+//7//v/+//7//v///////////////////wAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQACAAIAAgACAAIAAgADAAMAAwADAAMAAwADAAQABAAEAAQABAAEAAQABQAFAAUABQAFAAUABQAGAAYABgAGAAYABgAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgALAAsACwALAAsACwALAAwADAAMAAwADAAMAAwADQANAA0ADQANAA0ADQAOAA4ADgAOAA4ADgAOAA8ADwAPAA8ADwAPAA8AEAAQABAAEAAQABAAEAARABEAEQARABEAEQARABIAEgASABIAEgASABMAEwATABMAEwATABMAFAAUABQAFAAUABQAFAAVABUAFQAVABUAFQAVABYAFgAWABYAFgAWABYAFwAXABcAFwAXABcAFwAYABgAGAAYABgAGAAYABkAGQAZABkAGQAZABkAGgAaABoAGgAaABoAGgAaABsAGwAbABsAGwAbABsAHAAcABwAHAAcABwAHAAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHwAfAB8AHwAfAB8AHwAgACAAIAAgACAAIAAgACAAIQAhACEAIQAhACEAIQAiACIAIgAiACIAIgAiACMAIwAjACMAIwAjACMAIwAkACQAJAAkACQAJAAkACUAJQAlACUAJQAlACUAJgAmACYAJgAmACYAJgAmACcAJwAnACcAJwAnACcAKAAoACgAKAAoACgAKAAoACkAKQApACkAKQApACkAKQAqACoAKgAqACoAKgAqACsAKwArACsAKwArACsAKwAsACwALAAsACwALAAsACwALQAtAC0ALQAtAC0ALQAuAC4ALgAuAC4ALgAuAC4ALwAvAC8ALwAvAC8ALwAvADAAMAAwADAAMAAwADAAMAAxADEAMQAxADEAMQAxADEAMgAyADIAMgAyADIAMgAyADMAMwAzADMAMwAzADMAMwA0ADQANAA0ADQANAA0ADQANQA1ADUANQA1ADUANQA1ADUANgA2ADYANgA2ADYANgA2ADcANwA3ADcANwA3ADcANwA4ADgAOAA4ADgAOAA4ADgAOAA5ADkAOQA5ADkAOQA5ADkAOgA6ADoAOgA6ADoAOgA6ADoAOwA7ADsAOwA7ADsAOwA7ADsAPAA8ADwAPAA8ADwAPAA8AD0APQA9AD0APQA9AD0APQA9AD4APgA+AD4APgA+AD4APgA+AD8APwA/AD8APwA/AD8APwA/AEAAQABAAEAAQABAAEAAQABAAEAAQQBBAEEAQQBBAEEAQQBBAEEAQgBCAEIAQgBCAEIAQgBCAEIAQwBDAEMAQwBDAEMAQwBDAEMAQwBEAEQARABEAEQARABEAEQARABEAEUARQBFAEUARQBFAEUARQBFAEYARgBGAEYARgBGAEYARgBGAEYARwBHAEcARwBHAEcARwBHAEcARwBHAEgASABIAEgASABIAEgASABIAEgASQBJAEkASQBJAEkASQBJAEkASQBKAEoASgBKAEoASgBKAEoASgBKAEoASwBLAEsASwBLAEsASwBLAEsASwBLAEwATABMAEwATABMAEwATABMAEwATABNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATgBOAE4ATgBOAE4ATgBOAE4ATgBOAE4ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWwBbAFsAWwBbAFsAWwBbAFsAWwBbAFsAWwBbAFsAWwBbAFsAWwBbAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABdAF0AXQBdAF0AXQBdAF0AXQBdAF0AXQBdAF0AXQBdAF0AXQBdAF0AXQBdAF0AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYQBhAGEAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF0AXQBdAF0AXQBdAF0AXQBdAF0AXQBdAF0AXQBdAF0AXQBdAF0AXQBdAF0AXQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABbAFsAWwBbAFsAWwBbAFsAWwBbAFsAWwBbAFsAWwBbAFsAWwBbAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFMAUwBTAFIAUgBSAFIAUgBSAFIAUgBSAFIAUgBSAFIAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE4ATgBOAE4ATgBOAE4ATgBOAE4ATgBOAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAEwATABMAEwATABMAEwATABMAEwATABLAEsASwBLAEsASwBLAEsASwBLAEsASwBKAEoASgBKAEoASgBKAEoASgBKAEoASQBJAEkASQBJAEkASQBJAEkASQBJAEgASABIAEgASABIAEgASABIAEgASABHAEcARwBHAEcARwBHAEcARwBHAEYARgBGAEYARgBGAEYARgBGAEYARgBFAEUARQBFAEUARQBFAEUARQBFAEQARABEAEQARABEAEQARABEAEQAQwBDAEMAQwBDAEMAQwBDAEMAQwBCAEIAQgBCAEIAQgBCAEIAQgBCAEEAQQBBAEEAQQBBAEEAQQBBAEEAQABAAEAAQABAAEAAQABAAEAAQAA/AD8APwA/AD8APwA/AD8APwA+AD4APgA+AD4APgA+AD4APgA+AD0APQA9AD0APQA9AD0APQA9ADwAPAA8ADwAPAA8ADwAPAA8ADwAOwA7ADsAOwA7ADsAOwA7ADsAOgA6ADoAOgA6ADoAOgA6ADoAOQA5ADkAOQA5ADkAOQA5ADkAOAA4ADgAOAA4ADgAOAA4ADgANwA3ADcANwA3ADcANwA3ADcANgA2ADYANgA2ADYANgA2ADYANQA1ADUANQA1ADUANQA1ADUANAA0ADQANAA0ADQANAA0ADMAMwAzADMAMwAzADMAMwAzADIAMgAyADIAMgAyADIAMgAyADEAMQAxADEAMQAxADEAMQAwADAAMAAwADAAMAAwADAAMAAvAC8ALwAvAC8ALwAvAC8ALgAuAC4ALgAuAC4ALgAuAC4ALQAtAC0ALQAtAC0ALQAtACwALAAsACwALAAsACwALAArACsAKwArACsAKwArACsAKwAqACoAKgAqACoAKgAqACoAKQApACkAKQApACkAKQApACgAKAAoACgAKAAoACgAKAAnACcAJwAnACcAJwAnACcAJgAmACYAJgAmACYAJgAmACUAJQAlACUAJQAlACUAJQAlACQAJAAkACQAJAAkACQAJAAjACMAIwAjACMAIwAjACMAIgAiACIAIgAiACIAIgAiACEAIQAhACEAIQAhACEAIAAgACAAIAAgACAAIAAgAB8AHwAfAB8AHwAfAB8AHwAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdABwAHAAcABwAHAAcABwAHAAbABsAGwAbABsAGwAbABsAGgAaABoAGgAaABoAGgAaABkAGQAZABkAGQAZABkAGAAYABgAGAAYABgAGAAYABcAFwAXABcAFwAXABcAFwAWABYAFgAWABYAFgAWABYAFQAVABUAFQAVABUAFQAUABQAFAAUABQAFAAUABQAEwATABMAEwATABMAEwATABIAEgASABIAEgASABIAEQARABEAEQARABEAEQARABAAEAAQABAAEAAQABAAEAAPAA8ADwAPAA8ADwAPAA4ADgAOAA4ADgAOAA4ADgANAA0ADQANAA0ADQANAA0ADAAMAAwADAAMAAwADAALAAsACwALAAsACwALAAsACgAKAAoACgAKAAoACgAKAAkACQAJAAkACQAJAAkACAAIAAgACAAIAAgACAAIAAcABwAHAAcABwAHAAcABwAGAAYABgAGAAYABgAGAAUABQAFAAUABQAFAAUABQAEAAQABAAEAAQABAAEAAQAAwADAAMAAwADAAMAAwACAAIAAgACAAIAAgACAAIAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAA//////////////////////7//v/+//7//v/+//7//v/9//3//f/9//3//f/9//z//P/8//z//P/8//z//P/7//v/+//7//v/+//7//v/+v/6//r/+v/6//r/+v/6//n/+f/5//n/+f/5//n/+P/4//j/+P/4//j/+P/4//f/9//3//f/9//3//f/9//2//b/9v/2//b/9v/2//b/9f/1//X/9f/1//X/9f/1//T/9P/0//T/9P/0//T/8//z//P/8//z//P/8//z//L/8v/y//L/8v/y//L/8v/x//H/8f/x//H/8f/x//H/8P/w//D/8P/w//D/8P/w/+//7//v/+//7//v/+//7//u/+7/7v/u/+7/7v/u/+7/7f/t/+3/7f/t/+3/7f/t/+z/7P/s/+z/7P/s/+z/7P/r/+v/6//r/+v/6//r/+v/6v/q/+r/6v/q/+r/6v/q/+n/6f/p/+n/6f/p/+n/6f/o/+j/6P/o/+j/6P/o/+j/6P/n/+f/5//n/+f/5//n/+f/5v/m/+b/5v/m/+b/5v/m/+X/5f/l/+X/5f/l/+X/5f/k/+T/5P/k/+T/5P/k/+T/5P/j/+P/4//j/+P/4//j/+P/4v/i/+L/4v/i/+L/4v/i/+H/4f/h/+H/4f/h/+H/4f/h/+D/4P/g/+D/4P/g/+D/4P/f/9//3//f/9//3//f/9//3//e/97/3v/e/97/3v/e/97/3v/d/93/3f/d/93/3f/d/93/3P/c/9z/3P/c/9z/3P/c/9z/2//b/9v/2//b/9v/2//b/9v/2v/a/9r/2v/a/9r/2v/a/9r/2f/Z/9n/2f/Z/9n/2f/Z/9j/2P/Y/9j/2P/Y/9j/2P/Y/9f/1//X/9f/1//X/9f/1//X/9f/1v/W/9b/1v/W/9b/1v/W/9b/1f/V/9X/1f/V/9X/1f/V/9X/1P/U/9T/1P/U/9T/1P/U/9T/0//T/9P/0//T/9P/0//T/9P/0//S/9L/0v/S/9L/0v/S/9L/0v/R/9H/0f/R/9H/0f/R/9H/0f/R/9D/0P/Q/9D/0P/Q/9D/0P/Q/8//z//P/8//z//P/8//z//P/8//zv/O/87/zv/O/87/zv/O/87/zv/N/83/zf/N/83/zf/N/83/zf/N/8z/zP/M/8z/zP/M/8z/zP/M/8z/y//L/8v/y//L/8v/y//L/8v/y//K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yf/J/8n/yf/J/8n/yf/J/8n/yf/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/x//H/8f/x//H/8f/x//H/8f/x//G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xP/E/8T/xP/E/8T/xP/E/8T/xP/E/8P/w//D/8P/w//D/8P/w//D/8P/w//C/8L/wv/C/8L/wv/C/8L/wv/C/8L/wv/B/8H/wf/B/8H/wf/B/8H/wf/B/8H/wf/A/8D/wP/A/8D/wP/A/8D/wP/A/8D/wP+//7//v/+//7//v/+//7//v/+//7//v/+//77/vv++/77/vv++/77/vv++/77/vv++/77/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+2/7b/tv+2/7b/tv+2/7b/tv+2/7b/tv+2/7b/tv+2/7b/tf+1/7X/tf+1/7X/tf+1/7X/tf+1/7X/tf+1/7X/tf+1/7T/tP+0/7T/tP+0/7T/tP+0/7T/tP+0/7T/tP+0/7T/tP+0/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+y/7L/sv+y/7L/sv+y/7L/sv+y/7L/sv+y/7L/sv+y/7L/sv+y/7L/sf+x/7H/sf+x/7H/sf+x/7H/sf+x/7H/sf+x/7H/sf+x/7H/sf+x/7H/sf+w/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+w/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rP+s/6z/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rf+t/63/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//sP+w/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+w/7D/sP+x/7H/sf+x/7H/sf+x/7H/sf+x/7H/sf+x/7H/sf+x/7H/sf+x/7H/sf+x/7H/sv+y/7L/sv+y/7L/sv+y/7L/sv+y/7L/sv+y/7L/sv+y/7L/sv+y/7L/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7T/tP+0/7T/tP+0/7T/tP+0/7T/tP+0/7T/tP+0/7T/tP+0/7X/tf+1/7X/tf+1/7X/tf+1/7X/tf+1/7X/tf+1/7X/tf+1/7b/tv+2/7b/tv+2/7b/tv+2/7b/tv+2/7b/tv+2/7b/tv+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+4/7j/uP+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+5/7n/uf+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+6/7r/uv+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/7z/vP+8/73/vf+9/73/vf+9/73/vf+9/73/vf+9/73/vf++/77/vv++/77/vv++/77/vv++/77/vv++/77/v/+//7//v/+//7//v/+//7//v/+//7//v//A/8D/wP/A/8D/wP/A/8D/wP/A/8D/wP/A/8H/wf/B/8H/wf/B/8H/wf/B/8H/wf/B/8L/wv/C/8L/wv/C/8L/wv/C/8L/wv/C/8L/w//D/8P/w//D/8P/w//D/8P/w//D/8P/xP/E/8T/xP/E/8T/xP/E/8T/xP/E/8T/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8v/y//L/8v/y//L/8v/y//L/8v/y//M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zf/N/83/zf/N/83/zf/N/83/zf/N/87/zv/O/87/zv/O/87/zv/O/87/z//P/8//z//P/8//z//P/8//z//P/9D/0P/Q/9D/0P/Q/9D/0P/Q/9D/0f/R/9H/0f/R/9H/0f/R/9H/0f/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0//T/9P/0//T/9P/0//T/9P/0//U/9T/1P/U/9T/1P/U/9T/1P/U/9X/1f/V/9X/1f/V/9X/1f/V/9X/1v/W/9b/1v/W/9b/1v/W/9b/1v/X/9f/1//X/9f/1//X/9f/1//Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2v/a/9r/2v/a/9r/2v/a/9r/2v/b/9v/2//b/9v/2//b/9v/2//c/9z/3P/c/9z/3P/c/9z/3P/c/93/3f/d/93/3f/d/93/3f/d/97/3v/e/97/3v/e/97/3v/e/97/3//f/9//3//f/9//3//f/9//4P/g/+D/4P/g/+D/4P/g/+D/4f/h/+H/4f/h/+H/4f/h/+H/4f/i/+L/4v/i/+L/4v/i/+L/4v/j/+P/4//j/+P/4//j/+P/4//k/+T/5P/k/+T/5P/k/+T/5P/l/+X/5f/l/+X/5f/l/+X/5f/l/+b/5v/m/+b/5v/m/+b/5v/m/+f/5//n/+f/5//n/+f/5//n/+j/6P/o/+j/6P/o/+j/6P/o/+n/6f/p/+n/6f/p/+n/6f/p/+r/6v/q/+r/6v/q/+r/6v/q/+v/6//r/+v/6//r/+v/6//r/+z/7P/s/+z/7P/s/+z/7P/s/+3/7f/t/+3/7f/t/+3/7f/t/+7/7v/u/+7/7v/u/+7/7v/u/+//7//v/+//7//v/+//7//v//D/8P/w//D/8P/w//D/8P/w//H/8f/x//H/8f/x//H/8f/x//L/8v/y//L/8v/y//L/8v/y//P/8//z//P/8//z//P/8//z//T/9P/0//T/9P/0//T/9P/0//X/9f/1//X/9f/1//X/9f/1//b/9v/2//b/9v/2//b/9v/2//f/9//3//f/9//3//f/9//3//j/+P/4//j/+P/4//j/+P/4//n/+f/5//n/+f/5//n/+f/6//r/+v/6//r/+v/6//r/+v/7//v/+//7//v/+//7//v/+//8//z//P/8//z//P/8//z//P/9//3//f/9//3//f/9//3//f/+//7//v/+//7//v/+//7//v////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQACAAIAAgACAAIAAgACAAIAAgADAAMAAwADAAMAAwADAAMAAwAEAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAGAAYABgAGAAYABgAGAAYABgAHAAcABwAHAAcABwAHAAcABwAIAAgACAAIAAgACAAIAAgACAAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAsACwALAAsACwALAAsACwALAAwADAAMAAwADAAMAAwADAAMAA0ADQANAA0ADQANAA0ADQANAA4ADgAOAA4ADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8AEAAQABAAEAAQABAAEAAQABAAEQARABEAEQARABEAEQARABEAEQASABIAEgASABIAEgASABIAEgATABMAEwATABMAEwATABMAEwATABQAFAAUABQAFAAUABQAFAAUABUAFQAVABUAFQAVABUAFQAVABUAFgAWABYAFgAWABYAFgAWABYAFwAXABcAFwAXABcAFwAXABcAFwAYABgAGAAYABgAGAAYABgAGAAYABkAGQAZABkAGQAZABkAGQAZABkAGgAaABoAGgAaABoAGgAaABoAGgAbABsAGwAbABsAGwAbABsAGwAbABwAHAAcABwAHAAcABwAHAAcABwAHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB8AHwAfAB8AHwAfAB8AHwAfAB8AIAAgACAAIAAgACAAIAAgACAAIAAgACEAIQAhACEAIQAhACEAIQAhACEAIgAiACIAIgAiACIAIgAiACIAIgAiACMAIwAjACMAIwAjACMAIwAjACMAJAAkACQAJAAkACQAJAAkACQAJAAkACUAJQAlACUAJQAlACUAJQAlACUAJQAmACYAJgAmACYAJgAmACYAJgAmACYAJwAnACcAJwAnACcAJwAnACcAJwAnACgAKAAoACgAKAAoACgAKAAoACgAKAApACkAKQApACkAKQApACkAKQApACkAKQAqACoAKgAqACoAKgAqACoAKgAqACoAKwArACsAKwArACsAKwArACsAKwArACsALAAsACwALAAsACwALAAsACwALAAsACwALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALwAvAC8ALwAvAC8ALwAvAC8ALwAvAC8AMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADIAMgAyADIAMgAyADIAMgAyADIAMgAyADIAMwAzADMAMwAzADMAMwAzADMAMwAzADMAMwA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA+AD4APgA+AD4APgA+AD4APgA+AD4APgA+AD4APgA+AD4APgA/AD8APwA/AD8APwA/AD8APwA/AD8APwA/AD8APwA/AD8APwA/AD8AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARwBHAEcARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEYARgBGAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBFAEUARQBEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBDAEMAQwBCAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEIAQgBCAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAD8APwA/AD8APwA/AD8APwA/AD8APwA/AD8APwA/AD8APwA/AD8APwA/AD4APgA+AD4APgA+AD4APgA+AD4APgA+AD4APgA+AD4APgA+AD4APgA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA7ADsAOwA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOgA6ADoAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANwA3ADcANgA2ADYANgA2ADYANgA2ADYANgA2ADYANgA2ADYANQA1ADUANQA1ADUANQA1ADUANQA1ADUANQA1ADUANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADMAMwAzADMAMwAzADMAMwAzADMAMwAzADMAMwAzADIAMgAyADIAMgAyADIAMgAyADIAMgAyADIAMgAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAvAC8ALwAvAC8ALwAvAC8ALwAvAC8ALwAvAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtACwALAAsACwALAAsACwALAAsACwALAAsACsAKwArACsAKwArACsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgApACkAKQApACkAKQApACkAKQApACkAKQAoACgAKAAoACgAKAAoACgAKAAoACgAKAAnACcAJwAnACcAJwAnACcAJwAnACcAJwAmACYAJgAmACYAJgAmACYAJgAmACYAJgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAkACQAJAAkACQAJAAkACQAJAAkACQAJAAjACMAIwAjACMAIwAjACMAIwAjACMAIwAiACIAIgAiACIAIgAiACIAIgAiACIAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIAAgACAAIAAgACAAIAAgACAAIAAgAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHAAcABwAHAAcABwAHAAcABwAHAAcABwAGwAbABsAGwAbABsAGwAbABsAGwAbABoAGgAaABoAGgAaABoAGgAaABoAGgAZABkAGQAZABkAGQAZABkAGQAZABkAGAAYABgAGAAYABgAGAAYABgAGAAYABcAFwAXABcAFwAXABcAFwAXABcAFwAWABYAFgAWABYAFgAWABYAFgAWABYAFQAVABUAFQAVABUAFQAVABUAFQAVABQAFAAUABQAFAAUABQAFAAUABQAFAATABMAEwATABMAEwATABMAEwATABIAEgASABIAEgASABIAEgASABIAEgARABEAEQARABEAEQARABEAEQARABEAEAAQABAAEAAQABAAEAAQABAAEAAQAA8ADwAPAA8ADwAPAA8ADwAPAA8ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA0ADQANAA0ADQANAA0ADQANAA0ADQAMAAwADAAMAAwADAAMAAwADAAMAAwACwALAAsACwALAAsACwALAAsACwAKAAoACgAKAAoACgAKAAoACgAKAAoACQAJAAkACQAJAAkACQAJAAkACQAJAAgACAAIAAgACAAIAAgACAAIAAgABwAHAAcABwAHAAcABwAHAAcABwAHAAYABgAGAAYABgAGAAYABgAGAAYABgAFAAUABQAFAAUABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAEAAQABAADAAMAAwADAAMAAwADAAMAAwADAAMAAgACAAIAAgACAAIAAgACAAIAAgABAAEAAQABAAEAAQABAAEAAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////+//7//v/+//7//v/+//7//v/+//3//f/9//3//f/9//3//f/9//3//f/8//z//P/8//z//P/8//z//P/8//z/+//7//v/+//7//v/+//7//v/+//7//r/+v/6//r/+v/6//r/+v/6//r/+v/5//n/+f/5//n/+f/5//n/+f/5//n/+P/4//j/+P/4//j/+P/4//j/+P/4//f/9//3//f/9//3//f/9//3//f/9//2//b/9v/2//b/9v/2//b/9v/2//b/9f/1//X/9f/1//X/9f/1//X/9f/1//T/9P/0//T/9P/0//T/9P/0//T/9P/0//P/8//z//P/8//z//P/8//z//P/8//y//L/8v/y//L/8v/y//L/8v/y//L/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8P/w//D/8P/w//D/8P/w//D/8P/w/+//7//v/+//7//v/+//7//v/+//7//v/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/r/+v/6//r/+v/6//r/+v/6//r/+v/6//q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/n/+f/5//n/+f/5//n/+f/5//n/+f/5//m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/9//3//f/9//3//f/9//3//f/9//3//f/9//3//e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/93/3f/d/93/3f/d/93/3f/d/93/3f/d/93/3f/d/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9H/0f/R/9H/0f/R/9H/0f/R/9H/0f/R/9H/0f/R/9H/0f/R/9H/0P/Q/9D/0P/Q/9D/0P/Q/9D/0P/Q/9D/0P/Q/9D/0P/Q/9D/0P/Q/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//O/87/zv/O/87/zv/O/87/zv/O/87/zv/O/87/zv/O/87/zv/O/87/zv/O/83/zf/N/83/zf/N/83/zf/N/83/zf/N/83/zf/N/83/zf/N/83/zf/N/83/zf/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xf/F/8X/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8b/xv/G/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8j/yP/I/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yf/J/8n/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/yv/K/8r/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zP/M/8z/zf/N/83/zf/N/83/zf/N/83/zf/N/83/zf/N/83/zf/N/83/zf/N/83/zf/N/83/zf/O/87/zv/O/87/zv/O/87/zv/O/87/zv/O/87/zv/O/87/zv/O/87/zv/O/87/z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//Q/9D/0P/Q/9D/0P/Q/9D/0P/Q/9D/0P/Q/9D/0P/Q/9D/0P/Q/9D/0P/R/9H/0f/R/9H/0f/R/9H/0f/R/9H/0f/R/9H/0f/R/9H/0f/R/9H/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9L/0v/S/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/U/9T/1P/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/V/9X/1f/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1v/W/9b/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9j/2P/Y/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3P/c/9z/3f/d/93/3f/d/93/3f/d/93/3f/d/93/3f/d/93/3f/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7//v/+//7//v/+//7//v/+//7//v/+//7//w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8//z//P/8//z//P/8//z//P/8//z//P/8//0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//f/9//3//f/9//3//f/9//3//f/9//3//f/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/7//v/+//7//v/+//7//v/+//7//v/+//7//z//P/8//z//P/8//z//P/8//z//P/8//z//P/9//3//f/9//3//f/9//3//f/9//3//f/9//7//v/+//7//v/+//7//v/+//7//v/+//7//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACwALAAsACwALAAsACwALAAsACwALAAsACwALAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACIAIgAiACIAIgAiACIAIgAiACIAIgAiACIAIgAiACIAIgAiACIAIgAiACMAIwAjACMAIwAjACMAIwAjACMAIwAjACMAIwAjACMAIwAjACMAIwAjACMAIwAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC4ALgAuAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAtAC0ALQAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJwAnACcAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAmACYAJgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAIwAjACMAIwAjACMAIwAjACMAIwAjACMAIwAjACMAIwAjACMAIwAjACMAIwAjACMAIgAiACIAIgAiACIAIgAiACIAIgAiACIAIgAiACIAIgAiACIAIgAiACIAIgAiACIAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACEAIQAhACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAfAB8AHwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAVABUAFQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////////////////////v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4P/g/+D/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+H/4f/h/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+L/4v/i/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/k/+T/5P/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/l/+X/5f/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/m/+b/5v/n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6P/o/+j/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/p/+n/6f/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+r/6v/q/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/s/+z/7P/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+3/7f/t/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7v/u/+7/7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/w//D/8P/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8f/x//H/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8v/y//L/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/0//T/9P/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9f/1//X/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/2//b/9v/3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEwATABMAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAsACwALAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/4//j/+P/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/5//n/+f/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//r/+v/6//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF9QTVi2EwAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxMzcgNzkuMTU5NzY4LCAyMDE2LzA4LzExLTEzOjI0OjQyICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXBETT0iaHR0cDovL25zLmFkb2JlLmNvbS94bXAvMS4wL0R5bmFtaWNNZWRpYS8iCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iCiAgICAgICAgICAgIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDx4bXBETTpUcmFja3M+CiAgICAgICAgICAgIDxyZGY6QmFnPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHhtcERNOnRyYWNrTmFtZT5DdWVQb2ludCBNYXJrZXJzPC94bXBETTp0cmFja05hbWU+CiAgICAgICAgICAgICAgICAgIDx4bXBETTp0cmFja1R5cGU+Q3VlPC94bXBETTp0cmFja1R5cGU+CiAgICAgICAgICAgICAgICAgIDx4bXBETTpmcmFtZVJhdGU+ZjQ0MTAwPC94bXBETTpmcmFtZVJhdGU+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHhtcERNOnRyYWNrTmFtZT5DRCBUcmFjayBNYXJrZXJzPC94bXBETTp0cmFja05hbWU+CiAgICAgICAgICAgICAgICAgIDx4bXBETTp0cmFja1R5cGU+VHJhY2s8L3htcERNOnRyYWNrVHlwZT4KICAgICAgICAgICAgICAgICAgPHhtcERNOmZyYW1lUmF0ZT5mNDQxMDA8L3htcERNOmZyYW1lUmF0ZT4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8eG1wRE06dHJhY2tOYW1lPlN1YmNsaXAgTWFya2VyczwveG1wRE06dHJhY2tOYW1lPgogICAgICAgICAgICAgICAgICA8eG1wRE06dHJhY2tUeXBlPkluT3V0PC94bXBETTp0cmFja1R5cGU+CiAgICAgICAgICAgICAgICAgIDx4bXBETTpmcmFtZVJhdGU+ZjQ0MTAwPC94bXBETTpmcmFtZVJhdGU+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpCYWc+CiAgICAgICAgIDwveG1wRE06VHJhY2tzPgogICAgICAgICA8eG1wOk1ldGFkYXRhRGF0ZT4yMDE3LTA0LTE0VDE0OjQxOjM5KzAyOjAwPC94bXA6TWV0YWRhdGFEYXRlPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxNy0wNC0xNFQxNDo0MTozOSswMjowMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXBNTTpJbnN0YW5jZUlEPnhtcC5paWQ6MzJkNTc5ZjAtMjIyZi00YjIyLThmZTUtNmNlZWY2YjJhYzMwPC94bXBNTTpJbnN0YW5jZUlEPgogICAgICAgICA8eG1wTU06RG9jdW1lbnRJRD54bXAuZGlkOjYzOGI4M2Y5LTA5ZWItNDk5Mi1hZDdjLWRkN2UwOWEwMzgyZDwveG1wTU06RG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD54bXAuZGlkOjYzOGI4M2Y5LTA5ZWItNDk5Mi1hZDdjLWRkN2UwOWEwMzgyZDwveG1wTU06T3JpZ2luYWxEb2N1bWVudElEPgogICAgICAgICA8eG1wTU06SGlzdG9yeT4KICAgICAgICAgICAgPHJkZjpTZXE+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6NjM4YjgzZjktMDllYi00OTkyLWFkN2MtZGQ3ZTA5YTAzODJkPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE3LTA0LTE0VDE0OjQxOjM5KzAyOjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBBdWRpdGlvbiBDQyAyMDE3LjAgKE1hY2ludG9zaCk8L3N0RXZ0OnNvZnR3YXJlQWdlbnQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpjaGFuZ2VkPi9tZXRhZGF0YTwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MzJkNTc5ZjAtMjIyZi00YjIyLThmZTUtNmNlZWY2YjJhYzMwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE3LTA0LTE0VDE0OjQxOjM5KzAyOjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBBdWRpdGlvbiBDQyAyMDE3LjAgKE1hY2ludG9zaCk8L3N0RXZ0OnNvZnR3YXJlQWdlbnQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpjaGFuZ2VkPi88L3N0RXZ0OmNoYW5nZWQ+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpTZXE+CiAgICAgICAgIDwveG1wTU06SGlzdG9yeT4KICAgICAgICAgPGRjOmZvcm1hdD5hdWRpby94LXdhdjwvZGM6Zm9ybWF0PgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+\"></audio>\n</body>\n</html>\n"
  },
  {
    "path": "local-cli/server/util/jsPackagerClient.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nconst WebSocket = require('ws');\n\nconst parseMessage = require('./messageSocket').parseMessage;\n\nconst PROTOCOL_VERSION = 2;\nconst TARGET_SERVER = 'server';\n\nfunction getMessageId() {\n  return `${Date.now()}:${Math.random()}`;\n}\n\nclass JsPackagerClient {\n  constructor(url) {\n    this.ws = new WebSocket(url);\n    this.msgCallbacks = new Map();\n\n    this.openPromise = new Promise((resolve, reject) => {\n      this.ws.on('error', error => reject(error));\n      this.ws.on('open', resolve);\n    });\n\n    this.ws.on('message', (data, flags) => {\n      const message = parseMessage(data, flags.binary);\n      const msgCallback = this.msgCallbacks.get(message.id);\n      if (message === undefined || message.id === undefined) {\n        // gracefully ignore wrong messages or broadcasts\n      } else if (msgCallback === undefined) {\n        console.warn(`Response with non-existing message id: '${message.id}'`);\n      } else {\n        if (message.error === undefined) {\n          msgCallback.resolve(message.result);\n        } else {\n          msgCallback.reject(message.error);\n        }\n      }\n    });\n  }\n\n  sendRequest(method, target, params) {\n    return this.openPromise.then(() => new Promise((resolve, reject) => {\n      const messageId = getMessageId();\n      this.msgCallbacks.set(messageId, {resolve: resolve, reject: reject});\n      this.ws.send(\n        JSON.stringify({\n          version: PROTOCOL_VERSION,\n          target: target,\n          method: method,\n          id: messageId,\n          params: params,\n        }),\n        error => {\n          if (error !== undefined) {\n            this.msgCallbacks.delete(messageId);\n            reject(error);\n          }\n        });\n    }));\n  }\n\n  sendNotification(method, target, params) {\n    return this.openPromise.then(() => new Promise((resolve, reject) => {\n      this.ws.send(\n        JSON.stringify({\n          version: PROTOCOL_VERSION,\n          target: target,\n          method: method,\n          params: params,\n        }),\n        error => {\n          if (error !== undefined) {\n            reject(error);\n          } else {\n            resolve();\n          }\n        });\n    }));\n  }\n\n  sendBroadcast(method, params) {\n    return this.sendNotification(method, undefined, params);\n  }\n\n  getPeers() {\n    return new Promise((resolve, reject) => {\n      this.sendRequest('getpeers', TARGET_SERVER, undefined).then(\n        response => {\n          if (!response instanceof Map) {\n            reject('Results received from server are of wrong format:\\n' +\n                   JSON.stringify(response));\n          } else {\n            resolve(response);\n          }\n        },\n        reject);\n    });\n  }\n\n  getId() {\n    return this.sendRequest('getid', TARGET_SERVER, undefined);\n  }\n}\n\nmodule.exports = JsPackagerClient;\n"
  },
  {
    "path": "local-cli/server/util/launchChrome.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\nconst opn = require('opn');\nconst execSync = require('child_process').execSync;\n\nfunction commandExistsUnixSync (commandName, callback) {\n  try {\n    var stdout = execSync('command -v ' + commandName +\n          ' 2>/dev/null' +\n          ' && { echo >&1 \\'' + commandName + ' found\\'; exit 0; }');\n    return !!stdout;\n  } catch (error) {\n    return false;\n  }\n}\n\nfunction getChromeAppName(): string {\n  switch (process.platform) {\n  case 'darwin':\n    return 'google chrome';\n  case 'win32':\n    return 'chrome';\n  case 'linux':\n    if (commandExistsUnixSync('google-chrome')) {\n      return 'google-chrome';\n    } else if (commandExistsUnixSync('chromium-browser')) {\n      return 'chromium-browser';\n    } else {\n      return 'chromium';\n    }\n  default:\n    return 'google-chrome';\n  }\n}\n\nfunction launchChrome(url: string) {\n  opn(url, {app: [getChromeAppName()]}, function(err) {\n    if (err) {\n      console.error('Google Chrome exited with error:', err);\n    }\n  });\n}\n\nmodule.exports = launchChrome;\n"
  },
  {
    "path": "local-cli/server/util/launchEditor.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nvar chalk = require('chalk');\nvar fs = require('fs');\nvar path = require('path');\nvar child_process = require('child_process');\nconst isAbsolutePath = require('absolute-path');\nconst shellQuote = require('shell-quote');\n\nfunction isTerminalEditor(editor) {\n  switch (editor) {\n    case 'vim':\n    case 'emacs':\n    case 'nano':\n      return true;\n  }\n  return false;\n}\n\n// Map from full process name to binary that starts the process\n// We can't just re-use full process name, because it will spawn a new instance\n// of the app every time\nvar COMMON_EDITORS = {\n  '/Applications/Atom.app/Contents/MacOS/Atom': 'atom',\n  '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta':\n    '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',\n  '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea': 'idea',\n  '/Applications/Sublime Text.app/Contents/MacOS/Sublime Text':\n    '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',\n  '/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2':\n    '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',\n  '/Applications/Visual Studio Code.app/Contents/MacOS/Electron': 'code',\n  '/Applications/WebStorm.app/Contents/MacOS/webstorm': 'webstorm',\n};\n\nfunction addWorkspaceToArgumentsIfExists(args, workspace) {\n  if (workspace) {\n    args.unshift(workspace);\n  }\n  return args;\n}\n\nfunction getArgumentsForLineNumber(editor, fileName, lineNumber, workspace) {\n  switch (path.basename(editor)) {\n    case 'vim':\n    case 'mvim':\n      return [fileName, '+' + lineNumber];\n    case 'atom':\n    case 'Atom':\n    case 'Atom Beta':\n    case 'subl':\n    case 'sublime':\n    case 'webstorm':\n    case 'wstorm':\n    case 'appcode':\n    case 'charm':\n    case 'idea':\n      return [fileName + ':' + lineNumber];\n    case 'joe':\n    case 'emacs':\n    case 'emacsclient':\n      return ['+' + lineNumber, fileName];\n    case 'rmate':\n    case 'mate':\n    case 'mine':\n      return ['--line', lineNumber, fileName];\n    case 'code':\n      return addWorkspaceToArgumentsIfExists(['-g', fileName + ':' + lineNumber], workspace);\n  }\n\n  // For all others, drop the lineNumber until we have\n  // a mapping above, since providing the lineNumber incorrectly\n  // can result in errors or confusing behavior.\n  return [fileName];\n}\n\nfunction guessEditor() {\n  // Explicit config always wins\n  if (process.env.REACT_EDITOR) {\n    return shellQuote.parse(process.env.REACT_EDITOR);\n  }\n\n  // Using `ps x` on OSX we can find out which editor is currently running.\n  // Potentially we could use similar technique for Windows and Linux\n  if (process.platform === 'darwin') {\n    try {\n      var output = child_process.execSync('ps x').toString();\n      var processNames = Object.keys(COMMON_EDITORS);\n      for (var i = 0; i < processNames.length; i++) {\n        var processName = processNames[i];\n        if (output.indexOf(processName) !== -1) {\n          return [COMMON_EDITORS[processName]];\n        }\n      }\n    } catch (error) {\n      // Ignore...\n    }\n  }\n\n  // Last resort, use old skool env vars\n  if (process.env.VISUAL) {\n    return [process.env.VISUAL];\n  } else if (process.env.EDITOR) {\n    return [process.env.EDITOR];\n  }\n\n  return [null];\n}\n\nfunction printInstructions(title) {\n  console.log([\n    '',\n    chalk.bgBlue.white.bold(' ' + title + ' '),\n    '  When you see Red Box with stack trace, you can click any ',\n    '  stack frame to jump to the source file. The packager will launch your ',\n    '  editor of choice. It will first look at REACT_EDITOR environment ',\n    '  variable, then at EDITOR. To set it up, you can add something like ',\n    '  export REACT_EDITOR=atom to your ~/.bashrc or ~/.zshrc depending on ',\n    '  which shell you use.',\n    ''\n  ].join('\\n'));\n}\n\nfunction transformToAbsolutePathIfNeeded(pathName) {\n  if (!isAbsolutePath(pathName)) {\n    pathName = path.resolve(process.cwd(), pathName);\n  }\n  return pathName;\n}\n\nfunction findRootForFile(projectRoots, fileName) {\n  fileName = transformToAbsolutePathIfNeeded(fileName);\n  return projectRoots.find((root) => {\n    root = transformToAbsolutePathIfNeeded(root);\n    return fileName.startsWith(root + path.sep);\n  });\n}\n\nvar _childProcess = null;\nfunction launchEditor(fileName, lineNumber, projectRoots) {\n  if (!fs.existsSync(fileName)) {\n    return;\n  }\n\n  // Sanitize lineNumber to prevent malicious use on win32\n  // via: https://github.com/nodejs/node/blob/c3bb4b1aa5e907d489619fb43d233c3336bfc03d/lib/child_process.js#L333\n  if (lineNumber && isNaN(lineNumber)) {\n    return;\n  }\n\n  let [editor, ...args] = guessEditor();\n  if (!editor) {\n    printInstructions('PRO TIP');\n    return;\n  }\n\n  var workspace = findRootForFile(projectRoots, fileName);\n  if (lineNumber) {\n    args = args.concat(getArgumentsForLineNumber(editor, fileName, lineNumber, workspace));\n  } else {\n    args.push(fileName);\n  }\n  console.log('Opening ' + chalk.underline(fileName) + ' with ' + chalk.bold(editor));\n\n  if (_childProcess && isTerminalEditor(editor)) {\n    // There's an existing editor process already and it's attached\n    // to the terminal, so go kill it. Otherwise two separate editor\n    // instances attach to the stdin/stdout which gets confusing.\n    _childProcess.kill('SIGKILL');\n  }\n\n  if (process.platform === 'win32') {\n    // On Windows, launch the editor in a shell because spawn can only\n    // launch .exe files.\n    _childProcess = child_process.spawn('cmd.exe', ['/C', editor].concat(args), {stdio: 'inherit'});\n  } else {\n    _childProcess = child_process.spawn(editor, args, {stdio: 'inherit'});\n  }\n  _childProcess.on('exit', function(errorCode) {\n    _childProcess = null;\n\n    if (errorCode) {\n      console.log(chalk.red('Your editor exited with an error!'));\n      printInstructions('Keep these instructions in mind:');\n    }\n  });\n\n  _childProcess.on('error', function(error) {\n    console.log(chalk.red(error.message));\n    printInstructions('How to fix:');\n  });\n}\n\nmodule.exports = launchEditor;\n"
  },
  {
    "path": "local-cli/server/util/messageSocket.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst url = require('url');\nconst WebSocketServer = require('ws').Server;\nconst PROTOCOL_VERSION = 2;\nconst notifier = require('node-notifier');\n\nfunction parseMessage(data, binary) {\n  if (binary) {\n    console.error('Expected text message, got binary!');\n    return undefined;\n  }\n  try {\n    const message = JSON.parse(data);\n    if (message.version === PROTOCOL_VERSION) {\n      return message;\n    }\n    console.error('Received message had wrong protocol version: '\n                  + message.version);\n  } catch (e) {\n    console.error('Failed to parse the message as JSON:\\n' + data);\n  }\n  return undefined;\n}\n\nfunction isBroadcast(message) {\n  return (\n    typeof message.method === 'string' &&\n    message.id === undefined &&\n    message.target === undefined\n  );\n}\n\nfunction isRequest(message) {\n  return (\n    typeof message.method === 'string' &&\n    typeof message.target === 'string');\n}\n\nfunction isResponse(message) {\n  return (\n    typeof message.id === 'object' &&\n    typeof message.id.requestId !== undefined &&\n    typeof message.id.clientId === 'string' && (\n      message.result !== undefined ||\n      message.error !== undefined\n  ));\n}\n\nfunction attachToServer(server, path) {\n  const wss = new WebSocketServer({\n    server: server,\n    path: path\n  });\n  const clients = new Map();\n  let nextClientId = 0;\n\n  function getClientWs(clientId) {\n    const clientWs = clients.get(clientId);\n    if (clientWs === undefined) {\n      throw `could not find id \"${clientId}\" while forwarding request`;\n    }\n    return clientWs;\n  }\n\n  function handleSendBroadcast(broadcasterId, message) {\n    const forwarded = {\n      version: PROTOCOL_VERSION,\n      method: message.method,\n      params: message.params,\n    };\n    if (clients.size === 0) {\n      notifier.notify({\n        'title': 'React Native: No apps connected',\n        'message': `Sending '${message.method}' to all React Native apps ` +\n                  'failed. Make sure your app is running in the simulator ' +\n                  'or on a phone connected via USB.'\n      });\n    }\n    for (const [otherId, otherWs] of clients) {\n      if (otherId !== broadcasterId) {\n        try {\n          otherWs.send(JSON.stringify(forwarded));\n        } catch (e) {\n          console.error(`Failed to send broadcast to client: '${otherId}' ` +\n                        `due to:\\n ${e.toString()}`);\n        }\n      }\n    }\n  }\n\n  wss.on('connection', function(clientWs) {\n    const clientId = `client#${nextClientId++}`;\n\n    function handleCaughtError(message, error) {\n      const errorMessage = {\n        id: message.id,\n        method: message.method,\n        target: message.target,\n        error: message.error === undefined ? 'undefined' : 'defined',\n        params: message.params === undefined ? 'undefined' : 'defined',\n        result: message.result === undefined ? 'undefined' : 'defined',\n      };\n\n      if (message.id === undefined) {\n        console.error(\n          `Handling message from ${clientId} failed with:\\n${error}\\n` +\n          `message:\\n${JSON.stringify(errorMessage)}`);\n      } else {\n        try {\n          clientWs.send(JSON.stringify({\n            version: PROTOCOL_VERSION,\n            error: error,\n            id: message.id,\n          }));\n        } catch (e) {\n          console.error(`Failed to reply to ${clientId} with error:\\n${error}` +\n                        `\\nmessage:\\n${JSON.stringify(errorMessage)}` +\n                        `\\ndue to error: ${e.toString()}`);\n        }\n      }\n    }\n\n    function handleServerRequest(message) {\n      let result = null;\n      switch (message.method) {\n        case 'getid':\n          result = clientId;\n          break;\n        case 'getpeers':\n          result = {};\n          clients.forEach((otherWs, otherId) => {\n            if (clientId !== otherId) {\n              result[otherId] = url.parse(otherWs.upgradeReq.url, true).query;\n            }\n          });\n          break;\n        default:\n          throw `unkown method: ${message.method}`;\n      }\n\n      clientWs.send(JSON.stringify({\n        version: PROTOCOL_VERSION,\n        result: result,\n        id: message.id\n      }));\n    }\n\n    function forwardRequest(message) {\n      getClientWs(message.target).send(JSON.stringify({\n        version: PROTOCOL_VERSION,\n        method: message.method,\n        params: message.params,\n        id: (message.id === undefined\n          ? undefined\n          : {requestId: message.id, clientId: clientId}),\n      }));\n    }\n\n    function forwardResponse(message) {\n      getClientWs(message.id.clientId).send(JSON.stringify({\n        version: PROTOCOL_VERSION,\n        result: message.result,\n        error: message.error,\n        id: message.id.requestId,\n      }));\n    }\n\n    clients.set(clientId, clientWs);\n    clientWs.onclose =\n    clientWs.onerror = () => {\n      clientWs.onmessage = null;\n      clients.delete(clientId);\n    };\n    clientWs.onmessage = (event) => {\n      const message = parseMessage(event.data, event.binary);\n      if (message === undefined) {\n        console.error('Received message not matching protocol');\n        return;\n      }\n\n      try {\n        if (isBroadcast(message)) {\n          handleSendBroadcast(clientId, message);\n        } else if (isRequest(message)) {\n          if (message.target === 'server') {\n            handleServerRequest(message);\n          } else {\n            forwardRequest(message);\n          }\n        } else if (isResponse(message)) {\n          forwardResponse(message);\n        } else {\n          throw 'Invalid message, did not match the protocol';\n        }\n      } catch (e) {\n        handleCaughtError(message, e.toString());\n      }\n    };\n  });\n\n  return {\n    broadcast: (method, params) => {\n      handleSendBroadcast(null, {method: method, params: params});\n    }\n  };\n}\n\nmodule.exports = {\n  attachToServer: attachToServer,\n  parseMessage: parseMessage,\n};\n"
  },
  {
    "path": "local-cli/server/util/webSocketProxy.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\n\nfunction attachToServer(server, path) {\n  var WebSocketServer = require('ws').Server;\n  var wss = new WebSocketServer({\n    server: server,\n    path: path\n  });\n  var debuggerSocket, clientSocket;\n\n  function send(dest, message) {\n    if (!dest) {\n      return;\n    }\n\n    try {\n      dest.send(message);\n    } catch (e) {\n      console.warn(e);\n      // Sometimes this call throws 'not opened'\n    }\n  }\n\n  wss.on('connection', function(ws) {\n    const {url} = ws.upgradeReq;\n\n    if (url.indexOf('role=debugger') > -1) {\n      if (debuggerSocket) {\n        ws.close(1011, 'Another debugger is already connected');\n        return;\n      }\n      debuggerSocket = ws;\n      debuggerSocket.onerror =\n      debuggerSocket.onclose = () => {\n        debuggerSocket = null;\n        if (clientSocket) {\n          clientSocket.close(1011, 'Debugger was disconnected');\n        }\n      };\n      debuggerSocket.onmessage = ({data}) => send(clientSocket, data);\n    } else if (url.indexOf('role=client') > -1) {\n      if (clientSocket) {\n        clientSocket.onerror = clientSocket.onclose = clientSocket.onmessage = null;\n        clientSocket.close(1011, 'Another client connected');\n      }\n      clientSocket = ws;\n      clientSocket.onerror =\n      clientSocket.onclose = () => {\n        clientSocket = null;\n        send(debuggerSocket, JSON.stringify({method: '$disconnected'}));\n      };\n      clientSocket.onmessage = ({data}) => send(debuggerSocket, data);\n    } else {\n      ws.close(1011, 'Missing role param');\n    }\n  });\n\n  return {\n    server: wss,\n    isChromeConnected: function() {\n      return !!debuggerSocket;\n    }\n  };\n}\n\nmodule.exports = {\n  attachToServer: attachToServer\n};\n"
  },
  {
    "path": "local-cli/setup_env.bat",
    "content": ":: Copyright (c) 2015-present, Facebook, Inc.\n:: All rights reserved.\n::\n:: This source code is licensed under the BSD-style license found in the\n:: LICENSE file in the root directory of this source tree. An additional grant\n:: of patent rights can be found in the PATENTS file in the same directory.\n"
  },
  {
    "path": "local-cli/setup_env.sh",
    "content": "#!/usr/bin/env bash\n# Copyright (c) 2015-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\n# 2048 is the max for non root users on Mac\nulimit -n 2048\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/App.js",
    "content": "/**\n * This is an example React Native app demonstrates ListViews, text input and\n * navigation between a few screens.\n * https://github.com/facebook/react-native\n */\n\nimport React, { Component } from 'react';\nimport { StackNavigator } from 'react-navigation';\n\nimport HomeScreenTabNavigator from './views/HomeScreenTabNavigator';\nimport ChatScreen from './views/chat/ChatScreen';\n\n/**\n * Top-level navigator. Renders the application UI.\n */\nconst App = StackNavigator({\n  Home: {\n    screen: HomeScreenTabNavigator,\n  },\n  Chat: {\n    screen: ChatScreen,\n  },\n});\n\nexport default App;\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/README.md",
    "content": "# App template for new React Native apps\n\nThis is a simple React Native app template which demonstrates a few basics concepts such as navigation between a few screens, FlatLists, and handling text input.\n\n<img src=\"https://cloud.githubusercontent.com/assets/346214/22697898/ced66f52-ed4a-11e6-9b90-df6daef43199.gif\" alt=\"Android Example\" height=\"800\" style=\"float: left\"/>\n\n<img src=\"https://cloud.githubusercontent.com/assets/346214/22697901/cfeab3e4-ed4a-11e6-8552-d76585317ac2.gif\" alt=\"iOS Example\" height=\"800\"/>\n\n## Purpose\n\nThe idea is to make it easier for people to get started with React Native. Currently `react-native init` creates a very simple app that contains one screen with static text. Everyone new to React Native then needs to figure out how to do very basic things such as:\n- Rendering a list of items fetched from a server\n- Navigating between screens\n- Handling text input and the software keyboard\n\nThis app serves as a template used by `react-native init` so it is easier for anyone to get up and running quickly by having an app with a few screens and a FlatList ready to go.\n\n### Best practices\n\nAnother purpose of this app is to define best practices such as the folder structure of a standalone React Native app and naming conventions.\n\n## Not using Redux\n\nThis template intentionally doesn't use Redux. After discussing with a few people who have experience using Redux we concluded that adding Redux to this app targeted at beginners would make the code more confusing, and wouldn't clearly show the benefits of Redux (because the app is too small). There are already a few concepts to grasp - the React component lifecycle, rendering lists, using async / await, handling the software keyboard. We thought that's the maximum amount of things to learn at once. It's better for everyone to see patterns in their codebase as the app grows and decide for themselves whether and when they need Redux. See also the post [You Might Not Need Redux](https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367#.f3q7kq4b3) by [Dan Abramov](https://twitter.com/dan_abramov).\n\n## Not using Flow (for now)\n\nMany people are new to React Native, some are new to ES6 and most people will be new to Flow. Therefore we didn't want to introduce all these concepts all at once in a single codebase. However, it might make sense to later introduce a separate version of this template that uses Flow annotations.\n\n## Provide feedback\n\nWe need your feedback. Do you have a lot of experience building React Native apps? If so, please carefully read the code of the template and if you think something should be done differently, use issues in the repo [mkonicek/AppTemplateFeedback](https://github.com/mkonicek/AppTemplateFeedback) to discuss what should be done differently.\n\n## How to use the template\n\n```\n$ react-native init MyApp --template navigation\n$ cd MyApp\n$ react-native run-android\n$ react-native run-ios\n```\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/components/KeyboardSpacer.js",
    "content": "'use strict';\n\n/* @flow */\n\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n  Platform,\n  View,\n  Keyboard,\n  LayoutAnimation,\n} from 'react-native';\n\ntype Props = {\n  offset?: number,\n}\n\ntype State = {\n  keyboardHeight: number\n}\n\n// Consider contributing this to the popular library:\n// https://github.com/Andr3wHur5t/react-native-keyboard-spacer\n\n/**\n * On iOS, the software keyboard covers the screen by default.\n * This is not desirable if there are TextInputs near the bottom of the screen -\n * they would be covered by the keyboard and the user cannot see what they\n * are typing.\n * To get around this problem, place a `<KeyboardSpacer />` at the bottom\n * of the screen, after your TextInputs. The keyboard spacer has size 0 and\n * when the keyboard is shown it will grow to the same size as the keyboard,\n * shifting all views above it and therefore making them visible.\n *\n * On Android, this component is not needed because resizing the UI when\n * the keyboard is shown is supported by the OS.\n * Simply set the `android:windowSoftInputMode=\"adjustResize\"` attribute\n * on the <activity> element in your AndroidManifest.xml.\n *\n * How is this different from KeyboardAvoidingView?\n * The KeyboardAvoidingView doesn't work when used together with\n * a ScrollView/ListView.\n */\nconst KeyboardSpacer = () => (\n  Platform.OS === 'ios' ? <KeyboardSpacerIOS /> : null\n);\n\nclass KeyboardSpacerIOS extends Component<Props, State> {\n  static propTypes = {\n    offset: PropTypes.number,\n  };\n\n  static defaultProps = {\n    offset: 0,\n  };\n\n  state: State = {\n    keyboardHeight: 0,\n  };\n\n  componentWillMount() {\n    this._registerEvents();\n  }\n\n  componentWillUnmount() {\n    this._unRegisterEvents();\n  }\n\n  _keyboardWillShowSubscription: { +remove: Function };\n  _keyboardWillHideSubscription: { +remove: Function };\n\n  _registerEvents = () => {\n    this._keyboardWillShowSubscription = Keyboard.addListener(\n      'keyboardWillShow',\n      this._keyboardWillShow\n    );\n    this._keyboardWillHideSubscription = Keyboard.addListener(\n      'keyboardWillHide',\n      this._keyboardWillHide\n    );\n  };\n\n  _unRegisterEvents = () => {\n    this._keyboardWillShowSubscription.remove();\n    this._keyboardWillHideSubscription.remove();\n  };\n\n  _configureLayoutAnimation = () => {\n    // Any duration is OK here. The `type: 'keyboard defines the animation.\n    LayoutAnimation.configureNext({\n      duration: 100,\n      update: {\n        type: 'keyboard',\n      }\n    });\n  }\n\n  _keyboardWillShow = (e: any) => {\n    this._configureLayoutAnimation();\n    this.setState({\n      keyboardHeight: e.endCoordinates.height - (this.props.offset || 0),\n    });\n  };\n\n  _keyboardWillHide = () => {\n    this._configureLayoutAnimation();\n    this.setState({\n      keyboardHeight: 0,\n    });\n  };\n\n  render() {\n    return <View style={{ height: this.state.keyboardHeight }} />;\n  }\n}\n\nexport default KeyboardSpacer;\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/components/ListItem.js",
    "content": "'use strict';\n\nimport React, { Component } from 'react';\nimport {\n  Platform,\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  TouchableNativeFeedback,\n  View,\n} from 'react-native';\n\n/**\n * Renders the right type of Touchable for the list item, based on platform.\n */\nconst Touchable = ({onPress, children}) => {\n  const child = React.Children.only(children);\n  if (Platform.OS === 'android') {\n    return (\n      <TouchableNativeFeedback onPress={onPress}>\n        {child}\n      </TouchableNativeFeedback>\n    );\n  } else {\n    return (\n      <TouchableHighlight onPress={onPress} underlayColor=\"#ddd\">\n        {child}\n      </TouchableHighlight>\n    );\n  }\n};\n\nconst ListItem = ({label, onPress}) => (\n  <Touchable onPress={onPress}>\n    <View style={styles.item}>\n      <Text style={styles.label}>{label}</Text>\n    </View>\n  </Touchable>\n);\n\nconst styles = StyleSheet.create({\n  item: {\n    height: 48,\n    justifyContent: 'center',\n    paddingLeft: 12,\n    borderBottomWidth: StyleSheet.hairlineWidth,\n    borderBottomColor: '#ddd',\n  },\n  label: {\n    fontSize: 16,\n  }\n});\n\nexport default ListItem;\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/dependencies.json",
    "content": "{\n  \"react-navigation\": \"1.0.0-beta.11\"\n}\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/lib/Backend.js",
    "content": "'use strict';\n\n// This file just a dummy example of a HTTP API to talk to the backend.\n// The state of the \"database\" that would normally live on the server\n// is simply held here in memory.\n\nconst backendStateForLoggedInPerson = {\n  chats: [\n    {\n      name: 'Claire',\n      messages: [\n        {\n          name: 'Claire',\n          text: 'I ❤️ React Native!',\n        },\n      ],\n    },\n    {\n      name: 'John',\n      messages: [\n        {\n          name: 'John',\n          text: 'I ❤️ React Native!',\n        },\n      ],\n    }\n  ],\n};\n\n/**\n * Randomly simulate network failures.\n * It is useful to enable this during development to make sure our app works\n * in real-world conditions.\n */\nfunction isNetworkFailure() {\n  const chanceOfFailure = 0;  // 0..1\n  return Math.random() < chanceOfFailure;\n}\n\n/**\n * Helper for the other functions in this file.\n * Simulates a short delay and then returns a provided value or failure.\n * This is just a dummy example. Normally we'd make a HTTP request,\n * see http://facebook.github.io/react-native/docs/network.html\n */\nfunction _makeSimulatedNetworkRequest(getValue) {\n  const durationMs = 400;\n  return new Promise(function (resolve, reject) {\n    setTimeout(function () {\n      if (isNetworkFailure()) {\n        reject(new Error('Network failure'));\n      } else {\n        getValue(resolve, reject);\n      }\n    }, durationMs);\n  });\n}\n\n/**\n * Fetch a list of all chats for the logged in person.\n */\nasync function fetchChatList() {\n  return _makeSimulatedNetworkRequest((resolve, reject) => {\n    resolve(backendStateForLoggedInPerson.chats.map(chat => chat.name));\n  });\n}\n\n/**\n * Fetch a single chat.\n */\nasync function fetchChat(name) {\n  return _makeSimulatedNetworkRequest((resolve, reject) => {\n    resolve(\n      backendStateForLoggedInPerson.chats.find(\n        chat => chat.name === name\n      )\n    );\n  });\n}\n\n/**\n * Send given message to given person.\n */\nasync function sendMessage({name, message}) {\n  return _makeSimulatedNetworkRequest((resolve, reject) => {\n    const chatForName = backendStateForLoggedInPerson.chats.find(\n      chat => chat.name === name\n    );\n    if (chatForName) {\n      chatForName.messages.push({\n        name: 'Me',\n        text: message,\n      });\n      resolve();\n    } else {\n      reject(new Error('Uknown person: ' + name));\n    }\n  });\n}\n\nconst Backend = {\n  fetchChatList,\n  fetchChat,\n  sendMessage,\n};\n\nexport default Backend;\n\n// In case you are looking into using Redux for state management,\n// this is how network requests are done in the f8 app which uses Redux:\n// - To load some data, a Component fires a Redux action, such as loadSession()\n// - That action makes the HTTP requests and then dispatches a redux action\n//   {type: 'LOADED_SESSIONS', results}\n// - Then all reducers get called and one of them updates a part of the application\n//   state by storing the results\n// - Redux re-renders the connected Components\n// See https://github.com/fbsamples/f8app/search?utf8=%E2%9C%93&q=loaded_sessions\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/views/HomeScreenTabNavigator.js",
    "content": "import { TabNavigator } from 'react-navigation';\n\nimport ChatListScreen from './chat/ChatListScreen';\nimport WelcomeScreen from './welcome/WelcomeScreen';\n\n/**\n * Screen with tabs shown on app startup.\n */\nconst HomeScreenTabNavigator = TabNavigator({\n  Welcome: {\n    screen: WelcomeScreen,\n  },\n  Chats: {\n    screen: ChatListScreen,\n  },\n});\n\nexport default HomeScreenTabNavigator;\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/views/chat/ChatListScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  ActivityIndicator,\n  Image,\n  FlatList,\n  Platform,\n  StyleSheet,\n  View,\n} from 'react-native';\nimport ListItem from '../../components/ListItem';\nimport Backend from '../../lib/Backend';\n\nexport default class ChatListScreen extends Component {\n\n  static navigationOptions = {\n    title: 'Chats',\n    header: Platform.OS === 'ios' ? undefined : null,\n    tabBarIcon: ({ tintColor }) => (\n      <Image\n        // Using react-native-vector-icons works here too\n        source={require('./chat-icon.png')}\n        style={[styles.icon, {tintColor: tintColor}]}\n      />\n    ),\n  }\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      isLoading: true,\n    };\n  }\n\n  async componentDidMount() {\n    const chatList = await Backend.fetchChatList();\n    this.setState((prevState) => ({\n      chatList,\n      isLoading: false,\n    }));\n  }\n\n  // Binding the function so it can be passed to FlatList below\n  // and 'this' works properly inside renderItem\n  renderItem = ({ item }) => {\n    return (\n      <ListItem\n        label={item}\n        onPress={() => {\n          // Start fetching in parallel with animating\n          this.props.navigation.navigate('Chat', {\n            name: item,\n          });\n        }}\n      />\n    );\n  }\n\n  render() {\n    if (this.state.isLoading) {\n      return (\n        <View style={styles.loadingScreen}>\n          <ActivityIndicator />\n        </View>\n      );\n    }\n    return (\n      <FlatList\n        data={this.state.chatList}\n        renderItem={this.renderItem}\n        keyExtractor={(item, index) => index}\n        style={styles.listView}\n      />\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  loadingScreen: {\n    backgroundColor: 'white',\n    paddingTop: 8,\n    flex: 1,\n  },\n  listView: {\n    backgroundColor: 'white',\n  },\n  icon: {\n    width: 30,\n    height: 26,\n  },\n});\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/views/chat/ChatScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  ActivityIndicator,\n  Button,\n  FlatList,\n  StyleSheet,\n  Text,\n  TextInput,\n  View,\n} from 'react-native';\nimport KeyboardSpacer from '../../components/KeyboardSpacer';\nimport Backend from '../../lib/Backend';\n\nexport default class ChatScreen extends Component {\n\n  static navigationOptions = ({ navigation }) => ({\n    title: `Chat with ${navigation.state.params.name}`,\n  });\n  constructor(props) {\n    super(props);\n    this.state = {\n      messages: [],\n      myMessage: '',\n      isLoading: true,\n    };\n  }\n\n  async componentDidMount() {\n    let chat;\n    try {\n      chat = await Backend.fetchChat(this.props.navigation.state.params.name);\n    } catch (err) {\n      // Here we would handle the fact the request failed, e.g.\n      // set state to display \"Messages could not be loaded\".\n      // We should also check network connection first before making any\n      // network requests - maybe we're offline? See React Native's NetInfo\n      // module.\n      this.setState({\n        isLoading: false,\n      });\n      return;\n    }\n    this.setState((prevState) => ({\n      messages: chat.messages,\n      isLoading: false,\n    }));\n  }\n\n  onAddMessage = async () => {\n    // Optimistically update the UI\n    this.addMessageLocal();\n    // Send the request\n    try {\n      await Backend.sendMessage({\n        name: this.props.navigation.state.params.name,\n        // TODO Is reading state like this outside of setState OK?\n        // Can it contain a stale value?\n        message: this.state.myMessage,\n      });\n    } catch (err) {\n      // Here we would handle the request failure, e.g. call setState\n      // to display a visual hint showing the message could not be sent.\n    }\n  }\n\n  addMessageLocal = () => {\n    this.setState((prevState) => {\n      if (!prevState.myMessage) {\n        return prevState;\n      }\n      const messages = [\n        ...prevState.messages, {\n          name: 'Me',\n          text: prevState.myMessage,\n        }\n      ];\n      return {\n        messages: messages,\n        myMessage: '',\n      };\n    });\n    this.textInput.clear();\n  }\n\n  onMyMessageChange = (event) => {\n    this.setState({myMessage: event.nativeEvent.text});\n  }\n\n  renderItem = ({ item }) => (\n    <View style={styles.bubble}>\n      <Text style={styles.name}>{item.name}</Text>\n      <Text>{item.text}</Text>\n    </View>\n  )\n\n  render() {\n    if (this.state.isLoading) {\n      return (\n        <View style={styles.container}>\n          <ActivityIndicator />\n        </View>\n      );\n    }\n    return (\n      <View style={styles.container}>\n        <FlatList\n           data={this.state.messages}\n           renderItem={this.renderItem}\n           keyExtractor={(item, index) => index}\n           style={styles.listView}\n         />\n\n        <View style={styles.composer}>\n          <TextInput\n            ref={(textInput) => { this.textInput = textInput; }}\n            style={styles.textInput}\n            placeholder=\"Type a message...\"\n            text={this.state.myMessage}\n            onSubmitEditing={this.onAddMessage}\n            onChange={this.onMyMessageChange}\n          />\n          {this.state.myMessage !== '' && (\n            <Button\n              title=\"Send\"\n              onPress={this.onAddMessage}\n            />\n          )}\n        </View>\n        <KeyboardSpacer />\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    padding: 8,\n    backgroundColor: 'white',\n  },\n  listView: {\n    flex: 1,\n    alignSelf: 'stretch',\n  },\n  bubble: {\n    alignSelf: 'flex-end',\n    backgroundColor: '#d6f3fc',\n    padding: 12,\n    borderRadius: 4,\n    marginBottom: 4,\n  },\n  name: {\n    fontWeight: 'bold',\n  },\n  composer: {\n    flexDirection: 'row',\n    alignItems: 'center',\n    height: 36,\n  },\n  textInput: {\n    flex: 1,\n    borderColor: '#ddd',\n    borderWidth: 1,\n    padding: 4,\n    height: 30,\n    fontSize: 13,\n    marginRight: 8,\n  }\n});\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/views/welcome/WelcomeScreen.js",
    "content": "import React, { Component } from 'react';\nimport {\n  Image,\n  Platform,\n  StyleSheet,\n} from 'react-native';\n\nimport ListItem from '../../components/ListItem';\nimport WelcomeText from './WelcomeText';\n\nexport default class WelcomeScreen extends Component {\n\n  static navigationOptions = {\n    title: 'Welcome',\n    // You can now set header: null on any component to hide the header\n    header: Platform.OS === 'ios' ? undefined : null,\n    tabBarIcon: ({ tintColor }) => (\n      <Image\n        // Using react-native-vector-icons works here too\n        source={require('./welcome-icon.png')}\n        style={[styles.icon, {tintColor: tintColor}]}\n      />\n    ),\n  }\n\n  render() {\n    return (\n      <WelcomeText />\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  icon: {\n    width: 30,\n    height: 26,\n  },\n});\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/views/welcome/WelcomeText.android.js",
    "content": "import React, { Component } from 'react';\nimport {\n  StyleSheet,\n  Text,\n  View,\n} from 'react-native';\n\nexport default class WelcomeText extends Component {\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text style={styles.welcome}>\n          Welcome to React Native!\n        </Text>\n        <Text style={styles.instructions}>\n          This app shows the basics of navigating between a few screens,\n          working with ListView and handling text input.\n        </Text>\n        <Text style={styles.instructions}>\n          Modify any files to get started. For example try changing the\n          file views/welcome/WelcomeText.android.js.\n        </Text>\n        <Text style={styles.instructions}>\n          Double tap R on your keyboard to reload,{'\\n'}\n          Shake or press menu button for dev menu.\n        </Text>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: 'white',\n    padding: 20,\n  },\n  welcome: {\n    fontSize: 20,\n    textAlign: 'center',\n    margin: 16,\n  },\n  instructions: {\n    textAlign: 'center',\n    color: '#333333',\n    marginBottom: 12,\n  },\n});\n"
  },
  {
    "path": "local-cli/templates/HelloNavigation/views/welcome/WelcomeText.ios.js",
    "content": "import React, { Component } from 'react';\nimport {\n  StyleSheet,\n  Text,\n  View,\n} from 'react-native';\n\nexport default class WelcomeText extends Component {\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text style={styles.welcome}>\n          Welcome to React Native!\n        </Text>\n        <Text style={styles.instructions}>\n          This app shows the basics of navigating between a few screens,\n          working with ListView and handling text input.\n        </Text>\n        <Text style={styles.instructions}>\n          Modify any files to get started. For example try changing the\n          file{'\\n'}views/welcome/WelcomeText.ios.js.\n        </Text>\n        <Text style={styles.instructions}>\n          Press Cmd+R to reload,{'\\n'}\n          Cmd+D or shake for dev menu.\n        </Text>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: 'white',\n    padding: 20,\n  },\n  welcome: {\n    fontSize: 20,\n    textAlign: 'center',\n    margin: 16,\n  },\n  instructions: {\n    textAlign: 'center',\n    color: '#333333',\n    marginBottom: 12,\n  },\n});\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/App.js",
    "content": "/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n * @flow\n */\n\nimport React, { Component } from 'react';\nimport {\n  Platform,\n  StyleSheet,\n  Text,\n  View\n} from 'react-native';\n\nconst instructions = Platform.select({\n  ios: 'Press Cmd+R to reload,\\n' +\n    'Cmd+D or shake for dev menu',\n  android: 'Double tap R on your keyboard to reload,\\n' +\n    'Shake or press menu button for dev menu',\n});\n\ntype Props = {};\nexport default class App extends Component<Props> {\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text style={styles.welcome}>\n          Welcome to React Native!\n        </Text>\n        <Text style={styles.instructions}>\n          To get started, edit App.js\n        </Text>\n        <Text style={styles.instructions}>\n          {instructions}\n        </Text>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: '#F5FCFF',\n  },\n  welcome: {\n    fontSize: 20,\n    textAlign: 'center',\n    margin: 10,\n  },\n  instructions: {\n    textAlign: 'center',\n    color: '#333333',\n    marginBottom: 5,\n  },\n});\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/__tests__/App.js",
    "content": "import 'react-native';\nimport React from 'react';\nimport App from '../App';\n\n// Note: test renderer must be required after react-native.\nimport renderer from 'react-test-renderer';\n\nit('renders correctly', () => {\n  const tree = renderer.create(\n    <App />\n  );\n});\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/__tests__/index.macos.js",
    "content": "import 'react-native';\nimport React from 'react';\nimport Index from '../index.macos.js';\n\n// Note: test renderer must be required after react-native.\nimport renderer from 'react-test-renderer';\n\nit('renders correctly', () => {\n  const tree = renderer.create(\n    <Index />\n  );\n});\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/_babelrc",
    "content": "{\n  \"presets\": [\"react-native\"],\n  \"plugins\": [\n    [\"module-resolver\", {\n      \"alias\": {\n        \"react-native\": \"react-native-macos\"\n      }\n    }]\n  ]\n}\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/_flowconfig",
    "content": "[ignore]\n; We fork some components by platform\n.*/*[.]android.js\n.*/*[.]ios.js\n\n; Ignore \"BUCK\" generated dirs\n<PROJECT_ROOT>/\\.buckd/\n\n; Ignore unexpected extra \"@providesModule\"\n.*/node_modules/.*/node_modules/fbjs/.*\n\n; Ignore duplicate module providers\n; For RN Apps installed via npm, \"Libraries\" folder is inside\n; \"node_modules/react-native\" but in the source repo it is in the root\n.*/Libraries/react-native/React.js\n\n; Ignore polyfills\n.*/Libraries/polyfills/.*\n\n; Ignore metro\n.*/node_modules/metro/.*\n\n[include]\n\n[libs]\nnode_modules/react-native-macos/Libraries/react-native/react-native-interface.js\nnode_modules/react-native-macos/flow\nflow-github/\n\n[options]\nemoji=true\n\nmodule.system=haste\n\nmunge_underscores=true\nmodule.name_mapper='react-native' -> 'react-native-macos'\nmodule.name_mapper='^[./a-zA-Z0-9$_-]+\\.\\(bmp\\|gif\\|jpg\\|jpeg\\|png\\|psd\\|svg\\|webp\\|m4v\\|mov\\|mp4\\|mpeg\\|mpg\\|webm\\|aac\\|aiff\\|caf\\|m4a\\|mp3\\|wav\\|html\\|pdf\\)$' -> 'RelativeImageStub'\n\nmodule.file_ext=.js\nmodule.file_ext=.jsx\nmodule.file_ext=.json\nmodule.file_ext=.native.js\n\nsuppress_type=$FlowIssue\nsuppress_type=$FlowFixMe\nsuppress_type=$FlowFixMeProps\nsuppress_type=$FlowFixMeState\n\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowFixMe\\\\($\\\\|[^(]\\\\|(\\\\(<VERSION>\\\\)? *\\\\(site=[a-z,_]*react_native[a-z,_]*\\\\)?)\\\\)\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowIssue\\\\((\\\\(<VERSION>\\\\)? *\\\\(site=[a-z,_]*react_native[a-z,_]*\\\\)?)\\\\)?:? #[0-9]+\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowFixedInNextDeploy\nsuppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowExpectedError\n\n[version]\n^0.63.0\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/_gitattributes",
    "content": "*.pbxproj -text\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/_gitignore",
    "content": "# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\nproject.xcworkspace\n\n# Android/IntelliJ\n#\nbuild/\n.idea\n.gradle\nlocal.properties\n*.iml\n\n# node.js\n#\nnode_modules/\nnpm-debug.log\nyarn-error.log\n\n# BUCK\nbuck-out/\n\\.buckd/\n*.keystore\n\n# fastlane\n#\n# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the\n# screenshots whenever they are needed.\n# For more information about the recommended setup visit:\n# https://docs.fastlane.tools/best-practices/source-control/\n\n*/fastlane/report.xml\n*/fastlane/Preview.html\n*/fastlane/screenshots\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/_watchmanconfig",
    "content": "{}"
  },
  {
    "path": "local-cli/templates/HelloWorld/android/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nimport com.android.build.OutputFile\n\n/**\n * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets\n * and bundleReleaseJsAndAssets).\n * These basically call `react-native bundle` with the correct arguments during the Android build\n * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the\n * bundle directly from the development server. Below you can see all the possible configurations\n * and their defaults. If you decide to add a configuration block, make sure to add it before the\n * `apply from: \"../../node_modules/react-native/react.gradle\"` line.\n *\n * project.ext.react = [\n *   // the name of the generated asset file containing your JS bundle\n *   bundleAssetName: \"index.android.bundle\",\n *\n *   // the entry file for bundle generation\n *   entryFile: \"index.android.js\",\n *\n *   // whether to bundle JS and assets in debug mode\n *   bundleInDebug: false,\n *\n *   // whether to bundle JS and assets in release mode\n *   bundleInRelease: true,\n *\n *   // whether to bundle JS and assets in another build variant (if configured).\n *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants\n *   // The configuration property can be in the following formats\n *   //         'bundleIn${productFlavor}${buildType}'\n *   //         'bundleIn${buildType}'\n *   // bundleInFreeDebug: true,\n *   // bundleInPaidRelease: true,\n *   // bundleInBeta: true,\n *\n *   // whether to disable dev mode in custom build variants (by default only disabled in release)\n *   // for example: to disable dev mode in the staging build type (if configured)\n *   devDisabledInStaging: true,\n *   // The configuration property can be in the following formats\n *   //         'devDisabledIn${productFlavor}${buildType}'\n *   //         'devDisabledIn${buildType}'\n *\n *   // the root of your project, i.e. where \"package.json\" lives\n *   root: \"../../\",\n *\n *   // where to put the JS bundle asset in debug mode\n *   jsBundleDirDebug: \"$buildDir/intermediates/assets/debug\",\n *\n *   // where to put the JS bundle asset in release mode\n *   jsBundleDirRelease: \"$buildDir/intermediates/assets/release\",\n *\n *   // where to put drawable resources / React Native assets, e.g. the ones you use via\n *   // require('./image.png')), in debug mode\n *   resourcesDirDebug: \"$buildDir/intermediates/res/merged/debug\",\n *\n *   // where to put drawable resources / React Native assets, e.g. the ones you use via\n *   // require('./image.png')), in release mode\n *   resourcesDirRelease: \"$buildDir/intermediates/res/merged/release\",\n *\n *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means\n *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to\n *   // date; if you have any other folders that you want to ignore for performance reasons (gradle\n *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/\n *   // for example, you might want to remove it from here.\n *   inputExcludes: [\"android/**\", \"ios/**\"],\n *\n *   // override which node gets called and with what additional arguments\n *   nodeExecutableAndArgs: [\"node\"],\n *\n *   // supply additional arguments to the packager\n *   extraPackagerArgs: []\n * ]\n */\n\nproject.ext.react = [\n    entryFile: \"index.js\"\n]\n\napply from: \"../../node_modules/react-native/react.gradle\"\n\n/**\n * Set this to true to create two separate APKs instead of one:\n *   - An APK that only works on ARM devices\n *   - An APK that only works on x86 devices\n * The advantage is the size of the APK is reduced by about 4MB.\n * Upload all the APKs to the Play Store and people will download\n * the correct one based on the CPU architecture of their device.\n */\ndef enableSeparateBuildPerCPUArchitecture = false\n\n/**\n * Run Proguard to shrink the Java bytecode in release builds.\n */\ndef enableProguardInReleaseBuilds = false\n\nandroid {\n    compileSdkVersion 23\n    buildToolsVersion \"23.0.1\"\n\n    defaultConfig {\n        applicationId \"com.helloworld\"\n        minSdkVersion 16\n        targetSdkVersion 22\n        versionCode 1\n        versionName \"1.0\"\n        ndk {\n            abiFilters \"armeabi-v7a\", \"x86\"\n        }\n    }\n    splits {\n        abi {\n            reset()\n            enable enableSeparateBuildPerCPUArchitecture\n            universalApk false  // If true, also generate a universal APK\n            include \"armeabi-v7a\", \"x86\"\n        }\n    }\n    buildTypes {\n        release {\n            minifyEnabled enableProguardInReleaseBuilds\n            proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n        }\n    }\n    // applicationVariants are e.g. debug, release\n    applicationVariants.all { variant ->\n        variant.outputs.each { output ->\n            // For each separate APK per architecture, set a unique version code as described here:\n            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits\n            def versionCodes = [\"armeabi-v7a\":1, \"x86\":2]\n            def abi = output.getFilter(OutputFile.ABI)\n            if (abi != null) {  // null for the universal-debug, universal-release variants\n                output.versionCodeOverride =\n                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode\n            }\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: \"libs\", include: [\"*.jar\"])\n    compile \"com.android.support:appcompat-v7:23.0.1\"\n    compile \"com.facebook.react:react-native:+\"  // From node_modules\n}\n\n// Run this once to be able to run the application with BUCK\n// puts all compile dependencies into folder libs for BUCK to use\ntask copyDownloadableDepsToLibs(type: Copy) {\n    from configurations.compile\n    into 'libs'\n}\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/android/app/src/main/java/com/helloworld/MainApplication.java",
    "content": "package com.helloworld;\n\nimport android.app.Application;\n\nimport com.facebook.react.ReactApplication;\nimport com.facebook.react.ReactNativeHost;\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.shell.MainReactPackage;\nimport com.facebook.soloader.SoLoader;\n\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class MainApplication extends Application implements ReactApplication {\n\n  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {\n    @Override\n    public boolean getUseDeveloperSupport() {\n      return BuildConfig.DEBUG;\n    }\n\n    @Override\n    protected List<ReactPackage> getPackages() {\n      return Arrays.<ReactPackage>asList(\n          new MainReactPackage()\n      );\n    }\n\n    @Override\n    protected String getJSMainModuleName() {\n      return \"index\";\n    }\n  };\n\n  @Override\n  public ReactNativeHost getReactNativeHost() {\n    return mReactNativeHost;\n  }\n\n  @Override\n  public void onCreate() {\n    super.onCreate();\n    SoLoader.init(this, /* native exopackage */ false);\n  }\n}\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/index.js",
    "content": "import { AppRegistry } from 'react-native';\nimport App from './App';\n\nAppRegistry.registerComponent('HelloWorld', () => App);\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/ios/HelloWorld/AppDelegate.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"AppDelegate.h\"\n\n#import <React/RCTBundleURLProvider.h>\n#import <React/RCTRootView.h>\n\n@implementation AppDelegate\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n  NSURL *jsCodeLocation;\n\n  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\" fallbackResource:nil];\n\n  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation\n                                                      moduleName:@\"HelloWorld\"\n                                               initialProperties:nil\n                                                   launchOptions:launchOptions];\n  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];\n\n  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n  UIViewController *rootViewController = [UIViewController new];\n  rootViewController.view = rootView;\n  self.window.rootViewController = rootViewController;\n  [self.window makeKeyAndVisible];\n  return YES;\n}\n\n@end\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/ios/HelloWorld/Images.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorld/AppDelegate.h",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Cocoa/Cocoa.h>\n\n@class RCTBridge;\n\n@interface AppDelegate : NSObject <NSApplicationDelegate, NSWindowDelegate>\n\n@property (nonatomic, strong) NSWindow *window;\n@property (strong, nonatomic) NSArray<NSString *> *argv;\n@property (nonatomic, readonly) RCTBridge *bridge;\n\n@end\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorld/AppDelegate.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import \"AppDelegate.h\"\n\n#import <Cocoa/Cocoa.h>\n#import <React/RCTBundleURLProvider.h>\n#import <React/RCTRootView.h>\n\n@implementation AppDelegate\n\n-(id)init\n{\n  if(self = [super init]) {\n    NSRect contentSize = NSMakeRect(200, 500, 1000, 500); // initial size of main NSWindow\n\n    self.window = [[NSWindow alloc] initWithContentRect:contentSize\n                                             styleMask:\n                                                NSWindowStyleMaskTitled |\n                                                NSWindowStyleMaskResizable |\n                                                NSWindowStyleMaskFullSizeContentView |\n                                                NSWindowStyleMaskMiniaturizable |\n                                                NSWindowStyleMaskClosable\n                                               backing:NSBackingStoreBuffered\n                                                 defer:NO];\n\n    NSWindowController *windowController = [[NSWindowController alloc] initWithWindow:self.window];\n\n    [[self window] setTitleVisibility:NSWindowTitleHidden];\n    [[self window] setTitlebarAppearsTransparent:YES];\n    \n    [windowController setShouldCascadeWindows:NO];\n    [windowController setWindowFrameAutosaveName:@\"HelloWorld\"];\n\n    [windowController showWindow:self.window];\n\n    [self setUpApplicationMenu];\n  }\n  return self;\n}\n\n\n- (void)applicationDidFinishLaunching:(__unused NSNotification *)aNotification\n{\n  NSURL *jsCodeLocation;\n\n  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\" fallbackResource:nil];\n\n  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation\n                                                      moduleName:@\"HelloWorld\"\n                                               initialProperties:nil\n                                                   launchOptions:@{@\"argv\": [self argv]}];\n  rootView.material = NSVisualEffectMaterialAppearanceBased;\n  [self.window setContentView:rootView];\n}\n\n- (void)setUpApplicationMenu\n{\n  NSMenuItem *containerItem = [[NSMenuItem alloc] init];\n  NSMenu *rootMenu = [[NSMenu alloc] initWithTitle:@\"\" ];\n  [containerItem setSubmenu:rootMenu];\n  [rootMenu addItemWithTitle:@\"Quit HelloWorld\" action:@selector(terminate:) keyEquivalent:@\"q\"];\n  [[NSApp mainMenu] addItem:containerItem];\n}\n\n- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication * __unused)theApplication {\n  return YES;\n}\n\n@end\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorld/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleDisplayName</key>\n\t<string>Hello App Display Name</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>$(MACOSX_DEPLOYMENT_TARGET)</string>\n\t<key>NSAppTransportSecurity</key>\n\t<dict>\n\t\t<key>NSExceptionDomains</key>\n\t\t<dict>\n\t\t\t<key>localhost</key>\n\t\t\t<dict>\n\t\t\t\t<key>NSExceptionAllowsInsecureHTTPLoads</key>\n\t\t\t\t<true/>\n\t\t\t</dict>\n\t\t</dict>\n\t</dict>\n\t<key>NSLocationWhenInUseUsageDescription</key>\n\t<string></string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorld/main.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n\n#import \"AppDelegate.h\"\n\nint main(int argc, char * argv[]) {\n  @autoreleasepool {\n    NSApplication * application = [NSApplication sharedApplication];\n    NSMenu *mainMenu = [[NSMenu alloc] initWithTitle:@\"Application\"];\n    [NSApp setMainMenu:mainMenu];\n    AppDelegate * appDelegate = [[AppDelegate alloc] init];\n    [application setDelegate:appDelegate];\n    if (argc > 1) {\n      NSMutableArray *argvArray = [[NSMutableArray alloc] init];\n      for (int i = 1; i < argc; i++) {\n        [argvArray addObject:[[NSString alloc] initWithUTF8String:argv[i]]];\n      }\n      [appDelegate setArgv:argvArray];\n    } else {\n      [appDelegate setArgv:[[NSArray alloc] init]];\n    }\n\n    [application run];\n    return EXIT_SUCCESS;\n  }\n}\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorld-tvOS/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UIViewControllerBasedStatusBarAppearance</key>\n\t<false/>\n\t<key>NSLocationWhenInUseUsageDescription</key>\n\t<string></string>\n\t<key>NSAppTransportSecurity</key>\n\t<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->\n\t<dict>\n\t\t<key>NSExceptionDomains</key>\n\t\t<dict>\n\t\t\t<key>localhost</key>\n\t\t\t<dict>\n\t\t\t\t<key>NSExceptionAllowsInsecureHTTPLoads</key>\n\t\t\t\t<true/>\n\t\t\t</dict>\n\t\t</dict>\n\t</dict>\n</dict>\n</plist>\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorld-tvOSTests/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorld.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };\n\t\t00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };\n\t\t00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; };\n\t\t133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };\n\t\t139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };\n\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n\t\t140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };\n\t\t146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };\n\t\t2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n\t\t2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n\t\t2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */; };\n\t\t2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */; };\n\t\t2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */; };\n\t\t2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */; };\n\t\t2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */; };\n\t\t2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; };\n\t\t2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; };\n\t\t2DCD954D1E0B4F2C00145EB5 /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; };\n\t\t5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };\n\t\t832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5115D1A9E6B3D00147676;\n\t\t\tremoteInfo = RCTImage;\n\t\t};\n\t\t00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B511DB1A9E6C8500147676;\n\t\t\tremoteInfo = RCTNetwork;\n\t\t};\n\t\t00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 13B07F861A680F5B00A75B9A;\n\t\t\tremoteInfo = HelloWorld;\n\t\t};\n\t\t139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3C86DF461ADF2C930047B81A;\n\t\t\tremoteInfo = RCTWebSocket;\n\t\t};\n\t\t146834031AC3E56700842450 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;\n\t\t\tremoteInfo = React;\n\t\t};\n\t\t2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 2D02E47A1E0B4A5D006451C7;\n\t\t\tremoteInfo = \"HelloWorld-tvOS\";\n\t\t};\n\t\t2D16E6831FA4F8DC00B85C8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3DBE0D001F3B181A0099AA32;\n\t\t\tremoteInfo = fishhook;\n\t\t};\n\t\t2D16E6851FA4F8DC00B85C8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;\n\t\t\tremoteInfo = \"fishhook-tvOS\";\n\t\t};\n\t\t3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A283A1D9B042B00D4039D;\n\t\t\tremoteInfo = \"RCTImage-tvOS\";\n\t\t};\n\t\t3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28471D9B043800D4039D;\n\t\t\tremoteInfo = \"RCTLinking-tvOS\";\n\t\t};\n\t\t3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28541D9B044C00D4039D;\n\t\t\tremoteInfo = \"RCTNetwork-tvOS\";\n\t\t};\n\t\t3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A287B1D9B048500D4039D;\n\t\t\tremoteInfo = \"RCTText-tvOS\";\n\t\t};\n\t\t3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28881D9B049200D4039D;\n\t\t\tremoteInfo = \"RCTWebSocket-tvOS\";\n\t\t};\n\t\t3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28131D9B038B00D4039D;\n\t\t\tremoteInfo = \"React-tvOS\";\n\t\t};\n\t\t3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3C059A1DE3340900C268FA;\n\t\t\tremoteInfo = yoga;\n\t\t};\n\t\t3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3C06751DE3340C00C268FA;\n\t\t\tremoteInfo = \"yoga-tvOS\";\n\t\t};\n\t\t3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4;\n\t\t\tremoteInfo = cxxreact;\n\t\t};\n\t\t3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;\n\t\t\tremoteInfo = \"cxxreact-tvOS\";\n\t\t};\n\t\t3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4;\n\t\t\tremoteInfo = jschelpers;\n\t\t};\n\t\t3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;\n\t\t\tremoteInfo = \"jschelpers-tvOS\";\n\t\t};\n\t\t5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTAnimation;\n\t\t};\n\t\t5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 2D2A28201D9B03D100D4039D;\n\t\t\tremoteInfo = \"RCTAnimation-tvOS\";\n\t\t};\n\t\t78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 134814201AA4EA6300B7C361;\n\t\t\tremoteInfo = RCTLinking;\n\t\t};\n\t\t832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 58B5119B1A9E6C1200147676;\n\t\t\tremoteInfo = RCTText;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = \"<group>\"; };\n\t\t00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTImage.xcodeproj; path = \"../node_modules/react-native-macos/Libraries/Image/RCTImage.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTNetwork.xcodeproj; path = \"../node_modules/react-native-macos/Libraries/Network/RCTNetwork.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HelloWorldTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t00E356F21AD99517003FC87E /* HelloWorldTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HelloWorldTests.m; sourceTree = \"<group>\"; };\n\t\t139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTWebSocket.xcodeproj; path = \"../node_modules/react-native-macos/Libraries/WebSocket/RCTWebSocket.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t13B07F961A680F5B00A75B9A /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = HelloWorld/AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = HelloWorld/AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HelloWorld/Images.xcassets; sourceTree = \"<group>\"; };\n\t\t13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HelloWorld/Info.plist; sourceTree = \"<group>\"; };\n\t\t13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = \"<group>\"; };\n\t\t146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = React.xcodeproj; path = \"../node_modules/react-native-macos/React/React.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t2D02E47B1E0B4A5D006451C7 /* HelloWorld-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"HelloWorld-tvOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t2D02E4901E0B4A5D006451C7 /* HelloWorld-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = \"HelloWorld-tvOSTests.xctest\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTAnimation.xcodeproj; path = \"../node_modules/react-native-macos/Libraries/NativeAnimation/RCTAnimation.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTLinking.xcodeproj; path = \"../node_modules/react-native-macos/Libraries/LinkingIOS/RCTLinking.xcodeproj\"; sourceTree = \"<group>\"; };\n\t\t832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTText.xcodeproj; path = \"../node_modules/react-native-macos/Libraries/Text/RCTText.xcodeproj\"; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t00E356EB1AD99517003FC87E /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */,\n\t\t\t\t146834051AC3E58100842450 /* libReact.a in Frameworks */,\n\t\t\t\t5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */,\n\t\t\t\t00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,\n\t\t\t\t133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,\n\t\t\t\t00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,\n\t\t\t\t832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,\n\t\t\t\t139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D02E4781E0B4A5D006451C7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */,\n\t\t\t\t2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */,\n\t\t\t\t2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */,\n\t\t\t\t2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */,\n\t\t\t\t2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */,\n\t\t\t\t2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */,\n\t\t\t\t2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D02E48D1E0B4A5D006451C7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t00C302BC1ABCB91800DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302C01ABCB91800DB3ED1 /* libRCTImage.a */,\n\t\t\t\t3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00C302D41ABCB9D200DB3ED1 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */,\n\t\t\t\t3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00E356EF1AD99517003FC87E /* HelloWorldTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00E356F21AD99517003FC87E /* HelloWorldTests.m */,\n\t\t\t\t00E356F01AD99517003FC87E /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = HelloWorldTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t00E356F01AD99517003FC87E /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t00E356F11AD99517003FC87E /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t139FDEE71B06529A00C62182 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,\n\t\t\t\t3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */,\n\t\t\t\t2D16E6841FA4F8DC00B85C8A /* libfishhook.a */,\n\t\t\t\t2D16E6861FA4F8DC00B85C8A /* libfishhook-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t13B07FAE1A68108700A75B9A /* HelloWorld */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t008F07F21AC5B25A0029DE68 /* main.jsbundle */,\n\t\t\t\t13B07FAF1A68108700A75B9A /* AppDelegate.h */,\n\t\t\t\t13B07FB01A68108700A75B9A /* AppDelegate.m */,\n\t\t\t\t13B07FB51A68108700A75B9A /* Images.xcassets */,\n\t\t\t\t13B07FB61A68108700A75B9A /* Info.plist */,\n\t\t\t\t13B07FB71A68108700A75B9A /* main.m */,\n\t\t\t);\n\t\t\tname = HelloWorld;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t146834001AC3E56700842450 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t146834041AC3E56700842450 /* libReact.a */,\n\t\t\t\t3DAD3EA51DF850E9000B6D8A /* libyoga.a */,\n\t\t\t\t3DAD3EA71DF850E9000B6D8A /* libyoga.a */,\n\t\t\t\t3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */,\n\t\t\t\t3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */,\n\t\t\t\t3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */,\n\t\t\t\t3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */,\n\t\t\t\t3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2D16E6871FA4F8E400B85C8A /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2D16E6891FA4F8E400B85C8A /* libReact.a */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5E91572E1DD0AC6500FF2AA8 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */,\n\t\t\t\t5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t78C398B11ACF4ADC00677621 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t78C398B91ACF4ADC00677621 /* libRCTLinking.a */,\n\t\t\t\t3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t832341AE1AAA6A7D00B99B32 /* Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */,\n\t\t\t\t146833FF1AC3E56700842450 /* React.xcodeproj */,\n\t\t\t\t00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,\n\t\t\t\t78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,\n\t\t\t\t00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,\n\t\t\t\t832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,\n\t\t\t\t139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,\n\t\t\t);\n\t\t\tname = Libraries;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t832341B11AAA6A8300B99B32 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t832341B51AAA6A8300B99B32 /* libRCTText.a */,\n\t\t\t\t3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t83CBB9F61A601CBA00E9B192 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07FAE1A68108700A75B9A /* HelloWorld */,\n\t\t\t\t832341AE1AAA6A7D00B99B32 /* Libraries */,\n\t\t\t\t00E356EF1AD99517003FC87E /* HelloWorldTests */,\n\t\t\t\t83CBBA001A601CBA00E9B192 /* Products */,\n\t\t\t\t2D16E6871FA4F8E400B85C8A /* Frameworks */,\n\t\t\t);\n\t\t\tindentWidth = 2;\n\t\t\tsourceTree = \"<group>\";\n\t\t\ttabWidth = 2;\n\t\t\tusesTabs = 0;\n\t\t};\n\t\t83CBBA001A601CBA00E9B192 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t13B07F961A680F5B00A75B9A /* HelloWorld.app */,\n\t\t\t\t00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */,\n\t\t\t\t2D02E47B1E0B4A5D006451C7 /* HelloWorld-tvOS.app */,\n\t\t\t\t2D02E4901E0B4A5D006451C7 /* HelloWorld-tvOSTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t00E356ED1AD99517003FC87E /* HelloWorldTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget \"HelloWorldTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t00E356EA1AD99517003FC87E /* Sources */,\n\t\t\t\t00E356EB1AD99517003FC87E /* Frameworks */,\n\t\t\t\t00E356EC1AD99517003FC87E /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t00E356F51AD99517003FC87E /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = HelloWorldTests;\n\t\t\tproductName = HelloWorldTests;\n\t\t\tproductReference = 00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t13B07F861A680F5B00A75B9A /* HelloWorld */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"HelloWorld\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t13B07F871A680F5B00A75B9A /* Sources */,\n\t\t\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */,\n\t\t\t\t13B07F8E1A680F5B00A75B9A /* Resources */,\n\t\t\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = HelloWorld;\n\t\t\tproductName = \"Hello World\";\n\t\t\tproductReference = 13B07F961A680F5B00A75B9A /* HelloWorld.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t2D02E47A1E0B4A5D006451C7 /* HelloWorld-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget \"HelloWorld-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2D02E4771E0B4A5D006451C7 /* Sources */,\n\t\t\t\t2D02E4781E0B4A5D006451C7 /* Frameworks */,\n\t\t\t\t2D02E4791E0B4A5D006451C7 /* Resources */,\n\t\t\t\t2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"HelloWorld-tvOS\";\n\t\t\tproductName = \"HelloWorld-tvOS\";\n\t\t\tproductReference = 2D02E47B1E0B4A5D006451C7 /* HelloWorld-tvOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t2D02E48F1E0B4A5D006451C7 /* HelloWorld-tvOSTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget \"HelloWorld-tvOSTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2D02E48C1E0B4A5D006451C7 /* Sources */,\n\t\t\t\t2D02E48D1E0B4A5D006451C7 /* Frameworks */,\n\t\t\t\t2D02E48E1E0B4A5D006451C7 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"HelloWorld-tvOSTests\";\n\t\t\tproductName = \"HelloWorld-tvOSTests\";\n\t\t\tproductReference = 2D02E4901E0B4A5D006451C7 /* HelloWorld-tvOSTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t83CBB9F71A601CBA00E9B192 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t00E356ED1AD99517003FC87E = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.2;\n\t\t\t\t\t\tTestTargetID = 13B07F861A680F5B00A75B9A;\n\t\t\t\t\t};\n\t\t\t\t\t2D02E47A1E0B4A5D006451C7 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.2.1;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t2D02E48F1E0B4A5D006451C7 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.2.1;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t\tTestTargetID = 2D02E47A1E0B4A5D006451C7;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"HelloWorld\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 83CBB9F61A601CBA00E9B192;\n\t\t\tproductRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */;\n\t\t\t\t\tProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 78C398B11ACF4ADC00677621 /* Products */;\n\t\t\t\t\tProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;\n\t\t\t\t\tProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 832341B11AAA6A8300B99B32 /* Products */;\n\t\t\t\t\tProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 139FDEE71B06529A00C62182 /* Products */;\n\t\t\t\t\tProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 146834001AC3E56700842450 /* Products */;\n\t\t\t\t\tProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t13B07F861A680F5B00A75B9A /* HelloWorld */,\n\t\t\t\t00E356ED1AD99517003FC87E /* HelloWorldTests */,\n\t\t\t\t2D02E47A1E0B4A5D006451C7 /* HelloWorld-tvOS */,\n\t\t\t\t2D02E48F1E0B4A5D006451C7 /* HelloWorld-tvOSTests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\t00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTImage.a;\n\t\t\tremoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTNetwork.a;\n\t\t\tremoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTWebSocket.a;\n\t\t\tremoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t146834041AC3E56700842450 /* libReact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libReact.a;\n\t\t\tremoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2D16E6841FA4F8DC00B85C8A /* libfishhook.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libfishhook.a;\n\t\t\tremoteRef = 2D16E6831FA4F8DC00B85C8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t2D16E6861FA4F8DC00B85C8A /* libfishhook-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libfishhook-tvOS.a\";\n\t\t\tremoteRef = 2D16E6851FA4F8DC00B85C8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTImage-tvOS.a\";\n\t\t\tremoteRef = 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTLinking-tvOS.a\";\n\t\t\tremoteRef = 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTNetwork-tvOS.a\";\n\t\t\tremoteRef = 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTText-tvOS.a\";\n\t\t\tremoteRef = 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libRCTWebSocket-tvOS.a\";\n\t\t\tremoteRef = 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libReact-tvOS.a\";\n\t\t\tremoteRef = 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EA51DF850E9000B6D8A /* libyoga.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libyoga.a;\n\t\t\tremoteRef = 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EA71DF850E9000B6D8A /* libyoga.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libyoga.a;\n\t\t\tremoteRef = 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libcxxreact.a;\n\t\t\tremoteRef = 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libcxxreact.a;\n\t\t\tremoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjschelpers.a;\n\t\t\tremoteRef = 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libjschelpers.a;\n\t\t\tremoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTAnimation.a;\n\t\t\tremoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTAnimation.a;\n\t\t\tremoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTLinking.a;\n\t\t\tremoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t832341B51AAA6A8300B99B32 /* libRCTText.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = libRCTText.a;\n\t\t\tremoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t00E356EC1AD99517003FC87E /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F8E1A680F5B00A75B9A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D02E4791E0B4A5D006451C7 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D02E48E1E0B4A5D006451C7 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Bundle React Native code and images\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"export NODE_BINARY=node\\n../node_modules/react-native-macos/scripts/react-native-xcode.sh\";\n\t\t};\n\t\t2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Bundle React Native Code And Images\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"export NODE_BINARY=node\\n../node_modules/react-native-macos/scripts/react-native-xcode.sh\";\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t00E356EA1AD99517003FC87E /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t13B07F871A680F5B00A75B9A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,\n\t\t\t\t13B07FC11A68108700A75B9A /* main.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D02E4771E0B4A5D006451C7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */,\n\t\t\t\t2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2D02E48C1E0B4A5D006451C7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2DCD954D1E0B4F2C00145EB5 /* HelloWorldTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t00E356F51AD99517003FC87E /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 13B07F861A680F5B00A75B9A /* HelloWorld */;\n\t\t\ttargetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;\n\t\t};\n\t\t2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 2D02E47A1E0B4A5D006451C7 /* HelloWorld-tvOS */;\n\t\t\ttargetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin XCBuildConfiguration section */\n\t\t00E356F61AD99517003FC87E /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = HelloWorldTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/HelloWorld.app/Contents/MacOS/HelloWorld\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t00E356F71AD99517003FC87E /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tINFOPLIST_FILE = HelloWorldTests/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/HelloWorld.app/Contents/MacOS/HelloWorld\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t13B07F941A680F5B00A75B9A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEAD_CODE_STRIPPING = NO;\n\t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = HelloWorld;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t13B07F951A680F5B00A75B9A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = HelloWorld;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t2D02E4971E0B4A5E006451C7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = \"App Icon & Top Shelf Image\";\n\t\t\t\tASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = \"HelloWorld-tvOS/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.HelloWorld-tvOS\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = 3;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D02E4981E0B4A5E006451C7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = \"App Icon & Top Shelf Image\";\n\t\t\t\tASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = \"HelloWorld-tvOS/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-ObjC\",\n\t\t\t\t\t\"-lc++\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.HelloWorld-tvOS\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = 3;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t2D02E4991E0B4A5E006451C7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = \"HelloWorld-tvOSTests/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.HelloWorld-tvOSTests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/HelloWorld-tvOS.app/HelloWorld-tvOS\";\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 10.1;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2D02E49A1E0B4A5E006451C7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tINFOPLIST_FILE = \"HelloWorld-tvOSTests/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.facebook.REACT.HelloWorld-tvOSTests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/HelloWorld-tvOS.app/HelloWorld-tvOS\";\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 10.1;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t83CBBA201A601CBA00E9B192 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t83CBBA211A601CBA00E9B192 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget \"HelloWorldTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t00E356F61AD99517003FC87E /* Debug */,\n\t\t\t\t00E356F71AD99517003FC87E /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"HelloWorld\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t13B07F941A680F5B00A75B9A /* Debug */,\n\t\t\t\t13B07F951A680F5B00A75B9A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget \"HelloWorld-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D02E4971E0B4A5E006451C7 /* Debug */,\n\t\t\t\t2D02E4981E0B4A5E006451C7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget \"HelloWorld-tvOSTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2D02E4991E0B4A5E006451C7 /* Debug */,\n\t\t\t\t2D02E49A1E0B4A5E006451C7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject \"HelloWorld\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t83CBBA201A601CBA00E9B192 /* Debug */,\n\t\t\t\t83CBBA211A601CBA00E9B192 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;\n}\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-tvOS.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0820\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"NO\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2D2A28121D9B038B00D4039D\"\n               BuildableName = \"libReact.a\"\n               BlueprintName = \"React-tvOS\"\n               ReferencedContainer = \"container:../node_modules/react-native/React/React.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2D02E47A1E0B4A5D006451C7\"\n               BuildableName = \"HelloWorld-tvOS.app\"\n               BlueprintName = \"HelloWorld-tvOS\"\n               ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"NO\"\n            buildForArchiving = \"NO\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2D02E48F1E0B4A5D006451C7\"\n               BuildableName = \"HelloWorld-tvOSTests.xctest\"\n               BlueprintName = \"HelloWorld-tvOSTests\"\n               ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2D02E48F1E0B4A5D006451C7\"\n               BuildableName = \"HelloWorld-tvOSTests.xctest\"\n               BlueprintName = \"HelloWorld-tvOSTests\"\n               ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"2D02E47A1E0B4A5D006451C7\"\n            BuildableName = \"HelloWorld-tvOS.app\"\n            BlueprintName = \"HelloWorld-tvOS\"\n            ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"2D02E47A1E0B4A5D006451C7\"\n            BuildableName = \"HelloWorld-tvOS.app\"\n            BlueprintName = \"HelloWorld-tvOS\"\n            ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"2D02E47A1E0B4A5D006451C7\"\n            BuildableName = \"HelloWorld-tvOS.app\"\n            BlueprintName = \"HelloWorld-tvOS\"\n            ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0620\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"NO\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"83CBBA2D1A601D0E00E9B192\"\n               BuildableName = \"libReact.a\"\n               BlueprintName = \"React\"\n               ReferencedContainer = \"container:../node_modules/react-native-macos/React/React.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n               BuildableName = \"HelloWorld.app\"\n               BlueprintName = \"HelloWorld\"\n               ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"NO\"\n            buildForArchiving = \"NO\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"00E356ED1AD99517003FC87E\"\n               BuildableName = \"HelloWorldTests.xctest\"\n               BlueprintName = \"HelloWorldTests\"\n               ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"00E356ED1AD99517003FC87E\"\n               BuildableName = \"HelloWorldTests.xctest\"\n               BlueprintName = \"HelloWorldTests\"\n               ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"HelloWorld.app\"\n            BlueprintName = \"HelloWorld\"\n            ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"HelloWorld.app\"\n            BlueprintName = \"HelloWorld\"\n            ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n            BuildableName = \"HelloWorld.app\"\n            BlueprintName = \"HelloWorld\"\n            ReferencedContainer = \"container:HelloWorld.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorldTests/HelloWorldTests.m",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <AppKit/AppKit.h>\n#import <XCTest/XCTest.h>\n\n#import <React/RCTLog.h>\n#import <React/RCTRootView.h>\n#import \"AppDelegate.h\"\n\n#define TIMEOUT_SECONDS 60\n#define TEXT_TO_LOOK_FOR @\"Welcome to React Native macOS!\"\n\n@interface HelloWorldTests : XCTestCase\n\n@end\n\n@implementation HelloWorldTests\n\n- (BOOL)findSubviewInView:(NSView *)view matching:(BOOL(^)(NSView *view))test\n{\n  if (test(view)) {\n    return YES;\n  }\n  for (NSView *subview in [view subviews]) {\n    if ([self findSubviewInView:subview matching:test]) {\n      return YES;\n    }\n  }\n  return NO;\n}\n\n- (void)testRendersWelcomeScreen\n{\n  [[RCTSharedApplication() mainWindow] makeKeyAndOrderFront:self];\n  [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:2]];\n  [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:2]];\n  AppDelegate *delegate = (AppDelegate *)[RCTSharedApplication() delegate];\n  NSView *rootView = delegate.window.contentView;\n  XCTAssertNotNil(rootView, @\"contentView shouldn't be null\");\n\n  NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];\n  BOOL foundElement = NO;\n\n  __block NSString *redboxError = nil;\n  RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {\n    if (level >= RCTLogLevelError) {\n      redboxError = message;\n    }\n  });\n\n  while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {\n    [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];\n    [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];\n\n    foundElement = [self findSubviewInView:rootView matching:^BOOL(NSView *view) {\n      if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {\n        return YES;\n      }\n      return NO;\n    }];\n  }\n\n  RCTSetLogFunction(RCTDefaultLogFunction);\n\n  XCTAssertNil(redboxError, @\"RedBox error: %@\", redboxError);\n  XCTAssertTrue(foundElement, @\"Couldn't find element with text '%@' in %d seconds\", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);\n}\n\n\n@end\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/macos/HelloWorldTests/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "local-cli/templates/HelloWorld/rn-cli.config.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * React Native CLI configuration file\n *\n * @format\n *\n */\n'use strict';\n\nmodule.exports = {\n  getProvidesModuleNodeModules: () => ['react-native-macos'],\n  getPlatforms: () => 'macos',\n};\n"
  },
  {
    "path": "local-cli/templates/README.md",
    "content": "# App templates\n\nThis folder contains basic app templates. These get expanded by 'react-native init' when creating a new app to make it easier for anyone to get started.\n\n# Chat Example\n\nThis is an example React Native app demonstrates ListViews, text input and\nnavigation between a few screens.\n\n<img width=\"487\" alt=\"screenshot 2017-01-13 17 24 37\" src=\"https://cloud.githubusercontent.com/assets/346214/21950983/54d75cb4-d9b5-11e6-9d63-bd7edf51f4d4.png\">\n<img width=\"487\" alt=\"screenshot 2017-01-13 17 24 40\" src=\"https://cloud.githubusercontent.com/assets/346214/21950982/54d6797a-d9b5-11e6-829f-3e0f15dab0c1.png\">\n\n## Purpose\n\nOne problem with React Native is that it is not trivial to get started: `react-native init` creates a very simple app that renders some text. Everyone then has to figure out how to do very basic things such as adding a list of items fetched from a server, navigating to a screen when a list item is tapped, or handling text input.\n\nThis app is a template used by `react-native init` so it is easier for anyone to get up and running quickly by having an app with a few screens, a `ListView` and a `TextInput` that works well with the software keyboard.\n\n## Best practices\n\nAnother purpose of this app is to define best practices such as:\n- The folder structure of a standalone React Native app\n- A style guide for JavaScript and React - for this we use the [AirBnb style guide](https://github.com/airbnb/javascript)\n- Naming conventions\n\nWe need your feedback to settle on a good set of best practices. Have you built React Native apps? If so, please use the issues in the repo [mkonicek/ChatExample](https://github.com/mkonicek/ChatExample) to discuss what you think are the best practices that this example should be using.\n\n## Running the app locally\n\n```\ncd ChatExample\nyarn\nreact-native run-ios\nreact-native run-android\n```\n\n--- \n(In case you want to use react-navigation master):\n\n```\n# Install dependencies:\ncd react-navigation\nyarn\nyarn pack --filename react-navigation-1.0.0-alpha.tgz\ncd ChatExample\nyarn\nyarn add ~/code/react-navigation/react-navigation-1.0.0-alpha.tgz\n```\n"
  },
  {
    "path": "local-cli/upgrade/upgrade.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst chalk = require('chalk');\nconst copyProjectTemplateAndReplace = require('../generator/copyProjectTemplateAndReplace');\nconst fs = require('fs');\nconst path = require('path');\nconst printRunInstructions = require('../generator/printRunInstructions');\nconst semver = require('semver');\nconst yarn = require('../util/yarn');\n\n/**\n * Migrate application to a new version of React Native.\n * See http://facebook.github.io/react-native/docs/upgrading.html\n *\n * IMPORTANT: Assumes the cwd() is the project directory.\n * The code here must only be invoked via the CLI:\n * $ cd MyAwesomeApp\n * $ react-native upgrade\n */\nfunction validateAndUpgrade() {\n  const projectDir = process.cwd();\n\n  const packageJSON = JSON.parse(\n      fs.readFileSync(path.resolve(projectDir, 'package.json'), 'utf8')\n  );\n\n  warn(\n    'You should consider using the new upgrade tool based on Git. It ' +\n    'makes upgrades easier by resolving most conflicts automatically.\\n' +\n    'To use it:\\n' +\n    '- Go back to the old version of React Native\\n' +\n    '- Run \"npm install -g react-native-git-upgrade\"\\n' +\n    '- Run \"react-native-git-upgrade\"\\n' +\n    'See https://facebook.github.io/react-native/docs/upgrading.html'\n  );\n\n  const projectName = packageJSON.name;\n  if (!projectName) {\n    warn(\n      'Your project needs to have a name, declared in package.json, ' +\n      'such as \"name\": \"AwesomeApp\". Please add a project name. Aborting.'\n    );\n    return;\n  }\n\n  const version = packageJSON.dependencies['react-native'];\n  if (!version) {\n    warn(\n      'Your \"package.json\" file doesn\\'t seem to declare \"react-native\" as ' +\n      'a dependency. Nothing to upgrade. Aborting.'\n    );\n    return;\n  }\n\n  if (version === 'latest' || version === '*') {\n    warn(\n      'Some major releases introduce breaking changes.\\n' +\n      'Please use a caret version number in your \"package.json\" file \\n' +\n      'to avoid breakage. Use e.g. react-native: ^0.38.0. Aborting.'\n    );\n    return;\n  }\n\n  const installed = JSON.parse(\n    fs.readFileSync(\n      path.resolve(projectDir, 'node_modules/react-native/package.json'),\n      'utf8'\n    )\n  );\n\n  if (!semver.satisfies(installed.version, version)) {\n    warn(\n      'react-native version in \"package.json\" doesn\\'t match ' +\n      'the installed version in \"node_modules\".\\n' +\n      'Try running \"npm install\" to fix this. Aborting.'\n    );\n    return;\n  }\n\n  const v = version.replace(/^(~|\\^|=)/, '').replace(/x/i, '0');\n\n  if (!semver.valid(v)) {\n    warn(\n      \"A valid version number for 'react-native' is not specified in your \" +\n      \"'package.json' file. Aborting.\"\n    );\n    return;\n  }\n\n  console.log(\n    'Upgrading project to react-native v' + installed.version + '\\n' +\n    'Check out the release notes and breaking changes: ' +\n    'https://github.com/facebook/react-native/releases/tag/v' +\n    semver.major(v) + '.' + semver.minor(v) + '.0'\n  );\n\n  // >= v0.21.0, we require react to be a peer dependency\n  if (semver.gte(v, '0.21.0') && !packageJSON.dependencies.react) {\n    warn(\n      'Your \"package.json\" file doesn\\'t seem to have \"react\" as a dependency.\\n' +\n      '\"react\" was changed from a dependency to a peer dependency in react-native v0.21.0.\\n' +\n      'Therefore, it\\'s necessary to include \"react\" in your project\\'s dependencies.\\n' +\n      'Please run \"npm install --save react\", then re-run \"react-native upgrade\".\\n'\n    );\n    return;\n  }\n\n  if (semver.satisfies(v, '~0.26.0')) {\n    warn(\n      'React Native 0.26 introduced some breaking changes to the native files on iOS. You can\\n' +\n      'perform them manually by checking the release notes or use \"rnpm\" ' +\n      'to do it automatically.\\n' +\n      'Just run:\\n' +\n      '\"npm install -g rnpm && npm install rnpm-plugin-upgrade@0.26 --save-dev\", ' +\n      'then run \"rnpm upgrade\".'\n    );\n  }\n\n  return new Promise((resolve) => {\n    upgradeProjectFiles(projectDir, projectName);\n    console.log(\n      'Successfully upgraded this project to react-native v' + installed.version\n    );\n    resolve();\n  });\n}\n\n/**\n * Once all checks passed, upgrade the project files.\n */\nfunction upgradeProjectFiles(projectDir, projectName) {\n  // Just owerwrite\n  copyProjectTemplateAndReplace(\n    path.resolve('node_modules', 'react-native', 'local-cli', 'templates', 'HelloWorld'),\n    projectDir,\n    projectName,\n    {upgrade: true}\n  );\n}\n\nfunction warn(message) {\n  console.warn(chalk.yellow(message));\n}\n\nconst upgradeCommand = {\n  name: 'upgrade',\n  description: 'upgrade your app\\'s template files to the latest version; run this after ' +\n    'updating the react-native version in your package.json and running npm install',\n  func: validateAndUpgrade,\n};\n\nmodule.exports = upgradeCommand;\n"
  },
  {
    "path": "local-cli/util/Config.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @flow\n */\n'use strict';\n\nconst findSymlinkedModules = require('./findSymlinkedModules');\nconst fs = require('fs');\nconst getPolyfills = require('../../rn-get-polyfills');\nconst invariant = require('fbjs/lib/invariant');\nconst path = require('path');\n\nconst {Config: MetroConfig} = require('metro');\n\nconst RN_CLI_CONFIG = 'rn-cli.config.js';\n\nimport type {ConfigT as MetroConfigT} from 'metro';\n\n/**\n * Configuration file of the CLI.\n */\nexport type ConfigT = MetroConfigT;\n\nfunction getProjectPath() {\n  if (\n    __dirname.match(/node_modules[\\/\\\\]react-native-macos[\\/\\\\]local-cli[\\/\\\\]util$/)\n  ) {\n    // Packager is running from node_modules.\n    // This is the default case for all projects created using 'react-native init'.\n    return path.resolve(__dirname, '../../../..');\n  } else if (__dirname.match(/Pods[\\/\\\\]React[\\/\\\\]packager$/)) {\n    // React Native was installed using CocoaPods.\n    return path.resolve(__dirname, '../../../..');\n  }\n  return path.resolve(__dirname, '../..');\n}\n\nconst resolveSymlinksForRoots = roots =>\n  roots.reduce(\n    (arr, rootPath) => arr.concat(findSymlinkedModules(rootPath, roots)),\n    [...roots],\n  );\n\nconst getProjectRoots = () => {\n  const root = process.env.REACT_NATIVE_APP_ROOT;\n  if (root) {\n    return resolveSymlinksForRoots([path.resolve(root)]);\n  }\n  return resolveSymlinksForRoots([getProjectPath()]);\n};\n\n/**\n * Module capable of getting the configuration out of a given file.\n *\n * The function will return all the default configuration, as specified by the\n * `DEFAULT` param overriden by those found on `rn-cli.config.js` files, if any. If no\n * default config is provided and no configuration can be found in the directory\n * hierarchy, an error will be thrown.\n */\nconst Config = {\n  DEFAULT: ({\n    ...MetroConfig.DEFAULT,\n    getProjectRoots,\n    getPolyfills,\n    getModulesRunBeforeMainModule: () => [\n      require.resolve('../../Libraries/Core/InitializeCore'),\n    ],\n  }: ConfigT),\n\n  find(startDir: string): ConfigT {\n    return this.findWithPath(startDir).config;\n  },\n\n  findWithPath(startDir: string): {config: ConfigT, projectPath: string} {\n    const configPath = findConfigPath(startDir);\n    invariant(\n      configPath,\n      `Can't find \"${RN_CLI_CONFIG}\" file in any parent folder of \"${startDir}\"`,\n    );\n    const projectPath = path.dirname(configPath);\n    return {config: this.load(configPath, startDir), projectPath};\n  },\n\n  findOptional(startDir: string): ConfigT {\n    const configPath = findConfigPath(startDir);\n    return configPath ? this.load(configPath, startDir) : {...Config.DEFAULT};\n  },\n\n  load(configFile: string): ConfigT {\n    return MetroConfig.load(configFile, Config.DEFAULT);\n  },\n};\n\nfunction findConfigPath(cwd: string): ?string {\n  const parentDir = findParentDirectory(cwd, RN_CLI_CONFIG);\n  return parentDir ? path.join(parentDir, RN_CLI_CONFIG) : null;\n}\n\n// Finds the most near ancestor starting at `currentFullPath` that has\n// a file named `filename`\nfunction findParentDirectory(currentFullPath, filename) {\n  const root = path.parse(currentFullPath).root;\n  const testDir = parts => {\n    if (parts.length === 0) {\n      return null;\n    }\n\n    const fullPath = path.join(root, parts.join(path.sep));\n\n    var exists = fs.existsSync(path.join(fullPath, filename));\n    return exists ? fullPath : testDir(parts.slice(0, -1));\n  };\n\n  return testDir(currentFullPath.substring(root.length).split(path.sep));\n}\n\nmodule.exports = Config;\n"
  },
  {
    "path": "local-cli/util/PackageManager.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst spawnSync = require('child_process').spawnSync;\nconst yarn = require('../util/yarn');\nconst spawnOpts = {\n  stdio: 'inherit',\n  stdin: 'inherit',\n};\n\n/**\n * Execute npm or yarn command\n *\n * @param  {String} yarnCommand Yarn command to be executed eg. yarn add package\n * @param  {String} npmCommand  Npm command to be executed eg. npm install package\n * @return {object}             spawnSync's result object\n */\nfunction callYarnOrNpm(yarnCommand, npmCommand) {\n  let command;\n\n  const projectDir = process.cwd();\n  const isYarnAvailable =\n    yarn.getYarnVersionIfAvailable() &&\n    yarn.isGlobalCliUsingYarn(projectDir);\n\n  if (isYarnAvailable) {\n    command = yarnCommand;\n  } else {\n    command = npmCommand;\n  }\n\n  const args = command.split(' ');\n  const cmd = args.shift();\n\n  const res = spawnSync(cmd, args, spawnOpts);\n\n  return res;\n}\n\n/**\n * Install package into project using npm or yarn if available\n * @param  {[type]} packageName Package to be installed\n * @return {[type]}             spawnSync's result object\n */\nfunction add(packageName) {\n  return callYarnOrNpm(\n    `yarn add ${packageName}`,\n    `npm install ${packageName} --save`\n  );\n}\n\n/**\n * Uninstall package from project using npm or yarn if available\n * @param  {[type]} packageName Package to be uninstalled\n * @return {Object}             spawnSync's result object\n */\nfunction remove(packageName) {\n  return callYarnOrNpm(\n    `yarn remove ${packageName}`,\n    `npm uninstall --save ${packageName}`\n  );\n}\n\nmodule.exports = {\n  add: add,\n  remove: remove,\n};\n"
  },
  {
    "path": "local-cli/util/__mocks__/log.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nmodule.exports.out = () => jest.genMockFn();\nmodule.exports.err = () => jest.genMockFn();\n"
  },
  {
    "path": "local-cli/util/__tests__/findSymlinkedModules-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @emails oncall+javascript_foundation\n */\n\njest.mock('fs');\n\nconst fs = require('fs');\nconst findSymlinkedModules = require('../findSymlinkedModules');\n\ndescribe('findSymlinksForProjectRoot', () => {\n  it('correctly finds normal module symlinks', () => {\n    fs.__setMockFilesystem({\n      root: {\n        projectA: {\n          'package.json': JSON.stringify({\n            name: 'projectA',\n            main: 'main.js',\n          }),\n          node_modules: {\n            depFoo: {\n              'package.json': JSON.stringify({\n                name: 'depFoo',\n                main: 'main.js',\n              }),\n            },\n            projectB: {\n              SYMLINK: '/root/projectB',\n            },\n          },\n        },\n        projectB: {\n          'package.json': JSON.stringify({\n            name: 'projectB',\n            main: 'main.js',\n          }),\n          node_modules: {\n            depBar: {\n              'package.json': JSON.stringify({\n                name: 'depBar',\n                main: 'main.js',\n              }),\n            },\n          },\n        },\n      },\n    });\n\n    const symlinkedModules = findSymlinkedModules('/root/projectA', []);\n    expect(symlinkedModules).toEqual(['/root/projectB']);\n  });\n\n  it('correctly finds scoped module symlinks', () => {\n    fs.__setMockFilesystem({\n      root: {\n        projectA: {\n          'package.json': JSON.stringify({\n            name: 'projectA',\n            main: 'main.js',\n          }),\n          node_modules: {\n            depFoo: {\n              'package.json': JSON.stringify({\n                name: 'depFoo',\n                main: 'main.js',\n              }),\n            },\n            '@scoped': {\n              projectC: {\n                SYMLINK: '/root/@scoped/projectC',\n              },\n            },\n            projectB: {\n              SYMLINK: '/root/projectB',\n            },\n          },\n        },\n        projectB: {\n          'package.json': JSON.stringify({\n            name: 'projectB',\n            main: 'main.js',\n          }),\n          node_modules: {\n            depBar: {\n              'package.json': JSON.stringify({\n                name: 'depBar',\n                main: 'main.js',\n              }),\n            },\n          },\n        },\n        '@scoped': {\n          projectC: {\n            'package.json': JSON.stringify({\n              name: '@scoped/projectC',\n              main: 'main.js',\n            }),\n          },\n        },\n      },\n    });\n\n    const symlinkedModules = findSymlinkedModules('/root/projectA', []);\n    expect(symlinkedModules).toEqual([\n      '/root/@scoped/projectC',\n      '/root/projectB',\n    ]);\n  });\n\n  it('correctly finds module symlinks within other module symlinks', () => {\n    fs.__setMockFilesystem({\n      root: {\n        projectA: {\n          'package.json': JSON.stringify({\n            name: 'projectA',\n            main: 'main.js',\n          }),\n          node_modules: {\n            depFoo: {\n              'package.json': JSON.stringify({\n                name: 'depFoo',\n                main: 'main.js',\n              }),\n            },\n            '@scoped': {\n              projectC: {\n                SYMLINK: '/root/@scoped/projectC',\n              },\n            },\n            projectB: {\n              SYMLINK: '/root/projectB',\n            },\n          },\n        },\n        projectB: {\n          'package.json': JSON.stringify({\n            name: 'projectB',\n            main: 'main.js',\n          }),\n          node_modules: {\n            depBar: {\n              'package.json': JSON.stringify({\n                name: 'depBar',\n                main: 'main.js',\n              }),\n            },\n            projectD: {\n              SYMLINK: '/root/projectD',\n            },\n          },\n        },\n        '@scoped': {\n          projectC: {\n            'package.json': JSON.stringify({\n              name: '@scoped/projectC',\n              main: 'main.js',\n            }),\n          },\n        },\n        projectD: {\n          'package.json': JSON.stringify({\n            name: 'projectD',\n            main: 'main.js',\n          }),\n        },\n      },\n    });\n\n    const symlinkedModules = findSymlinkedModules('/root/projectA', []);\n    expect(symlinkedModules).toEqual([\n      '/root/@scoped/projectC',\n      '/root/projectB',\n      '/root/projectD',\n    ]);\n  });\n\n  it('correctly handles duplicate symlink paths', () => {\n    // projectA ->\n    //          -> projectC\n    //          -> projectB -> projectC\n    // Final list should only contain projectC once\n    fs.__setMockFilesystem({\n      root: {\n        projectA: {\n          'package.json': JSON.stringify({\n            name: 'projectA',\n            main: 'main.js',\n          }),\n          node_modules: {\n            depFoo: {\n              'package.json': JSON.stringify({\n                name: 'depFoo',\n                main: 'main.js',\n              }),\n            },\n            '@scoped': {\n              projectC: {\n                SYMLINK: '/root/@scoped/projectC',\n              },\n            },\n            projectB: {\n              SYMLINK: '/root/projectB',\n            },\n          },\n        },\n        projectB: {\n          'package.json': JSON.stringify({\n            name: 'projectB',\n            main: 'main.js',\n          }),\n          node_modules: {\n            depBar: {\n              'package.json': JSON.stringify({\n                name: 'depBar',\n                main: 'main.js',\n              }),\n            },\n            '@scoped': {\n              projectC: {\n                SYMLINK: '/root/@scoped/projectC',\n              },\n            },\n          },\n        },\n        '@scoped': {\n          projectC: {\n            'package.json': JSON.stringify({\n              name: '@scoped/projectC',\n              main: 'main.js',\n            }),\n          },\n        },\n      },\n    });\n\n    const symlinkedModules = findSymlinkedModules('/root/projectA', []);\n    expect(symlinkedModules).toEqual([\n      '/root/@scoped/projectC',\n      '/root/projectB',\n    ]);\n  });\n\n  it('correctly handles symlink recursion', () => {\n    // projectA ->\n    //          -> projectC -> projectD -> projectA\n    //          -> projectB -> projectC -> projectA\n    //          -> projectD -> projectC -> projectA\n    // Should not infinite loop, should not contain projectA\n    fs.__setMockFilesystem({\n      root: {\n        projectA: {\n          'package.json': JSON.stringify({\n            name: 'projectA',\n            main: 'main.js',\n          }),\n          node_modules: {\n            depFoo: {\n              'package.json': JSON.stringify({\n                name: 'depFoo',\n                main: 'main.js',\n              }),\n            },\n            '@scoped': {\n              projectC: {\n                SYMLINK: '/root/@scoped/projectC',\n              },\n            },\n            projectB: {\n              SYMLINK: '/root/projectB',\n            },\n          },\n        },\n        projectB: {\n          'package.json': JSON.stringify({\n            name: 'projectB',\n            main: 'main.js',\n          }),\n          node_modules: {\n            depBar: {\n              'package.json': JSON.stringify({\n                name: 'depBar',\n                main: 'main.js',\n              }),\n            },\n            projectD: {\n              SYMLINK: '/root/projectD',\n            },\n            '@scoped': {\n              projectC: {\n                SYMLINK: '/root/@scoped/projectC',\n              },\n            },\n          },\n        },\n        '@scoped': {\n          projectC: {\n            'package.json': JSON.stringify({\n              name: '@scoped/projectC',\n              main: 'main.js',\n            }),\n            node_modules: {\n              projectA: {\n                SYMLINK: '/root/projectA',\n              },\n              projectD: {\n                SYMLINK: '/root/projectD',\n              },\n              projectE: {\n                SYMLINK: '/root/projectE',\n              },\n            },\n          },\n        },\n        projectD: {\n          'package.json': JSON.stringify({\n            name: 'projectD',\n            main: 'main.js',\n          }),\n          node_modules: {\n            '@scoped': {\n              projectC: {\n                SYMLINK: '/root/@scoped/projectC',\n              },\n            },\n            projectE: {\n              SYMLINK: '/root/projectE',\n            },\n          },\n        },\n        projectE: {\n          'package.json': JSON.stringify({\n            name: 'projectD',\n            main: 'main.js',\n          }),\n        },\n      },\n    });\n\n    const symlinkedModules = findSymlinkedModules('/root/projectA');\n    expect(symlinkedModules).toEqual([\n      '/root/@scoped/projectC',\n      '/root/projectB',\n      '/root/projectD',\n      '/root/projectE',\n    ]);\n  });\n});\n"
  },
  {
    "path": "local-cli/util/assertRequiredOptions.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst { Option } = require('commander');\nconst { camelCase } = require('lodash');\n\n// Commander.js has a 2 years old open issue to support <...> syntax\n// for options. Until that gets merged, we run the checks manually\n// https://github.com/tj/commander.js/issues/230\nmodule.exports = function assertRequiredOptions(options, passedOptions) {\n  options.forEach(opt => {\n    const option = new Option(opt.command);\n\n    if (!option.required) {\n      return;\n    }\n\n    const name = camelCase(option.long);\n\n    if (!passedOptions[name]) {\n      // Provide commander.js like error message\n      throw new Error(`error: option '${option.long}' missing`);\n    }\n  });\n};\n"
  },
  {
    "path": "local-cli/util/copyAndReplace.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\n// Binary files, don't process these (avoid decoding as utf8)\nconst binaryExtensions = ['.png', '.jar'];\n\n/**\n * Copy a file to given destination, replacing parts of its contents.\n * @param srcPath Path to a file to be copied.\n * @param destPath Destination path.\n * @param replacements: e.g. {'TextToBeReplaced': 'Replacement'}\n * @param contentChangedCallback\n *        Used when upgrading projects. Based on if file contents would change\n *        when being replaced, allows the caller to specify whether the file\n *        should be replaced or not.\n *        If null, files will be overwritten.\n *        Function(path, 'identical' | 'changed' | 'new') => 'keep' | 'overwrite'\n */\nfunction copyAndReplace(srcPath, destPath, replacements, contentChangedCallback) {\n  if (fs.lstatSync(srcPath).isDirectory()) {\n    if (!fs.existsSync(destPath)) {\n      fs.mkdirSync(destPath);\n    }\n    // Not recursive\n    return;\n  }\n\n  const extension = path.extname(srcPath);\n  if (binaryExtensions.indexOf(extension) !== -1) {\n    // Binary file\n    let shouldOverwrite = 'overwrite';\n    if (contentChangedCallback) {\n      const newContentBuffer = fs.readFileSync(srcPath);\n      let contentChanged = 'identical';\n      try {\n        const origContentBuffer = fs.readFileSync(destPath);\n        if (Buffer.compare(origContentBuffer, newContentBuffer) !== 0) {\n          contentChanged = 'changed';\n        }\n      } catch (err) {\n        if (err.code === 'ENOENT') {\n          contentChanged = 'new';\n        } else {\n          throw err;\n        }\n      }\n      shouldOverwrite = contentChangedCallback(destPath, contentChanged);\n    }\n    if (shouldOverwrite === 'overwrite') {\n      copyBinaryFile(srcPath, destPath, (err) => {\n        if (err) { throw err; }\n      });\n    }\n  } else {\n    // Text file\n    const srcPermissions = fs.statSync(srcPath).mode;\n    let content = fs.readFileSync(srcPath, 'utf8');\n    Object.keys(replacements).forEach(regex =>\n      content = content.replace(new RegExp(regex, 'g'), replacements[regex])\n    );\n\n    let shouldOverwrite = 'overwrite';\n    if (contentChangedCallback) {\n      // Check if contents changed and ask to overwrite\n      let contentChanged = 'identical';\n      try {\n        const origContent = fs.readFileSync(destPath, 'utf8');\n        if (content !== origContent) {\n          //console.log('Content changed: ' + destPath);\n          contentChanged = 'changed';\n        }\n      } catch (err) {\n        if (err.code === 'ENOENT') {\n          contentChanged = 'new';\n        } else {\n          throw err;\n        }\n      }\n      shouldOverwrite = contentChangedCallback(destPath, contentChanged);\n    }\n    if (shouldOverwrite === 'overwrite') {\n      fs.writeFileSync(destPath, content, {\n        encoding: 'utf8',\n        mode: srcPermissions,\n      });\n    }\n  }\n}\n\n/**\n * Same as 'cp' on Unix. Don't do any replacements.\n */\nfunction copyBinaryFile(srcPath, destPath, cb) {\n  let cbCalled = false;\n  const srcPermissions = fs.statSync(srcPath).mode;\n  const readStream = fs.createReadStream(srcPath);\n  readStream.on('error', function(err) {\n    done(err);\n  });\n  const writeStream = fs.createWriteStream(destPath, {\n    mode: srcPermissions\n  });\n  writeStream.on('error', function(err) {\n    done(err);\n  });\n  writeStream.on('close', function(ex) {\n    done();\n  });\n  readStream.pipe(writeStream);\n  function done(err) {\n    if (!cbCalled) {\n      cb(err);\n      cbCalled = true;\n    }\n  }\n}\n\nmodule.exports = copyAndReplace;\n"
  },
  {
    "path": "local-cli/util/findReactNativeScripts.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n */\n'use strict';\n\nconst path = require('path');\nconst fs = require('fs');\n\nfunction findReactNativeScripts(): ?string {\n  const executablePath = path.resolve(\n    'node_modules',\n    '.bin',\n    'react-native-scripts'\n  );\n  if (fs.existsSync(executablePath)) {\n    return executablePath;\n  }\n  return null;\n}\n\nmodule.exports = findReactNativeScripts;\n"
  },
  {
    "path": "local-cli/util/findSymlinkedModules.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * @flow\n */\n\nconst path = require('path');\nconst fs = require('fs');\n\n/**\n * Find symlinked modules inside \"node_modules.\"\n *\n * Naively, we could just perform a depth-first search of all folders in\n * node_modules, recursing when we find a symlink.\n *\n * We can be smarter than this due to our knowledge of how npm/Yarn lays out\n * \"node_modules\" / how tools that build on top of npm/Yarn (such as Lerna)\n * install dependencies.\n *\n * Starting from a given root node_modules folder, this algorithm will look at\n * both the top level descendants of the node_modules folder or second level\n * descendants of folders that start with \"@\" (which indicates a scoped\n * package). If any of those folders is a symlink, it will recurse into the\n * link, and perform the same search in the linked folder.\n *\n * The end result should be a list of all resolved module symlinks for a given\n * root.\n */\nmodule.exports = function findSymlinkedModules(\n  projectRoot: string,\n  ignoredRoots?: Array<string> = [],\n) {\n  const timeStart = Date.now();\n  const nodeModuleRoot = path.join(projectRoot, 'node_modules');\n  const resolvedSymlinks = findModuleSymlinks(nodeModuleRoot, [\n    ...ignoredRoots,\n    projectRoot,\n  ]);\n  const timeEnd = Date.now();\n\n  console.log(\n    `Scanning folders for symlinks in ${nodeModuleRoot} (${timeEnd -\n      timeStart}ms)`,\n  );\n\n  return resolvedSymlinks;\n};\n\nfunction findModuleSymlinks(\n  modulesPath: string,\n  ignoredPaths: Array<string> = [],\n): Array<string> {\n  if (!fs.existsSync(modulesPath)) {\n    return [];\n  }\n\n  // Find module symlinks\n  const moduleFolders = fs.readdirSync(modulesPath);\n  const symlinks = moduleFolders.reduce((links, folderName) => {\n    const folderPath = path.join(modulesPath, folderName);\n    const maybeSymlinkPaths = [];\n    if (folderName.startsWith('@')) {\n      const scopedModuleFolders = fs.readdirSync(folderPath);\n      maybeSymlinkPaths.push(\n        ...scopedModuleFolders.map(name => path.join(folderPath, name)),\n      );\n    } else {\n      maybeSymlinkPaths.push(folderPath);\n    }\n    return links.concat(resolveSymlinkPaths(maybeSymlinkPaths, ignoredPaths));\n  }, []);\n\n  // For any symlinks found, look in _that_ modules node_modules directory\n  // and find any symlinked modules\n  const nestedSymlinks = symlinks.reduce(\n    (links, symlinkPath) =>\n      links.concat(\n        // We ignore any found symlinks or anything from the ignored list,\n        // to prevent infinite recursion\n        findModuleSymlinks(path.join(symlinkPath, 'node_modules'), [\n          ...ignoredPaths,\n          ...symlinks,\n        ]),\n      ),\n    [],\n  );\n\n  return [...new Set([...symlinks, ...nestedSymlinks])];\n}\n\nfunction resolveSymlinkPaths(maybeSymlinkPaths, ignoredPaths) {\n  return maybeSymlinkPaths.reduce((resolvedPaths, maybeSymlinkPath) => {\n    const visited = [];\n\n    let resolvedPath = maybeSymlinkPath;\n    while (fs.lstatSync(resolvedPath).isSymbolicLink()) {\n      const index = visited.indexOf(resolvedPath);\n      if (index !== -1) {\n        throw Error(\n          'Infinite symlink recursion detected:\\n  ' +\n            visited.slice(index).join('\\n  '),\n        );\n      }\n\n      visited.push(resolvedPath);\n      resolvedPath = path.resolve(\n        path.dirname(resolvedPath),\n        fs.readlinkSync(resolvedPath),\n      );\n    }\n\n    if (\n      resolvedPath.indexOf('/node_modules/') < 0 &&\n      ignoredPaths.indexOf(resolvedPath) < 0 &&\n      fs.existsSync(resolvedPath)\n    ) {\n      resolvedPaths.push(resolvedPath);\n    }\n    return resolvedPaths;\n  }, []);\n}\n"
  },
  {
    "path": "local-cli/util/findSymlinksPaths.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst path = require('path');\nconst fs = require('fs');\n\n/**\n * Find and resolve symlinks in `lookupFolder`.\n * Ignore any descendants of the paths in `ignoredRoots`.\n */\nmodule.exports = function findSymlinksPaths(lookupFolder, ignoredRoots) {\n  const timeStart = Date.now();\n  const folders = fs.readdirSync(lookupFolder);\n\n  const resolvedSymlinks = [];\n  folders.forEach(folder => {\n    const visited = [];\n\n    let symlink = path.resolve(lookupFolder, folder);\n    while (fs.lstatSync(symlink).isSymbolicLink()) {\n      const index = visited.indexOf(symlink);\n      if (index !== -1) {\n        throw Error(\n          'Infinite symlink recursion detected:\\n  ' +\n            visited.slice(index).join('\\n  ')\n        );\n      }\n\n      visited.push(symlink);\n      symlink = path.resolve(\n        path.dirname(symlink),\n        fs.readlinkSync(symlink)\n      );\n    }\n\n    if (visited.length && !rootExists(ignoredRoots, symlink)) {\n      resolvedSymlinks.push(symlink);\n    }\n  });\n\n  const timeEnd = Date.now();\n  console.log(`Scanning ${folders.length} folders for symlinks in ${lookupFolder} (${timeEnd - timeStart}ms)`);\n\n  return resolvedSymlinks;\n};\n\nfunction rootExists(roots, child) {\n  return roots.some(root => isDescendant(root, child));\n}\n\nfunction isDescendant(root, child) {\n  return root === child || child.startsWith(root + path.sep);\n}\n"
  },
  {
    "path": "local-cli/util/isPackagerRunning.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst fetch = require('node-fetch');\n\n/**\n * Indicates whether or not the packager is running. It returns a promise that\n * when fulfilled can returns one out of these possible values:\n *   - `running`: the packager is running\n *   - `not_running`: the packager nor any process is running on the expected\n *                    port.\n *   - `unrecognized`: one other process is running on the port we expect the\n *                     packager to be running.\n */\nfunction isPackagerRunning(packagerPort = (process.env.RCT_METRO_PORT || 8081)) {\n  return fetch(`http://localhost:${packagerPort}/status`).then(\n    res => res.text().then(body =>\n      body === 'packager-status:running' ? 'running' : 'unrecognized'\n    ),\n    () => 'not_running'\n  );\n}\n\nmodule.exports = isPackagerRunning;\n"
  },
  {
    "path": "local-cli/util/isValidPackageName.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nfunction isValidPackageName(name) {\n  return name.match(/^[$A-Z_][0-9A-Z_$]*$/i);\n}\n\nmodule.exports = isValidPackageName;\n"
  },
  {
    "path": "local-cli/util/log.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nvar _enabled = true;\n\nfunction disable() {\n  _enabled = false;\n}\n\nfunction log(stream, module) {\n  return function() {\n    if (!_enabled) {\n      return;\n    }\n    const message = Array.prototype.slice.call(arguments).join(' ');\n    stream.write(module + ': ' + message + '\\n');\n  };\n}\n\nmodule.exports.out = log.bind(null, process.stdout);\nmodule.exports.err = log.bind(null, process.stderr);\nmodule.exports.disable = disable;\n"
  },
  {
    "path": "local-cli/util/parseCommandLine.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * Wrapper on-top of `optimist` in order to properly support boolean flags\n * and have a slightly less awkward API.\n *\n * Usage example:\n *   var argv = parseCommandLine([{\n *     command: 'web',\n *     description: 'Run in a web browser instead of iOS',\n *     default: true\n *   }])\n *\n * NOTE: This file is used internally at Facebook and not in `local-cli` itself.\n * No changes should be made to this file without prior discussion with FB team.\n */\n'use strict';\n\nvar optimistModule = require('optimist');\n\nfunction parseCommandLine(config, args) {\n  var optimist = new optimistModule();\n  args = args || process.argv;\n  // optimist default API requires you to write the command name three time\n  // This is a small wrapper to accept an object instead\n  for (var i = 0; i < config.length; ++i) {\n    if (config[i].type === 'string') {\n      optimist.string(config[i].command);\n    } else {\n      optimist.boolean(config[i].command);\n    }\n\n    optimist\n      .default(config[i].command, config[i].default)\n      .describe(config[i].command, config[i].description);\n\n    if (config[i].required) {\n      optimist.demand(config[i].command);\n    }\n  }\n  var argv = optimist.parse(args);\n\n  // optimist doesn't have support for --dev=false, instead it returns 'false'\n  for (var i = 0; i < config.length; ++i) {\n    var command = config[i].command;\n    if (argv[command] === undefined) {\n      argv[command] = config[i].default;\n    }\n    if (argv[command] === 'true') {\n      argv[command] = true;\n    }\n    if (argv[command] === 'false') {\n      argv[command] = false;\n    }\n    if (config[i].type === 'string') {\n      // According to https://github.com/substack/node-optimist#numbers,\n      // every argument that looks like a number should be converted to one.\n      var strValue = argv[command];\n      var numValue = strValue ? Number(strValue) : undefined;\n      if (typeof numValue === 'number' && !isNaN(numValue)) {\n        argv[command] = numValue;\n      }\n    }\n  }\n\n  // Show --help\n  if (argv.help || argv.h) {\n    optimist.showHelp();\n    process.exit();\n  }\n\n  return argv;\n}\n\nmodule.exports = parseCommandLine;\n"
  },
  {
    "path": "local-cli/util/walk.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\nfunction walk(current) {\n  if (!fs.lstatSync(current).isDirectory()) {\n    return [current];\n  }\n\n  const files = fs.readdirSync(current).map(child => {\n    child = path.join(current, child);\n    return walk(child);\n  });\n  return [].concat.apply([current], files);\n}\n\nmodule.exports = walk;\n"
  },
  {
    "path": "local-cli/util/yarn.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst execSync = require('child_process').execSync;\nconst fs = require('fs');\nconst path = require('path');\nconst semver = require('semver');\n\n/**\n * Use Yarn if available, it's much faster than the npm client.\n * Return the version of yarn installed on the system, null if yarn is not available.\n */\nfunction getYarnVersionIfAvailable() {\n  let yarnVersion;\n  try {\n    // execSync returns a Buffer -> convert to string\n    yarnVersion = (execSync('yarn --version', {\n      stdio: [ 0, 'pipe', 'ignore', ]\n    }).toString() || '').trim();\n  } catch (error) {\n    return null;\n  }\n  // yarn < 0.16 has a 'missing manifest' bug\n  try {\n    if (semver.gte(yarnVersion, '0.16.0')) {\n      return yarnVersion;\n    } else {\n      return null;\n    }\n  } catch (error) {\n    console.error('Cannot parse yarn version: ' + yarnVersion);\n    return null;\n  }\n}\n\n/**\n * Check that 'react-native init' itself used yarn to install React Native.\n * When using an old global react-native-cli@1.0.0 (or older), we don't want\n * to install React Native with npm, and React + Jest with yarn.\n * Let's be safe and not mix yarn and npm in a single project.\n * @param projectDir e.g. /Users/martin/AwesomeApp\n */\nfunction isGlobalCliUsingYarn(projectDir) {\n  return fs.existsSync(path.join(projectDir, 'yarn.lock'));\n}\n\nmodule.exports = {\n  getYarnVersionIfAvailable: getYarnVersionIfAvailable,\n  isGlobalCliUsingYarn: isGlobalCliUsingYarn,\n};\n"
  },
  {
    "path": "local-cli/wrong-react-native.js",
    "content": "#!/usr/bin/env node\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst isWindows = process.platform === 'win32';\n\nvar installedGlobally;\nif (isWindows) {\n  const fs = require('fs');\n  const path = require('path');\n  // On Windows, assume we are installed globally if we can't find a package.json above node_modules.\n  installedGlobally = !(fs.existsSync(path.join(__dirname, '../../../package.json')));\n} else {\n  // On non-windows, assume we are installed globally if we are called from outside of the node_mobules/.bin/react-native executable.\n  var script = process.argv[1];\n  installedGlobally = script.indexOf('node_modules/.bin/react-native') === -1;\n}\n\n\nif (installedGlobally) {\n  const chalk = require('chalk');\n\n  console.error([\n    chalk.red('Looks like you installed react-native-macos globally, maybe you meant react-native-macos-cli?'),\n    chalk.red('To fix the issue, run:'),\n    'npm uninstall -g react-native-macos',\n    'npm install -g react-native-macos-cli'\n  ].join('\\n'));\n  process.exit(1);\n} else {\n  require('./cli').run();\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"react-native-macos\",\n  \"version\": \"0.19.3\",\n  \"description\": \"A framework for building native macOS apps using React\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git@github.com:ptmt/react-native-macos.git\"\n  },\n  \"engines\": {\n    \"node\": \">=4\"\n  },\n  \"prettier\": {\n    \"requirePragma\": true,\n    \"singleQuote\": true,\n    \"trailingComma\": \"all\",\n    \"bracketSpacing\": false,\n    \"jsxBracketSameLine\": true,\n    \"parser\": \"flow\"\n  },\n  \"jest\": {\n    \"transform\": {\n      \"^[./a-zA-Z0-9$_-]+\\\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$\": \"<rootDir>/jest/assetFileTransformer.js\",\n      \".*\": \"./jest/preprocessor.js\"\n    },\n    \"setupFiles\": [\n      \"./jest/setup.js\"\n    ],\n    \"timers\": \"fake\",\n    \"moduleNameMapper\": {\n      \"^React$\": \"<rootDir>/Libraries/react-native/React.js\"\n    },\n    \"testPathIgnorePatterns\": [\n      \"Libraries/Renderer\",\n      \"/node_modules/\",\n      \"local-cli/templates/\"\n    ],\n    \"haste\": {\n      \"defaultPlatform\": \"macos\",\n      \"providesModuleNodeModules\": [\n        \"react-native-macos\"\n      ],\n      \"platforms\": [\n        \"ios\",\n        \"android\",\n        \"macos\"\n      ]\n    },\n    \"modulePathIgnorePatterns\": [\n      \"/node_modules/(?!react|fbjs|react-native|react-native-macos|react-transform-hmr|core-js|promise)/\",\n      \"node_modules/react/node_modules/fbjs/\",\n      \"node_modules/react/lib/ReactDOM.js\",\n      \"node_modules/fbjs/lib/Map.js\",\n      \"node_modules/fbjs/lib/Promise.js\",\n      \"node_modules/fbjs/lib/fetch.js\",\n      \"node_modules/fbjs/lib/ErrorUtils.js\",\n      \"node_modules/fbjs/lib/URI.js\",\n      \"node_modules/fbjs/lib/Deferred.js\",\n      \"node_modules/fbjs/lib/PromiseMap.js\",\n      \"node_modules/fbjs/lib/UserAgent.js\",\n      \"node_modules/fbjs/lib/areEqual.js\",\n      \"node_modules/fbjs/lib/base62.js\",\n      \"node_modules/fbjs/lib/crc32.js\",\n      \"node_modules/fbjs/lib/everyObject.js\",\n      \"node_modules/fbjs/lib/fetchWithRetries.js\",\n      \"node_modules/fbjs/lib/filterObject.js\",\n      \"node_modules/fbjs/lib/flattenArray.js\",\n      \"node_modules/fbjs/lib/forEachObject.js\",\n      \"node_modules/fbjs/lib/isEmpty.js\",\n      \"node_modules/fbjs/lib/nullthrows.js\",\n      \"node_modules/fbjs/lib/removeFromArray.js\",\n      \"node_modules/fbjs/lib/resolveImmediate.js\",\n      \"node_modules/fbjs/lib/someObject.js\",\n      \"node_modules/fbjs/lib/sprintf.js\",\n      \"node_modules/fbjs/lib/xhrSimpleDataSerializer.js\",\n      \"node_modules/jest-cli\",\n      \"node_modules/react/dist\",\n      \"node_modules/fbjs/.*/__mocks__/\",\n      \"node_modules/fbjs/node_modules/\"\n    ],\n    \"unmockedModulePathPatterns\": [\n      \"node_modules/react/\",\n      \"Libraries/Renderer\",\n      \"promise\",\n      \"source-map\",\n      \"fastpath\",\n      \"denodeify\",\n      \"fbjs\",\n      \"sinon\"\n    ],\n    \"testEnvironment\": \"node\"\n  },\n  \"main\": \"Libraries/react-native/react-native-implementation.js\",\n  \"files\": [\n    \".flowconfig\",\n    \"android\",\n    \"cli.js\",\n    \"flow\",\n    \"init.sh\",\n    \"scripts/macos-configure-glog.sh\",\n    \"scripts/macos-configure-folly.sh\",\n    \"scripts/macos-install-third-party.sh\",\n    \"scripts/launchPackager.bat\",\n    \"scripts/launchPackager.command\",\n    \"scripts/packager.sh\",\n    \"scripts/react-native-xcode.sh\",\n    \"jest-preset.json\",\n    \"jest\",\n    \"lib\",\n    \"rn-get-polyfills.js\",\n    \"setupBabel.js\",\n    \"Libraries\",\n    \"LICENSE\",\n    \"local-cli\",\n    \"packager\",\n    \"PATENTS\",\n    \"react.gradle\",\n    \"React.podspec\",\n    \"React\",\n    \"ReactAndroid\",\n    \"ReactCommon\",\n    \"README.md\",\n    \"third-party-podspecs\"\n  ],\n  \"scripts\": {\n    \"test\": \"jest\",\n    \"flow\": \"flow\",\n    \"lint\": \"eslint .\",\n    \"prettier\": \"find . -name node_modules -prune -or -name '*.js' -print | xargs prettier --write\",\n    \"start\": \"/usr/bin/env bash -c './scripts/packager.sh \\\"$@\\\" || true' --\",\n    \"test-android-setup\": \"docker pull hramos/android-base:latest\",\n    \"test-android-build-base\": \"docker build -t hramos/android-base -f ContainerShip/Dockerfile.android-base .\",\n    \"test-android-build\": \"docker build -t react/android -f ContainerShip/Dockerfile.android .\",\n    \"test-android-run-instrumentation\": \"docker run --cap-add=SYS_ADMIN -it react/android bash ContainerShip/scripts/run-android-docker-instrumentation-tests.sh\",\n    \"test-android-run-unit\": \"docker run --cap-add=SYS_ADMIN -it react/android bash ContainerShip/scripts/run-android-docker-unit-tests.sh\",\n    \"test-android-run-e2e\": \"docker run --privileged -it react/android bash ContainerShip/scripts/run-ci-e2e-tests.sh --android --js\",\n    \"test-android-all\": \"npm run test-android-build && npm run test-android-run-unit && npm run test-android-run-instrumentation && npm run test-android-run-e2e\",\n    \"test-android-instrumentation\": \"npm run test-android-build && npm run test-android-run-instrumentation\",\n    \"test-android-unit\": \"npm run test-android-build && npm run test-android-run-unit\",\n    \"test-android-e2e\": \"npm run test-android-build && npm run test-android-run-e2e\"\n  },\n  \"bin\": {\n    \"react-native-macos\": \"local-cli/wrong-react-native.js\"\n  },\n  \"peerDependencies\": {\n    \"react\": \"16.2.0\"\n  },\n  \"dependencies\": {\n    \"absolute-path\": \"^0.0.0\",\n    \"art\": \"^0.10.0\",\n    \"babel-core\": \"^6.24.1\",\n    \"babel-plugin-syntax-trailing-function-commas\": \"^6.20.0\",\n    \"babel-plugin-transform-async-to-generator\": \"6.16.0\",\n    \"babel-plugin-transform-class-properties\": \"^6.18.0\",\n    \"babel-plugin-transform-exponentiation-operator\": \"^6.5.0\",\n    \"babel-plugin-transform-flow-strip-types\": \"^6.21.0\",\n    \"babel-plugin-transform-object-rest-spread\": \"^6.20.2\",\n    \"babel-register\": \"^6.24.1\",\n    \"babel-runtime\": \"^6.23.0\",\n    \"base64-js\": \"^1.3.1\",\n    \"chalk\": \"^1.1.1\",\n    \"commander\": \"^2.9.0\",\n    \"connect\": \"^3.7.0\",\n    \"create-react-class\": \"^15.5.2\",\n    \"debug\": \"^2.2.0\",\n    \"denodeify\": \"^1.2.1\",\n    \"envinfo\": \"^3.0.0\",\n    \"event-target-shim\": \"^1.0.5\",\n    \"fbjs\": \"^0.8.14\",\n    \"fbjs-scripts\": \"^0.8.1\",\n    \"fs-extra\": \"^1.0.0\",\n    \"glob\": \"^7.1.1\",\n    \"graceful-fs\": \"^4.1.3\",\n    \"inquirer\": \"^3.0.6\",\n    \"lodash\": \"^4.17.5\",\n    \"metro\": \"^0.24.3\",\n    \"metro-core\": \"^0.24.3\",\n    \"mime\": \"^1.3.4\",\n    \"minimist\": \"^1.2.0\",\n    \"mkdirp\": \"^0.5.1\",\n    \"node-fetch\": \"^1.3.3\",\n    \"node-notifier\": \"^5.1.2\",\n    \"npmlog\": \"^2.0.4\",\n    \"opn\": \"^3.0.2\",\n    \"optimist\": \"^0.6.1\",\n    \"plist\": \"^1.2.0\",\n    \"pretty-format\": \"^4.2.1\",\n    \"promise\": \"^7.1.1\",\n    \"prop-types\": \"^15.5.8\",\n    \"react-clone-referenced-element\": \"^1.0.1\",\n    \"react-devtools-core\": \"3.0.0\",\n    \"react-timer-mixin\": \"^0.13.2\",\n    \"regenerator-runtime\": \"^0.11.0\",\n    \"rimraf\": \"^2.5.4\",\n    \"semver\": \"^5.0.3\",\n    \"shell-quote\": \"1.6.1\",\n    \"stacktrace-parser\": \"^0.1.3\",\n    \"whatwg-fetch\": \"^1.0.0\",\n    \"ws\": \">=3.3.1\",\n    \"xcode\": \"^0.9.1\",\n    \"xmldoc\": \"^0.4.0\",\n    \"yargs\": \"^14.0.0\"\n  },\n  \"devDependencies\": {\n    \"babel-eslint\": \"^7.2.3\",\n    \"eslint\": \"^4.18.2\",\n    \"eslint-config-fb-strict\": \"^20.0.3\",\n    \"eslint-config-fbjs\": \"^1.1.1\",\n    \"eslint-plugin-eslint-comments\": \"^2.0.1\",\n    \"eslint-plugin-flowtype\": \"^2.33.0\",\n    \"eslint-plugin-jest\": \"^21.5.0\",\n    \"eslint-plugin-prettier\": \"2.1.1\",\n    \"eslint-plugin-react\": \"^7.2.1\",\n    \"flow-bin\": \"^0.63.0\",\n    \"jest\": \"22.0.0\",\n    \"polished\": \"^1.9.3\",\n    \"prettier\": \"^1.14.0\",\n    \"react\": \"16.2.0\",\n    \"react-test-renderer\": \"16.2.0\",\n    \"shelljs\": \"^0.7.8\",\n    \"sinon\": \"^2.2.0\"\n  },\n  \"rnpm\": {\n    \"plugin\": \"./local-cli/index.js\",\n    \"platform\": \"./local-cli/platform.js\"\n  }\n}\n"
  },
  {
    "path": "react-native-git-upgrade/README.md",
    "content": "# React Native Git Upgrade\n\nThis tool makes upgrading your apps to a new version of React Native easier than the stock `react-native upgrade` command.\n\nIt uses Git under the hood to automatically resolve merge conflicts in project templates (native iOS and Android files, `.flowconfig` etc.). These conflicts happen when a new React Native version introduces changes to those files and you have local changes in those files too, which is quite common.\n\n## Usage\n\nSee the [Upgrading docs](https://facebook.github.io/react-native/releases/next/docs/upgrading.html) on the React Native website.\n\nBasic usage:\n\n```\n$ npm install -g react-native-git-upgrade\n$ cd MyReactNativeApp\n$ react-native-git-upgrade\n```\n"
  },
  {
    "path": "react-native-git-upgrade/checks.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst {execSync} = require('child_process');\nconst semver = require('semver');\n\nfunction checkDeclaredVersion(declaredVersion) {\n  if (!declaredVersion) {\n    throw new Error(\n      'Your \"package.json\" file doesn\\'t seem to have \"react-native\" as a dependency.'\n    );\n  }\n}\n\nfunction checkMatchingVersions(currentVersion, declaredVersion, useYarn) {\n  if (!semver.satisfies(currentVersion, declaredVersion)) {\n    throw new Error(\n      'react-native version in \"package.json\" (' + declaredVersion + ') doesn\\'t match ' +\n      'the installed version in \"node_modules\" (' + currentVersion + ').\\n' +\n      (useYarn ?\n        'Try running \"yarn\" to fix this.' :\n        'Try running \"npm install\" to fix this.')\n    );\n  }\n}\n\nfunction checkReactPeerDependency(currentVersion, declaredReactVersion) {\n  if (semver.lt(currentVersion, '0.21.0') && !declaredReactVersion) {\n    throw new Error(\n      'Your \"package.json\" file doesn\\'t seem to have \"react\" as a dependency.\\n' +\n      '\"react\" was changed from a dependency to a peer dependency in react-native v0.21.0.\\n' +\n      'Therefore, it\\'s necessary to include \"react\" in your project\\'s dependencies.\\n' +\n      'Please run \"npm install --save react\", then re-run ' +\n      '\"react-native upgrade\".'\n    );\n  }\n}\n\nfunction checkGitAvailable() {\n  try {\n    execSync('git --version');\n  } catch (error) {\n    throw new Error(\n      '\"react-native-git-upgrade\" requires \"git\" to be available in path. ' +\n      'Please install Git (https://git-scm.com)\"'\n    );\n  }\n}\n\nmodule.exports = {\n  checkDeclaredVersion,\n  checkMatchingVersions,\n  checkReactPeerDependency,\n  checkGitAvailable,\n};\n"
  },
  {
    "path": "react-native-git-upgrade/cli.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nrequire('babel-register')({\n  presets: [\n    require('babel-preset-es2015-node'),\n    require('babel-preset-stage-3')\n  ],\n  // Enable transpiling for react-native-git-upgrade AND the generator, just like the upgrade CLI command does\n  only: /(react-native-git-upgrade\\/(?!(node_modules)))|(local-cli\\/generator)/\n});\n\nvar cliEntry = require('./cliEntry');\n\nmodule.exports = cliEntry;\n"
  },
  {
    "path": "react-native-git-upgrade/cliEntry.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst fs = require('fs');\nconst os = require('os');\nconst assert = require('assert');\nconst path = require('path');\nconst shell = require('shelljs');\nconst Promise = require('promise');\nconst yeoman = require('yeoman-environment');\nconst TerminalAdapter = require('yeoman-environment/lib/adapter');\nconst log = require('npmlog');\nconst rimraf = require('rimraf');\nconst semver = require('semver');\nconst yarn = require('./yarn');\n\nconst {\n  checkDeclaredVersion,\n  checkMatchingVersions,\n  checkReactPeerDependency,\n  checkGitAvailable,\n} = require('./checks');\n\nlog.heading = 'git-upgrade';\n\n/**\n * Promisify the callback-based shelljs function exec\n * @param logOutput If true, log the stdout of the command.\n * @returns {Promise}\n */\nfunction exec(command, logOutput) {\n  return new Promise((resolve, reject) => {\n    let stderr, stdout = '';\n    const child = shell.exec(command, {async: true, silent: true});\n\n    child.stdout.on('data', data => {\n      stdout += data;\n      if (logOutput) {\n        process.stdout.write(data);\n      }\n    });\n\n    child.stderr.on('data', data => {\n      stderr += data;\n      process.stderr.write(data);\n    });\n\n    child.on('exit', (code, signal) => {\n      if (code === 0) {\n        resolve(stdout);\n      } else if (code) {\n        reject(new Error(`Command '${command}' exited with code ${code}:\nstderr: ${stderr}\nstdout: ${stdout}`));\n      } else {\n        reject(new Error(`Command '${command}' terminated with signal '${signal}':\nstderr: ${stderr}\nstdout: ${stdout}`));\n      }\n    });\n  });\n}\n\nfunction parseJsonFile(path, useYarn) {\n  const installHint = useYarn ?\n    'Make sure you ran \"yarn\" and that you are inside a React Native project.' :\n    'Make sure you ran \"npm install\" and that you are inside a React Native project.';\n  let fileContents;\n  try {\n    fileContents = fs.readFileSync(path, 'utf8');\n  } catch (err) {\n    throw new Error('Cannot find \"' + path + '\". ' + installHint);\n  }\n  try {\n    return JSON.parse(fileContents);\n  } catch (err) {\n    throw new Error('Cannot parse \"' + path + '\": ' + err.message);\n  }\n}\n\nfunction readPackageFiles(useYarn) {\n  const reactNativeNodeModulesPakPath = path.resolve(\n    process.cwd(), 'node_modules', 'react-native', 'package.json'\n  );\n  const reactNodeModulesPakPath = path.resolve(\n    process.cwd(), 'node_modules', 'react', 'package.json'\n  );\n  const pakPath = path.resolve(\n    process.cwd(), 'package.json'\n  );\n  return {\n    reactNativeNodeModulesPak: parseJsonFile(reactNativeNodeModulesPakPath),\n    reactNodeModulesPak: parseJsonFile(reactNodeModulesPakPath),\n    pak: parseJsonFile(pakPath)\n  };\n}\n\nfunction parseInformationJsonOutput(jsonOutput, requestedVersion) {\n  try {\n    const output = JSON.parse(jsonOutput);\n    const newVersion = output.version;\n    const peerDependencies = output.peerDependencies;\n    const newReactVersionRange = peerDependencies.react;\n\n    assert(semver.valid(newVersion));\n\n    return {newVersion, newReactVersionRange};\n  } catch (err) {\n    throw new Error(\n      'The specified version of React Native ' + requestedVersion + ' doesn\\'t exist.\\n' +\n      'Re-run the react-native-git-upgrade command with an existing version,\\n' +\n      'for example: \"react-native-git-upgrade 0.38.0\",\\n' +\n      'or without arguments to upgrade to the latest: \"react-native-git-upgrade\".'\n    );\n  }\n}\n\n\nfunction setupWorkingDir(tmpDir) {\n  return new Promise((resolve, reject) => {\n    rimraf(tmpDir, err => {\n      if (err) {\n        reject(err);\n      } else {\n        fs.mkdirSync(tmpDir);\n        resolve();\n      }\n    });\n  });\n}\n\nfunction configureGitEnv(tmpDir) {\n  /*\n   * The workflow inits a temporary Git repository. We don't want to interfere\n   * with an existing user's Git repository.\n   * Thanks to Git env vars, we can make Git use a different directory for its \".git\" folder.\n   * See https://git-scm.com/book/tr/v2/Git-Internals-Environment-Variables\n   */\n  process.env.GIT_DIR = path.resolve(tmpDir, '.gitrn');\n  process.env.GIT_WORK_TREE = '.';\n}\n\nfunction generateTemplates(generatorDir, appName, verbose) {\n  try {\n    const yeomanGeneratorEntryPoint = path.resolve(generatorDir, 'index.js');\n    // Try requiring the index.js (entry-point of Yeoman generators)\n    fs.accessSync(yeomanGeneratorEntryPoint);\n    return runYeomanGenerators(generatorDir, appName, verbose);\n  } catch (err) {\n    return runCopyAndReplace(generatorDir, appName);\n  }\n}\n\nfunction runCopyAndReplace(generatorDir, appName) {\n  const copyProjectTemplateAndReplacePath = path.resolve(generatorDir, 'copyProjectTemplateAndReplace');\n  /*\n   * This module is required twice during the process: for both old and new version\n   * of React Native.\n   * This file could have changed between these 2 versions. When generating the new template,\n   * we don't want to load the old version of the generator from the cache\n   */\n  delete require.cache[require.resolve(copyProjectTemplateAndReplacePath)];\n  const copyProjectTemplateAndReplace = require(copyProjectTemplateAndReplacePath);\n  copyProjectTemplateAndReplace(\n    path.resolve(generatorDir, '..', 'templates', 'HelloWorld'),\n    process.cwd(),\n    appName,\n    {upgrade: true, force: true}\n  );\n}\n\nfunction runYeomanGenerators(generatorDir, appName, verbose) {\n  if (!verbose) {\n    // Yeoman output needs monkey-patching (no silent option)\n    TerminalAdapter.prototype.log = () => {};\n    TerminalAdapter.prototype.log.force = () => {};\n    TerminalAdapter.prototype.log.create = () => {};\n  }\n\n  const env = yeoman.createEnv();\n  env.register(generatorDir, 'react:app');\n  const generatorArgs = ['react:app', appName];\n  return new Promise((resolve) => env.run(generatorArgs, {upgrade: true, force: true}, resolve));\n}\n\n/**\n * If there's a newer version of react-native-git-upgrade in npm, suggest to the user to upgrade.\n */\nasync function checkForUpdates() {\n  try {\n    log.info('Check for updates');\n    const lastGitUpgradeVersion = await exec('npm view react-native-git-upgrade@latest version');\n    const current = require('./package').version;\n    const latest = semver.clean(lastGitUpgradeVersion);\n    if (semver.gt(latest, current)) {\n      log.warn(\n        'A more recent version of \"react-native-git-upgrade\" has been found.\\n' +\n        `Current: ${current}\\n` +\n        `Latest: ${latest}\\n` +\n        'Please run \"npm install -g react-native-git-upgrade\"'\n      );\n    }\n  } catch (err) {\n    log.warn('Check for latest version failed', err.message);\n  }\n}\n\n/**\n * If true, use yarn instead of the npm client to upgrade the project.\n */\nfunction shouldUseYarn(cliArgs, projectDir) {\n  if (cliArgs && cliArgs.npm) {\n    return false;\n  }\n  const yarnVersion = yarn.getYarnVersionIfAvailable();\n  if (yarnVersion && yarn.isProjectUsingYarn(projectDir)) {\n    log.info('Using yarn ' + yarnVersion);\n    return true;\n  }\n  return false;\n}\n\n/**\n * @param requestedVersion The version argument, e.g. 'react-native-git-upgrade 0.38'.\n *                         `undefined` if no argument passed.\n * @param cliArgs Additional arguments parsed using minimist.\n */\nasync function run(requestedVersion, cliArgs) {\n  const tmpDir = path.resolve(os.tmpdir(), 'react-native-git-upgrade');\n  const generatorDir = path.resolve(process.cwd(), 'node_modules', 'react-native', 'local-cli', 'generator');\n  let projectBackupCreated = false;\n\n  try {\n    await checkForUpdates();\n\n    const useYarn = shouldUseYarn(cliArgs, path.resolve(process.cwd()));\n\n    log.info('Read package.json files');\n    const {reactNativeNodeModulesPak, reactNodeModulesPak, pak} = readPackageFiles(useYarn);\n    const appName = pak.name;\n    const currentVersion = reactNativeNodeModulesPak.version;\n    const currentReactVersion = reactNodeModulesPak.version;\n    const declaredVersion = pak.dependencies['react-native'];\n    const declaredReactVersion = pak.dependencies.react;\n\n    const verbose = cliArgs.verbose;\n\n    log.info('Check declared version');\n    checkDeclaredVersion(declaredVersion);\n\n    log.info('Check matching versions');\n    checkMatchingVersions(currentVersion, declaredVersion, useYarn);\n\n    log.info('Check React peer dependency');\n    checkReactPeerDependency(currentVersion, declaredReactVersion);\n\n    log.info('Check that Git is installed');\n    checkGitAvailable();\n\n    log.info('Get information from NPM registry');\n    const viewCommand = 'npm view react-native@' + (requestedVersion || 'latest') + ' --json';\n    const jsonOutput = await exec(viewCommand, verbose);\n    const {newVersion, newReactVersionRange} = parseInformationJsonOutput(jsonOutput, requestedVersion);\n    // Print which versions we're upgrading to\n    log.info('Upgrading to React Native ' + newVersion + (newReactVersionRange ? ', React ' + newReactVersionRange : ''));\n\n    log.info('Setup temporary working directory');\n    await setupWorkingDir(tmpDir);\n\n    log.info('Configure Git environment');\n    configureGitEnv(tmpDir);\n\n    log.info('Init Git repository');\n    await exec('git init', verbose);\n\n    log.info('Add all files to commit');\n    await exec('git add .', verbose);\n\n    log.info('Commit current project sources');\n    await exec('git commit -m \"Project snapshot\" --no-verify', verbose);\n\n    log.info('Create a tag before updating sources');\n    await exec('git tag project-snapshot', verbose);\n    projectBackupCreated = true;\n\n    log.info('Generate old version template');\n    await generateTemplates(generatorDir, appName, verbose);\n\n    log.info('Add updated files to commit');\n    await exec('git add .', verbose);\n\n    log.info('Commit old version template');\n    await exec('git commit -m \"Old version\" --allow-empty --no-verify', verbose);\n\n    log.info('Install the new version');\n    let installCommand;\n    if (useYarn) {\n      installCommand = 'yarn add';\n    } else {\n      installCommand = 'npm install --save --color=always';\n    }\n    installCommand += ' react-native@' + newVersion;\n    if (newReactVersionRange && !semver.satisfies(currentReactVersion, newReactVersionRange)) {\n      // Install React as well to avoid unmet peer dependency\n      installCommand += ' react@' + newReactVersionRange;\n    }\n    await exec(installCommand, verbose);\n\n    log.info('Generate new version template');\n    await generateTemplates(generatorDir, appName, verbose);\n\n    log.info('Add updated files to commit');\n    await exec('git add .', verbose);\n\n    log.info('Commit new version template');\n    await exec('git commit -m \"New version\" --allow-empty --no-verify', verbose);\n\n    log.info('Generate the patch between the 2 versions');\n    const diffOutput = await exec('git diff --binary --no-color HEAD~1 HEAD', verbose);\n\n    log.info('Save the patch in temp directory');\n    const patchPath = path.resolve(tmpDir, `upgrade_${currentVersion}_${newVersion}.patch`);\n    fs.writeFileSync(patchPath, diffOutput);\n\n    log.info('Reset the 2 temporary commits');\n    await exec('git reset HEAD~2 --hard', verbose);\n\n    try {\n      log.info('Apply the patch');\n      await exec(`git apply --3way ${patchPath}`, true);\n    } catch (err) {\n      log.warn(\n        'The upgrade process succeeded but there might be conflicts to be resolved. ' +\n        'See above for the list of files that have merge conflicts.');\n    } finally {\n      log.info('Upgrade done');\n      if (cliArgs.verbose) {\n        log.info(`Temporary working directory: ${tmpDir}`);\n      }\n    }\n\n  } catch (err) {\n    log.error('An error occurred during upgrade:');\n    log.error(err.stack);\n    if (projectBackupCreated) {\n      log.error('Restore initial sources');\n      await exec('git checkout project-snapshot --no-verify', true);\n    }\n  }\n}\n\nmodule.exports = {\n  run: run,\n};\n"
  },
  {
    "path": "react-native-git-upgrade/index.js",
    "content": "#!/usr/bin/env node\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nvar argv = require('minimist')(process.argv.slice(2));\nvar cli = require('./cli');\n\nif (argv._.length === 0 && (argv.h || argv.help)) {\n  console.log([\n    '',\n    '  Usage: react-native-git-upgrade [version] [options]',\n    '',\n    '',\n    '  Commands:',\n    '',\n    '    [Version]     upgrades React Native and app templates to the desired version',\n    '                  (latest, if not specified)',\n    '',\n    '  Options:',\n    '',\n    '    -h, --help    output usage information',\n    '    -v, --version output the version number',\n    '    --verbose output debugging info',\n    '    --npm force using the npm client even if your project uses yarn',\n    '',\n  ].join('\\n'));\n  process.exit(0);\n}\n\nif (argv._.length === 0 && (argv.v || argv.version)) {\n  console.log(require('./package.json').version);\n  process.exit(0);\n}\n\ncli.run(argv._[0], argv)\n  .catch(console.error);\n"
  },
  {
    "path": "react-native-git-upgrade/package.json",
    "content": "{\n  \"name\": \"react-native-git-upgrade\",\n  \"version\": \"0.2.7\",\n  \"license\": \"BSD-3-Clause\",\n  \"description\": \"The React Native upgrade tool\",\n  \"main\": \"cli.js\",\n  \"bin\": {\n    \"react-native-git-upgrade\": \"index.js\"\n  },\n  \"engines\": {\n    \"node\": \">=4\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/facebook/react-native.git\"\n  },\n  \"dependencies\": {\n    \"babel-core\": \"^6.18.0\",\n    \"babel-preset-es2015-node\": \"^6.1.1\",\n    \"babel-preset-stage-3\": \"^6.17.0\",\n    \"babel-register\": \"^6.18.0\",\n    \"minimist\": \"^1.2.0\",\n    \"npmlog\": \"^4.0.0\",\n    \"promise\": \"^7.1.1\",\n    \"rimraf\": \"^2.5.4\",\n    \"semver\": \"^5.0.3\",\n    \"shelljs\": \"^0.7.5\",\n    \"yeoman-environment\": \"1.5.3\"\n  }\n}\n"
  },
  {
    "path": "react-native-git-upgrade/yarn.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\nconst execSync = require('child_process').execSync;\nconst fs = require('fs');\nconst path = require('path');\nconst semver = require('semver');\n\n/**\n * Use Yarn if available, it's much faster than the npm client.\n * Return the version of yarn installed on the system, null if yarn is not available.\n */\nfunction getYarnVersionIfAvailable() {\n  let yarnVersion;\n  try {\n    // execSync returns a Buffer -> convert to string\n    if (process.platform.startsWith('win')) {\n      yarnVersion = (execSync('yarn --version').toString() || '').trim();\n    } else {\n      yarnVersion = (execSync('yarn --version 2>/dev/null').toString() || '').trim();\n    }\n  } catch (error) {\n    return null;\n  }\n  // yarn < 0.16 has a 'missing manifest' bug\n  try {\n    if (semver.gte(yarnVersion, '0.16.0')) {\n      return yarnVersion;\n    } else {\n      return null;\n    }\n  } catch (error) {\n    console.error('Cannot parse yarn version: ' + yarnVersion);\n    return null;\n  }\n}\n\n/**\n * Check that 'react-native init' itself used yarn to install React Native.\n * When using an old global react-native-cli@1.0.0 (or older), we don't want\n * to install React Native with npm, and React + Jest with yarn.\n * Let's be safe and not mix yarn and npm in a single project.\n * @param projectDir e.g. /Users/martin/AwesomeApp\n */\nfunction isProjectUsingYarn(projectDir) {\n  return fs.existsSync(path.join(projectDir, 'yarn.lock'));\n}\n\nmodule.exports = {\n  getYarnVersionIfAvailable: getYarnVersionIfAvailable,\n  isProjectUsingYarn: isProjectUsingYarn,\n};\n"
  },
  {
    "path": "react-native-macos-cli/index.js",
    "content": "#!/usr/bin/env node\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n// /!\\ DO NOT MODIFY THIS FILE /!\\\n// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n//\n// react-native-cli is installed globally on people's computers. This means\n// that it is extremely difficult to have them upgrade the version and\n// because there's only one global version installed, it is very prone to\n// breaking changes.\n//\n// The only job of react-native-cli is to init the repository and then\n// forward all the commands to the local version of react-native.\n//\n// If you need to add a new command, please add it to local-cli/.\n//\n// The only reason to modify this file is to add more warnings and\n// troubleshooting information for the `react-native init` command.\n//\n// To allow for graceful failure on older node versions, this file should\n// retain ES5 compatibility.\n//\n// Do not make breaking changes! We absolutely don't want to have to\n// tell people to update their global version of react-native-cli.\n//\n// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n// /!\\ DO NOT MODIFY THIS FILE /!\\\n// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar exec = require('child_process').exec;\nvar execSync = require('child_process').execSync;\nvar chalk = require('chalk');\nvar prompt = require('prompt');\nvar semver = require('semver');\n/**\n * Used arguments:\n *   -v --version - to print current version of react-native-cli and react-native dependency\n *   if you are in a RN app folder\n * init - to create a new project and npm install it\n *   --verbose - to print logs while init\n *   --template - name of the template to use, e.g. --template navigation\n *   --version <alternative react-native package> - override default (https://registry.npmjs.org/react-native@latest),\n *      package to install, examples:\n *     - \"0.22.0-rc1\" - A new app will be created using a specific version of React Native from npm repo\n *     - \"https://registry.npmjs.org/react-native/-/react-native-0.20.0.tgz\" - a .tgz archive from any npm repo\n *     - \"/Users/home/react-native/react-native-0.22.0.tgz\" - for package prepared with `npm pack`, useful for e2e tests\n */\n\nvar options = require('minimist')(process.argv.slice(2));\n\nvar CLI_MODULE_PATH = function() {\n  return path.resolve(\n    process.cwd(),\n    'node_modules',\n    'react-native-macos',\n    'cli.js'\n  );\n};\n\nvar REACT_NATIVE_PACKAGE_JSON_PATH = function() {\n  return path.resolve(\n    process.cwd(),\n    'node_modules',\n    'react-native-macos',\n    'package.json'\n  );\n};\n\nif (options._.length === 0 && (options.v || options.version)) {\n  printVersionsAndExit(REACT_NATIVE_PACKAGE_JSON_PATH());\n}\n\n// Use Yarn if available, it's much faster than the npm client.\n// Return the version of yarn installed on the system, null if yarn is not available.\nfunction getYarnVersionIfAvailable() {\n  var yarnVersion;\n  try {\n    // execSync returns a Buffer -> convert to string\n    if (process.platform.startsWith('win')) {\n      yarnVersion = (execSync('yarn --version 2> NUL').toString() || '').trim();\n    } else {\n      yarnVersion = (execSync('yarn --version 2>/dev/null').toString() || '').trim();\n    }\n  } catch (error) {\n    return null;\n  }\n  // yarn < 0.16 has a 'missing manifest' bug\n  try {\n    if (semver.gte(yarnVersion, '0.16.0')) {\n      return yarnVersion;\n    } else {\n      return null;\n    }\n  } catch (error) {\n    console.error('Cannot parse yarn version: ' + yarnVersion);\n    return null;\n  }\n}\n\nvar cli;\nvar cliPath = CLI_MODULE_PATH();\nif (fs.existsSync(cliPath)) {\n  cli = require(cliPath);\n}\n\nvar commands = options._;\nif (cli) {\n  cli.run();\n} else {\n  if (options._.length === 0 && (options.h || options.help)) {\n    console.log([\n      '',\n      '  Usage: react-native-macos [command] [options]',\n      '',\n      '',\n      '  Commands:',\n      '',\n      '    init <ProjectName> [options]  generates a new project and installs its dependencies',\n      '',\n      '  Options:',\n      '',\n      '    -h, --help    output usage information',\n      '    -v, --version use a specific version of React Native',\n      '    --template use an app template. Use --template to see available templates.',\n      '',\n    ].join('\\n'));\n    process.exit(0);\n  }\n\n  if (commands.length === 0) {\n    console.error(\n      'You did not pass any commands, run `react-native-macos --help` to see a list of all available commands.'\n    );\n    process.exit(1);\n  }\n\n  switch (commands[0]) {\n  case 'init':\n    if (!commands[1]) {\n      console.error(\n        'Usage: react-native-macos init <ProjectName> [--verbose]'\n      );\n      process.exit(1);\n    } else {\n      init(commands[1], options);\n    }\n    break;\n  default:\n    console.error(\n      'Command `%s` unrecognized. ' +\n      'Make sure that you have run `npm install` and that you are inside a react-native-macos project.',\n      commands[0]\n    );\n    process.exit(1);\n    break;\n  }\n}\n\nfunction validateProjectName(name) {\n  if (!String(name).match(/^[$A-Z_][0-9A-Z_$]*$/i)) {\n    console.error(\n      '\"%s\" is not a valid name for a project. Please use a valid identifier ' +\n        'name (alphanumeric).',\n      name\n    );\n    process.exit(1);\n  }\n\n  if (name === 'React') {\n    console.error(\n      '\"%s\" is not a valid name for a project. Please do not use the ' +\n        'reserved word \"React\".',\n      name\n    );\n    process.exit(1);\n  }\n}\n\n/**\n * @param name Project name, e.g. 'AwesomeApp'.\n * @param options.verbose If true, will run 'npm install' in verbose mode (for debugging).\n * @param options.version Version of React Native to install, e.g. '0.38.0'.\n * @param options.npm If true, always use the npm command line client,\n *                       don't use yarn even if available.\n */\nfunction init(name, options) {\n  validateProjectName(name);\n\n  if (fs.existsSync(name)) {\n    createAfterConfirmation(name, options);\n  } else {\n    createProject(name, options);\n  }\n}\n\nfunction createAfterConfirmation(name, options) {\n  prompt.start();\n\n  var property = {\n    name: 'yesno',\n    message: 'Directory ' + name + ' already exists. Continue?',\n    validator: /y[es]*|n[o]?/,\n    warning: 'Must respond yes or no',\n    default: 'no'\n  };\n\n  prompt.get(property, function (err, result) {\n    if (result.yesno[0] === 'y') {\n      createProject(name, options);\n    } else {\n      console.log('Project initialization canceled');\n      process.exit();\n    }\n  });\n}\n\nfunction createProject(name, options) {\n  var root = path.resolve(name);\n  var projectName = path.basename(root);\n\n  console.log(\n    'This will walk you through creating a new React Native for macOS project in',\n    root\n  );\n\n  if (!fs.existsSync(root)) {\n    fs.mkdirSync(root);\n  }\n\n  var packageJson = {\n    name: projectName,\n    version: '0.0.1',\n    private: true,\n    scripts: {\n      start: 'node node_modules/react-native-macos/local-cli/cli.js start',\n      ios: 'react-native run-ios',\n      android: 'react-native run-android',\n      macos: 'react-native-macos run-macos',\n    }\n  };\n  fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson, null, 2));\n  process.chdir(root);\n\n  run(root, projectName, options);\n}\n\nfunction getInstallPackage(rnPackage) {\n  var packageToInstall = 'react-native-macos';\n  var isValidSemver = semver.valid(rnPackage);\n  if (isValidSemver) {\n    packageToInstall += '@' + isValidSemver;\n  } else if (rnPackage) {\n    // for tar.gz or alternative paths\n    packageToInstall = rnPackage;\n  }\n  return packageToInstall;\n}\n\nfunction run(root, projectName, options) {\n  var rnPackage = options.version; // e.g. '0.38' or '/path/to/archive.tgz'\n  var forceNpmClient = options.npm;\n  var yarnVersion = (!forceNpmClient) && getYarnVersionIfAvailable();\n  var installCommand;\n  if (options.installCommand) {\n    // In CI environments it can be useful to provide a custom command,\n    // to set up and use an offline mirror for installing dependencies, for example.\n    installCommand = options.installCommand;\n  } else {\n    if (yarnVersion) {\n      console.log('Using yarn v' + yarnVersion);\n      console.log('Installing ' + getInstallPackage(rnPackage) + '...');\n      installCommand = 'yarn add ' + getInstallPackage(rnPackage) + ' --exact';\n      if (options.verbose) {\n        installCommand += ' --verbose';\n      }\n    } else {\n      console.log('Installing ' + getInstallPackage(rnPackage) + '...');\n      if (!forceNpmClient) {\n        console.log('Consider installing yarn to make this faster: https://yarnpkg.com');\n      }\n      installCommand = 'npm install --save --save-exact ' + getInstallPackage(rnPackage);\n      if (options.verbose) {\n        installCommand += ' --verbose';\n      }\n    }\n  }\n  try {\n    execSync(installCommand, {stdio: 'inherit'});\n  } catch (err) {\n    console.error(err);\n    console.error('Command `' + installCommand + '` failed.');\n    process.exit(1);\n  }\n  checkNodeVersion();\n  cli = require(CLI_MODULE_PATH());\n  cli.init(root, projectName);\n}\n\nfunction checkNodeVersion() {\n  var packageJson = require(REACT_NATIVE_PACKAGE_JSON_PATH());\n  if (!packageJson.engines || !packageJson.engines.node) {\n    return;\n  }\n  if (!semver.satisfies(process.version, packageJson.engines.node)) {\n    console.error(chalk.red(\n        'You are currently running Node %s but React Native macOS requires %s. ' +\n        'Please use a supported version of Node.\\n' +\n        'See https://facebook.github.io/react-native/docs/getting-started.html'\n      ),\n      process.version,\n      packageJson.engines.node);\n  }\n}\n\nfunction printVersionsAndExit(reactNativePackageJsonPath) {\n  console.log('react-native-macos-cli: ' + require('./package.json').version);\n  try {\n    console.log('react-native-macos: ' + require(reactNativePackageJsonPath).version);\n  } catch (e) {\n    console.log('react-native-macos: n/a - not inside a React Native project directory');\n  }\n  process.exit();\n}\n"
  },
  {
    "path": "react-native-macos-cli/package.json",
    "content": "{\n  \"name\": \"react-native-macos-cli\",\n  \"version\": \"2.0.1\",\n  \"license\": \"BSD-3-Clause\",\n  \"description\": \"The React Native macOS CLI tools\",\n  \"main\": \"index.js\",\n  \"engines\": {\n    \"node\": \">=4\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/ptmt/react-native-macos.git\"\n  },\n  \"scripts\": {\n    \"test\": \"mocha\"\n  },\n  \"bin\": {\n    \"react-native-macos\": \"index.js\"\n  },\n  \"dependencies\": {\n    \"chalk\": \"^1.1.1\",\n    \"minimist\": \"^1.2.0\",\n    \"prompt\": \"^0.2.14\",\n    \"semver\": \"^5.0.3\"\n  }\n}\n"
  },
  {
    "path": "react.gradle",
    "content": "import org.apache.tools.ant.taskdefs.condition.Os\n\ndef config = project.hasProperty(\"react\") ? project.react : [];\n\ndef cliPath = config.cliPath ?: \"node_modules/react-native/local-cli/cli.js\"\ndef bundleAssetName = config.bundleAssetName ?: \"index.android.bundle\"\ndef entryFile = config.entryFile ?: \"index.android.js\"\ndef bundleCommand = config.bundleCommand ?: \"bundle\"\n\n// because elvis operator\ndef elvisFile(thing) {\n    return thing ? file(thing) : null;\n}\n\ndef reactRoot = elvisFile(config.root) ?: file(\"../../\")\ndef inputExcludes = config.inputExcludes ?: [\"android/**\", \"ios/**\"]\ndef bundleConfig = config.bundleConfig ? \"${reactRoot}/${config.bundleConfig}\" : null ;\n\nvoid runBefore(String dependentTaskName, Task task) {\n    Task dependentTask = tasks.findByPath(dependentTaskName);\n    if (dependentTask != null) {\n        dependentTask.dependsOn task\n    }\n}\n\ngradle.projectsEvaluated {\n    // Grab all build types and product flavors\n    def buildTypes = android.buildTypes.collect { type -> type.name }\n    def productFlavors = android.productFlavors.collect { flavor -> flavor.name }\n\n    // When no product flavors defined, use empty\n    if (!productFlavors) productFlavors.add('')\n\n    productFlavors.each { productFlavorName ->\n        buildTypes.each { buildTypeName ->\n            // Create variant and target names\n            def flavorNameCapitalized = \"${productFlavorName.capitalize()}\"\n            def buildNameCapitalized = \"${buildTypeName.capitalize()}\"\n            def targetName = \"${flavorNameCapitalized}${buildNameCapitalized}\"\n            def targetPath = productFlavorName ?\n                    \"${productFlavorName}/${buildTypeName}\" :\n                    \"${buildTypeName}\"\n\n            // React js bundle directories\n            def jsBundleDirConfigName = \"jsBundleDir${targetName}\"\n            def jsBundleDir = elvisFile(config.\"$jsBundleDirConfigName\") ?:\n                    file(\"$buildDir/intermediates/assets/${targetPath}\")\n\n            def resourcesDirConfigName = \"resourcesDir${targetName}\"\n            def resourcesDir = elvisFile(config.\"${resourcesDirConfigName}\") ?:\n                    file(\"$buildDir/intermediates/res/merged/${targetPath}\")\n            def jsBundleFile = file(\"$jsBundleDir/$bundleAssetName\")\n\n            // Bundle task name for variant\n            def bundleJsAndAssetsTaskName = \"bundle${targetName}JsAndAssets\"\n\n            // Additional node and packager commandline arguments\n            def nodeExecutableAndArgs = config.nodeExecutableAndArgs ?: [\"node\"]\n            def extraPackagerArgs = config.extraPackagerArgs ?: []\n\n            def currentBundleTask = tasks.create(\n                    name: bundleJsAndAssetsTaskName,\n                    type: Exec) {\n                group = \"react\"\n                description = \"bundle JS and assets for ${targetName}.\"\n\n                // Create dirs if they are not there (e.g. the \"clean\" task just ran)\n                doFirst {\n                    jsBundleDir.mkdirs()\n                    resourcesDir.mkdirs()\n                }\n\n                // Set up inputs and outputs so gradle can cache the result\n                inputs.files fileTree(dir: reactRoot, excludes: inputExcludes)\n                outputs.dir jsBundleDir\n                outputs.dir resourcesDir\n\n                // Set up the call to the react-native cli\n                workingDir reactRoot\n\n                // Set up dev mode\n                def devEnabled = !(config.\"devDisabledIn${targetName}\"\n                    || targetName.toLowerCase().contains(\"release\"))\n\n                def extraArgs = extraPackagerArgs;\n\n                if (bundleConfig) {\n                  extraArgs = extraArgs.clone()\n                  extraArgs.add(\"--config\");\n                  extraArgs.add(bundleConfig);\n                }\n\n                if (Os.isFamily(Os.FAMILY_WINDOWS)) {\n                    commandLine(\"cmd\", \"/c\", *nodeExecutableAndArgs, cliPath, bundleCommand, \"--platform\", \"android\", \"--dev\", \"${devEnabled}\",\n                            \"--reset-cache\", \"--entry-file\", entryFile, \"--bundle-output\", jsBundleFile, \"--assets-dest\", resourcesDir, *extraArgs)\n                } else {\n                    commandLine(*nodeExecutableAndArgs, cliPath, bundleCommand, \"--platform\", \"android\", \"--dev\", \"${devEnabled}\",\n                            \"--reset-cache\", \"--entry-file\", entryFile, \"--bundle-output\", jsBundleFile, \"--assets-dest\", resourcesDir, *extraArgs)\n                }\n\n                enabled config.\"bundleIn${targetName}\" ||\n                    config.\"bundleIn${buildTypeName.capitalize()}\" ?:\n                            targetName.toLowerCase().contains(\"release\")\n            }\n\n            // Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process\n            currentBundleTask.dependsOn(\"merge${targetName}Resources\")\n            currentBundleTask.dependsOn(\"merge${targetName}Assets\")\n\n            runBefore(\"process${flavorNameCapitalized}Armeabi-v7a${buildNameCapitalized}Resources\", currentBundleTask)\n            runBefore(\"process${flavorNameCapitalized}X86${buildNameCapitalized}Resources\", currentBundleTask)\n            runBefore(\"processUniversal${targetName}Resources\", currentBundleTask)\n            runBefore(\"process${targetName}Resources\", currentBundleTask)\n            runBefore(\"dataBindingProcessLayouts${targetName}\", currentBundleTask)\n        }\n    }\n}\n"
  },
  {
    "path": "rn-cli.config.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @format\n */\n'use strict';\n\nconst getPolyfills = require('./rn-get-polyfills');\n\n/**\n * This cli config is needed for development purposes, e.g. for running\n * integration tests during local development or on CI services.\n */\nmodule.exports = {\n  extraNodeModules: {\n    'react-native': __dirname,\n  },\n  getPolyfills,\n};\n"
  },
  {
    "path": "rn-get-polyfills.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nmodule.exports = () => [\n  require.resolve('./Libraries/polyfills/Object.es6.js'),\n  require.resolve('./Libraries/polyfills/console.js'),\n  require.resolve('./Libraries/polyfills/error-guard.js'),\n  require.resolve('./Libraries/polyfills/Number.es6.js'),\n  require.resolve('./Libraries/polyfills/String.prototype.es6.js'),\n  require.resolve('./Libraries/polyfills/Array.prototype.es6.js'),\n  require.resolve('./Libraries/polyfills/Array.es6.js'),\n  require.resolve('./Libraries/polyfills/Object.es7.js'),\n  require.resolve('./Libraries/polyfills/babelHelpers.js'),\n];\n"
  },
  {
    "path": "runXcodeTests.sh",
    "content": "#!/bin/sh\n\n# Run from react-native root\n\nset -e\n\nif [ -z \"$1\" ]\n  then\n    echo \"You must supply an OS version as the first arg, e.g. 8.1\"\n    exit 255\nfi\n\nxctool \\\n  -project RNTester/RNTester.xcodeproj \\\n  -scheme RNTester \\\n  -sdk iphonesimulator${1} \\\n  -destination \"platform=iOS Simulator,OS=${1},name=iPhone 5\" \\\n  build test\n"
  },
  {
    "path": "scripts/android-e2e-test.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * Used in run-ci-e2e-test.js and executed in Travis and Circle CI.\n * E2e test that verifies that init app can be installed, compiled, started and Hot Module reloading and Chrome debugging work.\n * For other examples of appium refer to: https://github.com/appium/sample-code/tree/master/sample-code/examples/node and\n * https://www.npmjs.com/package/wd-android\n *\n *\n * To set up:\n * - npm install --save-dev appium@1.5.1 mocha@2.4.5 wd@0.3.11 colors@1.0.3 pretty-data2@0.40.1\n * - cp <this file> <to app installation path>\n * - keytool -genkey -v -keystore android/keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US\n *\n * To run this test:\n * - npm start\n * - node node_modules/.bin/appium\n * - (cd android && ./gradlew :app:copyDownloadableDepsToLibs)\n * - buck build android/app\n * - node ../node_modules/.bin/_mocha ../android-e2e-test.js\n */\n\n /* eslint-env mocha */\n\n'use strict';\n\nconst wd = require('wd');\nconst path = require('path');\nconst fs = require('fs');\nconst pd = require('pretty-data2').pd;\nrequire('colors');\n// value in ms to print out screen contents, set this value in CI to debug if tests are failing\nconst appiumDebugInterval = process.env.APPIUM_DEBUG_INTERVAL;\n\ndescribe('Android Test App', function () {\n  this.timeout(600000);\n  let driver;\n  let debugIntervalId;\n\n  before(function () {\n    driver = wd.promiseChainRemote({\n      host: 'localhost',\n      port: 4723\n    });\n    driver.on('status', function (info) {\n      console.log(info.cyan);\n    });\n    driver.on('command', function (method, path, data) {\n      if (path === 'source()' && data) {\n        console.log(' > ' + method.yellow, 'Screen contents'.grey, '\\n', pd.xml(data).yellow);\n      } else {\n        console.log(' > ' + method.yellow, path.grey, data || '');\n      }\n    });\n    driver.on('http', function (method, path, data) {\n      console.log(' > ' + method.magenta, path, (data || '').grey);\n    });\n\n    // every interval print what is on the screen\n    if (appiumDebugInterval) {\n      debugIntervalId = setInterval(() => {\n        // it driver.on('command') will log the screen contents\n        driver.source();\n      }, appiumDebugInterval);\n    }\n\n    const desired = {\n      platformName: 'Android',\n      deviceName: 'Android Emulator',\n      app: path.resolve('buck-out/gen/android/app/app.apk')\n    };\n\n    // React Native in dev mode often starts with Red Box \"Can't fibd variable __fbBatchedBridge...\"\n    // This is fixed by clicking Reload JS which will trigger a request to packager server\n    return driver\n      .init(desired)\n      .setImplicitWaitTimeout(5000)\n      .waitForElementByXPath('//android.widget.Button[@text=\"Reload JS\"]').\n      then((elem) => {\n        elem.click();\n      }, (err) => {\n        // ignoring if Reload JS button can't be located\n      })\n      .setImplicitWaitTimeout(150000);\n  });\n\n  after(function () {\n    if (debugIntervalId) {\n      clearInterval(debugIntervalId);\n    }\n    return driver.quit();\n  });\n\n  it('should have Hot Module Reloading working', function () {\n    const androidAppCode = fs.readFileSync('index.js', 'utf-8');\n    let intervalToUpdate;\n    return driver\n      .waitForElementByXPath('//android.widget.TextView[starts-with(@text, \"Welcome to React Native!\")]')\n      // http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_MENU\n      .pressDeviceKey(82)\n      .elementByXPath('//android.widget.TextView[starts-with(@text, \"Enable Hot Reloading\")]')\n      .click()\n      .waitForElementByXPath('//android.widget.TextView[starts-with(@text, \"Welcome to React Native!\")]')\n      .then(() => {\n        let iteration = 0;\n        // CI environment can be quite slow and we can't guarantee that it can consistently motice a file change\n        // so we change the file every few seconds just in case\n        intervalToUpdate = setInterval(() => {\n          fs.writeFileSync('index.js', androidAppCode.replace('Welcome to React Native!', 'Welcome to React Native with HMR!' + iteration), 'utf-8');\n        }, 3000);\n      })\n      .waitForElementByXPath('//android.widget.TextView[starts-with(@text, \"Welcome to React Native with HMR!\")]')\n      .finally(() => {\n        clearInterval(intervalToUpdate);\n        fs.writeFileSync('index.js', androidAppCode, 'utf-8');\n      });\n  });\n\n\n  it('should have Debug In Chrome working', function () {\n    const androidAppCode = fs.readFileSync('index.js', 'utf-8');\n    // http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_MENU\n    return driver\n      .waitForElementByXPath('//android.widget.TextView[starts-with(@text, \"Welcome to React Native!\")]')\n      .pressDeviceKey(82)\n      .elementByXPath('//android.widget.TextView[starts-with(@text, \"Debug\")]')\n      .click()\n      .waitForElementByXPath('//android.widget.TextView[starts-with(@text, \"Welcome to React Native!\")]');\n  });\n});\n"
  },
  {
    "path": "scripts/bump-oss-version.js",
    "content": "#!/usr/bin/env node\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\n/**\n * This script bumps a new version for open source releases.\n * It updates the version in json/gradle files and makes sure they are consistent between each other\n * After changing the files it makes a commit and tags it.\n * All you have to do is push changes to remote and CI will make a new build.\n */\nconst fs = require('fs');\nconst {\n  cat,\n  echo,\n  exec,\n  exit,\n  sed,\n} = require('shelljs');\n\nconst minimist = require('minimist');\n\nlet argv = minimist(process.argv.slice(2), {\n  alias: {remote: 'r'},\n  default: {remote: 'origin'},\n});\n\n// - check we are in release branch, e.g. 0.33-stable\nlet branch = exec('git symbolic-ref --short HEAD', {silent: true}).stdout.trim();\n\nif (branch.indexOf('-stable') === -1) {\n  echo('You must be in 0.XX-stable branch to bump a version');\n  exit(1);\n}\n\n// e.g. 0.33\nlet versionMajor = branch.slice(0, branch.indexOf('-stable'));\n\n// - check that argument version matches branch\n// e.g. 0.33.1 or 0.33.0-rc4\nlet version = argv._[0];\nif (!version || version.indexOf(versionMajor) !== 0) {\n  echo(`You must pass a tag like 0.${versionMajor}.[X]-rc[Y] to bump a version`);\n  exit(1);\n}\n\n// Generate version files to detect mismatches between JS and native.\nlet match = version.match(/^(\\d+)\\.(\\d+)\\.(\\d+)(?:-(.+))?$/);\nif (!match) {\n  echo(`You must pass a correctly formatted version; couldn't parse ${version}`);\n  exit(1);\n}\nlet [, major, minor, patch, prerelease] = match;\n\nfs.writeFileSync(\n  'ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java',\n  cat('scripts/versiontemplates/ReactNativeVersion.java.template')\n    .replace('${major}', major)\n    .replace('${minor}', minor)\n    .replace('${patch}', patch)\n    .replace('${prerelease}', prerelease !== undefined ? `\"${prerelease}\"` : 'null'),\n  'utf-8'\n);\n\nfs.writeFileSync(\n  'React/Base/RCTVersion.h',\n  cat('scripts/versiontemplates/RCTVersion.h.template')\n    .replace('${major}', `@(${major})`)\n    .replace('${minor}', `@(${minor})`)\n    .replace('${patch}', `@(${patch})`)\n    .replace('${prerelease}', prerelease !== undefined ? `@\"${prerelease}\"` : '[NSNull null]'),\n  'utf-8'\n);\n\nfs.writeFileSync(\n  'Libraries/Core/ReactNativeVersion.js',\n  cat('scripts/versiontemplates/ReactNativeVersion.js.template')\n    .replace('${major}', major)\n    .replace('${minor}', minor)\n    .replace('${patch}', patch)\n    .replace('${prerelease}', prerelease !== undefined ? `'${prerelease}'` : 'null'),\n  'utf-8'\n);\n\nlet packageJson = JSON.parse(cat('package.json'));\npackageJson.version = version;\nfs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2), 'utf-8');\n\n// - change ReactAndroid/gradle.properties\nif (sed('-i', /^VERSION_NAME=.*/, `VERSION_NAME=${version}`, 'ReactAndroid/gradle.properties').code) {\n  echo('Couldn\\'t update version for Gradle');\n  exit(1);\n}\n\n// verify that files changed, we just do a git diff and check how many times version is added across files\nlet numberOfChangedLinesWithNewVersion = exec(`git diff -U0 | grep '^[+]' | grep -c ${version} `, {silent: true})\n  .stdout.trim();\nif (+numberOfChangedLinesWithNewVersion !== 2) {\n  echo('Failed to update all the files. package.json and gradle.properties must have versions in them');\n  echo('Fix the issue, revert and try again');\n  exec('git diff');\n  exit(1);\n}\n\n// - make commit [0.21.0-rc] Bump version numbers\nif (exec(`git commit -a -m \"[${version}] Bump version numbers\"`).code) {\n  echo('failed to commit');\n  exit(1);\n}\n\n// - add tag v0.21.0-rc\nif (exec(`git tag v${version}`).code) {\n  echo(`failed to tag the commit with v${version}, are you sure this release wasn't made earlier?`);\n  echo('You may want to rollback the last commit');\n  echo('git reset --hard HEAD~1');\n  exit(1);\n}\n\n// Push newly created tag\nlet remote = argv.remote;\nexec(`git push ${remote} v${version}`);\n\n// Tag latest if doing stable release\nif (version.indexOf('rc') === -1) {\n  exec('git tag -d latest');\n  exec(`git push ${remote} :latest`);\n  exec('git tag latest');\n  exec(`git push ${remote} latest`);\n}\n\nexec(`git push ${remote} ${branch} --follow-tags`);\n\nexit(0);\n"
  },
  {
    "path": "scripts/circle-ci-android-setup.sh",
    "content": "# inspired by https://github.com/Originate/guide/blob/master/android/guide/Continuous%20Integration.md\n\n# SDK Built Tools revision, per http://facebook.github.io/react-native/docs/getting-started.html\nANDROID_SDK_BUILD_TOOLS_REVISION=23.0.1\n# API Level we build with\nANDROID_SDK_BUILD_API_LEVEL=\"23\"\n# Minimum API Level we target, used for emulator image\nANDROID_SDK_TARGET_API_LEVEL=\"19\"\n# Emulator name\nAVD_NAME=\"testAVD\"\n\nfunction getAndroidSDK {\n  export PATH=\"$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH\"\n\n  DEPS=\"$ANDROID_HOME/installed-dependencies\"\n\n  if [ ! -e $DEPS ]; then\n    echo \"Installing Android API level $ANDROID_SDK_TARGET_API_LEVEL, Google APIs, ARM EABI v7a system image...\"\n    sdkmanager \"system-images;android-$ANDROID_SDK_TARGET_API_LEVEL;google_apis;armeabi-v7a\"\n# x86 image requires hardware acceleration, which is not supported when running within the CircleCI Docker image\n#    echo \"Installing Android API level $ANDROID_SDK_TARGET_API_LEVEL, Google APIs, Intel x86 Atom system image...\"\n#    sdkmanager \"system-images;android-$ANDROID_SDK_TARGET_API_LEVEL;google_apis;x86\"\n    echo \"Installing build SDK for Android API level $ANDROID_SDK_BUILD_API_LEVEL...\"\n    sdkmanager \"platforms;android-$ANDROID_SDK_BUILD_API_LEVEL\"\n    echo \"Installing target SDK for Android API level $ANDROID_SDK_TARGET_API_LEVEL...\"\n    sdkmanager \"platforms;android-$ANDROID_SDK_TARGET_API_LEVEL\"\n    echo \"Installing SDK build tools, revision $ANDROID_SDK_BUILD_TOOLS_REVISION...\"\n    sdkmanager \"build-tools;$ANDROID_SDK_BUILD_TOOLS_REVISION\"\n    echo \"Installing Google APIs for Android API level $ANDROID_SDK_BUILD_API_LEVEL...\"\n    sdkmanager \"add-ons;addon-google_apis-google-$ANDROID_SDK_BUILD_API_LEVEL\"\n    echo \"Installing Android Support Repository\"\n    sdkmanager \"extras;android;m2repository\"\n    touch $DEPS\n  fi\n}\n\nfunction getAndroidNDK {\n  NDK_HOME=\"/opt/ndk\"\n  DEPS=\"$NDK_HOME/installed-dependencies\"\n\n  if [ ! -e $DEPS ]; then\n    cd $NDK_HOME\n    echo \"Downloading NDK...\"\n    curl -o ndk.zip https://dl.google.com/android/repository/android-ndk-r10e-linux-x86.zip\n    curl -o ndk_64.zip https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip\n    unzip -o -q ndk.zip\n    unzip -o -q ndk_64.zip\n    echo \"Installed Android NDK at $NDK_HOME\"\n    touch $DEPS\n    rm ndk.zip\n    rm ndk_64.zip\n  fi\n}\n\nfunction createAVD {\n  echo no | avdmanager create avd --name $AVD_NAME --force --package \"system-images;android-$ANDROID_SDK_TARGET_API_LEVEL;google_apis;armeabi-v7a\" --tag google_apis --abi armeabi-v7a\n}\n\nfunction launchAVD {\n  # The AVD name here should match the one created in createAVD\n  # emulator64-arm -avd $AVD_NAME -no-audio -no-window -no-boot-anim -gpu off\n  emulator -avd $AVD_NAME -no-audio -no-window\n}\n\nfunction waitForAVD {\n  echo \"Waiting for Android Virtual Device to finish booting...\"\n  local bootanim=\"\"\n  export PATH=$(dirname $(dirname $(which android)))/platform-tools:$PATH\n  until [[ \"$bootanim\" =~ \"stopped\" ]]; do\n    sleep 5\n    bootanim=$(adb -e shell getprop init.svc.bootanim 2>&1)\n    echo \"boot animation status=$bootanim\"\n  done\n  echo \"Android Virtual Device is ready.\"\n}\n\nfunction retry3 {\n  local n=1\n  local max=3\n  local delay=1\n  while true; do\n    \"$@\" && break || {\n      if [[ $n -lt $max ]]; then\n        ((n++))\n        echo \"Command failed. Attempt $n/$max:\"\n        sleep $delay;\n      else\n        echo \"The command has failed after $n attempts.\" >&2\n        return 1\n      fi\n    }\n  done\n}\n"
  },
  {
    "path": "scripts/e2e-sinopia.config.yml",
    "content": "storage: /tmp/sinopia-package-cache\n\nuplinks:\n  npmjs:\n    url: https://registry.npmjs.org/\n\npackages:\n  'react-native-macos':\n    allow_access: $all\n    allow_publish: $all\n\n  'react-native-macos-cli':\n    allow_access: $all\n    allow_publish: $all\n\n  '*':\n    allow_access: $all\n    proxy: npmjs\n\nlogs:\n  - {type: file, path: sinopia.log, format: pretty, level: http}\n\nmax_body_size: '50mb'\n"
  },
  {
    "path": "scripts/e2e-test.sh",
    "content": "#!/bin/bash\n\n# The script has one required argument:\n# --packager: react-native init, make sure the packager starts\n# --ios: react-native init, start the packager and run the iOS app\n# --android: same but run the Android app\n\n# Abort the mission if any command fails\nset -e\nset -x\n\nif [ -z $1 ]; then\n  echo \"Please run the script with --ios, --android or --packager\"\n  exit 1\nfi\n\nSCRIPTS=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\nROOT=$(dirname $SCRIPTS)\nTEMP=$(mktemp -d /tmp/react-native-XXXXXXXX)\n\n# When tests run on CI server, we won't be able to see logs\n# from packager because it runs in a separate window. This is\n# a simple workaround, see scripts/packager.sh\nexport REACT_PACKAGER_LOG=\"$TEMP/server.log\"\n\n# To make sure we actually installed the local version\n# of react-native, we will create a temp file inside the template\n# and check that it exists after `react-native init`\nMARKER_MACOS=$(mktemp $ROOT/local-cli/generator-macos/templates/app/XXXXXXXX)\n\n\nfunction cleanup {\n  EXIT_CODE=$?\n  set +e\n\n  if [ $EXIT_CODE -ne 0 ];\n  then\n    WATCHMAN_LOGS=/usr/local/Cellar/watchman/3.1/var/run/watchman/$USER.log\n    [ -f $WATCHMAN_LOGS ] && cat $WATCHMAN_LOGS\n\n    [ -f $REACT_PACKAGER_LOG ] && cat $REACT_PACKAGER_LOG\n  fi\n\n  rm $MARKER_MACOS\n  [ $SINOPIA_PID ] && kill -9 $SINOPIA_PID\n  [ $SERVER_PID ] && kill -9 $SERVER_PID\n  [ -f ~/.npmrc.bak ] && mv ~/.npmrc.bak ~/.npmrc\n}\ntrap cleanup EXIT\n\ncd $TEMP\n\n# sinopia is npm registry proxy, it is used to make npm\n# think react-native and react-native-cli are actually\n# published on npm\n# Temporarily installing sinopia from a github fork\n# TODO t10060166 use npm repo when bug is fixed\nwhich sinopia || npm install -g git://github.com/bestander/sinopia.git#68707efbab90569d5f52193138936f9281cc410c\n\n# but in order to make npm use sinopia we temporarily\n# replace its config file\n[ -f ~/.npmrc ] && cp ~/.npmrc ~/.npmrc.bak\ncp $SCRIPTS/e2e-npmrc ~/.npmrc\n\nsinopia --config $SCRIPTS/e2e-sinopia.config.yml &\nSINOPIA_PID=$!\n\n# Make sure to remove old version of react-native in\n# case it was cached\nnpm unpublish react-native-macos --force\nnpm unpublish react-native-macos-cli --force\nnpm publish $ROOT\nnpm publish $ROOT/react-native-macos-cli\n\nnpm install -g react-native-macos-cli\nreact-native-macos init EndToEndTest\ncd EndToEndTest\n\ncase $1 in\n\"--packager\"*)\n  echo \"Running a basic packager test\"\n  # Check the packager produces a bundle (doesn't throw an error)\n  react-native-macos bundle --platform macos --dev true --entry-file index.macos.js --bundle-output macos-bundle.js\n  ;;\n\"--macos\"*)\n  echo \"Running a macOS app\"\n  cd macos\n  # Make sure we installed local version of react-native\n  ls EndToEndTest/`basename $MARKER_IOS` > /dev/null\n  ../node_modules/react-native-macos/scripts/packager.sh --nonPersistent &\n  SERVER_PID=$!\n  # Start the app on the simulator\n  xctool -scheme EndToEndTest -sdk iphonesimulator test\n  ;;\n\"--ios\"*)\n  echo \"Running an iOS app\"\n  cd ios\n  # Make sure we installed local version of react-native\n  ls EndToEndTest/`basename $MARKER_IOS` > /dev/null\n  ../node_modules/react-native/scripts/packager.sh --nonPersistent &\n  SERVER_PID=$!\n  # Start the app on the simulator\n  xctool -scheme EndToEndTest -sdk iphonesimulator test\n  ;;\n\"--android\"*)\n  echo \"Running an Android app\"\n  cd android\n  # Make sure we installed local version of react-native\n  ls `basename $MARKER_ANDROID` > /dev/null\n  ../node_modules/react-native/scripts/packager.sh --nonPersistent &\n  SERVER_PID=$!\n  # TODO Start the app and check it renders \"Welcome to React Native\"\n  echo \"The Android e2e test is not implemented yet\"\n  ;;\n*)\n  echo \"Please run the script with --ios, --android or --packager\"\n  ;;\nesac\n"
  },
  {
    "path": "scripts/ios-configure-glog.sh",
    "content": "#!/bin/bash\nset -e\n\nPLATFORM_NAME=\"${PLATFORM_NAME:-iphoneos}\"\nCURRENT_ARCH=\"${CURRENT_ARCH:-armv7}\"\n\nexport CC=\"$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)\"\nexport CXX=\"$CC\"\n\n# Remove automake symlink if it exists\nif [ -h \"test-driver\" ]; then\n    rm test-driver\nfi\n\n./configure --host arm-apple-darwin\n\n# Fix build for tvOS\ncat << EOF >> src/config.h\n\n/* Add in so we have Apple Target Conditionals */\n#ifdef __APPLE__\n#include <TargetConditionals.h>\n#include <Availability.h>\n#endif\n\n/* Special configuration for AppleTVOS */\n#if TARGET_OS_TV\n#undef HAVE_SYSCALL_H\n#undef HAVE_SYS_SYSCALL_H\n#undef OS_MACOSX\n#endif\n\n/* Special configuration for ucontext */\n#undef HAVE_UCONTEXT_H\n#undef PC_FROM_UCONTEXT\n#if defined(__x86_64__)\n#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip\n#elif defined(__i386__)\n#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip\n#endif\nEOF\n"
  },
  {
    "path": "scripts/ios-install-third-party.sh",
    "content": "#!/bin/bash\n\n#boostdir=\"`node ./node_modules/boost-lib/bin/boost-lib download -V 1.63`\"\n#cd \"$boostdir\"\n#./bootstrap.sh\n#./b2 headers\n\nset -e\n\ncachedir=\"$HOME/.rncache\"\nmkdir -p \"$cachedir\"\n\nfunction fetch_and_unpack () {\n    file=$1\n    url=$2\n    cmd=$3\n\n    if [ ! -f \"$cachedir/$file\" ]; then\n        (cd \"$cachedir\"; curl -J -L -O \"$url\")\n    fi\n\n    dir=$(basename \"$file\" .tar.gz)\n    if [ ! -d \"third-party/$dir\" ]; then\n        (cd third-party;\n         echo Unpacking \"$cachedir/$file\"...\n         tar zxf \"$cachedir/$file\"\n\n         cd \"$dir\"\n         eval \"${cmd:-true}\")\n    fi\n}\n\nmkdir -p third-party\n\nSCRIPTDIR=$(pwd)/$(dirname \"$0\")\n\nfetch_and_unpack glog-0.3.4.tar.gz https://github.com/google/glog/archive/v0.3.4.tar.gz \"$SCRIPTDIR/ios-configure-glog.sh\"\nfetch_and_unpack double-conversion-1.1.5.tar.gz https://github.com/google/double-conversion/archive/v1.1.5.tar.gz\nfetch_and_unpack boost_1_63_0.tar.gz https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz\nfetch_and_unpack folly-2016.09.26.00.tar.gz https://github.com/facebook/folly/archive/v2016.09.26.00.tar.gz\n"
  },
  {
    "path": "scripts/launchPackager.bat",
    "content": ":: Copyright (c) 2015-present, Facebook, Inc.\n:: All rights reserved.\n::\n:: This source code is licensed under the BSD-style license found in the\n:: LICENSE file in the root directory of this source tree. An additional grant\n:: of patent rights can be found in the PATENTS file in the same directory.\n\n@echo off\ntitle Metro Bundler\nnode \"%~dp0..\\local-cli\\cli.js\" start\npause\nexit\n"
  },
  {
    "path": "scripts/launchPackager.command",
    "content": "#!/usr/bin/env bash\n\n# Copyright (c) 2015-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\n# Set terminal title\necho -en \"\\033]0;Metro Bundler\\a\"\nclear\n\nTHIS_DIR=$(dirname \"$0\")\n. \"$THIS_DIR/packager.sh\"\n\necho \"Process terminated. Press <enter> to close the window\"\nread\n"
  },
  {
    "path": "scripts/macos-configure-folly.sh",
    "content": "#!/bin/bash\nset -e\n\n# Fix name conflicts with macOS\ncat << EOF >> folly/prepend.h\n#ifdef __APPLE__\n#undef check\n#endif\nEOF\n\necho \"$(cat folly/prepend.h)\\n$(cat folly/dynamic.h)\" > folly/dynamic.h\n"
  },
  {
    "path": "scripts/macos-configure-glog.sh",
    "content": "#!/bin/bash\nset -e\n\n# Only set when not running in an Xcode context\n# if [ -z \"$ACTION\" ] || [ -z \"$BUILD_DIR\" ]; then\n#   echo \"not in xcode\"\n#   export CC=\"$(xcrun -find -sdk iphoneos cc) -arch armv7 -isysroot $(xcrun -sdk iphoneos --show-sdk-path)\"\n# fi\n\n./configure\n\n# Fix build for tvOS\ncat << EOF >> src/config.h\n\n/* Add in so we have Apple Target Conditionals */\n#ifdef __APPLE__\n#include <TargetConditionals.h>\n#include <Availability.h>\n#undef check\n#endif\n\n/* Special configuration for AppleTVOS */\n#if TARGET_OS_TV\n#undef HAVE_SYSCALL_H\n#undef HAVE_SYS_SYSCALL_H\n#undef OS_MACOSX\n#endif\nEOF\n"
  },
  {
    "path": "scripts/macos-install-third-party.sh",
    "content": "#!/bin/sh\n\n#boostdir=\"`node ./node_modules/boost-lib/bin/boost-lib download -V 1.63`\"\n#cd \"$boostdir\"\n#./bootstrap.sh\n#./b2 headers\n\n#set -e\n\ncachedir=\"$HOME/.rncache\"\nmkdir -p \"$cachedir\"\n\nfunction fetch_and_unpack () {\n    file=$1\n    url=$2\n    cmd=$3\n\n    if [ ! -f \"$cachedir/$file\" ]; then\n        (cd \"$cachedir\"; curl -J -L -O \"$url\")\n    fi\n\n    dir=$(basename \"$file\" .tar.gz)\n    if [ ! -d \"third-party/$dir\" ]; then\n        (cd third-party;\n         echo Unpacking \"$cachedir/$file\"...\n         tar zxf \"$cachedir/$file\"\n\n         cd \"$dir\"\n         eval \"${cmd:-true}\")\n    fi\n}\n\necho \"Checking if third-party dir exists\"\nmkdir -p third-party\n\nSCRIPTDIR=$(pwd)/scripts\n\nfetch_and_unpack glog-0.3.4.tar.gz https://github.com/google/glog/archive/v0.3.4.tar.gz \"$SCRIPTDIR/macos-configure-glog.sh\"\nfetch_and_unpack double-conversion-1.1.5.tar.gz https://github.com/google/double-conversion/archive/v1.1.5.tar.gz\nfetch_and_unpack boost_1_63_0.tar.gz https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz\nfetch_and_unpack folly-2016.09.26.00.tar.gz https://github.com/facebook/folly/archive/v2016.09.26.00.tar.gz \"$SCRIPTDIR/macos-configure-folly.sh\"\n"
  },
  {
    "path": "scripts/objc-test-ios.sh",
    "content": "#!/bin/bash\nset -ex\n\n# Script used to run iOS tests.\n# If not arguments are passed to the script, it will only compile\n# the RNTester.\n# If the script is called with a single argument \"test\", we'll\n# also run the RNTester integration test (needs JS and packager):\n# ./objc-test-ios.sh test\n\nSCRIPTS=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\nROOT=$(dirname \"$SCRIPTS\")\n\ncd \"$ROOT\"\n\nSCHEME=\"RNTester\"\nSDK=\"iphonesimulator\"\nDESTINATION=\"platform=iOS Simulator,name=iPhone 5s,OS=10.3.1\"\n\n# If there's a \"test\" argument, pass it to the test script.\n. ./scripts/objc-test.sh $1\n"
  },
  {
    "path": "scripts/objc-test-macos.sh",
    "content": "#!/bin/bash\nset -ex\n\n# Script used to run iOS tests.\n# If not arguments are passed to the script, it will only compile\n# the UIExplorer.\n# If the script is called with a single argument \"test\", we'll\n# also run the UIExplorer integration test (needs JS and packager):\n# ./objc-test-ios.sh test\n\nSCRIPTS=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\nROOT=$(dirname \"$SCRIPTS\")\n\ncd \"$ROOT\"\n\nSCHEME=\"UIExplorer\"\nSDK=\"macosx10.12\"\nDESTINATION=\"platform=OS X,arch=x86_64\"\n\n# If there is a \"test\" argument, pass it to the test script.\n. ./scripts/objc-test.sh $1\n"
  },
  {
    "path": "scripts/objc-test-tvos.sh",
    "content": "#!/bin/bash\nset -ex\n\n# Script used to run tvOS tests.\n# If not arguments are passed to the script, it will only compile\n# the RNTester.\n# If the script is called with a single argument \"test\", we'll\n# also run the RNTester integration test (needs JS and packager):\n# ./objc-test-tvos.sh test\n\nSCRIPTS=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\nROOT=$(dirname \"$SCRIPTS\")\n\ncd \"$ROOT\"\n\nSCHEME=\"RNTester-tvOS\"\nSDK=\"appletvsimulator\"\nDESTINATION=\"platform=tvOS Simulator,name=Apple TV 1080p,OS=10.2\"\n\n# If there's a \"test\" argument, pass it to the test script.\n. ./scripts/objc-test.sh $1\n\n"
  },
  {
    "path": "scripts/objc-test.sh",
    "content": "#!/bin/bash\nset -ex\n\n# Script used to run iOS and tvOS tests.\n# Environment variables are used to configure what test to run.\n# If not arguments are passed to the script, it will only compile\n# the RNTester.\n# If the script is called with a single argument \"test\", we'll\n# also run the RNTester integration test (needs JS and packager).\n# ./objc-test.sh test\n\nSCRIPTS=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\nROOT=$(dirname $SCRIPTS)\n\ncd $ROOT\n\n# Create cleanup handler\nfunction cleanup {\n  EXIT_CODE=$?\n  set +e\n  echo \"EXIT_CODE=$EXIT_CODE\"\n  echo \"SERVER_PID=$SERVER_PID\"\n  if [ $EXIT_CODE -ne 0 ];\n  then\n    WATCHMAN_LOGS=/usr/local/Cellar/watchman/3.1/var/run/watchman/$USER.log\n    [ -f $WATCHMAN_LOGS ] && cat $WATCHMAN_LOGS\n  fi\n  # kill whatever is occupying port 8081 (packager)\n  lsof -i tcp:8081 | awk 'NR!=1 {print $2}' | xargs kill\n  # kill whatever is occupying port 5555 (web socket server)\n  lsof -i tcp:5555 | awk 'NR!=1 {print $2}' | xargs kill\n}\ntrap cleanup EXIT\n\n# Wait for the package to start\nfunction waitForPackager {\n  local -i max_attempts=60\n  local -i attempt_num=1\n\n  until $(curl -s http://localhost:8081/status | grep \"packager-status:running\" -q); do\n    if (( attempt_num == max_attempts )); then\n      echo \"Packager did not respond in time. No more attempts left.\"\n      exit 1\n    else\n      (( attempt_num++ ))\n      echo \"Packager did not respond. Retrying for attempt number $attempt_num...\"\n      sleep 1\n    fi\n  done\n\n  echo \"Packager is ready!\"\n}\n\n# If first argument is \"test\", actually start the packager and run tests.\n# Otherwise, just build RNTester for tvOS and exit\n\nif [ \"$1\" = \"test\" ]; then\n\n# Start the packager\n./scripts/packager.sh --max-workers=1 || echo \"Can't start packager automatically\" &\n# Start the WebSocket test server\nopen \"./IntegrationTests/launchWebSocketServer.command\" || echo \"Can't start web socket server automatically\"\n\nwaitForPackager\n\n# Preload the RNTesterApp bundle for better performance in integration tests\ncurl 'http://localhost:8081/RNTester/js/RNTesterApp.macos.bundle?platform=macos&dev=true' -o temp.bundle\nrm temp.bundle\ncurl 'http://localhost:8081/RNTester/js/RNTesterApp.macos.bundle?platform=macos&dev=true&minify=false' -o temp.bundle\nrm temp.bundle\ncurl 'http://localhost:8081/IntegrationTests/IntegrationTestsApp.bundle?platform=macos&dev=true' -o temp.bundle\nrm temp.bundle\ncurl 'http://localhost:8081/IntegrationTests/RCTRootViewIntegrationTestApp.bundle?platform=macos&dev=true' -o temp.bundle\nrm temp.bundle\n\n# Run tests\n# TODO: We use xcodebuild because xctool would stall when collecting info about\n# the tests before running them. Switch back when this issue with xctool has\n# been resolved.\nxcodebuild \\\n  -project \"RNTester/RNTester.xcodeproj\" \\\n  -scheme $SCHEME \\\n  -configuration Debug \\\n  -sdk $SDK \\\n  -destination \"$DESTINATION\" \\\n  build test\n\nelse\n\n# Don't run tests. No need to pass -destination to xcodebuild.\n# TODO: We use xcodebuild because xctool would stall when collecting info about\n# the tests before running them. Switch back when this issue with xctool has\n# been resolved.\nxcodebuild \\\n  -project \"RNTester/RNTester.xcodeproj\" \\\n  -scheme $SCHEME \\\n  -sdk $SDK \\\n  build\n\nfi\n"
  },
  {
    "path": "scripts/packager.sh",
    "content": "#!/usr/bin/env bash\n\n# Copyright (c) 2015-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\nTHIS_DIR=$(dirname \"$0\")\nsource \"${THIS_DIR}/.packager.env\"\ncd \"$THIS_DIR/..\"\nnode \"./local-cli/cli.js\" start \"$@\"\n"
  },
  {
    "path": "scripts/process-podspecs.sh",
    "content": "#!/bin/bash\nset -ex\n\nSCRIPTS=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\nROOT=$(dirname $SCRIPTS)\n\n# Specify `SPEC_REPO` as an env variable if you want to push to a specific spec repo.\n# Defaults to `react-test`, which is meant to be a dummy repo used to test that the specs fully lint.\n: ${SPEC_REPO:=\"react-test\"}\nSPEC_REPO_DIR=\"$HOME/.cocoapods/repos/$SPEC_REPO\"\n\n# If the `SPEC_REPO` does not exist yet, assume this is purely for testing and create a dummy repo.\nif ! [ -d \"$SPEC_REPO_DIR\" ]; then\n  mkdir -p \"$SPEC_REPO_DIR\"\n  cd \"$SPEC_REPO_DIR\"\n  touch .gitkeep\n  git init\n  git add .\n  git commit -m \"init\"\n  git remote add origin \"https://example.com/$SPEC_REPO.git\"\nfi\n\ncd \"$SPEC_REPO_DIR\"\nSPEC_REPOS=\"$(git remote get-url origin),https://github.com/CocoaPods/Specs.git\"\n\nPOD_LINT_OPT=\"--verbose --allow-warnings --fail-fast --private --swift-version=3.0 --sources=$SPEC_REPOS\"\n\n# Get the version from a podspec.\nversion() {\n  ruby -rcocoapods-core -rjson -e \"puts Pod::Specification.from_file('$1').version\"\n}\n\n# Lint both framework and static library builds.\nlint() {\n  local SUBSPEC=$1\n  if [ \"${SUBSPEC:-}\" ]; then\n    local SUBSPEC_OPT=\"--subspec=$SUBSPEC\"\n  fi\n  pod lib lint $SUBSPEC_OPT $POD_LINT_OPT\n  pod lib lint $SUBSPEC_OPT $POD_LINT_OPT --use-libraries\n}\n\n# Push the spec in arg `$1`, which is expected to be in the cwd, to the `SPEC_REPO` in JSON format.\npush() {\n  local SPEC_NAME=$1\n  local POD_NAME=$(basename $SPEC_NAME .podspec)\n  local SPEC_DIR=\"$SPEC_REPO_DIR/$POD_NAME/$(version $SPEC_NAME)\"\n  local SPEC_PATH=\"$SPEC_DIR/$SPEC_NAME.json\"\n  mkdir -p $SPEC_DIR\n  env INSTALL_YOGA_WITHOUT_PATH_OPTION=1 INSTALL_YOGA_FROM_LOCATION=\"$ROOT\" pod ipc spec $SPEC_NAME > $SPEC_PATH\n}\n\n# Perform linting and publishing of podspec in cwd.\n# Skip linting with `SKIP_LINT` if e.g. publishing to a private spec repo.\nprocess() {\n  cd $1\n  if [ -z \"$SKIP_LINT\" ]; then\n    lint $2\n  fi\n  local SPEC_NAME=(*.podspec)\n  push $SPEC_NAME\n}\n\n# Make third-party deps accessible\ncd \"$ROOT/third-party-podspecs\"\npush Folly.podspec\npush DoubleConversion.podspec\npush GLog.podspec\n\nprocess \"$ROOT/ReactCommon/yoga\"\nprocess \"$ROOT\" _ignore_me_subspec_for_linting_\n"
  },
  {
    "path": "scripts/publish-npm.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\n/**\n * This script publishes a new version of react-native to NPM.\n * It is supposed to run in CI environment, not on a developer's machine.\n *\n * To make it easier for developers it uses some logic to identify with which version to publish the package.\n *\n * To cut a branch (and release RC):\n * - Developer: `git checkout -b 0.XY-stable`\n * - Developer: `git tag v0.XY.0-rc` and `git push --tags` to git@github.com:facebook/react-native.git\n * - CI: test and deploy to npm (run this script) with version 0.XY.0-rc with tag \"next\"\n *\n * To update RC release:\n * - Developer: `git checkout 0.XY-stable`\n * - Developer: cherry-pick whatever changes needed\n * - Developer: `git tag v0.XY.0-rc1` and `git push --tags` to git@github.com:facebook/react-native.git\n * - CI: test and deploy to npm (run this script) with version 0.XY.0-rc1 with tag \"next\"\n *\n * To publish a release:\n * - Developer: `git checkout 0.XY-stable`\n * - Developer: cherry-pick whatever changes needed\n * - Developer: `git tag latest`\n * - Developer: `git tag v0.XY.0`\n * - Developer: `git push --tags` to git@github.com:facebook/react-native.git\n * - CI: test and deploy to npm (run this script) with version 0.XY.0 with and not tag (latest is implied by npm)\n *\n * To patch old release:\n * - Developer: `git checkout 0.XY-stable`\n * - Developer: cherry-pick whatever changes needed\n * - Developer: `git tag v0.XY.Z`\n * - Developer: `git push` to git@github.com:facebook/react-native.git (or merge as pull request)\n * - CI: test and deploy to npm (run this script) with version 0.XY.Z with no tag, npm will not mark it as latest if\n * there is a version higher than XY\n *\n * Important tags:\n * If tag v0.XY.0-rcZ is present on the commit then publish to npm with version 0.XY.0-rcZ and tag next\n * If tag v0.XY.Z is present on the commit then publish to npm with version 0.XY.Z and no tag (npm will consider it latest)\n */\n\n/*eslint-disable no-undef */\nrequire('shelljs/global');\n\nconst buildBranch = process.env.CIRCLE_BRANCH;\n\nlet branchVersion;\nif (buildBranch.indexOf('-stable') !== -1) {\n  branchVersion = buildBranch.slice(0, buildBranch.indexOf('-stable'));\n} else {\n  echo('Error: We publish only from stable branches');\n  exit(0);\n}\n\n// 34c034298dc9cad5a4553964a5a324450fda0385\nconst currentCommit = exec('git rev-parse HEAD', {silent: true}).stdout.trim();\n// [34c034298dc9cad5a4553964a5a324450fda0385, refs/heads/0.33-stable, refs/tags/latest, refs/tags/v0.33.1, refs/tags/v0.34.1-rc]\nconst tagsWithVersion = exec(`git ls-remote origin | grep ${currentCommit}`, {silent: true})\n  .stdout.split(/\\s/)\n  // ['refs/tags/v0.33.0', 'refs/tags/v0.33.0-rc', 'refs/tags/v0.33.0-rc1', 'refs/tags/v0.33.0-rc2', 'refs/tags/v0.34.0']\n  .filter(version => !!version && version.indexOf(`refs/tags/v${branchVersion}`) === 0)\n  // ['refs/tags/v0.33.0', 'refs/tags/v0.33.0-rc', 'refs/tags/v0.33.0-rc1', 'refs/tags/v0.33.0-rc2']\n  .filter(version => version.indexOf(branchVersion) !== -1)\n  // ['v0.33.0', 'v0.33.0-rc', 'v0.33.0-rc1', 'v0.33.0-rc2']\n  .map(version => version.slice('refs/tags/'.length));\n\nif (tagsWithVersion.length === 0) {\n  echo('Error: Can\\'t find version tag in current commit. To deploy to NPM you must add tag v0.XY.Z[-rc] to your commit');\n  exit(1);\n}\nlet releaseVersion;\nif (tagsWithVersion[0].indexOf('-rc') === -1) {\n  // if first tag on this commit is non -rc then we are making a stable release\n  // '0.33.0'\n  releaseVersion = tagsWithVersion[0].slice(1);\n} else {\n  // otherwise pick last -rc tag alphabetically\n  // 0.33.0-rc2\n  releaseVersion = tagsWithVersion[tagsWithVersion.length - 1].slice(1);\n}\n\n// -------- Generating Android Artifacts with JavaDoc\nif (exec('./gradlew :ReactAndroid:installArchives').code) {\n  echo('Couldn\\'t generate artifacts');\n  exit(1);\n}\n\n// undo uncommenting javadoc setting\nexec('git checkout ReactAndroid/gradle.properties');\n\necho('Generated artifacts for Maven');\n\nlet artifacts = ['-javadoc.jar', '-sources.jar', '.aar', '.pom'].map((suffix) => {\n  return `react-native-${releaseVersion}${suffix}`;\n});\n\nartifacts.forEach((name) => {\n  if (!test('-e', `./android/com/facebook/react/react-native/${releaseVersion}/${name}`)) {\n    echo(`file ${name} was not generated`);\n    exit(1);\n  }\n});\n\nif (releaseVersion.indexOf('-rc') === -1) {\n  // release, package will be installed by default\n  exec('npm publish');\n} else {\n  // RC release, package will be installed only if users specifically do it\n  exec('npm publish --tag next');\n}\n\necho(`Published to npm ${releaseVersion}`);\n\nexit(0);\n/*eslint-enable no-undef */\n"
  },
  {
    "path": "scripts/react-native-xcode.sh",
    "content": "#!/bin/bash\n# Copyright (c) 2015-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\n# Bundle React Native app's code and image assets.\n# This script is supposed to be invoked as part of Xcode build process\n# and relies on environment variables (including PWD) set by Xcode\n\nif [[ \"$SKIP_BUNDLING\" ]]; then\n  echo \"SKIP_BUNDLING enabled; skipping.\"\n  exit 0;\nfi\n\ncase \"$CONFIGURATION\" in\n  *Debug*)\n\n    if [[ \"$FORCE_BUNDLING\" ]]; then\n      echo \"FORCE_BUNDLING enabled; continuing to bundle.\"\n    else\n      echo \"Skipping bundling in Debug for the Simulator (since the packager bundles for you). Use the FORCE_BUNDLING flag to change this behavior.\"\n      exit 0;\n    fi\n\n    ;;\n  \"\")\n    echo \"$0 must be invoked by Xcode\"\n    exit 1\n    ;;\n  *)\n    DEV=false\n    ;;\nesac\n\n# Path to react-native folder inside node_modules\nREACT_NATIVE_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")/..\" && pwd)\"\n\n# Xcode project file for React Native apps is located in ios/ subfolder\ncd \"${REACT_NATIVE_DIR}\"/../..\n\n# Define NVM_DIR and source the nvm.sh setup script\n[ -z \"$NVM_DIR\" ] && export NVM_DIR=\"$HOME/.nvm\"\n\n# Define entry file\nif [[ -s \"index.macos.js\" ]]; then\n  ENTRY_FILE=${1:-index.macos.js}\nelse\n  ENTRY_FILE=${1:-index.js}\nfi\n\nif [[ -s \"$HOME/.nvm/nvm.sh\" ]]; then\n  . \"$HOME/.nvm/nvm.sh\"\nelif [[ -x \"$(command -v brew)\" && -s \"$(brew --prefix nvm)/nvm.sh\" ]]; then\n  . \"$(brew --prefix nvm)/nvm.sh\"\nfi\n\n# Set up the nodenv node version manager if present\nif [[ -x \"$HOME/.nodenv/bin/nodenv\" ]]; then\n  eval \"$(\"$HOME/.nodenv/bin/nodenv\" init -)\"\nfi\n\n[ -z \"$NODE_BINARY\" ] && export NODE_BINARY=\"node\"\n\n[ -z \"$CLI_PATH\" ] && export CLI_PATH=\"$REACT_NATIVE_DIR/local-cli/cli.js\"\n\n[ -z \"$BUNDLE_COMMAND\" ] && BUNDLE_COMMAND=\"bundle\"\n\nif [[ -z \"$BUNDLE_CONFIG\" ]]; then\n  CONFIG_ARG=\"\"\nelse\n  CONFIG_ARG=\"--config $(pwd)/$BUNDLE_CONFIG\"\nfi\n\nnodejs_not_found()\n{\n  echo \"error: Can't find '$NODE_BINARY' binary to build React Native bundle\" >&2\n  echo \"If you have non-standard nodejs installation, select your project in Xcode,\" >&2\n  echo \"find 'Build Phases' - 'Bundle React Native code and images'\" >&2\n  echo \"and change NODE_BINARY to absolute path to your node executable\" >&2\n  echo \"(you can find it by invoking 'which node' in the terminal)\" >&2\n  exit 2\n}\n\ntype $NODE_BINARY >/dev/null 2>&1 || nodejs_not_found\n\n# Print commands before executing them (useful for troubleshooting)\nset -x\nDEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\n\nif [[ \"$CONFIGURATION\" = \"Debug\" && ! \"$PLATFORM_NAME\" == *simulator ]]; then\n  PLISTBUDDY='/usr/libexec/PlistBuddy'\n  PLIST=$TARGET_BUILD_DIR/$INFOPLIST_PATH\n  IP=$(ipconfig getifaddr en0)\n  if [ -z \"$IP\" ]; then\n    IP=$(ifconfig | grep 'inet ' | grep -v ' 127.' | cut -d\\   -f2  | awk 'NR==1{print $1}')\n  fi\n\n  if [ -z ${DISABLE_XIP+x} ]; then\n    IP=\"$IP.xip.io\"\n  fi\n\n  $PLISTBUDDY -c \"Add NSAppTransportSecurity:NSExceptionDomains:localhost:NSTemporaryExceptionAllowsInsecureHTTPLoads bool true\" \"$PLIST\"\n  $PLISTBUDDY -c \"Add NSAppTransportSecurity:NSExceptionDomains:$IP:NSTemporaryExceptionAllowsInsecureHTTPLoads bool true\" \"$PLIST\"\n  echo \"$IP\" > \"$DEST/ip.txt\"\nfi\n\nBUNDLE_FILE=\"$DEST/main.jsbundle\"\n\n$NODE_BINARY $CLI_PATH $BUNDLE_COMMAND \\\n  $CONFIG_ARG \\\n  --entry-file \"$ENTRY_FILE\" \\\n  --platform macos \\\n  --dev $DEV \\\n  --reset-cache \\\n  --bundle-output \"$BUNDLE_FILE\" \\\n  --assets-dest \"$DEST\"\n\nif [[ $DEV != true && ! -f \"$BUNDLE_FILE\" ]]; then\n  echo \"error: File $BUNDLE_FILE does not exist. This must be a bug with\" >&2\n  echo \"React Native, please report it here: https://github.com/facebook/react-native/issues\"\n  exit 2\nfi\n"
  },
  {
    "path": "scripts/run-android-ci-instrumentation-tests.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\n/**\n * This script runs instrumentation tests one by one with retries\n * Instrumentation tests tend to be flaky, so rerunning them individually increases\n * chances for success and reduces total average execution time.\n *\n * We assume that all instrumentation tests are flat in one folder\n * Available arguments:\n * --path - path to all .java files with tests\n * --package - com.facebook.react.tests\n * --retries [num] - how many times to retry possible flaky commands: npm install and running tests, default 1\n */\n\nconst {\n   echo,\n   exec,\n   exit,\n   ls,\n} = require('shelljs');\n\nconst argv = require('yargs').argv;\nconst numberOfRetries = argv.retries || 1;\nconst tryExecNTimes = require('./try-n-times');\nconst path = require('path');\n\n// Flaky tests ignored on Circle CI. They still run internally at fb.\nconst ignoredTests = [\n  'ReactScrollViewTestCase',\n  'ReactHorizontalScrollViewTestCase'\n];\n\n// ReactAndroid/src/androidTest/java/com/facebook/react/tests/ReactHorizontalScrollViewTestCase.java\nconst testClasses = ls(`${argv.path}/*.java`)\n.map(javaFile => {\n  // ReactHorizontalScrollViewTestCase\n  return path.basename(javaFile, '.java');\n}).filter(className => {\n  return ignoredTests.indexOf(className) === -1;\n}).map(className => {\n  // com.facebook.react.tests.ReactHorizontalScrollViewTestCase\n  return argv.package + '.' + className;\n});\n\nlet exitCode = 0;\ntestClasses.forEach((testClass) => {\n  if (tryExecNTimes(\n    () => {\n      echo(`Starting ${testClass}`);\n      // any faster means Circle CI crashes\n      exec('sleep 10s');\n      return exec(`./scripts/run-instrumentation-tests-via-adb-shell.sh ${argv.package} ${testClass}`).code;\n    },\n    numberOfRetries)) {\n      echo(`${testClass} failed ${numberOfRetries} times`);\n      exitCode = 1;\n  }\n});\n\nexit(exitCode);\n"
  },
  {
    "path": "scripts/run-android-emulator.sh",
    "content": "#!/bin/bash\n\n# Runs an Android emulator locally.\n# If there already is a running emulator, this just uses that.\n# The only reason to use this config is that it represents a known-good\n# virtual device configuration.\n# This is useful for running integration tests on a local machine.\n# TODO: make continuous integration use the precise same setup\n\nSTATE=`adb get-state`\n\nif [ -n \"$STATE\" ]; then\n    echo \"An emulator is already running.\"\n    exit 1\nfi\n\necho \"Creating virtual device...\"\necho no | android create avd -n testAVD -f -t android-23 --abi default/x86\nemulator -avd testAVD\n"
  },
  {
    "path": "scripts/run-android-local-integration-tests.sh",
    "content": "#!/bin/bash\n\n# Runs all Android integration tests locally.\n# See http://facebook.github.io/react-native/docs/testing.html\n\nsource $(dirname $0)/validate-android-sdk.sh\nsource $(dirname $0)/validate-android-test-env.sh\nsource $(dirname $0)/validate-android-device-env.sh\n\nset -e\n\necho \"Compiling native code...\"\n./gradlew :ReactAndroid:packageReactNdkLibsForBuck\n\necho \"Building JS bundle...\"\nnode local-cli/cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js\n\necho \"Installing test app on the device...\"\nbuck fetch ReactAndroid/src/androidTest/buck-runner:instrumentation-tests\nbuck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests\n\necho \"Running integration tests...\"\n# Use the JS script that runs all tests in a loop and is easy to tweak\nnode ./scripts/run-android-ci-instrumentation-tests.js --path ./ReactAndroid/src/androidTest/java/com/facebook/react/tests --package com.facebook.react.tests\n"
  },
  {
    "path": "scripts/run-android-local-unit-tests.sh",
    "content": "#!/bin/bash\n\n# Runs all Android unit tests locally.\n# See http://facebook.github.io/react-native/docs/testing.html\n\nsource $(dirname $0)/validate-android-sdk.sh\nsource $(dirname $0)/validate-android-test-env.sh\n\nset -e\n\necho \"Fetching dependencies...\"\nbuck fetch ReactAndroid/src/test/...\n\necho \"Running unit tests...\"\nbuck test ReactAndroid/src/test/...\n"
  },
  {
    "path": "scripts/run-ci-e2e-tests.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\n/**\n * This script tests that React Native end to end installation/bootstrap works for different platforms\n * Available arguments:\n * --ios - 'react-native init' and check iOS app doesn't redbox\n * --tvos - 'react-native init' and check tvOS app doesn't redbox\n * --android - 'react-native init' and check Android app doesn't redbox\n * --js - 'react-native init' and only check the packager returns a bundle\n * --skip-cli-install - to skip react-native-cli global installation (for local debugging)\n * --retries [num] - how many times to retry possible flaky commands: npm install and running tests, default 1\n */\n/*eslint-disable no-undef */\nrequire('shelljs/global');\n\nconst spawn = require('child_process').spawn;\nconst argv = require('yargs').argv;\nconst path = require('path');\n\nconst SCRIPTS = __dirname;\nconst ROOT = path.normalize(path.join(__dirname, '..'));\nconst tryExecNTimes = require('./try-n-times');\n\nconst TEMP = exec('mktemp -d /tmp/react-native-macos-XXXXXXXX').stdout.trim();\n// To make sure we actually installed the local version\n// of react-native, we will create a temp file inside the template\n// and check that it exists after `react-native init\nconst MARKER_IOS = exec(`mktemp ${ROOT}/local-cli/templates/HelloWorld/ios/HelloWorld/XXXXXXXX`).stdout.trim();\nconst MARKER_ANDROID = exec(`mktemp ${ROOT}/local-cli/templates/HelloWorld/android/XXXXXXXX`).stdout.trim();\nconst MARKER_MACOS = exec(`mktemp ${ROOT}/local-cli/templates/HelloWorld/macos/HelloWorld/XXXXXXXX`).stdout.trim();\nconst numberOfRetries = argv.retries || 1;\nlet SERVER_PID;\nlet APPIUM_PID;\nlet exitCode;\n\ntry {\n  // install CLI\n  cd('react-native-macos-cli');\n  exec('npm pack');\n  const CLI_PACKAGE = path.join(ROOT, 'react-native-macos-cli', 'react-native-macos-cli-*.tgz');\n  cd('..');\n\n  if (!argv['skip-cli-install']) {\n    if (exec(`npm install -g ${CLI_PACKAGE}`).code) {\n      echo('Could not install react-native-macos-cli globally, please run in su mode');\n      echo('Or with --skip-cli-install to skip this step');\n      exitCode = 1;\n      throw Error(exitCode);\n    }\n  }\n\n  if (argv.android) {\n    if (exec('./gradlew :ReactAndroid:installArchives -Pjobs=1 -Dorg.gradle.jvmargs=\"-Xmx512m -XX:+HeapDumpOnOutOfMemoryError\"').code) {\n      echo('Failed to compile Android binaries');\n      exitCode = 1;\n      throw Error(exitCode);\n    }\n  }\n\n  if (exec('npm pack').code) {\n    echo('Failed to pack react-native-macos');\n    exitCode = 1;\n    throw Error(exitCode);\n  }\n\n  const PACKAGE = path.join(ROOT, 'react-native-macos-*.tgz');\n  cd(TEMP);\n  if (tryExecNTimes(\n    () => {\n      exec('sleep 10s');\n      return exec(`react-native-macos init EndToEndTest --version ${PACKAGE} --npm`).code;\n    },\n    numberOfRetries,\n    () => rm('-rf', 'EndToEndTest'))) {\n      echo('Failed to execute react-native-macos init');\n      echo('Most common reason is npm registry connectivity, try again');\n      exitCode = 1;\n      throw Error(exitCode);\n  }\n\n  cd('EndToEndTest');\n\n  if (argv.android) {\n    echo('Running an Android e2e test');\n    echo('Installing e2e framework');\n    if (tryExecNTimes(\n      () => exec('npm install --save-dev appium@1.5.1 mocha@2.4.5 wd@0.3.11 colors@1.0.3 pretty-data2@0.40.1', { silent: true }).code,\n      numberOfRetries)) {\n        echo('Failed to install appium');\n        echo('Most common reason is npm registry connectivity, try again');\n        exitCode = 1;\n        throw Error(exitCode);\n    }\n    cp(`${SCRIPTS}/android-e2e-test.js`, 'android-e2e-test.js');\n    cd('android');\n    echo('Downloading Maven deps');\n    exec('./gradlew :app:copyDownloadableDepsToLibs');\n    // Make sure we installed local version of react-native\n    if (!test('-e', path.basename(MARKER_ANDROID))) {\n      echo('Android marker was not found, react native init command failed?');\n      exitCode = 1;\n      throw Error(exitCode);\n    }\n    cd('..');\n    exec('keytool -genkey -v -keystore android/keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US\"');\n\n    echo(`Starting appium server, ${APPIUM_PID}`);\n    const appiumProcess = spawn('node', ['./node_modules/.bin/appium']);\n    APPIUM_PID = appiumProcess.pid;\n\n    echo('Building the app');\n    if (exec('buck build android/app').code) {\n      echo('could not execute Buck build, is it installed and in PATH?');\n      exitCode = 1;\n      throw Error(exitCode);\n    }\n\n    echo(`Starting packager server, ${SERVER_PID}`);\n    // shelljs exec('', {async: true}) does not emit stdout events, so we rely on good old spawn\n    const packagerProcess = spawn('npm', ['start', '--', '--max-workers 1'], {\n      env: process.env\n    });\n    SERVER_PID = packagerProcess.pid;\n    // wait a bit to allow packager to startup\n    exec('sleep 15s');\n    echo('Executing android e2e test');\n    if (tryExecNTimes(\n      () => {\n        exec('sleep 10s');\n        return exec('node node_modules/.bin/_mocha android-e2e-test.js').code;\n      },\n      numberOfRetries)) {\n        echo('Failed to run Android e2e tests');\n        echo('Most likely the code is broken');\n        exitCode = 1;\n        throw Error(exitCode);\n    }\n  }\n\n  if (argv.ios || argv.tvos) {\n    var iosTestType = (argv.tvos ? 'tvOS' : 'iOS');\n    echo('Running the ' + iosTestType + 'app');\n    cd('ios');\n    // Make sure we installed local version of react-native\n    if (!test('-e', path.join('EndToEndTest', path.basename(MARKER_IOS)))) {\n      echo('iOS marker was not found, `react-native init` command failed?');\n      exitCode = 1;\n      throw Error(exitCode);\n    }\n    // shelljs exec('', {async: true}) does not emit stdout events, so we rely on good old spawn\n    const packagerEnv = Object.create(process.env);\n    packagerEnv.REACT_NATIVE_MAX_WORKERS = 1;\n    const packagerProcess = spawn('npm', ['start', '--', '--nonPersistent'],\n      {\n        stdio: 'inherit',\n        env: packagerEnv\n      });\n    SERVER_PID = packagerProcess.pid;\n    exec('sleep 15s');\n    // prepare cache to reduce chances of possible red screen \"Can't fibd variable __fbBatchedBridge...\"\n    exec('response=$(curl --write-out %{http_code} --silent --output /dev/null localhost:8081/index.bundle?platform=ios&dev=true)');\n    echo(`Starting packager server, ${SERVER_PID}`);\n    echo('Executing ' + iosTestType + ' e2e test');\n    if (tryExecNTimes(\n      () => {\n        exec('sleep 10s');\n        if (argv.tvos) {\n          return exec('xcodebuild -destination \"platform=tvOS Simulator,name=Apple TV 1080p,OS=10.0\" -scheme EndToEndTest-tvOS -sdk appletvsimulator test | xcpretty && exit ${PIPESTATUS[0]}').code;\n        } else {\n          return exec('xcodebuild -destination \"platform=iOS Simulator,name=iPhone 5s,OS=10.3.1\" -scheme EndToEndTest -sdk iphonesimulator test | xcpretty && exit ${PIPESTATUS[0]}').code;\n        }\n      },\n      numberOfRetries)) {\n        echo('Failed to run ' + iosTestType + ' e2e tests');\n        echo('Most likely the code is broken');\n        exitCode = 1;\n        throw Error(exitCode);\n    }\n    cd('..');\n  }\n\n  if (argv.macos) {\n    var iosTestType = 'macOS';\n    echo('Running the ' + iosTestType + 'app');\n    cd('macos');\n    // Make sure we installed local version of react-native\n    if (!test('-e', path.join('EndToEndTest', path.basename(MARKER_MACOS)))) {\n      echo('macOS marker was not found, `react-native-macos init` command failed?');\n      exitCode = 1;\n      throw Error(exitCode);\n    }\n    // shelljs exec('', {async: true}) does not emit stdout events, so we rely on good old spawn\n    const packagerEnv = Object.create(process.env);\n    packagerEnv.REACT_NATIVE_MAX_WORKERS = 1;\n    const packagerProcess = spawn('npm', ['start', '--', '--nonPersistent'],\n      {\n        stdio: 'inherit',\n        env: packagerEnv\n      });\n    SERVER_PID = packagerProcess.pid;\n    exec('sleep 15s');\n    // prepare cache to reduce chances of possible red screen \"Can't fibd variable __fbBatchedBridge...\"\n    exec('response=$(curl --write-out %{http_code} --silent --output /dev/null localhost:8081/index.macos.bundle?platform=macos&dev=true)');\n    echo(`Starting packager server, ${SERVER_PID}`);\n    echo('Executing ' + iosTestType + ' e2e test');\n    if (tryExecNTimes(\n      () => {\n        exec('sleep 10s');\n        if (argv.tvos) {\n          return exec('xcodebuild -destination \"platform=tvOS Simulator,name=Apple TV 1080p,OS=10.0\" -scheme EndToEndTest-tvOS -sdk appletvsimulator test | xcpretty && exit ${PIPESTATUS[0]}').code;\n        } else {\n          return exec('xcodebuild -destination \"platform=OS X,arch=x86_64\" -scheme EndToEndTest -sdk macosx10.12 test | xcpretty && exit ${PIPESTATUS[0]}').code;\n        }\n      },\n      numberOfRetries)) {\n        echo('Failed to run ' + iosTestType + ' e2e tests');\n        echo('Most likely the code is broken');\n        exitCode = 1;\n        throw Error(exitCode);\n    }\n    cd('..');\n  }\n\n  if (argv.js) {\n    // Check the packager produces a bundle (doesn't throw an error)\n    if (exec('REACT_NATIVE_MAX_WORKERS=1 react-native-macos bundle --platform macos --dev true --entry-file index.macos.js --bundle-output macos-bundle.js').code) {\n      echo('Could not build macOS bundle');\n      exitCode = 1;\n      throw Error(exitCode);\n    }\n    if (exec(`${ROOT}/node_modules/.bin/flow check`).code) {\n      echo('Flow check does not pass');\n      exitCode = 1;\n      throw Error(exitCode);\n    }\n    if (exec('npm test').code) {\n      echo('Jest test failure');\n      exitCode = 1;\n      throw Error(exitCode);\n    }\n  }\n  exitCode = 0;\n\n} finally {\n  cd(ROOT);\n  // rm(MARKER_IOS);\n  // rm(MARKER_ANDROID);\n  rm(MARKER_MACOS);\n\n  if (SERVER_PID) {\n    echo(`Killing packager ${SERVER_PID}`);\n    exec(`kill -9 ${SERVER_PID}`);\n    // this is quite drastic but packager starts a daemon that we can't kill by killing the parent process\n    // it will be fixed in April (quote David Aurelio), so until then we will kill the zombie by the port number\n    exec(\"lsof -i tcp:8081 | awk 'NR!=1 {print $2}' | xargs kill\");\n  }\n  if (APPIUM_PID) {\n    echo(`Killing appium ${APPIUM_PID}`);\n    exec(`kill -9 ${APPIUM_PID}`);\n  }\n}\nexit(exitCode);\n\n/*eslint-enable no-undef */\n"
  },
  {
    "path": "scripts/run-instrumentation-tests-via-adb-shell.sh",
    "content": "#!/bin/bash\n\n# Python script to run instrumentation tests, copied from https://github.com/circleci/circle-dummy-android\n# Example: ./scripts/run-android-instrumentation-tests.sh com.facebook.react.tests com.facebook.react.tests.ReactPickerTestCase\n#\nexport PATH=\"$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH\"\n\n# clear the logs\nadb logcat -c\n\n# run tests and check output\npython - $1 $2 << END\n\nimport re\nimport subprocess as sp\nimport sys\nimport threading\nimport time\n\ndone = False\n\ntest_app = sys.argv[1]\ntest_class = None\n\nif len(sys.argv) > 2:\n  test_class = sys.argv[2]\n  \ndef update():\n  # prevent CircleCI from killing the process for inactivity\n  while not done:\n    time.sleep(5)\n    print \"Running in background.  Waiting for 'adb' command response...\"\n\nt = threading.Thread(target=update)\nt.dameon = True\nt.start()\n\ndef run():\n  sp.Popen(['adb', 'wait-for-device']).communicate()\n  if (test_class != None):\n    p = sp.Popen('adb shell am instrument -w -e class %s %s/android.support.test.runner.AndroidJUnitRunner' \n      % (test_class, test_app), shell=True, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE)\n  else :\n    p = sp.Popen('adb shell am instrument -w %s/android.support.test.runner.AndroidJUnitRunner' \n      % (test_app), shell=True, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE)\n  return p.communicate()\n\nsuccess = re.compile(r'OK \\(\\d+ test(s)?\\)')\nstdout, stderr = run()\n\ndone = True\nprint stderr\nprint stdout\n\nif success.search(stderr + stdout):\n  sys.exit(0)\nelse:\n  # dump the logs\n  sp.Popen(['adb', 'logcat', '-d']).communicate()\n  sys.exit(1) # make sure we fail if the test failed\nEND\n\nRETVAL=$?\n\nexit $RETVAL\n"
  },
  {
    "path": "scripts/sync-css-layout.sh",
    "content": "#!/usr/bin/env bash\n\nfunction usage {\n  echo \"usage: sync-css-layout.sh <pathToGithubRepo> <pathToFbSourceRepo>\";\n}\n\nfunction patchfile {\n  # Add React Native copyright\n  printf \"/**\\n\"  > /tmp/yogasync.tmp\n  printf \" * Copyright (c) 2014-present, Facebook, Inc.\\n\"  >> /tmp/yogasync.tmp\n  printf \" * All rights reserved.\\n\" >> /tmp/yogasync.tmp\n  printf \" * This source code is licensed under the BSD-style license found in the\\n\"  >> /tmp/yogasync.tmp\n  printf \" * LICENSE file in the root directory of this source tree. An additional grant\\n\"  >> /tmp/yogasync.tmp\n  printf \" * of patent rights can be found in the PATENTS file in the same directory.\\n\"  >> /tmp/yogasync.tmp\n  printf \" */\\n\\n\"  >> /tmp/yogasync.tmp\n  printf \"// NOTE: this file is auto-copied from https://github.com/facebook/css-layout\\n\" >> /tmp/yogasync.tmp\n  # The following is split over four lines so Phabricator doesn't think this file is generated\n  printf \"// @g\" >> /tmp/yogasync.tmp\n  printf \"enerated <<S\" >> /tmp/yogasync.tmp\n  printf \"ignedSource::*O*zOeWoEQle#+L\" >> /tmp/yogasync.tmp\n  printf \"!plEphiEmie@IsG>>\\n\\n\" >> /tmp/yogasync.tmp\n  tail -n +9 $1 >> /tmp/yogasync.tmp\n  mv /tmp/yogasync.tmp $1\n  $ROOT/fbandroid/scripts/signedsource.py sign $1\n}\n\nif [ -z $1 ]; then\n  usage\n  exit 1\nfi\n\nif [ -z $2 ]; then\n  usage\n  exit 1\nfi\n\nGITHUB=$1\nROOT=$2\n\nset -e # exit if any command fails\n\necho \"Making github project...\"\npushd $GITHUB\nCOMMIT_ID=$(git rev-parse HEAD)\npopd\n\nC_SRC=$GITHUB/src/\nJAVA_SRC=$GITHUB/src/java/src/com/facebook/yoga\nTESTS=$GITHUB/src/java/tests/com/facebook/yoga\nFBA_SRC=$ROOT/fbandroid/java/com/facebook/catalyst/js/react-native-github/ReactAndroid/src/main/java/com/facebook/yoga/\nFBA_TESTS=$ROOT/fbandroid/javatests/com/facebook/yoga/\nFBO_SRC=$ROOT/fbobjc/Libraries/FBReactKit/js/react-native-github/React/Layout/\n\necho \"Copying fbandroid src files over...\"\ncp $JAVA_SRC/*.java $FBA_SRC\necho \"Copying fbandroid test files over...\"\ncp $TESTS/*.java $FBA_TESTS\necho \"Copying fbobjc src files over...\"\ncp $C_SRC/Layout.{c,h} $FBO_SRC\n\necho \"Patching files...\"\nfor sourcefile in $FBA_SRC/*.java; do\n  patchfile $sourcefile\ndone\nfor testfile in $FBA_TESTS/*.java; do\n  patchfile $testfile\ndone\nfor sourcefile in $FBO_SRC/Layout.{c,h}; do\n  patchfile $sourcefile\ndone\n\necho \"Writing README\"\n\necho \"The source of truth for css-layout is: https://github.com/facebook/css-layout\n\nThe code here should be kept in sync with GitHub.\nHEAD at the time this code was synced: https://github.com/facebook/css-layout/commit/$COMMIT_ID\n\nThere is generated code in:\n - README (this file)\n - fbandroid/java/com/facebook/yoga\n - fbandroid/javatests/com/facebook/yoga\n - fbobjc/Libraries/FBReactKit/js/react-native-github/React/Layout\n\nThe code was generated by running 'make' in the css-layout folder and running:\n\n  scripts/sync-css-layout.sh <pathToGithubRepo> <pathToFbSourceRepo>\n\" > /tmp/yogasync.tmp\n\ncp /tmp/yogasync.tmp \"$FBA_SRC/README\"\ncp /tmp/yogasync.tmp \"$FBO_SRC/README\"\n"
  },
  {
    "path": "scripts/test-manual-e2e.sh",
    "content": "#! /bin/bash\n\nJAVA_VERSION=\"1.7\"\n\nRED=\"\\033[0;31m\"\nGREEN=\"\\033[0;32m\"\nBLUE=\"\\033[0;35m\"\nENDCOLOR=\"\\033[0m\"\n\nerror() {\n    echo -e $RED\"$@\"$ENDCOLOR\n    exit 1\n}\n\nsuccess() {\n    echo -e $GREEN\"$@\"$ENDCOLOR\n}\n\ninfo() {\n    echo -e $BLUE\"$@\"$ENDCOLOR\n}\n\nPACKAGE_VERSION=$(cat package.json \\\n  | grep version \\\n  | head -1 \\\n  | awk -F: '{ print $2 }' \\\n  | sed 's/[\",]//g' \\\n  | tr -d '[[:space:]]')\n\nsuccess \"Preparing version $PACKAGE_VERSION\"\n\nrepo_root=$(pwd)\n\nrm -rf android\n./gradlew :ReactAndroid:installArchives || error \"Couldn't generate artifacts\"\n\nsuccess \"Generated artifacts for Maven\"\n\nnpm install\n\nsuccess \"Killing any running packagers\"\nlsof -i :8081 | grep LISTEN\nlsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill\n\ninfo \"Start the packager in another terminal by running 'npm start' from the root\"\ninfo \"and then press any key.\"\ninfo \"\"\nread -n 1\n\n./gradlew :RNTester:android:app:installDebug || error \"Couln't build RNTester Android\"\n\ninfo \"Press any key to run RNTester in an already running Android emulator/device\"\ninfo \"\"\nread -n 1\nadb shell am start -n com.facebook.react.uiapp/.RNTesterActivity\n\ninfo \"Press any key to open the project in Xcode, then build and test manually.\"\ninfo \"\"\nread -n 1\nopen \"RNTester/RNTester.xcodeproj\"\n\ninfo \"When done testing RNTester app on iOS and Android press any key to continue.\"\ninfo \"\"\nread -n 1\n\nsuccess \"Killing packager\"\nlsof -i :8081 | grep LISTEN\nlsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill\n\nnpm pack\n\nPACKAGE=$(pwd)/react-native-$PACKAGE_VERSION.tgz\nsuccess \"Package bundled ($PACKAGE)\"\n\nproject_name=\"RNTestProject\"\n\ncd /tmp/\nrm -rf \"$project_name\"\nreact-native init \"$project_name\" --version $PACKAGE\n\ninfo \"Double checking the versions in package.json are correct:\"\ngrep \"\\\"react-native\\\": \\\".*react-native-$PACKAGE_VERSION.tgz\\\"\" \"/tmp/${project_name}/package.json\" || error \"Incorrect version number in /tmp/${project_name}/package.json\"\ngrep -E \"com.facebook.react:react-native:\\\\+\" \"${project_name}/android/app/build.gradle\" || error \"Dependency in /tmp/${project_name}/android/app/build.gradle must be com.facebook.react:react-native:+\"\n\nsuccess \"New sample project generated at /tmp/${project_name}\"\n\ninfo \"Test the following on Android:\"\ninfo \"   - Disable Hot Reloading. It might be enabled from last time (the setting is stored on the device)\"\ninfo \"   - Verify 'Reload JS' works\"\ninfo \"\"\ninfo \"Press any key to run the sample in Android emulator/device\"\ninfo \"\"\nread -n 1\ncd \"/tmp/${project_name}\" && react-native run-android\n\ninfo \"Test the following on iOS:\"\ninfo \"   - Disable Hot Reloading. It might be enabled from last time (the setting is stored on the device)\"\ninfo \"   - Verify 'Reload JS' works\"\ninfo \"   - Test Chrome debugger by adding breakpoints and reloading JS. We don't have tests for Chrome debugging.\"\ninfo \"   - Disable Chrome debugging.\"\ninfo \"   - Enable Hot Reloading, change a file (index.js) and save. The UI should refresh.\"\ninfo \"   - Disable Hot Reloading.\"\ninfo \"\"\ninfo \"Press any key to open the project in Xcode\"\ninfo \"\"\nread -n 1\nopen \"/tmp/${project_name}/ios/${project_name}.xcodeproj\"\n\ncd \"$repo_root\"\n\ninfo \"Next steps:\"\ninfo \"   - https://github.com/facebook/react-native/blob/master/Releases.md\"\n"
  },
  {
    "path": "scripts/try-n-times.js",
    "content": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* globals echo:false */\n\n'use strict';\n\n/**\n * Try executing a function n times recursively.\n * Return 0 the first time it succeeds\n * Return code of the last failed commands if not more retries left\n * @funcToRetry - function that gets retried\n * @retriesLeft - number of retries to execute funcToRetry\n * @onEveryError - func to execute if funcToRetry returns non 0\n */\nfunction tryExecNTimes(funcToRetry, retriesLeft, onEveryError) {\n  const exitCode = funcToRetry();\n  if (exitCode === 0) {\n    return exitCode;\n  } else {\n    if (onEveryError) {\n      onEveryError();\n    }\n    retriesLeft--;\n    echo(`Command failed, ${retriesLeft} retries left`);\n    if (retriesLeft === 0) {\n      return exitCode;\n    } else {\n      return tryExecNTimes(funcToRetry, retriesLeft, onEveryError);\n    }\n  }\n}\n\nmodule.exports = tryExecNTimes;\n"
  },
  {
    "path": "scripts/validate-android-device-env.sh",
    "content": "#!/bin/bash\n\n# This script validates that the Android environment is set up to run\n# tests on a device or emulator (as opposed to a plain Java environment).\n\n# This requires that the Android NDK is set up correctly and it also\n# requires that you are currently either running an emulator or have\n# an Android device plugged in.\n\nif [ -z \"$ANDROID_NDK\" ]; then\n  echo \"Error: \\$ANDROID_NDK is not configured.\"\n  echo \"You must first install the Android NDK and then set \\$ANDROID_NDK.\"\n  echo \"If you already installed the Android SDK, well, the NDK is a different thing that you also need to install.\"\n  echo \"See https://facebook.github.io/react-native/docs/android-building-from-source.html for instructions.\"\n  exit 1\nfi\n\nif [ -z \"$(adb get-state)\" ]; then\n  echo \"Error: you must either run an emulator or connect a device.\"\n  echo \"You can check what devices are running with 'adb get-state'.\"\n  echo \"You can run scripts/run-android-emulator.sh to get a known-good emulator config.\"\n  exit 1\nfi\n\nwhile :\ndo\n    BOOTANIM=`adb -e shell getprop init.svc.bootanim`\n    if [ -n `echo $BOOTANIM | grep stopped` ]; then\n        break\n    fi\n    echo \"Waiting for the emulator to finish booting...\"\n    sleep 3\ndone\n"
  },
  {
    "path": "scripts/validate-android-sdk.sh",
    "content": "#!/bin/bash\n\n# This script validates that the Android SDK is installed correctly.\n# This means setting ANDROID_HOME and adding its subdirectories to PATH.\n# If the Android SDK is not installed correctly, this script exits\n# with an error and a helpful message is printed.\n\nif [ -z \"$ANDROID_HOME\" ]; then\n  echo \"Error: \\$ANDROID_HOME is not configured.\"\n  echo \"You must first install the Android SDK and then set \\$ANDROID_HOME.\"\n  echo \"If you already installed the Android SDK, the problem is that you need to export ANDROID_HOME from your .bashrc or equivalent.\"\n  echo \"See https://facebook.github.io/react-native/docs/getting-started.html for instructions.\"\n  exit 1\nfi\n\nif [ ! -d \"$ANDROID_HOME\" ]; then\n  echo \"Error: \\$ANDROID_HOME = $ANDROID_HOME but that directory does not exist.\"\n  echo \"It is possible that you installed then uninstalled the Android SDK.\"\n  echo \"In that case, you should reinstall it.\"\n  echo \"See https://facebook.github.io/react-native/docs/getting-started.html for instructions.\"\n  exit 1\nfi\n\nif [ ! -e \"$ANDROID_HOME/tools/emulator\" ]; then\n  echo \"Error: could not find an emulator at \\$ANDROID_HOME/tools/emulator.\"\n  echo \"Specifically, $ANDROID_HOME/tools/emulator does not exist.\"\n  echo \"This indicates something is borked with your Android SDK install.\"\n  echo \"One possibility is that you have \\$ANDROID_HOME set to the wrong value.\"\n  echo \"If that seems correct, you might want to try reinstalling the Android SDK.\"\n  echo \"See https://facebook.github.io/react-native/docs/getting-started.html for instructions.\"\n  exit 1\nfi\n\nif [ -z `which emulator` ]; then\n  echo \"Error: could not find 'emulator'. Specifically, 'which emulator' was empty.\"\n  echo \"However, the emulator seems to be installed at \\$ANDROID_HOME/tools/emulator already.\"\n  echo \"This means that the problem is that you are not adding \\$ANDROID_HOME/tools to your \\$PATH.\"\n  echo \"You should do that, and then rerun this command.\"\n  echo \"Sorry for not fixing this automatically - we just didn't want to mess with your \\$PATH automatically because that can break things.\"\n  exit 1\nfi\n\nif [ -z `which adb` ]; then\n  echo \"Error: could not find 'adb'. Specifically, 'which adb' was empty.\"\n  echo \"This indicates something is borked with your Android SDK install.\"\n  echo \"The most likely problem is that you are not adding \\$ANDROID_HOME/platform-tools to your \\$PATH.\"\n  echo \"If all else fails, try reinstalling the Android SDK.\"\n  echo \"See https://facebook.github.io/react-native/docs/getting-started.html for instructions.\"\n  exit 1\nfi\n  \n"
  },
  {
    "path": "scripts/validate-android-test-env.sh",
    "content": "#!/bin/bash\n\n# This script validates that Android is set up correctly for the\n# testing environment.\n#\n# In particular, the config in ReactAndroid/build.gradle must match\n# the android sdk that is actually installed. Also, we must have the\n# right version of Java.\n\n# Check that Buck is working.\nif [ -z \"$(which buck)\" ]; then\n  echo \"You need to install Buck.\"\n  echo \"See https://buckbuild.com/setup/install.html for instructions.\"\n  exit 1\nfi\n\nif [ -z \"$(buck --version)\" ]; then\n  echo \"Your Buck install is broken.\"\n\n  if [ -d \"/opt/facebook\" ]; then\n    SUGGESTED=\"b9b76a3a5a086eb440a26d1db9b0731875975099\"\n    echo \"FB laptops ship with a Buck config that is not compatible with open \"\n    echo \"source. FB Buck requires the environment to set a buck version, but \"\n    echo \"the open source version of Buck forbids that.\"\n    echo\n    echo \"You can try setting:\"\n    echo\n    echo \"export BUCKVERSION=${SUGGESTED}\"\n    echo\n    echo \"in your .bashrc or .bash_profile to fix this.\"\n    echo\n    echo \"If you don't want to alter BUCKVERSION for other things running on\"\n    echo \"your machine, you can just scope it to a single script, for example\"\n    echo \"by running something like:\"\n    echo\n    echo \"BUCKVERSION=${SUGGESTED} $0\"\n    echo\n  else\n    echo \"I don't know what's wrong, but calling 'buck --version' should work.\"\n  fi\n  exit 1\nfi\n\n# BUILD_TOOLS_VERSION is in a format like \"23.0.1\"\nBUILD_TOOLS_VERSION=`grep buildToolsVersion $(dirname $0)/../ReactAndroid/build.gradle | sed 's/^[^\"]*\\\"//' | sed 's/\"//'`\n\n# MAJOR is something like \"23\"\nMAJOR=`echo $BUILD_TOOLS_VERSION | sed 's/\\..*//'`\n\n# Check that we have the right major version of the Android SDK.\nPLATFORM_DIR=\"$ANDROID_HOME/platforms/android-$MAJOR\"\nif [ ! -e \"$PLATFORM_DIR\" ]; then\n  echo \"Error: could not find version $ANDROID_VERSION of the Android SDK.\"\n  echo \"Specifically, the directory $PLATFORM_DIR does not exist.\"\n  echo \"You probably need to specify the right version using the SDK Manager from within Android Studio.\"\n  echo \"See https://facebook.github.io/react-native/docs/getting-started.html for details.\"\n  echo \"If you are using Android SDK Tools from the command line, you may need to run:\"\n  echo\n  echo \"  sdkmanager \\\"platform-tools\\\" \\\"platform-tools;android-$MAJOR\\\"\"\n  echo\n  echo \"Check out https://developer.android.com/studio/command-line/sdkmanager.html for details.\"\n  exit 1\nfi\n\n# Check that we have the right version of the build tools.\nBT_DIR=\"$ANDROID_HOME/build-tools/$BUILD_TOOLS_VERSION\"\nif [ ! -e \"$BT_DIR\" ]; then\n  echo \"Error: could not find version $BUILD_TOOLS_VERSION of the Android build tools.\"\n  echo \"Specifically, the directory $BT_DIR does not exist.\"\n  echo \"You probably need to explicitly install the correct version of the Android SDK Build Tools from within Android Studio.\"\n  echo \"See https://facebook.github.io/react-native/docs/getting-started.html for details.\"\n  echo \"If you are using Android SDK Tools from the command line, you may need to run:\"\n  echo\n  echo \"  sdkmanager \\\"platform-tools\\\" \\\"build-tools;android-$BUILD_TOOLS_VERSION\\\"\"\n  echo\n  echo \"Check out https://developer.android.com/studio/command-line/sdkmanager.html for details.\"\n  exit 1\nfi\n\nif [ -n \"$(which csrutil)\" ]; then\n  # This is a SIP-protected machine (recent OSX).\n  # Check that we are not using SIP-protected Java.\n  JAVA=`which java`\n  if [ \"$JAVA\" = \"/usr/bin/java\" ]; then\n    echo \"Error: we can't use this Java version.\"\n    echo \"Currently, Java runs from $JAVA.\"\n    echo \"The operating-system-provided Java doesn't work with React Native because of SIP protection.\"\n    echo \"Please install the Oracle Java Development Kit 8.\"\n    if [ -d \"/opt/facebook\" ]; then\n      echo \"See https://our.intern.facebook.com/intern/dex/installing-java-8/ for instructions on installing Java 8 on FB laptops.\"\n    else\n      echo \"Check out http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html .\"\n      echo \"Be sure that you set JAVA_HOME and PATH correctly in your .bashrc or equivalent. Example:\"\n      echo\n      echo \"  export JAVA_HOME=path/to/java\"\n      echo \"  export PATH=\\$PATH:\\$JAVA_HOME/bin\"\n      echo\n    fi\n    echo \"After installing Java, run 'buck kill' and 'buck clean'.\"\n    exit 1\n  fi\nfi\n  \nif [ -z \"$JAVA_HOME\" ]; then\n  echo \"Error: \\$JAVA_HOME is not configured.\"\n  echo \"Try adding export JAVA_HOME=\\$(/usr/libexec/java_home) to your .bashrc or equivalent.\"\n  echo \"You will also want to add \\$JAVA_HOME/bin to your path.\"\n  exit 1\nfi\n\n\n"
  },
  {
    "path": "scripts/versiontemplates/RCTVersion.h.template",
    "content": "/**\n * @generated by scripts/bump-oss-version.js\n *\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#define RCT_REACT_NATIVE_VERSION @{ \\\n  @\"major\": ${major}, \\\n  @\"minor\": ${minor}, \\\n  @\"patch\": ${patch}, \\\n  @\"prerelease\": ${prerelease}, \\\n}\n"
  },
  {
    "path": "scripts/versiontemplates/ReactNativeVersion.java.template",
    "content": "/**\n * @generated by scripts/bump-oss-version.js\n *\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\npackage com.facebook.react.modules.systeminfo;\n\nimport com.facebook.react.common.MapBuilder;\n\nimport java.util.Map;\n\npublic class ReactNativeVersion {\n  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(\n      \"major\", ${major},\n      \"minor\", ${minor},\n      \"patch\", ${patch},\n      \"prerelease\", ${prerelease});\n}\n"
  },
  {
    "path": "scripts/versiontemplates/ReactNativeVersion.js.template",
    "content": "/**\n * @generated by scripts/bump-oss-version.js\n *\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @flow\n * @providesModule ReactNativeVersion\n */\n\nexports.version = {\n  major: ${major},\n  minor: ${minor},\n  patch: ${patch},\n  prerelease: ${prerelease},\n};\n"
  },
  {
    "path": "settings.gradle",
    "content": "// Copyright 2004-present Facebook. All Rights Reserved.\n\ninclude ':ReactAndroid', ':RNTester:android:app'\n"
  },
  {
    "path": "setupBabel.js",
    "content": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nconst babelRegisterOnly = require('metro/src/babelRegisterOnly');\nconst escapeRegExp = require('lodash/escapeRegExp');\nconst path = require('path');\n\nconst BABEL_ENABLED_PATHS = ['local-cli'];\n\n/**\n * We use absolute paths for matching only the top-level folders reliably. For\n * example, we would not want to match some deeply nested forder that happens to\n * have the same name as one of `BABEL_ENABLED_PATHS`.\n */\nfunction buildRegExps(basePath, dirPaths) {\n  return dirPaths.map(\n    folderPath =>\n      // Babel `only` option works with forward slashes in the RegExp so replace\n      // backslashes for Windows.\n      folderPath instanceof RegExp\n        ? new RegExp(\n            `^${escapeRegExp(\n              path.resolve(basePath, '.').replace(/\\\\/g, '/')\n            )}/${folderPath.source}`,\n            folderPath.flags\n          )\n        : new RegExp(\n            `^${escapeRegExp(\n              path.resolve(basePath, folderPath).replace(/\\\\/g, '/')\n            )}`\n          )\n  );\n}\n\nfunction getOnlyList() {\n  return buildRegExps(__dirname, BABEL_ENABLED_PATHS);\n}\n\n/**\n * Centralized place to register all the directories that need a Babel\n * transformation before being fed to Node.js. Notably, this is necessary to\n * support Flow type annotations.\n */\nfunction setupBabel() {\n  babelRegisterOnly(getOnlyList());\n}\n\nsetupBabel.buildRegExps = buildRegExps;\nsetupBabel.getOnlyList = getOnlyList;\nmodule.exports = setupBabel;\n"
  },
  {
    "path": "third-party-podspecs/DoubleConversion.podspec",
    "content": "Pod::Spec.new do |spec|\n  spec.name = 'DoubleConversion'\n  spec.version = '1.1.5'\n  spec.license = { :type => 'BSD' }\n  spec.homepage = 'https://github.com/google/double-conversion'\n  spec.summary = 'Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles'\n  spec.authors = 'Google'\n  spec.prepare_command = 'mv src double-conversion'\n  spec.source = { :git => 'https://github.com/google/double-conversion.git',\n                  :tag => \"v#{spec.version}\" }\n  spec.module_name = 'DoubleConversion'\n  spec.source_files = 'double-conversion/*.{h,cc}'\n\n  # Pinning to the same version as React.podspec.\n  spec.platforms = { :ios => \"8.0\", :tvos => \"9.2\" }\n\nend\n"
  },
  {
    "path": "third-party-podspecs/Folly.podspec",
    "content": "Pod::Spec.new do |spec|\n  spec.name = 'Folly'\n  spec.version = '2016.09.26.00'\n  spec.license = { :type => 'Apache License, Version 2.0' }\n  spec.homepage = 'https://github.com/facebook/folly'\n  spec.summary = 'An open-source C++ library developed and used at Facebook.'\n  spec.authors = 'Facebook'\n  spec.source = { :git => 'https://github.com/facebook/folly.git',\n                  :tag => \"v#{spec.version}\" }\n  spec.module_name = 'folly'\n  spec.dependency 'boost'\n  spec.dependency 'DoubleConversion'\n  spec.dependency 'GLog'\n  spec.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'\n  spec.source_files = 'folly/Bits.cpp',\n                      'folly/Conv.cpp',\n                      'folly/Demangle.cpp',\n                      'folly/StringBase.cpp',\n                      'folly/Unicode.cpp',\n                      'folly/dynamic.cpp',\n                      'folly/json.cpp',\n                      'folly/portability/BitsFunctexcept.cpp',\n                      'folly/detail/MallocImpl.cpp'\n  # workaround for https://github.com/facebook/react-native/issues/14326\n  spec.preserve_paths = 'folly/*.h',\n                        'folly/detail/*.h',\n                        'folly/portability/*.h'\n  spec.libraries           = \"stdc++\"\n  spec.pod_target_xcconfig = { \"USE_HEADERMAP\" => \"NO\",\n                               \"CLANG_CXX_LANGUAGE_STANDARD\" => \"c++14\",\n                               \"HEADER_SEARCH_PATHS\" => \"\\\"$(PODS_TARGET_SRCROOT)\\\" \\\"$(PODS_ROOT)/boost\\\" \\\"$(PODS_ROOT)/DoubleConversion\\\"\" }\n\n  # Pinning to the same version as React.podspec.\n  spec.platforms = { :ios => \"8.0\", :tvos => \"9.2\" }\nend\n"
  },
  {
    "path": "third-party-podspecs/GLog.podspec",
    "content": "Pod::Spec.new do |spec|\n  spec.name = 'GLog'\n  spec.version = '0.3.4'\n  spec.license = { :type => 'Google', :file => 'COPYING' }\n  spec.homepage = 'https://github.com/google/glog'\n  spec.summary = 'Google logging module'\n  spec.authors = 'Google'\n\n  spec.prepare_command = File.read(\"../scripts/ios-configure-glog.sh\")\n  spec.source = { :git => 'https://github.com/google/glog.git',\n                  :tag => \"v#{spec.version}\" }\n  spec.module_name = 'glog'\n  spec.source_files = 'src/glog/*.h',\n                      'src/demangle.cc',\n                      'src/logging.cc',\n                      'src/raw_logging.cc',\n                      'src/signalhandler.cc',\n                      'src/symbolize.cc',\n                      'src/utilities.cc',\n                      'src/vlog_is_on.cc'\n  # workaround for https://github.com/facebook/react-native/issues/14326\n  spec.preserve_paths = 'src/*.h',\n                        'src/base/*.h'\n  spec.exclude_files       = \"src/windows/**/*\"\n  spec.libraries           = \"stdc++\"\n  spec.pod_target_xcconfig = { \"USE_HEADERMAP\" => \"NO\",\n                               \"HEADER_SEARCH_PATHS\" => \"$(PODS_TARGET_SRCROOT)/src\" }\n\n  # Pinning to the same version as React.podspec.\n  spec.platforms = { :ios => \"8.0\", :tvos => \"9.2\" }\n\nend\n"
  }
]